diff --git a/.gitignore b/.gitignore index f2779a4c..75b4e1e2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ bin-debug/ bin-release/ bin/ -libs/ node_modules/ modules/ .cache/ diff --git a/Cocos/1.x/README.md b/Cocos/1.x/README.md new file mode 100644 index 00000000..c1534c67 --- /dev/null +++ b/Cocos/1.x/README.md @@ -0,0 +1,26 @@ +## How to build +* Clone or download [DragonBonesJS](https://github.com/DragonBones/DragonBonesJS/). +* Install [Node.JS](https://nodejs.org/). +* Open `DragonBonesJS/Cocos/1.x/` in command. +* $ `npm install` +* $ `npm run build` + +## Make sure project structure like this: +``` +Your project + |-- libs + |-- creator.d.ts + |-- node_modules + |-- ... + |-- out + |-- ... + |-- src + |-- ... + |-- ... +``` + +## Notice +You should remove all dragoneBones declaration in creator.d.ts. + +## Creator declaration +[Get creator.d.ts](https://google.com/) \ No newline at end of file diff --git a/Cocos/1.x/libs/.gitkeep b/Cocos/1.x/libs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Cocos/1.x/libs/creator.d.ts b/Cocos/1.x/libs/creator.d.ts new file mode 100644 index 00000000..19921801 --- /dev/null +++ b/Cocos/1.x/libs/creator.d.ts @@ -0,0 +1,20635 @@ + +/** !#en +The main namespace of Cocos2d-JS, all engine core classes, functions, properties and constants are defined in this namespace. +!#zh +Cocos 引擎的主要命名空间,引擎代码中所有的类,函数,属性和常量都在这个命名空间中定义。 */ +declare module cc { + /** The current version of Cocos2d being used.
+ Please DO NOT remove this String, it is an important flag for bug tracking.
+ If you post a bug to forum, please attach this flag. */ + export var ENGINE_VERSION: string; + /** The element contains the game canvas */ + export var container: HTMLDivElement; + /** + !#en Init Debug setting. + !#zh 设置调试模式。 + @param mode mode + */ + export function _initDebugSetting(mode: DebugMode): void; + /** + !#en + Outputs an error message to the Cocos Creator Console (editor) or Web Console (runtime).
+ - In Cocos Creator, error is red.
+ - In Chrome, error have a red icon along with red message text.
+ !#zh + 输出错误消息到 Cocos Creator 编辑器的 Console 或运行时页面端的 Console 中。
+ - 在 Cocos Creator 中,错误信息显示是红色的。
+ - 在 Chrome 中,错误信息有红色的图标以及红色的消息文本。
+ @param msg A JavaScript string containing zero or more substitution strings. + @param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. + */ + export function error(msg: any, ...subst: any[]): void; + /** + !#en + Outputs a warning message to the Cocos Creator Console (editor) or Web Console (runtime). + - In Cocos Creator, warning is yellow. + - In Chrome, warning have a yellow warning icon with the message text. + !#zh + 输出警告消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。
+ - 在 Cocos Creator 中,警告信息显示是黄色的。
+ - 在 Chrome 中,警告信息有着黄色的图标以及黄色的消息文本。
+ @param msg A JavaScript string containing zero or more substitution strings. + @param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. + */ + export function warn(msg: any, ...subst: any[]): void; + /** + !#en Outputs a message to the Cocos Creator Console (editor) or Web Console (runtime). + !#zh 输出一条消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。 + @param msg A JavaScript string containing zero or more substitution strings. + @param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. + */ + export function log(msg: string|any, ...subst: any[]): void; + /** + !#en + Outputs an informational message to the Cocos Creator Console (editor) or Web Console (runtime). + - In Cocos Creator, info is blue. + - In Firefox and Chrome, a small "i" icon is displayed next to these items in the Web Console's log. + !#zh + 输出一条信息消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。 + - 在 Cocos Creator 中,Info 信息显示是蓝色的。
+ - 在 Firefox 和 Chrome 中,Info 信息有着小 “i” 图标。 + @param msg A JavaScript string containing zero or more substitution strings. + @param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. + */ + export function info(msg: any, ...subst: any[]): void; + /** + !#en + Creates the speed action which changes the speed of an action, making it take longer (speed > 1) + or less (speed < 1) time.
+ Useful to simulate 'slow motion' or 'fast forward' effect. + !#zh 修改目标动作的速率。 + @param action action + @param speed speed + + @example + ```js + // change the target action speed; + var action = cc.scaleTo(0.2, 1, 0.6); + var newAction = cc.speed(action, 0.5); + ``` + */ + export function speed(action: ActionInterval, speed: number): Action; + /** + !#en Create a follow action which makes its target follows another node. + !#zh 追踪目标节点的位置。 + @param followedNode followedNode + @param rect rect + + @example + ```js + // example + // creates the action with a set boundary + var followAction = cc.follow(targetNode, cc.rect(0, 0, screenWidth * 2 - 100, screenHeight)); + node.runAction(followAction); + + // creates the action with no boundary set + var followAction = cc.follow(targetNode); + node.runAction(followAction); + ``` + */ + export function follow(followedNode: Node, rect: Rect): Action; + /** + Points setter + @param points points + */ + export function setPoints(points: any[]): void; + /** + !#en Creates an action with a Cardinal Spline array of points and tension. + !#zh 按基数样条曲线轨迹移动到目标位置。 + @param duration duration + @param points array of control points + @param tension tension + + @example + ```js + //create a cc.CardinalSplineTo + var action1 = cc.cardinalSplineTo(3, array, 0); + ``` + */ + export function cardinalSplineTo(duration: number, points: any[], tension: number): ActionInterval; + /** + update position of target + @param newPos newPos + */ + export function updatePosition(newPos: Vec2): void; + /** + !#en Creates an action with a Cardinal Spline array of points and tension. + !#zh 按基数样条曲线轨迹移动指定的距离。 + @param duration duration + @param points points + @param tension tension + */ + export function cardinalSplineBy(duration: number, points: any[], tension: number): ActionInterval; + /** + !#en Creates an action with a Cardinal Spline array of points and tension. + !#zh 按 Catmull Rom 样条曲线轨迹移动到目标位置。 + @param dt dt + @param points points + + @example + ```js + var action1 = cc.catmullRomTo(3, array); + ``` + */ + export function catmullRomTo(dt: number, points: any[]): ActionInterval; + /** + !#en Creates an action with a Cardinal Spline array of points and tension. + !#zh 按 Catmull Rom 样条曲线轨迹移动指定的距离。 + @param dt dt + @param points points + + @example + ```js + var action1 = cc.catmullRomBy(3, array); + ``` + */ + export function catmullRomBy(dt: number, points: any[]): ActionInterval; + /** + !#en + Creates the action easing object with the rate parameter.
+ From slow to fast. + !#zh 创建 easeIn 缓动对象,由慢到快。 + @param rate rate + + @example + ```js + action.easing(cc.easeIn(3.0)); + ``` + */ + export function easeIn(rate: number): any; + /** + !#en + Creates the action easing object with the rate parameter.
+ From fast to slow. + !#zh 创建 easeOut 缓动对象,由快到慢。 + @param rate rate + + @example + ```js + action.easing(cc.easeOut(3.0)); + ``` + */ + export function easeOut(rate: number): any; + /** + !#en + Creates the action easing object with the rate parameter.
+ Slow to fast then to slow. + !#zh 创建 easeInOut 缓动对象,慢到快,然后慢。 + @param rate rate + + @example + ```js + action.easing(cc.easeInOut(3.0)); + ``` + */ + export function easeInOut(rate: number): any; + /** + !#en + Creates the action easing object with the rate parameter.
+ Reference easeInExpo:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeExponentialIn 缓动对象。
+ EaseExponentialIn 是按指数函数缓动进入的动作。
+ 参考 easeInExpo:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeExponentialIn()); + ``` + */ + export function easeExponentialIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutExpo:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeExponentialOut 缓动对象。
+ EaseExponentialOut 是按指数函数缓动退出的动作。
+ 参考 easeOutExpo:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeExponentialOut()); + ``` + */ + export function easeExponentialOut(): any; + /** + !#en + Creates an EaseExponentialInOut action easing object.
+ Reference easeInOutExpo:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeExponentialInOut 缓动对象。
+ EaseExponentialInOut 是按指数函数缓动进入并退出的动作。
+ 参考 easeInOutExpo:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeExponentialInOut()); + ``` + */ + export function easeExponentialInOut(): any; + /** + !#en + Creates an EaseSineIn action.
+ Reference easeInSine:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 EaseSineIn 缓动对象。
+ EaseSineIn 是按正弦函数缓动进入的动作。
+ 参考 easeInSine:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeSineIn()); + ``` + */ + export function easeSineIn(): any; + /** + !#en + Creates an EaseSineOut action easing object.
+ Reference easeOutSine:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 EaseSineOut 缓动对象。
+ EaseSineIn 是按正弦函数缓动退出的动作。
+ 参考 easeOutSine:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeSineOut()); + ``` + */ + export function easeSineOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutSine:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeSineInOut 缓动对象。
+ EaseSineIn 是按正弦函数缓动进入并退出的动作。
+ 参考 easeInOutSine:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeSineInOut()); + ``` + */ + export function easeSineInOut(): any; + /** + !#en + Creates the action easing obejct with the period in radians (default is 0.3).
+ Reference easeInElastic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeElasticIn 缓动对象。
+ EaseElasticIn 是按弹性曲线缓动进入的动作。
+ 参数 easeInElastic:http://www.zhihu.com/question/21981571/answer/19925418 + @param period period + + @example + ```js + // example + action.easing(cc.easeElasticIn(3.0)); + ``` + */ + export function easeElasticIn(period: number): any; + /** + !#en + Creates the action easing object with the period in radians (default is 0.3).
+ Reference easeOutElastic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeElasticOut 缓动对象。
+ EaseElasticOut 是按弹性曲线缓动退出的动作。
+ 参考 easeOutElastic:http://www.zhihu.com/question/21981571/answer/19925418 + @param period period + + @example + ```js + // example + action.easing(cc.easeElasticOut(3.0)); + ``` + */ + export function easeElasticOut(period: number): any; + /** + !#en + Creates the action easing object with the period in radians (default is 0.3).
+ Reference easeInOutElastic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeElasticInOut 缓动对象。
+ EaseElasticInOut 是按弹性曲线缓动进入并退出的动作。
+ 参考 easeInOutElastic:http://www.zhihu.com/question/21981571/answer/19925418 + @param period period + + @example + ```js + // example + action.easing(cc.easeElasticInOut(3.0)); + ``` + */ + export function easeElasticInOut(period: number): any; + /** + !#en + Creates the action easing object.
+ Eased bounce effect at the beginning. + !#zh + 创建 easeBounceIn 缓动对象。
+ EaseBounceIn 是按弹跳动作缓动进入的动作。 + + @example + ```js + // example + action.easing(cc.easeBounceIn()); + ``` + */ + export function easeBounceIn(): any; + /** + !#en + Creates the action easing object.
+ Eased bounce effect at the ending. + !#zh + 创建 easeBounceOut 缓动对象。
+ EaseBounceOut 是按弹跳动作缓动退出的动作。 + + @example + ```js + // example + action.easing(cc.easeBounceOut()); + ``` + */ + export function easeBounceOut(): any; + /** + !#en + Creates the action easing object.
+ Eased bounce effect at the begining and ending. + !#zh + 创建 easeBounceInOut 缓动对象。
+ EaseBounceInOut 是按弹跳动作缓动进入并退出的动作。 + + @example + ```js + // example + action.easing(cc.easeBounceInOut()); + ``` + */ + export function easeBounceInOut(): any; + /** + !#en + Creates the action easing object.
+ In the opposite direction to move slowly, and then accelerated to the right direction. + !#zh + 创建 easeBackIn 缓动对象。
+ easeBackIn 是在相反的方向缓慢移动,然后加速到正确的方向。
+ + @example + ```js + // example + action.easing(cc.easeBackIn()); + ``` + */ + export function easeBackIn(): any; + /** + !#en + Creates the action easing object.
+ Fast moving more than the finish, and then slowly back to the finish. + !#zh + 创建 easeBackOut 缓动对象。
+ easeBackOut 快速移动超出目标,然后慢慢回到目标点。 + + @example + ```js + // example + action.easing(cc.easeBackOut()); + ``` + */ + export function easeBackOut(): any; + /** + !#en + Creates the action easing object.
+ Begining of cc.EaseBackIn. Ending of cc.EaseBackOut. + !#zh + 创建 easeBackInOut 缓动对象。
+ + @example + ```js + // example + action.easing(cc.easeBackInOut()); + ``` + */ + export function easeBackInOut(): any; + /** + !#en + Creates the action easing object.
+ Into the 4 reference point.
+ To calculate the motion curve. + !#zh + 创建 easeBezierAction 缓动对象。
+ EaseBezierAction 是按贝塞尔曲线缓动的动作。 + @param p0 The first bezier parameter + @param p1 The second bezier parameter + @param p2 The third bezier parameter + @param p3 The fourth bezier parameter + + @example + ```js + // example + action.easing(cc.easeBezierAction(0.5, 0.5, 1.0, 1.0)); + ``` + */ + export function easeBezierAction(p0: number, p1: number, p2: number, p3: number): any; + /** + !#en + Creates the action easing object.
+ Reference easeInQuad:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuadraticActionIn 缓动对象。
+ EaseQuadraticIn是按二次函数缓动进入的动作。
+ 参考 easeInQuad:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuadraticActionIn()); + ``` + */ + export function easeQuadraticActionIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutQuad:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuadraticActionOut 缓动对象。
+ EaseQuadraticOut 是按二次函数缓动退出的动作。
+ 参考 easeOutQuad:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuadraticActionOut()); + ``` + */ + export function easeQuadraticActionOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutQuad:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuadraticActionInOut 缓动对象。
+ EaseQuadraticInOut 是按二次函数缓动进入并退出的动作。
+ 参考 easeInOutQuad:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuadraticActionInOut()); + ``` + */ + export function easeQuadraticActionInOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeIntQuart:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuarticActionIn 缓动对象。
+ EaseQuarticIn 是按四次函数缓动进入的动作。
+ 参考 easeIntQuart:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuarticActionIn()); + ``` + */ + export function easeQuarticActionIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutQuart:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuarticActionOut 缓动对象。
+ EaseQuarticOut 是按四次函数缓动退出的动作。
+ 参考 easeOutQuart:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.QuarticActionOut()); + ``` + */ + export function easeQuarticActionOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutQuart:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuarticActionInOut 缓动对象。
+ EaseQuarticInOut 是按四次函数缓动进入并退出的动作。
+ 参考 easeInOutQuart:http://www.zhihu.com/question/21981571/answer/19925418 + */ + export function easeQuarticActionInOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInQuint:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuinticActionIn 缓动对象。
+ EaseQuinticIn 是按五次函数缓动进的动作。
+ 参考 easeInQuint:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuinticActionIn()); + ``` + */ + export function easeQuinticActionIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutQuint:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuinticActionOut 缓动对象。
+ EaseQuinticOut 是按五次函数缓动退出的动作 + 参考 easeOutQuint:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuadraticActionOut()); + ``` + */ + export function easeQuinticActionOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutQuint:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuinticActionInOut 缓动对象。
+ EaseQuinticInOut是按五次函数缓动进入并退出的动作。
+ 参考 easeInOutQuint:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuinticActionInOut()); + ``` + */ + export function easeQuinticActionInOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInCirc:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCircleActionIn 缓动对象。
+ EaseCircleIn是按圆形曲线缓动进入的动作。
+ 参考 easeInCirc:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeCircleActionIn()); + ``` + */ + export function easeCircleActionIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutCirc:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCircleActionOut 缓动对象。
+ EaseCircleOut是按圆形曲线缓动退出的动作。
+ 参考 easeOutCirc:http://www.zhihu.com/question/21981571/answer/19925418 + */ + export function easeCircleActionOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutCirc:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCircleActionInOut 缓动对象。
+ EaseCircleInOut 是按圆形曲线缓动进入并退出的动作。
+ 参考 easeInOutCirc:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeCircleActionInOut()); + ``` + */ + export function easeCircleActionInOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInCubic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCubicActionIn 缓动对象。
+ EaseCubicIn 是按三次函数缓动进入的动作。
+ 参考 easeInCubic:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeCubicActionIn()); + ``` + */ + export function easeCubicActionIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutCubic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCubicActionOut 缓动对象。
+ EaseCubicOut 是按三次函数缓动退出的动作。
+ 参考 easeOutCubic:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeCubicActionOut()); + ``` + */ + export function easeCubicActionOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutCubic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCubicActionInOut 缓动对象。
+ EaseCubicInOut是按三次函数缓动进入并退出的动作。
+ 参考 easeInOutCubic:http://www.zhihu.com/question/21981571/answer/19925418 + */ + export function easeCubicActionInOut(): any; + /** + !#en Show the Node. + !#zh 立即显示。 + + @example + ```js + // example + var showAction = cc.show(); + ``` + */ + export function show(): ActionInstant; + /** + !#en Hide the node. + !#zh 立即隐藏。 + + @example + ```js + // example + var hideAction = cc.hide(); + ``` + */ + export function hide(): ActionInstant; + /** + !#en Toggles the visibility of a node. + !#zh 显隐状态切换。 + + @example + ```js + // example + var toggleVisibilityAction = cc.toggleVisibility(); + ``` + */ + export function toggleVisibility(): ActionInstant; + /** + !#en Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing. + !#zh 从父节点移除自身。 + @param isNeedCleanUp isNeedCleanUp + + @example + ```js + // example + var removeSelfAction = cc.removeSelf(); + ``` + */ + export function removeSelf(isNeedCleanUp ?: boolean): ActionInstant; + /** + !#en Create a FlipX action to flip or unflip the target. + !#zh X轴翻转。 + @param flip Indicate whether the target should be flipped or not + + @example + ```js + var flipXAction = cc.flipX(true); + ``` + */ + export function flipX(flip: boolean): ActionInstant; + /** + !#en Create a FlipY action to flip or unflip the target. + !#zh Y轴翻转。 + @param flip flip + + @example + ```js + var flipYAction = cc.flipY(true); + ``` + */ + export function flipY(flip: boolean): ActionInstant; + /** + !#en Creates a Place action with a position. + !#zh 放置在目标位置。 + @param pos pos + @param y y + + @example + ```js + // example + var placeAction = cc.place(cc.p(200, 200)); + var placeAction = cc.place(200, 200); + ``` + */ + export function place(pos: Vec2|number, y?: number): ActionInstant; + /** + !#en Creates the action with the callback. + !#zh 执行回调函数。 + @param selector selector + @param selectorTarget selectorTarget + @param data data for function, it accepts all data types. + + @example + ```js + // example + // CallFunc without data + var finish = cc.callFunc(this.removeSprite, this); + + // CallFunc with data + var finish = cc.callFunc(this.removeFromParentAndCleanup, this._grossini, true); + ``` + */ + export function callFunc(selector: Function, selectorTarget?: any, data?: any): ActionInstant; + /** + !#en + Helper constructor to create an array of sequenceable actions + The created action will run actions sequentially, one after another. + !#zh 顺序执行动作,创建的动作将按顺序依次运行。 + @param actionOrActionArray actionOrActionArray + @param tempArray tempArray + + @example + ```js + // example + // create sequence with actions + var seq = cc.sequence(act1, act2); + + // create sequence with array + var seq = cc.sequence(actArray); + ``` + */ + export function sequence(actionOrActionArray: FiniteTimeAction|FiniteTimeAction[], ...tempArray: FiniteTimeAction[]): ActionInterval; + /** + !#en Creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30) + !#zh 重复动作,可以按一定次数重复一个动,如果想永远重复一个动作请使用 repeatForever 动作来完成。 + @param action action + @param times times + + @example + ```js + // example + var rep = cc.repeat(cc.sequence(jump2, jump1), 5); + ``` + */ + export function repeat(action: FiniteTimeAction, times: number): ActionInterval; + /** + !#en Create a acton which repeat forever, as it runs forever, it can't be added into cc.sequence and cc.spawn. + !#zh 永远地重复一个动作,有限次数内重复一个动作请使用 repeat 动作,由于这个动作不会停止,所以不能被添加到 cc.sequence 或 cc.spawn 中。 + @param action action + + @example + ```js + // example + var repeat = cc.repeatForever(cc.rotateBy(1.0, 360)); + ``` + */ + export function repeatForever(action: FiniteTimeAction): ActionInterval; + /** + !#en Create a spawn action which runs several actions in parallel. + !#zh 同步执行动作,同步执行一组动作。 + @param actionOrActionArray actionOrActionArray + @param tempArray tempArray + + @example + ```js + // example + var action = cc.spawn(cc.jumpBy(2, cc.p(300, 0), 50, 4), cc.rotateBy(2, 720)); + todo:It should be the direct use new + ``` + */ + export function spawn(actionOrActionArray: FiniteTimeAction|FiniteTimeAction[], ...tempArray: FiniteTimeAction[]): FiniteTimeAction; + /** + !#en + Rotates a Node object to a certain angle by modifying its rotation property.
+ The direction will be decided by the shortest angle. + !#zh 旋转到目标角度,通过逐帧修改它的 rotation 属性,旋转方向将由最短的角度决定。 + @param duration duration in seconds + @param deltaAngleX deltaAngleX in degrees. + @param deltaAngleY deltaAngleY in degrees. + + @example + ```js + // example + var rotateTo = cc.rotateTo(2, 61.0); + ``` + */ + export function rotateTo(duration: number, deltaAngleX: number, deltaAngleY?: number): ActionInterval; + /** + !#en + Rotates a Node object clockwise a number of degrees by modifying its rotation property. + Relative to its properties to modify. + !#zh 旋转指定的角度。 + @param duration duration in seconds + @param deltaAngleX deltaAngleX in degrees + @param deltaAngleY deltaAngleY in degrees + + @example + ```js + // example + var actionBy = cc.rotateBy(2, 360); + ``` + */ + export function rotateBy(duration: number, deltaAngleX: number, deltaAngleY?: number): ActionInterval; + /** + !#en + Moves a Node object x,y pixels by modifying its position property.
+ x and y are relative to the position of the object.
+ Several MoveBy actions can be concurrently called, and the resulting
+ movement will be the sum of individual movements. + !#zh 移动指定的距离。 + @param duration duration in seconds + @param deltaPos deltaPos + @param deltaY deltaY + + @example + ```js + // example + var actionTo = cc.moveBy(2, cc.p(windowSize.width - 40, windowSize.height - 40)); + ``` + */ + export function moveBy(duration: number, deltaPos: Vec2|number, deltaY?: number): ActionInterval; + /** + !#en + Moves a Node object to the position x,y. x and y are absolute coordinates by modifying its position property.
+ Several MoveTo actions can be concurrently called, and the resulting
+ movement will be the sum of individual movements. + !#zh 移动到目标位置。 + @param duration duration in seconds + @param position position + @param y y + + @example + ```js + // example + var actionBy = cc.moveTo(2, cc.p(80, 80)); + ``` + */ + export function moveTo(duration: number, position: Vec2|number, y?: number): ActionInterval; + /** + !#en + Create a action which skews a Node object to given angles by modifying its skewX and skewY properties. + Changes to the specified value. + !#zh 偏斜到目标角度。 + @param t time in seconds + @param sx sx + @param sy sy + + @example + ```js + // example + var actionTo = cc.skewTo(2, 37.2, -37.2); + ``` + */ + export function skewTo(t: number, sx: number, sy: number): ActionInterval; + /** + !#en + Skews a Node object by skewX and skewY degrees.
+ Relative to its property modification. + !#zh 偏斜指定的角度。 + @param t time in seconds + @param sx sx skew in degrees for X axis + @param sy sy skew in degrees for Y axis + + @example + ```js + // example + var actionBy = cc.skewBy(2, 0, -90); + ``` + */ + export function skewBy(t: number, sx: number, sy: number): ActionInterval; + /** + !#en + Moves a Node object simulating a parabolic jump movement by modifying it's position property. + Relative to its movement. + !#zh 用跳跃的方式移动指定的距离。 + @param duration duration + @param position position + @param y y + @param height height + @param jumps jumps + + @example + ```js + // example + var actionBy = cc.jumpBy(2, cc.p(300, 0), 50, 4); + var actionBy = cc.jumpBy(2, 300, 0, 50, 4); + ``` + */ + export function jumpBy(duration: number, position: Vec2|number, y?: number, height?: number, jumps?: number): ActionInterval; + /** + !#en + Moves a Node object to a parabolic position simulating a jump movement by modifying its position property.
+ Jump to the specified location. + !#zh 用跳跃的方式移动到目标位置。 + @param duration duration + @param position position + @param y y + @param height height + @param jumps jumps + + @example + ```js + // example + var actionTo = cc.jumpTo(2, cc.p(300, 300), 50, 4); + var actionTo = cc.jumpTo(2, 300, 300, 50, 4); + ``` + */ + export function jumpTo(duration: number, position: Vec2|number, y?: number, height?: number, jumps?: number): ActionInterval; + /** + !#en + An action that moves the target with a cubic Bezier curve by a certain distance. + Relative to its movement. + !#zh 按贝赛尔曲线轨迹移动指定的距离。 + @param t time in seconds + @param c Array of points + + @example + ```js + // example + var bezier = [cc.p(0, windowSize.height / 2), cc.p(300, -windowSize.height / 2), cc.p(300, 100)]; + var bezierForward = cc.bezierBy(3, bezier); + ``` + */ + export function bezierBy(t: number, c: Vec2[]): ActionInterval; + /** + !#en An action that moves the target with a cubic Bezier curve to a destination point. + !#zh 按贝赛尔曲线轨迹移动到目标位置。 + @param t t + @param c Array of points + + @example + ```js + // example + var bezier = [cc.p(0, windowSize.height / 2), cc.p(300, -windowSize.height / 2), cc.p(300, 100)]; + var bezierTo = cc.bezierTo(2, bezier); + ``` + */ + export function bezierTo(t: number, c: Vec2[]): ActionInterval; + /** + !#en Scales a Node object to a zoom factor by modifying it's scale property. + !#zh 将节点大小缩放到指定的倍数。 + @param duration duration + @param sx scale parameter in X + @param sy scale parameter in Y, if Null equal to sx + + @example + ```js + // example + // It scales to 0.5 in both X and Y. + var actionTo = cc.scaleTo(2, 0.5); + + // It scales to 0.5 in x and 2 in Y + var actionTo = cc.scaleTo(2, 0.5, 2); + ``` + */ + export function scaleTo(duration: number, sx: number, sy?: number): ActionInterval; + /** + !#en + Scales a Node object a zoom factor by modifying it's scale property. + Relative to its changes. + !#zh 按指定的倍数缩放节点大小。 + @param duration duration in seconds + @param sx sx scale parameter in X + @param sy sy scale parameter in Y, if Null equal to sx + + @example + ```js + // example without sy, it scales by 2 both in X and Y + var actionBy = cc.scaleBy(2, 2); + + //example with sy, it scales by 0.25 in X and 4.5 in Y + var actionBy2 = cc.scaleBy(2, 0.25, 4.5); + ``` + */ + export function scaleBy(duration: number, sx: number, sy?: number|void): ActionInterval; + /** + !#en Blinks a Node object by modifying it's visible property. + !#zh 闪烁(基于透明度)。 + @param duration duration in seconds + @param blinks blinks in times + + @example + ```js + // example + var action = cc.blink(2, 10); + ``` + */ + export function blink(duration: number, blinks: number): ActionInterval; + /** + !#en + Fades an object that implements the cc.RGBAProtocol protocol. + It modifies the opacity from the current value to a custom one. + !#zh 修改透明度到指定值。 + @param duration duration + @param opacity 0-255, 0 is transparent + + @example + ```js + // example + var action = cc.fadeTo(1.0, 0); + ``` + */ + export function fadeTo(duration: number, opacity: number): ActionInterval; + /** + !#en Fades In an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 0 to 255. + !#zh 渐显效果。 + @param duration duration in seconds + + @example + ```js + //example + var action = cc.fadeIn(1.0); + ``` + */ + export function fadeIn(duration: number): ActionInterval; + /** + !#en Fades Out an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 255 to 0. + !#zh 渐隐效果。 + @param d duration in seconds + + @example + ```js + // example + var action = cc.fadeOut(1.0); + ``` + */ + export function fadeOut(d: number): ActionInterval; + /** + !#en Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one. + !#zh 修改颜色到指定值。 + @param duration duration + @param red 0-255 + @param green 0-255 + @param blue 0-255 + + @example + ```js + // example + var action = cc.tintTo(2, 255, 0, 255); + ``` + */ + export function tintTo(duration: number, red: number, green: number, blue: number): ActionInterval; + /** + !#en + Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one. + Relative to their own color change. + !#zh 按照指定的增量修改颜色。 + @param duration duration in seconds + @param deltaRed deltaRed + @param deltaGreen deltaGreen + @param deltaBlue deltaBlue + + @example + ```js + // example + var action = cc.tintBy(2, -127, -255, -127); + ``` + */ + export function tintBy(duration: number, deltaRed: number, deltaGreen: number, deltaBlue: number): ActionInterval; + /** + !#en Delays the action a certain amount of seconds. + !#en 延迟指定的时间量。 + @param d duration in seconds + + @example + ```js + // example + var delay = cc.delayTime(1); + ``` + */ + export function delayTime(d: number): ActionInterval; + /** + !#en Executes an action in reverse order, from time=duration to time=0. + !#zh 反转目标动作的时间轴。 + @param action action + + @example + ```js + // example + var reverse = cc.reverseTime(this); + ``` + */ + export function reverseTime(action: FiniteTimeAction): ActionInterval; + /** + !#en Create an action with the specified action and forced target. + !#zh 用已有动作和一个新的目标节点创建动作。 + @param target target + @param action action + */ + export function targetedAction(target: Node, action: FiniteTimeAction): ActionInterval; + /** !#en cc.view is the shared view object. + !#zh cc.view 是全局的视图对象。 */ + export var view: View; + /** !#en Director + !#zh 导演类。 */ + export var director: Director; + /** !#en cc.winSize is the alias object for the size of the current game window. + !#zh cc.winSize 为当前的游戏窗口的大小。 */ + export var winSize: Size; + export var game: Game; + /** !#en The System event singleton for global usage + !#zh 系统事件单例,方便全局使用 */ + export var systemEvent: SystemEvent; + /** + + @param touches touches + */ + export function handleTouchesBegin(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesMove(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesEnd(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesCancel(touches: any[]): void; + /** + + @param touches touches + */ + export function getSetOfTouchesEndOrCancel(touches: any[]): any[]; + /** + + @param element element + */ + export function getHTMLElementPosition(element: HTMLElement): any; + /** + + @param touch touch + */ + export function getPreTouch(touch: Touch): Touch; + /** + + @param touch touch + */ + export function setPreTouch(touch: Touch): void; + /** + + @param tx tx + @param ty ty + @param pos pos + */ + export function getTouchByXY(tx: number, ty: number, pos: Vec2): Touch; + /** + + @param event event + @param pos pos + */ + export function getPointByEvent(event: Touch, pos: Vec2): Vec2; + /** + + @param event event + @param pos pos + */ + export function getTouchesByEvent(event: Touch, pos: Vec2): any[]; + /** + + @param element element + */ + export function registerSystemEvent(element: HTMLElement): void; + /** + !#en Defines a CCClass using the given specification, please see [Class](/docs/editors_and_tools/creator-chapters/scripting/class.html) for details. + !#zh 定义一个 CCClass,传入参数必须是一个包含类型参数的字面量对象,具体用法请查阅[类型定义](/docs/creator/scripting/class.html)。 + @param options options + + @example + ```js + // define base class + var Node = cc.Class(); + + // define sub class + var Sprite = cc.Class({ + name: 'Sprite', + extends: Node, + ctor: function () { + this.url = ""; + this.id = 0; + }, + + statics: { + // define static members + count: 0, + getBounds: function (spriteList) { + // compute bounds... + } + }, + + properties { + width: { + default: 128, + type: 'Integer', + tooltip: 'The width of sprite' + }, + height: 128, + size: { + get: function () { + return cc.v2(this.width, this.height); + } + } + }, + + load: function () { + // load this.url... + }; + }); + + // instantiate + + var obj = new Sprite(); + obj.url = 'sprite.png'; + obj.load(); + ``` + */ + export function Class(options?: {name?: string; extends?: Function; ctor?: Function; __ctor__?: Function; properties?: any; statics?: any; mixins?: Function[]; editor?: {executeInEditMode?: boolean; requireComponent?: Function; menu?: string; executionOrder?: number; disallowMultiple?: boolean; playOnFocus?: boolean; inspector?: string; icon?: string; help?: string; }; update?: Function; lateUpdate?: Function; onLoad?: Function; start?: Function; onEnable?: Function; onDisable?: Function; onDestroy?: Function; onFocusInEditor?: Function; onLostFocusInEditor?: Function; resetInEditor?: Function; onRestore?: Function; _getLocalBounds?: Function; }): Function; + /** + Checks whether subclass is child of superclass or equals to superclass + @param subclass subclass + @param superclass superclass + */ + export function isChildClassOf(subclass: Function, superclass: Function): boolean; + /** + Return all super classes + @param constructor constructor + */ + export function getInheritanceChain(constructor: Function): Function[]; + /** + !#en + Define an enum type.
+ If a enum item has a value of -1, it will be given an Integer number according to it's order in the list.
+ Otherwise it will use the value specified by user who writes the enum definition. + + !#zh + 定义一个枚举类型。
+ 用户可以把枚举值设为任意的整数,如果设为 -1,系统将会分配为上一个枚举值 + 1。 + @param obj a JavaScript literal object containing enum names and values, or a TypeScript enum type + + @example + ```js + // JavaScript: + + var WrapMode = cc.Enum({ + Repeat: -1, + Clamp: -1 + }); + + // Texture.WrapMode.Repeat == 0 + // Texture.WrapMode.Clamp == 1 + // Texture.WrapMode[0] == "Repeat" + // Texture.WrapMode[1] == "Clamp" + + var FlagType = cc.Enum({ + Flag1: 1, + Flag2: 2, + Flag3: 4, + Flag4: 8, + }); + + var AtlasSizeList = cc.Enum({ + 128: 128, + 256: 256, + 512: 512, + 1024: 1024, + }); + + // TypeScript: + + // If used in TypeScript, just define a TypeScript enum: + enum Direction { + Up, + Down, + Left, + Right + } + + // If you need to inspect the enum in Properties panel, you can call cc.Enum: + const {ccclass, property} = cc._decorator; + + @ccclass + class NewScript extends cc.Component { + @property({ + default: Direction.Up, + type: cc.Enum(Direction) // call cc.Enum + }) + direction: Direction = Direction.Up; + } + + ``` + */ + export function Enum(obj: T): T; + /** + whether enable accelerometer event + @param isEnable isEnable + */ + export function setAccelerometerEnabled(isEnable: boolean): void; + /** + set accelerometer interval value + @param interval interval + */ + export function setAccelerometerInterval(interval: number): void; + /** + + @param touches touches + */ + export function handleTouchesBegin(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesMove(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesEnd(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesCancel(touches: any[]): void; + /** + + @param touches touches + */ + export function getSetOfTouchesEndOrCancel(touches: any[]): any[]; + /** + + @param element element + */ + export function getHTMLElementPosition(element: HTMLElement): any; + /** + + @param touch touch + */ + export function getPreTouch(touch: Touch): Touch; + /** + + @param touch touch + */ + export function setPreTouch(touch: Touch): void; + /** + + @param tx tx + @param ty ty + @param pos pos + */ + export function getTouchByXY(tx: number, ty: number, pos: Vec2): Touch; + /** + + @param location location + @param pos pos + @param eventType eventType + */ + export function getTouchByXY(location: Vec2, pos: Vec2, eventType: number): Event.EventMouse; + /** + + @param event event + @param pos pos + */ + export function getPointByEvent(event: Touch, pos: Vec2): Vec2; + /** + + @param event event + @param pos pos + */ + export function getTouchesByEvent(event: Touch, pos: Vec2): any[]; + /** + + @param element element + */ + export function registerSystemEvent(element: HTMLElement): void; + /** + + @param dt dt + */ + export function update(dt: number): void; + /** +

+ Linear interpolation between 2 numbers, the ratio sets how much it is biased to each end +

+ @param a number A + @param b number B + @param r ratio between 0 and 1 + + @example + ```js + ---- + lerp + cc.lerp(2,10,0.5)//returns 6 + cc.lerp(2,10,0.2)//returns 3.6 + + ``` + */ + export function lerp(a: number, b: number, r: number): void; + /** + get a random number from 0 to 0xffffff + */ + export function rand(): number; + /** + returns a random float between -1 and 1 + */ + export function randomMinus1To1(): number; + /** + returns a random float between 0 and 1, use Math.random directly + */ + export function random0To1(): number; + /** + converts degrees to radians + @param angle angle + */ + export function degreesToRadians(angle: number): number; + /** + converts radians to degrees + @param angle angle + */ + export function radiansToDegrees(angle: number): number; + /** + Helpful macro that setups the GL server state, the correct GL program and sets the Model View Projection matrix + @param node setup node + */ + export function nodeDrawSetup(node: Node): void; + /** +

+ Increments the GL Draws counts by one.
+ The number of calls per frame are displayed on the screen when the CCDirector's stats are enabled.
+

+ @param addNumber addNumber + */ + export function incrementGLDraws(addNumber: number): void; + /** + Check webgl error.Error will be shown in console if exists. + */ + export function checkGLErrorDebug(): void; + /** + !#en + Checks whether the object is non-nil and not yet destroyed.
+ When an object's `destroy` is called, it is actually destroyed after the end of this frame. + So `isValid` will return false from the next frame, while `isValid` in the current frame will still be true. + If you want to determine whether the current frame has called `destroy`, use `cc.isValid(obj, true)`, + but this is often caused by a particular logical requirements, which is not normally required. + + !#zh + 检查该对象是否不为 null 并且尚未销毁。
+ 当一个对象的 `destroy` 调用以后,会在这一帧结束后才真正销毁。因此从下一帧开始 `isValid` 就会返回 false,而当前帧内 `isValid` 仍然会是 true。如果希望判断当前帧是否调用过 `destroy`,请使用 `cc.isValid(obj, true)`,不过这往往是特殊的业务需求引起的,通常情况下不需要这样。 + @param value value + @param strictMode If true, Object called destroy() in this frame will also treated as invalid. + + @example + ```js + var node = new cc.Node(); + cc.log(cc.isValid(node)); // true + node.destroy(); + cc.log(cc.isValid(node)); // true, still valid in this frame + // after a frame... + cc.log(cc.isValid(node)); // false, destroyed in the end of last frame + ``` + */ + export function isValid(value: any, strictMode?: boolean): boolean; + /** Specify that the input value must be integer in Inspector. + Also used to indicates that the elements in array should be type integer. */ + export var Integer: string; + /** Indicates that the elements in array should be type double. */ + export var Float: string; + /** Indicates that the elements in array should be type boolean. */ + export var Boolean: string; + /** Indicates that the elements in array should be type string. */ + export var String: string; + /** + !#en Deserialize json to cc.Asset + !#zh 将 JSON 反序列化为对象实例。 + + 当指定了 target 选项时,如果 target 引用的其它 asset 的 uuid 不变,则不会改变 target 对 asset 的引用, + 也不会将 uuid 保存到 result 对象中。 + @param data the serialized cc.Asset json string or json object. + @param details additional loading result + @param options options + */ + export function deserialize(data: string|any, details?: Details, options?: any): any; + /** + !#en Clones the object `original` and returns the clone, or instantiate a node from the Prefab. + !#zh 克隆指定的任意类型的对象,或者从 Prefab 实例化出新节点。 + + (Instantiate 时,function 和 dom 等非可序列化对象会直接保留原有引用,Asset 会直接进行浅拷贝,可序列化类型会进行深拷贝。) + @param original An existing object that you want to make a copy of. + + @example + ```js + // instantiate node from prefab + var scene = cc.director.getScene(); + var node = cc.instantiate(prefabAsset); + node.parent = scene; + // clone node + var scene = cc.director.getScene(); + var node = cc.instantiate(targetNode); + node.parent = scene; + ``` + */ + export function instantiate(original: Prefab): Node; + export function instantiate(original: T): T; + /** + Finds a node by hierarchy path, the path is case-sensitive. + It will traverse the hierarchy by splitting the path using '/' character. + This function will still returns the node even if it is inactive. + It is recommended to not use this function every frame instead cache the result at startup. + @param path path + @param referenceNode referenceNode + */ + export function find(path: string, referenceNode?: Node): Node; + /** + !#en + The convenience method to create a new {{#crossLink "Color/Color:method"}}cc.Color{{/crossLink}} + Alpha channel is optional. Default value is 255. + + !#zh + 通过该方法来创建一个新的 {{#crossLink "Color/Color:method"}}cc.Color{{/crossLink}} 对象。 + Alpha 通道是可选的。默认值是 255。 + @param r r + @param g g + @param b b + @param a a + + @example + ```js + ----------------------- + // 1. All channels seperately as parameters + var color1 = new cc.Color(255, 255, 255, 255); + // 2. Convert a hex string to a color + var color2 = new cc.Color("#000000"); + // 3. An color object as parameter + var color3 = new cc.Color({r: 255, g: 255, b: 255, a: 255}); + + ``` + */ + export function color(r?: number, g?: number, b?: number, a?: number): Color; + /** + !#en returns true if both ccColor3B are equal. Otherwise it returns false. + !#zh 判断两个颜色对象的 RGB 部分是否相等,不比较透明度。 + @param color1 color1 + @param color2 color2 + + @example + ```js + cc.log(cc.colorEqual(cc.Color.RED, new cc.Color(255, 0, 0))); // true + ``` + */ + export function colorEqual(color1: Color, color2: Color): boolean; + /** + !#en + convert a string of color for style to Color. + e.g. "#ff06ff" to : cc.color(255,6,255)。 + !#zh 16 进制转换为 Color + @param hex hex + + @example + ```js + cc.hexToColor("#FFFF33"); // Color {r: 255, g: 255, b: 51, a: 255}; + ``` + */ + export function hexToColor(hex: string): Color; + /** + !#en + convert Color to a string of color for style. + e.g. cc.color(255,6,255) to : "#ff06ff" + !#zh Color 转换为 16进制。 + @param color color + + @example + ```js + var color = new cc.Color(255, 6, 255) + cc.colorToHex(color); // #ff06ff; + ``` + */ + export function colorToHex(color: Color): string; + /** + !#en Returns opposite of Vec2. + !#zh 返回相反的向量。 + @param point point + + @example + ```js + cc.pNeg(cc.v2(10, 10));// Vec2 {x: -10, y: -10}; + ``` + */ + export function pNeg(point: Vec2): Vec2; + /** + !#en Calculates sum of two points. + !#zh 返回两个向量的和。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.pAdd(cc.v2(1, 1), cc.v2(2, 2));// Vec2 {x: 3, y: 3}; + ``` + */ + export function pAdd(v1: Vec2, v2: Vec2): Vec2; + /** + !#en Calculates difference of two points. + !#zh 返回两个向量的差。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.pSub(cc.v2(20, 20), cc.v2(5, 5)); // Vec2 {x: 15, y: 15}; + ``` + */ + export function pSub(v1: Vec2, v2: Vec2): Vec2; + /** + !#en Returns point multiplied by given factor. + !#zh 向量缩放。 + @param point point + @param floatVar floatVar + + @example + ```js + cc.pMult(cc.v2(5, 5), 4); // Vec2 {x: 20, y: 20}; + ``` + */ + export function pMult(point: Vec2, floatVar: number): Vec2; + /** + !#en Calculates midpoint between two points. + !#zh 两个向量之间的中心点。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.pMidpoint(cc.v2(10, 10), cc.v2(5, 5)); // Vec2 {x: 7.5, y: 7.5}; + ``` + */ + export function pMidpoint(v1: Vec2, v2: Vec2): Vec2; + /** + !#en Calculates dot product of two points. + !#zh 两个向量之间进行点乘。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.pDot(cc.v2(20, 20), cc.v2(5, 5)); // 200; + ``` + */ + export function pDot(v1: Vec2, v2: Vec2): number; + /** + !#en Calculates cross product of two points. + !#zh 两个向量之间进行叉乘。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.pCross(cc.v2(20, 20), cc.v2(5, 5)); // 0; + ``` + */ + export function pCross(v1: Vec2, v2: Vec2): number; + /** + !#en Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) greater than 0. + !#zh 返回逆时针旋转 90 度后的新向量。 + @param point point + + @example + ```js + cc.pPerp(cc.v2(20, 20)); // Vec2 {x: -20, y: 20}; + ``` + */ + export function pPerp(point: Vec2): Vec2; + /** + !#en Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) smaller than 0. + !#zh 将指定向量顺时针旋转 90 度并返回。 + @param point point + + @example + ```js + cc.pRPerp(cc.v2(20, 20)); // Vec2 {x: 20, y: -20}; + ``` + */ + export function pRPerp(point: Vec2): Vec2; + /** + !#en Calculates the projection of v1 over v2. + !#zh 返回 v1 在 v2 上的投影向量。 + @param v1 v1 + @param v2 v2 + + @example + ```js + var v1 = cc.v2(20, 20); + var v2 = cc.v2(5, 5); + cc.pProject(v1, v2); // Vec2 {x: 20, y: 20}; + ``` + */ + export function pProject(v1: Vec2, v2: Vec2): Vec2; + /** + !#en Calculates the square length of a cc.Vec2 (not calling sqrt() ). + !#zh 返回指定向量长度的平方。 + @param v v + + @example + ```js + cc.pLengthSQ(cc.v2(20, 20)); // 800; + ``` + */ + export function pLengthSQ(v: Vec2): number; + /** + !#en Calculates the square distance between two points (not calling sqrt() ). + !#zh 返回两个点之间距离的平方。 + @param point1 point1 + @param point2 point2 + + @example + ```js + var point1 = cc.v2(20, 20); + var point2 = cc.v2(5, 5); + cc.pDistanceSQ(point1, point2); // 450; + ``` + */ + export function pDistanceSQ(point1: Vec2, point2: Vec2): number; + /** + !#en Calculates distance between point an origin. + !#zh 返回指定向量的长度. + @param v v + + @example + ```js + cc.pLength(cc.v2(20, 20)); // 28.284271247461902; + ``` + */ + export function pLength(v: Vec2): number; + /** + !#en Calculates the distance between two points. + !#zh 返回指定 2 个向量之间的距离。 + @param v1 v1 + @param v2 v2 + + @example + ```js + var v1 = cc.v2(20, 20); + var v2 = cc.v2(5, 5); + cc.pDistance(v1, v2); // 21.213203435596427; + ``` + */ + export function pDistance(v1: Vec2, v2: Vec2): number; + /** + !#en Returns this vector with a magnitude of 1. + !#zh 返回一个长度为 1 的标准化过后的向量。 + @param v v + + @example + ```js + cc.pNormalize(cc.v2(20, 20)); // Vec2 {x: 0.7071067811865475, y: 0.7071067811865475}; + ``` + */ + export function pNormalize(v: Vec2): Vec2; + /** + !#en Converts radians to a normalized vector. + !#zh 将弧度转换为一个标准化后的向量,返回坐标 x = cos(a) , y = sin(a)。 + @param a a + + @example + ```js + cc.pForAngle(20); // Vec2 {x: 0.40808206181339196, y: 0.9129452507276277}; + ``` + */ + export function pForAngle(a: number): Vec2; + /** + !#en Converts a vector to radians. + !#zh 返回指定向量的弧度。 + @param v v + + @example + ```js + cc.pToAngle(cc.v2(20, 20)); // 0.7853981633974483; + ``` + */ + export function pToAngle(v: Vec2): number; + /** + !#en Clamp a value between from and to. + !#zh + 限定浮点数的最大最小值。
+ 数值大于 max_inclusive 则返回 max_inclusive。
+ 数值小于 min_inclusive 则返回 min_inclusive。
+ 否则返回自身。 + @param value value + @param min_inclusive min_inclusive + @param max_inclusive max_inclusive + + @example + ```js + var v1 = cc.clampf(20, 0, 20); // 20; + var v2 = cc.clampf(-1, 0, 20); // 0; + var v3 = cc.clampf(10, 0, 20); // 10; + ``` + */ + export function clampf(value: number, min_inclusive: number, max_inclusive: number): number; + /** + !#en Clamp a value between 0 and 1. + !#zh 限定浮点数的取值范围为 0 ~ 1 之间。 + @param value value + + @example + ```js + var v1 = cc.clampf(20); // 1; + var v2 = cc.clampf(-1); // 0; + var v3 = cc.clampf(0.5); // 0.5; + ``` + */ + export function clamp01(value: number): number; + /** + !#en Clamp a point between from and to. + !#zh + 返回指定限制区域后的向量。
+ 向量大于 max_inclusive 则返回 max_inclusive。
+ 向量小于 min_inclusive 则返回 min_inclusive。
+ 否则返回自身。 + @param p p + @param min_inclusive min_inclusive + @param max_inclusive max_inclusive + + @example + ```js + var min_inclusive = cc.v2(0, 0); + var max_inclusive = cc.v2(20, 20); + var v1 = cc.pClamp(cc.v2(20, 20), min_inclusive, max_inclusive); // Vec2 {x: 20, y: 20}; + var v2 = cc.pClamp(cc.v2(0, 0), min_inclusive, max_inclusive); // Vec2 {x: 0, y: 0}; + var v3 = cc.pClamp(cc.v2(10, 10), min_inclusive, max_inclusive); // Vec2 {x: 10, y: 10}; + ``` + */ + export function pClamp(p: Vec2, min_inclusive: Vec2, max_inclusive: Vec2): Vec2; + /** + !#en Quickly convert cc.Size to a cc.Vec2. + !#zh 快速转换 cc.Size 为 cc.Vec2。 + @param s s + + @example + ```js + cc.pFromSize(new cc.size(20, 20)); // Vec2 {x: 20, y: 20}; + ``` + */ + export function pFromSize(s: Size): Vec2; + /** + !#en + Run a math operation function on each point component
+ Math.abs, Math.fllor, Math.ceil, Math.round. + !#zh 通过运行指定的数学运算函数来计算指定的向量。 + @param p p + @param opFunc opFunc + + @example + ```js + cc.pCompOp(cc.p(-10, -10), Math.abs); // Vec2 {x: 10, y: 10}; + ``` + */ + export function pCompOp(p: Vec2, opFunc: Function): Vec2; + /** + !#en + Linear Interpolation between two points a and b.
+ alpha == 0 ? a
+ alpha == 1 ? b
+ otherwise a value between a..b. + !#zh + 两个点 A 和 B 之间的线性插值。
+ alpha == 0 ? a
+ alpha == 1 ? b
+ 否则这个数值在 a ~ b 之间。 + @param a a + @param b b + @param alpha alpha + + @example + ```js + cc.pLerp(cc.v2(20, 20), cc.v2(5, 5), 0.5); // Vec2 {x: 12.5, y: 12.5}; + ``` + */ + export function pLerp(a: Vec2, b: Vec2, alpha: number): Vec2; + /** + !#en TODO + !#zh + 近似判断两个点是否相等。
+ 判断 2 个向量是否在指定数值的范围之内,如果在则返回 true,反之则返回 false。 + @param a a + @param b b + @param variance variance + + @example + ```js + var a = cc.v2(20, 20); + var b = cc.v2(5, 5); + var b1 = cc.pFuzzyEqual(a, b, 10); // false; + var b2 = cc.pFuzzyEqual(a, b, 18); // true; + ``` + */ + export function pFuzzyEqual(a: Vec2, b: Vec2, variance: number): boolean; + /** + !#en Multiplies a nd b components, a.x*b.x, a.y*b.y. + !#zh 计算两个向量的每个分量的乘积, a.x * b.x, a.y * b.y。 + @param a a + @param b b + + @example + ```js + cc.pCompMult(acc.v2(20, 20), cc.v2(5, 5)); // Vec2 {x: 100, y: 100}; + ``` + */ + export function pCompMult(a: Vec2, b: Vec2): Vec2; + /** + !#en TODO + !#zh 返回两个向量之间带正负号的弧度。 + @param a a + @param b b + */ + export function pAngleSigned(a: Vec2, b: Vec2): number; + /** + !#en TODO + !#zh 获取当前向量与指定向量之间的弧度角。 + @param a a + @param b b + */ + export function pAngle(a: Vec2, b: Vec2): number; + /** + !#en Rotates a point counter clockwise by the angle around a pivot. + !#zh 返回给定向量围绕指定轴心顺时针旋转一定弧度后的结果。 + @param v v is the point to rotate + @param pivot pivot is the pivot, naturally + @param angle angle is the angle of rotation cw in radians + */ + export function pRotateByAngle(v: Vec2, pivot: Vec2, angle: number): Vec2; + /** + !#en + A general line-line intersection test + indicating successful intersection of a line
+ note that to truly test intersection for segments we have to make
+ sure that s & t lie within [0..1] and for rays, make sure s & t > 0
+ the hit point is p3 + t * (p4 - p3);
+ the hit point also is p1 + s * (p2 - p1); + !#zh + 返回 A 为起点 B 为终点线段 1 所在直线和 C 为起点 D 为终点线段 2 所在的直线是否相交,
+ 如果相交返回 true,反之则为 false,参数 retP 是返回交点在线段 1、线段 2 上的比例。 + @param A A is the startpoint for the first line P1 = (p1 - p2). + @param B B is the endpoint for the first line P1 = (p1 - p2). + @param C C is the startpoint for the second line P2 = (p3 - p4). + @param D D is the endpoint for the second line P2 = (p3 - p4). + @param retP retP.x is the range for a hitpoint in P1 (pa = p1 + s*(p2 - p1)),
+ retP.y is the range for a hitpoint in P3 (pa = p2 + t*(p4 - p3)). + */ + export function pLineIntersect(A: Vec2, B: Vec2, C: Vec2, D: Vec2, retP: Vec2): boolean; + /** + !#en ccpSegmentIntersect return YES if Segment A-B intersects with segment C-D. + !#zh 返回线段 A - B 和线段 C - D 是否相交。 + @param A A + @param B B + @param C C + @param D D + */ + export function pSegmentIntersect(A: Vec2, B: Vec2, C: Vec2, D: Vec2): boolean; + /** + !#en ccpIntersectPoint return the intersection point of line A-B, C-D. + !#zh 返回线段 A - B 和线段 C - D 的交点。 + @param A A + @param B B + @param C C + @param D D + */ + export function pIntersectPoint(A: Vec2, B: Vec2, C: Vec2, D: Vec2): Vec2; + /** + !#en check to see if both points are equal. + !#zh 检查指定的 2 个向量是否相等。 + @param A A ccp a + @param B B ccp b to be compared + */ + export function pSameAs(A: Vec2, B: Vec2): boolean; + /** + !#en sets the position of the point to 0. + !#zh 设置指定向量归 0。 + @param v v + */ + export function pZeroIn(v: Vec2): void; + /** + !#en copies the position of one point to another. + !#zh 令 v1 向量等同于 v2。 + @param v1 v1 + @param v2 v2 + */ + export function pIn(v1: Vec2, v2: Vec2): void; + /** + !#en multiplies the point with the given factor (inplace). + !#zh 向量缩放,结果保存到第一个向量。 + @param point point + @param floatVar floatVar + */ + export function pMultIn(point: Vec2, floatVar: number): void; + /** + !#en subtracts one point from another (inplace). + !#zh 向量减法,结果保存到第一个向量。 + @param v1 v1 + @param v2 v2 + */ + export function pSubIn(v1: Vec2, v2: Vec2): void; + /** + !#en adds one point to another (inplace). + !#zh 向量加法,结果保存到第一个向量。 + @param v1 v1 + @param v2 v2 + */ + export function pAddIn(v1: Vec2, v2: Vec2): void; + /** + !#en normalizes the point (inplace). + !#zh 规范化 v 向量,设置 v 向量长度为 1。 + @param v v + */ + export function pNormalizeIn(v: Vec2): void; + /** + !#en + The convenience method to create a new Rect. + see {{#crossLink "Rect/Rect:method"}}cc.Rect{{/crossLink}} + !#zh + 该方法用来快速创建一个新的矩形。{{#crossLink "Rect/Rect:method"}}cc.Rect{{/crossLink}} + @param x x + @param y y + @param w w + @param h h + + @example + ```js + var a = new cc.Rect(0 , 0, 10, 0); + ``` + */ + export function rect(x?: number, y?: number, w?: number, h?: number): Rect; + /** + !#en Check whether a rect's value equals to another. + !#zh 判断两个矩形是否相等。 + @param rect1 rect1 + @param rect2 rect2 + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Rect(0, 0, 5, 5); + cc.rectEqualToRect(a, b); // false; + var c = new cc.Rect(0, 0, 5, 5); + cc.rectEqualToRect(b, c); // true; + ``` + */ + export function rectEqualToRect(rect1: Rect, rect2: Rect): boolean; + /** + !#en Check whether the rect1 contains rect2. + !#zh + 检查 rect1 矩形是否包含 rect2 矩形。
+ 注意:如果要允许 rect1 和 rect2 的边界重合,应该用 cc.rectOverlapsRect + @param rect1 rect1 + @param rect2 rect2 + + @example + ```js + var a = new cc.Rect(0, 0, 20, 20); + var b = new cc.Rect(10, 10, 20, 20); + cc.rectContainsRect(a, b); // true; + ``` + */ + export function rectContainsRect(rect1: Rect, rect2: Rect): boolean; + /** + !#en Returns the rightmost x-value of a rect. + !#zh 返回矩形在 x 轴上的最大值 + @param rect rect + + @example + ```js + var a = new cc.Rect(10, 0, 20, 20); + cc.rectGetMaxX(a); // 30; + ``` + */ + export function rectGetMaxX(rect: Rect): number; + /** + !#en Return the midpoint x-value of a rect. + !#zh 返回矩形在 x 轴上的中点。 + @param rect rect + + @example + ```js + var a = new cc.Rect(10, 0, 20, 20); + cc.rectGetMidX(a); // 20; + ``` + */ + export function rectGetMidX(rect: Rect): number; + /** + !#en Returns the leftmost x-value of a rect. + !#zh 返回矩形在 x 轴上的最小值。 + @param rect rect + + @example + ```js + var a = new cc.Rect(10, 0, 20, 20); + cc.rectGetMinX(a); // 10; + ``` + */ + export function rectGetMinX(rect: Rect): number; + /** + !#en Return the topmost y-value of a rect. + !#zh 返回矩形在 y 轴上的最大值。 + @param rect rect + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + cc.rectGetMaxY(a); // 30; + ``` + */ + export function rectGetMaxY(rect: Rect): number; + /** + !#en Return the midpoint y-value of `rect'. + !#zh 返回矩形在 y 轴上的中点。 + @param rect rect + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + cc.rectGetMidY(a); // 20; + ``` + */ + export function rectGetMidY(rect: Rect): number; + /** + !#en Return the bottommost y-value of a rect. + !#zh 返回矩形在 y 轴上的最小值。 + @param rect rect + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + cc.rectGetMinY(a); // 10; + ``` + */ + export function rectGetMinY(rect: Rect): number; + /** + !#en Check whether a rect contains a point. + !#zh 检查一个矩形是否包含某个坐标点。 + @param rect rect + @param point point + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + var b = new cc.Vec2(0, 10, 10, 10); + cc.rectContainsPoint(a, b); // true; + ``` + */ + export function rectContainsPoint(rect: Rect, point: Vec2): boolean; + /** + !#en Check whether a rect intersect with another. + !#zh 检查一个矩形是否与另一个相交。 + @param rectA rectA + @param rectB rectB + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + var b = new cc.Rect(0, 10, 10, 10); + cc.rectIntersectsRect(a, b); // true; + ``` + */ + export function rectIntersectsRect(rectA: Rect, rectB: Rect): boolean; + /** + !#en Check whether a rect overlaps another. + !#zh 检查一个矩形是否重叠另一个。 + @param rectA rectA + @param rectB rectB + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + var b = new cc.Rect(0, 10, 10, 10); + cc.rectOverlapsRect(a, b); // true; + ``` + */ + export function rectOverlapsRect(rectA: Rect, rectB: Rect): boolean; + /** + !#en Returns the smallest rectangle that contains the two source rectangles. + !#zh 返回一个包含两个指定矩形的最小矩形。 + @param rectA rectA + @param rectB rectB + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + var b = new cc.Rect(0, 10, 10, 10); + cc.rectUnion(a, b); // Rect {x: 0, y: 10, width: 20, height: 20}; + ``` + */ + export function rectUnion(rectA: Rect, rectB: Rect): Rect; + /** + !#en Returns the overlapping portion of 2 rectangles. + !#zh 返回 2 个矩形重叠的部分。 + @param rectA rectA + @param rectB rectB + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + var b = new cc.Rect(0, 10, 10, 10); + cc.rectIntersection(a, b); // Rect {x: 0, y: 10, width: 10, height: 10}; + ``` + */ + export function rectIntersection(rectA: Rect, rectB: Rect): Rect; + /** + !#en + Helper function that creates a cc.Size.
+ Please use cc.p or cc.v2 instead, it will soon replace cc.Size. + !#zh + 创建一个 cc.Size 对象的帮助函数。
+ 注意:可以使用 cc.p 或者是 cc.v2 代替,它们将很快取代 cc.Size。 + @param w width or a size object + @param h height + + @example + ```js + var size1 = cc.size(); + var size2 = cc.size(100,100); + var size3 = cc.size(size2); + var size4 = cc.size({width: 100, height: 100}); + + ``` + */ + export function size(w: number|Size, h?: number): Size; + /** + !#en Check whether a point's value equals to another. + !#zh 检查 Size 对象是否等于另一个。 + @param size1 size1 + @param size2 size2 + + @example + ```js + var a = new cc.size(10, 10); + var b = new cc.size(10, 10); + cc.sizeEqualToSize(a, b);// return true; + var b = new cc.size(5, 10); + cc.sizeEqualToSize(a, b);// return false; + ``` + */ + export function sizeEqualToSize(size1: Size, size2: Size): boolean; + export function V3F_C4B_T2F_QuadZero(): V3F_C4B_T2F_Quad; + /** + + @param sourceQuad sourceQuad + */ + export function V3F_C4B_T2F_QuadCopy(sourceQuad: V3F_C4B_T2F_Quad): V3F_C4B_T2F_Quad; + /** + + @param sourceQuads sourceQuads + */ + export function V3F_C4B_T2F_QuadsCopy(sourceQuads: any[]): any[]; + /** + !#en The convenience method to create a new {{#crossLink "Vec2"}}cc.Vec2{{/crossLink}}. + !#zh 通过该简便的函数进行创建 {{#crossLink "Vec2"}}cc.Vec2{{/crossLink}} 对象。 + @param x x + @param y y + + @example + ```js + var v1 = cc.v2(); + var v2 = cc.v2(0, 0); + var v3 = cc.v2(v2); + var v4 = cc.v2({x: 100, y: 100}); + ``` + */ + export function v2(x?: number|any, y?: number): Vec2; + /** + !#en The convenience method to creates a new {{#crossLink "Vec2"}}cc.Vec2{{/crossLink}}. + !#zh 通过该简便的函数进行创建 {{#crossLink "Vec2"}}cc.Vec2{{/crossLink}} 对象。 + @param x a Number or a size object + @param y y + + @example + ```js + var point1 = cc.p(); + var point2 = cc.p(100, 100); + var point3 = cc.p(point2); + var point4 = cc.p({x: 100, y: 100}); + ``` + */ + export function p(x?: number|any, y?: number): Vec2; + /** + !#en Check whether a point's value equals to another. + !#zh 判断两个向量是否相等。 + @param point1 point1 + @param point2 point2 + */ + export function pointEqualToPoint(point1: Vec2, point2: Vec2): boolean; + /** !#en Enum for debug modes. + !#zh 调试模式 */ + export enum DebugMode { + NONE = 0, + INFO = 0, + WARN = 0, + ERROR = 0, + INFO_FOR_WEB_PAGE = 0, + WARN_FOR_WEB_PAGE = 0, + ERROR_FOR_WEB_PAGE = 0, + } + /** !#en + cc.NodePool is the cache pool designed for node type.
+ It can helps you to improve your game performance for objects which need frequent release and recreate operations
+ + It's recommended to create cc.NodePool instances by node type, the type corresponds to node type in game design, not the class, + for example, a prefab is a specific node type.
+ When you create a node pool, you can pass a Component which contains `unuse`, `reuse` functions to control the content of node.
+ + Some common use case is :
+ 1. Bullets in game (die very soon, massive creation and recreation, no side effect on other objects)
+ 2. Blocks in candy crash (massive creation and recreation)
+ etc... + !#zh + cc.NodePool 是用于管理节点对象的对象缓存池。
+ 它可以帮助您提高游戏性能,适用于优化对象的反复创建和销毁
+ 以前 cocos2d-x 中的 cc.pool 和新的节点事件注册系统不兼容,因此请使用 cc.NodePool 来代替。 + + 新的 NodePool 需要实例化之后才能使用,每种不同的节点对象池需要一个不同的对象池实例,这里的种类对应于游戏中的节点设计,一个 prefab 相当于一个种类的节点。
+ 在创建缓冲池时,可以传入一个包含 unuse, reuse 函数的组件类型用于节点的回收和复用逻辑。
+ + 一些常见的用例是:
+ 1.在游戏中的子弹(死亡很快,频繁创建,对其他对象无副作用)
+ 2.糖果粉碎传奇中的木块(频繁创建)。 + 等等.... */ + export class NodePool { + /** + !#en + Constructor for creating a pool for a specific node template (usually a prefab). You can pass a component (type or name) argument for handling event for reusing and recycling node. + !#zh + 使用构造函数来创建一个节点专用的对象池,您可以传递一个组件类型或名称,用于处理节点回收和复用时的事件逻辑。 + @param poolHandlerComp !#en The constructor or the class name of the component to control the unuse/reuse logic. !#zh 处理节点回收和复用事件逻辑的组件类型或名称。 + + @example + ```js + properties: { + template: cc.Prefab + }, + onLoad () { + // MyTemplateHandler is a component with 'unuse' and 'reuse' to handle events when node is reused or recycled. + this.myPool = new cc.NodePool('MyTemplateHandler'); + } + ``` + */ + constructor(poolHandlerComp?: {prototype: Component}|string); + /** !#en The pool handler component, it could be the class name or the constructor. + !#zh 缓冲池处理组件,用于节点的回收和复用逻辑,这个属性可以是组件类名或组件的构造函数。 */ + poolHandlerComp: Function|string; + /** + !#en The current available size in the pool + !#zh 获取当前缓冲池的可用对象数量 + */ + size(): number; + /** + !#en Destroy all cached nodes in the pool + !#zh 销毁对象池中缓存的所有节点 + */ + clear(): void; + /** + !#en Put a new Node into the pool. + It will automatically remove the node from its parent without cleanup. + It will also invoke unuse method of the poolHandlerComp if exist. + !#zh 向缓冲池中存入一个不再需要的节点对象。 + 这个函数会自动将目标节点从父节点上移除,但是不会进行 cleanup 操作。 + 这个函数会调用 poolHandlerComp 的 unuse 函数,如果组件和函数都存在的话。 + @param obj obj + + @example + ```js + let myNode = cc.instantiate(this.template); + this.myPool.put(myNode); + ``` + */ + put(obj: Node): void; + /** + !#en Get a obj from pool, if no available object in pool, null will be returned. + This function will invoke the reuse function of poolHandlerComp if exist. + !#zh 获取对象池中的对象,如果对象池没有可用对象,则返回空。 + 这个函数会调用 poolHandlerComp 的 reuse 函数,如果组件和函数都存在的话。 + @param params !#en Params to pass to 'reuse' method in poolHandlerComp !#zh 向 poolHandlerComp 中的 'reuse' 函数传递的参数 + + @example + ```js + let newNode = this.myPool.get(); + ``` + */ + get(...params: any[]): Node; + } + /** !#en + Attention: In creator, it's strongly not recommended to use cc.pool to manager cc.Node. + We provided {{#crossLink "NodePool"}}cc.NodePool{{/crossLink}} instead. + + cc.pool is a singleton object serves as an object cache pool.
+ It can helps you to improve your game performance for objects which need frequent release and recreate operations
+ !#zh + 首先请注意,在 Creator 中我们强烈不建议使用 cc.pool 来管理 cc.Node 节点对象,请使用 {{#crossLink "NodePool"}}cc.NodePool{{/crossLink}} 代替 + 因为 cc.pool 是面向类来设计的,而 cc.Node 中使用 Component 来进行组合,它的类永远都一样,实际却千差万别。 + + cc.pool 是一个单例对象,用作为对象缓存池。
+ 它可以帮助您提高游戏性能,适用于优化对象的反复创建和销毁
*/ + export class pool { + /** + !#en Put the obj in pool. + !#zh 加入对象到对象池中。 + @param obj The need put in pool object. + + @example + ```js + --------------------------------- + var sp = new _ccsg.Sprite("a.png"); + this.addChild(sp); + cc.pool.putInPool(sp); + cc.pool.getFromPool(_ccsg.Sprite, "a.png"); + + ``` + */ + putInPool(obj: any): void; + /** + !#en Check if this kind of obj has already in pool. + !#zh 检查对象池中是否有指定对象的存在。 + @param objClass The check object class. + */ + hasObject(objClass: any): boolean; + /** + !#en Remove the obj if you want to delete it. + !#zh 移除在对象池中指定的对象。 + */ + removeObject(): void; + /** + !#en Get the obj from pool. + !#zh 获取对象池中的指定对象。 + */ + getFromPool(): any; + /** + !#en Remove all objs in pool and reset the pool. + !#zh 移除对象池中的所有对象,并且重置对象池。 + */ + drainAllPools(): void; + } + /** !#en Base class cc.Action for action classes. + !#zh Action 类是所有动作类型的基类。 */ + export class Action { + /** + !#en + to copy object with deep copy. + returns a clone of action. + !#zh 返回一个克隆的动作。 + */ + clone(): Action; + /** + !#en + return true if the action has finished. + !#zh 如果动作已完成就返回 true。 + */ + isDone(): boolean; + /** + !#en get the target. + !#zh 获取当前目标节点。 + */ + getTarget(): Node; + /** + !#en The action will modify the target properties. + !#zh 设置目标节点。 + @param target target + */ + setTarget(target: Node): void; + /** + !#en get the original target. + !#zh 获取原始目标节点。 + */ + getOriginalTarget(): Node; + /** + !#en get tag number. + !#zh 获取用于识别动作的标签。 + */ + getTag(): number; + /** + !#en set tag number. + !#zh 设置标签,用于识别动作。 + @param tag tag + */ + setTag(tag: number): void; + /** !#en Default Action tag. + !#zh 默认动作标签。 */ + static TAG_INVALID: number; + } + /** !#en + Base class actions that do have a finite time duration.
+ Possible actions:
+ - An action with a duration of 0 seconds.
+ - An action with a duration of 35.5 seconds. + + Infinite time actions are valid + !#zh 有限时间动作,这种动作拥有时长 duration 属性。 */ + export class FiniteTimeAction extends Action { + /** + !#en get duration of the action. (seconds). + !#zh 获取动作以秒为单位的持续时间。 + */ + getDuration(): number; + /** + !#en set duration of the action. (seconds). + !#zh 设置动作以秒为单位的持续时间。 + @param duration duration + */ + setDuration(duration: number): void; + /** + !#en + Returns a reversed action.
+ For example:
+ - The action will be x coordinates of 0 move to 100.
+ - The reversed action will be x of 100 move to 0. + - Will be rewritten + !#zh 返回一个新的动作,执行与原动作完全相反的动作。 + */ + reverse(): void; + /** + !#en + to copy object with deep copy. + returns a clone of action. + !#zh 返回一个克隆的动作。 + */ + clone(): FiniteTimeAction; + } + /** !#en Base class for Easing actions. + !#zh 所有缓动动作基类,用于修饰 ActionInterval。 */ + export class ActionEase extends ActionInterval { + } + /** !#en Base class for Easing actions with rate parameters + !#zh 拥有速率属性的缓动动作基类。 */ + export class EaseRateAction extends ActionEase { + } + /** !#en Ease Elastic abstract class. + !#zh 弹性缓动动作基类。 */ + export class EaseElastic extends ActionEase { + } + /** !#en cc.EaseBounce abstract class. + !#zh 反弹缓动动作基类。 */ + export class EaseBounce extends ActionEase { + } + /** !#en Instant actions are immediate actions. They don't have a duration like the ActionInterval actions. + !#zh 即时动作,这种动作立即就会执行,继承自 FiniteTimeAction。 */ + export class ActionInstant extends FiniteTimeAction { + } + /** !#en +

An interval action is an action that takes place within a certain period of time.
+ It has an start time, and a finish time. The finish time is the parameter
+ duration plus the start time.

+ +

These CCActionInterval actions have some interesting properties, like:
+ - They can run normally (default)
+ - They can run reversed with the reverse method
+ - They can run with the time altered with the Accelerate, AccelDeccel and Speed actions.

+ +

For example, you can simulate a Ping Pong effect running the action normally and
+ then running it again in Reverse mode.

+ !#zh 时间间隔动作,这种动作在已定时间内完成,继承 FiniteTimeAction。 */ + export class ActionInterval extends FiniteTimeAction { + /** + !#en Implementation of ease motion. + !#zh 缓动运动。 + @param easeObj easeObj + + @example + ```js + action.easing(cc.easeIn(3.0)); + ``` + */ + easing(easeObj: any): ActionInterval; + /** + !#en + Repeats an action a number of times. + To repeat an action forever use the CCRepeatForever action. + !#zh 重复动作可以按一定次数重复一个动作,使用 RepeatForever 动作来永远重复一个动作。 + @param times times + */ + repeat(times: number): ActionInterval; + /** + !#en + Repeats an action for ever.
+ To repeat the an action for a limited number of times use the Repeat action.
+ !#zh 永远地重复一个动作,有限次数内重复一个动作请使用 Repeat 动作。 + */ + repeatForever(): ActionInterval; + } + /** !#en + cc.ActionManager is a class that can manage actions.
+ Normally you won't need to use this class directly. 99% of the cases you will use the CCNode interface, + which uses this class's singleton object. + But there are some cases where you might need to use this class.
+ Examples:
+ - When you want to run an action where the target is different from a CCNode.
+ - When you want to pause / resume the actions
+ !#zh + cc.ActionManager 是可以管理动作的单例类。
+ 通常你并不需要直接使用这个类,99%的情况您将使用 CCNode 的接口。
+ 但也有一些情况下,您可能需要使用这个类。
+ 例如: + - 当你想要运行一个动作,但目标不是 CCNode 类型时。
+ - 当你想要暂停/恢复动作时。
*/ + export class ActionManager { + /** + !#en + Adds an action with a target.
+ If the target is already present, then the action will be added to the existing target. + 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. + When the target is paused, the queued actions won't be 'ticked'. + !#zh + 增加一个动作,同时还需要提供动作的目标对象,目标对象是否暂停作为参数。
+ 如果目标已存在,动作将会被直接添加到现有的节点中。
+ 如果目标不存在,将为这一目标创建一个新的实例,并将动作添加进去。
+ 当目标状态的 paused 为 true,动作将不会被执行 + @param action action + @param target target + @param paused paused + */ + addAction(action: Action, target: Node, paused: boolean): void; + /** + !#en Removes all actions from all the targets. + !#zh 移除所有对象的所有动作。 + */ + removeAllActions(): void; + /** + !#en + Removes all actions from a certain target.
+ All the actions that belongs to the target will be removed. + !#zh + 移除指定对象上的所有动作。
+ 属于该目标的所有的动作将被删除。 + @param target target + @param forceDelete forceDelete + */ + removeAllActionsFromTarget(target: Node, forceDelete: boolean): void; + /** + !#en Removes an action given an action reference. + !#zh 移除指定的动作。 + @param action action + */ + removeAction(action: Action): void; + /** + !#en Removes an action given its tag and the target. + !#zh 删除指定对象下特定标签的一个动作,将删除首个匹配到的动作。 + @param tag tag + @param target target + */ + removeActionByTag(tag: number, target: Node): void; + /** + !#en Gets an action given its tag an a target. + !#zh 通过目标对象和标签获取一个动作。 + @param tag tag + @param target target + */ + getActionByTag(tag: number, target: Node): Action; + /** + !#en + Returns the numbers of actions that are running in a certain target.
+ Composable actions are counted as 1 action.
+ Example:
+ - If you are running 1 Sequence of 7 actions, it will return 1.
+ - If you are running 7 Sequences of 2 actions, it will return 7. + !#zh + 返回指定对象下所有正在运行的动作数量。
+ 组合动作被算作一个动作。
+ 例如:
+ - 如果您正在运行 7 个动作组成的序列动作(Sequence),这个函数将返回 1。
+ - 如果你正在运行 2 个序列动作(Sequence)和 5 个普通动作,这个函数将返回 7。
+ @param target target + */ + getNumberOfRunningActionsInTarget(target: Node): number; + /** + !#en Pauses the target: all running actions and newly added actions will be paused. + !#zh 暂停指定对象:所有正在运行的动作和新添加的动作都将会暂停。 + @param target target + */ + pauseTarget(target: Node): void; + /** + !#en Resumes the target. All queued actions will be resumed. + !#zh 让指定目标恢复运行。在执行序列中所有被暂停的动作将重新恢复运行。 + @param target target + */ + resumeTarget(target: Node): void; + /** + !#en Pauses all running actions, returning a list of targets whose actions were paused. + !#zh 暂停所有正在运行的动作,返回一个包含了那些动作被暂停了的目标对象的列表。 + */ + pauseAllRunningActions(): any[]; + /** + !#en Resume a set of targets (convenience function to reverse a pauseAllRunningActions or pauseTargets call). + !#zh 让一组指定对象恢复运行(用来逆转 pauseAllRunningActions 效果的便捷函数)。 + @param targetsToResume targetsToResume + */ + resumeTargets(targetsToResume: any[]): void; + /** + !#en Pause a set of targets. + !#zh 暂停一组指定对象。 + @param targetsToPause targetsToPause + */ + pauseTargets(targetsToPause: any[]): void; + /** + !#en + purges the shared action manager. It releases the retained instance.
+ because it uses this, so it can not be static. + !#zh + 清除共用的动作管理器。它释放了持有的实例。
+ 因为它使用 this,因此它不能是静态的。 + */ + purgeSharedManager(): void; + /** + !#en The ActionManager update。 + !#zh ActionManager 主循环。 + @param dt delta time in seconds + */ + update(dt: number): void; + } + /** !#en Class for animation data handling. + !#zh 动画剪辑,用于存储动画数据。 */ + export class AnimationClip extends Asset { + /** !#en Duration of this animation. + !#zh 动画的持续时间。 */ + duration: number; + /** !#en FrameRate of this animation. + !#zh 动画的帧速率。 */ + sample: number; + /** !#en Speed of this animation. + !#zh 动画的播放速度。 */ + speed: number; + /** !#en WrapMode of this animation. + !#zh 动画的循环模式。 */ + wrapMode: WrapMode; + /** !#en Curve data. + !#zh 曲线数据。 */ + curveData: any; + /** !#en Event data. + !#zh 事件数据。 */ + events: {frame: number, func: string, params: string[]}[]; + /** + !#en Crate clip with a set of sprite frames + !#zh 使用一组序列帧图片来创建动画剪辑 + @param spriteFrames spriteFrames + @param sample sample + + @example + ```js + var clip = cc.AnimationClip.createWithSpriteFrames(spriteFrames, 10); + ``` + */ + static createWithSpriteFrames(spriteFrames: [SpriteFrame], sample: number): AnimationClip; + } + /** !#en + The AnimationState gives full control over animation playback process. + In most cases the Animation Component is sufficient and easier to use. Use the AnimationState if you need full control. + !#zh + AnimationState 完全控制动画播放过程。
+ 大多数情况下 动画组件 是足够和易于使用的。如果您需要更多的动画控制接口,请使用 AnimationState。 */ + export class AnimationState extends Playable { + /** + + @param clip clip + @param name name + */ + constructor(clip: AnimationClip, name?: string); + animator: AnimationAnimator; + /** !#en The curves list. + !#zh 曲线列表。 */ + curves: any[]; + /** !#en The start delay which represents the number of seconds from an animation's start time to the start of + the active interval. + !#zh 延迟多少秒播放。 */ + delay: number; + /** !#en The animation's iteration count property. + + A real number greater than or equal to zero (including positive infinity) representing the number of times + to repeat the animation node. + + Values less than zero and NaN values are treated as the value 1.0 for the purpose of timing model + calculations. + + !#zh 迭代次数,指动画播放多少次后结束, normalize time。 如 2.5(2次半) */ + repeatCount: number; + /** !#en The iteration duration of this animation in seconds. (length) + !#zh 单次动画的持续时间,秒。 */ + duration: number; + /** !#en The animation's playback speed. 1 is normal playback speed. + !#zh 播放速率。 */ + speed: number; + /** !#en + Wrapping mode of the playing animation. + Notice : dynamic change wrapMode will reset time and repeatCount property + !#zh + 动画循环方式。 + 需要注意的是,动态修改 wrapMode 时,会重置 time 以及 repeatCount */ + wrapMode: WrapMode; + /** !#en The current time of this animation in seconds. + !#zh 动画当前的时间,秒。 */ + time: number; + /** !#en The clip that is being played by this animation state. + !#zh 此动画状态正在播放的剪辑。 */ + clip: AnimationClip; + /** !#en The name of the playing animation. + !#zh 动画的名字 */ + name: string; + } + /** undefined */ + export class Playable { + /** !#en Is playing or paused in play mode? + !#zh 当前是否正在播放。 */ + isPlaying: boolean; + /** !#en Is currently paused? This can be true even if in edit mode(isPlaying == false). + !#zh 当前是否正在暂停 */ + isPaused: boolean; + /** + !#en Play this animation. + !#zh 播放动画。 + */ + play(): void; + /** + !#en Stop this animation. + !#zh 停止动画播放。 + */ + stop(): void; + /** + !#en Pause this animation. + !#zh 暂停动画。 + */ + pause(): void; + /** + !#en Resume this animation. + !#zh 重新播放动画。 + */ + resume(): void; + /** + !#en Perform a single frame step. + !#zh 执行一帧动画。 + */ + step(): void; + } + /** !#en Specifies how time is treated when it is outside of the keyframe range of an Animation. + !#zh 动画使用的循环模式。 */ + export enum WrapMode { + Default = 0, + Normal = 0, + Reverse = 0, + Loop = 0, + LoopReverse = 0, + PingPong = 0, + PingPongReverse = 0, + } + /** !#en +

+ ATTENTION: USE cc.director INSTEAD OF cc.Director.
+ cc.director is a singleton object which manage your game's logic flow.
+ Since the cc.director is a singleton, you don't need to call any constructor or create functions,
+ the standard way to use it is by calling:
+ - cc.director.methodName();
+ + It creates and handle the main Window and manages how and when to execute the Scenes.
+
+ The cc.director is also responsible for:
+ - initializing the OpenGL context
+ - setting the OpenGL pixel format (default on is RGB565)
+ - setting the OpenGL buffer depth (default on is 0-bit)
+ - setting the color for clear screen (default one is BLACK)
+ - setting the projection (default one is 3D)
+ - setting the orientation (default one is Portrait)
+
+
+ The cc.director also sets the default OpenGL context:
+ - GL_TEXTURE_2D is enabled
+ - GL_VERTEX_ARRAY is enabled
+ - GL_COLOR_ARRAY is enabled
+ - GL_TEXTURE_COORD_ARRAY is enabled
+

+

+ cc.director also synchronizes timers with the refresh rate of the display.
+ Features and Limitations:
+ - Scheduled timers & drawing are synchronizes with the refresh rate of the display
+ - Only supports animation intervals of 1/60 1/30 & 1/15
+

+ + !#zh +

+ 注意:用 cc.director 代替 cc.Director。
+ cc.director 一个管理你的游戏的逻辑流程的单例对象。
+ 由于 cc.director 是一个单例,你不需要调用任何构造函数或创建函数,
+ 使用它的标准方法是通过调用:
+ - cc.director.methodName(); +
+ 它创建和处理主窗口并且管理什么时候执行场景。
+
+ cc.director 还负责:
+ - 初始化 OpenGL 环境。
+ - 设置OpenGL像素格式。(默认是 RGB565)
+ - 设置OpenGL缓冲区深度 (默认是 0-bit)
+ - 设置空白场景的颜色 (默认是 黑色)
+ - 设置投影 (默认是 3D)
+ - 设置方向 (默认是 Portrait)
+
+ cc.director 设置了 OpenGL 默认环境
+ - GL_TEXTURE_2D 启用。
+ - GL_VERTEX_ARRAY 启用。
+ - GL_COLOR_ARRAY 启用。
+ - GL_TEXTURE_COORD_ARRAY 启用。
+

+

+ cc.director 也同步定时器与显示器的刷新速率。 +
+ 特点和局限性:
+ - 将计时器 & 渲染与显示器的刷新频率同步。
+ - 只支持动画的间隔 1/60 1/30 & 1/15。
+

*/ + export class Director extends EventTarget { + /** + !#en + Converts an OpenGL coordinate to a view coordinate
+ Useful to convert node points to window points for calls such as glScissor
+ Implementation can be found in CCDirectorWebGL. + !#zh 将触摸点的 WebGL View 坐标转换为屏幕坐标。 + @param glPoint glPoint + */ + convertToUI(glPoint: Vec2): Vec2; + /** + !#en + Returns the size of the WebGL view in points.
+ It takes into account any possible rotation (device orientation) of the window. + !#zh 获取视图的大小,以点为单位。 + */ + getWinSize(): Size; + /** + !#en + Returns the size of the OpenGL view in pixels.
+ It takes into account any possible rotation (device orientation) of the window.
+ On Mac winSize and winSizeInPixels return the same value. + (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()) + !#zh + 获取视图大小,以像素为单位(这里的像素指的是资源分辨率。 + 如果要获取屏幕物理分辨率,需要用 cc.view.getFrameSize()) + */ + getWinSizeInPixels(): Size; + /** + !#en Returns the visible size of the running scene. + !#zh 获取运行场景的可见大小。 + */ + getVisibleSize(): Size; + /** + !#en Returns the visible origin of the running scene. + !#zh 获取视图在游戏内容中的坐标原点。 + */ + getVisibleOrigin(): Vec2; + /** + !#en Pause the director's ticker, only involve the game logic execution. + It won't pause the rendering process nor the event manager. + If you want to pause the entier game including rendering, audio and event, + please use {{#crossLink "Game.pause"}}cc.game.pause{{/crossLink}} + !#zh 暂停正在运行的场景,该暂停只会停止游戏逻辑执行,但是不会停止渲染和 UI 响应。 + 如果想要更彻底得暂停游戏,包含渲染,音频和事件,请使用 {{#crossLink "Game.pause"}}cc.game.pause{{/crossLink}}。 + */ + pause(): void; + /** + !#en + Run a scene. Replaces the running scene with a new one or enter the first scene.
+ The new scene will be launched immediately. + !#zh 立刻切换指定场景。 + @param scene The need run scene. + @param onBeforeLoadScene The function invoked at the scene before loading. + @param onLaunched The function invoked at the scene after launch. + */ + runSceneImmediate(scene: Scene, onBeforeLoadScene?: Function, onLaunched?: Function): void; + /** + !#en Loads the scene by its name. + !#zh 通过场景名称进行加载场景。 + @param sceneName The name of the scene to load. + @param onLaunched callback, will be called after scene launched. + */ + loadScene(sceneName: string, onLaunched?: Function): boolean; + /** + !#en + Preloads the scene to reduces loading time. You can call this method at any time you want. + After calling this method, you still need to launch the scene by `cc.director.loadScene`. + It will be totally fine to call `cc.director.loadScene` at any time even if the preloading is not + yet finished, the scene will be launched after loaded automatically. + !#zh 预加载场景,你可以在任何时候调用这个方法。 + 调用完后,你仍然需要通过 `cc.director.loadScene` 来启动场景,因为这个方法不会执行场景加载操作。 + 就算预加载还没完成,你也可以直接调用 `cc.director.loadScene`,加载完成后场景就会启动。 + @param sceneName The name of the scene to preload. + @param onLoaded callback, will be called after scene loaded. + */ + preloadScene(sceneName: string, onLoaded?: (error: Error) => void): void; + /** + !#en Resume game logic execution after pause, if the current scene is not paused, nothing will happen. + !#zh 恢复暂停场景的游戏逻辑,如果当前场景没有暂停将没任何事情发生。 + */ + resume(): void; + /** + !#en + Enables or disables WebGL depth test.
+ Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js + !#zh 启用/禁用深度测试(在 Canvas 渲染模式下不会生效)。 + @param on on + */ + setDepthTest(on: boolean): void; + /** + !#en + Set color for clear screen.
+ (Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js) + !#zh + 设置场景的默认擦除颜色。
+ 支持全透明,但不支持透明度为中间值。要支持全透明需手工开启 cc.macro.ENABLE_TRANSPARENT_CANVAS。 + @param clearColor clearColor + */ + setClearColor(clearColor: Color): void; + /** + !#en + Sets an OpenGL projection.
+ Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js. + !#zh 设置 OpenGL 投影。 + @param projection projection + */ + setProjection(projection: number): void; + /** + !#en + Update the view port.
+ Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js. + !#zh 设置视窗(请不要主动调用这个接口,除非你知道你在做什么)。 + */ + setViewport(): void; + /** + !#en + Sets an OpenGL projection.
+ Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js. + !#zh 获取 OpenGL 投影。 + */ + getProjection(): number; + /** + !#en + Enables/disables OpenGL alpha blending.
+ Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js. + !#zh 启用/禁用 透明度融合。 + @param on on + */ + setAlphaBlending(on: boolean): void; + /** + !#en + Returns whether or not the replaced scene will receive the cleanup message.
+ If the new scene is pushed, then the old scene won't receive the "cleanup" message.
+ If the new scene replaces the old one, the it will receive the "cleanup" message. + !#zh + 更换场景时是否接收清理消息。
+ 如果新场景是采用 push 方式进入的,那么旧的场景将不会接收到 “cleanup” 消息。
+ 如果新场景取代旧的场景,它将会接收到 “cleanup” 消息。
+ */ + isSendCleanupToScene(): boolean; + /** + !#en Returns current logic Scene. + !#zh 获取当前逻辑场景。 + + @example + ```js + // This will help you to get the Canvas node in scene + cc.director.getScene().getChildByName('Canvas'); + ``` + */ + getScene(): Scene; + /** + !#en Returns the FPS value. + !#zh 获取单位帧执行时间。 + */ + getAnimationInterval(): number; + /** + !#en Returns whether or not to display the FPS informations. + !#zh 获取是否显示 FPS 信息。 + */ + isDisplayStats(): boolean; + /** + !#en Sets whether display the FPS on the bottom-left corner. + !#zh 设置是否在左下角显示 FPS。 + @param displayStats displayStats + */ + setDisplayStats(displayStats: boolean): void; + /** + !#en Returns whether next delta time equals to zero. + !#zh 返回下一个 “delta time” 是否等于零。 + */ + isNextDeltaTimeZero(): boolean; + /** + !#en Returns whether or not the Director is paused. + !#zh 是否处于暂停状态。 + */ + isPaused(): boolean; + /** + !#en Returns how many frames were called since the director started. + !#zh 获取 director 启动以来游戏运行的总帧数。 + */ + getTotalFrames(): number; + /** + !#en Returns the cc.Scheduler associated with this director. + !#zh 获取和 director 相关联的 cc.Scheduler。 + */ + getScheduler(): Scheduler; + /** + !#en Sets the cc.Scheduler associated with this director. + !#zh 设置和 director 相关联的 cc.Scheduler。 + @param scheduler scheduler + */ + setScheduler(scheduler: Scheduler): void; + /** + !#en Returns the cc.ActionManager associated with this director. + !#zh 获取和 director 相关联的 cc.ActionManager(动作管理器)。 + */ + getActionManager(): ActionManager; + /** + !#en Sets the cc.ActionManager associated with this director. + !#zh 设置和 director 相关联的 cc.ActionManager(动作管理器)。 + @param actionManager actionManager + */ + setActionManager(actionManager: ActionManager): void; + /** + Returns the cc.CollisionManager associated with this director. + */ + getCollisionManager(): CollisionManager; + /** + Returns the cc.PhysicsManager associated with this director. + */ + getPhysicsManager(): PhysicsManager; + /** + !#en Returns the delta time since last frame. + !#zh 获取上一帧的 “delta time”。 + */ + getDeltaTime(): number; + /** !#en The event projection changed of cc.Director. + !#zh cc.Director 投影变化的事件。 */ + static EVENT_PROJECTION_CHANGED: string; + /** !#en The event which will be triggered before loading a new scene. + !#zh 加载新场景之前所触发的事件。 */ + static EVENT_BEFORE_SCENE_LOADING: string; + /** !#en The event which will be triggered before launching a new scene. + !#zh 运行新场景之前所触发的事件。 */ + static EVENT_BEFORE_SCENE_LAUNCH: string; + /** !#en The event which will be triggered after launching a new scene. + !#zh 运行新场景之后所触发的事件。 */ + static EVENT_AFTER_SCENE_LAUNCH: string; + /** !#en The event which will be triggered at the beginning of every frame. + !#zh 每个帧的开始时所触发的事件。 */ + static EVENT_BEFORE_UPDATE: string; + /** !#en The event which will be triggered after engine and components update logic. + !#zh 将在引擎和组件 “update” 逻辑之后所触发的事件。 */ + static EVENT_AFTER_UPDATE: string; + /** !#en The event which will be triggered before visiting the rendering scene graph. + !#zh 访问渲染场景树之前所触发的事件。 */ + static EVENT_BEFORE_VISIT: string; + /** !#en + The event which will be triggered after visiting the rendering scene graph, + the render queue is ready but not rendered at this point. + !#zh + 访问渲染场景图之后所触发的事件,渲染队列已准备就绪,但在这一时刻还没有呈现在画布上。 */ + static EVENT_AFTER_VISIT: string; + /** !#en The event which will be triggered after the rendering process. + !#zh 渲染过程之后所触发的事件。 */ + static EVENT_AFTER_DRAW: string; + /** Constant for 2D projection (orthogonal projection) */ + static PROJECTION_2D: number; + /** Constant for 3D projection with a fovy=60, znear=0.5f and zfar=1500. */ + static PROJECTION_3D: number; + /** Constant for custom projection, if cc.Director's projection set to it, it calls "updateProjection" on the projection delegate. */ + static PROJECTION_CUSTOM: number; + /** Constant for default projection of cc.Director, default projection is 2D projection */ + static PROJECTION_DEFAULT: number; + } + /** !#en cc.game is the singleton object for game related functions. + !#zh cc.game 是 Game 的实例,用来驱动整个游戏。 */ + export class Game extends EventTarget { + /** !#en Event triggered when game hide to background. + Please note that this event is not 100% guaranteed to be fired on Web platform, + on native platforms, it corresponds to enter background event, os status bar or notification center may not trigger this event. + !#zh 游戏进入后台时触发的事件。 + 请注意,在 WEB 平台,这个事件不一定会 100% 触发,这完全取决于浏览器的回调行为。 + 在原生平台,它对应的是应用被切换到后台事件,下拉菜单和上拉状态栏等不一定会触发这个事件,这取决于系统行为。 */ + EVENT_HIDE: string; + /** Event triggered when game back to foreground + Please note that this event is not 100% guaranteed to be fired on Web platform, + on native platforms, it corresponds to enter foreground event. + !#zh 游戏进入前台运行时触发的事件。 + 请注意,在 WEB 平台,这个事件不一定会 100% 触发,这完全取决于浏览器的回调行为。 + 在原生平台,它对应的是应用被切换到前台事件。 */ + EVENT_SHOW: string; + /** Event triggered after game inited, at this point all engine objects and game scripts are loaded */ + EVENT_GAME_INITED: string; + /** Event triggered after renderer inited, at this point you will be able to use the render context */ + EVENT_RENDERER_INITED: string; + /** Key of config */ + CONFIG_KEY: any; + /** !#en The outer frame of the game canvas, parent of cc.container. + !#zh 游戏画布的外框,cc.container 的父类。 */ + frame: any; + /** !#en The container of game canvas, equals to cc.container. + !#zh 游戏画布的容器。 */ + container: HTMLDivElement; + /** !#en The canvas of the game, equals to cc._canvas. + !#zh 游戏的画布。 */ + canvas: HTMLCanvasElement; + /** !#en + The current game configuration, including:
+ 1. debugMode
+ "debugMode" possible values :
+ 0 - No message will be printed.
+ 1 - cc.error, cc.assert, cc.warn, cc.log will print in console.
+ 2 - cc.error, cc.assert, cc.warn will print in console.
+ 3 - cc.error, cc.assert will print in console.
+ 4 - cc.error, cc.assert, cc.warn, cc.log will print on canvas, available only on web.
+ 5 - cc.error, cc.assert, cc.warn will print on canvas, available only on web.
+ 6 - cc.error, cc.assert will print on canvas, available only on web.
+ 2. showFPS
+ Left bottom corner fps information will show when "showFPS" equals true, otherwise it will be hide.
+ 3. exposeClassName
+ Expose class name to chrome debug tools, the class intantiate performance is a little bit slower when exposed.
+ 4. frameRate
+ "frameRate" set the wanted frame rate for your game, but the real fps depends on your game implementation and the running environment.
+ 5. id
+ "gameCanvas" sets the id of your canvas element on the web page, it's useful only on web.
+ 6. renderMode
+ "renderMode" sets the renderer type, only useful on web :
+ 0 - Automatically chosen by engine
+ 1 - Forced to use canvas renderer
+ 2 - Forced to use WebGL renderer, but this will be ignored on mobile browsers
+ 7. scenes
+ "scenes" include available scenes in the current bundle.
+
+ Please DO NOT modify this object directly, it won't have any effect.
+ !#zh + 当前的游戏配置,包括:
+ 1. debugMode(debug 模式,但是在浏览器中这个选项会被忽略)
+ "debugMode" 各种设置选项的意义。
+ 0 - 没有消息被打印出来。
+ 1 - cc.error,cc.assert,cc.warn,cc.log 将打印在 console 中。
+ 2 - cc.error,cc.assert,cc.warn 将打印在 console 中。
+ 3 - cc.error,cc.assert 将打印在 console 中。
+ 4 - cc.error,cc.assert,cc.warn,cc.log 将打印在 canvas 中(仅适用于 web 端)。
+ 5 - cc.error,cc.assert,cc.warn 将打印在 canvas 中(仅适用于 web 端)。
+ 6 - cc.error,cc.assert 将打印在 canvas 中(仅适用于 web 端)。
+ 2. showFPS(显示 FPS)
+ 当 showFPS 为 true 的时候界面的左下角将显示 fps 的信息,否则被隐藏。
+ 3. exposeClassName
+ 暴露类名让 Chrome DevTools 可以识别,如果开启会稍稍降低类的创建过程的性能,但对对象构造没有影响。
+ 4. frameRate (帧率)
+ “frameRate” 设置想要的帧率你的游戏,但真正的FPS取决于你的游戏实现和运行环境。
+ 5. id
+ "gameCanvas" Web 页面上的 Canvas Element ID,仅适用于 web 端。
+ 6. renderMode(渲染模式)
+ “renderMode” 设置渲染器类型,仅适用于 web 端:
+ 0 - 通过引擎自动选择。
+ 1 - 强制使用 canvas 渲染。 + 2 - 强制使用 WebGL 渲染,但是在部分 Android 浏览器中这个选项会被忽略。
+ 7. scenes
+ “scenes” 当前包中可用场景。
+
+ 注意:请不要直接修改这个对象,它不会有任何效果。 */ + config: any; + /** + !#en Callback when the scripts of engine have been load. + !#zh 当引擎完成启动后的回调函数。 + */ + onStart(): void; + /** + !#en Set frameRate of game. + !#zh 设置游戏帧率。 + @param frameRate frameRate + */ + setFrameRate(frameRate: number): void; + /** + !#en Run the game frame by frame. + !#zh 执行一帧游戏循环。 + */ + step(): void; + /** + !#en Pause the game main loop. This will pause: + game logic execution, rendering process, event manager, background music and all audio effects. + This is different with cc.director.pause which only pause the game logic execution. + !#zh 暂停游戏主循环。包含:游戏逻辑,渲染,事件处理,背景音乐和所有音效。这点和只暂停游戏逻辑的 cc.director.pause 不同。 + */ + pause(): void; + /** + !#en Resume the game from pause. This will resume: + game logic execution, rendering process, event manager, background music and all audio effects. + !#zh 恢复游戏主循环。包含:游戏逻辑,渲染,事件处理,背景音乐和所有音效。 + */ + resume(): void; + /** + !#en Check whether the game is paused. + !#zh 判断游戏是否暂停。 + */ + isPaused(): boolean; + /** + !#en Restart game. + !#zh 重新开始游戏 + */ + restart(): void; + /** + !#en End game, it will close the game window + !#zh 退出游戏 + */ + end(): void; + /** + !#en Prepare game. + !#zh 准备引擎,请不要直接调用这个函数。 + @param cb cb + */ + prepare(cb: Function): void; + /** + !#en Run game with configuration object and onStart function. + !#zh 运行游戏,并且指定引擎配置和 onStart 的回调。 + @param config Pass configuration object or onStart function + @param onStart function to be executed after game initialized + */ + run(config?: any|Function, onStart?: Function): void; + /** + !#en + Add a persistent root node to the game, the persistent node won't be destroyed during scene transition.
+ The target node must be placed in the root level of hierarchy, otherwise this API won't have any effect. + !#zh + 声明常驻根节点,该节点不会被在场景切换中被销毁。
+ 目标节点必须位于为层级的根节点,否则无效。 + @param node The node to be made persistent + */ + addPersistRootNode(node: Node): void; + /** + !#en Remove a persistent root node. + !#zh 取消常驻根节点。 + @param node The node to be removed from persistent node list + */ + removePersistRootNode(node: Node): void; + /** + !#en Check whether the node is a persistent root node. + !#zh 检查节点是否是常驻根节点。 + @param node The node to be checked + */ + isPersistRootNode(node: Node): boolean; + } + /** !#en + Class of all entities in Cocos Creator scenes.
+ Node also inherits from {{#crossLink "EventTarget"}}Event Target{{/crossLink}}, it permits Node to dispatch events. + For events supported by Node, please refer to {{#crossLink "Node.EventType"}}{{/crossLink}} + !#zh + Cocos Creator 场景中的所有节点类。节点也继承了 {{#crossLink "EventTarget"}}EventTarget{{/crossLink}},它允许节点发送事件。
+ 支持的节点事件,请参阅 {{#crossLink "Node.EventType"}}{{/crossLink}}。 */ + export class Node extends _BaseNode { + /** !#en + Group index of node.
+ Which Group this node belongs to will resolve that this node's collision components can collide with which other collision componentns.
+ !#zh + 节点的分组索引。
+ 节点的分组将关系到节点的碰撞组件可以与哪些碰撞组件相碰撞。
*/ + groupIndex: number; + /** !#en + Group of node.
+ Which Group this node belongs to will resolve that this node's collision components can collide with which other collision componentns.
+ !#zh + 节点的分组。
+ 节点的分组将关系到节点的碰撞组件可以与哪些碰撞组件相碰撞。
*/ + group: string; + /** !#en The position (x, y) of the node in its parent's coordinates. + !#zh 节点在父节点坐标系中的位置(x, y)。 */ + position: Vec2; + /** !#en x axis position of node. + !#zh 节点 X 轴坐标。 */ + x: number; + /** !#en y axis position of node. + !#zh 节点 Y 轴坐标。 */ + y: number; + /** !#en Rotation of node. + !#zh 该节点旋转角度。 */ + rotation: number; + /** !#en Rotation on x axis. + !#zh 该节点 X 轴旋转角度。 */ + rotationX: number; + /** !#en Rotation on y axis. + !#zh 该节点 Y 轴旋转角度。 */ + rotationY: number; + /** !#en Scale on x axis. + !#zh 节点 X 轴缩放。 */ + scaleX: number; + /** !#en Scale on y axis. + !#zh 节点 Y 轴缩放。 */ + scaleY: number; + /** !#en Skew x + !#zh 该节点 Y 轴倾斜角度。 */ + skewX: number; + /** !#en Skew y + !#zh 该节点 X 轴倾斜角度。 */ + skewY: number; + /** !#en Opacity of node, default value is 255. + !#zh 节点透明度,默认值为 255。 */ + opacity: number; + /** !#en Indicate whether node's opacity value affect its child nodes, default value is true. + !#zh 节点的不透明度值是否影响其子节点,默认值为 true。 */ + cascadeOpacity: boolean; + /** !#en Color of node, default value is white: (255, 255, 255). + !#zh 节点颜色。默认为白色,数值为:(255,255,255)。 */ + color: Color; + /** !#en Anchor point's position on x axis. + !#zh 节点 X 轴锚点位置。 */ + anchorX: number; + /** !#en Anchor point's position on y axis. + !#zh 节点 Y 轴锚点位置。 */ + anchorY: number; + /** !#en Width of node. + !#zh 节点宽度。 */ + width: number; + /** !#en Height of node. + !#zh 节点高度。 */ + height: number; + /** !#en Z order in depth which stands for the drawing order. + !#zh 该节点渲染排序的 Z 轴深度。 */ + zIndex: number; + /** + + @param name name + */ + constructor(name?: string); + /** + !#en + Register a callback of a specific event type on Node.
+ Use this method to register touch or mouse event permit propagation based on scene graph, + you can propagate the event to the parents or swallow it by calling stopPropagation on the event.
+ It's the recommended way to register touch/mouse event for Node, + please do not use cc.eventManager directly for Node. + !#zh + 在节点上注册指定类型的回调函数,也可以设置 target 用于绑定响应函数的 this 对象。
+ 同时您可以将事件派发到父节点或者通过调用 stopPropagation 拦截它。
+ 推荐使用这种方式来监听节点上的触摸或鼠标事件,请不要在节点上直接使用 cc.eventManager。 + @param type A string representing the event type to listen for.
+ See {{#crossLink "Node/position-changed:event"}}Node Events{{/crossLink}} for all builtin events. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + this.node.on(cc.Node.EventType.TOUCH_START, this.memberFunction, this); // if "this" is component and the "memberFunction" declared in CCClass. + node.on(cc.Node.EventType.TOUCH_START, callback, this.node); + node.on(cc.Node.EventType.TOUCH_MOVE, callback, this.node); + node.on(cc.Node.EventType.TOUCH_END, callback, this.node); + node.on(cc.Node.EventType.TOUCH_CANCEL, callback, this.node); + node.on("anchor-changed", callback, this); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the callback previously registered with the same type, callback, target and or useCapture. + This method is merely an alias to removeEventListener. + !#zh 删除之前与同类型,回调,目标或 useCapture 注册的回调。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + this.node.off(cc.Node.EventType.TOUCH_START, this.memberFunction, this); + node.off(cc.Node.EventType.TOUCH_START, callback, this.node); + node.off("anchor-changed", callback, this); + ``` + */ + off(type: string, callback: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target. + !#zh 移除目标上的所有注册事件。 + @param target The target to be searched for all related callbacks + + @example + ```js + node.targetOff(target); + ``` + */ + targetOff(target: any): void; + /** + !#en Pause node related system events registered with the current Node. Node system events includes touch and mouse events. + If recursive is set to true, then this API will pause the node system events for the node and all nodes in its sub node tree. + Reference: http://cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/internal-events/ + !#zh 暂停当前节点上注册的所有节点系统事件,节点系统事件包含触摸和鼠标事件。 + 如果传递 recursive 为 true,那么这个 API 将暂停本节点和它的子树上所有节点的节点系统事件。 + 参考:http://cocos.com/docs/creator/scripting/internal-events.html + @param recursive Whether to pause node system events on the sub node tree. + + @example + ```js + node.pauseSystemEvents(true); + ``` + */ + pauseSystemEvents(recursive: boolean): void; + /** + !#en Resume node related system events registered with the current Node. Node system events includes touch and mouse events. + If recursive is set to true, then this API will resume the node system events for the node and all nodes in its sub node tree. + Reference: http://cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/internal-events/ + !#zh 恢复当前节点上注册的所有节点系统事件,节点系统事件包含触摸和鼠标事件。 + 如果传递 recursive 为 true,那么这个 API 将恢复本节点和它的子树上所有节点的节点系统事件。 + 参考:http://cocos.com/docs/creator/scripting/internal-events.html + @param recursive Whether to resume node system events on the sub node tree. + + @example + ```js + node.resumeSystemEvents(true); + ``` + */ + resumeSystemEvents(recursive: boolean): void; + /** + !#en + Executes an action, and returns the action that is executed.
+ The node becomes the action's target. Refer to cc.Action's getTarget()
+ Calling runAction while the node is not active won't have any effect.
+ Note:You shouldn't modify the action after runAction, that won't take any effect.
+ if you want to modify, when you define action plus. + !#zh + 执行并返回该执行的动作。该节点将会变成动作的目标。
+ 调用 runAction 时,节点自身处于不激活状态将不会有任何效果。
+ 注意:你不应该修改 runAction 后的动作,将无法发挥作用,如果想进行修改,请在定义 action 时加入。 + @param action action + + @example + ```js + var action = cc.scaleTo(0.2, 1, 0.6); + node.runAction(action); + node.runAction(action).repeatForever(); // fail + node.runAction(action.repeatForever()); // right + ``` + */ + runAction(action: Action): Action; + /** + !#en Pause all actions running on the current node. Equals to `cc.director.getActionManager().pauseTarget(node)`. + !#zh 暂停本节点上所有正在运行的动作。和 `cc.director.getActionManager().pauseTarget(node);` 等价。 + + @example + ```js + node.pauseAllActions(); + ``` + */ + pauseAllActions(): void; + /** + !#en Resume all paused actions on the current node. Equals to `cc.director.getActionManager().resumeTarget(node)`. + !#zh 恢复运行本节点上所有暂停的动作。和 `cc.director.getActionManager().resumeTarget(node);` 等价。 + + @example + ```js + node.resumeAllActions(); + ``` + */ + resumeAllActions(): void; + /** + !#en Stops and removes all actions from the running action list . + !#zh 停止并且移除所有正在运行的动作列表。 + + @example + ```js + node.stopAllActions(); + ``` + */ + stopAllActions(): void; + /** + !#en Stops and removes an action from the running action list. + !#zh 停止并移除指定的动作。 + @param action An action object to be removed. + + @example + ```js + var action = cc.scaleTo(0.2, 1, 0.6); + node.stopAction(action); + ``` + */ + stopAction(action: Action): void; + /** + !#en Removes an action from the running action list by its tag. + !#zh 停止并且移除指定标签的动作。 + @param tag A tag that indicates the action to be removed. + + @example + ```js + node.stopAction(1); + ``` + */ + stopActionByTag(tag: number): void; + /** + !#en Returns an action from the running action list by its tag. + !#zh 通过标签获取指定动作。 + @param tag tag + + @example + ```js + var action = node.getActionByTag(1); + ``` + */ + getActionByTag(tag: number): Action; + /** + !#en + Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays).
+ Composable actions are counted as 1 action. Example:
+ If you are running 1 Sequence of 7 actions, it will return 1.
+ If you are running 7 Sequences of 2 actions, it will return 7.

+ !#zh + 获取运行着的动作加上正在调度运行的动作的总数。
+ 例如:
+ - 如果你正在运行 7 个动作中的 1 个 Sequence,它将返回 1。
+ - 如果你正在运行 2 个动作中的 7 个 Sequence,它将返回 7。
+ + @example + ```js + var count = node.getNumberOfRunningActions(); + cc.log("Running Action Count: " + count); + ``` + */ + getNumberOfRunningActions(): number; + /** + !#en Returns a copy of the position (x, y) of the node in its parent's coordinates. + !#zh 获取节点在父节点坐标系中的位置(x, y)。 + + @example + ```js + cc.log("Node Position: " + node.getPosition()); + ``` + */ + getPosition(): Vec2; + /** + !#en + Sets the position (x, y) of the node in its parent's coordinates.
+ Usually we use cc.v2(x, y) to compose cc.Vec2 object.
+ and Passing two numbers (x, y) is more efficient than passing cc.Vec2 object. + !#zh + 设置节点在父节点坐标系中的位置。
+ 可以通过两种方式设置坐标点:
+ 1. 传入 2 个数值 x 和 y。
+ 2. 传入 cc.v2(x, y) 类型为 cc.Vec2 的对象。 + @param newPosOrX X coordinate for position or the position (x, y) of the node in coordinates + @param y Y coordinate for position + + @example + ```js + node.setPosition(cc.v2(0, 0)); + node.setPosition(0, 0); + + ``` + */ + setPosition(newPosOrX: Vec2|number, y?: number): void; + /** + !#en + Returns the scale factor of the node. + Assertion will fail when _scaleX != _scaleY. + !#zh 获取节点的缩放。当 X 轴和 Y 轴有相同的缩放数值时。 + + @example + ```js + cc.log("Node Scale: " + node.getScale()); + ``` + */ + getScale(): number; + /** + !#en Sets the scale factor of the node. 1.0 is the default scale factor. This function can modify the X and Y scale at the same time. + !#zh 设置节点的缩放比例,默认值为 1.0。这个函数可以在同一时间修改 X 和 Y 缩放。 + @param scaleX scaleX or scale + @param scaleY scaleY + + @example + ```js + node.setScale(cc.v2(1, 1)); + node.setScale(1, 1); + ``` + */ + setScale(scaleX: number|Vec2, scaleY?: number): void; + /** + !#en + Returns a copy the untransformed size of the node.
+ The contentSize remains the same no matter the node is scaled or rotated.
+ All nodes has a size. Layer and Scene has the same size of the screen by default.
+ !#zh 获取节点自身大小,不受该节点是否被缩放或者旋转的影响。 + @param ignoreSizeProvider true if you need to get the original size of the node + + @example + ```js + cc.log("Content Size: " + node.getContentSize()); + ``` + */ + getContentSize(ignoreSizeProvider?: boolean): Size; + /** + !#en + Sets the untransformed size of the node.
+ The contentSize remains the same no matter the node is scaled or rotated.
+ All nodes has a size. Layer and Scene has the same size of the screen. + !#zh 设置节点原始大小,不受该节点是否被缩放或者旋转的影响。 + @param size The untransformed size of the node or The untransformed size's width of the node. + @param height The untransformed size's height of the node. + + @example + ```js + node.setContentSize(cc.size(100, 100)); + node.setContentSize(100, 100); + ``` + */ + setContentSize(size: Size|number, height?: number): void; + /** + !#en + Set whether color should be changed with the opacity value, + useless in ccsg.Node, but this function is override in some class to have such behavior. + !#zh 设置更改透明度时是否修改RGB值, + @param opacityValue opacityValue + + @example + ```js + node.setOpacityModifyRGB(true); + ``` + */ + setOpacityModifyRGB(opacityValue: boolean): void; + /** + !#en Get whether color should be changed with the opacity value. + !#zh 更改透明度时是否修改RGB值。 + + @example + ```js + var hasChange = node.isOpacityModifyRGB(); + ``` + */ + isOpacityModifyRGB(): boolean; + /** + !#en + Returns a copy of the anchor point.
+ Anchor point is the point around which all transformations and positioning manipulations take place.
+ It's like a pin in the node where it is "attached" to its parent.
+ The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner.
+ But you can use values higher than (1,1) and lower than (0,0) too.
+ The default anchor point is (0.5,0.5), so it starts at the center of the node. + !#zh + 获取节点锚点,用百分比表示。
+ 锚点应用于所有变换和坐标点的操作,它就像在节点上连接其父节点的大头针。
+ 锚点是标准化的,就像百分比一样。(0,0) 表示左下角,(1,1) 表示右上角。
+ 但是你可以使用比(1,1)更高的值或者比(0,0)更低的值。
+ 默认的锚点是(0.5,0.5),因此它开始于节点的中心位置。
+ 注意:Creator 中的锚点仅用于定位所在的节点,子节点的定位不受影响。 + + @example + ```js + cc.log("Node AnchorPoint: " + node.getAnchorPoint()); + ``` + */ + getAnchorPoint(): Vec2; + /** + !#en + Sets the anchor point in percent.
+ anchor point is the point around which all transformations and positioning manipulations take place.
+ It's like a pin in the node where it is "attached" to its parent.
+ The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner.
+ But you can use values higher than (1,1) and lower than (0,0) too.
+ The default anchor point is (0.5,0.5), so it starts at the center of the node. + !#zh + 设置锚点的百分比。
+ 锚点应用于所有变换和坐标点的操作,它就像在节点上连接其父节点的大头针。
+ 锚点是标准化的,就像百分比一样。(0,0) 表示左下角,(1,1) 表示右上角。
+ 但是你可以使用比(1,1)更高的值或者比(0,0)更低的值。
+ 默认的锚点是(0.5,0.5),因此它开始于节点的中心位置。
+ 注意:Creator 中的锚点仅用于定位所在的节点,子节点的定位不受影响。 + @param point The anchor point of node or The x axis anchor of node. + @param y The y axis anchor of node. + + @example + ```js + node.setAnchorPoint(cc.v2(1, 1)); + node.setAnchorPoint(1, 1); + ``` + */ + setAnchorPoint(point: Vec2|number, y?: number): void; + /** + !#en + Returns a copy of the anchor point in absolute pixels.
+ you can only read it. If you wish to modify it, use setAnchorPoint. + !#zh + 返回锚点的绝对像素位置。
+ 你只能读它。如果您要修改它,使用 setAnchorPoint。 + + @example + ```js + cc.log("AnchorPointInPoints: " + node.getAnchorPointInPoints()); + ``` + */ + getAnchorPointInPoints(): Vec2; + /** + !#en + Returns the displayed opacity of Node, + the difference between displayed opacity and opacity is that displayed opacity is calculated based on opacity and parent node's opacity when cascade opacity enabled. + !#zh + 获取节点显示透明度, + 显示透明度和透明度之间的不同之处在于当启用级连透明度时, + 显示透明度是基于自身透明度和父节点透明度计算的。 + + @example + ```js + var displayOpacity = node.getDisplayedOpacity(); + ``` + */ + getDisplayedOpacity(): number; + /** + !#en + Returns the displayed color of Node, + the difference between displayed color and color is that displayed color is calculated based on color and parent node's color when cascade color enabled. + !#zh + 获取节点的显示颜色, + 显示颜色和颜色之间的不同之处在于当启用级连颜色时, + 显示颜色是基于自身颜色和父节点颜色计算的。 + + @example + ```js + var displayColor = node.getDisplayedColor(); + ``` + */ + getDisplayedColor(): Color; + /** + !#en + Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates.
+ The matrix is in Pixels.
+ This method is AR (Anchor Relative). + !#zh + 返回这个将节点(局部)的空间坐标系转换成父节点的空间坐标系的矩阵。
+ 这个矩阵以像素为单位。
+ 该方法基于节点坐标。 + + @example + ```js + var affineTransform = node.getNodeToParentTransformAR(); + ``` + */ + getNodeToParentTransformAR(): AffineTransform; + /** + !#en + Returns a "local" axis aligned bounding box of the node.
+ The returned box is relative only to its parent. + !#zh 返回父节坐标系下的轴向对齐的包围盒。 + + @example + ```js + var boundingBox = node.getBoundingBox(); + ``` + */ + getBoundingBox(): Rect; + /** + !#en + Returns a "world" axis aligned bounding box of the node.
+ The bounding box contains self and active children's world bounding box. + !#zh + 返回节点在世界坐标系下的对齐轴向的包围盒(AABB)。
+ 该边框包含自身和已激活的子节点的世界边框。 + + @example + ```js + var newRect = node.getBoundingBoxToWorld(); + ``` + */ + getBoundingBoxToWorld(): Rect; + /** + !#en + Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates.
+ The matrix is in Pixels. + !#zh 返回这个将节点(局部)的空间坐标系转换成父节点的空间坐标系的矩阵。这个矩阵以像素为单位。 + + @example + ```js + var affineTransform = node.getNodeToParentTransform(); + ``` + */ + getNodeToParentTransform(): AffineTransform; + /** + !#en Returns the world affine transform matrix. The matrix is in Pixels. + !#zh 返回节点到世界坐标系的仿射变换矩阵。矩阵单位是像素。 + + @example + ```js + var affineTransform = node.getNodeToWorldTransform(); + ``` + */ + getNodeToWorldTransform(): AffineTransform; + /** + !#en + Returns the world affine transform matrix. The matrix is in Pixels.
+ This method is AR (Anchor Relative). + !#zh + 返回节点到世界坐标仿射变换矩阵。矩阵单位是像素。
+ 该方法基于节点坐标。 + + @example + ```js + var mat = node.getNodeToWorldTransformAR(); + ``` + */ + getNodeToWorldTransformAR(): AffineTransform; + /** + !#en + Returns the matrix that transform parent's space coordinates to the node's (local) space coordinates.
+ The matrix is in Pixels. The returned transform is readonly and cannot be changed. + !#zh + 返回将父节点的坐标系转换成节点(局部)的空间坐标系的矩阵。
+ 该矩阵以像素为单位。返回的矩阵是只读的,不能更改。 + + @example + ```js + var affineTransform = node.getParentToNodeTransform(); + ``` + */ + getParentToNodeTransform(): AffineTransform; + /** + !#en Returns the inverse world affine transform matrix. The matrix is in Pixels. + !#en 返回世界坐标系到节点坐标系的逆矩阵。 + + @example + ```js + var affineTransform = node.getWorldToNodeTransform(); + ``` + */ + getWorldToNodeTransform(): AffineTransform; + /** + !#en Converts a Point to node (local) space coordinates. The result is in Vec2. + !#zh 将一个点转换到节点 (局部) 坐标系。结果以 Vec2 为单位。 + @param worldPoint worldPoint + + @example + ```js + var newVec2 = node.convertToNodeSpace(cc.v2(100, 100)); + ``` + */ + convertToNodeSpace(worldPoint: Vec2): Vec2; + /** + !#en Converts a Point to world space coordinates. The result is in Points. + !#zh 将一个点转换到世界空间坐标系。结果以 Vec2 为单位。 + @param nodePoint nodePoint + + @example + ```js + var newVec2 = node.convertToWorldSpace(cc.v2(100, 100)); + ``` + */ + convertToWorldSpace(nodePoint: Vec2): Vec2; + /** + !#en + Converts a Point to node (local) space coordinates. The result is in Points.
+ treating the returned/received node point as anchor relative. + !#zh + 将一个点转换到节点 (局部) 空间坐标系。结果以 Vec2 为单位。
+ 返回值将基于节点坐标。 + @param worldPoint worldPoint + + @example + ```js + var newVec2 = node.convertToNodeSpaceAR(cc.v2(100, 100)); + ``` + */ + convertToNodeSpaceAR(worldPoint: Vec2): Vec2; + /** + !#en + Converts a local Point to world space coordinates.The result is in Points.
+ treating the returned/received node point as anchor relative. + !#zh + 将一个点转换到世界空间坐标系。结果以 Vec2 为单位。
+ 返回值将基于世界坐标。 + @param nodePoint nodePoint + + @example + ```js + var newVec2 = node.convertToWorldSpaceAR(cc.v2(100, 100)); + ``` + */ + convertToWorldSpaceAR(nodePoint: Vec2): Vec2; + /** + !#en convenience methods which take a cc.Touch instead of cc.Vec2. + !#zh 将触摸点转换成本地坐标系中位置。 + @param touch The touch object + + @example + ```js + var newVec2 = node.convertTouchToNodeSpace(touch); + ``` + */ + convertTouchToNodeSpace(touch: Touch): Vec2; + /** + !#en converts a cc.Touch (world coordinates) into a local coordinate. This method is AR (Anchor Relative). + !#zh 转换一个 cc.Touch(世界坐标)到一个局部坐标,该方法基于节点坐标。 + @param touch The touch object + + @example + ```js + var newVec2 = node.convertTouchToNodeSpaceAR(touch); + ``` + */ + convertTouchToNodeSpaceAR(touch: Touch): Vec2; + /** + !#en + Adds a child to the node with z order and tag. + !#zh + 添加子节点,并且可以修改该节点的 局部 Z 顺序和标签。 + @param child A child node + @param localZOrder Z order for drawing priority. Please refer to setZOrder(int) + @param tag An integer or a name to identify the node easily. Please refer to setTag(int) and setName(string) + + @example + ```js + node.addChild(newNode, 1, 1001); + ``` + */ + addChild(child: Node, localZOrder?: number, tag?: number|string): void; + /** + !#en Stops all running actions and schedulers. + !#zh 停止所有正在播放的动作和计时器。 + + @example + ```js + node.cleanup(); + ``` + */ + cleanup(): void; + /** + !#en Sorts the children array depends on children's zIndex and arrivalOrder, + normally you won't need to invoke this function. + !#zh 根据子节点的 zIndex 和 arrivalOrder 进行排序,正常情况下开发者不需要手动调用这个函数。 + */ + sortAllChildren(): void; + /** !#en The local scale relative to the parent. + !#zh 节点相对父节点的缩放。 */ + scale: number; + /** + !#en Returns the x axis position of the node in cocos2d coordinates. + !#zh 获取节点 X 轴坐标。 + + @example + ```js + var posX = node.getPositionX(); + ``` + */ + getPositionX(): number; + /** + !#en Sets the x axis position of the node in cocos2d coordinates. + !#zh 设置节点 X 轴坐标。 + @param x x + + @example + ```js + node.setPositionX(1); + ``` + */ + setPositionX(x: number): void; + /** + !#en Returns the y axis position of the node in cocos2d coordinates. + !#zh 获取节点 Y 轴坐标。 + + @example + ```js + var posY = node.getPositionY(); + ``` + */ + getPositionY(): number; + /** + !#en Sets the y axis position of the node in cocos2d coordinates. + !#zh 设置节点 Y 轴坐标。 + @param y The new position in y axis + + @example + ```js + node.setPositionY(100); + ``` + */ + setPositionY(y: number): void; + /** + !#en Returns the local Z order of this node. + !#zh 获取节点局部 Z 轴顺序。 + + @example + ```js + var localZorder = node.getLocalZOrder(); + ``` + */ + getLocalZOrder(): number; + /** + !#en + LocalZOrder is the 'key' used to sort the node relative to its siblings.
+
+ The Node's parent will sort all its children based ont the LocalZOrder value.
+ If two nodes have the same LocalZOrder, then the node that was added first to the children's array
+ will be in front of the other node in the array.
+ Also, the Scene Graph is traversed using the "In-Order" tree traversal algorithm ( http://en.wikipedia.org/wiki/Tree_traversal#In-order )
+ And Nodes that have LocalZOder values smaller than 0 are the "left" subtree
+ While Nodes with LocalZOder greater than 0 are the "right" subtree. + !#zh + LocalZOrder 是 “key” (关键)来分辨节点和它兄弟节点的相关性。 + 父节点将会通过 LocalZOrder 的值来分辨所有的子节点。 + 如果两个节点有同样的 LocalZOrder,那么先加入子节点数组的节点将会显示在后加入的节点的前面。 + 同样的,场景图使用 “In-Order(按顺序)” 遍历数算法来遍历 + ( http://en.wikipedia.org/wiki/Tree_traversal#In-order ) 并且拥有小于 0 的 LocalZOrder 的值的节点是 “ left ” 子树(左子树) + 所以拥有大于 0 的 LocalZOrder 的值得节点是 “ right ”子树(右子树)。 + @param localZOrder localZOrder + + @example + ```js + node.setLocalZOrder(1); + ``` + */ + setLocalZOrder(localZOrder: number): void; + /** + !#en Returns whether node's opacity value affect its child nodes. + !#zh 返回节点的不透明度值是否影响其子节点。 + + @example + ```js + cc.log(node.isCascadeOpacityEnabled()); + ``` + */ + isCascadeOpacityEnabled(): boolean; + /** + !#en Enable or disable cascade opacity, if cascade enabled, child nodes' opacity will be the multiplication of parent opacity and its own opacity. + !#zh 启用或禁用级连不透明度,如果级连启用,子节点的不透明度将是父不透明度乘上它自己的不透明度。 + @param cascadeOpacityEnabled cascadeOpacityEnabled + + @example + ```js + node.setCascadeOpacityEnabled(true); + ``` + */ + setCascadeOpacityEnabled(cascadeOpacityEnabled: boolean): void; + } + /** !#en + cc.Scene is a subclass of cc.Node that is used only as an abstract concept.
+ cc.Scene and cc.Node are almost identical with the difference that users can not modify cc.Scene manually. + !#zh + cc.Scene 是 cc.Node 的子类,仅作为一个抽象的概念。
+ cc.Scene 和 cc.Node 有点不同,用户不应直接修改 cc.Scene。 */ + export class Scene extends Node { + /** !#en Indicates whether all (directly or indirectly) static referenced assets of this scene are releasable by default after scene unloading. + !#zh 指示该场景中直接或间接静态引用到的所有资源是否默认在场景切换后自动释放。 */ + autoReleaseAssets: boolean; + } + /** !#en + Scheduler is responsible of triggering the scheduled callbacks.
+ You should not use NSTimer. Instead use this class.
+
+ There are 2 different types of callbacks (selectors):
+ - update callback: the 'update' callback will be called every frame. You can customize the priority.
+ - custom callback: A custom callback will be called every frame, or with a custom interval of time
+
+ The 'custom selectors' should be avoided when possible. It is faster, + and consumes less memory to use the 'update callback'. * + !#zh + Scheduler 是负责触发回调函数的类。
+ 通常情况下,建议使用 cc.director.getScheduler() 来获取系统定时器。
+ 有两种不同类型的定时器:
+ - update 定时器:每一帧都会触发。您可以自定义优先级。
+ - 自定义定时器:自定义定时器可以每一帧或者自定义的时间间隔触发。
+ 如果希望每帧都触发,应该使用 update 定时器,使用 update 定时器更快,而且消耗更少的内存。 */ + export class Scheduler { + /** + !#en + Modifies the time of all scheduled callbacks.
+ You can use this property to create a 'slow motion' or 'fast forward' effect.
+ Default is 1.0. To create a 'slow motion' effect, use values below 1.0.
+ To create a 'fast forward' effect, use values higher than 1.0.
+ Note:It will affect EVERY scheduled selector / action. + !#zh + 设置时间间隔的缩放比例。
+ 您可以使用这个方法来创建一个 “slow motion(慢动作)” 或 “fast forward(快进)” 的效果。
+ 默认是 1.0。要创建一个 “slow motion(慢动作)” 效果,使用值低于 1.0。
+ 要使用 “fast forward(快进)” 效果,使用值大于 1.0。
+ 注意:它影响该 Scheduler 下管理的所有定时器。 + @param timeScale timeScale + */ + setTimeScale(timeScale: number): void; + /** + !#en Returns time scale of scheduler. + !#zh 获取时间间隔的缩放比例。 + */ + getTimeScale(): number; + /** + !#en 'update' the scheduler. (You should NEVER call this method, unless you know what you are doing.) + !#zh update 调度函数。(不应该直接调用这个方法,除非完全了解这么做的结果) + @param dt delta time + */ + update(dt: number): void; + /** + !#en +

+ The scheduled method will be called every 'interval' seconds.
+ If paused is YES, then it won't be called until it is resumed.
+ If 'interval' is 0, it will be called every frame, but if so, it recommended to use 'scheduleUpdateForTarget:' instead.
+ If the callback function is already scheduled, then only the interval parameter will be updated without re-scheduling it again.
+ repeat let the action be repeated repeat + 1 times, use cc.macro.REPEAT_FOREVER to let the action run continuously
+ delay is the amount of time the action will wait before it'll start
+

+ !#zh + 指定回调函数,调用对象等信息来添加一个新的定时器。
+ 当时间间隔达到指定值时,设置的回调函数将会被调用。
+ 如果 paused 值为 true,那么直到 resume 被调用才开始计时。
+ 如果 interval 值为 0,那么回调函数每一帧都会被调用,但如果是这样, + 建议使用 scheduleUpdateForTarget 代替。
+ 如果回调函数已经被定时器使用,那么只会更新之前定时器的时间间隔参数,不会设置新的定时器。
+ repeat 值可以让定时器触发 repeat + 1 次,使用 cc.macro.REPEAT_FOREVER + 可以让定时器一直循环触发。
+ delay 值指定延迟时间,定时器会在延迟指定的时间之后开始计时。 + @param target target + @param callback_fn callback_fn + @param interval interval + @param repeat repeat + @param delay delay + @param paused paused + + @example + ```js + //register a schedule to scheduler + var scheduler = cc.director.getScheduler(); + scheduler.scheduleCallbackForTarget(this, function, interval, repeat, delay, !this._isRunning); + + ``` + */ + scheduleCallbackForTarget(target: any, callback: Function, interval: number, repeat: number, delay: number, paused?: boolean): void; + scheduleCallbackForTarget(target: any, callback: Function, interval: number, paused?: boolean): void; + /** + !#en The schedule + !#zh 定时器 + @param callback callback + @param target target + @param interval interval + @param repeat repeat + @param delay delay + @param paused paused + + @example + ```js + //register a schedule to scheduler + cc.director.getScheduler().schedule(callback, this, interval, !this._isRunning); + + ``` + */ + schedule(callback: Function, target: any, interval: number, repeat: number, delay: number, paused?: boolean): void; + schedule(callback: Function, target: any, interval: number, paused?: boolean): void; + /** + !#en + Schedules the update callback for a given target, + the callback will be invoked every frame after schedule started. + !#zh + 使用指定的优先级为指定的对象设置 update 定时器。 + update 定时器每一帧都会被触发。优先级的值越低,定时器被触发的越早。 + @param target target + @param priority priority + @param paused paused + @param updateFunc updateFunc + */ + scheduleUpdate(target: any, priority: number, paused: boolean, updateFunc: Function): void; + /** + !#en + Unschedules a callback for a callback and a given target. + If you want to unschedule the "update", use `unscheduleUpdate()` + !#zh + 根据指定的回调函数和调用对象。 + 如果需要取消 update 定时器,请使用 unscheduleUpdate()。 + @param callback The callback to be unscheduled + @param target The target bound to the callback. + */ + unschedule(callback: Function, target: any): void; + /** + !#en Unschedules the update callback for a given target. + !#zh 取消指定对象的 update 定时器。 + @param target The target to be unscheduled. + */ + unscheduleUpdate(target: any): void; + /** + !#en + Unschedules all scheduled callbacks for a given target. + This also includes the "update" callback. + !#zh 取消指定对象的所有定时器,包括 update 定时器。 + @param target The target to be unscheduled. + */ + unscheduleAllForTarget(target: any): void; + /** + !#en + Unschedules all scheduled callbacks from all targets including the system callbacks.
+ You should NEVER call this method, unless you know what you are doing. + !#zh + 取消所有对象的所有定时器,包括系统定时器。
+ 不用调用此函数,除非你确定你在做什么。 + */ + unscheduleAll(): void; + /** + !#en + Unschedules all callbacks from all targets with a minimum priority.
+ You should only call this with `PRIORITY_NON_SYSTEM_MIN` or higher. + !#zh + 取消所有优先级的值大于指定优先级的定时器。
+ 你应该只取消优先级的值大于 PRIORITY_NON_SYSTEM_MIN 的定时器。 + @param minPriority The minimum priority of selector to be unscheduled. Which means, all selectors which + priority is higher than minPriority will be unscheduled. + */ + unscheduleAllWithMinPriority(minPriority: number): void; + /** + !#en Checks whether a callback for a given target is scheduled. + !#zh 检查指定的回调函数和回调对象组合是否存在定时器。 + @param callback The callback to check. + @param target The target of the callback. + */ + isScheduled(callback: Function, target: any): boolean; + /** + !#en + Pause all selectors from all targets.
+ You should NEVER call this method, unless you know what you are doing. + !#zh + 暂停所有对象的所有定时器。
+ 不要调用这个方法,除非你知道你正在做什么。 + */ + pauseAllTargets(): void; + /** + !#en + Pause all selectors from all targets with a minimum priority.
+ You should only call this with kCCPriorityNonSystemMin or higher. + !#zh + 暂停所有优先级的值大于指定优先级的定时器。
+ 你应该只暂停优先级的值大于 PRIORITY_NON_SYSTEM_MIN 的定时器。 + @param minPriority minPriority + */ + pauseAllTargetsWithMinPriority(minPriority: number): void; + /** + !#en + Resume selectors on a set of targets.
+ This can be useful for undoing a call to pauseAllCallbacks. + !#zh + 恢复指定数组中所有对象的定时器。
+ 这个函数是 pauseAllCallbacks 的逆操作。 + @param targetsToResume targetsToResume + */ + resumeTargets(targetsToResume: any[]): void; + /** + !#en + Pauses the target.
+ All scheduled selectors/update for a given target won't be 'ticked' until the target is resumed.
+ If the target is not present, nothing happens. + !#zh + 暂停指定对象的定时器。
+ 指定对象的所有定时器都会被暂停。
+ 如果指定的对象没有定时器,什么也不会发生。 + @param target target + */ + pauseTarget(target: any): void; + /** + !#en + Resumes the target.
+ The 'target' will be unpaused, so all schedule selectors/update will be 'ticked' again.
+ If the target is not present, nothing happens. + !#zh + 恢复指定对象的所有定时器。
+ 指定对象的所有定时器将继续工作。
+ 如果指定的对象没有定时器,什么也不会发生。 + @param target target + */ + resumeTarget(target: any): void; + /** + !#en Returns whether or not the target is paused. + !#zh 返回指定对象的定时器是否暂停了。 + @param target target + */ + isTargetPaused(target: any): boolean; + /** + !#en + Schedules the 'update' callback_fn for a given target with a given priority.
+ The 'update' callback_fn will be called every frame.
+ The lower the priority, the earlier it is called. + !#zh + 为指定对象设置 update 定时器。
+ update 定时器每一帧都会被调用。
+ 优先级的值越低,越早被调用。 + @param target target + @param priority priority + @param paused paused + + @example + ```js + //register this object to scheduler + var scheduler = cc.director.getScheduler(); + scheduler.scheduleUpdateForTarget(this, priority, !this._isRunning ); + + ``` + */ + scheduleUpdateForTarget(target: any, priority: number, paused: boolean): void; + /** + !#en + Unschedule a callback function for a given target.
+ If you want to unschedule the "update", use unscheduleUpdateForTarget. + !#zh + 根据指定的回调函数和调用对象对象取消相应的定时器。
+ 如果需要取消 update 定时器,请使用 unscheduleUpdateForTarget()。 + @param target target + @param callback callback[Function] or key[String] + + @example + ```js + //unschedule a callback of target + var scheduler = cc.director.getScheduler(); + scheduler.unscheduleCallbackForTarget(this, callback); + + ``` + */ + unscheduleCallbackForTarget(target: any, callback: Function): void; + /** + !#en Unschedules the update callback function for a given target. + !#zh 取消指定对象的所有定时器。 + @param target target + + @example + ```js + //unschedules the "update" method. + var scheduler = cc.director.getScheduler(); + scheduler.unscheduleUpdateForTarget(this); + + ``` + */ + unscheduleUpdateForTarget(target: any): void; + /** + !#en + Unschedules all function callbacks for a given target.
+ This also includes the "update" callback function. + !#zh 取消指定对象的所有定时器,包括 update 定时器。 + @param target target + */ + unscheduleAllCallbacksForTarget(target: any): void; + /** + !#en + Unschedules all function callbacks from all targets.
+ You should NEVER call this method, unless you know what you are doing. + !#zh + 取消所有对象的所有定时器。
+ 不要调用这个方法,除非你知道你正在做什么。 + */ + unscheduleAllCallbacks(): void; + /** + !#en + Unschedules all function callbacks from all targets with a minimum priority.
+ You should only call this with kCCPriorityNonSystemMin or higher. + !#zh + 取消所有优先级的值大于指定优先级的所有对象的所有定时器。
+ 你应该只暂停优先级的值大于 PRIORITY_NON_SYSTEM_MIN 的定时器。 + @param minPriority minPriority + */ + unscheduleAllCallbacksWithMinPriority(minPriority: number): void; + /** !#en Priority level reserved for system services. + !#zh 系统服务的优先级。 */ + static PRIORITY_SYSTEM: number; + /** !#en Minimum priority level for user scheduling. + !#zh 用户调度最低优先级。 */ + static PRIORITY_NON_SYSTEM: number; + } + /** !#en cc.audioEngine is the singleton object, it provide simple audio APIs. + !#zh + cc.audioengine是单例对象。
+ 主要用来播放音频,播放的时候会返回一个 audioID,之后都可以通过这个 audioID 来操作这个音频对象。
+ 不使用的时候,请使用 cc.audioEngine.uncache(filePath); 进行资源释放
+ 注意:
+ 在 Android 系统浏览器上,不同浏览器,不同版本的效果不尽相同。
+ 比如说:大多数浏览器都需要用户物理交互才可以开始播放音效,有一些不支持 WebAudio,
+ 有一些不支持多音轨播放。总之如果对音乐依赖比较强,请做尽可能多的测试。 */ + export class audioEngine { + /** + !#en Play audio. + !#zh 播放音频 + @param filePath The path of the audio file without filename extension. + @param loop Whether the music loop or not. + @param volume Volume size. + + @example + ```js + var audioID = cc.audioEngine.play(path, false, 0.5); + ``` + */ + static play(filePath: string, loop: boolean, volume: number): number; + /** + !#en Set audio loop. + !#zh 设置音频是否循环。 + @param audioID audio id. + @param loop Whether cycle. + + @example + ```js + cc.audioEngine.setLoop(id, true); + ``` + */ + static setLoop(audioID: number, loop: boolean): void; + /** + !#en Get audio cycle state. + !#zh 获取音频的循环状态。 + @param audioID audio id. + + @example + ```js + cc.audioEngine.isLoop(id); + ``` + */ + static isLoop(audioID: number): boolean; + /** + !#en Set the volume of audio. + !#zh 设置音量(0.0 ~ 1.0)。 + @param audioID audio id. + @param volume Volume must be in 0.0~1.0 . + + @example + ```js + cc.audioEngine.setVolume(id, 0.5); + ``` + */ + static setVolume(audioID: number, volume: number): void; + /** + !#en The volume of the music max value is 1.0,the min value is 0.0 . + !#zh 获取音量(0.0 ~ 1.0)。 + @param audioID audio id. + + @example + ```js + var volume = cc.audioEngine.getVolume(id); + ``` + */ + static getVolume(audioID: number): number; + /** + !#en Set current time + !#zh 设置当前的音频时间。 + @param audioID audio id. + @param sec current time. + + @example + ```js + cc.audioEngine.setCurrentTime(id, 2); + ``` + */ + static setCurrentTime(audioID: number, sec: number): boolean; + /** + !#en Get current time + !#zh 获取当前的音频播放时间。 + @param audioID audio id. + + @example + ```js + var time = cc.audioEngine.getCurrentTime(id); + ``` + */ + static getCurrentTime(audioID: number): number; + /** + !#en Get audio duration + !#zh 获取音频总时长。 + @param audioID audio id. + + @example + ```js + var time = cc.audioEngine.getDuration(id); + ``` + */ + static getDuration(audioID: number): number; + /** + !#en Get audio state + !#zh 获取音频状态。 + @param audioID audio id. + + @example + ```js + var state = cc.audioEngine.getState(id); + ``` + */ + static getState(audioID: number): audioEngine.AudioState; + /** + !#en Set Audio finish callback + !#zh 设置一个音频结束后的回调 + @param audioID audio id. + @param callback loaded callback. + + @example + ```js + cc.audioEngine.setFinishCallback(id, function () {}); + ``` + */ + static setFinishCallback(audioID: number, callback: Function): void; + /** + !#en Pause playing audio. + !#zh 暂停正在播放音频。 + @param audioID The return value of function play. + + @example + ```js + cc.audioEngine.pause(audioID); + ``` + */ + static pause(audioID: number): void; + /** + !#en Pause all playing audio + !#zh 暂停现在正在播放的所有音频。 + + @example + ```js + cc.audioEngine.pauseAll(); + ``` + */ + static pauseAll(): void; + /** + !#en Resume playing audio. + !#zh 恢复播放指定的音频。 + @param audioID The return value of function play. + + @example + ```js + cc.audioEngine.resume(audioID); + ``` + */ + static resume(audioID: number): void; + /** + !#en Resume all playing audio. + !#zh 恢复播放所有之前暂停的所有音频。 + + @example + ```js + cc.audioEngine.resumeAll(); + ``` + */ + static resumeAll(): void; + /** + !#en Stop playing audio. + !#zh 停止播放指定音频。 + @param audioID The return value of function play. + + @example + ```js + cc.audioEngine.stop(audioID); + ``` + */ + static stop(audioID: number): void; + /** + !#en Stop all playing audio. + !#zh 停止正在播放的所有音频。 + + @example + ```js + cc.audioEngine.stopAll(); + ``` + */ + static stopAll(): void; + /** + !#en Set up an audio can generate a few examples. + !#zh 设置一个音频可以设置几个实例 + @param num a number of instances to be created from within an audio + + @example + ```js + cc.audioEngine.setMaxAudioInstance(20); + ``` + */ + static setMaxAudioInstance(num: number): void; + /** + !#en Getting audio can produce several examples. + !#zh 获取一个音频可以设置几个实例 + + @example + ```js + cc.audioEngine.getMaxAudioInstance(); + ``` + */ + static getMaxAudioInstance(): number; + /** + !#en Unload the preloaded audio from internal buffer. + !#zh 卸载预加载的音频。 + @param filePath filePath + + @example + ```js + cc.audioEngine.uncache(filePath); + ``` + */ + static uncache(filePath: string): void; + /** + !#en Unload all audio from internal buffer. + !#zh 卸载所有音频。 + + @example + ```js + cc.audioEngine.uncacheAll(); + ``` + */ + static uncacheAll(): void; + /** + !#en Preload audio file. + !#zh 预加载一个音频 + @param filePath The file path of an audio. + @param callback The callback of an audio. + + @example + ```js + cc.audioEngine.preload(path); + ``` + */ + static preload(filePath: string, callback?: Function): void; + /** + !#en Set a size, the unit is KB. Over this size is directly resolved into DOM nodes. + !#zh 设置一个以 KB 为单位的尺寸,大于这个尺寸的音频在加载的时候会强制使用 dom 方式加载 + @param kb The file path of an audio. + + @example + ```js + cc.audioEngine.setMaxWebAudioSize(300); + ``` + */ + static setMaxWebAudioSize(kb: number): void; + } + /** !#en + cc.MotionStreak manages a Ribbon based on it's motion in absolute space.
+ You construct it with a fadeTime, minimum segment size, texture path, texture
+ length and color. The fadeTime controls how long it takes each vertex in
+ the streak to fade out, the minimum segment size it how many pixels the
+ streak will move before adding a new ribbon segment, and the texture
+ length is the how many pixels the texture is stretched across. The texture
+ is vertically aligned along the streak segment. + !#zh 运动轨迹,用于游戏对象的运动轨迹上实现拖尾渐隐效果。 */ + export class MotionStreak extends Component { + /** !#en + !#zh 在编辑器模式下预览拖尾效果。 */ + preview: boolean; + /** !#en The fade time to fade. + !#zh 拖尾的渐隐时间,以秒为单位。 */ + fadeTime: number; + /** !#en The minimum segment size. + !#zh 拖尾之间最小距离。 */ + minSeg: number; + /** !#en The stroke's width. + !#zh 拖尾的宽度。 */ + stroke: number; + /** !#en The texture of the MotionStreak. + !#zh 拖尾的贴图。 */ + texture: Texture2D; + /** !#en The color of the MotionStreak. + !#zh 拖尾的颜色 */ + color: Color; + /** !#en The fast Mode. + !#zh 是否启用了快速模式。当启用快速模式,新的点会被更快地添加,但精度较低。 */ + fastMode: boolean; + /** + !#en Remove all living segments of the ribbon. + !#zh 删除当前所有的拖尾片段。 + + @example + ```js + // Remove all living segments of the ribbon. + myMotionStreak.reset(); + ``` + */ + reset(): void; + } + /** Particle System base class.
+ Attributes of a Particle System:
+ - emmision rate of the particles
+ - Gravity Mode (Mode A):
+ - gravity
+ - direction
+ - speed +- variance
+ - tangential acceleration +- variance
+ - radial acceleration +- variance
+ - Radius Mode (Mode B):
+ - startRadius +- variance
+ - endRadius +- variance
+ - rotate +- variance
+ - Properties common to all modes:
+ - life +- life variance
+ - start spin +- variance
+ - end spin +- variance
+ - start size +- variance
+ - end size +- variance
+ - start color +- variance
+ - end color +- variance
+ - life +- variance
+ - blending function
+ - texture
+
+ cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).
+ 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guarateed in cocos2d,
+ cocos2d uses a another approach, but the results are almost identical.
+ cocos2d supports all the variables used by Particle Designer plus a bit more:
+ - spinning particles (supported when using ParticleSystem)
+ - tangential acceleration (Gravity mode)
+ - radial acceleration (Gravity mode)
+ - radius direction (Radius mode) (Particle Designer supports outwards to inwards direction only)
+ It is possible to customize any of the above mentioned properties in runtime. Example:
*/ + export class ParticleSystem extends _RendererUnderSG { + /** !#en Play particle in edit mode. + !#zh 在编辑器模式下预览粒子,启用后选中粒子时,粒子将自动播放。 */ + preview: boolean; + /** !#en + If set custom to true, then use custom properties insteadof read particle file. + !#zh 是否自定义粒子属性。 */ + custom: boolean; + /** !#en The plist file. + !#zh plist 格式的粒子配置文件。 */ + file: string; + /** . */ + texture: Texture2D; + /** !#en Current quantity of particles that are being simulated. + !#zh 当前播放的粒子数量。 */ + particleCount: number; + /** !#en Specify the source Blend Factor. + !#zh 指定原图混合模式。 */ + srcBlendFactor: BlendFactor; + /** !#en Specify the destination Blend Factor. + !#zh 指定目标的混合模式。 */ + dstBlendFactor: BlendFactor; + /** !#en If set to true, the particle system will automatically start playing on onLoad. + !#zh 如果设置为 true 运行时会自动发射粒子。 */ + playOnLoad: boolean; + /** !#en Indicate whether the owner node will be auto-removed when it has no particles left. + !#zh 粒子播放完毕后自动销毁所在的节点。 */ + autoRemoveOnFinish: boolean; + /** !#en Indicate whether the particle system is activated. + !#zh 是否激活粒子。 */ + active: boolean; + /** !#en Maximum particles of the system. + !#zh 粒子最大数量。 */ + totalParticles: number; + /** !#en How many seconds the emitter wil run. -1 means 'forever'. + !#zh 发射器生存时间,单位秒,-1表示持续发射。 */ + duration: number; + /** !#en Emission rate of the particles. + !#zh 每秒发射的粒子数目。 */ + emissionRate: number; + /** !#en Life of each particle setter. + !#zh 粒子的运行时间。 */ + life: number; + /** !#en Variation of life. + !#zh 粒子的运行时间变化范围。 */ + lifeVar: number; + /** !#en Start color of each particle. + !#zh 粒子初始颜色。 */ + startColor: Color; + /** !#en Variation of the start color. + !#zh 粒子初始颜色变化范围。 */ + startColorVar: Color; + /** !#en Ending color of each particle. + !#zh 粒子结束颜色。 */ + endColor: Color; + /** !#en Variation of the end color. + !#zh 粒子结束颜色变化范围。 */ + endColorVar: Color; + /** !#en Angle of each particle setter. + !#zh 粒子角度。 */ + angle: number; + /** !#en Variation of angle of each particle setter. + !#zh 粒子角度变化范围。 */ + angleVar: number; + /** !#en Start size in pixels of each particle. + !#zh 粒子的初始大小。 */ + startSize: number; + /** !#en Variation of start size in pixels. + !#zh 粒子初始大小的变化范围。 */ + startSizeVar: number; + /** !#en End size in pixels of each particle. + !#zh 粒子结束时的大小。 */ + endSize: number; + /** !#en Variation of end size in pixels. + !#zh 粒子结束大小的变化范围。 */ + endSizeVar: number; + /** !#en Start angle of each particle. + !#zh 粒子开始自旋角度。 */ + startSpin: number; + /** !#en Variation of start angle. + !#zh 粒子开始自旋角度变化范围。 */ + startSpinVar: number; + /** !#en End angle of each particle. + !#zh 粒子结束自旋角度。 */ + endSpin: number; + /** !#en Variation of end angle. + !#zh 粒子结束自旋角度变化范围。 */ + endSpinVar: number; + /** !#en Source position of the emitter. + !#zh 发射器位置。 */ + sourcePos: Vec2; + /** !#en Variation of source position. + !#zh 发射器位置的变化范围。(横向和纵向) */ + posVar: Vec2; + /** !#en Particles movement type. + !#zh 粒子位置类型。 */ + positionType: ParticleSystem.PositionType; + /** !#en Particles emitter modes. + !#zh 发射器类型。 */ + emitterMode: ParticleSystem.EmitterMode; + /** !#en Gravity of the emitter. + !#zh 重力。 */ + gravity: Vec2; + /** !#en Speed of the emitter. + !#zh 速度。 */ + speed: number; + /** !#en Variation of the speed. + !#zh 速度变化范围。 */ + speedVar: number; + /** !#en Tangential acceleration of each particle. Only available in 'Gravity' mode. + !#zh 每个粒子的切向加速度,即垂直于重力方向的加速度,只有在重力模式下可用。 */ + tangentialAccel: number; + /** !#en Variation of the tangential acceleration. + !#zh 每个粒子的切向加速度变化范围。 */ + tangentialAccelVar: number; + /** !#en Acceleration of each particle. Only available in 'Gravity' mode. + !#zh 粒子径向加速度,即平行于重力方向的加速度,只有在重力模式下可用。 */ + radialAccel: number; + /** !#en Variation of the radial acceleration. + !#zh 粒子径向加速度变化范围。 */ + radialAccelVar: number; + /** !#en Indicate whether the rotation of each particle equals to its direction. Only available in 'Gravity' mode. + !#zh 每个粒子的旋转是否等于其方向,只有在重力模式下可用。 */ + rotationIsDir: boolean; + /** !#en Starting radius of the particles. Only available in 'Radius' mode. + !#zh 初始半径,表示粒子出生时相对发射器的距离,只有在半径模式下可用。 */ + startRadius: number; + /** !#en Variation of the starting radius. + !#zh 初始半径变化范围。 */ + startRadiusVar: number; + /** !#en Ending radius of the particles. Only available in 'Radius' mode. + !#zh 结束半径,只有在半径模式下可用。 */ + endRadius: number; + /** !#en Variation of the ending radius. + !#zh 结束半径变化范围。 */ + endRadiusVar: number; + /** !#en Number of degress to rotate a particle around the source pos per second. Only available in 'Radius' mode. + !#zh 粒子每秒围绕起始点的旋转角度,只有在半径模式下可用。 */ + rotatePerS: number; + /** !#en Variation of the degress to rotate a particle around the source pos per second. + !#zh 粒子每秒围绕起始点的旋转角度变化范围。 */ + rotatePerSVar: number; + /** !#en The Particle emitter lives forever. + !#zh 表示发射器永久存在 */ + static DURATION_INFINITY: number; + /** !#en The starting size of the particle is equal to the ending size. + !#zh 表示粒子的起始大小等于结束大小。 */ + static START_SIZE_EQUAL_TO_END_SIZE: number; + /** !#en The starting radius of the particle is equal to the ending radius. + !#zh 表示粒子的起始半径等于结束半径。 */ + static START_RADIUS_EQUAL_TO_END_RADIUS: number; + /** + !#en Add a particle to the emitter. + !#zh 添加一个粒子到发射器中。 + */ + addParticle(): boolean; + /** + !#en Stop emitting particles. Running particles will continue to run until they die. + !#zh 停止发射器发射粒子,发射出去的粒子将继续运行,直至粒子生命结束。 + + @example + ```js + // stop particle system. + myParticleSystem.stopSystem(); + ``` + */ + stopSystem(): void; + /** + !#en Kill all living particles. + !#zh 杀死所有存在的粒子,然后重新启动粒子发射器。 + + @example + ```js + // play particle system. + myParticleSystem.resetSystem(); + ``` + */ + resetSystem(): void; + /** + !#en Whether or not the system is full. + !#zh 发射器中粒子是否大于等于设置的总粒子数量。 + */ + isFull(): boolean; + /** + !#en +

Sets a new CCSpriteFrame as particle.
+ WARNING: this method is experimental. Use setTextureWithRect instead. +

+ !#zh +

设置一个新的精灵帧为粒子。
+ 警告:这个函数只是试验,请使用 setTextureWithRect 实现。 +

+ @param spriteFrame spriteFrame + */ + setDisplayFrame(spriteFrame: SpriteFrame): void; + /** + !#en Sets a new texture with a rect. The rect is in texture position and size. + !#zh 设置一张新贴图和关联的矩形。 + @param texture texture + @param rect rect + */ + setTextureWithRect(texture: Texture2D, rect: Rect): void; + } + /** !#en Renders the TMX object. + !#zh 渲染 tmx object。 */ + export class TMXObject { + /** + !#en Get the name of object + !#zh 获取对象的名称 + */ + getObjectName(): string; + /** + !#en Get the property of object + !#zh 获取对象的属性 + @param propertyName propertyName + */ + getProperty(propertyName: string): any; + /** + !#en Get the properties of object + !#zh 获取对象的属性 + */ + getProperties(): any; + /** + !#en Set the object name + !#zh 设置对象名称 + @param name name + */ + setObjectName(name: string): void; + /** + !#en Set the properties of the object + !#zh 设置对象的属性 + @param props props + */ + setProperties(props: any): void; + } + /** !#en Render the TMX layer. + !#zh 渲染 TMX layer。 */ + export class TiledLayer extends _SGComponent { + /** + !#en Gets the layer name. + !#zh 获取层的名称。 + + @example + ```js + var layerName = tiledLayer.getLayerName(); + cc.log(layerName); + ``` + */ + getLayerName(): string; + /** + !#en Set the layer name. + !#zh 设置层的名称 + @param layerName layerName + + @example + ```js + tiledLayer.setLayerName("New Layer"); + ``` + */ + SetLayerName(layerName: string): void; + /** + !#en Return the value for the specific property name. + !#zh 获取指定属性名的值。 + @param propertyName propertyName + + @example + ```js + var property = tiledLayer.getProperty("info"); + cc.log(property); + ``` + */ + getProperty(propertyName: string): any; + /** + !#en Returns the position in pixels of a given tile coordinate. + !#zh 获取指定 tile 的像素坐标。 + @param pos position or x + @param y y + + @example + ```js + var pos = tiledLayer.getPositionAt(cc.v2(0, 0)); + cc.log("Pos: " + pos); + var pos = tiledLayer.getPositionAt(0, 0); + cc.log("Pos: " + pos); + ``` + */ + getPositionAt(pos: Vec2|number, y?: number): Vec2; + /** + !#en Removes a tile at given tile coordinate. + !#zh 删除指定坐标上的 tile。 + @param pos position or x + @param y y + + @example + ```js + tiledLayer.removeTileAt(cc.v2(0, 0)); + tiledLayer.removeTileAt(0, 0); + ``` + */ + removeTileAt(pos: Vec2|number, y?: number): void; + /** + !#en + Sets the tile gid (gid = tile global id) at a given tile coordinate.
+ The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor . Tileset Mgr +1.
+ If a tile is already placed at that position, then it will be removed. + !#zh + 设置给定坐标的 tile 的 gid (gid = tile 全局 id), + tile 的 GID 可以使用方法 “tileGIDAt” 来获得。
+ 如果一个 tile 已经放在那个位置,那么它将被删除。 + @param gid gid + @param posOrX position or x + @param flagsOrY flags or y + @param flags flags + + @example + ```js + tiledLayer.setTileGID(1001, 10, 10, 1) + ``` + */ + setTileGID(gid: number, posOrX: Vec2|number, flagsOrY: number, flags?: number): void; + /** + !#en + Returns the tile gid at a given tile coordinate.
+ if it returns 0, it means that the tile is empty.
+ This method requires the the tile map has not been previously released (eg. don't call layer.releaseMap())
+ !#zh + 通过给定的 tile 坐标、flags(可选)返回 tile 的 GID.
+ 如果它返回 0,则表示该 tile 为空。
+ 该方法要求 tile 地图之前没有被释放过(如:没有调用过layer.releaseMap()). + @param pos or x + @param y y + + @example + ```js + var tileGid = tiledLayer.getTileGIDAt(0, 0); + ``` + */ + getTileGIDAt(pos: Vec2|number, y?: number): number; + /** + !#en + Returns the tile (_ccsg.Sprite) at a given a tile coordinate.
+ The returned _ccsg.Sprite will be already added to the _ccsg.TMXLayer. Don't add it again.
+ The _ccsg.Sprite can be treated like any other _ccsg.Sprite: rotated, scaled, translated, opacity, color, etc.
+ You can remove either by calling:
+ - layer.removeChild(sprite, cleanup);
+ - or layer.removeTileAt(ccp(x,y)); + !#zh + 通过指定的 tile 坐标获取对应的 tile(Sprite)。 返回的 tile(Sprite) 应是已经添加到 TMXLayer,请不要重复添加。
+ 这个 tile(Sprite) 如同其他的 Sprite 一样,可以旋转、缩放、翻转、透明化、设置颜色等。
+ 你可以通过调用以下方法来对它进行删除:
+ 1. layer.removeChild(sprite, cleanup);
+ 2. 或 layer.removeTileAt(cc.v2(x,y)); + @param pos or x + @param y y + + @example + ```js + var title = tiledLayer.getTileAt(100, 100); + cc.log(title); + ``` + */ + getTileAt(pos: Vec2|number, y?: number): _ccsg.Sprite; + /** + !#en + Dealloc the map that contains the tile position from memory.
+ Unless you want to know at runtime the tiles positions, you can safely call this method.
+ If you are going to call layer.getTileGIDAt() then, don't release the map. + !#zh + 从内存中释放包含 tile 位置信息的地图。
+ 除了在运行时想要知道 tiles 的位置信息外,你都可安全的调用此方法。
+ 如果你之后还要调用 layer.tileGIDAt(), 请不要释放地图. + + @example + ```js + tiledLayer.releaseMap(); + ``` + */ + releaseMap(): void; + /** + !#en Sets the untransformed size of the _ccsg.TMXLayer. + !#zh 设置未转换的 layer 大小。 + @param size The untransformed size of the _ccsg.TMXLayer or The untransformed size's width of the TMXLayer. + @param height The untransformed size's height of the _ccsg.TMXLayer. + + @example + ```js + tiledLayer.setContentSize(100, 100); + ``` + */ + setContentSize(size: Size|number, height?: number): void; + /** + !#en Return texture of cc.SpriteBatchNode. + !#zh 获取纹理。 + + @example + ```js + var texture = tiledLayer.getTexture(); + cc.log("Texture: " + texture); + ``` + */ + getTexture(): Texture2D; + /** + !#en Set the texture of cc.SpriteBatchNode. + !#zh 设置纹理。 + @param texture texture + + @example + ```js + tiledLayer.setTexture(texture); + ``` + */ + setTexture(texture: Texture2D): void; + /** + !#en Set the opacity of all tiles + !#zh 设置所有 Tile 的透明度 + @param opacity opacity + + @example + ```js + tiledLayer.setTileOpacity(128); + ``` + */ + setTileOpacity(opacity: number): void; + /** + !#en Gets layer size. + !#zh 获得层大小。 + + @example + ```js + var size = tiledLayer.getLayerSize(); + cc.log("layer size: " + size); + ``` + */ + getLayerSize(): Size; + /** + !#en Set layer size. + !#zh 设置层大小。 + @param layerSize layerSize + + @example + ```js + tiledLayer.setLayerSize(new cc.size(5, 5)); + ``` + */ + setLayerSize(layerSize: Size): void; + /** + !#en Size of the map's tile (could be different from the tile's size). + !#zh 获取 tile 的大小( tile 的大小可能会有所不同)。 + + @example + ```js + var mapTileSize = tiledLayer.getMapTileSize(); + cc.log("MapTile size: " + mapTileSize); + ``` + */ + getMapTileSize(): Size; + /** + !#en Set the map tile size. + !#zh 设置 tile 的大小。 + @param tileSize tileSize + + @example + ```js + tiledLayer.setMapTileSize(new cc.size(10, 10)); + ``` + */ + setMapTileSize(tileSize: Size): void; + /** + !#en Pointer to the map of tiles. + !#zh 获取地图 tiles。 + + @example + ```js + var tiles = tiledLayer.getTiles(); + ``` + */ + getTiles(): any[]; + /** + !#en Pointer to the map of tiles. + !#zh 设置地图 tiles + @param tiles tiles + + @example + ```js + tiledLayer.setTiles(tiles); + ``` + */ + setTiles(tiles: any[]): void; + /** + !#en Tile set information for the layer. + !#zh 获取 layer 的 Tileset 信息。 + + @example + ```js + var tileset = tiledLayer.getTileSet(); + ``` + */ + getTileSet(): TMXTilesetInfo; + /** + !#en Tile set information for the layer. + !#zh 设置 layer 的 Tileset 信息。 + @param tileset tileset + + @example + ```js + tiledLayer.setTileSet(tileset); + ``` + */ + setTileSet(tileset: TMXTilesetInfo): void; + /** + !#en Layer orientation, which is the same as the map orientation. + !#zh 获取 Layer 方向(同地图方向)。 + + @example + ```js + var orientation = tiledLayer.getLayerOrientation(); + cc.log("Layer Orientation: " + orientation); + ``` + */ + getLayerOrientation(): number; + /** + !#en Layer orientation, which is the same as the map orientation. + !#zh 设置 Layer 方向(同地图方向)。 + @param orientation orientation + + @example + ```js + tiledLayer.setLayerOrientation(TiledMap.Orientation.ORTHO); + ``` + */ + setLayerOrientation(orientation: TiledMap.Orientation): void; + /** + !#en properties from the layer. They can be added using Tiled. + !#zh 获取 layer 的属性,可以使用 Tiled 编辑器添加属性。 + + @example + ```js + var properties = tiledLayer.getProperties(); + cc.log("Properties: " + properties); + ``` + */ + getProperties(): any[]; + /** + !#en properties from the layer. They can be added using Tiled. + !#zh 设置层属性。 + @param properties properties + + @example + ```js + tiledLayer.setLayerOrientation(properties); + ``` + */ + setProperties(properties: any[]): void; + } + /** !#en Renders a TMX Tile Map in the scene. + !#zh 在场景中渲染一个 tmx 格式的 Tile Map。 */ + export class TiledMap extends Component { + /** !#en The TiledMap Asset. + !#zh TiledMap 资源。 */ + tmxAsset: TiledMapAsset; + /** + !#en Gets the map size. + !#zh 获取地图大小。 + + @example + ```js + var mapSize = tiledMap.getMapSize(); + cc.log("Map Size: " + mapSize); + ``` + */ + getMapSize(): Size; + /** + !#en Set the map size. + !#zh 设置地图大小。 + @param mapSize mapSize + + @example + ```js + tiledMap.setMapSize(new cc.size(960, 640)); + ``` + */ + setMapSize(mapSize: Size): void; + /** + !#en Gets the tile size. + !#zh 获取地图背景中 tile 元素的大小。 + + @example + ```js + var tileSize = tiledMap.getTileSize(); + cc.log("Tile Size: " + tileSize); + ``` + */ + getTileSize(): Size; + /** + !#en Set the tile size. + !#zh 设置地图背景中 tile 元素的大小。 + @param tileSize tileSize + + @example + ```js + tiledMap.setTileSize(new cc.size(10, 10)); + ``` + */ + setTileSize(tileSize: Size): void; + /** + !#en map orientation. + !#zh 获取地图方向。 + + @example + ```js + var mapOrientation = tiledMap.getMapOrientation(); + cc.log("Map Orientation: " + mapOrientation); + ``` + */ + getMapOrientation(): number; + /** + !#en map orientation. + !#zh 设置地图方向。 + @param orientation orientation + + @example + ```js + tiledMap.setMapOrientation(TiledMap.Orientation.ORTHO); + ``` + */ + setMapOrientation(orientation: TiledMap.Orientation): void; + /** + !#en object groups. + !#zh 获取所有的对象层。 + + @example + ```js + var objGroups = titledMap.getObjectGroups(); + for (var i = 0; i < objGroups.length; ++i) { + cc.log("obj: " + objGroups[i]); + } + ``` + */ + getObjectGroups(): TiledObjectGroup[]; + /** + !#en Gets the map properties. + !#zh 获取地图的属性。 + + @example + ```js + var properties = titledMap.getProperties(); + for (var i = 0; i < properties.length; ++i) { + cc.log("Properties: " + properties[i]); + } + ``` + */ + getProperties(): any[]; + /** + !#en Set the map properties. + !#zh 设置地图的属性。 + @param properties properties + + @example + ```js + titledMap.setProperties(properties); + ``` + */ + setProperties(properties: any[]): void; + /** + !#en Return All layers array. + !#zh 返回包含所有 layer 的数组。 + + @example + ```js + var layers = titledMap.allLayers(); + for (var i = 0; i < layers.length; ++i) { + cc.log("Layers: " + layers[i]); + } + ``` + */ + allLayers(): TiledLayer[]; + /** + !#en return the cc.TiledLayer for the specific layer. + !#zh 获取指定名称的 layer。 + @param layerName layerName + + @example + ```js + var layer = titledMap.getLayer("Player"); + cc.log(layer); + ``` + */ + getLayer(layerName: string): TiledLayer; + /** + !#en Return the TMXObjectGroup for the specific group. + !#zh 获取指定的 TMXObjectGroup。 + @param groupName groupName + + @example + ```js + var group = titledMap.getObjectGroup("Players"); + cc.log("ObjectGroup: " + group); + ``` + */ + getObjectGroup(groupName: string): TiledObjectGroup; + /** + !#en Return the value for the specific property name. + !#zh 通过属性名称,获取指定的属性。 + @param propertyName propertyName + + @example + ```js + var property = titledMap.getProperty("info"); + cc.log("Property: " + property); + ``` + */ + getProperty(propertyName: string): string; + /** + !#en Return properties dictionary for tile GID. + !#zh 通过 GID ,获取指定的属性。 + @param GID GID + + @example + ```js + var properties = titledMap.getPropertiesForGID(GID); + cc.log("Properties: " + properties); + ``` + */ + getPropertiesForGID(GID: number): any; + } + /** Class for tiled map asset handling. */ + export class TiledMapAsset extends Asset { + } + /** !#en Renders the TMX object group. + !#zh 渲染 tmx object group。 */ + export class TiledObjectGroup extends _SGComponent { + /** + !#en Offset position of child objects. + !#zh 获取子对象的偏移位置。 + + @example + ```js + var offset = tMXObjectGroup.getPositionOffset(); + ``` + */ + getPositionOffset(): Vec2; + /** + !#en Offset position of child objects. + !#zh 设置子对象的偏移位置。 + @param offset offset + + @example + ```js + tMXObjectGroup.setPositionOffset(cc.v2(5, 5)); + ``` + */ + setPositionOffset(offset: Vec2): void; + /** + !#en List of properties stored in a dictionary. + !#zh 以映射的形式获取属性列表。 + + @example + ```js + var offset = tMXObjectGroup.getProperties(); + ``` + */ + getProperties(): any; + /** + !#en Set the properties of the object group. + !#zh 设置属性列表。 + @param Var Var + + @example + ```js + tMXObjectGroup.setProperties(obj); + ``` + */ + setProperties(Var: any): void; + /** + !#en Gets the Group name. + !#zh 获取组名称。 + + @example + ```js + var groupName = tMXObjectGroup.getGroupName; + ``` + */ + getGroupName(): string; + /** + !#en Set the Group name. + !#zh 设置组名称。 + @param groupName groupName + + @example + ```js + tMXObjectGroup.setGroupName("New Group"); + ``` + */ + setGroupName(groupName: string): void; + /** + !#en + Return the object for the specific object name.
+ It will return the 1st object found on the array for the given name. + !#zh 获取指定的对象。 + @param objectName objectName + + @example + ```js + var object = tMXObjectGroup.getObject("Group"); + ``` + */ + getObject(objectName: string): any; + /** + !#en Gets the objects. + !#zh 获取对象数组。 + + @example + ```js + var objects = tMXObjectGroup.getObjects(); + ``` + */ + getObjects(): any[]; + } + /** !#en + Base class for handling assets used in Fireball. This class can be instantiate. + + You may want to override:
+ - createNode
+ - cc.Object._serialize
+ - cc.Object._deserialize
+ !#zh + 资源基类,该类可以被实例化。
+ + 您可能需要重写:
+ - createNode
+ - cc.Object._serialize
+ - cc.Object._deserialize
*/ + export class Asset extends RawAsset { + /** !#en + Returns the url of this asset's first raw file, if none of rawFile exists, + it will returns an empty string. + !#zh 返回该资源的原始文件的 URL,如果不支持 RAW 文件,它将返回一个空字符串。 */ + rawUrl: string; + /** !#en + Returns the url of this asset's raw files, if none of rawFile exists, + it will returns an empty array. + !#zh 返回该资源的原文件的 URL 数组,如果不支持 RAW 文件,它将返回一个空数组。 */ + rawUrls: string[]; + /** !#en Indicates whether its dependent raw assets can support deferred load if the owner scene (or prefab) is marked as `asyncLoadAssets`. + !#zh 当场景或 Prefab 被标记为 `asyncLoadAssets`,禁止延迟加载该资源所依赖的其它 RawAsset。 */ + static preventDeferredLoadDependents: boolean; + /** + !#en + Create a new node using this asset in the scene.
+ If this type of asset dont have its corresponding node type, this method should be null. + !#zh + 使用该资源在场景中创建一个新节点。
+ 如果这类资源没有相应的节点类型,该方法应该是空的。 + @param callback callback + */ + createNode(callback: (error: string, node: any) => void): void; + } + /** !#en Class for audio data handling. + !#zh 音频资源类。 */ + export class AudioClip extends RawAsset { + } + /** !#en Class for BitmapFont handling. + !#zh 位图字体资源类。 */ + export class BitmapFont extends RawAsset { + } + /** !#en Class for Font handling. + !#zh 字体资源类。 */ + export class Font extends RawAsset { + } + /** !#en Class for LabelAtlas handling. + !#zh 艺术数字字体资源类。 */ + export class LabelAtlas extends BitmapFont { + } + /** !#en Class for prefab handling. + !#zh 预制资源类。 */ + export class Prefab extends Asset { + /** the main cc.Node in the prefab */ + data: Node; + /** !#en Indicates the raw assets of this prefab can be load after prefab loaded. + !#zh 指示该 Prefab 依赖的资源可否在 Prefab 加载后再延迟加载。 */ + asyncLoadAssets: boolean; + /** + Dynamically translation prefab data into minimized code.
+ This method will be called automatically before the first time the prefab being instantiated, + but you can re-call to refresh the create function once you modified the original prefab data in script. + */ + compileCreateFunction(): void; + } + /** !#en + The base class for registering asset types. + + You may want to override: + - createNode (static) + !#zh + 注册用的资源基类。
+ 你可能要重写:
+ - createNode (static) */ + export class RawAsset extends Object { + /** + !#en + Create a new node in the scene.
+ If this type of asset dont have its corresponding node type, this method should be null. + !#zh + 在场景中创建一个新节点。
+ 如果这类资源没有相应的节点类型,该方法应该是空的。 + @param Info Info + @param callback callback + */ + static createNodeByInfo(Info: any, callback: (error: string, node: any) => void): void; + } + /** !#en Class for scene handling. + !#zh 场景资源类。 */ + export class SceneAsset extends Asset { + scene: Scene; + /** !#en Indicates the raw assets of this scene can be load after scene launched. + !#zh 指示该场景依赖的资源可否在场景切换后再延迟加载。 */ + asyncLoadAssets: boolean; + } + /** !#en Class for script handling. + !#zh Script 资源类。 */ + export class _Script extends Asset { + } + /** !#en Class for JavaScript handling. + !#zh JavaScript 资源类。 */ + export class _JavaScript extends Asset { + } + /** !#en Class for coffeescript handling. + !#zh CoffeeScript 资源类。 */ + export class CoffeeScript extends Asset { + } + /** !#en Class for TypeScript handling. + !#zh TypeScript 资源类。 */ + export class TypeScript extends Asset { + } + /** !#en Class for sprite atlas handling. + !#zh 精灵图集资源类。 */ + export class SpriteAtlas extends RawAsset { + /** + Returns the texture of the sprite atlas + */ + getTexture(): Texture2D; + /** + Returns the sprite frame correspond to the given key in sprite atlas. + @param key key + */ + getSpriteFrame(key: string): SpriteFrame; + /** + Returns the sprite frames in sprite atlas. + */ + getSpriteFrames(): [SpriteFrame]; + } + /** !#en Class for TTFFont handling. + !#zh TTF 字体资源类。 */ + export class TTFFont extends Asset { + } + /** !#en Class for text file. + !#zh 文本资源类。 */ + export class TextAsset extends Asset { + } + /** !#en + Camera is usefull when making reel game or other games which need scroll screen. + Using camera will be more efficient than moving node to scroll screen. + Camera + !#zh + 摄像机在制作卷轴或是其他需要移动屏幕的游戏时比较有用,使用摄像机将会比移动节点来移动屏幕更加高效。 */ + export class Camera extends _RendererUnderSG { + /** !#en + The camera zoom ratio. + !#zh + 摄像机缩放比率 */ + zoomRatio: number; + /** !#en + Current active camera, the scene should only have one active camera at the same time. + !#zh + 当前激活的摄像机,场景中在同一时间内只能有一个激活的摄像机。 */ + static main: Camera; + /** + !#en + Add the specified target to camera. + !#zh + 将指定的节点添加到摄像机中。 + @param target target + */ + addTarget(target: Node): void; + /** + !#en + Remove the specified target from camera. + !#zh + 将指定的节点从摄像机中移除。 + @param target target + */ + removeTarget(target: Node): void; + /** + !#en + Get all camera targets. + !#zh + 获取所有摄像机目标节点。 + */ + getTargets(): [Node]; + /** + !#en + Returns the matrix that transform the node's (local) space coordinates into the camera's space coordinates. + !#zh + 返回一个将节点坐标系转换到摄像机坐标系下的矩阵 + @param node the node which should transform + */ + getNodeToCameraTransform(node: Node): AffineTransform; + /** + !#en + Conver a camera coordinates point to world coordinates. + !#zh + 将一个摄像机坐标系下的点转换到世界坐标系下。 + @param point the point which should transform + */ + getCameraToWorldPoint(point: Node): Vec2; + /** + !#en + Check whether the node is in the camera. + !#zh + 检测节点是否被此摄像机影响 + @param node the node which need to check + */ + containsNode(node: Node): boolean; + } + /** !#en Box Collider. + !#zh 包围盒碰撞组件 */ + export class BoxCollider extends Collider implements Collider.Box { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Box size + !#zh 包围盒大小 */ + size: Size; + } + /** !#en Circle Collider. + !#zh 圆形碰撞组件 */ + export class CircleCollider extends Collider implements Collider.Circle { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Circle radius + !#zh 圆形半径 */ + radius: number; + } + /** !#en Collider component base class. + !#zh 碰撞组件基类 */ + export class Collider extends Component { + /** !#en Tag. If a node has several collider components, you can judge which type of collider is collided according to the tag. + !#zh 标签。当一个节点上有多个碰撞组件时,在发生碰撞后,可以使用此标签来判断是节点上的哪个碰撞组件被碰撞了。 */ + tag: number; + } + /** !#en + A simple collision manager class. + It will calculate whether the collider collides other colliders, if collides then call the callbacks. + !#zh + 一个简单的碰撞组件管理类,用于处理节点之间的碰撞组件是否产生了碰撞,并调用相应回调函数。 */ + export class CollisionManager implements EventTarget { + /** !#en + !#zh + 是否开启碰撞管理,默认为不开启 */ + enabled: boolean; + /** !#en + !#zh + 是否绘制碰撞组件的包围盒,默认为不绘制 */ + enabledDrawBoundingBox: boolean; + /** !#en + !#zh + 是否绘制碰撞组件的形状,默认为不绘制 */ + enabledDebugDraw: boolean; + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** !#en Intersection helper class + !#zh 辅助类,用于测试形状与形状是否相交 */ + export class Intersection { + /** + !#en Test line and line + !#zh 测试线段与线段是否相交 + @param a1 The start point of the first line + @param a2 The end point of the first line + @param b1 The start point of the second line + @param b2 The end point of the second line + */ + static lineLine(a1: Vec2, a2: Vec2, b1: Vec2, b2: Vec2): boolean; + /** + !#en Test line and rect + !#zh 测试线段与矩形是否相交 + @param a1 The start point of the line + @param a2 The end point of the line + @param b The rect + */ + static lineRect(a1: Vec2, a2: Vec2, b: Rect): boolean; + /** + !#en Test line and polygon + !#zh 测试线段与多边形是否相交 + @param a1 The start point of the line + @param a2 The end point of the line + @param b The polygon, a set of points + */ + static linePolygon(a1: Vec2, a2: Vec2, b: Vec2[]): boolean; + /** + !#en Test rect and rect + !#zh 测试矩形与矩形是否相交 + @param a The first rect + @param b The second rect + */ + static rectRect(a: Rect, b: Rect): boolean; + /** + !#en Test rect and polygon + !#zh 测试矩形与多边形是否相交 + @param a The rect + @param b The polygon, a set of points + */ + static rectPolygon(a: Rect, b: Vec2[]): boolean; + /** + !#en Test polygon and polygon + !#zh 测试多边形与多边形是否相交 + @param a The first polygon, a set of points + @param b The second polygon, a set of points + */ + static polygonPolygon(a: Vec2[], b: Vec2[]): boolean; + /** + !#en Test circle and circle + !#zh 测试圆形与圆形是否相交 + @param a Object contains position and radius + @param b Object contains position and radius + */ + static circleCircle(a: {position: Vec2, radius: number}, b: {position: Vec2, radius: number}): boolean; + /** + !#en Test polygon and circle + !#zh 测试矩形与圆形是否相交 + @param polygon The Polygon, a set of points + @param circle Object contains position and radius + */ + static polygonCircle(polygon: Vec2[], circle: {position: Vec2, radius: number}): boolean; + /** + !#en Test whether the point is in the polygon + !#zh 测试一个点是否在一个多边形中 + @param point The point + @param polygon The polygon, a set of points + */ + static pointInPolygon(point: Vec2, polygon: Vec2[]): boolean; + /** + !#en Calculate the distance of point to line. + !#zh 计算点到直线的距离。如果这是一条线段并且垂足不在线段内,则会计算点到线段端点的距离。 + @param point The point + @param start The start point of line + @param end The end point of line + @param isSegment whether this line is a segment + */ + static pointLineDistance(point: Vec2, start: Vec2, end: Vec2, isSegment: boolean): boolean; + } + /** !#en Polygon Collider. + !#zh 多边形碰撞组件 */ + export class PolygonCollider extends Collider implements Collider.Polygon { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Polygon points + !#zh 多边形顶点数组 */ + points: [Vec2]; + } + /** !#en The animation component is used to play back animations. + + Animation provide several events to register: + - play : Emit when begin playing animation + - stop : Emit when stop playing animation + - pause : Emit when pause animation + - resume : Emit when resume animation + - lastframe : If animation repeat count is larger than 1, emit when animation play to the last frame + - finished : Emit when finish playing animation + + !#zh Animation 组件用于播放动画。 + + Animation 提供了一系列可注册的事件: + - play : 开始播放时 + - stop : 停止播放时 + - pause : 暂停播放时 + - resume : 恢复播放时 + - lastframe : 假如动画循环次数大于 1,当动画播放到最后一帧时 + - finished : 动画播放完成时 */ + export class Animation extends Component implements EventTarget { + /** !#en Animation will play the default clip when start game. + !#zh 在勾选自动播放或调用 play() 时默认播放的动画剪辑。 */ + defaultClip: AnimationClip; + /** !#en Current played clip. + !#zh 当前播放的动画剪辑。 */ + currentClip: AnimationClip; + /** !#en Whether the animation should auto play the default clip when start game. + !#zh 是否在运行游戏后自动播放默认动画剪辑。 */ + playOnLoad: boolean; + /** + !#en Get all the clips used in this animation. + !#zh 获取动画组件上的所有动画剪辑。 + */ + getClips(): AnimationClip[]; + /** + !#en Plays an animation and stop other animations. + !#zh 播放指定的动画,并且停止当前正在播放动画。如果没有指定动画,则播放默认动画。 + @param name The name of animation to play. If no name is supplied then the default animation will be played. + @param startTime play an animation from startTime + + @example + ```js + var animCtrl = this.node.getComponent(cc.Animation); + animCtrl.play("linear"); + ``` + */ + play(name?: string, startTime?: number): AnimationState; + /** + !#en + Plays an additive animation, it will not stop other animations. + If there are other animations playing, then will play several animations at the same time. + !#zh 播放指定的动画(将不会停止当前播放的动画)。如果没有指定动画,则播放默认动画。 + @param name The name of animation to play. If no name is supplied then the default animation will be played. + @param startTime play an animation from startTime + + @example + ```js + // linear_1 and linear_2 at the same time playing. + var animCtrl = this.node.getComponent(cc.Animation); + animCtrl.playAdditive("linear_1"); + animCtrl.playAdditive("linear_2"); + ``` + */ + playAdditive(name?: string, startTime?: number): AnimationState; + /** + !#en Stops an animation named name. If no name is supplied then stops all playing animations that were started with this Animation.
+ Stopping an animation also Rewinds it to the Start. + !#zh 停止指定的动画。如果没有指定名字,则停止当前正在播放的动画。 + @param name The animation to stop, if not supplied then stops all playing animations. + */ + stop(name?: string): void; + /** + !#en Pauses an animation named name. If no name is supplied then pauses all playing animations that were started with this Animation. + !#zh 暂停当前或者指定的动画。如果没有指定名字,则暂停当前正在播放的动画。 + @param name The animation to pauses, if not supplied then pauses all playing animations. + */ + pause(name?: string): void; + /** + !#en Resumes an animation named name. If no name is supplied then resumes all paused animations that were started with this Animation. + !#zh 重新播放指定的动画,如果没有指定名字,则重新播放当前正在播放的动画。 + @param name The animation to resumes, if not supplied then resumes all paused animations. + */ + resume(name?: string): void; + /** + !#en Make an animation named name go to the specified time. If no name is supplied then make all animations go to the specified time. + !#zh 设置指定动画的播放时间。如果没有指定名字,则设置当前播放动画的播放时间。 + @param time The time to go to + @param name Specified animation name, if not supplied then make all animations go to the time. + */ + setCurrentTime(time?: number, name?: string): void; + /** + !#en Returns the animation state named name. If no animation with the specified name, the function will return null. + !#zh 获取当前或者指定的动画状态,如果未找到指定动画剪辑则返回 null。 + @param name name + */ + getAnimationState(name: string): AnimationState; + /** + !#en Adds a clip to the animation with name newName. If a clip with that name already exists it will be replaced with the new clip. + !#zh 添加动画剪辑,并且可以重新设置该动画剪辑的名称。 + @param clip the clip to add + @param newName newName + */ + addClip(clip: AnimationClip, newName?: string): AnimationState; + /** + !#en + Remove clip from the animation list. This will remove the clip and any animation states based on it. + If there are animation states depand on the clip are playing or clip is defaultClip, it will not delete the clip. + But if force is true, then will always remove the clip and any animation states based on it. If clip is defaultClip, defaultClip will be reset to null + !#zh + 从动画列表中移除指定的动画剪辑,
+ 如果依赖于 clip 的 AnimationState 正在播放或者 clip 是 defaultClip 的话,默认是不会删除 clip 的。 + 但是如果 force 参数为 true,则会强制停止该动画,然后移除该动画剪辑和相关的动画。这时候如果 clip 是 defaultClip,defaultClip 将会被重置为 null。 + @param clip clip + @param force If force is true, then will always remove the clip and any animation states based on it. + */ + removeClip(clip: AnimationClip, force?: boolean): void; + /** + !#en + Samples animations at the current state.
+ This is useful when you explicitly want to set up some animation state, and sample it once. + !#zh 对指定或当前动画进行采样。你可以手动将动画设置到某一个状态,然后采样一次。 + @param name name + */ + sample(name: string): void; + /** + !#en + Register animation event callback. + The event arguments will provide the AnimationState which emit the event. + When play an animation, will auto register the event callback to the AnimationState, and unregister the event callback from the AnimationState when animation stopped. + !#zh + 注册动画事件回调。 + 回调的事件里将会附上发送事件的 AnimationState。 + 当播放一个动画时,会自动将事件注册到对应的 AnimationState 上,停止播放时会将事件从这个 AnimationState 上取消注册。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + onPlay: function (event) { + var state = event.detail; // state instanceof cc.AnimationState + var type = event.type; // type === 'play'; + } + + // register event to all animation + animation.on('play', this.onPlay, this); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Unregister animation event callback. + !#zh + 取消注册动画事件回调。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // unregister event to all animation + animation.off('play', this.onPlay, this); + ``` + */ + off(type: string, callback: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** !#en Audio Source. + !#zh 音频源组件,能对音频剪辑。 */ + export class AudioSource extends Component { + /** !#en + Is the audio source playing (Read Only).
+ Note: isPlaying is not supported for Native platforms. + !#zh + 该音频剪辑是否正播放(只读)。
+ 注意:Native 平台暂时不支持 isPlaying。 */ + isPlaying: boolean; + /** !#en The clip of the audio source. + !#zh 默认要播放的音频剪辑。 */ + clip: AudioClip; + /** !#en The volume of the audio source. + !#zh 音频源的音量(0.0 ~ 1.0)。 */ + volume: number; + /** !#en Is the audio source mute? + !#zh 是否静音音频源。Mute 是设置音量为 0,取消静音是恢复原来的音量。 */ + mute: boolean; + /** !#en Is the audio source looping? + !#zh 音频源是否循环播放? */ + loop: boolean; + /** !#en If set to true, the audio source will automatically start playing on onLoad. + !#zh 如果设置为true,音频源将在 onLoad 时自动播放。 */ + playOnLoad: boolean; + /** + !#en Plays the clip. + !#zh 播放音频剪辑。 + */ + play(): void; + /** + !#en Stops the clip. + !#zh 停止当前音频剪辑。 + */ + stop(): void; + /** + !#en Pause the clip. + !#zh 暂停当前音频剪辑。 + */ + pause(): void; + /** + !#en Resume the clip. + !#zh 恢复播放。 + */ + resume(): void; + /** + !#en Rewind playing music. + !#zh 从头开始播放。 + */ + rewind(): void; + /** + !#en Get current time + !#zh 获取当前的播放时间 + */ + getCurrentTime(): void; + /** + !#en Set current time + !#zh 设置当前的播放时间 + @param time time + */ + setCurrentTime(time: number): void; + /** + !#en Get audio duration + !#zh 获取当前音频的长度 + */ + getDuration(): void; + } + /** !#en + This component will block all input events (mouse and touch) within the bounding box of the node, preventing the input from penetrating into the underlying node, typically for the background of the top UI.
+ This component does not have any API interface and can be added directly to the scene to take effect. + !#zh + 该组件将拦截所属节点 bounding box 内的所有输入事件(鼠标和触摸),防止输入穿透到下层节点,一般用于上层 UI 的背景。
+ 该组件没有任何 API 接口,直接添加到场景即可生效。 */ + export class BlockInputEvents extends Component { + } + /** !#en + Button has 4 Transition types + When Button state changed: + If Transition type is Button.Transition.NONE, Button will do nothing + If Transition type is Button.Transition.COLOR, Button will change target's color + If Transition type is Button.Transition.SPRITE, Button will change target Sprite's sprite + If Transition type is Button.Transition.SCALE, Button will change target node's scale + + Button will trigger 5 events: + Button.EVENT_TOUCH_DOWN + Button.EVENT_TOUCH_UP + Button.EVENT_HOVER_IN + Button.EVENT_HOVER_MOVE + Button.EVENT_HOVER_OUT + + !#zh + 按钮组件。可以被按下,或者点击。
+ + 按钮可以通过修改 Transition 来设置按钮状态过渡的方式:
+ -Button.Transition.NONE // 不做任何过渡
+ -Button.Transition.COLOR // 进行颜色之间过渡
+ -Button.Transition.SPRITE // 进行精灵之间过渡
+ -Button.Transition.SCALE // 进行缩放过渡
+ + 按钮可以绑定事件(但是必须要在按钮的 Node 上才能绑定事件):
+ // 以下事件可以在全平台上都触发
+ -cc.Node.EventType.TOUCH_START // 按下时事件
+ -cc.Node.EventType.TOUCH_Move // 按住移动后事件
+ -cc.Node.EventType.TOUCH_END // 按下后松开后事件
+ -cc.Node.EventType.TOUCH_CANCEL // 按下取消事件
+ // 以下事件只在 PC 平台上触发
+ -cc.Node.EventType.MOUSE_DOWN // 鼠标按下时事件
+ -cc.Node.EventType.MOUSE_MOVE // 鼠标按住移动后事件
+ -cc.Node.EventType.MOUSE_ENTER // 鼠标进入目标事件
+ -cc.Node.EventType.MOUSE_LEAVE // 鼠标离开目标事件
+ -cc.Node.EventType.MOUSE_UP // 鼠标松开事件
+ -cc.Node.EventType.MOUSE_WHEEL // 鼠标滚轮事件
*/ + export class Button extends Component { + /** !#en + Whether the Button is disabled. + If true, the Button will trigger event and do transition. + !#zh + 按钮事件是否被响应,如果为 false,则按钮将被禁用。 */ + interactable: boolean; + /** !#en When this flag is true, Button target sprite will turn gray when interactable is false. + !#zh 如果这个标记为 true,当 button 的 interactable 属性为 false 的时候,会使用内置 shader 让 button 的 target 节点的 sprite 组件变灰 */ + enableAutoGrayEffect: boolean; + /** !#en Transition type + !#zh 按钮状态改变时过渡方式。 */ + transition: Button.Transition; + /** !#en Normal state color. + !#zh 普通状态下按钮所显示的颜色。 */ + normalColor: Color; + /** !#en Pressed state color + !#zh 按下状态时按钮所显示的颜色。 */ + pressedColor: Color; + /** !#en Hover state color + !#zh 悬停状态下按钮所显示的颜色。 */ + hoverColor: Color; + /** !#en Disabled state color + !#zh 禁用状态下按钮所显示的颜色。 */ + disabledColor: Color; + /** !#en Color and Scale transition duration + !#zh 颜色过渡和缩放过渡时所需时间 */ + duration: number; + /** !#en When user press the button, the button will zoom to a scale. + The final scale of the button equals (button original scale * zoomScale) + !#zh 当用户点击按钮后,按钮会缩放到一个值,这个值等于 Button 原始 scale * zoomScale */ + zoomScale: number; + /** !#en Normal state sprite + !#zh 普通状态下按钮所显示的 Sprite 。 */ + normalSprite: SpriteFrame; + /** !#en Pressed state sprite + !#zh 按下状态时按钮所显示的 Sprite 。 */ + pressedSprite: SpriteFrame; + /** !#en Hover state sprite + !#zh 悬停状态下按钮所显示的 Sprite 。 */ + hoverSprite: SpriteFrame; + /** !#en Disabled state sprite + !#zh 禁用状态下按钮所显示的 Sprite 。 */ + disabledSprite: SpriteFrame; + /** !#en + Transition target. + When Button state changed: + If Transition type is Button.Transition.NONE, Button will do nothing + If Transition type is Button.Transition.COLOR, Button will change target's color + If Transition type is Button.Transition.SPRITE, Button will change target Sprite's sprite + !#zh + 需要过渡的目标。 + 当前按钮状态改变规则: + -如果 Transition type 选择 Button.Transition.NONE,按钮不做任何过渡。 + -如果 Transition type 选择 Button.Transition.COLOR,按钮会对目标颜色进行颜色之间的过渡。 + -如果 Transition type 选择 Button.Transition.Sprite,按钮会对目标 Sprite 进行 Sprite 之间的过渡。 */ + target: Node; + /** !#en If Button is clicked, it will trigger event's handler + !#zh 按钮的点击事件列表。 */ + clickEvents: Component.EventHandler[]; + } + /** !#zh: 作为 UI 根节点,为所有子节点提供视窗四边的位置信息以供对齐,另外提供屏幕适配策略接口,方便从编辑器设置。 + 注:由于本节点的尺寸会跟随屏幕拉伸,所以 anchorPoint 只支持 (0.5, 0.5),否则适配不同屏幕时坐标会有偏差。 */ + export class Canvas extends Component { + /** !#en Current active canvas, the scene should only have one active canvas at the same time. + !#zh 当前激活的画布组件,场景同一时间只能有一个激活的画布。 */ + static instance: Canvas; + /** !#en The desigin resolution for current scene. + !#zh 当前场景设计分辨率。 */ + designResolution: Size; + /** !#en TODO + !#zh: 是否优先将设计分辨率高度撑满视图高度。 */ + fitHeight: boolean; + /** !#en TODO + !#zh: 是否优先将设计分辨率宽度撑满视图宽度。 */ + fitWidth: boolean; + } + /** !#en + Base class for everything attached to Node(Entity).
+
+ NOTE: Not allowed to use construction parameters for Component's subclasses, + because Component is created by the engine. + !#zh + 所有附加到节点的基类。
+
+ 注意:不允许使用组件的子类构造参数,因为组件是由引擎创建的。 */ + export class Component extends Object { + /** !#en The node this component is attached to. A component is always attached to a node. + !#zh 该组件被附加到的节点。组件总会附加到一个节点。 */ + node: Node; + /** !#en The uuid for editor. + !#zh 组件的 uuid,用于编辑器。 */ + uuid: string; + /** !#en indicates whether this component is enabled or not. + !#zh 表示该组件自身是否启用。 */ + enabled: boolean; + /** !#en indicates whether this component is enabled and its node is also active in the hierarchy. + !#zh 表示该组件是否被启用并且所在的节点也处于激活状态。 */ + enabledInHierarchy: boolean; + /** !#en Returns a value which used to indicate the onLoad get called or not. + !#zh 返回一个值用来判断 onLoad 是否被调用过,不等于 0 时调用过,等于 0 时未调用。 */ + _isOnLoadCalled: number; + /** + !#en Update is called every frame, if the Component is enabled. + !#zh 如果该组件启用,则每帧调用 update。 + @param dt the delta time in seconds it took to complete the last frame + */ + protected update(dt: number): void; + /** + !#en LateUpdate is called every frame, if the Component is enabled. + !#zh 如果该组件启用,则每帧调用 LateUpdate。 + */ + protected lateUpdate(): void; + /** + !#en + When attaching to an active node or its node first activated. + onLoad is always called before any start functions, this allows you to order initialization of scripts. + !#zh + 当附加到一个激活的节点上或者其节点第一次激活时候调用。onLoad 总是会在任何 start 方法调用前执行,这能用于安排脚本的初始化顺序。 + */ + protected onLoad(): void; + /** + !#en + Called before all scripts' update if the Component is enabled the first time. + Usually used to initialize some logic which need to be called after all components' `onload` methods called. + !#zh + 如果该组件第一次启用,则在所有组件的 update 之前调用。通常用于需要在所有组件的 onLoad 初始化完毕后执行的逻辑。 + */ + protected start(): void; + /** + !#en Called when this component becomes enabled and its node is active. + !#zh 当该组件被启用,并且它的节点也激活时。 + */ + protected onEnable(): void; + /** + !#en Called when this component becomes disabled or its node becomes inactive. + !#zh 当该组件被禁用或节点变为无效时调用。 + */ + protected onDisable(): void; + /** + !#en Called when this component will be destroyed. + !#zh 当该组件被销毁时调用 + */ + protected onDestroy(): void; + protected onFocusInEditor(): void; + protected onLostFocusInEditor(): void; + /** + !#en Called to initialize the component or node’s properties when adding the component the first time or when the Reset command is used. This function is only called in editor. + !#zh 用来初始化组件或节点的一些属性,当该组件被第一次添加到节点上或用户点击了它的 Reset 菜单时调用。这个回调只会在编辑器下调用。 + */ + protected resetInEditor(): void; + /** + !#en Adds a component class to the node. You can also add component to node by passing in the name of the script. + !#zh 向节点添加一个组件类,你还可以通过传入脚本的名称来添加组件。 + @param typeOrClassName the constructor or the class name of the component to add + + @example + ```js + var sprite = node.addComponent(cc.Sprite); + var test = node.addComponent("Test"); + ``` + */ + addComponent(type: {new(): T}): T; + addComponent(className: string): any; + /** + !#en + Returns the component of supplied type if the node has one attached, null if it doesn't.
+ You can also get component in the node by passing in the name of the script. + !#zh + 获取节点上指定类型的组件,如果节点有附加指定类型的组件,则返回,如果没有则为空。
+ 传入参数也可以是脚本的名称。 + @param typeOrClassName typeOrClassName + + @example + ```js + // get sprite component. + var sprite = node.getComponent(cc.Sprite); + // get custom test calss. + var test = node.getComponent("Test"); + ``` + */ + getComponent(type: {prototype: T}): T; + getComponent(className: string): any; + /** + !#en Returns all components of supplied Type in the node. + !#zh 返回节点上指定类型的所有组件。 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprites = node.getComponents(cc.Sprite); + var tests = node.getComponents("Test"); + ``` + */ + getComponents(type: {prototype: T}): T[]; + getComponents(className: string): any[]; + /** + !#en Returns the component of supplied type in any of its children using depth first search. + !#zh 递归查找所有子节点中第一个匹配指定类型的组件。 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprite = node.getComponentInChildren(cc.Sprite); + var Test = node.getComponentInChildren("Test"); + ``` + */ + getComponentInChildren(type: {prototype: T}): T; + getComponentInChildren(className: string): any; + /** + !#en Returns the components of supplied type in self or any of its children using depth first search. + !#zh 递归查找自身或所有子节点中指定类型的组件 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprites = node.getComponentsInChildren(cc.Sprite); + var tests = node.getComponentsInChildren("Test"); + ``` + */ + getComponentsInChildren(type: {prototype: T}): T[]; + getComponentsInChildren(className: string): any[]; + /** + !#en + If the component's bounding box is different from the node's, you can implement this method to supply + a custom axis aligned bounding box (AABB), so the editor's scene view can perform hit test properly. + !#zh + 如果组件的包围盒与节点不同,您可以实现该方法以提供自定义的轴向对齐的包围盒(AABB), + 以便编辑器的场景视图可以正确地执行点选测试。 + @param out_rect the Rect to receive the bounding box + */ + _getLocalBounds(out_rect: Rect): void; + /** + !#en + onRestore is called after the user clicks the Reset item in the Inspector's context menu or performs + an undo operation on this component.
+
+ If the component contains the "internal state", short for "temporary member variables which not included
+ in its CCClass properties", then you may need to implement this function.
+
+ The editor will call the getset accessors of your component to record/restore the component's state
+ for undo/redo operation. However, in extreme cases, it may not works well. Then you should implement
+ this function to manually synchronize your component's "internal states" with its public properties.
+ Once you implement this function, all the getset accessors of your component will not be called when
+ the user performs an undo/redo operation. Which means that only the properties with default value
+ will be recorded or restored by editor.
+
+ Similarly, the editor may failed to reset your component correctly in extreme cases. Then if you need
+ to support the reset menu, you should manually synchronize your component's "internal states" with its
+ properties in this function. Once you implement this function, all the getset accessors of your component
+ will not be called during reset operation. Which means that only the properties with default value
+ will be reset by editor. + + This function is only called in editor mode. + !#zh + onRestore 是用户在检查器菜单点击 Reset 时,对此组件执行撤消操作后调用的。
+
+ 如果组件包含了“内部状态”(不在 CCClass 属性中定义的临时成员变量),那么你可能需要实现该方法。
+
+ 编辑器执行撤销/重做操作时,将调用组件的 get set 来录制和还原组件的状态。 + 然而,在极端的情况下,它可能无法良好运作。
+ 那么你就应该实现这个方法,手动根据组件的属性同步“内部状态”。 + 一旦你实现这个方法,当用户撤销或重做时,组件的所有 get set 都不会再被调用。 + 这意味着仅仅指定了默认值的属性将被编辑器记录和还原。
+
+ 同样的,编辑可能无法在极端情况下正确地重置您的组件。
+ 于是如果你需要支持组件重置菜单,你需要在该方法中手工同步组件属性到“内部状态”。
+ 一旦你实现这个方法,组件的所有 get set 都不会在重置操作时被调用。 + 这意味着仅仅指定了默认值的属性将被编辑器重置。 +
+ 此方法仅在编辑器下会被调用。 + */ + onRestore(): void; + /** + !#en + Schedules a custom selector.
+ If the selector is already scheduled, then the interval parameter will be updated without scheduling it again. + !#zh + 调度一个自定义的回调函数。
+ 如果回调函数已调度,那么将不会重复调度它,只会更新时间间隔参数。 + @param callback The callback function + @param interval Tick interval in seconds. 0 means tick every frame. + @param repeat The selector will be executed (repeat + 1) times, you can use cc.macro.REPEAT_FOREVER for tick infinitely. + @param delay The amount of time that the first tick will wait before execution. + + @example + ```js + var timeCallback = function (dt) { + cc.log("time: " + dt); + } + this.schedule(timeCallback, 1); + ``` + */ + schedule(callback: Function, interval?: number, repeat?: number, delay?: number): void; + /** + !#en Schedules a callback function that runs only once, with a delay of 0 or larger. + !#zh 调度一个只运行一次的回调函数,可以指定 0 让回调函数在下一帧立即执行或者在一定的延时之后执行。 + @param callback A function wrapped as a selector + @param delay The amount of time that the first tick will wait before execution. + + @example + ```js + var timeCallback = function (dt) { + cc.log("time: " + dt); + } + this.scheduleOnce(timeCallback, 2); + ``` + */ + scheduleOnce(callback: Function, delay?: number): void; + /** + !#en Unschedules a custom callback function. + !#zh 取消调度一个自定义的回调函数。 + @param callback_fn A function wrapped as a selector + + @example + ```js + this.unschedule(_callback); + ``` + */ + unschedule(callback_fn: Function): void; + /** + !#en + unschedule all scheduled callback functions: custom callback functions, and the 'update' callback function.
+ Actions are not affected by this method. + !#zh 取消调度所有已调度的回调函数:定制的回调函数以及 'update' 回调函数。动作不受此方法影响。 + + @example + ```js + this.unscheduleAllCallbacks(); + ``` + */ + unscheduleAllCallbacks(): void; + } + /** !#en cc.EditBox is a component for inputing text, you can use it to gather small amounts of text from users. + !#zh EditBox 组件,用于获取用户的输入文本。 */ + export class EditBox extends _RendererUnderSG { + /** !#en Input string of EditBox. + !#zh 输入框的初始输入内容,如果为空则会显示占位符的文本。 */ + string: string; + /** !#en The background image of EditBox. + !#zh 输入框的背景图片 */ + backgroundImage: SpriteFrame; + /** !#en + The return key type of EditBox. + Note: it is meaningless for web platforms and desktop platforms. + !#zh + 指定移动设备上面回车按钮的样式。 + 注意:这个选项对 web 平台与 desktop 平台无效。 */ + returnType: EditBox.KeyboardReturnType; + /** !#en Set the input flags that are to be applied to the EditBox. + !#zh 指定输入标志位,可以指定输入方式为密码或者单词首字母大写。 */ + inputFlag: EditBox.InputFlag; + /** !#en + Set the input mode of the edit box. + If you pass ANY, it will create a multiline EditBox. + !#zh + 指定输入模式: ANY表示多行输入,其它都是单行输入,移动平台上还可以指定键盘样式。 */ + inputMode: EditBox.InputMode; + /** !#en Font size of the input text. + !#zh 输入框文本的字体大小 */ + fontSize: number; + /** !#en Change the lineHeight of displayed text. + !#zh 输入框文本的行高。 */ + lineHeight: number; + /** !#en Font color of the input text. + !#zh 输入框文本的颜色。 */ + fontColor: Color; + /** !#en The display text of placeholder. + !#zh 输入框占位符的文本内容。 */ + placeholder: string; + /** !#en The font size of placeholder. + !#zh 输入框占位符的字体大小。 */ + placeholderFontSize: number; + /** !#en The font color of placeholder. + !#zh 输入框占位符的字体颜色。 */ + placeholderFontColor: Color; + /** !#en The maximize input length of EditBox. + - If pass a value less than 0, it won't limit the input number of characters. + - If pass 0, it doesn't allow input any characters. + !#zh 输入框最大允许输入的字符个数。 + - 如果值为小于 0 的值,则不会限制输入字符个数。 + - 如果值为 0,则不允许用户进行任何输入。 */ + maxLength: number; + /** !#en The input is always visible and be on top of the game view. + !zh 输入框总是可见,并且永远在游戏视图的上面 + Note: only available on Web at the moment. */ + stayOnTop: boolean; + /** !#en Set the tabIndex of the DOM input element, only useful on Web. + !#zh 修改 DOM 输入元素的 tabIndex,这个属性只有在 Web 上面修改有意义。 */ + tabIndex: number; + /** !#en The event handler to be called when EditBox began to edit text. + !#zh 开始编辑文本输入框触发的事件回调。 */ + editingDidBegan: Component.EventHandler[]; + /** !#en The event handler to be called when EditBox text changes. + !#zh 编辑文本输入框时触发的事件回调。 */ + textChanged: Component.EventHandler[]; + /** !#en The event handler to be called when EditBox edit ends. + !#zh 结束编辑文本输入框时触发的事件回调。 */ + editingDidEnded: Component.EventHandler[]; + /** !#en The event handler to be called when return key is pressed. Windows is not supported. + !#zh 当用户按下回车按键时的事件回调,目前不支持 windows 平台 */ + editingReturn: Component.EventHandler[]; + /** + !#en Let the EditBox get focus, only valid when stayOnTop is true. + !#zh 让当前 EditBox 获得焦点,只有在 stayOnTop 为 true 的时候设置有效 + Note: only available on Web at the moment. + */ + setFocus(): void; + /** + !#en Determine whether EditBox is getting focus or not. + !#zh 判断 EditBox 是否获得了焦点 + Note: only available on Web at the moment. + */ + isFocused(): void; + /** + !#en if you don't need the EditBox and it isn't in any running Scene, you should + call the destroy method on this component or the associated node explicitly. + Otherwise, the created DOM element won't be removed from web page. + !#zh + 如果你不再使用 EditBox,并且组件未添加到场景中,那么你必须手动对组件或所在节点调用 destroy。 + 这样才能移除网页上的 DOM 节点,避免 Web 平台内存泄露。 + + @example + ```js + editbox.node.parent = null; // or editbox.node.removeFromParent(false); + // when you don't need editbox anymore + editbox.node.destroy(); + ``` + */ + destroy(): boolean; + } + /** !#en The Label Component. + !#zh 文字标签组件 */ + export class Label extends _RendererUnderSG { + /** !#en Content string of label. + !#zh 标签显示的文本内容。 */ + string: string; + /** !#en Horizontal Alignment of label. + !#zh 文本内容的水平对齐方式。 */ + horizontalAlign: Label.HorizontalAlign; + /** !#en Vertical Alignment of label. + !#zh 文本内容的垂直对齐方式。 */ + verticalAlign: Label.VerticalAlign; + /** !#en The actual rendering font size in shrink mode + !#zh SHRINK 模式下面文本实际渲染的字体大小 */ + actualFontSize: number; + /** !#en Font size of label. + !#zh 文本字体大小。 */ + fontSize: number; + /** !#en Font family of label, only take effect when useSystemFont property is true. + !#zh 文本字体名称, 只在 useSystemFont 属性为 true 的时候生效。 */ + fontFamily: string; + /** !#en Line Height of label. + !#zh 文本行高。 */ + lineHeight: number; + /** !#en Overflow of label. + !#zh 文字显示超出范围时的处理方式。 */ + overflow: Label.Overflow; + /** !#en Whether auto wrap label when string width is large than label width. + !#zh 是否自动换行。 */ + enableWrapText: boolean; + /** !#en The font of label. + !#zh 文本字体。 */ + font: Font; + /** !#en Whether use system font name or not. + !#zh 是否使用系统字体。 */ + isSystemFontUsed: boolean; + } + /** !#en Outline effect used to change the display, only used for TTF font + !#zh 描边效果组件,用于字体描边,只能用于系统字体 */ + export class LabelOutline extends Component { + /** !#en Change the outline color + !#zh 改变描边的颜色 */ + color: Color; + /** !#en Change the outline width + !#zh 改变描边的宽度 */ + width: number; + } + /** !#en + The Layout is a container component, use it to arrange child elements easily.
+ Note:
+ 1.Scaling and rotation of child nodes are not considered.
+ 2.After setting the Layout, the results need to be updated until the next frame, + unless you manually call {{#crossLink "Layout/updateLayout:method"}}{{/crossLink}}。 + !#zh + Layout 组件相当于一个容器,能自动对它的所有子节点进行统一排版。
+ 注意:
+ 1.不会考虑子节点的缩放和旋转。
+ 2.对 Layout 设置后结果需要到下一帧才会更新,除非你设置完以后手动调用 {{#crossLink "Layout/updateLayout:method"}}{{/crossLink}}。 */ + export class Layout extends Component { + /** !#en The layout type. + !#zh 布局类型 */ + type: Layout.Type; + /** !#en + The are three resize modes for Layout. + None, resize Container and resize children. + !#zh 缩放模式 */ + resizeMode: Layout.ResizeMode; + /** !#en The cell size for grid layout. + !#zh 每个格子的大小,只有布局类型为 GRID 的时候才有效。 */ + cellSize: Size; + /** !#en + The start axis for grid layout. If you choose horizontal, then children will layout horizontally at first, + and then break line on demand. Choose vertical if you want to layout vertically at first . + !#zh 起始轴方向类型,可进行水平和垂直布局排列,只有布局类型为 GRID 的时候才有效。 */ + startAxis: Layout.AxisDirection; + /** !#en The left padding of layout, it only effect the layout in one direction. + !#zh 容器内左边距,只会在一个布局方向上生效。 */ + paddingLeft: number; + /** !#en The right padding of layout, it only effect the layout in one direction. + !#zh 容器内右边距,只会在一个布局方向上生效。 */ + paddingRight: number; + /** !#en The top padding of layout, it only effect the layout in one direction. + !#zh 容器内上边距,只会在一个布局方向上生效。 */ + paddingTop: number; + /** !#en The bottom padding of layout, it only effect the layout in one direction. + !#zh 容器内下边距,只会在一个布局方向上生效。 */ + paddingBottom: number; + /** !#en The distance in x-axis between each element in layout. + !#zh 子节点之间的水平间距。 */ + spacingX: number; + /** !#en The distance in y-axis between each element in layout. + !#zh 子节点之间的垂直间距。 */ + spacingY: number; + /** !#en + Only take effect in Vertical layout mode. + This option changes the start element's positioning. + !#zh 垂直排列子节点的方向。 */ + verticalDirection: Layout.VerticalDirection; + /** !#en + Only take effect in Horizontal layout mode. + This option changes the start element's positioning. + !#zh 水平排列子节点的方向。 */ + horizontalDirection: Layout.HorizontalDirection; + /** + !#en Perform the layout update + !#zh 立即执行更新布局 + + @example + ```js + layout.type = cc.Layout.HORIZONTAL; + layout.node.addChild(childNode); + cc.log(childNode.x); // not yet changed + layout.updateLayout(); + cc.log(childNode.x); // changed + ``` + */ + updateLayout(): void; + /** !#en The padding of layout, it effects the layout in four direction. + !#zh 容器内边距,该属性会在四个布局方向上生效。 */ + padding: number; + } + /** !#en The Mask Component + !#zh 遮罩组件 */ + export class Mask extends _RendererInSG { + /** !#en The mask type. + !#zh 遮罩类型 */ + type: Mask.Type; + /** !#en The mask image + !#zh 遮罩所需要的贴图 */ + spriteFrame: SpriteFrame; + /** !#en + The alpha threshold.(Not supported Canvas Mode)
+ The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold.
+ Should be a float between 0 and 1.
+ This default to 1 (so alpha test is disabled). + !#zh + Alpha 阈值(不支持 Canvas 模式)
+ 只有当模板的像素的 alpha 大于 alphaThreshold 时,才会绘制内容。
+ 该数值 0 ~ 1 之间的浮点数,默认值为 1(因此禁用 alpha) */ + alphaThreshold: number; + /** !#en Reverse mask (Not supported Canvas Mode) + !#zh 反向遮罩(不支持 Canvas 模式) */ + inverted: boolean; + /** !#en The segements for ellipse mask. + !#zh 椭圆遮罩的曲线细分数 */ + segements: number; + } + /** !#en The PageView control + !#zh 页面视图组件 */ + export class PageView extends ScrollView { + /** !#en Specify the size type of each page in PageView. + !#zh 页面视图中每个页面大小类型 */ + sizeMode: PageView.SizeMode; + /** !#en The page view direction + !#zh 页面视图滚动类型 */ + direction: PageView.Direction; + /** !#en + The scroll threshold value, when drag exceeds this value, + release the next page will automatically scroll, less than the restore + !#zh 滚动临界值,默认单位百分比,当拖拽超出该数值时,松开会自动滚动下一页,小于时则还原。 */ + scrollThreshold: number; + /** !#en + Auto page turning velocity threshold. When users swipe the PageView quickly, + it will calculate a velocity based on the scroll distance and time, + if the calculated velocity is larger than the threshold, then it will trigger page turning. + !#zh + 快速滑动翻页临界值。 + 当用户快速滑动时,会根据滑动开始和结束的距离与时间计算出一个速度值, + 该值与此临界值相比较,如果大于临界值,则进行自动翻页。 */ + autoPageTurningThreshold: number; + /** !#en Change the PageTurning event timing of PageView. + !#zh 设置 PageView PageTurning 事件的发送时机。 */ + pageTurningEventTiming: number; + /** !#en The Page View Indicator + !#zh 页面视图指示器组件 */ + indicator: PageViewIndicator; + /** !#en The time required to turn over a page. unit: second + !#zh 每个页面翻页时所需时间。单位:秒 */ + pageTurningSpeed: number; + /** !#en PageView events callback + !#zh 滚动视图的事件回调函数 */ + pageEvents: Component.EventHandler[]; + /** + !#en Returns current page index + !#zh 返回当前页面索引 + */ + getCurrentPageIndex(): number; + /** + !#en Set current page index + !#zh 设置当前页面索引 + @param index index + */ + setCurrentPageIndex(index: number): void; + /** + !#en Returns all pages of pageview + !#zh 返回视图中的所有页面 + */ + getPages(): Node[]; + /** + !#en At the end of the current page view to insert a new view + !#zh 在当前页面视图的尾部插入一个新视图 + @param page page + */ + addPage(page: Node): void; + /** + !#en Inserts a page in the specified location + !#zh 将页面插入指定位置中 + @param page page + @param index index + */ + insertPage(page: Node, index: number): void; + /** + !#en Removes a page from PageView. + !#zh 移除指定页面 + @param page page + */ + removePage(page: Node): void; + /** + !#en Removes a page at index of PageView. + !#zh 移除指定下标的页面 + @param index index + */ + removePageAtIndex(index: number): void; + /** + !#en Removes all pages from PageView + !#zh 移除所有页面 + */ + removeAllPages(): void; + /** + !#en Scroll PageView to index. + !#zh 滚动到指定页面 + @param idx index of page. + @param timeInSecond scrolling time + */ + scrollToPage(idx: number, timeInSecond: number): void; + } + /** !#en The Page View Indicator Component + !#zh 页面视图每页标记组件 */ + export class PageViewIndicator extends Component { + /** !#en The spriteFrame for each element. + !#zh 每个页面标记显示的图片 */ + spriteFrame: SpriteFrame; + /** !#en The location direction of PageViewIndicator. + !#zh 页面标记摆放方向 */ + direction: PageViewIndicator.Direction; + /** !#en The cellSize for each element. + !#zh 每个页面标记的大小 */ + cellSize: Size; + /** !#en The distance between each element. + !#zh 每个页面标记之间的边距 */ + spacing: number; + /** + !#en Set Page View + !#zh 设置页面视图 + @param target target + */ + setPageView(target: PageView): void; + } + /** !#en + Visual indicator of progress in some operation. + Displays a bar to the user representing how far the operation has progressed. + !#zh + 进度条组件,可用于显示加载资源时的进度。 */ + export class ProgressBar extends Component { + /** !#en The targeted Sprite which will be changed progressively. + !#zh 用来显示进度条比例的 Sprite 对象。 */ + barSprite: Sprite; + /** !#en The progress mode, there are two modes supported now: horizontal and vertical. + !#zh 进度条的模式 */ + mode: ProgressBar.Mode; + /** !#en The total width or height of the bar sprite. + !#zh 进度条实际的总长度 */ + totalLength: number; + /** !#en The current progress of the bar sprite. The valid value is between 0-1. + !#zh 当前进度值,该数值的区间是 0-1 之间。 */ + progress: number; + /** !#en Whether reverse the progress direction of the bar sprite. + !#zh 进度条是否进行反方向变化。 */ + reverse: boolean; + } + /** Rendering component in scene graph. + Maintains a node which will be the scene graph of component's Node. */ + export class _RendererInSG extends _SGComponent { + } + /** The base rendering component which will attach a leaf node to the cocos2d scene graph. */ + export class _RendererUnderSG extends _SGComponent { + } + /** !#en The RichText Component. + !#zh 富文本组件 */ + export class RichText extends Component { + /** !#en Content string of RichText. + !#zh 富文本显示的文本内容。 */ + string: string; + /** !#en Horizontal Alignment of each line in RichText. + !#zh 文本内容的水平对齐方式。 */ + horizontalAlign: TextAlignment; + /** !#en Font size of RichText. + !#zh 富文本字体大小。 */ + fontSize: number; + /** !#en Custom TTF font of RichText + !#zh 富文本定制字体 */ + font: cc.TTFFont; + /** !#en The maximize width of the RichText + !#zh 富文本的最大宽度 */ + maxWidth: number; + /** !#en Line Height of RichText. + !#zh 富文本行高。 */ + lineHeight: number; + /** !#en The image atlas for the img tag. For each src value in the img tag, there should be a valid spriteFrame in the image atlas. + !#zh 对于 img 标签里面的 src 属性名称,都需要在 imageAtlas 里面找到一个有效的 spriteFrame,否则 img tag 会判定为无效。 */ + imageAtlas: SpriteAtlas; + /** !#en + Once checked, the RichText will block all input events (mouse and touch) within + the bounding box of the node, preventing the input from penetrating into the underlying node. + !#zh + 选中此选项后,RichText 将阻止节点边界框中的所有输入事件(鼠标和触摸),从而防止输入事件穿透到底层节点。 */ + handleTouchEvent: boolean; + } + /** The base class for all rendering component in scene graph. + + You should override: + - _createSgNode + - _initSgNode */ + export class _SGComponent extends Component { + } + /** !#en + The Scrollbar control allows the user to scroll an image or other view that is too large to see completely + !#zh 滚动条组件 */ + export class Scrollbar extends Component { + /** !#en The "handle" part of the scrollbar. + !#zh 作为当前滚动区域位置显示的滑块 Sprite。 */ + handle: Sprite; + /** !#en The direction of scrollbar. + !#zh ScrollBar 的滚动方向。 */ + direction: Scrollbar.Direction; + /** !#en Whether enable auto hide or not. + !#zh 是否在没有滚动动作时自动隐藏 ScrollBar。 */ + enableAutoHide: boolean; + /** !#en + The time to hide scrollbar when scroll finished. + Note: This value is only useful when enableAutoHide is true. + !#zh + 没有滚动动作后经过多久会自动隐藏。 + 注意:只要当 “enableAutoHide” 为 true 时,才有效。 */ + autoHideTime: number; + } + /** !#en + Layout container for a view hierarchy that can be scrolled by the user, + allowing it to be larger than the physical display. + + !#zh + 滚动视图组件 */ + export class ScrollView extends Component { + /** !#en This is a reference to the UI element to be scrolled. + !#zh 可滚动展示内容的节点。 */ + content: Node; + /** !#en Enable horizontal scroll. + !#zh 是否开启水平滚动。 */ + horizontal: boolean; + /** !#en Enable vertical scroll. + !#zh 是否开启垂直滚动。 */ + vertical: boolean; + /** !#en When inertia is set, the content will continue to move when touch ended. + !#zh 是否开启滚动惯性。 */ + inertia: boolean; + /** !#en + It determines how quickly the content stop moving. A value of 1 will stop the movement immediately. + A value of 0 will never stop the movement until it reaches to the boundary of scrollview. + !#zh + 开启惯性后,在用户停止触摸后滚动多快停止,0表示永不停止,1表示立刻停止。 */ + brake: number; + /** !#en When elastic is set, the content will be bounce back when move out of boundary. + !#zh 是否允许滚动内容超过边界,并在停止触摸后回弹。 */ + elastic: boolean; + /** !#en The elapse time of bouncing back. A value of 0 will bounce back immediately. + !#zh 回弹持续的时间,0 表示将立即反弹。 */ + bounceDuration: number; + /** !#en The horizontal scrollbar reference. + !#zh 水平滚动的 ScrollBar。 */ + horizontalScrollBar: Scrollbar; + /** !#en The vertical scrollbar reference. + !#zh 垂直滚动的 ScrollBar。 */ + verticalScrollBar: Scrollbar; + /** !#en Scrollview events callback + !#zh 滚动视图的事件回调函数 */ + scrollEvents: Component.EventHandler[]; + /** !#en If cancelInnerEvents is set to true, the scroll behavior will cancel touch events on inner content nodes + It's set to true by default. + !#zh 如果这个属性被设置为 true,那么滚动行为会取消子节点上注册的触摸事件,默认被设置为 true。 + 注意,子节点上的 touchstart 事件仍然会触发,触点移动距离非常短的情况下 touchmove 和 touchend 也不会受影响。 */ + cancelInnerEvents: boolean; + /** + !#en Scroll the content to the bottom boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图底部。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the bottom boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the bottom of the view. + scrollView.scrollToBottom(0.1); + ``` + */ + scrollToBottom(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the top boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图顶部。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the top boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the top of the view. + scrollView.scrollToTop(0.1); + ``` + */ + scrollToTop(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the left boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图左边。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the left boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the left of the view. + scrollView.scrollToLeft(0.1); + ``` + */ + scrollToLeft(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the right boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图右边。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the right boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the right of the view. + scrollView.scrollToRight(0.1); + ``` + */ + scrollToRight(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the top left boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图左上角。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the top left boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the upper left corner of the view. + scrollView.scrollToTopLeft(0.1); + ``` + */ + scrollToTopLeft(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the top right boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图右上角。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the top right boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the top right corner of the view. + scrollView.scrollToTopRight(0.1); + ``` + */ + scrollToTopRight(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the bottom left boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图左下角。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the bottom left boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the lower left corner of the view. + scrollView.scrollToBottomLeft(0.1); + ``` + */ + scrollToBottomLeft(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the bottom right boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图右下角。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the bottom right boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the lower right corner of the view. + scrollView.scrollToBottomRight(0.1); + ``` + */ + scrollToBottomRight(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll with an offset related to the ScrollView's top left origin, if timeInSecond is omitted, then it will jump to the + specific offset immediately. + !#zh 视图内容在规定时间内将滚动到 ScrollView 相对左上角原点的偏移位置, 如果 timeInSecond参数不传,则立即滚动到指定偏移位置。 + @param offset A Vec2, the value of which each axis between 0 and maxScrollOffset + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the specific offset of ScrollView immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to middle position in 0.1 second in x-axis + var maxScrollOffset = this.getMaxScrollOffset(); + scrollView.scrollToOffset(cc.p(maxScrollOffset.x / 2, 0), 0.1); + ``` + */ + scrollToOffset(offset: Vec2, timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Get the positive offset value corresponds to the content's top left boundary. + !#zh 获取滚动视图相对于左上角原点的当前滚动偏移 + */ + getScrollOffset(): Vec2; + /** + !#en Get the maximize available scroll offset + !#zh 获取滚动视图最大可以滚动的偏移量 + */ + getMaxScrollOffset(): Vec2; + /** + !#en Scroll the content to the horizontal percent position of ScrollView. + !#zh 视图内容在规定时间内将滚动到 ScrollView 水平方向的百分比位置上。 + @param percent A value between 0 and 1. + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the horizontal percent position of ScrollView immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to middle position. + scrollView.scrollToBottomRight(0.5, 0.1); + ``` + */ + scrollToPercentHorizontal(percent: number, timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the percent position of ScrollView in any direction. + !#zh 视图内容在规定时间内进行垂直方向和水平方向的滚动,并且滚动到指定百分比位置上。 + @param anchor A point which will be clamp between cc.p(0,0) and cc.p(1,1). + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the percent position of ScrollView immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Vertical scroll to the bottom of the view. + scrollView.scrollTo(cc.p(0, 1), 0.1); + + // Horizontal scroll to view right. + scrollView.scrollTo(cc.p(1, 0), 0.1); + ``` + */ + scrollTo(anchor: Vec2, timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the vertical percent position of ScrollView. + !#zh 视图内容在规定时间内滚动到 ScrollView 垂直方向的百分比位置上。 + @param percent A value between 0 and 1. + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the vertical percent position of ScrollView immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + // Scroll to middle position. + scrollView.scrollToPercentVertical(0.5, 0.1); + */ + scrollToPercentVertical(percent: number, timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Stop auto scroll immediately + !#zh 停止自动滚动, 调用此 API 可以让 Scrollview 立即停止滚动 + */ + stopAutoScroll(): void; + /** + !#en Modify the content position. + !#zh 设置当前视图内容的坐标点。 + @param position The position in content's parent space. + */ + setContentPosition(position: Vec2): void; + /** + !#en Query the content's position in its parent space. + !#zh 获取当前视图内容的坐标点。 + */ + getContentPosition(): Position; + /** + !#en Query whether the user is currently dragging the ScrollView to scroll it + !#zh 用户是否在拖拽当前滚动视图 + */ + isScrolling(): boolean; + /** + !#en Query whether the ScrollView is currently scrolling because of a bounceback or inertia slowdown. + !#zh 当前滚动视图是否在惯性滚动 + */ + isAutoScrolling(): boolean; + } + /** !#en The Slider Control + !#zh 滑动器组件 */ + export class Slider extends Component { + /** !#en The "handle" part of the slider + !#zh 滑动器滑块按钮部件 */ + handle: Button; + /** !#en The slider direction + !#zh 滑动器方向 */ + direction: Slider.Direction; + /** !#en The current progress of the slider. The valid value is between 0-1 + !#zh 当前进度值,该数值的区间是 0-1 之间 */ + progress: number; + /** !#en The slider events callback + !#zh 滑动器组件事件回调函数 */ + slideEvents: Component.EventHandler[]; + } + /** !#en Renders a sprite in the scene. + !#zh 该组件用于在场景中渲染精灵。 */ + export class Sprite extends _RendererUnderSG { + /** !#en The sprite frame of the sprite. + !#zh 精灵的精灵帧 */ + spriteFrame: SpriteFrame; + /** !#en The sprite render type. + !#zh 精灵渲染类型 */ + type: Sprite.Type; + /** !#en + The fill type, This will only have any effect if the "type" is set to “cc.Sprite.Type.FILLED”. + !#zh + 精灵填充类型,仅渲染类型设置为 cc.Sprite.Type.FILLED 时有效。 */ + fillType: Sprite.FillType; + /** !#en + The fill Center, This will only have any effect if the "type" is set to “cc.Sprite.Type.FILLED”. + !#zh + 填充中心点,仅渲染类型设置为 cc.Sprite.Type.FILLED 时有效。 */ + fillCenter: Vec2; + /** !#en + The fill Start, This will only have any effect if the "type" is set to “cc.Sprite.Type.FILLED”. + !#zh + 填充起始点,仅渲染类型设置为 cc.Sprite.Type.FILLED 时有效。 */ + fillStart: number; + /** !#en + The fill Range, This will only have any effect if the "type" is set to “cc.Sprite.Type.FILLED”. + !#zh + 填充范围,仅渲染类型设置为 cc.Sprite.Type.FILLED 时有效。 */ + fillRange: number; + /** !#en specify the frame is trimmed or not. + !#zh 是否使用裁剪模式 */ + trim: boolean; + /** !#en specify the source Blend Factor. + !#zh 指定原图的混合模式 */ + srcBlendFactor: BlendFactor; + /** !#en specify the destination Blend Factor. + !#zh 指定目标的混合模式 */ + dstBlendFactor: BlendFactor; + /** !#en specify the size tracing mode. + !#zh 精灵尺寸调整模式 */ + sizeMode: Sprite.SizeMode; + /** + !#en Change the left sprite's cap inset. + !#zh 设置精灵左边框-用于九宫格。 + @param insetLeft The values to use for the cap inset. + + @example + ```js + sprite.setInsetLeft(5); + ``` + */ + setInsetLeft(insetLeft: number): void; + /** + !#en Query the left sprite's cap inset. + !#zh 获取精灵左边框 + + @example + ```js + var insetLeft = sprite.getInsetLeft(); + cc.log("Inset Left:" + insetLeft); + ``` + */ + getInsetLeft(): number; + /** + !#en Change the top sprite's cap inset. + !#zh 设置精灵上边框-用于九宫格。 + @param insetTop The values to use for the cap inset. + + @example + ```js + sprite.setInsetTop(5); + ``` + */ + setInsetTop(insetTop: number): void; + /** + !#en Query the top sprite's cap inset. + !#zh 获取精灵上边框。 + + @example + ```js + var insetTop = sprite.getInsetTop(); + cc.log("Inset Top:" + insetTop); + ``` + */ + getInsetTop(): number; + /** + !#en Change the right sprite's cap inset. + !#zh 设置精灵右边框-用于九宫格。 + @param insetRight The values to use for the cap inset. + + @example + ```js + sprite.setInsetRight(5); + ``` + */ + setInsetRight(insetRight: number): void; + /** + !#en Query the right sprite's cap inset. + !#zh 获取精灵右边框。 + + @example + ```js + var insetRight = sprite.getInsetRight(); + cc.log("Inset Right:" + insetRight); + ``` + */ + getInsetRight(): number; + /** + !#en Change the bottom sprite's cap inset. + !#zh 设置精灵下边框-用于九宫格。 + @param bottomInset The values to use for the cap inset. + + @example + ```js + sprite.setInsetBottom(5); + ``` + */ + setInsetBottom(bottomInset: number): void; + /** + !#en Query the bottom sprite's cap inset. + !#zh 获取精灵下边框。 + + @example + ```js + var insetBottom = sprite.getInsetBottom(); + cc.log("Inset Bottom:" + insetBottom); + ``` + */ + getInsetBottom(): number; + } + /** !#en A distortion used to change the rendering of simple sprite.If will take effect after sprite component is added. + !#zh 扭曲效果组件,用于改变SIMPLE类型sprite的渲染,只有当sprite组件已经添加后,才能起作用. */ + export class SpriteDistortion extends Component { + /** !#en Change the UV offset for distortion rendering. + !#zh 在渲染时改变UV的整体偏移. */ + offset: Vec2; + /** !#en Change the UV scale for distortion rendering. + !#zh 在渲染时改变UV的寻址系数 */ + tiling: Vec2; + } + /** !#en The toggle component is a CheckBox, when it used together with a ToggleGroup, it + could be treated as a RadioButton. + !#zh Toggle 是一个 CheckBox,当它和 ToggleGroup 一起使用的时候,可以变成 RadioButton。 */ + export class Toggle extends Button { + /** !#en When this value is true, the check mark component will be enabled, otherwise + the check mark component will be disabled. + !#zh 如果这个设置为 true,则 check mark 组件会处于 enabled 状态,否则处于 disabled 状态。 */ + isChecked: boolean; + /** !#en The toggle group which the toggle belongs to, when it is null, the toggle is a CheckBox. + Otherwise, the toggle is a RadioButton. + !#zh Toggle 所属的 ToggleGroup,这个属性是可选的。如果这个属性为 null,则 Toggle 是一个 CheckBox, + 否则,Toggle 是一个 RadioButton。 */ + toggleGroup: ToggleGroup; + /** !#en The image used for the checkmark. + !#zh Toggle 处于选中状态时显示的图片 */ + checkMark: Sprite; + /** !#en If Toggle is clicked, it will trigger event's handler + !#zh Toggle 按钮的点击事件列表。 */ + checkEvents: Component.EventHandler[]; + /** + !#en Make the toggle button checked. + !#zh 使 toggle 按钮处于选中状态 + */ + check(): void; + /** + !#en Make the toggle button unchecked. + !#zh 使 toggle 按钮处于未选中状态 + */ + uncheck(): void; + } + /** !#en ToggleContainer is not a visiable UI component but a way to modify the behavior of a set of Toggles.
+ Toggles that belong to the same group could only have one of them to be switched on at a time.
+ Note: All the first layer child node containing the toggle component will auto be added to the container + !#zh ToggleContainer 不是一个可见的 UI 组件,它可以用来修改一组 Toggle 组件的行为。
+ 当一组 Toggle 属于同一个 ToggleContainer 的时候,任何时候只能有一个 Toggle 处于选中状态。
+ 注意:所有包含 Toggle 组件的一级子节点都会自动被添加到该容器中 */ + export class ToggleContainer extends Component { + /** !#en If this setting is true, a toggle could be switched off and on when pressed. + If it is false, it will make sure there is always only one toggle could be switched on + and the already switched on toggle can't be switched off. + !#zh 如果这个设置为 true, 那么 toggle 按钮在被点击的时候可以反复地被选中和未选中。 */ + allowSwitchOff: boolean; + /** !#en Read only property, return the toggle items array reference managed by ToggleContainer. + !#zh 只读属性,返回 ToggleContainer 管理的 toggle 数组引用 */ + toggleItems: Toggle[]; + } + /** !#en ToggleGroup is not a visiable UI component but a way to modify the behavior of a set of Toggles. + Toggles that belong to the same group could only have one of them to be switched on at a time. + !#zh ToggleGroup 不是一个可见的 UI 组件,它可以用来修改一组 Toggle 组件的行为。当一组 Toggle 属于同一个 ToggleGroup 的时候, + 任何时候只能有一个 Toggle 处于选中状态。 */ + export class ToggleGroup extends Component { + /** !#en If this setting is true, a toggle could be switched off and on when pressed. + If it is false, it will make sure there is always only one toggle could be switched on + and the already switched on toggle can't be switched off. + !#zh 如果这个设置为 true, 那么 toggle 按钮在被点击的时候可以反复地被选中和未选中。 */ + allowSwitchOff: boolean; + /** !#en Read only property, return the toggle items array reference managed by toggleGroup. + !#zh 只读属性,返回 toggleGroup 管理的 toggle 数组引用 */ + toggleItems: any[]; + } + /** !#en cc.VideoPlayer is a component for playing videos, you can use it for showing videos in your game. + !#zh Video 组件,用于在游戏中播放视频 */ + export class VideoPlayer extends _RendererUnderSG { + /** !#en The resource type of videoplayer, REMOTE for remote url and LOCAL for local file path. + !#zh 视频来源:REMOTE 表示远程视频 URL,LOCAL 表示本地视频地址。 */ + resourceType: VideoPlayer.ResourceType; + /** !#en The remote URL of video. + !#zh 远程视频的 URL */ + remoteURL: string; + /** !#en The local video full path. + !#zh 本地视频的 URL */ + clip: string; + /** !#en The current playback time of the now playing item in seconds, you could also change the start playback time. + !#zh 指定视频从什么时间点开始播放,单位是秒,也可以用来获取当前视频播放的时间进度。 */ + currentTime: number; + /** !#en Whether keep the aspect ration of the original video. + !#zh 是否保持视频原来的宽高比 */ + keepAspectRatio: boolean; + /** !#en Whether play video in fullscreen mode. + !#zh 是否全屏播放视频 */ + isFullscreen: boolean; + /** !#en the video player's callback, it will be triggered when certain event occurs, like: playing, paused, stopped and completed. + !#zh 视频播放回调函数,该回调函数会在特定情况被触发,比如播放中,暂时,停止和完成播放。 */ + videoPlayerEvent: Component.EventHandler[]; + /** + !#en If a video is paused, call this method could resume playing. If a video is stopped, call this method to play from scratch. + !#zh 如果视频被暂停播放了,调用这个接口可以继续播放。如果视频被停止播放了,调用这个接口可以从头开始播放。 + */ + play(): void; + /** + !#en If a video is paused, call this method to resume playing. + !#zh 如果一个视频播放被暂停播放了,调用这个接口可以继续播放。 + */ + resume(): void; + /** + !#en If a video is playing, call this method to pause playing. + !#zh 如果一个视频正在播放,调用这个接口可以暂停播放。 + */ + pause(): void; + /** + !#en If a video is playing, call this method to stop playing immediately. + !#zh 如果一个视频正在播放,调用这个接口可以立马停止播放。 + */ + stop(): void; + /** + !#en Gets the duration of the video + !#zh 获取视频文件的播放总时长 + */ + getDuration(): number; + /** + !#en Determine whether video is playing or not. + !#zh 判断当前视频是否处于播放状态 + */ + isPlaying(): boolean; + /** + !#en if you don't need the VideoPlayer and it isn't in any running Scene, you should + call the destroy method on this component or the associated node explicitly. + Otherwise, the created DOM element won't be removed from web page. + !#zh + 如果你不再使用 VideoPlayer,并且组件未添加到场景中,那么你必须手动对组件或所在节点调用 destroy。 + 这样才能移除网页上的 DOM 节点,避免 Web 平台内存泄露。 + + @example + ```js + videoplayer.node.parent = null; // or videoplayer.node.removeFromParent(false); + // when you don't need videoplayer anymore + videoplayer.node.destroy(); + ``` + */ + destroy(): boolean; + } + /** !#en + Handling touch events in a ViewGroup takes special care, + because it's common for a ViewGroup to have children that are targets for different touch events than the ViewGroup itself. + To make sure that each view correctly receives the touch events intended for it, + ViewGroup should register capture phase event and handle the event propagation properly. + Please refer to Scrollview for more information. + + !#zh + ViewGroup的事件处理比较特殊,因为 ViewGroup 里面的子节点关心的事件跟 ViewGroup 本身可能不一样。 + 为了让子节点能够正确地处理事件,ViewGroup 需要注册 capture 阶段的事件,并且合理地处理 ViewGroup 之间的事件传递。 + 请参考 ScrollView 的实现来获取更多信息。 */ + export class ViewGroup extends Component { + } + /** !#en cc.WebView is a component for display web pages in the game + !#zh WebView 组件,用于在游戏中显示网页 */ + export class WebView extends _RendererUnderSG { + /** !#en A given URL to be loaded by the WebView, it should have a http or https prefix. + !#zh 指定 WebView 加载的网址,它应该是一个 http 或者 https 开头的字符串 */ + url: string; + /** !#en The webview's event callback , it will be triggered when certain webview event occurs. + !#zh WebView 的回调事件,当网页加载过程中,加载完成后或者加载出错时都会回调此函数 */ + webviewLoadedEvents: Component.EventHandler[]; + /** + !#en + Set javascript interface scheme (see also setOnJSCallback).
+ Note: Supports only on the Android and iOS. For HTML5, please refer to the official documentation.
+ Please refer to the official documentation for more details. + !#zh + 设置 JavaScript 接口方案(与 'setOnJSCallback' 配套使用)。
+ 注意:只支持 Android 和 iOS ,Web 端用法请前往官方文档查看。
+ 详情请参阅官方文档 + @param scheme scheme + */ + setJavascriptInterfaceScheme(scheme: string): void; + /** + !#en + This callback called when load URL that start with javascript + interface scheme (see also setJavascriptInterfaceScheme).
+ Note: Supports only on the Android and iOS. For HTML5, please refer to the official documentation.
+ Please refer to the official documentation for more details. + !#zh + 当加载 URL 以 JavaScript 接口方案开始时调用这个回调函数。
+ 注意:只支持 Android 和 iOS,Web 端用法请前往官方文档查看。 + 详情请参阅官方文档 + @param callback callback + */ + setOnJSCallback(callback: Function): void; + /** + !#en + Evaluates JavaScript in the context of the currently displayed page.
+ Please refer to the official document for more details
+ Note: Cross domain issues need to be resolved by yourself
+ !#zh + 执行 WebView 内部页面脚本(详情请参阅官方文档)
+ 注意:需要自行解决跨域问题 + @param str str + */ + evaluateJS(str: string): void; + /** + !#en if you don't need the WebView and it isn't in any running Scene, you should + call the destroy method on this component or the associated node explicitly. + Otherwise, the created DOM element won't be removed from web page. + !#zh + 如果你不再使用 WebView,并且组件未添加到场景中,那么你必须手动对组件或所在节点调用 destroy。 + 这样才能移除网页上的 DOM 节点,避免 Web 平台内存泄露。 + + @example + ```js + webview.node.parent = null; // or webview.node.removeFromParent(false); + // when you don't need webview anymore + webview.node.destroy(); + ``` + */ + destroy(): void; + } + /** !#en + Stores and manipulate the anchoring based on its parent. + Widget are used for GUI but can also be used for other things. + Widget will adjust current node's position and size automatically, but the results after adjustment can not be obtained until the next frame unless you call {{#crossLink "Widget/updateAlignment:method"}}{{/crossLink}} manually. + !#zh + Widget 组件,用于设置和适配其相对于父节点的边距,Widget 通常被用于 UI 界面,也可以用于其他地方。 + Widget 会自动调整当前节点的坐标和宽高,不过目前调整后的结果要到下一帧才能在脚本里获取到,除非你先手动调用 {{#crossLink "Widget/updateAlignment:method"}}{{/crossLink}}。 */ + export class Widget extends Component { + /** !#en Specifies an alignment target that can only be one of the parent nodes of the current node. + The default value is null, and when null, indicates the current parent. + !#zh 指定一个对齐目标,只能是当前节点的其中一个父节点,默认为空,为空时表示当前父节点。 */ + target: Node; + /** !#en Whether to align the top. + !#zh 是否对齐上边。 */ + isAlignTop: boolean; + /** !#en + Vertically aligns the midpoint, This will open the other vertical alignment options cancel. + !#zh + 是否垂直方向对齐中点,开启此项会将垂直方向其他对齐选项取消。 */ + isAlignVerticalCenter: boolean; + /** !#en Whether to align the bottom. + !#zh 是否对齐下边。 */ + isAlignBottom: boolean; + /** !#en Whether to align the left. + !#zh 是否对齐左边 */ + isAlignLeft: boolean; + /** !#en + Horizontal aligns the midpoint. This will open the other horizontal alignment options canceled. + !#zh + 是否水平方向对齐中点,开启此选项会将水平方向其他对齐选项取消。 */ + isAlignHorizontalCenter: boolean; + /** !#en Whether to align the right. + !#zh 是否对齐右边。 */ + isAlignRight: boolean; + /** !#en + Whether the stretched horizontally, when enable the left and right alignment will be stretched horizontally, + the width setting is invalid (read only). + !#zh + 当前是否水平拉伸。当同时启用左右对齐时,节点将会被水平拉伸,此时节点的宽度只读。 */ + isStretchWidth: boolean; + /** !#en + Whether the stretched vertically, when enable the left and right alignment will be stretched vertically, + then height setting is invalid (read only) + !#zh + 当前是否垂直拉伸。当同时启用上下对齐时,节点将会被垂直拉伸,此时节点的高度只读。 */ + isStretchHeight: boolean; + /** !#en + The margins between the top of this node and the top of parent node, + the value can be negative, Only available in 'isAlignTop' open. + !#zh + 本节点顶边和父节点顶边的距离,可填写负值,只有在 isAlignTop 开启时才有作用。 */ + top: number; + /** !#en + The margins between the bottom of this node and the bottom of parent node, + the value can be negative, Only available in 'isAlignBottom' open. + !#zh + 本节点底边和父节点底边的距离,可填写负值,只有在 isAlignBottom 开启时才有作用。 */ + bottom: number; + /** !#en + The margins between the left of this node and the left of parent node, + the value can be negative, Only available in 'isAlignLeft' open. + !#zh + 本节点左边和父节点左边的距离,可填写负值,只有在 isAlignLeft 开启时才有作用。 */ + left: number; + /** !#en + The margins between the right of this node and the right of parent node, + the value can be negative, Only available in 'isAlignRight' open. + !#zh + 本节点右边和父节点右边的距离,可填写负值,只有在 isAlignRight 开启时才有作用。 */ + right: number; + /** !#en + Horizontal aligns the midpoint offset value, + the value can be negative, Only available in 'isAlignHorizontalCenter' open. + !#zh 水平居中的偏移值,可填写负值,只有在 isAlignHorizontalCenter 开启时才有作用。 */ + horizontalCenter: number; + /** !#en + Vertical aligns the midpoint offset value, + the value can be negative, Only available in 'isAlignVerticalCenter' open. + !#zh 垂直居中的偏移值,可填写负值,只有在 isAlignVerticalCenter 开启时才有作用。 */ + verticalCenter: number; + /** !#en If true, horizontalCenter is pixel margin, otherwise is percentage (0 - 1) margin. + !#zh 如果为 true,"horizontalCenter" 将会以像素作为偏移值,反之为百分比(0 到 1)。 */ + isAbsoluteHorizontalCenter: boolean; + /** !#en If true, verticalCenter is pixel margin, otherwise is percentage (0 - 1) margin. + !#zh 如果为 true,"verticalCenter" 将会以像素作为偏移值,反之为百分比(0 到 1)。 */ + isAbsoluteVerticalCenter: boolean; + /** !#en + If true, top is pixel margin, otherwise is percentage (0 - 1) margin relative to the parent's height. + !#zh + 如果为 true,"top" 将会以像素作为边距,否则将会以相对父物体高度的百分比(0 到 1)作为边距。 */ + isAbsoluteTop: boolean; + /** !#en + If true, bottom is pixel margin, otherwise is percentage (0 - 1) margin relative to the parent's height. + !#zh + 如果为 true,"bottom" 将会以像素作为边距,否则将会以相对父物体高度的百分比(0 到 1)作为边距。 */ + isAbsoluteBottom: boolean; + /** !#en + If true, left is pixel margin, otherwise is percentage (0 - 1) margin relative to the parent's width. + !#zh + 如果为 true,"left" 将会以像素作为边距,否则将会以相对父物体宽度的百分比(0 到 1)作为边距。 */ + isAbsoluteLeft: boolean; + /** !#en + If true, right is pixel margin, otherwise is percentage (0 - 1) margin relative to the parent's width. + !#zh + 如果为 true,"right" 将会以像素作为边距,否则将会以相对父物体宽度的百分比(0 到 1)作为边距。 */ + isAbsoluteRight: boolean; + /** !#en TODO + !#zh + 开启后仅会在 onEnable 的当帧结束时对齐一次,然后立刻禁用当前组件。 + 这样便于脚本或动画继续控制当前节点。 + 注意:onEnable 时所在的那一帧仍然会进行对齐。 */ + isAlignOnce: boolean; + /** + !#en + Immediately perform the widget alignment. You need to manually call this method only if + you need to get the latest results after the alignment before the end of current frame. + !#zh + 立刻执行 widget 对齐操作。这个接口一般不需要手工调用。 + 只有当你需要在当前帧结束前获得 widget 对齐后的最新结果时才需要手动调用这个方法。 + + @example + ```js + widget.top = 10; // change top margin + cc.log(widget.node.y); // not yet changed + widget.updateAlignment(); + cc.log(widget.node.y); // changed + ``` + */ + updateAlignment(): void; + } + /** !#en + EventTarget is an object to which an event is dispatched when something has occurred. + Entity are the most common event targets, but other objects can be event targets too. + + Event targets are an important part of the Fireball event model. + The event target serves as the focal point for how events flow through the scene graph. + When an event such as a mouse click or a keypress occurs, Fireball dispatches an event object + into the event flow from the root of the hierarchy. The event object then makes its way through + the scene graph until it reaches the event target, at which point it begins its return trip through + the scene graph. This round-trip journey to the event target is conceptually divided into three phases: + - The capture phase comprises the journey from the root to the last node before the event target's node + - The target phase comprises only the event target node + - The bubbling phase comprises any subsequent nodes encountered on the return trip to the root of the tree + See also: http://www.w3.org/TR/DOM-Level-3-Events/#event-flow + + Event targets can implement the following methods: + - _getCapturingTargets + - _getBubblingTargets + + !#zh + 事件目标是事件触发时,分派的事件对象,Node 是最常见的事件目标, + 但是其他对象也可以是事件目标。
*/ + export class EventTarget { + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** !#en Base class of all kinds of events. + !#zh 包含事件相关信息的对象。 */ + export class Event { + /** + + @param type The name of the event (case-sensitive), e.g. "click", "fire", or "submit" + @param bubbles A boolean indicating whether the event bubbles up through the tree or not + */ + constructor(type: string, bubbles: boolean); + /** !#en The name of the event (case-sensitive), e.g. "click", "fire", or "submit". + !#zh 事件类型。 */ + type: string; + /** !#en Indicate whether the event bubbles up through the tree or not. + !#zh 表示该事件是否进行冒泡。 */ + bubbles: boolean; + /** !#en A reference to the target to which the event was originally dispatched. + !#zh 最初事件触发的目标 */ + target: any; + /** !#en A reference to the currently registered target for the event. + !#zh 当前目标 */ + currentTarget: any; + /** !#en + Indicates which phase of the event flow is currently being evaluated. + Returns an integer value represented by 4 constants: + - Event.NONE = 0 + - Event.CAPTURING_PHASE = 1 + - Event.AT_TARGET = 2 + - Event.BUBBLING_PHASE = 3 + The phases are explained in the [section 3.1, Event dispatch and DOM event flow] + (http://www.w3.org/TR/DOM-Level-3-Events/#event-flow), of the DOM Level 3 Events specification. + !#zh 事件阶段 */ + eventPhase: number; + /** + !#en Reset the event for being stored in the object pool. + !#zh 重置对象池中存储的事件。 + */ + unuse(): string; + /** + !#en Reuse the event for being used again by the object pool. + !#zh 用于对象池再次使用的事件。 + */ + reuse(): string; + /** + !#en Stops propagation for current event. + !#zh 停止传递当前事件。 + */ + stopPropagation(): void; + /** + !#en Stops propagation for current event immediately, + the event won't even be dispatched to the listeners attached in the current target. + !#zh 立即停止当前事件的传递,事件甚至不会被分派到所连接的当前目标。 + */ + stopPropagationImmediate(): void; + /** + !#en Checks whether the event has been stopped. + !#zh 检查该事件是否已经停止传递. + */ + isStopped(): boolean; + /** + !#en +

+ Gets current target of the event
+ note: It only be available when the event listener is associated with node.
+ It returns 0 when the listener is associated with fixed priority. +

+ !#zh 获取当前目标节点 + */ + getCurrentTarget(): Node; + /** + !#en Gets the event type. + !#zh 获取事件类型 + */ + getType(): string; + /** !#en Code for event without type. + !#zh 没有类型的事件 */ + static NO_TYPE: string; + /** !#en The type code of Touch event. + !#zh 触摸事件类型 */ + static TOUCH: string; + /** !#en The type code of Mouse event. + !#zh 鼠标事件类型 */ + static MOUSE: string; + /** !#en The type code of Keyboard event. + !#zh 键盘事件类型 */ + static KEYBOARD: string; + /** !#en The type code of Acceleration event. + !#zh 加速器事件类型 */ + static ACCELERATION: string; + /** !#en Events not currently dispatched are in this phase + !#zh 尚未派发事件阶段 */ + static NONE: number; + /** !#en + The capturing phase comprises the journey from the root to the last node before the event target's node + see http://www.w3.org/TR/DOM-Level-3-Events/#event-flow + !#zh 捕获阶段,包括事件目标节点之前从根节点到最后一个节点的过程。 */ + static CAPTURING_PHASE: number; + /** !#en + The target phase comprises only the event target node + see http://www.w3.org/TR/DOM-Level-3-Events/#event-flow + !#zh 目标阶段仅包括事件目标节点。 */ + static AT_TARGET: number; + /** !#en + The bubbling phase comprises any subsequent nodes encountered on the return trip to the root of the hierarchy + see http://www.w3.org/TR/DOM-Level-3-Events/#event-flow + !#zh 冒泡阶段, 包括回程遇到到层次根节点的任何后续节点。 */ + static BUBBLING_PHASE: number; + } + /** !#en The System event, it currently supports the key events and accelerometer events + !#zh 系统事件,它目前支持按键事件和重力感应事件 */ + export class SystemEvent extends EventTarget { + /** + !#en whether enable accelerometer event + !#zh 是否启用加速度计事件 + @param isEnable isEnable + */ + setAccelerometerEnabled(isEnable: boolean): void; + /** + !#en set accelerometer interval value + !#zh 设置加速度计间隔值 + @param interval interval + */ + setAccelerometerInterval(interval: number): void; + } + /** !#en +

+ The base class of event listener.
+ If you need custom listener which with different callback, you need to inherit this class.
+ For instance, you could refer to EventListenerAcceleration, EventListenerKeyboard,
+ EventListenerTouchOneByOne, EventListenerCustom. +

+ + !#zh + 封装用户的事件处理逻辑。 + 注意:这是一个抽象类,开发者不应该直接实例化这个类,请参考 {{#crossLink "EventListener/create:method"}}cc.EventListener.create{{/crossLink}}。 */ + export class EventListener { + /** + Constructor + @param type type + @param listenerID listenerID + @param callback callback + */ + constructor(type: number, listenerID: number, callback: number); + /** + !#en Checks whether the listener is available. + !#zh 检测监听器是否有效 + */ + checkAvailable(): boolean; + /** + !#en Clones the listener, its subclasses have to override this method. + !#zh 克隆监听器,它的子类必须重写此方法。 + */ + clone(): EventListener; + /** + !#en Enables or disables the listener + !#zh 启用或禁用监听器。 + @param enabled enabled + */ + setEnabled(enabled: boolean): void; + /** + !#en Checks whether the listener is enabled + !#zh 检查监听器是否可用。 + */ + isEnabled(): boolean; + /** !#en The type code of unknown event listener. + !#zh 未知的事件监听器类型 */ + static UNKNOWN: number; + /** !#en The type code of keyboard event listener. + !#zh 键盘事件监听器类型 */ + static KEYBOARD: number; + /** !#en The type code of acceleration event listener. + !#zh 加速器事件监听器类型 */ + static ACCELERATION: number; + /** + !#en + Create a EventListener object with configuration including the event type, handlers and other parameters. + In handlers, this refer to the event listener object itself. + You can also pass custom parameters in the configuration object, + all custom parameters will be polyfilled into the event listener object and can be accessed in handlers. + !#zh 通过指定不同的 Event 对象来设置想要创建的事件监听器。 + @param argObj a json object + + @example + ```js + // Create KEYBOARD EventListener. + cc.EventListener.create({ + event: cc.EventListener.KEYBOARD, + onKeyPressed: function (keyCode, event) { + cc.log('pressed key: ' + keyCode); + }, + onKeyReleased: function (keyCode, event) { + cc.log('released key: ' + keyCode); + } + }); + + // Create ACCELERATION EventListener. + cc.EventListener.create({ + event: cc.EventListener.ACCELERATION, + callback: function (acc, event) { + cc.log('acc: ' + keyCode); + } + }); + ``` + */ + static create(argObj: any): EventListener; + } + /** !#en + This class has been deprecated, please use cc.systemEvent or cc.EventTarget instead. See [Listen to and launch events](../../../manual/en/scripting/events.md) for details.
+
+ cc.eventManager is a singleton object which manages event listener subscriptions and event dispatching. + The EventListener list is managed in such way so that event listeners can be added and removed + while events are being dispatched. + + !#zh + 该类已废弃,请使用 cc.systemEvent 或 cc.EventTarget 代替,详见 [监听和发射事件](../../../manual/zh/scripting/events.md)。
+
+ 事件管理器,它主要管理事件监听器注册和派发系统事件。 */ + export class eventManager { + /** + !#en Pauses all listeners which are associated the specified target. + !#zh 暂停传入的 node 相关的所有监听器的事件响应。 + @param node node + @param recursive recursive + */ + static pauseTarget(node: Node, recursive?: boolean): void; + /** + !#en Resumes all listeners which are associated the specified target. + !#zh 恢复传入的 node 相关的所有监听器的事件响应。 + @param node node + @param recursive recursive + */ + static resumeTarget(node: Node, recursive?: boolean): void; + /** + !#en Query whether the specified event listener id has been added. + !#zh 查询指定的事件 ID 是否存在 + @param listenerID The listener id. + */ + static hasEventListener(listenerID: string|number): boolean; + /** + !#en +

+ Adds a event listener for a specified event.
+ if the parameter "nodeOrPriority" is a node, + it means to add a event listener for a specified event with the priority of scene graph.
+ if the parameter "nodeOrPriority" is a Number, + it means to add a event listener for a specified event with the fixed priority.
+

+ !#zh + 将事件监听器添加到事件管理器中。
+ 如果参数 “nodeOrPriority” 是节点,优先级由 node 的渲染顺序决定,显示在上层的节点将优先收到事件。
+ 如果参数 “nodeOrPriority” 是数字,优先级则固定为该参数的数值,数字越小,优先级越高。
+ @param listener The listener of a specified event or a object of some event parameters. + @param nodeOrPriority The priority of the listener is based on the draw order of this node or fixedPriority The fixed priority of the listener. + */ + static addListener(listener: EventListener|any, nodeOrPriority: Node|number): EventListener; + /** + !#en Remove a listener. + !#zh 移除一个已添加的监听器。 + @param listener an event listener or a registered node target + + @example + ```js + + // 1. remove eventManager add Listener; + var mouseListener1 = cc.eventManager.addListener({ + event: cc.EventListener.MOUSE, + onMouseDown: function(keyCode, event){ }, + onMouseUp: function(keyCode, event){ }, + onMouseMove: function () { }, + onMouseScroll: function () { } + }, node); + + cc.eventManager.removeListener(mouseListener1); + + // 2. remove eventListener create Listener; + var mouseListener2 = cc.EventListener.create({ + event: cc.EventListener.MOUSE, + onMouseDown: function(keyCode, event){ }, + onMouseUp: function(keyCode, event){ }, + onMouseMove: function () { }, + onMouseScroll: function () { } + }); + + cc.eventManager.removeListener(mouseListener2); + + ``` + */ + static removeListener(listener: EventListener): void; + /** + !#en Removes all listeners with the same event listener type or removes all listeners of a node. + !#zh + 移除注册到 eventManager 中指定类型的所有事件监听器。
+ 1. 如果传入的第一个参数类型是 Node,那么事件管理器将移除与该对象相关的所有事件监听器。 + (如果第二参数 recursive 是 true 的话,就会连同该对象的子控件上所有的事件监听器也一并移除)
+ 2. 如果传入的第一个参数类型是 Number(该类型 EventListener 中定义的事件类型), + 那么事件管理器将移除该类型的所有事件监听器。
+ + 下列是目前存在监听器类型:
+ cc.EventListener.UNKNOWN
+ cc.EventListener.KEYBOARD
+ cc.EventListener.ACCELERATION,
+ @param listenerType listenerType or a node + @param recursive recursive + */ + static removeListeners(listenerType: number|Node, recursive?: boolean): void; + /** + !#en Removes all listeners + !#zh 移除所有事件监听器。 + */ + static removeAllListeners(): void; + /** + !#en Sets listener's priority with fixed value. + !#zh 设置 FixedPriority 类型监听器的优先级。 + @param listener listener + @param fixedPriority fixedPriority + */ + static setPriority(listener: EventListener, fixedPriority: number): void; + /** + !#en Whether to enable dispatching events + !#zh 启用或禁用事件管理器,禁用后不会分发任何事件。 + @param enabled enabled + */ + static setEnabled(enabled: boolean): void; + /** + !#en Checks whether dispatching events is enabled + !#zh 检测事件管理器是否启用。 + */ + static isEnabled(): boolean; + } + /** !#en The touch event class + !#zh 封装了触摸相关的信息。 */ + export class Touch { + /** + !#en Returns the current touch location in OpenGL coordinates.、 + !#zh 获取当前触点位置。 + */ + getLocation(): Vec2; + /** + !#en Returns X axis location value. + !#zh 获取当前触点 X 轴位置。 + */ + getLocationX(): number; + /** + !#en Returns Y axis location value. + !#zh 获取当前触点 Y 轴位置。 + */ + getLocationY(): number; + /** + !#en Returns the previous touch location in OpenGL coordinates. + !#zh 获取触点在上一次事件时的位置对象,对象包含 x 和 y 属性。 + */ + getPreviousLocation(): Vec2; + /** + !#en Returns the start touch location in OpenGL coordinates. + !#zh 获获取触点落下时的位置对象,对象包含 x 和 y 属性。 + */ + getStartLocation(): Vec2; + /** + !#en Returns the delta distance from the previous touche to the current one in screen coordinates. + !#zh 获取触点距离上一次事件移动的距离对象,对象包含 x 和 y 属性。 + */ + getDelta(): Vec2; + /** + !#en Returns the current touch location in screen coordinates. + !#zh 获取当前事件在游戏窗口内的坐标位置对象,对象包含 x 和 y 属性。 + */ + getLocationInView(): Vec2; + /** + !#en Returns the previous touch location in screen coordinates. + !#zh 获取触点在上一次事件时在游戏窗口中的位置对象,对象包含 x 和 y 属性。 + */ + getPreviousLocationInView(): Vec2; + /** + !#en Returns the start touch location in screen coordinates. + !#zh 获取触点落下时在游戏窗口中的位置对象,对象包含 x 和 y 属性。 + */ + getStartLocationInView(): Vec2; + /** + !#en Returns the id of cc.Touch. + !#zh 触点的标识 ID,可以用来在多点触摸中跟踪触点。 + */ + getID(): number; + /** + !#en Sets information to touch. + !#zh 设置触摸相关的信息。用于监控触摸事件。 + @param id id + @param x x + @param y y + */ + setTouchInfo(id: number, x: number, y: number): void; + } + /** undefined */ + export class Graphics extends _RendererUnderSG { + /** !#en + Current line width. + !#zh + 当前线条宽度 */ + lineWidth: number; + /** !#en + lineJoin determines how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together. + !#zh + lineJoin 用来设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性。 */ + lineJoin: Graphics.LineJoin; + /** !#en + lineCap determines how the end points of every line are drawn. + !#zh + lineCap 指定如何绘制每一条线段末端。 */ + lineCap: Graphics.LineCap; + /** !#en + stroke color + !#zh + 线段颜色 */ + strokeColor: Color; + /** !#en + fill color + !#zh + 填充颜色 */ + fillColor: Color; + /** !#en + Sets the miter limit ratio + !#zh + 设置斜接面限制比例 */ + miterLimit: number; + /** + !#en Move path start point to (x,y). + !#zh 移动路径起点到坐标(x, y) + @param x The x axis of the coordinate for the end point. + @param y The y axis of the coordinate for the end point. + */ + moveTo(x?: number, y?: number): void; + /** + !#en Adds a straight line to the path + !#zh 绘制直线路径 + @param x The x axis of the coordinate for the end point. + @param y The y axis of the coordinate for the end point. + */ + lineTo(x?: number, y?: number): void; + /** + !#en Adds a cubic Bézier curve to the path + !#zh 绘制三次贝赛尔曲线路径 + @param c1x The x axis of the coordinate for the first control point. + @param c1y The y axis of the coordinate for first control point. + @param c2x The x axis of the coordinate for the second control point. + @param c2y The y axis of the coordinate for the second control point. + @param x The x axis of the coordinate for the end point. + @param y The y axis of the coordinate for the end point. + */ + bezierCurveTo(c1x?: number, c1y?: number, c2x?: number, c2y?: number, x?: number, y?: number): void; + /** + !#en Adds a quadratic Bézier curve to the path + !#zh 绘制二次贝赛尔曲线路径 + @param cx The x axis of the coordinate for the control point. + @param cy The y axis of the coordinate for the control point. + @param x The x axis of the coordinate for the end point. + @param y The y axis of the coordinate for the end point. + */ + quadraticCurveTo(cx?: number, cy?: number, x?: number, y?: number): void; + /** + !#en Adds an arc to the path which is centered at (cx, cy) position with radius r starting at startAngle and ending at endAngle going in the given direction by counterclockwise (defaulting to false). + !#zh 绘制圆弧路径。圆弧路径的圆心在 (cx, cy) 位置,半径为 r ,根据 counterclockwise (默认为false)指定的方向从 startAngle 开始绘制,到 endAngle 结束。 + @param cx The x axis of the coordinate for the center point. + @param cy The y axis of the coordinate for the center point. + @param r The arc's radius. + @param startAngle The angle at which the arc starts, measured clockwise from the positive x axis and expressed in radians. + @param endAngle The angle at which the arc ends, measured clockwise from the positive x axis and expressed in radians. + @param counterclockwise An optional Boolean which, if true, causes the arc to be drawn counter-clockwise between the two angles. By default it is drawn clockwise. + */ + arc(cx?: number, cy?: number, r?: number, startAngle?: number, endAngle?: number, counterclockwise?: number): void; + /** + !#en Adds an ellipse to the path. + !#zh 绘制椭圆路径。 + @param cx The x axis of the coordinate for the center point. + @param cy The y axis of the coordinate for the center point. + @param rx The ellipse's x-axis radius. + @param ry The ellipse's y-axis radius. + */ + ellipse(cx?: number, cy?: number, rx?: number, ry?: number): void; + /** + !#en Adds an circle to the path. + !#zh 绘制圆形路径。 + @param cx The x axis of the coordinate for the center point. + @param cy The y axis of the coordinate for the center point. + @param r The circle's radius. + */ + circle(cx?: number, cy?: number, r?: number): void; + /** + !#en Adds an rectangle to the path. + !#zh 绘制矩形路径。 + @param x The x axis of the coordinate for the rectangle starting point. + @param y The y axis of the coordinate for the rectangle starting point. + @param w The rectangle's width. + @param h The rectangle's height. + */ + rect(x?: number, y?: number, w?: number, h?: number): void; + /** + !#en Adds an round corner rectangle to the path. + !#zh 绘制圆角矩形路径。 + @param x The x axis of the coordinate for the rectangle starting point. + @param y The y axis of the coordinate for the rectangle starting point. + @param w The rectangles width. + @param h The rectangle's height. + @param r The radius of the rectangle. + */ + roundRect(x?: number, y?: number, w?: number, h?: number, r?: number): void; + /** + !#en Draws a filled rectangle. + !#zh 绘制填充矩形。 + @param x The x axis of the coordinate for the rectangle starting point. + @param y The y axis of the coordinate for the rectangle starting point. + @param w The rectangle's width. + @param h The rectangle's height. + */ + fillRect(x?: number, y?: number, w?: number, h?: number): void; + /** + !#en Erasing any previously drawn content. + !#zh 擦除之前绘制的所有内容的方法。 + @param clean Whether to clean the graphics inner cache. + */ + clear(clean?: boolean): void; + /** + !#en Causes the point of the pen to move back to the start of the current path. It tries to add a straight line from the current point to the start. + !#zh 将笔点返回到当前路径起始点的。它尝试从当前点到起始点绘制一条直线。 + */ + close(): void; + /** + !#en Strokes the current or given path with the current stroke style. + !#zh 根据当前的画线样式,绘制当前或已经存在的路径。 + */ + stroke(): void; + /** + !#en Fills the current or given path with the current fill style. + !#zh 根据当前的画线样式,填充当前或已经存在的路径。 + */ + fill(): void; + } + /** Loader for resource loading process. It's a singleton object. */ + export class loader extends Pipeline { + /** The asset loader in cc.loader's pipeline, it's by default the first pipe. + It's used to identify an asset's type, and determine how to download it. */ + static assetLoader: any; + /** The downloader in cc.loader's pipeline, it's by default the second pipe. + It's used to download files with several handlers: pure text, image, script, audio, font, uuid. + You can add your own download function with addDownloadHandlers */ + static downloader: any; + /** The downloader in cc.loader's pipeline, it's by default the third pipe. + It's used to parse downloaded content with several handlers: JSON, image, plist, fnt, uuid. + You can add your own download function with addLoadHandlers */ + static loader: any; + /** + Gets a new XMLHttpRequest instance. + */ + static getXMLHttpRequest(): XMLHttpRequest; + /** + Add custom supported types handler or modify existing type handler for download process. + @param extMap Custom supported types with corresponded handler + + @example + ```js + cc.loader.addDownloadHandlers({ + // This will match all url with `.scene` extension or all url with `scene` type + 'scene' : function (url, callback) {} + }); + ``` + */ + static addDownloadHandlers(extMap: any): void; + /** + Add custom supported types handler or modify existing type handler for load process. + @param extMap Custom supported types with corresponded handler + + @example + ```js + cc.loader.addLoadHandlers({ + // This will match all url with `.scene` extension or all url with `scene` type + 'scene' : function (url, callback) {} + }); + ``` + */ + static addLoadHandlers(extMap: any): void; + /** + Load resources with a progression callback and a complete callback. + The progression callback is the same as Pipeline's {{#crossLink "LoadingItems/onProgress:method"}}onProgress{{/crossLink}} + The complete callback is almost the same as Pipeline's {{#crossLink "LoadingItems/onComplete:method"}}onComplete{{/crossLink}} + The only difference is when user pass a single url as resources, the complete callback will set its result directly as the second parameter. + @param resources Url list in an array + @param progressCallback Callback invoked when progression change + @param completeCallback Callback invoked when all resources loaded + + @example + ```js + cc.loader.load('a.png', function (err, tex) { + cc.log('Result should be a texture: ' + (tex instanceof cc.Texture2D)); + }); + + cc.loader.load('http://example.com/a.png', function (err, tex) { + cc.log('Should load a texture from external url: ' + (tex instanceof cc.Texture2D)); + }); + + cc.loader.load({url: 'http://example.com/getImageREST?file=a.png', type: 'png'}, function (err, tex) { + cc.log('Should load a texture from RESTful API by specify the type: ' + (tex instanceof cc.Texture2D)); + }); + + cc.loader.load(['a.png', 'b.json'], function (errors, results) { + if (errors) { + for (var i = 0; i < errors.length; i++) { + cc.log('Error url [' + errors[i] + ']: ' + results.getError(errors[i])); + } + } + var aTex = results.getContent('a.png'); + var bJsonObj = results.getContent('b.json'); + }); + ``` + */ + static load(resources: string|string[]|{uuid?: string, url?: string, type?: string}, completeCallback?: Function): void; + static load(resources: string|string[]|{uuid?: string, url?: string, type?: string}, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: Function|null): void; + /** + Load resources from the "resources" folder inside the "assets" folder of your project.
+
+ Note: All asset URLs in Creator use forward slashes, URLs using backslashes will not work. + @param url Url of the target resource. + The url is relative to the "resources" folder, extensions must be omitted. + @param type Only asset of type will be loaded if this argument is supplied. + @param progressCallback Callback invoked when progression change. + @param completeCallback Callback invoked when the resource loaded. + + @example + ```js + // load the prefab (project/assets/resources/misc/character/cocos) from resources folder + cc.loader.loadRes('misc/character/cocos', function (err, prefab) { + if (err) { + cc.error(err.message || err); + return; + } + cc.log('Result should be a prefab: ' + (prefab instanceof cc.Prefab)); + }); + + // load the sprite frame of (project/assets/resources/imgs/cocos.png) from resources folder + cc.loader.loadRes('imgs/cocos', cc.SpriteFrame, function (err, spriteFrame) { + if (err) { + cc.error(err.message || err); + return; + } + cc.log('Result should be a sprite frame: ' + (spriteFrame instanceof cc.SpriteFrame)); + }); + ``` + */ + static loadRes(url: string, type: typeof cc.Asset, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any) => void)|null): void; + static loadRes(url: string, type: typeof cc.Asset, completeCallback: (error: Error, resource: any) => void): void; + static loadRes(url: string, type: typeof cc.Asset): void; + static loadRes(url: string, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any) => void)|null): void; + static loadRes(url: string, completeCallback: (error: Error, resource: any) => void): void; + static loadRes(url: string): void; + /** + This method is like {{#crossLink "loader/loadRes:method"}}{{/crossLink}} except that it accepts array of url. + @param urls Array of URLs of the target resource. + The url is relative to the "resources" folder, extensions must be omitted. + @param type Only asset of type will be loaded if this argument is supplied. + @param progressCallback Callback invoked when progression change. + @param completeCallback A callback which is called when all assets have been loaded, or an error occurs. + + @example + ```js + // load the SpriteFrames from resources folder + var spriteFrames; + var urls = ['misc/characters/character_01', 'misc/weapons/weapons_01']; + cc.loader.loadResArray(urls, cc.SpriteFrame, function (err, assets) { + if (err) { + cc.error(err); + return; + } + spriteFrames = assets; + // ... + }); + ``` + */ + static loadResArray(url: string[], type: typeof cc.Asset, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[]) => void)|null): void; + static loadResArray(url: string[], type: typeof cc.Asset, completeCallback: (error: Error, resource: any[]) => void): void; + static loadResArray(url: string[], type: typeof cc.Asset): void; + static loadResArray(url: string[], progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[]) => void)|null): void; + static loadResArray(url: string[], completeCallback: (error: Error, resource: any[]) => void): void; + static loadResArray(url: string[]): void; + /** + Load all assets in a folder inside the "assets/resources" folder of your project.
+
+ Note: All asset URLs in Creator use forward slashes, URLs using backslashes will not work. + @param url Url of the target folder. + The url is relative to the "resources" folder, extensions must be omitted. + @param type Only asset of type will be loaded if this argument is supplied. + @param progressCallback Callback invoked when progression change. + @param completeCallback A callback which is called when all assets have been loaded, or an error occurs. + + @example + ```js + // load the texture (resources/imgs/cocos.png) and the corresponding sprite frame + cc.loader.loadResDir('imgs/cocos', function (err, assets) { + if (err) { + cc.error(err); + return; + } + var texture = assets[0]; + var spriteFrame = assets[1]; + }); + + // load all textures in "resources/imgs/" + cc.loader.loadResDir('imgs', cc.Texture2D, function (err, textures) { + var texture1 = textures[0]; + var texture2 = textures[1]; + }); + + // load all JSONs in "resources/data/" + cc.loader.loadResDir('data', function (err, objects, urls) { + var data = objects[0]; + var url = urls[0]; + }); + ``` + */ + static loadResDir(url: string, type: typeof cc.Asset, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[], urls: string[]) => void)|null): void; + static loadResDir(url: string, type: typeof cc.Asset, completeCallback: (error: Error, resource: any[], urls: string[]) => void): void; + static loadResDir(url: string, type: typeof cc.Asset): void; + static loadResDir(url: string, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[], urls: string[]) => void)|null): void; + static loadResDir(url: string, completeCallback: (error: Error, resource: any[], urls: string[]) => void): void; + static loadResDir(url: string): void; + /** + Get resource data by id.
+ When you load resources with {{#crossLink "loader/load:method"}}{{/crossLink}} or {{#crossLink "loader/loadRes:method"}}{{/crossLink}}, + the url will be the unique identity of the resource. + After loaded, you can acquire them by passing the url to this API. + @param url url + @param type Only asset of type will be returned if this argument is supplied. + */ + static getRes(url: string, type?: Function): any; + /** + !#en Get all resource dependencies of the requested asset in an array, including itself. + The owner parameter accept the following types: 1. The asset itself; 2. The resource url; 3. The asset's uuid.
+ The returned array stores the dependencies with their uuids, after retrieve dependencies, + you can release them, access dependent assets by passing the uuid to {{#crossLink "loader/getRes:method"}}{{/crossLink}}, or other stuffs you want.
+ For release all dependencies of an asset, please refer to {{#crossLink "loader/release:method"}}{{/crossLink}} + Here is some examples: + !#zh 获取一个指定资源的所有依赖资源,包含它自身,并保存在数组中返回。owner 参数接收以下几种类型:1. 资源 asset 对象;2. 资源目录下的 url;3. 资源的 uuid。
+ 返回的数组将仅保存依赖资源的 uuid,获取这些 uuid 后,你可以从 loader 释放这些资源;通过 {{#crossLink "loader/getRes:method"}}{{/crossLink}} 获取某个资源或者进行其他你需要的操作。
+ 想要释放一个资源及其依赖资源,可以参考 {{#crossLink "loader/release:method"}}{{/crossLink}}。下面是一些示例代码: + @param owner The owner asset or the resource url or the asset's uuid + + @example + ```js + // Release all dependencies of a loaded prefab + var deps = cc.loader.getDependsRecursively(prefab); + cc.loader.release(deps); + // Retrieve all dependent textures + var deps = cc.loader.getDependsRecursively('prefabs/sample'); + var textures = []; + for (var i = 0; i < deps.length; ++i) { + var item = cc.loader.getRes(deps[i]); + if (item instanceof cc.Texture2D) { + textures.push(item); + } + } + ``` + */ + static getDependsRecursively(owner: Asset|RawAsset|string): any[]; + /** + !#en + Release the content of an asset or an array of assets by uuid. + Start from v1.3, this method will not only remove the cache of the asset in loader, but also clean up its content. + For example, if you release a texture, the texture asset and its gl texture data will be freed up. + In complexe project, you can use this function with {{#crossLink "loader/getDependsRecursively:method"}}{{/crossLink}} to free up memory in critical circumstances. + Notice, this method may cause the texture to be unusable, if there are still other nodes use the same texture, they may turn to black and report gl errors. + If you only want to remove the cache of an asset, please use {{#crossLink "pipeline/removeItem:method"}}{{/crossLink}} + !#zh + 通过 id(通常是资源 url)来释放一个资源或者一个资源数组。 + 从 v1.3 开始,这个方法不仅会从 loader 中删除资源的缓存引用,还会清理它的资源内容。 + 比如说,当你释放一个 texture 资源,这个 texture 和它的 gl 贴图数据都会被释放。 + 在复杂项目中,我们建议你结合 {{#crossLink "loader/getDependsRecursively:method"}}{{/crossLink}} 来使用,便于在设备内存告急的情况下更快地释放不再需要的资源的内存。 + 注意,这个函数可能会导致资源贴图或资源所依赖的贴图不可用,如果场景中存在节点仍然依赖同样的贴图,它们可能会变黑并报 GL 错误。 + 如果你只想删除一个资源的缓存引用,请使用 {{#crossLink "pipeline/removeItem:method"}}{{/crossLink}} + @param asset asset + + @example + ```js + // Release a texture which is no longer need + cc.loader.release(texture); + // Release all dependencies of a loaded prefab + var deps = cc.loader.getDependsRecursively('prefabs/sample'); + cc.loader.release(deps); + // If there is no instance of this prefab in the scene, the prefab and its dependencies like textures, sprite frames, etc, will be freed up. + // If you have some other nodes share a texture in this prefab, you can skip it in two ways: + // 1. Forbid auto release a texture before release + cc.loader.setAutoRelease(texture2d, false); + // 2. Remove it from the dependencies array + var deps = cc.loader.getDependsRecursively('prefabs/sample'); + var index = deps.indexOf(texture2d._uuid); + if (index !== -1) + deps.splice(index, 1); + cc.loader.release(deps); + ``` + */ + static release(asset: Asset|RawAsset|string|any[]): void; + /** + !#en Release the asset by its object. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations. + !#zh 通过资源对象自身来释放资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}} + @param asset asset + */ + static releaseAsset(asset: Asset): void; + /** + !#en Release the asset loaded by {{#crossLink "loader/loadRes:method"}}{{/crossLink}}. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations. + !#zh 释放通过 {{#crossLink "loader/loadRes:method"}}{{/crossLink}} 加载的资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}} + @param url url + @param type Only asset of type will be released if this argument is supplied. + */ + static releaseRes(url: string, type?: Function): void; + /** + !#en Release the all assets loaded by {{#crossLink "loader/loadResDir:method"}}{{/crossLink}}. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations. + !#zh 释放通过 {{#crossLink "loader/loadResDir:method"}}{{/crossLink}} 加载的资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}} + @param url url + @param type Only asset of type will be released if this argument is supplied. + */ + static releaseResDir(url: string, type?: Function): void; + /** + !#en Resource all assets. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations. + !#zh 释放所有资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}} + */ + static releaseAll(): void; + /** + !#en + Indicates whether to release the asset when loading a new scene.
+ By default, when loading a new scene, all assets in the previous scene will be released or preserved + according to whether the previous scene checked the "Auto Release Assets" option. + On the other hand, assets dynamically loaded by using `cc.loader.loadRes` or `cc.loader.loadResDir` + will not be affected by that option, remain not released by default.
+ Use this API to change the default behavior on a single asset, to force preserve or release specified asset when scene switching.
+
+ See: {{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}}, {{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}} + !#zh + 设置当场景切换时是否自动释放资源。
+ 默认情况下,当加载新场景时,旧场景的资源根据旧场景是否勾选“Auto Release Assets”,将会被释放或者保留。 + 而使用 `cc.loader.loadRes` 或 `cc.loader.loadResDir` 动态加载的资源,则不受场景设置的影响,默认不自动释放。
+ 使用这个 API 可以在单个资源上改变这个默认行为,强制在切换场景时保留或者释放指定资源。
+
+ 参考:{{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}},{{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}} + @param assetOrUrlOrUuid asset object or the raw asset's url or uuid + @param autoRelease indicates whether should release automatically + + @example + ```js + // auto release the texture event if "Auto Release Assets" disabled in current scene + cc.loader.setAutoRelease(texture2d, true); + // don't release the texture even if "Auto Release Assets" enabled in current scene + cc.loader.setAutoRelease(texture2d, false); + // first parameter can be url + cc.loader.setAutoRelease(audioUrl, false); + ``` + */ + static setAutoRelease(assetOrUrlOrUuid: Asset|string, autoRelease: boolean): void; + /** + !#en + Indicates whether to release the asset and its referenced other assets when loading a new scene.
+ By default, when loading a new scene, all assets in the previous scene will be released or preserved + according to whether the previous scene checked the "Auto Release Assets" option. + On the other hand, assets dynamically loaded by using `cc.loader.loadRes` or `cc.loader.loadResDir` + will not be affected by that option, remain not released by default.
+ Use this API to change the default behavior on the specified asset and its recursively referenced assets, to force preserve or release specified asset when scene switching.
+
+ See: {{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}}, {{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}} + !#zh + 设置当场景切换时是否自动释放资源及资源引用的其它资源。
+ 默认情况下,当加载新场景时,旧场景的资源根据旧场景是否勾选“Auto Release Assets”,将会被释放或者保留。 + 而使用 `cc.loader.loadRes` 或 `cc.loader.loadResDir` 动态加载的资源,则不受场景设置的影响,默认不自动释放。
+ 使用这个 API 可以在指定资源及资源递归引用到的所有资源上改变这个默认行为,强制在切换场景时保留或者释放指定资源。
+
+ 参考:{{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}},{{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}} + @param assetOrUrlOrUuid asset object or the raw asset's url or uuid + @param autoRelease indicates whether should release automatically + + @example + ```js + // auto release the SpriteFrame and its Texture event if "Auto Release Assets" disabled in current scene + cc.loader.setAutoReleaseRecursively(spriteFrame, true); + // don't release the SpriteFrame and its Texture even if "Auto Release Assets" enabled in current scene + cc.loader.setAutoReleaseRecursively(spriteFrame, false); + // don't release the Prefab and all the referenced assets + cc.loader.setAutoReleaseRecursively(prefab, false); + ``` + */ + static setAutoReleaseRecursively(assetOrUrlOrUuid: Asset|string, autoRelease: boolean): void; + /** + !#en + Returns whether the asset is configured as auto released, despite how "Auto Release Assets" property is set on scene asset.
+
+ See: {{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}}, {{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}} + + !#zh + 返回指定的资源是否有被设置为自动释放,不论场景的“Auto Release Assets”如何设置。
+
+ 参考:{{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}},{{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}} + @param assetOrUrl asset object or the raw asset's url + */ + static isAutoRelease(assetOrUrl: Asset|string): boolean; + } + /** !#en + LoadingItems is the queue of items which can flow them into the loading pipeline.
+ Please don't construct it directly, use {{#crossLink "LoadingItems.create"}}cc.LoadingItems.create{{/crossLink}} instead, because we use an internal pool to recycle the queues.
+ It hold a map of items, each entry in the map is a url to object key value pair.
+ Each item always contains the following property:
+ - id: The identification of the item, usually it's identical to url
+ - url: The url
+ - type: The type, it's the extension name of the url by default, could be specified manually too.
+ - error: The error happened in pipeline will be stored in this property.
+ - content: The content processed by the pipeline, the final result will also be stored in this property.
+ - complete: The flag indicate whether the item is completed by the pipeline.
+ - states: An object stores the states of each pipe the item go through, the state can be: Pipeline.ItemState.WORKING | Pipeline.ItemState.ERROR | Pipeline.ItemState.COMPLETE
+
+ Item can hold other custom properties.
+ Each LoadingItems object will be destroyed for recycle after onComplete callback
+ So please don't hold its reference for later usage, you can copy properties in it though. + !#zh + LoadingItems 是一个加载对象队列,可以用来输送加载对象到加载管线中。
+ 请不要直接使用 new 构造这个类的对象,你可以使用 {{#crossLink "LoadingItems.create"}}cc.LoadingItems.create{{/crossLink}} 来创建一个新的加载队列,这样可以允许我们的内部对象池回收并重利用加载队列。 + 它有一个 map 属性用来存放加载项,在 map 对象中已 url 为 key 值。
+ 每个对象都会包含下列属性:
+ - id:该对象的标识,通常与 url 相同。
+ - url:路径
+ - type: 类型,它这是默认的 URL 的扩展名,可以手动指定赋值。
+ - error:pipeline 中发生的错误将被保存在这个属性中。
+ - content: pipeline 中处理的临时结果,最终的结果也将被存储在这个属性中。
+ - complete:该标志表明该对象是否通过 pipeline 完成。
+ - states:该对象存储每个管道中对象经历的状态,状态可以是 Pipeline.ItemState.WORKING | Pipeline.ItemState.ERROR | Pipeline.ItemState.COMPLETE
+
+ 对象可容纳其他自定义属性。
+ 每个 LoadingItems 对象都会在 onComplete 回调之后被销毁,所以请不要持有它的引用并在结束回调之后依赖它的内容执行任何逻辑,有这种需求的话你可以提前复制它的内容。 */ + export class LoadingItems extends CallbacksInvoker { + /** + !#en This is a callback which will be invoked while an item flow out the pipeline. + You can pass the callback function in LoadingItems.create or set it later. + !#zh 这个回调函数将在 item 加载结束后被调用。你可以在构造时传递这个回调函数或者是在构造之后直接设置。 + @param completedCount The number of the items that are already completed. + @param totalCount The total number of the items. + @param item The latest item which flow out the pipeline. + + @example + ```js + loadingItems.onProgress = function (completedCount, totalCount, item) { + var progress = (100 * completedCount / totalCount).toFixed(2); + cc.log(progress + '%'); + } + ``` + */ + onProgress(completedCount: number, totalCount: number, item: any): void; + /** + !#en This is a callback which will be invoked while all items is completed, + You can pass the callback function in LoadingItems.create or set it later. + !#zh 该函数将在加载队列全部完成时被调用。你可以在构造时传递这个回调函数或者是在构造之后直接设置。 + @param errors All errored urls will be stored in this array, if no error happened, then it will be null + @param items All items. + + @example + ```js + loadingItems.onComplete = function (errors, items) { + if (error) + cc.log('Completed with ' + errors.length + ' errors'); + else + cc.log('Completed ' + items.totalCount + ' items'); + } + ``` + */ + onComplete(errors: any[], items: LoadingItems): void; + /** !#en The map of all items. + !#zh 存储所有加载项的对象。 */ + map: any; + /** !#en The map of completed items. + !#zh 存储已经完成的加载项。 */ + completed: any; + /** !#en Total count of all items. + !#zh 所有加载项的总数。 */ + totalCount: number; + /** !#en Total count of completed items. + !#zh 所有完成加载项的总数。 */ + completedCount: number; + /** !#en Activated or not. + !#zh 是否启用。 */ + active: boolean; + /** + !#en The constructor function of LoadingItems, this will use recycled LoadingItems in the internal pool if possible. + You can pass onProgress and onComplete callbacks to visualize the loading process. + !#zh LoadingItems 的构造函数,这种构造方式会重用内部对象缓冲池中的 LoadingItems 队列,以尽量避免对象创建。 + 你可以传递 onProgress 和 onComplete 回调函数来获知加载进度信息。 + @param pipeline The pipeline to process the queue. + @param urlList The items array. + @param onProgress The progression callback, refer to {{#crossLink "LoadingItems.onProgress"}}{{/crossLink}} + @param onComplete The completion callback, refer to {{#crossLink "LoadingItems.onComplete"}}{{/crossLink}} + + @example + ```js + cc.LoadingItems.create(cc.loader, ['a.png', 'b.plist'], function (completedCount, totalCount, item) { + var progress = (100 * completedCount / totalCount).toFixed(2); + cc.log(progress + '%'); + }, function (errors, items) { + if (errors) { + for (var i = 0; i < errors.length; ++i) { + cc.log('Error url: ' + errors[i] + ', error: ' + items.getError(errors[i])); + } + } + else { + var result_a = items.getContent('a.png'); + // ... + } + }) + ``` + */ + static create(pipeline: Pipeline, urlList: any[], onProgress: Function, onComplete: Function): LoadingItems; + /** + !#en Retrieve the LoadingItems queue object for an item. + !#zh 通过 item 对象获取它的 LoadingItems 队列。 + @param item The item to query + */ + static getQueue(item: any): LoadingItems; + /** + !#en Complete an item in the LoadingItems queue, please do not call this method unless you know what's happening. + !#zh 通知 LoadingItems 队列一个 item 对象已完成,请不要调用这个函数,除非你知道自己在做什么。 + @param item The item which has completed + */ + static itemComplete(item: any): void; + /** + !#en Add urls to the LoadingItems queue. + !#zh 向一个 LoadingItems 队列添加加载项。 + @param urlList The url list to be appended, the url can be object or string + */ + append(urlList: any[]): any[]; + /** + !#en Complete a LoadingItems queue, please do not call this method unless you know what's happening. + !#zh 完成一个 LoadingItems 队列,请不要调用这个函数,除非你知道自己在做什么。 + */ + allComplete(): void; + /** + !#en Check whether all items are completed. + !#zh 检查是否所有加载项都已经完成。 + */ + isCompleted(): boolean; + /** + !#en Check whether an item is completed. + !#zh 通过 id 检查指定加载项是否已经加载完成。 + @param id The item's id. + */ + isItemCompleted(id: string): boolean; + /** + !#en Check whether an item exists. + !#zh 通过 id 检查加载项是否存在。 + @param id The item's id. + */ + exists(id: string): boolean; + /** + !#en Returns the content of an internal item. + !#zh 通过 id 获取指定对象的内容。 + @param id The item's id. + */ + getContent(id: string): any; + /** + !#en Returns the error of an internal item. + !#zh 通过 id 获取指定对象的错误信息。 + @param id The item's id. + */ + getError(id: string): any; + /** + !#en Add a listener for an item, the callback will be invoked when the item is completed. + !#zh 监听加载项(通过 key 指定)的完成事件。 + @param key key + @param callback can be null + @param target can be null + */ + addListener(key: string, callback: Function, target: any): boolean; + /** + !#en + Check if the specified key has any registered callback.
+ If a callback is also specified, it will only return true if the callback is registered. + !#zh + 检查指定的加载项是否有完成事件监听器。
+ 如果同时还指定了一个回调方法,并且回调有注册,它只会返回 true。 + @param key key + @param callback callback + @param target target + */ + hasListener(key: string, callback?: Function, target?: any): boolean; + /** + !#en + Removes a listener.
+ It will only remove when key, callback, target all match correctly. + !#zh + 移除指定加载项已经注册的完成事件监听器。
+ 只会删除 key, callback, target 均匹配的监听器。 + @param key key + @param callback callback + @param target target + */ + remove(key: string, callback: Function, target: any): boolean; + /** + !#en + Removes all callbacks registered in a certain event + type or all callbacks registered with a certain target. + !#zh 删除指定目标的所有完成事件监听器。 + @param key The event key to be removed or the target to be removed + */ + removeAllListeners(key: string|any): void; + /** + !#en Complete an item in the LoadingItems queue, please do not call this method unless you know what's happening. + !#zh 通知 LoadingItems 队列一个 item 对象已完成,请不要调用这个函数,除非你知道自己在做什么。 + @param id The item url + */ + itemComplete(id: string): void; + /** + !#en Destroy the LoadingItems queue, the queue object won't be garbage collected, it will be recycled, so every after destroy is not reliable. + !#zh 销毁一个 LoadingItems 队列,这个队列对象会被内部缓冲池回收,所以销毁后的所有内部信息都是不可依赖的。 + */ + destroy(): void; + } + /** !#en + A pipeline describes a sequence of manipulations, each manipulation is called a pipe.
+ It's designed for loading process. so items should be urls, and the url will be the identity of each item during the process.
+ A list of items can flow in the pipeline and it will output the results of all pipes.
+ They flow in the pipeline like water in tubes, they go through pipe by pipe separately.
+ Finally all items will flow out the pipeline and the process is finished. + + !#zh + pipeline 描述了一系列的操作,每个操作都被称为 pipe。
+ 它被设计来做加载过程的流程管理。所以 item 应该是 url,并且该 url 将是在处理中的每个 item 的身份标识。
+ 一个 item 列表可以在 pipeline 中流动,它将输出加载项经过所有 pipe 之后的结果。
+ 它们穿过 pipeline 就像水在管子里流动,将会按顺序流过每个 pipe。
+ 最后当所有加载项都流出 pipeline 时,整个加载流程就结束了。 */ + export class Pipeline { + /** + !#en + Constructor, pass an array of pipes to construct a new Pipeline, + the pipes will be chained in the given order.
+ A pipe is an object which must contain an `id` in string and a `handle` function, + the id must be unique in the pipeline.
+ It can also include `async` property to identify whether it's an asynchronous process. + !#zh + 构造函数,通过一系列的 pipe 来构造一个新的 pipeline,pipes 将会在给定的顺序中被锁定。
+ 一个 pipe 就是一个对象,它包含了字符串类型的 ‘id’ 和 ‘handle’ 函数,在 pipeline 中 id 必须是唯一的。
+ 它还可以包括 ‘async’ 属性以确定它是否是一个异步过程。 + @param pipes pipes + + @example + ```js + var pipeline = new Pipeline([ + { + id: 'Downloader', + handle: function (item, callback) {}, + async: true + }, + {id: 'Parser', handle: function (item) {}, async: false} + ]); + ``` + */ + constructor(pipes: any[]); + /** + !#en + Insert a new pipe at the given index of the pipeline.
+ A pipe must contain an `id` in string and a `handle` function, the id must be unique in the pipeline. + !#zh + 在给定的索引位置插入一个新的 pipe。
+ 一个 pipe 必须包含一个字符串类型的 ‘id’ 和 ‘handle’ 函数,该 id 在 pipeline 必须是唯一标识。 + @param pipe The pipe to be inserted + @param index The index to insert + */ + insertPipe(pipe: any, index: number): void; + /** + !en + Insert a pipe to the end of an existing pipe. The existing pipe must be a valid pipe in the pipeline. + !zh + 在当前 pipeline 的一个已知 pipe 后面插入一个新的 pipe。 + @param refPipe An existing pipe in the pipeline. + @param newPipe The pipe to be inserted. + */ + insertPipeAfter(refPipe: any, newPipe: any): void; + /** + !#en + Add a new pipe at the end of the pipeline.
+ A pipe must contain an `id` in string and a `handle` function, the id must be unique in the pipeline. + !#zh + 添加一个新的 pipe 到 pipeline 尾部。
+ 该 pipe 必须包含一个字符串类型 ‘id’ 和 ‘handle’ 函数,该 id 在 pipeline 必须是唯一标识。 + @param pipe The pipe to be appended + */ + appendPipe(pipe: any): void; + /** + !#en + Let new items flow into the pipeline.
+ Each item can be a simple url string or an object, + if it's an object, it must contain `id` property.
+ You can specify its type by `type` property, by default, the type is the extension name in url.
+ By adding a `skips` property including pipe ids, you can skip these pipe.
+ The object can contain any supplementary property as you want.
+ !#zh + 让新的 item 流入 pipeline 中。
+ 这里的每个 item 可以是一个简单字符串类型的 url 或者是一个对象, + 如果它是一个对象的话,他必须要包含 ‘id’ 属性。
+ 你也可以指定它的 ‘type’ 属性类型,默认情况下,该类型是 ‘url’ 的后缀名。
+ 也通过添加一个 包含 ‘skips’ 属性的 item 对象,你就可以跳过 skips 中包含的 pipe。
+ 该对象可以包含任何附加属性。 + @param items items + + @example + ```js + pipeline.flowIn([ + 'res/Background.png', + { + id: 'res/scene.json', + type: 'scene', + name: 'scene', + skips: ['Downloader'] + } + ]); + ``` + */ + flowIn(items: any[]): void; + /** + !#en + Let new items flow into the pipeline and give a callback when the list of items are all completed.
+ This is for loading dependencies for an existing item in flow, usually used in a pipe logic.
+ For example, we have a loader for scene configuration file in JSON, the scene will only be fully loaded
+ after all its dependencies are loaded, then you will need to use function to flow in all dependencies
+ found in the configuration file, and finish the loader pipe only after all dependencies are loaded (in the callback). + !#zh + 让新 items 流入 pipeline 并且当 item 列表完成时进行回调函数。
+ 这个 API 的使用通常是为了加载依赖项。
+ 例如:
+ 我们需要加载一个场景配置的 JSON 文件,该场景会将所有的依赖项全部都加载完毕以后,进行回调表示加载完毕。 + @param urlList urlList + @param callback callback + */ + flowInDeps(urlList: any[], callback: Function): any[]; + /** + !#en + Copy the item states from one source item to all destination items.
+ It's quite useful when a pipe generate new items from one source item,
+ then you should flowIn these generated items into pipeline,
+ but you probably want them to skip all pipes the source item already go through,
+ you can achieve it with this API.
+
+ For example, an unzip pipe will generate more items, but you won't want them to pass unzip or download pipe again. + !#zh + 从一个源 item 向所有目标 item 复制它的 pipe 状态,用于避免重复通过部分 pipe。
+ 当一个源 item 生成了一系列新的 items 时很有用,
+ 你希望让这些新的依赖项进入 pipeline,但是又不希望它们通过源 item 已经经过的 pipe,
+ 但是你可能希望他们源 item 已经通过并跳过所有 pipes,
+ 这个时候就可以使用这个 API。 + @param srcItem The source item + @param dstItems A single destination item or an array of destination items + */ + copyItemStates(srcItem: any, dstItems: any[]|any): void; + /** + !#en Returns whether the pipeline is flowing (contains item) currently. + !#zh 获取 pipeline 当前是否正在处理中。 + */ + isFlowing(): boolean; + /** + !#en Returns all items in pipeline. Returns null, please use API of Loader or LoadingItems. + !#zh 获取 pipeline 中的所有 items。返回 null,请使用 Loader / LoadingItems API。 + */ + getItems(): LoadingItems; + /** + !#en Returns an item in pipeline. + !#zh 根据 id 获取一个 item + @param id The id of the item + */ + getItem(id: any): any; + /** + !#en Removes an completed item in pipeline. + It will only remove the cache in the pipeline or loader, its dependencies won't be released. + cc.loader provided another method to completely cleanup the resource and its dependencies, + please refer to {{#crossLink "loader/release:method"}}cc.loader.release{{/crossLink}} + !#zh 移除指定的已完成 item。 + 这将仅仅从 pipeline 或者 loader 中删除其缓存,并不会释放它所依赖的资源。 + cc.loader 中提供了另一种删除资源及其依赖的清理方法,请参考 {{#crossLink "loader/release:method"}}cc.loader.release{{/crossLink}} + @param id The id of the item + */ + removeItem(id: any): boolean; + /** + !#en Clear the current pipeline, this function will clean up the items. + !#zh 清空当前 pipeline,该函数将清理 items。 + */ + clear(): void; + } + /** undefined */ + export class WorldManifold { + /** !#en + world contact point (point of intersection) + !#zh + 碰撞点集合 */ + points: [Vec2]; + /** !#en + world vector pointing from A to B + !#zh + 世界坐标系下由 A 指向 B 的向量 */ + normal: Vec2; + } + /** !#en + A manifold point is a contact point belonging to a contact manifold. + It holds details related to the geometry and dynamics of the contact points. + Note: the impulses are used for internal caching and may not + provide reliable contact forces, especially for high speed collisions. + !#zh + ManifoldPoint 是接触信息中的接触点信息。它拥有关于几何和接触点的详细信息。 + 注意:信息中的冲量用于系统内部缓存,提供的接触力可能不是很准确,特别是高速移动中的碰撞信息。 */ + export class ManifoldPoint { + /** !#en + The local point usage depends on the manifold type: + -e_circles: the local center of circleB + -e_faceA: the local center of circleB or the clip point of polygonB + -e_faceB: the clip point of polygonA + !#zh + 本地坐标点的用途取决于 manifold 的类型 + - e_circles: circleB 的本地中心点 + - e_faceA: circleB 的本地中心点 或者是 polygonB 的截取点 + - e_faceB: polygonB 的截取点 */ + localPoint: Vec2; + /** !#en + Normal impulse. + !#zh + 法线冲量。 */ + normalImpulse: number; + /** !#en + Tangent impulse. + !#zh + 切线冲量。 */ + tangentImpulse: number; + } + /** undefined */ + export class Manifold { + /** !#en + Manifold type : 0: e_circles, 1: e_faceA, 2: e_faceB + !#zh + Manifold 类型 : 0: e_circles, 1: e_faceA, 2: e_faceB */ + type: number; + /** !#en + The local point usage depends on the manifold type: + -e_circles: the local center of circleA + -e_faceA: the center of faceA + -e_faceB: the center of faceB + !#zh + 用途取决于 manifold 类型 + -e_circles: circleA 的本地中心点 + -e_faceA: faceA 的本地中心点 + -e_faceB: faceB 的本地中心点 */ + localPoint: Vec2; + /** !#en + -e_circles: not used + -e_faceA: the normal on polygonA + -e_faceB: the normal on polygonB + !#zh + -e_circles: 没被使用到 + -e_faceA: polygonA 的法向量 + -e_faceB: polygonB 的法向量 */ + localNormal: Vec2; + /** !#en + the points of contact. + !#zh + 接触点信息。 */ + points: [ManifoldPoint]; + } + /** !#en + Contact impulses for reporting. + !#zh + 用于返回给回调的接触冲量。 */ + export class PhysicsImpulse { + /** !#en + Normal impulses. + !#zh + 法线方向的冲量 */ + normalImpulses: void; + /** !#en + Tangent impulses + !#zh + 切线方向的冲量 */ + tangentImpulses: void; + } + /** !#en + PhysicsContact will be generated during begin and end collision as a parameter of the collision callback. + Note that contacts will be reused for speed up cpu time, so do not cache anything in the contact. + !#zh + 物理接触会在开始和结束碰撞之间生成,并作为参数传入到碰撞回调函数中。 + 注意:传入的物理接触会被系统进行重用,所以不要在使用中缓存里面的任何信息。 */ + export class PhysicsContact { + /** + !#en + Get the world manifold. + !#zh + 获取世界坐标系下的碰撞信息。 + */ + getWorldManifold(): WorldManifold; + /** + !#en + Get the manifold. + !#zh + 获取世界坐标系下的碰撞信息。 + */ + getManifold(): Manifold; + /** + !#en + Get the impulses. + Note: PhysicsImpulse can only used in onPostSolve callback. + !#zh + 获取冲量信息 + 注意:这个信息只有在 onPostSolve 回调中才能获取到 + */ + getImpulse(): PhysicsImpulse; + colliderA: Collider; + colliderB: Collider; + /** !#en + If set disabled to true, the contact will be ignored until contact end. + If you just want to disabled contact for current time step or sub-step, please use disabledOnce. + !#zh + 如果 disabled 被设置为 true,那么直到接触结束此接触都将被忽略。 + 如果只是希望在当前时间步或子步中忽略此接触,请使用 disabledOnce 。 */ + disabled: boolean; + /** !#en + Disabled contact for current time step or sub-step. + !#zh + 在当前时间步或子步中忽略此接触。 */ + disabledOnce: boolean; + /** + !#en + Is this contact touching? + !#zh + 返回碰撞体是否已经接触到。 + */ + isTouching(): boolean; + /** + !#en + Set the desired tangent speed for a conveyor belt behavior. + !#zh + 为传送带设置期望的切线速度 + @param tangentSpeed tangentSpeed + */ + setTangentSpeed(tangentSpeed: number): void; + /** + !#en + Get the desired tangent speed. + !#zh + 获取切线速度 + */ + getTangentSpeed(): number; + /** + !#en + Override the default friction mixture. You can call this in onPreSolve callback. + !#zh + 覆盖默认的摩擦力系数。你可以在 onPreSolve 回调中调用此函数。 + @param friction friction + */ + setFriction(friction: number): void; + /** + !#en + Get the friction. + !#zh + 获取当前摩擦力系数 + */ + getFriction(): number; + /** + !#en + Reset the friction mixture to the default value. + !#zh + 重置摩擦力系数到默认值 + */ + resetFriction(): void; + /** + !#en + Override the default restitution mixture. You can call this in onPreSolve callback. + !#zh + 覆盖默认的恢复系数。你可以在 onPreSolve 回调中调用此函数。 + @param restitution restitution + */ + setRestitution(restitution: number): void; + /** + !#en + Get the restitution. + !#zh + 获取当前恢复系数 + */ + getRestitution(): number; + /** + !#en + Reset the restitution mixture to the default value. + !#zh + 重置恢复系数到默认值 + */ + resetRestitution(): void; + } + /** !#en + Physics manager uses box2d as the inner physics system, and hide most box2d implement details(creating rigidbody, synchronize rigidbody info to node). + You can visit some common box2d function through physics manager(hit testing, raycast, debug info). + Physics manager distributes the collision information to each collision callback when collision is produced. + Note: You need first enable the collision listener in the rigidbody. + !#zh + 物理系统将 box2d 作为内部物理系统,并且隐藏了大部分 box2d 实现细节(比如创建刚体,同步刚体信息到节点中等)。 + 你可以通过物理系统访问一些 box2d 常用的功能,比如点击测试,射线测试,设置测试信息等。 + 物理系统还管理碰撞信息的分发,她会在产生碰撞时,将碰撞信息分发到各个碰撞回调中。 + 注意:你需要先在刚体中开启碰撞接听才会产生相应的碰撞回调。 */ + export class PhysicsManager implements EventTarget { + /** !#en + The draw bits for drawing physics debug information. + !#zh + 指定物理系统需要绘制哪些调试信息。 */ + static DrawBits: DrawBits; + /** !#en + The ratio transform between physics unit and pixel unit, generally is 32. + !#zh + 物理单位与像素单位互相转换的比率,一般是 32。 */ + static PTM_RATIO: number; + /** !#en + The velocity iterations for the velocity constraint solver. + !#zh + 速度更新迭代数 */ + static VELOCITY_ITERATIONS: number; + /** !#en + The position Iterations for the position constraint solver. + !#zh + 位置迭代更新数 */ + static POSITION_ITERATIONS: number; + /** !#en + Specify the fixed time step. + Need enabledAccumulator to make it work. + !#zh + 指定固定的物理更新间隔时间,需要开启 enabledAccumulator 才有效。 */ + static FIXED_TIME_STEP: number; + /** !#en + Specify the max accumulator time. + Need enabledAccumulator to make it work. + !#zh + 每次可用于更新物理系统的最大时间,需要开启 enabledAccumulator 才有效。 */ + static MAX_ACCUMULATOR: number; + /** !#en + If enabled accumulator, then will call step function with the fixed time step FIXED_TIME_STEP. + And if the update dt is bigger than the time step, then will call step function several times. + If disabled accumulator, then will call step function with a time step calculated with the frame rate. + !#zh + 如果开启此选项,那么将会以固定的间隔时间 FIXED_TIME_STEP 来更新物理引擎,如果一个 update 的间隔时间大于 FIXED_TIME_STEP,则会对物理引擎进行多次更新。 + 如果关闭此选项,那么将会根据设定的 frame rate 计算出一个间隔时间来更新物理引擎。 */ + enabledAccumulator: boolean; + /** + !#en + Test which collider contains the given world point + !#zh + 获取包含给定世界坐标系点的碰撞体 + @param point the world point + */ + testPoint(point: Vec2): PhysicsCollider; + /** + !#en + Test which colliders intersect the given world rect + !#zh + 获取与给定世界坐标系矩形相交的碰撞体 + @param rect the world rect + */ + testAABB(rect: Rect): [PhysicsCollider]; + /** + !#en + Raycast the world for all colliders in the path of the ray. + The raycast ignores colliders that contain the starting point. + !#zh + 检测哪些碰撞体在给定射线的路径上,射线检测将忽略包含起始点的碰撞体。 + @param p1 start point of the raycast + @param p2 end point of the raycast + @param type optional, default is RayCastType.Closest + */ + rayCast(p1: Vec2, p2: Vec2, type: RayCastType): [PhysicsRayCastResult]; + /** + !#en + Attach physics debug draw to camera + !#zh + 将物理的调试绘制信息附加到指定摄像机上 + @param camera camera + */ + attachDebugDrawToCamera(camera: Camera): void; + /** + !#en + Detach physics debug draw to camera + !#zh + 将物理的调试绘制信息从指定摄像机上移除 + @param camera camera + */ + detachDebugDrawFromCamera(camera: Camera): void; + /** !#en + Enabled the physics manager? + !#zh + 指定是否启用物理系统? */ + enabled: boolean; + /** !#en + Debug draw flags. + !#zh + 设置调试绘制标志 */ + debugDrawFlags: number; + /** !#en + The physics world gravity. + !#zh + 物理世界重力值 */ + gravity: Vec2; + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** undefined */ + export enum DrawBits { + e_aabbBit = 0, + e_pairBit = 0, + e_centerOfMassBit = 0, + e_jointBit = 0, + e_shapeBit = 0, + } + /** undefined */ + export class PhysicsRayCastResult { + /** !#en + The PhysicsCollider which intersects with the raycast + !#zh + 与射线相交的碰撞体 */ + collider: PhysicsCollider; + /** !#en + The intersection point + !#zh + 射线与碰撞体相交的点 */ + point: Vec2; + /** !#en + The normal vector at the point of intersection + !#zh + 射线与碰撞体相交的点的法向量 */ + normal: Vec2; + /** !#en + The fraction of the raycast path at the point of intersection + !#zh + 射线与碰撞体相交的点占射线长度的分数 */ + fraction: number; + } + /** !#en Enum for RigidBodyType. + !#zh 刚体类型 */ + export enum RigidBodyType { + Static = 0, + Kinematic = 0, + Dynamic = 0, + Animated = 0, + } + /** !#en Enum for RayCastType. + !#zh 射线检测类型 */ + export enum RayCastType { + Closest = 0, + Any = 0, + AllClosest = 0, + All = 0, + } + /** undefined */ + export class RigidBody extends Component { + /** !#en + Should enabled contact listener? + When a collision is trigger, the collision callback will only be called when enabled contact listener. + !#zh + 是否启用接触接听器。 + 当 collider 产生碰撞时,只有开启了接触接听器才会调用相应的回调函数 */ + enabledContactListener: boolean; + /** + !#en + Collision callback. + Called when two collider begin to touch. + !#zh + 碰撞回调。 + 如果你的脚本中实现了这个函数,那么它将会在两个碰撞体开始接触时被调用。 + @param contact contact information + @param selfCollider the collider belong to this rigidbody + @param otherCollider the collider belong to another rigidbody + */ + onBeginContact(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void; + /** + !#en + Collision callback. + Called when two collider cease to touch. + !#zh + 碰撞回调。 + 如果你的脚本中实现了这个函数,那么它将会在两个碰撞体停止接触时被调用。 + @param contact contact information + @param selfCollider the collider belong to this rigidbody + @param otherCollider the collider belong to another rigidbody + */ + onEndContact(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void; + /** + !#en + Collision callback. + This is called when a contact is updated. + This allows you to inspect a contact before it goes to the solver(e.g. disable contact). + Note: this is called only for awake bodies. + Note: this is called even when the number of contact points is zero. + Note: this is not called for sensors. + !#zh + 碰撞回调。 + 如果你的脚本中实现了这个函数,那么它将会在接触更新时被调用。 + 你可以在接触被处理前根据他包含的信息作出相应的处理,比如将这个接触禁用掉。 + 注意:回调只会为醒着的刚体调用。 + 注意:接触点为零的时候也有可能被调用。 + 注意:感知体(sensor)的回调不会被调用。 + @param contact contact information + @param selfCollider the collider belong to this rigidbody + @param otherCollider the collider belong to another rigidbody + */ + onPreSolve(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void; + /** + !#en + Collision callback. + This is called after a contact is updated. + You can get the impulses from the contact in this callback. + !#zh + 碰撞回调。 + 如果你的脚本中实现了这个函数,那么它将会在接触更新完后被调用。 + 你可以在这个回调中从接触信息中获取到冲量信息。 + @param contact contact information + @param selfCollider the collider belong to this rigidbody + @param otherCollider the collider belong to another rigidbody + */ + onPostSolve(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void; + /** !#en + Is this a fast moving body that should be prevented from tunneling through + other moving bodies? + Note : + - All bodies are prevented from tunneling through kinematic and static bodies. This setting is only considered on dynamic bodies. + - You should use this flag sparingly since it increases processing time. + !#zh + 这个刚体是否是一个快速移动的刚体,并且需要禁止穿过其他快速移动的刚体? + 需要注意的是 : + - 所有刚体都被禁止从 运动刚体 和 静态刚体 中穿过。此选项只关注于 动态刚体。 + - 应该尽量少的使用此选项,因为它会增加程序处理时间。 */ + bullet: boolean; + /** !#en + Rigidbody type : Static, Kinematic, Dynamic or Animated. + !#zh + 刚体类型: Static, Kinematic, Dynamic or Animated. */ + type: RigidBodyType; + /** !#en + Set this flag to false if this body should never fall asleep. + Note that this increases CPU usage. + !#zh + 如果此刚体永远都不应该进入睡眠,那么设置这个属性为 false。 + 需要注意这将使 CPU 占用率提高。 */ + allowSleep: boolean; + /** !#en + Scale the gravity applied to this body. + !#zh + 缩放应用在此刚体上的重力值 */ + gravityScale: number; + /** !#en + Linear damping is use to reduce the linear velocity. + The damping parameter can be larger than 1, but the damping effect becomes sensitive to the + time step when the damping parameter is large. + !#zh + Linear damping 用于衰减刚体的线性速度。衰减系数可以大于 1,但是当衰减系数比较大的时候,衰减的效果会变得比较敏感。 */ + linearDamping: number; + /** !#en + Angular damping is use to reduce the angular velocity. The damping parameter + can be larger than 1 but the damping effect becomes sensitive to the + time step when the damping parameter is large. + !#zh + Angular damping 用于衰减刚体的角速度。衰减系数可以大于 1,但是当衰减系数比较大的时候,衰减的效果会变得比较敏感。 */ + angularDamping: number; + /** !#en + The linear velocity of the body's origin in world co-ordinates. + !#zh + 刚体在世界坐标下的线性速度 */ + linearVelocity: Vec2; + /** !#en + The angular velocity of the body. + !#zh + 刚体的角速度 */ + angularVelocity: number; + /** !#en + Should this body be prevented from rotating? + !#zh + 是否禁止此刚体进行旋转 */ + fixedRotation: boolean; + /** !#en + Is this body initially awake or sleeping? + !#zh + 是否立刻唤醒此刚体 */ + awake: boolean; + /** !#en + Set the active state of the body. An inactive body is not + simulated and cannot be collided with or woken up. + If body is active, all fixtures will be added to the + broad-phase. + If body is inactive, all fixtures will be removed from + the broad-phase and all contacts will be destroyed. + Fixtures on an inactive body are implicitly inactive and will + not participate in collisions, ray-casts, or queries. + Joints connected to an inactive body are implicitly inactive. + !#zh + 设置刚体的激活状态。一个非激活状态下的刚体是不会被模拟和碰撞的,不管它是否处于睡眠状态下。 + 如果刚体处于激活状态下,所有夹具会被添加到 粗测阶段(broad-phase)。 + 如果刚体处于非激活状态下,所有夹具会被从 粗测阶段(broad-phase)中移除。 + 在非激活状态下的夹具不会参与到碰撞,射线,或者查找中 + 链接到非激活状态下刚体的关节也是非激活的。 */ + active: boolean; + /** + !#en + Gets a local point relative to the body's origin given a world point. + !#zh + 将一个给定的世界坐标系下的点转换为刚体本地坐标系下的点 + @param worldPoint a point in world coordinates. + @param out optional, the receiving point + */ + getLocalPoint(worldPoint: Vec2, out: Vec2): Vec2; + /** + !#en + Get the world coordinates of a point given the local coordinates. + !#zh + 将一个给定的刚体本地坐标系下的点转换为世界坐标系下的点 + @param localPoint a point in local coordinates. + @param out optional, the receiving point + */ + getWorldPoint(localPoint: Vec2, out: Vec2): Vec2; + /** + !#en + Get the world coordinates of a vector given the local coordinates. + !#zh + 将一个给定的世界坐标系下的向量转换为刚体本地坐标系下的向量 + @param localVector a vector in world coordinates. + @param out optional, the receiving vector + */ + getWorldVector(localVector: Vec2, out: Vec2): Vec2; + /** + !#en + Gets a local vector relative to the body's origin given a world vector. + !#zh + 将一个给定的世界坐标系下的点转换为刚体本地坐标系下的点 + @param worldVector a vector in world coordinates. + @param out optional, the receiving vector + */ + getLocalVector(worldVector: Vec2, out: Vec2): Vec2; + /** + !#en + Get the world body origin position. + !#zh + 获取刚体世界坐标系下的原点值 + @param out optional, the receiving point + */ + getWorldPosition(out: Vec2): Vec2; + /** + !#en + Get the world body rotation angle. + !#zh + 获取刚体世界坐标系下的旋转值。 + */ + getWorldRotation(): number; + /** + !#en + Get the local position of the center of mass. + !#zh + 获取刚体本地坐标系下的质心 + */ + getLocalCenter(): Vec2; + /** + !#en + Get the world position of the center of mass. + !#zh + 获取刚体世界坐标系下的质心 + */ + getWorldCenter(): Vec2; + /** + !#en + Get the world linear velocity of a world point attached to this body. + !#zh + 获取刚体上指定点的线性速度 + @param worldPoint a point in world coordinates. + @param out optional, the receiving point + */ + getLinearVelocityFromWorldPoint(worldPoint: Vec2, out: Vec2): Vec2; + /** + !#en + Get total mass of the body. + !#zh + 获取刚体的质量。 + */ + getMass(): number; + /** + !#en + Get the rotational inertia of the body about the local origin. + !#zh + 获取刚体本地坐标系下原点的旋转惯性 + */ + getInertia(): number; + /** + !#en + Get all the joints connect to the rigidbody. + !#zh + 获取链接到此刚体的所有关节 + */ + getJointList(): [Joint]; + /** + !#en + Apply a force at a world point. If the force is not + applied at the center of mass, it will generate a torque and + affect the angular velocity. + !#zh + 施加一个力到刚体上的一个点。如果力没有施加到刚体的质心上,还会产生一个扭矩并且影响到角速度。 + @param force the world force vector. + @param point the world position. + @param wake also wake up the body. + */ + applyForce(force: Vec2, point: Vec2, wake: boolean): void; + /** + !#en + Apply a force to the center of mass. + !#zh + 施加一个力到刚体上的质心上。 + @param force the world force vector. + @param wake also wake up the body. + */ + applyForceToCenter(force: Vec2, wake: boolean): void; + /** + !#en + Apply a torque. This affects the angular velocity. + !#zh + 施加一个扭矩力,将影响刚体的角速度 + @param torque about the z-axis (out of the screen), usually in N-m. + @param wake also wake up the body + */ + applyTorque(torque: number, wake: boolean): void; + /** + !#en + Apply a impulse at a world point, This immediately modifies the velocity. + If the impulse is not applied at the center of mass, it will generate a torque and + affect the angular velocity. + !#zh + 施加冲量到刚体上的一个点,将立即改变刚体的线性速度。 + 如果冲量施加到的点不是刚体的质心,那么将产生一个扭矩并影响刚体的角速度。 + @param impulse the world impulse vector, usually in N-seconds or kg-m/s. + @param point the world position + @param wake alse wake up the body + */ + applyLinearImpulse(impulse: Vec2, point: Vec2, wake: boolean): void; + /** + !#en + Apply an angular impulse. + !#zh + 施加一个角速度冲量。 + @param impulse the angular impulse in units of kg*m*m/s + @param wake also wake up the body + */ + applyAngularImpulse(impulse: number, wake: boolean): void; + /** + !#en + Synchronize node's world position to box2d rigidbody's position. + If enableAnimated is true and rigidbody's type is Animated type, + will set linear velocity instead of directly set rigidbody's position. + !#zh + 同步节点的世界坐标到 box2d 刚体的坐标上。 + 如果 enableAnimated 是 true,并且刚体的类型是 Animated ,那么将设置刚体的线性速度来代替直接设置刚体的位置。 + @param enableAnimated enableAnimated + */ + syncPosition(enableAnimated: boolean): void; + /** + !#en + Synchronize node's world angle to box2d rigidbody's angle. + If enableAnimated is true and rigidbody's type is Animated type, + will set angular velocity instead of directly set rigidbody's angle. + !#zh + 同步节点的世界旋转角度值到 box2d 刚体的旋转值上。 + 如果 enableAnimated 是 true,并且刚体的类型是 Animated ,那么将设置刚体的角速度来代替直接设置刚体的角度。 + @param enableAnimated enableAnimated + */ + syncRotation(enableAnimated: boolean): void; + } + /** !#en Key map for keyboard event + !#zh 键盘事件的按键值 */ + export enum KEY { + none = 0, + back = 0, + menu = 0, + backspace = 0, + tab = 0, + enter = 0, + shift = 0, + ctrl = 0, + alt = 0, + pause = 0, + capslock = 0, + escape = 0, + space = 0, + pageup = 0, + pagedown = 0, + end = 0, + home = 0, + left = 0, + up = 0, + right = 0, + down = 0, + select = 0, + insert = 0, + Delete = 0, + a = 0, + b = 0, + c = 0, + d = 0, + e = 0, + f = 0, + g = 0, + h = 0, + i = 0, + j = 0, + k = 0, + l = 0, + m = 0, + n = 0, + o = 0, + p = 0, + q = 0, + r = 0, + s = 0, + t = 0, + u = 0, + v = 0, + w = 0, + x = 0, + y = 0, + z = 0, + num0 = 0, + num1 = 0, + num2 = 0, + num3 = 0, + num4 = 0, + num5 = 0, + num6 = 0, + num7 = 0, + num8 = 0, + num9 = 0, + '*' = 0, + '+' = 0, + '-' = 0, + numdel = 0, + '/' = 0, + f1 = 0, + f2 = 0, + f3 = 0, + f4 = 0, + f5 = 0, + f6 = 0, + f7 = 0, + f8 = 0, + f9 = 0, + f10 = 0, + f11 = 0, + f12 = 0, + numlock = 0, + scrolllock = 0, + ';' = 0, + semicolon = 0, + equal = 0, + '=' = 0, + ',' = 0, + comma = 0, + dash = 0, + '.' = 0, + period = 0, + forwardslash = 0, + grave = 0, + '[' = 0, + openbracket = 0, + backslash = 0, + ']' = 0, + closebracket = 0, + quote = 0, + dpadLeft = 0, + dpadRight = 0, + dpadUp = 0, + dpadDown = 0, + dpadCenter = 0, + } + /** Image formats */ + export enum ImageFormat { + JPG = 0, + PNG = 0, + TIFF = 0, + WEBP = 0, + PVR = 0, + ETC = 0, + S3TC = 0, + ATITC = 0, + TGA = 0, + RAWDATA = 0, + UNKNOWN = 0, + getImageFormatByData = 0, + } + /** Predefined constants */ + export enum macro { + INVALID_INDEX = 0, + NODE_TAG_INVALID = 0, + PI = 0, + PI2 = 0, + FLT_MAX = 0, + FLT_MIN = 0, + RAD = 0, + DEG = 0, + UINT_MAX = 0, + REPEAT_FOREVER = 0, + FLT_EPSILON = 0, + ONE = 0, + ZERO = 0, + SRC_ALPHA = 0, + SRC_ALPHA_SATURATE = 0, + SRC_COLOR = 0, + DST_ALPHA = 0, + DST_COLOR = 0, + ONE_MINUS_SRC_ALPHA = 0, + ONE_MINUS_SRC_COLOR = 0, + ONE_MINUS_DST_ALPHA = 0, + ONE_MINUS_DST_COLOR = 0, + ONE_MINUS_CONSTANT_ALPHA = 0, + ONE_MINUS_CONSTANT_COLOR = 0, + LINEAR = 0, + BLEND_DST = 0, + WEB_ORIENTATION_PORTRAIT = 0, + WEB_ORIENTATION_LANDSCAPE_LEFT = 0, + WEB_ORIENTATION_PORTRAIT_UPSIDE_DOWN = 0, + WEB_ORIENTATION_LANDSCAPE_RIGHT = 0, + ORIENTATION_PORTRAIT = 0, + ORIENTATION_LANDSCAPE = 0, + ORIENTATION_AUTO = 0, + VERTEX_ATTRIB_FLAG_NONE = 0, + VERTEX_ATTRIB_FLAG_POSITION = 0, + VERTEX_ATTRIB_FLAG_COLOR = 0, + VERTEX_ATTRIB_FLAG_TEX_COORDS = 0, + VERTEX_ATTRIB_FLAG_POS_COLOR_TEX = 0, + GL_ALL = 0, + VERTEX_ATTRIB_POSITION = 0, + VERTEX_ATTRIB_COLOR = 0, + VERTEX_ATTRIB_TEX_COORDS = 0, + VERTEX_ATTRIB_MAX = 0, + UNIFORM_PMATRIX = 0, + UNIFORM_MVMATRIX = 0, + UNIFORM_MVPMATRIX = 0, + UNIFORM_TIME = 0, + UNIFORM_SINTIME = 0, + UNIFORM_COSTIME = 0, + UNIFORM_RANDOM01 = 0, + UNIFORM_SAMPLER = 0, + UNIFORM_MAX = 0, + SHADER_POSITION_TEXTURECOLOR = 0, + SHADER_SPRITE_POSITION_TEXTURECOLOR = 0, + SHADER_POSITION_TEXTURECOLORALPHATEST = 0, + SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST = 0, + SHADER_POSITION_COLOR = 0, + SHADER_SPRITE_POSITION_COLOR = 0, + SHADER_POSITION_TEXTURE = 0, + SHADER_POSITION_TEXTURE_UCOLOR = 0, + SHADER_POSITION_TEXTUREA8COLOR = 0, + SHADER_POSITION_UCOLOR = 0, + SHADER_POSITION_LENGTHTEXTURECOLOR = 0, + UNIFORM_PMATRIX_S = 0, + UNIFORM_MVMATRIX_S = 0, + UNIFORM_MVPMATRIX_S = 0, + UNIFORM_TIME_S = 0, + UNIFORM_SINTIME_S = 0, + UNIFORM_COSTIME_S = 0, + UNIFORM_RANDOM01_S = 0, + UNIFORM_SAMPLER_S = 0, + UNIFORM_ALPHA_TEST_VALUE_S = 0, + ATTRIBUTE_NAME_COLOR = 0, + ATTRIBUTE_NAME_POSITION = 0, + ATTRIBUTE_NAME_TEX_COORD = 0, + ITEM_SIZE = 0, + CURRENT_ITEM = 0, + ZOOM_ACTION_TAG = 0, + NORMAL_TAG = 0, + SELECTED_TAG = 0, + DISABLE_TAG = 0, + FIX_ARTIFACTS_BY_STRECHING_TEXEL = 0, + FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX = 0, + DIRECTOR_STATS_POSITION = 0, + DIRECTOR_FPS_INTERVAL = 0, + COCOSNODE_RENDER_SUBPIXEL = 0, + SPRITEBATCHNODE_RENDER_SUBPIXEL = 0, + AUTO_PREMULTIPLIED_ALPHA_FOR_PNG = 0, + OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA = 0, + TEXTURE_NPOT_SUPPORT = 0, + USE_LA88_LABELS = 0, + SPRITE_DEBUG_DRAW = 0, + LABELBMFONT_DEBUG_DRAW = 0, + LABELATLAS_DEBUG_DRAW = 0, + ENABLE_STACKABLE_ACTIONS = 0, + ENABLE_GL_STATE_CACHE = 0, + TOUCH_TIMEOUT = 0, + BATCH_VERTEX_COUNT = 0, + ENABLE_GC_FOR_NATIVE_OBJECTS = 0, + ENABLE_TILEDMAP_CULLING = 0, + DOWNLOAD_MAX_CONCURRENT = 0, + ENABLE_TRANSPARENT_CANVAS = 0, + ENABLE_WEBGL_ANTIALIAS = 0, + ENABLE_CULLING = 0, + BLEND_SRC = 0, + } + /** The base class of most of all the objects in Fireball. */ + export class Object { + /** !#en The name of the object. + !#zh 该对象的名称。 */ + name: string; + /** !#en + Indicates whether the object is not yet destroyed. (It will not be available after being destroyed)
+ When an object's `destroy` is called, it is actually destroyed after the end of this frame. + So `isValid` will return false from the next frame, while `isValid` in the current frame will still be true. + If you want to determine whether the current frame has called `destroy`, use `cc.isValid(obj, true)`, + but this is often caused by a particular logical requirements, which is not normally required. + + !#zh + 表示该对象是否可用(被 destroy 后将不可用)。
+ 当一个对象的 `destroy` 调用以后,会在这一帧结束后才真正销毁。因此从下一帧开始 `isValid` 就会返回 false,而当前帧内 `isValid` 仍然会是 true。如果希望判断当前帧是否调用过 `destroy`,请使用 `cc.isValid(obj, true)`,不过这往往是特殊的业务需求引起的,通常情况下不需要这样。 */ + isValid: boolean; + /** + !#en + Destroy this Object, and release all its own references to other objects.
+ Actual object destruction will delayed until before rendering. + From the next frame, this CCObject is not usable any more. + You can use cc.isValid(obj) to check whether the object is destroyed before accessing it. + !#zh + 销毁该对象,并释放所有它对其它对象的引用。
+ 实际销毁操作会延迟到当前帧渲染前执行。从下一帧开始,CCObject 将不再可用。 + 您可以在访问对象之前使用 cc.isValid(obj) 来检查对象是否已被销毁。 + + @example + ```js + obj.destroy(); + ``` + */ + destroy(): boolean; + } + /** Bit mask that controls object states. */ + export enum Flags { + DontSave = 0, + EditorOnly = 0, + } + /** The fullscreen API provides an easy way for web content to be presented using the user's entire screen. + It's invalid on safari, QQbrowser and android browser */ + export class screen { + /** + initialize + */ + init(): void; + /** + return true if it's full now. + */ + fullScreen(): boolean; + /** + change the screen to full mode. + @param element element + @param onFullScreenChange onFullScreenChange + */ + requestFullScreen(element: Element, onFullScreenChange: Function): void; + /** + exit the full mode. + */ + exitFullScreen(): boolean; + /** + Automatically request full screen with a touch/click event + @param element element + @param onFullScreenChange onFullScreenChange + */ + autoFullScreen(element: Element, onFullScreenChange: Function): void; + } + /** System variables */ + export class sys { + /** English language code */ + static LANGUAGE_ENGLISH: string; + /** Chinese language code */ + static LANGUAGE_CHINESE: string; + /** French language code */ + static LANGUAGE_FRENCH: string; + /** Italian language code */ + static LANGUAGE_ITALIAN: string; + /** German language code */ + static LANGUAGE_GERMAN: string; + /** Spanish language code */ + static LANGUAGE_SPANISH: string; + /** Spanish language code */ + static LANGUAGE_DUTCH: string; + /** Russian language code */ + static LANGUAGE_RUSSIAN: string; + /** Korean language code */ + static LANGUAGE_KOREAN: string; + /** Japanese language code */ + static LANGUAGE_JAPANESE: string; + /** Hungarian language code */ + static LANGUAGE_HUNGARIAN: string; + /** Portuguese language code */ + static LANGUAGE_PORTUGUESE: string; + /** Arabic language code */ + static LANGUAGE_ARABIC: string; + /** Norwegian language code */ + static LANGUAGE_NORWEGIAN: string; + /** Polish language code */ + static LANGUAGE_POLISH: string; + /** Turkish language code */ + static LANGUAGE_TURKISH: string; + /** Ukrainian language code */ + static LANGUAGE_UKRAINIAN: string; + /** Romanian language code */ + static LANGUAGE_ROMANIAN: string; + /** Bulgarian language code */ + static LANGUAGE_BULGARIAN: string; + /** Unknown language code */ + static LANGUAGE_UNKNOWN: string; + static OS_IOS: string; + static OS_ANDROID: string; + static OS_WINDOWS: string; + static OS_MARMALADE: string; + static OS_LINUX: string; + static OS_BADA: string; + static OS_BLACKBERRY: string; + static OS_OSX: string; + static OS_WP8: string; + static OS_WINRT: string; + static OS_UNKNOWN: string; + static UNKNOWN: number; + static WIN32: number; + static LINUX: number; + static MACOS: number; + static ANDROID: number; + static IPHONE: number; + static IPAD: number; + static BLACKBERRY: number; + static NACL: number; + static EMSCRIPTEN: number; + static TIZEN: number; + static WINRT: number; + static WP8: number; + static MOBILE_BROWSER: number; + static DESKTOP_BROWSER: number; + /** Indicates whether executes in editor's window process (Electron's renderer context) */ + static EDITOR_PAGE: number; + /** Indicates whether executes in editor's main process (Electron's browser context) */ + static EDITOR_CORE: number; + static WECHAT_GAME: number; + static QQ_PLAY: number; + /** BROWSER_TYPE_WECHAT */ + static BROWSER_TYPE_WECHAT: string; + /** BROWSER_TYPE_WECHAT_GAME */ + static BROWSER_TYPE_WECHAT_GAME: string; + /** BROWSER_TYPE_QQ_PLAY */ + static BROWSER_TYPE_QQ_PLAY: string; + static BROWSER_TYPE_ANDROID: string; + static BROWSER_TYPE_IE: string; + static BROWSER_TYPE_QQ: string; + static BROWSER_TYPE_MOBILE_QQ: string; + static BROWSER_TYPE_UC: string; + static BROWSER_TYPE_360: string; + static BROWSER_TYPE_BAIDU_APP: string; + static BROWSER_TYPE_BAIDU: string; + static BROWSER_TYPE_MAXTHON: string; + static BROWSER_TYPE_OPERA: string; + static BROWSER_TYPE_OUPENG: string; + static BROWSER_TYPE_MIUI: string; + static BROWSER_TYPE_FIREFOX: string; + static BROWSER_TYPE_SAFARI: string; + static BROWSER_TYPE_CHROME: string; + static BROWSER_TYPE_LIEBAO: string; + static BROWSER_TYPE_QZONE: string; + static BROWSER_TYPE_SOUGOU: string; + static BROWSER_TYPE_UNKNOWN: string; + /** Is native ? This is set to be true in jsb auto. */ + static isNative: boolean; + /** Is web browser ? */ + static isBrowser: boolean; + /** Indicate whether system is mobile system */ + static isMobile: boolean; + /** Indicate the running platform */ + static platform: number; + /** Indicate the current language of the running system */ + static language: string; + /** Indicate the running os name */ + static os: string; + /** Indicate the running os version */ + static osVersion: string; + /** Indicate the running os main version */ + static osMainVersion: number; + /** Indicate the running browser type */ + static browserType: string; + /** Indicate the running browser version */ + static browserVersion: string; + /** Indicate the real pixel resolution of the whole game window */ + static windowPixelResolution: Size; + /** cc.sys.localStorage is a local storage component. */ + static localStorage: any; + /** The capabilities of the current platform */ + static capabilities: any; + /** + Forces the garbage collection, only available in JSB + */ + static garbageCollect(): void; + /** + Dumps rooted objects, only available in JSB + */ + static dumpRoot(): void; + /** + Restart the JS VM, only available in JSB + */ + static restartVM(): void; + /** + Clean a script in the JS VM, only available in JSB + @param jsfile jsfile + */ + static cleanScript(jsfile: string): void; + /** + Check whether an object is valid, + In web engine, it will return true if the object exist + In native engine, it will return true if the JS object and the correspond native object are both valid + @param obj obj + */ + static isObjectValid(obj: any): boolean; + /** + Dump system informations + */ + static dump(): void; + /** + Open a url in browser + @param url url + */ + static openURL(url: string): void; + /** + Get the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. + */ + static now(): number; + } + /** cc.view is the singleton object which represents the game window.
+ It's main task include:
+ - Apply the design resolution policy
+ - Provide interaction with the window, like resize event on web, retina display support, etc...
+ - Manage the game view port which can be different with the window
+ - Manage the content scale and translation
+
+ Since the cc.view is a singleton, you don't need to call any constructor or create functions,
+ the standard way to use it is by calling:
+ - cc.view.methodName();
*/ + export class View { + /** +

+ Sets view's target-densitydpi for android mobile browser. it can be set to:
+ 1. cc.macro.DENSITYDPI_DEVICE, value is "device-dpi"
+ 2. cc.macro.DENSITYDPI_HIGH, value is "high-dpi" (default value)
+ 3. cc.macro.DENSITYDPI_MEDIUM, value is "medium-dpi" (browser's default value)
+ 4. cc.macro.DENSITYDPI_LOW, value is "low-dpi"
+ 5. Custom value, e.g: "480"
+

+ @param densityDPI densityDPI + */ + setTargetDensityDPI(densityDPI: string): void; + /** + Returns the current target-densitydpi value of cc.view. + */ + getTargetDensityDPI(): string; + /** + Sets whether resize canvas automatically when browser's size changed.
+ Useful only on web. + @param enabled Whether enable automatic resize with browser's resize event + */ + resizeWithBrowserSize(enabled: boolean): void; + /** + Sets the callback function for cc.view's resize action,
+ this callback will be invoked before applying resolution policy,
+ so you can do any additional modifications within the callback.
+ Useful only on web. + @param callback The callback function + */ + setResizeCallback(callback: Function|void): void; + /** + Sets the orientation of the game, it can be landscape, portrait or auto. + When set it to landscape or portrait, and screen w/h ratio doesn't fit, + cc.view will automatically rotate the game canvas using CSS. + Note that this function doesn't have any effect in native, + in native, you need to set the application orientation in native project settings + @param orientation Possible values: cc.macro.ORIENTATION_LANDSCAPE | cc.macro.ORIENTATION_PORTRAIT | cc.macro.ORIENTATION_AUTO + */ + setOrientation(orientation: number): void; + /** + Sets whether the engine modify the "viewport" meta in your web page.
+ It's enabled by default, we strongly suggest you not to disable it.
+ And even when it's enabled, you can still set your own "viewport" meta, it won't be overridden
+ Only useful on web + @param enabled Enable automatic modification to "viewport" meta + */ + adjustViewPort(enabled: boolean): void; + /** + Retina support is enabled by default for Apple device but disabled for other devices,
+ it takes effect only when you called setDesignResolutionPolicy
+ Only useful on web + @param enabled Enable or disable retina display + */ + enableRetina(enabled: boolean): void; + /** + Check whether retina display is enabled.
+ Only useful on web + */ + isRetinaEnabled(): boolean; + /** + !#en Whether to Enable on anti-alias + !#zh 控制抗锯齿是否开启 + @param enabled Enable or not anti-alias + */ + enableAntiAlias(enabled: boolean): void; + /** + !#en Returns whether the current enable on anti-alias + !#zh 返回当前是否抗锯齿 + */ + isAntiAliasEnabled(): boolean; + /** + If enabled, the application will try automatically to enter full screen mode on mobile devices
+ You can pass true as parameter to enable it and disable it by passing false.
+ Only useful on web + @param enabled Enable or disable auto full screen on mobile devices + */ + enableAutoFullScreen(enabled: boolean): void; + /** + Check whether auto full screen is enabled.
+ Only useful on web + */ + isAutoFullScreenEnabled(): boolean; + /** + Get whether render system is ready(no matter opengl or canvas),
+ this name is for the compatibility with cocos2d-x, subclass must implement this method. + */ + isViewReady(): boolean; + /** + Sets the resolution translate on View. + @param offsetLeft offsetLeft + @param offsetTop offsetTop + */ + setContentTranslateLeftTop(offsetLeft: number, offsetTop: number): void; + /** + Returns the resolution translate on View + */ + getContentTranslateLeftTop(): Size; + /** + Returns the frame size of the view.
+ On native platforms, it returns the screen size since the view is a fullscreen view.
+ On web, it returns the size of the canvas's outer DOM element. + */ + getFrameSize(): Size; + /** + On native, it sets the frame size of view.
+ On web, it sets the size of the canvas's outer DOM element. + @param width width + @param height height + */ + setFrameSize(width: number, height: number): void; + /** + Returns the visible area size of the view port. + */ + getVisibleSize(): Size; + /** + Returns the visible area size of the view port. + */ + getVisibleSizeInPixel(): Size; + /** + Returns the visible origin of the view port. + */ + getVisibleOrigin(): Vec2; + /** + Returns the visible origin of the view port. + */ + getVisibleOriginInPixel(): Vec2; + /** + Returns whether developer can set content's scale factor. + */ + canSetContentScaleFactor(): boolean; + /** + Returns the current resolution policy + */ + getResolutionPolicy(): ResolutionPolicy; + /** + Sets the current resolution policy + @param resolutionPolicy resolutionPolicy + */ + setResolutionPolicy(resolutionPolicy: ResolutionPolicy|number): void; + /** + Sets the resolution policy with designed view size in points.
+ The resolution policy include:
+ [1] ResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched.
+ [2] ResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut.
+ [3] ResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown.
+ [4] ResolutionFixedHeight Scale the content's height to screen's height and proportionally scale its width
+ [5] ResolutionFixedWidth Scale the content's width to screen's width and proportionally scale its height
+ [cc.ResolutionPolicy] [Web only feature] Custom resolution policy, constructed by cc.ResolutionPolicy
+ @param width Design resolution width. + @param height Design resolution height. + @param resolutionPolicy The resolution policy desired + */ + setDesignResolutionSize(width: number, height: number, resolutionPolicy: ResolutionPolicy|number): void; + /** + Returns the designed size for the view. + Default resolution size is the same as 'getFrameSize'. + */ + getDesignResolutionSize(): Size; + /** + Sets the container to desired pixel resolution and fit the game content to it. + This function is very useful for adaptation in mobile browsers. + In some HD android devices, the resolution is very high, but its browser performance may not be very good. + In this case, enabling retina display is very costy and not suggested, and if retina is disabled, the image may be blurry. + But this API can be helpful to set a desired pixel resolution which is in between. + This API will do the following: + 1. Set viewport's width to the desired width in pixel + 2. Set body width to the exact pixel resolution + 3. The resolution policy will be reset with designed view size in points. + @param width Design resolution width. + @param height Design resolution height. + @param resolutionPolicy The resolution policy desired + */ + setRealPixelResolution(width: number, height: number, resolutionPolicy: ResolutionPolicy|number): void; + /** + Sets view port rectangle with points. + @param x x + @param y y + @param w width + @param h height + */ + setViewPortInPoints(x: number, y: number, w: number, h: number): void; + /** + Sets Scissor rectangle with points. + @param x x + @param y y + @param w w + @param h h + */ + setScissorInPoints(x: number, y: number, w: number, h: number): void; + /** + Returns whether GL_SCISSOR_TEST is enable + */ + isScissorEnabled(): boolean; + /** + Returns the current scissor rectangle + */ + getScissorRect(): Rect; + /** + Sets the name of the view + @param viewName viewName + */ + setViewName(viewName: string): void; + /** + Returns the name of the view + */ + getViewName(): string; + /** + Returns the view port rectangle. + */ + getViewPortRect(): Rect; + /** + Returns scale factor of the horizontal direction (X axis). + */ + getScaleX(): number; + /** + Returns scale factor of the vertical direction (Y axis). + */ + getScaleY(): number; + /** + Returns device pixel ratio for retina display. + */ + getDevicePixelRatio(): number; + /** + Returns the real location in view for a translation based on a related position + @param tx The X axis translation + @param ty The Y axis translation + @param relatedPos The related position object including "left", "top", "width", "height" informations + */ + convertToLocationInView(tx: number, ty: number, relatedPos: any): Vec2; + } + /**

cc.ContainerStrategy class is the root strategy class of container's scale strategy, + it controls the behavior of how to scale the cc.container and cc.game.canvas object

*/ + export class ContainerStrategy { + /** + Manipulation before appling the strategy + @param view The target view + */ + preApply(view: View): void; + /** + Function to apply this strategy + @param view view + @param designedResolution designedResolution + */ + apply(view: View, designedResolution: Size): void; + /** + Manipulation after applying the strategy + @param view The target view + */ + postApply(view: View): void; + } + /**

cc.ContentStrategy class is the root strategy class of content's scale strategy, + it controls the behavior of how to scale the scene and setup the viewport for the game

*/ + export class ContentStrategy { + /** + Manipulation before applying the strategy + @param view The target view + */ + preApply(view: View): void; + /** + Function to apply this strategy + The return value is {scale: [scaleX, scaleY], viewport: {cc.Rect}}, + The target view can then apply these value to itself, it's preferred not to modify directly its private variables + @param view view + @param designedResolution designedResolution + */ + apply(view: View, designedResolution: Size): any; + /** + Manipulation after applying the strategy + @param view The target view + */ + postApply(view: View): void; + } + /** undefined */ + export class EqualToFrame extends ContainerStrategy { + } + /** undefined */ + export class ProportionalToFrame extends ContainerStrategy { + } + /** undefined */ + export class EqualToWindow extends EqualToFrame { + } + /** undefined */ + export class ProportionalToWindow extends ProportionalToFrame { + } + /** undefined */ + export class OriginalContainer extends ContainerStrategy { + } + /**

cc.ResolutionPolicy class is the root strategy class of scale strategy, + its main task is to maintain the compatibility with Cocos2d-x

*/ + export class ResolutionPolicy { + /** + + @param containerStg The container strategy + @param contentStg The content strategy + */ + constructor(containerStg: ContainerStrategy, contentStg: ContentStrategy); + /** + Manipulation before applying the resolution policy + @param view The target view + */ + preApply(view: View): void; + /** + Function to apply this resolution policy + The return value is {scale: [scaleX, scaleY], viewport: {cc.Rect}}, + The target view can then apply these value to itself, it's preferred not to modify directly its private variables + @param view The target view + @param designedResolution The user defined design resolution + */ + apply(view: View, designedResolution: Size): any; + /** + Manipulation after appyling the strategy + @param view The target view + */ + postApply(view: View): void; + /** + Setup the container's scale strategy + @param containerStg containerStg + */ + setContainerStrategy(containerStg: ContainerStrategy): void; + /** + Setup the content's scale strategy + @param contentStg contentStg + */ + setContentStrategy(contentStg: ContentStrategy): void; + /** The entire application is visible in the specified area without trying to preserve the original aspect ratio.
+ Distortion can occur, and the application may appear stretched or compressed. */ + static EXACT_FIT: number; + /** The entire application fills the specified area, without distortion but possibly with some cropping,
+ while maintaining the original aspect ratio of the application. */ + static NO_BORDER: number; + /** The entire application is visible in the specified area without distortion while maintaining the original
+ aspect ratio of the application. Borders can appear on two sides of the application. */ + static SHOW_ALL: number; + /** The application takes the height of the design resolution size and modifies the width of the internal
+ canvas so that it fits the aspect ratio of the device
+ no distortion will occur however you must make sure your application works on different
+ aspect ratios */ + static FIXED_HEIGHT: number; + /** The application takes the width of the design resolution size and modifies the height of the internal
+ canvas so that it fits the aspect ratio of the device
+ no distortion will occur however you must make sure your application works on different
+ aspect ratios */ + static FIXED_WIDTH: number; + /** Unknow policy */ + static UNKNOWN: number; + } + /** cc.visibleRect is a singleton object which defines the actual visible rect of the current view, + it should represent the same rect as cc.view.getViewportRect() */ + export class visibleRect { + /** + initialize + @param visibleRect visibleRect + */ + init(visibleRect: Rect): void; + /** Top left coordinate of the screen related to the game scene. */ + topLeft: Vec2; + /** Top right coordinate of the screen related to the game scene. */ + topRight: Vec2; + /** Top center coordinate of the screen related to the game scene. */ + top: Vec2; + /** Bottom left coordinate of the screen related to the game scene. */ + bottomLeft: Vec2; + /** Bottom right coordinate of the screen related to the game scene. */ + bottomRight: Vec2; + /** Bottom center coordinate of the screen related to the game scene. */ + bottom: Vec2; + /** Center coordinate of the screen related to the game scene. */ + center: Vec2; + /** Left center coordinate of the screen related to the game scene. */ + left: Vec2; + /** Right center coordinate of the screen related to the game scene. */ + right: Vec2; + /** Width of the screen. */ + width: number; + /** Height of the screen. */ + height: number; + } + /** The CallbacksHandler is an abstract class that can register and unregister callbacks by key. + Subclasses should implement their own methods about how to invoke the callbacks. */ + export class _CallbacksHandler { + /** + + @param key key + @param callback callback + @param target can be null + */ + add(key: string, callback: Function, target?: any): void; + /** + Check if the specified key has any registered callback. If a callback is also specified, + it will only return true if the callback is registered. + @param key key + @param callback callback + @param target target + */ + has(key: string, callback?: Function, target?: any): boolean; + /** + Removes all callbacks registered in a certain event type or all callbacks registered with a certain target + @param keyOrTarget The event key to be removed or the target to be removed + */ + removeAll(keyOrTarget: string|any): void; + /** + + @param key key + @param callback callback + @param target target + */ + remove(key: string, callback: Function, target?: any): void; + } + /** !#en The callbacks invoker to handle and invoke callbacks by key. + !#zh CallbacksInvoker 用来根据 Key 管理并调用回调方法。 */ + export class CallbacksInvoker extends _CallbacksHandler { + /** + + @param key key + @param p1 p1 + @param p2 p2 + @param p3 p3 + @param p4 p4 + @param p5 p5 + */ + invoke(key: string, p1?: any, p2?: any, p3?: any, p4?: any, p5?: any): void; + } + /** !#en Contains information collected during deserialization + !#zh 包含反序列化时的一些信息 */ + export class Details { + /** list of the depends assets' uuid */ + uuidList: string[]; + /** the obj list whose field needs to load asset by uuid */ + uuidObjList: any[]; + /** the corresponding field name which referenced to the asset */ + uuidPropList: string[]; + /** the corresponding field name which referenced to the raw object */ + rawProp: string; + reset(): void; + /** + + @param obj obj + @param propName propName + */ + getUuidOf(obj: any, propName: string): string; + /** + + @param obj obj + @param propName propName + @param uuid uuid + */ + push(obj: any, propName: string, uuid: string): void; + } + /** undefined */ + export class url { + /** + Returns the url of raw assets, you will only need this if the raw asset is inside the "resources" folder. + @param url url + + @example + ```js + --- + var url = cc.url.raw("textures/myTexture.png"); + console.log(url); // "resources/raw/textures/myTexture.png" + + ``` + */ + static raw(url: string): string; + /** + Returns the url of builtin raw assets. This method can only used in editor. + @param url url + + @example + ```js + --- + var url = cc.url.builtinRaw("textures/myTexture.png"); + console.log(url); // "resources/default-raw/textures/myTexture.png" + + ``` + */ + static builtinRaw(url: string): string; + } + /** !#en + A cc.SpriteFrame has:
+ - texture: A cc.Texture2D that will be used by the _ccsg.Sprite
+ - rectangle: A rectangle of the texture + + !#zh + 一个 SpriteFrame 包含:
+ - 纹理:会被 Sprite 使用的 Texture2D 对象。
+ - 矩形:在纹理中的矩形区域。 */ + export class SpriteFrame extends Asset implements EventTarget { + /** + !#en + Constructor of SpriteFrame class. + !#zh + SpriteFrame 类的构造函数。 + @param filename filename + @param rect rect + @param rotated Whether the frame is rotated in the texture + @param offset The offset of the frame in the texture + @param originalSize The size of the frame in the texture + */ + constructor(filename?: string|Texture2D, rect?: Rect, rotated?: boolean, offset?: Vec2, originalSize?: Size); + /** !#en Top border of the sprite + !#zh sprite 的顶部边框 */ + insetTop: number; + /** !#en Bottom border of the sprite + !#zh sprite 的底部边框 */ + insetBottom: number; + /** !#en Left border of the sprite + !#zh sprite 的左边边框 */ + insetLeft: number; + /** !#en Right border of the sprite + !#zh sprite 的左边边框 */ + insetRight: number; + /** + !#en Returns whether the texture have been loaded + !#zh 返回是否已加载纹理 + */ + textureLoaded(): boolean; + /** + Add a event listener for texture loaded event. + @param callback callback + @param target target + */ + addLoadedEventListener(callback: Function, target: any): void; + /** + !#en Returns whether the sprite frame is rotated in the texture. + !#zh 获取 SpriteFrame 是否旋转 + */ + isRotated(): boolean; + /** + !#en Set whether the sprite frame is rotated in the texture. + !#zh 设置 SpriteFrame 是否旋转 + @param bRotated bRotated + */ + setRotated(bRotated: boolean): void; + /** + !#en Returns the rect of the sprite frame in the texture. + !#zh 获取 SpriteFrame 的纹理矩形区域 + */ + getRect(): Rect; + /** + !#en Sets the rect of the sprite frame in the texture. + !#zh 设置 SpriteFrame 的纹理矩形区域 + @param rect rect + */ + setRect(rect: Rect): void; + /** + !#en Returns the original size of the trimmed image. + !#zh 获取修剪前的原始大小 + */ + getOriginalSize(): Size; + /** + !#en Sets the original size of the trimmed image. + !#zh 设置修剪前的原始大小 + @param size size + */ + setOriginalSize(size: Size): void; + /** + !#en Returns the texture of the frame. + !#zh 获取使用的纹理实例 + */ + getTexture(): Texture2D; + /** + !#en Returns the offset of the frame in the texture. + !#zh 获取偏移量 + */ + getOffset(): Vec2; + /** + !#en Sets the offset of the frame in the texture. + !#zh 设置偏移量 + @param offsets offsets + */ + setOffset(offsets: Vec2): void; + /** + !#en Clone the sprite frame. + !#zh 克隆 SpriteFrame + */ + clone(): SpriteFrame; + /** + !#en Set SpriteFrame with Texture, rect, rotated, offset and originalSize.
+ !#zh 通过 Texture,rect,rotated,offset 和 originalSize 设置 SpriteFrame + @param textureOrTextureFile textureOrTextureFile + @param rect rect + @param rotated rotated + @param offset offset + @param originalSize originalSize + */ + setTexture(textureOrTextureFile: string|Texture2D, rect?: Rect, rotated?: boolean, offset?: Vec2, originalSize?: Size): boolean; + /** + !#en If a loading scene (or prefab) is marked as `asyncLoadAssets`, all the textures of the SpriteFrame which + associated by user's custom Components in the scene, will not preload automatically. + These textures will be load when Sprite component is going to render the SpriteFrames. + You can call this method if you want to load the texture early. + !#zh 当加载中的场景或 Prefab 被标记为 `asyncLoadAssets` 时,用户在场景中由自定义组件关联到的所有 SpriteFrame 的贴图都不会被提前加载。 + 只有当 Sprite 组件要渲染这些 SpriteFrame 时,才会检查贴图是否加载。如果你希望加载过程提前,你可以手工调用这个方法。 + + @example + ```js + if (spriteFrame.textureLoaded()) { + this._onSpriteFrameLoaded(); + } + else { + spriteFrame.once('load', this._onSpriteFrameLoaded, this); + spriteFrame.ensureLoadTexture(); + } + ``` + */ + ensureLoadTexture(): void; + /** + !#en + If you do not need to use the SpriteFrame temporarily, you can call this method so that its texture could be garbage collected. Then when you need to render the SpriteFrame, you should call `ensureLoadTexture` manually to reload texture. + !#zh + 当你暂时不再使用这个 SpriteFrame 时,可以调用这个方法来保证引用的贴图对象能被 GC。然后当你要渲染 SpriteFrame 时,你需要手动调用 `ensureLoadTexture` 来重新加载贴图。 + + @example + ```js + spriteFrame.clearTexture(); + // when you need the SpriteFrame again... + spriteFrame.once('load', onSpriteFrameLoaded); + spriteFrame.ensureLoadTexture(); + ``` + */ + clearTexture(): void; + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /**

+ This class allows to easily create OpenGL or Canvas 2D textures from images, text or raw data.
+ The created cc.Texture2D object will always have power-of-two dimensions.
+ Depending on how you create the cc.Texture2D object, the actual image area of the texture might be smaller than the texture dimensions
+ i.e. "contentSize" != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0).
+ Be aware that the content of the generated textures will be upside-down!

*/ + export class Texture2D extends RawAsset implements EventTarget { + /** !#en + The url of the texture, this coule be empty if the texture wasn't created via a file. + !#zh + 贴图文件的 url,当贴图不是由文件创建时值可能为空 */ + url: string; + /** !#en + Whether the texture is loaded or not + !#zh + 贴图是否已经成功加载 */ + loaded: boolean; + /** !#en + Texture width in pixel + !#zh + 贴图像素宽度 */ + width: number; + /** !#en + Texture height in pixel + !#zh + 贴图像素高度 */ + height: number; + /** + Update texture options, not available in Canvas render mode. + image, format, premultiplyAlpha can not be updated in native. + @param options options + */ + update(options: {image: DOMImageElement; mipmap: boolean; format: PixelFormat; minFilter: Filter; magFilter: Filter; wrapS: WrapMode; wrapT: WrapMode; premultiplyAlpha: boolean; }): void; + /** + Get width in pixels. + */ + getPixelWidth(): number; + /** + Get height of in pixels. + */ + getPixelHeight(): number; + /** + Get content size. + */ + getContentSize(): Size; + /** + Get content size in pixels. + */ + getContentSizeInPixels(): Size; + /** + Init with HTML element. + @param element element + + @example + ```js + var img = new Image(); + img.src = dataURL; + texture.initWithElement(img); + texture.handleLoadedTexture(); + ``` + */ + initWithElement(element: HTMLImageElement|HTMLCanvasElement): void; + /** + Intializes with a texture2d with data. + @param data data + @param pixelFormat pixelFormat + @param pixelsWidth pixelsWidth + @param pixelsHeight pixelsHeight + @param contentSize contentSize is deprecated and ignored + */ + initWithData(data: TypedArray, pixelFormat: number, pixelsWidth: number, pixelsHeight: number, contentSize: Size): boolean; + /** + Initializes a texture from a UIImage object. + Extensions to make it easy to create a CCTexture2D object from an image file. + Note that RGBA type textures will have their alpha premultiplied - use the blending mode (gl.ONE, gl.ONE_MINUS_SRC_ALPHA). + @param uiImage uiImage + */ + initWithImage(uiImage: HTMLImageElement): boolean; + /** + HTMLElement Object getter, available only on web. + In most case, it will return null, because we are recycling the dom image element for better loading performance and lower image cache memory usage. + */ + getHtmlElementObj(): HTMLImageElement; + /** + Check whether texture is loaded. + */ + isLoaded(): boolean; + /** + Handler of texture loaded event. + @param premultiplied premultiplied + */ + handleLoadedTexture(premultiplied?: boolean): void; + /** + Description of cc.Texture2D. + */ + description(): string; + /** + Release texture. + */ + releaseTexture(): void; + /** + Pixel format of the texture. + */ + getPixelFormat(): number; + /** + Whether or not the texture has their Alpha premultiplied, + support only in WebGl rendering mode. + */ + hasPremultipliedAlpha(): boolean; + /** + Whether or not use mipmap, support only in WebGl rendering mode. + */ + hasMipmaps(): boolean; + /** + Sets the min filter, mag filter, wrap s and wrap t texture parameters.
+ If the texture size is NPOT (non power of 2), then in can only use gl.CLAMP_TO_EDGE in gl.TEXTURE_WRAP_{S,T}. + @param texParams texParams object or minFilter + @param magFilter magFilter + @param wrapS wrapS + @param wrapT wrapT + */ + setTexParameters(texParams: any|number, magFilter?: number, wrapS?: Texture2D.WrapMode, wrapT?: Texture2D.WrapMode): void; + /** + sets antialias texture parameters:
+ - GL_TEXTURE_MIN_FILTER = GL_NEAREST
+ - GL_TEXTURE_MAG_FILTER = GL_NEAREST
+ supported only in native or WebGl rendering mode + */ + setAntiAliasTexParameters(): void; + /** + Sets alias texture parameters:
+ GL_TEXTURE_MIN_FILTER = GL_NEAREST
+ GL_TEXTURE_MAG_FILTER = GL_NEAREST
+ supported only in native or WebGl rendering mode + */ + setAliasTexParameters(): void; + /** Pixel format of the texture. */ + pixelFormat: number; + /** Width in pixels. */ + pixelWidth: number; + /** Height in pixels. */ + pixelHeight: number; + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** cc.textureCache is a singleton object, it's the global cache for cc.Texture2D */ + export class textureCache { + /** + Description + */ + static description(): string; + /** + Returns an already created texture. Returns null if the texture doesn't exist. + @param textureKeyName textureKeyName + + @example + ```js + ------------------ + var key = cc.textureCache.textureForKey("hello.png"); + + ``` + */ + static textureForKey(textureKeyName: string): Texture2D; + /** + Returns an already created texture. Returns null if the texture doesn't exist. + @param textureKeyName textureKeyName + + @example + ```js + ------------------ + var key = cc.textureCache.getTextureForKey("hello.png"); + + ``` + */ + static getTextureForKey(textureKeyName: string): Texture2D; + /** + + @param texture texture + + @example + ```js + --------------- + var cacheTextureForColor = cc.textureCache.getTextureColors(texture); + + ``` + */ + static getTextureColors(texture: HTMLImageElement): any[]; + /** + !#en get all textures + !#zh 获取所有贴图 + */ + static getAllTextures(): Texture2D[]; + /** +

Purges the dictionary of loaded textures.
+ Call this method if you receive the "Memory Warning"
+ In the short term: it will free some resources preventing your app from being killed
+ In the medium term: it will allocate more resources
+ In the long term: it will be the same

+ + @example + ```js + -------- + cc.textureCache.removeAllTextures(); + + ``` + */ + static removeAllTextures(): void; + /** + Deletes a texture from the cache given a texture. + @param texture texture + + @example + ```js + ----- + cc.textureCache.removeTexture(texture); + + ``` + */ + static removeTexture(texture: HTMLImageElement): void; + /** + Deletes a texture from the cache given a its key name. + @param textureKeyName textureKeyName + + @example + ```js + ------ + cc.textureCache.removeTexture("hello.png"); + + ``` + */ + static removeTextureForKey(textureKeyName: string): void; + /** +

Returns a Texture2D object given an file image
+ If the file image was not previously loaded, it will create a new Texture2D
+ object and it will return it. It will use the filename as a key.
+ Otherwise it will return a reference of a previously loaded image.
+ Supported image extensions: .png, .jpg, .gif

+ @param url url + @param cb cb + @param target target + + @example + ```js + ---- + cc.textureCache.addImage("hello.png"); + + ``` + */ + static addImage(url: string, cb: Function, target: any): Texture2D; + /** + Cache the image data. + @param path path + @param texture texture + */ + static cacheImage(path: string, texture: HTMLImageElement|HTMLCanvasElement): void; + } + /** A base node for CCNode, it will: + - maintain scene hierarchy and active logic + - notifications if some properties changed + - define some interfaces shares between CCNode + - define machanisms for Enity Component Systems + - define prefab and serialize functions */ + export class _BaseNode extends Object implements EventTarget { + /** !#en Name of node. + !#zh 该节点名称。 */ + name: string; + /** !#en The uuid for editor, will be stripped before building project. + !#zh 主要用于编辑器的 uuid,在编辑器下可用于持久化存储,在项目构建之后将变成自增的 id。 */ + uuid: string; + /** !#en All children nodes. + !#zh 节点的所有子节点。 */ + children: Node[]; + /** !#en All children nodes. + !#zh 节点的子节点数量。 */ + childrenCount: number; + /** !#en + The local active state of this node.
+ Note that a Node may be inactive because a parent is not active, even if this returns true.
+ Use {{#crossLink "Node/activeInHierarchy:property"}}{{/crossLink}} if you want to check if the Node is actually treated as active in the scene. + !#zh + 当前节点的自身激活状态。
+ 值得注意的是,一个节点的父节点如果不被激活,那么即使它自身设为激活,它仍然无法激活。
+ 如果你想检查节点在场景中实际的激活状态可以使用 {{#crossLink "Node/activeInHierarchy:property"}}{{/crossLink}}。 */ + active: boolean; + /** !#en Indicates whether this node is active in the scene. + !#zh 表示此节点是否在场景中激活。 */ + activeInHierarchy: boolean; + /** !#en Tag of node. + !#zh 节点标签。 */ + tag: number; + /** + + @param name name + */ + constructor(name?: string); + /** !#en The parent of the node. + !#zh 该节点的父节点。 */ + parent: Node; + /** + !#en + Properties configuration function
+ All properties in attrs will be set to the node,
+ when the setter of the node is available,
+ the property will be set via setter function.
+ !#zh 属性配置函数。在 attrs 的所有属性将被设置为节点属性。 + @param attrs Properties to be set to node + + @example + ```js + var attrs = { key: 0, num: 100 }; + node.attr(attrs); + ``` + */ + attr(attrs: any): void; + /** + !#en Returns a child from the container given its tag. + !#zh 通过标签获取节点的子节点。 + @param aTag An identifier to find the child node. + + @example + ```js + var child = node.getChildByTag(1001); + ``` + */ + getChildByTag(aTag: number): Node; + /** + !#en Returns a child from the container given its uuid. + !#zh 通过 uuid 获取节点的子节点。 + @param uuid The uuid to find the child node. + + @example + ```js + var child = node.getChildByUuid(uuid); + ``` + */ + getChildByUuid(uuid: string): Node; + /** + !#en Returns a child from the container given its name. + !#zh 通过名称获取节点的子节点。 + @param name A name to find the child node. + + @example + ```js + var child = node.getChildByName("Test Node"); + ``` + */ + getChildByName(name: string): Node; + /** + !#en + Inserts a child to the node at a specified index. + !#zh + 插入子节点到指定位置 + @param child the child node to be inserted + @param siblingIndex the sibling index to place the child in + + @example + ```js + node.insertChild(child, 2); + ``` + */ + insertChild(child: Node, siblingIndex: number): void; + /** + !#en Get the sibling index. + !#zh 获取同级索引。 + + @example + ```js + var index = node.getSiblingIndex(); + ``` + */ + getSiblingIndex(): number; + /** + !#en Set the sibling index of this node. + !#zh 设置节点同级索引。 + @param index index + + @example + ```js + node.setSiblingIndex(1); + ``` + */ + setSiblingIndex(index: number): void; + /** + !#en + Remove itself from its parent node. If cleanup is `true`, then also remove all events and actions.
+ If the cleanup parameter is not passed, it will force a cleanup, so it is recommended that you always pass in the `false` parameter when calling this API.
+ If the node orphan, then nothing happens. + !#zh + 从父节点中删除该节点。如果不传入 cleanup 参数或者传入 `true`,那么这个节点上所有绑定的事件、action 都会被删除。
+ 因此建议调用这个 API 时总是传入 `false` 参数。
+ 如果这个节点是一个孤节点,那么什么都不会发生。 + @param cleanup true if all actions and callbacks on this node should be removed, false otherwise. + + @example + ```js + node.removeFromParent(); + node.removeFromParent(false); + ``` + */ + removeFromParent(cleanup?: boolean): void; + /** + !#en + Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter.

+ If the cleanup parameter is not passed, it will force a cleanup.
+ "remove" logic MUST only be on this method
+ If a class wants to extend the 'removeChild' behavior it only needs
+ to override this method. + !#zh + 移除节点中指定的子节点,是否需要清理所有正在运行的行为取决于 cleanup 参数。
+ 如果 cleanup 参数不传入,默认为 true 表示清理。
+ @param child The child node which will be removed. + @param cleanup true if all running actions and callbacks on the child node will be cleanup, false otherwise. + + @example + ```js + node.removeChild(newNode); + node.removeChild(newNode, false); + ``` + */ + removeChild(child: Node, cleanup?: boolean): void; + /** + !#en + Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter. + If the cleanup parameter is not passed, it will force a cleanup.
+ !#zh + 通过标签移除节点中指定的子节点,是否需要清理所有正在运行的行为取决于 cleanup 参数。
+ 如果 cleanup 参数不传入,默认为 true 表示清理。 + @param tag An integer number that identifies a child node + @param cleanup true if all running actions and callbacks on the child node will be cleanup, false otherwise. + + @example + ```js + node.removeChildByTag(1001); + node.removeChildByTag(1001, false); + ``` + */ + removeChildByTag(tag: number, cleanup?: boolean): void; + /** + !#en + Removes all children from the container and do a cleanup all running actions depending on the cleanup parameter.
+ If the cleanup parameter is not passed, it will force a cleanup. + !#zh + 移除节点所有的子节点,是否需要清理所有正在运行的行为取决于 cleanup 参数。
+ 如果 cleanup 参数不传入,默认为 true 表示清理。 + @param cleanup true if all running actions on all children nodes should be cleanup, false otherwise. + + @example + ```js + node.removeAllChildren(); + node.removeAllChildren(false); + ``` + */ + removeAllChildren(cleanup?: boolean): void; + /** + !#en Is this node a child of the given node? + !#zh 是否是指定节点的子节点? + @param parent parent + + @example + ```js + node.isChildOf(newNode); + ``` + */ + isChildOf(parent: Node): boolean; + /** + !#en + Returns the component of supplied type if the node has one attached, null if it doesn't.
+ You can also get component in the node by passing in the name of the script. + !#zh + 获取节点上指定类型的组件,如果节点有附加指定类型的组件,则返回,如果没有则为空。
+ 传入参数也可以是脚本的名称。 + @param typeOrClassName typeOrClassName + + @example + ```js + // get sprite component. + var sprite = node.getComponent(cc.Sprite); + // get custom test calss. + var test = node.getComponent("Test"); + ``` + */ + getComponent(type: {prototype: T}): T; + getComponent(className: string): any; + /** + !#en Returns all components of supplied type in the node. + !#zh 返回节点上指定类型的所有组件。 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprites = node.getComponents(cc.Sprite); + var tests = node.getComponents("Test"); + ``` + */ + getComponents(type: {prototype: T}): T[]; + getComponents(className: string): any[]; + /** + !#en Returns the component of supplied type in any of its children using depth first search. + !#zh 递归查找所有子节点中第一个匹配指定类型的组件。 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprite = node.getComponentInChildren(cc.Sprite); + var Test = node.getComponentInChildren("Test"); + ``` + */ + getComponentInChildren(type: {prototype: T}): T; + getComponentInChildren(className: string): any; + /** + !#en Returns all components of supplied type in self or any of its children. + !#zh 递归查找自身或所有子节点中指定类型的组件 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprites = node.getComponentsInChildren(cc.Sprite); + var tests = node.getComponentsInChildren("Test"); + ``` + */ + getComponentsInChildren(type: {prototype: T}): T[]; + getComponentsInChildren(className: string): any[]; + /** + !#en Adds a component class to the node. You can also add component to node by passing in the name of the script. + !#zh 向节点添加一个指定类型的组件类,你还可以通过传入脚本的名称来添加组件。 + @param typeOrClassName The constructor or the class name of the component to add + + @example + ```js + var sprite = node.addComponent(cc.Sprite); + var test = node.addComponent("Test"); + ``` + */ + addComponent(type: {new(): T}): T; + addComponent(className: string): any; + /** + !#en + Removes a component identified by the given name or removes the component object given. + You can also use component.destroy() if you already have the reference. + !#zh + 删除节点上的指定组件,传入参数可以是一个组件构造函数或组件名,也可以是已经获得的组件引用。 + 如果你已经获得组件引用,你也可以直接调用 component.destroy() + @param component The need remove component. + + @example + ```js + node.removeComponent(cc.Sprite); + var Test = require("Test"); + node.removeComponent(Test); + ``` + */ + removeComponent(component: string|Function|Component): void; + /** + !#en + Destroy all children from the node, and release all their own references to other objects.
+ Actual destruct operation will delayed until before rendering. + !#zh + 销毁所有子节点,并释放所有它们对其它对象的引用。
+ 实际销毁操作会延迟到当前帧渲染前执行。 + + @example + ```js + node.destroyAllChildren(); + ``` + */ + destroyAllChildren(): void; + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** !#en + cc.AffineTransform class represent an affine transform matrix. It's composed basically by translation, rotation, scale transformations.
+ Please do not use its constructor directly, use cc.affineTransformMake alias function instead. + !#zh + cc.AffineTransform 类代表一个仿射变换矩阵。它基本上是由平移旋转,缩放转变所组成。
+ 请不要直接使用它的构造,请使用 cc.affineTransformMake 函数代替。 */ + export class AffineTransform { + /** + !#en Create a cc.AffineTransform object with all contents in the matrix. + !#zh 用在矩阵中的所有内容创建一个 cc.AffineTransform 对象。 + @param a a + @param b b + @param c c + @param d d + @param tx tx + @param ty ty + */ + affineTransformMake(a: number, b: number, c: number, d: number, tx: number, ty: number): AffineTransform; + /** + !#en Clone a cc.AffineTransform object from the specified transform. + !#zh 克隆指定的 cc.AffineTransform 对象。 + @param t t + */ + affineTransformClone(t: AffineTransform): AffineTransform; + /** + !#en Apply the affine transformation on a point. + !#zh 对一个点应用矩阵变换。 + @param point or x. + @param transOrY transform matrix or y. + @param t transform matrix or y. + */ + pointApplyAffineTransform(point: Vec2|number, transOrY: AffineTransform|number, t: AffineTransform): Vec2; + /** + !#en Apply the affine transformation on a size. + !#zh 应用 Size 到仿射变换矩阵上。 + @param size size + @param t t + */ + sizeApplyAffineTransform(size: Size, t: AffineTransform): Size; + /** + !#en + Create a identity transformation matrix:
+ [ 1, 0, 0,
+ 0, 1, 0 ] + !#zh + 单位矩阵:
+ [ 1, 0, 0,
+ 0, 1, 0 ] + */ + affineTransformMakeIdentity(): AffineTransform; + /** + !#en Apply the affine transformation on a rect. + !#zh 应用 Rect 到仿射变换矩阵上。 + @param rect rect + @param anAffineTransform anAffineTransform + */ + rectApplyAffineTransform(rect: Rect, anAffineTransform: AffineTransform): Rect; + /** + !#en Apply the affine transformation on a rect, and truns to an Oriented Bounding Box. + !#zh 应用 Rect 到仿射变换矩阵上, 并转换为有向包围盒 + @param rect rect + @param anAffineTransform anAffineTransform + @param out_bl out_bl + @param out_tl out_tl + @param out_tr out_tr + @param out_br out_br + */ + obbApplyAffineTransform(rect: Rect, anAffineTransform: AffineTransform, out_bl: Vec2, out_tl: Vec2, out_tr: Vec2, out_br: Vec2): void; + /** + !#en Create a new affine transformation with a base transformation matrix and a translation based on it. + !#zh 基于一个基础矩阵加上一个平移操作来创建一个新的矩阵。 + @param t The base affine transform object. + @param tx The translation on x axis. + @param ty The translation on y axis. + */ + affineTransformTranslate(t: AffineTransform, tx: number, ty: number): AffineTransform; + /** + !#en Create a new affine transformation with a base transformation matrix and a scale based on it. + !#zh 创建一个基础变换矩阵,并在此基础上进行了 Scale 仿射变换。 + @param t The base affine transform object. + @param sx The scale on x axis. + @param sy The scale on y axis. + */ + affineTransformScale(t: AffineTransform, sx: number, sy: number): AffineTransform; + /** + !#en Create a new affine transformation with a base transformation matrix and a rotation based on it. + !#zh 创建一个基础变换矩阵,并在此基础上进行了 Rotation 仿射变换。 + @param aTransform The base affine transform object. + @param anAngle The angle to rotate. + */ + affineTransformRotate(aTransform: AffineTransform, anAngle: number): AffineTransform; + /** + !#en + Concatenate a transform matrix to another and return the result:
+ t' = t1 * t2 + !#zh 拼接两个矩阵,并返回结果:
+ t' = t1 * t2 + @param t1 The first transform object. + @param t2 The transform object to concatenate. + */ + affineTransformConcat(t1: AffineTransform, t2: AffineTransform): AffineTransform; + /** + !#en + Concatenate a transform matrix to another
+ The results are reflected in the first matrix.
+ t' = t1 * t2 + !#zh + 拼接两个矩阵,将结果保存到第一个矩阵。
+ t' = t1 * t2 + @param t1 The first transform object. + @param t2 The transform object to concatenate. + */ + affineTransformConcatIn(t1: AffineTransform, t2: AffineTransform): AffineTransform; + /** + !#en Return true if an affine transform equals to another, false otherwise. + !#zh 判断两个矩阵是否相等。 + @param t1 t1 + @param t2 t2 + */ + affineTransformEqualToTransform(t1: AffineTransform, t2: AffineTransform): boolean; + /** + !#en Get the invert transform of an AffineTransform object. + !#zh 求逆矩阵。 + @param t t + */ + affineTransformInvert(t: AffineTransform): AffineTransform; + /** + !#en Put the invert transform of an AffineTransform object into the out AffineTransform object. + !#zh 求逆矩阵并存入用户传入的矩阵对象参数。 + @param t t + @param out out + */ + affineTransformInvert(t: AffineTransform, out: AffineTransform): void; + } + /** !#en + Representation of RGBA colors. + + Each color component is a floating point value with a range from 0 to 255. + + You can also use the convenience method {{#crossLink "cc/color:method"}}cc.color{{/crossLink}} to create a new Color. + + !#zh + cc.Color 用于表示颜色。 + + 它包含 RGBA 四个以浮点数保存的颜色分量,每个的值都在 0 到 255 之间。 + + 您也可以通过使用 {{#crossLink "cc/color:method"}}cc.color{{/crossLink}} 的便捷方法来创建一个新的 Color。 */ + export class Color extends ValueType { + /** + + @param r red component of the color, default value is 0. + @param g green component of the color, defualt value is 0. + @param b blue component of the color, default value is 0. + @param a alpha component of the color, default value is 255. + */ + constructor(r?: number, g?: number, b?: number, a?: number); + /** !#en Solid white, RGBA is [255, 255, 255, 255]. + !#zh 纯白色,RGBA 是 [255, 255, 255, 255]。 */ + static WHITE: Color; + /** !#en Solid black, RGBA is [0, 0, 0, 255]. + !#zh 纯黑色,RGBA 是 [0, 0, 0, 255]。 */ + static BLACK: Color; + /** !#en Transparent, RGBA is [0, 0, 0, 0]. + !#zh 透明,RGBA 是 [0, 0, 0, 0]。 */ + static TRANSPARENT: Color; + /** !#en Grey, RGBA is [127.5, 127.5, 127.5]. + !#zh 灰色,RGBA 是 [127.5, 127.5, 127.5]。 */ + static GRAY: Color; + /** !#en Solid red, RGBA is [255, 0, 0]. + !#zh 纯红色,RGBA 是 [255, 0, 0]。 */ + static RED: Color; + /** !#en Solid green, RGBA is [0, 255, 0]. + !#zh 纯绿色,RGBA 是 [0, 255, 0]。 */ + static GREEN: Color; + /** !#en Solid blue, RGBA is [0, 0, 255]. + !#zh 纯蓝色,RGBA 是 [0, 0, 255]。 */ + static BLUE: Color; + /** !#en Yellow, RGBA is [255, 235, 4]. + !#zh 黄色,RGBA 是 [255, 235, 4]。 */ + static YELLOW: Color; + /** !#en Orange, RGBA is [255, 127, 0]. + !#zh 橙色,RGBA 是 [255, 127, 0]。 */ + static ORANGE: Color; + /** !#en Cyan, RGBA is [0, 255, 255]. + !#zh 青色,RGBA 是 [0, 255, 255]。 */ + static CYAN: Color; + /** !#en Magenta, RGBA is [255, 0, 255]. + !#zh 洋红色(品红色),RGBA 是 [255, 0, 255]。 */ + static MAGENTA: Color; + /** + !#en Clone a new color from the current color. + !#zh 克隆当前颜色。 + + @example + ```js + var color = new cc.Color(); + var newColor = color.clone();// Color {r: 0, g: 0, b: 0, a: 255} + ``` + */ + clone(): Color; + /** + !#en TODO + !#zh 判断两个颜色是否相等。 + @param other other + + @example + ```js + var color1 = cc.Color.WHITE; + var color2 = new cc.Color(255, 255, 255); + cc.log(color1.equals(color2)); // true; + color2 = cc.Color.RED; + cc.log(color2.equals(color1)); // false; + ``` + */ + equals(other: Color): boolean; + /** + !#en TODO + !#zh 线性插值 + @param to to + @param ratio the interpolation coefficient. + @param out optional, the receiving vector. + + @example + ```js + // Converts a white color to a black one trough time. + update: function (dt) { + var color = this.node.color; + if (color.equals(cc.Color.BLACK)) { + return; + } + this.ratio += dt * 0.1; + this.node.color = cc.Color.WHITE.lerp(cc.Color.BLACK, ratio); + } + + ``` + */ + lerp(to: Color, ratio: number, out?: Color): Color; + /** + !#en TODO + !#zh 转换为方便阅读的字符串。 + + @example + ```js + var color = cc.Color.WHITE; + color.toString(); // "rgba(255, 255, 255, 255)" + ``` + */ + toString(): string; + /** + !#en Gets red channel value + !#zh 获取当前颜色的红色值。 + */ + getR(): number; + /** + !#en Sets red value and return the current color object + !#zh 设置当前的红色值,并返回当前对象。 + @param red the new Red component. + + @example + ```js + var color = new cc.Color(); + color.setR(255); // Color {r: 255, g: 0, b: 0, a: 255} + ``` + */ + setR(red: number): Color; + /** + !#en Gets green channel value + !#zh 获取当前颜色的绿色值。 + */ + getG(): number; + /** + !#en Sets green value and return the current color object + !#zh 设置当前的绿色值,并返回当前对象。 + @param green the new Green component. + + @example + ```js + var color = new cc.Color(); + color.setG(255); // Color {r: 0, g: 255, b: 0, a: 255} + ``` + */ + setG(green: number): Color; + /** + !#en Gets blue channel value + !#zh 获取当前颜色的蓝色值。 + */ + getB(): number; + /** + !#en Sets blue value and return the current color object + !#zh 设置当前的蓝色值,并返回当前对象。 + @param blue the new Blue component. + + @example + ```js + var color = new cc.Color(); + color.setB(255); // Color {r: 0, g: 0, b: 255, a: 255} + ``` + */ + setB(blue: number): Color; + /** + !#en Gets alpha channel value + !#zh 获取当前颜色的透明度值。 + */ + getA(): number; + /** + !#en Sets alpha value and return the current color object + !#zh 设置当前的透明度,并返回当前对象。 + @param alpha the new Alpha component. + + @example + ```js + var color = new cc.Color(); + color.setA(0); // Color {r: 0, g: 0, b: 0, a: 0} + ``` + */ + setA(alpha: number): Color; + /** + !#en Convert color to css format. + !#zh 转换为 CSS 格式。 + @param opt "rgba", "rgb", "#rgb" or "#rrggbb". + + @example + ```js + var color = cc.Color.BLACK; + color.toCSS(); // "#000"; + color.toCSS("rgba"); // "rgba(0,0,0,1.00)"; + color.toCSS("rgb"); // "rgba(0,0,0)"; + color.toCSS("#rgb"); // "#000"; + color.toCSS("#rrggbb"); // "#000000"; + ``` + */ + toCSS(opt: string): string; + /** + !#en Clamp this color to make all components between 0 to 255。 + !#zh 限制颜色数值,在 0 到 255 之间。 + + @example + ```js + var color = new cc.Color(1000, 0, 0, 255); + color.clamp(); + cc.log(color); // (255, 0, 0, 255) + ``` + */ + clamp(): void; + /** + !#en Read hex string and store color data into the current color object, the hex string must be formated as rgba or rgb. + !#zh 读取 16 进制颜色。 + @param hexString hexString + + @example + ```js + var color = cc.Color.BLACK; + color.fromHEX("#FFFF33"); // Color {r: 255, g: 255, b: 51, a: 255}; + ``` + */ + fromHEX(hexString: string): Color; + /** + !#en TODO + !#zh 转换为 16 进制。 + @param fmt "#rgb" or "#rrggbb". + + @example + ```js + var color = cc.Color.BLACK; + color.toHEX("#rgb"); // "000"; + color.toHEX("#rrggbb"); // "000000"; + ``` + */ + toHEX(fmt: string): string; + /** + !#en Convert to 24bit rgb value. + !#zh 转换为 24bit 的 RGB 值。 + + @example + ```js + var color = cc.Color.YELLOW; + color.toRGBValue(); // 16771844; + ``` + */ + toRGBValue(): number; + /** + !#en TODO + !#zh 读取 HSV(色彩模型)格式。 + @param h h + @param s s + @param v v + + @example + ```js + var color = cc.Color.YELLOW; + color.fromHSV(0, 0, 1); // Color {r: 255, g: 255, b: 255, a: 255}; + ``` + */ + fromHSV(h: number, s: number, v: number): Color; + /** + !#en TODO + !#zh 转换为 HSV(色彩模型)格式。 + + @example + ```js + var color = cc.Color.YELLOW; + color.toHSV(); // Object {h: 0.1533864541832669, s: 0.9843137254901961, v: 1}; + ``` + */ + toHSV(): any; + /** + !#en TODO + !#zh RGB 转换为 HSV。 + @param r red, must be [0, 255]. + @param g red, must be [0, 255]. + @param b red, must be [0, 255]. + + @example + ```js + cc.Color.rgb2hsv(255, 255, 255); // Object {h: 0, s: 0, v: 1}; + ``` + */ + static rgb2hsv(r: number, g: number, b: number): any; + /** + !#en TODO + !#zh HSV 转换为 RGB。 + @param h h + @param s s + @param v v + + @example + ```js + cc.Color.hsv2rgb(0, 0, 1); // Object {r: 255, g: 255, b: 255}; + ``` + */ + static hsv2rgb(h: number, s: number, v: number): any; + } + /** !#en A 2D rectangle defined by x, y position and width, height. + !#zh 通过位置和宽高定义的 2D 矩形。 */ + export class Rect extends ValueType { + /** + !#en + Constructor of cc.Rect class. + see {{#crossLink "cc/rect:method"}} cc.rect {{/crossLink}} for convenience method. + !#zh + cc.Rect类的构造函数。可以通过 {{#crossLink "cc/rect:method"}} cc.rect {{/crossLink}} 简便方法进行创建。 + @param x x + @param y y + @param w w + @param h h + */ + constructor(x?: number, y?: number, w?: number, h?: number); + x: number; + y: number; + width: number; + height: number; + /** + !#en Creates a rectangle from two coordinate values. + !#zh 根据指定 2 个坐标创建出一个矩形区域。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.Rect.fromMinMax(cc.v2(10, 10), cc.v2(20, 20)); // Rect {x: 10, y: 10, width: 10, height: 10}; + ``` + */ + static fromMinMax(v1: Vec2, v2: Vec2): Rect; + /** + !#en Checks if rect contains. + !#zh + 判断 2 个矩形是否有包含。
+ 返回 1 为 a 包含 b,如果 -1 为 b 包含 a, + 0 这则都不包含。 + @param a Rect a + @param b Rect b + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Rect(5, 5, 5, 5); + var c = new cc.Rect(20, 20, 10, 10); + cc.Rect.contain(a, b); // 1; + cc.Rect.contain(b, a); // -1; + cc.Rect.contain(a, c); // 0; + ``` + */ + static contain(a: Rect, b: Rect): number; + /** + !#en TODO + !#zh 克隆一个新的 Rect。 + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + a.clone();// Rect {x: 0, y: 0, width: 10, height: 10} + ``` + */ + clone(): Rect; + /** + !#en TODO + !#zh 是否等于指定的矩形。 + @param other other + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Rect(0, 0, 10, 10); + a.equals(b);// true; + ``` + */ + equals(other: Rect): boolean; + /** + !#en TODO + !#zh 线性插值 + @param to to + @param ratio the interpolation coefficient. + @param out optional, the receiving vector. + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Rect(50, 50, 100, 100); + update (dt) { + // method 1; + var c = a.lerp(b, dt * 0.1); + // method 2; + a.lerp(b, dt * 0.1, c); + } + ``` + */ + lerp(to: Rect, ratio: number, out?: Rect): Rect; + /** + !#en TODO + !#zh 转换为方便阅读的字符串 + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + a.toString();// "(0.00, 0.00, 10.00, 10.00)"; + ``` + */ + toString(): string; + /** !#en TODO + !#zh 矩形 x 轴上的最小值。 */ + xMin: number; + /** !#en TODO + !#zh 矩形 y 轴上的最小值。 */ + yMin: number; + /** !#en TODO + !#zh 矩形 x 轴上的最大值。 */ + xMax: number; + /** !#en TODO + !#zh 矩形 y 轴上的最大值。 */ + yMax: number; + /** !#en The position of the center of the rectangle. + !#zh 矩形的中心点。 */ + center: Vec2; + /** !#en The X and Y position of the rectangle. + !#zh 矩形的 x 和 y 坐标。 */ + origin: Vec2; + /** !#en Width and height of the rectangle. + !#zh 矩形的大小。 */ + size: Size; + /** + !#en TODO + !#zh 当前矩形与指定矩形是否相交。 + @param rect rect + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Rect(0, 0, 20, 20); + a.intersects(b);// true + ``` + */ + intersects(rect: Rect): void; + /** + !#en TODO + !#zh 当前矩形是否包含指定坐标点。 + Returns true if the point inside this rectangle. + @param point point + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Vec2(0, 5); + a.contains(b);// true + ``` + */ + contains(point: Vec2): void; + /** + !#en Returns true if the other rect totally inside this rectangle. + !#zh 当前矩形是否包含指定矩形。 + @param rect rect + + @example + ```js + var a = new cc.Rect(0, 0, 20, 20); + var b = new cc.Rect(0, 0, 10, 10); + a.containsRect(b);// true + ``` + */ + containsRect(rect: Rect): void; + } + /** !#en + cc.Size is the class for size object,
+ please do not use its constructor to create sizes,
+ use {{#crossLink "cc/size:method"}}{{/crossLink}} alias function instead.
+ It will be deprecated soon, please use cc.Vec2 instead. + + !#zh + cc.Size 是 size 对象的类。
+ 请不要使用它的构造函数创建的 size,
+ 使用 {{#crossLink "cc/size:method"}}{{/crossLink}} 别名函数。
+ 它不久将被取消,请使用cc.Vec2代替。 */ + export class Size { + /** + + @param width width + @param height height + */ + constructor(width: number|Size, height?: number); + width: number; + height: number; + /** !#en return a Size object with width = 0 and height = 0. + !#zh 返回一个宽度为 0 和高度为 0 的 Size 对象。 */ + static ZERO: Size; + /** + !#en TODO + !#zh 克隆 size 对象。 + + @example + ```js + var a = new cc.size(10, 10); + a.clone();// return Size {width: 0, height: 0}; + ``` + */ + clone(): Size; + /** + !#en TODO + !#zh 当前 Size 对象是否等于指定 Size 对象。 + @param other other + + @example + ```js + var a = new cc.size(10, 10); + a.equals(new cc.size(10, 10));// return true; + ``` + */ + equals(other: Size): boolean; + /** + !#en TODO + !#zh 线性插值。 + @param to to + @param ratio the interpolation coefficient. + @param out optional, the receiving vector. + + @example + ```js + var a = new cc.size(10, 10); + var b = new cc.rect(50, 50, 100, 100); + update (dt) { + // method 1; + var c = a.lerp(b, dt * 0.1); + // method 2; + a.lerp(b, dt * 0.1, c); + } + ``` + */ + lerp(to: Rect, ratio: number, out?: Size): Size; + /** + !#en TODO + !#zh 转换为方便阅读的字符串。 + + @example + ```js + var a = new cc.size(10, 10); + a.toString();// return "(10.00, 10.00)"; + ``` + */ + toString(): string; + } + /** !#en the device accelerometer reports values for each axis in units of g-force. + !#zh 设备重力传感器传递的各个轴的数据。 */ + export class Acceleration { + /** + + @param x x + @param y y + @param z z + @param timestamp timestamp + */ + constructor(x: number, y: number, z: number, timestamp: number); + } + /** !#en Blend Function used for textures. + !#zh 图像的混合方式。 */ + export class BlendFunc { + /** + + @param src1 source blend function + @param dst1 destination blend function + */ + constructor(src1: number, dst1: number); + } + /** !#en + Enum for blend factor + Refer to: http://www.andersriggelsen.dk/glblendfunc.php + !#zh + 混合因子 + 可参考: http://www.andersriggelsen.dk/glblendfunc.php */ + export enum BlendFactor { + ONE = 0, + ZERO = 0, + SRC_ALPHA = 0, + SRC_COLOR = 0, + DST_ALPHA = 0, + DST_COLOR = 0, + ONE_MINUS_SRC_ALPHA = 0, + ONE_MINUS_SRC_COLOR = 0, + ONE_MINUS_DST_ALPHA = 0, + ONE_MINUS_DST_COLOR = 0, + blendFuncDisable = 0, + } + /** undefined */ + export enum TextAlignment { + LEFT = 0, + CENTER = 0, + RIGHT = 0, + } + /** undefined */ + export class WebGLColor { + /** + + @param r r + @param g g + @param b b + @param a a + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(r: number, g: number, b: number, a: number, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class Vertex2F { + /** + + @param x x + @param y y + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(x: number, y: number, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class Vertex3F { + /** + + @param x x + @param y y + @param z z + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(x: number, y: number, z: number, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class Tex2F { + /** + + @param u u + @param v v + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(u: number, v: number, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class Quad2 { + /** + + @param tl tl + @param tr tr + @param bl bl + @param br br + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(tl: Vertex2F, tr: Vertex2F, bl: Vertex2F, br: Vertex2F, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** A 3D Quad. 4 * 3 floats */ + export class Quad3 { + /** + + @param bl1 bl1 + @param br1 br1 + @param tl1 tl1 + @param tr1 tr1 + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(bl1: Vertex3F, br1: Vertex3F, tl1: Vertex3F, tr1: Vertex3F, arrayBuffer: any[], offset: number); + } + /** undefined */ + export class V3F_C4B_T2F { + /** + + @param vertices vertices + @param colors colors + @param texCoords texCoords + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(vertices: Vertex3F, colors: Color, texCoords: Tex2F, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT(): void; + } + /** undefined */ + export class V3F_C4B_T2F_Quad { + /** + + @param tl tl + @param bl bl + @param tr tr + @param br br + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(tl: V3F_C4B_T2F, bl: V3F_C4B_T2F, tr: V3F_C4B_T2F, br: V3F_C4B_T2F, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class V2F_C4B_T2F { + /** + + @param vertices vertices + @param colors colors + @param texCoords texCoords + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(vertices: Vertex2F, colors: Color, texCoords: Tex2F, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class V2F_C4B_T2F_Triangle { + /** + + @param a a + @param b b + @param c c + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(a: V2F_C4B_T2F, b: V2F_C4B_T2F, c: V2F_C4B_T2F, arrayBuffer: any[], offset: number); + } + /** !#en The base class of all value types. + !#zh 所有值类型的基类。 */ + export class ValueType { + /** + !#en This method returns an exact copy of current value. + !#zh 克隆当前值,该方法返回一个新对象,新对象的值和原对象相等。 + */ + clone(): ValueType; + /** + !#en Compares this object with the other one. + !#zh 当前对象是否等于指定对象。 + @param other other + */ + equals(other: ValueType): boolean; + /** + !#en + Linearly interpolates between this value to to value by ratio which is in the range [0, 1]. + When ratio = 0 returns this. When ratio = 1 return to. When ratio = 0.5 returns the average of this and to. + !#zh + 线性插值。
+ 当 ratio = 0 时返回自身,ratio = 1 时返回目标,ratio = 0.5 返回自身和目标的平均值。。 + @param to the to value + @param ratio the interpolation coefficient + */ + lerp(to: ValueType, ratio: number): ValueType; + /** + !#en TODO + !#zh 转换为方便阅读的字符串。 + */ + toString(): string; + } + /** !#en Representation of 2D vectors and points. + !#zh 表示 2D 向量和坐标 */ + export class Vec2 extends ValueType { + /** + !#en + Constructor + see {{#crossLink "cc/vec2:method"}}cc.v2{{/crossLink}} or {{#crossLink "cc/p:method"}}cc.p{{/crossLink}} + !#zh + 构造函数,可查看 {{#crossLink "cc/vec2:method"}}cc.v2{{/crossLink}} 或者 {{#crossLink "cc/p:method"}}cc.p{{/crossLink}} + @param x x + @param y y + */ + constructor(x?: number, y?: number); + x: number; + y: number; + /** + !#en clone a Vec2 value + !#zh 克隆一个 Vec2 值 + */ + clone(): Vec2; + /** + !#en TODO + !#zh 设置向量值。 + @param newValue !#en new value to set. !#zh 要设置的新值 + */ + set(newValue: Vec2): Vec2; + /** + !#en TODO + !#zh 当前的向量是否与指定的向量相等。 + @param other other + */ + equals(other: Vec2): boolean; + /** + !#en TODO + !#zh 转换为方便阅读的字符串。 + */ + toString(): string; + /** + !#en TODO + !#zh 线性插值。 + @param to to + @param ratio the interpolation coefficient + @param out optional, the receiving vector + */ + lerp(to: Vec2, ratio: number, out?: Vec2): Vec2; + /** + !#en Adds this vector. If you want to save result to another vector, use add() instead. + !#zh 向量加法。如果你想保存结果到另一个向量,使用 add() 代替。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.addSelf(cc.v2(5, 5));// return Vec2 {x: 15, y: 15}; + ``` + */ + addSelf(vector: Vec2): Vec2; + /** + !#en Adds two vectors, and returns the new result. + !#zh 向量加法,并返回新结果。 + @param vector vector + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + v.add(cc.v2(5, 5)); // return Vec2 {x: 15, y: 15}; + var v1; + v.add(cc.v2(5, 5), v1); // return Vec2 {x: 15, y: 15}; + ``` + */ + add(vector: Vec2, out?: Vec2): Vec2; + /** + !#en Subtracts one vector from this. If you want to save result to another vector, use sub() instead. + !#zh 向量减法。如果你想保存结果到另一个向量,可使用 sub() 代替。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.subSelf(cc.v2(5, 5));// return Vec2 {x: 5, y: 5}; + ``` + */ + subSelf(vector: Vec2): Vec2; + /** + !#en Subtracts one vector from this, and returns the new result. + !#zh 向量减法,并返回新结果。 + @param vector vector + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + v.sub(cc.v2(5, 5)); // return Vec2 {x: 5, y: 5}; + var v1; + v.sub(cc.v2(5, 5), v1); // return Vec2 {x: 5, y: 5}; + ``` + */ + sub(vector: Vec2, out?: Vec2): Vec2; + /** + !#en Multiplies this by a number. If you want to save result to another vector, use mul() instead. + !#zh 缩放当前向量。如果你想结果保存到另一个向量,可使用 mul() 代替。 + @param num num + + @example + ```js + var v = cc.v2(10, 10); + v.mulSelf(5);// return Vec2 {x: 50, y: 50}; + ``` + */ + mulSelf(num: number): Vec2; + /** + !#en Multiplies by a number, and returns the new result. + !#zh 缩放向量,并返回新结果。 + @param num num + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + v.mul(5); // return Vec2 {x: 50, y: 50}; + var v1; + v.mul(5, v1); // return Vec2 {x: 50, y: 50}; + ``` + */ + mul(num: number, out?: Vec2): Vec2; + /** + !#en Multiplies two vectors. + !#zh 分量相乘。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.scaleSelf(cc.v2(5, 5));// return Vec2 {x: 50, y: 50}; + ``` + */ + scaleSelf(vector: Vec2): Vec2; + /** + !#en Multiplies two vectors, and returns the new result. + !#zh 分量相乘,并返回新的结果。 + @param vector vector + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + v.scale(cc.v2(5, 5)); // return Vec2 {x: 50, y: 50}; + var v1; + v.scale(cc.v2(5, 5), v1); // return Vec2 {x: 50, y: 50}; + ``` + */ + scale(vector: Vec2, out?: Vec2): Vec2; + /** + !#en Divides by a number. If you want to save result to another vector, use div() instead. + !#zh 向量除法。如果你想结果保存到另一个向量,可使用 div() 代替。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.divSelf(5); // return Vec2 {x: 2, y: 2}; + ``` + */ + divSelf(vector: Vec2): Vec2; + /** + !#en Divides by a number, and returns the new result. + !#zh 向量除法,并返回新的结果。 + @param vector vector + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + v.div(5); // return Vec2 {x: 2, y: 2}; + var v1; + v.div(5, v1); // return Vec2 {x: 2, y: 2}; + ``` + */ + div(vector: Vec2, out?: Vec2): Vec2; + /** + !#en Negates the components. If you want to save result to another vector, use neg() instead. + !#zh 向量取反。如果你想结果保存到另一个向量,可使用 neg() 代替。 + + @example + ```js + var v = cc.v2(10, 10); + v.negSelf(); // return Vec2 {x: -10, y: -10}; + ``` + */ + negSelf(): Vec2; + /** + !#en Negates the components, and returns the new result. + !#zh 返回取反后的新向量。 + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + var v1; + v.neg(v1); // return Vec2 {x: -10, y: -10}; + ``` + */ + neg(out?: Vec2): Vec2; + /** + !#en Dot product + !#zh 当前向量与指定向量进行点乘。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.dot(cc.v2(5, 5)); // return 100; + ``` + */ + dot(vector?: Vec2): number; + /** + !#en Cross product + !#zh 当前向量与指定向量进行叉乘。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.cross(cc.v2(5, 5)); // return 0; + ``` + */ + cross(vector?: Vec2): number; + /** + !#en Returns the length of this vector. + !#zh 返回该向量的长度。 + + @example + ```js + var v = cc.v2(10, 10); + v.mag(); // return 14.142135623730951; + ``` + */ + mag(): number; + /** + !#en Returns the squared length of this vector. + !#zh 返回该向量的长度平方。 + + @example + ```js + var v = cc.v2(10, 10); + v.magSqr(); // return 200; + ``` + */ + magSqr(): number; + /** + !#en Make the length of this vector to 1. + !#zh 向量归一化,让这个向量的长度为 1。 + + @example + ```js + var v = cc.v2(10, 10); + v.normalizeSelf(); // return Vec2 {x: 0.7071067811865475, y: 0.7071067811865475}; + ``` + */ + normalizeSelf(): Vec2; + /** + !#en + Returns this vector with a magnitude of 1.
+
+ Note that the current vector is unchanged and a new normalized vector is returned. If you want to normalize the current vector, use normalizeSelf function. + !#zh + 返回归一化后的向量。
+
+ 注意,当前向量不变,并返回一个新的归一化向量。如果你想来归一化当前向量,可使用 normalizeSelf 函数。 + @param out optional, the receiving vector + */ + normalize(out?: Vec2): Vec2; + /** + !#en Get angle in radian between this and vector. + !#zh 夹角的弧度。 + @param vector vector + */ + angle(vector: Vec2): number; + /** + !#en Get angle in radian between this and vector with direction. + !#zh 带方向的夹角的弧度。 + @param vector vector + */ + signAngle(vector: Vec2): number; + /** + !#en rotate + !#zh 返回旋转给定弧度后的新向量。 + @param radians radians + @param out optional, the receiving vector + */ + rotate(radians: number, out?: Vec2): Vec2; + /** + !#en rotate self + !#zh 按指定弧度旋转向量。 + @param radians radians + */ + rotateSelf(radians: number): Vec2; + /** !#en return a Vec2 object with x = 1 and y = 1. + !#zh 新 Vec2 对象。 */ + static ONE: Vec2; + /** !#en return a Vec2 object with x = 0 and y = 0. + !#zh 返回 x = 0 和 y = 0 的 Vec2 对象。 */ + static ZERO: Vec2; + /** !#en return a Vec2 object with x = 0 and y = 1. + !#zh 返回 x = 0 和 y = 1 的 Vec2 对象。 */ + static UP: Vec2; + /** !#en return a Vec2 object with x = 1 and y = 0. + !#zh 返回 x = 1 和 y = 0 的 Vec2 对象。 */ + static RIGHT: Vec2; + } + /** undefined */ + export class PhysicsBoxCollider extends PhysicsCollider implements Collider.Box { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Box size + !#zh 包围盒大小 */ + size: Size; + } + /** undefined */ + export class PhysicsChainCollider extends PolygonCollider { + /** !#en Whether the chain is loop + !#zh 链条是否首尾相连 */ + loop: boolean; + /** !#en Chain points + !#zh 链条顶点数组 */ + points: [Vec2]; + } + /** undefined */ + export class PhysicsCircleCollider extends PhysicsCollider implements Collider.Circle { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Circle radius + !#zh 圆形半径 */ + radius: number; + } + /** undefined */ + export class PhysicsCollider { + /** !#en + The density. + !#zh + 密度 */ + density: number; + /** !#en + A sensor collider collects contact information but never generates a collision response + !#zh + 一个传感器类型的碰撞体会产生碰撞回调,但是不会发生物理碰撞效果。 */ + sensor: boolean; + /** !#en + The friction coefficient, usually in the range [0,1]. + !#zh + 摩擦系数,取值一般在 [0, 1] 之间 */ + friction: number; + /** !#en + The restitution (elasticity) usually in the range [0,1]. + !#zh + 弹性系数,取值一般在 [0, 1]之间 */ + restitution: number; + /** !#en + Physics collider will find the rigidbody component on the node and set to this property. + !#zh + 碰撞体会在初始化时查找节点上是否存在刚体,如果查找成功则赋值到这个属性上。 */ + body: RigidBody; + /** + !#en + Apply current changes to collider, this will regenerate inner box2d fixtures. + !#zh + 应用当前 collider 中的修改,调用此函数会重新生成内部 box2d 的夹具。 + */ + apply(): void; + /** + !#en + Get the world aabb of the collider + !#zh + 获取碰撞体的世界坐标系下的包围盒 + */ + getAABB(): void; + } + /** undefined */ + export class PhysicsPolygonCollider extends PhysicsCollider implements Collider.Polygon { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Polygon points + !#zh 多边形顶点数组 */ + points: [Vec2]; + } + /** !#en + A distance joint constrains two points on two bodies + to remain at a fixed distance from each other. You can view + this as a massless, rigid rod. + !#zh + 距离关节通过一个固定的长度来约束关节链接的两个刚体。你可以将它想象成一个无质量,坚固的木棍。 */ + export class DistanceJoint extends Joint { + /** !#en + The distance separating the two ends of the joint. + !#zh + 关节两端的距离 */ + distance: number; + /** !#en + The spring frequency. + !#zh + 弹性系数。 */ + frequency: number; + /** !#en + The damping ratio. + !#zh + 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */ + 0: number; + } + /** !#en + Base class for joints to connect rigidbody. + !#zh + 关节类的基类 */ + export class Joint extends Component { + /** !#en + The anchor of the rigidbody. + !#zh + 刚体的锚点。 */ + anchor: Vec2; + /** !#en + The anchor of the connected rigidbody. + !#zh + 关节另一端刚体的锚点。 */ + connectedAnchor: Vec2; + /** !#en + The rigidbody to which the other end of the joint is attached. + !#zh + 关节另一端链接的刚体 */ + connectedBody: RigidBody; + /** !#en + Should the two rigid bodies connected with this joint collide with each other? + !#zh + 链接到关节上的两个刚体是否应该相互碰撞? */ + collideConnected: boolean; + /** + !#en + Apply current changes to joint, this will regenerate inner box2d joint. + !#zh + 应用当前关节中的修改,调用此函数会重新生成内部 box2d 的关节。 + */ + apply(): void; + /** + !#en + Get the anchor point on rigidbody in world coordinates. + !#zh + 获取刚体世界坐标系下的锚点。 + */ + getWorldAnchor(): Vec2; + /** + !#en + Get the anchor point on connected rigidbody in world coordinates. + !#zh + 获取链接刚体世界坐标系下的锚点。 + */ + getWorldConnectedAnchor(): Vec2; + /** + !#en + Gets the reaction force of the joint. + !#zh + 获取关节的反作用力。 + @param timeStep The time to calculate the reaction force for. + */ + getReactionForce(timeStep: number): number; + /** + !#en + Gets the reaction torque of the joint. + !#zh + 获取关节的反扭矩。 + @param timeStep The time to calculate the reaction torque for. + */ + getReactionTorque(timeStep: number): number; + } + /** !#en + A motor joint is used to control the relative motion + between two bodies. A typical usage is to control the movement + of a dynamic body with respect to the ground. + !#zh + 马达关节被用来控制两个刚体间的相对运动。 + 一个典型的例子是用来控制一个动态刚体相对于地面的运动。 */ + export class MotorJoint extends Joint { + /** !#en + The anchor of the rigidbody. + !#zh + 刚体的锚点。 */ + anchor: Vec2; + /** !#en + The anchor of the connected rigidbody. + !#zh + 关节另一端刚体的锚点。 */ + connectedAnchor: Vec2; + /** !#en + The linear offset from connected rigidbody to rigidbody. + !#zh + 关节另一端的刚体相对于起始端刚体的位置偏移量 */ + linearOffset: Vec2; + /** !#en + The angular offset from connected rigidbody to rigidbody. + !#zh + 关节另一端的刚体相对于起始端刚体的角度偏移量 */ + angularOffset: number; + /** !#en + The maximum force can be applied to rigidbody. + !#zh + 可以应用于刚体的最大的力值 */ + maxForce: number; + /** !#en + The maximum torque can be applied to rigidbody. + !#zh + 可以应用于刚体的最大扭矩值 */ + maxTorque: number; + /** !#en + The position correction factor in the range [0,1]. + !#zh + 位置矫正系数,范围为 [0, 1] */ + correctionFactor: number; + } + /** !#en + A mouse joint is used to make a point on a body track a + specified world point. This a soft constraint with a maximum + force. This allows the constraint to stretch and without + applying huge forces. + Mouse Joint will auto register the touch event with the mouse region node, + and move the choosed rigidbody in touch move event. + Note : generally mouse joint only used in test bed. + !#zh + 鼠标关节用于使刚体上的一个点追踪一个指定的世界坐标系下的位置。 + 鼠标关节可以指定一个最大的里来施加一个柔和的约束。 + 鼠标关节会自动使用 mouse region 节点来注册鼠标事件,并且在触摸移动事件中移动选中的刚体。 + 注意:一般鼠标关节只在测试环境中使用。 */ + export class MouseJoint extends Joint { + /** !#en + The anchor of the rigidbody. + !#zh + 刚体的锚点。 */ + anchor: Vec2; + /** !#en + The anchor of the connected rigidbody. + !#zh + 关节另一端刚体的锚点。 */ + connectedAnchor: Vec2; + /** !#en + The node used to register touch evnet. + If this is null, it will be the joint's node. + !#zh + 用于注册触摸事件的节点。 + 如果没有设置这个值,那么将会使用关节的节点来注册事件。 */ + mouseRegion: Node; + /** !#en + The target point. + The mouse joint will move choosed rigidbody to target point. + !#zh + 目标点,鼠标关节将会移动选中的刚体到指定的目标点 */ + target: Vec2; + /** !#en + The spring frequency. + !#zh + 弹簧系数。 */ + frequency: number; + /** !#en + The damping ratio. + !#zh + 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */ + 0: number; + /** !#en + The maximum force + !#zh + 最大阻力值 */ + maxForce: number; + } + /** !#en + A prismatic joint. This joint provides one degree of freedom: translation + along an axis fixed in rigidbody. Relative rotation is prevented. You can + use a joint limit to restrict the range of motion and a joint motor to + drive the motion or to model joint friction. + !#zh + 移动关节指定了只能在一个方向上移动刚体。 + 你可以开启关节限制来设置刚体运行移动的间距,也可以开启马达来使用关节马达驱动刚体的运行。 */ + export class PrismaticJoint extends Joint { + /** !#en + The local joint axis relative to rigidbody. + !#zh + 指定刚体可以移动的方向。 */ + localAxisA: Vec2; + /** !#en + The reference angle. + !#zh + 相对角度 */ + referenceAngle: number; + /** !#en + Enable joint distance limit? + !#zh + 是否开启关节的距离限制? */ + enableLimit: boolean; + /** !#en + Enable joint motor? + !#zh + 是否开启关节马达? */ + enableMotor: boolean; + /** !#en + The lower joint limit. + !#zh + 刚体能够移动的最小值 */ + lowerLimit: number; + /** !#en + The upper joint limit. + !#zh + 刚体能够移动的最大值 */ + upperLimit: number; + /** !#en + The maxium force can be applied to rigidbody to rearch the target motor speed. + !#zh + 可以施加到刚体的最大力。 */ + maxMotorForce: number; + /** !#en + The expected motor speed. + !#zh + 期望的马达速度。 */ + motorSpeed: number; + } + /** !#en + A revolute joint constrains two bodies to share a common point while they + are free to rotate about the point. The relative rotation about the shared + point is the joint angle. You can limit the relative rotation with + a joint limit that specifies a lower and upper angle. You can use a motor + to drive the relative rotation about the shared point. A maximum motor torque + is provided so that infinite forces are not generated. + !#zh + 旋转关节可以约束两个刚体围绕一个点来进行旋转。 + 你可以通过开启关节限制来限制旋转的最大角度和最小角度。 + 你可以通过开启马达来施加一个扭矩力来驱动这两个刚体在这一点上的相对速度。 */ + export class RevoluteJoint extends Joint { + /** !#en + The reference angle. + An angle between bodies considered to be zero for the joint angle. + !#zh + 相对角度。 + 两个物体之间角度为零时可以看作相等于关节角度 */ + referenceAngle: number; + /** !#en + The lower angle. + !#zh + 角度的最低限制。 */ + lowerAngle: number; + /** !#en + The upper angle. + !#zh + 角度的最高限制。 */ + upperAngle: number; + /** !#en + The maxium torque can be applied to rigidbody to rearch the target motor speed. + !#zh + 可以施加到刚体的最大扭矩。 */ + maxMotorTorque: number; + /** !#en + The expected motor speed. + !#zh + 期望的马达速度。 */ + motorSpeed: number; + /** !#en + Enable joint limit? + !#zh + 是否开启关节的限制? */ + enableLimit: boolean; + /** !#en + Enable joint motor? + !#zh + 是否开启关节马达? */ + enableMotor: boolean; + /** + !#en + Get the joint angle. + !#zh + 获取关节角度。 + */ + getJointAngle(): number; + } + /** !#en + A rope joint enforces a maximum distance between two points + on two bodies. It has no other effect. + Warning: if you attempt to change the maximum length during + the simulation you will get some non-physical behavior. + !#zh + 绳子关节只指定两个刚体间的最大距离,没有其他的效果。 + 注意:如果你试图动态修改关节的长度,这有可能会得到一些意外的效果。 */ + export class RopeJoint extends Joint { + /** !#en + The max length. + !#zh + 最大长度。 */ + maxLength: number; + } + /** !#en + A weld joint essentially glues two bodies together. A weld joint may + distort somewhat because the island constraint solver is approximate. + !#zh + 熔接关节相当于将两个刚体粘在了一起。 + 熔接关节可能会使某些东西失真,因为约束求解器算出的都是近似值。 */ + export class WeldJoint extends Joint { + /** !#en + The reference angle. + !#zh + 相对角度。 */ + referenceAngle: number; + /** !#en + The frequency. + !#zh + 弹性系数。 */ + frequency: number; + /** !#en + The damping ratio. + !#zh + 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */ + 0: number; + } + /** !#en + A wheel joint. This joint provides two degrees of freedom: translation + along an axis fixed in bodyA and rotation in the plane. You can use a joint motor to drive + the rotation or to model rotational friction. + This joint is designed for vehicle suspensions. + !#zh + 轮子关节提供两个维度的自由度:旋转和沿着指定方向上位置的移动。 + 你可以通过开启关节马达来使用马达驱动刚体的旋转。 + 轮组关节是专门为机动车类型设计的。 */ + export class WheelJoint extends Joint { + /** !#en + The local joint axis relative to rigidbody. + !#zh + 指定刚体可以移动的方向。 */ + localAxisA: Vec2; + /** !#en + The maxium torque can be applied to rigidbody to rearch the target motor speed. + !#zh + 可以施加到刚体的最大扭矩。 */ + maxMotorTorque: number; + /** !#en + The expected motor speed. + !#zh + 期望的马达速度。 */ + motorSpeed: number; + /** !#en + Enable joint motor? + !#zh + 是否开启关节马达? */ + enableMotor: boolean; + /** !#en + The spring frequency. + !#zh + 弹性系数。 */ + frequency: number; + /** !#en + The damping ratio. + !#zh + 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */ + dampingRatio: number; + } + /**************************************************** + * Node + *****************************************************/ + + export module Node { + /** !#en The event type supported by Node + !#zh Node 支持的事件类型 */ + export class EventType { + /** !#en The event type for touch start event, you can use its value directly: 'touchstart' + !#zh 当手指触摸到屏幕时。 */ + static TOUCH_START: string; + /** !#en The event type for touch move event, you can use its value directly: 'touchmove' + !#zh 当手指在屏幕上目标节点区域内移动时。 */ + static TOUCH_MOVE: string; + /** !#en The event type for touch end event, you can use its value directly: 'touchend' + !#zh 当手指在目标节点区域内离开屏幕时。 */ + static TOUCH_END: string; + /** !#en The event type for touch end event, you can use its value directly: 'touchcancel' + !#zh 当手指在目标节点区域外离开屏幕时。 */ + static TOUCH_CANCEL: string; + /** !#en The event type for mouse down events, you can use its value directly: 'mousedown' + !#zh 当鼠标按下时触发一次。 */ + static MOUSE_DOWN: string; + /** !#en The event type for mouse move events, you can use its value directly: 'mousemove' + !#zh 当鼠标在目标节点在目标节点区域中移动时,不论是否按下。 */ + static MOUSE_MOVE: string; + /** !#en The event type for mouse enter target events, you can use its value directly: 'mouseenter' + !#zh 当鼠标移入目标节点区域时,不论是否按下。 */ + static MOUSE_ENTER: string; + /** !#en The event type for mouse leave target events, you can use its value directly: 'mouseleave' + !#zh 当鼠标移出目标节点区域时,不论是否按下。 */ + static MOUSE_LEAVE: string; + /** !#en The event type for mouse up events, you can use its value directly: 'mouseup' + !#zh 当鼠标从按下状态松开时触发一次。 */ + static MOUSE_UP: string; + /** !#en The event type for mouse wheel events, you can use its value directly: 'mousewheel' + !#zh 当鼠标滚轮滚动时。 */ + static MOUSE_WHEEL: string; + } + } + + /**************************************************** + * audioEngine + *****************************************************/ + + export module audioEngine { + /** !#en Audio state. + !#zh 声音播放状态 */ + export enum AudioState { + ERROR = 0, + INITIALZING = 0, + PLAYING = 0, + PAUSED = 0, + } + } + + /**************************************************** + * ParticleSystem + *****************************************************/ + + export module ParticleSystem { + /** !#en Enum for emitter modes + !#zh 发射模式 */ + export enum EmitterMode { + GRAVITY = 0, + RADIUS = 0, + } + } + + /**************************************************** + * ParticleSystem + *****************************************************/ + + export module ParticleSystem { + /** !#en Enum for particles movement type. + !#zh 粒子位置类型 */ + export enum PositionType { + FREE = 0, + RELATIVE = 0, + GROUPED = 0, + } + } + + /**************************************************** + * TiledMap + *****************************************************/ + + export module TiledMap { + /** !#en The orientation of tiled map. + !#zh Tiled Map 地图方向。 */ + export enum Orientation { + ORTHO = 0, + HEX = 0, + ISO = 0, + NONE = 0, + MAP = 0, + LAYER = 0, + OBJECTGROUP = 0, + OBJECT = 0, + TILE = 0, + HORIZONTAL = 0, + VERTICAL = 0, + DIAGONAL = 0, + FLIPPED_ALL = 0, + FLIPPED_MASK = 0, + STAGGERAXIS_X = 0, + STAGGERAXIS_Y = 0, + STAGGERINDEX_ODD = 0, + STAGGERINDEX_EVEN = 0, + } + } + + /**************************************************** + * Collider + *****************************************************/ + + export module Collider { + /** !#en Defines a Box Collider . + !#zh 用来定义包围盒碰撞体 */ + export class Box { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Box size + !#zh 包围盒大小 */ + size: Size; + } + } + + /**************************************************** + * Collider + *****************************************************/ + + export module Collider { + /** !#en Defines a Circle Collider . + !#zh 用来定义圆形碰撞体 */ + export class Circle { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Circle radius + !#zh 圆形半径 */ + radius: number; + } + } + + /**************************************************** + * Collider + *****************************************************/ + + export module Collider { + /** !#en Defines a Polygon Collider . + !#zh 用来定义多边形碰撞体 */ + export class Polygon { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Polygon points + !#zh 多边形顶点数组 */ + points: [Vec2]; + } + } + + /**************************************************** + * Button + *****************************************************/ + + export module Button { + /** !#en Enum for transition type. + !#zh 过渡类型 */ + export enum Transition { + NONE = 0, + COLOR = 0, + SPRITE = 0, + SCALE = 0, + } + } + + /**************************************************** + * Component + *****************************************************/ + + export module Component { + /** !#en + Component will register a event to target component's handler. + And it will trigger the handler when a certain event occurs. + + !@zh + “EventHandler” 类用来设置场景中的事件回调, + 该类允许用户设置回调目标节点,目标组件名,组件方法名, + 并可通过 emit 方法调用目标函数。 */ + export class EventHandler { + /** !#en Event target + !#zh 目标节点 */ + target: Node; + /** !#en Component name + !#zh 目标组件名 */ + component: string; + /** !#en Event handler + !#zh 响应事件函数名 */ + handler: string; + /** !#en Custom Event Data + !#zh 自定义事件数据 */ + customEventData: string; + /** + + @param events events + @param params params + */ + static emitEvents(events: Component.EventHandler[], ...params: any[]): void; + /** + !#en Emit event with params + !#zh 触发目标组件上的指定 handler 函数,该参数是回调函数的参数值(可不填)。 + @param params params + + @example + ```js + // Call Function + var eventHandler = new cc.Component.EventHandler(); + eventHandler.target = newTarget; + eventHandler.component = "MainMenu"; + eventHandler.handler = "OnClick" + eventHandler.emit(["param1", "param2", ....]); + ``` + */ + emit(params: any[]): void; + } + } + + /**************************************************** + * EditBox + *****************************************************/ + + export module EditBox { + /** !#en Enum for keyboard return types + !#zh 键盘的返回键类型 */ + export enum KeyboardReturnType { + DEFAULT = 0, + DONE = 0, + SEND = 0, + SEARCH = 0, + GO = 0, + } + } + + /**************************************************** + * EditBox + *****************************************************/ + + export module EditBox { + /** !#en The EditBox's InputMode defines the type of text that the user is allowed to enter. + !#zh 输入模式 */ + export enum InputMode { + ANY = 0, + EMAIL_ADDR = 0, + NUMERIC = 0, + PHONE_NUMBER = 0, + URL = 0, + DECIMAL = 0, + SINGLE_LINE = 0, + } + } + + /**************************************************** + * EditBox + *****************************************************/ + + export module EditBox { + /** !#en Enum for the EditBox's input flags + !#zh 定义了一些用于设置文本显示和文本格式化的标志位。 */ + export enum InputFlag { + PASSWORD = 0, + SENSITIVE = 0, + INITIAL_CAPS_WORD = 0, + INITIAL_CAPS_SENTENCE = 0, + INITIAL_CAPS_ALL_CHARACTERS = 0, + } + } + + /**************************************************** + * Label + *****************************************************/ + + export module Label { + /** !#en Enum for text alignment. + !#zh 文本横向对齐类型 */ + export enum HorizontalAlign { + LEFT = 0, + CENTER = 0, + RIGHT = 0, + } + } + + /**************************************************** + * Label + *****************************************************/ + + export module Label { + /** !#en Enum for vertical text alignment. + !#zh 文本垂直对齐类型 */ + export enum VerticalAlign { + TOP = 0, + CENTER = 0, + BOTTOM = 0, + } + } + + /**************************************************** + * Label + *****************************************************/ + + export module Label { + /** !#en Enum for Overflow. + !#zh Overflow 类型 */ + export enum Overflow { + NONE = 0, + CLAMP = 0, + SHRINK = 0, + RESIZE_HEIGHT = 0, + } + } + + /**************************************************** + * Label + *****************************************************/ + + export module Label { + /** !#en Enum for font type. + !#zh Type 类型 */ + export enum Type { + TTF = 0, + BMFont = 0, + SystemFont = 0, + } + } + + /**************************************************** + * Layout + *****************************************************/ + + export module Layout { + /** !#en Enum for Layout type + !#zh 布局类型 */ + export enum Type { + NONE = 0, + HORIZONTAL = 0, + VERTICAL = 0, + GRID = 0, + } + } + + /**************************************************** + * Layout + *****************************************************/ + + export module Layout { + /** !#en Enum for Layout Resize Mode + !#zh 缩放模式 */ + export enum ResizeMode { + NONE = 0, + CONTAINER = 0, + CHILDREN = 0, + } + } + + /**************************************************** + * Layout + *****************************************************/ + + export module Layout { + /** !#en Enum for Grid Layout start axis direction. + The items in grid layout will be arranged in each axis at first.; + !#zh 布局轴向,只用于 GRID 布局。 */ + export enum AxisDirection { + HORIZONTAL = 0, + VERTICAL = 0, + } + } + + /**************************************************** + * Layout + *****************************************************/ + + export module Layout { + /** !#en Enum for vertical layout direction. + Used in Grid Layout together with AxisDirection is VERTICAL + !#zh 垂直方向布局方式 */ + export enum VerticalDirection { + BOTTOM_TO_TOP = 0, + TOP_TO_BOTTOM = 0, + } + } + + /**************************************************** + * Layout + *****************************************************/ + + export module Layout { + /** !#en Enum for horizontal layout direction. + Used in Grid Layout together with AxisDirection is HORIZONTAL + !#zh 水平方向布局方式 */ + export enum HorizontalDirection { + LEFT_TO_RIGHT = 0, + RIGHT_TO_LEFT = 0, + } + } + + /**************************************************** + * Mask + *****************************************************/ + + export module Mask { + /** !#en the type for mask. + !#zh 遮罩组件类型 */ + export enum Type { + RECT = 0, + ELLIPSE = 0, + IMAGE_STENCIL = 0, + } + } + + /**************************************************** + * PageView + *****************************************************/ + + export module PageView { + /** !#en The Page View Size Mode + !#zh 页面视图每个页面统一的大小类型 */ + export enum SizeMode { + Unified = 0, + Free = 0, + } + } + + /**************************************************** + * PageView + *****************************************************/ + + export module PageView { + /** !#en The Page View Direction + !#zh 页面视图滚动类型 */ + export enum Direction { + Horizontal = 0, + Vertical = 0, + } + } + + /**************************************************** + * PageView + *****************************************************/ + + export module PageView { + /** !#en Enum for ScrollView event type. + !#zh 滚动视图事件类型 */ + export enum EventType { + PAGE_TURNING = 0, + } + } + + /**************************************************** + * PageViewIndicator + *****************************************************/ + + export module PageViewIndicator { + /** !#en Enum for PageView Indicator direction + !#zh 页面视图指示器的摆放方向 */ + export enum Direction { + HORIZONTAL = 0, + VERTICAL = 0, + } + } + + /**************************************************** + * ProgressBar + *****************************************************/ + + export module ProgressBar { + /** !#en Enum for ProgressBar mode + !#zh 进度条模式 */ + export enum Mode { + HORIZONTAL = 0, + VERTICAL = 0, + FILLED = 0, + } + } + + /**************************************************** + * Scrollbar + *****************************************************/ + + export module Scrollbar { + /** Enum for Scrollbar direction */ + export enum Direction { + HORIZONTAL = 0, + VERTICAL = 0, + } + } + + /**************************************************** + * ScrollView + *****************************************************/ + + export module ScrollView { + /** !#en Enum for ScrollView event type. + !#zh 滚动视图事件类型 */ + export enum EventType { + SCROLL_TO_TOP = 0, + SCROLL_TO_BOTTOM = 0, + SCROLL_TO_LEFT = 0, + SCROLL_TO_RIGHT = 0, + SCROLLING = 0, + BOUNCE_TOP = 0, + BOUNCE_BOTTOM = 0, + BOUNCE_LEFT = 0, + BOUNCE_RIGHT = 0, + SCROLL_ENDED = 0, + TOUCH_UP = 0, + AUTOSCROLL_ENDED_WITH_THRESHOLD = 0, + SCROLL_BEGAN = 0, + } + } + + /**************************************************** + * Slider + *****************************************************/ + + export module Slider { + /** !#en The Slider Direction + !#zh 滑动器方向 */ + export enum Direction { + Horizontal = 0, + Vertical = 0, + } + } + + /**************************************************** + * Sprite + *****************************************************/ + + export module Sprite { + /** !#en Enum for sprite type. + !#zh Sprite 类型 */ + export enum Type { + SIMPLE = 0, + SLICED = 0, + TILED = 0, + FILLED = 0, + } + } + + /**************************************************** + * Sprite + *****************************************************/ + + export module Sprite { + /** !#en Enum for fill type. + !#zh 填充类型 */ + export enum FillType { + HORIZONTAL = 0, + VERTICAL = 0, + RADIAL = 0, + } + } + + /**************************************************** + * Sprite + *****************************************************/ + + export module Sprite { + /** !#en Sprite Size can track trimmed size, raw size or none. + !#zh 精灵尺寸调整模式 */ + export enum SizeMode { + CUSTOM = 0, + TRIMMED = 0, + RAW = 0, + } + } + + /**************************************************** + * VideoPlayer + *****************************************************/ + + export module VideoPlayer { + /** !#en Video event type + !#zh 视频事件类型 */ + export enum EventType { + PLAYING = 0, + PAUSED = 0, + STOPPED = 0, + COMPLETED = 0, + META_LOADED = 0, + CLICKED = 0, + READY_TO_PLAY = 0, + } + } + + /**************************************************** + * VideoPlayer + *****************************************************/ + + export module VideoPlayer { + /** !#en Enum for video resouce type type. + !#zh 视频来源 */ + export enum ResourceType { + REMOTE = 0, + LOCAL = 0, + } + } + + /**************************************************** + * WebView + *****************************************************/ + + export module WebView { + /** !#en WebView event type + !#zh 网页视图事件类型 */ + export enum EventType { + LOADED = 0, + LOADING = 0, + ERROR = 0, + } + } + + /**************************************************** + * Event + *****************************************************/ + + export module Event { + /** !#en The Custom event + !#zh 自定义事件 */ + export class EventCustom extends Event { + /** + + @param type The name of the event (case-sensitive), e.g. "click", "fire", or "submit" + @param bubbles A boolean indicating whether the event bubbles up through the tree or not + */ + constructor(type: string, bubbles: boolean); + /** !#en A reference to the detailed data of the event + !#zh 事件的详细数据 */ + detail: any; + /** + !#en Sets user data + !#zh 设置用户数据 + @param data data + */ + setUserData(data: any): void; + /** + !#en Gets user data + !#zh 获取用户数据 + */ + getUserData(): any; + /** + !#en Gets event name + !#zh 获取事件名称 + */ + getEventName(): string; + /** !#en + The keyCode read-only property represents a system and implementation dependent numerical code identifying the unmodified value of the pressed key.
+ This is usually the decimal ASCII (RFC 20) or Windows 1252 code corresponding to the key.
+ If the key can't be identified, this value is 0.
+ + !#zh + keyCode 是只读属性它表示一个系统和依赖于实现的数字代码,可以识别按键的未修改值。
+ 这通常是十进制 ASCII (RFC20) 或者 Windows 1252 代码,所对应的密钥。
+ 如果无法识别该键,则该值为 0。 */ + keyCode: number; + } + } + + /**************************************************** + * SystemEvent + *****************************************************/ + + export module SystemEvent { + /** !#en The event type supported by SystemEvent + !#zh SystemEvent 支持的事件类型 */ + export class EventType { + /** !#en The event type for press the key down event, you can use its value directly: 'keydown' + !#zh 当按下按键时触发的事件 */ + static KEY_DOWN: string; + /** !#en The event type for press the key up event, you can use its value directly: 'keyup' + !#zh 当松开按键时触发的事件 */ + static KEY_UP: string; + /** !#en The event type for press the devicemotion event, you can use its value directly: 'devicemotion' + !#zh 重力感应 */ + static DEVICEMOTION: string; + } + } + + /**************************************************** + * Event + *****************************************************/ + + export module Event { + /** !#en The mouse event + !#zh 鼠标事件类型 */ + export class EventMouse extends Event { + /** + !#en Sets scroll data. + !#zh 设置鼠标的滚动数据。 + @param scrollX scrollX + @param scrollY scrollY + */ + setScrollData(scrollX: number, scrollY: number): void; + /** + !#en Returns the x axis scroll value. + !#zh 获取鼠标滚动的X轴距离,只有滚动时才有效。 + */ + getScrollX(): number; + /** + !#en Returns the y axis scroll value. + !#zh 获取滚轮滚动的 Y 轴距离,只有滚动时才有效。 + */ + getScrollY(): number; + /** + !#en Sets cursor location. + !#zh 设置当前鼠标位置。 + @param x x + @param y y + */ + setLocation(x: number, y: number): void; + /** + !#en Returns cursor location. + !#zh 获取鼠标位置对象,对象包含 x 和 y 属性。 + */ + getLocation(): Vec2; + /** + !#en Returns the current cursor location in screen coordinates. + !#zh 获取当前事件在游戏窗口内的坐标位置对象,对象包含 x 和 y 属性。 + */ + getLocationInView(): Vec2; + /** + !#en Returns the previous touch location. + !#zh 获取鼠标点击在上一次事件时的位置对象,对象包含 x 和 y 属性。 + */ + getPreviousLocation(): Vec2; + /** + !#en Returns the delta distance from the previous location to current location. + !#zh 获取鼠标距离上一次事件移动的距离对象,对象包含 x 和 y 属性。 + */ + getDelta(): Vec2; + /** + !#en Returns the X axis delta distance from the previous location to current location. + !#zh 获取鼠标距离上一次事件移动的 X 轴距离。 + */ + getDeltaX(): number; + /** + !#en Returns the Y axis delta distance from the previous location to current location. + !#zh 获取鼠标距离上一次事件移动的 Y 轴距离。 + */ + getDeltaY(): number; + /** + !#en Sets mouse button. + !#zh 设置鼠标按键。 + @param button button + */ + setButton(button: number): void; + /** + !#en Returns mouse button. + !#zh 获取鼠标按键。 + */ + getButton(): number; + /** + !#en Returns location X axis data. + !#zh 获取鼠标当前位置 X 轴。 + */ + getLocationX(): number; + /** + !#en Returns location Y axis data. + !#zh 获取鼠标当前位置 Y 轴。 + */ + getLocationY(): number; + /** !#en The none event code of mouse event. + !#zh 无。 */ + static NONE: number; + /** !#en The event type code of mouse down event. + !#zh 鼠标按下事件。 */ + static DOWN: number; + /** !#en The event type code of mouse up event. + !#zh 鼠标按下后释放事件。 */ + static UP: number; + /** !#en The event type code of mouse move event. + !#zh 鼠标移动事件。 */ + static MOVE: number; + /** !#en The event type code of mouse scroll event. + !#zh 鼠标滚轮事件。 */ + static SCROLL: number; + /** !#en The tag of Mouse left button. + !#zh 鼠标左键的标签。 */ + static BUTTON_LEFT: number; + /** !#en The tag of Mouse right button (The right button number is 2 on browser). + !#zh 鼠标右键的标签。 */ + static BUTTON_RIGHT: number; + /** !#en The tag of Mouse middle button (The right button number is 1 on browser). + !#zh 鼠标中键的标签。 */ + static BUTTON_MIDDLE: number; + /** !#en The tag of Mouse button 4. + !#zh 鼠标按键 4 的标签。 */ + static BUTTON_4: number; + /** !#en The tag of Mouse button 5. + !#zh 鼠标按键 5 的标签。 */ + static BUTTON_5: number; + /** !#en The tag of Mouse button 6. + !#zh 鼠标按键 6 的标签。 */ + static BUTTON_6: number; + /** !#en The tag of Mouse button 7. + !#zh 鼠标按键 7 的标签。 */ + static BUTTON_7: number; + /** !#en The tag of Mouse button 8. + !#zh 鼠标按键 8 的标签。 */ + static BUTTON_8: number; + } + } + + /**************************************************** + * Event + *****************************************************/ + + export module Event { + /** !#en The touch event + !#zh 触摸事件 */ + export class EventTouch extends Event { + /** + + @param touchArr The array of the touches + @param bubbles A boolean indicating whether the event bubbles up through the tree or not + */ + constructor(touchArr: any[], bubbles: boolean); + /** !#en The current touch object + !#zh 当前触点对象 */ + touch: Touch; + /** + !#en Returns event code. + !#zh 获取事件类型。 + */ + getEventCode(): number; + /** + !#en Returns touches of event. + !#zh 获取触摸点的列表。 + */ + getTouches(): any[]; + /** + !#en Sets touch location. + !#zh 设置当前触点位置 + @param x x + @param y y + */ + setLocation(x: number, y: number): void; + /** + !#en Returns touch location. + !#zh 获取触点位置。 + */ + getLocation(): Vec2; + /** + !#en Returns the current touch location in screen coordinates. + !#zh 获取当前触点在游戏窗口中的位置。 + */ + getLocationInView(): Vec2; + /** + !#en Returns the previous touch location. + !#zh 获取触点在上一次事件时的位置对象,对象包含 x 和 y 属性。 + */ + getPreviousLocation(): Vec2; + /** + !#en Returns the start touch location. + !#zh 获获取触点落下时的位置对象,对象包含 x 和 y 属性。 + */ + getStartLocation(): Vec2; + /** + !#en Returns the id of cc.Touch. + !#zh 触点的标识 ID,可以用来在多点触摸中跟踪触点。 + */ + getID(): number; + /** + !#en Returns the delta distance from the previous location to current location. + !#zh 获取触点距离上一次事件移动的距离对象,对象包含 x 和 y 属性。 + */ + getDelta(): Vec2; + /** + !#en Returns the X axis delta distance from the previous location to current location. + !#zh 获取触点距离上一次事件移动的 x 轴距离。 + */ + getDeltaX(): number; + /** + !#en Returns the Y axis delta distance from the previous location to current location. + !#zh 获取触点距离上一次事件移动的 y 轴距离。 + */ + getDeltaY(): number; + /** + !#en Returns location X axis data. + !#zh 获取当前触点 X 轴位置。 + */ + getLocationX(): number; + /** + !#en Returns location Y axis data. + !#zh 获取当前触点 Y 轴位置。 + */ + getLocationY(): number; + } + } + + /**************************************************** + * Event + *****************************************************/ + + export module Event { + /** !#en The acceleration event + !#zh 加速度事件 */ + export class EventAcceleration extends Event { + } + } + + /**************************************************** + * Event + *****************************************************/ + + export module Event { + /** !#en The keyboard event + !#zh 键盘事件 */ + export class EventKeyboard extends Event { + } + } + + /**************************************************** + * Graphics + *****************************************************/ + + export module Graphics { + /** !#en Enum for LineCap. + !#zh 线段末端属性 */ + export enum LineCap { + BUTT = 0, + ROUND = 0, + SQUARE = 0, + } + } + + /**************************************************** + * Graphics + *****************************************************/ + + export module Graphics { + /** !#en Enum for LineJoin. + !#zh 线段拐角属性 */ + export enum LineJoin { + BEVEL = 0, + ROUND = 0, + MITER = 0, + } + } + + /**************************************************** + * Pipeline + *****************************************************/ + + export module Pipeline { + /** The downloader pipe, it can download several types of files: + 1. Text + 2. Image + 3. Script + 4. Audio + 5. Assets + All unknown type will be downloaded as plain text. + You can pass custom supported types in the constructor. */ + export class Downloader { + /** + Constructor of Downloader, you can pass custom supported types. + @param extMap Custom supported types with corresponded handler + + @example + ```js + var downloader = new Downloader({ + // This will match all url with `.scene` extension or all url with `scene` type + 'scene' : function (url, callback) {} + }); + ``` + */ + constructor(extMap: any); + /** + Add custom supported types handler or modify existing type handler. + @param extMap Custom supported types with corresponded handler + */ + addHandlers(extMap: any): void; + } + } + + /**************************************************** + * Pipeline + *****************************************************/ + + export module Pipeline { + /** The loader pipe, it can load several types of files: + 1. Images + 2. JSON + 3. Plist + 4. Audio + 5. Font + 6. Cocos Creator scene + It will not interfere with items of unknown type. + You can pass custom supported types in the constructor. */ + export class Loader { + /** + Constructor of Loader, you can pass custom supported types. + @param extMap Custom supported types with corresponded handler + + @example + ```js + var loader = new Loader({ + // This will match all url with `.scene` extension or all url with `scene` type + 'scene' : function (url, callback) {} + }); + ``` + */ + constructor(extMap: any); + /** + Add custom supported types handler or modify existing type handler. + @param extMap Custom supported types with corresponded handler + */ + addHandlers(extMap: any): void; + } + } + + /**************************************************** + * LoadingItems + *****************************************************/ + + export module LoadingItems { + /** !#en The item states of the LoadingItems, its value could be LoadingItems.ItemState.WORKING | LoadingItems.ItemState.COMPLETET | LoadingItems.ItemState.ERROR + !#zh LoadingItems 队列中的加载项状态,状态的值可能是 LoadingItems.ItemState.WORKING | LoadingItems.ItemState.COMPLETET | LoadingItems.ItemState.ERROR */ + export enum ItemState { + WORKING = 0, + COMPLETET = 0, + ERROR = 0, + } + } + + /**************************************************** + * Texture2D + *****************************************************/ + + export module Texture2D { + /** The texture pixel format, default value is RGBA8888 */ + export enum PixelFormat { + RGB565 = 0, + RGB5A1 = 0, + RGBA4444 = 0, + RGB888 = 0, + RGBA8888 = 0, + A8 = 0, + I8 = 0, + AI88 = 0, + } + } + + /**************************************************** + * Texture2D + *****************************************************/ + + export module Texture2D { + /** The texture wrap mode */ + export enum WrapMode { + REPEAT = 0, + CLAMP_TO_EDGE = 0, + MIRRORED_REPEAT = 0, + } + } + + /**************************************************** + * Texture2D + *****************************************************/ + + export module Texture2D { + /** The texture filter mode */ + export enum Filter { + LINEAR = 0, + NEAREST = 0, + } + } + +} + +/** !#en +The global main namespace of DragonBones, all classes, functions, +properties and constants of DragonBones are defined in this namespace +!#zh +DragonBones 的全局的命名空间, +与 DragonBones 相关的所有的类,函数,属性,常量都在这个命名空间中定义。 */ +declare module dragonBonesOLD { + /** !#en + The Armature Display of DragonBones
+
+ (Armature Display has a reference to a DragonBonesAsset and stores the state for ArmatureDisplay instance, + which consists of the current pose's bone SRT, slot colors, and which slot attachments are visible.
+ Multiple Armature Display can use the same DragonBonesAsset which includes all animations, skins, and attachments.)
+ !#zh + DragonBones 骨骼动画
+
+ (Armature Display 具有对骨骼数据的引用并且存储了骨骼实例的状态, + 它由当前的骨骼动作,slot 颜色,和可见的 slot attachments 组成。
+ 多个 Armature Display 可以使用相同的骨骼数据,其中包括所有的动画,皮肤和 attachments。)
*/ + export class ArmatureDisplay extends cc._RendererUnderSG { + /** !#en + The DragonBones data contains the armatures information (bind pose bones, slots, draw order, + attachments, skins, etc) and animations but does not hold any state.
+ Multiple ArmatureDisplay can share the same DragonBones data. + !#zh + 骨骼数据包含了骨骼信息(绑定骨骼动作,slots,渲染顺序, + attachments,皮肤等等)和动画但不持有任何状态。
+ 多个 ArmatureDisplay 可以共用相同的骨骼数据。 */ + dragonAsset: DragonBonesAsset; + /** !#en + The atlas asset for the DragonBones. + !#zh + 骨骼数据所需的 Atlas Texture 数据。 */ + dragonAtlasAsset: DragonBonesAtlasAsset; + /** !#en The name of current armature. + !#zh 当前的 Armature 名称。 */ + armatureName: string; + /** !#en The name of current playing animation. + !#zh 当前播放的动画名称。 */ + animationName: string; + _defaultArmatureIndex: number; + /** !#en The time scale of this armature. + !#zh 当前骨骼中所有动画的时间缩放率。 */ + timeScale: number; + /** !#en The play times of the default animation. + -1 means using the value of config file; + 0 means repeat for ever + >0 means repeat times + !#zh 播放默认动画的循环次数 + -1 表示使用配置文件中的默认值; + 0 表示无限循环 + >0 表示循环次数 */ + playTimes: number; + /** !#en Indicates whether open debug bones. + !#zh 是否显示 bone 的 debug 信息。 */ + debugBones: boolean; + /** + !#en + Play the specified animation. + Parameter animName specify the animation name. + Parameter playTimes specify the repeat times of the animation. + -1 means use the value of the config file. + 0 means play the animation for ever. + >0 means repeat times. + !#zh + 播放指定的动画. + animName 指定播放动画的名称。 + playTimes 指定播放动画的次数。 + -1 为使用配置文件中的次数。 + 0 为无限循环播放。 + >0 为动画的重复次数。 + @param animName animName + @param playTimes playTimes + */ + playAnimation(animName: string, playTimes: number): dragonBonesOLD.AnimationState; + /** + !#en + Get the all armature names in the DragonBones Data. + !#zh + 获取 DragonBones 数据中所有的 armature 名称 + */ + getArmatureNames(): any[]; + /** + !#en + Get the all animation names of specified armature. + !#zh + 获取指定的 armature 的所有动画名称。 + @param armatureName armatureName + */ + getAnimationNames(armatureName: string): any[]; + /** + !#en + Add event listener for the DragonBones Event. + !#zh + 添加 DragonBones 事件监听器。 + @param eventType eventType + @param listener listener + @param target target + */ + addEventListener(eventType: dragonBonesOLD.EventObject, listener: Function, target: any): void; + /** + !#en + Remove the event listener for the DragonBones Event. + !#zh + 移除 DragonBones 事件监听器。 + @param eventType eventType + @param listener listener + @param target target + */ + removeEventListener(eventType: dragonBonesOLD.EventObject, listener: Function, target: any): void; + /** + !#en + Build the armature for specified name. + !#zh + 构建指定名称的 armature 对象 + @param armatureName armatureName + */ + buildArmature(armatureName: string): dragonBonesOLD.Armature; + /** + !#en + Get the current armature object of the ArmatureDisplay. + !#zh + 获取 ArmatureDisplay 当前使用的 Armature 对象 + */ + armature(): any; + } + /** !#en The skeleton data of dragonBonesOLD. + !#zh dragonBonesOLD 的 骨骼数据。 */ + export class DragonBonesAsset extends cc.Asset { + /** !#en See http://developer.egret.com/cn/github/egret-docs/DB/dbLibs/dataFormat/index.html + !#zh 可查看 DragonBones 官方文档 http://developer.egret.com/cn/github/egret-docs/DB/dbLibs/dataFormat/index.html */ + dragonBonesJson: string; + } + /** !#en The skeleton atlas data of dragonBonesOLD. + !#zh dragonBonesOLD 的骨骼纹理数据。 */ + export class DragonBonesAtlasAsset extends cc.Asset { + atlasJson: string; + texture: cc.Texture2D; + } +} + +/** !#en +AnySDK is a third party solution that offers game developers SDK integration without making changes to the SDK's features or parameters.It can do all of this while remaining invisible to your end user.Our goal is to handle all the tedious SDK integration work for you so that you can use your time to focus on the game itself.No matter if it’s the channel SDK, user system, payment system, ad system, statistics system, sharing system or any other type of SDK: we’ll take care of it for you. +!#zh +AnySDK 为 CP 提供一套第三方 SDK 接入解决方案,整个接入过程,不改变任何 SDK 的功能、特性、参数等,对于最终玩家而言是完全透明无感知的。 +目的是让 CP 商能有更多时间更专注于游戏本身的品质,所有 SDK 的接入工作统统交给我们吧。第三方 SDK 包括了渠道SDK、用户系统、支付系统、广告系统、统计系统、分享系统等等。 */ +declare module anysdk { + /** !#en + agent manager of plugin + !#zh + 插件管理对象 */ + export var agentManager: anysdk.AgentManager; + /** !#en + agent manager of plugin + !#zh + 插件管理类 */ + export class AgentManager { + /** + !#en + AppKey appSecret and privateKey are the only three parameters generated + after the packing tool client finishes creating the game. + The oauthLoginServer parameter is the API address provided by the game service + to login verification + !#zh + appKey、appSecret、privateKey是通过 AnySDK 客户端工具创建游戏后生成的。 + oauthLoginServer参数是游戏服务提供的用来做登陆验证转发的接口地址。 + @param appKey appKey + @param appSecret appSecret + @param privateKey privateKey + @param oauthLoginServer oauthLoginServer + */ + init(appKey: string, appSecret: string, privateKey: string, oauthLoginServer: string): void; + /** + !#en + load all plugins, the operation includes SDK`s initialization + !#zh + 加载所有插件,该操作包含了 SDKs 初始化 + @param callback callback + @param target The object to bind to. + */ + loadAllPlugins(callback: Function, target: any): void; + /** + !#en + unload all plugins + !#zh + 卸载插件 + */ + unloadAllPlugins(): void; + /** + !#en + get user system plugin + !#zh + 获取用户系统插件 + */ + getUserPlugin(): anysdk.ProtocolUser; + /** + !#en + get IAP system plugins + !#zh + 获取支付系统插件 + */ + getIAPPlugins(): anysdk.ProtocolIAP[]; + /** + !#en + get IAP system plugin + !#zh + 获取支付系统插件 + */ + getIAPPlugin(): anysdk.ProtocolIAP; + /** + !#en + get social system plugin + !#zh + 获取社交系统插件 + */ + getSocialPlugin(): anysdk.ProtocolSocial; + /** + !#en + get share system plugin + !#zh + 获取分享系统插件 + */ + getSharePlugin(): anysdk.ProtocolShare; + /** + !#en + get analytics system plugin + !#zh + 获取统计系统插件 + */ + getAnalyticsPlugin(): anysdk.ProtocolAnalytics; + /** + !#en + get ads system plugin + !#zh + 获取广告系统插件 + */ + getAdsPlugin(): anysdk.ProtocolAds; + /** + !#en + get push system plugin + !#zh + 获取推送系统插件 + */ + getPushPlugin(): anysdk.ProtocolPush; + /** + !#en + get REC system plugin + !#zh + 获取录屏系统插件 + */ + getRECPlugin(): anysdk.ProtocolREC; + /** + !#en + get crash system plugin + !#zh + 获取崩溃分析系统插件 + */ + getCrashPlugin(): anysdk.ProtocolCrash; + /** + !#en + get ad track system plugin + !#zh + 获取广告追踪系统插件 + */ + getAdTrackingPlugin(): anysdk.ProtocolAdTracking; + /** + !#en + get custom system plugin + !#zh + 获取自定义系统插件 + */ + getCustomPlugin(): anysdk.ProtocolCustom; + /** + !#en + get custom parameter + !#zh + 获取自定义参数 + */ + getCustomParam(): string; + /** + !#en + get channel id + !#zh + 获取渠道唯一表示符 + */ + getChannelId(): string; + /** + !#en + get status of analytics + !#zh + 获取统计状态 + */ + isAnaylticsEnabled(): boolean; + /** + !#en + set whether to analytics + !#zh + 设置是否统计 + @param enabled enabled + */ + setIsAnaylticsEnabled(enabled: boolean): void; + /** + !#en + destory instance + !#zh + 销毁单例 + */ + static end(): void; + /** + !#en + get instance + !#zh + 获取单例 + */ + static getInstance(): anysdk.AgentManager; + } + /** !#en + plugin protocol + !#zh + 插件协议 */ + export class PluginProtocol { + /** + !#en + Check whether the function is supported + !#zh + 判断函数是否支持 + @param functionName functionName + */ + isFunctionSupported(functionName: string): boolean; + /** + !#en + get plugin name + !#zh + 获取插件名称 + */ + getPluginName(): string; + /** + !#en + get plugin version + !#zh + 获取插件版本 + */ + getPluginVersion(): string; + /** + !#en + get SDK version + !#zh + 获取 SDK 版本 + */ + getSDKVersion(): string; + /** + !#en + void methods for reflections with parameter + !#zh + 反射调用带参数的void方法 + @param funName funName + @param args optional arguments + */ + callFuncWithParam(funName: string, ...args: any|anysdk.PluginParam[]): void; + /** + !#en + String methods for reflections with parameter + !#zh + 反射调用带参数的 String 方法 + @param funName funName + @param args optional arguments + */ + callStringFuncWithParam(funName: string, ...args: any|anysdk.PluginParam[]): string; + /** + !#en + int methods for reflections with parameter + !#zh + 反射调用带参数的 Int 方法 + @param funName funName + @param args optional arguments + */ + callIntFuncWithParam(funName: string, ...args: any|anysdk.PluginParam[]): number; + /** + !#en + boolean methods for reflections with parameter + !#zh + 反射调用带参数的 boolean 方法 + @param funName funName + @param args optional arguments + */ + callBoolFuncWithParam(funName: string, ...args: any|anysdk.PluginParam[]): boolean; + /** + !#en + float methods for reflections with parameter + !#zh + 反射调用带参数的 float 方法 + @param funName funName + @param args optional arguments + */ + callFloatFuncWithParam(funName: string, ...args: any|anysdk.PluginParam[]): number; + } + /** !#en + user protocol + !#zh + 用户系统协议接口 */ + export class ProtocolUser extends PluginProtocol { + /** + !#en + login interface + !#zh + 登录接口 + @param args optional arguments + */ + login(...args: string|any[]): void; + /** + !#en + get status of login + !#zh + 获取登录状态 + */ + isLogined(): boolean; + /** + !#en + get user ID + !#zh + 获取用户唯一标示符 + */ + getUserID(): string; + /** + !#en + get plugin ID + !#zh + 获取插件ID + */ + getPluginId(): string; + /** + !#en + set listener + !#zh + 设置用户系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取用户系统的监听 + */ + getListener(): Function; + /** + !#en + logout + Before to invoke, you need to verdict whether this properties existed + !#zh + 登出,调用前需要判断属性是否存在 + */ + logout(): void; + /** + !#en + show toolbar + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示悬浮窗,调用前需要判断属性是否存在 + @param place place + */ + showToolBar(place: anysdk.ToolBarPlace): void; + /** + !#en + hide toolbar + Before to invoke, you need to verdict whether this properties existed + !#zh + 隐藏悬浮窗,调用前需要判断属性是否存在 + */ + hideToolBar(): void; + /** + !#en + enter platform + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示平台中心,调用前需要判断属性是否存在 + */ + enterPlatform(): void; + /** + !#en + show exit page + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示退出界面,调用前需要判断属性是否存在 + */ + exit(): void; + /** + !#en + show pause page + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示暂停界面,调用前需要判断属性是否存在 + */ + pause(): void; + /** + !#en + Real-name registration + Before to invoke, you need to verdict whether this properties existed + !#zh + 实名注册,调用前需要判断属性是否存在 + */ + realNameRegister(): void; + /** + !#en + Anti-addiction query + Before to invoke, you need to verdict whether this properties existed + !#zh + 防沉迷查询,调用前需要判断属性是否存在 + */ + antiAddictionQuery(): void; + /** + !#en + submit game role information + Before to invoke, you need to verdict whether this properties existed + !#zh + 提交角色信息,调用前需要判断属性是否存在 + @param data data + */ + submitLoginGameRole(data: any): void; + /** + !#en + get user information + Before to invoke, you need to verdict whether this properties existed + !#zh + 获取用户信息,调用前需要判断属性是否存在 + @param info info + */ + getUserInfo(info: any): void; + /** + !#en + set login type + Before to invoke, you need to verdict whether this properties existed + !#zh + 设置登录类型,调用前需要判断属性是否存在 + @param info info + */ + getAvailableLoginType(info: any): void; + /** + !#en + set login type + Before to invoke, you need to verdict whether this properties existed + !#zh + 设置登录类型,调用前需要判断属性是否存在 + @param loginType loginType + */ + setLoginType(loginType: string): void; + /** + !#en + send to desktop + Before to invoke, you need to verdict whether this properties existed + !#zh + 发送到桌面,调用前需要判断属性是否存在 + */ + sendToDesktop(): void; + /** + !#en + open bbs + Before to invoke, you need to verdict whether this properties existed + !#zh + 打开论坛,调用前需要判断属性是否存在 + */ + openBBS(): void; + } + /** !#en + IAP protocol + !#zh + 支付系统协议接口 */ + export class ProtocolIAP extends PluginProtocol { + /** + !#en + pay interface + !#zh + 支付接口 + @param info Type:map + */ + payForProduct(info: any): void; + /** + !#en + get order ID + !#zh + 获取订单ID + */ + getOrderId(): string; + /** + !#en + reset the pay status + !#zh + 重置支付状态 + */ + static resetPayState(): void; + /** + !#en + get plugin ID + !#zh + 获取插件ID + */ + getPluginId(): string; + /** + !#en + set listener + !#zh + 设置支付系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取支付系统的监听 + */ + getListener(): Function; + } + /** !#en + analytics protocol + !#zh + 统计系统协议接口 */ + export class ProtocolAnalytics extends PluginProtocol { + /** + !#en + Start a new session. + !#zh + 启动会话 + */ + startSession(): void; + /** + !#en + Stop a session. + !#zh + 关闭会话 + */ + stopSession(): void; + /** + !#en + Set the timeout for expiring a session. + !#zh + 设置会话超时时间 + @param millis Type: long + */ + setSessionContinueMillis(millis: number): void; + /** + !#en + log an error + !#zh + 捕捉异常 + @param errorId errorId + @param message message + */ + logError(errorId: string, message: string): void; + /** + !#en + log an event. + !#zh + 捕捉事件 + @param errorId errorId + @param args optional arguments Type: map + */ + logEvent(errorId: string, ...args: any[]): void; + /** + !#en + Track an event begin. + !#zh + 统计事件开始 + @param eventId eventId + */ + logTimedEventBegin(eventId: string): void; + /** + !#en + Track an event end. + !#zh + 统计事件结束 + @param eventId eventId + */ + logTimedEventEnd(eventId: string): void; + /** + !#en + set Whether to catch uncaught exceptions to server. + !#zh + 设置是否开启自动异常捕捉 + @param enabled enabled + */ + setCaptureUncaughtException(enabled: boolean): void; + /** + !#en + analytics account information + !#zh + 统计玩家帐户信息 + @param paramMap Type: map + */ + setAccount(paramMap: any): void; + /** + !#en + track user to request payment + !#zh + 跟踪用户支付请求 + @param paramMap Type: map + */ + onChargeRequest(paramMap: any): void; + /** + !#en + track Successful payment + !#zh + 追踪用户支付成功 + @param orderID orderID + */ + onChargeSuccess(orderID: string): void; + /** + !#en + track failed payment + !#zh + 追踪用户支付失败 + @param paramMap Type: map + */ + onChargeFail(paramMap: any): void; + /** + !#en + track Successful payment + !#zh + 统计玩家支付成功 + @param paramMap Type: map + */ + onChargeOnlySuccess(paramMap: any): void; + /** + !#en + track user purchase + !#zh + 统计玩家消费 + @param paramMap Type: map + */ + onPurchase(paramMap: any): void; + /** + !#en + track user to use goods + !#zh + 统计玩家使用道具 + @param paramMap Type: map + */ + onUse(paramMap: any): void; + /** + !#en + track user to reward goods + !#zh + 统计玩家获取奖励 + @param paramMap Type: map + */ + onReward(paramMap: any): void; + /** + !#en + start level + !#zh + 开始关卡 + @param paramMap Type: map + */ + startLevel(paramMap: any): void; + /** + !#en + finish level + !#zh + 结束关卡 + @param levelID levelID + */ + finishLevel(levelID: string): void; + /** + !#en + failed level + !#zh + 关卡失败 + @param paramMap Type: map + */ + failLevel(paramMap: any): void; + /** + !#en + start task + !#zh + 开始任务 + @param paramMap Type: map + */ + startTask(paramMap: any): void; + /** + !#en + finish task + !#zh + 完成任务 + @param taskID taskID + */ + finishTask(taskID: string): void; + /** + !#en + failed task + !#zh + 任务失败 + @param paramMap Type: map + */ + failTask(paramMap: any): void; + } + /** !#en + share protocol + !#zh + 分享系统协议接口 */ + export class ProtocolShare extends PluginProtocol { + /** + !#en + share interface + !#zh + 分享 + @param info Type: map + */ + share(info: any): void; + /** + !#en + set listener + !#zh + 设置分享系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取分享系统的监听 + */ + getListener(): Function; + } + /** !#en + ads protocol + !#zh + 广告系统协议接口 */ + export class ProtocolAds extends PluginProtocol { + /** + !#en + hide ads view + !#zh + 隐藏广告 + @param adstype adstype + @param idx idx + */ + hideAds(adstype: anysdk.AdsType, idx: number): void; + /** + !#en + preload ads view + !#zh + 预加载广告 + @param adstype adstype + @param idx idx + */ + preloadAds(adstype: anysdk.AdsType, idx: number): void; + /** + !#en + query points + !#zh + 查询分数 + */ + queryPoints(): number; + /** + !#en + get whether the ads type is supported + !#zh + 获取广告类型是否支持 + @param arg0 arg0 + */ + isAdTypeSupported(arg0: anysdk.AdsType): boolean; + /** + !#en + spend point + !#zh + 消费分数 + @param points points + */ + spendPoints(points: number): void; + /** + !#en + set listener + !#zh + 设置广告系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取广告系统的监听 + */ + getListener(): Function; + } + /** !#en + social protocol + !#zh + 社交系统协议接口 */ + export class ProtocolSocial extends PluginProtocol { + /** + !#en + sign in + !#zh + 登录 + */ + signIn(): void; + /** + !#en + sign out + !#zh + 登出 + */ + signOut(): void; + /** + !#en + submit score + !#zh + 提交分数 + @param leadboardID leadboardID + @param score Type: long + */ + submitScore(leadboardID: string, score: number): void; + /** + !#en + show the id of Leaderboard page + !#zh + 根据唯一标识符显示排行榜 + @param leaderboardID leaderboardID + */ + showLeaderboard(leaderboardID: string): void; + /** + !#en + show the page of achievements + !#zh + 显示成就榜 + */ + showAchievements(): void; + /** + !#en + unlock achievement + !#zh + 解锁成就 + @param info Type: map + */ + share(info: any): void; + /** + !#en + set listener + !#zh + 设置社交系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取社交系统的监听 + */ + getListener(): Function; + /** + !#en + get friends info + Before to invoke, you need to verdict whether this properties existed + !#zh + 获取好友信息,调用前需要判断属性是否存在 + */ + pauseRecording(): void; + /** + !#en + interact + Before to invoke, you need to verdict whether this properties existed + !#zh + 订阅,调用前需要判断属性是否存在 + */ + interact(): void; + /** + !#en + subscribe + Before to invoke, you need to verdict whether this properties existed + !#zh + 关注,调用前需要判断属性是否存在 + */ + subscribe(): void; + } + /** !#en + push protocol + !#zh + 推送系统协议接口 */ + export class ProtocolPush extends PluginProtocol { + /** + !#en + start Push services + !#zh + 启动推送服务 + */ + startPush(): void; + /** + !#en + close Push services + !#zh + 暂停推送服务 + */ + closePush(): void; + /** + !#en + delete alias + !#zh + 删除别名 + @param alias alias + */ + delAlias(alias: string): void; + /** + !#en + set alias + !#zh + 设置别名 + @param alias alias + */ + setAlias(alias: string): void; + /** + !#en + delete tags + !#zh + 删除标签 + @param tags Type: list + */ + delTags(tags: any): void; + /** + !#en + set tags + !#zh + 设置标签 + @param tags Type: list + */ + setTags(tags: any): void; + /** + !#en + set listener + !#zh + 设置推送系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取推送系统的监听 + */ + getListener(): Function; + } + /** !#en + crash protocol + !#zh + 崩溃分析系统协议接口 */ + export class ProtocolCrash extends PluginProtocol { + /** + !#en + set user identifier + !#zh + 统计用户唯一标识符 + @param identifier identifier + */ + setUserIdentifier(identifier: string): void; + /** + !#en + The uploader captured in exception information + !#zh + 上报异常信息 + @param message message + @param exception exception + */ + reportException(message: string, exception: string): void; + /** + !#en + customize logging + !#zh + 自定义日志记录 + @param breadcrumb breadcrumb + */ + leaveBreadcrumb(breadcrumb: string): void; + } + /** !#en + REC protocol + !#zh + 录屏系统协议接口 */ + export class ProtocolREC extends PluginProtocol { + /** + !#en + share video + !#zh + 分享视频 + @param info Type: map + */ + share(info: any): void; + /** + !#en + Start to record video + !#zh + 开始录制视频 + */ + startRecording(): void; + /** + !#en + Start to record video + !#zh + 结束录制视频 + */ + stopRecording(): void; + /** + !#en + set listener + !#zh + 设置录屏系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取录屏系统的监听 + */ + getListener(): Function; + /** + !#en + pause to record video + Before to invoke, you need to verdict whether this properties existed + !#zh + 暂停录制视频,调用前需要判断属性是否存在 + */ + pauseRecording(): void; + /** + !#en + resume to record video + Before to invoke, you need to verdict whether this properties existed + !#zh + 恢复录制视频,调用前需要判断属性是否存在 + */ + resumeRecording(): void; + /** + !#en + get whether the device is isAvailable + Before to invoke, you need to verdict whether this properties existed + !#zh + 获取设备是否可用,调用前需要判断属性是否存在 + */ + isAvailable(): boolean; + /** + !#en + get status of recording + Before to invoke, you need to verdict whether this properties existed + !#zh + 获取录制状态,调用前需要判断属性是否存在 + */ + isRecording(): boolean; + /** + !#en + show toolbar + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示悬浮窗,调用前需要判断属性是否存在 + */ + showToolBar(): void; + /** + !#en + hide toolbar + Before to invoke, you need to verdict whether this properties existed + !#zh + 隐藏悬浮窗,调用前需要判断属性是否存在 + */ + hideToolBar(): void; + /** + !#en + show video center + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示视频中心,调用前需要判断属性是否存在 + */ + showVideoCenter(): void; + /** + !#en + enter platform + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示平台中心,调用前需要判断属性是否存在 + */ + enterPlatform(): void; + /** + !#en + Set the video data, it is recommended to check whether are recorded firstly + Before to invoke, you need to verdict whether this properties existed + !#zh + 设置视频相关数据,建议先检查是否是正在录制,调用前需要判断属性是否存在 + @param info Type: map + */ + setMetaData(info: any): void; + } + /** !#en + ad tracking protocol + !#zh + 广告追踪系统协议接口 */ + export class ProtocolAdTracking extends PluginProtocol { + /** + !#en + Call this method if you want to track register events as happening during a section. + !#zh + 统计用户注册信息 + @param productInfo Type: map + */ + onPay(productInfo: any): void; + /** + !#en + Call this method if you want to track register events as happening during a section. + !#zh + 统计用户注册信息 + @param userInfo Type: map + */ + onLogin(userInfo: any): void; + /** + !#en + Call this method if you want to track register events as happening during a section. + !#zh + 统计用户注册信息 + @param userId userId + */ + onRegister(userId: string): void; + /** + !#en + Call this method if you want to track custom events with parameters as happening during a section. + !#zh + 统计自定义事件 + @param eventId eventId + @param paramMap Type: map + */ + trackEvent(eventId: string, paramMap: any): void; + /** + !#en + Call this method with parameters if you want to create role as happening during a section. + !#zh + 统计创建角色事件,调用前需要判断属性是否存在 + @param userInfo Type: map + */ + onCreateRole(userInfo: any): void; + /** + !#en + Call this method if you want to track levelup events with parameters as happening during a section. + Before to invoke, you need to verdict whether this properties existed + !#zh + 统计角色升级事件,调用前需要判断属性是否存在 + @param info Type: map + */ + onLevelUp(info: any): void; + /** + !#en + Invoke this method with parameters if you want to start to pay as happening during a section. + Before to invoke, you need to verdict whether this properties existed + !#zh + 统计开始充值事件,调用前需要判断属性是否存在 + @param info Type: map + */ + onStartToPay(info: any): void; + } + /** !#en + custom protocol + !#zh + 自定义系统协议接口 */ + export class ProtocolCustom extends PluginProtocol { + /** + !#en + set listener + !#zh + 设置自定义系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取自定义系统的监听 + */ + getListener(): Function; + } + /** !#en + Data structure class + !#zh + 数据结构类 */ + export class PluginParam { + /** + !#en + create plugin parameters + !#zh + 创建对象 + @param parameters parameters + */ + static create(parameters: number|string|any): anysdk.PluginParam; + } + /** !#en The callback of user system + !#zh 用户系统回调 */ + export enum UserActionResultCode { + kInitSuccess = 0, + kInitFail = 0, + kLoginSuccess = 0, + kLoginNetworkError = 0, + kLoginNoNeed = 0, + kLoginFail = 0, + kLoginCancel = 0, + kLogoutSuccess = 0, + kLogoutFail = 0, + kPlatformEnter = 0, + kPlatformBack = 0, + kPausePage = 0, + kExitPage = 0, + kAntiAddictionQuery = 0, + kRealNameRegister = 0, + kAccountSwitchSuccess = 0, + kAccountSwitchFail = 0, + kOpenShop = 0, + kAccountSwitchCancel = 0, + kUserExtension = 0, + kSendToDesktopSuccess = 0, + kSendToDesktopFail = 0, + kGetAvailableLoginTypeSuccess = 0, + kGetAvailableLoginTypeFail = 0, + kGetUserInfoSuccess = 0, + kGetUserInfoFail = 0, + kOpenBBSSuccess = 0, + kOpenBBSFail = 0, + } + /** !#en The toolbar position of user type + !#zh 用户系统悬浮窗位置 */ + export enum ToolBarPlace { + kToolBarTopLeft = 0, + kToolBarTopRight = 0, + kToolBarMidLeft = 0, + kToolBarMidRight = 0, + kToolBarBottomLeft = 0, + kToolBarBottomRight = 0, + } + /** !#en The callback of requesting reStringge + !#zh 支付系统支付请求回调 */ + export enum PayResultCode { + kPaySuccess = 0, + kPayFail = 0, + kPayCancel = 0, + kPayNetworkError = 0, + kPayProductionInforIncomplete = 0, + kPayInitSuccess = 0, + kPayInitFail = 0, + kPayNowPaying = 0, + kPayReStringgeSuccess = 0, + kPayExtension = 0, + kPayNeedLoginAgain = 0, + kRequestSuccess = 0, + kRequestFail = 0, + } + /** !#en The enum of account type + !#zh 统计系统的账号类型 */ + export enum AccountType { + ANONYMOUS = 0, + REGISTED = 0, + SINA_WEIBO = 0, + TENCENT_WEIBO = 0, + QQ = 0, + ND91 = 0, + } + /** !#en The enum of account operation + !#zh 统计系统的账号操作 */ + export enum AccountOperate { + LOGIN = 0, + LOGOUT = 0, + REGISTER = 0, + } + /** !#en The enum of gender + !#zh 统计系统的账号性别 */ + export enum AccountGender { + MALE = 0, + FEMALE = 0, + UNKNOWN = 0, + } + /** !#en The enum of task type + !#zh 统计系统的任务类型 */ + export enum TaskType { + GUIDE_LINE = 0, + MAIN_LINE = 0, + BRANCH_LINE = 0, + DAILY = 0, + ACTIVITY = 0, + OTHER = 0, + } + /** !#en The callback of share system + !#zh 分享系统回调 */ + export enum ShareResultCode { + kShareSuccess = 0, + kShareFail = 0, + kShareCancel = 0, + kShareNetworkError = 0, + kShareExtension = 0, + } + /** !#en The callback of social system + !#zh 社交系统回调 */ + export enum SocialRetCode { + kScoreSubmitSucceed = 0, + kScoreSubmitfail = 0, + kAchUnlockSucceed = 0, + kAchUnlockFail = 0, + kSocialSignInSucceed = 0, + kSocialSignInFail = 0, + kSocialSignOutSucceed = 0, + kSocialSignOutFail = 0, + kSocialGetGameFriends = 0, + kSocialExtensionCode = 0, + kSocialGetFriendsInfoSuccess = 0, + kSocialGetFriendsInfoFail = 0, + kSocialAlreadySubscription = 0, + kSocialNoSubscription = 0, + kSocialSubscriptionFail = 0, + } + /** !#en The callback of ads system + !#zh 广告系统回调 */ + export enum AdsResultCode { + kAdsReceived = 0, + kAdsShown = 0, + kAdsDismissed = 0, + kPointsSpendSucceed = 0, + kPointsSpendFailed = 0, + kNetworkError = 0, + kUnknownError = 0, + kOfferWallOnPointsChanged = 0, + kRewardedVideoWithReward = 0, + kInAppPurchaseFinished = 0, + kAdsClicked = 0, + kAdsExtension = 0, + } + /** !#en The enum of ads position + !#zh 广告位置 */ + export enum AdsPos { + kPosCenter = 0, + kPosTop = 0, + kPosTopLeft = 0, + kPosTopRight = 0, + kPosBottom = 0, + kPosBottomLeft = 0, + kPosBottomRight = 0, + } + /** !#en The enum of ads type + !#zh 广告类型 */ + export enum AdsType { + AD_TYPE_BANNER = 0, + AD_TYPE_FULLSCREEN = 0, + AD_TYPE_MOREAPP = 0, + AD_TYPE_OFFERWALL = 0, + AD_TYPE_REWARDEDVIDEO = 0, + AD_TYPE_NATIVEEXPRESS = 0, + AD_TYPE_NATIVEADVANCED = 0, + } + /** !#en The callback of push system + !#zh 推送系统回调 */ + export enum PushActionResultCode { + kPushReceiveMessage = 0, + kPushExtensionCode = 0, + } + /** !#en The callback of custom system + !#zh 自定义系统回调 */ + export enum CustomResultCode { + kCustomExtension = 0, + } + /** !#en The callback of REC system + !#zh 录屏系统回调 */ + export enum RECResultCode { + kRECInitSuccess = 0, + kRECInitFail = 0, + kRECStartRecording = 0, + kRECStopRecording = 0, + kRECPauseRecording = 0, + kRECResumeRecording = 0, + kRECEnterSDKPage = 0, + kRECQuitSDKPage = 0, + kRECShareSuccess = 0, + kRECShareFail = 0, + kRECExtension = 0, + } +} + +/** !#en +The global main namespace of Spine, all classes, functions, +properties and constants of Spine are defined in this namespace +!#zh +Spine 的全局的命名空间, +与 Spine 相关的所有的类,函数,属性,常量都在这个命名空间中定义。 */ +declare module sp { + /** !#en + The skeleton of Spine
+
+ (Skeleton has a reference to a SkeletonData and stores the state for skeleton instance, + which consists of the current pose's bone SRT, slot colors, and which slot attachments are visible.
+ Multiple skeletons can use the same SkeletonData which includes all animations, skins, and attachments.)
+ !#zh + Spine 骨骼动画
+
+ (Skeleton 具有对骨骼数据的引用并且存储了骨骼实例的状态, + 它由当前的骨骼动作,slot 颜色,和可见的 slot attachments 组成。
+ 多个 Skeleton 可以使用相同的骨骼数据,其中包括所有的动画,皮肤和 attachments。 */ + export class Skeleton extends cc._RendererUnderSG { + /** !#en The skeletal animation is paused? + !#zh 该骨骼动画是否暂停。 */ + paused: boolean; + /** !#en + The skeleton data contains the skeleton information (bind pose bones, slots, draw order, + attachments, skins, etc) and animations but does not hold any state.
+ Multiple skeletons can share the same skeleton data. + !#zh + 骨骼数据包含了骨骼信息(绑定骨骼动作,slots,渲染顺序, + attachments,皮肤等等)和动画但不持有任何状态。
+ 多个 Skeleton 可以共用相同的骨骼数据。 */ + skeletonData: SkeletonData; + /** !#en The name of default skin. + !#zh 默认的皮肤名称。 */ + defaultSkin: string; + /** !#en The name of default animation. + !#zh 默认的动画名称。 */ + defaultAnimation: string; + /** !#en The name of current playing animation. + !#zh 当前播放的动画名称。 */ + animation: string; + _defaultSkinIndex: number; + /** !#en TODO + !#zh 是否循环播放当前骨骼动画。 */ + loop: boolean; + /** !#en Indicates whether to enable premultiplied alpha. + You should disable this option when image's transparent area appears to have opaque pixels, + or enable this option when image's half transparent area appears to be darken. + !#zh 是否启用贴图预乘。 + 当图片的透明区域出现色块时需要关闭该选项,当图片的半透明区域颜色变黑时需要启用该选项。 */ + premultipliedAlpha: boolean; + /** !#en The time scale of this skeleton. + !#zh 当前骨骼中所有动画的时间缩放率。 */ + timeScale: number; + /** !#en Indicates whether open debug slots. + !#zh 是否显示 slot 的 debug 信息。 */ + debugSlots: boolean; + /** !#en Indicates whether open debug bones. + !#zh 是否显示 bone 的 debug 信息。 */ + debugBones: boolean; + /** + !#en Computes the world SRT from the local SRT for each bone. + !#zh 重新更新所有骨骼的世界 Transform, + 当获取 bone 的数值未更新时,即可使用该函数进行更新数值。 + + @example + ```js + var bone = spine.findBone('head'); + cc.log(bone.worldX); // return 0; + spine.updateWorldTransform(); + bone = spine.findBone('head'); + cc.log(bone.worldX); // return -23.12; + ``` + */ + updateWorldTransform(): void; + /** + !#en Sets the bones and slots to the setup pose. + !#zh 还原到起始动作 + */ + setToSetupPose(): void; + /** + !#en + Sets the bones to the setup pose, + using the values from the `BoneData` list in the `SkeletonData`. + !#zh + 设置 bone 到起始动作 + 使用 SkeletonData 中的 BoneData 列表中的值。 + */ + setBonesToSetupPose(): void; + /** + !#en + Sets the slots to the setup pose, + using the values from the `SlotData` list in the `SkeletonData`. + !#zh + 设置 slot 到起始动作。 + 使用 SkeletonData 中的 SlotData 列表中的值。 + */ + setSlotsToSetupPose(): void; + /** + !#en + Finds a bone by name. + This does a string comparison for every bone.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Bone object. + !#zh + 通过名称查找 bone。 + 这里对每个 bone 的名称进行了对比。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Bone 对象。 + @param boneName boneName + */ + findBone(boneName: string): sp.spine.Bone; + /** + !#en + Finds a slot by name. This does a string comparison for every slot.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Slot object. + !#zh + 通过名称查找 slot。这里对每个 slot 的名称进行了比较。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Slot 对象。 + @param slotName slotName + */ + findSlot(slotName: string): sp.spine.Slot; + /** + !#en + Finds a skin by name and makes it the active skin. + This does a string comparison for every skin.
+ Note that setting the skin does not change which attachments are visible.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Skin object. + !#zh + 按名称查找皮肤,激活该皮肤。这里对每个皮肤的名称进行了比较。
+ 注意:设置皮肤不会改变 attachment 的可见性。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Skin 对象。 + @param skinName skinName + */ + setSkin(skinName: string): sp.spine.Skin; + /** + !#en + Returns the attachment for the slot and attachment name. + The skeleton looks first in its skin, then in the skeleton data’s default skin.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Attachment object. + !#zh + 通过 slot 和 attachment 的名称获取 attachment。Skeleton 优先查找它的皮肤,然后才是 Skeleton Data 中默认的皮肤。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Attachment 对象。 + @param slotName slotName + @param attachmentName attachmentName + */ + getAttachment(slotName: string, attachmentName: string): sp.spine.Attachment; + /** + !#en + Sets the attachment for the slot and attachment name. + The skeleton looks first in its skin, then in the skeleton data’s default skin. + !#zh + 通过 slot 和 attachment 的名字来设置 attachment。 + Skeleton 优先查找它的皮肤,然后才是 Skeleton Data 中默认的皮肤。 + @param slotName slotName + @param attachmentName attachmentName + */ + setAttachment(slotName: string, attachmentName: string): void; + /** + !#en + Sets runtime skeleton data to sp.Skeleton.
+ This method is different from the `skeletonData` property. This method is passed in the raw data provided by the Spine runtime, and the skeletonData type is the asset type provided by Creator. + !#zh + 设置底层运行时用到的 SkeletonData。
+ 这个接口有别于 `skeletonData` 属性,这个接口传入的是 Spine runtime 提供的原始数据,而 skeletonData 的类型是 Creator 提供的资源类型。 + @param skeletonData skeletonData + @param ownsSkeletonData ownsSkeletonData + */ + setSkeletonData(skeletonData: sp.spine.SkeletonData, ownsSkeletonData: sp.spine.SkeletonData): void; + /** + !#en Sets animation state data.
+ The parameter type is {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.AnimationStateData. + !#zh 设置动画状态数据。
+ 参数是 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.AnimationStateData。 + @param stateData stateData + */ + setAnimationStateData(stateData: sp.spine.AnimationStateData): void; + /** + !#en + Mix applies all keyframe values, + interpolated for the specified time and mixed with the current values. + !#zh 为所有关键帧设定混合及混合时间(从当前值开始差值)。 + @param fromAnimation fromAnimation + @param toAnimation toAnimation + @param duration duration + */ + setMix(fromAnimation: string, toAnimation: string, duration: number): void; + /** + !#en Sets event listener. + !#zh 设置动画事件监听器。 + @param target target + @param callback callback + */ + setAnimationListener(target: any, callback: Function): void; + /** + !#en Set the current animation. Any queued animations are cleared.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry object. + !#zh 设置当前动画。队列中的任何的动画将被清除。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry 对象。 + @param trackIndex trackIndex + @param name name + @param loop loop + */ + setAnimation(trackIndex: number, name: string, loop: boolean): sp.spine.TrackEntry; + /** + !#en Adds an animation to be played delay seconds after the current or last queued animation.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry object. + !#zh 添加一个动画到动画队列尾部,还可以延迟指定的秒数。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry 对象。 + @param trackIndex trackIndex + @param name name + @param loop loop + @param delay delay + */ + addAnimation(trackIndex: number, name: string, loop: boolean, delay?: number): sp.spine.TrackEntry; + /** + !#en Find animation with specified name. + !#zh 查找指定名称的动画 + @param name name + */ + findAnimation(name: string): sp.spine.Animation; + /** + !#en Returns track entry by trackIndex.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry object. + !#zh 通过 track 索引获取 TrackEntry。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry 对象。 + @param trackIndex trackIndex + */ + getCurrent(trackIndex: void): sp.spine.TrackEntry; + /** + !#en Clears all tracks of animation state. + !#zh 清除所有 track 的动画状态。 + */ + clearTracks(): void; + /** + !#en Clears track of animation state by trackIndex. + !#zh 清除出指定 track 的动画状态。 + @param trackIndex trackIndex + */ + clearTrack(trackIndex: number): void; + /** + !#en Set the start event listener. + !#zh 用来设置开始播放动画的事件监听。 + @param listener listener + */ + setStartListener(listener: Function): void; + /** + !#en Set the interrupt event listener. + !#zh 用来设置动画被打断的事件监听。 + @param listener listener + */ + setInterruptListener(listener: Function): void; + /** + !#en Set the end event listener. + !#zh 用来设置动画播放完后的事件监听。 + @param listener listener + */ + setEndListener(listener: Function): void; + /** + !#en Set the dispose event listener. + !#zh 用来设置动画将被销毁的事件监听。 + @param listener listener + */ + setDisposeListener(listener: Function): void; + /** + !#en Set the complete event listener. + !#zh 用来设置动画播放一次循环结束后的事件监听。 + @param listener listener + */ + setCompleteListener(listener: Function): void; + /** + !#en Set the animation event listener. + !#zh 用来设置动画播放过程中帧事件的监听。 + @param listener listener + */ + setEventListener(listener: Function): void; + /** + !#en Set the start event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画开始播放的事件监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackStartListener(entry: sp.spine.TrackEntry, listener: Function): void; + /** + !#en Set the interrupt event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画被打断的事件监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackInterruptListener(entry: sp.spine.TrackEntry, listener: Function): void; + /** + !#en Set the end event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画播放结束的事件监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackEndListener(entry: sp.spine.TrackEntry, listener: Function): void; + /** + !#en Set the dispose event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画即将被销毁的事件监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackDisposeListener(entry: sp.spine.TrackEntry, listener: Function): void; + /** + !#en Set the complete event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画一次循环播放结束的事件监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackCompleteListener(entry: sp.spine.TrackEntry, listener: Function): void; + /** + !#en Set the event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画帧事件的监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackEventListener(entry: sp.spine.TrackEntry, listener: Function): void; + } + /** !#en The skeleton data of spine. + !#zh Spine 的 骨骼数据。 */ + export class SkeletonData extends cc.Asset { + /** !#en See http://en.esotericsoftware.com/spine-json-format + !#zh 可查看 Spine 官方文档 http://zh.esotericsoftware.com/spine-json-format */ + skeletonJson: any; + atlasText: string; + textures: cc.Texture2D[]; + /** !#en + A scale can be specified on the JSON or binary loader which will scale the bone positions, + image sizes, and animation translations. + This can be useful when using different sized images than were used when designing the skeleton + in Spine. For example, if using images that are half the size than were used in Spine, + a scale of 0.5 can be used. This is commonly used for games that can run with either low or high + resolution texture atlases. + see http://en.esotericsoftware.com/spine-using-runtimes#Scaling + !#zh 可查看 Spine 官方文档: http://zh.esotericsoftware.com/spine-using-runtimes#Scaling */ + scale: number; + /** + !#en Get the included SkeletonData used in spine runtime.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.SkeletonData object. + !#zh 获取 Spine Runtime 使用的 SkeletonData。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.SkeletonData 对象。 + @param quiet quiet + */ + getRuntimeData(quiet?: boolean): sp.spine.SkeletonData; + } + /** !#en The event type of spine skeleton animation. + !#zh 骨骼动画事件类型。 */ + export enum AnimationEventType { + START = 0, + END = 0, + COMPLETE = 0, + EVENT = 0, + } +} + +/** !#en +`sp.spine` is the namespace for official Spine Runtime, which officially implemented and maintained by Spine.
+Please refer to the official documentation for its detailed usage: [http://en.esotericsoftware.com/spine-using-runtimes](http://en.esotericsoftware.com/spine-using-runtimes) +!#zh +sp.spine 模块是 Spine 官方运行库的 API 入口,由 Spine 官方统一实现和维护,具体用法请参考:[http://zh.esotericsoftware.com/spine-using-runtimes](http://zh.esotericsoftware.com/spine-using-runtimes) */ +declare module sp.spine { +} + +/** !#en Some JavaScript decorators which can be accessed with "cc._decorator". +!#zh 一些 JavaScript 装饰器,目前可以通过 "cc._decorator" 来访问。 +(这些 API 仍不完全稳定,有可能随着 JavaScript 装饰器的标准实现而调整) */ +declare module cc._decorator { + /** + !#en + Declare the standard [ES6 Class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) + as CCClass, please see [Class](/docs/editors_and_tools/creator-chapters/scripting/class/) for details. + !#zh + 将标准写法的 [ES6 Class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) 声明为 CCClass,具体用法请参阅[类型定义](/docs/creator/scripting/class/)。 + @param name The class name used for serialization. + + @example + ```js + const {ccclass} = cc._decorator; + + // define a CCClass, omit the name + @ccclass + class NewScript extends cc.Component { + // ... + } + + // define a CCClass with a name + @ccclass('LoginData') + class LoginData { + // ... + } + ``` + */ + export function ccclass(name?: string): Function; + export function ccclass(_class?: Function): void; + /** + !#en + Declare property for [CCClass](/docs/editors_and_tools/creator-chapters/scripting/class/). + !#zh + 定义 [CCClass](/docs/creator/scripting/class/) 所用的属性。 + @param options an object with some property attributes + + @example + ```js + const {ccclass, property} = cc._decorator; + + @ccclass + class NewScript extends cc.Component { + @property({ + type: cc.Node + }) + targetNode1 = null; + + @property(cc.Node) + targetNode2 = null; + + @property(cc.Button) + targetButton = null; + + @property + _width = 100; + + @property + get width () { + return this._width; + } + + @property + set width (value) { + this._width = value; + } + + @property + offset = new cc.Vec2(100, 100); + + @property(cc.Vec2) + offsets = []; + + @property(cc.Texture2D) + texture = ""; + } + + // above is equivalent to (上面的代码相当于): + + var NewScript = cc.Class({ + properties: { + targetNode1: { + default: null, + type: cc.Node + }, + + targetNode2: { + default: null, + type: cc.Node + }, + + targetButton: { + default: null, + type: cc.Button + }, + + _width: 100, + + width: { + get () { + return this._width; + }, + set (value) { + this._width = value; + } + }, + + offset: new cc.Vec2(100, 100) + + offsets: { + default: [], + type: cc.Vec2 + } + + texture: { + default: "", + url: cc.Texture2D + }, + } + }); + ``` + */ + export function property(options?: {type?: any; url?: typeof cc.RawAsset; visible?: boolean|(() => boolean); displayName?: string; tooltip?: string; multiline?: boolean; readonly?: boolean; min?: number; max?: number; step?: number; range?: number[]; slide?: boolean; serializable?: boolean; formerlySerializedAs?: string; editorOnly?: boolean; override?: boolean; animatable?: boolean} | any[]|Function|cc.ValueType|number|string|boolean): Function; + export function property(_target: Object, _key: any, _desc?: any): void; + /** + !#en + Makes a CCClass that inherit from component execute in edit mode.
+ By default, all components are only executed in play mode, + which means they will not have their callback functions executed while the Editor is in edit mode. + !#zh + 允许继承自 Component 的 CCClass 在编辑器里执行。
+ 默认情况下,所有 Component 都只会在运行时才会执行,也就是说它们的生命周期回调不会在编辑器里触发。 + + @example + ```js + const {ccclass, executeInEditMode} = cc._decorator; + + @ccclass + @executeInEditMode + class NewScript extends cc.Component { + // ... + } + ``` + */ + export function executeInEditMode(): Function; + export function executeInEditMode(_class: Function): void; + /** + !#en + Automatically add required component as a dependency for the CCClass that inherit from component. + !#zh + 为声明为 CCClass 的组件添加依赖的其它组件。当组件添加到节点上时,如果依赖的组件不存在,引擎将会自动将依赖组件添加到同一个节点,防止脚本出错。该设置在运行时同样有效。 + @param requiredComponent requiredComponent + + @example + ```js + const {ccclass, requireComponent} = cc._decorator; + + @ccclass + @requireComponent(cc.Sprite) + class SpriteCtrl extends cc.Component { + // ... + } + ``` + */ + export function requireComponent(requiredComponent: typeof cc.Component): Function; + /** + !#en + The menu path to register a component to the editors "Component" menu. Eg. "Rendering/CameraCtrl". + !#zh + 将当前组件添加到组件菜单中,方便用户查找。例如 "Rendering/CameraCtrl"。 + @param path The path is the menu represented like a pathname. + For example the menu could be "Rendering/CameraCtrl". + + @example + ```js + const {ccclass, menu} = cc._decorator; + + @ccclass + @menu("Rendering/CameraCtrl") + class NewScript extends cc.Component { + // ... + } + ``` + */ + export function menu(path: string): Function; + /** + !#en + The execution order of lifecycle methods for Component. + Those less than 0 will execute before while those greater than 0 will execute after. + The order will only affect onLoad, onEnable, start, update and lateUpdate while onDisable and onDestroy will not be affected. + !#zh + 设置脚本生命周期方法调用的优先级。优先级小于 0 的组件将会优先执行,优先级大于 0 的组件将会延后执行。优先级仅会影响 onLoad, onEnable, start, update 和 lateUpdate,而 onDisable 和 onDestroy 不受影响。 + @param order The execution order of lifecycle methods for Component. Those less than 0 will execute before while those greater than 0 will execute after. + + @example + ```js + const {ccclass, executionOrder} = cc._decorator; + + @ccclass + @executionOrder(1) + class CameraCtrl extends cc.Component { + // ... + } + ``` + */ + export function executionOrder(order: number): Function; + /** + !#en + Prevents Component of the same type (or subtype) to be added more than once to a Node. + !#zh + 防止多个相同类型(或子类型)的组件被添加到同一个节点。 + + @example + ```js + const {ccclass, disallowMultiple} = cc._decorator; + + @ccclass + @disallowMultiple + class CameraCtrl extends cc.Component { + // ... + } + ``` + */ + export function disallowMultiple(): Function; + export function disallowMultiple(_class: Function): void; + /** + !#en + If specified, the editor's scene view will keep updating this node in 60 fps when it is selected, otherwise, it will update only if necessary.
+ This property is only available if executeInEditMode is true. + !#zh + 当指定了 "executeInEditMode" 以后,playOnFocus 可以在选中当前组件所在的节点时,提高编辑器的场景刷新频率到 60 FPS,否则场景就只会在必要的时候进行重绘。 + + @example + ```js + const {ccclass, playOnFocus, executeInEditMode} = cc._decorator; + + @ccclass + @executeInEditMode + @playOnFocus + class CameraCtrl extends cc.Component { + // ... + } + ``` + */ + export function playOnFocus(): Function; + export function playOnFocus(_class: Function): void; + /** + !#en + Specifying the url of the custom html to draw the component in **Properties**. + !#zh + 自定义当前组件在 **属性检查器** 中渲染时所用的网页 url。 + @param url url + + @example + ```js + const {ccclass, inspector} = cc._decorator; + + @ccclass + @inspector("packages://inspector/inspectors/comps/camera-ctrl.js") + class NewScript extends cc.Component { + // ... + } + ``` + */ + export function inspector(path: string): Function; + /** + !#en + The custom documentation URL. + !#zh + 指定当前组件的帮助文档的 url,设置过后,在 **属性检查器** 中就会出现一个帮助图标,用户点击将打开指定的网页。 + @param url url + + @example + ```js + const {ccclass, help} = cc._decorator; + + @ccclass + @help("app://docs/html/components/spine.html") + class NewScript extends cc.Component { + // ... + } + ``` + */ + export function help(path: string): Function; + /** + NOTE:
+ The old mixins implemented in cc.Class(ES5) behaves exact the same as multiple inheritance. + But since ES6, class constructor can't be function-called and class methods become non-enumerable, + so we can not mix in ES6 Classes.
+ See:
+ [https://esdiscuss.org/topic/traits-are-now-impossible-in-es6-until-es7-since-rev32](https://esdiscuss.org/topic/traits-are-now-impossible-in-es6-until-es7-since-rev32)
+ One possible solution (but IDE unfriendly):
+ [http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes](http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/)
+
+ NOTE:
+ You must manually call mixins constructor, this is different from cc.Class(ES5). + @param ctor constructors to mix, only support ES5 constructors or classes defined by using `cc.Class`, + not support ES6 Classes. + + @example + ```js + const {ccclass, mixins} = cc._decorator; + + class Animal { ... } + + const Fly = cc.Class({ + constructor () { ... } + }); + + @ccclass + @mixins(cc.EventTarget, Fly) + class Bird extends Animal { + constructor () { + super(); + + // You must manually call mixins constructor, this is different from cc.Class(ES5) + cc.EventTarget.call(this); + Fly.call(this); + } + // ... + } + ``` + */ + export function mixins(ctor: Function, ...rest: Function[]): Function; +} + +/** This module provides some JavaScript utilities. +All members can be accessed with "cc.js". */ +declare module cc.js { + /** + Check the obj whether is number or not + If a number is created by using 'new Number(10086)', the typeof it will be "object"... + Then you can use this function if you care about this case. + @param obj obj + */ + export function isNumber(obj: any): boolean; + /** + Check the obj whether is string or not. + If a string is created by using 'new String("blabla")', the typeof it will be "object"... + Then you can use this function if you care about this case. + @param obj obj + */ + export function isString(obj: any): boolean; + /** + This method is deprecated, use cc.js.mixin please.
+ Copy all properties not defined in obj from arguments[1...n] + @param obj object to extend its properties + @param sourceObj source object to copy properties from + */ + export function addon(obj: any, ...sourceObj: any[]): any; + /** + copy all properties from arguments[1...n] to obj + @param obj obj + @param sourceObj sourceObj + */ + export function mixin(obj: any, ...sourceObj: any[]): any; + /** + Derive the class from the supplied base class. + Both classes are just native javascript constructors, not created by cc.Class, so + usually you will want to inherit using {{#crossLink "cc/Class:method"}}cc.Class {{/crossLink}} instead. + @param cls cls + @param base the baseclass to inherit + */ + export function extend(cls: Function, base: Function): Function; + /** + Get super class + @param ctor the constructor of subclass + */ + export function getSuper(ctor: Function): Function; + /** + Removes all enumerable properties from object + @param obj obj + */ + export function clear(obj: any): void; + /** + Get property descriptor in object and all its ancestors + @param obj obj + @param name name + */ + export function getPropertyDescriptor(obj: any, name: string): any; + /** + Define value, just help to call Object.defineProperty.
+ The configurable will be true. + @param obj obj + @param prop prop + @param value value + @param writable writable + @param enumerable enumerable + */ + export function value(obj: any, prop: string, value: any, writable?: boolean, enumerable?: boolean): void; + /** + Define get set accessor, just help to call Object.defineProperty(...) + @param obj obj + @param prop prop + @param getter getter + @param setter setter + @param enumerable enumerable + */ + export function getset(obj: any, prop: string, getter: Function, setter: Function, enumerable?: boolean): void; + /** + Define get accessor, just help to call Object.defineProperty(...) + @param obj obj + @param prop prop + @param getter getter + @param enumerable enumerable + @param configurable configurable + */ + export function get(obj: any, prop: string, getter: Function, enumerable?: boolean, configurable?: boolean): void; + /** + Define set accessor, just help to call Object.defineProperty(...) + @param obj obj + @param prop prop + @param setter setter + @param enumerable enumerable + @param configurable configurable + */ + export function set(obj: any, prop: string, setter: Function, enumerable?: boolean, configurable?: boolean): void; + /** + Get class name of the object, if object is just a {} (and which class named 'Object'), it will return "". + (modified from the code from this stackoverflow post) + @param objOrCtor instance or constructor + */ + export function getClassName(objOrCtor: any|Function): string; + /** + Register the class by specified name manually + @param className className + @param constructor constructor + */ + export function setClassName(className: string, constructor: Function): void; + /** + Unregister a class from fireball. + + If you dont need a registered class anymore, you should unregister the class so that Fireball will not keep its reference anymore. + Please note that its still your responsibility to free other references to the class. + @param constructor the class you will want to unregister, any number of classes can be added + */ + export function unregisterClass(...constructor: Function[]): void; + /** + Get the registered class by name + @param classname classname + */ + export function getClassByName(classname: string): Function; + /** + Defines a polyfill field for obsoleted codes. + @param obj YourObject or YourClass.prototype + @param obsoleted "OldParam" or "YourClass.OldParam" + @param newPropName "NewParam" + @param writable writable + */ + export function obsolete(obj: any, obsoleted: string, newPropName: string, writable?: boolean): void; + /** + Defines all polyfill fields for obsoleted codes corresponding to the enumerable properties of props. + @param obj YourObject or YourClass.prototype + @param objName "YourObject" or "YourClass" + @param props props + @param writable writable + */ + export function obsoletes(obj: any, objName: any, props: any, writable?: boolean): void; + /** + A string tool to construct a string with format string. + @param msg A JavaScript string containing zero or more substitution strings (%s). + @param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. + + @example + ```js + cc.js.formatStr("a: %s, b: %s", a, b); + cc.js.formatStr(a, b, c); + ``` + */ + export function formatStr(msg: string|any, ...subst: any[]): string; + /** + !#en + A simple wrapper of `Object.create(null)` which ensures the return object have no prototype (and thus no inherited members). So we can skip `hasOwnProperty` calls on property lookups. It is a worthwhile optimization than the `{}` literal when `hasOwnProperty` calls are necessary. + !#zh + 该方法是对 `Object.create(null)` 的简单封装。`Object.create(null)` 用于创建无 prototype (也就无继承)的空对象。这样我们在该对象上查找属性时,就不用进行 `hasOwnProperty` 判断。在需要频繁判断 `hasOwnProperty` 时,使用这个方法性能会比 `{}` 更高。 + @param forceDictMode Apply the delete operator to newly created map object. This causes V8 to put the object in "dictionary mode" and disables creation of hidden classes which are very expensive for objects that are constantly changing shape. + */ + export function createMap(forceDictMode?: boolean): any; + /** undefined */ + export class array { + /** + Removes the array item at the specified index. + @param array array + @param index index + */ + static removeAt(array: any[], index: number): void; + /** + Removes the array item at the specified index. + It's faster but the order of the array will be changed. + @param array array + @param index index + */ + static fastRemoveAt(array: any[], index: number): void; + /** + Removes the first occurrence of a specific object from the array. + @param array array + @param value value + */ + static remove(array: any[], value: any): boolean; + /** + Removes the first occurrence of a specific object from the array. + It's faster but the order of the array will be changed. + @param array array + @param value value + */ + static fastRemove(array: any[], value: number): void; + /** + Verify array's Type + @param array array + @param type type + */ + static verifyType(array: any[], type: Function): boolean; + /** + Removes from array all values in minusArr. For each Value in minusArr, the first matching instance in array will be removed. + @param array Source Array + @param minusArr minus Array + */ + static removeArray(array: any[], minusArr: any[]): void; + /** + Inserts some objects at index + @param array array + @param addObjs addObjs + @param index index + */ + static appendObjectsAt(array: any[], addObjs: any[], index: number): any[]; + /** + Exact same function as Array.prototype.indexOf.
+ HACK: ugliy hack for Baidu mobile browser compatibility, stupid Baidu guys modify Array.prototype.indexOf for all pages loaded, their version changes strict comparison to non-strict comparison, it also ignores the second parameter of the original API, and this will cause event handler enter infinite loop.
+ Baidu developers, if you ever see this documentation, here is the standard: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf, Seriously! + @param searchElement Element to locate in the array. + @param fromIndex The index to start the search at + */ + static indexOf(searchElement: any, fromIndex?: number): number; + /** + Determines whether the array contains a specific value. + @param array array + @param value value + */ + static contains(array: any[], value: any): boolean; + /** + Copy an array's item to a new array (its performance is better than Array.slice) + @param array array + */ + static copy(array: any[]): any[]; + } + /** !#en + A fixed-length object pool designed for general type.
+ The implementation of this object pool is very simple, + it can helps you to improve your game performance for objects which need frequent release and recreate operations
+ !#zh + 长度固定的对象缓存池,可以用来缓存各种对象类型。
+ 这个对象池的实现非常精简,它可以帮助您提高游戏性能,适用于优化对象的反复创建和销毁。 */ + export class Pool { + /** + !#en + Constructor for creating an object pool for the specific object type. + You can pass a callback argument for process the cleanup logic when the object is recycled. + !#zh + 使用构造函数来创建一个指定对象类型的对象池,您可以传递一个回调函数,用于处理对象回收时的清理逻辑。 + @param cleanupFunc the callback method used to process the cleanup logic when the object is recycled. + @param size initializes the length of the array + */ + constructor(cleanupFunc: (obj: any) => void, size: number); + constructor(size: number); + /** + !#en + Get and initialize an object from pool. This method defaults to null and requires the user to implement it. + !#zh + 获取并初始化对象池中的对象。这个方法默认为空,需要用户自己实现。 + @param params parameters to used to initialize the object + */ + get(...params: any[]): any; + /** !#en + The current number of available objects, the default is 0, it will gradually increase with the recycle of the object, + the maximum will not exceed the size specified when the constructor is called. + !#zh + 当前可用对象数量,一开始默认是 0,随着对象的回收会逐渐增大,最大不会超过调用构造函数时指定的 size。 */ + count: number; + /** + !#en + Get an object from pool, if no available object in the pool, null will be returned. + !#zh + 获取对象池中的对象,如果对象池没有可用对象,则返回空。 + */ + _get(): any; + /** + !#en Put an object into the pool. + !#zh 向对象池返还一个不再需要的对象。 + */ + put(): void; + /** + !#en Resize the pool. + !#zh 设置对象池容量。 + */ + resize(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @private + */ + const enum ArmatureType { + Armature = 0, + MovieClip = 1, + Stage = 2, + } + /** + * @private + */ + const enum DisplayType { + Image = 0, + Armature = 1, + Mesh = 2, + } + /** + * @private + */ + const enum ExtensionType { + FFD = 0, + AdjustColor = 10, + BevelFilter = 11, + BlurFilter = 12, + DropShadowFilter = 13, + GlowFilter = 14, + GradientBevelFilter = 15, + GradientGlowFilter = 16, + } + /** + * @private + */ + const enum EventType { + Frame = 10, + Sound = 11, + } + /** + * @private + */ + const enum ActionType { + Play = 0, + Stop = 1, + GotoAndPlay = 2, + GotoAndStop = 3, + FadeIn = 4, + FadeOut = 5, + } + /** + * @private + */ + const enum BlendMode { + Normal = 0, + Add = 1, + Alpha = 2, + Darken = 3, + Difference = 4, + Erase = 5, + HardLight = 6, + Invert = 7, + Layer = 8, + Lighten = 9, + Multiply = 10, + Overlay = 11, + Screen = 12, + Subtract = 13, + } + /** + * @private + */ + interface Map { + [key: string]: T; + } + /** + * DragonBones + */ + class DragonBones { + /** + * @private + */ + static PI_D: number; + /** + * @private + */ + static PI_H: number; + /** + * @private + */ + static PI_Q: number; + /** + * @private + */ + static ANGLE_TO_RADIAN: number; + /** + * @private + */ + static RADIAN_TO_ANGLE: number; + /** + * @private + */ + static SECOND_TO_MILLISECOND: number; + static VERSION: string; + /** + * @private + */ + static debug: boolean; + /** + * @private + */ + static debugDraw: boolean; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 基础对象。 + * @version DragonBones 4.5 + */ + abstract class BaseObject { + private static _hashCode; + private static _defaultMaxCount; + private static _maxCountMap; + private static _poolsMap; + private static _returnObject(object); + /** + * @language zh_CN + * 设置每种对象池的最大缓存数量。 + * @param objectConstructor 对象类。 + * @param maxCount 最大缓存数量。 (设置为 0 则不缓存) + * @version DragonBones 4.5 + */ + static setMaxCount(objectConstructor: typeof BaseObject, maxCount: number): void; + /** + * @language zh_CN + * 清除对象池缓存的对象。 + * @param objectConstructor 对象类。 (不设置则清除所有缓存) + * @version DragonBones 4.5 + */ + static clearPool(objectConstructor?: typeof BaseObject): void; + /** + * @language zh_CN + * 从对象池中创建指定对象。 + * @param objectConstructor 对象类。 + * @version DragonBones 4.5 + */ + static borrowObject(objectConstructor: { + new (): T; + }): T; + /** + * @language zh_CN + * 对象的唯一标识。 + * @version DragonBones 4.5 + */ + hashCode: number; + /** + * @private + */ + protected abstract _onClear(): void; + /** + * @language zh_CN + * 清除数据并返还对象池。 + * @version DragonBones 4.5 + */ + returnToPool(): void; + } +} +declare namespace dragonBonesOLD { +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 动画混合时,使用的淡出方式。 + * @see dragonBonesOLD.Animation#fadeIn() + * @version DragonBones 4.5 + */ + const enum AnimationFadeOutMode { + /** + * @language zh_CN + * 不淡出动画。 + * @version DragonBones 4.5 + */ + None = 0, + /** + * @language zh_CN + * 淡出同层的动画。 + * @version DragonBones 4.5 + */ + SameLayer = 1, + /** + * @language zh_CN + * 淡出同组的动画。 + * @version DragonBones 4.5 + */ + SameGroup = 2, + /** + * @language zh_CN + * 淡出同层并且同组的动画。 + * @version DragonBones 4.5 + */ + SameLayerAndGroup = 3, + /** + * @language zh_CN + * 淡出所有动画。 + * @version DragonBones 4.5 + */ + All = 4, + } + /** + * @language zh_CN + * 播放动画组件接口。 (Armature 和 WordClock 都实现了该接口) + * 任何实现了此接口的实例都可以加到 WorldClock 时钟中,由时钟统一控制动画的播放。 + * @see dragonBonesOLD.WorldClock + * @see dragonBonesOLD.Armature + * @version DragonBones 3.0 + */ + interface IAnimateble { + /** + * @language zh_CN + * 更新一个指定的时间。 + * @param passedTime 前进的时间。 (以秒为单位) + * @version DragonBones 3.0 + */ + advanceTime(passedTime: number): void; + } + /** + * @language zh_CN + * 动画控制器,用来播放动画数据,管理动画状态。 + * @see dragonBonesOLD.AnimationData + * @see dragonBonesOLD.AnimationState + * @version DragonBones 3.0 + */ + class Animation extends BaseObject { + /** + * @private + */ + private static _sortAnimationState(a, b); + /** + * @private + */ + static toString(): string; + /** + * @language zh_CN + * 动画的播放速度。 [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1 + * @version DragonBones 3.0 + */ + timeScale: number; + /** + * @private + */ + _armature: Armature; + private _isPlaying; + private _time; + private _duration; + private _lastAnimationState; + private _animations; + private _animationNames; + private _animationStates; + /** + * @inheritDoc + */ + protected _onClear(): void; + private _fadeOut(fadeOutTime, layer, group, fadeOutMode, pauseFadeOut); + /** + * @language zh_CN + * 清除所有正在播放的动画状态。 + * @version DragonBones 4.5 + */ + reset(): void; + /** + * @language zh_CN + * 暂停播放动画。 + * @param animationName 动画状态的名称,如果未设置,则暂停所有动画状态。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 3.0 + */ + stop(animationName?: string): void; + /** + * @language zh_CN + * 播放动画。 + * @param animationName 动画数据的名称,如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放上一个正在播放的动画。 + * @param playTimes 动画需要播放的次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] + * @returns 返回控制这个动画数据的动画状态。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 3.0 + */ + play(animationName?: string, playTimes?: number): AnimationState; + /** + * @language zh_CN + * 淡入播放指定名称的动画。 + * @param animationName 动画数据的名称。 + * @param playTimes 循环播放的次数。 [-1: 使用数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] + * @param fadeInTime 淡入的时间。 [-1: 使用数据默认值, [0~N]: N 秒淡入完毕] (以秒为单位) + * @param layer 混合的图层,图层高会优先获取混合权重。 + * @param group 混合的组,用于给动画状态编组,方便混合淡出控制。 + * @param fadeOutMode 淡出的模式。 + * @param additiveBlending 以叠加的形式混合。 + * @param displayControl 是否对显示对象属性可控。 + * @param pauseFadeOut 暂停需要淡出的动画。 + * @param pauseFadeIn 暂停需要淡入的动画,直到淡入结束才开始播放。 + * @returns 返回控制这个动画数据的动画状态。 + * @see dragonBonesOLD.AnimationFadeOutMode + * @see dragonBonesOLD.AnimationState + * @version DragonBones 4.5 + */ + fadeIn(animationName: string, fadeInTime?: number, playTimes?: number, layer?: number, group?: string, fadeOutMode?: AnimationFadeOutMode, additiveBlending?: boolean, displayControl?: boolean, pauseFadeOut?: boolean, pauseFadeIn?: boolean): AnimationState; + /** + * @language zh_CN + * 指定名称的动画从指定时间开始播放。 + * @param animationName 动画数据的名称。 + * @param time 时间。 (以秒为单位) + * @param playTimes 动画循环播放的次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] + * @param toTime 播放到指定的时间,如果未设置则播放整个动画。 + * @returns 返回控制这个动画数据的动画状态。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 4.5 + */ + gotoAndPlayByTime(animationName: string, time?: number, playTimes?: number, toTime?: number): AnimationState; + /** + * @language zh_CN + * 指定名称的动画从指定帧开始播放。 + * @param animationName 动画数据的名称。 + * @param frame 帧。 + * @param playTimes 动画循环播放的次数。[-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] + * @param toFrame 播放到指定的帧,如果未设置则播放整个动画。 + * @returns 返回控制这个动画数据的动画状态。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 4.5 + */ + gotoAndPlayByFrame(animationName: string, frame?: number, playTimes?: number, toFrame?: number): AnimationState; + /** + * @language zh_CN + * 指定名称的动画从指定进度开始播放。 + * @param animationName 动画数据的名称。 + * @param progress 进度。 [0~1] + * @param playTimes 动画循环播放的次数。[-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] + * @param toProgress 播放到指定的进度,如果未设置则播放整个动画。 + * @returns 返回控制这个动画数据的动画状态。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 4.5 + */ + gotoAndPlayByProgress(animationName: string, progress?: number, playTimes?: number, toProgress?: number): AnimationState; + /** + * @language zh_CN + * 播放指定名称的动画到指定的时间并停止。 + * @param animationName 动画数据的名称。 + * @param time 时间。 (以秒为单位) + * @returns 返回控制这个动画数据的动画状态。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 4.5 + */ + gotoAndStopByTime(animationName: string, time?: number): AnimationState; + /** + * @language zh_CN + * 播放指定名称的动画到指定的帧并停止。 + * @param animationName 动画数据的名称。 + * @param frame 帧。 + * @returns 返回控制这个动画数据的动画状态。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 4.5 + */ + gotoAndStopByFrame(animationName: string, frame?: number): AnimationState; + /** + * @language zh_CN + * 播放指定名称的动画到指定的进度并停止。 + * @param animationName 动画数据的名称。 + * @param progress 进度。 [0~1] + * @returns 返回控制这个动画数据的动画状态。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 4.5 + */ + gotoAndStopByProgress(animationName: string, progress?: number): AnimationState; + /** + * @language zh_CN + * 获取指定名称的动画状态。 + * @param animationName 动画状态的名称。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 3.0 + */ + getState(animationName: string): AnimationState; + /** + * @language zh_CN + * 是否包含指定名称的动画数据。 + * @param animationName 动画数据的名称。 + * @see dragonBonesOLD.AnimationData + * @version DragonBones 3.0 + */ + hasAnimation(animationName: string): boolean; + /** + * @language zh_CN + * 动画是否处于播放状态。 + * @version DragonBones 3.0 + */ + isPlaying: boolean; + /** + * @language zh_CN + * 所有动画状态是否均已播放完毕。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 3.0 + */ + isCompleted: boolean; + /** + * @language zh_CN + * 上一个正在播放的动画状态的名称。 + * @see #lastAnimationState + * @version DragonBones 3.0 + */ + lastAnimationName: string; + /** + * @language zh_CN + * 上一个正在播放的动画状态。 + * @see dragonBonesOLD.AnimationState + * @version DragonBones 3.0 + */ + lastAnimationState: AnimationState; + /** + * @language zh_CN + * 所有动画数据名称。 + * @see #animations + * @version DragonBones 4.5 + */ + animationNames: Array; + /** + * @language zh_CN + * 所有的动画数据。 + * @see dragonBonesOLD.AnimationData + * @version DragonBones 4.5 + */ + animations: Map; + /** + * @deprecated + * @see #play() + * @see #fadeIn() + * @see #gotoAndPlayByTime() + * @see #gotoAndPlayByFrame() + * @see #gotoAndPlayByProgress() + */ + gotoAndPlay(animationName: string, fadeInTime?: number, duration?: number, playTimes?: number, layer?: number, group?: string, fadeOutMode?: AnimationFadeOutMode, pauseFadeOut?: boolean, pauseFadeIn?: boolean): AnimationState; + /** + * @deprecated + * @see #gotoAndStopByTime() + * @see #gotoAndStopByFrame() + * @see #gotoAndStopByProgress() + */ + gotoAndStop(animationName: string, time?: number): AnimationState; + /** + * @deprecated + * @see #animationNames + * @see #animations + */ + animationList: Array; + /** + * @language zh_CN + * @deprecated + * @see #animationNames + * @see #animations + */ + animationDataList: Array; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 动画状态,播放动画时产生,可以对单个动画的播放进行更细致的控制和调节。 + * @see dragonBonesOLD.Animation + * @see dragonBonesOLD.AnimationData + * @version DragonBones 3.0 + */ + class AnimationState extends BaseObject { + /** + * @private + */ + static stateActionEnabled: boolean; + /** + * @private + */ + static toString(): string; + /** + * @language zh_CN + * 是否对插槽的颜色,显示序列索引,深度排序,行为等拥有控制的权限。 + * @see dragonBonesOLD.Slot#displayController + * @version DragonBones 3.0 + */ + displayControl: boolean; + /** + * @language zh_CN + * 是否以叠加的方式混合动画。 + * @version DragonBones 3.0 + */ + additiveBlending: boolean; + /** + * @private + */ + actionEnabled: boolean; + /** + * @language zh_CN + * 需要播放的次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + */ + playTimes: number; + /** + * @language zh_CN + * 播放速度。 [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1 + * @version DragonBones 3.0 + */ + timeScale: number; + /** + * @language zh_CN + * 进行动画混合时的权重。 + * @default 1 + * @version DragonBones 3.0 + */ + weight: number; + /** + * @language zh_CN + * 自动淡出时需要的时间,当设置一个大于等于 0 的值,动画状态将会在播放完成后自动淡出。 (以秒为单位) + * @default -1 + * @version DragonBones 3.0 + */ + autoFadeOutTime: number; + /** + * @private + */ + fadeTotalTime: number; + /** + * @private + */ + private _isPlaying; + /** + * @private + */ + private _isPausePlayhead; + /** + * @private + */ + private _fadeTime; + /** + * @private + */ + private _time; + /** + * @private + */ + private _name; + /** + * @private + */ + private _armature; + /** + * @private + */ + private _animationData; + /** + * @private + */ + private _zOrderTimeline; + /** + * @private + */ + private _boneMask; + /** + * @private + */ + private _boneTimelines; + /** + * @private + */ + private _slotTimelines; + /** + * @private + */ + private _ffdTimelines; + /** + * @inheritDoc + */ + protected _onClear(): void; + private _updateTimelineStates(); + private _advanceFadeTime(passedTime); + /** + * @language zh_CN + * 继续播放。 + * @version DragonBones 3.0 + */ + play(): void; + /** + * @language zh_CN + * 暂停播放。 + * @version DragonBones 3.0 + */ + stop(): void; + /** + * @language zh_CN + * 淡出动画。 + * @param fadeOutTime 淡出时间。 (以秒为单位) + * @param pausePlayhead 淡出时是否暂停动画。 [true: 暂停, false: 不暂停] + * @version DragonBones 3.0 + */ + fadeOut(fadeOutTime: number, pausePlayhead?: boolean): void; + /** + * @language zh_CN + * 是否包含指定的骨骼遮罩。 + * @param name 指定的骨骼名称。 + * @version DragonBones 3.0 + */ + containsBoneMask(name: string): boolean; + /** + * @language zh_CN + * 添加指定的骨骼遮罩。 + * @param boneName 指定的骨骼名称。 + * @param recursive 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + */ + addBoneMask(name: string, recursive?: boolean): void; + /** + * @language zh_CN + * 删除指定的骨骼遮罩。 + * @param boneName 指定的骨骼名称。 + * @param recursive 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + */ + removeBoneMask(name: string, recursive?: boolean): void; + /** + * @language zh_CN + * 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + */ + removeAllBoneMask(): void; + /** + * @language zh_CN + * 动画图层。 + * @see dragonBonesOLD.Animation#fadeIn() + * @version DragonBones 3.0 + */ + layer: number; + /** + * @language zh_CN + * 动画组。 + * @see dragonBonesOLD.Animation#fadeIn() + * @version DragonBones 3.0 + */ + group: string; + /** + * @language zh_CN + * 动画名称。 + * @see dragonBonesOLD.AnimationData#name + * @version DragonBones 3.0 + */ + name: string; + /** + * @language zh_CN + * 动画数据。 + * @see dragonBonesOLD.AnimationData + * @version DragonBones 3.0 + */ + animationData: AnimationData; + /** + * @language zh_CN + * 是否播放完毕。 + * @version DragonBones 3.0 + */ + isCompleted: boolean; + /** + * @language zh_CN + * 是否正在播放。 + * @version DragonBones 3.0 + */ + isPlaying: boolean; + /** + * @language zh_CN + * 当前动画的播放次数。 + * @version DragonBones 3.0 + */ + currentPlayTimes: number; + /** + * @language zh_CN + * 当前动画的总时间。 (以秒为单位) + * @version DragonBones 3.0 + */ + totalTime: number; + /** + * @language zh_CN + * 当前动画的播放时间。 (以秒为单位) + * @version DragonBones 3.0 + */ + currentTime: number; + /** + * @deprecated + */ + autoTween: boolean; + /** + * @deprecated + * @see #animationData + */ + clip: AnimationData; + } +} +declare namespace dragonBonesOLD { +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * WorldClock 提供时钟的支持,为每个加入到时钟的 IAnimatable 对象更新时间。 + * @see dragonBonesOLD.IAnimatable + * @see dragonBonesOLD.Armature + * @version DragonBones 3.0 + */ + class WorldClock implements IAnimateble { + private static _clock; + /** + * @language zh_CN + * 一个可以直接使用的全局 WorldClock 实例. + * @version DragonBones 3.0 + */ + static clock: WorldClock; + /** + * @language zh_CN + * 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + */ + time: number; + /** + * @language zh_CN + * 时间流逝的速度,用于实现动画的变速播放。 [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1 + * @version DragonBones 3.0 + */ + timeScale: number; + private _animatebles; + /** + * @language zh_CN + * 创建一个新的 WorldClock 实例。 + * 通常并不需要单独创建 WorldClock 的实例,可以直接使用 WorldClock.clock 静态实例。 + * (创建更多独立的 WorldClock 可以更灵活的为需要更新的 IAnimateble 实例分组,实现不同组不同速度的动画播放) + * @version DragonBones 3.0 + */ + constructor(); + /** + * @language zh_CN + * 为所有的 IAnimatable 实例向前播放一个指定的时间。 (通常这个方法需要在 ENTER_FRAME 事件的响应函数中被调用) + * @param passedTime 前进的时间。 (以秒为单位,当设置为 -1 时将自动计算当前帧与上一帧的时间差) + * @version DragonBones 3.0 + */ + advanceTime(passedTime: number): void; + /** + * 是否包含指定的 IAnimatable 实例 + * @param value 指定的 IAnimatable 实例。 + * @returns [true: 包含,false: 不包含]。 + * @version DragonBones 3.0 + */ + contains(value: IAnimateble): boolean; + /** + * @language zh_CN + * 添加指定的 IAnimatable 实例。 + * @param value IAnimatable 实例。 + * @version DragonBones 3.0 + */ + add(value: IAnimateble): void; + /** + * @language zh_CN + * 移除指定的 IAnimatable 实例。 + * @param value IAnimatable 实例。 + * @version DragonBones 3.0 + */ + remove(value: IAnimateble): void; + /** + * @language zh_CN + * 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + */ + clear(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 基础变换对象。 + * @version DragonBones 4.5 + */ + abstract class TransformObject extends BaseObject { + /** + * @language zh_CN + * 可以用于存储临时数据。 + * @version DragonBones 3.0 + */ + userData: any; + /** + * @language zh_CN + * 对象的名称。 + * @version DragonBones 3.0 + */ + name: string; + /** + * @language zh_CN + * 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + */ + globalTransformMatrix: Matrix; + /** + * @language zh_CN + * 相对于骨架坐标系的变换。 + * @see dragonBonesOLD.Transform + * @version DragonBones 3.0 + */ + global: Transform; + /** + * @language zh_CN + * 相对于骨架或父骨骼坐标系的绑定变换。 + * @see dragonBonesOLD.Transform + * @version DragonBones 3.0 + */ + origin: Transform; + /** + * @language zh_CN + * 相对于骨架或父骨骼坐标系的偏移变换。 + * @see dragonBonesOLD.Transform + * @version DragonBones 3.0 + */ + offset: Transform; + /** + * @private + */ + _armature: Armature; + /** + * @private + */ + _parent: Bone; + /** + * @private + */ + protected _globalTransformMatrix: Matrix; + /** + * @inheritDoc + */ + protected _onClear(): void; + /** + * @language zh_CN + * 所属的骨架。 + * @see dragonBonesOLD.Armature + * @version DragonBones 3.0 + */ + armature: Armature; + /** + * @language zh_CN + * 所属的父骨骼。 + * @see dragonBonesOLD.Bone + * @version DragonBones 3.0 + */ + parent: Bone; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 骨架,是骨骼动画系统的核心,由显示容器、骨骼、插槽、动画、事件系统构成。 + * @see dragonBonesOLD.ArmatureData + * @see dragonBonesOLD.Bone + * @see dragonBonesOLD.Slot + * @see dragonBonesOLD.Animation + * @see dragonBonesOLD.IArmatureDisplay + * @version DragonBones 3.0 + */ + class Armature extends BaseObject implements IAnimateble { + /** + * @private + */ + static toString(): string; + private static _onSortSlots(a, b); + /** + * @language zh_CN + * 可以用于存储临时数据。 + * @version DragonBones 3.0 + */ + userData: any; + /** + * @private + */ + _cacheFrameIndex: number; + /** + * @private + */ + _armatureData: ArmatureData; + /** + * @private + */ + _skinData: SkinData; + /** + * @private + */ + _animation: Animation; + /** + * @private + */ + _display: IArmatureDisplay; + /** + * @private + */ + _eventManager: IEventDispatcher; + private _delayDispose; + private _lockDispose; + private _slotsDirty; + private _replacedTexture; + private _bones; + private _slots; + private _actions; + private _events; + /** + * @inheritDoc + */ + protected _onClear(): void; + private _sortBones(); + private _sortSlots(); + private _doAction(value); + /** + * @private + */ + _sortZOrder(slotIndices: Array): void; + /** + * @private + */ + _bufferAction(value: ActionData): void; + /** + * @language zh_CN + * 释放骨架。 (会回收到内存池) + * @version DragonBones 3.0 + */ + dispose(): void; + /** + * @language zh_CN + * 更新骨架和动画。 (可以使用时钟实例或显示容器来更新) + * @param passedTime 两帧之前的时间间隔。 (以秒为单位) + * @see dragonBonesOLD.IAnimateble + * @see dragonBonesOLD.WorldClock + * @see dragonBonesOLD.IArmatureDisplay + * @version DragonBones 3.0 + */ + advanceTime(passedTime: number): void; + /** + * @language zh_CN + * 更新骨骼和插槽的变换。 (当骨骼没有动画状态或动画状态播放完成时,骨骼将不在更新) + * @param boneName 指定的骨骼名称,如果未设置,将更新所有骨骼。 + * @param updateSlotDisplay 是否更新插槽的显示对象。 + * @see dragonBonesOLD.Bone + * @see dragonBonesOLD.Slot + * @version DragonBones 3.0 + */ + invalidUpdate(boneName?: string, updateSlotDisplay?: boolean): void; + /** + * @language zh_CN + * 获取指定名称的骨骼。 + * @param name 骨骼的名称。 + * @returns 骨骼。 + * @see dragonBonesOLD.Bone + * @version DragonBones 3.0 + */ + getBone(name: string): Bone; + /** + * @language zh_CN + * 通过显示对象获取骨骼。 + * @param display 显示对象。 + * @returns 包含这个显示对象的骨骼。 + * @see dragonBonesOLD.Bone + * @version DragonBones 3.0 + */ + getBoneByDisplay(display: any): Bone; + /** + * @language zh_CN + * 获取指定名称的插槽。 + * @param name 插槽的名称。 + * @returns 插槽。 + * @see dragonBonesOLD.Slot + * @version DragonBones 3.0 + */ + getSlot(name: string): Slot; + /** + * @language zh_CN + * 通过显示对象获取插槽。 + * @param display 显示对象。 + * @returns 包含这个显示对象的插槽。 + * @see dragonBonesOLD.Slot + * @version DragonBones 3.0 + */ + getSlotByDisplay(display: any): Slot; + /** + * @language zh_CN + * 替换骨架的主贴图,根据渲染引擎的不同,提供不同的贴图数据。 + * @param texture 贴图。 + * @version DragonBones 4.5 + */ + replaceTexture(texture: any): void; + /** + * @language zh_CN + * 获取所有骨骼。 + * @see dragonBonesOLD.Bone + * @version DragonBones 3.0 + */ + getBones(): Array; + /** + * @language zh_CN + * 获取所有插槽。 + * @see dragonBonesOLD.Slot + * @version DragonBones 3.0 + */ + getSlots(): Array; + /** + * @language zh_CN + * 骨架名称。 + * @see dragonBonesOLD.ArmatureData#name + * @version DragonBones 3.0 + */ + name: string; + /** + * @language zh_CN + * 获取骨架数据。 + * @see dragonBonesOLD.ArmatureData + * @version DragonBones 4.5 + */ + armatureData: ArmatureData; + /** + * @language zh_CN + * 获得动画控制器。 + * @see dragonBonesOLD.Animation + * @version DragonBones 3.0 + */ + animation: Animation; + /** + * @language zh_CN + * 获取显示容器,插槽的显示对象都会以此显示容器为父级,根据渲染平台的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + */ + display: IArmatureDisplay | any; + /** + * @language zh_CN + * 获取父插槽。 (当此骨架是某个骨架的子骨架时,可以通过此属性向上查找从属关系) + * @see dragonBonesOLD.Slot + * @version DragonBones 4.5 + */ + parent: Slot; + /** + * @language zh_CN + * 动画缓存的帧率,当设置一个大于 0 的帧率时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如 Bone 和 Slot 的 offset 属性等。 + * @see dragonBonesOLD.DragonBonesData#frameRate + * @see dragonBonesOLD.ArmatureData#frameRate + * @version DragonBones 4.5 + */ + cacheFrameRate: number; + /** + * @language zh_CN + * 替换骨架的主贴图,根据渲染引擎的不同,提供不同的贴图数据。 + * @version DragonBones 4.5 + */ + replacedTexture: any; + /** + * @language zh_CN + * 开启动画缓存。 + * @param frameRate 动画缓存的帧率 + * @see #cacheFrameRate + * @version DragonBones 4.5 + */ + enableAnimationCache(frameRate: number): void; + /** + * @language zh_CN + * 是否包含指定类型的事件。 + * @param type 事件类型。 + * @returns [true: 包含, false: 不包含] + * @version DragonBones 3.0 + */ + hasEventListener(type: EventStringType): void; + /** + * @language zh_CN + * 添加事件。 + * @param type 事件类型。 + * @param listener 事件回调。 + * @version DragonBones 3.0 + */ + addEventListener(type: EventStringType, listener: Function, target: any): void; + /** + * @language zh_CN + * 移除事件。 + * @param type 事件类型。 + * @param listener 事件回调。 + * @version DragonBones 3.0 + */ + removeEventListener(type: EventStringType, listener: Function, target: any): void; + /** + * @deprecated + */ + addBone(value: Bone, parentName?: string): void; + /** + * @deprecated + */ + addSlot(value: Slot, parentName: string): void; + /** + * @deprecated + */ + removeBone(value: Bone): void; + /** + * @deprecated + */ + removeSlot(value: Slot): void; + /** + * @deprecated + * @see #display + */ + getDisplay(): any; + /** + * @deprecated + * @see #cacheFrameRate + */ + enableCache: boolean; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 骨骼,一个骨架中可以包含多个骨骼,骨骼以树状结构组成骨架。 + * 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移旋转缩放的实现。 + * @see dragonBonesOLD.BoneData + * @see dragonBonesOLD.Armature + * @see dragonBonesOLD.Slot + * @version DragonBones 3.0 + */ + class Bone extends TransformObject { + /** + * @private + */ + static toString(): string; + /** + * @language zh_CN + * 是否继承父骨骼的平移。 [true: 继承, false: 不继承] + * @version DragonBones 3.0 + */ + inheritTranslation: boolean; + /** + * @language zh_CN + * 是否继承父骨骼的旋转。 [true: 继承, false: 不继承] + * @version DragonBones 3.0 + */ + inheritRotation: boolean; + /** + * @language zh_CN + * 是否继承父骨骼的缩放。 [true: 继承, false: 不继承] + * @version DragonBones 4.5 + */ + inheritScale: boolean; + /** + * @language zh_CN + * IK 约束时骨骼方向是否为顺时针方向。 [true: 顺时针, false: 逆时针] + * @version DragonBones 4.5 + */ + ikBendPositive: boolean; + /** + * @language zh_CN + * IK 约束的权重。 + * @version DragonBones 4.5 + */ + ikWeight: number; + /** + * @language zh_CN + * 骨骼长度。 + * @version DragonBones 4.5 + */ + length: number; + /** + * @private + */ + private _visible; + /** + * @private + */ + private _ikChain; + /** + * @private + */ + private _ikChainIndex; + /** + * @private + */ + private _ik; + /** + * @private + */ + private _bones; + /** + * @private + */ + private _slots; + /** + * @inheritDoc + */ + protected _onClear(): void; + /** + * @private + */ + private _updateGlobalTransformMatrix(); + /** + * @private + */ + private _computeIKA(); + /** + * @private + */ + private _computeIKB(); + /** + * @inheritDoc + */ + _setArmature(value: Armature): void; + /** + * @language zh_CN + * 下一帧更新变换。 (当骨骼没有动画状态或动画状态播放完成时,骨骼将不在更新) + * @version DragonBones 3.0 + */ + invalidUpdate(): void; + /** + * @language zh_CN + * 是否包含某个指定的骨骼或插槽。 + * @returns [true: 包含,false: 不包含] + * @see dragonBonesOLD.TransformObject + * @version DragonBones 3.0 + */ + contains(child: TransformObject): boolean; + /** + * @language zh_CN + * 所有的子骨骼。 + * @version DragonBones 3.0 + */ + getBones(): Array; + /** + * @language zh_CN + * 所有的插槽。 + * @see dragonBonesOLD.Slot + * @version DragonBones 3.0 + */ + getSlots(): Array; + /** + * @private + */ + ikChain: number; + /** + * @private + */ + ikChainIndex: number; + /** + * @language zh_CN + * 当前的 IK 约束目标。 + * @version DragonBones 4.5 + */ + ik: Bone; + /** + * @language zh_CN + * 控制此骨骼所有插槽的显示。 + * @default true + * @see dragonBonesOLD.Slot + * @version DragonBones 3.0 + */ + visible: boolean; + /** + * @deprecated + * @see dragonBonesOLD.Armature#getSlot() + */ + slot: Slot; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 骨架显示容器和事件的接口。 + * @see dragonBonesOLD.Armature#display + * @version DragonBones 4.5 + */ + interface IArmatureDisplay extends IEventDispatcher { + /** + * @language zh_CN + * 释放显示对象和骨架。 + * @version DragonBones 4.5 + */ + dispose(): void; + /** + * @language zh_CN + * 获取使用这个显示容器的骨架。 + * @readOnly + * @see dragonBonesOLD.Armature + * @version DragonBones 4.5 + */ + armature: Armature; + /** + * @language zh_CN + * 获取使用骨架的动画控制器。 + * @readOnly + * @see dragonBonesOLD.Animation + * @version DragonBones 4.5 + */ + animation: Animation; + /** + * @language zh_CN + * 由显示容器来更新骨架和动画。 + * @param on 开启或关闭显示容器对骨架与动画的更新。 + * @version DragonBones 4.5 + */ + advanceTimeBySelf(on: boolean): void; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 插槽,附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBonesOLD.Armature + * @see dragonBonesOLD.Bone + * @see dragonBonesOLD.SlotData + * @version DragonBones 3.0 + */ + abstract class Slot extends TransformObject { + private static _helpPoint; + private static _helpMatrix; + /** + * @language zh_CN + * 子骨架是否继承父骨架的动画。 [true: 继承, false: 不继承] + * @default true + * @version DragonBones 4.5 + */ + inheritAnimation: boolean; + /** + * @language zh_CN + * 显示对象受到控制的对象,应设置为动画状态的名称或组名称,设置为 null 则表示受所有的动画状态控制。 + * @default null + * @see dragonBonesOLD.AnimationState#displayControl + * @see dragonBonesOLD.AnimationState#name + * @see dragonBonesOLD.AnimationState#group + * @version DragonBones 4.5 + */ + displayController: string; + /** + * @private + */ + _zOrder: number; + /** + * @private + */ + _pivotX: number; + /** + * @private + */ + _pivotY: number; + /** + * @private + */ + _displayDataSet: SlotDisplayDataSet; + /** + * @private + */ + _meshData: MeshData; + /** + * @private + */ + _childArmature: Armature; + /** + * @private + */ + _rawDisplay: any; + /** + * @private + */ + _meshDisplay: any; + /** + * @private + */ + _cacheFrames: Array; + /** + * @private + */ + _colorTransform: ColorTransform; + /** + * @private + */ + _ffdVertices: Array; + /** + * @private + */ + _replacedDisplayDataSet: Array; + /** + * @private + */ + protected _displayDirty: boolean; + /** + * @private + */ + protected _blendModeDirty: boolean; + /** + * @private + */ + protected _originDirty: boolean; + /** + * @private + */ + protected _transformDirty: boolean; + /** + * @private + */ + protected _displayIndex: number; + /** + * @private + */ + protected _blendMode: BlendMode; + /** + * @private + */ + protected _display: any; + /** + * @private + */ + protected _localMatrix: Matrix; + /** + * @private + */ + protected _displayList: Array; + /** + * @private + */ + protected _meshBones: Array; + /** + * @inheritDoc + */ + protected _onClear(): void; + /** + * @private + */ + protected abstract _initDisplay(value: any): void; + /** + * @private + */ + protected abstract _disposeDisplay(value: any): void; + /** + * @private + */ + protected abstract _onUpdateDisplay(): void; + /** + * @private + */ + protected abstract _addDisplay(): void; + /** + * @private + */ + protected abstract _replaceDisplay(value: any): void; + /** + * @private + */ + protected abstract _removeDisplay(): void; + /** + * @private + */ + protected abstract _updateZOrder(): void; + /** + * @private + */ + protected abstract _updateBlendMode(): void; + /** + * @private + */ + protected abstract _updateColor(): void; + /** + * @private + */ + protected abstract _updateFilters(): void; + /** + * @private + */ + protected abstract _updateFrame(): void; + /** + * @private + */ + protected abstract _updateMesh(): void; + /** + * @private + */ + protected abstract _updateTransform(): void; + private _isMeshBonesUpdate(); + /** + * @private + */ + protected _updatePivot(rawDisplayData: DisplayData, currentDisplayData: DisplayData, currentTextureData: TextureData): void; + /** + * @private + */ + protected _updateDisplay(): void; + /** + * @private + */ + protected _updateLocalTransformMatrix(): void; + /** + * @private + */ + protected _updateGlobalTransformMatrix(): void; + /** + * @private Factory + */ + _setDisplayList(value: Array): boolean; + /** + * @language zh_CN + * 在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + */ + invalidUpdate(): void; + /** + * @private + */ + rawDisplay: any; + /** + * @private + */ + MeshDisplay: any; + /** + * @language zh_CN + * 此时显示的显示对象在显示列表中的索引。 + * @version DragonBones 4.5 + */ + displayIndex: number; + /** + * @language zh_CN + * 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + */ + displayList: Array; + /** + * @language zh_CN + * 此时显示的显示对象。 + * @version DragonBones 3.0 + */ + display: any; + /** + * @language zh_CN + * 此时显示的子骨架。 + * @see dragonBonesOLD.Armature + * @version DragonBones 3.0 + */ + childArmature: Armature; + /** + * @deprecated + * @see #display + */ + getDisplay(): any; + /** + * @deprecated + * @see #display + */ + setDisplay(value: any): void; + } +} +declare namespace dragonBonesOLD { + /** + * @private + */ + type EventStringType = string | "start" | "loopComplete" | "complete" | "fadeIn" | "fadeInComplete" | "fadeOut" | "fadeOutComplete" | "frameEvent" | "soundEvent"; + /** + * @language zh_CN + * 事件接口。 + * @version DragonBones 4.5 + */ + interface IEventDispatcher { + /** + * @language zh_CN + * 是否包含指定类型的事件。 + * @param type 事件类型。 + * @returns [true: 包含, false: 不包含] + * @version DragonBones 4.5 + */ + hasEvent(type: EventStringType): boolean; + /** + * @language zh_CN + * 添加事件。 + * @param type 事件类型。 + * @param listener 事件回调。 + * @version DragonBones 4.5 + */ + addEvent(type: EventStringType, listener: Function, target: any): void; + /** + * @language zh_CN + * 移除事件。 + * @param type 事件类型。 + * @param listener 事件回调。 + * @version DragonBones 4.5 + */ + removeEvent(type: EventStringType, listener: Function, target: any): void; + } + /** + * @language zh_CN + * 事件数据。 + * @version DragonBones 4.5 + */ + class EventObject extends BaseObject { + /** + * @language zh_CN + * 动画开始。 + * @version DragonBones 4.5 + */ + static START: string; + /** + * @language zh_CN + * 动画循环播放一次完成。 + * @version DragonBones 4.5 + */ + static LOOP_COMPLETE: string; + /** + * @language zh_CN + * 动画播放完成。 + * @version DragonBones 4.5 + */ + static COMPLETE: string; + /** + * @language zh_CN + * 动画淡入开始。 + * @version DragonBones 4.5 + */ + static FADE_IN: string; + /** + * @language zh_CN + * 动画淡入完成。 + * @version DragonBones 4.5 + */ + static FADE_IN_COMPLETE: string; + /** + * @language zh_CN + * 动画淡出开始。 + * @version DragonBones 4.5 + */ + static FADE_OUT: string; + /** + * @language zh_CN + * 动画淡出完成。 + * @version DragonBones 4.5 + */ + static FADE_OUT_COMPLETE: string; + /** + * @language zh_CN + * 动画帧事件。 + * @version DragonBones 4.5 + */ + static FRAME_EVENT: string; + /** + * @language zh_CN + * 动画声音事件。 + * @version DragonBones 4.5 + */ + static SOUND_EVENT: string; + /** + * @private + */ + static toString(): string; + /** + * @language zh_CN + * 事件类型。 + * @version DragonBones 4.5 + */ + type: EventStringType; + /** + * @language zh_CN + * 事件名称。 (帧标签的名称或声音的名称) + * @version DragonBones 4.5 + */ + name: string; + /** + * @language zh_CN + * 扩展的数据。 + * @version DragonBones 4.5 + */ + data: any; + /** + * @language zh_CN + * 发出事件的骨架。 + * @version DragonBones 4.5 + */ + armature: Armature; + /** + * @language zh_CN + * 发出事件的骨骼。 + * @version DragonBones 4.5 + */ + bone: Bone; + /** + * @language zh_CN + * 发出事件的插槽。 + * @version DragonBones 4.5 + */ + slot: Slot; + /** + * @language zh_CN + * 发出事件的动画状态。 + * @version DragonBones 4.5 + */ + animationState: AnimationState; + /** + * @private + */ + frame: AnimationFrameData; + /** + * @language zh_CN + * 用户数据。 + * @version DragonBones 4.5 + */ + userData: any; + /** + * @inheritDoc + */ + protected _onClear(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @private + */ + class ColorTransform { + alphaMultiplier: number; + redMultiplier: number; + greenMultiplier: number; + blueMultiplier: number; + alphaOffset: number; + redOffset: number; + greenOffset: number; + blueOffset: number; + constructor(alphaMultiplier?: number, redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaOffset?: number, redOffset?: number, greenOffset?: number, blueOffset?: number); + copyFrom(value: ColorTransform): void; + identity(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 2D 矩阵。 + * @version DragonBones 3.0 + */ + class Matrix { + a: number; + b: number; + c: number; + d: number; + tx: number; + ty: number; + constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number); + /** + * @private + */ + toString(): string; + /** + * @language zh_CN + * 复制矩阵。 + * @param value 需要复制的矩阵。 + * @version DragonBones 3.0 + */ + copyFrom(value: Matrix): void; + /** + * @language zh_CN + * 转换为恒等矩阵。 + * @version DragonBones 3.0 + */ + identity(): void; + /** + * @language zh_CN + * 将当前矩阵与另一个矩阵相乘。 + * @param value 需要相乘的矩阵。 + * @version DragonBones 3.0 + */ + concat(value: Matrix): void; + /** + * @language zh_CN + * 转换为逆矩阵。 + * @version DragonBones 3.0 + */ + invert(): void; + /** + * @language zh_CN + * 将矩阵转换应用于指定点。 + * @param x 横坐标。 + * @param y 纵坐标。 + * @param result 应用转换之后的坐标。 + * @params delta 是否忽略 tx,ty 对坐标的转换。 + * @version DragonBones 3.0 + */ + transformPoint(x: number, y: number, result: { + x: number; + y: number; + }, delta?: boolean): void; + } +} +declare namespace dragonBonesOLD { + /** + * @private + */ + class Point { + x: number; + y: number; + constructor(x?: number, y?: number); + copyFrom(value: Point): void; + clear(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @private + */ + class Rectangle { + x: number; + y: number; + width: number; + height: number; + constructor(x?: number, y?: number, width?: number, height?: number); + copyFrom(value: Rectangle): void; + clear(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 2D 变换。 + * @version DragonBones 3.0 + */ + class Transform { + /** + * @language zh_CN + * 水平位移。 + * @version DragonBones 3.0 + */ + x: number; + /** + * @language zh_CN + * 垂直位移。 + * @version DragonBones 3.0 + */ + y: number; + /** + * @language zh_CN + * 水平倾斜。 (以弧度为单位) + * @version DragonBones 3.0 + */ + skewX: number; + /** + * @language zh_CN + * 垂直倾斜。 (以弧度为单位) + * @version DragonBones 3.0 + */ + skewY: number; + /** + * @language zh_CN + * 水平缩放。 + * @version DragonBones 3.0 + */ + scaleX: number; + /** + * @language zh_CN + * 垂直缩放。 + * @version DragonBones 3.0 + */ + scaleY: number; + /** + * @private + */ + static normalizeRadian(value: number): number; + /** + * @private + */ + constructor( + /** + * @language zh_CN + * 水平位移。 + * @version DragonBones 3.0 + */ + x?: number, + /** + * @language zh_CN + * 垂直位移。 + * @version DragonBones 3.0 + */ + y?: number, + /** + * @language zh_CN + * 水平倾斜。 (以弧度为单位) + * @version DragonBones 3.0 + */ + skewX?: number, + /** + * @language zh_CN + * 垂直倾斜。 (以弧度为单位) + * @version DragonBones 3.0 + */ + skewY?: number, + /** + * @language zh_CN + * 水平缩放。 + * @version DragonBones 3.0 + */ + scaleX?: number, + /** + * @language zh_CN + * 垂直缩放。 + * @version DragonBones 3.0 + */ + scaleY?: number); + /** + * @private + */ + toString(): string; + /** + * @private + */ + copyFrom(value: Transform): Transform; + /** + * @private + */ + identity(): Transform; + /** + * @private + */ + add(value: Transform): Transform; + /** + * @private + */ + minus(value: Transform): Transform; + /** + * @private + */ + fromMatrix(matrix: Matrix): Transform; + /** + * @language zh_CN + * 转换为矩阵。 + * @param 矩阵。 + * @version DragonBones 3.0 + */ + toMatrix(matrix: Matrix): Transform; + /** + * @language zh_CN + * 旋转。 (以弧度为单位) + * @version DragonBones 3.0 + */ + rotation: number; + } +} +declare namespace dragonBonesOLD { + /** + * @private + */ + abstract class TimelineData> extends BaseObject { + /** + * @private + */ + static toString(): string; + scale: number; + /** + * @private + */ + offset: number; + /** + * @private + */ + frames: Array; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @private + */ + class ZOrderTimelineData extends TimelineData { + static toString(): string; + } + /** + * @private + */ + class BoneTimelineData extends TimelineData { + static cacheFrame(cacheFrames: Array, cacheFrameIndex: number, globalTransformMatrix: Matrix): Matrix; + static toString(): string; + bone: BoneData; + originalTransform: Transform; + cachedFrames: Array; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + cacheFrames(cacheFrameCount: number): void; + } + /** + * @private + */ + class SlotTimelineData extends TimelineData { + static cacheFrame(cacheFrames: Array, cacheFrameIndex: number, globalTransformMatrix: Matrix): Matrix; + static toString(): string; + slot: SlotData; + cachedFrames: Array; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + cacheFrames(cacheFrameCount: number): void; + } + /** + * @private + */ + class FFDTimelineData extends TimelineData { + static toString(): string; + displayIndex: number; + skin: SkinData; + slot: SlotDisplayDataSet; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 动画数据。 + * @version DragonBones 3.0 + */ + class AnimationData extends TimelineData { + /** + * @private + */ + static toString(): string; + /** + * @private + */ + hasAsynchronyTimeline: boolean; + /** + * @language zh_CN + * 持续的帧数。 + * @version DragonBones 3.0 + */ + frameCount: number; + /** + * @language zh_CN + * 循环播放的次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + */ + playTimes: number; + /** + * @language zh_CN + * 开始的时间。 (以秒为单位) + * @version DragonBones 3.0 + */ + position: number; + /** + * @language zh_CN + * 持续的时间。 (以秒为单位) + * @version DragonBones 3.0 + */ + duration: number; + /** + * @language zh_CN + * 淡入混合的时间。 (以秒为单位) + * @version DragonBones 3.0 + */ + fadeInTime: number; + /** + * @private + */ + cacheTimeToFrameScale: number; + /** + * @language zh_CN + * 数据名称。 + * @version DragonBones 3.0 + */ + name: string; + /** + * @private + */ + animation: AnimationData; + /** + * @private + */ + zOrderTimeline: TimelineData; + /** + * @private + */ + boneTimelines: Map; + /** + * @private + */ + slotTimelines: Map; + /** + * @private + */ + ffdTimelines: Map>>; + /** + * @private + */ + cachedFrames: Array; + /** + * @private + */ + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + /** + * @private + */ + cacheFrames(value: number): void; + /** + * @private + */ + addBoneTimeline(value: BoneTimelineData): void; + /** + * @private + */ + addSlotTimeline(value: SlotTimelineData): void; + /** + * @private + */ + addFFDTimeline(value: FFDTimelineData): void; + /** + * @private + */ + getBoneTimeline(name: string): BoneTimelineData; + /** + * @private + */ + getSlotTimeline(name: string): SlotTimelineData; + /** + * @private + */ + getFFDTimeline(skinName: string, slotName: string, displayIndex: number): FFDTimelineData; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 骨架数据。 + * @see dragonBonesOLD.Armature + * @version DragonBones 3.0 + */ + class ArmatureData extends BaseObject { + private static _onSortSlots(a, b); + /** + * @private + */ + static toString(): string; + /** + * @language zh_CN + * 动画帧率。 + * @version DragonBones 3.0 + */ + frameRate: number; + /** + * @language zh_CN + * 骨架类型。 + * @see dragonBonesOLD.ArmatureType + * @version DragonBones 3.0 + */ + type: ArmatureType; + /** + * @language zh_CN + * 数据名称。 + * @version DragonBones 3.0 + */ + name: string; + /** + * @private + */ + parent: DragonBonesData; + /** + * @private + */ + userData: any; + /** + * @private + */ + aabb: Rectangle; + /** + * @language zh_CN + * 所有的骨骼数据。 + * @see dragonBonesOLD.BoneData + * @version DragonBones 3.0 + */ + bones: Map; + /** + * @language zh_CN + * 所有的插槽数据。 + * @see dragonBonesOLD.SlotData + * @version DragonBones 3.0 + */ + slots: Map; + /** + * @language zh_CN + * 所有的皮肤数据。 + * @see dragonBonesOLD.SkinData + * @version DragonBones 3.0 + */ + skins: Map; + /** + * @language zh_CN + * 所有的动画数据。 + * @see dragonBonesOLD.AnimationData + * @version DragonBones 3.0 + */ + animations: Map; + /** + * @private + */ + actions: Array; + /** + * @private + */ + cacheFrameRate: number; + /** + * @private + */ + scale: number; + private _boneDirty; + private _slotDirty; + private _defaultSkin; + private _defaultAnimation; + private _sortedBones; + private _sortedSlots; + private _bonesChildren; + /** + * @private + */ + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + private _sortBones(); + private _sortSlots(); + /** + * @private + */ + cacheFrames(value: number): void; + /** + * @private + */ + addBone(value: BoneData, parentName: string): void; + /** + * @private + */ + addSlot(value: SlotData): void; + /** + * @private + */ + addSkin(value: SkinData): void; + /** + * @private + */ + addAnimation(value: AnimationData): void; + /** + * @language zh_CN + * 获取指定名称的骨骼数据。 + * @param name 骨骼数据名称。 + * @see dragonBonesOLD.BoneData + * @version DragonBones 3.0 + */ + getBone(name: string): BoneData; + /** + * @language zh_CN + * 获取指定名称的插槽数据。 + * @param name 插槽数据名称。 + * @see dragonBonesOLD.SlotData + * @version DragonBones 3.0 + */ + getSlot(name: string): SlotData; + /** + * @language zh_CN + * 获取指定名称的皮肤数据。 + * @param name 皮肤数据名称。 + * @see dragonBonesOLD.SkinData + * @version DragonBones 3.0 + */ + getSkin(name: string): SkinData; + /** + * @language zh_CN + * 获取指定名称的动画数据。 + * @param name 动画数据名称。 + * @see dragonBonesOLD.AnimationData + * @version DragonBones 3.0 + */ + getAnimation(name: string): AnimationData; + /** + * @private + */ + sortedBones: Array; + /** + * @private + */ + sortedSlots: Array; + /** + * @language zh_CN + * 获取默认的皮肤数据。 + * @see dragonBonesOLD.SkinData + * @version DragonBones 4.5 + */ + defaultSkin: SkinData; + /** + * @language zh_CN + * 获取默认的动画数据。 + * @see dragonBonesOLD.AnimationData + * @version DragonBones 4.5 + */ + defaultAnimation: AnimationData; + } + /** + * @language zh_CN + * 骨骼数据。 + * @see dragonBonesOLD.Bone + * @version DragonBones 3.0 + */ + class BoneData extends BaseObject { + /** + * @private + */ + static toString(): string; + /** + * @private + */ + inheritTranslation: boolean; + /** + * @private + */ + inheritRotation: boolean; + /** + * @private + */ + inheritScale: boolean; + /** + * @private + */ + bendPositive: boolean; + /** + * @private + */ + chain: number; + /** + * @private + */ + chainIndex: number; + /** + * @private + */ + weight: number; + /** + * @private + */ + length: number; + /** + * @language zh_CN + * 数据名称。 + * @version DragonBones 3.0 + */ + name: string; + /** + * @language zh_CN + * 所属的父骨骼数据。 + * @version DragonBones 3.0 + */ + parent: BoneData; + /** + * @private + */ + ik: BoneData; + /** + * @private + */ + transform: Transform; + /** + * @private + */ + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @language zh_CN + * 插槽数据。 + * @see dragonBonesOLD.Slot + * @version DragonBones 3.0 + */ + class SlotData extends BaseObject { + /** + * @private + */ + static DEFAULT_COLOR: ColorTransform; + /** + * @private + */ + static generateColor(): ColorTransform; + /** + * @private + */ + static toString(): string; + /** + * @private + */ + displayIndex: number; + /** + * @private + */ + zOrder: number; + /** + * @private + */ + blendMode: BlendMode; + /** + * @language zh_CN + * 数据名称。 + * @version DragonBones 3.0 + */ + name: string; + /** + * @language zh_CN + * 所属的父骨骼数据。 + * @see dragonBonesOLD.BoneData + * @version DragonBones 3.0 + */ + parent: BoneData; + /** + * @private + */ + color: ColorTransform; + /** + * @private + */ + actions: Array; + /** + * @private + */ + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @language zh_CN + * 皮肤数据。 + * @version DragonBones 3.0 + */ + class SkinData extends BaseObject { + /** + * @private + */ + static toString(): string; + /** + * @language zh_CN + * 数据名称。 + * @version DragonBones 3.0 + */ + name: string; + /** + * @private + */ + slots: Map; + /** + * @private + */ + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + /** + * @private + */ + addSlot(value: SlotDisplayDataSet): void; + /** + * @private + */ + getSlot(name: string): SlotDisplayDataSet; + } + /** + * @private + */ + class SlotDisplayDataSet extends BaseObject { + static toString(): string; + slot: SlotData; + displays: Array; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @private + */ + class DisplayData extends BaseObject { + static toString(): string; + isRelativePivot: boolean; + type: DisplayType; + name: string; + texture: TextureData; + armature: ArmatureData; + mesh: MeshData; + pivot: Point; + transform: Transform; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @private + */ + class MeshData extends BaseObject { + static toString(): string; + skinned: boolean; + slotPose: Matrix; + uvs: Array; + vertices: Array; + vertexIndices: Array; + boneIndices: Array>; + weights: Array>; + boneVertices: Array>; + bones: Array; + inverseBindPose: Array; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 龙骨数据,包含多个骨架数据。 + * @see dragonBonesOLD.ArmatureData + * @version DragonBones 3.0 + */ + class DragonBonesData extends BaseObject { + /** + * @private + */ + static toString(): string; + /** + * @language zh_CN + * 是否开启共享搜索。 [true: 开启, false: 不开启] + * @default false + * @see dragonBonesOLD.ArmatureData + * @version DragonBones 4.5 + */ + autoSearch: boolean; + /** + * @language zh_CN + * 动画帧频。 + * @version DragonBones 3.0 + */ + frameRate: number; + /** + * @language zh_CN + * 数据名称。 + * @version DragonBones 3.0 + */ + name: string; + /** + * @language zh_CN + * 所有的骨架数据。 + * @see dragonBonesOLD.ArmatureData + * @version DragonBones 3.0 + */ + armatures: Map; + private _armatureNames; + /** + * @inheritDoc + */ + protected _onClear(): void; + /** + * @language zh_CN + * 获取指定名称的骨架。 + * @param name 骨架数据骨架名称。 + * @see dragonBonesOLD.ArmatureData + * @version DragonBones 3.0 + */ + getArmature(name: string): ArmatureData; + /** + * @language zh_CN + * 所有的骨架数据名称。 + * @see #armatures + * @version DragonBones 3.0 + */ + armatureNames: Array; + /** + * @deprecated + * @see dragonBonesOLD.BaseFactory#removeDragonBonesData() + */ + dispose(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @private + */ + class ActionData extends BaseObject { + static toString(): string; + type: ActionType; + bone: BoneData; + slot: SlotData; + data: Array; + constructor(); + protected _onClear(): void; + } + /** + * @private + */ + class EventData extends BaseObject { + static toString(): string; + type: EventType; + name: string; + data: any; + bone: BoneData; + slot: SlotData; + constructor(); + protected _onClear(): void; + } + /** + * @private + */ + abstract class FrameData extends BaseObject { + position: number; + duration: number; + prev: T; + next: T; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @private + */ + abstract class TweenFrameData extends FrameData { + static samplingCurve(curve: Array, frameCount: number): Array; + tweenEasing: number; + curve: Array; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @private + */ + class AnimationFrameData extends FrameData { + static toString(): string; + actions: Array; + events: Array; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @private + */ + class ZOrderFrameData extends FrameData { + zOrder: Array; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @private + */ + class BoneFrameData extends TweenFrameData { + static toString(): string; + tweenScale: boolean; + tweenRotate: number; + guideCurve: Array; + transform: Transform; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @private + */ + class SlotFrameData extends TweenFrameData { + static DEFAULT_COLOR: ColorTransform; + static generateColor(): ColorTransform; + static toString(): string; + displayIndex: number; + color: ColorTransform; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } + /** + * @private + */ + class ExtensionFrameData extends TweenFrameData { + static toString(): string; + type: ExtensionType; + tweens: Array; + keys: Array; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @private + */ + abstract class DataParser { + protected static DATA_VERSION_2_3: string; + protected static DATA_VERSION_3_0: string; + protected static DATA_VERSION_4_0: string; + protected static DATA_VERSION: string; + protected static TEXTURE_ATLAS: string; + protected static SUB_TEXTURE: string; + protected static FORMAT: string; + protected static IMAGE_PATH: string; + protected static WIDTH: string; + protected static HEIGHT: string; + protected static ROTATED: string; + protected static FRAME_X: string; + protected static FRAME_Y: string; + protected static FRAME_WIDTH: string; + protected static FRAME_HEIGHT: string; + protected static DRADON_BONES: string; + protected static ARMATURE: string; + protected static BONE: string; + protected static IK: string; + protected static SLOT: string; + protected static SKIN: string; + protected static DISPLAY: string; + protected static ANIMATION: string; + protected static Z_ORDER: string; + protected static FFD: string; + protected static FRAME: string; + protected static PIVOT: string; + protected static TRANSFORM: string; + protected static AABB: string; + protected static COLOR: string; + protected static FILTER: string; + protected static VERSION: string; + protected static IS_GLOBAL: string; + protected static FRAME_RATE: string; + protected static TYPE: string; + protected static NAME: string; + protected static PARENT: string; + protected static LENGTH: string; + protected static DATA: string; + protected static DISPLAY_INDEX: string; + protected static BLEND_MODE: string; + protected static INHERIT_TRANSLATION: string; + protected static INHERIT_ROTATION: string; + protected static INHERIT_SCALE: string; + protected static TARGET: string; + protected static BEND_POSITIVE: string; + protected static CHAIN: string; + protected static WEIGHT: string; + protected static FADE_IN_TIME: string; + protected static PLAY_TIMES: string; + protected static SCALE: string; + protected static OFFSET: string; + protected static POSITION: string; + protected static DURATION: string; + protected static TWEEN_EASING: string; + protected static TWEEN_ROTATE: string; + protected static TWEEN_SCALE: string; + protected static CURVE: string; + protected static GUIDE_CURVE: string; + protected static EVENT: string; + protected static SOUND: string; + protected static ACTION: string; + protected static ACTIONS: string; + protected static DEFAULT_ACTIONS: string; + protected static X: string; + protected static Y: string; + protected static SKEW_X: string; + protected static SKEW_Y: string; + protected static SCALE_X: string; + protected static SCALE_Y: string; + protected static ALPHA_OFFSET: string; + protected static RED_OFFSET: string; + protected static GREEN_OFFSET: string; + protected static BLUE_OFFSET: string; + protected static ALPHA_MULTIPLIER: string; + protected static RED_MULTIPLIER: string; + protected static GREEN_MULTIPLIER: string; + protected static BLUE_MULTIPLIER: string; + protected static UVS: string; + protected static VERTICES: string; + protected static TRIANGLES: string; + protected static WEIGHTS: string; + protected static SLOT_POSE: string; + protected static BONE_POSE: string; + protected static TWEEN: string; + protected static KEY: string; + protected static COLOR_TRANSFORM: string; + protected static TIMELINE: string; + protected static PIVOT_X: string; + protected static PIVOT_Y: string; + protected static Z: string; + protected static LOOP: string; + protected static AUTO_TWEEN: string; + protected static HIDE: string; + protected static _getArmatureType(value: string): ArmatureType; + protected static _getDisplayType(value: string): DisplayType; + protected static _getBlendMode(value: string): BlendMode; + protected static _getActionType(value: string): ActionType; + protected _data: DragonBonesData; + protected _armature: ArmatureData; + protected _skin: SkinData; + protected _slotDisplayDataSet: SlotDisplayDataSet; + protected _mesh: MeshData; + protected _animation: AnimationData; + protected _timeline: any; + protected _isOldData: boolean; + protected _isGlobalTransform: boolean; + protected _isAutoTween: boolean; + protected _animationTweenEasing: number; + protected _timelinePivot: Point; + protected _helpPoint: Point; + protected _helpTransformA: Transform; + protected _helpTransformB: Transform; + protected _helpMatrix: Matrix; + protected _rawBones: Array; + constructor(); + /** + * @private + */ + abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData; + /** + * @private + */ + abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): void; + private _getTimelineFrameMatrix(animation, timeline, position, transform); + protected _globalToLocal(armature: ArmatureData): void; + protected _mergeFrameToAnimationTimeline(framePostion: number, actions: Array, events: Array): void; + /** + * @deprecated + * @see dragonBonesOLD.BaseFactory#parseDragonBonesData() + */ + static parseDragonBonesData(rawData: any): DragonBonesData; + /** + * @deprecated + * @see dragonBonesOLD.BaseFactory#parsetTextureAtlasData() + */ + static parseTextureAtlasData(rawData: any, scale?: number): any; + } +} +declare namespace dragonBonesOLD { + /** + * @private + */ + class ObjectDataParser extends DataParser { + /** + * @private + */ + protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean; + /** + * @private + */ + protected static _getNumber(rawData: any, key: string, defaultValue: number): number; + /** + * @private + */ + protected static _getString(rawData: any, key: string, defaultValue: string): string; + /** + * @private + */ + protected static _getParameter(rawData: Array, index: number, defaultValue: any): any; + /** + * @private + */ + constructor(); + /** + * @private + */ + protected _parseArmature(rawData: any, scale: number): ArmatureData; + /** + * @private + */ + protected _parseBone(rawData: any): BoneData; + /** + * @private + */ + protected _parseIK(rawData: any): void; + /** + * @private + */ + protected _parseSlot(rawData: any, zOrder: number): SlotData; + /** + * @private + */ + protected _parseSkin(rawData: any): SkinData; + /** + * @private + */ + protected _parseSlotDisplaySet(rawData: any): SlotDisplayDataSet; + /** + * @private + */ + protected _parseDisplay(rawData: any): DisplayData; + /** + * @private + */ + protected _parseMesh(rawData: any): MeshData; + /** + * @private + */ + protected _parseAnimation(rawData: any): AnimationData; + /** + * @private + */ + protected _parseBoneTimeline(rawData: any): BoneTimelineData; + /** + * @private + */ + protected _parseSlotTimeline(rawData: any): SlotTimelineData; + /** + * @private + */ + protected _parseFFDTimeline(rawData: any): FFDTimelineData; + /** + * @private + */ + protected _parseAnimationFrame(rawData: any, frameStart: number, frameCount: number): AnimationFrameData; + /** + * @private + */ + protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): ZOrderFrameData; + /** + * @private + */ + protected _parseBoneFrame(rawData: Object, frameStart: number, frameCount: number): BoneFrameData; + /** + * @private + */ + protected _parseSlotFrame(rawData: any, frameStart: number, frameCount: number): SlotFrameData; + /** + * @private + */ + protected _parseFFDFrame(rawData: any, frameStart: number, frameCount: number): ExtensionFrameData; + /** + * @private + */ + protected _parseTweenFrame>(rawData: any, frame: T, frameStart: number, frameCount: number): void; + /** + * @private + */ + protected _parseFrame>(rawData: any, frame: T, frameStart: number, frameCount: number): void; + /** + * @private + */ + protected _parseTimeline>(rawData: Object, timeline: TimelineData, frameParser: (rawData: any, frameStart: number, frameCount: number) => T): void; + /** + * @private + */ + protected _parseActionData(rawData: any, actions: Array, bone: BoneData, slot: SlotData): void; + /** + * @private + */ + protected _parseEventData(rawData: any, events: Array, bone: BoneData, slot: SlotData): void; + /** + * @private + */ + protected _parseTransform(rawData: Object, transform: Transform): void; + /** + * @private + */ + protected _parseColorTransform(rawData: Object, color: ColorTransform): void; + /** + * @inheritDoc + */ + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData; + /** + * @inheritDoc + */ + parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale?: number): void; + /** + * @private + */ + private static _instance; + /** + * @deprecated + * @see dragonBonesOLD.BaseFactory#parseDragonBonesData() + */ + static getInstance(): ObjectDataParser; + } +} +declare namespace dragonBonesOLD { + /** + * @language zh_CN + * 贴图集数据。 + * @version DragonBones 3.0 + */ + abstract class TextureAtlasData extends BaseObject { + /** + * @language zh_CN + * 是否开启共享搜索。 [true: 开启, false: 不开启] + * @default false + * @version DragonBones 4.5 + */ + autoSearch: boolean; + /** + * @language zh_CN + * 贴图集缩放系数。 + * @version DragonBones 3.0 + */ + scale: number; + /** + * @language zh_CN + * 贴图集名称。 + * @version DragonBones 3.0 + */ + name: string; + /** + * @language zh_CN + * 贴图集图片路径。 + * @version DragonBones 3.0 + */ + imagePath: string; + /** + * @inheritDoc + */ + protected _onClear(): void; + /** + * @private + */ + getTexture(name: string): TextureData; + } + /** + * @private + */ + abstract class TextureData extends BaseObject { + static generateRectangle(): Rectangle; + rotated: boolean; + name: string; + frame: Rectangle; + parent: TextureAtlasData; + region: Rectangle; + constructor(); + /** + * @inheritDoc + */ + protected _onClear(): void; + } +} +declare namespace dragonBonesOLD { + /** + * @private + */ + type BuildArmaturePackage = { + dataName?: string; + textureAtlasName?: string; + data?: DragonBonesData; + armature?: ArmatureData; + skin?: SkinData; + }; + /** + * @language zh_CN + * 创建骨架的基础工厂。 (通常只需要一个全局工厂实例) + * @see dragonBonesOLD.DragonBonesData + * @see dragonBonesOLD.TextureAtlasData + * @see dragonBonesOLD.ArmatureData + * @see dragonBonesOLD.Armature + * @version DragonBones 3.0 + */ + abstract class BaseFactory { + protected static _defaultParser: ObjectDataParser; + /** + * @language zh_CN + * 是否开启共享搜索。 [true: 开启, false: 不开启] + * 如果开启,创建一个骨架时,可以从多个龙骨数据中寻找骨架数据,或贴图集数据中寻找贴图数据。 (通常在有共享导出的数据时开启) + * @see dragonBonesOLD.DragonBonesData#autoSearch + * @see dragonBonesOLD.TextureAtlasData#autoSearch + * @version DragonBones 4.5 + */ + autoSearch: boolean; + /** + * @private + */ + protected _dataParser: DataParser; + /** + * @private + */ + protected _dragonBonesDataMap: Map; + /** + * @private + */ + protected _textureAtlasDataMap: Map>; + /** + * @private + */ + constructor(dataParser?: DataParser); + /** + * @private + */ + protected _getTextureData(textureAtlasName: string, textureName: string): TextureData; + /** + * @private + */ + protected _fillBuildArmaturePackage(dataPackage: BuildArmaturePackage, dragonBonesName: string, armatureName: string, skinName: string, textureAtlasName: string): boolean; + /** + * @private + */ + protected _buildBones(dataPackage: BuildArmaturePackage, armature: Armature): void; + /** + * @private + */ + protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void; + /** + * @private + */ + protected _replaceSlotDisplay(dataPackage: BuildArmaturePackage, displayData: DisplayData, slot: Slot, displayIndex: number): void; + /** + * @private + */ + protected abstract _generateTextureAtlasData(textureAtlasData: TextureAtlasData, textureAtlas: any): TextureAtlasData; + /** + * @private + */ + protected abstract _generateArmature(dataPackage: BuildArmaturePackage): Armature; + /** + * @private + */ + protected abstract _generateSlot(dataPackage: BuildArmaturePackage, slotDisplayDataSet: SlotDisplayDataSet, armature: Armature): Slot; + /** + * @language zh_CN + * 解析并添加龙骨数据。 + * @param rawData 需要解析的原始数据。 (JSON) + * @param name 为数据提供一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。 + * @returns DragonBonesData + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBonesOLD.DragonBonesData + * @version DragonBones 4.5 + */ + parseDragonBonesData(rawData: any, name?: string, scale?: number): DragonBonesData; + /** + * @language zh_CN + * 解析并添加贴图集数据。 + * @param rawData 需要解析的原始数据。 (JSON) + * @param textureAtlas 贴图集数据。 (JSON) + * @param name 为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。 + * @param scale 为贴图集设置一个缩放值。 + * @returns 贴图集数据 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBonesOLD.TextureAtlasData + * @version DragonBones 4.5 + */ + parseTextureAtlasData(rawData: any, textureAtlas: Object, name?: string, scale?: number): TextureAtlasData; + /** + * @language zh_CN + * 获取指定名称的龙骨数据。 + * @param name 数据名称。 + * @returns DragonBonesData + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBonesOLD.DragonBonesData + * @version DragonBones 3.0 + */ + getDragonBonesData(name: string): DragonBonesData; + /** + * @language zh_CN + * 添加龙骨数据。 + * @param data 龙骨数据。 + * @param name 为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。 + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBonesOLD.DragonBonesData + * @version DragonBones 3.0 + */ + addDragonBonesData(data: DragonBonesData, name?: string): void; + /** + * @language zh_CN + * 移除龙骨数据。 + * @param name 数据名称。 + * @param disposeData 是否释放数据。 [false: 不释放, true: 释放] + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBonesOLD.DragonBonesData + * @version DragonBones 3.0 + */ + removeDragonBonesData(name: string, disposeData?: boolean): void; + /** + * @language zh_CN + * 获取指定名称的贴图集数据列表。 + * @param name 数据名称。 + * @returns 贴图集数据列表。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBonesOLD.textures.TextureAtlasData + * @version DragonBones 3.0 + */ + getTextureAtlasData(name: string): Array; + /** + * @language zh_CN + * 添加贴图集数据。 + * @param data 贴图集数据。 + * @param name 为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBonesOLD.textures.TextureAtlasData + * @version DragonBones 3.0 + */ + addTextureAtlasData(data: TextureAtlasData, name?: string): void; + /** + * @language zh_CN + * 移除贴图集数据。 + * @param name 数据名称。 + * @param disposeData 是否释放数据。 [false: 不释放, true: 释放] + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBonesOLD.textures.TextureAtlasData + * @version DragonBones 3.0 + */ + removeTextureAtlasData(name: string, disposeData?: boolean): void; + /** + * @language zh_CN + * 清除所有的数据。 + * @param disposeData 是否释放数据。 [false: 不释放, true: 释放] + * @version DragonBones 4.5 + */ + clear(disposeData?: boolean): void; + /** + * @language zh_CN + * 创建一个指定名称的骨架。 + * @param armatureName 骨架数据名称。 + * @param dragonBonesName 龙骨数据名称,如果未设置,将检索所有的龙骨数据,当多个龙骨数据中包含同名的骨架数据时,可能无法创建出准确的骨架。 + * @param skinName 皮肤名称,如果未设置,则使用默认皮肤。 + * @param textureAtlasName 贴图集数据名称,如果未设置,则使用龙骨数据。 + * @returns 骨架 + * @see dragonBonesOLD.Armature + * @version DragonBones 3.0 + */ + buildArmature(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): Armature; + /** + * @language zh_CN + * 将指定骨架的动画替换成其他骨架的动画。 (通常这些骨架应该具有相同的骨架结构) + * @param toArmature 指定的骨架。 + * @param fromArmatreName 其他骨架的名称。 + * @param fromSkinName 其他骨架的皮肤名称,如果未设置,则使用默认皮肤。 + * @param fromDragonBonesDataName 其他骨架属于的龙骨数据名称,如果未设置,则检索所有的龙骨数据。 + * @param ifRemoveOriginalAnimationList 是否移除原有的动画。 [true: 移除, false: 不移除] + * @returns 是否替换成功。 [true: 成功, false: 不成功] + * @see dragonBonesOLD.Armature + * @version DragonBones 4.5 + */ + copyAnimationsToArmature(toArmature: Armature, fromArmatreName: string, fromSkinName?: string, fromDragonBonesDataName?: string, ifRemoveOriginalAnimationList?: boolean): boolean; + /** + * @language zh_CN + * 将指定插槽的显示对象替换为指定资源创造出的显示对象。 + * @param dragonBonesName 指定的龙骨数据名称。 + * @param armatureName 指定的骨架名称。 + * @param slotName 指定的插槽名称。 + * @param displayName 指定的显示对象名称。 + * @param slot 指定的插槽实例。 + * @param displayIndex 要替换的显示对象的索引,如果未设置,则替换当前正在显示的显示对象。 + * @version DragonBones 4.5 + */ + replaceSlotDisplay(dragonBonesName: string, armatureName: string, slotName: string, displayName: string, slot: Slot, displayIndex?: number): void; + /** + * @language zh_CN + * 将指定插槽的显示对象列表替换为指定资源创造出的显示对象列表。 + * @param dragonBonesName 指定的 DragonBonesData 名称。 + * @param armatureName 指定的骨架名称。 + * @param slotName 指定的插槽名称。 + * @param slot 指定的插槽实例。 + * @version DragonBones 4.5 + */ + replaceSlotDisplayList(dragonBonesName: string, armatureName: string, slotName: string, slot: Slot): void; + /** + * @private + */ + getAllDragonBonesData(): Map; + /** + * @private + */ + getAllTextureAtlasData(): Map>; + } +} + +declare let jsb: any; +/** Running in the editor. */ +declare let CC_EDITOR: boolean; +/** Preview in browser or simulator. */ +declare let CC_PREVIEW: boolean; +/** Running in the editor or preview. */ +declare let CC_DEV: boolean; +/** Running in the editor or preview, or build in debug mode. */ +declare let CC_DEBUG: boolean; +/** Running in published project. */ +declare let CC_BUILD: boolean; +/** Running in native platform (mobile app, desktop app, or simulator). */ +declare let CC_JSB: boolean; +/** Running in the engine's unit test. */ +declare let CC_TEST: boolean; diff --git a/Cocos/1.x/out/dragonBones.d.ts b/Cocos/1.x/out/dragonBones.d.ts new file mode 100644 index 00000000..4bbb97be --- /dev/null +++ b/Cocos/1.x/out/dragonBones.d.ts @@ -0,0 +1,6547 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + const enum BinaryOffset { + WeigthBoneCount = 0, + WeigthFloatOffset = 1, + WeigthBoneIndices = 2, + GeometryVertexCount = 0, + GeometryTriangleCount = 1, + GeometryFloatOffset = 2, + GeometryWeightOffset = 3, + GeometryVertexIndices = 4, + TimelineScale = 0, + TimelineOffset = 1, + TimelineKeyFrameCount = 2, + TimelineFrameValueCount = 3, + TimelineFrameValueOffset = 4, + TimelineFrameOffset = 5, + FramePosition = 0, + FrameTweenType = 1, + FrameTweenEasingOrCurveSampleCount = 2, + FrameCurveSamples = 3, + DeformVertexOffset = 0, + DeformCount = 1, + DeformValueCount = 2, + DeformValueOffset = 3, + DeformFloatOffset = 4, + } + /** + * @private + */ + const enum ArmatureType { + Armature = 0, + MovieClip = 1, + Stage = 2, + } + /** + * @private + */ + const enum BoneType { + Bone = 0, + Surface = 1, + } + /** + * @private + */ + const enum DisplayType { + Image = 0, + Armature = 1, + Mesh = 2, + BoundingBox = 3, + Path = 4, + } + /** + * - Bounding box type. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框类型。 + * @version DragonBones 5.0 + * @language zh_CN + */ + const enum BoundingBoxType { + Rectangle = 0, + Ellipse = 1, + Polygon = 2, + } + /** + * @private + */ + const enum ActionType { + Play = 0, + Frame = 10, + Sound = 11, + } + /** + * @private + */ + const enum BlendMode { + Normal = 0, + Add = 1, + Alpha = 2, + Darken = 3, + Difference = 4, + Erase = 5, + HardLight = 6, + Invert = 7, + Layer = 8, + Lighten = 9, + Multiply = 10, + Overlay = 11, + Screen = 12, + Subtract = 13, + } + /** + * @private + */ + const enum TweenType { + None = 0, + Line = 1, + Curve = 2, + QuadIn = 3, + QuadOut = 4, + QuadInOut = 5, + } + /** + * @private + */ + const enum TimelineType { + Action = 0, + ZOrder = 1, + BoneAll = 10, + BoneTranslate = 11, + BoneRotate = 12, + BoneScale = 13, + Surface = 50, + BoneAlpha = 60, + SlotDisplay = 20, + SlotColor = 21, + SlotDeform = 22, + SlotZIndex = 23, + SlotAlpha = 24, + IKConstraint = 30, + AnimationProgress = 40, + AnimationWeight = 41, + AnimationParameter = 42, + } + /** + * - Offset mode. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 偏移模式。 + * @version DragonBones 5.5 + * @language zh_CN + */ + const enum OffsetMode { + None = 0, + Additive = 1, + Override = 2, + } + /** + * - Animation fade out mode. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出模式。 + * @version DragonBones 4.5 + * @language zh_CN + */ + const enum AnimationFadeOutMode { + /** + * - Fade out the animation states of the same layer. + * @language en_US + */ + /** + * - 淡出同层的动画状态。 + * @language zh_CN + */ + SameLayer = 1, + /** + * - Fade out the animation states of the same group. + * @language en_US + */ + /** + * - 淡出同组的动画状态。 + * @language zh_CN + */ + SameGroup = 2, + /** + * - Fade out the animation states of the same layer and group. + * @language en_US + */ + /** + * - 淡出同层并且同组的动画状态。 + * @language zh_CN + */ + SameLayerAndGroup = 3, + /** + * - Fade out of all animation states. + * @language en_US + */ + /** + * - 淡出所有的动画状态。 + * @language zh_CN + */ + All = 4, + /** + * - Does not replace the animation state with the same name. + * @language en_US + */ + /** + * - 不替换同名的动画状态。 + * @language zh_CN + */ + Single = 5, + } + /** + * @private + */ + const enum AnimationBlendType { + None = 0, + E1D = 1, + } + /** + * @private + */ + const enum AnimationBlendMode { + Additive = 0, + Override = 1, + } + /** + * @private + */ + const enum ConstraintType { + IK = 0, + Path = 1, + } + /** + * @private + */ + const enum PositionMode { + Fixed = 0, + Percent = 1, + } + /** + * @private + */ + const enum SpacingMode { + Length = 0, + Fixed = 1, + Percent = 2, + } + /** + * @private + */ + const enum RotateMode { + Tangent = 0, + Chain = 1, + ChainScale = 2, + } + /** + * @private + */ + interface Map { + [key: string]: T; + } + /** + * @private + */ + class DragonBones { + static readonly VERSION: string; + static yDown: boolean; + static debug: boolean; + static debugDraw: boolean; + private readonly _clock; + private readonly _events; + private readonly _objects; + private _eventManager; + constructor(eventManager: IEventDispatcher); + advanceTime(passedTime: number): void; + bufferEvent(value: EventObject): void; + bufferObject(object: BaseObject): void; + readonly clock: WorldClock; + readonly eventManager: IEventDispatcher; + } +} +declare var __extends: any; +declare var exports: any; +declare var module: any; +declare var define: any; +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The BaseObject is the base class for all objects in the DragonBones framework. + * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 基础对象,通常 DragonBones 的对象都继承自该类。 + * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。 + * @version DragonBones 4.5 + * @language zh_CN + */ + abstract class BaseObject { + private static _hashCode; + private static _defaultMaxCount; + private static readonly _maxCountMap; + private static readonly _poolsMap; + private static _returnObject(object); + static toString(): string; + /** + * - Set the maximum cache count of the specify object pool. + * @param objectConstructor - The specify class. (Set all object pools max cache count if not set) + * @param maxCount - Max count. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 设置特定对象池的最大缓存数量。 + * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量) + * @param maxCount - 最大缓存数量。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static setMaxCount(objectConstructor: (typeof BaseObject) | null, maxCount: number): void; + /** + * - Clear the cached instances of a specify object pool. + * @param objectConstructor - Specify class. (Clear all cached instances if not set) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除特定对象池的缓存实例。 + * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例) + * @version DragonBones 4.5 + * @language zh_CN + */ + static clearPool(objectConstructor?: (typeof BaseObject) | null): void; + /** + * - Get an instance of the specify class from object pool. + * @param objectConstructor - The specify class. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从对象池中获取特定类的实例。 + * @param objectConstructor - 特定的类。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static borrowObject(objectConstructor: { + new (): T; + }): T; + /** + * - A unique identification number assigned to the object. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分配给此实例的唯一标识号。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly hashCode: number; + private _isInPool; + protected abstract _onClear(): void; + /** + * - Clear the object and return it back to object pool。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除该实例的所有数据并将其返还对象池。 + * @version DragonBones 4.5 + * @language zh_CN + */ + returnToPool(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - 2D Transform matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 转换矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Matrix { + /** + * - The value that affects the positioning of pixels along the x axis when scaling or rotating an image. + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 缩放或旋转图像时影响像素沿 x 轴定位的值。 + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + a: number; + /** + * - The value that affects the positioning of pixels along the y axis when rotating or skewing an image. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转或倾斜图像时影响像素沿 y 轴定位的值。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + b: number; + /** + * - The value that affects the positioning of pixels along the x axis when rotating or skewing an image. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转或倾斜图像时影响像素沿 x 轴定位的值。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + c: number; + /** + * - The value that affects the positioning of pixels along the y axis when scaling or rotating an image. + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 缩放或旋转图像时影响像素沿 y 轴定位的值。 + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + d: number; + /** + * - The distance by which to translate each point along the x axis. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 沿 x 轴平移每个点的距离。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + tx: number; + /** + * - The distance by which to translate each point along the y axis. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 沿 y 轴平移每个点的距离。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + ty: number; + /** + * @private + */ + constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number); + toString(): string; + /** + * @private + */ + copyFrom(value: Matrix): Matrix; + /** + * @private + */ + copyFromArray(value: Array, offset?: number): Matrix; + /** + * - Convert to unit matrix. + * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为单位矩阵。 + * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + identity(): Matrix; + /** + * - Multiplies the current matrix with another matrix. + * @param value - The matrix that needs to be multiplied. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将当前矩阵与另一个矩阵相乘。 + * @param value - 需要相乘的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + concat(value: Matrix): Matrix; + /** + * - Convert to inverse matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为逆矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + invert(): Matrix; + /** + * - Apply a matrix transformation to a specific point. + * @param x - X coordinate. + * @param y - Y coordinate. + * @param result - The point after the transformation is applied. + * @param delta - Whether to ignore tx, ty's conversion to point. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将矩阵转换应用于特定点。 + * @param x - 横坐标。 + * @param y - 纵坐标。 + * @param result - 应用转换之后的点。 + * @param delta - 是否忽略 tx,ty 对点的转换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + transformPoint(x: number, y: number, result: { + x: number; + y: number; + }, delta?: boolean): void; + /** + * @private + */ + transformRectangle(rectangle: { + x: number; + y: number; + width: number; + height: number; + }, delta?: boolean): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - 2D Transform. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 变换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Transform { + /** + * @private + */ + static readonly PI: number; + /** + * @private + */ + static readonly PI_D: number; + /** + * @private + */ + static readonly PI_H: number; + /** + * @private + */ + static readonly PI_Q: number; + /** + * @private + */ + static readonly RAD_DEG: number; + /** + * @private + */ + static readonly DEG_RAD: number; + /** + * @private + */ + static normalizeRadian(value: number): number; + /** + * - Horizontal translate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 水平位移。 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - Vertical translate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 垂直位移。 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - Skew. (In radians) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 倾斜。 (以弧度为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + skew: number; + /** + * - rotation. (In radians) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转。 (以弧度为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + rotation: number; + /** + * - Horizontal Scaling. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 水平缩放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + scaleX: number; + /** + * - Vertical scaling. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 垂直缩放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + scaleY: number; + /** + * @private + */ + constructor(x?: number, y?: number, skew?: number, rotation?: number, scaleX?: number, scaleY?: number); + toString(): string; + /** + * @private + */ + copyFrom(value: Transform): Transform; + /** + * @private + */ + identity(): Transform; + /** + * @private + */ + add(value: Transform): Transform; + /** + * @private + */ + minus(value: Transform): Transform; + /** + * @private + */ + fromMatrix(matrix: Matrix): Transform; + /** + * @private + */ + toMatrix(matrix: Matrix): Transform; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class ColorTransform { + alphaMultiplier: number; + redMultiplier: number; + greenMultiplier: number; + blueMultiplier: number; + alphaOffset: number; + redOffset: number; + greenOffset: number; + blueOffset: number; + constructor(alphaMultiplier?: number, redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaOffset?: number, redOffset?: number, greenOffset?: number, blueOffset?: number); + copyFrom(value: ColorTransform): void; + identity(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The Point object represents a location in a two-dimensional coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Point 对象表示二维坐标系统中的某个位置。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Point { + /** + * - The horizontal coordinate. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 该点的水平坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - The vertical coordinate. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 该点的垂直坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @param x - The horizontal coordinate. + * @param y - The vertical coordinate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。 + * @param x - 该对象的x属性值,默认为 0.0。 + * @param y - 该对象的y属性值,默认为 0.0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(x?: number, y?: number); + /** + * @private + */ + copyFrom(value: Point): void; + /** + * @private + */ + clear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its + * width and its height.
+ * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of + * one property has no effect on the others. However, the right and bottom properties are integrally related to those + * four properties. For example, if you change the value of the right property, the value of the width property changes; + * if you change the bottom property, the value of the height property changes. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
+ * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 + * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width + * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Rectangle { + /** + * - The x coordinate of the top-left corner of the rectangle. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形左上角的 x 坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - The y coordinate of the top-left corner of the rectangle. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形左上角的 y 坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - The width of the rectangle, in pixels. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形的宽度(以像素为单位)。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + width: number; + /** + * - 矩形的高度(以像素为单位)。 + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - The height of the rectangle, in pixels. + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + height: number; + /** + * @private + */ + constructor(x?: number, y?: number, width?: number, height?: number); + /** + * @private + */ + copyFrom(value: Rectangle): void; + /** + * @private + */ + clear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The user custom data. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 用户自定义数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + class UserData extends BaseObject { + static toString(): string; + /** + * - The custom int numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly ints: Array; + /** + * - The custom float numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly floats: Array; + /** + * - The custom strings. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly strings: Array; + protected _onClear(): void; + /** + * - Get the custom int number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getInt(index?: number): number; + /** + * - Get the custom float number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getFloat(index?: number): number; + /** + * - Get the custom string. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getString(index?: number): string; + } + /** + * @private + */ + class ActionData extends BaseObject { + static toString(): string; + type: ActionType; + name: string; + bone: BoneData | null; + slot: SlotData | null; + data: UserData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The DragonBones data. + * A DragonBones data contains multiple armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据。 + * 一个龙骨数据包含多个骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + class DragonBonesData extends BaseObject { + static toString(): string; + /** + * @private + */ + autoSearch: boolean; + /** + * - The animation frame rate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画帧频。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameRate: number; + /** + * - The data version. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 数据版本。 + * @version DragonBones 3.0 + * @language zh_CN + */ + version: string; + /** + * - The DragonBones data name. + * The name is consistent with the DragonBones project name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据名称。 + * 该名称与龙骨项目名保持一致。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + stage: ArmatureData | null; + /** + * - All armature data names. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly armatureNames: Array; + /** + * @private + */ + readonly armatures: Map; + /** + * @private + */ + userData: UserData | null; + protected _onClear(): void; + /** + * - Get a specific armature data. + * @param armatureName - The armature data name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param armatureName - 骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getArmature(armatureName: string): ArmatureData | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The armature data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class ArmatureData extends BaseObject { + static toString(): string; + /** + * @private + */ + type: ArmatureType; + /** + * - The animation frame rate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画帧率。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameRate: number; + /** + * @private + */ + cacheFrameRate: number; + /** + * @private + */ + scale: number; + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly aabb: Rectangle; + /** + * - The names of all the animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的动画数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animationNames: Array; + /** + * @private + */ + readonly sortedBones: Array; + /** + * @private + */ + readonly sortedSlots: Array; + /** + * @private + */ + readonly defaultActions: Array; + /** + * @private + */ + readonly actions: Array; + /** + * @private + */ + readonly bones: Map; + /** + * @private + */ + readonly slots: Map; + /** + * @private + */ + readonly constraints: Map; + /** + * @private + */ + readonly skins: Map; + /** + * @private + */ + readonly animations: Map; + /** + * - The default skin data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 默认插槽数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + defaultSkin: SkinData | null; + /** + * - The default animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 默认动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + defaultAnimation: AnimationData | null; + /** + * @private + */ + canvas: CanvasData | null; + /** + * @private + */ + userData: UserData | null; + /** + * @private + */ + parent: DragonBonesData; + protected _onClear(): void; + /** + * - Get a specific done data. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼数据。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getBone(boneName: string): BoneData | null; + /** + * - Get a specific slot data. + * @param slotName - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽数据。 + * @param slotName - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlot(slotName: string): SlotData | null; + /** + * @private + */ + getConstraint(constraintName: string): ConstraintData | null; + /** + * - Get a specific skin data. + * @param skinName - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定皮肤数据。 + * @param skinName - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getSkin(skinName: string): SkinData | null; + /** + * @private + */ + getMesh(skinName: string, slotName: string, meshName: string): MeshDisplayData | null; + /** + * - Get a specific animation data. + * @param animationName - The animation animationName. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的动画数据。 + * @param animationName - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getAnimation(animationName: string): AnimationData | null; + } + /** + * - The bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class BoneData extends BaseObject { + static toString(): string; + /** + * @private + */ + inheritTranslation: boolean; + /** + * @private + */ + inheritRotation: boolean; + /** + * @private + */ + inheritScale: boolean; + /** + * @private + */ + inheritReflection: boolean; + /** + * @private + */ + type: BoneType; + /** + * - The bone length. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼长度。 + * @version DragonBones 3.0 + * @language zh_CN + */ + length: number; + /** + * @private + */ + alpha: number; + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly transform: Transform; + /** + * @private + */ + userData: UserData | null; + /** + * - The parent bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 父骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + parent: BoneData | null; + protected _onClear(): void; + } + /** + * - The slot data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class SlotData extends BaseObject { + static toString(): string; + /** + * @private + */ + blendMode: BlendMode; + /** + * @private + */ + displayIndex: number; + /** + * @private + */ + zOrder: number; + /** + * @private + */ + zIndex: number; + /** + * @private + */ + alpha: number; + /** + * - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + color: ColorTransform; + /** + * @private + */ + userData: UserData | null; + /** + * - The parent bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 父骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + parent: BoneData; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class CanvasData extends BaseObject { + static toString(): string; + hasBackground: boolean; + color: number; + x: number; + y: number; + width: number; + height: number; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The skin data, typically a armature data instance contains at least one skinData. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class SkinData extends BaseObject { + static toString(): string; + /** + * - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly displays: Map>; + /** + * @private + */ + parent: ArmatureData; + protected _onClear(): void; + /** + * @private + */ + getDisplay(slotName: string, displayName: string): DisplayData | null; + /** + * @private + */ + getDisplays(slotName: string): Array | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + abstract class ConstraintData extends BaseObject { + order: number; + name: string; + type: ConstraintType; + target: BoneData; + root: BoneData; + bone: BoneData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class GeometryData { + isShared: boolean; + inheritDeform: boolean; + offset: number; + data: DragonBonesData; + weight: WeightData | null; + clear(): void; + shareFrom(value: GeometryData): void; + readonly vertexCount: number; + readonly triangleCount: number; + } + /** + * @private + */ + abstract class DisplayData extends BaseObject { + type: DisplayType; + name: string; + path: string; + readonly transform: Transform; + parent: SkinData; + protected _onClear(): void; + } + /** + * @private + */ + class ImageDisplayData extends DisplayData { + static toString(): string; + readonly pivot: Point; + texture: TextureData | null; + protected _onClear(): void; + } + /** + * @private + */ + class ArmatureDisplayData extends DisplayData { + static toString(): string; + inheritAnimation: boolean; + readonly actions: Array; + armature: ArmatureData | null; + protected _onClear(): void; + /** + * @private + */ + addAction(value: ActionData): void; + } + /** + * @private + */ + class MeshDisplayData extends DisplayData { + static toString(): string; + readonly geometry: GeometryData; + texture: TextureData | null; + protected _onClear(): void; + } + /** + * @private + */ + class BoundingBoxDisplayData extends DisplayData { + static toString(): string; + boundingBox: BoundingBoxData | null; + protected _onClear(): void; + } + /** + * @private + */ + class PathDisplayData extends DisplayData { + static toString(): string; + closed: boolean; + constantSpeed: boolean; + readonly geometry: GeometryData; + readonly curveLengths: Array; + protected _onClear(): void; + } + /** + * @private + */ + class WeightData extends BaseObject { + static toString(): string; + count: number; + offset: number; + readonly bones: Array; + protected _onClear(): void; + addBone(value: BoneData): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The base class of bounding box data. + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框数据基类。 + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract class BoundingBoxData extends BaseObject { + /** + * - The bounding box type. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框类型。 + * @version DragonBones 5.0 + * @language zh_CN + */ + type: BoundingBoxType; + /** + * @private + */ + color: number; + /** + * @private + */ + width: number; + /** + * @private + */ + height: number; + protected _onClear(): void; + /** + * - Check whether the bounding box contains a specific point. (Local coordinate system) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查边界框是否包含特定点。(本地坐标系) + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract containsPoint(pX: number, pY: number): boolean; + /** + * - Check whether the bounding box intersects a specific segment. (Local coordinate system) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查边界框是否与特定线段相交。(本地坐标系) + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA: { + x: number; + y: number; + } | null, intersectionPointB: { + x: number; + y: number; + } | null, normalRadians: { + x: number; + y: number; + } | null): number; + } + /** + * - The rectangle bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 矩形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class RectangleBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * - Compute the bit code for a point (x, y) using the clip rectangle + */ + private static _computeOutCode(x, y, xMin, yMin, xMax, yMax); + /** + * @private + */ + static rectangleIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xMin: number, yMin: number, xMax: number, yMax: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } + /** + * - The ellipse bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 椭圆边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class EllipseBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * @private + */ + static ellipseIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xC: number, yC: number, widthH: number, heightH: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } + /** + * - The polygon bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class PolygonBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * @private + */ + static polygonIntersectsSegment(xA: number, yA: number, xB: number, yB: number, vertices: Array, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + /** + * @private + */ + x: number; + /** + * @private + */ + y: number; + /** + * - The polygon vertices. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形顶点。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly vertices: Array; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class AnimationData extends BaseObject { + static toString(): string; + /** + * @private + */ + blendType: AnimationBlendType; + /** + * - The frame count of the animation. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的帧数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameCount: number; + /** + * - The play times of the animation. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The duration of the animation. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的持续时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + duration: number; + /** + * @private + */ + scale: number; + /** + * - The fade in time of the animation. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的淡入时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + fadeInTime: number; + /** + * @private + */ + cacheFrameRate: number; + /** + * - The animation name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly cachedFrames: Array; + /** + * @private + */ + readonly boneTimelines: Map>; + /** + * @private + */ + readonly slotTimelines: Map>; + /** + * @private + */ + readonly constraintTimelines: Map>; + /** + * @private + */ + readonly animationTimelines: Map>; + /** + * @private + */ + readonly boneCachedFrameIndices: Map>; + /** + * @private + */ + readonly slotCachedFrameIndices: Map>; + /** + * @private + */ + actionTimeline: TimelineData | null; + /** + * @private + */ + zOrderTimeline: TimelineData | null; + /** + * @private + */ + parent: ArmatureData; + protected _onClear(): void; + /** + * @private + */ + addBoneTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addSlotTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addConstraintTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addAnimationTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + getBoneTimelines(timelineName: string): Array | null; + /** + * @private + */ + getSlotTimelines(timelineName: string): Array | null; + /** + * @private + */ + getConstraintTimelines(timelineName: string): Array | null; + /** + * @private + */ + getAnimationTimelines(timelineName: string): Array | null; + /** + * @private + */ + getBoneCachedFrameIndices(boneName: string): Array | null; + /** + * @private + */ + getSlotCachedFrameIndices(slotName: string): Array | null; + } + /** + * @private + */ + class TimelineData extends BaseObject { + static toString(): string; + type: TimelineType; + offset: number; + frameIndicesOffset: number; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation config is used to describe all the information needed to play an animation state. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画配置用来描述播放一个动画状态所需要的全部信息。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + class AnimationConfig extends BaseObject { + static toString(): string; + /** + * @private + */ + pauseFadeOut: boolean; + /** + * - Fade out the pattern of other animation states when the animation state is fade in. + * This property is typically used to specify the substitution of multiple animation states blend. + * @default dragonBones.AnimationFadeOutMode.All + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 淡入动画状态时淡出其他动画状态的模式。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @default dragonBones.AnimationFadeOutMode.All + * @version DragonBones 5.0 + * @language zh_CN + */ + fadeOutMode: AnimationFadeOutMode; + /** + * @private + */ + fadeOutTweenType: TweenType; + /** + * @private + */ + fadeOutTime: number; + /** + * @private + */ + pauseFadeIn: boolean; + /** + * @private + */ + actionEnabled: boolean; + /** + * @private + */ + additive: boolean; + /** + * - Whether the animation state has control over the display property of the slots. + * Sometimes blend a animation state does not want it to control the display properties of the slots, + * especially if other animation state are controlling the display properties of the slots. + * @default true + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态是否对插槽的显示对象属性有控制权。 + * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, + * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 + * @default true + * @version DragonBones 5.0 + * @language zh_CN + */ + displayControl: boolean; + /** + * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. + * This property should usually be set to false when blend multiple animation states. + * @default true + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 + * 通常在混合多个动画状态时应该将该属性设置为 false。 + * @default true + * @version DragonBones 5.1 + * @language zh_CN + */ + resetToPose: boolean; + /** + * @private + */ + fadeInTweenType: TweenType; + /** + * - The play times. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The blend layer. + * High layer animation state will get the blend weight first. + * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合图层。 + * 图层高的动画状态会优先获取混合权重。 + * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + layer: number; + /** + * - The start time of play. (In seconds) + * @default 0.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 播放的开始时间。 (以秒为单位) + * @default 0.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + position: number; + /** + * - The duration of play. + * [-1: Use the default value of the animation data, 0: Stop play, (0~N]: The duration] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 播放的持续时间。 + * [-1: 使用动画数据默认值, 0: 动画停止, (0~N]: 持续时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + duration: number; + /** + * - The play speed. + * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. + * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度。 + * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 + * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + weight: number; + /** + * - The fade in time. + * [-1: Use the default value of the animation data, [0~N]: The fade in time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 淡入时间。 + * [-1: 使用动画数据默认值, [0~N]: 淡入时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + fadeInTime: number; + /** + * - The auto fade out time when the animation state play completed. + * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态播放完成后的自动淡出时间。 + * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + autoFadeOutTime: number; + /** + * - The name of the animation state. (Can be different from the name of the animation data) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态名称。 (可以不同于动画数据) + * @version DragonBones 5.0 + * @language zh_CN + */ + name: string; + /** + * - The animation data name. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画数据名称。 + * @version DragonBones 5.0 + * @language zh_CN + */ + animation: string; + /** + * - The blend group name of the animation state. + * This property is typically used to specify the substitution of multiple animation states blend. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合组名称。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + group: string; + /** + * @private + */ + readonly boneMask: Array; + protected _onClear(): void; + /** + * @private + */ + clear(): void; + /** + * @private + */ + copyFrom(value: AnimationConfig): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class TextureAtlasData extends BaseObject { + /** + * @private + */ + autoSearch: boolean; + /** + * @private + */ + width: number; + /** + * @private + */ + height: number; + /** + * @private + */ + scale: number; + /** + * - The texture atlas name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * - The image path of the texture atlas. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集图片路径。 + * @version DragonBones 3.0 + * @language zh_CN + */ + imagePath: string; + /** + * @private + */ + readonly textures: Map; + protected _onClear(): void; + /** + * @private + */ + copyFrom(value: TextureAtlasData): void; + /** + * @private + */ + getTexture(textureName: string): TextureData | null; + } + /** + * @private + */ + abstract class TextureData extends BaseObject { + static createRectangle(): Rectangle; + rotated: boolean; + name: string; + readonly region: Rectangle; + parent: TextureAtlasData; + frame: Rectangle | null; + protected _onClear(): void; + copyFrom(value: TextureData): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The armature proxy interface, the docking engine needs to implement it concretely. + * @see dragonBones.Armature + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 骨架代理接口,对接的引擎需要对其进行具体实现。 + * @see dragonBones.Armature + * @version DragonBones 5.0 + * @language zh_CN + */ + interface IArmatureProxy extends IEventDispatcher { + /** + * - Dispose the instance and the Armature instance. (The Armature instance will return to the object pool) + * @example + *
+         *     removeChild(armatureDisplay);
+         *     armatureDisplay.dispose();
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 释放该实例和骨架。 (骨架会回收到对象池) + * @example + *
+         *     removeChild(armatureDisplay);
+         *     armatureDisplay.dispose();
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + dispose(disposeProxy: boolean): void; + /** + * - The armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly armature: Armature; + /** + * - The animation player. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animation: Animation; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Armature is the core of the skeleton animation system. + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架是骨骼动画系统的核心。 + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + class Armature extends BaseObject implements IAnimatable { + static toString(): string; + private static _onSortSlots(a, b); + /** + * - Whether to inherit the animation control of the parent armature. + * True to try to have the child armature play an animation with the same name when the parent armature play the animation. + * @default true + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 是否继承父骨架的动画控制。 + * 如果该值为 true,当父骨架播放动画时,会尝试让子骨架播放同名动画。 + * @default true + * @version DragonBones 4.5 + * @language zh_CN + */ + inheritAnimation: boolean; + /** + * @private + */ + userData: any; + private _slotsDirty; + private _zOrderDirty; + private _flipX; + private _flipY; + private _alpha; + private readonly _bones; + private readonly _slots; + private readonly _actions; + private _animation; + private _proxy; + private _display; + private _replacedTexture; + private _clock; + protected _onClear(): void; + /** + * - Dispose the armature. (Return to the object pool) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 释放骨架。 (回收到对象池) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + dispose(): void; + /** + * @inheritDoc + */ + advanceTime(passedTime: number): void; + /** + * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. + * @param boneName - The bone name. (If not set, all bones will be update) + * @param updateSlot - Whether to update the bone's slots. (Default: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 + * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) + * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + invalidUpdate(boneName?: string | null, updateSlot?: boolean): void; + /** + * - Check whether a specific point is inside a custom bounding box in a slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在某个插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + containsPoint(x: number, y: number): Slot | null; + /** + * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 + * @version DragonBones 5.0 + * @language zh_CN + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): Slot | null; + /** + * - Get a specific bone. + * @param name - The bone name. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼。 + * @param name - 骨骼名称。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBone(name: string): Bone | null; + /** + * - Get a specific bone by the display. + * @param display - The display object. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的骨骼。 + * @param display - 显示对象。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBoneByDisplay(display: any): Bone | null; + /** + * - Get a specific slot. + * @param name - The slot name. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽。 + * @param name - 插槽名称。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlot(name: string): Slot | null; + /** + * - Get a specific slot by the display. + * @param display - The display object. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的插槽。 + * @param display - 显示对象。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlotByDisplay(display: any): Slot | null; + /** + * - Get all bones. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBones(): Array; + /** + * - Get all slots. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的插槽。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlots(): Array; + /** + * - Whether to flip the armature horizontally. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架水平翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + flipX: boolean; + /** + * - Whether to flip the armature vertically. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架垂直翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + flipY: boolean; + /** + * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. + * There is a certain amount of memory overhead to improve performance by caching animation data in memory. + * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. + * When the animation cache is turned on, some features will fail, such as the offset property of bone. + * @example + *
+         *     armature.cacheFrameRate = 24;
+         * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 + * @example + *
+         *     armature.cacheFrameRate = 24;
+         * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language zh_CN + */ + cacheFrameRate: number; + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - The armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly armatureData: ArmatureData; + /** + * - The animation player. + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animation: Animation; + /** + * @pivate + */ + readonly proxy: IArmatureProxy; + /** + * - The EventDispatcher instance of the armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架的 EventDispatcher 实例。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly eventDispatcher: IEventDispatcher; + /** + * - The display container. + * The display of the slot is displayed as the parent. + * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 显示容器实例。 + * 插槽的显示对象都会以此显示容器为父级。 + * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly display: any; + /** + * @private + */ + replacedTexture: any; + /** + * @inheritDoc + */ + clock: WorldClock | null; + /** + * - Get the parent slot which the armature belongs to. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架所属的父插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly parent: Slot | null; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + getDisplay(): any; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The base class of the transform object. + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 变换对象的基类。 + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language zh_CN + */ + abstract class TransformObject extends BaseObject { + protected static readonly _helpMatrix: Matrix; + protected static readonly _helpTransform: Transform; + protected static readonly _helpPoint: Point; + /** + * - A matrix relative to the armature coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly globalTransformMatrix: Matrix; + /** + * - A transform relative to the armature coordinate system. + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的变换。 + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly global: Transform; + /** + * - The offset transform relative to the armature or the parent bone coordinate system. + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架或父骨骼坐标系的偏移变换。 + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly offset: Transform; + /** + * @private + */ + origin: Transform | null; + /** + * @private + */ + userData: any; + protected _globalDirty: boolean; + /** + */ + protected _onClear(): void; + /** + * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, + * some engines do not rely on these attributes to update rendering, such as Egret. + * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 + * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + updateGlobalTransform(): void; + /** + * - The armature to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的骨架。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly armature: Armature; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Bone is one of the most important logical units in the armature animation system, + * and is responsible for the realization of translate, rotation, scaling in the animations. + * A armature can contain multiple bones. + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 + * 一个骨架中可以包含多个骨骼。 + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + class Bone extends TransformObject { + static toString(): string; + /** + * - The offset mode. + * @see #offset + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 偏移模式。 + * @see #offset + * @version DragonBones 5.5 + * @language zh_CN + */ + offsetMode: OffsetMode; + protected _localDirty: boolean; + protected _visible: boolean; + protected _cachedFrameIndex: number; + /** + * @private + */ + protected _parent: Bone | null; + protected _onClear(): void; + protected _updateGlobalTransformMatrix(isCache: boolean): void; + /** + * - Forces the bone to update the transform in the next frame. + * When the bone is not animated or its animation state is finished, the bone will not continue to update, + * and when the skeleton must be updated for some reason, the method needs to be called explicitly. + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制骨骼在下一帧更新变换。 + * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + invalidUpdate(): void; + /** + * - Check whether the bone contains a specific bone. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查该骨骼是否包含特定的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + contains(value: Bone): boolean; + /** + * - The bone data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly boneData: BoneData; + /** + * - The visible of all slots in the bone. + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 此骨骼所有插槽的可见。 + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language zh_CN + */ + visible: boolean; + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly parent: Bone | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class DisplayFrame extends BaseObject { + static toString(): string; + rawDisplayData: DisplayData | null; + displayData: DisplayData | null; + textureData: TextureData | null; + display: any | Armature | null; + readonly deformVertices: Array; + protected _onClear(): void; + updateDeformVertices(): void; + getGeometryData(): GeometryData | null; + getBoundingBox(): BoundingBoxData | null; + getTextureData(): TextureData | null; + } + /** + * - The slot attached to the armature, controls the display status and properties of the display object. + * A bone can contain multiple slots. + * A slot can contain multiple display objects, displaying only one of the display objects at a time, + * but you can toggle the display object into frame animation while the animation is playing. + * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, + * and a custom other display object. + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class Slot extends TransformObject { + /** + * - Displays the animated state or mixed group name controlled by the object, set to null to be controlled by all animation states. + * @default null + * @see dragonBones.AnimationState#displayControl + * @see dragonBones.AnimationState#name + * @see dragonBones.AnimationState#group + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 显示对象受到控制的动画状态或混合组名称,设置为 null 则表示受所有的动画状态控制。 + * @default null + * @see dragonBones.AnimationState#displayControl + * @see dragonBones.AnimationState#name + * @see dragonBones.AnimationState#group + * @version DragonBones 4.5 + * @language zh_CN + */ + displayController: string | null; + protected _displayDataDirty: boolean; + protected _displayDirty: boolean; + protected _geometryDirty: boolean; + protected _textureDirty: boolean; + protected _visibleDirty: boolean; + protected _blendModeDirty: boolean; + protected _zOrderDirty: boolean; + protected _transformDirty: boolean; + protected _visible: boolean; + protected _blendMode: BlendMode; + protected _displayIndex: number; + protected _animationDisplayIndex: number; + protected _cachedFrameIndex: number; + protected readonly _localMatrix: Matrix; + protected _boundingBoxData: BoundingBoxData | null; + protected _textureData: TextureData | null; + protected _rawDisplay: any; + protected _meshDisplay: any; + protected _display: any | null; + protected _childArmature: Armature | null; + /** + * @private + */ + protected _parent: Bone; + protected _onClear(): void; + protected abstract _initDisplay(value: any, isRetain: boolean): void; + protected abstract _disposeDisplay(value: any, isRelease: boolean): void; + protected abstract _onUpdateDisplay(): void; + protected abstract _addDisplay(): void; + protected abstract _replaceDisplay(value: any): void; + protected abstract _removeDisplay(): void; + protected abstract _updateZOrder(): void; + protected abstract _updateBlendMode(): void; + protected abstract _updateColor(): void; + protected abstract _updateFrame(): void; + protected abstract _updateMesh(): void; + protected abstract _updateTransform(): void; + protected abstract _identityTransform(): void; + protected _hasDisplay(display: any): boolean; + protected _updateDisplayData(): void; + protected _updateDisplay(): void; + protected _updateGlobalTransformMatrix(isCache: boolean): void; + /** + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + invalidUpdate(): void; + /** + * @private + */ + updateTransformAndMatrix(): void; + /** + * @private + */ + replaceRawDisplayData(displayData: DisplayData | null, index?: number): void; + /** + * @private + */ + replaceDisplayData(displayData: DisplayData | null, index?: number): void; + /** + * @private + */ + replaceTextureData(textureData: TextureData | null, index?: number): void; + /** + * @private + */ + replaceDisplay(value: any | Armature | null, index?: number): void; + /** + * - Check whether a specific point is inside a custom bounding box in the slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + containsPoint(x: number, y: number): boolean; + /** + * - Check whether a specific segment intersects a custom bounding box for the slot. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] + * @version DragonBones 5.0 + * @language zh_CN + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + /** + * @private + */ + getDisplayFrameAt(index: number): DisplayFrame; + /** + * - The visible of slot's display object. + * @default true + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 插槽的显示对象的可见。 + * @default true + * @version DragonBones 5.6 + * @language zh_CN + */ + visible: boolean; + /** + * @private + */ + displayFrameCount: number; + /** + * - The index of the display object displayed in the display list. + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     slot.displayIndex = 3;
+         *     slot.displayController = "none";
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 此时显示的显示对象在显示列表中的索引。 + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     slot.displayIndex = 3;
+         *     slot.displayController = "none";
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + displayIndex: number; + /** + * - The slot name. + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - Contains a display list of display objects or child armatures. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + * @language zh_CN + */ + displayList: Array; + /** + * - The slot data. + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 插槽数据。 + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly slotData: SlotData; + /** + * - The custom bounding box data for the slot at current time. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 插槽此时的自定义包围盒数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly boundingBoxData: BoundingBoxData | null; + /** + * @private + */ + readonly rawDisplay: any; + /** + * @private + */ + readonly meshDisplay: any; + /** + * - The display object that the slot displays at this time. + * @example + *
+         *     let slot = armature.getSlot("text");
+         *     slot.display = new yourEngine.TextField();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的显示对象。 + * @example + *
+         *     let slot = armature.getSlot("text");
+         *     slot.display = new yourEngine.TextField();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + display: any; + /** + * - The child armature that the slot displayed at current time. + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
+         *     }
+         *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的子骨架。 + * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
+         *     }
+         *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + childArmature: Armature | null; + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly parent: Bone; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + getDisplay(): any; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + setDisplay(value: any): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Play animation interface. (Both Armature and Wordclock implement the interface) + * Any instance that implements the interface can be added to the Worldclock instance and advance time by Worldclock instance uniformly. + * @see dragonBones.WorldClock + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放动画接口。 (Armature 和 WordClock 都实现了该接口) + * 任何实现了此接口的实例都可以添加到 WorldClock 实例中,由 WorldClock 实例统一更新时间。 + * @see dragonBones.WorldClock + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + interface IAnimatable { + /** + * - Advance time. + * @param passedTime - Passed time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 更新时间。 + * @param passedTime - 前进的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + advanceTime(passedTime: number): void; + /** + * - The Wordclock instance to which the current belongs. + * @example + *
+         *     armature.clock = factory.clock; // Add armature to clock.
+         *     armature.clock = null; // Remove armature from clock.
+         * 
+ * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 当前所属的 WordClock 实例。 + * @example + *
+         *     armature.clock = factory.clock; // 将骨架添加到时钟。
+         *     armature.clock = null; // 将骨架从时钟移除。
+         * 
+ * @version DragonBones 5.0 + * @language zh_CN + */ + clock: WorldClock | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + class WorldClock implements IAnimatable { + /** + * - Current time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + time: number; + /** + * - The play speed, used to control animation speed-shift play. + * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度,用于控制动画变速播放。 + * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + private _systemTime; + private readonly _animatebles; + private _clock; + /** + * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. + * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 + * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(time?: number); + /** + * - Advance time for all IAnimatable instances. + * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 为所有的 IAnimatable 实例更新时间。 + * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + advanceTime(passedTime: number): void; + /** + * - Check whether contains a specific instance of IAnimatable. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + contains(value: IAnimatable): boolean; + /** + * - Add IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + add(value: IAnimatable): void; + /** + * - Removes a specified IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + remove(value: IAnimatable): void; + /** + * - Clear all IAnimatable instances. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + clear(): void; + /** + * @inheritDoc + */ + clock: WorldClock | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation player is used to play the animation data and manage the animation states. + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器用来播放动画数据和管理动画状态。 + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + class Animation extends BaseObject { + static toString(): string; + /** + * - The play speed of all animations. [0: Stop, (0~1): Slow, 1: Normal, (1~N): Fast] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有动画的播放速度。 [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * Update bones and slots cachedFrameIndices. + */ + private _animationDirty; + private _inheritTimeScale; + private readonly _animationNames; + private readonly _animationStates; + private readonly _animations; + private readonly _blendStates; + private _armature; + private _animationConfig; + private _lastAnimationState; + protected _onClear(): void; + private _fadeOut(animationConfig); + /** + * - Clear all animations states. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除所有的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + reset(): void; + /** + * - Pause a specific animation state. + * @param animationName - The name of animation state. (If not set, it will pause all animations) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停指定动画状态的播放。 + * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + stop(animationName?: string | null): void; + /** + * - Play animation with a specific animation config. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @param animationConfig - The animation config. + * @returns The playing animation state. + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 通过指定的动画配置来播放动画。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @param animationConfig - 动画配置。 + * @returns 播放的动画状态。 + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + playConfig(animationConfig: AnimationConfig): AnimationState | null; + /** + * - Play a specific animation. + * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) + * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放指定动画。 + * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + play(animationName?: string | null, playTimes?: number): AnimationState | null; + /** + * - Fade in a specific animation. + * @param animationName - The name of animation data. + * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) + * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) + * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) + * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 淡入播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) + * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) + * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + fadeIn(animationName: string, fadeInTime?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode): AnimationState | null; + /** + * - Play a specific animation from the specific time. + * @param animationName - The name of animation data. + * @param time - The start time point of playing. (In seconds) + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定时间开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param time - 播放开始的时间。 (以秒为单位) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByTime(animationName: string, time?: number, playTimes?: number): AnimationState | null; + /** + * - Play a specific animation from the specific frame. + * @param animationName - The name of animation data. + * @param frame - The start frame of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定帧开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param frame - 播放开始的帧数。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByFrame(animationName: string, frame?: number, playTimes?: number): AnimationState | null; + /** + * - Play a specific animation from the specific progress. + * @param animationName - The name of animation data. + * @param progress - The start progress value of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定进度开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param progress - 开始播放的进度。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByProgress(animationName: string, progress?: number, playTimes?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific time. + * @param animationName - The name of animation data. + * @param time - The stop time. (In seconds) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定时间停止指定动画播放 + * @param animationName - 动画数据名称。 + * @param time - 停止的时间。 (以秒为单位) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByTime(animationName: string, time?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific frame. + * @param animationName - The name of animation data. + * @param frame - The stop frame. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定帧停止指定动画的播放 + * @param animationName - 动画数据名称。 + * @param frame - 停止的帧数。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByFrame(animationName: string, frame?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific progress. + * @param animationName - The name of animation data. + * @param progress - The stop progress value. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定的进度停止指定的动画播放。 + * @param animationName - 动画数据名称。 + * @param progress - 停止进度。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByProgress(animationName: string, progress?: number): AnimationState | null; + /** + * - Get a specific animation state. + * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取指定的动画状态。 + * @param animationName - 动画状态名称。 + * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + getState(animationName: string, layer?: number): AnimationState | null; + /** + * - Check whether a specific animation data is included. + * @param animationName - The name of animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含指定的动画数据 + * @param animationName - 动画数据名称。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + hasAnimation(animationName: string): boolean; + /** + * - Get all the animation states. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取所有的动画状态 + * @version DragonBones 5.1 + * @language zh_CN + */ + getStates(): ReadonlyArray; + /** + * - Check whether there is an animation state is playing + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否有动画状态正在播放 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isPlaying: boolean; + /** + * - Check whether all the animation states' playing were finished. + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否所有的动画状态均已播放完毕。 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isCompleted: boolean; + /** + * - The name of the last playing animation state. + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态名称 + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly lastAnimationName: string; + /** + * - The name of all animation data + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有动画数据的名称 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly animationNames: ReadonlyArray; + /** + * - All animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有的动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + animations: Map; + /** + * - An AnimationConfig instance that can be used quickly. + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 一个可以快速使用的动画配置实例。 + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly animationConfig: AnimationConfig; + /** + * - The last playing animation state + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly lastAnimationState: AnimationState | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation state is generated when the animation data is played. + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画状态由播放动画数据时产生。 + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + class AnimationState extends BaseObject { + static toString(): string; + /** + * @private + */ + actionEnabled: boolean; + /** + * @private + */ + additive: boolean; + /** + * - Whether the animation state has control over the display object properties of the slots. + * Sometimes blend a animation state does not want it to control the display object properties of the slots, + * especially if other animation state are controlling the display object properties of the slots. + * @default true + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态是否对插槽的显示对象属性有控制权。 + * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, + * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 + * @default true + * @version DragonBones 5.0 + * @language zh_CN + */ + displayControl: boolean; + /** + * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. + * This property should usually be set to false when blend multiple animation states. + * @default true + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 + * 通常在混合多个动画状态时应该将该属性设置为 false。 + * @default true + * @version DragonBones 5.1 + * @language zh_CN + */ + resetToPose: boolean; + /** + * @private + */ + blendType: AnimationBlendType; + /** + * - The play times. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The blend layer. + * High layer animation state will get the blend weight first. + * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合图层。 + * 图层高的动画状态会优先获取混合权重。 + * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + layer: number; + /** + * - The play speed. + * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. + * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度。 + * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 + * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * @private + */ + parameterX: number; + /** + * @private + */ + parameterY: number; + /** + * @private + */ + positionX: number; + /** + * @private + */ + positionY: number; + /** + * - The auto fade out time when the animation state play completed. + * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态播放完成后的自动淡出时间。 + * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + autoFadeOutTime: number; + /** + * @private + */ + fadeTotalTime: number; + /** + * - The name of the animation state. (Can be different from the name of the animation data) + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态名称。 (可以不同于动画数据) + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + name: string; + /** + * - The blend group name of the animation state. + * This property is typically used to specify the substitution of multiple animation states blend. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合组名称。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + group: string; + private _timelineDirty; + private _weight; + private _fadeTime; + private _time; + private readonly _boneMask; + private readonly _boneTimelines; + private readonly _boneBlendTimelines; + private readonly _slotTimelines; + private readonly _slotBlendTimelines; + private readonly _constraintTimelines; + private readonly _animationTimelines; + private readonly _poseTimelines; + private _animationData; + private _armature; + private _zOrderTimeline; + private _activeChildA; + private _activeChildB; + protected _onClear(): void; + private _updateTimelines(); + private _updateBoneAndSlotTimelines(); + private _advanceFadeTime(passedTime); + /** + * - Continue play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 继续播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + play(): void; + /** + * - Stop play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + stop(): void; + /** + * - Fade out the animation state. + * @param fadeOutTime - The fade out time. (In seconds) + * @param pausePlayhead - Whether to pause the animation playing when fade out. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 淡出动画状态。 + * @param fadeOutTime - 淡出时间。 (以秒为单位) + * @param pausePlayhead - 淡出时是否暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + fadeOut(fadeOutTime: number, pausePlayhead?: boolean): void; + /** + * - Check if a specific bone mask is included. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + containsBoneMask(boneName: string): boolean; + /** + * - Add a specific bone mask. + * @param boneName - The bone name. + * @param recursive - Whether or not to add a mask to the bone's sub-bone. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加特定的骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + addBoneMask(boneName: string, recursive?: boolean): void; + /** + * - Remove the mask of a specific bone. + * @param boneName - The bone name. + * @param recursive - Whether to remove the bone's sub-bone mask. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除特定骨骼的遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + removeBoneMask(boneName: string, recursive?: boolean): void; + /** + * - Remove all bone masks. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + removeAllBoneMask(): void; + /** + * @private + */ + addState(animationState: AnimationState, timelineDatas?: TimelineData[] | null): void; + /** + * - Whether the animation state is fading in. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡入。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeIn: boolean; + /** + * - Whether the animation state is fading out. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡出。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeOut: boolean; + /** + * - Whether the animation state is fade completed. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否淡入或淡出完毕。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeComplete: boolean; + /** + * - Whether the animation state is playing. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否正在播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isPlaying: boolean; + /** + * - Whether the animation state is play completed. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否播放完毕。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isCompleted: boolean; + /** + * - The times has been played. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 已经循环播放的次数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly currentPlayTimes: number; + /** + * - The total time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 总播放时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly totalTime: number; + /** + * - The time is currently playing. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前播放的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + currentTime: number; + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + /** + * - The animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + weight: number; + /** + * - 动画数据。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animationData: AnimationData; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The properties of the object carry basic information about an event, + * which are passed as parameter or parameter's parameter to event listeners when an event occurs. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 + * @version DragonBones 4.5 + * @language zh_CN + */ + class EventObject extends BaseObject { + /** + * - Animation start play. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画开始播放。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly START: string; + /** + * - Animation loop play complete once. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画循环播放完成一次。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly LOOP_COMPLETE: string; + /** + * - Animation play complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画播放完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly COMPLETE: string; + /** + * - Animation fade in start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_IN: string; + /** + * - Animation fade in complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_IN_COMPLETE: string; + /** + * - Animation fade out start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_OUT: string; + /** + * - Animation fade out complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_OUT_COMPLETE: string; + /** + * - Animation frame event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FRAME_EVENT: string; + /** + * - Animation frame sound event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧声音事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly SOUND_EVENT: string; + static toString(): string; + /** + * - If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 如果是帧事件,此值用来描述该事件在动画时间轴中所处的时间。(以秒为单位) + * @version DragonBones 4.5 + * @language zh_CN + */ + time: number; + /** + * - The event type。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件类型。 + * @version DragonBones 4.5 + * @language zh_CN + */ + type: EventStringType; + /** + * - The event name. (The frame event name or the frame sound name) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件名称。 (帧事件的名称或帧声音的名称) + * @version DragonBones 4.5 + * @language zh_CN + */ + name: string; + /** + * - The armature that dispatch the event. + * @see dragonBones.Armature + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的骨架。 + * @see dragonBones.Armature + * @version DragonBones 4.5 + * @language zh_CN + */ + armature: Armature; + /** + * - The bone that dispatch the event. + * @see dragonBones.Bone + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 4.5 + * @language zh_CN + */ + bone: Bone | null; + /** + * - The slot that dispatch the event. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + slot: Slot | null; + /** + * - The animation state that dispatch the event. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + animationState: AnimationState; + /** + * @private + */ + actionData: ActionData | null; + /** + * @private + */ + /** + * - The custom data. + * @see dragonBones.CustomData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义数据。 + * @see dragonBones.CustomData + * @version DragonBones 5.0 + * @language zh_CN + */ + data: UserData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + type EventStringType = string | "start" | "loopComplete" | "complete" | "fadeIn" | "fadeInComplete" | "fadeOut" | "fadeOutComplete" | "frameEvent" | "soundEvent"; + /** + * - The event dispatcher interface. + * Dragonbones event dispatch usually relies on docking engine to implement, which defines the event method to be implemented when docking the engine. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件派发接口。 + * DragonBones 的事件派发通常依赖于对接的引擎来实现,该接口定义了对接引擎时需要实现的事件方法。 + * @version DragonBones 4.5 + * @language zh_CN + */ + interface IEventDispatcher { + /** + * - Checks whether the object has any listeners registered for a specific type of event。 + * @param type - Event type. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 检查是否为特定的事件类型注册了任何侦听器。 + * @param type - 事件类型。 + * @version DragonBones 4.5 + * @language zh_CN + */ + hasDBEventListener(type: EventStringType): boolean; + /** + * - Dispatches an event into the event flow. + * @param type - Event type. + * @param eventObject - Event object. + * @see dragonBones.EventObject + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分派特定的事件到事件流中。 + * @param type - 事件类型。 + * @param eventObject - 事件数据。 + * @see dragonBones.EventObject + * @version DragonBones 4.5 + * @language zh_CN + */ + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + /** + * - Add an event listener object so that the listener receives notification of an event. + * @param type - Event type. + * @param listener - Event listener. + * @param thisObject - The listener function's "this". + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 添加特定事件类型的事件侦听器,以使侦听器能够接收事件通知。 + * @param type - 事件类型。 + * @param listener - 事件侦听器。 + * @param thisObject - 侦听函数绑定的 this 对象。 + * @version DragonBones 4.5 + * @language zh_CN + */ + addDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; + /** + * - Removes a listener from the object. + * @param type - Event type. + * @param listener - Event listener. + * @param thisObject - The listener function's "this". + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 删除特定事件类型的侦听器。 + * @param type - 事件类型。 + * @param listener - 事件侦听器。 + * @param thisObject - 侦听函数绑定的 this 对象。 + * @version DragonBones 4.5 + * @language zh_CN + */ + removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + abstract class DataParser { + protected static readonly DATA_VERSION_2_3: string; + protected static readonly DATA_VERSION_3_0: string; + protected static readonly DATA_VERSION_4_0: string; + protected static readonly DATA_VERSION_4_5: string; + protected static readonly DATA_VERSION_5_0: string; + protected static readonly DATA_VERSION_5_5: string; + protected static readonly DATA_VERSION_5_6: string; + protected static readonly DATA_VERSION: string; + protected static readonly DATA_VERSIONS: Array; + protected static readonly TEXTURE_ATLAS: string; + protected static readonly SUB_TEXTURE: string; + protected static readonly FORMAT: string; + protected static readonly IMAGE_PATH: string; + protected static readonly WIDTH: string; + protected static readonly HEIGHT: string; + protected static readonly ROTATED: string; + protected static readonly FRAME_X: string; + protected static readonly FRAME_Y: string; + protected static readonly FRAME_WIDTH: string; + protected static readonly FRAME_HEIGHT: string; + protected static readonly DRADON_BONES: string; + protected static readonly USER_DATA: string; + protected static readonly ARMATURE: string; + protected static readonly CANVAS: string; + protected static readonly BONE: string; + protected static readonly SURFACE: string; + protected static readonly SLOT: string; + protected static readonly CONSTRAINT: string; + protected static readonly SKIN: string; + protected static readonly DISPLAY: string; + protected static readonly FRAME: string; + protected static readonly IK: string; + protected static readonly PATH_CONSTRAINT: string; + protected static readonly ANIMATION: string; + protected static readonly TIMELINE: string; + protected static readonly FFD: string; + protected static readonly TRANSLATE_FRAME: string; + protected static readonly ROTATE_FRAME: string; + protected static readonly SCALE_FRAME: string; + protected static readonly DISPLAY_FRAME: string; + protected static readonly COLOR_FRAME: string; + protected static readonly DEFAULT_ACTIONS: string; + protected static readonly ACTIONS: string; + protected static readonly EVENTS: string; + protected static readonly INTS: string; + protected static readonly FLOATS: string; + protected static readonly STRINGS: string; + protected static readonly TRANSFORM: string; + protected static readonly PIVOT: string; + protected static readonly AABB: string; + protected static readonly COLOR: string; + protected static readonly VERSION: string; + protected static readonly COMPATIBLE_VERSION: string; + protected static readonly FRAME_RATE: string; + protected static readonly TYPE: string; + protected static readonly SUB_TYPE: string; + protected static readonly NAME: string; + protected static readonly PARENT: string; + protected static readonly TARGET: string; + protected static readonly STAGE: string; + protected static readonly SHARE: string; + protected static readonly PATH: string; + protected static readonly LENGTH: string; + protected static readonly DISPLAY_INDEX: string; + protected static readonly Z_ORDER: string; + protected static readonly Z_INDEX: string; + protected static readonly BLEND_MODE: string; + protected static readonly INHERIT_TRANSLATION: string; + protected static readonly INHERIT_ROTATION: string; + protected static readonly INHERIT_SCALE: string; + protected static readonly INHERIT_REFLECTION: string; + protected static readonly INHERIT_ANIMATION: string; + protected static readonly INHERIT_DEFORM: string; + protected static readonly SEGMENT_X: string; + protected static readonly SEGMENT_Y: string; + protected static readonly BEND_POSITIVE: string; + protected static readonly CHAIN: string; + protected static readonly WEIGHT: string; + protected static readonly BLEND_TYPE: string; + protected static readonly FADE_IN_TIME: string; + protected static readonly PLAY_TIMES: string; + protected static readonly SCALE: string; + protected static readonly OFFSET: string; + protected static readonly POSITION: string; + protected static readonly DURATION: string; + protected static readonly TWEEN_EASING: string; + protected static readonly TWEEN_ROTATE: string; + protected static readonly TWEEN_SCALE: string; + protected static readonly CLOCK_WISE: string; + protected static readonly CURVE: string; + protected static readonly SOUND: string; + protected static readonly EVENT: string; + protected static readonly ACTION: string; + protected static readonly X: string; + protected static readonly Y: string; + protected static readonly SKEW_X: string; + protected static readonly SKEW_Y: string; + protected static readonly SCALE_X: string; + protected static readonly SCALE_Y: string; + protected static readonly VALUE: string; + protected static readonly ROTATE: string; + protected static readonly SKEW: string; + protected static readonly ALPHA: string; + protected static readonly ALPHA_OFFSET: string; + protected static readonly RED_OFFSET: string; + protected static readonly GREEN_OFFSET: string; + protected static readonly BLUE_OFFSET: string; + protected static readonly ALPHA_MULTIPLIER: string; + protected static readonly RED_MULTIPLIER: string; + protected static readonly GREEN_MULTIPLIER: string; + protected static readonly BLUE_MULTIPLIER: string; + protected static readonly UVS: string; + protected static readonly VERTICES: string; + protected static readonly TRIANGLES: string; + protected static readonly WEIGHTS: string; + protected static readonly SLOT_POSE: string; + protected static readonly BONE_POSE: string; + protected static readonly BONES: string; + protected static readonly POSITION_MODE: string; + protected static readonly SPACING_MODE: string; + protected static readonly ROTATE_MODE: string; + protected static readonly SPACING: string; + protected static readonly ROTATE_OFFSET: string; + protected static readonly ROTATE_MIX: string; + protected static readonly TRANSLATE_MIX: string; + protected static readonly TARGET_DISPLAY: string; + protected static readonly CLOSED: string; + protected static readonly CONSTANT_SPEED: string; + protected static readonly VERTEX_COUNT: string; + protected static readonly LENGTHS: string; + protected static readonly GOTO_AND_PLAY: string; + protected static readonly DEFAULT_NAME: string; + protected static _getArmatureType(value: string): ArmatureType; + protected static _getBoneType(value: string): BoneType; + protected static _getPositionMode(value: string): PositionMode; + protected static _getSpacingMode(value: string): SpacingMode; + protected static _getRotateMode(value: string): RotateMode; + protected static _getDisplayType(value: string): DisplayType; + protected static _getBoundingBoxType(value: string): BoundingBoxType; + protected static _getBlendMode(value: string): BlendMode; + protected static _getAnimationBlendType(value: string): AnimationBlendType; + protected static _getActionType(value: string): ActionType; + abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null; + abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + const enum FrameValueType { + Step = 0, + Int = 1, + Float = 2, + } + /** + * @private + */ + class ObjectDataParser extends DataParser { + protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean; + protected static _getNumber(rawData: any, key: string, defaultValue: number): number; + protected static _getString(rawData: any, key: string, defaultValue: string): string; + protected _rawTextureAtlasIndex: number; + protected readonly _rawBones: Array; + protected _data: DragonBonesData; + protected _armature: ArmatureData; + protected _bone: BoneData; + protected _geometry: GeometryData; + protected _slot: SlotData; + protected _skin: SkinData; + protected _mesh: MeshDisplayData; + protected _animation: AnimationData; + protected _timeline: TimelineData; + protected _rawTextureAtlases: Array | null; + private _frameValueType; + private _defaultColorOffset; + private _prevClockwise; + private _prevRotation; + private _frameDefaultValue; + private _frameValueScale; + private readonly _helpMatrixA; + private readonly _helpMatrixB; + private readonly _helpTransform; + private readonly _helpColorTransform; + private readonly _helpPoint; + private readonly _helpArray; + private readonly _intArray; + private readonly _floatArray; + private readonly _frameIntArray; + private readonly _frameFloatArray; + private readonly _frameArray; + private readonly _timelineArray; + private readonly _colorArray; + private readonly _cacheRawMeshes; + private readonly _cacheMeshes; + private readonly _actionFrames; + private readonly _weightSlotPose; + private readonly _weightBonePoses; + private readonly _cacheBones; + private readonly _slotChildActions; + private _getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, t, result); + private _samplingEasingCurve(curve, samples); + private _parseActionDataInFrame(rawData, frameStart, bone, slot); + private _mergeActionFrame(rawData, frameStart, type, bone, slot); + protected _parseArmature(rawData: any, scale: number): ArmatureData; + protected _parseBone(rawData: any): BoneData; + protected _parseIKConstraint(rawData: any): ConstraintData | null; + protected _parsePathConstraint(rawData: any): ConstraintData | null; + protected _parseSlot(rawData: any, zOrder: number): SlotData; + protected _parseSkin(rawData: any): SkinData; + protected _parseDisplay(rawData: any): DisplayData | null; + protected _parsePath(rawData: any, display: PathDisplayData): void; + protected _parsePivot(rawData: any, display: ImageDisplayData): void; + protected _parseMesh(rawData: any, mesh: MeshDisplayData): void; + protected _parseBoundingBox(rawData: any): BoundingBoxData | null; + protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData; + protected _parseAnimation(rawData: any): AnimationData; + protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, timelineType: TimelineType, frameValueType: FrameValueType, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number, timeline?: TimelineData | null): TimelineData | null; + protected _parseBoneTimeline(rawData: any): void; + protected _parseSlotTimeline(rawData: any): void; + protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSingleValueFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseDoubleValueFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number; + protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotDeformFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array; + protected _parseDeformFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseTransform(rawData: any, transform: Transform, scale: number): void; + protected _parseColorTransform(rawData: any, color: ColorTransform): void; + protected _parseGeometry(rawData: any, geometry: GeometryData): void; + protected _parseArray(rawData: any): void; + protected _modifyArray(): void; + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null; + parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale?: number): boolean; + private static _objectDataParserInstance; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + static getInstance(): ObjectDataParser; + } + /** + * @private + */ + class ActionFrame { + frameStart: number; + readonly actions: Array; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class BinaryDataParser extends ObjectDataParser { + private _binaryOffset; + private _binary; + private _intArrayBuffer; + private _frameArrayBuffer; + private _timelineArrayBuffer; + private _inRange(a, min, max); + private _decodeUTF8(data); + private _parseBinaryTimeline(type, offset, timelineData?); + protected _parseAnimation(rawData: any): AnimationData; + protected _parseGeometry(rawData: any, geometry: GeometryData): void; + protected _parseArray(rawData: any): void; + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null; + private static _binaryDataParserInstance; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + static getInstance(): BinaryDataParser; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) + * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. + * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) + * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 + * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class BaseFactory { + protected static _objectParser: ObjectDataParser; + protected static _binaryParser: BinaryDataParser; + /** + * @private + */ + autoSearch: boolean; + protected readonly _dragonBonesDataMap: Map; + protected readonly _textureAtlasDataMap: Map>; + protected _dragonBones: DragonBones; + protected _dataParser: DataParser; + /** + * - Create a factory instance. (typically only one global factory instance is required) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(dataParser?: DataParser | null); + protected _isSupportMesh(): boolean; + protected _getTextureData(textureAtlasName: string, textureName: string): TextureData | null; + protected _fillBuildArmaturePackage(dataPackage: BuildArmaturePackage, dragonBonesName: string, armatureName: string, skinName: string, textureAtlasName: string): boolean; + protected _buildBones(dataPackage: BuildArmaturePackage, armature: Armature): void; + /** + * @private + */ + protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void; + protected _buildConstraints(dataPackage: BuildArmaturePackage, armature: Armature): void; + protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, _slot: Slot, displayData: ArmatureDisplayData): Armature | null; + protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, slot: Slot): any; + protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData; + protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature; + protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot; + /** + * - Parse the raw data to a DragonBonesData instance and cache it to the factory. + * @param rawData - The raw data. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for all armatures. (Default: 1.0) + * @returns DragonBonesData instance + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 + * @param rawData - 原始数据。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) + * @returns DragonBonesData 实例 + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language zh_CN + */ + parseDragonBonesData(rawData: any, name?: string | null, scale?: number): DragonBonesData | null; + /** + * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. + * @param rawData - The raw texture atlas data. + * @param textureAtlas - The texture atlas object. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for the map set. (Default: 1.0) + * @returns TextureAtlasData instance + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 + * @param rawData - 原始贴图集数据。 + * @param textureAtlas - 贴图集对象。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) + * @returns TextureAtlasData 实例 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language zh_CN + */ + parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData; + /** + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN + */ + updateTextureAtlases(textureAtlases: Array, name: string): void; + /** + * - Get a specific DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @returns DragonBonesData instance + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 DragonBonesData 实例。 + * @param name - DragonBonesData 实例的缓存名称。 + * @returns DragonBonesData 实例 + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + getDragonBonesData(name: string): DragonBonesData | null; + /** + * - Cache a DragonBonesData instance to the factory. + * @param data - The DragonBonesData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 DragonBonesData 实例缓存到工厂中。 + * @param data - DragonBonesData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + addDragonBonesData(data: DragonBonesData, name?: string | null): void; + /** + * - Remove a DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @param disposeData - Whether to dispose data. (Default: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 DragonBonesData 实例。 + * @param name - DragonBonesData 实例缓存名称。 + * @param disposeData - 是否释放数据。 (默认: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + removeDragonBonesData(name: string, disposeData?: boolean): void; + /** + * - Get a list of specific TextureAtlasData instances. + * @param name - The TextureAtlasData cahce name. + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 TextureAtlasData 实例列表。 + * @param name - TextureAtlasData 实例缓存名称。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + getTextureAtlasData(name: string): Array | null; + /** + * - Cache a TextureAtlasData instance to the factory. + * @param data - The TextureAtlasData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 TextureAtlasData 实例缓存到工厂中。 + * @param data - TextureAtlasData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + addTextureAtlasData(data: TextureAtlasData, name?: string | null): void; + /** + * - Remove a TextureAtlasData instance. + * @param name - The TextureAtlasData instance cache name. + * @param disposeData - Whether to dispose data. + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 TextureAtlasData 实例。 + * @param name - TextureAtlasData 实例的缓存名称。 + * @param disposeData - 是否释放数据。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + removeTextureAtlasData(name: string, disposeData?: boolean): void; + /** + * - Get a specific armature data. + * @param name - The armature data name. + * @param dragonBonesName - The cached name for DragonbonesData instance. + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param name - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language zh_CN + */ + getArmatureData(name: string, dragonBonesName?: string): ArmatureData | null; + /** + * - Clear all cached DragonBonesData instances and TextureAtlasData instances. + * @param disposeData - Whether to dispose data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 + * @param disposeData - 是否释放数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + clear(disposeData?: boolean): void; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. + * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature. + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 + * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架。 + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + buildArmature(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): Armature | null; + /** + * @private + */ + replaceDisplay(slot: Slot, displayData: DisplayData | null, displayIndex?: number): void; + /** + * - Replaces the current display data for a particular slot with a specific display data. + * Specify display data with "dragonBonesName/armatureName/slotName/displayName". + * @param dragonBonesName - The DragonBonesData instance cache name. + * @param armatureName - The armature data name. + * @param slotName - The slot data name. + * @param displayName - The display data name. + * @param slot - The slot. + * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 + * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @param armatureName - 骨架数据名称。 + * @param slotName - 插槽数据名称。 + * @param displayName - 显示对象数据名称。 + * @param slot - 插槽。 + * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + replaceSlotDisplay(dragonBonesName: string, armatureName: string, slotName: string, displayName: string, slot: Slot, displayIndex?: number): boolean; + /** + * @private + */ + replaceSlotDisplayList(dragonBonesName: string | null, armatureName: string, slotName: string, slot: Slot): boolean; + /** + * - Share specific skin data with specific armature. + * @param armature - The armature. + * @param skin - The skin data. + * @param isOverride - Whether it completely override the original skin. (Default: false) + * @param exclude - A list of slot names that do not need to be replace. + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 将特定的皮肤数据共享给特定的骨架使用。 + * @param armature - 骨架。 + * @param skin - 皮肤数据。 + * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) + * @param exclude - 不需要被替换的插槽名称列表。 + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language zh_CN + */ + replaceSkin(armature: Armature, skin: SkinData, isOverride?: boolean, exclude?: Array | null): boolean; + /** + * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. + * This enables you to make a armature template so that other armature without animations can share it's animations. + * @param armature - The armtaure. + * @param armatureData - The armature data. + * @param isOverride - Whether to completely overwrite the original animation. (Default: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 + * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 + * @param armature - 骨架。 + * @param armatureData - 骨架数据。 + * @param isOverride - 是否完全覆盖原来的动画。(默认: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language zh_CN + */ + replaceAnimation(armature: Armature, armatureData: ArmatureData, isOverride?: boolean): boolean; + /** + * @private + */ + getAllDragonBonesData(): Map; + /** + * @private + */ + getAllTextureAtlasData(): Map>; + /** + * - An Worldclock instance updated by engine. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 由引擎驱动的 WorldClock 实例。 + * @version DragonBones 5.7 + * @language zh_CN + */ + readonly clock: WorldClock; + /** + * @private + */ + readonly dragonBones: DragonBones; + } + /** + * @private + */ + class BuildArmaturePackage { + dataName: string; + textureAtlasName: string; + data: DragonBonesData; + armature: ArmatureData; + skin: SkinData | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare var _Scene: any; +declare namespace dragonBones { + class DragonBonesAsset extends cc.Asset { + readonly dragonBonesData: string | ArrayBuffer; + readonly textureAtlases: string[]; + readonly textures: cc.Texture2D[]; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The Cocos texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class CocosTextureAtlasData extends TextureAtlasData { + static toString(): string; + private _renderTexture; + protected _onClear(): void; + createTexture(): TextureData; + /** + * - The Cocos texture. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 贴图。 + * @version DragonBones 3.0 + * @language zh_CN + */ + renderTexture: cc.Texture2D | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @see dragonBones.IArmatureProxy + */ + class CocosArmatureComponent extends cc.Component implements IArmatureProxy { + /** + * @private + */ + debugDraw: boolean; + private _debugDraw; + dbInit(armature: Armature): void; + dbClear(): void; + dbUpdate(): void; + dispose(_isposeProxy?: boolean): void; + destroy(): true; + /** + * @private + */ + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + hasDBEventListener(type: EventStringType): boolean; + addDBEventListener(type: EventStringType, listener: (event: cc.Event.EventCustom) => void, target: any): void; + removeDBEventListener(type: EventStringType, listener: (event: cc.Event.EventCustom) => void, target: any): void; + readonly armature: Armature; + readonly animation: Animation; + start(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The Cocos slot. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 插槽。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class CocosSlot extends Slot { + static toString(): string; + private _ccMeshDirty; + private _textureScale; + private _renderDisplay; + protected _onClear(): void; + protected _initDisplay(_value: any, _isRetain: boolean): void; + protected _disposeDisplay(value: any, isRelease: boolean): void; + protected _onUpdateDisplay(): void; + protected _addDisplay(): void; + protected _replaceDisplay(value: any): void; + protected _removeDisplay(): void; + protected _updateZOrder(): void; + protected _updateBlendMode(): void; + protected _updateColor(): void; + protected _updateFrame(): void; + protected _updateMesh(): void; + protected _updateTransform(): void; + protected _identityTransform(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The Cocos factory. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 工厂。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class CocosFactory extends BaseFactory { + private static _dragonBonesInstance; + private static _factory; + /** + * - A global factory instance that can be used directly. + * @version DragonBones 4.7 + * @language en_US + */ + /** + * - 一个可以直接使用的全局工厂实例。 + * @version DragonBones 4.7 + * @language zh_CN + */ + static readonly factory: CocosFactory; + protected _node: cc.Node | null; + protected _armatureNode: cc.Node | null; + constructor(dataParser?: DataParser | null); + protected _isSupportMesh(): boolean; + protected _buildTextureAtlasData(textureAtlasData: CocosTextureAtlasData | null, textureAtlas: cc.Texture2D | null): CocosTextureAtlasData; + protected _buildArmature(dataPackage: BuildArmaturePackage): Armature; + protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, slot: Slot, displayData: ArmatureDisplayData): Armature | null; + protected _buildSlot(_dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot; + /** + * - Create a armature component from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it. + * - The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update. + * - Note that when the created armature proxy that is no longer in use, you need to explicitly dispose {@link #dragonBones.IArmatureProxy#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature component. + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + * + *
+         *     let armatureComponent = factory.buildArmatureComponent("armatureName", "dragonBonesName");
+         * 
+ * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架组件,并用 {@link #clock} 更新该骨架。 + * - 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。 + * - 注意,创建的骨架代理不再使用时,需要显式释放 {@link #dragonBones.IArmatureProxy#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架组件。 + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + * + *
+         *     let armatureComponent = factory.buildArmatureComponent("armatureName", "dragonBonesName");
+         * 
+ * @language zh_CN + */ + buildArmatureComponent(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string, node?: cc.Node | null): CocosArmatureComponent | null; + /** + * - Create the display object with the specified texture. + * @param textureName - The texture data name. + * @param textureAtlasName - The texture atlas data name. (Of not set, all texture atlas data will be searched) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建带有指定贴图的显示对象。 + * @param textureName - 贴图数据名称。 + * @param textureAtlasName - 贴图集数据名称。 (如果未设置,将检索所有的贴图集数据) + * @version DragonBones 3.0 + * @language zh_CN + */ + getTextureDisplay(textureName: string, textureAtlasName?: string | null): cc.Sprite | null; + /** + * - A global sound event manager. + * Sound events can be listened to uniformly from the manager. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 全局声音事件管理器。 + * 声音事件可以从该管理器统一侦听。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly soundEventManager: cc.Node; + } +} diff --git a/Cocos/1.x/out/dragonBones.js b/Cocos/1.x/out/dragonBones.js new file mode 100644 index 00000000..803475e7 --- /dev/null +++ b/Cocos/1.x/out/dragonBones.js @@ -0,0 +1,16258 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DragonBones = (function () { + function DragonBones(eventManager) { + this._clock = new dragonBones.WorldClock(); + this._events = []; + this._objects = []; + this._eventManager = null; + this._eventManager = eventManager; + console.info("DragonBones: " + DragonBones.VERSION + "\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/"); + } + DragonBones.prototype.advanceTime = function (passedTime) { + if (this._objects.length > 0) { + for (var _i = 0, _a = this._objects; _i < _a.length; _i++) { + var object = _a[_i]; + object.returnToPool(); + } + this._objects.length = 0; + } + this._clock.advanceTime(passedTime); + if (this._events.length > 0) { + for (var i = 0; i < this._events.length; ++i) { + var eventObject = this._events[i]; + var armature = eventObject.armature; + if (armature._armatureData !== null) { + armature.eventDispatcher.dispatchDBEvent(eventObject.type, eventObject); + if (eventObject.type === dragonBones.EventObject.SOUND_EVENT) { + this._eventManager.dispatchDBEvent(eventObject.type, eventObject); + } + } + this.bufferObject(eventObject); + } + this._events.length = 0; + } + }; + DragonBones.prototype.bufferEvent = function (value) { + if (this._events.indexOf(value) < 0) { + this._events.push(value); + } + }; + DragonBones.prototype.bufferObject = function (object) { + if (this._objects.indexOf(object) < 0) { + this._objects.push(object); + } + }; + Object.defineProperty(DragonBones.prototype, "clock", { + get: function () { + return this._clock; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragonBones.prototype, "eventManager", { + get: function () { + return this._eventManager; + }, + enumerable: true, + configurable: true + }); + DragonBones.VERSION = "5.7.000"; + DragonBones.yDown = true; + DragonBones.debug = false; + DragonBones.debugDraw = false; + return DragonBones; + }()); + dragonBones.DragonBones = DragonBones; +})(dragonBones || (dragonBones = {})); +// +if (!console.warn) { + console.warn = function () { }; +} +if (!console.assert) { + console.assert = function () { }; +} +// +if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; +} +// Weixin can not support typescript extends. +var __extends = function (t, e) { + function r() { + this.constructor = t; + } + for (var i in e) { + if (e.hasOwnProperty(i)) { + t[i] = e[i]; + } + } + r.prototype = e.prototype, t.prototype = new r(); +}; +// +if (typeof global === "undefined" && typeof window !== "undefined") { + var global = window; +} +if (typeof exports === "object" && typeof module === "object") { + module.exports = dragonBones; +} +else if (typeof define === "function" && define["amd"]) { + define(["dragonBones"], function () { return dragonBones; }); +} +else if (typeof exports === "object") { + exports = dragonBones; +} +else if (typeof global !== "undefined") { + global.dragonBones = dragonBones; +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The BaseObject is the base class for all objects in the DragonBones framework. + * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 基础对象,通常 DragonBones 的对象都继承自该类。 + * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。 + * @version DragonBones 4.5 + * @language zh_CN + */ + var BaseObject = (function () { + function BaseObject() { + /** + * - A unique identification number assigned to the object. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分配给此实例的唯一标识号。 + * @version DragonBones 4.5 + * @language zh_CN + */ + this.hashCode = BaseObject._hashCode++; + this._isInPool = false; + } + BaseObject._returnObject = function (object) { + var classType = String(object.constructor); + var maxCount = classType in BaseObject._maxCountMap ? BaseObject._maxCountMap[classType] : BaseObject._defaultMaxCount; + var pool = BaseObject._poolsMap[classType] = BaseObject._poolsMap[classType] || []; + if (pool.length < maxCount) { + if (!object._isInPool) { + object._isInPool = true; + pool.push(object); + } + else { + console.warn("The object is already in the pool."); + } + } + else { + } + }; + BaseObject.toString = function () { + throw new Error(); + }; + /** + * - Set the maximum cache count of the specify object pool. + * @param objectConstructor - The specify class. (Set all object pools max cache count if not set) + * @param maxCount - Max count. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 设置特定对象池的最大缓存数量。 + * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量) + * @param maxCount - 最大缓存数量。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.setMaxCount = function (objectConstructor, maxCount) { + if (maxCount < 0 || maxCount !== maxCount) { + maxCount = 0; + } + if (objectConstructor !== null) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > maxCount) { + pool.length = maxCount; + } + BaseObject._maxCountMap[classType] = maxCount; + } + else { + BaseObject._defaultMaxCount = maxCount; + for (var classType in BaseObject._poolsMap) { + var pool = BaseObject._poolsMap[classType]; + if (pool.length > maxCount) { + pool.length = maxCount; + } + if (classType in BaseObject._maxCountMap) { + BaseObject._maxCountMap[classType] = maxCount; + } + } + } + }; + /** + * - Clear the cached instances of a specify object pool. + * @param objectConstructor - Specify class. (Clear all cached instances if not set) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除特定对象池的缓存实例。 + * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例) + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.clearPool = function (objectConstructor) { + if (objectConstructor === void 0) { objectConstructor = null; } + if (objectConstructor !== null) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > 0) { + pool.length = 0; + } + } + else { + for (var k in BaseObject._poolsMap) { + var pool = BaseObject._poolsMap[k]; + pool.length = 0; + } + } + }; + /** + * - Get an instance of the specify class from object pool. + * @param objectConstructor - The specify class. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从对象池中获取特定类的实例。 + * @param objectConstructor - 特定的类。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.borrowObject = function (objectConstructor) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > 0) { + var object_1 = pool.pop(); + object_1._isInPool = false; + return object_1; + } + var object = new objectConstructor(); + object._onClear(); + return object; + }; + /** + * - Clear the object and return it back to object pool。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除该实例的所有数据并将其返还对象池。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.prototype.returnToPool = function () { + this._onClear(); + BaseObject._returnObject(this); + }; + BaseObject._hashCode = 0; + BaseObject._defaultMaxCount = 3000; + BaseObject._maxCountMap = {}; + BaseObject._poolsMap = {}; + return BaseObject; + }()); + dragonBones.BaseObject = BaseObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - 2D Transform matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 转换矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Matrix = (function () { + /** + * @private + */ + function Matrix(a, b, c, d, tx, ty) { + if (a === void 0) { a = 1.0; } + if (b === void 0) { b = 0.0; } + if (c === void 0) { c = 0.0; } + if (d === void 0) { d = 1.0; } + if (tx === void 0) { tx = 0.0; } + if (ty === void 0) { ty = 0.0; } + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.tx = tx; + this.ty = ty; + } + Matrix.prototype.toString = function () { + return "[object dragonBones.Matrix] a:" + this.a + " b:" + this.b + " c:" + this.c + " d:" + this.d + " tx:" + this.tx + " ty:" + this.ty; + }; + /** + * @private + */ + Matrix.prototype.copyFrom = function (value) { + this.a = value.a; + this.b = value.b; + this.c = value.c; + this.d = value.d; + this.tx = value.tx; + this.ty = value.ty; + return this; + }; + /** + * @private + */ + Matrix.prototype.copyFromArray = function (value, offset) { + if (offset === void 0) { offset = 0; } + this.a = value[offset]; + this.b = value[offset + 1]; + this.c = value[offset + 2]; + this.d = value[offset + 3]; + this.tx = value[offset + 4]; + this.ty = value[offset + 5]; + return this; + }; + /** + * - Convert to unit matrix. + * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为单位矩阵。 + * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.identity = function () { + this.a = this.d = 1.0; + this.b = this.c = 0.0; + this.tx = this.ty = 0.0; + return this; + }; + /** + * - Multiplies the current matrix with another matrix. + * @param value - The matrix that needs to be multiplied. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将当前矩阵与另一个矩阵相乘。 + * @param value - 需要相乘的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.concat = function (value) { + var aA = this.a * value.a; + var bA = 0.0; + var cA = 0.0; + var dA = this.d * value.d; + var txA = this.tx * value.a + value.tx; + var tyA = this.ty * value.d + value.ty; + if (this.b !== 0.0 || this.c !== 0.0) { + aA += this.b * value.c; + bA += this.b * value.d; + cA += this.c * value.a; + dA += this.c * value.b; + } + if (value.b !== 0.0 || value.c !== 0.0) { + bA += this.a * value.b; + cA += this.d * value.c; + txA += this.ty * value.c; + tyA += this.tx * value.b; + } + this.a = aA; + this.b = bA; + this.c = cA; + this.d = dA; + this.tx = txA; + this.ty = tyA; + return this; + }; + /** + * - Convert to inverse matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为逆矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.invert = function () { + var aA = this.a; + var bA = this.b; + var cA = this.c; + var dA = this.d; + var txA = this.tx; + var tyA = this.ty; + if (bA === 0.0 && cA === 0.0) { + this.b = this.c = 0.0; + if (aA === 0.0 || dA === 0.0) { + this.a = this.b = this.tx = this.ty = 0.0; + } + else { + aA = this.a = 1.0 / aA; + dA = this.d = 1.0 / dA; + this.tx = -aA * txA; + this.ty = -dA * tyA; + } + return this; + } + var determinant = aA * dA - bA * cA; + if (determinant === 0.0) { + this.a = this.d = 1.0; + this.b = this.c = 0.0; + this.tx = this.ty = 0.0; + return this; + } + determinant = 1.0 / determinant; + var k = this.a = dA * determinant; + bA = this.b = -bA * determinant; + cA = this.c = -cA * determinant; + dA = this.d = aA * determinant; + this.tx = -(k * txA + cA * tyA); + this.ty = -(bA * txA + dA * tyA); + return this; + }; + /** + * - Apply a matrix transformation to a specific point. + * @param x - X coordinate. + * @param y - Y coordinate. + * @param result - The point after the transformation is applied. + * @param delta - Whether to ignore tx, ty's conversion to point. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将矩阵转换应用于特定点。 + * @param x - 横坐标。 + * @param y - 纵坐标。 + * @param result - 应用转换之后的点。 + * @param delta - 是否忽略 tx,ty 对点的转换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.transformPoint = function (x, y, result, delta) { + if (delta === void 0) { delta = false; } + result.x = this.a * x + this.c * y; + result.y = this.b * x + this.d * y; + if (!delta) { + result.x += this.tx; + result.y += this.ty; + } + }; + /** + * @private + */ + Matrix.prototype.transformRectangle = function (rectangle, delta) { + if (delta === void 0) { delta = false; } + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + var tx = delta ? 0.0 : this.tx; + var ty = delta ? 0.0 : this.ty; + var x = rectangle.x; + var y = rectangle.y; + var xMax = x + rectangle.width; + var yMax = y + rectangle.height; + var x0 = a * x + c * y + tx; + var y0 = b * x + d * y + ty; + var x1 = a * xMax + c * y + tx; + var y1 = b * xMax + d * y + ty; + var x2 = a * xMax + c * yMax + tx; + var y2 = b * xMax + d * yMax + ty; + var x3 = a * x + c * yMax + tx; + var y3 = b * x + d * yMax + ty; + var tmp = 0.0; + if (x0 > x1) { + tmp = x0; + x0 = x1; + x1 = tmp; + } + if (x2 > x3) { + tmp = x2; + x2 = x3; + x3 = tmp; + } + rectangle.x = Math.floor(x0 < x2 ? x0 : x2); + rectangle.width = Math.ceil((x1 > x3 ? x1 : x3) - rectangle.x); + if (y0 > y1) { + tmp = y0; + y0 = y1; + y1 = tmp; + } + if (y2 > y3) { + tmp = y2; + y2 = y3; + y3 = tmp; + } + rectangle.y = Math.floor(y0 < y2 ? y0 : y2); + rectangle.height = Math.ceil((y1 > y3 ? y1 : y3) - rectangle.y); + }; + return Matrix; + }()); + dragonBones.Matrix = Matrix; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - 2D Transform. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 变换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Transform = (function () { + /** + * @private + */ + function Transform(x, y, skew, rotation, scaleX, scaleY) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (skew === void 0) { skew = 0.0; } + if (rotation === void 0) { rotation = 0.0; } + if (scaleX === void 0) { scaleX = 1.0; } + if (scaleY === void 0) { scaleY = 1.0; } + this.x = x; + this.y = y; + this.skew = skew; + this.rotation = rotation; + this.scaleX = scaleX; + this.scaleY = scaleY; + } + /** + * @private + */ + Transform.normalizeRadian = function (value) { + value = (value + Math.PI) % (Math.PI * 2.0); + value += value > 0.0 ? -Math.PI : Math.PI; + return value; + }; + Transform.prototype.toString = function () { + return "[object dragonBones.Transform] x:" + this.x + " y:" + this.y + " skewX:" + this.skew * 180.0 / Math.PI + " skewY:" + this.rotation * 180.0 / Math.PI + " scaleX:" + this.scaleX + " scaleY:" + this.scaleY; + }; + /** + * @private + */ + Transform.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + this.skew = value.skew; + this.rotation = value.rotation; + this.scaleX = value.scaleX; + this.scaleY = value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.identity = function () { + this.x = this.y = 0.0; + this.skew = this.rotation = 0.0; + this.scaleX = this.scaleY = 1.0; + return this; + }; + /** + * @private + */ + Transform.prototype.add = function (value) { + this.x += value.x; + this.y += value.y; + this.skew += value.skew; + this.rotation += value.rotation; + this.scaleX *= value.scaleX; + this.scaleY *= value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.minus = function (value) { + this.x -= value.x; + this.y -= value.y; + this.skew -= value.skew; + this.rotation -= value.rotation; + this.scaleX /= value.scaleX; + this.scaleY /= value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.fromMatrix = function (matrix) { + var backupScaleX = this.scaleX, backupScaleY = this.scaleY; + var PI_Q = Transform.PI_Q; + this.x = matrix.tx; + this.y = matrix.ty; + this.rotation = Math.atan(matrix.b / matrix.a); + var skewX = Math.atan(-matrix.c / matrix.d); + this.scaleX = (this.rotation > -PI_Q && this.rotation < PI_Q) ? matrix.a / Math.cos(this.rotation) : matrix.b / Math.sin(this.rotation); + this.scaleY = (skewX > -PI_Q && skewX < PI_Q) ? matrix.d / Math.cos(skewX) : -matrix.c / Math.sin(skewX); + if (backupScaleX >= 0.0 && this.scaleX < 0.0) { + this.scaleX = -this.scaleX; + this.rotation = this.rotation - Math.PI; + } + if (backupScaleY >= 0.0 && this.scaleY < 0.0) { + this.scaleY = -this.scaleY; + skewX = skewX - Math.PI; + } + this.skew = skewX - this.rotation; + return this; + }; + /** + * @private + */ + Transform.prototype.toMatrix = function (matrix) { + if (this.rotation === 0.0) { + matrix.a = 1.0; + matrix.b = 0.0; + } + else { + matrix.a = Math.cos(this.rotation); + matrix.b = Math.sin(this.rotation); + } + if (this.skew === 0.0) { + matrix.c = -matrix.b; + matrix.d = matrix.a; + } + else { + matrix.c = -Math.sin(this.skew + this.rotation); + matrix.d = Math.cos(this.skew + this.rotation); + } + if (this.scaleX !== 1.0) { + matrix.a *= this.scaleX; + matrix.b *= this.scaleX; + } + if (this.scaleY !== 1.0) { + matrix.c *= this.scaleY; + matrix.d *= this.scaleY; + } + matrix.tx = this.x; + matrix.ty = this.y; + return this; + }; + /** + * @private + */ + Transform.PI = Math.PI; + /** + * @private + */ + Transform.PI_D = Math.PI * 2.0; + /** + * @private + */ + Transform.PI_H = Math.PI / 2.0; + /** + * @private + */ + Transform.PI_Q = Math.PI / 4.0; + /** + * @private + */ + Transform.RAD_DEG = 180.0 / Math.PI; + /** + * @private + */ + Transform.DEG_RAD = Math.PI / 180.0; + return Transform; + }()); + dragonBones.Transform = Transform; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ColorTransform = (function () { + function ColorTransform(alphaMultiplier, redMultiplier, greenMultiplier, blueMultiplier, alphaOffset, redOffset, greenOffset, blueOffset) { + if (alphaMultiplier === void 0) { alphaMultiplier = 1.0; } + if (redMultiplier === void 0) { redMultiplier = 1.0; } + if (greenMultiplier === void 0) { greenMultiplier = 1.0; } + if (blueMultiplier === void 0) { blueMultiplier = 1.0; } + if (alphaOffset === void 0) { alphaOffset = 0; } + if (redOffset === void 0) { redOffset = 0; } + if (greenOffset === void 0) { greenOffset = 0; } + if (blueOffset === void 0) { blueOffset = 0; } + this.alphaMultiplier = alphaMultiplier; + this.redMultiplier = redMultiplier; + this.greenMultiplier = greenMultiplier; + this.blueMultiplier = blueMultiplier; + this.alphaOffset = alphaOffset; + this.redOffset = redOffset; + this.greenOffset = greenOffset; + this.blueOffset = blueOffset; + } + ColorTransform.prototype.copyFrom = function (value) { + this.alphaMultiplier = value.alphaMultiplier; + this.redMultiplier = value.redMultiplier; + this.greenMultiplier = value.greenMultiplier; + this.blueMultiplier = value.blueMultiplier; + this.alphaOffset = value.alphaOffset; + this.redOffset = value.redOffset; + this.greenOffset = value.greenOffset; + this.blueOffset = value.blueOffset; + }; + ColorTransform.prototype.identity = function () { + this.alphaMultiplier = this.redMultiplier = this.greenMultiplier = this.blueMultiplier = 1.0; + this.alphaOffset = this.redOffset = this.greenOffset = this.blueOffset = 0; + }; + return ColorTransform; + }()); + dragonBones.ColorTransform = ColorTransform; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The Point object represents a location in a two-dimensional coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Point 对象表示二维坐标系统中的某个位置。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Point = (function () { + /** + * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @param x - The horizontal coordinate. + * @param y - The vertical coordinate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。 + * @param x - 该对象的x属性值,默认为 0.0。 + * @param y - 该对象的y属性值,默认为 0.0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + function Point(x, y) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + this.x = x; + this.y = y; + } + /** + * @private + */ + Point.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + }; + /** + * @private + */ + Point.prototype.clear = function () { + this.x = this.y = 0.0; + }; + return Point; + }()); + dragonBones.Point = Point; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its + * width and its height.
+ * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of + * one property has no effect on the others. However, the right and bottom properties are integrally related to those + * four properties. For example, if you change the value of the right property, the value of the width property changes; + * if you change the bottom property, the value of the height property changes. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
+ * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 + * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width + * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Rectangle = (function () { + /** + * @private + */ + function Rectangle(x, y, width, height) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (width === void 0) { width = 0.0; } + if (height === void 0) { height = 0.0; } + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + /** + * @private + */ + Rectangle.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + this.width = value.width; + this.height = value.height; + }; + /** + * @private + */ + Rectangle.prototype.clear = function () { + this.x = this.y = 0.0; + this.width = this.height = 0.0; + }; + return Rectangle; + }()); + dragonBones.Rectangle = Rectangle; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The user custom data. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 用户自定义数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + var UserData = (function (_super) { + __extends(UserData, _super); + function UserData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - The custom int numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.ints = []; + /** + * - The custom float numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.floats = []; + /** + * - The custom strings. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.strings = []; + return _this; + } + UserData.toString = function () { + return "[class dragonBones.UserData]"; + }; + UserData.prototype._onClear = function () { + this.ints.length = 0; + this.floats.length = 0; + this.strings.length = 0; + }; + /** + * @internal + */ + UserData.prototype.addInt = function (value) { + this.ints.push(value); + }; + /** + * @internal + */ + UserData.prototype.addFloat = function (value) { + this.floats.push(value); + }; + /** + * @internal + */ + UserData.prototype.addString = function (value) { + this.strings.push(value); + }; + /** + * - Get the custom int number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getInt = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.ints.length ? this.ints[index] : 0; + }; + /** + * - Get the custom float number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getFloat = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.floats.length ? this.floats[index] : 0.0; + }; + /** + * - Get the custom string. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getString = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.strings.length ? this.strings[index] : ""; + }; + return UserData; + }(dragonBones.BaseObject)); + dragonBones.UserData = UserData; + /** + * @private + */ + var ActionData = (function (_super) { + __extends(ActionData, _super); + function ActionData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.data = null; // + return _this; + } + ActionData.toString = function () { + return "[class dragonBones.ActionData]"; + }; + ActionData.prototype._onClear = function () { + if (this.data !== null) { + this.data.returnToPool(); + } + this.type = 0 /* Play */; + this.name = ""; + this.bone = null; + this.slot = null; + this.data = null; + }; + return ActionData; + }(dragonBones.BaseObject)); + dragonBones.ActionData = ActionData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The DragonBones data. + * A DragonBones data contains multiple armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据。 + * 一个龙骨数据包含多个骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + var DragonBonesData = (function (_super) { + __extends(DragonBonesData, _super); + function DragonBonesData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @internal + */ + _this.frameIndices = []; + /** + * @internal + */ + _this.cachedFrames = []; + /** + * - All armature data names. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.armatureNames = []; + /** + * @private + */ + _this.armatures = {}; + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + DragonBonesData.toString = function () { + return "[class dragonBones.DragonBonesData]"; + }; + DragonBonesData.prototype._onClear = function () { + for (var k in this.armatures) { + this.armatures[k].returnToPool(); + delete this.armatures[k]; + } + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.autoSearch = false; + this.frameRate = 0; + this.version = ""; + this.name = ""; + this.stage = null; + this.frameIndices.length = 0; + this.cachedFrames.length = 0; + this.armatureNames.length = 0; + //this.armatures.clear(); + this.binary = null; // + this.intArray = null; // + this.floatArray = null; // + this.frameIntArray = null; // + this.frameFloatArray = null; // + this.frameArray = null; // + this.timelineArray = null; // + this.colorArray = null; // + this.userData = null; + }; + /** + * @internal + */ + DragonBonesData.prototype.addArmature = function (value) { + if (value.name in this.armatures) { + console.warn("Same armature: " + value.name); + return; + } + value.parent = this; + this.armatures[value.name] = value; + this.armatureNames.push(value.name); + }; + /** + * - Get a specific armature data. + * @param armatureName - The armature data name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param armatureName - 骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + DragonBonesData.prototype.getArmature = function (armatureName) { + return armatureName in this.armatures ? this.armatures[armatureName] : null; + }; + return DragonBonesData; + }(dragonBones.BaseObject)); + dragonBones.DragonBonesData = DragonBonesData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The armature data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var ArmatureData = (function (_super) { + __extends(ArmatureData, _super); + function ArmatureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.aabb = new dragonBones.Rectangle(); + /** + * - The names of all the animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的动画数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.animationNames = []; + /** + * @private + */ + _this.sortedBones = []; + /** + * @private + */ + _this.sortedSlots = []; + /** + * @private + */ + _this.defaultActions = []; + /** + * @private + */ + _this.actions = []; + /** + * @private + */ + _this.bones = {}; + /** + * @private + */ + _this.slots = {}; + /** + * @private + */ + _this.constraints = {}; + /** + * @private + */ + _this.skins = {}; + /** + * @private + */ + _this.animations = {}; + /** + * @private + */ + _this.canvas = null; // Initial value. + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + ArmatureData.toString = function () { + return "[class dragonBones.ArmatureData]"; + }; + ArmatureData.prototype._onClear = function () { + for (var _i = 0, _a = this.defaultActions; _i < _a.length; _i++) { + var action = _a[_i]; + action.returnToPool(); + } + for (var _b = 0, _c = this.actions; _b < _c.length; _b++) { + var action = _c[_b]; + action.returnToPool(); + } + for (var k in this.bones) { + this.bones[k].returnToPool(); + delete this.bones[k]; + } + for (var k in this.slots) { + this.slots[k].returnToPool(); + delete this.slots[k]; + } + for (var k in this.constraints) { + this.constraints[k].returnToPool(); + delete this.constraints[k]; + } + for (var k in this.skins) { + this.skins[k].returnToPool(); + delete this.skins[k]; + } + for (var k in this.animations) { + this.animations[k].returnToPool(); + delete this.animations[k]; + } + if (this.canvas !== null) { + this.canvas.returnToPool(); + } + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.type = 0 /* Armature */; + this.frameRate = 0; + this.cacheFrameRate = 0; + this.scale = 1.0; + this.name = ""; + this.aabb.clear(); + this.animationNames.length = 0; + this.sortedBones.length = 0; + this.sortedSlots.length = 0; + this.defaultActions.length = 0; + this.actions.length = 0; + // this.bones.clear(); + // this.slots.clear(); + // this.constraints.clear(); + // this.skins.clear(); + // this.animations.clear(); + this.defaultSkin = null; + this.defaultAnimation = null; + this.canvas = null; + this.userData = null; + this.parent = null; // + }; + /** + * @internal + */ + ArmatureData.prototype.sortBones = function () { + var total = this.sortedBones.length; + if (total <= 0) { + return; + } + var sortHelper = this.sortedBones.concat(); + var index = 0; + var count = 0; + this.sortedBones.length = 0; + while (count < total) { + var bone = sortHelper[index++]; + if (index >= total) { + index = 0; + } + if (this.sortedBones.indexOf(bone) >= 0) { + continue; + } + var flag = false; + for (var k in this.constraints) { + var constraint = this.constraints[k]; + if (constraint.root === bone && this.sortedBones.indexOf(constraint.target) < 0) { + flag = true; + break; + } + } + if (flag) { + continue; + } + if (bone.parent !== null && this.sortedBones.indexOf(bone.parent) < 0) { + continue; + } + this.sortedBones.push(bone); + count++; + } + }; + /** + * @internal + */ + ArmatureData.prototype.cacheFrames = function (frameRate) { + if (this.cacheFrameRate > 0) { + return; + } + this.cacheFrameRate = frameRate; + for (var k in this.animations) { + this.animations[k].cacheFrames(this.cacheFrameRate); + } + }; + /** + * @internal + */ + ArmatureData.prototype.setCacheFrame = function (globalTransformMatrix, transform) { + var dataArray = this.parent.cachedFrames; + var arrayOffset = dataArray.length; + dataArray.length += 10; + dataArray[arrayOffset] = globalTransformMatrix.a; + dataArray[arrayOffset + 1] = globalTransformMatrix.b; + dataArray[arrayOffset + 2] = globalTransformMatrix.c; + dataArray[arrayOffset + 3] = globalTransformMatrix.d; + dataArray[arrayOffset + 4] = globalTransformMatrix.tx; + dataArray[arrayOffset + 5] = globalTransformMatrix.ty; + dataArray[arrayOffset + 6] = transform.rotation; + dataArray[arrayOffset + 7] = transform.skew; + dataArray[arrayOffset + 8] = transform.scaleX; + dataArray[arrayOffset + 9] = transform.scaleY; + return arrayOffset; + }; + /** + * @internal + */ + ArmatureData.prototype.getCacheFrame = function (globalTransformMatrix, transform, arrayOffset) { + var dataArray = this.parent.cachedFrames; + globalTransformMatrix.a = dataArray[arrayOffset]; + globalTransformMatrix.b = dataArray[arrayOffset + 1]; + globalTransformMatrix.c = dataArray[arrayOffset + 2]; + globalTransformMatrix.d = dataArray[arrayOffset + 3]; + globalTransformMatrix.tx = dataArray[arrayOffset + 4]; + globalTransformMatrix.ty = dataArray[arrayOffset + 5]; + transform.rotation = dataArray[arrayOffset + 6]; + transform.skew = dataArray[arrayOffset + 7]; + transform.scaleX = dataArray[arrayOffset + 8]; + transform.scaleY = dataArray[arrayOffset + 9]; + transform.x = globalTransformMatrix.tx; + transform.y = globalTransformMatrix.ty; + }; + /** + * @internal + */ + ArmatureData.prototype.addBone = function (value) { + if (value.name in this.bones) { + console.warn("Same bone: " + value.name); + return; + } + this.bones[value.name] = value; + this.sortedBones.push(value); + }; + /** + * @internal + */ + ArmatureData.prototype.addSlot = function (value) { + if (value.name in this.slots) { + console.warn("Same slot: " + value.name); + return; + } + this.slots[value.name] = value; + this.sortedSlots.push(value); + }; + /** + * @internal + */ + ArmatureData.prototype.addConstraint = function (value) { + if (value.name in this.constraints) { + console.warn("Same constraint: " + value.name); + return; + } + this.constraints[value.name] = value; + }; + /** + * @internal + */ + ArmatureData.prototype.addSkin = function (value) { + if (value.name in this.skins) { + console.warn("Same skin: " + value.name); + return; + } + value.parent = this; + this.skins[value.name] = value; + if (this.defaultSkin === null) { + this.defaultSkin = value; + } + if (value.name === "default") { + this.defaultSkin = value; + } + }; + /** + * @internal + */ + ArmatureData.prototype.addAnimation = function (value) { + if (value.name in this.animations) { + console.warn("Same animation: " + value.name); + return; + } + value.parent = this; + this.animations[value.name] = value; + this.animationNames.push(value.name); + if (this.defaultAnimation === null) { + this.defaultAnimation = value; + } + }; + /** + * @internal + */ + ArmatureData.prototype.addAction = function (value, isDefault) { + if (isDefault) { + this.defaultActions.push(value); + } + else { + this.actions.push(value); + } + }; + /** + * - Get a specific done data. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼数据。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getBone = function (boneName) { + return boneName in this.bones ? this.bones[boneName] : null; + }; + /** + * - Get a specific slot data. + * @param slotName - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽数据。 + * @param slotName - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getSlot = function (slotName) { + return slotName in this.slots ? this.slots[slotName] : null; + }; + /** + * @private + */ + ArmatureData.prototype.getConstraint = function (constraintName) { + return constraintName in this.constraints ? this.constraints[constraintName] : null; + }; + /** + * - Get a specific skin data. + * @param skinName - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定皮肤数据。 + * @param skinName - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getSkin = function (skinName) { + return skinName in this.skins ? this.skins[skinName] : null; + }; + /** + * @private + */ + ArmatureData.prototype.getMesh = function (skinName, slotName, meshName) { + var skin = this.getSkin(skinName); + if (skin === null) { + return null; + } + return skin.getDisplay(slotName, meshName); + }; + /** + * - Get a specific animation data. + * @param animationName - The animation animationName. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的动画数据。 + * @param animationName - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getAnimation = function (animationName) { + return animationName in this.animations ? this.animations[animationName] : null; + }; + return ArmatureData; + }(dragonBones.BaseObject)); + dragonBones.ArmatureData = ArmatureData; + /** + * - The bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var BoneData = (function (_super) { + __extends(BoneData, _super); + function BoneData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.transform = new dragonBones.Transform(); + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + BoneData.toString = function () { + return "[class dragonBones.BoneData]"; + }; + BoneData.prototype._onClear = function () { + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.inheritTranslation = false; + this.inheritRotation = false; + this.inheritScale = false; + this.inheritReflection = false; + this.type = 0 /* Bone */; + this.length = 0.0; + this.alpha = 1.0; + this.name = ""; + this.transform.identity(); + this.userData = null; + this.parent = null; + }; + return BoneData; + }(dragonBones.BaseObject)); + dragonBones.BoneData = BoneData; + /** + * @internal + */ + var SurfaceData = (function (_super) { + __extends(SurfaceData, _super); + function SurfaceData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new dragonBones.GeometryData(); + return _this; + } + SurfaceData.toString = function () { + return "[class dragonBones.SurfaceData]"; + }; + SurfaceData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 1 /* Surface */; + this.segmentX = 0; + this.segmentY = 0; + this.geometry.clear(); + }; + return SurfaceData; + }(BoneData)); + dragonBones.SurfaceData = SurfaceData; + /** + * - The slot data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var SlotData = (function (_super) { + __extends(SlotData, _super); + function SlotData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.color = null; // Initial value. + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + /** + * @internal + */ + SlotData.createColor = function () { + return new dragonBones.ColorTransform(); + }; + SlotData.toString = function () { + return "[class dragonBones.SlotData]"; + }; + SlotData.prototype._onClear = function () { + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.blendMode = 0 /* Normal */; + this.displayIndex = 0; + this.zOrder = 0; + this.zIndex = 0; + this.alpha = 1.0; + this.name = ""; + this.color = null; // + this.userData = null; + this.parent = null; // + }; + /** + * @internal + */ + SlotData.DEFAULT_COLOR = new dragonBones.ColorTransform(); + return SlotData; + }(dragonBones.BaseObject)); + dragonBones.SlotData = SlotData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var CanvasData = (function (_super) { + __extends(CanvasData, _super); + function CanvasData() { + return _super !== null && _super.apply(this, arguments) || this; + } + CanvasData.toString = function () { + return "[class dragonBones.CanvasData]"; + }; + CanvasData.prototype._onClear = function () { + this.hasBackground = false; + this.color = 0x000000; + this.x = 0; + this.y = 0; + this.width = 0; + this.height = 0; + }; + return CanvasData; + }(dragonBones.BaseObject)); + dragonBones.CanvasData = CanvasData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The skin data, typically a armature data instance contains at least one skinData. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var SkinData = (function (_super) { + __extends(SkinData, _super); + function SkinData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.displays = {}; + return _this; + } + SkinData.toString = function () { + return "[class dragonBones.SkinData]"; + }; + SkinData.prototype._onClear = function () { + for (var k in this.displays) { + var slotDisplays = this.displays[k]; + for (var _i = 0, slotDisplays_1 = slotDisplays; _i < slotDisplays_1.length; _i++) { + var display = slotDisplays_1[_i]; + if (display !== null) { + display.returnToPool(); + } + } + delete this.displays[k]; + } + this.name = ""; + // this.displays.clear(); + this.parent = null; // + }; + /** + * @internal + */ + SkinData.prototype.addDisplay = function (slotName, value) { + if (!(slotName in this.displays)) { + this.displays[slotName] = []; + } + if (value !== null) { + value.parent = this; + } + var slotDisplays = this.displays[slotName]; // TODO clear prev + slotDisplays.push(value); + }; + /** + * @private + */ + SkinData.prototype.getDisplay = function (slotName, displayName) { + var slotDisplays = this.getDisplays(slotName); + if (slotDisplays !== null) { + for (var _i = 0, slotDisplays_2 = slotDisplays; _i < slotDisplays_2.length; _i++) { + var display = slotDisplays_2[_i]; + if (display !== null && display.name === displayName) { + return display; + } + } + } + return null; + }; + /** + * @private + */ + SkinData.prototype.getDisplays = function (slotName) { + if (!(slotName in this.displays)) { + return null; + } + return this.displays[slotName]; + }; + return SkinData; + }(dragonBones.BaseObject)); + dragonBones.SkinData = SkinData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ConstraintData = (function (_super) { + __extends(ConstraintData, _super); + function ConstraintData() { + return _super !== null && _super.apply(this, arguments) || this; + } + ConstraintData.prototype._onClear = function () { + this.order = 0; + this.name = ""; + this.type = 0 /* IK */; + this.target = null; // + this.root = null; // + this.bone = null; + }; + return ConstraintData; + }(dragonBones.BaseObject)); + dragonBones.ConstraintData = ConstraintData; + /** + * @internal + */ + var IKConstraintData = (function (_super) { + __extends(IKConstraintData, _super); + function IKConstraintData() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraintData.toString = function () { + return "[class dragonBones.IKConstraintData]"; + }; + IKConstraintData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.scaleEnabled = false; + this.bendPositive = false; + this.weight = 1.0; + }; + return IKConstraintData; + }(ConstraintData)); + dragonBones.IKConstraintData = IKConstraintData; + /** + * @internal + */ + var PathConstraintData = (function (_super) { + __extends(PathConstraintData, _super); + function PathConstraintData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.bones = []; + return _this; + } + PathConstraintData.toString = function () { + return "[class dragonBones.PathConstraintData]"; + }; + PathConstraintData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.pathSlot = null; + this.pathDisplayData = null; + this.bones.length = 0; + this.positionMode = 0 /* Fixed */; + this.spacingMode = 1 /* Fixed */; + this.rotateMode = 1 /* Chain */; + this.position = 0.0; + this.spacing = 0.0; + this.rotateOffset = 0.0; + this.rotateMix = 0.0; + this.translateMix = 0.0; + }; + PathConstraintData.prototype.AddBone = function (value) { + this.bones.push(value); + }; + return PathConstraintData; + }(ConstraintData)); + dragonBones.PathConstraintData = PathConstraintData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var GeometryData = (function () { + function GeometryData() { + this.weight = null; // Initial value. + } + GeometryData.prototype.clear = function () { + if (!this.isShared && this.weight !== null) { + this.weight.returnToPool(); + } + this.isShared = false; + this.inheritDeform = false; + this.offset = 0; + this.data = null; + this.weight = null; + }; + GeometryData.prototype.shareFrom = function (value) { + this.isShared = true; + this.offset = value.offset; + this.weight = value.weight; + }; + Object.defineProperty(GeometryData.prototype, "vertexCount", { + get: function () { + var intArray = this.data.intArray; + return intArray[this.offset + 0 /* GeometryVertexCount */]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GeometryData.prototype, "triangleCount", { + get: function () { + var intArray = this.data.intArray; + return intArray[this.offset + 1 /* GeometryTriangleCount */]; + }, + enumerable: true, + configurable: true + }); + return GeometryData; + }()); + dragonBones.GeometryData = GeometryData; + /** + * @private + */ + var DisplayData = (function (_super) { + __extends(DisplayData, _super); + function DisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.transform = new dragonBones.Transform(); + return _this; + } + DisplayData.prototype._onClear = function () { + this.name = ""; + this.path = ""; + this.transform.identity(); + this.parent = null; // + }; + return DisplayData; + }(dragonBones.BaseObject)); + dragonBones.DisplayData = DisplayData; + /** + * @private + */ + var ImageDisplayData = (function (_super) { + __extends(ImageDisplayData, _super); + function ImageDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.pivot = new dragonBones.Point(); + return _this; + } + ImageDisplayData.toString = function () { + return "[class dragonBones.ImageDisplayData]"; + }; + ImageDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 0 /* Image */; + this.pivot.clear(); + this.texture = null; + }; + return ImageDisplayData; + }(DisplayData)); + dragonBones.ImageDisplayData = ImageDisplayData; + /** + * @private + */ + var ArmatureDisplayData = (function (_super) { + __extends(ArmatureDisplayData, _super); + function ArmatureDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.actions = []; + return _this; + } + ArmatureDisplayData.toString = function () { + return "[class dragonBones.ArmatureDisplayData]"; + }; + ArmatureDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + for (var _i = 0, _a = this.actions; _i < _a.length; _i++) { + var action = _a[_i]; + action.returnToPool(); + } + this.type = 1 /* Armature */; + this.inheritAnimation = false; + this.actions.length = 0; + this.armature = null; + }; + /** + * @private + */ + ArmatureDisplayData.prototype.addAction = function (value) { + this.actions.push(value); + }; + return ArmatureDisplayData; + }(DisplayData)); + dragonBones.ArmatureDisplayData = ArmatureDisplayData; + /** + * @private + */ + var MeshDisplayData = (function (_super) { + __extends(MeshDisplayData, _super); + function MeshDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new GeometryData(); + return _this; + } + MeshDisplayData.toString = function () { + return "[class dragonBones.MeshDisplayData]"; + }; + MeshDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 2 /* Mesh */; + this.geometry.clear(); + this.texture = null; + }; + return MeshDisplayData; + }(DisplayData)); + dragonBones.MeshDisplayData = MeshDisplayData; + /** + * @private + */ + var BoundingBoxDisplayData = (function (_super) { + __extends(BoundingBoxDisplayData, _super); + function BoundingBoxDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.boundingBox = null; // Initial value. + return _this; + } + BoundingBoxDisplayData.toString = function () { + return "[class dragonBones.BoundingBoxDisplayData]"; + }; + BoundingBoxDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this.boundingBox !== null) { + this.boundingBox.returnToPool(); + } + this.type = 3 /* BoundingBox */; + this.boundingBox = null; + }; + return BoundingBoxDisplayData; + }(DisplayData)); + dragonBones.BoundingBoxDisplayData = BoundingBoxDisplayData; + /** + * @private + */ + var PathDisplayData = (function (_super) { + __extends(PathDisplayData, _super); + function PathDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new GeometryData(); + _this.curveLengths = []; + return _this; + } + PathDisplayData.toString = function () { + return "[class dragonBones.PathDisplayData]"; + }; + PathDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 4 /* Path */; + this.closed = false; + this.constantSpeed = false; + this.geometry.clear(); + this.curveLengths.length = 0; + }; + return PathDisplayData; + }(DisplayData)); + dragonBones.PathDisplayData = PathDisplayData; + /** + * @private + */ + var WeightData = (function (_super) { + __extends(WeightData, _super); + function WeightData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.bones = []; + return _this; + } + WeightData.toString = function () { + return "[class dragonBones.WeightData]"; + }; + WeightData.prototype._onClear = function () { + this.count = 0; + this.offset = 0; + this.bones.length = 0; + }; + WeightData.prototype.addBone = function (value) { + this.bones.push(value); + }; + return WeightData; + }(dragonBones.BaseObject)); + dragonBones.WeightData = WeightData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The base class of bounding box data. + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框数据基类。 + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language zh_CN + */ + var BoundingBoxData = (function (_super) { + __extends(BoundingBoxData, _super); + function BoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoundingBoxData.prototype._onClear = function () { + this.color = 0x000000; + this.width = 0.0; + this.height = 0.0; + }; + return BoundingBoxData; + }(dragonBones.BaseObject)); + dragonBones.BoundingBoxData = BoundingBoxData; + /** + * - The rectangle bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 矩形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var RectangleBoundingBoxData = (function (_super) { + __extends(RectangleBoundingBoxData, _super); + function RectangleBoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + RectangleBoundingBoxData.toString = function () { + return "[class dragonBones.RectangleBoundingBoxData]"; + }; + /** + * - Compute the bit code for a point (x, y) using the clip rectangle + */ + RectangleBoundingBoxData._computeOutCode = function (x, y, xMin, yMin, xMax, yMax) { + var code = 0 /* InSide */; // initialised as being inside of [[clip window]] + if (x < xMin) { + code |= 1 /* Left */; + } + else if (x > xMax) { + code |= 2 /* Right */; + } + if (y < yMin) { + code |= 4 /* Top */; + } + else if (y > yMax) { + code |= 8 /* Bottom */; + } + return code; + }; + /** + * @private + */ + RectangleBoundingBoxData.rectangleIntersectsSegment = function (xA, yA, xB, yB, xMin, yMin, xMax, yMax, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var inSideA = xA > xMin && xA < xMax && yA > yMin && yA < yMax; + var inSideB = xB > xMin && xB < xMax && yB > yMin && yB < yMax; + if (inSideA && inSideB) { + return -1; + } + var intersectionCount = 0; + var outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax); + var outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax); + while (true) { + if ((outcode0 | outcode1) === 0) { + intersectionCount = 2; + break; + } + else if ((outcode0 & outcode1) !== 0) { + break; + } + // failed both tests, so calculate the line segment to clip + // from an outside point to an intersection with clip edge + var x = 0.0; + var y = 0.0; + var normalRadian = 0.0; + // At least one endpoint is outside the clip rectangle; pick it. + var outcodeOut = outcode0 !== 0 ? outcode0 : outcode1; + // Now find the intersection point; + if ((outcodeOut & 4 /* Top */) !== 0) { + x = xA + (xB - xA) * (yMin - yA) / (yB - yA); + y = yMin; + if (normalRadians !== null) { + normalRadian = -Math.PI * 0.5; + } + } + else if ((outcodeOut & 8 /* Bottom */) !== 0) { + x = xA + (xB - xA) * (yMax - yA) / (yB - yA); + y = yMax; + if (normalRadians !== null) { + normalRadian = Math.PI * 0.5; + } + } + else if ((outcodeOut & 2 /* Right */) !== 0) { + y = yA + (yB - yA) * (xMax - xA) / (xB - xA); + x = xMax; + if (normalRadians !== null) { + normalRadian = 0; + } + } + else if ((outcodeOut & 1 /* Left */) !== 0) { + y = yA + (yB - yA) * (xMin - xA) / (xB - xA); + x = xMin; + if (normalRadians !== null) { + normalRadian = Math.PI; + } + } + // Now we move outside point to intersection point to clip + // and get ready for next pass. + if (outcodeOut === outcode0) { + xA = x; + yA = y; + outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax); + if (normalRadians !== null) { + normalRadians.x = normalRadian; + } + } + else { + xB = x; + yB = y; + outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax); + if (normalRadians !== null) { + normalRadians.y = normalRadian; + } + } + } + if (intersectionCount) { + if (inSideA) { + intersectionCount = 2; // 10 + if (intersectionPointA !== null) { + intersectionPointA.x = xB; + intersectionPointA.y = yB; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = xB; + } + if (normalRadians !== null) { + normalRadians.x = normalRadians.y + Math.PI; + } + } + else if (inSideB) { + intersectionCount = 1; // 01 + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA; + intersectionPointB.y = yA; + } + if (normalRadians !== null) { + normalRadians.y = normalRadians.x + Math.PI; + } + } + else { + intersectionCount = 3; // 11 + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = yB; + } + } + } + return intersectionCount; + }; + RectangleBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 0 /* Rectangle */; + }; + /** + * @inheritDoc + */ + RectangleBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var widthH = this.width * 0.5; + if (pX >= -widthH && pX <= widthH) { + var heightH = this.height * 0.5; + if (pY >= -heightH && pY <= heightH) { + return true; + } + } + return false; + }; + /** + * @inheritDoc + */ + RectangleBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var widthH = this.width * 0.5; + var heightH = this.height * 0.5; + var intersectionCount = RectangleBoundingBoxData.rectangleIntersectsSegment(xA, yA, xB, yB, -widthH, -heightH, widthH, heightH, intersectionPointA, intersectionPointB, normalRadians); + return intersectionCount; + }; + return RectangleBoundingBoxData; + }(BoundingBoxData)); + dragonBones.RectangleBoundingBoxData = RectangleBoundingBoxData; + /** + * - The ellipse bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 椭圆边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var EllipseBoundingBoxData = (function (_super) { + __extends(EllipseBoundingBoxData, _super); + function EllipseBoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + EllipseBoundingBoxData.toString = function () { + return "[class dragonBones.EllipseData]"; + }; + /** + * @private + */ + EllipseBoundingBoxData.ellipseIntersectsSegment = function (xA, yA, xB, yB, xC, yC, widthH, heightH, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var d = widthH / heightH; + var dd = d * d; + yA *= d; + yB *= d; + var dX = xB - xA; + var dY = yB - yA; + var lAB = Math.sqrt(dX * dX + dY * dY); + var xD = dX / lAB; + var yD = dY / lAB; + var a = (xC - xA) * xD + (yC - yA) * yD; + var aa = a * a; + var ee = xA * xA + yA * yA; + var rr = widthH * widthH; + var dR = rr - ee + aa; + var intersectionCount = 0; + if (dR >= 0.0) { + var dT = Math.sqrt(dR); + var sA = a - dT; + var sB = a + dT; + var inSideA = sA < 0.0 ? -1 : (sA <= lAB ? 0 : 1); + var inSideB = sB < 0.0 ? -1 : (sB <= lAB ? 0 : 1); + var sideAB = inSideA * inSideB; + if (sideAB < 0) { + return -1; + } + else if (sideAB === 0) { + if (inSideA === -1) { + intersectionCount = 2; // 10 + xB = xA + sB * xD; + yB = (yA + sB * yD) / d; + if (intersectionPointA !== null) { + intersectionPointA.x = xB; + intersectionPointA.y = yB; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = yB; + } + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yB / rr * dd, xB / rr); + normalRadians.y = normalRadians.x + Math.PI; + } + } + else if (inSideB === 1) { + intersectionCount = 1; // 01 + xA = xA + sA * xD; + yA = (yA + sA * yD) / d; + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA; + intersectionPointB.y = yA; + } + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yA / rr * dd, xA / rr); + normalRadians.y = normalRadians.x + Math.PI; + } + } + else { + intersectionCount = 3; // 11 + if (intersectionPointA !== null) { + intersectionPointA.x = xA + sA * xD; + intersectionPointA.y = (yA + sA * yD) / d; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(intersectionPointA.y / rr * dd, intersectionPointA.x / rr); + } + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA + sB * xD; + intersectionPointB.y = (yA + sB * yD) / d; + if (normalRadians !== null) { + normalRadians.y = Math.atan2(intersectionPointB.y / rr * dd, intersectionPointB.x / rr); + } + } + } + } + } + return intersectionCount; + }; + EllipseBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 1 /* Ellipse */; + }; + /** + * @inheritDoc + */ + EllipseBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var widthH = this.width * 0.5; + if (pX >= -widthH && pX <= widthH) { + var heightH = this.height * 0.5; + if (pY >= -heightH && pY <= heightH) { + pY *= widthH / heightH; + return Math.sqrt(pX * pX + pY * pY) <= widthH; + } + } + return false; + }; + /** + * @inheritDoc + */ + EllipseBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var intersectionCount = EllipseBoundingBoxData.ellipseIntersectsSegment(xA, yA, xB, yB, 0.0, 0.0, this.width * 0.5, this.height * 0.5, intersectionPointA, intersectionPointB, normalRadians); + return intersectionCount; + }; + return EllipseBoundingBoxData; + }(BoundingBoxData)); + dragonBones.EllipseBoundingBoxData = EllipseBoundingBoxData; + /** + * - The polygon bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var PolygonBoundingBoxData = (function (_super) { + __extends(PolygonBoundingBoxData, _super); + function PolygonBoundingBoxData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - The polygon vertices. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形顶点。 + * @version DragonBones 5.1 + * @language zh_CN + */ + _this.vertices = []; + return _this; + } + PolygonBoundingBoxData.toString = function () { + return "[class dragonBones.PolygonBoundingBoxData]"; + }; + /** + * @private + */ + PolygonBoundingBoxData.polygonIntersectsSegment = function (xA, yA, xB, yB, vertices, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + if (xA === xB) { + xA = xB + 0.000001; + } + if (yA === yB) { + yA = yB + 0.000001; + } + var count = vertices.length; + var dXAB = xA - xB; + var dYAB = yA - yB; + var llAB = xA * yB - yA * xB; + var intersectionCount = 0; + var xC = vertices[count - 2]; + var yC = vertices[count - 1]; + var dMin = 0.0; + var dMax = 0.0; + var xMin = 0.0; + var yMin = 0.0; + var xMax = 0.0; + var yMax = 0.0; + for (var i = 0; i < count; i += 2) { + var xD = vertices[i]; + var yD = vertices[i + 1]; + if (xC === xD) { + xC = xD + 0.0001; + } + if (yC === yD) { + yC = yD + 0.0001; + } + var dXCD = xC - xD; + var dYCD = yC - yD; + var llCD = xC * yD - yC * xD; + var ll = dXAB * dYCD - dYAB * dXCD; + var x = (llAB * dXCD - dXAB * llCD) / ll; + if (((x >= xC && x <= xD) || (x >= xD && x <= xC)) && (dXAB === 0.0 || (x >= xA && x <= xB) || (x >= xB && x <= xA))) { + var y = (llAB * dYCD - dYAB * llCD) / ll; + if (((y >= yC && y <= yD) || (y >= yD && y <= yC)) && (dYAB === 0.0 || (y >= yA && y <= yB) || (y >= yB && y <= yA))) { + if (intersectionPointB !== null) { + var d = x - xA; + if (d < 0.0) { + d = -d; + } + if (intersectionCount === 0) { + dMin = d; + dMax = d; + xMin = x; + yMin = y; + xMax = x; + yMax = y; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + normalRadians.y = normalRadians.x; + } + } + else { + if (d < dMin) { + dMin = d; + xMin = x; + yMin = y; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + } + } + if (d > dMax) { + dMax = d; + xMax = x; + yMax = y; + if (normalRadians !== null) { + normalRadians.y = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + } + } + } + intersectionCount++; + } + else { + xMin = x; + yMin = y; + xMax = x; + yMax = y; + intersectionCount++; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + normalRadians.y = normalRadians.x; + } + break; + } + } + } + xC = xD; + yC = yD; + } + if (intersectionCount === 1) { + if (intersectionPointA !== null) { + intersectionPointA.x = xMin; + intersectionPointA.y = yMin; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xMin; + intersectionPointB.y = yMin; + } + if (normalRadians !== null) { + normalRadians.y = normalRadians.x + Math.PI; + } + } + else if (intersectionCount > 1) { + intersectionCount++; + if (intersectionPointA !== null) { + intersectionPointA.x = xMin; + intersectionPointA.y = yMin; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xMax; + intersectionPointB.y = yMax; + } + } + return intersectionCount; + }; + PolygonBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 2 /* Polygon */; + this.x = 0.0; + this.y = 0.0; + this.vertices.length = 0; + }; + /** + * @inheritDoc + */ + PolygonBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var isInSide = false; + if (pX >= this.x && pX <= this.width && pY >= this.y && pY <= this.height) { + for (var i = 0, l = this.vertices.length, iP = l - 2; i < l; i += 2) { + var yA = this.vertices[iP + 1]; + var yB = this.vertices[i + 1]; + if ((yB < pY && yA >= pY) || (yA < pY && yB >= pY)) { + var xA = this.vertices[iP]; + var xB = this.vertices[i]; + if ((pY - yB) * (xA - xB) / (yA - yB) + xB < pX) { + isInSide = !isInSide; + } + } + iP = i; + } + } + return isInSide; + }; + /** + * @inheritDoc + */ + PolygonBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var intersectionCount = 0; + if (RectangleBoundingBoxData.rectangleIntersectsSegment(xA, yA, xB, yB, this.x, this.y, this.x + this.width, this.y + this.height, null, null, null) !== 0) { + intersectionCount = PolygonBoundingBoxData.polygonIntersectsSegment(xA, yA, xB, yB, this.vertices, intersectionPointA, intersectionPointB, normalRadians); + } + return intersectionCount; + }; + return PolygonBoundingBoxData; + }(BoundingBoxData)); + dragonBones.PolygonBoundingBoxData = PolygonBoundingBoxData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var AnimationData = (function (_super) { + __extends(AnimationData, _super); + function AnimationData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.cachedFrames = []; + /** + * @private + */ + _this.boneTimelines = {}; + /** + * @private + */ + _this.slotTimelines = {}; + /** + * @private + */ + _this.constraintTimelines = {}; + /** + * @private + */ + _this.animationTimelines = {}; + /** + * @private + */ + _this.boneCachedFrameIndices = {}; + /** + * @private + */ + _this.slotCachedFrameIndices = {}; + /** + * @private + */ + _this.actionTimeline = null; // Initial value. + /** + * @private + */ + _this.zOrderTimeline = null; // Initial value. + return _this; + } + AnimationData.toString = function () { + return "[class dragonBones.AnimationData]"; + }; + AnimationData.prototype._onClear = function () { + for (var k in this.boneTimelines) { + for (var _i = 0, _a = this.boneTimelines[k]; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.returnToPool(); + } + delete this.boneTimelines[k]; + } + for (var k in this.slotTimelines) { + for (var _b = 0, _c = this.slotTimelines[k]; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.returnToPool(); + } + delete this.slotTimelines[k]; + } + for (var k in this.constraintTimelines) { + for (var _d = 0, _e = this.constraintTimelines[k]; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.returnToPool(); + } + delete this.constraintTimelines[k]; + } + for (var k in this.animationTimelines) { + for (var _f = 0, _g = this.animationTimelines[k]; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.returnToPool(); + } + delete this.animationTimelines[k]; + } + for (var k in this.boneCachedFrameIndices) { + delete this.boneCachedFrameIndices[k]; + } + for (var k in this.slotCachedFrameIndices) { + delete this.slotCachedFrameIndices[k]; + } + if (this.actionTimeline !== null) { + this.actionTimeline.returnToPool(); + } + if (this.zOrderTimeline !== null) { + this.zOrderTimeline.returnToPool(); + } + this.frameIntOffset = 0; + this.frameFloatOffset = 0; + this.frameOffset = 0; + this.blendType = 0 /* None */; + this.frameCount = 0; + this.playTimes = 0; + this.duration = 0.0; + this.scale = 1.0; + this.fadeInTime = 0.0; + this.cacheFrameRate = 0.0; + this.name = ""; + this.cachedFrames.length = 0; + // this.boneTimelines.clear(); + // this.slotTimelines.clear(); + // this.constraintTimelines.clear(); + // this.animationTimelines.clear(); + // this.boneCachedFrameIndices.clear(); + // this.slotCachedFrameIndices.clear(); + this.actionTimeline = null; + this.zOrderTimeline = null; + this.parent = null; // + }; + /** + * @internal + */ + AnimationData.prototype.cacheFrames = function (frameRate) { + if (this.cacheFrameRate > 0.0) { + return; + } + this.cacheFrameRate = Math.max(Math.ceil(frameRate * this.scale), 1.0); + var cacheFrameCount = Math.ceil(this.cacheFrameRate * this.duration) + 1; // Cache one more frame. + this.cachedFrames.length = cacheFrameCount; + for (var i = 0, l = this.cacheFrames.length; i < l; ++i) { + this.cachedFrames[i] = false; + } + for (var _i = 0, _a = this.parent.sortedBones; _i < _a.length; _i++) { + var bone = _a[_i]; + var indices = new Array(cacheFrameCount); + for (var i = 0, l = indices.length; i < l; ++i) { + indices[i] = -1; + } + this.boneCachedFrameIndices[bone.name] = indices; + } + for (var _b = 0, _c = this.parent.sortedSlots; _b < _c.length; _b++) { + var slot = _c[_b]; + var indices = new Array(cacheFrameCount); + for (var i = 0, l = indices.length; i < l; ++i) { + indices[i] = -1; + } + this.slotCachedFrameIndices[slot.name] = indices; + } + }; + /** + * @private + */ + AnimationData.prototype.addBoneTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : (this.boneTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addSlotTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : (this.slotTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addConstraintTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : (this.constraintTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addAnimationTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.animationTimelines ? this.animationTimelines[timelineName] : (this.animationTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.getBoneTimelines = function (timelineName) { + return timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getSlotTimelines = function (timelineName) { + return timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getConstraintTimelines = function (timelineName) { + return timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getAnimationTimelines = function (timelineName) { + return timelineName in this.animationTimelines ? this.animationTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getBoneCachedFrameIndices = function (boneName) { + return boneName in this.boneCachedFrameIndices ? this.boneCachedFrameIndices[boneName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getSlotCachedFrameIndices = function (slotName) { + return slotName in this.slotCachedFrameIndices ? this.slotCachedFrameIndices[slotName] : null; + }; + return AnimationData; + }(dragonBones.BaseObject)); + dragonBones.AnimationData = AnimationData; + /** + * @private + */ + var TimelineData = (function (_super) { + __extends(TimelineData, _super); + function TimelineData() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimelineData.toString = function () { + return "[class dragonBones.TimelineData]"; + }; + TimelineData.prototype._onClear = function () { + this.type = 10 /* BoneAll */; + this.offset = 0; + this.frameIndicesOffset = -1; + }; + return TimelineData; + }(dragonBones.BaseObject)); + dragonBones.TimelineData = TimelineData; + /** + * @internal + */ + var AnimationTimelineData = (function (_super) { + __extends(AnimationTimelineData, _super); + function AnimationTimelineData() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationTimelineData.toString = function () { + return "[class dragonBones.AnimationTimelineData]"; + }; + AnimationTimelineData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.x = 0.0; + this.y = 0.0; + }; + return AnimationTimelineData; + }(TimelineData)); + dragonBones.AnimationTimelineData = AnimationTimelineData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation config is used to describe all the information needed to play an animation state. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画配置用来描述播放一个动画状态所需要的全部信息。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + var AnimationConfig = (function (_super) { + __extends(AnimationConfig, _super); + function AnimationConfig() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.boneMask = []; + return _this; + } + AnimationConfig.toString = function () { + return "[class dragonBones.AnimationConfig]"; + }; + AnimationConfig.prototype._onClear = function () { + this.pauseFadeOut = true; + this.fadeOutMode = 4 /* All */; + this.fadeOutTweenType = 1 /* Line */; + this.fadeOutTime = -1.0; + this.actionEnabled = true; + this.additive = false; + this.displayControl = true; + this.pauseFadeIn = true; + this.resetToPose = true; + this.fadeInTweenType = 1 /* Line */; + this.playTimes = -1; + this.layer = 0; + this.position = 0.0; + this.duration = -1.0; + this.timeScale = -100.0; + this.weight = 1.0; + this.fadeInTime = -1.0; + this.autoFadeOutTime = -1.0; + this.name = ""; + this.animation = ""; + this.group = ""; + this.boneMask.length = 0; + }; + /** + * @private + */ + AnimationConfig.prototype.clear = function () { + this._onClear(); + }; + /** + * @private + */ + AnimationConfig.prototype.copyFrom = function (value) { + this.pauseFadeOut = value.pauseFadeOut; + this.fadeOutMode = value.fadeOutMode; + this.autoFadeOutTime = value.autoFadeOutTime; + this.fadeOutTweenType = value.fadeOutTweenType; + this.actionEnabled = value.actionEnabled; + this.additive = value.additive; + this.displayControl = value.displayControl; + this.pauseFadeIn = value.pauseFadeIn; + this.resetToPose = value.resetToPose; + this.playTimes = value.playTimes; + this.layer = value.layer; + this.position = value.position; + this.duration = value.duration; + this.timeScale = value.timeScale; + this.fadeInTime = value.fadeInTime; + this.fadeOutTime = value.fadeOutTime; + this.fadeInTweenType = value.fadeInTweenType; + this.weight = value.weight; + this.name = value.name; + this.animation = value.animation; + this.group = value.group; + this.boneMask.length = value.boneMask.length; + for (var i = 0, l = this.boneMask.length; i < l; ++i) { + this.boneMask[i] = value.boneMask[i]; + } + }; + return AnimationConfig; + }(dragonBones.BaseObject)); + dragonBones.AnimationConfig = AnimationConfig; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var TextureAtlasData = (function (_super) { + __extends(TextureAtlasData, _super); + function TextureAtlasData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.textures = {}; + return _this; + } + TextureAtlasData.prototype._onClear = function () { + for (var k in this.textures) { + this.textures[k].returnToPool(); + delete this.textures[k]; + } + this.autoSearch = false; + this.width = 0; + this.height = 0; + this.scale = 1.0; + // this.textures.clear(); + this.name = ""; + this.imagePath = ""; + }; + /** + * @private + */ + TextureAtlasData.prototype.copyFrom = function (value) { + this.autoSearch = value.autoSearch; + this.scale = value.scale; + this.width = value.width; + this.height = value.height; + this.name = value.name; + this.imagePath = value.imagePath; + for (var k in this.textures) { + this.textures[k].returnToPool(); + delete this.textures[k]; + } + // this.textures.clear(); + for (var k in value.textures) { + var texture = this.createTexture(); + texture.copyFrom(value.textures[k]); + this.textures[k] = texture; + } + }; + /** + * @internal + */ + TextureAtlasData.prototype.addTexture = function (value) { + if (value.name in this.textures) { + console.warn("Same texture: " + value.name); + return; + } + value.parent = this; + this.textures[value.name] = value; + }; + /** + * @private + */ + TextureAtlasData.prototype.getTexture = function (textureName) { + return textureName in this.textures ? this.textures[textureName] : null; + }; + return TextureAtlasData; + }(dragonBones.BaseObject)); + dragonBones.TextureAtlasData = TextureAtlasData; + /** + * @private + */ + var TextureData = (function (_super) { + __extends(TextureData, _super); + function TextureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.region = new dragonBones.Rectangle(); + _this.frame = null; // Initial value. + return _this; + } + TextureData.createRectangle = function () { + return new dragonBones.Rectangle(); + }; + TextureData.prototype._onClear = function () { + this.rotated = false; + this.name = ""; + this.region.clear(); + this.parent = null; // + this.frame = null; + }; + TextureData.prototype.copyFrom = function (value) { + this.rotated = value.rotated; + this.name = value.name; + this.region.copyFrom(value.region); + this.parent = value.parent; + if (this.frame === null && value.frame !== null) { + this.frame = TextureData.createRectangle(); + } + else if (this.frame !== null && value.frame === null) { + this.frame = null; + } + if (this.frame !== null && value.frame !== null) { + this.frame.copyFrom(value.frame); + } + }; + return TextureData; + }(dragonBones.BaseObject)); + dragonBones.TextureData = TextureData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones_1) { + /** + * - Armature is the core of the skeleton animation system. + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架是骨骼动画系统的核心。 + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + var Armature = (function (_super) { + __extends(Armature, _super); + function Armature() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._bones = []; + _this._slots = []; + /** + * @internal + */ + _this._constraints = []; + _this._actions = []; + _this._animation = null; // Initial value. + _this._proxy = null; // Initial value. + /** + * @internal + */ + _this._replaceTextureAtlasData = null; // Initial value. + _this._clock = null; // Initial value. + return _this; + } + Armature.toString = function () { + return "[class dragonBones.Armature]"; + }; + Armature._onSortSlots = function (a, b) { + return a._zIndex * 1000 + a._zOrder > b._zIndex * 1000 + b._zOrder ? 1 : -1; + }; + Armature.prototype._onClear = function () { + if (this._clock !== null) { + this._clock.remove(this); + } + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + bone.returnToPool(); + } + for (var _b = 0, _c = this._slots; _b < _c.length; _b++) { + var slot = _c[_b]; + slot.returnToPool(); + } + for (var _d = 0, _e = this._constraints; _d < _e.length; _d++) { + var constraint = _e[_d]; + constraint.returnToPool(); + } + for (var _f = 0, _g = this._actions; _f < _g.length; _f++) { + var action = _g[_f]; + action.returnToPool(); + } + if (this._animation !== null) { + this._animation.returnToPool(); + } + if (this._proxy !== null) { + this._proxy.dbClear(); + } + if (this._replaceTextureAtlasData !== null) { + this._replaceTextureAtlasData.returnToPool(); + } + this.inheritAnimation = true; + this.userData = null; + this._lockUpdate = false; + this._slotsDirty = true; + this._zOrderDirty = false; + this._zIndexDirty = false; + this._alphaDirty = true; + this._flipX = false; + this._flipY = false; + this._cacheFrameIndex = -1; + this._alpha = 1.0; + this._globalAlpha = 1.0; + this._bones.length = 0; + this._slots.length = 0; + this._constraints.length = 0; + this._actions.length = 0; + this._armatureData = null; // + this._animation = null; // + this._proxy = null; // + this._display = null; + this._replaceTextureAtlasData = null; + this._replacedTexture = null; + this._dragonBones = null; // + this._clock = null; + this._parent = null; + }; + /** + * @internal + */ + Armature.prototype._sortZOrder = function (slotIndices, offset) { + var slotDatas = this._armatureData.sortedSlots; + var isOriginal = slotIndices === null; + if (this._zOrderDirty || !isOriginal) { + for (var i = 0, l = slotDatas.length; i < l; ++i) { + var slotIndex = isOriginal ? i : slotIndices[offset + i]; + if (slotIndex < 0 || slotIndex >= l) { + continue; + } + var slotData = slotDatas[slotIndex]; + var slot = this.getSlot(slotData.name); + if (slot !== null) { + slot._setZOrder(i); + } + } + this._slotsDirty = true; + this._zOrderDirty = !isOriginal; + } + }; + /** + * @internal + */ + Armature.prototype._addBone = function (value) { + if (this._bones.indexOf(value) < 0) { + this._bones.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._addSlot = function (value) { + if (this._slots.indexOf(value) < 0) { + this._slots.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._addConstraint = function (value) { + if (this._constraints.indexOf(value) < 0) { + this._constraints.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._bufferAction = function (action, append) { + if (this._actions.indexOf(action) < 0) { + if (append) { + this._actions.push(action); + } + else { + this._actions.unshift(action); + } + } + }; + /** + * - Dispose the armature. (Return to the object pool) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 释放骨架。 (回收到对象池) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.dispose = function () { + if (this._armatureData !== null) { + this._lockUpdate = true; + this._dragonBones.bufferObject(this); + } + }; + /** + * @internal + */ + Armature.prototype.init = function (armatureData, proxy, display, dragonBones) { + if (this._armatureData !== null) { + return; + } + this._armatureData = armatureData; + this._animation = dragonBones_1.BaseObject.borrowObject(dragonBones_1.Animation); + this._proxy = proxy; + this._display = display; + this._dragonBones = dragonBones; + this._proxy.dbInit(this); + this._animation.init(this); + this._animation.animations = this._armatureData.animations; + }; + /** + * @inheritDoc + */ + Armature.prototype.advanceTime = function (passedTime) { + if (this._lockUpdate) { + return; + } + this._lockUpdate = true; + if (this._armatureData === null) { + console.warn("The armature has been disposed."); + return; + } + else if (this._armatureData.parent === null) { + console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear()."); + return; + } + var prevCacheFrameIndex = this._cacheFrameIndex; + // Update animation. + this._animation.advanceTime(passedTime); + // Sort slots. + if (this._slotsDirty || this._zIndexDirty) { + this._slots.sort(Armature._onSortSlots); + if (this._zIndexDirty) { + for (var i = 0, l = this._slots.length; i < l; ++i) { + this._slots[i]._setZOrder(i); // + } + } + this._slotsDirty = false; + this._zIndexDirty = false; + } + // Update alpha. + if (this._alphaDirty) { + this._alphaDirty = false; + this._globalAlpha = this._alpha * (this._parent !== null ? this._parent._globalAlpha : 1.0); + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + bone._updateAlpha(); + } + for (var _b = 0, _c = this._slots; _b < _c.length; _b++) { + var slot = _c[_b]; + slot._updateAlpha(); + } + } + // Update bones and slots. + if (this._cacheFrameIndex < 0 || this._cacheFrameIndex !== prevCacheFrameIndex) { + var i = 0, l = 0; + for (i = 0, l = this._bones.length; i < l; ++i) { + this._bones[i].update(this._cacheFrameIndex); + } + for (i = 0, l = this._slots.length; i < l; ++i) { + this._slots[i].update(this._cacheFrameIndex); + } + } + // Do actions. + if (this._actions.length > 0) { + for (var _d = 0, _e = this._actions; _d < _e.length; _d++) { + var action = _e[_d]; + var actionData = action.actionData; + if (actionData !== null) { + if (actionData.type === 0 /* Play */) { + if (action.slot !== null) { + var childArmature = action.slot.childArmature; + if (childArmature !== null) { + childArmature.animation.fadeIn(actionData.name); + } + } + else if (action.bone !== null) { + for (var _f = 0, _g = this.getSlots(); _f < _g.length; _f++) { + var slot = _g[_f]; + if (slot.parent === action.bone) { + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.animation.fadeIn(actionData.name); + } + } + } + } + else { + this._animation.fadeIn(actionData.name); + } + } + } + action.returnToPool(); + } + this._actions.length = 0; + } + this._lockUpdate = false; + this._proxy.dbUpdate(); + }; + /** + * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. + * @param boneName - The bone name. (If not set, all bones will be update) + * @param updateSlot - Whether to update the bone's slots. (Default: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 + * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) + * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.invalidUpdate = function (boneName, updateSlot) { + if (boneName === void 0) { boneName = null; } + if (updateSlot === void 0) { updateSlot = false; } + if (boneName !== null && boneName.length > 0) { + var bone = this.getBone(boneName); + if (bone !== null) { + bone.invalidUpdate(); + if (updateSlot) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.parent === bone) { + slot.invalidUpdate(); + } + } + } + } + } + else { + for (var _b = 0, _c = this._bones; _b < _c.length; _b++) { + var bone = _c[_b]; + bone.invalidUpdate(); + } + if (updateSlot) { + for (var _d = 0, _e = this._slots; _d < _e.length; _d++) { + var slot = _e[_d]; + slot.invalidUpdate(); + } + } + } + }; + /** + * - Check whether a specific point is inside a custom bounding box in a slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在某个插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Armature.prototype.containsPoint = function (x, y) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.containsPoint(x, y)) { + return slot; + } + } + return null; + }; + /** + * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Armature.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var isV = xA === xB; + var dMin = 0.0; + var dMax = 0.0; + var intXA = 0.0; + var intYA = 0.0; + var intXB = 0.0; + var intYB = 0.0; + var intAN = 0.0; + var intBN = 0.0; + var intSlotA = null; + var intSlotB = null; + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var intersectionCount = slot.intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); + if (intersectionCount > 0) { + if (intersectionPointA !== null || intersectionPointB !== null) { + if (intersectionPointA !== null) { + var d = isV ? intersectionPointA.y - yA : intersectionPointA.x - xA; + if (d < 0.0) { + d = -d; + } + if (intSlotA === null || d < dMin) { + dMin = d; + intXA = intersectionPointA.x; + intYA = intersectionPointA.y; + intSlotA = slot; + if (normalRadians) { + intAN = normalRadians.x; + } + } + } + if (intersectionPointB !== null) { + var d = intersectionPointB.x - xA; + if (d < 0.0) { + d = -d; + } + if (intSlotB === null || d > dMax) { + dMax = d; + intXB = intersectionPointB.x; + intYB = intersectionPointB.y; + intSlotB = slot; + if (normalRadians !== null) { + intBN = normalRadians.y; + } + } + } + } + else { + intSlotA = slot; + break; + } + } + } + if (intSlotA !== null && intersectionPointA !== null) { + intersectionPointA.x = intXA; + intersectionPointA.y = intYA; + if (normalRadians !== null) { + normalRadians.x = intAN; + } + } + if (intSlotB !== null && intersectionPointB !== null) { + intersectionPointB.x = intXB; + intersectionPointB.y = intYB; + if (normalRadians !== null) { + normalRadians.y = intBN; + } + } + return intSlotA; + }; + /** + * - Get a specific bone. + * @param name - The bone name. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼。 + * @param name - 骨骼名称。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBone = function (name) { + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + if (bone.name === name) { + return bone; + } + } + return null; + }; + /** + * - Get a specific bone by the display. + * @param display - The display object. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的骨骼。 + * @param display - 显示对象。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBoneByDisplay = function (display) { + var slot = this.getSlotByDisplay(display); + return slot !== null ? slot.parent : null; + }; + /** + * - Get a specific slot. + * @param name - The slot name. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽。 + * @param name - 插槽名称。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlot = function (name) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.name === name) { + return slot; + } + } + return null; + }; + /** + * - Get a specific slot by the display. + * @param display - The display object. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的插槽。 + * @param display - 显示对象。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlotByDisplay = function (display) { + if (display !== null) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.display === display) { + return slot; + } + } + } + return null; + }; + /** + * - Get all bones. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBones = function () { + return this._bones; + }; + /** + * - Get all slots. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的插槽。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlots = function () { + return this._slots; + }; + Object.defineProperty(Armature.prototype, "flipX", { + /** + * - Whether to flip the armature horizontally. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架水平翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + get: function () { + return this._flipX; + }, + set: function (value) { + if (this._flipX === value) { + return; + } + this._flipX = value; + this.invalidUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "flipY", { + /** + * - Whether to flip the armature vertically. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架垂直翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + get: function () { + return this._flipY; + }, + set: function (value) { + if (this._flipY === value) { + return; + } + this._flipY = value; + this.invalidUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "cacheFrameRate", { + /** + * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. + * There is a certain amount of memory overhead to improve performance by caching animation data in memory. + * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. + * When the animation cache is turned on, some features will fail, such as the offset property of bone. + * @example + *
+             *     armature.cacheFrameRate = 24;
+             * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 + * @example + *
+             *     armature.cacheFrameRate = 24;
+             * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._armatureData.cacheFrameRate; + }, + set: function (value) { + if (this._armatureData.cacheFrameRate !== value) { + this._armatureData.cacheFrames(value); + // Set child armature frameRate. + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.cacheFrameRate = value; + } + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "name", { + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._armatureData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "armatureData", { + /** + * - The armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._armatureData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "animation", { + /** + * - The animation player. + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._animation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "proxy", { + /** + * @pivate + */ + get: function () { + return this._proxy; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "eventDispatcher", { + /** + * - The EventDispatcher instance of the armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架的 EventDispatcher 实例。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._proxy; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "display", { + /** + * - The display container. + * The display of the slot is displayed as the parent. + * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 显示容器实例。 + * 插槽的显示对象都会以此显示容器为父级。 + * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._display; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "replacedTexture", { + /** + * @private + */ + get: function () { + return this._replacedTexture; + }, + set: function (value) { + if (this._replacedTexture === value) { + return; + } + if (this._replaceTextureAtlasData !== null) { + this._replaceTextureAtlasData.returnToPool(); + this._replaceTextureAtlasData = null; + } + this._replacedTexture = value; + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + slot.invalidUpdate(); + slot.update(-1); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "clock", { + /** + * @inheritDoc + */ + get: function () { + return this._clock; + }, + set: function (value) { + if (this._clock === value) { + return; + } + if (this._clock !== null) { + this._clock.remove(this); + } + this._clock = value; + if (this._clock) { + this._clock.add(this); + } + // Update childArmature clock. + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.clock = this._clock; + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "parent", { + /** + * - Get the parent slot which the armature belongs to. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架所属的父插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Armature.prototype.getDisplay = function () { + return this._display; + }; + return Armature; + }(dragonBones_1.BaseObject)); + dragonBones_1.Armature = Armature; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The base class of the transform object. + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 变换对象的基类。 + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language zh_CN + */ + var TransformObject = (function (_super) { + __extends(TransformObject, _super); + function TransformObject() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - A matrix relative to the armature coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.globalTransformMatrix = new dragonBones.Matrix(); + /** + * - A transform relative to the armature coordinate system. + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的变换。 + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.global = new dragonBones.Transform(); + /** + * - The offset transform relative to the armature or the parent bone coordinate system. + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架或父骨骼坐标系的偏移变换。 + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.offset = new dragonBones.Transform(); + return _this; + } + /** + */ + TransformObject.prototype._onClear = function () { + this.globalTransformMatrix.identity(); + this.global.identity(); + this.offset.identity(); + this.origin = null; + this.userData = null; + this._globalDirty = false; + this._alpha = 1.0; + this._globalAlpha = 1.0; + this._armature = null; // + }; + /** + * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, + * some engines do not rely on these attributes to update rendering, such as Egret. + * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 + * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + TransformObject.prototype.updateGlobalTransform = function () { + if (this._globalDirty) { + this._globalDirty = false; + this.global.fromMatrix(this.globalTransformMatrix); + } + }; + Object.defineProperty(TransformObject.prototype, "armature", { + /** + * - The armature to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的骨架。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._armature; + }, + enumerable: true, + configurable: true + }); + TransformObject._helpMatrix = new dragonBones.Matrix(); + TransformObject._helpTransform = new dragonBones.Transform(); + TransformObject._helpPoint = new dragonBones.Point(); + return TransformObject; + }(dragonBones.BaseObject)); + dragonBones.TransformObject = TransformObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Bone is one of the most important logical units in the armature animation system, + * and is responsible for the realization of translate, rotation, scaling in the animations. + * A armature can contain multiple bones. + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 + * 一个骨架中可以包含多个骨骼。 + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + var Bone = (function (_super) { + __extends(Bone, _super); + function Bone() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @internal + */ + _this.animationPose = new dragonBones.Transform(); + return _this; + } + Bone.toString = function () { + return "[class dragonBones.Bone]"; + }; + Bone.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.offsetMode = 1 /* Additive */; + this.animationPose.identity(); + this._transformDirty = false; + this._childrenTransformDirty = false; + this._localDirty = true; + this._hasConstraint = false; + this._visible = true; + this._cachedFrameIndex = -1; + this._boneData = null; // + this._parent = null; // + this._cachedFrameIndices = null; + }; + Bone.prototype._updateGlobalTransformMatrix = function (isCache) { + // For typescript. + var boneData = this._boneData; + var global = this.global; + var globalTransformMatrix = this.globalTransformMatrix; + var origin = this.origin; + var offset = this.offset; + var animationPose = this.animationPose; + var parent = this._parent; // + var flipX = this._armature.flipX; + var flipY = this._armature.flipY === dragonBones.DragonBones.yDown; + var inherit = parent !== null; + var rotation = 0.0; + if (this.offsetMode === 1 /* Additive */) { + if (origin !== null) { + // global.copyFrom(this.origin).add(this.offset).add(this.animationPose); + global.x = origin.x + offset.x + animationPose.x; + global.scaleX = origin.scaleX * offset.scaleX * animationPose.scaleX; + global.scaleY = origin.scaleY * offset.scaleY * animationPose.scaleY; + if (dragonBones.DragonBones.yDown) { + global.y = origin.y + offset.y + animationPose.y; + global.skew = origin.skew + offset.skew + animationPose.skew; + global.rotation = origin.rotation + offset.rotation + animationPose.rotation; + } + else { + global.y = origin.y - offset.y + animationPose.y; + global.skew = origin.skew - offset.skew + animationPose.skew; + global.rotation = origin.rotation - offset.rotation + animationPose.rotation; + } + } + else { + global.copyFrom(offset); + if (!dragonBones.DragonBones.yDown) { + global.y = -global.y; + global.skew = -global.skew; + global.rotation = -global.rotation; + } + global.add(animationPose); + } + } + else if (this.offsetMode === 0 /* None */) { + if (origin !== null) { + global.copyFrom(origin).add(animationPose); + } + else { + global.copyFrom(animationPose); + } + } + else { + inherit = false; + global.copyFrom(offset); + if (!dragonBones.DragonBones.yDown) { + global.y = -global.y; + global.skew = -global.skew; + global.rotation = -global.rotation; + } + } + if (inherit) { + var isSurface = parent._boneData.type === 1 /* Surface */; + var surfaceBone = isSurface ? parent._bone : null; + var parentMatrix = isSurface ? parent._getGlobalTransformMatrix(global.x, global.y) : parent.globalTransformMatrix; + if (boneData.inheritScale && (!isSurface || surfaceBone !== null)) { + if (isSurface) { + if (boneData.inheritRotation) { + global.rotation += parent.global.rotation; + } + surfaceBone.updateGlobalTransform(); + global.scaleX *= surfaceBone.global.scaleX; + global.scaleY *= surfaceBone.global.scaleY; + parentMatrix.transformPoint(global.x, global.y, global); + global.toMatrix(globalTransformMatrix); + if (boneData.inheritTranslation) { + global.x = globalTransformMatrix.tx; + global.y = globalTransformMatrix.ty; + } + else { + globalTransformMatrix.tx = global.x; + globalTransformMatrix.ty = global.y; + } + } + else { + if (!boneData.inheritRotation) { + parent.updateGlobalTransform(); + if (flipX && flipY) { + rotation = global.rotation - (parent.global.rotation + Math.PI); + } + else if (flipX) { + rotation = global.rotation + parent.global.rotation + Math.PI; + } + else if (flipY) { + rotation = global.rotation + parent.global.rotation; + } + else { + rotation = global.rotation - parent.global.rotation; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + globalTransformMatrix.concat(parentMatrix); + if (boneData.inheritTranslation) { + global.x = globalTransformMatrix.tx; + global.y = globalTransformMatrix.ty; + } + else { + globalTransformMatrix.tx = global.x; + globalTransformMatrix.ty = global.y; + } + if (isCache) { + global.fromMatrix(globalTransformMatrix); + } + else { + this._globalDirty = true; + } + } + } + else { + if (boneData.inheritTranslation) { + var x = global.x; + var y = global.y; + global.x = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + global.y = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + } + else { + if (flipX) { + global.x = -global.x; + } + if (flipY) { + global.y = -global.y; + } + } + if (boneData.inheritRotation) { + parent.updateGlobalTransform(); + if (parent.global.scaleX < 0.0) { + rotation = global.rotation + parent.global.rotation + Math.PI; + } + else { + rotation = global.rotation + parent.global.rotation; + } + if (parentMatrix.a * parentMatrix.d - parentMatrix.b * parentMatrix.c < 0.0) { + rotation -= global.rotation * 2.0; + if (flipX !== flipY || boneData.inheritReflection) { + global.skew += Math.PI; + } + if (!dragonBones.DragonBones.yDown) { + global.skew = -global.skew; + } + } + global.rotation = rotation; + } + else if (flipX || flipY) { + if (flipX && flipY) { + rotation = global.rotation + Math.PI; + } + else { + if (flipX) { + rotation = Math.PI - global.rotation; + } + else { + rotation = -global.rotation; + } + global.skew += Math.PI; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + } + } + else { + if (flipX || flipY) { + if (flipX) { + global.x = -global.x; + } + if (flipY) { + global.y = -global.y; + } + if (flipX && flipY) { + rotation = global.rotation + Math.PI; + } + else { + if (flipX) { + rotation = Math.PI - global.rotation; + } + else { + rotation = -global.rotation; + } + global.skew += Math.PI; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + } + }; + /** + * @internal + */ + Bone.prototype._updateAlpha = function () { + if (this._parent !== null) { + this._globalAlpha = this._alpha * this._parent._globalAlpha; + } + else { + this._globalAlpha = this._alpha * this._armature._globalAlpha; + } + }; + /** + * @internal + */ + Bone.prototype.init = function (boneData, armatureValue) { + if (this._boneData !== null) { + return; + } + this._boneData = boneData; + this._armature = armatureValue; + this._alpha = this._boneData.alpha; + if (this._boneData.parent !== null) { + this._parent = this._armature.getBone(this._boneData.parent.name); + } + this._armature._addBone(this); + // + this.origin = this._boneData.transform; + }; + /** + * @internal + */ + Bone.prototype.update = function (cacheFrameIndex) { + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else { + if (this._hasConstraint) { + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || + (this._parent !== null && this._parent._childrenTransformDirty)) { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + } + else { + if (this._hasConstraint) { + for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) { + var constraint = _c[_b]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + if (this._transformDirty) { + this._transformDirty = false; + this._childrenTransformDirty = true; + // + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + if (this._localDirty) { + this._updateGlobalTransformMatrix(isCache); + } + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + // + } + else if (this._childrenTransformDirty) { + this._childrenTransformDirty = false; + } + this._localDirty = true; + }; + /** + * @internal + */ + Bone.prototype.updateByConstraint = function () { + if (this._localDirty) { + this._localDirty = false; + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { + this._updateGlobalTransformMatrix(true); + } + this._transformDirty = true; + } + }; + /** + * - Forces the bone to update the transform in the next frame. + * When the bone is not animated or its animation state is finished, the bone will not continue to update, + * and when the skeleton must be updated for some reason, the method needs to be called explicitly. + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制骨骼在下一帧更新变换。 + * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Bone.prototype.invalidUpdate = function () { + this._transformDirty = true; + }; + /** + * - Check whether the bone contains a specific bone. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查该骨骼是否包含特定的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Bone.prototype.contains = function (value) { + if (value === this) { + return false; + } + var ancestor = value; + while (ancestor !== this && ancestor !== null) { + ancestor = ancestor.parent; + } + return ancestor === this; + }; + Object.defineProperty(Bone.prototype, "boneData", { + /** + * - The bone data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._boneData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "visible", { + /** + * - The visible of all slots in the bone. + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 此骨骼所有插槽的可见。 + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._visible; + }, + set: function (value) { + if (this._visible === value) { + return; + } + this._visible = value; + for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.parent === this) { + slot._updateVisible(); + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "name", { + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._boneData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "parent", { + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return Bone; + }(dragonBones.TransformObject)); + dragonBones.Bone = Bone; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var Surface = (function (_super) { + __extends(Surface, _super); + function Surface() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._vertices = []; + _this._deformVertices = []; + /** + * - x1, y1, x2, y2, x3, y3, x4, y4, d1X, d1Y, d2X, d2Y + */ + _this._hullCache = []; + /** + * - Inside [flag, a, b, c, d, tx, ty], Outside [flag, a, b, c, d, tx, ty] + */ + _this._matrixCahce = []; + return _this; + } + Surface.toString = function () { + return "[class dragonBones.Surface]"; + }; + Surface.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._dX = 0.0; + this._dY = 0.0; + this._k = 0.0; + this._kX = 0.0; + this._kY = 0.0; + this._vertices.length = 0; + this._deformVertices.length = 0; + this._matrixCahce.length = 0; + this._hullCache.length = 0; + this._bone = null; + }; + Surface.prototype._getAffineTransform = function (x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown) { + var dabX = bX - aX; + var dabY = bY - aY; + var dacX = cX - aX; + var dacY = cY - aY; + transform.rotation = Math.atan2(dabY, dabX); + transform.skew = Math.atan2(dacY, dacX) - Math.PI * 0.5 - transform.rotation; + if (isDown) { + transform.rotation += Math.PI; + } + transform.scaleX = Math.sqrt(dabX * dabX + dabY * dabY) / lX; + transform.scaleY = Math.sqrt(dacX * dacX + dacY * dacY) / lY; + transform.toMatrix(matrix); + transform.x = matrix.tx = aX - (matrix.a * x + matrix.c * y); + transform.y = matrix.ty = aY - (matrix.b * x + matrix.d * y); + }; + Surface.prototype._updateVertices = function () { + var data = this._armature.armatureData.parent; + var geometry = this._boneData.geometry; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometry.offset + 0 /* GeometryVertexCount */]; + var verticesOffset = intArray[geometry.offset + 2 /* GeometryFloatOffset */]; + var vertices = this._vertices; + var animationVertices = this._deformVertices; + if (this._parent !== null) { + if (this._parent._boneData.type === 1 /* Surface */) { + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + var x = floatArray[verticesOffset + iD] + animationVertices[iD]; + var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + var matrix = this._parent._getGlobalTransformMatrix(x, y); + // + vertices[iD] = matrix.a * x + matrix.c * y + matrix.tx; + vertices[iD + 1] = matrix.b * x + matrix.d * y + matrix.ty; + } + } + else { + var parentMatrix = this._parent.globalTransformMatrix; + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + var x = floatArray[verticesOffset + iD] + animationVertices[iD]; + var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + // + vertices[iD] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + vertices[iD + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + } + } + } + else { + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + vertices[iD] = floatArray[verticesOffset + iD] + animationVertices[iD]; + vertices[iD + 1] = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + } + } + }; + Surface.prototype._updateGlobalTransformMatrix = function (isCache) { + // tslint:disable-next-line:no-unused-expression + isCache; + var segmentXD = this._boneData.segmentX * 2; + var lastIndex = this._vertices.length - 2; + var lA = 200.0; + // + var raX = this._vertices[0]; + var raY = this._vertices[1]; + var rbX = this._vertices[segmentXD]; + var rbY = this._vertices[segmentXD + 1]; + var rcX = this._vertices[lastIndex]; + var rcY = this._vertices[lastIndex + 1]; + var rdX = this._vertices[lastIndex - segmentXD]; + var rdY = this._vertices[lastIndex - segmentXD + 1]; + // + var dacX = raX + (rcX - raX) * 0.5; + var dacY = raY + (rcY - raY) * 0.5; + var dbdX = rbX + (rdX - rbX) * 0.5; + var dbdY = rbY + (rdY - rbY) * 0.5; + var aX = dacX + (dbdX - dacX) * 0.5; + var aY = dacY + (dbdY - dacY) * 0.5; + var bX = rbX + (rcX - rbX) * 0.5; + var bY = rbY + (rcY - rbY) * 0.5; + var cX = rdX + (rcX - rdX) * 0.5; + var cY = rdY + (rcY - rdY) * 0.5; + // TODO interpolation + this._getAffineTransform(0.0, 0.0, lA, lA, aX, aY, bX, bY, cX, cY, this.global, this.globalTransformMatrix, false); + this._globalDirty = false; + }; + Surface.prototype._getGlobalTransformMatrix = function (x, y) { + var lA = 200.0; + var lB = 1000.0; + if (x < -lB || lB < x || y < -lB || lB < y) { + return this.globalTransformMatrix; + } + var isDown = false; + var surfaceData = this._boneData; + var segmentX = surfaceData.segmentX; + var segmentY = surfaceData.segmentY; + var segmentXD = surfaceData.segmentX * 2; + var dX = this._dX; + var dY = this._dY; + var indexX = Math.floor((x + lA) / dX); // -1 ~ segmentX - 1 + var indexY = Math.floor((y + lA) / dY); // -1 ~ segmentY - 1 + var matrixIndex = 0; + var pX = indexX * dX - lA; + var pY = indexY * dY - lA; + // + var matrices = this._matrixCahce; + var helpMatrix = Surface._helpMatrix; + if (x < -lA) { + if (y < -lA || y >= lA) { + return this.globalTransformMatrix; + } + // Left. + isDown = y > this._kX * (x + lA) + pY; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexY * (segmentXD + 2); + var ddX = this._hullCache[4]; + var ddY = this._hullCache[5]; + var sX = this._hullCache[2] - (segmentY - indexY) * ddX; + var sY = this._hullCache[3] - (segmentY - indexY) * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(-lA, pY + dY, lB - lA, dY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], sX + ddX, sY + ddY, vertices[vertexIndex], vertices[vertexIndex + 1], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(-lB, pY, lB - lA, dY, sX, sY, vertices[vertexIndex], vertices[vertexIndex + 1], sX + ddX, sY + ddY, Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (x >= lA) { + if (y < -lA || y >= lA) { + return this.globalTransformMatrix; + } + // Right. + isDown = y > this._kX * (x - lB) + pY; + matrixIndex = ((segmentX * segmentY + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = (indexY + 1) * (segmentXD + 2) - 2; + var ddX = this._hullCache[4]; + var ddY = this._hullCache[5]; + var sX = this._hullCache[0] + indexY * ddX; + var sY = this._hullCache[1] + indexY * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(lB, pY + dY, lB - lA, dY, sX + ddX, sY + ddY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], sX, sY, Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(lA, pY, lB - lA, dY, vertices[vertexIndex], vertices[vertexIndex + 1], sX, sY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (y < -lA) { + if (x < -lA || x >= lA) { + return this.globalTransformMatrix; + } + // Up. + isDown = y > this._kY * (x - pX - dX) - lB; + matrixIndex = ((segmentX * segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexX * 2; + var ddX = this._hullCache[10]; + var ddY = this._hullCache[11]; + var sX = this._hullCache[8] + indexX * ddX; + var sY = this._hullCache[9] + indexX * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, -lA, dX, lB - lA, vertices[vertexIndex + 2], vertices[vertexIndex + 3], vertices[vertexIndex], vertices[vertexIndex + 1], sX + ddX, sY + ddY, Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, -lB, dX, lB - lA, sX, sY, sX + ddX, sY + ddY, vertices[vertexIndex], vertices[vertexIndex + 1], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (y >= lA) { + if (x < -lA || x >= lA) { + return this.globalTransformMatrix; + } + // Down + isDown = y > this._kY * (x - pX - dX) + lA; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = segmentY * (segmentXD + 2) + indexX * 2; + var ddX = this._hullCache[10]; + var ddY = this._hullCache[11]; + var sX = this._hullCache[6] - (segmentX - indexX) * ddX; + var sY = this._hullCache[7] - (segmentX - indexX) * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, lB, dX, lB - lA, sX + ddX, sY + ddY, sX, sY, vertices[vertexIndex + 2], vertices[vertexIndex + 3], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, lA, dX, lB - lA, vertices[vertexIndex], vertices[vertexIndex + 1], vertices[vertexIndex + 2], vertices[vertexIndex + 3], sX, sY, Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else { + isDown = y > this._k * (x - pX - dX) + pY; + matrixIndex = ((segmentX * indexY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexX * 2 + indexY * (segmentXD + 2); + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, pY + dY, dX, dY, vertices[vertexIndex + segmentXD + 4], vertices[vertexIndex + segmentXD + 5], vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], vertices[vertexIndex + 2], vertices[vertexIndex + 3], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, pY, dX, dY, vertices[vertexIndex], vertices[vertexIndex + 1], vertices[vertexIndex + 2], vertices[vertexIndex + 3], vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + return helpMatrix; + }; + /** + * @internal + * @private + */ + Surface.prototype.init = function (surfaceData, armatureValue) { + if (this._boneData !== null) { + return; + } + _super.prototype.init.call(this, surfaceData, armatureValue); + var segmentX = surfaceData.segmentX; + var segmentY = surfaceData.segmentY; + var vertexCount = this._armature.armatureData.parent.intArray[surfaceData.geometry.offset + 0 /* GeometryVertexCount */]; + var lB = 1000.0; + var lA = 200.0; + // + this._dX = lA * 2.0 / segmentX; + this._dY = lA * 2.0 / segmentY; + this._k = -this._dY / this._dX; + this._kX = -this._dY / (lB - lA); + this._kY = -(lB - lA) / this._dX; + this._vertices.length = vertexCount * 2; + this._deformVertices.length = vertexCount * 2; + this._matrixCahce.length = (segmentX * segmentY + segmentX * 2 + segmentY * 2) * 2 * 7; + this._hullCache.length = 10; + for (var i = 0; i < vertexCount * 2; ++i) { + this._deformVertices[i] = 0.0; + } + if (this._parent !== null) { + if (this._parent.boneData.type === 0 /* Bone */) { + this._bone = this._parent; + } + else { + this._bone = this._parent._bone; + } + } + }; + /** + * @internal + */ + Surface.prototype.update = function (cacheFrameIndex) { + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else { + if (this._hasConstraint) { + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || + (this._parent !== null && this._parent._childrenTransformDirty)) { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + } + else { + if (this._hasConstraint) { + for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) { + var constraint = _c[_b]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + if (this._transformDirty) { + this._transformDirty = false; + this._childrenTransformDirty = true; + // + for (var i = 0, l = this._matrixCahce.length; i < l; i += 7) { + this._matrixCahce[i] = -1.0; + } + // + this._updateVertices(); + // + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + if (this._localDirty) { + this._updateGlobalTransformMatrix(isCache); + } + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + // Update hull vertices. + var lB = 1000.0; + var lA = 200.0; + var ddX = 2 * this.global.x; + var ddY = 2 * this.global.y; + // + var helpPoint = Surface._helpPoint; + this.globalTransformMatrix.transformPoint(lB, -lA, helpPoint); + this._hullCache[0] = helpPoint.x; + this._hullCache[1] = helpPoint.y; + this._hullCache[2] = ddX - helpPoint.x; + this._hullCache[3] = ddY - helpPoint.y; + this.globalTransformMatrix.transformPoint(0.0, this._dY, helpPoint, true); + this._hullCache[4] = helpPoint.x; + this._hullCache[5] = helpPoint.y; + // + this.globalTransformMatrix.transformPoint(lA, lB, helpPoint); + this._hullCache[6] = helpPoint.x; + this._hullCache[7] = helpPoint.y; + this._hullCache[8] = ddX - helpPoint.x; + this._hullCache[9] = ddY - helpPoint.y; + this.globalTransformMatrix.transformPoint(this._dX, 0.0, helpPoint, true); + this._hullCache[10] = helpPoint.x; + this._hullCache[11] = helpPoint.y; + } + else if (this._childrenTransformDirty) { + this._childrenTransformDirty = false; + } + this._localDirty = true; + }; + return Surface; + }(dragonBones.Bone)); + dragonBones.Surface = Surface; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DisplayFrame = (function (_super) { + __extends(DisplayFrame, _super); + function DisplayFrame() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.deformVertices = []; + return _this; + } + DisplayFrame.toString = function () { + return "[class dragonBones.DisplayFrame]"; + }; + DisplayFrame.prototype._onClear = function () { + this.rawDisplayData = null; + this.displayData = null; + this.textureData = null; + this.display = null; + this.deformVertices.length = 0; + }; + DisplayFrame.prototype.updateDeformVertices = function () { + if (this.rawDisplayData === null || this.deformVertices.length !== 0) { + return; + } + var rawGeometryData; + if (this.rawDisplayData.type === 2 /* Mesh */) { + rawGeometryData = this.rawDisplayData.geometry; + } + else if (this.rawDisplayData.type === 4 /* Path */) { + rawGeometryData = this.rawDisplayData.geometry; + } + else { + return; + } + var vertexCount = 0; + if (rawGeometryData.weight !== null) { + vertexCount = rawGeometryData.weight.count * 2; + } + else { + vertexCount = rawGeometryData.data.intArray[rawGeometryData.offset + 0 /* GeometryVertexCount */] * 2; + } + this.deformVertices.length = vertexCount; + for (var i = 0, l = this.deformVertices.length; i < l; ++i) { + this.deformVertices[i] = 0.0; + } + }; + DisplayFrame.prototype.getGeometryData = function () { + if (this.displayData !== null) { + if (this.displayData.type === 2 /* Mesh */) { + return this.displayData.geometry; + } + if (this.displayData.type === 4 /* Path */) { + return this.displayData.geometry; + } + } + if (this.rawDisplayData !== null) { + if (this.rawDisplayData.type === 2 /* Mesh */) { + return this.rawDisplayData.geometry; + } + if (this.rawDisplayData.type === 4 /* Path */) { + return this.rawDisplayData.geometry; + } + } + return null; + }; + DisplayFrame.prototype.getBoundingBox = function () { + if (this.displayData !== null && this.displayData.type === 3 /* BoundingBox */) { + return this.displayData.boundingBox; + } + if (this.rawDisplayData !== null && this.rawDisplayData.type === 3 /* BoundingBox */) { + return this.rawDisplayData.boundingBox; + } + return null; + }; + DisplayFrame.prototype.getTextureData = function () { + if (this.displayData !== null) { + if (this.displayData.type === 0 /* Image */) { + return this.displayData.texture; + } + if (this.displayData.type === 2 /* Mesh */) { + return this.displayData.texture; + } + } + if (this.textureData !== null) { + return this.textureData; + } + if (this.rawDisplayData !== null) { + if (this.rawDisplayData.type === 0 /* Image */) { + return this.rawDisplayData.texture; + } + if (this.rawDisplayData.type === 2 /* Mesh */) { + return this.rawDisplayData.texture; + } + } + return null; + }; + return DisplayFrame; + }(dragonBones.BaseObject)); + dragonBones.DisplayFrame = DisplayFrame; + /** + * - The slot attached to the armature, controls the display status and properties of the display object. + * A bone can contain multiple slots. + * A slot can contain multiple display objects, displaying only one of the display objects at a time, + * but you can toggle the display object into frame animation while the animation is playing. + * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, + * and a custom other display object. + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language zh_CN + */ + var Slot = (function (_super) { + __extends(Slot, _super); + function Slot() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._localMatrix = new dragonBones.Matrix(); + /** + * @internal + */ + _this._colorTransform = new dragonBones.ColorTransform(); + /** + * @internal + */ + _this._displayFrames = []; + /** + * @internal + */ + _this._geometryBones = []; + _this._rawDisplay = null; // Initial value. + _this._meshDisplay = null; // Initial value. + _this._display = null; + return _this; + } + Slot.prototype._onClear = function () { + _super.prototype._onClear.call(this); + var disposeDisplayList = []; + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var dispayFrame = _a[_i]; + var display = dispayFrame.display; + if (display !== this._rawDisplay && display !== this._meshDisplay && + disposeDisplayList.indexOf(display) < 0) { + disposeDisplayList.push(display); + } + dispayFrame.returnToPool(); + } + for (var _b = 0, disposeDisplayList_1 = disposeDisplayList; _b < disposeDisplayList_1.length; _b++) { + var eachDisplay = disposeDisplayList_1[_b]; + if (eachDisplay instanceof dragonBones.Armature) { + eachDisplay.dispose(); + } + else { + this._disposeDisplay(eachDisplay, true); + } + } + if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) { + this._disposeDisplay(this._meshDisplay, false); + } + if (this._rawDisplay !== null) { + this._disposeDisplay(this._rawDisplay, false); + } + this.displayController = null; + this._displayDataDirty = false; + this._displayDirty = false; + this._geometryDirty = false; + this._textureDirty = false; + this._visibleDirty = false; + this._blendModeDirty = false; + this._zOrderDirty = false; + this._colorDirty = false; + this._verticesDirty = false; + this._transformDirty = false; + this._visible = true; + this._blendMode = 0 /* Normal */; + this._displayIndex = -1; + this._animationDisplayIndex = -1; + this._zOrder = 0; + this._zIndex = 0; + this._cachedFrameIndex = -1; + this._pivotX = 0.0; + this._pivotY = 0.0; + this._localMatrix.identity(); + this._colorTransform.identity(); + this._displayFrames.length = 0; + this._geometryBones.length = 0; + this._slotData = null; // + this._displayFrame = null; + this._geometryData = null; + this._boundingBoxData = null; + this._textureData = null; + this._rawDisplay = null; + this._meshDisplay = null; + this._display = null; + this._childArmature = null; + this._parent = null; // + this._cachedFrameIndices = null; + }; + Slot.prototype._hasDisplay = function (display) { + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var displayFrame = _a[_i]; + if (displayFrame.display === display) { + return true; + } + } + return false; + }; + /** + * @internal + */ + Slot.prototype._isBonesUpdate = function () { + for (var _i = 0, _a = this._geometryBones; _i < _a.length; _i++) { + var bone = _a[_i]; + if (bone !== null && bone._childrenTransformDirty) { + return true; + } + } + return false; + }; + /** + * @internal + */ + Slot.prototype._updateAlpha = function () { + var globalAlpha = this._alpha * this._parent._globalAlpha; + if (this._globalAlpha !== globalAlpha) { + this._globalAlpha = globalAlpha; + this._colorDirty = true; + } + }; + Slot.prototype._updateDisplayData = function () { + var prevDisplayFrame = this._displayFrame; + var prevGeometryData = this._geometryData; + var prevTextureData = this._textureData; + var rawDisplayData = null; + var displayData = null; + this._displayFrame = null; + this._geometryData = null; + this._boundingBoxData = null; + this._textureData = null; + if (this._displayIndex >= 0 && this._displayIndex < this._displayFrames.length) { + this._displayFrame = this._displayFrames[this._displayIndex]; + rawDisplayData = this._displayFrame.rawDisplayData; + displayData = this._displayFrame.displayData; + this._geometryData = this._displayFrame.getGeometryData(); + this._boundingBoxData = this._displayFrame.getBoundingBox(); + this._textureData = this._displayFrame.getTextureData(); + } + if (this._displayFrame !== prevDisplayFrame || + this._geometryData !== prevGeometryData || this._textureData !== prevTextureData) { + // Update pivot offset. + if (this._geometryData === null && this._textureData !== null) { + var imageDisplayData = ((displayData !== null && displayData.type === 0 /* Image */) ? displayData : rawDisplayData); // + var scale = this._textureData.parent.scale * this._armature._armatureData.scale; + var frame = this._textureData.frame; + this._pivotX = imageDisplayData.pivot.x; + this._pivotY = imageDisplayData.pivot.y; + var rect = frame !== null ? frame : this._textureData.region; + var width = rect.width; + var height = rect.height; + if (this._textureData.rotated && frame === null) { + width = rect.height; + height = rect.width; + } + this._pivotX *= width * scale; + this._pivotY *= height * scale; + if (frame !== null) { + this._pivotX += frame.x * scale; + this._pivotY += frame.y * scale; + } + // Update replace pivot. TODO + if (rawDisplayData !== null && imageDisplayData !== rawDisplayData) { + rawDisplayData.transform.toMatrix(Slot._helpMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint); + this._pivotX -= Slot._helpPoint.x; + this._pivotY -= Slot._helpPoint.y; + imageDisplayData.transform.toMatrix(Slot._helpMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint); + this._pivotX += Slot._helpPoint.x; + this._pivotY += Slot._helpPoint.y; + } + if (!dragonBones.DragonBones.yDown) { + this._pivotY = (this._textureData.rotated ? this._textureData.region.width : this._textureData.region.height) * scale - this._pivotY; + } + } + else { + this._pivotX = 0.0; + this._pivotY = 0.0; + } + // Update original transform. + if (rawDisplayData !== null) { + this.origin = rawDisplayData.transform; + } + else if (displayData !== null) { + this.origin = displayData.transform; + } + else { + this.origin = null; + } + // TODO remove slot offset. + if (this.origin !== null) { + this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix); + } + else { + this.global.copyFrom(this.offset).toMatrix(this._localMatrix); + } + // Update geometry. + if (this._geometryData !== prevGeometryData) { + this._geometryDirty = true; + this._verticesDirty = true; + if (this._geometryData !== null) { + this._geometryBones.length = 0; + if (this._geometryData.weight !== null) { + for (var i = 0, l = this._geometryData.weight.bones.length; i < l; ++i) { + var bone = this._armature.getBone(this._geometryData.weight.bones[i].name); + this._geometryBones.push(bone); + } + } + } + else { + this._geometryBones.length = 0; + this._geometryData = null; + } + } + this._textureDirty = this._textureData !== prevTextureData; + this._transformDirty = true; + } + }; + Slot.prototype._updateDisplay = function () { + var prevDisplay = this._display !== null ? this._display : this._rawDisplay; + var prevChildArmature = this._childArmature; + // Update display and child armature. + if (this._displayFrame !== null) { + this._display = this._displayFrame.display; + if (this._display !== null && this._display instanceof dragonBones.Armature) { + this._childArmature = this._display; + this._display = this._childArmature.display; + } + else { + this._childArmature = null; + } + } + else { + this._display = null; + this._childArmature = null; + } + // Update display. + var currentDisplay = this._display !== null ? this._display : this._rawDisplay; + if (currentDisplay !== prevDisplay) { + this._textureDirty = true; + this._visibleDirty = true; + this._blendModeDirty = true; + // this._zOrderDirty = true; + this._colorDirty = true; + this._transformDirty = true; + this._onUpdateDisplay(); + this._replaceDisplay(prevDisplay); + } + // Update child armature. + if (this._childArmature !== prevChildArmature) { + if (prevChildArmature !== null) { + prevChildArmature._parent = null; // Update child armature parent. + prevChildArmature.clock = null; + if (prevChildArmature.inheritAnimation) { + prevChildArmature.animation.reset(); + } + } + if (this._childArmature !== null) { + this._childArmature._parent = this; // Update child armature parent. + this._childArmature.clock = this._armature.clock; + if (this._childArmature.inheritAnimation) { + if (this._childArmature.cacheFrameRate === 0) { + var cacheFrameRate = this._armature.cacheFrameRate; + if (cacheFrameRate !== 0) { + this._childArmature.cacheFrameRate = cacheFrameRate; + } + } + // Child armature action. + if (this._displayFrame !== null) { + var actions = null; + var displayData = this._displayFrame.displayData !== null ? this._displayFrame.displayData : this._displayFrame.rawDisplayData; + if (displayData !== null && displayData.type === 1 /* Armature */) { + actions = displayData.actions; + } + if (actions !== null && actions.length > 0) { + for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) { + var action = actions_1[_i]; + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + eventObject.slot = this; + this._armature._bufferAction(eventObject, false); + } + } + else { + this._childArmature.animation.play(); + } + } + } + } + } + }; + Slot.prototype._updateGlobalTransformMatrix = function (isCache) { + var parentMatrix = this._parent._boneData.type === 0 /* Bone */ ? this._parent.globalTransformMatrix : this._parent._getGlobalTransformMatrix(this.global.x, this.global.y); + this.globalTransformMatrix.copyFrom(this._localMatrix); + this.globalTransformMatrix.concat(parentMatrix); + if (isCache) { + this.global.fromMatrix(this.globalTransformMatrix); + } + else { + this._globalDirty = true; + } + }; + /** + * @internal + */ + Slot.prototype._setDisplayIndex = function (value, isAnimation) { + if (isAnimation === void 0) { isAnimation = false; } + if (isAnimation) { + if (this._animationDisplayIndex === value) { + return; + } + this._animationDisplayIndex = value; + } + if (this._displayIndex === value) { + return; + } + this._displayIndex = value < this._displayFrames.length ? value : this._displayFrames.length - 1; + this._displayDataDirty = true; + this._displayDirty = this._displayIndex < 0 || this._display !== this._displayFrames[this._displayIndex].display; + }; + /** + * @internal + */ + Slot.prototype._setZOrder = function (value) { + if (this._zOrder === value) { + // return false; + } + this._zOrder = value; + this._zOrderDirty = true; + return this._zOrderDirty; + }; + /** + * @internal + */ + Slot.prototype._setColor = function (value) { + this._colorTransform.copyFrom(value); + return this._colorDirty = true; + }; + /** + * @internal + */ + Slot.prototype.init = function (slotData, armatureValue, rawDisplay, meshDisplay) { + if (this._slotData !== null) { + return; + } + this._slotData = slotData; + this._colorDirty = true; // + this._blendModeDirty = true; // + this._blendMode = this._slotData.blendMode; + this._zOrder = this._slotData.zOrder; + this._zIndex = this._slotData.zIndex; + this._alpha = this._slotData.alpha; + this._colorTransform.copyFrom(this._slotData.color); + this._rawDisplay = rawDisplay; + this._meshDisplay = meshDisplay; + // + this._armature = armatureValue; + var slotParent = this._armature.getBone(this._slotData.parent.name); + if (slotParent !== null) { + this._parent = slotParent; + } + else { + // Never; + } + this._armature._addSlot(this); + // + this._initDisplay(this._rawDisplay, false); + if (this._rawDisplay !== this._meshDisplay) { + this._initDisplay(this._meshDisplay, false); + } + this._onUpdateDisplay(); + this._addDisplay(); + }; + /** + * @internal + */ + Slot.prototype.update = function (cacheFrameIndex) { + if (this._displayDataDirty) { + this._updateDisplayData(); + this._displayDataDirty = false; + } + if (this._displayDirty) { + this._updateDisplay(); + this._displayDirty = false; + } + if (this._geometryDirty || this._textureDirty) { + if (this._display === null || this._display === this._rawDisplay || this._display === this._meshDisplay) { + this._updateFrame(); + } + this._geometryDirty = false; + this._textureDirty = false; + } + if (this._display === null) { + return; + } + if (this._visibleDirty) { + this._updateVisible(); + this._visibleDirty = false; + } + if (this._blendModeDirty) { + this._updateBlendMode(); + this._blendModeDirty = false; + } + if (this._colorDirty) { + this._updateColor(); + this._colorDirty = false; + } + if (this._zOrderDirty) { + this._updateZOrder(); + this._zOrderDirty = false; + } + if (this._geometryData !== null && this._display === this._meshDisplay) { + var isSkinned = this._geometryData.weight !== null; + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + if (this._verticesDirty || + (isSkinned && this._isBonesUpdate()) || + (isSurface && this._parent._childrenTransformDirty)) { + this._verticesDirty = false; // Allow update mesh to reset the dirty value. + this._updateMesh(); + } + if (isSkinned || isSurface) { + return; + } + } + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else if (this._transformDirty || this._parent._childrenTransformDirty) { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + else if (this._transformDirty || this._parent._childrenTransformDirty) { + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + if (this._transformDirty) { + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + this._updateGlobalTransformMatrix(isCache); + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + this._updateTransform(); + this._transformDirty = false; + } + }; + /** + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Slot.prototype.invalidUpdate = function () { + this._displayDataDirty = true; + this._displayDirty = true; + // + this._transformDirty = true; + }; + /** + * @private + */ + Slot.prototype.updateTransformAndMatrix = function () { + if (this._transformDirty) { + this._updateGlobalTransformMatrix(false); + this._transformDirty = false; + } + }; + /** + * @private + */ + Slot.prototype.replaceRawDisplayData = function (displayData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.rawDisplayData !== displayData) { + displayFrame.deformVertices.length = 0; + displayFrame.rawDisplayData = displayData; + if (displayFrame.rawDisplayData === null) { + var defaultSkin = this._armature._armatureData.defaultSkin; + if (defaultSkin !== null) { + var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name); + if (defaultRawDisplayDatas !== null && index < defaultRawDisplayDatas.length) { + displayFrame.rawDisplayData = defaultRawDisplayDatas[index]; + } + } + } + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceDisplayData = function (displayData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.displayData !== displayData && displayFrame.rawDisplayData !== displayData) { + displayFrame.displayData = displayData; + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceTextureData = function (textureData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.textureData !== textureData) { + displayFrame.textureData = textureData; + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceDisplay = function (value, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.display !== value) { + var prevDisplay = displayFrame.display; + displayFrame.display = value; + if (prevDisplay !== null && + prevDisplay !== this._rawDisplay && prevDisplay !== this._meshDisplay && + !this._hasDisplay(prevDisplay)) { + if (prevDisplay instanceof dragonBones.Armature) { + // (eachDisplay as Armature).dispose(); + } + else { + this._disposeDisplay(prevDisplay, true); + } + } + if (value !== null && + value !== this._rawDisplay && value !== this._meshDisplay && + !this._hasDisplay(prevDisplay) && + !(value instanceof dragonBones.Armature)) { + this._initDisplay(value, true); + } + if (index === this._displayIndex) { + this._displayDirty = true; + } + } + }; + /** + * - Check whether a specific point is inside a custom bounding box in the slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Slot.prototype.containsPoint = function (x, y) { + if (this._boundingBoxData === null) { + return false; + } + this.updateTransformAndMatrix(); + Slot._helpMatrix.copyFrom(this.globalTransformMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(x, y, Slot._helpPoint); + return this._boundingBoxData.containsPoint(Slot._helpPoint.x, Slot._helpPoint.y); + }; + /** + * - Check whether a specific segment intersects a custom bounding box for the slot. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] + * @version DragonBones 5.0 + * @language zh_CN + */ + Slot.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + if (this._boundingBoxData === null) { + return 0; + } + this.updateTransformAndMatrix(); + Slot._helpMatrix.copyFrom(this.globalTransformMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(xA, yA, Slot._helpPoint); + xA = Slot._helpPoint.x; + yA = Slot._helpPoint.y; + Slot._helpMatrix.transformPoint(xB, yB, Slot._helpPoint); + xB = Slot._helpPoint.x; + yB = Slot._helpPoint.y; + var intersectionCount = this._boundingBoxData.intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); + if (intersectionCount > 0) { + if (intersectionCount === 1 || intersectionCount === 2) { + if (intersectionPointA !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointA.x, intersectionPointA.y, intersectionPointA); + if (intersectionPointB !== null) { + intersectionPointB.x = intersectionPointA.x; + intersectionPointB.y = intersectionPointA.y; + } + } + else if (intersectionPointB !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointB.x, intersectionPointB.y, intersectionPointB); + } + } + else { + if (intersectionPointA !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointA.x, intersectionPointA.y, intersectionPointA); + } + if (intersectionPointB !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointB.x, intersectionPointB.y, intersectionPointB); + } + } + if (normalRadians !== null) { + this.globalTransformMatrix.transformPoint(Math.cos(normalRadians.x), Math.sin(normalRadians.x), Slot._helpPoint, true); + normalRadians.x = Math.atan2(Slot._helpPoint.y, Slot._helpPoint.x); + this.globalTransformMatrix.transformPoint(Math.cos(normalRadians.y), Math.sin(normalRadians.y), Slot._helpPoint, true); + normalRadians.y = Math.atan2(Slot._helpPoint.y, Slot._helpPoint.x); + } + } + return intersectionCount; + }; + /** + * @private + */ + Slot.prototype.getDisplayFrameAt = function (index) { + return this._displayFrames[index]; + }; + Object.defineProperty(Slot.prototype, "visible", { + /** + * - The visible of slot's display object. + * @default true + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 插槽的显示对象的可见。 + * @default true + * @version DragonBones 5.6 + * @language zh_CN + */ + get: function () { + return this._visible; + }, + set: function (value) { + if (this._visible === value) { + return; + } + this._visible = value; + this._updateVisible(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayFrameCount", { + /** + * @private + */ + get: function () { + return this._displayFrames.length; + }, + set: function (value) { + var prevCount = this._displayFrames.length; + if (prevCount < value) { + this._displayFrames.length = value; + for (var i = prevCount; i < value; ++i) { + this._displayFrames[i] = dragonBones.BaseObject.borrowObject(DisplayFrame); + } + } + else if (prevCount > value) { + for (var i = prevCount - 1; i < value; --i) { + this.replaceDisplay(null, i); + this._displayFrames[i].returnToPool(); + } + this._displayFrames.length = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayIndex", { + /** + * - The index of the display object displayed in the display list. + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     slot.displayIndex = 3;
+             *     slot.displayController = "none";
+             * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 此时显示的显示对象在显示列表中的索引。 + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     slot.displayIndex = 3;
+             *     slot.displayController = "none";
+             * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._displayIndex; + }, + set: function (value) { + this._setDisplayIndex(value); + this.update(-1); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "name", { + /** + * - The slot name. + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._slotData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayList", { + /** + * - Contains a display list of display objects or child armatures. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + var displays = new Array(); + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var displayFrame = _a[_i]; + displays.push(displayFrame.display); + } + return displays; + }, + set: function (value) { + this.displayFrameCount = value.length; + var index = 0; + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var eachDisplay = value_1[_i]; + this.replaceDisplay(eachDisplay, index++); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "slotData", { + /** + * - The slot data. + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 插槽数据。 + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._slotData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "boundingBoxData", { + /** + * - The custom bounding box data for the slot at current time. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 插槽此时的自定义包围盒数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + get: function () { + return this._boundingBoxData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "rawDisplay", { + /** + * @private + */ + get: function () { + return this._rawDisplay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "meshDisplay", { + /** + * @private + */ + get: function () { + return this._meshDisplay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "display", { + /** + * - The display object that the slot displays at this time. + * @example + *
+             *     let slot = armature.getSlot("text");
+             *     slot.display = new yourEngine.TextField();
+             * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的显示对象。 + * @example + *
+             *     let slot = armature.getSlot("text");
+             *     slot.display = new yourEngine.TextField();
+             * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._display; + }, + set: function (value) { + if (this._display === value) { + return; + } + if (this._displayFrames.length === 0) { + this.displayFrameCount = 1; + this._displayIndex = 0; + } + this.replaceDisplay(value, this._displayIndex); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "childArmature", { + /** + * - The child armature that the slot displayed at current time. + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
+             *     }
+             *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+             * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的子骨架。 + * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
+             *     }
+             *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+             * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._childArmature; + }, + set: function (value) { + if (this._childArmature === value) { + return; + } + this.display = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "parent", { + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Slot.prototype.getDisplay = function () { + return this._display; + }; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Slot.prototype.setDisplay = function (value) { + this.display = value; + }; + return Slot; + }(dragonBones.TransformObject)); + dragonBones.Slot = Slot; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var Constraint = (function (_super) { + __extends(Constraint, _super); + function Constraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + Constraint.prototype._onClear = function () { + this._armature = null; // + this._target = null; // + this._root = null; // + this._bone = null; + }; + Object.defineProperty(Constraint.prototype, "name", { + get: function () { + return this._constraintData.name; + }, + enumerable: true, + configurable: true + }); + Constraint._helpMatrix = new dragonBones.Matrix(); + Constraint._helpTransform = new dragonBones.Transform(); + Constraint._helpPoint = new dragonBones.Point(); + return Constraint; + }(dragonBones.BaseObject)); + dragonBones.Constraint = Constraint; + /** + * @internal + */ + var IKConstraint = (function (_super) { + __extends(IKConstraint, _super); + function IKConstraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraint.toString = function () { + return "[class dragonBones.IKConstraint]"; + }; + IKConstraint.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._scaleEnabled = false; + this._bendPositive = false; + this._weight = 1.0; + this._constraintData = null; + }; + IKConstraint.prototype._computeA = function () { + var ikGlobal = this._target.global; + var global = this._root.global; + var globalTransformMatrix = this._root.globalTransformMatrix; + var radian = Math.atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); + if (global.scaleX < 0.0) { + radian += Math.PI; + } + global.rotation += dragonBones.Transform.normalizeRadian(radian - global.rotation) * this._weight; + global.toMatrix(globalTransformMatrix); + }; + IKConstraint.prototype._computeB = function () { + var boneLength = this._bone._boneData.length; + var parent = this._root; + var ikGlobal = this._target.global; + var parentGlobal = parent.global; + var global = this._bone.global; + var globalTransformMatrix = this._bone.globalTransformMatrix; + var x = globalTransformMatrix.a * boneLength; + var y = globalTransformMatrix.b * boneLength; + var lLL = x * x + y * y; + var lL = Math.sqrt(lLL); + var dX = global.x - parentGlobal.x; + var dY = global.y - parentGlobal.y; + var lPP = dX * dX + dY * dY; + var lP = Math.sqrt(lPP); + var rawRadian = global.rotation; + var rawParentRadian = parentGlobal.rotation; + var rawRadianA = Math.atan2(dY, dX); + dX = ikGlobal.x - parentGlobal.x; + dY = ikGlobal.y - parentGlobal.y; + var lTT = dX * dX + dY * dY; + var lT = Math.sqrt(lTT); + var radianA = 0.0; + if (lL + lP <= lT || lT + lL <= lP || lT + lP <= lL) { + radianA = Math.atan2(ikGlobal.y - parentGlobal.y, ikGlobal.x - parentGlobal.x); + if (lL + lP <= lT) { + } + else if (lP < lL) { + radianA += Math.PI; + } + } + else { + var h = (lPP - lLL + lTT) / (2.0 * lTT); + var r = Math.sqrt(lPP - h * h * lTT) / lT; + var hX = parentGlobal.x + (dX * h); + var hY = parentGlobal.y + (dY * h); + var rX = -dY * r; + var rY = dX * r; + var isPPR = false; + var parentParent = parent.parent; + if (parentParent !== null) { + var parentParentMatrix = parentParent.globalTransformMatrix; + isPPR = parentParentMatrix.a * parentParentMatrix.d - parentParentMatrix.b * parentParentMatrix.c < 0.0; + } + if (isPPR !== this._bendPositive) { + global.x = hX - rX; + global.y = hY - rY; + } + else { + global.x = hX + rX; + global.y = hY + rY; + } + radianA = Math.atan2(global.y - parentGlobal.y, global.x - parentGlobal.x); + } + var dR = dragonBones.Transform.normalizeRadian(radianA - rawRadianA); + parentGlobal.rotation = rawParentRadian + dR * this._weight; + parentGlobal.toMatrix(parent.globalTransformMatrix); + // + var currentRadianA = rawRadianA + dR * this._weight; + global.x = parentGlobal.x + Math.cos(currentRadianA) * lP; + global.y = parentGlobal.y + Math.sin(currentRadianA) * lP; + // + var radianB = Math.atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); + if (global.scaleX < 0.0) { + radianB += Math.PI; + } + global.rotation = parentGlobal.rotation + rawRadian - rawParentRadian + dragonBones.Transform.normalizeRadian(radianB - dR - rawRadian) * this._weight; + global.toMatrix(globalTransformMatrix); + }; + IKConstraint.prototype.init = function (constraintData, armature) { + if (this._constraintData !== null) { + return; + } + this._constraintData = constraintData; + this._armature = armature; + this._target = this._armature.getBone(this._constraintData.target.name); + this._root = this._armature.getBone(this._constraintData.root.name); + this._bone = this._constraintData.bone !== null ? this._armature.getBone(this._constraintData.bone.name) : null; + { + var ikConstraintData = this._constraintData; + this._scaleEnabled = ikConstraintData.scaleEnabled; + this._bendPositive = ikConstraintData.bendPositive; + this._weight = ikConstraintData.weight; + } + this._root._hasConstraint = true; + }; + IKConstraint.prototype.update = function () { + this._root.updateByConstraint(); + if (this._bone !== null) { + this._bone.updateByConstraint(); + this._computeB(); + } + else { + this._computeA(); + } + }; + IKConstraint.prototype.invalidUpdate = function () { + this._root.invalidUpdate(); + if (this._bone !== null) { + this._bone.invalidUpdate(); + } + }; + return IKConstraint; + }(Constraint)); + dragonBones.IKConstraint = IKConstraint; + /** + * @internal + */ + var PathConstraint = (function (_super) { + __extends(PathConstraint, _super); + function PathConstraint() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._bones = []; + _this._spaces = []; + _this._positions = []; + _this._curves = []; + _this._boneLengths = []; + _this._pathGlobalVertices = []; + _this._segments = [10]; + return _this; + } + PathConstraint.toString = function () { + return "[class dragonBones.PathConstraint]"; + }; + PathConstraint.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.dirty = false; + this.pathOffset = 0; + this.position = 0.0; + this.spacing = 0.0; + this.rotateOffset = 0.0; + this.rotateMix = 1.0; + this.translateMix = 1.0; + this._pathSlot = null; + this._bones.length = 0; + this._spaces.length = 0; + this._positions.length = 0; + this._curves.length = 0; + this._boneLengths.length = 0; + this._pathGlobalVertices.length = 0; + }; + PathConstraint.prototype._updatePathVertices = function (verticesData) { + //计算曲线的节点数据 + var armature = this._armature; + var dragonBonesData = armature.armatureData.parent; + var scale = armature.armatureData.scale; + var intArray = dragonBonesData.intArray; + var floatArray = dragonBonesData.floatArray; + var pathOffset = verticesData.offset; + var pathVertexCount = intArray[pathOffset + 0 /* GeometryVertexCount */]; + var pathVertexOffset = intArray[pathOffset + 2 /* GeometryFloatOffset */]; + this._pathGlobalVertices.length = pathVertexCount * 2; + var weightData = verticesData.weight; + //没有骨骼约束我,那节点只受自己的Bone控制 + if (weightData === null) { + var parentBone = this._pathSlot.parent; + parentBone.updateByConstraint(); + var matrix = parentBone.globalTransformMatrix; + for (var i = 0, iV_1 = pathVertexOffset; i < pathVertexCount; i += 2) { + var vx = floatArray[iV_1++] * scale; + var vy = floatArray[iV_1++] * scale; + var x = matrix.a * vx + matrix.c * vy + matrix.tx; + var y = matrix.b * vx + matrix.d * vy + matrix.ty; + // + this._pathGlobalVertices[i] = x; + this._pathGlobalVertices[i + 1] = y; + } + return; + } + //有骨骼约束我,那我的节点受骨骼权重控制 + var bones = this._pathSlot._geometryBones; + var weightBoneCount = weightData.bones.length; + var weightOffset = weightData.offset; + var floatOffset = intArray[weightOffset + 1 /* WeigthFloatOffset */]; + var iV = floatOffset; + var iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount; + for (var i = 0, iW = 0; i < pathVertexCount; i++) { + var vertexBoneCount = intArray[iB++]; // + var xG = 0.0, yG = 0.0; + for (var ii = 0, ll = vertexBoneCount; ii < ll; ii++) { + var boneIndex = intArray[iB++]; + var bone = bones[boneIndex]; + if (bone === null) { + continue; + } + bone.updateByConstraint(); + var matrix = bone.globalTransformMatrix; + var weight = floatArray[iV++]; + var vx = floatArray[iV++] * scale; + var vy = floatArray[iV++] * scale; + xG += (matrix.a * vx + matrix.c * vy + matrix.tx) * weight; + yG += (matrix.b * vx + matrix.d * vy + matrix.ty) * weight; + } + this._pathGlobalVertices[iW++] = xG; + this._pathGlobalVertices[iW++] = yG; + } + }; + PathConstraint.prototype._computeVertices = function (start, count, offset, out) { + //TODO优化 + for (var i = offset, iW = start; i < count; i += 2) { + out[i] = this._pathGlobalVertices[iW++]; + out[i + 1] = this._pathGlobalVertices[iW++]; + } + }; + PathConstraint.prototype._computeBezierCurve = function (pathDisplayDta, spaceCount, tangents, percentPosition, percentSpacing) { + //计算当前的骨骼在曲线上的位置 + var armature = this._armature; + var intArray = armature.armatureData.parent.intArray; + var vertexCount = intArray[pathDisplayDta.geometry.offset + 0 /* GeometryVertexCount */]; + var positions = this._positions; + var spaces = this._spaces; + var isClosed = pathDisplayDta.closed; + var curveVertices = Array(); + var verticesLength = vertexCount * 2; + var curveCount = verticesLength / 6; + var preCurve = -1; + var position = this.position; + positions.length = spaceCount * 3 + 2; + var pathLength = 0.0; + //不需要匀速运动,效率高些 + if (!pathDisplayDta.constantSpeed) { + var lenghts = pathDisplayDta.curveLengths; + curveCount -= isClosed ? 1 : 2; + pathLength = lenghts[curveCount]; + if (percentPosition) { + position *= pathLength; + } + if (percentSpacing) { + for (var i = 0; i < spaceCount; i++) { + spaces[i] *= pathLength; + } + } + curveVertices.length = 8; + for (var i = 0, o = 0, curve = 0; i < spaceCount; i++, o += 3) { + var space = spaces[i]; + position += space; + if (isClosed) { + position %= pathLength; + if (position < 0) { + position += pathLength; + } + curve = 0; + } + else if (position < 0) { + //TODO + continue; + } + else if (position > pathLength) { + //TODO + continue; + } + var percent = 0.0; + for (;; curve++) { + var len = lenghts[curve]; + if (position > len) { + continue; + } + if (curve === 0) { + percent = position / len; + } + else { + var preLen = lenghts[curve - 1]; + percent = (position - preLen) / (len - preLen); + } + break; + } + if (curve !== preCurve) { + preCurve = curve; + if (isClosed && curve === curveCount) { + //计算曲线 + this._computeVertices(verticesLength - 4, 4, 0, curveVertices); + this._computeVertices(0, 4, 4, curveVertices); + } + else { + this._computeVertices(curve * 6 + 2, 8, 0, curveVertices); + } + } + // + this.addCurvePosition(percent, curveVertices[0], curveVertices[1], curveVertices[2], curveVertices[3], curveVertices[4], curveVertices[5], curveVertices[6], curveVertices[7], positions, o, tangents); + } + return; + } + //匀速的 + if (isClosed) { + verticesLength += 2; + curveVertices.length = vertexCount; + this._computeVertices(2, verticesLength - 4, 0, curveVertices); + this._computeVertices(0, 2, verticesLength - 4, curveVertices); + curveVertices[verticesLength - 2] = curveVertices[0]; + curveVertices[verticesLength - 1] = curveVertices[1]; + } + else { + curveCount--; + verticesLength -= 4; + curveVertices.length = verticesLength; + this._computeVertices(2, verticesLength, 0, curveVertices); + } + // + var curves = new Array(curveCount); + pathLength = 0; + var x1 = curveVertices[0], y1 = curveVertices[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = curveVertices[w]; + cy1 = curveVertices[w + 1]; + cx2 = curveVertices[w + 2]; + cy2 = curveVertices[w + 3]; + x2 = curveVertices[w + 4]; + y2 = curveVertices[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) { + position *= pathLength; + } + if (percentSpacing) { + for (var i = 0; i < spaceCount; i++) { + spaces[i] *= pathLength; + } + } + var segments = this._segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spaceCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (isClosed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + continue; + } + else if (p > pathLength) { + continue; + } + // Determine curve containing position. + for (;; curve++) { + var length_1 = curves[curve]; + if (p > length_1) + continue; + if (curve === 0) + p /= length_1; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_1 - prev); + } + break; + } + if (curve !== preCurve) { + preCurve = curve; + var ii = curve * 6; + x1 = curveVertices[ii]; + y1 = curveVertices[ii + 1]; + cx1 = curveVertices[ii + 2]; + cy1 = curveVertices[ii + 3]; + cx2 = curveVertices[ii + 4]; + cy2 = curveVertices[ii + 5]; + x2 = curveVertices[ii + 6]; + y2 = curveVertices[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + // Weight by segment length. + p *= curveLength; + for (;; segment++) { + var length_2 = segments[segment]; + if (p > length_2) + continue; + if (segment === 0) + p /= length_2; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_2 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, positions, o, tangents); + } + }; + //Calculates a point on the curve, for a given t value between 0 and 1. + PathConstraint.prototype.addCurvePosition = function (t, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, offset, tangents) { + if (t === 0) { + out[offset] = x1; + out[offset + 1] = y1; + out[offset + 2] = 0; + return; + } + if (t === 1) { + out[offset] = x2; + out[offset + 1] = y2; + out[offset + 2] = 0; + return; + } + var mt = 1 - t; + var mt2 = mt * mt; + var t2 = t * t; + var a = mt2 * mt; + var b = mt2 * t * 3; + var c = mt * t2 * 3; + var d = t * t2; + var x = a * x1 + b * cx1 + c * cx2 + d * x2; + var y = a * y1 + b * cy1 + c * cy2 + d * y2; + out[offset] = x; + out[offset + 1] = y; + if (tangents) { + //Calculates the curve tangent at the specified t value + out[offset + 2] = Math.atan2(y - (a * y1 + b * cy1 + c * cy2), x - (a * x1 + b * cx1 + c * cx2)); + } + else { + out[offset + 2] = 0; + } + }; + PathConstraint.prototype.init = function (constraintData, armature) { + this._constraintData = constraintData; + this._armature = armature; + var data = constraintData; + this.pathOffset = data.pathDisplayData.geometry.offset; + // + this.position = data.position; + this.spacing = data.spacing; + this.rotateOffset = data.rotateOffset; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + // + this._root = this._armature.getBone(data.root.name); + this._target = this._armature.getBone(data.target.name); + this._pathSlot = this._armature.getSlot(data.pathSlot.name); + for (var i = 0, l = data.bones.length; i < l; i++) { + var bone = this._armature.getBone(data.bones[i].name); + if (bone !== null) { + this._bones.push(bone); + } + } + if (data.rotateMode === 2 /* ChainScale */) { + this._boneLengths.length = this._bones.length; + } + this._root._hasConstraint = true; + }; + PathConstraint.prototype.update = function () { + var pathSlot = this._pathSlot; + if (pathSlot._geometryData === null || + pathSlot._geometryData.offset !== this.pathOffset) { + return; + } + var constraintData = this._constraintData; + // + //曲线节点数据改变:父亲bone改变,权重bones改变,变形顶点改变 + var isPathVerticeDirty = false; + if (this._root._childrenTransformDirty) { + this._updatePathVertices(pathSlot._geometryData); + isPathVerticeDirty = true; + } + else if (pathSlot._verticesDirty || pathSlot._isBonesUpdate()) { + this._updatePathVertices(pathSlot._geometryData); + pathSlot._verticesDirty = false; + isPathVerticeDirty = true; + } + if (!isPathVerticeDirty && !this.dirty) { + return; + } + // + var positionMode = constraintData.positionMode; + var spacingMode = constraintData.spacingMode; + var rotateMode = constraintData.rotateMode; + var bones = this._bones; + var isLengthMode = spacingMode === 0 /* Length */; + var isChainScaleMode = rotateMode === 2 /* ChainScale */; + var isTangentMode = rotateMode === 0 /* Tangent */; + var boneCount = bones.length; + var spacesCount = isTangentMode ? boneCount : boneCount + 1; + var spacing = this.spacing; + var spaces = this._spaces; + spaces.length = spacesCount; + //计曲线间隔和长度 + if (isChainScaleMode || isLengthMode) { + //Bone改变和spacing改变触发 + spaces[0] = 0; + for (var i = 0, l = spacesCount - 1; i < l; i++) { + var bone = bones[i]; + bone.updateByConstraint(); + var boneLength = bone._boneData.length; + var matrix = bone.globalTransformMatrix; + var x = boneLength * matrix.a; + var y = boneLength * matrix.b; + var len = Math.sqrt(x * x + y * y); + if (isChainScaleMode) { + this._boneLengths[i] = len; + } + spaces[i + 1] = (boneLength + spacing) * len / boneLength; + } + } + else { + for (var i = 0; i < spacesCount; i++) { + spaces[i] = spacing; + } + } + // + this._computeBezierCurve(pathSlot._displayFrame.rawDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); + //根据新的节点数据重新采样 + var positions = this._positions; + var rotateOffset = this.rotateOffset; + var boneX = positions[0], boneY = positions[1]; + var tip; + if (rotateOffset === 0) { + tip = rotateMode === 1 /* Chain */; + } + else { + tip = false; + var bone = pathSlot.parent; + if (bone !== null) { + var matrix = bone.globalTransformMatrix; + rotateOffset *= matrix.a * matrix.d - matrix.b * matrix.c > 0 ? dragonBones.Transform.DEG_RAD : -dragonBones.Transform.DEG_RAD; + } + } + // + var rotateMix = this.rotateMix; + var translateMix = this.translateMix; + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.updateByConstraint(); + var matrix = bone.globalTransformMatrix; + matrix.tx += (boneX - matrix.tx) * translateMix; + matrix.ty += (boneY - matrix.ty) * translateMix; + var x = positions[p], y = positions[p + 1]; + var dx = x - boneX, dy = y - boneY; + if (isChainScaleMode) { + var lenght = this._boneLengths[i]; + var s = (Math.sqrt(dx * dx + dy * dy) / lenght - 1) * rotateMix + 1; + matrix.a *= s; + matrix.b *= s; + } + boneX = x; + boneY = y; + if (rotateMix > 0) { + var a = matrix.a, b = matrix.b, c = matrix.c, d = matrix.d, r = void 0, cos = void 0, sin = void 0; + if (isTangentMode) { + r = positions[p - 1]; + } + else { + r = Math.atan2(dy, dx); + } + r -= Math.atan2(b, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_3 = bone._boneData.length; + boneX += (length_3 * (cos * a - sin * b) - dx) * rotateMix; + boneY += (length_3 * (sin * a + cos * b) - dy) * rotateMix; + } + else { + r += rotateOffset; + } + if (r > dragonBones.Transform.PI) { + r -= dragonBones.Transform.PI_D; + } + else if (r < -dragonBones.Transform.PI) { + r += dragonBones.Transform.PI_D; + } + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + matrix.a = cos * a - sin * b; + matrix.b = sin * a + cos * b; + matrix.c = cos * c - sin * d; + matrix.d = sin * c + cos * d; + } + bone.global.fromMatrix(matrix); + } + this.dirty = false; + }; + PathConstraint.prototype.invalidUpdate = function () { + }; + return PathConstraint; + }(Constraint)); + dragonBones.PathConstraint = PathConstraint; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + var WorldClock = (function () { + /** + * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. + * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 + * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 + * @version DragonBones 3.0 + * @language zh_CN + */ + function WorldClock(time) { + if (time === void 0) { time = 0.0; } + /** + * - Current time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + this.time = 0.0; + /** + * - The play speed, used to control animation speed-shift play. + * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度,用于控制动画变速播放。 + * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + this.timeScale = 1.0; + this._systemTime = 0.0; + this._animatebles = []; + this._clock = null; + this.time = time; + this._systemTime = new Date().getTime() * 0.001; + } + /** + * - Advance time for all IAnimatable instances. + * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 为所有的 IAnimatable 实例更新时间。 + * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.advanceTime = function (passedTime) { + if (passedTime !== passedTime) { + passedTime = 0.0; + } + var currentTime = Date.now() * 0.001; + if (passedTime < 0.0) { + passedTime = currentTime - this._systemTime; + } + this._systemTime = currentTime; + if (this.timeScale !== 1.0) { + passedTime *= this.timeScale; + } + if (passedTime === 0.0) { + return; + } + if (passedTime < 0.0) { + this.time -= passedTime; + } + else { + this.time += passedTime; + } + var i = 0, r = 0, l = this._animatebles.length; + for (; i < l; ++i) { + var animatable = this._animatebles[i]; + if (animatable !== null) { + if (r > 0) { + this._animatebles[i - r] = animatable; + this._animatebles[i] = null; + } + animatable.advanceTime(passedTime); + } + else { + r++; + } + } + if (r > 0) { + l = this._animatebles.length; + for (; i < l; ++i) { + var animateble = this._animatebles[i]; + if (animateble !== null) { + this._animatebles[i - r] = animateble; + } + else { + r++; + } + } + this._animatebles.length -= r; + } + }; + /** + * - Check whether contains a specific instance of IAnimatable. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.contains = function (value) { + if (value === this) { + return false; + } + var ancestor = value; + while (ancestor !== this && ancestor !== null) { + ancestor = ancestor.clock; + } + return ancestor === this; + }; + /** + * - Add IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.add = function (value) { + if (this._animatebles.indexOf(value) < 0) { + this._animatebles.push(value); + value.clock = this; + } + }; + /** + * - Removes a specified IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.remove = function (value) { + var index = this._animatebles.indexOf(value); + if (index >= 0) { + this._animatebles[index] = null; + value.clock = null; + } + }; + /** + * - Clear all IAnimatable instances. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.clear = function () { + for (var _i = 0, _a = this._animatebles; _i < _a.length; _i++) { + var animatable = _a[_i]; + if (animatable !== null) { + animatable.clock = null; + } + } + }; + Object.defineProperty(WorldClock.prototype, "clock", { + /** + * @inheritDoc + */ + get: function () { + return this._clock; + }, + set: function (value) { + if (this._clock === value) { + return; + } + if (this._clock !== null) { + this._clock.remove(this); + } + this._clock = value; + if (this._clock !== null) { + this._clock.add(this); + } + }, + enumerable: true, + configurable: true + }); + return WorldClock; + }()); + dragonBones.WorldClock = WorldClock; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation player is used to play the animation data and manage the animation states. + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器用来播放动画数据和管理动画状态。 + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + var Animation = (function (_super) { + __extends(Animation, _super); + function Animation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._animationNames = []; + _this._animationStates = []; + _this._animations = {}; + _this._blendStates = {}; + _this._animationConfig = null; // Initial value. + return _this; + } + Animation.toString = function () { + return "[class dragonBones.Animation]"; + }; + Animation.prototype._onClear = function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.returnToPool(); + } + for (var k in this._animations) { + delete this._animations[k]; + } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].returnToPool(); + } + delete this._blendStates[k]; + } + if (this._animationConfig !== null) { + this._animationConfig.returnToPool(); + } + this.timeScale = 1.0; + this._animationDirty = false; + this._inheritTimeScale = 1.0; + this._animationNames.length = 0; + this._animationStates.length = 0; + //this._animations.clear(); + this._armature = null; // + this._animationConfig = null; // + this._lastAnimationState = null; + }; + Animation.prototype._fadeOut = function (animationConfig) { + switch (animationConfig.fadeOutMode) { + case 1 /* SameLayer */: + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (animationState._parent !== null) { + continue; + } + if (animationState.layer === animationConfig.layer) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 2 /* SameGroup */: + for (var _b = 0, _c = this._animationStates; _b < _c.length; _b++) { + var animationState = _c[_b]; + if (animationState._parent !== null) { + continue; + } + if (animationState.group === animationConfig.group) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 3 /* SameLayerAndGroup */: + for (var _d = 0, _e = this._animationStates; _d < _e.length; _d++) { + var animationState = _e[_d]; + if (animationState._parent !== null) { + continue; + } + if (animationState.layer === animationConfig.layer && + animationState.group === animationConfig.group) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 4 /* All */: + for (var _f = 0, _g = this._animationStates; _f < _g.length; _f++) { + var animationState = _g[_f]; + if (animationState._parent !== null) { + continue; + } + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + break; + case 5 /* Single */: // TODO + default: + break; + } + }; + /** + * @internal + */ + Animation.prototype.init = function (armature) { + if (this._armature !== null) { + return; + } + this._armature = armature; + this._animationConfig = dragonBones.BaseObject.borrowObject(dragonBones.AnimationConfig); + }; + /** + * @internal + */ + Animation.prototype.advanceTime = function (passedTime) { + if (passedTime < 0.0) { + passedTime = -passedTime; + } + if (this._armature.inheritAnimation && this._armature._parent !== null) { + this._inheritTimeScale = this._armature._parent._armature.animation._inheritTimeScale * this.timeScale; + } + else { + this._inheritTimeScale = this.timeScale; + } + if (this._inheritTimeScale !== 1.0) { + passedTime *= this._inheritTimeScale; + } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].reset(); + } + } + var animationStateCount = this._animationStates.length; + if (animationStateCount === 1) { + var animationState = this._animationStates[0]; + if (animationState._fadeState > 0 && animationState._subFadeState > 0) { + this._armature._dragonBones.bufferObject(animationState); + this._animationStates.length = 0; + this._lastAnimationState = null; + } + else { + var animationData = animationState.animationData; + var cacheFrameRate = animationData.cacheFrameRate; + if (this._animationDirty && cacheFrameRate > 0.0) { + this._animationDirty = false; + for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { + var bone = _a[_i]; + bone._cachedFrameIndices = animationData.getBoneCachedFrameIndices(bone.name); + } + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { + var slot = _c[_b]; + if (slot.displayFrameCount > 0) { + var rawDisplayData = slot.getDisplayFrameAt(0).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.parent === this._armature.armatureData.defaultSkin) { + slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); + continue; + } + } + slot._cachedFrameIndices = null; + } + } + animationState.advanceTime(passedTime, cacheFrameRate); + } + } + else if (animationStateCount > 1) { + for (var i = 0, r = 0; i < animationStateCount; ++i) { + var animationState = this._animationStates[i]; + if (animationState._fadeState > 0 && animationState._subFadeState > 0) { + r++; + this._armature._dragonBones.bufferObject(animationState); + this._animationDirty = true; + if (this._lastAnimationState === animationState) { + this._lastAnimationState = null; + } + } + else { + if (r > 0) { + this._animationStates[i - r] = animationState; + } + animationState.advanceTime(passedTime, 0.0); + } + if (i === animationStateCount - 1 && r > 0) { + this._animationStates.length -= r; + if (this._lastAnimationState === null && this._animationStates.length > 0) { + this._lastAnimationState = this._animationStates[this._animationStates.length - 1]; + } + } + } + this._armature._cacheFrameIndex = -1; + } + else { + this._armature._cacheFrameIndex = -1; + } + }; + /** + * - Clear all animations states. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除所有的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.reset = function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.returnToPool(); + } + this._animationDirty = false; + this._animationConfig.clear(); + this._animationStates.length = 0; + this._lastAnimationState = null; + }; + /** + * - Pause a specific animation state. + * @param animationName - The name of animation state. (If not set, it will pause all animations) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停指定动画状态的播放。 + * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.stop = function (animationName) { + if (animationName === void 0) { animationName = null; } + if (animationName !== null) { + var animationState = this.getState(animationName); + if (animationState !== null) { + animationState.stop(); + } + } + else { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.stop(); + } + } + }; + /** + * - Play animation with a specific animation config. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @param animationConfig - The animation config. + * @returns The playing animation state. + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 通过指定的动画配置来播放动画。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @param animationConfig - 动画配置。 + * @returns 播放的动画状态。 + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + Animation.prototype.playConfig = function (animationConfig) { + var animationName = animationConfig.animation; + if (!(animationName in this._animations)) { + console.warn("Non-existent animation.\n", "DragonBones name: " + this._armature.armatureData.parent.name, "Armature name: " + this._armature.name, "Animation name: " + animationName); + return null; + } + var animationData = this._animations[animationName]; + if (animationConfig.fadeOutMode === 5 /* Single */) { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState_1 = _a[_i]; + if (animationState_1._fadeState < 1 && + animationState_1.layer === animationConfig.layer && + animationState_1.animationData === animationData) { + return animationState_1; + } + } + } + if (this._animationStates.length === 0) { + animationConfig.fadeInTime = 0.0; + } + else if (animationConfig.fadeInTime < 0.0) { + animationConfig.fadeInTime = animationData.fadeInTime; + } + if (animationConfig.fadeOutTime < 0.0) { + animationConfig.fadeOutTime = animationConfig.fadeInTime; + } + if (animationConfig.timeScale <= -100.0) { + animationConfig.timeScale = 1.0 / animationData.scale; + } + if (animationData.frameCount > 0) { + if (animationConfig.position < 0.0) { + animationConfig.position %= animationData.duration; + animationConfig.position = animationData.duration - animationConfig.position; + } + else if (animationConfig.position === animationData.duration) { + animationConfig.position -= 0.000001; // Play a little time before end. + } + else if (animationConfig.position > animationData.duration) { + animationConfig.position %= animationData.duration; + } + if (animationConfig.duration > 0.0 && animationConfig.position + animationConfig.duration > animationData.duration) { + animationConfig.duration = animationData.duration - animationConfig.position; + } + if (animationConfig.playTimes < 0) { + animationConfig.playTimes = animationData.playTimes; + } + } + else { + animationConfig.playTimes = 1; + animationConfig.position = 0.0; + if (animationConfig.duration > 0.0) { + animationConfig.duration = 0.0; + } + } + if (animationConfig.duration === 0.0) { + animationConfig.duration = -1.0; + } + this._fadeOut(animationConfig); + // + var animationState = dragonBones.BaseObject.borrowObject(dragonBones.AnimationState); + animationState.init(this._armature, animationData, animationConfig); + this._animationDirty = true; + this._armature._cacheFrameIndex = -1; + if (this._animationStates.length > 0) { + var added = false; + for (var i = 0, l = this._animationStates.length; i < l; ++i) { + if (animationState.layer > this._animationStates[i].layer) { + added = true; + this._animationStates.splice(i, 0, animationState); + break; + } + else if (i !== l - 1 && animationState.layer > this._animationStates[i + 1].layer) { + added = true; + this._animationStates.splice(i + 1, 0, animationState); + break; + } + } + if (!added) { + this._animationStates.push(animationState); + } + } + else { + this._animationStates.push(animationState); + } + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { + var slot = _c[_b]; + var childArmature = slot.childArmature; + if (childArmature !== null && childArmature.inheritAnimation && + childArmature.animation.hasAnimation(animationName) && + childArmature.animation.getState(animationName) === null) { + childArmature.animation.fadeIn(animationName); // + } + } + for (var k in animationData.animationTimelines) { + var childAnimationState = this.fadeIn(k, 0.0, 1, animationState.layer, "", 5 /* Single */); + if (childAnimationState === null) { + continue; + } + var timelines = animationData.animationTimelines[k]; + childAnimationState.actionEnabled = false; + childAnimationState.resetToPose = false; + childAnimationState.stop(); + animationState.addState(childAnimationState, timelines); + // + var index = this._animationStates.indexOf(animationState); + var childIndex = this._animationStates.indexOf(childAnimationState); + if (childIndex < index) { + this._animationStates.splice(index, 1); + this._animationStates.splice(childIndex, 0, animationState); + } + } + // if (!this._armature._lockUpdate && animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. + // this._armature.advanceTime(0.0); + // } + this._lastAnimationState = animationState; + return animationState; + }; + /** + * - Play a specific animation. + * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) + * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放指定动画。 + * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.play = function (animationName, playTimes) { + if (animationName === void 0) { animationName = null; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName !== null ? animationName : ""; + if (animationName !== null && animationName.length > 0) { + this.playConfig(this._animationConfig); + } + else if (this._lastAnimationState === null) { + var defaultAnimation = this._armature.armatureData.defaultAnimation; + if (defaultAnimation !== null) { + this._animationConfig.animation = defaultAnimation.name; + this.playConfig(this._animationConfig); + } + } + else if (!this._lastAnimationState.isPlaying && !this._lastAnimationState.isCompleted) { + this._lastAnimationState.play(); + } + else { + this._animationConfig.animation = this._lastAnimationState.name; + this.playConfig(this._animationConfig); + } + return this._lastAnimationState; + }; + /** + * - Fade in a specific animation. + * @param animationName - The name of animation data. + * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) + * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) + * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) + * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 淡入播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) + * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) + * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.fadeIn = function (animationName, fadeInTime, playTimes, layer, group, fadeOutMode) { + if (fadeInTime === void 0) { fadeInTime = -1.0; } + if (playTimes === void 0) { playTimes = -1; } + if (layer === void 0) { layer = 0; } + if (group === void 0) { group = null; } + if (fadeOutMode === void 0) { fadeOutMode = 3 /* SameLayerAndGroup */; } + this._animationConfig.clear(); + this._animationConfig.fadeOutMode = fadeOutMode; + this._animationConfig.playTimes = playTimes; + this._animationConfig.layer = layer; + this._animationConfig.fadeInTime = fadeInTime; + this._animationConfig.animation = animationName; + this._animationConfig.group = group !== null ? group : ""; + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific time. + * @param animationName - The name of animation data. + * @param time - The start time point of playing. (In seconds) + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定时间开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param time - 播放开始的时间。 (以秒为单位) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByTime = function (animationName, time, playTimes) { + if (time === void 0) { time = 0.0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.position = time; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific frame. + * @param animationName - The name of animation data. + * @param frame - The start frame of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定帧开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param frame - 播放开始的帧数。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByFrame = function (animationName, frame, playTimes) { + if (frame === void 0) { frame = 0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + var animationData = animationName in this._animations ? this._animations[animationName] : null; + if (animationData !== null) { + this._animationConfig.position = animationData.frameCount > 0 ? animationData.duration * frame / animationData.frameCount : 0.0; + } + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific progress. + * @param animationName - The name of animation data. + * @param progress - The start progress value of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定进度开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param progress - 开始播放的进度。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByProgress = function (animationName, progress, playTimes) { + if (progress === void 0) { progress = 0.0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + var animationData = animationName in this._animations ? this._animations[animationName] : null; + if (animationData !== null) { + this._animationConfig.position = animationData.duration * (progress > 0.0 ? progress : 0.0); + } + return this.playConfig(this._animationConfig); + }; + /** + * - Stop a specific animation at the specific time. + * @param animationName - The name of animation data. + * @param time - The stop time. (In seconds) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定时间停止指定动画播放 + * @param animationName - 动画数据名称。 + * @param time - 停止的时间。 (以秒为单位) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByTime = function (animationName, time) { + if (time === void 0) { time = 0.0; } + var animationState = this.gotoAndPlayByTime(animationName, time, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * - Stop a specific animation at the specific frame. + * @param animationName - The name of animation data. + * @param frame - The stop frame. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定帧停止指定动画的播放 + * @param animationName - 动画数据名称。 + * @param frame - 停止的帧数。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByFrame = function (animationName, frame) { + if (frame === void 0) { frame = 0; } + var animationState = this.gotoAndPlayByFrame(animationName, frame, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * - Stop a specific animation at the specific progress. + * @param animationName - The name of animation data. + * @param progress - The stop progress value. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定的进度停止指定的动画播放。 + * @param animationName - 动画数据名称。 + * @param progress - 停止进度。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByProgress = function (animationName, progress) { + if (progress === void 0) { progress = 0.0; } + var animationState = this.gotoAndPlayByProgress(animationName, progress, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * @internal + */ + Animation.prototype.getBlendState = function (type, name, target) { + if (!(type in this._blendStates)) { + this._blendStates[type] = {}; + } + var blendStates = this._blendStates[type]; + if (!(name in blendStates)) { + var blendState = blendStates[name] = dragonBones.BaseObject.borrowObject(dragonBones.BlendState); + blendState.target = target; + } + return blendStates[name]; + }; + /** + * - Get a specific animation state. + * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取指定的动画状态。 + * @param animationName - 动画状态名称。 + * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.getState = function (animationName, layer) { + if (layer === void 0) { layer = -1; } + var i = this._animationStates.length; + while (i--) { + var animationState = this._animationStates[i]; + if (animationState.name === animationName && (layer < 0 || animationState.layer === layer)) { + return animationState; + } + } + return null; + }; + /** + * - Check whether a specific animation data is included. + * @param animationName - The name of animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含指定的动画数据 + * @param animationName - 动画数据名称。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.hasAnimation = function (animationName) { + return animationName in this._animations; + }; + /** + * - Get all the animation states. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取所有的动画状态 + * @version DragonBones 5.1 + * @language zh_CN + */ + Animation.prototype.getStates = function () { + return this._animationStates; + }; + Object.defineProperty(Animation.prototype, "isPlaying", { + /** + * - Check whether there is an animation state is playing + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否有动画状态正在播放 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (animationState.isPlaying) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "isCompleted", { + /** + * - Check whether all the animation states' playing were finished. + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否所有的动画状态均已播放完毕。 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (!animationState.isCompleted) { + return false; + } + } + return this._animationStates.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "lastAnimationName", { + /** + * - The name of the last playing animation state. + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态名称 + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._lastAnimationState !== null ? this._lastAnimationState.name : ""; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animationNames", { + /** + * - The name of all animation data + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有动画数据的名称 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._animationNames; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animations", { + /** + * - All animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有的动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._animations; + }, + set: function (value) { + if (this._animations === value) { + return; + } + this._animationNames.length = 0; + for (var k in this._animations) { + delete this._animations[k]; + } + for (var k in value) { + this._animationNames.push(k); + this._animations[k] = value[k]; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animationConfig", { + /** + * - An AnimationConfig instance that can be used quickly. + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 一个可以快速使用的动画配置实例。 + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language zh_CN + */ + get: function () { + this._animationConfig.clear(); + return this._animationConfig; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "lastAnimationState", { + /** + * - The last playing animation state + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._lastAnimationState; + }, + enumerable: true, + configurable: true + }); + return Animation; + }(dragonBones.BaseObject)); + dragonBones.Animation = Animation; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation state is generated when the animation data is played. + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画状态由播放动画数据时产生。 + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + var AnimationState = (function (_super) { + __extends(AnimationState, _super); + function AnimationState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._boneMask = []; + _this._boneTimelines = []; + _this._boneBlendTimelines = []; + _this._slotTimelines = []; + _this._slotBlendTimelines = []; + _this._constraintTimelines = []; + _this._animationTimelines = []; + _this._poseTimelines = []; + /** + * @internal + */ + _this._actionTimeline = null; // Initial value. + _this._zOrderTimeline = null; // Initial value. + return _this; + } + AnimationState.toString = function () { + return "[class dragonBones.AnimationState]"; + }; + AnimationState.prototype._onClear = function () { + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.returnToPool(); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.returnToPool(); + } + for (var _d = 0, _e = this._slotTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.returnToPool(); + } + for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.returnToPool(); + } + for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) { + var timeline = _j[_h]; + timeline.returnToPool(); + } + for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) { + var timeline = _l[_k]; + var animationState = timeline.target; + if (animationState._parent === this) { + animationState._fadeState = 1; + animationState._subFadeState = 1; + animationState._parent = null; + } + timeline.returnToPool(); + } + if (this._actionTimeline !== null) { + this._actionTimeline.returnToPool(); + } + if (this._zOrderTimeline !== null) { + this._zOrderTimeline.returnToPool(); + } + this.actionEnabled = false; + this.additive = false; + this.displayControl = false; + this.resetToPose = false; + this.blendType = 0 /* None */; + this.playTimes = 1; + this.layer = 0; + this.timeScale = 1.0; + this._weight = 1.0; + this.parameterX = 0.0; + this.parameterY = 0.0; + this.positionX = 0.0; + this.positionY = 0.0; + this.autoFadeOutTime = 0.0; + this.fadeTotalTime = 0.0; + this.name = ""; + this.group = ""; + this._timelineDirty = 2; + this._playheadState = 0; + this._fadeState = -1; + this._subFadeState = -1; + this._position = 0.0; + this._duration = 0.0; + this._fadeTime = 0.0; + this._time = 0.0; + this._fadeProgress = 0.0; + this._weightResult = 0.0; + this._boneMask.length = 0; + this._boneTimelines.length = 0; + this._boneBlendTimelines.length = 0; + this._slotTimelines.length = 0; + this._slotBlendTimelines.length = 0; + this._constraintTimelines.length = 0; + this._animationTimelines.length = 0; + this._poseTimelines.length = 0; + // this._bonePoses.clear(); + this._animationData = null; // + this._armature = null; // + this._actionTimeline = null; // + this._zOrderTimeline = null; + this._activeChildA = null; + this._activeChildB = null; + this._parent = null; + }; + AnimationState.prototype._updateTimelines = function () { + { + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + var timelineDatas = this._animationData.getConstraintTimelines(constraint.name); + if (timelineDatas !== null) { + for (var _b = 0, timelineDatas_1 = timelineDatas; _b < timelineDatas_1.length; _b++) { + var timelineData = timelineDatas_1[_b]; + switch (timelineData.type) { + case 30 /* IKConstraint */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState); + timeline.target = constraint; + timeline.init(this._armature, this, timelineData); + this._constraintTimelines.push(timeline); + break; + } + default: + break; + } + } + } + else if (this.resetToPose) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState); + timeline.target = constraint; + timeline.init(this._armature, this, null); + this._constraintTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + }; + AnimationState.prototype._updateBoneAndSlotTimelines = function () { + { + var boneTimelines = {}; + // Create bone timelines map. + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + var timelineName = timeline.target.target.name; + if (!(timelineName in boneTimelines)) { + boneTimelines[timelineName] = []; + } + boneTimelines[timelineName].push(timeline); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + var timelineName = timeline.target.target.name; + if (!(timelineName in boneTimelines)) { + boneTimelines[timelineName] = []; + } + boneTimelines[timelineName].push(timeline); + } + // + for (var _d = 0, _e = this._armature.getBones(); _d < _e.length; _d++) { + var bone = _e[_d]; + var timelineName = bone.name; + if (!this.containsBoneMask(timelineName)) { + continue; + } + if (timelineName in boneTimelines) { + delete boneTimelines[timelineName]; + } + else { + var timelineDatas = this._animationData.getBoneTimelines(timelineName); + var blendState = this._armature.animation.getBlendState(BlendState.BONE_TRANSFORM, bone.name, bone); + if (timelineDatas !== null) { + for (var _f = 0, timelineDatas_2 = timelineDatas; _f < timelineDatas_2.length; _f++) { + var timelineData = timelineDatas_2[_f]; + switch (timelineData.type) { + case 10 /* BoneAll */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 11 /* BoneTranslate */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneTranslateTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 12 /* BoneRotate */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneRotateTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 13 /* BoneScale */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneScaleTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 60 /* BoneAlpha */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.BONE_ALPHA, bone.name, bone); + timeline.init(this._armature, this, timelineData); + this._boneBlendTimelines.push(timeline); + break; + } + case 50 /* Surface */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone); + timeline.init(this._armature, this, timelineData); + this._boneBlendTimelines.push(timeline); + break; + } + default: + break; + } + } + } + else if (this.resetToPose) { + if (bone._boneData.type === 0 /* Bone */) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, null); + this._boneTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + else { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone); + timeline.init(this._armature, this, null); + this._boneBlendTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + } + for (var k in boneTimelines) { + for (var _g = 0, _h = boneTimelines[k]; _g < _h.length; _g++) { + var timeline = _h[_g]; + var index = this._boneTimelines.indexOf(timeline); + if (index >= 0) { + this._boneTimelines.splice(index, 1); + timeline.returnToPool(); + } + index = this._boneBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._boneBlendTimelines.splice(index, 1); + timeline.returnToPool(); + } + } + } + } + { + var slotTimelines = {}; + var ffdFlags = []; + // Create slot timelines map. + for (var _j = 0, _k = this._slotTimelines; _j < _k.length; _j++) { + var timeline = _k[_j]; + var timelineName = timeline.target.name; + if (!(timelineName in slotTimelines)) { + slotTimelines[timelineName] = []; + } + slotTimelines[timelineName].push(timeline); + } + for (var _l = 0, _m = this._slotBlendTimelines; _l < _m.length; _l++) { + var timeline = _m[_l]; + var timelineName = timeline.target.target.name; + if (!(timelineName in slotTimelines)) { + slotTimelines[timelineName] = []; + } + slotTimelines[timelineName].push(timeline); + } + // + for (var _o = 0, _p = this._armature.getSlots(); _o < _p.length; _o++) { + var slot = _p[_o]; + var boneName = slot.parent.name; + if (!this.containsBoneMask(boneName)) { + continue; + } + var timelineName = slot.name; + if (timelineName in slotTimelines) { + delete slotTimelines[timelineName]; + } + else { + var displayIndexFlag = false; + var colorFlag = false; + ffdFlags.length = 0; + var timelineDatas = this._animationData.getSlotTimelines(timelineName); + if (timelineDatas !== null) { + for (var _q = 0, timelineDatas_3 = timelineDatas; _q < timelineDatas_3.length; _q++) { + var timelineData = timelineDatas_3[_q]; + switch (timelineData.type) { + case 20 /* SlotDisplay */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, timelineData); + this._slotTimelines.push(timeline); + displayIndexFlag = true; + break; + } + case 23 /* SlotZIndex */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotZIndexTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_Z_INDEX, slot.name, slot); + timeline.init(this._armature, this, timelineData); + this._slotBlendTimelines.push(timeline); + break; + } + case 21 /* SlotColor */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, timelineData); + this._slotTimelines.push(timeline); + colorFlag = true; + break; + } + case 22 /* SlotDeform */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot); + timeline.init(this._armature, this, timelineData); + if (timeline.target !== null) { + this._slotBlendTimelines.push(timeline); + ffdFlags.push(timeline.geometryOffset); + } + else { + timeline.returnToPool(); + } + break; + } + case 24 /* SlotAlpha */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_ALPHA, slot.name, slot); + timeline.init(this._armature, this, timelineData); + this._slotBlendTimelines.push(timeline); + break; + } + default: + break; + } + } + } + if (this.resetToPose) { + if (!displayIndexFlag) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, null); + this._slotTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + if (!colorFlag) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, null); + this._slotTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayFrame = slot.getDisplayFrameAt(i); + if (displayFrame.deformVertices.length === 0) { + continue; + } + var geometryData = displayFrame.getGeometryData(); + if (geometryData !== null && ffdFlags.indexOf(geometryData.offset) < 0) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState); + timeline.geometryOffset = geometryData.offset; // + timeline.displayFrame = displayFrame; // + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot); + timeline.init(this._armature, this, null); + this._slotBlendTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + } + } + for (var k in slotTimelines) { + for (var _r = 0, _s = slotTimelines[k]; _r < _s.length; _r++) { + var timeline = _s[_r]; + var index = this._slotTimelines.indexOf(timeline); + if (index >= 0) { + this._slotTimelines.splice(index, 1); + timeline.returnToPool(); + } + index = this._slotBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._slotBlendTimelines.splice(index, 1); + timeline.returnToPool(); + } + } + } + } + }; + AnimationState.prototype._advanceFadeTime = function (passedTime) { + var isFadeOut = this._fadeState > 0; + if (this._subFadeState < 0) { + this._subFadeState = 0; + var eventActive = this._parent === null && this.actionEnabled; + if (eventActive) { + var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN; + if (this._armature.eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = eventType; + eventObject.armature = this._armature; + eventObject.animationState = this; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + if (passedTime < 0.0) { + passedTime = -passedTime; + } + this._fadeTime += passedTime; + if (this._fadeTime >= this.fadeTotalTime) { + this._subFadeState = 1; + this._fadeProgress = isFadeOut ? 0.0 : 1.0; + } + else if (this._fadeTime > 0.0) { + this._fadeProgress = isFadeOut ? (1.0 - this._fadeTime / this.fadeTotalTime) : (this._fadeTime / this.fadeTotalTime); + } + else { + this._fadeProgress = isFadeOut ? 1.0 : 0.0; + } + if (this._subFadeState > 0) { + if (!isFadeOut) { + this._playheadState |= 1; // x1 + this._fadeState = 0; + } + var eventActive = this._parent === null && this.actionEnabled; + if (eventActive) { + var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE; + if (this._armature.eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = eventType; + eventObject.armature = this._armature; + eventObject.animationState = this; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + }; + /** + * @internal + */ + AnimationState.prototype.init = function (armature, animationData, animationConfig) { + if (this._armature !== null) { + return; + } + this._armature = armature; + this._animationData = animationData; + // + this.resetToPose = animationConfig.resetToPose; + this.additive = animationConfig.additive; + this.displayControl = animationConfig.displayControl; + this.actionEnabled = animationConfig.actionEnabled; + this.blendType = animationData.blendType; + this.layer = animationConfig.layer; + this.playTimes = animationConfig.playTimes; + this.timeScale = animationConfig.timeScale; + this.fadeTotalTime = animationConfig.fadeInTime; + this.autoFadeOutTime = animationConfig.autoFadeOutTime; + this.name = animationConfig.name.length > 0 ? animationConfig.name : animationConfig.animation; + this.group = animationConfig.group; + // + this._weight = animationConfig.weight; + if (animationConfig.pauseFadeIn) { + this._playheadState = 2; // 10 + } + else { + this._playheadState = 3; // 11 + } + if (animationConfig.duration < 0.0) { + this._position = 0.0; + this._duration = this._animationData.duration; + if (animationConfig.position !== 0.0) { + if (this.timeScale >= 0.0) { + this._time = animationConfig.position; + } + else { + this._time = animationConfig.position - this._duration; + } + } + else { + this._time = 0.0; + } + } + else { + this._position = animationConfig.position; + this._duration = animationConfig.duration; + this._time = 0.0; + } + if (this.timeScale < 0.0 && this._time === 0.0) { + this._time = -0.000001; // Turn to end. + } + if (this.fadeTotalTime <= 0.0) { + this._fadeProgress = 0.999999; // Make different. + } + if (animationConfig.boneMask.length > 0) { + this._boneMask.length = animationConfig.boneMask.length; + for (var i = 0, l = this._boneMask.length; i < l; ++i) { + this._boneMask[i] = animationConfig.boneMask[i]; + } + } + this._actionTimeline = dragonBones.BaseObject.borrowObject(dragonBones.ActionTimelineState); + this._actionTimeline.init(this._armature, this, this._animationData.actionTimeline); + this._actionTimeline.currentTime = this._time; + if (this._actionTimeline.currentTime < 0.0) { + this._actionTimeline.currentTime = this._duration - this._actionTimeline.currentTime; + } + if (this._animationData.zOrderTimeline !== null) { + this._zOrderTimeline = dragonBones.BaseObject.borrowObject(dragonBones.ZOrderTimelineState); + this._zOrderTimeline.init(this._armature, this, this._animationData.zOrderTimeline); + } + }; + /** + * @internal + */ + AnimationState.prototype.advanceTime = function (passedTime, cacheFrameRate) { + // Update fade time. + if (this._fadeState !== 0 || this._subFadeState !== 0) { + this._advanceFadeTime(passedTime); + } + // Update time. + if (this._playheadState === 3) { + if (this.timeScale !== 1.0) { + passedTime *= this.timeScale; + } + this._time += passedTime; + } + // Update timeline. + if (this._timelineDirty !== 0) { + if (this._timelineDirty === 2) { + this._updateTimelines(); + } + this._timelineDirty = 0; + this._updateBoneAndSlotTimelines(); + } + var isBlendDirty = this._fadeState !== 0 || this._subFadeState === 0; + var isCacheEnabled = this._fadeState === 0 && cacheFrameRate > 0.0; + var isUpdateTimeline = true; + var isUpdateBoneTimeline = true; + var time = this._time; + this._weightResult = this._weight * this._fadeProgress; + if (this._parent !== null) { + this._weightResult *= this._parent._weightResult; + } + if (this._actionTimeline.playState <= 0) { + this._actionTimeline.update(time); + } + if (this._weight === 0.0) { + return; + } + if (isCacheEnabled) { + var internval = cacheFrameRate * 2.0; + this._actionTimeline.currentTime = Math.floor(this._actionTimeline.currentTime * internval) / internval; + } + if (this._zOrderTimeline !== null && this._zOrderTimeline.playState <= 0) { + this._zOrderTimeline.update(time); + } + if (isCacheEnabled) { + var cacheFrameIndex = Math.floor(this._actionTimeline.currentTime * cacheFrameRate); // uint + if (this._armature._cacheFrameIndex === cacheFrameIndex) { + isUpdateTimeline = false; + isUpdateBoneTimeline = false; + } + else { + this._armature._cacheFrameIndex = cacheFrameIndex; + if (this._animationData.cachedFrames[cacheFrameIndex]) { + isUpdateBoneTimeline = false; + } + else { + this._animationData.cachedFrames[cacheFrameIndex] = true; + } + } + } + if (isUpdateTimeline) { + var isBlend = false; + var prevTarget = null; // + if (isUpdateBoneTimeline) { + for (var i = 0, l = this._boneTimelines.length; i < l; ++i) { + var timeline = this._boneTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (timeline.target !== prevTarget) { + var blendState = timeline.target; + isBlend = blendState.update(this); + prevTarget = blendState; + if (blendState.dirty === 1) { + var pose = blendState.target.animationPose; + pose.x = 0.0; + pose.y = 0.0; + pose.rotation = 0.0; + pose.skew = 0.0; + pose.scaleX = 1.0; + pose.scaleY = 1.0; + } + } + if (isBlend) { + timeline.blend(isBlendDirty); + } + } + } + for (var i = 0, l = this._boneBlendTimelines.length; i < l; ++i) { + var timeline = this._boneBlendTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (timeline.target.update(this)) { + timeline.blend(isBlendDirty); + } + } + if (this.displayControl) { + for (var i = 0, l = this._slotTimelines.length; i < l; ++i) { + var timeline = this._slotTimelines[i]; + if (timeline.playState <= 0) { + var slot = timeline.target; + var displayController = slot.displayController; + if (displayController === null || + displayController === this.name || + displayController === this.group) { + timeline.update(time); + } + } + } + } + for (var i = 0, l = this._slotBlendTimelines.length; i < l; ++i) { + var timeline = this._slotBlendTimelines[i]; + if (timeline.playState <= 0) { + var blendState = timeline.target; + timeline.update(time); + if (blendState.update(this)) { + timeline.blend(isBlendDirty); + } + } + } + for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) { + var timeline = this._constraintTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + } + if (this._animationTimelines.length > 0) { + var dL = 100.0; + var dR = 100.0; + var leftState = null; + var rightState = null; + for (var i = 0, l = this._animationTimelines.length; i < l; ++i) { + var timeline = this._animationTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (this.blendType === 1 /* E1D */) { + var animationState = timeline.target; + var d = this.parameterX - animationState.positionX; + if (d >= 0.0) { + if (d < dL) { + dL = d; + leftState = animationState; + } + } + else { + if (-d < dR) { + dR = -d; + rightState = animationState; + } + } + } + } + if (leftState !== null) { + if (this._activeChildA !== leftState) { + if (this._activeChildA !== null) { + this._activeChildA.weight = 0.0; + } + this._activeChildA = leftState; + this._activeChildA.activeTimeline(); + } + if (this._activeChildB !== rightState) { + if (this._activeChildB !== null) { + this._activeChildB.weight = 0.0; + } + this._activeChildB = rightState; + } + leftState.weight = dR / (dL + dR); + if (rightState) { + rightState.weight = 1.0 - leftState.weight; + } + } + } + } + if (this._fadeState === 0) { + if (this._subFadeState > 0) { + this._subFadeState = 0; + if (this._poseTimelines.length > 0) { + for (var _i = 0, _a = this._poseTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + var index = this._boneTimelines.indexOf(timeline); + if (index >= 0) { + this._boneTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._boneBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._boneBlendTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._slotTimelines.indexOf(timeline); + if (index >= 0) { + this._slotTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._slotBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._slotBlendTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._constraintTimelines.indexOf(timeline); + if (index >= 0) { + this._constraintTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + } + this._poseTimelines.length = 0; + } + } + if (this._actionTimeline.playState > 0) { + if (this.autoFadeOutTime >= 0.0) { + this.fadeOut(this.autoFadeOutTime); + } + } + } + }; + /** + * - Continue play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 继续播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.play = function () { + this._playheadState = 3; // 11 + }; + /** + * - Stop play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.stop = function () { + this._playheadState &= 1; // 0x + }; + /** + * - Fade out the animation state. + * @param fadeOutTime - The fade out time. (In seconds) + * @param pausePlayhead - Whether to pause the animation playing when fade out. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 淡出动画状态。 + * @param fadeOutTime - 淡出时间。 (以秒为单位) + * @param pausePlayhead - 淡出时是否暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.fadeOut = function (fadeOutTime, pausePlayhead) { + if (pausePlayhead === void 0) { pausePlayhead = true; } + if (fadeOutTime < 0.0) { + fadeOutTime = 0.0; + } + if (pausePlayhead) { + this._playheadState &= 2; // x0 + } + if (this._fadeState > 0) { + if (fadeOutTime > this.fadeTotalTime - this._fadeTime) { + return; + } + } + else { + this._fadeState = 1; + this._subFadeState = -1; + if (fadeOutTime <= 0.0 || this._fadeProgress <= 0.0) { + this._fadeProgress = 0.000001; // Modify fade progress to different value. + } + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.fadeOut(); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.fadeOut(); + } + for (var _d = 0, _e = this._slotTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.fadeOut(); + } + for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.fadeOut(); + } + for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) { + var timeline = _j[_h]; + timeline.fadeOut(); + } + for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) { + var timeline = _l[_k]; + timeline.fadeOut(); + // + var animaitonState = timeline.target; + animaitonState.fadeOut(999999.0, true); + } + } + this.displayControl = false; // + this.fadeTotalTime = this._fadeProgress > 0.000001 ? fadeOutTime / this._fadeProgress : 0.0; + this._fadeTime = this.fadeTotalTime * (1.0 - this._fadeProgress); + }; + /** + * - Check if a specific bone mask is included. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.containsBoneMask = function (boneName) { + return this._boneMask.length === 0 || this._boneMask.indexOf(boneName) >= 0; + }; + /** + * - Add a specific bone mask. + * @param boneName - The bone name. + * @param recursive - Whether or not to add a mask to the bone's sub-bone. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加特定的骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.addBoneMask = function (boneName, recursive) { + if (recursive === void 0) { recursive = true; } + var currentBone = this._armature.getBone(boneName); + if (currentBone === null) { + return; + } + if (this._boneMask.indexOf(boneName) < 0) { + this._boneMask.push(boneName); + } + if (recursive) { + for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { + var bone = _a[_i]; + if (this._boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) { + this._boneMask.push(bone.name); + } + } + } + this._timelineDirty = 1; + }; + /** + * - Remove the mask of a specific bone. + * @param boneName - The bone name. + * @param recursive - Whether to remove the bone's sub-bone mask. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除特定骨骼的遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.removeBoneMask = function (boneName, recursive) { + if (recursive === void 0) { recursive = true; } + var index = this._boneMask.indexOf(boneName); + if (index >= 0) { + this._boneMask.splice(index, 1); + } + if (recursive) { + var currentBone = this._armature.getBone(boneName); + if (currentBone !== null) { + var bones = this._armature.getBones(); + if (this._boneMask.length > 0) { + for (var _i = 0, bones_1 = bones; _i < bones_1.length; _i++) { + var bone = bones_1[_i]; + var index_1 = this._boneMask.indexOf(bone.name); + if (index_1 >= 0 && currentBone.contains(bone)) { + this._boneMask.splice(index_1, 1); + } + } + } + else { + for (var _a = 0, bones_2 = bones; _a < bones_2.length; _a++) { + var bone = bones_2[_a]; + if (bone === currentBone) { + continue; + } + if (!currentBone.contains(bone)) { + this._boneMask.push(bone.name); + } + } + } + } + } + this._timelineDirty = 1; + }; + /** + * - Remove all bone masks. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.removeAllBoneMask = function () { + this._boneMask.length = 0; + this._timelineDirty = 1; + }; + /** + * @private + */ + AnimationState.prototype.addState = function (animationState, timelineDatas) { + if (timelineDatas === void 0) { timelineDatas = null; } + if (timelineDatas !== null) { + for (var _i = 0, timelineDatas_4 = timelineDatas; _i < timelineDatas_4.length; _i++) { + var timelineData = timelineDatas_4[_i]; + switch (timelineData.type) { + case 40 /* AnimationProgress */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationProgressTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + if (this.blendType !== 0 /* None */) { + var animaitonTimelineData = timelineData; + animationState.positionX = animaitonTimelineData.x; + animationState.positionY = animaitonTimelineData.y; + animationState.weight = 0.0; + } + animationState._parent = this; + this.resetToPose = false; + break; + } + case 41 /* AnimationWeight */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationWeightTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + break; + } + case 42 /* AnimationParameter */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationParametersTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + break; + } + default: + break; + } + } + } + if (animationState._parent === null) { + animationState._parent = this; + } + }; + /** + * @internal + */ + AnimationState.prototype.activeTimeline = function () { + for (var _i = 0, _a = this._slotTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.dirty = true; + timeline.currentTime = -1.0; + } + }; + Object.defineProperty(AnimationState.prototype, "isFadeIn", { + /** + * - Whether the animation state is fading in. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡入。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState < 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isFadeOut", { + /** + * - Whether the animation state is fading out. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡出。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isFadeComplete", { + /** + * - Whether the animation state is fade completed. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否淡入或淡出完毕。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState === 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isPlaying", { + /** + * - Whether the animation state is playing. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否正在播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return (this._playheadState & 2) !== 0 && this._actionTimeline.playState <= 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isCompleted", { + /** + * - Whether the animation state is play completed. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否播放完毕。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.playState > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "currentPlayTimes", { + /** + * - The times has been played. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 已经循环播放的次数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.currentPlayTimes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "totalTime", { + /** + * - The total time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 总播放时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._duration; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "currentTime", { + /** + * - The time is currently playing. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前播放的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.currentTime; + }, + set: function (value) { + var currentPlayTimes = this._actionTimeline.currentPlayTimes - (this._actionTimeline.playState > 0 ? 1 : 0); + if (value < 0 || this._duration < value) { + value = (value % this._duration) + currentPlayTimes * this._duration; + if (value < 0) { + value += this._duration; + } + } + if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 && + value === this._duration && this._parent === null) { + value = this._duration - 0.000001; // + } + if (this._time === value) { + return; + } + this._time = value; + this._actionTimeline.setCurrentTime(this._time); + if (this._zOrderTimeline !== null) { + this._zOrderTimeline.playState = -1; + } + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.playState = -1; + } + for (var _b = 0, _c = this._slotTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.playState = -1; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "weight", { + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + /** + * - The animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + get: function () { + return this._weight; + }, + set: function (value) { + if (this._weight === value) { + return; + } + this._weight = value; + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.dirty = true; + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.dirty = true; + } + for (var _d = 0, _e = this._slotBlendTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.dirty = true; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "animationData", { + /** + * - 动画数据。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._animationData; + }, + enumerable: true, + configurable: true + }); + return AnimationState; + }(dragonBones.BaseObject)); + dragonBones.AnimationState = AnimationState; + /** + * @internal + */ + var BlendState = (function (_super) { + __extends(BlendState, _super); + function BlendState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlendState.toString = function () { + return "[class dragonBones.BlendState]"; + }; + BlendState.prototype._onClear = function () { + this.reset(); + this.target = null; + }; + BlendState.prototype.update = function (animationState) { + var animationLayer = animationState.layer; + var animationWeight = animationState._weightResult; + if (this.dirty > 0) { + if (this.leftWeight > 0.0) { + if (this.layer !== animationLayer) { + if (this.layerWeight >= this.leftWeight) { + this.dirty++; + this.layer = animationLayer; + this.leftWeight = 0.0; + this.blendWeight = 0.0; + return false; + } + this.layer = animationLayer; + this.leftWeight -= this.layerWeight; + this.layerWeight = 0.0; + } + animationWeight *= this.leftWeight; + this.dirty++; + this.blendWeight = animationWeight; + this.layerWeight += this.blendWeight; + return true; + } + return false; + } + this.dirty++; + this.layer = animationLayer; + this.leftWeight = 1.0; + this.blendWeight = animationWeight; + this.layerWeight = animationWeight; + return true; + }; + BlendState.prototype.reset = function () { + this.dirty = 0; + this.layer = 0; + this.leftWeight = 0.0; + this.layerWeight = 0.0; + this.blendWeight = 0.0; + }; + BlendState.BONE_TRANSFORM = "boneTransform"; + BlendState.BONE_ALPHA = "boneAlpha"; + BlendState.SURFACE = "surface"; + BlendState.SLOT_DEFORM = "slotDeform"; + BlendState.SLOT_ALPHA = "slotAlpha"; + BlendState.SLOT_Z_INDEX = "slotZIndex"; + return BlendState; + }(dragonBones.BaseObject)); + dragonBones.BlendState = BlendState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var TimelineState = (function (_super) { + __extends(TimelineState, _super); + function TimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimelineState.prototype._onClear = function () { + this.dirty = false; + this.playState = -1; + this.currentPlayTimes = -1; + this.currentTime = -1.0; + this.target = null; + this._isTween = false; + this._valueOffset = 0; + this._frameValueOffset = 0; + this._frameOffset = 0; + this._frameRate = 0; + this._frameCount = 0; + this._frameIndex = -1; + this._frameRateR = 0.0; + this._position = 0.0; + this._duration = 0.0; + this._timeScale = 1.0; + this._timeOffset = 0.0; + this._animationData = null; // + this._timelineData = null; // + this._armature = null; // + this._animationState = null; // + this._actionTimeline = null; // + this._frameArray = null; // + this._valueArray = null; // + this._timelineArray = null; // + this._frameIndices = null; // + }; + TimelineState.prototype._setCurrentTime = function (passedTime) { + var prevState = this.playState; + var prevPlayTimes = this.currentPlayTimes; + var prevTime = this.currentTime; + if (this._actionTimeline !== null && this._frameCount <= 1) { + this.playState = this._actionTimeline.playState >= 0 ? 1 : -1; + this.currentPlayTimes = 1; + this.currentTime = this._actionTimeline.currentTime; + } + else if (this._actionTimeline === null || this._timeScale !== 1.0 || this._timeOffset !== 0.0) { + var playTimes = this._animationState.playTimes; + var totalTime = playTimes * this._duration; + passedTime *= this._timeScale; + if (this._timeOffset !== 0.0) { + passedTime += this._timeOffset * this._animationData.duration; + } + if (playTimes > 0 && (passedTime >= totalTime || passedTime <= -totalTime)) { + if (this.playState <= 0 && this._animationState._playheadState === 3) { + this.playState = 1; + } + this.currentPlayTimes = playTimes; + if (passedTime < 0.0) { + this.currentTime = 0.0; + } + else { + this.currentTime = this.playState === 1 ? this._duration + 0.000001 : this._duration; // Precision problem + } + } + else { + if (this.playState !== 0 && this._animationState._playheadState === 3) { + this.playState = 0; + } + if (passedTime < 0.0) { + passedTime = -passedTime; + this.currentPlayTimes = Math.floor(passedTime / this._duration); + this.currentTime = this._duration - (passedTime % this._duration); + } + else { + this.currentPlayTimes = Math.floor(passedTime / this._duration); + this.currentTime = passedTime % this._duration; + } + } + this.currentTime += this._position; + } + else { + this.playState = this._actionTimeline.playState; + this.currentPlayTimes = this._actionTimeline.currentPlayTimes; + this.currentTime = this._actionTimeline.currentTime; + } + if (this.currentPlayTimes === prevPlayTimes && this.currentTime === prevTime) { + return false; + } + // Clear frame flag when timeline start or loopComplete. + if ((prevState < 0 && this.playState !== prevState) || + (this.playState <= 0 && this.currentPlayTimes !== prevPlayTimes)) { + this._frameIndex = -1; + } + return true; + }; + TimelineState.prototype.init = function (armature, animationState, timelineData) { + this._armature = armature; + this._animationState = animationState; + this._timelineData = timelineData; + this._actionTimeline = this._animationState._actionTimeline; + if (this === this._actionTimeline) { + this._actionTimeline = null; // + } + this._animationData = this._animationState.animationData; + // + this._frameRate = this._animationData.parent.frameRate; + this._frameRateR = 1.0 / this._frameRate; + this._position = this._animationState._position; + this._duration = this._animationState._duration; + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data. + this._frameArray = dragonBonesData.frameArray; + this._timelineArray = dragonBonesData.timelineArray; + this._frameIndices = dragonBonesData.frameIndices; + // + this._frameCount = this._timelineArray[this._timelineData.offset + 2 /* TimelineKeyFrameCount */]; + this._frameValueOffset = this._timelineArray[this._timelineData.offset + 4 /* TimelineFrameValueOffset */]; + this._timeScale = 100.0 / this._timelineArray[this._timelineData.offset + 0 /* TimelineScale */]; + this._timeOffset = this._timelineArray[this._timelineData.offset + 1 /* TimelineOffset */] * 0.01; + } + }; + TimelineState.prototype.fadeOut = function () { + this.dirty = false; + }; + TimelineState.prototype.update = function (passedTime) { + if (this._setCurrentTime(passedTime)) { + if (this._frameCount > 1) { + var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint + var frameIndex = this._frameIndices[this._timelineData.frameIndicesOffset + timelineFrameIndex]; + if (this._frameIndex !== frameIndex) { + this._frameIndex = frameIndex; + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex]; + this._onArriveAtFrame(); + } + } + else if (this._frameIndex < 0) { + this._frameIndex = 0; + if (this._timelineData !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */]; + } + this._onArriveAtFrame(); + } + if (this._isTween || this.dirty) { + this._onUpdateFrame(); + } + } + }; + TimelineState.prototype.blend = function (_isDirty) { + }; + return TimelineState; + }(dragonBones.BaseObject)); + dragonBones.TimelineState = TimelineState; + /** + * @internal + */ + var TweenTimelineState = (function (_super) { + __extends(TweenTimelineState, _super); + function TweenTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + TweenTimelineState._getEasingValue = function (tweenType, progress, easing) { + var value = progress; + switch (tweenType) { + case 3 /* QuadIn */: + value = Math.pow(progress, 2.0); + break; + case 4 /* QuadOut */: + value = 1.0 - Math.pow(1.0 - progress, 2.0); + break; + case 5 /* QuadInOut */: + value = 0.5 * (1.0 - Math.cos(progress * Math.PI)); + break; + } + return (value - progress) * easing + progress; + }; + TweenTimelineState._getEasingCurveValue = function (progress, samples, count, offset) { + if (progress <= 0.0) { + return 0.0; + } + else if (progress >= 1.0) { + return 1.0; + } + var isOmited = count > 0; + var segmentCount = count + 1; // + 2 - 1 + var valueIndex = Math.floor(progress * segmentCount); + var fromValue = 0.0; + var toValue = 0.0; + if (isOmited) { + fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1]; + toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex]; + } + else { + fromValue = samples[offset + valueIndex - 1]; + toValue = samples[offset + valueIndex]; + } + return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001; + }; + TweenTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._tweenType = 0 /* None */; + this._curveCount = 0; + this._framePosition = 0.0; + this._frameDurationR = 0.0; + this._tweenEasing = 0.0; + this._tweenProgress = 0.0; + this._valueScale = 1.0; + }; + TweenTimelineState.prototype._onArriveAtFrame = function () { + if (this._frameCount > 1 && + (this._frameIndex !== this._frameCount - 1 || + this._animationState.playTimes === 0 || + this._animationState.currentPlayTimes < this._animationState.playTimes - 1)) { + this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */]; + this._isTween = this._tweenType !== 0 /* None */; + if (this._isTween) { + if (this._tweenType === 2 /* Curve */) { + this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */]; + } + else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) { + this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01; + } + } + else { + this.dirty = true; + } + this._framePosition = this._frameArray[this._frameOffset] * this._frameRateR; + if (this._frameIndex === this._frameCount - 1) { + this._frameDurationR = 1.0 / (this._animationData.duration - this._framePosition); + } + else { + var nextFrameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex + 1]; + var frameDuration = this._frameArray[nextFrameOffset] * this._frameRateR - this._framePosition; + if (frameDuration > 0) { + this._frameDurationR = 1.0 / frameDuration; + } + else { + this._frameDurationR = 0.0; + } + } + } + else { + this.dirty = true; + this._isTween = false; + } + }; + TweenTimelineState.prototype._onUpdateFrame = function () { + if (this._isTween) { + this.dirty = true; + this._tweenProgress = (this.currentTime - this._framePosition) * this._frameDurationR; + if (this._tweenType === 2 /* Curve */) { + this._tweenProgress = TweenTimelineState._getEasingCurveValue(this._tweenProgress, this._frameArray, this._curveCount, this._frameOffset + 3 /* FrameCurveSamples */); + } + else if (this._tweenType !== 1 /* Line */) { + this._tweenProgress = TweenTimelineState._getEasingValue(this._tweenType, this._tweenProgress, this._tweenEasing); + } + } + }; + return TweenTimelineState; + }(TimelineState)); + dragonBones.TweenTimelineState = TweenTimelineState; + /** + * @internal + */ + var SingleValueTimelineState = (function (_super) { + __extends(SingleValueTimelineState, _super); + function SingleValueTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SingleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._current = 0.0; + this._difference = 0.0; + this._result = 0.0; + }; + SingleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + 1; + if (valueScale === 1.0) { + this._current = valueArray[valueOffset]; + this._difference = valueArray[nextValueOffset] - this._current; + } + else { + this._current = valueArray[valueOffset] * valueScale; + this._difference = valueArray[nextValueOffset] * valueScale - this._current; + } + } + else { + this._result = valueArray[valueOffset] * valueScale; + } + } + else { + this._result = 0.0; + } + }; + SingleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._result = this._current + this._difference * this._tweenProgress; + } + }; + return SingleValueTimelineState; + }(TweenTimelineState)); + dragonBones.SingleValueTimelineState = SingleValueTimelineState; + /** + * @internal + */ + var DoubleValueTimelineState = (function (_super) { + __extends(DoubleValueTimelineState, _super); + function DoubleValueTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + DoubleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._currentA = 0.0; + this._currentB = 0.0; + this._differenceA = 0.0; + this._differenceB = 0.0; + this._resultA = 0.0; + this._resultB = 0.0; + }; + DoubleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * 2; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + 2; + if (valueScale === 1.0) { + this._currentA = valueArray[valueOffset]; + this._currentB = valueArray[valueOffset + 1]; + this._differenceA = valueArray[nextValueOffset] - this._currentA; + this._differenceB = valueArray[nextValueOffset + 1] - this._currentB; + } + else { + this._currentA = valueArray[valueOffset] * valueScale; + this._currentB = valueArray[valueOffset + 1] * valueScale; + this._differenceA = valueArray[nextValueOffset] * valueScale - this._currentA; + this._differenceB = valueArray[nextValueOffset + 1] * valueScale - this._currentB; + } + } + else { + this._resultA = valueArray[valueOffset] * valueScale; + this._resultB = valueArray[valueOffset + 1] * valueScale; + } + } + else { + this._resultA = 0.0; + this._resultB = 0.0; + } + }; + DoubleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._resultA = this._currentA + this._differenceA * this._tweenProgress; + this._resultB = this._currentB + this._differenceB * this._tweenProgress; + } + }; + return DoubleValueTimelineState; + }(TweenTimelineState)); + dragonBones.DoubleValueTimelineState = DoubleValueTimelineState; + /** + * @internal + */ + var MutilpleValueTimelineState = (function (_super) { + __extends(MutilpleValueTimelineState, _super); + function MutilpleValueTimelineState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._rd = []; + return _this; + } + MutilpleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._valueCount = 0; + this._rd.length = 0; + }; + MutilpleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + var valueCount = this._valueCount; + var rd = this._rd; + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + valueCount; + if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[valueCount + i] = valueArray[nextValueOffset + i] - valueArray[valueOffset + i]; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[valueCount + i] = (valueArray[nextValueOffset + i] - valueArray[valueOffset + i]) * valueScale; + } + } + } + else if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i]; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] * valueScale; + } + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = 0.0; + } + } + }; + MutilpleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + var valueCount = this._valueCount; + var valueScale = this._valueScale; + var tweenProgress = this._tweenProgress; + var valueArray = this._valueArray; + var rd = this._rd; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount; + if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] + rd[valueCount + i] * tweenProgress; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] * valueScale + rd[valueCount + i] * tweenProgress; + } + } + } + }; + return MutilpleValueTimelineState; + }(TweenTimelineState)); + dragonBones.MutilpleValueTimelineState = MutilpleValueTimelineState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var ActionTimelineState = (function (_super) { + __extends(ActionTimelineState, _super); + function ActionTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + ActionTimelineState.toString = function () { + return "[class dragonBones.ActionTimelineState]"; + }; + ActionTimelineState.prototype._onCrossFrame = function (frameIndex) { + var eventDispatcher = this._armature.eventDispatcher; + if (this._animationState.actionEnabled) { + var frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + frameIndex]; + var actionCount = this._frameArray[frameOffset + 1]; + var actions = this._animationData.parent.actions; // May be the animaton data not belong to this armature data. + for (var i = 0; i < actionCount; ++i) { + var actionIndex = this._frameArray[frameOffset + 2 + i]; + var action = actions[actionIndex]; + if (action.type === 0 /* Play */) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + // eventObject.time = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + eventObject.time = this._frameArray[frameOffset] / this._frameRate; + eventObject.animationState = this._animationState; + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + this._armature._bufferAction(eventObject, true); + } + else { + var eventType = action.type === 10 /* Frame */ ? dragonBones.EventObject.FRAME_EVENT : dragonBones.EventObject.SOUND_EVENT; + if (action.type === 11 /* Sound */ || eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + // eventObject.time = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + eventObject.time = this._frameArray[frameOffset] / this._frameRate; + eventObject.animationState = this._animationState; + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + } + }; + ActionTimelineState.prototype._onArriveAtFrame = function () { }; + ActionTimelineState.prototype._onUpdateFrame = function () { }; + ActionTimelineState.prototype.update = function (passedTime) { + var prevState = this.playState; + var prevPlayTimes = this.currentPlayTimes; + var prevTime = this.currentTime; + if (this._setCurrentTime(passedTime)) { + var eventActive = this._animationState._parent === null && this._animationState.actionEnabled; + var eventDispatcher = this._armature.eventDispatcher; + if (prevState < 0) { + if (this.playState !== prevState) { + if (this._animationState.displayControl && this._animationState.resetToPose) { + this._armature._sortZOrder(null, 0); + } + prevPlayTimes = this.currentPlayTimes; + if (eventActive && eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = dragonBones.EventObject.START; + eventObject.armature = this._armature; + eventObject.animationState = this._animationState; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + else { + return; + } + } + var isReverse = this._animationState.timeScale < 0.0; + var loopCompleteEvent = null; + var completeEvent = null; + if (eventActive && this.currentPlayTimes !== prevPlayTimes) { + if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.LOOP_COMPLETE)) { + loopCompleteEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + loopCompleteEvent.type = dragonBones.EventObject.LOOP_COMPLETE; + loopCompleteEvent.armature = this._armature; + loopCompleteEvent.animationState = this._animationState; + } + if (this.playState > 0) { + if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.COMPLETE)) { + completeEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + completeEvent.type = dragonBones.EventObject.COMPLETE; + completeEvent.armature = this._armature; + completeEvent.animationState = this._animationState; + } + } + } + if (this._frameCount > 1) { + var timelineData = this._timelineData; + var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint + var frameIndex = this._frameIndices[timelineData.frameIndicesOffset + timelineFrameIndex]; + if (this._frameIndex !== frameIndex) { + var crossedFrameIndex = this._frameIndex; + this._frameIndex = frameIndex; + if (this._timelineArray !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex]; + if (isReverse) { + if (crossedFrameIndex < 0) { + var prevFrameIndex = Math.floor(prevTime * this._frameRate); + crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex]; + if (this.currentPlayTimes === prevPlayTimes) { + if (crossedFrameIndex === frameIndex) { + crossedFrameIndex = -1; + } + } + } + while (crossedFrameIndex >= 0) { + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this._position <= framePosition && + framePosition <= this._position + this._duration) { + this._onCrossFrame(crossedFrameIndex); + } + if (loopCompleteEvent !== null && crossedFrameIndex === 0) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + if (crossedFrameIndex > 0) { + crossedFrameIndex--; + } + else { + crossedFrameIndex = this._frameCount - 1; + } + if (crossedFrameIndex === frameIndex) { + break; + } + } + } + else { + if (crossedFrameIndex < 0) { + var prevFrameIndex = Math.floor(prevTime * this._frameRate); + crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex]; + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this.currentPlayTimes === prevPlayTimes) { + if (prevTime <= framePosition) { + if (crossedFrameIndex > 0) { + crossedFrameIndex--; + } + else { + crossedFrameIndex = this._frameCount - 1; + } + } + else if (crossedFrameIndex === frameIndex) { + crossedFrameIndex = -1; + } + } + } + while (crossedFrameIndex >= 0) { + if (crossedFrameIndex < this._frameCount - 1) { + crossedFrameIndex++; + } + else { + crossedFrameIndex = 0; + } + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this._position <= framePosition && + framePosition <= this._position + this._duration // + ) { + this._onCrossFrame(crossedFrameIndex); + } + if (loopCompleteEvent !== null && crossedFrameIndex === 0) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + if (crossedFrameIndex === frameIndex) { + break; + } + } + } + } + } + } + else if (this._frameIndex < 0) { + this._frameIndex = 0; + if (this._timelineData !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */]; + // Arrive at frame. + var framePosition = this._frameArray[this._frameOffset] / this._frameRate; + if (this.currentPlayTimes === prevPlayTimes) { + if (prevTime <= framePosition) { + this._onCrossFrame(this._frameIndex); + } + } + else if (this._position <= framePosition) { + if (!isReverse && loopCompleteEvent !== null) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + this._onCrossFrame(this._frameIndex); + } + } + } + if (loopCompleteEvent !== null) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + } + if (completeEvent !== null) { + this._armature._dragonBones.bufferEvent(completeEvent); + } + } + }; + ActionTimelineState.prototype.setCurrentTime = function (value) { + this._setCurrentTime(value); + this._frameIndex = -1; + }; + return ActionTimelineState; + }(dragonBones.TimelineState)); + dragonBones.ActionTimelineState = ActionTimelineState; + /** + * @internal + */ + var ZOrderTimelineState = (function (_super) { + __extends(ZOrderTimelineState, _super); + function ZOrderTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + ZOrderTimelineState.toString = function () { + return "[class dragonBones.ZOrderTimelineState]"; + }; + ZOrderTimelineState.prototype._onArriveAtFrame = function () { + if (this.playState >= 0) { + var count = this._frameArray[this._frameOffset + 1]; + if (count > 0) { + this._armature._sortZOrder(this._frameArray, this._frameOffset + 2); + } + else { + this._armature._sortZOrder(null, 0); + } + } + }; + ZOrderTimelineState.prototype._onUpdateFrame = function () { }; + return ZOrderTimelineState; + }(dragonBones.TimelineState)); + dragonBones.ZOrderTimelineState = ZOrderTimelineState; + /** + * @internal + */ + var BoneAllTimelineState = (function (_super) { + __extends(BoneAllTimelineState, _super); + function BoneAllTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneAllTimelineState.toString = function () { + return "[class dragonBones.BoneAllTimelineState]"; + }; + BoneAllTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._isTween && this._frameIndex === this._frameCount - 1) { + this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]); + this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]); + } + if (this._timelineData === null) { + this._rd[4] = 1.0; + this._rd[5] = 1.0; + } + }; + BoneAllTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = 6; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneAllTimelineState.prototype.fadeOut = function () { + this.dirty = false; + this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]); + this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]); + }; + BoneAllTimelineState.prototype.blend = function (isDirty) { + var valueScale = this._armature.armatureData.scale; + var rd = this._rd; + // + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.x += rd[0] * blendWeight * valueScale; + result.y += rd[1] * blendWeight * valueScale; + result.rotation += rd[2] * blendWeight; + result.skew += rd[3] * blendWeight; + result.scaleX += (rd[4] - 1.0) * blendWeight; + result.scaleY += (rd[5] - 1.0) * blendWeight; + } + else { + result.x = rd[0] * blendWeight * valueScale; + result.y = rd[1] * blendWeight * valueScale; + result.rotation = rd[2] * blendWeight; + result.skew = rd[3] * blendWeight; + result.scaleX = (rd[4] - 1.0) * blendWeight + 1.0; // + result.scaleY = (rd[5] - 1.0) * blendWeight + 1.0; // + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneAllTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.BoneAllTimelineState = BoneAllTimelineState; + /** + * @internal + */ + var BoneTranslateTimelineState = (function (_super) { + __extends(BoneTranslateTimelineState, _super); + function BoneTranslateTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneTranslateTimelineState.toString = function () { + return "[class dragonBones.BoneTranslateTimelineState]"; + }; + BoneTranslateTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneTranslateTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.x += this._resultA * blendWeight; + result.y += this._resultB * blendWeight; + } + else if (blendWeight !== 1.0) { + result.x = this._resultA * blendWeight; + result.y = this._resultB * blendWeight; + } + else { + result.x = this._resultA; + result.y = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneTranslateTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneTranslateTimelineState = BoneTranslateTimelineState; + /** + * @internal + */ + var BoneRotateTimelineState = (function (_super) { + __extends(BoneRotateTimelineState, _super); + function BoneRotateTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneRotateTimelineState.toString = function () { + return "[class dragonBones.BoneRotateTimelineState]"; + }; + BoneRotateTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._isTween && this._frameIndex === this._frameCount - 1) { + this._differenceA = dragonBones.Transform.normalizeRadian(this._differenceA); + this._differenceB = dragonBones.Transform.normalizeRadian(this._differenceB); + } + }; + BoneRotateTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneRotateTimelineState.prototype.fadeOut = function () { + this.dirty = false; + this._resultA = dragonBones.Transform.normalizeRadian(this._resultA); + this._resultB = dragonBones.Transform.normalizeRadian(this._resultB); + }; + BoneRotateTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.rotation += this._resultA * blendWeight; + result.skew += this._resultB * blendWeight; + } + else if (blendWeight !== 1.0) { + result.rotation = this._resultA * blendWeight; + result.skew = this._resultB * blendWeight; + } + else { + result.rotation = this._resultA; + result.skew = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneRotateTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneRotateTimelineState = BoneRotateTimelineState; + /** + * @internal + */ + var BoneScaleTimelineState = (function (_super) { + __extends(BoneScaleTimelineState, _super); + function BoneScaleTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneScaleTimelineState.toString = function () { + return "[class dragonBones.BoneScaleTimelineState]"; + }; + BoneScaleTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { + this._resultA = 1.0; + this._resultB = 1.0; + } + }; + BoneScaleTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneScaleTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.scaleX += (this._resultA - 1.0) * blendWeight; + result.scaleY += (this._resultB - 1.0) * blendWeight; + } + else if (blendWeight !== 1.0) { + result.scaleX = (this._resultA - 1.0) * blendWeight + 1.0; + result.scaleY = (this._resultB - 1.0) * blendWeight + 1.0; + } + else { + result.scaleX = this._resultA; + result.scaleY = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneScaleTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneScaleTimelineState = BoneScaleTimelineState; + /** + * @internal + */ + var SurfaceTimelineState = (function (_super) { + __extends(SurfaceTimelineState, _super); + function SurfaceTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SurfaceTimelineState.toString = function () { + return "[class dragonBones.SurfaceTimelineState]"; + }; + SurfaceTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._deformCount = 0; + this._deformOffset = 0; + this._sameValueOffset = 0; + }; + SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; + var frameIntArray = dragonBonesData.frameIntArray; + var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */]; + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */]; + this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */]; + this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */]; + this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = dragonBonesData.frameFloatArray; + this._rd.length = this._valueCount * 2; + } + else { + this._deformCount = this.target.target._deformVertices.length; + } + }; + SurfaceTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var surface = blendState.target; + var blendWeight = blendState.blendWeight; + var result = surface._deformVertices; + var valueArray = this._valueArray; + if (valueArray !== null) { + var valueCount = this._valueCount; + var deformOffset = this._deformOffset; + var sameValueOffset = this._sameValueOffset; + var rd = this._rd; + for (var i = 0; i < this._deformCount; ++i) { + var value = 0.0; + if (i < deformOffset) { + value = valueArray[sameValueOffset + i]; + } + else if (i < deformOffset + valueCount) { + value = rd[i - deformOffset]; + } + else { + value = valueArray[sameValueOffset + i - valueCount]; + } + if (blendState.dirty > 1) { + result[i] += value * blendWeight; + } + else { + result[i] = value * blendWeight; + } + } + } + else if (blendState.dirty === 1) { + for (var i = 0; i < this._deformCount; ++i) { + result[i] = 0.0; + } + } + if (isDirty || this.dirty) { + this.dirty = false; + surface._transformDirty = true; + } + }; + return SurfaceTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.SurfaceTimelineState = SurfaceTimelineState; + /** + * @internal + */ + var AlphaTimelineState = (function (_super) { + __extends(AlphaTimelineState, _super); + function AlphaTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AlphaTimelineState.toString = function () { + return "[class dragonBones.AlphaTimelineState]"; + }; + AlphaTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { + this._result = 1.0; + } + }; + AlphaTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.01; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + AlphaTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var alphaTarget = blendState.target; + var blendWeight = blendState.blendWeight; + if (blendState.dirty > 1) { + alphaTarget._alpha += this._result * blendWeight; + if (alphaTarget._alpha > 1.0) { + alphaTarget._alpha = 1.0; + } + } + else { + alphaTarget._alpha = this._result * blendWeight; + } + if (isDirty || this.dirty) { + this.dirty = false; + this._armature._alphaDirty = true; + } + }; + return AlphaTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AlphaTimelineState = AlphaTimelineState; + /** + * @internal + */ + var SlotDisplayTimelineState = (function (_super) { + __extends(SlotDisplayTimelineState, _super); + function SlotDisplayTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SlotDisplayTimelineState.toString = function () { + return "[class dragonBones.SlotDisplayTimelineState]"; + }; + SlotDisplayTimelineState.prototype._onArriveAtFrame = function () { + if (this.playState >= 0) { + var slot = this.target; + var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : slot._slotData.displayIndex; + if (slot.displayIndex !== displayIndex) { + slot._setDisplayIndex(displayIndex, true); + } + } + }; + SlotDisplayTimelineState.prototype._onUpdateFrame = function () { + }; + return SlotDisplayTimelineState; + }(dragonBones.TimelineState)); + dragonBones.SlotDisplayTimelineState = SlotDisplayTimelineState; + /** + * @internal + */ + var SlotColorTimelineState = (function (_super) { + __extends(SlotColorTimelineState, _super); + function SlotColorTimelineState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._current = [0, 0, 0, 0, 0, 0, 0, 0]; + _this._difference = [0, 0, 0, 0, 0, 0, 0, 0]; + _this._result = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]; + return _this; + } + SlotColorTimelineState.toString = function () { + return "[class dragonBones.SlotColorTimelineState]"; + }; + SlotColorTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; + var colorArray = dragonBonesData.colorArray; + var frameIntArray = dragonBonesData.frameIntArray; + var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex; + var colorOffset = frameIntArray[valueOffset]; + if (colorOffset < 0) { + colorOffset += 65536; // Fixed out of bounds bug. + } + if (this._isTween) { + this._current[0] = colorArray[colorOffset++]; + this._current[1] = colorArray[colorOffset++]; + this._current[2] = colorArray[colorOffset++]; + this._current[3] = colorArray[colorOffset++]; + this._current[4] = colorArray[colorOffset++]; + this._current[5] = colorArray[colorOffset++]; + this._current[6] = colorArray[colorOffset++]; + this._current[7] = colorArray[colorOffset++]; + if (this._frameIndex === this._frameCount - 1) { + colorOffset = frameIntArray[this._animationData.frameIntOffset + this._frameValueOffset]; + } + else { + colorOffset = frameIntArray[valueOffset + 1]; + } + if (colorOffset < 0) { + colorOffset += 65536; // Fixed out of bounds bug. + } + this._difference[0] = colorArray[colorOffset++] - this._current[0]; + this._difference[1] = colorArray[colorOffset++] - this._current[1]; + this._difference[2] = colorArray[colorOffset++] - this._current[2]; + this._difference[3] = colorArray[colorOffset++] - this._current[3]; + this._difference[4] = colorArray[colorOffset++] - this._current[4]; + this._difference[5] = colorArray[colorOffset++] - this._current[5]; + this._difference[6] = colorArray[colorOffset++] - this._current[6]; + this._difference[7] = colorArray[colorOffset++] - this._current[7]; + } + else { + this._result[0] = colorArray[colorOffset++] * 0.01; + this._result[1] = colorArray[colorOffset++] * 0.01; + this._result[2] = colorArray[colorOffset++] * 0.01; + this._result[3] = colorArray[colorOffset++] * 0.01; + this._result[4] = colorArray[colorOffset++]; + this._result[5] = colorArray[colorOffset++]; + this._result[6] = colorArray[colorOffset++]; + this._result[7] = colorArray[colorOffset++]; + } + } + else { + var slot = this.target; + var color = slot.slotData.color; + this._result[0] = color.alphaMultiplier; + this._result[1] = color.redMultiplier; + this._result[2] = color.greenMultiplier; + this._result[3] = color.blueMultiplier; + this._result[4] = color.alphaOffset; + this._result[5] = color.redOffset; + this._result[6] = color.greenOffset; + this._result[7] = color.blueOffset; + } + }; + SlotColorTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._result[0] = (this._current[0] + this._difference[0] * this._tweenProgress) * 0.01; + this._result[1] = (this._current[1] + this._difference[1] * this._tweenProgress) * 0.01; + this._result[2] = (this._current[2] + this._difference[2] * this._tweenProgress) * 0.01; + this._result[3] = (this._current[3] + this._difference[3] * this._tweenProgress) * 0.01; + this._result[4] = this._current[4] + this._difference[4] * this._tweenProgress; + this._result[5] = this._current[5] + this._difference[5] * this._tweenProgress; + this._result[6] = this._current[6] + this._difference[6] * this._tweenProgress; + this._result[7] = this._current[7] + this._difference[7] * this._tweenProgress; + } + }; + SlotColorTimelineState.prototype.fadeOut = function () { + this._isTween = false; + }; + SlotColorTimelineState.prototype.update = function (passedTime) { + _super.prototype.update.call(this, passedTime); + // Fade animation. + if (this._isTween || this.dirty) { + var slot = this.target; + var result = slot._colorTransform; + if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) { + if (result.alphaMultiplier !== this._result[0] || + result.redMultiplier !== this._result[1] || + result.greenMultiplier !== this._result[2] || + result.blueMultiplier !== this._result[3] || + result.alphaOffset !== this._result[4] || + result.redOffset !== this._result[5] || + result.greenOffset !== this._result[6] || + result.blueOffset !== this._result[7]) { + var fadeProgress = Math.pow(this._animationState._fadeProgress, 4); + result.alphaMultiplier += (this._result[0] - result.alphaMultiplier) * fadeProgress; + result.redMultiplier += (this._result[1] - result.redMultiplier) * fadeProgress; + result.greenMultiplier += (this._result[2] - result.greenMultiplier) * fadeProgress; + result.blueMultiplier += (this._result[3] - result.blueMultiplier) * fadeProgress; + result.alphaOffset += (this._result[4] - result.alphaOffset) * fadeProgress; + result.redOffset += (this._result[5] - result.redOffset) * fadeProgress; + result.greenOffset += (this._result[6] - result.greenOffset) * fadeProgress; + result.blueOffset += (this._result[7] - result.blueOffset) * fadeProgress; + slot._colorDirty = true; + } + } + else if (this.dirty) { + this.dirty = false; + if (result.alphaMultiplier !== this._result[0] || + result.redMultiplier !== this._result[1] || + result.greenMultiplier !== this._result[2] || + result.blueMultiplier !== this._result[3] || + result.alphaOffset !== this._result[4] || + result.redOffset !== this._result[5] || + result.greenOffset !== this._result[6] || + result.blueOffset !== this._result[7]) { + result.alphaMultiplier = this._result[0]; + result.redMultiplier = this._result[1]; + result.greenMultiplier = this._result[2]; + result.blueMultiplier = this._result[3]; + result.alphaOffset = this._result[4]; + result.redOffset = this._result[5]; + result.greenOffset = this._result[6]; + result.blueOffset = this._result[7]; + slot._colorDirty = true; + } + } + } + }; + return SlotColorTimelineState; + }(dragonBones.TweenTimelineState)); + dragonBones.SlotColorTimelineState = SlotColorTimelineState; + /** + * @internal + */ + var SlotZIndexTimelineState = (function (_super) { + __extends(SlotZIndexTimelineState, _super); + function SlotZIndexTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SlotZIndexTimelineState.toString = function () { + return "[class dragonBones.SlotZIndexTimelineState]"; + }; + SlotZIndexTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { + var blendState = this.target; + var slot = blendState.target; + this._result = slot.slotData.zIndex; + } + }; + SlotZIndexTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + SlotZIndexTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var slot = blendState.target; + var blendWeight = blendState.blendWeight; + if (blendState.dirty > 1) { + slot._zIndex += this._result * blendWeight; + } + else { + slot._zIndex = this._result * blendWeight; + } + if (isDirty || this.dirty) { + this.dirty = false; + this._armature._zIndexDirty = true; + } + }; + return SlotZIndexTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.SlotZIndexTimelineState = SlotZIndexTimelineState; + /** + * @internal + */ + var DeformTimelineState = (function (_super) { + __extends(DeformTimelineState, _super); + function DeformTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + DeformTimelineState.toString = function () { + return "[class dragonBones.DeformTimelineState]"; + }; + DeformTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.geometryOffset = 0; + this.displayFrame = null; + this._deformCount = 0; + this._deformOffset = 0; + this._sameValueOffset = 0; + }; + DeformTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + if (this._timelineData !== null) { + var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */]; + var dragonBonesData = this._animationData.parent.parent; + var frameIntArray = dragonBonesData.frameIntArray; + var slot = this.target.target; + this.geometryOffset = frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */]; + if (this.geometryOffset < 0) { + this.geometryOffset += 65536; // Fixed out of bounds bug. + } + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayFrame = slot.getDisplayFrameAt(i); + var geometryData = displayFrame.getGeometryData(); + if (geometryData === null) { + continue; + } + if (geometryData.offset === this.geometryOffset) { + this.displayFrame = displayFrame; + this.displayFrame.updateDeformVertices(); + break; + } + } + if (this.displayFrame === null) { + this.returnToPool(); // + return; + } + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */]; + this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */]; + this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */]; + this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = dragonBonesData.frameFloatArray; + this._rd.length = this._valueCount * 2; + } + else { + this._deformCount = this.displayFrame.deformVertices.length; + } + }; + DeformTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var slot = blendState.target; + var blendWeight = blendState.blendWeight; + var result = this.displayFrame.deformVertices; + var valueArray = this._valueArray; + if (valueArray !== null) { + var valueCount = this._valueCount; + var deformOffset = this._deformOffset; + var sameValueOffset = this._sameValueOffset; + var rd = this._rd; + for (var i = 0; i < this._deformCount; ++i) { + var value = 0.0; + if (i < deformOffset) { + value = valueArray[sameValueOffset + i]; + } + else if (i < deformOffset + valueCount) { + value = rd[i - deformOffset]; + } + else { + value = valueArray[sameValueOffset + i - valueCount]; + } + if (blendState.dirty > 1) { + result[i] += value * blendWeight; + } + else { + result[i] = value * blendWeight; + } + } + } + else if (blendState.dirty === 1) { + for (var i = 0; i < this._deformCount; ++i) { + result[i] = 0.0; + } + } + if (isDirty || this.dirty) { + this.dirty = false; + if (slot._geometryData === this.displayFrame.getGeometryData()) { + slot._verticesDirty = true; + } + } + }; + return DeformTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.DeformTimelineState = DeformTimelineState; + /** + * @internal + */ + var IKConstraintTimelineState = (function (_super) { + __extends(IKConstraintTimelineState, _super); + function IKConstraintTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraintTimelineState.toString = function () { + return "[class dragonBones.IKConstraintTimelineState]"; + }; + IKConstraintTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var ikConstraint = this.target; + if (this._timelineData !== null) { + ikConstraint._bendPositive = this._currentA > 0.0; + ikConstraint._weight = this._currentB; + } + else { + var ikConstraintData = ikConstraint._constraintData; + ikConstraint._bendPositive = ikConstraintData.bendPositive; + ikConstraint._weight = ikConstraintData.weight; + } + ikConstraint.invalidUpdate(); + this.dirty = false; + }; + IKConstraintTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.01; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return IKConstraintTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.IKConstraintTimelineState = IKConstraintTimelineState; + /** + * @internal + */ + var AnimationProgressTimelineState = (function (_super) { + __extends(AnimationProgressTimelineState, _super); + function AnimationProgressTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationProgressTimelineState.toString = function () { + return "[class dragonBones.AnimationProgressTimelineState]"; + }; + AnimationProgressTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.currentTime = this._result * animationState.totalTime; + } + this.dirty = false; + }; + AnimationProgressTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationProgressTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AnimationProgressTimelineState = AnimationProgressTimelineState; + /** + * @internal + */ + var AnimationWeightTimelineState = (function (_super) { + __extends(AnimationWeightTimelineState, _super); + function AnimationWeightTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationWeightTimelineState.toString = function () { + return "[class dragonBones.AnimationWeightTimelineState]"; + }; + AnimationWeightTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.weight = this._result; + } + this.dirty = false; + }; + AnimationWeightTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationWeightTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AnimationWeightTimelineState = AnimationWeightTimelineState; + /** + * @internal + */ + var AnimationParametersTimelineState = (function (_super) { + __extends(AnimationParametersTimelineState, _super); + function AnimationParametersTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationParametersTimelineState.toString = function () { + return "[class dragonBones.AnimationParametersTimelineState]"; + }; + AnimationParametersTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.parameterX = this._resultA; + animationState.parameterY = this._resultB; + } + this.dirty = false; + }; + AnimationParametersTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationParametersTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.AnimationParametersTimelineState = AnimationParametersTimelineState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The properties of the object carry basic information about an event, + * which are passed as parameter or parameter's parameter to event listeners when an event occurs. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 + * @version DragonBones 4.5 + * @language zh_CN + */ + var EventObject = (function (_super) { + __extends(EventObject, _super); + function EventObject() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @internal + * @private + */ + EventObject.actionDataToInstance = function (data, instance, armature) { + if (data.type === 0 /* Play */) { + instance.type = EventObject.FRAME_EVENT; + } + else { + instance.type = data.type === 10 /* Frame */ ? EventObject.FRAME_EVENT : EventObject.SOUND_EVENT; + } + instance.name = data.name; + instance.armature = armature; + instance.actionData = data; + instance.data = data.data; + if (data.bone !== null) { + instance.bone = armature.getBone(data.bone.name); + } + if (data.slot !== null) { + instance.slot = armature.getSlot(data.slot.name); + } + }; + EventObject.toString = function () { + return "[class dragonBones.EventObject]"; + }; + EventObject.prototype._onClear = function () { + this.time = 0.0; + this.type = ""; + this.name = ""; + this.armature = null; + this.bone = null; + this.slot = null; + this.animationState = null; + this.actionData = null; + this.data = null; + }; + /** + * - Animation start play. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画开始播放。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.START = "start"; + /** + * - Animation loop play complete once. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画循环播放完成一次。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.LOOP_COMPLETE = "loopComplete"; + /** + * - Animation play complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画播放完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.COMPLETE = "complete"; + /** + * - Animation fade in start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_IN = "fadeIn"; + /** + * - Animation fade in complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_IN_COMPLETE = "fadeInComplete"; + /** + * - Animation fade out start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_OUT = "fadeOut"; + /** + * - Animation fade out complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_OUT_COMPLETE = "fadeOutComplete"; + /** + * - Animation frame event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FRAME_EVENT = "frameEvent"; + /** + * - Animation frame sound event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧声音事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.SOUND_EVENT = "soundEvent"; + return EventObject; + }(dragonBones.BaseObject)); + dragonBones.EventObject = EventObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DataParser = (function () { + function DataParser() { + } + DataParser._getArmatureType = function (value) { + switch (value.toLowerCase()) { + case "stage": + return 2 /* Stage */; + case "armature": + return 0 /* Armature */; + case "movieclip": + return 1 /* MovieClip */; + default: + return 0 /* Armature */; + } + }; + DataParser._getBoneType = function (value) { + switch (value.toLowerCase()) { + case "bone": + return 0 /* Bone */; + case "surface": + return 1 /* Surface */; + default: + return 0 /* Bone */; + } + }; + DataParser._getPositionMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "percent": + return 1 /* Percent */; + case "fixed": + return 0 /* Fixed */; + default: + return 1 /* Percent */; + } + }; + DataParser._getSpacingMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "length": + return 0 /* Length */; + case "percent": + return 2 /* Percent */; + case "fixed": + return 1 /* Fixed */; + default: + return 0 /* Length */; + } + }; + DataParser._getRotateMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "tangent": + return 0 /* Tangent */; + case "chain": + return 1 /* Chain */; + case "chainscale": + return 2 /* ChainScale */; + default: + return 0 /* Tangent */; + } + }; + DataParser._getDisplayType = function (value) { + switch (value.toLowerCase()) { + case "image": + return 0 /* Image */; + case "mesh": + return 2 /* Mesh */; + case "armature": + return 1 /* Armature */; + case "boundingbox": + return 3 /* BoundingBox */; + case "path": + return 4 /* Path */; + default: + return 0 /* Image */; + } + }; + DataParser._getBoundingBoxType = function (value) { + switch (value.toLowerCase()) { + case "rectangle": + return 0 /* Rectangle */; + case "ellipse": + return 1 /* Ellipse */; + case "polygon": + return 2 /* Polygon */; + default: + return 0 /* Rectangle */; + } + }; + DataParser._getBlendMode = function (value) { + switch (value.toLowerCase()) { + case "normal": + return 0 /* Normal */; + case "add": + return 1 /* Add */; + case "alpha": + return 2 /* Alpha */; + case "darken": + return 3 /* Darken */; + case "difference": + return 4 /* Difference */; + case "erase": + return 5 /* Erase */; + case "hardlight": + return 6 /* HardLight */; + case "invert": + return 7 /* Invert */; + case "layer": + return 8 /* Layer */; + case "lighten": + return 9 /* Lighten */; + case "multiply": + return 10 /* Multiply */; + case "overlay": + return 11 /* Overlay */; + case "screen": + return 12 /* Screen */; + case "subtract": + return 13 /* Subtract */; + default: + return 0 /* Normal */; + } + }; + DataParser._getAnimationBlendType = function (value) { + switch (value.toLowerCase()) { + case "none": + return 0 /* None */; + case "1d": + return 1 /* E1D */; + default: + return 0 /* None */; + } + }; + DataParser._getActionType = function (value) { + switch (value.toLowerCase()) { + case "play": + return 0 /* Play */; + case "frame": + return 10 /* Frame */; + case "sound": + return 11 /* Sound */; + default: + return 0 /* Play */; + } + }; + DataParser.DATA_VERSION_2_3 = "2.3"; + DataParser.DATA_VERSION_3_0 = "3.0"; + DataParser.DATA_VERSION_4_0 = "4.0"; + DataParser.DATA_VERSION_4_5 = "4.5"; + DataParser.DATA_VERSION_5_0 = "5.0"; + DataParser.DATA_VERSION_5_5 = "5.5"; + DataParser.DATA_VERSION_5_6 = "5.6"; + DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_6; + DataParser.DATA_VERSIONS = [ + DataParser.DATA_VERSION_4_0, + DataParser.DATA_VERSION_4_5, + DataParser.DATA_VERSION_5_0, + DataParser.DATA_VERSION_5_5, + DataParser.DATA_VERSION_5_6 + ]; + DataParser.TEXTURE_ATLAS = "textureAtlas"; + DataParser.SUB_TEXTURE = "SubTexture"; + DataParser.FORMAT = "format"; + DataParser.IMAGE_PATH = "imagePath"; + DataParser.WIDTH = "width"; + DataParser.HEIGHT = "height"; + DataParser.ROTATED = "rotated"; + DataParser.FRAME_X = "frameX"; + DataParser.FRAME_Y = "frameY"; + DataParser.FRAME_WIDTH = "frameWidth"; + DataParser.FRAME_HEIGHT = "frameHeight"; + DataParser.DRADON_BONES = "dragonBones"; + DataParser.USER_DATA = "userData"; + DataParser.ARMATURE = "armature"; + DataParser.CANVAS = "canvas"; + DataParser.BONE = "bone"; + DataParser.SURFACE = "surface"; + DataParser.SLOT = "slot"; + DataParser.CONSTRAINT = "constraint"; + DataParser.SKIN = "skin"; + DataParser.DISPLAY = "display"; + DataParser.FRAME = "frame"; + DataParser.IK = "ik"; + DataParser.PATH_CONSTRAINT = "path"; + DataParser.ANIMATION = "animation"; + DataParser.TIMELINE = "timeline"; + DataParser.FFD = "ffd"; + DataParser.TRANSLATE_FRAME = "translateFrame"; + DataParser.ROTATE_FRAME = "rotateFrame"; + DataParser.SCALE_FRAME = "scaleFrame"; + DataParser.DISPLAY_FRAME = "displayFrame"; + DataParser.COLOR_FRAME = "colorFrame"; + DataParser.DEFAULT_ACTIONS = "defaultActions"; + DataParser.ACTIONS = "actions"; + DataParser.EVENTS = "events"; + DataParser.INTS = "ints"; + DataParser.FLOATS = "floats"; + DataParser.STRINGS = "strings"; + DataParser.TRANSFORM = "transform"; + DataParser.PIVOT = "pivot"; + DataParser.AABB = "aabb"; + DataParser.COLOR = "color"; + DataParser.VERSION = "version"; + DataParser.COMPATIBLE_VERSION = "compatibleVersion"; + DataParser.FRAME_RATE = "frameRate"; + DataParser.TYPE = "type"; + DataParser.SUB_TYPE = "subType"; + DataParser.NAME = "name"; + DataParser.PARENT = "parent"; + DataParser.TARGET = "target"; + DataParser.STAGE = "stage"; + DataParser.SHARE = "share"; + DataParser.PATH = "path"; + DataParser.LENGTH = "length"; + DataParser.DISPLAY_INDEX = "displayIndex"; + DataParser.Z_ORDER = "zOrder"; + DataParser.Z_INDEX = "zIndex"; + DataParser.BLEND_MODE = "blendMode"; + DataParser.INHERIT_TRANSLATION = "inheritTranslation"; + DataParser.INHERIT_ROTATION = "inheritRotation"; + DataParser.INHERIT_SCALE = "inheritScale"; + DataParser.INHERIT_REFLECTION = "inheritReflection"; + DataParser.INHERIT_ANIMATION = "inheritAnimation"; + DataParser.INHERIT_DEFORM = "inheritDeform"; + DataParser.SEGMENT_X = "segmentX"; + DataParser.SEGMENT_Y = "segmentY"; + DataParser.BEND_POSITIVE = "bendPositive"; + DataParser.CHAIN = "chain"; + DataParser.WEIGHT = "weight"; + DataParser.BLEND_TYPE = "blendType"; + DataParser.FADE_IN_TIME = "fadeInTime"; + DataParser.PLAY_TIMES = "playTimes"; + DataParser.SCALE = "scale"; + DataParser.OFFSET = "offset"; + DataParser.POSITION = "position"; + DataParser.DURATION = "duration"; + DataParser.TWEEN_EASING = "tweenEasing"; + DataParser.TWEEN_ROTATE = "tweenRotate"; + DataParser.TWEEN_SCALE = "tweenScale"; + DataParser.CLOCK_WISE = "clockwise"; + DataParser.CURVE = "curve"; + DataParser.SOUND = "sound"; + DataParser.EVENT = "event"; + DataParser.ACTION = "action"; + DataParser.X = "x"; + DataParser.Y = "y"; + DataParser.SKEW_X = "skX"; + DataParser.SKEW_Y = "skY"; + DataParser.SCALE_X = "scX"; + DataParser.SCALE_Y = "scY"; + DataParser.VALUE = "value"; + DataParser.ROTATE = "rotate"; + DataParser.SKEW = "skew"; + DataParser.ALPHA = "alpha"; + DataParser.ALPHA_OFFSET = "aO"; + DataParser.RED_OFFSET = "rO"; + DataParser.GREEN_OFFSET = "gO"; + DataParser.BLUE_OFFSET = "bO"; + DataParser.ALPHA_MULTIPLIER = "aM"; + DataParser.RED_MULTIPLIER = "rM"; + DataParser.GREEN_MULTIPLIER = "gM"; + DataParser.BLUE_MULTIPLIER = "bM"; + DataParser.UVS = "uvs"; + DataParser.VERTICES = "vertices"; + DataParser.TRIANGLES = "triangles"; + DataParser.WEIGHTS = "weights"; + DataParser.SLOT_POSE = "slotPose"; + DataParser.BONE_POSE = "bonePose"; + DataParser.BONES = "bones"; + DataParser.POSITION_MODE = "positionMode"; + DataParser.SPACING_MODE = "spacingMode"; + DataParser.ROTATE_MODE = "rotateMode"; + DataParser.SPACING = "spacing"; + DataParser.ROTATE_OFFSET = "rotateOffset"; + DataParser.ROTATE_MIX = "rotateMix"; + DataParser.TRANSLATE_MIX = "translateMix"; + DataParser.TARGET_DISPLAY = "targetDisplay"; + DataParser.CLOSED = "closed"; + DataParser.CONSTANT_SPEED = "constantSpeed"; + DataParser.VERTEX_COUNT = "vertexCount"; + DataParser.LENGTHS = "lengths"; + DataParser.GOTO_AND_PLAY = "gotoAndPlay"; + DataParser.DEFAULT_NAME = "default"; + return DataParser; + }()); + dragonBones.DataParser = DataParser; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ObjectDataParser = (function (_super) { + __extends(ObjectDataParser, _super); + function ObjectDataParser() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._rawTextureAtlasIndex = 0; + _this._rawBones = []; + _this._data = null; // + _this._armature = null; // + _this._bone = null; // + _this._geometry = null; // + _this._slot = null; // + _this._skin = null; // + _this._mesh = null; // + _this._animation = null; // + _this._timeline = null; // + _this._rawTextureAtlases = null; + _this._frameValueType = 0 /* Step */; + _this._defaultColorOffset = -1; + _this._prevClockwise = 0; + _this._prevRotation = 0.0; + _this._frameDefaultValue = 0.0; + _this._frameValueScale = 1.0; + _this._helpMatrixA = new dragonBones.Matrix(); + _this._helpMatrixB = new dragonBones.Matrix(); + _this._helpTransform = new dragonBones.Transform(); + _this._helpColorTransform = new dragonBones.ColorTransform(); + _this._helpPoint = new dragonBones.Point(); + _this._helpArray = []; + _this._intArray = []; + _this._floatArray = []; + _this._frameIntArray = []; + _this._frameFloatArray = []; + _this._frameArray = []; + _this._timelineArray = []; + _this._colorArray = []; + _this._cacheRawMeshes = []; + _this._cacheMeshes = []; + _this._actionFrames = []; + _this._weightSlotPose = {}; + _this._weightBonePoses = {}; + _this._cacheBones = {}; + _this._slotChildActions = {}; + return _this; + } + ObjectDataParser._getBoolean = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + var type = typeof value; + if (type === "boolean") { + return value; + } + else if (type === "string") { + switch (value) { + case "0": + case "NaN": + case "": + case "false": + case "null": + case "undefined": + return false; + default: + return true; + } + } + else { + return !!value; + } + } + return defaultValue; + }; + ObjectDataParser._getNumber = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + if (value === null || value === "NaN") { + return defaultValue; + } + return +value || 0; + } + return defaultValue; + }; + ObjectDataParser._getString = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + var type = typeof value; + if (type === "string") { + return value; + } + return String(value); + } + return defaultValue; + }; + ObjectDataParser.prototype._getCurvePoint = function (x1, y1, x2, y2, x3, y3, x4, y4, t, result) { + var l_t = 1.0 - t; + var powA = l_t * l_t; + var powB = t * t; + var kA = l_t * powA; + var kB = 3.0 * t * powA; + var kC = 3.0 * l_t * powB; + var kD = t * powB; + result.x = kA * x1 + kB * x2 + kC * x3 + kD * x4; + result.y = kA * y1 + kB * y2 + kC * y3 + kD * y4; + }; + ObjectDataParser.prototype._samplingEasingCurve = function (curve, samples) { + var curveCount = curve.length; + if (curveCount % 3 === 1) { + var stepIndex = -2; + for (var i = 0, l = samples.length; i < l; ++i) { + var t = (i + 1) / (l + 1); // float + while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) { + stepIndex += 6; + } + var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount; + var x1 = isInCurve ? curve[stepIndex] : 0.0; + var y1 = isInCurve ? curve[stepIndex + 1] : 0.0; + var x2 = curve[stepIndex + 2]; + var y2 = curve[stepIndex + 3]; + var x3 = curve[stepIndex + 4]; + var y3 = curve[stepIndex + 5]; + var x4 = isInCurve ? curve[stepIndex + 6] : 1.0; + var y4 = isInCurve ? curve[stepIndex + 7] : 1.0; + var lower = 0.0; + var higher = 1.0; + while (higher - lower > 0.0001) { + var percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } + } + samples[i] = this._helpPoint.y; + } + return true; + } + else { + var stepIndex = 0; + for (var i = 0, l = samples.length; i < l; ++i) { + var t = (i + 1) / (l + 1); // float + while (curve[stepIndex + 6] < t) { + stepIndex += 6; + } + var x1 = curve[stepIndex]; + var y1 = curve[stepIndex + 1]; + var x2 = curve[stepIndex + 2]; + var y2 = curve[stepIndex + 3]; + var x3 = curve[stepIndex + 4]; + var y3 = curve[stepIndex + 5]; + var x4 = curve[stepIndex + 6]; + var y4 = curve[stepIndex + 7]; + var lower = 0.0; + var higher = 1.0; + while (higher - lower > 0.0001) { + var percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } + } + samples[i] = this._helpPoint.y; + } + return false; + } + }; + ObjectDataParser.prototype._parseActionDataInFrame = function (rawData, frameStart, bone, slot) { + if (dragonBones.DataParser.EVENT in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.EVENT], frameStart, 10 /* Frame */, bone, slot); + } + if (dragonBones.DataParser.SOUND in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.SOUND], frameStart, 11 /* Sound */, bone, slot); + } + if (dragonBones.DataParser.ACTION in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.ACTION], frameStart, 0 /* Play */, bone, slot); + } + if (dragonBones.DataParser.EVENTS in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.EVENTS], frameStart, 10 /* Frame */, bone, slot); + } + if (dragonBones.DataParser.ACTIONS in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.ACTIONS], frameStart, 0 /* Play */, bone, slot); + } + }; + ObjectDataParser.prototype._mergeActionFrame = function (rawData, frameStart, type, bone, slot) { + var actionOffset = this._armature.actions.length; + var actions = this._parseActionData(rawData, type, bone, slot); + var frameIndex = 0; + var frame = null; + for (var _i = 0, actions_2 = actions; _i < actions_2.length; _i++) { + var action = actions_2[_i]; + this._armature.addAction(action, false); + } + if (this._actionFrames.length === 0) { + frame = new ActionFrame(); + frame.frameStart = 0; + this._actionFrames.push(frame); + frame = null; + } + for (var _a = 0, _b = this._actionFrames; _a < _b.length; _a++) { + var eachFrame = _b[_a]; + if (eachFrame.frameStart === frameStart) { + frame = eachFrame; + break; + } + else if (eachFrame.frameStart > frameStart) { + break; + } + frameIndex++; + } + if (frame === null) { + frame = new ActionFrame(); + frame.frameStart = frameStart; + this._actionFrames.splice(frameIndex, 0, frame); + } + for (var i = 0; i < actions.length; ++i) { + frame.actions.push(actionOffset + i); + } + }; + ObjectDataParser.prototype._parseArmature = function (rawData, scale) { + var armature = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureData); + armature.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + armature.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, this._data.frameRate); + armature.scale = scale; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + armature.type = dragonBones.DataParser._getArmatureType(rawData[dragonBones.DataParser.TYPE]); + } + else { + armature.type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Armature */); + } + if (armature.frameRate === 0) { + armature.frameRate = 24; + } + this._armature = armature; + if (dragonBones.DataParser.CANVAS in rawData) { + var rawCanvas = rawData[dragonBones.DataParser.CANVAS]; + var canvas = dragonBones.BaseObject.borrowObject(dragonBones.CanvasData); + if (dragonBones.DataParser.COLOR in rawCanvas) { + canvas.hasBackground = true; + } + else { + canvas.hasBackground = false; + } + canvas.color = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.COLOR, 0); + canvas.x = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.X, 0) * armature.scale; + canvas.y = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.Y, 0) * armature.scale; + canvas.width = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.WIDTH, 0) * armature.scale; + canvas.height = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.HEIGHT, 0) * armature.scale; + armature.canvas = canvas; + } + if (dragonBones.DataParser.AABB in rawData) { + var rawAABB = rawData[dragonBones.DataParser.AABB]; + armature.aabb.x = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.X, 0.0) * armature.scale; + armature.aabb.y = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.Y, 0.0) * armature.scale; + armature.aabb.width = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.WIDTH, 0.0) * armature.scale; + armature.aabb.height = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.HEIGHT, 0.0) * armature.scale; + } + if (dragonBones.DataParser.BONE in rawData) { + var rawBones = rawData[dragonBones.DataParser.BONE]; + for (var _i = 0, rawBones_1 = rawBones; _i < rawBones_1.length; _i++) { + var rawBone = rawBones_1[_i]; + var parentName = ObjectDataParser._getString(rawBone, dragonBones.DataParser.PARENT, ""); + var bone = this._parseBone(rawBone); + if (parentName.length > 0) { + var parent_1 = armature.getBone(parentName); + if (parent_1 !== null) { + bone.parent = parent_1; + } + else { + if (!(parentName in this._cacheBones)) { + this._cacheBones[parentName] = []; + } + this._cacheBones[parentName].push(bone); + } + } + if (bone.name in this._cacheBones) { + for (var _a = 0, _b = this._cacheBones[bone.name]; _a < _b.length; _a++) { + var child = _b[_a]; + child.parent = bone; + } + delete this._cacheBones[bone.name]; + } + armature.addBone(bone); + this._rawBones.push(bone); // Cache raw bones sort. + } + } + if (dragonBones.DataParser.IK in rawData) { + var rawIKS = rawData[dragonBones.DataParser.IK]; + for (var _c = 0, rawIKS_1 = rawIKS; _c < rawIKS_1.length; _c++) { + var rawIK = rawIKS_1[_c]; + var constraint = this._parseIKConstraint(rawIK); + if (constraint) { + armature.addConstraint(constraint); + } + } + } + armature.sortBones(); + if (dragonBones.DataParser.SLOT in rawData) { + var zOrder = 0; + var rawSlots = rawData[dragonBones.DataParser.SLOT]; + for (var _d = 0, rawSlots_1 = rawSlots; _d < rawSlots_1.length; _d++) { + var rawSlot = rawSlots_1[_d]; + armature.addSlot(this._parseSlot(rawSlot, zOrder++)); + } + } + if (dragonBones.DataParser.SKIN in rawData) { + var rawSkins = rawData[dragonBones.DataParser.SKIN]; + for (var _e = 0, rawSkins_1 = rawSkins; _e < rawSkins_1.length; _e++) { + var rawSkin = rawSkins_1[_e]; + armature.addSkin(this._parseSkin(rawSkin)); + } + } + if (dragonBones.DataParser.PATH_CONSTRAINT in rawData) { + var rawPaths = rawData[dragonBones.DataParser.PATH_CONSTRAINT]; + for (var _f = 0, rawPaths_1 = rawPaths; _f < rawPaths_1.length; _f++) { + var rawPath = rawPaths_1[_f]; + var constraint = this._parsePathConstraint(rawPath); + if (constraint) { + armature.addConstraint(constraint); + } + } + } + for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) { + var rawData_1 = this._cacheRawMeshes[i]; + var shareName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SHARE, ""); + if (shareName.length === 0) { + continue; + } + var skinName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME); + if (skinName.length === 0) { + skinName = dragonBones.DataParser.DEFAULT_NAME; + } + var shareMesh = armature.getMesh(skinName, "", shareName); // TODO slot; + if (shareMesh === null) { + continue; // Error. + } + var mesh = this._cacheMeshes[i]; + mesh.geometry.shareFrom(shareMesh.geometry); + } + if (dragonBones.DataParser.ANIMATION in rawData) { + var rawAnimations = rawData[dragonBones.DataParser.ANIMATION]; + for (var _g = 0, rawAnimations_1 = rawAnimations; _g < rawAnimations_1.length; _g++) { + var rawAnimation = rawAnimations_1[_g]; + var animation = this._parseAnimation(rawAnimation); + armature.addAnimation(animation); + } + } + if (dragonBones.DataParser.DEFAULT_ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.DEFAULT_ACTIONS], 0 /* Play */, null, null); + for (var _h = 0, actions_3 = actions; _h < actions_3.length; _h++) { + var action = actions_3[_h]; + armature.addAction(action, true); + if (action.type === 0 /* Play */) { + var animation = armature.getAnimation(action.name); + if (animation !== null) { + armature.defaultAnimation = animation; + } + } + } + } + if (dragonBones.DataParser.ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + for (var _j = 0, actions_4 = actions; _j < actions_4.length; _j++) { + var action = actions_4[_j]; + armature.addAction(action, false); + } + } + // Clear helper. + this._rawBones.length = 0; + this._cacheRawMeshes.length = 0; + this._cacheMeshes.length = 0; + this._armature = null; + for (var k in this._weightSlotPose) { + delete this._weightSlotPose[k]; + } + for (var k in this._weightBonePoses) { + delete this._weightBonePoses[k]; + } + for (var k in this._cacheBones) { + delete this._cacheBones[k]; + } + for (var k in this._slotChildActions) { + delete this._slotChildActions[k]; + } + return armature; + }; + ObjectDataParser.prototype._parseBone = function (rawData) { + var type = 0 /* Bone */; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + type = dragonBones.DataParser._getBoneType(rawData[dragonBones.DataParser.TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Bone */); + } + if (type === 0 /* Bone */) { + var scale = this._armature.scale; + var bone = dragonBones.BaseObject.borrowObject(dragonBones.BoneData); + bone.inheritTranslation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_TRANSLATION, true); + bone.inheritRotation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_ROTATION, true); + bone.inheritScale = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_SCALE, true); + bone.inheritReflection = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_REFLECTION, true); + bone.length = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.LENGTH, 0) * scale; + bone.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + bone.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + if (dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], bone.transform, scale); + } + return bone; + } + var surface = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceData); + surface.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + surface.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + surface.segmentX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_X, 0); + surface.segmentY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_Y, 0); + this._parseGeometry(rawData, surface.geometry); + return surface; + }; + ObjectDataParser.prototype._parseIKConstraint = function (rawData) { + var bone = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.BONE, "")); + if (bone === null) { + return null; + } + var target = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET, "")); + if (target === null) { + return null; + } + var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0); + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintData); + constraint.scaleEnabled = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.SCALE, false); + constraint.bendPositive = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true); + constraint.weight = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0); + constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + constraint.type = 0 /* IK */; + constraint.target = target; + if (chain > 0 && bone.parent !== null) { + constraint.root = bone.parent; + constraint.bone = bone; + } + else { + constraint.root = bone; + constraint.bone = null; + } + return constraint; + }; + ObjectDataParser.prototype._parsePathConstraint = function (rawData) { + var target = this._armature.getSlot(ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET, "")); + if (target === null) { + return null; + } + var defaultSkin = this._armature.defaultSkin; + if (defaultSkin === null) { + return null; + } + //TODO + var targetDisplay = defaultSkin.getDisplay(target.name, ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET_DISPLAY, target.name)); + if (targetDisplay === null || !(targetDisplay instanceof dragonBones.PathDisplayData)) { + return null; + } + var bones = rawData[dragonBones.DataParser.BONES]; + if (bones === null || bones.length === 0) { + return null; + } + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.PathConstraintData); + constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + constraint.type = 1 /* Path */; + constraint.pathSlot = target; + constraint.pathDisplayData = targetDisplay; + constraint.target = target.parent; + constraint.positionMode = dragonBones.DataParser._getPositionMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.POSITION_MODE, "")); + constraint.spacingMode = dragonBones.DataParser._getSpacingMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.SPACING_MODE, "")); + constraint.rotateMode = dragonBones.DataParser._getRotateMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.ROTATE_MODE, "")); + constraint.position = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.POSITION, 0); + constraint.spacing = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SPACING, 0); + constraint.rotateOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE_OFFSET, 0); + constraint.rotateMix = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE_MIX, 1); + constraint.translateMix = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TRANSLATE_MIX, 1); + // + for (var _i = 0, bones_3 = bones; _i < bones_3.length; _i++) { + var boneName = bones_3[_i]; + var bone = this._armature.getBone(boneName); + if (bone !== null) { + constraint.AddBone(bone); + if (constraint.root === null) { + constraint.root = bone; + } + } + } + return constraint; + }; + ObjectDataParser.prototype._parseSlot = function (rawData, zOrder) { + var slot = dragonBones.BaseObject.borrowObject(dragonBones.SlotData); + slot.displayIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0); + slot.zOrder = zOrder; + slot.zIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Z_INDEX, 0); + slot.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + slot.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + slot.parent = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.PARENT, "")); // + if (dragonBones.DataParser.BLEND_MODE in rawData && typeof rawData[dragonBones.DataParser.BLEND_MODE] === "string") { + slot.blendMode = dragonBones.DataParser._getBlendMode(rawData[dragonBones.DataParser.BLEND_MODE]); + } + else { + slot.blendMode = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLEND_MODE, 0 /* Normal */); + } + if (dragonBones.DataParser.COLOR in rawData) { + slot.color = dragonBones.SlotData.createColor(); + this._parseColorTransform(rawData[dragonBones.DataParser.COLOR], slot.color); + } + else { + slot.color = dragonBones.SlotData.DEFAULT_COLOR; + } + if (dragonBones.DataParser.ACTIONS in rawData) { + this._slotChildActions[slot.name] = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + } + return slot; + }; + ObjectDataParser.prototype._parseSkin = function (rawData) { + var skin = dragonBones.BaseObject.borrowObject(dragonBones.SkinData); + skin.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (skin.name.length === 0) { + skin.name = dragonBones.DataParser.DEFAULT_NAME; + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawSlots = rawData[dragonBones.DataParser.SLOT]; + this._skin = skin; + for (var _i = 0, rawSlots_2 = rawSlots; _i < rawSlots_2.length; _i++) { + var rawSlot = rawSlots_2[_i]; + var slotName = ObjectDataParser._getString(rawSlot, dragonBones.DataParser.NAME, ""); + var slot = this._armature.getSlot(slotName); + if (slot !== null) { + this._slot = slot; + if (dragonBones.DataParser.DISPLAY in rawSlot) { + var rawDisplays = rawSlot[dragonBones.DataParser.DISPLAY]; + for (var _a = 0, rawDisplays_1 = rawDisplays; _a < rawDisplays_1.length; _a++) { + var rawDisplay = rawDisplays_1[_a]; + if (rawDisplay) { + skin.addDisplay(slotName, this._parseDisplay(rawDisplay)); + } + else { + skin.addDisplay(slotName, null); + } + } + } + this._slot = null; // + } + } + this._skin = null; // + } + return skin; + }; + ObjectDataParser.prototype._parseDisplay = function (rawData) { + var name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + var path = ObjectDataParser._getString(rawData, dragonBones.DataParser.PATH, ""); + var type = 0 /* Image */; + var display = null; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + type = dragonBones.DataParser._getDisplayType(rawData[dragonBones.DataParser.TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, type); + } + switch (type) { + case 0 /* Image */: { + var imageDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ImageDisplayData); + imageDisplay.name = name; + imageDisplay.path = path.length > 0 ? path : name; + this._parsePivot(rawData, imageDisplay); + break; + } + case 1 /* Armature */: { + var armatureDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureDisplayData); + armatureDisplay.name = name; + armatureDisplay.path = path.length > 0 ? path : name; + armatureDisplay.inheritAnimation = true; + if (dragonBones.DataParser.ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + for (var _i = 0, actions_5 = actions; _i < actions_5.length; _i++) { + var action = actions_5[_i]; + armatureDisplay.addAction(action); + } + } + else if (this._slot.name in this._slotChildActions) { + var displays = this._skin.getDisplays(this._slot.name); + if (displays === null ? this._slot.displayIndex === 0 : this._slot.displayIndex === displays.length) { + for (var _a = 0, _b = this._slotChildActions[this._slot.name]; _a < _b.length; _a++) { + var action = _b[_a]; + armatureDisplay.addAction(action); + } + delete this._slotChildActions[this._slot.name]; + } + } + break; + } + case 2 /* Mesh */: { + var meshDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.MeshDisplayData); + meshDisplay.geometry.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true); + meshDisplay.name = name; + meshDisplay.path = path.length > 0 ? path : name; + if (dragonBones.DataParser.SHARE in rawData) { + meshDisplay.geometry.data = this._data; + this._cacheRawMeshes.push(rawData); + this._cacheMeshes.push(meshDisplay); + } + else { + this._parseMesh(rawData, meshDisplay); + } + break; + } + case 3 /* BoundingBox */: { + var boundingBox = this._parseBoundingBox(rawData); + if (boundingBox !== null) { + var boundingBoxDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.BoundingBoxDisplayData); + boundingBoxDisplay.name = name; + boundingBoxDisplay.path = path.length > 0 ? path : name; + boundingBoxDisplay.boundingBox = boundingBox; + } + break; + } + case 4 /* Path */: { + var rawCurveLengths = rawData[dragonBones.DataParser.LENGTHS]; + var pathDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.PathDisplayData); + pathDisplay.closed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CLOSED, false); + pathDisplay.constantSpeed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CONSTANT_SPEED, false); + pathDisplay.name = name; + pathDisplay.path = path.length > 0 ? path : name; + pathDisplay.curveLengths.length = rawCurveLengths.length; + for (var i = 0, l = rawCurveLengths.length; i < l; ++i) { + pathDisplay.curveLengths[i] = rawCurveLengths[i]; + } + this._parsePath(rawData, pathDisplay); + break; + } + } + if (display !== null && dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], display.transform, this._armature.scale); + } + return display; + }; + ObjectDataParser.prototype._parsePath = function (rawData, display) { + this._parseGeometry(rawData, display.geometry); + }; + ObjectDataParser.prototype._parsePivot = function (rawData, display) { + if (dragonBones.DataParser.PIVOT in rawData) { + var rawPivot = rawData[dragonBones.DataParser.PIVOT]; + display.pivot.x = ObjectDataParser._getNumber(rawPivot, dragonBones.DataParser.X, 0.0); + display.pivot.y = ObjectDataParser._getNumber(rawPivot, dragonBones.DataParser.Y, 0.0); + } + else { + display.pivot.x = 0.5; + display.pivot.y = 0.5; + } + }; + ObjectDataParser.prototype._parseMesh = function (rawData, mesh) { + this._parseGeometry(rawData, mesh.geometry); + if (dragonBones.DataParser.WEIGHTS in rawData) { + var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE]; + var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE]; + var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; + this._weightSlotPose[meshName] = rawSlotPose; + this._weightBonePoses[meshName] = rawBonePoses; + } + }; + ObjectDataParser.prototype._parseBoundingBox = function (rawData) { + var boundingBox = null; + var type = 0 /* Rectangle */; + if (dragonBones.DataParser.SUB_TYPE in rawData && typeof rawData[dragonBones.DataParser.SUB_TYPE] === "string") { + type = dragonBones.DataParser._getBoundingBoxType(rawData[dragonBones.DataParser.SUB_TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SUB_TYPE, type); + } + switch (type) { + case 0 /* Rectangle */: + boundingBox = dragonBones.BaseObject.borrowObject(dragonBones.RectangleBoundingBoxData); + break; + case 1 /* Ellipse */: + boundingBox = dragonBones.BaseObject.borrowObject(dragonBones.EllipseBoundingBoxData); + break; + case 2 /* Polygon */: + boundingBox = this._parsePolygonBoundingBox(rawData); + break; + } + if (boundingBox !== null) { + boundingBox.color = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.COLOR, 0x000000); + if (boundingBox.type === 0 /* Rectangle */ || boundingBox.type === 1 /* Ellipse */) { + boundingBox.width = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WIDTH, 0.0); + boundingBox.height = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.HEIGHT, 0.0); + } + } + return boundingBox; + }; + ObjectDataParser.prototype._parsePolygonBoundingBox = function (rawData) { + var polygonBoundingBox = dragonBones.BaseObject.borrowObject(dragonBones.PolygonBoundingBoxData); + if (dragonBones.DataParser.VERTICES in rawData) { + var scale = this._armature.scale; + var rawVertices = rawData[dragonBones.DataParser.VERTICES]; + var vertices = polygonBoundingBox.vertices; + vertices.length = rawVertices.length; + for (var i = 0, l = rawVertices.length; i < l; i += 2) { + var x = rawVertices[i] * scale; + var y = rawVertices[i + 1] * scale; + vertices[i] = x; + vertices[i + 1] = y; + // AABB. + if (i === 0) { + polygonBoundingBox.x = x; + polygonBoundingBox.y = y; + polygonBoundingBox.width = x; + polygonBoundingBox.height = y; + } + else { + if (x < polygonBoundingBox.x) { + polygonBoundingBox.x = x; + } + else if (x > polygonBoundingBox.width) { + polygonBoundingBox.width = x; + } + if (y < polygonBoundingBox.y) { + polygonBoundingBox.y = y; + } + else if (y > polygonBoundingBox.height) { + polygonBoundingBox.height = y; + } + } + } + polygonBoundingBox.width -= polygonBoundingBox.x; + polygonBoundingBox.height -= polygonBoundingBox.y; + } + else { + console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug."); + } + return polygonBoundingBox; + }; + ObjectDataParser.prototype._parseAnimation = function (rawData) { + var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData); + animation.blendType = dragonBones.DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, "")); + animation.frameCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0); + animation.playTimes = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1); + animation.duration = animation.frameCount / this._armature.frameRate; // float + animation.fadeInTime = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0); + animation.scale = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0); + animation.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (animation.name.length === 0) { + animation.name = dragonBones.DataParser.DEFAULT_NAME; + } + animation.frameIntOffset = this._frameIntArray.length; + animation.frameFloatOffset = this._frameFloatArray.length; + animation.frameOffset = this._frameArray.length; + this._animation = animation; + if (dragonBones.DataParser.FRAME in rawData) { + var rawFrames = rawData[dragonBones.DataParser.FRAME]; + var keyFrameCount = rawFrames.length; + if (keyFrameCount > 0) { + for (var i = 0, frameStart = 0; i < keyFrameCount; ++i) { + var rawFrame = rawFrames[i]; + this._parseActionDataInFrame(rawFrame, frameStart, null, null); + frameStart += ObjectDataParser._getNumber(rawFrame, dragonBones.DataParser.DURATION, 1); + } + } + } + if (dragonBones.DataParser.Z_ORDER in rawData) { + this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, 0 /* Step */, 0, this._parseZOrderFrame); + } + if (dragonBones.DataParser.BONE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.BONE]; + for (var _i = 0, rawTimelines_1 = rawTimelines; _i < rawTimelines_1.length; _i++) { + var rawTimeline = rawTimelines_1[_i]; + this._parseBoneTimeline(rawTimeline); + } + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.SLOT]; + for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) { + var rawTimeline = rawTimelines_2[_a]; + this._parseSlotTimeline(rawTimeline); + } + } + if (dragonBones.DataParser.FFD in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.FFD]; + for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) { + var rawTimeline = rawTimelines_3[_b]; + var skinName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME); + var slotName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SLOT, ""); + var displayName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + if (skinName.length === 0) { + skinName = dragonBones.DataParser.DEFAULT_NAME; + } + this._slot = this._armature.getSlot(slotName); + this._mesh = this._armature.getMesh(skinName, slotName, displayName); + if (this._slot === null || this._mesh === null) { + continue; + } + var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, 2 /* Float */, 0, this._parseSlotDeformFrame); + if (timeline !== null) { + this._animation.addSlotTimeline(slotName, timeline); + } + this._slot = null; // + this._mesh = null; // + } + } + if (dragonBones.DataParser.IK in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.IK]; + for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) { + var rawTimeline = rawTimelines_4[_c]; + var constraintName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var constraint = this._armature.getConstraint(constraintName); + if (constraint === null) { + continue; + } + var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, 1 /* Int */, 2, this._parseIKConstraintFrame); + if (timeline !== null) { + this._animation.addConstraintTimeline(constraintName, timeline); + } + } + } + if (this._actionFrames.length > 0) { + this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, 0 /* Step */, 0, this._parseActionFrame); + this._actionFrames.length = 0; + } + if (dragonBones.DataParser.TIMELINE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.TIMELINE]; + for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) { + var rawTimeline = rawTimelines_5[_d]; + var timelineType = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */); + var timelineName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var timeline = null; + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 20 /* SlotDisplay */: // TODO + case 23 /* SlotZIndex */: + case 60 /* BoneAlpha */: + case 24 /* SlotAlpha */: + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + if (timelineType === 20 /* SlotDisplay */) { + this._frameValueType = 0 /* Step */; + this._frameValueScale = 1.0; + } + else { + this._frameValueType = 1 /* Int */; + if (timelineType === 23 /* SlotZIndex */) { + this._frameValueScale = 1.0; + } + else if (timelineType === 40 /* AnimationProgress */ || + timelineType === 41 /* AnimationWeight */) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + if (timelineType === 60 /* BoneAlpha */ || + timelineType === 24 /* SlotAlpha */ || + timelineType === 41 /* AnimationWeight */) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData); + var animaitonTimeline = timeline; + animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0); + animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0); + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 1, this._parseSingleValueFrame, timeline); + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 30 /* IKConstraint */: + case 42 /* AnimationParameter */: + if (timelineType === 30 /* IKConstraint */ || + timelineType === 42 /* AnimationParameter */) { + this._frameValueType = 1 /* Int */; + if (timelineType === 42 /* AnimationParameter */) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + else { + if (timelineType === 12 /* BoneRotate */) { + this._frameValueScale = dragonBones.Transform.DEG_RAD; + } + else { + this._frameValueScale = 1.0; + } + this._frameValueType = 2 /* Float */; + } + if (timelineType === 13 /* BoneScale */ || + timelineType === 30 /* IKConstraint */) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 2, this._parseDoubleValueFrame); + break; + case 1 /* ZOrder */: + // TODO + break; + case 50 /* Surface */: { + var surface = this._armature.getBone(timelineName); + if (surface === null) { + continue; + } + this._geometry = surface.geometry; + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame); + this._geometry = null; // + break; + } + case 22 /* SlotDeform */: { + this._geometry = null; // + for (var skinName in this._armature.skins) { + var skin = this._armature.skins[skinName]; + for (var slontName in skin.displays) { + var displays = skin.displays[slontName]; + for (var _e = 0, displays_1 = displays; _e < displays_1.length; _e++) { + var display = displays_1[_e]; + if (display !== null && display.name === timelineName) { + this._geometry = display.geometry; + break; + } + } + } + } + if (this._geometry === null) { + continue; + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame); + this._geometry = null; // + break; + } + case 21 /* SlotColor */: + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 1 /* Int */, 1, this._parseSlotColorFrame); + break; + } + if (timeline !== null) { + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 1 /* ZOrder */: + // TODO + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 50 /* Surface */: + case 60 /* BoneAlpha */: + this._animation.addBoneTimeline(timelineName, timeline); + break; + case 20 /* SlotDisplay */: + case 21 /* SlotColor */: + case 22 /* SlotDeform */: + case 23 /* SlotZIndex */: + case 24 /* SlotAlpha */: + this._animation.addSlotTimeline(timelineName, timeline); + break; + case 30 /* IKConstraint */: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + case 42 /* AnimationParameter */: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null; // + return animation; + }; + ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, timelineType, frameValueType, frameValueCount, frameParser, timeline) { + if (timeline === void 0) { timeline = null; } + if (rawData !== null && framesKey.length > 0 && framesKey in rawData) { + rawFrames = rawData[framesKey]; + } + if (rawFrames === null) { + return null; + } + var keyFrameCount = rawFrames.length; + if (keyFrameCount === 0) { + return null; + } + var frameIntArrayLength = this._frameIntArray.length; + var frameFloatArrayLength = this._frameFloatArray.length; + var timelineOffset = this._timelineArray.length; + if (timeline === null) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData); + } + timeline.type = timelineType; + timeline.offset = timelineOffset; + this._frameValueType = frameValueType; + this._timeline = timeline; + this._timelineArray.length += 1 + 1 + 1 + 1 + 1 + keyFrameCount; + if (rawData !== null) { + this._timelineArray[timelineOffset + 0 /* TimelineScale */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0) * 100); + this._timelineArray[timelineOffset + 1 /* TimelineOffset */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0.0) * 100); + } + else { + this._timelineArray[timelineOffset + 0 /* TimelineScale */] = 100; + this._timelineArray[timelineOffset + 1 /* TimelineOffset */] = 0; + } + this._timelineArray[timelineOffset + 2 /* TimelineKeyFrameCount */] = keyFrameCount; + this._timelineArray[timelineOffset + 3 /* TimelineFrameValueCount */] = frameValueCount; + switch (this._frameValueType) { + case 0 /* Step */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0; + break; + case 1 /* Int */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset; + break; + case 2 /* Float */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset; + break; + } + if (keyFrameCount === 1) { + timeline.frameIndicesOffset = -1; + this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + 0] = frameParser.call(this, rawFrames[0], 0, 0) - this._animation.frameOffset; + } + else { + var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. + var frameIndices = this._data.frameIndices; + var frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; + timeline.frameIndicesOffset = frameIndicesOffset; + for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) { + if (frameStart + frameCount <= i && iK < keyFrameCount) { + var rawFrame = rawFrames[iK]; + frameStart = i; // frame.frameStart; + if (iK === keyFrameCount - 1) { + frameCount = this._animation.frameCount - frameStart; + } + else { + if (rawFrame instanceof ActionFrame) { + frameCount = this._actionFrames[iK + 1].frameStart - frameStart; + } + else { + frameCount = ObjectDataParser._getNumber(rawFrame, dragonBones.DataParser.DURATION, 1); + } + } + this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + iK] = frameParser.call(this, rawFrame, frameStart, frameCount) - this._animation.frameOffset; + iK++; + } + frameIndices[frameIndicesOffset + i] = iK - 1; + } + } + this._timeline = null; // + return timeline; + }; + ObjectDataParser.prototype._parseBoneTimeline = function (rawData) { + var bone = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "")); + if (bone === null) { + return; + } + this._bone = bone; + this._slot = this._armature.getSlot(this._bone.name); + if (dragonBones.DataParser.TRANSLATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, 2 /* Float */, 2, this._parseDoubleValueFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.ROTATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, 2 /* Float */, 2, this._parseBoneRotateFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.SCALE_FRAME in rawData) { + this._frameDefaultValue = 1.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, 2 /* Float */, 2, this._parseBoneScaleFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.FRAME in rawData) { + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, 2 /* Float */, 6, this._parseBoneAllFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + this._bone = null; // + this._slot = null; // + }; + ObjectDataParser.prototype._parseSlotTimeline = function (rawData) { + var slot = this._armature.getSlot(ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "")); + if (slot === null) { + return; + } + var displayTimeline = null; + var colorTimeline = null; + this._slot = slot; + if (dragonBones.DataParser.DISPLAY_FRAME in rawData) { + displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame); + } + else { + displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame); + } + if (dragonBones.DataParser.COLOR_FRAME in rawData) { + colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame); + } + else { + colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame); + } + if (displayTimeline !== null) { + this._animation.addSlotTimeline(slot.name, displayTimeline); + } + if (colorTimeline !== null) { + this._animation.addSlotTimeline(slot.name, colorTimeline); + } + this._slot = null; // + }; + ObjectDataParser.prototype._parseFrame = function (rawData, frameStart, frameCount) { + // tslint:disable-next-line:no-unused-expression + rawData; + // tslint:disable-next-line:no-unused-expression + frameCount; + var frameOffset = this._frameArray.length; + this._frameArray.length += 1; + this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart; + return frameOffset; + }; + ObjectDataParser.prototype._parseTweenFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + if (frameCount > 0) { + if (dragonBones.DataParser.CURVE in rawData) { + var sampleCount = frameCount + 1; + this._helpArray.length = sampleCount; + var isOmited = this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray); + this._frameArray.length += 1 + 1 + this._helpArray.length; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 2 /* Curve */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = isOmited ? sampleCount : -sampleCount; + for (var i = 0; i < sampleCount; ++i) { + this._frameArray[frameOffset + 3 /* FrameCurveSamples */ + i] = Math.round(this._helpArray[i] * 10000.0); + } + } + else { + var noTween = -2.0; + var tweenEasing = noTween; + if (dragonBones.DataParser.TWEEN_EASING in rawData) { + tweenEasing = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TWEEN_EASING, noTween); + } + if (tweenEasing === noTween) { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 0 /* None */; + } + else if (tweenEasing === 0.0) { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 1 /* Line */; + } + else if (tweenEasing < 0.0) { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 3 /* QuadIn */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(-tweenEasing * 100.0); + } + else if (tweenEasing <= 1.0) { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 4 /* QuadOut */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(tweenEasing * 100.0); + } + else { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 5 /* QuadInOut */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(tweenEasing * 100.0 - 100.0); + } + } + } + else { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 0 /* None */; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseSingleValueFrame = function (rawData, frameStart, frameCount) { + var frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue); + break; + } + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale); + break; + } + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 1; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + return frameOffset; + }; + ObjectDataParser.prototype._parseDoubleValueFrame = function (rawData, frameStart, frameCount) { + var frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 2; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue); + this._frameArray[frameOffset + 2] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue); + break; + } + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale); + this._frameIntArray[frameValueOffset + 1] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale); + break; + } + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale; + this._frameFloatArray[frameValueOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + return frameOffset; + }; + ObjectDataParser.prototype._parseActionFrame = function (frame, frameStart, frameCount) { + // tslint:disable-next-line:no-unused-expression + frameCount; + var frameOffset = this._frameArray.length; + var actionCount = frame.actions.length; + this._frameArray.length += 1 + 1 + actionCount; + this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart; + this._frameArray[frameOffset + 0 /* FramePosition */ + 1] = actionCount; // Action count. + for (var i = 0; i < actionCount; ++i) { + this._frameArray[frameOffset + 0 /* FramePosition */ + 2 + i] = frame.actions[i]; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseZOrderFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + if (dragonBones.DataParser.Z_ORDER in rawData) { + var rawZOrder = rawData[dragonBones.DataParser.Z_ORDER]; + if (rawZOrder.length > 0) { + var slotCount = this._armature.sortedSlots.length; + var unchanged = new Array(slotCount - rawZOrder.length / 2); + var zOrders = new Array(slotCount); + for (var i_1 = 0; i_1 < unchanged.length; ++i_1) { + unchanged[i_1] = 0; + } + for (var i_2 = 0; i_2 < slotCount; ++i_2) { + zOrders[i_2] = -1; + } + var originalIndex = 0; + var unchangedIndex = 0; + for (var i_3 = 0, l = rawZOrder.length; i_3 < l; i_3 += 2) { + var slotIndex = rawZOrder[i_3]; + var zOrderOffset = rawZOrder[i_3 + 1]; + while (originalIndex !== slotIndex) { + unchanged[unchangedIndex++] = originalIndex++; + } + var index = originalIndex + zOrderOffset; + zOrders[index] = originalIndex++; + } + while (originalIndex < slotCount) { + unchanged[unchangedIndex++] = originalIndex++; + } + this._frameArray.length += 1 + slotCount; + this._frameArray[frameOffset + 1] = slotCount; + var i = slotCount; + while (i--) { + if (zOrders[i] === -1) { + this._frameArray[frameOffset + 2 + i] = unchanged[--unchangedIndex] || 0; + } + else { + this._frameArray[frameOffset + 2 + i] = zOrders[i] || 0; + } + } + return frameOffset; + } + } + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = 0; + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneAllFrame = function (rawData, frameStart, frameCount) { + this._helpTransform.identity(); + if (dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], this._helpTransform, 1.0); + } + // Modify rotation. + var rotation = this._helpTransform.rotation; + if (frameStart !== 0) { + if (this._prevClockwise === 0) { + rotation = this._prevRotation + dragonBones.Transform.normalizeRadian(rotation - this._prevRotation); + } + else { + if (this._prevClockwise > 0 ? rotation >= this._prevRotation : rotation <= this._prevRotation) { + this._prevClockwise = this._prevClockwise > 0 ? this._prevClockwise - 1 : this._prevClockwise + 1; + } + rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise; + } + } + this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TWEEN_ROTATE, 0.0); + this._prevRotation = rotation; + // + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 6; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.x; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.y; + this._frameFloatArray[frameFloatOffset++] = rotation; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.skew; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleX; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleY; + this._parseActionDataInFrame(rawData, frameStart, this._bone, this._slot); + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneTranslateFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0); + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneRotateFrame = function (rawData, frameStart, frameCount) { + // Modify rotation. + var rotation = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE, 0.0) * dragonBones.Transform.DEG_RAD; + if (frameStart !== 0) { + if (this._prevClockwise === 0) { + rotation = this._prevRotation + dragonBones.Transform.normalizeRadian(rotation - this._prevRotation); + } + else { + if (this._prevClockwise > 0 ? rotation >= this._prevRotation : rotation <= this._prevRotation) { + this._prevClockwise = this._prevClockwise > 0 ? this._prevClockwise - 1 : this._prevClockwise + 1; + } + rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise; + } + } + this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CLOCK_WISE, 0); + this._prevRotation = rotation; + // + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = rotation; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD; + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneScaleFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 1.0); + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotDisplayFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + if (dragonBones.DataParser.VALUE in rawData) { + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, 0); + } + else { + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0); + } + this._parseActionDataInFrame(rawData, frameStart, this._slot.parent, this._slot); + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotColorFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var colorOffset = -1; + if (dragonBones.DataParser.VALUE in rawData || dragonBones.DataParser.COLOR in rawData) { + var rawColor = dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : rawData[dragonBones.DataParser.COLOR]; + for (var k in rawColor) { + // tslint:disable-next-line:no-unused-expression + k; + this._parseColorTransform(rawColor, this._helpColorTransform); + colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset); + colorOffset -= 8; + break; + } + } + if (colorOffset < 0) { + if (this._defaultColorOffset < 0) { + this._defaultColorOffset = colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + } + colorOffset = this._defaultColorOffset; + } + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameIntOffset] = colorOffset; + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotDeformFrame = function (rawData, frameStart, frameCount) { + var frameFloatOffset = this._frameFloatArray.length; + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var rawVertices = dragonBones.DataParser.VERTICES in rawData ? rawData[dragonBones.DataParser.VERTICES] : null; + var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint + var vertexCount = this._intArray[this._mesh.geometry.offset + 0 /* GeometryVertexCount */]; + var meshName = this._mesh.parent.name + "_" + this._slot.name + "_" + this._mesh.name; + var weight = this._mesh.geometry.weight; + var x = 0.0; + var y = 0.0; + var iB = 0; + var iV = 0; + if (weight !== null) { + var rawSlotPose = this._weightSlotPose[meshName]; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + this._frameFloatArray.length += weight.count * 2; + iB = weight.offset + 2 /* WeigthBoneIndices */ + weight.bones.length; + } + else { + this._frameFloatArray.length += vertexCount * 2; + } + for (var i = 0; i < vertexCount * 2; i += 2) { + if (rawVertices === null) { + x = 0.0; + y = 0.0; + } + else { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + if (weight !== null) { + var rawBonePoses = this._weightBonePoses[meshName]; + var vertexBoneCount = this._intArray[iB++]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint, true); + x = this._helpPoint.x; + y = this._helpPoint.y; + for (var j = 0; j < vertexBoneCount; ++j) { + var boneIndex = this._intArray[iB++]; + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint, true); + this._frameFloatArray[frameFloatOffset + iV++] = this._helpPoint.x; + this._frameFloatArray[frameFloatOffset + iV++] = this._helpPoint.y; + } + } + else { + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + if (frameStart === 0) { + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.geometry.offset; + this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0; + this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseIKConstraintFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameIntOffset++] = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true) ? 1 : 0; + this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseActionData = function (rawData, type, bone, slot) { + var actions = new Array(); + if (typeof rawData === "string") { + var action = dragonBones.BaseObject.borrowObject(dragonBones.ActionData); + action.type = type; + action.name = rawData; + action.bone = bone; + action.slot = slot; + actions.push(action); + } + else if (rawData instanceof Array) { + for (var _i = 0, rawData_2 = rawData; _i < rawData_2.length; _i++) { + var rawAction = rawData_2[_i]; + var action = dragonBones.BaseObject.borrowObject(dragonBones.ActionData); + if (dragonBones.DataParser.GOTO_AND_PLAY in rawAction) { + action.type = 0 /* Play */; + action.name = ObjectDataParser._getString(rawAction, dragonBones.DataParser.GOTO_AND_PLAY, ""); + } + else { + if (dragonBones.DataParser.TYPE in rawAction && typeof rawAction[dragonBones.DataParser.TYPE] === "string") { + action.type = dragonBones.DataParser._getActionType(rawAction[dragonBones.DataParser.TYPE]); + } + else { + action.type = ObjectDataParser._getNumber(rawAction, dragonBones.DataParser.TYPE, type); + } + action.name = ObjectDataParser._getString(rawAction, dragonBones.DataParser.NAME, ""); + } + if (dragonBones.DataParser.BONE in rawAction) { + var boneName = ObjectDataParser._getString(rawAction, dragonBones.DataParser.BONE, ""); + action.bone = this._armature.getBone(boneName); + } + else { + action.bone = bone; + } + if (dragonBones.DataParser.SLOT in rawAction) { + var slotName = ObjectDataParser._getString(rawAction, dragonBones.DataParser.SLOT, ""); + action.slot = this._armature.getSlot(slotName); + } + else { + action.slot = slot; + } + var userData = null; + if (dragonBones.DataParser.INTS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawInts = rawAction[dragonBones.DataParser.INTS]; + for (var _a = 0, rawInts_1 = rawInts; _a < rawInts_1.length; _a++) { + var rawValue = rawInts_1[_a]; + userData.addInt(rawValue); + } + } + if (dragonBones.DataParser.FLOATS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawFloats = rawAction[dragonBones.DataParser.FLOATS]; + for (var _b = 0, rawFloats_1 = rawFloats; _b < rawFloats_1.length; _b++) { + var rawValue = rawFloats_1[_b]; + userData.addFloat(rawValue); + } + } + if (dragonBones.DataParser.STRINGS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawStrings = rawAction[dragonBones.DataParser.STRINGS]; + for (var _c = 0, rawStrings_1 = rawStrings; _c < rawStrings_1.length; _c++) { + var rawValue = rawStrings_1[_c]; + userData.addString(rawValue); + } + } + action.data = userData; + actions.push(action); + } + } + return actions; + }; + ObjectDataParser.prototype._parseDeformFrame = function (rawData, frameStart, frameCount) { + var frameFloatOffset = this._frameFloatArray.length; + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var rawVertices = dragonBones.DataParser.VERTICES in rawData ? + rawData[dragonBones.DataParser.VERTICES] : + (dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : null); + var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint + var vertexCount = this._intArray[this._geometry.offset + 0 /* GeometryVertexCount */]; + var weight = this._geometry.weight; + var x = 0.0; + var y = 0.0; + if (weight !== null) { + // TODO + } + else { + this._frameFloatArray.length += vertexCount * 2; + for (var i = 0; i < vertexCount * 2; i += 2) { + if (rawVertices !== null) { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + else { + x = 0.0; + y = 0.0; + } + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + if (frameStart === 0) { + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._geometry.offset; + this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0; + this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseTransform = function (rawData, transform, scale) { + transform.x = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0) * scale; + transform.y = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0) * scale; + if (dragonBones.DataParser.ROTATE in rawData || dragonBones.DataParser.SKEW in rawData) { + transform.rotation = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE, 0.0) * dragonBones.Transform.DEG_RAD); + transform.skew = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD); + } + else if (dragonBones.DataParser.SKEW_X in rawData || dragonBones.DataParser.SKEW_Y in rawData) { + transform.rotation = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW_Y, 0.0) * dragonBones.Transform.DEG_RAD); + transform.skew = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW_X, 0.0) * dragonBones.Transform.DEG_RAD) - transform.rotation; + } + transform.scaleX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE_X, 1.0); + transform.scaleY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE_Y, 1.0); + }; + ObjectDataParser.prototype._parseColorTransform = function (rawData, color) { + color.alphaMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA_MULTIPLIER, 100) * 0.01; + color.redMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.RED_MULTIPLIER, 100) * 0.01; + color.greenMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_MULTIPLIER, 100) * 0.01; + color.blueMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_MULTIPLIER, 100) * 0.01; + color.alphaOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA_OFFSET, 0); + color.redOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.RED_OFFSET, 0); + color.greenOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_OFFSET, 0); + color.blueOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_OFFSET, 0); + }; + ObjectDataParser.prototype._parseGeometry = function (rawData, geometry) { + var rawVertices = rawData[dragonBones.DataParser.VERTICES]; + var vertexCount = Math.floor(rawVertices.length / 2); // uint + var triangleCount = 0; + var geometryOffset = this._intArray.length; + var verticesOffset = this._floatArray.length; + // + geometry.offset = geometryOffset; + geometry.data = this._data; + // + this._intArray.length += 1 + 1 + 1 + 1; + this._intArray[geometryOffset + 0 /* GeometryVertexCount */] = vertexCount; + this._intArray[geometryOffset + 2 /* GeometryFloatOffset */] = verticesOffset; + this._intArray[geometryOffset + 3 /* GeometryWeightOffset */] = -1; // + // + this._floatArray.length += vertexCount * 2; + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[verticesOffset + i] = rawVertices[i]; + } + if (dragonBones.DataParser.TRIANGLES in rawData) { + var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES]; + triangleCount = Math.floor(rawTriangles.length / 3); // uint + // + this._intArray.length += triangleCount * 3; + for (var i = 0, l = triangleCount * 3; i < l; ++i) { + this._intArray[geometryOffset + 4 /* GeometryVertexIndices */ + i] = rawTriangles[i]; + } + } + // Fill triangle count. + this._intArray[geometryOffset + 1 /* GeometryTriangleCount */] = triangleCount; + if (dragonBones.DataParser.UVS in rawData) { + var rawUVs = rawData[dragonBones.DataParser.UVS]; + var uvOffset = verticesOffset + vertexCount * 2; + this._floatArray.length += vertexCount * 2; + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[uvOffset + i] = rawUVs[i]; + } + } + if (dragonBones.DataParser.WEIGHTS in rawData) { + var rawWeights = rawData[dragonBones.DataParser.WEIGHTS]; + var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint + var weightOffset = this._intArray.length; + var floatOffset = this._floatArray.length; + var weightBoneCount = 0; + var sortedBones = this._armature.sortedBones; + var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData); + weight.count = weightCount; + weight.offset = weightOffset; + this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount; + this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset; + if (dragonBones.DataParser.BONE_POSE in rawData) { + var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE]; + var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE]; + var weightBoneIndices = new Array(); + weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint + weightBoneIndices.length = weightBoneCount; + for (var i = 0; i < weightBoneCount; ++i) { + var rawBoneIndex = rawBonePoses[i * 7]; // uint + var bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + weightBoneIndices[i] = rawBoneIndex; + this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone); + } + this._floatArray.length += weightCount * 3; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) { + var iD = i * 2; + var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint + var x = this._floatArray[verticesOffset + iD]; + var y = this._floatArray[verticesOffset + iD + 1]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint); + x = this._helpPoint.x; + y = this._helpPoint.y; + for (var j = 0; j < vertexBoneCount; ++j) { + var rawBoneIndex = rawWeights[iW++]; // uint + var boneIndex = weightBoneIndices.indexOf(rawBoneIndex); + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint); + this._intArray[iB++] = boneIndex; + this._floatArray[iV++] = rawWeights[iW++]; + this._floatArray[iV++] = this._helpPoint.x; + this._floatArray[iV++] = this._helpPoint.y; + } + } + } + else { + var rawBones = rawData[dragonBones.DataParser.BONES]; + weightBoneCount = rawBones.length; + for (var i = 0; i < weightBoneCount; i++) { + var rawBoneIndex = rawBones[i]; + var bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone); + } + this._floatArray.length += weightCount * 3; + for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) { + var vertexBoneCount = rawWeights[iW++]; + this._intArray[iB++] = vertexBoneCount; + for (var j = 0; j < vertexBoneCount; j++) { + var boneIndex = rawWeights[iW++]; + var boneWeight = rawWeights[iW++]; + var x = rawVertices[iV++]; + var y = rawVertices[iV++]; + this._intArray[iB++] = rawBones.indexOf(boneIndex); + this._floatArray[iF++] = boneWeight; + this._floatArray[iF++] = x; + this._floatArray[iF++] = y; + } + } + } + geometry.weight = weight; + } + }; + ObjectDataParser.prototype._parseArray = function (rawData) { + // tslint:disable-next-line:no-unused-expression + rawData; + this._intArray.length = 0; + this._floatArray.length = 0; + this._frameIntArray.length = 0; + this._frameFloatArray.length = 0; + this._frameArray.length = 0; + this._timelineArray.length = 0; + this._colorArray.length = 0; + }; + ObjectDataParser.prototype._modifyArray = function () { + // Align. + if ((this._intArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._intArray.push(0); + } + if ((this._frameIntArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._frameIntArray.push(0); + } + if ((this._frameArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._frameArray.push(0); + } + if ((this._timelineArray.length % Uint16Array.BYTES_PER_ELEMENT) !== 0) { + this._timelineArray.push(0); + } + if ((this._timelineArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._colorArray.push(0); + } + var l1 = this._intArray.length * Int16Array.BYTES_PER_ELEMENT; + var l2 = this._floatArray.length * Float32Array.BYTES_PER_ELEMENT; + var l3 = this._frameIntArray.length * Int16Array.BYTES_PER_ELEMENT; + var l4 = this._frameFloatArray.length * Float32Array.BYTES_PER_ELEMENT; + var l5 = this._frameArray.length * Int16Array.BYTES_PER_ELEMENT; + var l6 = this._timelineArray.length * Uint16Array.BYTES_PER_ELEMENT; + var l7 = this._colorArray.length * Int16Array.BYTES_PER_ELEMENT; + var lTotal = l1 + l2 + l3 + l4 + l5 + l6 + l7; + // + var binary = new ArrayBuffer(lTotal); + var intArray = new Int16Array(binary, 0, this._intArray.length); + var floatArray = new Float32Array(binary, l1, this._floatArray.length); + var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length); + var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length); + var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length); + var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length); + var colorArray = new Int16Array(binary, l1 + l2 + l3 + l4 + l5 + l6, this._colorArray.length); + for (var i = 0, l = this._intArray.length; i < l; ++i) { + intArray[i] = this._intArray[i]; + } + for (var i = 0, l = this._floatArray.length; i < l; ++i) { + floatArray[i] = this._floatArray[i]; + } + for (var i = 0, l = this._frameIntArray.length; i < l; ++i) { + frameIntArray[i] = this._frameIntArray[i]; + } + for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) { + frameFloatArray[i] = this._frameFloatArray[i]; + } + for (var i = 0, l = this._frameArray.length; i < l; ++i) { + frameArray[i] = this._frameArray[i]; + } + for (var i = 0, l = this._timelineArray.length; i < l; ++i) { + timelineArray[i] = this._timelineArray[i]; + } + for (var i = 0, l = this._colorArray.length; i < l; ++i) { + colorArray[i] = this._colorArray[i]; + } + this._data.binary = binary; + this._data.intArray = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = frameArray; + this._data.timelineArray = timelineArray; + this._data.colorArray = colorArray; + this._defaultColorOffset = -1; + }; + ObjectDataParser.prototype.parseDragonBonesData = function (rawData, scale) { + if (scale === void 0) { scale = 1; } + console.assert(rawData !== null && rawData !== undefined, "Data error."); + var version = ObjectDataParser._getString(rawData, dragonBones.DataParser.VERSION, ""); + var compatibleVersion = ObjectDataParser._getString(rawData, dragonBones.DataParser.COMPATIBLE_VERSION, ""); + if (dragonBones.DataParser.DATA_VERSIONS.indexOf(version) >= 0 || + dragonBones.DataParser.DATA_VERSIONS.indexOf(compatibleVersion) >= 0) { + var data = dragonBones.BaseObject.borrowObject(dragonBones.DragonBonesData); + data.version = version; + data.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + data.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, 24); + if (data.frameRate === 0) { + data.frameRate = 24; + } + if (dragonBones.DataParser.ARMATURE in rawData) { + this._data = data; + this._parseArray(rawData); + var rawArmatures = rawData[dragonBones.DataParser.ARMATURE]; + for (var _i = 0, rawArmatures_1 = rawArmatures; _i < rawArmatures_1.length; _i++) { + var rawArmature = rawArmatures_1[_i]; + data.addArmature(this._parseArmature(rawArmature, scale)); + } + if (!this._data.binary) { + this._modifyArray(); + } + if (dragonBones.DataParser.STAGE in rawData) { + data.stage = data.getArmature(ObjectDataParser._getString(rawData, dragonBones.DataParser.STAGE, "")); + } + else if (data.armatureNames.length > 0) { + data.stage = data.getArmature(data.armatureNames[0]); + } + this._data = null; + } + if (dragonBones.DataParser.TEXTURE_ATLAS in rawData) { + this._rawTextureAtlases = rawData[dragonBones.DataParser.TEXTURE_ATLAS]; + } + return data; + } + else { + console.assert(false, "Nonsupport data version: " + version + "\n" + + "Please convert DragonBones data to support version.\n" + + "Read more: https://github.com/DragonBones/Tools/"); + } + return null; + }; + ObjectDataParser.prototype.parseTextureAtlasData = function (rawData, textureAtlasData, scale) { + if (scale === void 0) { scale = 1.0; } + console.assert(rawData !== undefined); + if (rawData === null) { + if (this._rawTextureAtlases === null || this._rawTextureAtlases.length === 0) { + return false; + } + var rawTextureAtlas = this._rawTextureAtlases[this._rawTextureAtlasIndex++]; + this.parseTextureAtlasData(rawTextureAtlas, textureAtlasData, scale); + if (this._rawTextureAtlasIndex >= this._rawTextureAtlases.length) { + this._rawTextureAtlasIndex = 0; + this._rawTextureAtlases = null; + } + return true; + } + // Texture format. + textureAtlasData.width = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WIDTH, 0); + textureAtlasData.height = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.HEIGHT, 0); + textureAtlasData.scale = scale === 1.0 ? (1.0 / ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0)) : scale; + textureAtlasData.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + textureAtlasData.imagePath = ObjectDataParser._getString(rawData, dragonBones.DataParser.IMAGE_PATH, ""); + if (dragonBones.DataParser.SUB_TEXTURE in rawData) { + var rawTextures = rawData[dragonBones.DataParser.SUB_TEXTURE]; + for (var i = 0, l = rawTextures.length; i < l; ++i) { + var rawTexture = rawTextures[i]; + var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0); + var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0); + var textureData = textureAtlasData.createTexture(); + textureData.rotated = ObjectDataParser._getBoolean(rawTexture, dragonBones.DataParser.ROTATED, false); + textureData.name = ObjectDataParser._getString(rawTexture, dragonBones.DataParser.NAME, ""); + textureData.region.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.X, 0.0); + textureData.region.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.Y, 0.0); + textureData.region.width = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.WIDTH, 0.0); + textureData.region.height = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.HEIGHT, 0.0); + if (frameWidth > 0.0 && frameHeight > 0.0) { + textureData.frame = dragonBones.TextureData.createRectangle(); + textureData.frame.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_X, 0.0); + textureData.frame.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_Y, 0.0); + textureData.frame.width = frameWidth; + textureData.frame.height = frameHeight; + } + textureAtlasData.addTexture(textureData); + } + } + return true; + }; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + ObjectDataParser.getInstance = function () { + if (ObjectDataParser._objectDataParserInstance === null) { + ObjectDataParser._objectDataParserInstance = new ObjectDataParser(); + } + return ObjectDataParser._objectDataParserInstance; + }; + ObjectDataParser._objectDataParserInstance = null; + return ObjectDataParser; + }(dragonBones.DataParser)); + dragonBones.ObjectDataParser = ObjectDataParser; + /** + * @private + */ + var ActionFrame = (function () { + function ActionFrame() { + this.frameStart = 0; + this.actions = []; + } + return ActionFrame; + }()); + dragonBones.ActionFrame = ActionFrame; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var BinaryDataParser = (function (_super) { + __extends(BinaryDataParser, _super); + function BinaryDataParser() { + return _super !== null && _super.apply(this, arguments) || this; + } + BinaryDataParser.prototype._inRange = function (a, min, max) { + return min <= a && a <= max; + }; + BinaryDataParser.prototype._decodeUTF8 = function (data) { + var EOF_byte = -1; + var EOF_code_point = -1; + var FATAL_POINT = 0xFFFD; + var pos = 0; + var result = ""; + var code_point; + var utf8_code_point = 0; + var utf8_bytes_needed = 0; + var utf8_bytes_seen = 0; + var utf8_lower_boundary = 0; + while (data.length > pos) { + var _byte = data[pos++]; + if (_byte === EOF_byte) { + if (utf8_bytes_needed !== 0) { + code_point = FATAL_POINT; + } + else { + code_point = EOF_code_point; + } + } + else { + if (utf8_bytes_needed === 0) { + if (this._inRange(_byte, 0x00, 0x7F)) { + code_point = _byte; + } + else { + if (this._inRange(_byte, 0xC2, 0xDF)) { + utf8_bytes_needed = 1; + utf8_lower_boundary = 0x80; + utf8_code_point = _byte - 0xC0; + } + else if (this._inRange(_byte, 0xE0, 0xEF)) { + utf8_bytes_needed = 2; + utf8_lower_boundary = 0x800; + utf8_code_point = _byte - 0xE0; + } + else if (this._inRange(_byte, 0xF0, 0xF4)) { + utf8_bytes_needed = 3; + utf8_lower_boundary = 0x10000; + utf8_code_point = _byte - 0xF0; + } + else { + } + utf8_code_point = utf8_code_point * Math.pow(64, utf8_bytes_needed); + code_point = null; + } + } + else if (!this._inRange(_byte, 0x80, 0xBF)) { + utf8_code_point = 0; + utf8_bytes_needed = 0; + utf8_bytes_seen = 0; + utf8_lower_boundary = 0; + pos--; + code_point = _byte; + } + else { + utf8_bytes_seen += 1; + utf8_code_point = utf8_code_point + (_byte - 0x80) * Math.pow(64, utf8_bytes_needed - utf8_bytes_seen); + if (utf8_bytes_seen !== utf8_bytes_needed) { + code_point = null; + } + else { + var cp = utf8_code_point; + var lower_boundary = utf8_lower_boundary; + utf8_code_point = 0; + utf8_bytes_needed = 0; + utf8_bytes_seen = 0; + utf8_lower_boundary = 0; + if (this._inRange(cp, lower_boundary, 0x10FFFF) && !this._inRange(cp, 0xD800, 0xDFFF)) { + code_point = cp; + } + else { + code_point = _byte; + } + } + } + } + //Decode string + if (code_point !== null && code_point !== EOF_code_point) { + if (code_point <= 0xFFFF) { + if (code_point > 0) + result += String.fromCharCode(code_point); + } + else { + code_point -= 0x10000; + result += String.fromCharCode(0xD800 + ((code_point >> 10) & 0x3ff)); + result += String.fromCharCode(0xDC00 + (code_point & 0x3ff)); + } + } + } + return result; + }; + BinaryDataParser.prototype._parseBinaryTimeline = function (type, offset, timelineData) { + if (timelineData === void 0) { timelineData = null; } + var timeline = timelineData !== null ? timelineData : dragonBones.BaseObject.borrowObject(dragonBones.TimelineData); + timeline.type = type; + timeline.offset = offset; + this._timeline = timeline; + var keyFrameCount = this._timelineArrayBuffer[timeline.offset + 2 /* TimelineKeyFrameCount */]; + if (keyFrameCount === 1) { + timeline.frameIndicesOffset = -1; + } + else { + var frameIndicesOffset = 0; + var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. + var frameIndices = this._data.frameIndices; + frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; + timeline.frameIndicesOffset = frameIndicesOffset; + for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) { + if (frameStart + frameCount <= i && iK < keyFrameCount) { + frameStart = this._frameArrayBuffer[this._animation.frameOffset + this._timelineArrayBuffer[timeline.offset + 5 /* TimelineFrameOffset */ + iK]]; + if (iK === keyFrameCount - 1) { + frameCount = this._animation.frameCount - frameStart; + } + else { + frameCount = this._frameArrayBuffer[this._animation.frameOffset + this._timelineArrayBuffer[timeline.offset + 5 /* TimelineFrameOffset */ + iK + 1]] - frameStart; + } + iK++; + } + frameIndices[frameIndicesOffset + i] = iK - 1; + } + } + this._timeline = null; // + return timeline; + }; + BinaryDataParser.prototype._parseAnimation = function (rawData) { + var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData); + animation.blendType = dragonBones.DataParser._getAnimationBlendType(dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, "")); + animation.frameCount = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0); + animation.playTimes = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1); + animation.duration = animation.frameCount / this._armature.frameRate; // float + animation.fadeInTime = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0); + animation.scale = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0); + animation.name = dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (animation.name.length === 0) { + animation.name = dragonBones.DataParser.DEFAULT_NAME; + } + // Offsets. + var offsets = rawData[dragonBones.DataParser.OFFSET]; + animation.frameIntOffset = offsets[0]; + animation.frameFloatOffset = offsets[1]; + animation.frameOffset = offsets[2]; + this._animation = animation; + if (dragonBones.DataParser.ACTION in rawData) { + animation.actionTimeline = this._parseBinaryTimeline(0 /* Action */, rawData[dragonBones.DataParser.ACTION]); + } + if (dragonBones.DataParser.Z_ORDER in rawData) { + animation.zOrderTimeline = this._parseBinaryTimeline(1 /* ZOrder */, rawData[dragonBones.DataParser.Z_ORDER]); + } + if (dragonBones.DataParser.BONE in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.BONE]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var bone = this._armature.getBone(k); + if (bone === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addBoneTimeline(bone.name, timeline); + } + } + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.SLOT]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var slot = this._armature.getSlot(k); + if (slot === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addSlotTimeline(slot.name, timeline); + } + } + } + if (dragonBones.DataParser.CONSTRAINT in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.CONSTRAINT]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var constraint = this._armature.getConstraint(k); + if (constraint === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addConstraintTimeline(constraint.name, timeline); + } + } + } + if (dragonBones.DataParser.TIMELINE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.TIMELINE]; + for (var _i = 0, rawTimelines_6 = rawTimelines; _i < rawTimelines_6.length; _i++) { + var rawTimeline = rawTimelines_6[_i]; + var timelineOffset = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.OFFSET, 0); + if (timelineOffset >= 0) { + var timelineType = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */); + var timelineName = dragonBones.ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var timeline = null; + if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData); + var animaitonTimeline = timeline; + animaitonTimeline.x = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0); + animaitonTimeline.y = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0); + } + timeline = this._parseBinaryTimeline(timelineType, timelineOffset, timeline); + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 1 /* ZOrder */: + // TODO + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 50 /* Surface */: + case 60 /* BoneAlpha */: + this._animation.addBoneTimeline(timelineName, timeline); + break; + case 20 /* SlotDisplay */: + case 21 /* SlotColor */: + case 22 /* SlotDeform */: + case 23 /* SlotZIndex */: + case 24 /* SlotAlpha */: + this._animation.addSlotTimeline(timelineName, timeline); + break; + case 30 /* IKConstraint */: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + case 42 /* AnimationParameter */: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null; + return animation; + }; + BinaryDataParser.prototype._parseGeometry = function (rawData, geometry) { + geometry.offset = rawData[dragonBones.DataParser.OFFSET]; + geometry.data = this._data; + var weightOffset = this._intArrayBuffer[geometry.offset + 3 /* GeometryWeightOffset */]; + if (weightOffset >= 0) { + var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData); + var vertexCount = this._intArrayBuffer[geometry.offset + 0 /* GeometryVertexCount */]; + var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */]; + weight.offset = weightOffset; + for (var i = 0; i < boneCount; ++i) { + var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i]; + weight.addBone(this._rawBones[boneIndex]); + } + var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount; + var weightCount = 0; + for (var i = 0, l = vertexCount; i < l; ++i) { + var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++]; + weightCount += vertexBoneCount; + boneIndicesOffset += vertexBoneCount; + } + weight.count = weightCount; + geometry.weight = weight; + } + }; + BinaryDataParser.prototype._parseArray = function (rawData) { + var offsets = rawData[dragonBones.DataParser.OFFSET]; + var l1 = offsets[1]; + var l2 = offsets[3]; + var l3 = offsets[5]; + var l4 = offsets[7]; + var l5 = offsets[9]; + var l6 = offsets[11]; + var l7 = offsets.length > 12 ? offsets[13] : 0; // Color. + var intArray = new Int16Array(this._binary, this._binaryOffset + offsets[0], l1 / Int16Array.BYTES_PER_ELEMENT); + var floatArray = new Float32Array(this._binary, this._binaryOffset + offsets[2], l2 / Float32Array.BYTES_PER_ELEMENT); + var frameIntArray = new Int16Array(this._binary, this._binaryOffset + offsets[4], l3 / Int16Array.BYTES_PER_ELEMENT); + var frameFloatArray = new Float32Array(this._binary, this._binaryOffset + offsets[6], l4 / Float32Array.BYTES_PER_ELEMENT); + var frameArray = new Int16Array(this._binary, this._binaryOffset + offsets[8], l5 / Int16Array.BYTES_PER_ELEMENT); + var timelineArray = new Uint16Array(this._binary, this._binaryOffset + offsets[10], l6 / Uint16Array.BYTES_PER_ELEMENT); + var colorArray = l7 > 0 ? new Int16Array(this._binary, this._binaryOffset + offsets[12], l7 / Int16Array.BYTES_PER_ELEMENT) : intArray; // Color. + this._data.binary = this._binary; + this._data.intArray = this._intArrayBuffer = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = this._frameArrayBuffer = frameArray; + this._data.timelineArray = this._timelineArrayBuffer = timelineArray; + this._data.colorArray = colorArray; + }; + BinaryDataParser.prototype.parseDragonBonesData = function (rawData, scale) { + if (scale === void 0) { scale = 1; } + console.assert(rawData !== null && rawData !== undefined && rawData instanceof ArrayBuffer, "Data error."); + var tag = new Uint8Array(rawData, 0, 8); + if (tag[0] !== "D".charCodeAt(0) || + tag[1] !== "B".charCodeAt(0) || + tag[2] !== "D".charCodeAt(0) || + tag[3] !== "T".charCodeAt(0)) { + console.assert(false, "Nonsupport data."); + return null; + } + var headerLength = new Uint32Array(rawData, 8, 1)[0]; + var headerBytes = new Uint8Array(rawData, 8 + 4, headerLength); + var headerString = this._decodeUTF8(headerBytes); + var header = JSON.parse(headerString); + // + this._binaryOffset = 8 + 4 + headerLength; + this._binary = rawData; + return _super.prototype.parseDragonBonesData.call(this, header, scale); + }; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + BinaryDataParser.getInstance = function () { + if (BinaryDataParser._binaryDataParserInstance === null) { + BinaryDataParser._binaryDataParserInstance = new BinaryDataParser(); + } + return BinaryDataParser._binaryDataParserInstance; + }; + BinaryDataParser._binaryDataParserInstance = null; + return BinaryDataParser; + }(dragonBones.ObjectDataParser)); + dragonBones.BinaryDataParser = BinaryDataParser; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) + * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. + * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) + * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 + * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + var BaseFactory = (function () { + /** + * - Create a factory instance. (typically only one global factory instance is required) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) + * @version DragonBones 3.0 + * @language zh_CN + */ + function BaseFactory(dataParser) { + if (dataParser === void 0) { dataParser = null; } + /** + * @private + */ + this.autoSearch = false; + this._dragonBonesDataMap = {}; + this._textureAtlasDataMap = {}; + this._dragonBones = null; + this._dataParser = null; + if (BaseFactory._objectParser === null) { + BaseFactory._objectParser = new dragonBones.ObjectDataParser(); + } + if (BaseFactory._binaryParser === null) { + BaseFactory._binaryParser = new dragonBones.BinaryDataParser(); + } + this._dataParser = dataParser !== null ? dataParser : BaseFactory._objectParser; + } + BaseFactory.prototype._isSupportMesh = function () { + return true; + }; + BaseFactory.prototype._getTextureData = function (textureAtlasName, textureName) { + if (textureAtlasName in this._textureAtlasDataMap) { + for (var _i = 0, _a = this._textureAtlasDataMap[textureAtlasName]; _i < _a.length; _i++) { + var textureAtlasData = _a[_i]; + var textureData = textureAtlasData.getTexture(textureName); + if (textureData !== null) { + return textureData; + } + } + } + if (this.autoSearch) { + for (var k in this._textureAtlasDataMap) { + for (var _b = 0, _c = this._textureAtlasDataMap[k]; _b < _c.length; _b++) { + var textureAtlasData = _c[_b]; + if (textureAtlasData.autoSearch) { + var textureData = textureAtlasData.getTexture(textureName); + if (textureData !== null) { + return textureData; + } + } + } + } + } + return null; + }; + BaseFactory.prototype._fillBuildArmaturePackage = function (dataPackage, dragonBonesName, armatureName, skinName, textureAtlasName) { + var dragonBonesData = null; + var armatureData = null; + if (dragonBonesName.length > 0) { + if (dragonBonesName in this._dragonBonesDataMap) { + dragonBonesData = this._dragonBonesDataMap[dragonBonesName]; + armatureData = dragonBonesData.getArmature(armatureName); + } + } + if (armatureData === null && (dragonBonesName.length === 0 || this.autoSearch)) { + for (var k in this._dragonBonesDataMap) { + dragonBonesData = this._dragonBonesDataMap[k]; + if (dragonBonesName.length === 0 || dragonBonesData.autoSearch) { + armatureData = dragonBonesData.getArmature(armatureName); + if (armatureData !== null) { + dragonBonesName = k; + break; + } + } + } + } + if (armatureData !== null) { + dataPackage.dataName = dragonBonesName; + dataPackage.textureAtlasName = textureAtlasName; + dataPackage.data = dragonBonesData; + dataPackage.armature = armatureData; + dataPackage.skin = null; + if (skinName.length > 0) { + dataPackage.skin = armatureData.getSkin(skinName); + if (dataPackage.skin === null && this.autoSearch) { + for (var k in this._dragonBonesDataMap) { + var skinDragonBonesData = this._dragonBonesDataMap[k]; + var skinArmatureData = skinDragonBonesData.getArmature(skinName); + if (skinArmatureData !== null) { + dataPackage.skin = skinArmatureData.defaultSkin; + break; + } + } + } + } + if (dataPackage.skin === null) { + dataPackage.skin = armatureData.defaultSkin; + } + return true; + } + return false; + }; + BaseFactory.prototype._buildBones = function (dataPackage, armature) { + for (var _i = 0, _a = dataPackage.armature.sortedBones; _i < _a.length; _i++) { + var boneData = _a[_i]; + var bone = dragonBones.BaseObject.borrowObject(boneData.type === 0 /* Bone */ ? dragonBones.Bone : dragonBones.Surface); + bone.init(boneData, armature); + } + }; + /** + * @private + */ + BaseFactory.prototype._buildSlots = function (dataPackage, armature) { + var currentSkin = dataPackage.skin; + var defaultSkin = dataPackage.armature.defaultSkin; + if (currentSkin === null || defaultSkin === null) { + return; + } + var skinSlots = {}; + for (var k in defaultSkin.displays) { + var displays = defaultSkin.getDisplays(k); + skinSlots[k] = displays; + } + if (currentSkin !== defaultSkin) { + for (var k in currentSkin.displays) { + var displays = currentSkin.getDisplays(k); + skinSlots[k] = displays; + } + } + for (var _i = 0, _a = dataPackage.armature.sortedSlots; _i < _a.length; _i++) { + var slotData = _a[_i]; + var displayDatas = slotData.name in skinSlots ? skinSlots[slotData.name] : null; + var slot = this._buildSlot(dataPackage, slotData, armature); + if (displayDatas !== null) { + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); + if (displayData !== null) { + if (dataPackage.textureAtlasName.length > 0) { + var textureData = this._getTextureData(dataPackage.textureAtlasName, displayData.path); + slot.replaceTextureData(textureData, i); + } + var display = this._getSlotDisplay(dataPackage, displayData, slot); + slot.replaceDisplay(display, i); + } + else { + slot.replaceDisplay(null); + } + } + } + slot._setDisplayIndex(slotData.displayIndex, true); + } + }; + BaseFactory.prototype._buildConstraints = function (dataPackage, armature) { + var constraints = dataPackage.armature.constraints; + for (var k in constraints) { + var constraintData = constraints[k]; + // TODO more constraint type. + switch (constraintData.type) { + case 0 /* IK */: + var ikConstraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraint); + ikConstraint.init(constraintData, armature); + armature._addConstraint(ikConstraint); + break; + case 1 /* Path */: + var pathConstraint = dragonBones.BaseObject.borrowObject(dragonBones.PathConstraint); + pathConstraint.init(constraintData, armature); + armature._addConstraint(pathConstraint); + break; + default: + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraint); + constraint.init(constraintData, armature); + armature._addConstraint(constraint); + break; + } + } + }; + BaseFactory.prototype._buildChildArmature = function (dataPackage, _slot, displayData) { + return this.buildArmature(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage !== null ? dataPackage.textureAtlasName : ""); + }; + BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, slot) { + var dataName = dataPackage !== null ? dataPackage.dataName : displayData.parent.parent.parent.name; + var display = null; + switch (displayData.type) { + case 0 /* Image */: { + var imageDisplayData = displayData; + if (imageDisplayData.texture === null) { + imageDisplayData.texture = this._getTextureData(dataName, displayData.path); + } + display = slot.rawDisplay; + break; + } + case 2 /* Mesh */: { + var meshDisplayData = displayData; + if (meshDisplayData.texture === null) { + meshDisplayData.texture = this._getTextureData(dataName, meshDisplayData.path); + } + if (this._isSupportMesh()) { + display = slot.meshDisplay; + } + else { + display = slot.rawDisplay; + } + break; + } + case 1 /* Armature */: { + var armatureDisplayData = displayData; + var childArmature = this._buildChildArmature(dataPackage, slot, armatureDisplayData); + if (childArmature !== null) { + childArmature.inheritAnimation = armatureDisplayData.inheritAnimation; + if (!childArmature.inheritAnimation) { + var actions = armatureDisplayData.actions.length > 0 ? armatureDisplayData.actions : childArmature.armatureData.defaultActions; + if (actions.length > 0) { + for (var _i = 0, actions_6 = actions; _i < actions_6.length; _i++) { + var action = actions_6[_i]; + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + dragonBones.EventObject.actionDataToInstance(action, eventObject, slot.armature); + eventObject.slot = slot; + slot.armature._bufferAction(eventObject, false); + } + } + else { + childArmature.animation.play(); + } + } + armatureDisplayData.armature = childArmature.armatureData; // + } + display = childArmature; + break; + } + case 3 /* BoundingBox */: + break; + default: + break; + } + return display; + }; + /** + * - Parse the raw data to a DragonBonesData instance and cache it to the factory. + * @param rawData - The raw data. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for all armatures. (Default: 1.0) + * @returns DragonBonesData instance + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 + * @param rawData - 原始数据。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) + * @returns DragonBonesData 实例 + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.parseDragonBonesData = function (rawData, name, scale) { + if (name === void 0) { name = null; } + if (scale === void 0) { scale = 1.0; } + var dataParser = rawData instanceof ArrayBuffer ? BaseFactory._binaryParser : this._dataParser; + var dragonBonesData = dataParser.parseDragonBonesData(rawData, scale); + while (true) { + var textureAtlasData = this._buildTextureAtlasData(null, null); + if (dataParser.parseTextureAtlasData(null, textureAtlasData, scale)) { + this.addTextureAtlasData(textureAtlasData, name); + } + else { + textureAtlasData.returnToPool(); + break; + } + } + if (dragonBonesData !== null) { + this.addDragonBonesData(dragonBonesData, name); + } + return dragonBonesData; + }; + /** + * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. + * @param rawData - The raw texture atlas data. + * @param textureAtlas - The texture atlas object. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for the map set. (Default: 1.0) + * @returns TextureAtlasData instance + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 + * @param rawData - 原始贴图集数据。 + * @param textureAtlas - 贴图集对象。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) + * @returns TextureAtlasData 实例 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.parseTextureAtlasData = function (rawData, textureAtlas, name, scale) { + if (name === void 0) { name = null; } + if (scale === void 0) { scale = 1.0; } + var textureAtlasData = this._buildTextureAtlasData(null, null); + this._dataParser.parseTextureAtlasData(rawData, textureAtlasData, scale); + this._buildTextureAtlasData(textureAtlasData, textureAtlas || null); + this.addTextureAtlasData(textureAtlasData, name); + return textureAtlasData; + }; + /** + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN + */ + BaseFactory.prototype.updateTextureAtlases = function (textureAtlases, name) { + var textureAtlasDatas = this.getTextureAtlasData(name); + if (textureAtlasDatas !== null) { + for (var i = 0, l = textureAtlasDatas.length; i < l; ++i) { + if (i < textureAtlases.length) { + this._buildTextureAtlasData(textureAtlasDatas[i], textureAtlases[i]); + } + } + } + }; + /** + * - Get a specific DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @returns DragonBonesData instance + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 DragonBonesData 实例。 + * @param name - DragonBonesData 实例的缓存名称。 + * @returns DragonBonesData 实例 + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.getDragonBonesData = function (name) { + return (name in this._dragonBonesDataMap) ? this._dragonBonesDataMap[name] : null; + }; + /** + * - Cache a DragonBonesData instance to the factory. + * @param data - The DragonBonesData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 DragonBonesData 实例缓存到工厂中。 + * @param data - DragonBonesData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.addDragonBonesData = function (data, name) { + if (name === void 0) { name = null; } + name = name !== null ? name : data.name; + if (name in this._dragonBonesDataMap) { + if (this._dragonBonesDataMap[name] === data) { + return; + } + console.warn("Can not add same name data: " + name); + return; + } + this._dragonBonesDataMap[name] = data; + }; + /** + * - Remove a DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @param disposeData - Whether to dispose data. (Default: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 DragonBonesData 实例。 + * @param name - DragonBonesData 实例缓存名称。 + * @param disposeData - 是否释放数据。 (默认: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.removeDragonBonesData = function (name, disposeData) { + if (disposeData === void 0) { disposeData = true; } + if (name in this._dragonBonesDataMap) { + if (disposeData) { + this._dragonBones.bufferObject(this._dragonBonesDataMap[name]); + } + delete this._dragonBonesDataMap[name]; + } + }; + /** + * - Get a list of specific TextureAtlasData instances. + * @param name - The TextureAtlasData cahce name. + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 TextureAtlasData 实例列表。 + * @param name - TextureAtlasData 实例缓存名称。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.getTextureAtlasData = function (name) { + return (name in this._textureAtlasDataMap) ? this._textureAtlasDataMap[name] : null; + }; + /** + * - Cache a TextureAtlasData instance to the factory. + * @param data - The TextureAtlasData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 TextureAtlasData 实例缓存到工厂中。 + * @param data - TextureAtlasData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.addTextureAtlasData = function (data, name) { + if (name === void 0) { name = null; } + name = name !== null ? name : data.name; + var textureAtlasList = (name in this._textureAtlasDataMap) ? this._textureAtlasDataMap[name] : (this._textureAtlasDataMap[name] = []); + if (textureAtlasList.indexOf(data) < 0) { + textureAtlasList.push(data); + } + }; + /** + * - Remove a TextureAtlasData instance. + * @param name - The TextureAtlasData instance cache name. + * @param disposeData - Whether to dispose data. + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 TextureAtlasData 实例。 + * @param name - TextureAtlasData 实例的缓存名称。 + * @param disposeData - 是否释放数据。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.removeTextureAtlasData = function (name, disposeData) { + if (disposeData === void 0) { disposeData = true; } + if (name in this._textureAtlasDataMap) { + var textureAtlasDataList = this._textureAtlasDataMap[name]; + if (disposeData) { + for (var _i = 0, textureAtlasDataList_1 = textureAtlasDataList; _i < textureAtlasDataList_1.length; _i++) { + var textureAtlasData = textureAtlasDataList_1[_i]; + this._dragonBones.bufferObject(textureAtlasData); + } + } + delete this._textureAtlasDataMap[name]; + } + }; + /** + * - Get a specific armature data. + * @param name - The armature data name. + * @param dragonBonesName - The cached name for DragonbonesData instance. + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param name - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language zh_CN + */ + BaseFactory.prototype.getArmatureData = function (name, dragonBonesName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + var dataPackage = new BuildArmaturePackage(); + if (!this._fillBuildArmaturePackage(dataPackage, dragonBonesName, name, "", "")) { + return null; + } + return dataPackage.armature; + }; + /** + * - Clear all cached DragonBonesData instances and TextureAtlasData instances. + * @param disposeData - Whether to dispose data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 + * @param disposeData - 是否释放数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.clear = function (disposeData) { + if (disposeData === void 0) { disposeData = true; } + for (var k in this._dragonBonesDataMap) { + if (disposeData) { + this._dragonBones.bufferObject(this._dragonBonesDataMap[k]); + } + delete this._dragonBonesDataMap[k]; + } + for (var k in this._textureAtlasDataMap) { + if (disposeData) { + var textureAtlasDataList = this._textureAtlasDataMap[k]; + for (var _i = 0, textureAtlasDataList_2 = textureAtlasDataList; _i < textureAtlasDataList_2.length; _i++) { + var textureAtlasData = textureAtlasDataList_2[_i]; + this._dragonBones.bufferObject(textureAtlasData); + } + } + delete this._textureAtlasDataMap[k]; + } + }; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. + * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature. + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 + * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架。 + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.buildArmature = function (armatureName, dragonBonesName, skinName, textureAtlasName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + if (skinName === void 0) { skinName = ""; } + if (textureAtlasName === void 0) { textureAtlasName = ""; } + var dataPackage = new BuildArmaturePackage(); + if (!this._fillBuildArmaturePackage(dataPackage, dragonBonesName || "", armatureName, skinName || "", textureAtlasName || "")) { + console.warn("No armature data: " + armatureName + ", " + (dragonBonesName !== null ? dragonBonesName : "")); + return null; + } + var armature = this._buildArmature(dataPackage); + this._buildBones(dataPackage, armature); + this._buildSlots(dataPackage, armature); + this._buildConstraints(dataPackage, armature); + armature.invalidUpdate(null, true); + armature.advanceTime(0.0); // Update armature pose. + return armature; + }; + /** + * @private + */ + BaseFactory.prototype.replaceDisplay = function (slot, displayData, displayIndex) { + if (displayIndex === void 0) { displayIndex = -1; } + if (displayIndex < 0) { + displayIndex = slot.displayIndex; + } + if (displayIndex < 0) { + displayIndex = 0; + } + slot.replaceDisplayData(displayData, displayIndex); + if (displayData !== null) { + var display = this._getSlotDisplay(null, displayData, slot); + if (displayData.type === 0 /* Image */) { + var rawDisplayData = slot.getDisplayFrameAt(displayIndex).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.type === 2 /* Mesh */) { + display = slot.meshDisplay; + } + } + slot.replaceDisplay(display, displayIndex); + } + else { + slot.replaceDisplay(null, displayIndex); + } + }; + /** + * - Replaces the current display data for a particular slot with a specific display data. + * Specify display data with "dragonBonesName/armatureName/slotName/displayName". + * @param dragonBonesName - The DragonBonesData instance cache name. + * @param armatureName - The armature data name. + * @param slotName - The slot data name. + * @param displayName - The display data name. + * @param slot - The slot. + * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 + * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @param armatureName - 骨架数据名称。 + * @param slotName - 插槽数据名称。 + * @param displayName - 显示对象数据名称。 + * @param slot - 插槽。 + * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.replaceSlotDisplay = function (dragonBonesName, armatureName, slotName, displayName, slot, displayIndex) { + if (displayIndex === void 0) { displayIndex = -1; } + var armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); + if (armatureData === null || armatureData.defaultSkin === null) { + return false; + } + var displayData = armatureData.defaultSkin.getDisplay(slotName, displayName); + this.replaceDisplay(slot, displayData, displayIndex); + return true; + }; + /** + * @private + */ + BaseFactory.prototype.replaceSlotDisplayList = function (dragonBonesName, armatureName, slotName, slot) { + var armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); + if (!armatureData || !armatureData.defaultSkin) { + return false; + } + var displayDatas = armatureData.defaultSkin.getDisplays(slotName); + if (!displayDatas) { + return false; + } + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + this.replaceDisplay(slot, displayData, i); + } + return true; + }; + /** + * - Share specific skin data with specific armature. + * @param armature - The armature. + * @param skin - The skin data. + * @param isOverride - Whether it completely override the original skin. (Default: false) + * @param exclude - A list of slot names that do not need to be replace. + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 将特定的皮肤数据共享给特定的骨架使用。 + * @param armature - 骨架。 + * @param skin - 皮肤数据。 + * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) + * @param exclude - 不需要被替换的插槽名称列表。 + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language zh_CN + */ + BaseFactory.prototype.replaceSkin = function (armature, skin, isOverride, exclude) { + if (isOverride === void 0) { isOverride = false; } + if (exclude === void 0) { exclude = null; } + var success = false; + var defaultSkin = skin.parent.defaultSkin; + for (var _i = 0, _a = armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + if (exclude !== null && exclude.indexOf(slot.name) >= 0) { + continue; + } + var displayDatas = skin.getDisplays(slot.name); + if (displayDatas === null) { + if (defaultSkin !== null && skin !== defaultSkin) { + displayDatas = defaultSkin.getDisplays(slot.name); + } + if (displayDatas === null) { + if (isOverride) { + slot.displayFrameCount = 0; + } + continue; + } + } + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); + if (displayData !== null) { + slot.replaceDisplay(this._getSlotDisplay(null, displayData, slot), i); + } + else { + slot.replaceDisplay(null, i); + } + } + success = true; + } + return success; + }; + /** + * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. + * This enables you to make a armature template so that other armature without animations can share it's animations. + * @param armature - The armtaure. + * @param armatureData - The armature data. + * @param isOverride - Whether to completely overwrite the original animation. (Default: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 + * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 + * @param armature - 骨架。 + * @param armatureData - 骨架数据。 + * @param isOverride - 是否完全覆盖原来的动画。(默认: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language zh_CN + */ + BaseFactory.prototype.replaceAnimation = function (armature, armatureData, isOverride) { + if (isOverride === void 0) { isOverride = true; } + var skinData = armatureData.defaultSkin; + if (skinData === null) { + return false; + } + if (isOverride) { + armature.animation.animations = armatureData.animations; + } + else { + var rawAnimations = armature.animation.animations; + var animations = {}; + for (var k in rawAnimations) { + animations[k] = rawAnimations[k]; + } + for (var k in armatureData.animations) { + animations[k] = armatureData.animations[k]; + } + armature.animation.animations = animations; + } + for (var _i = 0, _a = armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + var index = 0; + for (var _b = 0, _c = slot.displayList; _b < _c.length; _b++) { + var display = _c[_b]; + if (display instanceof dragonBones.Armature) { + var displayDatas = skinData.getDisplays(slot.name); + if (displayDatas !== null && index < displayDatas.length) { + var displayData = displayDatas[index]; + if (displayData !== null && displayData.type === 1 /* Armature */) { + var childArmatureData = this.getArmatureData(displayData.path, displayData.parent.parent.parent.name); + if (childArmatureData) { + this.replaceAnimation(display, childArmatureData, isOverride); + } + } + } + } + index++; + } + } + return true; + }; + /** + * @private + */ + BaseFactory.prototype.getAllDragonBonesData = function () { + return this._dragonBonesDataMap; + }; + /** + * @private + */ + BaseFactory.prototype.getAllTextureAtlasData = function () { + return this._textureAtlasDataMap; + }; + Object.defineProperty(BaseFactory.prototype, "clock", { + /** + * - An Worldclock instance updated by engine. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 由引擎驱动的 WorldClock 实例。 + * @version DragonBones 5.7 + * @language zh_CN + */ + get: function () { + return this._dragonBones.clock; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseFactory.prototype, "dragonBones", { + /** + * @private + */ + get: function () { + return this._dragonBones; + }, + enumerable: true, + configurable: true + }); + BaseFactory._objectParser = null; + BaseFactory._binaryParser = null; + return BaseFactory; + }()); + dragonBones.BaseFactory = BaseFactory; + /** + * @private + */ + var BuildArmaturePackage = (function () { + function BuildArmaturePackage() { + this.dataName = ""; + this.textureAtlasName = ""; + this.skin = null; + } + return BuildArmaturePackage; + }()); + dragonBones.BuildArmaturePackage = BuildArmaturePackage; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +if (CC_EDITOR) { + _Scene.Sandbox._globalsVerifier_loadPluginScript.ignoreNames['dragonBones'] = true; +} +var dragonBones; +(function (dragonBones) { + var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property; + var DragonBonesAsset = (function (_super) { + __extends(DragonBonesAsset, _super); + function DragonBonesAsset() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.dragonBonesData = ""; + _this.textureAtlases = []; + _this.textures = []; + return _this; + } + __decorate([ + property + ], DragonBonesAsset.prototype, "dragonBonesData", void 0); + __decorate([ + property([cc.String]) + ], DragonBonesAsset.prototype, "textureAtlases", void 0); + __decorate([ + property([cc.Texture2D]) + ], DragonBonesAsset.prototype, "textures", void 0); + DragonBonesAsset = __decorate([ + ccclass("DragonBones.DragonBonesAsset") + ], DragonBonesAsset); + return DragonBonesAsset; + }(cc.Asset)); + dragonBones.DragonBonesAsset = DragonBonesAsset; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The Cocos texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var CocosTextureAtlasData = (function (_super) { + __extends(CocosTextureAtlasData, _super); + function CocosTextureAtlasData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._renderTexture = null; // Initial value. + return _this; + } + CocosTextureAtlasData.toString = function () { + return "[class dragonBones.CocosTextureAtlasData]"; + }; + CocosTextureAtlasData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this._renderTexture !== null) { + // this._renderTexture.dispose(); + } + this._renderTexture = null; + }; + CocosTextureAtlasData.prototype.createTexture = function () { + return dragonBones.BaseObject.borrowObject(CocosTextureData); + }; + Object.defineProperty(CocosTextureAtlasData.prototype, "renderTexture", { + /** + * - The Cocos texture. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 贴图。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._renderTexture; + }, + set: function (value) { + if (this._renderTexture === value) { + return; + } + this._renderTexture = value; + if (this._renderTexture !== null) { + for (var k in this.textures) { + var textureData = this.textures[k]; + if (textureData.renderTexture !== null) { + textureData.renderTexture.destroy(); + } + var reat = cc.rect(textureData.region.x, textureData.region.y, textureData.rotated ? textureData.region.height : textureData.region.width, textureData.rotated ? textureData.region.width : textureData.region.height); + var offset = cc.v2(); + var originSize = cc.size(reat.size.width, reat.size.height); + textureData.renderTexture = new cc.SpriteFrame(this._renderTexture, reat, textureData.rotated, offset, originSize); + } + } + else { + for (var k in this.textures) { + var textureData = this.textures[k]; + if (textureData.renderTexture !== null) { + textureData.renderTexture.destroy(); + } + textureData.renderTexture = null; + } + } + }, + enumerable: true, + configurable: true + }); + return CocosTextureAtlasData; + }(dragonBones.TextureAtlasData)); + dragonBones.CocosTextureAtlasData = CocosTextureAtlasData; + /** + * @internal + */ + var CocosTextureData = (function (_super) { + __extends(CocosTextureData, _super); + function CocosTextureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.renderTexture = null; // Initial value. + return _this; + } + CocosTextureData.toString = function () { + return "[class dragonBones.CocosTextureData]"; + }; + CocosTextureData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this.renderTexture !== null) { + this.renderTexture.destroy(); + } + this.renderTexture = null; + }; + return CocosTextureData; + }(dragonBones.TextureData)); + dragonBones.CocosTextureData = CocosTextureData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + // const _defaultItems = cc.Enum({ "None": -1 }); + // function _setItems(object: any, key: string, items: any) { + // (cc.Class as any).attr( // creator.d.ts error. + // object, + // key, + // { + // type: "Enum", + // enumList: (cc.Enum as any).getList(items), // creator.d.ts error. + // } + // ); + // } + var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, executeInEditMode = _a.executeInEditMode, disallowMultiple = _a.disallowMultiple, playOnFocus = _a.playOnFocus, menu = _a.menu, help = _a.help; + /** + * @see dragonBones.IArmatureProxy + */ + var CocosArmatureComponent = (function (_super) { + __extends(CocosArmatureComponent, _super); + function CocosArmatureComponent() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.debugDraw = false; + _this._debugDraw = false; + /** + * @internal + */ + _this._armature = null; + // Editor. + /** + * @internal + */ + _this._armatureName = ""; + /** + * @internal + */ + _this._animationName = ""; + // Visibie. + /** + * @internal + */ + _this._dragonBonesAsset = null; + /** + * @internal + */ + _this._armatureNames = []; + /** + * @internal + */ + _this._animationNames = []; + /** + * @internal + */ + _this._playTimes = -1; + /** + * @internal + */ + _this._timeScale = 1.0; + return _this; + } + CocosArmatureComponent.prototype.dbInit = function (armature) { + this._armature = armature; + }; + CocosArmatureComponent.prototype.dbClear = function () { + this._armature = null; + _super.prototype.destroy.call(this); + }; + CocosArmatureComponent.prototype.dbUpdate = function () { + var drawed = dragonBones.DragonBones.debugDraw || this.debugDraw; + if (drawed || this._debugDraw) { + this._debugDraw = drawed; + } + }; + CocosArmatureComponent.prototype.dispose = function (_isposeProxy) { + if (_isposeProxy === void 0) { _isposeProxy = true; } + if (this._armature !== null) { + this._armature.dispose(); + this._armature = null; + } + }; + CocosArmatureComponent.prototype.destroy = function () { + this.dispose(); + if (false) { + _super.prototype.destroy.call(this); + } + return true; + }; + /** + * @private + */ + CocosArmatureComponent.prototype.dispatchDBEvent = function (type, eventObject) { + var event = new cc.Event.EventCustom(type, false); + event.setUserData(eventObject); + this.node.dispatchEvent(event); + }; + CocosArmatureComponent.prototype.hasDBEventListener = function (type) { + return this.node.hasEventListener(type, false); // creator.d.ts error. + }; + CocosArmatureComponent.prototype.addDBEventListener = function (type, listener, target) { + this.node.on(type, listener, target); + }; + CocosArmatureComponent.prototype.removeDBEventListener = function (type, listener, target) { + this.node.off(type, listener, target); + }; + Object.defineProperty(CocosArmatureComponent.prototype, "armature", { + get: function () { + return this._armature; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CocosArmatureComponent.prototype, "animation", { + get: function () { + return this._armature.animation; + }, + enumerable: true, + configurable: true + }); + CocosArmatureComponent.prototype.start = function () { + }; + __decorate([ + property + ], CocosArmatureComponent.prototype, "_armatureName", void 0); + __decorate([ + property + ], CocosArmatureComponent.prototype, "_animationName", void 0); + __decorate([ + property({ + type: dragonBones.DragonBonesAsset, + displayName: "DragonBones", + tooltip: "DragonBones Asset", + visible: true, + }) + ], CocosArmatureComponent.prototype, "_dragonBonesAsset", void 0); + __decorate([ + property({ + type: [cc.String], + displayName: "Armature", + tooltip: "The armature name.", + visible: true, + editorOnly: true, + serializable: false, + }) + ], CocosArmatureComponent.prototype, "_armatureNames", void 0); + __decorate([ + property({ + type: [cc.String], + displayName: "Animation", + tooltip: "The animation name.", + visible: true, + editorOnly: true, + serializable: false, + }) + ], CocosArmatureComponent.prototype, "_animationNames", void 0); + __decorate([ + property({ + type: cc.Integer, + displayName: "Play times", + tooltip: "The animation play times.", + visible: true, + slide: true, + range: [-1, 99, 1], + }) + ], CocosArmatureComponent.prototype, "_playTimes", void 0); + __decorate([ + property({ + type: cc.Float, + displayName: "TimeScale", + tooltip: "The animation play speed.", + visible: true, + slide: true, + range: [-2, 2, 0.01], + }) + ], CocosArmatureComponent.prototype, "_timeScale", void 0); + CocosArmatureComponent = __decorate([ + ccclass("CocosArmatureComponent"), + executeInEditMode, + disallowMultiple, + playOnFocus, + menu("DragonBones/Armature"), + executeInEditMode, + help("https://github.com/DragonBones/") + ], CocosArmatureComponent); + return CocosArmatureComponent; + }(cc.Component)); + dragonBones.CocosArmatureComponent = CocosArmatureComponent; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The Cocos slot. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 插槽。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var CocosSlot = (function (_super) { + __extends(CocosSlot, _super); + function CocosSlot() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._ccMeshDirty = false; + return _this; + } + CocosSlot.toString = function () { + return "[class dragonBones.CocosSlot]"; + }; + CocosSlot.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._textureScale = 1.0; + this._renderDisplay = null; + }; + CocosSlot.prototype._initDisplay = function (_value, _isRetain) { + }; + CocosSlot.prototype._disposeDisplay = function (value, isRelease) { + if (!isRelease) { + value.destroy(); + } + }; + CocosSlot.prototype._onUpdateDisplay = function () { + this._renderDisplay = (this._display ? this._display : this._rawDisplay); + }; + CocosSlot.prototype._addDisplay = function () { + var container = this._armature.display; + container.addChild(this._renderDisplay, this._zOrder); + }; + CocosSlot.prototype._replaceDisplay = function (value) { + var container = this._armature.display; + var prevDisplay = value; + if (this._renderDisplay.parent !== container) { + container.addChild(this._renderDisplay, prevDisplay.getLocalZOrder()); + } + // container.removeChild(prevDisplay, false); + this._renderDisplay.active = true; + prevDisplay.active = false; + this._textureScale = 1.0; + }; + CocosSlot.prototype._removeDisplay = function () { + this._renderDisplay.parent.removeChild(this._renderDisplay, false); + }; + CocosSlot.prototype._updateZOrder = function () { + if (this._renderDisplay.getLocalZOrder() === this._zOrder) { + return; + } + this._renderDisplay.setLocalZOrder(this._zOrder); + }; + /** + * @internal + */ + CocosSlot.prototype._updateVisible = function () { + this._renderDisplay.active = this._parent.visible && this._visible; + }; + CocosSlot.prototype._updateBlendMode = function () { + var sprite = this._renderDisplay.getComponent(cc.Sprite); + if (sprite) { + switch (this._blendMode) { + case 0 /* Normal */: + break; + case 1 /* Add */: + var texture = sprite.spriteFrame.getTexture(); + var BlendFunc = cc.BlendFunc; // creator.d.ts error. + if (texture && texture.hasPremultipliedAlpha()) { + sprite._sgNode.setBlendFunc(BlendFunc.BlendFactor.ONE, BlendFunc.BlendFactor.ONE); // creator.d.ts error. + } + else { + sprite._sgNode.setBlendFunc(BlendFunc.BlendFactor.SRC_ALPHA, BlendFunc.BlendFactor.ONE); // creator.d.ts error. + } + break; + case 3 /* Darken */: + break; + case 4 /* Difference */: + break; + case 6 /* HardLight */: + break; + case 9 /* Lighten */: + break; + case 10 /* Multiply */: + break; + case 11 /* Overlay */: + break; + case 12 /* Screen */: + break; + default: + break; + } + } + else if (this._childArmature !== null) { + for (var _i = 0, _a = this._childArmature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + slot._blendMode = this._blendMode; + slot._updateBlendMode(); + } + } + }; + CocosSlot.prototype._updateColor = function () { + var alpha = this._colorTransform.alphaMultiplier * this._globalAlpha * 255; + var color = this._renderDisplay.color; + this._renderDisplay.opacity = alpha; + color.setR(this._colorTransform.redMultiplier * 0xFF); + color.setG(this._colorTransform.greenMultiplier * 0xFF); + color.setB(this._colorTransform.blueMultiplier * 0xFF); + this._renderDisplay.setColor(color); // creator.d.ts error. + }; + CocosSlot.prototype._updateFrame = function () { + var currentTextureData = this._textureData; + var sprite = this._renderDisplay.getComponent(cc.Sprite); + if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) { + var currentTextureAtlasData = currentTextureData.parent; + if (this._armature.replacedTexture !== null) { + if (this._armature._replaceTextureAtlasData === null) { + currentTextureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.CocosTextureAtlasData); + currentTextureAtlasData.copyFrom(currentTextureData.parent); + currentTextureAtlasData.renderTexture = this._armature.replacedTexture; + this._armature._replaceTextureAtlasData = currentTextureAtlasData; + } + else { + currentTextureAtlasData = this._armature._replaceTextureAtlasData; + } + currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name); + } + var renderTexture = currentTextureData.renderTexture; + if (renderTexture !== null) { + if (this._geometryData !== null) { + var data = this._geometryData.data; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[this._geometryData.offset + 0 /* GeometryVertexCount */]; + var triangleCount = intArray[this._geometryData.offset + 1 /* GeometryTriangleCount */]; + var vertexOffset = intArray[this._geometryData.offset + 2 /* GeometryFloatOffset */]; + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + var uvOffset = vertexOffset + vertexCount * 2; + var scale = this._armature._armatureData.scale; + var textureAtlasSize = renderTexture.getTexture().getContentSizeInPixels(); + var textureAtlasWidth = currentTextureAtlasData.width > 0.0 ? currentTextureAtlasData.width : textureAtlasSize.width; + var textureAtlasHeight = currentTextureAtlasData.height > 0.0 ? currentTextureAtlasData.height : textureAtlasSize.height; + var region = currentTextureData.region; + var boundsRect = cc.rect(999999.0, 999999.0, -999999.0, -999999.0); + var polygonInfo = { + triangles: { + verts: [], + indices: [] + }, + rect: boundsRect + }; + for (var i = 0, l = vertexCount * 2; i < l; i += 2) { + var vertex = { + x: floatArray[vertexOffset + i] * scale, + y: -floatArray[vertexOffset + i + 1] * scale, + u: floatArray[uvOffset + i], + v: floatArray[uvOffset + i + 1] + }; + if (currentTextureData.rotated) { + var backU = vertex.u; + vertex.u = (region.x + (1.0 - vertex.v) * region.width) / textureAtlasWidth; + vertex.v = (region.y + backU * region.height) / textureAtlasHeight; + } + else { + vertex.u = (region.x + vertex.u * region.width) / textureAtlasWidth; + vertex.v = (region.y + vertex.v * region.height) / textureAtlasHeight; + } + polygonInfo.triangles.verts[i / 2] = vertex; + if (boundsRect.x > vertex.x) { + boundsRect.x = vertex.x; + } + if (boundsRect.width < vertex.x) { + boundsRect.width = vertex.x; + } + if (boundsRect.y > vertex.y) { + boundsRect.y = vertex.y; + } + if (boundsRect.height < vertex.y) { + boundsRect.height = vertex.y; + } + } + for (var i = 0; i < triangleCount * 3; ++i) { + polygonInfo.triangles.indices[i] = intArray[this._geometryData.offset + 4 /* GeometryVertexIndices */ + i]; + } + this._textureScale = 1.0; + sprite._sgNode.setRenderingType(cc.Scale9Sprite.RenderingType.MESH); // creator.d.ts error. + sprite.spriteFrame = renderTexture; + sprite._sgNode.setMeshPolygonInfo(polygonInfo); // creator.d.ts error. + sprite._sgNode.setContentSize(cc.size(boundsRect.width, boundsRect.height)); // creator.d.ts error. + var isSkinned = this._geometryData.weight !== null; + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + if (isSkinned || isSurface) { + this._identityTransform(); + } + // Delay to update cocos mesh. (some cocos bug.) + this._ccMeshDirty = true; + } + else { + this._textureScale = currentTextureData.parent.scale * this._armature._armatureData.scale; + sprite._sgNode.setRenderingType(cc.Scale9Sprite.RenderingType.SIMPLE); // creator.d.ts error. + sprite.spriteFrame = renderTexture; + sprite._sgNode.setContentSize(renderTexture.getOriginalSize()); // creator.d.ts error. + } + this._visibleDirty = true; + // this._blendModeDirty = true; + // this._colorDirty = true; + return; + } + } + this._renderDisplay.active = false; + this._renderDisplay.setPosition(0.0, 0.0); + }; + CocosSlot.prototype._updateMesh = function () { + var scale = this._armature._armatureData.scale; + var deformVertices = this._displayFrame.deformVertices; + var bones = this._geometryBones; + var geometryData = this._geometryData; + var weightData = geometryData.weight; + var hasDeform = deformVertices.length > 0 && geometryData.inheritDeform; + var meshDisplay = this._renderDisplay.getComponent(cc.Sprite)._sgNode; // as cc.Scale9Sprite; + var polygonInfo = meshDisplay.getMeshPolygonInfo(); + if (!polygonInfo) { + return; + } + var verticesAndUVs = polygonInfo.triangles.verts; + var boundsRect = cc.rect(999999.0, 999999.0, -999999.0, -999999.0); + if (weightData !== null) { + var data = geometryData.data; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometryData.offset + 0 /* GeometryVertexCount */]; + var weightFloatOffset = intArray[weightData.offset + 1 /* WeigthFloatOffset */]; + if (weightFloatOffset < 0) { + weightFloatOffset += 65536; // Fixed out of bouds bug. + } + for (var i = 0, iB = weightData.offset + 2 /* WeigthBoneIndices */ + bones.length, iV = weightFloatOffset, iF = 0; i < vertexCount; ++i) { + var boneCount = intArray[iB++]; + var xG = 0.0, yG = 0.0; + for (var j = 0; j < boneCount; ++j) { + var boneIndex = intArray[iB++]; + var bone = bones[boneIndex]; + if (bone !== null) { + var matrix = bone.globalTransformMatrix; + var weight = floatArray[iV++]; + var xL = floatArray[iV++] * scale; + var yL = floatArray[iV++] * scale; + if (hasDeform) { + xL += deformVertices[iF++]; + yL += deformVertices[iF++]; + } + xG += (matrix.a * xL + matrix.c * yL + matrix.tx) * weight; + yG += (matrix.b * xL + matrix.d * yL + matrix.ty) * weight; + } + } + var vertex = verticesAndUVs[i]; + vertex.x = xG; + vertex.y = yG; + if (boundsRect.x > xG) { + boundsRect.x = xG; + } + if (boundsRect.width < xG) { + boundsRect.width = xG; + } + if (boundsRect.y > yG) { + boundsRect.y = yG; + } + if (boundsRect.height < yG) { + boundsRect.height = yG; + } + } + } + else { + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + var data = geometryData.data; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometryData.offset + 0 /* GeometryVertexCount */]; + var vertexOffset = intArray[geometryData.offset + 2 /* GeometryFloatOffset */]; + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + for (var i = 0, l = vertexCount * 2; i < l; i += 2) { + var iH = i / 2; // int. + var x = floatArray[vertexOffset + i] * scale; + var y = floatArray[vertexOffset + i + 1] * scale; + if (hasDeform) { + x += deformVertices[i]; + y += deformVertices[i + 1]; + } + var vertex = verticesAndUVs[iH]; + if (isSurface) { + var matrix = this._parent._getGlobalTransformMatrix(x, y); + vertex.x = matrix.a * x + matrix.c * y + matrix.tx; + vertex.y = matrix.b * x + matrix.d * y + matrix.ty; + // + x = vertex.x; + y = vertex.y; + } + else { + vertex.x = x; + y = vertex.y = -y; + } + if (boundsRect.x > x) { + boundsRect.x = x; + } + if (boundsRect.width < x) { + boundsRect.width = x; + } + if (boundsRect.y > y) { + boundsRect.y = y; + } + if (boundsRect.height < y) { + boundsRect.height = y; + } + } + } + boundsRect.width -= boundsRect.x; + boundsRect.height -= boundsRect.y; + polygonInfo.rect = boundsRect; + meshDisplay.setContentSize(cc.size(boundsRect.width, boundsRect.height)); + meshDisplay.setMeshPolygonInfo(polygonInfo); + if (weightData !== null) { + this._identityTransform(); + } + else { + var transform = this.global; + var globalTransformMatrix = this.globalTransformMatrix; + this._renderDisplay.x = transform.x - (globalTransformMatrix.a * this._pivotX - globalTransformMatrix.c * this._pivotY); + this._renderDisplay.y = transform.y - (globalTransformMatrix.b * this._pivotX - globalTransformMatrix.d * this._pivotY); + this._renderDisplay.rotationX = -(transform.rotation + transform.skew) * dragonBones.Transform.RAD_DEG; + this._renderDisplay.rotationY = -transform.rotation * dragonBones.Transform.RAD_DEG; + this._renderDisplay.scaleX = transform.scaleX * this._textureScale; + this._renderDisplay.scaleY = -transform.scaleY * this._textureScale; + } + if (this._ccMeshDirty) { + this._ccMeshDirty = false; + this._verticesDirty = true; + } + }; + CocosSlot.prototype._updateTransform = function () { + // const globalTransformMatrix = this.globalTransformMatrix; + // const helpMatrix = TransformObject._helpMatrix; + // helpMatrix.a = globalTransformMatrix.a; + // helpMatrix.b = globalTransformMatrix.b; + // helpMatrix.c = -globalTransformMatrix.c; + // helpMatrix.d = -globalTransformMatrix.d; + // if (this._renderDisplay === this._rawDisplay || this._renderDisplay === this._meshDisplay) { + // helpMatrix.tx = globalTransformMatrix.tx - (globalTransformMatrix.a * this._pivotX + globalTransformMatrix.c * this._pivotY); + // helpMatrix.ty = (globalTransformMatrix.ty - (globalTransformMatrix.b * this._pivotX + globalTransformMatrix.d * this._pivotY)); + // } + // else { + // helpMatrix.tx = globalTransformMatrix.tx; + // helpMatrix.ty = globalTransformMatrix.ty; + // } + // (this._renderDisplay as any)._sgNode._renderCmd.setNodeToParentTransform(helpMatrix); // creator.d.ts error. + this.updateGlobalTransform(); + var transform = this.global; + var globalTransformMatrix = this.globalTransformMatrix; + if (this._renderDisplay === this._rawDisplay || this._renderDisplay === this._meshDisplay) { + this._renderDisplay.x = transform.x - (globalTransformMatrix.a * this._pivotX - globalTransformMatrix.c * this._pivotY); + this._renderDisplay.y = transform.y - (globalTransformMatrix.b * this._pivotX - globalTransformMatrix.d * this._pivotY); + } + else { + this._renderDisplay.x = transform.x; + this._renderDisplay.y = transform.y; + } + this._renderDisplay.rotationX = -(transform.rotation + transform.skew) * dragonBones.Transform.RAD_DEG; + this._renderDisplay.rotationY = -transform.rotation * dragonBones.Transform.RAD_DEG; + this._renderDisplay.scaleX = transform.scaleX * this._textureScale; + this._renderDisplay.scaleY = -transform.scaleY * this._textureScale; + }; + CocosSlot.prototype._identityTransform = function () { + // const helpMatrix = TransformObject._helpMatrix; + // helpMatrix.a = 1.0; + // helpMatrix.b = 0.0; + // helpMatrix.c = -0.0; + // helpMatrix.d = -1.0; + // helpMatrix.tx = 0.0; + // helpMatrix.ty = 0.0; + // (this._renderDisplay as any)._renderCmd.setNodeToParentTransform(helpMatrix); + this._renderDisplay.x = 0.0; + this._renderDisplay.y = 0.0; + this._renderDisplay.rotationX = 0.0; + this._renderDisplay.rotationY = 0.0; + this._renderDisplay.scaleX = 1.0; + this._renderDisplay.scaleY = 1.0; + }; + return CocosSlot; + }(dragonBones.Slot)); + dragonBones.CocosSlot = CocosSlot; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + var ccclass = cc._decorator.ccclass; + var ClockHandler = (function (_super) { + __extends(ClockHandler, _super); + function ClockHandler() { + return _super !== null && _super.apply(this, arguments) || this; + } + ClockHandler.prototype.update = function (passedTime) { + CocosFactory.factory.dragonBones.advanceTime(passedTime); + }; + ClockHandler = __decorate([ + ccclass + ], ClockHandler); + return ClockHandler; + }(cc.Component)); + /** + * - The Cocos factory. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 工厂。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var CocosFactory = (function (_super) { + __extends(CocosFactory, _super); + function CocosFactory(dataParser) { + if (dataParser === void 0) { dataParser = null; } + var _this = _super.call(this, dataParser) || this; + _this._node = null; + _this._armatureNode = null; + if (!CC_EDITOR) { + if (_this._node === null) { + var nodeName = "DragonBones Node"; + _this._node = cc.find(nodeName); + if (_this._node === null) { + _this._node = new cc.Node(nodeName); + cc.game.addPersistRootNode(_this._node); + } + } + if (!_this._node.getComponent(ClockHandler)) { + _this._node.addComponent(ClockHandler); + } + var eventManager = _this._node.getComponent(dragonBones.CocosArmatureComponent) || _this._node.addComponent(dragonBones.CocosArmatureComponent); + if (CocosFactory._dragonBonesInstance === null) { + CocosFactory._dragonBonesInstance = new dragonBones.DragonBones(eventManager); + // + dragonBones.DragonBones.yDown = false; + } + } + else { + if (CocosFactory._dragonBonesInstance === null) { + CocosFactory._dragonBonesInstance = new dragonBones.DragonBones(null); + // + dragonBones.DragonBones.yDown = false; + } + } + _this._dragonBones = CocosFactory._dragonBonesInstance; + return _this; + } + Object.defineProperty(CocosFactory, "factory", { + /** + * - A global factory instance that can be used directly. + * @version DragonBones 4.7 + * @language en_US + */ + /** + * - 一个可以直接使用的全局工厂实例。 + * @version DragonBones 4.7 + * @language zh_CN + */ + get: function () { + if (this._factory === null) { + this._factory = new CocosFactory(); + } + return this._factory; + }, + enumerable: true, + configurable: true + }); + CocosFactory.prototype._isSupportMesh = function () { + if (cc._renderType !== cc.game.RENDER_TYPE_WEBGL) { + console.warn("Only webgl mode can support mesh."); + return false; + } + return true; + }; + CocosFactory.prototype._buildTextureAtlasData = function (textureAtlasData, textureAtlas) { + if (textureAtlasData !== null) { + textureAtlasData.renderTexture = textureAtlas; + } + else { + textureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.CocosTextureAtlasData); + } + return textureAtlasData; + }; + CocosFactory.prototype._buildArmature = function (dataPackage) { + var armature = dragonBones.BaseObject.borrowObject(dragonBones.Armature); + var armatureDisplay = this._armatureNode === null ? new cc.Node(dataPackage.armature.name) : this._armatureNode; + var armatureComponent = armatureDisplay.getComponent(dragonBones.CocosArmatureComponent) || armatureDisplay.addComponent(dragonBones.CocosArmatureComponent); + armatureDisplay.setOpacityModifyRGB(false); + armatureDisplay.setCascadeOpacityEnabled(true); + armatureDisplay._sgNode.setCascadeColorEnabled(true); // creator.d.ts error. + this._armatureNode = null; + armatureComponent._armature = armature; + armature.init(dataPackage.armature, armatureComponent, armatureDisplay, this._dragonBones); + return armature; + }; + CocosFactory.prototype._buildChildArmature = function (dataPackage, slot, displayData) { + var childDisplayName = slot.slotData.name + " (" + displayData.path.replace("/", "_") + ")"; // + var proxy = slot.armature.proxy; + var childNode = cc.find(childDisplayName, proxy.node); + var childArmature = null; + if (!childNode) { + if (dataPackage !== null) { + childArmature = this.buildArmature(displayData.path, dataPackage.dataName); + } + else { + childArmature = this.buildArmature(displayData.path, displayData.parent.parent.parent.name); + } + } + else { + var childArmatureComponent = childNode.getComponent(dragonBones.CocosArmatureComponent) || null; + if (childArmatureComponent === null) { + if (dataPackage !== null) { + childArmatureComponent = this.buildArmatureComponent(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage.textureAtlasName, childNode); + } + else { + childArmatureComponent = this.buildArmatureComponent(displayData.path, "", "", "", childNode); + } + } + if (childArmatureComponent !== null) { + childArmature = childArmatureComponent.armature; + } + } + if (childArmature === null) { + return null; + } + var childArmatureDisplay = childArmature.display; + childArmatureDisplay.name = childDisplayName; + if (childArmatureDisplay.parent !== proxy.node) { + proxy.node.addChild(childArmatureDisplay, slot._zOrder); + } + childArmatureDisplay.active = false; + return childArmature; + }; + CocosFactory.prototype._buildSlot = function (_dataPackage, slotData, armature) { + var slot = dragonBones.BaseObject.borrowObject(dragonBones.CocosSlot); + var armatureDisplay = armature.display; + var rawSlotDisplay = cc.find(slotData.name, armatureDisplay) || new cc.Node(slotData.name); + rawSlotDisplay.addComponent(cc.Sprite); + rawSlotDisplay.setAnchorPoint(0.0, 0.0); + rawSlotDisplay.setOpacityModifyRGB(false); + rawSlotDisplay.setCascadeOpacityEnabled(true); + rawSlotDisplay._sgNode.setCascadeColorEnabled(true); // creator.d.ts error. + slot.init(slotData, armature, rawSlotDisplay, rawSlotDisplay); + return slot; + }; + /** + * - Create a armature component from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it. + * - The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update. + * - Note that when the created armature proxy that is no longer in use, you need to explicitly dispose {@link #dragonBones.IArmatureProxy#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature component. + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + * + *
+         *     let armatureComponent = factory.buildArmatureComponent("armatureName", "dragonBonesName");
+         * 
+ * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架组件,并用 {@link #clock} 更新该骨架。 + * - 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。 + * - 注意,创建的骨架代理不再使用时,需要显式释放 {@link #dragonBones.IArmatureProxy#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架组件。 + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + * + *
+         *     let armatureComponent = factory.buildArmatureComponent("armatureName", "dragonBonesName");
+         * 
+ * @language zh_CN + */ + CocosFactory.prototype.buildArmatureComponent = function (armatureName, dragonBonesName, skinName, textureAtlasName, node) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + if (skinName === void 0) { skinName = ""; } + if (textureAtlasName === void 0) { textureAtlasName = ""; } + if (node === void 0) { node = null; } + this._armatureNode = node; + var armature = this.buildArmature(armatureName, dragonBonesName || "", skinName || "", textureAtlasName || ""); + if (armature !== null) { + this._dragonBones.clock.add(armature); + return armature.proxy; + } + return null; + }; + /** + * - Create the display object with the specified texture. + * @param textureName - The texture data name. + * @param textureAtlasName - The texture atlas data name. (Of not set, all texture atlas data will be searched) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建带有指定贴图的显示对象。 + * @param textureName - 贴图数据名称。 + * @param textureAtlasName - 贴图集数据名称。 (如果未设置,将检索所有的贴图集数据) + * @version DragonBones 3.0 + * @language zh_CN + */ + CocosFactory.prototype.getTextureDisplay = function (textureName, textureAtlasName) { + if (textureAtlasName === void 0) { textureAtlasName = null; } + var textureData = this._getTextureData(textureAtlasName !== null ? textureAtlasName : "", textureName); + if (textureData !== null && textureData.renderTexture !== null) { + var texture = textureData.renderTexture; + var sprite = new cc.Sprite(); + sprite.spriteFrame = texture; + return sprite; + } + return null; + }; + Object.defineProperty(CocosFactory.prototype, "soundEventManager", { + /** + * - A global sound event manager. + * Sound events can be listened to uniformly from the manager. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 全局声音事件管理器。 + * 声音事件可以从该管理器统一侦听。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._dragonBones.eventManager.node; + }, + enumerable: true, + configurable: true + }); + CocosFactory._dragonBonesInstance = null; + CocosFactory._factory = null; + return CocosFactory; + }(dragonBones.BaseFactory)); + dragonBones.CocosFactory = CocosFactory; +})(dragonBones || (dragonBones = {})); diff --git a/Cocos/1.x/out/dragonBones.min.js b/Cocos/1.x/out/dragonBones.min.js new file mode 100644 index 00000000..97497d27 --- /dev/null +++ b/Cocos/1.x/out/dragonBones.min.js @@ -0,0 +1 @@ +"use strict";var __extends=this&&this.__extends||function(){var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(t,e){r(t,e);function a(){this.constructor=t}t.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}();var __decorate=this&&this.__decorate||function(t,e,a,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,a):r,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,a,r);else for(var o=t.length-1;o>=0;o--)if(s=t[o])n=(i<3?s(n):i>3?s(e,a,n):s(e,a))||n;return i>3&&n&&Object.defineProperty(e,a,n),n};var dragonBones;(function(o){var t=function(){function e(t){this._clock=new o.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=t;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(t){if(this._objects.length>0){for(var e=0,a=this._objects;e0){for(var i=0;ie){r.length=e}n._maxCountMap[a]=e}else{n._defaultMaxCount=e;for(var a in n._poolsMap){var r=n._poolsMap[a];if(r.length>e){r.length=e}if(a in n._maxCountMap){n._maxCountMap[a]=e}}}};n.clearPool=function(t){if(t===void 0){t=null}if(t!==null){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){a.length=0}}else{for(var r in n._poolsMap){var a=n._poolsMap[r];a.length=0}}};n.borrowObject=function(t){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){var r=a.pop();r._isInPool=false;return r}var i=new t;i._onClear();return i};n.prototype.returnToPool=function(){this._onClear();n._returnObject(this)};n._hashCode=0;n._defaultMaxCount=3e3;n._maxCountMap={};n._poolsMap={};return n}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var u=l+t.width;var f=h+t.height;var _=a*l+i*h+s;var m=r*l+n*h+o;var c=a*u+i*h+s;var p=r*u+n*h+o;var d=a*u+i*f+s;var y=r*u+n*f+o;var v=a*l+i*f+s;var g=r*l+n*f+o;var D=0;if(_>c){D=_;_=c;c=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_v?c:v)-t.x);if(m>p){D=m;m=p;p=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(mg?p:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function n(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}n.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};n.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};n.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};n.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};n.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};n.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};n.prototype.fromMatrix=function(t){var e=this.scaleX,a=this.scaleY;var r=n.PI_Q;this.x=t.tx;this.y=t.ty;this.rotation=Math.atan(t.b/t.a);var i=Math.atan(-t.c/t.d);this.scaleX=this.rotation>-r&&this.rotation-r&&i=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(a>=0&&this.scaleY<0){this.scaleY=-this.scaleY;i=i-Math.PI}this.skew=i-this.rotation;return this};n.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};n.PI=Math.PI;n.PI_D=Math.PI*2;n.PI_H=Math.PI/2;n.PI_Q=Math.PI/4;n.RAD_DEG=180/Math.PI;n.DEG_RAD=Math.PI/180;return n}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.ints=[];t.floats=[];t.strings=[];return t}t.toString=function(){return"[class dragonBones.UserData]"};t.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};t.prototype.addInt=function(t){this.ints.push(t)};t.prototype.addFloat=function(t){this.floats.push(t)};t.prototype.addString=function(t){this.strings.push(t)};t.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};t.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};t.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};t.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};t.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};t.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};t.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};t.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};t.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};t.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};t.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};t.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};t.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};t.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};t.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};t.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return t}(a.BaseObject);a.ArmatureData=t;var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.transform=new a.Transform;t.userData=null;return t}t.toString=function(){return"[class dragonBones.BoneData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return t}(a.BaseObject);a.BoneData=e;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.geometry=new a.GeometryData;return t}t.toString=function(){return"[class dragonBones.SurfaceData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return t}(e);a.SurfaceData=r;var i=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}t.createColor=function(){return new a.ColorTransform};t.toString=function(){return"[class dragonBones.SlotData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.zIndex=0;this.alpha=1;this.name="";this.color=null;this.userData=null;this.parent=null};t.DEFAULT_COLOR=new a.ColorTransform;return t}(a.BaseObject);a.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.displays={};return t}t.toString=function(){return"[class dragonBones.SkinData]"};t.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};D.rectangleIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=t>i&&tn&&ei&&an&&r=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};D.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=this.width*.5;var l=this.height*.5;var h=D.rectangleIntersectsSegment(t,e,a,r,-o,-l,o,l,i,n,s);return h};return D}(e);t.RectangleBoundingBoxData=h;var a=function(t){__extends(l,t);function l(){return t!==null&&t.apply(this,arguments)||this}l.toString=function(){return"[class dragonBones.EllipseData]"};l.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=s/o;var _=f*f;e*=f;r*=f;var m=a-t;var c=r-e;var p=Math.sqrt(m*m+c*c);var d=m/p;var y=c/p;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var T=s*s;var b=T-D+g;var A=0;if(b>=0){var S=Math.sqrt(b);var P=v-S;var O=v+S;var x=P<0?-1:P<=p?0:1;var B=O<0?-1:O<=p?0:1;var E=x*B;if(E<0){return-1}else if(E===0){if(x===-1){A=2;a=t+O*d;r=(e+O*y)/f;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,a/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+P*d;e=(e+P*y)/f;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.x=Math.atan2(e/T*_,t/T);u.y=u.x+Math.PI}}else{A=3;if(l!==null){l.x=t+P*d;l.y=(e+P*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+O*d;h.y=(e+O*y)/f;if(u!==null){u.y=Math.atan2(h.y/T*_,h.x/T)}}}}}return A};l.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};l.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};l.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=l.ellipseIntersectsSegment(t,e,a,r,0,0,this.width*.5,this.height*.5,i,n,s);return o};return l}(e);t.EllipseBoundingBoxData=a;var r=function(e){__extends(l,e);function l(){var t=e!==null&&e.apply(this,arguments)||this;t.vertices=[];return t}l.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};l.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var u=e-r;var f=t*r-e*a;var _=0;var m=i[l-2];var c=i[l-1];var p=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var T=0;T=m&&B<=b||B>=b&&B<=m)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var E=(f*P-u*O)/x;if((E>=c&&E<=A||E>=A&&E<=c)&&(u===0||E>=e&&E<=r||E>=r&&E<=e)){if(s!==null){var M=B-t;if(M<0){M=-M}if(_===0){p=M;d=M;y=B;v=E;g=B;D=E;if(o!==null){o.x=Math.atan2(A-c,b-m)-Math.PI*.5;o.y=o.x}}else{if(Md){d=M;g=B;D=E;if(o!==null){o.y=Math.atan2(A-c,b-m)-Math.PI*.5}}}_++}else{y=B;v=E;g=B;D=E;_++;if(o!==null){o.x=Math.atan2(A-c,b-m)-Math.PI*.5;o.y=o.x}break}}}m=b;c=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};l.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};l.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;ae._zIndex*1e3+e._zOrder?1:-1};y.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};y.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};y.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};y.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};y.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};y.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};y.prototype.init=function(t,e,a,r){if(this._armatureData!==null){return}this._armatureData=t;this._animation=i.BaseObject.borrowObject(i.Animation);this._proxy=e;this._display=a;this._dragonBones=r;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};y.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty||this._zIndexDirty){this._slots.sort(y._onSortSlots);if(this._zIndexDirty){for(var a=0,r=this._slots.length;a0){for(var u=0,f=this._actions;u0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var b=o?i.y-e:i.x-t;if(b<0){b=-b}if(d===null||bh){h=b;_=n.x;m=n.y;y=D;if(s!==null){p=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=u;i.y=f;if(s!==null){s.x=c}}if(y!==null&&n!==null){n.x=_;n.y=m;if(s!==null){s.y=p}}return d};y.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};t.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};t.prototype.invalidUpdate=function(){this._transformDirty=true};t.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(t.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=a){return this.globalTransformMatrix}i=e>this._kX*(t+a)+p;m=((s*o+s+o+o+_)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=_*(l+2);var g=this._hullCache[4];var D=this._hullCache[5];var T=this._hullCache[2]-(o-_)*g;var b=this._hullCache[3]-(o-_)*D;var A=this._vertices;if(i){this._getAffineTransform(-a,p+u,r-a,u,A[v+l+2],A[v+l+3],T+g,b+D,A[v],A[v+1],S._helpTransform,y,true)}else{this._getAffineTransform(-r,p,r-a,u,T,b,A[v],A[v+1],T+g,b+D,S._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else if(t>=a){if(e<-a||e>=a){return this.globalTransformMatrix}i=e>this._kX*(t-r)+p;m=((s*o+s+_)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=(_+1)*(l+2)-2;var g=this._hullCache[4];var D=this._hullCache[5];var T=this._hullCache[0]+_*g;var b=this._hullCache[1]+_*D;var A=this._vertices;if(i){this._getAffineTransform(r,p+u,r-a,u,T+g,b+D,A[v+l+2],A[v+l+3],T,b,S._helpTransform,y,true)}else{this._getAffineTransform(a,p,r-a,u,A[v],A[v+1],T,b,A[v+l+2],A[v+l+3],S._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else if(e<-a){if(t<-a||t>=a){return this.globalTransformMatrix}i=e>this._kY*(t-c-h)-r;m=((s*o+f)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=f*2;var g=this._hullCache[10];var D=this._hullCache[11];var T=this._hullCache[8]+f*g;var b=this._hullCache[9]+f*D;var A=this._vertices;if(i){this._getAffineTransform(c+h,-a,h,r-a,A[v+2],A[v+3],A[v],A[v+1],T+g,b+D,S._helpTransform,y,true)}else{this._getAffineTransform(c,-r,h,r-a,T,b,T+g,b+D,A[v],A[v+1],S._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else if(e>=a){if(t<-a||t>=a){return this.globalTransformMatrix}i=e>this._kY*(t-c-h)+a;m=((s*o+s+o+f)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=o*(l+2)+f*2;var g=this._hullCache[10];var D=this._hullCache[11];var T=this._hullCache[6]-(s-f)*g;var b=this._hullCache[7]-(s-f)*D;var A=this._vertices;if(i){this._getAffineTransform(c+h,r,h,r-a,T+g,b+D,T,b,A[v+2],A[v+3],S._helpTransform,y,true)}else{this._getAffineTransform(c,a,h,r-a,A[v],A[v+1],A[v+2],A[v+3],T,b,S._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else{i=e>this._k*(t-c-h)+p;m=((s*_+f)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=f*2+_*(l+2);var A=this._vertices;if(i){this._getAffineTransform(c+h,p+u,h,u,A[v+l+4],A[v+l+5],A[v+l+2],A[v+l+3],A[v+2],A[v+3],S._helpTransform,y,true)}else{this._getAffineTransform(c,p,h,u,A[v],A[v+1],A[v+2],A[v+3],A[v+l+2],A[v+l+3],S._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}return y};S.prototype.init=function(t,e){if(this._boneData!==null){return}l.prototype.init.call(this,t,e);var a=t.segmentX;var r=t.segmentY;var i=this._armature.armatureData.parent.intArray[t.geometry.offset+0];var n=1e3;var s=200;this._dX=s*2/a;this._dY=s*2/r;this._k=-this._dY/this._dX;this._kX=-this._dY/(n-s);this._kY=-(n-s)/this._dX;this._vertices.length=i*2;this._deformVertices.length=i*2;this._matrixCahce.length=(a*r+a*2+r*2)*2*7;this._hullCache.length=10;for(var o=0;o=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(h)}if(h&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var u=1e3;var f=200;var _=2*this.global.x;var m=2*this.global.y;var c=S._helpPoint;this.globalTransformMatrix.transformPoint(u,-f,c);this._hullCache[0]=c.x;this._hullCache[1]=c.y;this._hullCache[2]=_-c.x;this._hullCache[3]=m-c.y;this.globalTransformMatrix.transformPoint(0,this._dY,c,true);this._hullCache[4]=c.x;this._hullCache[5]=c.y;this.globalTransformMatrix.transformPoint(f,u,c);this._hullCache[6]=c.x;this._hullCache[7]=c.y;this._hullCache[8]=_-c.x;this._hullCache[9]=m-c.y;this.globalTransformMatrix.transformPoint(this._dX,0,c,true);this._hullCache[10]=c.x;this._hullCache[11]=c.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return S}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(p){var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.deformVertices=[];return t}t.toString=function(){return"[class dragonBones.DisplayFrame]"};t.prototype._onClear=function(){this.rawDisplayData=null;this.displayData=null;this.textureData=null;this.display=null;this.deformVertices.length=0};t.prototype.updateDeformVertices=function(){if(this.rawDisplayData===null||this.deformVertices.length!==0){return}var t;if(this.rawDisplayData.type===2){t=this.rawDisplayData.geometry}else if(this.rawDisplayData.type===4){t=this.rawDisplayData.geometry}else{return}var e=0;if(t.weight!==null){e=t.weight.count*2}else{e=t.data.intArray[t.offset+0]*2}this.deformVertices.length=e;for(var a=0,r=this.deformVertices.length;a=0&&this._displayIndex0){for(var s=0,o=i;s=0&&this._cachedFrameIndices!==null){var r=this._cachedFrameIndices[t];if(r>=0&&this._cachedFrameIndex===r){this._transformDirty=false}else if(r>=0){this._transformDirty=true;this._cachedFrameIndex=r}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._transformDirty){if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform();this._transformDirty=false}};c.prototype.invalidUpdate=function(){this._displayDataDirty=true;this._displayDirty=true;this._transformDirty=true};c.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._updateGlobalTransformMatrix(false);this._transformDirty=false}};c.prototype.replaceRawDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.rawDisplayData!==t){a.deformVertices.length=0;a.rawDisplayData=t;if(a.rawDisplayData===null){var r=this._armature._armatureData.defaultSkin;if(r!==null){var i=r.getDisplays(this._slotData.name);if(i!==null&&e=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.displayData!==t&&a.rawDisplayData!==t){a.displayData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};c.prototype.replaceTextureData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.textureData!==t){a.textureData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};c.prototype.replaceDisplay=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.display!==t){var r=a.display;a.display=t;if(r!==null&&r!==this._rawDisplay&&r!==this._meshDisplay&&!this._hasDisplay(r)){if(r instanceof p.Armature){}else{this._disposeDisplay(r,true)}}if(t!==null&&t!==this._rawDisplay&&t!==this._meshDisplay&&!this._hasDisplay(r)&&!(t instanceof p.Armature)){this._initDisplay(t,true)}if(e===this._displayIndex){this._displayDirty=true}}};c.prototype.containsPoint=function(t,e){if(this._boundingBoxData===null){return false}this.updateTransformAndMatrix();c._helpMatrix.copyFrom(this.globalTransformMatrix);c._helpMatrix.invert();c._helpMatrix.transformPoint(t,e,c._helpPoint);return this._boundingBoxData.containsPoint(c._helpPoint.x,c._helpPoint.y)};c.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}if(this._boundingBoxData===null){return 0}this.updateTransformAndMatrix();c._helpMatrix.copyFrom(this.globalTransformMatrix);c._helpMatrix.invert();c._helpMatrix.transformPoint(t,e,c._helpPoint);t=c._helpPoint.x;e=c._helpPoint.y;c._helpMatrix.transformPoint(a,r,c._helpPoint);a=c._helpPoint.x;r=c._helpPoint.y;var o=this._boundingBoxData.intersectsSegment(t,e,a,r,i,n,s);if(o>0){if(o===1||o===2){if(i!==null){this.globalTransformMatrix.transformPoint(i.x,i.y,i);if(n!==null){n.x=i.x;n.y=i.y}}else if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}}else{if(i!==null){this.globalTransformMatrix.transformPoint(i.x,i.y,i)}if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}}if(s!==null){this.globalTransformMatrix.transformPoint(Math.cos(s.x),Math.sin(s.x),c._helpPoint,true);s.x=Math.atan2(c._helpPoint.y,c._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(s.y),Math.sin(s.y),c._helpPoint,true);s.y=Math.atan2(c._helpPoint.y,c._helpPoint.x)}}return o};c.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]};Object.defineProperty(c.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(c.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(t){var e=this._displayFrames.length;if(et){for(var a=e-1;ad){continue}var b=0;for(;;D++){var A=y[D];if(p>A){continue}if(D===0){b=p/A}else{var S=y[D-1];b=(p-S)/(A-S)}break}if(D!==c){c=D;if(u&&D===m){this._computeVertices(_-4,4,0,f);this._computeVertices(0,4,4,f)}else{this._computeVertices(D*6+2,8,0,f)}}this.addCurvePosition(b,f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],l,g,a)}return}if(u){_+=2;f.length=o;this._computeVertices(2,_-4,0,f);this._computeVertices(0,2,_-4,f);f[_-2]=f[0];f[_-1]=f[1]}else{m--;_-=4;f.length=_;this._computeVertices(2,_,0,f)}var P=new Array(m);d=0;var O=f[0],x=f[1],B=0,E=0,M=0,I=0,C=0,F=0;var w,N,R,j,k,L,V,Y;for(var v=0,U=2;vd){continue}for(;;D++){var W=P[D];if(H>W)continue;if(D===0)H/=W;else{var K=P[D-1];H=(H-K)/(W-K)}break}if(D!==c){c=D;var Z=D*6;O=f[Z];x=f[Z+1];B=f[Z+2];E=f[Z+3];M=f[Z+4];I=f[Z+5];C=f[Z+6];F=f[Z+7];w=(O-B*2+M)*.03;N=(x-E*2+I)*.03;R=((B-M)*3-O+C)*.006;j=((E-I)*3-x+F)*.006;k=w*2+R;L=N*2+j;V=(B-O)*.3+w+R*.16666667;Y=(E-x)*.3+N+j*.16666667;G=Math.sqrt(V*V+Y*Y);X[0]=G;for(Z=1;Z<8;Z++){V+=k;Y+=L;k+=R;L+=j;G+=Math.sqrt(V*V+Y*Y);X[Z]=G}V+=k;Y+=L;G+=Math.sqrt(V*V+Y*Y);X[8]=G;V+=k+R;Y+=L+j;G+=Math.sqrt(V*V+Y*Y);X[9]=G;z=0}H*=G;for(;;z++){var q=X[z];if(H>q)continue;if(z===0)H/=q;else{var K=X[z-1];H=z+(H-K)/(q-K)}break}this.addCurvePosition(H*.1,O,x,B,E,M,I,C,F,l,g,a)}};t.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,u,f){if(t===0){h[u]=e;h[u+1]=a;h[u+2]=0;return}if(t===1){h[u]=o;h[u+1]=l;h[u+2]=0;return}var _=1-t;var m=_*_;var c=t*t;var p=m*_;var d=m*t*3;var y=_*c*3;var v=t*c;var g=p*e+d*r+y*n+v*o;var D=p*a+d*i+y*s+v*l;h[u]=g;h[u+1]=D;if(f){h[u+2]=Math.atan2(D-(p*a+d*i+y*s),g-(p*e+d*r+y*n))}else{h[u+2]=0}};t.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?U.Transform.DEG_RAD:-U.Transform.DEG_RAD}}var x=this.rotateMix;var B=this.translateMix;for(var c=0,E=3;c0){var w=v.a,N=v.b,R=v.c,j=v.d,k=void 0,L=void 0,V=void 0;if(h){k=b[E-1]}else{k=Math.atan2(I,M)}k-=Math.atan2(N,w);if(O){L=Math.cos(k);V=Math.sin(k);var Y=d._boneData.length;S+=(Y*(L*w-V*N)-M)*x;P+=(Y*(V*w+L*N)-I)*x}else{k+=A}if(k>U.Transform.PI){k-=U.Transform.PI_D}else if(k<-U.Transform.PI){k+=U.Transform.PI_D}k*=x;L=Math.cos(k);V=Math.sin(k);v.a=L*w-V*N;v.b=V*w+L*N;v.c=L*R-V*j;v.d=V*R+L*j}d.global.fromMatrix(v)}this.dirty=false};t.prototype.invalidUpdate=function(){};return t}(t);U.PathConstraint=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=0}this.time=0;this.timeScale=1;this._systemTime=0;this._animatebles=[];this._clock=null;this.time=t;this._systemTime=(new Date).getTime()*.001}t.prototype.advanceTime=function(t){if(t!==t){t=0}var e=Date.now()*.001;if(t<0){t=e-this._systemTime}this._systemTime=e;if(this.timeScale!==1){t*=this.timeScale}if(t===0){return}if(t<0){this.time-=t}else{this.time+=t}var a=0,r=0,i=this._animatebles.length;for(;a0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&n._subFadeState>0){this._armature._dragonBones.bufferObject(n);this._animationStates.length=0;this._lastAnimationState=null}else{var s=n.animationData;var o=s.cacheFrameRate;if(this._animationDirty&&o>0){this._animationDirty=false;for(var l=0,h=this._armature.getBones();l0){var c=m.getDisplayFrameAt(0).rawDisplayData;if(c!==null&&c.parent===this._armature.armatureData.defaultSkin){m._cachedFrameIndices=s.getSlotCachedFrameIndices(m.name);continue}}m._cachedFrameIndices=null}}n.advanceTime(t,o)}}else if(i>1){for(var p=0,d=0;p0&&n._subFadeState>0){d++;this._armature._dragonBones.bufferObject(n);this._animationDirty=true;if(this._lastAnimationState===n){this._lastAnimationState=null}}else{if(d>0){this._animationStates[p-d]=n}n.advanceTime(t,0)}if(p===i-1&&d>0){this._animationStates.length-=d;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};t.prototype.reset=function(){for(var t=0,e=this._animationStates;t0){if(t.position<0){t.position%=a.duration;t.position=a.duration-t.position}else if(t.position===a.duration){t.position-=1e-6}else if(t.position>a.duration){t.position%=a.duration}if(t.duration>0&&t.position+t.duration>a.duration){t.duration=a.duration-t.position}if(t.playTimes<0){t.playTimes=a.playTimes}}else{t.playTimes=1;t.position=0;if(t.duration>0){t.duration=0}}if(t.duration===0){t.duration=-1}this._fadeOut(t);var s=g.BaseObject.borrowObject(g.AnimationState);s.init(this._armature,a,t);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var o=false;for(var l=0,h=this._animationStates.length;lthis._animationStates[l].layer){o=true;this._animationStates.splice(l,0,s);break}else if(l!==h-1&&s.layer>this._animationStates[l+1].layer){o=true;this._animationStates.splice(l+1,0,s);break}}if(!o){this._animationStates.push(s)}}else{this._animationStates.push(s)}for(var u=0,f=this._armature.getSlots();u0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};t.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.frameCount>0?r.duration*e/r.frameCount:0}return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};t.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};t.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};t.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};t.prototype.getBlendState=function(t,e,a){if(!(t in this._blendStates)){this._blendStates[t]={}}var r=this._blendStates[t];if(!(e in r)){var i=r[e]=g.BaseObject.borrowObject(g.BlendState);i.target=a}return r[e]};t.prototype.getState=function(t,e){if(e===void 0){e=-1}var a=this._animationStates.length;while(a--){var r=this._animationStates[a];if(r.name===t&&(e<0||r.layer===e)){return r}}return null};t.prototype.hasAnimation=function(t){return t in this._animations};t.prototype.getStates=function(){return this._animationStates};Object.defineProperty(t.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});return t}(g.BaseObject);g.Animation=t})(dragonBones||(dragonBones={}));var dragonBones;(function(L){var t=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t._boneMask=[];t._boneTimelines=[];t._boneBlendTimelines=[];t._slotTimelines=[];t._slotBlendTimelines=[];t._constraintTimelines=[];t._animationTimelines=[];t._poseTimelines=[];t._actionTimeline=null;t._zOrderTimeline=null;return t}t.toString=function(){return"[class dragonBones.AnimationState]"};t.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0){this._boneTimelines.splice(v,1);r.returnToPool()}v=this._boneBlendTimelines.indexOf(r);if(v>=0){this._boneBlendTimelines.splice(v,1);r.returnToPool()}}}}{var g={};var D=[];for(var T=0,b=this._slotTimelines;T=0){this._slotTimelines.splice(v,1);r.returnToPool()}v=this._slotBlendTimelines.indexOf(r);if(v>=0){this._slotBlendTimelines.splice(v,1);r.returnToPool()}}}}};t.prototype._advanceFadeTime=function(t){var e=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var a=this._parent===null&&this.actionEnabled;if(a){var r=e?L.EventObject.FADE_OUT:L.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=L.BaseObject.borrowObject(L.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}}if(t<0){t=-t}this._fadeTime+=t;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=e?0:1}else if(this._fadeTime>0){this._fadeProgress=e?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=e?1:0}if(this._subFadeState>0){if(!e){this._playheadState|=1;this._fadeState=0}var a=this._parent===null&&this.actionEnabled;if(a){var r=e?L.EventObject.FADE_OUT_COMPLETE:L.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=L.BaseObject.borrowObject(L.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}}};t.prototype.init=function(t,e,a){if(this._armature!==null){return}this._armature=t;this._animationData=e;this.resetToPose=a.resetToPose;this.additive=a.additive;this.displayControl=a.displayControl;this.actionEnabled=a.actionEnabled;this.blendType=e.blendType;this.layer=a.layer;this.playTimes=a.playTimes;this.timeScale=a.timeScale;this.fadeTotalTime=a.fadeInTime;this.autoFadeOutTime=a.autoFadeOutTime;this.name=a.name.length>0?a.name:a.animation;this.group=a.group;this._weight=a.weight;if(a.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(a.duration<0){this._position=0;this._duration=this._animationData.duration;if(a.position!==0){if(this.timeScale>=0){this._time=a.position}else{this._time=a.position-this._duration}}else{this._time=0}}else{this._position=a.position;this._duration=a.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(a.boneMask.length>0){this._boneMask.length=a.boneMask.length;for(var r=0,i=this._boneMask.length;r0;var i=true;var n=true;var s=this._time;this._weightResult=this._weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(this._weight===0){return}if(r){var o=e*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*e);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){var h=false;var u=null;if(n){for(var f=0,_=this._boneTimelines.length;f<_;++f){var m=this._boneTimelines[f];if(m.playState<=0){m.update(s)}if(m.target!==u){var c=m.target;h=c.update(this);u=c;if(c.dirty===1){var p=c.target.animationPose;p.x=0;p.y=0;p.rotation=0;p.skew=0;p.scaleX=1;p.scaleY=1}}if(h){m.blend(a)}}}for(var f=0,_=this._boneBlendTimelines.length;f<_;++f){var m=this._boneBlendTimelines[f];if(m.playState<=0){m.update(s)}if(m.target.update(this)){m.blend(a)}}if(this.displayControl){for(var f=0,_=this._slotTimelines.length;f<_;++f){var m=this._slotTimelines[f];if(m.playState<=0){var d=m.target;var y=d.displayController;if(y===null||y===this.name||y===this.group){m.update(s)}}}}for(var f=0,_=this._slotBlendTimelines.length;f<_;++f){var m=this._slotBlendTimelines[f];if(m.playState<=0){var c=m.target;m.update(s);if(c.update(this)){m.blend(a)}}}for(var f=0,_=this._constraintTimelines.length;f<_;++f){var m=this._constraintTimelines[f];if(m.playState<=0){m.update(s)}}if(this._animationTimelines.length>0){var v=100;var g=100;var D=null;var T=null;for(var f=0,_=this._animationTimelines.length;f<_;++f){var m=this._animationTimelines[f];if(m.playState<=0){m.update(s)}if(this.blendType===1){var b=m.target;var A=this.parameterX-b.positionX;if(A>=0){if(A0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var S=0,P=this._poseTimelines;S=0){this._boneTimelines.splice(O,1);m.returnToPool();continue}O=this._boneBlendTimelines.indexOf(m);if(O>=0){this._boneBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._slotTimelines.indexOf(m);if(O>=0){this._slotTimelines.splice(O,1);m.returnToPool();continue}O=this._slotBlendTimelines.indexOf(m);if(O>=0){this._slotBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._constraintTimelines.indexOf(m);if(O>=0){this._constraintTimelines.splice(O,1);m.returnToPool();continue}}this._poseTimelines.length=0}}if(this._actionTimeline.playState>0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};t.prototype.play=function(){this._playheadState=3};t.prototype.stop=function(){this._playheadState&=1};t.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};t.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};t.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,u=i;h0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&this._parent===null){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.dirty++;this.layer=e;this.leftWeight=0;this.blendWeight=0;return false}this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}a*=this.leftWeight;this.dirty++;this.blendWeight=a;this.layerWeight+=this.blendWeight;return true}return false}this.dirty++;this.layer=e;this.leftWeight=1;this.blendWeight=a;this.layerWeight=a;return true};e.prototype.reset=function(){this.dirty=0;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};e.BONE_TRANSFORM="boneTransform";e.BONE_ALPHA="boneAlpha";e.SURFACE="surface";e.SLOT_DEFORM="slotDeform";e.SLOT_ALPHA="slotAlpha";e.SLOT_Z_INDEX="slotZIndex";return e}(L.BaseObject);L.BlendState=V})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.dirty=false;this.playState=-1;this.currentPlayTimes=-1;this.currentTime=-1;this.target=null;this._isTween=false;this._valueOffset=0;this._frameValueOffset=0;this._frameOffset=0;this._frameRate=0;this._frameCount=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._valueArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this.playState===1?this._duration+1e-6:this._duration}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState.animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;if(this._timelineData!==null){var r=this._animationData.parent.parent;this._frameArray=r.frameArray;this._timelineArray=r.timelineArray;this._frameIndices=r.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){this.dirty=false};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._isTween||this.dirty){this._onUpdateFrame()}}};e.prototype.blend=function(t){};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a>0;var n=a+1;var s=Math.floor(t*n);var o=0;var l=0;if(i){o=s===0?0:e[r+s-1];l=s===n-1?1e4:e[r+s]}else{o=e[r+s-1];l=e[r+s]}return(o+(l-o)*(t*n-s))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenEasing=0;this._tweenProgress=0;this._valueScale=1};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this.dirty=true;this._isTween=false}};e.prototype._onUpdateFrame=function(){if(this._isTween){this.dirty=true;this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}};return e}(e);t.TweenTimelineState=a;var r=function(i){__extends(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}t.prototype._onClear=function(){i.prototype._onClear.call(this);this._current=0;this._difference=0;this._result=0};t.prototype._onArriveAtFrame=function(){i.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._valueScale;var e=this._valueArray;var a=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:a+1;if(t===1){this._current=e[a];this._difference=e[r]-this._current}else{this._current=e[a]*t;this._difference=e[r]*t-this._current}}else{this._result=e[a]*t}}else{this._result=0}};t.prototype._onUpdateFrame=function(){i.prototype._onUpdateFrame.call(this);if(this._isTween){this._result=this._current+this._difference*this._tweenProgress}};return t}(a);t.SingleValueTimelineState=r;var i=function(i){__extends(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}t.prototype._onClear=function(){i.prototype._onClear.call(this);this._currentA=0;this._currentB=0;this._differenceA=0;this._differenceB=0;this._resultA=0;this._resultB=0};t.prototype._onArriveAtFrame=function(){i.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._valueScale;var e=this._valueArray;var a=this._valueOffset+this._frameValueOffset+this._frameIndex*2;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:a+2;if(t===1){this._currentA=e[a];this._currentB=e[a+1];this._differenceA=e[r]-this._currentA;this._differenceB=e[r+1]-this._currentB}else{this._currentA=e[a]*t;this._currentB=e[a+1]*t;this._differenceA=e[r]*t-this._currentA;this._differenceB=e[r+1]*t-this._currentB}}else{this._resultA=e[a]*t;this._resultB=e[a+1]*t}}else{this._resultA=0;this._resultB=0}};t.prototype._onUpdateFrame=function(){i.prototype._onUpdateFrame.call(this);if(this._isTween){this._resultA=this._currentA+this._differenceA*this._tweenProgress;this._resultB=this._currentB+this._differenceB*this._tweenProgress}};return t}(a);t.DoubleValueTimelineState=i;var n=function(o){__extends(t,o);function t(){var t=o!==null&&o.apply(this,arguments)||this;t._rd=[];return t}t.prototype._onClear=function(){o.prototype._onClear.call(this);this._valueCount=0;this._rd.length=0};t.prototype._onArriveAtFrame=function(){o.prototype._onArriveAtFrame.call(this);var t=this._valueCount;var e=this._rd;if(this._timelineData!==null){var a=this._valueScale;var r=this._valueArray;var i=this._valueOffset+this._frameValueOffset+this._frameIndex*t;if(this._isTween){var n=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:i+t;if(a===1){for(var s=0;s0){if(n.hasDBEventListener(y.EventObject.COMPLETE)){h=y.BaseObject.borrowObject(y.EventObject);h.type=y.EventObject.COMPLETE;h.armature=this._armature;h.animationState=this._animationState}}}if(this._frameCount>1){var u=this._timelineData;var f=Math.floor(this.currentTime*this._frameRate);var _=this._frameIndices[u.frameIndicesOffset+f];if(this._frameIndex!==_){var m=this._frameIndex;this._frameIndex=_;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[u.offset+5+this._frameIndex];if(o){if(m<0){var c=Math.floor(r*this._frameRate);m=this._frameIndices[u.frameIndicesOffset+c];if(this.currentPlayTimes===a){if(m===_){m=-1}}}while(m>=0){var p=this._animationData.frameOffset+this._timelineArray[u.offset+5+m];var d=this._frameArray[p]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(m)}if(l!==null&&m===0){this._armature._dragonBones.bufferEvent(l);l=null}if(m>0){m--}else{m=this._frameCount-1}if(m===_){break}}}else{if(m<0){var c=Math.floor(r*this._frameRate);m=this._frameIndices[u.frameIndicesOffset+c];var p=this._animationData.frameOffset+this._timelineArray[u.offset+5+m];var d=this._frameArray[p]/this._frameRate;if(this.currentPlayTimes===a){if(r<=d){if(m>0){m--}else{m=this._frameCount-1}}else if(m===_){m=-1}}}while(m>=0){if(m=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(y.TimelineState);y.ZOrderTimelineState=e;var a=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._rd[2]=y.Transform.normalizeRadian(this._rd[2]);this._rd[3]=y.Transform.normalizeRadian(this._rd[3])}if(this._timelineData===null){this._rd[4]=1;this._rd[5]=1}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=6;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.fadeOut=function(){this.dirty=false;this._rd[2]=y.Transform.normalizeRadian(this._rd[2]);this._rd[3]=y.Transform.normalizeRadian(this._rd[3])};t.prototype.blend=function(t){var e=this._armature.armatureData.scale;var a=this._rd;var r=this.target;var i=r.target;var n=r.blendWeight;var s=i.animationPose;if(r.dirty>1){s.x+=a[0]*n*e;s.y+=a[1]*n*e;s.rotation+=a[2]*n;s.skew+=a[3]*n;s.scaleX+=(a[4]-1)*n;s.scaleY+=(a[5]-1)*n}else{s.x=a[0]*n*e;s.y=a[1]*n*e;s.rotation=a[2]*n;s.skew=a[3]*n;s.scaleX=(a[4]-1)*n+1;s.scaleY=(a[5]-1)*n+1}if(t||this.dirty){this.dirty=false;i._transformDirty=true}};return t}(y.MutilpleValueTimelineState);y.BoneAllTimelineState=a;var r=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.x+=this._resultA*r;i.y+=this._resultB*r}else if(r!==1){i.x=this._resultA*r;i.y=this._resultB*r}else{i.x=this._resultA;i.y=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneTranslateTimelineState=r;var i=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._differenceA=y.Transform.normalizeRadian(this._differenceA);this._differenceB=y.Transform.normalizeRadian(this._differenceB)}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.fadeOut=function(){this.dirty=false;this._resultA=y.Transform.normalizeRadian(this._resultA);this._resultB=y.Transform.normalizeRadian(this._resultB)};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.rotation+=this._resultA*r;i.skew+=this._resultB*r}else if(r!==1){i.rotation=this._resultA*r;i.skew=this._resultB*r}else{i.rotation=this._resultA;i.skew=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneRotateTimelineState=i;var n=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){this._resultA=1;this._resultB=1}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.scaleX+=(this._resultA-1)*r;i.scaleY+=(this._resultB-1)*r}else if(r!==1){i.scaleX=(this._resultA-1)*r+1;i.scaleY=(this._resultB-1)*r+1}else{i.scaleX=this._resultA;i.scaleY=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneScaleTimelineState=n;var s=function(s){__extends(t,s);function t(){return s!==null&&s.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};t.prototype._onClear=function(){s.prototype._onClear.call(this);this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};t.prototype.init=function(t,e,a){s.prototype.init.call(this,t,e,a);if(this._timelineData!==null){var r=this._animationData.parent.parent;var i=r.frameIntArray;var n=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=i[n+2];this._deformCount=i[n+1];this._deformOffset=i[n+3];this._sameValueOffset=i[n+4]+this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=r.frameFloatArray;this._rd.length=this._valueCount*2}else{this._deformCount=this.target.target._deformVertices.length}};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a._deformVertices;var n=this._valueArray;if(n!==null){var s=this._valueCount;var o=this._deformOffset;var l=this._sameValueOffset;var h=this._rd;for(var u=0;u1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u1){a._alpha+=this._result*r;if(a._alpha>1){a._alpha=1}}else{a._alpha=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._alphaDirty=true}};return t}(y.SingleValueTimelineState);y.AlphaTimelineState=o;var l=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotDisplayTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target;var e=this._timelineData!==null?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;if(t.displayIndex!==e){t._setDisplayIndex(e,true)}}};e.prototype._onUpdateFrame=function(){};return e}(y.TimelineState);y.SlotDisplayTimelineState=l;var h=function(o){__extends(t,o);function t(){var t=o!==null&&o.apply(this,arguments)||this;t._current=[0,0,0,0,0,0,0,0];t._difference=[0,0,0,0,0,0,0,0];t._result=[0,0,0,0,0,0,0,0];return t}t.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};t.prototype._onArriveAtFrame=function(){o.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.parent.parent;var e=t.colorArray;var a=t.frameIntArray;var r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex;var i=a[r];if(i<0){i+=65536}if(this._isTween){this._current[0]=e[i++];this._current[1]=e[i++];this._current[2]=e[i++];this._current[3]=e[i++];this._current[4]=e[i++];this._current[5]=e[i++];this._current[6]=e[i++];this._current[7]=e[i++];if(this._frameIndex===this._frameCount-1){i=a[this._animationData.frameIntOffset+this._frameValueOffset]}else{i=a[r+1]}if(i<0){i+=65536}this._difference[0]=e[i++]-this._current[0];this._difference[1]=e[i++]-this._current[1];this._difference[2]=e[i++]-this._current[2];this._difference[3]=e[i++]-this._current[3];this._difference[4]=e[i++]-this._current[4];this._difference[5]=e[i++]-this._current[5];this._difference[6]=e[i++]-this._current[6];this._difference[7]=e[i++]-this._current[7]}else{this._result[0]=e[i++]*.01;this._result[1]=e[i++]*.01;this._result[2]=e[i++]*.01;this._result[3]=e[i++]*.01;this._result[4]=e[i++];this._result[5]=e[i++];this._result[6]=e[i++];this._result[7]=e[i++]}}else{var n=this.target;var s=n.slotData.color;this._result[0]=s.alphaMultiplier;this._result[1]=s.redMultiplier;this._result[2]=s.greenMultiplier;this._result[3]=s.blueMultiplier;this._result[4]=s.alphaOffset;this._result[5]=s.redOffset;this._result[6]=s.greenOffset;this._result[7]=s.blueOffset}};t.prototype._onUpdateFrame=function(){o.prototype._onUpdateFrame.call(this);if(this._isTween){this._result[0]=(this._current[0]+this._difference[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._difference[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._difference[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._difference[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress;this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress;this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress;this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress}};t.prototype.fadeOut=function(){this._isTween=false};t.prototype.update=function(t){o.prototype.update.call(this,t);if(this._isTween||this.dirty){var e=this.target;var a=e._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);a.alphaMultiplier+=(this._result[0]-a.alphaMultiplier)*r;a.redMultiplier+=(this._result[1]-a.redMultiplier)*r;a.greenMultiplier+=(this._result[2]-a.greenMultiplier)*r;a.blueMultiplier+=(this._result[3]-a.blueMultiplier)*r;a.alphaOffset+=(this._result[4]-a.alphaOffset)*r;a.redOffset+=(this._result[5]-a.redOffset)*r;a.greenOffset+=(this._result[6]-a.greenOffset)*r;a.blueOffset+=(this._result[7]-a.blueOffset)*r;e._colorDirty=true}}else if(this.dirty){this.dirty=false;if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){a.alphaMultiplier=this._result[0];a.redMultiplier=this._result[1];a.greenMultiplier=this._result[2];a.blueMultiplier=this._result[3];a.alphaOffset=this._result[4];a.redOffset=this._result[5];a.greenOffset=this._result[6];a.blueOffset=this._result[7];e._colorDirty=true}}}};return t}(y.TweenTimelineState);y.SlotColorTimelineState=h;var u=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){var t=this.target;var e=t.target;this._result=e.slotData.zIndex}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueArray=this._animationData.parent.parent.frameIntArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;if(e.dirty>1){a._zIndex+=this._result*r}else{a._zIndex=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._zIndexDirty=true}};return t}(y.SingleValueTimelineState);y.SlotZIndexTimelineState=u;var f=function(f){__extends(t,f);function t(){return f!==null&&f.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.DeformTimelineState]"};t.prototype._onClear=function(){f.prototype._onClear.call(this);this.geometryOffset=0;this.displayFrame=null;this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};t.prototype.init=function(t,e,a){f.prototype.init.call(this,t,e,a);if(this._timelineData!==null){var r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];var i=this._animationData.parent.parent;var n=i.frameIntArray;var s=this.target.target;this.geometryOffset=n[r+0];if(this.geometryOffset<0){this.geometryOffset+=65536}for(var o=0,l=s.displayFrameCount;o1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u0;t._weight=this._currentB}else{var e=t._constraintData;t._bendPositive=e.bendPositive;t._weight=e.weight}t.invalidUpdate();this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=.01;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.DoubleValueTimelineState);y.IKConstraintTimelineState=_;var m=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.currentTime=this._result*t.totalTime}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.SingleValueTimelineState);y.AnimationProgressTimelineState=m;var c=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.weight=this._result}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.SingleValueTimelineState);y.AnimationWeightTimelineState=c;var p=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.parameterX=this._resultA;t.parameterY=this._resultB}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.DoubleValueTimelineState);y.AnimationParametersTimelineState=p})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.actionDataToInstance=function(t,e,a){if(t.type===0){e.type=r.FRAME_EVENT}else{e.type=t.type===10?r.FRAME_EVENT:r.SOUND_EVENT}e.name=t.name;e.armature=a;e.actionData=t;e.data=t.data;if(t.bone!==null){e.bone=a.getBone(t.bone.name)}if(t.slot!==null){e.slot=a.getSlot(t.slot.name)}};r.toString=function(){return"[class dragonBones.EventObject]"};r.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};r.START="start";r.LOOP_COMPLETE="loopComplete";r.COMPLETE="complete";r.FADE_IN="fadeIn";r.FADE_IN_COMPLETE="fadeInComplete";r.FADE_OUT="fadeOut";r.FADE_OUT_COMPLETE="fadeOutComplete";r.FRAME_EVENT="frameEvent";r.SOUND_EVENT="soundEvent";return r}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(){}t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}};t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};t.DATA_VERSION_2_3="2.3";t.DATA_VERSION_3_0="3.0";t.DATA_VERSION_4_0="4.0";t.DATA_VERSION_4_5="4.5";t.DATA_VERSION_5_0="5.0";t.DATA_VERSION_5_5="5.5";t.DATA_VERSION_5_6="5.6";t.DATA_VERSION=t.DATA_VERSION_5_6;t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6];t.TEXTURE_ATLAS="textureAtlas";t.SUB_TEXTURE="SubTexture";t.FORMAT="format";t.IMAGE_PATH="imagePath";t.WIDTH="width";t.HEIGHT="height";t.ROTATED="rotated";t.FRAME_X="frameX";t.FRAME_Y="frameY";t.FRAME_WIDTH="frameWidth";t.FRAME_HEIGHT="frameHeight";t.DRADON_BONES="dragonBones";t.USER_DATA="userData";t.ARMATURE="armature";t.CANVAS="canvas";t.BONE="bone";t.SURFACE="surface";t.SLOT="slot";t.CONSTRAINT="constraint";t.SKIN="skin";t.DISPLAY="display";t.FRAME="frame";t.IK="ik";t.PATH_CONSTRAINT="path";t.ANIMATION="animation";t.TIMELINE="timeline";t.FFD="ffd";t.TRANSLATE_FRAME="translateFrame";t.ROTATE_FRAME="rotateFrame";t.SCALE_FRAME="scaleFrame";t.DISPLAY_FRAME="displayFrame";t.COLOR_FRAME="colorFrame";t.DEFAULT_ACTIONS="defaultActions";t.ACTIONS="actions";t.EVENTS="events";t.INTS="ints";t.FLOATS="floats";t.STRINGS="strings";t.TRANSFORM="transform";t.PIVOT="pivot";t.AABB="aabb";t.COLOR="color";t.VERSION="version";t.COMPATIBLE_VERSION="compatibleVersion";t.FRAME_RATE="frameRate";t.TYPE="type";t.SUB_TYPE="subType";t.NAME="name";t.PARENT="parent";t.TARGET="target";t.STAGE="stage";t.SHARE="share";t.PATH="path";t.LENGTH="length";t.DISPLAY_INDEX="displayIndex";t.Z_ORDER="zOrder";t.Z_INDEX="zIndex";t.BLEND_MODE="blendMode";t.INHERIT_TRANSLATION="inheritTranslation";t.INHERIT_ROTATION="inheritRotation";t.INHERIT_SCALE="inheritScale";t.INHERIT_REFLECTION="inheritReflection";t.INHERIT_ANIMATION="inheritAnimation";t.INHERIT_DEFORM="inheritDeform";t.SEGMENT_X="segmentX";t.SEGMENT_Y="segmentY";t.BEND_POSITIVE="bendPositive";t.CHAIN="chain";t.WEIGHT="weight";t.BLEND_TYPE="blendType";t.FADE_IN_TIME="fadeInTime";t.PLAY_TIMES="playTimes";t.SCALE="scale";t.OFFSET="offset";t.POSITION="position";t.DURATION="duration";t.TWEEN_EASING="tweenEasing";t.TWEEN_ROTATE="tweenRotate";t.TWEEN_SCALE="tweenScale";t.CLOCK_WISE="clockwise";t.CURVE="curve";t.SOUND="sound";t.EVENT="event";t.ACTION="action";t.X="x";t.Y="y";t.SKEW_X="skX";t.SKEW_Y="skY";t.SCALE_X="scX";t.SCALE_Y="scY";t.VALUE="value";t.ROTATE="rotate";t.SKEW="skew";t.ALPHA="alpha";t.ALPHA_OFFSET="aO";t.RED_OFFSET="rO";t.GREEN_OFFSET="gO";t.BLUE_OFFSET="bO";t.ALPHA_MULTIPLIER="aM";t.RED_MULTIPLIER="rM";t.GREEN_MULTIPLIER="gM";t.BLUE_MULTIPLIER="bM";t.UVS="uvs";t.VERTICES="vertices";t.TRIANGLES="triangles";t.WEIGHTS="weights";t.SLOT_POSE="slotPose";t.BONE_POSE="bonePose";t.BONES="bones";t.POSITION_MODE="positionMode";t.SPACING_MODE="spacingMode";t.ROTATE_MODE="rotateMode";t.SPACING="spacing";t.ROTATE_OFFSET="rotateOffset";t.ROTATE_MIX="rotateMix";t.TRANSLATE_MIX="translateMix";t.TARGET_DISPLAY="targetDisplay";t.CLOSED="closed";t.CONSTANT_SPEED="constantSpeed";t.VERTEX_COUNT="vertexCount";t.LENGTHS="lengths";t.GOTO_AND_PLAY="gotoAndPlay";t.DEFAULT_NAME="default";return t}();t.DataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(tt){var t=function(e){__extends($,e);function $(){var t=e!==null&&e.apply(this,arguments)||this;t._rawTextureAtlasIndex=0;t._rawBones=[];t._data=null;t._armature=null;t._bone=null;t._geometry=null;t._slot=null;t._skin=null;t._mesh=null;t._animation=null;t._timeline=null;t._rawTextureAtlases=null;t._frameValueType=0;t._defaultColorOffset=-1;t._prevClockwise=0;t._prevRotation=0;t._frameDefaultValue=0;t._frameValueScale=1;t._helpMatrixA=new tt.Matrix;t._helpMatrixB=new tt.Matrix;t._helpTransform=new tt.Transform;t._helpColorTransform=new tt.ColorTransform;t._helpPoint=new tt.Point;t._helpArray=[];t._intArray=[];t._floatArray=[];t._frameIntArray=[];t._frameFloatArray=[];t._frameArray=[];t._timelineArray=[];t._colorArray=[];t._cacheRawMeshes=[];t._cacheMeshes=[];t._actionFrames=[];t._weightSlotPose={};t._weightBonePoses={};t._cacheBones={};t._slotChildActions={};return t}$._getBoolean=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="boolean"){return r}else if(i==="string"){switch(r){case"0":case"NaN":case"":case"false":case"null":case"undefined":return false;default:return true}}else{return!!r}}return a};$._getNumber=function(t,e,a){if(e in t){var r=t[e];if(r===null||r==="NaN"){return a}return+r||0}return a};$._getString=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="string"){return r}return String(r)}return a};$.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var u=1-l;var f=u*u;var _=l*l;var m=u*f;var c=3*l*f;var p=3*u*_;var d=l*_;h.x=m*t+c*a+p*i+d*s;h.y=m*e+c*r+p*n+d*o};$.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3===1){var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,c,p,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return true}else{var r=0;for(var i=0,n=e.length;i1e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,c,p,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return false}};$.prototype._parseActionDataInFrame=function(t,e,a,r){if(tt.DataParser.EVENT in t){this._mergeActionFrame(t[tt.DataParser.EVENT],e,10,a,r)}if(tt.DataParser.SOUND in t){this._mergeActionFrame(t[tt.DataParser.SOUND],e,11,a,r)}if(tt.DataParser.ACTION in t){this._mergeActionFrame(t[tt.DataParser.ACTION],e,0,a,r)}if(tt.DataParser.EVENTS in t){this._mergeActionFrame(t[tt.DataParser.EVENTS],e,10,a,r)}if(tt.DataParser.ACTIONS in t){this._mergeActionFrame(t[tt.DataParser.ACTIONS],e,0,a,r)}};$.prototype._mergeActionFrame=function(t,e,a,r,i){var n=this._armature.actions.length;var s=this._parseActionData(t,a,r,i);var o=0;var l=null;for(var h=0,u=s;he){break}o++}if(l===null){l=new D;l.frameStart=e;this._actionFrames.splice(o,0,l)}for(var p=0;p0){var _=a.getBone(u);if(_!==null){f.parent=_}else{if(!(u in this._cacheBones)){this._cacheBones[u]=[]}this._cacheBones[u].push(f)}}if(f.name in this._cacheBones){for(var m=0,c=this._cacheBones[f.name];m0&&e.parent!==null){i.root=e.parent;i.bone=e}else{i.root=e;i.bone=null}return i};$.prototype._parsePathConstraint=function(t){var e=this._armature.getSlot($._getString(t,tt.DataParser.TARGET,""));if(e===null){return null}var a=this._armature.defaultSkin;if(a===null){return null}var r=a.getDisplay(e.name,$._getString(t,tt.DataParser.TARGET_DISPLAY,e.name));if(r===null||!(r instanceof tt.PathDisplayData)){return null}var i=t[tt.DataParser.BONES];if(i===null||i.length===0){return null}var n=tt.BaseObject.borrowObject(tt.PathConstraintData);n.name=$._getString(t,tt.DataParser.NAME,"");n.type=1;n.pathSlot=e;n.pathDisplayData=r;n.target=e.parent;n.positionMode=tt.DataParser._getPositionMode($._getString(t,tt.DataParser.POSITION_MODE,""));n.spacingMode=tt.DataParser._getSpacingMode($._getString(t,tt.DataParser.SPACING_MODE,""));n.rotateMode=tt.DataParser._getRotateMode($._getString(t,tt.DataParser.ROTATE_MODE,""));n.position=$._getNumber(t,tt.DataParser.POSITION,0);n.spacing=$._getNumber(t,tt.DataParser.SPACING,0);n.rotateOffset=$._getNumber(t,tt.DataParser.ROTATE_OFFSET,0);n.rotateMix=$._getNumber(t,tt.DataParser.ROTATE_MIX,1);n.translateMix=$._getNumber(t,tt.DataParser.TRANSLATE_MIX,1);for(var s=0,o=i;s0?a:e;this._parsePivot(t,n);break}case 1:{var s=i=tt.BaseObject.borrowObject(tt.ArmatureDisplayData);s.name=e;s.path=a.length>0?a:e;s.inheritAnimation=true;if(tt.DataParser.ACTIONS in t){var o=this._parseActionData(t[tt.DataParser.ACTIONS],0,null,null);for(var l=0,h=o;l0?a:e;if(tt.DataParser.SHARE in t){c.geometry.data=this._data;this._cacheRawMeshes.push(t);this._cacheMeshes.push(c)}else{this._parseMesh(t,c)}break}case 3:{var p=this._parseBoundingBox(t);if(p!==null){var d=i=tt.BaseObject.borrowObject(tt.BoundingBoxDisplayData);d.name=e;d.path=a.length>0?a:e;d.boundingBox=p}break}case 4:{var y=t[tt.DataParser.LENGTHS];var v=i=tt.BaseObject.borrowObject(tt.PathDisplayData);v.closed=$._getBoolean(t,tt.DataParser.CLOSED,false);v.constantSpeed=$._getBoolean(t,tt.DataParser.CONSTANT_SPEED,false);v.name=e;v.path=a.length>0?a:e;v.curveLengths.length=y.length;for(var g=0,D=y.length;ge.width){e.width=o}if(le.height){e.height=l}}}e.width-=e.x;e.height-=e.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return e};$.prototype._parseAnimation=function(t){var e=tt.BaseObject.borrowObject(tt.AnimationData);e.blendType=tt.DataParser._getAnimationBlendType($._getString(t,tt.DataParser.BLEND_TYPE,""));e.frameCount=$._getNumber(t,tt.DataParser.DURATION,0);e.playTimes=$._getNumber(t,tt.DataParser.PLAY_TIMES,1);e.duration=e.frameCount/this._armature.frameRate;e.fadeInTime=$._getNumber(t,tt.DataParser.FADE_IN_TIME,0);e.scale=$._getNumber(t,tt.DataParser.SCALE,1);e.name=$._getString(t,tt.DataParser.NAME,tt.DataParser.DEFAULT_NAME);if(e.name.length===0){e.name=tt.DataParser.DEFAULT_NAME}e.frameIntOffset=this._frameIntArray.length;e.frameFloatOffset=this._frameFloatArray.length;e.frameOffset=this._frameArray.length;this._animation=e;if(tt.DataParser.FRAME in t){var a=t[tt.DataParser.FRAME];var r=a.length;if(r>0){for(var i=0,n=0;i0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame);this._actionFrames.length=0}if(tt.DataParser.TIMELINE in t){var o=t[tt.DataParser.TIMELINE];for(var A=0,S=o;A0&&a in t){e=t[a]}if(e===null){return null}var l=e.length;if(l===0){return null}var h=this._frameIntArray.length;var u=this._frameFloatArray.length;var f=this._timelineArray.length;if(o===null){o=tt.BaseObject.borrowObject(tt.TimelineData)}o.type=r;o.offset=f;this._frameValueType=i;this._timeline=o;this._timelineArray.length+=1+1+1+1+1+l;if(t!==null){this._timelineArray[f+0]=Math.round($._getNumber(t,tt.DataParser.SCALE,1)*100);this._timelineArray[f+1]=Math.round($._getNumber(t,tt.DataParser.OFFSET,0)*100)}else{this._timelineArray[f+0]=100;this._timelineArray[f+1]=0}this._timelineArray[f+2]=l;this._timelineArray[f+3]=n;switch(this._frameValueType){case 0:this._timelineArray[f+4]=0;break;case 1:this._timelineArray[f+4]=h-this._animation.frameIntOffset;break;case 2:this._timelineArray[f+4]=u-this._animation.frameFloatOffset;break}if(l===1){o.frameIndicesOffset=-1;this._timelineArray[f+5+0]=s.call(this,e[0],0,0)-this._animation.frameOffset}else{var _=this._animation.frameCount+1;var m=this._data.frameIndices;var c=m.length;m.length+=_;o.frameIndicesOffset=c;for(var p=0,d=0,y=0,v=0;p<_;++p){if(y+v<=p&&d0){if(tt.DataParser.CURVE in t){var i=a+1;this._helpArray.length=i;var n=this._samplingEasingCurve(t[tt.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[r+1]=2;this._frameArray[r+2]=n?i:-i;for(var s=0;s0){var n=this._armature.sortedSlots.length;var s=new Array(n-i.length/2);var o=new Array(n);for(var l=0;l0?r>=this._prevRotation:r<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}r=this._prevRotation+r-this._prevRotation+tt.Transform.PI_D*this._prevClockwise}}this._prevClockwise=$._getNumber(t,tt.DataParser.TWEEN_ROTATE,0);this._prevRotation=r;var i=this._parseTweenFrame(t,e,a);var n=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[n++]=this._helpTransform.x;this._frameFloatArray[n++]=this._helpTransform.y;this._frameFloatArray[n++]=r;this._frameFloatArray[n++]=this._helpTransform.skew;this._frameFloatArray[n++]=this._helpTransform.scaleX;this._frameFloatArray[n++]=this._helpTransform.scaleY;this._parseActionDataInFrame(t,e,this._bone,this._slot);return i};$.prototype._parseBoneTranslateFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.X,0);this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.Y,0);return r};$.prototype._parseBoneRotateFrame=function(t,e,a){var r=$._getNumber(t,tt.DataParser.ROTATE,0)*tt.Transform.DEG_RAD;if(e!==0){if(this._prevClockwise===0){r=this._prevRotation+tt.Transform.normalizeRadian(r-this._prevRotation)}else{if(this._prevClockwise>0?r>=this._prevRotation:r<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}r=this._prevRotation+r-this._prevRotation+tt.Transform.PI_D*this._prevClockwise}}this._prevClockwise=$._getNumber(t,tt.DataParser.CLOCK_WISE,0);this._prevRotation=r;var i=this._parseTweenFrame(t,e,a);var n=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[n++]=r;this._frameFloatArray[n++]=$._getNumber(t,tt.DataParser.SKEW,0)*tt.Transform.DEG_RAD;return i};$.prototype._parseBoneScaleFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.X,1);this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.Y,1);return r};$.prototype._parseSlotDisplayFrame=function(t,e,a){var r=this._parseFrame(t,e,a);this._frameArray.length+=1;if(tt.DataParser.VALUE in t){this._frameArray[r+1]=$._getNumber(t,tt.DataParser.VALUE,0)}else{this._frameArray[r+1]=$._getNumber(t,tt.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(t,e,this._slot.parent,this._slot);return r};$.prototype._parseSlotColorFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=-1;if(tt.DataParser.VALUE in t||tt.DataParser.COLOR in t){var n=tt.DataParser.VALUE in t?t[tt.DataParser.VALUE]:t[tt.DataParser.COLOR];for(var s in n){s;this._parseColorTransform(n,this._helpColorTransform);i=this._colorArray.length;this._colorArray.length+=8;this._colorArray[i++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.redMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.alphaOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.redOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.greenOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.blueOffset);i-=8;break}}if(i<0){if(this._defaultColorOffset<0){this._defaultColorOffset=i=this._colorArray.length;this._colorArray.length+=8;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=0;this._colorArray[i++]=0;this._colorArray[i++]=0;this._colorArray[i++]=0}i=this._defaultColorOffset}var o=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[o]=i;return r};$.prototype._parseSlotDeformFrame=function(t,e,a){var r=this._frameFloatArray.length;var i=this._parseTweenFrame(t,e,a);var n=tt.DataParser.VERTICES in t?t[tt.DataParser.VERTICES]:null;var s=$._getNumber(t,tt.DataParser.OFFSET,0);var o=this._intArray[this._mesh.geometry.offset+0];var l=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var h=this._mesh.geometry.weight;var u=0;var f=0;var _=0;var m=0;if(h!==null){var c=this._weightSlotPose[l];this._helpMatrixA.copyFromArray(c,0);this._frameFloatArray.length+=h.count*2;_=h.offset+2+h.bones.length}else{this._frameFloatArray.length+=o*2}for(var p=0;p=n.length){u=0}else{u=n[p-s]}if(p+1=n.length){f=0}else{f=n[p+1-s]}}if(h!==null){var d=this._weightBonePoses[l];var y=this._intArray[_++];this._helpMatrixA.transformPoint(u,f,this._helpPoint,true);u=this._helpPoint.x;f=this._helpPoint.y;for(var v=0;v=n.length){h=0}else{h=n[f-s]}if(f+1=n.length){u=0}else{u=n[f+1-s]}}else{h=0;u=0}this._frameFloatArray[r+f]=h;this._frameFloatArray[r+f+1]=u}}if(e===0){var _=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[_+0]=this._geometry.offset;this._frameIntArray[_+1]=this._frameFloatArray.length-r;this._frameIntArray[_+2]=this._frameFloatArray.length-r;this._frameIntArray[_+3]=0;this._frameIntArray[_+4]=r-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=_-this._animation.frameIntOffset}return i};$.prototype._parseTransform=function(t,e,a){e.x=$._getNumber(t,tt.DataParser.X,0)*a;e.y=$._getNumber(t,tt.DataParser.Y,0)*a;if(tt.DataParser.ROTATE in t||tt.DataParser.SKEW in t){e.rotation=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.ROTATE,0)*tt.Transform.DEG_RAD);e.skew=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW,0)*tt.Transform.DEG_RAD)}else if(tt.DataParser.SKEW_X in t||tt.DataParser.SKEW_Y in t){e.rotation=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW_Y,0)*tt.Transform.DEG_RAD);e.skew=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW_X,0)*tt.Transform.DEG_RAD)-e.rotation}e.scaleX=$._getNumber(t,tt.DataParser.SCALE_X,1);e.scaleY=$._getNumber(t,tt.DataParser.SCALE_Y,1)};$.prototype._parseColorTransform=function(t,e){e.alphaMultiplier=$._getNumber(t,tt.DataParser.ALPHA_MULTIPLIER,100)*.01;e.redMultiplier=$._getNumber(t,tt.DataParser.RED_MULTIPLIER,100)*.01;e.greenMultiplier=$._getNumber(t,tt.DataParser.GREEN_MULTIPLIER,100)*.01;e.blueMultiplier=$._getNumber(t,tt.DataParser.BLUE_MULTIPLIER,100)*.01;e.alphaOffset=$._getNumber(t,tt.DataParser.ALPHA_OFFSET,0);e.redOffset=$._getNumber(t,tt.DataParser.RED_OFFSET,0);e.greenOffset=$._getNumber(t,tt.DataParser.GREEN_OFFSET,0);e.blueOffset=$._getNumber(t,tt.DataParser.BLUE_OFFSET,0)};$.prototype._parseGeometry=function(t,e){var a=t[tt.DataParser.VERTICES];var r=Math.floor(a.length/2);var i=0;var n=this._intArray.length;var s=this._floatArray.length;e.offset=n;e.data=this._data;this._intArray.length+=1+1+1+1;this._intArray[n+0]=r;this._intArray[n+2]=s;this._intArray[n+3]=-1;this._floatArray.length+=r*2;for(var o=0,l=r*2;o=0||tt.DataParser.DATA_VERSIONS.indexOf(r)>=0){var i=tt.BaseObject.borrowObject(tt.DragonBonesData);i.version=a;i.name=$._getString(t,tt.DataParser.NAME,"");i.frameRate=$._getNumber(t,tt.DataParser.FRAME_RATE,24);if(i.frameRate===0){i.frameRate=24}if(tt.DataParser.ARMATURE in t){this._data=i;this._parseArray(t);var n=t[tt.DataParser.ARMATURE];for(var s=0,o=n;s0){i.stage=i.getArmature(i.armatureNames[0])}this._data=null}if(tt.DataParser.TEXTURE_ATLAS in t){this._rawTextureAtlases=t[tt.DataParser.TEXTURE_ATLAS]}return i}else{console.assert(false,"Nonsupport data version: "+a+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};$.prototype.parseTextureAtlasData=function(t,e,a){if(a===void 0){a=1}console.assert(t!==undefined);if(t===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var r=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(r,e,a);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}e.width=$._getNumber(t,tt.DataParser.WIDTH,0);e.height=$._getNumber(t,tt.DataParser.HEIGHT,0);e.scale=a===1?1/$._getNumber(t,tt.DataParser.SCALE,1):a;e.name=$._getString(t,tt.DataParser.NAME,"");e.imagePath=$._getString(t,tt.DataParser.IMAGE_PATH,"");if(tt.DataParser.SUB_TEXTURE in t){var i=t[tt.DataParser.SUB_TEXTURE];for(var n=0,s=i.length;n0&&h>0){u.frame=tt.TextureData.createRectangle();u.frame.x=$._getNumber(o,tt.DataParser.FRAME_X,0);u.frame.y=$._getNumber(o,tt.DataParser.FRAME_Y,0);u.frame.width=l;u.frame.height=h}e.addTexture(u)}}return true};$.getInstance=function(){if($._objectDataParserInstance===null){$._objectDataParserInstance=new $}return $._objectDataParserInstance};$._objectDataParserInstance=null;return $}(tt.DataParser);tt.ObjectDataParser=t;var D=function(){function t(){this.frameStart=0;this.actions=[]}return t}();tt.ActionFrame=D})(dragonBones||(dragonBones={}));var dragonBones;(function(g){var t=function(o){__extends(t,o);function t(){return o!==null&&o.apply(this,arguments)||this}t.prototype._inRange=function(t,e,a){return e<=t&&t<=a};t.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var u=0;while(t.length>i){var f=t[i++];if(f===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(f,0,127)){s=f}else{if(this._inRange(f,194,223)){l=1;u=128;o=f-192}else if(this._inRange(f,224,239)){l=2;u=2048;o=f-224}else if(this._inRange(f,240,244)){l=3;u=65536;o=f-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(f,128,191)){o=0;l=0;h=0;u=0;i--;s=f}else{h+=1;o=o+(f-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var m=u;o=0;l=0;h=0;u=0;if(this._inRange(_,m,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=f}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};t.prototype._parseBinaryTimeline=function(t,e,a){if(a===void 0){a=null}var r=a!==null?a:g.BaseObject.borrowObject(g.TimelineData);r.type=t;r.offset=e;this._timeline=r;var i=this._timelineArrayBuffer[r.offset+2];if(i===1){r.frameIndicesOffset=-1}else{var n=0;var s=this._animation.frameCount+1;var o=this._data.frameIndices;n=o.length;o.length+=s;r.frameIndicesOffset=n;for(var l=0,h=0,u=0,f=0;l=0){var h=g.ObjectDataParser._getNumber(d,g.DataParser.TYPE,0);var y=g.ObjectDataParser._getString(d,g.DataParser.NAME,"");var f=null;if(h===40&&e.blendType!==0){f=g.BaseObject.borrowObject(g.AnimationTimelineData);var v=f;v.x=g.ObjectDataParser._getNumber(d,g.DataParser.X,0);v.y=g.ObjectDataParser._getNumber(d,g.DataParser.Y,0)}f=this._parseBinaryTimeline(h,u,f);switch(h){case 0:break;case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(y,f);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(y,f);break;case 30:this._animation.addConstraintTimeline(y,f);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(y,f);break}}}}this._animation=null;return e};t.prototype._parseGeometry=function(t,e){e.offset=t[g.DataParser.OFFSET];e.data=this._data;var a=this._intArrayBuffer[e.offset+3];if(a>=0){var r=g.BaseObject.borrowObject(g.WeightData);var i=this._intArrayBuffer[e.offset+0];var n=this._intArrayBuffer[a+0];r.offset=a;for(var s=0;s12?e[13]:0;var h=new Int16Array(this._binary,this._binaryOffset+e[0],a/Int16Array.BYTES_PER_ELEMENT);var u=new Float32Array(this._binary,this._binaryOffset+e[2],r/Float32Array.BYTES_PER_ELEMENT);var f=new Int16Array(this._binary,this._binaryOffset+e[4],i/Int16Array.BYTES_PER_ELEMENT);var _=new Float32Array(this._binary,this._binaryOffset+e[6],n/Float32Array.BYTES_PER_ELEMENT);var m=new Int16Array(this._binary,this._binaryOffset+e[8],s/Int16Array.BYTES_PER_ELEMENT);var c=new Uint16Array(this._binary,this._binaryOffset+e[10],o/Uint16Array.BYTES_PER_ELEMENT);var p=l>0?new Int16Array(this._binary,this._binaryOffset+e[12],l/Int16Array.BYTES_PER_ELEMENT):h;this._data.binary=this._binary;this._data.intArray=this._intArrayBuffer=h;this._data.floatArray=u;this._data.frameIntArray=f;this._data.frameFloatArray=_;this._data.frameArray=this._frameArrayBuffer=m;this._data.timelineArray=this._timelineArrayBuffer=c;this._data.colorArray=p};t.prototype.parseDragonBonesData=function(t,e){if(e===void 0){e=1}console.assert(t!==null&&t!==undefined&&t instanceof ArrayBuffer,"Data error.");var a=new Uint8Array(t,0,8);if(a[0]!=="D".charCodeAt(0)||a[1]!=="B".charCodeAt(0)||a[2]!=="D".charCodeAt(0)||a[3]!=="T".charCodeAt(0)){console.assert(false,"Nonsupport data.");return null}var r=new Uint32Array(t,8,1)[0];var i=new Uint8Array(t,8+4,r);var n=this._decodeUTF8(i);var s=JSON.parse(n);this._binaryOffset=8+4+r;this._binary=t;return o.prototype.parseDragonBonesData.call(this,s,e)};t.getInstance=function(){if(t._binaryDataParserInstance===null){t._binaryDataParserInstance=new t}return t._binaryDataParserInstance};t._binaryDataParserInstance=null;return t}(g.ObjectDataParser);g.BinaryDataParser=t})(dragonBones||(dragonBones={}));var dragonBones;(function(y){var t=function(){function s(t){if(t===void 0){t=null}this.autoSearch=false;this._dragonBonesDataMap={};this._textureAtlasDataMap={};this._dragonBones=null;this._dataParser=null;if(s._objectParser===null){s._objectParser=new y.ObjectDataParser}if(s._binaryParser===null){s._binaryParser=new y.BinaryDataParser}this._dataParser=t!==null?t:s._objectParser}s.prototype._isSupportMesh=function(){return true};s.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap){for(var a=0,r=this._textureAtlasDataMap[t];a0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};s.prototype._buildBones=function(t,e){for(var a=0,r=t.armature.sortedBones;a0){var p=this._getTextureData(t.textureAtlasName,c.path);f.replaceTextureData(p,_)}var d=this._getSlotDisplay(t,c,f);f.replaceDisplay(d,_)}else{f.replaceDisplay(null)}}}f._setDisplayIndex(h.displayIndex,true)}};s.prototype._buildConstraints=function(t,e){var a=t.armature.constraints;for(var r in a){var i=a[r];switch(i.type){case 0:var n=y.BaseObject.borrowObject(y.IKConstraint);n.init(i,e);e._addConstraint(n);break;case 1:var s=y.BaseObject.borrowObject(y.PathConstraint);s.init(i,e);e._addConstraint(s);break;default:var o=y.BaseObject.borrowObject(y.IKConstraint);o.init(i,e);e._addConstraint(o);break}}};s.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,t!==null?t.dataName:"","",t!==null?t.textureAtlasName:"")};s.prototype._getSlotDisplay=function(t,e,a){var r=t!==null?t.dataName:e.parent.parent.parent.name;var i=null;switch(e.type){case 0:{var n=e;if(n.texture===null){n.texture=this._getTextureData(r,e.path)}i=a.rawDisplay;break}case 2:{var s=e;if(s.texture===null){s.texture=this._getTextureData(r,s.path)}if(this._isSupportMesh()){i=a.meshDisplay}else{i=a.rawDisplay}break}case 1:{var o=e;var l=this._buildChildArmature(t,a,o);if(l!==null){l.inheritAnimation=o.inheritAnimation;if(!l.inheritAnimation){var h=o.actions.length>0?o.actions:l.armatureData.defaultActions;if(h.length>0){for(var u=0,f=h;u=0){continue}var h=e.getDisplays(l.name);if(h===null){if(n!==null&&e!==n){h=n.getDisplays(l.name)}if(h===null){if(a){l.displayFrameCount=0}continue}}l.displayFrameCount=h.length;for(var u=0,f=l.displayFrameCount;u=0&&this._display!==null&&t!==null){var a=t.parent;if(this._armature.replacedTexture!==null){if(this._armature._replaceTextureAtlasData===null){a=k.BaseObject.borrowObject(k.CocosTextureAtlasData);a.copyFrom(t.parent);a.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=a}else{a=this._armature._replaceTextureAtlasData}t=a.getTexture(t.name)}var r=t.renderTexture;if(r!==null){if(this._geometryData!==null){var i=this._geometryData.data;var n=i.intArray;var s=i.floatArray;var o=n[this._geometryData.offset+0];var l=n[this._geometryData.offset+1];var h=n[this._geometryData.offset+2];if(h<0){h+=65536}var u=h+o*2;var f=this._armature._armatureData.scale;var _=r.getTexture().getContentSizeInPixels();var m=a.width>0?a.width:_.width;var c=a.height>0?a.height:_.height;var p=t.region;var d=cc.rect(999999,999999,-999999,-999999);var y={triangles:{verts:[],indices:[]},rect:d};for(var v=0,g=o*2;vD.x){d.x=D.x}if(d.widthD.y){d.y=D.y}if(d.height0&&r.inheritDeform;var s=this._renderDisplay.getComponent(cc.Sprite)._sgNode;var o=s.getMeshPolygonInfo();if(!o){return}var l=o.triangles.verts;var h=cc.rect(999999,999999,-999999,-999999);if(i!==null){var u=r.data;var f=u.intArray;var _=u.floatArray;var m=f[r.offset+0];var c=f[i.offset+1];if(c<0){c+=65536}for(var p=0,d=i.offset+2+a.length,y=c,v=0;pD){h.x=D}if(h.widthT){h.y=T}if(h.heightw){h.x=w}if(h.widthN){h.y=N}if(h.height void, target: any): void { + this.node.on(type, listener, target); + } + + public removeDBEventListener(type: EventStringType, listener: (event: cc.Event.EventCustom) => void, target: any): void { + this.node.off(type, listener, target); + } + + public get armature(): Armature { + return this._armature; + } + + public get animation(): Animation { + return this._armature.animation; + } + // Editor. + /** + * @internal + */ + @property + public _armatureName: string = ""; + /** + * @internal + */ + @property + public _animationName: string = ""; + // Visibie. + /** + * @internal + */ + @property({ + type: DragonBonesAsset, + displayName: "DragonBones", + tooltip: "DragonBones Asset", + visible: true, + }) + public _dragonBonesAsset: DragonBonesAsset | null = null; + /** + * @internal + */ + @property({ + type: [cc.String], + displayName: "Armature", + tooltip: "The armature name.", + visible: true, + editorOnly: true, + serializable: false, + }) + public readonly _armatureNames: Array = []; + /** + * @internal + */ + @property({ + type: [cc.String], + displayName: "Animation", + tooltip: "The animation name.", + visible: true, + editorOnly: true, + serializable: false, + }) + public readonly _animationNames: Array = []; + /** + * @internal + */ + @property({ + type: cc.Integer, + displayName: "Play times", + tooltip: "The animation play times.", + visible: true, + slide: true, + range: [-1, 99, 1], + }) + public _playTimes: number = -1; + /** + * @internal + */ + @property({ + type: cc.Float, + displayName: "TimeScale", + tooltip: "The animation play speed.", + visible: true, + slide: true, + range: [-2, 2, 0.01], + }) + public _timeScale: number = 1.0; + + start() { + + } + } +} \ No newline at end of file diff --git a/Cocos/1.x/src/dragonBones/cocos/CocosAsset.ts b/Cocos/1.x/src/dragonBones/cocos/CocosAsset.ts new file mode 100644 index 00000000..1c5bf0ec --- /dev/null +++ b/Cocos/1.x/src/dragonBones/cocos/CocosAsset.ts @@ -0,0 +1,41 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +// force overwrite builtin dragonBones +declare var _Scene: any; +if (CC_EDITOR) { + _Scene.Sandbox._globalsVerifier_loadPluginScript.ignoreNames['dragonBones'] = true; +} + +namespace dragonBones { + const { ccclass, property } = cc._decorator; + @ccclass("DragonBones.DragonBonesAsset") + export class DragonBonesAsset extends cc.Asset { + @property + public readonly dragonBonesData: string | ArrayBuffer = ""; + @property([cc.String]) + public readonly textureAtlases: string[] = []; + @property([cc.Texture2D]) + public readonly textures: cc.Texture2D[] = []; + } +} \ No newline at end of file diff --git a/Cocos/1.x/src/dragonBones/cocos/CocosFactory.ts b/Cocos/1.x/src/dragonBones/cocos/CocosFactory.ts new file mode 100644 index 00000000..0d7008b2 --- /dev/null +++ b/Cocos/1.x/src/dragonBones/cocos/CocosFactory.ts @@ -0,0 +1,296 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +namespace dragonBones { + const { + ccclass, + } = cc._decorator; + + @ccclass + class ClockHandler extends cc.Component { + update(passedTime: number) { + CocosFactory.factory.dragonBones.advanceTime(passedTime); + } + } + /** + * - The Cocos factory. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 工厂。 + * @version DragonBones 3.0 + * @language zh_CN + */ + export class CocosFactory extends BaseFactory { + private static _dragonBonesInstance: DragonBones = null as any; + private static _factory: CocosFactory | null = null; + /** + * - A global factory instance that can be used directly. + * @version DragonBones 4.7 + * @language en_US + */ + /** + * - 一个可以直接使用的全局工厂实例。 + * @version DragonBones 4.7 + * @language zh_CN + */ + public static get factory(): CocosFactory { + if (this._factory === null) { + this._factory = new CocosFactory(); + } + + return this._factory; + } + + protected _node: cc.Node | null = null; + protected _armatureNode: cc.Node | null = null; + + public constructor(dataParser: DataParser | null = null) { + super(dataParser); + + if (!CC_EDITOR) { // Is playing. + if (this._node === null) { + const nodeName = "DragonBones Node"; + this._node = cc.find(nodeName); + if (this._node === null) { + this._node = new cc.Node(nodeName); + cc.game.addPersistRootNode(this._node); + } + } + + if (!this._node.getComponent(ClockHandler)) { + this._node.addComponent(ClockHandler); + } + + const eventManager = this._node.getComponent(CocosArmatureComponent) || this._node.addComponent(CocosArmatureComponent); + if (CocosFactory._dragonBonesInstance === null) { + CocosFactory._dragonBonesInstance = new DragonBones(eventManager); + // + DragonBones.yDown = false; + } + } + else { + if (CocosFactory._dragonBonesInstance === null) { + CocosFactory._dragonBonesInstance = new DragonBones(null as any); + // + DragonBones.yDown = false; + } + } + + this._dragonBones = CocosFactory._dragonBonesInstance; + } + + protected _isSupportMesh(): boolean { + if ((cc as any)._renderType !== (cc.game as any).RENDER_TYPE_WEBGL) { // creator.d.ts error. + console.warn("Only webgl mode can support mesh."); + + return false; + } + + return true; + } + + protected _buildTextureAtlasData(textureAtlasData: CocosTextureAtlasData | null, textureAtlas: cc.Texture2D | null): CocosTextureAtlasData { + if (textureAtlasData !== null) { + textureAtlasData.renderTexture = textureAtlas; + } + else { + textureAtlasData = BaseObject.borrowObject(CocosTextureAtlasData); + } + + return textureAtlasData; + } + + protected _buildArmature(dataPackage: BuildArmaturePackage): Armature { + const armature = BaseObject.borrowObject(Armature); + const armatureDisplay = this._armatureNode === null ? new cc.Node(dataPackage.armature.name) : this._armatureNode; + const armatureComponent = armatureDisplay.getComponent(CocosArmatureComponent) || armatureDisplay.addComponent(CocosArmatureComponent); + + armatureDisplay.setOpacityModifyRGB(false); + armatureDisplay.setCascadeOpacityEnabled(true); + (armatureDisplay as any)._sgNode.setCascadeColorEnabled(true); // creator.d.ts error. + + this._armatureNode = null; + armatureComponent._armature = armature; + armature.init( + dataPackage.armature, + armatureComponent, armatureDisplay, this._dragonBones + ); + + return armature; + } + + protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, slot: Slot, displayData: ArmatureDisplayData): Armature | null { + const childDisplayName = slot.slotData.name + " (" + displayData.path.replace("/", "_") + ")"; // + const proxy = slot.armature.proxy as CocosArmatureComponent; + let childNode = cc.find(childDisplayName, proxy.node); + let childArmature: Armature | null = null; + + if (!childNode) { + if (dataPackage !== null) { + childArmature = this.buildArmature(displayData.path, dataPackage.dataName); + } + else { + childArmature = this.buildArmature(displayData.path, displayData.parent.parent.parent.name); + } + } + else { + let childArmatureComponent: CocosArmatureComponent | null = childNode.getComponent(CocosArmatureComponent) || null; + + if (childArmatureComponent === null) { + if (dataPackage !== null) { + childArmatureComponent = this.buildArmatureComponent(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage.textureAtlasName, childNode); + } + else { + childArmatureComponent = this.buildArmatureComponent(displayData.path, "", "", "", childNode); + } + } + + if (childArmatureComponent !== null) { + childArmature = childArmatureComponent.armature; + } + } + + if (childArmature === null) { + return null; + } + + const childArmatureDisplay = childArmature.display as cc.Node; + childArmatureDisplay.name = childDisplayName; + + if (childArmatureDisplay.parent !== proxy.node) { + proxy.node.addChild(childArmatureDisplay, slot._zOrder); + } + + childArmatureDisplay.active = false; + + return childArmature; + } + + protected _buildSlot(_dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot { + const slot = BaseObject.borrowObject(CocosSlot); + const armatureDisplay = armature.display as cc.Node; + const rawSlotDisplay = cc.find(slotData.name, armatureDisplay) || new cc.Node(slotData.name); + rawSlotDisplay.addComponent(cc.Sprite); + rawSlotDisplay.setAnchorPoint(0.0, 0.0); + rawSlotDisplay.setOpacityModifyRGB(false); + rawSlotDisplay.setCascadeOpacityEnabled(true); + (rawSlotDisplay as any)._sgNode.setCascadeColorEnabled(true); // creator.d.ts error. + + slot.init( + slotData, armature, + rawSlotDisplay, rawSlotDisplay + ); + + return slot; + } + /** + * - Create a armature component from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it. + * - The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update. + * - Note that when the created armature proxy that is no longer in use, you need to explicitly dispose {@link #dragonBones.IArmatureProxy#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature component. + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + * + *
+         *     let armatureComponent = factory.buildArmatureComponent("armatureName", "dragonBonesName");
+         * 
+ * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架组件,并用 {@link #clock} 更新该骨架。 + * - 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。 + * - 注意,创建的骨架代理不再使用时,需要显式释放 {@link #dragonBones.IArmatureProxy#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架组件。 + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + * + *
+         *     let armatureComponent = factory.buildArmatureComponent("armatureName", "dragonBonesName");
+         * 
+ * @language zh_CN + */ + public buildArmatureComponent(armatureName: string, dragonBonesName: string = "", skinName: string = "", textureAtlasName: string = "", node: cc.Node | null = null): CocosArmatureComponent | null { + this._armatureNode = node; + const armature = this.buildArmature(armatureName, dragonBonesName || "", skinName || "", textureAtlasName || ""); + if (armature !== null) { + this._dragonBones.clock.add(armature); + + return armature.proxy as CocosArmatureComponent; + } + + return null; + } + /** + * - Create the display object with the specified texture. + * @param textureName - The texture data name. + * @param textureAtlasName - The texture atlas data name. (Of not set, all texture atlas data will be searched) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建带有指定贴图的显示对象。 + * @param textureName - 贴图数据名称。 + * @param textureAtlasName - 贴图集数据名称。 (如果未设置,将检索所有的贴图集数据) + * @version DragonBones 3.0 + * @language zh_CN + */ + public getTextureDisplay(textureName: string, textureAtlasName: string | null = null): cc.Sprite | null { + const textureData = this._getTextureData(textureAtlasName !== null ? textureAtlasName : "", textureName) as CocosTextureData; + if (textureData !== null && textureData.renderTexture !== null) { + const texture = textureData.renderTexture; + const sprite = new cc.Sprite(); + sprite.spriteFrame = texture; + + return sprite; + } + + return null; + } + /** + * - A global sound event manager. + * Sound events can be listened to uniformly from the manager. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 全局声音事件管理器。 + * 声音事件可以从该管理器统一侦听。 + * @version DragonBones 4.5 + * @language zh_CN + */ + public get soundEventManager(): cc.Node { + return (this._dragonBones.eventManager as CocosArmatureComponent).node; + } + } +} \ No newline at end of file diff --git a/Cocos/1.x/src/dragonBones/cocos/CocosSlot.ts b/Cocos/1.x/src/dragonBones/cocos/CocosSlot.ts new file mode 100644 index 00000000..051e2262 --- /dev/null +++ b/Cocos/1.x/src/dragonBones/cocos/CocosSlot.ts @@ -0,0 +1,503 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +namespace dragonBones { + /** + * - The Cocos slot. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 插槽。 + * @version DragonBones 3.0 + * @language zh_CN + */ + export class CocosSlot extends Slot { + public static toString(): string { + return "[class dragonBones.CocosSlot]"; + } + + private _ccMeshDirty: boolean = false; + private _textureScale: number; + private _renderDisplay: cc.Node; + + protected _onClear(): void { + super._onClear(); + + this._textureScale = 1.0; + this._renderDisplay = null as any; + } + + protected _initDisplay(_value: any, _isRetain: boolean): void { + } + + protected _disposeDisplay(value: any, isRelease: boolean): void { + if (!isRelease) { + (value as cc.Node).destroy(); + } + } + + protected _onUpdateDisplay(): void { + this._renderDisplay = (this._display ? this._display : this._rawDisplay) as cc.Node; + } + + protected _addDisplay(): void { + const container = this._armature.display as cc.Node; + container.addChild(this._renderDisplay, this._zOrder); + } + + protected _replaceDisplay(value: any): void { + const container = this._armature.display as cc.Node; + const prevDisplay = value as cc.Node; + + if (this._renderDisplay.parent !== container) { + container.addChild(this._renderDisplay, prevDisplay.getLocalZOrder()); + } + + // container.removeChild(prevDisplay, false); + this._renderDisplay.active = true; + prevDisplay.active = false; + + this._textureScale = 1.0; + } + + protected _removeDisplay(): void { + this._renderDisplay.parent.removeChild(this._renderDisplay, false); + } + + protected _updateZOrder(): void { + if (this._renderDisplay.getLocalZOrder() === this._zOrder) { + return; + } + + this._renderDisplay.setLocalZOrder(this._zOrder); + } + /** + * @internal + */ + public _updateVisible(): void { + this._renderDisplay.active = this._parent.visible && this._visible; + } + + protected _updateBlendMode(): void { + const sprite = this._renderDisplay.getComponent(cc.Sprite); + if (sprite) { + switch (this._blendMode) { + case BlendMode.Normal: + break; + + case BlendMode.Add: + const texture = sprite.spriteFrame.getTexture(); + const BlendFunc = cc.BlendFunc as any; // creator.d.ts error. + if (texture && texture.hasPremultipliedAlpha()) { + (sprite as any)._sgNode.setBlendFunc(BlendFunc.BlendFactor.ONE, BlendFunc.BlendFactor.ONE); // creator.d.ts error. + } + else { + (sprite as any)._sgNode.setBlendFunc(BlendFunc.BlendFactor.SRC_ALPHA, BlendFunc.BlendFactor.ONE); // creator.d.ts error. + } + break; + + case BlendMode.Darken: + break; + + case BlendMode.Difference: + break; + + case BlendMode.HardLight: + break; + + case BlendMode.Lighten: + break; + + case BlendMode.Multiply: + break; + + case BlendMode.Overlay: + break; + + case BlendMode.Screen: + break; + + default: + break; + } + } + else if (this._childArmature !== null) { + for (const slot of this._childArmature.getSlots() as CocosSlot[]) { + slot._blendMode = this._blendMode; + slot._updateBlendMode(); + } + } + } + + protected _updateColor(): void { + const alpha = this._colorTransform.alphaMultiplier * this._globalAlpha * 255; + const color = this._renderDisplay.color; + this._renderDisplay.opacity = alpha; + color.setR(this._colorTransform.redMultiplier * 0xFF); + color.setG(this._colorTransform.greenMultiplier * 0xFF); + color.setB(this._colorTransform.blueMultiplier * 0xFF); + (this._renderDisplay as any).setColor(color); // creator.d.ts error. + } + + protected _updateFrame(): void { + let currentTextureData = this._textureData as (CocosTextureData | null); + const sprite = this._renderDisplay.getComponent(cc.Sprite); + + if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) { + let currentTextureAtlasData = currentTextureData.parent as CocosTextureAtlasData; + + if (this._armature.replacedTexture !== null) { // Update replaced texture atlas. + if (this._armature._replaceTextureAtlasData === null) { + currentTextureAtlasData = BaseObject.borrowObject(CocosTextureAtlasData); + currentTextureAtlasData.copyFrom(currentTextureData.parent); + currentTextureAtlasData.renderTexture = this._armature.replacedTexture; + this._armature._replaceTextureAtlasData = currentTextureAtlasData; + } + else { + currentTextureAtlasData = this._armature._replaceTextureAtlasData as CocosTextureAtlasData; + } + + currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name) as CocosTextureData; + } + + const renderTexture = currentTextureData.renderTexture; + if (renderTexture !== null) { + if (this._geometryData !== null) { // Mesh. + const data = this._geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexCount]; + const triangleCount = intArray[this._geometryData.offset + BinaryOffset.GeometryTriangleCount]; + let vertexOffset = intArray[this._geometryData.offset + BinaryOffset.GeometryFloatOffset]; + + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + + const uvOffset = vertexOffset + vertexCount * 2; + const scale = this._armature._armatureData.scale; + + const textureAtlasSize = renderTexture.getTexture().getContentSizeInPixels(); + const textureAtlasWidth = currentTextureAtlasData.width > 0.0 ? currentTextureAtlasData.width : textureAtlasSize.width; + const textureAtlasHeight = currentTextureAtlasData.height > 0.0 ? currentTextureAtlasData.height : textureAtlasSize.height; + const region = currentTextureData.region; + const boundsRect = cc.rect(999999.0, 999999.0, -999999.0, -999999.0); + const polygonInfo = { + triangles: { + verts: [] as { x: number, y: number, u: number, v: number }[], + indices: [] as number[] + }, + rect: boundsRect + }; + + for (let i = 0, l = vertexCount * 2; i < l; i += 2) { + const vertex = { + x: floatArray[vertexOffset + i] * scale, + y: -floatArray[vertexOffset + i + 1] * scale, + u: floatArray[uvOffset + i], + v: floatArray[uvOffset + i + 1] + }; + + if (currentTextureData.rotated) { + const backU = vertex.u; + vertex.u = (region.x + (1.0 - vertex.v) * region.width) / textureAtlasWidth; + vertex.v = (region.y + backU * region.height) / textureAtlasHeight; + } + else { + vertex.u = (region.x + vertex.u * region.width) / textureAtlasWidth; + vertex.v = (region.y + vertex.v * region.height) / textureAtlasHeight; + } + + polygonInfo.triangles.verts[i / 2] = vertex; + + if (boundsRect.x > vertex.x) { + boundsRect.x = vertex.x; + } + + if (boundsRect.width < vertex.x) { + boundsRect.width = vertex.x; + } + + if (boundsRect.y > vertex.y) { + boundsRect.y = vertex.y; + } + + if (boundsRect.height < vertex.y) { + boundsRect.height = vertex.y; + } + } + + for (let i = 0; i < triangleCount * 3; ++i) { + polygonInfo.triangles.indices[i] = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexIndices + i]; + } + + this._textureScale = 1.0; + (sprite as any)._sgNode.setRenderingType((cc as any).Scale9Sprite.RenderingType.MESH); // creator.d.ts error. + sprite.spriteFrame = renderTexture; + (sprite as any)._sgNode.setMeshPolygonInfo(polygonInfo); // creator.d.ts error. + (sprite as any)._sgNode.setContentSize(cc.size(boundsRect.width, boundsRect.height)); // creator.d.ts error. + + const isSkinned = this._geometryData.weight !== null; + const isSurface = this._parent._boneData.type !== BoneType.Bone; + if (isSkinned || isSurface) { + this._identityTransform(); + } + // Delay to update cocos mesh. (some cocos bug.) + this._ccMeshDirty = true; + } + else { // Normal texture. + this._textureScale = currentTextureData.parent.scale * this._armature._armatureData.scale; + (sprite as any)._sgNode.setRenderingType((cc as any).Scale9Sprite.RenderingType.SIMPLE); // creator.d.ts error. + sprite.spriteFrame = renderTexture; + (sprite as any)._sgNode.setContentSize(renderTexture.getOriginalSize()); // creator.d.ts error. + } + + this._visibleDirty = true; + // this._blendModeDirty = true; + // this._colorDirty = true; + + return; + } + } + + this._renderDisplay.active = false; + this._renderDisplay.setPosition(0.0, 0.0); + } + + protected _updateMesh(): void { + const scale = this._armature._armatureData.scale; + const deformVertices = (this._displayFrame as DisplayFrame).deformVertices; + const bones = this._geometryBones; + const geometryData = this._geometryData as GeometryData; + const weightData = geometryData.weight; + + const hasDeform = deformVertices.length > 0 && geometryData.inheritDeform; + const meshDisplay = (this._renderDisplay.getComponent(cc.Sprite) as any)._sgNode; // as cc.Scale9Sprite; + const polygonInfo = meshDisplay.getMeshPolygonInfo(); + if (!polygonInfo) { + return; + } + + const verticesAndUVs = polygonInfo.triangles.verts as { x: number, y: number, u: number, v: number }[]; + const boundsRect = cc.rect(999999.0, 999999.0, -999999.0, -999999.0); + + if (weightData !== null) { + const data = geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount]; + let weightFloatOffset = intArray[weightData.offset + BinaryOffset.WeigthFloatOffset]; + + if (weightFloatOffset < 0) { + weightFloatOffset += 65536; // Fixed out of bouds bug. + } + + for ( + let i = 0, iB = weightData.offset + BinaryOffset.WeigthBoneIndices + bones.length, iV = weightFloatOffset, iF = 0; + i < vertexCount; + ++i + ) { + const boneCount = intArray[iB++]; + let xG = 0.0, yG = 0.0; + + for (let j = 0; j < boneCount; ++j) { + const boneIndex = intArray[iB++]; + const bone = bones[boneIndex]; + + if (bone !== null) { + const matrix = bone.globalTransformMatrix; + const weight = floatArray[iV++]; + let xL = floatArray[iV++] * scale; + let yL = floatArray[iV++] * scale; + + if (hasDeform) { + xL += deformVertices[iF++]; + yL += deformVertices[iF++]; + } + + xG += (matrix.a * xL + matrix.c * yL + matrix.tx) * weight; + yG += (matrix.b * xL + matrix.d * yL + matrix.ty) * weight; + } + } + + const vertex = verticesAndUVs[i]; + vertex.x = xG; + vertex.y = yG; + + if (boundsRect.x > xG) { + boundsRect.x = xG; + } + + if (boundsRect.width < xG) { + boundsRect.width = xG; + } + + if (boundsRect.y > yG) { + boundsRect.y = yG; + } + + if (boundsRect.height < yG) { + boundsRect.height = yG; + } + } + } + else { + const isSurface = this._parent._boneData.type !== BoneType.Bone; + const data = geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount]; + let vertexOffset = intArray[geometryData.offset + BinaryOffset.GeometryFloatOffset]; + + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + + for (let i = 0, l = vertexCount * 2; i < l; i += 2) { + const iH = i / 2; // int. + let x = floatArray[vertexOffset + i] * scale; + let y = floatArray[vertexOffset + i + 1] * scale; + + if (hasDeform) { + x += deformVertices[i]; + y += deformVertices[i + 1]; + } + + const vertex = verticesAndUVs[iH]; + + if (isSurface) { + const matrix = (this._parent as Surface)._getGlobalTransformMatrix(x, y); + vertex.x = matrix.a * x + matrix.c * y + matrix.tx; + vertex.y = matrix.b * x + matrix.d * y + matrix.ty; + // + x = vertex.x; + y = vertex.y; + } + else { + vertex.x = x; + y = vertex.y = -y; + } + + if (boundsRect.x > x) { + boundsRect.x = x; + } + + if (boundsRect.width < x) { + boundsRect.width = x; + } + + if (boundsRect.y > y) { + boundsRect.y = y; + } + + if (boundsRect.height < y) { + boundsRect.height = y; + } + } + } + + boundsRect.width -= boundsRect.x; + boundsRect.height -= boundsRect.y; + + polygonInfo.rect = boundsRect; + meshDisplay.setContentSize(cc.size(boundsRect.width, boundsRect.height)); + meshDisplay.setMeshPolygonInfo(polygonInfo); + + if (weightData !== null) { + this._identityTransform(); + } + else { + const transform = this.global; + const globalTransformMatrix = this.globalTransformMatrix; + this._renderDisplay.x = transform.x - (globalTransformMatrix.a * this._pivotX - globalTransformMatrix.c * this._pivotY); + this._renderDisplay.y = transform.y - (globalTransformMatrix.b * this._pivotX - globalTransformMatrix.d * this._pivotY); + this._renderDisplay.rotationX = -(transform.rotation + transform.skew) * dragonBones.Transform.RAD_DEG; + this._renderDisplay.rotationY = -transform.rotation * dragonBones.Transform.RAD_DEG; + this._renderDisplay.scaleX = transform.scaleX * this._textureScale; + this._renderDisplay.scaleY = -transform.scaleY * this._textureScale; + } + + if (this._ccMeshDirty) { + this._ccMeshDirty = false; + this._verticesDirty = true; + } + } + + protected _updateTransform(): void { + // const globalTransformMatrix = this.globalTransformMatrix; + // const helpMatrix = TransformObject._helpMatrix; + + // helpMatrix.a = globalTransformMatrix.a; + // helpMatrix.b = globalTransformMatrix.b; + // helpMatrix.c = -globalTransformMatrix.c; + // helpMatrix.d = -globalTransformMatrix.d; + + // if (this._renderDisplay === this._rawDisplay || this._renderDisplay === this._meshDisplay) { + // helpMatrix.tx = globalTransformMatrix.tx - (globalTransformMatrix.a * this._pivotX + globalTransformMatrix.c * this._pivotY); + // helpMatrix.ty = (globalTransformMatrix.ty - (globalTransformMatrix.b * this._pivotX + globalTransformMatrix.d * this._pivotY)); + // } + // else { + // helpMatrix.tx = globalTransformMatrix.tx; + // helpMatrix.ty = globalTransformMatrix.ty; + // } + + // (this._renderDisplay as any)._sgNode._renderCmd.setNodeToParentTransform(helpMatrix); // creator.d.ts error. + this.updateGlobalTransform(); + + const transform = this.global; + const globalTransformMatrix = this.globalTransformMatrix; + + if (this._renderDisplay === this._rawDisplay || this._renderDisplay === this._meshDisplay) { + this._renderDisplay.x = transform.x - (globalTransformMatrix.a * this._pivotX - globalTransformMatrix.c * this._pivotY); + this._renderDisplay.y = transform.y - (globalTransformMatrix.b * this._pivotX - globalTransformMatrix.d * this._pivotY); + } + else { + this._renderDisplay.x = transform.x; + this._renderDisplay.y = transform.y; + } + + this._renderDisplay.rotationX = -(transform.rotation + transform.skew) * dragonBones.Transform.RAD_DEG; + this._renderDisplay.rotationY = -transform.rotation * dragonBones.Transform.RAD_DEG; + this._renderDisplay.scaleX = transform.scaleX * this._textureScale; + this._renderDisplay.scaleY = -transform.scaleY * this._textureScale; + } + + protected _identityTransform(): void { + // const helpMatrix = TransformObject._helpMatrix; + // helpMatrix.a = 1.0; + // helpMatrix.b = 0.0; + // helpMatrix.c = -0.0; + // helpMatrix.d = -1.0; + // helpMatrix.tx = 0.0; + // helpMatrix.ty = 0.0; + // (this._renderDisplay as any)._renderCmd.setNodeToParentTransform(helpMatrix); + + this._renderDisplay.x = 0.0; + this._renderDisplay.y = 0.0; + this._renderDisplay.rotationX = 0.0; + this._renderDisplay.rotationY = 0.0; + this._renderDisplay.scaleX = 1.0; + this._renderDisplay.scaleY = 1.0; + } + } +} \ No newline at end of file diff --git a/Cocos/1.x/src/dragonBones/cocos/CocosTextureAtlasData.ts b/Cocos/1.x/src/dragonBones/cocos/CocosTextureAtlasData.ts new file mode 100644 index 00000000..1216591f --- /dev/null +++ b/Cocos/1.x/src/dragonBones/cocos/CocosTextureAtlasData.ts @@ -0,0 +1,129 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +namespace dragonBones { + /** + * - The Cocos texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + export class CocosTextureAtlasData extends TextureAtlasData { + public static toString(): string { + return "[class dragonBones.CocosTextureAtlasData]"; + } + + private _renderTexture: cc.Texture2D | null = null; // Initial value. + + protected _onClear(): void { + super._onClear(); + + if (this._renderTexture !== null) { + // this._renderTexture.dispose(); + } + + this._renderTexture = null; + } + + public createTexture(): TextureData { + return BaseObject.borrowObject(CocosTextureData); + } + /** + * - The Cocos texture. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 贴图。 + * @version DragonBones 3.0 + * @language zh_CN + */ + public get renderTexture(): cc.Texture2D | null { + return this._renderTexture; + } + public set renderTexture(value: cc.Texture2D | null) { + if (this._renderTexture === value) { + return; + } + + this._renderTexture = value; + + if (this._renderTexture !== null) { + for (let k in this.textures) { + const textureData = this.textures[k] as CocosTextureData; + if (textureData.renderTexture !== null) { + textureData.renderTexture.destroy(); + } + + const reat = cc.rect( + textureData.region.x, textureData.region.y, + textureData.rotated ? textureData.region.height : textureData.region.width, + textureData.rotated ? textureData.region.width : textureData.region.height + ); + const offset = cc.v2(); + const originSize = cc.size(reat.size.width, reat.size.height); + textureData.renderTexture = new cc.SpriteFrame( + this._renderTexture, + reat, + textureData.rotated, + offset, + originSize + ); + } + } + else { + for (let k in this.textures) { + const textureData = this.textures[k] as CocosTextureData; + if (textureData.renderTexture !== null) { + textureData.renderTexture.destroy(); + } + + textureData.renderTexture = null; + } + } + } + } + /** + * @internal + */ + export class CocosTextureData extends TextureData { + public static toString(): string { + return "[class dragonBones.CocosTextureData]"; + } + + public renderTexture: cc.SpriteFrame | null = null; // Initial value. + + protected _onClear(): void { + super._onClear(); + + if (this.renderTexture !== null) { + this.renderTexture.destroy(); + } + + this.renderTexture = null; + } + } +} \ No newline at end of file diff --git a/Cocos/1.x/tsconfig.json b/Cocos/1.x/tsconfig.json new file mode 100644 index 00000000..e1afbff6 --- /dev/null +++ b/Cocos/1.x/tsconfig.json @@ -0,0 +1,81 @@ +{ + "compilerOptions": { + "watch": false, + "sourceMap": false, + "declaration": true, + "stripInternal": true, + "alwaysStrict": true, + "noImplicitAny": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strictNullChecks": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "es5", + "outFile": "out/dragonBones.js", + "lib": [ + "es5", + "dom", + "es2015.promise" + ] + }, + "exclude": [ + "node_modules", + "out" + ], + "files": [ + "./libs/creator.d.ts", + + "../../DragonBones/src/dragonBones/core/DragonBones.ts", + "../../DragonBones/src/dragonBones/core/BaseObject.ts", + + "../../DragonBones/src/dragonBones/geom/Matrix.ts", + "../../DragonBones/src/dragonBones/geom/Transform.ts", + "../../DragonBones/src/dragonBones/geom/ColorTransform.ts", + "../../DragonBones/src/dragonBones/geom/Point.ts", + "../../DragonBones/src/dragonBones/geom/Rectangle.ts", + + "../../DragonBones/src/dragonBones/model/UserData.ts", + "../../DragonBones/src/dragonBones/model/DragonBonesData.ts", + "../../DragonBones/src/dragonBones/model/ArmatureData.ts", + "../../DragonBones/src/dragonBones/model/CanvasData.ts", + "../../DragonBones/src/dragonBones/model/SkinData.ts", + "../../DragonBones/src/dragonBones/model/ConstraintData.ts", + "../../DragonBones/src/dragonBones/model/DisplayData.ts", + "../../DragonBones/src/dragonBones/model/BoundingBoxData.ts", + "../../DragonBones/src/dragonBones/model/AnimationData.ts", + "../../DragonBones/src/dragonBones/model/AnimationConfig.ts", + "../../DragonBones/src/dragonBones/model/TextureAtlasData.ts", + + "../../DragonBones/src/dragonBones/armature/IArmatureProxy.ts", + "../../DragonBones/src/dragonBones/armature/Armature.ts", + "../../DragonBones/src/dragonBones/armature/TransformObject.ts", + "../../DragonBones/src/dragonBones/armature/Bone.ts", + "../../DragonBones/src/dragonBones/armature/Surface.ts", + "../../DragonBones/src/dragonBones/armature/Slot.ts", + "../../DragonBones/src/dragonBones/armature/Constraint.ts", + + "../../DragonBones/src/dragonBones/animation/IAnimatable.ts", + "../../DragonBones/src/dragonBones/animation/WorldClock.ts", + "../../DragonBones/src/dragonBones/animation/Animation.ts", + "../../DragonBones/src/dragonBones/animation/AnimationState.ts", + "../../DragonBones/src/dragonBones/animation/BaseTimelineState.ts", + "../../DragonBones/src/dragonBones/animation/TimelineState.ts", + + "../../DragonBones/src/dragonBones/event/EventObject.ts", + "../../DragonBones/src/dragonBones/event/IEventDispatcher.ts", + + "../../DragonBones/src/dragonBones/parser/DataParser.ts", + "../../DragonBones/src/dragonBones/parser/ObjectDataParser.ts", + "../../DragonBones/src/dragonBones/parser/BinaryDataParser.ts", + + "../../DragonBones/src/dragonBones/factory/BaseFactory.ts", + + "./src/dragonBones/cocos/CocosAsset.ts", + "./src/dragonBones/cocos/CocosTextureAtlasData.ts", + "./src/dragonBones/cocos/CocosArmatureComponent.ts", + "./src/dragonBones/cocos/CocosSlot.ts", + "./src/dragonBones/cocos/CocosFactory.ts" + ] +} \ No newline at end of file diff --git a/Cocos/1.x/tslint.json b/Cocos/1.x/tslint.json new file mode 100644 index 00000000..eeb58d17 --- /dev/null +++ b/Cocos/1.x/tslint.json @@ -0,0 +1,15 @@ +{ + "rules": { + "no-unused-expression": true, + "no-unreachable": true, + "no-duplicate-variable": true, + "no-duplicate-key": true, + "no-unused-variable": true, + "curly": false, + "class-name": true, + "triple-equals": true, + "semicolon": [ + true + ] + } +} \ No newline at end of file diff --git a/Cocos/Demos/.gitignore b/Cocos/Demos/.gitignore new file mode 100644 index 00000000..640d65b9 --- /dev/null +++ b/Cocos/Demos/.gitignore @@ -0,0 +1,67 @@ +#///////////////////////////////////////////////////////////////////////////// +# Fireball Projects +#///////////////////////////////////////////////////////////////////////////// + +library/ +temp/ +local/ +build/ + +#///////////////////////////////////////////////////////////////////////////// +# Logs and databases +#///////////////////////////////////////////////////////////////////////////// + +*.log +*.sql +*.sqlite + +#///////////////////////////////////////////////////////////////////////////// +# files for debugger +#///////////////////////////////////////////////////////////////////////////// + +*.sln +*.csproj +*.pidb +*.unityproj +*.suo + +#///////////////////////////////////////////////////////////////////////////// +# OS generated files +#///////////////////////////////////////////////////////////////////////////// + +.DS_Store +ehthumbs.db +Thumbs.db + +#///////////////////////////////////////////////////////////////////////////// +# exvim files +#///////////////////////////////////////////////////////////////////////////// + +*UnityVS.meta +*.err +*.err.meta +*.exvim +*.exvim.meta +*.vimentry +*.vimentry.meta +*.vimproject +*.vimproject.meta +.vimfiles.*/ +.exvim.*/ +quick_gen_project_*_autogen.bat +quick_gen_project_*_autogen.bat.meta +quick_gen_project_*_autogen.sh +quick_gen_project_*_autogen.sh.meta +.exvim.app + +#///////////////////////////////////////////////////////////////////////////// +# webstorm files +#///////////////////////////////////////////////////////////////////////////// + +.idea/ + +#////////////////////////// +# VS Code +#////////////////////////// + +.vscode/ \ No newline at end of file diff --git a/Cocos/Demos/README.md b/Cocos/Demos/README.md new file mode 100644 index 00000000..1cda3a10 --- /dev/null +++ b/Cocos/Demos/README.md @@ -0,0 +1,28 @@ +## How to run + +## Make sure project structure like this: +``` +Your project + |-- assets + |-- Scene + |-- ... + |-- Script + |-- dragonBones + |-- dragonBones.js + |-- ... + |-- resources + |-- dragonBones files + |-- ... + |-- declaration + |-- dragonBones.d.ts + |-- ... + |-- creator.d.ts + |-- tsconfig.json + |-- ... +``` + +## Notice +You should remove all dragoneBones declaration in creator.d.ts. + +## Creator +[Get creator.d.ts](https://google.com/) \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene.meta b/Cocos/Demos/assets/Scene.meta new file mode 100644 index 00000000..7da30b04 --- /dev/null +++ b/Cocos/Demos/assets/Scene.meta @@ -0,0 +1,6 @@ +{ + "ver": "1.0.1", + "uuid": "29f52784-2fca-467b-92e7-8fd9ef8c57b7", + "isGroup": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/01.HelloDragonBones.fire b/Cocos/Demos/assets/Scene/01.HelloDragonBones.fire new file mode 100644 index 00000000..68af30d9 --- /dev/null +++ b/Cocos/Demos/assets/Scene/01.HelloDragonBones.fire @@ -0,0 +1,231 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "05ecc92d-234d-47ab-8d87-d184d73ebb17", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 5 + }, + { + "__id__": 6 + }, + { + "__id__": 7 + } + ], + "_prefab": null, + "_id": "a286bbGknJLZpRpxROV6M94", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 252, + "g": 252, + "b": 252, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "d3s1EN/JtBRLZn4nLf2o+n", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "fc606aaYIZASrPL7pfSfZBd", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + }, + { + "__type__": "CocosArmatureComponent", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_armatureName": "", + "_animationName": "", + "_dragonBonesAsset": { + "__uuid__": "ff2e056a-d84a-49d2-8b7c-5e08c9f607a7" + }, + "_playTimes": -1, + "_timeScale": 1 + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/01.HelloDragonBones.fire.meta b/Cocos/Demos/assets/Scene/01.HelloDragonBones.fire.meta new file mode 100644 index 00000000..5806e55e --- /dev/null +++ b/Cocos/Demos/assets/Scene/01.HelloDragonBones.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "05ecc92d-234d-47ab-8d87-d184d73ebb17", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/02.AnimationBase.fire b/Cocos/Demos/assets/Scene/02.AnimationBase.fire new file mode 100644 index 00000000..68187ea8 --- /dev/null +++ b/Cocos/Demos/assets/Scene/02.AnimationBase.fire @@ -0,0 +1,212 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "545b7027-4749-4feb-afea-480a2b74481e", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 5 + }, + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "3cTbqxr0ZFpJh4n5aIxUZf", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "18O+pbh3pNAanu3Y2p7HUI", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "310ecHrdENP0peTsunqAxx4", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/02.AnimationBase.fire.meta b/Cocos/Demos/assets/Scene/02.AnimationBase.fire.meta new file mode 100644 index 00000000..fa4a07a1 --- /dev/null +++ b/Cocos/Demos/assets/Scene/02.AnimationBase.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "545b7027-4749-4feb-afea-480a2b74481e", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/03.DragonBonesEvent.fire b/Cocos/Demos/assets/Scene/03.DragonBonesEvent.fire new file mode 100644 index 00000000..ebe30665 --- /dev/null +++ b/Cocos/Demos/assets/Scene/03.DragonBonesEvent.fire @@ -0,0 +1,289 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "d0a66be9-2be5-40e1-ad9b-a2c9cc08b2f6", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 7 + }, + { + "__id__": 8 + } + ], + "_prefab": null, + "_id": "cerJpHBXhJzq3R7w00r4pC", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "caDeQpBGZBqL1bWf7+c9W9", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "2eX4pqUfNLXbfXllgUE9rJ", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 216, + "height": 24 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": -220 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_useOriginalSize": false, + "_actualFontSize": 20, + "_fontSize": 20, + "_lineHeight": 24, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_N$string": "Touch to play animation.", + "_N$horizontalAlign": 0, + "_N$verticalAlign": 0, + "_N$fontFamily": "Arial", + "_N$overflow": 0 + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "c353bexq8pA3IKSuF79jvwq", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/03.DragonBonesEvent.fire.meta b/Cocos/Demos/assets/Scene/03.DragonBonesEvent.fire.meta new file mode 100644 index 00000000..35a8bbef --- /dev/null +++ b/Cocos/Demos/assets/Scene/03.DragonBonesEvent.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "d0a66be9-2be5-40e1-ad9b-a2c9cc08b2f6", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/04.AnimationLayer.fire b/Cocos/Demos/assets/Scene/04.AnimationLayer.fire new file mode 100644 index 00000000..11fce1a6 --- /dev/null +++ b/Cocos/Demos/assets/Scene/04.AnimationLayer.fire @@ -0,0 +1,212 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "b237ce5b-762e-482c-a3f1-50369681a487", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 5 + }, + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "ce4IzJq3pDhrE1GUiAJ8Cs", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "2erdzLHSNBG7xpKaBB9znU", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "b362fL73ztCvKXRF9b+2P8v", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/04.AnimationLayer.fire.meta b/Cocos/Demos/assets/Scene/04.AnimationLayer.fire.meta new file mode 100644 index 00000000..072db23f --- /dev/null +++ b/Cocos/Demos/assets/Scene/04.AnimationLayer.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "b237ce5b-762e-482c-a3f1-50369681a487", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/05.BoneOffset.fire b/Cocos/Demos/assets/Scene/05.BoneOffset.fire new file mode 100644 index 00000000..751e432f --- /dev/null +++ b/Cocos/Demos/assets/Scene/05.BoneOffset.fire @@ -0,0 +1,212 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "3d95f516-2312-4643-bb16-766094b133b2", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 5 + }, + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "3baNPcbmJKUI00KK9eQ0nW", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "166Yqzm1JFCJ3EOO0l7rrO", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "e0062cp2AlNcbCB/q3liVKS", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/05.BoneOffset.fire.meta b/Cocos/Demos/assets/Scene/05.BoneOffset.fire.meta new file mode 100644 index 00000000..b05bd163 --- /dev/null +++ b/Cocos/Demos/assets/Scene/05.BoneOffset.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "3d95f516-2312-4643-bb16-766094b133b2", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/06.InverseKinematics.fire b/Cocos/Demos/assets/Scene/06.InverseKinematics.fire new file mode 100644 index 00000000..024bfb67 --- /dev/null +++ b/Cocos/Demos/assets/Scene/06.InverseKinematics.fire @@ -0,0 +1,289 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "7731e30f-08df-4470-bff5-5af3696d886b", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 7 + }, + { + "__id__": 8 + } + ], + "_prefab": null, + "_id": "6bJ0IuynBM6JK0PHCFB/l8", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "cbLjWeeC5CALo5KMj3idng", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "2cnAJl0B5KqIj3hwHjJCT6", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 338, + "height": 24 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": -220 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_useOriginalSize": false, + "_actualFontSize": 20, + "_fontSize": 20, + "_lineHeight": 24, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_N$string": "Drag circle shape to modify IK bones.", + "_N$horizontalAlign": 0, + "_N$verticalAlign": 0, + "_N$fontFamily": "Arial", + "_N$overflow": 0 + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "fbc7caetOhEbZLqQQuTL8E1", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/06.InverseKinematics.fire.meta b/Cocos/Demos/assets/Scene/06.InverseKinematics.fire.meta new file mode 100644 index 00000000..ffa27cc6 --- /dev/null +++ b/Cocos/Demos/assets/Scene/06.InverseKinematics.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "7731e30f-08df-4470-bff5-5af3696d886b", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/07.BoundingBox.fire b/Cocos/Demos/assets/Scene/07.BoundingBox.fire new file mode 100644 index 00000000..f5f00fa0 --- /dev/null +++ b/Cocos/Demos/assets/Scene/07.BoundingBox.fire @@ -0,0 +1,289 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "f8861cb2-a2ee-43d6-bbd3-aa9a9db94827", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 7 + }, + { + "__id__": 8 + } + ], + "_prefab": null, + "_id": "54hltNJmBEYpbNXzG/ZOb8", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 960, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "6bX87PY7FKLbl04TVFZRyK", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "dcUc53zWFCIrmW7FLNIdrb", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 306, + "height": 24 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": -220 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_useOriginalSize": false, + "_actualFontSize": 20, + "_fontSize": 20, + "_lineHeight": 24, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_N$string": "Drag to move bounding box tester.", + "_N$horizontalAlign": 0, + "_N$verticalAlign": 0, + "_N$fontFamily": "Arial", + "_N$overflow": 0 + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "54bb51+eNhD/bFW9M309+uR", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/07.BoundingBox.fire.meta b/Cocos/Demos/assets/Scene/07.BoundingBox.fire.meta new file mode 100644 index 00000000..410dbcec --- /dev/null +++ b/Cocos/Demos/assets/Scene/07.BoundingBox.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "f8861cb2-a2ee-43d6-bbd3-aa9a9db94827", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/08.MultiTextureAltas.fire b/Cocos/Demos/assets/Scene/08.MultiTextureAltas.fire new file mode 100644 index 00000000..c39dc4bb --- /dev/null +++ b/Cocos/Demos/assets/Scene/08.MultiTextureAltas.fire @@ -0,0 +1,212 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "85b8d9e1-a881-4d34-a6be-7b9276872e23", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 5 + }, + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "b7xS9+cSlNjICDUe/8bY5J", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "cfDKVehKtOAbOjRqcqnqjz", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "96ee3YL4B9Kvqr3lL0p5673", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/08.MultiTextureAltas.fire.meta b/Cocos/Demos/assets/Scene/08.MultiTextureAltas.fire.meta new file mode 100644 index 00000000..e6012057 --- /dev/null +++ b/Cocos/Demos/assets/Scene/08.MultiTextureAltas.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "85b8d9e1-a881-4d34-a6be-7b9276872e23", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/09.ReplaceSlotDisplay.fire b/Cocos/Demos/assets/Scene/09.ReplaceSlotDisplay.fire new file mode 100644 index 00000000..2f326de6 --- /dev/null +++ b/Cocos/Demos/assets/Scene/09.ReplaceSlotDisplay.fire @@ -0,0 +1,289 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "084b9fa6-786b-4575-92a4-2a902643cdde", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 7 + }, + { + "__id__": 8 + } + ], + "_prefab": null, + "_id": "74cFUjbTpAGI0xTIFe42uY", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "1eUmPCDoZPlqyC4b6oen52", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "abA3prPSJJ97DHb0fljsf1", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 470, + "height": 48 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": -220 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_useOriginalSize": false, + "_actualFontSize": 20, + "_fontSize": 20, + "_lineHeight": 24, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_N$string": "Touch screen left / center / right to relace slot display.\n", + "_N$horizontalAlign": 0, + "_N$verticalAlign": 0, + "_N$fontFamily": "Arial", + "_N$overflow": 0 + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "ad05ck39tJMOowkFXJZpG7k", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/09.ReplaceSlotDisplay.fire.meta b/Cocos/Demos/assets/Scene/09.ReplaceSlotDisplay.fire.meta new file mode 100644 index 00000000..22b23d22 --- /dev/null +++ b/Cocos/Demos/assets/Scene/09.ReplaceSlotDisplay.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "084b9fa6-786b-4575-92a4-2a902643cdde", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/10.ReplaceSkin.fire b/Cocos/Demos/assets/Scene/10.ReplaceSkin.fire new file mode 100644 index 00000000..a822610b --- /dev/null +++ b/Cocos/Demos/assets/Scene/10.ReplaceSkin.fire @@ -0,0 +1,289 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "8664c837-d9c5-4adf-a42f-25cb2df87fa2", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 7 + }, + { + "__id__": 8 + } + ], + "_prefab": null, + "_id": "87qt2d7FRHHYLAl+B8w9ET", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "21bOS0DiVCta85JSPa2Vco", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "3911Ec90xBtJVMYWQCKrnG", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 279, + "height": 24 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": -220 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_useOriginalSize": false, + "_actualFontSize": 20, + "_fontSize": 20, + "_lineHeight": 24, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_N$string": "Touch to replace armature skin.", + "_N$horizontalAlign": 0, + "_N$verticalAlign": 0, + "_N$fontFamily": "Arial", + "_N$overflow": 0 + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "7ed1bnEur9NfL+TCTUGsyJh", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/10.ReplaceSkin.fire.meta b/Cocos/Demos/assets/Scene/10.ReplaceSkin.fire.meta new file mode 100644 index 00000000..f5f3195e --- /dev/null +++ b/Cocos/Demos/assets/Scene/10.ReplaceSkin.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "8664c837-d9c5-4adf-a42f-25cb2df87fa2", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/11.ReplaceAnimation.fire b/Cocos/Demos/assets/Scene/11.ReplaceAnimation.fire new file mode 100644 index 00000000..7f356d00 --- /dev/null +++ b/Cocos/Demos/assets/Scene/11.ReplaceAnimation.fire @@ -0,0 +1,289 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "8bc0ca1f-ace4-4516-977f-56b8a6a075e1", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 7 + }, + { + "__id__": 8 + } + ], + "_prefab": null, + "_id": "07OrMBTAJBYasU9K3CkmrD", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 960, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "e0CWqlmalD4Lz6IcfwLMYl", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "e9RZtBp8VHlqaCBadaNmlg", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 245, + "height": 24 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": -220 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_useOriginalSize": false, + "_actualFontSize": 20, + "_fontSize": 20, + "_lineHeight": 24, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_N$string": "Touch to change animation.", + "_N$horizontalAlign": 0, + "_N$verticalAlign": 0, + "_N$fontFamily": "Arial", + "_N$overflow": 0 + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "687f17cUzNII6ZgR2cZ3g6Z", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/11.ReplaceAnimation.fire.meta b/Cocos/Demos/assets/Scene/11.ReplaceAnimation.fire.meta new file mode 100644 index 00000000..ab600073 --- /dev/null +++ b/Cocos/Demos/assets/Scene/11.ReplaceAnimation.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "8bc0ca1f-ace4-4516-977f-56b8a6a075e1", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/12.CoreElement.fire b/Cocos/Demos/assets/Scene/12.CoreElement.fire new file mode 100644 index 00000000..bc952510 --- /dev/null +++ b/Cocos/Demos/assets/Scene/12.CoreElement.fire @@ -0,0 +1,289 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "5afc7e32-fb0d-4816-a956-14f92e7aa598", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 7 + }, + { + "__id__": 8 + } + ], + "_prefab": null, + "_id": "53S6UB4GJOjLUGtvNXgKV8", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "adZPRTtDJFA7YGqe9e5IBd", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "245Gvl/+dBJJgWvpqc9+8y", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 836, + "height": 48 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": -220 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_useOriginalSize": false, + "_actualFontSize": 20, + "_fontSize": 20, + "_lineHeight": 24, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_N$string": "Press W/A/S/D to move. Press Q/E/SPACE to switch weapons and skin. Touch to aim and fire.\n", + "_N$horizontalAlign": 0, + "_N$verticalAlign": 0, + "_N$fontFamily": "Arial", + "_N$overflow": 0 + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "560edrIWZBBnZ3JG6DlFCnm", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/12.CoreElement.fire.meta b/Cocos/Demos/assets/Scene/12.CoreElement.fire.meta new file mode 100644 index 00000000..d613450a --- /dev/null +++ b/Cocos/Demos/assets/Scene/12.CoreElement.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "5afc7e32-fb0d-4816-a956-14f92e7aa598", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/13.EyeTracking.fire b/Cocos/Demos/assets/Scene/13.EyeTracking.fire new file mode 100644 index 00000000..848634a7 --- /dev/null +++ b/Cocos/Demos/assets/Scene/13.EyeTracking.fire @@ -0,0 +1,212 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "be4b2a91-fe33-47f6-a7e9-56c2d8f33caa", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 5 + }, + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "3funz8ctNFipGM4iF/oDph", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "efNa/zCY9DjZ/ISbet7uDw", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "523272zTCtBPZeQuGr0VvKe", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/13.EyeTracking.fire.meta b/Cocos/Demos/assets/Scene/13.EyeTracking.fire.meta new file mode 100644 index 00000000..2484a057 --- /dev/null +++ b/Cocos/Demos/assets/Scene/13.EyeTracking.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "be4b2a91-fe33-47f6-a7e9-56c2d8f33caa", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/14.PerformanceTest.fire b/Cocos/Demos/assets/Scene/14.PerformanceTest.fire new file mode 100644 index 00000000..8db76311 --- /dev/null +++ b/Cocos/Demos/assets/Scene/14.PerformanceTest.fire @@ -0,0 +1,289 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "1b83ce3d-53b7-4e09-b342-6dcfa44a34b7", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 7 + }, + { + "__id__": 8 + } + ], + "_prefab": null, + "_id": "9cFJpB3cVO6L9EPJB+9OSC", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 568, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Node", + "_name": "background", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "92zZRG/6pAeYYNj40POUTP", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 2048, + "height": 2048 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_spriteFrame": { + "__uuid__": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_atlas": null + }, + { + "__type__": "cc.Node", + "_name": "label", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 6 + } + ], + "_prefab": null, + "_id": "c6uS3VbMNHrbkJJmw5Hiyb", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 1 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 24 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 0, + "y": -220 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_useOriginalSize": false, + "_actualFontSize": 20, + "_fontSize": 20, + "_lineHeight": 24, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_N$string": "", + "_N$horizontalAlign": 0, + "_N$verticalAlign": 0, + "_N$fontFamily": "Arial", + "_N$overflow": 0 + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 1136, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "507b7xxM9xDHo7NfmzDYPNX", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/14.PerformanceTest.fire.meta b/Cocos/Demos/assets/Scene/14.PerformanceTest.fire.meta new file mode 100644 index 00000000..6437df1f --- /dev/null +++ b/Cocos/Demos/assets/Scene/14.PerformanceTest.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "1b83ce3d-53b7-4e09-b342-6dcfa44a34b7", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/Test.fire b/Cocos/Demos/assets/Scene/Test.fire new file mode 100644 index 00000000..36921ad4 --- /dev/null +++ b/Cocos/Demos/assets/Scene/Test.fire @@ -0,0 +1,130 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_rawFiles": null, + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_tag": -1, + "_active": true, + "_components": [], + "_prefab": null, + "_id": "b9016c44-f3d7-4e66-8792-7f2f88da363e", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0, + "autoReleaseAssets": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_tag": -1, + "_active": true, + "_components": [ + { + "__id__": 3 + }, + { + "__id__": 4 + } + ], + "_prefab": null, + "_id": "160GRo2IxI4b2GGD1bxacW", + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_cascadeOpacityEnabled": true, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 960, + "height": 640 + }, + "_rotationX": 0, + "_rotationY": 0, + "_scaleX": 1, + "_scaleY": 1, + "_position": { + "__type__": "cc.Vec2", + "x": 480, + "y": 320 + }, + "_skewX": 0, + "_skewY": 0, + "_localZOrder": 0, + "_globalZOrder": 0, + "_opacityModifyRGB": false, + "groupIndex": 0 + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 960, + "height": 640 + }, + "_fitWidth": false, + "_fitHeight": true + }, + { + "__type__": "6a6cb1wmNFMiLrd6JrR1bRd", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true + } +] \ No newline at end of file diff --git a/Cocos/Demos/assets/Scene/Test.fire.meta b/Cocos/Demos/assets/Scene/Test.fire.meta new file mode 100644 index 00000000..83420d42 --- /dev/null +++ b/Cocos/Demos/assets/Scene/Test.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "b9016c44-f3d7-4e66-8792-7f2f88da363e", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script.meta b/Cocos/Demos/assets/Script.meta new file mode 100644 index 00000000..72591687 --- /dev/null +++ b/Cocos/Demos/assets/Script.meta @@ -0,0 +1,6 @@ +{ + "ver": "1.0.1", + "uuid": "4734c20c-0db8-4eb2-92ea-e692f4d70934", + "isGroup": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/AnimationBase.ts b/Cocos/Demos/assets/Script/AnimationBase.ts new file mode 100644 index 00000000..cfe497fc --- /dev/null +++ b/Cocos/Demos/assets/Script/AnimationBase.ts @@ -0,0 +1,62 @@ +@cc._decorator.ccclass +export default class AnimationBase extends cc.Component { + private _armatureComponent: dragonBones.CocosArmatureComponent; + + start() { + const resources = [ + cc.url.raw("resources/progress_bar/progress_bar_ske.json"), + cc.url.raw("resources/progress_bar/progress_bar_tex.json"), + cc.url.raw("resources/progress_bar/progress_bar_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + // + this._armatureComponent = factory.buildArmatureComponent("progress_bar"); + this._armatureComponent.node.x = 0.0; + this._armatureComponent.node.y = 0.0; + this.node.addChild(this._armatureComponent.node); + // Add animation event listener. + this._armatureComponent.addDBEventListener(dragonBones.EventObject.START, this._animationEventHandler, this); + this._armatureComponent.addDBEventListener(dragonBones.EventObject.LOOP_COMPLETE, this._animationEventHandler, this); + this._armatureComponent.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); + this._armatureComponent.addDBEventListener(dragonBones.EventObject.FADE_IN, this._animationEventHandler, this); + this._armatureComponent.addDBEventListener(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); + this._armatureComponent.addDBEventListener(dragonBones.EventObject.FADE_OUT, this._animationEventHandler, this); + this._armatureComponent.addDBEventListener(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); + this._armatureComponent.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._animationEventHandler, this); + this._armatureComponent.animation.play("idle"); + // + this.node.on(cc.Node.EventType.TOUCH_START, this._touchHandler, this); + this.node.on(cc.Node.EventType.TOUCH_END, this._touchHandler, this); + this.node.on(cc.Node.EventType.TOUCH_MOVE, this._touchHandler, this); + }); + } + + private _touchHandler(event: cc.Event.EventTouch): void { + const progress = Math.min(Math.max((event.touch.getLocationX() - this.node.x + 300.0) / 600.0, 0.0), 1.0); + + switch (event.type) { + case cc.Node.EventType.TOUCH_START: + this._armatureComponent.animation.gotoAndStopByProgress("idle", progress); + break; + + case cc.Node.EventType.TOUCH_END: + this._armatureComponent.animation.play(); + break; + + case cc.Node.EventType.TOUCH_MOVE: + const animationState = this._armatureComponent.animation.getState("idle"); + if (animationState) { + animationState.currentTime = animationState.totalTime * progress; + } + break; + } + } + + private _animationEventHandler(event: cc.Event.EventCustom): void { + const eventObject = event.getUserData() as dragonBones.EventObject; + console.log(eventObject.animationState.name, event.type, eventObject.name); + } +} diff --git a/Cocos/Demos/assets/Script/AnimationBase.ts.meta b/Cocos/Demos/assets/Script/AnimationBase.ts.meta new file mode 100644 index 00000000..ee14e2fd --- /dev/null +++ b/Cocos/Demos/assets/Script/AnimationBase.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "310ec1eb-7443-4fd2-9793-b2e9ea031c78", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/AnimationLayer.ts b/Cocos/Demos/assets/Script/AnimationLayer.ts new file mode 100644 index 00000000..880ac640 --- /dev/null +++ b/Cocos/Demos/assets/Script/AnimationLayer.ts @@ -0,0 +1,37 @@ +@cc._decorator.ccclass +export default class AnimationLayer extends cc.Component { + private _armatureComponent: dragonBones.CocosArmatureComponent; + + start() { + const resources = [ + cc.url.raw("resources/mecha_1004d/mecha_1004d_ske.json"), + cc.url.raw("resources/mecha_1004d/mecha_1004d_tex.json"), + cc.url.raw("resources/mecha_1004d/mecha_1004d_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + // + this._armatureComponent = factory.buildArmatureComponent("mecha_1004d"); + this._armatureComponent.addDBEventListener(dragonBones.EventObject.LOOP_COMPLETE, this._animationEventHandler, this); + this._armatureComponent.animation.play("walk"); + + this._armatureComponent.node.x = 0.0; + this._armatureComponent.node.y = -100.0; + this.node.addChild(this._armatureComponent.node); + }); + } + + private _animationEventHandler(event: cc.Event.EventCustom): void { + let attackState = this._armatureComponent.animation.getState("attack_01"); + if (!attackState) { + attackState = this._armatureComponent.animation.fadeIn("attack_01", 0.1, 1, 1); + attackState.resetToPose = false; + attackState.autoFadeOutTime = 0.1; + attackState.addBoneMask("chest"); + attackState.addBoneMask("effect_l"); + attackState.addBoneMask("effect_r"); + } + } +} diff --git a/Cocos/Demos/assets/Script/AnimationLayer.ts.meta b/Cocos/Demos/assets/Script/AnimationLayer.ts.meta new file mode 100644 index 00000000..c81bdc4e --- /dev/null +++ b/Cocos/Demos/assets/Script/AnimationLayer.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "b362f2fb-df3b-42bc-a5d1-17d6fed8ff2f", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/BoneOffset.ts b/Cocos/Demos/assets/Script/BoneOffset.ts new file mode 100644 index 00000000..d6a13369 --- /dev/null +++ b/Cocos/Demos/assets/Script/BoneOffset.ts @@ -0,0 +1,58 @@ +@cc._decorator.ccclass +export default class BoneOffset extends cc.Component { + start() { + const resources = [ + cc.url.raw("resources/bullet_01/bullet_01_ske.json"), + cc.url.raw("resources/bullet_01/bullet_01_tex.json"), + cc.url.raw("resources/bullet_01/bullet_01_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + + for (let i = 0; i < 100; ++i) { + // + const armatureComponent = factory.buildArmatureComponent("bullet_01"); + armatureComponent.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); + armatureComponent.node.x = 0.0; + armatureComponent.node.y = 0.0; + this.node.addChild(armatureComponent.node); + // + this._moveTo(armatureComponent); + } + }); + } + + private _animationEventHandler(event: cc.Event.EventCustom): void { + const eventObject = event.getUserData() as dragonBones.EventObject; + this._moveTo(eventObject.armature.proxy as dragonBones.CocosArmatureComponent); + } + + private _moveTo(armatureComponent: dragonBones.CocosArmatureComponent): void { + const fromX = armatureComponent.node.x; + const fromY = armatureComponent.node.y; + + const canvas = this.getComponent(cc.Canvas); + const size = canvas.designResolution; + + const toX = Math.random() * size.width - size.width * 0.5; + const toY = Math.random() * size.height - size.height * 0.5; + const dX = toX - fromX; + const dY = toY - fromY; + const rootSlot = armatureComponent.armature.getBone("root"); + const bulletSlot = armatureComponent.armature.getBone("bullet"); + // Modify root and bullet bone offset. + rootSlot.offset.scaleX = Math.sqrt(dX * dX + dY * dY) / 100.0; // Bullet translate distance is 100 px. + rootSlot.offset.rotation = Math.atan2(dY, dX); + rootSlot.offset.skew = Math.random() * Math.PI - Math.PI * 0.5; // Random skew. + bulletSlot.offset.scaleX = 0.5 + Math.random() * 0.5; // Random scale. + bulletSlot.offset.scaleY = 0.5 + Math.random() * 0.5; + // Update root and bullet bone. + rootSlot.invalidUpdate(); + bulletSlot.invalidUpdate(); + // + armatureComponent.animation.timeScale = 0.5 + Math.random() * 1.0; // Random animation speed. + armatureComponent.animation.play("idle", 1); + } +} diff --git a/Cocos/Demos/assets/Script/BoneOffset.ts.meta b/Cocos/Demos/assets/Script/BoneOffset.ts.meta new file mode 100644 index 00000000..826937b0 --- /dev/null +++ b/Cocos/Demos/assets/Script/BoneOffset.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "e0062729-d809-4d71-b081-feade5895292", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/BoundingBox.ts b/Cocos/Demos/assets/Script/BoundingBox.ts new file mode 100644 index 00000000..24ee4635 --- /dev/null +++ b/Cocos/Demos/assets/Script/BoundingBox.ts @@ -0,0 +1,132 @@ +import DragHelper from "./DragHelper"; +@cc._decorator.ccclass +export default class BoundingBox extends cc.Component { + private readonly _helpPointA: cc.Vec2 = cc.v2(); + private readonly _helpPointB: cc.Vec2 = cc.v2(); + private readonly _helpPointC: cc.Vec2 = cc.v2(); + + private _armatureComponent: dragonBones.CocosArmatureComponent; + private _boundingBoxTester: dragonBones.CocosArmatureComponent; + private _targetA: dragonBones.CocosArmatureComponent; + private _targetB: dragonBones.CocosArmatureComponent; + private _line: dragonBones.Bone; + private _pointA: dragonBones.Bone; + private _pointB: dragonBones.Bone; + + start() { + const resources = [ + cc.url.raw("resources/mecha_2903/mecha_2903_ske.json"), + cc.url.raw("resources/mecha_2903/mecha_2903_tex.json"), + cc.url.raw("resources/mecha_2903/mecha_2903_tex.png"), + cc.url.raw("resources/bounding_box_tester/bounding_box_tester_ske.json"), + cc.url.raw("resources/bounding_box_tester/bounding_box_tester_tex.json"), + cc.url.raw("resources/bounding_box_tester/bounding_box_tester_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + factory.parseDragonBonesData(cc.loader.getRes(resources[3])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[4]), cc.loader.getRes(resources[5])); + // + this._armatureComponent = factory.buildArmatureComponent("mecha_2903d"); + this._boundingBoxTester = factory.buildArmatureComponent("tester"); + this._targetA = this._boundingBoxTester.armature.getSlot("target_a").childArmature.proxy as dragonBones.CocosArmatureComponent; + this._targetB = this._boundingBoxTester.armature.getSlot("target_b").childArmature.proxy as dragonBones.CocosArmatureComponent; + this._line = this._boundingBoxTester.armature.getBone("line"); + this._pointA = this._boundingBoxTester.armature.getBone("point_a"); + this._pointB = this._boundingBoxTester.armature.getBone("point_b"); + // + this._armatureComponent.debugDraw = true; + this._armatureComponent.node.x = 0.0; + this._armatureComponent.node.y = -100.0; + this._boundingBoxTester.node.x = 0.0; + this._boundingBoxTester.node.y = -200.0; + this._targetA.armature.inheritAnimation = false; + this._targetB.armature.inheritAnimation = false; + this._line.offsetMode = 2 /* dragonBones.OffsetMode.Override */; // creator can not support const enum. + this._pointA.offsetMode = 2 /* dragonBones.OffsetMode.Override */; // creator can not support const enum. + this._pointB.offsetMode = 2 /* dragonBones.OffsetMode.Override */; // creator can not support const enum. + this._armatureComponent.animation.play("walk"); + this._boundingBoxTester.animation.play("0"); + // + this.node.addChild(this._armatureComponent.node); + this.node.addChild(this._boundingBoxTester.node); + // + DragHelper.getInstance().enableDrag(this._targetA.node); + DragHelper.getInstance().enableDrag(this._targetB.node); + }); + } + + update() { + if (!this._armatureComponent) { + return; + } + + const localToGlobal = this._armatureComponent.node.getWorldToNodeTransform(); + const globalToLocal = this._boundingBoxTester.node.getNodeToWorldTransform(); + let globalA = (cc as any).pointApplyAffineTransform(cc.v2(this._targetA.node.x, this._targetA.node.y), localToGlobal); // creator.d.ts error. + let globalB = (cc as any).pointApplyAffineTransform(cc.v2(this._targetB.node.x, this._targetB.node.y), localToGlobal); // creator.d.ts error. + let localA = (cc as any).pointApplyAffineTransform(globalA, globalToLocal); // creator.d.ts error. + let localB = (cc as any).pointApplyAffineTransform(globalB, globalToLocal); // creator.d.ts error. + + const containsSlotA = this._armatureComponent.armature.containsPoint(localA.x, localA.y); + const containsSlotB = this._armatureComponent.armature.containsPoint(localB.x, localB.y); + const intersectsSlots = this._armatureComponent.armature.intersectsSegment(localA.x, localA.y, localB.x, localB.y, localA, localB, this._helpPointC); + + { + const animationName = containsSlotA ? "1" : "0"; + if (this._targetA.animation.lastAnimationName !== animationName) { + this._targetA.animation.fadeIn(animationName, 0.2).resetToPose = false; + } + } + + { + const animationName = containsSlotB ? "1" : "0"; + if (this._targetB.animation.lastAnimationName !== animationName) { + this._targetB.animation.fadeIn(animationName, 0.2).resetToPose = false; + } + } + + { + const targetA = this._targetA.armature.parent.parent; + const targetB = this._targetB.armature.parent.parent; + const dX = targetB.global.x - targetA.global.x; + const dY = targetB.global.y - targetA.global.y; + this._line.offset.x = targetA.global.x; + this._line.offset.y = targetA.global.y; + this._line.offset.scaleX = Math.sqrt(dX * dX + dY * dY) / 100.0; + this._line.offset.rotation = Math.atan2(dY, dX); + this._line.invalidUpdate(); + + const animationName = intersectsSlots ? "1" : "0"; + if (this._boundingBoxTester.animation.lastAnimationName !== animationName) { + this._boundingBoxTester.animation.fadeIn(animationName, 0.2).resetToPose = false; + } + + if (intersectsSlots) { + const globalToLocal = this._armatureComponent.node.getNodeToWorldTransform(); + const localToGlobal = this._boundingBoxTester.node.getWorldToNodeTransform(); + globalA = (cc as any).pointApplyAffineTransform(localA, localToGlobal); // creator.d.ts error. + globalB = (cc as any).pointApplyAffineTransform(localB, localToGlobal); // creator.d.ts error. + localA = (cc as any).pointApplyAffineTransform(globalA, globalToLocal); // creator.d.ts error. + localB = (cc as any).pointApplyAffineTransform(globalB, globalToLocal); // creator.d.ts error. + + this._pointA.visible = true; + this._pointB.visible = true; + this._pointA.offset.x = localA.x; + this._pointA.offset.y = localA.y; + this._pointB.offset.x = localB.x; + this._pointB.offset.y = localB.y; + this._pointA.offset.rotation = this._helpPointC.x; + this._pointB.offset.rotation = this._helpPointC.y; + this._pointA.invalidUpdate(); + this._pointB.invalidUpdate(); + } + else { + this._pointA.visible = false; + this._pointB.visible = false; + } + } + } +} diff --git a/Cocos/Demos/assets/Script/BoundingBox.ts.meta b/Cocos/Demos/assets/Script/BoundingBox.ts.meta new file mode 100644 index 00000000..8a610180 --- /dev/null +++ b/Cocos/Demos/assets/Script/BoundingBox.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "54bb5d7e-78d8-43fd-b156-f4cdf4f7eb91", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/CoreElement.ts b/Cocos/Demos/assets/Script/CoreElement.ts new file mode 100644 index 00000000..0a5f2d17 --- /dev/null +++ b/Cocos/Demos/assets/Script/CoreElement.ts @@ -0,0 +1,578 @@ +import DragHelper from "./DragHelper"; + +type PointType = cc.Vec2; +type ArmatureComponentType = dragonBones.CocosArmatureComponent; +type EventType = cc.Event.EventCustom; + +@cc._decorator.ccclass +export default class Game extends cc.Component { + public static GROUND: number; + public static G: number = -0.6; + public static instance: Game; + + private _left: boolean = false; + private _right: boolean = false; + private _player: Mecha; + private readonly _bullets: Array = []; + + start() { + const resources = [ + cc.url.raw("resources/mecha_1502b/mecha_1502b_ske.json"), + cc.url.raw("resources/mecha_1502b/mecha_1502b_tex.json"), + cc.url.raw("resources/mecha_1502b/mecha_1502b_tex.png"), + cc.url.raw("resources/skin_1502b/skin_1502b_ske.json"), + cc.url.raw("resources/skin_1502b/skin_1502b_tex.json"), + cc.url.raw("resources/skin_1502b/skin_1502b_tex.png"), + cc.url.raw("resources/weapon_1000/weapon_1000_ske.json"), + cc.url.raw("resources/weapon_1000/weapon_1000_tex.json"), + cc.url.raw("resources/weapon_1000/weapon_1000_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const canvas = this.getComponent(cc.Canvas); + const size = canvas.designResolution; + Game.GROUND = -(size.height * 0.5 - 150.0); + Game.instance = this; + // + this.node.on(cc.Node.EventType.TOUCH_START, this._touchHandler, this); + this.node.on(cc.Node.EventType.TOUCH_END, this._touchHandler, this); + this.node.on(cc.Node.EventType.MOUSE_MOVE, this._touchHandler, this); + cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN, this._keyHandler, this); + cc.systemEvent.on(cc.SystemEvent.EventType.KEY_UP, this._keyHandler, this); + // + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + factory.parseDragonBonesData(cc.loader.getRes(resources[3])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[4]), cc.loader.getRes(resources[5])); + factory.parseDragonBonesData(cc.loader.getRes(resources[6])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[7]), cc.loader.getRes(resources[8])); + // + this._player = new Mecha(); + }); + } + + update() { + if (this._player) { + this._player.update(); + } + + let i = this._bullets.length; + while (i--) { + const bullet = this._bullets[i]; + if (bullet.update()) { + this._bullets.splice(i, 1); + } + } + } + + private _touchHandler(event: cc.Event.EventTouch): void { + this._player.aim(event.getLocationX() - this.node.x, event.getLocationY() - this.node.y); + + if (event.type === cc.Node.EventType.TOUCH_START) { + this._player.attack(true); + } + else if (event.type === cc.Node.EventType.TOUCH_END) { + this._player.attack(false); + } + } + + private _keyHandler(event: KeyboardEvent): void { + const isDown = event.type === "keydown"; + switch (event.keyCode) { + case 37: + case 65: + this._left = isDown; + this._updateMove(-1); + break; + + case 39: + case 68: + this._right = isDown; + this._updateMove(1); + break; + + case 38: + case 87: + if (isDown) { + this._player.jump(); + } + break; + + case 83: + case 40: + this._player.squat(isDown); + break; + + case 81: + if (isDown) { + this._player.switchWeaponR(); + } + break; + + case 69: + if (isDown) { + this._player.switchWeaponL(); + } + break; + + case 32: + if (isDown) { + this._player.switchSkin(); + } + break; + } + } + + private _updateMove(dir: number): void { + if (this._left && this._right) { + this._player.move(dir); + } + else if (this._left) { + this._player.move(-1); + } + else if (this._right) { + this._player.move(1); + } + else { + this._player.move(0); + } + } + + public addBullet(bullet: Bullet): void { + this._bullets.push(bullet); + } +} + +class Mecha { + private static readonly JUMP_SPEED: number = 20; + private static readonly NORMALIZE_MOVE_SPEED: number = 3.6; + private static readonly MAX_MOVE_SPEED_FRONT: number = Mecha.NORMALIZE_MOVE_SPEED * 1.4; + private static readonly MAX_MOVE_SPEED_BACK: number = Mecha.NORMALIZE_MOVE_SPEED * 1.0; + private static readonly NORMAL_ANIMATION_GROUP: string = "normal"; + private static readonly AIM_ANIMATION_GROUP: string = "aim"; + private static readonly ATTACK_ANIMATION_GROUP: string = "attack"; + private static readonly WEAPON_L_LIST: Array = ["weapon_1502b_l", "weapon_1005", "weapon_1005b", "weapon_1005c", "weapon_1005d", "weapon_1005e", ""]; + private static readonly WEAPON_R_LIST: Array = ["weapon_1502b_r", "weapon_1005", "weapon_1005b", "weapon_1005c", "weapon_1005d", ""]; + private static readonly SKINS: Array = ["mecha_1502b", "skin_a", "skin_b", "skin_c"]; + + private _isJumpingA: boolean = false; + private _isSquating: boolean = false; + private _isAttackingA: boolean = false; + private _isAttackingB: boolean = false; + private _weaponRIndex: number = 0; + private _weaponLIndex: number = 0; + private _skinIndex: number = 0; + private _faceDir: number = 1; + private _aimDir: number = 0; + private _moveDir: number = 0; + private _aimRadian: number = 0.0; + private _speedX: number = 0.0; + private _speedY: number = 0.0; + private _armature: dragonBones.Armature; + private _armatureComponent: ArmatureComponentType; + private _weaponL: dragonBones.Armature | null = null; + private _weaponR: dragonBones.Armature | null = null; + private _aimState: dragonBones.AnimationState | null = null; + private _walkState: dragonBones.AnimationState | null = null; + private _attackState: dragonBones.AnimationState | null = null; + private readonly _target: PointType = cc.v2(); + private readonly _helpPoint: PointType = cc.v2(); + + public constructor() { + this._armatureComponent = dragonBones.CocosFactory.factory.buildArmatureComponent("mecha_1502b"); + this._armatureComponent.node.x = 0.0; + this._armatureComponent.node.y = Game.GROUND; + this._armatureComponent.node.on(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); + this._armatureComponent.node.on(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); + this._armatureComponent.node.on(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); + this._armature = this._armatureComponent.armature; + + // Get weapon childArmature. + this._weaponL = this._armature.getSlot("weapon_l").childArmature; + this._weaponR = this._armature.getSlot("weapon_r").childArmature; + if (this._weaponL) { + this._weaponL.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + } + + if (this._weaponR) { + this._weaponR.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + } + + Game.instance.node.addChild(this._armatureComponent.node); + this._updateAnimation(); + } + + public move(dir: number): void { + if (this._moveDir === dir) { + return; + } + + this._moveDir = dir; + this._updateAnimation(); + } + + public jump(): void { + if (this._isJumpingA) { + return; + } + + this._isJumpingA = true; + this._armature.animation.fadeIn( + "jump_1", -1.0, -1, + 0, Mecha.NORMAL_ANIMATION_GROUP + ).resetToPose = false; + + this._walkState = null; + } + + public squat(isSquating: boolean): void { + if (this._isSquating === isSquating) { + return; + } + + this._isSquating = isSquating; + this._updateAnimation(); + } + + public attack(isAttacking: boolean): void { + if (this._isAttackingA === isAttacking) { + return; + } + + this._isAttackingA = isAttacking; + } + + public switchWeaponL(): void { + if (this._weaponL) { + this._weaponL.eventDispatcher.removeDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + } + + this._weaponLIndex++; + this._weaponLIndex %= Mecha.WEAPON_L_LIST.length; + const weaponName = Mecha.WEAPON_L_LIST[this._weaponLIndex]; + + if (weaponName) { + this._weaponL = dragonBones.CocosFactory.factory.buildArmature(weaponName); + this._armature.getSlot("weapon_l").childArmature = this._weaponL; + this._weaponL.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + } + else { + this._weaponL = null; + this._armature.getSlot("weapon_l").childArmature = this._weaponL; + } + } + + public switchWeaponR(): void { + if (this._weaponR) { + this._weaponR.eventDispatcher.removeDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + } + + this._weaponRIndex++; + this._weaponRIndex %= Mecha.WEAPON_R_LIST.length; + const weaponName = Mecha.WEAPON_R_LIST[this._weaponRIndex]; + + if (weaponName) { + this._weaponR = dragonBones.CocosFactory.factory.buildArmature(weaponName); + this._armature.getSlot("weapon_r").childArmature = this._weaponR; + this._weaponR.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + } + else { + this._weaponR = null; + this._armature.getSlot("weapon_r").childArmature = this._weaponR; + } + } + + public switchSkin(): void { + this._skinIndex++; + this._skinIndex %= Mecha.SKINS.length; + const skinName = Mecha.SKINS[this._skinIndex]; + const skinData = dragonBones.CocosFactory.factory.getArmatureData(skinName).defaultSkin; + dragonBones.CocosFactory.factory.replaceSkin(this._armature, skinData, false, ["weapon_l", "weapon_r"]); + } + + public aim(x: number, y: number): void { + this._target.x = x; + this._target.y = y; + } + + public update(): void { + this._updatePosition(); + this._updateAim(); + this._updateAttack(); + } + + private _animationEventHandler(event: EventType): void { + const eventObject = event.getUserData() as dragonBones.EventObject; + + switch (event.type) { + case dragonBones.EventObject.FADE_IN_COMPLETE: + if (eventObject.animationState.name === "jump_1") { + this._speedY = Mecha.JUMP_SPEED; + + if (this._moveDir !== 0) { + if (this._moveDir * this._faceDir > 0) { + this._speedX = Mecha.MAX_MOVE_SPEED_FRONT * this._faceDir; + } + else { + this._speedX = -Mecha.MAX_MOVE_SPEED_BACK * this._faceDir; + } + } + + this._armature.animation.fadeIn( + "jump_2", -1.0, -1, + 0, Mecha.NORMAL_ANIMATION_GROUP + ).resetToPose = false; + } + break; + + case dragonBones.EventObject.FADE_OUT_COMPLETE: + if (eventObject.animationState.name === "attack_01") { + this._isAttackingB = false; + this._attackState = null; + } + break; + + case dragonBones.EventObject.COMPLETE: + if (eventObject.animationState.name === "jump_4") { + this._isJumpingA = false; + this._updateAnimation(); + } + break; + } + } + + private _frameEventHandler(event: EventType): void { + const eventObject = event.getUserData() as dragonBones.EventObject; + + if (eventObject.name === "fire") { + const localToGlobal = (eventObject.armature.proxy as ArmatureComponentType).node.getNodeToWorldTransform(); + const globalToLocal = Game.instance.node.getWorldToNodeTransform(); + const global = (cc as any).pointApplyAffineTransform(cc.v2(eventObject.bone.global.x, eventObject.bone.global.y), localToGlobal); // creator.d.ts error. + const local = (cc as any).pointApplyAffineTransform(global, globalToLocal); // creator.d.ts error. + this._fire(local); + } + } + + private _fire(firePoint: PointType): void { + const radian = (this._faceDir < 0 ? Math.PI - this._aimRadian : this._aimRadian); + const bullet = new Bullet("bullet_01", "fire_effect_01", radian + Math.random() * 0.02 - 0.01, 40, firePoint); + Game.instance.addBullet(bullet); + } + + private _updateAnimation(): void { + if (this._isJumpingA) { + return; + } + + if (this._isSquating) { + this._speedX = 0; + this._armature.animation.fadeIn( + "squat", -1.0, -1, + 0, Mecha.NORMAL_ANIMATION_GROUP + ).resetToPose = false; + + this._walkState = null; + return; + } + + if (this._moveDir === 0) { + this._speedX = 0; + this._armature.animation.fadeIn( + "idle", -1.0, -1, 0, + Mecha.NORMAL_ANIMATION_GROUP + ).resetToPose = false; + + this._walkState = null; + } + else { + if (this._walkState === null) { + this._walkState = this._armature.animation.fadeIn( + "walk", -1.0, -1, + 0, Mecha.NORMAL_ANIMATION_GROUP + ); + + this._walkState.resetToPose = false; + } + + if (this._moveDir * this._faceDir > 0) { + this._walkState.timeScale = Mecha.MAX_MOVE_SPEED_FRONT / Mecha.NORMALIZE_MOVE_SPEED; + } + else { + this._walkState.timeScale = -Mecha.MAX_MOVE_SPEED_BACK / Mecha.NORMALIZE_MOVE_SPEED; + } + + if (this._moveDir * this._faceDir > 0) { + this._speedX = Mecha.MAX_MOVE_SPEED_FRONT * this._faceDir; + } + else { + this._speedX = -Mecha.MAX_MOVE_SPEED_BACK * this._faceDir; + } + } + } + + private _updatePosition(): void { + if (this._speedX !== 0.0) { + const canvas = Game.instance.getComponent(cc.Canvas); + const size = canvas.designResolution; + + this._armatureComponent.node.x += this._speedX; + if (this._armatureComponent.node.x < -size.width * 0.5) { + this._armatureComponent.node.x = -size.width * 0.5; + } + else if (this._armatureComponent.node.x > size.width * 0.5) { + this._armatureComponent.node.x = size.width * 0.5; + } + } + + if (this._speedY !== 0.0) { + if (this._speedY < -5.0 && this._speedY + Game.G >= -5.0) { + this._armature.animation.fadeIn( + "jump_3", -1.0, -1, 0 + , Mecha.NORMAL_ANIMATION_GROUP + ).resetToPose = false; + } + + this._speedY += Game.G; + this._armatureComponent.node.y += this._speedY; + + if (this._armatureComponent.node.y < Game.GROUND) { + this._armatureComponent.node.y = Game.GROUND; + this._speedY = 0.0; + this._armature.animation.fadeIn( + "jump_4", -1.0, -1, + 0, Mecha.NORMAL_ANIMATION_GROUP + ).resetToPose = false; + } + } + } + + private _updateAim(): void { + this._faceDir = this._target.x > this._armatureComponent.node.x ? 1 : -1; + if (this._armatureComponent.armature.flipX !== this._faceDir < 0) { + this._armatureComponent.armature.flipX = !this._armatureComponent.armature.flipX; + + if (this._moveDir !== 0) { + this._updateAnimation(); + } + } + + const aimOffsetY = this._armature.getBone("chest").global.y * this._armatureComponent.node.scaleY; + if (this._faceDir > 0) { + this._aimRadian = Math.atan2(this._target.y - this._armatureComponent.node.y - aimOffsetY, this._target.x - this._armatureComponent.node.x); + } + else { + this._aimRadian = Math.PI - Math.atan2(this._target.y - this._armatureComponent.node.y - aimOffsetY, this._target.x - this._armatureComponent.node.x); + if (this._aimRadian > Math.PI) { + this._aimRadian -= Math.PI * 2.0; + } + } + + let aimDir = 0; + if (this._aimRadian > 0.0) { + aimDir = 1; + } + else { + aimDir = -1; + } + + if (this._aimState === null || this._aimDir !== aimDir) { + this._aimDir = aimDir; + + // Animation mixing. + if (this._aimDir >= 0) { + this._aimState = this._armature.animation.fadeIn( + "aim_up", -1.0, -1, + 0, Mecha.AIM_ANIMATION_GROUP + ); + } + else { + this._aimState = this._armature.animation.fadeIn( + "aim_down", -1.0, -1, + 0, Mecha.AIM_ANIMATION_GROUP + ); + } + + this._aimState.resetToPose = false; + } + + this._aimState.weight = Math.abs(this._aimRadian / Math.PI * 2); + this._armature.invalidUpdate(); + } + + private _updateAttack(): void { + if (!this._isAttackingA || this._isAttackingB) { + return; + } + + this._isAttackingB = true; + this._attackState = this._armature.animation.fadeIn( + "attack_01", -1.0, -1, + 0, Mecha.ATTACK_ANIMATION_GROUP + ); + + this._attackState.resetToPose = false; + this._attackState.autoFadeOutTime = 0.1; + } +} + +class Bullet { + private _speedX: number = 0.0; + private _speedY: number = 0.0; + + private _armatureComponent: ArmatureComponentType; + private _effecComponent: ArmatureComponentType | null = null; + + public constructor(armatureName: string, effectArmatureName: string | null, radian: number, speed: number, position: PointType) { + this._speedX = Math.cos(radian) * speed; + this._speedY = Math.sin(radian) * speed; + + this._armatureComponent = dragonBones.CocosFactory.factory.buildArmatureComponent(armatureName); + this._armatureComponent.node.x = position.x + Math.random() * 2 - 1; + this._armatureComponent.node.y = position.y + Math.random() * 2 - 1; + this._armatureComponent.node.rotation = -radian * dragonBones.Transform.RAD_DEG; + + if (effectArmatureName !== null) { + this._effecComponent = dragonBones.CocosFactory.factory.buildArmatureComponent(effectArmatureName); + this._effecComponent.node.rotation = -radian * dragonBones.Transform.RAD_DEG; + this._effecComponent.node.x = this._armatureComponent.node.x; + this._effecComponent.node.y = this._armatureComponent.node.y; + this._effecComponent.node.scaleX = 1.0 + Math.random() * 1.0; + this._effecComponent.node.scaleY = 1.0 + Math.random() * 0.5; + + if (Math.random() < 0.5) { + this._effecComponent.node.scaleY *= -1.0; + } + + Game.instance.node.addChild(this._effecComponent.node); + this._effecComponent.animation.play("idle"); + } + + Game.instance.node.addChild(this._armatureComponent.node); + this._armatureComponent.animation.play("idle"); + } + + public update(): boolean { + const canvas = Game.instance.getComponent(cc.Canvas); + const size = canvas.designResolution; + + this._armatureComponent.node.x += this._speedX; + this._armatureComponent.node.y += this._speedY; + + if ( + this._armatureComponent.node.x < -size.width * 0.5 - 100.0 || this._armatureComponent.node.x > size.width * 0.5 + 100.0 || + this._armatureComponent.node.y < -size.height * 0.5 - 100.0 || this._armatureComponent.node.y > size.height * 0.5 + 100.0 + ) { + Game.instance.node.removeChild(this._armatureComponent.node); + this._armatureComponent.dispose(); + + if (this._effecComponent !== null) { + Game.instance.node.removeChild(this._effecComponent.node); + this._effecComponent.dispose(); + } + + return true; + } + + return false; + } +} diff --git a/Cocos/Demos/assets/Script/CoreElement.ts.meta b/Cocos/Demos/assets/Script/CoreElement.ts.meta new file mode 100644 index 00000000..2d78a78a --- /dev/null +++ b/Cocos/Demos/assets/Script/CoreElement.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "560edac8-5990-419d-9dc9-1ba0e51429e6", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/DragHelper.ts b/Cocos/Demos/assets/Script/DragHelper.ts new file mode 100644 index 00000000..0951731e --- /dev/null +++ b/Cocos/Demos/assets/Script/DragHelper.ts @@ -0,0 +1,83 @@ +export default class DragHelper { + private static _instance: DragHelper = new DragHelper(); + public static getInstance(): DragHelper { + return DragHelper._instance; + } + + private readonly _dragOffset: cc.Vec2 = cc.v2(); + private _dragDisplayObject: cc.Node | null = null; + + private _dragHandler(event: cc.Event.EventTouch): void { + switch (event.type) { + case cc.Node.EventType.TOUCH_START: + if (this._dragDisplayObject) { + return; + } + + this._dragDisplayObject = event.currentTarget as cc.Node; + + const armatureComponent = this._dragDisplayObject.parent.getComponent(dragonBones.CocosArmatureComponent); + const bone = armatureComponent.armature.getBoneByDisplay(this._dragDisplayObject); + + if (bone) { + const matrix = armatureComponent.node.getWorldToNodeTransform(); + const point = (cc as any).pointApplyAffineTransform(event.touch.getLocation(), matrix); // creator.d.ts error. + + if (bone.offsetMode !== 2 /* dragonBones.OffsetMode.Override */) { // creator can not support const enum. + bone.offsetMode = 2 /* dragonBones.OffsetMode.Override */; + bone.offset.x = bone.global.x; + bone.offset.y = bone.global.y; // Offset is yDown. + } + + this._dragOffset.x = bone.global.x - point.x; + this._dragOffset.y = bone.global.y - point.y; + + this._dragDisplayObject.on(cc.Node.EventType.TOUCH_MOVE, this._dragHandler, this); + } + break; + + case cc.Node.EventType.TOUCH_END: + if (this._dragDisplayObject) { + this._dragDisplayObject.off(cc.Node.EventType.TOUCH_MOVE, this._dragHandler, this); + this._dragDisplayObject = null; + } + break; + + case cc.Node.EventType.TOUCH_MOVE: + if (this._dragDisplayObject) { + const armatureComponent = this._dragDisplayObject.parent.getComponent(dragonBones.CocosArmatureComponent); + const bone = armatureComponent.armature.getBoneByDisplay(this._dragDisplayObject); + + if (bone) { + const matrix = armatureComponent.node.getWorldToNodeTransform(); + const point = (cc as any).pointApplyAffineTransform(event.touch.getLocation(), matrix); // creator.d.ts error. + bone.offset.x = point.x + this._dragOffset.x; + bone.offset.y = (point.y + this._dragOffset.y); // + bone.invalidUpdate(); + } + } + break; + } + } + + private _hold(): void { + } + + public enableDrag(displayObject: cc.Node): void { + displayObject.on(cc.Node.EventType.TOUCH_START, this._dragHandler, this); + displayObject.on(cc.Node.EventType.TOUCH_END, this._dragHandler, this); + + if (displayObject.childrenCount > 0) { // + displayObject.children[0].on(cc.Node.EventType.TOUCH_START, this._hold, this); + } + } + + public disableDrag(displayObject: cc.Node): void { + displayObject.off(cc.Node.EventType.TOUCH_START, this._dragHandler, this); + displayObject.off(cc.Node.EventType.TOUCH_END, this._dragHandler, this); + + if (displayObject.childrenCount > 0) { // + displayObject.children[0].off(cc.Node.EventType.TOUCH_START, this._hold, this); + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/DragHelper.ts.meta b/Cocos/Demos/assets/Script/DragHelper.ts.meta new file mode 100644 index 00000000..f5c7d601 --- /dev/null +++ b/Cocos/Demos/assets/Script/DragHelper.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "b6006d7a-8c4a-41d0-8dc8-20470390bb92", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/DragonBonesEvent.ts b/Cocos/Demos/assets/Script/DragonBonesEvent.ts new file mode 100644 index 00000000..3a03e6df --- /dev/null +++ b/Cocos/Demos/assets/Script/DragonBonesEvent.ts @@ -0,0 +1,42 @@ +@cc._decorator.ccclass +export default class DragonBonesEvent extends cc.Component { + private _armatureComponent: dragonBones.CocosArmatureComponent; + + start() { + const resources = [ + cc.url.raw("resources/mecha_1004d/mecha_1004d_ske.json"), + cc.url.raw("resources/mecha_1004d/mecha_1004d_tex.json"), + cc.url.raw("resources/mecha_1004d/mecha_1004d_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + // + factory.soundEventManager.on(dragonBones.EventObject.SOUND_EVENT, this._soundEventHandler, this); + // + this._armatureComponent = factory.buildArmatureComponent("mecha_1004d"); + this._armatureComponent.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); + this._armatureComponent.animation.play("idle"); + this._armatureComponent.node.x = 0.0; + this._armatureComponent.node.y = -100.0; + this.node.addChild(this._armatureComponent.node); + // + this.node.on(cc.Node.EventType.TOUCH_START, () => { + this._armatureComponent.animation.fadeIn("skill_03", 0.2); + }, this); + }); + } + + private _soundEventHandler(event: cc.Event.EventCustom): void { + const eventObject = event.getUserData() as dragonBones.EventObject; + console.log(eventObject.name); + } + + private _animationEventHandler(event: cc.Event.EventCustom): void { + const eventObject = event.getUserData() as dragonBones.EventObject; + if (eventObject.animationState.name === "skill_03") { + this._armatureComponent.animation.fadeIn("walk", 0.2); + } + } +} diff --git a/Cocos/Demos/assets/Script/DragonBonesEvent.ts.meta b/Cocos/Demos/assets/Script/DragonBonesEvent.ts.meta new file mode 100644 index 00000000..f3bd86fd --- /dev/null +++ b/Cocos/Demos/assets/Script/DragonBonesEvent.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "c353b7b1-abca-40dc-8292-b85efd8efc2a", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/EyeTracking.ts b/Cocos/Demos/assets/Script/EyeTracking.ts new file mode 100644 index 00000000..bf1e32cb --- /dev/null +++ b/Cocos/Demos/assets/Script/EyeTracking.ts @@ -0,0 +1,129 @@ +@cc._decorator.ccclass +export default class EyeTracking extends cc.Component { + private _scale: number = 0.3; + private readonly _target: cc.Vec2 = cc.v2(); + private readonly _animationNames: string[] = [ + "PARAM_ANGLE_X", + "PARAM_ANGLE_Y", + "PARAM_ANGLE_Z", + "PARAM_EYE_BALL_X", + "PARAM_EYE_BALL_Y", + "PARAM_BODY_X", + "PARAM_BODY_Y", + "PARAM_BODY_Z", + "PARAM_BODY_ANGLE_X", + "PARAM_BODY_ANGLE_Y", + "PARAM_BODY_ANGLE_Z", + "PARAM_BREATH", + ]; + private _armatureComponent: dragonBones.CocosArmatureComponent; + + start() { + const resources = [ + cc.url.raw("resources/shizuku/shizuku_ske.json"), + cc.url.raw("resources/shizuku/shizuku.1024/texture_00.png"), + cc.url.raw("resources/shizuku/shizuku.1024/texture_01.png"), + cc.url.raw("resources/shizuku/shizuku.1024/texture_02.png"), + cc.url.raw("resources/shizuku/shizuku.1024/texture_03.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0]), "shizuku"); + factory.updateTextureAtlases( + [ + cc.loader.getRes(resources[1]), + cc.loader.getRes(resources[2]), + cc.loader.getRes(resources[3]), + cc.loader.getRes(resources[4]), + ], + "shizuku" + ); + + this._armatureComponent = factory.buildArmatureComponent("shizuku", "shizuku"); + this._armatureComponent.animation.play("idle_00"); + + this._armatureComponent.node.x = 0.0; + this._armatureComponent.node.y = -200.0; + this._armatureComponent.node.scaleX = this._armatureComponent.node.scaleY = this._scale; + this.node.addChild(this._armatureComponent.node); + + this.node.on(cc.Node.EventType.MOUSE_MOVE, (event: cc.Event.EventMouse) => { + this._setTarget(event.getLocationX(), event.getLocationY()); + }, this); + }); + } + + update(): void { + if (!this._armatureComponent) { + return; + } + + const armature = this._armatureComponent.armature; + const animation = this._armatureComponent.animation; + const canvas = armature.armatureData.canvas; + + let p = 0.0; + const pX = Math.max(Math.min((this._target.x - canvas.x) / (canvas.width * 0.5), 1.0), -1.0); + const pY = Math.max(Math.min((this._target.y + canvas.y) / (canvas.height * 0.5), 1.0), -1.0); + for (const animationName of this._animationNames) { + if (!animation.hasAnimation(animationName)) { + continue; + } + + let animationState = animation.getState(animationName, 1); + if (!animationState) { + animationState = animation.fadeIn(animationName, 0.1, 1, 1, animationName); + if (animationState) { + animationState.resetToPose = false; + animationState.stop(); + } + } + + if (!animationState) { + continue; + } + + switch (animationName) { + case "PARAM_ANGLE_X": + case "PARAM_EYE_BALL_X": + p = (pX + 1.0) * 0.5; + break; + + case "PARAM_ANGLE_Y": + case "PARAM_EYE_BALL_Y": + p = (pY + 1.0) * 0.5; + break; + + case "PARAM_ANGLE_Z": + p = (-pX * pY + 1.0) * 0.5; + break; + + case "PARAM_BODY_X": + case "PARAM_BODY_ANGLE_X": + p = (pX + 1.0) * 0.5; + break; + + case "PARAM_BODY_Y": + case "PARAM_BODY_ANGLE_Y": + p = (-pX * pY + 1.0) * 0.5; + break; + + case "PARAM_BODY_Z": + case "PARAM_BODY_ANGLE_Z": + p = (-pX * pY + 1.0) * 0.5; + break; + + case "PARAM_BREATH": + p = (Math.sin(armature.clock.time) + 1.0) * 0.5; + break; + } + + animationState.currentTime = p * animationState.totalTime; + } + } + + private _setTarget(x: number, y: number) { + this._target.x += ((x - this.node.x - this._armatureComponent.node.x) / this._scale - this._target.x) * 0.3; + this._target.y += ((y - this.node.y - this._armatureComponent.node.y) / this._scale - this._target.y) * 0.3; + } +} diff --git a/Cocos/Demos/assets/Script/EyeTracking.ts.meta b/Cocos/Demos/assets/Script/EyeTracking.ts.meta new file mode 100644 index 00000000..5db8bc7c --- /dev/null +++ b/Cocos/Demos/assets/Script/EyeTracking.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "52327db3-4c2b-413d-9790-b86af456f29e", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/HelloDragonBones.ts b/Cocos/Demos/assets/Script/HelloDragonBones.ts new file mode 100644 index 00000000..0367b19d --- /dev/null +++ b/Cocos/Demos/assets/Script/HelloDragonBones.ts @@ -0,0 +1,39 @@ +/** + * How to use + * 1. Load data. + * + * 2. Parse data. + * factory.parseDragonBonesData(); + * factory.parseTextureAtlasData(); + * + * 3. Build armature. + * armatureComponent = factory.buildArmatureComponent("armatureName"); + * + * 4. Play animation. + * armatureComponent.animation.play("animationName"); + * + * 5. Add armature to stage. + * addChild(armatureComponent.node); + */ +@cc._decorator.ccclass +export default class HelloDragonBones extends cc.Component { + start() { + const resources = [ + cc.url.raw("resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.json"), + cc.url.raw("resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.json"), + cc.url.raw("resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + + const armatureComponent = factory.buildArmatureComponent("mecha_1002_101d", "mecha_1002_101d_show"); + armatureComponent.animation.play("idle"); + + armatureComponent.node.x = 0.0; + armatureComponent.node.y = -200.0; + this.node.addChild(armatureComponent.node); + }); + } +} diff --git a/Cocos/Demos/assets/Script/HelloDragonBones.ts.meta b/Cocos/Demos/assets/Script/HelloDragonBones.ts.meta new file mode 100644 index 00000000..ec0ba8a4 --- /dev/null +++ b/Cocos/Demos/assets/Script/HelloDragonBones.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "fc60669a-6086-404a-b3cb-ee97d27d905d", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/InverseKinematics.ts b/Cocos/Demos/assets/Script/InverseKinematics.ts new file mode 100644 index 00000000..a4ecbac4 --- /dev/null +++ b/Cocos/Demos/assets/Script/InverseKinematics.ts @@ -0,0 +1,121 @@ +import DragHelper from "./DragHelper"; + +@cc._decorator.ccclass +export default class InverseKinematics extends cc.Component { + private _faceDir: number = 0; + private _aimRadian: number = 0.0; + private _offsetRotation: number = 0.0; + private readonly _target: cc.Vec2 = cc.v2(); + private _armatureComponent: dragonBones.CocosArmatureComponent; + private _floorBoard: dragonBones.CocosArmatureComponent; + private _chestBone: dragonBones.Bone; + private _leftFootBone: dragonBones.Bone; + private _rightFootBone: dragonBones.Bone; + private _circleBone: dragonBones.Bone; + private _floorBoardBone: dragonBones.Bone; + private _aimState: dragonBones.AnimationState; + + start() { + const resources = [ + cc.url.raw("resources/mecha_1406/mecha_1406_ske.json"), + cc.url.raw("resources/mecha_1406/mecha_1406_tex.json"), + cc.url.raw("resources/mecha_1406/mecha_1406_tex.png"), + cc.url.raw("resources/floor_board/floor_board_ske.json"), + cc.url.raw("resources/floor_board/floor_board_tex.json"), + cc.url.raw("resources/floor_board/floor_board_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + factory.parseDragonBonesData(cc.loader.getRes(resources[3])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[4]), cc.loader.getRes(resources[5])); + // + this._armatureComponent = factory.buildArmatureComponent("mecha_1406"); + this._floorBoard = factory.buildArmatureComponent("floor_board"); + // + this._chestBone = this._armatureComponent.armature.getBone("chest"); + this._leftFootBone = this._armatureComponent.armature.getBone("foot_l"); + this._rightFootBone = this._armatureComponent.armature.getBone("foot_r"); + this._circleBone = this._floorBoard.armature.getBone("circle"); + this._floorBoardBone = this._floorBoard.armature.getBone("floor_board"); + // + this._armatureComponent.animation.play("idle"); + this._aimState = this._armatureComponent.animation.fadeIn("aim", 0.1, 1, 0, "aim_group"); + this._aimState.resetToPose = false; + this._aimState.stop(); + // + this._floorBoard.animation.play("idle"); + this._floorBoard.armature.getSlot("player").display = this._armatureComponent.node; + this._floorBoard.node.x = 0.0; + this._floorBoard.node.y = -50.0; + this.node.addChild(this._floorBoard.node); + // + this.node.on(cc.Node.EventType.MOUSE_MOVE, (event: cc.Event.EventMouse) => { + this._target.x = event.getLocationX() - this.node.x; + this._target.y = event.getLocationY() - this.node.y; + }, this); + // + DragHelper.getInstance().enableDrag(this._floorBoard.armature.getSlot("circle").display); + }); + } + + update() { + if (!this._armatureComponent) { + return; + } + + this._updateAim(); + this._updateFoot(); + } + + private _updateAim(): void { + const positionX = this._floorBoard.node.x; + const positionY = this._floorBoard.node.y; + const aimOffsetY = this._chestBone.global.y * this._floorBoard.node.scaleY; + + this._faceDir = this._target.x > 0.0 ? 1 : -1; + this._armatureComponent.armature.flipX = this._faceDir < 0; + + if (this._faceDir > 0) { + this._aimRadian = -Math.atan2(this._target.y - positionY - aimOffsetY, this._target.x - positionX); + } + else { + this._aimRadian = Math.PI + Math.atan2(this._target.y - positionY - aimOffsetY, this._target.x - positionX); + if (this._aimRadian > Math.PI) { + this._aimRadian -= Math.PI * 2.0; + } + } + + // Calculate progress. + const progress = Math.abs((this._aimRadian + Math.PI / 2.0) / Math.PI); + // Set currentTime. + this._aimState.currentTime = progress * this._aimState.totalTime; + } + + private _updateFoot(): void { + // Set floor board bone offset. + const minRadian = -25.0 * dragonBones.Transform.DEG_RAD; + const maxRadian = 25.0 * dragonBones.Transform.DEG_RAD; + let circleRadian = Math.atan2(this._circleBone.global.y, this._circleBone.global.x); + + if (this._circleBone.global.x < 0.0) { + circleRadian = dragonBones.Transform.normalizeRadian(circleRadian + Math.PI); + } + + this._offsetRotation = Math.min(Math.max(circleRadian, minRadian), maxRadian); + this._floorBoardBone.offset.rotation = this._offsetRotation; + this._floorBoardBone.invalidUpdate(); + // Set foot bone offset. + const tan = Math.tan(this._offsetRotation); + const sinR = 1.0 / Math.sin(Math.PI * 0.5 - this._offsetRotation) - 1.0; + + this._leftFootBone.offset.y = tan * this._leftFootBone.global.x + this._leftFootBone.origin.y * sinR; + this._leftFootBone.offset.rotation = this._offsetRotation * this._faceDir; + this._leftFootBone.invalidUpdate(); + + this._rightFootBone.offset.y = tan * this._rightFootBone.global.x + this._rightFootBone.origin.y * sinR; + this._rightFootBone.offset.rotation = this._offsetRotation * this._faceDir; + this._rightFootBone.invalidUpdate(); + } +} diff --git a/Cocos/Demos/assets/Script/InverseKinematics.ts.meta b/Cocos/Demos/assets/Script/InverseKinematics.ts.meta new file mode 100644 index 00000000..b02c65e0 --- /dev/null +++ b/Cocos/Demos/assets/Script/InverseKinematics.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "fbc7c69e-b4e8-446d-92ea-410b932fc135", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/MultiTextureAltas.ts b/Cocos/Demos/assets/Script/MultiTextureAltas.ts new file mode 100644 index 00000000..2fd75f37 --- /dev/null +++ b/Cocos/Demos/assets/Script/MultiTextureAltas.ts @@ -0,0 +1,72 @@ +@cc._decorator.ccclass +export default class MultiTextureAltas extends cc.Component { + private _armatureComponentA: dragonBones.CocosArmatureComponent; + private _armatureComponentB: dragonBones.CocosArmatureComponent; + private _armatureComponentC: dragonBones.CocosArmatureComponent; + private _armatureComponentD: dragonBones.CocosArmatureComponent; + + start() { + const resources = [ + cc.url.raw("resources/effect/effect_ske.json"), + cc.url.raw("resources/effect/effect_tex.json"), + cc.url.raw("resources/effect/effect_tex.png"), + cc.url.raw("resources/effect/effect_sd_tex.json"), + cc.url.raw("resources/effect/effect_sd_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0]), "hd", 1.0); + factory.parseDragonBonesData(cc.loader.getRes(resources[0]), "sd", 0.5); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2]), "hd", 1.0); + factory.parseTextureAtlasData(cc.loader.getRes(resources[3]), cc.loader.getRes(resources[4]), "sd", 2.0); + // + this._armatureComponentA = factory.buildArmatureComponent("flower", "hd", null, "hd"); // HD Armature and HD TextureAtlas. + this._armatureComponentB = factory.buildArmatureComponent("flower", "hd", null, "sd"); // HD Armature and SD TextureAtlas. + this._armatureComponentC = factory.buildArmatureComponent("flower", "sd", null, "hd"); // SD Armature and HD TextureAtlas. + this._armatureComponentD = factory.buildArmatureComponent("flower", "sd", null, "sd"); // SD Armature and SD TextureAtlas. + // Test flip. + this._armatureComponentB.armature.flipX = true; + this._armatureComponentC.armature.flipY = true; + this._armatureComponentD.armature.flipX = true; + this._armatureComponentD.armature.flipY = true; + // + this._armatureComponentA.node.x = -250.0; + this._armatureComponentA.node.y = 0.0; + this._armatureComponentB.node.x = 250.0; + this._armatureComponentB.node.y = 0.0; + this._armatureComponentC.node.x = -250.0; + this._armatureComponentC.node.y = -200.0; + this._armatureComponentD.node.x = 250.0; + this._armatureComponentD.node.y = -200.0; + // + this.node.addChild(this._armatureComponentA.node); + this.node.addChild(this._armatureComponentB.node); + this.node.addChild(this._armatureComponentC.node); + this.node.addChild(this._armatureComponentD.node); + // + this.node.on(cc.Node.EventType.TOUCH_START, () => { + this._changeAnimation(); + }, this); + // + this._changeAnimation(); + }); + } + + private _changeAnimation(): void { + let animationName = this._armatureComponentA.animation.lastAnimationName; + if (animationName) { + const animationNames = this._armatureComponentA.animation.animationNames; + const animationIndex = (animationNames.indexOf(animationName) + 1) % animationNames.length; + this._armatureComponentA.animation.play(animationNames[animationIndex]).playTimes = 0; + } + else { + this._armatureComponentA.animation.play().playTimes = 0; + } + + animationName = this._armatureComponentA.animation.lastAnimationName; + + this._armatureComponentB.animation.play(animationName).playTimes = 0; + this._armatureComponentC.animation.play(animationName).playTimes = 0; + this._armatureComponentD.animation.play(animationName).playTimes = 0; + } +} diff --git a/Cocos/Demos/assets/Script/MultiTextureAltas.ts.meta b/Cocos/Demos/assets/Script/MultiTextureAltas.ts.meta new file mode 100644 index 00000000..6bd6e57b --- /dev/null +++ b/Cocos/Demos/assets/Script/MultiTextureAltas.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "96ee360b-e01f-4abe-aaf7-94bd29e7aef7", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/PerformanceTest.ts b/Cocos/Demos/assets/Script/PerformanceTest.ts new file mode 100644 index 00000000..756fbc84 --- /dev/null +++ b/Cocos/Demos/assets/Script/PerformanceTest.ts @@ -0,0 +1,125 @@ +@cc._decorator.ccclass +export default class PerformanceTest extends cc.Component { + private _addingArmature: boolean = false; + private _removingArmature: boolean = false; + private readonly _resources: string[] = []; + private readonly _armatures: dragonBones.CocosArmatureComponent[] = []; + private _text: cc.Label; + + start() { + this._resources.push( + cc.url.raw("resources/mecha_1406/mecha_1406_ske.json"), + cc.url.raw("resources/mecha_1406/mecha_1406_tex.json"), + cc.url.raw("resources/mecha_1406/mecha_1406_tex.png"), + ); + cc.loader.load(this._resources, (err, assets) => { + this.node.on(cc.Node.EventType.TOUCH_START, this._touchHandler, this); + this.node.on(cc.Node.EventType.TOUCH_END, this._touchHandler, this); + + for (let i = 0; i < 300; ++i) { + this._addArmature(); + } + + this._resetPosition(); + this._updateText(); + }); + this._text = this.getComponentInChildren(cc.Label); + } + + update() { + if (this._addingArmature) { + for (let i = 0; i < 10; ++i) { + this._addArmature(); + } + + this._resetPosition(); + this._updateText(); + } + + if (this._removingArmature) { + for (let i = 0; i < 10; ++i) { + this._removeArmature(); + } + + this._resetPosition(); + this._updateText(); + } + } + + private _touchHandler(event: cc.Event.EventTouch): void { + switch (event.type) { + case cc.Node.EventType.TOUCH_START: + const touchRight = event.getLocationX() - this.node.x > 0.0; + this._addingArmature = touchRight; + this._removingArmature = !touchRight; + break; + + case cc.Node.EventType.TOUCH_END: + this._addingArmature = false; + this._removingArmature = false; + break; + } + } + + private _addArmature(): void { + const factory = dragonBones.CocosFactory.factory; + if (this._armatures.length === 0) { + factory.parseDragonBonesData(cc.loader.getRes(this._resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(this._resources[1]), cc.loader.getRes(this._resources[2])); + } + + const armatureComponent = factory.buildArmatureComponent("mecha_1406"); + armatureComponent.armature.cacheFrameRate = 24; + armatureComponent.animation.play("walk"); + armatureComponent.node.scaleX = armatureComponent.node.scaleY = 0.5; + this.node.addChild(armatureComponent.node); + + this._armatures.push(armatureComponent); + } + + private _removeArmature(): void { + if (this._armatures.length === 0) { + return; + } + + const armatureComponent = this._armatures.pop(); + this.node.removeChild(armatureComponent.node); + armatureComponent.dispose(); + + if (this._armatures.length === 0) { + dragonBones.CocosFactory.factory.clear(true); + dragonBones.BaseObject.clearPool(); + } + } + + private _resetPosition(): void { + const armatureCount = this._armatures.length; + if (armatureCount === 0) { + return; + } + + const canvas = this.getComponent(cc.Canvas); + const size = canvas.designResolution; + + const paddingH = 100; + const paddingT = 200; + const paddingB = 100; + const gapping = 90; + const stageWidth = size.width - paddingH * 2; + const columnCount = Math.floor(stageWidth / gapping); + const paddingHModify = (size.width - columnCount * gapping) * 0.5; + const dX = stageWidth / columnCount; + const dY = (size.height - paddingT - paddingB) / Math.ceil(armatureCount / columnCount); + + for (let i = 0, l = armatureCount; i < l; ++i) { + const armatureDisplay = this._armatures[i].node; + const lineY = Math.floor(i / columnCount); + armatureDisplay.x = (i % columnCount) * dX + paddingHModify - size.width * 0.5; + armatureDisplay.y = -(lineY * dY + paddingT - size.height * 0.5); + } + } + + private _updateText(): void { + this._text.string = "Count: " + this._armatures.length + ". Touch screen left to decrease count / right to increase count."; + } +} diff --git a/Cocos/Demos/assets/Script/PerformanceTest.ts.meta b/Cocos/Demos/assets/Script/PerformanceTest.ts.meta new file mode 100644 index 00000000..8edf6122 --- /dev/null +++ b/Cocos/Demos/assets/Script/PerformanceTest.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "507b7c71-33dc-431e-8ecd-7e6cc360f357", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/ReplaceAnimation.ts b/Cocos/Demos/assets/Script/ReplaceAnimation.ts new file mode 100644 index 00000000..5b02254c --- /dev/null +++ b/Cocos/Demos/assets/Script/ReplaceAnimation.ts @@ -0,0 +1,66 @@ +@cc._decorator.ccclass +export default class ReplaceSlotDisplay extends cc.Component { + private _armatureComponentA: dragonBones.CocosArmatureComponent; + private _armatureComponentB: dragonBones.CocosArmatureComponent; + private _armatureComponentC: dragonBones.CocosArmatureComponent; + private _armatureComponentD: dragonBones.CocosArmatureComponent; + + start() { + const resources = [ + cc.url.raw("resources/mecha_2903/mecha_2903_ske.json"), + cc.url.raw("resources/mecha_2903/mecha_2903_tex.json"), + cc.url.raw("resources/mecha_2903/mecha_2903_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + // + this._armatureComponentA = factory.buildArmatureComponent("mecha_2903"); + this._armatureComponentB = factory.buildArmatureComponent("mecha_2903b"); + this._armatureComponentC = factory.buildArmatureComponent("mecha_2903c"); + this._armatureComponentD = factory.buildArmatureComponent("mecha_2903d"); + // + const sourceArmatureData = factory.getArmatureData("mecha_2903d"); + factory.replaceAnimation(this._armatureComponentA.armature, sourceArmatureData); + factory.replaceAnimation(this._armatureComponentB.armature, sourceArmatureData); + factory.replaceAnimation(this._armatureComponentC.armature, sourceArmatureData); + // + this._armatureComponentA.node.x = 0.0 - 350.0; + this._armatureComponentA.node.y = 0.0 - 150.0; + this._armatureComponentB.node.x = 0.0; + this._armatureComponentB.node.y = 0.0 - 150.0; + this._armatureComponentC.node.x = 0.0 + 350.0; + this._armatureComponentC.node.y = 0.0 - 150.0; + this._armatureComponentD.node.x = 0.0; + this._armatureComponentD.node.y = 0.0 + 50.0; + // + this.node.addChild(this._armatureComponentD.node); + this.node.addChild(this._armatureComponentA.node); + this.node.addChild(this._armatureComponentB.node); + this.node.addChild(this._armatureComponentC.node); + // + this.node.on(cc.Node.EventType.TOUCH_START, () => { + this._changeAnimation(); + }, this); + }); + } + + private _changeAnimation(): void { + let animationName = this._armatureComponentD.animation.lastAnimationName; + if (animationName) { + const animationNames = this._armatureComponentD.animation.animationNames; + const animationIndex = (animationNames.indexOf(animationName) + 1) % animationNames.length; + this._armatureComponentD.animation.play(animationNames[animationIndex]); + } + else { + this._armatureComponentD.animation.play(); + } + + animationName = this._armatureComponentD.animation.lastAnimationName; + + this._armatureComponentA.animation.play(animationName); + this._armatureComponentB.animation.play(animationName); + this._armatureComponentC.animation.play(animationName); + } +} diff --git a/Cocos/Demos/assets/Script/ReplaceAnimation.ts.meta b/Cocos/Demos/assets/Script/ReplaceAnimation.ts.meta new file mode 100644 index 00000000..9376eb9c --- /dev/null +++ b/Cocos/Demos/assets/Script/ReplaceAnimation.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "687f1edc-5333-4823-a660-476719de0e99", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/ReplaceSkin.ts b/Cocos/Demos/assets/Script/ReplaceSkin.ts new file mode 100644 index 00000000..618dbd35 --- /dev/null +++ b/Cocos/Demos/assets/Script/ReplaceSkin.ts @@ -0,0 +1,136 @@ +@cc._decorator.ccclass +export default class ReplaceSkin extends cc.Component { + private _replaceSuitIndex: number = 0; + private readonly _suitConfigs: string[][] = []; + private readonly _replaceSuitParts: string[] = []; + private _armatureComponent: dragonBones.CocosArmatureComponent; + + start() { + this._suitConfigs.push([ + "2010600a", + "2010600a_1", + "20208003", + "20208003_1", + "20208003_2", + "20208003_3", + "20405006", + "20509005", + "20703016", + "20703016_1", + "2080100c", + "2080100e", + "2080100e_1", + "20803005", + "2080500b", + "2080500b_1" + ]); + + this._suitConfigs.push([ + "20106010", + "20106010_1", + "20208006", + "20208006_1", + "20208006_2", + "20208006_3", + "2040600b", + "2040600b_1", + "20509007", + "20703020", + "20703020_1", + "2080b003", + "20801015" + ]); + + const resources = [ + cc.url.raw("resources/you_xin/body/body_ske.json"), + cc.url.raw("resources/you_xin/body/body_tex.json"), + cc.url.raw("resources/you_xin/body/body_tex.png"), + ]; + + for (let i = 0, l = this._suitConfigs.length; i < l; ++i) { + for (const partArmatureName of this._suitConfigs[i]) { + // resources/you_xin/suit1/2010600a/xxxxxx + const path = "resources/you_xin/suit" + (i + 1) + "/" + partArmatureName + "/" + partArmatureName; + const dragonBonesJSONPath = path + "_ske.json"; + const textureAtlasJSONPath = path + "_tex.json"; + const textureAtlasPath = path + "_tex.png"; + // + resources.push( + cc.url.raw(dragonBonesJSONPath), + cc.url.raw(textureAtlasJSONPath), + cc.url.raw(textureAtlasPath) + ); + } + } + + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + + for (let i = 0, l = this._suitConfigs.length; i < l; ++i) { + for (const partArmatureName of this._suitConfigs[i]) { + const path = "resources/you_xin/suit" + (i + 1) + "/" + partArmatureName + "/" + partArmatureName; + const dragonBonesJSONPath = cc.url.raw(path + "_ske.json"); + const textureAtlasJSONPath = cc.url.raw(path + "_tex.json"); + const textureAtlasPath = cc.url.raw(path + "_tex.png"); + // + factory.parseDragonBonesData(cc.loader.getRes(dragonBonesJSONPath)); + factory.parseTextureAtlasData(cc.loader.getRes(textureAtlasJSONPath), cc.loader.getRes(textureAtlasPath)); + } + } + // + this._armatureComponent = factory.buildArmatureComponent("body"); + this._armatureComponent.node.on(dragonBones.EventObject.LOOP_COMPLETE, this._animationEventHandler, this); + this._armatureComponent.animation.play("idle", 0); + // + this._armatureComponent.node.x = 0.0; + this._armatureComponent.node.y = -200.0; + this._armatureComponent.node.scaleX = this._armatureComponent.node.scaleY = 0.25; + this.node.addChild(this._armatureComponent.node); + // Init the first suit. + for (const part of this._suitConfigs[0]) { + const partArmatureData = factory.getArmatureData(part); + factory.replaceSkin(this._armatureComponent.armature, partArmatureData.defaultSkin); + } + // + this.node.on(cc.Node.EventType.TOUCH_START, () => { + this._randomReplaceSkin(); + }, this); + }); + } + + private _animationEventHandler(event: cc.Event.EventCustom): void { + // Random animation index. + const animationIndex = Math.floor(Math.random() * this._armatureComponent.animation.animationNames.length); + const animationName = this._armatureComponent.animation.animationNames[animationIndex]; + // Play animation. + this._armatureComponent.animation.fadeIn(animationName, 0.3, 0); + } + + private _randomReplaceSkin(): void { + const factory = dragonBones.CocosFactory.factory; + // This suit has been replaced, next suit. + if (this._replaceSuitParts.length === 0) { + this._replaceSuitIndex++; + + if (this._replaceSuitIndex >= this._suitConfigs.length) { + this._replaceSuitIndex = 0; + } + + // Refill the unset parits. + for (const partArmatureName of this._suitConfigs[this._replaceSuitIndex]) { + this._replaceSuitParts.push(partArmatureName); + } + } + + // Random one part in this suit. + const partIndex = Math.floor(Math.random() * this._replaceSuitParts.length); + const partArmatureName = this._replaceSuitParts[partIndex]; + const partArmatureData = factory.getArmatureData(partArmatureName); + // Replace skin. + factory.replaceSkin(this._armatureComponent.armature, partArmatureData.defaultSkin); + // Remove has been replaced + this._replaceSuitParts.splice(partIndex, 1); + } +} diff --git a/Cocos/Demos/assets/Script/ReplaceSkin.ts.meta b/Cocos/Demos/assets/Script/ReplaceSkin.ts.meta new file mode 100644 index 00000000..582ea861 --- /dev/null +++ b/Cocos/Demos/assets/Script/ReplaceSkin.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "7ed1b9c4-babf-4d7c-bf93-093506b32261", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/ReplaceSlotDisplay.ts b/Cocos/Demos/assets/Script/ReplaceSlotDisplay.ts new file mode 100644 index 00000000..9a4e3ee3 --- /dev/null +++ b/Cocos/Demos/assets/Script/ReplaceSlotDisplay.ts @@ -0,0 +1,80 @@ +@cc._decorator.ccclass +export default class ReplaceSlotDisplay extends cc.Component { + private static readonly WEAPON_RIGHT_LIST: string[] = ["weapon_1004_r", "weapon_1004b_r", "weapon_1004c_r", "weapon_1004d_r", "weapon_1004e_r"]; + + private _leftWeaponIndex: number = 0; + private _rightWeaponIndex: number = 0; + private _armatureComponent: dragonBones.CocosArmatureComponent; + private _logoText: cc.Node; + + start() { + const resources = [ + cc.url.raw("resources/mecha_1004d_show/mecha_1004d_show_ske.json"), + cc.url.raw("resources/mecha_1004d_show/mecha_1004d_show_tex.json"), + cc.url.raw("resources/mecha_1004d_show/mecha_1004d_show_tex.png"), + cc.url.raw("resources/weapon_1004_show/weapon_1004_show_ske.json"), + cc.url.raw("resources/weapon_1004_show/weapon_1004_show_tex.json"), + cc.url.raw("resources/weapon_1004_show/weapon_1004_show_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + factory.parseDragonBonesData(cc.loader.getRes(resources[3])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[4]), cc.loader.getRes(resources[5])); + // + this._armatureComponent = factory.buildArmatureComponent("mecha_1004d"); + this._armatureComponent.animation.play(); + // + this._armatureComponent.node.x = 100.0; + this._armatureComponent.node.y = -200.0; + this.node.addChild(this._armatureComponent.node); + // + this.node.on(cc.Node.EventType.TOUCH_START, (event: cc.Event.EventTouch) => { + const localX = event.getLocationX() - this.node.x; + if (localX < -150.0) { + this._replaceDisplay(-1); + } + else if (localX > 150.0) { + this._replaceDisplay(1); + } + else { + this._replaceDisplay(0); + } + }, this); + }); + } + + private _replaceDisplay(type: number): void { + const factory = dragonBones.CocosFactory.factory; + if (type === -1) { + this._rightWeaponIndex++; + this._rightWeaponIndex %= ReplaceSlotDisplay.WEAPON_RIGHT_LIST.length; + const displayName = ReplaceSlotDisplay.WEAPON_RIGHT_LIST[this._rightWeaponIndex]; + factory.replaceSlotDisplay("weapon_1004_show", "weapon", "weapon_r", displayName, this._armatureComponent.armature.getSlot("weapon_hand_r")); + } + else if (type === 1) { + this._leftWeaponIndex++; + this._leftWeaponIndex %= 5; + this._armatureComponent.armature.getSlot("weapon_hand_l").displayIndex = this._leftWeaponIndex; + } + else { + const logoSlot = this._armatureComponent.armature.getSlot("logo"); + + if (logoSlot.display === this._logoText) { + logoSlot.display = logoSlot.rawDisplay; + } + else { + if (!this._logoText) { + this._logoText = new cc.Node(); + const label = this._logoText.addComponent(cc.Label); + label.string = "Core Element"; + this._logoText.anchorX = 0.5; + this._logoText.anchorY = 0.5; + } + + logoSlot.display = this._logoText; + } + } + } +} diff --git a/Cocos/Demos/assets/Script/ReplaceSlotDisplay.ts.meta b/Cocos/Demos/assets/Script/ReplaceSlotDisplay.ts.meta new file mode 100644 index 00000000..1770dfcd --- /dev/null +++ b/Cocos/Demos/assets/Script/ReplaceSlotDisplay.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "ad05c937-f6d2-4c3a-8c24-157259a46ee4", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/Script/Test.ts b/Cocos/Demos/assets/Script/Test.ts new file mode 100644 index 00000000..32176393 --- /dev/null +++ b/Cocos/Demos/assets/Script/Test.ts @@ -0,0 +1,22 @@ +@cc._decorator.ccclass +export default class Test extends cc.Component { + start() { + const resources = [ + cc.url.raw("resources/test/test_ske.json"), + cc.url.raw("resources/test/test_tex.json"), + cc.url.raw("resources/test/test_tex.png"), + ]; + cc.loader.load(resources, (err, assets) => { + const factory = dragonBones.CocosFactory.factory; + factory.parseDragonBonesData(cc.loader.getRes(resources[0])); + factory.parseTextureAtlasData(cc.loader.getRes(resources[1]), cc.loader.getRes(resources[2])); + + const armatureComponent = factory.buildArmatureComponent("test"); + armatureComponent.animation.play("test"); + + armatureComponent.node.x = 0.0; + armatureComponent.node.y = -200.0; + this.node.addChild(armatureComponent.node); + }); + } +} diff --git a/Cocos/Demos/assets/Script/Test.ts.meta b/Cocos/Demos/assets/Script/Test.ts.meta new file mode 100644 index 00000000..2fed049d --- /dev/null +++ b/Cocos/Demos/assets/Script/Test.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "6a6cbd70-98d1-4c88-badd-e89ad1d5b45d", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources.meta b/Cocos/Demos/assets/resources.meta new file mode 100644 index 00000000..1d81dc3d --- /dev/null +++ b/Cocos/Demos/assets/resources.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "051f6def-1f8b-4f41-940e-3e464cfd1380", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/background.png b/Cocos/Demos/assets/resources/background.png new file mode 100644 index 00000000..c587b0d2 Binary files /dev/null and b/Cocos/Demos/assets/resources/background.png differ diff --git a/Cocos/Demos/assets/resources/background.png.meta b/Cocos/Demos/assets/resources/background.png.meta new file mode 100644 index 00000000..0a2fca51 --- /dev/null +++ b/Cocos/Demos/assets/resources/background.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "109cb12a-45ef-4fca-9982-3c411a39c68e", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "background": { + "ver": "1.0.3", + "uuid": "e3e30dfa-0f13-4276-a6f1-04c9c54ccd11", + "rawTextureUuid": "109cb12a-45ef-4fca-9982-3c411a39c68e", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 2048, + "height": 2048, + "rawWidth": 2048, + "rawHeight": 2048, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bounding_box_tester.meta b/Cocos/Demos/assets/resources/bounding_box_tester.meta new file mode 100644 index 00000000..8bdd0a5e --- /dev/null +++ b/Cocos/Demos/assets/resources/bounding_box_tester.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "991d1e94-339f-460c-ba6b-21557e035420", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_ske.json b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_ske.json new file mode 100644 index 00000000..6eaddc03 --- /dev/null +++ b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_ske.json @@ -0,0 +1 @@ +{"frameRate":24,"name":"bounding_box_tester","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"tester","aabb":{"x":-150,"y":-50,"width":400,"height":100},"bone":[{"inheritRotation":false,"inheritScale":false,"name":"root"},{"length":20,"name":"target_a","parent":"root"},{"length":20,"name":"target_b","parent":"root","transform":{"x":100}},{"length":20,"name":"point_a","parent":"root"},{"length":20,"name":"point_b","parent":"root","transform":{"x":100}},{"length":100,"name":"line","parent":"root"}],"slot":[{"name":"line","parent":"line"},{"name":"point_b","parent":"point_b"},{"name":"point_a","parent":"point_a"},{"name":"target_b","parent":"target_b"},{"name":"target_a","parent":"target_a"}],"skin":[{"name":"","slot":[{"name":"point_b","display":[{"type":"armature","name":"point","transform":{"scX":0.4,"scY":0.4}}]},{"name":"point_a","display":[{"type":"armature","name":"point","transform":{"scX":0.6,"scY":0.6}}]},{"name":"target_b","display":[{"type":"armature","name":"target","transform":{"scX":0.4,"scY":0.4}}]},{"name":"line","display":[{"name":"line","transform":{"x":50,"scX":0.25}}]},{"name":"target_a","display":[{"type":"armature","name":"target","transform":{"scX":0.6,"scY":0.6}}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"1","slot":[{"name":"line","colorFrame":[{"duration":0,"value":{"rM":0,"bM":0}}]}]},{"duration":0,"playTimes":0,"name":"0","slot":[{"name":"line","colorFrame":[{"duration":0,"value":{"gM":0,"bM":0}}]}]}],"defaultActions":[{"gotoAndPlay":"1"}]},{"type":"Armature","frameRate":24,"name":"target","aabb":{"x":-50,"y":-50,"width":100,"height":100},"bone":[{"name":"root"}],"slot":[{"name":"a","parent":"root","color":{"aM":20}},{"name":"b","parent":"root","color":{"aM":80}}],"skin":[{"name":"","slot":[{"name":"b","display":[{"name":"circle","transform":{"scX":0.1,"scY":0.1}}]},{"name":"a","display":[{"name":"circle"}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"1","slot":[{"name":"a","colorFrame":[{"duration":0,"value":{"aM":20,"rM":0,"bM":0}}]},{"name":"b","colorFrame":[{"duration":0,"value":{"aM":80,"rM":0,"bM":0}}]}]},{"duration":0,"playTimes":0,"name":"0","slot":[{"name":"a","colorFrame":[{"duration":0,"value":{"aM":20,"gM":0,"bM":0}}]},{"name":"b","colorFrame":[{"duration":0,"value":{"aM":80,"gM":0,"bM":0}}]}]}],"defaultActions":[{"gotoAndPlay":"1"}]},{"type":"Armature","frameRate":24,"name":"point","aabb":{"x":-175,"y":-50,"width":400,"height":100},"bone":[{"name":"root"}],"slot":[{"name":"circle","parent":"root","color":{"aM":80,"rM":0,"bM":0}},{"name":"line","parent":"root","color":{"rM":0,"bM":0}}],"skin":[{"name":"","slot":[{"name":"circle","display":[{"name":"circle","transform":{"scX":0.1,"scY":0.1}}]},{"name":"line","display":[{"name":"line","transform":{"x":25,"scX":0.125}}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_ske.json.meta b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_ske.json.meta new file mode 100644 index 00000000..6d66b022 --- /dev/null +++ b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "ff2e056a-d84a-49d2-8b7c-5e08c9f607a7", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.json b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.json new file mode 100644 index 00000000..a039ddcd --- /dev/null +++ b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.json @@ -0,0 +1 @@ +{"SubTexture":[{"width":400,"y":1,"height":40,"name":"line","x":1},{"width":100,"y":1,"height":100,"name":"circle","x":403}],"width":512,"height":128,"name":"bounding_box_tester","imagePath":"bounding_box_tester_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.json.meta b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.json.meta new file mode 100644 index 00000000..6d659df8 --- /dev/null +++ b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "873f638a-76dd-47b0-ae41-a6483840874c", + "atlasJson": "{\"SubTexture\":[{\"width\":400,\"y\":1,\"height\":40,\"name\":\"line\",\"x\":1},{\"width\":100,\"y\":1,\"height\":100,\"name\":\"circle\",\"x\":403}],\"width\":512,\"height\":128,\"name\":\"bounding_box_tester\",\"imagePath\":\"bounding_box_tester_tex.png\"}", + "texture": "68d3d675-1012-4985-87b8-66dea6588f19", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.png b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.png new file mode 100644 index 00000000..a670eaae Binary files /dev/null and b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.png differ diff --git a/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.png.meta b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.png.meta new file mode 100644 index 00000000..154de7ea --- /dev/null +++ b/Cocos/Demos/assets/resources/bounding_box_tester/bounding_box_tester_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "68d3d675-1012-4985-87b8-66dea6588f19", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "bounding_box_tester_tex": { + "ver": "1.0.3", + "uuid": "b57c03bd-4b08-4c31-badb-7cb3e36f1fc7", + "rawTextureUuid": "68d3d675-1012-4985-87b8-66dea6588f19", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -4, + "offsetY": 13, + "trimX": 1, + "trimY": 1, + "width": 502, + "height": 100, + "rawWidth": 512, + "rawHeight": 128, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bullet_01.meta b/Cocos/Demos/assets/resources/bullet_01.meta new file mode 100644 index 00000000..24b244c9 --- /dev/null +++ b/Cocos/Demos/assets/resources/bullet_01.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "2b8d53f4-47d1-481a-b3b9-b53c8150175c", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bullet_01/bullet_01_ske.json b/Cocos/Demos/assets/resources/bullet_01/bullet_01_ske.json new file mode 100644 index 00000000..7d0dd04c --- /dev/null +++ b/Cocos/Demos/assets/resources/bullet_01/bullet_01_ske.json @@ -0,0 +1 @@ +{"frameRate":24,"name":"bullet_01","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"bullet_01","aabb":{"x":-64,"y":-10,"width":74,"height":20},"bone":[{"length":20,"name":"root"},{"inheritScale":false,"length":20,"name":"bullet","parent":"root"}],"slot":[{"name":"b","parent":"bullet","color":{"aM":50}}],"skin":[{"name":"","slot":[{"name":"b","display":[{"name":"bullet_01_f/bullet_01","transform":{"x":-27}}]}]}],"animation":[{"duration":12,"name":"idle","bone":[{"name":"bullet","translateFrame":[{"duration":12,"tweenEasing":0},{"duration":0,"x":100}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.1,"y":0.3},{"duration":8,"x":1.8,"y":1.1}]}],"slot":[{"name":"b","colorFrame":[{"duration":2,"tweenEasing":0,"value":{"aM":0}},{"duration":8,"tweenEasing":0,"value":{"aM":50}},{"duration":2,"tweenEasing":0,"value":{"aM":50}},{"duration":0,"value":{"aM":0}}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bullet_01/bullet_01_ske.json.meta b/Cocos/Demos/assets/resources/bullet_01/bullet_01_ske.json.meta new file mode 100644 index 00000000..5e21bfe9 --- /dev/null +++ b/Cocos/Demos/assets/resources/bullet_01/bullet_01_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "f20b62ca-ea90-4235-992a-69ad49575979", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.json b/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.json new file mode 100644 index 00000000..bc5b0aa8 --- /dev/null +++ b/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.json @@ -0,0 +1 @@ +{"SubTexture":[{"width":74,"y":1,"height":20,"name":"bullet_01_f/bullet_01","x":1}],"width":128,"height":32,"name":"bullet_01","imagePath":"bullet_01_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.json.meta b/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.json.meta new file mode 100644 index 00000000..6a38b7e6 --- /dev/null +++ b/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "2a29bd11-005e-4969-a459-bf2834cfe41d", + "atlasJson": "{\"SubTexture\":[{\"width\":74,\"y\":1,\"height\":20,\"name\":\"bullet_01_f/bullet_01\",\"x\":1}],\"width\":128,\"height\":32,\"name\":\"bullet_01\",\"imagePath\":\"bullet_01_tex.png\"}", + "texture": "eac75507-47a5-4482-9497-53621aa3c1cd", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.png b/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.png new file mode 100644 index 00000000..f28c5559 Binary files /dev/null and b/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.png differ diff --git a/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.png.meta b/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.png.meta new file mode 100644 index 00000000..a9488be5 --- /dev/null +++ b/Cocos/Demos/assets/resources/bullet_01/bullet_01_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "eac75507-47a5-4482-9497-53621aa3c1cd", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "bullet_01_tex": { + "ver": "1.0.3", + "uuid": "cf9f0320-91bc-4aee-a09e-567def45039a", + "rawTextureUuid": "eac75507-47a5-4482-9497-53621aa3c1cd", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -26, + "offsetY": 5, + "trimX": 1, + "trimY": 1, + "width": 74, + "height": 20, + "rawWidth": 128, + "rawHeight": 32, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/effect.meta b/Cocos/Demos/assets/resources/effect.meta new file mode 100644 index 00000000..31358557 --- /dev/null +++ b/Cocos/Demos/assets/resources/effect.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "a4508792-d1a0-4fba-8d21-43ec9d046844", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/effect/effect_sd_tex.json b/Cocos/Demos/assets/resources/effect/effect_sd_tex.json new file mode 100644 index 00000000..92c758be --- /dev/null +++ b/Cocos/Demos/assets/resources/effect/effect_sd_tex.json @@ -0,0 +1 @@ +{"width":256,"SubTexture":[{"width":69,"y":207,"height":62,"name":"jiguang","x":74},{"width":10,"y":142,"height":10,"name":"meigui","x":224},{"y":271,"frameWidth":38,"x":74,"frameHeight":38,"width":36,"frameY":-1,"height":36,"name":"zheng","frameX":-1},{"y":271,"frameWidth":38,"x":112,"frameHeight":38,"width":26,"frameY":-6,"height":26,"name":"zheng2","frameX":-6},{"y":1,"frameWidth":90,"x":173,"frameHeight":80,"width":79,"frameY":-11,"height":68,"name":"1 (6)","frameX":-4},{"y":74,"frameWidth":90,"x":86,"frameHeight":80,"width":77,"frameY":-14,"height":64,"name":"1 (3)","frameX":-4},{"y":142,"frameWidth":90,"x":150,"frameHeight":80,"width":72,"frameY":-15,"height":63,"name":"1 (9)","frameX":-3},{"y":1,"frameWidth":90,"x":1,"frameHeight":80,"width":83,"frameY":-2,"height":77,"name":"1 (2)","frameX":-3},{"y":71,"frameWidth":90,"x":173,"frameHeight":80,"width":75,"frameY":-9,"height":69,"name":"1 (1)","frameX":-3},{"y":148,"frameWidth":90,"x":1,"frameHeight":80,"width":71,"frameY":-14,"height":64,"name":"1 (4)","frameX":-4},{"y":207,"frameWidth":90,"x":150,"frameHeight":80,"width":72,"frameY":-16,"height":63,"name":"1 (10)","frameX":-3},{"y":80,"frameWidth":90,"x":1,"frameHeight":80,"width":72,"frameY":-11,"height":66,"name":"1 (8)","frameX":-4},{"y":1,"frameWidth":90,"x":86,"frameHeight":80,"width":85,"frameY":-6,"height":71,"name":"1 (7)","frameX":-4},{"y":140,"frameWidth":90,"x":75,"frameHeight":80,"width":73,"frameY":-14,"height":65,"name":"1 (5)","frameX":-4}],"height":512,"name":"effect_sd","imagePath":"effect_sd_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/effect/effect_sd_tex.json.meta b/Cocos/Demos/assets/resources/effect/effect_sd_tex.json.meta new file mode 100644 index 00000000..f1613a82 --- /dev/null +++ b/Cocos/Demos/assets/resources/effect/effect_sd_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "231d282d-91ee-46e1-848b-666554d32c6c", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":69,\"y\":207,\"height\":62,\"name\":\"jiguang\",\"x\":74},{\"width\":10,\"y\":142,\"height\":10,\"name\":\"meigui\",\"x\":224},{\"y\":271,\"frameWidth\":38,\"x\":74,\"frameHeight\":38,\"width\":36,\"frameY\":-1,\"height\":36,\"name\":\"zheng\",\"frameX\":-1},{\"y\":271,\"frameWidth\":38,\"x\":112,\"frameHeight\":38,\"width\":26,\"frameY\":-6,\"height\":26,\"name\":\"zheng2\",\"frameX\":-6},{\"y\":1,\"frameWidth\":90,\"x\":173,\"frameHeight\":80,\"width\":79,\"frameY\":-11,\"height\":68,\"name\":\"1 (6)\",\"frameX\":-4},{\"y\":74,\"frameWidth\":90,\"x\":86,\"frameHeight\":80,\"width\":77,\"frameY\":-14,\"height\":64,\"name\":\"1 (3)\",\"frameX\":-4},{\"y\":142,\"frameWidth\":90,\"x\":150,\"frameHeight\":80,\"width\":72,\"frameY\":-15,\"height\":63,\"name\":\"1 (9)\",\"frameX\":-3},{\"y\":1,\"frameWidth\":90,\"x\":1,\"frameHeight\":80,\"width\":83,\"frameY\":-2,\"height\":77,\"name\":\"1 (2)\",\"frameX\":-3},{\"y\":71,\"frameWidth\":90,\"x\":173,\"frameHeight\":80,\"width\":75,\"frameY\":-9,\"height\":69,\"name\":\"1 (1)\",\"frameX\":-3},{\"y\":148,\"frameWidth\":90,\"x\":1,\"frameHeight\":80,\"width\":71,\"frameY\":-14,\"height\":64,\"name\":\"1 (4)\",\"frameX\":-4},{\"y\":207,\"frameWidth\":90,\"x\":150,\"frameHeight\":80,\"width\":72,\"frameY\":-16,\"height\":63,\"name\":\"1 (10)\",\"frameX\":-3},{\"y\":80,\"frameWidth\":90,\"x\":1,\"frameHeight\":80,\"width\":72,\"frameY\":-11,\"height\":66,\"name\":\"1 (8)\",\"frameX\":-4},{\"y\":1,\"frameWidth\":90,\"x\":86,\"frameHeight\":80,\"width\":85,\"frameY\":-6,\"height\":71,\"name\":\"1 (7)\",\"frameX\":-4},{\"y\":140,\"frameWidth\":90,\"x\":75,\"frameHeight\":80,\"width\":73,\"frameY\":-14,\"height\":65,\"name\":\"1 (5)\",\"frameX\":-4}],\"height\":512,\"name\":\"effect_sd\",\"imagePath\":\"effect_sd_tex.png\"}", + "texture": "5cdd371a-6ea2-4f71-83de-d2b729723f35", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/effect/effect_sd_tex.png b/Cocos/Demos/assets/resources/effect/effect_sd_tex.png new file mode 100644 index 00000000..5da02671 Binary files /dev/null and b/Cocos/Demos/assets/resources/effect/effect_sd_tex.png differ diff --git a/Cocos/Demos/assets/resources/effect/effect_sd_tex.png.meta b/Cocos/Demos/assets/resources/effect/effect_sd_tex.png.meta new file mode 100644 index 00000000..67d07388 --- /dev/null +++ b/Cocos/Demos/assets/resources/effect/effect_sd_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "5cdd371a-6ea2-4f71-83de-d2b729723f35", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "effect_sd_tex": { + "ver": "1.0.3", + "uuid": "91381713-dd1f-4524-b086-f38249572a21", + "rawTextureUuid": "5cdd371a-6ea2-4f71-83de-d2b729723f35", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -1.5, + "offsetY": 102.5, + "trimX": 1, + "trimY": 1, + "width": 251, + "height": 305, + "rawWidth": 256, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/effect/effect_ske.json b/Cocos/Demos/assets/resources/effect/effect_ske.json new file mode 100644 index 00000000..7243ecc4 --- /dev/null +++ b/Cocos/Demos/assets/resources/effect/effect_ske.json @@ -0,0 +1 @@ +{"frameRate":30,"name":"effect","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"flower","aabb":{"x":-316.56,"y":-256.95,"width":505.88,"height":310.08},"bone":[{"name":"root","transform":{"y":-89.1136}},{"name":"hua","parent":"root","transform":{"x":-1.2207,"y":95.86095}},{"name":"roo2","parent":"root","transform":{"x":-122.72615,"y":99.615}},{"name":"JG","parent":"roo2","transform":{"x":48.5738}},{"name":"MG","parent":"roo2","transform":{"x":11.66245,"y":0.09285,"skX":-5.93,"skY":-5.93}},{"name":"zhen","parent":"roo2","transform":{"x":120.51,"y":-6.995,"skX":-0.06,"skY":-0.06,"scX":6.875,"scY":2.385}},{"name":"zheng3","parent":"roo2","transform":{"x":123.96,"y":-30.985,"scY":0.4}},{"name":"jiguang4","parent":"JG","transform":{"x":-64.595,"y":-205.955,"scX":0.663,"scY":0.461}},{"name":"jiguang3","parent":"JG","transform":{"x":38.125,"y":-181.45,"scX":0.83,"scY":0.458}},{"name":"jiguang","parent":"JG","transform":{"x":194.98,"y":-113.8,"scX":0.799,"scY":0.632}},{"name":"jiguang2","parent":"JG","transform":{"x":53.045,"y":-137.18,"scX":1.013,"scY":1.097}},{"name":"jiguang8","parent":"JG","transform":{"x":-3.45,"y":-103.625,"scX":0.335,"scY":0.363}},{"name":"jiguang9","parent":"JG","transform":{"x":76.46,"y":-97.71,"scX":0.429,"scY":0.288}},{"name":"jiguang10","parent":"JG","transform":{"x":140.585,"y":-85.875,"scX":0.448,"scY":0.245}},{"name":"jiguang11","parent":"JG","transform":{"x":180.375,"y":-95.47,"scX":0.47,"scY":0.209}},{"name":"jiguang7","parent":"JG","transform":{"x":186.32,"y":-176.64,"scX":0.737,"scY":0.562}},{"name":"jiguang5","parent":"JG","transform":{"x":74.91,"y":-126.865,"scX":1.021,"scY":0.438}},{"name":"jiguang6","parent":"JG","transform":{"x":-54.655,"y":-131.37,"scX":0.737,"scY":0.562}},{"name":"jiguang12","parent":"JG","transform":{"x":-173.905,"y":-189.055,"scX":0.598,"scY":0.531}},{"name":"meigui4","parent":"MG","transform":{"x":76.075,"y":-172.265,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui5","parent":"MG","transform":{"x":10.4,"y":-173.51,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui6","parent":"MG","transform":{"x":148.425,"y":-166.045,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui7","parent":"MG","transform":{"x":222.04,"y":-146.435,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui8","parent":"MG","transform":{"x":114.085,"y":-161.615,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui9","parent":"MG","transform":{"x":98.955,"y":-174.72,"skX":-9.41,"skY":-9.41,"scX":1.146,"scY":1.146}},{"name":"meigui10","parent":"MG","transform":{"x":172.865,"y":-145.485,"skX":-9.41,"skY":-9.41,"scX":0.529,"scY":0.529}},{"name":"meigui11","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui12","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui13","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui14","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui","parent":"MG","transform":{"x":53.23,"y":-163.915,"scX":1.111,"scY":1.111}},{"name":"zhen1","parent":"zhen"},{"name":"zhen2","parent":"zhen"},{"name":"meigui2","parent":"MG","transform":{"x":128.11,"y":-172.61,"skX":-57.56,"skY":-57.56,"scX":1.151,"scY":1.151}},{"name":"zzz","parent":"zheng3","transform":{"x":-1.2334}},{"name":"meigui3","parent":"MG","transform":{"x":184.74,"y":-156.28,"skX":-9.41,"skY":-9.41,"scX":1.103,"scY":1.103}}],"slot":[{"blendMode":"add","name":"jiguang12","parent":"jiguang11","color":{"aM":72,"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang9","parent":"jiguang8","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang10","parent":"jiguang9","color":{"aM":81,"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang11","parent":"jiguang10","color":{"aM":40,"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang2","parent":"jiguang2","color":{"rM":25,"gM":20}},{"blendMode":"add","name":"jiguang6","parent":"jiguang6","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang","parent":"jiguang"},{"blendMode":"add","name":"jiguang13","parent":"jiguang12","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang7","parent":"jiguang4","color":{"rM":74,"gM":0}},{"blendMode":"add","name":"jiguang5","parent":"jiguang5"},{"blendMode":"add","name":"jiguang3","parent":"jiguang3"},{"blendMode":"add","name":"jiguang8","parent":"jiguang7","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"meigui","parent":"meigui"},{"blendMode":"add","name":"meigui12","parent":"meigui"},{"blendMode":"add","name":"meigui2","parent":"meigui2"},{"blendMode":"add","displayIndex":-1,"name":"meigui3","parent":"meigui3"},{"blendMode":"add","displayIndex":-1,"name":"meigui4","parent":"meigui4"},{"blendMode":"add","displayIndex":-1,"name":"meigui5","parent":"meigui5"},{"blendMode":"add","displayIndex":-1,"name":"meigui13","parent":"meigui5"},{"blendMode":"add","name":"meigui6","parent":"meigui6"},{"blendMode":"add","name":"meigui7","parent":"meigui7"},{"blendMode":"add","displayIndex":-1,"name":"meigui8","parent":"meigui8"},{"blendMode":"add","name":"meigui9","parent":"meigui9"},{"blendMode":"add","displayIndex":-1,"name":"meigui10","parent":"meigui10"},{"blendMode":"add","displayIndex":-1,"name":"meigui11","parent":"meigui11"},{"blendMode":"add","displayIndex":-1,"name":"meigui14","parent":"meigui12"},{"blendMode":"add","displayIndex":-1,"name":"meigui15","parent":"meigui13"},{"blendMode":"add","displayIndex":-1,"name":"meigui16","parent":"meigui14"},{"blendMode":"add","displayIndex":-1,"name":"zheng","parent":"zhen1"},{"blendMode":"add","displayIndex":-1,"name":"zheng2","parent":"zhen2"},{"blendMode":"add","displayIndex":-1,"name":"zheng3","parent":"zzz"},{"name":"sprite","parent":"hua"}],"skin":[{"slot":[{"name":"meigui12","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[-112.33,33.09,130.41,35.44,130.41,-210.84,-112.33,-213.19],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"meigui16","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui7","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui5","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[-91.11,-46.78,-97.64,-51.68,-95.37,-59.1,-87.14,-55.23,-94.33,-56.63,-92.13,-49.06,-93.57,-52.95],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang3","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang10","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"sprite","display":[{"type":"armature","name":"sprite","transform":{"x":9.52,"y":-33.63},"path":"sprite"}]},{"name":"meigui11","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui2","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang11","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"zheng","display":[{"name":"zheng"}]},{"name":"meigui8","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui13","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang8","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang2","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[209.72,50.23,-180.44,50.23,-180.44,-156.77,209.72,-156.77],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"meigui14","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui3","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang13","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[205.06,63.9,-52.94,63.9,-52.94,-167.1,205.06,-167.1],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang7","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang12","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"zheng2","display":[{"name":"zheng"}]},{"name":"meigui9","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui6","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[100.17,22.33,95.16,21.3,94.47,16.48,100.17,16.48,95.72,17.61,98.98,21.31,97.13,19.5],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang6","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"meigui15","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui4","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang5","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[148.01,35.84,-109.98,35.84,-109.98,-195.16,148.02,-195.16],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang9","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"zheng3","display":[{"name":"zheng2"}]},{"name":"meigui10","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]}]}],"animation":[{"duration":110,"name":"skill","frame":[{"duration":0,"events":[{"name":"playse"}]}],"bone":[{"name":"jiguang","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-28.8},{"duration":26,"tweenEasing":0},{"duration":16,"tweenEasing":0,"y":94.69},{"duration":15,"y":114.63}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":26,"tweenEasing":0},{"duration":16,"tweenEasing":0,"y":2.81},{"duration":15,"y":2.17}]},{"name":"jiguang2","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-36.83},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":54.82},{"duration":17,"y":76.35}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":2.81},{"duration":17,"y":2.17}]},{"name":"jiguang3","translateFrame":[{"duration":39,"tweenEasing":0,"y":-14.01},{"duration":25,"tweenEasing":0},{"duration":26,"tweenEasing":0,"y":177.79},{"duration":20,"y":213.84}],"scaleFrame":[{"duration":39,"tweenEasing":0,"y":0.4},{"duration":25,"tweenEasing":0,"y":1.54},{"duration":26,"tweenEasing":0,"y":3.55},{"duration":20,"y":1.9}]},{"name":"jiguang4","translateFrame":[{"duration":39,"tweenEasing":0,"y":5.39},{"duration":25,"tweenEasing":0,"y":26.44},{"duration":21,"tweenEasing":0,"y":146.04},{"duration":25,"y":184.43}],"scaleFrame":[{"duration":39,"tweenEasing":0,"y":0.27},{"duration":25,"tweenEasing":0},{"duration":21,"tweenEasing":0,"x":1.2,"y":5.46},{"duration":25,"y":2.49}]},{"name":"jiguang5","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-25.44},{"duration":13,"tweenEasing":0},{"duration":39,"tweenEasing":0,"y":50.35},{"duration":5,"y":114.63}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":13,"tweenEasing":0},{"duration":39,"tweenEasing":0,"y":4.76},{"duration":5,"y":2.18}]},{"name":"jiguang6","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-27.58},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":94.69},{"duration":17,"y":114.63}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":2.81},{"duration":17,"y":2.17}]},{"name":"jiguang7","translateFrame":[{"duration":39,"tweenEasing":0,"y":-33.84},{"duration":25,"tweenEasing":0},{"duration":36,"tweenEasing":0,"y":139.54},{"duration":10,"y":184.43}],"scaleFrame":[{"duration":39,"tweenEasing":0},{"duration":25,"tweenEasing":0,"y":3.51},{"duration":36,"tweenEasing":0,"y":3.55},{"duration":10,"y":2.49}]},{"name":"jiguang8","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":15,"tweenEasing":0,"y":-61.98},{"duration":15,"tweenEasing":0,"y":9.89},{"duration":17,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.51},{"duration":15,"tweenEasing":0,"y":1.86},{"duration":15,"tweenEasing":0,"y":3.68},{"duration":17,"y":1.83}]},{"name":"jiguang9","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":15,"tweenEasing":0,"y":-61.98},{"duration":32,"tweenEasing":0,"y":9.89},{"duration":0,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.53},{"duration":15,"tweenEasing":0,"y":1.86},{"duration":32,"tweenEasing":0,"y":3.7},{"duration":0,"y":1.84}]},{"name":"jiguang10","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":17,"tweenEasing":0,"y":-61.98},{"duration":25,"tweenEasing":0,"y":9.89},{"duration":5,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.51},{"duration":17,"tweenEasing":0,"y":1.86},{"duration":25,"tweenEasing":0,"y":3.7},{"duration":5,"y":1.84}]},{"name":"jiguang11","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":15,"tweenEasing":0,"y":-61.98},{"duration":15,"tweenEasing":0,"y":9.89},{"duration":17,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.54},{"duration":15,"tweenEasing":0,"y":1.86},{"duration":15,"tweenEasing":0,"y":3.7},{"duration":17,"y":1.84}]},{"name":"jiguang12","translateFrame":[{"duration":40,"tweenEasing":0,"y":-10.34},{"duration":24,"tweenEasing":0},{"duration":21,"tweenEasing":0,"y":139.54},{"duration":25,"y":184.43}],"scaleFrame":[{"duration":40,"tweenEasing":0,"y":0.25},{"duration":24,"tweenEasing":0},{"duration":21,"tweenEasing":0,"y":3.55},{"duration":25,"y":2.49}]},{"name":"meigui","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":82,"tweenEasing":0,"x":-22,"y":-82.62},{"duration":23,"x":73.47,"y":190.1}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":82,"tweenEasing":0},{"duration":23,"rotate":-71.26}],"scaleFrame":[{"duration":5,"tweenEasing":0},{"duration":82,"tweenEasing":0},{"duration":23,"x":0.29}]},{"name":"meigui2","translateFrame":[{"duration":23,"tweenEasing":0},{"duration":72,"tweenEasing":0,"x":-158.4,"y":-48.2},{"duration":15,"x":-88.77,"y":151.79}],"rotateFrame":[{"duration":23,"tweenEasing":0},{"duration":72,"tweenEasing":0,"rotate":134.69},{"duration":15,"rotate":34.01}]},{"name":"meigui3","translateFrame":[{"duration":40,"tweenEasing":0},{"duration":70,"tweenEasing":0,"x":-80.15,"y":-60.77},{"duration":0,"x":18.74,"y":134.04}],"rotateFrame":[{"duration":40,"tweenEasing":0},{"duration":70,"tweenEasing":0,"rotate":-19.05},{"duration":0,"rotate":-52.29}],"scaleFrame":[{"duration":40,"tweenEasing":0},{"duration":70,"tweenEasing":0},{"duration":0,"x":0.54,"y":1.23}]},{"name":"meigui4","translateFrame":[{"duration":45,"tweenEasing":0},{"duration":55,"tweenEasing":0,"x":-77.82,"y":-37.37},{"duration":10,"x":17.57,"y":106}],"rotateFrame":[{"duration":45,"tweenEasing":0},{"duration":55,"tweenEasing":0},{"duration":10,"rotate":-25.04}]},{"name":"meigui5","translateFrame":[{"duration":42,"tweenEasing":0},{"duration":54,"tweenEasing":0,"x":42.56,"y":22.81},{"duration":14,"x":138.97,"y":149.95}],"rotateFrame":[{"duration":42,"tweenEasing":0},{"duration":54,"tweenEasing":0,"rotate":1.39},{"duration":14,"rotate":-43.42}]},{"name":"meigui6","translateFrame":[{"duration":41,"tweenEasing":0,"x":-185,"y":-40.92},{"duration":11,"tweenEasing":0,"x":-116.91,"y":86.74},{"duration":45,"tweenEasing":0,"x":-225.07,"y":-68.34},{"duration":13,"x":-166.09,"y":78.05}],"rotateFrame":[{"duration":110,"rotate":-29.87}]},{"name":"meigui7","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":71,"tweenEasing":0,"x":-230.82,"y":-98.22},{"duration":26,"x":110.11,"y":172.15}],"rotateFrame":[{"duration":13,"tweenEasing":0},{"duration":71,"tweenEasing":0},{"duration":26,"rotate":-57.52}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":71,"tweenEasing":0,"x":2.01,"y":2.01},{"duration":26,"x":0.89,"y":0.89}]},{"name":"meigui8","translateFrame":[{"duration":60,"tweenEasing":0},{"duration":24,"tweenEasing":0,"x":15.4,"y":-64.94},{"duration":23,"tweenEasing":0,"x":15.4,"y":-64.94},{"duration":3,"x":95.14,"y":57.8}],"rotateFrame":[{"duration":84,"tweenEasing":0},{"duration":23,"tweenEasing":0},{"duration":3,"rotate":-87.86}],"scaleFrame":[{"duration":60,"tweenEasing":0},{"duration":24,"tweenEasing":0},{"duration":23,"tweenEasing":0,"x":0.54},{"duration":3}]},{"name":"meigui9","translateFrame":[{"duration":14,"tweenEasing":0},{"duration":66,"tweenEasing":0,"x":-63.98,"y":-75.86},{"duration":30,"x":10.98,"y":54.38}],"rotateFrame":[{"duration":14,"tweenEasing":0},{"duration":66,"tweenEasing":0},{"duration":30,"rotate":-37.05}],"scaleFrame":[{"duration":14,"tweenEasing":0},{"duration":66,"tweenEasing":0,"x":0.5,"y":0.5},{"duration":30,"x":0.44,"y":0.44}]},{"name":"meigui10","translateFrame":[{"duration":41,"tweenEasing":0},{"duration":32,"tweenEasing":0,"x":-105.16,"y":-77.08},{"duration":36,"tweenEasing":0,"x":-105.16,"y":-77.08},{"x":60.47,"y":195.9}],"rotateFrame":[{"duration":41,"tweenEasing":0},{"duration":32,"tweenEasing":0},{"duration":36,"tweenEasing":0,"rotate":-49.87},{"rotate":-133.85}],"scaleFrame":[{"duration":41,"tweenEasing":0},{"duration":32,"tweenEasing":0},{"duration":36,"tweenEasing":0,"x":0.5,"y":1.82},{"x":1.56,"y":1.82}]},{"name":"meigui11","translateFrame":[{"duration":61,"tweenEasing":0},{"duration":49,"tweenEasing":0,"x":-41.54,"y":-52.83},{"duration":0,"x":107.18,"y":100.08}],"rotateFrame":[{"duration":61,"tweenEasing":0},{"duration":49,"tweenEasing":0},{"duration":0,"rotate":-48.84}],"scaleFrame":[{"duration":61,"tweenEasing":0},{"duration":49,"tweenEasing":0,"x":0.78,"y":2.37},{"duration":0,"x":2.33,"y":2.37}]},{"name":"zhen1","translateFrame":[{"duration":43,"tweenEasing":0},{"duration":67,"y":0.97}],"rotateFrame":[{"duration":43,"tweenEasing":0},{"duration":57,"tweenEasing":0},{"duration":10,"rotate":54.95}],"scaleFrame":[{"duration":43,"tweenEasing":0},{"duration":57,"tweenEasing":0,"x":0.89,"y":0.89},{"duration":10,"x":1.22,"y":1.22}]},{"name":"zhen2","translateFrame":[{"duration":43,"tweenEasing":0},{"duration":67,"y":0.97}],"rotateFrame":[{"duration":43,"tweenEasing":0},{"duration":22,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":23.13},{"duration":15,"rotate":54.95}],"scaleFrame":[{"duration":43,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.89,"y":0.89},{"duration":30,"tweenEasing":0,"x":1.03,"y":1.03},{"duration":15,"x":1.53,"y":1.53}]},{"name":"meigui12","translateFrame":[{"duration":75,"tweenEasing":0},{"duration":35,"tweenEasing":0,"x":-55.5,"y":-67.15},{"duration":0,"x":-7.89,"y":-9.12}],"scaleFrame":[{"duration":75,"tweenEasing":0},{"duration":35,"tweenEasing":0},{"duration":0,"x":2.13,"y":2.13}]},{"name":"meigui13","translateFrame":[{"duration":66,"tweenEasing":0},{"duration":34,"tweenEasing":0,"x":43.72,"y":-53.51},{"duration":10,"x":94.5,"y":-10.07}],"rotateFrame":[{"duration":66,"tweenEasing":0},{"duration":34,"tweenEasing":0},{"duration":10,"rotate":-19.75}],"scaleFrame":[{"duration":66,"tweenEasing":0},{"duration":34,"tweenEasing":0,"x":1.98,"y":1.98},{"duration":10,"x":0.96,"y":0.96}]},{"name":"meigui14","translateFrame":[{"duration":77,"tweenEasing":0},{"duration":33,"tweenEasing":0,"x":132.75,"y":-44.2},{"duration":0,"x":188.19,"y":12.82}],"rotateFrame":[{"duration":77,"tweenEasing":0},{"duration":33,"tweenEasing":0,"rotate":28.72},{"duration":0,"rotate":-53.72}],"scaleFrame":[{"duration":77,"tweenEasing":0},{"duration":33,"x":1.54,"y":1.54}]},{"name":"zheng3","translateFrame":[{"duration":110,"x":2.08,"y":22.52}],"scaleFrame":[{"duration":110,"x":7.47,"y":5.65}]},{"name":"zzz","rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":82.31},{"duration":10,"curve":[0.2295,0.375,0.6765,0.825]},{"duration":55,"curve":[0.283,0.49,0.761,1],"rotate":-35.64},{"duration":5,"rotate":-124.39}],"scaleFrame":[{"duration":20,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.34,"y":0.34},{"duration":55,"curve":[0.283,0.49,0.761,1],"x":0.85,"y":0.85},{"duration":5,"x":1.5,"y":1.5}]},{"name":"hua","scaleFrame":[{"duration":20},{"duration":30,"tweenEasing":0,"x":0.25,"y":0.25},{"duration":60,"tweenEasing":0,"x":1.1,"y":1.1},{"duration":0,"x":2,"y":1.7}]}],"slot":[{"name":"jiguang","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0}},{"duration":26},{"duration":16,"tweenEasing":0},{"duration":15,"value":{"aM":0}}]},{"name":"jiguang2","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0,"rM":25,"gM":19}},{"duration":26,"value":{"rM":25,"gM":19}},{"duration":14,"tweenEasing":0,"value":{"rM":25,"gM":19}},{"duration":17,"value":{"aM":0,"rM":25,"gM":19}}]},{"name":"jiguang3","colorFrame":[{"duration":39,"tweenEasing":0,"value":{"aM":0}},{"duration":25},{"duration":26,"tweenEasing":0},{"duration":20,"value":{"aM":0}}]},{"name":"jiguang5","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0}},{"duration":13},{"duration":39,"tweenEasing":0},{"duration":5,"value":{"aM":0}}]},{"name":"jiguang6","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0,"rM":65,"gM":0}},{"duration":26,"value":{"rM":65,"gM":0}},{"duration":14,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":17,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang7","colorFrame":[{"duration":39,"tweenEasing":0,"value":{"aM":0,"rM":74,"gM":0}},{"duration":25,"value":{"rM":74,"gM":0}},{"duration":21,"tweenEasing":0,"value":{"rM":74,"gM":0}},{"duration":25,"value":{"aM":0,"rM":74,"gM":0}}]},{"name":"jiguang8","colorFrame":[{"duration":39,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":25,"value":{"rM":65,"gM":0}},{"duration":36,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":10,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang9","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":15,"value":{"rM":65,"gM":0}},{"duration":15,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":17,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang10","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":15,"tweenEasing":0,"value":{"aM":80,"rM":65,"gM":0}},{"duration":32,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":0,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang11","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":17,"value":{"rM":65,"gM":0}},{"duration":25,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":5,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang12","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":15,"value":{"aM":72,"rM":65,"gM":0}},{"duration":15,"tweenEasing":0,"value":{"aM":72,"rM":65,"gM":0}},{"duration":17,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang13","colorFrame":[{"duration":40,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":27,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":43,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"meigui","displayFrame":[{"duration":5,"value":-1},{"duration":105}],"colorFrame":[{"duration":5,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":{"aM":0}},{"duration":16},{"duration":32,"tweenEasing":0},{"duration":23,"value":{"aM":0}}]},{"name":"meigui2","displayFrame":[{"duration":23,"value":-1},{"duration":87}],"colorFrame":[{"duration":23,"tweenEasing":0},{"duration":27,"tweenEasing":0,"value":{"aM":0}},{"duration":25},{"duration":20,"tweenEasing":0},{"duration":15,"value":{"aM":0}}]},{"name":"meigui3","displayFrame":[{"duration":40,"value":-1},{"duration":70}],"colorFrame":[{"duration":40,"tweenEasing":0},{"duration":28,"tweenEasing":0,"value":{"aM":0}},{"duration":22},{"duration":20,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"meigui4","displayFrame":[{"duration":45,"value":-1},{"duration":65}],"colorFrame":[{"duration":45,"tweenEasing":0},{"duration":30,"tweenEasing":0,"value":{"aM":0}},{"duration":25,"tweenEasing":0},{"duration":10,"value":{"aM":0}}]},{"name":"meigui5","displayFrame":[{"duration":42,"value":-1},{"duration":68}],"colorFrame":[{"duration":42,"tweenEasing":0},{"duration":27,"tweenEasing":0,"value":{"aM":0}},{"duration":27,"tweenEasing":0},{"duration":14,"value":{"aM":0}}]},{"name":"meigui6","colorFrame":[{"duration":22,"tweenEasing":0,"value":{"aM":0}},{"duration":19,"tweenEasing":0},{"duration":11,"value":{"aM":0}},{"duration":22,"tweenEasing":0,"value":{"aM":0}},{"duration":23,"tweenEasing":0},{"duration":13,"value":{"aM":0}}]},{"name":"meigui7","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":38,"tweenEasing":0,"value":{"aM":0}},{"duration":33,"tweenEasing":0},{"duration":26,"value":{"aM":0}}]},{"name":"meigui8","displayFrame":[{"duration":60,"value":-1},{"duration":50}],"colorFrame":[{"duration":60,"tweenEasing":0},{"duration":24,"tweenEasing":0,"value":{"aM":0}},{"duration":23,"tweenEasing":0},{"duration":3,"value":{"aM":0}}]},{"name":"meigui9","displayFrame":[{"duration":14,"value":-1},{"duration":96}],"colorFrame":[{"duration":14,"tweenEasing":0},{"duration":25,"tweenEasing":0,"value":{"aM":0}},{"duration":41,"tweenEasing":0},{"duration":30,"value":{"aM":0}}]},{"name":"meigui10","displayFrame":[{"duration":41,"value":-1},{"duration":69}],"colorFrame":[{"duration":41,"tweenEasing":0},{"duration":24,"tweenEasing":0,"value":{"aM":0}},{"duration":25},{"duration":19,"tweenEasing":0},{"value":{"aM":0}}]},{"name":"meigui11","displayFrame":[{"duration":61,"value":-1},{"duration":49}],"colorFrame":[{"duration":61,"tweenEasing":0},{"duration":26,"tweenEasing":0,"value":{"aM":0}},{"duration":23,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"meigui12","displayFrame":[{"duration":5,"value":-1},{"duration":105}],"colorFrame":[{"duration":5,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":{"aM":0}},{"duration":16},{"duration":32,"tweenEasing":0},{"duration":23,"value":{"aM":0}}]},{"name":"meigui13","colorFrame":[{"duration":42,"tweenEasing":0},{"duration":27,"tweenEasing":0,"value":{"aM":0}},{"duration":27,"tweenEasing":0},{"duration":14,"value":{"aM":0}}]},{"name":"meigui14","displayFrame":[{"duration":75,"value":-1},{"duration":35}],"colorFrame":[{"duration":76,"tweenEasing":0},{"duration":34,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"meigui15","displayFrame":[{"duration":66,"value":-1},{"duration":44}],"colorFrame":[{"duration":68,"tweenEasing":0},{"duration":32,"tweenEasing":0},{"duration":10,"value":{"aM":0}}]},{"name":"meigui16","displayFrame":[{"duration":77,"value":-1},{"duration":33}],"colorFrame":[{"duration":83,"tweenEasing":0},{"duration":27,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"zheng","displayFrame":[{"duration":43,"value":-1},{"duration":67}],"colorFrame":[{"duration":43,"tweenEasing":0},{"duration":22,"tweenEasing":0,"value":{"aM":0}},{"duration":35,"tweenEasing":0,"value":{"aM":47,"rM":94,"bM":94}},{"duration":10,"value":{"aM":0}}]},{"name":"zheng2","displayFrame":[{"duration":55,"value":-1},{"duration":55}],"colorFrame":[{"duration":55,"tweenEasing":0},{"duration":10,"tweenEasing":0,"value":{"aM":0}},{"duration":30,"tweenEasing":0,"value":{"aM":56}},{"duration":15,"value":{"aM":0}}]},{"name":"zheng3","displayFrame":[{"duration":20,"value":-1},{"duration":90}],"colorFrame":[{"duration":20,"tweenEasing":0},{"duration":30,"tweenEasing":0,"value":{"aM":0}},{"duration":20,"tweenEasing":0,"value":{"aM":22}},{"duration":35,"tweenEasing":0,"value":{"aM":80}},{"duration":5,"value":{"aM":0}}]},{"name":"sprite","displayFrame":[{"duration":20,"value":-1},{"duration":90,"actions":[{"gotoAndPlay":"sprite"}]}],"colorFrame":[{"duration":20},{"duration":30,"tweenEasing":0,"value":{"aM":0}},{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]}],"ffd":[{"name":"jiguang","slot":"jiguang","frame":[{"duration":79},{"duration":16,"tweenEasing":0},{"duration":15,"offset":5,"vertices":[141.47,0,141.47]}]},{"name":"jiguang","slot":"jiguang3","frame":[{"duration":64},{"duration":26,"tweenEasing":0},{"duration":20,"offset":5,"vertices":[169.85,0,169.85]}]},{"name":"jiguang","slot":"jiguang7","frame":[{"duration":64},{"duration":21,"tweenEasing":0},{"duration":25,"offset":5,"vertices":[122.89,0,122.89]}]},{"name":"jiguang","slot":"jiguang8","frame":[{"duration":64},{"duration":36,"tweenEasing":0},{"duration":10,"offset":5,"vertices":[127.94,0,127.94]}]},{"name":"meigui","slot":"meigui2","frame":[{"duration":23,"tweenEasing":0},{"duration":87,"vertices":[-1.93,-2.42,1.8,-1.65,2.33,1.95,-1.93,1.95,1.39,1.11,-1.05,-1.65,0.34,-0.29]}]},{"name":"meigui","slot":"meigui5","frame":[{"duration":42,"tweenEasing":0},{"duration":68,"vertices":[225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98]}]},{"name":"meigui","slot":"meigui6","frame":[{"duration":41,"tweenEasing":0},{"duration":11,"tweenEasing":0,"vertices":[2.77,-4.16,3.42,1.98,-1.86,4.53,-3.95,-2.02,-1.02,2.68,2.03,-2.42,0.62,0.37]},{"duration":45,"tweenEasing":0},{"duration":13,"vertices":[2.77,-4.16,3.42,1.98,-1.86,4.53,-3.95,-2.02,-1.02,2.68,2.03,-2.42,0.62,0.37]}]},{"name":"meigui","slot":"meigui13","frame":[{"duration":42},{"duration":53,"tweenEasing":0,"vertices":[112.61,-72.01,112.69,-72.31,111.03,-65.67,110.53,-63.65,111.33,-66.83,112.35,-70.97,111.86,-69.03]},{"duration":15,"vertices":[225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98]}]}]}],"defaultActions":[{"gotoAndPlay":"skill"}]},{"type":"Sheet","frameRate":10,"name":"sprite","aabb":{"x":-90,"y":-80,"width":180,"height":160},"bone":[{"name":"root"}],"slot":[{"name":"sheetSlot","parent":"root"}],"skin":[{"slot":[{"name":"sheetSlot","display":[{"name":"1 (1)"},{"name":"1 (2)"},{"name":"1 (3)"},{"name":"1 (4)"},{"name":"1 (5)"},{"name":"1 (6)"},{"name":"1 (7)"},{"name":"1 (8)"},{"name":"1 (9)"},{"name":"1 (10)"}]}]}],"animation":[{"duration":10,"playTimes":0,"name":"sprite","slot":[{"name":"sheetSlot","displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"value":5},{"value":6},{"value":7},{"value":8},{"value":9}]}]}],"defaultActions":[{"gotoAndPlay":"sprite"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/effect/effect_ske.json.meta b/Cocos/Demos/assets/resources/effect/effect_ske.json.meta new file mode 100644 index 00000000..42d638c1 --- /dev/null +++ b/Cocos/Demos/assets/resources/effect/effect_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "519f3c44-7451-48be-8643-85fe1799bcbd", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/effect/effect_tex.json b/Cocos/Demos/assets/resources/effect/effect_tex.json new file mode 100644 index 00000000..27b04611 --- /dev/null +++ b/Cocos/Demos/assets/resources/effect/effect_tex.json @@ -0,0 +1 @@ +{"width":512,"SubTexture":[{"width":137,"y":421,"height":123,"name":"jiguang","x":1},{"width":20,"y":333,"height":20,"name":"meigui","x":442},{"y":408,"frameWidth":75,"x":292,"frameHeight":75,"width":71,"frameY":-2,"height":71,"name":"zheng","frameX":-2},{"y":280,"frameWidth":75,"x":442,"frameHeight":75,"width":51,"frameY":-12,"height":51,"name":"zheng2","frameX":-12},{"y":1,"frameWidth":180,"x":340,"frameHeight":160,"width":158,"frameY":-22,"height":137,"name":"1 (6)","frameX":-7},{"y":146,"frameWidth":180,"x":168,"frameHeight":160,"width":154,"frameY":-27,"height":127,"name":"1 (3)","frameX":-8},{"y":293,"frameWidth":180,"x":1,"frameHeight":160,"width":145,"frameY":-30,"height":126,"name":"1 (9)","frameX":-7},{"y":1,"frameWidth":180,"x":1,"frameHeight":160,"width":165,"frameY":-4,"height":155,"name":"1 (2)","frameX":-6},{"y":140,"frameWidth":180,"x":340,"frameHeight":160,"width":151,"frameY":-17,"height":138,"name":"1 (1)","frameX":-6},{"y":407,"frameWidth":180,"x":148,"frameHeight":160,"width":142,"frameY":-28,"height":128,"name":"1 (4)","frameX":-8},{"y":280,"frameWidth":180,"x":295,"frameHeight":160,"width":145,"frameY":-33,"height":126,"name":"1 (10)","frameX":-6},{"y":158,"frameWidth":180,"x":1,"frameHeight":160,"width":145,"frameY":-23,"height":133,"name":"1 (8)","frameX":-8},{"y":1,"frameWidth":180,"x":168,"frameHeight":160,"width":170,"frameY":-12,"height":143,"name":"1 (7)","frameX":-7},{"y":275,"frameWidth":180,"x":148,"frameHeight":160,"width":145,"frameY":-27,"height":130,"name":"1 (5)","frameX":-7}],"height":1024,"name":"effect","imagePath":"effect_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/effect/effect_tex.json.meta b/Cocos/Demos/assets/resources/effect/effect_tex.json.meta new file mode 100644 index 00000000..d33997fd --- /dev/null +++ b/Cocos/Demos/assets/resources/effect/effect_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "a95bfa35-d46e-4e21-8c20-7d8d9e194332", + "atlasJson": "{\"width\":512,\"SubTexture\":[{\"width\":137,\"y\":421,\"height\":123,\"name\":\"jiguang\",\"x\":1},{\"width\":20,\"y\":333,\"height\":20,\"name\":\"meigui\",\"x\":442},{\"y\":408,\"frameWidth\":75,\"x\":292,\"frameHeight\":75,\"width\":71,\"frameY\":-2,\"height\":71,\"name\":\"zheng\",\"frameX\":-2},{\"y\":280,\"frameWidth\":75,\"x\":442,\"frameHeight\":75,\"width\":51,\"frameY\":-12,\"height\":51,\"name\":\"zheng2\",\"frameX\":-12},{\"y\":1,\"frameWidth\":180,\"x\":340,\"frameHeight\":160,\"width\":158,\"frameY\":-22,\"height\":137,\"name\":\"1 (6)\",\"frameX\":-7},{\"y\":146,\"frameWidth\":180,\"x\":168,\"frameHeight\":160,\"width\":154,\"frameY\":-27,\"height\":127,\"name\":\"1 (3)\",\"frameX\":-8},{\"y\":293,\"frameWidth\":180,\"x\":1,\"frameHeight\":160,\"width\":145,\"frameY\":-30,\"height\":126,\"name\":\"1 (9)\",\"frameX\":-7},{\"y\":1,\"frameWidth\":180,\"x\":1,\"frameHeight\":160,\"width\":165,\"frameY\":-4,\"height\":155,\"name\":\"1 (2)\",\"frameX\":-6},{\"y\":140,\"frameWidth\":180,\"x\":340,\"frameHeight\":160,\"width\":151,\"frameY\":-17,\"height\":138,\"name\":\"1 (1)\",\"frameX\":-6},{\"y\":407,\"frameWidth\":180,\"x\":148,\"frameHeight\":160,\"width\":142,\"frameY\":-28,\"height\":128,\"name\":\"1 (4)\",\"frameX\":-8},{\"y\":280,\"frameWidth\":180,\"x\":295,\"frameHeight\":160,\"width\":145,\"frameY\":-33,\"height\":126,\"name\":\"1 (10)\",\"frameX\":-6},{\"y\":158,\"frameWidth\":180,\"x\":1,\"frameHeight\":160,\"width\":145,\"frameY\":-23,\"height\":133,\"name\":\"1 (8)\",\"frameX\":-8},{\"y\":1,\"frameWidth\":180,\"x\":168,\"frameHeight\":160,\"width\":170,\"frameY\":-12,\"height\":143,\"name\":\"1 (7)\",\"frameX\":-7},{\"y\":275,\"frameWidth\":180,\"x\":148,\"frameHeight\":160,\"width\":145,\"frameY\":-27,\"height\":130,\"name\":\"1 (5)\",\"frameX\":-7}],\"height\":1024,\"name\":\"effect\",\"imagePath\":\"effect_tex.png\"}", + "texture": "a8d3a064-96e0-4fcf-98d6-975054f18c2b", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/effect/effect_tex.png b/Cocos/Demos/assets/resources/effect/effect_tex.png new file mode 100644 index 00000000..628b5ba7 Binary files /dev/null and b/Cocos/Demos/assets/resources/effect/effect_tex.png differ diff --git a/Cocos/Demos/assets/resources/effect/effect_tex.png.meta b/Cocos/Demos/assets/resources/effect/effect_tex.png.meta new file mode 100644 index 00000000..18482292 --- /dev/null +++ b/Cocos/Demos/assets/resources/effect/effect_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "a8d3a064-96e0-4fcf-98d6-975054f18c2b", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "effect_tex": { + "ver": "1.0.3", + "uuid": "8a54c29f-82f0-4bff-be74-991b75ce105d", + "rawTextureUuid": "a8d3a064-96e0-4fcf-98d6-975054f18c2b", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -6.5, + "offsetY": 239.5, + "trimX": 1, + "trimY": 1, + "width": 497, + "height": 543, + "rawWidth": 512, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/floor_board.meta b/Cocos/Demos/assets/resources/floor_board.meta new file mode 100644 index 00000000..ef42752e --- /dev/null +++ b/Cocos/Demos/assets/resources/floor_board.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "51f00546-1d46-48fa-a2ff-88f94c89d59e", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/floor_board/floor_board_ske.json b/Cocos/Demos/assets/resources/floor_board/floor_board_ske.json new file mode 100644 index 00000000..3f781661 --- /dev/null +++ b/Cocos/Demos/assets/resources/floor_board/floor_board_ske.json @@ -0,0 +1 @@ +{"frameRate":24,"name":"floor_board","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"floor_board","aabb":{"x":-198.84,"y":-85.92,"width":548.84,"height":227.23},"bone":[{"name":"root"},{"inheritRotation":false,"inheritScale":false,"length":100,"name":"circle","parent":"root","transform":{"x":300}},{"length":100,"name":"floor_board","parent":"root"},{"inheritRotation":false,"inheritScale":false,"length":50,"name":"player","parent":"floor_board"}],"slot":[{"name":"flame_01","parent":"floor_board"},{"name":"flame_02","parent":"floor_board"},{"name":"floor_board","parent":"floor_board"},{"name":"player","parent":"player"},{"name":"circle","parent":"circle","color":{"aM":30}}],"skin":[{"name":"","slot":[{"name":"floor_board","display":[{"name":"weapon_1002_101","transform":{"x":-2.05,"y":13.82,"skX":-4.25,"skY":-4.25,"scX":1.1,"scY":1.1}}]},{"name":"player","display":[{"name":"circle"}]},{"name":"flame_02","display":[{"type":"armature","name":"flame_01","transform":{"x":-74.91,"y":43.81,"skX":63.15,"skY":63.15}}]},{"name":"circle","display":[{"name":"circle"}]},{"name":"flame_01","display":[{"type":"armature","name":"flame_01","transform":{"x":-163,"y":11.58,"skX":90.89,"skY":90.89}}]}]}],"animation":[{"duration":50,"playTimes":0,"name":"idle","bone":[{"name":"floor_board","translateFrame":[{"duration":25,"curve":[0.5,0,0.5,1]},{"duration":25,"curve":[0.5,0,0.5,1],"y":10},{"duration":0}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":24,"name":"flame_01","aabb":{"x":-90,"y":-22,"width":180,"height":234},"bone":[{"name":"root"},{"inheritScale":false,"length":30,"name":"b2","parent":"root","transform":{"skX":90,"skY":90}}],"slot":[{"name":"b1","parent":"root"},{"blendMode":"add","name":"b2","parent":"b2"}],"skin":[{"name":"","slot":[{"name":"b1","display":[{"name":"flame_01_f/ba_bu_flame1","transform":{"y":85,"skX":-90,"skY":-90}}]},{"name":"b2","display":[{"name":"flame_01_f/bbb","transform":{"x":95,"skX":-90,"skY":-90}}]}]}],"animation":[{"duration":3,"playTimes":0,"name":"idle","bone":[{"name":"b2","scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":0,"x":0.5,"y":0.5}]}],"slot":[{"name":"b2","colorFrame":[{"duration":2,"tweenEasing":0},{"value":{"aM":30}}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/floor_board/floor_board_ske.json.meta b/Cocos/Demos/assets/resources/floor_board/floor_board_ske.json.meta new file mode 100644 index 00000000..b81690f3 --- /dev/null +++ b/Cocos/Demos/assets/resources/floor_board/floor_board_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "42297671-5db5-4a7b-a5d2-1b3aed96e9ab", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/floor_board/floor_board_tex.json b/Cocos/Demos/assets/resources/floor_board/floor_board_tex.json new file mode 100644 index 00000000..841a0404 --- /dev/null +++ b/Cocos/Demos/assets/resources/floor_board/floor_board_tex.json @@ -0,0 +1 @@ +{"SubTexture":[{"width":338,"y":1,"height":70,"name":"weapon_1002_101","x":1},{"width":100,"y":73,"height":100,"name":"circle","x":1},{"width":180,"y":175,"height":52,"name":"flame_01_f/ba_bu_flame1","x":1},{"frameX":-2,"frameHeight":234,"y":1,"frameY":0,"frameWidth":86,"width":81,"height":233,"name":"flame_01_f/bbb","x":341}],"width":512,"height":256,"name":"floor_board","imagePath":"floor_board_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/floor_board/floor_board_tex.json.meta b/Cocos/Demos/assets/resources/floor_board/floor_board_tex.json.meta new file mode 100644 index 00000000..8c7eb298 --- /dev/null +++ b/Cocos/Demos/assets/resources/floor_board/floor_board_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "e19245aa-020e-4332-9614-664a3ff6caa9", + "atlasJson": "{\"SubTexture\":[{\"width\":338,\"y\":1,\"height\":70,\"name\":\"weapon_1002_101\",\"x\":1},{\"width\":100,\"y\":73,\"height\":100,\"name\":\"circle\",\"x\":1},{\"width\":180,\"y\":175,\"height\":52,\"name\":\"flame_01_f/ba_bu_flame1\",\"x\":1},{\"frameX\":-2,\"frameHeight\":234,\"y\":1,\"frameY\":0,\"frameWidth\":86,\"width\":81,\"height\":233,\"name\":\"flame_01_f/bbb\",\"x\":341}],\"width\":512,\"height\":256,\"name\":\"floor_board\",\"imagePath\":\"floor_board_tex.png\"}", + "texture": "ec034815-bf70-4494-ab40-8fe98e8824e7", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/floor_board/floor_board_tex.png b/Cocos/Demos/assets/resources/floor_board/floor_board_tex.png new file mode 100644 index 00000000..afe2daa5 Binary files /dev/null and b/Cocos/Demos/assets/resources/floor_board/floor_board_tex.png differ diff --git a/Cocos/Demos/assets/resources/floor_board/floor_board_tex.png.meta b/Cocos/Demos/assets/resources/floor_board/floor_board_tex.png.meta new file mode 100644 index 00000000..a7067798 --- /dev/null +++ b/Cocos/Demos/assets/resources/floor_board/floor_board_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "ec034815-bf70-4494-ab40-8fe98e8824e7", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "floor_board_tex": { + "ver": "1.0.3", + "uuid": "1c7144f9-044f-4ed2-a66f-0b11d983494e", + "rawTextureUuid": "ec034815-bf70-4494-ab40-8fe98e8824e7", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -44.5, + "offsetY": 10.5, + "trimX": 1, + "trimY": 1, + "width": 421, + "height": 233, + "rawWidth": 512, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1002_101d_show.meta b/Cocos/Demos/assets/resources/mecha_1002_101d_show.meta new file mode 100644 index 00000000..bf0da55b --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1002_101d_show.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "9d8481f8-a564-460b-87c2-8a2c7bd88ea9", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin new file mode 100644 index 00000000..1d6f88f7 Binary files /dev/null and b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin differ diff --git a/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin.meta b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin.meta new file mode 100644 index 00000000..cc10c7d6 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.0", + "uuid": "980c849f-6599-4c83-9ef0-4402a4cbd9d7", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.json b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.json new file mode 100644 index 00000000..bf0ac08f --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.json @@ -0,0 +1 @@ +{"frameRate":25,"name":"mecha_1002_101d_show","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":25,"name":"mecha_1002_101d","aabb":{"x":-370.08,"y":-441.63,"width":657.08,"height":467.71},"bone":[{"inheritScale":false,"length":116,"name":"root","transform":{"x":-1.35,"y":-233.4,"skX":89.647,"skY":89.6814,"scX":0.9989,"scY":0.9981}},{"inheritScale":false,"length":23,"name":"pelvis","parent":"root","transform":{"x":-0.01,"y":0.05,"skX":-165.5296,"skY":-165.5271}},{"inheritScale":false,"length":33,"name":"chest","parent":"pelvis","transform":{"x":23.34,"y":-0.03,"skX":-9.8623,"skY":-9.8643,"scX":0.9997}},{"inheritScale":false,"name":"head","parent":"chest","transform":{"x":63.49,"y":-10.44,"skX":-5.2901,"skY":-5.2918}},{"inheritScale":false,"length":55,"name":"thigh_l","parent":"chest","transform":{"x":-13.68,"y":43.84,"skX":158.4792,"skY":158.4697,"scX":0.9986,"scY":0.9993}},{"inheritScale":false,"length":42,"name":"upperarm_l","parent":"chest","transform":{"x":91.87,"y":107.69,"skX":139.9899,"skY":139.9908,"scX":0.9968,"scY":0.9984}},{"inheritScale":false,"length":34,"name":"upperarm_r","parent":"chest","transform":{"x":57.34,"y":-91.71,"skX":-169.9467,"skY":-169.9515,"scX":0.9981,"scY":0.9991}},{"inheritScale":false,"length":60,"name":"thigh_r","parent":"chest","transform":{"x":-31.77,"y":-49.43,"skX":-150.3578,"skY":-150.3524,"scX":0.9969,"scY":0.9984}},{"inheritScale":false,"length":52,"name":"thigh_1_r","parent":"thigh_r","transform":{"x":60.96,"y":0.04,"skX":-57.4543,"skY":-57.4594,"scX":0.9977,"scY":0.9988}},{"inheritScale":false,"length":58,"name":"forearm_r","parent":"upperarm_r","transform":{"x":34.55,"y":0.02,"skX":9.2754,"skY":9.2814,"scX":0.9977,"scY":0.9989}},{"inheritScale":false,"length":44,"name":"forearm_l","parent":"upperarm_l","transform":{"x":42.42,"y":-0.02,"skX":19.3077,"skY":19.3051}},{"inheritScale":false,"length":61,"name":"thigh_1_l","parent":"thigh_l","transform":{"x":55.37,"y":-0.02,"skX":-10.6291,"skY":-10.6203,"scX":0.9972,"scY":0.9986}},{"inheritScale":false,"length":38,"name":"hand_r","parent":"forearm_r","transform":{"x":58.02,"y":0.03,"skX":104.4143,"skY":104.3791,"scX":0.9987,"scY":0.9977}},{"inheritScale":false,"length":25,"name":"hand_l","parent":"forearm_l","transform":{"x":44.41,"skX":-48.4006,"skY":-48.4152,"scX":0.9989,"scY":0.9979}},{"inheritScale":false,"length":78,"name":"calf_r","parent":"thigh_1_r","transform":{"x":52.36,"y":0.04,"skX":33.1257,"skY":33.1276,"scX":0.9989,"scY":0.9995}},{"inheritScale":false,"length":89,"name":"calf_l","parent":"thigh_1_l","transform":{"x":61.43,"y":-0.02,"skX":6.7512,"skY":6.7462,"scX":0.998,"scY":0.999}},{"inheritScale":false,"name":"foot_l","parent":"calf_l","transform":{"x":89.4,"y":-0.01,"skX":21.1127,"skY":21.1127}},{"inheritScale":false,"name":"weapon_hand_l","parent":"hand_l","transform":{"x":25.81,"y":-0.01,"skX":62.5975,"skY":62.601,"scX":1.0845,"scY":1.0847}},{"inheritScale":false,"name":"weapon_hand_r","parent":"hand_r","transform":{"x":38.66,"y":0.02,"skX":-109.9737,"skY":-109.9721,"scX":0.9981,"scY":0.999}},{"inheritScale":false,"name":"foot_r","parent":"calf_r","transform":{"x":78.56,"y":0.03,"skX":-9.6077,"skY":-9.6077}}],"slot":[{"name":"weapon_hand_r","parent":"weapon_hand_r"},{"name":"forearm_r","parent":"forearm_r"},{"name":"upperarm_r","parent":"upperarm_r"},{"name":"hand_r","parent":"hand_r"},{"name":"foot_r","parent":"foot_r"},{"name":"calf_r","parent":"calf_r"},{"name":"thigh_1_r","parent":"thigh_1_r"},{"name":"thigh_r","parent":"thigh_r"},{"name":"chest","parent":"chest"},{"name":"pelvis","parent":"pelvis"},{"name":"head","parent":"head"},{"name":"foot_l","parent":"foot_l"},{"name":"calf_l","parent":"calf_l"},{"name":"thigh_1_l","parent":"thigh_1_l"},{"name":"thigh_l","parent":"thigh_l"},{"name":"upperarm_l","parent":"upperarm_l"},{"name":"forearm_l","parent":"forearm_l"},{"name":"hand_l","parent":"hand_l"},{"name":"weapon_hand_l","parent":"weapon_hand_l"}],"skin":[{"name":"","slot":[{"name":"foot_l","display":[{"name":"mecha_1002_101d_folder/foot_l","transform":{"x":15.95,"y":12.9}}]},{"name":"weapon_hand_r","display":[{"type":"armature","name":"mecha_1002_101d_folder/weapon_hand_r"}]},{"name":"upperarm_r","display":[{"name":"mecha_1002_101d_folder/upperarm_r","transform":{"x":-28.55,"y":-6.3,"skX":2.43,"skY":2.43}}]},{"name":"foot_r","display":[{"name":"mecha_1002_101d_folder/foot_r","transform":{"x":13.95,"y":8.95}}]},{"name":"weapon_hand_l","display":[{"name":"mecha_1002_101d_folder/weapon_hand_l","transform":{"x":2.45,"y":-3.5}}]},{"name":"thigh_1_r","display":[{"name":"mecha_1002_101d_folder/thigh_1_r","transform":{"x":12.5,"y":-5.45,"skX":1.23,"skY":1.23}}]},{"name":"forearm_l","display":[{"name":"mecha_1002_101d_folder/forearm_l","transform":{"x":39,"y":-20.15,"skX":15.91,"skY":15.91}}]},{"name":"chest","display":[{"name":"mecha_1002_101d_folder/chest","transform":{"x":39.25,"y":67.75,"skX":-6.79,"skY":-6.79}}]},{"name":"thigh_l","display":[{"name":"mecha_1002_101d_folder/thigh_l","transform":{"x":36.75,"y":0.9,"skX":4.97,"skY":4.97}}]},{"name":"calf_l","display":[{"name":"mecha_1002_101d_folder/calf_l","transform":{"x":23.15,"y":12.75,"skX":2.34,"skY":2.34}}]},{"name":"head","display":[{"name":"mecha_1002_101d_folder/head","transform":{"x":17}}]},{"name":"forearm_r","display":[{"name":"mecha_1002_101d_folder/forearm_r","transform":{"x":40.1,"y":6.8,"skX":-1.83,"skY":-1.83}}]},{"name":"hand_r","display":[{"name":"mecha_1002_101d_folder/hand_r","transform":{"x":-9.5,"y":-9.05,"skX":-105.23,"skY":-105.23}}]},{"name":"calf_r","display":[{"name":"mecha_1002_101d_folder/calf_r","transform":{"x":15.45,"y":-0.8,"skX":-0.1,"skY":-0.1}}]},{"name":"hand_l","display":[{"name":"mecha_1002_101d_folder/hand_l","transform":{"x":4,"y":21.2,"skX":83.85,"skY":83.85}}]},{"name":"thigh_r","display":[{"name":"mecha_1002_101d_folder/thigh_r","transform":{"x":47.35,"y":8.45,"skX":-0.61,"skY":-0.61}}]},{"name":"upperarm_l","display":[{"name":"mecha_1002_101d_folder/upperarm_l","transform":{"x":-31.95,"y":3.1,"skX":-0.37,"skY":-0.37}}]},{"name":"pelvis","display":[{"name":"mecha_1002_101d_folder/pelvis","transform":{"x":7.95,"y":3.1,"skX":-13.65,"skY":-13.65}}]},{"name":"thigh_1_l","display":[{"name":"mecha_1002_101d_folder/thigh_1_l","transform":{"x":13.8,"skX":-2.45,"skY":-2.45}}]}]}],"animation":[{"duration":80,"playTimes":0,"name":"idle","bone":[{"name":"root","translateFrame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-0.05,"y":-5.9},{"duration":0}],"rotateFrame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"rotate":-0.75},{"duration":0}]},{"name":"weapon_hand_r","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":0.77,"y":-1.8},{"duration":7,"tweenEasing":0,"x":0.93,"y":-2.16},{"duration":33,"tweenEasing":0,"x":0.98,"y":-2.41},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-1.51},{"duration":7,"tweenEasing":0,"rotate":-1.76},{"duration":33,"tweenEasing":0,"rotate":-2.01},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":-0.05,"y":0.09},{"duration":7,"tweenEasing":0,"x":0.02,"y":-0.02},{"duration":33,"tweenEasing":0,"y":0.04},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":2.5},{"duration":7,"tweenEasing":0,"rotate":2.76},{"duration":33,"tweenEasing":0,"rotate":2.76},{"duration":0}]},{"name":"upperarm_r","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":0.64,"y":1.42},{"duration":7,"tweenEasing":0,"x":1.3,"y":1.76},{"duration":33,"tweenEasing":0,"x":1.21,"y":1.67},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-0.25},{"duration":7,"tweenEasing":0,"rotate":-0.01},{"duration":33,"tweenEasing":0,"rotate":-0.25},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":0.14,"y":-0.03},{"duration":7,"tweenEasing":0,"x":0.17},{"duration":33,"tweenEasing":0,"x":0.15,"y":0.04},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":1.51},{"duration":7,"tweenEasing":0,"rotate":1.76},{"duration":33,"tweenEasing":0,"rotate":2},{"duration":0}]},{"name":"foot_r","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":0.09,"y":-0.15},{"duration":7,"tweenEasing":0,"x":0.04,"y":-0.2},{"duration":33,"tweenEasing":0,"x":0.04,"y":-0.15},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":15,"tweenEasing":0,"rotate":0.5},{"duration":33,"tweenEasing":0,"rotate":0.5},{"duration":0}]},{"name":"calf_r","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":1.82,"y":0.23},{"duration":7,"tweenEasing":0,"x":1.93,"y":0.35},{"duration":33,"tweenEasing":0,"x":1.82,"y":0.32},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-4.77},{"duration":7,"tweenEasing":0,"rotate":-5.02},{"duration":33,"tweenEasing":0,"rotate":-4.76},{"duration":0}]},{"name":"thigh_1_r","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":0.37,"y":-0.25},{"duration":7,"tweenEasing":0,"x":0.36,"y":-0.32},{"duration":33,"tweenEasing":0,"x":0.4,"y":-0.06},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":6.53},{"duration":7,"tweenEasing":0,"rotate":7.03},{"duration":33,"tweenEasing":0,"rotate":6.78},{"duration":0}]},{"name":"thigh_r","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":0.19,"y":0.2},{"duration":7,"tweenEasing":0,"x":0.41,"y":0.02},{"duration":33,"tweenEasing":0,"x":0.19,"y":0.19},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-1.76},{"duration":7,"tweenEasing":0,"rotate":-1.77},{"duration":33,"tweenEasing":0,"rotate":-2.01},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":0.68,"y":-0.31},{"duration":7,"tweenEasing":0,"x":-0.08,"y":-0.08},{"duration":33,"tweenEasing":0,"x":0.67,"y":-0.32},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-0.7},{"duration":7,"tweenEasing":0,"rotate":-0.99},{"duration":33,"tweenEasing":0,"rotate":-0.7},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-0.02,"y":-0.04},{"duration":0}],"rotateFrame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"rotate":1},{"duration":0}]},{"name":"head","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":-0.22,"y":-0.02},{"duration":7,"tweenEasing":0,"x":-0.12,"y":0.15},{"duration":33,"tweenEasing":0,"x":-0.22,"y":-0.03},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":0.75},{"duration":7,"tweenEasing":0,"rotate":1.24},{"duration":33,"tweenEasing":0,"rotate":0.75},{"duration":0}]},{"name":"foot_l","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":-0.1,"y":-0.12},{"duration":7,"tweenEasing":0,"x":-0.11,"y":-0.07},{"duration":33,"tweenEasing":0,"x":-0.1,"y":-0.12},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":15,"tweenEasing":0,"rotate":-0.75},{"duration":33,"tweenEasing":0,"rotate":-0.75},{"duration":0}]},{"name":"calf_l","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":2.11,"y":-0.65},{"duration":7,"tweenEasing":0,"x":2.33,"y":-0.85},{"duration":33,"tweenEasing":0,"x":2.12,"y":-0.65},{"duration":0,"x":0.05}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-1},{"duration":7,"tweenEasing":0,"rotate":-1.25},{"duration":33,"tweenEasing":0,"rotate":-1},{"duration":0}]},{"name":"thigh_1_l","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":3.43,"y":0.94},{"duration":7,"tweenEasing":0,"x":3.7,"y":1.14},{"duration":33,"tweenEasing":0,"x":3.48,"y":0.98},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":3.26},{"duration":7,"tweenEasing":0,"rotate":3.76},{"duration":33,"tweenEasing":0,"rotate":3.26},{"duration":0}]},{"name":"thigh_l","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":-0.08,"y":-0.48},{"duration":7,"tweenEasing":0,"x":-0.22,"y":-0.64},{"duration":33,"tweenEasing":0,"x":-0.08,"y":-0.49},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-1},{"duration":7,"tweenEasing":0,"rotate":-1.01},{"duration":33,"tweenEasing":0,"rotate":-1},{"duration":0}]},{"name":"upperarm_l","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":4.29,"y":-2.4},{"duration":7,"tweenEasing":0,"x":4.51,"y":-2.47},{"duration":33,"tweenEasing":0,"x":5.01,"y":-2.91},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-0.26},{"duration":7,"tweenEasing":0,"rotate":-0.26},{"duration":33,"tweenEasing":0,"rotate":-0.51},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":-0.12,"y":0.04},{"duration":7,"tweenEasing":0,"x":-0.17,"y":0.17},{"duration":33,"tweenEasing":0,"x":-0.13,"y":0.16},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-0.25},{"duration":7,"tweenEasing":0,"rotate":-0.24},{"duration":33,"tweenEasing":0,"rotate":-0.25},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":0.44,"y":0.57},{"duration":7,"tweenEasing":0,"x":0.58,"y":0.65},{"duration":33,"tweenEasing":0,"x":0.76,"y":0.62},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-0.5},{"duration":7,"tweenEasing":0,"rotate":-0.5},{"duration":33,"tweenEasing":0,"rotate":-0.75},{"duration":0}]},{"name":"weapon_hand_l","translateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":-1.76,"y":0.94},{"duration":7,"tweenEasing":0,"x":-1.91,"y":1.07},{"duration":33,"tweenEasing":0,"x":-1.89,"y":1.2},{"duration":0}],"rotateFrame":[{"duration":32,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":0.5},{"duration":7,"tweenEasing":0,"rotate":0.5},{"duration":33,"tweenEasing":0,"rotate":0.75},{"duration":0}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":25,"name":"mecha_1002_101d_folder/weapon_hand_r","aabb":{"x":-231,"y":-58,"width":554,"height":140},"bone":[{"inheritScale":false,"name":"图层 1","transform":{"x":46,"y":12,"scX":0.8123,"scY":0.8123}}],"slot":[{"name":"图层 1","parent":"图层 1"}],"skin":[{"name":"","slot":[{"name":"图层 1","display":[{"name":"mecha_1002_101d_folder/textures/weapon_hand_r_4"}]}]}],"animation":[{"duration":0,"name":"idle"}],"defaultActions":[{"gotoAndPlay":"idle"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.json.meta b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.json.meta new file mode 100644 index 00000000..1659f032 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "3a1599ab-aa89-4c21-9d2c-1fc99e097b69", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.json b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.json new file mode 100644 index 00000000..0442abef --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.json @@ -0,0 +1 @@ +{"SubTexture":[{"width":125,"y":342,"height":56,"name":"mecha_1002_101d_folder/forearm_r","x":557},{"width":124,"y":273,"height":67,"name":"mecha_1002_101d_folder/upperarm_r","x":557},{"frameX":0,"frameHeight":42,"y":297,"frameY":0,"frameWidth":57,"width":57,"height":41,"name":"mecha_1002_101d_folder/hand_r","x":683},{"width":79,"y":1,"height":129,"name":"mecha_1002_101d_folder/foot_r","x":477},{"width":169,"y":1,"height":107,"name":"mecha_1002_101d_folder/calf_r","x":306},{"frameX":0,"frameHeight":51,"y":1,"frameY":0,"frameWidth":48,"width":47,"height":51,"name":"mecha_1002_101d_folder/thigh_1_r","x":650},{"frameX":-8,"frameHeight":116,"y":191,"frameY":-16,"frameWidth":145,"width":128,"height":89,"name":"mecha_1002_101d_folder/thigh_r","x":425},{"frameX":0,"frameHeight":303,"y":1,"frameY":-2,"frameWidth":303,"width":303,"height":301,"name":"mecha_1002_101d_folder/chest","x":1},{"frameX":0,"frameHeight":113,"y":182,"frameY":0,"frameWidth":92,"width":80,"height":113,"name":"mecha_1002_101d_folder/pelvis","x":690},{"frameX":-1,"frameHeight":31,"y":69,"frameY":0,"frameWidth":34,"width":33,"height":31,"name":"mecha_1002_101d_folder/head","x":610},{"width":90,"y":1,"height":66,"name":"mecha_1002_101d_folder/foot_l","x":558},{"frameX":0,"frameHeight":79,"y":110,"frameY":0,"frameWidth":166,"width":165,"height":79,"name":"mecha_1002_101d_folder/calf_l","x":306},{"width":50,"y":69,"height":36,"name":"mecha_1002_101d_folder/thigh_1_l","x":558},{"frameX":-6,"frameHeight":103,"y":191,"frameY":-11,"frameWidth":148,"width":133,"height":80,"name":"mecha_1002_101d_folder/thigh_l","x":555},{"width":141,"y":110,"height":70,"name":"mecha_1002_101d_folder/upperarm_l","x":558},{"width":117,"y":191,"height":106,"name":"mecha_1002_101d_folder/forearm_l","x":306},{"width":64,"y":132,"height":57,"name":"mecha_1002_101d_folder/hand_l","x":473},{"frameX":0,"frameHeight":74,"y":442,"frameY":0,"frameWidth":208,"width":208,"height":69,"name":"mecha_1002_101d_folder/weapon_hand_l","x":1},{"frameX":0,"frameHeight":140,"y":304,"frameY":0,"frameWidth":554,"width":554,"height":136,"name":"mecha_1002_101d_folder/textures/weapon_hand_r_4","x":1}],"width":1024,"height":512,"name":"mecha_1002_101d_show","imagePath":"mecha_1002_101d_show_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.json.meta b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.json.meta new file mode 100644 index 00000000..fa4f31b6 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "217bcd0d-b0f5-44d8-bf5a-27290afd29ce", + "atlasJson": "{\"SubTexture\":[{\"width\":125,\"y\":342,\"height\":56,\"name\":\"mecha_1002_101d_folder/forearm_r\",\"x\":557},{\"width\":124,\"y\":273,\"height\":67,\"name\":\"mecha_1002_101d_folder/upperarm_r\",\"x\":557},{\"frameX\":0,\"frameHeight\":42,\"y\":297,\"frameY\":0,\"frameWidth\":57,\"width\":57,\"height\":41,\"name\":\"mecha_1002_101d_folder/hand_r\",\"x\":683},{\"width\":79,\"y\":1,\"height\":129,\"name\":\"mecha_1002_101d_folder/foot_r\",\"x\":477},{\"width\":169,\"y\":1,\"height\":107,\"name\":\"mecha_1002_101d_folder/calf_r\",\"x\":306},{\"frameX\":0,\"frameHeight\":51,\"y\":1,\"frameY\":0,\"frameWidth\":48,\"width\":47,\"height\":51,\"name\":\"mecha_1002_101d_folder/thigh_1_r\",\"x\":650},{\"frameX\":-8,\"frameHeight\":116,\"y\":191,\"frameY\":-16,\"frameWidth\":145,\"width\":128,\"height\":89,\"name\":\"mecha_1002_101d_folder/thigh_r\",\"x\":425},{\"frameX\":0,\"frameHeight\":303,\"y\":1,\"frameY\":-2,\"frameWidth\":303,\"width\":303,\"height\":301,\"name\":\"mecha_1002_101d_folder/chest\",\"x\":1},{\"frameX\":0,\"frameHeight\":113,\"y\":182,\"frameY\":0,\"frameWidth\":92,\"width\":80,\"height\":113,\"name\":\"mecha_1002_101d_folder/pelvis\",\"x\":690},{\"frameX\":-1,\"frameHeight\":31,\"y\":69,\"frameY\":0,\"frameWidth\":34,\"width\":33,\"height\":31,\"name\":\"mecha_1002_101d_folder/head\",\"x\":610},{\"width\":90,\"y\":1,\"height\":66,\"name\":\"mecha_1002_101d_folder/foot_l\",\"x\":558},{\"frameX\":0,\"frameHeight\":79,\"y\":110,\"frameY\":0,\"frameWidth\":166,\"width\":165,\"height\":79,\"name\":\"mecha_1002_101d_folder/calf_l\",\"x\":306},{\"width\":50,\"y\":69,\"height\":36,\"name\":\"mecha_1002_101d_folder/thigh_1_l\",\"x\":558},{\"frameX\":-6,\"frameHeight\":103,\"y\":191,\"frameY\":-11,\"frameWidth\":148,\"width\":133,\"height\":80,\"name\":\"mecha_1002_101d_folder/thigh_l\",\"x\":555},{\"width\":141,\"y\":110,\"height\":70,\"name\":\"mecha_1002_101d_folder/upperarm_l\",\"x\":558},{\"width\":117,\"y\":191,\"height\":106,\"name\":\"mecha_1002_101d_folder/forearm_l\",\"x\":306},{\"width\":64,\"y\":132,\"height\":57,\"name\":\"mecha_1002_101d_folder/hand_l\",\"x\":473},{\"frameX\":0,\"frameHeight\":74,\"y\":442,\"frameY\":0,\"frameWidth\":208,\"width\":208,\"height\":69,\"name\":\"mecha_1002_101d_folder/weapon_hand_l\",\"x\":1},{\"frameX\":0,\"frameHeight\":140,\"y\":304,\"frameY\":0,\"frameWidth\":554,\"width\":554,\"height\":136,\"name\":\"mecha_1002_101d_folder/textures/weapon_hand_r_4\",\"x\":1}],\"width\":1024,\"height\":512,\"name\":\"mecha_1002_101d_show\",\"imagePath\":\"mecha_1002_101d_show_tex.png\"}", + "texture": "c59d0037-fa46-43ad-adbc-49040e8b2308", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.png b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.png new file mode 100644 index 00000000..5e13ca25 Binary files /dev/null and b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.png differ diff --git a/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.png.meta b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.png.meta new file mode 100644 index 00000000..2086b456 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1002_101d_show/mecha_1002_101d_show_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "c59d0037-fa46-43ad-adbc-49040e8b2308", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "mecha_1002_101d_show_tex": { + "ver": "1.0.3", + "uuid": "97cead24-a2fa-4663-8539-3ef99100b503", + "rawTextureUuid": "c59d0037-fa46-43ad-adbc-49040e8b2308", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -126.5, + "offsetY": 0, + "trimX": 1, + "trimY": 1, + "width": 769, + "height": 510, + "rawWidth": 1024, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d.meta b/Cocos/Demos/assets/resources/mecha_1004d.meta new file mode 100644 index 00000000..8613be61 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "6c788662-7864-4527-aa2e-e23f51e3fd26", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_ske.json b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_ske.json new file mode 100644 index 00000000..539009db --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_ske.json @@ -0,0 +1 @@ +{"frameRate":25,"name":"mecha_1004d","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":25,"name":"mecha_1004d","aabb":{"x":-232.76,"y":-275.91,"width":464.75,"height":315.24},"bone":[{"name":"root1"},{"inheritScale":false,"name":"effect_r","parent":"root1","transform":{"x":208,"y":25,"skX":-46.2343,"skY":-23.9186,"scX":2.1416,"scY":2.3753}},{"inheritScale":false,"name":"effect_l","parent":"root1","transform":{"x":238.55,"y":-21.55,"skX":-35.0775,"skY":-20.0269,"scX":2.4973,"scY":2.496}},{"inheritScale":false,"length":24,"name":"root","parent":"root1","transform":{"x":-0.25,"y":-96.75,"skX":90.2632,"skY":90.2632}},{"inheritScale":false,"length":35,"name":"thigh_l","parent":"root","transform":{"x":-2.37,"y":-27.45,"skX":-40.9701,"skY":-40.9714,"scX":0.9869,"scY":0.9853}},{"inheritScale":false,"length":35,"name":"thigh_r","parent":"root","transform":{"x":2.38,"y":27.98,"skX":3.5596,"skY":3.567,"scX":0.9859,"scY":0.9981}},{"inheritScale":false,"length":24,"name":"pelvis","parent":"root","transform":{"x":-0.0889,"y":0.543,"skX":-174.7594,"skY":-174.7594,"scX":0.9802,"scY":0.9952}},{"inheritScale":false,"length":61,"name":"calf_r","parent":"thigh_r","transform":{"x":35.65,"y":0.01,"skX":16.144,"skY":16.1453,"scX":0.9955,"scY":0.9905}},{"inheritScale":false,"length":49,"name":"calf_l","parent":"thigh_l","transform":{"x":35.37,"y":-0.01,"skX":32.6682,"skY":32.6684,"scX":0.9945,"scY":0.9954}},{"inheritScale":false,"length":54,"name":"chest","parent":"pelvis","transform":{"x":25,"y":-0.01,"skX":-5.2066,"skY":-5.2246,"scX":0.9979,"scY":0.9998}},{"inheritScale":false,"name":"foot_l","parent":"calf_l","transform":{"x":49.56,"y":-0.02,"skX":8.0381,"skY":8.0381,"scX":0.9955}},{"inheritScale":false,"name":"foot_r","parent":"calf_r","transform":{"x":61.46,"skX":-19.9771,"skY":-19.9771,"scX":0.9955}},{"inheritScale":false,"length":37,"name":"shouder_l","parent":"chest","transform":{"x":60.22,"y":62.24,"skX":-164.5083,"skY":-164.5031,"scX":0.9868,"scY":0.9948}},{"inheritScale":false,"length":37,"name":"shouder_r","parent":"chest","transform":{"x":48.03,"y":-62.2,"skX":-147.477,"skY":-147.4808,"scX":0.9972,"scY":0.9986}},{"inheritScale":false,"length":49,"name":"forearm_r","parent":"shouder_r","transform":{"x":37.51,"y":0.01,"skX":-38.002,"skY":-38.0045,"scX":0.9973,"scY":0.994}},{"inheritScale":false,"length":48,"name":"forearm_l","parent":"shouder_l","transform":{"x":37.59,"y":-0.01,"skX":-42.3216,"skY":-42.3089,"scX":0.9979,"scY":0.987}},{"inheritScale":false,"name":"hand_r","parent":"forearm_r","transform":{"x":49.66,"y":0.05,"skX":3.3187,"skY":3.3187,"scX":1.0446,"scY":0.9963}},{"inheritScale":false,"name":"hand_l","parent":"forearm_l","transform":{"x":48.07,"y":-0.02,"skX":118.8939,"skY":119.4238,"scX":0.9894,"scY":0.9954}},{"inheritScale":false,"name":"weapon_hand_l","parent":"hand_l","transform":{"x":-0.05,"y":0.01,"skX":139.1057,"skY":139.1066,"scX":0.9967,"scY":0.9984}},{"inheritRotation":false,"inheritScale":false,"name":"weapon_hand_r","parent":"hand_r","transform":{"x":-0.01,"y":0.03,"skX":-17.7736,"skY":-17.7744,"scX":0.9981,"scY":0.999}}],"slot":[{"name":"forearm_l","parent":"forearm_l"},{"name":"hand_l","parent":"hand_l"},{"name":"shouder_l","parent":"shouder_l"},{"name":"weapon_hand_l","parent":"weapon_hand_l"},{"displayIndex":-1,"name":"effect_l","parent":"effect_l"},{"name":"foot_l","parent":"foot_l"},{"name":"thigh_l","parent":"thigh_l"},{"name":"calf_l","parent":"calf_l"},{"name":"pelvis","parent":"pelvis"},{"name":"chest","parent":"chest"},{"name":"foot_r","parent":"foot_r"},{"name":"calf_r","parent":"calf_r"},{"name":"thigh_r","parent":"thigh_r"},{"name":"shouder_r","parent":"shouder_r"},{"name":"weapon_hand_r","parent":"weapon_hand_r"},{"name":"hand_r","parent":"hand_r"},{"name":"forearm_r","parent":"forearm_r"},{"displayIndex":-1,"name":"effect_r","parent":"effect_r"}],"skin":[{"slot":[{"name":"hand_r","display":[{"name":"mecha_1004d_folder/textures/hand_r_2","transform":{"x":8.5,"y":-4.5}},{"name":"mecha_1004d_folder/textures/hand_r_1","transform":{"x":9.95,"y":-4.95}},{"name":"mecha_1004d_folder/textures/hand_r_3","transform":{"x":11.5,"y":-3.45}}]},{"name":"thigh_l","display":[{"name":"mecha_1004d_folder/textures/thigh_l_0","transform":{"x":7.45,"y":1.9,"skX":-0.4,"skY":-0.4}}]},{"name":"shouder_r","display":[{"name":"mecha_1004d_folder/textures/shouder_r_1","transform":{"x":2.9,"y":0.5,"skX":1.62,"skY":1.62}},{"name":"mecha_1004d_folder/textures/shouder_r_2","transform":{"x":4,"y":-0.3,"skX":1.62,"skY":1.62}},{"name":"mecha_1004d_folder/textures/shouder_r_0","transform":{"x":3.5,"y":-1.4,"skX":1.62,"skY":1.62}}]},{"name":"effect_l","display":[{"type":"armature","name":"we_bl_4"}]},{"name":"calf_r","display":[{"name":"mecha_1004d_folder/textures/calf_r_0","transform":{"x":30.35,"y":2.2,"skX":0.05,"skY":0.05,"scX":1.2105,"scY":1.2105}},{"name":"mecha_1004d_folder/textures/calf_r_1","transform":{"x":27.9,"y":3.5,"skX":0.05,"skY":0.05,"scX":1.2105,"scY":1.2105}}]},{"name":"shouder_l","display":[{"name":"mecha_1004d_folder/textures/shouder_l_1","transform":{"x":2.5,"y":0.4,"skX":-0.4,"skY":-0.4}},{"name":"mecha_1004d_folder/textures/shouder_l_2","transform":{"x":3.4,"skX":-0.4,"skY":-0.4}},{"name":"mecha_1004d_folder/textures/shouder_l_0","transform":{"x":5.95,"y":0.45,"skX":-0.4,"skY":-0.4}}]},{"name":"chest","display":[{"name":"mecha_1004d_folder/textures/chest_0","transform":{"x":63.3,"y":-2.05,"skX":4.83,"skY":4.83}},{"name":"mecha_1004d_folder/textures/chest_1","transform":{"x":57.75,"y":-1.1,"skX":4.83,"skY":4.83}},{"name":"mecha_1004d_folder/textures/chest_3","transform":{"x":51.35,"y":-7.6,"skX":4.83,"skY":4.83}},{"name":"mecha_1004d_folder/textures/chest_2","transform":{"x":54.3,"y":-1.4,"skX":4.83,"skY":4.83}}]},{"name":"effect_r","display":[{"type":"armature","name":"we_bl_4"},{"type":"armature","name":"we_bl_5"}]},{"name":"forearm_r","display":[{"name":"mecha_1004d_folder/textures/forearm_r_3","transform":{"x":23,"y":6.4,"skX":-0.19,"skY":-0.19}},{"name":"mecha_1004d_folder/textures/forearm_r_2","transform":{"x":21.45,"y":5.8,"skX":-0.19,"skY":-0.19}}]},{"name":"calf_l","display":[{"name":"mecha_1004d_folder/textures/calf_l_0","transform":{"x":24.35,"y":2.65,"skX":-0.71,"skY":-0.71,"scX":1.3158,"scY":1.3158}},{"name":"mecha_1004d_folder/textures/calf_l_1","transform":{"x":28.9,"y":2.55,"skX":-0.71,"skY":-0.71,"scX":1.3158,"scY":1.3158}}]},{"name":"weapon_hand_r","display":[{"type":"armature","name":"weapon_replace"}]},{"name":"foot_l","display":[{"name":"mecha_1004d_folder/textures/foot_l_0","transform":{"x":2.5,"y":0.35,"scX":1.1959,"scY":1.1959}}]},{"name":"thigh_r","display":[{"name":"mecha_1004d_folder/textures/thigh_r_0","transform":{"x":8,"y":2,"skX":-0.32,"skY":-0.32}},{"name":"mecha_1004d_folder/textures/thigh_r_1","transform":{"x":7.95,"y":3.45,"skX":-0.32,"skY":-0.32}}]},{"name":"weapon_hand_l","display":[{"type":"armature","name":"weapon_replace"}]},{"name":"foot_r","display":[{"name":"mecha_1004d_folder/textures/foot_r_0","transform":{"x":9.3,"y":2.05,"scX":1.1693,"scY":1.1693}},{"name":"mecha_1004d_folder/textures/foot_r_1","transform":{"x":7.55,"y":1.45,"scX":1.1693,"scY":1.1693}}]},{"name":"hand_l","display":[{"name":"mecha_1004d_folder/textures/hand_l_2","transform":{"x":-3,"y":-8.55,"skX":-118.58,"skY":-118.58}},{"name":"mecha_1004d_folder/textures/hand_l_3","transform":{"x":-9.35,"y":-7.95,"skX":-118.58,"skY":-118.58}},{"name":"mecha_1004d_folder/textures/hand_l_0","transform":{"x":-9.5,"y":-4.9,"skX":-118.58,"skY":-118.58}},{"name":"mecha_1004d_folder/textures/hand_l_1","transform":{"x":-6.3,"y":-2.2,"skX":-118.58,"skY":-118.58}}]},{"name":"pelvis","display":[{"name":"mecha_1004d_folder/textures/pelvis_0","transform":{"x":-7.75,"y":-3,"skX":3.86,"skY":3.86}},{"name":"mecha_1004d_folder/textures/pelvis_1","transform":{"x":-7,"y":0.95,"skX":3.86,"skY":3.86}},{"name":"mecha_1004d_folder/textures/pelvis_3","transform":{"x":-3.9,"y":-1.25,"skX":3.86,"skY":3.86}}]},{"name":"forearm_l","display":[{"name":"mecha_1004d_folder/textures/forearm_l_2","transform":{"x":25.05,"y":-7.65,"skX":0.59,"skY":0.59}},{"name":"mecha_1004d_folder/textures/forearm_l_1","transform":{"x":17.55,"y":-7.75,"skX":0.59,"skY":0.59}},{"name":"mecha_1004d_folder/textures/forearm_l_0","transform":{"x":11.9,"y":1.55,"skX":0.59,"skY":0.59}}]}]}],"animation":[{"duration":60,"playTimes":0,"fadeInTime":0.2,"name":"idle","bone":[{"name":"pelvis","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-1.95,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-1.5},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.14,"y":0.7},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-0.48},{"duration":0}]},{"name":"shouder_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":3.73,"y":-1.38},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":1.98},{"duration":0}]},{"name":"shouder_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.41,"y":1.73},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":1.98},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.12,"y":-0.05},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.07,"y":0.01},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.04,"y":-0.07},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-1.5},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.01,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-0.75},{"duration":0}]},{"name":"weapon_hand_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.04,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-0.92},{"duration":0}]},{"name":"weapon_hand_r","rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-3.01},{"duration":0}]},{"name":"thigh_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-1.09,"y":1.31},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":0.25},{"duration":0}]},{"name":"thigh_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-2.81,"y":-1.34},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":7.53},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"calf_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.06,"y":0.07},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-1.75},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"calf_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.11,"y":-0.11},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-10.55},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.03},{"duration":0}]},{"name":"foot_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.04,"y":-0.03},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":1.5},{"duration":0}]},{"name":"foot_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.01,"y":0.04},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":3.03},{"duration":0}]}]},{"duration":58,"playTimes":0,"fadeInTime":0.2,"name":"walk","frame":[{"duration":27},{"duration":31,"sound":"walk"},{"duration":0,"sound":"walk"}],"bone":[{"name":"pelvis","translateFrame":[{"duration":10,"tweenEasing":0,"x":0.05,"y":-0.03},{"duration":2,"tweenEasing":0,"x":0.04},{"duration":17,"tweenEasing":0,"x":-2.91,"y":-0.09},{"duration":8,"tweenEasing":0,"x":0.05,"y":-0.03},{"duration":5,"tweenEasing":0,"y":-0.03},{"duration":16,"tweenEasing":0,"x":-6.65,"y":0.2},{"duration":0,"x":-0.6,"y":-0.02}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":6.25},{"duration":2,"tweenEasing":0,"rotate":5.25},{"duration":17,"tweenEasing":0,"rotate":5},{"duration":8,"tweenEasing":0,"rotate":5.75},{"duration":5,"tweenEasing":0,"rotate":5.5},{"duration":16,"tweenEasing":0,"rotate":5.75},{"duration":0,"rotate":6.05}],"scaleFrame":[{"duration":10,"tweenEasing":0,"x":1.01},{"duration":19,"tweenEasing":0,"x":0.98},{"duration":8,"tweenEasing":0,"x":0.98},{"duration":21}]},{"name":"chest","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.39,"y":1.17},{"duration":7,"tweenEasing":0,"x":-2.74,"y":1.66},{"duration":2,"tweenEasing":0,"x":0.18,"y":1.74},{"duration":7,"tweenEasing":0,"x":0.23,"y":1.8},{"duration":7,"tweenEasing":0,"x":6.91,"y":1.15},{"duration":3,"tweenEasing":0,"x":4.47,"y":1.12},{"duration":3,"tweenEasing":0,"x":0.18,"y":1.44},{"duration":5,"tweenEasing":0,"x":-1.76,"y":1.6},{"duration":2,"tweenEasing":0,"x":-0.18,"y":1.55},{"duration":3,"tweenEasing":0,"x":0.09,"y":1.45},{"duration":7,"tweenEasing":0,"x":-0.3,"y":1.49},{"duration":9,"tweenEasing":0,"x":4.32,"y":0.83},{"duration":0,"x":2.05,"y":1.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-4.04},{"duration":7,"tweenEasing":0,"rotate":-3.46},{"duration":2,"tweenEasing":0,"rotate":-2.94},{"duration":7,"tweenEasing":0,"rotate":-3.06},{"duration":7,"tweenEasing":0,"rotate":-4.75},{"duration":3,"tweenEasing":0,"rotate":-6.6},{"duration":3,"tweenEasing":0,"rotate":-5.2},{"duration":5,"tweenEasing":0,"rotate":-3.88},{"duration":2,"tweenEasing":0,"rotate":-4.26},{"duration":3,"tweenEasing":0,"rotate":-4.62},{"duration":7,"tweenEasing":0,"rotate":-5.53},{"duration":9,"tweenEasing":0,"rotate":-7.66},{"duration":0,"rotate":-5.3}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0},{"duration":7,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":32}]},{"name":"shouder_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-10.85,"y":54.86},{"duration":7,"tweenEasing":0,"x":-10.22,"y":53.31},{"duration":2,"tweenEasing":0,"x":-7.01,"y":43.2},{"duration":7,"tweenEasing":0,"x":-5.99,"y":40.84},{"duration":7,"tweenEasing":0,"x":-3.35,"y":33.5},{"duration":3,"tweenEasing":0,"x":-3.92,"y":28.52},{"duration":3,"tweenEasing":0,"x":-5.7,"y":31.34},{"duration":5,"tweenEasing":0,"x":-7.17,"y":32.76},{"duration":2,"tweenEasing":0,"x":-8.29,"y":40.92},{"duration":3,"tweenEasing":0,"x":-8.59,"y":43.71},{"duration":7,"tweenEasing":0,"x":-8.78,"y":46.72},{"duration":9,"tweenEasing":0,"x":-8.94,"y":52.07},{"duration":0,"x":-10.14,"y":54.33}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-19.52},{"duration":7,"tweenEasing":0,"rotate":-17.27},{"duration":2,"tweenEasing":0,"rotate":-10.54},{"duration":7,"tweenEasing":0,"rotate":-8.54},{"duration":7,"tweenEasing":0,"rotate":-2.29},{"duration":3,"tweenEasing":0,"rotate":2.3},{"duration":3,"tweenEasing":0,"rotate":1.76},{"duration":5,"tweenEasing":0,"rotate":0.78},{"duration":2,"tweenEasing":0,"rotate":-0.48},{"duration":3,"tweenEasing":0,"rotate":-1.48},{"duration":7,"tweenEasing":0,"rotate":-2.99},{"duration":9,"tweenEasing":0,"rotate":-7.27},{"duration":0,"rotate":-17.54}]},{"name":"shouder_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":15.04,"y":-59.71},{"duration":7,"tweenEasing":0,"x":14.25,"y":-59.09},{"duration":2,"tweenEasing":0,"x":11.48,"y":-50.81},{"duration":7,"tweenEasing":0,"x":10.63,"y":-48.85},{"duration":7,"tweenEasing":0,"x":8.36,"y":-42.71},{"duration":3,"tweenEasing":0,"x":9.39,"y":-39.14},{"duration":3,"tweenEasing":0,"x":11.01,"y":-41.18},{"duration":5,"tweenEasing":0,"x":12.45,"y":-42.62},{"duration":2,"tweenEasing":0,"x":13.32,"y":-49.71},{"duration":3,"tweenEasing":0,"x":13.42,"y":-52.26},{"duration":7,"tweenEasing":0,"x":13.47,"y":-54.83},{"duration":9,"tweenEasing":0,"x":13.25,"y":-58.42},{"duration":0,"x":14.25,"y":-59.62}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":9.06},{"duration":7,"tweenEasing":0,"rotate":8.05},{"duration":2,"tweenEasing":0,"rotate":5.76},{"duration":7,"tweenEasing":0,"rotate":4.5},{"duration":7,"tweenEasing":0,"rotate":-0.28},{"duration":3,"tweenEasing":0,"rotate":-5.21},{"duration":3,"tweenEasing":0,"rotate":-6.5},{"duration":5,"tweenEasing":0,"rotate":-5.98},{"duration":2,"tweenEasing":0,"rotate":-2.48},{"duration":3,"tweenEasing":0,"rotate":-0.98},{"duration":7,"tweenEasing":0,"rotate":1.52},{"duration":9,"tweenEasing":0,"rotate":7.27},{"duration":0,"rotate":9.53}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.85},{"duration":7,"tweenEasing":0,"x":0.87},{"duration":2,"tweenEasing":0,"x":0.91},{"duration":7,"tweenEasing":0,"x":0.91},{"duration":7,"tweenEasing":0,"x":0.89},{"duration":3,"tweenEasing":0,"x":0.87},{"duration":8,"tweenEasing":0,"x":0.86},{"duration":2,"tweenEasing":0,"x":0.86},{"duration":10,"tweenEasing":0,"x":0.87},{"duration":9,"tweenEasing":0,"x":0.87},{"duration":0,"x":0.86}]},{"name":"forearm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":5.11,"y":-0.73},{"duration":7,"tweenEasing":0,"x":4.98,"y":-0.83},{"duration":2,"tweenEasing":0,"x":4.85,"y":-0.65},{"duration":7,"tweenEasing":0,"x":4.89,"y":-0.44},{"duration":7,"tweenEasing":0,"x":5.02,"y":-0.41},{"duration":3,"tweenEasing":0,"x":5.22,"y":-0.23},{"duration":3,"tweenEasing":0,"x":5.21,"y":-0.3},{"duration":5,"tweenEasing":0,"x":5.22,"y":-0.2},{"duration":2,"tweenEasing":0,"x":5.24,"y":-0.43},{"duration":3,"tweenEasing":0,"x":5.27,"y":-0.5},{"duration":7,"tweenEasing":0,"x":5.26,"y":-0.65},{"duration":9,"tweenEasing":0,"x":5.17,"y":-0.74},{"duration":0,"x":5.1,"y":-0.84}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":6.96},{"duration":7,"tweenEasing":0,"rotate":6.97},{"duration":2,"tweenEasing":0,"rotate":7.24},{"duration":7,"tweenEasing":0,"rotate":7.74},{"duration":7,"tweenEasing":0,"rotate":8.73},{"duration":3,"tweenEasing":0,"rotate":9.96},{"duration":3,"tweenEasing":0,"rotate":8.7},{"duration":5,"tweenEasing":0,"rotate":6.69},{"duration":2,"tweenEasing":0,"rotate":3.2},{"duration":3,"tweenEasing":0,"rotate":1.95},{"duration":7,"tweenEasing":0,"rotate":0.44},{"duration":9,"tweenEasing":0,"rotate":0.2},{"duration":0,"rotate":5.68}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.85,"y":1.01},{"duration":7,"tweenEasing":0,"x":0.89,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.95,"y":1.01},{"duration":7,"tweenEasing":0,"x":0.95},{"duration":7,"tweenEasing":0,"x":0.96},{"duration":3,"tweenEasing":0,"x":0.95},{"duration":3,"tweenEasing":0,"x":0.95},{"duration":5,"tweenEasing":0,"x":0.94},{"duration":2,"tweenEasing":0,"x":0.93},{"duration":3,"tweenEasing":0,"x":0.93},{"duration":7,"tweenEasing":0,"x":0.92},{"duration":9,"tweenEasing":0,"x":0.9},{"duration":0,"x":0.86,"y":1.01}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":7.73,"y":1.35},{"duration":7,"tweenEasing":0,"x":7.76,"y":1.45},{"duration":2,"tweenEasing":0,"x":7.67,"y":1.31},{"duration":7,"tweenEasing":0,"x":7.72,"y":1.28},{"duration":7,"tweenEasing":0,"x":7.59,"y":1.2},{"duration":3,"tweenEasing":0,"x":7.53,"y":1.25},{"duration":3,"tweenEasing":0,"x":7.57,"y":1.22},{"duration":5,"tweenEasing":0,"x":7.52,"y":1.07},{"duration":2,"tweenEasing":0,"x":7.35,"y":1.1},{"duration":3,"tweenEasing":0,"x":7.33,"y":1.15},{"duration":7,"tweenEasing":0,"x":7.44,"y":1.12},{"duration":9,"tweenEasing":0,"x":7.8,"y":1.25},{"duration":0,"x":7.7,"y":1.38}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":6.52},{"duration":7,"tweenEasing":0,"rotate":6.27},{"duration":2,"tweenEasing":0,"rotate":5.52},{"duration":7,"tweenEasing":0,"rotate":5.27},{"duration":7,"tweenEasing":0,"rotate":6.51},{"duration":3,"tweenEasing":0,"rotate":9.5},{"duration":3,"tweenEasing":0,"rotate":10},{"duration":5,"tweenEasing":0,"rotate":10.25},{"duration":2,"tweenEasing":0,"rotate":9.5},{"duration":3,"tweenEasing":0,"rotate":9.01},{"duration":7,"tweenEasing":0,"rotate":8.77},{"duration":9,"tweenEasing":0,"rotate":8.53},{"duration":0,"rotate":7.78}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":16,"tweenEasing":0,"x":1.03},{"duration":7,"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":5,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":1.02},{"duration":9,"x":1.03}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.86,"y":-0.44},{"duration":7,"tweenEasing":0,"x":0.76,"y":-0.28},{"duration":2,"tweenEasing":0,"x":0.67,"y":-0.33},{"duration":7,"tweenEasing":0,"x":0.61,"y":-0.22},{"duration":7,"tweenEasing":0,"x":0.62,"y":-0.37},{"duration":3,"tweenEasing":0,"x":0.62,"y":-0.33},{"duration":3,"tweenEasing":0,"x":0.66,"y":-0.03},{"duration":5,"tweenEasing":0,"x":0.74,"y":-0.12},{"duration":2,"tweenEasing":0,"x":0.86,"y":-0.38},{"duration":3,"tweenEasing":0,"x":0.95,"y":-0.33},{"duration":7,"tweenEasing":0,"x":0.92,"y":-0.3},{"duration":9,"tweenEasing":0,"x":0.94,"y":-0.31},{"duration":0,"x":0.89,"y":-0.31}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-5.5},{"duration":7,"tweenEasing":0,"rotate":-5},{"duration":2,"tweenEasing":0,"rotate":-4.5},{"duration":7,"tweenEasing":0,"rotate":-4.25},{"duration":7,"tweenEasing":0,"rotate":-5.25},{"duration":3,"tweenEasing":0,"rotate":-7.5},{"duration":3,"tweenEasing":0,"rotate":-7.25},{"duration":5,"tweenEasing":0,"rotate":-6.25},{"duration":2,"tweenEasing":0,"rotate":-1.75},{"duration":3,"tweenEasing":0,"rotate":-0.25},{"duration":7,"tweenEasing":0,"rotate":0.25},{"duration":9,"tweenEasing":0,"rotate":-1.5},{"duration":0,"rotate":-4.75}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":7,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":7,"tweenEasing":0,"x":0.98},{"duration":7,"tweenEasing":0,"x":0.97},{"duration":3,"tweenEasing":0,"x":0.97},{"duration":3,"tweenEasing":0,"x":0.96},{"duration":5,"tweenEasing":0,"x":0.96},{"duration":5,"tweenEasing":0,"x":0.97},{"duration":7,"tweenEasing":0,"x":0.97},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.98,"y":0.99}]},{"name":"hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.82,"y":0.57},{"duration":7,"tweenEasing":0,"x":0.59,"y":0.54},{"duration":2,"tweenEasing":0,"x":0.27,"y":0.72},{"duration":7,"tweenEasing":0,"x":0.27,"y":0.6},{"duration":7,"tweenEasing":0,"x":0.24,"y":0.81},{"duration":3,"tweenEasing":0,"x":0.16,"y":0.89},{"duration":3,"tweenEasing":0,"x":0.17,"y":0.8},{"duration":5,"tweenEasing":0,"x":0.25,"y":0.9},{"duration":2,"tweenEasing":0,"x":0.37,"y":0.92},{"duration":3,"tweenEasing":0,"x":0.45,"y":0.91},{"duration":7,"tweenEasing":0,"x":0.5,"y":0.89},{"duration":9,"tweenEasing":0,"x":0.61,"y":0.87},{"duration":0,"x":0.76,"y":0.68}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":5.14},{"duration":7,"tweenEasing":0,"rotate":6.86},{"duration":2,"tweenEasing":0,"rotate":9.82},{"duration":7,"tweenEasing":0,"rotate":9.31},{"duration":7,"tweenEasing":0,"rotate":7.06},{"duration":3,"tweenEasing":0,"rotate":4.3},{"duration":3,"tweenEasing":0,"rotate":4.05},{"duration":5,"tweenEasing":0,"rotate":5.06},{"duration":2,"tweenEasing":0,"rotate":7.32},{"duration":3,"tweenEasing":0,"rotate":8.08},{"duration":7,"tweenEasing":0,"rotate":9.08},{"duration":9,"tweenEasing":0,"rotate":9.35},{"duration":0,"rotate":5.91}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.95},{"duration":7,"tweenEasing":0,"x":0.99,"y":0.96},{"duration":2,"tweenEasing":0,"y":0.97},{"duration":7,"tweenEasing":0,"y":0.97},{"duration":23,"tweenEasing":0,"x":0.99,"y":0.97},{"duration":7,"tweenEasing":0,"x":0.99,"y":0.97},{"duration":9,"tweenEasing":0,"y":0.97},{"duration":0,"y":0.96}]},{"name":"weapon_hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.11,"y":0.01},{"duration":7,"tweenEasing":0,"x":0.11,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.05,"y":0.04},{"duration":7,"tweenEasing":0,"x":0.05,"y":0.03},{"duration":7,"tweenEasing":0,"x":0.09,"y":0.02},{"duration":3,"tweenEasing":0,"y":0.04},{"duration":3,"tweenEasing":0,"x":0.02,"y":0.01},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.02},{"duration":3,"tweenEasing":0,"x":0.08,"y":0.03},{"duration":7,"tweenEasing":0,"x":0.06,"y":0.01},{"duration":9,"tweenEasing":0,"x":0.05,"y":0.03},{"duration":0,"x":0.12,"y":-0.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":21.05},{"duration":7,"tweenEasing":0,"rotate":19.94},{"duration":2,"tweenEasing":0,"rotate":17.95},{"duration":7,"tweenEasing":0,"rotate":18.42},{"duration":7,"tweenEasing":0,"rotate":20.58},{"duration":3,"tweenEasing":0,"rotate":23.19},{"duration":3,"tweenEasing":0,"rotate":23.94},{"duration":5,"tweenEasing":0,"rotate":23.5},{"duration":2,"tweenEasing":0,"rotate":22.36},{"duration":3,"tweenEasing":0,"rotate":21.8},{"duration":7,"tweenEasing":0,"rotate":21.24},{"duration":9,"tweenEasing":0,"rotate":20.8},{"duration":0,"rotate":21.25}]},{"name":"weapon_hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.04,"y":-0.01},{"duration":7,"tweenEasing":0,"x":-0.03},{"duration":2,"tweenEasing":0,"x":-0.03,"y":0.05},{"duration":7,"tweenEasing":0,"x":-0.05,"y":0.07},{"duration":7,"tweenEasing":0,"x":-0.03,"y":0.01},{"duration":3,"tweenEasing":0,"x":-0.04,"y":-0.03},{"duration":3,"tweenEasing":0,"x":-0.03,"y":0.01},{"duration":5,"tweenEasing":0,"x":-0.01,"y":-0.03},{"duration":2,"tweenEasing":0,"x":-0.02,"y":-0.02},{"duration":3,"tweenEasing":0,"x":-0.03,"y":-0.01},{"duration":7,"tweenEasing":0,"y":0.06},{"duration":9,"tweenEasing":0,"x":-0.02,"y":0.06},{"duration":0,"x":-0.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-3.01},{"duration":7,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":6.76},{"duration":7,"tweenEasing":0,"rotate":8.77},{"duration":7,"tweenEasing":0,"rotate":14.4},{"duration":3,"tweenEasing":0,"rotate":18.27},{"duration":3,"tweenEasing":0,"rotate":19.78},{"duration":5,"tweenEasing":0,"rotate":21.53},{"duration":2,"tweenEasing":0,"rotate":24.53},{"duration":3,"tweenEasing":0,"rotate":24.28},{"duration":7,"tweenEasing":0,"rotate":21.78},{"duration":9,"tweenEasing":0,"rotate":12.52},{"duration":0,"rotate":-0.5}]},{"name":"root","translateFrame":[{"duration":10,"tweenEasing":0,"x":-10.2,"y":6},{"duration":19,"tweenEasing":0,"x":-9.25,"y":0.15},{"duration":8,"tweenEasing":0,"x":-10.2,"y":6.45},{"duration":21,"tweenEasing":0,"x":-11.2,"y":6.2},{"duration":0,"x":-10.3,"y":5.95}]},{"name":"thigh_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":4.01,"y":-18.65},{"duration":2,"tweenEasing":0,"x":7.51,"y":-19.05},{"duration":5,"tweenEasing":0,"x":8.91,"y":-19.41},{"duration":2,"tweenEasing":0,"x":7.15,"y":-20.13},{"duration":7,"tweenEasing":0,"x":4.55,"y":-20.62},{"duration":7,"tweenEasing":0,"x":-0.31,"y":-22.16},{"duration":3,"tweenEasing":0,"x":3.19,"y":-23.54},{"duration":3,"tweenEasing":0,"x":7.89,"y":-24.42},{"duration":5,"tweenEasing":0,"x":9.28,"y":-24.92},{"duration":2,"tweenEasing":0,"x":6.24,"y":-24.81},{"duration":3,"tweenEasing":0,"x":2.79,"y":-24.59},{"duration":7,"tweenEasing":0,"x":-1.46,"y":-24.02},{"duration":9,"tweenEasing":0,"x":-4.15,"y":-21.96},{"duration":0,"x":1.01,"y":-19.18}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-21.02},{"duration":2,"tweenEasing":0,"rotate":-22.53},{"duration":5,"tweenEasing":0,"rotate":-26.04},{"duration":2,"tweenEasing":0,"rotate":-53.15},{"duration":7,"tweenEasing":0,"rotate":-58.92},{"duration":7,"tweenEasing":0,"rotate":-60.43},{"duration":3,"tweenEasing":0,"rotate":-72.97},{"duration":3,"tweenEasing":0,"rotate":-65.19},{"duration":5,"tweenEasing":0,"rotate":-68.71},{"duration":2,"tweenEasing":0,"rotate":-61.43},{"duration":3,"tweenEasing":0,"rotate":-54.4},{"duration":7,"tweenEasing":0,"rotate":-44.36},{"duration":9,"tweenEasing":0,"rotate":-31.31},{"duration":0,"rotate":-21.52}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":5,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":9,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":10,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":9,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":0,"x":1.01}]},{"name":"thigh_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-3.92,"y":18.44},{"duration":7,"tweenEasing":0,"x":-2.32,"y":18.74},{"duration":2,"tweenEasing":0,"x":-6.97,"y":19.88},{"duration":7,"tweenEasing":0,"x":-10.26,"y":20.24},{"duration":7,"tweenEasing":0,"x":-16.06,"y":21.61},{"duration":3,"tweenEasing":0,"x":-12.5,"y":23.28},{"duration":3,"tweenEasing":0,"x":-7.64,"y":24.11},{"duration":2,"tweenEasing":0,"x":-5.54,"y":24.65},{"duration":3,"tweenEasing":0,"x":-4.94,"y":24.74},{"duration":2,"tweenEasing":0,"x":-6.19,"y":24.45},{"duration":3,"tweenEasing":0,"x":-8.64,"y":24.41},{"duration":7,"tweenEasing":0,"x":-11.74,"y":24.08},{"duration":9,"tweenEasing":0,"x":-13.1,"y":22.08},{"duration":0,"x":-7.02,"y":19.06}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-20.58},{"duration":7,"tweenEasing":0,"rotate":-21.34},{"duration":2,"tweenEasing":0,"rotate":-5.52},{"duration":7,"tweenEasing":0,"rotate":1.26},{"duration":7,"tweenEasing":0,"rotate":20.33},{"duration":3,"tweenEasing":0,"rotate":26.84},{"duration":3,"tweenEasing":0,"rotate":21.33},{"duration":2,"tweenEasing":0,"rotate":19.83},{"duration":3,"tweenEasing":0,"rotate":16.31},{"duration":2,"tweenEasing":0,"rotate":1.76},{"duration":3,"tweenEasing":0,"rotate":-8.29},{"duration":7,"tweenEasing":0,"rotate":-15.32},{"duration":9,"tweenEasing":0,"rotate":-18.83},{"duration":0,"rotate":-19.05}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":7,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.97,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.98,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0,"x":1.01,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.31,"y":-0.21},{"duration":2,"tweenEasing":0,"x":0.32,"y":-0.17},{"duration":5,"tweenEasing":0,"x":0.29,"y":-0.21},{"duration":2,"tweenEasing":0,"x":0.19,"y":-0.17},{"duration":7,"tweenEasing":0,"x":0.22,"y":-0.2},{"duration":7,"tweenEasing":0,"x":0.2,"y":-0.26},{"duration":3,"tweenEasing":0,"x":0.28,"y":-0.34},{"duration":3,"tweenEasing":0,"x":0.23,"y":-0.14},{"duration":5,"tweenEasing":0,"x":0.25,"y":-0.26},{"duration":2,"tweenEasing":0,"x":0.31,"y":-0.12},{"duration":3,"tweenEasing":0,"x":0.32,"y":-0.15},{"duration":7,"tweenEasing":0,"x":0.34,"y":-0.14},{"duration":9,"tweenEasing":0,"x":0.4,"y":-0.26},{"duration":0,"x":0.45,"y":-0.39}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":48.14},{"duration":2,"tweenEasing":0,"rotate":58.43},{"duration":5,"tweenEasing":0,"rotate":64.7},{"duration":2,"tweenEasing":0,"rotate":80.26},{"duration":7,"tweenEasing":0,"rotate":79.51},{"duration":7,"tweenEasing":0,"rotate":56.68},{"duration":3,"tweenEasing":0,"rotate":52.2},{"duration":3,"tweenEasing":0,"rotate":42.17},{"duration":5,"tweenEasing":0,"rotate":48.44},{"duration":2,"tweenEasing":0,"rotate":48.66},{"duration":3,"tweenEasing":0,"rotate":43.64},{"duration":7,"tweenEasing":0,"rotate":35.85},{"duration":9,"tweenEasing":0,"rotate":32.07},{"duration":0,"rotate":41.6}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.02,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.02,"y":1.01},{"duration":5,"tweenEasing":0,"x":1.01,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.99,"y":1.01},{"duration":10,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":0,"x":0.98}]},{"name":"calf_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.23,"y":-0.13},{"duration":7,"tweenEasing":0,"x":-0.2,"y":-0.11},{"duration":2,"tweenEasing":0,"x":-0.2,"y":-0.17},{"duration":7,"tweenEasing":0,"x":-0.16,"y":-0.22},{"duration":7,"tweenEasing":0,"x":-0.1,"y":-0.21},{"duration":3,"tweenEasing":0,"x":0.01,"y":-0.26},{"duration":3,"tweenEasing":0,"y":-0.2},{"duration":2,"tweenEasing":0,"x":-0.01,"y":-0.23},{"duration":3,"tweenEasing":0,"y":-0.2},{"duration":2,"tweenEasing":0,"x":-0.04,"y":-0.13},{"duration":3,"tweenEasing":0,"x":-0.07,"y":-0.1},{"duration":7,"tweenEasing":0,"x":-0.08,"y":-0.1},{"duration":9,"tweenEasing":0,"x":-0.12,"y":-0.06},{"duration":0,"x":-0.18,"y":-0.15}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":26.19},{"duration":7,"tweenEasing":0,"rotate":27.35},{"duration":2,"tweenEasing":0,"rotate":23.54},{"duration":7,"tweenEasing":0,"rotate":19.51},{"duration":7,"tweenEasing":0,"rotate":10.96},{"duration":3,"tweenEasing":0,"rotate":20.49},{"duration":3,"tweenEasing":0,"rotate":36.56},{"duration":2,"tweenEasing":0,"rotate":47.6},{"duration":3,"tweenEasing":0,"rotate":54.38},{"duration":2,"tweenEasing":0,"rotate":63.92},{"duration":3,"tweenEasing":0,"rotate":66.19},{"duration":7,"tweenEasing":0,"rotate":62.92},{"duration":9,"tweenEasing":0,"rotate":43.86},{"duration":0,"rotate":24.05}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.01},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"y":0.99},{"duration":5,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":7,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"foot_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.36,"y":-0.26},{"duration":2,"tweenEasing":0,"x":-1.5,"y":-0.23},{"duration":5,"tweenEasing":0,"x":-1.42,"y":-0.27},{"duration":2,"tweenEasing":0,"x":-1.25,"y":-0.05},{"duration":7,"tweenEasing":0,"x":-1.1,"y":-0.26},{"duration":7,"tweenEasing":0,"x":-0.96,"y":0.15},{"duration":3,"tweenEasing":0,"x":-0.98,"y":-0.08},{"duration":3,"tweenEasing":0,"x":-1.09},{"duration":5,"tweenEasing":0,"x":-1.09,"y":0.03},{"duration":2,"tweenEasing":0,"x":-0.99,"y":0.35},{"duration":3,"tweenEasing":0,"x":-0.97,"y":0.2},{"duration":7,"tweenEasing":0,"x":-0.99,"y":0.19},{"duration":9,"tweenEasing":0,"x":-1.1,"y":-0.15},{"duration":0,"x":-1.33,"y":-0.13}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-20.1},{"duration":2,"tweenEasing":0,"rotate":-16.61},{"duration":5,"tweenEasing":0,"rotate":-12.35},{"duration":2,"tweenEasing":0,"rotate":10.49},{"duration":7,"tweenEasing":0,"rotate":13.25},{"duration":7,"tweenEasing":0,"rotate":3.01},{"duration":3,"tweenEasing":0,"rotate":5.76},{"duration":3,"tweenEasing":0,"rotate":23.03},{"duration":5,"tweenEasing":0,"rotate":20.28},{"duration":2,"tweenEasing":0,"rotate":12.78},{"duration":3,"tweenEasing":0,"rotate":10.78},{"duration":7,"tweenEasing":0,"rotate":8.52},{"duration":9,"tweenEasing":0,"rotate":-0.75},{"duration":0,"rotate":-16.03}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":5,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":7,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":7,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":20,"tweenEasing":0},{"duration":9,"tweenEasing":0},{"duration":0,"x":0.98}]},{"name":"foot_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":9.56,"y":-0.87},{"duration":7,"tweenEasing":0,"x":9.49,"y":-0.62},{"duration":2,"tweenEasing":0,"x":9.45,"y":-0.44},{"duration":7,"tweenEasing":0,"x":9.45,"y":-0.55},{"duration":7,"tweenEasing":0,"x":9.42,"y":-0.77},{"duration":3,"tweenEasing":0,"x":9.29,"y":-1.04},{"duration":3,"tweenEasing":0,"x":9.26,"y":-1.12},{"duration":2,"tweenEasing":0,"x":9.2,"y":-1.13},{"duration":3,"tweenEasing":0,"x":9.22,"y":-1.22},{"duration":2,"tweenEasing":0,"x":9.35,"y":-1.02},{"duration":3,"tweenEasing":0,"x":9.53,"y":-0.95},{"duration":7,"tweenEasing":0,"x":9.67,"y":-1.01},{"duration":9,"tweenEasing":0,"x":9.77,"y":-0.62},{"duration":0,"x":9.62,"y":-0.7}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-6.94},{"duration":7,"tweenEasing":0,"rotate":-7.25},{"duration":2,"tweenEasing":0,"rotate":-19},{"duration":7,"tweenEasing":0,"rotate":-21.75},{"duration":7,"tweenEasing":0,"rotate":-31.28},{"duration":3,"tweenEasing":0,"rotate":-44.59},{"duration":3,"tweenEasing":0,"rotate":-49.88},{"duration":2,"tweenEasing":0,"rotate":-47.9},{"duration":3,"tweenEasing":0,"rotate":-44.39},{"duration":2,"tweenEasing":0,"rotate":-31.6},{"duration":3,"tweenEasing":0,"rotate":-20.56},{"duration":7,"tweenEasing":0,"rotate":-18.8},{"duration":9,"tweenEasing":0,"rotate":-26.94},{"duration":0,"rotate":-13.54}],"scaleFrame":[{"duration":19,"tweenEasing":0},{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":10,"tweenEasing":0,"y":0.99},{"duration":7,"tweenEasing":0,"y":0.99},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":58,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":58,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":58,"value":1}]},{"name":"shouder_r","displayFrame":[{"duration":58,"value":1}]},{"name":"chest","displayFrame":[{"duration":58,"value":1}]},{"name":"shouder_l","displayFrame":[{"duration":58,"value":1}]},{"name":"hand_l","displayFrame":[{"duration":58,"value":1}]},{"name":"forearm_l","displayFrame":[{"duration":58,"value":1}]},{"name":"calf_r","displayFrame":[{"duration":58,"value":1}]},{"name":"foot_r","displayFrame":[{"duration":58,"value":1}]},{"name":"calf_l","displayFrame":[{"duration":58,"value":1}]}]},{"duration":66,"fadeInTime":0.1,"name":"death","bone":[{"name":"pelvis","translateFrame":[{"duration":6,"tweenEasing":0,"x":0.01,"y":-0.02},{"duration":4,"tweenEasing":0,"x":0.02,"y":-0.04},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.01},{"duration":10,"tweenEasing":0,"x":0.05,"y":0.01},{"duration":10,"tweenEasing":0,"x":0.02,"y":-0.02},{"duration":5,"tweenEasing":0,"x":0.04,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":3,"tweenEasing":0,"x":0.01},{"duration":3,"tweenEasing":0,"x":2.22,"y":-1.07},{"duration":2,"tweenEasing":0,"x":0.04,"y":-0.13},{"duration":3,"tweenEasing":0,"x":-0.4,"y":-1.02},{"duration":4,"tweenEasing":0,"y":-0.05},{"duration":3,"tweenEasing":0,"x":-3.97,"y":-2.04},{"duration":9,"tweenEasing":0,"x":1.08,"y":-2.01},{"duration":0,"x":0.03,"y":-0.07}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":17.28},{"duration":4,"tweenEasing":0,"rotate":5.5},{"duration":2,"tweenEasing":0,"rotate":-5.5},{"duration":10,"tweenEasing":0,"rotate":-6},{"duration":10,"tweenEasing":0,"rotate":1.75},{"duration":5,"tweenEasing":0,"rotate":5.5},{"duration":2,"tweenEasing":0,"rotate":-7},{"duration":3,"tweenEasing":0,"rotate":-10.51},{"duration":3,"tweenEasing":0,"rotate":6.51},{"duration":2,"tweenEasing":0,"rotate":20.04},{"duration":3,"tweenEasing":0,"rotate":41.37},{"duration":4,"tweenEasing":0,"rotate":82.99},{"duration":3,"tweenEasing":0,"rotate":84},{"duration":9,"tweenEasing":0,"rotate":87.25},{"duration":0,"rotate":85}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":10,"tweenEasing":0,"x":0.98},{"duration":10,"tweenEasing":0,"x":0.98},{"duration":5,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.04},{"duration":3,"tweenEasing":0,"x":1.04},{"duration":9,"x":1.03}]},{"name":"chest","translateFrame":[{"duration":6,"tweenEasing":0,"y":-4.42},{"duration":3,"tweenEasing":0,"x":-0.17,"y":1.78},{"tweenEasing":0,"x":0.29,"y":3.02},{"duration":2,"tweenEasing":0,"x":-1.23,"y":5.4},{"duration":10,"tweenEasing":0,"x":-1.7,"y":5.86},{"duration":10,"tweenEasing":0,"x":-0.75,"y":3.36},{"duration":5,"tweenEasing":0,"x":0.08,"y":-0.35},{"duration":2,"tweenEasing":0,"x":0.26,"y":0.23},{"duration":3,"tweenEasing":0,"x":0.07,"y":0.29},{"duration":3,"tweenEasing":0,"x":-0.22,"y":-2.19},{"duration":2,"tweenEasing":0,"x":-0.77,"y":0.29},{"duration":3,"tweenEasing":0,"x":-1.18,"y":2.7},{"duration":4,"tweenEasing":0,"x":-0.82,"y":2.41},{"duration":3,"tweenEasing":0,"x":-0.6,"y":1.43},{"duration":4,"tweenEasing":0,"x":-0.64,"y":1.64},{"duration":5,"tweenEasing":0,"x":-0.73,"y":3.3},{"duration":0,"x":-0.44,"y":1.56}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":44.35},{"duration":3,"tweenEasing":0,"rotate":24.74},{"tweenEasing":0,"rotate":10.26},{"duration":2,"tweenEasing":0,"rotate":8.29},{"duration":10,"tweenEasing":0,"rotate":4.32},{"duration":10,"tweenEasing":0,"rotate":1.32},{"duration":5,"tweenEasing":0,"rotate":1.88},{"duration":2,"tweenEasing":0,"rotate":-2.13},{"duration":3,"tweenEasing":0,"rotate":-0.44},{"duration":3,"tweenEasing":0,"rotate":15.76},{"duration":2,"tweenEasing":0,"rotate":37.03},{"duration":3,"tweenEasing":0,"rotate":17.21},{"duration":4,"tweenEasing":0,"rotate":-25.71},{"duration":3,"tweenEasing":0,"rotate":15.88},{"duration":4,"tweenEasing":0,"rotate":-3.38},{"duration":5,"tweenEasing":0,"rotate":12.65},{"duration":0,"rotate":15.67}],"scaleFrame":[{"duration":6,"tweenEasing":0,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":10,"tweenEasing":0,"x":0.99},{"duration":10,"tweenEasing":0,"x":0.93},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":3,"tweenEasing":0,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0},{"duration":5,"x":1.01}]},{"name":"shouder_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":-16.22,"y":47.36},{"duration":3,"tweenEasing":0,"x":8.72,"y":51.8},{"tweenEasing":0,"x":19.98,"y":43.1},{"duration":2,"tweenEasing":0,"x":10.45,"y":34.31},{"duration":10,"tweenEasing":0,"x":-5.07,"y":31.15},{"duration":10,"tweenEasing":0,"x":-12.46,"y":33.56},{"duration":5,"tweenEasing":0,"x":3.55,"y":36.17},{"duration":2,"tweenEasing":0,"x":5.2,"y":29.39},{"duration":3,"tweenEasing":0,"x":5.7,"y":24.72},{"duration":3,"tweenEasing":0,"x":-2.77,"y":17.7},{"duration":2,"tweenEasing":0,"x":-19.27,"y":25.65},{"duration":3,"tweenEasing":0,"x":-7.75,"y":42.19},{"duration":4,"tweenEasing":0,"x":-21.74,"y":89.67},{"duration":3,"tweenEasing":0,"x":-6.07,"y":82.06},{"duration":4,"tweenEasing":0,"x":-9.08,"y":84.68},{"duration":5,"tweenEasing":0,"x":-3.8,"y":80.9},{"duration":0,"x":-3.27,"y":80.99}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":-81.03},{"duration":3,"tweenEasing":0,"rotate":69.12},{"tweenEasing":0,"rotate":70.36},{"duration":2,"tweenEasing":0,"rotate":7.92},{"duration":10,"tweenEasing":0,"rotate":-7.21},{"duration":10,"tweenEasing":0,"rotate":6.38},{"duration":5,"tweenEasing":0,"rotate":-12.29},{"duration":2,"tweenEasing":0,"rotate":32.33},{"duration":3,"tweenEasing":0,"rotate":78.92},{"duration":3,"tweenEasing":0,"rotate":23.95},{"duration":2,"tweenEasing":0,"rotate":-17.09},{"duration":3,"tweenEasing":0,"rotate":-30.39},{"duration":4,"tweenEasing":0,"rotate":-8.51},{"duration":3,"tweenEasing":0,"rotate":-68.19},{"duration":4,"tweenEasing":0,"rotate":-62.93},{"duration":5,"tweenEasing":0,"rotate":-55.67},{"duration":0,"rotate":-55.92}]},{"name":"shouder_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":11.61,"y":-72.42},{"duration":2,"tweenEasing":0,"x":-5.76,"y":-80.78},{"duration":3,"tweenEasing":0,"x":-8.72,"y":-78.39},{"tweenEasing":0,"x":-2.95,"y":-57.72},{"duration":2,"tweenEasing":0,"x":1.41,"y":-46.96},{"duration":10,"tweenEasing":0,"x":12.62,"y":-30.94},{"duration":10,"tweenEasing":0,"x":25.11,"y":-34.39},{"duration":5,"tweenEasing":0,"x":9.83,"y":-43.13},{"duration":2,"tweenEasing":0,"x":8.63,"y":-34.7},{"duration":3,"tweenEasing":0,"x":7.65,"y":-29.28},{"duration":3,"tweenEasing":0,"x":12.49,"y":-20.29},{"duration":2,"tweenEasing":0,"x":19.59,"y":-26.56},{"duration":3,"tweenEasing":0,"x":8.86,"y":-55.46},{"duration":4,"tweenEasing":0,"x":18.47,"y":-101.99},{"duration":3,"tweenEasing":0,"x":-1.56,"y":-87.6},{"duration":4,"tweenEasing":0,"x":1,"y":-89.75},{"duration":5,"tweenEasing":0,"x":-3.49,"y":-86.4},{"duration":0,"x":-3.68,"y":-86.97}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-106.06},{"duration":2,"tweenEasing":0,"rotate":-8.75},{"duration":3,"tweenEasing":0,"rotate":3.7},{"tweenEasing":0,"rotate":16.47},{"duration":2,"tweenEasing":0,"rotate":17.43},{"duration":10,"tweenEasing":0,"rotate":16.36},{"duration":10,"tweenEasing":0,"rotate":1.1},{"duration":5,"tweenEasing":0,"rotate":25.08},{"duration":2,"tweenEasing":0,"rotate":27.28},{"duration":3,"tweenEasing":0,"rotate":21},{"duration":3,"tweenEasing":0,"rotate":-9.44},{"duration":2,"tweenEasing":0,"rotate":-30.15},{"duration":3,"tweenEasing":0,"rotate":1.96},{"duration":4,"tweenEasing":0,"rotate":-20.8},{"duration":3,"tweenEasing":0,"rotate":-28.08},{"duration":4,"tweenEasing":0,"rotate":-20.04},{"duration":5,"tweenEasing":0,"rotate":-19.34},{"duration":0,"rotate":-19.1}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.88,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.08,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.09,"y":0.99},{"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":10,"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.86,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.84},{"duration":3,"tweenEasing":0,"x":0.81,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.78,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.82},{"duration":4,"tweenEasing":0,"x":0.72,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.19},{"duration":4,"tweenEasing":0,"x":1.18},{"duration":5,"tweenEasing":0,"x":1.2},{"duration":0,"x":1.15}]},{"name":"forearm_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.48,"y":0.64},{"duration":2,"tweenEasing":0,"x":-1.64,"y":-1.2},{"duration":3,"tweenEasing":0,"x":-1.85,"y":-1.3},{"tweenEasing":0,"x":-1.3,"y":-1.64},{"duration":2,"tweenEasing":0,"x":-0.93,"y":-1.66},{"duration":10,"tweenEasing":0,"x":-0.47,"y":-1.5},{"duration":10,"tweenEasing":0,"x":-0.45,"y":-0.94},{"duration":5,"tweenEasing":0,"x":-1.01,"y":-1.68},{"duration":2,"tweenEasing":0,"x":-0.1,"y":-1.35},{"duration":3,"tweenEasing":0,"x":-0.24,"y":-0.78},{"duration":3,"tweenEasing":0,"x":-0.02,"y":-0.24},{"duration":2,"tweenEasing":0,"x":-0.06,"y":-0.06},{"duration":3,"tweenEasing":0,"x":-0.57,"y":-0.8},{"duration":4,"tweenEasing":0,"x":0.2,"y":-0.35},{"duration":3,"tweenEasing":0,"x":-1.5,"y":-0.29},{"duration":4,"tweenEasing":0,"x":-1.45,"y":-0.28},{"duration":5,"tweenEasing":0,"x":-1.67,"y":-0.27},{"duration":0,"x":-1.47,"y":-0.31}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-1.88},{"duration":2,"tweenEasing":0,"rotate":-14.52},{"duration":3,"tweenEasing":0,"rotate":-11.52},{"tweenEasing":0,"rotate":-12.78},{"duration":2,"tweenEasing":0,"rotate":-12.29},{"duration":10,"tweenEasing":0,"rotate":-7.79},{"duration":10,"tweenEasing":0,"rotate":11.55},{"duration":5,"tweenEasing":0,"rotate":1.93},{"duration":2,"tweenEasing":0,"rotate":4.68},{"duration":3,"tweenEasing":0,"rotate":5.43},{"duration":3,"tweenEasing":0,"rotate":4.15},{"duration":2,"tweenEasing":0,"rotate":-0.93},{"duration":3,"tweenEasing":0,"rotate":5.3},{"duration":4,"tweenEasing":0,"rotate":40.88},{"duration":3,"tweenEasing":0,"rotate":36.08},{"duration":4,"tweenEasing":0,"rotate":29.81},{"duration":5,"tweenEasing":0,"rotate":39.09},{"duration":0,"rotate":40.61}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.87,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.86,"y":1.01},{"tweenEasing":0,"x":0.83},{"duration":2,"tweenEasing":0,"x":0.83},{"duration":10,"tweenEasing":0,"x":0.85},{"duration":10,"tweenEasing":0,"x":0.94,"y":1.01},{"duration":5,"tweenEasing":0,"x":0.82,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.76,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.75,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.7,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.66,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.66},{"duration":4,"tweenEasing":0,"x":0.66},{"duration":3,"tweenEasing":0,"x":0.66,"y":1.01},{"duration":4,"tweenEasing":0,"x":0.66},{"duration":5,"tweenEasing":0,"x":0.66,"y":1.01},{"duration":0,"x":0.76,"y":1.01}]},{"name":"forearm_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":-0.66,"y":1.47},{"duration":3,"tweenEasing":0,"x":-8.6,"y":2.14},{"tweenEasing":0,"x":-18.64,"y":2.76},{"duration":2,"tweenEasing":0,"x":-15.02,"y":3.45},{"duration":10,"tweenEasing":0,"x":1.05,"y":2.52},{"duration":10,"tweenEasing":0,"x":-0.94,"y":2.74},{"duration":5,"tweenEasing":0,"x":0.49,"y":2.49},{"duration":2,"tweenEasing":0,"x":3.72,"y":2.31},{"duration":3,"tweenEasing":0,"x":6.09,"y":1.85},{"duration":3,"tweenEasing":0,"x":4.52,"y":1.75},{"duration":2,"tweenEasing":0,"x":6.2,"y":1.52},{"duration":3,"tweenEasing":0,"x":0.7,"y":1.43},{"duration":4,"tweenEasing":0,"x":-21.35,"y":0.38},{"duration":3,"tweenEasing":0,"x":-17.39,"y":-0.07},{"duration":4,"tweenEasing":0,"x":-15.42,"y":-0.08},{"duration":5,"tweenEasing":0,"x":-19.02,"y":0.03},{"duration":0,"x":-18.49,"y":0.04}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":-10.55},{"duration":3,"tweenEasing":0,"rotate":-146.71},{"tweenEasing":0,"rotate":-125.63},{"duration":2,"tweenEasing":0,"rotate":-48.42},{"duration":10,"tweenEasing":0,"rotate":-26.84},{"duration":10,"tweenEasing":0,"rotate":-54.95},{"duration":5,"tweenEasing":0,"rotate":13.27},{"duration":2,"tweenEasing":0,"rotate":-4.33},{"duration":3,"tweenEasing":0,"rotate":-41.41},{"duration":3,"tweenEasing":0,"rotate":4.18},{"duration":2,"tweenEasing":0,"rotate":-9.62},{"duration":3,"tweenEasing":0,"rotate":-4.1},{"duration":4,"tweenEasing":0,"rotate":-31.67},{"duration":3,"tweenEasing":0,"rotate":-4.85},{"duration":4,"tweenEasing":0,"rotate":12.72},{"duration":5,"tweenEasing":0,"rotate":-9.87},{"duration":0,"rotate":-12.37}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.89,"y":0.99},{"tweenEasing":0,"x":0.82,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.77,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.9,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":5,"tweenEasing":0,"x":0.92},{"duration":2,"tweenEasing":0,"x":0.89},{"duration":3,"tweenEasing":0,"x":0.67},{"duration":3,"tweenEasing":0,"x":0.87,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.93},{"duration":4,"tweenEasing":0,"x":0.74},{"duration":3,"tweenEasing":0,"x":0.77},{"duration":4,"tweenEasing":0,"x":0.74,"y":0.99},{"duration":5,"x":0.72,"y":0.99}]},{"name":"hand_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":1.05,"y":-0.2},{"duration":3,"tweenEasing":0,"x":-0.59,"y":-1.24},{"tweenEasing":0,"x":-1.19,"y":-1.28},{"duration":2,"tweenEasing":0,"x":-1.58,"y":-0.5},{"duration":10,"tweenEasing":0,"x":-0.44,"y":-0.11},{"duration":10,"tweenEasing":0,"x":0.01,"y":-0.19},{"duration":5,"tweenEasing":0,"x":0.14,"y":0.66},{"duration":2,"tweenEasing":0,"x":0.21,"y":0.91},{"duration":3,"tweenEasing":0,"x":-0.3,"y":1.8},{"duration":3,"tweenEasing":0,"x":0.83,"y":1.07},{"duration":2,"tweenEasing":0,"x":0.5,"y":0.19},{"duration":3,"tweenEasing":0,"x":0.8,"y":-0.01},{"duration":4,"tweenEasing":0,"x":1.54,"y":-0.89},{"duration":3,"tweenEasing":0,"x":1.52,"y":-1.07},{"duration":4,"tweenEasing":0,"x":1.48,"y":-1.17},{"duration":5,"tweenEasing":0,"x":1.47,"y":-1.02},{"duration":0,"x":1.43,"y":-1.04}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":4.03},{"duration":3,"tweenEasing":0,"rotate":-12.06},{"tweenEasing":0,"rotate":152.64},{"duration":2,"tweenEasing":0,"rotate":130.33},{"duration":10,"tweenEasing":0,"rotate":134.36},{"duration":10,"tweenEasing":0,"rotate":144.41},{"duration":5,"tweenEasing":0,"rotate":90.23},{"duration":2,"tweenEasing":0,"rotate":79.72},{"duration":3,"tweenEasing":0,"rotate":71.89},{"duration":3,"tweenEasing":0,"rotate":59.63},{"duration":2,"tweenEasing":0,"rotate":110.84},{"duration":3,"tweenEasing":0,"rotate":121.36},{"duration":4,"tweenEasing":0,"rotate":146.89},{"duration":3,"tweenEasing":0,"rotate":155.42},{"duration":4,"tweenEasing":0,"rotate":148.64},{"duration":5,"tweenEasing":0,"rotate":148.89},{"duration":0,"rotate":149.89}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.65,"y":0.99},{"tweenEasing":0,"x":0.69},{"duration":2,"tweenEasing":0},{"duration":27,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":12,"x":0.97}]},{"name":"hand_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.75,"y":0.57},{"duration":2,"tweenEasing":0,"x":0.3,"y":-0.06},{"duration":3,"tweenEasing":0,"x":0.25,"y":-0.4},{"tweenEasing":0,"x":0.83},{"duration":2,"tweenEasing":0,"x":0.99,"y":0.12},{"duration":10,"tweenEasing":0,"x":1.02,"y":0.31},{"duration":10,"tweenEasing":0,"x":0.57,"y":0.3},{"duration":5,"tweenEasing":0,"x":0.84,"y":-0.26},{"duration":2,"tweenEasing":0,"x":1.3,"y":0.25},{"duration":3,"tweenEasing":0,"x":0.66,"y":0.71},{"duration":3,"tweenEasing":0,"x":0.39,"y":1.22},{"duration":2,"tweenEasing":0,"x":-6.35,"y":1.47},{"duration":3,"tweenEasing":0,"x":-18.98,"y":0.39},{"duration":4,"tweenEasing":0,"x":-2.29,"y":0.27},{"duration":3,"tweenEasing":0,"x":-2.72,"y":0.18},{"duration":4,"tweenEasing":0,"x":-2.78,"y":0.33},{"duration":5,"tweenEasing":0,"x":-1.19,"y":0.08},{"duration":0,"x":-0.08,"y":0.23}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":3.25},{"duration":2,"tweenEasing":0,"rotate":15.58},{"duration":3,"tweenEasing":0,"rotate":32.47},{"tweenEasing":0,"rotate":59.31},{"duration":2,"tweenEasing":0,"rotate":63.85},{"duration":10,"tweenEasing":0,"rotate":64.64},{"duration":10,"tweenEasing":0,"rotate":35.73},{"duration":5,"tweenEasing":0,"rotate":26.18},{"duration":2,"tweenEasing":0,"rotate":7.62},{"duration":3,"tweenEasing":0,"rotate":4.93},{"duration":3,"tweenEasing":0,"rotate":12.32},{"duration":2,"tweenEasing":0,"rotate":37.9},{"duration":3,"tweenEasing":0,"rotate":48.02},{"duration":4,"tweenEasing":0,"rotate":51.68},{"duration":3,"tweenEasing":0,"rotate":13.57},{"duration":4,"tweenEasing":0,"rotate":27.35},{"duration":5,"tweenEasing":0,"rotate":3.06},{"duration":0,"rotate":-0.06}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01,"y":1.02},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.91},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.92},{"tweenEasing":0,"x":0.98,"y":0.92},{"duration":2,"tweenEasing":0,"x":0.97,"y":0.91},{"duration":10,"tweenEasing":0,"x":0.97,"y":0.89},{"duration":10,"tweenEasing":0,"x":0.97,"y":0.89},{"duration":5,"tweenEasing":0,"x":0.96,"y":0.86},{"duration":2,"tweenEasing":0,"x":0.96,"y":0.83},{"duration":3,"tweenEasing":0,"x":0.96,"y":0.82},{"duration":3,"tweenEasing":0,"x":0.94,"y":0.76},{"duration":2,"tweenEasing":0,"x":0.93,"y":0.75},{"duration":3,"tweenEasing":0,"x":0.94,"y":0.75},{"duration":4,"tweenEasing":0,"y":0.97},{"duration":7,"tweenEasing":0,"x":1.02,"y":1.02},{"duration":5,"tweenEasing":0,"x":1.02,"y":1.02},{"duration":0,"x":1.01,"y":1.02}]},{"name":"weapon_hand_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.02,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.09},{"duration":3,"tweenEasing":0,"x":0.07,"y":-0.05},{"tweenEasing":0,"x":0.09,"y":-0.05},{"duration":2,"tweenEasing":0,"x":0.06,"y":-0.04},{"duration":10,"tweenEasing":0,"x":0.09,"y":-0.05},{"duration":10,"tweenEasing":0,"x":0.06,"y":-0.01},{"duration":5,"tweenEasing":0,"x":0.08,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.06},{"duration":3,"tweenEasing":0,"x":0.05,"y":0.02},{"duration":3,"tweenEasing":0,"x":0.04,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.07},{"duration":3,"tweenEasing":0,"x":0.08,"y":0.04},{"duration":4,"tweenEasing":0,"x":0.05,"y":-0.02},{"duration":3,"tweenEasing":0,"x":0.06,"y":0.01},{"duration":4,"tweenEasing":0,"x":0.09,"y":0.01},{"duration":5,"tweenEasing":0,"x":0.05,"y":-0.01},{"duration":0,"x":0.09,"y":0.02}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":4.42},{"duration":2,"tweenEasing":0,"rotate":24.72},{"duration":3,"tweenEasing":0,"rotate":16.51},{"tweenEasing":0,"rotate":9.6},{"duration":2,"tweenEasing":0,"rotate":9.71},{"duration":10,"tweenEasing":0,"rotate":11.52},{"duration":10,"tweenEasing":0,"rotate":25.31},{"duration":5,"tweenEasing":0,"rotate":20.24},{"duration":2,"tweenEasing":0,"rotate":29.56},{"duration":3,"tweenEasing":0,"rotate":31.39},{"duration":3,"tweenEasing":0,"rotate":27.05},{"duration":2,"tweenEasing":0,"rotate":-4.88},{"duration":3,"tweenEasing":0,"rotate":-52.41},{"duration":4,"tweenEasing":0,"rotate":-105.87},{"duration":3,"tweenEasing":0,"rotate":-81.38},{"duration":4,"tweenEasing":0,"rotate":-80.53},{"duration":5,"tweenEasing":0,"rotate":-79.97},{"duration":0,"rotate":-80.88}]},{"name":"weapon_hand_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":0.01,"y":-0.04},{"duration":3,"tweenEasing":0,"x":0.01,"y":-0.07},{"tweenEasing":0,"x":0.05,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.06},{"duration":10,"tweenEasing":0,"x":0.02,"y":-0.01},{"duration":10,"tweenEasing":0,"x":0.06,"y":-0.02},{"duration":7,"tweenEasing":0,"x":0.02},{"duration":3,"tweenEasing":0,"x":0.02},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.03,"y":0.01},{"duration":3,"tweenEasing":0,"x":0.03},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.02},{"duration":3,"tweenEasing":0,"x":-0.02,"y":0.02},{"duration":4,"tweenEasing":0,"x":-0.02,"y":0.02},{"duration":5,"tweenEasing":0,"x":-0.03,"y":0.02},{"duration":0,"x":-0.04,"y":0.02}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":-6.02},{"duration":3,"tweenEasing":0,"rotate":93.01},{"tweenEasing":0,"rotate":105.4},{"duration":2,"tweenEasing":0,"rotate":104.02},{"duration":27,"tweenEasing":0,"rotate":107.78},{"duration":3,"tweenEasing":0,"rotate":107.78},{"duration":3,"tweenEasing":0,"rotate":121.04},{"duration":2,"tweenEasing":0,"rotate":155.41},{"duration":3,"tweenEasing":0,"rotate":159.93},{"duration":4,"tweenEasing":0,"rotate":-179.75},{"duration":12,"rotate":-159.98}]},{"name":"root","translateFrame":[{"duration":6,"tweenEasing":0,"x":-57.1,"y":3.8},{"duration":4,"tweenEasing":0,"x":-103.6,"y":-3.45},{"duration":2,"tweenEasing":0,"x":-104.85,"y":-9.95},{"duration":10,"tweenEasing":0,"x":-97.65,"y":-1.55},{"duration":10,"tweenEasing":0,"x":-102.75,"y":4.3},{"duration":5,"tweenEasing":0,"x":-85.95,"y":-1.55},{"duration":2,"tweenEasing":0,"x":-35.35,"y":1.9},{"duration":6,"tweenEasing":0,"x":-14.2,"y":42.9},{"duration":5,"tweenEasing":0,"x":2.75,"y":49.55},{"duration":16,"tweenEasing":0,"x":22.1,"y":76.05},{"duration":0,"x":25.85,"y":81.4}]},{"name":"thigh_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":2.18,"y":-18.08},{"duration":3,"tweenEasing":0,"x":4.11,"y":-24.65},{"tweenEasing":0,"x":5.35,"y":-16.54},{"duration":2,"tweenEasing":0,"x":7.11,"y":-15.49},{"duration":10,"tweenEasing":0,"x":7.94,"y":-12.53},{"duration":10,"tweenEasing":0,"x":7.45,"y":-15.71},{"duration":5,"tweenEasing":0,"x":9.44,"y":-21.94},{"duration":2,"tweenEasing":0,"x":9.82,"y":-20.3},{"duration":3,"tweenEasing":0,"x":9.68,"y":-17.79},{"duration":3,"tweenEasing":0,"x":4.53,"y":-10.63},{"duration":2,"tweenEasing":0,"x":-0.54,"y":-16.67},{"duration":3,"tweenEasing":0,"x":4.93,"y":-26.35},{"duration":4,"tweenEasing":0,"x":13.17,"y":-27.36},{"duration":3,"tweenEasing":0,"x":5.81,"y":-28.23},{"duration":4,"tweenEasing":0,"x":6.52,"y":-27.39},{"duration":5,"tweenEasing":0,"x":8.12,"y":-25.3},{"duration":0,"x":8.53,"y":-23.06}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":-44.61},{"duration":3,"tweenEasing":0,"rotate":-48.38},{"tweenEasing":0,"rotate":-43.86},{"duration":2,"tweenEasing":0,"rotate":-43.35},{"duration":10,"tweenEasing":0,"rotate":-54.15},{"duration":10,"tweenEasing":0,"rotate":-64.69},{"duration":5,"tweenEasing":0,"rotate":-42.6},{"duration":2,"tweenEasing":0,"rotate":-29.05},{"duration":3,"tweenEasing":0,"rotate":-2.5},{"duration":3,"tweenEasing":0,"rotate":2},{"duration":2,"tweenEasing":0,"rotate":14.27},{"duration":3,"tweenEasing":0,"rotate":37.86},{"duration":4,"tweenEasing":0,"rotate":71.48},{"duration":3,"tweenEasing":0,"rotate":61.96},{"duration":4,"tweenEasing":0,"rotate":63.96},{"duration":5,"tweenEasing":0,"rotate":67.22},{"duration":0,"rotate":63.46}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.96,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":5,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":16,"x":1.02,"y":0.99}]},{"name":"thigh_l","translateFrame":[{"tweenEasing":0,"x":-2.21,"y":17.84},{"duration":5,"tweenEasing":0,"x":-1.98,"y":26.35},{"duration":3,"tweenEasing":0,"x":-4.01,"y":24.18},{"tweenEasing":0,"x":-7.33,"y":19.52},{"duration":2,"tweenEasing":0,"x":-7,"y":15.33},{"duration":10,"tweenEasing":0,"x":-7.75,"y":12.39},{"duration":10,"tweenEasing":0,"x":-7.26,"y":15.51},{"duration":5,"tweenEasing":0,"x":-9.21,"y":21.65},{"duration":2,"tweenEasing":0,"x":-9.65,"y":20.04},{"duration":3,"tweenEasing":0,"x":-9.5,"y":17.65},{"duration":3,"tweenEasing":0,"x":-0.14,"y":8.44},{"duration":2,"tweenEasing":0,"x":0.56,"y":16.32},{"duration":3,"tweenEasing":0,"x":-5.69,"y":23.9},{"duration":4,"tweenEasing":0,"x":-12.98,"y":26.81},{"duration":3,"tweenEasing":0,"x":-13.6,"y":23.76},{"duration":4,"tweenEasing":0,"x":-4.3,"y":22.91},{"duration":5,"tweenEasing":0,"x":-4.16,"y":22.9},{"duration":0,"x":-8.27,"y":22.62}],"rotateFrame":[{"tweenEasing":0,"rotate":-23.85},{"duration":5,"tweenEasing":0,"rotate":39},{"duration":3,"tweenEasing":0,"rotate":-6.78},{"tweenEasing":0,"rotate":12.3},{"duration":2,"tweenEasing":0,"rotate":19.83},{"duration":10,"tweenEasing":0,"rotate":16.07},{"duration":10,"tweenEasing":0,"rotate":-1.5},{"duration":5,"tweenEasing":0,"rotate":32.36},{"duration":2,"tweenEasing":0,"rotate":36.86},{"duration":3,"tweenEasing":0,"rotate":49.37},{"duration":3,"tweenEasing":0,"rotate":66.15},{"duration":2,"tweenEasing":0,"rotate":87.74},{"duration":3,"tweenEasing":0,"rotate":100.55},{"duration":4,"tweenEasing":0,"rotate":114.09},{"duration":3,"tweenEasing":0,"rotate":118.87},{"duration":4,"tweenEasing":0,"rotate":120.64},{"duration":5,"tweenEasing":0,"rotate":117.35},{"duration":0,"rotate":116.86}],"scaleFrame":[{"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.77,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.91},{"tweenEasing":0,"x":0.9},{"duration":2,"tweenEasing":0,"x":0.89},{"duration":10,"tweenEasing":0,"x":0.87},{"duration":10,"tweenEasing":0,"x":0.9},{"duration":5,"tweenEasing":0,"x":0.86,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.89,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.81,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.91},{"duration":2,"tweenEasing":0,"x":0.93},{"duration":3,"tweenEasing":0,"x":0.93},{"duration":4,"tweenEasing":0,"x":0.92,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.73,"y":1.01},{"duration":4,"tweenEasing":0,"x":0.66,"y":1.01},{"duration":5,"tweenEasing":0,"x":0.82,"y":1.01},{"duration":0,"x":0.79,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":-0.01,"y":-0.28},{"duration":3,"tweenEasing":0,"x":-0.25,"y":-0.22},{"tweenEasing":0,"x":-0.18,"y":-0.15},{"duration":2,"tweenEasing":0,"x":-0.2,"y":-0.16},{"duration":10,"tweenEasing":0,"x":-0.35,"y":-0.11},{"duration":10,"tweenEasing":0,"x":-0.25,"y":-0.33},{"duration":5,"tweenEasing":0,"x":0.06,"y":-0.14},{"duration":2,"tweenEasing":0,"x":0.11,"y":-0.16},{"duration":3,"tweenEasing":0,"x":0.1,"y":-0.01},{"duration":3,"tweenEasing":0,"x":0.09,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.2,"y":-0.15},{"duration":3,"tweenEasing":0,"x":0.15,"y":-0.23},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.35},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.24},{"duration":4,"tweenEasing":0,"x":0.11,"y":-0.16},{"duration":5,"tweenEasing":0,"x":0.11,"y":-0.36},{"duration":0,"x":0.12,"y":-0.21}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":31.33},{"duration":3,"tweenEasing":0,"rotate":45.37},{"tweenEasing":0,"rotate":32.33},{"duration":2,"tweenEasing":0,"rotate":30.83},{"duration":10,"tweenEasing":0,"rotate":51.13},{"duration":10,"tweenEasing":0,"rotate":64.19},{"duration":5,"tweenEasing":0,"rotate":57.91},{"duration":2,"tweenEasing":0,"rotate":66.96},{"duration":3,"tweenEasing":0,"rotate":78.23},{"duration":3,"tweenEasing":0,"rotate":63.48},{"duration":2,"tweenEasing":0,"rotate":50.96},{"duration":3,"tweenEasing":0,"rotate":43.38},{"duration":4,"tweenEasing":0,"rotate":39.35},{"duration":3,"tweenEasing":0,"rotate":31.56},{"duration":4,"tweenEasing":0,"rotate":15.28},{"duration":5,"tweenEasing":0,"rotate":10.01},{"duration":0,"rotate":16.53}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":1.01,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.04},{"tweenEasing":0,"x":1.04,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":10,"tweenEasing":0,"x":1.02},{"duration":10,"tweenEasing":0,"x":1.03},{"duration":5,"tweenEasing":0,"x":1.04},{"duration":2,"tweenEasing":0,"x":1.04},{"duration":3,"tweenEasing":0,"x":1.05,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.04,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.02,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.04},{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.05},{"duration":4,"tweenEasing":0,"x":1.05},{"duration":5,"tweenEasing":0,"x":1.05,"y":1.01},{"duration":0,"x":1.05}]},{"name":"calf_l","translateFrame":[{"tweenEasing":0,"x":-0.28,"y":-0.03},{"duration":5,"tweenEasing":0,"x":0.32,"y":-0.75},{"duration":3,"tweenEasing":0,"x":0.22,"y":-0.19},{"tweenEasing":0,"x":0.32,"y":-0.41},{"duration":2,"tweenEasing":0,"x":0.33,"y":-0.43},{"duration":10,"tweenEasing":0,"x":0.41,"y":-0.39},{"duration":10,"tweenEasing":0,"x":0.2,"y":-0.3},{"duration":5,"tweenEasing":0,"x":0.27,"y":-0.72},{"duration":2,"tweenEasing":0,"x":0.24,"y":-0.35},{"duration":3,"tweenEasing":0,"x":-0.03,"y":-0.21},{"duration":3,"tweenEasing":0,"x":-0.17,"y":-0.26},{"duration":2,"tweenEasing":0,"x":-0.26,"y":-0.42},{"duration":3,"tweenEasing":0,"x":-0.3,"y":-0.44},{"duration":4,"tweenEasing":0,"x":-0.34,"y":-0.27},{"duration":3,"tweenEasing":0,"x":-0.26,"y":-0.48},{"duration":4,"tweenEasing":0,"x":-0.28,"y":-0.44},{"duration":5,"tweenEasing":0,"x":-0.36,"y":-0.34},{"duration":0,"x":-0.33,"y":-0.37}],"rotateFrame":[{"tweenEasing":0,"rotate":41.36},{"duration":5,"tweenEasing":0,"rotate":16.91},{"duration":3,"tweenEasing":0,"rotate":40.79},{"tweenEasing":0,"rotate":14.94},{"duration":2,"tweenEasing":0,"rotate":6.91},{"duration":10,"tweenEasing":0,"rotate":24.2},{"duration":10,"tweenEasing":0,"rotate":45.3},{"duration":5,"tweenEasing":0,"rotate":8.15},{"duration":2,"tweenEasing":0,"rotate":22.24},{"duration":3,"tweenEasing":0,"rotate":48.05},{"duration":3,"tweenEasing":0,"rotate":31.31},{"duration":2,"tweenEasing":0,"rotate":16.24},{"duration":3,"tweenEasing":0,"rotate":5.93},{"duration":4,"tweenEasing":0,"rotate":-6.36},{"duration":3,"tweenEasing":0,"rotate":16.85},{"duration":4,"tweenEasing":0,"rotate":10.27},{"duration":5,"tweenEasing":0,"rotate":-5.17},{"duration":0,"rotate":-6.69}],"scaleFrame":[{"tweenEasing":0,"x":0.95},{"duration":5,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":10,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":5,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":3,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.05,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.05,"y":0.99},{"duration":5,"x":1.03}]},{"name":"foot_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":-1.13,"y":-0.06},{"duration":3,"tweenEasing":0,"x":-1.29,"y":-0.06},{"tweenEasing":0,"x":-1.3,"y":-0.19},{"duration":2,"tweenEasing":0,"x":-1.25,"y":-0.09},{"duration":10,"tweenEasing":0,"x":-1.29,"y":-0.4},{"duration":10,"tweenEasing":0,"x":-1.28,"y":-0.24},{"duration":5,"tweenEasing":0,"x":-1.4},{"duration":2,"tweenEasing":0,"x":-1.29,"y":-0.03},{"duration":3,"tweenEasing":0,"x":-1.3,"y":0.06},{"duration":3,"tweenEasing":0,"x":-1.58},{"duration":2,"tweenEasing":0,"x":-1.63,"y":-0.06},{"duration":3,"tweenEasing":0,"x":-1.54,"y":0.11},{"duration":4,"tweenEasing":0,"x":-1.1,"y":0.07},{"duration":3,"tweenEasing":0,"x":-1.18,"y":-0.07},{"duration":4,"tweenEasing":0,"x":-1.37,"y":0.07},{"duration":5,"tweenEasing":0,"x":-1.38,"y":0.16},{"duration":0,"x":-1.4,"y":0.08}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":13.28},{"duration":3,"tweenEasing":0,"rotate":3.76},{"tweenEasing":0,"rotate":12.78},{"duration":2,"tweenEasing":0,"rotate":14.03},{"duration":10,"tweenEasing":0,"rotate":3.51},{"duration":10,"tweenEasing":0,"rotate":0.75},{"duration":5,"tweenEasing":0,"rotate":-15.05},{"duration":2,"tweenEasing":0,"rotate":48.6},{"duration":3,"tweenEasing":0,"rotate":27.29},{"duration":3,"tweenEasing":0,"rotate":49.32},{"duration":2,"tweenEasing":0,"rotate":65.14},{"duration":3,"tweenEasing":0,"rotate":51.39},{"duration":4,"tweenEasing":0,"rotate":12.5},{"duration":3,"tweenEasing":0,"rotate":53.41},{"duration":4,"tweenEasing":0,"rotate":38.58},{"duration":5,"tweenEasing":0,"rotate":35.06},{"duration":0,"rotate":35.57}],"scaleFrame":[{"duration":32,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.92},{"duration":3,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":5,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":0,"y":0.99}]},{"name":"foot_l","translateFrame":[{"tweenEasing":0,"x":9.41,"y":-0.93},{"duration":5,"tweenEasing":0,"x":8.62,"y":-1.21},{"duration":3,"tweenEasing":0,"x":8.77,"y":-1.21},{"tweenEasing":0,"x":8.91,"y":-1.14},{"duration":2,"tweenEasing":0,"x":8.97,"y":-1.27},{"duration":10,"tweenEasing":0,"x":8.81,"y":-1.28},{"duration":10,"tweenEasing":0,"x":8.78,"y":-1.26},{"duration":5,"tweenEasing":0,"x":8.77,"y":-1.28},{"duration":2,"tweenEasing":0,"x":8.92,"y":-1.14},{"duration":3,"tweenEasing":0,"x":8.48,"y":-1.05},{"duration":3,"tweenEasing":0,"x":8.67,"y":-0.99},{"duration":2,"tweenEasing":0,"x":8.57,"y":-0.82},{"duration":3,"tweenEasing":0,"x":8.49,"y":-0.83},{"duration":4,"tweenEasing":0,"x":8.59,"y":-0.88},{"duration":3,"tweenEasing":0,"x":8.88,"y":-0.75},{"duration":4,"tweenEasing":0,"x":8.75,"y":-0.71},{"duration":5,"tweenEasing":0,"x":8.59,"y":-0.72},{"duration":0,"x":8.63,"y":-0.6}],"rotateFrame":[{"tweenEasing":0,"rotate":-17.55},{"duration":5,"tweenEasing":0,"rotate":-55.87},{"duration":3,"tweenEasing":0,"rotate":-34.03},{"tweenEasing":0,"rotate":-27.28},{"duration":2,"tweenEasing":0,"rotate":-26.79},{"duration":10,"tweenEasing":0,"rotate":-40.34},{"duration":10,"tweenEasing":0,"rotate":-43.84},{"duration":5,"tweenEasing":0,"rotate":-40.58},{"duration":2,"tweenEasing":0,"rotate":27.58},{"duration":3,"tweenEasing":0,"rotate":-2.01},{"duration":3,"tweenEasing":0,"rotate":25.82},{"duration":2,"tweenEasing":0,"rotate":8.52},{"duration":3,"tweenEasing":0,"rotate":1.76},{"duration":4,"tweenEasing":0,"rotate":5.03},{"duration":3,"tweenEasing":0,"rotate":-6.71},{"duration":4,"tweenEasing":0,"rotate":13.13},{"duration":5,"tweenEasing":0,"rotate":1.29},{"duration":0,"rotate":2.29}],"scaleFrame":[{"duration":32,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":8,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":5,"x":1.03,"y":0.99}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":66,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":66,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":66,"value":-1}]},{"name":"shouder_r","displayFrame":[{"duration":66,"value":1}]},{"name":"chest","displayFrame":[{"duration":50,"value":1},{"duration":16,"value":2}]},{"name":"forearm_l","displayFrame":[{"duration":66,"value":1}]},{"name":"calf_r","displayFrame":[{"duration":66,"value":1}]},{"name":"foot_r","displayFrame":[{"duration":66,"value":1}]},{"name":"calf_l","displayFrame":[{"duration":66,"value":1}]}]},{"duration":9,"fadeInTime":0.1,"name":"hit","bone":[{"name":"pelvis","translateFrame":[{"tweenEasing":0,"x":0.05,"y":-0.09},{"duration":4,"tweenEasing":0,"x":0.02,"y":-0.04},{"duration":4,"tweenEasing":0,"x":0.04,"y":-0.01},{"duration":0,"x":0.02,"y":-0.01}],"rotateFrame":[{"tweenEasing":0,"rotate":6.75},{"duration":4,"tweenEasing":0,"rotate":-8.5},{"duration":4,"tweenEasing":0,"rotate":-10.01},{"duration":0,"rotate":-7}],"scaleFrame":[{"tweenEasing":0,"x":0.97},{"duration":8,"x":0.99}]},{"name":"chest","translateFrame":[{"tweenEasing":0,"x":-0.51,"y":0.82},{"duration":2,"tweenEasing":0,"x":0.23,"y":1.24},{"duration":2,"tweenEasing":0,"x":0.49,"y":-2.96},{"duration":4,"tweenEasing":0,"x":0.18,"y":0.97},{"duration":0,"x":0.12,"y":0.25}],"rotateFrame":[{"tweenEasing":0,"rotate":27.42},{"duration":2,"tweenEasing":0,"rotate":33.34},{"duration":2,"tweenEasing":0,"rotate":5.29},{"duration":4,"tweenEasing":0,"rotate":2.27},{"duration":0,"rotate":-2.97}],"scaleFrame":[{"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":0,"x":1.01}]},{"name":"shouder_r","translateFrame":[{"tweenEasing":0,"x":-9.53,"y":38.52},{"duration":2,"tweenEasing":0,"x":-14.68,"y":9.08},{"duration":2,"tweenEasing":0,"x":6.64,"y":-10.66},{"duration":4,"tweenEasing":0,"x":9.17,"y":-12.06},{"duration":0,"x":8.94,"y":-12.12}],"rotateFrame":[{"tweenEasing":0,"rotate":-38.87},{"duration":2,"tweenEasing":0,"rotate":-31.32},{"duration":2,"tweenEasing":0,"rotate":6.94},{"duration":4,"tweenEasing":0,"rotate":14.17},{"duration":0,"rotate":8.92}]},{"name":"shouder_l","translateFrame":[{"tweenEasing":0,"x":11.2,"y":-40.24},{"duration":2,"tweenEasing":0,"x":20.13,"y":-10.5},{"duration":2,"tweenEasing":0,"x":-2.49,"y":14.81},{"duration":4,"tweenEasing":0,"x":-4.81,"y":17.52},{"duration":0,"x":-4.43,"y":17.43}],"rotateFrame":[{"tweenEasing":0,"rotate":-38.11},{"duration":2,"tweenEasing":0,"rotate":-36.55},{"duration":2,"tweenEasing":0,"rotate":-18.59},{"duration":4,"tweenEasing":0,"rotate":-16.13},{"duration":0,"rotate":-9.84}],"scaleFrame":[{"tweenEasing":0,"x":0.9},{"duration":2,"tweenEasing":0,"x":1.14},{"duration":2,"tweenEasing":0,"x":1.19},{"duration":4,"tweenEasing":0,"x":1.2},{"duration":0,"x":1.12}]},{"name":"forearm_l","translateFrame":[{"tweenEasing":0,"x":4.97,"y":0.19},{"duration":2,"tweenEasing":0,"x":-0.73,"y":-0.01},{"duration":2,"tweenEasing":0,"x":-0.89,"y":-0.24},{"duration":4,"tweenEasing":0,"x":-0.9,"y":-0.25},{"duration":0,"x":-0.44,"y":0.05}],"rotateFrame":[{"tweenEasing":0,"rotate":15.75},{"duration":2,"tweenEasing":0,"rotate":21.34},{"duration":2,"tweenEasing":0,"rotate":27.35},{"duration":4,"tweenEasing":0,"rotate":26.6},{"duration":0,"rotate":19.55}],"scaleFrame":[{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.95},{"duration":0,"x":0.89}]},{"name":"forearm_r","translateFrame":[{"tweenEasing":0,"x":6.09,"y":1.17},{"duration":2,"tweenEasing":0,"x":1.56,"y":0.36},{"duration":2,"tweenEasing":0,"x":-6.74,"y":-0.81},{"duration":4,"tweenEasing":0,"x":-10.71,"y":-1.18},{"duration":0,"x":-7.55,"y":-0.86}],"rotateFrame":[{"tweenEasing":0,"rotate":-18.3},{"duration":2,"tweenEasing":0,"rotate":14.66},{"duration":2,"tweenEasing":0,"rotate":19.51},{"duration":4,"tweenEasing":0,"rotate":19},{"duration":0,"rotate":15.51}],"scaleFrame":[{"tweenEasing":0,"x":1.03,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95},{"duration":6,"x":1.02}]},{"name":"hand_r","translateFrame":[{"tweenEasing":0,"x":0.7,"y":-0.3},{"duration":2,"tweenEasing":0,"x":0.07,"y":-0.08},{"duration":2,"tweenEasing":0,"x":-0.39,"y":0.12},{"duration":4,"tweenEasing":0,"x":-0.45,"y":-0.19},{"duration":0,"x":-0.46,"y":0.1}],"rotateFrame":[{"tweenEasing":0,"rotate":-1.49},{"duration":2,"tweenEasing":0,"rotate":0.24},{"duration":2,"tweenEasing":0,"rotate":0.26},{"duration":4,"tweenEasing":0,"rotate":0.51},{"duration":0,"rotate":0.5}],"scaleFrame":[{"tweenEasing":0,"x":0.98,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":0,"x":1.03}]},{"name":"hand_l","translateFrame":[{"tweenEasing":0,"x":0.17,"y":0.79},{"duration":2,"tweenEasing":0,"x":0.25,"y":0.18},{"duration":2,"tweenEasing":0,"x":0.38,"y":-0.13},{"duration":4,"tweenEasing":0,"x":0.3,"y":-0.26},{"duration":0,"x":0.08,"y":-0.58}],"rotateFrame":[{"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-0.01},{"duration":2,"tweenEasing":0,"rotate":0.01},{"duration":4,"tweenEasing":0,"rotate":0.04},{"duration":0,"rotate":0.15}],"scaleFrame":[{"tweenEasing":0,"x":1.01,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.01,"y":1.02},{"duration":2,"tweenEasing":0,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.96},{"duration":0,"x":0.97,"y":0.91}]},{"name":"weapon_hand_l","translateFrame":[{"tweenEasing":0,"x":0.02,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.02,"y":0.04},{"duration":4,"tweenEasing":0,"x":0.02,"y":0.01},{"duration":0,"x":0.01,"y":0.02}],"rotateFrame":[{"tweenEasing":0,"rotate":24.8},{"duration":2,"tweenEasing":0,"rotate":8.08},{"duration":2,"tweenEasing":0,"rotate":-9.64},{"duration":4,"tweenEasing":0,"rotate":-21.02},{"duration":0,"rotate":-30.54}]},{"name":"weapon_hand_r","translateFrame":[{"tweenEasing":0,"x":0.01,"y":-0.06},{"duration":2,"tweenEasing":0,"x":-0.01,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":4,"tweenEasing":0,"x":0.01},{"duration":0,"x":0.01,"y":-0.01}],"rotateFrame":[{"tweenEasing":0,"rotate":-12.54},{"duration":2,"tweenEasing":0,"rotate":-9.28},{"duration":2,"tweenEasing":0,"rotate":25.03},{"duration":4,"tweenEasing":0,"rotate":45.83},{"duration":0,"rotate":24.78}]},{"name":"root","translateFrame":[{"tweenEasing":0,"x":22.65,"y":8.35},{"duration":4,"tweenEasing":0,"x":-5.05,"y":9.2},{"duration":4,"tweenEasing":0,"x":-19.9,"y":13.5},{"duration":0,"x":-14.75,"y":12.45}]},{"name":"thigh_r","translateFrame":[{"tweenEasing":0,"x":3.27,"y":-5.25},{"duration":2,"tweenEasing":0,"x":4.88,"y":2.39},{"duration":2,"tweenEasing":0,"x":5.29,"y":7.07},{"duration":4,"tweenEasing":0,"x":4.86,"y":3.57},{"duration":0,"x":3.48,"y":3.43}],"rotateFrame":[{"tweenEasing":0,"rotate":15.02},{"duration":2,"tweenEasing":0,"rotate":-23.27},{"duration":2,"tweenEasing":0,"rotate":-7.24},{"duration":4,"tweenEasing":0,"rotate":-12.24},{"duration":0,"rotate":-2.99}],"scaleFrame":[{"tweenEasing":0,"x":1.02,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.78,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.78},{"duration":4,"tweenEasing":0,"x":0.72},{"duration":0,"x":0.79}]},{"name":"thigh_l","translateFrame":[{"tweenEasing":0,"x":-3.18,"y":5.08},{"duration":2,"tweenEasing":0,"x":-4.79,"y":-2.52},{"duration":2,"tweenEasing":0,"x":-4.39,"y":0.67},{"duration":4,"tweenEasing":0,"x":-4.78,"y":-3.69},{"duration":0,"x":-3.45,"y":-3.44}],"rotateFrame":[{"tweenEasing":0,"rotate":-9.79},{"duration":2,"tweenEasing":0,"rotate":-6.03},{"duration":2,"tweenEasing":0,"rotate":-8.79},{"duration":4,"tweenEasing":0,"rotate":-10.29},{"duration":0,"rotate":-10.04}],"scaleFrame":[{"duration":9,"x":1.01}]},{"name":"calf_r","translateFrame":[{"tweenEasing":0,"x":0.29,"y":-0.16},{"duration":2,"tweenEasing":0,"x":-0.52,"y":-0.16},{"duration":2,"tweenEasing":0,"x":-0.49,"y":0.1},{"duration":4,"tweenEasing":0,"x":-0.62,"y":0.08},{"duration":0,"x":-0.42,"y":0.21}],"rotateFrame":[{"tweenEasing":0,"rotate":5.31},{"duration":2,"tweenEasing":0,"rotate":28.71},{"duration":2,"tweenEasing":0,"rotate":22.72},{"duration":4,"tweenEasing":0,"rotate":25.67},{"duration":0,"rotate":17.72}],"scaleFrame":[{"tweenEasing":0,"x":1.02,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":6,"x":0.95}]},{"name":"calf_l","translateFrame":[{"tweenEasing":0,"x":-0.04,"y":-0.14},{"duration":2,"tweenEasing":0,"y":-0.1},{"duration":2,"tweenEasing":0,"x":-0.05,"y":-0.15},{"duration":4,"tweenEasing":0,"x":-0.04,"y":-0.14},{"duration":0,"x":-0.06,"y":-0.2}],"rotateFrame":[{"tweenEasing":0,"rotate":35.07},{"duration":2,"tweenEasing":0,"rotate":6.03},{"duration":2,"tweenEasing":0,"rotate":-2.48},{"duration":4,"tweenEasing":0,"rotate":-4.24},{"duration":0,"rotate":1.03}],"scaleFrame":[{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":0,"x":0.93}]},{"name":"foot_r","translateFrame":[{"tweenEasing":0,"x":-1.27,"y":-0.07},{"duration":2,"tweenEasing":0,"x":0.05,"y":-0.32},{"duration":2,"tweenEasing":0,"x":-0.17,"y":-0.4},{"duration":4,"tweenEasing":0,"x":-0.17,"y":-0.52},{"duration":0,"x":-0.14,"y":-0.51}],"rotateFrame":[{"tweenEasing":0,"rotate":-20.33},{"duration":2,"tweenEasing":0,"rotate":-5.51},{"duration":2,"tweenEasing":0,"rotate":-15.56},{"duration":4,"tweenEasing":0,"rotate":-13.55},{"duration":0,"rotate":-14.8}]},{"name":"foot_l","translateFrame":[{"tweenEasing":0,"x":0.31,"y":0.12},{"duration":2,"tweenEasing":0,"x":0.08,"y":0.01},{"duration":2,"tweenEasing":0,"x":-0.07,"y":-0.02},{"duration":4,"tweenEasing":0,"x":-0.13,"y":0.05},{"duration":0,"x":-0.01,"y":0.02}],"rotateFrame":[{"tweenEasing":0,"rotate":-25.26},{"duration":2,"tweenEasing":0,"rotate":-0.03},{"duration":2,"tweenEasing":0,"rotate":11.27},{"duration":4,"tweenEasing":0,"rotate":14.52},{"duration":0,"rotate":8.97}]}],"slot":[{"name":"pelvis","displayFrame":[{"value":1},{"duration":8}]},{"name":"forearm_r","displayFrame":[{"duration":9,"value":1}]},{"name":"hand_r","displayFrame":[{"value":1},{"duration":8}]},{"name":"shouder_r","displayFrame":[{"duration":9,"value":1}]},{"name":"chest","displayFrame":[{"value":1},{"duration":8}]},{"name":"shouder_l","displayFrame":[{"value":1},{"duration":8}]},{"name":"calf_r","displayFrame":[{"value":1},{"duration":8}]}]},{"duration":14,"fadeInTime":0.2,"name":"attack_01","frame":[{"duration":4},{"duration":0,"sound":"200025"}],"bone":[{"name":"pelvis","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.04,"y":-0.05},{"tweenEasing":0,"x":0.01,"y":-0.14},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.12},{"duration":2,"tweenEasing":0,"x":1.83,"y":0.06},{"duration":4,"tweenEasing":0,"x":0.02,"y":-0.13},{"duration":0,"x":1.23,"y":-0.64}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-5.75},{"tweenEasing":0,"rotate":0.25},{"duration":2,"tweenEasing":0,"rotate":13.52},{"duration":2,"tweenEasing":0,"rotate":22.3},{"duration":4,"tweenEasing":0,"rotate":24.3},{"duration":0,"rotate":17.78}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":0,"x":0.96}]},{"name":"chest","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.21,"y":-1.32},{"tweenEasing":0,"x":-1.02,"y":0.14},{"duration":2,"tweenEasing":0,"x":-1.82,"y":3.65},{"duration":2,"tweenEasing":0,"x":-1.86,"y":4.27},{"duration":4,"tweenEasing":0,"x":-1.86,"y":3.71},{"duration":0,"x":-1.45,"y":2.22}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":5.96},{"tweenEasing":0,"rotate":7.79},{"duration":2,"tweenEasing":0,"rotate":10.03},{"duration":2,"tweenEasing":0,"rotate":1.45},{"duration":4,"tweenEasing":0,"rotate":-0.75},{"duration":0,"rotate":1.89}],"scaleFrame":[{"duration":5,"tweenEasing":0},{"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.98}]},{"name":"shouder_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":7.83,"y":-1.17},{"duration":3,"tweenEasing":0,"x":11.81,"y":0.22},{"tweenEasing":0,"x":8.28,"y":8.73},{"duration":2,"tweenEasing":0,"x":-12.11,"y":106.95},{"duration":2,"tweenEasing":0,"x":-11.12,"y":108.1},{"duration":4,"tweenEasing":0,"x":-15.24,"y":97.4},{"duration":0,"x":-15.49,"y":55.1}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-129.6},{"duration":3,"tweenEasing":0,"rotate":167.8},{"tweenEasing":0,"rotate":176.6},{"duration":2,"tweenEasing":0,"rotate":-74.75},{"duration":2,"tweenEasing":0,"rotate":-56.5},{"duration":4,"tweenEasing":0,"rotate":-60.7},{"duration":0,"rotate":-54.25}]},{"name":"shouder_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":2.1,"y":-2.14},{"tweenEasing":0,"x":-8.66,"y":-32.23},{"duration":2,"tweenEasing":0,"x":26.23,"y":-107.84},{"duration":2,"tweenEasing":0,"x":21.59,"y":-110.42},{"duration":4,"tweenEasing":0,"x":21.69,"y":-107.7},{"duration":0,"x":23.55,"y":-77.25}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-48.37},{"tweenEasing":0,"rotate":1.39},{"duration":2,"tweenEasing":0,"rotate":24.27},{"duration":2,"tweenEasing":0,"rotate":24.73},{"duration":4,"tweenEasing":0,"rotate":26.04},{"duration":0,"rotate":13.44}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.67},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.06},{"duration":4,"tweenEasing":0,"x":1.06},{"duration":0,"x":1.04}]},{"name":"forearm_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-1.06,"y":1.01},{"tweenEasing":0,"x":1.5,"y":-0.3},{"duration":2,"tweenEasing":0,"x":4,"y":-0.91},{"duration":2,"tweenEasing":0,"x":3.71,"y":-0.31},{"duration":4,"tweenEasing":0,"x":3.7,"y":-0.26},{"duration":0,"x":2.03,"y":7.18}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":12.19},{"tweenEasing":0,"rotate":-34.07},{"duration":2,"tweenEasing":0,"rotate":5.44},{"duration":2,"tweenEasing":0,"rotate":28.28},{"duration":4,"tweenEasing":0,"rotate":24.27},{"duration":0,"rotate":1.22}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.78,"y":1.01},{"tweenEasing":0,"x":0.95,"y":1.01},{"duration":2,"tweenEasing":0,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.25,"y":1.01},{"duration":4,"tweenEasing":0,"x":1.13,"y":1.01},{"duration":0,"x":1.15,"y":1.01}]},{"name":"forearm_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":5.42,"y":0.84},{"duration":3,"tweenEasing":0,"x":5.51,"y":0.79},{"tweenEasing":0,"x":6.67,"y":0.86},{"duration":2,"tweenEasing":0,"x":6.46,"y":1.57},{"duration":2,"tweenEasing":0,"x":7.22,"y":1.21},{"duration":4,"tweenEasing":0,"x":6.78,"y":1.41},{"duration":0,"x":1.24,"y":-0.89}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":12.78},{"duration":3,"tweenEasing":0,"rotate":12.78},{"tweenEasing":0,"rotate":-15.8},{"duration":2,"tweenEasing":0,"rotate":0.41},{"duration":2,"tweenEasing":0,"rotate":-14.66},{"duration":4,"tweenEasing":0,"rotate":14.63},{"duration":0,"rotate":2.97}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.03},{"duration":4,"tweenEasing":0,"x":1.03},{"duration":0,"x":1.02}]},{"name":"hand_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":0.5,"y":-0.45},{"duration":3,"tweenEasing":0,"x":0.44,"y":-0.46},{"tweenEasing":0,"x":1.18,"y":-0.15},{"duration":2,"tweenEasing":0,"x":0.39,"y":-0.22},{"duration":2,"tweenEasing":0,"x":0.35,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.44,"y":-0.15},{"duration":0,"x":-3.42,"y":-0.85}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":6.76},{"duration":3,"tweenEasing":0,"rotate":6.75},{"tweenEasing":0,"rotate":-2.5},{"duration":2,"tweenEasing":0,"rotate":76.22},{"duration":2,"tweenEasing":0,"rotate":58.71},{"duration":4,"tweenEasing":0,"rotate":41.93},{"duration":0,"rotate":38.08}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.17},{"duration":3,"tweenEasing":0,"x":1.17},{"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":0.94},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.98}]},{"name":"hand_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.84,"y":-1.09},{"tweenEasing":0,"x":-0.64,"y":1.37},{"duration":2,"tweenEasing":0,"x":-16.19,"y":-0.82},{"duration":2,"tweenEasing":0,"x":-17.14,"y":-1.08},{"duration":4,"tweenEasing":0,"x":-16.86,"y":-1.09},{"duration":0,"x":-18.75,"y":-0.73}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-2.57},{"tweenEasing":0,"rotate":4.32},{"duration":2,"tweenEasing":0,"rotate":-19.52},{"duration":2,"tweenEasing":0,"rotate":-14.64},{"duration":4,"tweenEasing":0,"rotate":-0.79},{"duration":0,"rotate":14.44}],"scaleFrame":[{"duration":5,"tweenEasing":0,"y":0.96},{"tweenEasing":0,"y":0.96},{"duration":2,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.07,"y":1.19},{"duration":4,"tweenEasing":0,"x":1.02,"y":1.05},{"duration":0,"x":1.02,"y":1.03}]},{"name":"weapon_hand_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.04,"y":0.02},{"tweenEasing":0,"x":0.01},{"duration":2,"tweenEasing":0,"x":0.05,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.08,"y":-0.03},{"duration":4,"tweenEasing":0,"x":0.08,"y":-0.06},{"duration":0,"x":0.09,"y":0.05}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":3.1},{"tweenEasing":0,"rotate":32.41},{"duration":2,"tweenEasing":0,"rotate":6.87},{"duration":2,"tweenEasing":0,"rotate":-13.06},{"duration":4,"tweenEasing":0,"rotate":-13.08},{"duration":0,"rotate":-8.52}]},{"name":"weapon_hand_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.03},{"duration":3,"tweenEasing":0,"x":0.03,"y":-0.05},{"tweenEasing":0,"x":0.05,"y":0.02},{"duration":2,"tweenEasing":0,"x":-0.04,"y":-0.05},{"duration":2,"tweenEasing":0,"x":-0.01,"y":-0.08},{"duration":4,"tweenEasing":0,"x":-0.04,"y":-0.08},{"duration":0,"x":-0.03,"y":-0.02}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-96.78},{"duration":3,"tweenEasing":0,"rotate":-156.22},{"tweenEasing":0,"clockwise":1,"rotate":-179.75},{"duration":2,"tweenEasing":0,"rotate":38.81},{"duration":2,"tweenEasing":0,"rotate":39.31},{"duration":4,"tweenEasing":0,"rotate":29.29},{"duration":0,"rotate":15.52}]},{"name":"root","translateFrame":[{"duration":5,"tweenEasing":0,"x":23.5,"y":-0.45},{"tweenEasing":0,"x":9.05,"y":18.8},{"duration":4,"tweenEasing":0,"x":3.35,"y":26.95},{"duration":4,"tweenEasing":0,"x":6.25,"y":28.7},{"duration":0,"x":4.2,"y":19.2}]},{"name":"thigh_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.85,"y":2.4},{"tweenEasing":0,"x":6.91,"y":-21.62},{"duration":2,"tweenEasing":0,"x":12.56,"y":-49.03},{"duration":2,"tweenEasing":0,"x":17,"y":-50.06},{"duration":4,"tweenEasing":0,"x":16.71,"y":-47.16},{"duration":0,"x":11.09,"y":-31.49}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":4.5},{"tweenEasing":0,"rotate":-0.5},{"duration":2,"tweenEasing":0,"rotate":27.82},{"duration":2,"tweenEasing":0,"rotate":29.32},{"duration":4,"tweenEasing":0,"rotate":26.56},{"duration":0,"rotate":17.58}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.98}]},{"name":"thigh_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.87,"y":-2.59},{"tweenEasing":0,"x":-6.79,"y":21.1},{"duration":2,"tweenEasing":0,"x":-12.35,"y":48.03},{"duration":2,"tweenEasing":0,"x":-13.2,"y":49.38},{"duration":4,"tweenEasing":0,"x":-16.52,"y":46.24},{"duration":0,"x":-11.08,"y":30.81}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":15.06},{"tweenEasing":0,"rotate":-33.12},{"duration":2,"tweenEasing":0,"rotate":-10.04},{"duration":2,"tweenEasing":0,"rotate":-10.04},{"duration":4,"tweenEasing":0,"rotate":-7.03},{"duration":0,"rotate":-4.75}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.96,"y":1.01},{"tweenEasing":0,"x":1.01,"y":1.01},{"duration":8,"x":0.98,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.16,"y":-0.05},{"tweenEasing":0,"x":0.07,"y":-0.16},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.1},{"duration":2,"tweenEasing":0,"x":-0.06,"y":-0.07},{"duration":4,"tweenEasing":0,"x":-0.04,"y":-0.12},{"duration":0,"x":0.44,"y":-7.58}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":10.3},{"tweenEasing":0,"rotate":39.9},{"duration":2,"tweenEasing":0,"rotate":19.86},{"duration":2,"tweenEasing":0,"rotate":22.62},{"duration":4,"tweenEasing":0,"rotate":26.38},{"duration":0,"rotate":25.1}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":0.99,"y":1.01},{"duration":4,"tweenEasing":0,"x":1.05,"y":1.01},{"duration":4,"tweenEasing":0,"x":1.05,"y":1.01},{"duration":0,"x":1.01,"y":1.01}]},{"name":"calf_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.16,"y":0.06},{"tweenEasing":0,"x":-0.24,"y":-0.24},{"duration":2,"tweenEasing":0,"x":-0.19,"y":-0.03},{"duration":2,"tweenEasing":0,"x":-0.2,"y":-0.02},{"duration":4,"tweenEasing":0,"x":-0.21,"y":-0.06},{"duration":0,"x":-0.19,"y":0.03}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":5.94},{"tweenEasing":0,"rotate":32.87},{"duration":2,"tweenEasing":0,"rotate":-32.11},{"duration":2,"tweenEasing":0,"rotate":-32.11},{"duration":4,"tweenEasing":0,"rotate":-32.1},{"duration":0,"rotate":-21.33}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.93},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.21},{"duration":0,"x":1.14}]},{"name":"foot_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":-1.2,"y":-0.14},{"tweenEasing":0,"x":-1.25,"y":-0.19},{"duration":2,"tweenEasing":0,"x":-1.35,"y":-0.17},{"duration":2,"tweenEasing":0,"x":-1.4,"y":0.04},{"duration":4,"tweenEasing":0,"x":-1.4,"y":-0.02},{"duration":0,"x":-1.68,"y":0.12}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-4.04},{"tweenEasing":0,"rotate":-35.15},{"duration":2,"tweenEasing":0,"rotate":-47.69},{"duration":2,"tweenEasing":0,"rotate":-52.7},{"duration":4,"tweenEasing":0,"rotate":-54.2},{"duration":0,"rotate":-43.45}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":8}]},{"name":"foot_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.41,"y":0.12},{"tweenEasing":0,"x":9.7,"y":-0.23},{"duration":2,"tweenEasing":0,"x":9.18,"y":-0.4},{"duration":2,"tweenEasing":0,"x":9.24,"y":-0.34},{"duration":4,"tweenEasing":0,"x":-0.48,"y":-0.36},{"duration":0,"x":-2.63,"y":-1.92}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-21.05},{"tweenEasing":0,"rotate":0.19},{"duration":2,"tweenEasing":0,"rotate":42.16},{"duration":2,"tweenEasing":0,"rotate":42.15},{"duration":4,"tweenEasing":0,"rotate":39.26},{"duration":0,"rotate":26.17}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":6},{"duration":8,"value":2},{"duration":0,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":14,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"shouder_r","displayFrame":[{"duration":14,"value":1}]},{"name":"chest","displayFrame":[{"duration":6},{"duration":8,"value":2},{"duration":0,"value":1}]},{"name":"shouder_l","displayFrame":[{"duration":6},{"duration":8,"value":2}]},{"name":"hand_l","displayFrame":[{"duration":6},{"duration":8,"value":2},{"duration":0,"value":3}]},{"name":"forearm_l","displayFrame":[{"duration":6},{"duration":8,"value":2}]},{"name":"effect_r","displayFrame":[{"duration":6,"value":-1},{"duration":5},{"duration":3,"value":-1}]},{"name":"calf_r","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"calf_l","displayFrame":[{"duration":6},{"duration":8,"value":1},{"duration":0}]}]},{"duration":48,"fadeInTime":0.2,"name":"skill_03","frame":[{"duration":33},{"sound":"200029"},{"duration":0,"events":[{"name":"onTimeStart"}]}],"bone":[{"name":"pelvis","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.04,"y":-0.02},{"duration":31,"tweenEasing":0,"x":0.03,"y":-0.08},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.06},{"duration":2,"tweenEasing":0,"x":0.02,"y":-0.05},{"duration":4,"tweenEasing":0,"x":0.02,"y":-0.09},{"duration":3,"tweenEasing":0,"x":8.52,"y":-0.88},{"duration":3,"tweenEasing":0,"x":0.03,"y":-0.09},{"duration":0,"x":-0.03,"y":-0.09}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":23.05},{"duration":31,"tweenEasing":0,"rotate":7.25},{"duration":2,"tweenEasing":0,"rotate":-22.53},{"duration":2,"tweenEasing":0,"rotate":23.8},{"duration":4,"tweenEasing":0,"rotate":49.66},{"duration":3,"tweenEasing":0,"rotate":39.11},{"duration":3,"tweenEasing":0,"rotate":24.81},{"duration":0,"rotate":12.3}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.96,"y":0.99},{"duration":31,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":0,"x":0.99}]},{"name":"chest","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.92,"y":0.53},{"duration":31,"tweenEasing":0,"x":-0.24,"y":0.97},{"duration":2,"tweenEasing":0,"x":-1.49,"y":6.66},{"duration":2,"tweenEasing":0,"x":-1.73,"y":-2.35},{"duration":4,"tweenEasing":0,"x":-4.98,"y":-12.12},{"duration":3,"tweenEasing":0,"x":-5.47,"y":-15.32},{"duration":3,"tweenEasing":0,"x":-3.43,"y":-12.88},{"duration":0,"x":-0.89,"y":-6.66}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":21.69},{"duration":31,"tweenEasing":0,"rotate":-3.4},{"duration":2,"tweenEasing":0,"rotate":1.59},{"duration":2,"tweenEasing":0,"rotate":47.72},{"duration":4,"tweenEasing":0,"rotate":23.57},{"duration":3,"tweenEasing":0,"rotate":30.93},{"duration":3,"tweenEasing":0,"rotate":22.58},{"duration":0,"rotate":11.3}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":31,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":4,"tweenEasing":0,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":0,"x":0.99}]},{"name":"shouder_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-13.52,"y":40.87},{"duration":2,"tweenEasing":0,"x":-4.87,"y":38.87},{"duration":29,"tweenEasing":0,"x":-9.2,"y":42.09},{"duration":2,"tweenEasing":0,"x":-3.89,"y":44.4},{"duration":2,"tweenEasing":0,"x":-20.24,"y":71.04},{"duration":4,"tweenEasing":0,"x":-20.31,"y":71.88},{"duration":3,"tweenEasing":0,"x":-21.45,"y":67.91},{"duration":3,"tweenEasing":0,"x":-7.9,"y":47.44},{"duration":0,"x":-5.52,"y":37.58}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-32.21},{"duration":2,"tweenEasing":0,"rotate":-26.21},{"duration":29,"tweenEasing":0,"rotate":-56.66},{"duration":2,"tweenEasing":0,"rotate":-179.92},{"duration":2,"tweenEasing":0,"rotate":-100.73},{"duration":4,"tweenEasing":0,"rotate":-102.06},{"duration":3,"tweenEasing":0,"rotate":-113.23},{"duration":3,"tweenEasing":0,"rotate":-70.65},{"duration":0,"rotate":-31.81}]},{"name":"shouder_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":30.61,"y":-59.53},{"duration":2,"tweenEasing":0,"x":18.08,"y":-47.26},{"duration":29,"tweenEasing":0,"x":16.49,"y":-45.48},{"duration":2,"tweenEasing":0,"x":8.54,"y":-49.19},{"duration":2,"tweenEasing":0,"x":28.51,"y":-71.5},{"duration":4,"tweenEasing":0,"x":23.12,"y":-71.11},{"duration":3,"tweenEasing":0,"x":29.82,"y":-69.97},{"duration":3,"tweenEasing":0,"x":27.73,"y":-59.24},{"duration":0,"x":15.46,"y":-39.24}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-2.11},{"duration":2,"tweenEasing":0,"rotate":-7.16},{"duration":29,"tweenEasing":0,"rotate":-40.37},{"duration":2,"tweenEasing":0,"rotate":-126.51},{"duration":2,"tweenEasing":0,"rotate":-54.13},{"duration":4,"tweenEasing":0,"rotate":-56.46},{"duration":3,"tweenEasing":0,"rotate":-59.88},{"duration":3,"tweenEasing":0,"rotate":-43.84},{"duration":0,"rotate":-21.78}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.91,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":29,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.96},{"duration":0,"x":0.99}]},{"name":"forearm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":4.74,"y":-0.94},{"duration":2,"tweenEasing":0,"x":5.05},{"duration":29,"tweenEasing":0,"x":4.93,"y":0.63},{"duration":2,"tweenEasing":0,"x":5.91,"y":-1.18},{"duration":2,"tweenEasing":0,"x":4.69,"y":-0.1},{"duration":4,"tweenEasing":0,"x":4.45,"y":-0.05},{"duration":3,"tweenEasing":0,"x":4.45,"y":0.11},{"duration":3,"tweenEasing":0,"x":4.59,"y":-0.08},{"duration":0,"x":1.72}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-10.87},{"duration":2,"tweenEasing":0,"rotate":-22.37},{"duration":29,"tweenEasing":0,"rotate":-31.14},{"duration":2,"tweenEasing":0,"rotate":-41.66},{"duration":2,"tweenEasing":0,"rotate":-36.65},{"duration":4,"tweenEasing":0,"rotate":-42.16},{"duration":3,"tweenEasing":0,"rotate":-37.89},{"duration":3,"tweenEasing":0,"rotate":-5.03},{"duration":0,"rotate":-2.51}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.91,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":29,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":0,"y":1.01}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":6.87,"y":1.13},{"duration":2,"tweenEasing":0,"x":5.29,"y":1.37},{"duration":29,"tweenEasing":0,"x":1.58,"y":0.27},{"duration":2,"tweenEasing":0,"x":8.33,"y":1.24},{"duration":2,"tweenEasing":0,"x":7.65,"y":1.15},{"duration":4,"tweenEasing":0,"x":7.32,"y":1.12},{"duration":3,"tweenEasing":0,"x":7.55,"y":0.99},{"duration":3,"tweenEasing":0,"x":7.73,"y":1.32},{"duration":0,"x":6.44,"y":1.14}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-5.79},{"duration":2,"tweenEasing":0,"rotate":-33.15},{"duration":29,"tweenEasing":0,"rotate":-45.42},{"duration":2,"tweenEasing":0,"rotate":12.03},{"duration":2,"tweenEasing":0,"rotate":-11.34},{"duration":4,"tweenEasing":0,"rotate":-0.79},{"duration":3,"tweenEasing":0,"rotate":6.95},{"duration":3,"tweenEasing":0,"rotate":-7.3},{"duration":0,"rotate":-9.52}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":0.93,"y":0.99},{"duration":29,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":0,"x":1.02,"y":0.99}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.65,"y":-0.29},{"duration":2,"tweenEasing":0,"x":0.97,"y":-1.53},{"duration":29,"tweenEasing":0,"x":2.3,"y":-1.37},{"duration":2,"tweenEasing":0,"x":0.92,"y":-0.39},{"duration":2,"tweenEasing":0,"x":1.22,"y":-0.41},{"duration":4,"tweenEasing":0,"x":1.04,"y":-0.29},{"duration":3,"tweenEasing":0,"x":1.01,"y":-0.34},{"duration":3,"tweenEasing":0,"x":0.92,"y":-0.14},{"duration":0,"x":0.57,"y":-0.31}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":12.01},{"duration":2,"tweenEasing":0,"rotate":18.07},{"duration":29,"tweenEasing":0,"rotate":18.27},{"duration":2,"tweenEasing":0,"rotate":-6.26},{"duration":2,"tweenEasing":0,"rotate":48.15},{"duration":4,"tweenEasing":0,"rotate":37.86},{"duration":3,"tweenEasing":0,"rotate":44.89},{"duration":3,"tweenEasing":0,"rotate":46.12},{"duration":0,"rotate":34.82}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":29,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":6,"x":0.98}]},{"name":"hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.42,"y":0.68},{"duration":2,"tweenEasing":0,"x":-0.05,"y":1.21},{"duration":29,"tweenEasing":0,"x":-0.09,"y":0.44},{"duration":2,"tweenEasing":0,"x":2.11,"y":1.77},{"duration":2,"tweenEasing":0,"x":-0.19,"y":0.85},{"duration":4,"tweenEasing":0,"x":-0.23,"y":0.73},{"duration":3,"tweenEasing":0,"x":-0.25,"y":0.82},{"duration":3,"tweenEasing":0,"x":-0.15,"y":0.71},{"duration":0,"x":0.01,"y":0.39}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":11.13},{"duration":2,"tweenEasing":0,"rotate":14.81},{"duration":29,"tweenEasing":0,"rotate":13.5},{"duration":2,"tweenEasing":0,"rotate":-0.66},{"duration":2,"tweenEasing":0,"rotate":51.14},{"duration":4,"tweenEasing":0,"rotate":57.16},{"duration":3,"tweenEasing":0,"rotate":59.68},{"duration":3,"tweenEasing":0,"rotate":39.57},{"duration":0,"rotate":19.81}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.98,"y":0.93},{"duration":2,"tweenEasing":0,"y":1.01},{"duration":29,"tweenEasing":0,"x":1.01,"y":1.02},{"duration":2,"tweenEasing":0,"x":1.11,"y":1.34},{"duration":6,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"y":0.98},{"duration":0,"x":1.01,"y":0.99}]},{"name":"weapon_hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.07,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.03},{"duration":29,"tweenEasing":0,"x":0.01,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.06,"y":-0.05},{"duration":2,"tweenEasing":0,"x":0.04,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.02},{"duration":3,"tweenEasing":0,"y":0.03},{"duration":3,"tweenEasing":0,"x":0.04},{"duration":0,"x":0.06,"y":0.13}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":21.59},{"duration":2,"tweenEasing":0,"rotate":19.03},{"duration":29,"tweenEasing":0,"rotate":16.97},{"duration":2,"tweenEasing":0,"rotate":13.9},{"duration":6,"tweenEasing":0,"rotate":18.48},{"duration":3,"tweenEasing":0,"rotate":18.48},{"duration":3,"tweenEasing":0,"rotate":17.86},{"duration":0,"rotate":9.1}]},{"name":"weapon_hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":0.02},{"duration":2,"tweenEasing":0,"x":-0.03,"y":-0.05},{"duration":29,"tweenEasing":0,"x":0.05,"y":-0.06},{"duration":2,"tweenEasing":0,"x":0.07,"y":-0.03},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.03},{"duration":4,"tweenEasing":0,"x":0.06,"y":-0.05},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.05},{"duration":3,"tweenEasing":0,"x":-0.01,"y":-0.07},{"duration":0,"x":-0.03,"y":0.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":31.29},{"duration":2,"tweenEasing":0,"rotate":-28.61},{"duration":29,"tweenEasing":0,"rotate":-69.47},{"duration":2,"tweenEasing":0,"rotate":176.49},{"duration":2,"tweenEasing":0,"rotate":21.15},{"duration":4,"tweenEasing":0,"rotate":22.28},{"duration":3,"tweenEasing":0,"rotate":22.28},{"duration":3,"tweenEasing":0,"rotate":28.28},{"duration":0,"rotate":32.29}]},{"name":"effect_r","translateFrame":[{"duration":5,"x":-164.4,"y":-257.55},{"duration":28,"tweenEasing":0,"x":-164.4,"y":-257.55},{"duration":3,"x":-167.4,"y":-324.55},{"duration":12,"x":-6.45,"y":6.45}],"rotateFrame":[{"duration":33,"rotate":35.08},{"duration":3,"rotate":35.08},{"duration":12,"rotate":7.52}],"scaleFrame":[{"duration":33,"x":0.18,"y":0.16},{"duration":3,"x":0.18,"y":0.16},{"duration":4,"tweenEasing":0,"x":1.21,"y":1.09},{"duration":8,"x":1.68,"y":1.51}]},{"name":"effect_l","scaleFrame":[{"duration":36},{"duration":4,"tweenEasing":0},{"duration":8,"x":1.4,"y":1.4}]},{"name":"root","translateFrame":[{"duration":3,"tweenEasing":0,"x":-18.9,"y":36.95},{"duration":31,"tweenEasing":0,"x":37.9,"y":-80.65},{"duration":2,"tweenEasing":0,"x":49.6,"y":-138.95},{"duration":2,"tweenEasing":0,"x":18.1,"y":43.1},{"duration":7,"tweenEasing":0,"x":17.25,"y":41.75},{"duration":3,"tweenEasing":0,"x":14.4,"y":40.8},{"duration":0,"x":7.2,"y":20.45}]},{"name":"thigh_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":4.72,"y":-13.54},{"duration":31,"tweenEasing":0,"x":-3.74,"y":-15.56},{"duration":2,"tweenEasing":0,"x":2.13,"y":-21.42},{"duration":2,"tweenEasing":0,"x":6.38,"y":-19.53},{"duration":4,"tweenEasing":0,"x":6.32,"y":-21.17},{"duration":3,"tweenEasing":0,"x":15.88,"y":-21.01},{"duration":3,"tweenEasing":0,"x":5.98,"y":-21.71},{"duration":0,"x":-5.59,"y":-11.37}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-63.19},{"duration":31,"tweenEasing":0,"rotate":-33.31},{"duration":2,"tweenEasing":0,"rotate":-11.76},{"duration":2,"tweenEasing":0,"rotate":-0.5},{"duration":4,"tweenEasing":0,"rotate":1},{"duration":3,"tweenEasing":0,"rotate":-1.59},{"duration":3,"tweenEasing":0,"rotate":5.01},{"duration":0,"rotate":5.51}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":31,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.9},{"duration":4,"tweenEasing":0,"x":0.91},{"duration":3,"tweenEasing":0,"x":0.84},{"duration":3,"tweenEasing":0,"x":0.84},{"duration":0,"x":0.92}]},{"name":"thigh_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-4.6,"y":13.45},{"duration":2,"tweenEasing":0,"x":3.75,"y":15.2},{"duration":29,"tweenEasing":0,"x":-6.54,"y":6.82},{"duration":2,"tweenEasing":0,"x":-2.08,"y":21},{"duration":2,"tweenEasing":0,"x":-6.25,"y":19.18},{"duration":4,"tweenEasing":0,"x":-6.13,"y":20.64},{"duration":3,"tweenEasing":0,"x":1.27,"y":18.96},{"duration":3,"tweenEasing":0,"x":-5.82,"y":21.24},{"duration":0,"x":-2.98,"y":10.67}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-43.89},{"duration":2,"tweenEasing":0,"rotate":37.86},{"duration":29,"tweenEasing":0,"rotate":-63.16},{"duration":2,"tweenEasing":0,"rotate":-39.39},{"duration":2,"tweenEasing":0,"rotate":-61.15},{"duration":4,"tweenEasing":0,"rotate":-63.15},{"duration":3,"tweenEasing":0,"rotate":-78.7},{"duration":3,"tweenEasing":0,"rotate":-66.92},{"duration":0,"rotate":-33.58}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.94,"y":1.01},{"duration":29,"tweenEasing":0,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.02,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.9,"y":1.01},{"duration":4,"tweenEasing":0,"x":0.94,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.97},{"duration":3,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.12,"y":-0.22},{"duration":31,"tweenEasing":0,"x":0.27,"y":-0.67},{"duration":2,"tweenEasing":0,"x":0.88,"y":-0.2},{"duration":2,"tweenEasing":0,"x":0.16,"y":-0.14},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.2},{"duration":3,"tweenEasing":0,"x":0.14,"y":-0.19},{"duration":3,"tweenEasing":0,"x":0.13,"y":-0.21},{"duration":0,"x":0.04,"y":-0.07}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":97.06},{"duration":31,"tweenEasing":0,"rotate":81.5},{"duration":2,"tweenEasing":0,"rotate":11.26},{"duration":2,"tweenEasing":0,"rotate":58.17},{"duration":4,"tweenEasing":0,"rotate":56.18},{"duration":3,"tweenEasing":0,"rotate":65.16},{"duration":3,"tweenEasing":0,"rotate":48.14},{"duration":0,"rotate":13.54}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94},{"duration":31,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.97,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.93},{"duration":0,"x":0.95,"y":0.99}]},{"name":"calf_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.16,"y":-0.42},{"duration":2,"tweenEasing":0,"x":0.45,"y":-0.13},{"duration":29,"tweenEasing":0,"x":0.35,"y":-0.6},{"duration":2,"tweenEasing":0,"x":0.24,"y":-0.14},{"duration":2,"tweenEasing":0,"x":0.16,"y":-0.64},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.52},{"duration":3,"tweenEasing":0,"x":0.09,"y":-0.49},{"duration":3,"tweenEasing":0,"x":-0.01,"y":-0.39},{"duration":0,"x":-5.91,"y":-0.03}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":17.05},{"duration":2,"tweenEasing":0,"rotate":-17.87},{"duration":29,"tweenEasing":0,"rotate":103.48},{"duration":2,"tweenEasing":0,"rotate":56.4},{"duration":2,"tweenEasing":0,"rotate":68.88},{"duration":4,"tweenEasing":0,"rotate":69.4},{"duration":3,"tweenEasing":0,"rotate":82.2},{"duration":3,"tweenEasing":0,"rotate":71.17},{"duration":0,"rotate":35.8}],"scaleFrame":[{"duration":3,"tweenEasing":0,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":29,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.77},{"duration":4,"tweenEasing":0,"x":0.81},{"duration":3,"tweenEasing":0,"x":0.85},{"duration":3,"tweenEasing":0,"x":1.04},{"duration":0,"x":0.94}]},{"name":"foot_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.11,"y":-0.11},{"duration":31,"tweenEasing":0,"x":-0.4,"y":-0.38},{"duration":2,"tweenEasing":0,"x":-0.13,"y":0.21},{"duration":2,"tweenEasing":0,"x":-1.26,"y":0.03},{"duration":4,"tweenEasing":0,"x":-1.22,"y":-0.18},{"duration":3,"tweenEasing":0,"x":-1.21,"y":-0.01},{"duration":3,"tweenEasing":0,"x":-0.06,"y":-0.13},{"duration":0,"x":0.17,"y":-0.24}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-33.88},{"duration":31,"tweenEasing":0,"rotate":13},{"duration":2,"tweenEasing":0,"rotate":43.62},{"duration":2,"tweenEasing":0,"rotate":-56.95},{"duration":4,"tweenEasing":0,"rotate":-56.21},{"duration":3,"tweenEasing":0,"rotate":-62.46},{"duration":3,"tweenEasing":0,"rotate":-51.69},{"duration":0,"rotate":-17.16}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":31,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.96,"y":0.99},{"duration":12}]},{"name":"foot_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.28,"y":0.1},{"duration":2,"tweenEasing":0,"x":10.08,"y":-0.53},{"duration":29,"tweenEasing":0,"x":11.49,"y":-0.66},{"duration":2,"tweenEasing":0,"x":11.02,"y":-0.16},{"duration":2,"tweenEasing":0,"x":10.08,"y":-0.05},{"duration":4,"tweenEasing":0,"x":9.97,"y":-0.05},{"duration":3,"tweenEasing":0,"x":9.85,"y":-0.09},{"duration":3,"tweenEasing":0,"x":0.01,"y":-0.12},{"duration":0,"x":4.52,"y":-0.18}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":26.83},{"duration":2,"tweenEasing":0,"rotate":8.27},{"duration":29,"tweenEasing":0,"rotate":-20.08},{"duration":2,"tweenEasing":0,"rotate":4.75},{"duration":2,"tweenEasing":0,"rotate":-7.97},{"duration":4,"tweenEasing":0,"rotate":-6.42},{"duration":3,"tweenEasing":0,"rotate":-3.63},{"duration":3,"tweenEasing":0,"rotate":-4.23},{"duration":0,"rotate":-2.27}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":2,"tweenEasing":0,"y":0.99},{"duration":29,"tweenEasing":0,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":12}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":48,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":48,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":48,"value":1}]},{"name":"shouder_r","displayFrame":[{"duration":48,"value":1}]},{"name":"chest","displayFrame":[{"duration":36,"value":1},{"duration":9,"value":3},{"duration":3,"value":1}]},{"name":"shouder_l","displayFrame":[{"duration":48,"value":1}]},{"name":"hand_l","displayFrame":[{"duration":5,"value":1},{"duration":29},{"duration":2,"value":3},{"duration":12,"value":1},{"duration":0}]},{"name":"forearm_l","displayFrame":[{"duration":48,"value":1}]},{"name":"effect_r","displayFrame":[{"duration":36,"value":-1},{"duration":5},{"duration":7,"value":-1}]},{"name":"effect_l","displayFrame":[{"duration":36,"value":-1},{"duration":5},{"duration":7,"value":-1}]},{"name":"calf_r","displayFrame":[{"duration":3},{"duration":42,"value":1},{"duration":3}]},{"name":"foot_r","displayFrame":[{"duration":3},{"duration":42,"value":1},{"duration":3}]},{"name":"calf_l","displayFrame":[{"duration":3},{"duration":42,"value":1},{"duration":3}]}]},{"duration":14,"fadeInTime":0.2,"name":"skill_01","frame":[{"duration":5},{"duration":0,"sound":"200026"}],"bone":[{"name":"pelvis","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.05,"y":-0.1},{"tweenEasing":0,"x":0.05,"y":-0.1},{"tweenEasing":0,"x":0.16,"y":0.07},{"duration":7,"x":0.02}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-0.25},{"tweenEasing":0,"rotate":-0.25},{"tweenEasing":0,"rotate":-1},{"duration":7,"tweenEasing":0,"rotate":-1.5},{"duration":0,"rotate":-0.25}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.98},{"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":0.99},{"duration":0,"x":1.01}]},{"name":"chest","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.02},{"tweenEasing":0,"x":-0.02,"y":-0.05},{"tweenEasing":0,"x":-0.69,"y":0.87},{"duration":7,"tweenEasing":0,"x":-0.82,"y":2.04},{"duration":0,"x":-0.65,"y":1.71}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":10.32},{"tweenEasing":0,"rotate":10.32},{"tweenEasing":0,"rotate":-1.49},{"duration":7,"tweenEasing":0,"rotate":-0.49},{"duration":0,"rotate":-0.3}],"scaleFrame":[{"duration":5,"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":0.94},{"duration":0,"x":0.96}]},{"name":"shouder_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":5.9,"y":-4.76},{"tweenEasing":0,"x":0.98,"y":-2.35},{"tweenEasing":0,"x":-6.16,"y":32.88},{"duration":7,"tweenEasing":0,"x":-3.19,"y":106.61},{"duration":0,"x":-2.58,"y":101.77}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":44.91},{"tweenEasing":0,"rotate":45.66},{"tweenEasing":0,"rotate":61.1},{"duration":7,"tweenEasing":0,"rotate":-91.96},{"duration":0,"rotate":-79.76}]},{"name":"shouder_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":2.17,"y":-5.35},{"tweenEasing":0,"x":2.8,"y":-4.95},{"tweenEasing":0,"x":11.77,"y":-40.19},{"duration":7,"tweenEasing":0,"x":21.73,"y":-121.8},{"duration":0,"x":19.56,"y":-114.39}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-19.79},{"tweenEasing":0,"rotate":-18.04},{"tweenEasing":0,"rotate":23.73},{"duration":7,"tweenEasing":0,"rotate":44.71},{"duration":0,"rotate":42.09}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.97,"y":1.01},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.96},{"duration":7,"tweenEasing":0,"x":1.05},{"duration":0,"x":1.02}]},{"name":"forearm_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":4.98,"y":-0.01},{"tweenEasing":0,"x":4.82,"y":0.07},{"tweenEasing":0,"x":4.63,"y":-0.74},{"duration":7,"tweenEasing":0,"x":4.47,"y":-0.46},{"duration":0,"x":4.3,"y":-0.89}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-0.8},{"tweenEasing":0,"rotate":-8.57},{"tweenEasing":0,"rotate":-24.34},{"duration":7,"tweenEasing":0,"rotate":-18.82},{"duration":0,"rotate":-26.6}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":0.93,"y":1.01},{"duration":7,"tweenEasing":0,"x":0.84,"y":1.01},{"duration":0,"x":0.85,"y":1.01}]},{"name":"forearm_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.83,"y":-0.25},{"tweenEasing":0,"x":1.14,"y":-0.12},{"tweenEasing":0,"x":5.74,"y":0.78},{"duration":7,"tweenEasing":0,"x":7.57,"y":1.39},{"duration":0,"x":7.72,"y":1.18}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-22.9},{"tweenEasing":0,"rotate":-10.41},{"tweenEasing":0,"rotate":-62.21},{"duration":7,"tweenEasing":0,"rotate":3.51},{"duration":0,"rotate":2.22}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.03,"y":1.01},{"duration":7,"tweenEasing":0,"x":1.02},{"duration":0,"x":1.02,"y":1.01}]},{"name":"hand_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.21},{"tweenEasing":0,"x":0.02,"y":-0.17},{"tweenEasing":0,"x":0.6,"y":-0.12},{"duration":7,"tweenEasing":0,"x":1.16,"y":-0.51},{"duration":0,"x":0.98,"y":-0.26}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-22.03},{"tweenEasing":0,"rotate":-22.3},{"tweenEasing":0,"rotate":3.75},{"duration":7,"tweenEasing":0,"rotate":95.26},{"duration":0,"rotate":83.25}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":0.99},{"duration":7,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.99}]},{"name":"hand_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.25,"y":0.27},{"tweenEasing":0,"x":0.13,"y":0.52},{"tweenEasing":0,"x":0.37,"y":0.98},{"duration":7,"tweenEasing":0,"x":1.9,"y":-0.29},{"duration":0,"x":1.63,"y":0.04}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":0.5},{"tweenEasing":0,"rotate":-2.27},{"tweenEasing":0,"rotate":-12.92},{"duration":7,"tweenEasing":0,"rotate":-20.48},{"duration":0,"rotate":-23.94}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01,"y":1.02},{"tweenEasing":0,"x":1.01,"y":1.03},{"tweenEasing":0,"x":0.98,"y":0.92},{"duration":7,"tweenEasing":0,"x":0.94,"y":0.76},{"duration":0,"x":0.96,"y":0.81}]},{"name":"weapon_hand_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.04},{"tweenEasing":0,"x":0.04,"y":0.01},{"tweenEasing":0,"x":0.03,"y":0.03},{"duration":7,"tweenEasing":0,"x":0.08,"y":0.01},{"duration":0,"x":0.06,"y":0.03}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":13.43},{"tweenEasing":0,"rotate":14.56},{"tweenEasing":0,"rotate":26.23},{"duration":7,"tweenEasing":0,"rotate":23.18},{"duration":0,"rotate":32.77}]},{"name":"weapon_hand_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.01},{"tweenEasing":0,"x":-0.04},{"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":-0.03,"y":-0.08},{"duration":0,"x":-0.02,"y":-0.06}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":19.53},{"tweenEasing":0,"rotate":26.53},{"tweenEasing":0,"rotate":13.24},{"duration":7,"tweenEasing":0,"rotate":19.02},{"duration":0,"rotate":17.77}]},{"name":"effect_r","translateFrame":[{"duration":7,"x":87,"y":-163.45},{"duration":3,"tweenEasing":0,"x":87,"y":-163.45},{"duration":4,"x":67,"y":-148}],"rotateFrame":[{"duration":7,"rotate":121.12},{"duration":3,"tweenEasing":0,"rotate":121.12},{"duration":4,"rotate":125.08}],"scaleFrame":[{"duration":7,"x":0.35,"y":0.76},{"duration":3,"tweenEasing":0,"x":0.35,"y":0.76},{"duration":4,"x":0.12,"y":0.42}]},{"name":"root","translateFrame":[{"duration":5,"tweenEasing":0,"x":1,"y":10.6},{"duration":2,"tweenEasing":0,"x":1,"y":10.6},{"duration":7,"x":-5.4,"y":21.9}]},{"name":"thigh_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":1.84,"y":-0.16},{"tweenEasing":0,"x":1.84,"y":-0.16},{"tweenEasing":0,"x":6.08,"y":-16.45},{"duration":7,"tweenEasing":0,"x":7.31,"y":-34.98},{"duration":0,"x":4.64,"y":-29.72}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-12.51},{"tweenEasing":0,"rotate":-12.51},{"tweenEasing":0,"rotate":-8.25},{"duration":7,"tweenEasing":0,"rotate":12.27},{"duration":0,"rotate":7.26}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.89},{"tweenEasing":0,"x":0.89},{"tweenEasing":0},{"duration":7,"x":1.02}]},{"name":"thigh_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-1.75,"y":0.01},{"tweenEasing":0,"x":-1.75,"y":0.01},{"tweenEasing":0,"x":-5.62,"y":16.4},{"duration":7,"tweenEasing":0,"x":-7.17,"y":34.48},{"duration":0,"x":-4.54,"y":29.37}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-15.06},{"tweenEasing":0,"rotate":-15.06},{"tweenEasing":0,"rotate":-26.1},{"duration":7,"tweenEasing":0,"rotate":-8.29},{"duration":0,"rotate":-31.37}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":1.01,"y":1.01},{"tweenEasing":0,"x":1.01,"y":1.01},{"duration":7,"tweenEasing":0,"x":0.95,"y":1.01},{"duration":0,"x":1.01,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.17,"y":-0.15},{"tweenEasing":0,"x":-0.17,"y":-0.15},{"tweenEasing":0,"x":0.2,"y":-0.18},{"duration":7,"tweenEasing":0,"x":0.33,"y":-0.12},{"duration":0,"x":0.34,"y":-0.12}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":23.5},{"tweenEasing":0,"rotate":23.5},{"tweenEasing":0,"rotate":40.63},{"duration":7,"tweenEasing":0,"rotate":27.65},{"duration":0,"rotate":29.9}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.94,"y":1.01},{"tweenEasing":0,"x":0.94,"y":1.01},{"tweenEasing":0,"x":0.98,"y":1.01},{"duration":7,"tweenEasing":0,"x":1.04,"y":1.01},{"duration":0,"x":1.02,"y":1.01}]},{"name":"calf_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.07,"y":-0.07},{"tweenEasing":0,"x":-0.07,"y":-0.07},{"tweenEasing":0,"x":-0.16,"y":-0.16},{"duration":7,"tweenEasing":0,"x":-0.02,"y":-0.02},{"duration":0,"x":-0.18,"y":-0.12}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":23.57},{"tweenEasing":0,"rotate":23.57},{"tweenEasing":0,"rotate":17.59},{"duration":7,"tweenEasing":0,"rotate":-32.13},{"duration":0,"rotate":6.8}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.94},{"tweenEasing":0,"x":0.94},{"tweenEasing":0,"x":0.89},{"duration":7,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.94}]},{"name":"foot_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.05,"y":-0.42},{"tweenEasing":0,"x":0.05,"y":-0.42},{"tweenEasing":0,"x":-1.22,"y":-0.3},{"duration":7,"tweenEasing":0,"x":-1.13,"y":-0.18},{"duration":0,"x":-1.09,"y":-0.08}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-11.03},{"tweenEasing":0,"rotate":-11.03},{"tweenEasing":0,"rotate":-32.38},{"duration":7,"tweenEasing":0,"rotate":-39.91},{"duration":0,"rotate":-37.15}]},{"name":"foot_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.2,"y":0.03},{"tweenEasing":0,"x":0.2,"y":0.03},{"tweenEasing":0,"x":9.67,"y":-0.2},{"duration":7,"tweenEasing":0,"x":9.2,"y":-0.34},{"duration":0,"x":9.45,"y":-0.18}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-8.55},{"tweenEasing":0,"rotate":-8.55},{"tweenEasing":0,"rotate":8.43},{"duration":7,"tweenEasing":0,"rotate":40.37},{"duration":0,"rotate":24.52}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":14,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"shouder_r","displayFrame":[{"duration":14,"value":1}]},{"name":"chest","displayFrame":[{"duration":6},{"value":1},{"duration":7,"value":2}]},{"name":"shouder_l","displayFrame":[{"duration":14,"value":1}]},{"name":"hand_l","displayFrame":[{"duration":5},{"duration":9,"value":1}]},{"name":"forearm_l","displayFrame":[{"duration":14,"value":1}]},{"name":"effect_r","displayFrame":[{"duration":7,"value":-1},{"duration":4,"value":1},{"duration":3,"value":-1}]},{"name":"calf_r","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"foot_r","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"calf_l","displayFrame":[{"duration":6},{"duration":8,"value":1}]}]},{"duration":49,"playTimes":0,"name":"skill_04","frame":[{"duration":35},{"events":[{"name":"onTimeStart"}]},{"duration":0,"sound":"200030"}],"bone":[{"name":"pelvis","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":4,"tweenEasing":0,"x":0.02},{"duration":2,"tweenEasing":0,"x":0.04,"y":-0.1},{"tweenEasing":0,"x":0.03,"y":-0.12},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.06},{"duration":4,"tweenEasing":0,"x":2.01,"y":-0.64},{"duration":4,"tweenEasing":0,"x":0.02,"y":-0.12},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.11},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.05},{"duration":4,"tweenEasing":0,"y":-0.05},{"duration":4,"tweenEasing":0,"x":3.67,"y":0.2},{"duration":2,"tweenEasing":0,"x":0.04,"y":-0.12},{"duration":6,"tweenEasing":0,"x":0.02,"y":-0.12},{"duration":2,"tweenEasing":0,"x":0.05,"y":-0.12},{"duration":3,"tweenEasing":0,"x":1.7,"y":0.28},{"duration":0,"x":1.05,"y":0.34}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-5},{"duration":4,"tweenEasing":0,"rotate":1.25},{"duration":2,"tweenEasing":0,"rotate":4.5},{"tweenEasing":0,"rotate":15.52},{"duration":2,"tweenEasing":0,"rotate":1.25},{"duration":4,"tweenEasing":0,"rotate":-17.02},{"duration":4,"tweenEasing":0,"rotate":-22.03},{"duration":4,"tweenEasing":0,"rotate":-17.27},{"duration":4,"tweenEasing":0,"rotate":-14.51},{"duration":4,"tweenEasing":0,"rotate":-13.51},{"duration":4,"tweenEasing":0,"rotate":-15.26},{"duration":2,"tweenEasing":0,"rotate":-10.76},{"duration":6,"tweenEasing":0,"rotate":-5.25},{"duration":2,"tweenEasing":0,"rotate":2.25},{"duration":3,"tweenEasing":0,"rotate":3.5},{"duration":0,"rotate":2.02}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.95,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":11}]},{"name":"chest","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.6,"y":-2.12},{"duration":4,"tweenEasing":0,"x":-1.16,"y":-9.29},{"duration":2,"tweenEasing":0,"x":-2.17,"y":-11.91},{"tweenEasing":0,"x":0.83,"y":-3.27},{"tweenEasing":0,"x":0.17,"y":4.32},{"tweenEasing":0,"x":-0.56,"y":9.06},{"duration":4,"tweenEasing":0,"x":-3.92,"y":12.2},{"duration":4,"tweenEasing":0,"x":-5.11,"y":13.42},{"duration":4,"tweenEasing":0,"x":-4.56,"y":13.11},{"duration":4,"tweenEasing":0,"x":-3.19,"y":10.62},{"duration":4,"tweenEasing":0,"x":-1.9,"y":8.76},{"duration":3,"tweenEasing":0,"x":-0.76,"y":5.52},{"tweenEasing":0,"x":-1.84,"y":-0.16},{"duration":2,"tweenEasing":0,"x":0.41,"y":-0.14},{"duration":2,"tweenEasing":0,"x":0.29,"y":-0.63},{"duration":4,"tweenEasing":0,"x":1.76,"y":-0.18},{"duration":2,"tweenEasing":0,"x":-0.08,"y":-3.83},{"duration":3,"tweenEasing":0,"y":-3.9},{"duration":0,"x":0.05,"y":-2.05}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":22.04},{"duration":4,"tweenEasing":0,"rotate":36.83},{"duration":2,"tweenEasing":0,"rotate":45.91},{"tweenEasing":0,"rotate":21.73},{"tweenEasing":0,"rotate":5.63},{"tweenEasing":0,"rotate":-7.09},{"duration":4,"tweenEasing":0,"rotate":-6.82},{"duration":4,"tweenEasing":0,"rotate":-3.87},{"duration":4,"tweenEasing":0,"rotate":-9.13},{"duration":4,"tweenEasing":0,"rotate":-5.12},{"duration":4,"tweenEasing":0,"rotate":-2.55},{"duration":3,"tweenEasing":0,"rotate":9.67},{"tweenEasing":0,"rotate":14.08},{"duration":2,"tweenEasing":0,"rotate":11.46},{"duration":2,"tweenEasing":0,"rotate":4.36},{"duration":4,"tweenEasing":0,"rotate":1.99},{"duration":2,"tweenEasing":0,"rotate":6.98},{"duration":3,"tweenEasing":0,"rotate":6.24},{"duration":0,"rotate":5.48}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"y":0.99},{"tweenEasing":0,"x":0.97,"y":0.99},{"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.99,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.04,"y":0.99},{"duration":8,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0},{"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":3,"x":0.98}]},{"name":"shouder_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.81,"y":29.41},{"duration":4,"tweenEasing":0,"x":-4.51,"y":46.6},{"duration":2,"tweenEasing":0,"x":-10.93,"y":48.88},{"tweenEasing":0,"x":-9.37,"y":49.01},{"tweenEasing":0,"x":-12.99,"y":48.34},{"tweenEasing":0,"x":-6.19,"y":28.59},{"duration":4,"tweenEasing":0,"x":-5.62,"y":33.26},{"duration":4,"tweenEasing":0,"x":-3.33,"y":27.83},{"duration":4,"tweenEasing":0,"x":-4.94,"y":31.62},{"duration":4,"tweenEasing":0,"x":-6.94,"y":30.44},{"duration":4,"tweenEasing":0,"x":-8.34,"y":36.6},{"duration":3,"tweenEasing":0,"x":-6.26,"y":41.08},{"tweenEasing":0,"x":-7.68,"y":31.7},{"duration":2,"tweenEasing":0,"x":-4.26,"y":34.95},{"duration":2,"tweenEasing":0,"x":1.08,"y":36.38},{"duration":4,"tweenEasing":0,"x":4.47,"y":36.74},{"duration":2,"tweenEasing":0,"x":-7,"y":39.82},{"duration":3,"tweenEasing":0,"x":-6.87,"y":32.44},{"duration":0,"x":-7.02,"y":33.86}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-12.49},{"duration":4,"tweenEasing":0,"rotate":-44.39},{"duration":2,"tweenEasing":0,"rotate":-98.28},{"tweenEasing":0,"rotate":-77.58},{"tweenEasing":0,"rotate":-27.39},{"tweenEasing":0,"rotate":19.32},{"duration":4,"tweenEasing":0,"rotate":30.48},{"duration":4,"tweenEasing":0,"rotate":37.88},{"duration":4,"tweenEasing":0,"rotate":43.42},{"duration":4,"tweenEasing":0,"rotate":33.66},{"duration":4,"tweenEasing":0,"rotate":-4.43},{"duration":3,"tweenEasing":0,"rotate":-83.73},{"tweenEasing":0,"rotate":-87.15},{"duration":2,"tweenEasing":0,"rotate":-26.55},{"duration":2,"tweenEasing":0,"rotate":23.26},{"duration":4,"tweenEasing":0,"rotate":28.25},{"duration":2,"tweenEasing":0,"rotate":12.12},{"duration":3,"tweenEasing":0,"rotate":9.89},{"duration":0,"rotate":4.62}]},{"name":"shouder_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":31.8,"y":-18.41},{"duration":4,"tweenEasing":0,"x":24.93,"y":-48.7},{"duration":2,"tweenEasing":0,"x":22.06,"y":-60.39},{"tweenEasing":0,"x":28,"y":-72.02},{"tweenEasing":0,"x":29.08,"y":-61.03},{"tweenEasing":0,"x":21.52,"y":-50.93},{"duration":4,"tweenEasing":0,"x":13.15,"y":-42.71},{"duration":4,"tweenEasing":0,"x":-5.27,"y":-24.35},{"duration":4,"tweenEasing":0,"x":0.51,"y":-34.21},{"duration":4,"tweenEasing":0,"x":1.25,"y":-28.01},{"duration":4,"tweenEasing":0,"x":4.49,"y":-29.64},{"duration":3,"tweenEasing":0,"x":16.01,"y":-31.7},{"tweenEasing":0,"x":21.42,"y":-37.55},{"duration":2,"tweenEasing":0,"x":17.09,"y":-39.6},{"duration":2,"tweenEasing":0,"x":11.05,"y":-58.46},{"duration":4,"tweenEasing":0,"x":7.92,"y":-59.96},{"duration":2,"tweenEasing":0,"x":22.08,"y":-43.36},{"duration":3,"tweenEasing":0,"x":23.21,"y":-38.56},{"duration":0,"x":16.72,"y":-21.43}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-86.68},{"duration":4,"tweenEasing":0,"rotate":-74.91},{"duration":2,"tweenEasing":0,"rotate":-76.2},{"tweenEasing":0,"rotate":13.95},{"tweenEasing":0,"rotate":48.88},{"tweenEasing":0,"rotate":69.25},{"duration":4,"tweenEasing":0,"rotate":76.9},{"duration":4,"tweenEasing":0,"rotate":72.26},{"duration":4,"tweenEasing":0,"rotate":71.52},{"duration":4,"tweenEasing":0,"rotate":54.72},{"duration":4,"tweenEasing":0,"rotate":44.97},{"duration":3,"tweenEasing":0,"rotate":-66.42},{"tweenEasing":0,"rotate":-110.91},{"duration":2,"tweenEasing":0,"rotate":-82.96},{"duration":2,"tweenEasing":0,"rotate":18.99},{"duration":4,"tweenEasing":0,"rotate":33.01},{"duration":2,"tweenEasing":0,"rotate":15.39},{"duration":3,"tweenEasing":0,"rotate":5.87},{"duration":0,"rotate":-5.67}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.71,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.71,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.72},{"tweenEasing":0,"x":0.67,"y":0.99},{"tweenEasing":0,"x":0.75,"y":0.99},{"tweenEasing":0,"x":0.83,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.83,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.84,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.89,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.84,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.82,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.71,"y":0.99},{"tweenEasing":0,"x":0.72},{"duration":2,"tweenEasing":0,"x":0.72},{"duration":2,"tweenEasing":0,"x":0.67,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.73,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.67,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.72,"y":0.99},{"duration":0,"x":0.84}]},{"name":"forearm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-13.05,"y":2.2},{"duration":4,"tweenEasing":0,"x":-18.78,"y":1.25},{"duration":2,"tweenEasing":0,"x":-7.29,"y":0.85},{"tweenEasing":0,"x":-1.06,"y":-1.94},{"tweenEasing":0,"x":4.75,"y":-2.01},{"tweenEasing":0,"x":4.22,"y":-1.84},{"duration":4,"tweenEasing":0,"x":4.05,"y":-1.72},{"duration":4,"tweenEasing":0,"x":4.18,"y":-1.51},{"duration":4,"tweenEasing":0,"x":3.98,"y":-1.43},{"duration":4,"tweenEasing":0,"x":4.56,"y":-1.25},{"duration":4,"tweenEasing":0,"x":4.84,"y":-1.09},{"duration":3,"tweenEasing":0,"x":-9.92,"y":1.88},{"tweenEasing":0,"x":-6.24,"y":1.73},{"duration":2,"tweenEasing":0,"x":-10.6,"y":1.92},{"duration":2,"tweenEasing":0,"x":4.69,"y":-1.14},{"duration":4,"tweenEasing":0,"x":5.26,"y":-1.58},{"duration":2,"tweenEasing":0,"x":3.75,"y":-1.23},{"duration":3,"tweenEasing":0,"x":1.18,"y":-0.86},{"duration":0,"x":0.57,"y":-0.17}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":51.21},{"duration":4,"tweenEasing":0,"rotate":6.28},{"duration":2,"tweenEasing":0,"rotate":-13.79},{"tweenEasing":0,"rotate":-71.21},{"tweenEasing":0,"rotate":-79.47},{"tweenEasing":0,"rotate":-76.39},{"duration":4,"tweenEasing":0,"rotate":-75.38},{"duration":4,"tweenEasing":0,"rotate":-69.85},{"duration":4,"tweenEasing":0,"rotate":-54.26},{"duration":4,"tweenEasing":0,"rotate":-58.05},{"duration":4,"tweenEasing":0,"rotate":-69.35},{"duration":3,"tweenEasing":0,"rotate":-2.17},{"tweenEasing":0,"rotate":18.3},{"duration":2,"tweenEasing":0,"rotate":3.62},{"duration":2,"tweenEasing":0,"rotate":-15.23},{"duration":4,"tweenEasing":0,"rotate":-14.7},{"duration":2,"tweenEasing":0,"rotate":-16.5},{"duration":3,"tweenEasing":0,"rotate":-9.18},{"duration":0,"rotate":-1.07}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.68},{"tweenEasing":0,"x":0.78},{"duration":4,"tweenEasing":0,"x":0.78},{"duration":4,"tweenEasing":0,"x":0.79},{"duration":4,"tweenEasing":0,"x":0.78},{"duration":4,"tweenEasing":0,"x":0.79},{"duration":4,"tweenEasing":0,"x":0.79},{"duration":3,"tweenEasing":0,"x":0.78,"y":1.01},{"tweenEasing":0,"x":0.66},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.11,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.79},{"duration":3,"tweenEasing":0,"x":0.81},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":7.52,"y":1.45},{"duration":4,"tweenEasing":0,"x":2.52,"y":1.56},{"duration":2,"tweenEasing":0,"x":2.26,"y":0.56},{"tweenEasing":0,"x":6.76,"y":0.92},{"tweenEasing":0,"x":3.85,"y":1.37},{"tweenEasing":0,"x":5.96,"y":1.64},{"duration":4,"tweenEasing":0,"x":6.35,"y":1.65},{"duration":4,"tweenEasing":0,"x":7.02,"y":1.45},{"duration":4,"tweenEasing":0,"x":6.92,"y":1.58},{"duration":4,"tweenEasing":0,"x":6.72,"y":1.5},{"duration":4,"tweenEasing":0,"x":0.39,"y":1.86},{"tweenEasing":0,"x":-5.1,"y":-0.11},{"duration":2,"tweenEasing":0,"x":-7.02,"y":-0.18},{"tweenEasing":0,"x":-10.71,"y":-0.27},{"duration":2,"tweenEasing":0,"x":-3.03,"y":1.55},{"duration":2,"tweenEasing":0,"x":6.58,"y":1.62},{"duration":4,"tweenEasing":0,"x":7.11,"y":1.64},{"duration":2,"tweenEasing":0,"x":7.62,"y":1.24},{"duration":3,"tweenEasing":0,"x":7.09,"y":1},{"duration":0,"x":4.09,"y":0.38}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-48.17},{"duration":4,"tweenEasing":0,"rotate":-44.41},{"duration":2,"tweenEasing":0,"rotate":-15.39},{"tweenEasing":0,"rotate":-13.88},{"tweenEasing":0,"rotate":-27.88},{"tweenEasing":0,"rotate":-27.59},{"duration":4,"tweenEasing":0,"rotate":-22.07},{"duration":4,"tweenEasing":0,"rotate":1.71},{"duration":4,"tweenEasing":0,"rotate":7.95},{"duration":4,"tweenEasing":0,"rotate":14.22},{"duration":4,"tweenEasing":0,"rotate":-23.11},{"tweenEasing":0,"rotate":-33.11},{"duration":2,"tweenEasing":0,"rotate":-36.04},{"tweenEasing":0,"rotate":-41.9},{"duration":2,"tweenEasing":0,"rotate":-38.91},{"duration":2,"tweenEasing":0,"rotate":-0.33},{"duration":4,"tweenEasing":0,"rotate":1.17},{"duration":2,"tweenEasing":0,"rotate":-3.08},{"duration":3,"tweenEasing":0,"rotate":-4.07},{"duration":0,"rotate":-5.29}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.92,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.79},{"tweenEasing":0,"x":0.77,"y":0.99},{"tweenEasing":0,"x":1.03,"y":0.99},{"tweenEasing":0,"x":1.06,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.93},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.89,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.75},{"duration":2,"tweenEasing":0,"x":0.95},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":3,"x":1.02}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.41,"y":-0.4},{"duration":4,"tweenEasing":0,"x":1.23,"y":0.3},{"duration":2,"tweenEasing":0,"x":0.22,"y":0.84},{"tweenEasing":0,"x":0.42,"y":0.85},{"tweenEasing":0,"x":1.34,"y":-0.34},{"tweenEasing":0,"x":-16.3,"y":-0.36},{"duration":4,"tweenEasing":0,"x":-16.6,"y":0.2},{"duration":4,"tweenEasing":0,"x":-16.78,"y":1.32},{"duration":4,"tweenEasing":0,"x":-16.29,"y":1.5},{"duration":4,"tweenEasing":0,"x":-16.35,"y":1.55},{"duration":4,"tweenEasing":0,"x":-16.81,"y":-1},{"duration":3,"tweenEasing":0,"x":1.86,"y":-0.72},{"tweenEasing":0,"x":2.02,"y":-0.72},{"duration":2,"tweenEasing":0,"x":0.71,"y":-1.22},{"duration":2,"tweenEasing":0,"x":0.48,"y":0.49},{"duration":4,"tweenEasing":0,"x":0.57,"y":0.45},{"duration":2,"tweenEasing":0,"x":0.4,"y":0.26},{"duration":3,"tweenEasing":0,"x":0.39,"y":0.03},{"duration":0,"x":0.1,"y":-0.07}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":32.39},{"duration":4,"tweenEasing":0,"rotate":27.11},{"duration":2,"tweenEasing":0,"rotate":9.99},{"tweenEasing":0,"rotate":1.71},{"tweenEasing":0,"rotate":-10.02},{"tweenEasing":0,"rotate":-36.63},{"duration":4,"tweenEasing":0,"rotate":-43.92},{"duration":4,"tweenEasing":0,"rotate":-72.73},{"duration":4,"tweenEasing":0,"rotate":-81.97},{"duration":4,"tweenEasing":0,"rotate":-85.48},{"duration":4,"tweenEasing":0,"rotate":-26.35},{"duration":3,"tweenEasing":0,"rotate":15.32},{"tweenEasing":0,"rotate":2.27},{"duration":2,"tweenEasing":0,"rotate":0.7},{"duration":2,"tweenEasing":0,"rotate":-5.27},{"duration":4,"tweenEasing":0,"rotate":-3.51},{"duration":2,"tweenEasing":0,"rotate":-1.75},{"duration":3,"tweenEasing":0,"rotate":-2.25},{"duration":0,"rotate":-1.88}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.91,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.04,"y":0.99},{"tweenEasing":0,"x":1.01,"y":0.99},{"tweenEasing":0,"x":0.98,"y":0.99},{"tweenEasing":0,"x":0.76,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.73,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.72,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.89,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0,"x":0.9,"y":0.99},{"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.85,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":0,"x":1.03}]},{"name":"hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.03,"y":0.07},{"duration":4,"tweenEasing":0,"x":-0.37,"y":0.02},{"duration":2,"tweenEasing":0,"x":-0.18,"y":-0.11},{"tweenEasing":0,"x":0.01,"y":1.36},{"tweenEasing":0,"x":1.4,"y":2.25},{"tweenEasing":0,"x":-19.16,"y":2.06},{"duration":4,"tweenEasing":0,"x":-21.87,"y":1.91},{"duration":4,"tweenEasing":0,"x":-26.38,"y":2.04},{"duration":4,"tweenEasing":0,"x":-27.55,"y":1.44},{"duration":4,"tweenEasing":0,"x":-18.99,"y":2.08},{"duration":4,"tweenEasing":0,"x":-18.49,"y":2.41},{"duration":3,"tweenEasing":0,"x":1.25,"y":-1.12},{"tweenEasing":0,"x":0.76,"y":-1.21},{"duration":2,"tweenEasing":0,"x":0.41,"y":-0.39},{"duration":2,"tweenEasing":0,"x":-16.51,"y":1.15},{"duration":4,"tweenEasing":0,"x":-16.63,"y":0.46},{"duration":2,"tweenEasing":0,"x":1.06,"y":1.17},{"duration":3,"tweenEasing":0,"x":1.02,"y":1.27},{"duration":0,"x":0.19,"y":0.81}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":11.31},{"duration":4,"tweenEasing":0,"rotate":16.08},{"duration":2,"tweenEasing":0,"rotate":12.83},{"tweenEasing":0,"rotate":10.56},{"tweenEasing":0,"rotate":-2.49},{"tweenEasing":0,"rotate":-18.64},{"duration":4,"tweenEasing":0,"rotate":-21.89},{"duration":4,"tweenEasing":0,"rotate":-29.35},{"duration":4,"tweenEasing":0,"rotate":-38.6},{"duration":4,"tweenEasing":0,"rotate":-20.87},{"duration":4,"tweenEasing":0,"rotate":-14.89},{"duration":3,"tweenEasing":0,"rotate":9.64},{"tweenEasing":0,"rotate":14.89},{"duration":2,"tweenEasing":0,"rotate":8.59},{"duration":2,"tweenEasing":0,"rotate":-1.87},{"duration":4,"tweenEasing":0,"rotate":13.3},{"duration":2,"tweenEasing":0,"rotate":34.08},{"duration":3,"tweenEasing":0,"rotate":30.57},{"duration":0,"rotate":13.79}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.96},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.96},{"duration":2,"tweenEasing":0,"x":1.01,"y":1.02},{"tweenEasing":0,"y":0.99},{"tweenEasing":0,"x":0.99,"y":0.98},{"tweenEasing":0,"x":0.99,"y":0.96},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.95},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.93},{"duration":4,"tweenEasing":0,"x":0.96,"y":0.84},{"duration":4,"tweenEasing":0,"x":0.96,"y":0.85},{"duration":4,"tweenEasing":0,"x":0.97,"y":0.88},{"duration":3,"tweenEasing":0,"x":0.97,"y":0.88},{"tweenEasing":0,"x":0.94,"y":0.75},{"duration":2,"tweenEasing":0,"x":0.99,"y":0.94},{"duration":2,"tweenEasing":0,"x":0.97,"y":0.89},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.92},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.9},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.9},{"duration":0,"y":0.99}]},{"name":"weapon_hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.01,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.02,"y":0.01},{"tweenEasing":0,"x":0.03,"y":0.02},{"tweenEasing":0,"x":0.03,"y":0.03},{"tweenEasing":0,"x":0.02,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.02,"y":0.01},{"duration":4,"tweenEasing":0,"x":0.03,"y":0.01},{"duration":4,"tweenEasing":0,"x":0.04,"y":0.03},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":4,"tweenEasing":0,"x":0.01,"y":0.01},{"duration":3,"tweenEasing":0,"x":0.03,"y":-0.06},{"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.05},{"duration":2,"tweenEasing":0,"x":0.09,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.07},{"duration":2,"tweenEasing":0,"x":0.08},{"duration":3,"tweenEasing":0,"x":0.09,"y":0.03},{"duration":0,"y":0.03}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":63.44},{"duration":4,"tweenEasing":0,"rotate":53.3},{"duration":2,"tweenEasing":0,"rotate":21.2},{"tweenEasing":0,"rotate":31.53},{"tweenEasing":0,"rotate":27.28},{"tweenEasing":0,"rotate":28.26},{"duration":4,"tweenEasing":0,"rotate":29.29},{"duration":4,"tweenEasing":0,"rotate":31.3},{"duration":4,"tweenEasing":0,"rotate":34.31},{"duration":4,"tweenEasing":0,"rotate":29.21},{"duration":4,"tweenEasing":0,"rotate":26.54},{"duration":3,"tweenEasing":0,"rotate":2.14},{"tweenEasing":0,"rotate":-7.6},{"duration":2,"tweenEasing":0,"rotate":-1.74},{"duration":2,"tweenEasing":0,"rotate":26.12},{"duration":4,"tweenEasing":0,"rotate":19.34},{"duration":2,"tweenEasing":0,"rotate":22.31},{"duration":3,"tweenEasing":0,"rotate":25.99},{"duration":0,"rotate":29.54}]},{"name":"weapon_hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.02},{"duration":4,"tweenEasing":0,"x":-0.01,"y":-0.07},{"duration":2,"tweenEasing":0,"x":0.02,"y":-0.05},{"tweenEasing":0,"x":0.02,"y":-0.05},{"tweenEasing":0,"x":0.04,"y":-0.04},{"tweenEasing":0,"x":-0.07,"y":-0.04},{"duration":4,"tweenEasing":0,"x":-0.02,"y":-0.05},{"duration":4,"tweenEasing":0,"y":-0.06},{"duration":4,"tweenEasing":0,"x":0.04,"y":-0.1},{"duration":4,"tweenEasing":0,"x":0.07,"y":-0.05},{"duration":4,"tweenEasing":0,"x":-0.06,"y":-0.07},{"duration":3,"tweenEasing":0,"x":0.03,"y":-0.07},{"tweenEasing":0,"x":0.04,"y":-0.06},{"tweenEasing":0,"x":-0.04,"y":-0.03},{"tweenEasing":0,"x":-0.05,"y":-0.09},{"duration":2,"tweenEasing":0,"x":-0.04,"y":0.01},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":2,"tweenEasing":0,"x":-0.01,"y":-0.01},{"duration":3,"tweenEasing":0,"y":-0.02},{"duration":0,"x":-0.03,"y":-0.02}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":1.25},{"duration":4,"tweenEasing":0,"rotate":-22.33},{"duration":2,"tweenEasing":0,"rotate":-63.97},{"tweenEasing":0,"rotate":-58.46},{"tweenEasing":0,"rotate":-45.93},{"tweenEasing":0,"rotate":-24.34},{"duration":4,"tweenEasing":0,"rotate":-8.78},{"duration":4,"tweenEasing":0,"rotate":2},{"duration":4,"tweenEasing":0,"rotate":0.75},{"duration":4,"tweenEasing":0,"rotate":3.76},{"duration":4,"tweenEasing":0,"rotate":-62.22},{"duration":3,"tweenEasing":0,"rotate":-94.51},{"tweenEasing":0,"rotate":-107.56},{"tweenEasing":0,"rotate":-48.94},{"tweenEasing":0,"rotate":-10.04},{"duration":2,"tweenEasing":0,"rotate":28.78},{"duration":4,"tweenEasing":0,"rotate":37.55},{"duration":2,"tweenEasing":0,"rotate":28.53},{"duration":3,"tweenEasing":0,"rotate":25.53},{"duration":0,"rotate":14.9}]},{"name":"effect_r","translateFrame":[{"duration":49,"x":-195,"y":-151}],"rotateFrame":[{"duration":49,"rotate":35.08}],"scaleFrame":[{"duration":49,"x":0.18,"y":0.16}]},{"name":"effect_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-221.45,"y":19.55},{"duration":44,"x":-221.55,"y":19.55}],"rotateFrame":[{"duration":49,"rotate":27.55}],"scaleFrame":[{"duration":49,"x":0.94,"y":0.94}]},{"name":"root","translateFrame":[{"duration":3,"tweenEasing":0,"x":-2.65,"y":13.2},{"duration":4,"tweenEasing":0,"x":-3.45,"y":33},{"duration":2,"tweenEasing":0,"x":1.55,"y":33.7},{"tweenEasing":0,"x":4.45,"y":14.7},{"duration":6,"tweenEasing":0,"x":9.4,"y":2.8},{"duration":4,"tweenEasing":0,"x":5.85,"y":16.05},{"duration":4,"tweenEasing":0,"x":8.6,"y":13.95},{"duration":4,"tweenEasing":0,"x":9.55,"y":11.35},{"duration":8,"tweenEasing":0,"x":10.2,"y":10.35},{"duration":2,"tweenEasing":0,"x":1.35,"y":25.85},{"duration":6,"tweenEasing":0,"x":7.2,"y":5.4},{"duration":5,"tweenEasing":0,"x":0.7,"y":4.05},{"duration":0,"x":0.3,"y":1.7}]},{"name":"thigh_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":6.32,"y":-9.19},{"duration":4,"tweenEasing":0,"x":5.95,"y":-24.18},{"duration":2,"tweenEasing":0,"x":7.33,"y":-25.24},{"tweenEasing":0,"x":10.62,"y":-23.77},{"tweenEasing":0,"x":9.21,"y":-21},{"tweenEasing":0,"x":8.17,"y":-18.61},{"duration":4,"tweenEasing":0,"x":10.09,"y":-16.68},{"duration":4,"tweenEasing":0,"x":8.31,"y":-13.01},{"duration":4,"tweenEasing":0,"x":6.75,"y":-13.49},{"duration":4,"tweenEasing":0,"x":5.76,"y":-9.38},{"duration":4,"tweenEasing":0,"x":7.39,"y":-13.13},{"duration":3,"tweenEasing":0,"x":9.56,"y":-14.93},{"tweenEasing":0,"x":9.83,"y":-12.7},{"duration":2,"tweenEasing":0,"x":6.58,"y":-12.85},{"duration":2,"tweenEasing":0,"x":5.7,"y":-14.7},{"duration":4,"tweenEasing":0,"x":3.55,"y":-16.89},{"duration":2,"tweenEasing":0,"x":4.27,"y":-15.94},{"duration":3,"tweenEasing":0,"x":5.78,"y":-13.99},{"duration":0,"x":3.72,"y":-6.72}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-20.02},{"duration":4,"tweenEasing":0,"rotate":-21.77},{"duration":2,"tweenEasing":0,"rotate":-15.26},{"tweenEasing":0,"rotate":-3},{"tweenEasing":0,"rotate":22.3},{"tweenEasing":0,"rotate":11.01},{"duration":4,"tweenEasing":0,"rotate":0.5},{"duration":4,"tweenEasing":0,"rotate":-13.76},{"duration":4,"tweenEasing":0,"rotate":-6.25},{"duration":4,"tweenEasing":0,"rotate":-3.5},{"duration":4,"tweenEasing":0,"rotate":0.5},{"duration":3,"tweenEasing":0,"rotate":-6.38},{"tweenEasing":0,"rotate":-13.5},{"duration":2,"tweenEasing":0,"rotate":-13},{"duration":2,"tweenEasing":0,"rotate":9.76},{"duration":4,"tweenEasing":0,"rotate":14.27},{"duration":2,"tweenEasing":0,"rotate":7.01},{"duration":3,"tweenEasing":0,"rotate":4.5},{"duration":0,"rotate":0.25}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.93},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01,"y":0.99},{"tweenEasing":0,"x":1.02,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":0.82},{"duration":2,"tweenEasing":0,"x":0.82},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":2,"tweenEasing":0},{"duration":3,"x":0.98}]},{"name":"thigh_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-6.25,"y":9.07},{"duration":4,"tweenEasing":0,"x":-5.83,"y":23.93},{"duration":2,"tweenEasing":0,"x":-7.09,"y":24.73},{"tweenEasing":0,"x":-10.41,"y":23.23},{"tweenEasing":0,"x":-9.05,"y":20.53},{"tweenEasing":0,"x":-8.36,"y":17.22},{"duration":4,"tweenEasing":0,"x":-6.02,"y":15.29},{"duration":4,"tweenEasing":0,"x":-8.17,"y":12.61},{"duration":4,"tweenEasing":0,"x":-6.68,"y":13.17},{"duration":4,"tweenEasing":0,"x":-5.7,"y":9.17},{"duration":4,"tweenEasing":0,"x":-7.29,"y":12.89},{"duration":3,"tweenEasing":0,"x":-2.21,"y":15.23},{"tweenEasing":0,"x":-3.2,"y":13.76},{"duration":2,"tweenEasing":0,"x":-6.45,"y":12.51},{"duration":2,"tweenEasing":0,"x":-5.67,"y":14.35},{"duration":4,"tweenEasing":0,"x":-6.86,"y":14.06},{"duration":2,"tweenEasing":0,"x":-4.13,"y":15.55},{"duration":3,"tweenEasing":0,"x":-2.39,"y":14.45},{"duration":0,"x":-1.47,"y":7.4}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-14.06},{"duration":4,"tweenEasing":0,"rotate":-46.39},{"duration":2,"tweenEasing":0,"rotate":-52.64},{"tweenEasing":0,"rotate":-16.57},{"tweenEasing":0,"rotate":14.06},{"tweenEasing":0,"rotate":-3.77},{"duration":4,"tweenEasing":0,"rotate":-14.56},{"duration":4,"tweenEasing":0,"rotate":-25.35},{"duration":4,"tweenEasing":0,"rotate":-26.1},{"duration":4,"tweenEasing":0,"rotate":-18.58},{"duration":4,"tweenEasing":0,"rotate":-16.82},{"duration":3,"tweenEasing":0,"rotate":-33.88},{"tweenEasing":0,"rotate":-37.38},{"duration":2,"tweenEasing":0,"rotate":-35.13},{"duration":2,"tweenEasing":0,"rotate":-7.03},{"duration":4,"tweenEasing":0,"rotate":-4.02},{"duration":2,"tweenEasing":0,"rotate":-7.78},{"duration":3,"tweenEasing":0,"rotate":-9.04},{"duration":0,"rotate":-5.78}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":0.99,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.97,"y":1.01},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":12,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.01,"y":1.01},{"tweenEasing":0,"y":1.01},{"duration":2,"tweenEasing":0,"y":1.01},{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":5,"x":1.02}]},{"name":"calf_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.27},{"duration":4,"tweenEasing":0,"x":0.16,"y":-0.41},{"duration":2,"tweenEasing":0,"x":0.04,"y":-0.34},{"tweenEasing":0,"x":0.16,"y":-0.13},{"tweenEasing":0,"x":0.38,"y":-0.29},{"tweenEasing":0,"x":0.28,"y":-0.16},{"duration":4,"tweenEasing":0,"x":0.26,"y":-0.11},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.23},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.24},{"duration":4,"tweenEasing":0,"x":0.07,"y":-0.21},{"duration":4,"tweenEasing":0,"x":0.12,"y":-0.16},{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.35},{"tweenEasing":0,"x":-0.09,"y":-0.17},{"duration":2,"tweenEasing":0,"x":-0.02,"y":-0.16},{"duration":2,"tweenEasing":0,"x":0.32,"y":-0.04},{"duration":4,"tweenEasing":0,"x":0.31,"y":-0.1},{"duration":2,"tweenEasing":0,"x":0.12,"y":-0.02},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.07},{"duration":0,"x":0.04,"y":0.07}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":44.1},{"duration":4,"tweenEasing":0,"rotate":71.21},{"duration":2,"tweenEasing":0,"rotate":66.43},{"tweenEasing":0,"rotate":41.41},{"tweenEasing":0,"rotate":-3.72},{"tweenEasing":0,"rotate":12.33},{"duration":4,"tweenEasing":0,"rotate":28.87},{"duration":4,"tweenEasing":0,"rotate":48.64},{"duration":4,"tweenEasing":0,"rotate":38.38},{"duration":4,"tweenEasing":0,"rotate":29.35},{"duration":4,"tweenEasing":0,"rotate":27.61},{"duration":3,"tweenEasing":0,"rotate":40.86},{"tweenEasing":0,"rotate":48.58},{"duration":2,"tweenEasing":0,"rotate":46.32},{"duration":2,"tweenEasing":0,"rotate":8.81},{"duration":4,"tweenEasing":0,"rotate":0.29},{"duration":2,"tweenEasing":0,"rotate":7.04},{"duration":3,"tweenEasing":0,"rotate":9.29},{"duration":0,"rotate":7.77}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.93,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"y":0.99},{"tweenEasing":0,"x":0.99,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.96,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":0.87},{"duration":2,"tweenEasing":0,"x":0.86},{"duration":2,"tweenEasing":0,"x":0.96,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":3,"x":0.97}]},{"name":"calf_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.12,"y":-0.18},{"duration":4,"tweenEasing":0,"x":-0.22,"y":-0.37},{"duration":2,"tweenEasing":0,"x":-0.15,"y":-0.62},{"tweenEasing":0,"x":-0.18,"y":-0.11},{"tweenEasing":0,"x":0.08,"y":-0.08},{"tweenEasing":0,"x":-0.06,"y":-0.03},{"duration":4,"tweenEasing":0,"x":-0.15,"y":-0.05},{"duration":4,"tweenEasing":0,"x":-0.23,"y":-0.19},{"duration":4,"tweenEasing":0,"x":-0.21,"y":-0.1},{"duration":4,"tweenEasing":0,"x":-0.17,"y":-0.2},{"duration":4,"tweenEasing":0,"x":-0.17,"y":-0.25},{"duration":3,"tweenEasing":0,"x":-0.19,"y":-0.33},{"tweenEasing":0,"x":-0.12,"y":-0.43},{"duration":2,"tweenEasing":0,"x":-0.13,"y":-0.4},{"duration":2,"tweenEasing":0,"x":-0.04,"y":-0.05},{"duration":4,"tweenEasing":0,"x":-0.11,"y":0.01},{"duration":2,"tweenEasing":0,"x":-0.24,"y":-0.26},{"duration":3,"tweenEasing":0,"x":-0.18,"y":-0.18},{"duration":0,"x":-0.14,"y":-0.29}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":7.55},{"duration":4,"tweenEasing":0,"rotate":28.59},{"duration":2,"tweenEasing":0,"rotate":40.35},{"tweenEasing":0,"rotate":5.06},{"tweenEasing":0,"rotate":-32.11},{"tweenEasing":0,"rotate":-2.24},{"duration":4,"tweenEasing":0,"rotate":14.57},{"duration":4,"tweenEasing":0,"rotate":29.11},{"duration":4,"tweenEasing":0,"rotate":32.62},{"duration":4,"tweenEasing":0,"rotate":27.84},{"duration":4,"tweenEasing":0,"rotate":22.59},{"duration":3,"tweenEasing":0,"rotate":35.88},{"tweenEasing":0,"rotate":36.88},{"duration":2,"tweenEasing":0,"rotate":34.87},{"duration":2,"tweenEasing":0,"rotate":3.27},{"duration":4,"tweenEasing":0,"rotate":-2.99},{"duration":2,"tweenEasing":0,"rotate":-2.98},{"duration":3,"tweenEasing":0,"rotate":-0.22},{"duration":0,"rotate":1.78}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.06,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.12,"y":0.99},{"tweenEasing":0,"x":1.13},{"tweenEasing":0,"x":1.18,"y":0.99},{"tweenEasing":0,"x":1.14},{"duration":4,"tweenEasing":0,"x":1.12},{"duration":4,"tweenEasing":0,"x":1.09},{"duration":4,"tweenEasing":0,"x":1.1},{"duration":4,"tweenEasing":0,"x":1.05},{"duration":4,"tweenEasing":0,"x":1.09},{"duration":3,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":1.09},{"duration":4,"tweenEasing":0,"x":1.11},{"duration":2,"tweenEasing":0,"x":1.13},{"duration":3,"tweenEasing":0,"x":1.11},{"duration":0,"x":1.06}]},{"name":"foot_r","translateFrame":[{"duration":3,"tweenEasing":0,"y":-0.19},{"duration":4,"tweenEasing":0,"x":-0.15,"y":-0.27},{"duration":2,"tweenEasing":0,"x":-0.18,"y":-0.17},{"tweenEasing":0,"x":-0.15,"y":-0.05},{"tweenEasing":0,"x":-0.08,"y":-0.22},{"tweenEasing":0,"x":-0.04,"y":-0.19},{"duration":4,"tweenEasing":0,"x":-0.07,"y":-0.18},{"duration":4,"tweenEasing":0,"x":-0.09,"y":-0.16},{"duration":4,"tweenEasing":0,"x":-0.07,"y":-0.18},{"duration":4,"tweenEasing":0,"x":-0.06,"y":-0.08},{"duration":4,"tweenEasing":0,"x":-0.02,"y":-0.19},{"duration":3,"tweenEasing":0,"x":-0.03,"y":-0.28},{"tweenEasing":0,"x":-0.05,"y":-0.29},{"duration":2,"tweenEasing":0,"x":-0.09,"y":-0.22},{"duration":2,"tweenEasing":0,"y":-0.17},{"duration":4,"tweenEasing":0,"x":-0.05,"y":-0.12},{"duration":2,"tweenEasing":0,"x":-0.02,"y":-0.18},{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.16},{"duration":0,"x":0.02,"y":-0.19}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-24.09},{"duration":4,"tweenEasing":0,"rotate":-49.44},{"duration":2,"tweenEasing":0,"rotate":-51.2},{"tweenEasing":0,"rotate":-38.4},{"tweenEasing":0,"rotate":-18.57},{"tweenEasing":0,"rotate":-23.34},{"duration":4,"tweenEasing":0,"rotate":-29.36},{"duration":4,"tweenEasing":0,"rotate":-34.89},{"duration":4,"tweenEasing":0,"rotate":-32.13},{"duration":4,"tweenEasing":0,"rotate":-25.85},{"duration":4,"tweenEasing":0,"rotate":-28.11},{"duration":3,"tweenEasing":0,"rotate":-34.63},{"tweenEasing":0,"rotate":-35.13},{"duration":2,"tweenEasing":0,"rotate":-33.37},{"duration":2,"tweenEasing":0,"rotate":-18.57},{"duration":4,"tweenEasing":0,"rotate":-14.55},{"duration":2,"tweenEasing":0,"rotate":-14.05},{"duration":3,"tweenEasing":0,"rotate":-13.8},{"duration":0,"rotate":-8.03}]},{"name":"foot_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.03,"y":0.11},{"duration":4,"tweenEasing":0,"x":-0.23,"y":-0.06},{"duration":2,"tweenEasing":0,"x":-0.26,"y":-0.21},{"tweenEasing":0,"x":-0.27,"y":-0.15},{"tweenEasing":0,"x":-0.33,"y":-0.29},{"tweenEasing":0,"x":-0.27,"y":-0.27},{"duration":4,"tweenEasing":0,"x":-0.16,"y":-0.31},{"duration":4,"tweenEasing":0,"x":-0.09,"y":-0.11},{"duration":4,"tweenEasing":0,"x":-0.11,"y":-0.28},{"duration":4,"tweenEasing":0,"x":0.03,"y":0.06},{"duration":4,"tweenEasing":0,"x":-0.09,"y":-0.29},{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.16},{"tweenEasing":0,"x":0.06,"y":0.12},{"duration":2,"tweenEasing":0,"x":0.07,"y":-0.02},{"duration":2,"tweenEasing":0,"x":-0.12,"y":-0.15},{"duration":4,"tweenEasing":0,"x":-0.18,"y":-0.16},{"duration":2,"tweenEasing":0,"x":-0.25,"y":-0.08},{"duration":3,"tweenEasing":0,"x":-0.25,"y":-0.27},{"duration":0,"x":-0.08,"y":-0.05}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":6.52},{"duration":4,"tweenEasing":0,"rotate":17.84},{"duration":2,"tweenEasing":0,"rotate":12.36},{"tweenEasing":0,"rotate":11.61},{"tweenEasing":0,"rotate":18.16},{"tweenEasing":0,"rotate":6.1},{"duration":4,"tweenEasing":0,"rotate":0.08},{"duration":4,"tweenEasing":0,"rotate":-3.7},{"duration":4,"tweenEasing":0,"rotate":-6.44},{"duration":4,"tweenEasing":0,"rotate":-9.22},{"duration":4,"tweenEasing":0,"rotate":-5.7},{"duration":3,"tweenEasing":0,"rotate":-1.98},{"tweenEasing":0,"rotate":0.49},{"duration":2,"tweenEasing":0,"rotate":0.24},{"duration":2,"tweenEasing":0,"rotate":3.82},{"duration":4,"tweenEasing":0,"rotate":7.09},{"duration":2,"tweenEasing":0,"rotate":10.86},{"duration":3,"tweenEasing":0,"rotate":9.34},{"duration":0,"rotate":4.05}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":49,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":49,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":3,"value":1},{"duration":3,"value":2},{"duration":6,"value":1},{"duration":12},{"duration":18,"value":1},{"duration":7}]},{"name":"shouder_r","displayFrame":[{"duration":49,"value":1}]},{"name":"chest","displayFrame":[{"duration":49,"value":1}]},{"name":"shouder_l","displayFrame":[{"duration":9},{"value":1},{"duration":22,"value":2},{"duration":6},{"duration":8,"value":1},{"duration":3}]},{"name":"hand_l","displayFrame":[{"duration":20},{"duration":12,"value":1},{"duration":6},{"duration":11,"value":1},{"duration":0}]},{"name":"forearm_l","displayFrame":[{"duration":11},{"duration":21,"value":2},{"duration":6},{"duration":6,"value":2},{"duration":2,"value":1},{"duration":3}]},{"name":"effect_r","colorFrame":[{"duration":29,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"tweenEasing":0,"value":{"aM":0}},{"duration":14}]},{"name":"effect_l","colorFrame":[{"duration":5,"tweenEasing":0,"value":{"aM":17}},{"duration":21},{"duration":8,"tweenEasing":0},{"value":{"aM":0}},{"duration":14}]}]},{"duration":14,"fadeInTime":0.2,"name":"skill_05","bone":[{"name":"pelvis","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.09},{"tweenEasing":0,"x":-4.45,"y":4.16},{"tweenEasing":0,"x":-1.18,"y":0.7},{"tweenEasing":0,"x":0.01,"y":-0.06},{"duration":3,"tweenEasing":0,"y":-0.09},{"duration":2,"tweenEasing":0,"x":0.05,"y":-0.07},{"duration":2,"tweenEasing":0,"y":-0.09},{"duration":0,"x":0.03,"y":-0.14}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-3.75},{"tweenEasing":0,"rotate":-6.5},{"tweenEasing":0,"rotate":-7.51},{"tweenEasing":0,"rotate":-8.01},{"duration":3,"tweenEasing":0,"rotate":5.75},{"duration":2,"tweenEasing":0,"rotate":8.01},{"duration":2,"tweenEasing":0,"rotate":6.5},{"duration":0,"rotate":5}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":0,"x":1.01}]},{"name":"chest","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.36,"y":1.16},{"tweenEasing":0,"x":-0.29,"y":1.23},{"tweenEasing":0,"x":3.59,"y":1.35},{"tweenEasing":0,"x":-0.21,"y":1.93},{"duration":3,"tweenEasing":0,"x":-0.29,"y":1.89},{"duration":2,"tweenEasing":0,"x":-0.28,"y":1.84},{"duration":2,"tweenEasing":0,"x":-0.21,"y":1.85},{"duration":0,"x":-0.15,"y":1.6}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":4.88},{"tweenEasing":0,"rotate":5.16},{"tweenEasing":0,"rotate":14.13},{"tweenEasing":0,"rotate":22.76},{"duration":3,"tweenEasing":0,"rotate":61.65},{"duration":2,"tweenEasing":0,"rotate":62.37},{"duration":2,"tweenEasing":0,"rotate":65.64},{"duration":0,"rotate":23.25}],"scaleFrame":[{"duration":4,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":0,"x":0.93,"y":0.99}]},{"name":"shouder_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.55,"y":-6.07},{"tweenEasing":0,"x":5.47,"y":-1.92},{"tweenEasing":0,"x":-5.32,"y":54.03},{"tweenEasing":0,"x":-11.23,"y":101.12},{"duration":3,"tweenEasing":0,"x":-10.24,"y":101.82},{"duration":2,"tweenEasing":0,"x":-15.51,"y":102.42},{"duration":2,"tweenEasing":0,"x":-12.71,"y":104.34},{"duration":0,"x":-19.02,"y":47.32}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-162.66},{"tweenEasing":0,"rotate":-172.91},{"tweenEasing":0,"rotate":169.22},{"tweenEasing":0,"rotate":-151.56},{"duration":3,"tweenEasing":0,"rotate":-106.04},{"duration":2,"tweenEasing":0,"rotate":-109.51},{"duration":2,"tweenEasing":0,"rotate":-123.06},{"duration":0,"rotate":-42.04}]},{"name":"shouder_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":5.07,"y":3.41},{"tweenEasing":0,"x":11.93,"y":-5.16},{"tweenEasing":0,"x":22.77,"y":-61.77},{"tweenEasing":0,"x":24.21,"y":-106.73},{"duration":3,"tweenEasing":0,"x":20.23,"y":-124.79},{"duration":2,"tweenEasing":0,"x":19.91,"y":-121.93},{"duration":2,"tweenEasing":0,"x":13.59,"y":-116.92},{"duration":0,"x":28.39,"y":-61.41}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-25.76},{"tweenEasing":0,"rotate":-34.23},{"tweenEasing":0,"rotate":-33.54},{"tweenEasing":0,"rotate":13.36},{"duration":3,"tweenEasing":0,"rotate":-23.07},{"duration":2,"tweenEasing":0,"rotate":-22.52},{"duration":2,"tweenEasing":0,"rotate":-29.32},{"duration":0,"rotate":-25.73}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.11},{"tweenEasing":0,"x":1.12,"y":0.99},{"tweenEasing":0,"x":0.81},{"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.04,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.04,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":0,"x":0.74}]},{"name":"forearm_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.57,"y":0.41},{"tweenEasing":0,"x":-0.74,"y":0.49},{"tweenEasing":0,"x":5.63,"y":0.45},{"tweenEasing":0,"x":4.59,"y":-0.72},{"duration":3,"tweenEasing":0,"x":4.44,"y":-0.41},{"duration":2,"tweenEasing":0,"x":4.33,"y":-0.44},{"duration":2,"tweenEasing":0,"x":4.54,"y":-0.69},{"duration":0,"x":6.18,"y":-0.15}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-6.07},{"tweenEasing":0,"rotate":-5.31},{"tweenEasing":0,"rotate":-18.73},{"tweenEasing":0,"rotate":-39.38},{"duration":3,"tweenEasing":0,"rotate":-25.84},{"duration":2,"tweenEasing":0,"rotate":9.71},{"duration":2,"tweenEasing":0,"rotate":17.97},{"duration":0,"rotate":-15.7}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.9},{"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":1.01,"y":1.01},{"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.18,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.09},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":0,"x":0.99}]},{"name":"forearm_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":-13.85,"y":-1.39},{"tweenEasing":0,"x":-3.52,"y":-0.34},{"tweenEasing":0,"x":4.65,"y":0.88},{"tweenEasing":0,"x":3,"y":0.15},{"duration":3,"tweenEasing":0,"x":1.52,"y":1.91},{"duration":2,"tweenEasing":0,"x":6.68,"y":1.47},{"duration":2,"tweenEasing":0,"x":4.32,"y":1.6},{"duration":0,"x":7.74,"y":1.27}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-4.07},{"tweenEasing":0,"rotate":-0.52},{"tweenEasing":0,"rotate":-7.76},{"tweenEasing":0,"rotate":-7.12},{"duration":3,"tweenEasing":0,"rotate":-46.18},{"duration":2,"tweenEasing":0,"rotate":-42.68},{"duration":2,"tweenEasing":0,"rotate":-18.64},{"duration":0,"rotate":3.52}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"y":0.99},{"tweenEasing":0,"x":0.97,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":0,"x":1.03,"y":0.99}]},{"name":"hand_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.02,"y":-0.11},{"tweenEasing":0,"x":-0.59,"y":-0.4},{"tweenEasing":0,"x":0.66,"y":-0.83},{"tweenEasing":0,"x":3.05,"y":-0.01},{"duration":3,"tweenEasing":0,"x":-0.13,"y":-0.46},{"duration":2,"tweenEasing":0,"x":-0.06,"y":-0.37},{"duration":2,"tweenEasing":0,"x":0.31,"y":-0.2},{"duration":0,"x":0.87,"y":-0.17}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":50.93},{"tweenEasing":0,"rotate":39.09},{"tweenEasing":0,"rotate":15.28},{"tweenEasing":0,"rotate":-9.78},{"duration":3,"tweenEasing":0,"rotate":85.25},{"duration":2,"tweenEasing":0,"rotate":87.25},{"duration":2,"tweenEasing":0,"rotate":77.75},{"duration":0,"rotate":13.53}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"tweenEasing":0,"x":1.04,"y":0.99},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":0.96,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.94},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.95}]},{"name":"hand_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":1,"y":-0.76},{"tweenEasing":0,"x":1.05,"y":-0.61},{"tweenEasing":0,"x":-0.31,"y":1.2},{"tweenEasing":0,"x":-16.19,"y":1.56},{"duration":3,"tweenEasing":0,"x":-16.5,"y":1.11},{"duration":2,"tweenEasing":0,"x":-16.06,"y":0.39},{"duration":2,"tweenEasing":0,"x":-16.34,"y":0.27},{"duration":0,"x":0.15,"y":1.03}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":1.32},{"tweenEasing":0,"rotate":1.31},{"tweenEasing":0,"rotate":2.76},{"tweenEasing":0,"rotate":15.64},{"duration":3,"tweenEasing":0,"rotate":7.1},{"duration":2,"tweenEasing":0,"rotate":-19.59},{"duration":2,"tweenEasing":0,"rotate":-27.06},{"duration":0,"rotate":15.83}],"scaleFrame":[{"duration":4,"tweenEasing":0,"y":1.01},{"tweenEasing":0,"x":1.01,"y":1.01},{"tweenEasing":0,"x":1.01,"y":1.02},{"tweenEasing":0,"x":0.98,"y":0.91},{"duration":3,"tweenEasing":0,"x":1.05,"y":1.14},{"duration":2,"tweenEasing":0,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.96,"y":0.82},{"duration":0,"x":0.99,"y":0.97}]},{"name":"weapon_hand_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.02,"y":0.04},{"tweenEasing":0,"x":0.01,"y":0.02},{"tweenEasing":0,"y":0.01},{"tweenEasing":0,"x":0.08,"y":0.03},{"duration":3,"tweenEasing":0,"x":0.02},{"duration":2,"tweenEasing":0,"x":0.05},{"duration":2,"tweenEasing":0,"x":0.07,"y":0.03},{"duration":0,"y":0.02}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":9.92},{"tweenEasing":0,"rotate":10.21},{"tweenEasing":0,"rotate":18.65},{"tweenEasing":0,"rotate":17.41},{"duration":3,"tweenEasing":0,"rotate":9.92},{"duration":2,"tweenEasing":0,"rotate":6.1},{"duration":2,"tweenEasing":0,"rotate":12.54},{"duration":0,"rotate":29.4}]},{"name":"weapon_hand_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.08},{"tweenEasing":0,"x":0.02,"y":-0.1},{"tweenEasing":0,"x":0.02,"y":-0.02},{"tweenEasing":0,"x":0.02},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.06},{"duration":2,"tweenEasing":0,"x":-0.03,"y":-0.08},{"duration":2,"tweenEasing":0,"x":0.07,"y":-0.08},{"duration":0,"x":-0.03,"y":-0.07}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-101.03},{"tweenEasing":0,"rotate":-112.83},{"tweenEasing":0,"rotate":-120.87},{"tweenEasing":0,"rotate":-84.74},{"duration":3,"tweenEasing":0,"rotate":16.27},{"duration":2,"tweenEasing":0,"rotate":18.77},{"duration":2,"tweenEasing":0,"rotate":21.15},{"duration":0,"rotate":19.65}]},{"name":"effect_r","translateFrame":[{"duration":14,"x":38,"y":-21}],"rotateFrame":[{"duration":14,"rotate":13.67}],"scaleFrame":[{"duration":14,"x":1.08,"y":1.06}]},{"name":"root","translateFrame":[{"duration":6,"tweenEasing":0,"x":30.3,"y":8.7},{"tweenEasing":0,"x":41.9,"y":14.1},{"duration":3,"tweenEasing":0,"x":42.7,"y":53.1},{"duration":2,"tweenEasing":0,"x":44.05,"y":49.25},{"duration":2,"tweenEasing":0,"x":32.15,"y":51.6},{"duration":0,"x":3.75,"y":7.9}]},{"name":"thigh_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.22,"y":-7.99},{"tweenEasing":0,"x":-1.67,"y":-9.45},{"tweenEasing":0,"x":4.98,"y":-29.33},{"tweenEasing":0,"x":11.49,"y":-35.87},{"duration":3,"tweenEasing":0,"x":5.08,"y":-27.92},{"duration":2,"tweenEasing":0,"x":3.48,"y":-26.34},{"duration":2,"tweenEasing":0,"x":3.88,"y":-25.85},{"duration":0,"x":4.33,"y":-22.36}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":14.52},{"tweenEasing":0,"rotate":18.78},{"tweenEasing":0,"rotate":12.77},{"tweenEasing":0,"rotate":4},{"duration":3,"tweenEasing":0,"rotate":20.54},{"duration":2,"tweenEasing":0,"rotate":3.25},{"duration":2,"tweenEasing":0,"rotate":-11.51},{"duration":0,"rotate":13.27}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01,"y":0.99},{"tweenEasing":0,"x":1.02,"y":0.99},{"tweenEasing":0,"y":0.99},{"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":0,"x":1.02,"y":0.99}]},{"name":"thigh_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.25,"y":7.66},{"tweenEasing":0,"x":-7.24,"y":17.63},{"tweenEasing":0,"x":-9.65,"y":28.63},{"tweenEasing":0,"x":-11.33,"y":35.09},{"duration":3,"tweenEasing":0,"x":-5.02,"y":27.33},{"duration":2,"tweenEasing":0,"x":-3.28,"y":25.79},{"duration":2,"tweenEasing":0,"x":-3.88,"y":25.23},{"duration":0,"x":-4.17,"y":21.88}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-13.81},{"tweenEasing":0,"rotate":-27.86},{"tweenEasing":0,"rotate":-13.81},{"tweenEasing":0,"rotate":-6.78},{"duration":3,"tweenEasing":0,"rotate":-84.23},{"duration":2,"tweenEasing":0,"rotate":-85.73},{"duration":2,"tweenEasing":0,"rotate":-89.5},{"duration":0,"rotate":-29.87}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.97},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0},{"duration":0,"x":1.02,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.2,"y":-0.2},{"tweenEasing":0,"x":0.34,"y":-0.01},{"tweenEasing":0,"x":0.52,"y":-0.24},{"tweenEasing":0,"x":0.64,"y":-0.23},{"duration":3,"tweenEasing":0,"x":0.63,"y":-0.27},{"duration":2,"tweenEasing":0,"x":0.55,"y":-0.16},{"duration":2,"tweenEasing":0,"x":0.49,"y":-0.34},{"duration":0,"x":0.27,"y":-0.1}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":8.32},{"tweenEasing":0,"rotate":9.08},{"tweenEasing":0,"rotate":35.92},{"tweenEasing":0,"rotate":54.72},{"duration":3,"tweenEasing":0,"rotate":65.46},{"duration":2,"tweenEasing":0,"rotate":81.24},{"duration":2,"tweenEasing":0,"rotate":96.99},{"duration":0,"rotate":7.31}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.98,"y":0.99},{"tweenEasing":0,"x":0.98,"y":0.99},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.04},{"duration":3,"tweenEasing":0,"x":1.04},{"duration":2,"tweenEasing":0,"x":1.05},{"duration":2,"tweenEasing":0,"x":1.05},{"duration":0,"x":0.98,"y":0.99}]},{"name":"calf_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.15,"y":-0.18},{"tweenEasing":0,"x":-0.05,"y":-0.36},{"tweenEasing":0,"x":-0.46,"y":-0.23},{"tweenEasing":0,"x":0.03,"y":0.05},{"duration":3,"tweenEasing":0,"x":0.28,"y":-0.32},{"duration":2,"tweenEasing":0,"x":0.29,"y":-0.36},{"duration":2,"tweenEasing":0,"x":0.06,"y":-0.34},{"duration":0,"x":-0.22,"y":-0.25}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":47.11},{"tweenEasing":0,"rotate":62.67},{"tweenEasing":0,"rotate":13.28},{"tweenEasing":0,"rotate":-11.53},{"duration":3,"tweenEasing":0,"rotate":76.2},{"duration":2,"tweenEasing":0,"rotate":81.22},{"duration":2,"tweenEasing":0,"rotate":72.96},{"duration":0,"rotate":20.35}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.02,"y":0.99},{"tweenEasing":0,"x":1.03,"y":0.99},{"tweenEasing":0,"x":0.92,"y":0.99},{"tweenEasing":0,"x":0.95,"y":0.99},{"duration":3,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.87},{"duration":2,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":0,"x":1.08}]},{"name":"foot_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.19},{"tweenEasing":0,"x":0.05,"y":-0.34},{"tweenEasing":0,"x":-0.84,"y":-0.15},{"tweenEasing":0,"x":-0.89,"y":-0.21},{"duration":3,"tweenEasing":0,"x":-0.94,"y":0.1},{"duration":2,"tweenEasing":0,"x":-0.87,"y":0.1},{"duration":2,"tweenEasing":0,"x":-0.99,"y":0.01},{"duration":0,"x":-0.03,"y":-0.27}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":4.22},{"tweenEasing":0,"rotate":5.97},{"tweenEasing":0,"rotate":13.51},{"tweenEasing":0,"rotate":19.78},{"duration":3,"tweenEasing":0,"rotate":-30.32},{"duration":2,"tweenEasing":0,"rotate":-14.52},{"duration":2,"tweenEasing":0,"rotate":-19.03},{"duration":0,"rotate":-20.58}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"tweenEasing":0,"x":1.02,"y":0.99},{"tweenEasing":0,"x":0.98,"y":0.99},{"tweenEasing":0,"x":0.98,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":0}]},{"name":"foot_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.35,"y":0.05},{"tweenEasing":0,"x":0.62,"y":-0.21},{"tweenEasing":0,"x":0.45,"y":1.03},{"tweenEasing":0,"x":9.49,"y":-0.18},{"duration":3,"tweenEasing":0,"x":0.08,"y":0.4},{"duration":2,"tweenEasing":0,"x":9.81,"y":0.22},{"duration":2,"tweenEasing":0,"x":9.54,"y":-0.09},{"duration":0,"x":-0.09,"y":-0.05}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-33.28},{"tweenEasing":0,"rotate":-11.98},{"tweenEasing":0,"rotate":14.98},{"tweenEasing":0,"rotate":18.76},{"duration":3,"tweenEasing":0,"rotate":8.52},{"duration":2,"tweenEasing":0,"rotate":4.91},{"duration":2,"tweenEasing":0,"rotate":17.01},{"duration":0,"rotate":20.33}],"scaleFrame":[{"duration":4,"tweenEasing":0},{"tweenEasing":0,"x":0.97,"y":0.99},{"tweenEasing":0,"x":0.97,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.99,"y":0.99}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":14,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":14,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":6,"value":-1},{"duration":8,"value":1}]},{"name":"shouder_r","displayFrame":[{"duration":5,"value":2},{"duration":9,"value":1}]},{"name":"chest","displayFrame":[{"duration":5},{"value":1},{"duration":8,"value":2},{"duration":0,"value":1}]},{"name":"shouder_l","displayFrame":[{"duration":5},{"value":1},{"duration":8,"value":2},{"duration":0,"value":1}]},{"name":"hand_l","displayFrame":[{"duration":6},{"value":1},{"duration":7,"value":2},{"duration":0}]},{"name":"forearm_l","displayFrame":[{"duration":5},{"value":1},{"duration":8,"value":2},{"duration":0}]},{"name":"effect_r","displayFrame":[{"duration":6,"value":-1},{"duration":5},{"duration":3,"value":-1}]},{"name":"thigh_r","displayFrame":[{"duration":5},{"duration":9,"value":1},{"duration":0}]},{"name":"calf_r","displayFrame":[{"duration":5},{"duration":9,"value":1},{"duration":0}]},{"name":"foot_r","displayFrame":[{"duration":5},{"duration":9,"value":1},{"duration":0}]},{"name":"calf_l","displayFrame":[{"duration":5},{"duration":2,"value":1},{"duration":3},{"duration":4,"value":1},{"duration":0}]}]},{"duration":28,"playTimes":0,"fadeInTime":0.2,"name":"victory","bone":[{"name":"pelvis","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.02},{"duration":11,"tweenEasing":0,"x":0.01,"y":-0.11},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.11},{"duration":6,"tweenEasing":0,"x":0.04,"y":-0.14},{"duration":6,"tweenEasing":0,"x":0.1,"y":-0.07},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":6},{"duration":11,"tweenEasing":0,"rotate":-8},{"duration":2,"tweenEasing":0,"rotate":-8.25},{"duration":6,"tweenEasing":0,"rotate":-5.64},{"duration":6,"tweenEasing":0,"rotate":-2.97},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.97},{"duration":11,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.34,"y":1.95},{"duration":11,"tweenEasing":0,"x":0.19,"y":2.01},{"duration":2,"tweenEasing":0,"x":0.21,"y":2.13},{"duration":6,"tweenEasing":0,"x":0.23,"y":2.02},{"duration":6,"tweenEasing":0,"x":-0.79,"y":0.43},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":2.34},{"duration":11,"tweenEasing":0,"rotate":7.01},{"duration":2,"tweenEasing":0,"rotate":7.26},{"duration":6,"tweenEasing":0,"rotate":5.79},{"duration":6,"tweenEasing":0,"rotate":2.25},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94},{"duration":11,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":12}]},{"name":"shouder_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-2.7,"y":-3.44},{"duration":11,"tweenEasing":0,"x":14.25,"y":9.48},{"duration":2,"tweenEasing":0,"x":14.25,"y":9.48},{"duration":6,"tweenEasing":0,"x":8.43,"y":1.55},{"duration":6,"tweenEasing":0,"x":3.36,"y":0.86},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":24.66},{"duration":11,"tweenEasing":0,"rotate":-127.17},{"duration":2,"tweenEasing":0,"rotate":-127.17},{"duration":6,"tweenEasing":0,"rotate":-102.81},{"duration":6,"tweenEasing":0,"rotate":-44.58},{"duration":0}]},{"name":"shouder_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":12.28,"y":-0.92},{"duration":11,"tweenEasing":0,"x":-5.34,"y":-16.66},{"duration":2,"tweenEasing":0,"x":-5.34,"y":-16.66},{"duration":6,"tweenEasing":0,"x":0.51,"y":-6.97},{"duration":6,"tweenEasing":0,"x":1.05,"y":-4.05},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-24.49},{"duration":11,"tweenEasing":0,"rotate":-7.86},{"duration":2,"tweenEasing":0,"rotate":18.69},{"duration":6,"tweenEasing":0,"rotate":19.28},{"duration":6,"tweenEasing":0,"rotate":9.77},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94},{"duration":11,"tweenEasing":0,"x":0.9},{"duration":2,"tweenEasing":0,"x":0.88,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.87,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.91},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.08,"y":0.35},{"duration":11,"tweenEasing":0,"x":0.09,"y":0.17},{"duration":2,"tweenEasing":0,"x":0.17,"y":-0.57},{"duration":6,"tweenEasing":0,"x":0.38,"y":-0.6},{"duration":6,"tweenEasing":0,"x":0.37,"y":-0.28},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":5.94},{"duration":11,"tweenEasing":0,"rotate":9.46},{"duration":2,"tweenEasing":0,"rotate":-12.33},{"duration":6,"tweenEasing":0,"rotate":-14.34},{"duration":6,"tweenEasing":0,"rotate":-8.3},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.98},{"duration":11,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.9},{"duration":6,"tweenEasing":0,"x":0.92},{"duration":6,"tweenEasing":0,"x":1.02},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.11,"y":-0.32},{"duration":11,"tweenEasing":0,"x":0.55,"y":-0.42},{"duration":2,"tweenEasing":0,"x":0.55,"y":-0.42},{"duration":6,"tweenEasing":0,"x":0.12,"y":0.02},{"duration":6,"tweenEasing":0,"x":6.92,"y":1.22},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":16.97},{"duration":11,"tweenEasing":0,"rotate":3.95},{"duration":2,"tweenEasing":0,"rotate":3.95},{"duration":6,"tweenEasing":0,"rotate":-2.5},{"duration":6,"tweenEasing":0,"rotate":-0.84},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"y":0.99},{"duration":11,"tweenEasing":0,"x":0.91,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.91,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.84,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.82,"y":0.99},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.46,"y":-0.78},{"duration":11,"tweenEasing":0,"x":2.79,"y":-1.42},{"duration":2,"tweenEasing":0,"x":2.79,"y":-1.42},{"duration":6,"tweenEasing":0,"x":2.25,"y":-1.79},{"duration":6,"tweenEasing":0,"x":0.1,"y":-0.89},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":0.01},{"duration":11,"tweenEasing":0,"rotate":-3.52},{"duration":2,"tweenEasing":0,"rotate":-3.52},{"duration":6,"tweenEasing":0,"rotate":-4.04},{"duration":6,"tweenEasing":0,"rotate":-3.04},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":11,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.88,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.82,"y":0.99},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.19,"y":-0.17},{"duration":11,"tweenEasing":0,"x":0.2,"y":1.08},{"duration":2,"tweenEasing":0,"x":0.53,"y":1.1},{"duration":6,"tweenEasing":0,"x":0.59,"y":1.18},{"duration":6,"tweenEasing":0,"x":0.25,"y":0.68},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":0.01},{"duration":11,"tweenEasing":0,"rotate":-0.23},{"duration":2,"tweenEasing":0,"rotate":9.23},{"duration":6,"tweenEasing":0,"rotate":8.42},{"duration":6,"tweenEasing":0,"rotate":3.5},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.98},{"duration":11,"tweenEasing":0,"x":0.99,"y":0.98},{"duration":2,"tweenEasing":0,"x":0.97,"y":0.89},{"duration":6,"tweenEasing":0,"x":0.98,"y":0.91},{"duration":6}]},{"name":"weapon_hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":0.04},{"duration":11,"tweenEasing":0,"x":0.01,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.01,"y":0.02},{"duration":6,"tweenEasing":0,"x":0.05,"y":0.01},{"duration":6,"tweenEasing":0,"x":0.05,"y":0.03},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-11.56},{"duration":11,"tweenEasing":0,"rotate":35.02},{"duration":2,"tweenEasing":0,"rotate":34.46},{"duration":6,"tweenEasing":0,"rotate":35.98},{"duration":6,"tweenEasing":0,"rotate":26.72},{"duration":0}]},{"name":"weapon_hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.02},{"tweenEasing":0,"x":8.3,"y":-2.89},{"tweenEasing":0,"x":8.3,"y":-2.89},{"tweenEasing":0,"x":8.23,"y":-2.89},{"tweenEasing":0,"x":8.19,"y":-2.99},{"tweenEasing":0,"x":8.23,"y":-2.89},{"tweenEasing":0,"x":8.23,"y":-2.89},{"tweenEasing":0,"x":8.27,"y":-2.99},{"tweenEasing":0,"x":8.23,"y":-2.89},{"tweenEasing":0,"x":8.16,"y":-2.89},{"tweenEasing":0,"x":8.27,"y":-2.92},{"tweenEasing":0,"x":8.3,"y":-2.89},{"tweenEasing":0,"x":8.23,"y":-2.89},{"tweenEasing":0,"x":24.52,"y":-20.18},{"duration":6,"tweenEasing":0,"x":0.04,"y":-0.06},{"duration":6,"tweenEasing":0,"x":-0.07},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":72.69},{"tweenEasing":0,"rotate":-95.52},{"tweenEasing":0,"rotate":-151.72},{"tweenEasing":0,"rotate":124.8},{"tweenEasing":0,"rotate":63.15},{"tweenEasing":0,"rotate":5.26},{"tweenEasing":0,"rotate":-57.46},{"tweenEasing":0,"rotate":-116.85},{"tweenEasing":0,"rotate":-174.24},{"tweenEasing":0,"rotate":123.54},{"tweenEasing":0,"rotate":64.15},{"tweenEasing":0,"rotate":6.51},{"tweenEasing":0,"rotate":-55.46},{"tweenEasing":0,"rotate":-104.3},{"duration":6,"tweenEasing":0,"rotate":-96.77},{"duration":6,"tweenEasing":0,"rotate":-55.71},{"duration":0}]},{"name":"root","translateFrame":[{"duration":3,"tweenEasing":0,"x":-4.85,"y":14.4},{"duration":11,"tweenEasing":0,"x":8.25,"y":1.85},{"duration":2,"tweenEasing":0,"x":8.25,"y":1.85},{"duration":6,"tweenEasing":0,"x":2.05,"y":8.55},{"duration":6,"tweenEasing":0,"x":1.05,"y":4.3},{"duration":0}]},{"name":"thigh_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.57,"y":-1.47},{"duration":11,"tweenEasing":0,"x":4.74,"y":-4.13},{"duration":2,"tweenEasing":0,"x":4.89,"y":-4.13},{"duration":6,"tweenEasing":0,"x":4.53,"y":-3.36},{"duration":6,"tweenEasing":0,"x":3.49,"y":-0.94},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-22.27},{"duration":11,"tweenEasing":0,"rotate":3},{"duration":2,"tweenEasing":0,"rotate":2.75},{"duration":6,"tweenEasing":0,"rotate":-11.76},{"duration":6,"tweenEasing":0,"rotate":-8.5},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.84,"y":0.99},{"duration":11,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":6,"tweenEasing":0,"x":0.93},{"duration":6,"tweenEasing":0,"x":0.95},{"duration":0}]},{"name":"thigh_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.57,"y":1.44},{"duration":11,"tweenEasing":0,"x":-4.62,"y":3.86},{"duration":2,"tweenEasing":0,"x":-4.82,"y":3.86},{"duration":6,"tweenEasing":0,"x":-4.5,"y":3.08},{"duration":6,"tweenEasing":0,"x":-1.5,"y":2.04},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-19.58},{"duration":11,"tweenEasing":0,"rotate":3.01},{"duration":2,"tweenEasing":0,"rotate":3.51},{"duration":6,"tweenEasing":0,"rotate":-9.54},{"duration":6,"tweenEasing":0,"rotate":-6.03},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.01},{"duration":11,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":6,"tweenEasing":0,"x":1.01},{"duration":6,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"calf_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.26,"y":-0.24},{"duration":11,"tweenEasing":0,"x":0.17,"y":-0.03},{"duration":2,"tweenEasing":0,"x":0.19,"y":-0.01},{"duration":6,"tweenEasing":0,"x":-0.08,"y":-0.07},{"duration":6,"tweenEasing":0,"x":-0.07,"y":-0.09},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":33.01},{"duration":11,"tweenEasing":0,"rotate":9.04},{"duration":2,"tweenEasing":0,"rotate":9.54},{"duration":6,"tweenEasing":0,"rotate":27.29},{"duration":6,"tweenEasing":0,"rotate":17.02},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94},{"duration":11,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":6,"tweenEasing":0,"x":0.94},{"duration":6,"tweenEasing":0,"x":0.96},{"duration":0}]},{"name":"calf_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.06,"y":-0.36},{"duration":11,"tweenEasing":0,"x":0.03,"y":0.02},{"duration":2,"tweenEasing":0,"x":0.05},{"duration":6,"tweenEasing":0,"x":-0.08,"y":-0.13},{"duration":6,"tweenEasing":0,"y":-0.15},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":20.59},{"duration":11,"tweenEasing":0,"rotate":-0.02},{"duration":2,"tweenEasing":0,"rotate":-0.77},{"duration":6,"tweenEasing":0,"rotate":13.3},{"duration":6,"tweenEasing":0,"rotate":8.28},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.9},{"duration":11,"tweenEasing":0,"x":1.04},{"duration":2,"tweenEasing":0,"x":1.04},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"foot_r","translateFrame":[{"tweenEasing":0,"x":0.03,"y":-0.2},{"duration":2,"tweenEasing":0,"y":-0.13},{"duration":11,"tweenEasing":0,"x":-0.01,"y":-0.2},{"duration":2,"tweenEasing":0,"x":0.02,"y":-0.27},{"duration":6,"tweenEasing":0,"x":0.02,"y":-0.4},{"duration":6,"tweenEasing":0,"x":0.01,"y":-0.13},{"duration":0}],"rotateFrame":[{"tweenEasing":0,"rotate":-10.78},{"duration":2,"tweenEasing":0,"rotate":-11.2},{"duration":11,"tweenEasing":0,"rotate":-12.04},{"duration":2,"tweenEasing":0,"rotate":-12.29},{"duration":6,"tweenEasing":0,"rotate":-15.55},{"duration":6,"tweenEasing":0,"rotate":-8.53},{"duration":0}]},{"name":"foot_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.14,"y":0.09},{"duration":11,"tweenEasing":0,"x":0.02,"y":0.03},{"duration":2,"tweenEasing":0,"x":-0.01},{"duration":6,"tweenEasing":0,"x":0.11,"y":0.01},{"duration":6,"tweenEasing":0,"x":0.1,"y":-0.11},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-1.08},{"duration":11,"tweenEasing":0,"rotate":-2.98},{"duration":2,"tweenEasing":0,"rotate":-2.73},{"duration":6,"tweenEasing":0,"rotate":-3.76},{"duration":6,"tweenEasing":0,"rotate":-2.26},{"duration":0}]}],"slot":[{"name":"forearm_r","displayFrame":[{"duration":28,"value":1}]},{"name":"weapon_hand_r","displayFrame":[{"duration":4},{"value":-1},{"duration":4},{"duration":2,"value":-1},{"duration":17}]},{"name":"shouder_r","displayFrame":[{"duration":28,"value":1}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":25,"name":"we_bl_4","aabb":{"x":-83,"y":-221,"width":224,"height":246},"bone":[{"inheritScale":false,"name":"b"}],"slot":[{"name":"b","parent":"b"}],"skin":[{"slot":[{"name":"b","display":[{"name":"we_bl_4_f/1","transform":{"x":29,"y":-98}},{"name":"we_bl_4_f/2","transform":{"x":50,"y":-91.5}},{"name":"we_bl_4_f/3","transform":{"x":40,"y":-68}},{"name":"we_bl_4_f/4","transform":{"x":23.5,"y":-38}},{"name":"we_bl_4_f/5","transform":{"x":12.5,"y":-34}}]}]}],"animation":[{"duration":5,"name":"fade_in","slot":[{"name":"b","displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"duration":0,"value":-1}]}]}],"defaultActions":[{"gotoAndPlay":"fade_in"}]},{"type":"Armature","frameRate":25,"name":"we_bl_5","aabb":{"x":-97,"y":-26,"width":184,"height":236},"bone":[{"inheritScale":false,"name":"b"}],"slot":[{"name":"b","parent":"b"}],"skin":[{"slot":[{"name":"b","display":[{"name":"we_bl_5_f/1","transform":{"x":-5,"y":92}},{"name":"we_bl_5_f/2","transform":{"x":10.5,"y":64}},{"name":"we_bl_5_f/3","transform":{"x":-7,"y":57}},{"name":"we_bl_5_f/4","transform":{"x":-6,"y":18.5}},{"name":"we_bl_5_f/5","transform":{"x":-4,"y":-2.5}}]}]}],"animation":[{"duration":5,"name":"fade_in","slot":[{"name":"b","displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"duration":0,"value":-1}]}]}],"defaultActions":[{"gotoAndPlay":"fade_in"}]},{"type":"Armature","frameRate":25,"name":"weapon_replace","aabb":{"x":-56,"y":-44,"width":313,"height":102},"bone":[{"inheritScale":false,"name":"b","transform":{"x":100.5,"y":7}}],"slot":[{"name":"b","parent":"b"}],"skin":[{"slot":[{"name":"b","display":[{"name":"weapon_replace_folder/weapon_hand_r_4"}]}]}],"animation":[{"duration":0,"name":"a_1"}],"defaultActions":[{"gotoAndPlay":"a_1"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_ske.json.meta b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_ske.json.meta new file mode 100644 index 00000000..0c3184a3 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "dcd88cfc-70bd-47f9-a26e-8122f3d4b3a3", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.json b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.json new file mode 100644 index 00000000..f9d2fbc5 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.json @@ -0,0 +1 @@ +{"width":1024,"height":1024,"name":"mecha_1004d","imagePath":"mecha_1004d_tex.png","SubTexture":[{"width":105,"y":130,"height":82,"name":"mecha_1004d_folder/textures/forearm_l_1","x":859},{"width":100,"y":214,"height":72,"name":"mecha_1004d_folder/textures/forearm_l_2","x":859},{"width":80,"y":288,"height":65,"name":"mecha_1004d_folder/textures/forearm_l_0","x":859},{"width":26,"y":485,"height":22,"name":"mecha_1004d_folder/textures/hand_l_0","x":990},{"width":26,"y":212,"height":25,"name":"mecha_1004d_folder/textures/hand_l_2","x":496},{"width":27,"y":485,"height":23,"name":"mecha_1004d_folder/textures/hand_l_3","x":961},{"width":26,"y":510,"height":19,"name":"mecha_1004d_folder/textures/hand_l_1","x":961},{"width":63,"y":1,"height":59,"name":"mecha_1004d_folder/textures/shouder_l_1","x":960},{"width":70,"y":186,"height":61,"name":"mecha_1004d_folder/textures/shouder_l_0","x":311},{"width":69,"y":951,"height":56,"name":"mecha_1004d_folder/textures/shouder_l_2","x":1},{"width":29,"y":128,"height":83,"name":"mecha_1004d_folder/textures/foot_l_0","x":966},{"width":83,"y":353,"height":56,"name":"mecha_1004d_folder/textures/thigh_l_0","x":418},{"width":74,"y":951,"height":46,"name":"mecha_1004d_folder/textures/calf_l_1","x":72},{"width":61,"y":546,"height":44,"name":"mecha_1004d_folder/textures/calf_l_0","x":957},{"width":64,"y":347,"height":71,"name":"mecha_1004d_folder/textures/pelvis_1","x":941},{"width":58,"y":62,"height":64,"name":"mecha_1004d_folder/textures/pelvis_3","x":960},{"width":68,"y":546,"height":61,"name":"mecha_1004d_folder/textures/pelvis_0","x":887},{"width":168,"y":1,"height":182,"name":"mecha_1004d_folder/textures/chest_2","x":384},{"width":154,"y":1,"height":183,"name":"mecha_1004d_folder/textures/chest_0","x":227},{"width":163,"y":185,"height":184,"name":"mecha_1004d_folder/textures/chest_1","x":694},{"width":163,"y":185,"height":186,"name":"mecha_1004d_folder/textures/chest_3","x":529},{"width":30,"y":355,"height":85,"name":"mecha_1004d_folder/textures/foot_r_1","x":887},{"width":35,"y":592,"height":64,"name":"mecha_1004d_folder/textures/foot_r_0","x":957},{"width":72,"y":671,"height":39,"name":"mecha_1004d_folder/textures/calf_r_0","x":290},{"width":76,"y":130,"height":47,"name":"mecha_1004d_folder/textures/calf_r_1","x":758},{"width":82,"y":288,"height":57,"name":"mecha_1004d_folder/textures/thigh_r_1","x":941},{"width":82,"y":186,"height":58,"name":"mecha_1004d_folder/textures/thigh_r_0","x":227},{"width":72,"y":485,"height":59,"name":"mecha_1004d_folder/textures/shouder_r_2","x":887},{"width":59,"y":214,"height":61,"name":"mecha_1004d_folder/textures/shouder_r_0","x":961},{"width":68,"y":420,"height":63,"name":"mecha_1004d_folder/textures/shouder_r_1","x":941},{"width":29,"y":185,"height":25,"name":"mecha_1004d_folder/textures/hand_r_3","x":496},{"width":27,"y":509,"height":21,"name":"mecha_1004d_folder/textures/hand_r_2","x":990},{"width":26,"y":442,"height":24,"name":"mecha_1004d_folder/textures/hand_r_1","x":887},{"width":111,"y":185,"height":56,"name":"mecha_1004d_folder/textures/forearm_r_2","x":383},{"width":102,"y":671,"height":39,"name":"mecha_1004d_folder/textures/forearm_r_3","x":186},{"y":713,"frameX":0,"frameHeight":237,"frameY":0,"width":182,"frameWidth":182,"height":236,"name":"we_bl_4_f/2","x":1},{"y":475,"frameX":-1,"frameHeight":196,"frameY":-1,"width":196,"frameWidth":198,"height":194,"name":"we_bl_4_f/3","x":186},{"width":224,"y":1,"height":246,"name":"we_bl_4_f/1","x":1},{"y":1,"frameX":0,"frameHeight":128,"frameY":0,"width":200,"frameWidth":201,"height":127,"name":"we_bl_4_f/4","x":758},{"y":353,"frameX":0,"frameHeight":118,"frameY":0,"width":202,"frameWidth":203,"height":117,"name":"we_bl_4_f/5","x":214},{"width":202,"y":1,"height":145,"name":"we_bl_5_f/4","x":554},{"width":185,"y":713,"height":212,"name":"we_bl_5_f/2","x":185},{"y":371,"frameX":-1,"frameHeight":121,"frameY":0,"width":191,"frameWidth":192,"height":121,"name":"we_bl_5_f/5","x":694},{"y":475,"frameX":0,"frameHeight":236,"frameY":0,"width":183,"frameWidth":184,"height":236,"name":"we_bl_5_f/1","x":1},{"y":249,"frameX":-1,"frameHeight":224,"frameY":0,"width":211,"frameWidth":212,"height":224,"name":"we_bl_5_f/3","x":1},{"width":313,"y":249,"height":102,"name":"weapon_replace_folder/weapon_hand_r_4","x":214}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.json.meta b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.json.meta new file mode 100644 index 00000000..3672755f --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "de46eb88-8569-4c3a-b898-29ca79720a0a", + "atlasJson": "{\"width\":1024,\"height\":1024,\"name\":\"mecha_1004d\",\"imagePath\":\"mecha_1004d_tex.png\",\"SubTexture\":[{\"width\":105,\"y\":130,\"height\":82,\"name\":\"mecha_1004d_folder/textures/forearm_l_1\",\"x\":859},{\"width\":100,\"y\":214,\"height\":72,\"name\":\"mecha_1004d_folder/textures/forearm_l_2\",\"x\":859},{\"width\":80,\"y\":288,\"height\":65,\"name\":\"mecha_1004d_folder/textures/forearm_l_0\",\"x\":859},{\"width\":26,\"y\":485,\"height\":22,\"name\":\"mecha_1004d_folder/textures/hand_l_0\",\"x\":990},{\"width\":26,\"y\":212,\"height\":25,\"name\":\"mecha_1004d_folder/textures/hand_l_2\",\"x\":496},{\"width\":27,\"y\":485,\"height\":23,\"name\":\"mecha_1004d_folder/textures/hand_l_3\",\"x\":961},{\"width\":26,\"y\":510,\"height\":19,\"name\":\"mecha_1004d_folder/textures/hand_l_1\",\"x\":961},{\"width\":63,\"y\":1,\"height\":59,\"name\":\"mecha_1004d_folder/textures/shouder_l_1\",\"x\":960},{\"width\":70,\"y\":186,\"height\":61,\"name\":\"mecha_1004d_folder/textures/shouder_l_0\",\"x\":311},{\"width\":69,\"y\":951,\"height\":56,\"name\":\"mecha_1004d_folder/textures/shouder_l_2\",\"x\":1},{\"width\":29,\"y\":128,\"height\":83,\"name\":\"mecha_1004d_folder/textures/foot_l_0\",\"x\":966},{\"width\":83,\"y\":353,\"height\":56,\"name\":\"mecha_1004d_folder/textures/thigh_l_0\",\"x\":418},{\"width\":74,\"y\":951,\"height\":46,\"name\":\"mecha_1004d_folder/textures/calf_l_1\",\"x\":72},{\"width\":61,\"y\":546,\"height\":44,\"name\":\"mecha_1004d_folder/textures/calf_l_0\",\"x\":957},{\"width\":64,\"y\":347,\"height\":71,\"name\":\"mecha_1004d_folder/textures/pelvis_1\",\"x\":941},{\"width\":58,\"y\":62,\"height\":64,\"name\":\"mecha_1004d_folder/textures/pelvis_3\",\"x\":960},{\"width\":68,\"y\":546,\"height\":61,\"name\":\"mecha_1004d_folder/textures/pelvis_0\",\"x\":887},{\"width\":168,\"y\":1,\"height\":182,\"name\":\"mecha_1004d_folder/textures/chest_2\",\"x\":384},{\"width\":154,\"y\":1,\"height\":183,\"name\":\"mecha_1004d_folder/textures/chest_0\",\"x\":227},{\"width\":163,\"y\":185,\"height\":184,\"name\":\"mecha_1004d_folder/textures/chest_1\",\"x\":694},{\"width\":163,\"y\":185,\"height\":186,\"name\":\"mecha_1004d_folder/textures/chest_3\",\"x\":529},{\"width\":30,\"y\":355,\"height\":85,\"name\":\"mecha_1004d_folder/textures/foot_r_1\",\"x\":887},{\"width\":35,\"y\":592,\"height\":64,\"name\":\"mecha_1004d_folder/textures/foot_r_0\",\"x\":957},{\"width\":72,\"y\":671,\"height\":39,\"name\":\"mecha_1004d_folder/textures/calf_r_0\",\"x\":290},{\"width\":76,\"y\":130,\"height\":47,\"name\":\"mecha_1004d_folder/textures/calf_r_1\",\"x\":758},{\"width\":82,\"y\":288,\"height\":57,\"name\":\"mecha_1004d_folder/textures/thigh_r_1\",\"x\":941},{\"width\":82,\"y\":186,\"height\":58,\"name\":\"mecha_1004d_folder/textures/thigh_r_0\",\"x\":227},{\"width\":72,\"y\":485,\"height\":59,\"name\":\"mecha_1004d_folder/textures/shouder_r_2\",\"x\":887},{\"width\":59,\"y\":214,\"height\":61,\"name\":\"mecha_1004d_folder/textures/shouder_r_0\",\"x\":961},{\"width\":68,\"y\":420,\"height\":63,\"name\":\"mecha_1004d_folder/textures/shouder_r_1\",\"x\":941},{\"width\":29,\"y\":185,\"height\":25,\"name\":\"mecha_1004d_folder/textures/hand_r_3\",\"x\":496},{\"width\":27,\"y\":509,\"height\":21,\"name\":\"mecha_1004d_folder/textures/hand_r_2\",\"x\":990},{\"width\":26,\"y\":442,\"height\":24,\"name\":\"mecha_1004d_folder/textures/hand_r_1\",\"x\":887},{\"width\":111,\"y\":185,\"height\":56,\"name\":\"mecha_1004d_folder/textures/forearm_r_2\",\"x\":383},{\"width\":102,\"y\":671,\"height\":39,\"name\":\"mecha_1004d_folder/textures/forearm_r_3\",\"x\":186},{\"y\":713,\"frameX\":0,\"frameHeight\":237,\"frameY\":0,\"width\":182,\"frameWidth\":182,\"height\":236,\"name\":\"we_bl_4_f/2\",\"x\":1},{\"y\":475,\"frameX\":-1,\"frameHeight\":196,\"frameY\":-1,\"width\":196,\"frameWidth\":198,\"height\":194,\"name\":\"we_bl_4_f/3\",\"x\":186},{\"width\":224,\"y\":1,\"height\":246,\"name\":\"we_bl_4_f/1\",\"x\":1},{\"y\":1,\"frameX\":0,\"frameHeight\":128,\"frameY\":0,\"width\":200,\"frameWidth\":201,\"height\":127,\"name\":\"we_bl_4_f/4\",\"x\":758},{\"y\":353,\"frameX\":0,\"frameHeight\":118,\"frameY\":0,\"width\":202,\"frameWidth\":203,\"height\":117,\"name\":\"we_bl_4_f/5\",\"x\":214},{\"width\":202,\"y\":1,\"height\":145,\"name\":\"we_bl_5_f/4\",\"x\":554},{\"width\":185,\"y\":713,\"height\":212,\"name\":\"we_bl_5_f/2\",\"x\":185},{\"y\":371,\"frameX\":-1,\"frameHeight\":121,\"frameY\":0,\"width\":191,\"frameWidth\":192,\"height\":121,\"name\":\"we_bl_5_f/5\",\"x\":694},{\"y\":475,\"frameX\":0,\"frameHeight\":236,\"frameY\":0,\"width\":183,\"frameWidth\":184,\"height\":236,\"name\":\"we_bl_5_f/1\",\"x\":1},{\"y\":249,\"frameX\":-1,\"frameHeight\":224,\"frameY\":0,\"width\":211,\"frameWidth\":212,\"height\":224,\"name\":\"we_bl_5_f/3\",\"x\":1},{\"width\":313,\"y\":249,\"height\":102,\"name\":\"weapon_replace_folder/weapon_hand_r_4\",\"x\":214}]}", + "texture": "2657c58a-6dff-47d8-a14c-c159b22ac205", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.png b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.png new file mode 100644 index 00000000..c792a4c6 Binary files /dev/null and b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.png differ diff --git a/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.png.meta b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.png.meta new file mode 100644 index 00000000..e668aee8 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d/mecha_1004d_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "2657c58a-6dff-47d8-a14c-c159b22ac205", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "mecha_1004d_tex": { + "ver": "1.0.3", + "uuid": "1ad3f601-20da-482e-b25a-bf15a399746a", + "rawTextureUuid": "2657c58a-6dff-47d8-a14c-c159b22ac205", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 8, + "trimX": 1, + "trimY": 1, + "width": 1022, + "height": 1006, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d_show.meta b/Cocos/Demos/assets/resources/mecha_1004d_show.meta new file mode 100644 index 00000000..5131a410 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d_show.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "a8300c25-d583-4b5a-8d74-23d91715db99", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_ske.json b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_ske.json new file mode 100644 index 00000000..5b2f69a5 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_ske.json @@ -0,0 +1 @@ +{"frameRate":25,"name":"mecha_1004d_show","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":25,"name":"mecha_1004d","aabb":{"x":-487.86,"y":-487.89,"width":756.87,"height":576.61},"bone":[{"name":"root"},{"inheritScale":false,"length":73,"name":"shouder_r","parent":"root","transform":{"x":-93.7,"y":-323,"skX":85.5769,"skY":85.5754,"scX":0.9988,"scY":0.9996}},{"inheritScale":false,"length":86,"name":"shouder_l","parent":"root","transform":{"x":109.7,"y":-370.15,"skX":67.9555,"skY":67.9569,"scX":0.997,"scY":0.9976}},{"inheritScale":false,"length":48,"name":"pelvis","parent":"root","transform":{"y":-177.9,"skX":-91.1134,"skY":-91.1215,"scX":0.9987,"scY":0.9996}},{"inheritScale":false,"length":86,"name":"forearm_r","parent":"shouder_r","transform":{"x":73.91,"y":0.03,"skX":20.6849,"skY":20.6859,"scX":0.998,"scY":0.9982}},{"inheritScale":false,"length":48,"name":"chest","parent":"pelvis","transform":{"x":48.53,"y":0.03,"skX":177.7225,"skY":177.7167,"scX":0.9989,"scY":0.9998}},{"inheritScale":false,"length":100,"name":"forearm_l","parent":"shouder_l","transform":{"x":86.16,"y":-0.02,"skX":11.4743,"skY":11.4742,"scX":0.9991,"scY":0.9989}},{"inheritScale":false,"length":41,"name":"thigh_l","parent":"chest","transform":{"x":48.09,"y":-51.64,"skX":2.2965,"skY":2.054,"scX":0.9728,"scY":0.9995}},{"inheritScale":false,"name":"hand_r","parent":"forearm_r","transform":{"x":86.03,"y":0.02,"skX":-17.0115,"skY":-17.0123,"scX":0.9962}},{"inheritScale":false,"name":"hand_l","parent":"forearm_l","transform":{"x":100.92,"y":-0.03,"skX":-1.4428,"skY":-1.4428,"scX":0.9984,"scY":0.9987}},{"inheritScale":false,"length":64,"name":"thigh_r","parent":"chest","transform":{"x":48.83,"y":51.55,"skX":47.3349,"skY":47.3381,"scX":0.998,"scY":0.9967}},{"inheritScale":false,"length":129,"name":"calf_l","parent":"thigh_l","transform":{"x":41.36,"y":-0.04,"skX":-21.8135,"skY":-21.8126,"scX":0.9984,"scY":0.9976}},{"inheritScale":false,"length":100,"name":"calf_r","parent":"thigh_r","transform":{"x":64.7,"y":0.05,"skX":-54.2764,"skY":-54.2755,"scX":0.9994,"scY":0.999}},{"inheritScale":false,"name":"weapon_hand_l","parent":"hand_l","transform":{"x":31.5347,"y":10.1248,"skX":77.9701,"skY":77.9701,"scX":0.9976,"scY":0.9988}},{"inheritScale":false,"name":"weapon_hand_r","parent":"hand_r","transform":{"x":18.0534,"y":-6.8328,"skX":71.7239,"skY":71.7239,"scX":0.998,"scY":0.999}},{"inheritScale":false,"name":"foot_l","parent":"calf_l","transform":{"x":129.47,"y":-0.01,"skX":23.1618,"skY":23.1618,"scX":0.9997}},{"inheritScale":false,"name":"foot_r","parent":"calf_r","transform":{"x":100.6,"y":0.04,"skX":10.3405,"skY":10.3405,"scX":0.9997}}],"slot":[{"name":"shouder_r","parent":"shouder_r"},{"name":"forearm_r","parent":"forearm_r"},{"name":"hand_r","parent":"hand_r"},{"name":"weapon_hand_r","parent":"weapon_hand_r"},{"name":"thigh_r","parent":"thigh_r"},{"name":"calf_r","parent":"calf_r"},{"name":"foot_r","parent":"foot_r"},{"name":"chest","parent":"chest"},{"name":"pelvis","parent":"pelvis"},{"name":"thigh_l","parent":"thigh_l"},{"name":"calf_l","parent":"calf_l"},{"name":"foot_l","parent":"foot_l"},{"displayIndex":4,"name":"weapon_hand_l","parent":"weapon_hand_l"},{"name":"hand_l","parent":"hand_l"},{"name":"shouder_l","parent":"shouder_l"},{"name":"forearm_l","parent":"forearm_l"},{"name":"logo","parent":"pelvis"}],"skin":[{"name":"","slot":[{"name":"foot_r","display":[{"name":"mecha_1004d_folder/foot_r","transform":{"x":2.95,"y":-2.95}}]},{"name":"thigh_r","display":[{"name":"mecha_1004d_folder/thigh_r","transform":{"x":16.9,"y":-3.65,"skX":0.94,"skY":0.94}}]},{"name":"forearm_r","display":[{"name":"mecha_1004d_folder/forearm_r","transform":{"x":39.8,"y":-8.25,"skX":-0.49,"skY":-0.49}}]},{"name":"forearm_l","display":[{"name":"mecha_1004d_folder/forearm_l","transform":{"x":47.25,"y":-14.15,"skX":1.06,"skY":1.06}}]},{"name":"weapon_hand_l","display":[{"name":"weapon_1004_l","transform":{"x":91.22,"y":-30.21}},{"name":"weapon_1004b_l","transform":{"x":122.94,"y":-44.14}},{"name":"weapon_1004c_l","transform":{"x":130.95,"y":-56.95}},{"name":"weapon_1004d_l","transform":{"x":134.67,"y":-55.25}},{"name":"weapon_1004e_l","transform":{"x":155.62,"y":-59.2}}]},{"name":"foot_l","display":[{"name":"mecha_1004d_folder/foot_l","transform":{"x":3.95,"y":0.95}}]},{"name":"thigh_l","display":[{"name":"mecha_1004d_folder/thigh_l","transform":{"x":9.05,"y":-1.25,"skX":4.48,"skY":4.48}}]},{"name":"chest","display":[{"name":"mecha_1004d_folder/chest","transform":{"x":-95.5,"y":-13.55,"skX":-177.85,"skY":-177.85}}]},{"name":"calf_r","display":[{"name":"mecha_1004d_folder/calf_r","transform":{"x":52.15,"y":-4.85,"skX":2.34,"skY":2.34}}]},{"name":"shouder_r","display":[{"name":"mecha_1004d_folder/shouder_r","transform":{"x":6.9,"y":-1.9,"skX":0.42,"skY":0.42}}]},{"name":"weapon_hand_r","display":[{"name":"weapon_1004_r","transform":{"x":119.74,"y":-23.1}}]},{"name":"hand_r","display":[{"name":"mecha_1004d_folder/hand_r","transform":{"x":20.9,"y":-1.95}}]},{"name":"logo","display":[{"name":"logo","transform":{"x":95.09,"y":-328.7,"skX":91.12,"skY":91.12,"scX":1.0004,"scY":1.0013}}]},{"name":"shouder_l","display":[{"name":"mecha_1004d_folder/shouder_l","transform":{"x":8.9,"y":-2.15,"skX":-1.25,"skY":-1.25}}]},{"name":"hand_l","display":[{"name":"mecha_1004d_folder/hand_l","transform":{"x":22,"y":11}}]},{"name":"calf_l","display":[{"name":"mecha_1004d_folder/calf_l","transform":{"x":62.9,"y":0.1,"skX":0.12,"skY":0.12}}]},{"name":"pelvis","display":[{"name":"mecha_1004d_folder/pelvis","transform":{"x":-15.05,"y":0.8,"skX":4.37,"skY":4.37}}]}]}],"animation":[{"duration":80,"playTimes":0,"name":"idle","bone":[{"name":"shouder_r","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.85,"y":-5.6},{"duration":5,"tweenEasing":0,"x":0.8,"y":-5.6},{"duration":35,"tweenEasing":0,"x":0.75,"y":-5.4},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.25},{"duration":35,"tweenEasing":0,"rotate":-0.25},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.01,"y":-0.19},{"duration":5,"tweenEasing":0,"y":-0.19},{"duration":35,"tweenEasing":0,"x":0.03,"y":-0.21},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":1.26},{"duration":5,"tweenEasing":0,"rotate":1.26},{"duration":35,"tweenEasing":0,"rotate":1.25},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-0.28,"y":0.19},{"duration":5,"tweenEasing":0,"x":-0.27,"y":0.14},{"duration":35,"tweenEasing":0,"x":-0.27,"y":-0.03},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-0.25},{"duration":5,"tweenEasing":0,"rotate":-0.5},{"duration":35,"tweenEasing":0,"rotate":-0.5},{"duration":0}]},{"name":"weapon_hand_r","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.02,"y":0.03},{"duration":5,"tweenEasing":0,"x":0.02,"y":0.03},{"duration":35,"tweenEasing":0,"x":0.03,"y":0.03},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":0.5},{"duration":5,"tweenEasing":0,"rotate":0.75},{"duration":35,"tweenEasing":0,"rotate":0.5},{"duration":0}]},{"name":"thigh_r","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-0.8,"y":-1.53},{"duration":5,"tweenEasing":0,"x":-0.66,"y":-1.8},{"duration":35,"tweenEasing":0,"x":-0.8,"y":-1.53},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-4.01},{"duration":5,"tweenEasing":0,"rotate":-4.26},{"duration":35,"tweenEasing":0,"rotate":-4.01},{"duration":0}],"scaleFrame":[{"duration":35,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.02},{"duration":35,"tweenEasing":0,"x":1.02},{"duration":0}]},{"name":"calf_r","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-0.61,"y":0.41},{"duration":5,"tweenEasing":0,"x":-0.6,"y":0.26},{"duration":35,"tweenEasing":0,"x":-0.61,"y":0.41},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":5.25},{"duration":35,"tweenEasing":0,"rotate":5.25},{"duration":0}],"scaleFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0,"x":1.02},{"duration":35,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"foot_r","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.5,"y":0.47},{"duration":5,"tweenEasing":0,"x":0.52,"y":0.57},{"duration":35,"tweenEasing":0,"x":0.5,"y":0.47},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-1.79},{"duration":35,"tweenEasing":0,"rotate":-1.79},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.19,"y":-0.74},{"duration":5,"tweenEasing":0,"x":-0.25,"y":-0.83},{"duration":35,"tweenEasing":0,"x":0.19,"y":-0.74},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-0.17},{"duration":5,"tweenEasing":0,"rotate":-0.02},{"duration":35,"tweenEasing":0,"rotate":-0.17},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"y":-4.1},{"duration":0}],"rotateFrame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"rotate":0.75},{"duration":0}]},{"name":"thigh_l","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.1,"y":0.37},{"duration":5,"tweenEasing":0,"x":0.9,"y":0.16},{"duration":35,"tweenEasing":0,"x":1.1,"y":0.37},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-1.5},{"duration":5,"tweenEasing":0,"rotate":-1.75},{"duration":35,"tweenEasing":0,"rotate":-1.5},{"duration":0}],"scaleFrame":[{"duration":35,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.08},{"duration":35,"tweenEasing":0,"x":1.08},{"duration":0}]},{"name":"calf_l","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-0.76,"y":0.24},{"duration":5,"tweenEasing":0,"x":-0.75,"y":0.21},{"duration":35,"tweenEasing":0,"x":-0.76,"y":0.24},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":0.4},{"duration":35,"tweenEasing":0,"rotate":0.4},{"duration":0}]},{"name":"foot_l","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":0.16,"y":0.09},{"duration":35,"tweenEasing":0,"x":0.16,"y":0.09},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":0.25},{"duration":35,"tweenEasing":0,"rotate":0.25},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-0.32,"y":-0.13},{"duration":5,"tweenEasing":0,"x":-0.31,"y":-0.21},{"duration":35,"tweenEasing":0,"x":-0.36,"y":-0.17},{"duration":0}]},{"name":"weapon_hand_l","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.01,"y":0.02},{"duration":5,"tweenEasing":0,"x":-0.03,"y":-0.01},{"duration":35,"tweenEasing":0,"x":-0.01,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":1.76},{"duration":5,"tweenEasing":0,"rotate":1.75},{"duration":35,"tweenEasing":0,"rotate":1.76},{"duration":0}]},{"name":"shouder_l","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":2,"y":-7.75},{"duration":5,"tweenEasing":0,"x":2.15,"y":-8.1},{"duration":35,"tweenEasing":0,"x":1.95,"y":-8.15},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.75},{"duration":35,"tweenEasing":0,"rotate":-0.75},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"duration":35,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-0.33,"y":-0.12},{"duration":5,"tweenEasing":0,"x":-0.35,"y":-0.12},{"duration":35,"tweenEasing":0,"x":-0.31,"y":-0.13},{"duration":0}],"rotateFrame":[{"duration":35,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":0.75},{"duration":35,"tweenEasing":0,"rotate":0.75},{"duration":0}]}],"slot":[{"name":"weapon_hand_l","displayFrame":[{"duration":80}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_ske.json.meta b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_ske.json.meta new file mode 100644 index 00000000..c3382478 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "db5537fb-35a9-45ac-a5fa-d83f4c6fc198", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.json b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.json new file mode 100644 index 00000000..d735d44a --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.json @@ -0,0 +1 @@ +{"SubTexture":[{"width":119,"y":540,"height":101,"name":"mecha_1004d_folder/shouder_r","x":439},{"frameX":0,"frameHeight":95,"y":536,"frameY":0,"frameWidth":179,"width":179,"height":94,"name":"mecha_1004d_folder/forearm_r","x":1},{"width":48,"y":536,"height":41,"name":"mecha_1004d_folder/hand_r","x":238},{"width":293,"y":448,"height":86,"name":"weapon_1004_r","x":1},{"width":150,"y":459,"height":92,"name":"mecha_1004d_folder/thigh_r","x":650},{"frameX":0,"frameHeight":83,"y":581,"frameY":0,"frameWidth":122,"width":122,"height":82,"name":"mecha_1004d_folder/calf_r","x":299},{"width":48,"y":314,"height":148,"name":"mecha_1004d_folder/foot_r","x":975},{"width":288,"y":1,"height":331,"name":"mecha_1004d_folder/chest","x":386},{"frameX":0,"frameHeight":117,"y":334,"frameY":0,"frameWidth":118,"width":118,"height":116,"name":"mecha_1004d_folder/pelvis","x":545},{"frameX":0,"frameHeight":92,"y":581,"frameY":0,"frameWidth":116,"width":115,"height":91,"name":"mecha_1004d_folder/thigh_l","x":182},{"width":147,"y":632,"height":65,"name":"mecha_1004d_folder/calf_l","x":1},{"width":58,"y":540,"height":61,"name":"mecha_1004d_folder/foot_l","x":560},{"width":297,"y":314,"height":143,"name":"weapon_1004b_l","x":676},{"width":328,"y":263,"height":183,"name":"weapon_1004d_l","x":1},{"frameX":0,"frameHeight":160,"y":1,"frameY":0,"frameWidth":323,"width":323,"height":159,"name":"weapon_1004c_l","x":676},{"width":212,"y":334,"height":120,"name":"weapon_1004_l","x":331},{"width":383,"y":1,"height":260,"name":"weapon_1004e_l","x":1},{"width":54,"y":536,"height":40,"name":"mecha_1004d_folder/hand_l","x":182},{"width":141,"y":456,"height":123,"name":"mecha_1004d_folder/shouder_l","x":296},{"width":209,"y":456,"height":82,"name":"mecha_1004d_folder/forearm_l","x":439},{"frameX":0,"frameHeight":150,"y":162,"frameY":0,"frameWidth":315,"width":313,"height":150,"name":"logo","x":676}],"width":1024,"height":1024,"name":"mecha_1004d_show","imagePath":"mecha_1004d_show_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.json.meta b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.json.meta new file mode 100644 index 00000000..41dc07ce --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "7f971bdb-95dc-4364-b5c6-c9e9107b200e", + "atlasJson": "{\"SubTexture\":[{\"width\":119,\"y\":540,\"height\":101,\"name\":\"mecha_1004d_folder/shouder_r\",\"x\":439},{\"frameX\":0,\"frameHeight\":95,\"y\":536,\"frameY\":0,\"frameWidth\":179,\"width\":179,\"height\":94,\"name\":\"mecha_1004d_folder/forearm_r\",\"x\":1},{\"width\":48,\"y\":536,\"height\":41,\"name\":\"mecha_1004d_folder/hand_r\",\"x\":238},{\"width\":293,\"y\":448,\"height\":86,\"name\":\"weapon_1004_r\",\"x\":1},{\"width\":150,\"y\":459,\"height\":92,\"name\":\"mecha_1004d_folder/thigh_r\",\"x\":650},{\"frameX\":0,\"frameHeight\":83,\"y\":581,\"frameY\":0,\"frameWidth\":122,\"width\":122,\"height\":82,\"name\":\"mecha_1004d_folder/calf_r\",\"x\":299},{\"width\":48,\"y\":314,\"height\":148,\"name\":\"mecha_1004d_folder/foot_r\",\"x\":975},{\"width\":288,\"y\":1,\"height\":331,\"name\":\"mecha_1004d_folder/chest\",\"x\":386},{\"frameX\":0,\"frameHeight\":117,\"y\":334,\"frameY\":0,\"frameWidth\":118,\"width\":118,\"height\":116,\"name\":\"mecha_1004d_folder/pelvis\",\"x\":545},{\"frameX\":0,\"frameHeight\":92,\"y\":581,\"frameY\":0,\"frameWidth\":116,\"width\":115,\"height\":91,\"name\":\"mecha_1004d_folder/thigh_l\",\"x\":182},{\"width\":147,\"y\":632,\"height\":65,\"name\":\"mecha_1004d_folder/calf_l\",\"x\":1},{\"width\":58,\"y\":540,\"height\":61,\"name\":\"mecha_1004d_folder/foot_l\",\"x\":560},{\"width\":297,\"y\":314,\"height\":143,\"name\":\"weapon_1004b_l\",\"x\":676},{\"width\":328,\"y\":263,\"height\":183,\"name\":\"weapon_1004d_l\",\"x\":1},{\"frameX\":0,\"frameHeight\":160,\"y\":1,\"frameY\":0,\"frameWidth\":323,\"width\":323,\"height\":159,\"name\":\"weapon_1004c_l\",\"x\":676},{\"width\":212,\"y\":334,\"height\":120,\"name\":\"weapon_1004_l\",\"x\":331},{\"width\":383,\"y\":1,\"height\":260,\"name\":\"weapon_1004e_l\",\"x\":1},{\"width\":54,\"y\":536,\"height\":40,\"name\":\"mecha_1004d_folder/hand_l\",\"x\":182},{\"width\":141,\"y\":456,\"height\":123,\"name\":\"mecha_1004d_folder/shouder_l\",\"x\":296},{\"width\":209,\"y\":456,\"height\":82,\"name\":\"mecha_1004d_folder/forearm_l\",\"x\":439},{\"frameX\":0,\"frameHeight\":150,\"y\":162,\"frameY\":0,\"frameWidth\":315,\"width\":313,\"height\":150,\"name\":\"logo\",\"x\":676}],\"width\":1024,\"height\":1024,\"name\":\"mecha_1004d_show\",\"imagePath\":\"mecha_1004d_show_tex.png\"}", + "texture": "0e8b4346-5429-4a9b-bbf9-47b1e199dfc2", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.png b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.png new file mode 100644 index 00000000..8bb77554 Binary files /dev/null and b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.png differ diff --git a/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.png.meta b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.png.meta new file mode 100644 index 00000000..7b484081 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1004d_show/mecha_1004d_show_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "0e8b4346-5429-4a9b-bbf9-47b1e199dfc2", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "mecha_1004d_show_tex": { + "ver": "1.0.3", + "uuid": "c2e79baa-a44e-4e24-8567-601185701cbf", + "rawTextureUuid": "0e8b4346-5429-4a9b-bbf9-47b1e199dfc2", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 163, + "trimX": 1, + "trimY": 1, + "width": 1022, + "height": 696, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1406.meta b/Cocos/Demos/assets/resources/mecha_1406.meta new file mode 100644 index 00000000..6bd0e123 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1406.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "6f1af821-b396-405c-8300-3d65a28ddc70", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.dbbin b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.dbbin new file mode 100644 index 00000000..6e062eaf Binary files /dev/null and b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.dbbin differ diff --git a/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.dbbin.meta b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.dbbin.meta new file mode 100644 index 00000000..2c533907 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.dbbin.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.0", + "uuid": "af3dfb60-a39d-4ce5-a55f-25e10d0fca20", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.json b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.json new file mode 100644 index 00000000..dccbb54b --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.json @@ -0,0 +1 @@ +{"frameRate":24,"name":"mecha_1406","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"mecha_1406","aabb":{"x":-88.16,"y":-213.5,"width":247.6,"height":238.68},"bone":[{"inheritScale":false,"length":20,"name":"root"},{"inheritScale":false,"length":33,"name":"pelvis","parent":"root","transform":{"x":-5.872,"y":-103.685,"skX":-90.6854,"skY":-90.6854}},{"inheritScale":false,"length":20,"name":"foot_l","parent":"root","transform":{"x":71.808,"y":-31.055,"skX":90,"skY":90,"scX":0.9955}},{"inheritScale":false,"length":20,"name":"foot_r","parent":"root","transform":{"x":-47.192,"y":-13.285,"skX":90,"skY":90,"scX":0.9955}},{"length":50,"name":"thigh_l","parent":"root","transform":{"x":0.678,"y":-112.465,"skX":16.0827,"skY":16.0827,"scX":1.005,"scY":0.9973}},{"length":52,"name":"thigh_r","parent":"root","transform":{"x":-12.662,"y":-94.655,"skX":85.252,"skY":85.252,"scX":0.9871,"scY":0.9993}},{"length":20,"name":"thigh_l_ik","parent":"foot_l","transform":{"x":-47.3294,"y":-24.2379,"skX":-90,"skY":-90,"scY":1.0045}},{"inheritScale":false,"length":22,"name":"chest","parent":"pelvis","transform":{"x":33.1,"skX":-41.0313,"skY":-40.7755,"scX":1.0022,"scY":1.0008}},{"inheritScale":false,"length":41,"name":"thigh_1_l","parent":"thigh_l","transform":{"x":50.86,"skX":91.3529,"skY":91.3591,"scX":0.9912,"scY":0.9971}},{"inheritScale":false,"length":43,"name":"thigh_1_r","parent":"thigh_r","transform":{"x":52.23,"y":-0.03,"skX":113.5008,"skY":113.503,"scX":1.004,"scY":0.9969}},{"length":20,"name":"thigh_r_ik","parent":"foot_r","transform":{"x":0.9127,"y":-39.8426,"skX":-90,"skY":-90,"scY":1.0045}},{"inheritScale":false,"length":44,"name":"calf_r","parent":"thigh_1_r","transform":{"x":43.98,"y":-0.02,"skX":-112.6745,"skY":-112.6734,"scX":0.9987,"scY":0.9995}},{"inheritScale":false,"length":30,"name":"shouder_l","parent":"chest","transform":{"x":21.35,"y":18.86,"skX":128.5246,"skY":128.5246,"scX":0.9937,"scY":0.9996}},{"inheritScale":false,"length":30,"name":"shouder_r","parent":"chest","transform":{"x":15.21,"y":-20.7,"skX":128.5246,"skY":128.5246,"scX":0.9937,"scY":0.9996}},{"inheritScale":false,"length":93,"name":"weapon","parent":"chest","transform":{"x":29.47,"y":1.86,"skX":118.5103,"skY":118.5103,"scX":0.994,"scY":0.9994}},{"inheritScale":false,"length":43,"name":"calf_l","parent":"thigh_1_l","transform":{"x":41.83,"y":0.03,"skX":-68.6325,"skY":-68.639,"scX":1.0193,"scY":0.9952}},{"inheritScale":false,"length":100,"name":"weapon_1","parent":"weapon","transform":{"x":93.18,"y":-0.01,"skX":12.1013,"skY":12.1013,"scX":0.9937,"scY":0.9996}}],"slot":[{"name":"shouder_l","parent":"shouder_l"},{"name":"foot_l","parent":"foot_l"},{"name":"thigh_1_l","parent":"thigh_1_l"},{"name":"calf_l","parent":"calf_l"},{"name":"thigh_l","parent":"thigh_l"},{"name":"chest","parent":"chest"},{"name":"foot_r","parent":"foot_r"},{"name":"thigh_1_r","parent":"thigh_1_r"},{"name":"calf_r","parent":"calf_r"},{"name":"thigh_r","parent":"thigh_r"},{"name":"weapon_1","parent":"weapon_1"},{"name":"weapon","parent":"weapon"},{"name":"shouder_r","parent":"shouder_r"}],"ik":[{"name":"bone_ik1","bone":"thigh_l","target":"thigh_l_ik"},{"name":"bone_ik","bone":"thigh_r","target":"thigh_r_ik"},{"bendPositive":false,"chain":1,"name":"calf_l","bone":"calf_l","target":"foot_l"},{"bendPositive":false,"chain":1,"name":"calf_r","bone":"calf_r","target":"foot_r"}],"skin":[{"name":"","slot":[{"name":"foot_l","display":[{"name":"mecha_1406_folder/textures/foot_l_0","transform":{"x":7.5,"y":3,"skX":-4,"skY":-4}}]},{"name":"calf_l","display":[{"name":"mecha_1406_folder/calf_l","transform":{"x":12.95,"y":-0.05,"skX":-0.14,"skY":-0.14}}]},{"name":"shouder_r","display":[{"name":"mecha_1406_folder/shouder_r","transform":{"x":-3.55,"y":-8}}]},{"name":"chest","display":[{"name":"mecha_1406_folder/chest","transform":{"x":9.1,"y":2.85,"skX":35.9,"skY":35.9}}]},{"name":"thigh_l","display":[{"name":"mecha_1406_folder/thigh_l","transform":{"x":17.5,"y":-2.95}}]},{"name":"thigh_1_r","display":[{"name":"mecha_1406_folder/textures/thigh_1_r_1","transform":{"x":22.05,"y":1.6,"skX":0.09,"skY":0.09}}]},{"name":"thigh_r","display":[{"name":"mecha_1406_folder/thigh_r","transform":{"x":18.45,"y":-2,"skX":0.06,"skY":0.06}}]},{"name":"weapon_1","display":[{"name":"mecha_1406_folder/weapon_1","transform":{"x":45.5,"y":0.05}}]},{"name":"weapon","display":[{"name":"mecha_1406_folder/weapon","transform":{"x":26.8,"y":-15.3,"skX":12.03,"skY":12.03}}]},{"name":"thigh_1_l","display":[{"name":"mecha_1406_folder/textures/thigh_1_l_0","transform":{"x":20.95,"y":-0.6,"skX":-0.35,"skY":-0.35}}]},{"name":"foot_r","display":[{"name":"mecha_1406_folder/foot_r","transform":{"x":8,"y":2.5,"skX":-4,"skY":-4}}]},{"name":"shouder_l","display":[{"name":"mecha_1406_folder/shouder_l","transform":{"x":-3.45,"y":-5.5}}]},{"name":"calf_r","display":[{"name":"mecha_1406_folder/calf_r","transform":{"x":13.5,"y":1.55,"skX":0.23,"skY":0.23}}]}]}],"animation":[{"duration":60,"playTimes":0,"fadeInTime":0.2,"name":"idle","bone":[{"name":"shouder_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.41,"y":1.02},{"duration":26,"tweenEasing":0,"x":1.69,"y":1.24},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":0.76},{"duration":26,"tweenEasing":0,"rotate":1.07},{"duration":0}]},{"name":"thigh_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.04,"y":-3},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":3.05},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":0.5},{"duration":0}]},{"name":"thigh_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.04,"y":-3.1},{"duration":0}]},{"name":"weapon_1","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.09,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-0.01},{"duration":0}]},{"name":"weapon","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.05,"y":-0.02},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":0.76},{"duration":0}]},{"name":"shouder_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.28,"y":1.19},{"duration":26,"tweenEasing":0,"x":1.6,"y":1.41},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":0.76},{"duration":26,"tweenEasing":0,"rotate":1.07},{"duration":0}]}]},{"duration":30,"playTimes":0,"fadeInTime":0.2,"name":"walk","bone":[{"name":"pelvis","translateFrame":[{"duration":4,"tweenEasing":0,"x":-4.69,"y":-15.64},{"duration":3,"tweenEasing":0,"x":-3.59,"y":-11.66},{"duration":8,"tweenEasing":0,"x":-3.19,"y":-20.11},{"duration":4,"tweenEasing":0,"x":-4.69,"y":-15.64},{"duration":3,"tweenEasing":0,"x":-6.24,"y":-7.68},{"duration":8,"tweenEasing":0,"x":-6.32,"y":-14.38},{"duration":0,"x":-4.69,"y":-15.64}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":8.76},{"duration":3,"tweenEasing":0,"rotate":8.5},{"duration":8,"tweenEasing":0,"rotate":8.76},{"duration":4,"tweenEasing":0,"rotate":9.01},{"duration":3,"tweenEasing":0,"rotate":9.26},{"duration":8,"tweenEasing":0,"rotate":9.51},{"duration":0,"rotate":8.76}]},{"name":"shouder_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":-2.57,"y":2.39},{"duration":3,"tweenEasing":0,"x":-2.17,"y":-0.8},{"duration":8,"tweenEasing":0,"x":-2.38,"y":-2.89},{"duration":4,"tweenEasing":0,"x":-3.8,"y":-0.02},{"duration":2,"tweenEasing":0,"x":-3.42,"y":4.4},{"tweenEasing":0,"x":-3.02,"y":5.37},{"duration":8,"tweenEasing":0,"x":-2.54,"y":6.09},{"duration":0,"x":-2.57,"y":2.39}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-4.28},{"duration":3,"tweenEasing":0,"rotate":-1.66},{"duration":8,"tweenEasing":0,"rotate":-1.25},{"duration":4,"tweenEasing":0,"rotate":-7.48},{"duration":2,"tweenEasing":0,"rotate":-0.5},{"tweenEasing":0,"rotate":1.79},{"duration":8,"tweenEasing":0,"rotate":1.93},{"duration":0,"rotate":-4.28}]},{"name":"foot_l","translateFrame":[{"duration":2,"tweenEasing":0,"x":-5.03,"y":2.01},{"duration":2,"tweenEasing":0,"x":-8.28,"y":1.9},{"duration":3,"tweenEasing":0,"x":-24.59,"y":1.09},{"duration":4,"tweenEasing":0,"x":-51.81,"y":-0.18},{"duration":3,"tweenEasing":0,"x":-87.34,"y":-2.55},{"tweenEasing":0,"x":-106.14,"y":-6.83},{"duration":2,"tweenEasing":0,"x":-111.62,"y":-9.56},{"duration":2,"tweenEasing":0,"x":-115.29,"y":-15.42},{"tweenEasing":0,"x":-93.64,"y":-23.58},{"duration":2,"tweenEasing":0,"x":-81.13,"y":-26.78},{"tweenEasing":0,"x":-61.99,"y":-28.21},{"duration":6,"tweenEasing":0,"x":-53.58,"y":-26.86},{"tweenEasing":0,"x":-7.4,"y":-8.56},{"duration":0,"x":-5.03,"y":2.01}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":1},{"tweenEasing":0,"rotate":8.01},{"duration":2,"tweenEasing":0,"rotate":14.02},{"duration":2,"tweenEasing":0,"rotate":28.31},{"tweenEasing":0,"rotate":37.85},{"duration":2,"tweenEasing":0,"rotate":38.35},{"tweenEasing":0,"rotate":26.05},{"duration":6,"tweenEasing":0,"rotate":18.28},{"tweenEasing":0,"rotate":-15.77},{"duration":0}]},{"name":"thigh_l","translateFrame":[{"duration":2,"tweenEasing":0,"x":0.52,"y":-15.26},{"duration":2,"tweenEasing":0,"x":-0.7,"y":-8.14},{"duration":3,"tweenEasing":0,"x":-2.15,"y":-12.68},{"duration":4,"tweenEasing":0,"x":-4.7,"y":-21.25},{"duration":3,"tweenEasing":0,"x":-8.82,"y":-26.75},{"tweenEasing":0,"x":-8.97,"y":-18.39},{"duration":2,"tweenEasing":0,"x":-8.62,"y":-14.5},{"duration":2,"tweenEasing":0,"x":-8.2,"y":-4.3},{"tweenEasing":0,"x":-7.86,"y":-5.06},{"duration":2,"tweenEasing":0,"x":-7.38,"y":-6.46},{"tweenEasing":0,"x":-5.93,"y":-11.18},{"duration":6,"tweenEasing":0,"x":-5.02,"y":-14.09},{"tweenEasing":0,"x":-0.18,"y":-19.15},{"duration":0,"x":0.52,"y":-15.26}]},{"name":"chest","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.66,"y":-0.35},{"duration":3,"tweenEasing":0,"x":-2.17,"y":0.49},{"duration":8,"tweenEasing":0,"x":-3.74,"y":0.85},{"duration":4,"tweenEasing":0,"x":-7.45,"y":1.32},{"duration":3,"tweenEasing":0,"x":0.13,"y":-0.25},{"duration":8,"tweenEasing":0,"x":-0.21,"y":-0.55},{"duration":0,"x":-0.66,"y":-0.35}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-6.01},{"duration":3,"tweenEasing":0,"rotate":-5.5},{"duration":8,"tweenEasing":0,"rotate":-5.75},{"duration":4,"tweenEasing":0,"rotate":-6.26},{"duration":3,"tweenEasing":0,"rotate":-6.75},{"duration":8,"tweenEasing":0,"rotate":-7.26},{"duration":0,"rotate":-6.01}]},{"name":"foot_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":-2.93,"y":-2.42},{"duration":2,"tweenEasing":0,"x":-7.51,"y":-17.16},{"tweenEasing":0,"x":11.82,"y":-23.09},{"duration":2,"tweenEasing":0,"x":23.5,"y":-24.83},{"tweenEasing":0,"x":47.01,"y":-28.87},{"duration":5,"tweenEasing":0,"x":57.31,"y":-28.64},{"tweenEasing":0,"x":96.32,"y":-7.55},{"tweenEasing":0,"x":97.66,"y":4.68},{"tweenEasing":0,"x":98.13,"y":5.73},{"duration":3,"tweenEasing":0,"x":95.51,"y":4.46},{"duration":3,"tweenEasing":0,"x":75.8,"y":3.74},{"duration":5,"tweenEasing":0,"x":54.39,"y":3.05},{"duration":3,"tweenEasing":0,"x":18.17,"y":1.23},{"duration":0,"x":-2.93,"y":-2.42}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":7.01},{"duration":2,"tweenEasing":0,"rotate":28.56},{"tweenEasing":0,"rotate":21.54},{"duration":2,"tweenEasing":0,"rotate":16.52},{"tweenEasing":0,"rotate":11.26},{"duration":5,"tweenEasing":0,"rotate":8.26},{"tweenEasing":0,"rotate":-15.01},{"tweenEasing":0,"rotate":-1.25},{"tweenEasing":0,"rotate":0.25},{"duration":6,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":0.75},{"duration":0,"rotate":7.01}]},{"name":"thigh_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":-9.94,"y":-16.03},{"duration":2,"tweenEasing":0,"x":-7.44,"y":-7.36},{"tweenEasing":0,"x":-5.03,"y":-10.64},{"duration":2,"tweenEasing":0,"x":-3.76,"y":-13.16},{"tweenEasing":0,"x":-1.58,"y":-18.98},{"duration":5,"tweenEasing":0,"x":-0.76,"y":-21.74},{"tweenEasing":0,"x":0.96,"y":-24.36},{"tweenEasing":0,"x":0.25,"y":-20.65},{"tweenEasing":0,"x":-0.6,"y":-16.89},{"duration":3,"tweenEasing":0,"x":-1.43,"y":-11.23},{"duration":3,"tweenEasing":0,"x":-4.57,"y":-10.4},{"duration":5,"tweenEasing":0,"x":-6.71,"y":-17.67},{"duration":3,"tweenEasing":0,"x":-9.45,"y":-25.39},{"duration":0,"x":-9.94,"y":-16.03}]},{"name":"weapon_1","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.19,"y":-0.49},{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.45},{"duration":8,"tweenEasing":0,"x":0.02,"y":-0.47},{"duration":4,"tweenEasing":0,"x":0.3,"y":-0.55},{"duration":2,"tweenEasing":0,"x":0.17,"y":-0.7},{"tweenEasing":0,"x":0.12,"y":-0.73},{"duration":8,"tweenEasing":0,"x":0.09,"y":-0.73},{"duration":0,"x":0.18,"y":-0.85}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":0.15},{"duration":3,"tweenEasing":0,"rotate":0.05},{"duration":8,"tweenEasing":0,"rotate":-0.01},{"duration":4,"tweenEasing":0,"rotate":0.12},{"duration":2,"tweenEasing":0,"rotate":0.23},{"tweenEasing":0,"rotate":0.25},{"duration":8,"tweenEasing":0,"rotate":0.26},{"duration":0,"rotate":0.17}]},{"name":"weapon","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.54,"y":-0.15},{"duration":3,"tweenEasing":0,"x":0.32,"y":0.06},{"duration":8,"tweenEasing":0,"x":0.23,"y":0.22},{"duration":4,"tweenEasing":0,"x":0.61,"y":-0.02},{"duration":2,"tweenEasing":0,"x":0.78,"y":-0.5},{"tweenEasing":0,"x":0.66,"y":-0.85},{"duration":8,"tweenEasing":0,"x":0.82,"y":-0.58},{"duration":0,"x":0.54,"y":-0.15}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-2.66},{"duration":3,"tweenEasing":0,"rotate":-3.41},{"duration":8,"tweenEasing":0,"rotate":-3.75},{"duration":4,"tweenEasing":0,"rotate":-5.48},{"duration":2,"tweenEasing":0,"rotate":-2},{"tweenEasing":0,"rotate":-0.72},{"duration":8,"tweenEasing":0,"rotate":-0.58},{"duration":0,"rotate":-2.66}]},{"name":"shouder_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":2.77,"y":-2.12},{"duration":3,"tweenEasing":0,"x":2.16,"y":0.71},{"duration":8,"tweenEasing":0,"x":2.19,"y":2.6},{"duration":4,"tweenEasing":0,"x":3.83,"y":0.06},{"duration":2,"tweenEasing":0,"x":3.76,"y":-4.18},{"tweenEasing":0,"x":3.2,"y":-5.61},{"duration":8,"tweenEasing":0,"x":3.11,"y":-5.72},{"duration":0,"x":2.77,"y":-2.12}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-4.28},{"duration":3,"tweenEasing":0,"rotate":-1.66},{"duration":8,"tweenEasing":0,"rotate":-1.25},{"duration":4,"tweenEasing":0,"rotate":-7.48},{"duration":2,"tweenEasing":0,"rotate":-0.5},{"tweenEasing":0,"rotate":1.79},{"duration":8,"tweenEasing":0,"rotate":1.93},{"duration":0,"rotate":-4.28}]}]},{"duration":30,"name":"attack_01","bone":[{"name":"pelvis","translateFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":-6.53,"y":-6.87},{"duration":2,"tweenEasing":0,"x":6.85,"y":-0.28},{"duration":2,"tweenEasing":0,"x":11.62,"y":14.51},{"duration":5,"tweenEasing":0,"x":8.67,"y":10.2},{"tweenEasing":0,"x":8.67,"y":10.2},{"tweenEasing":0,"x":16.03,"y":10.41},{"duration":4,"tweenEasing":0,"x":-18.95,"y":8.13},{"duration":9,"tweenEasing":0,"x":-19.1,"y":17.08},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":-2.75},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-1.75},{"duration":20}]},{"name":"shouder_l","translateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":2.03,"y":-0.37},{"duration":3,"tweenEasing":0,"x":2.25,"y":-0.52},{"duration":2,"tweenEasing":0,"x":-1.05,"y":0.07},{"duration":2,"tweenEasing":0,"x":-0.45,"y":0.18},{"duration":5,"tweenEasing":0,"x":2.05,"y":-0.4},{"tweenEasing":0,"x":2.05,"y":-0.4},{"tweenEasing":0,"x":-3.25,"y":0.25},{"duration":4,"tweenEasing":0,"x":-5.25,"y":0.68},{"tweenEasing":0,"x":1.4,"y":0.22},{"duration":8,"tweenEasing":0,"x":2.07,"y":0.12},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"rotate":-0.09},{"duration":3,"tweenEasing":0,"rotate":-0.08},{"duration":2,"tweenEasing":0,"rotate":-0.09},{"duration":2,"tweenEasing":0,"rotate":-0.07},{"duration":5,"tweenEasing":0,"rotate":-0.12},{"tweenEasing":0,"rotate":-0.12},{"tweenEasing":0,"rotate":-0.27},{"duration":4,"tweenEasing":0,"rotate":-0.36},{"tweenEasing":0,"rotate":-0.4},{"duration":8,"tweenEasing":0,"rotate":-0.1},{"duration":0}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":9}]},{"name":"thigh_l","translateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":-6.43,"y":-6.77},{"duration":3,"tweenEasing":0,"x":-4.31,"y":-9.55},{"duration":2,"tweenEasing":0,"x":6.85,"y":-0.33},{"duration":2,"tweenEasing":0,"x":11.57,"y":14.36},{"duration":5,"tweenEasing":0,"x":8.62,"y":10.05},{"tweenEasing":0,"x":8.62,"y":10.05},{"tweenEasing":0,"x":15.87,"y":10.26},{"duration":4,"tweenEasing":0,"x":-18.66,"y":8.02},{"tweenEasing":0,"x":-18.85,"y":16.93},{"duration":8,"tweenEasing":0,"x":-17.26,"y":16.01},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":0.07,"y":-0.06},{"duration":3,"tweenEasing":0,"x":4.62,"y":-2.14},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-0.09,"y":-0.07},{"duration":6,"tweenEasing":0,"x":-0.05},{"tweenEasing":0,"x":-0.05},{"duration":4,"tweenEasing":0,"x":-0.1,"y":-0.1},{"tweenEasing":0,"x":-0.2,"y":-0.1},{"duration":8,"tweenEasing":0,"x":-1.15,"y":-0.65},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"rotate":9.26},{"duration":3,"tweenEasing":0,"rotate":9.32},{"duration":2,"tweenEasing":0,"rotate":-3.25},{"duration":2,"tweenEasing":0,"rotate":-0.5},{"duration":5,"tweenEasing":0,"rotate":5},{"tweenEasing":0,"rotate":5},{"tweenEasing":0,"rotate":-10.26},{"duration":4,"tweenEasing":0,"rotate":-13.77},{"tweenEasing":0,"rotate":4.01},{"duration":8,"tweenEasing":0,"rotate":6},{"duration":0}],"scaleFrame":[{"duration":16,"tweenEasing":0},{"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":9}]},{"name":"thigh_r","translateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":-6.58,"y":-6.97},{"duration":3,"tweenEasing":0,"x":-4.42,"y":-9.8},{"duration":2,"tweenEasing":0,"x":7,"y":-0.33},{"duration":2,"tweenEasing":0,"x":11.88,"y":14.71},{"duration":5,"tweenEasing":0,"x":8.87,"y":10.29},{"tweenEasing":0,"x":8.87,"y":10.29},{"tweenEasing":0,"x":16.28,"y":10.51},{"duration":4,"tweenEasing":0,"x":-19.15,"y":8.18},{"tweenEasing":0,"x":-19.29,"y":17.28},{"duration":8,"tweenEasing":0,"x":-17.71,"y":16.36},{"duration":0}]},{"name":"weapon_1","translateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":-0.08,"y":0.22},{"duration":3,"tweenEasing":0,"x":-0.04,"y":0.13},{"duration":2,"tweenEasing":0,"x":0.09,"y":-0.19},{"duration":2,"tweenEasing":0,"x":-0.02,"y":-0.11},{"duration":5,"tweenEasing":0,"x":-0.08,"y":0.38},{"tweenEasing":0,"x":-0.08,"y":0.38},{"tweenEasing":0,"x":-0.13,"y":0.48},{"duration":2,"tweenEasing":0,"x":-80,"y":-16.13},{"duration":2,"tweenEasing":0,"x":-87.02,"y":-17.56},{"tweenEasing":0,"x":-89.63,"y":-17.98},{"tweenEasing":0,"x":-89.86,"y":-18.13},{"duration":3,"tweenEasing":0,"x":-89.3,"y":-17.7},{"duration":4,"tweenEasing":0,"x":-54.76,"y":-10.76},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"rotate":-0.05},{"duration":3,"tweenEasing":0,"rotate":-0.04},{"duration":2,"tweenEasing":0,"rotate":0.02},{"duration":2,"tweenEasing":0,"rotate":0.01},{"duration":5,"tweenEasing":0,"rotate":-0.05},{"tweenEasing":0,"rotate":-0.05},{"tweenEasing":0,"rotate":-0.04},{"duration":2,"tweenEasing":0,"rotate":0.12},{"duration":2,"tweenEasing":0,"rotate":0.08},{"tweenEasing":0,"rotate":-0.01},{"tweenEasing":0,"rotate":-0.05},{"duration":3,"tweenEasing":0,"rotate":1.2},{"duration":4,"tweenEasing":0,"rotate":-0.08},{"duration":0}],"scaleFrame":[{"duration":16,"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"weapon","translateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":-0.27,"y":0.14},{"duration":3,"tweenEasing":0,"x":-0.33,"y":0.1},{"duration":2,"tweenEasing":0,"x":0.15,"y":0.02},{"duration":2,"tweenEasing":0,"x":-0.05,"y":-0.01},{"duration":5,"tweenEasing":0,"x":-0.34,"y":0.07},{"tweenEasing":0,"x":-0.34,"y":0.07},{"tweenEasing":0,"x":0.38,"y":0.02},{"duration":2,"tweenEasing":0,"x":0.63,"y":-0.02},{"duration":2,"tweenEasing":0,"x":2.7,"y":-4.06},{"tweenEasing":0,"x":-0.2,"y":-0.21},{"duration":4,"tweenEasing":0,"x":-0.45,"y":-0.01},{"duration":4,"tweenEasing":0,"x":-0.72,"y":0.12},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"rotate":-1.84},{"duration":3,"tweenEasing":0,"rotate":-2.58},{"duration":2,"tweenEasing":0,"rotate":1.41},{"duration":2,"tweenEasing":0,"rotate":0.68},{"duration":5,"tweenEasing":0,"rotate":-0.12},{"tweenEasing":0,"rotate":-4.66},{"tweenEasing":0,"rotate":10.44},{"duration":2,"tweenEasing":0,"rotate":0.39},{"duration":2,"tweenEasing":0,"rotate":-4.51},{"tweenEasing":0,"rotate":-2.66},{"duration":4,"tweenEasing":0,"rotate":-1.35},{"duration":4,"tweenEasing":0,"rotate":4.57},{"duration":0}],"scaleFrame":[{"duration":16,"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"shouder_r","translateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":-2.02,"y":0.46},{"duration":3,"tweenEasing":0,"x":-2.27,"y":0.52},{"duration":2,"tweenEasing":0,"x":1.03,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.3,"y":-0.12},{"duration":5,"tweenEasing":0,"x":-2.14,"y":0.4},{"tweenEasing":0,"x":-2.14,"y":0.4},{"tweenEasing":0,"x":3.2,"y":-0.16},{"duration":4,"tweenEasing":0,"x":5.13,"y":-0.56},{"tweenEasing":0,"x":-1.48,"y":-0.38},{"duration":8,"tweenEasing":0,"x":-2.26,"y":-0.06},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"rotate":-0.09},{"duration":3,"tweenEasing":0,"rotate":-0.08},{"duration":2,"tweenEasing":0,"rotate":-0.09},{"duration":2,"tweenEasing":0,"rotate":-0.07},{"duration":5,"tweenEasing":0,"rotate":-0.12},{"tweenEasing":0,"rotate":-0.12},{"tweenEasing":0,"rotate":-0.27},{"duration":4,"tweenEasing":0,"rotate":-0.36},{"tweenEasing":0,"rotate":-0.4},{"duration":8,"tweenEasing":0,"rotate":-0.1},{"duration":0}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":9}]}]},{"duration":22,"fadeInTime":0.1,"name":"death","bone":[{"name":"pelvis","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":28.13,"y":-18.44},{"duration":4,"tweenEasing":0,"x":-7.8,"y":16.64},{"duration":6,"tweenEasing":0,"x":-31.95,"y":8.13},{"duration":2,"tweenEasing":0,"x":-13.04,"y":-11.59},{"duration":3,"tweenEasing":0,"x":-12.42,"y":36.1},{"duration":4,"tweenEasing":0,"x":-12.54,"y":26.15},{"x":-12.41,"y":36.95}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-9.76},{"duration":4,"tweenEasing":0,"rotate":-9.76},{"duration":6,"tweenEasing":0,"rotate":11.51},{"duration":2,"tweenEasing":0,"rotate":4.75},{"duration":8,"rotate":12.76}]},{"name":"shouder_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-5.29,"y":-0.25},{"tweenEasing":0,"x":0.16,"y":0.89},{"duration":3,"tweenEasing":0,"x":3.2,"y":0.93},{"tweenEasing":0,"x":5.14,"y":2.89},{"duration":5,"tweenEasing":0,"x":4.91,"y":3.78},{"duration":2,"tweenEasing":0,"x":6.58,"y":6.94},{"duration":2,"tweenEasing":0,"x":9.28,"y":7.89},{"tweenEasing":0,"x":-9.57,"y":-7.37},{"tweenEasing":0,"x":-10.39,"y":-7.09},{"tweenEasing":0,"x":-10.77,"y":-6.24},{"duration":2,"tweenEasing":0,"x":-13.8,"y":-5.58},{"tweenEasing":0,"x":-16.01,"y":-3.97},{"duration":0,"x":-14.82,"y":-4.44}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-3.67},{"tweenEasing":0,"rotate":-8.79},{"duration":3,"tweenEasing":0,"rotate":-11.36},{"tweenEasing":0,"rotate":23.68},{"duration":5,"tweenEasing":0,"rotate":30.36},{"duration":2,"tweenEasing":0,"rotate":-12.38},{"duration":2,"tweenEasing":0,"rotate":-3.74},{"tweenEasing":0,"rotate":23.84},{"tweenEasing":0,"rotate":19.54},{"tweenEasing":0,"rotate":14.58},{"duration":2,"tweenEasing":0,"rotate":17.9},{"tweenEasing":0,"rotate":24.02},{"duration":0,"rotate":23.59}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.01},{"x":1.02}]},{"name":"thigh_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":27.83,"y":-18.23},{"tweenEasing":0,"x":-7.65,"y":16.44},{"duration":3,"tweenEasing":0,"x":-17.93,"y":18.57},{"tweenEasing":0,"x":-31.51,"y":8.08},{"duration":5,"tweenEasing":0,"x":-30.8,"y":4.22},{"duration":2,"tweenEasing":0,"x":-12.79,"y":-11.45},{"tweenEasing":0,"x":-12.22,"y":35.7},{"tweenEasing":0,"x":-12.21,"y":36.4},{"tweenEasing":0,"x":-12.29,"y":30},{"tweenEasing":0,"x":-12.34,"y":25.85},{"tweenEasing":0,"x":-12.33,"y":27.2},{"duration":2,"tweenEasing":0,"x":-12.29,"y":30.2},{"x":-12.21,"y":36.55}]},{"name":"chest","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.38,"y":-0.03},{"tweenEasing":0,"x":0.16,"y":-0.04},{"duration":3,"tweenEasing":0,"x":-3.93,"y":-4.77},{"tweenEasing":0,"x":-0.38,"y":-0.12},{"duration":5,"tweenEasing":0,"x":-0.17,"y":-1.68},{"duration":2,"tweenEasing":0,"x":-0.08,"y":-0.04},{"duration":2,"tweenEasing":0,"x":-0.47,"y":0.01},{"tweenEasing":0,"x":-1.26,"y":0.38},{"duration":2,"tweenEasing":0,"x":-0.35,"y":-0.02},{"duration":2,"tweenEasing":0,"x":0.55,"y":-0.23},{"x":-0.5,"y":-0.01}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-6.27},{"tweenEasing":0,"rotate":8.76},{"duration":3,"tweenEasing":0,"rotate":10.7},{"tweenEasing":0,"rotate":-6.26},{"duration":5,"tweenEasing":0,"rotate":-8.38},{"duration":2,"tweenEasing":0,"rotate":-8.76},{"duration":2,"tweenEasing":0,"rotate":-12.26},{"tweenEasing":0,"rotate":0.24},{"duration":2,"tweenEasing":0,"rotate":-1.76},{"duration":2,"tweenEasing":0,"rotate":-8.01},{"tweenEasing":0,"rotate":-3.26},{"duration":0,"rotate":0.24}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":12,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"x":0.99}]},{"name":"foot_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"x":-25.51,"y":-0.84},{"duration":2,"tweenEasing":0,"x":-32.86,"y":-1.06},{"tweenEasing":0,"x":-38.57,"y":-1.29},{"tweenEasing":0,"x":-39.57,"y":-1.28},{"duration":5,"tweenEasing":0,"x":-39.92,"y":-1.32},{"duration":10,"x":-38.57,"y":-1.29}]},{"name":"thigh_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":28.48,"y":-18.69},{"tweenEasing":0,"x":-7.85,"y":16.8},{"duration":2,"tweenEasing":0,"x":-18.37,"y":18.97},{"tweenEasing":0,"x":-30.46,"y":12.17},{"tweenEasing":0,"x":-32.3,"y":8.19},{"duration":5,"tweenEasing":0,"x":-31.6,"y":4.28},{"duration":2,"tweenEasing":0,"x":-13.19,"y":-11.74},{"duration":2,"tweenEasing":0,"x":-12.51,"y":36.5},{"tweenEasing":0,"x":-12.63,"y":30.7},{"duration":2,"tweenEasing":0,"x":-12.68,"y":26.45},{"duration":2,"tweenEasing":0,"x":-12.63,"y":30.9},{"x":-12.5,"y":37.4}]},{"name":"weapon_1","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.62,"y":-0.3},{"tweenEasing":0,"x":-8.41,"y":-2.05},{"duration":3,"tweenEasing":0,"x":-18.35,"y":-3.11},{"tweenEasing":0,"x":-22.05,"y":-4.03},{"duration":5,"tweenEasing":0,"x":-22.09,"y":-4.07},{"duration":2,"tweenEasing":0,"x":-21.74,"y":-4.63},{"duration":2,"tweenEasing":0,"x":-22.23,"y":-3.66},{"tweenEasing":0,"x":-22.07,"y":-3.79},{"duration":2,"tweenEasing":0,"x":-22.04,"y":-3.74},{"duration":2,"tweenEasing":0,"x":-22.08,"y":-3.69},{"tweenEasing":0,"x":-22.08,"y":-3.49},{"duration":0,"x":-21.96,"y":-3.65}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":0.06},{"tweenEasing":0,"rotate":0.05},{"duration":3,"tweenEasing":0,"rotate":-0.07},{"tweenEasing":0,"rotate":-0.09},{"duration":5,"tweenEasing":0,"rotate":-0.05},{"duration":2,"tweenEasing":0,"rotate":0.06},{"duration":2,"tweenEasing":0,"rotate":-0.04},{"tweenEasing":0,"rotate":-0.11},{"duration":2,"tweenEasing":0,"rotate":-0.08},{"duration":2,"tweenEasing":0,"rotate":-0.07},{"tweenEasing":0,"rotate":-0.11},{"duration":0,"rotate":-0.14}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":6,"x":1.01}]},{"name":"weapon","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.96,"y":0.05},{"tweenEasing":0,"x":0.48,"y":-0.7},{"duration":3,"tweenEasing":0,"x":0.6,"y":-1.24},{"tweenEasing":0,"x":3.13,"y":-3.91},{"duration":5,"tweenEasing":0,"x":4.23,"y":-4.98},{"duration":2,"tweenEasing":0,"x":11.36,"y":-12.5},{"duration":2,"tweenEasing":0,"x":12.06,"y":-14},{"tweenEasing":0,"x":9.82,"y":-12.17},{"duration":2,"tweenEasing":0,"x":8.26,"y":-10.26},{"duration":2,"tweenEasing":0,"x":4.7,"y":-5.97},{"tweenEasing":0,"x":1.46,"y":-2.71},{"duration":0,"x":0.87,"y":-2.25}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":9.35},{"tweenEasing":0,"rotate":-4.53},{"duration":3,"tweenEasing":0,"rotate":0.4},{"tweenEasing":0,"rotate":3.39},{"duration":5,"tweenEasing":0,"rotate":3.55},{"duration":2,"tweenEasing":0,"rotate":-2.36},{"duration":2,"tweenEasing":0,"rotate":3.26},{"tweenEasing":0,"rotate":-1.49},{"duration":2,"tweenEasing":0,"rotate":-3.27},{"duration":2,"tweenEasing":0,"rotate":1.87},{"tweenEasing":0,"rotate":1.46},{"duration":0,"rotate":1.27}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":6,"x":1.01}]},{"name":"shouder_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":5.69,"y":0.62},{"tweenEasing":0,"x":0.8,"y":-0.15},{"duration":3,"tweenEasing":0,"x":-1.22,"y":0.67},{"tweenEasing":0,"x":2.07,"y":2.61},{"duration":5,"tweenEasing":0,"x":4.33,"y":3.2},{"duration":2,"tweenEasing":0,"x":10.63,"y":6.9},{"duration":2,"tweenEasing":0,"x":8.26,"y":7.04},{"tweenEasing":0,"x":-20.39,"y":-6.04},{"tweenEasing":0,"x":-19.67,"y":-6.26},{"tweenEasing":0,"x":-17.93,"y":-6.17},{"duration":2,"tweenEasing":0,"x":-18.91,"y":-6.13},{"tweenEasing":0,"x":-24.88,"y":-3.59},{"duration":0,"x":-26.15,"y":-3.11}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-3.67},{"tweenEasing":0,"rotate":-8.79},{"duration":3,"tweenEasing":0,"rotate":-11.36},{"tweenEasing":0,"rotate":10.65},{"duration":5,"tweenEasing":0,"rotate":14.82},{"duration":2,"tweenEasing":0,"rotate":-12.38},{"duration":2,"tweenEasing":0,"rotate":-3.74},{"tweenEasing":0,"rotate":23.84},{"tweenEasing":0,"rotate":19.54},{"tweenEasing":0,"rotate":14.58},{"duration":2,"tweenEasing":0,"rotate":17.9},{"tweenEasing":0,"rotate":24.02},{"duration":0,"rotate":23.59}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.01},{"x":1.02}]}]},{"duration":16,"fadeInTime":0.1,"name":"hit","bone":[{"name":"pelvis","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":28.13,"y":-18.44},{"duration":4,"tweenEasing":0,"x":-7.8,"y":16.64},{"duration":9,"tweenEasing":0,"x":-19.55,"y":8.48},{}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-9.76},{"duration":4,"tweenEasing":0,"rotate":-9.76},{"duration":9,"tweenEasing":0,"rotate":11.51},{}]},{"name":"shouder_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-5.41,"y":-0.34},{"tweenEasing":0,"x":-0.35,"y":0.5},{"duration":3,"tweenEasing":0,"x":2.25,"y":0.13},{"tweenEasing":0,"x":3.17,"y":-0.45},{"duration":8,"tweenEasing":0,"x":2.42,"y":-0.23},{}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-3.67},{"tweenEasing":0,"rotate":-8.79},{"duration":3,"tweenEasing":0,"rotate":-11.35},{"tweenEasing":0,"rotate":7.22},{"duration":8,"tweenEasing":0,"rotate":7.18},{"tweenEasing":0,"rotate":0.25},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":8,"tweenEasing":0,"x":1.01},{}]},{"name":"thigh_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":27.83,"y":-18.23},{"tweenEasing":0,"x":-7.65,"y":16.44},{"duration":3,"tweenEasing":0,"x":-14.83,"y":18.38},{"tweenEasing":0,"x":-19.25,"y":8.38},{"duration":8,"tweenEasing":0,"x":-18.36,"y":7.22},{}]},{"name":"chest","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.38,"y":-0.03},{"tweenEasing":0,"x":0.16,"y":-0.04},{"duration":3,"tweenEasing":0,"x":-3.63,"y":-4.66},{"tweenEasing":0,"x":-0.29,"y":-0.07},{"duration":8,"tweenEasing":0,"x":-0.26,"y":-0.41},{}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-6.27},{"tweenEasing":0,"rotate":8.76},{"duration":3,"tweenEasing":0,"rotate":10.7},{"tweenEasing":0,"rotate":-2.26},{"duration":8,"tweenEasing":0,"rotate":-2.98},{}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":14}]},{"name":"thigh_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":28.48,"y":-18.69},{"tweenEasing":0,"x":-7.85,"y":16.8},{"duration":3,"tweenEasing":0,"x":-15.23,"y":18.78},{"tweenEasing":0,"x":-19.8,"y":8.59},{"duration":8,"tweenEasing":0,"x":-18.86,"y":7.33},{}]},{"name":"weapon_1","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.58,"y":-0.32},{"tweenEasing":0,"x":-8.45,"y":-2.05},{"duration":3,"tweenEasing":0,"x":-18.26,"y":-2.95},{"tweenEasing":0,"x":-21.83,"y":-3.73},{"duration":8,"tweenEasing":0,"x":-21.88,"y":-3.85},{"tweenEasing":0,"x":-0.77,"y":-0.4},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":0.06},{"tweenEasing":0,"rotate":0.05},{"duration":3,"tweenEasing":0,"rotate":-0.07},{"tweenEasing":0,"rotate":-0.12},{"duration":8,"tweenEasing":0,"rotate":-0.11},{}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":8,"tweenEasing":0,"x":1.01},{}]},{"name":"weapon","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.82,"y":0.2},{"tweenEasing":0,"x":-0.02,"y":-0.14},{"duration":3,"tweenEasing":0,"x":-0.4,"y":0.06},{"tweenEasing":0,"x":-0.53,"y":-0.01},{"duration":8,"tweenEasing":0,"x":-0.45,"y":0.01},{}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":9.35},{"tweenEasing":0,"rotate":-4.53},{"duration":3,"tweenEasing":0,"rotate":0.4},{"tweenEasing":0,"rotate":3.21},{"duration":8,"tweenEasing":0,"rotate":3.42},{"tweenEasing":0,"rotate":0.25},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":8,"tweenEasing":0,"x":1.01},{}]},{"name":"shouder_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":5.56,"y":0.52},{"tweenEasing":0,"x":0.28,"y":-0.55},{"duration":3,"tweenEasing":0,"x":-2.3,"y":-0.04},{"tweenEasing":0,"x":-3.3,"y":0.35},{"tweenEasing":0,"x":-2.61,"y":0.23},{"duration":7,"tweenEasing":0,"x":-1.99,"y":-0.04},{}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-3.67},{"tweenEasing":0,"rotate":-8.79},{"duration":3,"tweenEasing":0,"rotate":-11.35},{"tweenEasing":0,"rotate":0.71},{"tweenEasing":0,"rotate":5.43},{"duration":7,"tweenEasing":0,"rotate":7.31},{"tweenEasing":0,"rotate":0.5},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":7,"tweenEasing":0,"x":1.01},{}]}]},{"duration":10,"fadeInTime":0.1,"name":"jump","bone":[{"name":"pelvis","translateFrame":[{"duration":8,"tweenEasing":0,"x":0.43,"y":40.35},{"tweenEasing":0,"x":-0.1,"y":-8.45},{"x":0.2,"y":16.75}],"rotateFrame":[{"duration":8,"tweenEasing":0,"rotate":4},{"duration":2}]},{"name":"shouder_l","translateFrame":[{"duration":2,"tweenEasing":0,"x":5.06,"y":-0.86},{"duration":4,"tweenEasing":0,"x":2.37,"y":0.67},{"duration":2,"tweenEasing":0,"x":0.06,"y":6},{"tweenEasing":0,"x":1.3,"y":7.28},{"tweenEasing":0,"x":-3.07,"y":2.17},{"duration":0,"x":-4.22,"y":-4.12}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-0.24},{"duration":4,"tweenEasing":0,"rotate":4.38},{"duration":2,"tweenEasing":0,"rotate":-0.56},{"tweenEasing":0,"rotate":-2.3},{"tweenEasing":0,"rotate":-1.2},{"duration":0,"rotate":-0.11}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"foot_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-29.46,"y":-0.95},{"tweenEasing":0,"x":-70.59,"y":5.3},{"duration":3,"tweenEasing":0,"x":-93.04,"y":-2.94},{"duration":2,"tweenEasing":0,"x":-44.16,"y":11.78},{"duration":2}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"rotate":8.51},{"duration":3,"tweenEasing":0,"rotate":15.27},{"duration":2,"tweenEasing":0,"rotate":7.26},{"duration":2}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":2}]},{"name":"thigh_l","translateFrame":[{"tweenEasing":0,"x":0.43,"y":39.85},{"tweenEasing":0,"x":0.1,"y":8.4},{"tweenEasing":0,"x":-0.17,"y":-14.45},{"duration":3,"tweenEasing":0,"x":-0.25,"y":-20.5},{"duration":2,"tweenEasing":0,"x":-0.21,"y":-17.35},{"tweenEasing":0,"x":-0.1,"y":-8.35},{"x":0.15,"y":16.55}]},{"name":"chest","translateFrame":[{"duration":2,"tweenEasing":0,"x":-0.32,"y":0.03},{"duration":4,"tweenEasing":0,"x":42.74,"y":-2.27},{"duration":2,"tweenEasing":0,"x":21.41,"y":-0.38},{"tweenEasing":0},{"x":-0.1,"y":-0.05}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":8.51},{"duration":4,"tweenEasing":0,"rotate":2.01},{"duration":2,"tweenEasing":0,"rotate":-13.02},{"tweenEasing":0,"rotate":-11.27},{"tweenEasing":0,"rotate":-7.51},{"duration":0,"rotate":5.75}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{}]},{"name":"foot_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"x":-16.41,"y":3.15},{"duration":3,"tweenEasing":0,"x":-35.16,"y":-9.23},{"duration":2,"tweenEasing":0,"x":8.94,"y":11.69},{"duration":2}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"rotate":11.01},{"duration":3,"tweenEasing":0,"rotate":20.53},{"duration":2,"tweenEasing":0,"rotate":15.77},{"duration":2}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":2}]},{"name":"thigh_r","translateFrame":[{"tweenEasing":0,"x":0.49,"y":40.8},{"tweenEasing":0,"x":0.1,"y":8.55},{"tweenEasing":0,"x":-0.18,"y":-14.8},{"duration":3,"tweenEasing":0,"x":-0.25,"y":-21},{"duration":2,"tweenEasing":0,"x":-0.21,"y":-17.8},{"tweenEasing":0,"x":-0.1,"y":-8.55},{"x":0.2,"y":16.9}]},{"name":"weapon_1","translateFrame":[{"duration":2,"tweenEasing":0,"x":-0.46,"y":0.94},{"duration":4,"tweenEasing":0,"x":-0.03,"y":0.51},{"duration":2,"tweenEasing":0,"x":0.62,"y":-0.51},{"tweenEasing":0,"x":0.49,"y":-0.5},{"tweenEasing":0,"x":-0.02,"y":-0.21},{"duration":0,"x":-0.26,"y":0.47}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-0.12},{"duration":4,"tweenEasing":0,"rotate":-0.09},{"duration":2,"tweenEasing":0,"rotate":0.11},{"tweenEasing":0,"rotate":0.12},{"tweenEasing":0,"rotate":0.07},{"duration":0,"rotate":-0.05}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"weapon","translateFrame":[{"duration":2,"tweenEasing":0,"x":-0.97,"y":0.08},{"duration":4,"tweenEasing":0,"x":-0.17,"y":0.23},{"duration":2,"tweenEasing":0,"x":0.74,"y":0.01},{"tweenEasing":0,"x":0.67,"y":0.02},{"tweenEasing":0,"x":0.23,"y":-0.12},{"duration":0,"x":-0.4}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-0.24},{"duration":4,"tweenEasing":0,"rotate":4.38},{"duration":2,"tweenEasing":0,"rotate":-0.57},{"tweenEasing":0,"rotate":-2.3},{"tweenEasing":0,"rotate":-0.2},{"duration":0,"rotate":-0.11}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"shouder_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":-5.29,"y":0.74},{"duration":4,"tweenEasing":0,"x":-0.59,"y":1.8},{"duration":2,"tweenEasing":0,"x":9.41,"y":6.33},{"tweenEasing":0,"x":9.89,"y":7.33},{"tweenEasing":0,"x":1.77,"y":1.14},{"duration":0,"x":-9.15,"y":-3.85}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-0.24},{"duration":4,"tweenEasing":0,"rotate":4.38},{"duration":2,"tweenEasing":0,"rotate":-0.56},{"tweenEasing":0,"rotate":-2.3},{"tweenEasing":0,"rotate":-1.2},{"duration":0,"rotate":-0.11}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":0}]}]},{"duration":40,"fadeInTime":0.1,"name":"skill_01","bone":[{"name":"pelvis","translateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-11.87,"y":-9.86},{"tweenEasing":0,"x":-21.62,"y":18.91},{"duration":3,"tweenEasing":0,"x":-22.86,"y":28.23},{"duration":4,"tweenEasing":0,"x":-21.62,"y":18.91},{"duration":17,"tweenEasing":0,"x":-22.35,"y":20.62},{"duration":3,"tweenEasing":0,"x":-22.35,"y":20.62},{"duration":4,"tweenEasing":0,"x":-13.96,"y":-4.73},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.46,"y":4.78},{"duration":0}]},{"name":"shouder_l","translateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":2.95,"y":11.21},{"tweenEasing":0,"x":4.11,"y":23.17},{"duration":2,"tweenEasing":0,"x":5.36,"y":21.4},{"tweenEasing":0,"x":1.59,"y":17.67},{"tweenEasing":0,"x":1.66,"y":17.62},{"duration":3,"tweenEasing":0,"x":2.45,"y":18.17},{"duration":17,"tweenEasing":0,"x":5.18,"y":19.85},{"duration":3,"tweenEasing":0,"x":5.18,"y":19.85},{"duration":4,"tweenEasing":0,"x":2.86,"y":11.94},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.1,"y":0.09},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-2.44},{"tweenEasing":0,"rotate":-8.8},{"duration":2,"tweenEasing":0,"rotate":-15.4},{"tweenEasing":0,"rotate":-26.79},{"tweenEasing":0,"rotate":-26.98},{"duration":3,"tweenEasing":0,"rotate":-26.49},{"duration":17,"tweenEasing":0,"rotate":-24.7},{"duration":3,"tweenEasing":0,"rotate":-24.7},{"duration":4,"tweenEasing":0,"rotate":-14.96},{"duration":4}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":22,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":4}]},{"name":"thigh_l","translateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-11.67,"y":-9.76},{"tweenEasing":0,"x":-21.33,"y":18.66},{"duration":2,"tweenEasing":0,"x":-22.57,"y":27.87},{"tweenEasing":0,"x":-21.69,"y":21.56},{"tweenEasing":0,"x":-21.33,"y":18.66},{"duration":3,"tweenEasing":0,"x":-21.38,"y":18.26},{"duration":17,"tweenEasing":0,"x":-22.06,"y":20.37},{"duration":3,"tweenEasing":0,"x":-22.06,"y":20.37},{"duration":4,"tweenEasing":0,"x":-13.71,"y":-4.69},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.46,"y":4.68},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.05,"y":-0.05},{"tweenEasing":0,"x":-0.15,"y":-0.1},{"duration":3,"tweenEasing":0,"x":-0.2,"y":-0.1},{"tweenEasing":0,"x":-0.15,"y":-0.1},{"duration":3,"tweenEasing":0,"x":0.7,"y":0.05},{"duration":17,"tweenEasing":0,"x":-0.2,"y":-0.05},{"duration":3,"tweenEasing":0,"x":-0.2,"y":-0.05},{"duration":4,"tweenEasing":0,"y":-0.05},{"duration":4}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":2.75},{"tweenEasing":0,"rotate":-1.25},{"duration":3,"tweenEasing":0,"rotate":4.75},{"tweenEasing":0,"rotate":3},{"duration":3,"tweenEasing":0,"rotate":2.5},{"duration":17,"tweenEasing":0,"rotate":3.75},{"duration":3,"tweenEasing":0,"rotate":3.75},{"duration":4,"tweenEasing":0,"rotate":2.25},{"duration":4}]},{"name":"foot_r","translateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":-23.31,"y":-9.02},{"tweenEasing":0,"x":-45.42,"y":-1.51},{"tweenEasing":0,"x":-45.77,"y":-1.2},{"duration":2,"tweenEasing":0,"x":-45.72,"y":-1.25},{"duration":25,"tweenEasing":0,"x":-45.42,"y":-1.51},{"duration":2,"tweenEasing":0,"x":-45.42,"y":-1.51},{"duration":2,"tweenEasing":0,"x":-25.68,"y":-6.14},{"duration":4}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"rotate":6.26},{"tweenEasing":0},{"tweenEasing":0,"rotate":-0.5},{"duration":2,"tweenEasing":0,"rotate":-0.5},{"duration":33}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":37}]},{"name":"thigh_r","translateFrame":[{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":-12.02,"y":-10.01},{"tweenEasing":0,"x":-17.37,"y":2.56},{"tweenEasing":0,"x":-21.87,"y":19.06},{"duration":2,"tweenEasing":0,"x":-23.11,"y":28.53},{"tweenEasing":0,"x":-22.24,"y":22.02},{"tweenEasing":0,"x":-21.87,"y":19.06},{"duration":3,"tweenEasing":0,"x":-21.93,"y":18.66},{"duration":17,"tweenEasing":0,"x":-22.6,"y":20.82},{"duration":3,"tweenEasing":0,"x":-22.6,"y":20.82},{"duration":2,"tweenEasing":0,"x":-14.11,"y":-4.83},{"duration":2,"tweenEasing":0,"x":-6.71,"y":-4.72},{"tweenEasing":0},{"tweenEasing":0,"x":1.43,"y":2.78},{"tweenEasing":0,"x":1.51,"y":4.78},{"tweenEasing":0,"x":0.94,"y":2.99},{"duration":0}]},{"name":"weapon_1","translateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-0.21,"y":0.1},{"tweenEasing":0,"x":-0.52,"y":-0.01},{"duration":3,"tweenEasing":0,"x":-0.65,"y":0.57},{"tweenEasing":0,"x":-0.57,"y":0.28},{"duration":3,"tweenEasing":0,"x":-0.57,"y":0.15},{"duration":17,"tweenEasing":0,"x":-0.63,"y":0.29},{"duration":3,"tweenEasing":0,"x":-0.63,"y":0.29},{"duration":4,"tweenEasing":0,"x":-0.22,"y":-0.26},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-0.08},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-0.02},{"tweenEasing":0,"rotate":0.01},{"duration":3,"tweenEasing":0,"rotate":-0.04},{"tweenEasing":0,"rotate":-0.02},{"duration":3,"tweenEasing":0,"rotate":-0.02},{"duration":17,"tweenEasing":0,"rotate":-0.03},{"duration":3,"tweenEasing":0,"rotate":-0.03},{"duration":4,"tweenEasing":0,"rotate":-0.02},{"duration":4}]},{"name":"weapon","translateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-0.07,"y":-0.03},{"tweenEasing":0,"x":-0.05,"y":-0.21},{"duration":3,"tweenEasing":0,"x":-0.41,"y":-0.26},{"tweenEasing":0,"x":-0.26,"y":-0.17},{"duration":3,"tweenEasing":0,"x":-0.17,"y":-0.3},{"duration":17,"tweenEasing":0,"x":-0.26,"y":-0.27},{"duration":3,"tweenEasing":0,"x":-0.26,"y":-0.27},{"duration":4,"tweenEasing":0,"x":-0.06,"y":-0.02},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-0.05,"y":0.03},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-0.19},{"tweenEasing":0,"rotate":-0.04},{"duration":3,"tweenEasing":0,"rotate":-0.39},{"tweenEasing":0,"rotate":-0.18},{"duration":3,"tweenEasing":0,"rotate":-0.19},{"duration":17,"tweenEasing":0,"rotate":-0.16},{"duration":3,"tweenEasing":0,"rotate":-0.16},{"duration":4,"tweenEasing":0,"rotate":0.05},{"duration":4}]},{"name":"shouder_r","translateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.86,"y":11.89},{"tweenEasing":0,"x":5.3,"y":22.72},{"duration":2,"tweenEasing":0,"x":1.78,"y":21.47},{"tweenEasing":0,"x":-1.06,"y":17.52},{"tweenEasing":0,"x":-0.41,"y":17.51},{"duration":3,"tweenEasing":0,"x":0.77,"y":18.03},{"duration":17,"tweenEasing":0,"x":2.65,"y":19.83},{"duration":3,"tweenEasing":0,"x":2.65,"y":19.83},{"duration":4,"tweenEasing":0,"x":2,"y":12.4},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-0.09},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-2.44},{"tweenEasing":0,"rotate":-8.8},{"duration":2,"tweenEasing":0,"rotate":-15.4},{"tweenEasing":0,"rotate":-26.79},{"tweenEasing":0,"rotate":-26.98},{"duration":3,"tweenEasing":0,"rotate":-26.49},{"duration":17,"tweenEasing":0,"rotate":-24.7},{"duration":3,"tweenEasing":0,"rotate":-24.7},{"duration":4,"tweenEasing":0,"rotate":-14.96},{"duration":4}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":22,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":4}]}]},{"duration":100,"fadeInTime":0.01,"name":"aim","bone":[{"name":"pelvis","rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":-30.59},{"duration":0,"rotate":30}]},{"name":"chest","rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":-29.22},{"duration":0,"rotate":40.09}]},{"name":"weapon","rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":-30.04},{"duration":0,"rotate":20.64}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.json.meta b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.json.meta new file mode 100644 index 00000000..b3fa0db3 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "7e95d5a1-d4f4-471f-8a16-88c12a15ab74", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.json b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.json new file mode 100644 index 00000000..d2d221d3 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.json @@ -0,0 +1 @@ +{"SubTexture":[{"width":85,"y":193,"height":59,"name":"mecha_1406_folder/shouder_l","x":143},{"width":47,"y":299,"height":60,"name":"mecha_1406_folder/textures/foot_l_0","x":1},{"width":60,"y":254,"height":31,"name":"mecha_1406_folder/textures/thigh_1_l_0","x":123},{"width":70,"y":249,"height":48,"name":"mecha_1406_folder/calf_l","x":1},{"width":105,"y":65,"height":60,"name":"mecha_1406_folder/thigh_l","x":135},{"width":132,"y":1,"height":136,"name":"mecha_1406_folder/chest","x":1},{"width":48,"y":249,"height":61,"name":"mecha_1406_folder/foot_r","x":73},{"width":64,"y":198,"height":31,"name":"mecha_1406_folder/textures/thigh_1_r_1","x":76},{"width":73,"y":198,"height":49,"name":"mecha_1406_folder/calf_r","x":1},{"width":107,"y":1,"height":62,"name":"mecha_1406_folder/thigh_r","x":135},{"width":97,"y":287,"height":14,"name":"mecha_1406_folder/weapon_1","x":123},{"width":140,"y":139,"height":57,"name":"mecha_1406_folder/weapon","x":1},{"width":87,"y":127,"height":64,"name":"mecha_1406_folder/shouder_r","x":143}],"width":256,"height":512,"name":"mecha_1406","imagePath":"mecha_1406_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.json.meta b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.json.meta new file mode 100644 index 00000000..06e90b06 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "4534f079-9649-4dbf-bfd6-1db9476df6b5", + "atlasJson": "{\"SubTexture\":[{\"width\":85,\"y\":193,\"height\":59,\"name\":\"mecha_1406_folder/shouder_l\",\"x\":143},{\"width\":47,\"y\":299,\"height\":60,\"name\":\"mecha_1406_folder/textures/foot_l_0\",\"x\":1},{\"width\":60,\"y\":254,\"height\":31,\"name\":\"mecha_1406_folder/textures/thigh_1_l_0\",\"x\":123},{\"width\":70,\"y\":249,\"height\":48,\"name\":\"mecha_1406_folder/calf_l\",\"x\":1},{\"width\":105,\"y\":65,\"height\":60,\"name\":\"mecha_1406_folder/thigh_l\",\"x\":135},{\"width\":132,\"y\":1,\"height\":136,\"name\":\"mecha_1406_folder/chest\",\"x\":1},{\"width\":48,\"y\":249,\"height\":61,\"name\":\"mecha_1406_folder/foot_r\",\"x\":73},{\"width\":64,\"y\":198,\"height\":31,\"name\":\"mecha_1406_folder/textures/thigh_1_r_1\",\"x\":76},{\"width\":73,\"y\":198,\"height\":49,\"name\":\"mecha_1406_folder/calf_r\",\"x\":1},{\"width\":107,\"y\":1,\"height\":62,\"name\":\"mecha_1406_folder/thigh_r\",\"x\":135},{\"width\":97,\"y\":287,\"height\":14,\"name\":\"mecha_1406_folder/weapon_1\",\"x\":123},{\"width\":140,\"y\":139,\"height\":57,\"name\":\"mecha_1406_folder/weapon\",\"x\":1},{\"width\":87,\"y\":127,\"height\":64,\"name\":\"mecha_1406_folder/shouder_r\",\"x\":143}],\"width\":256,\"height\":512,\"name\":\"mecha_1406\",\"imagePath\":\"mecha_1406_tex.png\"}", + "texture": "e976a346-54ef-4a8d-a76e-1aab21ecc88c", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.png b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.png new file mode 100644 index 00000000..5f70a869 Binary files /dev/null and b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.png differ diff --git a/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.png.meta b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.png.meta new file mode 100644 index 00000000..7b44858e --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1406/mecha_1406_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "e976a346-54ef-4a8d-a76e-1aab21ecc88c", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "mecha_1406_tex": { + "ver": "1.0.3", + "uuid": "a9715dd2-9c8b-4f6f-b4d2-a18c48407379", + "rawTextureUuid": "e976a346-54ef-4a8d-a76e-1aab21ecc88c", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -6.5, + "offsetY": 76, + "trimX": 1, + "trimY": 1, + "width": 241, + "height": 358, + "rawWidth": 256, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1502b.meta b/Cocos/Demos/assets/resources/mecha_1502b.meta new file mode 100644 index 00000000..aade2519 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1502b.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "dcba6fea-1a0b-4701-a207-7bfbfb71eb40", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_ske.json b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_ske.json new file mode 100644 index 00000000..5cdc8f20 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_ske.json @@ -0,0 +1 @@ +{"frameRate":24,"armature":[{"animation":[{"frame":[],"slot":[{"colorFrame":[{"duration":4,"tweenEasing":0,"color":{"aM":50}},{"duration":0}],"displayFrame":[{"duration":4},{"duration":0}],"name":"b"}],"bone":[{"translateFrame":[{"duration":4,"tweenEasing":0},{"duration":0}],"rotateFrame":[{"duration":4,"tweenEasing":0},{"duration":0}],"scaleFrame":[{"y":0.3,"duration":4,"tweenEasing":0,"x":0.1},{"duration":0,"x":1.8}],"name":"b"}],"duration":4,"name":"idle","ffd":[]}],"type":"Armature","frameRate":24,"aabb":{"width":74,"y":-10,"height":20,"x":-64},"defaultActions":[{"gotoAndPlay":"idle"}],"skin":[{"slot":[{"display":[{"path":"bullet_01_f/bullet_01","type":"image","name":"bullet_01_f/bullet_01","transform":{"x":-27}}],"name":"b"}],"name":""}],"bone":[{"length":20,"name":"b","transform":{},"inheritScale":false}],"ik":[],"name":"bullet_01","slot":[{"name":"b","parent":"b","color":{"aM":50}}]},{"animation":[{"frame":[],"slot":[{"colorFrame":[{"duration":1},{"duration":0}],"displayFrame":[{"duration":1},{"value":-1,"duration":0}],"name":"root"}],"bone":[{"translateFrame":[{"duration":1}],"rotateFrame":[{"duration":1}],"scaleFrame":[{"duration":1}],"name":"root"}],"duration":1,"name":"idle","ffd":[]}],"type":"Armature","frameRate":24,"aabb":{"width":48,"y":-19,"height":38,"x":-3},"defaultActions":[{"gotoAndPlay":"idle"}],"skin":[{"slot":[{"display":[{"path":"fire_effect_01_f/fireEffect","type":"image","name":"fire_effect_01_f/fireEffect","transform":{"x":21,"scX":1.5}}],"name":"root"}],"name":""}],"bone":[{"length":30,"name":"root","transform":{},"inheritScale":false}],"ik":[],"name":"fire_effect_01","slot":[{"name":"root","parent":"root","color":{}}]},{"animation":[{"frame":[],"slot":[{"colorFrame":[{"duration":1,"tweenEasing":0},{"duration":1,"color":{"aM":30}}],"displayFrame":[{"duration":1},{"duration":1}],"name":"b2"},{"colorFrame":[],"displayFrame":[],"name":"b1"}],"playTimes":0,"bone":[{"translateFrame":[{"duration":2,"tweenEasing":0},{"duration":0}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":0}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"y":0.5,"duration":0,"x":0.5}],"name":"b2"},{"translateFrame":[{"duration":2}],"rotateFrame":[{"duration":2}],"scaleFrame":[{"duration":2}],"name":"root"}],"duration":2,"name":"idle","ffd":[]}],"type":"Armature","frameRate":24,"aabb":{"width":180,"y":-22,"height":234,"x":-90},"defaultActions":[{"gotoAndPlay":"idle"}],"skin":[{"slot":[{"display":[{"path":"flame_01_f/bbb","type":"image","name":"flame_01_f/bbb","transform":{"skX":-90,"x":95,"skY":-90}}],"blendMode":"add","name":"b2"},{"display":[{"path":"flame_01_f/ba_bu_flame1","type":"image","name":"flame_01_f/ba_bu_flame1","transform":{"y":85,"skX":-90,"skY":-90}}],"name":"b1"}],"name":""}],"bone":[{"name":"root","transform":{}},{"length":30,"transform":{"skX":90,"skY":90},"parent":"root","name":"b2","inheritScale":false}],"ik":[],"name":"flame_01","slot":[{"name":"b1","parent":"root","color":{}},{"blendMode":"add","z":1,"parent":"b2","name":"b2","color":{}}]},{"animation":[{"frame":[],"slot":[{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.2,"playTimes":0,"bone":[{"translateFrame":[{"duration":30,"tweenEasing":0},{"y":-0.04,"duration":30,"tweenEasing":0,"x":-0.01},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":0.0004},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.0004},{"duration":0}],"name":"weapon_l"},{"translateFrame":[{"duration":30,"tweenEasing":0},{"y":-0.61,"duration":30,"tweenEasing":0,"x":-0.46},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":3.5176},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0},{"duration":0}],"name":"shouder_l"},{"translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30}],"name":"foot_l"},{"translateFrame":[{"duration":60}],"rotateFrame":[{"duration":60}],"scaleFrame":[{"duration":60}],"name":"thigh_1_l"},{"translateFrame":[{"duration":60}],"rotateFrame":[{"duration":60}],"scaleFrame":[{"duration":60}],"name":"calf_l"},{"translateFrame":[{"duration":30,"tweenEasing":0},{"y":-3.95,"duration":30,"tweenEasing":0},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":3.2615},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"y":0.9998,"duration":30,"tweenEasing":0,"x":1.0008},{"duration":0}],"name":"thigh_l"},{"translateFrame":[{"duration":30,"tweenEasing":0},{"y":-4,"duration":30,"tweenEasing":0},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0},{"duration":0}],"name":"pelvis"},{"translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-3.5022},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"y":1.0027,"duration":30,"tweenEasing":0,"x":0.9996},{"duration":0}],"name":"chest"},{"translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30}],"name":"foot_r"},{"translateFrame":[{"duration":60}],"rotateFrame":[{"duration":60}],"scaleFrame":[{"duration":60}],"name":"thigh_1_r"},{"translateFrame":[{"duration":60}],"rotateFrame":[{"duration":60}],"scaleFrame":[{"duration":60}],"name":"calf_r"},{"translateFrame":[{"duration":30,"tweenEasing":0},{"y":-4.05,"duration":30,"tweenEasing":0},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":2.2559},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"y":1.0002,"duration":30,"tweenEasing":0,"x":0.9985},{"duration":0}],"name":"thigh_r"},{"translateFrame":[{"duration":30,"tweenEasing":0},{"y":0.55,"duration":30,"tweenEasing":0,"x":0.49},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":3.5176},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0},{"duration":0}],"name":"shouder_r"},{"translateFrame":[{"duration":30,"tweenEasing":0},{"y":0.06,"duration":30,"tweenEasing":0,"x":0.01},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-0.0004},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.0002},{"duration":0}],"name":"weapon_r"},{"translateFrame":[{"duration":60}],"rotateFrame":[{"duration":60}],"scaleFrame":[{"duration":60}],"name":"root"},{"translateFrame":[{"duration":60}],"rotateFrame":[{"duration":60}],"scaleFrame":[{"duration":60}],"name":"effects_b"},{"translateFrame":[{"duration":60}],"rotateFrame":[{"duration":60}],"scaleFrame":[{"duration":60}],"name":"effects_f"}],"duration":60,"name":"idle","ffd":[]},{"frame":[{"duration":14,"tweenEasing":null},{"duration":16,"tweenEasing":null,"events":[{"name":"step","bone":"foot_r"}]},{"duration":0,"tweenEasing":null,"events":[{"name":"step"}]}],"slot":[{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.2,"playTimes":0,"bone":[{"translateFrame":[{"y":0.21,"duration":4,"tweenEasing":0,"x":0.32},{"y":0.2,"duration":3,"tweenEasing":0,"x":0.25},{"y":0.28,"duration":8,"tweenEasing":0,"x":0.14},{"y":0.21,"duration":4,"tweenEasing":0,"x":0.33},{"y":0.14,"duration":3,"tweenEasing":0,"x":0.52},{"y":0.15,"duration":8,"tweenEasing":0,"x":0.87},{"y":0.21,"duration":0,"x":0.32}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-13.2794},{"duration":3,"tweenEasing":0,"rotate":-12.4984},{"duration":8,"tweenEasing":0,"rotate":-12.2896},{"duration":4,"tweenEasing":0,"rotate":-16.0772},{"duration":3,"tweenEasing":0,"rotate":-15.1996},{"duration":8,"tweenEasing":0,"rotate":-13.4424},{"duration":0,"rotate":-13.2794}],"scaleFrame":[{"duration":4,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.9998},{"duration":8,"tweenEasing":0,"x":0.9997},{"y":0.9998,"duration":4,"tweenEasing":0,"x":0.9996},{"duration":3,"tweenEasing":0,"x":0.9997},{"duration":8,"tweenEasing":0},{"duration":0}],"name":"weapon_l"},{"translateFrame":[{"y":-0.49,"duration":4,"tweenEasing":0,"x":-1.93},{"y":-1.58,"duration":3,"tweenEasing":0,"x":-0.43},{"y":-2.37,"duration":8,"tweenEasing":0,"x":0.46},{"y":-1.99,"duration":4,"tweenEasing":0,"x":-1.3},{"y":-0.1,"duration":3,"tweenEasing":0,"x":-3.33},{"y":1.08,"duration":8,"tweenEasing":0,"x":-3.69},{"y":-0.49,"duration":0,"x":-1.93}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":10.8683},{"duration":3,"tweenEasing":0,"rotate":9.3445},{"duration":8,"tweenEasing":0,"rotate":8.6273},{"duration":4,"tweenEasing":0,"rotate":13.3741},{"duration":3,"tweenEasing":0,"rotate":13.6744},{"duration":8,"tweenEasing":0,"rotate":11.8799},{"duration":0,"rotate":10.8683}],"scaleFrame":[{"y":1.0017,"duration":4,"tweenEasing":0,"x":1.1315},{"duration":3,"tweenEasing":0,"x":1.0079},{"y":0.9988,"duration":8,"tweenEasing":0,"x":0.9313},{"y":1.0004,"duration":4,"tweenEasing":0,"x":1.037},{"y":1.0028,"duration":3,"tweenEasing":0,"x":1.2006},{"y":1.0028,"duration":8,"tweenEasing":0,"x":1.2005},{"y":1.0017,"duration":0,"x":1.1315}],"name":"shouder_l"},{"translateFrame":[{"y":-0.3,"duration":2,"tweenEasing":0,"x":16.75},{"y":-0.3,"duration":2,"tweenEasing":0,"x":12.15},{"y":-1.15,"duration":3,"tweenEasing":0,"x":-7.15},{"y":-2.5,"duration":4,"tweenEasing":0,"x":-39.35},{"y":-5.1,"duration":3,"tweenEasing":0,"x":-81.1},{"y":-10.25,"duration":1,"tweenEasing":0,"x":-102.2},{"y":-13.45,"duration":2,"tweenEasing":0,"x":-108.3},{"y":-20.4,"duration":2,"tweenEasing":0,"x":-111.6},{"y":-29.65,"duration":1,"tweenEasing":0,"x":-86.3},{"y":-33.25,"duration":2,"tweenEasing":0,"x":-71.8},{"y":-35.1,"duration":1,"tweenEasing":0,"x":-49.45},{"y":-33.55,"duration":6,"tweenEasing":0,"x":-39.6},{"y":-12.45,"duration":1,"tweenEasing":0,"x":14.05},{"y":-0.3,"duration":0,"x":16.75}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":1.0018},{"duration":1,"tweenEasing":0,"rotate":8.0069},{"duration":2,"tweenEasing":0,"rotate":14.0174},{"duration":2,"tweenEasing":0,"rotate":28.3078},{"duration":1,"tweenEasing":0,"rotate":37.8456},{"duration":2,"tweenEasing":0,"rotate":38.3492},{"duration":1,"tweenEasing":0,"rotate":26.0511},{"duration":6,"tweenEasing":0,"rotate":18.277},{"duration":1,"tweenEasing":0,"rotate":-15.7672},{"duration":0}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":0.999},{"duration":2,"tweenEasing":0,"x":0.9981},{"duration":3,"tweenEasing":0,"x":0.9994},{"duration":4,"tweenEasing":0,"x":1.0021},{"duration":3,"tweenEasing":0,"x":1.0028},{"y":0.9991,"duration":1,"tweenEasing":0,"x":0.9898},{"y":0.9985,"duration":2,"tweenEasing":0,"x":1.0146},{"y":0.9973,"duration":2,"tweenEasing":0,"x":0.9856},{"y":0.9968,"duration":1,"tweenEasing":0,"x":0.9987},{"y":0.9968,"duration":2,"tweenEasing":0,"x":1.0058},{"y":0.9974,"duration":1,"tweenEasing":0,"x":1.004},{"y":0.998,"duration":6,"tweenEasing":0,"x":1.0066},{"y":0.9982,"duration":1,"tweenEasing":0,"x":1.0049},{"duration":0,"x":0.999}],"name":"foot_l"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"thigh_1_l"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"calf_l"},{"translateFrame":[{"y":-10.85,"duration":2,"tweenEasing":0,"x":-4.15},{"y":-2.8,"duration":2,"tweenEasing":0,"x":-5.75},{"y":-8.05,"duration":3,"tweenEasing":0,"x":-7.55},{"y":-17.85,"duration":4,"tweenEasing":0,"x":-10.55},{"y":-24.1,"duration":3,"tweenEasing":0,"x":-15.45},{"y":-14.5,"duration":1,"tweenEasing":0,"x":-15.75},{"y":-10.05,"duration":2,"tweenEasing":0,"x":-15.3},{"y":1.6,"duration":2,"tweenEasing":0,"x":-14.9},{"y":0.85,"duration":1,"tweenEasing":0,"x":-14.4},{"y":-0.75,"duration":2,"tweenEasing":0,"x":-13.8},{"y":-6.1,"duration":1,"tweenEasing":0,"x":-11.95},{"y":-9.45,"duration":6,"tweenEasing":0,"x":-10.85},{"y":-15.3,"duration":1,"tweenEasing":0,"x":-4.9},{"y":-10.85,"duration":0,"x":-4.15}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":1.757},{"duration":2,"tweenEasing":0,"rotate":8.7813},{"duration":3,"tweenEasing":0,"rotate":15.0555},{"duration":4,"tweenEasing":0,"rotate":28.8665},{"duration":3,"tweenEasing":0,"rotate":47.6848},{"duration":1,"tweenEasing":0,"rotate":56.4545},{"duration":2,"tweenEasing":0,"rotate":54.952},{"duration":2,"tweenEasing":0,"rotate":48.1864},{"duration":1,"tweenEasing":0,"rotate":39.9089},{"duration":2,"tweenEasing":0,"rotate":32.1285},{"duration":1,"tweenEasing":0,"rotate":12.5451},{"duration":6,"tweenEasing":0,"rotate":5.0168},{"duration":1,"tweenEasing":0,"rotate":-4.2613},{"duration":0,"rotate":1.757}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.0008},{"y":0.9994,"duration":2,"tweenEasing":0,"x":0.9991},{"y":0.9992,"duration":3,"tweenEasing":0,"x":0.9974},{"y":0.9991,"duration":4,"tweenEasing":0,"x":0.9897},{"y":1.0002,"duration":3,"tweenEasing":0,"x":0.9656},{"y":1.001,"duration":1,"tweenEasing":0,"x":0.9566},{"y":1.0009,"duration":2,"tweenEasing":0,"x":0.9602},{"y":1.0002,"duration":2,"tweenEasing":0,"x":0.9672},{"y":0.9996,"duration":1,"tweenEasing":0,"x":0.9635},{"y":0.9992,"duration":2,"tweenEasing":0,"x":0.971},{"y":0.9993,"duration":1,"tweenEasing":0,"x":0.993},{"y":0.9996,"duration":6,"tweenEasing":0,"x":0.9989},{"y":1.0004,"duration":1,"tweenEasing":0,"x":1.0018},{"duration":0,"x":1.0008}],"name":"thigh_l"},{"translateFrame":[{"y":-11.35,"duration":4,"tweenEasing":0,"x":-10.5},{"y":-6.75,"duration":3,"tweenEasing":0,"x":-9.3},{"y":-16.4,"duration":8,"tweenEasing":0,"x":-8.75},{"y":-11.35,"duration":4,"tweenEasing":0,"x":-10.5},{"y":-2.3,"duration":3,"tweenEasing":0,"x":-12.45},{"y":-9.95,"duration":8,"tweenEasing":0,"x":-12.45},{"y":-11.35,"duration":0,"x":-10.5}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":8.7548},{"duration":3,"tweenEasing":0,"rotate":8.504},{"duration":8,"tweenEasing":0,"rotate":8.7552},{"duration":4,"tweenEasing":0,"rotate":9.0056},{"duration":3,"tweenEasing":0,"rotate":9.2549},{"duration":8,"tweenEasing":0,"rotate":9.5049},{"duration":0,"rotate":8.7548}],"scaleFrame":[{"y":0.999,"duration":4,"tweenEasing":0,"x":0.9864},{"y":0.999,"duration":3,"tweenEasing":0,"x":0.9816},{"y":0.999,"duration":8,"tweenEasing":0,"x":0.984},{"y":0.999,"duration":4,"tweenEasing":0,"x":1.0044},{"y":0.999,"duration":3,"tweenEasing":0,"x":1.0118},{"y":0.9989,"duration":8,"tweenEasing":0,"x":1.0123},{"y":0.999,"duration":0,"x":0.9864}],"name":"pelvis"},{"translateFrame":[{"y":-0.18,"duration":4,"tweenEasing":0,"x":-0.09},{"y":0.05,"duration":3,"tweenEasing":0,"x":0.14},{"y":0.03,"duration":8,"tweenEasing":0,"x":0.3},{"y":0.01,"duration":4,"tweenEasing":0,"x":0.12},{"y":-0.12,"duration":3,"tweenEasing":0,"x":-0.1},{"y":-0.25,"duration":8,"tweenEasing":0,"x":-0.27},{"y":-0.18,"duration":0,"x":-0.09}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-5.5067},{"duration":3,"tweenEasing":0,"rotate":-5.2565},{"duration":8,"tweenEasing":0,"rotate":-5.5072},{"duration":4,"tweenEasing":0,"rotate":-6.0065},{"duration":3,"tweenEasing":0,"rotate":-6.5045},{"duration":8,"tweenEasing":0,"rotate":-6.7562},{"duration":0,"rotate":-5.5067}],"scaleFrame":[{"y":1.001,"duration":4,"tweenEasing":0,"x":0.9997},{"y":1.0072,"duration":3,"tweenEasing":0,"x":0.9997},{"y":1.0109,"duration":8,"tweenEasing":0,"x":0.9998},{"y":1.0092,"duration":4,"tweenEasing":0,"x":0.9997},{"y":0.9991,"duration":3,"tweenEasing":0,"x":0.9997},{"y":0.992,"duration":8,"tweenEasing":0,"x":0.9996},{"y":1.001,"duration":0,"x":0.9997}],"name":"chest"},{"translateFrame":[{"y":-0.4,"duration":2,"tweenEasing":0,"x":-16.75},{"y":-17.5,"duration":2,"tweenEasing":0,"x":-20.95},{"y":-24.25,"duration":1,"tweenEasing":0,"x":2.05},{"y":-26.2,"duration":2,"tweenEasing":0,"x":15.95},{"y":-30.85,"duration":1,"tweenEasing":0,"x":43.9},{"y":-30.5,"duration":5,"tweenEasing":0,"x":56},{"y":-6.25,"duration":1,"tweenEasing":0,"x":101.45},{"y":7.85,"duration":1,"tweenEasing":0,"x":102.6},{"y":7.8,"duration":1,"tweenEasing":0,"x":101.125},{"y":7.75,"duration":3,"tweenEasing":0,"x":99.65},{"y":7.05,"duration":3,"tweenEasing":0,"x":76.2},{"y":6.35,"duration":5,"tweenEasing":0,"x":50.75},{"y":4.35,"duration":3,"tweenEasing":0,"x":7.9},{"y":-0.4,"duration":0,"x":-16.75}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":7.0062},{"duration":2,"tweenEasing":0,"rotate":28.559},{"duration":1,"tweenEasing":0,"rotate":21.5367},{"duration":2,"tweenEasing":0,"rotate":16.5225},{"duration":1,"tweenEasing":0,"rotate":11.2628},{"duration":5,"tweenEasing":0,"rotate":8.2584},{"duration":1,"tweenEasing":0,"rotate":-15.0151},{"duration":1,"tweenEasing":0,"rotate":-1.2505},{"duration":1,"tweenEasing":0,"rotate":-0.6252},{"duration":3,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":0.0035},{"duration":5,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":0.7523},{"duration":0,"rotate":7.0062}],"scaleFrame":[{"y":0.9992,"duration":2,"tweenEasing":0,"x":0.9748},{"y":0.9972,"duration":2,"tweenEasing":0,"x":1.0043},{"y":0.9977,"duration":1,"tweenEasing":0,"x":1.0169},{"y":0.9982,"duration":2,"tweenEasing":0,"x":1.0189},{"y":0.9987,"duration":1,"tweenEasing":0,"x":1.0148},{"y":0.9991,"duration":5,"tweenEasing":0,"x":1.0131},{"y":0.9984,"duration":1,"tweenEasing":0,"x":1.017},{"y":0.9998,"duration":1,"tweenEasing":0,"x":1.0029},{"duration":1,"tweenEasing":0,"x":1.0016},{"duration":3,"tweenEasing":0,"x":1.0003},{"duration":3,"tweenEasing":0,"x":0.9988},{"duration":5,"tweenEasing":0,"x":0.9979},{"duration":3,"tweenEasing":0,"x":0.9933},{"y":0.9992,"duration":0,"x":0.9748}],"name":"foot_r"},{"translateFrame":[{"duration":30}],"rotateFrame":[{"duration":30}],"scaleFrame":[{"duration":30}],"name":"thigh_1_r"},{"translateFrame":[{"duration":30}],"rotateFrame":[{"duration":30}],"scaleFrame":[{"duration":30}],"name":"calf_r"},{"translateFrame":[{"y":-11.8,"duration":2,"tweenEasing":0,"x":-17.1},{"y":-1.75,"duration":2,"tweenEasing":0,"x":-14.2},{"y":-5.4,"duration":1,"tweenEasing":0,"x":-11.15},{"y":-8.25,"duration":2,"tweenEasing":0,"x":-9.6},{"y":-14.85,"duration":1,"tweenEasing":0,"x":-6.85},{"y":-18.05,"duration":5,"tweenEasing":0,"x":-5.75},{"y":-21.25,"duration":1,"tweenEasing":0,"x":-3.6},{"y":-17,"duration":1,"tweenEasing":0,"x":-4.5},{"y":-12.7,"duration":1,"tweenEasing":0,"x":-5.55},{"y":-6.3,"duration":3,"tweenEasing":0,"x":-6.7},{"y":-5.55,"duration":3,"tweenEasing":0,"x":-10.45},{"y":-13.95,"duration":5,"tweenEasing":0,"x":-13},{"y":-22.55,"duration":3,"tweenEasing":0,"x":-16.3},{"y":-11.8,"duration":0,"x":-17.1}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":23.2815},{"duration":2,"tweenEasing":0,"rotate":12.275},{"duration":1,"tweenEasing":0,"rotate":5.5136},{"duration":2,"tweenEasing":0,"rotate":-1.0035},{"duration":1,"tweenEasing":0,"rotate":-15.3049},{"duration":5,"tweenEasing":0,"rotate":-21.8326},{"duration":1,"tweenEasing":0,"rotate":-32.629},{"duration":1,"tweenEasing":0,"rotate":-20.5773},{"duration":1,"tweenEasing":0,"rotate":-15.0532},{"duration":3,"tweenEasing":0,"rotate":-20.0748},{"duration":3,"tweenEasing":0,"rotate":-19.0705},{"duration":5,"tweenEasing":0,"rotate":-5.7685},{"duration":3,"tweenEasing":0,"rotate":15.5266},{"duration":0,"rotate":23.2815}],"scaleFrame":[{"y":1.0018,"duration":2,"tweenEasing":0,"x":1.0012},{"y":1.0012,"duration":2,"tweenEasing":0,"x":1.0078},{"y":1.0005,"duration":1,"tweenEasing":0,"x":1.0083},{"y":0.9998,"duration":2,"tweenEasing":0,"x":1.0099},{"y":0.999,"duration":1,"tweenEasing":0,"x":1.0115},{"y":0.9988,"duration":5,"tweenEasing":0,"x":1.0114},{"y":0.999,"duration":1,"tweenEasing":0,"x":1.0082},{"y":0.9988,"duration":1,"tweenEasing":0,"x":1.0115},{"y":0.999,"duration":1,"tweenEasing":0,"x":1.0109},{"y":0.9989,"duration":3,"tweenEasing":0,"x":1.0114},{"y":0.9989,"duration":3,"tweenEasing":0,"x":1.0093},{"y":0.9995,"duration":5,"tweenEasing":0,"x":1.0024},{"y":1.0016,"duration":3,"tweenEasing":0,"x":0.9958},{"y":1.0018,"duration":0,"x":1.0012}],"name":"thigh_r"},{"translateFrame":[{"y":0.66,"duration":4,"tweenEasing":0,"x":1.86},{"y":1.24,"duration":3,"tweenEasing":0,"x":0.3},{"y":1.82,"duration":8,"tweenEasing":0,"x":-0.57},{"y":1.85,"duration":4,"tweenEasing":0,"x":1.19},{"y":0.6,"duration":3,"tweenEasing":0,"x":3.01},{"y":-0.16,"duration":8,"tweenEasing":0,"x":3.6},{"y":0.66,"duration":0,"x":1.86}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":9.563},{"duration":3,"tweenEasing":0,"rotate":7.6299},{"duration":8,"tweenEasing":0,"rotate":6.6463},{"duration":4,"tweenEasing":0,"rotate":12.4092},{"duration":3,"tweenEasing":0,"rotate":12.5754},{"duration":8,"tweenEasing":0,"rotate":10.8219},{"duration":0,"rotate":9.563}],"scaleFrame":[{"y":0.9996,"duration":4,"tweenEasing":0,"x":0.9857},{"y":0.9983,"duration":3,"tweenEasing":0,"x":0.8951},{"y":0.9983,"duration":8,"tweenEasing":0,"x":0.8951},{"y":0.9984,"duration":4,"tweenEasing":0,"x":0.8952},{"y":1.0008,"duration":3,"tweenEasing":0,"x":1.0644},{"y":1.0019,"duration":8,"tweenEasing":0,"x":1.1373},{"y":0.9996,"duration":0,"x":0.9857}],"name":"shouder_r"},{"translateFrame":[{"y":0.27,"duration":4,"tweenEasing":0,"x":0.2},{"y":0.3,"duration":3,"tweenEasing":0,"x":-0.16},{"y":0.42,"duration":8,"tweenEasing":0,"x":-0.9},{"y":0.35,"duration":4,"tweenEasing":0,"x":0.14},{"y":0.17,"duration":3,"tweenEasing":0,"x":0.41},{"y":0.19,"duration":8,"tweenEasing":0,"x":0.41},{"y":0.27,"duration":0,"x":0.2}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-12.9031},{"duration":3,"tweenEasing":0,"rotate":-11.6123},{"duration":8,"tweenEasing":0,"rotate":-10.6085},{"duration":4,"tweenEasing":0,"rotate":-16.1317},{"duration":3,"tweenEasing":0,"rotate":-14.8927},{"duration":8,"tweenEasing":0,"rotate":-12.7133},{"duration":0,"rotate":-12.9031}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.9997},{"y":0.9998,"duration":3,"tweenEasing":0,"x":0.9996},{"y":0.9998,"duration":8,"tweenEasing":0,"x":0.9995},{"y":0.9998,"duration":4,"tweenEasing":0,"x":0.9993},{"y":0.9998,"duration":3,"tweenEasing":0,"x":0.9995},{"duration":8,"tweenEasing":0,"x":0.9996},{"duration":0,"x":0.9997}],"name":"weapon_r"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"root"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"effects_b"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"effects_f"}],"duration":30,"name":"walk","ffd":[]},{"frame":[],"slot":[{"colorFrame":[{"duration":3}],"displayFrame":[{"duration":3,"actions":[{"gotoAndPlay":"fire_01"}]}],"name":"weapon_l"},{"colorFrame":[{"duration":3}],"displayFrame":[{"duration":3,"actions":[{"gotoAndPlay":"fire_01"}]}],"name":"weapon_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"}],"fadeInTime":0.2,"playTimes":5,"bone":[{"translateFrame":[{"y":-0.08,"duration":2,"tweenEasing":0,"x":0.19},{"y":-0.1,"duration":1,"x":0.18}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-0.005},{"duration":1,"rotate":-0.005}],"scaleFrame":[{"y":1.0006,"duration":2,"tweenEasing":0,"x":1.002},{"y":1.0006,"duration":1,"x":1.002}],"name":"weapon_l"},{"translateFrame":[{"y":-0.48,"duration":2,"tweenEasing":0,"x":-0.78},{"y":-0.86,"duration":1,"x":-1.1}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":4.5013},{"duration":1,"rotate":7.5038}],"scaleFrame":[{"y":1.0015,"duration":2,"tweenEasing":0,"x":1.0004},{"y":1.0015,"duration":1,"x":1.0004}],"name":"shouder_l"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"foot_l"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"thigh_1_l"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"calf_l"},{"translateFrame":[{"y":13.534,"duration":2,"tweenEasing":0,"x":-17.524},{"y":15.434,"duration":1,"x":-17.524}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-7.269},{"duration":1,"rotate":-7.269}],"scaleFrame":[{"y":1.0015,"duration":2,"tweenEasing":0,"x":0.9988},{"y":1.0015,"duration":1,"x":0.9988}],"name":"thigh_l"},{"translateFrame":[{"y":13.834,"duration":2,"tweenEasing":0,"x":-17.574},{"y":15.734,"duration":1,"x":-17.574}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-1.7543},{"duration":1,"rotate":-1.7543}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":0.9998},{"duration":1,"x":0.9998}],"name":"pelvis"},{"translateFrame":[{"y":-0.1,"duration":2,"tweenEasing":0,"x":-0.05},{"y":0.33,"duration":1,"x":-0.03}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-4.5042},{"duration":1,"rotate":-5.7521}],"scaleFrame":[{"y":0.9995,"duration":2,"tweenEasing":0,"x":0.9997},{"y":0.9992,"duration":1,"x":0.9996}],"name":"chest"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"foot_r"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"thigh_1_r"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"calf_r"},{"translateFrame":[{"y":14.134,"duration":2,"tweenEasing":0,"x":-17.674},{"y":16.034,"duration":1,"x":-17.674}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":8.2685},{"duration":1,"rotate":8.2685}],"scaleFrame":[{"y":1.0015,"duration":2,"tweenEasing":0,"x":1.0112},{"y":1.0015,"duration":1,"x":1.0112}],"name":"thigh_r"},{"translateFrame":[{"y":0.37,"duration":2,"tweenEasing":0,"x":0.66},{"y":0.89,"duration":1,"x":1.13}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":4.5018},{"duration":1,"rotate":7.5043}],"scaleFrame":[{"y":1.0015,"duration":2,"tweenEasing":0,"x":1.0005},{"y":1.0015,"duration":1,"x":1.0005}],"name":"shouder_r"},{"translateFrame":[{"y":-0.05,"duration":2,"tweenEasing":0,"x":0.15},{"y":-0.06,"duration":1,"x":0.21}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-0.0061},{"duration":1,"rotate":-0.0061}],"scaleFrame":[{"y":1.0005,"duration":2,"tweenEasing":0,"x":1.0017},{"y":1.0006,"duration":1,"x":1.0018}],"name":"weapon_r"},{"translateFrame":[{"duration":3},{"duration":0}],"rotateFrame":[{"duration":3},{"duration":0}],"scaleFrame":[{"duration":3},{"duration":0}],"name":"root"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"effects_b"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"effects_f"}],"duration":3,"name":"attack_01","ffd":[]},{"frame":[{"duration":4,"tweenEasing":null},{"duration":5,"tweenEasing":null,"events":[{"name":"step","bone":"foot_l"}]},{"action":"attack_02_1","duration":0,"tweenEasing":null}],"slot":[{"colorFrame":[{"duration":9}],"displayFrame":[{"duration":9,"actions":[{"gotoAndPlay":"prepare_01"}]}],"name":"weapon_l"},{"colorFrame":[{"duration":9}],"displayFrame":[{"duration":9,"actions":[{"gotoAndPlay":"prepare_01"}]}],"name":"weapon_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"}],"fadeInTime":0.2,"bone":[{"translateFrame":[{"duration":2,"tweenEasing":0},{"y":0.19,"duration":4,"tweenEasing":0},{"y":0.19,"duration":3,"tweenEasing":0,"x":0.37},{"y":0.15,"duration":0,"x":0.34}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":0.0004},{"duration":3,"tweenEasing":0,"rotate":0.0004},{"duration":0,"rotate":0.0004}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":0.9998},{"y":1.0003,"duration":3,"tweenEasing":0,"x":1.0011},{"y":1.0006,"duration":0,"x":1.0019}],"name":"weapon_l"},{"translateFrame":[{"duration":2,"tweenEasing":0},{"y":-1.27,"duration":4,"tweenEasing":0,"x":-0.86},{"y":-0.89,"duration":3,"tweenEasing":0,"x":-1.17},{"y":-0.16,"duration":0,"x":-0.45}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":6.0331},{"duration":3,"tweenEasing":0,"rotate":4.524},{"duration":0,"rotate":0.0044}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":0}],"name":"shouder_l"},{"translateFrame":[{"duration":2,"tweenEasing":0},{"y":-15.75,"duration":2,"tweenEasing":0,"x":-60.15},{"y":-4.85,"duration":2,"tweenEasing":0,"x":-110.7},{"y":-4.85,"duration":3,"x":-110.7}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":3}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":3}],"name":"foot_l"},{"translateFrame":[{"duration":9}],"rotateFrame":[{"duration":9}],"scaleFrame":[{"duration":9}],"name":"thigh_1_l"},{"translateFrame":[{"duration":9}],"rotateFrame":[{"duration":9}],"scaleFrame":[{"duration":9}],"name":"calf_l"},{"translateFrame":[{"duration":2,"tweenEasing":0},{"y":-28.65,"duration":2,"tweenEasing":0,"x":-19.85},{"y":-17.3,"duration":2,"tweenEasing":0,"x":-39.65},{"y":18.95,"duration":3,"x":-55.2}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":47.9352},{"duration":2,"tweenEasing":0,"rotate":92.2569},{"duration":3,"rotate":48.186}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"y":1.0002,"duration":2,"tweenEasing":0,"x":0.9793},{"duration":2,"tweenEasing":0,"x":0.9465},{"y":1.0002,"duration":3,"x":0.9767}],"name":"thigh_l"},{"translateFrame":[{"duration":6,"tweenEasing":0},{"y":19.15,"duration":3,"x":-56}],"rotateFrame":[{"duration":6,"tweenEasing":0},{"duration":3}],"scaleFrame":[{"duration":6,"tweenEasing":0},{"duration":3}],"name":"pelvis"},{"translateFrame":[{"duration":2,"tweenEasing":0},{"y":-1.55,"duration":4,"tweenEasing":0,"x":35.55},{"y":-0.1,"duration":3,"tweenEasing":0,"x":-0.1},{"y":-0.1,"duration":0,"x":-0.1}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":-6.0048},{"duration":3,"tweenEasing":0,"rotate":-4.5034},{"duration":0,"rotate":-0.0035}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"y":1.0047,"duration":4,"tweenEasing":0,"x":0.9994},{"y":1.0035,"duration":3,"tweenEasing":0,"x":0.9995},{"y":1.0002,"duration":0}],"name":"chest"},{"translateFrame":[{"duration":9}],"rotateFrame":[{"duration":9}],"scaleFrame":[{"duration":9}],"name":"foot_r"},{"translateFrame":[{"duration":9}],"rotateFrame":[{"duration":9}],"scaleFrame":[{"duration":9}],"name":"thigh_1_r"},{"translateFrame":[{"duration":9}],"rotateFrame":[{"duration":9}],"scaleFrame":[{"duration":9}],"name":"calf_r"},{"translateFrame":[{"duration":2,"tweenEasing":0},{"y":-29.5,"duration":4,"tweenEasing":0,"x":-20.5},{"y":19.4,"duration":3,"x":-56.8}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":9.5202},{"duration":3,"rotate":-35.3896}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"y":1.0009,"duration":4,"tweenEasing":0,"x":0.9925},{"y":0.999,"duration":3,"x":1.0113}],"name":"thigh_r"},{"translateFrame":[{"duration":2,"tweenEasing":0},{"y":1.38,"duration":4,"tweenEasing":0,"x":1.16},{"y":0.32,"duration":3,"tweenEasing":0,"x":1.44},{"y":-0.43,"duration":0,"x":0.93}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":6.0331},{"duration":3,"tweenEasing":0,"rotate":4.524},{"duration":0,"rotate":0.0044}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":0}],"name":"shouder_r"},{"translateFrame":[{"duration":2,"tweenEasing":0},{"y":0.23,"duration":4,"tweenEasing":0},{"y":0.22,"duration":3,"tweenEasing":0,"x":0.38},{"y":0.24,"duration":0,"x":0.37}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":-0.0004},{"duration":3,"tweenEasing":0},{"duration":0}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"y":0.9998,"duration":4,"tweenEasing":0,"x":0.9996},{"y":1.0003,"duration":3,"tweenEasing":0,"x":1.0008},{"y":1.0005,"duration":0,"x":1.0016}],"name":"weapon_r"},{"translateFrame":[{"duration":9}],"rotateFrame":[{"duration":9}],"scaleFrame":[{"duration":9}],"name":"root"},{"translateFrame":[{"duration":9}],"rotateFrame":[{"duration":9}],"scaleFrame":[{"duration":9}],"name":"effects_b"},{"translateFrame":[{"duration":9}],"rotateFrame":[{"duration":9}],"scaleFrame":[{"duration":9}],"name":"effects_f"}],"duration":9,"name":"attack_02","ffd":[]},{"frame":[],"slot":[{"colorFrame":[{"duration":3}],"displayFrame":[{"duration":3,"actions":[{"gotoAndPlay":"fire_01"}]}],"name":"weapon_l"},{"colorFrame":[{"duration":3}],"displayFrame":[{"duration":3,"actions":[{"gotoAndPlay":"fire_01"}]}],"name":"weapon_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"}],"fadeInTime":0.1,"playTimes":10,"bone":[{"translateFrame":[{"y":0.15,"duration":3,"x":0.34}],"rotateFrame":[{"duration":3,"rotate":0.0004}],"scaleFrame":[{"y":1.0006,"duration":3,"x":1.0019}],"name":"weapon_l"},{"translateFrame":[{"y":-0.16,"duration":2,"tweenEasing":0,"x":-0.45},{"y":-0.72,"duration":1,"x":-0.9}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":0.0044},{"duration":1,"rotate":3.5184}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":1}],"name":"shouder_l"},{"translateFrame":[{"y":-4.85,"duration":3,"x":-110.7}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"foot_l"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"thigh_1_l"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"calf_l"},{"translateFrame":[{"y":18.95,"duration":2,"tweenEasing":0,"x":-55.2},{"y":22,"duration":1,"x":-56.4}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":48.186},{"duration":1,"rotate":46.6818}],"scaleFrame":[{"y":1.0002,"duration":2,"tweenEasing":0,"x":0.9767},{"duration":1,"x":0.9778}],"name":"thigh_l"},{"translateFrame":[{"y":19.15,"duration":2,"tweenEasing":0,"x":-56},{"y":22.25,"duration":1,"x":-57.2}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":1}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":1}],"name":"pelvis"},{"translateFrame":[{"y":-0.1,"duration":2,"tweenEasing":0,"x":-0.1},{"y":-0.1,"duration":1,"x":-0.1}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-0.0035},{"duration":1,"rotate":-3.502}],"scaleFrame":[{"y":1.0002,"duration":2,"tweenEasing":0},{"y":1.0029,"duration":1,"x":0.9996}],"name":"chest"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"foot_r"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"thigh_1_r"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"calf_r"},{"translateFrame":[{"y":19.4,"duration":2,"tweenEasing":0,"x":-56.8},{"y":22.55,"duration":1,"x":-58}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-35.3896},{"duration":1,"rotate":-39.4055}],"scaleFrame":[{"y":0.999,"duration":2,"tweenEasing":0,"x":1.0113},{"y":0.9992,"duration":1,"x":1.0107}],"name":"thigh_r"},{"translateFrame":[{"y":-0.43,"duration":2,"tweenEasing":0,"x":0.93},{"y":0.12,"duration":1,"x":1.51}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":0.0044},{"duration":1,"rotate":3.5184}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":1}],"name":"shouder_r"},{"translateFrame":[{"y":0.24,"duration":3,"x":0.37}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"y":1.0005,"duration":3,"x":1.0016}],"name":"weapon_r"},{"translateFrame":[{"duration":3},{"duration":0}],"rotateFrame":[{"duration":3},{"duration":0}],"scaleFrame":[{"duration":3},{"duration":0}],"name":"root"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"effects_b"},{"translateFrame":[{"duration":3}],"rotateFrame":[{"duration":3}],"scaleFrame":[{"duration":3}],"name":"effects_f"}],"duration":3,"name":"attack_02_1","ffd":[]},{"frame":[],"slot":[{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.1,"bone":[{"translateFrame":[{"y":0.04,"duration":2,"tweenEasing":0,"x":-0.02},{"y":0.36,"duration":2,"tweenEasing":0,"x":0.2},{"y":0.14,"duration":2,"tweenEasing":0,"x":0.44},{"y":0.19,"duration":2,"tweenEasing":0,"x":0.49},{"y":0.13,"duration":2,"tweenEasing":0,"x":0.56},{"y":0.09,"duration":0,"x":0.51}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-20.746},{"duration":2,"tweenEasing":0,"rotate":8.943},{"duration":2,"tweenEasing":0,"rotate":5.575},{"duration":2,"tweenEasing":0,"rotate":47.4274},{"duration":0,"rotate":52.6339}],"scaleFrame":[{"y":1.0005,"duration":2,"tweenEasing":0,"x":1.0015},{"y":0.9996,"duration":2,"tweenEasing":0,"x":0.9988},{"y":0.9994,"duration":2,"tweenEasing":0,"x":0.9982},{"y":0.9991,"duration":2,"tweenEasing":0,"x":0.9974},{"y":0.9992,"duration":2,"tweenEasing":0,"x":0.9977},{"y":0.9991,"duration":0,"x":0.9973}],"name":"weapon_l"},{"translateFrame":[{"y":-2.07,"duration":2,"tweenEasing":0,"x":-1.35},{"y":-2.5,"duration":2,"tweenEasing":0,"x":-1.87},{"y":2.88,"duration":2,"tweenEasing":0,"x":3.68},{"y":1.72,"duration":2,"tweenEasing":0,"x":1.42},{"y":3.09,"duration":2,"tweenEasing":0,"x":4.47},{"y":3.2,"duration":0,"x":5.39}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":12.0717},{"duration":2,"tweenEasing":0,"rotate":-1.9106},{"duration":2,"tweenEasing":0,"rotate":-8.0419},{"duration":2,"tweenEasing":0,"rotate":-1.6343},{"duration":2,"tweenEasing":0,"rotate":-28.3747},{"duration":0,"rotate":-16.7951}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":0}],"name":"shouder_l"},{"translateFrame":[{"duration":2,"tweenEasing":0},{"y":-5,"duration":6,"tweenEasing":0,"x":-114.2},{"y":-5,"duration":2,"x":-114.2}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":2}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":2}],"name":"foot_l"},{"translateFrame":[{"duration":10}],"rotateFrame":[{"duration":10}],"scaleFrame":[{"duration":10}],"name":"thigh_1_l"},{"translateFrame":[{"duration":10}],"rotateFrame":[{"duration":10}],"scaleFrame":[{"duration":10}],"name":"calf_l"},{"translateFrame":[{"y":-14.05,"duration":2,"tweenEasing":0,"x":15.35},{"y":-24.4,"duration":2,"tweenEasing":0,"x":-51.9},{"y":45,"duration":2,"tweenEasing":0,"x":-81.7},{"y":35.8,"duration":1,"tweenEasing":0,"x":-81.75},{"y":44.8,"duration":1,"tweenEasing":0,"x":-87.3},{"y":45.8,"duration":2,"tweenEasing":0,"x":-87.9},{"y":44.8,"duration":0,"x":-87.3}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":10.0352},{"duration":2,"tweenEasing":0,"rotate":54.7019},{"duration":2,"tweenEasing":0,"rotate":31.1258},{"duration":1,"tweenEasing":0,"rotate":28.1115},{"duration":1,"tweenEasing":0,"rotate":17.8176},{"duration":2,"tweenEasing":0,"rotate":16.3114},{"duration":0,"rotate":16.8131}],"scaleFrame":[{"y":0.9993,"duration":2,"tweenEasing":0,"x":1.0014},{"y":1.0008,"duration":2,"tweenEasing":0,"x":0.9738},{"y":0.9991,"duration":2,"tweenEasing":0,"x":0.9895},{"y":0.9991,"duration":1,"tweenEasing":0,"x":0.993},{"y":0.9991,"duration":1,"tweenEasing":0,"x":0.9986},{"y":0.9991,"duration":2,"tweenEasing":0,"x":0.9993},{"y":0.9991,"duration":0,"x":0.9992}],"name":"thigh_l"},{"translateFrame":[{"y":-14.25,"duration":2,"tweenEasing":0,"x":15.55},{"y":-24.75,"duration":2,"tweenEasing":0,"x":-52.7},{"y":45.6,"duration":2,"tweenEasing":0,"x":-82.85},{"y":36.25,"duration":1,"tweenEasing":0,"x":-82.9},{"y":45.35,"duration":3,"x":-88.5}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-1.7526},{"duration":2,"tweenEasing":0,"rotate":12.2587},{"duration":2,"tweenEasing":0,"rotate":-6.5053},{"duration":1,"tweenEasing":0,"rotate":-6.5053},{"duration":3,"rotate":-6.5053}],"scaleFrame":[{"y":0.9997,"duration":2,"tweenEasing":0,"x":1.0015},{"y":0.9986,"duration":2,"tweenEasing":0,"x":0.9907},{"y":0.9993,"duration":2,"tweenEasing":0,"x":1.0051},{"y":0.9993,"duration":1,"tweenEasing":0,"x":1.0051},{"y":0.9993,"duration":3,"x":1.0051}],"name":"pelvis"},{"translateFrame":[{"y":-0.08,"duration":2,"tweenEasing":0},{"y":-0.12,"duration":2,"tweenEasing":0,"x":0.06},{"y":-0.13,"duration":2,"tweenEasing":0,"x":-0.12},{"y":-0.17,"duration":1,"tweenEasing":0,"x":-0.12},{"y":-0.07,"duration":1,"tweenEasing":0,"x":-0.09},{"y":-0.84,"duration":2,"tweenEasing":0,"x":-1.05},{"y":-0.07,"duration":0,"x":-0.09}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-10.2599},{"duration":2,"tweenEasing":0,"rotate":-24.2724},{"duration":2,"tweenEasing":0,"rotate":31.0475},{"duration":1,"tweenEasing":0,"rotate":19.2674},{"duration":1,"tweenEasing":0,"rotate":26.0326},{"duration":2,"tweenEasing":0,"rotate":34.8102},{"duration":0,"rotate":38.5745}],"scaleFrame":[{"y":1.0096,"duration":2,"tweenEasing":0,"x":0.9988},{"y":1.0097,"duration":2,"tweenEasing":0,"x":0.9988},{"y":0.985,"duration":2,"tweenEasing":0,"x":0.9974},{"y":0.9906,"duration":1,"tweenEasing":0,"x":0.9985},{"y":0.9869,"duration":1,"tweenEasing":0,"x":0.9978},{"y":0.9841,"duration":2,"tweenEasing":0,"x":0.9972},{"y":0.9836,"duration":0,"x":0.9969}],"name":"chest"},{"translateFrame":[{"duration":2,"tweenEasing":0},{"y":-1.2,"duration":2,"tweenEasing":0,"x":-26.7},{"y":-2,"duration":4,"tweenEasing":0,"x":-43.6},{"y":-2,"duration":2,"x":-43.6}],"rotateFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":2}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":2}],"name":"foot_r"},{"translateFrame":[{"y":-0.21,"duration":10,"x":0.12}],"rotateFrame":[{"duration":10,"rotate":-23.7927}],"scaleFrame":[{"y":0.9984,"duration":10,"x":0.9872}],"name":"thigh_1_r"},{"translateFrame":[{"y":-0.04,"duration":10,"x":0.32}],"rotateFrame":[{"duration":10,"rotate":28.5415}],"scaleFrame":[{"y":0.9993,"duration":10,"x":0.9903}],"name":"calf_r"},{"translateFrame":[{"y":-14.4,"duration":2,"tweenEasing":0,"x":15.75},{"y":-25.15,"duration":2,"tweenEasing":0,"x":-53.5},{"y":46.15,"duration":2,"tweenEasing":0,"x":-84},{"y":36.7,"duration":1,"tweenEasing":0,"x":-84.1},{"y":45.95,"duration":1,"tweenEasing":0,"x":-89.75},{"y":46.95,"duration":2,"tweenEasing":0,"x":-90.35},{"y":45.95,"duration":0,"x":-89.75}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":7.7666},{"duration":2,"tweenEasing":0,"rotate":-4.7656},{"duration":2,"tweenEasing":0,"rotate":8.5197},{"duration":1,"tweenEasing":0,"rotate":-12.0409},{"duration":1,"tweenEasing":0,"rotate":-5.2668},{"duration":2,"tweenEasing":0,"rotate":0.7522},{"duration":0,"rotate":0.502}],"scaleFrame":[{"y":1.0007,"duration":2,"tweenEasing":0,"x":0.9946},{"y":0.9996,"duration":2,"tweenEasing":0,"x":1.0019},{"y":1.0008,"duration":2,"tweenEasing":0,"x":0.9989},{"y":0.9992,"duration":1,"tweenEasing":0,"x":1.008},{"y":0.9996,"duration":1,"tweenEasing":0,"x":1.0059},{"duration":2,"tweenEasing":0,"x":1.0032},{"duration":0,"x":1.0031}],"name":"thigh_r"},{"translateFrame":[{"y":1.98,"duration":2,"tweenEasing":0,"x":1.21},{"y":2.32,"duration":2,"tweenEasing":0,"x":2.18},{"y":-4.33,"duration":2,"tweenEasing":0,"x":-2.87},{"y":-2.65,"duration":2,"tweenEasing":0,"x":-0.64},{"y":-4.74,"duration":2,"tweenEasing":0,"x":-3.51},{"y":-5.12,"duration":0,"x":-4.15}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":12.0717},{"duration":2,"tweenEasing":0,"rotate":-26.7714},{"duration":2,"tweenEasing":0,"rotate":1.9618},{"duration":2,"tweenEasing":0,"rotate":-10.8871},{"duration":2,"tweenEasing":0,"rotate":-32.6422},{"duration":0,"rotate":-24.7231}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"y":0.9983,"duration":2,"tweenEasing":0,"x":0.7204},{"y":0.9985,"duration":2,"tweenEasing":0,"x":0.8952},{"y":1.0009,"duration":2,"tweenEasing":0,"x":0.9907},{"y":1.0002,"duration":2,"tweenEasing":0,"x":0.9997},{"duration":0,"x":1.0003}],"name":"shouder_r"},{"translateFrame":[{"y":0.02,"duration":2,"tweenEasing":0,"x":-0.1},{"y":-1.22,"duration":2,"tweenEasing":0,"x":9.24},{"y":0.14,"duration":2,"tweenEasing":0,"x":0.35},{"y":-1.56,"duration":2,"tweenEasing":0,"x":11.53},{"y":-1.54,"duration":2,"tweenEasing":0,"x":11.64},{"y":-1.55,"duration":0,"x":11.65}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-0.0004},{"duration":2,"tweenEasing":0,"rotate":11.8408},{"duration":2,"tweenEasing":0,"rotate":7.9952},{"duration":2,"tweenEasing":0,"rotate":19.4318},{"duration":2,"tweenEasing":0,"rotate":48.2468},{"duration":0,"rotate":57.4615}],"scaleFrame":[{"y":1.0004,"duration":2,"tweenEasing":0,"x":1.0013},{"y":0.9996,"duration":2,"tweenEasing":0,"x":0.9986},{"y":0.9998,"duration":2,"tweenEasing":0,"x":0.9993},{"y":0.999,"duration":2,"tweenEasing":0,"x":0.9968},{"y":0.9992,"duration":2,"tweenEasing":0,"x":0.9976},{"y":0.999,"duration":0,"x":0.9969}],"name":"weapon_r"},{"translateFrame":[{"duration":10}],"rotateFrame":[{"duration":10}],"scaleFrame":[{"duration":10}],"name":"root"},{"translateFrame":[{"duration":10}],"rotateFrame":[{"duration":10}],"scaleFrame":[{"duration":10}],"name":"effects_b"},{"translateFrame":[{"duration":10}],"rotateFrame":[{"duration":10}],"scaleFrame":[{"duration":10}],"name":"effects_f"}],"duration":10,"name":"death","ffd":[]},{"frame":[],"slot":[{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.1,"bone":[{"translateFrame":[{"y":0.04,"duration":1,"tweenEasing":0,"x":-0.02},{"y":0.17,"duration":5,"tweenEasing":0,"x":0.26},{"y":0.23,"duration":2,"tweenEasing":0,"x":0.28},{"y":0.15,"duration":0,"x":0.21}],"rotateFrame":[{"duration":1,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":0.0004},{"duration":2,"tweenEasing":0,"rotate":0.0008},{"duration":0,"rotate":0.0004}],"scaleFrame":[{"y":0.9996,"duration":1,"tweenEasing":0,"x":0.9989},{"y":1.0004,"duration":5,"tweenEasing":0,"x":1.0013},{"y":1.0006,"duration":2,"tweenEasing":0,"x":1.0018},{"y":1.0006,"duration":0,"x":1.0019}],"name":"weapon_l"},{"translateFrame":[{"y":-2.07,"duration":1,"tweenEasing":0,"x":-1.35},{"y":0.18,"duration":5,"tweenEasing":0,"x":0.04},{"y":-0.36,"duration":2,"tweenEasing":0,"x":9.94},{"y":1.45,"duration":0,"x":1.5}],"rotateFrame":[{"duration":1,"tweenEasing":0,"rotate":12.0717},{"duration":5,"tweenEasing":0,"rotate":-3.0111},{"duration":2,"tweenEasing":0,"rotate":-9.4689},{"duration":0,"rotate":-12.052}],"scaleFrame":[{"duration":1,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":0}],"name":"shouder_l"},{"translateFrame":[{"duration":1,"tweenEasing":0},{"y":-8.45,"duration":2,"tweenEasing":0,"x":-53},{"y":-1.25,"duration":5,"x":-78.8}],"rotateFrame":[{"duration":1,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":5}],"scaleFrame":[{"duration":1,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":5}],"name":"foot_l"},{"translateFrame":[{"duration":8}],"rotateFrame":[{"duration":8}],"scaleFrame":[{"duration":8}],"name":"thigh_1_l"},{"translateFrame":[{"duration":8}],"rotateFrame":[{"duration":8}],"scaleFrame":[{"duration":8}],"name":"calf_l"},{"translateFrame":[{"y":-14.05,"duration":1,"tweenEasing":0,"x":15.35},{"y":-1.35,"duration":2,"tweenEasing":0,"x":-51.85},{"y":2,"duration":5,"tweenEasing":0,"x":-61.05},{"y":7.1,"duration":0,"x":-54.65}],"rotateFrame":[{"duration":1,"tweenEasing":0,"rotate":10.0352},{"duration":2,"tweenEasing":0,"rotate":-8.0191},{"duration":5,"tweenEasing":0,"rotate":1.0027},{"duration":0,"rotate":6.0197}],"scaleFrame":[{"y":0.9993,"duration":1,"tweenEasing":0,"x":1.0014},{"y":1.0008,"duration":2,"tweenEasing":0,"x":0.9964},{"duration":5,"tweenEasing":0,"x":1.0002},{"y":0.9996,"duration":0,"x":1.0013}],"name":"thigh_l"},{"translateFrame":[{"y":-14.25,"duration":1,"tweenEasing":0,"x":15.55},{"y":-1.4,"duration":7,"tweenEasing":0,"x":-52.6},{"y":7.15,"duration":0,"x":-55.45}],"rotateFrame":[{"duration":1,"tweenEasing":0,"rotate":-1.7526},{"duration":7,"tweenEasing":0,"rotate":12.2587},{"duration":0,"rotate":10.5074}],"scaleFrame":[{"y":0.9997,"duration":1,"tweenEasing":0,"x":1.0015},{"y":0.9986,"duration":7,"tweenEasing":0,"x":0.9907},{"y":0.9989,"duration":0,"x":0.9919}],"name":"pelvis"},{"translateFrame":[{"y":-0.08,"duration":1,"tweenEasing":0},{"y":-0.09,"duration":7,"tweenEasing":0,"x":-0.05},{"y":-0.09,"duration":0,"x":-0.05}],"rotateFrame":[{"duration":1,"tweenEasing":0,"rotate":-10.2599},{"duration":7,"tweenEasing":0,"rotate":-9.2597},{"duration":0,"rotate":1.5031}],"scaleFrame":[{"y":1.0096,"duration":1,"tweenEasing":0,"x":0.9988},{"y":0.9976,"duration":7,"tweenEasing":0,"x":0.9996},{"y":0.991,"duration":0,"x":0.9986}],"name":"chest"},{"translateFrame":[{"duration":1,"tweenEasing":0},{"y":-1.2,"duration":7,"x":-26.7}],"rotateFrame":[{"duration":1,"tweenEasing":0},{"duration":7}],"scaleFrame":[{"duration":1,"tweenEasing":0},{"duration":7}],"name":"foot_r"},{"translateFrame":[{"duration":8}],"rotateFrame":[{"duration":8}],"scaleFrame":[{"duration":8}],"name":"thigh_1_r"},{"translateFrame":[{"duration":8}],"rotateFrame":[{"duration":8}],"scaleFrame":[{"duration":8}],"name":"calf_r"},{"translateFrame":[{"y":-14.4,"duration":1,"tweenEasing":0,"x":15.75},{"y":-1.45,"duration":7,"tweenEasing":0,"x":-53.35},{"y":7.25,"duration":0,"x":-56.25}],"rotateFrame":[{"duration":1,"tweenEasing":0,"rotate":7.7666},{"duration":7,"tweenEasing":0,"rotate":-7.5237},{"duration":0,"rotate":-1.0034}],"scaleFrame":[{"y":1.0007,"duration":1,"tweenEasing":0,"x":0.9946},{"y":0.9994,"duration":7,"tweenEasing":0,"x":1.0041},{"y":0.9998,"duration":0,"x":1.0007}],"name":"thigh_r"},{"translateFrame":[{"y":1.98,"duration":1,"tweenEasing":0,"x":1.21},{"y":-0.54,"duration":5,"tweenEasing":0,"x":0.42},{"y":-3.08,"duration":2,"tweenEasing":0,"x":8.58},{"y":-1.98,"duration":0,"x":-0.92}],"rotateFrame":[{"duration":1,"tweenEasing":0,"rotate":12.0717},{"duration":5,"tweenEasing":0,"rotate":-3.0111},{"duration":2,"tweenEasing":0,"rotate":-9.4689},{"duration":0,"rotate":-12.052}],"scaleFrame":[{"duration":1,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":0}],"name":"shouder_r"},{"translateFrame":[{"y":0.02,"duration":1,"tweenEasing":0,"x":-0.1},{"y":0.24,"duration":5,"tweenEasing":0,"x":0.17},{"y":0.29,"duration":2,"tweenEasing":0,"x":0.27},{"y":0.18,"duration":0,"x":0.26}],"rotateFrame":[{"duration":1,"tweenEasing":0,"rotate":-0.0004},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":0}],"scaleFrame":[{"y":0.9995,"duration":1,"tweenEasing":0,"x":0.9986},{"y":1.0004,"duration":5,"tweenEasing":0,"x":1.001},{"y":1.0005,"duration":2,"tweenEasing":0,"x":1.0014},{"y":1.0006,"duration":0,"x":1.0018}],"name":"weapon_r"},{"translateFrame":[{"duration":8}],"rotateFrame":[{"duration":8}],"scaleFrame":[{"duration":8}],"name":"root"},{"translateFrame":[{"duration":8}],"rotateFrame":[{"duration":8}],"scaleFrame":[{"duration":8}],"name":"effects_b"},{"translateFrame":[{"duration":8}],"rotateFrame":[{"duration":8}],"scaleFrame":[{"duration":8}],"name":"effects_f"}],"duration":8,"name":"hit","ffd":[]},{"frame":[],"slot":[{"colorFrame":[{"duration":0,"color":{"aM":0}}],"displayFrame":[{"duration":0}],"name":"effects_f"},{"colorFrame":[{"duration":0,"color":{"aM":0}}],"displayFrame":[{"duration":0}],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.1,"bone":[{"translateFrame":[{"y":-0.24,"duration":0,"x":0.18}],"rotateFrame":[{"duration":0,"rotate":0.0004}],"scaleFrame":[{"y":0.9994,"duration":0,"x":0.9983}],"name":"weapon_l"},{"translateFrame":[{"y":2.18,"duration":0,"x":3.04}],"rotateFrame":[{"duration":0,"rotate":-17.0743}],"scaleFrame":[{"duration":0}],"name":"shouder_l"},{"translateFrame":[{"y":-2.25,"duration":0,"x":-51.4}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"foot_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_l"},{"translateFrame":[{"y":32.95,"duration":0,"x":-5.9}],"rotateFrame":[{"duration":0,"rotate":28.6149}],"scaleFrame":[{"y":0.9991,"duration":0,"x":0.9929}],"name":"thigh_l"},{"translateFrame":[{"y":33.35,"duration":0,"x":-5.95}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"pelvis"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"y":0.5,"duration":0,"x":0.5}],"name":"effects_f"},{"translateFrame":[{"duration":0,"x":-0.1}],"rotateFrame":[{"duration":0,"rotate":17.0206}],"scaleFrame":[{"y":0.9882,"duration":0,"x":0.9981}],"name":"chest"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0,"rotate":-23.137}],"scaleFrame":[{"y":0.5,"duration":0,"x":0.5}],"name":"effects_b"},{"translateFrame":[{"y":0.95,"duration":0,"x":20.4}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"foot_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_r"},{"translateFrame":[{"y":33.85,"duration":0,"x":-6}],"rotateFrame":[{"duration":0,"rotate":-1.003}],"scaleFrame":[{"y":0.9998,"duration":0,"x":1.002}],"name":"thigh_r"},{"translateFrame":[{"y":-2.82,"duration":0,"x":-2.45}],"rotateFrame":[{"duration":0,"rotate":-17.0743}],"scaleFrame":[{"duration":0}],"name":"shouder_r"},{"translateFrame":[{"y":-0.18,"duration":0,"x":0.18}],"rotateFrame":[{"duration":0,"rotate":0.0004}],"scaleFrame":[{"y":0.9995,"duration":0,"x":0.9985}],"name":"weapon_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"root"}],"duration":0,"name":"jump_1","ffd":[]},{"frame":[],"slot":[{"colorFrame":[{"duration":0}],"displayFrame":[{"duration":0}],"name":"effects_f"},{"colorFrame":[{"duration":0}],"displayFrame":[{"duration":0}],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.1,"bone":[{"translateFrame":[{"y":-0.01,"duration":0,"x":0.05}],"rotateFrame":[{"duration":0,"rotate":0.0004}],"scaleFrame":[{"y":1.0005,"duration":0,"x":1.0016}],"name":"weapon_l"},{"translateFrame":[{"y":-2.03,"duration":0,"x":-1.6}],"rotateFrame":[{"duration":0,"rotate":12.0717}],"scaleFrame":[{"duration":0}],"name":"shouder_l"},{"translateFrame":[{"y":10.8,"duration":0,"x":-83.05}],"rotateFrame":[{"duration":0,"rotate":57.6803}],"scaleFrame":[{"y":0.997,"duration":0,"x":0.9907}],"name":"foot_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_l"},{"translateFrame":[{"y":-0.2,"duration":0,"x":-5.9}],"rotateFrame":[{"duration":0,"rotate":46.682}],"scaleFrame":[{"duration":0,"x":0.9819}],"name":"thigh_l"},{"translateFrame":[{"y":-0.25,"duration":0,"x":-5.95}],"rotateFrame":[{"duration":0,"rotate":25.2942}],"scaleFrame":[{"y":0.9974,"duration":0,"x":0.9847}],"name":"pelvis"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"effects_f"},{"translateFrame":[{"y":-2.71,"duration":0,"x":-0.2}],"rotateFrame":[{"duration":0,"rotate":-37.3067}],"scaleFrame":[{"y":1.0096,"duration":0,"x":0.9988}],"name":"chest"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0,"rotate":1.2365}],"scaleFrame":[{"duration":0}],"name":"effects_b"},{"translateFrame":[{"y":-8.75,"duration":0,"x":-44.3}],"rotateFrame":[{"duration":0,"rotate":57.6796}],"scaleFrame":[{"y":0.997,"duration":0,"x":0.9908}],"name":"foot_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_r"},{"translateFrame":[{"y":-0.25,"duration":0,"x":-6.05}],"rotateFrame":[{"duration":0,"rotate":31.0399}],"scaleFrame":[{"y":1.0009,"duration":0,"x":0.9759}],"name":"thigh_r"},{"translateFrame":[{"y":1.82,"duration":0,"x":1.49}],"rotateFrame":[{"duration":0,"rotate":12.0717}],"scaleFrame":[{"duration":0}],"name":"shouder_r"},{"translateFrame":[{"y":0.08,"duration":0,"x":0.11}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0,"x":0.9997}],"name":"weapon_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"root"}],"duration":0,"name":"jump_2","ffd":[]},{"frame":[],"slot":[{"colorFrame":[{"duration":0}],"displayFrame":[{"duration":0}],"name":"effects_f"},{"colorFrame":[{"duration":0}],"displayFrame":[{"duration":0}],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.1,"bone":[{"translateFrame":[{"y":3.11,"duration":0,"x":-2.66}],"rotateFrame":[{"duration":0,"rotate":-29.9978}],"scaleFrame":[{"y":1.0007,"duration":0,"x":1.002}],"name":"weapon_l"},{"translateFrame":[{"y":-2.01,"duration":0,"x":-1.62}],"rotateFrame":[{"duration":0,"rotate":12.0702}],"scaleFrame":[{"duration":0}],"name":"shouder_l"},{"translateFrame":[{"y":29.9,"duration":0,"x":-20.7}],"rotateFrame":[{"duration":0,"rotate":-16.3344}],"scaleFrame":[{"y":0.997,"duration":0,"x":0.9907}],"name":"foot_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_l"},{"translateFrame":[{"y":-0.2,"duration":0,"x":-5.9}],"rotateFrame":[{"duration":0,"rotate":27.2182}],"scaleFrame":[{"duration":0,"x":0.9818}],"name":"thigh_l"},{"translateFrame":[{"y":-0.25,"duration":0,"x":-5.95}],"rotateFrame":[{"duration":0,"rotate":25.2942}],"scaleFrame":[{"y":0.9974,"duration":0,"x":0.9847}],"name":"pelvis"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0,"rotate":-16.22}],"scaleFrame":[{"duration":0}],"name":"effects_f"},{"translateFrame":[{"y":-2.71,"duration":0,"x":-0.2}],"rotateFrame":[{"duration":0,"rotate":-7.3078}],"scaleFrame":[{"y":1.0096,"duration":0,"x":0.9988}],"name":"chest"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0,"rotate":-11.7614}],"scaleFrame":[{"duration":0}],"name":"effects_b"},{"translateFrame":[{"y":34.35,"duration":0,"x":29.95}],"rotateFrame":[{"duration":0,"rotate":-17.8717}],"scaleFrame":[{"y":0.997,"duration":0,"x":0.9908}],"name":"foot_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_r"},{"translateFrame":[{"y":-0.25,"duration":0,"x":-6.05}],"rotateFrame":[{"duration":0,"rotate":-6.4437}],"scaleFrame":[{"y":1.0009,"duration":0,"x":0.9759}],"name":"thigh_r"},{"translateFrame":[{"y":1.84,"duration":0,"x":1.48}],"rotateFrame":[{"duration":0,"rotate":12.0709}],"scaleFrame":[{"duration":0}],"name":"shouder_r"},{"translateFrame":[{"y":-2.28,"duration":0,"x":2.58}],"rotateFrame":[{"duration":0,"rotate":-29.9989}],"scaleFrame":[{"y":1.0006,"duration":0,"x":1.0018}],"name":"weapon_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"root"}],"duration":0,"name":"jump_3","ffd":[]},{"frame":[],"slot":[{"colorFrame":[{"duration":1,"color":{"aM":0}},{"duration":0,"color":{"aM":0}}],"displayFrame":[{"duration":1},{"value":-1,"duration":0}],"name":"effects_f"},{"colorFrame":[{"duration":1,"color":{"aM":0}},{"duration":0,"color":{"aM":0}}],"displayFrame":[{"duration":1},{"value":-1,"duration":0}],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.1,"bone":[{"translateFrame":[{"y":2.26,"duration":1,"x":-2.2}],"rotateFrame":[{"duration":1,"rotate":-24.1892}],"scaleFrame":[{"y":1.0007,"duration":1,"x":1.002}],"name":"weapon_l"},{"translateFrame":[{"y":0.91,"duration":1,"x":0.77}],"rotateFrame":[{"duration":1,"rotate":-5.0209}],"scaleFrame":[{"duration":1}],"name":"shouder_l"},{"translateFrame":[{"duration":1}],"rotateFrame":[{"duration":1}],"scaleFrame":[{"duration":1}],"name":"foot_l"},{"translateFrame":[{"duration":1}],"rotateFrame":[{"duration":1}],"scaleFrame":[{"duration":1}],"name":"thigh_1_l"},{"translateFrame":[{"duration":1}],"rotateFrame":[{"duration":1}],"scaleFrame":[{"duration":1}],"name":"calf_l"},{"translateFrame":[{"y":37.6,"duration":1,"x":0.05}],"rotateFrame":[{"duration":1,"rotate":7.7638}],"scaleFrame":[{"y":0.9992,"duration":1,"x":0.9429}],"name":"thigh_l"},{"translateFrame":[{"y":38.1,"duration":1,"x":0.1}],"rotateFrame":[{"duration":1}],"scaleFrame":[{"duration":1}],"name":"pelvis"},{"translateFrame":[{"duration":1}],"rotateFrame":[{"duration":1}],"scaleFrame":[{"y":0.5,"duration":1,"x":0.5}],"name":"effects_f"},{"translateFrame":[{"y":-0.05,"duration":1,"x":-0.1}],"rotateFrame":[{"duration":1,"rotate":29.192}],"scaleFrame":[{"y":0.9959,"duration":1,"x":0.9994}],"name":"chest"},{"translateFrame":[{"duration":1}],"rotateFrame":[{"duration":1,"rotate":-22.362}],"scaleFrame":[{"y":0.5,"duration":1,"x":0.5}],"name":"effects_b"},{"translateFrame":[{"duration":1}],"rotateFrame":[{"duration":1}],"scaleFrame":[{"duration":1}],"name":"foot_r"},{"translateFrame":[{"duration":1}],"rotateFrame":[{"duration":1}],"scaleFrame":[{"duration":1}],"name":"thigh_1_r"},{"translateFrame":[{"duration":1}],"rotateFrame":[{"duration":1}],"scaleFrame":[{"duration":1}],"name":"calf_r"},{"translateFrame":[{"y":38.65,"duration":1,"x":0.15}],"rotateFrame":[{"duration":1,"rotate":11.7454}],"scaleFrame":[{"y":1.0009,"duration":1,"x":0.9828}],"name":"thigh_r"},{"translateFrame":[{"y":-1.46,"duration":1,"x":-0.78}],"rotateFrame":[{"duration":1,"rotate":-5.0207}],"scaleFrame":[{"duration":1}],"name":"shouder_r"},{"translateFrame":[{"y":-0.18,"duration":1,"x":0.2}],"rotateFrame":[{"duration":1,"rotate":-24.1901}],"scaleFrame":[{"y":1.0006,"duration":1,"x":1.0018}],"name":"weapon_r"},{"translateFrame":[{"duration":1}],"rotateFrame":[{"duration":1}],"scaleFrame":[{"duration":1}],"name":"root"}],"duration":1,"name":"jump_4","ffd":[]},{"frame":[],"slot":[{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.1,"bone":[{"translateFrame":[{"y":-0.16,"duration":0,"x":0.19}],"rotateFrame":[{"duration":0,"rotate":0.0004}],"scaleFrame":[{"y":1.0004,"duration":0,"x":1.0015}],"name":"weapon_l"},{"translateFrame":[{"y":0.9,"duration":0,"x":0.83}],"rotateFrame":[{"duration":0,"rotate":-5.0198}],"scaleFrame":[{"duration":0}],"name":"shouder_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"foot_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_l"},{"translateFrame":[{"y":37.6,"duration":0,"x":0.05}],"rotateFrame":[{"duration":0,"rotate":-6.3646}],"scaleFrame":[{"y":0.9992,"duration":0,"x":0.9429}],"name":"thigh_l"},{"translateFrame":[{"y":38.1,"duration":0,"x":0.1}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"pelvis"},{"translateFrame":[{"y":-0.05,"duration":0,"x":-0.1}],"rotateFrame":[{"duration":0,"rotate":5.0014}],"scaleFrame":[{"y":0.9959,"duration":0,"x":0.9994}],"name":"chest"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"foot_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_r"},{"translateFrame":[{"y":22.4,"duration":0,"x":-6.7}],"rotateFrame":[{"duration":0,"rotate":19.7955}],"scaleFrame":[{"y":1.0015,"duration":0,"x":1.0112}],"name":"thigh_r"},{"translateFrame":[{"y":-1.38,"duration":0,"x":-0.75}],"rotateFrame":[{"duration":0,"rotate":-5.0198}],"scaleFrame":[{"duration":0}],"name":"shouder_r"},{"translateFrame":[{"y":-0.22,"duration":0,"x":0.21}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"y":1.0002,"duration":0,"x":1.001}],"name":"weapon_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"root"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"effects_b"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"effects_f"}],"duration":0,"name":"squat","ffd":[]},{"frame":[],"slot":[{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.1,"bone":[{"translateFrame":[{"y":-0.09,"duration":0,"x":0.13}],"rotateFrame":[{"duration":0,"rotate":-20.5761}],"scaleFrame":[{"y":1.0007,"duration":0,"x":1.002}],"name":"weapon_l"},{"translateFrame":[{"y":-0.41,"duration":0,"x":-0.79}],"rotateFrame":[{"duration":0,"rotate":-16.7021}],"scaleFrame":[{"y":1.0015,"duration":0,"x":1.0004}],"name":"shouder_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"foot_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_l"},{"translateFrame":[{"y":20.85,"duration":0,"x":-6.55}],"rotateFrame":[{"duration":0,"rotate":-5.0137}],"scaleFrame":[{"y":1.0014,"duration":0,"x":0.9986}],"name":"thigh_l"},{"translateFrame":[{"y":21.15,"duration":0,"x":-6.6}],"rotateFrame":[{"duration":0,"rotate":-23.2231}],"scaleFrame":[{"duration":0}],"name":"pelvis"},{"translateFrame":[{"y":-0.11,"duration":0,"x":-0.06}],"rotateFrame":[{"duration":0,"rotate":-29.5015}],"scaleFrame":[{"y":0.9995,"duration":0,"x":0.9997}],"name":"chest"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"foot_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_r"},{"translateFrame":[{"y":21.45,"duration":0,"x":-6.7}],"rotateFrame":[{"duration":0,"rotate":7.2673}],"scaleFrame":[{"y":1.0014,"duration":0,"x":1.011}],"name":"thigh_r"},{"translateFrame":[{"y":0.44,"duration":0,"x":0.69}],"rotateFrame":[{"duration":0,"rotate":-16.6937}],"scaleFrame":[{"y":1.0015,"duration":0,"x":1.0004}],"name":"shouder_r"},{"translateFrame":[{"y":-0.07,"duration":0,"x":0.2}],"rotateFrame":[{"duration":0,"rotate":-20.5843}],"scaleFrame":[{"y":1.0005,"duration":0,"x":1.0017}],"name":"weapon_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"root"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"effects_b"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"effects_f"}],"duration":0,"name":"aim_up","ffd":[]},{"frame":[],"slot":[{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"fadeInTime":0.1,"bone":[{"translateFrame":[{"y":7.3,"duration":0,"x":-14.03}],"rotateFrame":[{"duration":0,"rotate":13.8342}],"scaleFrame":[{"y":1.0007,"duration":0,"x":1.002}],"name":"weapon_l"},{"translateFrame":[{"y":2.72,"duration":0,"x":9.53}],"rotateFrame":[{"duration":0,"rotate":19.5006}],"scaleFrame":[{"y":1.0015,"duration":0,"x":1.0004}],"name":"shouder_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"foot_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_l"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_l"},{"translateFrame":[{"y":29.0164,"duration":0,"x":-3.8279}],"rotateFrame":[{"duration":0,"rotate":-5.0138}],"scaleFrame":[{"y":1.0014,"duration":0,"x":0.9986}],"name":"thigh_l"},{"translateFrame":[{"y":21.15,"duration":0,"x":-6.6}],"rotateFrame":[{"duration":0,"rotate":35.6959}],"scaleFrame":[{"duration":0}],"name":"pelvis"},{"translateFrame":[{"y":-0.12,"duration":0,"x":-0.1}],"rotateFrame":[{"duration":0,"rotate":20.9562}],"scaleFrame":[{"y":0.9995,"duration":0,"x":0.9997}],"name":"chest"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"foot_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_1_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"calf_r"},{"translateFrame":[{"y":11.9358,"duration":0,"x":-9.3081}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"thigh_r"},{"translateFrame":[{"y":-2.7,"duration":0,"x":-9.69}],"rotateFrame":[{"duration":0,"rotate":19.5004}],"scaleFrame":[{"y":1.0015,"duration":0,"x":1.0004}],"name":"shouder_r"},{"translateFrame":[{"y":-0.07,"duration":0,"x":0.14}],"rotateFrame":[{"duration":0,"rotate":13.8335}],"scaleFrame":[{"y":1.0005,"duration":0,"x":1.0017}],"name":"weapon_r"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"root"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"effects_b"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"effects_f"}],"duration":0,"name":"aim_down","ffd":[]},{"frame":[],"slot":[{"colorFrame":[],"displayFrame":[],"name":"weapon_l"},{"colorFrame":[],"displayFrame":[],"name":"shouder_l"},{"colorFrame":[],"displayFrame":[],"name":"foot_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_l"},{"colorFrame":[],"displayFrame":[],"name":"calf_l"},{"colorFrame":[],"displayFrame":[],"name":"thigh_l"},{"colorFrame":[],"displayFrame":[],"name":"pelvis"},{"colorFrame":[],"displayFrame":[],"name":"effects_f"},{"colorFrame":[],"displayFrame":[],"name":"chest"},{"colorFrame":[],"displayFrame":[],"name":"effects_b"},{"colorFrame":[],"displayFrame":[],"name":"foot_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_1_r"},{"colorFrame":[],"displayFrame":[],"name":"calf_r"},{"colorFrame":[],"displayFrame":[],"name":"thigh_r"},{"colorFrame":[],"displayFrame":[],"name":"shouder_r"},{"colorFrame":[],"displayFrame":[],"name":"weapon_r"}],"playTimes":0,"bone":[{"translateFrame":[{"duration":100,"tweenEasing":0},{"duration":0}],"rotateFrame":[{"duration":100,"tweenEasing":0},{"duration":0}],"scaleFrame":[{"duration":100,"tweenEasing":0},{"duration":0}],"name":"root"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"foot_l"},{"translateFrame":[{"y":20.85,"duration":100,"tweenEasing":0,"x":-6.55},{"y":29.0164,"duration":0,"x":-3.8279}],"rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":-5.0137},{"duration":0,"rotate":-5.0138}],"scaleFrame":[{"y":1.0014,"duration":100,"tweenEasing":0,"x":0.9986},{"y":1.0014,"duration":0,"x":0.9986}],"name":"thigh_l"},{"translateFrame":[{"y":21.45,"duration":100,"tweenEasing":0,"x":-6.7},{"y":11.9358,"duration":0,"x":-9.3081}],"rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":7.2673},{"duration":0}],"scaleFrame":[{"y":1.0014,"duration":100,"tweenEasing":0,"x":1.011},{"duration":0}],"name":"thigh_r"},{"translateFrame":[{"y":21.15,"duration":100,"tweenEasing":0,"x":-6.6},{"y":21.15,"duration":0,"x":-6.6}],"rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":-23.2231},{"duration":0,"rotate":35.6959}],"scaleFrame":[{"duration":100,"tweenEasing":0},{"duration":0}],"name":"pelvis"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"foot_r"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"thigh_1_l"},{"translateFrame":[{"y":-0.11,"duration":100,"tweenEasing":0,"x":-0.06},{"y":-0.12,"duration":0,"x":-0.1}],"rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":-29.5015},{"duration":0,"rotate":20.9562}],"scaleFrame":[{"y":0.9995,"duration":100,"tweenEasing":0,"x":0.9997},{"y":0.9995,"duration":0,"x":0.9997}],"name":"chest"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"thigh_1_r"},{"translateFrame":[{"y":0.44,"duration":100,"tweenEasing":0,"x":0.69},{"y":-2.7,"duration":0,"x":-9.69}],"rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":-16.6937},{"duration":0,"rotate":19.5004}],"scaleFrame":[{"y":1.0015,"duration":100,"tweenEasing":0,"x":1.0004},{"y":1.0015,"duration":0,"x":1.0004}],"name":"shouder_r"},{"translateFrame":[{"y":-0.41,"duration":100,"tweenEasing":0,"x":-0.79},{"y":2.72,"duration":0,"x":9.53}],"rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":-16.7021},{"duration":0,"rotate":19.5006}],"scaleFrame":[{"y":1.0015,"duration":100,"tweenEasing":0,"x":1.0004},{"y":1.0015,"duration":0,"x":1.0004}],"name":"shouder_l"},{"translateFrame":[{"duration":100,"tweenEasing":0},{"duration":0}],"rotateFrame":[{"duration":100,"tweenEasing":0},{"duration":0}],"scaleFrame":[{"duration":100,"tweenEasing":0},{"duration":0}],"name":"effects_b"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"calf_l"},{"translateFrame":[{"duration":100,"tweenEasing":0},{"duration":0}],"rotateFrame":[{"duration":100,"tweenEasing":0},{"duration":0}],"scaleFrame":[{"duration":100,"tweenEasing":0},{"duration":0}],"name":"effects_f"},{"translateFrame":[],"rotateFrame":[],"scaleFrame":[],"name":"calf_r"},{"translateFrame":[{"y":-0.07,"duration":100,"tweenEasing":0,"x":0.2},{"y":-0.07,"duration":0,"x":0.14}],"rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":-20.5843},{"duration":0,"rotate":13.8335}],"scaleFrame":[{"y":1.0005,"duration":100,"tweenEasing":0,"x":1.0017},{"y":1.0005,"duration":0,"x":1.0017}],"name":"weapon_r"},{"translateFrame":[{"y":-0.09,"duration":100,"tweenEasing":0,"x":0.13},{"y":7.3,"duration":0,"x":-14.03}],"rotateFrame":[{"duration":100,"tweenEasing":0,"rotate":-20.5761},{"duration":0,"rotate":13.8342}],"scaleFrame":[{"y":1.0007,"duration":100,"tweenEasing":0,"x":1.002},{"y":1.0007,"duration":0,"x":1.002}],"name":"weapon_l"}],"duration":100,"name":"aim","ffd":[]}],"type":"Armature","frameRate":24,"aabb":{"width":202.6571337556091,"y":-262.3655325241823,"height":320.2820325241823,"x":-111.39678584090109},"defaultActions":[{"gotoAndPlay":"idle"}],"skin":[{"slot":[{"display":[{"path":"mecha_1502b_folder/thigh_1_l_0","type":"image","name":"mecha_1502b_folder/thigh_1_l_0","transform":{"y":-2.95,"skX":0.1119,"x":23,"skY":0.1128}}],"name":"thigh_1_l"},{"display":[{"path":"mecha_1502b_folder/shouder_r_1","type":"image","name":"mecha_1502b_folder/shouder_r_1","transform":{"y":-3.0591,"skX":-50.3304,"x":1.8548,"skY":-50.3127,"scX":0.9998,"scY":1.0002}}],"name":"shouder_r"},{"display":[{"path":"mecha_1502b_folder/thigh_l","type":"image","name":"mecha_1502b_folder/thigh_l","transform":{"y":-5.55,"skX":0.0463,"x":13.45,"skY":0.0455}}],"name":"thigh_l"},{"display":[{"path":"mecha_1502b_folder/calf_r","type":"image","name":"mecha_1502b_folder/calf_r","transform":{"y":2.05,"skX":0.1784,"x":16.95,"skY":0.1784}}],"name":"calf_r"},{"display":[{"transform":{"skX":-90,"skY":-90,"scX":0.8,"scY":0.8},"path":"flame_01","type":"armature","name":"flame_01","filterType":null}],"name":"effects_f"},{"display":[{"transform":{"skX":-90,"skY":-90},"path":"flame_01","type":"armature","name":"flame_01","filterType":null}],"name":"effects_b"},{"display":[{"transform":{},"path":"weapon_1502b_l","type":"armature","name":"weapon_1502b_l","filterType":null}],"name":"weapon_l"},{"display":[{"path":"mecha_1502b_folder/foot_l_0","type":"image","name":"mecha_1502b_folder/foot_l_0","transform":{"y":6.4707,"skX":89.9982,"x":0.0002,"skY":89.9982,"scX":0.9955,"scY":1.0045}}],"name":"foot_l"},{"display":[{"path":"mecha_1502b_folder/calf_l","type":"image","name":"mecha_1502b_folder/calf_l","transform":{"y":0.95,"skX":-0.1967,"x":15,"skY":-0.1976}}],"name":"calf_l"},{"display":[{"path":"mecha_1502b_folder/thigh_r","type":"image","name":"mecha_1502b_folder/thigh_r","transform":{"y":-11.55,"skX":-0.1635,"x":12.45,"skY":-0.1626}}],"name":"thigh_r"},{"display":[{"path":"mecha_1502b_folder/pelvis","type":"image","name":"mecha_1502b_folder/pelvis","transform":{"y":7.5,"x":3.5}}],"name":"pelvis"},{"display":[{"path":"mecha_1502b_folder/thigh_1_r_1","type":"image","name":"mecha_1502b_folder/thigh_1_r_1","transform":{"y":-1.9,"skX":0.438,"x":21.55,"skY":0.438}}],"name":"thigh_1_r"},{"display":[{"path":"mecha_1502b_folder/chest","type":"image","name":"mecha_1502b_folder/chest","transform":{"y":29.4658,"skX":89.9994,"x":-17.0277,"skY":90.0004}}],"name":"chest"},{"display":[{"transform":{},"path":"weapon_1502b_r","type":"armature","name":"weapon_1502b_r","filterType":null}],"name":"weapon_r"},{"display":[{"path":"mecha_1502b_folder/foot_r","type":"image","name":"mecha_1502b_folder/foot_r","transform":{"y":7.4165,"skX":89.9982,"x":-0.502,"skY":89.9982,"scX":0.9955,"scY":1.0045}}],"name":"foot_r"},{"display":[{"path":"mecha_1502b_folder/shouder_l_0","type":"image","name":"mecha_1502b_folder/shouder_l_0","transform":{"y":-3.2345,"skX":129.6702,"x":0.7822,"skY":129.6875,"scX":0.9998,"scY":1.0002}}],"name":"shouder_l"}],"name":""}],"bone":[{"name":"root","transform":{}},{"length":20,"transform":{"y":-25,"x":62.85,"scX":0.9955},"parent":"root","name":"foot_l","inheritScale":false},{"length":40,"transform":{"y":-133.55,"skX":21.9887,"x":8.3,"skY":21.9887,"scX":0.9995,"scY":0.9977},"parent":"root","name":"thigh_l","inheritScale":false},{"length":42,"transform":{"y":-112.45,"skX":69.8809,"x":-8.55,"skY":69.8854,"scX":0.9876,"scY":0.9979},"parent":"root","name":"thigh_r","inheritScale":false},{"length":20,"transform":{"y":-123.15,"skX":-89.9991,"skY":-89.9991},"parent":"root","name":"pelvis","inheritScale":false},{"length":20,"transform":{"y":-4,"x":-43.8,"scX":0.9955},"parent":"root","name":"foot_r","inheritScale":false},{"length":50,"transform":{"y":-0.04,"skX":97.9614,"x":40.11,"skY":97.9621,"scX":0.9894,"scY":0.9971},"parent":"thigh_l","name":"thigh_1_l","inheritScale":false},{"length":20,"transform":{"skX":-90,"x":13.75,"skY":-90},"parent":"pelvis","name":"chest","inheritScale":false},{"length":53,"transform":{"y":-0.01,"skX":105.4235,"x":41.52,"skY":105.423,"scX":0.9984,"scY":0.9995},"parent":"thigh_r","name":"thigh_1_r","inheritScale":false},{"length":20,"transform":{"y":31.28,"x":13.74,"scX":0.9965,"scY":0.9969},"parent":"chest","name":"shouder_r","inheritScale":false},{"length":20,"transform":{"y":46.59,"x":-2.41,"scX":0.9965,"scY":0.9969},"parent":"chest","name":"shouder_l","inheritScale":false},{"length":100,"transform":{"y":3.13,"skX":130,"x":11.65,"skY":130},"parent":"chest","inheritRotation":false,"name":"effects_b","inheritScale":false},{"length":64,"transform":{"y":0.01,"skX":-70.8583,"x":50.91,"skY":-70.864,"scX":1.0149,"scY":0.9967},"parent":"thigh_1_l","name":"calf_l","inheritScale":false},{"length":100,"transform":{"y":-13.37,"skX":90,"x":-20.82,"skY":90},"parent":"chest","inheritRotation":false,"name":"effects_f","inheritScale":false},{"length":66,"transform":{"y":-0.02,"skX":-88.4874,"x":53.26,"skY":-88.4933,"scX":0.9852,"scY":0.9996},"parent":"thigh_1_r","name":"calf_r","inheritScale":false},{"length":100,"transform":{"skX":180,"x":5.98,"skY":180,"scX":0.9982,"scY":0.9994},"parent":"shouder_r","name":"weapon_r","inheritScale":false},{"length":100,"transform":{"y":0.04,"skX":180,"x":5.6,"skY":180,"scX":0.998,"scY":0.9993},"parent":"shouder_l","name":"weapon_l","inheritScale":false}],"ik":[{"chain":1,"bone":"calf_l","name":"calf_l","bendPositive":"false","target":"foot_l"},{"chain":1,"bone":"calf_r","name":"calf_r","bendPositive":"false","target":"foot_r"}],"name":"mecha_1502b","slot":[{"name":"weapon_l","parent":"weapon_l","color":{}},{"z":1,"name":"shouder_l","parent":"shouder_l","color":{}},{"z":2,"name":"foot_l","parent":"foot_l","color":{}},{"z":3,"name":"thigh_1_l","parent":"thigh_1_l","color":{}},{"z":4,"name":"calf_l","parent":"calf_l","color":{}},{"z":5,"name":"thigh_l","parent":"thigh_l","color":{}},{"z":6,"name":"pelvis","parent":"pelvis","color":{}},{"z":7,"name":"effects_f","parent":"effects_f","color":{"aM":0}},{"z":8,"name":"chest","parent":"chest","color":{}},{"z":9,"name":"effects_b","parent":"effects_b","color":{"aM":0}},{"z":10,"name":"foot_r","parent":"foot_r","color":{}},{"z":11,"name":"thigh_1_r","parent":"thigh_1_r","color":{}},{"z":12,"name":"calf_r","parent":"calf_r","color":{}},{"z":13,"name":"thigh_r","parent":"thigh_r","color":{}},{"z":14,"name":"shouder_r","parent":"shouder_r","color":{}},{"z":15,"name":"weapon_r","parent":"weapon_r","color":{}}]},{"animation":[{"frame":[],"slot":[{"colorFrame":[],"displayFrame":[],"name":"back"},{"colorFrame":[],"displayFrame":[],"name":"front"}],"bone":[{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"fire"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"root"}],"duration":0,"name":"idle","ffd":[]},{"frame":[{"duration":0,"tweenEasing":null,"events":[{"name":"fire","bone":"fire"}]}],"slot":[{"colorFrame":[{"duration":1},{"duration":1},{"duration":0}],"displayFrame":[{"duration":1},{"value":1,"duration":1},{"value":2,"duration":0}],"name":"front"},{"colorFrame":[],"displayFrame":[],"name":"back"}],"bone":[{"translateFrame":[{"duration":2}],"rotateFrame":[{"duration":2}],"scaleFrame":[{"duration":2}],"name":"fire"},{"translateFrame":[{"duration":2}],"rotateFrame":[{"duration":2}],"scaleFrame":[{"duration":2}],"name":"root"}],"duration":2,"name":"fire_01","ffd":[]},{"frame":[],"slot":[{"colorFrame":[{"duration":2},{"duration":2},{"duration":2},{"duration":0}],"displayFrame":[{"duration":2},{"value":1,"duration":2},{"value":2,"duration":2},{"duration":0}],"name":"front"},{"colorFrame":[],"displayFrame":[],"name":"back"}],"playTimes":0,"bone":[{"translateFrame":[{"duration":6}],"rotateFrame":[{"duration":6}],"scaleFrame":[{"duration":6}],"name":"fire"},{"translateFrame":[{"duration":6}],"rotateFrame":[{"duration":6}],"scaleFrame":[{"duration":6}],"name":"root"}],"duration":6,"name":"prepare_01","ffd":[]}],"type":"Armature","frameRate":24,"aabb":{"width":151.9727,"y":-21.0345,"height":44,"x":-68.0006},"defaultActions":[{"gotoAndPlay":"idle"}],"skin":[{"slot":[{"display":[{"path":"weapon_1502b_folder/back_l","type":"image","name":"weapon_1502b_folder/back_l","transform":{"y":0.9655,"skX":-1.9759,"x":-10.0006,"skY":-1.9759}}],"name":"back"},{"display":[{"path":"weapon_1502b_folder/image/paoguan_0001","type":"image","name":"weapon_1502b_folder/image/paoguan_0001","transform":{"y":-2.6705,"skX":-1.9759,"x":36.9721,"skY":-1.9759}},{"path":"weapon_1502b_folder/image/paoguan_0002","type":"image","name":"weapon_1502b_folder/image/paoguan_0002","transform":{"y":-2.6705,"skX":-1.9759,"x":36.9721,"skY":-1.9759}},{"path":"weapon_1502b_folder/image/paoguan_0003","type":"image","name":"weapon_1502b_folder/image/paoguan_0003","transform":{"y":-2.6705,"skX":-1.9759,"x":36.9721,"skY":-1.9759}}],"name":"front"}],"name":""}],"bone":[{"name":"root","transform":{}},{"inheritScale":false,"transform":{"y":-8,"x":81},"name":"fire","parent":"root"}],"ik":[],"name":"weapon_1502b_l","slot":[{"name":"back","parent":"root","color":{}},{"z":1,"name":"front","parent":"root","color":{}}]},{"animation":[{"frame":[],"slot":[{"colorFrame":[],"displayFrame":[],"name":"back"},{"colorFrame":[],"displayFrame":[],"name":"front"}],"bone":[{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"fire"},{"translateFrame":[{"duration":0}],"rotateFrame":[{"duration":0}],"scaleFrame":[{"duration":0}],"name":"root"}],"duration":0,"name":"idle","ffd":[]},{"frame":[{"duration":0,"tweenEasing":null,"events":[{"name":"fire","bone":"fire"}]}],"slot":[{"colorFrame":[{"duration":1},{"duration":1},{"duration":0}],"displayFrame":[{"duration":1},{"value":1,"duration":1},{"value":2,"duration":0}],"name":"front"},{"colorFrame":[],"displayFrame":[],"name":"back"}],"bone":[{"translateFrame":[{"duration":2}],"rotateFrame":[{"duration":2}],"scaleFrame":[{"duration":2}],"name":"fire"},{"translateFrame":[{"duration":2}],"rotateFrame":[{"duration":2}],"scaleFrame":[{"duration":2}],"name":"root"}],"duration":2,"name":"fire_01","ffd":[]},{"frame":[],"slot":[{"colorFrame":[{"duration":2},{"duration":2},{"duration":2},{"duration":0}],"displayFrame":[{"duration":2},{"value":1,"duration":2},{"value":2,"duration":2},{"duration":0}],"name":"front"},{"colorFrame":[],"displayFrame":[],"name":"back"}],"playTimes":0,"bone":[{"translateFrame":[{"duration":6}],"rotateFrame":[{"duration":6}],"scaleFrame":[{"duration":6}],"name":"fire"},{"translateFrame":[{"duration":6}],"rotateFrame":[{"duration":6}],"scaleFrame":[{"duration":6}],"name":"root"}],"duration":6,"name":"prepare_01","ffd":[]}],"type":"Armature","frameRate":24,"aabb":{"width":154.9534,"y":-20.9676,"height":45,"x":-70.9813},"defaultActions":[{"gotoAndPlay":"idle"}],"skin":[{"slot":[{"display":[{"path":"weapon_1502b_folder/image/paoguan_0001","type":"image","name":"weapon_1502b_folder/image/paoguan_0001","transform":{"y":-2.6705,"skX":-1.9759,"x":36.9721,"skY":-1.9759}},{"path":"weapon_1502b_folder/image/paoguan_0002","type":"image","name":"weapon_1502b_folder/image/paoguan_0002","transform":{"y":-2.6705,"skX":-1.9759,"x":36.9721,"skY":-1.9759}},{"path":"weapon_1502b_folder/image/paoguan_0003","type":"image","name":"weapon_1502b_folder/image/paoguan_0003","transform":{"y":-2.6705,"skX":-1.9759,"x":36.9721,"skY":-1.9759}}],"name":"front"},{"display":[{"path":"weapon_1502b_folder/back_r","type":"image","name":"weapon_1502b_folder/back_r","transform":{"y":1.5324,"skX":-1.9759,"x":-10.4813,"skY":-1.9759}}],"name":"back"}],"name":""}],"bone":[{"name":"root","transform":{}},{"inheritScale":false,"transform":{"y":-7,"x":81},"name":"fire","parent":"root"}],"ik":[],"name":"weapon_1502b_r","slot":[{"name":"back","parent":"root","color":{}},{"z":1,"name":"front","parent":"root","color":{}}]}],"isGlobal":0,"name":"mecha_1502b","version":"5.5"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_ske.json.meta b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_ske.json.meta new file mode 100644 index 00000000..2fdf3f06 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "314ebb30-060c-478d-a82d-eae7fe7f43ef", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.json b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.json new file mode 100644 index 00000000..0f5f63c1 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.json @@ -0,0 +1 @@ +{"imagePath":"mecha_1502b_tex.png","width":512,"SubTexture":[{"width":74,"y":93,"height":20,"name":"bullet_01_f/bullet_01","x":307},{"width":48,"y":1,"height":38,"name":"fire_effect_01_f/fireEffect","x":212},{"width":180,"y":430,"height":52,"name":"flame_01_f/ba_bu_flame1","x":1},{"frameX":-2,"frameHeight":234,"y":1,"frameY":0,"frameWidth":86,"width":81,"height":233,"name":"flame_01_f/bbb","x":1},{"width":44,"y":1,"height":39,"name":"mecha_1502b_folder/shouder_l_0","x":319},{"width":29,"y":77,"height":106,"name":"mecha_1502b_folder/foot_l_0","x":434},{"width":50,"y":185,"height":32,"name":"mecha_1502b_folder/thigh_1_l_0","x":434},{"width":122,"y":177,"height":46,"name":"mecha_1502b_folder/calf_l","x":84},{"width":101,"y":118,"height":57,"name":"mecha_1502b_folder/thigh_l","x":84},{"width":41,"y":77,"height":65,"name":"mecha_1502b_folder/pelvis","x":465},{"width":89,"y":236,"height":192,"name":"mecha_1502b_folder/chest","x":1},{"width":29,"y":77,"height":109,"name":"mecha_1502b_folder/foot_r","x":403},{"width":55,"y":1,"height":32,"name":"mecha_1502b_folder/thigh_1_r_1","x":262},{"width":126,"y":1,"height":52,"name":"mecha_1502b_folder/calf_r","x":84},{"width":103,"y":55,"height":61,"name":"mecha_1502b_folder/thigh_r","x":84},{"width":43,"y":144,"height":39,"name":"mecha_1502b_folder/shouder_r_1","x":465},{"width":116,"y":55,"height":44,"name":"weapon_1502b_folder/back_l","x":189},{"frameX":0,"frameHeight":36,"y":39,"frameY":0,"frameWidth":94,"width":93,"height":36,"name":"weapon_1502b_folder/image/paoguan_0002","x":403},{"width":94,"y":1,"height":36,"name":"weapon_1502b_folder/image/paoguan_0001","x":403},{"width":94,"y":55,"height":36,"name":"weapon_1502b_folder/image/paoguan_0003","x":307},{"width":121,"y":118,"height":45,"name":"weapon_1502b_folder/back_r","x":187}],"height":512,"name":"mecha_1502b"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.json.meta b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.json.meta new file mode 100644 index 00000000..3b435a6f --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "183b5daf-cb0b-478d-a2c4-c5dbd4c75703", + "atlasJson": "{\"imagePath\":\"mecha_1502b_tex.png\",\"width\":512,\"SubTexture\":[{\"width\":74,\"y\":93,\"height\":20,\"name\":\"bullet_01_f/bullet_01\",\"x\":307},{\"width\":48,\"y\":1,\"height\":38,\"name\":\"fire_effect_01_f/fireEffect\",\"x\":212},{\"width\":180,\"y\":430,\"height\":52,\"name\":\"flame_01_f/ba_bu_flame1\",\"x\":1},{\"frameX\":-2,\"frameHeight\":234,\"y\":1,\"frameY\":0,\"frameWidth\":86,\"width\":81,\"height\":233,\"name\":\"flame_01_f/bbb\",\"x\":1},{\"width\":44,\"y\":1,\"height\":39,\"name\":\"mecha_1502b_folder/shouder_l_0\",\"x\":319},{\"width\":29,\"y\":77,\"height\":106,\"name\":\"mecha_1502b_folder/foot_l_0\",\"x\":434},{\"width\":50,\"y\":185,\"height\":32,\"name\":\"mecha_1502b_folder/thigh_1_l_0\",\"x\":434},{\"width\":122,\"y\":177,\"height\":46,\"name\":\"mecha_1502b_folder/calf_l\",\"x\":84},{\"width\":101,\"y\":118,\"height\":57,\"name\":\"mecha_1502b_folder/thigh_l\",\"x\":84},{\"width\":41,\"y\":77,\"height\":65,\"name\":\"mecha_1502b_folder/pelvis\",\"x\":465},{\"width\":89,\"y\":236,\"height\":192,\"name\":\"mecha_1502b_folder/chest\",\"x\":1},{\"width\":29,\"y\":77,\"height\":109,\"name\":\"mecha_1502b_folder/foot_r\",\"x\":403},{\"width\":55,\"y\":1,\"height\":32,\"name\":\"mecha_1502b_folder/thigh_1_r_1\",\"x\":262},{\"width\":126,\"y\":1,\"height\":52,\"name\":\"mecha_1502b_folder/calf_r\",\"x\":84},{\"width\":103,\"y\":55,\"height\":61,\"name\":\"mecha_1502b_folder/thigh_r\",\"x\":84},{\"width\":43,\"y\":144,\"height\":39,\"name\":\"mecha_1502b_folder/shouder_r_1\",\"x\":465},{\"width\":116,\"y\":55,\"height\":44,\"name\":\"weapon_1502b_folder/back_l\",\"x\":189},{\"frameX\":0,\"frameHeight\":36,\"y\":39,\"frameY\":0,\"frameWidth\":94,\"width\":93,\"height\":36,\"name\":\"weapon_1502b_folder/image/paoguan_0002\",\"x\":403},{\"width\":94,\"y\":1,\"height\":36,\"name\":\"weapon_1502b_folder/image/paoguan_0001\",\"x\":403},{\"width\":94,\"y\":55,\"height\":36,\"name\":\"weapon_1502b_folder/image/paoguan_0003\",\"x\":307},{\"width\":121,\"y\":118,\"height\":45,\"name\":\"weapon_1502b_folder/back_r\",\"x\":187}],\"height\":512,\"name\":\"mecha_1502b\"}", + "texture": "bb03f495-80f6-46b2-83a3-08d5996135a0", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.png b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.png new file mode 100644 index 00000000..65167fea Binary files /dev/null and b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.png differ diff --git a/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.png.meta b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.png.meta new file mode 100644 index 00000000..c78b2e16 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_1502b/mecha_1502b_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "bb03f495-80f6-46b2-83a3-08d5996135a0", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "mecha_1502b_tex": { + "ver": "1.0.3", + "uuid": "991e26fb-3e4e-4a2c-8f00-590dd92bf5e9", + "rawTextureUuid": "bb03f495-80f6-46b2-83a3-08d5996135a0", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -1.5, + "offsetY": 14.5, + "trimX": 1, + "trimY": 1, + "width": 507, + "height": 481, + "rawWidth": 512, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_2903.meta b/Cocos/Demos/assets/resources/mecha_2903.meta new file mode 100644 index 00000000..a7e01c79 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_2903.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "37fb5c8c-c568-4544-8d87-a9e9fcf5aa06", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_ske.json b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_ske.json new file mode 100644 index 00000000..ec7f06fd --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_ske.json @@ -0,0 +1 @@ +{"frameRate":25,"name":"mecha_2903","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":25,"name":"mecha_2903","aabb":{"x":-164.84,"y":-197.63,"width":343.98,"height":212.29},"bone":[{"inheritScale":false,"length":11,"name":"pelvis","transform":{"x":-41.2,"y":-49.45,"skX":76.0851,"skY":76.1437,"scX":0.9995,"scY":0.9978}},{"inheritScale":false,"length":33,"name":"chest","parent":"pelvis","transform":{"x":4.3,"y":-15.06,"skX":-49.0173,"skY":-48.9448,"scX":0.9987,"scY":0.9996}},{"inheritScale":false,"length":36,"name":"thigh_l_b","parent":"pelvis","transform":{"x":9.9,"y":0.83,"skX":-177.595,"skY":-177.5957,"scX":0.9938,"scY":0.998}},{"inheritScale":false,"length":31,"name":"thigh_r_b","parent":"pelvis","transform":{"x":20.57,"y":14.15,"skX":155.0643,"skY":155.0181,"scX":0.9466,"scY":0.9952}},{"inheritScale":false,"length":13,"name":"tail","parent":"chest","transform":{"x":-32.21,"y":16.45,"skX":152.8011,"skY":152.8011,"scX":0.999}},{"inheritScale":false,"length":33,"name":"thigh_r_m","parent":"chest","transform":{"x":24.87,"y":21.17,"skX":-134.049,"skY":-134.0888,"scX":0.9415,"scY":0.9973}},{"inheritScale":false,"name":"thigh_r_f","parent":"chest","transform":{"x":49.12,"y":9.74,"skX":-87.6376,"skY":-87.637,"scX":0.9261,"scY":0.9958}},{"inheritScale":false,"name":"calf_r_b","parent":"thigh_r_b","transform":{"x":31.66,"y":0.03,"skX":-112.1024,"skY":-112.1024,"scX":1.0071,"scY":0.9958}},{"inheritScale":false,"name":"calf_l_b","parent":"thigh_l_b","transform":{"x":36.26,"y":-0.01,"skX":-151.5258,"skY":-151.5258,"scX":1.0056,"scY":0.9973}},{"inheritScale":false,"length":52,"name":"thigh_l_m","parent":"chest","transform":{"x":26.31,"y":11.26,"skX":-103.9319,"skY":-103.9223,"scX":0.9794,"scY":0.9978}},{"inheritScale":false,"length":17,"name":"neck","parent":"chest","transform":{"x":62.91,"y":-36.34,"skX":-30.6973,"skY":-30.7124,"scX":0.9984,"scY":0.9992}},{"inheritScale":false,"name":"calf_r_f","parent":"chest","transform":{"x":50.6,"y":-21.26,"skX":46.531,"skY":46.5318,"scX":1.0002,"scY":0.9974}},{"inheritScale":false,"length":54,"name":"thigh_l_f","parent":"chest","transform":{"x":50.49,"y":-1.08,"skX":-71.7516,"skY":-71.7533,"scX":1.0058,"scY":0.9951}},{"inheritScale":false,"length":25,"name":"upperarm_r","parent":"neck","transform":{"x":12.28,"y":5.8,"skX":89.6493,"skY":89.4553,"scX":0.8704,"scY":0.9994}},{"inheritScale":false,"name":"calf_r_m","parent":"thigh_r_m","transform":{"x":33.64,"y":-0.03,"skX":-154.1031,"skY":-154.1031,"scX":1.0062,"scY":0.9984}},{"inheritScale":false,"length":14,"name":"upperarm_l","parent":"neck","transform":{"x":23,"y":-8.68,"skX":63.7558,"skY":63.7438,"scX":0.9979,"scY":0.9956}},{"inheritScale":false,"name":"calf_l_m","parent":"thigh_l_m","transform":{"x":52.2,"y":-0.04,"skX":153.9595,"skY":153.9612,"scX":1.0523,"scY":0.9979}},{"inheritScale":false,"name":"calf_l_f","parent":"thigh_l_f","transform":{"x":54.21,"y":0.02,"skX":92.9449,"skY":92.9425,"scX":1.0255,"scY":0.9951}},{"inheritScale":false,"length":14,"name":"tail1","parent":"tail","transform":{"x":13.12,"skX":4.4887,"skY":4.489,"scX":0.9995,"scY":0.9992}},{"inheritScale":false,"name":"head","parent":"neck","transform":{"x":16.17,"y":2.98,"skX":27.3048,"skY":27.3048,"scX":0.9984,"scY":0.9963}},{"inheritScale":false,"length":15,"name":"tail2","parent":"tail1","transform":{"x":14.68,"y":-0.02,"skX":2.5013,"skY":2.5,"scX":1.0041,"scY":0.9988}},{"inheritScale":false,"length":52,"name":"forearm_r","parent":"upperarm_r","transform":{"x":25.98,"y":0.01,"skX":-83.6035,"skY":-82.0181,"scX":1.0451,"scY":1.0012}},{"inheritScale":false,"length":52,"name":"forearm_l","parent":"upperarm_l","transform":{"x":14.81,"y":0.02,"skX":-57.0604,"skY":-56.8154,"scX":1.0093,"scY":0.9981}},{"inheritScale":false,"name":"hand_r","parent":"forearm_r","transform":{"x":52.25,"y":15.11,"skX":11.5959,"skY":11.5959,"scX":1.0136,"scY":0.9974}},{"inheritScale":false,"name":"hand_l_1","parent":"forearm_l","transform":{"x":50.61,"y":-10.36,"skX":0.3373,"skY":0.3373,"scX":0.9538,"scY":0.9994}},{"inheritScale":false,"name":"hand_r_1","parent":"forearm_r","transform":{"x":52.55,"y":-15.2,"skX":-3.4237,"skY":-3.4229,"scX":1.0252}},{"inheritScale":false,"name":"hand_l","parent":"forearm_l","transform":{"x":54.96,"y":10.3,"skX":14.1078,"skY":14.1086,"scX":0.9875,"scY":0.9972}},{"inheritScale":false,"length":18,"name":"tail3","parent":"tail2","transform":{"x":15.59,"y":-0.01,"skX":12.0898,"skY":12.0875,"scX":1.0078,"scY":0.9969}},{"inheritScale":false,"length":13,"name":"tail4","parent":"tail3","transform":{"x":18.23,"y":-0.01,"skX":11.9206,"skY":11.924,"scX":1.0137,"scY":0.9956}},{"inheritScale":false,"length":14,"name":"tail5","parent":"tail4","transform":{"x":13.12,"y":-0.03,"skX":15.3695,"skY":15.3699,"scX":1.0114,"scY":0.9951}},{"inheritScale":false,"length":19,"name":"tail6","parent":"tail5","transform":{"x":14.65,"y":-0.02,"skX":27.4879,"skY":27.4813,"scX":0.9931,"scY":0.9974}},{"inheritScale":false,"length":17,"name":"tail7","parent":"tail6","transform":{"x":19.5,"y":0.02,"skX":22.363,"skY":22.3635,"scX":0.9991,"scY":0.9988}},{"inheritScale":false,"length":22,"name":"tail8","parent":"tail7","transform":{"x":17.52,"skX":24.9254,"skY":24.8834,"scX":0.9789,"scY":0.9955}},{"inheritScale":false,"length":32,"name":"tail9","parent":"tail8","transform":{"x":22.55,"y":0.02,"skX":11.6352,"skY":11.6109,"scX":0.9945,"scY":0.9954}},{"inheritScale":false,"name":"weapon","parent":"tail9","transform":{"x":32.01,"y":0.02,"skX":26.257,"skY":26.2593,"scX":0.9948,"scY":0.9978}}],"slot":[{"name":"calf_l_m","parent":"calf_l_m"},{"name":"calf_l_f","parent":"calf_l_f"},{"name":"calf_l_b","parent":"calf_l_b"},{"name":"forearm_l","parent":"forearm_l"},{"name":"upperarm_l","parent":"upperarm_l"},{"name":"hand_l","parent":"hand_l"},{"name":"hand_l_1","parent":"hand_l_1"},{"name":"thigh_l_f","parent":"thigh_l_f"},{"name":"thigh_l_m","parent":"thigh_l_m"},{"name":"thigh_l_b","parent":"thigh_l_b"},{"name":"tail9","parent":"tail9"},{"name":"tail8","parent":"tail8"},{"name":"tail7","parent":"tail7"},{"name":"tail6","parent":"tail6"},{"name":"tail5","parent":"tail5"},{"name":"tail4","parent":"tail4"},{"name":"tail3","parent":"tail3"},{"name":"tail2","parent":"tail2"},{"name":"tail1","parent":"tail1"},{"name":"tail","parent":"tail"},{"name":"pelvis","parent":"pelvis"},{"name":"chest","parent":"chest"},{"name":"neck","parent":"neck"},{"name":"head","parent":"head"},{"name":"weapon","parent":"weapon"},{"name":"thigh_r_b","parent":"thigh_r_b"},{"name":"thigh_r_m","parent":"thigh_r_m"},{"name":"thigh_r_f","parent":"thigh_r_f"},{"name":"upperarm_r","parent":"upperarm_r"},{"name":"forearm_r","parent":"forearm_r"},{"name":"hand_r_1","parent":"hand_r_1"},{"name":"hand_r","parent":"hand_r"},{"name":"calf_r_b","parent":"calf_r_b"},{"name":"calf_r_m","parent":"calf_r_m"},{"name":"calf_r_f","parent":"calf_r_f"}],"skin":[{"name":"","slot":[{"name":"tail8","display":[{"name":"mecha_2903_folder/textures/tail8_1","transform":{"x":8.45,"y":-3.3,"skX":1.2,"skY":1.2}}]},{"name":"thigh_r_b","display":[{"name":"mecha_2903_folder/textures/thigh_r_b_1","transform":{"x":14.05,"y":2.1,"skX":0.47,"skY":0.47}}]},{"name":"tail4","display":[{"name":"mecha_2903_folder/tail4","transform":{"x":10,"y":-2,"skX":0.07,"skY":0.07}}]},{"name":"calf_l_b","display":[{"name":"mecha_2903_folder/calf_l_b","transform":{"x":18,"y":4.55}}]},{"name":"tail","display":[{"name":"mecha_2903_folder/tail","transform":{"x":7.5,"y":-0.5}}]},{"name":"calf_r_f","display":[{"name":"mecha_2903_folder/calf_r_f","transform":{"x":25.5,"y":0.95}}]},{"name":"hand_l_1","display":[{"name":"mecha_2903_folder/textures/hand_l_1_0","transform":{"x":15.1,"y":1}}]},{"name":"hand_r","display":[{"name":"mecha_2903_folder/textures/hand_r_0","transform":{"x":21.55,"y":3.05}}]},{"name":"tail9","display":[{"name":"mecha_2903_folder/textures/tail9_1","transform":{"x":14.25,"y":0.25,"skX":13.2,"skY":13.2}}]},{"name":"thigh_r_f","display":[{"name":"mecha_2903_folder/textures/thigh_r_f_2","transform":{"x":17.55,"y":-1}}]},{"name":"tail5","display":[{"name":"mecha_2903_folder/textures/tail5_1","transform":{"x":5.45,"y":-2.45,"skX":0.01,"skY":0.01}}]},{"name":"calf_l_f","display":[{"name":"mecha_2903_folder/textures/calf_l_f_1","transform":{"x":20,"y":0.05}}]},{"name":"tail1","display":[{"name":"mecha_2903_folder/tail1","transform":{"x":10.45,"y":-1.5,"skX":0.26,"skY":0.26}}]},{"name":"hand_l","display":[{"name":"mecha_2903_folder/hand_l","transform":{"x":21.5,"y":3.5}}]},{"name":"calf_r_b","display":[{"name":"mecha_2903_folder/calf_r_b","transform":{"x":29.5,"y":5}}]},{"name":"thigh_l_b","display":[{"name":"mecha_2903_folder/textures/thigh_l_b_1","transform":{"x":15,"y":-0.45,"skX":-0.06,"skY":-0.06}}]},{"name":"upperarm_r","display":[{"name":"mecha_2903_folder/textures/upperarm_r_0","transform":{"x":5.5,"y":-0.4,"skX":0.7,"skY":0.7}}]},{"name":"thigh_r_m","display":[{"name":"mecha_2903_folder/textures/thigh_r_m_0","transform":{"x":19,"y":-1.35,"skX":0.35,"skY":0.35}}]},{"name":"tail6","display":[{"name":"mecha_2903_folder/textures/tail6_1","transform":{"x":11.05,"y":-1.9,"skX":0.63,"skY":0.63}}]},{"name":"neck","display":[{"name":"mecha_2903_folder/neck","transform":{"x":2.3,"y":-1.1,"skX":10.26,"skY":10.26}}]},{"name":"head","display":[{"name":"mecha_2903_folder/head","transform":{"x":16,"y":-5}}]},{"name":"weapon","display":[{"name":"mecha_2903_folder/weapon","transform":{"x":27.95,"y":-0.5}}]},{"name":"upperarm_l","display":[{"name":"mecha_2903_folder/textures/upperarm_l_2","transform":{"x":2.4,"y":-1.05,"skX":-2.56,"skY":-2.56}}]},{"name":"chest","display":[{"name":"mecha_2903_folder/chest","transform":{"x":30,"y":-19.1,"skX":-27.66,"skY":-27.66}}]},{"name":"thigh_l_m","display":[{"name":"mecha_2903_folder/thigh_l_m","transform":{"x":26.5,"y":-2.6,"skX":-0.26,"skY":-0.26}}]},{"name":"forearm_r","display":[{"name":"mecha_2903_folder/forearm_r","transform":{"x":24.4,"y":0.4,"skX":16.38,"skY":16.38}}]},{"name":"tail7","display":[{"name":"mecha_2903_folder/textures/tail7_1","transform":{"x":9,"y":-2.4,"skX":0.79,"skY":0.79}}]},{"name":"calf_r_m","display":[{"name":"mecha_2903_folder/calf_r_m","transform":{"x":26.95,"y":5.05}}]},{"name":"calf_l_m","display":[{"name":"mecha_2903_folder/calf_l_m","transform":{"x":17,"y":0.95}}]},{"name":"tail3","display":[{"name":"mecha_2903_folder/tail3","transform":{"x":9.5,"y":-2.55,"skX":-0.05,"skY":-0.05}}]},{"name":"tail2","display":[{"name":"mecha_2903_folder/tail2","transform":{"x":10.5,"y":-2.05,"skX":0.01,"skY":0.01}}]},{"name":"forearm_l","display":[{"name":"mecha_2903_folder/forearm_l","transform":{"x":24.45,"y":-3.15,"skX":10.47,"skY":10.47}}]},{"name":"pelvis","display":[{"name":"mecha_2903_folder/pelvis","transform":{"x":-4.4,"y":0.8,"skX":-74.11,"skY":-74.11}}]},{"name":"thigh_l_f","display":[{"name":"mecha_2903_folder/textures/thigh_l_f_0","transform":{"x":27.5,"y":-1.15,"skX":-0.07,"skY":-0.07}}]},{"name":"hand_r_1","display":[{"name":"mecha_2903_folder/textures/hand_r_1_0","transform":{"x":15,"y":3.45}}]}]}],"animation":[{"duration":0,"playTimes":0,"fadeInTime":0.2,"name":"idle"}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":25,"name":"mecha_2903d","aabb":{"x":-191.62,"y":-229.33,"width":387.99,"height":256.85},"bone":[{"inheritScale":false,"length":11,"name":"pelvis","transform":{"x":-41.2,"y":-49.45,"skX":76.0851,"skY":76.1437,"scX":0.9995,"scY":0.9978}},{"inheritScale":false,"length":33,"name":"chest","parent":"pelvis","transform":{"x":4.3,"y":-15.06,"skX":-49.0173,"skY":-48.9448,"scX":0.9987,"scY":0.9996}},{"inheritScale":false,"length":36,"name":"thigh_l_b","parent":"pelvis","transform":{"x":9.9,"y":0.83,"skX":-177.595,"skY":-177.5957,"scX":0.9938,"scY":0.998}},{"inheritScale":false,"length":31,"name":"thigh_r_b","parent":"pelvis","transform":{"x":20.57,"y":14.15,"skX":155.0643,"skY":155.0181,"scX":0.9466,"scY":0.9952}},{"inheritScale":false,"length":13,"name":"tail","parent":"chest","transform":{"x":-32.21,"y":16.45,"skX":152.8011,"skY":152.8011,"scX":0.999}},{"inheritScale":false,"length":33,"name":"thigh_r_m","parent":"chest","transform":{"x":24.87,"y":21.17,"skX":-134.049,"skY":-134.0888,"scX":0.9415,"scY":0.9973}},{"inheritScale":false,"name":"thigh_r_f","parent":"chest","transform":{"x":49.12,"y":9.74,"skX":-87.6376,"skY":-87.637,"scX":0.9261,"scY":0.9958}},{"inheritScale":false,"name":"calf_r_b","parent":"thigh_r_b","transform":{"x":31.66,"y":0.03,"skX":-112.1024,"skY":-112.1024,"scX":1.0071,"scY":0.9958}},{"inheritScale":false,"name":"calf_l_b","parent":"thigh_l_b","transform":{"x":36.26,"y":-0.01,"skX":-151.5258,"skY":-151.5258,"scX":1.0056,"scY":0.9973}},{"inheritScale":false,"length":52,"name":"thigh_l_m","parent":"chest","transform":{"x":26.31,"y":11.26,"skX":-103.9319,"skY":-103.9223,"scX":0.9794,"scY":0.9978}},{"inheritScale":false,"length":17,"name":"neck","parent":"chest","transform":{"x":62.91,"y":-36.34,"skX":-30.6973,"skY":-30.7124,"scX":0.9984,"scY":0.9992}},{"inheritScale":false,"name":"calf_r_f","parent":"chest","transform":{"x":50.6,"y":-21.26,"skX":46.531,"skY":46.5318,"scX":1.0002,"scY":0.9974}},{"inheritScale":false,"length":54,"name":"thigh_l_f","parent":"chest","transform":{"x":50.49,"y":-1.08,"skX":-71.7516,"skY":-71.7533,"scX":1.0058,"scY":0.9951}},{"inheritScale":false,"length":14,"name":"upperarm_l","parent":"neck","transform":{"x":23,"y":-8.68,"skX":63.7558,"skY":63.7438,"scX":0.9979,"scY":0.9956}},{"inheritScale":false,"name":"calf_r_m","parent":"thigh_r_m","transform":{"x":33.64,"y":-0.03,"skX":-154.1031,"skY":-154.1031,"scX":1.0062,"scY":0.9984}},{"inheritScale":false,"length":25,"name":"upperarm_r","parent":"neck","transform":{"x":12.28,"y":5.8,"skX":89.6493,"skY":89.4553,"scX":0.8704,"scY":0.9994}},{"inheritScale":false,"name":"calf_l_f","parent":"thigh_l_f","transform":{"x":54.21,"y":0.02,"skX":92.9449,"skY":92.9425,"scX":1.0255,"scY":0.9951}},{"inheritScale":false,"name":"calf_l_m","parent":"thigh_l_m","transform":{"x":52.2,"y":-0.04,"skX":153.9595,"skY":153.9612,"scX":1.0523,"scY":0.9979}},{"inheritScale":false,"length":14,"name":"tail1","parent":"tail","transform":{"x":13.12,"skX":4.4887,"skY":4.489,"scX":0.9995,"scY":0.9992}},{"inheritScale":false,"name":"head","parent":"neck","transform":{"x":16.17,"y":2.98,"skX":27.3048,"skY":27.3048,"scX":0.9984,"scY":0.9963}},{"inheritScale":false,"length":15,"name":"tail2","parent":"tail1","transform":{"x":14.68,"y":-0.02,"skX":2.5013,"skY":2.5,"scX":1.0041,"scY":0.9988}},{"inheritScale":false,"length":52,"name":"forearm_r","parent":"upperarm_r","transform":{"x":25.98,"y":0.01,"skX":-83.6035,"skY":-82.0181,"scX":1.0451,"scY":1.0012}},{"inheritScale":false,"length":52,"name":"forearm_l","parent":"upperarm_l","transform":{"x":14.81,"y":0.02,"skX":-57.0604,"skY":-56.8154,"scX":1.0093,"scY":0.9981}},{"inheritScale":false,"name":"hand_r","parent":"forearm_r","transform":{"x":52.25,"y":15.11,"skX":11.5959,"skY":11.5959,"scX":1.0136,"scY":0.9974}},{"inheritScale":false,"name":"hand_l_1","parent":"forearm_l","transform":{"x":50.61,"y":-10.36,"skX":0.3373,"skY":0.3373,"scX":0.9538,"scY":0.9994}},{"inheritScale":false,"name":"hand_r_1","parent":"forearm_r","transform":{"x":52.55,"y":-15.2,"skX":-3.4237,"skY":-3.4229,"scX":1.0252}},{"inheritScale":false,"name":"hand_l","parent":"forearm_l","transform":{"x":54.96,"y":10.3,"skX":14.1078,"skY":14.1086,"scX":0.9875,"scY":0.9972}},{"inheritScale":false,"length":18,"name":"tail3","parent":"tail2","transform":{"x":15.59,"y":-0.01,"skX":12.0898,"skY":12.0875,"scX":1.0078,"scY":0.9969}},{"inheritScale":false,"length":13,"name":"tail4","parent":"tail3","transform":{"x":18.23,"y":-0.01,"skX":11.9206,"skY":11.924,"scX":1.0137,"scY":0.9956}},{"inheritScale":false,"length":14,"name":"tail5","parent":"tail4","transform":{"x":13.12,"y":-0.03,"skX":15.3695,"skY":15.3699,"scX":1.0114,"scY":0.9951}},{"inheritScale":false,"length":19,"name":"tail6","parent":"tail5","transform":{"x":14.65,"y":-0.02,"skX":27.4879,"skY":27.4813,"scX":0.9931,"scY":0.9974}},{"inheritScale":false,"length":17,"name":"tail7","parent":"tail6","transform":{"x":19.5,"y":0.02,"skX":22.363,"skY":22.3635,"scX":0.9991,"scY":0.9988}},{"inheritScale":false,"length":22,"name":"tail8","parent":"tail7","transform":{"x":17.52,"skX":24.9254,"skY":24.8834,"scX":0.9789,"scY":0.9955}},{"inheritScale":false,"length":32,"name":"tail9","parent":"tail8","transform":{"x":22.55,"y":0.02,"skX":7.975,"skY":7.9443,"scX":0.9946,"scY":0.9953}},{"inheritScale":false,"name":"weapon","parent":"tail9","transform":{"x":32.91,"skX":29.9236,"skY":29.9259,"scX":0.9948,"scY":0.9978}}],"slot":[{"name":"calf_l_f","parent":"calf_l_f"},{"name":"calf_l_m","parent":"calf_l_m"},{"name":"calf_l_b","parent":"calf_l_b"},{"name":"forearm_l","parent":"forearm_l"},{"name":"upperarm_l","parent":"upperarm_l"},{"name":"hand_l","parent":"hand_l"},{"name":"hand_l_1","parent":"hand_l_1"},{"name":"thigh_l_f","parent":"thigh_l_f"},{"name":"thigh_l_m","parent":"thigh_l_m"},{"name":"thigh_l_b","parent":"thigh_l_b"},{"name":"tail9","parent":"tail9"},{"name":"tail8","parent":"tail8"},{"name":"tail7","parent":"tail7"},{"name":"tail6","parent":"tail6"},{"name":"tail5","parent":"tail5"},{"name":"tail4","parent":"tail4"},{"name":"tail3","parent":"tail3"},{"name":"tail2","parent":"tail2"},{"name":"tail1","parent":"tail1"},{"name":"tail","parent":"tail"},{"name":"weapon","parent":"weapon"},{"name":"pelvis","parent":"pelvis"},{"name":"chest","parent":"chest"},{"name":"neck","parent":"neck"},{"name":"head","parent":"head"},{"name":"thigh_r_b","parent":"thigh_r_b"},{"name":"thigh_r_m","parent":"thigh_r_m"},{"name":"thigh_r_f","parent":"thigh_r_f"},{"name":"upperarm_r","parent":"upperarm_r"},{"name":"forearm_r","parent":"forearm_r"},{"name":"hand_r_1","parent":"hand_r_1"},{"name":"hand_r","parent":"hand_r"},{"name":"calf_r_b","parent":"calf_r_b"},{"name":"calf_r_m","parent":"calf_r_m"},{"name":"calf_r_f","parent":"calf_r_f"},{"displayIndex":1,"name":"weapon_box","parent":"weapon"},{"name":"hand_r_boundingBox","parent":"hand_r"},{"name":"hand_r_1_boundingBox","parent":"hand_r_1"}],"skin":[{"name":"","slot":[{"name":"thigh_l_f","display":[{"name":"mecha_2903d_folder/textures/thigh_l_f_0","transform":{"x":27.5,"y":-1.15,"skX":-0.07,"skY":-0.07}}]},{"name":"weapon","display":[{"name":"mecha_2903d_folder/textures/tail10_3","transform":{"x":25.45,"y":-7}}]},{"name":"weapon_box","display":[{"type":"boundingBox","name":"pelvis_boundingBox","subType":"polygon","vertices":[2.58,61.43,-33.48,154.91,96.18,97.4]},{"type":"boundingBox","name":"pelvis_boundingBox1","subType":"polygon","vertices":[0.17,48.23,-28.52,28.12,-15.58,24.61,-46.21,-3.8,-13.97,-12.68,-48.93,-55.2,-0.52,-22.86,-11.45,-66.21,26.3,-27.04,72.17,-22.74,111.32,40.4,61.15,32.8]}]},{"name":"tail3","display":[{"name":"mecha_2903d_folder/tail3","transform":{"x":12,"y":-0.45,"skX":-0.05,"skY":-0.05}}]},{"name":"hand_r","display":[{"name":"mecha_2903d_folder/textures/hand_r_0","transform":{"x":12.55}}]},{"name":"tail4","display":[{"name":"mecha_2903d_folder/tail4","transform":{"x":10,"y":-2,"skX":0.07,"skY":0.07}}]},{"name":"tail7","display":[{"name":"mecha_2903d_folder/textures/tail7_1","transform":{"x":13.3,"y":-25.8,"skX":0.79,"skY":0.79}}]},{"name":"forearm_l","display":[{"name":"mecha_2903d_folder/forearm_l","transform":{"x":19.95,"y":-3.5,"skX":10.47,"skY":10.47}}]},{"name":"tail8","display":[{"name":"mecha_2903d_folder/textures/tail8_1","transform":{"x":17.05,"y":-29.15,"skX":1.2,"skY":1.2}}]},{"name":"thigh_l_m","display":[{"name":"mecha_2903d_folder/thigh_l_m","transform":{"x":26.5,"y":-2.6,"skX":-0.26,"skY":-0.26}}]},{"name":"thigh_r_m","display":[{"name":"mecha_2903d_folder/textures/thigh_r_m_0","transform":{"x":19,"y":-1.35,"skX":0.35,"skY":0.35}}]},{"name":"chest","display":[{"name":"mecha_2903d_folder/chest","transform":{"x":18.7,"y":-26.75,"skX":-27.66,"skY":-27.66}}]},{"name":"tail2","display":[{"name":"mecha_2903d_folder/tail2","transform":{"x":13.5,"y":0.45,"skX":0.01,"skY":0.01}}]},{"name":"calf_l_f","display":[{"name":"mecha_2903d_folder/textures/calf_l_f_1","transform":{"x":13.05,"y":1.05}}]},{"name":"thigh_r_b","display":[{"name":"mecha_2903d_folder/textures/thigh_r_b_1","transform":{"x":14.05,"y":2.1,"skX":0.47,"skY":0.47}}]},{"name":"upperarm_l","display":[{"name":"mecha_2903d_folder/textures/upperarm_l_2","transform":{"x":2.4,"y":-1.05,"skX":-2.56,"skY":-2.56}}]},{"name":"thigh_l_b","display":[{"name":"mecha_2903d_folder/textures/thigh_l_b_1","transform":{"x":15,"y":-0.45,"skX":-0.06,"skY":-0.06}}]},{"name":"hand_r_1","display":[{"name":"mecha_2903d_folder/textures/hand_r_1_0","transform":{"x":9.5,"y":1.5}}]},{"name":"pelvis","display":[{"name":"mecha_2903d_folder/pelvis","transform":{"x":-5.25,"y":3.75,"skX":-74.11,"skY":-74.11}}]},{"name":"calf_r_m","display":[{"name":"mecha_2903d_folder/calf_r_m","transform":{"x":19,"y":3.55}}]},{"name":"calf_r_f","display":[{"name":"mecha_2903d_folder/calf_r_f","transform":{"x":17.5,"y":3.5}}]},{"name":"neck","display":[{"name":"mecha_2903d_folder/neck","transform":{"x":-5.2,"y":-24.35,"skX":10.26,"skY":10.26}}]},{"name":"hand_r_1_boundingBox","display":[{"type":"boundingBox","name":"hand_r_1_boundingBox","subType":"polygon","vertices":[23.89,5.29,3.59,6.34,-16.59,-8.22,26.44,-6.31,47.35,11.39]}]},{"name":"tail5","display":[{"name":"mecha_2903d_folder/textures/tail5_1","transform":{"x":7,"y":-13.95,"skX":0.01,"skY":0.01}}]},{"name":"hand_l","display":[{"name":"mecha_2903d_folder/hand_l","transform":{"x":11.95,"y":1}}]},{"name":"tail6","display":[{"name":"mecha_2903d_folder/textures/tail6_1","transform":{"x":15.15,"y":-18.8,"skX":0.63,"skY":0.63}}]},{"name":"upperarm_r","display":[{"name":"mecha_2903d_folder/textures/upperarm_r_0","transform":{"x":5.5,"y":-0.4,"skX":0.7,"skY":0.7}}]},{"name":"calf_l_m","display":[{"name":"mecha_2903d_folder/calf_l_m","transform":{"x":12.55,"y":2}}]},{"name":"forearm_r","display":[{"name":"mecha_2903d_folder/forearm_r","transform":{"x":18.65,"y":-1.3,"skX":16.38,"skY":16.38}}]},{"name":"calf_r_b","display":[{"name":"mecha_2903d_folder/calf_r_b","transform":{"x":20.5,"y":3.5}}]},{"name":"tail","display":[{"name":"mecha_2903d_folder/tail","transform":{"x":11.5,"y":4.5}}]},{"name":"hand_r_boundingBox","display":[{"type":"boundingBox","name":"hand_r_boundingBox","subType":"polygon","vertices":[32.6,10.2,17.06,10.11,8.02,20.73,-39.57,22.17,-7.27,9.6,-0.1,-8.43,26.58,-7.43,66.6,-23.76]}]},{"name":"tail1","display":[{"name":"mecha_2903d_folder/tail1","transform":{"x":13.5,"y":2.05,"skX":0.26,"skY":0.26}}]},{"name":"head","display":[{"name":"mecha_2903d_folder/head","transform":{"x":16,"y":-5}}]},{"name":"hand_l_1","display":[{"name":"mecha_2903d_folder/textures/hand_l_1_0","transform":{"x":10,"y":-0.45}}]},{"name":"thigh_r_f","display":[{"name":"mecha_2903d_folder/textures/thigh_r_f_2","transform":{"x":17.55,"y":-1}}]},{"name":"calf_l_b","display":[{"name":"mecha_2903d_folder/calf_l_b","transform":{"x":12,"y":3}}]},{"name":"tail9","display":[{"name":"mecha_2903d_folder/textures/tail9_1","transform":{"x":14.15,"y":1.2,"skX":16.86,"skY":16.86}}]}]}],"animation":[{"duration":60,"playTimes":0,"fadeInTime":0.2,"name":"idle","bone":[{"name":"calf_l_f","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.07,"y":-0.03},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-5.78},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.02},{"duration":0}]},{"name":"calf_l_m","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.13,"y":-0.07},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-3.53},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.07},{"duration":0}]},{"name":"calf_l_b","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.24,"y":0.08},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-5.52},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.08},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.35,"y":-0.03},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-13.89},{"duration":0}]},{"name":"upperarm_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.8,"y":0.15},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":15.13},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.81},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.25,"y":-0.03},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-4.52},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.95},{"duration":0}]},{"name":"hand_l_1","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-2.16,"y":0.63},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":9.75},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.02},{"duration":0}]},{"name":"thigh_l_f","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.18,"y":0.15},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":8.27},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"thigh_l_m","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.16,"y":0.15},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":2.75},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.92},{"duration":0}]},{"name":"thigh_l_b","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.41,"y":0.54},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-5.19},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.94},{"duration":0}]},{"name":"tail9","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.02},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":6.27},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail8","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.07,"y":0.04},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":6.26},{"duration":0}]},{"name":"tail7","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.09,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":3.51},{"duration":0}]},{"name":"tail6","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.02,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-1.75},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail5","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.06,"y":0.08},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-1.51},{"duration":0}]},{"name":"tail4","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.07,"y":-0.04},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":1},{"duration":0}]},{"name":"tail3","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.01,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-10.52},{"duration":0}]},{"name":"tail2","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.01,"y":0.03},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":5.51},{"duration":0}]},{"name":"tail","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.2,"y":-0.36},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":0.74},{"duration":0}]},{"name":"weapon","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-1.38,"y":-0.48},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-1.1},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-3.25,"y":-7.7},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":4.75},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-1.21,"y":-0.23},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-5.44},{"duration":0}]},{"name":"neck","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.1,"y":0.08},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-3.76},{"duration":0}]},{"name":"head","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.05,"y":-0.1},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":9.06},{"duration":0}]},{"name":"thigh_r_b","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.52,"y":-0.39},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-12.98},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.9},{"duration":0}]},{"name":"thigh_r_m","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.01,"y":0.05},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-6.04},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.86},{"duration":0}]},{"name":"thigh_r_f","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.02,"y":0.09},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":14.55},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.87},{"duration":0}]},{"name":"upperarm_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.33,"y":-0.79},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":14.54},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.09,"y":0.08},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-15.51},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"hand_r_1","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.31,"y":0.79},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":14.84},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.06,"y":0.09},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-6.69},{"duration":0}]},{"name":"calf_r_b","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.29,"y":0.12},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":3.33},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"calf_r_m","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-1.19,"y":0.1},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":3.58},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"calf_r_f","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":6.3,"y":5.17},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":0.99},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.01},{"duration":0}]}]},{"duration":30,"playTimes":0,"fadeInTime":0.2,"name":"walk","bone":[{"name":"calf_l_f","translateFrame":[{"duration":2,"tweenEasing":0,"x":-0.11,"y":0.1},{"duration":5,"tweenEasing":0,"x":-0.15,"y":0.07},{"duration":2,"tweenEasing":0,"x":0.12,"y":-0.05},{"duration":6,"tweenEasing":0,"x":0.23,"y":-0.11},{"duration":2,"tweenEasing":0,"x":0.23,"y":-0.11},{"duration":5,"tweenEasing":0,"x":0.07,"y":-0.12},{"duration":8,"tweenEasing":0,"y":-0.03},{"duration":0,"x":-0.11,"y":0.1}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":33.63},{"duration":5,"tweenEasing":0,"rotate":36.39},{"duration":2,"tweenEasing":0,"rotate":18.83},{"duration":6,"tweenEasing":0,"rotate":8.79},{"duration":2,"tweenEasing":0,"rotate":-25.85},{"duration":5,"tweenEasing":0,"rotate":-32.38},{"duration":8,"tweenEasing":0,"rotate":-9.54},{"duration":0,"rotate":33.63}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":6,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":8,"x":1.02}]},{"name":"calf_l_m","translateFrame":[{"duration":7,"tweenEasing":0,"y":-0.01},{"duration":8,"tweenEasing":0,"x":-0.07,"y":0.15},{"duration":7,"tweenEasing":0,"x":-0.14,"y":-0.09},{"duration":6,"tweenEasing":0,"x":0.47,"y":-0.04},{"duration":2,"tweenEasing":0,"x":0.32,"y":0.09},{"duration":0,"y":-0.01}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":-50.43},{"duration":8,"tweenEasing":0,"rotate":-17.31},{"duration":7,"tweenEasing":0,"rotate":24.26},{"duration":6,"tweenEasing":0,"rotate":-11.75},{"duration":2,"tweenEasing":0,"rotate":-45.88},{"duration":0,"rotate":-50.43}],"scaleFrame":[{"duration":7,"tweenEasing":0,"x":1.19},{"duration":8,"tweenEasing":0,"x":1.12},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":6,"tweenEasing":0,"x":0.85},{"duration":2,"tweenEasing":0,"x":1.07},{"duration":0,"x":1.19}]},{"name":"calf_l_b","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.27,"y":-0.04},{"duration":6,"tweenEasing":0,"x":0.5,"y":-0.32},{"duration":2,"tweenEasing":0,"x":-0.02,"y":0.03},{"duration":2,"tweenEasing":0,"x":-0.61,"y":0.11},{"duration":13,"tweenEasing":0,"x":-0.36,"y":0.01},{"duration":2,"tweenEasing":0,"x":-0.44,"y":0.04},{"duration":0,"x":-0.27,"y":-0.04}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":38.62},{"duration":6,"tweenEasing":0,"rotate":-4.99},{"duration":2,"tweenEasing":0,"rotate":-53.12},{"duration":2,"tweenEasing":0,"rotate":-50.13},{"duration":13,"tweenEasing":0,"rotate":-48.37},{"duration":2,"tweenEasing":0,"rotate":52.17},{"duration":0,"rotate":38.62}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.07},{"duration":6,"tweenEasing":0,"x":0.75},{"duration":2,"tweenEasing":0,"x":1.18},{"duration":2,"tweenEasing":0,"x":1.31},{"duration":13,"tweenEasing":0,"x":1.27},{"duration":2,"tweenEasing":0,"x":1.09},{"duration":0,"x":1.07}]},{"name":"forearm_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":1.17,"y":-0.28},{"duration":2,"tweenEasing":0,"x":0.85,"y":-0.19},{"tweenEasing":0,"x":0.33,"y":-0.17},{"duration":4,"tweenEasing":0,"x":0.16,"y":-0.14},{"duration":3,"tweenEasing":0,"x":0.71,"y":-0.22},{"duration":5,"tweenEasing":0,"x":1.17,"y":-0.28},{"duration":2,"tweenEasing":0,"x":0.85,"y":-0.22},{"tweenEasing":0,"x":0.33,"y":-0.17},{"duration":4,"tweenEasing":0,"x":0.19,"y":-0.16},{"duration":3,"tweenEasing":0,"x":0.7,"y":-0.22},{"duration":0,"x":1.17,"y":-0.28}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-11.05},{"duration":2,"tweenEasing":0,"rotate":-12.81},{"tweenEasing":0,"rotate":-16.58},{"duration":4,"tweenEasing":0,"rotate":-17.84},{"duration":3,"tweenEasing":0,"rotate":-13.81},{"duration":5,"tweenEasing":0,"rotate":-11.05},{"duration":2,"tweenEasing":0,"rotate":-12.81},{"tweenEasing":0,"rotate":-16.58},{"duration":4,"tweenEasing":0,"rotate":-17.84},{"duration":3,"tweenEasing":0,"rotate":-13.81},{"duration":0,"rotate":-11.05}],"scaleFrame":[{"duration":30,"x":0.92}]},{"name":"upperarm_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.01},{"duration":2,"tweenEasing":0,"x":-0.27,"y":2.15},{"tweenEasing":0,"x":-0.39,"y":-0.59},{"duration":4,"tweenEasing":0,"x":-0.24,"y":-2.41},{"duration":3,"tweenEasing":0,"y":-3.37},{"duration":5,"tweenEasing":0,"x":-0.01},{"duration":2,"tweenEasing":0,"x":-0.32,"y":2},{"tweenEasing":0,"x":-0.39,"y":-0.59},{"duration":4,"tweenEasing":0,"x":-0.24,"y":-2.36},{"duration":3,"tweenEasing":0,"x":0.03,"y":-2.92},{"duration":0,"x":-0.01}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-19.96},{"duration":2,"tweenEasing":0,"rotate":-18.93},{"tweenEasing":0,"rotate":-12.94},{"duration":4,"tweenEasing":0,"rotate":-10.34},{"duration":3,"tweenEasing":0,"rotate":-15.98},{"duration":5,"tweenEasing":0,"rotate":-19.96},{"duration":2,"tweenEasing":0,"rotate":-18.93},{"tweenEasing":0,"rotate":-12.94},{"duration":4,"tweenEasing":0,"rotate":-10.34},{"duration":3,"tweenEasing":0,"rotate":-15.98},{"duration":0,"rotate":-19.96}],"scaleFrame":[{"duration":30,"x":1.36}]},{"name":"hand_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":1.63,"y":-0.23},{"duration":2,"tweenEasing":0,"x":1.54,"y":-0.24},{"tweenEasing":0,"x":1.48,"y":-0.15},{"duration":4,"tweenEasing":0,"x":1.48,"y":-0.19},{"duration":3,"tweenEasing":0,"x":1.54,"y":-0.15},{"duration":5,"tweenEasing":0,"x":1.63,"y":-0.23},{"duration":2,"tweenEasing":0,"x":1.62,"y":-0.17},{"tweenEasing":0,"x":1.48,"y":-0.15},{"duration":4,"tweenEasing":0,"x":1.46,"y":-0.19},{"duration":3,"tweenEasing":0,"x":1.53,"y":-0.12},{"duration":0,"x":1.63,"y":-0.23}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-15.63},{"duration":2,"tweenEasing":0,"rotate":-4.1},{"tweenEasing":0,"rotate":-7.37},{"duration":4,"tweenEasing":0,"rotate":-10.64},{"duration":3,"tweenEasing":0,"rotate":-23.67},{"duration":5,"tweenEasing":0,"rotate":-17.38},{"duration":2,"tweenEasing":0,"rotate":-4.1},{"tweenEasing":0,"rotate":-11.39},{"duration":4,"tweenEasing":0,"rotate":-15.66},{"duration":3,"tweenEasing":0,"rotate":-23.42},{"duration":0,"rotate":-15.63}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.79},{"duration":2,"tweenEasing":0,"x":0.81},{"tweenEasing":0,"x":0.8},{"duration":4,"tweenEasing":0,"x":0.8},{"duration":3,"tweenEasing":0,"x":0.78},{"duration":5,"tweenEasing":0,"x":0.79},{"duration":2,"tweenEasing":0,"x":0.81},{"tweenEasing":0,"x":0.8},{"duration":4,"tweenEasing":0,"x":0.79},{"duration":3,"tweenEasing":0,"x":0.78},{"duration":0,"x":0.79}]},{"name":"hand_l_1","translateFrame":[{"duration":5,"tweenEasing":0,"x":-5.99,"y":-7.55},{"duration":2,"tweenEasing":0,"x":-6.07,"y":-7.51},{"tweenEasing":0,"x":-6.09,"y":-7.3},{"duration":4,"tweenEasing":0,"x":-6.1,"y":-7.33},{"duration":3,"tweenEasing":0,"x":-6.05,"y":-7.42},{"duration":5,"tweenEasing":0,"x":-5.99,"y":-7.55},{"duration":2,"tweenEasing":0,"x":-6.04,"y":-7.46},{"tweenEasing":0,"x":-6.09,"y":-7.3},{"duration":4,"tweenEasing":0,"x":-6.12,"y":-7.33},{"duration":3,"tweenEasing":0,"x":-6.06,"y":-7.4},{"duration":0,"x":-5.99,"y":-7.55}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-9.64},{"duration":2,"tweenEasing":0,"rotate":4.16},{"tweenEasing":0,"rotate":7.9},{"duration":4,"tweenEasing":0,"rotate":7.14},{"duration":3,"tweenEasing":0,"rotate":-3.88},{"duration":5,"tweenEasing":0,"rotate":-9.64},{"duration":2,"tweenEasing":0,"rotate":4.16},{"tweenEasing":0,"rotate":7.9},{"duration":4,"tweenEasing":0,"rotate":7.14},{"duration":3,"tweenEasing":0,"rotate":-3.88},{"duration":0,"rotate":-9.64}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.34},{"duration":2,"tweenEasing":0,"x":1.37},{"tweenEasing":0,"x":1.39},{"duration":4,"tweenEasing":0,"x":1.39},{"duration":3,"tweenEasing":0,"x":1.35},{"duration":5,"tweenEasing":0,"x":1.34},{"duration":2,"tweenEasing":0,"x":1.37},{"tweenEasing":0,"x":1.39},{"duration":4,"tweenEasing":0,"x":1.39},{"duration":3,"tweenEasing":0,"x":1.35},{"duration":0,"x":1.34}]},{"name":"thigh_l_f","translateFrame":[{"duration":2,"tweenEasing":0,"x":0.02,"y":0.08},{"duration":5,"tweenEasing":0,"x":2.12,"y":4.28},{"duration":2,"tweenEasing":0,"x":-0.1,"y":0.16},{"duration":6,"tweenEasing":0,"x":-1.79,"y":-2.78},{"duration":2,"tweenEasing":0,"x":0.02,"y":0.08},{"duration":5,"tweenEasing":0,"x":2.11,"y":4.06},{"duration":8,"tweenEasing":0,"x":-0.1,"y":0.16},{"duration":0,"x":0.02,"y":0.08}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-16.32},{"duration":5,"tweenEasing":0,"rotate":-20},{"duration":2,"tweenEasing":0,"rotate":-17.53},{"duration":6,"tweenEasing":0,"rotate":-12.9},{"duration":2,"tweenEasing":0,"rotate":7.28},{"duration":5,"tweenEasing":0,"rotate":17.4},{"duration":8,"tweenEasing":0,"rotate":8.83},{"duration":0,"rotate":-16.32}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":0.96},{"duration":5,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":6,"tweenEasing":0,"x":1.04},{"duration":2,"tweenEasing":0,"x":1.05},{"duration":5,"tweenEasing":0,"x":1.02},{"duration":8,"tweenEasing":0,"x":0.99},{"duration":0,"x":0.96}]},{"name":"thigh_l_m","translateFrame":[{"duration":7,"tweenEasing":0,"x":0.02,"y":0.08},{"duration":8,"tweenEasing":0,"x":-0.14,"y":0.14},{"duration":7,"tweenEasing":0,"x":0.02,"y":0.08},{"duration":6,"tweenEasing":0,"x":-0.14,"y":0.14},{"duration":2,"tweenEasing":0,"x":-0.89,"y":-1.52},{"duration":0,"x":0.02,"y":0.08}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":22.82},{"duration":8,"tweenEasing":0,"rotate":8.56},{"duration":7,"tweenEasing":0,"rotate":-8.51},{"duration":6,"tweenEasing":0,"rotate":1.29},{"duration":2,"tweenEasing":0,"rotate":15.43},{"duration":0,"rotate":22.82}],"scaleFrame":[{"duration":7,"tweenEasing":0,"x":0.95},{"duration":8,"tweenEasing":0,"x":0.93},{"duration":7,"tweenEasing":0,"x":0.95},{"duration":6,"tweenEasing":0,"x":1.11},{"duration":2,"tweenEasing":0,"x":1.07},{"duration":0,"x":0.95}]},{"name":"thigh_l_b","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.06,"y":-0.04},{"duration":6,"tweenEasing":0,"x":-1.69,"y":-0.47},{"duration":2,"tweenEasing":0,"x":-6.21,"y":-1.54},{"duration":2,"tweenEasing":0,"x":-3.11,"y":-0.77},{"duration":13,"tweenEasing":0,"x":0.06,"y":-0.04},{"duration":2,"tweenEasing":0,"x":-3.06,"y":-0.76},{"duration":0,"x":0.06,"y":-0.04}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-16.29},{"duration":6,"tweenEasing":0,"rotate":11.01},{"duration":2,"tweenEasing":0,"rotate":-6.76},{"duration":2,"tweenEasing":0,"rotate":-9.27},{"duration":13,"tweenEasing":0,"rotate":-8.52},{"duration":2,"tweenEasing":0,"rotate":-29.85},{"duration":0,"rotate":-16.29}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.94},{"duration":6,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.76},{"duration":13,"tweenEasing":0,"x":0.87},{"duration":2,"tweenEasing":0,"x":0.87},{"duration":0,"x":0.94}]},{"name":"tail9","translateFrame":[{"duration":7,"tweenEasing":0,"x":0.02,"y":0.03},{"duration":8,"tweenEasing":0,"x":0.1,"y":0.03},{"duration":7,"tweenEasing":0,"x":0.02,"y":0.03},{"duration":8,"tweenEasing":0,"x":0.03,"y":0.09},{"duration":0,"x":0.02,"y":0.03}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":6.27},{"duration":8,"tweenEasing":0,"rotate":5.01},{"duration":7,"tweenEasing":0,"rotate":6.27},{"duration":8,"tweenEasing":0,"rotate":5.26},{"duration":0,"rotate":6.27}]},{"name":"tail8","translateFrame":[{"duration":7,"tweenEasing":0,"x":0.06,"y":0.06},{"duration":8,"tweenEasing":0,"x":0.07,"y":-0.01},{"duration":7,"tweenEasing":0,"x":0.06,"y":0.06},{"duration":8,"tweenEasing":0,"x":0.07,"y":0.03},{"duration":0,"x":0.06,"y":0.06}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":-0.26},{"duration":8,"tweenEasing":0,"rotate":0.96},{"duration":7,"tweenEasing":0,"rotate":-0.26},{"duration":8,"tweenEasing":0,"rotate":0.7},{"duration":0,"rotate":-0.26}]},{"name":"tail7","translateFrame":[{"duration":7,"tweenEasing":0,"x":0.14,"y":0.01},{"duration":8,"tweenEasing":0,"x":0.06,"y":0.1},{"duration":7,"tweenEasing":0,"x":0.14,"y":0.01},{"duration":8,"tweenEasing":0,"x":0.09,"y":0.1},{"duration":0,"x":0.14,"y":0.01}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":-0.5},{"duration":8,"tweenEasing":0,"rotate":-2.48},{"duration":7,"tweenEasing":0,"rotate":-0.5},{"duration":8,"tweenEasing":0,"rotate":-1.73},{"duration":0,"rotate":-0.5}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":1.01},{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail6","translateFrame":[{"duration":7,"tweenEasing":0,"x":0.04,"y":-0.03},{"duration":8,"tweenEasing":0,"x":-0.06,"y":-0.01},{"duration":7,"tweenEasing":0,"x":0.04,"y":-0.03},{"duration":8,"tweenEasing":0,"x":-0.06,"y":-0.05},{"duration":0,"x":0.04,"y":-0.03}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":-11.29},{"duration":8,"tweenEasing":0,"rotate":-10.03},{"duration":7,"tweenEasing":0,"rotate":-11.29},{"duration":8,"tweenEasing":0,"rotate":-10.03},{"duration":0,"rotate":-11.29}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":1.01},{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail5","translateFrame":[{"duration":7,"tweenEasing":0,"x":-0.02,"y":-0.02},{"duration":8,"tweenEasing":0,"x":0.03,"y":0.05},{"duration":7,"tweenEasing":0,"x":-0.02,"y":-0.02},{"duration":8,"tweenEasing":0,"x":-0.05,"y":0.02},{"duration":0,"x":-0.02,"y":-0.02}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":-0.25},{"duration":8,"tweenEasing":0,"rotate":-2.01},{"duration":7,"tweenEasing":0,"rotate":-0.25},{"duration":8,"tweenEasing":0,"rotate":-2.26},{"duration":0,"rotate":-0.25}]},{"name":"tail4","translateFrame":[{"duration":7,"tweenEasing":0,"x":-0.04,"y":0.05},{"duration":8,"tweenEasing":0,"x":-0.03,"y":-0.06},{"duration":7,"tweenEasing":0,"x":-0.04,"y":0.05},{"duration":8,"tweenEasing":0,"y":0.02},{"duration":0,"x":-0.04,"y":0.05}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":5.27},{"duration":8,"tweenEasing":0,"rotate":3.26},{"duration":7,"tweenEasing":0,"rotate":5.27},{"duration":8,"tweenEasing":0,"rotate":3.51},{"duration":0,"rotate":5.27}]},{"name":"tail3","translateFrame":[{"duration":7,"tweenEasing":0,"x":-0.06,"y":0.04},{"duration":8,"tweenEasing":0,"x":-0.06,"y":-0.01},{"duration":7,"tweenEasing":0,"x":-0.06,"y":0.04},{"duration":8,"tweenEasing":0,"x":-0.06,"y":-0.01},{"duration":0,"x":-0.06,"y":0.04}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":-0.75},{"duration":8,"tweenEasing":0,"rotate":-0.5},{"duration":7,"tweenEasing":0,"rotate":-0.75},{"duration":8,"tweenEasing":0,"rotate":-1.26},{"duration":0,"rotate":-0.75}]},{"name":"tail2","translateFrame":[{"duration":7,"tweenEasing":0,"x":0.09,"y":0.13},{"duration":8,"tweenEasing":0,"x":0.04,"y":0.08},{"duration":7,"tweenEasing":0,"x":0.09,"y":0.13},{"duration":8,"tweenEasing":0,"x":0.04,"y":0.08},{"duration":0,"x":0.09,"y":0.13}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":4.01},{"duration":8,"tweenEasing":0,"rotate":2},{"duration":7,"tweenEasing":0,"rotate":4.01},{"duration":8,"tweenEasing":0,"rotate":2},{"duration":0,"rotate":4.01}]},{"name":"tail1","translateFrame":[{"duration":7,"tweenEasing":0,"x":-0.07,"y":-0.1},{"duration":8,"tweenEasing":0,"x":-0.01,"y":-0.19},{"duration":7,"tweenEasing":0,"x":-0.07,"y":-0.1},{"duration":8,"tweenEasing":0,"x":-0.01,"y":-0.19},{"duration":0,"x":-0.07,"y":-0.1}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":0.75},{"duration":8,"tweenEasing":0,"rotate":-1.37},{"duration":7,"tweenEasing":0,"rotate":0.75},{"duration":8,"tweenEasing":0,"rotate":-1.37},{"duration":0,"rotate":0.75}]},{"name":"tail","translateFrame":[{"duration":7,"tweenEasing":0,"x":-0.05,"y":0.06},{"duration":8,"tweenEasing":0,"x":0.49,"y":0.83},{"duration":7,"tweenEasing":0,"x":-0.05,"y":0.06},{"duration":8,"tweenEasing":0,"x":0.49,"y":0.83},{"duration":0,"x":-0.05,"y":0.06}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":-0.5},{"duration":8,"tweenEasing":0,"rotate":-3.72},{"duration":7,"tweenEasing":0,"rotate":-0.5},{"duration":8,"tweenEasing":0,"rotate":-3.72},{"duration":0,"rotate":-0.5}]},{"name":"weapon","translateFrame":[{"duration":7,"tweenEasing":0,"x":-0.38,"y":-0.18},{"duration":8,"tweenEasing":0,"x":1.05,"y":0.47},{"duration":7,"tweenEasing":0,"x":-0.38,"y":-0.18},{"duration":8,"tweenEasing":0,"x":1.09,"y":0.46},{"duration":0,"x":-0.38,"y":-0.18}],"rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":11.74},{"duration":8,"tweenEasing":0,"rotate":10.09},{"duration":7,"tweenEasing":0,"rotate":11.74},{"duration":8,"tweenEasing":0,"rotate":9.84},{"duration":0,"rotate":11.74}],"scaleFrame":[{"duration":7,"tweenEasing":0,"x":1.01},{"duration":8,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":8,"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"pelvis","translateFrame":[{"duration":30,"x":-0.05,"y":-3.95}]},{"name":"chest","translateFrame":[{"duration":7,"tweenEasing":0,"x":0.01,"y":-0.05},{"duration":8,"tweenEasing":0,"x":-5.49,"y":-1.36},{"duration":7,"tweenEasing":0,"x":0.01,"y":-0.05},{"duration":8,"tweenEasing":0,"x":-5.49,"y":-1.36},{"duration":0,"x":0.01,"y":-0.05}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":1.5},{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":1.5},{"duration":0}]},{"name":"neck","translateFrame":[{"duration":7,"tweenEasing":0,"y":0.04},{"duration":8,"tweenEasing":0,"x":0.18,"y":0.15},{"duration":7,"tweenEasing":0,"y":0.04},{"duration":8,"tweenEasing":0,"x":0.18,"y":0.15},{"duration":0,"y":0.04}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":1.29},{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":1.29},{"duration":0}]},{"name":"head","translateFrame":[{"duration":7,"tweenEasing":0,"x":-0.01},{"duration":8,"tweenEasing":0,"x":0.03,"y":-0.02},{"duration":7,"tweenEasing":0,"x":-0.01},{"duration":8,"tweenEasing":0,"x":0.03,"y":-0.02},{"duration":0,"x":-0.01}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-2.77},{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-2.77},{"duration":0}]},{"name":"thigh_r_b","translateFrame":[{"duration":13,"tweenEasing":0,"x":-0.03,"y":-0.06},{"duration":2,"tweenEasing":0,"x":-3.25,"y":-0.8},{"duration":5,"tweenEasing":0,"x":-0.03,"y":-0.06},{"duration":6,"tweenEasing":0,"x":-1.79,"y":-0.44},{"duration":2,"tweenEasing":0,"x":-6.36,"y":-1.57},{"duration":2,"tweenEasing":0,"x":-3.2,"y":-0.79},{"duration":0,"x":-0.03,"y":-0.06}],"rotateFrame":[{"duration":13,"tweenEasing":0,"rotate":-5.27},{"duration":2,"tweenEasing":0,"rotate":-28.87},{"duration":5,"tweenEasing":0,"rotate":-19.83},{"duration":6,"tweenEasing":0,"rotate":28.09},{"duration":2,"tweenEasing":0,"rotate":14.05},{"duration":2,"tweenEasing":0,"rotate":-10.55},{"duration":0,"rotate":-5.27}],"scaleFrame":[{"duration":13,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":1.06},{"duration":5,"tweenEasing":0,"x":1.08},{"duration":6,"tweenEasing":0,"x":1.17},{"duration":2,"tweenEasing":0,"x":1.2},{"duration":2,"tweenEasing":0,"x":0.92},{"duration":0,"x":0.97}]},{"name":"thigh_r_m","translateFrame":[{"duration":2,"tweenEasing":0,"y":0.04},{"duration":5,"tweenEasing":0,"x":2.16,"y":4.2},{"duration":6,"tweenEasing":0,"x":0.05,"y":0.04},{"duration":2,"tweenEasing":0,"x":-0.83,"y":-1.74},{"duration":7,"tweenEasing":0,"y":0.04},{"duration":8,"tweenEasing":0,"x":0.05,"y":0.04},{"duration":0,"y":0.04}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-10.53},{"duration":5,"tweenEasing":0,"rotate":-1.67},{"duration":6,"tweenEasing":0,"rotate":14.79},{"duration":2,"tweenEasing":0,"rotate":27.16},{"duration":7,"tweenEasing":0,"rotate":34.54},{"duration":8,"tweenEasing":0,"rotate":12.05},{"duration":0,"rotate":-10.53}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":0.97},{"duration":5,"tweenEasing":0,"x":1.14},{"duration":6,"tweenEasing":0,"x":1.36},{"duration":2,"tweenEasing":0,"x":1.19},{"duration":7,"tweenEasing":0,"x":0.86},{"duration":8,"tweenEasing":0,"x":0.86},{"duration":0,"x":0.97}]},{"name":"thigh_r_f","translateFrame":[{"duration":2,"tweenEasing":0,"x":0.04,"y":0.01},{"duration":5,"tweenEasing":0,"x":2.2,"y":4.29},{"duration":8,"tweenEasing":0,"x":0.14,"y":0.1},{"duration":4,"tweenEasing":0,"x":0.04,"y":0.01},{"duration":3,"tweenEasing":0,"x":1.63,"y":3.11},{"duration":2,"tweenEasing":0,"x":0.14,"y":0.1},{"duration":6,"tweenEasing":0,"x":-1.59,"y":-2.8},{"duration":0,"x":0.04,"y":0.01}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":26.36},{"duration":5,"tweenEasing":0,"rotate":43.5},{"duration":8,"tweenEasing":0,"rotate":38.69},{"duration":4,"tweenEasing":0,"rotate":-17.8},{"duration":3,"tweenEasing":0,"rotate":-29.4},{"duration":2,"tweenEasing":0,"rotate":-23.52},{"duration":6,"tweenEasing":0,"rotate":-13.64},{"duration":0,"rotate":26.36}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.07},{"duration":5,"tweenEasing":0,"x":1.06},{"duration":8,"tweenEasing":0,"x":0.92},{"duration":4,"tweenEasing":0,"x":0.82},{"duration":3,"tweenEasing":0,"x":0.89},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":6,"tweenEasing":0,"x":1.02},{"duration":0,"x":1.07}]},{"name":"upperarm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":1.6,"y":-0.05},{"duration":4,"tweenEasing":0,"x":1.63,"y":4.53},{"duration":3,"tweenEasing":0,"x":1.93,"y":-0.21},{"duration":5,"tweenEasing":0,"x":2.01,"y":-3.97},{"duration":3,"tweenEasing":0,"x":1.6,"y":-0.05},{"duration":4,"tweenEasing":0,"x":1.59,"y":4.13},{"duration":3,"tweenEasing":0,"x":1.93,"y":-0.21},{"duration":5,"tweenEasing":0,"x":2,"y":-3.72},{"duration":0,"x":1.6,"y":-0.05}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-24.8},{"duration":4,"tweenEasing":0,"rotate":-17.71},{"duration":3,"tweenEasing":0,"rotate":-25.82},{"duration":5,"tweenEasing":0,"rotate":-29.8},{"duration":3,"tweenEasing":0,"rotate":-24.8},{"duration":4,"tweenEasing":0,"rotate":-17.71},{"duration":3,"tweenEasing":0,"rotate":-25.82},{"duration":5,"tweenEasing":0,"rotate":-29.8},{"duration":0,"rotate":-24.8}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.08},{"duration":4,"tweenEasing":0,"x":1.09},{"duration":3,"tweenEasing":0,"x":1.08},{"duration":5,"tweenEasing":0,"x":1.07},{"duration":3,"tweenEasing":0,"x":1.08},{"duration":4,"tweenEasing":0,"x":1.09},{"duration":3,"tweenEasing":0,"x":1.08},{"duration":5,"tweenEasing":0,"x":1.07},{"duration":0,"x":1.08}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.23,"y":-0.04},{"duration":4,"tweenEasing":0,"x":0.15,"y":0.06},{"duration":3,"tweenEasing":0,"x":0.18,"y":0.01},{"duration":5,"tweenEasing":0,"x":0.26,"y":-0.04},{"duration":3,"tweenEasing":0,"x":0.23,"y":-0.04},{"duration":4,"tweenEasing":0,"x":0.18,"y":0.01},{"duration":3,"tweenEasing":0,"x":0.18,"y":0.01},{"duration":5,"tweenEasing":0,"x":0.24,"y":-0.05},{"duration":0,"x":0.23,"y":-0.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-15.34},{"duration":4,"tweenEasing":0,"rotate":-19.87},{"duration":3,"tweenEasing":0,"rotate":-16.1},{"duration":5,"tweenEasing":0,"rotate":-13.08},{"duration":3,"tweenEasing":0,"rotate":-15.34},{"duration":4,"tweenEasing":0,"rotate":-19.87},{"duration":3,"tweenEasing":0,"rotate":-16.1},{"duration":5,"tweenEasing":0,"rotate":-13.08},{"duration":0,"rotate":-15.34}],"scaleFrame":[{"duration":30,"x":1.03}]},{"name":"hand_r_1","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.42,"y":-0.89},{"duration":4,"tweenEasing":0,"x":-1.66,"y":-1.24},{"duration":3,"tweenEasing":0,"x":-1.57,"y":-1.01},{"duration":5,"tweenEasing":0,"x":-1.51,"y":-1.01},{"duration":3,"tweenEasing":0,"x":-1.42,"y":-0.89},{"duration":4,"tweenEasing":0,"x":-1.67,"y":-1.19},{"duration":3,"tweenEasing":0,"x":-1.57,"y":-1.01},{"duration":5,"tweenEasing":0,"x":-1.47,"y":-0.98},{"duration":0,"x":-1.42,"y":-0.89}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-1.23},{"duration":4,"tweenEasing":0,"rotate":3.53},{"duration":3,"tweenEasing":0,"rotate":12.07},{"duration":5,"tweenEasing":0,"rotate":7.81},{"duration":3,"tweenEasing":0,"rotate":-1.23},{"duration":4,"tweenEasing":0,"rotate":3.53},{"duration":3,"tweenEasing":0,"rotate":12.07},{"duration":5,"tweenEasing":0,"rotate":7.81},{"duration":0,"rotate":-1.23}],"scaleFrame":[{"duration":30,"x":0.97}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.24,"y":0.18},{"duration":4,"tweenEasing":0,"x":-0.33,"y":-0.05},{"duration":3,"tweenEasing":0,"x":-0.34,"y":0.1},{"duration":5,"tweenEasing":0,"x":-0.25,"y":0.01},{"duration":3,"tweenEasing":0,"x":-0.24,"y":0.18},{"duration":4,"tweenEasing":0,"x":-0.35,"y":-0.06},{"duration":3,"tweenEasing":0,"x":-0.34,"y":0.1},{"duration":5,"tweenEasing":0,"x":-0.25,"y":0.01},{"duration":0,"x":-0.24,"y":0.18}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-2.2},{"duration":4,"tweenEasing":0,"rotate":-12.25},{"duration":3,"tweenEasing":0,"rotate":-17.76},{"duration":5,"tweenEasing":0,"rotate":-11.22},{"duration":3,"tweenEasing":0,"rotate":-2.2},{"duration":4,"tweenEasing":0,"rotate":-7.98},{"duration":3,"tweenEasing":0,"rotate":-18.01},{"duration":5,"tweenEasing":0,"rotate":-12.73},{"duration":0,"rotate":-2.2}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":0,"x":0.99}]},{"name":"calf_r_b","translateFrame":[{"duration":13,"tweenEasing":0,"x":0.06,"y":0.05},{"duration":2,"tweenEasing":0,"x":-0.04,"y":0.3},{"duration":5,"tweenEasing":0,"x":-0.1,"y":0.3},{"duration":6,"tweenEasing":0,"x":-0.34,"y":-0.04},{"duration":2,"tweenEasing":0,"x":-0.28,"y":-0.05},{"duration":2,"tweenEasing":0,"x":0.12,"y":0.17},{"duration":0,"x":0.06,"y":0.05}],"rotateFrame":[{"duration":13,"tweenEasing":0,"rotate":-44.3},{"duration":2,"tweenEasing":0,"rotate":36.37},{"duration":5,"tweenEasing":0,"rotate":31.85},{"duration":6,"tweenEasing":0,"rotate":-18.12},{"duration":2,"tweenEasing":0,"rotate":-56.71},{"duration":2,"tweenEasing":0,"rotate":-39.5},{"duration":0,"rotate":-44.3}],"scaleFrame":[{"duration":13,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.94},{"duration":2,"x":0.99}]},{"name":"calf_r_m","translateFrame":[{"duration":2,"tweenEasing":0,"x":0.11,"y":0.2},{"duration":5,"tweenEasing":0,"x":-0.04,"y":-0.03},{"duration":6,"tweenEasing":0,"x":-0.22,"y":-0.07},{"duration":2,"tweenEasing":0,"x":-0.11,"y":0.01},{"duration":7,"tweenEasing":0,"x":-4.93,"y":-0.11},{"duration":8,"tweenEasing":0,"x":-5.46,"y":-0.06},{"duration":0,"x":0.11,"y":0.2}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":15.3},{"duration":5,"tweenEasing":0,"rotate":7.72},{"duration":6,"tweenEasing":0,"rotate":-16.12},{"duration":2,"tweenEasing":0,"rotate":-45.85},{"duration":7,"tweenEasing":0,"rotate":-60.26},{"duration":8,"tweenEasing":0,"rotate":-24.96},{"duration":0,"rotate":15.3}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.95},{"duration":2,"tweenEasing":0,"x":0.95},{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":1.01},{"duration":0,"x":1.02}]},{"name":"calf_r_f","translateFrame":[{"duration":2,"tweenEasing":0,"x":18.75,"y":-5.99},{"duration":5,"tweenEasing":0,"x":30.29,"y":6.18},{"duration":8,"tweenEasing":0,"x":22.31,"y":3.36},{"duration":2,"tweenEasing":0,"x":-9.02,"y":2.64},{"duration":2,"tweenEasing":0,"x":-12.75,"y":5.2},{"duration":3,"tweenEasing":0,"x":-15.51,"y":2.79},{"duration":2,"tweenEasing":0,"x":-15.62,"y":-6.17},{"duration":6,"tweenEasing":0,"x":-10.79,"y":-11.15},{"duration":0,"x":18.75,"y":-5.99}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-18.81},{"duration":5,"tweenEasing":0,"rotate":-18.23},{"duration":8,"tweenEasing":0,"rotate":-10.49},{"duration":2,"tweenEasing":0,"rotate":9.26},{"duration":2,"tweenEasing":0,"rotate":13.35},{"duration":3,"tweenEasing":0,"rotate":14.43},{"duration":2,"tweenEasing":0,"rotate":4.55},{"duration":6,"tweenEasing":0,"rotate":-2.86},{"duration":0,"rotate":-18.81}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":0.92},{"duration":5,"tweenEasing":0,"x":0.94},{"duration":8,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":6,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.92}]}]},{"duration":13,"fadeInTime":0.2,"name":"attack_01","bone":[{"name":"calf_l_f","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.61,"y":0.02},{"tweenEasing":0,"x":0.61,"y":-0.02},{"duration":2,"tweenEasing":0,"x":0.78,"y":0.12},{"duration":6,"tweenEasing":0,"x":-0.21,"y":0.18},{"duration":0,"x":-0.25,"y":-0.07}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-18.58},{"tweenEasing":0,"rotate":-10.3},{"duration":2,"tweenEasing":0,"rotate":-21.34},{"duration":6,"tweenEasing":0,"rotate":10.04},{"duration":0,"rotate":19.33}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.04},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":6,"tweenEasing":0,"x":1.05},{"duration":0,"x":1.04}]},{"name":"calf_l_m","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.15,"y":0.16},{"tweenEasing":0,"x":-0.28,"y":0.22},{"duration":2,"tweenEasing":0,"x":-0.14,"y":0.54},{"duration":6,"tweenEasing":0,"x":-0.18,"y":0.33},{"duration":0,"x":-0.13,"y":0.29}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-11.55},{"tweenEasing":0,"rotate":-11.56},{"duration":2,"tweenEasing":0,"rotate":-32.88},{"duration":6,"tweenEasing":0,"rotate":-15.32},{"duration":0,"rotate":-9.3}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.11},{"tweenEasing":0,"x":1.12},{"duration":2,"tweenEasing":0,"x":1.17},{"duration":6,"tweenEasing":0,"x":1.12},{"duration":0,"x":1.1}]},{"name":"calf_l_b","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.25,"y":0.1},{"tweenEasing":0,"x":-0.33,"y":0.2},{"duration":2,"tweenEasing":0,"x":-0.45,"y":0.28},{"duration":6,"tweenEasing":0,"x":-0.3,"y":0.13},{"duration":0,"x":-0.18,"y":0.06}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-23.54},{"tweenEasing":0,"rotate":-22.79},{"duration":2,"tweenEasing":0,"rotate":-39.56},{"duration":6,"tweenEasing":0,"rotate":-24.29},{"duration":0,"rotate":-16.28}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.1},{"tweenEasing":0,"x":1.13},{"duration":2,"tweenEasing":0,"x":1.18},{"duration":6,"tweenEasing":0,"x":1.12},{"duration":0,"x":1.07}]},{"name":"forearm_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.12,"y":-0.18},{"tweenEasing":0,"x":0.14,"y":-0.17},{"duration":2,"tweenEasing":0,"x":0.25,"y":-0.28},{"duration":6,"tweenEasing":0,"x":0.37,"y":-0.17},{"duration":0,"x":0.33,"y":-0.17}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":8.69},{"tweenEasing":0,"rotate":8.69},{"duration":2,"tweenEasing":0,"rotate":-13.93},{"duration":6,"tweenEasing":0,"rotate":-38.93},{"duration":0,"rotate":-24.9}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":6}]},{"name":"upperarm_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":1.39,"y":1.97},{"tweenEasing":0,"x":0.34,"y":-0.72},{"duration":2,"tweenEasing":0,"x":0.31,"y":-0.81},{"duration":6,"tweenEasing":0,"x":0.26,"y":-0.84},{"duration":0,"x":0.34,"y":-0.53}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":11.21},{"tweenEasing":0,"rotate":4.65},{"duration":2,"tweenEasing":0,"rotate":10.33},{"duration":6,"tweenEasing":0,"rotate":20.07},{"duration":0,"rotate":13.31}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.36},{"tweenEasing":0,"x":1.36},{"duration":2,"tweenEasing":0,"x":1.17},{"duration":6,"x":0.96}]},{"name":"hand_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.16,"y":0.21},{"tweenEasing":0,"x":-0.13,"y":0.26},{"duration":2,"tweenEasing":0,"x":-0.09,"y":0.22},{"duration":6,"tweenEasing":0,"x":0.13,"y":-0.16},{"duration":0,"x":0.22,"y":-0.15}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-12.96},{"tweenEasing":0,"rotate":-12.96},{"duration":2,"tweenEasing":0,"rotate":-14.64},{"duration":6,"tweenEasing":0,"rotate":-17.8},{"duration":0,"rotate":-21.29}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":6,"tweenEasing":0,"x":0.91},{"duration":0,"x":0.88}]},{"name":"hand_l_1","translateFrame":[{"duration":4,"tweenEasing":0,"x":3.31,"y":-5.01},{"tweenEasing":0,"x":3.31,"y":-5.06},{"duration":2,"tweenEasing":0,"x":1.92,"y":-3.88},{"duration":6,"tweenEasing":0,"x":-0.93,"y":-2.68},{"duration":0,"x":-1.09,"y":-2.14}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-13.71},{"tweenEasing":0,"rotate":-13.71},{"duration":2,"tweenEasing":0,"rotate":-4.63},{"duration":6,"tweenEasing":0,"rotate":3.74},{"duration":0,"rotate":2}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.04},{"tweenEasing":0,"x":1.04},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":6,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"thigh_l_f","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.85,"y":0.21},{"tweenEasing":0,"x":0.9,"y":0.17},{"duration":2,"tweenEasing":0,"x":0.74,"y":0.1},{"duration":6,"tweenEasing":0,"x":0.72,"y":0.11},{"duration":0,"x":3.09,"y":0.81}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":19.95},{"tweenEasing":0,"rotate":16.68},{"duration":2,"tweenEasing":0,"rotate":21.23},{"duration":6,"tweenEasing":0,"rotate":3.4},{"duration":0,"rotate":-2.88}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.94},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":6,"tweenEasing":0,"x":0.92},{"duration":0,"x":0.93}]},{"name":"thigh_l_m","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.79,"y":0.29},{"tweenEasing":0,"x":0.83,"y":0.2},{"duration":2,"tweenEasing":0,"x":0.72,"y":0.14},{"duration":6,"tweenEasing":0,"x":0.7,"y":0.15},{"duration":0,"x":0.64,"y":0.24}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":6.39},{"tweenEasing":0,"rotate":6.89},{"duration":2,"tweenEasing":0,"rotate":16.69},{"duration":6,"tweenEasing":0,"rotate":8.17},{"duration":0,"rotate":5.41}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":0.89},{"duration":2,"tweenEasing":0,"x":0.88},{"duration":6,"tweenEasing":0,"x":0.9},{"duration":0,"x":0.91}]},{"name":"thigh_l_b","translateFrame":[{"duration":4,"tweenEasing":0,"x":-1.67,"y":1.68},{"tweenEasing":0,"x":-1.63,"y":1.69},{"duration":2,"tweenEasing":0,"x":-1.63,"y":1.49},{"duration":6,"tweenEasing":0,"x":-1.41,"y":1.34},{"duration":0,"x":-0.61,"y":0.56}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-6.83},{"tweenEasing":0,"rotate":-8.34},{"duration":2,"tweenEasing":0,"rotate":-9.58},{"duration":6,"tweenEasing":0,"rotate":-7.35},{"duration":0,"rotate":-3.67}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.92},{"duration":2,"tweenEasing":0,"x":0.9},{"duration":6,"tweenEasing":0,"x":0.93},{"duration":0,"x":0.97}]},{"name":"tail9","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.18,"y":-0.08},{"tweenEasing":0,"x":0.08},{"duration":2,"tweenEasing":0,"x":-0.1},{"duration":6,"tweenEasing":0,"x":-0.03,"y":-0.06},{"duration":0,"x":0.01,"y":0.03}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":4.76},{"tweenEasing":0,"rotate":4.48},{"duration":2,"tweenEasing":0,"rotate":-3.01},{"duration":6,"tweenEasing":0,"rotate":-2.51},{"duration":0,"rotate":2.51}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.02},{"duration":8}]},{"name":"tail8","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.17,"y":-0.04},{"tweenEasing":0,"x":0.15,"y":-0.11},{"duration":2,"tweenEasing":0,"x":0.14,"y":-0.02},{"duration":6,"tweenEasing":0,"x":0.03},{"duration":0,"x":-0.01,"y":-0.09}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-7.24},{"tweenEasing":0,"rotate":-7.49},{"duration":2,"tweenEasing":0,"rotate":8.53},{"duration":6,"tweenEasing":0,"rotate":9.27},{"duration":0,"rotate":2.98}]},{"name":"tail7","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.15,"y":-0.04},{"tweenEasing":0,"x":-0.17,"y":-0.04},{"duration":2,"tweenEasing":0,"x":0.11,"y":-0.09},{"duration":6,"tweenEasing":0,"x":0.08,"y":0.05},{"duration":0,"x":0.09,"y":0.07}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-5.24},{"tweenEasing":0,"rotate":5.8},{"duration":2,"tweenEasing":0,"rotate":-2},{"duration":6,"tweenEasing":0,"rotate":-1},{"duration":0,"rotate":4.78}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"tail6","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.16,"y":-0.11},{"tweenEasing":0,"x":-0.12,"y":-0.1},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.09},{"duration":6,"tweenEasing":0,"x":-0.03,"y":-0.03},{"duration":0,"x":-0.08,"y":-0.07}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-12.09},{"tweenEasing":0,"rotate":-10.59},{"duration":2,"tweenEasing":0,"rotate":-3.77},{"duration":6,"tweenEasing":0,"rotate":-6.52},{"duration":0,"rotate":-16.3}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"tail5","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.14,"y":-0.02},{"tweenEasing":0,"x":0.15,"y":-0.04},{"duration":2,"tweenEasing":0,"y":0.05},{"duration":6,"tweenEasing":0,"x":0.09,"y":0.04},{"duration":0,"x":-0.04,"y":0.06}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":5.75},{"tweenEasing":0,"rotate":5.75},{"duration":2,"tweenEasing":0,"rotate":2.77},{"duration":6,"tweenEasing":0,"rotate":4.02},{"duration":0,"rotate":8.79}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":8}]},{"name":"tail4","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.15,"y":0.01},{"tweenEasing":0,"x":0.18},{"duration":2,"tweenEasing":0,"x":-0.05,"y":0.02},{"duration":6,"tweenEasing":0,"x":-0.11},{"duration":0,"x":-0.11,"y":0.01}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":0.01},{"tweenEasing":0,"rotate":0.01},{"duration":2,"tweenEasing":0,"rotate":-1.75},{"duration":6,"tweenEasing":0,"rotate":-1.01},{"duration":0,"rotate":1.99}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":8}]},{"name":"tail3","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.12,"y":0.02},{"tweenEasing":0,"x":0.12,"y":-0.04},{"duration":2,"tweenEasing":0,"x":-0.03,"y":-0.07},{"duration":6,"tweenEasing":0,"x":-0.02,"y":-0.01},{"duration":0,"x":-0.02,"y":-0.05}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-5.49},{"tweenEasing":0,"rotate":-5.49},{"duration":2,"tweenEasing":0,"rotate":-4.5},{"duration":6,"tweenEasing":0,"rotate":-4.76},{"duration":0,"rotate":-5.77}]},{"name":"tail2","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.13,"y":0.1},{"tweenEasing":0,"x":0.08,"y":0.09},{"duration":2,"tweenEasing":0,"x":-0.02,"y":0.08},{"duration":6,"tweenEasing":0,"x":0.02,"y":0.03},{"duration":0,"x":-0.03}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":10.04},{"tweenEasing":0,"rotate":10.04},{"duration":2,"tweenEasing":0,"rotate":4.76},{"duration":6,"tweenEasing":0,"rotate":4.25},{"duration":0,"rotate":3.75}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":6}]},{"name":"tail1","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.02,"y":-0.04},{"tweenEasing":0,"x":0.02,"y":-0.01},{"duration":2,"tweenEasing":0,"x":-0.07,"y":-0.05},{"duration":6,"tweenEasing":0,"x":-0.05,"y":-0.06},{"duration":0,"x":-0.06,"y":-0.07}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-3.25},{"tweenEasing":0,"rotate":-3.25},{"duration":2,"tweenEasing":0,"rotate":4.25},{"duration":6,"tweenEasing":0,"rotate":3.51},{"duration":0,"rotate":-0.25}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":8}]},{"name":"tail","translateFrame":[{"duration":4,"tweenEasing":0,"x":-3.86,"y":-9.88},{"tweenEasing":0,"x":-3.81,"y":-9.92},{"duration":2,"tweenEasing":0,"x":-3.69,"y":-9.43},{"duration":6,"tweenEasing":0,"x":-3.44,"y":-8.34},{"duration":0,"x":-2.46,"y":-5.1}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":31.69},{"tweenEasing":0,"rotate":31.69},{"duration":2,"tweenEasing":0,"rotate":5.16},{"duration":6,"tweenEasing":0,"rotate":2.66},{"duration":0,"rotate":-0.35}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":0,"x":0.99}]},{"name":"weapon","translateFrame":[{"duration":4,"tweenEasing":0,"x":-1.8,"y":-0.54},{"tweenEasing":0,"x":-3.72,"y":-0.6},{"duration":2,"tweenEasing":0,"x":-0.85,"y":-0.4},{"duration":6,"tweenEasing":0,"x":-0.48,"y":-0.24},{"duration":0,"x":0.39,"y":0.19}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-0.15},{"tweenEasing":0,"rotate":-0.81},{"duration":2,"tweenEasing":0,"rotate":0.7},{"duration":6,"tweenEasing":0,"rotate":4.23},{"duration":0,"rotate":13.31}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.02},{"duration":8,"x":1.01}]},{"name":"pelvis","translateFrame":[{"duration":4,"tweenEasing":0,"x":-14.4,"y":-6.9},{"tweenEasing":0,"x":-14.4,"y":-9.5},{"duration":2,"tweenEasing":0,"x":-33.2,"y":-10.45},{"duration":6,"tweenEasing":0,"x":-17.3,"y":-9.1},{"duration":0,"x":-12.1,"y":-6.35}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":15.27},{"tweenEasing":0,"rotate":15.27},{"duration":2,"tweenEasing":0,"rotate":15.52},{"duration":6,"tweenEasing":0,"rotate":13.27},{"duration":0,"rotate":6.26}],"scaleFrame":[{"duration":7,"tweenEasing":0,"y":1.01},{"duration":6,"tweenEasing":0,"y":1.01},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":4,"tweenEasing":0,"x":-1.31,"y":-0.26},{"tweenEasing":0,"x":-1.26,"y":-0.2},{"duration":2,"tweenEasing":0,"x":-1.2,"y":-0.23},{"duration":6,"tweenEasing":0,"x":-1.07,"y":-0.24},{"duration":0,"x":-0.67,"y":-0.18}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-21.6},{"tweenEasing":0,"rotate":-21.6},{"duration":2,"tweenEasing":0,"rotate":-20.6},{"duration":6,"tweenEasing":0,"rotate":-18.36},{"duration":0,"rotate":-11.68}]},{"name":"neck","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.1,"y":-0.01},{"tweenEasing":0,"x":-0.02,"y":-0.12},{"duration":2,"tweenEasing":0,"x":-0.27,"y":0.01},{"duration":6,"tweenEasing":0,"x":-0.13,"y":-0.1},{"duration":0,"x":-0.09,"y":-0.03}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-3.12},{"tweenEasing":0,"rotate":3.39},{"duration":2,"tweenEasing":0,"rotate":3.41},{"duration":6,"tweenEasing":0,"rotate":3.41},{"duration":0,"rotate":2.65}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.99},{"duration":9}]},{"name":"head","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.06,"y":-0.18},{"tweenEasing":0,"x":0.06,"y":-0.1},{"duration":2,"tweenEasing":0,"x":-0.04,"y":-0.07},{"duration":6,"tweenEasing":0,"x":0.06,"y":-0.04},{"duration":0,"x":0.05,"y":-0.1}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-12.2},{"tweenEasing":0,"rotate":-18.76},{"duration":2,"tweenEasing":0,"rotate":-18.02},{"duration":6,"tweenEasing":0,"rotate":-16.77},{"duration":0,"rotate":-11.26}],"scaleFrame":[{"duration":13,"x":0.99}]},{"name":"thigh_r_b","translateFrame":[{"duration":4,"tweenEasing":0,"x":1.37,"y":-1.35},{"tweenEasing":0,"x":1.36,"y":-1.34},{"duration":2,"tweenEasing":0,"x":1.36,"y":-1.3},{"duration":6,"tweenEasing":0,"x":1.2,"y":-1.12},{"duration":0,"x":0.63,"y":-0.54}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-7.83},{"tweenEasing":0,"rotate":-13.36},{"duration":2,"tweenEasing":0,"rotate":-8.33},{"duration":6,"tweenEasing":0,"rotate":-9.36},{"duration":0,"rotate":-3.67}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.81},{"tweenEasing":0,"x":0.77},{"duration":2,"tweenEasing":0,"x":0.8},{"duration":6,"tweenEasing":0,"x":0.81},{"duration":0,"x":0.9}]},{"name":"thigh_r_m","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.48,"y":0.03},{"tweenEasing":0,"x":-0.45,"y":-0.06},{"duration":2,"tweenEasing":0,"x":-0.53,"y":0.01},{"duration":6,"tweenEasing":0,"x":-0.41,"y":-0.04},{"duration":0,"x":-0.42,"y":0.01}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-1.64},{"tweenEasing":0,"rotate":-4.65},{"duration":2,"tweenEasing":0,"rotate":10.16},{"duration":6,"tweenEasing":0,"rotate":-0.86},{"duration":0,"rotate":-3.38}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.89},{"duration":9,"x":0.86}]},{"name":"thigh_r_f","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.51},{"tweenEasing":0,"x":-0.48,"y":-0.08},{"duration":2,"tweenEasing":0,"x":-0.59,"y":-0.03},{"duration":6,"tweenEasing":0,"x":-0.42,"y":-0.1},{"duration":0,"x":-0.46,"y":-0.02}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":28.98},{"tweenEasing":0,"rotate":34},{"duration":2,"tweenEasing":0,"rotate":53.09},{"duration":6,"tweenEasing":0,"rotate":35.03},{"duration":0,"rotate":26.75}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.82},{"tweenEasing":0,"x":0.82},{"duration":2,"tweenEasing":0,"x":1.06},{"duration":6,"x":0.82}]},{"name":"upperarm_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":-1.06,"y":6.99},{"tweenEasing":0,"x":0.24,"y":5.67},{"duration":2,"tweenEasing":0,"x":0.14,"y":5.66},{"duration":6,"tweenEasing":0,"x":0.28,"y":5.19},{"duration":0,"x":-0.24,"y":2.87}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":0.33},{"tweenEasing":0,"rotate":-6.23},{"duration":2,"tweenEasing":0,"rotate":2.02},{"duration":6,"tweenEasing":0,"rotate":12.03},{"duration":0,"rotate":9.03}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.12},{"tweenEasing":0,"x":1.12},{"duration":2,"tweenEasing":0,"x":1.08},{"duration":6,"tweenEasing":0,"x":1.05},{"duration":0,"x":1.02}]},{"name":"forearm_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.08,"y":0.02},{"tweenEasing":0,"x":0.03,"y":0.01},{"duration":2,"tweenEasing":0,"x":-0.01,"y":0.15},{"duration":6,"tweenEasing":0,"x":-0.1,"y":0.26},{"duration":0,"x":-0.08,"y":0.13}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":23.99},{"tweenEasing":0,"rotate":23.99},{"duration":2,"tweenEasing":0,"rotate":-1.8},{"duration":6,"tweenEasing":0,"rotate":-30.55},{"duration":0,"rotate":-21.29}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":6,"tweenEasing":0,"x":0.96},{"duration":0,"x":0.98}]},{"name":"hand_r_1","translateFrame":[{"duration":4,"tweenEasing":0,"x":-2.07,"y":-1.92},{"tweenEasing":0,"x":-2.04,"y":-1.9},{"duration":2,"tweenEasing":0,"x":-0.94,"y":-1.51},{"duration":6,"tweenEasing":0,"x":1.06,"y":0.15},{"duration":0,"x":0.63,"y":0.24}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-12.29},{"tweenEasing":0,"rotate":-12.29},{"duration":2,"tweenEasing":0,"rotate":-1.79},{"duration":6,"tweenEasing":0,"rotate":9.27},{"duration":0,"rotate":6.16}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.95},{"duration":2,"tweenEasing":0,"x":0.94},{"duration":6,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.99}]},{"name":"hand_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.12,"y":-0.08},{"tweenEasing":0,"x":-0.08,"y":-0.02},{"duration":2,"tweenEasing":0,"x":-0.12,"y":-0.04},{"duration":6,"tweenEasing":0,"x":0.09,"y":-0.1},{"duration":0,"x":0.03,"y":0.25}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-14.79},{"tweenEasing":0,"rotate":-14.79},{"duration":2,"tweenEasing":0,"rotate":-18.81},{"duration":6,"tweenEasing":0,"rotate":-21.29},{"duration":0,"rotate":-17.63}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":6}]},{"name":"calf_r_b","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.42,"y":-0.13},{"tweenEasing":0,"x":0.56,"y":-0.18},{"duration":2,"tweenEasing":0,"x":0.6,"y":-0.32},{"duration":6,"tweenEasing":0,"x":0.52,"y":-0.13},{"duration":0,"x":0.3,"y":-0.12}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-18.19},{"tweenEasing":0,"rotate":-13.9},{"duration":2,"tweenEasing":0,"rotate":-32.71},{"duration":6,"tweenEasing":0,"rotate":-17.69},{"duration":0,"rotate":-11.98}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"calf_r_m","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.3,"y":0.02},{"tweenEasing":0,"x":-0.88,"y":0.04},{"duration":2,"tweenEasing":0,"x":-6.89,"y":-0.55},{"duration":6,"tweenEasing":0,"x":-1.78,"y":-0.05},{"duration":0,"x":0.37,"y":0.02}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-2.94},{"tweenEasing":0,"rotate":-0.16},{"duration":2,"tweenEasing":0,"rotate":-25.72},{"duration":6,"tweenEasing":0,"rotate":-6.18},{"duration":0,"rotate":-0.67}],"scaleFrame":[{"duration":4,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0},{"duration":6,"x":1.01}]},{"name":"calf_r_f","translateFrame":[{"duration":4,"tweenEasing":0,"x":11.34,"y":8.67},{"tweenEasing":0,"x":12.73,"y":10.32},{"duration":2,"tweenEasing":0,"x":25.74,"y":11.24},{"duration":6,"tweenEasing":0,"x":14.43,"y":8.94},{"duration":0,"x":10.38,"y":8.4}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":0.37},{"tweenEasing":0,"rotate":1.13},{"duration":2,"tweenEasing":0,"rotate":-7.63},{"duration":6,"tweenEasing":0,"rotate":-1.11},{"duration":0,"rotate":0.89}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":6,"x":1.01}]}]},{"duration":20,"fadeInTime":0.1,"name":"death","bone":[{"name":"calf_l_f","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-1.04,"y":0.16},{"duration":2,"tweenEasing":0,"x":0.82,"y":0.05},{"duration":11,"tweenEasing":0,"x":0.84,"y":-0.07},{"duration":2,"tweenEasing":0,"x":0.27,"y":0.6},{"tweenEasing":0,"x":0.32,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.27,"y":-0.08},{"duration":0,"x":0.26}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":11.77},{"duration":2,"tweenEasing":0,"rotate":-72.25},{"duration":11,"tweenEasing":0,"rotate":-74.25},{"duration":2,"tweenEasing":0,"rotate":-22.08},{"tweenEasing":0,"rotate":-26.59},{"duration":2,"tweenEasing":0,"rotate":-9.79},{"duration":0,"rotate":-20.82}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.08},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":11,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":1.05},{"tweenEasing":0,"x":0.86},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":0,"x":0.95}]},{"name":"calf_l_m","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-1.89,"y":-0.47},{"duration":2,"tweenEasing":0,"x":0.27,"y":0.34},{"duration":11,"tweenEasing":0,"x":0.19,"y":0.43},{"duration":2,"tweenEasing":0,"x":-19.84},{"tweenEasing":0,"x":0.58,"y":-0.11},{"duration":2,"tweenEasing":0,"x":0.44,"y":-0.06},{"duration":0,"x":0.46,"y":-0.17}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":25.41},{"duration":2,"tweenEasing":0,"rotate":-41.37},{"duration":11,"tweenEasing":0,"rotate":-40.88},{"duration":2,"tweenEasing":0,"rotate":8.64},{"tweenEasing":0,"rotate":-6.48},{"duration":2,"tweenEasing":0,"rotate":5.28},{"duration":0,"rotate":-5.49}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.13},{"duration":2,"tweenEasing":0,"x":1.07},{"duration":11,"tweenEasing":0,"x":1.1},{"duration":2,"tweenEasing":0,"x":1.2},{"duration":3,"x":0.72}]},{"name":"calf_l_b","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.47,"y":-0.17},{"duration":13,"tweenEasing":0,"x":-0.08,"y":0.12},{"duration":2,"tweenEasing":0,"x":-5.72,"y":-0.23},{"tweenEasing":0,"x":0.18,"y":-0.03},{"duration":2,"tweenEasing":0,"x":0.11,"y":-0.05},{"duration":0,"x":0.18,"y":-0.03}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":35.85},{"duration":13,"tweenEasing":0,"rotate":-41.81},{"duration":2,"tweenEasing":0,"rotate":27.33},{"tweenEasing":0,"rotate":35.17},{"duration":2,"tweenEasing":0,"rotate":33.15},{"duration":0,"rotate":35.17}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.1},{"duration":13,"tweenEasing":0,"x":1.09},{"duration":2,"tweenEasing":0,"x":1.19},{"tweenEasing":0,"x":0.85},{"duration":2,"tweenEasing":0,"x":0.93},{"duration":0,"x":0.85}]},{"name":"forearm_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":4.73,"y":-0.89},{"tweenEasing":0,"x":3.33,"y":-0.63},{"tweenEasing":0,"x":0.05,"y":-0.35},{"duration":2,"tweenEasing":0,"x":0.11,"y":-0.38},{"duration":8,"tweenEasing":0,"x":1.09,"y":-0.41},{"tweenEasing":0,"x":2.67,"y":-0.27},{"tweenEasing":0,"x":3.68,"y":-0.51},{"tweenEasing":0,"x":4.08,"y":-0.61},{"tweenEasing":0,"x":2,"y":-0.52},{"tweenEasing":0,"x":1.51,"y":-0.4},{"tweenEasing":0,"x":1.84,"y":-0.5},{"duration":0,"x":2.17,"y":-0.42}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":14.43},{"tweenEasing":0,"rotate":2.22},{"tweenEasing":0,"rotate":-14.13},{"duration":2,"tweenEasing":0,"rotate":-12.42},{"duration":8,"tweenEasing":0,"rotate":4.7},{"tweenEasing":0,"rotate":15.76},{"tweenEasing":0,"rotate":20.29},{"tweenEasing":0,"rotate":25.32},{"tweenEasing":0,"rotate":29.7},{"tweenEasing":0,"rotate":31.2},{"tweenEasing":0,"rotate":31.45},{"duration":0,"rotate":32.19}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.85,"y":0.99},{"tweenEasing":0,"x":0.9},{"tweenEasing":0,"x":0.95},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":8,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.96},{"duration":3}]},{"name":"upperarm_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.06,"y":1.12},{"tweenEasing":0,"x":-0.15,"y":-0.2},{"tweenEasing":0,"x":-0.63,"y":0.69},{"duration":2,"tweenEasing":0,"x":-0.07,"y":0.1},{"duration":8,"tweenEasing":0,"x":-2.15,"y":-0.99},{"tweenEasing":0,"x":2.73,"y":-3.17},{"tweenEasing":0,"x":1.33,"y":2.57},{"tweenEasing":0,"x":1.85,"y":-3.59},{"tweenEasing":0,"x":-0.22,"y":0.96},{"tweenEasing":0,"x":0.4,"y":1.52},{"tweenEasing":0,"x":0.42,"y":1.68},{"duration":0,"x":0.3,"y":1.49}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-43.72},{"tweenEasing":0,"rotate":-29.01},{"tweenEasing":0,"rotate":-3.92},{"duration":2,"tweenEasing":0,"rotate":1.34},{"duration":8,"tweenEasing":0,"rotate":-2.18},{"tweenEasing":0,"rotate":-9.09},{"tweenEasing":0,"rotate":-21.16},{"tweenEasing":0,"rotate":-40.75},{"tweenEasing":0,"rotate":-49.61},{"tweenEasing":0,"rotate":-42.3},{"tweenEasing":0,"rotate":-39.3},{"duration":0,"rotate":-38.06}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.37},{"tweenEasing":0,"x":1.36},{"tweenEasing":0,"x":1.34},{"duration":2,"tweenEasing":0,"x":1.32},{"duration":10,"tweenEasing":0,"x":1.36},{"tweenEasing":0,"x":1.36},{"duration":3,"x":1.28}]},{"name":"hand_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":3.06,"y":-0.06},{"tweenEasing":0,"x":1.31,"y":-0.12},{"tweenEasing":0,"x":0.74,"y":-0.29},{"duration":2,"tweenEasing":0,"x":0.61,"y":-0.27},{"duration":8,"tweenEasing":0,"x":0.49,"y":-0.07},{"tweenEasing":0,"x":1.13,"y":-0.25},{"tweenEasing":0,"x":1.45,"y":-0.21},{"tweenEasing":0,"x":1.46,"y":-0.3},{"tweenEasing":0,"x":0.36,"y":-0.27},{"tweenEasing":0,"x":0.1,"y":-0.2},{"tweenEasing":0,"y":0.01},{"duration":0,"x":-0.06,"y":0.1}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-3.99},{"tweenEasing":0,"rotate":-3.04},{"tweenEasing":0,"rotate":-2.39},{"duration":2,"tweenEasing":0,"rotate":-4.13},{"duration":8,"tweenEasing":0,"rotate":-6.87},{"tweenEasing":0,"rotate":-14.27},{"tweenEasing":0,"rotate":-8.6},{"tweenEasing":0,"rotate":-1.32},{"tweenEasing":0,"rotate":1.24},{"tweenEasing":0,"rotate":0.99},{"tweenEasing":0,"rotate":0.75},{"duration":0,"rotate":0.26}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.72},{"tweenEasing":0,"x":0.78},{"tweenEasing":0,"x":0.85},{"duration":2,"tweenEasing":0,"x":0.88},{"duration":8,"tweenEasing":0,"x":0.91},{"tweenEasing":0,"x":0.84},{"tweenEasing":0,"x":0.84},{"tweenEasing":0,"x":0.88},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{}]},{"name":"hand_l_1","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-5.98,"y":-9.26},{"tweenEasing":0,"x":-7.02,"y":-8.01},{"tweenEasing":0,"x":-6.35,"y":-6.39},{"duration":2,"tweenEasing":0,"x":-5.29,"y":-5.81},{"duration":4,"tweenEasing":0,"x":-3.78,"y":-5.02},{"duration":4,"tweenEasing":0,"x":-4.11,"y":-7.3},{"tweenEasing":0,"x":-4.23,"y":-5.04},{"tweenEasing":0,"x":-4.86,"y":-5.37},{"tweenEasing":0,"x":-5.27,"y":-4.86},{"tweenEasing":0,"x":-2.44,"y":2.25},{"tweenEasing":0,"x":-1.15,"y":3.23},{"tweenEasing":0,"x":-0.46,"y":3.17},{"duration":0,"x":0.09,"y":3.02}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-20.34},{"tweenEasing":0,"rotate":-14.1},{"tweenEasing":0,"rotate":-5.64},{"duration":2,"tweenEasing":0,"rotate":-0.86},{"duration":4,"tweenEasing":0,"rotate":6.4},{"duration":4,"tweenEasing":0,"rotate":16.35},{"tweenEasing":0,"rotate":-0.5},{"tweenEasing":0,"rotate":-2.83},{"tweenEasing":0,"rotate":5.19},{"tweenEasing":0,"rotate":17.77},{"tweenEasing":0,"rotate":7.51},{"tweenEasing":0,"rotate":12.27},{"duration":0,"rotate":17.04}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.08},{"tweenEasing":0,"x":0.72},{"duration":2,"tweenEasing":0,"x":0.78},{"duration":4,"tweenEasing":0,"x":0.88},{"duration":4,"tweenEasing":0,"x":0.93},{"tweenEasing":0,"x":0.88},{"tweenEasing":0,"x":0.84},{"tweenEasing":0,"x":0.83},{"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"duration":0,"x":1.02}]},{"name":"thigh_l_f","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.32,"y":0.55},{"duration":2,"tweenEasing":0,"x":-0.2},{"duration":11,"tweenEasing":0,"x":-0.13,"y":0.09},{"tweenEasing":0,"x":1.53,"y":0.7},{"tweenEasing":0,"x":-0.88,"y":-4.32},{"tweenEasing":0,"x":-0.32,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.39,"y":0.04},{"duration":0,"x":0.13,"y":-0.1}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":17.36},{"duration":2,"tweenEasing":0,"rotate":32.68},{"duration":11,"tweenEasing":0,"rotate":36.42},{"tweenEasing":0,"rotate":46.43},{"tweenEasing":0,"rotate":11.82},{"tweenEasing":0,"rotate":-5.5},{"duration":2,"tweenEasing":0,"rotate":-5.11},{"duration":0,"rotate":-4.33}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.78},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":11,"tweenEasing":0},{"tweenEasing":0,"x":0.8},{"tweenEasing":0,"x":0.94},{"tweenEasing":0,"x":1.07},{"duration":2,"tweenEasing":0,"x":1.05},{"duration":0,"x":1.06}]},{"name":"thigh_l_m","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.06,"y":0.65},{"duration":2,"tweenEasing":0,"x":-0.18,"y":-0.12},{"duration":11,"tweenEasing":0,"x":-0.11,"y":-0.02},{"duration":2,"tweenEasing":0,"x":1.33,"y":0.81},{"tweenEasing":0,"x":-0.33,"y":-0.15},{"duration":2,"tweenEasing":0,"x":0.28,"y":-0.02},{"duration":0,"x":0.11,"y":-0.14}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-9.42},{"duration":2,"tweenEasing":0,"rotate":15.11},{"duration":11,"tweenEasing":0,"rotate":16.36},{"duration":2,"tweenEasing":0,"rotate":0.06},{"tweenEasing":0,"rotate":-4.24},{"duration":2,"tweenEasing":0,"rotate":-5.58},{"duration":0,"rotate":-4.56}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.7},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":11,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.7},{"tweenEasing":0,"x":1.14},{"duration":2,"tweenEasing":0,"x":1.13},{"duration":0,"x":1.14}]},{"name":"thigh_l_b","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.98,"y":-0.27},{"duration":13,"tweenEasing":0,"x":-1.01,"y":0.56},{"duration":2,"tweenEasing":0,"x":0.31,"y":0.24},{"tweenEasing":0,"x":-1.06,"y":0.64},{"duration":2,"tweenEasing":0,"x":-1.04,"y":0.8},{"duration":0,"x":-1.06,"y":0.64}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-26.42},{"duration":13,"tweenEasing":0,"rotate":-6.14},{"duration":2,"tweenEasing":0,"rotate":-38.37},{"tweenEasing":0,"rotate":6.09},{"duration":2,"tweenEasing":0,"rotate":0.1},{"duration":0,"rotate":6.09}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.79},{"duration":13,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.66},{"duration":3,"x":1.03}]},{"name":"tail9","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.11,"y":0.12},{"duration":2,"tweenEasing":0,"x":-0.23,"y":0.03},{"duration":5,"tweenEasing":0,"x":-0.2,"y":0.04},{"duration":6,"tweenEasing":0,"x":0.86,"y":-13.59},{"duration":2,"tweenEasing":0,"x":0.15,"y":0.08},{"tweenEasing":0,"x":-0.17,"y":0.12},{"tweenEasing":0,"x":-0.12,"y":0.15},{"tweenEasing":0,"x":-0.2,"y":0.05},{"duration":0,"x":-0.21,"y":0.04}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-1.28},{"duration":2,"tweenEasing":0,"rotate":1.65},{"duration":5,"tweenEasing":0,"rotate":3.91},{"duration":6,"tweenEasing":0,"rotate":3.67},{"duration":2,"tweenEasing":0,"rotate":-2.04},{"tweenEasing":0,"rotate":0.73},{"tweenEasing":0,"rotate":1.67},{"tweenEasing":0,"rotate":1.72},{"duration":0,"rotate":1.67}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":5,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":6,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":1.02},{"duration":0,"x":1.03,"y":1.01}]},{"name":"tail8","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.09,"y":0.06},{"duration":2,"tweenEasing":0,"x":-0.06,"y":-0.11},{"duration":11,"tweenEasing":0,"x":-0.06,"y":-0.13},{"duration":2,"tweenEasing":0,"x":0.1,"y":0.02},{"tweenEasing":0,"x":-0.03,"y":0.06},{"tweenEasing":0,"x":0.03,"y":-0.06},{"tweenEasing":0,"x":0.01,"y":-0.05},{"duration":0,"x":-0.04,"y":0.01}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-2.06},{"duration":2,"tweenEasing":0,"rotate":3.29},{"duration":11,"tweenEasing":0,"rotate":3.05},{"duration":2,"tweenEasing":0,"rotate":-2.56},{"tweenEasing":0,"rotate":1.54},{"tweenEasing":0,"rotate":2.8},{"tweenEasing":0,"rotate":2.55},{"duration":0,"rotate":3.3}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":11,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"tail7","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.03,"y":0.13},{"duration":2,"tweenEasing":0,"x":-0.31,"y":-0.16},{"duration":11,"tweenEasing":0,"x":-0.31,"y":-0.13},{"duration":2,"tweenEasing":0,"x":0.15,"y":0.09},{"tweenEasing":0,"x":-0.37,"y":-0.09},{"tweenEasing":0,"x":-0.33,"y":-0.07},{"tweenEasing":0,"x":-0.42,"y":-0.09},{"duration":0,"x":-0.42,"y":-0.05}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-1.72},{"duration":2,"tweenEasing":0,"rotate":4.58},{"duration":11,"tweenEasing":0,"rotate":4.07},{"duration":2,"tweenEasing":0,"rotate":-1.97},{"tweenEasing":0,"rotate":1.51},{"tweenEasing":0,"rotate":4.06},{"tweenEasing":0,"rotate":2.77},{"duration":0,"rotate":4.06}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":11,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":3,"x":0.99}]},{"name":"tail6","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.05},{"duration":2,"tweenEasing":0,"x":0.08,"y":-0.07},{"duration":11,"tweenEasing":0,"x":0.08,"y":-0.16},{"duration":2,"tweenEasing":0,"x":-0.11,"y":0.01},{"tweenEasing":0,"x":-0.08,"y":-0.11},{"tweenEasing":0,"y":-0.06},{"tweenEasing":0,"x":-0.06,"y":-0.09},{"duration":0,"x":-0.02,"y":-0.11}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-1.74},{"duration":2,"tweenEasing":0,"rotate":4.44},{"duration":11,"tweenEasing":0,"rotate":3.94},{"duration":2,"tweenEasing":0,"rotate":-2.24},{"tweenEasing":0,"rotate":1.72},{"tweenEasing":0,"rotate":3.69},{"tweenEasing":0,"rotate":2.71},{"duration":0,"rotate":3.94}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":11,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail5","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.01,"y":0.02},{"duration":2,"tweenEasing":0,"x":0.08,"y":0.02},{"duration":11,"tweenEasing":0,"x":0.08},{"duration":2,"tweenEasing":0,"y":0.03},{"tweenEasing":0,"x":0.03,"y":0.07},{"tweenEasing":0,"x":0.11,"y":0.01},{"tweenEasing":0,"x":0.09,"y":0.06},{"duration":0,"x":0.04,"y":-0.02}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-1.26},{"duration":2,"tweenEasing":0,"rotate":3.75},{"duration":11,"tweenEasing":0,"rotate":3.75},{"duration":2,"tweenEasing":0,"rotate":2.24},{"tweenEasing":0,"rotate":2.76},{"tweenEasing":0,"rotate":3},{"tweenEasing":0,"rotate":2.51},{"duration":0,"rotate":3.5}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":11,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0},{"duration":3,"x":0.99}]},{"name":"tail4","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.06,"y":-0.03},{"duration":2,"tweenEasing":0,"x":0.05},{"duration":11,"tweenEasing":0,"x":0.05,"y":0.05},{"duration":2,"tweenEasing":0,"x":-0.08,"y":-0.06},{"tweenEasing":0,"x":-0.04,"y":0.01},{"tweenEasing":0,"x":0.01,"y":-0.01},{"tweenEasing":0,"x":-0.07,"y":-0.06},{"duration":0,"x":-0.01,"y":0.02}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-1.27},{"duration":2,"tweenEasing":0,"rotate":3.02},{"duration":11,"tweenEasing":0,"rotate":3.02},{"duration":2,"tweenEasing":0,"rotate":-0.78},{"tweenEasing":0,"rotate":1.26},{"tweenEasing":0,"rotate":2.52},{"tweenEasing":0,"rotate":1.76},{"duration":0,"rotate":2.77}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":11,"tweenEasing":0,"x":0.99},{"duration":5}]},{"name":"tail3","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.01,"y":-0.11},{"duration":2,"tweenEasing":0,"x":0.03,"y":0.02},{"duration":11,"tweenEasing":0,"x":0.01,"y":-0.03},{"duration":2,"tweenEasing":0,"x":-0.02,"y":-0.13},{"tweenEasing":0,"x":-0.08,"y":0.01},{"tweenEasing":0,"x":-0.02,"y":-0.04},{"tweenEasing":0,"y":0.02},{"duration":0,"x":0.02,"y":0.04}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-1.27},{"duration":2,"tweenEasing":0,"rotate":3.04},{"duration":11,"tweenEasing":0,"rotate":3.03},{"duration":2,"tweenEasing":0,"rotate":0.99},{"tweenEasing":0,"rotate":2.02},{"tweenEasing":0,"rotate":2.53},{"tweenEasing":0,"rotate":2.02},{"duration":0,"rotate":2.78}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":11,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":3}]},{"name":"tail2","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.03,"y":-0.02},{"duration":2,"tweenEasing":0,"x":0.08,"y":0.09},{"duration":11,"tweenEasing":0,"x":0.07,"y":0.13},{"duration":2,"tweenEasing":0,"x":0.07,"y":-0.03},{"tweenEasing":0,"x":0.07,"y":0.17},{"tweenEasing":0,"x":0.07,"y":0.05},{"tweenEasing":0,"y":0.08},{"duration":0,"x":0.02,"y":0.11}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-1.25},{"duration":2,"tweenEasing":0,"rotate":3.26},{"duration":11,"tweenEasing":0,"rotate":1.76},{"duration":2,"tweenEasing":0,"rotate":-9.26},{"tweenEasing":0,"rotate":-1.5},{"tweenEasing":0,"rotate":2.76},{"tweenEasing":0,"rotate":2.25},{"duration":0,"rotate":3.01}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":11,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"tail1","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.03,"y":-0.14},{"duration":2,"tweenEasing":0,"x":-0.05,"y":0.01},{"duration":11,"tweenEasing":0,"x":-0.06,"y":0.03},{"duration":2,"tweenEasing":0,"x":-0.03,"y":-0.13},{"tweenEasing":0,"x":-0.02,"y":-0.06},{"tweenEasing":0,"y":-0.04},{"tweenEasing":0,"x":-0.07,"y":-0.02},{"duration":0,"x":-0.05,"y":0.02}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-0.25},{"duration":2,"tweenEasing":0,"rotate":0.26},{"duration":11,"tweenEasing":0,"rotate":-0.49},{"duration":2,"tweenEasing":0,"rotate":-5},{"tweenEasing":0,"rotate":-1},{"tweenEasing":0,"rotate":0.26},{"tweenEasing":0,"rotate":-6.51},{"duration":0,"rotate":0.26}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":11,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"tail","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-1.49,"y":-2.58},{"duration":2,"tweenEasing":0,"x":-1.57,"y":-3.44},{"duration":11,"tweenEasing":0,"x":-1.73,"y":-3.8},{"duration":2,"tweenEasing":0,"x":-3.22,"y":-6.88},{"tweenEasing":0,"x":-1.44,"y":-3.12},{"tweenEasing":0,"x":-2.85,"y":-6.62},{"tweenEasing":0,"x":-2.52,"y":-6.94},{"duration":0,"x":-2.35,"y":-5.11}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":2.57},{"duration":2,"tweenEasing":0,"rotate":11.83},{"duration":11,"tweenEasing":0,"rotate":11.82},{"duration":2,"tweenEasing":0,"rotate":9.31},{"tweenEasing":0,"rotate":7.53},{"tweenEasing":0,"rotate":16.44},{"tweenEasing":0,"rotate":14.2},{"duration":0,"rotate":14.21}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":11,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0},{"duration":3,"x":1.01}]},{"name":"weapon","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":2.71,"y":1.74},{"duration":2,"tweenEasing":0,"x":-6.5,"y":0.08},{"duration":5,"tweenEasing":0,"x":-6.26,"y":-0.02},{"duration":6,"tweenEasing":0,"x":-2.21,"y":-0.62},{"duration":2,"tweenEasing":0,"x":3.07,"y":2.08},{"tweenEasing":0,"x":-2.84,"y":-0.55},{"tweenEasing":0,"x":-5.57,"y":-0.22},{"tweenEasing":0,"x":-3.6,"y":-0.62},{"duration":0,"x":-5.8,"y":-0.13}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-0.89},{"duration":2,"tweenEasing":0,"rotate":-20.29},{"duration":5,"tweenEasing":0,"rotate":-9.25},{"duration":6,"tweenEasing":0,"rotate":24.11},{"duration":2,"tweenEasing":0,"rotate":14.17},{"tweenEasing":0,"rotate":5.3},{"tweenEasing":0,"rotate":1.57},{"tweenEasing":0,"rotate":1.22},{"duration":0,"rotate":1.81}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0,"x":1.03},{"duration":6,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.02},{"duration":0,"x":1.03}]},{"name":"pelvis","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":16.5,"y":-18.85},{"duration":13,"tweenEasing":0,"x":-36.65,"y":-1.6},{"duration":2,"tweenEasing":0,"x":0.75,"y":-33.9},{"tweenEasing":0,"x":3.55,"y":33.15},{"duration":2,"tweenEasing":0,"x":8.05,"y":26.2},{"duration":0,"x":3.55,"y":33.15}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-5.25},{"duration":13,"tweenEasing":0,"rotate":8.76},{"duration":2,"tweenEasing":0,"rotate":0.75},{"tweenEasing":0,"rotate":6},{"duration":2,"tweenEasing":0,"rotate":7.26},{"duration":0,"rotate":6}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0},{"duration":13,"tweenEasing":0,"y":1.01},{"duration":5}]},{"name":"chest","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.04,"y":-0.03},{"duration":2,"tweenEasing":0,"x":0.01,"y":0.07},{"duration":11,"tweenEasing":0,"x":0.55,"y":5.9},{"duration":2,"tweenEasing":0,"x":0.02,"y":-0.01},{"tweenEasing":0,"x":0.04,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.08,"y":0.05},{"duration":0,"x":0.04,"y":0.03}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-5.07},{"duration":2,"tweenEasing":0,"rotate":-5.9},{"duration":11,"tweenEasing":0,"rotate":-5.18},{"duration":2,"tweenEasing":0,"rotate":-12.25},{"tweenEasing":0,"rotate":-5.18},{"duration":2,"tweenEasing":0,"rotate":-11.42},{"duration":0,"rotate":-8.68}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":11,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":3}]},{"name":"neck","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.39,"y":-0.24},{"duration":2,"tweenEasing":0,"x":-0.07,"y":0.46},{"duration":11,"tweenEasing":0,"x":-0.08,"y":0.47},{"duration":2,"tweenEasing":0,"x":0.24,"y":-0.31},{"tweenEasing":0,"x":0.13,"y":0.55},{"tweenEasing":0,"x":0.06,"y":0.2},{"tweenEasing":0,"x":-0.2,"y":-1.29},{"duration":0,"x":-0.05,"y":0.26}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":0.32},{"duration":2,"tweenEasing":0,"rotate":0.31},{"duration":11,"tweenEasing":0,"rotate":0.31},{"duration":2,"tweenEasing":0,"rotate":0.3},{"tweenEasing":0,"rotate":0.27},{"tweenEasing":0,"rotate":0.18},{"tweenEasing":0,"rotate":-0.56},{"duration":0,"rotate":-0.05}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":11,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":3}]},{"name":"head","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.1,"y":-0.15},{"duration":2,"tweenEasing":0,"x":-0.07,"y":-0.06},{"duration":11,"tweenEasing":0,"x":-0.04,"y":-0.02},{"duration":2,"tweenEasing":0,"x":0.16,"y":-0.21},{"tweenEasing":0,"x":-0.01,"y":-0.02},{"tweenEasing":0,"x":0.04,"y":-0.09},{"tweenEasing":0,"x":0.01,"y":0.01},{"duration":0,"x":0.02,"y":-0.03}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-19.96},{"duration":2,"tweenEasing":0,"rotate":-20.06},{"duration":11,"tweenEasing":0,"rotate":-14.3},{"duration":2,"tweenEasing":0,"rotate":-17.94},{"tweenEasing":0,"rotate":-20.8},{"tweenEasing":0,"rotate":-16.75},{"tweenEasing":0,"rotate":-19.01},{"duration":0,"rotate":-16.76}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":11,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":3,"x":0.99}]},{"name":"thigh_r_b","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.48,"y":0.31},{"duration":13,"tweenEasing":0,"x":0.82,"y":-0.62},{"tweenEasing":0,"x":-0.05,"y":-0.03},{"tweenEasing":0,"x":-3.84,"y":-1.33},{"tweenEasing":0,"x":0.7,"y":-0.58},{"duration":2,"tweenEasing":0,"x":0.94,"y":-0.75},{"duration":0,"x":0.7,"y":-0.58}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-41.97},{"duration":13,"tweenEasing":0,"rotate":9.92},{"tweenEasing":0,"rotate":-62.65},{"tweenEasing":0,"rotate":-37.46},{"tweenEasing":0,"rotate":-37.3},{"duration":2,"tweenEasing":0,"rotate":-55.07},{"duration":0,"rotate":-37.3}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.05},{"duration":13,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":0.9},{"duration":0,"x":1.02}]},{"name":"thigh_r_m","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.62,"y":-0.02},{"duration":2,"tweenEasing":0,"x":-0.04,"y":0.13},{"duration":11,"tweenEasing":0,"x":-0.1,"y":0.13},{"tweenEasing":0,"x":-0.72,"y":0.02},{"tweenEasing":0,"x":-1.83,"y":-4.35},{"tweenEasing":0,"x":-0.01,"y":0.1},{"duration":2,"tweenEasing":0,"x":-0.23,"y":0.03},{"duration":0,"x":-0.16,"y":0.02}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-48.13},{"duration":2,"tweenEasing":0,"rotate":28.6},{"duration":11,"tweenEasing":0,"rotate":27.83},{"tweenEasing":0,"rotate":-71.68},{"tweenEasing":0,"rotate":-30.61},{"tweenEasing":0,"rotate":-16.28},{"duration":2,"tweenEasing":0,"rotate":-25.43},{"duration":0,"rotate":-17.87}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.05},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":11,"tweenEasing":0,"x":0.86},{"tweenEasing":0,"x":0.91},{"tweenEasing":0,"x":0.86},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":0,"x":1.04}]},{"name":"thigh_r_f","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.48,"y":-0.13},{"duration":2,"tweenEasing":0,"x":0.01,"y":0.29},{"duration":11,"tweenEasing":0,"x":-0.07,"y":0.28},{"tweenEasing":0,"x":-0.73,"y":-0.14},{"tweenEasing":0,"x":-1.89,"y":-4.54},{"tweenEasing":0,"x":0.1,"y":0.33},{"duration":2,"tweenEasing":0,"x":-0.19,"y":0.1},{"duration":0,"x":-0.21,"y":0.13}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":43.72},{"duration":2,"tweenEasing":0,"rotate":36.47},{"duration":11,"tweenEasing":0,"rotate":40.97},{"tweenEasing":0,"rotate":105.82},{"tweenEasing":0,"rotate":37.17},{"tweenEasing":0,"rotate":26.13},{"duration":2,"tweenEasing":0,"rotate":25.02},{"duration":0,"rotate":26.8}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.82},{"duration":2,"tweenEasing":0,"x":1.07},{"duration":11,"tweenEasing":0,"x":1.27},{"tweenEasing":0,"x":1.24},{"tweenEasing":0,"x":0.82},{"tweenEasing":0,"x":0.95},{"duration":2,"tweenEasing":0,"x":0.87},{"duration":0,"x":0.91}]},{"name":"upperarm_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.36,"y":4.23},{"tweenEasing":0,"x":0.98,"y":6.36},{"tweenEasing":0,"x":0.87,"y":6.71},{"duration":3,"tweenEasing":0,"x":1.75,"y":5.84},{"duration":8,"tweenEasing":0,"x":-0.17,"y":1.18},{"tweenEasing":0,"x":4.07,"y":1.53},{"tweenEasing":0,"x":6.09,"y":-2.95},{"tweenEasing":0,"x":5.81,"y":3.35},{"tweenEasing":0,"x":5.55,"y":2.45},{"tweenEasing":0,"x":7.33,"y":2.99},{"duration":0,"x":9.39,"y":3.29}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-68.9},{"tweenEasing":0,"rotate":-44.89},{"tweenEasing":0,"rotate":-13.28},{"duration":3,"tweenEasing":0,"rotate":-8.52},{"duration":8,"tweenEasing":0,"rotate":-14.83},{"tweenEasing":0,"rotate":-40.06},{"tweenEasing":0,"rotate":-52.39},{"tweenEasing":0,"rotate":-61.2},{"tweenEasing":0,"rotate":-43.85},{"tweenEasing":0,"rotate":-40.59},{"duration":0,"rotate":-40.85}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.14},{"tweenEasing":0,"x":1.13},{"tweenEasing":0,"x":1.1},{"duration":3,"tweenEasing":0,"x":1.11},{"duration":8,"tweenEasing":0,"x":1.13},{"tweenEasing":0,"x":1.07},{"tweenEasing":0,"x":1.09},{"tweenEasing":0,"x":1.1},{"tweenEasing":0,"x":1.16},{"tweenEasing":0,"x":1.17},{"duration":0,"x":1.24}]},{"name":"forearm_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.49,"y":0.12},{"tweenEasing":0,"x":0.06,"y":0.12},{"tweenEasing":0,"x":0.02,"y":0.09},{"duration":3,"tweenEasing":0,"x":0.02,"y":0.17},{"duration":8,"tweenEasing":0,"x":0.08,"y":0.19},{"duration":2,"tweenEasing":0,"x":0.33,"y":-0.08},{"tweenEasing":0,"x":0.37,"y":0.15},{"tweenEasing":0,"x":-5.57,"y":-0.1},{"tweenEasing":0,"x":-5.55,"y":-0.13},{"duration":0,"x":-5.62,"y":-0.08}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":28.02},{"tweenEasing":0,"rotate":5.95},{"tweenEasing":0,"rotate":-15.62},{"duration":3,"tweenEasing":0,"rotate":-13.88},{"duration":8,"tweenEasing":0,"rotate":8.63},{"duration":2,"tweenEasing":0,"rotate":19.55},{"tweenEasing":0,"rotate":34.07},{"tweenEasing":0,"rotate":28.02},{"tweenEasing":0,"rotate":30.5},{"duration":0,"rotate":35.72}],"scaleFrame":[{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":8,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":0.98},{"x":0.97}]},{"name":"hand_r_1","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-2.06,"y":-1.11},{"tweenEasing":0,"x":-2.18,"y":-1.39},{"tweenEasing":0,"x":-1.94,"y":-1.17},{"duration":3,"tweenEasing":0,"x":-1.93,"y":-1.41},{"duration":3,"tweenEasing":0,"x":-1.82,"y":-1.13},{"duration":5,"tweenEasing":0,"x":1.13,"y":-5.09},{"duration":2,"tweenEasing":0,"x":-1,"y":-0.56},{"tweenEasing":0,"x":-1.46,"y":-0.26},{"tweenEasing":0,"x":1.73,"y":3.04},{"tweenEasing":0,"x":2.16,"y":3.17},{"duration":0,"x":1.63,"y":2.35}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-6.58},{"tweenEasing":0,"rotate":-6.8},{"tweenEasing":0,"rotate":-3.73},{"duration":3,"tweenEasing":0,"rotate":-1.69},{"duration":3,"tweenEasing":0,"rotate":6.55},{"duration":5,"tweenEasing":0,"rotate":14.44},{"duration":2,"tweenEasing":0,"rotate":-11.43},{"tweenEasing":0,"rotate":2.39},{"tweenEasing":0,"rotate":13.95},{"tweenEasing":0,"rotate":17.6},{"duration":0,"rotate":16.5}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.93},{"tweenEasing":0,"x":0.93},{"duration":4,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0,"x":0.94},{"duration":5,"tweenEasing":0,"x":0.95},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":2}]},{"name":"hand_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.51,"y":0.19},{"tweenEasing":0,"x":-0.73,"y":-0.13},{"tweenEasing":0,"x":-0.7,"y":-0.06},{"duration":3,"tweenEasing":0,"x":-0.62,"y":-0.26},{"duration":8,"tweenEasing":0,"x":-0.66,"y":0.24},{"duration":2,"tweenEasing":0,"x":0.06,"y":0.02},{"tweenEasing":0,"x":-0.47,"y":0.18},{"tweenEasing":0,"x":0.32,"y":0.19},{"tweenEasing":0,"x":0.29,"y":0.47},{"duration":0,"x":0.17,"y":0.42}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-1.52},{"tweenEasing":0,"rotate":-2.5},{"tweenEasing":0,"rotate":-1.95},{"duration":3,"tweenEasing":0,"rotate":-3.68},{"duration":8,"tweenEasing":0,"rotate":-7.97},{"duration":2,"tweenEasing":0,"rotate":-14.4},{"tweenEasing":0,"rotate":-0.6},{"tweenEasing":0,"rotate":3.19},{"tweenEasing":0,"rotate":2.23},{"duration":0,"rotate":0.23}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":8,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"duration":2,"x":0.99}]},{"name":"calf_r_b","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":2.01,"y":0.62},{"duration":13,"tweenEasing":0,"x":-0.07,"y":-0.32},{"duration":2,"tweenEasing":0,"x":2.13,"y":0.76},{"tweenEasing":0,"x":-2.69},{"duration":2,"tweenEasing":0,"x":2.09,"y":0.3},{"duration":0,"x":-2.69}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":50.39},{"duration":13,"tweenEasing":0,"rotate":-44.14},{"duration":2,"tweenEasing":0,"rotate":52.4},{"tweenEasing":0,"rotate":64.5},{"duration":2,"tweenEasing":0,"rotate":82.35},{"duration":0,"rotate":64.5}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0},{"duration":13,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.79},{"duration":2,"tweenEasing":0,"x":0.81},{"duration":0,"x":0.79}]},{"name":"calf_r_m","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-2.11,"y":0.97},{"duration":2,"tweenEasing":0,"x":-0.41,"y":-0.57},{"duration":11,"tweenEasing":0,"x":-0.36,"y":-0.59},{"duration":2,"tweenEasing":0,"x":-2.12,"y":1.13},{"tweenEasing":0,"x":-0.72,"y":-0.03},{"duration":2,"tweenEasing":0,"x":-0.49,"y":0.06},{"duration":0,"x":-0.6,"y":-0.12}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":58.19},{"duration":2,"tweenEasing":0,"rotate":-48.54},{"duration":11,"tweenEasing":0,"rotate":-47.99},{"duration":2,"tweenEasing":0,"rotate":74.02},{"tweenEasing":0,"rotate":23.56},{"duration":2,"tweenEasing":0,"rotate":36.86},{"duration":0,"rotate":27.07}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":11,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":3,"x":0.66}]},{"name":"calf_r_f","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":3.58,"y":24.93},{"duration":2,"tweenEasing":0,"x":24.03,"y":-1.21},{"duration":11,"tweenEasing":0,"x":25.87,"y":1.46},{"duration":2,"tweenEasing":0,"x":18.57,"y":36.5},{"tweenEasing":0,"x":12.86,"y":5.84},{"duration":2,"tweenEasing":0,"x":10.5,"y":8.51},{"duration":0,"x":12.29,"y":7.03}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":19.85},{"duration":2,"tweenEasing":0,"rotate":-19.49},{"duration":11,"tweenEasing":0,"rotate":-18},{"duration":2,"tweenEasing":0,"rotate":18.07},{"tweenEasing":0,"rotate":-13.27},{"duration":2,"tweenEasing":0,"rotate":0.17},{"duration":0,"rotate":-8.08}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":0.91},{"duration":11,"tweenEasing":0,"x":0.93},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":3,"x":0.66}]}]},{"duration":20,"name":"hit","bone":[{"name":"calf_l_f","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.02,"y":-0.01},{"duration":9,"tweenEasing":0,"x":0.73,"y":0.31},{"duration":9,"tweenEasing":0,"x":0.84,"y":-0.02},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":13.05},{"duration":9,"tweenEasing":0,"rotate":-47.93},{"duration":9,"tweenEasing":0,"rotate":-34.39},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.95},{"duration":9,"tweenEasing":0,"x":1.03},{"duration":9}]},{"name":"calf_l_m","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.3,"y":-0.05},{"duration":4,"tweenEasing":0,"x":-0.53,"y":0.49},{"duration":2,"tweenEasing":0,"x":-3.24,"y":0.55},{"duration":3,"tweenEasing":0,"x":-0.19,"y":-9.16},{"duration":5,"tweenEasing":0,"x":0.01,"y":0.2},{"duration":4,"tweenEasing":0,"x":-2.21,"y":-8.05},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":10.46},{"duration":4,"tweenEasing":0,"rotate":-25.4},{"duration":2,"tweenEasing":0,"rotate":-22.7},{"duration":3,"tweenEasing":0,"rotate":6.48},{"duration":5,"tweenEasing":0,"rotate":17.53},{"duration":4,"tweenEasing":0,"rotate":22.02},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.06},{"duration":4,"tweenEasing":0,"x":1.2},{"duration":2,"tweenEasing":0,"x":1.18},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0,"x":0.95},{"duration":4,"tweenEasing":0,"x":0.94},{"duration":0}]},{"name":"calf_l_b","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.4,"y":-0.19},{"duration":9,"tweenEasing":0,"x":-0.42,"y":0.18},{"duration":9,"tweenEasing":0,"x":0.07,"y":-0.15},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":33.59},{"duration":9,"tweenEasing":0,"rotate":-25.28},{"duration":9,"tweenEasing":0,"rotate":-27.03},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.08},{"duration":9,"tweenEasing":0,"x":1.14},{"duration":9,"tweenEasing":0,"x":0.95},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.62,"y":-0.11},{"tweenEasing":0,"x":3.3,"y":-0.48},{"duration":8,"tweenEasing":0,"x":-0.05,"y":-0.14},{"duration":9,"tweenEasing":0,"x":-3.74,"y":0.05},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":26.03},{"tweenEasing":0,"rotate":38.58},{"duration":8,"tweenEasing":0,"rotate":19.71},{"duration":9,"tweenEasing":0,"rotate":5.34},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.98},{"duration":17}]},{"name":"upperarm_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-2.08,"y":-1.95},{"tweenEasing":0,"x":0.95,"y":-0.06},{"duration":8,"tweenEasing":0,"x":-3.22,"y":-3.35},{"duration":9,"tweenEasing":0,"x":0.22,"y":-0.5},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-34.33},{"tweenEasing":0,"rotate":-26.2},{"duration":8,"tweenEasing":0,"rotate":-28.91},{"duration":9,"tweenEasing":0,"rotate":-27.3},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.36},{"tweenEasing":0,"x":1.36},{"duration":8,"tweenEasing":0,"x":1.3},{"duration":9,"tweenEasing":0,"x":1.24},{"duration":0}]},{"name":"hand_l","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.1,"y":0.2},{"tweenEasing":0,"x":0.07,"y":0.31},{"duration":8,"tweenEasing":0,"x":0.3,"y":-0.37},{"duration":9,"tweenEasing":0,"x":0.37,"y":-0.39},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-14.92},{"tweenEasing":0,"rotate":-7.86},{"duration":8,"tweenEasing":0,"rotate":-0.01},{"duration":9,"tweenEasing":0,"rotate":-14.76},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":8,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":0.95},{"duration":0}]},{"name":"hand_l_1","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":2.36,"y":-0.5},{"tweenEasing":0,"x":2.77,"y":-0.17},{"duration":8,"tweenEasing":0,"x":-1.74,"y":0.08},{"duration":9,"tweenEasing":0,"x":-3.65,"y":1.31},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-16.66},{"tweenEasing":0,"rotate":-15.61},{"duration":8,"tweenEasing":0,"rotate":-14.8},{"duration":9,"tweenEasing":0,"rotate":4.03},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":8,"tweenEasing":0,"x":0.93},{"duration":9,"tweenEasing":0,"x":0.92},{"duration":0}]},{"name":"thigh_l_f","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-1.27,"y":0.37},{"duration":9,"tweenEasing":0,"x":1.4,"y":0.49},{"duration":9,"tweenEasing":0,"x":0.34,"y":-0.11},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-9.28},{"duration":9,"tweenEasing":0,"rotate":43.95},{"duration":9,"tweenEasing":0,"rotate":19.88},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":0.95},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"thigh_l_m","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-1.32,"y":0.27},{"duration":9,"tweenEasing":0,"x":1.28,"y":0.5},{"duration":9,"tweenEasing":0,"x":0.38,"y":-0.03},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-3.26},{"duration":9,"tweenEasing":0,"rotate":16.1},{"duration":9,"tweenEasing":0,"rotate":-6.46},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.88},{"duration":9,"tweenEasing":0,"x":0.78},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"thigh_l_b","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.81,"y":-0.24},{"duration":9,"tweenEasing":0,"x":0.43,"y":-0.42},{"duration":9,"tweenEasing":0,"x":0.14,"y":-0.3},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-21.39},{"duration":9,"tweenEasing":0,"rotate":-4.78},{"duration":9,"tweenEasing":0,"rotate":1},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.84},{"duration":9,"tweenEasing":0,"x":0.93},{"duration":9,"tweenEasing":0,"x":1.03},{"duration":0}]},{"name":"tail9","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.01,"y":0.02},{"tweenEasing":0,"x":-0.19,"y":-0.02},{"duration":8,"tweenEasing":0,"x":-0.14,"y":-0.11},{"duration":9,"tweenEasing":0,"x":-0.15,"y":-0.05},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":8.78},{"tweenEasing":0,"rotate":9.01},{"duration":8,"tweenEasing":0,"rotate":9},{"duration":9,"tweenEasing":0,"rotate":7.28},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":8,"tweenEasing":0,"x":1.02},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail8","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.02,"y":0.06},{"tweenEasing":0,"x":0.03,"y":-0.02},{"duration":8,"tweenEasing":0,"x":-0.03,"y":-0.11},{"duration":9,"tweenEasing":0,"x":-0.02,"y":-0.08},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":2.51},{"tweenEasing":0,"rotate":3.04},{"duration":8,"tweenEasing":0,"rotate":3.29},{"duration":9,"tweenEasing":0,"rotate":3.25},{"duration":0}]},{"name":"tail7","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.1,"y":0.04},{"tweenEasing":0,"x":-0.34,"y":-0.04},{"duration":8,"tweenEasing":0,"x":-0.3,"y":-0.11},{"duration":9,"tweenEasing":0,"x":-0.45,"y":0.04},{"duration":0,"x":-0.32,"y":-0.03}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":2.25},{"tweenEasing":0,"rotate":2.74},{"duration":8,"tweenEasing":0,"rotate":3.25},{"duration":9,"tweenEasing":0,"rotate":3.25},{"duration":0,"rotate":-0.01}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":8,"tweenEasing":0,"x":0.99},{"duration":9}]},{"name":"tail6","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.04,"y":0.01},{"tweenEasing":0,"x":-0.03,"y":-0.08},{"duration":8,"tweenEasing":0,"x":-0.12,"y":-0.04},{"duration":9,"tweenEasing":0,"x":-0.15,"y":-0.02},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":2.26},{"tweenEasing":0,"rotate":5.51},{"duration":8,"tweenEasing":0,"rotate":7.51},{"duration":9,"tweenEasing":0,"rotate":2.77},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"x":1.02},{"duration":8,"tweenEasing":0,"x":1.01},{"duration":9,"x":1.02}]},{"name":"tail5","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.02},{"tweenEasing":0,"x":-0.02,"y":0.05},{"duration":8,"tweenEasing":0,"x":3.52,"y":-1.39},{"duration":9,"tweenEasing":0,"x":-0.1,"y":0.04},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":3.26},{"tweenEasing":0,"rotate":3.77},{"duration":8,"tweenEasing":0,"rotate":4.66},{"duration":9,"tweenEasing":0,"rotate":3.76},{"duration":0}]},{"name":"tail4","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.07,"y":0.04},{"duration":9,"tweenEasing":0,"x":-0.12,"y":-0.02},{"duration":9,"tweenEasing":0,"x":-0.15},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":2.24},{"duration":9,"tweenEasing":0,"rotate":2.25},{"duration":9,"tweenEasing":0,"rotate":3.23},{"duration":0}]},{"name":"tail3","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.01,"y":-0.17},{"tweenEasing":0,"x":-0.15,"y":-0.03},{"duration":8,"tweenEasing":0,"x":-0.1,"y":-0.11},{"duration":9,"tweenEasing":0,"x":-0.11,"y":-0.13},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-0.02},{"tweenEasing":0,"rotate":0.49},{"duration":8,"tweenEasing":0,"rotate":0.49},{"duration":9,"tweenEasing":0,"rotate":1.74},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":8,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"tail2","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.09,"y":-0.04},{"tweenEasing":0,"x":-0.01},{"duration":8,"tweenEasing":0,"x":3.87,"y":0.27},{"duration":9,"tweenEasing":0,"x":-0.05,"y":0.02},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":2.25},{"tweenEasing":0,"rotate":3.75},{"duration":8,"tweenEasing":0,"rotate":4.37},{"duration":9,"tweenEasing":0,"rotate":3.51},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"tail1","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.01,"y":-0.17},{"duration":9,"tweenEasing":0,"x":-0.01,"y":-0.03},{"duration":9,"tweenEasing":0,"x":-0.07,"y":-0.04},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-5.5},{"duration":9,"tweenEasing":0,"rotate":-5.5},{"duration":9,"tweenEasing":0,"rotate":-3.25},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"tail","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":5.78,"y":7.87},{"duration":9,"tweenEasing":0,"x":-2.21,"y":-4.8},{"duration":9,"tweenEasing":0,"x":-0.55,"y":-1.15},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-16.54},{"duration":9,"tweenEasing":0,"rotate":5.08},{"duration":9,"tweenEasing":0,"rotate":-14.72},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"weapon","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-1.89,"y":-0.61},{"tweenEasing":0,"x":-3.32,"y":-0.75},{"duration":8,"tweenEasing":0,"x":-3.79,"y":-0.71},{"duration":9,"tweenEasing":0,"x":-1.53,"y":-0.49},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-20.19},{"tweenEasing":0,"rotate":-18.77},{"duration":8,"tweenEasing":0,"rotate":-16.55},{"duration":9,"tweenEasing":0,"rotate":8.17},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":1.02},{"duration":0}]},{"name":"pelvis","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":18.75,"y":-13.05},{"duration":9,"tweenEasing":0,"x":-28.5,"y":-11.4},{"duration":9,"tweenEasing":0,"x":-24,"y":2.55},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-4.25},{"duration":9,"tweenEasing":0,"rotate":-1.5},{"duration":9,"tweenEasing":0,"rotate":-0.5},{"duration":0}]},{"name":"chest","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.02,"y":-0.06},{"duration":9,"tweenEasing":0,"x":-0.05,"y":0.06},{"duration":9,"tweenEasing":0,"x":0.07,"y":0.06},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":14.95},{"duration":9,"tweenEasing":0,"rotate":-8.78},{"duration":9,"tweenEasing":0,"rotate":-2.16},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":9}]},{"name":"neck","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.45,"y":0.36},{"duration":9,"tweenEasing":0,"x":-0.06,"y":0.02},{"duration":9,"tweenEasing":0,"x":-0.28,"y":-0.08},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":3.24},{"duration":9,"tweenEasing":0,"rotate":3.08},{"duration":9,"tweenEasing":0,"rotate":1.55},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":9}]},{"name":"head","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.04,"y":-0.08},{"duration":9,"tweenEasing":0,"x":0.06,"y":-0.19},{"duration":9,"tweenEasing":0,"x":-0.03,"y":-0.12},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-13.86},{"duration":9,"tweenEasing":0,"rotate":9.83},{"duration":9,"tweenEasing":0,"rotate":3.02},{"duration":0}]},{"name":"thigh_r_b","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.3,"y":0.16},{"duration":2,"tweenEasing":0,"x":-0.25,"y":0.25},{"tweenEasing":0,"x":-1.53,"y":6.42},{"tweenEasing":0,"x":-1.46,"y":7.39},{"duration":5,"tweenEasing":0,"x":-1.19,"y":7.41},{"duration":9,"tweenEasing":0,"x":-0.08,"y":0.18},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-36.45},{"duration":2,"tweenEasing":0,"rotate":-2.04},{"tweenEasing":0,"rotate":4.77},{"tweenEasing":0,"rotate":10.19},{"duration":5,"tweenEasing":0,"rotate":-2.23},{"duration":9,"tweenEasing":0,"rotate":-2.02},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.04},{"duration":2,"tweenEasing":0,"x":0.94},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":1.12},{"duration":0}]},{"name":"thigh_r_m","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.62,"y":0.15},{"duration":9,"tweenEasing":0,"x":-0.81,"y":0.06},{"duration":9,"tweenEasing":0,"x":-0.28,"y":0.01},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-22.83},{"duration":9,"tweenEasing":0,"rotate":-10.25},{"duration":9,"tweenEasing":0,"rotate":13.82},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.86},{"duration":9,"tweenEasing":0,"x":0.86},{"duration":9}]},{"name":"thigh_r_f","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.94,"y":0.27},{"tweenEasing":0,"x":-0.86,"y":0.01},{"tweenEasing":0,"x":-4.44,"y":-0.09},{"duration":7,"tweenEasing":0,"x":-6.42,"y":0.16},{"duration":9,"tweenEasing":0,"x":-0.37,"y":-0.07},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-1.75},{"tweenEasing":0,"rotate":65.52},{"tweenEasing":0,"rotate":31.59},{"duration":7,"tweenEasing":0,"rotate":14.18},{"duration":9,"tweenEasing":0,"rotate":-14.5},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.9},{"tweenEasing":0,"x":0.82},{"duration":7,"tweenEasing":0,"x":0.87},{"duration":9}]},{"name":"upperarm_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":2.16,"y":0.23},{"tweenEasing":0,"x":0.43,"y":-2.29},{"duration":8,"tweenEasing":0,"x":-3.63,"y":-5.5},{"duration":9,"tweenEasing":0,"x":0.58,"y":-0.89},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-4.11},{"tweenEasing":0,"rotate":-27.77},{"duration":8,"tweenEasing":0,"rotate":3.9},{"duration":9,"tweenEasing":0,"rotate":5.77},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.04},{"duration":8,"tweenEasing":0,"x":1.13},{"duration":9,"tweenEasing":0,"x":1.09},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.03,"y":0.08},{"tweenEasing":0,"x":0.1,"y":-0.02},{"duration":8,"tweenEasing":0,"x":-6.21},{"duration":9,"tweenEasing":0,"x":-6.06,"y":0.04},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-10.03},{"tweenEasing":0,"rotate":40.08},{"duration":8,"tweenEasing":0,"rotate":-21.36},{"duration":9,"tweenEasing":0,"rotate":-34.84},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"hand_r_1","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.05,"y":-0.17},{"tweenEasing":0,"x":0.35,"y":-0.28},{"duration":8,"tweenEasing":0,"x":1.66,"y":2.83},{"duration":9,"tweenEasing":0,"x":1.76,"y":4.21},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-16.26},{"tweenEasing":0,"rotate":-15.74},{"duration":8,"tweenEasing":0,"rotate":-11.2},{"duration":9,"tweenEasing":0,"rotate":6.34},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":17}]},{"name":"hand_r","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.13,"y":0.22},{"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":8,"tweenEasing":0,"x":0.13,"y":-0.09},{"duration":9,"tweenEasing":0,"x":0.08,"y":-0.06},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":-14.26},{"tweenEasing":0,"rotate":-7.99},{"duration":8,"tweenEasing":0,"rotate":3.11},{"duration":9,"tweenEasing":0,"rotate":-11.19},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":8,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"calf_r_b","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":2.02,"y":0.53},{"duration":2,"tweenEasing":0,"x":0.4,"y":-0.08},{"tweenEasing":0,"x":0.14,"y":-0.2},{"tweenEasing":0,"x":0.09,"y":-0.2},{"duration":5,"tweenEasing":0,"x":0.14,"y":-0.13},{"duration":4,"tweenEasing":0,"x":-2.61,"y":-0.19},{"duration":2,"tweenEasing":0,"x":-0.89,"y":-8.05},{"duration":3,"tweenEasing":0,"x":-1.02,"y":4.58},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":46.4},{"duration":2,"tweenEasing":0,"rotate":-19.51},{"tweenEasing":0,"rotate":-29.32},{"tweenEasing":0,"rotate":-21.33},{"duration":5,"tweenEasing":0,"rotate":0.76},{"duration":4,"tweenEasing":0,"rotate":7.98},{"duration":2,"tweenEasing":0,"rotate":11.66},{"duration":3,"tweenEasing":0,"rotate":-3.45},{"duration":0}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"calf_r_m","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-9.96,"y":0.46},{"duration":9,"tweenEasing":0,"x":-8.71,"y":0.02},{"duration":9,"tweenEasing":0,"x":-0.1,"y":-0.42},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":22.62},{"duration":9,"tweenEasing":0,"rotate":-0.39},{"duration":9,"tweenEasing":0,"rotate":-24.53},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.02},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"calf_r_f","translateFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":-0.36,"y":0.49},{"tweenEasing":0,"x":24.45,"y":19.41},{"tweenEasing":0,"x":6.07,"y":12.15},{"duration":7,"tweenEasing":0,"x":-3.71,"y":15.25},{"duration":5,"tweenEasing":0,"x":-8.3,"y":0.69},{"duration":3,"tweenEasing":0,"x":-14.05,"y":1.85},{"tweenEasing":0,"x":1.34,"y":0.02},{"duration":0}],"rotateFrame":[{"tweenEasing":0},{"tweenEasing":0,"rotate":2.98},{"tweenEasing":0,"rotate":0.3},{"tweenEasing":0,"rotate":2.22},{"duration":7,"tweenEasing":0,"rotate":8.16},{"duration":5,"tweenEasing":0,"rotate":5.31},{"duration":3,"tweenEasing":0,"rotate":10.4},{"tweenEasing":0,"rotate":-0.97},{"duration":0}],"scaleFrame":[{"tweenEasing":0},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":1.03},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01},{}]}]},{"duration":14,"fadeInTime":0.2,"name":"skill_01","bone":[{"name":"calf_l_f","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.25,"y":0.17},{"duration":4,"tweenEasing":0,"x":0.26,"y":-0.15},{"tweenEasing":0,"x":0.14,"y":0.08},{"duration":6,"tweenEasing":0,"x":0.89},{"duration":0,"x":0.6,"y":0.11}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-30.58},{"duration":4,"tweenEasing":0,"rotate":-45.67},{"tweenEasing":0,"rotate":-31.37},{"duration":6,"tweenEasing":0,"rotate":-47.68},{"duration":0,"rotate":-8.04}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.91},{"duration":4,"tweenEasing":0,"x":0.86},{"tweenEasing":0,"x":0.92},{"duration":6,"tweenEasing":0},{"duration":0,"x":1.03}]},{"name":"calf_l_m","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.32,"y":0.03},{"duration":4,"tweenEasing":0,"x":0.09,"y":0.25},{"tweenEasing":0,"x":-0.01,"y":0.3},{"duration":6,"tweenEasing":0,"x":0.16,"y":0.45},{"duration":0,"x":-0.02,"y":0.45}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-19.57},{"duration":4,"tweenEasing":0,"rotate":-29.36},{"tweenEasing":0,"rotate":-29.12},{"duration":6,"tweenEasing":0,"rotate":-51.19},{"duration":0,"rotate":-30.87}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.04},{"duration":4,"tweenEasing":0,"x":1.07},{"tweenEasing":0,"x":1.1},{"duration":6,"tweenEasing":0,"x":1.17},{"duration":0,"x":1.15}]},{"name":"calf_l_b","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.63,"y":0.41},{"duration":4,"tweenEasing":0,"x":-0.91,"y":0.35},{"tweenEasing":0,"x":-1.17,"y":0.35},{"duration":6,"tweenEasing":0,"x":-0.55,"y":0.41},{"duration":0,"x":-0.21,"y":0.08}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-11.25},{"duration":4,"tweenEasing":0,"rotate":-16.68},{"tweenEasing":0,"rotate":-14.8},{"duration":6,"tweenEasing":0,"rotate":-49.85},{"duration":0,"rotate":-33.8}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.14},{"duration":4,"tweenEasing":0,"x":1.21},{"tweenEasing":0,"x":1.22},{"duration":6,"tweenEasing":0,"x":1.24},{"duration":0,"x":1.13}]},{"name":"forearm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.19,"y":-0.42},{"duration":4,"tweenEasing":0,"x":-0.07,"y":-0.2},{"tweenEasing":0,"x":0.12,"y":-0.28},{"duration":6,"tweenEasing":0,"x":0.33,"y":-0.42},{"duration":0,"x":-1.38,"y":-0.06}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":2.77},{"duration":4,"tweenEasing":0,"rotate":4.39},{"tweenEasing":0,"rotate":11.49},{"duration":6,"tweenEasing":0,"rotate":-36.36},{"duration":0,"rotate":-22.84}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":6}]},{"name":"upperarm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1,"y":-0.13},{"duration":4,"tweenEasing":0,"x":-1.55,"y":-0.14},{"tweenEasing":0,"x":-2.45,"y":-2.4},{"duration":6,"tweenEasing":0,"x":-0.4,"y":-1.46},{"duration":0,"x":0.3,"y":-0.65}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-18.61},{"duration":4,"tweenEasing":0,"rotate":-28.08},{"tweenEasing":0,"rotate":-33.08},{"duration":6,"tweenEasing":0,"rotate":13.77},{"duration":0,"rotate":-7.27}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.2},{"duration":4,"tweenEasing":0,"x":1.3},{"tweenEasing":0,"x":1.36},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":0,"x":0.97}]},{"name":"hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.25,"y":0.31},{"duration":4,"tweenEasing":0,"x":-0.12,"y":0.17},{"tweenEasing":0,"x":-0.21,"y":0.1},{"duration":6,"tweenEasing":0,"x":0.03,"y":-0.37},{"duration":0,"x":0.38,"y":-0.3}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-7.02},{"duration":4,"tweenEasing":0,"rotate":-10.72},{"tweenEasing":0,"rotate":-11.65},{"duration":6,"tweenEasing":0,"rotate":-26.06},{"duration":0,"rotate":-15.25}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.98},{"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.89},{"duration":0,"x":0.84}]},{"name":"hand_l_1","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.39,"y":-2.08},{"duration":4,"tweenEasing":0,"x":0.96,"y":-3.34},{"tweenEasing":0,"x":1.87,"y":-3.88},{"duration":6,"tweenEasing":0,"x":-0.57,"y":-2.96},{"duration":0,"x":-3.67,"y":-1.12}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-7.78},{"duration":4,"tweenEasing":0,"rotate":-11.97},{"tweenEasing":0,"rotate":-12.4},{"duration":6,"tweenEasing":0,"rotate":1},{"duration":0,"rotate":6.8}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":1.01},{"duration":6,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.95}]},{"name":"thigh_l_f","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.67,"y":0.17},{"duration":4,"tweenEasing":0,"x":-1.79,"y":0.17},{"tweenEasing":0,"x":-1.57,"y":0.2},{"duration":6,"tweenEasing":0,"x":0.07,"y":0.24},{"duration":0,"x":0.6,"y":-0.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":9.22},{"duration":4,"tweenEasing":0,"rotate":13.65},{"tweenEasing":0,"rotate":10.86},{"duration":6,"tweenEasing":0,"rotate":27.12},{"duration":0,"rotate":11.47}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.03},{"duration":4,"tweenEasing":0,"x":1.04},{"tweenEasing":0,"x":1.03},{"duration":6,"tweenEasing":0},{"duration":0,"x":0.95}]},{"name":"thigh_l_m","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.44,"y":-0.08},{"duration":4,"tweenEasing":0,"x":-1.68,"y":0.1},{"tweenEasing":0,"x":-1.53,"y":0.15},{"duration":6,"tweenEasing":0,"x":0.07,"y":0.07},{"duration":0,"x":0.59,"y":0.06}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":7.97},{"duration":4,"tweenEasing":0,"rotate":11.89},{"tweenEasing":0,"rotate":12.86},{"duration":6,"tweenEasing":0,"rotate":23.35},{"duration":0,"rotate":14.72}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.96},{"duration":4,"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.91},{"duration":6,"tweenEasing":0,"x":0.93},{"duration":0,"x":0.91}]},{"name":"thigh_l_b","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.14,"y":0.99},{"duration":4,"tweenEasing":0,"x":-1.5,"y":1.65},{"tweenEasing":0,"x":-1.4,"y":1.66},{"duration":6,"tweenEasing":0,"x":-1.61,"y":1.38},{"duration":0,"x":-0.62,"y":0.35}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-11.22},{"duration":4,"tweenEasing":0,"rotate":-17.09},{"tweenEasing":0,"rotate":-19.35},{"duration":6,"tweenEasing":0,"rotate":-9.83},{"duration":0,"rotate":-5.67}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.81},{"duration":4,"tweenEasing":0,"x":0.72},{"tweenEasing":0,"x":0.67},{"duration":6,"tweenEasing":0,"x":0.85},{"duration":0,"x":0.96}]},{"name":"tail9","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.37,"y":-0.94},{"duration":4,"tweenEasing":0,"x":0.09,"y":0.01},{"tweenEasing":0,"x":0.1,"y":-0.03},{"duration":5,"tweenEasing":0,"x":-0.22,"y":-0.1},{"tweenEasing":0,"x":-0.07,"y":-0.04},{"duration":0,"x":-0.08,"y":0.06}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-2.81},{"duration":4,"tweenEasing":0,"rotate":-4.32},{"tweenEasing":0,"rotate":-4.58},{"duration":5,"tweenEasing":0,"rotate":4.5},{"tweenEasing":0,"rotate":2.21},{"duration":0,"rotate":1.96}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.02,"y":1.01},{"duration":5,"tweenEasing":0,"x":1.01},{"x":0.99}]},{"name":"tail8","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.83,"y":0.15},{"duration":4,"tweenEasing":0,"x":0.11,"y":-0.1},{"tweenEasing":0,"x":0.09,"y":-0.11},{"duration":5,"tweenEasing":0,"x":0.04,"y":-0.1},{"tweenEasing":0,"x":0.42,"y":0.01},{"duration":0,"x":0.44,"y":0.05}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-8.27},{"duration":4,"tweenEasing":0,"rotate":-12.51},{"tweenEasing":0,"rotate":-12.52},{"duration":5,"tweenEasing":0,"rotate":9.55},{"tweenEasing":0,"rotate":2.22},{"duration":0,"rotate":1.47}],"scaleFrame":[{"duration":7,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0},{"x":1.01}]},{"name":"tail7","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.05,"y":-0.12},{"duration":4,"tweenEasing":0,"x":-0.08,"y":-0.18},{"tweenEasing":0,"x":-0.18,"y":-0.13},{"duration":5,"tweenEasing":0,"x":-0.35,"y":0.06},{"tweenEasing":0,"x":-0.14,"y":0.22},{"duration":0,"x":-0.11,"y":0.16}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":1.33},{"duration":4,"tweenEasing":0,"rotate":2.08},{"tweenEasing":0,"rotate":2.09},{"duration":5,"tweenEasing":0,"rotate":18.79},{"tweenEasing":0,"rotate":4.32},{"duration":0,"rotate":2.31}],"scaleFrame":[{"duration":7,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":5,"tweenEasing":0},{"tweenEasing":0},{"duration":0,"x":0.99}]},{"name":"tail6","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.25,"y":-0.08},{"duration":4,"tweenEasing":0,"x":-0.06,"y":-0.15},{"tweenEasing":0,"y":-0.18},{"duration":5,"tweenEasing":0,"x":-0.13,"y":0.07},{"tweenEasing":0,"x":-0.15,"y":0.04},{"duration":0,"x":-0.13,"y":0.01}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-6.58},{"duration":4,"tweenEasing":0,"rotate":-9.81},{"tweenEasing":0,"rotate":-10.05},{"duration":5,"tweenEasing":0,"rotate":0.27},{"tweenEasing":0,"rotate":-16.55},{"duration":0,"rotate":-15.55}],"scaleFrame":[{"duration":7,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":5,"tweenEasing":0,"x":1.03},{"x":1.02}]},{"name":"tail5","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.61,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.24,"y":-0.02},{"tweenEasing":0,"x":0.18,"y":-0.14},{"duration":5,"tweenEasing":0,"x":-0.05,"y":0.07},{"tweenEasing":0,"x":-0.14,"y":0.01},{"duration":0,"x":-0.15,"y":0.03}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":4.03},{"duration":4,"tweenEasing":0,"rotate":6.21},{"tweenEasing":0,"rotate":6.46},{"duration":5,"tweenEasing":0,"rotate":-11.3},{"tweenEasing":0,"rotate":8.75},{"duration":0,"rotate":9.01}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.98},{"duration":6}]},{"name":"tail4","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.77,"y":0.04},{"duration":4,"tweenEasing":0,"x":0.27,"y":-0.1},{"tweenEasing":0,"x":0.24,"y":-0.08},{"duration":5,"tweenEasing":0,"x":-0.08,"y":0.09},{"tweenEasing":0,"x":-0.25,"y":-0.12},{"duration":0,"x":-0.24,"y":-0.13}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":2.98},{"duration":4,"tweenEasing":0,"rotate":4.26},{"tweenEasing":0,"rotate":4.5},{"duration":5,"tweenEasing":0,"rotate":-8.03},{"rotate":10.73}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.97},{"duration":5,"tweenEasing":0},{"x":0.99}]},{"name":"tail3","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.61,"y":0.09},{"duration":4,"tweenEasing":0,"x":0.12},{"tweenEasing":0,"x":0.16,"y":-0.06},{"duration":5,"tweenEasing":0,"x":-0.11},{"tweenEasing":0,"x":-0.09,"y":-0.18},{"duration":0,"x":-0.08,"y":-0.13}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":2.54},{"duration":4,"tweenEasing":0,"rotate":3.79},{"tweenEasing":0,"rotate":2.28},{"duration":5,"tweenEasing":0,"rotate":-7.26},{"tweenEasing":0,"rotate":-9.76},{"duration":0,"rotate":-8.52}],"scaleFrame":[{"duration":7,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":5,"tweenEasing":0},{"x":0.97}]},{"name":"tail2","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.32,"y":0.24},{"duration":4,"tweenEasing":0,"x":0.16,"y":0.09},{"tweenEasing":0,"x":0.26,"y":0.08},{"duration":5,"tweenEasing":0,"x":0.04,"y":0.05},{"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":0,"x":-0.08,"y":-0.08}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":2.97},{"duration":4,"tweenEasing":0,"rotate":4.27},{"tweenEasing":0,"rotate":6.28},{"duration":5,"tweenEasing":0,"rotate":4.76},{"tweenEasing":0,"rotate":-4},{"duration":0,"rotate":-4.25}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0,"x":1.01},{"x":0.98}]},{"name":"tail1","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.27,"y":-0.07},{"duration":4,"tweenEasing":0,"x":-0.03,"y":-0.07},{"tweenEasing":0,"x":-0.02,"y":-0.04},{"duration":5,"tweenEasing":0,"x":-0.11},{"tweenEasing":0,"x":3.26,"y":0.06},{"duration":0,"x":-0.07,"y":-0.08}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":3.79},{"duration":4,"tweenEasing":0,"rotate":5.79},{"tweenEasing":0,"rotate":11.06},{"duration":5,"tweenEasing":0,"rotate":4.25},{"tweenEasing":0,"rotate":-16.73},{"duration":0,"rotate":-15.27}],"scaleFrame":[{"duration":7,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0},{"x":0.98}]},{"name":"tail","translateFrame":[{"duration":3,"tweenEasing":0,"x":1.23,"y":2.1},{"duration":4,"tweenEasing":0,"x":1.94,"y":3.28},{"tweenEasing":0,"x":1.21,"y":2.19},{"duration":6,"tweenEasing":0,"x":-2.52,"y":-5.79},{"duration":0,"x":-1.95,"y":-4.14}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":6.21},{"duration":4,"tweenEasing":0,"rotate":9.34},{"tweenEasing":0,"rotate":11.32},{"duration":6,"tweenEasing":0,"rotate":-0.73},{"duration":0,"rotate":-2.07}],"scaleFrame":[{"duration":7,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":6,"tweenEasing":0},{"duration":0,"x":0.99}]},{"name":"weapon","translateFrame":[{"duration":3,"tweenEasing":0,"x":-3.19,"y":0.32},{"duration":4,"tweenEasing":0,"x":-3.68,"y":-0.63},{"tweenEasing":0,"x":-4.58,"y":-0.53},{"duration":2,"tweenEasing":0,"x":-2.73,"y":-0.7},{"duration":3,"tweenEasing":0,"x":-1.85,"y":-0.43},{"tweenEasing":0,"x":2.87,"y":2.16},{"duration":0,"x":2.96,"y":2.07}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-4.92},{"duration":4,"tweenEasing":0,"rotate":-7.31},{"tweenEasing":0,"rotate":-9.14},{"duration":2,"tweenEasing":0,"rotate":-3.94},{"duration":3,"tweenEasing":0,"rotate":9.54},{"tweenEasing":0,"rotate":29.47},{"duration":0,"rotate":28.21}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01},{}]},{"name":"pelvis","translateFrame":[{"duration":3,"tweenEasing":0,"x":-9.7,"y":-14.8},{"duration":4,"tweenEasing":0,"x":-14.45,"y":-22.2},{"tweenEasing":0,"x":-14.5,"y":-24.65},{"duration":6,"tweenEasing":0,"x":-45.3,"y":-11},{"duration":0,"x":-31,"y":-7.15}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":10.05},{"duration":4,"tweenEasing":0,"rotate":15.27},{"tweenEasing":0,"rotate":15.27},{"duration":6,"tweenEasing":0,"rotate":15.52},{"duration":0,"rotate":6.26}],"scaleFrame":[{"duration":8,"tweenEasing":0,"y":1.01},{"duration":6,"tweenEasing":0,"y":1.01},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.83,"y":-0.27},{"duration":4,"tweenEasing":0,"x":-1.34,"y":-0.28},{"tweenEasing":0,"x":-1.24,"y":-0.33},{"duration":6,"tweenEasing":0,"x":-1.22,"y":-0.19},{"duration":0,"x":-0.72,"y":-0.13}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":0.84},{"duration":4,"tweenEasing":0,"rotate":1.18},{"tweenEasing":0,"rotate":-0.83},{"duration":6,"tweenEasing":0,"rotate":-14.59},{"duration":0,"rotate":-9.93}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":6}]},{"name":"neck","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.46,"y":0.75},{"duration":4,"tweenEasing":0,"x":0.18,"y":0.35},{"tweenEasing":0,"x":0.22,"y":0.43},{"duration":6,"tweenEasing":0,"x":-0.09,"y":0.6},{"duration":0,"x":-0.29,"y":-0.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-1.8},{"duration":4,"tweenEasing":0,"rotate":-2.68},{"tweenEasing":0,"rotate":3.81},{"duration":6,"tweenEasing":0,"rotate":3.78},{"duration":0,"rotate":2.43}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":6}]},{"name":"head","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.04,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.05},{"tweenEasing":0,"x":-0.02,"y":-0.11},{"duration":6,"tweenEasing":0,"x":-0.04,"y":-0.04},{"duration":0,"x":0.03,"y":-0.1}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-23.37},{"duration":4,"tweenEasing":0,"rotate":-35.15},{"tweenEasing":0,"rotate":-39.68},{"duration":6,"tweenEasing":0,"rotate":-24.33},{"duration":0,"rotate":-12.77}],"scaleFrame":[{"duration":14,"x":0.99}]},{"name":"thigh_r_b","translateFrame":[{"duration":2,"tweenEasing":0,"x":0.37,"y":-0.62},{"tweenEasing":0,"x":0.62,"y":-0.64},{"tweenEasing":0,"x":1.24,"y":-1.32},{"duration":3,"tweenEasing":0,"x":-0.12,"y":-1.62},{"tweenEasing":0,"x":1.34,"y":-1.37},{"duration":2,"tweenEasing":0,"x":1.39,"y":-1.16},{"duration":4,"tweenEasing":0,"x":2.83,"y":3.18},{"duration":0,"x":0.52,"y":-0.41}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-30.53},{"tweenEasing":0,"rotate":-40.76},{"tweenEasing":0,"rotate":-56.77},{"duration":3,"tweenEasing":0,"rotate":-71},{"tweenEasing":0,"rotate":-71.25},{"duration":2,"tweenEasing":0,"rotate":-13.86},{"duration":4,"tweenEasing":0,"rotate":-6.27},{"duration":0,"rotate":-13.46}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":0.84},{"tweenEasing":0,"x":0.79},{"tweenEasing":0,"x":0.75},{"duration":3,"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":0.92},{"duration":2,"tweenEasing":0,"x":0.77},{"duration":4,"tweenEasing":0,"x":0.84},{"duration":0,"x":0.97}]},{"name":"thigh_r_m","translateFrame":[{"duration":2,"tweenEasing":0,"x":-0.61,"y":0.48},{"tweenEasing":0,"x":0.11,"y":0.31},{"duration":4,"tweenEasing":0,"x":0.88,"y":0.13},{"tweenEasing":0,"x":0.69,"y":0.14},{"duration":6,"tweenEasing":0,"x":-0.24,"y":0.21},{"duration":0,"x":-0.37,"y":-0.08}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":19.94},{"tweenEasing":0,"rotate":11.86},{"duration":4,"tweenEasing":0,"rotate":16.08},{"tweenEasing":0,"rotate":8.04},{"duration":6,"tweenEasing":0,"rotate":20.29},{"duration":0,"rotate":1.67}],"scaleFrame":[{"duration":14,"x":0.86}]},{"name":"thigh_r_f","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.27,"y":0.21},{"duration":4,"tweenEasing":0,"x":1.13,"y":0.19},{"tweenEasing":0,"x":0.93,"y":0.29},{"duration":6,"tweenEasing":0,"x":-0.23,"y":0.37},{"duration":0,"x":-0.44,"y":-0.11}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":17.03},{"duration":4,"tweenEasing":0,"rotate":25.46},{"tweenEasing":0,"rotate":29.94},{"duration":6,"tweenEasing":0,"rotate":56.96},{"duration":0,"rotate":46.6}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.05},{"duration":4,"tweenEasing":0,"x":1.08},{"tweenEasing":0,"x":1.03},{"duration":6,"tweenEasing":0,"x":1.34},{"duration":0,"x":1.06}]},{"name":"upperarm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.63,"y":6.12},{"duration":4,"tweenEasing":0,"x":1.54,"y":9.13},{"tweenEasing":0,"x":2.74,"y":7.28},{"duration":6,"tweenEasing":0,"x":0.7,"y":6.11},{"duration":0,"x":-0.25,"y":3.01}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-20.86},{"duration":4,"tweenEasing":0,"rotate":-31.39},{"tweenEasing":0,"rotate":-39.18},{"duration":6,"tweenEasing":0,"rotate":5.22},{"duration":0,"rotate":1.77}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.06},{"duration":6,"tweenEasing":0,"x":1.06},{"duration":0,"x":1.19}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.21,"y":0.01},{"duration":4,"tweenEasing":0,"x":0.13,"y":0.08},{"tweenEasing":0,"x":0.13,"y":0.11},{"duration":6,"tweenEasing":0,"x":0.01,"y":0.32},{"duration":0,"x":-6.11,"y":0.03}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":6.5},{"duration":4,"tweenEasing":0,"rotate":9.75},{"tweenEasing":0,"rotate":20.51},{"duration":6,"tweenEasing":0,"rotate":-27.06},{"duration":0,"rotate":-34.66}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.96},{"duration":6,"tweenEasing":0,"x":0.95},{"duration":0,"x":0.97}]},{"name":"hand_r_1","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.28,"y":-0.45},{"duration":4,"tweenEasing":0,"x":-0.19,"y":-0.94},{"tweenEasing":0,"x":-0.83,"y":-1.32},{"duration":6,"tweenEasing":0,"x":0.68,"y":0.05},{"duration":0,"x":2.2,"y":2.83}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-6.56},{"duration":4,"tweenEasing":0,"rotate":-10.04},{"tweenEasing":0,"rotate":-10.65},{"duration":6,"tweenEasing":0,"rotate":4.08},{"duration":0,"rotate":17.86}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.95},{"duration":6,"x":0.99}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.02,"y":0.19},{"duration":4,"tweenEasing":0,"x":0.02,"y":0.17},{"tweenEasing":0,"y":0.13},{"duration":6,"tweenEasing":0,"x":-0.3,"y":0.11},{"duration":0,"x":0.17}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-8.02},{"duration":4,"tweenEasing":0,"rotate":-12.04},{"tweenEasing":0,"rotate":-13.16},{"duration":6,"tweenEasing":0,"rotate":-24.73},{"duration":0,"rotate":-5.69}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.98},{"duration":6,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"calf_r_b","translateFrame":[{"duration":2,"tweenEasing":0,"x":-1.86,"y":1.03},{"tweenEasing":0,"x":-1.79,"y":0.46},{"tweenEasing":0,"x":2.88,"y":0.7},{"duration":3,"tweenEasing":0,"x":2.32,"y":0.69},{"tweenEasing":0,"x":2.33,"y":0.69},{"duration":2,"tweenEasing":0,"x":0.81,"y":-0.34},{"duration":4,"tweenEasing":0,"x":0.48,"y":-0.34},{"duration":0,"x":-2.19,"y":-0.07}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":8.91},{"tweenEasing":0,"rotate":11.95},{"tweenEasing":0,"rotate":34.28},{"duration":3,"tweenEasing":0,"rotate":57.2},{"tweenEasing":0,"rotate":57.2},{"duration":2,"tweenEasing":0,"rotate":-13.64},{"duration":4,"tweenEasing":0,"rotate":-16.72},{"duration":0,"rotate":4.79}],"scaleFrame":[{"duration":2,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"calf_r_m","translateFrame":[{"duration":2,"tweenEasing":0,"x":-7.55,"y":-0.35},{"tweenEasing":0,"x":-12.7,"y":-0.52},{"duration":4,"tweenEasing":0,"x":-14.14,"y":-0.66},{"tweenEasing":0,"x":-17.18,"y":-0.59},{"duration":6,"tweenEasing":0,"x":-4.6,"y":-0.87},{"duration":0,"x":-0.72,"y":-0.44}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-32.48},{"tweenEasing":0,"rotate":-21.96},{"duration":4,"tweenEasing":0,"rotate":-28.47},{"tweenEasing":0,"rotate":-19.96},{"duration":6,"tweenEasing":0,"rotate":-37.22},{"duration":0,"rotate":-8.69}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.02},{"duration":6,"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"calf_r_f","translateFrame":[{"duration":3,"tweenEasing":0,"x":12.05,"y":-2.55},{"duration":4,"tweenEasing":0,"x":18.15,"y":-6.09},{"tweenEasing":0,"x":19.99,"y":-2.92},{"duration":6,"tweenEasing":0,"x":34.5,"y":9.3},{"duration":0,"x":23.4,"y":8.19}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-11.09},{"duration":4,"tweenEasing":0,"rotate":-16.71},{"tweenEasing":0,"rotate":-14.48},{"duration":6,"tweenEasing":0,"rotate":-21.55},{"duration":0,"rotate":-8.1}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.96},{"duration":4,"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.96},{"duration":6,"tweenEasing":0,"x":0.91},{"duration":0,"x":0.98}]}]},{"duration":28,"fadeInTime":0.2,"name":"skill_03","frame":[{"duration":27},{"events":[{"name":"onTimeStart"}]},{"duration":0,"action":"skill_03_1"}],"bone":[{"name":"calf_l_f","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.56,"y":-0.1},{"duration":3,"tweenEasing":0,"x":-0.72,"y":0.01},{"duration":3,"tweenEasing":0,"x":0.78,"y":-0.02},{"duration":0,"x":0.18,"y":0.43}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":12.79},{"duration":3,"tweenEasing":0,"rotate":13.04},{"duration":3,"tweenEasing":0,"rotate":-23.1},{"duration":0,"rotate":-92.51}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":1.06},{"duration":3,"tweenEasing":0,"x":1.08},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"calf_l_m","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.46,"y":-0.27},{"duration":3,"tweenEasing":0,"x":-0.49,"y":-0.43},{"duration":3,"tweenEasing":0,"x":-0.12,"y":0.14},{"duration":0,"x":0.34,"y":0.56}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":16.22},{"duration":3,"tweenEasing":0,"rotate":19.21},{"duration":3,"tweenEasing":0,"rotate":-16.06},{"duration":0,"rotate":-51.69}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":1.08},{"duration":3,"tweenEasing":0,"x":1.09},{"duration":3,"tweenEasing":0,"x":1.09},{"duration":0,"x":1.08}]},{"name":"calf_l_b","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.2,"y":0.01},{"duration":3,"tweenEasing":0,"x":-0.24,"y":-0.01},{"duration":3,"tweenEasing":0,"x":-0.21,"y":-0.02},{"duration":0,"x":-6.07,"y":0.39}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":22.81},{"duration":3,"tweenEasing":0,"rotate":24.06},{"duration":3,"tweenEasing":0,"rotate":-13.02},{"duration":0,"rotate":-25.06}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0,"x":1.08},{"duration":0,"x":1.26}]},{"name":"forearm_l","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.82,"y":-0.37},{"duration":3,"tweenEasing":0,"x":-0.68,"y":-0.34},{"duration":3,"tweenEasing":0,"x":-1.05,"y":-0.24},{"duration":0,"x":-0.11,"y":-0.24}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-64.9},{"duration":3,"tweenEasing":0,"rotate":-68.54},{"duration":3,"tweenEasing":0,"rotate":-46.37},{"duration":0,"rotate":0.2}]},{"name":"upperarm_l","translateFrame":[{"duration":22,"tweenEasing":0,"x":2.09,"y":5.12},{"duration":3,"tweenEasing":0,"x":2.29,"y":4.47},{"duration":3,"tweenEasing":0,"x":1.38,"y":5.04},{"duration":0,"x":-0.39,"y":6.34}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":77.54},{"duration":3,"tweenEasing":0,"rotate":73.79},{"duration":3,"tweenEasing":0,"rotate":42.93},{"duration":0,"rotate":-26.11}],"scaleFrame":[{"duration":22,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0,"x":0.9},{"duration":0,"x":1.05}]},{"name":"hand_l","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.14,"y":0.06},{"duration":3,"tweenEasing":0,"x":0.24,"y":-0.01},{"duration":3,"tweenEasing":0,"x":-0.08,"y":0.03},{"duration":0,"x":-0.17,"y":-0.14}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-13.76},{"duration":3,"tweenEasing":0,"rotate":-16.77},{"duration":3,"tweenEasing":0,"rotate":-5.72},{"duration":0,"rotate":8.53}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0,"x":0.96},{"duration":3,"x":1.01}]},{"name":"hand_l_1","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.13,"y":-1.04},{"duration":3,"tweenEasing":0,"x":-0.97,"y":-0.48},{"duration":3,"tweenEasing":0,"x":0.59,"y":-0.12},{"duration":0,"x":0.51,"y":-0.49}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-0.74},{"duration":3,"tweenEasing":0,"rotate":-0.25},{"duration":3,"tweenEasing":0,"rotate":1.55},{"duration":0,"rotate":2.53}],"scaleFrame":[{"duration":22,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":3,"x":1.02}]},{"name":"thigh_l_f","translateFrame":[{"duration":22,"tweenEasing":0,"x":1.01,"y":0.45},{"duration":3,"tweenEasing":0,"x":1.37,"y":0.59},{"duration":3,"tweenEasing":0,"x":-0.24,"y":0.2},{"duration":0,"x":-2.54,"y":0.34}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":7.12},{"duration":3,"tweenEasing":0,"rotate":11.31},{"duration":3,"tweenEasing":0,"rotate":14.63},{"duration":0,"rotate":31.49}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.87},{"duration":3,"tweenEasing":0,"x":0.83},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":0,"x":0.97}]},{"name":"thigh_l_m","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.83,"y":0.48},{"duration":3,"tweenEasing":0,"x":1.12,"y":0.66},{"duration":3,"tweenEasing":0,"x":-0.27,"y":0.08},{"duration":0,"x":-2.4,"y":0.2}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-4.64},{"duration":3,"tweenEasing":0,"rotate":-5.7},{"duration":3,"tweenEasing":0,"rotate":7.83},{"duration":0,"rotate":20.52}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.85},{"duration":3,"tweenEasing":0,"x":0.82},{"duration":3,"tweenEasing":0,"x":0.93},{"duration":0,"x":0.95}]},{"name":"thigh_l_b","translateFrame":[{"duration":22,"tweenEasing":0,"x":1.5,"y":-0.78},{"duration":3,"tweenEasing":0,"x":1.6,"y":-0.81},{"duration":3,"tweenEasing":0,"x":0.18,"y":-0.14},{"duration":0,"x":-1.49,"y":1.58}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-8.67},{"duration":3,"tweenEasing":0,"rotate":-8.68},{"duration":3,"tweenEasing":0,"rotate":-3.01},{"duration":0,"rotate":-19.85}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0,"x":0.96},{"duration":0,"x":0.66}]},{"name":"tail9","translateFrame":[{"duration":22,"tweenEasing":0,"y":0.06},{"duration":3,"tweenEasing":0,"x":-0.04,"y":0.04},{"duration":3,"tweenEasing":0,"x":-0.13,"y":-0.07},{"duration":0,"x":-0.09,"y":0.03}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-0.55},{"duration":3,"tweenEasing":0,"rotate":-2.53},{"duration":3,"tweenEasing":0,"rotate":-0.26},{"duration":0,"rotate":1.89}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":0,"x":1.04,"y":1.01}]},{"name":"tail8","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.51,"y":0.1},{"duration":3,"tweenEasing":0,"x":0.54,"y":0.12},{"duration":3,"tweenEasing":0,"x":0.1,"y":0.03},{"duration":0,"x":0.07,"y":-0.15}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-1.79},{"duration":3,"tweenEasing":0,"rotate":11.99},{"duration":3,"tweenEasing":0,"rotate":10.8},{"duration":0,"rotate":5.28}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":0,"x":1.03}]},{"name":"tail7","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.02,"y":0.11},{"duration":3,"tweenEasing":0,"x":-0.03,"y":0.19},{"duration":3,"tweenEasing":0,"x":-0.25,"y":-0.08},{"duration":0,"x":-0.22,"y":-0.18}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":1.04},{"duration":3,"tweenEasing":0,"rotate":-5.72},{"duration":3,"tweenEasing":0,"rotate":-4.77},{"duration":0,"rotate":-2.18}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0},{"duration":0,"x":0.99}]},{"name":"tail6","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.17,"y":0.07},{"duration":3,"tweenEasing":0,"x":-0.14,"y":0.05},{"duration":3,"tweenEasing":0,"y":-0.01},{"duration":0,"x":-0.07,"y":-0.14}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-1.99},{"duration":3,"tweenEasing":0,"rotate":-0.99},{"duration":3,"tweenEasing":0,"rotate":1.49},{"duration":0,"rotate":5.46}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":0,"x":0.99}]},{"name":"tail5","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.11,"y":0.04},{"duration":3,"tweenEasing":0,"x":-0.02,"y":0.04},{"duration":3,"tweenEasing":0,"x":0.03,"y":0.03},{"duration":0,"x":0.22,"y":-0.07}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-0.78},{"duration":3,"tweenEasing":0,"rotate":-2.02},{"duration":3,"tweenEasing":0,"rotate":-2.76},{"duration":0,"rotate":-3.04}],"scaleFrame":[{"duration":25,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":0,"x":0.99}]},{"name":"tail4","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.15,"y":0.03},{"duration":3,"tweenEasing":0,"x":-0.1,"y":-0.17},{"duration":3,"tweenEasing":0,"x":-0.07,"y":0.07},{"duration":0,"x":0.21}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-1.53},{"duration":3,"tweenEasing":0,"rotate":3.22},{"duration":3,"tweenEasing":0,"rotate":4.02},{"duration":0,"rotate":5.01}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0},{"duration":0,"x":0.98}]},{"name":"tail3","translateFrame":[{"duration":22,"tweenEasing":0,"y":-0.08},{"duration":3,"tweenEasing":0,"x":-0.12,"y":-0.08},{"duration":3,"tweenEasing":0,"x":-0.06,"y":0.03},{"duration":0,"x":0.15,"y":-0.06}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-1.77},{"duration":3,"tweenEasing":0,"rotate":0.74},{"duration":3,"tweenEasing":0,"rotate":2.26},{"duration":0,"rotate":4.8}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":3}]},{"name":"tail2","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.03,"y":-0.01},{"duration":3,"tweenEasing":0,"x":0.09},{"duration":3,"tweenEasing":0,"x":0.03,"y":0.08},{"duration":0,"x":0.21,"y":0.13}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-1.75},{"duration":3,"tweenEasing":0,"rotate":3.52},{"duration":3,"tweenEasing":0,"rotate":1.25},{"duration":0,"rotate":-1.75}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"tail1","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.05,"y":-0.09},{"duration":3,"tweenEasing":0,"x":0.03,"y":-0.01},{"duration":3,"tweenEasing":0,"x":-0.03,"y":-0.04},{"duration":0,"x":0.02,"y":0.01}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-2},{"duration":3,"tweenEasing":0,"rotate":-17.53},{"duration":3,"tweenEasing":0,"rotate":-10.76},{"duration":0,"rotate":-0.23}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"tail","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.66,"y":1.22},{"duration":3,"tweenEasing":0,"x":-0.17,"y":-0.03},{"duration":3,"tweenEasing":0,"x":2.84,"y":4.23},{"duration":0,"x":8.17,"y":10.12}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-5.64},{"duration":3,"tweenEasing":0,"rotate":3.8},{"duration":3,"tweenEasing":0,"rotate":7.57},{"duration":0,"rotate":12.19}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":3,"x":1.01}]},{"name":"weapon","translateFrame":[{"duration":22,"tweenEasing":0,"x":3.1,"y":2.29},{"duration":3,"tweenEasing":0,"x":2.19,"y":1.46},{"duration":3,"tweenEasing":0,"x":-1.83,"y":-0.52},{"duration":0,"x":-7.39,"y":0.6}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":5.64},{"duration":3,"tweenEasing":0,"rotate":9.64},{"duration":3,"tweenEasing":0,"rotate":-4.14},{"duration":0,"rotate":-23.64}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":0,"x":1.02}]},{"name":"pelvis","translateFrame":[{"duration":22,"tweenEasing":0,"x":11.05,"y":-7.05},{"duration":3,"tweenEasing":0,"x":11.6,"y":-7},{"duration":3,"tweenEasing":0,"x":-12.95,"y":-8.65},{"duration":0,"x":-27.2,"y":-28.3}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-10.01},{"duration":3,"tweenEasing":0,"rotate":-11.01},{"duration":3,"tweenEasing":0},{"duration":0,"rotate":15.52}],"scaleFrame":[{"duration":22,"tweenEasing":0,"y":0.99},{"duration":3,"tweenEasing":0,"y":0.99},{"duration":3,"tweenEasing":0},{"duration":0,"y":1.01}]},{"name":"chest","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.09,"y":-0.01},{"duration":3,"tweenEasing":0,"x":-0.05,"y":-0.02},{"duration":3,"tweenEasing":0,"x":-1.44,"y":-0.28},{"duration":0,"x":-3.62,"y":-0.47}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":2.13},{"duration":3,"tweenEasing":0,"rotate":-0.64},{"duration":3,"tweenEasing":0,"rotate":2.5},{"duration":0,"rotate":7.19}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"neck","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.29,"y":-0.08},{"duration":3,"tweenEasing":0,"x":0.27,"y":-0.16},{"duration":3,"tweenEasing":0,"x":0.07,"y":0.35},{"duration":0,"x":0.28,"y":0.53}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-9.89},{"duration":3,"tweenEasing":0,"rotate":-7.46},{"duration":3,"tweenEasing":0,"rotate":-12.45},{"duration":0,"rotate":-20.39}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"head","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.16,"y":-0.08},{"duration":3,"tweenEasing":0,"x":0.15,"y":-0.12},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.14},{"duration":0,"x":-0.02,"y":-0.11}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":9.39},{"duration":3,"tweenEasing":0,"rotate":9.15},{"duration":3,"tweenEasing":0,"rotate":-6.44},{"duration":0,"rotate":-28.81}],"scaleFrame":[{"duration":22,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":0,"x":0.98}]},{"name":"thigh_r_b","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.99,"y":0.71},{"duration":3,"tweenEasing":0,"x":-1.14,"y":0.84},{"duration":3,"tweenEasing":0,"x":-0.02,"y":0.02},{"duration":0,"x":1.25,"y":-1.25}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-15.22},{"duration":3,"tweenEasing":0,"rotate":-15.24},{"duration":3,"tweenEasing":0,"rotate":-38.89},{"duration":0,"rotate":-78.76}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":1.21},{"duration":3,"tweenEasing":0,"x":1.22},{"duration":3,"tweenEasing":0,"x":1.05},{"duration":0,"x":0.99}]},{"name":"thigh_r_m","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.47,"y":0.1},{"duration":3,"tweenEasing":0,"x":-0.79,"y":0.04},{"duration":3,"tweenEasing":0,"x":-0.01,"y":0.12},{"duration":0,"x":1.11,"y":0.15}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-26.51},{"duration":3,"tweenEasing":0,"rotate":-28.59},{"duration":3,"tweenEasing":0,"rotate":5.56},{"duration":0,"rotate":48.04}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.97},{"duration":3,"tweenEasing":0,"x":1.04},{"duration":3,"x":0.86}]},{"name":"thigh_r_f","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.34,"y":-0.01},{"duration":3,"tweenEasing":0,"x":-0.67,"y":-0.05},{"duration":3,"tweenEasing":0,"x":0.11,"y":0.21},{"duration":0,"x":1.43,"y":0.29}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":3.11},{"duration":3,"tweenEasing":0,"rotate":4.03},{"duration":3,"tweenEasing":0,"rotate":25.67},{"duration":0,"rotate":22.53}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.87},{"duration":3,"tweenEasing":0,"x":0.87},{"duration":3,"tweenEasing":0,"x":0.82},{"duration":0,"x":1.11}]},{"name":"upperarm_r","translateFrame":[{"duration":22,"tweenEasing":0,"x":-1.62,"y":0.89},{"duration":3,"tweenEasing":0,"x":-1.67,"y":-0.18},{"duration":3,"tweenEasing":0,"x":-1.23,"y":2.79},{"duration":0,"x":-0.43,"y":6.75}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":50.98},{"duration":3,"tweenEasing":0,"rotate":49.73},{"duration":3,"tweenEasing":0,"rotate":30.37},{"duration":0,"rotate":-15.53}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":1.08},{"duration":3,"tweenEasing":0,"x":1.06},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":0,"x":1.16}]},{"name":"forearm_r","translateFrame":[{"duration":22,"tweenEasing":0,"x":-0.13,"y":0.2},{"duration":3,"tweenEasing":0,"x":-0.04,"y":0.21},{"duration":3,"tweenEasing":0,"x":-0.07,"y":0.18},{"duration":0,"x":-6.01}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-37.88},{"duration":3,"tweenEasing":0,"rotate":-44.62},{"duration":3,"tweenEasing":0,"rotate":-31.05},{"duration":0,"rotate":-7.62}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.95},{"duration":0,"x":0.91,"y":0.99}]},{"name":"hand_r_1","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.36,"y":-0.14},{"duration":3,"tweenEasing":0,"x":1.21,"y":0.82},{"duration":3,"tweenEasing":0,"x":1.54,"y":0.7},{"duration":0,"x":3.08,"y":1.52}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":0.21},{"duration":3,"tweenEasing":0,"rotate":1.39},{"duration":3,"tweenEasing":0,"rotate":5.08},{"duration":0,"rotate":9.63}],"scaleFrame":[{"duration":22,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.95}]},{"name":"hand_r","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.09,"y":0.03},{"duration":3,"tweenEasing":0,"x":0.33,"y":-0.04},{"duration":3,"tweenEasing":0,"x":0.11,"y":0.07},{"duration":0,"x":0.21,"y":0.06}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-19.56},{"duration":3,"tweenEasing":0,"rotate":-18.89},{"duration":3,"tweenEasing":0,"rotate":-4.69},{"duration":0,"rotate":15.88}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.94}]},{"name":"calf_r_b","translateFrame":[{"duration":22,"tweenEasing":0,"x":-2.68,"y":0.32},{"duration":3,"tweenEasing":0,"x":-2.75,"y":0.33},{"duration":3,"tweenEasing":0,"x":2.2,"y":0.4},{"duration":0,"x":2.24,"y":0.77}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":27.78},{"duration":3,"tweenEasing":0,"rotate":29.28},{"duration":3,"tweenEasing":0,"rotate":50.92},{"duration":0,"rotate":65.93}],"scaleFrame":[{"duration":25,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":0,"x":1.01}]},{"name":"calf_r_m","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.03,"y":0.8},{"duration":3,"tweenEasing":0,"x":-0.09,"y":0.73},{"duration":3,"tweenEasing":0,"x":-5.25,"y":-0.27},{"duration":0,"x":-18.21,"y":-1.15}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":34.14},{"duration":3,"tweenEasing":0,"rotate":38.38},{"duration":3,"tweenEasing":0,"rotate":-14.96},{"duration":0,"rotate":-68.12}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":0,"x":1.02}]},{"name":"calf_r_f","translateFrame":[{"duration":22,"tweenEasing":0,"x":0.16,"y":13.98},{"duration":3,"tweenEasing":0,"x":-0.27,"y":17.71},{"duration":3,"tweenEasing":0,"x":13.26,"y":2.89},{"duration":0,"x":16.83,"y":-7.84}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":12.88},{"duration":3,"tweenEasing":0,"rotate":16.07},{"duration":3,"tweenEasing":0,"rotate":-4.95},{"duration":0,"rotate":-17.38}],"scaleFrame":[{"duration":22,"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0},{"duration":0,"x":0.95}]}]},{"duration":6,"playTimes":0,"fadeInTime":0.1,"name":"skill_03_1","bone":[{"name":"calf_l_f","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.18,"y":0.43},{"duration":3,"tweenEasing":0,"x":0.25,"y":0.39},{"duration":0,"x":0.18,"y":0.43}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-92.51},{"duration":3,"tweenEasing":0,"rotate":-92.52},{"duration":0,"rotate":-92.51}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"calf_l_m","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.34,"y":0.56},{"duration":3,"tweenEasing":0,"x":0.35,"y":0.37},{"duration":0,"x":0.34,"y":0.56}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-51.69},{"duration":3,"tweenEasing":0,"rotate":-57.46},{"duration":0,"rotate":-51.69}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.08},{"duration":3,"tweenEasing":0,"x":1.09},{"duration":0,"x":1.08}]},{"name":"calf_l_b","translateFrame":[{"duration":3,"tweenEasing":0,"x":-6.07,"y":0.39},{"duration":3,"tweenEasing":0,"x":-7.42,"y":0.41},{"duration":0,"x":-6.07,"y":0.39}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-25.06},{"duration":3,"tweenEasing":0,"rotate":-24.81},{"duration":0,"rotate":-25.06}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.26},{"duration":3,"tweenEasing":0,"x":1.27},{"duration":0,"x":1.26}]},{"name":"forearm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.11,"y":-0.24},{"duration":3,"tweenEasing":0,"x":0.16,"y":-0.38},{"duration":0,"x":-0.11,"y":-0.24}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":0.2},{"duration":3,"tweenEasing":0,"rotate":25.08},{"duration":0,"rotate":0.2}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"upperarm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.39,"y":6.34},{"duration":3,"tweenEasing":0,"x":-0.25,"y":7.25},{"duration":0,"x":-0.39,"y":6.34}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-26.11},{"duration":3,"tweenEasing":0,"rotate":-48.54},{"duration":0,"rotate":-26.11}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.05},{"duration":3,"tweenEasing":0,"x":1.36},{"duration":0,"x":1.05}]},{"name":"hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.17,"y":-0.14},{"duration":3,"tweenEasing":0,"x":-0.18,"y":-0.18},{"duration":0,"x":-0.17,"y":-0.14}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":8.53},{"duration":3,"tweenEasing":0,"rotate":-0.92},{"duration":0,"rotate":8.53}],"scaleFrame":[{"duration":6,"x":1.01}]},{"name":"hand_l_1","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.51,"y":-0.49},{"duration":3,"tweenEasing":0,"x":1.58,"y":-0.09},{"duration":0,"x":0.51,"y":-0.49}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":2.53},{"duration":3,"tweenEasing":0,"rotate":14.86},{"duration":0,"rotate":2.53}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.05},{"duration":0,"x":1.02}]},{"name":"thigh_l_f","translateFrame":[{"duration":3,"tweenEasing":0,"x":-2.54,"y":0.34},{"duration":3,"tweenEasing":0,"x":-2.47,"y":0.35},{"duration":0,"x":-2.54,"y":0.34}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":31.49},{"duration":3,"tweenEasing":0,"rotate":31.74},{"duration":0,"rotate":31.49}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.97},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.97}]},{"name":"thigh_l_m","translateFrame":[{"duration":3,"tweenEasing":0,"x":-2.4,"y":0.2},{"duration":3,"tweenEasing":0,"x":-2.33,"y":0.21},{"duration":0,"x":-2.4,"y":0.2}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":20.52},{"duration":3,"tweenEasing":0,"rotate":23.28},{"duration":0,"rotate":20.52}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.95},{"duration":3,"tweenEasing":0,"x":0.94},{"duration":0,"x":0.95}]},{"name":"thigh_l_b","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.49,"y":1.58},{"duration":3,"tweenEasing":0,"x":-0.99,"y":1},{"duration":0,"x":-1.49,"y":1.58}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-19.85},{"duration":3,"tweenEasing":0,"rotate":-19.63},{"duration":0,"rotate":-19.85}],"scaleFrame":[{"duration":6,"x":0.66}]},{"name":"tail9","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.09,"y":0.03},{"duration":3,"tweenEasing":0,"x":-0.14,"y":0.1},{"duration":0,"x":-0.09,"y":0.03}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":1.89},{"duration":3,"tweenEasing":0,"rotate":-0.12},{"duration":0,"rotate":1.89}],"scaleFrame":[{"duration":6,"x":1.04,"y":1.01}]},{"name":"tail8","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.07,"y":-0.15},{"duration":3,"tweenEasing":0,"x":0.08,"y":-0.1},{"duration":0,"x":0.07,"y":-0.15}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":5.28},{"duration":3,"tweenEasing":0,"rotate":7.29},{"duration":0,"rotate":5.28}],"scaleFrame":[{"duration":6,"x":1.03}]},{"name":"tail7","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.22,"y":-0.18},{"duration":3,"tweenEasing":0,"x":-0.19,"y":-0.2},{"duration":0,"x":-0.22,"y":-0.18}],"rotateFrame":[{"duration":6,"rotate":-2.18}],"scaleFrame":[{"duration":6,"x":0.99}]},{"name":"tail6","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.07,"y":-0.14},{"duration":3,"tweenEasing":0,"x":-0.06,"y":-0.13},{"duration":0,"x":-0.07,"y":-0.14}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":5.46},{"duration":3,"tweenEasing":0,"rotate":5.21},{"duration":0,"rotate":5.46}],"scaleFrame":[{"duration":6,"x":0.99}]},{"name":"tail5","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.22,"y":-0.07},{"duration":3,"tweenEasing":0,"x":0.2,"y":-0.05},{"duration":0,"x":0.22,"y":-0.07}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-3.04},{"duration":3,"tweenEasing":0,"rotate":0.47},{"duration":0,"rotate":-3.04}],"scaleFrame":[{"duration":6,"x":0.99}]},{"name":"tail4","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.21},{"duration":3,"tweenEasing":0,"x":0.19,"y":-0.09},{"duration":0,"x":0.21}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":5.01},{"duration":3,"tweenEasing":0,"rotate":5.27},{"duration":0,"rotate":5.01}],"scaleFrame":[{"duration":6,"x":0.98}]},{"name":"tail3","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.15,"y":-0.06},{"duration":3,"tweenEasing":0,"x":0.14,"y":0.03},{"duration":0,"x":0.15,"y":-0.06}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":4.8},{"duration":3,"tweenEasing":0,"rotate":1.54},{"duration":0,"rotate":4.8}]},{"name":"tail2","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.21,"y":0.13},{"duration":3,"tweenEasing":0,"x":0.12,"y":0.09},{"duration":0,"x":0.21,"y":0.13}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-1.75},{"duration":3,"tweenEasing":0,"rotate":2.76},{"duration":0,"rotate":-1.75}],"scaleFrame":[{"duration":6,"x":1.01}]},{"name":"tail1","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":0.01},{"duration":3,"tweenEasing":0,"x":0.06,"y":0.02},{"duration":0,"x":0.02,"y":0.01}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-0.23},{"duration":3,"tweenEasing":0,"rotate":-1.49},{"duration":0,"rotate":-0.23}],"scaleFrame":[{"duration":6,"x":1.01}]},{"name":"tail","translateFrame":[{"duration":3,"tweenEasing":0,"x":8.17,"y":10.12},{"duration":3,"tweenEasing":0,"x":8.2,"y":10.09},{"duration":0,"x":8.17,"y":10.12}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":12.19},{"duration":3,"tweenEasing":0,"rotate":8.93},{"duration":0,"rotate":12.19}],"scaleFrame":[{"duration":6,"x":1.01}]},{"name":"weapon","translateFrame":[{"duration":3,"tweenEasing":0,"x":-7.39,"y":0.6},{"duration":3,"tweenEasing":0,"x":-7.52,"y":0.67},{"duration":0,"x":-7.39,"y":0.6}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-23.64},{"duration":3,"tweenEasing":0,"rotate":-19.63},{"duration":0,"rotate":-23.64}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":0,"x":1.02}]},{"name":"pelvis","translateFrame":[{"duration":3,"tweenEasing":0,"x":-27.2,"y":-28.3},{"duration":3,"tweenEasing":0,"x":-31.4,"y":-29.55},{"duration":0,"x":-27.2,"y":-28.3}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":15.52},{"duration":3,"tweenEasing":0,"rotate":11.51},{"duration":0,"rotate":15.52}],"scaleFrame":[{"duration":6,"y":1.01}]},{"name":"chest","translateFrame":[{"duration":3,"tweenEasing":0,"x":-3.62,"y":-0.47},{"duration":3,"tweenEasing":0,"x":-2.52,"y":-0.4},{"duration":0,"x":-3.62,"y":-0.47}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":7.19},{"duration":3,"tweenEasing":0,"rotate":11.16},{"duration":0,"rotate":7.19}],"scaleFrame":[{"duration":6,"x":1.01}]},{"name":"neck","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.28,"y":0.53},{"duration":3,"tweenEasing":0,"x":0.32,"y":0.57},{"duration":0,"x":0.28,"y":0.53}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-20.39},{"duration":3,"tweenEasing":0,"rotate":-22.64},{"duration":0,"rotate":-20.39}]},{"name":"head","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.02,"y":-0.11},{"duration":3,"tweenEasing":0,"y":-0.06},{"duration":0,"x":-0.02,"y":-0.11}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-28.81},{"duration":3,"tweenEasing":0,"rotate":-26.54},{"duration":0,"rotate":-28.81}],"scaleFrame":[{"duration":6,"x":0.98}]},{"name":"thigh_r_b","translateFrame":[{"duration":3,"tweenEasing":0,"x":1.25,"y":-1.25},{"duration":3,"tweenEasing":0,"x":0.92,"y":-0.87},{"duration":0,"x":1.25,"y":-1.25}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-78.76},{"duration":3,"tweenEasing":0,"rotate":-72.79},{"duration":0,"rotate":-78.76}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.99}]},{"name":"thigh_r_m","translateFrame":[{"duration":3,"tweenEasing":0,"x":1.11,"y":0.15},{"duration":3,"tweenEasing":0,"x":1.11,"y":0.16},{"duration":0,"x":1.11,"y":0.15}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":48.04},{"duration":3,"tweenEasing":0,"rotate":54.56},{"duration":0,"rotate":48.04}],"scaleFrame":[{"duration":6,"x":0.86}]},{"name":"thigh_r_f","translateFrame":[{"duration":3,"tweenEasing":0,"x":1.43,"y":0.29},{"duration":3,"tweenEasing":0,"x":1.42,"y":0.3},{"duration":0,"x":1.43,"y":0.29}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":22.53},{"duration":3,"tweenEasing":0,"rotate":26.54},{"duration":0,"rotate":22.53}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.11},{"duration":3,"tweenEasing":0,"x":1.14},{"duration":0,"x":1.11}]},{"name":"upperarm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.43,"y":6.75},{"duration":3,"tweenEasing":0,"x":-0.99,"y":7.21},{"duration":0,"x":-0.43,"y":6.75}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-15.53},{"duration":3,"tweenEasing":0,"rotate":-44.63},{"duration":0,"rotate":-15.53}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.16},{"duration":3,"tweenEasing":0,"x":1.09},{"duration":0,"x":1.16}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-6.01},{"duration":3,"tweenEasing":0,"x":-5.84},{"duration":0,"x":-6.01}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-7.62},{"duration":3,"tweenEasing":0,"rotate":24.51},{"duration":0,"rotate":-7.62}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.91,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.89,"y":0.99},{"duration":0,"x":0.91,"y":0.99}]},{"name":"hand_r_1","translateFrame":[{"duration":3,"tweenEasing":0,"x":3.08,"y":1.52},{"duration":3,"tweenEasing":0,"x":3.82,"y":1.65},{"duration":0,"x":3.08,"y":1.52}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":9.63},{"duration":3,"tweenEasing":0,"rotate":29.33},{"duration":0,"rotate":9.63}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.95},{"duration":3,"tweenEasing":0,"x":0.89},{"duration":0,"x":0.95}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.21,"y":0.06},{"duration":3,"tweenEasing":0,"x":0.45,"y":-0.05},{"duration":0,"x":0.21,"y":0.06}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":15.88},{"duration":3,"tweenEasing":0,"rotate":5.3},{"duration":0,"rotate":15.88}],"scaleFrame":[{"duration":6,"x":0.94}]},{"name":"calf_r_b","translateFrame":[{"duration":3,"tweenEasing":0,"x":2.24,"y":0.77},{"duration":3,"tweenEasing":0,"x":2.33,"y":0.68},{"duration":0,"x":2.24,"y":0.77}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":65.93},{"duration":3,"tweenEasing":0,"rotate":61.18},{"duration":0,"rotate":65.93}],"scaleFrame":[{"duration":6,"x":1.01}]},{"name":"calf_r_m","translateFrame":[{"duration":3,"tweenEasing":0,"x":-18.21,"y":-1.15},{"duration":3,"tweenEasing":0,"x":-17.48,"y":-1.12},{"duration":0,"x":-18.21,"y":-1.15}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-68.12},{"duration":3,"tweenEasing":0,"rotate":-76.65},{"duration":0,"rotate":-68.12}],"scaleFrame":[{"duration":6,"x":1.02}]},{"name":"calf_r_f","translateFrame":[{"duration":3,"tweenEasing":0,"x":16.83,"y":-7.84},{"duration":3,"tweenEasing":0,"x":19.98,"y":-7.47},{"duration":0,"x":16.83,"y":-7.84}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-17.38},{"duration":3,"tweenEasing":0,"rotate":-19.63},{"duration":0,"rotate":-17.38}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.95},{"duration":3,"tweenEasing":0,"x":0.94},{"duration":0,"x":0.95}]}]},{"duration":55,"name":"skill_04","frame":[{"duration":25},{"duration":0,"events":[{"name":"onTimeStart"}]}],"bone":[{"name":"calf_l_f","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.88},{"tweenEasing":0,"x":0.91,"y":0.2},{"tweenEasing":0,"x":0.11,"y":-0.3},{"duration":2,"tweenEasing":0,"x":-0.13,"y":-0.31},{"tweenEasing":0,"x":-0.45,"y":-0.33},{"duration":2,"tweenEasing":0,"x":-0.4,"y":-0.32},{"duration":5,"tweenEasing":0,"x":0.87,"y":-0.13},{"tweenEasing":0,"x":0.68,"y":0.32},{"duration":4,"tweenEasing":0,"x":-1.2,"y":0.15},{"tweenEasing":0,"x":-0.74,"y":-0.25},{"duration":4,"tweenEasing":0,"x":-0.57,"y":-0.4},{"duration":3,"tweenEasing":0,"x":-0.02,"y":-0.27},{"duration":5,"tweenEasing":0,"x":-0.01,"y":-0.09},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-48.68},{"tweenEasing":0,"rotate":-92.52},{"tweenEasing":0,"rotate":27.36},{"duration":2,"tweenEasing":0,"rotate":43.16},{"tweenEasing":0,"rotate":45.41},{"duration":2,"tweenEasing":0,"rotate":38.39},{"duration":5,"tweenEasing":0,"rotate":-37.4},{"tweenEasing":0,"rotate":-35.39},{"duration":4,"tweenEasing":0,"rotate":16.03},{"tweenEasing":0,"rotate":34.37},{"duration":4,"tweenEasing":0,"rotate":33.88},{"duration":3,"tweenEasing":0,"rotate":19.58},{"duration":5,"tweenEasing":0,"rotate":11.8},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.9},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.91},{"duration":2,"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":1.04},{"duration":4,"tweenEasing":0,"x":1.09},{"tweenEasing":0,"x":1.06},{"duration":4,"tweenEasing":0,"x":1.04},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":5,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"calf_l_m","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.03,"y":0.53},{"tweenEasing":0,"x":0.3,"y":0.5},{"tweenEasing":0,"x":-0.12,"y":-0.13},{"duration":2,"tweenEasing":0,"x":-0.2,"y":-0.55},{"tweenEasing":0,"x":-0.47,"y":-0.8},{"duration":2,"tweenEasing":0,"x":-0.47,"y":-0.4},{"duration":5,"tweenEasing":0,"x":0.18,"y":0.09},{"tweenEasing":0,"x":-0.61,"y":0.42},{"duration":4,"tweenEasing":0,"x":-0.83,"y":-0.65},{"tweenEasing":0,"x":-0.17,"y":-0.7},{"duration":4,"tweenEasing":0,"x":-0.17,"y":-0.64},{"duration":3,"tweenEasing":0,"x":0.14,"y":-0.04},{"duration":5,"tweenEasing":0,"x":0.11,"y":-0.18},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-31.11},{"tweenEasing":0,"rotate":-49.42},{"tweenEasing":0,"rotate":25.01},{"duration":2,"tweenEasing":0,"rotate":40.51},{"tweenEasing":0,"rotate":44.23},{"duration":2,"tweenEasing":0,"rotate":36.98},{"duration":5,"tweenEasing":0,"rotate":-25.07},{"tweenEasing":0,"rotate":-16.88},{"duration":4,"tweenEasing":0,"rotate":32.42},{"tweenEasing":0,"rotate":35.99},{"duration":4,"tweenEasing":0,"rotate":32.76},{"duration":3,"tweenEasing":0,"rotate":17.28},{"duration":5,"tweenEasing":0,"rotate":9.77},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.1},{"tweenEasing":0,"x":1.09},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.05},{"duration":2,"tweenEasing":0,"x":1.06},{"duration":5,"tweenEasing":0,"x":1.06},{"tweenEasing":0,"x":1.19},{"duration":4,"tweenEasing":0,"x":1.11},{"tweenEasing":0,"x":1.03},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":0.94},{"duration":5,"tweenEasing":0,"x":0.95},{"duration":0}]},{"name":"calf_l_b","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-0.45,"y":0.19},{"tweenEasing":0,"x":-0.74,"y":0.42},{"tweenEasing":0,"x":-0.37,"y":-0.1},{"duration":2,"tweenEasing":0,"x":-12.99,"y":-0.39},{"tweenEasing":0,"x":-13.01,"y":-0.42},{"duration":2,"tweenEasing":0,"x":-13.13,"y":-0.36},{"duration":5,"tweenEasing":0,"x":-0.03,"y":0.04},{"tweenEasing":0,"x":-0.17,"y":0.19},{"duration":5,"tweenEasing":0,"x":-0.27,"y":-0.18},{"duration":4,"tweenEasing":0,"x":-0.15,"y":-0.05},{"duration":3,"tweenEasing":0,"y":-0.13},{"duration":5,"tweenEasing":0,"x":-0.02,"y":-0.13},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-21.53},{"tweenEasing":0,"rotate":-37.32},{"tweenEasing":0,"rotate":35.84},{"duration":2,"tweenEasing":0,"rotate":59.72},{"tweenEasing":0,"rotate":69.5},{"duration":2,"tweenEasing":0,"rotate":54.69},{"duration":5,"tweenEasing":0,"rotate":-26.03},{"tweenEasing":0,"rotate":-18.01},{"duration":5,"tweenEasing":0,"rotate":39.11},{"duration":4,"tweenEasing":0,"rotate":38.87},{"duration":3,"tweenEasing":0,"rotate":21.81},{"duration":5,"tweenEasing":0,"rotate":13.04},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.15},{"tweenEasing":0,"x":1.23},{"tweenEasing":0,"x":1.12},{"duration":2,"tweenEasing":0,"x":1.11},{"tweenEasing":0,"x":1.14},{"duration":2,"tweenEasing":0,"x":1.15},{"duration":5,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.07},{"duration":5,"tweenEasing":0,"x":1.08},{"duration":4,"tweenEasing":0,"x":1.05},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":5,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.38,"y":-0.43},{"tweenEasing":0,"x":0.22,"y":-0.48},{"tweenEasing":0,"x":0.46,"y":-0.2},{"duration":2,"tweenEasing":0,"x":0.66,"y":-0.48},{"tweenEasing":0,"x":-0.25,"y":0.18},{"duration":2,"tweenEasing":0,"x":3.16,"y":-0.3},{"duration":2,"tweenEasing":0,"x":3.45,"y":-0.6},{"duration":3,"tweenEasing":0,"x":-0.05,"y":-0.13},{"tweenEasing":0,"x":0.55,"y":-0.47},{"duration":2,"tweenEasing":0,"x":0.68,"y":-0.52},{"tweenEasing":0,"x":1.1,"y":-0.78},{"tweenEasing":0,"x":3.5,"y":-0.61},{"tweenEasing":0,"x":4.39,"y":-0.68},{"duration":3,"tweenEasing":0,"x":4.41,"y":-0.77},{"tweenEasing":0,"x":3.17,"y":-0.55},{"duration":8,"tweenEasing":0,"x":2.77,"y":-0.46},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-58.39},{"tweenEasing":0,"rotate":-53.14},{"tweenEasing":0,"rotate":-79.38},{"duration":2,"tweenEasing":0,"rotate":-92.6},{"tweenEasing":0,"rotate":15.27},{"duration":2,"tweenEasing":0,"rotate":33.19},{"duration":2,"tweenEasing":0,"rotate":30.95},{"duration":3,"tweenEasing":0,"rotate":14.2},{"tweenEasing":0,"rotate":-67.82},{"duration":2,"tweenEasing":0,"rotate":-91.46},{"tweenEasing":0,"rotate":-104.29},{"tweenEasing":0,"rotate":33.58},{"tweenEasing":0,"rotate":38.59},{"duration":3,"tweenEasing":0,"rotate":37.34},{"tweenEasing":0,"rotate":22.82},{"duration":8,"tweenEasing":0,"rotate":21.06},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"duration":5,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":8,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"upperarm_l","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-0.69,"y":0.22},{"tweenEasing":0,"x":-0.88,"y":0.45},{"tweenEasing":0,"x":-0.95,"y":0.65},{"tweenEasing":0,"x":-0.33,"y":1.19},{"tweenEasing":0,"x":2.59,"y":0.36},{"tweenEasing":0,"x":-0.38,"y":0.65},{"duration":2,"tweenEasing":0,"x":-0.28,"y":0.96},{"duration":2,"tweenEasing":0,"x":1.21,"y":4.49},{"duration":3,"tweenEasing":0,"x":-7.12,"y":4.06},{"tweenEasing":0,"x":2.07,"y":5.05},{"duration":2,"tweenEasing":0,"x":1.7,"y":4.25},{"tweenEasing":0,"x":7.08,"y":1.33},{"tweenEasing":0,"x":10.32,"y":6.24},{"tweenEasing":0,"x":7.89,"y":6.99},{"duration":3,"tweenEasing":0,"x":8.12,"y":5.69},{"tweenEasing":0,"x":7.77,"y":4.58},{"duration":8,"tweenEasing":0,"x":7.1,"y":1.62},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":35.28},{"tweenEasing":0,"rotate":17},{"tweenEasing":0,"rotate":49.57},{"tweenEasing":0,"rotate":73.45},{"tweenEasing":0,"rotate":36.31},{"tweenEasing":0,"rotate":-20.55},{"duration":2,"tweenEasing":0,"rotate":-36.83},{"duration":2,"tweenEasing":0,"rotate":-37.02},{"duration":3,"tweenEasing":0,"rotate":-17.87},{"tweenEasing":0,"rotate":64.78},{"duration":2,"tweenEasing":0,"rotate":86.14},{"tweenEasing":0,"rotate":93.73},{"tweenEasing":0,"rotate":-39.91},{"tweenEasing":0,"rotate":-44.18},{"duration":3,"tweenEasing":0,"rotate":-44.21},{"tweenEasing":0,"rotate":-34.86},{"duration":8,"tweenEasing":0,"rotate":-34.25},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.09},{"tweenEasing":0,"x":1.09},{"tweenEasing":0,"x":1.11},{"tweenEasing":0,"x":1.16},{"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":1.21},{"duration":2,"tweenEasing":0,"x":1.28},{"duration":2,"tweenEasing":0,"x":1.28},{"duration":3,"tweenEasing":0,"x":1.3},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.22},{"tweenEasing":0,"x":1.36},{"tweenEasing":0,"x":1.37},{"tweenEasing":0,"x":1.37,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.37},{"tweenEasing":0,"x":1.36},{"duration":8,"tweenEasing":0,"x":1.36},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.36,"y":-0.33},{"tweenEasing":0,"x":0.1,"y":-0.14},{"tweenEasing":0,"x":0.3,"y":-0.27},{"duration":2,"tweenEasing":0,"x":0.39,"y":-0.08},{"tweenEasing":0,"x":0.53,"y":0.14},{"duration":2,"tweenEasing":0,"x":0.58,"y":0.19},{"duration":2,"tweenEasing":0,"x":0.64,"y":-0.18},{"duration":3,"tweenEasing":0,"x":0.69,"y":-0.45},{"tweenEasing":0,"x":0.61,"y":-0.32},{"duration":2,"tweenEasing":0,"x":0.8,"y":-0.17},{"tweenEasing":0,"x":0.66,"y":-0.11},{"tweenEasing":0,"x":0.72,"y":-0.19},{"tweenEasing":0,"x":0.84,"y":-0.19},{"duration":3,"tweenEasing":0,"x":0.98,"y":-0.07},{"tweenEasing":0,"x":1.1,"y":-0.35},{"duration":8,"tweenEasing":0,"x":0.99,"y":-0.13},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-1.7},{"tweenEasing":0,"rotate":-1.02},{"tweenEasing":0,"rotate":0.23},{"duration":2,"tweenEasing":0,"rotate":0.49},{"tweenEasing":0,"rotate":-6.76},{"duration":2,"tweenEasing":0,"rotate":-7.52},{"duration":2,"tweenEasing":0,"rotate":-8.89},{"duration":3,"tweenEasing":0,"rotate":-6.77},{"tweenEasing":0,"rotate":12.88},{"duration":2,"tweenEasing":0,"rotate":20.32},{"tweenEasing":0,"rotate":28.01},{"tweenEasing":0,"rotate":-10.79},{"tweenEasing":0,"rotate":-12.03},{"duration":3,"tweenEasing":0,"rotate":-8.99},{"tweenEasing":0,"rotate":3.64},{"duration":8,"tweenEasing":0,"rotate":4.13},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.93},{"duration":2,"tweenEasing":0,"x":0.9},{"duration":2,"tweenEasing":0,"x":0.83},{"duration":3,"tweenEasing":0,"x":0.85},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.94},{"tweenEasing":0,"x":0.92},{"duration":3,"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":0.96},{"duration":8,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"hand_l_1","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-2.75,"y":-4.85},{"tweenEasing":0,"x":-1.61,"y":-4.28},{"tweenEasing":0,"x":-1.07,"y":-3.1},{"duration":2,"tweenEasing":0,"x":-1.12,"y":-1.98},{"tweenEasing":0,"x":-1.71,"y":0.62},{"duration":2,"tweenEasing":0,"x":-1.86,"y":2.65},{"duration":2,"tweenEasing":0,"x":-5.09,"y":1.54},{"duration":3,"tweenEasing":0,"x":-6.08,"y":-1.04},{"tweenEasing":0,"x":-3.75,"y":-4.11},{"duration":2,"tweenEasing":0,"x":-2.27,"y":-4.28},{"tweenEasing":0,"x":-0.66,"y":-3.58},{"tweenEasing":0,"x":-0.33,"y":-2.12},{"tweenEasing":0,"x":-0.76,"y":-2.18},{"duration":3,"tweenEasing":0,"x":-1.44,"y":-2.56},{"tweenEasing":0,"x":-3.03,"y":-4.33},{"duration":8,"tweenEasing":0,"x":-3.04,"y":-3.95},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":7.82},{"tweenEasing":0,"rotate":11.25},{"tweenEasing":0,"rotate":9.25},{"duration":2,"tweenEasing":0,"rotate":8.01},{"tweenEasing":0,"rotate":9.01},{"duration":2,"tweenEasing":0,"rotate":10.25},{"duration":2,"tweenEasing":0,"rotate":10.13},{"duration":3,"tweenEasing":0,"rotate":8.75},{"tweenEasing":0,"rotate":-12.18},{"duration":2,"tweenEasing":0,"rotate":-22.55},{"tweenEasing":0,"rotate":-31.91},{"tweenEasing":0,"rotate":12},{"tweenEasing":0,"rotate":16.51},{"duration":3,"tweenEasing":0,"rotate":19.54},{"tweenEasing":0,"rotate":21.91},{"duration":8,"tweenEasing":0,"rotate":21.15},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.88},{"duration":2,"tweenEasing":0,"x":0.86},{"tweenEasing":0,"x":0.86},{"tweenEasing":0,"x":1.04},{"tweenEasing":0,"x":1.05},{"duration":3,"tweenEasing":0,"x":1.05},{"tweenEasing":0,"x":1.04},{"duration":8,"tweenEasing":0,"x":1.04},{"duration":0}]},{"name":"thigh_l_f","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-0.95,"y":0.17},{"tweenEasing":0,"x":-1.52},{"tweenEasing":0,"x":-1.29,"y":0.32},{"duration":2,"tweenEasing":0,"x":-0.59,"y":0.42},{"tweenEasing":0,"x":-0.4,"y":0.37},{"duration":2,"tweenEasing":0,"x":-0.51,"y":0.37},{"duration":5,"tweenEasing":0,"x":-0.27,"y":0.1},{"tweenEasing":0,"x":1.47,"y":0.4},{"duration":4,"tweenEasing":0,"x":1.63,"y":0.71},{"tweenEasing":0,"x":1.18,"y":0.28},{"duration":4,"tweenEasing":0,"x":0.88,"y":0.37},{"duration":3,"tweenEasing":0,"x":0.01,"y":0.1},{"duration":5,"tweenEasing":0,"x":0.06,"y":1.62},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":21.55},{"tweenEasing":0,"rotate":37.13},{"tweenEasing":0,"rotate":-20.58},{"duration":2,"tweenEasing":0,"rotate":-22.46},{"tweenEasing":0,"rotate":-19.22},{"duration":2,"tweenEasing":0,"rotate":-15.7},{"duration":5,"tweenEasing":0,"rotate":17.41},{"tweenEasing":0,"rotate":39.66},{"duration":4,"tweenEasing":0,"rotate":17.79},{"tweenEasing":0,"rotate":-5.47},{"duration":4,"tweenEasing":0,"rotate":-9.43},{"duration":3,"tweenEasing":0,"rotate":-12.56},{"duration":5,"tweenEasing":0,"rotate":-8.23},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.92},{"duration":2,"tweenEasing":0,"x":0.92},{"duration":5,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":0.93},{"duration":4,"tweenEasing":0,"x":0.74},{"tweenEasing":0,"x":0.84},{"duration":4,"tweenEasing":0,"x":0.89},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":5}]},{"name":"thigh_l_m","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-0.95,"y":0.06},{"tweenEasing":0,"x":-1.39,"y":-0.06},{"tweenEasing":0,"x":-1.38,"y":0.23},{"duration":2,"tweenEasing":0,"x":-0.75,"y":0.36},{"tweenEasing":0,"x":-0.59,"y":0.31},{"duration":2,"tweenEasing":0,"x":-0.69,"y":0.32},{"duration":5,"tweenEasing":0,"x":-0.29,"y":0.01},{"tweenEasing":0,"x":1.38,"y":0.47},{"duration":4,"tweenEasing":0,"x":1.35,"y":0.81},{"tweenEasing":0,"x":0.96,"y":0.42},{"duration":4,"tweenEasing":0,"x":0.67,"y":0.41},{"duration":3,"tweenEasing":0,"x":-0.11,"y":0.11},{"duration":5,"tweenEasing":0,"x":-0.15,"y":1.34},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":13.52},{"tweenEasing":0,"rotate":19.12},{"tweenEasing":0,"rotate":-9.04},{"duration":2,"tweenEasing":0,"rotate":-16.15},{"tweenEasing":0,"rotate":-19.17},{"duration":2,"tweenEasing":0,"rotate":-15.41},{"duration":5,"tweenEasing":0,"rotate":9.86},{"tweenEasing":0,"rotate":12.06},{"duration":4,"tweenEasing":0,"rotate":-12.99},{"tweenEasing":0,"rotate":-13.93},{"duration":4,"tweenEasing":0,"rotate":-12.13},{"duration":3,"tweenEasing":0,"rotate":-6.27},{"duration":5,"tweenEasing":0,"rotate":-2.95},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.93},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.94},{"duration":2,"tweenEasing":0,"x":0.88},{"tweenEasing":0,"x":0.81},{"duration":2,"tweenEasing":0,"x":0.81},{"duration":5,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.77},{"duration":4,"tweenEasing":0,"x":0.7},{"tweenEasing":0,"x":0.87},{"duration":4,"tweenEasing":0,"x":0.91},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0,"x":1.02},{"duration":0}]},{"name":"thigh_l_b","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-0.37,"y":0.34},{"tweenEasing":0,"x":-1.26,"y":1.06},{"tweenEasing":0,"x":-1.41,"y":1.88},{"duration":2,"tweenEasing":0,"x":-1.42,"y":2.03},{"tweenEasing":0,"x":-2.35,"y":3.59},{"duration":2,"tweenEasing":0,"x":-2.2,"y":3.28},{"duration":5,"tweenEasing":0,"x":-0.7,"y":0.51},{"tweenEasing":0,"x":1.13,"y":-0.78},{"duration":5,"tweenEasing":0,"x":1.08,"y":-0.43},{"duration":4,"tweenEasing":0,"x":0.03,"y":0.26},{"duration":3,"tweenEasing":0,"x":0.33,"y":-0.13},{"duration":5,"tweenEasing":0,"x":1.17,"y":0.46},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-6.94},{"tweenEasing":0,"rotate":-11.36},{"tweenEasing":0,"rotate":-30.15},{"duration":2,"tweenEasing":0,"rotate":-46.97},{"tweenEasing":0,"rotate":-68.97},{"duration":2,"tweenEasing":0,"rotate":-56.92},{"duration":5,"tweenEasing":0,"rotate":-2.17},{"tweenEasing":0,"rotate":-1.09},{"duration":5,"tweenEasing":0,"rotate":-24.18},{"duration":4,"tweenEasing":0,"rotate":-19.56},{"duration":3,"tweenEasing":0,"rotate":-3.55},{"duration":5,"tweenEasing":0,"rotate":-0.87},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.89},{"tweenEasing":0,"x":0.8},{"tweenEasing":0,"x":0.79},{"duration":2,"tweenEasing":0,"x":1.16},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.98},{"duration":5,"tweenEasing":0,"x":0.84},{"duration":4,"tweenEasing":0,"x":0.9},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail9","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":-0.16},{"tweenEasing":0,"x":0.04,"y":0.06},{"tweenEasing":0,"x":0.09,"y":0.09},{"duration":2,"tweenEasing":0,"x":0.35,"y":0.19},{"tweenEasing":0,"x":0.34,"y":0.17},{"tweenEasing":0,"x":0.26,"y":0.15},{"tweenEasing":0,"x":0.08,"y":0.07},{"duration":5,"tweenEasing":0,"x":-0.06,"y":0.03},{"tweenEasing":0,"x":0.01,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.13,"y":0.05},{"tweenEasing":0,"x":0.07,"y":0.16},{"duration":4,"tweenEasing":0,"x":0.08,"y":0.1},{"duration":8,"tweenEasing":0,"x":-0.02,"y":0.15},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-4.52},{"tweenEasing":0,"rotate":17.29},{"tweenEasing":0,"rotate":1},{"duration":2,"tweenEasing":0,"rotate":-15.87},{"tweenEasing":0,"rotate":-18.38},{"tweenEasing":0,"rotate":-18.13},{"tweenEasing":0,"rotate":-19.12},{"duration":5,"tweenEasing":0,"rotate":-2.54},{"tweenEasing":0,"rotate":-7.3},{"duration":4,"tweenEasing":0,"rotate":-7.55},{"tweenEasing":0,"rotate":-6.31},{"duration":4,"tweenEasing":0,"rotate":-6.05},{"duration":8,"tweenEasing":0,"rotate":-4.03},{"duration":0}],"scaleFrame":[{"duration":26,"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.02,"y":1.01},{"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":8,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail8","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.11,"y":-0.04},{"tweenEasing":0,"x":0.06,"y":-0.12},{"tweenEasing":0,"x":0.13},{"duration":2,"tweenEasing":0,"x":0.35},{"tweenEasing":0,"x":0.28,"y":0.01},{"tweenEasing":0,"x":0.29,"y":-0.08},{"tweenEasing":0,"x":0.12,"y":-0.06},{"duration":5,"tweenEasing":0,"x":-0.02,"y":-0.05},{"tweenEasing":0,"x":0.02,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.11,"y":0.1},{"tweenEasing":0,"x":0.14,"y":-0.05},{"duration":4,"tweenEasing":0,"x":0.08,"y":-0.07},{"duration":8,"tweenEasing":0,"x":0.02,"y":-0.12},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":13.75},{"tweenEasing":0,"rotate":-6.81},{"tweenEasing":0,"rotate":8},{"duration":2,"tweenEasing":0,"rotate":-17.3},{"tweenEasing":0,"rotate":-18.82},{"tweenEasing":0,"rotate":-17.32},{"tweenEasing":0,"rotate":-16.55},{"duration":5,"tweenEasing":0,"rotate":-10.5},{"tweenEasing":0,"rotate":-12.3},{"duration":4,"tweenEasing":0,"rotate":-11.79},{"tweenEasing":0,"rotate":-7.98},{"duration":4,"tweenEasing":0,"rotate":-7.24},{"duration":8,"tweenEasing":0,"rotate":-4.73},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"duration":4,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":8}]},{"name":"tail7","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.06,"y":0.11},{"tweenEasing":0,"x":-0.04,"y":0.18},{"tweenEasing":0,"x":0.08,"y":0.13},{"duration":2,"tweenEasing":0,"x":-0.05,"y":-0.05},{"tweenEasing":0,"x":-0.06,"y":-0.01},{"tweenEasing":0,"x":-0.05,"y":-0.08},{"tweenEasing":0,"x":-0.22,"y":-0.13},{"duration":5,"tweenEasing":0,"x":-0.39,"y":-0.08},{"tweenEasing":0,"x":0.06,"y":-0.06},{"duration":4,"tweenEasing":0,"x":-0.24},{"tweenEasing":0,"x":-0.21,"y":-0.05},{"duration":4,"tweenEasing":0,"x":-0.27,"y":-0.02},{"duration":8,"tweenEasing":0,"x":-0.28,"y":0.06},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":2.03},{"tweenEasing":0,"rotate":12.07},{"tweenEasing":0,"rotate":10.3},{"duration":2,"tweenEasing":0,"rotate":-19.52},{"tweenEasing":0,"rotate":-15.76},{"tweenEasing":0,"rotate":-11.24},{"tweenEasing":0,"rotate":-9.22},{"duration":5,"tweenEasing":0,"rotate":-2.69},{"tweenEasing":0,"rotate":-4.76},{"duration":4,"tweenEasing":0,"rotate":-4.02},{"tweenEasing":0,"rotate":0.31},{"duration":4,"tweenEasing":0,"rotate":0.56},{"duration":8,"tweenEasing":0,"rotate":1.03},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.99},{"duration":8,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"tail6","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-0.06,"y":-0.06},{"tweenEasing":0,"x":-0.11,"y":0.06},{"tweenEasing":0,"x":-0.04,"y":0.04},{"duration":2,"tweenEasing":0,"x":-0.07,"y":-0.17},{"tweenEasing":0,"x":-0.02,"y":-0.15},{"tweenEasing":0,"x":-0.07,"y":-0.21},{"tweenEasing":0,"x":-0.12,"y":-0.17},{"duration":5,"tweenEasing":0,"x":-0.24,"y":-0.13},{"tweenEasing":0,"x":-0.02,"y":-0.06},{"duration":4,"tweenEasing":0,"x":0.04,"y":-0.1},{"tweenEasing":0,"x":-0.21,"y":-0.13},{"duration":4,"tweenEasing":0,"x":-0.17,"y":-0.16},{"duration":8,"tweenEasing":0,"y":-0.06},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-12.29},{"tweenEasing":0,"rotate":-10.02},{"tweenEasing":0,"rotate":-7.01},{"duration":2,"tweenEasing":0,"rotate":-16.81},{"tweenEasing":0,"rotate":-22.33},{"tweenEasing":0,"rotate":-21.33},{"tweenEasing":0,"rotate":-5},{"duration":5,"tweenEasing":0,"rotate":-8.57},{"tweenEasing":0,"rotate":-16.32},{"duration":4,"tweenEasing":0,"rotate":-16.33},{"tweenEasing":0,"rotate":-12.33},{"duration":4,"tweenEasing":0,"rotate":-11.58},{"duration":8,"tweenEasing":0,"rotate":-7.83},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":13}]},{"name":"tail5","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.02,"y":0.11},{"tweenEasing":0,"x":-0.09,"y":0.04},{"tweenEasing":0,"x":0.02,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.3,"y":-0.1},{"tweenEasing":0,"x":0.29,"y":-0.07},{"tweenEasing":0,"x":0.31,"y":-0.08},{"tweenEasing":0,"x":0.22,"y":-0.07},{"duration":5,"tweenEasing":0,"x":0.11,"y":-0.09},{"tweenEasing":0,"y":0.03},{"duration":4,"tweenEasing":0,"x":0.01,"y":0.06},{"tweenEasing":0,"x":0.18,"y":-0.04},{"duration":4,"tweenEasing":0,"x":0.14,"y":-0.02},{"duration":8,"tweenEasing":0,"x":0.05,"y":-0.01},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-2.26},{"tweenEasing":0,"rotate":0.49},{"tweenEasing":0,"rotate":-5.02},{"duration":2,"tweenEasing":0,"rotate":-2.5},{"tweenEasing":0,"rotate":-2.76},{"tweenEasing":0,"rotate":-1.75},{"tweenEasing":0,"rotate":1.99},{"duration":5,"tweenEasing":0,"rotate":4.97},{"tweenEasing":0,"rotate":9.29},{"duration":4,"tweenEasing":0,"rotate":10.54},{"tweenEasing":0,"rotate":14.75},{"duration":4,"tweenEasing":0,"rotate":14.25},{"duration":8,"tweenEasing":0,"rotate":10.03},{"duration":0}],"scaleFrame":[{"duration":26,"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.97},{"duration":5,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":5,"tweenEasing":0,"x":0.98},{"duration":8,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"tail4","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-0.03},{"tweenEasing":0,"x":-0.15,"y":0.05},{"tweenEasing":0,"x":0.03,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.35,"y":-0.16},{"tweenEasing":0,"x":0.36,"y":-0.09},{"tweenEasing":0,"x":0.37,"y":-0.14},{"tweenEasing":0,"x":0.23,"y":-0.14},{"duration":5,"tweenEasing":0,"x":0.06,"y":-0.02},{"tweenEasing":0,"x":-0.05,"y":-0.01},{"duration":4,"tweenEasing":0,"x":-0.01,"y":0.07},{"tweenEasing":0,"x":0.15,"y":0.05},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.04},{"duration":8,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-4.01},{"tweenEasing":0,"rotate":-9.28},{"tweenEasing":0,"rotate":-6.78},{"duration":2,"tweenEasing":0,"rotate":2.77},{"tweenEasing":0,"rotate":5.78},{"tweenEasing":0,"rotate":7.79},{"tweenEasing":0,"rotate":13.48},{"duration":5,"tweenEasing":0,"rotate":17.07},{"tweenEasing":0,"rotate":7.03},{"duration":4,"tweenEasing":0,"rotate":6.28},{"tweenEasing":0,"rotate":6.03},{"duration":4,"tweenEasing":0,"rotate":5.53},{"duration":8,"tweenEasing":0,"rotate":3.53},{"duration":0}],"scaleFrame":[{"duration":26,"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.96},{"duration":5,"tweenEasing":0,"x":0.98},{"tweenEasing":0},{"duration":4,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":8}]},{"name":"tail3","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.02,"y":0.04},{"tweenEasing":0,"x":-0.11,"y":-0.02},{"tweenEasing":0,"x":0.04,"y":-0.05},{"duration":2,"tweenEasing":0,"x":0.25,"y":-0.02},{"tweenEasing":0,"x":0.37,"y":-0.07},{"tweenEasing":0,"x":0.32,"y":-0.07},{"tweenEasing":0,"x":0.16,"y":0.03},{"duration":5,"tweenEasing":0,"x":-0.02,"y":0.05},{"tweenEasing":0,"x":-0.11,"y":0.01},{"duration":4,"tweenEasing":0,"y":0.02},{"tweenEasing":0,"x":0.06,"y":-0.01},{"duration":4,"tweenEasing":0,"x":0.08,"y":0.02},{"duration":8,"tweenEasing":0,"x":0.02,"y":-0.03},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-9.02},{"tweenEasing":0,"rotate":-6.52},{"tweenEasing":0,"rotate":-5.26},{"duration":2,"tweenEasing":0,"rotate":0.76},{"tweenEasing":0,"rotate":-0.73},{"tweenEasing":0,"rotate":0.51},{"tweenEasing":0,"rotate":13.56},{"duration":5,"tweenEasing":0,"rotate":9.31},{"tweenEasing":0,"rotate":8.01},{"duration":4,"tweenEasing":0,"rotate":8.52},{"tweenEasing":0,"rotate":11.06},{"duration":4,"tweenEasing":0,"rotate":10.56},{"duration":8,"tweenEasing":0,"rotate":7.54},{"duration":0}],"scaleFrame":[{"duration":26,"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.98},{"duration":23}]},{"name":"tail2","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.06,"y":0.11},{"tweenEasing":0,"x":-0.01,"y":0.07},{"tweenEasing":0,"x":0.12,"y":0.1},{"duration":2,"tweenEasing":0,"x":0.25,"y":0.02},{"tweenEasing":0,"x":0.28,"y":0.09},{"tweenEasing":0,"x":0.28,"y":0.02},{"tweenEasing":0,"x":0.19,"y":0.09},{"duration":5,"tweenEasing":0,"x":-0.04,"y":0.11},{"tweenEasing":0,"x":-0.02,"y":0.01},{"duration":4,"tweenEasing":0,"x":0.09,"y":0.02},{"tweenEasing":0,"x":0.05,"y":-0.01},{"duration":4,"tweenEasing":0,"x":0.04,"y":0.11},{"duration":8,"tweenEasing":0,"x":0.07,"y":0.08},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-4.26},{"tweenEasing":0,"rotate":2.25},{"tweenEasing":0,"rotate":-2.5},{"duration":2,"tweenEasing":0,"rotate":18.77},{"tweenEasing":0,"rotate":20.05},{"tweenEasing":0,"rotate":18.77},{"tweenEasing":0,"rotate":20.59},{"duration":5,"tweenEasing":0,"rotate":15.28},{"tweenEasing":0,"rotate":15.52},{"duration":4,"tweenEasing":0,"rotate":16.27},{"tweenEasing":0,"rotate":18.53},{"duration":4,"tweenEasing":0,"rotate":18.03},{"duration":8,"tweenEasing":0,"rotate":12.76},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.97},{"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"duration":4,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":8}]},{"name":"tail1","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-0.05,"y":0.01},{"tweenEasing":0,"x":-0.06,"y":-0.04},{"tweenEasing":0,"x":0.03,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.16,"y":0.01},{"tweenEasing":0,"x":0.18,"y":-0.02},{"tweenEasing":0,"x":0.13,"y":-0.03},{"tweenEasing":0,"x":0.04,"y":-0.01},{"duration":5,"tweenEasing":0,"x":-0.08},{"tweenEasing":0,"x":-0.06,"y":-0.11},{"duration":4,"tweenEasing":0,"x":0.05,"y":-0.06},{"tweenEasing":0,"x":0.06,"y":-0.11},{"duration":4,"tweenEasing":0,"y":-0.12},{"duration":8,"tweenEasing":0,"x":-0.03,"y":-0.08},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":0.51},{"tweenEasing":0,"rotate":2.25},{"tweenEasing":0,"rotate":-6.76},{"duration":2,"tweenEasing":0,"rotate":4.51},{"tweenEasing":0,"rotate":-0.25},{"tweenEasing":0,"rotate":-3},{"tweenEasing":0,"rotate":-0.99},{"duration":5,"tweenEasing":0,"rotate":-1.75},{"tweenEasing":0,"rotate":-4.75},{"duration":4,"tweenEasing":0,"rotate":-4.5},{"tweenEasing":0,"rotate":-1.25},{"duration":4,"tweenEasing":0,"rotate":-1.25},{"duration":8,"tweenEasing":0,"rotate":-0.5},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0},{"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"duration":12}]},{"name":"tail","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":8.79,"y":10.28},{"tweenEasing":0,"x":3.82,"y":5.51},{"tweenEasing":0,"x":1.51,"y":2.72},{"duration":2,"tweenEasing":0,"x":-0.48,"y":-0.5},{"tweenEasing":0,"x":-0.82,"y":-1.14},{"tweenEasing":0,"x":-0.27,"y":-0.04},{"tweenEasing":0,"x":2.37,"y":3.55},{"duration":5,"tweenEasing":0,"x":5.29,"y":6.97},{"tweenEasing":0,"x":1.26,"y":2},{"duration":4,"tweenEasing":0,"x":0.31,"y":0.91},{"tweenEasing":0,"x":-0.84,"y":-1.35},{"duration":4,"tweenEasing":0,"x":-0.54,"y":-0.83},{"duration":8,"tweenEasing":0,"x":1.85,"y":2.96},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":6.97},{"tweenEasing":0,"rotate":-17.25},{"tweenEasing":0,"rotate":4.98},{"duration":2,"tweenEasing":0,"rotate":69.09},{"tweenEasing":0,"rotate":83.34},{"tweenEasing":0,"rotate":74.84},{"tweenEasing":0,"rotate":22.01},{"duration":5,"tweenEasing":0,"rotate":-3.42},{"tweenEasing":0,"rotate":-4.22},{"duration":4,"tweenEasing":0,"rotate":-2.25},{"tweenEasing":0,"rotate":4.33},{"duration":4,"tweenEasing":0,"rotate":3.38},{"duration":8,"tweenEasing":0,"rotate":-4.01},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":13}]},{"name":"weapon","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.57,"y":0.22},{"tweenEasing":0,"x":-2.44,"y":3.17},{"tweenEasing":0,"x":-0.12,"y":0.01},{"duration":2,"tweenEasing":0,"x":-3.85,"y":-0.36},{"tweenEasing":0,"x":-4.71,"y":-0.08},{"tweenEasing":0,"x":-4.51,"y":-0.26},{"tweenEasing":0,"x":-3.58,"y":-0.54},{"duration":5,"tweenEasing":0,"x":-4.39,"y":3.33},{"tweenEasing":0,"x":2.88,"y":1.91},{"duration":4,"tweenEasing":0,"x":-0.8,"y":4.09},{"tweenEasing":0,"x":-4,"y":3.36},{"duration":4,"tweenEasing":0,"x":-2.82,"y":-0.48},{"duration":8,"tweenEasing":0,"x":-2.01,"y":-0.44},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":14.82},{"tweenEasing":0,"rotate":21.81},{"tweenEasing":0,"rotate":4},{"duration":2,"tweenEasing":0,"rotate":-9.61},{"tweenEasing":0,"rotate":-12.18},{"tweenEasing":0,"rotate":-12.16},{"tweenEasing":0,"rotate":-9.56},{"duration":5,"tweenEasing":0,"rotate":-3.5},{"tweenEasing":0,"rotate":-7.17},{"duration":4,"tweenEasing":0,"rotate":-7.17},{"tweenEasing":0,"rotate":-4.97},{"duration":4,"tweenEasing":0,"rotate":-4.74},{"duration":8,"tweenEasing":0,"rotate":-2.91},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.02},{"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":8,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-21,"y":-13.5},{"tweenEasing":0,"x":-35.35,"y":-16.45},{"tweenEasing":0,"x":29.9,"y":-6.6},{"duration":2,"tweenEasing":0,"x":41.05,"y":-7.65},{"tweenEasing":0,"x":44.15,"y":-13.3},{"duration":2,"tweenEasing":0,"x":37.9,"y":-14.1},{"duration":5,"tweenEasing":0,"x":-20.95,"y":-1.8},{"tweenEasing":0,"x":-21.7,"y":-7.8},{"duration":5,"tweenEasing":0,"x":20.25,"y":-14.35},{"duration":4,"tweenEasing":0,"x":27.35,"y":-2},{"duration":8,"tweenEasing":0,"x":15.8,"y":5.85},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":4.75},{"tweenEasing":0,"rotate":12.76},{"tweenEasing":0,"rotate":13.27},{"duration":2,"tweenEasing":0,"rotate":13.27},{"tweenEasing":0,"rotate":24.8},{"duration":2,"tweenEasing":0,"rotate":23.04},{"duration":5,"tweenEasing":0,"rotate":6.26},{"tweenEasing":0,"rotate":-6.25},{"duration":5,"tweenEasing":0,"rotate":-6.5},{"duration":4,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-2.25},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":1.01},{"duration":2,"tweenEasing":0,"y":1.01},{"duration":5,"tweenEasing":0},{"tweenEasing":0,"y":0.99},{"duration":5,"tweenEasing":0,"y":0.99},{"duration":12}]},{"name":"chest","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-4.47,"y":-0.41},{"tweenEasing":0,"x":-2.57,"y":-0.46},{"tweenEasing":0,"x":-1.96,"y":-0.36},{"duration":2,"tweenEasing":0,"x":-1.87,"y":-0.36},{"tweenEasing":0,"x":-5.08,"y":-0.58},{"duration":2,"tweenEasing":0,"x":-5.01,"y":-0.51},{"duration":5,"tweenEasing":0,"x":-4.43,"y":-0.36},{"tweenEasing":0,"x":-2.37,"y":-0.36},{"duration":4,"tweenEasing":0,"x":-2.27,"y":-0.41},{"tweenEasing":0,"x":-0.99,"y":-2.5},{"duration":4,"tweenEasing":0,"x":-1.39,"y":-0.24},{"duration":8,"tweenEasing":0,"x":-0.91,"y":-0.18},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":4.82},{"tweenEasing":0,"rotate":0.9},{"tweenEasing":0,"rotate":-2.6},{"duration":2,"tweenEasing":0,"rotate":-8.11},{"tweenEasing":0,"rotate":-20.56},{"duration":2,"tweenEasing":0,"rotate":-18.56},{"duration":5,"tweenEasing":0,"rotate":-2.67},{"tweenEasing":0,"rotate":-5.59},{"duration":4,"tweenEasing":0,"rotate":-7.34},{"tweenEasing":0,"rotate":-8.22},{"duration":4,"tweenEasing":0,"rotate":-7.01},{"duration":8,"tweenEasing":0,"rotate":1.71},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":8}]},{"name":"neck","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.19,"y":0.45},{"tweenEasing":0,"x":-0.03,"y":0.43},{"tweenEasing":0,"x":0.49,"y":0.33},{"duration":2,"tweenEasing":0,"x":0.61,"y":0.26},{"tweenEasing":0,"x":0.65,"y":0.12},{"duration":2,"tweenEasing":0,"x":0.57,"y":0.18},{"duration":5,"tweenEasing":0,"x":0.04,"y":0.42},{"tweenEasing":0,"x":-0.15,"y":-0.27},{"duration":4,"tweenEasing":0,"x":0.41,"y":-0.32},{"tweenEasing":0,"x":0.37,"y":-0.41},{"duration":4,"tweenEasing":0,"x":0.44,"y":-0.1},{"duration":8,"tweenEasing":0,"x":0.14,"y":0.06},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-2.29},{"tweenEasing":0,"rotate":-3.73},{"tweenEasing":0,"rotate":-3.78},{"duration":2,"tweenEasing":0,"rotate":-3.89},{"tweenEasing":0,"rotate":-2.41},{"duration":2,"tweenEasing":0,"rotate":-3.15},{"duration":5,"tweenEasing":0,"rotate":-11.43},{"tweenEasing":0,"rotate":-9.72},{"duration":4,"tweenEasing":0,"rotate":-7.75},{"tweenEasing":0,"rotate":-3.92},{"duration":4,"tweenEasing":0,"rotate":-3.12},{"duration":8,"tweenEasing":0,"rotate":-2.01},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0},{"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":8}]},{"name":"head","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-0.02,"y":-0.02},{"tweenEasing":0,"x":-0.05,"y":-0.05},{"tweenEasing":0,"x":0.05,"y":-0.07},{"duration":2,"tweenEasing":0,"x":0.09,"y":0.01},{"tweenEasing":0,"x":0.11,"y":-0.12},{"duration":2,"tweenEasing":0,"x":0.08,"y":-0.02},{"duration":5,"tweenEasing":0,"x":-0.03,"y":-0.09},{"tweenEasing":0,"x":0.07,"y":-0.12},{"duration":4,"tweenEasing":0,"x":0.19,"y":-0.14},{"tweenEasing":0,"x":0.18,"y":-0.15},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.12},{"duration":8,"tweenEasing":0,"x":0.07,"y":-0.03},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-16.09},{"tweenEasing":0,"rotate":-2.81},{"tweenEasing":0,"rotate":-4.55},{"duration":2,"tweenEasing":0,"rotate":-6.27},{"tweenEasing":0,"rotate":-1.26},{"duration":2,"tweenEasing":0,"rotate":0.75},{"duration":5,"tweenEasing":0,"rotate":-5.71},{"tweenEasing":0,"rotate":1.91},{"duration":4,"tweenEasing":0,"rotate":2.41},{"tweenEasing":0,"rotate":3.09},{"duration":4,"tweenEasing":0,"rotate":1.57},{"duration":8,"tweenEasing":0,"rotate":-5.5},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":13}]},{"name":"thigh_r_b","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.35,"y":-0.27},{"tweenEasing":0,"x":1.15,"y":-1.03},{"tweenEasing":0,"x":1.26,"y":-1.38},{"duration":2,"tweenEasing":0,"x":1.26,"y":-1.43},{"tweenEasing":0,"x":1.95,"y":-2.69},{"duration":2,"tweenEasing":0,"x":1.9,"y":-2.45},{"duration":5,"tweenEasing":0,"x":0.61,"y":-0.43},{"tweenEasing":0,"x":-0.64,"y":0.6},{"duration":4,"tweenEasing":0,"x":-0.58,"y":0.36},{"tweenEasing":0,"x":0.39,"y":-2.22},{"duration":4,"tweenEasing":0,"x":0.13,"y":-0.17},{"duration":3,"tweenEasing":0,"x":-0.03,"y":0.03},{"duration":5,"tweenEasing":0,"x":0.93,"y":0.6},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-11.98},{"tweenEasing":0,"rotate":-20.92},{"tweenEasing":0,"rotate":-55.26},{"duration":2,"tweenEasing":0,"rotate":-70.52},{"tweenEasing":0,"rotate":-96.99},{"duration":2,"tweenEasing":0,"rotate":-85.97},{"duration":5,"tweenEasing":0,"rotate":9.38},{"tweenEasing":0,"rotate":4.92},{"duration":4,"tweenEasing":0,"rotate":-37.73},{"tweenEasing":0,"rotate":-36.36},{"duration":4,"tweenEasing":0,"rotate":-33.13},{"duration":3,"tweenEasing":0,"rotate":-7.83},{"duration":5,"tweenEasing":0,"rotate":-2.63},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.85},{"tweenEasing":0,"x":0.76},{"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":1.1},{"tweenEasing":0,"x":1.14},{"duration":2,"tweenEasing":0,"x":1.06},{"duration":5,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.07},{"tweenEasing":0,"x":1.06},{"duration":4,"tweenEasing":0,"x":1.04},{"duration":3,"tweenEasing":0,"x":1.18},{"duration":5,"tweenEasing":0,"x":1.15},{"duration":0}]},{"name":"thigh_r_m","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.42,"y":0.14},{"tweenEasing":0,"x":0.61,"y":0.14},{"tweenEasing":0,"x":0.69,"y":0.17},{"duration":2,"tweenEasing":0,"x":0.41,"y":0.22},{"tweenEasing":0,"x":0.41,"y":0.09},{"duration":2,"tweenEasing":0,"x":0.31,"y":0.13},{"duration":5,"tweenEasing":0,"x":0.06,"y":0.12},{"tweenEasing":0,"x":-0.92,"y":-0.12},{"duration":4,"tweenEasing":0,"x":-0.91,"y":-0.04},{"tweenEasing":0,"x":-0.45,"y":-0.1},{"duration":4,"tweenEasing":0,"x":-0.35,"y":0.06},{"duration":3,"tweenEasing":0,"x":-0.02,"y":0.01},{"duration":5,"tweenEasing":0,"x":-0.09,"y":1.33},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":26.49},{"tweenEasing":0,"rotate":45.88},{"tweenEasing":0,"rotate":-23.09},{"duration":2,"tweenEasing":0,"rotate":-40.53},{"tweenEasing":0,"rotate":-52.09},{"duration":2,"tweenEasing":0,"rotate":-48.83},{"duration":5,"tweenEasing":0,"rotate":17.34},{"tweenEasing":0,"rotate":-16.56},{"duration":4,"tweenEasing":0,"rotate":-45.94},{"tweenEasing":0,"rotate":-33.08},{"duration":4,"tweenEasing":0,"rotate":-28.25},{"duration":3,"tweenEasing":0,"rotate":-8.28},{"duration":5,"tweenEasing":0,"rotate":-2.95},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":0.86},{"tweenEasing":0,"x":0.86},{"duration":2,"tweenEasing":0,"x":1.04},{"tweenEasing":0,"x":1.07},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":5,"tweenEasing":0,"x":0.86},{"tweenEasing":0,"x":0.86},{"duration":4,"tweenEasing":0,"x":1.19},{"tweenEasing":0,"x":1.27},{"duration":4,"tweenEasing":0,"x":1.24},{"duration":3,"tweenEasing":0,"x":1.12},{"duration":5,"tweenEasing":0,"x":1.09},{"duration":0}]},{"name":"thigh_r_f","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.61,"y":0.27},{"tweenEasing":0,"x":0.76,"y":0.24},{"tweenEasing":0,"x":1.01,"y":0.24},{"duration":2,"tweenEasing":0,"x":0.72,"y":0.28},{"tweenEasing":0,"x":0.74,"y":0.16},{"duration":2,"tweenEasing":0,"x":0.63,"y":0.18},{"duration":5,"tweenEasing":0,"x":0.17,"y":0.25},{"tweenEasing":0,"x":-0.98,"y":-0.2},{"duration":4,"tweenEasing":0,"x":-0.75,"y":-0.17},{"tweenEasing":0,"x":-0.34,"y":-0.25},{"duration":4,"tweenEasing":0,"x":-0.15,"y":-0.02},{"duration":3,"tweenEasing":0,"x":0.11,"y":0.04},{"duration":5,"tweenEasing":0,"x":0.14,"y":1.66},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":33.61},{"tweenEasing":0,"rotate":40.69},{"tweenEasing":0,"rotate":-19.07},{"duration":2,"tweenEasing":0,"rotate":-27.2},{"tweenEasing":0,"rotate":-26.22},{"duration":2,"tweenEasing":0,"rotate":-19.7},{"duration":5,"tweenEasing":0,"rotate":25.45},{"tweenEasing":0,"rotate":64.74},{"duration":4,"tweenEasing":0,"rotate":32.1},{"tweenEasing":0,"rotate":-29.48},{"duration":4,"tweenEasing":0,"rotate":-26.68},{"duration":3,"tweenEasing":0,"rotate":-18.56},{"duration":5,"tweenEasing":0,"rotate":-11.98},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.44},{"tweenEasing":0,"x":1.13},{"duration":2,"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.87},{"duration":2,"tweenEasing":0,"x":0.87},{"duration":5,"tweenEasing":0,"x":0.94},{"tweenEasing":0,"x":0.86},{"duration":5,"tweenEasing":0,"x":0.87},{"duration":4,"tweenEasing":0,"x":0.87},{"duration":3,"tweenEasing":0,"x":1.08},{"duration":5,"tweenEasing":0,"x":1.08},{"duration":0}]},{"name":"upperarm_r","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.83,"y":1.41},{"tweenEasing":0,"x":1.1,"y":2.16},{"tweenEasing":0,"x":1.39,"y":1.96},{"duration":2,"tweenEasing":0,"x":0.78,"y":1.51},{"tweenEasing":0,"x":0.86,"y":0.91},{"duration":2,"tweenEasing":0,"x":0.73,"y":1.13},{"tweenEasing":0,"x":-1.1,"y":2.72},{"duration":4,"tweenEasing":0,"x":-7.78,"y":2.45},{"tweenEasing":0,"x":-2.3,"y":-0.01},{"tweenEasing":0,"x":-1.79,"y":-0.51},{"tweenEasing":0,"x":2.98,"y":-2.45},{"tweenEasing":0,"x":3.72,"y":-2.93},{"tweenEasing":0,"x":1.92,"y":-2.18},{"tweenEasing":0,"x":-1.01,"y":-0.53},{"duration":3,"tweenEasing":0,"x":-0.74,"y":-0.17},{"tweenEasing":0,"x":-0.12,"y":2.52},{"duration":8,"tweenEasing":0,"x":-0.02,"y":0.4},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":7.71},{"tweenEasing":0,"rotate":-5.32},{"tweenEasing":0,"rotate":13.97},{"duration":2,"tweenEasing":0,"rotate":33.32},{"tweenEasing":0,"rotate":7},{"duration":2,"tweenEasing":0,"rotate":-12.52},{"tweenEasing":0,"rotate":-12.21},{"duration":4,"tweenEasing":0,"rotate":14.26},{"tweenEasing":0,"rotate":104.7},{"tweenEasing":0,"rotate":105.7},{"tweenEasing":0,"rotate":-49.04},{"tweenEasing":0,"rotate":-57.57},{"tweenEasing":0,"rotate":-40.03},{"tweenEasing":0,"rotate":-35.02},{"duration":3,"tweenEasing":0,"rotate":-31.53},{"tweenEasing":0,"rotate":-23.9},{"duration":8,"tweenEasing":0,"rotate":-22.78},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.15},{"tweenEasing":0,"x":1.18},{"tweenEasing":0,"x":1.18},{"duration":2,"tweenEasing":0,"x":1.16},{"tweenEasing":0,"x":1.21},{"duration":2,"tweenEasing":0,"x":1.06},{"tweenEasing":0,"x":1.11},{"duration":4,"tweenEasing":0,"x":1.15},{"tweenEasing":0,"x":1.16},{"tweenEasing":0,"x":1.15},{"tweenEasing":0,"x":1.09},{"tweenEasing":0,"x":1.13},{"tweenEasing":0,"x":1.09},{"tweenEasing":0,"x":1.08},{"duration":3,"tweenEasing":0,"x":1.08},{"tweenEasing":0,"x":1.05},{"duration":8,"tweenEasing":0,"x":1.05},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.13,"y":0.23},{"tweenEasing":0,"x":0.04,"y":0.37},{"tweenEasing":0,"x":0.12,"y":0.28},{"duration":2,"tweenEasing":0,"x":0.1,"y":0.19},{"tweenEasing":0,"x":-6.05,"y":-0.31},{"duration":2,"tweenEasing":0,"x":-5.91,"y":-0.47},{"tweenEasing":0,"x":-5.91,"y":-0.1},{"duration":4,"tweenEasing":0,"x":-6.13,"y":0.15},{"tweenEasing":0,"x":0.44,"y":0.19},{"tweenEasing":0,"x":0.57,"y":0.08},{"tweenEasing":0,"x":0.57,"y":-0.01},{"tweenEasing":0,"x":0.54,"y":0.11},{"tweenEasing":0,"x":0.55,"y":-0.02},{"tweenEasing":0,"x":0.44,"y":-0.08},{"duration":3,"tweenEasing":0,"x":0.36,"y":-0.1},{"tweenEasing":0,"x":0.34,"y":-0.15},{"duration":8,"tweenEasing":0,"x":0.3,"y":-0.11},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-35.65},{"tweenEasing":0,"rotate":-27.89},{"tweenEasing":0,"rotate":-40.67},{"duration":2,"tweenEasing":0,"rotate":-51.46},{"tweenEasing":0,"rotate":-20.92},{"duration":2,"tweenEasing":0,"rotate":-1.55},{"tweenEasing":0,"rotate":3.7},{"duration":4,"tweenEasing":0,"rotate":-17.87},{"tweenEasing":0,"rotate":-83.86},{"tweenEasing":0,"rotate":-84.36},{"tweenEasing":0,"rotate":49.14},{"tweenEasing":0,"rotate":53.36},{"tweenEasing":0,"rotate":34.32},{"tweenEasing":0,"rotate":28.29},{"duration":3,"tweenEasing":0,"rotate":22.01},{"tweenEasing":0,"rotate":8.47},{"duration":8,"tweenEasing":0,"rotate":5.97},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.96},{"duration":4,"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.91,"y":0.99},{"tweenEasing":0,"x":0.91,"y":0.99},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.02,"y":1.01},{"tweenEasing":0,"x":1.03,"y":1.01},{"duration":8,"tweenEasing":0,"x":1.02,"y":1.01},{"duration":0}]},{"name":"hand_r_1","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-1.45,"y":-1.55},{"tweenEasing":0,"x":-2.28,"y":-1.61},{"tweenEasing":0,"x":-1.39,"y":-1.46},{"duration":2,"tweenEasing":0,"x":-0.57,"y":-0.89},{"tweenEasing":0,"x":0.37,"y":1.76},{"duration":2,"tweenEasing":0,"x":1.48,"y":3.61},{"tweenEasing":0,"x":2.23,"y":2.69},{"duration":4,"tweenEasing":0,"x":2.58,"y":2.55},{"tweenEasing":0,"x":1.86,"y":0.22},{"tweenEasing":0,"x":1.94,"y":-0.26},{"tweenEasing":0,"x":0.39,"y":-0.3},{"tweenEasing":0,"x":-0.48,"y":-0.65},{"tweenEasing":0,"x":-0.66,"y":-0.57},{"tweenEasing":0,"x":-0.97,"y":-0.44},{"duration":3,"tweenEasing":0,"x":-1.1,"y":-0.31},{"tweenEasing":0,"x":-1.38,"y":-0.62},{"duration":8,"tweenEasing":0,"x":-1.18,"y":-0.08},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":10.64},{"tweenEasing":0,"rotate":14.69},{"tweenEasing":0,"rotate":6.2},{"duration":2,"tweenEasing":0,"rotate":-1.18},{"tweenEasing":0,"rotate":8.99},{"duration":2,"tweenEasing":0,"rotate":15.48},{"tweenEasing":0,"rotate":22.18},{"duration":4,"tweenEasing":0,"rotate":17.77},{"tweenEasing":0,"rotate":-33.06},{"tweenEasing":0,"rotate":-38.16},{"tweenEasing":0,"rotate":15.7},{"tweenEasing":0,"rotate":14.87},{"tweenEasing":0,"rotate":14.31},{"tweenEasing":0,"rotate":13.73},{"duration":3,"tweenEasing":0,"rotate":12.69},{"tweenEasing":0,"rotate":8.66},{"duration":8,"tweenEasing":0,"rotate":7.67},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.97},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.96},{"duration":4,"tweenEasing":0,"x":0.97},{"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":15}]},{"name":"hand_r","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-0.31,"y":-0.15},{"tweenEasing":0,"x":-0.42,"y":0.02},{"tweenEasing":0,"x":0.03,"y":0.18},{"duration":2,"tweenEasing":0,"x":0.07,"y":0.4},{"tweenEasing":0,"x":0.32,"y":0.29},{"duration":2,"tweenEasing":0,"x":0.55,"y":0.19},{"tweenEasing":0,"x":0.15,"y":0.15},{"duration":4,"tweenEasing":0,"x":0.1,"y":0.2},{"tweenEasing":0,"x":-0.28,"y":-0.57},{"tweenEasing":0,"x":0.21,"y":-0.61},{"tweenEasing":0,"x":0.48,"y":0.19},{"tweenEasing":0,"x":0.3,"y":-0.15},{"tweenEasing":0,"x":0.19,"y":-0.1},{"tweenEasing":0,"x":-0.05,"y":0.12},{"duration":3,"tweenEasing":0,"x":-0.11,"y":0.28},{"tweenEasing":0,"x":-0.16,"y":-0.12},{"duration":8,"tweenEasing":0,"x":-0.28,"y":0.39},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-3.63},{"tweenEasing":0,"rotate":-5.09},{"tweenEasing":0,"rotate":-4.56},{"duration":2,"tweenEasing":0,"rotate":-3.43},{"tweenEasing":0,"rotate":-0.53},{"duration":2,"tweenEasing":0,"rotate":1.46},{"tweenEasing":0,"rotate":2.91},{"duration":4,"tweenEasing":0,"rotate":8.6},{"tweenEasing":0,"rotate":36.4},{"tweenEasing":0,"rotate":37.32},{"tweenEasing":0,"rotate":-11.09},{"tweenEasing":0,"rotate":-16.94},{"tweenEasing":0,"rotate":-14.49},{"tweenEasing":0,"rotate":-14.31},{"duration":3,"tweenEasing":0,"rotate":-13.6},{"tweenEasing":0,"rotate":-11.12},{"duration":8,"tweenEasing":0,"rotate":-9.6},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":0.92},{"duration":2,"tweenEasing":0},{"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.99},{"duration":8,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"calf_r_b","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.49,"y":-0.02},{"tweenEasing":0,"x":0.05,"y":-0.07},{"tweenEasing":0,"x":2.09,"y":0.54},{"duration":2,"tweenEasing":0,"x":1.81,"y":0.33},{"tweenEasing":0,"x":1.74,"y":0.5},{"duration":2,"tweenEasing":0,"x":1.84,"y":0.49},{"duration":5,"tweenEasing":0,"x":-0.01,"y":-0.26},{"tweenEasing":0,"x":0.14,"y":-0.09},{"duration":5,"tweenEasing":0,"x":1.95,"y":0.62},{"duration":4,"tweenEasing":0,"x":1.94,"y":0.47},{"duration":3,"tweenEasing":0,"x":-2.73,"y":0.24},{"duration":5,"tweenEasing":0,"x":-2.7,"y":0.07},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-10.93},{"tweenEasing":0,"rotate":-20.86},{"tweenEasing":0,"rotate":55.47},{"duration":2,"tweenEasing":0,"rotate":78.45},{"tweenEasing":0,"rotate":94.97},{"duration":2,"tweenEasing":0,"rotate":79.45},{"duration":5,"tweenEasing":0,"rotate":-28.84},{"tweenEasing":0,"rotate":-15.8},{"duration":5,"tweenEasing":0,"rotate":50.64},{"duration":4,"tweenEasing":0,"rotate":46.92},{"duration":3,"tweenEasing":0,"rotate":20.51},{"duration":5,"tweenEasing":0,"rotate":10.73},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0,"x":0.99},{"duration":18}]},{"name":"calf_r_m","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":-10.87,"y":-0.73},{"tweenEasing":0,"x":-4.87,"y":-0.87},{"tweenEasing":0,"x":-2.15,"y":0.61},{"duration":2,"tweenEasing":0,"x":-2.19,"y":0.82},{"tweenEasing":0,"x":-2.33,"y":0.85},{"duration":2,"tweenEasing":0,"x":-2.24,"y":0.89},{"duration":5,"tweenEasing":0,"x":0.06,"y":-0.33},{"tweenEasing":0,"x":-5.74,"y":0.21},{"duration":4,"tweenEasing":0,"x":-2.21,"y":1.03},{"tweenEasing":0,"x":-2.18,"y":0.79},{"duration":4,"tweenEasing":0,"x":-2.13,"y":0.76},{"duration":3,"tweenEasing":0,"x":-0.24,"y":0.35},{"duration":5,"tweenEasing":0,"x":-0.13,"y":0.28},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-44.74},{"tweenEasing":0,"rotate":-72.83},{"tweenEasing":0,"rotate":29.89},{"duration":2,"tweenEasing":0,"rotate":54.42},{"tweenEasing":0,"rotate":66.46},{"duration":2,"tweenEasing":0,"rotate":60.47},{"duration":5,"tweenEasing":0,"rotate":-30.22},{"tweenEasing":0,"rotate":9.9},{"duration":4,"tweenEasing":0,"rotate":59.9},{"tweenEasing":0,"rotate":49.85},{"duration":4,"tweenEasing":0,"rotate":43.83},{"duration":3,"tweenEasing":0,"rotate":16.75},{"duration":5,"tweenEasing":0,"rotate":8.74},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":1.01},{"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0},{"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":8}]},{"name":"calf_r_f","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":21.54,"y":-0.77},{"tweenEasing":0,"x":29.7,"y":-2.44},{"tweenEasing":0,"x":-10.19,"y":-2.47},{"duration":2,"tweenEasing":0,"x":-12.35,"y":4.04},{"tweenEasing":0,"x":-9.36,"y":9.3},{"duration":2,"tweenEasing":0,"x":-7.07,"y":8.65},{"duration":5,"tweenEasing":0,"x":15.35,"y":-1.26},{"tweenEasing":0,"x":20.2,"y":20.45},{"duration":4,"tweenEasing":0,"x":0.27,"y":26.87},{"tweenEasing":0,"x":-9.41,"y":13.66},{"duration":4,"tweenEasing":0,"x":-10.49,"y":9.43},{"duration":3,"tweenEasing":0,"x":-10.14,"y":-1.16},{"duration":5,"tweenEasing":0,"x":-6.53,"y":-0.31},{"duration":0}],"rotateFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"rotate":-14.07},{"tweenEasing":0,"rotate":-28.29},{"tweenEasing":0,"rotate":7.23},{"duration":2,"tweenEasing":0,"rotate":17.13},{"tweenEasing":0,"rotate":20.36},{"duration":2,"tweenEasing":0,"rotate":16.87},{"duration":5,"tweenEasing":0,"rotate":-10.69},{"tweenEasing":0,"rotate":4.03},{"duration":4,"tweenEasing":0,"rotate":23.79},{"tweenEasing":0,"rotate":21.1},{"duration":4,"tweenEasing":0,"rotate":18.15},{"duration":3,"tweenEasing":0,"rotate":6.25},{"duration":5,"tweenEasing":0,"rotate":3.56},{"duration":0}],"scaleFrame":[{"duration":11,"tweenEasing":0},{"duration":14,"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.89},{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":5,"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0,"x":1.03},{"duration":4,"tweenEasing":0,"x":1.03},{"duration":8}]}]},{"duration":28,"name":"skill_05","bone":[{"name":"calf_l_f","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-16.35,"y":0.85},{"duration":2,"tweenEasing":0,"x":-16.35,"y":0.85},{"duration":2,"tweenEasing":0,"x":0.96,"y":-0.03},{"duration":5,"tweenEasing":0,"x":0.64,"y":0.3},{"duration":9,"tweenEasing":0,"x":0.78,"y":0.14},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-26.06},{"duration":2,"tweenEasing":0,"rotate":-26.06},{"duration":2,"tweenEasing":0,"rotate":-28.62},{"duration":5,"tweenEasing":0,"rotate":-32.63},{"duration":9,"tweenEasing":0,"rotate":-30.13},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.07},{"duration":2,"tweenEasing":0,"x":1.07},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":5,"tweenEasing":0,"x":1.03},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"calf_l_m","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-20.73,"y":-0.85},{"duration":2,"tweenEasing":0,"x":-20.73,"y":-0.85},{"duration":2,"tweenEasing":0,"x":0.08,"y":0.21},{"duration":5,"tweenEasing":0,"x":-0.57,"y":0.47},{"duration":9,"tweenEasing":0,"x":-0.1,"y":0.23},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":39.46},{"duration":2,"tweenEasing":0,"rotate":39.46},{"duration":2,"tweenEasing":0,"rotate":-19.81},{"duration":5,"tweenEasing":0,"rotate":-17.38},{"duration":9,"tweenEasing":0,"rotate":-19.57},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.17},{"duration":2,"tweenEasing":0,"x":1.17},{"duration":2,"tweenEasing":0,"x":1.06},{"duration":5,"tweenEasing":0,"x":1.18},{"duration":9,"tweenEasing":0,"x":1.12},{"duration":0}]},{"name":"calf_l_b","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.69,"y":-0.37},{"duration":2,"tweenEasing":0,"x":-0.69,"y":-0.37},{"duration":7,"tweenEasing":0,"x":-0.31,"y":0.11},{"duration":9,"tweenEasing":0,"x":-0.27,"y":0.06},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":34.86},{"duration":2,"tweenEasing":0,"rotate":34.86},{"duration":7,"tweenEasing":0,"rotate":-14.77},{"duration":9,"tweenEasing":0,"rotate":-24.78},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.13},{"duration":2,"tweenEasing":0,"x":1.13},{"duration":7,"tweenEasing":0,"x":1.12},{"duration":9,"tweenEasing":0,"x":1.1},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.6,"y":-0.02},{"tweenEasing":0,"x":3.04,"y":-0.45},{"tweenEasing":0,"x":0.16,"y":-0.13},{"duration":2,"tweenEasing":0,"x":0.35,"y":-0.79},{"duration":5,"tweenEasing":0,"x":0.53,"y":-1.05},{"duration":9,"tweenEasing":0,"x":-1.02,"y":-0.57},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-27.86},{"tweenEasing":0,"rotate":-12.37},{"tweenEasing":0,"rotate":-8.32},{"duration":2,"tweenEasing":0,"rotate":-99.01},{"duration":5,"tweenEasing":0,"rotate":-82.59},{"duration":9,"tweenEasing":0,"rotate":-54.66},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":0.93},{"tweenEasing":0,"x":0.93},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":5,"tweenEasing":0,"x":0.99},{"duration":9}]},{"name":"upperarm_l","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":3.2,"y":5.35},{"tweenEasing":0,"x":3.2,"y":5.35},{"tweenEasing":0,"x":4.54,"y":3.45},{"duration":2,"tweenEasing":0,"x":-0.64,"y":-0.31},{"duration":5,"tweenEasing":0,"x":1.09,"y":1.1},{"duration":9,"tweenEasing":0,"x":0.79,"y":0.68},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-3.97},{"tweenEasing":0,"rotate":-33.51},{"tweenEasing":0,"rotate":-40.81},{"duration":2,"tweenEasing":0,"rotate":80.45},{"duration":5,"tweenEasing":0,"rotate":98.83},{"duration":9,"tweenEasing":0,"rotate":69.94},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.36},{"tweenEasing":0,"x":1.37},{"tweenEasing":0,"x":1.37},{"duration":2,"tweenEasing":0,"x":1.11},{"duration":5,"tweenEasing":0,"x":1.06},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":2.13,"y":0.25},{"tweenEasing":0,"x":2.16,"y":0.51},{"tweenEasing":0,"x":1.79,"y":0.1},{"duration":2,"tweenEasing":0,"x":0.6,"y":-0.16},{"duration":5,"tweenEasing":0,"x":0.46,"y":-0.06},{"duration":9,"tweenEasing":0,"x":0.23,"y":-0.02},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-4.01},{"tweenEasing":0,"rotate":-4.29},{"tweenEasing":0,"rotate":-3.76},{"duration":2,"tweenEasing":0,"rotate":-0.49},{"duration":5,"tweenEasing":0,"rotate":-2.2},{"duration":9,"tweenEasing":0,"rotate":-1.52},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.89},{"tweenEasing":0,"x":0.9},{"tweenEasing":0,"x":0.86},{"duration":2,"tweenEasing":0,"x":0.91},{"duration":5,"tweenEasing":0,"x":0.95},{"duration":9,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"hand_l_1","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-2.66,"y":-9.1},{"tweenEasing":0,"x":-2.17,"y":-9.02},{"tweenEasing":0,"x":-5.98,"y":-5.96},{"duration":2,"tweenEasing":0,"x":-5.74,"y":-2.63},{"duration":5,"tweenEasing":0,"x":-3.45,"y":-3.37},{"duration":9,"tweenEasing":0,"x":-2.32,"y":-1.88},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-34.35},{"tweenEasing":0,"rotate":-34.6},{"tweenEasing":0,"rotate":-31.6},{"duration":2,"tweenEasing":0,"rotate":-21.79},{"duration":5,"tweenEasing":0,"rotate":-18.73},{"duration":9,"tweenEasing":0,"rotate":-9.54},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.41},{"tweenEasing":0,"x":1.44},{"tweenEasing":0,"x":1.23},{"duration":2,"tweenEasing":0,"x":0.76},{"duration":5,"tweenEasing":0,"x":0.84},{"duration":9,"tweenEasing":0,"x":0.91},{"duration":0}]},{"name":"thigh_l_f","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":2.87,"y":1.55},{"duration":2,"tweenEasing":0,"x":2.87,"y":1.55},{"duration":2,"tweenEasing":0,"x":-0.74,"y":0.12},{"duration":5,"tweenEasing":0,"x":0.99,"y":0.33},{"duration":9,"tweenEasing":0,"x":0.57,"y":0.06},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":68.22},{"duration":2,"tweenEasing":0,"rotate":68.22},{"duration":2,"tweenEasing":0,"rotate":11.97},{"duration":5,"tweenEasing":0,"rotate":34.49},{"duration":9,"tweenEasing":0,"rotate":23.26},{"duration":0}],"scaleFrame":[{"duration":10,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0,"x":0.93},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"thigh_l_m","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":2.42,"y":1.68},{"duration":2,"tweenEasing":0,"x":2.42,"y":1.68},{"duration":2,"tweenEasing":0,"x":-0.68,"y":0.03},{"duration":5,"tweenEasing":0,"x":0.87,"y":0.34},{"duration":9,"tweenEasing":0,"x":0.56,"y":0.08},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-19.22},{"duration":2,"tweenEasing":0,"rotate":-19.22},{"duration":2,"tweenEasing":0,"rotate":8.19},{"duration":5,"tweenEasing":0,"rotate":11.9},{"duration":9,"tweenEasing":0,"rotate":9.44},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.7},{"duration":2,"tweenEasing":0,"x":0.7},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":5,"tweenEasing":0,"x":0.76},{"duration":9,"tweenEasing":0,"x":0.93},{"duration":0}]},{"name":"thigh_l_b","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.95,"y":-0.86},{"duration":2,"tweenEasing":0,"x":1.95,"y":-0.86},{"duration":7,"tweenEasing":0,"x":-0.25,"y":0.29},{"duration":9,"tweenEasing":0,"x":-0.77,"y":0.59},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-29.52},{"duration":2,"tweenEasing":0,"rotate":-29.52},{"duration":7,"tweenEasing":0,"rotate":-5.46},{"duration":9,"tweenEasing":0,"rotate":-4.66},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.73},{"duration":2,"tweenEasing":0,"x":0.73},{"duration":7,"tweenEasing":0,"x":0.92},{"duration":9,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"tail9","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.03,"y":0.06},{"duration":2,"tweenEasing":0,"x":0.03,"y":0.06},{"duration":2,"tweenEasing":0,"x":0.07,"y":0.08},{"duration":5,"tweenEasing":0,"x":0.05,"y":-0.09},{"duration":9,"tweenEasing":0,"x":-0.1,"y":-0.08},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":6.25},{"duration":2,"tweenEasing":0,"rotate":6.25},{"duration":2,"tweenEasing":0,"rotate":17.01},{"duration":5,"tweenEasing":0,"rotate":-0.51},{"duration":9,"tweenEasing":0,"rotate":10.02},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail8","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.52,"y":0.08},{"duration":2,"tweenEasing":0,"x":0.52,"y":0.08},{"duration":2,"tweenEasing":0,"x":0.56,"y":0.12},{"duration":5,"tweenEasing":0,"x":0.05},{"duration":9,"tweenEasing":0,"x":0.05,"y":-0.06},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":9.98},{"duration":2,"tweenEasing":0,"rotate":9.98},{"duration":2,"tweenEasing":0,"rotate":2.22},{"duration":5,"tweenEasing":0,"rotate":10.98},{"duration":9,"tweenEasing":0,"rotate":4.28},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":14}]},{"name":"tail7","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.06,"y":0.14},{"duration":2,"tweenEasing":0,"x":-0.06,"y":0.14},{"duration":2,"tweenEasing":0,"x":-0.05,"y":0.2},{"duration":5,"tweenEasing":0,"x":0.11,"y":0.12},{"duration":9,"tweenEasing":0,"x":0.06,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":8.59},{"duration":2,"tweenEasing":0,"rotate":8.59},{"duration":2,"tweenEasing":0,"rotate":1.56},{"duration":5,"tweenEasing":0,"rotate":2.79},{"duration":9,"tweenEasing":0,"rotate":10.52},{"duration":0}],"scaleFrame":[{"duration":12,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":9}]},{"name":"tail6","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.15,"y":0.04},{"duration":2,"tweenEasing":0,"x":-0.15,"y":0.04},{"duration":2,"tweenEasing":0,"x":-0.11,"y":-0.01},{"duration":5,"tweenEasing":0,"x":-0.06,"y":-0.03},{"duration":9,"tweenEasing":0,"x":-0.05,"y":-0.01},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-6.28},{"duration":2,"tweenEasing":0,"rotate":-6.28},{"duration":2,"tweenEasing":0,"rotate":-8.52},{"duration":5,"tweenEasing":0,"rotate":-9.52},{"duration":9,"tweenEasing":0,"rotate":-9.53},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail5","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.08},{"duration":2,"tweenEasing":0,"x":-0.08},{"duration":2,"tweenEasing":0,"x":-0.02,"y":0.04},{"duration":5,"tweenEasing":0,"x":-0.01,"y":0.03},{"duration":9,"tweenEasing":0,"x":0.03,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-9.05},{"duration":2,"tweenEasing":0,"rotate":-9.05},{"duration":2,"tweenEasing":0,"rotate":-11.05},{"duration":5,"tweenEasing":0,"rotate":-7.28},{"duration":9,"tweenEasing":0,"rotate":-1.5},{"duration":0}]},{"name":"tail4","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.09,"y":-0.09},{"duration":2,"tweenEasing":0,"x":-0.09,"y":-0.09},{"duration":2,"tweenEasing":0,"x":-0.08,"y":0.05},{"duration":5,"tweenEasing":0,"x":-0.09,"y":0.09},{"duration":9,"tweenEasing":0,"x":-0.02,"y":0.08},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-4.04},{"duration":2,"tweenEasing":0,"rotate":-4.04},{"duration":2,"tweenEasing":0,"rotate":-0.27},{"duration":5,"tweenEasing":0,"rotate":-1.01},{"duration":9,"tweenEasing":0,"rotate":-1.75},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":16}]},{"name":"tail3","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.04,"y":-0.07},{"duration":2,"tweenEasing":0,"x":-0.04,"y":-0.07},{"duration":2,"tweenEasing":0,"x":-0.07,"y":-0.05},{"duration":5,"tweenEasing":0,"x":-0.02,"y":-0.04},{"duration":9,"tweenEasing":0,"x":-0.06,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-4.02},{"duration":2,"tweenEasing":0,"rotate":-4.02},{"duration":2,"tweenEasing":0,"rotate":-6.02},{"duration":5,"tweenEasing":0,"rotate":-0.25},{"duration":9,"tweenEasing":0,"rotate":1.26},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":14}]},{"name":"tail2","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.12,"y":-0.08},{"duration":2,"tweenEasing":0,"x":0.12,"y":-0.08},{"duration":2,"tweenEasing":0,"x":-0.01,"y":-0.01},{"duration":5,"tweenEasing":0,"x":0.02,"y":0.07},{"duration":9,"tweenEasing":0,"x":-0.03,"y":0.09},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":3.51},{"duration":2,"tweenEasing":0,"rotate":3.51},{"duration":2,"tweenEasing":0,"rotate":1.5},{"duration":5,"tweenEasing":0,"rotate":4},{"duration":9,"tweenEasing":0,"rotate":6.51},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":16}]},{"name":"tail1","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.07,"y":-0.13},{"duration":2,"tweenEasing":0,"x":0.07,"y":-0.13},{"duration":2,"tweenEasing":0,"x":-0.05,"y":-0.11},{"duration":5,"tweenEasing":0,"x":-0.03,"y":-0.06},{"duration":9,"tweenEasing":0,"x":-0.06,"y":-0.11},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":2.51},{"duration":2,"tweenEasing":0,"rotate":2.51},{"duration":2,"tweenEasing":0,"rotate":-1.5},{"duration":5,"tweenEasing":0},{"duration":9,"tweenEasing":0,"rotate":8.51},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":14}]},{"name":"tail","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-4.07,"y":-10.56},{"duration":2,"tweenEasing":0,"x":-4.07,"y":-10.56},{"duration":2,"tweenEasing":0,"x":0.05,"y":0.13},{"duration":5,"tweenEasing":0,"x":-3.94,"y":-10.29},{"duration":9,"tweenEasing":0,"x":-3.17,"y":-7.52},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":5.81},{"duration":2,"tweenEasing":0,"rotate":5.81},{"duration":2,"tweenEasing":0,"rotate":-11.36},{"duration":5,"tweenEasing":0,"rotate":2.88},{"duration":9,"tweenEasing":0,"rotate":-7.33},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"weapon","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.63,"y":1.02},{"duration":2,"tweenEasing":0,"x":1.63,"y":1.02},{"duration":2,"tweenEasing":0,"x":1.25,"y":0.6},{"duration":5,"tweenEasing":0,"x":0.68,"y":0.21},{"duration":9,"tweenEasing":0,"x":-2.77,"y":-0.7},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-1.42},{"duration":2,"tweenEasing":0,"rotate":-1.42},{"duration":2,"tweenEasing":0,"rotate":10.61},{"duration":5,"tweenEasing":0,"rotate":19.59},{"duration":9,"tweenEasing":0,"rotate":-3.95},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":6.25,"y":-28.3},{"duration":2,"tweenEasing":0,"x":6.25,"y":-28.3},{"duration":7,"tweenEasing":0,"x":-13.9,"y":-11.4},{"duration":9,"tweenEasing":0,"x":-20.7,"y":-7.45},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-11.26},{"duration":2,"tweenEasing":0,"rotate":-11.26},{"duration":7,"tweenEasing":0,"rotate":3.25},{"duration":9,"tweenEasing":0,"rotate":7.01},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"y":0.99},{"duration":2,"tweenEasing":0,"y":0.99},{"duration":16}]},{"name":"chest","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.93,"y":0.22},{"duration":2,"tweenEasing":0,"x":0.93,"y":0.22},{"duration":2,"tweenEasing":0,"x":0.9,"y":0.29},{"duration":5,"tweenEasing":0,"x":-7.65,"y":1.91},{"duration":9,"tweenEasing":0,"x":0.54,"y":0.18},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-15.17},{"duration":2,"tweenEasing":0,"rotate":-15.17},{"duration":2,"tweenEasing":0,"rotate":3.54},{"duration":5,"tweenEasing":0,"rotate":-11.27},{"duration":9,"tweenEasing":0,"rotate":-10.92},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.99},{"duration":9}]},{"name":"neck","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.47,"y":-0.68},{"duration":2,"tweenEasing":0,"x":0.47,"y":-0.68},{"duration":2,"tweenEasing":0,"x":0.1,"y":0.33},{"duration":5,"tweenEasing":0,"y":-0.04},{"duration":9,"tweenEasing":0,"x":-0.18,"y":-0.05},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-4.46},{"duration":2,"tweenEasing":0,"rotate":-4.46},{"duration":2,"tweenEasing":0,"rotate":-0.6},{"duration":5,"tweenEasing":0,"rotate":-0.62},{"duration":9,"tweenEasing":0,"rotate":-0.57},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.99},{"duration":9}]},{"name":"head","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.24,"y":-0.16},{"duration":2,"tweenEasing":0,"x":0.24,"y":-0.16},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.12},{"duration":5,"tweenEasing":0,"x":0.04,"y":-0.12},{"duration":9,"tweenEasing":0,"x":0.06,"y":-0.08},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-22.05},{"duration":2,"tweenEasing":0,"rotate":-22.05},{"duration":2,"tweenEasing":0,"rotate":-32.09},{"duration":5,"tweenEasing":0,"rotate":-1.46},{"duration":9,"tweenEasing":0,"rotate":2.03},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":14}]},{"name":"thigh_r_b","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-1.24,"y":0.82},{"duration":2,"tweenEasing":0,"x":-1.24,"y":0.82},{"duration":7,"tweenEasing":0,"x":0.21,"y":-0.16},{"duration":9,"tweenEasing":0,"x":0.61,"y":-0.47},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-43.53},{"duration":2,"tweenEasing":0,"rotate":-43.53},{"duration":7,"tweenEasing":0,"rotate":-10.75},{"duration":9,"tweenEasing":0,"rotate":-0.89},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.06},{"duration":2,"tweenEasing":0,"x":1.06},{"duration":7,"tweenEasing":0,"x":0.88},{"duration":9,"tweenEasing":0,"x":0.9},{"duration":0}]},{"name":"thigh_r_m","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-1.84,"y":-0.27},{"duration":2,"tweenEasing":0,"x":-1.84,"y":-0.27},{"duration":2,"tweenEasing":0,"x":0.31,"y":0.08},{"duration":5,"tweenEasing":0,"x":-0.58,"y":-0.01},{"duration":9,"tweenEasing":0,"x":-0.37,"y":-0.04},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-58.41},{"duration":2,"tweenEasing":0,"rotate":-58.41},{"duration":2,"tweenEasing":0,"rotate":14.41},{"duration":5,"tweenEasing":0,"rotate":-19.47},{"duration":9,"tweenEasing":0,"rotate":5.18},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.33},{"duration":2,"tweenEasing":0,"x":1.33},{"duration":7,"tweenEasing":0,"x":0.86},{"duration":9,"tweenEasing":0,"x":0.86},{"duration":0}]},{"name":"thigh_r_f","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-1.82,"y":-0.6},{"duration":2,"tweenEasing":0,"x":-1.82,"y":-0.6},{"duration":2,"tweenEasing":0,"x":0.46,"y":0.21},{"duration":5,"tweenEasing":0,"x":-0.57,"y":-0.02},{"duration":9,"tweenEasing":0,"x":-0.38,"y":-0.08},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":148.48},{"duration":2,"tweenEasing":0,"rotate":148.48},{"duration":2,"tweenEasing":0,"rotate":21.76},{"duration":5,"tweenEasing":0,"rotate":58.82},{"duration":9,"tweenEasing":0,"rotate":34.56},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.24},{"duration":2,"tweenEasing":0,"x":1.24},{"duration":2,"tweenEasing":0,"x":0.92},{"duration":5,"tweenEasing":0,"x":0.86},{"duration":9,"tweenEasing":0,"x":0.82},{"duration":0}]},{"name":"upperarm_r","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-3.68,"y":-4.43},{"tweenEasing":0,"x":-3.68,"y":-4.43},{"tweenEasing":0,"x":-0.46,"y":1.07},{"duration":2,"tweenEasing":0,"x":-2.06,"y":3.74},{"duration":5,"tweenEasing":0,"x":-3.62,"y":2.11},{"duration":9,"tweenEasing":0,"x":-2.42,"y":1.61},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-15.34},{"tweenEasing":0,"rotate":-43.18},{"tweenEasing":0,"rotate":-60.73},{"duration":2,"tweenEasing":0,"rotate":2.71},{"duration":5,"tweenEasing":0,"rotate":24.84},{"duration":9,"tweenEasing":0,"rotate":18.56},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.12},{"tweenEasing":0,"x":1.06},{"tweenEasing":0,"x":1.05},{"duration":2,"tweenEasing":0,"x":1.12},{"duration":5,"tweenEasing":0,"x":1.15},{"duration":9,"tweenEasing":0,"x":1.11},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.28,"y":-0.03},{"tweenEasing":0,"x":0.5,"y":-0.16},{"tweenEasing":0,"x":0.46,"y":0.05},{"duration":2,"tweenEasing":0,"x":0.1,"y":0.23},{"duration":5,"tweenEasing":0,"x":0.02,"y":0.38},{"duration":9,"tweenEasing":0,"x":0.02,"y":0.29},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-20.12},{"tweenEasing":0,"rotate":-6.29},{"tweenEasing":0,"rotate":23.87},{"duration":2,"tweenEasing":0,"rotate":-38.13},{"duration":5,"tweenEasing":0,"rotate":-24.15},{"duration":9,"tweenEasing":0,"rotate":-13.86},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.02},{"duration":9,"tweenEasing":0,"x":1.02},{"duration":0}]},{"name":"hand_r_1","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.68,"y":-1.36},{"tweenEasing":0,"x":-0.31,"y":-0.75},{"tweenEasing":0,"x":-0.06,"y":-1.32},{"duration":2,"tweenEasing":0,"x":-0.72,"y":-0.86},{"duration":5,"tweenEasing":0,"x":-1.46,"y":-1.41},{"duration":9,"tweenEasing":0,"x":-1.31,"y":-1.28},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-20.58},{"tweenEasing":0,"rotate":-19.22},{"tweenEasing":0,"rotate":-7.83},{"duration":2,"tweenEasing":0,"rotate":5.25},{"duration":5,"tweenEasing":0,"rotate":2.75},{"duration":9,"tweenEasing":0,"rotate":1.2},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":12,"tweenEasing":0,"x":0.97},{"duration":9,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.34,"y":0.33},{"tweenEasing":0,"x":0.44,"y":0.49},{"tweenEasing":0,"x":0.63,"y":0.21},{"duration":2,"tweenEasing":0,"x":-0.24,"y":0.13},{"duration":5,"tweenEasing":0,"x":-0.44,"y":0.15},{"duration":9,"tweenEasing":0,"x":-0.4,"y":0.04},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":1.26},{"tweenEasing":0,"rotate":1.57},{"tweenEasing":0,"rotate":-10.3},{"duration":2,"tweenEasing":0,"rotate":-20.06},{"duration":5,"tweenEasing":0,"rotate":-26.79},{"duration":9,"tweenEasing":0,"rotate":-18.57},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"calf_r_b","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.96,"y":0.42},{"duration":2,"tweenEasing":0,"x":1.96,"y":0.42},{"duration":7,"tweenEasing":0,"x":0.36},{"duration":9,"tweenEasing":0,"x":0.29,"y":-0.2},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":50.11},{"duration":2,"tweenEasing":0,"rotate":50.11},{"duration":7,"tweenEasing":0,"rotate":-5.44},{"duration":9,"tweenEasing":0,"rotate":-21.76},{"duration":0}],"scaleFrame":[{"duration":10,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":9}]},{"name":"calf_r_m","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-2.32,"y":1},{"duration":2,"tweenEasing":0,"x":-2.32,"y":1},{"duration":2,"tweenEasing":0,"x":-4.41,"y":-0.35},{"duration":5,"tweenEasing":0,"x":-9.87,"y":0.22},{"duration":9,"tweenEasing":0,"x":-1.15,"y":-0.32},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":74.14},{"duration":2,"tweenEasing":0,"rotate":74.14},{"duration":2,"tweenEasing":0,"rotate":-26.22},{"duration":5,"tweenEasing":0,"rotate":11.64},{"duration":9,"tweenEasing":0,"rotate":-14.45},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0,"x":1.02},{"duration":9}]},{"name":"calf_r_f","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":8.66,"y":49.93},{"duration":2,"tweenEasing":0,"x":8.66,"y":49.93},{"duration":2,"tweenEasing":0,"x":13.13,"y":-1.78},{"duration":5,"tweenEasing":0,"x":20.67,"y":17.71},{"duration":9,"tweenEasing":0,"x":15.86,"y":6.78},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":33.61},{"duration":2,"tweenEasing":0,"rotate":33.61},{"duration":2,"tweenEasing":0,"rotate":-9.11},{"duration":5,"tweenEasing":0,"rotate":2.12},{"duration":9,"tweenEasing":0,"rotate":-3.84},{"duration":0}],"scaleFrame":[{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":5,"tweenEasing":0,"x":1.02},{"duration":9}]}]},{"duration":35,"playTimes":0,"fadeInTime":0.1,"name":"victory","bone":[{"name":"calf_l_f","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.91,"y":-0.16},{"duration":9,"tweenEasing":0,"x":-0.19,"y":0.37},{"duration":15,"tweenEasing":0,"x":-0.12,"y":0.42},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-54.45},{"duration":9,"tweenEasing":0,"rotate":-3.79},{"duration":15,"tweenEasing":0,"rotate":-7.3},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.94},{"duration":9,"tweenEasing":0,"x":1.08},{"duration":15,"tweenEasing":0,"x":1.1},{"duration":0}]},{"name":"calf_l_m","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.3,"y":0.21},{"duration":9,"tweenEasing":0,"x":-7.46,"y":-0.52},{"duration":15,"tweenEasing":0,"x":-0.9,"y":-0.53},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-36.09},{"duration":9,"tweenEasing":0,"rotate":20.4},{"duration":15,"tweenEasing":0,"rotate":17.9},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":1.16},{"duration":15,"tweenEasing":0,"x":1.15},{"duration":0}]},{"name":"calf_l_b","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.19,"y":-0.21},{"duration":9,"tweenEasing":0,"x":-0.5,"y":-0.1},{"duration":15,"tweenEasing":0,"x":-0.17,"y":-0.13},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-39.55},{"duration":9,"tweenEasing":0,"rotate":26.83},{"duration":15,"tweenEasing":0,"rotate":12.03},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.9},{"duration":9,"tweenEasing":0,"x":1.1},{"duration":15,"tweenEasing":0,"x":1.03},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-3.47,"y":-0.22},{"tweenEasing":0,"x":0.19,"y":-0.22},{"duration":9,"tweenEasing":0,"x":4.18,"y":-0.77},{"duration":15,"tweenEasing":0,"x":4.22,"y":-0.86},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-45.53},{"tweenEasing":0,"rotate":-50.17},{"duration":9,"tweenEasing":0,"rotate":1.94},{"duration":15,"tweenEasing":0,"rotate":-7.35},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":15,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"upperarm_l","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.22,"y":3.39},{"tweenEasing":0,"x":6.22,"y":5.06},{"duration":9,"tweenEasing":0,"x":3.1,"y":8.49},{"duration":15,"tweenEasing":0,"x":3.49,"y":7.48},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":42.42},{"tweenEasing":0,"rotate":20.84},{"duration":9,"tweenEasing":0,"rotate":-36.52},{"duration":15,"tweenEasing":0,"rotate":-35.74},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.85},{"duration":10,"tweenEasing":0,"x":1.36},{"duration":15,"tweenEasing":0,"x":1.36},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-0.05,"y":-0.1},{"tweenEasing":0,"x":0.77,"y":-0.09},{"duration":9,"tweenEasing":0,"x":1.51,"y":0.12},{"duration":15,"tweenEasing":0,"x":1.64,"y":0.22},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-2.51},{"tweenEasing":0,"rotate":-5.49},{"duration":9,"tweenEasing":0,"rotate":20.5},{"duration":15,"tweenEasing":0,"rotate":14.39},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.95},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":15,"tweenEasing":0,"x":0.94},{"duration":0}]},{"name":"hand_l_1","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-2.55,"y":1.82},{"tweenEasing":0,"x":-1.01,"y":-7.89},{"duration":9,"tweenEasing":0,"x":-0.04,"y":-10.02},{"duration":15,"tweenEasing":0,"x":-0.07,"y":-10.21},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":9.01},{"tweenEasing":0,"rotate":-17.32},{"duration":9,"tweenEasing":0,"rotate":-27.68},{"duration":15,"tweenEasing":0,"rotate":-12.46},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":10,"tweenEasing":0,"x":1.46},{"duration":15,"tweenEasing":0,"x":1.46},{"duration":0}]},{"name":"thigh_l_f","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.17,"y":-0.02},{"duration":9,"tweenEasing":0,"x":1.9,"y":0.84},{"duration":15,"tweenEasing":0,"x":2.63,"y":1.45},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":20.88},{"duration":9,"tweenEasing":0,"rotate":34.57},{"duration":15,"tweenEasing":0,"rotate":40.45},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":9,"tweenEasing":0,"x":0.75},{"duration":15,"tweenEasing":0,"x":0.75},{"duration":0}]},{"name":"thigh_l_m","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.13,"y":-0.12},{"duration":9,"tweenEasing":0,"x":1.57,"y":0.96},{"duration":15,"tweenEasing":0,"x":2.21,"y":1.42},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":10.82},{"duration":9,"tweenEasing":0,"rotate":-6.26},{"duration":15,"tweenEasing":0,"rotate":-3.64},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.08},{"duration":9,"tweenEasing":0,"x":0.7},{"duration":15,"tweenEasing":0,"x":0.71},{"duration":0}]},{"name":"thigh_l_b","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.7,"y":0.29},{"duration":9,"tweenEasing":0,"x":1.9,"y":-0.84},{"duration":15,"tweenEasing":0,"x":2.14,"y":-1.07},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-1.42},{"duration":9,"tweenEasing":0,"rotate":-18.72},{"duration":15,"tweenEasing":0,"rotate":-2.95},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":9,"tweenEasing":0,"x":0.82},{"duration":15,"tweenEasing":0,"x":0.96},{"duration":0}]},{"name":"tail9","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.18,"y":0.06},{"duration":9,"tweenEasing":0,"x":-0.09,"y":0.18},{"duration":15,"tweenEasing":0,"x":0.22,"y":0.26},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-0.06},{"duration":9,"tweenEasing":0,"rotate":4.44},{"duration":15,"tweenEasing":0,"rotate":6.42},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.02,"y":1.01},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":15,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail8","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"y":-0.1},{"duration":9,"tweenEasing":0,"x":0.46,"y":0.13},{"duration":15,"tweenEasing":0,"x":0.31,"y":0.24},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":1.05},{"duration":9,"tweenEasing":0,"rotate":6.25},{"duration":15,"tweenEasing":0,"rotate":6.3},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":1.02},{"duration":15,"tweenEasing":0,"x":1.02},{"duration":0}]},{"name":"tail7","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.29,"y":-0.07},{"duration":9,"tweenEasing":0,"x":-0.2,"y":0.25},{"duration":15,"tweenEasing":0,"x":-0.36,"y":0.23},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":1.8},{"duration":9,"tweenEasing":0,"rotate":3.57},{"duration":15,"tweenEasing":0,"rotate":1.79},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail6","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.01,"y":-0.13},{"duration":9,"tweenEasing":0,"x":-0.23,"y":0.02},{"duration":15,"tweenEasing":0,"x":-0.3,"y":-0.09},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":1.68},{"duration":9,"tweenEasing":0,"rotate":-6.79},{"duration":15,"tweenEasing":0,"rotate":-9.84},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":1.02},{"duration":15,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"tail5","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.13,"y":0.02},{"duration":9,"tweenEasing":0,"x":-0.1,"y":-0.02},{"duration":15,"tweenEasing":0,"x":-0.12},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":1.25},{"duration":9,"tweenEasing":0,"rotate":3.45},{"duration":15,"tweenEasing":0,"rotate":-4.04},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"tail4","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.07,"y":-0.03},{"duration":9,"tweenEasing":0,"x":-0.08,"y":-0.16},{"duration":15,"tweenEasing":0,"x":-0.16,"y":-0.17},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":0.77},{"duration":9,"tweenEasing":0,"rotate":8.76},{"duration":15,"tweenEasing":0,"rotate":3.51},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":15,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"tail3","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.03,"y":0.07},{"duration":9,"tweenEasing":0,"x":-0.04,"y":-0.15},{"duration":15,"tweenEasing":0,"x":-0.02,"y":-0.15},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":0.78},{"duration":9,"tweenEasing":0,"rotate":-6.75},{"duration":15,"tweenEasing":0,"rotate":-7.76},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":0.96},{"duration":15,"tweenEasing":0,"x":0.96},{"duration":0}]},{"name":"tail2","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.04,"y":0.07},{"duration":9,"tweenEasing":0,"x":0.07,"y":-0.05},{"duration":15,"tweenEasing":0,"x":0.06,"y":-0.05},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":0.76},{"duration":9,"tweenEasing":0,"rotate":-10.53},{"duration":15,"tweenEasing":0,"rotate":-11.78},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":0.97},{"duration":15,"tweenEasing":0,"x":0.96},{"duration":0}]},{"name":"tail1","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.04,"y":-0.01},{"duration":9,"tweenEasing":0,"x":-0.01,"y":-0.12},{"duration":15,"tweenEasing":0,"x":-0.07,"y":-0.14},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":0.51},{"duration":9,"tweenEasing":0,"rotate":-23.79},{"duration":15,"tweenEasing":0,"rotate":-17.54},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":0.97},{"duration":15,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"tail","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-1.02,"y":-2.32},{"duration":9,"tweenEasing":0,"x":-1.22,"y":-1.99},{"duration":15,"tweenEasing":0,"x":-2.53,"y":-5.31},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":17.57},{"duration":9,"tweenEasing":0,"rotate":8.99},{"duration":15,"tweenEasing":0,"rotate":5.6},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":15,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"weapon","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-4.41,"y":-0.58},{"duration":9,"tweenEasing":0,"x":3.36,"y":2.58},{"duration":15,"tweenEasing":0,"x":4.73,"y":5.93},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-0.09},{"duration":9,"tweenEasing":0,"rotate":4.37},{"duration":15,"tweenEasing":0,"rotate":6.46},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":15,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-31.3,"y":7.8},{"duration":9,"tweenEasing":0,"x":7.65,"y":-19.7},{"duration":15,"tweenEasing":0,"x":0.95,"y":-8.2},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":5.75},{"duration":9,"tweenEasing":0,"rotate":-11.26},{"duration":15,"tweenEasing":0,"rotate":-14.26},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":9,"tweenEasing":0,"y":0.99},{"duration":15,"tweenEasing":0,"y":0.99},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.07,"y":0.1},{"duration":9,"tweenEasing":0,"x":-0.04,"y":-0.03},{"duration":15,"tweenEasing":0,"x":-0.06,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-3.93},{"duration":9,"tweenEasing":0,"rotate":-4.4},{"duration":15,"tweenEasing":0,"rotate":-9.95},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":15,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":0}]},{"name":"neck","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.09,"y":0.46},{"duration":9,"tweenEasing":0,"x":0.34,"y":-0.33},{"duration":15,"tweenEasing":0,"x":0.41,"y":-0.29},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-8.71},{"duration":9,"tweenEasing":0,"rotate":-15.05},{"duration":15,"tweenEasing":0,"rotate":-9.93},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":0.97},{"duration":15,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"head","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.01,"y":-0.15},{"duration":9,"tweenEasing":0,"x":0.21,"y":-0.1},{"duration":15,"tweenEasing":0,"x":0.19,"y":-0.13},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-4.21},{"duration":9,"tweenEasing":0,"rotate":-8.76},{"duration":15,"tweenEasing":0,"rotate":-2.47},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":0.97},{"duration":15,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"thigh_r_b","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.63,"y":-0.32},{"duration":9,"tweenEasing":0,"x":-1.18,"y":0.84},{"duration":15,"tweenEasing":0,"x":-1.54,"y":1.19},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":23.91},{"duration":9,"tweenEasing":0,"rotate":-31.02},{"duration":15,"tweenEasing":0,"rotate":-5.74},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.18},{"duration":9,"tweenEasing":0,"x":1.04},{"duration":15,"tweenEasing":0,"x":1.21},{"duration":0}]},{"name":"thigh_r_m","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.06,"y":0.11},{"duration":9,"tweenEasing":0,"x":-1.03,"y":-0.05},{"duration":15,"tweenEasing":0,"x":-1.76,"y":-0.13},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":24.82},{"duration":9,"tweenEasing":0,"rotate":-49.73},{"duration":15,"tweenEasing":0,"rotate":-31.33},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.18},{"duration":9,"tweenEasing":0,"x":1.06},{"duration":15,"tweenEasing":0,"x":1.22},{"duration":0}]},{"name":"thigh_r_f","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.04,"y":0.25},{"duration":9,"tweenEasing":0,"x":-0.95,"y":-0.18},{"duration":15,"tweenEasing":0,"x":-1.8,"y":-0.23},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":23.9},{"duration":9,"tweenEasing":0,"rotate":100.48},{"duration":15,"tweenEasing":0,"rotate":103.59},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.06},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":15,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"upperarm_r","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-1.1,"y":2.05},{"tweenEasing":0,"x":1.4,"y":-0.78},{"duration":9,"tweenEasing":0,"x":-2.66,"y":0.35},{"duration":15,"tweenEasing":0,"x":-2.8,"y":-1.76},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":4.57},{"tweenEasing":0,"rotate":3.94},{"duration":9,"tweenEasing":0,"rotate":-53.7},{"duration":15,"tweenEasing":0,"rotate":-50.16},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.16},{"tweenEasing":0,"x":1.14},{"duration":9,"tweenEasing":0,"x":1.28},{"duration":15,"tweenEasing":0,"x":1.27},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.02,"y":0.12},{"tweenEasing":0,"x":0.4,"y":0.2},{"duration":9,"tweenEasing":0,"x":-5.39,"y":-0.19},{"duration":15,"tweenEasing":0,"x":-5.54,"y":-0.15},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-26.65},{"tweenEasing":0,"rotate":-45.38},{"duration":9,"tweenEasing":0,"rotate":12.65},{"duration":15,"tweenEasing":0,"rotate":3.37},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.82,"y":0.98},{"duration":9,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":15,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"hand_r_1","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-1.87,"y":-1.56},{"tweenEasing":0,"x":3.51,"y":0.36},{"duration":9,"tweenEasing":0,"x":1.43,"y":-0.38},{"duration":15,"tweenEasing":0,"x":1.28,"y":0.26},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":19.82},{"tweenEasing":0,"rotate":-1.79},{"duration":9,"tweenEasing":0,"rotate":-10.87},{"duration":15,"tweenEasing":0,"rotate":-1.06},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.9},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":15,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":-0.53,"y":-0.08},{"tweenEasing":0,"x":1.23,"y":0.71},{"duration":9,"tweenEasing":0,"x":1.09,"y":0.66},{"duration":15,"tweenEasing":0,"x":0.72,"y":0.63},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-9.23},{"tweenEasing":0,"rotate":2.01},{"duration":9,"tweenEasing":0,"rotate":29.05},{"duration":15,"tweenEasing":0,"rotate":22.3},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"tweenEasing":0,"x":0.89},{"duration":9,"tweenEasing":0,"x":0.95},{"duration":15,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"calf_r_b","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.51,"y":-0.25},{"duration":9,"tweenEasing":0,"x":2.04,"y":0.63},{"duration":15,"tweenEasing":0,"x":-2.67,"y":0.29},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-45.96},{"duration":9,"tweenEasing":0,"rotate":39.62},{"duration":15,"tweenEasing":0,"rotate":16.24},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.95},{"duration":24}]},{"name":"calf_r_m","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":-0.52,"y":-0.4},{"duration":9,"tweenEasing":0,"x":-2.04,"y":1},{"duration":15,"tweenEasing":0,"x":-1.98,"y":0.83},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-40.35},{"duration":9,"tweenEasing":0,"rotate":58.7},{"duration":15,"tweenEasing":0,"rotate":43.38},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.94},{"duration":9,"tweenEasing":0,"x":1.02},{"duration":15,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"calf_r_f","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":16.34,"y":-5.59},{"duration":9,"tweenEasing":0,"x":8.21,"y":32.02},{"duration":15,"tweenEasing":0,"x":4.22,"y":31.82},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"rotate":-17.51},{"duration":9,"tweenEasing":0,"rotate":21.5},{"duration":15,"tweenEasing":0,"rotate":23.12},{"duration":0}],"scaleFrame":[{"duration":8,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":0.91},{"duration":9,"tweenEasing":0,"x":1.03},{"duration":15,"tweenEasing":0,"x":1.03},{"duration":0}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":25,"name":"mecha_2903b","aabb":{"x":-166.95,"y":-203.52,"width":346.09,"height":218.17},"bone":[{"inheritScale":false,"length":11,"name":"pelvis","transform":{"x":-41.2,"y":-49.45,"skX":76.0851,"skY":76.1437,"scX":0.9995,"scY":0.9978}},{"inheritScale":false,"length":33,"name":"chest","parent":"pelvis","transform":{"x":4.3,"y":-15.06,"skX":-49.0173,"skY":-48.9448,"scX":0.9987,"scY":0.9996}},{"inheritScale":false,"length":36,"name":"thigh_l_b","parent":"pelvis","transform":{"x":9.9,"y":0.83,"skX":-177.595,"skY":-177.5957,"scX":0.9938,"scY":0.998}},{"inheritScale":false,"length":31,"name":"thigh_r_b","parent":"pelvis","transform":{"x":20.57,"y":14.15,"skX":155.0643,"skY":155.0181,"scX":0.9466,"scY":0.9952}},{"inheritScale":false,"length":13,"name":"tail","parent":"chest","transform":{"x":-32.21,"y":16.45,"skX":152.8011,"skY":152.8011,"scX":0.999}},{"inheritScale":false,"length":33,"name":"thigh_r_m","parent":"chest","transform":{"x":24.87,"y":21.17,"skX":-134.049,"skY":-134.0888,"scX":0.9415,"scY":0.9973}},{"inheritScale":false,"name":"thigh_r_f","parent":"chest","transform":{"x":49.12,"y":9.74,"skX":-87.6376,"skY":-87.637,"scX":0.9261,"scY":0.9958}},{"inheritScale":false,"name":"calf_r_b","parent":"thigh_r_b","transform":{"x":31.66,"y":0.03,"skX":-112.1024,"skY":-112.1024,"scX":1.0071,"scY":0.9958}},{"inheritScale":false,"name":"calf_l_b","parent":"thigh_l_b","transform":{"x":36.26,"y":-0.01,"skX":-151.5258,"skY":-151.5258,"scX":1.0056,"scY":0.9973}},{"inheritScale":false,"length":52,"name":"thigh_l_m","parent":"chest","transform":{"x":26.31,"y":11.26,"skX":-103.9319,"skY":-103.9223,"scX":0.9794,"scY":0.9978}},{"inheritScale":false,"length":17,"name":"neck","parent":"chest","transform":{"x":62.91,"y":-36.34,"skX":-30.6973,"skY":-30.7124,"scX":0.9984,"scY":0.9992}},{"inheritScale":false,"name":"calf_r_f","parent":"chest","transform":{"x":50.6,"y":-21.26,"skX":46.531,"skY":46.5318,"scX":1.0002,"scY":0.9974}},{"inheritScale":false,"length":54,"name":"thigh_l_f","parent":"chest","transform":{"x":50.49,"y":-1.08,"skX":-71.7516,"skY":-71.7533,"scX":1.0058,"scY":0.9951}},{"inheritScale":false,"length":14,"name":"upperarm_l","parent":"neck","transform":{"x":23,"y":-8.68,"skX":63.7558,"skY":63.7438,"scX":0.9979,"scY":0.9956}},{"inheritScale":false,"name":"calf_r_m","parent":"thigh_r_m","transform":{"x":33.64,"y":-0.03,"skX":-154.1031,"skY":-154.1031,"scX":1.0062,"scY":0.9984}},{"inheritScale":false,"length":25,"name":"upperarm_r","parent":"neck","transform":{"x":12.28,"y":5.8,"skX":89.6493,"skY":89.4553,"scX":0.8704,"scY":0.9994}},{"inheritScale":false,"name":"calf_l_f","parent":"thigh_l_f","transform":{"x":54.21,"y":0.02,"skX":92.9449,"skY":92.9425,"scX":1.0255,"scY":0.9951}},{"inheritScale":false,"name":"calf_l_m","parent":"thigh_l_m","transform":{"x":52.2,"y":-0.04,"skX":153.9595,"skY":153.9612,"scX":1.0523,"scY":0.9979}},{"inheritScale":false,"length":14,"name":"tail1","parent":"tail","transform":{"x":13.12,"skX":4.4887,"skY":4.489,"scX":0.9995,"scY":0.9992}},{"inheritScale":false,"name":"head","parent":"neck","transform":{"x":16.17,"y":2.98,"skX":27.3048,"skY":27.3048,"scX":0.9984,"scY":0.9963}},{"inheritScale":false,"length":15,"name":"tail2","parent":"tail1","transform":{"x":14.68,"y":-0.02,"skX":2.5013,"skY":2.5,"scX":1.0041,"scY":0.9988}},{"inheritScale":false,"length":52,"name":"forearm_r","parent":"upperarm_r","transform":{"x":25.98,"y":0.01,"skX":-83.6035,"skY":-82.0181,"scX":1.0451,"scY":1.0012}},{"inheritScale":false,"length":52,"name":"forearm_l","parent":"upperarm_l","transform":{"x":14.81,"y":0.02,"skX":-57.0604,"skY":-56.8154,"scX":1.0093,"scY":0.9981}},{"inheritScale":false,"name":"hand_r","parent":"forearm_r","transform":{"x":52.25,"y":15.11,"skX":11.5959,"skY":11.5959,"scX":1.0136,"scY":0.9974}},{"inheritScale":false,"name":"hand_l_1","parent":"forearm_l","transform":{"x":50.61,"y":-10.36,"skX":0.3373,"skY":0.3373,"scX":0.9538,"scY":0.9994}},{"inheritScale":false,"name":"hand_r_1","parent":"forearm_r","transform":{"x":52.55,"y":-15.2,"skX":-3.4237,"skY":-3.4229,"scX":1.0252}},{"inheritScale":false,"name":"hand_l","parent":"forearm_l","transform":{"x":54.96,"y":10.3,"skX":14.1078,"skY":14.1086,"scX":0.9875,"scY":0.9972}},{"inheritScale":false,"length":18,"name":"tail3","parent":"tail2","transform":{"x":15.59,"y":-0.01,"skX":12.0898,"skY":12.0875,"scX":1.0078,"scY":0.9969}},{"inheritScale":false,"length":13,"name":"tail4","parent":"tail3","transform":{"x":18.23,"y":-0.01,"skX":11.9206,"skY":11.924,"scX":1.0137,"scY":0.9956}},{"inheritScale":false,"length":14,"name":"tail5","parent":"tail4","transform":{"x":13.12,"y":-0.03,"skX":15.3695,"skY":15.3699,"scX":1.0114,"scY":0.9951}},{"inheritScale":false,"length":19,"name":"tail6","parent":"tail5","transform":{"x":14.65,"y":-0.02,"skX":27.4879,"skY":27.4813,"scX":0.9931,"scY":0.9974}},{"inheritScale":false,"length":17,"name":"tail7","parent":"tail6","transform":{"x":19.5,"y":0.02,"skX":22.363,"skY":22.3635,"scX":0.9991,"scY":0.9988}},{"inheritScale":false,"length":22,"name":"tail8","parent":"tail7","transform":{"x":17.52,"skX":24.9254,"skY":24.8834,"scX":0.9789,"scY":0.9955}},{"inheritScale":false,"length":32,"name":"tail9","parent":"tail8","transform":{"x":22.55,"y":0.02,"skX":11.6352,"skY":11.6109,"scX":0.9945,"scY":0.9954}},{"inheritScale":false,"name":"weapon","parent":"tail9","transform":{"x":32.01,"y":0.02,"skX":26.257,"skY":26.2593,"scX":0.9948,"scY":0.9978}}],"slot":[{"name":"calf_l_f","parent":"calf_l_f"},{"name":"calf_l_m","parent":"calf_l_m"},{"name":"calf_l_b","parent":"calf_l_b"},{"name":"forearm_l","parent":"forearm_l"},{"name":"upperarm_l","parent":"upperarm_l"},{"name":"hand_l","parent":"hand_l"},{"name":"hand_l_1","parent":"hand_l_1"},{"name":"thigh_l_f","parent":"thigh_l_f"},{"name":"thigh_l_m","parent":"thigh_l_m"},{"name":"thigh_l_b","parent":"thigh_l_b"},{"name":"tail9","parent":"tail9"},{"name":"tail8","parent":"tail8"},{"name":"tail7","parent":"tail7"},{"name":"tail6","parent":"tail6"},{"name":"tail5","parent":"tail5"},{"name":"tail4","parent":"tail4"},{"name":"tail3","parent":"tail3"},{"name":"tail2","parent":"tail2"},{"name":"tail1","parent":"tail1"},{"name":"tail","parent":"tail"},{"name":"pelvis","parent":"pelvis"},{"name":"chest","parent":"chest"},{"name":"neck","parent":"neck"},{"name":"head","parent":"head"},{"name":"weapon","parent":"weapon"},{"name":"thigh_r_b","parent":"thigh_r_b"},{"name":"thigh_r_m","parent":"thigh_r_m"},{"name":"thigh_r_f","parent":"thigh_r_f"},{"name":"upperarm_r","parent":"upperarm_r"},{"name":"forearm_r","parent":"forearm_r"},{"name":"hand_r_1","parent":"hand_r_1"},{"name":"hand_r","parent":"hand_r"},{"name":"calf_r_b","parent":"calf_r_b"},{"name":"calf_r_m","parent":"calf_r_m"},{"name":"calf_r_f","parent":"calf_r_f"}],"skin":[{"name":"","slot":[{"name":"pelvis","display":[{"name":"mecha_2903b_folder/pelvis","transform":{"x":-4.4,"y":0.8,"skX":-74.11,"skY":-74.11}}]},{"name":"forearm_l","display":[{"name":"mecha_2903b_folder/forearm_l","transform":{"x":24.45,"y":-3.15,"skX":10.47,"skY":10.47}}]},{"name":"calf_r_m","display":[{"name":"mecha_2903b_folder/calf_r_m","transform":{"x":26.95,"y":5.05}}]},{"name":"tail3","display":[{"name":"mecha_2903b_folder/tail3","transform":{"x":9.5,"y":-2.55,"skX":-0.05,"skY":-0.05}}]},{"name":"forearm_r","display":[{"name":"mecha_2903b_folder/forearm_r","transform":{"x":24.4,"y":0.4,"skX":16.38,"skY":16.38}}]},{"name":"tail7","display":[{"name":"mecha_2903b_folder/textures/tail7_1","transform":{"x":9,"y":-2.4,"skX":0.79,"skY":0.79}}]},{"name":"thigh_r_b","display":[{"name":"mecha_2903b_folder/textures/thigh_r_b_1","transform":{"x":14.05,"y":2.1,"skX":0.47,"skY":0.47}}]},{"name":"thigh_l_m","display":[{"name":"mecha_2903b_folder/thigh_l_m","transform":{"x":26.5,"y":-2.6,"skX":-0.26,"skY":-0.26}}]},{"name":"chest","display":[{"name":"mecha_2903b_folder/chest","transform":{"x":30,"y":-19.1,"skX":-27.66,"skY":-27.66}}]},{"name":"calf_l_f","display":[{"name":"mecha_2903b_folder/textures/calf_l_f_1","transform":{"x":20,"y":0.05}}]},{"name":"calf_r_f","display":[{"name":"mecha_2903b_folder/calf_r_f","transform":{"x":25.5,"y":0.95}}]},{"name":"tail2","display":[{"name":"mecha_2903b_folder/tail2","transform":{"x":10.5,"y":-2.05,"skX":0.01,"skY":0.01}}]},{"name":"calf_l_b","display":[{"name":"mecha_2903b_folder/calf_l_b","transform":{"x":18,"y":4.55}}]},{"name":"hand_r_1","display":[{"name":"mecha_2903b_folder/textures/hand_r_1_0","transform":{"x":15,"y":3.45}}]},{"name":"tail6","display":[{"name":"mecha_2903b_folder/textures/tail6_1","transform":{"x":10.55,"y":-1.95,"skX":0.63,"skY":0.63}}]},{"name":"upperarm_l","display":[{"name":"mecha_2903b_folder/textures/upperarm_l_2","transform":{"x":2.4,"y":-1.05,"skX":-2.56,"skY":-2.56}}]},{"name":"thigh_r_m","display":[{"name":"mecha_2903b_folder/textures/thigh_r_m_0","transform":{"x":19,"y":-1.35,"skX":0.35,"skY":0.35}}]},{"name":"thigh_l_b","display":[{"name":"mecha_2903b_folder/textures/thigh_l_b_1","transform":{"x":15,"y":-0.45,"skX":-0.06,"skY":-0.06}}]},{"name":"neck","display":[{"name":"mecha_2903b_folder/neck","transform":{"x":-6.05,"y":-16.85,"skX":10.26,"skY":10.26}}]},{"name":"hand_l","display":[{"name":"mecha_2903b_folder/hand_l","transform":{"x":21.5,"y":3.5}}]},{"name":"tail1","display":[{"name":"mecha_2903b_folder/tail1","transform":{"x":10.45,"y":-1.5,"skX":0.26,"skY":0.26}}]},{"name":"calf_l_m","display":[{"name":"mecha_2903b_folder/calf_l_m","transform":{"x":17,"y":0.95}}]},{"name":"tail5","display":[{"name":"mecha_2903b_folder/textures/tail5_1","transform":{"x":5.45,"y":-2.45,"skX":0.01,"skY":0.01}}]},{"name":"thigh_r_f","display":[{"name":"mecha_2903b_folder/textures/thigh_r_f_2","transform":{"x":17.55,"y":-1}}]},{"name":"tail9","display":[{"name":"mecha_2903b_folder/textures/tail9_1","transform":{"x":14.25,"y":0.25,"skX":13.2,"skY":13.2}}]},{"name":"head","display":[{"name":"mecha_2903b_folder/head","transform":{"x":16,"y":-5}}]},{"name":"hand_l_1","display":[{"name":"mecha_2903b_folder/textures/hand_l_1_0","transform":{"x":15.1,"y":1}}]},{"name":"tail","display":[{"name":"mecha_2903b_folder/tail","transform":{"x":7.5,"y":-0.5}}]},{"name":"calf_r_b","display":[{"name":"mecha_2903b_folder/calf_r_b","transform":{"x":29.5,"y":5}}]},{"name":"tail4","display":[{"name":"mecha_2903b_folder/tail4","transform":{"x":10,"y":-2,"skX":0.07,"skY":0.07}}]},{"name":"hand_r","display":[{"name":"mecha_2903b_folder/textures/hand_r_0","transform":{"x":21.55,"y":3.05}}]},{"name":"upperarm_r","display":[{"name":"mecha_2903b_folder/textures/upperarm_r_0","transform":{"x":5.5,"y":-0.4,"skX":0.7,"skY":0.7}}]},{"name":"tail8","display":[{"name":"mecha_2903b_folder/textures/tail8_1","transform":{"x":8.45,"y":-3.3,"skX":1.2,"skY":1.2}}]},{"name":"weapon","display":[{"name":"mecha_2903b_folder/weapon","transform":{"x":17.5,"y":-6}}]},{"name":"thigh_l_f","display":[{"name":"mecha_2903b_folder/textures/thigh_l_f_0","transform":{"x":27.5,"y":-1.15,"skX":-0.07,"skY":-0.07}}]}]}],"animation":[{"duration":0,"playTimes":0,"fadeInTime":0.2,"name":"idle"}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":25,"name":"mecha_2903c","aabb":{"x":-177.98,"y":-209.1,"width":370.36,"height":230.81},"bone":[{"inheritScale":false,"length":11,"name":"pelvis","transform":{"x":-41.2,"y":-49.45,"skX":76.0851,"skY":76.1437,"scX":0.9995,"scY":0.9978}},{"inheritScale":false,"length":33,"name":"chest","parent":"pelvis","transform":{"x":4.3,"y":-15.06,"skX":-49.0173,"skY":-48.9448,"scX":0.9987,"scY":0.9996}},{"inheritScale":false,"length":36,"name":"thigh_l_b","parent":"pelvis","transform":{"x":9.9,"y":0.83,"skX":-177.595,"skY":-177.5957,"scX":0.9938,"scY":0.998}},{"inheritScale":false,"length":31,"name":"thigh_r_b","parent":"pelvis","transform":{"x":20.57,"y":14.15,"skX":155.0643,"skY":155.0181,"scX":0.9466,"scY":0.9952}},{"inheritScale":false,"length":13,"name":"tail","parent":"chest","transform":{"x":-32.21,"y":16.45,"skX":152.8011,"skY":152.8011,"scX":0.999}},{"inheritScale":false,"length":33,"name":"thigh_r_m","parent":"chest","transform":{"x":24.87,"y":21.17,"skX":-134.049,"skY":-134.0888,"scX":0.9415,"scY":0.9973}},{"inheritScale":false,"name":"thigh_r_f","parent":"chest","transform":{"x":49.12,"y":9.74,"skX":-87.6376,"skY":-87.637,"scX":0.9261,"scY":0.9958}},{"inheritScale":false,"name":"calf_r_b","parent":"thigh_r_b","transform":{"x":31.66,"y":0.03,"skX":-112.1024,"skY":-112.1024,"scX":1.0071,"scY":0.9958}},{"inheritScale":false,"name":"calf_l_b","parent":"thigh_l_b","transform":{"x":36.26,"y":-0.01,"skX":-151.5258,"skY":-151.5258,"scX":1.0056,"scY":0.9973}},{"inheritScale":false,"length":52,"name":"thigh_l_m","parent":"chest","transform":{"x":26.31,"y":11.26,"skX":-103.9319,"skY":-103.9223,"scX":0.9794,"scY":0.9978}},{"inheritScale":false,"length":17,"name":"neck","parent":"chest","transform":{"x":62.91,"y":-36.34,"skX":-30.6973,"skY":-30.7124,"scX":0.9984,"scY":0.9992}},{"inheritScale":false,"name":"calf_r_f","parent":"chest","transform":{"x":50.6,"y":-21.26,"skX":46.531,"skY":46.5318,"scX":1.0002,"scY":0.9974}},{"inheritScale":false,"length":54,"name":"thigh_l_f","parent":"chest","transform":{"x":50.49,"y":-1.08,"skX":-71.7516,"skY":-71.7533,"scX":1.0058,"scY":0.9951}},{"inheritScale":false,"length":14,"name":"upperarm_l","parent":"neck","transform":{"x":23,"y":-8.68,"skX":63.7558,"skY":63.7438,"scX":0.9979,"scY":0.9956}},{"inheritScale":false,"name":"calf_r_m","parent":"thigh_r_m","transform":{"x":33.64,"y":-0.03,"skX":-154.1031,"skY":-154.1031,"scX":1.0062,"scY":0.9984}},{"inheritScale":false,"length":25,"name":"upperarm_r","parent":"neck","transform":{"x":12.28,"y":5.8,"skX":89.6493,"skY":89.4553,"scX":0.8704,"scY":0.9994}},{"inheritScale":false,"name":"calf_l_f","parent":"thigh_l_f","transform":{"x":54.21,"y":0.02,"skX":92.9449,"skY":92.9425,"scX":1.0255,"scY":0.9951}},{"inheritScale":false,"name":"calf_l_m","parent":"thigh_l_m","transform":{"x":52.2,"y":-0.04,"skX":153.9595,"skY":153.9612,"scX":1.0523,"scY":0.9979}},{"inheritScale":false,"length":14,"name":"tail1","parent":"tail","transform":{"x":13.12,"skX":4.4887,"skY":4.489,"scX":0.9995,"scY":0.9992}},{"inheritScale":false,"name":"head","parent":"neck","transform":{"x":16.17,"y":2.98,"skX":27.3048,"skY":27.3048,"scX":0.9984,"scY":0.9963}},{"inheritScale":false,"length":15,"name":"tail2","parent":"tail1","transform":{"x":14.68,"y":-0.02,"skX":2.5013,"skY":2.5,"scX":1.0041,"scY":0.9988}},{"inheritScale":false,"length":52,"name":"forearm_r","parent":"upperarm_r","transform":{"x":25.98,"y":0.01,"skX":-83.6035,"skY":-82.0181,"scX":1.0451,"scY":1.0012}},{"inheritScale":false,"length":52,"name":"forearm_l","parent":"upperarm_l","transform":{"x":14.81,"y":0.02,"skX":-57.0604,"skY":-56.8154,"scX":1.0093,"scY":0.9981}},{"inheritScale":false,"name":"hand_r","parent":"forearm_r","transform":{"x":52.25,"y":15.11,"skX":11.5959,"skY":11.5959,"scX":1.0136,"scY":0.9974}},{"inheritScale":false,"name":"hand_l_1","parent":"forearm_l","transform":{"x":50.61,"y":-10.36,"skX":0.3373,"skY":0.3373,"scX":0.9538,"scY":0.9994}},{"inheritScale":false,"name":"hand_r_1","parent":"forearm_r","transform":{"x":52.55,"y":-15.2,"skX":-3.4237,"skY":-3.4229,"scX":1.0252}},{"inheritScale":false,"name":"hand_l","parent":"forearm_l","transform":{"x":54.96,"y":10.3,"skX":14.1078,"skY":14.1086,"scX":0.9875,"scY":0.9972}},{"inheritScale":false,"length":18,"name":"tail3","parent":"tail2","transform":{"x":15.59,"y":-0.01,"skX":12.0898,"skY":12.0875,"scX":1.0078,"scY":0.9969}},{"inheritScale":false,"length":13,"name":"tail4","parent":"tail3","transform":{"x":18.23,"y":-0.01,"skX":11.9206,"skY":11.924,"scX":1.0137,"scY":0.9956}},{"inheritScale":false,"length":14,"name":"tail5","parent":"tail4","transform":{"x":13.12,"y":-0.03,"skX":15.3695,"skY":15.3699,"scX":1.0114,"scY":0.9951}},{"inheritScale":false,"length":19,"name":"tail6","parent":"tail5","transform":{"x":14.65,"y":-0.02,"skX":27.4879,"skY":27.4813,"scX":0.9931,"scY":0.9974}},{"inheritScale":false,"length":17,"name":"tail7","parent":"tail6","transform":{"x":19.5,"y":0.02,"skX":22.363,"skY":22.3635,"scX":0.9991,"scY":0.9988}},{"inheritScale":false,"length":22,"name":"tail8","parent":"tail7","transform":{"x":17.52,"skX":24.9254,"skY":24.8834,"scX":0.9789,"scY":0.9955}},{"inheritScale":false,"length":33,"name":"tail9","parent":"tail8","transform":{"x":22.55,"y":0.02,"skX":11.7321,"skY":11.7086,"scX":0.9945,"scY":0.9954}},{"inheritScale":false,"name":"weapon","parent":"tail9","transform":{"x":33.41,"y":0.02,"skX":26.1593,"skY":26.1616,"scX":0.9948,"scY":0.9978}}],"slot":[{"name":"calf_l_f","parent":"calf_l_f"},{"name":"calf_l_m","parent":"calf_l_m"},{"name":"calf_l_b","parent":"calf_l_b"},{"name":"forearm_l","parent":"forearm_l"},{"name":"upperarm_l","parent":"upperarm_l"},{"name":"hand_l","parent":"hand_l"},{"name":"hand_l_1","parent":"hand_l_1"},{"name":"thigh_l_f","parent":"thigh_l_f"},{"name":"thigh_l_m","parent":"thigh_l_m"},{"name":"thigh_l_b","parent":"thigh_l_b"},{"name":"tail9","parent":"tail9"},{"name":"tail8","parent":"tail8"},{"name":"tail7","parent":"tail7"},{"name":"tail6","parent":"tail6"},{"name":"tail5","parent":"tail5"},{"name":"tail4","parent":"tail4"},{"name":"tail3","parent":"tail3"},{"name":"tail2","parent":"tail2"},{"name":"tail1","parent":"tail1"},{"name":"tail","parent":"tail"},{"name":"pelvis","parent":"pelvis"},{"name":"chest","parent":"chest"},{"name":"neck","parent":"neck"},{"name":"head","parent":"head"},{"name":"weapon","parent":"weapon"},{"name":"thigh_r_b","parent":"thigh_r_b"},{"name":"thigh_r_m","parent":"thigh_r_m"},{"name":"thigh_r_f","parent":"thigh_r_f"},{"name":"upperarm_r","parent":"upperarm_r"},{"name":"forearm_r","parent":"forearm_r"},{"name":"hand_r_1","parent":"hand_r_1"},{"name":"hand_r","parent":"hand_r"},{"name":"calf_r_b","parent":"calf_r_b"},{"name":"calf_r_m","parent":"calf_r_m"},{"name":"calf_r_f","parent":"calf_r_f"}],"skin":[{"name":"","slot":[{"name":"tail2","display":[{"name":"mecha_2903c_folder/tail2","transform":{"x":10.5,"y":-2.05,"skX":0.01,"skY":0.01}}]},{"name":"calf_r_m","display":[{"name":"mecha_2903c_folder/calf_r_m","transform":{"x":19,"y":3.55}}]},{"name":"hand_r_1","display":[{"name":"mecha_2903c_folder/textures/hand_r_1_0","transform":{"x":9.5,"y":1.5}}]},{"name":"tail6","display":[{"name":"mecha_2903c_folder/textures/tail6_1","transform":{"x":13.1,"y":-9.85,"skX":0.63,"skY":0.63}}]},{"name":"thigh_r_m","display":[{"name":"mecha_2903c_folder/textures/thigh_r_m_0","transform":{"x":19,"y":-1.35,"skX":0.35,"skY":0.35}}]},{"name":"thigh_l_b","display":[{"name":"mecha_2903c_folder/textures/thigh_l_b_1","transform":{"x":15,"y":-0.45,"skX":-0.06,"skY":-0.06}}]},{"name":"neck","display":[{"name":"mecha_2903c_folder/neck","transform":{"x":-5.3,"y":-23.85,"skX":10.26,"skY":10.26}}]},{"name":"hand_l","display":[{"name":"mecha_2903c_folder/hand_l","transform":{"x":25,"y":2}}]},{"name":"tail1","display":[{"name":"mecha_2903c_folder/tail1","transform":{"x":10.45,"y":-1.5,"skX":0.26,"skY":0.26}}]},{"name":"calf_l_m","display":[{"name":"mecha_2903c_folder/calf_l_m","transform":{"x":12.55,"y":2}}]},{"name":"hand_r","display":[{"name":"mecha_2903c_folder/textures/hand_r_0","transform":{"x":25.6,"y":-0.05}}]},{"name":"tail5","display":[{"name":"mecha_2903c_folder/textures/tail5_1","transform":{"x":7.45,"y":-9.5,"skX":0.01,"skY":0.01}}]},{"name":"thigh_r_f","display":[{"name":"mecha_2903c_folder/textures/thigh_r_f_2","transform":{"x":17.55,"y":-1}}]},{"name":"tail9","display":[{"name":"mecha_2903c_folder/textures/tail9_1","transform":{"x":14.25,"y":0.25,"skX":13.1,"skY":13.1}}]},{"name":"calf_r_f","display":[{"name":"mecha_2903c_folder/calf_r_f","transform":{"x":17.5,"y":3.5}}]},{"name":"head","display":[{"name":"mecha_2903c_folder/head","transform":{"x":16,"y":-5}}]},{"name":"hand_l_1","display":[{"name":"mecha_2903c_folder/textures/hand_l_1_0","transform":{"x":10,"y":-0.45}}]},{"name":"tail","display":[{"name":"mecha_2903c_folder/tail","transform":{"x":7.5,"y":-0.5}}]},{"name":"calf_l_b","display":[{"name":"mecha_2903c_folder/calf_l_b","transform":{"x":12,"y":3}}]},{"name":"calf_r_b","display":[{"name":"mecha_2903c_folder/calf_r_b","transform":{"x":20.5,"y":3.5}}]},{"name":"tail4","display":[{"name":"mecha_2903c_folder/tail4","transform":{"x":10.05,"y":-5.5,"skX":0.07,"skY":0.07}}]},{"name":"upperarm_r","display":[{"name":"mecha_2903c_folder/textures/upperarm_r_0","transform":{"x":5.5,"y":-0.4,"skX":0.7,"skY":0.7}}]},{"name":"tail8","display":[{"name":"mecha_2903c_folder/textures/tail8_1","transform":{"x":12.8,"y":-13.8,"skX":1.2,"skY":1.2}}]},{"name":"weapon","display":[{"name":"mecha_2903c_folder/weapon","transform":{"x":19.45,"y":-7.5}}]},{"name":"thigh_l_f","display":[{"name":"mecha_2903c_folder/textures/thigh_l_f_0","transform":{"x":27.5,"y":-1.15,"skX":-0.07,"skY":-0.07}}]},{"name":"pelvis","display":[{"name":"mecha_2903c_folder/pelvis","transform":{"x":-4.4,"y":0.8,"skX":-74.11,"skY":-74.11}}]},{"name":"forearm_l","display":[{"name":"mecha_2903c_folder/forearm_l","transform":{"x":23.8,"y":-2.75,"skX":10.47,"skY":10.47}}]},{"name":"calf_l_f","display":[{"name":"mecha_2903c_folder/textures/calf_l_f_1","transform":{"x":12.5,"y":1}}]},{"name":"tail3","display":[{"name":"mecha_2903c_folder/tail3","transform":{"x":9.5,"y":-2.55,"skX":-0.05,"skY":-0.05}}]},{"name":"forearm_r","display":[{"name":"mecha_2903c_folder/forearm_r","transform":{"x":24.4,"y":0.4,"skX":16.38,"skY":16.38}}]},{"name":"tail7","display":[{"name":"mecha_2903c_folder/textures/tail7_1","transform":{"x":11.65,"y":-13.4,"skX":0.79,"skY":0.79}}]},{"name":"thigh_r_b","display":[{"name":"mecha_2903c_folder/textures/thigh_r_b_1","transform":{"x":14.05,"y":2.1,"skX":0.47,"skY":0.47}}]},{"name":"thigh_l_m","display":[{"name":"mecha_2903c_folder/thigh_l_m","transform":{"x":26.5,"y":-2.6,"skX":-0.26,"skY":-0.26}}]},{"name":"chest","display":[{"name":"mecha_2903c_folder/chest","transform":{"x":21.1,"y":-27.45,"skX":-27.66,"skY":-27.66}}]},{"name":"upperarm_l","display":[{"name":"mecha_2903c_folder/textures/upperarm_l_2","transform":{"x":2.4,"y":-1.05,"skX":-2.56,"skY":-2.56}}]}]}],"animation":[{"duration":0,"playTimes":0,"fadeInTime":0.2,"name":"idle"}],"defaultActions":[{"gotoAndPlay":"idle"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_ske.json.meta b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_ske.json.meta new file mode 100644 index 00000000..d28e7285 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "3e3c258d-e1f9-4354-ae20-3fb1f011f6a1", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.json b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.json new file mode 100644 index 00000000..61f526a2 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.json @@ -0,0 +1 @@ +{"SubTexture":[{"width":74,"y":608,"height":28,"name":"mecha_2903_folder/calf_l_m","x":1},{"width":82,"y":575,"height":28,"name":"mecha_2903_folder/textures/calf_l_f_1","x":195},{"width":76,"y":582,"height":25,"name":"mecha_2903_folder/calf_l_b","x":279},{"width":75,"y":453,"height":41,"name":"mecha_2903_folder/forearm_l","x":412},{"width":31,"y":685,"height":32,"name":"mecha_2903_folder/textures/upperarm_l_2","x":292},{"width":57,"y":713,"height":25,"name":"mecha_2903_folder/hand_l","x":1},{"width":38,"y":631,"height":14,"name":"mecha_2903_folder/textures/hand_l_1_0","x":465},{"width":59,"y":679,"height":18,"name":"mecha_2903_folder/textures/thigh_l_f_0","x":425},{"width":55,"y":479,"height":15,"name":"mecha_2903_folder/thigh_l_m","x":353},{"width":52,"y":327,"height":17,"name":"mecha_2903_folder/textures/thigh_l_b_1","x":331},{"width":52,"y":641,"height":28,"name":"mecha_2903_folder/textures/tail9_1","x":76},{"width":27,"y":805,"height":25,"name":"mecha_2903_folder/textures/tail8_1","x":71},{"width":28,"y":805,"height":23,"name":"mecha_2903_folder/textures/tail7_1","x":129},{"width":28,"y":847,"height":22,"name":"mecha_2903_folder/textures/tail6_1","x":1},{"width":33,"y":805,"height":21,"name":"mecha_2903_folder/textures/tail5_1","x":36},{"width":34,"y":453,"height":22,"name":"mecha_2903_folder/tail4","x":255},{"width":31,"y":781,"height":23,"name":"mecha_2903_folder/tail3","x":159},{"width":31,"y":734,"height":26,"name":"mecha_2903_folder/tail2","x":204},{"width":35,"y":703,"height":29,"name":"mecha_2903_folder/tail1","x":206},{"width":33,"y":630,"height":33,"name":"mecha_2903_folder/tail","x":355},{"width":62,"y":392,"height":56,"name":"mecha_2903_folder/pelvis","x":408},{"width":103,"y":1,"height":78,"name":"mecha_2903_folder/chest","x":402},{"width":60,"y":287,"height":69,"name":"mecha_2903_folder/neck","x":269},{"width":48,"y":301,"height":38,"name":"mecha_2903_folder/head","x":78},{"width":118,"y":218,"height":67,"name":"mecha_2903_folder/weapon","x":269},{"width":44,"y":699,"height":24,"name":"mecha_2903_folder/textures/thigh_r_b_1","x":415},{"width":38,"y":828,"height":17,"name":"mecha_2903_folder/textures/thigh_r_m_0","x":1},{"width":39,"y":765,"height":18,"name":"mecha_2903_folder/textures/thigh_r_f_2","x":34},{"width":39,"y":662,"height":29,"name":"mecha_2903_folder/textures/upperarm_r_0","x":130},{"width":75,"y":346,"height":51,"name":"mecha_2903_folder/forearm_r","x":331},{"width":38,"y":728,"height":17,"name":"mecha_2903_folder/textures/hand_r_1_0","x":455},{"width":59,"y":387,"height":26,"name":"mecha_2903_folder/textures/hand_r_0","x":116},{"width":97,"y":556,"height":24,"name":"mecha_2903_folder/calf_r_b","x":329},{"width":96,"y":496,"height":28,"name":"mecha_2903_folder/calf_r_m","x":141},{"width":95,"y":520,"height":28,"name":"mecha_2903_folder/calf_r_f","x":1},{"width":94,"y":580,"height":26,"name":"mecha_2903d_folder/textures/calf_l_f_1","x":1},{"width":83,"y":509,"height":32,"name":"mecha_2903d_folder/calf_l_m","x":239},{"width":88,"y":526,"height":30,"name":"mecha_2903d_folder/calf_l_b","x":98},{"width":82,"y":399,"height":40,"name":"mecha_2903d_folder/forearm_l","x":304},{"width":31,"y":731,"height":32,"name":"mecha_2903d_folder/textures/upperarm_l_2","x":60},{"width":108,"y":351,"height":34,"name":"mecha_2903d_folder/hand_l","x":78},{"width":76,"y":611,"height":17,"name":"mecha_2903d_folder/textures/hand_l_1_0","x":314},{"width":59,"y":665,"height":18,"name":"mecha_2903d_folder/textures/thigh_l_f_0","x":308},{"width":55,"y":719,"height":15,"name":"mecha_2903d_folder/thigh_l_m","x":243},{"width":52,"y":728,"height":17,"name":"mecha_2903d_folder/textures/thigh_l_b_1","x":325},{"width":52,"y":632,"height":28,"name":"mecha_2903d_folder/textures/tail9_1","x":154},{"width":43,"y":119,"height":79,"name":"mecha_2903d_folder/textures/tail8_1","x":115},{"width":36,"y":272,"height":68,"name":"mecha_2903d_folder/textures/tail7_1","x":465},{"width":34,"y":392,"height":56,"name":"mecha_2903d_folder/textures/tail6_1","x":472},{"width":36,"y":638,"height":46,"name":"mecha_2903d_folder/textures/tail5_1","x":1},{"width":34,"y":453,"height":22,"name":"mecha_2903d_folder/tail4","x":65},{"width":38,"y":677,"height":27,"name":"mecha_2903d_folder/tail3","x":252},{"width":37,"y":632,"height":33,"name":"mecha_2903d_folder/tail2","x":208},{"width":41,"y":586,"height":38,"name":"mecha_2903d_folder/tail1","x":434},{"width":41,"y":526,"height":45,"name":"mecha_2903d_folder/tail","x":195},{"width":169,"y":1,"height":116,"name":"mecha_2903d_folder/textures/tail10_3","x":1},{"width":74,"y":272,"height":72,"name":"mecha_2903d_folder/pelvis","x":389},{"width":116,"y":114,"height":102,"name":"mecha_2903d_folder/chest","x":287},{"width":113,"y":1,"height":112,"name":"mecha_2903d_folder/neck","x":172},{"width":48,"y":496,"height":38,"name":"mecha_2903d_folder/head","x":438},{"width":44,"y":699,"height":24,"name":"mecha_2903d_folder/textures/thigh_r_b_1","x":461},{"width":38,"y":725,"height":17,"name":"mecha_2903d_folder/textures/thigh_r_m_0","x":415},{"width":39,"y":785,"height":18,"name":"mecha_2903d_folder/textures/thigh_r_f_2","x":1},{"width":39,"y":693,"height":29,"name":"mecha_2903d_folder/textures/upperarm_r_0","x":130},{"width":87,"y":161,"height":53,"name":"mecha_2903d_folder/forearm_r","x":405},{"width":75,"y":616,"height":23,"name":"mecha_2903d_folder/textures/hand_r_1_0","x":77},{"width":113,"y":218,"height":52,"name":"mecha_2903d_folder/textures/hand_r_0","x":389},{"width":115,"y":450,"height":27,"name":"mecha_2903d_folder/calf_r_b","x":295},{"width":114,"y":391,"height":31,"name":"mecha_2903d_folder/calf_r_m","x":188},{"width":111,"y":420,"height":31,"name":"mecha_2903d_folder/calf_r_f","x":1},{"width":82,"y":556,"height":28,"name":"mecha_2903b_folder/textures/calf_l_f_1","x":428},{"width":74,"y":354,"height":28,"name":"mecha_2903b_folder/calf_l_m","x":1},{"width":76,"y":605,"height":25,"name":"mecha_2903b_folder/calf_l_b","x":175},{"width":75,"y":453,"height":41,"name":"mecha_2903b_folder/forearm_l","x":178},{"width":31,"y":740,"height":32,"name":"mecha_2903b_folder/textures/upperarm_l_2","x":1},{"width":57,"y":686,"height":25,"name":"mecha_2903b_folder/hand_l","x":1},{"width":38,"y":753,"height":14,"name":"mecha_2903b_folder/textures/hand_l_1_0","x":237},{"width":59,"y":637,"height":18,"name":"mecha_2903b_folder/textures/thigh_l_f_0","x":247},{"width":55,"y":736,"height":15,"name":"mecha_2903b_folder/thigh_l_m","x":243},{"width":52,"y":336,"height":17,"name":"mecha_2903b_folder/textures/thigh_l_b_1","x":209},{"width":52,"y":701,"height":28,"name":"mecha_2903b_folder/textures/tail9_1","x":76},{"width":27,"y":805,"height":25,"name":"mecha_2903b_folder/textures/tail8_1","x":100},{"width":28,"y":828,"height":23,"name":"mecha_2903b_folder/textures/tail7_1","x":41},{"width":27,"y":744,"height":22,"name":"mecha_2903b_folder/textures/tail6_1","x":419},{"width":33,"y":805,"height":21,"name":"mecha_2903b_folder/textures/tail5_1","x":1},{"width":34,"y":756,"height":22,"name":"mecha_2903b_folder/tail4","x":126},{"width":31,"y":780,"height":23,"name":"mecha_2903b_folder/tail3","x":126},{"width":31,"y":697,"height":26,"name":"mecha_2903b_folder/tail2","x":171},{"width":35,"y":725,"height":29,"name":"mecha_2903b_folder/tail1","x":167},{"width":33,"y":662,"height":33,"name":"mecha_2903b_folder/tail","x":171},{"width":62,"y":420,"height":56,"name":"mecha_2903b_folder/pelvis","x":114},{"width":103,"y":81,"height":78,"name":"mecha_2903b_folder/chest","x":405},{"width":112,"y":119,"height":97,"name":"mecha_2903b_folder/neck","x":1},{"width":48,"y":296,"height":38,"name":"mecha_2903b_folder/head","x":209},{"width":133,"y":218,"height":76,"name":"mecha_2903b_folder/weapon","x":134},{"width":44,"y":683,"height":24,"name":"mecha_2903b_folder/textures/thigh_r_b_1","x":369},{"width":38,"y":747,"height":17,"name":"mecha_2903b_folder/textures/thigh_r_m_0","x":300},{"width":39,"y":765,"height":18,"name":"mecha_2903b_folder/textures/thigh_r_f_2","x":75},{"width":39,"y":630,"height":29,"name":"mecha_2903b_folder/textures/upperarm_r_0","x":314},{"width":75,"y":301,"height":51,"name":"mecha_2903b_folder/forearm_r","x":1},{"width":38,"y":763,"height":17,"name":"mecha_2903b_folder/textures/hand_r_1_0","x":379},{"width":59,"y":609,"height":26,"name":"mecha_2903b_folder/textures/hand_r_0","x":253},{"width":97,"y":530,"height":24,"name":"mecha_2903b_folder/calf_r_b","x":329},{"width":96,"y":479,"height":28,"name":"mecha_2903b_folder/calf_r_m","x":255},{"width":95,"y":550,"height":28,"name":"mecha_2903b_folder/calf_r_f","x":1},{"width":95,"y":558,"height":26,"name":"mecha_2903c_folder/textures/calf_l_f_1","x":98},{"width":83,"y":496,"height":32,"name":"mecha_2903c_folder/calf_l_m","x":353},{"width":88,"y":543,"height":30,"name":"mecha_2903c_folder/calf_l_b","x":239},{"width":74,"y":478,"height":40,"name":"mecha_2903c_folder/forearm_l","x":65},{"width":31,"y":731,"height":32,"name":"mecha_2903c_folder/textures/upperarm_l_2","x":93},{"width":76,"y":586,"height":28,"name":"mecha_2903c_folder/hand_l","x":97},{"width":76,"y":536,"height":17,"name":"mecha_2903c_folder/textures/hand_l_1_0","x":428},{"width":59,"y":657,"height":18,"name":"mecha_2903c_folder/textures/thigh_l_f_0","x":247},{"width":55,"y":200,"height":15,"name":"mecha_2903c_folder/thigh_l_m","x":115},{"width":52,"y":709,"height":17,"name":"mecha_2903c_folder/textures/thigh_l_b_1","x":361},{"width":52,"y":671,"height":28,"name":"mecha_2903c_folder/textures/tail9_1","x":76},{"width":35,"y":638,"height":46,"name":"mecha_2903c_folder/textures/tail8_1","x":39},{"width":33,"y":586,"height":43,"name":"mecha_2903c_folder/textures/tail7_1","x":477},{"width":32,"y":626,"height":38,"name":"mecha_2903c_folder/textures/tail6_1","x":431},{"width":37,"y":611,"height":35,"name":"mecha_2903c_folder/textures/tail5_1","x":392},{"width":34,"y":685,"height":29,"name":"mecha_2903c_folder/tail4","x":325},{"width":31,"y":756,"height":23,"name":"mecha_2903c_folder/tail3","x":162},{"width":31,"y":762,"height":26,"name":"mecha_2903c_folder/tail2","x":204},{"width":35,"y":725,"height":29,"name":"mecha_2903c_folder/tail1","x":130},{"width":33,"y":648,"height":33,"name":"mecha_2903c_folder/tail","x":390},{"width":62,"y":453,"height":56,"name":"mecha_2903c_folder/pelvis","x":1},{"width":111,"y":115,"height":101,"name":"mecha_2903c_folder/chest","x":172},{"width":113,"y":1,"height":111,"name":"mecha_2903c_folder/neck","x":287},{"width":48,"y":287,"height":38,"name":"mecha_2903c_folder/head","x":331},{"width":131,"y":218,"height":81,"name":"mecha_2903c_folder/weapon","x":1},{"width":44,"y":677,"height":24,"name":"mecha_2903c_folder/textures/thigh_r_b_1","x":206},{"width":38,"y":744,"height":17,"name":"mecha_2903c_folder/textures/thigh_r_m_0","x":379},{"width":39,"y":785,"height":18,"name":"mecha_2903c_folder/textures/thigh_r_f_2","x":75},{"width":39,"y":648,"height":29,"name":"mecha_2903c_folder/textures/upperarm_r_0","x":465},{"width":73,"y":296,"height":53,"name":"mecha_2903c_folder/forearm_r","x":134},{"width":75,"y":586,"height":23,"name":"mecha_2903c_folder/textures/hand_r_1_0","x":357},{"width":79,"y":346,"height":44,"name":"mecha_2903c_folder/textures/hand_r_0","x":408},{"width":115,"y":424,"height":27,"name":"mecha_2903c_folder/calf_r_b","x":178},{"width":114,"y":358,"height":31,"name":"mecha_2903c_folder/calf_r_m","x":188},{"width":113,"y":387,"height":31,"name":"mecha_2903c_folder/calf_r_f","x":1}],"width":512,"height":1024,"name":"mecha_2903","imagePath":"mecha_2903_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.json.meta b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.json.meta new file mode 100644 index 00000000..a7e24682 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "2212b85f-13f5-4d21-bcda-7c17d7df4ab8", + "atlasJson": "{\"SubTexture\":[{\"width\":74,\"y\":608,\"height\":28,\"name\":\"mecha_2903_folder/calf_l_m\",\"x\":1},{\"width\":82,\"y\":575,\"height\":28,\"name\":\"mecha_2903_folder/textures/calf_l_f_1\",\"x\":195},{\"width\":76,\"y\":582,\"height\":25,\"name\":\"mecha_2903_folder/calf_l_b\",\"x\":279},{\"width\":75,\"y\":453,\"height\":41,\"name\":\"mecha_2903_folder/forearm_l\",\"x\":412},{\"width\":31,\"y\":685,\"height\":32,\"name\":\"mecha_2903_folder/textures/upperarm_l_2\",\"x\":292},{\"width\":57,\"y\":713,\"height\":25,\"name\":\"mecha_2903_folder/hand_l\",\"x\":1},{\"width\":38,\"y\":631,\"height\":14,\"name\":\"mecha_2903_folder/textures/hand_l_1_0\",\"x\":465},{\"width\":59,\"y\":679,\"height\":18,\"name\":\"mecha_2903_folder/textures/thigh_l_f_0\",\"x\":425},{\"width\":55,\"y\":479,\"height\":15,\"name\":\"mecha_2903_folder/thigh_l_m\",\"x\":353},{\"width\":52,\"y\":327,\"height\":17,\"name\":\"mecha_2903_folder/textures/thigh_l_b_1\",\"x\":331},{\"width\":52,\"y\":641,\"height\":28,\"name\":\"mecha_2903_folder/textures/tail9_1\",\"x\":76},{\"width\":27,\"y\":805,\"height\":25,\"name\":\"mecha_2903_folder/textures/tail8_1\",\"x\":71},{\"width\":28,\"y\":805,\"height\":23,\"name\":\"mecha_2903_folder/textures/tail7_1\",\"x\":129},{\"width\":28,\"y\":847,\"height\":22,\"name\":\"mecha_2903_folder/textures/tail6_1\",\"x\":1},{\"width\":33,\"y\":805,\"height\":21,\"name\":\"mecha_2903_folder/textures/tail5_1\",\"x\":36},{\"width\":34,\"y\":453,\"height\":22,\"name\":\"mecha_2903_folder/tail4\",\"x\":255},{\"width\":31,\"y\":781,\"height\":23,\"name\":\"mecha_2903_folder/tail3\",\"x\":159},{\"width\":31,\"y\":734,\"height\":26,\"name\":\"mecha_2903_folder/tail2\",\"x\":204},{\"width\":35,\"y\":703,\"height\":29,\"name\":\"mecha_2903_folder/tail1\",\"x\":206},{\"width\":33,\"y\":630,\"height\":33,\"name\":\"mecha_2903_folder/tail\",\"x\":355},{\"width\":62,\"y\":392,\"height\":56,\"name\":\"mecha_2903_folder/pelvis\",\"x\":408},{\"width\":103,\"y\":1,\"height\":78,\"name\":\"mecha_2903_folder/chest\",\"x\":402},{\"width\":60,\"y\":287,\"height\":69,\"name\":\"mecha_2903_folder/neck\",\"x\":269},{\"width\":48,\"y\":301,\"height\":38,\"name\":\"mecha_2903_folder/head\",\"x\":78},{\"width\":118,\"y\":218,\"height\":67,\"name\":\"mecha_2903_folder/weapon\",\"x\":269},{\"width\":44,\"y\":699,\"height\":24,\"name\":\"mecha_2903_folder/textures/thigh_r_b_1\",\"x\":415},{\"width\":38,\"y\":828,\"height\":17,\"name\":\"mecha_2903_folder/textures/thigh_r_m_0\",\"x\":1},{\"width\":39,\"y\":765,\"height\":18,\"name\":\"mecha_2903_folder/textures/thigh_r_f_2\",\"x\":34},{\"width\":39,\"y\":662,\"height\":29,\"name\":\"mecha_2903_folder/textures/upperarm_r_0\",\"x\":130},{\"width\":75,\"y\":346,\"height\":51,\"name\":\"mecha_2903_folder/forearm_r\",\"x\":331},{\"width\":38,\"y\":728,\"height\":17,\"name\":\"mecha_2903_folder/textures/hand_r_1_0\",\"x\":455},{\"width\":59,\"y\":387,\"height\":26,\"name\":\"mecha_2903_folder/textures/hand_r_0\",\"x\":116},{\"width\":97,\"y\":556,\"height\":24,\"name\":\"mecha_2903_folder/calf_r_b\",\"x\":329},{\"width\":96,\"y\":496,\"height\":28,\"name\":\"mecha_2903_folder/calf_r_m\",\"x\":141},{\"width\":95,\"y\":520,\"height\":28,\"name\":\"mecha_2903_folder/calf_r_f\",\"x\":1},{\"width\":94,\"y\":580,\"height\":26,\"name\":\"mecha_2903d_folder/textures/calf_l_f_1\",\"x\":1},{\"width\":83,\"y\":509,\"height\":32,\"name\":\"mecha_2903d_folder/calf_l_m\",\"x\":239},{\"width\":88,\"y\":526,\"height\":30,\"name\":\"mecha_2903d_folder/calf_l_b\",\"x\":98},{\"width\":82,\"y\":399,\"height\":40,\"name\":\"mecha_2903d_folder/forearm_l\",\"x\":304},{\"width\":31,\"y\":731,\"height\":32,\"name\":\"mecha_2903d_folder/textures/upperarm_l_2\",\"x\":60},{\"width\":108,\"y\":351,\"height\":34,\"name\":\"mecha_2903d_folder/hand_l\",\"x\":78},{\"width\":76,\"y\":611,\"height\":17,\"name\":\"mecha_2903d_folder/textures/hand_l_1_0\",\"x\":314},{\"width\":59,\"y\":665,\"height\":18,\"name\":\"mecha_2903d_folder/textures/thigh_l_f_0\",\"x\":308},{\"width\":55,\"y\":719,\"height\":15,\"name\":\"mecha_2903d_folder/thigh_l_m\",\"x\":243},{\"width\":52,\"y\":728,\"height\":17,\"name\":\"mecha_2903d_folder/textures/thigh_l_b_1\",\"x\":325},{\"width\":52,\"y\":632,\"height\":28,\"name\":\"mecha_2903d_folder/textures/tail9_1\",\"x\":154},{\"width\":43,\"y\":119,\"height\":79,\"name\":\"mecha_2903d_folder/textures/tail8_1\",\"x\":115},{\"width\":36,\"y\":272,\"height\":68,\"name\":\"mecha_2903d_folder/textures/tail7_1\",\"x\":465},{\"width\":34,\"y\":392,\"height\":56,\"name\":\"mecha_2903d_folder/textures/tail6_1\",\"x\":472},{\"width\":36,\"y\":638,\"height\":46,\"name\":\"mecha_2903d_folder/textures/tail5_1\",\"x\":1},{\"width\":34,\"y\":453,\"height\":22,\"name\":\"mecha_2903d_folder/tail4\",\"x\":65},{\"width\":38,\"y\":677,\"height\":27,\"name\":\"mecha_2903d_folder/tail3\",\"x\":252},{\"width\":37,\"y\":632,\"height\":33,\"name\":\"mecha_2903d_folder/tail2\",\"x\":208},{\"width\":41,\"y\":586,\"height\":38,\"name\":\"mecha_2903d_folder/tail1\",\"x\":434},{\"width\":41,\"y\":526,\"height\":45,\"name\":\"mecha_2903d_folder/tail\",\"x\":195},{\"width\":169,\"y\":1,\"height\":116,\"name\":\"mecha_2903d_folder/textures/tail10_3\",\"x\":1},{\"width\":74,\"y\":272,\"height\":72,\"name\":\"mecha_2903d_folder/pelvis\",\"x\":389},{\"width\":116,\"y\":114,\"height\":102,\"name\":\"mecha_2903d_folder/chest\",\"x\":287},{\"width\":113,\"y\":1,\"height\":112,\"name\":\"mecha_2903d_folder/neck\",\"x\":172},{\"width\":48,\"y\":496,\"height\":38,\"name\":\"mecha_2903d_folder/head\",\"x\":438},{\"width\":44,\"y\":699,\"height\":24,\"name\":\"mecha_2903d_folder/textures/thigh_r_b_1\",\"x\":461},{\"width\":38,\"y\":725,\"height\":17,\"name\":\"mecha_2903d_folder/textures/thigh_r_m_0\",\"x\":415},{\"width\":39,\"y\":785,\"height\":18,\"name\":\"mecha_2903d_folder/textures/thigh_r_f_2\",\"x\":1},{\"width\":39,\"y\":693,\"height\":29,\"name\":\"mecha_2903d_folder/textures/upperarm_r_0\",\"x\":130},{\"width\":87,\"y\":161,\"height\":53,\"name\":\"mecha_2903d_folder/forearm_r\",\"x\":405},{\"width\":75,\"y\":616,\"height\":23,\"name\":\"mecha_2903d_folder/textures/hand_r_1_0\",\"x\":77},{\"width\":113,\"y\":218,\"height\":52,\"name\":\"mecha_2903d_folder/textures/hand_r_0\",\"x\":389},{\"width\":115,\"y\":450,\"height\":27,\"name\":\"mecha_2903d_folder/calf_r_b\",\"x\":295},{\"width\":114,\"y\":391,\"height\":31,\"name\":\"mecha_2903d_folder/calf_r_m\",\"x\":188},{\"width\":111,\"y\":420,\"height\":31,\"name\":\"mecha_2903d_folder/calf_r_f\",\"x\":1},{\"width\":82,\"y\":556,\"height\":28,\"name\":\"mecha_2903b_folder/textures/calf_l_f_1\",\"x\":428},{\"width\":74,\"y\":354,\"height\":28,\"name\":\"mecha_2903b_folder/calf_l_m\",\"x\":1},{\"width\":76,\"y\":605,\"height\":25,\"name\":\"mecha_2903b_folder/calf_l_b\",\"x\":175},{\"width\":75,\"y\":453,\"height\":41,\"name\":\"mecha_2903b_folder/forearm_l\",\"x\":178},{\"width\":31,\"y\":740,\"height\":32,\"name\":\"mecha_2903b_folder/textures/upperarm_l_2\",\"x\":1},{\"width\":57,\"y\":686,\"height\":25,\"name\":\"mecha_2903b_folder/hand_l\",\"x\":1},{\"width\":38,\"y\":753,\"height\":14,\"name\":\"mecha_2903b_folder/textures/hand_l_1_0\",\"x\":237},{\"width\":59,\"y\":637,\"height\":18,\"name\":\"mecha_2903b_folder/textures/thigh_l_f_0\",\"x\":247},{\"width\":55,\"y\":736,\"height\":15,\"name\":\"mecha_2903b_folder/thigh_l_m\",\"x\":243},{\"width\":52,\"y\":336,\"height\":17,\"name\":\"mecha_2903b_folder/textures/thigh_l_b_1\",\"x\":209},{\"width\":52,\"y\":701,\"height\":28,\"name\":\"mecha_2903b_folder/textures/tail9_1\",\"x\":76},{\"width\":27,\"y\":805,\"height\":25,\"name\":\"mecha_2903b_folder/textures/tail8_1\",\"x\":100},{\"width\":28,\"y\":828,\"height\":23,\"name\":\"mecha_2903b_folder/textures/tail7_1\",\"x\":41},{\"width\":27,\"y\":744,\"height\":22,\"name\":\"mecha_2903b_folder/textures/tail6_1\",\"x\":419},{\"width\":33,\"y\":805,\"height\":21,\"name\":\"mecha_2903b_folder/textures/tail5_1\",\"x\":1},{\"width\":34,\"y\":756,\"height\":22,\"name\":\"mecha_2903b_folder/tail4\",\"x\":126},{\"width\":31,\"y\":780,\"height\":23,\"name\":\"mecha_2903b_folder/tail3\",\"x\":126},{\"width\":31,\"y\":697,\"height\":26,\"name\":\"mecha_2903b_folder/tail2\",\"x\":171},{\"width\":35,\"y\":725,\"height\":29,\"name\":\"mecha_2903b_folder/tail1\",\"x\":167},{\"width\":33,\"y\":662,\"height\":33,\"name\":\"mecha_2903b_folder/tail\",\"x\":171},{\"width\":62,\"y\":420,\"height\":56,\"name\":\"mecha_2903b_folder/pelvis\",\"x\":114},{\"width\":103,\"y\":81,\"height\":78,\"name\":\"mecha_2903b_folder/chest\",\"x\":405},{\"width\":112,\"y\":119,\"height\":97,\"name\":\"mecha_2903b_folder/neck\",\"x\":1},{\"width\":48,\"y\":296,\"height\":38,\"name\":\"mecha_2903b_folder/head\",\"x\":209},{\"width\":133,\"y\":218,\"height\":76,\"name\":\"mecha_2903b_folder/weapon\",\"x\":134},{\"width\":44,\"y\":683,\"height\":24,\"name\":\"mecha_2903b_folder/textures/thigh_r_b_1\",\"x\":369},{\"width\":38,\"y\":747,\"height\":17,\"name\":\"mecha_2903b_folder/textures/thigh_r_m_0\",\"x\":300},{\"width\":39,\"y\":765,\"height\":18,\"name\":\"mecha_2903b_folder/textures/thigh_r_f_2\",\"x\":75},{\"width\":39,\"y\":630,\"height\":29,\"name\":\"mecha_2903b_folder/textures/upperarm_r_0\",\"x\":314},{\"width\":75,\"y\":301,\"height\":51,\"name\":\"mecha_2903b_folder/forearm_r\",\"x\":1},{\"width\":38,\"y\":763,\"height\":17,\"name\":\"mecha_2903b_folder/textures/hand_r_1_0\",\"x\":379},{\"width\":59,\"y\":609,\"height\":26,\"name\":\"mecha_2903b_folder/textures/hand_r_0\",\"x\":253},{\"width\":97,\"y\":530,\"height\":24,\"name\":\"mecha_2903b_folder/calf_r_b\",\"x\":329},{\"width\":96,\"y\":479,\"height\":28,\"name\":\"mecha_2903b_folder/calf_r_m\",\"x\":255},{\"width\":95,\"y\":550,\"height\":28,\"name\":\"mecha_2903b_folder/calf_r_f\",\"x\":1},{\"width\":95,\"y\":558,\"height\":26,\"name\":\"mecha_2903c_folder/textures/calf_l_f_1\",\"x\":98},{\"width\":83,\"y\":496,\"height\":32,\"name\":\"mecha_2903c_folder/calf_l_m\",\"x\":353},{\"width\":88,\"y\":543,\"height\":30,\"name\":\"mecha_2903c_folder/calf_l_b\",\"x\":239},{\"width\":74,\"y\":478,\"height\":40,\"name\":\"mecha_2903c_folder/forearm_l\",\"x\":65},{\"width\":31,\"y\":731,\"height\":32,\"name\":\"mecha_2903c_folder/textures/upperarm_l_2\",\"x\":93},{\"width\":76,\"y\":586,\"height\":28,\"name\":\"mecha_2903c_folder/hand_l\",\"x\":97},{\"width\":76,\"y\":536,\"height\":17,\"name\":\"mecha_2903c_folder/textures/hand_l_1_0\",\"x\":428},{\"width\":59,\"y\":657,\"height\":18,\"name\":\"mecha_2903c_folder/textures/thigh_l_f_0\",\"x\":247},{\"width\":55,\"y\":200,\"height\":15,\"name\":\"mecha_2903c_folder/thigh_l_m\",\"x\":115},{\"width\":52,\"y\":709,\"height\":17,\"name\":\"mecha_2903c_folder/textures/thigh_l_b_1\",\"x\":361},{\"width\":52,\"y\":671,\"height\":28,\"name\":\"mecha_2903c_folder/textures/tail9_1\",\"x\":76},{\"width\":35,\"y\":638,\"height\":46,\"name\":\"mecha_2903c_folder/textures/tail8_1\",\"x\":39},{\"width\":33,\"y\":586,\"height\":43,\"name\":\"mecha_2903c_folder/textures/tail7_1\",\"x\":477},{\"width\":32,\"y\":626,\"height\":38,\"name\":\"mecha_2903c_folder/textures/tail6_1\",\"x\":431},{\"width\":37,\"y\":611,\"height\":35,\"name\":\"mecha_2903c_folder/textures/tail5_1\",\"x\":392},{\"width\":34,\"y\":685,\"height\":29,\"name\":\"mecha_2903c_folder/tail4\",\"x\":325},{\"width\":31,\"y\":756,\"height\":23,\"name\":\"mecha_2903c_folder/tail3\",\"x\":162},{\"width\":31,\"y\":762,\"height\":26,\"name\":\"mecha_2903c_folder/tail2\",\"x\":204},{\"width\":35,\"y\":725,\"height\":29,\"name\":\"mecha_2903c_folder/tail1\",\"x\":130},{\"width\":33,\"y\":648,\"height\":33,\"name\":\"mecha_2903c_folder/tail\",\"x\":390},{\"width\":62,\"y\":453,\"height\":56,\"name\":\"mecha_2903c_folder/pelvis\",\"x\":1},{\"width\":111,\"y\":115,\"height\":101,\"name\":\"mecha_2903c_folder/chest\",\"x\":172},{\"width\":113,\"y\":1,\"height\":111,\"name\":\"mecha_2903c_folder/neck\",\"x\":287},{\"width\":48,\"y\":287,\"height\":38,\"name\":\"mecha_2903c_folder/head\",\"x\":331},{\"width\":131,\"y\":218,\"height\":81,\"name\":\"mecha_2903c_folder/weapon\",\"x\":1},{\"width\":44,\"y\":677,\"height\":24,\"name\":\"mecha_2903c_folder/textures/thigh_r_b_1\",\"x\":206},{\"width\":38,\"y\":744,\"height\":17,\"name\":\"mecha_2903c_folder/textures/thigh_r_m_0\",\"x\":379},{\"width\":39,\"y\":785,\"height\":18,\"name\":\"mecha_2903c_folder/textures/thigh_r_f_2\",\"x\":75},{\"width\":39,\"y\":648,\"height\":29,\"name\":\"mecha_2903c_folder/textures/upperarm_r_0\",\"x\":465},{\"width\":73,\"y\":296,\"height\":53,\"name\":\"mecha_2903c_folder/forearm_r\",\"x\":134},{\"width\":75,\"y\":586,\"height\":23,\"name\":\"mecha_2903c_folder/textures/hand_r_1_0\",\"x\":357},{\"width\":79,\"y\":346,\"height\":44,\"name\":\"mecha_2903c_folder/textures/hand_r_0\",\"x\":408},{\"width\":115,\"y\":424,\"height\":27,\"name\":\"mecha_2903c_folder/calf_r_b\",\"x\":178},{\"width\":114,\"y\":358,\"height\":31,\"name\":\"mecha_2903c_folder/calf_r_m\",\"x\":188},{\"width\":113,\"y\":387,\"height\":31,\"name\":\"mecha_2903c_folder/calf_r_f\",\"x\":1}],\"width\":512,\"height\":1024,\"name\":\"mecha_2903\",\"imagePath\":\"mecha_2903_tex.png\"}", + "texture": "759bd723-8f27-46ed-a976-5b82099a42ab", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.png b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.png new file mode 100644 index 00000000..0b5751d3 Binary files /dev/null and b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.png differ diff --git a/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.png.meta b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.png.meta new file mode 100644 index 00000000..fa042937 --- /dev/null +++ b/Cocos/Demos/assets/resources/mecha_2903/mecha_2903_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "759bd723-8f27-46ed-a976-5b82099a42ab", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "mecha_2903_tex": { + "ver": "1.0.3", + "uuid": "1ed487f7-89d7-4fa6-ac86-ddf627417bae", + "rawTextureUuid": "759bd723-8f27-46ed-a976-5b82099a42ab", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -0.5, + "offsetY": 77, + "trimX": 1, + "trimY": 1, + "width": 509, + "height": 868, + "rawWidth": 512, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/progress_bar.meta b/Cocos/Demos/assets/resources/progress_bar.meta new file mode 100644 index 00000000..acf4ef0b --- /dev/null +++ b/Cocos/Demos/assets/resources/progress_bar.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "50b1041f-4c10-4e9c-85a8-59b30a251adb", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/progress_bar/progress_bar_ske.json b/Cocos/Demos/assets/resources/progress_bar/progress_bar_ske.json new file mode 100644 index 00000000..5abb73fc --- /dev/null +++ b/Cocos/Demos/assets/resources/progress_bar/progress_bar_ske.json @@ -0,0 +1 @@ +{"frameRate":24,"name":"progress_bar","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"progress_bar","aabb":{"x":-300,"y":-82.37,"width":611,"height":97.37},"bone":[{"name":"root"},{"inheritScale":false,"name":"track","parent":"root"},{"inheritScale":false,"name":"bar","parent":"root","transform":{"x":-300}},{"inheritScale":false,"name":"thrmb","parent":"root","transform":{"x":300}},{"name":"loading","parent":"root","transform":{"y":-50,"skX":0.8115,"skY":0.8115}}],"slot":[{"name":"track","parent":"track"},{"name":"bar","parent":"bar"},{"name":"thrmb","parent":"thrmb"},{"name":"loading","parent":"loading"}],"skin":[{"name":"","slot":[{"name":"loading","display":[{"type":"armature","name":"loading","transform":{"skX":-0.81,"skY":-0.81}}]},{"name":"thrmb","display":[{"name":"_texture/thrmb","transform":{"x":-33}}]},{"name":"bar","display":[{"name":"_texture/bar","transform":{"x":300}}]},{"name":"track","display":[{"name":"_texture/track"}]}]}],"animation":[{"duration":100,"name":"idle","frame":[{"duration":50,"events":[{"name":"startEvent"}]},{"duration":50,"events":[{"name":"middleEvent"}]},{"duration":0,"events":[{"name":"completeEvent"}]}],"bone":[{"name":"bar","scaleFrame":[{"duration":100,"tweenEasing":0,"x":0.01},{"duration":0}]},{"name":"thrmb","translateFrame":[{"duration":5,"tweenEasing":0,"x":-600},{"duration":90,"tweenEasing":0,"x":-565},{"duration":5,"tweenEasing":0,"x":-30},{"duration":0}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.5,"y":0.5},{"duration":90,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":0,"x":0.5,"y":0.5}]}],"slot":[{"name":"thrmb","colorFrame":[{"duration":5,"tweenEasing":0,"value":{"aM":0}},{"duration":90,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"loading","displayFrame":[{"duration":100,"actions":[{"gotoAndPlay":"idle"}]},{"duration":0,"actions":[{"gotoAndPlay":"hide"}]}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":24,"name":"loading","aabb":{"x":-54,"y":-51.95,"width":108,"height":104},"bone":[{"name":"root"},{"inheritScale":false,"name":"6","parent":"root","transform":{"x":-19,"y":-11,"scX":0.3329,"scY":0.3333}},{"inheritScale":false,"name":"5","parent":"root","transform":{"x":-19,"y":11,"scX":0.3329,"scY":0.3333}},{"inheritScale":false,"name":"4","parent":"root","transform":{"y":22,"scX":0.3329,"scY":0.3333}},{"inheritScale":false,"name":"3","parent":"root","transform":{"x":19,"y":11,"scX":0.3329,"scY":0.3333}},{"inheritScale":false,"name":"2","parent":"root","transform":{"x":19,"y":-11,"scX":0.3329,"scY":0.3333}},{"inheritScale":false,"name":"1","parent":"root","transform":{"y":-22,"scX":0.3329,"scY":0.3333}}],"slot":[{"name":"6","parent":"6"},{"name":"5","parent":"5"},{"name":"4","parent":"4"},{"name":"3","parent":"3"},{"name":"2","parent":"2"},{"name":"1","parent":"1"}],"skin":[{"name":"","slot":[{"name":"1","display":[{"name":"_texture/_diamond","transform":{"y":0.15}}]},{"name":"2","display":[{"name":"_texture/_diamond","transform":{"y":0.15}}]},{"name":"3","display":[{"name":"_texture/_diamond","transform":{"y":0.15}}]},{"name":"4","display":[{"name":"_texture/_diamond","transform":{"y":0.15}}]},{"name":"5","display":[{"name":"_texture/_diamond","transform":{"y":0.15}}]},{"name":"6","display":[{"name":"_texture/_diamond","transform":{"y":0.15}}]}]}],"animation":[{"duration":30,"playTimes":0,"fadeInTime":0.2,"name":"idle","bone":[{"name":"6","translateFrame":[{"duration":5,"tweenEasing":0,"x":-4,"y":-2},{"duration":20,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":0,"x":-4,"y":-2}]},{"name":"5","translateFrame":[{"duration":20,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-4,"y":3},{"duration":0}]},{"name":"4","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":4},{"duration":5}]},{"name":"3","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":4,"y":2},{"duration":10}]},{"name":"2","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":4,"y":-2},{"duration":15}]},{"name":"1","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-4},{"duration":20}]}],"slot":[{"name":"6","colorFrame":[{"duration":5,"tweenEasing":0},{"duration":20,"tweenEasing":0,"value":{"aM":50}},{"duration":5,"tweenEasing":0,"value":{"aM":50}},{"duration":0}]},{"name":"5","colorFrame":[{"duration":20,"tweenEasing":0,"value":{"aM":50}},{"duration":5,"tweenEasing":0,"value":{"aM":50}},{"duration":5,"tweenEasing":0},{"duration":0,"value":{"aM":50}}]},{"name":"4","colorFrame":[{"duration":15,"tweenEasing":0,"value":{"aM":50}},{"duration":5,"tweenEasing":0,"value":{"aM":50}},{"duration":5,"tweenEasing":0},{"duration":5,"value":{"aM":50}}]},{"name":"3","colorFrame":[{"duration":10,"tweenEasing":0,"value":{"aM":50}},{"duration":5,"tweenEasing":0,"value":{"aM":50}},{"duration":5,"tweenEasing":0},{"duration":10,"value":{"aM":50}}]},{"name":"2","colorFrame":[{"duration":5,"tweenEasing":0,"value":{"aM":50}},{"duration":5,"tweenEasing":0,"value":{"aM":50}},{"duration":5,"tweenEasing":0},{"duration":15,"value":{"aM":50}}]},{"name":"1","colorFrame":[{"duration":5,"tweenEasing":0,"value":{"aM":50}},{"duration":5,"tweenEasing":0},{"duration":20,"value":{"aM":50}}]}]},{"duration":0,"playTimes":0,"fadeInTime":0.2,"name":"hide","bone":[{"name":"6","translateFrame":[{"duration":0,"x":19,"y":11}]},{"name":"5","translateFrame":[{"duration":0,"x":19,"y":-11}]},{"name":"4","translateFrame":[{"duration":0,"y":-22}]},{"name":"3","translateFrame":[{"duration":0,"x":-19,"y":-11}]},{"name":"2","translateFrame":[{"duration":0,"x":-19,"y":11}]},{"name":"1","translateFrame":[{"duration":0,"y":22}]}],"slot":[{"name":"6","colorFrame":[{"duration":0,"value":{"aM":0}}]},{"name":"5","colorFrame":[{"duration":0,"value":{"aM":0}}]},{"name":"4","colorFrame":[{"duration":0,"value":{"aM":0}}]},{"name":"3","colorFrame":[{"duration":0,"value":{"aM":0}}]},{"name":"2","colorFrame":[{"duration":0,"value":{"aM":0}}]},{"name":"1","colorFrame":[{"duration":0,"value":{"aM":0}}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/progress_bar/progress_bar_ske.json.meta b/Cocos/Demos/assets/resources/progress_bar/progress_bar_ske.json.meta new file mode 100644 index 00000000..b57c7eb9 --- /dev/null +++ b/Cocos/Demos/assets/resources/progress_bar/progress_bar_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "1ecdfb85-8db8-48be-bc2b-1062cf5f95f0", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.json b/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.json new file mode 100644 index 00000000..98db24d5 --- /dev/null +++ b/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.json @@ -0,0 +1 @@ +{"imagePath":"progress_bar_tex.png","width":1024,"SubTexture":[{"width":600,"y":1,"height":4,"name":"_texture/track","x":73},{"width":600,"y":7,"height":4,"name":"_texture/bar","x":73},{"width":88,"y":1,"height":30,"name":"_texture/thrmb","x":675},{"width":70,"y":1,"height":60,"name":"_texture/_diamond","x":1}],"height":64,"name":"progress_bar"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.json.meta b/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.json.meta new file mode 100644 index 00000000..34f7e4fb --- /dev/null +++ b/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "f2c6fb73-a732-4c27-9a95-7e7580bb94c7", + "atlasJson": "{\"imagePath\":\"progress_bar_tex.png\",\"width\":1024,\"SubTexture\":[{\"width\":600,\"y\":1,\"height\":4,\"name\":\"_texture/track\",\"x\":73},{\"width\":600,\"y\":7,\"height\":4,\"name\":\"_texture/bar\",\"x\":73},{\"width\":88,\"y\":1,\"height\":30,\"name\":\"_texture/thrmb\",\"x\":675},{\"width\":70,\"y\":1,\"height\":60,\"name\":\"_texture/_diamond\",\"x\":1}],\"height\":64,\"name\":\"progress_bar\"}", + "texture": "73462a3c-c3ce-46d1-aa02-b5117fafddca", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.png b/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.png new file mode 100644 index 00000000..042805fc Binary files /dev/null and b/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.png differ diff --git a/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.png.meta b/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.png.meta new file mode 100644 index 00000000..7ecacb37 --- /dev/null +++ b/Cocos/Demos/assets/resources/progress_bar/progress_bar_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "73462a3c-c3ce-46d1-aa02-b5117fafddca", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "progress_bar_tex": { + "ver": "1.0.3", + "uuid": "57703945-a56a-4d79-a25e-d3a4b605a11d", + "rawTextureUuid": "73462a3c-c3ce-46d1-aa02-b5117fafddca", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -130, + "offsetY": 1, + "trimX": 1, + "trimY": 1, + "width": 762, + "height": 60, + "rawWidth": 1024, + "rawHeight": 64, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/shizuku.meta b/Cocos/Demos/assets/resources/shizuku.meta new file mode 100644 index 00000000..2045f22f --- /dev/null +++ b/Cocos/Demos/assets/resources/shizuku.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "eaa48db2-2607-4ef5-9672-9a4df3ec8911", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku.1024.meta b/Cocos/Demos/assets/resources/shizuku/shizuku.1024.meta new file mode 100644 index 00000000..88e16475 --- /dev/null +++ b/Cocos/Demos/assets/resources/shizuku/shizuku.1024.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "e23b400e-ff79-45f3-b30d-6673fcc5d513", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_00.png b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_00.png new file mode 100644 index 00000000..c3005403 Binary files /dev/null and b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_00.png differ diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_00.png.meta b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_00.png.meta new file mode 100644 index 00000000..0074b21d --- /dev/null +++ b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_00.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "f1681f1f-5c17-44bb-a4a6-46dd5bd0a46d", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "texture_00": { + "ver": "1.0.3", + "uuid": "2e89d08e-3565-4b7a-b553-3de79532f9bf", + "rawTextureUuid": "f1681f1f-5c17-44bb-a4a6-46dd5bd0a46d", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -8, + "offsetY": 3.5, + "trimX": 0, + "trimY": 8, + "width": 1008, + "height": 1001, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_01.png b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_01.png new file mode 100644 index 00000000..96566d99 Binary files /dev/null and b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_01.png differ diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_01.png.meta b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_01.png.meta new file mode 100644 index 00000000..8f264320 --- /dev/null +++ b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_01.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "a35fdbe5-12f4-408c-84f5-b56b6e18e2a5", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "texture_01": { + "ver": "1.0.3", + "uuid": "86680db1-f0db-4183-8158-db8e4d7e8255", + "rawTextureUuid": "a35fdbe5-12f4-408c-84f5-b56b6e18e2a5", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -0.5, + "offsetY": 4, + "trimX": 3, + "trimY": 0, + "width": 1017, + "height": 1016, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_02.png b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_02.png new file mode 100644 index 00000000..6ace01b9 Binary files /dev/null and b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_02.png differ diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_02.png.meta b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_02.png.meta new file mode 100644 index 00000000..78a1ebd8 --- /dev/null +++ b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_02.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "691ef495-23d9-4ef7-93b3-37dbb4cd2ab2", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "texture_02": { + "ver": "1.0.3", + "uuid": "154e5370-f350-4fbb-8edd-156a6f75b12b", + "rawTextureUuid": "691ef495-23d9-4ef7-93b3-37dbb4cd2ab2", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 2.5, + "offsetY": 0, + "trimX": 5, + "trimY": 4, + "width": 1019, + "height": 1016, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_03.png b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_03.png new file mode 100644 index 00000000..93eb4c68 Binary files /dev/null and b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_03.png differ diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_03.png.meta b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_03.png.meta new file mode 100644 index 00000000..86481a2a --- /dev/null +++ b/Cocos/Demos/assets/resources/shizuku/shizuku.1024/texture_03.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "c4df3e6c-d371-46c5-8792-e7d3b0caca0d", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "texture_03": { + "ver": "1.0.3", + "uuid": "23a0d3ed-e1bd-4b2a-bd8e-8a7448159720", + "rawTextureUuid": "c4df3e6c-d371-46c5-8792-e7d3b0caca0d", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -16, + "offsetY": -25, + "trimX": 21, + "trimY": 54, + "width": 950, + "height": 966, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku_ske.json b/Cocos/Demos/assets/resources/shizuku/shizuku_ske.json new file mode 100644 index 00000000..f3af6ceb --- /dev/null +++ b/Cocos/Demos/assets/resources/shizuku/shizuku_ske.json @@ -0,0 +1 @@ +{"frameRate":30,"name":"shizuku","version":"5.6","compatibleVersion":"5.5","armature":[{"name":"shizuku","aabb":{"x":-640,"y":-1380,"width":1280,"height":1380},"bone":[{"length":150,"name":"DST_BASE"},{"type":"surface","name":"B_BODY.04","segmentX":8,"segmentY":8,"vertices":[-574.8,-1106.14,-429.1,-1106.14,-283.39,-1106.14,-137.68,-1106.14,8.03,-1106.14,153.74,-1106.14,299.45,-1106.14,445.15,-1106.14,590.86,-1106.14,-574.8,-932.9,-429.1,-932.9,-283.39,-932.9,-137.68,-932.9,8.03,-932.9,153.74,-932.9,299.45,-932.9,445.15,-932.9,590.86,-932.9,-574.8,-759.66,-429.1,-759.66,-283.39,-759.66,-137.68,-759.66,8.03,-759.66,153.74,-759.66,299.45,-759.66,445.15,-759.66,590.86,-759.66,-574.8,-586.43,-429.1,-586.43,-283.39,-586.43,-137.68,-586.43,8.03,-586.43,153.74,-586.43,299.45,-586.43,445.15,-586.43,590.86,-586.43,-574.8,-413.19,-429.1,-413.19,-283.39,-413.19,-137.68,-413.19,8.03,-413.19,153.74,-413.19,299.45,-413.19,445.15,-413.19,590.86,-413.19,-574.8,-239.96,-429.1,-239.96,-283.39,-239.96,-137.68,-239.96,8.03,-239.96,153.74,-239.96,299.45,-239.96,445.15,-239.96,590.86,-239.96,-574.8,-66.72,-429.1,-66.72,-283.39,-66.72,-137.68,-66.72,8.03,-66.72,153.74,-66.72,299.45,-66.72,445.15,-66.72,590.86,-66.72,-574.8,106.51,-429.1,106.51,-283.39,106.51,-137.68,106.51,8.03,106.51,153.74,106.51,299.45,106.51,445.15,106.51,590.86,106.51,-574.8,279.75,-429.1,279.75,-283.39,279.75,-137.68,279.75,8.03,279.75,153.74,279.75,299.45,279.75,445.15,279.75,590.86,279.75]},{"length":150,"name":"B_BACKGROUND.01","transform":{"x":-17.33,"y":-22,"skX":-90,"skY":-90}},{"type":"surface","name":"B_BODY.03","parent":"B_BODY.04","segmentX":8,"segmentY":8,"vertices":[-171.8,-158.29,-129.46,-158.29,-87.11,-158.29,-44.76,-158.29,-2.41,-158.29,39.93,-158.29,82.28,-158.29,124.63,-158.29,166.97,-158.29,-171.8,-117.82,-129.46,-117.82,-87.11,-117.82,-44.76,-117.82,-2.41,-117.82,39.93,-117.82,82.28,-117.82,124.63,-117.82,166.97,-117.82,-171.8,-77.34,-129.46,-77.34,-87.11,-77.34,-44.76,-77.34,-2.41,-77.34,39.93,-77.34,82.28,-77.34,124.63,-77.34,166.97,-77.34,-171.8,-36.87,-129.46,-36.87,-87.11,-36.87,-44.76,-36.87,-2.41,-36.87,39.93,-36.87,82.28,-36.87,124.63,-36.87,166.97,-36.87,-171.8,3.6,-129.46,3.6,-87.11,3.6,-44.76,3.6,-2.41,3.6,39.93,3.6,82.28,3.6,124.63,3.6,166.97,3.6,-171.8,44.07,-129.46,44.07,-87.11,44.07,-44.76,44.07,-2.41,44.07,39.93,44.07,82.28,44.07,124.63,44.07,166.97,44.07,-171.8,84.55,-129.46,84.55,-87.11,84.55,-44.76,84.55,-2.41,84.55,39.93,84.55,82.28,84.55,124.63,84.55,166.97,84.55,-171.8,125.02,-129.46,125.02,-87.11,125.02,-44.76,125.02,-2.41,125.02,39.93,125.02,82.28,125.02,124.63,125.02,166.97,125.02,-171.8,165.49,-129.46,165.49,-87.11,165.49,-44.76,165.49,-2.41,165.49,39.93,165.49,82.28,165.49,124.63,165.49,166.97,165.49]},{"type":"surface","name":"B_BODY.02","parent":"B_BODY.03","segmentX":8,"segmentY":8,"vertices":[-174.86,-165.74,-131.63,-165.74,-88.39,-165.74,-45.15,-165.74,-1.92,-165.74,41.32,-165.74,84.56,-165.74,127.8,-165.74,171.03,-165.74,-174.86,-124.71,-131.63,-124.71,-88.39,-124.71,-45.15,-124.71,-1.92,-124.71,41.32,-124.71,84.56,-124.71,127.8,-124.71,171.03,-124.71,-174.86,-83.67,-131.63,-83.67,-88.39,-83.67,-45.15,-83.67,-1.92,-83.67,41.32,-83.67,84.56,-83.67,127.8,-83.67,171.03,-83.67,-174.86,-42.64,-131.63,-42.64,-88.39,-42.64,-45.15,-42.64,-1.92,-42.64,41.32,-42.64,84.56,-42.64,127.8,-42.64,171.03,-42.64,-174.86,-1.6,-131.63,-1.6,-88.39,-1.6,-45.15,-1.6,-1.92,-1.6,41.32,-1.6,84.56,-1.6,127.8,-1.6,171.03,-1.6,-174.86,39.43,-131.63,39.43,-88.39,39.43,-45.15,39.43,-1.92,39.43,41.32,39.43,84.56,39.43,127.8,39.43,171.03,39.43,-174.86,80.46,-131.63,80.46,-88.39,80.46,-45.15,80.46,-1.92,80.46,41.32,80.46,84.56,80.46,127.8,80.46,171.03,80.46,-174.86,121.5,-131.63,121.5,-88.39,121.5,-45.15,121.5,-1.92,121.5,41.32,121.5,84.56,121.5,127.8,121.5,171.03,121.5,-174.86,162.53,-131.63,162.53,-88.39,162.53,-45.15,162.53,-1.92,162.53,41.32,162.53,84.56,162.53,127.8,162.53,171.03,162.53]},{"type":"surface","name":"B_CLOTHES.10","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-87.08,-101.69,-67.29,-101.69,-47.49,-101.69,-27.7,-101.69,-7.9,-101.69,11.89,-101.69,31.68,-101.69,51.48,-101.69,71.27,-101.69,-87.08,-85.59,-67.29,-85.59,-47.49,-85.59,-27.7,-85.59,-7.9,-85.59,11.89,-85.59,31.68,-85.59,51.48,-85.59,71.27,-85.59,-87.08,-69.49,-67.29,-69.49,-47.49,-69.49,-27.7,-69.49,-7.9,-69.49,11.89,-69.49,31.68,-69.49,51.48,-69.49,71.27,-69.49,-87.08,-53.38,-67.29,-53.38,-47.49,-53.38,-27.7,-53.38,-7.9,-53.38,11.89,-53.38,31.68,-53.38,51.48,-53.38,71.27,-53.38,-87.08,-37.28,-67.29,-37.28,-47.49,-37.28,-27.7,-37.28,-7.9,-37.28,11.89,-37.28,31.68,-37.28,51.48,-37.28,71.27,-37.28,-87.08,-21.17,-67.29,-21.17,-47.49,-21.17,-27.7,-21.17,-7.9,-21.17,11.89,-21.17,31.68,-21.17,51.48,-21.17,71.27,-21.17,-87.08,-5.07,-67.29,-5.07,-47.49,-5.07,-27.7,-5.07,-7.9,-5.07,11.89,-5.07,31.68,-5.07,51.48,-5.07,71.27,-5.07,-87.08,11.03,-67.29,11.03,-47.49,11.03,-27.7,11.03,-7.9,11.03,11.89,11.03,31.68,11.03,51.48,11.03,71.27,11.03,-87.08,27.14,-67.29,27.14,-47.49,27.14,-27.7,27.14,-7.9,27.14,11.89,27.14,31.68,27.14,51.48,27.14,71.27,27.14]},{"type":"surface","name":"B_CLOTHES.11","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-53.62,-108.24,-45.36,-108.24,-37.1,-108.24,-28.84,-108.24,-20.58,-108.24,-12.33,-108.24,-4.07,-108.24,4.19,-108.24,12.45,-108.24,-53.62,-99.87,-45.36,-99.87,-37.1,-99.87,-28.84,-99.87,-20.58,-99.87,-12.33,-99.87,-4.07,-99.87,4.19,-99.87,12.45,-99.87,-53.62,-91.51,-45.36,-91.51,-37.1,-91.51,-28.84,-91.51,-20.58,-91.51,-12.33,-91.51,-4.07,-91.51,4.19,-91.51,12.45,-91.51,-53.62,-83.15,-45.36,-83.15,-37.1,-83.15,-28.84,-83.15,-20.58,-83.15,-12.33,-83.15,-4.07,-83.15,4.19,-83.15,12.45,-83.15,-53.62,-74.78,-45.36,-74.78,-37.1,-74.78,-28.84,-74.78,-20.58,-74.78,-12.33,-74.78,-4.07,-74.78,4.19,-74.78,12.45,-74.78,-53.62,-66.42,-45.36,-66.42,-37.1,-66.42,-28.84,-66.42,-20.58,-66.42,-12.33,-66.42,-4.07,-66.42,4.19,-66.42,12.45,-66.42,-53.62,-58.05,-45.36,-58.05,-37.1,-58.05,-28.84,-58.05,-20.58,-58.05,-12.33,-58.05,-4.07,-58.05,4.19,-58.05,12.45,-58.05,-53.62,-49.69,-45.36,-49.69,-37.1,-49.69,-28.84,-49.69,-20.58,-49.69,-12.33,-49.69,-4.07,-49.69,4.19,-49.69,12.45,-49.69,-53.62,-41.33,-45.36,-41.33,-37.1,-41.33,-28.84,-41.33,-20.58,-41.33,-12.33,-41.33,-4.07,-41.33,4.19,-41.33,12.45,-41.33]},{"type":"surface","name":"B_CLOTHES.12","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-21.62,-111.4,-13.24,-111.4,-4.86,-111.4,3.52,-111.4,11.89,-111.4,20.27,-111.4,28.65,-111.4,37.03,-111.4,45.41,-111.4,-21.62,-102.75,-13.24,-102.75,-4.86,-102.75,3.52,-102.75,11.89,-102.75,20.27,-102.75,28.65,-102.75,37.03,-102.75,45.41,-102.75,-21.62,-94.09,-13.24,-94.09,-4.86,-94.09,3.52,-94.09,11.89,-94.09,20.27,-94.09,28.65,-94.09,37.03,-94.09,45.41,-94.09,-21.62,-85.44,-13.24,-85.44,-4.86,-85.44,3.52,-85.44,11.89,-85.44,20.27,-85.44,28.65,-85.44,37.03,-85.44,45.41,-85.44,-21.62,-76.78,-13.24,-76.78,-4.86,-76.78,3.52,-76.78,11.89,-76.78,20.27,-76.78,28.65,-76.78,37.03,-76.78,45.41,-76.78,-21.62,-68.12,-13.24,-68.12,-4.86,-68.12,3.52,-68.12,11.89,-68.12,20.27,-68.12,28.65,-68.12,37.03,-68.12,45.41,-68.12,-21.62,-59.47,-13.24,-59.47,-4.86,-59.47,3.52,-59.47,11.89,-59.47,20.27,-59.47,28.65,-59.47,37.03,-59.47,45.41,-59.47,-21.62,-50.81,-13.24,-50.81,-4.86,-50.81,3.52,-50.81,11.89,-50.81,20.27,-50.81,28.65,-50.81,37.03,-50.81,45.41,-50.81,-21.62,-42.16,-13.24,-42.16,-4.86,-42.16,3.52,-42.16,11.89,-42.16,20.27,-42.16,28.65,-42.16,37.03,-42.16,45.41,-42.16]},{"type":"surface","name":"B_CLOTHES.14","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-46.57,-148.7,-23.14,-148.7,0.29,-148.7,23.72,-148.7,47.15,-148.7,70.58,-148.7,94.01,-148.7,117.44,-148.7,140.87,-148.7,-46.57,-117.79,-23.14,-117.79,0.29,-117.79,23.72,-117.79,47.15,-117.79,70.58,-117.79,94.01,-117.79,117.44,-117.79,140.87,-117.79,-46.57,-86.89,-23.14,-86.89,0.29,-86.89,23.72,-86.89,47.15,-86.89,70.58,-86.89,94.01,-86.89,117.44,-86.89,140.87,-86.89,-46.57,-55.98,-23.14,-55.98,0.29,-55.98,23.72,-55.98,47.15,-55.98,70.58,-55.98,94.01,-55.98,117.44,-55.98,140.87,-55.98,-46.57,-25.08,-23.14,-25.08,0.29,-25.08,23.72,-25.08,47.15,-25.08,70.58,-25.08,94.01,-25.08,117.44,-25.08,140.87,-25.08,-46.57,5.83,-23.14,5.83,0.29,5.83,23.72,5.83,47.15,5.83,70.58,5.83,94.01,5.83,117.44,5.83,140.87,5.83,-46.57,36.74,-23.14,36.74,0.29,36.74,23.72,36.74,47.15,36.74,70.58,36.74,94.01,36.74,117.44,36.74,140.87,36.74,-46.57,67.64,-23.14,67.64,0.29,67.64,23.72,67.64,47.15,67.64,70.58,67.64,94.01,67.64,117.44,67.64,140.87,67.64,-46.57,98.55,-23.14,98.55,0.29,98.55,23.72,98.55,47.15,98.55,70.58,98.55,94.01,98.55,117.44,98.55,140.87,98.55]},{"type":"surface","name":"B_CLOTHES.15","parent":"B_CLOTHES.14","segmentX":8,"segmentY":8,"vertices":[-170.95,-184.9,-128.03,-184.9,-85.11,-184.9,-42.19,-184.9,0.73,-184.9,43.65,-184.9,86.56,-184.9,129.48,-184.9,172.4,-184.9,-170.95,-139.4,-128.03,-139.4,-85.11,-139.4,-42.19,-139.4,0.73,-139.4,43.65,-139.4,86.56,-139.4,129.48,-139.4,172.4,-139.4,-170.95,-93.91,-128.03,-93.91,-85.11,-93.91,-42.19,-93.91,0.73,-93.91,43.65,-93.91,86.56,-93.91,129.48,-93.91,172.4,-93.91,-170.95,-48.41,-128.03,-48.41,-85.11,-48.41,-42.18,-48.41,0.66,-48.41,43.5,-48.41,86.41,-48.41,129.4,-48.41,172.4,-48.41,-170.95,-2.92,-128.03,-2.92,-85.11,-2.92,-42.26,-2.92,-0.02,-2.92,42.21,-2.92,85.23,-2.92,128.79,-2.92,172.4,-2.92,-170.95,42.58,-128.03,42.58,-85.11,42.58,-42.34,42.58,-0.71,42.58,40.92,42.58,84.04,42.58,128.18,42.58,172.4,42.58,-170.95,88.08,-128.03,88.08,-85.11,88.08,-42.34,88.08,-0.61,88.08,41.12,88.08,84.24,88.08,128.28,88.08,172.4,88.08,-170.95,133.57,-128.03,133.57,-85.11,133.57,-42.27,133.57,0.03,133.57,42.34,133.57,85.36,133.57,128.86,133.57,172.4,133.57,-170.95,179.07,-128.03,179.07,-85.11,179.07,-42.19,179.07,0.73,179.07,43.65,179.07,86.56,179.07,129.48,179.07,172.4,179.07]},{"type":"surface","name":"B_CLOTHES.18","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-154.67,-159.39,-130.05,-159.39,-105.44,-159.39,-80.83,-159.39,-56.22,-159.39,-31.6,-159.39,-6.99,-159.39,17.62,-159.39,42.24,-159.39,-154.67,-127.41,-130.05,-127.41,-105.44,-127.41,-80.83,-127.41,-56.22,-127.41,-31.6,-127.41,-6.99,-127.41,17.62,-127.41,42.24,-127.41,-154.67,-95.43,-130.05,-95.43,-105.44,-95.43,-80.83,-95.43,-56.22,-95.43,-31.6,-95.43,-6.99,-95.43,17.62,-95.43,42.24,-95.43,-154.67,-63.46,-130.05,-63.46,-105.44,-63.46,-80.83,-63.46,-56.22,-63.46,-31.6,-63.46,-6.99,-63.46,17.62,-63.46,42.24,-63.46,-154.67,-31.48,-130.05,-31.48,-105.44,-31.48,-80.83,-31.48,-56.22,-31.48,-31.6,-31.48,-6.99,-31.48,17.62,-31.48,42.24,-31.48,-154.67,0.5,-130.05,0.5,-105.44,0.5,-80.83,0.5,-56.22,0.5,-31.6,0.5,-6.99,0.5,17.62,0.5,42.24,0.5,-154.67,32.47,-130.05,32.47,-105.44,32.47,-80.83,32.47,-56.22,32.47,-31.6,32.47,-6.99,32.47,17.62,32.47,42.24,32.47,-154.67,64.45,-130.05,64.45,-105.44,64.45,-80.83,64.45,-56.22,64.45,-31.6,64.45,-6.99,64.45,17.62,64.45,42.24,64.45,-154.67,96.43,-130.05,96.43,-105.44,96.43,-80.83,96.43,-56.22,96.43,-31.6,96.43,-6.99,96.43,17.62,96.43,42.24,96.43]},{"type":"surface","name":"B_CLOTHES.34","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-133.34,-5.72,-101.37,-5.72,-69.39,-5.72,-37.41,-5.72,-5.43,-5.72,26.54,-5.72,58.52,-5.72,90.5,-5.72,122.48,-5.72,-133.34,16.38,-101.37,16.38,-69.39,16.38,-37.41,16.38,-5.43,16.38,26.54,16.38,58.52,16.38,90.5,16.38,122.48,16.38,-133.34,38.48,-101.37,38.48,-69.39,38.48,-37.41,38.48,-5.43,38.48,26.54,38.48,58.52,38.48,90.5,38.48,122.48,38.48,-133.34,60.58,-101.37,60.58,-69.39,60.58,-37.41,60.58,-5.43,60.58,26.54,60.58,58.52,60.58,90.5,60.58,122.48,60.58,-133.34,82.68,-101.37,82.68,-69.39,82.68,-37.41,82.68,-5.43,82.68,26.54,82.68,58.52,82.68,90.5,82.68,122.48,82.68,-133.34,104.78,-101.37,104.78,-69.39,104.78,-37.41,104.78,-5.43,104.78,26.54,104.78,58.52,104.78,90.5,104.78,122.48,104.78,-133.34,126.88,-101.37,126.88,-69.39,126.88,-37.41,126.88,-5.43,126.88,26.54,126.88,58.52,126.88,90.5,126.88,122.48,126.88,-133.34,148.98,-101.37,148.98,-69.39,148.98,-37.41,148.98,-5.43,148.98,26.54,148.98,58.52,148.98,90.5,148.98,122.48,148.98,-133.34,171.08,-101.37,171.08,-69.39,171.08,-37.41,171.08,-5.43,171.08,26.54,171.08,58.52,171.08,90.5,171.08,122.48,171.08]},{"type":"surface","name":"B_CLOTHES.35","parent":"B_CLOTHES.34","segmentX":8,"segmentY":8,"vertices":[-181.91,-175.57,-137.54,-175.57,-93.18,-175.57,-48.81,-175.57,-4.45,-175.57,39.92,-175.57,84.28,-175.57,128.65,-175.57,173.01,-175.57,-181.91,-131.42,-137.54,-131.42,-93.18,-131.42,-48.81,-131.42,-4.45,-131.42,39.92,-131.42,84.28,-131.42,128.65,-131.42,173.01,-131.42,-181.91,-87.28,-137.54,-87.28,-93.18,-87.28,-48.81,-87.28,-4.45,-87.28,39.92,-87.28,84.28,-87.28,128.65,-87.28,173.01,-87.28,-181.91,-43.13,-137.54,-43.13,-93.18,-43.13,-48.81,-43.13,-4.45,-43.13,39.92,-43.13,84.28,-43.13,128.65,-43.13,173.01,-43.13,-181.91,1.01,-137.54,1.01,-93.18,1.01,-48.81,1.01,-4.45,1.01,39.92,1.01,84.28,1.01,128.65,1.01,173.01,1.01,-181.91,45.16,-137.54,45.16,-93.18,45.16,-48.81,45.16,-4.45,45.16,39.92,45.16,84.28,45.16,128.65,45.16,173.01,45.16,-181.91,89.3,-137.54,89.3,-93.18,89.3,-48.81,89.3,-4.45,89.3,39.92,89.3,84.28,89.3,128.65,89.3,173.01,89.3,-181.91,133.45,-137.54,133.45,-93.18,133.45,-48.81,133.45,-4.45,133.45,39.92,133.45,84.28,133.45,128.65,133.45,173.01,133.45,-181.91,177.6,-137.54,177.6,-93.18,177.6,-48.81,177.6,-4.45,177.6,39.92,177.6,84.28,177.6,128.65,177.6,173.01,177.6]},{"type":"surface","name":"B_CLOTHES.19","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-93.43,-150.46,-72,-150.46,-50.57,-150.46,-29.14,-150.46,-7.72,-150.46,13.71,-150.46,35.14,-150.46,56.57,-150.46,77.99,-150.46,-93.43,-142.03,-72,-142.03,-50.57,-142.03,-29.14,-142.03,-7.72,-142.03,13.71,-142.03,35.14,-142.03,56.57,-142.03,77.99,-142.03,-93.43,-133.61,-72,-133.61,-50.57,-133.61,-29.14,-133.61,-7.72,-133.61,13.71,-133.61,35.14,-133.61,56.57,-133.61,77.99,-133.61,-93.43,-125.19,-72,-125.19,-50.57,-125.19,-29.14,-125.19,-7.72,-125.19,13.71,-125.19,35.14,-125.19,56.57,-125.19,77.99,-125.19,-93.43,-116.76,-72,-116.76,-50.57,-116.76,-29.14,-116.76,-7.72,-116.76,13.71,-116.76,35.14,-116.76,56.57,-116.76,77.99,-116.76,-93.43,-108.34,-72,-108.34,-50.57,-108.34,-29.14,-108.34,-7.72,-108.34,13.71,-108.34,35.14,-108.34,56.57,-108.34,77.99,-108.34,-93.43,-99.92,-72,-99.92,-50.57,-99.92,-29.14,-99.92,-7.72,-99.92,13.71,-99.92,35.14,-99.92,56.57,-99.92,77.99,-99.92,-93.43,-91.49,-72,-91.49,-50.57,-91.49,-29.14,-91.49,-7.72,-91.49,13.71,-91.49,35.14,-91.49,56.57,-91.49,77.99,-91.49,-93.43,-83.07,-72,-83.07,-50.57,-83.07,-29.14,-83.07,-7.72,-83.07,13.71,-83.07,35.14,-83.07,56.57,-83.07,77.99,-83.07]},{"type":"surface","name":"B_CLOTHES.20","parent":"B_CLOTHES.19","segmentX":8,"segmentY":8,"vertices":[-163.31,-157.15,-122.61,-157.15,-81.92,-157.15,-41.22,-157.15,-0.53,-157.15,40.16,-157.15,80.86,-157.15,121.55,-157.15,162.25,-157.15,-163.31,-116.49,-122.61,-116.49,-81.92,-116.49,-41.22,-116.49,-0.53,-116.49,40.16,-116.49,80.86,-116.49,121.55,-116.49,162.25,-116.49,-163.31,-75.84,-122.61,-75.84,-81.92,-75.84,-41.22,-75.84,-0.53,-75.84,40.16,-75.84,80.86,-75.84,121.55,-75.84,162.25,-75.84,-163.31,-35.19,-122.61,-35.19,-81.92,-35.19,-41.22,-35.19,-0.53,-35.19,40.16,-35.19,80.86,-35.19,121.55,-35.19,162.25,-35.19,-163.31,5.46,-122.61,5.46,-81.92,5.46,-41.22,5.46,-0.53,5.46,40.16,5.46,80.86,5.46,121.55,5.46,162.25,5.46,-163.31,46.11,-122.61,46.11,-81.92,46.11,-41.22,46.11,-0.53,46.11,40.16,46.11,80.86,46.11,121.55,46.11,162.25,46.11,-163.31,86.77,-122.61,86.77,-81.92,86.77,-41.22,86.77,-0.53,86.77,40.16,86.77,80.86,86.77,121.55,86.77,162.25,86.77,-163.31,127.42,-122.61,127.42,-81.92,127.42,-41.22,127.42,-0.53,127.42,40.16,127.42,80.86,127.42,121.55,127.42,162.25,127.42,-163.31,168.07,-122.61,168.07,-81.92,168.07,-41.22,168.07,-0.53,168.07,40.16,168.07,80.86,168.07,121.55,168.07,162.25,168.07]},{"type":"surface","name":"B_CLOTHES.21","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-87.05,-156.8,-73.69,-156.8,-60.34,-156.8,-46.98,-156.8,-33.63,-156.8,-20.27,-156.8,-6.92,-156.8,6.44,-156.8,19.79,-156.8,-87.05,-142.85,-73.69,-142.85,-60.34,-142.85,-46.98,-142.85,-33.63,-142.85,-20.27,-142.85,-6.92,-142.85,6.44,-142.85,19.79,-142.85,-87.05,-128.89,-73.69,-128.89,-60.34,-128.89,-46.98,-128.89,-33.63,-128.89,-20.27,-128.89,-6.92,-128.89,6.44,-128.89,19.79,-128.89,-87.05,-114.94,-73.69,-114.94,-60.34,-114.94,-46.98,-114.94,-33.63,-114.94,-20.27,-114.94,-6.92,-114.94,6.44,-114.94,19.79,-114.94,-87.05,-100.99,-73.69,-100.99,-60.34,-100.99,-46.98,-100.99,-33.63,-100.99,-20.27,-100.99,-6.92,-100.99,6.44,-100.99,19.79,-100.99,-87.05,-87.04,-73.69,-87.04,-60.34,-87.04,-46.98,-87.04,-33.63,-87.04,-20.27,-87.04,-6.92,-87.04,6.44,-87.04,19.79,-87.04,-87.05,-73.09,-73.69,-73.09,-60.34,-73.09,-46.98,-73.09,-33.63,-73.09,-20.27,-73.09,-6.92,-73.09,6.44,-73.09,19.79,-73.09,-87.05,-59.13,-73.69,-59.13,-60.34,-59.13,-46.98,-59.13,-33.63,-59.13,-20.27,-59.13,-6.92,-59.13,6.44,-59.13,19.79,-59.13,-87.05,-45.18,-73.69,-45.18,-60.34,-45.18,-46.98,-45.18,-33.63,-45.18,-20.27,-45.18,-6.92,-45.18,6.44,-45.18,19.79,-45.18]},{"type":"surface","name":"B_CLOTHES.22","parent":"B_CLOTHES.21","segmentX":8,"segmentY":8,"vertices":[-160.81,-173.51,-120.55,-173.51,-80.28,-173.51,-40.02,-173.51,0.24,-173.51,40.51,-173.51,80.77,-173.51,121.03,-173.51,161.3,-173.51,-160.81,-130.89,-120.55,-130.89,-80.28,-130.89,-40.02,-130.89,0.24,-130.89,40.51,-130.89,80.77,-130.89,121.03,-130.89,161.3,-130.89,-160.81,-88.27,-120.55,-88.27,-80.28,-88.27,-40.02,-88.27,0.24,-88.27,40.51,-88.27,80.77,-88.27,121.03,-88.27,161.3,-88.27,-160.81,-45.65,-120.55,-45.65,-80.28,-45.65,-40.02,-45.65,0.24,-45.65,40.51,-45.65,80.77,-45.65,121.03,-45.65,161.3,-45.65,-160.81,-3.04,-120.55,-3.04,-80.28,-3.04,-40.02,-3.04,0.24,-3.04,40.51,-3.04,80.77,-3.04,121.03,-3.04,161.3,-3.04,-160.81,39.58,-120.55,39.58,-80.28,39.58,-40.02,39.58,0.24,39.58,40.51,39.58,80.77,39.58,121.03,39.58,161.3,39.58,-160.81,82.2,-120.55,82.2,-80.28,82.2,-40.02,82.2,0.24,82.2,40.51,82.2,80.77,82.2,121.03,82.2,161.3,82.2,-160.81,124.81,-120.55,124.81,-80.28,124.81,-40.02,124.81,0.24,124.81,40.51,124.81,80.77,124.81,121.03,124.81,161.3,124.81,-160.81,167.43,-120.55,167.43,-80.28,167.43,-40.02,167.43,0.24,167.43,40.51,167.43,80.77,167.43,121.03,167.43,161.3,167.43]},{"type":"surface","name":"B_CLOTHES.23","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-36.75,-157.67,-22.96,-157.67,-9.17,-157.67,4.63,-157.67,18.42,-157.67,32.21,-157.67,46.01,-157.67,59.8,-157.67,73.6,-157.67,-36.75,-143.19,-22.96,-143.19,-9.17,-143.19,4.63,-143.19,18.42,-143.19,32.21,-143.19,46.01,-143.19,59.8,-143.19,73.6,-143.19,-36.75,-128.71,-22.96,-128.71,-9.17,-128.71,4.63,-128.71,18.42,-128.71,32.21,-128.71,46.01,-128.71,59.8,-128.71,73.6,-128.71,-36.75,-114.24,-22.96,-114.24,-9.17,-114.24,4.63,-114.24,18.42,-114.24,32.21,-114.24,46.01,-114.24,59.8,-114.24,73.6,-114.24,-36.75,-99.76,-22.96,-99.76,-9.17,-99.76,4.63,-99.76,18.42,-99.76,32.21,-99.76,46.01,-99.76,59.8,-99.76,73.6,-99.76,-36.75,-85.28,-22.96,-85.28,-9.17,-85.28,4.63,-85.28,18.42,-85.28,32.21,-85.28,46.01,-85.28,59.8,-85.28,73.6,-85.28,-36.75,-70.81,-22.96,-70.81,-9.17,-70.81,4.63,-70.81,18.42,-70.81,32.21,-70.81,46.01,-70.81,59.8,-70.81,73.6,-70.81,-36.75,-56.33,-22.96,-56.33,-9.17,-56.33,4.63,-56.33,18.42,-56.33,32.21,-56.33,46.01,-56.33,59.8,-56.33,73.6,-56.33,-36.75,-41.85,-22.96,-41.85,-9.17,-41.85,4.63,-41.85,18.42,-41.85,32.21,-41.85,46.01,-41.85,59.8,-41.85,73.6,-41.85]},{"type":"surface","name":"B_CLOTHES.24","parent":"B_CLOTHES.23","segmentX":8,"segmentY":8,"vertices":[-156.87,-164.06,-118.71,-164.06,-80.56,-164.06,-42.4,-164.06,-4.24,-164.06,33.91,-164.06,72.07,-164.06,110.23,-164.06,148.38,-164.06,-156.87,-121.18,-118.71,-121.18,-80.56,-121.18,-42.4,-121.18,-4.24,-121.18,33.91,-121.18,72.07,-121.18,110.23,-121.18,148.38,-121.18,-156.87,-78.3,-118.71,-78.3,-80.56,-78.3,-42.4,-78.3,-4.24,-78.3,33.91,-78.3,72.07,-78.3,110.23,-78.3,148.38,-78.3,-156.87,-35.42,-118.71,-35.42,-80.56,-35.42,-42.4,-35.42,-4.24,-35.42,33.91,-35.42,72.07,-35.42,110.23,-35.42,148.38,-35.42,-156.87,7.45,-118.71,7.45,-80.56,7.45,-42.4,7.45,-4.24,7.45,33.91,7.45,72.07,7.45,110.23,7.45,148.38,7.45,-156.87,50.33,-118.71,50.33,-80.56,50.33,-42.4,50.33,-4.24,50.33,33.91,50.33,72.07,50.33,110.23,50.33,148.38,50.33,-156.87,93.21,-118.71,93.21,-80.56,93.21,-42.4,93.21,-4.24,93.21,33.91,93.21,72.07,93.21,110.23,93.21,148.38,93.21,-156.87,136.09,-118.71,136.09,-80.56,136.09,-42.4,136.09,-4.24,136.09,33.91,136.09,72.07,136.09,110.23,136.09,148.38,136.09,-156.87,178.97,-118.71,178.97,-80.56,178.97,-42.4,178.97,-4.24,178.97,33.91,178.97,72.07,178.97,110.23,178.97,148.38,178.97]},{"type":"surface","name":"B_CLOTHES.13","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-126.12,-153.96,-96.38,-153.96,-66.63,-153.96,-36.89,-153.96,-7.14,-153.96,22.6,-153.96,52.35,-153.96,82.09,-153.96,111.84,-153.96,-126.12,-122.06,-96.38,-122.06,-66.63,-122.06,-36.89,-122.06,-7.14,-122.06,22.6,-122.06,52.35,-122.06,82.09,-122.06,111.84,-122.06,-126.12,-90.16,-96.38,-90.16,-66.63,-90.16,-36.89,-90.16,-7.14,-90.16,22.6,-90.16,52.35,-90.16,82.09,-90.16,111.84,-90.16,-126.12,-58.26,-96.38,-58.26,-66.63,-58.26,-36.89,-58.26,-7.14,-58.26,22.6,-58.26,52.35,-58.26,82.09,-58.26,111.84,-58.26,-126.12,-26.36,-96.38,-26.36,-66.63,-26.36,-36.89,-26.36,-7.14,-26.36,22.6,-26.36,52.35,-26.36,82.09,-26.36,111.84,-26.36,-126.12,5.54,-96.38,5.54,-66.63,5.54,-36.89,5.54,-7.14,5.54,22.6,5.54,52.35,5.54,82.09,5.54,111.84,5.54,-126.12,37.44,-96.38,37.44,-66.63,37.44,-36.89,37.44,-7.14,37.44,22.6,37.44,52.35,37.44,82.09,37.44,111.84,37.44,-126.12,69.34,-96.38,69.34,-66.63,69.34,-36.89,69.34,-7.14,69.34,22.6,69.34,52.35,69.34,82.09,69.34,111.84,69.34,-126.12,101.24,-96.38,101.24,-66.63,101.24,-36.89,101.24,-7.14,101.24,22.6,101.24,52.35,101.24,82.09,101.24,111.84,101.24]},{"type":"surface","name":"B_CLOTHES.16","parent":"B_CLOTHES.13","segmentX":8,"segmentY":8,"vertices":[-183.16,-186.18,-137.23,-186.18,-91.3,-186.18,-45.37,-186.18,0.56,-186.18,46.5,-186.18,92.43,-186.18,138.36,-186.18,184.29,-186.18,-183.16,-139.66,-137.23,-139.66,-91.3,-139.66,-45.37,-139.66,0.56,-139.66,46.5,-139.66,92.43,-139.66,138.36,-139.66,184.29,-139.66,-183.16,-93.15,-137.23,-93.15,-91.3,-93.15,-45.37,-93.15,0.56,-93.15,46.5,-93.15,92.43,-93.15,138.36,-93.15,184.29,-93.15,-183.16,-46.63,-137.23,-46.63,-91.3,-46.63,-45.37,-46.63,0.56,-46.63,46.5,-46.63,92.43,-46.63,138.36,-46.63,184.29,-46.63,-183.16,-0.11,-137.23,-0.11,-91.3,-0.11,-45.37,-0.11,0.56,-0.11,46.5,-0.11,92.43,-0.11,138.36,-0.11,184.29,-0.11,-183.16,46.4,-137.23,46.4,-91.3,46.4,-45.37,46.4,0.56,46.4,46.5,46.4,92.43,46.4,138.36,46.4,184.29,46.4,-183.16,92.92,-137.23,92.92,-91.3,92.92,-45.37,92.92,0.56,92.92,46.5,92.92,92.43,92.92,138.36,92.92,184.29,92.92,-183.16,139.43,-137.23,139.43,-91.3,139.43,-45.37,139.43,0.56,139.43,46.5,139.43,92.43,139.43,138.36,139.43,184.29,139.43,-183.16,185.95,-137.23,185.95,-91.3,185.95,-45.37,185.95,0.56,185.95,46.5,185.95,92.43,185.95,138.36,185.95,184.29,185.95]},{"length":150,"name":"B_CLOTHES.38","parent":"B_CLOTHES.18","transform":{"x":-106.64,"y":-60.89,"skX":84.7,"skY":84.7}},{"length":150,"name":"B_CLOTHES.39","parent":"B_CLOTHES.38","transform":{"x":291.48,"y":-20.7,"skX":-163.5,"skY":-163.5}},{"length":150,"name":"B_NECK.02","parent":"B_BODY.02","transform":{"x":-8.17,"y":-92.16,"skX":-90,"skY":-90}},{"length":150,"name":"B_CLOTHES.62","parent":"B_CLOTHES.18","transform":{"x":-106.64,"y":-60.89,"skX":84.7,"skY":84.7}},{"length":150,"name":"B_FACE.02","parent":"B_NECK.02","transform":{"x":91.33,"y":-0.17}},{"type":"surface","name":"B_EYE.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[313.89,-214.32,313.89,-189.18,313.89,-164.03,313.89,-138.89,313.89,-113.75,313.89,-88.61,313.89,-63.47,313.89,-38.32,313.89,-13.18,286.99,-214.32,286.99,-189.18,286.99,-164.03,286.99,-138.89,286.99,-113.75,286.99,-88.61,286.99,-63.47,286.99,-38.32,286.99,-13.18,260.08,-214.32,260.08,-189.18,260.08,-164.03,260.08,-138.89,260.08,-113.75,260.08,-88.61,260.08,-63.47,260.08,-38.32,260.08,-13.18,233.18,-214.32,233.18,-189.18,233.18,-164.03,233.18,-138.89,233.18,-113.75,233.18,-88.61,233.18,-63.47,233.18,-38.32,233.18,-13.18,206.28,-214.32,206.28,-189.18,206.28,-164.03,206.28,-138.89,206.28,-113.75,206.28,-88.61,206.28,-63.47,206.28,-38.32,206.28,-13.18,179.37,-214.32,179.37,-189.18,179.37,-164.03,179.37,-138.89,179.37,-113.75,179.37,-88.61,179.37,-63.47,179.37,-38.32,179.37,-13.18,152.47,-214.32,152.47,-189.18,152.47,-164.03,152.47,-138.89,152.47,-113.75,152.47,-88.61,152.47,-63.47,152.47,-38.32,152.47,-13.18,125.56,-214.32,125.56,-189.18,125.56,-164.03,125.56,-138.89,125.56,-113.75,125.56,-88.61,125.56,-63.47,125.56,-38.32,125.56,-13.18,98.66,-214.32,98.66,-189.18,98.66,-164.03,98.66,-138.89,98.66,-113.75,98.66,-88.61,98.66,-63.47,98.66,-38.32,98.66,-13.18]},{"type":"surface","name":"B_EYE.04","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[333.42,-28.13,333.42,-0.2,333.42,27.72,333.42,55.64,333.42,83.56,333.42,111.48,333.42,139.41,333.42,167.33,333.42,195.25,304.22,-28.13,304.22,-0.2,304.22,27.72,304.22,55.64,304.22,83.56,304.22,111.48,304.22,139.41,304.22,167.33,304.22,195.25,275.02,-28.13,275.02,-0.2,275.02,27.72,275.02,55.64,275.02,83.56,275.02,111.48,275.02,139.41,275.02,167.33,275.02,195.25,245.82,-28.13,245.82,-0.2,245.82,27.72,245.82,55.64,245.82,83.56,245.82,111.48,245.82,139.41,245.82,167.33,245.82,195.25,216.61,-28.13,216.61,-0.2,216.61,27.72,216.61,55.64,216.61,83.56,216.61,111.48,216.61,139.41,216.61,167.33,216.61,195.25,187.41,-28.13,187.41,-0.2,187.41,27.72,187.41,55.64,187.41,83.56,187.41,111.48,187.41,139.41,187.41,167.33,187.41,195.25,158.21,-28.13,158.21,-0.2,158.21,27.72,158.21,55.64,158.21,83.56,158.21,111.48,158.21,139.41,158.21,167.33,158.21,195.25,129.01,-28.13,129.01,-0.2,129.01,27.72,129.01,55.64,129.01,83.56,129.01,111.48,129.01,139.41,129.01,167.33,129.01,195.25,99.8,-28.13,99.8,-0.2,99.8,27.72,99.8,55.64,99.8,83.56,99.8,111.48,99.8,139.41,99.8,167.33,99.8,195.25]},{"type":"surface","name":"B_BROW.05","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[401.57,-269.07,401.57,-229.06,401.57,-189.05,401.57,-149.04,401.57,-109.03,401.57,-69.03,401.57,-29.02,401.57,10.99,401.57,51,369.37,-269.07,369.37,-229.06,369.37,-189.05,369.37,-149.04,369.37,-109.03,369.37,-69.03,369.37,-29.02,369.37,10.99,369.37,51,337.16,-269.07,337.16,-229.06,337.16,-189.05,337.16,-149.04,337.16,-109.03,337.16,-69.03,337.16,-29.02,337.16,10.99,337.16,51,304.96,-269.07,304.96,-229.06,304.96,-189.05,304.96,-149.04,304.96,-109.03,304.96,-69.03,304.96,-29.02,304.96,10.99,304.96,51,272.75,-269.07,272.75,-229.06,272.75,-189.05,272.75,-149.04,272.75,-109.03,272.75,-69.03,272.75,-29.02,272.75,10.99,272.75,51,240.55,-269.07,240.55,-229.06,240.55,-189.05,240.55,-149.04,240.55,-109.03,240.55,-69.03,240.55,-29.02,240.55,10.99,240.55,51,208.35,-269.07,208.35,-229.06,208.35,-189.05,208.35,-149.04,208.35,-109.03,208.35,-69.03,208.35,-29.02,208.35,10.99,208.35,51,176.14,-269.07,176.14,-229.06,176.14,-189.05,176.14,-149.04,176.14,-109.03,176.14,-69.03,176.14,-29.02,176.14,10.99,176.14,51,143.94,-269.07,143.94,-229.06,143.94,-189.05,143.94,-149.04,143.94,-109.03,143.94,-69.03,143.94,-29.02,143.94,10.99,143.94,51]},{"type":"surface","name":"B_BROW.06","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[412.5,-68.36,412.5,-31.02,412.5,6.32,412.5,43.67,412.5,81.01,412.5,118.35,412.5,155.69,412.5,193.03,412.5,230.37,380.56,-68.36,380.56,-31.02,380.56,6.32,380.56,43.67,380.56,81.01,380.56,118.35,380.56,155.69,380.56,193.03,380.56,230.37,348.62,-68.36,348.62,-31.02,348.62,6.32,348.62,43.67,348.62,81.01,348.62,118.35,348.62,155.69,348.62,193.03,348.62,230.37,316.68,-68.36,316.68,-31.02,316.68,6.32,316.68,43.67,316.68,81.01,316.68,118.35,316.68,155.69,316.68,193.03,316.68,230.37,284.74,-68.36,284.74,-31.02,284.74,6.32,284.74,43.67,284.74,81.01,284.74,118.35,284.74,155.69,284.74,193.03,284.74,230.37,252.8,-68.36,252.8,-31.02,252.8,6.32,252.8,43.67,252.8,81.01,252.8,118.35,252.8,155.69,252.8,193.03,252.8,230.37,220.86,-68.36,220.86,-31.02,220.86,6.32,220.86,43.67,220.86,81.01,220.86,118.35,220.86,155.69,220.86,193.03,220.86,230.37,188.92,-68.36,188.92,-31.02,188.92,6.32,188.92,43.67,188.92,81.01,188.92,118.35,188.92,155.69,188.92,193.03,188.92,230.37,156.98,-68.36,156.98,-31.02,156.98,6.32,156.98,43.67,156.98,81.01,156.98,118.35,156.98,155.69,156.98,193.03,156.98,230.37]},{"type":"surface","name":"B_MOUTH.03","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[156.33,-132.7,156.33,-101.46,156.33,-70.21,156.33,-38.96,156.33,-7.71,156.33,23.53,156.33,54.78,156.33,86.03,156.33,117.28,132.61,-132.7,132.61,-101.46,132.61,-70.21,132.61,-38.96,132.61,-7.71,132.61,23.53,132.61,54.78,132.61,86.03,132.61,117.28,108.88,-132.7,108.88,-101.46,108.88,-70.21,108.88,-38.96,108.88,-7.71,108.88,23.53,108.88,54.78,108.88,86.03,108.88,117.28,85.16,-132.7,85.16,-101.46,85.16,-70.21,85.16,-38.96,85.16,-7.71,85.16,23.53,85.16,54.78,85.16,86.03,85.16,117.28,61.43,-132.7,61.43,-101.46,61.43,-70.21,61.43,-38.96,61.43,-7.71,61.43,23.53,61.43,54.78,61.43,86.03,61.43,117.28,37.71,-132.7,37.71,-101.46,37.71,-70.21,37.71,-38.96,37.71,-7.71,37.71,23.53,37.71,54.78,37.71,86.03,37.71,117.28,13.98,-132.7,13.98,-101.46,13.98,-70.21,13.98,-38.96,13.98,-7.71,13.98,23.53,13.98,54.78,13.98,86.03,13.98,117.28,-9.74,-132.7,-9.74,-101.46,-9.74,-70.21,-9.74,-38.96,-9.74,-7.71,-9.74,23.53,-9.74,54.78,-9.74,86.03,-9.74,117.28,-33.47,-132.7,-33.47,-101.46,-33.47,-70.21,-33.47,-38.96,-33.47,-7.71,-33.47,23.53,-33.47,54.78,-33.47,86.03,-33.47,117.28]},{"type":"surface","name":"B_NOSE.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[141.96,-33.67,141.96,-29.17,141.96,-24.67,141.96,-20.17,141.96,-15.67,141.96,-11.17,141.96,-6.67,141.96,-2.17,141.96,2.33,137.36,-33.67,137.36,-29.17,137.36,-24.67,137.36,-20.17,137.36,-15.67,137.36,-11.17,137.36,-6.67,137.36,-2.17,137.36,2.33,132.77,-33.67,132.77,-29.17,132.77,-24.67,132.77,-20.17,132.77,-15.67,132.77,-11.17,132.77,-6.67,132.77,-2.17,132.77,2.33,128.18,-33.67,128.18,-29.17,128.18,-24.67,128.18,-20.17,128.18,-15.67,128.18,-11.17,128.18,-6.67,128.18,-2.17,128.18,2.33,123.58,-33.67,123.58,-29.17,123.58,-24.67,123.58,-20.17,123.58,-15.67,123.58,-11.17,123.58,-6.67,123.58,-2.17,123.58,2.33,118.99,-33.67,118.99,-29.17,118.99,-24.67,118.99,-20.17,118.99,-15.67,118.99,-11.17,118.99,-6.67,118.99,-2.17,118.99,2.33,114.4,-33.67,114.4,-29.17,114.4,-24.67,114.4,-20.17,114.4,-15.67,114.4,-11.17,114.4,-6.67,114.4,-2.17,114.4,2.33,109.8,-33.67,109.8,-29.17,109.8,-24.67,109.8,-20.17,109.8,-15.67,109.8,-11.17,109.8,-6.67,109.8,-2.17,109.8,2.33,105.21,-33.67,105.21,-29.17,105.21,-24.67,105.21,-20.17,105.21,-15.67,105.21,-11.17,105.21,-6.67,105.21,-2.17,105.21,2.33]},{"type":"surface","name":"B_EAR.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[252.74,89.02,252.74,106.52,252.74,124.02,252.74,141.52,252.74,159.03,252.74,176.53,252.74,194.03,252.74,211.53,252.74,229.04,229.88,89.02,229.88,106.52,229.88,124.02,229.88,141.52,229.88,159.03,229.88,176.53,229.88,194.03,229.88,211.53,229.88,229.04,207.03,89.02,207.03,106.52,207.03,124.02,207.03,141.52,207.03,159.03,207.03,176.53,207.03,194.03,207.03,211.53,207.03,229.04,184.17,89.02,184.17,106.52,184.17,124.02,184.17,141.52,184.17,159.03,184.17,176.53,184.17,194.03,184.17,211.53,184.17,229.04,161.31,89.02,161.31,106.52,161.31,124.02,161.31,141.52,161.31,159.03,161.31,176.53,161.31,194.03,161.31,211.53,161.31,229.04,138.45,89.02,138.45,106.52,138.45,124.02,138.45,141.52,138.45,159.03,138.45,176.53,138.45,194.03,138.45,211.53,138.45,229.04,115.6,89.02,115.6,106.52,115.6,124.02,115.6,141.52,115.6,159.03,115.6,176.53,115.6,194.03,115.6,211.53,115.6,229.04,92.74,89.02,92.74,106.52,92.74,124.02,92.74,141.52,92.74,159.03,92.74,176.53,92.74,194.03,92.74,211.53,92.74,229.04,69.88,89.02,69.88,106.52,69.88,124.02,69.88,141.52,69.88,159.03,69.88,176.53,69.88,194.03,69.88,211.53,69.88,229.04]},{"type":"surface","name":"B_EAR.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[230.68,-240.08,230.68,-224.94,230.68,-209.8,230.68,-194.65,230.68,-179.51,230.68,-164.37,230.68,-149.22,230.68,-134.08,230.68,-118.94,209.42,-240.08,209.42,-224.94,209.42,-209.8,209.42,-194.65,209.42,-179.51,209.42,-164.37,209.42,-149.22,209.42,-134.08,209.42,-118.94,188.16,-240.08,188.16,-224.94,188.16,-209.8,188.16,-194.65,188.16,-179.51,188.16,-164.37,188.16,-149.22,188.16,-134.08,188.16,-118.94,166.9,-240.08,166.9,-224.94,166.9,-209.8,166.9,-194.65,166.9,-179.51,166.9,-164.37,166.9,-149.22,166.9,-134.08,166.9,-118.94,145.64,-240.08,145.64,-224.94,145.64,-209.8,145.64,-194.65,145.64,-179.51,145.64,-164.37,145.64,-149.22,145.64,-134.08,145.64,-118.94,124.38,-240.08,124.38,-224.94,124.38,-209.8,124.38,-194.65,124.38,-179.51,124.38,-164.37,124.38,-149.22,124.38,-134.08,124.38,-118.94,103.12,-240.08,103.12,-224.94,103.12,-209.8,103.12,-194.65,103.12,-179.51,103.12,-164.37,103.12,-149.22,103.12,-134.08,103.12,-118.94,81.86,-240.08,81.86,-224.94,81.86,-209.8,81.86,-194.65,81.86,-179.51,81.86,-164.37,81.86,-149.22,81.86,-134.08,81.86,-118.94,60.6,-240.08,60.6,-224.94,60.6,-209.8,60.6,-194.65,60.6,-179.51,60.6,-164.37,60.6,-149.22,60.6,-134.08,60.6,-118.94]},{"type":"surface","name":"B_HAIR_FRONT.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[578.23,-284.44,578.23,-217.34,578.23,-150.23,578.23,-83.12,578.23,-16.02,578.23,51.09,578.23,118.2,578.23,185.3,578.23,252.41,520.55,-284.44,520.55,-217.34,520.55,-150.23,520.55,-83.12,520.55,-16.02,520.55,51.09,520.55,118.2,520.55,185.3,520.55,252.41,462.87,-284.44,462.87,-217.34,462.87,-150.23,462.87,-83.12,462.87,-16.02,462.87,51.09,462.87,118.2,462.87,185.3,462.87,252.41,405.18,-284.44,405.18,-217.34,405.18,-150.23,405.18,-83.12,405.18,-16.02,405.18,51.09,405.18,118.2,405.18,185.3,405.18,252.41,347.5,-284.44,347.5,-217.34,347.5,-150.23,347.5,-83.12,347.5,-16.02,347.5,51.09,347.5,118.2,347.5,185.3,347.5,252.41,289.82,-284.44,289.82,-217.34,289.82,-150.23,289.82,-83.12,289.82,-16.02,289.82,51.09,289.82,118.2,289.82,185.3,289.82,252.41,232.13,-284.44,232.13,-217.34,232.13,-150.23,232.13,-83.12,232.13,-16.02,232.13,51.09,232.13,118.2,232.13,185.3,232.13,252.41,174.45,-284.44,174.45,-217.34,174.45,-150.23,174.45,-83.12,174.45,-16.02,174.45,51.09,174.45,118.2,174.45,185.3,174.45,252.41,116.77,-284.44,116.77,-217.34,116.77,-150.23,116.77,-83.12,116.77,-16.02,116.77,51.09,116.77,118.2,116.77,185.3,116.77,252.41]},{"type":"surface","name":"B_HAIR_SIDE.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[531.83,-285.13,531.83,-254.06,531.83,-222.99,531.83,-191.91,531.83,-160.84,531.83,-129.77,531.83,-98.7,531.83,-67.63,531.83,-36.55,449.05,-285.13,449.05,-254.06,449.05,-222.99,449.05,-191.91,449.05,-160.84,449.05,-129.77,449.05,-98.7,449.05,-67.63,449.05,-36.55,366.27,-285.13,366.27,-254.06,366.27,-222.99,366.27,-191.91,366.27,-160.84,366.27,-129.77,366.27,-98.7,366.27,-67.63,366.27,-36.55,283.5,-285.13,283.5,-254.06,283.5,-222.99,283.5,-191.91,283.5,-160.84,283.5,-129.77,283.5,-98.7,283.5,-67.63,283.5,-36.55,200.72,-285.13,200.72,-254.06,200.72,-222.99,200.72,-191.91,200.72,-160.84,200.72,-129.77,200.72,-98.7,200.72,-67.63,200.72,-36.55,117.94,-285.13,117.94,-254.06,117.94,-222.99,117.94,-191.91,117.94,-160.84,117.94,-129.77,117.94,-98.7,117.94,-67.63,117.94,-36.55,35.17,-285.13,35.17,-254.06,35.17,-222.99,35.17,-191.91,35.17,-160.84,35.17,-129.77,35.17,-98.7,35.17,-67.63,35.17,-36.55,-47.61,-285.13,-47.61,-254.06,-47.61,-222.99,-47.61,-191.91,-47.61,-160.84,-47.61,-129.77,-47.61,-98.7,-47.61,-67.63,-47.61,-36.55,-130.39,-285.13,-130.39,-254.06,-130.39,-222.99,-130.39,-191.91,-130.39,-160.84,-130.39,-129.77,-130.39,-98.7,-130.39,-67.63,-130.39,-36.55]},{"type":"surface","name":"B_HAIR_SIDE.04","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[523.74,26.87,523.74,54.63,523.74,82.39,523.74,110.15,523.74,137.91,523.74,165.67,523.74,193.43,523.74,221.18,523.74,248.94,444.15,26.87,444.15,54.63,444.15,82.39,444.15,110.15,444.15,137.91,444.15,165.67,444.15,193.43,444.15,221.18,444.15,248.94,364.55,26.87,364.55,54.63,364.55,82.39,364.55,110.15,364.55,137.91,364.55,165.67,364.55,193.43,364.55,221.18,364.55,248.94,284.96,26.87,284.96,54.63,284.96,82.39,284.96,110.15,284.96,137.91,284.96,165.67,284.96,193.43,284.96,221.18,284.96,248.94,205.36,26.87,205.36,54.63,205.36,82.39,205.36,110.15,205.36,137.91,205.36,165.67,205.36,193.43,205.36,221.18,205.36,248.94,125.77,26.87,125.77,54.63,125.77,82.39,125.77,110.15,125.77,137.91,125.77,165.67,125.77,193.43,125.77,221.18,125.77,248.94,46.18,26.87,46.18,54.63,46.18,82.39,46.18,110.15,46.18,137.91,46.18,165.67,46.18,193.43,46.18,221.18,46.18,248.94,-33.42,26.87,-33.42,54.63,-33.42,82.39,-33.42,110.15,-33.42,137.91,-33.42,165.67,-33.42,193.43,-33.42,221.18,-33.42,248.94,-113.01,26.87,-113.01,54.63,-113.01,82.39,-113.01,110.15,-113.01,137.91,-113.01,165.67,-113.01,193.43,-113.01,221.18,-113.01,248.94]},{"type":"surface","name":"B_HAIR_SIDE.03","parent":"B_HAIR_SIDE.04","segmentX":8,"segmentY":8,"vertices":[-179,-192.14,-133.67,-192.14,-88.34,-192.14,-43,-192.14,2.33,-192.14,47.66,-192.14,92.99,-192.14,138.33,-192.14,183.66,-192.14,-179,-144.38,-133.67,-144.38,-88.34,-144.38,-43.01,-144.38,2.32,-144.38,47.66,-144.38,92.99,-144.38,138.32,-144.38,183.65,-144.38,-179.01,-96.62,-133.68,-96.62,-88.35,-96.62,-43.01,-96.62,2.32,-96.61,47.65,-96.61,92.98,-96.61,138.32,-96.61,183.65,-96.61,-179.01,-48.85,-133.68,-48.85,-88.35,-48.85,-43.02,-48.85,2.31,-48.85,47.65,-48.85,92.98,-48.85,138.31,-48.85,183.64,-48.85,-179.02,-1.09,-133.69,-1.09,-88.35,-1.09,-43.02,-1.09,2.31,-1.09,47.64,-1.09,92.97,-1.09,138.31,-1.09,183.64,-1.09,-179.02,46.67,-133.69,46.67,-88.36,46.68,-43.03,46.68,2.31,46.68,47.64,46.68,92.97,46.68,138.3,46.68,183.63,46.68,-179.03,94.44,-133.7,94.44,-88.36,94.44,-43.03,94.44,2.3,94.44,47.63,94.44,92.96,94.44,138.3,94.44,183.63,94.44,-179.03,142.2,-133.7,142.2,-88.37,142.2,-43.04,142.2,2.3,142.2,47.63,142.2,92.96,142.2,138.29,142.21,183.62,142.21,-179.04,189.97,-133.71,189.97,-88.37,189.97,-43.04,189.97,2.29,189.97,47.62,189.97,92.95,189.97,138.29,189.97,183.62,189.97]},{"type":"surface","name":"B_HAIR_SIDE.06","parent":"B_HAIR_SIDE.03","segmentX":8,"segmentY":8,"vertices":[-177.88,-194.08,-133.49,-194.08,-89.1,-194.08,-44.71,-194.08,-0.32,-194.08,44.06,-194.08,88.45,-194.08,132.84,-194.08,177.23,-194.08,-177.88,-145.91,-133.49,-145.91,-89.1,-145.91,-44.71,-145.91,-0.32,-145.91,44.06,-145.91,88.45,-145.91,132.84,-145.91,177.23,-145.91,-177.88,-97.75,-133.49,-97.75,-89.1,-97.75,-44.71,-97.75,-0.32,-97.75,44.06,-97.75,88.45,-97.75,132.84,-97.75,177.23,-97.75,-177.88,-49.59,-133.49,-49.59,-89.1,-49.59,-44.71,-49.59,-0.32,-49.59,44.06,-49.59,88.45,-49.59,132.84,-49.59,177.23,-49.59,-177.88,-1.42,-133.49,-1.42,-89.1,-1.42,-44.71,-1.42,-0.32,-1.42,44.06,-1.42,88.45,-1.42,132.84,-1.42,177.23,-1.42,-177.88,46.74,-133.49,46.74,-89.1,46.74,-44.71,46.74,-0.32,46.74,44.06,46.74,88.45,46.74,132.84,46.74,177.23,46.74,-177.88,94.9,-133.49,94.9,-89.1,94.9,-44.71,94.9,-0.32,94.9,44.06,94.9,88.45,94.9,132.84,94.9,177.23,94.9,-177.88,143.07,-133.49,143.07,-89.1,143.07,-44.71,143.07,-0.32,143.07,44.06,143.07,88.45,143.07,132.84,143.07,177.23,143.07,-177.88,191.23,-133.49,191.23,-89.1,191.23,-44.71,191.23,-0.32,191.23,44.06,191.23,88.45,191.23,132.84,191.23,177.23,191.23]},{"type":"surface","name":"B_HAIR_TWIN.04","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[575.33,-12.52,575.33,56.5,575.33,125.52,575.33,194.55,575.33,263.57,575.33,332.6,575.33,401.62,575.33,470.64,575.33,539.67,457.83,-12.52,457.83,56.5,457.83,125.52,457.83,194.55,457.83,263.57,457.83,332.6,457.83,401.62,457.83,470.64,457.83,539.67,340.33,-12.52,340.33,56.5,340.33,125.52,340.33,194.55,340.33,263.57,340.33,332.6,340.33,401.62,340.33,470.64,340.33,539.67,222.83,-12.52,222.83,56.5,222.83,125.52,222.83,194.55,222.83,263.57,222.83,332.6,222.83,401.62,222.83,470.64,222.83,539.67,105.33,-12.52,105.33,56.5,105.33,125.52,105.33,194.55,105.33,263.57,105.33,332.6,105.33,401.62,105.33,470.64,105.33,539.67,-12.17,-12.52,-12.17,56.5,-12.17,125.52,-12.17,194.55,-12.17,263.57,-12.17,332.6,-12.17,401.62,-12.17,470.64,-12.17,539.67,-129.67,-12.52,-129.67,56.5,-129.67,125.52,-129.67,194.55,-129.67,263.57,-129.67,332.6,-129.67,401.62,-129.67,470.64,-129.67,539.67,-247.17,-12.52,-247.17,56.5,-247.17,125.52,-247.17,194.55,-247.17,263.57,-247.17,332.6,-247.17,401.62,-247.17,470.64,-247.17,539.67,-364.67,-12.52,-364.67,56.5,-364.67,125.52,-364.67,194.55,-364.67,263.57,-364.67,332.6,-364.67,401.62,-364.67,470.64,-364.67,539.67]},{"type":"surface","name":"B_HAIR_TWIN.06","parent":"B_HAIR_TWIN.04","segmentX":8,"segmentY":8,"vertices":[-163.5,-190.48,-121.09,-190.48,-78.68,-190.48,-36.26,-190.48,6.15,-190.48,48.56,-190.48,90.98,-190.48,133.39,-190.48,175.8,-190.48,-163.5,-143.8,-121.09,-143.8,-78.68,-143.8,-36.26,-143.8,6.15,-143.8,48.56,-143.8,90.98,-143.8,133.39,-143.8,175.8,-143.8,-163.5,-97.13,-121.09,-97.13,-78.68,-97.13,-36.26,-97.13,6.15,-97.13,48.56,-97.13,90.98,-97.13,133.39,-97.13,175.8,-97.13,-163.5,-50.45,-121.09,-50.45,-78.68,-50.45,-36.26,-50.45,6.15,-50.45,48.56,-50.45,90.98,-50.45,133.39,-50.45,175.8,-50.45,-163.5,-3.77,-121.09,-3.77,-78.68,-3.77,-36.26,-3.77,6.15,-3.77,48.56,-3.77,90.98,-3.77,133.39,-3.77,175.8,-3.77,-163.5,42.91,-121.09,42.91,-78.68,42.91,-36.26,42.91,6.15,42.91,48.56,42.91,90.98,42.91,133.39,42.91,175.8,42.91,-163.5,89.59,-121.09,89.59,-78.68,89.59,-36.26,89.59,6.15,89.59,48.56,89.59,90.98,89.59,133.39,89.59,175.8,89.59,-163.5,136.27,-121.09,136.27,-78.68,136.27,-36.26,136.27,6.15,136.27,48.56,136.27,90.98,136.27,133.39,136.27,175.8,136.27,-163.5,182.95,-121.09,182.95,-78.68,182.95,-36.26,182.95,6.15,182.95,48.56,182.95,90.98,182.95,133.39,182.95,175.8,182.95]},{"type":"surface","name":"B_HAIR_TWIN.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[553.74,-528.52,553.74,-463.93,553.74,-399.35,553.74,-334.76,553.74,-270.18,553.74,-205.59,553.74,-141,553.74,-76.42,553.74,-11.83,436.33,-528.52,436.33,-463.93,436.33,-399.35,436.33,-334.76,436.33,-270.18,436.33,-205.59,436.33,-141,436.33,-76.42,436.33,-11.83,318.91,-528.52,318.91,-463.93,318.91,-399.35,318.91,-334.76,318.91,-270.18,318.91,-205.59,318.91,-141,318.91,-76.42,318.91,-11.83,201.5,-528.52,201.5,-463.93,201.5,-399.35,201.5,-334.76,201.5,-270.18,201.5,-205.59,201.5,-141,201.5,-76.42,201.5,-11.83,84.09,-528.52,84.09,-463.93,84.09,-399.35,84.09,-334.76,84.09,-270.18,84.09,-205.59,84.09,-141,84.09,-76.42,84.09,-11.83,-33.32,-528.52,-33.32,-463.93,-33.32,-399.35,-33.32,-334.76,-33.32,-270.18,-33.32,-205.59,-33.32,-141,-33.32,-76.42,-33.32,-11.83,-150.74,-528.52,-150.74,-463.93,-150.74,-399.35,-150.74,-334.76,-150.74,-270.18,-150.74,-205.59,-150.74,-141,-150.74,-76.42,-150.74,-11.83,-268.15,-528.52,-268.15,-463.93,-268.15,-399.35,-268.15,-334.76,-268.15,-270.18,-268.15,-205.59,-268.15,-141,-268.15,-76.42,-268.15,-11.83,-385.56,-528.52,-385.56,-463.93,-385.56,-399.35,-385.56,-334.76,-385.56,-270.18,-385.56,-205.59,-385.56,-141,-385.56,-76.42,-385.56,-11.83]},{"type":"surface","name":"B_HAIR_TWIN.03","parent":"B_HAIR_TWIN.01","segmentX":8,"segmentY":8,"vertices":[-176.96,-189.63,-133.15,-189.63,-89.35,-189.63,-45.54,-189.63,-1.74,-189.63,42.06,-189.63,85.87,-189.63,129.67,-189.63,173.48,-189.63,-176.96,-142.61,-133.15,-142.61,-89.35,-142.61,-45.54,-142.61,-1.74,-142.61,42.06,-142.61,85.87,-142.61,129.67,-142.61,173.48,-142.61,-176.96,-95.59,-133.15,-95.59,-89.35,-95.59,-45.54,-95.59,-1.74,-95.59,42.06,-95.59,85.87,-95.59,129.67,-95.59,173.48,-95.59,-176.96,-48.56,-133.15,-48.56,-89.35,-48.56,-45.54,-48.56,-1.74,-48.56,42.06,-48.56,85.87,-48.56,129.67,-48.56,173.48,-48.56,-176.96,-1.54,-133.15,-1.54,-89.35,-1.54,-45.54,-1.54,-1.74,-1.54,42.06,-1.54,85.87,-1.54,129.67,-1.54,173.48,-1.54,-176.96,45.49,-133.64,46.83,-89.78,46.68,-45.71,45.93,-1.74,45.49,42.06,45.49,85.87,45.49,129.67,45.49,173.48,45.49,-176.96,92.51,-134.13,95.2,-90.22,94.91,-45.87,93.41,-1.74,92.51,42.06,92.51,85.87,92.51,129.67,92.51,173.48,92.51,-176.96,139.53,-134.62,143.58,-90.65,143.13,-46.03,140.88,-1.74,139.53,42.06,139.53,85.87,139.53,129.67,139.53,173.48,139.53,-176.96,186.56,-135.11,191.95,-91.09,191.35,-46.2,188.35,-1.74,186.56,42.06,186.56,85.87,186.56,129.67,186.56,173.48,186.56]},{"type":"surface","name":"B_HAIR_TWIN.15","parent":"B_HAIR_TWIN.03","segmentX":8,"segmentY":8,"vertices":[-182.1,-191.51,-137.34,-191.51,-92.57,-191.51,-47.81,-191.51,-3.05,-191.51,41.72,-191.51,86.48,-191.51,131.25,-191.51,176.01,-191.51,-182.1,-143.74,-137.34,-143.74,-92.57,-143.74,-47.81,-143.74,-3.05,-143.74,41.72,-143.74,86.48,-143.74,131.25,-143.74,176.01,-143.74,-182.1,-95.98,-137.34,-95.98,-92.57,-95.98,-47.81,-95.98,-3.05,-95.98,41.72,-95.98,86.48,-95.98,131.25,-95.98,176.01,-95.98,-182.1,-48.21,-137.34,-48.21,-92.57,-48.21,-47.81,-48.21,-3.05,-48.21,41.72,-48.21,86.48,-48.21,131.25,-48.21,176.01,-48.21,-182.1,-0.44,-137.34,-0.44,-92.57,-0.44,-47.81,-0.44,-3.05,-0.44,41.72,-0.44,86.48,-0.44,131.25,-0.44,176.01,-0.44,-182.1,47.33,-137.34,47.33,-92.57,47.33,-47.81,47.33,-3.05,47.33,41.72,47.33,86.48,47.33,131.25,47.33,176.01,47.33,-182.1,95.1,-137.34,95.1,-92.57,95.1,-47.81,95.1,-3.05,95.1,41.72,95.1,86.48,95.1,131.25,95.1,176.01,95.1,-182.1,142.87,-137.34,142.87,-92.57,142.87,-47.81,142.87,-3.05,142.87,41.72,142.87,86.48,142.87,131.25,142.87,176.01,142.87,-182.1,190.63,-137.34,190.63,-92.57,190.63,-47.81,190.63,-3.05,190.63,41.72,190.63,86.48,190.63,131.25,190.63,176.01,190.63]},{"type":"surface","name":"B_HAIR_BACK.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[622.07,-345.67,622.07,-258.73,622.07,-171.79,622.07,-84.85,622.07,2.09,622.07,89.04,622.07,175.98,622.07,262.92,622.07,349.86,523.94,-345.67,523.94,-258.73,523.94,-171.79,523.94,-84.85,523.94,2.09,523.94,89.04,523.94,175.98,523.94,262.92,523.94,349.86,425.82,-345.67,425.82,-258.73,425.82,-171.79,425.82,-84.85,425.82,2.09,425.82,89.04,425.82,175.98,425.82,262.92,425.82,349.86,327.7,-345.67,327.7,-258.73,327.7,-171.79,327.7,-84.85,327.7,2.09,327.7,89.04,327.7,175.98,327.7,262.92,327.7,349.86,229.57,-345.67,229.57,-258.73,229.57,-171.79,229.57,-84.85,229.57,2.09,229.57,89.04,229.57,175.98,229.57,262.92,229.57,349.86,131.45,-345.67,131.45,-258.73,131.45,-171.79,131.45,-84.85,131.45,2.09,131.45,89.04,131.45,175.98,131.45,262.92,131.45,349.86,33.33,-345.67,33.33,-258.73,33.33,-171.79,33.33,-84.85,33.33,2.09,33.33,89.04,33.33,175.98,33.33,262.92,33.33,349.86,-64.79,-345.67,-64.79,-258.73,-64.79,-171.79,-64.79,-84.85,-64.79,2.09,-64.79,89.04,-64.79,175.98,-64.79,262.92,-64.79,349.86,-162.92,-345.67,-162.92,-258.73,-162.92,-171.79,-162.92,-84.85,-162.92,2.09,-162.92,89.04,-162.92,175.98,-162.92,262.92,-162.92,349.86]},{"length":150,"name":"B_CLOTHES.07","parent":"B_CLOTHES.14","transform":{"x":91.1,"y":-76.67,"skX":85.4,"skY":85.4}},{"length":150,"name":"B_CLOTHES.31","parent":"B_CLOTHES.18","transform":{"x":-106.87,"y":-60.91,"skX":93.9,"skY":93.9}},{"length":150,"name":"B_CLOTHES.32","parent":"B_CLOTHES.31","transform":{"x":355.72,"y":-16.23,"skX":-79.2,"skY":-79.2}},{"length":150,"name":"B_CLOTHES.33","parent":"B_CLOTHES.32","transform":{"x":265.21,"y":2.1,"skX":16.7,"skY":16.7}},{"type":"surface","name":"B_HAND.09","parent":"B_CLOTHES.33","segmentX":8,"segmentY":8,"vertices":[-117.14,-53.77,-80.32,-67.47,-43.49,-81.16,-6.67,-94.86,30.16,-108.55,66.98,-122.25,103.81,-135.94,140.63,-149.64,177.46,-163.33,-107.52,-27.9,-70.7,-41.6,-33.87,-55.29,2.95,-68.99,39.78,-82.68,76.6,-96.38,113.43,-110.07,150.25,-123.77,187.08,-137.46,-97.9,-2.03,-61.08,-15.73,-24.25,-29.42,12.57,-43.12,49.4,-56.81,86.23,-70.51,123.05,-84.2,159.88,-97.9,196.7,-111.59,-88.28,23.84,-51.45,10.14,-14.63,-3.55,22.2,-17.25,59.02,-30.94,95.85,-44.64,132.67,-58.33,169.5,-72.03,206.32,-85.72,-78.66,49.71,-41.83,36.01,-5.01,22.32,31.82,8.62,68.64,-5.07,105.47,-18.77,142.29,-32.46,179.12,-46.16,215.94,-59.85,-69.04,75.58,-32.21,61.88,4.61,48.19,41.44,34.49,78.26,20.8,115.09,7.1,151.91,-6.59,188.74,-20.29,225.56,-33.98,-59.42,101.45,-22.59,87.75,14.23,74.06,51.06,60.36,87.88,46.67,124.71,32.97,161.53,19.28,198.36,5.58,235.18,-8.11,-49.8,127.32,-12.97,113.62,23.85,99.93,60.68,86.23,97.5,72.54,134.33,58.84,171.15,45.15,207.98,31.45,244.81,17.76,-40.18,153.19,-3.35,139.49,33.48,125.8,70.3,112.1,107.13,98.41,143.95,84.71,180.78,71.02,217.6,57.32,254.43,43.63]},{"type":"surface","name":"B_HAND.10","parent":"B_HAND.09","segmentX":8,"segmentY":8,"vertices":[-178.26,-181.8,-134.31,-181.8,-90.37,-181.8,-46.42,-181.8,-2.47,-181.8,41.47,-181.8,85.42,-181.8,129.37,-181.8,173.31,-181.8,-178.26,-137.49,-134.31,-137.49,-90.37,-137.49,-46.42,-137.49,-2.47,-137.49,41.47,-137.49,85.42,-137.49,129.37,-137.49,173.31,-137.49,-178.26,-93.18,-134.31,-93.18,-90.37,-93.18,-46.42,-93.18,-2.47,-93.18,41.47,-93.18,85.42,-93.18,129.37,-93.18,173.31,-93.18,-178.26,-48.88,-134.31,-48.88,-90.37,-48.88,-46.42,-48.88,-2.47,-48.88,41.47,-48.88,85.42,-48.88,129.37,-48.88,173.31,-48.88,-178.26,-4.57,-134.31,-4.57,-90.37,-4.57,-46.42,-4.57,-2.47,-4.57,41.47,-4.57,85.42,-4.57,129.37,-4.57,173.31,-4.57,-178.26,39.74,-134.31,39.74,-90.37,39.74,-45.15,38.83,0.07,37.93,42.75,38.83,85.42,39.74,129.37,39.74,173.31,39.74,-178.26,84.05,-134.31,84.05,-90.37,84.05,-43.87,82.24,2.62,80.43,44.02,82.24,85.42,84.05,129.37,84.05,173.31,84.05,-178.26,128.36,-134.31,128.36,-90.37,128.36,-44.83,127.22,0.71,126.09,43.06,127.22,85.42,128.36,129.37,128.36,173.31,128.36,-178.26,172.66,-134.31,172.66,-90.37,172.66,-46.42,172.66,-2.47,172.66,41.47,172.66,85.42,172.66,129.37,172.66,173.31,172.66]},{"type":"surface","name":"B_HAND.12","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-83.11,2.27,-56.26,2.28,-29.42,2.3,-2.56,2.3,24.32,2.3,51.2,2.29,78.09,2.28,104.96,2.27,131.83,2.27,-83.13,23.08,-56.29,23.1,-29.44,23.13,-2.58,23.14,24.29,23.13,51.15,23.13,78.04,23.1,104.95,23.08,131.83,23.06,-83.16,43.89,-56.3,43.92,-29.42,43.94,-2.55,43.95,24.29,43.96,51.12,43.96,78,43.93,104.93,43.88,131.83,43.85,-83.19,64.71,-56.31,64.74,-29.41,64.75,-2.53,64.77,24.27,64.8,51.07,64.81,77.96,64.76,104.92,64.68,131.83,64.64,-83.23,85.52,-56.37,85.58,-29.48,85.62,-2.63,85.66,24.16,85.69,50.98,85.68,77.92,85.58,104.91,85.48,131.83,85.43,-83.25,106.33,-56.45,106.44,-29.64,106.53,-2.82,106.6,24,106.6,50.88,106.55,77.87,106.41,104.9,106.28,131.83,106.22,-83.26,127.12,-56.54,127.28,-29.81,127.42,-3.03,127.51,23.85,127.48,50.81,127.38,77.86,127.21,104.89,127.07,131.83,127.01,-83.25,147.9,-56.59,148.08,-29.92,148.27,-3.18,148.38,23.74,148.31,50.77,148.17,77.86,147.98,104.9,147.85,131.83,147.8,-83.24,168.68,-56.63,168.88,-30.01,169.08,-3.29,169.19,23.68,169.11,50.78,168.93,77.9,168.73,104.92,168.63,131.83,168.59]},{"type":"surface","name":"B_HAND.13","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-54.07,-46.15,-26,-46.15,2.06,-46.15,30.12,-46.15,58.19,-46.15,86.25,-46.15,114.31,-46.15,142.38,-46.15,170.44,-46.15,-54.07,-21.08,-26,-21.08,2.06,-21.08,30.11,-21.08,58.17,-21.07,86.24,-21.08,114.31,-21.08,142.38,-21.08,170.44,-21.08,-54.07,3.99,-26,4,2.05,4,30.09,4.01,58.15,4.01,86.24,4,114.31,3.99,142.38,3.99,170.44,3.99,-54.04,29.06,-25.97,29.08,2.06,29.11,30.07,29.13,58.11,29.13,86.21,29.09,114.31,29.06,142.37,29.06,170.44,29.06,-53.99,54.14,-25.91,54.18,2.1,54.23,30.04,54.29,58.02,54.29,86.14,54.21,114.28,54.14,142.37,54.13,170.44,54.12,-54.03,79.27,-25.95,79.34,2.02,79.44,29.9,79.53,57.87,79.49,86.06,79.33,114.27,79.22,142.37,79.2,170.44,79.19,-54.21,104.47,-26.26,104.63,1.63,104.78,29.55,104.84,57.69,104.68,86.02,104.42,114.27,104.29,142.37,104.27,170.44,104.26,-54.42,129.66,-26.62,129.9,1.24,130.08,29.27,130.07,57.59,129.8,86.02,129.48,114.27,129.35,142.37,129.33,170.44,129.33,-54.62,154.82,-26.91,155.12,0.94,155.29,29.1,155.2,57.56,154.87,86.05,154.53,114.29,154.41,142.37,154.4,170.44,154.4]},{"type":"surface","name":"B_HAND.14","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-38.29,-98.04,-11.83,-98.04,14.63,-98.04,41.09,-98.04,67.54,-98.04,94,-98.04,120.46,-98.04,146.91,-98.04,173.37,-98.04,-38.29,-67.75,-11.83,-67.75,14.63,-67.75,41.09,-67.75,67.54,-67.75,94,-67.75,120.46,-67.75,146.91,-67.75,173.37,-67.75,-38.29,-37.45,-11.83,-37.45,14.63,-37.45,41.09,-37.45,67.54,-37.45,94,-37.45,120.46,-37.45,146.91,-37.45,173.37,-37.45,-38.24,-7.18,-11.76,-7.19,14.68,-7.18,41.09,-7.16,67.52,-7.14,93.99,-7.14,120.46,-7.15,146.91,-7.15,173.37,-7.15,-38.06,23.02,-11.54,23,14.83,23.04,41.1,23.15,67.46,23.21,93.96,23.18,120.46,23.14,146.91,23.14,173.37,23.14,-37.91,53.27,-11.39,53.25,14.89,53.37,41.01,53.57,67.33,53.62,93.91,53.51,120.46,53.44,146.91,53.44,173.37,53.44,-38.32,83.88,-11.97,83.98,14.24,84.16,40.47,84.28,67.06,84.12,93.85,83.84,120.46,83.74,146.91,83.74,173.37,83.74,-38.96,114.61,-12.79,114.83,13.44,115,39.94,114.95,66.84,114.56,93.82,114.15,120.46,114.03,146.91,114.03,173.37,114.03,-39.49,145.25,-13.45,145.56,12.86,145.66,39.64,145.41,66.75,144.9,93.82,144.45,120.46,144.33,146.91,144.33,173.37,144.33]},{"type":"surface","name":"B_HAND.15","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-16.94,-149.35,6.43,-149.35,29.8,-149.35,53.17,-149.35,76.54,-149.35,99.91,-149.35,123.27,-149.35,146.64,-149.35,170.01,-149.35,-16.94,-110.77,6.43,-110.77,29.8,-110.77,53.17,-110.77,76.54,-110.77,99.91,-110.77,123.27,-110.77,146.64,-110.77,170.01,-110.77,-16.94,-72.18,6.43,-72.18,29.8,-72.18,53.17,-72.18,76.54,-72.18,99.91,-72.18,123.27,-72.18,146.64,-72.18,170.01,-72.18,-16.92,-33.61,6.46,-33.61,29.82,-33.61,53.17,-33.6,76.53,-33.6,99.9,-33.6,123.27,-33.6,146.64,-33.6,170.01,-33.6,-16.73,4.88,6.66,4.88,29.97,4.9,53.23,4.96,76.54,4.99,99.9,4.99,123.27,4.98,146.64,4.98,170.01,4.98,-16.39,43.34,6.96,43.36,30.16,43.44,53.3,43.55,76.56,43.59,99.9,43.58,123.27,43.57,146.64,43.57,170.01,43.57,-16.88,82.36,6.42,82.39,29.68,82.43,52.96,82.43,76.39,82.31,99.87,82.18,123.27,82.15,146.64,82.15,170.01,82.15,-17.82,121.56,5.47,121.6,28.9,121.52,52.49,121.32,76.19,121.02,99.83,120.78,123.27,120.74,146.64,120.74,170.01,120.74,-18.56,160.54,4.74,160.58,28.36,160.4,52.23,160.01,76.11,159.61,99.83,159.36,123.27,159.32,146.64,159.32,170.01,159.32]},{"type":"surface","name":"B_HAND.16","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-6.55,-97.38,13.58,-97.38,33.72,-97.38,53.85,-97.38,73.98,-97.38,94.11,-97.38,114.25,-97.38,134.38,-97.38,154.51,-97.38,-6.55,-82.16,13.58,-82.16,33.72,-82.16,53.85,-82.16,73.98,-82.16,94.11,-82.16,114.25,-82.16,134.38,-82.16,154.51,-82.16,-6.55,-66.94,13.58,-66.94,33.72,-66.94,53.85,-66.94,73.98,-66.94,94.11,-66.94,114.25,-66.94,134.38,-66.94,154.51,-66.94,-6.55,-51.72,13.58,-51.72,33.72,-51.72,53.85,-51.72,73.98,-51.72,94.11,-51.72,114.25,-51.72,134.38,-51.72,154.51,-51.72,-6.55,-36.49,13.58,-36.49,33.72,-36.49,53.85,-36.49,73.98,-36.49,94.11,-36.49,114.25,-36.49,134.38,-36.49,154.51,-36.49,-6.55,-21.27,13.58,-21.27,33.72,-21.27,53.85,-21.27,73.98,-21.27,94.11,-21.27,114.25,-21.27,134.38,-21.27,154.51,-21.27,-6.55,-6.05,13.58,-6.05,33.72,-6.05,53.85,-6.05,73.98,-6.05,94.11,-6.05,114.25,-6.05,134.38,-6.05,154.51,-6.05,-6.55,9.17,13.58,9.17,33.72,9.17,53.85,9.17,73.98,9.17,94.11,9.17,114.25,9.17,134.38,9.17,154.51,9.17,-6.55,24.39,13.58,24.39,33.72,24.39,53.85,24.39,73.98,24.39,94.11,24.39,114.25,24.39,134.38,24.39,154.51,24.39]},{"length":150,"name":"B_CLOTHES.40","parent":"B_CLOTHES.14","transform":{"x":91.11,"y":-76.57,"skX":97.2,"skY":97.2}},{"length":150,"name":"B_CLOTHES.41","parent":"B_CLOTHES.40","transform":{"x":300,"y":13.64,"skX":160.1,"skY":160.1}},{"length":150,"name":"B_HAND.18","parent":"B_CLOTHES.41","transform":{"x":372.97,"y":-9.7}},{"length":150,"name":"B_HAND.17","parent":"B_CLOTHES.39","transform":{"x":396.86,"y":22.99,"skX":-3.2,"skY":-3.2}},{"type":"surface","name":"B_NECK.01","parent":"B_NECK.02","segmentX":8,"segmentY":8,"vertices":[244.58,-117.17,244.58,-87.63,244.58,-58.09,244.58,-28.55,244.58,1,244.58,30.54,244.58,60.08,244.58,89.62,244.58,119.17,201.76,-117.17,201.76,-87.63,201.76,-58.09,201.76,-28.55,201.76,1,201.76,30.54,201.76,60.08,201.76,89.62,201.76,119.17,158.94,-117.17,158.94,-87.63,158.94,-58.09,158.94,-28.55,158.94,1,158.94,30.54,158.94,60.08,158.94,89.62,158.94,119.17,116.11,-117.17,116.11,-87.63,116.11,-58.09,116.11,-28.55,116.11,1,116.11,30.54,116.11,60.08,116.11,89.62,116.11,119.17,73.29,-117.17,73.29,-87.63,73.29,-58.09,73.29,-28.55,73.29,1,73.29,30.54,73.29,60.08,73.29,89.62,73.29,119.17,30.47,-117.17,30.47,-87.63,30.47,-58.09,30.47,-28.55,30.47,1,30.47,30.54,30.47,60.08,30.47,89.62,30.47,119.17,-12.36,-117.17,-12.36,-87.63,-12.36,-58.09,-12.36,-28.55,-12.36,1,-12.36,30.54,-12.36,60.08,-12.36,89.62,-12.36,119.17,-55.18,-117.17,-55.18,-87.63,-55.18,-58.09,-55.18,-28.55,-55.18,1,-55.18,30.54,-55.18,60.08,-55.18,89.62,-55.18,119.17,-98,-117.17,-98,-87.63,-98,-58.09,-98,-28.55,-98,1,-98,30.54,-98,60.08,-98,89.62,-98,119.17]},{"type":"surface","name":"B_NECK.03","parent":"B_NECK.01","segmentX":8,"segmentY":8,"vertices":[-167.24,-149.16,-126.21,-149.16,-85.18,-149.16,-44.15,-149.16,-3.12,-149.16,37.91,-149.16,78.95,-149.16,119.98,-149.16,161.01,-149.16,-167.24,-122.86,-126.21,-122.86,-85.18,-122.86,-44.15,-122.86,-3.12,-122.86,37.91,-122.86,78.95,-122.86,119.98,-122.86,161.01,-122.86,-167.24,-96.55,-126.21,-96.55,-85.18,-96.55,-44.15,-96.55,-3.12,-96.55,37.91,-96.55,78.95,-96.55,119.98,-96.55,161.01,-96.55,-167.24,-70.24,-126.21,-70.24,-85.18,-70.24,-44.15,-70.24,-3.12,-70.24,37.91,-70.24,78.95,-70.24,119.98,-70.24,161.01,-70.24,-167.24,-43.93,-126.21,-43.93,-85.18,-43.93,-44.15,-43.93,-3.12,-43.93,37.91,-43.93,78.95,-43.93,119.98,-43.93,161.01,-43.93,-167.24,-17.63,-126.21,-17.63,-85.18,-17.63,-44.15,-17.63,-3.12,-17.63,37.91,-17.63,78.95,-17.63,119.98,-17.63,161.01,-17.63,-167.24,8.68,-126.21,8.68,-85.18,8.68,-44.15,8.68,-3.12,8.68,37.91,8.68,78.95,8.68,119.98,8.68,161.01,8.68,-167.24,34.99,-126.21,34.99,-85.18,34.99,-44.15,34.99,-3.12,34.99,37.91,34.99,78.95,34.99,119.98,34.99,161.01,34.99,-167.24,61.3,-126.21,61.3,-85.18,61.3,-44.15,61.3,-3.12,61.3,37.91,61.3,78.95,61.3,119.98,61.3,161.01,61.3]},{"type":"surface","name":"B_BODY.01","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-129.18,-158.78,-97.99,-158.78,-66.8,-158.78,-35.6,-158.78,-4.41,-158.78,26.78,-158.78,57.98,-158.78,89.17,-158.78,120.36,-158.78,-129.18,-128.73,-97.99,-128.73,-66.8,-128.73,-35.6,-128.73,-4.41,-128.73,26.78,-128.73,57.98,-128.73,89.17,-128.73,120.36,-128.73,-129.18,-98.69,-97.99,-98.69,-66.8,-98.69,-35.6,-98.69,-4.41,-98.69,26.78,-98.69,57.98,-98.69,89.17,-98.69,120.36,-98.69,-129.18,-68.64,-97.99,-68.64,-66.8,-68.64,-35.6,-68.64,-4.41,-68.64,26.78,-68.64,57.98,-68.64,89.17,-68.64,120.36,-68.64,-129.18,-38.6,-97.99,-38.6,-66.8,-38.6,-35.6,-38.6,-4.41,-38.6,26.78,-38.6,57.98,-38.6,89.17,-38.6,120.36,-38.6,-129.18,-8.55,-97.99,-8.55,-66.8,-8.55,-35.6,-8.55,-4.41,-8.55,26.78,-8.55,57.98,-8.55,89.17,-8.55,120.36,-8.55,-129.18,21.49,-97.99,21.49,-66.8,21.49,-35.6,21.49,-4.41,21.49,26.78,21.49,57.98,21.49,89.17,21.49,120.36,21.49,-129.18,51.54,-97.99,51.54,-66.8,51.54,-35.6,51.54,-4.41,51.54,26.78,51.54,57.98,51.54,89.17,51.54,120.36,51.54,-129.18,81.58,-97.99,81.58,-66.8,81.58,-35.6,81.58,-4.41,81.58,26.78,81.58,57.98,81.58,89.17,81.58,120.36,81.58]},{"type":"surface","name":"B_CLOTHES.09","parent":"B_CLOTHES.10","segmentX":8,"segmentY":8,"vertices":[-170.47,-164.99,-127.16,-164.99,-83.85,-164.99,-40.53,-164.99,2.78,-164.99,46.09,-164.99,89.4,-164.99,132.72,-164.99,176.03,-164.99,-170.47,-122.81,-127.16,-122.81,-83.85,-122.81,-40.53,-122.81,2.78,-122.81,46.09,-122.81,89.4,-122.81,132.72,-122.81,176.03,-122.81,-170.47,-80.63,-127.16,-80.63,-83.85,-80.63,-40.53,-80.63,2.78,-80.63,46.09,-80.63,89.4,-80.63,132.72,-80.63,176.03,-80.63,-170.47,-38.45,-127.16,-38.45,-83.85,-38.45,-40.53,-38.45,2.78,-38.45,46.09,-38.45,89.4,-38.45,132.72,-38.45,176.03,-38.45,-170.47,3.72,-127.16,3.72,-83.85,3.72,-40.53,3.72,2.78,3.72,46.09,3.72,89.4,3.72,132.72,3.72,176.03,3.72,-170.47,45.9,-127.16,45.9,-83.85,45.9,-40.53,45.9,2.78,45.9,46.09,45.9,89.4,45.9,132.72,45.9,176.03,45.9,-170.47,88.08,-127.16,88.08,-83.85,88.08,-40.53,88.08,2.78,88.08,46.09,88.08,89.4,88.08,132.72,88.08,176.03,88.08,-170.47,130.26,-127.16,130.26,-83.85,130.26,-40.53,130.26,2.78,130.26,46.09,130.26,89.4,130.26,132.72,130.26,176.03,130.26,-170.47,172.44,-127.16,172.44,-83.85,172.44,-40.53,172.44,2.78,172.44,46.09,172.44,89.4,172.44,132.72,172.44,176.03,172.44]},{"type":"surface","name":"B_CLOTHES.17","parent":"B_CLOTHES.18","segmentX":8,"segmentY":8,"vertices":[-173.66,-175.19,-131.84,-175.19,-90.02,-175.19,-48.2,-175.19,-6.38,-175.19,35.44,-175.19,77.27,-175.19,119.09,-175.19,160.91,-175.19,-173.66,-130.57,-131.84,-130.57,-90.02,-130.57,-48.2,-130.57,-6.38,-130.57,35.44,-130.57,77.27,-130.57,119.09,-130.57,160.91,-130.57,-173.66,-85.94,-131.84,-85.94,-90.02,-85.94,-48.2,-85.94,-6.38,-85.94,35.44,-85.94,77.27,-85.94,119.09,-85.94,160.91,-85.94,-173.66,-41.32,-131.63,-41.41,-89.64,-41.44,-47.83,-41.43,-6.21,-41.38,35.41,-41.33,77.27,-41.32,119.09,-41.32,160.91,-41.32,-173.66,3.3,-130.08,2.67,-86.63,2.09,-44.56,2,-4.47,2.62,35.61,3.24,77.27,3.3,119.09,3.3,160.91,3.3,-173.66,47.93,-128.52,46.75,-83.61,45.62,-41.28,45.44,-2.73,46.63,35.81,47.81,77.27,47.93,119.09,47.93,160.91,47.93,-173.66,92.55,-127.69,91.49,-82.06,90.41,-39.72,90.23,-2.01,91.34,35.69,92.44,77.27,92.55,119.09,92.55,160.91,92.55,-173.66,137.17,-125.72,136.63,-78.27,136.06,-35.61,135.97,0.16,136.54,35.92,137.12,77.27,137.17,119.09,137.17,160.91,137.17,-173.66,181.8,-123.62,181.8,-74.2,181.8,-31.19,181.8,2.51,181.8,36.21,181.8,77.27,181.8,119.09,181.8,160.91,181.8]},{"length":150,"name":"B_CLOTHES.63","parent":"B_CLOTHES.62","transform":{"x":291.48,"y":-20.7,"skX":-163.5,"skY":-163.5}},{"type":"surface","name":"B_FACESHADOW.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[452,-248.13,452,-187.59,452,-127.05,452,-66.51,452,-5.97,452,54.57,452,115.11,452,175.65,452,236.19,410,-248.13,410,-187.59,410,-127.05,410,-66.51,410,-5.97,410,54.57,410,115.11,410,175.65,410,236.19,368,-248.13,368,-187.59,368,-127.05,368,-66.51,368,-5.97,368,54.57,368,115.11,368,175.65,368,236.19,326,-248.13,326,-187.59,326,-127.05,326,-66.51,326,-5.97,326,54.57,326,115.11,326,175.65,326,236.19,284,-248.13,284,-187.59,284,-127.05,284,-66.51,284,-5.97,284,54.57,284,115.11,284,175.65,284,236.19,242,-248.13,242,-187.59,242,-127.05,242,-66.51,242,-5.97,242,54.57,242,115.11,242,175.65,242,236.19,200,-248.13,200,-187.59,200,-127.05,200,-66.51,200,-5.97,200,54.57,200,115.11,200,175.65,200,236.19,158,-248.13,158,-187.59,158,-127.05,158,-66.51,158,-5.97,158,54.57,158,115.11,158,175.65,158,236.19,116,-248.13,116,-187.59,116,-127.05,116,-66.51,116,-5.97,116,54.57,116,115.11,116,175.65,116,236.19]},{"type":"surface","name":"B_FACESHADOW.02","parent":"B_FACESHADOW.01","segmentX":8,"segmentY":8,"vertices":[-190.79,-186.15,-143.48,-186.15,-96.16,-186.15,-48.85,-186.15,-1.54,-186.15,45.78,-186.15,93.09,-186.15,140.41,-186.15,187.72,-186.15,-190.79,-140.2,-143.48,-140.2,-96.16,-140.2,-48.85,-140.2,-1.54,-140.2,45.78,-140.2,93.09,-140.2,140.41,-140.2,187.72,-140.2,-190.79,-94.26,-143.48,-94.26,-96.16,-94.26,-48.85,-94.26,-1.54,-94.26,45.78,-94.26,93.09,-94.26,140.41,-94.26,187.72,-94.26,-190.79,-48.31,-143.48,-48.31,-96.16,-48.31,-48.85,-48.31,-1.54,-48.31,45.78,-48.31,93.09,-48.31,140.41,-48.31,187.72,-48.31,-190.79,-2.36,-143.48,-2.36,-96.16,-2.36,-48.85,-2.36,-1.54,-2.36,45.78,-2.36,93.09,-2.36,140.41,-2.36,187.72,-2.36,-190.79,43.59,-143.48,43.59,-96.16,43.59,-48.85,43.59,-1.54,43.59,45.78,43.59,93.09,43.59,140.41,43.59,187.72,43.59,-190.79,89.53,-143.48,89.53,-96.16,89.53,-48.85,89.53,-1.54,89.53,45.78,89.53,93.09,89.53,140.41,89.53,187.72,89.53,-190.79,135.48,-143.48,135.48,-96.16,135.48,-48.85,135.48,-1.54,135.48,45.78,135.48,93.09,135.48,140.41,135.48,187.72,135.48,-190.79,181.43,-143.48,181.43,-96.16,181.43,-48.85,181.43,-1.54,181.43,45.78,181.43,93.09,181.43,140.41,181.43,187.72,181.43]},{"type":"surface","name":"B_FACE.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[499,-315.38,499,-240,499,-163.05,499,-85.89,499,-8.73,499,68.43,499,145.59,499,222.75,499,299.92,420.75,-317.16,420.75,-240.23,420.75,-163.05,420.75,-85.89,420.75,-8.73,420.75,68.43,420.75,145.59,420.75,222.75,420.75,299.92,342.5,-317.38,342.5,-240.21,342.5,-163.05,342.5,-85.89,342.5,-8.73,342.5,68.43,342.5,145.59,342.5,222.75,342.5,299.92,264.25,-317.38,264.25,-240.21,264.25,-163.05,264.25,-85.89,264.25,-8.73,264.25,68.43,264.25,145.59,264.25,222.75,264.25,299.92,186,-317.38,186,-240.21,186,-163.05,186,-85.89,186,-8.73,186,68.43,186,145.59,186,222.75,186,299.92,107.75,-317.38,107.75,-240.21,107.75,-163.05,107.75,-85.89,107.75,-8.73,107.75,68.43,107.75,145.59,107.75,222.75,107.75,299.92,29.5,-317.38,29.5,-240.21,29.5,-163.05,29.5,-85.89,29.5,-8.73,29.5,68.43,29.5,145.59,29.5,222.75,29.5,299.92,-48.75,-317.38,-48.75,-240.21,-48.75,-163.05,-48.75,-85.89,-48.75,-8.73,-48.75,68.43,-48.75,145.59,-48.75,222.75,-48.75,299.92,-127,-317.38,-127,-240.21,-127,-163.05,-127,-85.89,-127,-8.73,-127,68.43,-127,145.59,-127,222.75,-127,299.92]},{"type":"surface","name":"B_EYE.01","parent":"B_EYE.02","segmentX":8,"segmentY":8,"vertices":[-184.36,-185.36,-138.97,-185.51,-93.45,-185.6,-48.16,-185.57,-3.07,-185.56,41.98,-185.59,87.16,-185.3,132.43,-185.1,177.71,-185.15,-185.19,-139.79,-139.18,-139.85,-93.41,-139.92,-48.12,-139.87,-3,-139.81,42.03,-139.83,87.16,-139.55,132.35,-139.35,177.58,-139.36,-186.09,-94.19,-139.46,-94.15,-93.44,-94.19,-48.15,-94.11,-2.96,-94,42.08,-94.03,87.18,-93.77,132.32,-93.58,177.52,-93.58,-186.12,-48.67,-139.42,-48.5,-93.44,-48.38,-48.21,-48.25,-2.97,-48.16,42.14,-48.23,87.13,-48.03,132.3,-47.96,177.57,-48.01,-184.74,-3.22,-138.85,-2.98,-93.3,-2.66,-48.17,-2.49,-3.02,-2.4,42.12,-2.43,86.81,-2.33,132.17,-2.47,177.71,-2.61,-184.16,42.69,-138.83,42.85,-93.46,43.1,-48.26,43.23,-3.18,43.36,42.03,43.4,86.43,43.45,131.99,43.25,177.81,43.11,-184.24,88.63,-139.03,88.71,-93.7,88.86,-48.43,88.96,-3.22,89.07,42.01,89.12,86.6,89.15,132.23,88.98,178.04,88.88,-184.39,134.41,-139.18,134.49,-93.9,134.64,-48.61,134.74,-3.19,134.78,42.05,134.8,87.08,134.82,132.72,134.76,178.36,134.73,-184.5,180.12,-139.33,180.22,-94.15,180.39,-48.85,180.5,-3.16,180.5,42.13,180.51,87.61,180.55,133.24,180.63,178.7,180.71]},{"type":"surface","name":"B_EYE.03","parent":"B_EYE.04","segmentX":8,"segmentY":8,"vertices":[-176.82,-176.2,-132.74,-176.23,-88.67,-176.25,-44.6,-176.24,-0.56,-176.15,43.39,-176.01,87.27,-175.91,130.91,-175.72,174.64,-175.51,-176.82,-131.91,-132.41,-133.49,-88.02,-135.1,-43.85,-135.47,0.13,-134.88,44,-134.27,87.75,-133.83,131.14,-132.55,174.59,-131.28,-176.82,-87.63,-132.1,-90.66,-87.41,-93.72,-43.15,-94.41,0.78,-93.37,44.57,-92.32,88.21,-91.59,131.37,-89.33,174.56,-87.06,-176.82,-43.34,-132.04,-46.67,-87.29,-49.9,-43.03,-50.62,0.89,-49.51,44.69,-48.41,88.35,-47.66,131.54,-45.32,174.74,-42.88,-176.82,0.95,-132.36,-0.84,-87.92,-2.49,-43.77,-2.86,0.2,-2.29,44.13,-1.69,87.96,-1.28,131.49,-0.06,175.04,1.28,-176.81,45.23,-132.68,44.98,-88.54,44.9,-44.51,44.89,-0.49,44.92,43.55,45.03,87.53,45.09,131.37,45.2,175.26,45.43,-176.81,89.52,-132.72,89.51,-88.61,89.51,-44.58,89.5,-0.57,89.47,43.48,89.52,87.49,89.56,131.43,89.58,175.42,89.6,-176.83,133.8,-132.72,133.8,-88.61,133.8,-44.57,133.79,-0.56,133.77,43.49,133.81,87.52,133.82,131.53,133.81,175.58,133.8,-176.86,178.08,-132.73,178.08,-88.6,178.08,-44.56,178.08,-0.55,178.07,43.49,178.08,87.55,178.07,131.65,178.03,175.76,178]},{"type":"surface","name":"B_EYE_BALL.05","parent":"B_EYE.01","segmentX":8,"segmentY":8,"vertices":[-109.01,-112.78,-76.73,-112.78,-44.46,-112.78,-12.19,-112.78,20.09,-112.78,52.36,-112.78,84.63,-112.78,116.9,-112.78,149.18,-112.78,-109.01,-77.87,-76.73,-77.87,-44.46,-77.87,-12.19,-77.87,20.09,-77.87,52.36,-77.87,84.63,-77.87,116.9,-77.87,149.18,-77.87,-109.01,-42.96,-76.73,-42.96,-44.46,-42.96,-12.19,-42.96,20.09,-42.96,52.36,-42.96,84.63,-42.96,116.9,-42.96,149.18,-42.96,-109.01,-8.06,-76.73,-8.06,-44.46,-8.06,-12.19,-8.06,20.09,-8.06,52.36,-8.06,84.63,-8.06,116.9,-8.06,149.18,-8.06,-109.01,26.85,-76.73,26.85,-44.46,26.85,-12.19,26.85,20.09,26.85,52.36,26.85,84.63,26.85,116.9,26.85,149.18,26.85,-109.01,61.76,-76.73,61.76,-44.46,61.76,-12.19,61.76,20.09,61.76,52.36,61.76,84.63,61.76,116.9,61.76,149.18,61.76,-109.01,96.67,-76.73,96.67,-44.46,96.67,-12.19,96.67,20.09,96.67,52.36,96.67,84.63,96.67,116.9,96.67,149.18,96.67,-109.01,131.58,-76.73,131.58,-44.46,131.58,-12.19,131.58,20.09,131.58,52.36,131.58,84.63,131.58,116.9,131.58,149.18,131.58,-109.01,166.49,-76.73,166.49,-44.46,166.49,-12.19,166.49,20.09,166.49,52.36,166.49,84.63,166.49,116.9,166.49,149.18,166.49]},{"type":"surface","name":"B_EYE_BALL.10","parent":"B_EYE.03","segmentX":8,"segmentY":8,"vertices":[-133.22,-106.6,-99.27,-106.6,-65.32,-106.6,-31.37,-106.6,2.58,-106.6,36.53,-106.6,70.48,-106.6,104.43,-106.6,138.39,-106.6,-133.22,-72.53,-99.27,-72.53,-65.32,-72.53,-31.37,-72.53,2.58,-72.53,36.53,-72.53,70.48,-72.53,104.43,-72.53,138.39,-72.53,-133.22,-38.47,-99.27,-38.47,-65.32,-38.47,-31.37,-38.47,2.58,-38.47,36.53,-38.47,70.48,-38.47,104.43,-38.47,138.39,-38.47,-133.22,-4.4,-99.27,-4.4,-65.32,-4.4,-31.37,-4.4,2.58,-4.4,36.53,-4.4,70.48,-4.4,104.43,-4.4,138.39,-4.4,-133.22,29.67,-99.27,29.67,-65.32,29.67,-31.37,29.67,2.58,29.67,36.53,29.67,70.48,29.67,104.43,29.67,138.39,29.67,-133.22,63.74,-99.27,63.74,-65.32,63.74,-31.37,63.74,2.58,63.74,36.53,63.74,70.48,63.74,104.43,63.74,138.39,63.74,-133.22,97.81,-99.27,97.81,-65.32,97.81,-31.37,97.81,2.58,97.81,36.53,97.81,70.48,97.81,104.43,97.81,138.39,97.81,-133.22,131.88,-99.27,131.88,-65.32,131.88,-31.37,131.88,2.58,131.88,36.53,131.88,70.48,131.88,104.43,131.88,138.39,131.88,-133.22,165.95,-99.27,165.95,-65.32,165.95,-31.37,165.95,2.58,165.95,36.53,165.95,70.48,165.95,104.43,165.95,138.39,165.95]},{"type":"surface","name":"B_BROW.03","parent":"B_BROW.05","segmentX":8,"segmentY":8,"vertices":[-165.41,-139.73,-128.92,-139.73,-92.43,-139.73,-55.94,-139.73,-19.45,-139.73,17.04,-139.73,53.53,-139.73,90.02,-139.73,126.5,-139.73,-165.41,-105.5,-128.92,-105.5,-92.43,-105.5,-55.94,-105.5,-19.45,-105.5,17.04,-105.5,53.53,-105.5,90.02,-105.5,126.5,-105.5,-165.41,-71.28,-128.92,-71.28,-92.43,-71.28,-55.94,-71.28,-19.45,-71.28,17.04,-71.28,53.53,-71.28,90.02,-71.28,126.5,-71.28,-165.41,-37.05,-128.92,-37.05,-92.43,-37.05,-55.94,-37.05,-19.45,-37.05,17.04,-37.05,53.53,-37.05,90.02,-37.05,126.5,-37.05,-165.41,-2.82,-128.92,-2.82,-92.43,-2.82,-55.94,-2.82,-19.45,-2.82,17.04,-2.82,53.53,-2.82,90.02,-2.82,126.5,-2.82,-165.41,31.4,-128.92,31.4,-92.43,31.4,-55.94,31.4,-19.45,31.4,17.04,31.4,53.53,31.4,90.02,31.4,126.5,31.4,-165.41,65.63,-128.92,65.63,-92.43,65.63,-55.94,65.63,-19.45,65.63,17.04,65.63,53.53,65.63,90.02,65.63,126.5,65.63,-165.41,99.85,-128.92,99.85,-92.43,99.85,-55.94,99.85,-19.45,99.85,17.04,99.85,53.53,99.85,90.02,99.85,126.5,99.85,-165.41,134.08,-128.92,134.08,-92.43,134.08,-55.94,134.08,-19.45,134.08,17.04,134.08,53.53,134.08,90.02,134.08,126.5,134.08]},{"type":"surface","name":"B_BROW.04","parent":"B_BROW.06","segmentX":8,"segmentY":8,"vertices":[-151.79,-142.29,-112.65,-142.29,-73.52,-142.29,-34.38,-142.29,4.76,-142.29,43.89,-142.29,83.03,-142.29,122.17,-142.29,161.3,-142.29,-151.79,-107.29,-112.65,-107.29,-73.52,-107.29,-34.38,-107.29,4.76,-107.29,43.89,-107.29,83.03,-107.29,122.17,-107.29,161.3,-107.29,-151.79,-72.28,-112.65,-72.28,-73.52,-72.28,-34.38,-72.28,4.76,-72.28,43.89,-72.28,83.03,-72.28,122.17,-72.28,161.3,-72.28,-151.79,-37.28,-112.65,-37.28,-73.52,-37.28,-34.38,-37.28,4.76,-37.28,43.89,-37.28,83.03,-37.28,122.17,-37.28,161.3,-37.28,-151.79,-2.27,-112.65,-2.27,-73.52,-2.27,-34.38,-2.27,4.76,-2.27,43.89,-2.27,83.03,-2.27,122.17,-2.27,161.3,-2.27,-151.79,32.73,-112.65,32.73,-73.52,32.73,-34.38,32.73,4.76,32.73,43.89,32.73,83.03,32.73,122.17,32.73,161.3,32.73,-151.79,67.74,-112.65,67.74,-73.52,67.74,-34.38,67.74,4.76,67.74,43.89,67.74,83.03,67.74,122.17,67.74,161.3,67.74,-151.79,102.75,-112.65,102.75,-73.52,102.75,-34.38,102.75,4.76,102.75,43.89,102.75,83.03,102.75,122.17,102.75,161.3,102.75,-151.79,137.75,-112.65,137.75,-73.52,137.75,-34.38,137.75,4.76,137.75,43.89,137.75,83.03,137.75,122.17,137.75,161.3,137.75]},{"type":"surface","name":"B_MOUTH.02","parent":"B_MOUTH.03","segmentX":8,"segmentY":8,"vertices":[-178.57,-176.83,-134.33,-176.83,-90.09,-176.83,-45.85,-176.83,-1.6,-176.83,42.64,-176.83,86.88,-176.83,131.12,-176.83,175.36,-176.83,-178.57,-133.24,-134.33,-133.24,-90.09,-133.24,-45.92,-133.24,-2.2,-133.23,41.52,-133.22,85.85,-133.22,130.59,-133.23,175.36,-133.24,-178.57,-89.65,-134.33,-89.65,-90.09,-89.65,-45.98,-89.64,-2.75,-89.63,40.48,-89.61,84.89,-89.61,130.1,-89.63,175.36,-89.65,-178.57,-46.05,-134.33,-46.05,-90.09,-46.05,-45.93,-46.06,-3.01,-46.08,39.91,-46.09,84.32,-46.1,129.78,-46.1,175.36,-46.05,-178.57,-2.46,-134.33,-2.46,-90.09,-2.46,-46.08,-2.5,-4.28,-2.92,37.51,-3.34,82.11,-3.28,128.64,-2.89,175.36,-2.46,-178.57,41.13,-134.33,41.13,-90.09,41.13,-46.23,41.05,-5.55,40.23,35.12,39.41,79.9,39.54,127.5,40.32,175.36,41.13,-178.57,84.72,-134.33,84.72,-90.09,84.72,-46.17,84.66,-5.89,84.01,34.38,83.37,79.16,83.49,127.1,84.16,175.36,84.72,-178.57,128.31,-134.33,128.31,-90.09,128.31,-46.26,128.33,-6.76,128.53,32.74,128.73,77.65,128.72,126.32,128.57,175.36,128.31,-178.57,171.9,-134.33,171.9,-90.09,171.9,-46.37,172,-7.69,173.12,30.99,174.23,76.04,174.06,125.49,173.02,175.36,171.9]},{"type":"surface","name":"B_MOUTH.01","parent":"B_MOUTH.02","segmentX":8,"segmentY":8,"vertices":[-159.45,-108.81,-117.56,-108.81,-75.66,-108.81,-33.77,-108.81,8.12,-108.81,50.02,-108.81,91.91,-108.81,133.81,-108.81,175.7,-108.81,-159.45,-72.73,-117.56,-72.73,-75.66,-72.73,-33.77,-72.73,8.12,-72.73,50.02,-72.73,91.91,-72.73,133.81,-72.73,175.7,-72.73,-159.45,-36.65,-117.56,-36.65,-75.66,-36.65,-33.77,-36.65,8.12,-36.65,50.02,-36.65,91.91,-36.65,133.81,-36.65,175.7,-36.65,-159.45,-0.57,-117.56,-0.57,-75.66,-0.57,-33.77,-0.57,8.12,-0.57,50.02,-0.57,91.91,-0.57,133.81,-0.57,175.7,-0.57,-159.45,35.51,-117.56,35.51,-75.66,35.51,-33.77,35.51,8.12,35.51,50.02,35.51,91.91,35.51,133.81,35.51,175.7,35.51,-159.45,71.59,-117.56,71.59,-75.66,71.59,-33.77,71.59,8.12,71.59,50.02,71.59,91.91,71.59,133.81,71.59,175.7,71.59,-159.45,107.68,-117.56,107.68,-75.66,107.68,-33.77,107.68,8.12,107.68,50.02,107.68,91.91,107.68,133.81,107.68,175.7,107.68,-159.45,143.76,-117.56,143.76,-75.66,143.76,-33.77,143.76,8.12,143.76,50.02,143.76,91.91,143.76,133.81,143.76,175.7,143.76,-159.45,179.84,-117.56,179.84,-75.66,179.84,-33.77,179.84,8.12,179.84,50.02,179.84,91.91,179.84,133.81,179.84,175.7,179.84]},{"type":"surface","name":"B_MOUTH.04","parent":"B_MOUTH.02","segmentX":8,"segmentY":8,"vertices":[-153.74,-140.09,-113.59,-140.09,-73.44,-140.09,-33.3,-140.09,6.85,-140.09,47,-140.09,87.15,-140.09,127.3,-140.09,167.45,-140.09,-153.74,-116.73,-113.59,-116.73,-73.44,-116.73,-33.3,-116.73,6.85,-116.73,47,-116.73,87.15,-116.73,127.3,-116.73,167.45,-116.73,-153.74,-93.37,-113.59,-93.37,-73.44,-93.37,-33.3,-93.37,6.85,-93.37,47,-93.37,87.15,-93.37,127.3,-93.37,167.45,-93.37,-153.74,-70,-113.59,-70,-73.44,-70,-33.3,-70,6.85,-70,47,-70,87.15,-70,127.3,-70,167.45,-70,-153.74,-46.64,-113.59,-46.64,-73.44,-46.64,-33.3,-46.64,6.85,-46.64,47,-46.64,87.15,-46.64,127.3,-46.64,167.45,-46.64,-153.74,-23.28,-113.59,-23.28,-73.44,-23.28,-33.3,-23.28,6.85,-23.28,47,-23.28,87.15,-23.28,127.3,-23.28,167.45,-23.28,-153.74,0.08,-113.59,0.08,-73.44,0.08,-33.3,0.08,6.85,0.08,47,0.08,87.15,0.08,127.3,0.08,167.45,0.08,-153.74,23.44,-113.59,23.44,-73.44,23.44,-33.3,23.44,6.85,23.44,47,23.44,87.15,23.44,127.3,23.44,167.45,23.44,-153.74,46.8,-113.59,46.8,-73.44,46.8,-33.3,46.8,6.85,46.8,47,46.8,87.15,46.8,127.3,46.8,167.45,46.8]},{"type":"surface","name":"B_MOUTH.05","parent":"B_MOUTH.02","segmentX":8,"segmentY":8,"vertices":[-130.04,-126.13,-94.19,-126.13,-58.34,-126.13,-22.48,-126.13,13.37,-126.13,49.22,-126.13,85.08,-126.13,120.93,-126.13,156.79,-126.13,-130.04,-92.77,-94.19,-92.77,-58.34,-92.77,-22.48,-92.77,13.37,-92.77,49.22,-92.77,85.08,-92.77,120.93,-92.77,156.79,-92.77,-130.04,-59.42,-94.19,-59.42,-58.34,-59.42,-22.48,-59.42,13.37,-59.42,49.22,-59.42,85.08,-59.42,120.93,-59.42,156.79,-59.42,-130.04,-26.06,-94.19,-26.06,-58.34,-26.06,-22.48,-26.06,13.37,-26.06,49.22,-26.06,85.08,-26.06,120.93,-26.06,156.79,-26.06,-130.04,7.29,-94.19,7.29,-58.34,7.29,-22.48,7.29,13.37,7.29,49.22,7.29,85.08,7.29,120.93,7.29,156.79,7.29,-130.04,40.65,-94.19,40.65,-58.34,40.65,-22.48,40.65,13.37,40.65,49.22,40.65,85.08,40.65,120.93,40.65,156.79,40.65,-130.04,74,-94.19,74,-58.34,74,-22.48,74,13.37,74,49.22,74,85.08,74,120.93,74,156.79,74,-130.04,107.36,-94.19,107.36,-58.34,107.36,-22.48,107.36,13.37,107.36,49.22,107.36,85.08,107.36,120.93,107.36,156.79,107.36,-130.04,140.72,-94.19,140.72,-58.34,140.72,-22.48,140.72,13.37,140.72,49.22,140.72,85.08,140.72,120.93,140.72,156.79,140.72]},{"type":"surface","name":"B_HAIR_FRONT.01","parent":"B_HAIR_FRONT.02","segmentX":8,"segmentY":8,"vertices":[-171.64,-167.23,-129.2,-167.23,-86.76,-167.23,-44.31,-167.23,-1.87,-167.23,40.58,-167.23,83.02,-167.23,125.47,-167.23,167.91,-167.23,-171.64,-126.11,-129.2,-126.11,-86.76,-126.11,-44.31,-126.11,-1.87,-126.11,40.58,-126.11,83.02,-126.11,125.47,-126.11,167.91,-126.11,-171.64,-85,-129.2,-85,-86.76,-85,-44.31,-85,-1.87,-85,40.58,-85,83.02,-85,125.47,-85,167.91,-85,-171.64,-43.89,-129.2,-43.89,-86.76,-43.89,-44.31,-43.89,-1.87,-43.89,40.58,-43.89,83.02,-43.89,125.47,-43.89,167.91,-43.89,-171.64,-2.77,-129.2,-2.77,-86.76,-2.77,-44.31,-2.77,-1.87,-2.77,40.58,-2.77,83.02,-2.77,125.47,-2.77,167.91,-2.77,-171.64,38.34,-129.2,38.34,-86.76,38.34,-44.31,38.34,-1.87,38.34,40.58,38.34,83.02,38.34,125.47,38.34,167.91,38.34,-171.64,79.46,-129.2,79.46,-86.76,79.46,-44.31,79.46,-1.87,79.46,40.58,79.46,83.02,79.46,125.47,79.46,167.91,79.46,-171.64,120.57,-129.2,120.57,-86.76,120.57,-44.31,120.57,-1.87,120.57,40.58,120.57,83.02,120.57,125.47,120.57,167.91,120.57,-171.64,161.68,-129.2,161.68,-86.76,161.68,-44.31,161.68,-1.87,161.68,40.58,161.68,83.02,161.68,125.47,161.68,167.91,161.68]},{"type":"surface","name":"B_HAIR_SIDE.01","parent":"B_HAIR_SIDE.02","segmentX":8,"segmentY":8,"vertices":[-168.56,-185.44,-126.27,-185.44,-83.97,-185.44,-41.67,-185.44,0.62,-185.44,42.92,-185.44,85.22,-185.44,127.51,-185.44,169.81,-185.44,-168.56,-139.56,-126.27,-139.56,-83.97,-139.56,-41.67,-139.56,0.62,-139.56,42.92,-139.56,85.22,-139.56,127.51,-139.56,169.81,-139.56,-168.56,-93.68,-126.27,-93.68,-83.97,-93.68,-41.67,-93.68,0.62,-93.68,42.92,-93.68,85.22,-93.68,127.51,-93.68,169.81,-93.68,-168.56,-47.8,-126.27,-47.8,-83.97,-47.8,-41.67,-47.8,0.62,-47.8,42.92,-47.8,85.22,-47.8,127.51,-47.8,169.81,-47.8,-168.56,-1.92,-126.27,-1.92,-83.97,-1.92,-41.67,-1.92,0.62,-1.92,42.92,-1.92,85.22,-1.92,127.51,-1.92,169.81,-1.92,-168.56,43.96,-126.27,43.96,-83.97,43.96,-41.67,43.96,0.62,43.96,42.92,43.96,85.22,43.96,127.51,43.96,169.81,43.96,-168.56,89.85,-126.27,89.85,-83.97,89.85,-41.67,89.85,0.62,89.85,42.92,89.85,85.22,89.85,127.51,89.85,169.81,89.85,-168.56,135.73,-126.27,135.73,-83.97,135.73,-41.67,135.73,0.62,135.73,42.92,135.73,85.22,135.73,127.51,135.73,169.81,135.73,-168.56,181.61,-126.27,181.61,-83.97,181.61,-41.67,181.61,0.62,181.61,42.92,181.61,85.22,181.61,127.51,181.61,169.81,181.61]},{"type":"surface","name":"B_HAIR_SIDE.05","parent":"B_HAIR_SIDE.01","segmentX":8,"segmentY":8,"vertices":[-179.97,-192.78,-135.45,-192.78,-90.94,-192.78,-46.42,-192.78,-1.91,-192.78,42.61,-192.78,87.12,-192.78,131.64,-192.78,176.15,-192.78,-179.97,-144.8,-135.45,-144.8,-90.94,-144.8,-46.42,-144.8,-1.91,-144.8,42.61,-144.8,87.12,-144.8,131.64,-144.8,176.15,-144.8,-179.97,-96.82,-135.45,-96.82,-90.94,-96.82,-46.42,-96.82,-1.91,-96.82,42.61,-96.82,87.12,-96.82,131.64,-96.82,176.15,-96.82,-179.97,-48.84,-135.45,-48.84,-90.94,-48.84,-46.42,-48.84,-1.91,-48.84,42.61,-48.84,87.12,-48.84,131.64,-48.84,176.15,-48.84,-179.97,-0.87,-135.45,-0.87,-90.94,-0.87,-46.42,-0.87,-1.91,-0.87,42.61,-0.86,87.12,-0.86,131.64,-0.86,176.15,-0.86,-179.97,47.11,-135.45,47.11,-90.94,47.11,-46.42,47.11,-1.91,47.11,42.61,47.11,87.12,47.11,131.64,47.11,176.15,47.11,-179.97,95.09,-135.45,95.09,-90.94,95.09,-46.42,95.09,-1.91,95.09,42.61,95.09,87.12,95.09,131.64,95.09,176.15,95.09,-179.97,143.07,-135.45,143.07,-90.94,143.07,-46.42,143.07,-1.91,143.07,42.61,143.07,87.12,143.07,131.64,143.07,176.15,143.07,-179.97,191.05,-135.45,191.05,-90.94,191.05,-46.42,191.05,-1.91,191.05,42.61,191.05,87.12,191.05,131.64,191.05,176.15,191.05]},{"type":"surface","name":"B_HAIR_TWIN.05","parent":"B_HAIR_TWIN.06","segmentX":8,"segmentY":8,"vertices":[-180.41,-188.43,-134.47,-188.43,-88.52,-188.43,-42.57,-188.43,3.38,-188.43,49.32,-188.43,95.27,-188.43,141.22,-188.43,187.17,-188.43,-180.41,-141.72,-134.47,-141.72,-88.52,-141.72,-42.57,-141.72,3.38,-141.72,49.32,-141.72,95.27,-141.72,141.22,-141.72,187.17,-141.72,-180.41,-95.02,-134.47,-95.02,-88.52,-95.02,-42.57,-95.02,3.38,-95.02,49.32,-95.02,95.27,-95.02,141.22,-95.02,187.17,-95.02,-180.41,-48.32,-134.47,-48.32,-88.52,-48.32,-42.57,-48.32,3.38,-48.32,49.32,-48.32,95.27,-48.32,141.22,-48.32,187.17,-48.32,-180.41,-1.62,-134.47,-1.62,-88.52,-1.62,-42.57,-1.62,3.38,-1.62,49.32,-1.62,95.27,-1.62,141.22,-1.62,187.17,-1.62,-180.41,45.08,-134.47,45.08,-88.52,45.08,-42.57,45.08,3.38,45.08,49.32,45.08,95.27,45.08,141.22,45.08,187.17,45.08,-180.41,91.79,-134.47,91.79,-88.52,91.79,-42.57,91.79,3.38,91.79,49.32,91.79,95.27,91.79,141.22,91.79,187.17,91.79,-180.41,138.49,-134.47,138.49,-88.52,138.49,-42.57,138.49,3.38,138.49,49.32,138.49,95.27,138.49,141.22,138.49,187.17,138.49,-180.41,185.19,-134.47,185.19,-88.52,185.19,-42.57,185.19,3.38,185.19,49.32,185.19,95.27,185.19,141.22,185.19,187.17,185.19]},{"type":"surface","name":"B_HAIR_TWIN.07","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-78.23,-162.39,-71.61,-162.39,-64.99,-162.39,-58.37,-162.39,-51.74,-162.39,-45.12,-162.39,-38.5,-162.39,-31.88,-162.39,-25.26,-162.39,-78.23,-150.25,-71.61,-150.25,-64.99,-150.25,-58.37,-150.25,-51.74,-150.25,-45.12,-150.25,-38.5,-150.25,-31.88,-150.25,-25.26,-150.25,-78.23,-138.11,-71.61,-138.11,-64.99,-138.11,-58.37,-138.11,-51.74,-138.11,-45.12,-138.11,-38.5,-138.11,-31.88,-138.11,-25.26,-138.11,-78.23,-125.97,-71.61,-125.97,-64.99,-125.97,-58.37,-125.97,-51.74,-125.97,-45.12,-125.97,-38.5,-125.97,-31.88,-125.97,-25.26,-125.97,-78.23,-113.83,-71.61,-113.83,-64.99,-113.83,-58.37,-113.83,-51.74,-113.83,-45.12,-113.83,-38.5,-113.83,-31.88,-113.83,-25.26,-113.83,-78.23,-101.69,-71.61,-101.69,-64.99,-101.69,-58.37,-101.69,-51.74,-101.69,-45.12,-101.69,-38.5,-101.69,-31.88,-101.69,-25.26,-101.69,-78.23,-89.55,-71.61,-89.55,-64.99,-89.55,-58.37,-89.55,-51.74,-89.55,-45.12,-89.55,-38.5,-89.55,-31.88,-89.55,-25.26,-89.55,-78.23,-77.41,-71.61,-77.41,-64.99,-77.41,-58.37,-77.41,-51.74,-77.41,-45.12,-77.41,-38.5,-77.41,-31.88,-77.41,-25.26,-77.41,-78.23,-65.28,-71.61,-65.28,-64.99,-65.28,-58.37,-65.28,-51.74,-65.28,-45.12,-65.28,-38.5,-65.28,-31.88,-65.28,-25.26,-65.28]},{"type":"surface","name":"B_HAIR_TWIN.16","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-104.3,-187.92,-70.44,-187.92,-36.59,-187.92,-2.74,-187.92,31.11,-187.92,64.97,-187.92,98.82,-187.92,132.67,-187.92,166.53,-187.92,-104.3,-141.39,-70.44,-141.39,-36.59,-141.39,-2.74,-141.39,31.11,-141.39,64.97,-141.39,98.82,-141.39,132.67,-141.39,166.53,-141.39,-104.3,-94.87,-70.44,-94.87,-36.59,-94.87,-2.74,-94.87,31.11,-94.87,64.97,-94.87,98.82,-94.87,132.67,-94.87,166.53,-94.87,-104.3,-48.34,-70.44,-48.34,-36.59,-48.34,-2.74,-48.34,31.11,-48.34,64.97,-48.34,98.82,-48.34,132.67,-48.34,166.53,-48.34,-104.3,-1.81,-70.44,-1.81,-36.59,-1.81,-2.74,-1.81,31.11,-1.81,64.97,-1.81,98.82,-1.81,132.67,-1.81,166.53,-1.81,-104.3,44.71,-70.44,44.71,-36.59,44.71,-2.74,44.71,31.11,44.71,64.97,44.71,98.82,44.71,132.67,44.71,166.53,44.71,-104.3,91.24,-70.44,91.24,-36.59,91.24,-2.74,91.24,31.11,91.24,64.97,91.24,98.82,91.24,132.67,91.24,166.53,91.24,-104.3,137.76,-70.44,137.76,-36.59,137.76,-2.74,137.76,31.11,137.76,64.97,137.76,98.82,137.76,132.67,137.76,166.53,137.76,-104.3,184.29,-70.44,184.29,-36.59,184.29,-2.74,184.29,31.11,184.29,64.97,184.29,98.82,184.29,132.67,184.29,166.53,184.29]},{"type":"surface","name":"B_HAIR_TWIN.17","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-106.57,-180.12,-71.06,-180.12,-35.55,-180.12,-0.04,-180.12,35.47,-180.12,70.98,-180.12,106.5,-180.12,142.01,-180.12,177.52,-180.12,-106.57,-137.16,-71.06,-137.16,-35.55,-137.16,-0.04,-137.16,35.47,-137.16,70.98,-137.16,106.5,-137.16,142.01,-137.16,177.52,-137.16,-106.57,-94.21,-71.06,-94.21,-35.55,-94.21,-0.04,-94.21,35.47,-94.21,70.98,-94.21,106.5,-94.21,142.01,-94.21,177.52,-94.21,-106.57,-51.25,-71.06,-51.25,-35.55,-51.25,-0.04,-51.25,35.47,-51.25,70.98,-51.25,106.5,-51.25,142.01,-51.25,177.52,-51.25,-106.57,-8.29,-71.06,-8.29,-35.55,-8.29,-0.04,-8.29,35.47,-8.29,70.98,-8.29,106.5,-8.29,142.01,-8.29,177.52,-8.29,-106.57,34.67,-71.06,34.67,-35.55,34.67,-0.04,34.67,35.47,34.67,70.98,34.67,106.5,34.67,142.01,34.67,177.52,34.67,-106.57,77.63,-71.06,77.63,-35.55,77.63,-0.04,77.63,35.47,77.63,70.98,77.63,106.5,77.63,142.01,77.63,177.52,77.63,-106.57,120.58,-71.06,120.58,-35.55,120.58,-0.04,120.58,35.47,120.58,70.98,120.58,106.5,120.58,142.01,120.58,177.52,120.58,-106.57,163.54,-71.06,163.54,-35.55,163.54,-0.04,163.54,35.47,163.54,70.98,163.54,106.5,163.54,142.01,163.54,177.52,163.54]},{"type":"surface","name":"B_HAIR_TWIN.18","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-100.75,-179.48,-66.05,-179.48,-31.36,-179.48,3.33,-179.48,38.02,-179.48,72.71,-179.48,107.41,-179.48,142.1,-179.48,176.79,-179.48,-100.75,-133.82,-66.05,-133.82,-31.36,-133.82,3.33,-133.82,38.02,-133.82,72.71,-133.82,107.41,-133.82,142.1,-133.82,176.79,-133.82,-100.75,-88.15,-66.05,-88.15,-31.36,-88.15,3.33,-88.15,38.02,-88.15,72.71,-88.15,107.41,-88.15,142.1,-88.15,176.79,-88.15,-100.75,-42.49,-66.05,-42.49,-31.36,-42.49,3.33,-42.49,38.02,-42.49,72.71,-42.49,107.41,-42.49,142.1,-42.49,176.79,-42.49,-100.75,3.18,-66.05,3.18,-31.36,3.18,3.33,3.18,38.02,3.18,72.71,3.18,107.41,3.18,142.1,3.18,176.79,3.18,-100.75,48.84,-66.05,48.84,-31.36,48.84,3.33,48.84,38.02,48.84,72.71,48.84,107.41,48.84,142.1,48.84,176.79,48.84,-100.75,94.51,-66.05,94.51,-31.36,94.51,3.33,94.51,38.02,94.51,72.71,94.51,107.41,94.51,142.1,94.51,176.79,94.51,-100.75,140.17,-66.05,140.17,-31.36,140.17,3.33,140.17,38.02,140.17,72.71,140.17,107.41,140.17,142.1,140.17,176.79,140.17,-100.75,185.84,-66.05,185.84,-31.36,185.84,3.33,185.84,38.02,185.84,72.71,185.84,107.41,185.84,142.1,185.84,176.79,185.84]},{"type":"surface","name":"B_HAIR_TWIN.19","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-123.6,-175.04,-92.26,-175.04,-60.92,-175.04,-29.57,-175.04,1.77,-175.04,33.11,-175.04,64.45,-175.04,95.8,-175.04,127.14,-175.04,-123.6,-132.49,-92.26,-132.49,-60.92,-132.49,-29.57,-132.49,1.77,-132.49,33.11,-132.49,64.45,-132.49,95.8,-132.49,127.14,-132.49,-123.6,-89.93,-92.26,-89.93,-60.92,-89.93,-29.57,-89.93,1.77,-89.93,33.11,-89.93,64.45,-89.93,95.8,-89.93,127.14,-89.93,-123.6,-47.38,-92.26,-47.38,-60.92,-47.38,-29.57,-47.38,1.77,-47.38,33.11,-47.38,64.45,-47.38,95.8,-47.38,127.14,-47.38,-123.6,-4.83,-92.26,-4.83,-60.92,-4.83,-29.57,-4.83,1.77,-4.83,33.11,-4.83,64.45,-4.83,95.8,-4.83,127.14,-4.83,-123.6,37.73,-92.26,37.73,-60.92,37.73,-29.57,37.73,1.77,37.73,33.11,37.73,64.45,37.73,95.8,37.73,127.14,37.73,-123.6,80.28,-92.26,80.28,-60.92,80.28,-29.57,80.28,1.77,80.28,33.11,80.28,64.45,80.28,95.8,80.28,127.14,80.28,-123.6,122.83,-92.26,122.83,-60.92,122.83,-29.57,122.83,1.77,122.83,33.11,122.83,64.45,122.83,95.8,122.83,127.14,122.83,-123.6,165.38,-92.26,165.38,-60.92,165.38,-29.57,165.38,1.77,165.38,33.11,165.38,64.45,165.38,95.8,165.38,127.14,165.38]},{"type":"surface","name":"B_HAIR_TWIN.20","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-132.4,-166.1,-102.9,-166.1,-73.41,-166.1,-43.92,-166.1,-14.42,-166.1,15.07,-166.1,44.57,-166.1,74.06,-166.1,103.55,-166.1,-132.4,-129.59,-102.9,-129.59,-73.41,-129.59,-43.92,-129.59,-14.42,-129.59,15.07,-129.59,44.57,-129.59,74.06,-129.59,103.55,-129.59,-132.4,-93.08,-102.9,-93.08,-73.41,-93.08,-43.92,-93.08,-14.42,-93.08,15.07,-93.08,44.57,-93.08,74.06,-93.08,103.55,-93.08,-132.4,-56.58,-102.9,-56.58,-73.41,-56.58,-43.92,-56.58,-14.42,-56.58,15.07,-56.58,44.57,-56.58,74.06,-56.58,103.55,-56.58,-132.4,-20.07,-102.9,-20.07,-73.41,-20.07,-43.92,-20.07,-14.42,-20.07,15.07,-20.07,44.57,-20.07,74.06,-20.07,103.55,-20.07,-132.4,16.44,-102.9,16.44,-73.41,16.44,-43.92,16.44,-14.42,16.44,15.07,16.44,44.57,16.44,74.06,16.44,103.55,16.44,-132.4,52.94,-102.9,52.94,-73.41,52.94,-43.92,52.94,-14.42,52.94,15.07,52.94,44.57,52.94,74.06,52.94,103.55,52.94,-132.4,89.45,-102.9,89.45,-73.41,89.45,-43.92,89.45,-14.42,89.45,15.07,89.45,44.57,89.45,74.06,89.45,103.55,89.45,-132.4,125.95,-102.9,125.95,-73.41,125.95,-43.92,125.95,-14.42,125.95,15.07,125.95,44.57,125.95,74.06,125.95,103.55,125.95]},{"type":"surface","name":"B_HAIR_TWIN.21","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-92.9,-166.34,-75.27,-166.34,-57.65,-166.34,-40.02,-166.34,-22.4,-166.34,-4.77,-166.34,12.86,-166.34,30.48,-166.34,48.11,-166.34,-92.9,-126.55,-75.27,-126.55,-57.65,-126.55,-40.02,-126.55,-22.4,-126.55,-4.77,-126.55,12.86,-126.55,30.48,-126.55,48.11,-126.55,-92.9,-86.75,-75.27,-86.75,-57.65,-86.75,-40.02,-86.75,-22.4,-86.75,-4.77,-86.75,12.86,-86.75,30.48,-86.75,48.11,-86.75,-92.9,-46.96,-75.27,-46.96,-57.65,-46.96,-40.02,-46.96,-22.4,-46.96,-4.77,-46.96,12.86,-46.96,30.48,-46.96,48.11,-46.96,-92.9,-7.17,-75.27,-7.17,-57.65,-7.17,-40.02,-7.17,-22.4,-7.17,-4.77,-7.17,12.86,-7.17,30.48,-7.17,48.11,-7.17,-92.9,32.63,-75.27,32.63,-57.65,32.63,-40.02,32.63,-22.4,32.63,-4.77,32.63,12.86,32.63,30.48,32.63,48.11,32.63,-92.9,72.42,-75.27,72.42,-57.65,72.42,-40.02,72.42,-22.4,72.42,-4.77,72.42,12.86,72.42,30.48,72.42,48.11,72.42,-92.9,112.21,-75.27,112.21,-57.65,112.21,-40.02,112.21,-22.4,112.21,-4.77,112.21,12.86,112.21,30.48,112.21,48.11,112.21,-92.9,152,-75.27,152,-57.65,152,-40.02,152,-22.4,152,-4.77,152,12.86,152,30.48,152,48.11,152]},{"type":"surface","name":"B_HAIR_TWIN.08","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-3.5,-163.12,5.94,-163.12,15.38,-163.12,24.81,-163.12,34.25,-163.12,43.69,-163.12,53.13,-163.12,62.57,-163.12,72.01,-163.12,-3.5,-151.57,5.94,-151.57,15.38,-151.57,24.81,-151.57,34.25,-151.57,43.69,-151.57,53.13,-151.57,62.57,-151.57,72.01,-151.57,-3.5,-140.01,5.94,-140.01,15.38,-140.01,24.81,-140.01,34.25,-140.01,43.69,-140.01,53.13,-140.01,62.57,-140.01,72.01,-140.01,-3.5,-128.46,5.94,-128.46,15.38,-128.46,24.81,-128.46,34.25,-128.46,43.69,-128.46,53.13,-128.46,62.57,-128.46,72.01,-128.46,-3.5,-116.91,5.94,-116.91,15.38,-116.91,24.81,-116.91,34.25,-116.91,43.69,-116.91,53.13,-116.91,62.57,-116.91,72.01,-116.91,-3.5,-105.35,5.94,-105.35,15.38,-105.35,24.81,-105.35,34.25,-105.35,43.69,-105.35,53.13,-105.35,62.57,-105.35,72.01,-105.35,-3.5,-93.8,5.94,-93.8,15.38,-93.8,24.81,-93.8,34.25,-93.8,43.69,-93.8,53.13,-93.8,62.57,-93.8,72.01,-93.8,-3.5,-82.25,5.94,-82.25,15.38,-82.25,24.81,-82.25,34.25,-82.25,43.69,-82.25,53.13,-82.25,62.57,-82.25,72.01,-82.25,-3.5,-70.7,5.94,-70.7,15.38,-70.7,24.81,-70.7,34.25,-70.7,43.69,-70.7,53.13,-70.7,62.57,-70.7,72.01,-70.7]},{"type":"surface","name":"B_HAIR_TWIN.02","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-140.26,-182.52,-110.87,-182.52,-81.49,-182.52,-52.11,-182.52,-22.72,-182.52,6.66,-182.52,36.05,-182.52,65.43,-182.52,94.81,-182.52,-140.26,-140.16,-110.87,-140.16,-81.49,-140.16,-52.11,-140.16,-22.72,-140.16,6.66,-140.16,36.05,-140.16,65.43,-140.16,94.81,-140.16,-140.26,-97.8,-110.87,-97.8,-81.49,-97.8,-52.11,-97.8,-22.72,-97.8,6.66,-97.8,36.05,-97.8,65.43,-97.8,94.81,-97.8,-140.26,-55.44,-110.87,-55.44,-81.49,-55.44,-52.11,-55.44,-22.72,-55.44,6.66,-55.44,36.05,-55.44,65.43,-55.44,94.81,-55.44,-140.26,-13.07,-110.87,-13.07,-81.49,-13.07,-52.11,-13.07,-22.72,-13.07,6.66,-13.07,36.05,-13.07,65.43,-13.07,94.81,-13.07,-140.26,29.29,-110.87,29.29,-81.49,29.29,-52.11,29.29,-22.72,29.29,6.66,29.29,36.05,29.29,65.43,29.29,94.81,29.29,-140.26,71.65,-110.87,71.65,-81.49,71.65,-52.11,71.65,-22.72,71.65,6.66,71.65,36.05,71.65,65.43,71.65,94.81,71.65,-140.26,114.02,-110.87,114.02,-81.49,114.02,-52.11,114.02,-22.72,114.02,6.66,114.02,36.05,114.02,65.43,114.02,94.81,114.02,-140.26,156.38,-110.87,156.38,-81.49,156.38,-52.11,156.38,-22.72,156.38,6.66,156.38,36.05,156.38,65.43,156.38,94.81,156.38]},{"type":"surface","name":"B_HAIR_TWIN.09","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-138.59,-191.25,-110.85,-191.29,-83.11,-191.33,-55.38,-191.37,-27.64,-191.41,0.1,-191.45,27.84,-191.49,55.57,-191.53,83.31,-191.57,-138.31,-145.23,-110.57,-145.26,-82.83,-145.3,-55.1,-145.34,-27.36,-145.38,0.38,-145.42,28.12,-145.46,55.85,-145.5,83.59,-145.54,-138.03,-99.2,-110.29,-99.24,-82.55,-99.28,-54.81,-99.32,-27.08,-99.35,0.66,-99.39,28.4,-99.43,56.13,-99.47,83.87,-99.51,-137.75,-53.17,-110.01,-53.21,-82.27,-53.25,-54.53,-53.29,-26.8,-53.33,0.94,-53.37,28.68,-53.41,56.42,-53.44,84.15,-53.48,-137.46,-7.14,-109.73,-7.18,-81.99,-7.22,-54.25,-7.26,-26.52,-7.3,1.22,-7.34,28.96,-7.38,56.7,-7.42,84.43,-7.46,-137.18,38.88,-109.45,38.84,-81.71,38.81,-53.97,38.77,-26.23,38.73,1.5,38.69,29.24,38.65,56.98,38.61,84.71,38.57,-136.9,84.91,-109.17,84.87,-81.43,84.83,-53.69,84.79,-25.95,84.75,1.78,84.72,29.52,84.68,57.26,84.64,85,84.6,-136.62,130.94,-108.88,130.9,-81.15,130.86,-53.41,130.82,-25.67,130.78,2.06,130.74,29.8,130.7,57.54,130.66,85.28,130.63,-136.34,176.96,-108.6,176.93,-80.87,176.89,-53.13,176.85,-25.39,176.81,2.35,176.77,30.08,176.73,57.82,176.69,85.56,176.65]},{"type":"surface","name":"B_HAIR_TWIN.10","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-144.51,-183.13,-104.01,-183.13,-63.52,-183.13,-23.02,-183.13,17.48,-183.13,57.97,-183.13,98.47,-183.13,138.96,-183.13,179.46,-183.13,-144.51,-137.66,-104.01,-137.66,-63.52,-137.66,-23.02,-137.66,17.48,-137.66,57.97,-137.66,98.47,-137.66,138.96,-137.66,179.46,-137.66,-144.51,-92.19,-104.01,-92.19,-63.52,-92.19,-23.02,-92.19,17.48,-92.19,57.97,-92.19,98.47,-92.19,138.96,-92.19,179.46,-92.19,-144.51,-46.71,-104.01,-46.71,-63.52,-46.71,-23.02,-46.71,17.48,-46.71,57.97,-46.71,98.47,-46.71,138.96,-46.71,179.46,-46.71,-144.51,-1.24,-104.01,-1.24,-63.52,-1.24,-23.02,-1.24,17.48,-1.24,57.97,-1.24,98.47,-1.24,138.96,-1.24,179.46,-1.24,-144.51,44.23,-104.01,44.23,-63.52,44.23,-23.02,44.23,17.48,44.23,57.97,44.23,98.47,44.23,138.96,44.23,179.46,44.23,-144.51,89.71,-104.01,89.71,-63.52,89.71,-23.02,89.71,17.48,89.71,57.97,89.71,98.47,89.71,138.96,89.71,179.46,89.71,-144.51,135.18,-104.01,135.18,-63.52,135.18,-23.02,135.18,17.48,135.18,57.97,135.18,98.47,135.18,138.96,135.18,179.46,135.18,-144.51,180.65,-104.01,180.65,-63.52,180.65,-23.02,180.65,17.48,180.65,57.97,180.65,98.47,180.65,138.96,180.65,179.46,180.65]},{"type":"surface","name":"B_HAIR_TWIN.11","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-97.49,-194.19,-67.77,-194.19,-38.05,-194.19,-8.33,-194.19,21.39,-194.19,51.11,-194.19,80.83,-194.19,110.55,-194.19,140.27,-194.19,-97.49,-146.78,-67.77,-146.78,-38.05,-146.78,-8.33,-146.78,21.39,-146.78,51.11,-146.78,80.83,-146.78,110.55,-146.78,140.27,-146.78,-97.49,-99.36,-67.77,-99.36,-38.05,-99.36,-8.33,-99.36,21.39,-99.36,51.11,-99.36,80.83,-99.36,110.55,-99.36,140.27,-99.36,-97.49,-51.95,-67.77,-51.95,-38.05,-51.95,-8.33,-51.95,21.39,-51.95,51.11,-51.95,80.83,-51.95,110.55,-51.95,140.27,-51.95,-97.49,-4.54,-67.77,-4.54,-38.05,-4.54,-8.33,-4.54,21.39,-4.54,51.11,-4.54,80.83,-4.54,110.55,-4.54,140.27,-4.54,-97.49,42.88,-67.77,42.88,-38.05,42.88,-8.33,42.88,21.39,42.88,51.11,42.88,80.83,42.88,110.55,42.88,140.27,42.88,-97.49,90.29,-67.77,90.29,-38.05,90.29,-8.33,90.29,21.39,90.29,51.11,90.29,80.83,90.29,110.55,90.29,140.27,90.29,-97.49,137.71,-67.77,137.71,-38.05,137.71,-8.33,137.71,21.39,137.71,51.11,137.71,80.83,137.71,110.55,137.71,140.27,137.71,-97.49,185.12,-67.77,185.12,-38.05,185.12,-8.33,185.12,21.39,185.12,51.11,185.12,80.83,185.12,110.55,185.12,140.27,185.12]},{"type":"surface","name":"B_HAIR_TWIN.12","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-39.07,-158.26,-20.86,-158.26,-2.66,-158.26,15.54,-158.26,33.74,-158.26,51.94,-158.26,70.14,-158.26,88.34,-158.26,106.54,-158.26,-39.07,-115.02,-20.86,-115.02,-2.66,-115.02,15.54,-115.02,33.74,-115.02,51.94,-115.02,70.14,-115.02,88.34,-115.02,106.54,-115.02,-39.07,-71.77,-20.86,-71.77,-2.66,-71.77,15.54,-71.77,33.74,-71.77,51.94,-71.77,70.14,-71.77,88.34,-71.77,106.54,-71.77,-39.07,-28.53,-20.86,-28.53,-2.66,-28.53,15.54,-28.53,33.74,-28.53,51.94,-28.53,70.14,-28.53,88.34,-28.53,106.54,-28.53,-39.07,14.72,-20.86,14.72,-2.66,14.72,15.54,14.72,33.74,14.72,51.94,14.72,70.14,14.72,88.34,14.72,106.54,14.72,-39.07,57.97,-20.86,57.97,-2.66,57.97,15.54,57.97,33.74,57.97,51.94,57.97,70.14,57.97,88.34,57.97,106.54,57.97,-39.07,101.21,-20.86,101.21,-2.66,101.21,15.54,101.21,33.74,101.21,51.94,101.21,70.14,101.21,88.34,101.21,106.54,101.21,-39.07,144.46,-20.86,144.46,-2.66,144.46,15.54,144.46,33.74,144.46,51.94,144.46,70.14,144.46,88.34,144.46,106.54,144.46,-39.07,187.7,-20.86,187.7,-2.66,187.7,15.54,187.7,33.74,187.7,51.94,187.7,70.14,187.7,88.34,187.7,106.54,187.7]},{"type":"surface","name":"B_HAIR_TWIN.13","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-174.36,-138.73,-138.23,-138.73,-102.11,-138.73,-65.98,-138.73,-29.85,-138.73,6.27,-138.73,42.4,-138.73,78.53,-138.73,114.66,-138.73,-174.36,-101.83,-138.23,-101.83,-102.11,-101.83,-65.98,-101.83,-29.85,-101.83,6.27,-101.83,42.4,-101.83,78.53,-101.83,114.66,-101.83,-174.36,-64.93,-138.23,-64.93,-102.11,-64.93,-65.98,-64.93,-29.85,-64.93,6.27,-64.93,42.4,-64.93,78.53,-64.93,114.66,-64.93,-174.36,-28.03,-138.23,-28.03,-102.11,-28.03,-65.98,-28.03,-29.85,-28.03,6.27,-28.03,42.4,-28.03,78.53,-28.03,114.66,-28.03,-174.36,8.87,-138.23,8.87,-102.11,8.87,-65.98,8.87,-29.85,8.87,6.27,8.87,42.4,8.87,78.53,8.87,114.66,8.87,-174.36,45.77,-138.23,45.77,-102.11,45.77,-65.98,45.77,-29.85,45.77,6.27,45.77,42.4,45.77,78.53,45.77,114.66,45.77,-174.36,82.67,-138.23,82.67,-102.11,82.67,-65.98,82.67,-29.85,82.67,6.27,82.67,42.4,82.67,78.53,82.67,114.66,82.67,-174.36,119.57,-138.23,119.57,-102.11,119.57,-65.98,119.57,-29.85,119.57,6.27,119.57,42.4,119.57,78.53,119.57,114.66,119.57,-174.36,156.47,-138.23,156.47,-102.11,156.47,-65.98,156.47,-29.85,156.47,6.27,156.47,42.4,156.47,78.53,156.47,114.66,156.47]},{"type":"surface","name":"B_HAIR_TWIN.14","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-83.44,-176.67,-61.19,-176.67,-38.94,-176.67,-16.69,-176.67,5.56,-176.67,27.81,-176.67,50.06,-176.67,72.31,-176.67,94.56,-176.67,-83.44,-136.78,-61.19,-136.78,-38.94,-136.78,-16.69,-136.78,5.56,-136.78,27.81,-136.78,50.06,-136.78,72.31,-136.78,94.56,-136.78,-83.44,-96.89,-61.19,-96.89,-38.94,-96.89,-16.69,-96.89,5.56,-96.89,27.81,-96.89,50.06,-96.89,72.31,-96.89,94.56,-96.89,-83.44,-57.01,-61.19,-57.01,-38.94,-57.01,-16.69,-57.01,5.56,-57.01,27.81,-57.01,50.06,-57.01,72.31,-57.01,94.56,-57.01,-83.44,-17.12,-61.19,-17.12,-38.94,-17.12,-16.69,-17.12,5.56,-17.12,27.81,-17.12,50.06,-17.12,72.31,-17.12,94.56,-17.12,-83.44,22.77,-61.19,22.77,-38.94,22.77,-16.69,22.77,5.56,22.77,27.81,22.77,50.06,22.77,72.31,22.77,94.56,22.77,-83.44,62.66,-61.19,62.66,-38.94,62.66,-16.69,62.66,5.56,62.66,27.81,62.66,50.06,62.66,72.31,62.66,94.56,62.66,-83.44,102.55,-61.19,102.55,-38.94,102.55,-16.69,102.55,5.56,102.55,27.81,102.55,50.06,102.55,72.31,102.55,94.56,102.55,-83.44,142.44,-61.19,142.44,-38.94,142.44,-16.69,142.44,5.56,142.44,27.81,142.44,50.06,142.44,72.31,142.44,94.56,142.44]},{"type":"surface","name":"B_HAIR_BACK.01","parent":"B_HAIR_BACK.02","segmentX":8,"segmentY":8,"vertices":[-187.83,-189.04,-141.02,-189.04,-94.22,-189.04,-47.41,-189.04,-0.6,-189.04,46.21,-189.04,93.01,-189.04,139.82,-189.04,186.63,-189.04,-187.83,-141.96,-141.02,-141.96,-94.22,-141.96,-47.41,-141.96,-0.6,-141.96,46.21,-141.96,93.01,-141.96,139.82,-141.96,186.63,-141.96,-187.83,-94.87,-141.02,-94.87,-94.22,-94.87,-47.41,-94.87,-0.6,-94.87,46.21,-94.87,93.01,-94.87,139.82,-94.87,186.63,-94.87,-187.83,-47.79,-141.02,-47.79,-94.22,-47.79,-47.41,-47.79,-0.6,-47.79,46.21,-47.79,93.01,-47.79,139.82,-47.79,186.63,-47.79,-187.83,-0.71,-141.02,-0.71,-94.22,-0.71,-47.41,-0.71,-0.6,-0.71,46.21,-0.71,93.01,-0.71,139.82,-0.71,186.63,-0.71,-187.83,46.38,-141.02,46.38,-94.22,46.38,-47.41,46.38,-0.6,46.38,46.21,46.38,93.01,46.38,139.82,46.38,186.63,46.38,-187.83,93.46,-141.02,93.46,-94.22,93.46,-47.41,93.46,-0.6,93.46,46.21,93.46,93.01,93.46,139.82,93.46,186.63,93.46,-187.83,140.55,-141.02,140.55,-94.22,140.55,-47.41,140.55,-0.6,140.55,46.21,140.55,93.01,140.55,139.82,140.55,186.63,140.55,-187.83,187.63,-141.02,187.63,-94.22,187.63,-47.41,187.63,-0.6,187.63,46.21,187.63,93.01,187.63,139.82,187.63,186.63,187.63]},{"length":150,"name":"B_CLOTHES.04","parent":"B_CLOTHES.07","transform":{"x":378.48,"y":-15.7,"skX":105.9,"skY":105.9}},{"type":"surface","name":"B_CLOTHES.06","parent":"B_CLOTHES.07","segmentX":8,"segmentY":8,"vertices":[-174.38,154.24,-170.89,110.84,-167.4,67.44,-163.9,24.05,-160.41,-19.35,-156.92,-62.74,-153.43,-106.14,-149.94,-149.54,-146.45,-192.93,-84.54,161.47,-81.05,118.07,-77.55,74.67,-74.06,31.28,-70.57,-12.12,-67.08,-55.52,-63.59,-98.91,-60.1,-142.31,-56.6,-185.7,5.3,168.69,8.8,125.3,12.29,81.9,15.78,38.51,19.27,-4.89,22.76,-48.29,26.25,-91.68,29.74,-135.08,33.24,-178.48,95.14,175.92,98.64,132.53,102.13,89.13,105.62,45.73,109.11,2.34,112.6,-41.06,116.09,-84.45,119.59,-127.85,123.08,-171.25,184.99,183.15,188.48,139.75,191.97,96.36,195.46,52.96,198.95,9.57,202.44,-33.83,205.94,-77.23,209.43,-120.62,212.92,-164.02,274.83,190.38,278.32,146.98,281.81,103.59,285.3,60.19,288.79,16.79,292.29,-26.6,295.78,-70,299.27,-113.39,302.76,-156.79,364.67,197.61,368.16,154.21,371.65,110.82,375.14,67.42,378.63,24.02,382.13,-19.37,385.62,-62.77,389.11,-106.17,392.6,-149.56,454.51,204.84,458,161.44,461.49,118.04,464.98,74.65,468.48,31.25,471.97,-12.14,475.46,-55.54,478.95,-98.94,482.44,-142.33,544.35,212.06,547.84,168.67,551.33,125.27,554.83,81.88,558.32,38.48,561.81,-4.92,565.3,-48.31,568.79,-91.71,572.28,-135.1]},{"length":150,"name":"B_HAND.08","parent":"B_CLOTHES.04","transform":{"x":301.23,"y":13.91,"skX":-3.1,"skY":-3.1}},{"type":"surface","name":"B_HAND.11","parent":"B_HAND.08","segmentX":8,"segmentY":8,"vertices":[330.78,106.23,279.15,114.49,227.52,122.75,175.89,131.01,124.26,139.27,72.63,147.53,21.01,155.8,-30.62,164.06,-82.25,172.32,324.91,69.57,273.29,77.83,221.66,86.09,170.03,94.35,118.4,102.61,66.77,110.87,15.14,119.14,-36.49,127.4,-88.12,135.66,319.05,32.9,267.42,41.17,215.79,49.43,164.16,57.69,112.53,65.95,60.9,74.21,9.27,82.47,-42.36,90.74,-93.99,99,313.18,-3.76,261.55,4.51,209.92,12.77,158.29,21.03,106.66,29.29,55.04,37.55,3.41,45.81,-48.22,54.08,-99.85,62.34,307.31,-40.42,255.69,-32.16,204.06,-23.89,152.43,-15.63,100.8,-7.37,49.17,0.89,-2.46,9.15,-54.09,17.41,-105.72,25.68,301.45,-77.08,249.82,-68.82,198.19,-60.55,146.56,-52.29,94.93,-44.03,43.3,-35.77,-8.33,-27.51,-59.96,-19.25,-111.59,-10.98,295.58,-113.74,243.95,-105.48,192.32,-97.21,140.69,-88.95,89.07,-80.69,37.44,-72.43,-14.19,-64.17,-65.82,-55.91,-117.45,-47.64,289.72,-150.4,238.09,-142.14,186.46,-133.88,134.83,-125.61,83.2,-117.35,31.57,-109.09,-20.06,-100.83,-71.69,-92.57,-123.32,-84.3,283.85,-187.06,232.22,-178.8,180.59,-170.54,128.96,-162.27,77.33,-154.01,25.7,-145.75,-25.93,-137.49,-77.55,-129.23,-129.18,-120.97]},{"type":"surface","name":"B_CLOTHES.29","parent":"B_CLOTHES.31","segmentX":8,"segmentY":8,"vertices":[-157.12,151.21,-159.37,118.08,-161.63,84.95,-163.89,51.82,-166.15,18.69,-168.41,-14.44,-170.67,-47.57,-172.93,-80.71,-175.18,-113.84,-72.16,145.42,-74.42,112.29,-76.68,79.16,-78.93,46.03,-81.19,12.9,-83.45,-20.24,-85.71,-53.37,-87.97,-86.5,-90.23,-119.63,12.8,139.63,10.54,106.5,8.28,73.37,6.02,40.23,3.76,7.1,1.5,-26.03,-0.75,-59.16,-3.01,-92.29,-5.27,-125.42,97.75,133.84,95.5,100.7,93.24,67.57,90.98,34.44,88.72,1.31,86.46,-31.82,84.2,-64.95,81.94,-98.08,79.68,-131.21,182.71,128.04,180.45,94.91,178.19,61.78,175.93,28.65,173.68,-4.48,171.42,-37.61,169.16,-70.74,166.9,-103.87,164.64,-137,267.67,122.25,265.41,89.12,263.15,55.99,260.89,22.86,258.63,-10.27,256.37,-43.4,254.12,-76.53,251.86,-109.66,249.6,-142.8,352.62,116.46,350.36,83.33,348.11,50.2,345.85,17.07,343.59,-16.06,341.33,-49.19,339.07,-82.33,336.81,-115.46,334.55,-148.59,437.58,110.67,435.32,77.54,433.06,44.41,430.8,11.28,428.55,-21.86,426.29,-54.99,424.03,-88.12,421.77,-121.25,419.51,-154.38,522.54,104.88,520.28,71.75,518.02,38.61,515.76,5.48,513.5,-27.65,511.24,-60.78,508.98,-93.91,506.73,-127.04,504.47,-160.17]},{"type":"surface","name":"B_CLOTHES.25","parent":"B_CLOTHES.32","segmentX":8,"segmentY":8,"vertices":[-205.93,-75.6,-122.82,-96.93,-40.47,-118.1,34.91,-137.78,107.9,-156.96,180.89,-176.14,253.87,-195.31,326.86,-214.49,399.85,-233.67,-192.95,-39.29,-111.05,-59.36,-29.81,-79.28,45.2,-98.61,118.19,-117.79,191.18,-136.96,264.17,-156.14,337.16,-175.32,410.14,-194.49,-180.17,-2.76,-99.4,-21.65,-19.21,-40.42,55.49,-59.44,128.48,-78.61,201.47,-97.79,274.46,-116.97,347.45,-136.14,420.44,-155.32,-169.07,35.82,-88.76,17.29,-8.98,-1.24,65.78,-20.26,138.77,-39.44,211.76,-58.62,284.75,-77.79,357.74,-96.97,430.73,-116.15,-156.92,75.86,-77.44,56.95,1.55,38.02,76.07,18.91,149.06,-0.27,222.05,-19.44,295.04,-38.62,368.03,-57.8,441.02,-76.97,-144.77,115.89,-66.12,96.61,12.08,77.29,86.36,58.08,159.35,38.91,232.34,19.73,305.33,0.55,378.32,-18.62,451.31,-37.8,-133,155.1,-55.21,135.76,22.28,116.51,96.36,97.33,166.81,78.8,237.26,60.28,310.74,40.93,385.39,21.24,460.15,1.71,-117.57,194.13,-42.11,174.86,33.21,155.65,106.33,136.52,173.18,118.17,240.02,99.83,313.3,80.64,388.94,61.36,464.78,42.2,-101.73,233.13,-28.74,213.96,44.25,194.78,116.32,175.69,179.59,157.43,242.85,139.16,315.8,120.19,392.23,101.48,468.94,82.8]},{"type":"surface","name":"B_CLOTHES.27","parent":"B_CLOTHES.33","segmentX":8,"segmentY":8,"vertices":[-113.21,-50.76,-82.71,-62.11,-52.22,-73.45,-21.72,-84.79,8.78,-96.13,39.28,-107.47,69.78,-118.82,100.27,-130.16,130.77,-141.5,-104.02,-26.04,-73.52,-37.38,-43.02,-48.72,-12.52,-60.06,17.98,-71.41,48.47,-82.75,78.97,-94.09,109.47,-105.43,139.97,-116.77,-94.82,-1.31,-64.32,-12.66,-33.83,-24,-3.33,-35.34,27.17,-46.68,57.67,-58.02,88.17,-69.37,118.66,-80.71,149.16,-92.05,-85.63,23.41,-55.13,12.07,-24.63,0.73,5.87,-10.62,36.37,-21.96,66.86,-33.3,97.36,-44.64,127.86,-55.98,158.36,-67.33,-76.43,48.14,-45.93,36.79,-15.44,25.45,15.06,14.11,45.56,2.77,76.06,-8.57,106.56,-19.92,137.05,-31.26,167.55,-42.6,-67.24,72.86,-36.74,61.52,-6.24,50.18,24.26,38.83,54.76,27.49,85.25,16.15,115.75,4.81,146.25,-6.53,176.75,-17.88,-58.04,97.58,-27.54,86.24,2.95,74.9,33.45,63.56,63.95,52.22,94.45,40.87,124.95,29.53,155.44,18.19,185.94,6.85,-48.85,122.31,-18.35,110.97,12.15,99.62,42.65,88.28,73.15,76.94,103.64,65.6,134.14,54.26,164.64,42.91,195.14,31.57,-39.65,147.03,-9.15,135.69,21.34,124.35,51.84,113.01,82.34,101.67,112.84,90.32,143.34,78.98,173.83,67.64,204.33,56.3]},{"type":"surface","name":"B_HOHO.01","parent":"B_FACE.01","segmentX":8,"segmentY":8,"vertices":[-122.66,2.8,-108.58,2.8,-94.5,2.8,-80.42,2.8,-66.35,2.8,-52.27,2.8,-38.19,2.8,-24.11,2.8,-10.03,2.8,-122.66,10.93,-108.58,10.93,-94.5,10.93,-80.42,10.93,-66.35,10.93,-52.27,10.93,-38.19,10.93,-24.11,10.93,-10.03,10.93,-122.66,19.05,-108.58,19.05,-94.5,19.05,-80.42,19.05,-66.35,19.05,-52.27,19.05,-38.19,19.05,-24.11,19.05,-10.03,19.05,-122.66,27.18,-108.58,27.18,-94.5,27.18,-80.42,27.18,-66.35,27.18,-52.27,27.18,-38.19,27.18,-24.11,27.18,-10.03,27.18,-122.66,35.3,-108.58,35.3,-94.5,35.3,-80.42,35.3,-66.35,35.3,-52.27,35.3,-38.19,35.3,-24.11,35.3,-10.03,35.3,-122.66,43.43,-108.58,43.43,-94.5,43.43,-80.42,43.43,-66.35,43.43,-52.27,43.43,-38.19,43.43,-24.11,43.43,-10.03,43.43,-122.66,51.56,-108.58,51.56,-94.5,51.56,-80.42,51.56,-66.35,51.56,-52.27,51.56,-38.19,51.56,-24.11,51.56,-10.03,51.56,-122.66,59.68,-108.58,59.68,-94.5,59.68,-80.42,59.68,-66.35,59.68,-52.27,59.68,-38.19,59.68,-24.11,59.68,-10.03,59.68,-122.66,67.81,-108.58,67.81,-94.5,67.81,-80.42,67.81,-66.35,67.81,-52.27,67.81,-38.19,67.81,-24.11,67.81,-10.03,67.81]},{"type":"surface","name":"B_HOHO.02","parent":"B_FACE.01","segmentX":8,"segmentY":8,"vertices":[18.1,-8.23,30.17,-8.23,42.24,-8.23,54.3,-8.23,66.37,-8.23,78.44,-8.23,90.51,-8.23,102.58,-8.23,114.65,-8.23,18.1,1.51,30.17,1.51,42.24,1.51,54.3,1.51,66.37,1.51,78.44,1.51,90.51,1.51,102.58,1.51,114.65,1.51,18.1,11.24,30.17,11.24,42.24,11.24,54.3,11.24,66.37,11.24,78.44,11.24,90.51,11.24,102.58,11.24,114.65,11.24,18.1,20.98,30.17,20.98,42.24,20.98,54.3,20.98,66.37,20.98,78.44,20.98,90.51,20.98,102.58,20.98,114.65,20.98,18.1,30.71,30.17,30.71,42.24,30.71,54.3,30.71,66.37,30.71,78.44,30.71,90.51,30.71,102.58,30.71,114.65,30.71,18.1,40.44,30.17,40.44,42.24,40.44,54.3,40.44,66.37,40.44,78.44,40.44,90.51,40.44,102.58,40.44,114.65,40.44,18.1,50.18,30.17,50.18,42.24,50.18,54.3,50.18,66.37,50.18,78.44,50.18,90.51,50.18,102.58,50.18,114.65,50.18,18.1,59.91,30.17,59.91,42.24,59.91,54.3,59.91,66.37,59.91,78.44,59.91,90.51,59.91,102.58,59.91,114.65,59.91,18.1,69.64,30.17,69.64,42.24,69.64,54.3,69.64,66.37,69.64,78.44,69.64,90.51,69.64,102.58,69.64,114.65,69.64]},{"type":"surface","name":"B_EYE_BALL.04","parent":"B_EYE_BALL.05","segmentX":8,"segmentY":8,"vertices":[-184.46,-187.34,-138.63,-187.34,-92.81,-187.34,-46.98,-187.34,-1.15,-187.34,44.67,-187.34,90.5,-187.34,136.33,-187.34,182.15,-187.34,-184.46,-140.36,-138.63,-140.36,-92.81,-140.36,-46.98,-140.36,-1.15,-140.36,44.67,-140.36,90.5,-140.36,136.33,-140.36,182.15,-140.36,-184.46,-93.37,-138.63,-93.37,-92.81,-93.37,-46.98,-93.37,-1.15,-93.37,44.67,-93.37,90.5,-93.37,136.33,-93.37,182.15,-93.37,-184.46,-46.39,-138.63,-46.39,-92.81,-46.39,-46.98,-46.39,-1.15,-46.39,44.67,-46.39,90.5,-46.39,136.33,-46.39,182.15,-46.39,-184.46,0.59,-138.63,0.59,-92.81,0.59,-46.98,0.59,-1.15,0.59,44.67,0.59,90.5,0.59,136.33,0.59,182.15,0.59,-184.46,47.58,-138.63,47.58,-92.81,47.58,-46.98,47.58,-1.15,47.58,44.67,47.58,90.5,47.58,136.33,47.58,182.15,47.58,-184.46,94.57,-138.63,94.57,-92.81,94.57,-46.98,94.57,-1.15,94.57,44.67,94.57,90.5,94.57,136.33,94.57,182.15,94.57,-184.46,141.55,-138.63,141.55,-92.81,141.55,-46.98,141.55,-1.15,141.55,44.67,141.55,90.5,141.55,136.33,141.55,182.15,141.55,-184.46,188.53,-138.63,188.53,-92.81,188.53,-46.98,188.53,-1.15,188.53,44.67,188.53,90.5,188.53,136.33,188.53,182.15,188.53]},{"type":"surface","name":"B_EYE_BALL.06","parent":"B_EYE_BALL.10","segmentX":8,"segmentY":8,"vertices":[-179.86,-180.79,-135.01,-180.79,-90.16,-180.79,-45.31,-180.79,-0.46,-180.79,44.39,-180.79,89.25,-180.79,134.1,-180.79,178.95,-180.79,-179.86,-134.65,-135.01,-134.65,-90.16,-134.65,-45.31,-134.65,-0.46,-134.65,44.39,-134.65,89.25,-134.65,134.1,-134.65,178.95,-134.65,-179.86,-88.52,-135.01,-88.52,-90.16,-88.52,-45.31,-88.52,-0.46,-88.52,44.39,-88.52,89.25,-88.52,134.1,-88.52,178.95,-88.52,-179.86,-42.38,-135.01,-42.38,-90.16,-42.38,-45.31,-42.38,-0.46,-42.38,44.39,-42.38,89.25,-42.38,134.1,-42.38,178.95,-42.38,-179.86,3.76,-135.01,3.76,-90.16,3.76,-45.31,3.76,-0.46,3.76,44.39,3.76,89.25,3.76,134.1,3.76,178.95,3.76,-179.86,49.89,-135.01,49.89,-90.16,49.89,-45.31,49.89,-0.46,49.89,44.39,49.89,89.25,49.89,134.1,49.89,178.95,49.89,-179.86,96.03,-135.01,96.03,-90.16,96.03,-45.31,96.03,-0.46,96.03,44.39,96.03,89.25,96.03,134.1,96.03,178.95,96.03,-179.86,142.17,-135.01,142.17,-90.16,142.17,-45.31,142.17,-0.46,142.17,44.39,142.17,89.25,142.17,134.1,142.17,178.95,142.17,-179.86,188.3,-135.01,188.3,-90.16,188.3,-45.31,188.3,-0.46,188.3,44.39,188.3,89.25,188.3,134.1,188.3,178.95,188.3]},{"type":"surface","name":"B_BROW.01","parent":"B_BROW.03","segmentX":8,"segmentY":8,"vertices":[-147.21,-84.12,-111.03,-84.12,-74.85,-84.12,-38.67,-84.12,-2.5,-84.12,33.68,-84.12,69.86,-84.12,106.04,-84.12,142.21,-84.12,-147.21,-62.46,-111.03,-62.46,-74.85,-62.46,-38.67,-62.46,-2.5,-62.46,33.68,-62.46,69.86,-62.46,106.04,-62.46,142.21,-62.46,-147.21,-40.8,-111.03,-40.8,-74.85,-40.8,-38.67,-40.8,-2.5,-40.8,33.68,-40.8,69.86,-40.8,106.04,-40.8,142.21,-40.8,-147.21,-19.14,-111.03,-19.14,-74.85,-19.14,-38.67,-19.14,-2.5,-19.14,33.68,-19.14,69.86,-19.14,106.04,-19.14,142.21,-19.14,-147.21,2.53,-111.03,2.53,-74.85,2.53,-38.67,2.53,-2.5,2.53,33.68,2.53,69.86,2.53,106.04,2.53,142.21,2.53,-147.21,24.19,-111.03,24.19,-74.85,24.19,-38.67,24.19,-2.5,24.19,33.68,24.19,69.86,24.19,106.04,24.19,142.21,24.19,-147.21,45.85,-111.03,45.85,-74.85,45.85,-38.67,45.85,-2.5,45.85,33.68,45.85,69.86,45.85,106.04,45.85,142.21,45.85,-147.21,67.51,-111.03,67.51,-74.85,67.51,-38.67,67.51,-2.5,67.51,33.68,67.51,69.86,67.51,106.04,67.51,142.21,67.51,-147.21,89.17,-111.03,89.17,-74.85,89.17,-38.67,89.17,-2.5,89.17,33.68,89.17,69.86,89.17,106.04,89.17,142.21,89.17]},{"type":"surface","name":"B_BROW.02","parent":"B_BROW.04","segmentX":8,"segmentY":8,"vertices":[-150.24,-90.12,-112.25,-90.11,-74.27,-90.1,-36.29,-90.1,1.68,-90.1,39.66,-90.09,77.64,-90.07,115.62,-90.04,153.59,-90.02,-150.24,-69.26,-112.26,-69.26,-74.28,-69.26,-36.3,-69.26,1.68,-69.28,39.66,-69.29,77.64,-69.29,115.62,-69.28,153.6,-69.26,-150.25,-48.45,-112.26,-48.44,-74.28,-48.45,-36.3,-48.47,1.68,-48.5,39.66,-48.51,77.64,-48.51,115.63,-48.51,153.61,-48.48,-150.25,-27.68,-112.26,-27.66,-74.28,-27.68,-36.3,-27.71,1.68,-27.76,39.66,-27.76,77.65,-27.76,115.63,-27.74,153.61,-27.69,-150.25,-6.93,-112.26,-6.92,-74.28,-6.93,-36.3,-6.98,1.68,-7.05,39.66,-7.04,77.64,-7.02,115.63,-6.99,153.62,-6.93,-150.25,13.83,-112.27,13.84,-74.28,13.83,-36.3,13.79,1.68,13.74,39.66,13.73,77.64,13.73,115.62,13.73,153.61,13.78,-150.25,34.55,-112.26,34.56,-74.28,34.55,-36.3,34.52,1.68,34.49,39.66,34.49,77.64,34.48,115.62,34.48,153.61,34.52,-150.24,55.2,-112.26,55.22,-74.27,55.22,-36.3,55.21,1.68,55.2,39.66,55.21,77.64,55.21,115.62,55.23,153.6,55.27,-150.22,75.75,-112.24,75.78,-74.26,75.81,-36.29,75.84,1.68,75.87,39.66,75.88,77.64,75.91,115.61,75.94,153.59,75.98]},{"type":"surface","name":"B_CLOTHES.03","parent":"B_CLOTHES.04","segmentX":8,"segmentY":8,"vertices":[608.76,150.34,524.79,167.12,440.82,183.9,356.85,200.67,272.89,217.45,188.92,234.23,104.95,251.01,20.98,267.79,-62.98,284.57,598.31,98.05,514.34,114.83,430.37,131.61,346.4,148.38,262.44,165.16,178.47,181.94,94.5,198.72,10.53,215.5,-73.43,232.28,587.86,45.76,503.89,62.54,419.92,79.32,335.96,96.09,251.99,112.87,168.02,129.65,84.05,146.43,0.09,163.21,-83.88,179.99,577.41,-6.53,493.44,10.25,409.47,27.03,325.51,43.8,241.54,60.58,157.57,77.36,73.6,94.14,-10.36,110.92,-94.33,127.7,566.96,-58.82,482.99,-42.04,399.03,-25.26,315.06,-8.49,231.09,8.29,147.12,25.07,63.16,41.85,-20.81,58.63,-104.78,75.41,556.51,-111.11,472.55,-94.33,388.58,-77.55,304.61,-60.78,220.64,-44,136.67,-27.22,52.71,-10.44,-31.26,6.34,-115.23,23.12,546.06,-163.4,462.1,-146.62,378.13,-129.84,294.16,-113.07,210.19,-96.29,126.23,-79.51,42.26,-62.73,-41.71,-45.95,-125.68,-29.17,535.62,-215.69,451.65,-198.91,367.68,-182.13,283.71,-165.36,199.75,-148.58,115.78,-131.8,31.81,-115.02,-52.16,-98.24,-136.13,-81.46,525.17,-267.98,441.2,-251.2,357.23,-234.43,273.26,-217.65,189.3,-200.87,105.33,-184.09,21.36,-167.31,-62.61,-150.53,-146.57,-133.75]},{"type":"surface","name":"B_CLOTHES.05","parent":"B_CLOTHES.06","segmentX":8,"segmentY":8,"vertices":[-148.34,-178.52,-110.17,-178.52,-71.99,-178.52,-34.21,-178.28,-0.23,-175.75,33.75,-173.21,72.53,-173.58,114.64,-175.95,157.07,-178.52,-148.34,-133.52,-110.17,-133.52,-71.99,-133.52,-33.96,-133.4,1.9,-132.03,37.75,-130.67,76.21,-130.85,116.54,-132.08,157.07,-133.52,-148.34,-88.53,-110.17,-88.53,-71.99,-88.53,-33.75,-88.5,3.86,-88.23,41.47,-87.95,79.64,-87.95,118.32,-88.14,157.07,-88.53,-148.34,-43.53,-110.17,-43.53,-71.99,-43.53,-33.81,-43.53,4.36,-43.53,42.54,-43.53,80.72,-43.53,118.89,-43.53,157.07,-43.53,-148.34,1.46,-110.17,1.46,-71.99,1.46,-33.81,1.46,4.36,1.46,42.54,1.46,80.72,1.46,118.89,1.46,157.07,1.46,-148.34,46.46,-110.17,46.46,-71.99,46.46,-33.81,46.46,4.36,46.46,42.54,46.46,80.72,46.46,118.89,46.46,157.07,46.46,-148.34,91.45,-110.17,91.45,-71.99,91.45,-33.81,91.45,4.36,91.45,42.54,91.45,80.72,91.45,118.89,91.45,157.07,91.45,-148.34,136.45,-110.17,136.45,-71.99,136.45,-33.81,136.45,4.36,136.45,42.54,136.45,80.72,136.45,118.89,136.45,157.07,136.45,-148.34,181.44,-110.17,181.44,-71.99,181.44,-33.81,181.44,4.36,181.44,42.54,181.44,80.72,181.44,118.89,181.44,157.07,181.44]},{"type":"surface","name":"B_CLOTHES.08","parent":"B_HAND.08","segmentX":8,"segmentY":8,"vertices":[219.88,107.15,187.5,111.81,155.13,116.48,122.76,121.14,90.39,125.81,58.02,130.47,25.65,135.14,-6.72,139.8,-39.09,144.47,215.47,76.58,183.1,81.25,150.73,85.91,118.36,90.58,85.99,95.24,53.61,99.91,21.24,104.57,-11.13,109.24,-43.5,113.9,211.07,46.02,178.7,50.68,146.32,55.35,113.95,60.01,81.58,64.68,49.21,69.34,16.84,74.01,-15.53,78.67,-47.9,83.34,206.66,15.45,174.29,20.12,141.92,24.78,109.55,29.45,77.18,34.11,44.81,38.78,12.43,43.44,-19.94,48.1,-52.31,52.77,202.26,-15.11,169.89,-10.45,137.51,-5.79,105.14,-1.12,72.77,3.54,40.4,8.21,8.03,12.87,-24.34,17.54,-56.71,22.2,197.85,-45.68,165.48,-41.02,133.11,-36.35,100.74,-31.69,68.37,-27.02,36,-22.36,3.62,-17.69,-28.75,-13.03,-61.12,-8.36,193.45,-76.25,161.08,-71.58,128.71,-66.92,96.33,-62.25,63.96,-57.59,31.59,-52.92,-0.78,-48.26,-33.15,-43.59,-65.52,-38.93,189.04,-106.81,156.67,-102.15,124.3,-97.48,91.93,-92.82,59.56,-88.15,27.19,-83.49,-5.18,-78.82,-37.56,-74.16,-69.93,-69.5,184.64,-137.38,152.27,-132.72,119.9,-128.05,87.52,-123.39,55.15,-118.72,22.78,-114.06,-9.59,-109.39,-41.96,-104.73,-74.33,-100.06]},{"type":"surface","name":"B_HAND.01","parent":"B_HAND.11","segmentX":8,"segmentY":8,"vertices":[-178.78,-156.52,-134.27,-155.54,-89.77,-154.56,-45.27,-153.59,-0.77,-152.61,43.73,-151.64,88.24,-150.66,132.74,-149.69,177.24,-148.71,-179.22,-116.23,-134.72,-115.26,-90.22,-114.28,-45.71,-113.31,-1.21,-112.33,43.29,-111.36,87.79,-110.38,132.29,-109.41,176.79,-108.43,-179.67,-75.95,-135.16,-74.98,-90.66,-74,-46.16,-73.03,-1.66,-72.05,42.84,-71.08,87.35,-70.1,131.85,-69.13,176.35,-68.15,-180.11,-35.67,-135.61,-34.7,-91.11,-33.72,-46.61,-32.75,-2.1,-31.77,42.4,-30.8,86.9,-29.82,131.4,-28.85,175.9,-27.87,-180.56,4.61,-136.05,5.58,-91.55,6.56,-47.05,7.53,-2.55,8.51,41.95,9.48,86.46,10.46,130.96,11.43,175.46,12.41,-181,44.89,-136.5,45.87,-92,46.84,-47.5,47.82,-2.99,48.79,41.51,49.77,86.01,50.74,130.51,51.72,175.01,52.69,-181.45,85.17,-136.94,86.15,-92.44,87.12,-47.94,88.1,-3.44,89.07,41.06,90.05,85.57,91.02,130.07,92,174.57,92.97,-181.89,125.45,-137.39,126.43,-92.89,127.4,-48.39,128.38,-3.88,129.35,40.62,130.33,85.12,131.3,129.62,132.28,174.12,133.25,-182.34,165.73,-137.83,166.71,-93.33,167.69,-48.83,168.66,-4.33,169.64,40.17,170.61,84.68,171.59,129.18,172.56,173.68,173.54]},{"type":"surface","name":"B_HAND.02","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-124.77,-117.48,-106.66,-117.48,-88.55,-117.48,-70.44,-117.48,-52.32,-117.48,-34.21,-117.48,-16.1,-117.48,2.01,-117.48,20.12,-117.48,-124.77,-101.04,-106.66,-101.04,-88.55,-101.04,-70.44,-101.04,-52.32,-101.04,-34.21,-101.04,-16.1,-101.04,2.01,-101.04,20.12,-101.04,-124.77,-84.59,-106.66,-84.59,-88.55,-84.59,-70.44,-84.59,-52.32,-84.59,-34.21,-84.59,-16.1,-84.59,2.01,-84.59,20.12,-84.59,-124.77,-68.14,-106.66,-68.14,-88.55,-68.14,-70.44,-68.14,-52.32,-68.14,-34.21,-68.14,-16.1,-68.14,2.01,-68.14,20.12,-68.14,-124.77,-51.69,-106.66,-51.69,-88.55,-51.69,-70.44,-51.69,-52.32,-51.69,-34.21,-51.69,-16.1,-51.69,2.01,-51.69,20.12,-51.69,-124.77,-35.24,-106.66,-35.24,-88.55,-35.24,-70.44,-35.24,-52.32,-35.24,-34.21,-35.24,-16.1,-35.24,2.01,-35.24,20.12,-35.24,-124.77,-18.79,-106.66,-18.79,-88.55,-18.79,-70.44,-18.79,-52.32,-18.79,-34.21,-18.79,-16.1,-18.79,2.01,-18.79,20.12,-18.79,-124.77,-2.34,-106.66,-2.34,-88.55,-2.34,-70.44,-2.34,-52.32,-2.34,-34.21,-2.34,-16.1,-2.34,2.01,-2.34,20.12,-2.34,-124.77,14.11,-106.66,14.11,-88.55,14.11,-70.44,14.11,-52.32,14.11,-34.21,14.11,-16.1,14.11,2.01,14.11,20.12,14.11]},{"type":"surface","name":"B_HAND.03","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-133.8,-118.29,-115.55,-118.29,-97.3,-118.29,-79.05,-118.29,-60.8,-118.29,-42.55,-118.29,-24.3,-118.29,-6.05,-118.29,12.2,-118.29,-133.8,-97.82,-115.55,-97.82,-97.3,-97.82,-79.05,-97.82,-60.8,-97.82,-42.55,-97.82,-24.3,-97.82,-6.05,-97.82,12.2,-97.82,-133.8,-77.35,-115.55,-77.35,-97.3,-77.35,-79.05,-77.35,-60.8,-77.35,-42.55,-77.35,-24.3,-77.35,-6.05,-77.35,12.2,-77.35,-133.8,-56.87,-115.55,-56.87,-97.3,-56.87,-79.05,-56.87,-60.8,-56.87,-42.55,-56.87,-24.3,-56.87,-6.05,-56.87,12.2,-56.87,-133.8,-36.4,-115.55,-36.4,-97.3,-36.4,-79.05,-36.4,-60.8,-36.4,-42.55,-36.4,-24.3,-36.4,-6.05,-36.4,12.2,-36.4,-133.8,-15.93,-115.55,-15.93,-97.3,-15.93,-79.05,-15.93,-60.8,-15.93,-42.55,-15.93,-24.3,-15.93,-6.05,-15.93,12.2,-15.93,-133.8,4.54,-115.55,4.54,-97.3,4.54,-79.05,4.54,-60.8,4.54,-42.55,4.54,-24.3,4.54,-6.05,4.54,12.2,4.54,-133.8,25.01,-115.55,25.01,-97.3,25.01,-79.05,25.01,-60.8,25.01,-42.55,25.01,-24.3,25.01,-6.05,25.01,12.2,25.01,-133.8,45.49,-115.55,45.49,-97.3,45.49,-79.05,45.49,-60.8,45.49,-42.55,45.49,-24.3,45.49,-6.05,45.49,12.2,45.49]},{"type":"surface","name":"B_HAND.04","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-133.48,-101.77,-112.79,-101.77,-92.1,-101.77,-71.42,-101.77,-50.73,-101.77,-30.05,-101.77,-9.36,-101.77,11.32,-101.77,32.01,-101.77,-133.48,-81.87,-112.79,-81.87,-92.1,-81.87,-71.42,-81.87,-50.73,-81.87,-30.05,-81.87,-9.36,-81.87,11.32,-81.87,32.01,-81.87,-133.48,-61.96,-112.79,-61.96,-92.1,-61.96,-71.42,-61.96,-50.73,-61.96,-30.05,-61.96,-9.36,-61.96,11.32,-61.96,32.01,-61.96,-133.48,-42.05,-112.79,-42.05,-92.1,-42.05,-71.42,-42.05,-50.73,-42.05,-30.05,-42.05,-9.36,-42.05,11.32,-42.05,32.01,-42.05,-133.48,-22.14,-112.79,-22.14,-92.1,-22.14,-71.42,-22.14,-50.73,-22.14,-30.05,-22.14,-9.36,-22.14,11.32,-22.14,32.01,-22.14,-133.48,-2.24,-112.79,-2.24,-92.1,-2.24,-71.42,-2.24,-50.73,-2.24,-30.05,-2.24,-9.36,-2.24,11.32,-2.24,32.01,-2.24,-133.48,17.67,-112.79,17.67,-92.1,17.67,-71.42,17.67,-50.73,17.67,-30.05,17.67,-9.36,17.67,11.32,17.67,32.01,17.67,-133.48,37.58,-112.79,37.58,-92.1,37.58,-71.42,37.58,-50.73,37.58,-30.05,37.58,-9.36,37.58,11.32,37.58,32.01,37.58,-133.48,57.48,-112.79,57.48,-92.1,57.48,-71.42,57.48,-50.73,57.48,-30.05,57.48,-9.36,57.48,11.32,57.48,32.01,57.48]},{"type":"surface","name":"B_HAND.05","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-121.2,-64.73,-100.75,-64.73,-80.31,-64.73,-59.87,-64.73,-39.43,-64.73,-18.98,-64.73,1.46,-64.73,21.9,-64.73,42.35,-64.73,-121.2,-47.73,-100.75,-47.73,-80.31,-47.73,-59.87,-47.73,-39.43,-47.73,-18.98,-47.73,1.46,-47.73,21.9,-47.73,42.35,-47.73,-121.2,-30.74,-100.75,-30.74,-80.31,-30.74,-59.87,-30.74,-39.43,-30.74,-18.98,-30.74,1.46,-30.74,21.9,-30.74,42.35,-30.74,-121.2,-13.74,-100.75,-13.74,-80.31,-13.74,-59.87,-13.74,-39.43,-13.74,-18.98,-13.74,1.46,-13.74,21.9,-13.74,42.35,-13.74,-121.2,3.25,-100.75,3.25,-80.31,3.25,-59.87,3.25,-39.43,3.25,-18.98,3.25,1.46,3.25,21.9,3.25,42.35,3.25,-121.2,20.25,-100.75,20.25,-80.31,20.25,-59.87,20.25,-39.43,20.25,-18.98,20.25,1.46,20.25,21.9,20.25,42.35,20.25,-121.2,37.24,-100.75,37.24,-80.31,37.24,-59.87,37.24,-39.43,37.24,-18.98,37.24,1.46,37.24,21.9,37.24,42.35,37.24,-121.2,54.24,-100.75,54.24,-80.31,54.24,-59.87,54.24,-39.43,54.24,-18.98,54.24,1.46,54.24,21.9,54.24,42.35,54.24,-121.2,71.23,-100.75,71.23,-80.31,71.23,-59.87,71.23,-39.43,71.23,-18.98,71.23,1.46,71.23,21.9,71.23,42.35,71.23]},{"type":"surface","name":"B_HAND.06","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-84.24,-22.62,-66.23,-22.62,-48.22,-22.62,-30.21,-22.62,-12.21,-22.62,5.8,-22.62,23.81,-22.62,41.82,-22.62,59.83,-22.62,-84.24,-9.22,-66.23,-9.22,-48.22,-9.22,-30.21,-9.22,-12.21,-9.22,5.8,-9.22,23.81,-9.22,41.82,-9.22,59.83,-9.22,-84.24,4.18,-66.23,4.18,-48.22,4.18,-30.21,4.18,-12.21,4.18,5.8,4.18,23.81,4.18,41.82,4.18,59.83,4.18,-84.24,17.57,-66.23,17.57,-48.22,17.57,-30.21,17.57,-12.21,17.57,5.8,17.57,23.81,17.57,41.82,17.57,59.83,17.57,-84.24,30.97,-66.23,30.97,-48.22,30.97,-30.21,30.97,-12.21,30.97,5.8,30.97,23.81,30.97,41.82,30.97,59.83,30.97,-84.24,44.37,-66.23,44.37,-48.22,44.37,-30.21,44.37,-12.21,44.37,5.8,44.37,23.81,44.37,41.82,44.37,59.83,44.37,-84.24,57.77,-66.23,57.77,-48.22,57.77,-30.21,57.77,-12.21,57.77,5.8,57.77,23.81,57.77,41.82,57.77,59.83,57.77,-84.24,71.17,-66.23,71.17,-48.22,71.17,-30.21,71.17,-12.21,71.17,5.8,71.17,23.81,71.17,41.82,71.17,59.83,71.17,-84.24,84.57,-66.23,84.57,-48.22,84.57,-30.21,84.57,-12.21,84.57,5.8,84.57,23.81,84.57,41.82,84.57,59.83,84.57]},{"type":"surface","name":"B_HAND.07","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-66.27,-155.93,-39.15,-155.93,-12.04,-155.93,15.08,-155.93,42.19,-155.93,69.31,-155.93,96.42,-155.93,123.54,-155.93,150.65,-155.93,-66.27,-126.29,-39.15,-126.29,-12.04,-126.29,15.08,-126.29,42.19,-126.29,69.31,-126.29,96.42,-126.29,123.54,-126.29,150.65,-126.29,-66.27,-96.65,-39.15,-96.65,-12.04,-96.65,15.08,-96.65,42.19,-96.65,69.31,-96.65,96.42,-96.65,123.54,-96.65,150.65,-96.65,-66.27,-67,-39.15,-67,-12.04,-67,15.08,-67,42.19,-67,69.31,-67,96.42,-67,123.54,-67,150.65,-67,-66.27,-37.36,-39.15,-37.36,-12.04,-37.36,15.08,-37.36,42.19,-37.36,69.31,-37.36,96.42,-37.36,123.54,-37.36,150.65,-37.36,-66.27,-7.72,-39.15,-7.72,-12.04,-7.72,15.08,-7.72,42.19,-7.72,69.31,-7.72,96.42,-7.72,123.54,-7.72,150.65,-7.72,-66.27,21.92,-39.15,21.92,-12.04,21.92,15.08,21.92,42.19,21.92,69.31,21.92,96.42,21.92,123.54,21.92,150.65,21.92,-66.27,51.56,-39.15,51.56,-12.04,51.56,15.08,51.56,42.19,51.56,69.31,51.56,96.42,51.56,123.54,51.56,150.65,51.56,-66.27,81.2,-39.15,81.2,-12.04,81.2,15.08,81.2,42.19,81.2,69.31,81.2,96.42,81.2,123.54,81.2,150.65,81.2]},{"type":"surface","name":"B_CLOTHES.30","parent":"B_CLOTHES.29","segmentX":8,"segmentY":8,"vertices":[-176.5,-187.2,-131.95,-187.2,-87.39,-187.2,-42.83,-187.21,1.72,-187.21,46.28,-187.21,90.84,-187.21,135.39,-187.21,179.95,-187.22,-176.49,-140.4,-131.93,-140.4,-87.38,-140.4,-42.82,-140.4,1.74,-140.41,46.29,-140.41,90.85,-140.41,135.41,-140.41,179.97,-140.41,-176.47,-93.6,-131.92,-93.6,-87.36,-93.6,-42.8,-93.6,1.75,-93.61,46.31,-93.61,90.87,-93.61,135.42,-93.61,179.98,-93.61,-176.46,-46.8,-131.9,-46.8,-87.35,-46.8,-42.79,-46.8,1.77,-46.8,46.32,-46.81,90.88,-46.81,135.44,-46.81,179.99,-46.81,-176.45,0.01,-131.89,0,-87.33,0,-42.78,0,1.78,0,46.34,0,90.89,-0.01,135.45,-0.01,180.01,-0.01,-176.43,46.81,-131.88,46.8,-87.32,46.8,-42.76,46.8,1.79,46.8,46.35,46.8,90.91,46.79,135.47,46.79,180.02,46.79,-176.42,93.61,-131.86,93.61,-87.3,93.6,-42.75,93.6,1.81,93.6,46.37,93.6,90.92,93.6,135.48,93.59,180.04,93.59,-176.4,140.41,-131.85,140.41,-87.29,140.41,-42.73,140.4,1.82,140.4,46.38,140.4,90.94,140.4,135.49,140.4,180.05,140.39,-176.39,187.21,-131.83,187.21,-87.28,187.21,-42.72,187.2,1.84,187.2,46.39,187.2,90.95,187.2,135.51,187.2,180.07,187.2]},{"type":"surface","name":"B_CLOTHES.26","parent":"B_CLOTHES.25","segmentX":8,"segmentY":8,"vertices":[-184.95,-174.11,-139.36,-174.11,-93.77,-174.11,-48.19,-174.11,-2.6,-174.1,42.98,-174.1,88.57,-174.1,134.16,-174.1,179.74,-174.1,-184.95,-130.6,-139.36,-130.59,-93.77,-130.59,-48.19,-130.59,-2.6,-130.59,42.98,-130.59,88.57,-130.59,134.16,-130.59,179.74,-130.59,-184.95,-87.08,-139.36,-87.08,-93.77,-87.08,-48.19,-87.08,-2.6,-87.08,42.98,-87.08,88.57,-87.08,134.16,-87.08,179.74,-87.08,-184.95,-43.57,-139.36,-43.57,-93.77,-43.57,-48.19,-43.57,-2.6,-43.57,42.98,-43.57,88.57,-43.57,134.16,-43.57,179.74,-43.57,-184.95,-0.06,-139.36,-0.06,-93.77,-0.06,-48.19,-0.06,-2.6,-0.06,42.98,-0.06,88.57,-0.06,134.16,-0.06,179.74,-0.06,-184.95,43.45,-139.36,43.45,-93.77,43.45,-48.19,43.45,-2.6,43.45,42.98,43.45,88.57,43.46,134.16,43.46,179.74,43.46,-184.95,86.96,-139.36,86.96,-93.77,86.96,-48.19,86.97,-2.6,86.97,42.98,86.97,88.57,86.97,134.16,86.97,179.74,86.97,-184.95,130.47,-139.36,130.48,-93.77,130.48,-48.19,130.48,-2.6,130.48,42.98,130.48,88.57,130.48,134.16,130.48,179.74,130.48,-184.95,173.99,-139.36,173.99,-93.77,173.99,-48.19,173.99,-2.6,173.99,42.98,173.99,88.57,173.99,134.16,173.99,179.74,173.99]},{"type":"surface","name":"B_CLOTHES.28","parent":"B_CLOTHES.27","segmentX":8,"segmentY":8,"vertices":[-182.37,-170.22,-137.16,-170.22,-91.95,-170.22,-46.73,-170.22,-1.52,-170.22,43.69,-170.22,88.9,-170.22,134.11,-170.22,179.32,-170.22,-182.37,-126.09,-137.16,-126.09,-91.95,-126.09,-46.73,-126.09,-1.52,-126.09,43.69,-126.09,88.9,-126.09,134.11,-126.09,179.32,-126.09,-182.37,-81.97,-137.16,-81.97,-91.95,-81.97,-46.73,-81.97,-1.52,-81.97,43.69,-81.97,88.9,-81.97,134.11,-81.97,179.32,-81.97,-182.37,-37.85,-137.16,-37.85,-91.95,-37.85,-46.73,-37.85,-1.52,-37.85,43.69,-37.85,88.9,-37.85,134.11,-37.85,179.32,-37.85,-182.37,6.28,-137.16,6.28,-91.95,6.28,-46.73,6.28,-1.52,6.28,43.69,6.28,88.9,6.28,134.11,6.28,179.32,6.28,-182.37,50.4,-137.16,50.4,-91.95,50.4,-46.73,50.4,-1.52,50.4,43.69,50.4,88.9,50.4,134.11,50.4,179.32,50.4,-182.37,94.52,-137.16,94.52,-91.95,94.52,-46.73,94.52,-1.52,94.52,43.69,94.52,88.9,94.52,134.11,94.52,179.32,94.52,-182.37,138.65,-137.16,138.65,-91.95,138.65,-46.73,138.65,-1.52,138.65,43.69,138.65,88.9,138.65,134.11,138.65,179.32,138.65,-182.37,182.77,-137.16,182.77,-91.95,182.77,-46.73,182.77,-1.52,182.77,43.69,182.77,88.9,182.77,134.11,182.77,179.32,182.77]},{"type":"surface","name":"B_EYE_BALL.03","parent":"B_EYE_BALL.04","segmentX":8,"segmentY":8,"vertices":[-171.52,-176.12,-128.59,-176.12,-85.65,-176.12,-42.72,-176.12,0.21,-176.12,43.15,-176.12,86.08,-176.12,129.02,-176.12,171.95,-176.12,-171.52,-131.86,-128.59,-131.86,-85.65,-131.86,-42.72,-131.86,0.21,-131.86,43.15,-131.86,86.08,-131.86,129.02,-131.86,171.95,-131.86,-171.52,-87.6,-128.59,-87.6,-85.65,-87.6,-42.72,-87.6,0.21,-87.6,43.15,-87.6,86.08,-87.6,129.02,-87.6,171.95,-87.6,-171.52,-43.34,-128.59,-43.34,-85.65,-43.34,-42.72,-43.34,0.21,-43.34,43.15,-43.34,86.08,-43.34,129.02,-43.34,171.95,-43.34,-171.52,0.92,-128.59,0.92,-85.65,0.92,-42.72,0.92,0.21,0.92,43.15,0.92,86.08,0.92,129.02,0.92,171.95,0.92,-171.52,45.18,-128.59,45.18,-85.65,45.18,-42.72,45.18,0.21,45.18,43.15,45.18,86.08,45.18,129.02,45.18,171.95,45.18,-171.52,89.43,-128.59,89.43,-85.65,89.43,-42.72,89.43,0.21,89.43,43.15,89.43,86.08,89.43,129.02,89.43,171.95,89.43,-171.52,133.69,-128.59,133.69,-85.65,133.69,-42.72,133.69,0.21,133.69,43.15,133.69,86.08,133.69,129.02,133.69,171.95,133.69,-171.52,177.95,-128.59,177.95,-85.65,177.95,-42.72,177.95,0.21,177.95,43.15,177.95,86.08,177.95,129.02,177.95,171.95,177.95]},{"type":"surface","name":"B_EYE_BALL.09","parent":"B_EYE_BALL.06","segmentX":8,"segmentY":8,"vertices":[-169.79,-174.28,-128.28,-174.28,-86.77,-174.28,-45.27,-174.28,-3.76,-174.28,37.75,-174.28,79.26,-174.28,120.76,-174.28,162.27,-174.28,-169.79,-131.19,-128.28,-131.19,-86.77,-131.19,-45.27,-131.19,-3.76,-131.19,37.75,-131.19,79.26,-131.19,120.76,-131.19,162.27,-131.19,-169.79,-88.09,-128.28,-88.09,-86.77,-88.09,-45.27,-88.09,-3.76,-88.09,37.75,-88.09,79.26,-88.09,120.76,-88.09,162.27,-88.09,-169.79,-45,-128.28,-45,-86.77,-45,-45.27,-45,-3.76,-45,37.75,-45,79.26,-45,120.76,-45,162.27,-45,-169.79,-1.9,-128.28,-1.9,-86.77,-1.9,-45.27,-1.9,-3.76,-1.9,37.75,-1.9,79.26,-1.9,120.76,-1.9,162.27,-1.9,-169.79,41.19,-128.28,41.19,-86.77,41.19,-45.27,41.19,-3.76,41.19,37.75,41.19,79.26,41.19,120.76,41.19,162.27,41.19,-169.79,84.29,-128.28,84.29,-86.77,84.29,-45.27,84.29,-3.76,84.29,37.75,84.29,79.26,84.29,120.76,84.29,162.27,84.29,-169.79,127.38,-128.28,127.38,-86.77,127.38,-45.27,127.38,-3.76,127.38,37.75,127.38,79.26,127.38,120.76,127.38,162.27,127.38,-169.79,170.48,-128.28,170.48,-86.77,170.48,-45.27,170.48,-3.76,170.48,37.75,170.48,79.26,170.48,120.76,170.48,162.27,170.48]},{"type":"surface","name":"B_CLOTHES.01","parent":"B_CLOTHES.03","segmentX":8,"segmentY":8,"vertices":[-166.78,-158.7,-122.8,-158.7,-78.83,-158.7,-34.85,-158.7,9.13,-158.7,53.11,-158.7,97.09,-158.7,141.06,-158.7,185.04,-158.7,-166.78,-117.26,-122.8,-117.26,-78.83,-117.26,-34.85,-117.26,9.13,-117.26,53.11,-117.26,97.09,-117.26,141.06,-117.26,185.04,-117.26,-166.78,-75.81,-122.8,-75.81,-78.83,-75.81,-34.85,-75.81,9.13,-75.81,53.11,-75.81,97.09,-75.81,141.06,-75.81,185.04,-75.81,-166.78,-34.36,-122.8,-34.36,-78.83,-34.36,-34.85,-34.36,9.13,-34.36,53.11,-34.36,97.09,-34.36,141.06,-34.36,185.04,-34.36,-166.78,7.09,-122.8,7.09,-78.83,7.09,-34.85,7.09,9.13,7.09,53.11,7.09,97.09,7.09,141.06,7.09,185.04,7.09,-166.78,48.53,-122.8,48.53,-78.83,48.53,-34.85,48.53,9.13,48.53,53.11,48.53,97.09,48.53,141.06,48.53,185.04,48.53,-166.78,89.98,-122.8,89.98,-78.83,89.98,-34.85,89.98,9.13,89.98,53.11,89.98,97.09,89.98,141.06,89.98,185.04,89.98,-166.78,131.43,-122.8,131.43,-78.83,131.43,-34.85,131.43,9.13,131.43,53.11,131.43,97.09,131.43,141.06,131.43,185.04,131.43,-166.78,172.88,-122.8,172.88,-78.83,172.88,-34.85,172.88,9.13,172.88,53.11,172.88,97.09,172.88,141.06,172.88,185.04,172.88]},{"type":"surface","name":"B_CLOTHES.02","parent":"B_CLOTHES.08","segmentX":8,"segmentY":8,"vertices":[-159.62,-164.08,-120.3,-164.08,-80.98,-164.08,-41.66,-164.08,-2.34,-164.08,36.98,-164.08,76.3,-164.08,115.62,-164.08,154.94,-164.08,-159.62,-122.43,-120.3,-122.43,-80.98,-122.43,-41.66,-122.43,-2.34,-122.43,36.98,-122.43,76.3,-122.43,115.62,-122.43,154.94,-122.43,-159.62,-80.78,-120.3,-80.78,-80.98,-80.78,-41.66,-80.78,-2.34,-80.78,36.98,-80.78,76.3,-80.78,115.62,-80.78,154.94,-80.78,-159.62,-39.12,-120.3,-39.12,-80.98,-39.12,-41.66,-39.12,-2.34,-39.12,36.98,-39.12,76.3,-39.12,115.62,-39.12,154.94,-39.12,-159.62,2.53,-120.3,2.53,-80.98,2.53,-41.66,2.53,-2.34,2.53,36.98,2.53,76.3,2.53,115.62,2.53,154.94,2.53,-159.62,44.18,-120.3,44.18,-80.98,44.18,-41.66,44.18,-2.34,44.18,36.98,44.18,76.3,44.18,115.62,44.18,154.94,44.18,-159.62,85.84,-120.3,85.84,-80.98,85.84,-41.66,85.84,-2.34,85.84,36.98,85.84,76.3,85.84,115.62,85.84,154.94,85.84,-159.62,127.49,-120.3,127.49,-80.98,127.49,-41.66,127.49,-2.34,127.49,36.98,127.49,76.3,127.49,115.62,127.49,154.94,127.49,-159.62,169.14,-120.3,169.14,-80.98,169.14,-41.66,169.14,-2.34,169.14,36.98,169.14,76.3,169.14,115.62,169.14,154.94,169.14]},{"type":"surface","name":"B_CLOTHES.36","parent":"B_CLOTHES.01","segmentX":8,"segmentY":8,"vertices":[-183.83,-177.55,-137.55,-179.07,-90.34,-179.85,-42.51,-180.14,5.64,-180.18,53.7,-180.22,100.93,-180.54,146.51,-181.41,189.6,-183.1,-183.83,-133.77,-137.55,-135.11,-90.34,-135.8,-42.51,-136.06,5.64,-136.09,53.7,-136.14,100.93,-136.42,146.51,-137.19,189.6,-138.68,-183.83,-89.99,-137.55,-91.16,-90.34,-91.76,-42.51,-91.98,5.64,-92.01,53.7,-92.05,100.93,-92.29,146.51,-92.96,189.6,-94.26,-183.83,-46.21,-137.55,-47.2,-90.34,-47.71,-42.51,-47.9,5.64,-47.93,53.7,-47.96,100.93,-48.17,146.51,-48.74,189.6,-49.84,-183.83,-2.43,-137.55,-3.25,-90.34,-3.67,-42.51,-3.82,5.64,-3.85,53.7,-3.87,100.93,-4.04,146.51,-4.51,189.6,-5.42,-183.83,41.35,-137.55,40.71,-90.34,40.38,-42.51,40.26,5.64,40.24,53.7,40.22,100.93,40.08,146.51,39.71,189.6,39,-183.83,85.13,-137.55,84.66,-90.34,84.42,-42.51,84.33,5.64,84.32,53.7,84.31,100.93,84.21,146.51,83.94,189.6,83.42,-183.83,128.91,-137.55,128.62,-90.34,128.47,-42.51,128.41,5.64,128.4,53.7,128.4,100.93,128.33,146.51,128.17,189.6,127.84,-183.83,172.69,-137.55,172.58,-90.34,172.51,-42.51,172.49,5.64,172.49,53.7,172.48,100.93,172.46,146.51,172.39,189.6,172.26]},{"type":"surface","name":"B_CLOTHES.37","parent":"B_CLOTHES.01","segmentX":8,"segmentY":8,"vertices":[71.1,-54.17,85.1,-53.82,99.09,-53.47,113.09,-53.12,127.08,-52.77,141.08,-52.41,155.07,-52.06,169.06,-51.71,183.06,-51.36,70.9,-30.11,84.89,-29.76,98.89,-29.41,112.88,-29.06,126.87,-28.71,140.87,-28.35,154.86,-28,168.86,-27.65,182.85,-27.3,70.69,-6.05,84.68,-5.7,98.68,-5.35,112.67,-5,126.67,-4.64,140.66,-4.29,154.65,-3.94,168.65,-3.59,182.64,-3.24,70.48,18.01,84.47,18.36,98.47,18.71,112.46,19.07,126.46,19.42,140.45,19.77,154.45,20.12,168.44,20.47,182.44,20.82,70.27,42.07,84.27,42.42,98.26,42.77,112.26,43.13,126.25,43.48,140.24,43.83,154.24,44.18,168.23,44.53,182.23,44.88,70.06,66.13,84.06,66.48,98.05,66.84,112.05,67.19,126.04,67.54,140.04,67.89,154.03,68.24,168.02,68.59,182.02,68.94,69.86,90.19,83.85,90.55,97.85,90.9,111.84,91.25,125.83,91.6,139.83,91.95,153.82,92.3,167.82,92.65,181.81,93,69.65,114.26,83.64,114.61,97.64,114.96,111.63,115.31,125.63,115.66,139.62,116.01,153.61,116.36,167.61,116.71,181.6,117.06,69.44,138.32,83.44,138.67,97.43,139.02,111.42,139.37,125.42,139.72,139.41,140.07,153.41,140.42,167.4,140.77,181.4,141.13]},{"type":"surface","name":"B_EYE_BALL.01","parent":"B_EYE_BALL.03","segmentX":8,"segmentY":8,"vertices":[-140.45,43.65,-126.91,43.65,-113.37,43.65,-99.82,43.65,-86.28,43.65,-72.74,43.65,-59.2,43.65,-45.66,43.65,-32.12,43.65,-140.45,53.8,-126.91,53.8,-113.37,53.8,-99.82,53.8,-86.28,53.8,-72.74,53.8,-59.2,53.8,-45.66,53.8,-32.12,53.8,-140.45,63.95,-126.91,63.95,-113.37,63.95,-99.82,63.95,-86.28,63.95,-72.74,63.95,-59.2,63.95,-45.66,63.95,-32.12,63.95,-140.45,74.11,-126.91,74.11,-113.37,74.11,-99.82,74.11,-86.28,74.11,-72.74,74.11,-59.2,74.11,-45.66,74.11,-32.12,74.11,-140.45,84.26,-126.91,84.26,-113.37,84.26,-99.82,84.26,-86.28,84.26,-72.74,84.26,-59.2,84.26,-45.66,84.26,-32.12,84.26,-140.45,94.41,-126.91,94.41,-113.37,94.41,-99.82,94.41,-86.28,94.41,-72.74,94.41,-59.2,94.41,-45.66,94.41,-32.12,94.41,-140.45,104.57,-126.91,104.57,-113.37,104.57,-99.82,104.57,-86.28,104.57,-72.74,104.57,-59.2,104.57,-45.66,104.57,-32.12,104.57,-140.45,114.72,-126.91,114.72,-113.37,114.72,-99.82,114.72,-86.28,114.72,-72.74,114.72,-59.2,114.72,-45.66,114.72,-32.12,114.72,-140.45,124.87,-126.91,124.87,-113.37,124.87,-99.82,124.87,-86.28,124.87,-72.74,124.87,-59.2,124.87,-45.66,124.87,-32.12,124.87]},{"type":"surface","name":"B_EYE_BALL.02","parent":"B_EYE_BALL.03","segmentX":8,"segmentY":8,"vertices":[-75.51,-104.42,-55.85,-104.42,-36.19,-104.42,-16.53,-104.42,3.12,-104.42,22.78,-104.42,42.44,-104.42,62.09,-104.42,81.75,-104.42,-75.51,-91.79,-55.85,-91.79,-36.19,-91.79,-16.53,-91.79,3.12,-91.79,22.78,-91.79,42.44,-91.79,62.09,-91.79,81.75,-91.79,-75.51,-79.17,-55.85,-79.17,-36.19,-79.17,-16.53,-79.17,3.12,-79.17,22.78,-79.17,42.44,-79.17,62.09,-79.17,81.75,-79.17,-75.51,-66.54,-55.85,-66.54,-36.19,-66.54,-16.53,-66.54,3.12,-66.54,22.78,-66.54,42.44,-66.54,62.09,-66.54,81.75,-66.54,-75.51,-53.91,-55.85,-53.91,-36.19,-53.91,-16.53,-53.91,3.12,-53.91,22.78,-53.91,42.44,-53.91,62.09,-53.91,81.75,-53.91,-75.51,-41.28,-55.85,-41.28,-36.19,-41.28,-16.53,-41.28,3.12,-41.28,22.78,-41.28,42.44,-41.28,62.09,-41.28,81.75,-41.28,-75.51,-28.65,-55.85,-28.65,-36.19,-28.65,-16.53,-28.65,3.12,-28.65,22.78,-28.65,42.44,-28.65,62.09,-28.65,81.75,-28.65,-75.51,-16.02,-55.85,-16.02,-36.19,-16.02,-16.53,-16.02,3.12,-16.02,22.78,-16.02,42.44,-16.02,62.09,-16.02,81.75,-16.02,-75.51,-3.39,-55.85,-3.39,-36.19,-3.39,-16.53,-3.39,3.12,-3.39,22.78,-3.39,42.44,-3.39,62.09,-3.39,81.75,-3.39]},{"type":"surface","name":"B_EYE_BALL.07","parent":"B_EYE_BALL.09","segmentX":8,"segmentY":8,"vertices":[-165.25,31.53,-150.87,31.53,-136.49,31.53,-122.1,31.53,-107.72,31.53,-93.34,31.53,-78.96,31.53,-64.58,31.53,-50.2,31.53,-165.25,42.11,-150.87,42.11,-136.49,42.11,-122.1,42.11,-107.72,42.11,-93.34,42.11,-78.96,42.11,-64.58,42.11,-50.2,42.11,-165.25,52.68,-150.87,52.68,-136.49,52.68,-122.1,52.68,-107.72,52.68,-93.34,52.68,-78.96,52.68,-64.58,52.68,-50.2,52.68,-165.25,63.26,-150.87,63.26,-136.49,63.26,-122.1,63.26,-107.72,63.26,-93.34,63.26,-78.96,63.26,-64.58,63.26,-50.2,63.26,-165.25,73.83,-150.87,73.83,-136.49,73.83,-122.1,73.83,-107.72,73.83,-93.34,73.83,-78.96,73.83,-64.58,73.83,-50.2,73.83,-165.25,84.41,-150.87,84.41,-136.49,84.41,-122.1,84.41,-107.72,84.41,-93.34,84.41,-78.96,84.41,-64.58,84.41,-50.2,84.41,-165.25,94.98,-150.87,94.98,-136.49,94.98,-122.1,94.98,-107.72,94.98,-93.34,94.98,-78.96,94.98,-64.58,94.98,-50.2,94.98,-165.25,105.56,-150.87,105.56,-136.49,105.56,-122.1,105.56,-107.72,105.56,-93.34,105.56,-78.96,105.56,-64.58,105.56,-50.2,105.56,-165.25,116.13,-150.87,116.13,-136.49,116.13,-122.1,116.13,-107.72,116.13,-93.34,116.13,-78.96,116.13,-64.58,116.13,-50.2,116.13]},{"type":"surface","name":"B_EYE_BALL.08","parent":"B_EYE_BALL.09","segmentX":8,"segmentY":8,"vertices":[-69.82,-116.3,-50.3,-116.3,-30.78,-116.3,-11.26,-116.3,8.26,-116.3,27.78,-116.3,47.3,-116.3,66.82,-116.3,86.34,-116.3,-69.82,-100.86,-50.3,-100.86,-30.78,-100.86,-11.26,-100.86,8.26,-100.86,27.78,-100.86,47.3,-100.86,66.82,-100.86,86.34,-100.86,-69.82,-85.41,-50.3,-85.41,-30.78,-85.41,-11.26,-85.41,8.26,-85.41,27.78,-85.41,47.3,-85.41,66.82,-85.41,86.34,-85.41,-69.82,-69.96,-50.3,-69.96,-30.78,-69.96,-11.26,-69.96,8.26,-69.96,27.78,-69.96,47.3,-69.96,66.82,-69.96,86.34,-69.96,-69.82,-54.51,-50.3,-54.51,-30.78,-54.51,-11.26,-54.51,8.26,-54.51,27.78,-54.51,47.3,-54.51,66.82,-54.51,86.34,-54.51,-69.82,-39.07,-50.3,-39.07,-30.78,-39.07,-11.26,-39.07,8.26,-39.07,27.78,-39.07,47.3,-39.07,66.82,-39.07,86.34,-39.07,-69.82,-23.62,-50.3,-23.62,-30.78,-23.62,-11.26,-23.62,8.26,-23.62,27.78,-23.62,47.3,-23.62,66.82,-23.62,86.34,-23.62,-69.82,-8.17,-50.3,-8.17,-30.78,-8.17,-11.26,-8.17,8.26,-8.17,27.78,-8.17,47.3,-8.17,66.82,-8.17,86.34,-8.17,-69.82,7.27,-50.3,7.27,-30.78,7.27,-11.26,7.27,8.26,7.27,27.78,7.27,47.3,7.27,66.82,7.27,86.34,7.27]}],"slot":[{"zIndex":100,"name":"D_BACKGROUND.01","parent":"DST_BASE"},{"zIndex":190,"name":"D_CLOTHES.04","parent":"B_CLOTHES.20"},{"zIndex":200,"name":"D_HAIR_TWIN.02","parent":"B_HAIR_TWIN.20"},{"zIndex":200,"name":"D_HAIR_TWIN.00","parent":"B_HAIR_TWIN.12"},{"zIndex":200,"name":"D_HAIR_BACK.00","parent":"B_HAIR_BACK.01"},{"zIndex":210,"name":"D_HAIR_TWIN.11","parent":"B_HAIR_TWIN.21"},{"zIndex":220,"name":"D_HAIR_TWIN.05","parent":"B_HAIR_TWIN.14"},{"zIndex":250,"name":"D_BODY.00","parent":"B_BODY.01"},{"zIndex":300,"name":"D_HAIR_TWIN.06","parent":"B_HAIR_TWIN.09"},{"zIndex":310,"name":"D_HAIR_TWIN.13","parent":"B_HAIR_TWIN.19"},{"zIndex":360,"name":"D_NECK.00","parent":"B_NECK.01"},{"zIndex":365,"name":"D_NECK.01","parent":"B_NECK.03"},{"zIndex":380,"name":"D_CLOTHES.00","parent":"B_CLOTHES.16"},{"zIndex":390,"name":"D_CLOTHES.01","parent":"B_CLOTHES.35"},{"zIndex":390,"name":"D_BACKGROUND.02","parent":"B_BACKGROUND.01"},{"zIndex":399,"name":"D_BACKGROUND.03","parent":"B_BACKGROUND.01"},{"zIndex":400,"name":"D_EAR.00","parent":"B_EAR.01"},{"zIndex":400,"name":"D_EAR.01","parent":"B_EAR.02"},{"zIndex":400,"name":"D_HAIR_TWIN.12","parent":"B_HAIR_TWIN.17"},{"zIndex":400,"name":"D_CLOTHES.13","parent":"B_CLOTHES.05"},{"zIndex":400,"name":"D_CLOTHES.10","parent":"B_CLOTHES.30"},{"zIndex":400,"name":"D_CLOTHES.18","parent":"B_CLOTHES.40"},{"zIndex":400,"name":"D_CLOTHES.16","parent":"B_CLOTHES.38"},{"zIndex":400,"name":"D_CLOTHES.07","parent":"B_CLOTHES.11"},{"zIndex":400,"name":"D_CLOTHES.08","parent":"B_CLOTHES.12"},{"zIndex":400,"name":"D_CLOTHES.02","parent":"B_CLOTHES.17"},{"zIndex":400,"name":"D_CLOTHES.03","parent":"B_CLOTHES.15"},{"zIndex":450,"name":"D_CLOTHES.05","parent":"B_CLOTHES.22"},{"zIndex":450,"name":"D_CLOTHES.06","parent":"B_CLOTHES.24"},{"zIndex":480,"name":"D_HAIR_TWIN.14","parent":"B_HAIR_TWIN.18"},{"zIndex":480,"name":"D_HAIR_TWIN.15","parent":"B_HAIR_TWIN.16"},{"zIndex":500,"name":"D_REF.HAIR","parent":"B_FACE.02"},{"zIndex":500,"name":"D_REF.BODY","parent":"DST_BASE"},{"zIndex":500,"name":"D_REF.ARM_R","parent":"DST_BASE"},{"zIndex":500,"name":"D_REF.ARM_L","parent":"DST_BASE"},{"zIndex":500,"name":"D_REF.HEAD","parent":"B_FACE.02"},{"zIndex":500,"name":"D_FACE.00","parent":"B_FACE.01"},{"zIndex":500,"name":"D_EYE.02","parent":"B_EYE.01"},{"zIndex":500,"alpha":0.9,"name":"D_EYE.03","parent":"B_EYE.03"},{"zIndex":500,"name":"D_EYE.12","parent":"B_EYE.01"},{"zIndex":500,"name":"D_EYE_BALL.00","parent":"B_EYE_BALL.03"},{"zIndex":500,"name":"D_EYE_BALL.01","parent":"B_EYE_BALL.09"},{"zIndex":500,"name":"D_EYE_BALL.03","parent":"B_EYE_BALL.08"},{"zIndex":500,"name":"D_EYE_BALL.05","parent":"B_EYE_BALL.07"},{"zIndex":500,"name":"D_MOUTH.00","parent":"B_MOUTH.05"},{"zIndex":500,"alpha":0.8,"name":"D_NOSE.00","parent":"B_NOSE.01"},{"zIndex":500,"name":"D_NOSE.01","parent":"B_NOSE.01"},{"zIndex":500,"name":"D_HAIR_TWIN.30","parent":"B_CLOTHES.37"},{"zIndex":500,"name":"D_HAIR_TWIN.29","parent":"B_CLOTHES.26"},{"zIndex":500,"name":"D_CLOTHES.09","parent":"B_CLOTHES.09"},{"zIndex":500,"name":"D_BACKGROUND.04","parent":"DST_BASE"},{"zIndex":500,"name":"D_BACKGROUND.05","parent":"DST_BASE"},{"zIndex":500,"name":"D_BACKGROUND.06","parent":"B_BACKGROUND.01"},{"zIndex":500,"name":"D_BACKGROUND.07","parent":"B_BACKGROUND.01"},{"zIndex":505,"name":"D_MOUTH.03","parent":"B_MOUTH.04"},{"zIndex":510,"name":"D_REF.FACE","parent":"B_FACE.02"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.07","parent":"B_EYE_BALL.03"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.08","parent":"B_EYE_BALL.02"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.10","parent":"B_EYE_BALL.01"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.12","parent":"B_EYE_BALL.09"},{"zIndex":510,"name":"D_EYE_BALL.02","parent":"B_EYE_BALL.02"},{"zIndex":510,"name":"D_EYE_BALL.04","parent":"B_EYE_BALL.01"},{"zIndex":510,"name":"D_MOUTH.01","parent":"B_MOUTH.01"},{"zIndex":510,"name":"D_MOUTH.02","parent":"B_MOUTH.04"},{"zIndex":510,"name":"D_HAIR_TWIN.04","parent":"B_HAIR_TWIN.11"},{"zIndex":510,"name":"D_HAIR_TWIN.07","parent":"B_HAIR_TWIN.13"},{"zIndex":511,"alpha":0,"name":"D_EYE_BALL.09","parent":"B_EYE_BALL.08"},{"zIndex":511,"alpha":0,"name":"D_EYE_BALL.11","parent":"B_EYE_BALL.07"},{"zIndex":520,"name":"D_REF.MOUTH","parent":"B_FACE.02"},{"zIndex":520,"name":"D_HAIR_TWIN.03","parent":"B_HAIR_TWIN.07"},{"zIndex":520,"name":"D_HAIR_TWIN.08","parent":"B_HAIR_TWIN.10"},{"zIndex":520,"name":"D_HAND.01","parent":"B_HAND.16"},{"zIndex":530,"name":"D_EYE.06","parent":"B_EYE.01"},{"zIndex":530,"name":"D_EYE.11","parent":"B_EYE.03"},{"zIndex":530,"name":"D_EYE.13","parent":"B_EYE.03"},{"zIndex":530,"name":"D_HAIR_TWIN.09","parent":"B_HAIR_TWIN.02"},{"zIndex":530,"name":"D_HAIR_TWIN.10","parent":"B_HAIR_TWIN.09"},{"zIndex":530,"name":"D_HAND.00","parent":"B_HAND.10"},{"zIndex":540,"alpha":0.96,"name":"D_FACESHADOW.00","parent":"B_FACESHADOW.02"},{"zIndex":540,"alpha":0,"name":"D_FACESHADOW.01","parent":"B_FACESHADOW.02"},{"zIndex":540,"name":"D_EYE.00","parent":"B_EYE.01"},{"zIndex":540,"name":"D_EYE.01","parent":"B_EYE.03"},{"zIndex":540,"name":"D_EYE.04","parent":"B_EYE.01"},{"zIndex":540,"name":"D_EYE.05","parent":"B_EYE.03"},{"zIndex":540,"name":"D_EYE.09","parent":"B_EYE.03"},{"zIndex":540,"name":"D_HAIR_SIDE.00","parent":"B_HAIR_SIDE.05"},{"zIndex":540,"name":"D_HAIR_SIDE.01","parent":"B_HAIR_SIDE.06"},{"zIndex":540,"name":"D_HAND.02","parent":"B_HAND.15"},{"zIndex":542,"name":"D_HAND.03","parent":"B_HAND.14"},{"zIndex":544,"name":"D_HAND.04","parent":"B_HAND.13"},{"zIndex":546,"name":"D_HAND.05","parent":"B_HAND.12"},{"zIndex":550,"name":"D_EYE.07","parent":"B_EYE.01"},{"zIndex":550,"name":"D_EYE.08","parent":"B_EYE.01"},{"zIndex":550,"name":"D_EYE.10","parent":"B_EYE.03"},{"zIndex":550,"name":"D_HAND.07","parent":"B_HAND.02"},{"zIndex":590,"name":"D_HAND.06","parent":"B_HAND.07"},{"zIndex":590,"name":"D_CLOTHES.11","parent":"B_CLOTHES.26"},{"zIndex":595,"name":"D_CLOTHES.12","parent":"B_CLOTHES.28"},{"zIndex":600,"name":"D_EYE.14","parent":"B_EYE.01"},{"zIndex":600,"name":"D_EYE.15","parent":"B_EYE.01"},{"zIndex":600,"name":"D_EYE.16","parent":"B_EYE.01"},{"zIndex":600,"name":"D_EYE.17","parent":"B_EYE.03"},{"zIndex":600,"name":"D_EYE.18","parent":"B_EYE.03"},{"zIndex":600,"name":"D_EYE.19","parent":"B_EYE.03"},{"zIndex":600,"name":"D_HAIR_FRONT.00","parent":"B_HAIR_FRONT.01"},{"zIndex":600,"name":"D_HAIR_TWIN.01","parent":"B_HAIR_TWIN.08"},{"zIndex":600,"name":"D_HAND.08","parent":"B_HAND.03"},{"zIndex":600,"name":"D_HAND.09","parent":"B_HAND.04"},{"zIndex":600,"name":"D_HAND.10","parent":"B_HAND.05"},{"zIndex":600,"name":"D_HAND.11","parent":"B_HAND.06"},{"zIndex":600,"name":"D_BACKGROUND.08","parent":"B_BACKGROUND.01"},{"zIndex":610,"alpha":0.6,"name":"D_HOHO.00","parent":"B_HOHO.01"},{"zIndex":610,"alpha":0.6,"name":"D_HOHO.01","parent":"B_HOHO.02"},{"zIndex":610,"name":"D_CLOTHES.14","parent":"B_CLOTHES.36"},{"zIndex":620,"name":"D_HAND.12","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.13","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.14","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.15","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.16","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.17","parent":"B_HAND.17"},{"zIndex":640,"name":"D_CLOTHES.15","parent":"B_CLOTHES.02"},{"zIndex":640,"name":"D_CLOTHES.17","parent":"B_CLOTHES.39"},{"zIndex":645,"name":"D_HAND.18","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.19","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.20","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.21","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.22","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.23","parent":"B_HAND.18"},{"zIndex":650,"name":"D_CLOTHES.19","parent":"B_CLOTHES.41"},{"zIndex":700,"name":"D_BROW.00","parent":"B_BROW.01"},{"zIndex":700,"name":"D_BROW.01","parent":"B_BROW.02"}],"skin":[{"slot":[{"name":"D_REF.HAIR","display":[{"type":"mesh","name":"D_REF.HAIR","path":"shizuku_00","vertices":[523.16,-338.04,531.58,341.16,-107.18,341.16,-97.47,-333.18],"uvs":[0.000188,0.000156,0.000906,0.000188,0.000906,0.000906,0.00025,0.000875],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.BODY","display":[{"type":"mesh","name":"D_REF.BODY","path":"shizuku_00","vertices":[-186.37,-671,149.73,-666.01,151.73,-190.57,-190.16,-196.56],"uvs":[0.000156,0.000125,0.001031,0.000188,0.001031,0.001031,0.000125,0.000906],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.ARM_R","display":[{"type":"mesh","name":"D_REF.ARM_R","path":"shizuku_00","vertices":[-335.19,-662.53,-195.92,-661.13,-178.71,-152.49,-335.13,-152.32],"uvs":[0.000125,0.000094,0.000906,0.000156,0.000937,0.000937,0.000094,0.000906],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.ARM_L","display":[{"type":"mesh","name":"D_REF.ARM_L","path":"shizuku_00","vertices":[159.85,-620.09,293.03,-624.81,293.03,-159.79,158.75,-159.79],"uvs":[0.000156,0.000156,0.001187,0.000156,0.001187,0.000906,0.000094,0.000906],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.FACE","display":[{"type":"mesh","name":"D_REF.FACE","path":"shizuku_00","vertices":[293.69,-202.02,292.75,187.64,-4.11,186.7,8.75,-202.02],"uvs":[0.000125,0.000094,0.000906,0.000125,0.000875,0.000813,0.000125,0.000781],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.MOUTH","display":[{"type":"mesh","name":"D_REF.MOUTH","path":"shizuku_00","vertices":[107.87,-137.43,111.03,126.11,-6.13,126.11,-6.13,-132.01],"uvs":[0.000125,0.000094,0.001,0.000125,0.001,0.000875,0.000188,0.000875],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.HEAD","display":[{"type":"mesh","name":"D_REF.HEAD","path":"shizuku_00","vertices":[563.01,-290.81,563.01,279.73,-34.85,271.33,-34.85,-295.54],"uvs":[0.000625,0.000625,0.001406,0.000625,0.001438,0.001438,0.000719,0.001438],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_FACESHADOW.00","display":[{"type":"mesh","name":"D_FACESHADOW.00","path":"shizuku_00","vertices":[-44.95,-140.8,38.84,-142.52,113.32,-104.52,152.88,-21.61,158.41,98,138.63,121.75,101.1,70.37,15.56,32.8,-66.77,49.64,-125.25,92.82,-141.54,147.66,-164.81,83.75,-163.65,-26.79,-110.12,-107.98,-129.61,16.39,-93.83,-45.79,-32.15,-42.34,39.42,-55.29,94.7,-16.43,122.63,52.66],"uvs":[0.165365,0.658854,0.259115,0.657552,0.342448,0.686198,0.386719,0.748698,0.384115,0.84375,0.361979,0.864583,0.322917,0.81901,0.236979,0.791667,0.138021,0.795573,0.083333,0.835938,0.057292,0.876302,0.03125,0.828125,0.032552,0.744792,0.092448,0.683594,0.071615,0.78125,0.110677,0.730469,0.186198,0.72526,0.261719,0.713542,0.321615,0.752604,0.356771,0.800781],"triangles":[19,3,18,19,18,6,2,17,18,18,17,7,17,16,7,17,0,16,16,15,8,16,13,15,15,14,8,15,12,14,14,11,9,16,0,13,15,13,12,14,12,11,11,10,9,14,9,8,16,8,7,18,7,6,19,6,5,19,5,4,19,4,3,18,3,2,17,2,1,17,1,0],"userEdges":[]}]},{"name":"D_FACESHADOW.01","display":[{"type":"mesh","name":"D_FACESHADOW.01","path":"shizuku_00","vertices":[-112.17,-137.34,-3.75,-177.32,101.64,-154.69,133.2,-23.69,18.25,-19.29,-140.95,-18.73,-5.89,-112.99,-135.52,-84.32,-89.06,-65.05,124.57,-100.51,91.09,-65.97,-69.01,-127.45,60.77,-138.84,-89.03,-21.26,-77.57,-97.13,-74.16,-151.36,90.94,-28.75,73.09,-105.43,58.84,-163.88,5.88,-67.32,139.39,-65.49,-148.19,-55.54,-39.83,-44.06,57.73,-44.59],"uvs":[0.864583,0.526693,0.926432,0.50651,0.985026,0.521484,0.989583,0.595052,0.938802,0.60026,0.873047,0.598307,0.924479,0.55599,0.868495,0.559789,0.897198,0.578436,0.987118,0.555248,0.964571,0.580045,0.888904,0.538589,0.962012,0.5346,0.899816,0.599102,0.893521,0.55809,0.886269,0.519616,0.966485,0.597421,0.962401,0.555541,0.961233,0.515404,0.93146,0.577566,0.98847,0.577076,0.870617,0.577751,0.916284,0.588448,0.952769,0.589304],"triangles":[23,10,19,22,19,8,22,4,19,23,19,4,23,16,10,23,4,16,22,8,13,22,13,4,17,9,12,18,1,12,18,12,2,17,12,6,15,11,1,14,11,7,14,6,11,15,0,11,20,9,10,17,10,9,16,3,10,20,10,3,17,6,10,19,10,6,12,9,2,14,7,8,21,8,7,21,5,8,13,8,5,19,6,8,14,8,6,11,0,7,11,6,1,12,1,6],"userEdges":[]}]},{"name":"D_HOHO.00","display":[{"type":"mesh","name":"D_HOHO.00","path":"shizuku_00","vertices":[-103.31,-96.89,-31.3,-132.75,61.19,-108.1,103.61,-39.73,104.22,73.54,5.85,140.71,-94.98,122.78,-119.99,-10.59,-47.8,1.74,39.78,-2.74],"uvs":[0.484375,0.023438,0.515299,0.013021,0.555013,0.020182,0.574544,0.040039,0.574544,0.073242,0.53125,0.092448,0.487956,0.08724,0.477214,0.048503,0.516276,0.052083,0.546875,0.050781],"triangles":[9,8,5,9,1,8,8,0,7,8,7,6,8,6,5,9,5,4,9,4,3,9,3,2,9,2,1,8,1,0],"userEdges":[]}]},{"name":"D_HOHO.01","display":[{"type":"mesh","name":"D_HOHO.01","path":"shizuku_00","vertices":[-99.15,-99.63,-12.62,-133.3,86.71,-124.27,155.61,-64.12,151.14,40.89,100.13,132.64,-11.72,148.93,-94.94,111.23,-121.79,3.17,-26.04,35.79,58.07,13.36],"uvs":[0.608073,0.017904,0.638672,0.006836,0.674805,0.008464,0.69987,0.027669,0.698242,0.061198,0.679688,0.090495,0.639648,0.100586,0.608724,0.083659,0.598958,0.049154,0.633789,0.05957,0.664388,0.052409],"triangles":[1,9,10,10,9,6,9,0,8,9,8,7,9,7,6,10,6,5,10,5,4,10,4,3,10,3,2,10,2,1,9,1,0],"userEdges":[]}]},{"name":"D_FACE.00","display":[{"type":"mesh","name":"D_FACE.00","path":"shizuku_00","vertices":[-40.57,-131.63,38.06,-133.33,95.94,-106.92,119.27,-63.47,114.09,3.83,93.35,71.57,66.14,108.2,38.06,123.96,6.95,133.33,-36.25,120.55,-97.81,58.15,-115.73,0.43,-116.6,-71.99,-88.09,-116.29,2.63,97.55,44.1,81.36,65.7,41.32,106.18,29.67,77.8,-4.69,-38.84,81.36,-65.62,48.99,-82.9,8.95,-83.77,-42.17,82.12,-44.73,0.9,52.4,-28.47,8.95,25.96,7.24,-1.69,-43.88,44.97,-37.06,-48.34,-38.76,-63.89,-81.36,0.04,-89.88,58.79,-84.77,-69.84,71.91,-60.16,91.53,-15.35,108.19,-17.78,126.02,-37.76,104.23,-47.98,98.2,-25,114.54,-17.27,118.18,-5.08,120.4,40.43,105.49,20.84,90.44,23.08,112.47,5.74,118.58,15.84,121.09,21.71,128.89,-12.96,91.46,-86.33,75.11,-72.53,84.97,-107.07,27.17,-90.43,37.15,-81.71,53.52,-84.72,64.4,67.67,76.96,82.07,87.76,53.73,94.11,86.43,36.01,100.48,45.64,79.79,55.72,82.88,74.02,67.46,90.45,90.14,52.37,51.45,115.71,-101.99,41.77,-93.12,47.87,-89.52,55.54,-81.1,74.48,-68.67,94.06,-57.3,100.61,-45.4,106.64,-63.17,96.92,-51.45,104.23,-37.09,111.48,53.71,106.89,39.27,114.55,29.54,117.43,45.74,110.42,59.67,100.85,75.73,83,87.79,65.06,-73.55,90.11],"uvs":[0.135417,0.238281,0.253906,0.235677,0.341146,0.276042,0.376302,0.342448,0.36849,0.445313,0.338542,0.549479,0.295573,0.602865,0.253906,0.628906,0.207031,0.643229,0.141927,0.623698,0.052083,0.527344,0.022135,0.440104,0.020833,0.329427,0.063802,0.261719,0.200521,0.588542,0.263021,0.563802,0.295573,0.502604,0.356578,0.486745,0.313802,0.432292,0.138021,0.563802,0.097656,0.514323,0.071615,0.453125,0.070313,0.375,0.320313,0.371094,0.197917,0.519531,0.153646,0.453125,0.235677,0.450521,0.19401,0.372396,0.264323,0.382813,0.123698,0.380208,0.10026,0.315104,0.196615,0.302083,0.285156,0.309896,0.090644,0.550661,0.106547,0.57804,0.173426,0.604799,0.169761,0.632048,0.1403,0.598753,0.124248,0.588236,0.158873,0.61353,0.171504,0.619091,0.18889,0.622483,0.258131,0.598729,0.22796,0.57768,0.229386,0.610366,0.204231,0.619707,0.220427,0.623537,0.229278,0.636432,0.177022,0.57924,0.069032,0.560536,0.086916,0.569976,0.036166,0.480977,0.060272,0.496227,0.073408,0.521251,0.070521,0.538493,0.298538,0.557066,0.318616,0.574235,0.278176,0.581989,0.326808,0.494484,0.349933,0.509859,0.314855,0.523639,0.32048,0.552905,0.297245,0.577046,0.332075,0.51917,0.274096,0.616288,0.043826,0.503291,0.056218,0.511633,0.062617,0.524334,0.077588,0.556626,0.092958,0.584188,0.110198,0.592566,0.128193,0.602431,0.101325,0.587724,0.11866,0.598149,0.141023,0.609837,0.277475,0.600866,0.25606,0.613524,0.239964,0.618364,0.265827,0.607194,0.286501,0.591978,0.309765,0.566666,0.32882,0.538873,0.085223,0.578752],"triangles":[77,76,44,78,76,64,78,42,76,77,7,76,78,64,75,79,57,75,78,75,42,79,75,6,74,71,9,73,71,38,74,37,71,73,38,70,72,70,34,82,69,50,72,34,69,67,53,66,67,66,10,66,52,65,66,65,10,76,7,64,75,64,6,81,63,60,81,5,63,80,62,56,79,62,57,80,55,62,79,6,62,80,56,61,81,60,61,80,61,55,81,61,5,61,60,55,63,58,60,63,59,58,63,5,59,59,17,58,60,58,16,62,55,57,75,57,42,62,6,56,61,56,5,60,16,55,57,55,15,68,54,49,67,54,53,68,33,54,67,10,54,54,33,53,66,53,52,53,20,52,65,52,51,52,21,51,69,34,50,68,49,50,82,50,49,68,50,33,54,10,49,77,46,7,47,7,46,47,46,8,77,44,46,46,44,45,46,45,8,76,42,44,45,44,14,44,42,43,44,43,14,57,15,42,43,42,15,45,14,41,45,41,8,41,40,36,41,35,40,40,39,36,74,39,37,40,35,39,74,9,39,70,38,34,71,37,38,39,35,37,38,37,19,39,9,36,41,36,8,48,19,35,37,35,19,41,14,35,48,35,14,50,34,33,38,19,34,34,19,33,53,33,20,32,31,28,32,1,31,31,30,27,31,0,30,30,22,29,30,29,27,32,28,23,31,27,28,28,27,26,29,25,27,27,25,26,28,26,18,29,21,25,26,25,24,25,20,24,26,24,16,48,24,19,43,15,24,48,14,24,43,24,14,32,23,3,28,18,23,30,12,22,29,22,21,51,21,11,22,11,21,52,20,21,25,21,20,33,19,20,24,20,19,58,18,16,26,16,18,23,18,4,58,17,18,18,17,4,24,15,16,55,16,15,30,0,13,30,13,12,22,12,11,23,4,3,32,3,2,32,2,1,31,1,0],"userEdges":[]}]},{"name":"D_EYE.00","display":[{"type":"mesh","name":"D_EYE.00","path":"shizuku_00","vertices":[-94.67,-62.27,-15.52,-76.5,87.83,-67.01,127.41,-25.66,120.81,15.02,72.44,-5.32,2.07,-11.42,-46.3,21.12,-118.86,2.81,-73.26,47.13,-67.63,-15.65,-46.84,-37.13,-75.14,13.84,30.61,-39.26,-5.88,-40.85,78.15,-29.87,97.67,-12.22,39.95,-73.32,32.49,-8.79,-42.74,-12.11,-52.77,-69.8,-106.99,-29.13,-104.54,46.53,-92.57,28.37,-93.03,-6.5,-82.78,-38.07,-73.84,-48.42,-30.75,-57.35,11.6,-55.83,-22.02,-21.61,-24.79,6.65,57.04,-55.24,56.14,-18.51,107.91,-47.7,15.25,-23.65,-9.42,-56.64,34.49,-54.37,82.55,-46.75,101.49,-27.88,93.37,4.82,120.46,-9.7,55.09,-34.43,54.2,-6.9,13.18,-40.02,-26.03,-39.02,-49.86,-53.75,-58.98,-0.73,-44.3,1.37,-23.62,-12.98,-2.03,-26.62,31.61,-22.95,-90.92,-23.98,-95.65,8.67,-89.69,46.82,-57.85,32.26,-110.75,27.57,43.17,-29.05,66.33,-23.77,75.81,-19.83],"uvs":[0.020508,0.90918,0.055664,0.902344,0.101563,0.905273,0.119141,0.926758,0.115234,0.947266,0.094727,0.936523,0.063477,0.933594,0.041992,0.949219,0.009766,0.94043,0.03002,0.961712,0.032519,0.931563,0.041754,0.921252,0.029184,0.945726,0.076474,0.920553,0.059944,0.919462,0.09759,0.923432,0.10626,0.93191,0.079648,0.903875,0.076984,0.93486,0.043575,0.932288,0.039118,0.905561,0.015038,0.925091,0.016127,0.961422,0.021443,0.9527,0.021239,0.935959,0.027092,0.92145,0.031065,0.915178,0.048897,0.911543,0.067383,0.912598,0.05229,0.927238,0.051544,0.942272,0.088542,0.913203,0.08749,0.930192,0.110482,0.916175,0.069328,0.927723,0.058048,0.91188,0.077743,0.913885,0.099395,0.915183,0.107803,0.925008,0.104023,0.941393,0.117681,0.93442,0.087347,0.922035,0.086627,0.935764,0.06858,0.920032,0.050995,0.920343,0.040413,0.913267,0.036363,0.938728,0.042879,0.939734,0.052067,0.932845,0.061653,0.926298,0.076747,0.928211,0.023476,0.928216,0.020074,0.943241,0.022723,0.961559,0.036865,0.954569,0.013367,0.952315,0.081893,0.925294,0.092165,0.927063,0.096419,0.928787],"triangles":[58,57,5,58,15,57,56,50,32,56,13,50,47,19,46,47,46,7,57,41,32,56,32,41,57,15,41,56,41,13,50,34,18,43,14,34,49,34,14,50,13,34,43,34,13,49,6,34,37,15,33,38,33,15,38,3,33,37,33,2,42,32,18,50,18,32,42,5,32,57,32,5,37,31,15,41,15,31,36,31,17,37,2,31,36,13,31,41,31,13,48,19,30,47,30,19,47,7,30,48,30,6,48,29,19,49,14,29,44,29,14,44,11,29,48,6,29,49,29,6,36,17,28,35,14,28,43,28,14,43,13,28,36,28,13,35,28,1,35,27,14,44,14,27,45,27,20,45,11,27,44,27,11,35,1,27,45,20,26,45,26,11,26,25,11,51,25,21,51,10,25,26,0,25,52,12,24,51,21,24,51,24,10,52,24,8,52,23,12,55,22,23,53,23,22,52,8,23,55,23,8,53,9,23,25,0,21,24,21,8,27,1,20,26,20,0,29,11,19,46,19,10,34,6,18,31,2,17,28,17,1,40,16,4,39,4,16,38,15,16,58,16,15,40,3,16,38,16,3,58,5,16,39,16,5,54,12,9,23,9,12,46,10,12,24,12,10,54,7,12,46,12,7,19,11,10,25,10,11],"userEdges":[]}]},{"name":"D_EYE.01","display":[{"type":"mesh","name":"D_EYE.01","path":"shizuku_00","vertices":[-105.01,-39.22,-52.54,-60.49,26.18,-68.22,85.73,-41.15,107.93,3.31,113.99,44.88,32.24,12.01,-21.25,-1.52,-57.58,10.08,-91.89,47.78,-108.04,-0.55,-61.62,-23.75,1.96,-36.32,63.52,-21.82,76.64,14.91,-32.15,-29.58,-81.53,5.03,-6.18,-65.04,-21.32,-46.65,-77.66,-50.31,16.74,-12.72,42.45,-48.01,29.55,-29.82,9.54,6.27,14.28,-54.96,52.9,-56.08,84.89,-9.72,45.13,-1.93,85.09,48.11,95.76,30.26,42.02,30.31,63.74,35.34,69.3,-5.64,97.79,-16.99,103.76,65.46,54.08,24.95,49.49,13.14,81.22,32.92,111.28,26.33,91.82,9.29,99.05,46.55,-88.24,-10.45,-69.56,23.24,-84.28,-31.83,-57.37,-40.95,-43.59,-13.82,-8.51,-20.61,-26.9,-63.01,-15.23,-32.92,-69.4,-36.63,-41.25,-43.37,-1.78,-49.52,-59.64,-7.21,-26.93,-16.15,-71.41,-9.6],"uvs":[0.148926,0.912109,0.174316,0.901367,0.212402,0.897461,0.241211,0.911133,0.251953,0.933594,0.254883,0.95459,0.215332,0.937988,0.189453,0.931152,0.171875,0.937012,0.155273,0.956055,0.147461,0.931641,0.169922,0.919922,0.200684,0.913574,0.230469,0.920898,0.236816,0.939453,0.18418,0.91698,0.160287,0.934462,0.196742,0.899067,0.189417,0.908358,0.162163,0.906509,0.207835,0.925494,0.220272,0.907671,0.214029,0.916856,0.204352,0.935088,0.207293,0.904487,0.225327,0.903595,0.240808,0.927008,0.221571,0.930944,0.240901,0.956221,0.246067,0.947203,0.220065,0.947229,0.230572,0.94977,0.233265,0.929071,0.247049,0.923339,0.249934,0.964983,0.225899,0.944521,0.223677,0.938557,0.239032,0.948548,0.253575,0.945217,0.244159,0.936611,0.247657,0.955433,0.157039,0.926643,0.166081,0.943658,0.158957,0.915842,0.171979,0.911235,0.178643,0.924937,0.195615,0.921508,0.186718,0.900095,0.192367,0.91529,0.166158,0.913415,0.179779,0.910013,0.198872,0.906907,0.170877,0.928276,0.186703,0.923761,0.165185,0.92707],"triangles":[54,16,52,54,52,11,48,15,46,53,46,15,53,7,46,48,46,12,53,15,45,52,8,45,53,45,7,52,45,11,50,44,15,49,44,19,50,1,44,49,11,44,49,19,43,49,43,11,54,41,16,43,0,41,54,11,41,43,41,11,36,6,35,36,35,14,40,28,34,40,34,5,37,31,28,35,30,31,37,14,31,35,31,14,35,6,30,39,29,4,38,4,29,37,28,29,40,29,28,40,5,29,38,29,5,39,14,29,37,29,14,32,27,14,36,14,27,36,27,6,32,13,27,33,3,26,32,14,26,39,26,14,39,4,26,33,26,4,32,26,13,25,21,3,51,24,17,51,12,24,24,12,21,22,21,12,25,2,21,24,21,2,22,13,21,22,20,13,27,13,20,46,7,20,23,20,7,23,6,20,27,20,6,22,12,20,46,20,12,44,1,19,43,19,0,48,18,15,50,15,18,51,17,18,47,18,17,47,1,18,50,18,1,48,12,18,51,18,12,24,2,17,42,16,9,42,8,16,52,16,8,41,10,16,44,11,15,45,15,11,21,13,3,26,3,13,41,0,10,16,10,9,45,8,7],"userEdges":[]}]},{"name":"D_EYE.02","display":[{"type":"mesh","name":"D_EYE.02","path":"shizuku_00","vertices":[-63.16,-35.83,21.86,-58.88,112.75,-39.9,122.96,45.53,74.89,107.86,-23.58,122.81,-88.08,79.42,-91.01,10.27,-11.85,57.73,61.44,33.32],"uvs":[0.733724,0.386068,0.771484,0.375,0.811849,0.384115,0.816406,0.42513,0.794922,0.455078,0.751302,0.46224,0.722656,0.441406,0.721354,0.408203,0.75651,0.43099,0.789063,0.419271],"triangles":[1,8,9,9,8,4,8,0,7,8,7,6,8,6,5,8,5,4,9,4,3,9,3,2,9,2,1,8,1,0],"userEdges":[]}]},{"name":"D_EYE.03","display":[{"type":"mesh","name":"D_EYE.03","path":"shizuku_00","vertices":[-60.95,-53.4,28.87,-54.36,106.58,-12.8,98.51,69.85,30.89,115.77,-59.94,102.24,-108.38,37.47,-93.24,-25.36,-8.47,43.27,55.11,8.47,-19.57,-8.93,-59.94,29.74],"uvs":[0.736328,0.476074,0.779785,0.475586,0.817383,0.496582,0.815918,0.539063,0.780762,0.561523,0.736816,0.554688,0.713379,0.521973,0.720703,0.490234,0.761719,0.524902,0.79248,0.507324,0.756348,0.498535,0.736816,0.518066],"triangles":[11,10,7,11,8,10,10,9,1,10,8,9,9,8,3,11,5,8,10,0,7,11,7,6,11,6,5,8,5,4,8,4,3,9,3,2,9,2,1,10,1,0],"userEdges":[]}]},{"name":"D_EYE.04","display":[{"type":"mesh","name":"D_EYE.04","path":"shizuku_00","vertices":[-50.88,86.88,-19.37,88.91,6.84,107.04,-10.94,127.72,-46.48,120.09,-23.03,107.89],"uvs":[0.299805,0.963542,0.313802,0.964518,0.329102,0.972982,0.318034,0.986328,0.301758,0.979492,0.312174,0.973633],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.05","display":[{"type":"mesh","name":"D_EYE.05","path":"shizuku_00","vertices":[18.78,119.64,18.78,95.47,60.16,86.77,73.28,112.87,45.02,129.3,46.03,108.04],"uvs":[0.344238,0.983398,0.34668,0.969727,0.368164,0.963379,0.373047,0.978516,0.359375,0.986816,0.359863,0.976074],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.06","display":[{"type":"mesh","name":"D_EYE.06","path":"shizuku_00","vertices":[-86.61,38.74,-130.59,-26.34,-107.13,-117.18,-29.44,-165.99,76.1,-155.14,128.87,-92.77,136.2,-22.27,102.49,8.91,45.32,-16.85,-42.64,3.49,-41.17,-73.79,52.65,-85.99,96.62,-48.03,0.61,-46.28,-86.2,-50.36,-90.57,-11.29,12.77,-124.85,-34.71,-124.61,63.06,-116.71,88.06,-89.14,-73.54,-95.08],"uvs":[0.028646,0.229818,0.007161,0.199219,0.019531,0.154948,0.054036,0.13151,0.100911,0.136719,0.124349,0.166667,0.127604,0.200521,0.11263,0.215495,0.08724,0.203125,0.048177,0.212891,0.048828,0.175781,0.090495,0.169922,0.110026,0.188151,0.067386,0.188992,0.028829,0.187031,0.026888,0.205794,0.072786,0.151265,0.051699,0.151379,0.095122,0.155174,0.106225,0.168409,0.034454,0.165559],"triangles":[19,5,18,19,18,11,20,17,2,20,10,17,18,4,16,17,10,16,17,16,3,18,16,11,15,9,14,20,2,14,15,14,1,20,14,10,19,11,12,19,12,5,13,11,10,16,10,11,13,8,11,12,11,8,14,9,10,13,10,9,15,0,9,13,9,8,12,8,7,12,7,6,12,6,5,18,5,4,16,4,3,17,3,2,14,2,1,15,1,0],"userEdges":[]}]},{"name":"D_EYE.07","display":[{"type":"mesh","name":"D_EYE.07","path":"shizuku_00","vertices":[-19.18,-84.98,23.33,-106.67,70.97,-104.64,87.09,-63.96,43.12,-62.61,0.61,-68.03,23.33,-87.69,54.11,-85.66],"uvs":[0.490885,0.204427,0.509766,0.19401,0.530924,0.194987,0.538086,0.214518,0.518555,0.215169,0.499674,0.212565,0.509766,0.203125,0.523438,0.204102],"triangles":[7,6,4,7,1,6,6,0,5,6,5,4,7,4,3,7,3,2,7,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE.08","display":[{"type":"mesh","name":"D_EYE.08","path":"shizuku_00","vertices":[-29.08,-74.47,17.1,-95.82,63.27,-91.76,84.16,-62.27,32.49,-63.28,2.03,-68.82,25.87,-77.29,45.96,-75.74,72.55,-78.67,55.01,-62.84,7.17,-78.03,33.65,-94.37,-3.79,-86.16,64.25,-69.29,42,-83.53],"uvs":[0.023926,0.648438,0.044434,0.638184,0.064941,0.640137,0.074219,0.654297,0.05127,0.653809,0.03774,0.651151,0.048328,0.647085,0.057251,0.647827,0.069059,0.646422,0.06127,0.654021,0.040023,0.646728,0.051784,0.638884,0.035156,0.642822,0.065377,0.650925,0.055495,0.644087],"triangles":[14,11,6,14,2,11,12,0,10,12,10,1,13,7,9,13,9,3,13,8,7,13,3,8,14,6,7,8,2,7,14,7,2,9,7,4,10,5,6,11,1,6,10,6,1,7,6,4,10,0,5,6,5,4],"userEdges":[]}]},{"name":"D_EYE.09","display":[{"type":"mesh","name":"D_EYE.09","path":"shizuku_00","vertices":[-105.52,-52.27,-78.61,-84.49,-36.89,-89,1.46,-67.09,-24.11,-55.49,-71.88,-49.69,-52.9,-70.81],"uvs":[0.572591,0.207357,0.585612,0.191081,0.605794,0.188802,0.624349,0.19987,0.611979,0.205729,0.588867,0.208659,0.598049,0.19799],"triangles":[6,4,2,6,1,5,6,5,4,4,3,2,6,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.10","display":[{"type":"mesh","name":"D_EYE.10","path":"shizuku_00","vertices":[-91.41,-58.28,-66.86,-76.74,-25.86,-79.37,-1.97,-61.09,-32.13,-54.77,-64.41,-53.58],"uvs":[0.089518,0.650065,0.101563,0.640951,0.121419,0.639974,0.132813,0.649414,0.118164,0.652344,0.102539,0.652669],"triangles":[1,5,4,4,3,2,4,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.11","display":[{"type":"mesh","name":"D_EYE.11","path":"shizuku_00","vertices":[-100.98,27.16,-138.65,-36,-122.51,-112.04,-17.55,-141.69,100.87,-113.33,142.58,-16.66,95.48,64.54,49.73,2.67,-36.39,-5.06,-47.15,-69.51,40.31,-70.8,-81.53,-18.72,1.1,-41.06,85.4,-46.93,95.21,-6.8,-100.28,-50.05,-86.02,-91.45,-72.22,-126.25,-30.53,-110.03,-3.29,-70.16,10.26,-107.62,47.59,-126.09,69.67,-91.42,121.99,-64.37,44.2,-40.48,44.19,-100.22,92.39,-76.97,-61.64,-102.31],"uvs":[0.147135,0.211589,0.128906,0.179688,0.136719,0.141276,0.1875,0.126302,0.244792,0.140625,0.264974,0.189453,0.242188,0.230469,0.220052,0.199219,0.178385,0.195313,0.173177,0.16276,0.215495,0.162109,0.156544,0.188415,0.196521,0.179086,0.237308,0.174164,0.242054,0.194436,0.147475,0.172588,0.154374,0.15168,0.16105,0.134102,0.181219,0.14229,0.194401,0.162434,0.200955,0.143511,0.219018,0.134182,0.229699,0.151693,0.255014,0.165356,0.217375,0.177423,0.21737,0.147249,0.240693,0.158992,0.166167,0.146195],"triangles":[26,13,23,26,23,4,26,22,13,25,22,21,26,4,22,25,10,22,25,21,20,22,4,21,21,3,20,25,20,10,20,18,19,20,19,10,27,18,17,20,3,18,27,9,18,19,18,9,27,17,16,18,3,17,17,2,16,27,16,9,16,2,15,16,15,9,14,13,7,24,7,13,14,5,13,23,13,5,22,10,13,24,13,10,24,12,7,19,9,12,24,10,12,19,12,10,15,11,9,15,1,11,11,8,9,12,9,8,11,0,8,12,8,7,14,7,6,14,6,5,15,2,1,11,1,0],"userEdges":[]}]},{"name":"D_EYE.12","display":[{"type":"mesh","name":"D_EYE.12","path":"shizuku_00","vertices":[-96.8,7.73,-59.01,0.61,-57.83,37.22,-51.92,72.81,-42.08,95.18,-72.39,79.93,-92.86,43.66,-77.86,22.06,-69.82,59.3,-75.22,40.75,-61.63,76.38,-78.64,4.31],"uvs":[0.321289,0.612305,0.336914,0.608887,0.337402,0.626465,0.34082,0.642578,0.342285,0.65332,0.330078,0.646973,0.322266,0.629883,0.32912,0.619187,0.332768,0.637069,0.329886,0.628162,0.335829,0.64462,0.328796,0.610663],"triangles":[10,8,5,9,8,2,9,6,8,10,3,8,9,7,6,11,7,1,11,0,7,9,2,7,7,0,6,8,6,5,10,5,4,10,4,3,8,3,2,7,2,1],"userEdges":[]}]},{"name":"D_EYE.13","display":[{"type":"mesh","name":"D_EYE.13","path":"shizuku_00","vertices":[71.26,10.4,105.58,25.23,96.83,63.89,77.99,84.52,57.13,94.83,61.17,63.25,67.23,32.31,80.01,53.58,83.15,29.37,68.68,77.5],"uvs":[0.396159,0.60612,0.41276,0.613607,0.408529,0.633138,0.400065,0.642904,0.388021,0.647135,0.391276,0.632813,0.394206,0.617188,0.400391,0.62793,0.401908,0.615701,0.395561,0.637733],"triangles":[8,7,1,8,6,7,9,7,5,9,3,7,8,0,6,7,6,5,9,5,4,9,4,3,7,3,2,7,2,1,8,1,0],"userEdges":[]}]},{"name":"D_EYE.14","display":[{"type":"mesh","name":"D_EYE.14","path":"shizuku_00","vertices":[-19.18,-94.13,10.14,-71.08,36.52,-46,-8.19,-36.51,-24.31,-59.56,0.47,-52.85,-9.01,-64.68,10.18,-40.4],"uvs":[0.710286,0.263997,0.723307,0.275065,0.735026,0.287109,0.715169,0.291667,0.708008,0.280599,0.719016,0.283819,0.714806,0.27814,0.723326,0.289795],"triangles":[7,2,5,6,4,5,7,5,3,6,5,1,6,0,4,5,4,3,5,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE.15","display":[{"type":"mesh","name":"D_EYE.15","path":"shizuku_00","vertices":[-119.59,-17.52,-95.41,-22.61,-55.83,-27.35,-70.12,3.15,-96.87,3.83,-111.53,-4.64,-79.95,-8.54,-102.39,-6.62],"uvs":[0.663574,0.29834,0.680664,0.296387,0.698242,0.294434,0.691895,0.309082,0.678711,0.308105,0.667969,0.307129,0.686063,0.30249,0.672194,0.303901],"triangles":[7,4,1,6,1,4,7,0,5,7,5,4,6,4,3,6,3,2,6,2,1,7,1,0],"userEdges":[]}]},{"name":"D_EYE.16","display":[{"type":"mesh","name":"D_EYE.16","path":"shizuku_00","vertices":[-107.41,68.23,-94.22,41.79,-73.33,29.59,-70.03,58.06,-82.66,49.57],"uvs":[0.668945,0.34082,0.674805,0.328125,0.684082,0.322266,0.685547,0.335938,0.679936,0.331857],"triangles":[4,0,3,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_EYE.17","display":[{"type":"mesh","name":"D_EYE.17","path":"shizuku_00","vertices":[-44.46,-47.28,-12.17,-60.16,29.55,-75.63,18.11,-43.41,-3.42,-34.39],"uvs":[0.769857,0.280599,0.785482,0.274089,0.805664,0.266276,0.80013,0.282552,0.789714,0.287109],"triangles":[1,4,3,3,2,1,4,1,0],"userEdges":[]}]},{"name":"D_EYE.18","display":[{"type":"mesh","name":"D_EYE.18","path":"shizuku_00","vertices":[62.18,-20.53,96.49,-12.8,126.1,-4.42,103.89,11.05,79,11.69,62.85,-3.77,83.71,-3.13,100.13,-1.08],"uvs":[0.817383,0.292643,0.833984,0.296549,0.848307,0.300781,0.837565,0.308594,0.825521,0.308919,0.817708,0.301107,0.827799,0.301432,0.835743,0.302467],"triangles":[7,1,6,7,6,3,6,0,5,6,5,4,6,4,3,7,3,2,7,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE.19","display":[{"type":"mesh","name":"D_EYE.19","path":"shizuku_00","vertices":[71.77,4.6,104.06,21.36,130.97,36.83,103.39,42.63,79.17,40.05,74.12,23.78,89.26,27.16,103.72,32.14],"uvs":[0.830078,0.319336,0.845703,0.327799,0.858724,0.335612,0.845378,0.338542,0.833659,0.33724,0.829753,0.328776,0.838542,0.330729,0.845538,0.333247],"triangles":[7,1,6,7,6,3,6,0,5,6,5,4,6,4,3,7,3,2,7,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.07","display":[{"type":"mesh","name":"D_EYE_BALL.07","path":"shizuku_00","vertices":[-22.7,-144.12,96.35,-124.86,164.75,-21.7,156.66,90.3,59.54,151.8,-78.97,136.04,-146.07,25.73,-124.42,-103.85,9.76,29.23,-1.06,-63.57],"uvs":[0.913086,0.32666,0.939941,0.332031,0.955078,0.36084,0.953125,0.39209,0.931641,0.40918,0.900391,0.404785,0.885254,0.374023,0.890137,0.337891,0.92041,0.375,0.917969,0.349121],"triangles":[9,8,2,9,6,8,9,0,7,9,7,6,8,6,5,8,5,4,8,4,3,8,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.08","display":[{"type":"mesh","name":"D_EYE_BALL.08","path":"shizuku_00","vertices":[-51.01,-135.33,136.17,-89.11,147.18,155.85,-17.98,155.85,-161.11,12.57,33.41,7.95],"uvs":[0.905599,0.25,0.922201,0.253255,0.923177,0.270508,0.908529,0.270508,0.895833,0.260417,0.913086,0.260091],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.09","display":[{"type":"mesh","name":"D_EYE_BALL.09","path":"shizuku_00","vertices":[-102.3,-113.07,66.41,-105.67,143.1,92.1,15.29,178.63,-173.87,38.11,-0.05,24.12],"uvs":[0.952148,0.25,0.969238,0.251953,0.976563,0.267578,0.964355,0.274414,0.94873,0.265137,0.962891,0.262207],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.10","display":[{"type":"mesh","name":"D_EYE_BALL.10","path":"shizuku_00","vertices":[-52.92,-153.15,160.18,-78.41,90.92,157.3,-122.18,151.55,-159.47,-20.92,-4.98,7.82],"uvs":[0.888021,0.287109,0.901042,0.291341,0.89681,0.304688,0.883789,0.304362,0.88151,0.294596,0.890951,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.11","display":[{"type":"mesh","name":"D_EYE_BALL.11","path":"shizuku_00","vertices":[-160.05,-23.04,-16.64,-152.36,163.79,-56.77,126.78,145.64,-86.03,156.89,1.87,27.56],"uvs":[0.924154,0.293294,0.934245,0.285807,0.94694,0.291341,0.944336,0.30306,0.929362,0.303711,0.935547,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.12","display":[{"type":"mesh","name":"D_EYE_BALL.12","path":"shizuku_00","vertices":[-12.72,-139.91,107.08,-95.71,127.52,18.11,89.69,132.29,-10.39,154.89,-114.4,119.98,-144.34,14.37,-94.19,-113.56,-15.01,47.96,-15.16,-48.98],"uvs":[0.910645,0.327637,0.941895,0.333008,0.953613,0.362305,0.951172,0.393555,0.929688,0.406738,0.902832,0.40332,0.888184,0.375977,0.890625,0.339844,0.921387,0.37793,0.915527,0.352051],"triangles":[9,6,8,9,8,2,9,0,7,9,7,6,8,6,5,8,5,4,8,4,3,8,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.00","display":[{"type":"mesh","name":"D_EYE_BALL.00","path":"shizuku_00","vertices":[-35.69,-149.38,120.86,-119.02,166.31,26.9,115.81,129.04,-20.54,155.31,-107.11,104.53,-141.74,-47.82,4.35,-31.18,23.83,61.63],"uvs":[0.436035,0.269531,0.470215,0.276367,0.480469,0.318359,0.469727,0.346191,0.438965,0.353516,0.418945,0.340332,0.410156,0.296875,0.44458,0.301514,0.448975,0.327393],"triangles":[8,1,7,8,7,6,7,0,6,8,6,5,8,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.01","display":[{"type":"mesh","name":"D_EYE_BALL.01","path":"shizuku_00","vertices":[19.22,-139.16,129,-73.15,127,73.12,45.17,160.53,-102.53,137.34,-150.43,48.15,-113.17,-107.05,-0.74,-30.34,-14.71,51.72],"uvs":[0.560059,0.268555,0.586914,0.286621,0.586426,0.32666,0.566406,0.350586,0.530273,0.344238,0.518555,0.319824,0.529785,0.275879,0.555176,0.29834,0.551758,0.320801],"triangles":[2,7,8,5,8,7,7,0,6,7,6,5,8,5,4,8,4,3,8,3,2,7,2,1,7,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.02","display":[{"type":"mesh","name":"D_EYE_BALL.02","path":"shizuku_00","vertices":[-51.01,-135.33,136.17,-89.11,147.18,155.85,-17.98,155.85,-161.11,12.57,33.41,7.95],"uvs":[0.905599,0.25,0.922201,0.253255,0.923177,0.270508,0.908529,0.270508,0.895833,0.260417,0.913086,0.260091],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.03","display":[{"type":"mesh","name":"D_EYE_BALL.03","path":"shizuku_00","vertices":[-102.3,-113.07,66.41,-105.67,143.1,92.1,15.29,178.63,-173.87,38.11,-0.05,24.12],"uvs":[0.952148,0.25,0.969238,0.251953,0.976563,0.267578,0.964355,0.274414,0.94873,0.265137,0.962891,0.262207],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.04","display":[{"type":"mesh","name":"D_EYE_BALL.04","path":"shizuku_00","vertices":[-52.92,-153.15,160.18,-78.41,90.92,157.3,-122.18,151.55,-159.47,-20.92,-4.98,7.82],"uvs":[0.888021,0.287109,0.901042,0.291341,0.89681,0.304688,0.883789,0.304362,0.88151,0.294596,0.890951,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.05","display":[{"type":"mesh","name":"D_EYE_BALL.05","path":"shizuku_00","vertices":[-160.05,-23.04,-16.64,-152.36,163.79,-56.77,126.78,145.64,-86.03,156.89,1.87,27.56],"uvs":[0.924154,0.293294,0.934245,0.285807,0.94694,0.291341,0.944336,0.30306,0.929362,0.303711,0.935547,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_BROW.00","display":[{"type":"mesh","name":"D_BROW.00","path":"shizuku_02","vertices":[-160.01,142.01,-112.68,5.9,-30.63,-91.83,68.77,-105.79,128.73,-49.94,153.97,19.86,101.91,5.9,18.28,12.88,-60.61,68.72,-47.7,-0.4,15.68,-98.33,46.61,-53.69,-9.72,-47.07,-107.47,103.27,-81.89,43.05,16.77,-51.52,85.23,-50.33,116.11,-23.66,-138.37,79.78,-109.91,57.73,-63.61,-52.55,-30.67,47.53,55.43,9.78,73.02,-25.23,32.13,-19.67,94.94,-81.41,-76.9,2.43,-38.31,-50.72,-17.78,5.62,-87.59,-23.98],"uvs":[0.08724,0.645833,0.106771,0.620443,0.140625,0.602214,0.181641,0.599609,0.20638,0.610026,0.216797,0.623047,0.195313,0.620443,0.160807,0.621745,0.128255,0.632161,0.133581,0.619267,0.159733,0.601,0.172495,0.609327,0.149252,0.610562,0.108919,0.638607,0.119474,0.627372,0.160185,0.609733,0.18843,0.609955,0.201171,0.614929,0.09617,0.634223,0.107914,0.630112,0.127017,0.609541,0.14061,0.628208,0.176134,0.621166,0.183393,0.614636,0.166522,0.615673,0.192439,0.604156,0.121536,0.619795,0.137458,0.609882,0.145927,0.620391,0.117122,0.614869],"triangles":[29,26,20,29,1,26,23,11,22,24,22,11,24,7,22,23,22,6,28,9,21,28,21,7,26,9,20,27,20,9,27,2,20,19,18,13,19,1,18,25,16,4,17,4,16,23,16,11,23,6,16,17,16,6,25,3,16,24,11,15,24,15,7,26,14,9,19,13,14,26,1,14,19,14,1,18,0,13,14,13,8,28,12,9,27,9,12,15,10,12,28,7,12,15,12,7,27,12,2,15,11,10,16,3,11,11,3,10,12,10,2,14,8,9,21,9,8,17,6,5,17,5,4],"userEdges":[]}]},{"name":"D_BROW.01","display":[{"type":"mesh","name":"D_BROW.01","path":"shizuku_02","vertices":[-147.95,38.77,-118.67,-29.47,-60.87,-68.98,2.95,-72.57,66.76,-34.86,117.81,31.59,159.1,135.75,108.05,107.02,47.24,54.94,-14.32,22.61,-76.63,24.41,88.03,38.21,26.48,-4.84,-38.07,-24.11,-102.67,-8.97,-68.18,-25.69,-7.18,-16.74,56.83,10.83,112.75,70.69,-97.65,-43.84,-105.77,30.28,-42.1,23.41,-29.73,-70.73,34.49,-53.93,18.06,39.61,95.79,2.92,79.63,82.68,-82.01,-38.63,-51.42,-50.39,-18.74,-46.95,15.48,-36.49,46.29,-19.6,77.67,2.61,-88.66,9,-56.18,-1.33,-26.94,-2.22,5.11,9.54,35.8,22.01,67.83,46.49,98.89,75.52,131.46,66.01,-120.27,9.59,-122.27,33.6,-129.91,-3.28],"uvs":[0.295898,0.611979,0.308594,0.599609,0.333659,0.592448,0.361328,0.591797,0.388997,0.598633,0.411133,0.610677,0.429036,0.629557,0.406901,0.624349,0.380534,0.614909,0.353841,0.609049,0.326823,0.609375,0.398218,0.611877,0.37153,0.604074,0.343545,0.60058,0.315531,0.603326,0.33049,0.600295,0.356936,0.601917,0.384691,0.606914,0.408939,0.617764,0.317708,0.597005,0.31419,0.610439,0.341795,0.609195,0.347159,0.59213,0.375007,0.595176,0.367881,0.612131,0.401583,0.605481,0.394578,0.619937,0.324492,0.597949,0.337754,0.595817,0.351924,0.596441,0.366762,0.598336,0.38012,0.601398,0.393725,0.605424,0.321608,0.606582,0.335692,0.60471,0.34837,0.604549,0.362264,0.606681,0.375574,0.60894,0.389463,0.613378,0.402926,0.618639,0.417048,0.616915,0.307901,0.606689,0.307034,0.611041,0.303722,0.604356],"triangles":[42,20,41,43,41,1,43,0,41,42,41,0,39,11,26,38,26,11,38,8,26,39,26,7,32,11,25,32,25,4,37,12,24,36,24,12,36,9,24,37,24,8,30,12,23,31,23,12,31,4,23,30,23,3,28,13,22,29,22,13,29,3,22,28,22,2,34,21,13,35,13,21,34,10,21,35,21,9,33,14,20,41,20,14,33,20,10,27,19,14,27,2,19,40,18,6,39,18,11,40,5,18,39,7,18,32,17,11,38,11,17,31,12,17,37,17,12,32,4,17,31,17,4,37,8,17,38,17,8,30,16,12,36,12,16,29,13,16,35,16,13,30,3,16,29,16,3,35,9,16,36,16,9,28,15,13,34,13,15,27,14,15,33,15,14,28,2,15,27,15,2,33,10,15,34,15,10,19,1,14,41,14,1,25,11,5,18,5,11,18,7,6],"userEdges":[]}]},{"name":"D_MOUTH.00","display":[{"type":"mesh","name":"D_MOUTH.00","path":"shizuku_00","vertices":[-61.02,-100.31,59.04,-101.55,131.33,-54.93,115.1,10.01,42.64,42.13,-63.57,40.92,-136.8,-3.23,-136.55,-72.01,-54.03,-32.54,37.78,-34.13],"uvs":[0.313477,0.874512,0.365723,0.874023,0.397461,0.897949,0.390625,0.931152,0.358887,0.947266,0.312988,0.947754,0.280273,0.924805,0.280273,0.88916,0.316895,0.909668,0.356934,0.908691],"triangles":[9,8,5,9,0,8,8,0,7,8,7,6,8,6,5,9,5,4,9,4,3,9,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_MOUTH.03","display":[{"type":"mesh","name":"D_MOUTH.03","path":"shizuku_00","vertices":[-118.79,20.11,-84.22,-19.56,-17.35,-25.64,77.56,-28.31,126.28,26.08,131.17,88.37,73.43,93.58,2.52,103.85,-53.69,87.29,-100.59,76.14,33.52,46.75,111.46,41.59,-70.85,37.49],"uvs":[0.686035,0.228516,0.70752,0.215332,0.739746,0.212891,0.780273,0.210938,0.809082,0.220215,0.802246,0.234375,0.777832,0.235352,0.748047,0.237305,0.723145,0.23877,0.700195,0.239258,0.761182,0.226558,0.793993,0.225572,0.716008,0.228065],"triangles":[11,3,6,10,6,3,10,2,7,12,8,2,12,1,9,12,9,8,2,8,7,10,7,6,11,6,5,11,5,4,11,4,3,10,3,2,12,2,1,9,1,0],"userEdges":[]}]},{"name":"D_MOUTH.01","display":[{"type":"mesh","name":"D_MOUTH.01","path":"shizuku_00","vertices":[-111.61,-104.94,-73.02,-80.53,-13.74,-52.42,58.49,-66.08,98.01,-96.46,118.84,-102.5,139.78,-5.89,94.19,51.7,55.75,85.04,-2.18,91.62,-59.18,81.52,-103.6,34.92,-86.38,0.61,-107.28,-53.16,7.68,35.98,75.93,21.79,103.67,-10.46,111.47,-66.07,61.78,-22.71,-35.98,-17.44,-126.72,-89.5,-110.4,-77.46,-100.67,-98.27,-93.77,-64.09,-52.46,-42.3,-27.26,-35.48,34.31,-36.53,61.49,-42.85,91.36,-64.12,105.62,-76.93,115.83,-92.44,110.48,-103.96,121.09,-72.38,6.77,-19.93,-96.52,-79.74,-106.27,-85.89,-85.87,-70.65,-60.95,-56.28,-84.72,-88.22,-25.4,-43.5,-42.63,-61.11,12.74,-43.73,44.17,-47.21,29.01,-51.97,59.7,-50.61,79.49,-62.44,81.13,-81.84,94.55,-74.65,103.22,-86.13,109.56,-90.22,-74.48,-59.5,-43.53,-50.02,-38.37,-42.92,-5.27,-40.01,6.96,-36.06,-101.02,-69.91,30.68,-45.72,-8.44,-43.6,-26.2,-40.05],"uvs":[0.874268,0.173096,0.892334,0.16333,0.909424,0.16333,0.928223,0.16333,0.943115,0.163574,0.956055,0.17041,0.958984,0.184082,0.954346,0.199707,0.936523,0.209473,0.912354,0.21167,0.888916,0.208984,0.877441,0.195801,0.894531,0.189453,0.888916,0.178711,0.914307,0.190674,0.932617,0.188965,0.947021,0.18335,0.94165,0.175293,0.927002,0.175537,0.905273,0.17627,0.875412,0.181282,0.881461,0.175853,0.87941,0.170316,0.890266,0.172636,0.900208,0.171204,0.906937,0.171084,0.92042,0.170967,0.92746,0.170956,0.936458,0.170667,0.942103,0.171672,0.947607,0.173274,0.948877,0.166618,0.951739,0.176592,0.914329,0.175964,0.885254,0.171021,0.880559,0.173419,0.89107,0.169017,0.897156,0.168152,0.886814,0.166314,0.908104,0.167444,0.902344,0.16333,0.915454,0.167518,0.923474,0.167978,0.919922,0.16333,0.927786,0.167693,0.933468,0.168003,0.936649,0.163468,0.938815,0.168157,0.942539,0.168187,0.945395,0.169216,0.894316,0.17,0.90252,0.167805,0.904318,0.169247,0.911619,0.169124,0.91443,0.171019,0.886429,0.174038,0.92003,0.16778,0.911373,0.167477,0.907602,0.169009],"triangles":[57,39,53,58,53,39,58,25,53,54,53,25,54,41,53,57,53,41,58,52,25,58,39,52,52,51,24,52,39,51,49,31,48,49,48,29,48,47,29,48,4,47,47,46,45,47,4,46,47,45,28,46,3,45,45,44,27,45,3,44,44,42,27,56,43,41,56,42,43,44,3,42,43,42,3,56,26,42,54,26,41,56,41,26,43,2,41,57,41,2,51,40,37,51,39,40,57,2,39,40,39,2,55,23,34,50,37,36,50,24,37,51,37,24,40,1,37,38,34,36,34,23,36,50,36,23,37,1,36,38,36,1,55,34,21,35,21,34,38,22,34,35,34,22,54,25,33,54,33,26,49,30,31,48,31,4,49,29,30,32,5,30,31,30,5,32,30,17,47,28,29,30,29,17,45,27,28,29,28,17,42,26,27,28,27,18,33,18,26,27,26,18,52,24,25,33,25,19,50,23,24,25,24,19,55,13,23,24,23,13,35,22,0,35,0,21,55,21,13,21,20,13,21,0,20,33,19,14,24,13,19,33,14,18,15,17,18,28,18,17,32,17,16,32,16,6,17,15,16,16,15,7,18,14,15,15,14,9,19,12,14,20,11,13,19,13,12,14,12,10,13,11,12,12,11,10,14,10,9,15,9,8,15,8,7,16,7,6,32,6,5],"userEdges":[]}]},{"name":"D_MOUTH.02","display":[{"type":"mesh","name":"D_MOUTH.02","path":"shizuku_00","vertices":[-120.37,47.27,-113.44,-49.94,-105.36,-113.71,-58.04,-145.02,24.83,-151.81,74.6,-142.66,107.93,-103.24,126.29,-42.28,126.45,29.76,98.87,77.63,33.79,128.23,-43.27,119.99,-94.38,85.05,-90.63,25.4,-52.32,64.08,29.62,73.73,88.25,53.1,111.15,6.98,71.72,-65.81,21.7,-35.22,-55.92,-43.25,-80.28,-42.16,-101.53,-10.77,126.44,6.37,96.86,-20.59,110.82,-34.1,120.61,25.57,107.91,46.9,95.61,69.1,67.01,93.77,33.63,106.28,-7.48,113.09,121.47,48.78,-48.8,100.03,-77.55,83.06,-96.68,59.65,-109.28,41.36,-109.94,69.52,-114.39,29.83,-119.25,10.3,-23.01,-89.98,-83.92,61.01,-69.36,75.21,-73.75,43.06,-50.35,85.96,-32.69,95.22,13.71,98.26,33.46,95.78,52.29,88.68,75.12,78.01,58.28,67.28,90.81,59.89,99.92,47.13,108.11,24.83,102.12,29.27,116.51,16.42,-94.64,45.11,-101.42,33.82,-106.76,24.41,-96.18,6.99,72.94,103.42,-4.37,124.15,-73.42,105.2,14.06,120.99,12.84,109.73,-79.99,4.37,-53.48,29.54,-27.06,30.18,26.64,32.76,-14.78,68.5,64.26,21.26,82.05,8.51],"uvs":[0.722656,0.195313,0.707031,0.18457,0.707031,0.15918,0.728027,0.140137,0.765137,0.135742,0.80127,0.140625,0.810059,0.166992,0.804688,0.184082,0.791016,0.191895,0.780273,0.188151,0.763997,0.188151,0.747396,0.189128,0.734375,0.190755,0.729167,0.179362,0.744792,0.177083,0.764323,0.178385,0.780273,0.178711,0.792643,0.180013,0.787435,0.158203,0.76237,0.157552,0.733724,0.160482,0.718925,0.170024,0.717083,0.182205,0.798009,0.187898,0.790662,0.171715,0.799069,0.175209,0.791677,0.187069,0.785756,0.184544,0.780273,0.184326,0.771572,0.183758,0.764134,0.184065,0.754914,0.184357,0.786888,0.190456,0.746242,0.183789,0.738912,0.184801,0.732395,0.186424,0.72528,0.188885,0.729602,0.192612,0.720416,0.190045,0.71674,0.191245,0.748025,0.149219,0.734781,0.182495,0.741501,0.181402,0.735916,0.178378,0.745595,0.180798,0.750706,0.181333,0.759419,0.181498,0.764223,0.181386,0.768754,0.18167,0.775392,0.181542,0.771603,0.178534,0.780273,0.181274,0.783159,0.181782,0.788888,0.182484,0.786577,0.179374,0.792168,0.183479,0.731085,0.183559,0.726864,0.185005,0.722615,0.186713,0.723054,0.1808,0.771973,0.188151,0.755775,0.188635,0.74044,0.189997,0.759655,0.186337,0.75947,0.184212,0.730563,0.173577,0.74123,0.17174,0.750793,0.170416,0.763588,0.170551,0.753739,0.17768,0.773819,0.171083,0.782959,0.171021],"triangles":[70,71,18,68,50,70,71,70,16,69,68,67,69,15,68,70,19,68,69,67,14,68,19,67,67,66,14,67,20,66,66,65,43,66,20,65,64,63,30,64,31,63,63,31,61,63,61,10,59,58,57,59,22,58,58,36,57,59,57,13,57,35,56,57,56,13,56,35,41,55,53,26,54,52,53,55,17,53,54,53,17,54,16,52,53,52,27,49,28,51,52,51,28,52,16,51,70,50,16,68,15,50,50,48,49,51,16,49,50,49,16,50,15,48,49,48,29,48,47,30,48,15,47,47,46,30,64,30,46,64,46,31,47,15,46,69,45,15,46,15,45,46,45,31,69,14,45,45,44,33,45,14,44,44,42,33,66,43,14,65,13,43,43,41,42,44,14,42,43,42,14,43,13,41,56,41,13,42,41,34,62,11,34,58,38,36,39,0,38,58,22,38,39,38,22,37,35,36,57,36,35,38,0,36,37,36,0,41,35,34,37,12,35,42,34,33,35,12,34,62,34,12,45,33,31,34,11,33,60,9,29,33,11,31,61,31,11,48,30,29,63,10,30,49,29,28,30,10,29,60,29,10,52,28,27,29,9,28,32,26,27,53,27,26,28,9,27,32,27,9,55,26,23,32,8,26,25,6,24,71,16,24,54,24,16,54,17,24,25,24,17,71,24,18,55,23,17,26,8,23,59,21,22,39,22,1,65,20,21,22,21,1,59,13,21,65,21,13,40,19,4,40,3,20,21,20,2,67,19,20,40,20,19,70,18,19,4,19,18,24,6,18,25,17,7,23,7,17,25,7,6,18,6,5,18,5,4,40,4,3,20,3,2,21,2,1],"userEdges":[]}]},{"name":"D_NOSE.00","display":[{"type":"mesh","name":"D_NOSE.00","path":"shizuku_00","vertices":[-14.81,-73.47,114.81,-8.16,129.63,107.94,-37.04,133.33,-133.33,17.23,11.11,13.61],"uvs":[0.567057,0.132161,0.580404,0.13737,0.580078,0.152018,0.56543,0.154297,0.556966,0.14388,0.569661,0.143555],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_NOSE.01","display":[{"type":"mesh","name":"D_NOSE.01","path":"shizuku_00","vertices":[-41.21,-133.33,55.09,-42.63,47.68,117.01,-70.84,11.79,-6.83,-15.87,-58.59,-48.21,-30.86,47.28,52.16,20.5,14.48,-80.88,27.3,-30.62,18.87,46.77,-41.84,-0.74,-22.63,-69.86,-21.28,22.11,24.41,3.39],"uvs":[0.500651,0.125977,0.509115,0.134115,0.508464,0.148438,0.498047,0.138997,0.503673,0.136515,0.499124,0.133614,0.501561,0.142182,0.508857,0.139779,0.505546,0.130683,0.506672,0.135192,0.505931,0.142136,0.500595,0.137873,0.502284,0.131671,0.502402,0.139924,0.506418,0.138244],"triangles":[13,11,6,13,4,11,13,6,10,14,10,7,14,4,10,13,10,4,14,7,9,14,9,4,12,4,8,9,8,4,9,1,8,12,8,0,10,2,7,9,7,1,11,3,6,10,6,2,11,4,5,12,5,4,12,0,5,11,5,3],"userEdges":[]}]},{"name":"D_EAR.00","display":[{"type":"mesh","name":"D_EAR.00","path":"shizuku_00","vertices":[-45.78,-121.45,87.53,-147.7,142.76,-98.12,118,11.25,30.4,92.92,-150.53,145.41,-118.15,22.92,-76.26,-66.04,-0.08,1.04,47.54,-77.7,-72.56,122.79,-39.63,59.92],"uvs":[0.861979,0.01237,0.907552,0.000651,0.926432,0.022786,0.917969,0.071615,0.888021,0.108073,0.826172,0.13151,0.83724,0.076823,0.851563,0.037109,0.877604,0.067057,0.89388,0.031901,0.852827,0.12141,0.864083,0.093342],"triangles":[11,6,10,11,10,4,9,8,3,9,7,8,11,8,6,11,4,8,9,0,7,8,7,6,10,6,5,8,4,3,9,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_EAR.01","display":[{"type":"mesh","name":"D_EAR.01","path":"shizuku_00","vertices":[-107.28,-141.95,71.02,-124.7,150.27,35.22,126.06,141.83,4.99,116.74,-107.28,25.81,-153.51,-79.24,-30.23,-61.99,40.21,30.51],"uvs":[0.729167,0.010417,0.781901,0.017578,0.805339,0.083984,0.798177,0.128255,0.76237,0.117839,0.729167,0.080078,0.715495,0.036458,0.751953,0.04362,0.772786,0.082031],"triangles":[8,1,7,8,7,5,7,0,6,7,6,5,8,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_HAIR_FRONT.00","display":[{"type":"mesh","name":"D_HAIR_FRONT.00","path":"shizuku_02","vertices":[5.72,-163.71,93.5,-148.25,157.86,-82.19,173.08,10.57,170.73,110.37,147.33,156.75,116.9,115.99,85.3,65.39,73.6,87.88,43.17,68.2,20.35,97.01,-19.44,75.23,-73.86,85.07,-101.94,108.96,-132.37,151.13,-159.29,112.83,-166.31,10.57,-148.75,-87.81,-85.56,-144.03,-134.71,96.31,-104.28,55.55,-60.98,33.06,-9.78,20.41,32.06,31.66,4.74,55.3,71.26,14.79,141.48,93.5,116.9,49.93,172.51,62.69,108.71,-18.94,-161,61.61,-130.03,37.28,-94.92,-3.48,-132.37,-30.19,59.56,-59.7,19.48,-38.27,-44.6,-37.21,-96.09,-72.35,-34.07,-86.41,30.3,-93.44,85.3,-97.65],"uvs":[0.264323,0.643229,0.358073,0.653646,0.429688,0.708333,0.46224,0.800781,0.463542,0.891927,0.432292,0.940104,0.408854,0.89974,0.373698,0.852865,0.360677,0.873698,0.326823,0.855469,0.313802,0.878906,0.263021,0.861979,0.196615,0.871094,0.165365,0.893229,0.13151,0.932292,0.105469,0.895833,0.09375,0.802083,0.113281,0.710938,0.183594,0.658854,0.132813,0.88151,0.16276,0.84375,0.210938,0.822917,0.266927,0.811198,0.3125,0.821615,0.287647,0.841889,0.358073,0.80599,0.436198,0.878906,0.408854,0.838542,0.462911,0.847758,0.39974,0.77474,0.099659,0.849359,0.134115,0.826823,0.173177,0.789063,0.13151,0.764323,0.345052,0.736979,0.295573,0.757813,0.229167,0.757813,0.174479,0.723958,0.240885,0.708333,0.311198,0.703125,0.360677,0.695313],"triangles":[1,39,40,40,39,34,0,38,39,39,38,35,38,18,37,38,37,36,37,32,36,38,36,35,36,22,35,39,35,34,40,34,2,35,25,34,34,29,2,37,17,33,37,33,32,33,31,32,36,32,21,33,16,31,32,31,20,31,30,19,31,16,30,34,25,29,29,25,27,29,27,3,27,28,3,28,27,26,28,26,4,27,6,26,35,23,25,27,25,7,25,9,7,25,23,9,24,9,23,35,22,23,24,23,22,24,22,11,36,21,22,22,21,11,32,20,21,21,20,12,31,19,20,20,19,13,30,15,19,38,0,18,37,18,17,33,17,16,19,15,14,19,14,13,20,13,12,21,12,11,24,11,10,24,10,9,9,8,7,27,7,6,26,6,5,26,5,4,29,3,2,40,2,1,39,1,0],"userEdges":[]}]},{"name":"D_HAIR_SIDE.00","display":[{"type":"mesh","name":"D_HAIR_SIDE.00","path":"shizuku_02","vertices":[14.66,-166.1,-0.3,-107.56,14.12,-35.76,37.55,37.41,52.87,103.96,160.36,159.52,26.95,160.44,-74.57,126.59,-98.26,47.02,-124.8,-17.92,-141.37,-86.75,-69.41,-148.26,62.04,139.4,-14.55,100.07,-42.87,4.49,-79.21,-51.77,-80.27,-95.21,-29.78,43.75,-92.78,94.74,-118.58,12.48,27.28,0.33,-131.57,-49.92,1.55,-62.73,-112.54,-71.95,-40.18,-80.35,-31.39,-130.32,-65.55,-26.01,-62.81,69.05,6.27,65.77,14.05,116.08,87.9,130.22,76.8,159.25,95.73,149.29,54.24,124.28,7.47,135.15,-25.88,142.82,-35.94,109.52,44.4,67.2,26.13,82.05,16.67,101.87,-23.19,68.11,-95.46,71.45,-44.67,80.71,-0.35,76.68,-46.86,97.87,-25.5,120.77,47.06,148.38,119.05,142.82,73.78,135.23,113.03,159.37,40.36,128.87,69.48,116.41,18.43,149.38,-30.06,131.24,6.1,40.37,-2.88,20.86,-17.87,-13.17,-10.88,2.59,-67.2,45.53,-71.85,26.74,-82.77,8.7,-88.45,-7.98],"uvs":[0.06901,0.528646,0.063802,0.605469,0.065104,0.709635,0.079427,0.8125,0.092448,0.904948,0.140625,0.989583,0.065104,0.984375,0.033854,0.94401,0.02474,0.828125,0.007813,0.733073,0.001302,0.634115,0.027344,0.55599,0.085938,0.951823,0.057292,0.898438,0.044271,0.765625,0.028646,0.684896,0.027575,0.622073,0.052427,0.820214,0.029853,0.893134,0.015694,0.777331,0.071986,0.759063,0.004901,0.688822,0.0646,0.669293,0.013699,0.657137,0.046655,0.64421,0.044002,0.578597,0.035743,0.721566,0.038809,0.858516,0.069357,0.851597,0.06955,0.921283,0.113259,0.941509,0.095558,0.986475,0.108201,0.967195,0.089156,0.928652,0.063621,0.948475,0.048841,0.963369,0.04894,0.914678,0.085256,0.853887,0.079199,0.874338,0.07357,0.901452,0.054531,0.854044,0.027357,0.861404,0.045756,0.87352,0.065518,0.8665,0.045961,0.896248,0.05362,0.931426,0.077046,0.965716,0.125025,0.962178,0.098346,0.947139,0.115098,0.987823,0.078536,0.93803,0.102314,0.922281,0.064455,0.968669,0.050003,0.946433,0.066815,0.816103,0.061753,0.788935,0.053411,0.74106,0.056913,0.762632,0.037296,0.824537,0.034051,0.798328,0.029211,0.771794,0.023987,0.747514],"triangles":[61,60,14,61,19,60,60,19,59,60,59,14,59,58,17,59,8,58,57,20,56,57,56,14,57,55,20,57,14,55,55,17,54,55,54,3,52,46,34,52,6,46,53,34,45,53,45,7,44,42,18,44,13,42,42,40,27,43,28,40,42,13,40,43,40,13,39,38,13,43,13,38,39,4,38,43,38,28,38,37,28,45,29,36,44,18,36,45,36,7,44,36,13,52,34,35,53,35,34,53,7,35,52,35,6,50,29,34,45,34,29,46,12,34,50,34,12,51,33,30,48,30,33,50,33,29,51,4,33,50,12,33,48,33,12,48,32,30,47,30,32,49,32,31,49,5,32,47,32,5,48,12,32,32,12,31,46,31,12,46,6,31,39,29,4,33,4,29,39,13,29,36,29,13,54,17,28,40,28,17,37,3,28,54,28,3,58,27,17,40,17,27,41,18,27,42,27,18,58,8,27,41,27,8,56,2,26,61,26,9,61,14,26,56,26,14,24,15,22,24,22,1,23,21,15,23,10,21,55,3,20,56,20,2,61,9,19,59,19,8,36,18,7,55,14,17,59,17,14,24,16,15,23,15,16,25,11,16,24,1,16,25,16,1,23,16,10,26,15,9,21,9,15,22,15,2,26,2,15,25,0,11,16,11,10,25,1,0],"userEdges":[]}]},{"name":"D_HAIR_SIDE.01","display":[{"type":"mesh","name":"D_HAIR_SIDE.01","path":"shizuku_02","vertices":[-88.85,-172.54,24.54,-151.6,114.06,-105.18,126,-36.92,115.57,34.08,14.88,150.82,-127.6,158.78,-50.03,108.95,-50.04,-49.66,-85.86,-128.85,12.61,-99.72,-16.14,138.66,16.46,72.81,38.82,-2.96,48.69,-43.67,37.23,32.32,16.04,109.36,-37.53,154.39,-69.66,-93.02,-2.38,-24.61,115.36,-0.62,85.89,-19.83,62.01,-70.84,116.62,-72.68,-21.28,-72.64,27.06,-71.69,-59.93,-71.52,1.98,14.31,80.28,16.05,-12.26,51.66,118.25,71.03,72.56,52.84,-14.42,89.14,59.12,90.94,-30.63,-140.23,30.7,-127.41,-47.16,-117.4,-81.12,128.93,-35.23,121.92,51.42,128.27,57.33,137.6,-67.68,147.96,67.97,113.27,120.34,94.95,69.44,128.03,-28.31,147.61,-2.22,144.11,29.95,137.99,36.47,144.09,-11.49,152.61,68.46,71.9,75.26,33.17,76.78,-1.8,87.19,-40.31,-20.57,109.13,-14.28,70.64,-0.87,31.29,-9.09,-4.76,-10.32,-47.25,-151.88,145.67],"uvs":[0.450521,0.516927,0.5,0.546875,0.533854,0.613281,0.541667,0.710938,0.533854,0.8125,0.498698,0.980469,0.433594,0.990885,0.463542,0.916667,0.467448,0.692708,0.451823,0.579427,0.494792,0.621094,0.484188,0.955256,0.496464,0.867893,0.506226,0.759505,0.507606,0.702572,0.503574,0.809977,0.494327,0.921156,0.4729,0.984596,0.458891,0.63067,0.488247,0.728536,0.537672,0.762864,0.523837,0.735371,0.516349,0.662411,0.537574,0.659781,0.480003,0.659825,0.501097,0.661183,0.463133,0.661425,0.488195,0.784214,0.520408,0.786708,0.483931,0.837646,0.530142,0.866325,0.515084,0.840308,0.48201,0.889306,0.509219,0.892857,0.475924,0.563143,0.49748,0.58278,0.468711,0.595804,0.451536,0.946419,0.472554,0.933511,0.504615,0.94087,0.509505,0.958854,0.460794,0.97173,0.509826,0.923416,0.528025,0.89702,0.515625,0.940918,0.477766,0.971949,0.490698,0.966568,0.500069,0.957513,0.504196,0.969473,0.485717,0.982546,0.513667,0.867092,0.518275,0.811202,0.521822,0.761171,0.524565,0.706737,0.477267,0.918668,0.483049,0.864789,0.485875,0.808502,0.485317,0.756928,0.483606,0.696677,0.42,0.9745],"triangles":[48,47,46,48,40,47,49,46,45,49,5,46,48,46,5,47,11,46,49,45,17,46,11,45,44,43,42,43,33,42,44,42,39,45,41,17,45,11,41,44,39,40,47,40,39,42,16,39,47,39,11,54,38,16,54,7,38,41,11,37,38,37,11,38,7,37,59,6,37,41,37,6,35,34,10,36,10,34,35,1,34,36,34,9,50,33,30,43,30,33,42,33,16,50,12,33,54,16,32,55,32,12,55,7,32,54,32,7,51,15,31,50,30,31,50,31,12,51,31,4,31,30,4,56,29,15,55,12,29,52,28,20,51,28,15,51,4,28,52,13,28,56,15,27,57,27,13,25,24,14,58,14,24,26,24,18,26,8,24,58,24,8,25,10,24,53,22,14,25,14,22,23,2,22,53,3,22,23,22,3,25,22,10,53,14,21,52,20,21,52,21,13,53,21,3,28,4,20,21,20,3,58,19,14,57,13,19,58,8,19,24,10,18,36,18,10,36,9,18,41,6,17,39,16,11,38,11,16,33,12,16,32,16,12,31,15,12,29,12,15,28,13,15,27,15,13,21,14,13,19,13,14,35,10,2,22,2,10,34,0,9,35,2,1,34,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.03","display":[{"type":"mesh","name":"D_HAIR_TWIN.03","path":"shizuku_01","vertices":[-72.51,-133.33,109.94,-123.95,133.33,-32.83,119.3,62.31,95.91,133.33,-39.77,114.57,-133.33,38.19,-109.94,-40.87,-87.88,75.29,7.87,51.67,22.92,93.98,-0.58,2.84,125.28,21.74,11.77,-36.85,23.91,-86.25],"uvs":[0.670573,0.430339,0.695964,0.434896,0.699219,0.479167,0.697266,0.525391,0.69401,0.559896,0.67513,0.550781,0.662109,0.513672,0.665365,0.47526,0.668434,0.531698,0.681759,0.520222,0.683853,0.540776,0.680583,0.496495,0.698098,0.50568,0.682302,0.477215,0.683992,0.453212],"triangles":[14,7,13,14,13,2,13,7,11,12,11,9,12,2,11,13,11,2,10,9,8,10,3,9,12,9,3,11,6,9,9,6,8,10,8,5,14,0,7,11,7,6,10,5,4,10,4,3,14,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.02","display":[{"type":"mesh","name":"D_HAIR_TWIN.02","path":"shizuku_02","vertices":[-59.3,-145.66,-17.56,-98.97,3.31,-41.82,-6.18,14.52,-36.53,58.79,3.31,98.23,86.78,110.3,158.88,118.35,88.68,137.67,-4.28,136.86,-93.45,120.76,-125.7,75.69,-108.63,17.74,-78.27,-34.58,-72.58,-86.09,-44.65,-70.25,-50.25,-13.32,-62.28,43.23,-62.1,86.63],"uvs":[0.764334,0.530345,0.785922,0.586946,0.796791,0.656263,0.792033,0.724631,0.776507,0.77837,0.797102,0.826184,0.840098,0.840754,0.877225,0.850452,0.841135,0.873955,0.793282,0.873066,0.747348,0.853619,0.730646,0.798962,0.739306,0.728634,0.754815,0.665129,0.75763,0.602623,0.772044,0.621825,0.769284,0.690893,0.76322,0.759519,0.763406,0.812177],"triangles":[18,10,5,17,11,4,18,4,11,16,12,3,17,3,12,15,13,2,16,2,13,15,1,14,15,14,13,16,13,12,17,12,11,18,11,10,5,10,9,6,9,8,8,7,6,9,6,5,18,5,4,17,4,3,16,3,2,15,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.11","display":[{"type":"mesh","name":"D_HAIR_TWIN.11","path":"shizuku_02","vertices":[-88.89,-154.22,25.4,-141.66,50.79,-93.67,60.32,-39.02,38.1,23,9.52,73.96,15.87,112.35,133.33,141.15,-19.05,138.2,-130.16,112.35,-133.33,60.66,-98.41,3.07,-82.54,-53.05,-88.89,-112.86,-24.5,-129.09,-17.53,-72.85,-17.87,-18.29,-42.45,40.7,-51.05,90.61],"uvs":[0.693359,0.5,0.728516,0.516602,0.736328,0.580078,0.739258,0.652344,0.732422,0.734375,0.723633,0.801758,0.725586,0.852539,0.761719,0.890625,0.714844,0.886719,0.680664,0.852539,0.679688,0.78418,0.69043,0.708008,0.695313,0.633789,0.693359,0.554688,0.713165,0.533231,0.715311,0.607601,0.715205,0.679764,0.707646,0.757774,0.705001,0.823778],"triangles":[18,9,6,17,10,5,18,5,10,16,11,4,17,4,11,15,12,3,16,3,12,14,13,2,15,2,13,14,0,13,15,13,12,16,12,11,17,11,10,18,10,9,6,9,8,8,7,6,18,6,5,17,5,4,16,4,3,15,3,2,14,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.12","display":[{"type":"mesh","name":"D_HAIR_TWIN.12","path":"shizuku_02","vertices":[-119.52,-153.4,-54.92,-145.2,-28.13,-107.57,-21.83,-68.59,-17.1,-23.44,-10.8,14.18,11.26,58.64,56.96,94.89,112.11,100.37,164.1,99,131.01,120.89,64.84,128.41,15.99,116.78,-23.4,102.42,-69.1,74.37,-95.89,25.12,-116.37,-34.39,-121.1,-88.42,-124.25,-131.52,-39,43.3,-6.07,80.53,-53.02,-1.3,-68.63,-51.65,-76.67,-97.57],"uvs":[0.604492,0.581055,0.644531,0.592773,0.661133,0.646484,0.665039,0.702148,0.667969,0.766602,0.671875,0.820313,0.685547,0.883789,0.713867,0.935547,0.748047,0.943359,0.780273,0.941406,0.759766,0.972656,0.71875,0.983398,0.688477,0.966797,0.664063,0.946289,0.635742,0.90625,0.619141,0.835938,0.606445,0.750977,0.603516,0.673828,0.601563,0.612305,0.654397,0.861881,0.674805,0.915039,0.645708,0.798212,0.63603,0.726322,0.631048,0.660762],"triangles":[23,2,18,22,3,17,23,17,3,21,4,16,22,16,4,19,5,15,21,15,5,20,6,14,19,14,6,20,13,7,23,18,17,22,17,16,21,16,15,19,15,14,20,14,13,7,13,12,7,12,11,7,11,10,10,9,8,10,8,7,20,7,6,19,6,5,21,5,4,22,4,3,23,3,2,18,2,1,18,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.13","display":[{"type":"mesh","name":"D_HAIR_TWIN.13","path":"shizuku_02","vertices":[-45.94,-146.74,18.33,-124.64,64.74,-80.45,104.02,-29.35,132.58,21.75,141.51,72.16,121.87,112.21,59.39,134.99,-44.16,139.83,-42.37,117.73,32.61,91.49,59.39,47.3,34.39,-6.56,-1.31,-56.28,-40.59,-99.79,-104.86,135.46,-141.75,114.28],"uvs":[0.893555,0.585938,0.928711,0.617188,0.954102,0.679688,0.975586,0.751953,0.991211,0.824219,0.996094,0.895508,0.985352,0.952148,0.951172,0.984375,0.894531,0.991211,0.895508,0.959961,0.936523,0.922852,0.951172,0.860352,0.9375,0.78418,0.917969,0.713867,0.896484,0.652344,0.861328,0.985026,0.841146,0.955078],"triangles":[9,16,15,2,14,13,3,13,12,4,12,11,5,11,10,7,10,9,15,8,9,9,8,7,10,7,6,10,6,5,11,5,4,12,4,3,13,3,2,14,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.14","display":[{"type":"mesh","name":"D_HAIR_TWIN.14","path":"shizuku_02","vertices":[-133.33,-154.13,-62.37,-151.56,-8.6,-112.09,43.01,-59.76,83.87,-6.56,129.03,56.07,133.33,101.54,90.32,136.71,2.15,138.43,-68.82,112.69,-62.37,90.39,10.75,101.54,55.91,89.53,51.61,50.92,-6.45,-9.14,-58.06,-61.47,-116.13,-118.1,53.76,116.98,-32.31,112.77],"uvs":[0.773438,0.507813,0.816406,0.511719,0.848958,0.571615,0.880208,0.651042,0.904948,0.731771,0.932292,0.826823,0.934896,0.895833,0.908854,0.949219,0.855469,0.951823,0.8125,0.91276,0.816406,0.878906,0.860677,0.895833,0.888021,0.877604,0.885417,0.81901,0.85026,0.727865,0.81901,0.648438,0.783854,0.5625,0.886719,0.919271,0.834602,0.912871],"triangles":[18,8,11,11,8,17,17,6,12,2,16,15,3,15,14,4,14,13,5,13,12,17,12,11,18,11,10,18,10,9,18,9,8,17,8,7,17,7,6,12,6,5,13,5,4,14,4,3,15,3,2,16,2,1,16,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.15","display":[{"type":"mesh","name":"D_HAIR_TWIN.15","path":"shizuku_02","vertices":[-124.49,-153.6,-30.3,-154.72,16.53,-130.3,29.75,-92.4,36.36,-41.88,29.75,19.59,20.94,79.38,25.34,118.11,62.81,147.59,133.33,148.43,73.83,168.64,-20.94,166.11,-78.24,140.01,-95.87,95.38,-82.64,33.06,-65.01,-34.3,-76.03,-92.4,-133.33,-126.09,-58.4,-132.82,-16.83,-63.85,-23.63,-4.1,-30.32,56.46,-36.52,106.51,-20.41,-115.18,-18.73,-92.4,-17.12,-37.88,-24.3,26.07,-36.54,87.25,-0.51,144.92,-23.38,128.41,25.89,155.75],"uvs":[0.507826,0.49913,0.563478,0.497391,0.591146,0.535156,0.598958,0.59375,0.602865,0.671875,0.598958,0.766927,0.59375,0.859375,0.596354,0.919271,0.61849,0.964844,0.660156,0.966146,0.625,0.997396,0.56901,0.99349,0.535156,0.953125,0.52474,0.884115,0.532552,0.78776,0.542969,0.683594,0.536458,0.59375,0.502604,0.541667,0.546875,0.53125,0.571438,0.637911,0.56742,0.730294,0.563467,0.823937,0.559803,0.901327,0.569323,0.558538,0.570313,0.59375,0.571267,0.678057,0.567022,0.776946,0.559789,0.87155,0.581082,0.960725,0.567569,0.935195,0.596676,0.977473],"triangles":[30,8,28,29,12,28,30,28,11,29,28,7,24,3,23,24,23,16,29,22,12,27,22,6,29,7,22,27,13,22,26,21,5,27,21,13,27,6,21,26,14,21,26,5,20,25,15,20,26,20,14,25,20,4,25,4,19,24,16,19,25,19,15,24,19,3,30,10,8,23,2,18,23,18,16,18,0,17,18,17,16,19,16,15,20,15,14,21,14,13,22,13,12,28,12,11,30,11,10,10,9,8,28,8,7,22,7,6,21,6,5,20,5,4,19,4,3,23,3,2,18,2,1,18,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.01","display":[{"type":"mesh","name":"D_HAIR_TWIN.01","path":"shizuku_01","vertices":[-68.28,-112.72,151.09,-135.68,118.18,-37.6,90.76,64.66,30.44,135.61,-128.6,91.79,-95.7,-6.29,-34.55,80.16,-111.86,41.87,-4.55,28.39,19.94,-23.22,105.21,10.79,-83.25,-54.61,26.82,-74.41,60.42,-126.19,135.09,-87.99],"uvs":[0.616211,0.441406,0.655273,0.430664,0.649414,0.476563,0.644531,0.524414,0.633789,0.557617,0.605469,0.537109,0.611328,0.491211,0.622217,0.531666,0.608451,0.513749,0.627559,0.507441,0.63192,0.483291,0.647104,0.499204,0.613545,0.468602,0.633144,0.459336,0.639129,0.435104,0.652425,0.45298],"triangles":[15,14,13,15,1,14,15,13,2,14,0,13,13,12,10,13,0,12,11,10,9,12,6,10,11,2,10,13,10,2,11,9,3,10,6,9,9,8,7,9,6,8,8,5,7,9,7,3,7,5,4,7,4,3],"userEdges":[]}]},{"name":"D_HAIR_TWIN.00","display":[{"type":"mesh","name":"D_HAIR_TWIN.00","path":"shizuku_02","vertices":[88.14,-141.13,92.66,-103.68,79.1,-62.57,106.21,-11.42,133.33,39.73,119.77,97.28,61.02,135.64,-133.33,166.7,-88.14,126.51,-51.98,70.79,-51.98,15.07,-106.21,-53.44,-47.46,-120.12,-74.99,-88.88,9.8,106.25,39.4,55.47,-74.65,-13.57,-3.46,-33.11,-25.38,130.35,33.79,84.02,54.23,29.2],"uvs":[0.71875,0.059896,0.720052,0.113281,0.716146,0.171875,0.723958,0.244792,0.731771,0.317708,0.727865,0.39974,0.710938,0.454427,0.654948,0.498698,0.667969,0.441406,0.678385,0.361979,0.678385,0.282552,0.66276,0.184896,0.679688,0.089844,0.671757,0.134379,0.696184,0.412527,0.704711,0.340148,0.671853,0.241722,0.692362,0.213867,0.686047,0.446885,0.703093,0.380835,0.708982,0.302701],"triangles":[17,16,3,17,11,16,20,10,15,19,5,15,20,15,4,19,15,9,19,14,5,18,14,8,19,9,14,18,6,14,1,12,13,13,11,2,17,2,11,16,10,3,20,3,10,15,10,9,14,9,8,18,8,7,18,7,6,14,6,5,15,5,4,20,4,3,17,3,2,13,2,1,12,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.04","display":[{"type":"mesh","name":"D_HAIR_TWIN.04","path":"shizuku_02","vertices":[11.17,-118.92,10.14,-102.21,44.63,-71.54,18.34,-24.57,53.67,18.4,133.33,59.41,126.99,109.42,64.34,145.39,-32.92,157.24,-100.43,152.93,-133.33,130.1,-64.73,130.67,0.36,114.84,16.92,72.62,-17.99,35.31,-76.24,-7.63,-88.51,-58.14,-23.91,-107.86,-13.7,-130.54,70.8,90.64,50.2,46.17,-5.5,6.54,-16.18,135.91,-31.64,-40.27,-54.76,-84.12,71.49,66.43,62.88,112.17,26.02,127.09,-83.12,142.14],"uvs":[0.621094,0.008789,0.625,0.064453,0.607422,0.130859,0.601563,0.205078,0.624023,0.270508,0.666992,0.331055,0.670898,0.40918,0.646484,0.467773,0.602539,0.490234,0.570313,0.486328,0.551758,0.452148,0.583984,0.450195,0.612305,0.422852,0.614258,0.356445,0.592773,0.299805,0.55957,0.235352,0.546875,0.157227,0.570313,0.077148,0.597656,0.030273,0.641983,0.382258,0.626216,0.313886,0.594671,0.254497,0.607451,0.456342,0.575982,0.182695,0.55912,0.115388,0.638981,0.344542,0.641231,0.416102,0.626013,0.440869,0.576943,0.468804],"triangles":[27,7,26,27,26,12,27,22,7,27,12,22,25,20,13,25,5,20,25,19,5,26,19,12,25,13,19,26,6,19,24,2,17,24,16,2,23,2,16,23,15,3,21,3,15,21,14,4,20,4,14,22,11,8,28,8,11,1,18,17,23,16,15,21,15,14,20,14,13,19,13,12,22,12,11,28,11,10,28,10,9,28,9,8,22,8,7,26,7,6,19,6,5,20,5,4,21,4,3,23,3,2,17,2,1,18,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.05","display":[{"type":"mesh","name":"D_HAIR_TWIN.05","path":"shizuku_02","vertices":[113.58,-163.03,108.64,-92.92,54.32,-17.53,24.69,51.25,34.57,100.19,133.33,125.32,29.63,134.58,-74.07,121.35,-133.33,73.74,-118.52,-5.63,-64.2,-78.37,4.94,-140.54,-7.6,-49.32,48.88,-120.36,-47.9,22.42],"uvs":[0.81913,0.10087,0.817391,0.193043,0.798261,0.292174,0.787826,0.382609,0.791304,0.446957,0.826087,0.48,0.789565,0.492174,0.753043,0.474783,0.732174,0.412174,0.737391,0.307826,0.756522,0.212174,0.78087,0.130435,0.776455,0.250379,0.796346,0.156966,0.762261,0.344702],"triangles":[13,10,1,12,1,10,12,9,2,14,2,9,14,8,3,13,0,11,13,11,10,12,10,9,14,9,8,4,8,7,4,7,6,6,5,4,8,4,3,14,3,2,12,2,1,13,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.06","display":[{"type":"mesh","name":"D_HAIR_TWIN.06","path":"shizuku_02","vertices":[25.83,-125.3,21,-87.97,20.41,-29.4,22.03,30.47,41.46,88.41,130.07,124.53,85.42,140.59,-14.7,143.08,-105.73,126.27,-134.34,95.34,-109.41,50.31,-79.94,-4.38,-54.94,-57.14,-50.12,-93.83,-34.29,-118.92,23.34,120.58,-43.2,101.86,-42.88,69.67],"uvs":[0.955078,0.099609,0.953125,0.15625,0.953125,0.245117,0.954102,0.335938,0.962891,0.423828,1.001953,0.478516,0.982422,0.50293,0.938477,0.506836,0.898438,0.481445,0.885742,0.43457,0.896484,0.366211,0.90918,0.283203,0.919922,0.203125,0.921875,0.147461,0.928711,0.109375,0.955078,0.472656,0.925781,0.444336,0.925781,0.395508],"triangles":[3,10,17,17,16,4,17,9,16,16,8,15,16,15,4,1,14,13,1,13,12,2,12,11,3,11,10,17,10,9,16,9,8,15,8,7,15,7,6,15,6,5,15,5,4,17,4,3,11,3,2,12,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.07","display":[{"type":"mesh","name":"D_HAIR_TWIN.07","path":"shizuku_02","vertices":[90.91,-142.99,127.41,-88.66,130.45,7.14,90.91,97.22,-6.41,138.69,-109.82,138.69,-143.28,111.52,-58.12,110.09,-0.33,72.92,30.08,-0.01,51.37,-87.23,86.58,-45.22,58.78,43.19,5.83,104.57,90.38,-87.96,82.67,3.74,36.37,82.69,-33.94,123.46,-76.6,120.31],"uvs":[0.652174,0.026087,0.718261,0.005217,0.834783,0.003478,0.944348,0.026087,0.994783,0.081739,0.994783,0.14087,0.961739,0.16,0.96,0.111304,0.914783,0.078261,0.826087,0.06087,0.72,0.048696,0.771096,0.028567,0.878626,0.044463,0.953284,0.074738,0.719108,0.026392,0.830643,0.030803,0.926674,0.057277,0.976265,0.097479,0.972434,0.121873],"triangles":[18,5,17,18,17,7,17,4,13,16,8,13,17,13,7,16,13,3,16,3,12,15,9,12,16,12,8,15,12,2,15,11,9,14,11,1,15,2,11,14,10,11,14,0,10,11,10,9,12,9,8,13,8,7,18,7,6,18,6,5,17,5,4,13,4,3,12,3,2,11,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.08","display":[{"type":"mesh","name":"D_HAIR_TWIN.08","path":"shizuku_02","vertices":[41.06,-154.1,35.32,-113.1,49.54,-63.58,73.92,-8.85,118.61,41.53,138.93,83.23,120.64,121.45,65.79,127.53,-7.34,152.73,-90.63,157.94,-137.35,130.14,-64.22,129.27,-3.28,101.47,21.1,53.69,0.79,-0.17,-27.65,-50.55,-58.12,-100.94,-37.81,-155.66,73.92,91.92,51.57,23.29,-2.7,-135.23,-1.26,-81.21,23.3,-29.63,-5.34,127.47,-4.85,-107.87,12.68,-57.36,41.33,-4.98,65.1,48.21],"uvs":[0.539063,0.016927,0.533854,0.088542,0.542969,0.16276,0.558594,0.244792,0.58724,0.320313,0.60026,0.382813,0.588542,0.440104,0.553385,0.449219,0.50651,0.486979,0.453125,0.494792,0.423177,0.453125,0.470052,0.451823,0.509115,0.410156,0.52474,0.338542,0.511719,0.257813,0.49349,0.182292,0.473958,0.106771,0.486979,0.02474,0.558594,0.395833,0.544271,0.292969,0.509485,0.055372,0.510404,0.13634,0.52615,0.213646,0.507793,0.44913,0.508103,0.096379,0.519341,0.172087,0.537708,0.250593,0.55294,0.330317],"triangles":[26,22,14,25,22,2,25,15,22,26,3,22,25,21,15,24,21,1,24,16,21,25,2,21,24,20,16,24,1,20,26,14,19,26,19,3,27,4,19,27,19,13,27,18,4,27,13,18,18,12,7,23,7,12,23,11,8,20,0,17,20,17,16,21,16,15,22,15,14,19,14,13,18,13,12,23,12,11,11,10,9,11,9,8,23,8,7,18,7,6,18,6,5,18,5,4,19,4,3,22,3,2,21,2,1,20,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.09","display":[{"type":"mesh","name":"D_HAIR_TWIN.09","path":"shizuku_02","vertices":[112.48,-152.51,133.33,-137.63,118.63,-94.27,78.74,-47.42,43.04,-3.36,19.95,44.2,13.65,87.56,45.14,114.13,97.64,139.31,17.85,142.11,-55.64,128.12,-133.33,96.65,-122.83,45.6,-80.84,-1.96,-38.85,-46.02,3.15,-95.67,45.14,-147.42,-53.24,66.99,-26.45,22.95,3.3,-24.06,42.72,-70.41,83.36,-119.78,-19.06,106.71,98.69,-141.48,63.89,-94.94,20.32,-46.72,-15.75,-2.69,-42.81,44.81,-45.21,91.2,-0.48,120.47,30.78,128.86],"uvs":[0.90918,0.080078,0.919922,0.112305,0.913086,0.172852,0.894531,0.238281,0.87793,0.299805,0.867188,0.366211,0.864258,0.426758,0.878906,0.463867,0.90332,0.499023,0.866211,0.50293,0.832031,0.483398,0.795898,0.439453,0.800781,0.368164,0.820313,0.301758,0.839844,0.240234,0.859375,0.170898,0.878906,0.098633,0.833148,0.398041,0.845608,0.336539,0.859446,0.270895,0.87778,0.206175,0.896682,0.137232,0.849046,0.453495,0.903809,0.106934,0.887622,0.171926,0.867362,0.239252,0.850584,0.300732,0.838002,0.367069,0.836882,0.431842,0.857688,0.472708,0.872225,0.484425],"triangles":[30,29,9,30,7,29,29,7,22,28,11,22,28,22,6,29,22,10,23,21,1,24,21,15,23,16,21,24,2,21,24,20,2,25,20,14,24,15,20,25,3,20,25,19,3,26,19,13,25,14,19,26,4,19,26,18,4,27,18,12,26,13,18,27,5,18,27,17,5,28,17,11,27,12,17,28,6,17,23,0,16,21,16,15,20,15,14,19,14,13,18,13,12,17,12,11,22,11,10,29,10,9,30,9,8,30,8,7,22,7,6,17,6,5,18,5,4,19,4,3,20,3,2,21,2,1,23,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.10","display":[{"type":"mesh","name":"D_HAIR_TWIN.10","path":"shizuku_02","vertices":[25.62,-150.51,134.82,-147.54,115.68,-131.8,43.21,-114.96,-6.12,-91.83,-47.49,-85.33,-41.84,-114.29,-7.95,-138.86,64.59,-137,15.2,-128.12,-16.27,-102.62],"uvs":[0.038574,0.466797,0.086426,0.471191,0.078125,0.495117,0.045898,0.521484,0.024902,0.556152,0.004883,0.565918,0.010742,0.522461,0.023438,0.484863,0.055664,0.487305,0.033541,0.501336,0.01879,0.54161],"triangles":[10,3,6,9,6,3,9,8,7,9,3,8,8,0,7,9,7,6,10,6,5,10,5,4,10,4,3,8,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_HAIR_BACK.00","display":[{"type":"mesh","name":"D_HAIR_BACK.00","path":"shizuku_02","vertices":[-6.8,-166.63,54.47,-165.66,126.13,-136.27,154.57,-67.37,152.79,22.85,118.35,85.24,64.19,120.29,48.73,139.82,7.42,150.42,-48.93,141.75,-70.25,118.62,-122.49,87.06,-154.5,21.29,-161.6,-63.63,-132.06,-134.34,-76.82,-164.7,-2.42,107.06,47.9,57.91,94.95,12.62,-61.5,64.65,-107.45,10.69,-103.08,-55.8,-4.61,35.74,-51.66,-6.66,35.87,-5.69,69.78,-72.19,-2.42,-73.15,-58.22,-77,-115.11,-96.28,101.51,-103.99,34.77,-118.44,-45.09,-124.22,124.08,-25.31,-130.13,-15.24,-100.03,-130.61,-132.33,-59.72,-130.44,15.87,-116.54,56.86,-141.15,48.71,-96.06,77.35,-61.57,-145.25,-32.51,-138.15,-3.38,-121.2,20.02,-135.54,74.25,-139.73,96.18,-148.56,114.87,-121.51,135.97,-112.44,43.64,-139.7,-147.73,-42.31,-143.26,4.44,-157.9,-19.39,-143.42,18.79,-147.77,35.11,-138.13,39.46,-130.37,52.28,-133.49,64.44,-119.67,72.72,79.91,70.33,105.8,46.3,121.53,17.32,72.4,34.33,34.08,114.31,56.68,91.52],"uvs":[0.238261,0.001739,0.335652,0.003478,0.452174,0.053913,0.492174,0.18087,0.493913,0.333913,0.452174,0.44,0.368696,0.507826,0.330435,0.554783,0.26087,0.573913,0.163478,0.558261,0.137391,0.516522,0.06087,0.455652,0.003478,0.34087,0,0.189565,0.041739,0.062609,0.126957,0.005217,0.245217,0.495652,0.325217,0.406957,0.4,0.325217,0.151304,0.41913,0.078261,0.321739,0.085217,0.201739,0.241739,0.366957,0.166957,0.290435,0.306087,0.292174,0.36,0.172174,0.245217,0.170435,0.156522,0.163478,0.066087,0.128696,0.410435,0.114783,0.304348,0.088696,0.177391,0.078261,0.443711,0.256765,0.042207,0.274949,0.091707,0.068374,0.042613,0.195653,0.041722,0.331086,0.067745,0.402708,0.027404,0.388721,0.100053,0.439828,0.151189,0.040313,0.197386,0.053125,0.243695,0.08371,0.280897,0.057839,0.367096,0.050279,0.403475,0.032834,0.433088,0.081746,0.466011,0.097832,0.318443,0.050326,0.018598,0.227188,0.021342,0.310463,0.001812,0.268389,0.021082,0.336366,0.015535,0.364983,0.031437,0.372487,0.045073,0.394847,0.041135,0.416183,0.064134,0.430517,0.382911,0.421973,0.424199,0.378455,0.443165,0.329214,0.364155,0.364397,0.31287,0.502322,0.348639,0.461294],"triangles":[63,17,62,63,62,6,60,59,4,61,58,59,60,18,59,61,59,18,63,6,58,59,58,5,61,17,58,63,58,17,57,55,56,57,56,11,57,37,55,56,55,38,55,37,54,55,54,38,54,52,53,54,53,38,54,36,52,53,52,12,52,36,50,51,50,49,51,12,50,52,50,12,50,33,49,51,49,13,47,2,46,47,46,29,46,45,44,46,2,45,48,30,44,46,44,29,45,1,44,48,44,1,48,1,43,48,43,30,43,41,42,43,42,30,42,41,31,43,0,41,41,0,40,41,40,31,57,39,37,57,11,39,39,19,37,54,37,36,50,36,33,37,20,36,49,33,35,49,35,13,40,15,34,40,34,31,36,20,33,35,33,21,60,4,32,60,32,18,34,28,31,42,31,26,44,30,29,42,26,30,47,29,3,30,25,29,31,28,27,34,14,28,35,28,13,35,21,28,28,21,27,31,27,26,27,23,26,23,24,26,30,26,25,26,24,25,32,25,18,32,3,25,29,25,3,25,24,18,61,18,24,61,24,17,27,21,23,24,23,22,23,19,22,24,22,17,33,20,21,23,21,20,37,19,20,23,20,19,39,10,19,22,19,16,22,16,17,62,17,16,19,10,16,62,16,7,40,0,15,34,15,14,28,14,13,39,11,10,16,10,9,16,9,8,16,8,7,62,7,6,58,6,5,59,5,4,32,4,3,43,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.13","display":[{"type":"mesh","name":"D_CLOTHES.13","path":"shizuku_01","vertices":[32.55,-158.8,76.4,-131.65,95.57,-78.03,105.28,-14.22,111.03,47.56,127.32,97.95,115.07,135.22,35.68,150.64,-57.92,142.75,-96.6,117.15,-137.39,63.13,-141.3,-4.73,-139.35,-70.83,-114.92,-110.83,-44.51,-155.02,31.64,120.35,-15.18,77.15,-1.58,25.14,-14.68,-31.01,-23.32,-95.63,-8.42,-4.2],"uvs":[0.295573,0.309896,0.329427,0.356771,0.334635,0.442708,0.342448,0.545573,0.352865,0.647135,0.363281,0.729167,0.354167,0.809896,0.303385,0.821615,0.244792,0.802083,0.220052,0.760417,0.209635,0.671875,0.200521,0.5625,0.192708,0.454427,0.208333,0.389323,0.255208,0.326823,0.302083,0.765625,0.272135,0.695313,0.27474,0.611979,0.268229,0.505208,0.266927,0.414063,0.271338,0.556197],"triangles":[14,19,1,19,12,18,19,18,2,20,3,18,20,18,11,20,11,17,20,17,3,17,16,4,17,10,16,16,9,15,16,15,5,19,14,13,19,13,12,18,12,11,17,11,10,16,10,9,15,9,8,15,8,7,15,7,6,15,6,5,16,5,4,17,4,3,18,3,2,19,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.30","display":[{"type":"mesh","name":"D_HAIR_TWIN.30","path":"shizuku_01","vertices":[-0.7,-144.64,116.64,-99.99,156.31,47.83,112.95,130.55,-24.52,114.3,-127.7,22.79,-106.1,-107.36,-15.96,-19.8,83.29,33.51],"uvs":[0.455078,0.754557,0.507161,0.742839,0.555339,0.770833,0.552734,0.818359,0.50651,0.839193,0.44987,0.832682,0.432943,0.783203,0.477214,0.791667,0.520182,0.788411],"triangles":[8,7,4,8,1,7,7,0,6,7,6,5,7,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.14","display":[{"type":"mesh","name":"D_CLOTHES.14","path":"shizuku_01","vertices":[-116.28,-135.59,-49.18,-131.75,32.44,-85.88,103.95,-61.89,167.78,-24.19,182.77,95.42,134.64,158.2,74.9,158.92,-5.46,91.39,-77.66,71.82,-112.59,-2.82,131.16,86.48,52.26,28.9,-30.94,7.36,-95.45,-30.04,-64.92,-25.64,14.09,-3.49,94.42,53.64,-11.99,-103.64,0.01,-38.2,66.57,-73.21,41.55,-33.1,81.2,-10.49,125.04,33.69,133.27,-44.27,34.84,121.88,63.33,92.46,105.46,114.5,23.15,56.79,-36.92,79.25,-17.5,52.68,-55,31.77,-83.57,-143.46,-72.76,-81.28,-39.72,-66.52,-117.31,-53.88,-107.96,-84.84,154.88,103.5,179.68,67.69,168.64,132.66],"uvs":[0.001739,0.878261,0.097391,0.864348,0.217391,0.852174,0.335652,0.84,0.429565,0.873043,0.452174,0.949565,0.410435,0.982609,0.32,0.993043,0.198261,0.987826,0.090435,0.986087,0.024348,0.968696,0.382609,0.925217,0.265497,0.918218,0.146236,0.92414,0.049947,0.936867,0.093605,0.9306,0.208131,0.917836,0.327683,0.917924,0.152381,0.858769,0.181005,0.888976,0.266915,0.847076,0.239512,0.882543,0.298205,0.881751,0.365137,0.893509,0.377858,0.85485,0.259547,0.990453,0.292137,0.954791,0.35539,0.954705,0.231652,0.953258,0.1503,0.987053,0.173219,0.957171,0.116478,0.957175,0.043396,0.872202,0.072486,0.902415,0.120494,0.892628,0.014944,0.931079,0.024313,0.905703,0.417113,0.937294,0.442476,0.916743,0.43044,0.966771],"triangles":[38,4,37,39,37,6,39,5,37,38,37,5,36,35,14,36,0,35,36,14,32,33,32,14,33,1,32,36,32,0,30,13,29,31,29,13,31,9,29,30,29,8,26,12,25,28,25,12,28,8,25,26,25,7,24,23,4,24,3,23,21,12,20,22,20,12,22,3,20,21,20,2,34,13,18,19,18,13,19,2,18,34,18,1,23,17,11,27,11,17,22,12,17,26,17,12,23,3,17,22,17,3,26,7,17,27,17,7,21,16,12,28,12,16,19,13,16,30,16,13,21,2,16,19,16,2,30,8,16,28,16,8,34,15,13,31,13,15,33,14,15,34,1,15,33,15,1,31,15,9,35,10,14,15,14,9,23,11,4,37,4,11,37,11,6,27,6,11,14,10,9,27,7,6],"userEdges":[]}]},{"name":"D_CLOTHES.15","display":[{"type":"mesh","name":"D_CLOTHES.15","path":"shizuku_01","vertices":[82.93,-106,115.14,-21.06,133.33,85.49,121.58,146.56,25.28,115.48,-51.18,95.98,-93.69,14.78,-130.95,-65.08,-133.33,-122.56,-56.54,-138.75,-76.64,-69.56,-10.62,17.86,44.01,-57.12,67.36,50.01,-26.17,-64.26],"uvs":[0.377604,0.182943,0.409505,0.164714,0.453125,0.151042,0.479167,0.154297,0.470703,0.203776,0.466146,0.242839,0.434245,0.267578,0.399089,0.298177,0.375651,0.294922,0.371745,0.246094,0.397786,0.257813,0.431641,0.225911,0.397786,0.201823,0.441406,0.185547,0.398093,0.237216],"triangles":[13,1,12,13,12,11,14,11,12,14,12,9,13,11,4,14,10,11,11,10,6,14,9,10,12,0,9,10,9,8,10,8,7,10,7,6,11,6,5,11,5,4,13,4,3,13,3,2,13,2,1,12,1,0],"userEdges":[]}]},{"name":"D_HAND.07","display":[{"type":"mesh","name":"D_HAND.07","path":"shizuku_00","vertices":[122.95,-169.04,-5.89,-97.49,-155.18,23.02,-79.51,135.99,51.37,98.33,141.35,41.85,-49.86,41.96,84.11,-23.96,23.99,4.69,132.76,-56.55,-117.73,78.93,-27.02,120.89,-72.06,-44.07,101.12,67.1,68.42,-138.76],"uvs":[0.51888,0.630208,0.477865,0.642578,0.430339,0.663411,0.454427,0.682943,0.496094,0.676432,0.52474,0.666667,0.463866,0.666687,0.506516,0.65529,0.487376,0.660243,0.522006,0.649656,0.442261,0.673078,0.471139,0.680331,0.456798,0.651813,0.511931,0.671033,0.501522,0.635443],"triangles":[9,7,5,13,5,7,14,1,7,8,7,1,9,0,7,14,7,0,8,4,7,13,7,4,8,6,4,11,4,6,12,2,6,10,6,2,8,1,6,12,6,1,10,3,6,11,6,3],"userEdges":[]}]},{"name":"D_HAND.06","display":[{"type":"mesh","name":"D_HAND.06","path":"shizuku_00","vertices":[-157.73,-105.85,-36.84,-125,102.5,-137.77,168.07,-99.47,159.87,50.51,92.25,120.71,-20.31,132.17,-129.05,56.89,77.91,-22.88,-47.08,-19.69,-96.53,-58.2,-144.77,-32.35,-95.53,-115.71,40.44,-132.08,9.21,-84.02,128.06,-65.49,164.92,-41.91,92.94,-93.09,23.66,62.76,12.45,-21.21,32.23,126.82,85.95,57.66,110.38,6.19,-73.63,95.26,-30.72,73.14,-86.66,17.29],"uvs":[0.399414,0.53125,0.457031,0.525391,0.523438,0.521484,0.554688,0.533203,0.550781,0.579102,0.518555,0.600586,0.466797,0.603516,0.413086,0.581055,0.511719,0.556641,0.452148,0.557617,0.428581,0.545833,0.405589,0.553746,0.429061,0.528235,0.49386,0.523224,0.478976,0.537931,0.535621,0.543603,0.553188,0.55082,0.51888,0.535156,0.486907,0.582531,0.48052,0.557152,0.490955,0.602148,0.515553,0.58129,0.527192,0.565538,0.44046,0.592502,0.461104,0.585677,0.433287,0.568934],"triangles":[24,9,23,25,23,9,25,7,23,24,23,6,22,21,4,22,8,21,21,18,5,20,5,18,19,9,18,24,18,9,24,6,18,20,18,6,21,8,18,19,18,8,16,15,4,22,4,15,17,15,2,16,3,15,17,8,15,22,15,8,19,14,9,19,8,14,14,8,13,17,13,8,17,2,13,14,13,1,12,10,1,11,7,10,25,10,7,12,0,10,11,10,0,25,9,10,10,9,1,14,1,9,21,5,4,15,3,2],"userEdges":[]}]},{"name":"D_HAND.08","display":[{"type":"mesh","name":"D_HAND.08","path":"shizuku_00","vertices":[69.96,-158.27,-94.94,-40.39,-198.72,166.85,-92.52,164.81,-9.55,75.06,149.47,-32.63,30.07,-41.2,-90.98,79.18,-8.37,-102.28,67.3,23.02,-140.3,50.18,-51.32,18.59],"uvs":[0.658203,0.37793,0.613281,0.40625,0.581055,0.448242,0.612305,0.448242,0.635742,0.428711,0.680664,0.405273,0.646934,0.403407,0.612738,0.429607,0.636866,0.391381,0.657452,0.417384,0.599197,0.424602,0.624756,0.417725],"triangles":[10,2,7,11,7,4,11,1,7,10,7,1,9,5,6,8,1,6,11,6,1,8,6,0,11,4,6,9,6,4,6,5,0,7,3,4,7,2,3],"userEdges":[]}]},{"name":"D_HAND.09","display":[{"type":"mesh","name":"D_HAND.09","path":"shizuku_00","vertices":[-166.29,149.53,-67.73,-27.18,82.15,-154.28,154.01,-5.48,14.39,81.33,-63.63,161.93,44.16,-22.18,-65.36,82.03,116.1,-83.98,-20.86,34.76,-104.17,157.04,8.8,-92.08,76.77,42.55,-108.66,46.21,-29.09,126.25],"uvs":[0.585286,0.507161,0.616536,0.470052,0.664063,0.443359,0.686849,0.474609,0.642578,0.492839,0.617839,0.509766,0.652017,0.471101,0.617288,0.492985,0.674828,0.458123,0.631401,0.483059,0.604985,0.508737,0.640805,0.456422,0.662356,0.484695,0.603558,0.485464,0.62879,0.502272],"triangles":[10,7,0,13,0,7,14,4,7,9,7,4,9,1,7,13,7,1,10,5,7,14,7,5,9,6,1,11,1,6,12,3,6,8,6,3,8,2,6,11,6,2,9,4,6,12,6,4],"userEdges":[]}]},{"name":"D_HAND.10","display":[{"type":"mesh","name":"D_HAND.10","path":"shizuku_00","vertices":[-172.41,92.67,-30.45,-80.3,111.51,-155.98,179.4,11.59,34.35,76.45,-64.4,152.12,-51.42,63.23,70.7,-33.04,144.51,-74.51,7.46,11.4,-106.21,129.11,-91.89,-5.44,44.33,-120.17,94.58,49.52,-12.59,112.43,-105.69,76.43,-41.22,-6.6,20.96,-56.28,92.01,-97.23,123.09,-11.53,51.95,23.43,-3.2,70.66,-59.07,115.63],"uvs":[0.578125,0.547852,0.623047,0.516602,0.667969,0.50293,0.689453,0.533203,0.643555,0.544922,0.612305,0.558594,0.616413,0.542532,0.655056,0.525139,0.678414,0.517647,0.635044,0.53317,0.599075,0.554436,0.603605,0.530127,0.646712,0.509399,0.662612,0.540056,0.628698,0.551422,0.599238,0.544918,0.619641,0.529917,0.639316,0.520941,0.661798,0.513544,0.671633,0.529026,0.649124,0.535343,0.63167,0.543876,0.613991,0.552],"triangles":[21,6,14,22,14,6,22,5,14,21,14,4,19,7,13,20,13,7,20,4,13,19,13,3,17,7,12,18,12,7,18,2,12,17,12,1,15,6,11,16,11,6,16,1,11,15,11,0,22,6,10,15,10,6,15,0,10,22,10,5,21,9,6,16,6,9,20,7,9,17,9,7,21,4,9,20,9,4,17,1,9,16,9,1,19,8,7,18,7,8,19,3,8,18,8,2],"userEdges":[]}]},{"name":"D_HAND.11","display":[{"type":"mesh","name":"D_HAND.11","path":"shizuku_00","vertices":[-155.43,57.21,-36.32,-83.34,104.99,-169.77,166.86,-4.5,28.49,53.78,-57.34,112.05,-49.48,38.98,61.12,-53.78,134.04,-78.14,-0.28,-7.09,-88.11,94.85,-89.84,-20.19,39.69,-130.95,86.25,29.45,-20.71,87.19,-89.41,45.85,-43.26,-18.81,16.13,-67.43,83.68,-113.42,114.41,-28.94,44.12,2.26,-10.45,46.39],"uvs":[0.597656,0.585449,0.630859,0.56543,0.66748,0.553711,0.6875,0.57666,0.648926,0.584961,0.625,0.593262,0.627191,0.582852,0.658022,0.569641,0.67835,0.566171,0.640906,0.576291,0.616423,0.590811,0.61594,0.574425,0.652049,0.558649,0.665029,0.581496,0.635211,0.589719,0.616061,0.583831,0.628924,0.574621,0.64548,0.567696,0.662885,0.56145,0.672878,0.573178,0.653283,0.577622,0.638073,0.583908],"triangles":[21,6,14,21,14,4,19,7,13,20,13,7,20,4,13,19,13,3,17,7,12,18,12,7,18,2,12,17,12,1,15,6,11,16,11,6,16,1,11,15,11,0,15,10,6,15,0,10,21,9,6,16,6,9,20,7,9,17,9,7,21,4,9,20,9,4,17,1,9,16,9,1,19,8,7,18,7,8,19,3,8,18,8,2,10,5,6,14,6,5],"userEdges":[]}]},{"name":"D_CLOTHES.10","display":[{"type":"mesh","name":"D_CLOTHES.10","path":"shizuku_01","vertices":[37.65,-157.4,116.83,-132.26,176.45,-74.06,167.59,11.7,174.13,91.91,128.92,138.59,-7.2,152.73,-107.79,147.52,-135.23,111.06,-117.32,23.41,-85.28,-60.56,-68.75,-127.84,-11.82,121.22,66.76,85.07,-41.65,53.57,87.48,46.38,6.58,3.04,46.84,-39.9,27.28,-102.11,-122.07,58.38,-102.69,-9.89,-36.65,90.92,-40.57,-28.41,-82.78,80.58,38.69,-129.41,-78.73,-96.82,-35.48,-78.94,-20.69,-143.83,-22.55,-114.66,82.03,-145.05],"uvs":[0.088542,0.309896,0.14974,0.358073,0.171875,0.441406,0.166667,0.570313,0.166667,0.708333,0.143229,0.78776,0.080729,0.830729,0.016927,0.816406,0.009115,0.731771,0.019531,0.606771,0.033854,0.473958,0.039063,0.36849,0.076823,0.763021,0.106771,0.700521,0.059896,0.654948,0.125,0.640625,0.08724,0.574219,0.111979,0.489583,0.098958,0.40625,0.015293,0.657633,0.025267,0.553583,0.062738,0.714611,0.060491,0.523983,0.034018,0.694097,0.094143,0.361708,0.036726,0.415804,0.063372,0.443259,0.062533,0.340696,0.068767,0.387217,0.122668,0.336762],"triangles":[26,18,25,28,25,18,28,11,25,26,25,10,29,24,1,27,11,24,28,24,11,29,0,24,27,24,0,28,18,24,23,21,14,23,8,21,22,20,16,22,10,20,23,14,19,23,19,8,24,18,1,26,17,18,18,17,2,22,16,17,26,10,17,22,17,10,17,16,3,20,9,16,16,15,3,16,14,15,19,14,9,16,9,14,15,14,13,21,13,14,15,13,4,21,12,13,13,12,5,21,8,12,12,8,7,12,7,6,12,6,5,13,5,4,15,4,3,17,3,2,18,2,1],"userEdges":[]}]},{"name":"D_HAIR_TWIN.29","display":[{"type":"mesh","name":"D_HAIR_TWIN.29","path":"shizuku_01","vertices":[-136.49,-100.25,-100.49,-120.03,-65.27,-80.78,-66.8,-11.7,-100.29,19.72,-141.27,2.96,-144.07,-56.58,-125.09,-44.57,-90.83,-54.36],"uvs":[0.455078,0.754557,0.507161,0.742839,0.555339,0.770833,0.552734,0.818359,0.50651,0.839193,0.44987,0.832682,0.432943,0.783203,0.477214,0.791667,0.520182,0.788411],"triangles":[8,7,4,8,1,7,7,0,6,7,6,5,7,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.11","display":[{"type":"mesh","name":"D_CLOTHES.11","path":"shizuku_01","vertices":[-147.25,13.94,-151.97,-51.47,-100.07,-124.65,-59.65,-161.82,7.49,-126.43,83.22,-64.33,141.56,-16.5,139.45,62.44,121.98,154.97,64.28,140.69,-0.8,107.64,-72.08,77.34,96.25,57,34.62,27.51,-32.57,8.96,-87.5,-32.83,-103.49,58.18,-127.06,1.22,-47.92,-69.46,19.95,-46.27,71.41,45.12,47.84,77.97,-40.34,90.84,-14.29,68.1,0.23,14.55,-12.34,-61.03,-78.41,32.17,-61.72,-18.73,-58.59,50.61,52.64,-5.05,35.51,-88.84,-30.31,-141.83,-76.77,-98.59,-132.22,-106.81,-137.91,-45.48,-94.8,-86.17],"uvs":[0.384115,0.334635,0.43099,0.316406,0.5,0.348958,0.535156,0.416667,0.53125,0.509115,0.519531,0.621094,0.511719,0.708333,0.457031,0.71875,0.388021,0.710938,0.378906,0.63151,0.380208,0.539063,0.377604,0.438802,0.446615,0.660156,0.446615,0.572917,0.445313,0.479167,0.447917,0.39974,0.380426,0.39365,0.406857,0.357842,0.491255,0.447207,0.487425,0.542152,0.446615,0.625,0.416426,0.599042,0.378764,0.483453,0.406964,0.514448,0.445927,0.523388,0.491804,0.495368,0.406431,0.422787,0.44671,0.436537,0.4003,0.452332,0.474786,0.59153,0.52649,0.554598,0.533592,0.453679,0.496295,0.409126,0.467092,0.333436,0.436306,0.342579,0.478172,0.370241],"triangles":[34,15,33,35,33,15,35,2,33,34,33,1,35,32,2,35,15,32,27,26,14,28,14,26,28,26,11,27,15,26,24,23,13,24,14,23,23,14,22,28,22,14,28,11,22,23,22,10,29,20,5,21,9,20,29,13,20,21,20,13,30,19,5,29,5,19,25,14,19,24,19,14,30,4,19,25,19,4,24,13,19,29,19,13,31,18,4,25,4,18,32,15,18,27,18,15,31,3,18,32,18,3,27,14,18,25,18,14,34,1,17,34,17,15,26,15,16,17,16,15,17,0,16,26,16,11,21,13,10,23,10,13,20,12,5,20,9,12,21,10,9,12,9,8,12,8,7,12,7,6,12,6,5,32,3,2,17,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.12","display":[{"type":"mesh","name":"D_CLOTHES.12","path":"shizuku_01","vertices":[5.2,-158.2,149.14,-105.13,129.47,-24.31,62.5,57.76,4.04,143.98,-86.76,97.07,-145.77,31.48,-86.4,-79.77,-26.73,3.97,62.33,-76.32,-8.09,-81.93,-88.71,24.47,-11.32,74.1,68.4,-134.9],"uvs":[0.373698,0.03776,0.44401,-0.001302,0.459635,0.022135,0.463542,0.080729,0.467448,0.13151,0.423177,0.152344,0.380208,0.15625,0.367188,0.10026,0.417969,0.104167,0.425781,0.044271,0.395333,0.070212,0.398307,0.131286,0.442754,0.117864,0.40457,0.020609],"triangles":[10,8,9,13,9,1,13,0,9,10,9,0,11,8,7,10,7,8,9,8,3,12,3,8,12,8,5,11,5,8,10,0,7,11,7,6,11,6,5,12,5,4,12,4,3,9,3,2,9,2,1],"userEdges":[]}]},{"name":"D_HAND.01","display":[{"type":"mesh","name":"D_HAND.01","path":"shizuku_00","vertices":[-121.12,-133.66,16.69,-90.24,133.7,-8.21,102.49,117.25,-4.11,131.73,-131.52,73.83,-62.7,-1.16,67.89,33.58,-126.37,-28.92,6.83,14.94,118.97,51.01,-49.78,-111.18,-72.25,100.76,76.55,-48.27,60.92,122.9],"uvs":[0.454427,0.701823,0.488932,0.707682,0.518229,0.71875,0.510417,0.735677,0.483724,0.73763,0.451823,0.729818,0.469054,0.7197,0.501753,0.724388,0.453112,0.715955,0.486464,0.721873,0.514542,0.726739,0.472289,0.704856,0.466664,0.733452,0.503919,0.713344,0.500008,0.736439],"triangles":[13,7,2,10,2,7,9,4,7,14,7,4,14,3,7,10,7,3,13,1,7,9,7,1,11,6,1,9,1,6,8,5,6,12,6,5,12,4,6,9,6,4,11,0,6,8,6,0],"userEdges":[]}]},{"name":"D_HAND.00","display":[{"type":"mesh","name":"D_HAND.00","path":"shizuku_00","vertices":[-118.48,-136.25,-31.61,-119.9,84.23,-79.01,68.3,2.76,20.52,78.39,-30.16,100.88,-96.76,64.09,-145.99,2.76,-148.89,-79.01,-38.84,6.85,17.62,-27.91,-62.01,-54.48],"uvs":[0.430664,0.390625,0.489258,0.398438,0.567383,0.417969,0.556641,0.457031,0.524414,0.493164,0.490234,0.503906,0.445313,0.486328,0.412109,0.457031,0.410156,0.417969,0.484375,0.458984,0.522461,0.442383,0.46875,0.429688],"triangles":[11,10,1,11,9,10,10,9,4,11,6,9,11,0,8,11,8,7,11,7,6,9,6,5,9,5,4,10,4,3,10,3,2,10,2,1,11,1,0],"userEdges":[]}]},{"name":"D_HAND.02","display":[{"type":"mesh","name":"D_HAND.02","path":"shizuku_00","vertices":[-127.91,-62.77,-79.03,-146.25,5.81,-101.69,118.53,-3.24,148.37,156.3,60.48,126.04,5.33,55.36,5.62,-27.36,-54.3,2.65,80.58,81.22,137.37,97.47,-54.09,-84.26,-54.86,-43.38,54.7,-59,61.37,26.38,103.16,110.18,5.47,15.44,61.34,-15.45,5.71,-66.18,46.33,69.43,97.16,44.32,126.89,41.43,28.94,85.44],"uvs":[0.444336,0.766602,0.458984,0.738281,0.483398,0.753906,0.515625,0.788086,0.523438,0.842773,0.498047,0.832031,0.482422,0.807617,0.482936,0.779324,0.465414,0.789301,0.504142,0.816794,0.520557,0.822607,0.465899,0.759594,0.465462,0.773565,0.497374,0.768729,0.498853,0.797952,0.510549,0.826797,0.48267,0.793959,0.49907,0.783649,0.483178,0.766047,0.494245,0.812612,0.50916,0.80425,0.517812,0.803398,0.489082,0.818023],"triangles":[21,20,10,21,3,20,22,5,19,22,19,6,20,14,9,19,9,14,17,7,14,16,14,7,20,3,14,17,14,3,16,6,14,19,14,6,18,7,13,17,13,7,17,3,13,18,13,2,18,11,7,12,7,11,18,2,11,12,11,0,20,9,10,15,10,9,15,4,10,19,5,9,15,9,5,16,7,8,12,8,7,12,0,8,16,8,6,15,5,4,11,2,1,11,1,0],"userEdges":[]}]},{"name":"D_HAND.03","display":[{"type":"mesh","name":"D_HAND.03","path":"shizuku_00","vertices":[-123.64,-51.58,-64.17,-142.55,24.87,-77.09,107.97,-2.54,164.36,162.93,82.74,137.48,22.33,64.44,-40.04,15.06,-48.72,-64.47,23.45,-2.46,138.27,86.37,93.77,76.28,114.59,108.16,62.03,33.38,-8.29,-29.97,-94.14,-96.65,-78.58,-15.41,-18.78,-109.18,-5.27,42.46,60.88,-44.81],"uvs":[0.446289,0.848633,0.46582,0.824219,0.495117,0.841797,0.520508,0.858398,0.536133,0.902344,0.511719,0.895508,0.494141,0.879883,0.473743,0.866562,0.470904,0.845187,0.494603,0.861866,0.528903,0.882009,0.51556,0.879289,0.521575,0.887765,0.506422,0.869876,0.484186,0.854462,0.455959,0.836545,0.461147,0.858336,0.480756,0.83318,0.485087,0.87397,0.506115,0.848988],"triangles":[13,6,11,12,10,11,12,11,5,13,11,3,12,4,10,11,10,3,19,9,3,13,3,9,14,7,9,18,9,7,18,6,9,13,9,6,19,2,9,14,9,2,14,8,7,16,7,8,17,1,8,15,8,1,14,2,8,17,8,2,15,0,8,16,8,0,11,6,5,12,5,4],"userEdges":[]}]},{"name":"D_HAND.04","display":[{"type":"mesh","name":"D_HAND.04","path":"shizuku_00","vertices":[-127.44,15.52,-129.15,-72.24,-67.6,-141.05,31.37,-48.86,148.79,94.82,137.61,156.35,74.3,146.02,-25.83,73.46,-49,-44.08,99.45,34.44,54.17,53.73,120.04,114.58,-95.42,-67.97,4.22,9.15,88.61,82.56,34.3,116.76,71.87,0.69,-70.66,47.92,-22.09,-98.67],"uvs":[0.447917,0.914063,0.447266,0.894531,0.472656,0.884115,0.503255,0.89974,0.544271,0.931641,0.540365,0.945313,0.518229,0.942057,0.483073,0.929036,0.477354,0.904375,0.527031,0.918232,0.511149,0.922047,0.534225,0.935659,0.46111,0.898092,0.493701,0.913608,0.523234,0.928508,0.504102,0.936825,0.517397,0.910738,0.467602,0.922447,0.486722,0.891297],"triangles":[14,11,9,14,6,11,16,10,9,14,9,10,13,7,10,15,10,7,15,6,10,14,10,6,16,3,10,13,10,3,11,4,9,18,8,3,13,3,8,12,0,8,17,8,0,17,7,8,13,8,7,18,2,8,12,8,2,11,6,5,11,5,4,12,2,1,12,1,0],"userEdges":[]}]},{"name":"D_HAND.05","display":[{"type":"mesh","name":"D_HAND.05","path":"shizuku_00","vertices":[-139.53,-31.02,-104.49,-133.36,-36.29,-122.81,65.38,-3.01,141.06,149.3,63.7,155.78,-23.78,91.78,-79.12,-61.34,-91.25,20.48,104.1,74.64,24.37,40.53,-30.7,-21.24,64.66,72.85,22.4,-53.49,15.74,120.46,87.54,107.9,94.2,153.23],"uvs":[0.442057,0.94987,0.45638,0.934896,0.479818,0.936198,0.510417,0.955078,0.535807,0.983073,0.509766,0.984375,0.480469,0.972656,0.46406,0.946935,0.458141,0.959411,0.523376,0.969366,0.496664,0.963151,0.480125,0.953422,0.510105,0.969097,0.497515,0.947118,0.493658,0.977932,0.517797,0.975518,0.52003,0.983862],"triangles":[16,4,15,16,15,5,15,9,12,15,12,5,12,10,5,14,5,10,13,2,10,11,10,2,12,3,10,13,10,3,11,6,10,14,10,6,15,4,9,12,9,3,11,2,7,8,7,0,8,6,7,11,7,6,7,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.18","display":[{"type":"mesh","name":"D_CLOTHES.18","path":"shizuku_04","vertices":[234.62,-66.42,298.53,-50.75,336.16,-22.48,358.44,23.22,-38.06,46.47,-3.82,-1.2,78.74,6.94,191.66,10.22,279.43,10.49,328.89,18.46,-57.52,23.12,-62.79,-26.78,-14.63,-58.16,52.87,-58.94,152.45,-63.26,327.53,80.79,270,82.9,182.61,85.68,62.46,82.28,8.97,67.36],"uvs":[0.41,0.815,0.387,0.875,0.355,0.908,0.308,0.924,0.334,0.537,0.376,0.576,0.358,0.655,0.341,0.764,0.33,0.849,0.316229,0.895947,0.359,0.521,0.408,0.522,0.4325,0.5725,0.425,0.638,0.417,0.735,0.256,0.887,0.261,0.831,0.269,0.746,0.287,0.63,0.308,0.58],"triangles":[19,18,6,18,17,6,17,16,7,16,15,9,14,13,6,13,12,5,12,11,5,5,11,10,15,3,9,16,9,8,9,2,8,16,8,7,14,7,0,8,0,7,14,6,7,17,7,6,13,5,6,19,6,5,19,5,4,10,4,5,9,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.19","display":[{"type":"mesh","name":"D_CLOTHES.19","path":"shizuku_04","vertices":[471.9,-73.52,474.06,-13.2,473.44,45.44,464.46,75.96,419.83,69.05,391.68,86.85,317.5,80.63,229.76,78.7,145.64,93.33,58.58,88.41,-7.94,67.05,-29.68,28.56,-42.68,-49.05,22.1,-80.42,101.07,-81.51,182.94,-86.15,266.59,-89.35,364.27,-108.27,409.97,-87.48,412.32,-18.72,425.84,28.42,349.19,33.19,353.99,-48.66,275.77,-4.35,200.5,-5.47,123.38,-2.86,57.28,0.99,9.66,-6.59,-51.63,36.48,-60.98,-19.3],"uvs":[0.184,0.036,0.241,0.021,0.297,0.009,0.328,0.011,0.331,0.055,0.354,0.078,0.364,0.15,0.381,0.234,0.413,0.311,0.427,0.395,0.418,0.461,0.386,0.489,0.309,0.52,0.274,0.466,0.256,0.391,0.234,0.314,0.213,0.235,0.174,0.146,0.184,0.098,0.249,0.081,0.291,0.058,0.312,0.13,0.233,0.143,0.292,0.208,0.311,0.278,0.332,0.347,0.344,0.415,0.347,0.462,0.3885,0.517,0.3315,0.533],"triangles":[29,28,12,27,26,13,27,9,26,26,8,25,26,25,14,25,8,24,25,24,15,24,7,23,24,23,16,23,22,16,23,21,22,22,21,19,23,6,21,21,5,20,21,20,19,20,1,19,22,19,18,19,0,18,22,18,17,22,17,16,24,16,15,25,15,14,26,14,13,27,13,12,28,11,12,27,12,11,28,10,11,27,11,10,27,10,9,26,9,8,24,8,7,23,7,6,21,6,5,20,5,4,20,4,3,20,3,2,20,2,1,19,1,0],"userEdges":[]}]},{"name":"D_HAND.18","display":[{"type":"mesh","name":"D_HAND.18","path":"shizuku_04","vertices":[126.74,47.26,126.73,68.25,92.38,59.99,61.53,52.51,45.22,45.68,40.46,22.57,49.22,9.32,83.83,23.42,108.84,35.88,57.26,29.5],"uvs":[0.361,0.909,0.381,0.9045,0.3805,0.939,0.38,0.97,0.377,0.987,0.356,0.9965,0.3415,0.991,0.3475,0.955,0.354,0.9285,0.359,0.979],"triangles":[9,3,7,2,0,8,2,8,7,9,7,6,9,6,5,9,5,4,9,4,3,7,3,2,2,1,0],"userEdges":[]}]},{"name":"D_HAND.19","display":[{"type":"mesh","name":"D_HAND.19","path":"shizuku_04","vertices":[39.12,-50.33,85.68,-56.63,105.7,-29.02,114.48,6.54,104.31,44.67,67.52,54.22,34.58,37.35,28.65,-3.88,63.9,-15.88,79.68,16.55],"uvs":[0.197,0.9825,0.181,0.9395,0.203,0.9145,0.235,0.8985,0.2735,0.9,0.2905,0.933,0.2815,0.968,0.2435,0.9825,0.2245,0.9515,0.252,0.9295],"triangles":[6,9,8,9,2,8,8,0,7,8,7,6,9,6,5,9,5,4,9,4,3,9,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_HAND.20","display":[{"type":"mesh","name":"D_HAND.20","path":"shizuku_04","vertices":[82.85,48.09,127.59,54.5,167.5,61.39,195.14,64.47,192.46,34.48,160.38,27.77,121.47,21.1,92.05,16.57],"uvs":[0.394,0.123,0.3905,0.079,0.3885,0.0395,0.3855,0.0125,0.3575,0.0215,0.358,0.0535,0.36,0.092,0.362,0.121],"triangles":[0,6,7,1,5,6,2,4,5,4,2,3,5,1,2,6,0,1],"userEdges":[]}]},{"name":"D_HAND.21","display":[{"type":"mesh","name":"D_HAND.21","path":"shizuku_04","vertices":[206.47,21.78,166.93,20.22,126.94,20.65,97.83,24.07,87.99,-9.12,131.88,-12.87,177.84,-7.24,204.38,-3.88],"uvs":[0.4075,0.867,0.4145,0.905,0.4235,0.943,0.433,0.97,0.4035,0.9865,0.3905,0.9455,0.386,0.9005,0.3835,0.8745],"triangles":[0,7,6,1,6,5,2,5,4,4,3,2,5,2,1,6,1,0],"userEdges":[]}]},{"name":"D_HAND.22","display":[{"type":"mesh","name":"D_HAND.22","path":"shizuku_04","vertices":[185.66,-43.52,195.64,-20.27,153.36,-11.96,117.74,-5.29,89.74,-2.15,83.16,-28.83,116.66,-35.45,157.34,-43.6],"uvs":[0.3745,0.165,0.3945,0.1505,0.4115,0.189,0.4255,0.2215,0.4345,0.2475,0.4105,0.2595,0.397,0.229,0.3805,0.192],"triangles":[2,0,7,2,7,6,3,6,5,5,4,3,6,3,2,2,1,0],"userEdges":[]}]},{"name":"D_HAND.23","display":[{"type":"mesh","name":"D_HAND.23","path":"shizuku_04","vertices":[147.11,-59.39,119.52,-44.09,86.58,-23.7,65.77,-47.81,96.54,-65.54,132.46,-80.54],"uvs":[0.1865,0.294,0.207,0.317,0.2335,0.344,0.215,0.369,0.1915,0.3435,0.1695,0.3125],"triangles":[0,5,4,1,4,3,3,2,1,4,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.16","display":[{"type":"mesh","name":"D_CLOTHES.16","path":"shizuku_04","vertices":[-71.31,-7.55,-66.03,-40.98,-34.5,-72.8,47.21,-88.88,117.77,-95.7,202.32,-98.14,275.38,-98.56,327.28,-92.72,362.15,-47.32,337.22,-0.27,295.16,31.82,230.05,46.35,154.68,49.64,55.75,51.78,-34.26,46.51,-12.4,-16.15,48.63,-4.42,33.23,-49.04,116.64,-39.24,135.08,16.97,201.97,-5.62,199.47,-56.24,279.14,-28.28,320.89,-46],"uvs":[0.035,0.014,0.081,0.007,0.12,0.04,0.143,0.118,0.156,0.186,0.166,0.268,0.173,0.339,0.172,0.39,0.131,0.428,0.083,0.408,0.048,0.37,0.028,0.308,0.018,0.235,0.007,0.139,0.004,0.051,0.063,0.064,0.061,0.127,0.103,0.108,0.101,0.19,0.048,0.213,0.076,0.276,0.125,0.269,0.105,0.349,0.126,0.388],"triangles":[23,22,9,23,6,22,22,6,21,22,21,20,21,18,20,22,20,11,20,19,12,20,18,19,19,18,16,21,4,18,18,3,17,18,17,16,19,16,13,17,15,16,16,15,14,17,2,15,15,0,14,16,14,13,19,13,12,20,12,11,22,11,10,22,10,9,23,9,8,23,8,7,23,7,6,21,6,5,21,5,4,18,4,3,17,3,2,15,2,1,15,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.17","display":[{"type":"mesh","name":"D_CLOTHES.17","path":"shizuku_04","vertices":[469.09,-49.88,473.04,5.53,471.31,60.67,463.13,97.41,410.95,103.53,359.55,127.75,274.71,110.83,167.15,106.84,49.59,94.99,-37.13,75.64,-49.15,0.75,-0.92,-60.79,90.76,-87.37,195.06,-71.49,281.26,-61.87,391.83,-71.12,393.85,2.95,333.18,65.54,298.19,-11.83,227.02,33.17,115.44,8.9,23.55,6.02,-52.52,-29.72,-73.8,15.72,-65.32,47.97,143.31,61.69,103.43,100.42,82.63,51.8,38.07,55.63,193.73,74.13,242.05,109.62,234.87,73.09,260.39,87.51],"uvs":[0.138627,0.445491,0.192463,0.452221,0.244953,0.464334,0.2786,0.479139,0.274563,0.530283,0.288022,0.584118,0.25572,0.66218,0.231494,0.764468,0.197847,0.874832,0.162853,0.95424,0.088829,0.951548,0.039031,0.893674,0.030956,0.800808,0.065949,0.703903,0.091521,0.623149,0.103634,0.515478,0.174966,0.527591,0.223419,0.597577,0.142665,0.61642,0.172275,0.693136,0.12786,0.795424,0.107672,0.882907,0.059,0.949,0.0985,0.978,0.131,0.976,0.183715,0.77874,0.213257,0.824286,0.162736,0.834995,0.157947,0.878405,0.2052,0.732796,0.248363,0.693244,0.212005,0.693192,0.230661,0.671477],"triangles":[32,19,31,32,31,30,31,29,30,32,30,6,30,29,7,31,19,29,28,27,21,28,8,27,27,26,25,27,8,26,29,19,25,26,7,25,29,25,7,27,25,20,24,10,23,23,10,22,28,21,9,27,20,21,21,20,12,25,19,20,20,19,13,32,17,19,19,18,14,19,17,18,32,6,17,18,17,16,17,4,16,4,2,16,18,16,15,16,0,15,18,15,14,19,14,13,20,13,12,21,12,11,22,10,11,21,11,10,24,9,10,21,10,9,28,9,8,17,6,5,17,5,4,4,3,2,16,2,1,16,1,0],"userEdges":[]}]},{"name":"D_HAND.12","display":[{"type":"mesh","name":"D_HAND.12","path":"shizuku_04","vertices":[97.88,-58.85,100.65,-35.46,66.59,-23.95,37.37,-7.44,18.2,-15.08,14.49,-37.83,36.61,-53.34,66.81,-55.52,40.11,-32.12],"uvs":[0.0105,0.3435,0.0335,0.344,0.04,0.3785,0.052,0.409,0.042,0.4265,0.0195,0.427,0.0075,0.4035,0.0095,0.374,0.0285,0.403],"triangles":[8,2,7,8,7,6,8,6,5,8,5,4,8,4,3,8,3,2,7,2,1,7,1,0],"userEdges":[]}]},{"name":"D_HAND.13","display":[{"type":"mesh","name":"D_HAND.13","path":"shizuku_04","vertices":[44.7,-47.97,71.77,-42.98,86.84,-16.66,82.19,20.18,67.8,46.51,50.75,61.31,21.94,55.02,4.86,51.22,0.81,18.69,3.36,-21.99,16.14,-37.75,51.14,-16.82,59.47,13.04,34.75,28.4,27.37,-5.72],"uvs":[0.0055,0.469,0.014,0.4435,0.0415,0.4325,0.0765,0.442,0.1,0.4595,0.112,0.478,0.102,0.505,0.096,0.521,0.064,0.5205,0.025,0.5125,0.0115,0.498,0.0365,0.467,0.0665,0.463,0.078,0.489,0.044,0.4915],"triangles":[10,14,11,14,8,13,14,13,12,13,4,12,14,12,11,12,2,11,11,0,10,14,10,9,14,9,8,13,8,7,13,7,6,13,6,5,13,5,4,12,4,3,12,3,2,11,2,1,11,1,0],"userEdges":[]}]},{"name":"D_HAND.14","display":[{"type":"mesh","name":"D_HAND.14","path":"shizuku_04","vertices":[57.18,-43.38,91.73,-47.72,133.66,-51.03,168.35,-50.73,165.61,-26.05,127.59,-20.71,92.09,-15.72,65.51,-9.91,49.25,-26.24,76.56,-30.6,112.19,-34.57,144.13,-37.25],"uvs":[0.01,0.64,0.0105,0.606,0.013,0.565,0.018,0.5315,0.0415,0.5375,0.0415,0.575,0.0415,0.61,0.0435,0.6365,0.0255,0.65,0.025,0.623,0.026,0.588,0.02775,0.55675],"triangles":[11,2,10,11,10,5,10,1,9,10,9,6,9,0,8,9,8,7,9,7,6,10,6,5,11,5,4,11,4,3,11,3,2,10,2,1,9,1,0],"userEdges":[]}]},{"name":"D_HAND.15","display":[{"type":"mesh","name":"D_HAND.15","path":"shizuku_04","vertices":[74.51,-14.36,109.85,-13.12,144.88,-10.29,178.11,-5.66,174.51,16.56,139.89,20.4,97.47,16.53,69.23,17.92,56.81,-0.5,82.88,1.01,119.8,2.54,151.62,6.34],"uvs":[0.051,0.628,0.057,0.594,0.0645,0.5605,0.0735,0.529,0.0945,0.5355,0.0935,0.5695,0.084,0.61,0.0815,0.6375,0.062,0.647,0.067,0.622,0.0735,0.5865,0.0815,0.55625],"triangles":[11,2,10,11,10,5,10,1,9,10,9,6,9,0,8,9,8,7,9,7,6,10,6,5,11,5,4,11,4,3,11,3,2,10,2,1,9,1,0],"userEdges":[]}]},{"name":"D_HAND.16","display":[{"type":"mesh","name":"D_HAND.16","path":"shizuku_04","vertices":[72.9,6.68,107.06,17.9,134.99,25.35,158.64,35.47,148.31,57.61,111.76,51.37,69.71,42.8,53.58,34.73,50.29,15.02,77.06,25.22],"uvs":[0.007,0.74,0.0225,0.7085,0.0335,0.6825,0.0465,0.661,0.0665,0.674,0.0555,0.7085,0.0415,0.748,0.0315,0.7625,0.012,0.763,0.0255,0.7385],"triangles":[5,1,9,9,0,8,9,8,7,9,7,6,9,6,5,2,5,4,4,3,2,5,2,1,9,1,0],"userEdges":[]}]},{"name":"D_HAND.17","display":[{"type":"mesh","name":"D_HAND.17","path":"shizuku_04","vertices":[67.24,32.59,90.44,54.15,114.58,71.44,99.13,86.54,61.44,68.57,39.32,54.61,45.02,32.62,63.51,50.18,82.59,78.65],"uvs":[0.1755,0.4155,0.1995,0.396,0.2195,0.375,0.232,0.392,0.2095,0.426,0.193,0.4455,0.1725,0.437,0.192,0.4215,0.222129,0.406916],"triangles":[1,8,3,8,1,7,8,7,4,7,0,6,7,6,5,7,5,4,3,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.07","display":[{"type":"mesh","name":"D_CLOTHES.07","path":"shizuku_01","vertices":[-133.33,-95.24,-95.51,-133.33,-36.88,-60.61,40.66,25.97,133.33,128.14,61.47,133.33,-17.97,77.92,-93.62,-13.85,-27.28,9.72,53.58,92.64,-92.19,-80.47],"uvs":[0.788411,0.905599,0.801432,0.891276,0.821615,0.91862,0.848307,0.951172,0.880208,0.989583,0.855469,0.991536,0.828125,0.970703,0.802083,0.936198,0.82492,0.945062,0.852754,0.976236,0.802573,0.911153],"triangles":[8,2,7,10,7,2,9,3,6,8,6,3,10,0,7,8,7,6,9,6,5,9,5,4,9,4,3,8,3,2,10,2,1,10,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.08","display":[{"type":"mesh","name":"D_CLOTHES.08","path":"shizuku_01","vertices":[103.78,-133.33,133.33,-77.08,86.96,1.47,3.92,75.26,-78.8,133.33,-133.33,114.45,-66.08,49.77,28.09,-46.39,14.24,23.35,95.14,-64.09,-76.04,96.79],"uvs":[0.987305,0.890625,0.99707,0.913574,0.979004,0.944336,0.947754,0.972656,0.915527,0.992676,0.897461,0.986328,0.922852,0.961426,0.958496,0.924316,0.952338,0.952028,0.983041,0.918215,0.918475,0.980099],"triangles":[9,7,2,8,2,7,8,6,3,10,3,6,9,0,7,8,7,6,10,6,5,10,5,4,10,4,3,8,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.09","display":[{"type":"mesh","name":"D_CLOTHES.09","path":"shizuku_01","vertices":[-161.78,-68.89,-107.58,-99.81,-26.06,-114.74,20.39,-112.6,95.08,-99.81,160.21,-41.17,131.97,37.19,108.29,89.43,125.14,164.59,63.2,189.11,-13.77,187.51,-102.12,170.98,-105.31,96.89,-125.8,68.64,-164.97,-11.32,-19.69,99.55,45.9,95.29,0.35,-2.79,52.27,1.47,-61.59,2.54,-118.06,-32.64,-57.94,-66.76,4,-62.5,67.76,-50.77],"uvs":[0.777344,0.645182,0.817057,0.624349,0.874349,0.617188,0.907552,0.61849,0.961589,0.624349,0.999349,0.64974,0.988932,0.691406,0.966146,0.714844,0.977865,0.758464,0.939453,0.772135,0.889974,0.782552,0.828776,0.77474,0.827474,0.723307,0.803385,0.711589,0.779948,0.678385,0.880208,0.73112,0.925781,0.727214,0.890625,0.680339,0.936849,0.68099,0.846354,0.681641,0.808594,0.667318,0.851563,0.646484,0.899089,0.645182,0.946615,0.647135],"triangles":[23,22,18,23,3,22,22,21,17,22,2,21,21,1,20,21,20,19,20,13,19,21,19,17,23,18,6,22,17,18,18,17,16,19,15,17,18,16,7,17,15,16,19,12,15,16,15,10,20,0,14,20,14,13,19,13,12,15,12,11,15,11,10,16,10,9,16,9,8,16,8,7,18,7,6,23,6,5,23,5,4,23,4,3,22,3,2,21,2,1,20,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.01","display":[{"type":"mesh","name":"D_CLOTHES.01","path":"shizuku_01","vertices":[-132.32,-144.94,-57.19,-130.16,40.51,-119.06,140.97,-134.84,142.07,-4.18,155.28,110.34,139.87,157.58,66.11,171.9,-7.65,177.63,-78.11,166.17,-145.26,144.7,-146.91,70.26,-142.51,-46.35,-75.9,87.44,-6.55,90.3,59.5,88.87,113.45,98.89,-88.01,-7.04,-6.55,5.84,70.51,-1.32,-93.52,-82.92,-19.76,-67.17,49.6,-71.46,106.01,-76.12],"uvs":[0.019531,0.002604,0.111979,0.011719,0.22526,0.014323,0.34375,0.002604,0.347656,0.128906,0.355469,0.235677,0.34375,0.282552,0.25651,0.295573,0.169271,0.300781,0.085938,0.290365,0.00651,0.270833,0.011719,0.200521,0.011719,0.096354,0.088542,0.21875,0.170573,0.221354,0.248698,0.220052,0.300781,0.222656,0.074219,0.132813,0.171875,0.140625,0.261719,0.138021,0.065104,0.063802,0.153646,0.070313,0.236979,0.074219,0.296875,0.06901],"triangles":[23,2,22,23,22,19,22,2,21,22,21,18,21,1,20,21,20,17,23,19,4,4,19,16,22,18,19,19,18,15,21,17,18,20,12,17,18,17,13,19,15,16,16,15,7,18,14,15,7,15,14,18,13,14,17,11,13,14,13,9,20,0,12,17,12,11,13,11,10,13,10,9,14,9,8,14,8,7,16,7,6,16,6,5,16,5,4,23,4,3,23,3,2,21,2,1,20,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.02","display":[{"type":"mesh","name":"D_CLOTHES.02","path":"shizuku_01","vertices":[-145.93,-110.66,-109.53,-129.9,-49.98,-147.71,1.23,-154.62,16.82,-84.28,46.08,-5.22,91.85,73.19,145.22,145.71,103.1,154.38,-27.23,166.6,-69.77,160.45,-89.35,106.87,-101.47,28.49,-129.91,-50.89,-30.01,110.14,55.35,113.26,102.01,125.71,22.07,140.01,-55.61,136.74,-37.45,50.14,38.8,52.08,-69.03,77.3,8.79,70.22,71.43,36.59,-95.07,70.85,-49.52,-1.21,-68.53,-85.08,-68.56,-112.22,-33.63,-128.89,32.37,-39.24,-10.64,-58.41,-82.51,-2.32,-138.02,-80.44,-102.83,-99.06,-57.39,-53.92,-42.51,23.45,-107.02,-111.62,-78.12,-137.65,-94.7,-123.69,-59.25,-131.64,1.65,22.76,42.23,24.2,1.48,-8.91,-37.63,-102.11,-29,-85.77,-4.84,-25.61,1.67,4.92,-63.5,111.46,-80.89,141.25,-119.47,-21.82,-66.61,13.57,-91.07,10.88,-67.58,39.87,-85.93,51.65,-64.52,32.69,-33.93,78.88,-79.97,91.31,-51.14,92.26,-51.57,62.26,-79.55,24.01,-71.62,124.32,-23.36,138.78,80.73,135.21,123.67,108.44,24.9,163.36,17.03,111.86,74.17,92.61,97.4,98.4,77.29,118.29,68.18,63.68,48.29,87.14],"uvs":[0.486328,0.05957,0.519531,0.037109,0.573242,0.019531,0.62207,0.013672,0.632813,0.099609,0.654297,0.199219,0.692383,0.298828,0.741211,0.376953,0.704102,0.394531,0.613281,0.401367,0.569336,0.389648,0.538086,0.324219,0.526367,0.233398,0.501953,0.143555,0.587891,0.333008,0.650391,0.329102,0.702179,0.356388,0.630656,0.367532,0.577032,0.366156,0.585938,0.254883,0.645508,0.272461,0.559247,0.293557,0.621065,0.295332,0.674801,0.252845,0.533872,0.291559,0.572266,0.172852,0.554688,0.100586,0.554688,0.066406,0.589551,0.039122,0.645137,0.156751,0.604345,0.134045,0.531562,0.155892,0.495039,0.106392,0.525247,0.082922,0.564204,0.139709,0.579603,0.216876,0.522973,0.063235,0.545181,0.028715,0.533555,0.048796,0.566259,0.037173,0.61081,0.23463,0.649708,0.237457,0.613424,0.186081,0.582997,0.078438,0.590876,0.100134,0.610539,0.164395,0.613703,0.208815,0.562097,0.328456,0.558985,0.367977,0.510893,0.176452,0.555834,0.194528,0.529265,0.190166,0.55793,0.244782,0.542142,0.262261,0.558404,0.223455,0.586865,0.291993,0.548367,0.309321,0.572365,0.311625,0.573971,0.272221,0.544407,0.209602,0.557426,0.345044,0.600349,0.36655,0.678947,0.363889,0.719759,0.342631,0.644648,0.399006,0.622322,0.330856,0.672044,0.313491,0.697203,0.327152,0.674157,0.341624,0.671457,0.287057,0.648306,0.304923],"triangles":[67,66,16,68,16,66,69,20,66,70,66,20,67,6,66,69,66,6,70,15,66,68,66,15,67,16,63,67,63,6,68,62,16,68,15,62,58,21,55,57,55,21,57,14,55,58,55,19,59,54,50,59,12,54,58,52,21,53,21,52,54,52,35,54,12,52,53,52,12,58,19,52,59,50,51,59,51,12,54,35,50,51,50,31,51,31,49,51,49,12,60,48,18,60,11,48,60,18,47,57,21,47,56,47,21,56,11,47,60,47,11,57,47,14,44,43,26,44,4,43,45,42,29,46,42,35,46,5,42,45,25,42,41,40,20,46,35,40,41,5,40,46,40,5,38,27,37,39,37,27,39,2,37,38,37,1,38,1,36,38,36,27,52,19,35,40,35,19,42,25,35,50,35,25,36,33,27,36,0,33,33,32,26,33,0,32,34,26,31,49,31,13,50,25,31,34,31,25,34,30,26,44,26,30,45,29,30,44,30,4,34,25,30,45,30,25,42,5,29,30,29,4,43,4,28,39,28,2,39,27,28,43,28,27,43,27,26,33,26,27,32,13,26,31,26,13,56,21,24,53,24,21,53,12,24,56,24,11,41,20,23,69,23,20,69,6,23,41,23,5,70,20,22,55,14,22,65,22,14,65,15,22,70,22,15,55,22,19,40,19,20,22,20,19,61,18,9,61,14,18,47,18,14,48,10,18,62,17,8,64,8,17,65,14,17,61,17,14,61,9,17,64,17,9,62,15,17,65,17,15,62,8,16,63,16,7,18,10,9,16,8,7,28,4,3,28,3,2,36,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.03","display":[{"type":"mesh","name":"D_CLOTHES.03","path":"shizuku_01","vertices":[-8.85,-163.07,48.77,-149.7,112.29,-129.12,157.82,-112.25,140.31,-61.25,96.97,8.82,79.5,38.31,80.9,87.17,45.95,167.82,-39.41,161.92,-119.25,154.83,-160.96,143.23,-131.18,82.91,-63.35,0.05,-28.33,-76.06,-87.01,110.79,-25.58,119.55,-51.4,68.59,23.98,68.87,14.56,14.17,13.29,-41.09,84.34,-59.8,27.68,-115.58,82.07,-109.37,-12.05,-125.09,10.86,-138.4,67.62,-126.17,79.36,-140.84,62.07,135.64,34.76,109.49,-93.7,50.34,21.33,-69.26,-43.28,-43.72,0.08,-97.38,-5.13,-58.55,-27.14,-20.62,-18.8,41.86,89.64,-30.94,118.56,-26.21,53.07,-17.46,65.79,10.72,82.5,63.37,54.71,47.92,55.22,30.1,60.13,80.82,73.11,115.44,22.07,151.85,-71.5,136.87,-37.78,95.57,-70.42,91.2,-3.04,96.64,59.47,65.57,62.37,97.55,28.69,130.7,51.67,123.55,55.67,110.76,40.9,145.65,46.92,133.63,-56.33,40.38,-21.85,7.7,13.78,-18.91,-38.56,23.35,-89.98,75.62,-69.72,60.62],"uvs":[0.627604,0.583333,0.673177,0.589844,0.730469,0.60026,0.769531,0.613281,0.769531,0.678385,0.753906,0.759115,0.752604,0.8125,0.765625,0.882813,0.75,0.980469,0.691406,0.980469,0.619792,0.981771,0.574219,0.97526,0.595052,0.898438,0.613281,0.792969,0.622396,0.692708,0.627604,0.93099,0.683594,0.93099,0.645833,0.864583,0.707031,0.859375,0.6875,0.792969,0.671875,0.722656,0.714844,0.678385,0.657552,0.636719,0.71224,0.632813,0.625211,0.633598,0.642145,0.609253,0.694564,0.61337,0.699932,0.594708,0.756118,0.942229,0.728524,0.904602,0.603284,0.850811,0.666954,0.685805,0.618511,0.735442,0.640894,0.663248,0.647211,0.707728,0.642738,0.75762,0.666409,0.829218,0.731337,0.712471,0.761695,0.718871,0.710897,0.739999,0.728768,0.77193,0.75987,0.851736,0.732665,0.833009,0.727518,0.804974,0.742839,0.873698,0.760534,0.914628,0.727772,0.963906,0.652335,0.955869,0.665756,0.899619,0.6361,0.900042,0.694284,0.898326,0.739109,0.854737,0.748859,0.892659,0.727319,0.937766,0.744313,0.926132,0.746923,0.910365,0.740427,0.954228,0.741996,0.94004,0.632378,0.834981,0.652832,0.792969,0.678159,0.750936,0.642894,0.813174,0.621307,0.880934,0.627399,0.858617],"triangles":[63,30,62,63,62,17,61,36,59,61,59,13,61,58,36,63,58,30,61,13,58,63,17,58,57,53,56,57,56,28,55,54,45,57,54,53,55,29,54,57,28,54,56,53,46,54,29,53,55,45,52,55,52,29,62,12,49,62,49,17,50,18,48,49,15,48,50,48,16,49,48,17,56,46,8,53,16,46,54,28,45,52,45,7,52,44,29,51,44,41,52,7,44,51,18,44,43,19,42,51,41,42,51,42,18,43,42,6,44,7,41,42,41,6,43,6,40,43,40,19,40,39,19,60,19,39,40,5,39,60,39,20,38,4,37,39,37,20,39,5,37,38,37,5,59,36,19,58,17,36,60,35,19,59,19,35,60,20,35,59,35,13,35,20,32,34,32,20,34,14,32,35,32,13,34,20,31,33,31,22,33,14,31,34,31,14,58,13,30,62,30,12,50,29,18,44,18,29,50,16,29,53,29,16,56,8,28,27,26,2,27,1,26,33,22,24,25,24,22,25,0,24,33,24,14,26,23,2,26,22,23,23,22,21,31,21,22,25,22,1,26,1,22,23,21,4,37,4,21,31,20,21,37,21,20,42,19,18,36,18,19,36,17,18,48,18,17,46,16,9,47,9,16,48,15,16,47,16,15,49,12,15,47,15,10,15,12,11,15,11,10,47,10,9,46,9,8,40,6,5,23,4,3,23,3,2,25,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.04","display":[{"type":"mesh","name":"D_CLOTHES.04","path":"shizuku_01","vertices":[-153.11,-115.87,-86.84,-157.35,86.9,-163.9,163.91,-129.2,149.59,115.59,77.94,150.53,-76.09,150.53,-139.67,113.4,-86.84,15.15,6.3,15.15,85.11,6.41,2.64,-155.43,6.3,150.53],"uvs":[0.765625,0.809896,0.821615,0.794271,0.947917,0.789063,1,0.804688,0.99349,0.872396,0.941406,0.882813,0.829427,0.882813,0.779948,0.876302,0.821615,0.842448,0.889323,0.842448,0.946615,0.839844,0.886662,0.791588,0.889323,0.882813],"triangles":[11,9,2,10,2,9,10,9,5,12,5,9,12,9,6,11,1,9,9,1,8,9,8,6,8,0,7,8,7,6,10,5,4,10,4,3,10,3,2,8,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.05","display":[{"type":"mesh","name":"D_CLOTHES.05","path":"shizuku_01","vertices":[-100.13,-133.67,-23.16,-88.66,69.79,-49.17,101.74,69.33,133.69,169.3,42.19,153.4,-55.11,143.3,-108.84,61.91,-130.63,-7.02,-155.32,-116.09,66.88,117.85,-10.09,51.67,-47.85,-20.63,-94.32,-75.98,0.25,-32.3,54.93,61.94,-38.91,-45.25,27.46,4.27,21.92,-69.5,-143.82,-65.29,-110,-46.19,-69.04,-45.87,-78.16,20.4,-33.48,99.29,-55.53,56.39,-0.11,131.83,96.96,141.01,61.6,12.07,85.22,8.06],"uvs":[0.740885,0.452474,0.772135,0.477214,0.817057,0.514323,0.832031,0.560547,0.841797,0.607422,0.796224,0.60612,0.766927,0.599609,0.732422,0.558594,0.71875,0.522786,0.719401,0.465495,0.806641,0.579427,0.776693,0.549479,0.757161,0.51888,0.740885,0.486328,0.781653,0.517017,0.808869,0.555914,0.762581,0.503799,0.795669,0.532952,0.793923,0.495212,0.719098,0.492177,0.731324,0.502077,0.74974,0.504036,0.744866,0.538618,0.771618,0.57553,0.756321,0.553673,0.784833,0.59051,0.822466,0.592029,0.812544,0.537246,0.824289,0.536646],"triangles":[28,27,3,28,2,27,25,10,23,24,7,23,25,23,6,24,23,11,24,11,22,24,22,7,21,20,12,21,13,20,20,13,19,20,19,8,27,17,15,27,2,17,21,16,13,21,12,16,27,15,3,17,11,15,17,14,11,18,1,14,16,14,1,17,2,14,18,14,2,16,12,14,16,1,13,19,13,9,22,12,8,20,8,12,22,11,12,14,12,11,23,10,11,15,11,10,15,10,3,26,3,10,25,5,10,26,10,5,13,0,9,22,8,7,23,7,6,25,6,5,26,5,4,26,4,3,13,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.06","display":[{"type":"mesh","name":"D_CLOTHES.06","path":"shizuku_01","vertices":[72.25,-141.23,131.5,-133.68,149.67,-37.14,108.46,48.25,45.69,118.55,-52.06,136.05,-140.75,144.5,-110.22,49.15,-53.54,-62.52,25.78,-112.24,-13.92,47.95,39.72,-24.77,78.58,-88.35,77.57,-120.44,138.57,-100.59,28.11,-76.91],"uvs":[0.960286,0.444661,0.992188,0.453125,0.997396,0.513021,0.978516,0.556641,0.947917,0.593099,0.903646,0.605469,0.863932,0.610026,0.877604,0.558594,0.905599,0.508464,0.934245,0.472656,0.921224,0.557943,0.951172,0.520182,0.969401,0.481771,0.9646,0.462222,0.994377,0.478304,0.942095,0.494698],"triangles":[13,12,1,14,1,12,15,12,9,13,9,12,14,12,2,15,11,12,12,11,2,15,8,11,11,8,10,11,10,3,10,7,5,13,0,9,15,9,8,10,8,7,7,6,5,10,5,4,10,4,3,11,3,2,13,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.00","display":[{"type":"mesh","name":"D_CLOTHES.00","path":"shizuku_01","vertices":[-135.53,-138.56,-63.22,-162.23,-23.21,-145.88,21.66,-152.23,63.67,-160.04,142.26,-139.29,147.41,-87.32,137.98,-7.53,113.11,56.89,67.67,108.86,4.23,155.71,-48.07,125.7,-96.94,62.74,-128.67,-10.46,-144.1,-83.66,-0.06,97.15,-1.78,42.25,51.38,58.35,-45.5,62.74,-66.94,15.16,70.24,10.04,-2.63,-15.58,-86.66,-44.86,79.67,-44.13,-4.63,-78.54,57.38,-99.52,-81.51,-96.84,107.9,-120.84,-112.13,-119.67],"uvs":[0.665039,0.036133,0.755859,0.012695,0.800781,0.03125,0.860352,0.03125,0.908203,0.011719,0.989258,0.035156,0.995117,0.109375,0.984375,0.21582,0.956055,0.301758,0.904297,0.371094,0.832031,0.433594,0.772461,0.393555,0.716797,0.30957,0.680664,0.211914,0.663086,0.114258,0.827148,0.355469,0.825195,0.282227,0.885742,0.303711,0.775391,0.30957,0.750977,0.246094,0.907227,0.239258,0.824219,0.205078,0.728516,0.166016,0.917969,0.166992,0.823242,0.125,0.908203,0.099609,0.734375,0.09668,0.955324,0.064664,0.6995,0.066226],"triangles":[27,4,25,28,26,1,28,14,26,2,26,24,27,25,6,3,24,25,25,24,23,26,22,24,25,23,6,24,21,23,24,22,21,26,14,22,22,19,21,23,21,20,21,16,20,23,20,7,22,13,19,21,19,16,19,12,18,19,18,16,20,17,8,20,16,17,18,15,16,17,16,15,17,15,9,18,11,15,28,0,14,22,14,13,19,13,12,18,12,11,15,11,10,15,10,9,17,9,8,20,8,7,23,7,6,27,6,5,27,5,4,25,4,3,24,3,2,26,2,1,28,1,0],"userEdges":[]}]},{"name":"D_NECK.00","display":[{"type":"mesh","name":"D_NECK.00","path":"shizuku_00","vertices":[-153.72,-130.04,-53.32,-132.38,56.98,-135.88,157.73,-133.55,134.36,-22.62,122.83,68.45,86.61,126.83,14.18,146.68,-71.43,124.49,-121.91,71.56,-137.26,-38.97,4.3,68.45,-5.58,-13.28,1.01,-81],"uvs":[0.27832,0.035156,0.331055,0.014648,0.396484,0.011719,0.442383,0.030273,0.439453,0.107422,0.435547,0.182617,0.414063,0.231445,0.371094,0.248047,0.320313,0.229492,0.294922,0.186523,0.283203,0.09668,0.365234,0.182617,0.362305,0.113281,0.363281,0.057617],"triangles":[13,12,4,13,10,12,12,11,5,12,9,11,13,0,10,12,10,9,11,9,8,11,8,7,11,7,6,11,6,5,12,5,4,13,4,3,13,3,2,13,2,1,13,1,0],"userEdges":[]}]},{"name":"D_NECK.01","display":[{"type":"mesh","name":"D_NECK.01","path":"shizuku_00","vertices":[-141.94,-73.42,-38.82,-120.02,97.3,-133.33,148.86,-77.12,132.36,34.58,49.87,133.33,-80.07,112.99,-135.75,30.14,-45.01,-29.03,66.37,-37.91],"uvs":[0.020508,0.036133,0.079102,0.013672,0.143555,0.007813,0.177734,0.033203,0.169922,0.081055,0.123047,0.124023,0.05957,0.112305,0.027344,0.081055,0.076172,0.053711,0.128906,0.049805],"triangles":[9,8,5,9,1,8,8,0,7,8,7,6,8,6,5,9,5,4,9,4,3,9,3,2,9,2,1,8,1,0],"userEdges":[]}]},{"name":"D_BODY.00","display":[{"type":"mesh","name":"D_BODY.00","path":"shizuku_00","vertices":[-154.9,-95.96,-87.61,-127.55,-11.05,-148.14,79.74,-135.91,151.46,-90.37,159.4,6.05,142.01,89.75,95.49,135.19,37.69,146.41,-67.97,142.54,-121.15,117.77,-153.57,38.25,-171.38,-42.9,-67.97,67.86,24.32,71.72,87.18,70.44,51.06,-5.53,-53.26,-10.68,-86.69,-77.64,-2.43,-80.22,100.55,-67.34],"uvs":[0.572174,0.646957,0.667826,0.617391,0.768696,0.594783,0.893913,0.608696,0.996522,0.648696,0.991304,0.806957,0.968696,0.92,0.937391,0.984348,0.833043,0.996522,0.695652,0.991304,0.617391,0.966956,0.584348,0.850435,0.558261,0.725217,0.695652,0.890435,0.815652,0.895652,0.897391,0.893913,0.850435,0.791304,0.714783,0.784348,0.671304,0.693913,0.78087,0.690435,0.914783,0.707826],"triangles":[3,19,20,20,19,16,19,18,17,19,1,18,18,12,17,11,13,17,19,17,16,17,14,16,20,16,5,16,15,5,16,14,15,15,14,8,17,13,14,8,14,13,18,0,12,17,12,11,13,11,10,13,10,9,13,9,8,15,8,7,15,7,6,15,6,5,20,5,4,20,4,3,19,3,2,19,2,1,18,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.01","display":[{"type":"mesh","name":"D_BACKGROUND.01","path":"shizuku_03","vertices":[-277.32,-351.93,-3.39,-383.42,250.07,-348.78,254.79,-87.45,10.77,-92.17,-282.04,-90.6],"uvs":[0.055147,0.496324,0.268382,0.471814,0.465686,0.498774,0.469363,0.702206,0.279412,0.698529,0.051471,0.699755],"triangles":[0,5,4,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.02","display":[{"type":"mesh","name":"D_BACKGROUND.02","path":"shizuku_03","vertices":[174.79,-441.38,179.52,-170.6,185.81,191.48,177.94,470.13,15.79,614.96,-39.31,613.39,-48.75,511.06,-327.4,506.34,-324.25,426.05,-168.4,407.16,-162.1,-376.83,-321.1,-383.13,-319.53,-485.46,-62.92,-493.33,-51.9,-573.62,40.98,-576.77,-61.35,-228.85,-164.78,-43.13,-45.61,74.99,-48.75,303.26,-166.64,188.33,79.16,242.3,182.08,323.76,68.87,389.84,-47.19,189.77,75.46,135.93,183.2,40.95,65.9,-46.66,67.98,489.98,92.45,546.49,-10.53,572.59,82.58,-358.39,177.58,-281.53,83.07,-193.93,58.94,-466.7,-62.27,-384.18,101.77,-515.26,-11.29,-534.8,20.5,354.23,18.36,441.9,-48.75,401.96,14.04,499.72,39.4,520.06,49.09,-527.06,107.45,-456.1,5.07,-430.02,-1.89,-479.99,150.22,-419.26,77.69,-487.95,176.17,-362.54,145.03,445.9,115.57,481.39,80.22,518.26,64.13,532.38,36.84,560.59,131.32,511.77,68.4,442.39,112.33,421.83,179.39,418.82,135.26,351.09],"uvs":[0.14951,0.044118,0.360294,0.040441,0.642157,0.035539,0.859069,0.041667,0.971814,0.167892,0.970588,0.210784,0.890931,0.218137,0.887255,0.435049,0.824755,0.432598,0.810049,0.311274,0.199755,0.306373,0.194853,0.430147,0.115196,0.428922,0.109069,0.229167,0.046569,0.220588,0.044118,0.148284,0.314951,0.227941,0.459522,0.308459,0.551471,0.215686,0.729167,0.218137,0.639707,0.309906,0.681719,0.118564,0.745129,0.038448,0.796569,0.126572,0.640822,0.216919,0.598914,0.12144,0.524975,0.037577,0.456775,0.128882,0.874524,0.127266,0.918514,0.10822,0.938829,0.188383,0.214113,0.115899,0.273947,0.041947,0.342138,0.115517,0.129801,0.134301,0.194034,0.228661,0.091997,0.100962,0.07679,0.188971,0.768849,0.164229,0.83709,0.165892,0.806,0.218137,0.882106,0.169259,0.897935,0.149516,0.082811,0.14197,0.138053,0.096541,0.15835,0.176241,0.119452,0.181653,0.166726,0.063247,0.113256,0.11971,0.210879,0.043047,0.84021,0.067286,0.867835,0.090217,0.896535,0.117736,0.907528,0.130266,0.929485,0.151511,0.891486,0.07796,0.837474,0.126936,0.821471,0.092743,0.819126,0.040538,0.766402,0.074892],"triangles":[58,59,57,59,58,22,58,57,50,59,23,57,57,56,51,57,23,56,54,29,53,52,42,53,54,53,42,55,51,52,53,29,52,55,52,29,57,51,50,56,28,51,52,51,28,55,3,51,51,3,50,58,50,3,49,47,31,49,0,47,46,13,45,46,45,34,47,44,31,48,44,36,48,34,44,47,0,44,48,36,43,48,43,34,52,28,42,54,42,30,42,41,30,42,28,41,56,39,28,41,28,39,40,39,38,40,6,39,41,39,6,56,23,39,39,23,38,40,38,19,43,37,34,46,34,37,43,15,37,46,37,13,44,0,36,43,36,15,45,35,31,45,13,35,45,31,34,44,34,31,49,31,32,33,32,31,33,1,32,35,16,31,33,31,16,54,30,4,41,6,30,54,4,29,33,16,27,33,27,1,27,25,26,27,26,1,26,25,2,27,18,25,25,24,21,25,18,24,38,23,21,59,21,23,59,22,21,24,19,21,38,21,19,22,2,21,25,21,2,40,9,6,40,19,9,24,18,20,24,20,19,19,20,9,27,16,18,20,18,17,18,16,17,17,16,10,35,10,16,35,13,10,37,15,14,37,14,13,10,13,12,12,11,10,9,8,7,9,7,6,30,6,5,30,5,4],"userEdges":[]}]},{"name":"D_BACKGROUND.03","display":[{"type":"mesh","name":"D_BACKGROUND.03","path":"shizuku_03","vertices":[17.56,-376.8,134.03,-293.98,132.73,-83.04,131.44,77.43,127.56,327.19,7.21,417.78,3.32,107.2,12.38,-138.68,81.18,-226.52,79.62,-4.96,73.13,237.17],"uvs":[0.026,0.967,0.09,0.877,0.253,0.878,0.377,0.879,0.57,0.882,0.64,0.975,0.4,0.978,0.21,0.971,0.142129,0.917835,0.313332,0.919042,0.500439,0.924058],"triangles":[9,6,3,10,3,6,8,7,2,9,2,7,8,0,7,9,7,6,10,6,5,10,5,4,10,4,3,9,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.04","display":[{"type":"mesh","name":"D_BACKGROUND.04","path":"shizuku_03","vertices":[-354.8,-51.76,-359.55,-116.78,-188.28,-123.13,-183.52,-67.62,-270.58,-87.85],"uvs":[0.655637,0.965686,0.651961,0.915441,0.784314,0.910539,0.78799,0.953431,0.720715,0.937796],"triangles":[4,0,3,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.05","display":[{"type":"mesh","name":"D_BACKGROUND.05","path":"shizuku_03","vertices":[-192.71,-107.62,-146.72,-126.65,-8.74,-117.14,-26.19,-41.01,-153.06,-66.39,-87.81,-84.8],"uvs":[0.031863,0.773284,0.067402,0.758578,0.17402,0.765931,0.160539,0.824755,0.0625,0.805147,0.11292,0.790921],"triangles":[5,1,4,5,4,3,5,3,2,5,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.06","display":[{"type":"mesh","name":"D_BACKGROUND.06","path":"shizuku_03","vertices":[9.32,458.67,7.74,384.14,68,376.21,71.17,463.43,38.61,417.51],"uvs":[0.526961,0.832108,0.469363,0.833333,0.463235,0.786765,0.530637,0.784314,0.495153,0.809475],"triangles":[4,0,3,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.07","display":[{"type":"mesh","name":"D_BACKGROUND.07","path":"shizuku_03","vertices":[94.6,394.84,72.39,451.93,116.8,458.28,126.31,398.01],"uvs":[0.477941,0.765931,0.522059,0.783088,0.526961,0.748775,0.480392,0.741422],"triangles":[0,2,3,2,0,1],"userEdges":[]}]},{"name":"D_BACKGROUND.08","display":[{"type":"mesh","name":"D_BACKGROUND.08","path":"shizuku_03","vertices":[40.07,-473.53,113.02,-471.94,139.98,-389.47,120.95,-224.54,9.94,-213.44,-10.68,-284.8,3.59,-397.4,71.79,-387.89,59.1,-294.32,91.83,-332.83,32.77,-251,88.9,-260.7,67.98,-219.24,27.99,-352.1,65.86,-344.15],"uvs":[0.214461,0.808824,0.215686,0.752451,0.279412,0.731618,0.406863,0.746324,0.415441,0.832108,0.360294,0.848039,0.273284,0.83701,0.280637,0.784314,0.352941,0.794118,0.323186,0.768826,0.386414,0.814464,0.378921,0.77109,0.410956,0.787254,0.308289,0.818161,0.314433,0.788896],"triangles":[14,7,13,14,13,8,12,11,10,12,3,11,12,10,4,11,8,10,11,3,9,14,9,7,14,8,9,11,9,8,10,8,5,13,5,8,9,2,7,13,7,6,7,0,6,13,6,5,10,5,4,9,3,2,7,2,1,7,1,0],"userEdges":[]}]}]}],"animation":[{"type":"tree","duration":0,"fadeInTime":0.5,"name":"f04.exp.json","timeline":[{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"value":0.15}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"value":1}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"value":0.8333}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"value":0.8333}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"value":1}]},{"name":"PARAM_TERE","type":40,"frame":[{"value":1}]}]},{"type":"tree","duration":0,"fadeInTime":0.5,"name":"f03.exp.json","timeline":[{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"value":0.6}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"value":0.4}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"value":0.4}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"value":0.15}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"value":0.65}]}]},{"type":"tree","duration":0,"fadeInTime":0.5,"name":"f02.exp.json","timeline":[{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"value":0.15}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"value":0.5667}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"value":0.5667}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"value":0.7}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{}]}]},{"type":"tree","duration":66,"playTimes":0,"fadeInTime":0.3,"name":"flick_head_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":13,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.415},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.535},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":4,"tweenEasing":0,"value":0.29},{"duration":2,"tweenEasing":0,"value":0.77},{"duration":2,"tweenEasing":0,"value":0.095},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":4,"tweenEasing":0,"value":0.665},{"duration":4,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.335},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.955},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.135},{"duration":4,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.35},{"duration":5,"value":0.04}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":7,"tweenEasing":0,"value":0.145},{"value":0.145},{"duration":58,"value":0.14}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":14,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.64},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":36,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":21,"value":0.505}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.22}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.24}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":14,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.64},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":36,"value":0.6667}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":66,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":23,"tweenEasing":0,"value":0.235},{"duration":6,"tweenEasing":0,"value":0.27},{"duration":2,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.495},{"duration":34,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":22,"tweenEasing":0,"value":0.825},{"tweenEasing":0,"value":0.895},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.845},{"duration":3,"tweenEasing":0,"value":0.795},{"duration":2,"tweenEasing":0,"value":0.615},{"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.51},{"duration":29,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.51},{"duration":4,"value":0.515}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":66,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.5043},{"duration":22,"tweenEasing":0,"value":0.5168},{"duration":17,"tweenEasing":0,"value":0.9757},{"tweenEasing":0,"value":0.9998},{"value":0.9997}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":23,"tweenEasing":0,"value":0.977},{"tweenEasing":0,"value":0.9737},{"duration":2,"tweenEasing":0,"value":0.9478},{"duration":5,"tweenEasing":0,"value":0.8603},{"duration":2,"tweenEasing":0,"value":0.5937},{"tweenEasing":0,"value":0.525},{"duration":30,"tweenEasing":0,"value":0.5065},{"tweenEasing":0,"value":0.4942},{"value":0.494}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.3355},{"duration":10,"tweenEasing":0,"value":0.3456},{"duration":30,"tweenEasing":0,"value":0.4978},{"tweenEasing":0,"value":0.499},{"value":0.4989}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":58,"tweenEasing":0,"value":0.39},{"value":0.39},{"duration":7,"value":0.385}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":52,"tweenEasing":0,"value":0.3367},{"value":0.3367},{"duration":13,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":57,"tweenEasing":0,"value":0.87},{"tweenEasing":0,"value":0.865},{"duration":8,"value":0.86}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":47,"tweenEasing":0,"value":0.375},{"tweenEasing":0,"value":0.495},{"duration":18,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.1933},{"tweenEasing":0,"value":0.19},{"duration":33,"value":0.1867}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":48,"tweenEasing":0,"value":0.815},{"tweenEasing":0,"value":0.82},{"duration":17,"value":0.825}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.385}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":66,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":21,"value":0.505}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":58,"playTimes":0,"fadeInTime":0.3,"name":"flick_head_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":10,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.03},{"duration":4,"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.69},{"duration":2,"tweenEasing":0,"value":0.84},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.555},{"duration":4,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":2,"tweenEasing":0,"value":0.745},{"duration":2,"tweenEasing":0,"value":0.065},{"duration":4,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.21},{"duration":3,"tweenEasing":0,"value":0.03},{"tweenEasing":0,"value":0.01},{"duration":4}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.435},{"tweenEasing":0,"value":0.27},{"value":0.265}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":19,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":23,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.56},{"duration":40,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.57}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":51,"tweenEasing":0,"value":0.305},{"tweenEasing":0,"value":0.245},{"duration":6,"value":0.24}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.57},{"duration":48,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.58}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.295},{"tweenEasing":0,"value":0.255},{"value":0.25}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":19,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":23,"value":0.6667}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.5213},{"tweenEasing":0,"value":0.7707},{"value":0.7733}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.57},{"duration":48,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.58}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":54,"tweenEasing":0,"value":0.24},{"tweenEasing":0,"value":0.315},{"duration":3,"value":0.32}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":58,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":54,"tweenEasing":0,"value":0.2433},{"tweenEasing":0,"value":0.24},{"duration":3,"value":0.2367}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.815}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.4},{"value":0.395}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.56},{"duration":40,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.57}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":78,"playTimes":0,"fadeInTime":0.3,"name":"flick_head_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.06},{"duration":4,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.73},{"duration":6,"tweenEasing":0,"value":0.965},{"duration":4,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.39},{"duration":2,"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.645},{"duration":2,"tweenEasing":0,"value":0.68},{"duration":2,"tweenEasing":0,"value":0.58},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":4,"tweenEasing":0,"value":0.54},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.14},{"tweenEasing":0,"value":0.085},{"duration":13,"value":0.03}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.255},{"tweenEasing":0,"value":0.495},{"duration":43,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":41,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.46}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.5},{"duration":20,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.775},{"duration":43,"value":0.78}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.69},{"duration":44,"value":0.695}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":31,"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.495},{"duration":46,"value":0.5}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":41,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.46}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":19,"tweenEasing":0,"value":0.16},{"duration":15,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.495},{"duration":43,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.505},{"duration":43,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.59},{"duration":45,"value":0.595}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.1208},{"tweenEasing":0,"value":0.499},{"duration":42,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":10,"tweenEasing":0,"value":0.9978},{"duration":22,"tweenEasing":0,"value":0.9422},{"duration":27,"tweenEasing":0,"value":0.5202},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.4632},{"duration":6,"tweenEasing":0,"value":0.4218},{"tweenEasing":0,"value":0.0782},{"tweenEasing":0,"value":0.0368},{"tweenEasing":0,"value":0.01},{"tweenEasing":0},{"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.0368},{"duration":3,"tweenEasing":0,"value":0.0782},{"tweenEasing":0,"value":0.25},{"tweenEasing":0,"value":0.3123}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.675},{"duration":44,"value":0.68}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.2926},{"tweenEasing":0,"value":0.4994},{"duration":42,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.485},{"duration":8,"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.75},{"duration":3,"tweenEasing":0,"value":0.735},{"duration":11,"tweenEasing":0,"value":0.66},{"duration":3,"tweenEasing":0,"value":0.21},{"tweenEasing":0,"value":0.135},{"tweenEasing":0,"value":0.125},{"duration":42,"value":0.12}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.3533},{"tweenEasing":0,"value":0.3367},{"duration":47,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.265},{"duration":8,"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.485},{"tweenEasing":0,"value":0.495},{"duration":63,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":78,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":78,"value":0.815}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.585},{"duration":45,"value":0.59}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"duration":21,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.78},{"tweenEasing":0,"value":0.78},{"duration":43,"value":0.785}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":269,"playTimes":0,"fadeInTime":2,"name":"idle_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":176,"tweenEasing":0},{"tweenEasing":0,"value":0.005},{"duration":92}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6633},{"tweenEasing":0,"value":0.6367},{"duration":2,"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.3567},{"duration":29,"tweenEasing":0,"value":0.33},{"duration":21,"tweenEasing":0,"value":0.3567},{"duration":4,"tweenEasing":0,"value":0.9333},{"duration":7,"tweenEasing":0,"value":0.9933},{"duration":22,"tweenEasing":0,"value":0.9733},{"duration":46,"tweenEasing":0,"value":0.6767},{"tweenEasing":0,"value":0.6533},{"duration":5,"tweenEasing":0,"value":0.6233},{"duration":2,"tweenEasing":0,"value":0.3933},{"duration":2,"tweenEasing":0,"value":0.3433},{"duration":12,"tweenEasing":0,"value":0.34},{"duration":71,"tweenEasing":0,"value":0.6033},{"tweenEasing":0,"value":0.6633},{"duration":10,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6633},{"tweenEasing":0,"value":0.64},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.36},{"duration":29,"tweenEasing":0,"value":0.3367},{"duration":22,"tweenEasing":0,"value":0.3567},{"duration":5,"tweenEasing":0,"value":0.95},{"duration":28,"tweenEasing":0,"value":1},{"duration":45,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.6533},{"duration":5,"tweenEasing":0,"value":0.6233},{"duration":2,"tweenEasing":0,"value":0.3933},{"duration":2,"tweenEasing":0,"value":0.3433},{"duration":12,"tweenEasing":0,"value":0.34},{"duration":71,"tweenEasing":0,"value":0.6033},{"tweenEasing":0,"value":0.6633},{"duration":10,"value":0.6667}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.5},{"duration":87,"tweenEasing":0,"value":0.285},{"duration":27,"tweenEasing":0,"value":0.765},{"duration":66,"tweenEasing":0,"value":0.49},{"duration":50,"tweenEasing":0,"value":0.825},{"tweenEasing":0,"value":0.505},{"duration":3,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.205},{"tweenEasing":0,"value":0.06},{"duration":15,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":0.14},{"duration":8,"tweenEasing":0,"value":0.74},{"duration":7,"tweenEasing":0,"value":0.77},{"duration":17,"tweenEasing":0,"value":0.665},{"duration":5,"tweenEasing":0,"value":0.275},{"duration":24,"tweenEasing":0,"value":0.25},{"duration":4,"tweenEasing":0,"value":0.69},{"duration":7,"tweenEasing":0,"value":0.71},{"duration":30,"tweenEasing":0,"value":0.615},{"duration":32,"tweenEasing":0,"value":0.11},{"duration":45,"tweenEasing":0,"value":0.015},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"duration":3,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":267,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.4998},{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":41,"tweenEasing":0,"value":0.5},{"duration":54,"tweenEasing":0,"value":0.626},{"duration":85,"tweenEasing":0,"value":0.2032},{"duration":31,"tweenEasing":0,"value":0.5232},{"duration":56,"tweenEasing":0,"value":0.1202},{"tweenEasing":0,"value":0.4997},{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":266,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5001},{"duration":2,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":52,"tweenEasing":0,"value":0.5},{"duration":92,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.505},{"duration":124,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":246,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.33},{"duration":22,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.415},{"duration":35,"tweenEasing":0,"value":0.48},{"duration":146,"tweenEasing":0,"value":0.085},{"duration":18,"tweenEasing":0,"value":0.155},{"tweenEasing":0,"value":0.41},{"duration":2,"value":0.415}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.6},{"tweenEasing":0,"value":0.6},{"duration":3,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.63},{"duration":2,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.65},{"duration":3,"tweenEasing":0,"value":0.65},{"duration":46,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.99},{"duration":3,"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.96},{"tweenEasing":0,"value":0.94},{"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":0.91},{"duration":17,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"duration":8,"tweenEasing":0,"value":0.6},{"tweenEasing":0,"value":0.6},{"duration":5,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"duration":4,"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.63},{"duration":3,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.66},{"duration":2,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.67},{"duration":90,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.98},{"tweenEasing":0,"value":0.96},{"duration":11,"tweenEasing":0,"value":0.96},{"tweenEasing":0,"value":0.86},{"duration":28,"tweenEasing":0,"value":0.84},{"tweenEasing":0,"value":0.61},{"duration":4,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":270,"playTimes":0,"fadeInTime":2,"name":"idle_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.6367},{"duration":5,"tweenEasing":0,"value":0.6067},{"duration":2,"tweenEasing":0,"value":0.3833},{"duration":10,"tweenEasing":0,"value":0.3367},{"duration":25,"tweenEasing":0,"value":0.3433},{"duration":20,"tweenEasing":0,"value":0.8833},{"duration":26,"tweenEasing":0,"value":0.9967},{"duration":47,"tweenEasing":0,"value":0.6733},{"tweenEasing":0,"value":0.6567},{"duration":9,"tweenEasing":0,"value":0.64},{"duration":5,"tweenEasing":0,"value":0.2867},{"duration":2,"tweenEasing":0,"value":0.0567},{"duration":30,"tweenEasing":0,"value":0.0067},{"duration":4,"tweenEasing":0,"value":0.0067},{"duration":6,"tweenEasing":0,"value":0.1},{"duration":3,"tweenEasing":0,"value":0.3367},{"duration":6,"tweenEasing":0,"value":0.4667},{"duration":6,"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6633},{"duration":30,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":31,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6533},{"duration":5,"tweenEasing":0,"value":0.6233},{"duration":2,"tweenEasing":0,"value":0.3933},{"duration":10,"tweenEasing":0,"value":0.3433},{"duration":5,"tweenEasing":0,"value":0.34},{"duration":17,"tweenEasing":0,"value":0.4367},{"duration":22,"tweenEasing":0,"value":0.8567},{"duration":27,"tweenEasing":0,"value":1},{"duration":47,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.6567},{"duration":9,"tweenEasing":0,"value":0.64},{"duration":5,"tweenEasing":0,"value":0.2867},{"duration":2,"tweenEasing":0,"value":0.0567},{"duration":30,"tweenEasing":0,"value":0.0067},{"duration":4,"tweenEasing":0,"value":0.0067},{"duration":6,"tweenEasing":0,"value":0.1},{"duration":3,"tweenEasing":0,"value":0.3367},{"duration":6,"tweenEasing":0,"value":0.4667},{"duration":6,"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6633},{"duration":30,"value":0.6667}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":39,"tweenEasing":0,"value":0.5},{"duration":83,"tweenEasing":0,"value":0.285},{"duration":27,"tweenEasing":0,"value":0.765},{"duration":85,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495},{"duration":35,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.69},{"duration":3,"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.14},{"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.015},{"duration":12,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":0.105},{"duration":7,"tweenEasing":0,"value":0.745},{"duration":7,"tweenEasing":0,"value":0.77},{"duration":17,"tweenEasing":0,"value":0.665},{"duration":5,"tweenEasing":0,"value":0.275},{"duration":24,"tweenEasing":0,"value":0.25},{"duration":4,"tweenEasing":0,"value":0.69},{"duration":3,"tweenEasing":0,"value":0.71},{"duration":10,"tweenEasing":0,"value":0.685},{"duration":89,"tweenEasing":0,"value":0.48},{"tweenEasing":0,"value":0.495},{"duration":17,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":222,"tweenEasing":0,"value":0.5},{"duration":45,"tweenEasing":0,"value":0.4515},{"tweenEasing":0,"value":0.5003},{"duration":2,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":41,"tweenEasing":0,"value":0.5},{"duration":54,"tweenEasing":0,"value":0.626},{"duration":110,"tweenEasing":0,"value":0.2032},{"tweenEasing":0,"value":0.5002},{"duration":64,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":179,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.4999},{"duration":90,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":52,"tweenEasing":0,"value":0.5},{"duration":92,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.505},{"duration":125,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":246,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.33},{"duration":23,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"tweenEasing":0,"value":1}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.6},{"tweenEasing":0,"value":0.6},{"duration":3,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.63},{"duration":2,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.65},{"duration":3,"tweenEasing":0,"value":0.65},{"duration":46,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.99},{"duration":3,"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.96},{"tweenEasing":0,"value":0.94},{"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":0.91},{"duration":17,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"duration":179,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":270,"playTimes":0,"fadeInTime":2,"name":"idle_00","timeline":[{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.5},{"duration":24,"tweenEasing":0,"value":0.3902},{"duration":75,"tweenEasing":0,"value":0.6823},{"tweenEasing":0,"value":0.5007},{"duration":90,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.5},{"duration":49,"tweenEasing":0,"value":0.1833},{"duration":23,"tweenEasing":0,"value":0.206},{"duration":165,"tweenEasing":0,"value":0.6368},{"tweenEasing":0,"value":0.5003},{"duration":2,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":84,"tweenEasing":0,"value":0.5},{"duration":184,"tweenEasing":0,"value":0.5616},{"tweenEasing":0,"value":0.4999},{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":60,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":7,"tweenEasing":0,"value":0.57},{"duration":2,"tweenEasing":0,"value":0.91},{"tweenEasing":0,"value":0.975},{"duration":168,"tweenEasing":0,"value":0.995},{"duration":2,"tweenEasing":0,"value":0.995},{"duration":9,"tweenEasing":0,"value":0.95},{"duration":2,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.505},{"duration":15,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":55,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":34,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6567},{"duration":6,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.3567},{"duration":60,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3433},{"duration":6,"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.66},{"duration":49,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":55,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":34,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6567},{"duration":6,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.3567},{"duration":60,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3433},{"duration":6,"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.66},{"duration":49,"value":0.6667}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.5},{"duration":24,"tweenEasing":0,"value":0.43},{"duration":161,"tweenEasing":0,"value":0.685},{"tweenEasing":0,"value":0.505},{"duration":4,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":77,"tweenEasing":0,"value":0.5},{"duration":9,"tweenEasing":0,"value":0.705},{"duration":14,"tweenEasing":0,"value":0.54},{"duration":4,"tweenEasing":0,"value":0.185},{"duration":162,"tweenEasing":0,"value":0.145},{"tweenEasing":0,"value":0.495},{"duration":3,"value":0.5}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":139,"playTimes":0,"fadeInTime":0.3,"name":"pinch_in_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":17,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.095},{"duration":4,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.535},{"duration":2,"tweenEasing":0,"value":1},{"duration":4,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.61},{"duration":20,"tweenEasing":0,"value":0.195},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.3},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":4,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":4,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":14,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.03},{"duration":4,"tweenEasing":0,"value":0.635},{"duration":2,"tweenEasing":0,"value":0.605},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.7},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.635},{"duration":12,"tweenEasing":0,"value":0.895},{"duration":4,"tweenEasing":0,"value":0.66},{"duration":2,"tweenEasing":0,"value":0.155},{"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.01},{"duration":5,"value":0.005}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":129,"tweenEasing":0,"value":0.89},{"duration":8,"tweenEasing":0,"value":0.945},{"tweenEasing":0,"value":0.84},{"tweenEasing":0,"value":0.825}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8733},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.7233},{"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4833},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3733},{"duration":2,"tweenEasing":0,"value":0.4733},{"tweenEasing":0,"value":0.7433},{"tweenEasing":0,"value":0.8433},{"duration":64,"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4367},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.3233},{"tweenEasing":0,"value":0.3433},{"duration":3,"tweenEasing":0,"value":0.3833},{"tweenEasing":0,"value":0.5367},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6033},{"duration":31,"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":93,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.465},{"duration":9,"tweenEasing":0,"value":0.435},{"duration":33,"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.295},{"tweenEasing":0,"value":0.31}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":111,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":27,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.16},{"tweenEasing":0,"value":0.15},{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":61,"tweenEasing":0,"value":0.74},{"duration":8,"tweenEasing":0,"value":0.8},{"duration":18,"tweenEasing":0,"value":0.68},{"duration":6,"tweenEasing":0,"value":0.27},{"duration":44,"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.37}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":133,"tweenEasing":0,"value":0.075},{"duration":4,"tweenEasing":0,"value":0.03},{"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.075}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8767},{"tweenEasing":0,"value":0.7433},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.7233},{"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4833},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3733},{"duration":2,"tweenEasing":0,"value":0.4733},{"tweenEasing":0,"value":0.7433},{"tweenEasing":0,"value":0.8433},{"duration":64,"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.35},{"duration":3,"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.5367},{"tweenEasing":0,"value":0.6},{"duration":31,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":139,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":65,"tweenEasing":0,"value":0.515},{"duration":23,"tweenEasing":0,"value":0.55},{"duration":4,"tweenEasing":0,"value":0.915},{"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":0.915},{"duration":2,"tweenEasing":0,"value":0.885},{"duration":5,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.43},{"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.29},{"tweenEasing":0,"value":0.265},{"duration":31,"tweenEasing":0,"value":0.255},{"tweenEasing":0,"value":0.31},{"tweenEasing":0,"value":0.315}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":93,"tweenEasing":0,"value":0.545},{"duration":3,"tweenEasing":0,"value":0.6},{"duration":7,"tweenEasing":0,"value":0.545},{"duration":31,"tweenEasing":0,"value":0.365},{"duration":3,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.39}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":139,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":129,"tweenEasing":0,"value":0.505},{"duration":8,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.735},{"tweenEasing":0,"value":0.72}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":132,"tweenEasing":0,"value":0.7722},{"duration":5,"tweenEasing":0,"value":0.9732},{"tweenEasing":0,"value":0.9192},{"tweenEasing":0,"value":0.9062}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":84,"tweenEasing":0,"value":0.6392},{"duration":21,"tweenEasing":0,"value":0.5245},{"duration":32,"tweenEasing":0,"value":0.2512},{"tweenEasing":0,"value":0.2923},{"value":0.2997}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":61,"tweenEasing":0,"value":0.745},{"duration":8,"tweenEasing":0,"value":0.805},{"duration":18,"tweenEasing":0,"value":0.685},{"duration":6,"tweenEasing":0,"value":0.27},{"duration":44,"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.31},{"value":0.315}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.4752},{"tweenEasing":0,"value":0.4877},{"tweenEasing":0,"value":0.4883}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":136,"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.285},{"duration":2,"value":0.29}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":136,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.36},{"duration":2,"value":0.3567}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":87,"tweenEasing":0,"value":0.435},{"duration":15,"tweenEasing":0,"value":0.61},{"duration":35,"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.72},{"value":0.715}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":136,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.425},{"duration":2,"value":0.43}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":130,"tweenEasing":0,"value":0.4767},{"duration":7,"tweenEasing":0,"value":0.5433},{"tweenEasing":0,"value":0.4633},{"tweenEasing":0,"value":0.45}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.305},{"duration":3,"tweenEasing":0,"value":0.195},{"duration":129,"tweenEasing":0,"value":0.165},{"tweenEasing":0,"value":0.445},{"tweenEasing":0,"value":0.455}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.455},{"value":0.46}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":134,"tweenEasing":0,"value":0.405},{"tweenEasing":0,"value":0.5},{"duration":4,"value":0.505}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.555},{"tweenEasing":0,"value":0.55}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.44},{"duration":112,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.355}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":96,"tweenEasing":0,"value":0.5},{"duration":9,"tweenEasing":0,"value":0.44},{"duration":32,"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.385}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.58},{"value":0.58},{"duration":113,"value":0.59}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":78,"playTimes":0,"fadeInTime":0.3,"name":"pinch_in_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.005},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.58},{"duration":2,"tweenEasing":0,"value":0.83},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":4,"tweenEasing":0,"value":0.715},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.28},{"duration":2,"tweenEasing":0,"value":0.095},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.205},{"tweenEasing":0,"value":0.04},{"tweenEasing":0,"value":0.535},{"tweenEasing":0,"value":1},{"duration":7,"tweenEasing":0,"value":0.97},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":4,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.58},{"duration":15,"tweenEasing":0,"value":0.07},{"tweenEasing":0,"value":0.065},{"duration":3,"value":0.06}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":78,"value":0.675}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.5933},{"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.73},{"tweenEasing":0,"value":0.8267},{"tweenEasing":0,"value":0.8867},{"duration":30,"tweenEasing":0,"value":0.9067},{"tweenEasing":0,"value":0.8267},{"duration":2,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.3733},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3767},{"duration":2,"tweenEasing":0,"value":0.4767},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.8067},{"tweenEasing":0,"value":0.8667},{"duration":17,"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.8567},{"tweenEasing":0,"value":0.8533}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":78,"value":0.505}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":78,"value":0.305}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":73,"tweenEasing":0,"value":0.855},{"tweenEasing":0,"value":0.915},{"duration":4,"value":0.91}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.5933},{"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.8233},{"tweenEasing":0,"value":0.8833},{"duration":30,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8267},{"duration":2,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.3733},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3767},{"duration":2,"tweenEasing":0,"value":0.4767},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.8067},{"tweenEasing":0,"value":0.8667},{"duration":17,"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.8567},{"tweenEasing":0,"value":0.8533}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":78,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":20,"tweenEasing":0,"value":0.54},{"duration":18,"tweenEasing":0,"value":0.52},{"duration":2,"tweenEasing":0,"value":0.305},{"duration":7,"tweenEasing":0,"value":0.305},{"duration":12,"tweenEasing":0,"value":0.425},{"duration":3,"tweenEasing":0,"value":0.74},{"duration":12,"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.77},{"duration":3,"value":0.765}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.34},{"duration":15,"tweenEasing":0,"value":0.28},{"duration":12,"tweenEasing":0,"value":0.56},{"duration":23,"tweenEasing":0,"value":0.87},{"duration":7,"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.99},{"duration":2,"value":0.985}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":78,"value":0.51}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":76,"tweenEasing":0,"value":0.5833},{"tweenEasing":0,"value":0.5963},{"tweenEasing":0,"value":0.5995}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.4947},{"duration":23,"tweenEasing":0,"value":0.5628},{"duration":41,"tweenEasing":0,"value":0.983},{"tweenEasing":0,"value":0.983},{"value":0.98}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":75,"tweenEasing":0,"value":0.855},{"tweenEasing":0,"value":0.915},{"duration":2,"value":0.91}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":43,"tweenEasing":0,"value":0.4833},{"duration":19,"tweenEasing":0,"value":0.409},{"duration":14,"tweenEasing":0,"value":0.6238},{"tweenEasing":0,"value":0.6174},{"tweenEasing":0,"value":0.6163}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":59,"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.4},{"duration":18,"value":0.405}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":78,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":59,"tweenEasing":0,"value":0.475},{"tweenEasing":0,"value":0.455},{"duration":18,"value":0.46}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.485},{"duration":27,"tweenEasing":0,"value":0.435},{"tweenEasing":0,"value":0.57},{"duration":6,"value":0.565}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.21}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":76,"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.375},{"value":0.38}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":78,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":14,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":55,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":12,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":78,"value":0.51}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":76,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.235},{"value":0.23}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":84,"playTimes":0,"fadeInTime":0.3,"name":"pinch_in_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.225},{"duration":4,"tweenEasing":0,"value":0.635},{"duration":2,"tweenEasing":0,"value":0.66},{"duration":2,"tweenEasing":0,"value":0.175},{"duration":26,"tweenEasing":0,"value":0.015},{"duration":4,"tweenEasing":0,"value":0.22},{"duration":2,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.54},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":10,"tweenEasing":0,"value":0.51},{"duration":2,"tweenEasing":0,"value":0.895},{"duration":3,"tweenEasing":0,"value":0.22},{"tweenEasing":0,"value":0.055},{"duration":4}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.68},{"value":0.68},{"duration":20,"value":0.675}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.92},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5133},{"tweenEasing":0,"value":0.3833},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.7933},{"duration":11,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.81},{"duration":16,"value":0.8133}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":20,"value":0.505}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":20,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.31},{"value":0.31},{"duration":20,"value":0.305}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":53,"tweenEasing":0,"value":0.71},{"duration":29,"tweenEasing":0,"value":0.975},{"tweenEasing":0,"value":0.945},{"value":0.94}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5133},{"tweenEasing":0,"value":0.3833},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.7933},{"duration":28,"value":0.81}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":65,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":73,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.565},{"duration":10,"value":0.56}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.815},{"tweenEasing":0,"value":0.685},{"value":0.68}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.515},{"value":0.515},{"duration":20,"value":0.51}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.7602},{"duration":39,"tweenEasing":0,"value":0.9083},{"duration":27,"tweenEasing":0,"value":0.9885},{"tweenEasing":0,"value":0.5877},{"tweenEasing":0,"value":0.5845},{"duration":8,"value":0.5833}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.4067},{"tweenEasing":0,"value":0.4395},{"tweenEasing":0,"value":0.4405}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":53,"tweenEasing":0,"value":0.71},{"duration":29,"tweenEasing":0,"value":0.975},{"tweenEasing":0,"value":0.945},{"value":0.94}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.4908},{"tweenEasing":0,"value":0.4751},{"duration":2,"value":0.4752}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":72,"tweenEasing":0,"value":0.29},{"tweenEasing":0,"value":0.375},{"duration":11,"value":0.38}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.3333},{"value":0.3333},{"duration":20,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":64,"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.48},{"duration":19,"value":0.475}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":61,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.48},{"duration":22,"value":0.485}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.21}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.54},{"value":0.535}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.44},{"value":0.44},{"duration":20,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":84,"value":0.505}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.51},{"value":0.51},{"value":0.505}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.515},{"value":0.515},{"duration":20,"value":0.51}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.35},{"duration":3,"value":0.355}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":20,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":85,"playTimes":0,"fadeInTime":0.5,"name":"shake_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":6,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":4,"tweenEasing":0,"value":0.12},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.575},{"duration":6,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":4,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.19},{"duration":10,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.025},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":4,"tweenEasing":0,"value":0.275},{"duration":2,"tweenEasing":0,"value":0.995},{"duration":2,"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.445},{"duration":4,"tweenEasing":0,"value":0.995},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.7},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":7,"tweenEasing":0,"value":0.045},{"tweenEasing":0,"value":0.055},{"duration":2,"value":0.06}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":78,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.28},{"duration":6,"value":0.275}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7167},{"duration":3,"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.88},{"duration":5,"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.8767},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.7167},{"tweenEasing":0,"value":0.5033},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.85},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"duration":2,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.8033},{"duration":32,"tweenEasing":0,"value":0.7633},{"tweenEasing":0,"value":0.77},{"duration":7,"value":0.7733}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.47},{"value":0.465}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.35},{"duration":2,"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.03},{"duration":65,"tweenEasing":0},{"tweenEasing":0,"value":0.17},{"tweenEasing":0,"value":0.175}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.415},{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.735},{"tweenEasing":0,"value":0.805},{"duration":39,"tweenEasing":0,"value":0.83},{"duration":26,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.625},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.305},{"duration":2,"tweenEasing":0,"value":0.245},{"tweenEasing":0,"value":0.085},{"tweenEasing":0,"value":0.025},{"duration":65,"tweenEasing":0},{"tweenEasing":0,"value":0.225},{"tweenEasing":0,"value":0.23}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"duration":3,"tweenEasing":0,"value":0.46},{"duration":4,"tweenEasing":0,"value":0.35},{"duration":15,"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.495},{"duration":48,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.7233},{"tweenEasing":0,"value":0.7367},{"duration":4,"tweenEasing":0,"value":0.75},{"tweenEasing":0,"value":0.8833},{"duration":5,"tweenEasing":0,"value":0.8967},{"tweenEasing":0,"value":0.87},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.4967},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.8533},{"tweenEasing":0,"value":0.9067},{"tweenEasing":0,"value":0.7633},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.8633},{"tweenEasing":0,"value":0.9067},{"duration":2,"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.8033},{"duration":40,"value":0.7867}]},{"name":"PARAM_DESK","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.465},{"tweenEasing":0,"value":0.455},{"tweenEasing":0,"value":0.475},{"tweenEasing":0,"value":0.51},{"duration":2,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.51},{"duration":64,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.34},{"tweenEasing":0,"value":0.3},{"duration":18,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.5},{"duration":48,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.29},{"duration":5,"tweenEasing":0,"value":0.265},{"duration":61,"tweenEasing":0,"value":0.355},{"tweenEasing":0,"value":0.455},{"duration":5,"value":0.46}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.48},{"tweenEasing":0,"value":0.46},{"duration":2,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.23},{"duration":10,"tweenEasing":0,"value":0.21},{"duration":15,"tweenEasing":0,"value":0.31},{"duration":31,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.495},{"duration":10,"value":0.49}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.715},{"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.785},{"duration":17,"tweenEasing":0,"value":0.785},{"tweenEasing":0,"value":0.51},{"duration":48,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.515},{"duration":3,"value":0.52}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.8623},{"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.8647},{"duration":2,"tweenEasing":0,"value":0.8193},{"tweenEasing":0,"value":0.6985},{"tweenEasing":0,"value":0.6527},{"duration":65,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.5842},{"value":0.5833}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.5142},{"tweenEasing":0,"value":0.4923},{"value":0.4922}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.575},{"duration":2,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.875},{"duration":65,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.635},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.5272},{"tweenEasing":0,"value":0.5277},{"tweenEasing":0,"value":0.5273}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.125},{"duration":2,"tweenEasing":0,"value":0.19},{"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.415},{"duration":55,"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.265},{"duration":11,"value":0.26}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":7,"tweenEasing":0,"value":0.28},{"duration":3,"tweenEasing":0,"value":0.2833},{"duration":7,"tweenEasing":0,"value":0.3333},{"duration":65,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.3067},{"duration":2,"value":0.3033}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.38},{"duration":4,"tweenEasing":0,"value":0.38},{"duration":64,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.37},{"duration":3,"value":0.365}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.705},{"duration":4,"tweenEasing":0,"value":0.695},{"tweenEasing":0,"value":0.56},{"duration":61,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.57},{"duration":5,"value":0.575}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":10,"tweenEasing":0,"value":0.3233},{"duration":7,"tweenEasing":0,"value":0.34},{"duration":66,"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.29},{"tweenEasing":0,"value":0.2867}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.36},{"duration":3,"value":0.365}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.415},{"tweenEasing":0,"value":0.42},{"duration":4,"tweenEasing":0,"value":0.435},{"tweenEasing":0,"value":0.575},{"duration":16,"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.56},{"duration":50,"value":0.555}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.48},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.335},{"duration":18,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.49},{"duration":48,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.73},{"tweenEasing":0,"value":0.785},{"duration":4,"tweenEasing":0,"value":0.81},{"duration":13,"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.51},{"duration":48,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.485},{"duration":3,"tweenEasing":0,"value":0.455},{"tweenEasing":0,"value":0.345},{"duration":61,"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.475},{"duration":5,"value":0.47}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":2,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":70,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":11,"value":0.505}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.015},{"tweenEasing":0},{"tweenEasing":0,"value":0.065},{"duration":2,"tweenEasing":0,"value":0.22},{"tweenEasing":0,"value":0.625},{"tweenEasing":0,"value":0.78},{"tweenEasing":0,"value":0.845},{"duration":24,"tweenEasing":0,"value":0.845},{"duration":39,"tweenEasing":0,"value":0.39},{"tweenEasing":0,"value":0.245},{"duration":2,"value":0.24}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.475},{"duration":2,"value":0.47}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":86,"playTimes":0,"fadeInTime":0.5,"name":"shake_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":20,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":4,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.95},{"duration":4,"tweenEasing":0,"value":0.8},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":4,"tweenEasing":0,"value":0.205},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":4,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.085},{"duration":2,"tweenEasing":0,"value":0.125},{"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.84},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.59},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.81},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.445},{"duration":6,"tweenEasing":0,"value":0.77},{"duration":2,"tweenEasing":0,"value":0.755},{"tweenEasing":0,"value":0.15},{"tweenEasing":0,"value":0.085},{"duration":4,"value":0.025}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":86,"value":0.68}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.74},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3533},{"duration":2,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5333},{"tweenEasing":0,"value":0.5833},{"tweenEasing":0,"value":0.6167},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.5467},{"duration":3,"tweenEasing":0,"value":0.4633},{"tweenEasing":0,"value":0.1633},{"tweenEasing":0,"value":0.08},{"tweenEasing":0,"value":0.02},{"duration":24,"tweenEasing":0},{"tweenEasing":0},{"duration":37,"value":0.0033}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.305},{"value":0.305},{"duration":48,"value":0.31}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.76},{"duration":5,"tweenEasing":0,"value":0.75},{"duration":10,"tweenEasing":0,"value":0.65},{"duration":4,"tweenEasing":0,"value":0.37},{"duration":28,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.3},{"duration":33,"value":0.295}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.185},{"tweenEasing":0,"value":0.35},{"duration":51,"value":0.355}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"duration":2,"tweenEasing":0,"value":0.6567},{"tweenEasing":0,"value":0.4367},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3533},{"duration":2,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5333},{"tweenEasing":0,"value":0.5833},{"tweenEasing":0,"value":0.6167},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.5467},{"duration":3,"tweenEasing":0,"value":0.4633},{"tweenEasing":0,"value":0.1633},{"tweenEasing":0,"value":0.08},{"tweenEasing":0,"value":0.02},{"duration":24,"tweenEasing":0},{"tweenEasing":0},{"duration":37,"value":0.0033}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":77,"tweenEasing":0,"value":0.415},{"tweenEasing":0,"value":0.475},{"duration":8,"value":0.48}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.565},{"tweenEasing":0,"value":0.62},{"duration":22,"value":0.625}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.49}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":84,"tweenEasing":0,"value":0.6675},{"tweenEasing":0,"value":0.6802},{"tweenEasing":0,"value":0.6773}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.5703},{"duration":16,"tweenEasing":0,"value":0.5522},{"duration":63,"tweenEasing":0,"value":0.1095},{"tweenEasing":0,"value":0.2483},{"tweenEasing":0,"value":0.256}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.765},{"duration":6,"tweenEasing":0,"value":0.755},{"duration":8,"tweenEasing":0,"value":0.62},{"duration":5,"tweenEasing":0,"value":0.375},{"duration":18,"tweenEasing":0,"value":0.31},{"tweenEasing":0,"value":0.305},{"duration":43,"value":0.3}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":64,"tweenEasing":0,"value":0.5517},{"tweenEasing":0,"value":0.5168},{"duration":21,"value":0.5167}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":48,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.425},{"duration":3,"tweenEasing":0,"value":0.355},{"duration":53,"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.36},{"duration":4,"value":0.355}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.4},{"duration":51,"value":0.405}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.485},{"duration":52,"value":0.49}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.2067},{"duration":15,"tweenEasing":0,"value":0.2267},{"duration":63,"tweenEasing":0,"value":0.5633},{"tweenEasing":0,"value":0.51},{"value":0.4967}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.77},{"tweenEasing":0,"value":0.765},{"duration":2,"value":0.76}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.44},{"value":0.44},{"duration":48,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":86,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":86,"value":0.48}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":7,"tweenEasing":0,"value":0.465},{"duration":13,"tweenEasing":0,"value":0.495},{"duration":3,"tweenEasing":0,"value":0.775},{"duration":46,"tweenEasing":0,"value":0.805},{"tweenEasing":0,"value":0.585},{"duration":16,"value":0.58}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":101,"playTimes":0,"fadeInTime":0.5,"name":"shake_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.09},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":4,"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.91},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.375},{"duration":2,"tweenEasing":0,"value":0.07},{"duration":2,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":4,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.605},{"duration":2,"tweenEasing":0,"value":0.44},{"duration":6,"tweenEasing":0,"value":0.07},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.135},{"duration":4,"tweenEasing":0,"value":0.99},{"duration":2,"tweenEasing":0,"value":0.675},{"duration":2,"tweenEasing":0,"value":0.95},{"tweenEasing":0,"value":0.83},{"tweenEasing":0,"value":0.955},{"tweenEasing":0,"value":1},{"duration":3,"tweenEasing":0,"value":0.96},{"duration":2,"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.745},{"duration":2,"tweenEasing":0,"value":0.95},{"duration":2,"tweenEasing":0,"value":0.72},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":12,"tweenEasing":0,"value":0.125},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.06},{"tweenEasing":0,"value":0.015}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.305},{"duration":56,"value":0.3}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7167},{"duration":3,"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.88},{"duration":5,"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.8767},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.7167},{"tweenEasing":0,"value":0.5033},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.85},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"duration":2,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8733},{"tweenEasing":0,"value":0.82},{"duration":18,"tweenEasing":0,"value":0.78},{"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.4367},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.6767},{"duration":25,"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.6867},{"duration":13,"value":0.69}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":86,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.495},{"duration":14,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.35},{"duration":2,"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.03},{"duration":40,"tweenEasing":0},{"tweenEasing":0,"value":0.165},{"duration":53,"value":0.17}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.555},{"tweenEasing":0,"value":0.735},{"tweenEasing":0,"value":0.8},{"duration":17,"tweenEasing":0,"value":0.83},{"duration":10,"tweenEasing":0,"value":0.76},{"duration":12,"tweenEasing":0,"value":0.585},{"duration":3,"tweenEasing":0,"value":0.2},{"duration":14,"tweenEasing":0,"value":0.145},{"duration":24,"tweenEasing":0,"value":0.215},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.49},{"duration":12,"value":0.495}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.305},{"duration":2,"tweenEasing":0,"value":0.245},{"tweenEasing":0,"value":0.085},{"tweenEasing":0,"value":0.025},{"duration":41,"tweenEasing":0},{"tweenEasing":0,"value":0.015},{"duration":52,"value":0.01}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"duration":3,"tweenEasing":0,"value":0.46},{"duration":4,"tweenEasing":0,"value":0.35},{"duration":15,"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.495},{"duration":75,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.7367},{"tweenEasing":0,"value":0.7367},{"tweenEasing":0,"value":0.7533},{"duration":2,"tweenEasing":0,"value":0.7867},{"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.92},{"duration":3,"tweenEasing":0,"value":0.9367},{"duration":2,"tweenEasing":0,"value":0.9267},{"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.8533},{"tweenEasing":0,"value":0.9067},{"tweenEasing":0,"value":0.7633},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.8633},{"tweenEasing":0,"value":0.9067},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":18,"tweenEasing":0,"value":0.8033},{"tweenEasing":0,"value":0.6533},{"duration":2,"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4067},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3233},{"tweenEasing":0,"value":0.3533},{"duration":2,"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.68},{"duration":31,"tweenEasing":0,"value":0.71},{"tweenEasing":0,"value":0.68},{"duration":7,"value":0.6833}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.465},{"tweenEasing":0,"value":0.455},{"tweenEasing":0,"value":0.475},{"tweenEasing":0,"value":0.51},{"duration":2,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.51},{"duration":91,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.34},{"tweenEasing":0,"value":0.3},{"duration":18,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.5},{"duration":75,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":2,"tweenEasing":0,"value":0.26},{"duration":5,"tweenEasing":0,"value":0.265},{"duration":27,"tweenEasing":0,"value":0.355},{"duration":5,"tweenEasing":0,"value":0.43},{"duration":8,"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.725},{"duration":5,"tweenEasing":0,"value":0.675},{"tweenEasing":0,"value":0.39},{"tweenEasing":0,"value":0.355},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.37},{"duration":5,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.705},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.765},{"duration":2,"tweenEasing":0,"value":0.775},{"duration":14,"tweenEasing":0,"value":0.765},{"duration":2,"tweenEasing":0,"value":0.51},{"tweenEasing":0,"value":0.505},{"duration":9,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.48},{"tweenEasing":0,"value":0.455},{"duration":2,"tweenEasing":0,"value":0.405},{"tweenEasing":0,"value":0.275},{"tweenEasing":0,"value":0.23},{"duration":10,"tweenEasing":0,"value":0.21},{"duration":15,"tweenEasing":0,"value":0.31},{"duration":20,"tweenEasing":0,"value":0.5},{"duration":8,"tweenEasing":0,"value":0.44},{"duration":2,"tweenEasing":0,"value":0.575},{"duration":2,"tweenEasing":0,"value":0.585},{"duration":7,"tweenEasing":0,"value":0.57},{"duration":27,"tweenEasing":0,"value":0.445},{"tweenEasing":0,"value":0.535},{"duration":2,"value":0.54}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.715},{"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.785},{"duration":17,"tweenEasing":0,"value":0.785},{"tweenEasing":0,"value":0.51},{"duration":75,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.5},{"duration":18,"tweenEasing":0,"value":0.48},{"duration":9,"tweenEasing":0,"value":0.155},{"duration":26,"tweenEasing":0,"value":0.145},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"duration":9,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"tweenEasing":0,"value":0.889},{"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.8603},{"duration":2,"tweenEasing":0,"value":0.8137},{"tweenEasing":0,"value":0.695},{"tweenEasing":0,"value":0.6513},{"duration":82,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.5835},{"duration":11,"value":0.5833}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.5167},{"duration":3,"tweenEasing":0,"value":0.4937},{"duration":10,"tweenEasing":0,"value":0.4317},{"duration":2,"tweenEasing":0,"value":0.0618},{"duration":27,"tweenEasing":0,"value":0.0168},{"duration":14,"tweenEasing":0,"value":0.0143},{"duration":3,"tweenEasing":0,"value":0.3167},{"duration":6,"tweenEasing":0,"value":0.3985},{"tweenEasing":0,"value":0.4493},{"tweenEasing":0,"value":0.45}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.57},{"duration":2,"tweenEasing":0,"value":0.635},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.875},{"duration":19,"tweenEasing":0,"value":0.9},{"duration":8,"tweenEasing":0,"value":0.815},{"duration":13,"tweenEasing":0,"value":0.67},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":25,"tweenEasing":0,"value":0.095},{"duration":13,"tweenEasing":0,"value":0.145},{"duration":5,"tweenEasing":0,"value":0.465},{"tweenEasing":0,"value":0.49},{"duration":8,"value":0.495}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":36,"tweenEasing":0,"value":0.5333},{"duration":14,"tweenEasing":0,"value":0.5185},{"tweenEasing":0,"value":0.3351},{"tweenEasing":0,"value":0.3333},{"duration":8,"tweenEasing":0,"value":0.343},{"tweenEasing":0,"value":0.611},{"tweenEasing":0,"value":0.6273},{"tweenEasing":0,"value":0.6333},{"duration":8,"tweenEasing":0,"value":0.6237},{"tweenEasing":0,"value":0.3557},{"duration":17,"tweenEasing":0,"value":0.3393},{"tweenEasing":0,"value":0.4985},{"duration":11,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"duration":79,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.495},{"duration":21,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.13},{"duration":2,"tweenEasing":0,"value":0.2},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.45},{"duration":45,"tweenEasing":0,"value":0.48},{"duration":46,"tweenEasing":0,"value":0.24},{"tweenEasing":0,"value":0.275},{"duration":2,"value":0.28}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.36},{"duration":42,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.3467},{"duration":52,"value":0.3433}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":2,"tweenEasing":0,"value":0.375},{"duration":4,"tweenEasing":0,"value":0.38},{"duration":80,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.43},{"duration":14,"value":0.435}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.71},{"tweenEasing":0,"value":0.705},{"duration":4,"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.56},{"duration":28,"tweenEasing":0,"value":0.55},{"duration":15,"tweenEasing":0,"value":0.56},{"duration":3,"tweenEasing":0,"value":0.365},{"duration":7,"tweenEasing":0,"value":0.38},{"duration":2,"tweenEasing":0,"value":0.5},{"duration":11,"tweenEasing":0,"value":0.51},{"duration":25,"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.565},{"duration":2,"value":0.57}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.35},{"duration":84,"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.5767},{"duration":10,"value":0.5733}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":99,"tweenEasing":0,"value":0.27},{"tweenEasing":0,"value":0.35},{"value":0.355}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.42},{"duration":2,"tweenEasing":0,"value":0.43},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.575},{"duration":16,"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.56},{"duration":77,"value":0.555}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.48},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.335},{"duration":18,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.49},{"duration":75,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.73},{"tweenEasing":0,"value":0.785},{"duration":4,"tweenEasing":0,"value":0.81},{"duration":13,"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.51},{"duration":75,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.47},{"duration":2,"tweenEasing":0,"value":0.395},{"tweenEasing":0,"value":0.195},{"tweenEasing":0,"value":0.12},{"tweenEasing":0,"value":0.09},{"duration":23,"tweenEasing":0,"value":0.09},{"duration":14,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495},{"duration":55,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.5},{"duration":4,"tweenEasing":0,"value":0.485},{"duration":8,"tweenEasing":0,"value":0.4},{"duration":4,"tweenEasing":0,"value":0.155},{"duration":23,"tweenEasing":0,"value":0.105},{"duration":5,"tweenEasing":0,"value":0.105},{"duration":7,"tweenEasing":0,"value":0.225},{"duration":3,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.495},{"duration":11,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"value":0.05},{"duration":2,"tweenEasing":0,"value":0.18},{"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.645},{"duration":4,"tweenEasing":0,"value":0.695},{"duration":21,"tweenEasing":0,"value":0.675},{"duration":33,"tweenEasing":0,"value":0.385},{"duration":22,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.31},{"duration":13,"value":0.305}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":124,"playTimes":0,"fadeInTime":0.3,"name":"pinch_out_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":11,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.76},{"duration":4,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.305},{"duration":2,"tweenEasing":0,"value":0.235},{"duration":4,"tweenEasing":0,"value":0.92},{"duration":14,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.155},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.11},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.55},{"duration":4,"tweenEasing":0,"value":0.885},{"tweenEasing":0,"value":0.07},{"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":4,"tweenEasing":0,"value":0.29},{"duration":6,"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.555},{"duration":2,"tweenEasing":0,"value":1},{"duration":6,"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.745},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.025},{"duration":12,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.77},{"duration":15,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.11},{"tweenEasing":0,"value":0.115}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":124,"value":0.655}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.2967},{"duration":2,"tweenEasing":0,"value":0.3},{"duration":9,"tweenEasing":0,"value":0.3333},{"duration":8,"tweenEasing":0,"value":0.6033},{"duration":20,"tweenEasing":0,"value":0.72},{"tweenEasing":0,"value":0.7233},{"value":0.7267}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":46,"tweenEasing":0,"value":0.175},{"value":0.175},{"duration":77,"value":0.18}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":124,"value":0.635}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":124,"value":0.295}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.3033},{"tweenEasing":0,"value":0.31},{"duration":10,"tweenEasing":0,"value":0.3233},{"duration":28,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.67},{"value":0.6733}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":124,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.49},{"value":0.49},{"duration":99,"value":0.485}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":47,"tweenEasing":0,"value":0.64},{"value":0.64},{"duration":76,"value":0.645}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":122,"tweenEasing":0,"value":0.7285},{"tweenEasing":0,"value":0.4833},{"tweenEasing":0,"value":0.4838}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":122,"tweenEasing":0,"value":0.9372},{"tweenEasing":0,"value":0.7333},{"value":0.7232}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":124,"value":0.735}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":119,"tweenEasing":0,"value":0.4995},{"tweenEasing":0,"value":0.5332},{"duration":4,"value":0.5333}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":124,"value":0.445}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":46,"tweenEasing":0,"value":0.3167},{"value":0.3167},{"duration":77,"value":0.3133}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":72,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.5},{"duration":51,"value":0.495}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":115,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.58},{"duration":8,"value":0.585}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":124,"value":0.5933}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":98,"tweenEasing":0,"value":0.305},{"tweenEasing":0,"value":0.275},{"duration":25,"value":0.27}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":124,"value":0.515}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":124,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":124,"value":0.25}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":166,"playTimes":0,"fadeInTime":0.3,"name":"pinch_out_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":45,"tweenEasing":0,"value":0.065},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":6,"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.1},{"duration":2,"tweenEasing":0,"value":0.26},{"duration":8,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.69},{"duration":12,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":4,"tweenEasing":0,"value":0.665},{"duration":2,"tweenEasing":0,"value":0.95},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.555},{"duration":2,"tweenEasing":0,"value":0.84},{"duration":2,"tweenEasing":0,"value":0.165},{"duration":2,"tweenEasing":0,"value":0.55},{"duration":2,"tweenEasing":0,"value":0.72},{"duration":2,"tweenEasing":0,"value":0.68},{"duration":2,"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.44},{"duration":4,"tweenEasing":0,"value":0.085},{"duration":2,"tweenEasing":0,"value":0.11},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.87},{"duration":2,"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.335},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":4,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":4,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.955},{"duration":2,"tweenEasing":0,"value":0.705},{"tweenEasing":0,"value":0.665},{"tweenEasing":0,"value":0.355},{"duration":25,"value":0.04}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":15,"tweenEasing":0,"value":0.3},{"duration":20,"tweenEasing":0,"value":0.33},{"duration":2,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.65},{"duration":128,"value":0.655}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.31},{"tweenEasing":0,"value":0.34},{"duration":2,"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.6967},{"duration":13,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7133},{"duration":5,"tweenEasing":0,"value":0.6733},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3067},{"duration":127,"value":0.2967}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.17},{"value":0.17},{"duration":141,"value":0.175}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.375},{"duration":18,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.63},{"duration":128,"value":0.635}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":151,"tweenEasing":0,"value":0.195},{"tweenEasing":0,"value":0.3},{"duration":14,"value":0.295}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.3433},{"duration":2,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.6967},{"duration":13,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.6733},{"duration":3,"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.43},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3133},{"duration":127,"value":0.3033}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":166,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":93,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":72,"value":0.49}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":117,"tweenEasing":0,"value":0.625},{"tweenEasing":0,"value":0.63},{"duration":48,"value":0.635}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":130,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":35,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.8833},{"duration":20,"tweenEasing":0,"value":0.823},{"duration":126,"tweenEasing":0,"value":0.5843},{"tweenEasing":0,"value":0.5837},{"value":0.5845}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":164,"tweenEasing":0,"value":0.5365},{"tweenEasing":0,"value":0.8502},{"value":0.8507}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.4},{"duration":21,"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.73},{"duration":128,"value":0.735}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":164,"tweenEasing":0,"value":0.5392},{"tweenEasing":0,"value":0.5333},{"value":0.5331}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":36,"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.44},{"duration":129,"value":0.445}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.3033},{"tweenEasing":0,"value":0.3133},{"duration":133,"value":0.3167}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.475},{"duration":135,"value":0.48}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.495},{"duration":136,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":15,"tweenEasing":0,"value":0.27},{"duration":22,"tweenEasing":0,"value":0.2967},{"tweenEasing":0,"value":0.59},{"duration":128,"value":0.5933}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":1},{"duration":5,"tweenEasing":0,"value":0.99},{"duration":16,"tweenEasing":0,"value":0.89},{"duration":4,"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.32},{"duration":128,"value":0.31}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.52},{"duration":131,"value":0.515}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":161,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":4,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.255},{"duration":130,"value":0.25}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":223,"playTimes":0,"fadeInTime":0.3,"name":"pinch_out_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.125},{"duration":4,"tweenEasing":0,"value":0.895},{"duration":2,"tweenEasing":0,"value":0.81},{"duration":2,"tweenEasing":0,"value":0.36},{"duration":2,"tweenEasing":0,"value":0.41},{"duration":2,"tweenEasing":0,"value":0.94},{"duration":4,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.565},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.125},{"duration":4,"tweenEasing":0,"value":0.01},{"duration":4,"tweenEasing":0,"value":0.81},{"duration":2,"tweenEasing":0,"value":0.3},{"duration":6,"tweenEasing":0,"value":0.3},{"duration":2,"tweenEasing":0,"value":0.015},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.955},{"duration":4,"tweenEasing":0,"value":0.55},{"duration":2,"tweenEasing":0,"value":0.375},{"duration":18,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.83},{"duration":2,"tweenEasing":0,"value":0.32},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.36},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.015},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.5},{"duration":4,"tweenEasing":0,"value":0.735},{"duration":4,"tweenEasing":0,"value":0.175},{"duration":6,"tweenEasing":0,"value":0.025},{"tweenEasing":0,"value":0.04},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.955},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.375},{"duration":2,"tweenEasing":0,"value":0.485},{"duration":4,"tweenEasing":0,"value":0.085},{"duration":2,"tweenEasing":0,"value":0.135},{"duration":16,"tweenEasing":0,"value":0.01},{"duration":4,"tweenEasing":0,"value":0.11},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.94},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.69},{"duration":2,"tweenEasing":0,"value":0.94},{"duration":2,"tweenEasing":0,"value":0.72},{"duration":2,"tweenEasing":0,"value":0.87},{"duration":2,"tweenEasing":0,"value":0.84},{"duration":4,"tweenEasing":0,"value":0.205},{"duration":6,"tweenEasing":0,"value":0.9},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":11,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.09},{"tweenEasing":0,"value":0.085}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.3}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.2267},{"tweenEasing":0,"value":0.11},{"tweenEasing":0,"value":0.0333},{"duration":13,"tweenEasing":0,"value":0.0033},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":52,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.6733},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.23},{"tweenEasing":0,"value":0.1133},{"tweenEasing":0,"value":0.0333},{"duration":13,"tweenEasing":0,"value":0.0033},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":37,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7267},{"duration":2,"tweenEasing":0,"value":0.6467},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.3433},{"duration":2,"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.71},{"duration":26,"value":0.7267}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.17}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.47},{"duration":11,"tweenEasing":0,"value":0.49},{"duration":5,"tweenEasing":0,"value":0.295},{"duration":11,"tweenEasing":0,"value":0.29},{"duration":113,"tweenEasing":0,"value":0.485},{"tweenEasing":0,"value":0.38},{"duration":48,"value":0.375}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":14,"tweenEasing":0,"value":0.16},{"tweenEasing":0,"value":0.19},{"duration":208,"value":0.195}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7867},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.2233},{"tweenEasing":0,"value":0.1067},{"tweenEasing":0,"value":0.03},{"duration":13,"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":52,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.79},{"duration":3,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.2233},{"tweenEasing":0,"value":0.1067},{"tweenEasing":0,"value":0.03},{"duration":13,"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":37,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.5133},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.34},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.3433},{"duration":2,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.6867},{"duration":26,"value":0.7}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":223,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":124,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":98,"value":0.495}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":172,"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.62},{"duration":50,"value":0.625}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":223,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":148,"tweenEasing":0,"value":0.5777},{"duration":36,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.883},{"duration":38,"value":0.8833}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.7308},{"duration":2,"tweenEasing":0,"value":0.657},{"duration":9,"tweenEasing":0,"value":0.6102},{"duration":2,"tweenEasing":0,"value":0.2603},{"duration":2,"tweenEasing":0,"value":0.2158},{"tweenEasing":0,"value":0.2},{"duration":2,"tweenEasing":0,"value":0.2058},{"duration":9,"tweenEasing":0,"value":0.2482},{"duration":2,"tweenEasing":0,"value":0.6037},{"duration":55,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.6608},{"duration":9,"tweenEasing":0,"value":0.6185},{"duration":2,"tweenEasing":0,"value":0.263},{"duration":2,"tweenEasing":0,"value":0.2167},{"tweenEasing":0,"value":0.2},{"duration":2,"tweenEasing":0,"value":0.2058},{"duration":9,"tweenEasing":0,"value":0.2482},{"duration":2,"tweenEasing":0,"value":0.6037},{"duration":75,"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4127},{"tweenEasing":0,"value":0.417}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.5},{"duration":14,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.33},{"duration":14,"tweenEasing":0,"value":0.33},{"duration":110,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.405},{"duration":49,"value":0.4}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":221,"tweenEasing":0,"value":0.4835},{"tweenEasing":0,"value":0.5414},{"value":0.5413}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":178,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.34},{"duration":44,"value":0.335}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.3267},{"tweenEasing":0,"value":0.3067},{"duration":198,"value":0.3033}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":176,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.44},{"duration":46,"value":0.435}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.57},{"duration":68,"tweenEasing":0,"value":0.54},{"duration":16,"tweenEasing":0,"value":0.54},{"duration":41,"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.465},{"duration":41,"value":0.46}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":155,"tweenEasing":0,"value":0.2833},{"tweenEasing":0,"value":0.2733},{"duration":67,"value":0.27}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":51,"tweenEasing":0,"value":0.88},{"duration":68,"tweenEasing":0,"value":0.99},{"duration":14,"tweenEasing":0,"value":0.905},{"duration":18,"tweenEasing":0,"value":1},{"duration":30,"tweenEasing":0,"value":0.895},{"tweenEasing":0,"value":0.995},{"duration":41,"value":1}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":155,"tweenEasing":0,"value":0.555},{"value":0.555},{"duration":67,"value":0.56}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":223,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":38,"tweenEasing":0,"value":0.305},{"duration":16,"tweenEasing":0,"value":0.31},{"duration":68,"tweenEasing":0,"value":0.285},{"duration":16,"tweenEasing":0,"value":0.31},{"duration":8,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.33},{"duration":76,"value":0.335}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":53,"playTimes":0,"fadeInTime":0.3,"name":"tap_body_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":11,"tweenEasing":0,"value":0.06},{"duration":2,"tweenEasing":0,"value":0.065},{"duration":2,"tweenEasing":0,"value":0.32},{"duration":4,"tweenEasing":0,"value":0.91},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":4,"tweenEasing":0,"value":0.41},{"duration":2,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":6,"tweenEasing":0,"value":0.91},{"duration":2,"tweenEasing":0,"value":0.8},{"duration":2,"tweenEasing":0,"value":0.555},{"duration":3,"tweenEasing":0,"value":0.19},{"tweenEasing":0,"value":0.045},{"duration":4}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":53,"value":0.455}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.0033},{"tweenEasing":0},{"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.04},{"tweenEasing":0,"value":0.0867},{"duration":7,"tweenEasing":0,"value":0.1467},{"tweenEasing":0,"value":0.6667},{"duration":2,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.8333},{"duration":21,"value":0.84}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":48,"tweenEasing":0,"value":0.23},{"value":0.23},{"duration":4,"value":0.235}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.75},{"duration":11,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.535},{"duration":22,"value":0.525}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":41,"tweenEasing":0,"value":0.22},{"tweenEasing":0,"value":0.23},{"duration":11,"value":0.235}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":17,"tweenEasing":0,"value":0.0033},{"tweenEasing":0,"value":0.0133},{"tweenEasing":0,"value":0.0467},{"tweenEasing":0,"value":0.0933},{"duration":7,"tweenEasing":0,"value":0.15},{"duration":2,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.7767},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.8333},{"duration":21,"value":0.84}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.6},{"duration":23,"value":0.605}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.625},{"duration":11,"tweenEasing":0,"value":0.61},{"duration":2,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.345},{"duration":21,"value":0.34}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"tweenEasing":0,"value":0.6328},{"tweenEasing":0,"value":0.6332},{"duration":51,"value":0.6333}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":4,"tweenEasing":0,"value":0.483},{"duration":10,"tweenEasing":0,"value":0.4697},{"duration":3,"tweenEasing":0,"value":0.2932},{"duration":12,"tweenEasing":0,"value":0.2872},{"duration":2,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.5807},{"duration":21,"value":0.5833}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.75},{"duration":11,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.535},{"duration":22,"value":0.525}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":53,"value":0.24}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":36,"tweenEasing":0,"value":0.2167},{"value":0.2133},{"duration":16,"value":0.2167}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":53,"value":0.455}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":51,"tweenEasing":0,"value":0.2033},{"tweenEasing":0,"value":0.18},{"value":0.1767}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":22,"tweenEasing":0,"value":0.89},{"tweenEasing":0,"value":0.91},{"duration":30,"value":0.915}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":50,"tweenEasing":0,"value":0.685},{"tweenEasing":0,"value":0.665},{"duration":2,"value":0.66}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":8,"value":0.495}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.625},{"duration":11,"tweenEasing":0,"value":0.61},{"duration":2,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.345},{"duration":21,"value":0.34}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":28,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.535},{"duration":24,"value":0.54}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.59}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":100,"playTimes":0,"fadeInTime":0.3,"name":"tap_body_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":23,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":4,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.645},{"duration":2,"tweenEasing":0,"value":0.605},{"duration":2,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.705},{"duration":2,"tweenEasing":0,"value":0.55},{"duration":2,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.61},{"duration":2,"tweenEasing":0,"value":0.25},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":4,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.425},{"duration":2,"tweenEasing":0,"value":0.355},{"duration":2,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.625},{"duration":2,"tweenEasing":0,"value":0.47},{"duration":4,"tweenEasing":0,"value":0.77},{"duration":25,"tweenEasing":0,"value":0.055},{"tweenEasing":0,"value":0.055},{"tweenEasing":0,"value":0.06}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":22,"tweenEasing":0,"value":0.585},{"duration":17,"tweenEasing":0,"value":0.705},{"duration":17,"tweenEasing":0,"value":0.6},{"duration":41,"tweenEasing":0,"value":0.705},{"tweenEasing":0,"value":0.6},{"duration":2,"value":0.595}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":21,"tweenEasing":0,"value":0.75},{"tweenEasing":0,"value":0.7667},{"duration":2,"tweenEasing":0,"value":0.6867},{"tweenEasing":0,"value":0.4433},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3267},{"tweenEasing":0,"value":0.3533},{"duration":3,"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":16,"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5633},{"tweenEasing":0,"value":0.4467},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":35,"tweenEasing":0,"value":0.7567},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.73}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":100,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":98,"tweenEasing":0,"value":0.13},{"tweenEasing":0,"value":0.005},{"value":0.01}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":17,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.745},{"duration":82,"value":0.75}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":96,"tweenEasing":0,"value":0.145},{"tweenEasing":0},{"duration":3,"value":0.005}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":21,"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5633},{"tweenEasing":0,"value":0.4467},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":16,"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.7667},{"duration":2,"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.36},{"duration":3,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":35,"tweenEasing":0,"value":0.7567},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.73}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":100,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":62,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":37,"value":0.495}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.52},{"tweenEasing":0,"value":0.535},{"duration":32,"value":0.54}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":100,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":65,"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.615},{"duration":34,"value":0.62}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":98,"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.5518},{"value":0.5528}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":23,"tweenEasing":0,"value":0.6268},{"duration":13,"tweenEasing":0,"value":0.6552},{"duration":3,"tweenEasing":0,"value":0.4253},{"duration":14,"tweenEasing":0,"value":0.4198},{"duration":3,"tweenEasing":0,"value":0.658},{"duration":13,"tweenEasing":0,"value":0.6635},{"duration":29,"tweenEasing":0,"value":0.4255},{"tweenEasing":0,"value":0.4182},{"value":0.419}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":62,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":0.755},{"duration":37,"value":0.75}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":47,"tweenEasing":0,"value":0.41},{"duration":13,"tweenEasing":0,"value":0.395},{"duration":37,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.36},{"duration":2,"value":0.355}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.5733},{"duration":7,"tweenEasing":0,"value":0.9567},{"duration":17,"tweenEasing":0,"value":0.9867},{"duration":17,"tweenEasing":0,"value":0.9},{"duration":41,"tweenEasing":0,"value":0.9867},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.8733}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.525},{"duration":32,"value":0.52}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.49},{"duration":99,"value":0.495}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":15,"tweenEasing":0,"value":0.4867},{"duration":7,"tweenEasing":0,"value":0.9233},{"duration":18,"tweenEasing":0,"value":0.98},{"duration":17,"tweenEasing":0,"value":0.8867},{"duration":41,"tweenEasing":0,"value":0.9767},{"tweenEasing":0,"value":0.8667},{"tweenEasing":0,"value":0.86}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":68,"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.86},{"duration":31,"value":0.855}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":28,"tweenEasing":0,"value":0.695},{"duration":17,"tweenEasing":0,"value":0.74},{"duration":15,"tweenEasing":0,"value":0.72},{"duration":9,"tweenEasing":0,"value":0.75},{"tweenEasing":0,"value":0.695},{"duration":30,"value":0.69}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":28,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":71,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":62,"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.62},{"duration":37,"value":0.625}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":65,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.495},{"duration":34,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":100,"value":0.59}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":83,"playTimes":0,"fadeInTime":0.3,"name":"tap_body_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":4,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":6,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.715},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":8,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.995},{"duration":6,"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.44},{"duration":2,"tweenEasing":0,"value":0.48},{"duration":10,"tweenEasing":0,"value":0.7},{"duration":2,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":4,"tweenEasing":0,"value":0.885},{"duration":4,"tweenEasing":0,"value":0.5},{"duration":4,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.61},{"duration":6,"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.06},{"duration":2,"value":0.055}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.675}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":4,"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.75},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3767},{"duration":2,"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.84},{"duration":40,"tweenEasing":0,"value":0.86},{"duration":2,"tweenEasing":0,"value":0.85},{"duration":2,"tweenEasing":0,"value":0.8},{"duration":9,"tweenEasing":0,"value":0.7133},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":2,"tweenEasing":0,"value":0.0967},{"duration":5,"tweenEasing":0,"value":0.0433},{"tweenEasing":0,"value":0.0033},{"duration":3}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":83,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.445},{"tweenEasing":0,"value":0.49},{"value":0.495}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.305}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.435},{"duration":14,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.115},{"value":0.11}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":4,"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.75},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3733},{"duration":2,"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.84},{"duration":40,"tweenEasing":0,"value":0.86},{"duration":2,"tweenEasing":0,"value":0.85},{"duration":2,"tweenEasing":0,"value":0.8},{"duration":9,"tweenEasing":0,"value":0.7133},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":2,"tweenEasing":0,"value":0.0967},{"duration":5,"tweenEasing":0,"value":0.0433},{"tweenEasing":0,"value":0.0033},{"duration":3}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":83,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":83,"value":0.43}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":78,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.6},{"duration":4,"value":0.605}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.415},{"duration":7,"tweenEasing":0,"value":0.34},{"duration":65,"tweenEasing":0,"value":0.24},{"tweenEasing":0,"value":0.37},{"duration":2,"value":0.375}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.5313},{"tweenEasing":0,"value":0.5187},{"value":0.5182}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.4487},{"duration":2,"tweenEasing":0,"value":0.444},{"duration":7,"tweenEasing":0,"value":0.4032},{"duration":2,"tweenEasing":0,"value":0.172},{"tweenEasing":0,"value":0.15},{"tweenEasing":0,"value":0.1575},{"duration":8,"tweenEasing":0,"value":0.1778},{"duration":2,"tweenEasing":0,"value":0.4965},{"duration":53,"tweenEasing":0,"value":0.5408},{"tweenEasing":0,"value":0.5653},{"tweenEasing":0,"value":0.563}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.44},{"duration":14,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.115},{"value":0.11}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.4998},{"tweenEasing":0,"value":0.5148},{"value":0.5153}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":79,"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.415},{"duration":3,"value":0.42}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":71,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":11,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":77,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495},{"duration":5,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.21}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.775},{"duration":2,"value":0.78}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":83,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":69,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.415},{"duration":6,"tweenEasing":0,"value":0.34},{"duration":67,"tweenEasing":0,"value":0.25},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.385}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.48},{"value":0.485}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_DESK","timeline":[{"name":"B_BACKGROUND.01","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-8},{"duration":60,"tweenEasing":0},{"x":8}]},{"name":"D_BACKGROUND.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[2,40,0,46,0,24,-1.33,14.67,-5.33,-42,0,0,-2,-22.67,0,-23.33,0,-42.67,0,-39.33,2,-20,0,-10,2,-12,0,-12,1.33,-24,2.67,-22,0,0,0,-84,0,-24,0,-33.33,0,-50,2,-20,0,14,8,-26,0,-22,0,-18,0,30,0,-14,5.33,-25.33,0,-16,2.67,-42.67,0,-18,0,24,0,-32,-2,-3.33,2,-24,-4,-3.33,4,-11.33,1.18,-34.2,0.28,-25.14,-0.95,-33.9,1.23,-36,1.33,-28.25,0.48,-9.97,-1.5,7.92,1.11,-21.85,2.66,-14.66,1.47,24.54,-2.88,-3.33,1.01,32.11,0.15,10.4,2.45,-4.02,2.66,-18,0.71,-21.2,1.44,-30.4,-0.61,-2.06,6.6,-25.65,4.28,-9.8,-0.87,14.43,3.31,-2.54]},{"duration":60,"tweenEasing":0,"offset":119},{"offset":1,"value":[-20,0,-26,0,-72,-1.67,-22.67,10,22,0,6,0,14,0,18,0,12,0,12,0,42,4,40,0,20,0,8,0,30,0,18,0,40,0,24,0,16,0,18,0,20,0,0,-1,-41,8,10,0,26,0,0,0,-58,0,0,4,-12,-2,2,2,16,-1,34,0,-40,0,30,-3,10,0,38,0,8,0,28,0,10,0,14,0,12,0,26,2,8,0,14,0,2,-1,22.67,-1,14,0,-5.61,1.12,9.12,0,-29.86,-4.78,-29.18,-0.33,-20.59,0,-6.99,-2.86,5.2,0.16,9.56,-3.82,-16.19,5.9,-1.54,2.42,-9.12,-2.56,-37.16,0.31,-7.28]}]},{"name":"D_BACKGROUND.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[-17.33,-1.33,10.67,0,9.33,0,12,1.33,16,1.33,-48,0,-28,0,-25.33,0,-9.33,0,-9.33,0,-17.33]},{"duration":60,"tweenEasing":0,"offset":21},{"value":[-3,19.67,0,-16,0,-8,0,-12,0,-18.67,0,4,0,28,-2.67,40,0,5.33,0,13.33,0,8]}]},{"name":"D_BACKGROUND.06","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[-25.33,0,-25.33,0,-25.33,0,-25.33,0,-25.33]},{"duration":60,"tweenEasing":0,"offset":9},{"offset":1,"value":[4,0,4,0,4,0,4,0,4]}]},{"name":"D_BACKGROUND.07","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[-7.33,0,-7.33,0,-7.33,0,-7.33]},{"duration":60,"tweenEasing":0,"offset":7},{"offset":1,"value":[-18.67,0,-18.67,0,-18.67,0,-18.67]}]},{"name":"D_BACKGROUND.08","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[2.67,-4,1.33,8,-1.33,16,0,0,0,0,1.33,-12,1.33,-5.33,1.33,-8,0,-17.33,0,-4,0,-8.05,0,-8.98,0,0,0.75,-10.61,0.71,-12.36]},{"duration":60,"tweenEasing":0,"offset":29},{"value":[-3.33,8.67,-2.67,5.33,0,-10,-2.33,-15.33,18.67,-2.67,0,24,0,16,-1.33,6.67,-2.67,20,-1.33,13.33,0.71,9.72,-0.95,11.22,5.91,-8.76,-1.17,17.76,-2.67,10.23]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BREATH","timeline":[{"name":"B_BODY.04","type":50,"frame":[{"duration":120,"tweenEasing":0,"offset":161},{"value":[-40,-16,-28.13,-17.19,-15,-18.5,-4.38,-19.56,0,-20,5.03,-18.91,17.25,-16.25,32.34,-12.97,46,-10,-34.16,-9.07,-24.66,-10.58,-13.85,-12.3,-4.66,-13.81,0,-14.66,6.88,-13.2,18.27,-10.33,30.89,-6.87,41.47,-3.66,-25.81,-0.36,-19.32,-2.37,-11.47,-4.93,-4.34,-7.3,0,-8.75,7.09,-6.54,15.92,-2.6,24.32,1.87,30.08,5.69,-15.55,7.54,-12.55,4.97,-8.14,1.48,-3.55,-1.86,0,-3.97,6.4,-0.88,11.79,4.4,15.07,10.16,15.15,14.69,-4,12,-4.8,8.98,-4.15,4.76,-2.43,0.66,0,-2,5.62,1.82,7.5,8.14,5.62,14.89,0,20,-3.56,10.69,-4.02,8.11,-3.4,4.27,-1.96,0.52,0,-1.78,4.22,1.57,5.62,7.37,4.22,13.5,0,17.81,-2.5,7.5,-2.78,5.71,-2.33,3,-1.34,0.35,0,-1.25,2.81,1.09,3.75,5.19,2.82,9.52,0,12.5,-1.19,3.56,-1.34,2.7,-1.13,1.42,-0.65,0.17,0,-0.59,1.4,0.52,1.87,2.46,1.41,4.5,0,5.94]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_02_R","timeline":[{"name":"D_HAND.12","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[12.64,12.48,10.25,12.64,9.26,9.12,7.73,6.06,8.61,4.15,10.94,3.89,12.4,6.22,12.46,9.3,10.22,6.47]},{"offset":17}]},{"name":"D_HAND.13","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-0.3,7.45,1.21,8.58,0,0,0,0,0.1,-4.05,-0.84,-5.94]},{"offset":29}]},{"name":"D_HAND.14","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[4.19,8.69,4.43,11.58,5.41,16.32,3.73,27.51,1.22,23.89,2.24,15.8,1.76,11.5,1.37,9.26,2.79,7.96,3.06,10.26,3.26,13.25,3.93,19.88]},{"offset":23}]},{"name":"D_HAND.15","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-0.85,-1.23,-0.56,-3.96,0.1,-4.05,0,0,-0.46,-3.3,-0.56,-3.96,-0.19,-1.32,0,0,0,0,0,0,0.86,-3.49,-2.06,-5.1]},{"offset":23}]},{"name":"D_HAND.16","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-2.21,-3.01,-0.13,-11.93,0.43,-15.96,2.13,-20.55,6.89,-24.9,6.02,-14.92,5.53,-3.15,5.4,4.32,0.08,1.6,1.35,-6.29]},{"offset":19}]},{"name":"D_HAND.17","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-2.46,-9.98,4.5,-28.03,8.55,-37.87,12.6,-34.89,9.12,-15.37,6.87,-0.4,-0.09,-3.81,3.67,-11.78,11.24,-27.28]},{"offset":17}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_02_L","timeline":[{"name":"D_HAND.18","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[4.84,-14.03,9.51,-14.55,8.54,-6.7,7.65,0.36,6.53,4.17,1.51,5.81,-1.66,4.19,0.61,-3.87,2.75,-9.76,2.63,1.89]},{"offset":19}]},{"name":"D_HAND.19","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[1.17,8.46,1.53,9.91,0,0,0,0,7.08,-8.66,-1.17,-8.46]},{"offset":19}]},{"name":"D_HAND.20","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-0.85,-5.32,0.78,-8.02,3.96,-17.56,1.81,-26.24,-3.41,-21.27,-3,-14,-0.85,-5.32,-0.85,-5.32]},{"offset":15}]},{"name":"D_HAND.21","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-5.85,-1.32,-5.98,3.78,-5.98,3.78,-5.98,3.78,-5.98,3.78,-5.98,3.78,-5.98,3.78,-6.29,0.63]},{"offset":15}]},{"name":"D_HAND.22","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-5,24.36,-4.73,19.15,-6.24,13.19,-6.57,11.07,-6.71,9.4,-3.04,0.41,-3.42,14.2,-4.8,18.56]},{"offset":15}]},{"name":"D_HAND.23","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[9.39,38.82,3.16,26.92,-2.34,11.34,9.6,4.86,14.19,19.29,15.87,35.22]},{"offset":11}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_L_02","timeline":[{"name":"B_CLOTHES.40","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.41","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.18","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.18","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.19","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_L_01","timeline":[{"name":"B_CLOTHES.40","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.41","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAND.18","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.18","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.19","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_R","timeline":[{"name":"B_HAND.12","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-1.21,-6.42,2.89,-6.57,6.68,-6.7,7.27,-6.73,3.24,-6.59,-0.8,-6.45,-1.2,-6.43,-1.2,-6.42,-1.2,-6.42,-1.18,-6.44,1.72,-7.26,4.42,-8.12,4.91,-8.52,1.32,-9.11,-2.46,-9.4,-3.31,-8.88,-4.47,-7.37,-5.69,-6.09,-1.14,-6.46,0.46,-7.9,1.96,-9.36,2.31,-10.09,-0.86,-11.35,-4.38,-11.99,-5.6,-11.05,-7.82,-8.32,-10.13,-5.94,-1.13,-6.46,-1.29,-8.37,-1.44,-10.21,-1.57,-11.3,-4.54,-12.58,-8.19,-12.89,-9.68,-11.7,-11.94,-9.64,-14.46,-7.03,-1.13,-6.47,-3.11,-9.11,-4.99,-11.74,-5.39,-13.91,-8.09,-18.13,-12.16,-20.91,-15.55,-17.8,-19.42,-11.98,-23.51,-6.14,-1.14,-6.46,-4.42,-9.57,-7.51,-12.53,-7.91,-15.72,-10.94,-23.51,-16.01,-29.38,-21.36,-24.42,-27.33,-14.87,-33.13,-5.79,-1.16,-6.44,-4.89,-9.82,-8.34,-12.81,-8.66,-15.76,-12.23,-23.96,-19.13,-30.95,-26.89,-26.54,-34.59,-16,-41.69,-6.43,-1.19,-6.43,-5.55,-10.34,-9.59,-13.85,-10.56,-15.84,-15.08,-20.58,-24.38,-25.49,-34.26,-23.18,-41.56,-15.31,-48.38,-7.91,-1.21,-6.42,-6.23,-10.9,-10.9,-15,-12.56,-16.04,-18.19,-16.91,-29.99,-19.27,-41.77,-19.18,-48.46,-14.54,-54.68,-9.58]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-4.82,4.09,-4.85,4.11,-4.88,4.13,-4.91,4.14,-4.91,4.14,-4.88,4.13,-4.84,4.1,-4.83,4.09,-4.83,4.09,-4.81,4.07,-4.85,4.1,-4.93,4.16,-5.02,4.23,-5.06,4.25,-5.04,4.23,-4.94,4.16,-4.86,4.11,-4.83,4.09,-4.76,4.04,-4.81,4.07,-4.92,4.16,-5.09,4.28,-5.2,4.35,-5.19,4.34,-5.04,4.23,-4.89,4.13,-4.83,4.09,-4.7,3.99,-4.72,4.01,-4.83,4.09,-5.05,4.49,-5.32,4.92,-5.42,4.9,-5.27,4.75,-4.99,4.5,-4.83,4.09,-4.63,3.95,-4.6,3.93,-4.67,3.98,-5.05,5.29,-5.98,8.26,-6.65,9.76,-6.46,9.18,-5.61,6.69,-4.83,4.09,-4.6,3.93,-4.51,3.86,-4.51,3.86,-4.99,6.09,-6.59,11.58,-7.83,14.57,-7.56,13.56,-6.21,8.87,-4.83,4.09,-4.61,3.94,-4.49,3.85,-4.45,3.82,-4.74,6.35,-6.27,12.05,-7.67,14.81,-7.47,13.86,-6.27,9.56,-5.04,5.43,-4.65,3.97,-4.53,3.88,-4.47,3.83,-4.44,6.41,-5.59,11.81,-7.01,14.09,-7.03,13.81,-6.43,12.15,-5.86,10.68,-4.7,4,-4.59,3.92,-4.51,3.86,-4.15,6.5,-4.91,11.55,-6.31,13.33,-6.54,13.79,-6.65,15.03,-6.76,16.35]}]},{"name":"B_HAND.13","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.33,-2,0.33,-2,0.44,-2.02,1.36,-2.27,2.28,-2.51,1.02,-2.32,-3.55,-1.56,-8.44,-1.03,0.34,-2.01,0.36,-2.02,0.36,-2.03,0.57,-2.06,2.33,-2.53,4.1,-2.99,1.65,-2.67,-7.29,-1.39,-16.88,-0.47,0.37,-2.03,0.41,-2.06,0.43,-2.08,0.65,-2.09,1.15,-2.34,1.66,-2.59,-1.58,-2.59,-13.04,-2.48,-25.35,-2.2,0.36,-2.03,0.41,-2.06,0.45,-2.09,-0.12,-2.01,-7,-1.1,-13.87,-0.2,-17.62,-0.07,-28.1,0.11,-39.33,0.49,0.34,-2.01,0.39,-2.04,0.42,-2.07,-1.14,-1.96,-15.59,-0.76,-30.04,0.45,-33.76,0.76,-42.36,1.46,-51.68,2.2,0.3,-1.98,-2.04,-1.76,-4.23,-1.52,-7.78,-1.45,-26.89,-0.38,-45.15,0.93,-50.73,1.44,-60.1,2.57,-70.03,3.33,0.26,-1.96,-5.11,-1.43,-10.11,-0.92,-16.14,-0.94,-39.13,-0.11,-59.98,1.33,-67.92,1.59,-78.4,1.55,-89.31,1.21,0.25,-1.95,-8.09,-1.12,-15.82,-0.34,-24.25,-0.48,-51.1,0.03,-74.51,1.52,-84.71,1.47,-96.3,0,-108.13,-1.57]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-2.25,4.18,-2.52,5.65,-2.57,6.09,-2.28,6.6,-1.98,7.1,-1.95,6.62,-1.93,4.65,-1.93,2.73,-1.95,2.74,-2.56,5.56,-3.12,8.4,-3.21,9.23,-2.62,10.19,-2.03,11.15,-1.95,10.24,-1.94,6.47,-1.93,2.73,-1.97,2.75,-2.72,6.02,-3.41,9.09,-3.5,9.99,-2.85,11.15,-2.19,12.31,-2.11,11.35,-2.02,7.23,-1.93,2.73,-1.92,2.71,-2.83,5.41,-3.69,7.92,-3.94,8.81,-3.74,11.15,-3.5,13.47,-3.28,12.47,-2.63,7.79,-1.93,2.73,-1.83,2.66,-2.89,4.76,-3.9,6.68,-4.29,7.56,-4.57,11.12,-4.8,14.63,-4.43,13.58,-3.23,8.34,-1.93,2.73,-1.78,2.62,-2.68,4.3,-3.57,6.04,-3.97,6.9,-4.31,10.62,-4.59,14.28,-4.23,13.27,-3.12,8.14,-1.93,2.73,-1.76,2.6,-2.21,3.46,-2.68,4.38,-2.93,5.03,-3.15,8.78,-3.32,12.49,-3.12,11.7,-2.54,7.35,-1.93,2.73,-1.77,2.61,-1.73,2.58,-1.76,2.6,-1.84,3.01,-1.91,6.8,-1.94,10.56,-1.93,10.01,-1.93,6.51,-1.93,2.73]}]},{"name":"B_HAND.14","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-1.59,5.51,-4.46,6.17,-7.55,6.61,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-2.33,5.64,-8.05,6.73,-14.22,7.47,-0.88,5.35,-1.33,5.24,-1.76,5.13,-1.72,5.11,-2.39,5.26,-3.06,5.4,-5.33,5.55,-13.31,6.08,-21.86,6.53,-1,5.44,-2.56,4.89,-4.01,4.32,-4.77,4.13,-10.63,3.98,-16.49,3.83,-18.63,4.07,-25.26,5.11,-32.41,5.9,-1.05,5.47,-3.28,4.58,-5.3,3.68,-7.05,3.32,-19.12,2.36,-31.19,1.4,-33.32,1.45,-38.08,2.18,-43.3,2.83,-0.9,5.36,-6.41,5.28,-11.49,5.46,-14.18,5.39,-28.91,4.2,-43.64,3.01,-46.1,2.93,-51.44,3.21,-57.3,3.64,-0.71,5.23,-10.66,5.81,-19.91,6.53,-23.85,6.65,-40.29,5.96,-56.73,5.29,-59.88,5.37,-66.75,5.91,-74.21,6.56,-0.58,5.13,-14.94,6.3,-28.3,7.43,-33.42,7.71,-51.54,7.55,-69.68,7.4,-73.64,7.67,-82.13,8.53,-91.28,9.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-0.72,10.22,-0.72,10.22,-0.72,10.22,-0.72,9.93,-0.72,6.81,-0.72,3.7,-0.72,2.36,-0.72,-1.72,-0.72,-6.13,-0.72,10.22,-0.72,10.22,-0.72,10.22,-0.72,9.99,-0.67,7.52,-0.62,5.06,-0.57,3.84,-0.43,-0.03,-0.28,-4.24,-0.72,10.22,-0.72,10.22,-0.72,10.22,-0.72,10.05,-0.62,8.18,-0.52,6.31,-0.43,5.2,-0.15,1.53,0.14,-2.49,-0.83,10.3,-0.86,10.32,-0.87,10.32,-0.81,10.16,-0.76,8.51,-0.72,6.87,-0.62,5.77,-0.21,2.07,0.23,-2.02,-1.09,10.48,-1.2,10.56,-1.24,10.59,-1.24,10.49,-1.93,9.88,-2.64,9.28,-2.37,8.02,-1.17,3.35,0.12,-1.7,-1.19,10.55,-1.37,10.69,-1.43,10.73,-1.5,10.7,-3.01,11.18,-4.55,11.69,-4.12,10.27,-2.14,4.63,0.01,-1.39,-0.89,10.34,-1.01,10.42,-1.05,10.45,-1.01,10.39,-1.8,10.13,-2.6,9.88,-2.41,8.33,-1.31,4.13,-0.16,-0.73,-0.52,10.07,-0.5,10.06,-0.52,10.07,-0.53,10.16,-0.61,10.78,-0.63,11.37,-0.67,9.33,-0.71,5.7,-0.78,1.75,-0.26,9.89,-0.13,9.79,-0.12,9.79,-0.21,10.06,0.42,11.8,1.14,13.47,0.92,10.9,-0.22,7.61,-1.45,4.43]}]},{"name":"B_HAND.15","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-4.07,0.78,-5.25,-0.78,-6.44,-2.34,-6.24,-2.08,-5.11,-0.56,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-4.2,0.65,-6.5,-2.35,-8.81,-5.35,-8.42,-4.87,-6.24,-1.97,-3.9,0.93,-3.9,0.93,-4.22,0.7,-4.47,0.51,-4.62,0.13,-7.7,-3.41,-10.78,-6.95,-10.62,-6.42,-8.67,-3.05,-6.55,0.44,-3.9,0.93,-6.56,-0.91,-8.94,-3.17,-9.64,-3.99,-13.68,-6.15,-17.72,-8.31,-18,-7.66,-17.29,-4.31,-16.51,-0.96,-3.86,0.9,-9.71,-1.64,-15.11,-4.5,-16.89,-5.39,-21.7,-6.78,-26.5,-8.18,-27,-7.66,-27.33,-5,-27.72,-2.18,-3.77,0.84,-11.97,-1.21,-19.18,-2.94,-23.47,-3.46,-30.06,-5.3,-35.82,-7.04,-37.13,-6.95,-40.07,-5.75,-43.25,-4.24,-3.72,0.8,-14.04,-1.78,-22.76,-4.19,-30.68,-4.8,-40.39,-6.31,-48.06,-7.53,-50.11,-7.62,-55.42,-7.38,-61.16,-6.97,-3.75,0.82,-16.15,-2.39,-26.37,-5.63,-37.91,-6.35,-50.79,-7.57,-60.47,-8.32,-63.24,-8.54,-70.85,-9.11,-79.08,-9.72]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":6,"value":[-1.04,0.09,-12.16,1.05,-23.27,2.02,-24.66,1.92,-26.03,1.19,-27.5,0.41,0,0,-1.46,-0.95,-2.82,-1.93,-3.95,-2.76,-11.4,-5.86,-18.8,-8.73,-21.12,-10.39,-22.01,-12.76,-22.73,-15.14,0,0,-2.82,-1.84,-5.45,-3.72,-6.55,-5.43,-10.51,-12.27,-14.41,-18.65,-17.42,-21.83,-17.74,-25.83,-17.57,-29.77,0,0,-2.7,-2.74,-5.23,-5.86,-6.1,-8.28,-7.87,-15.67,-9.77,-22.54,-12.8,-27.53,-11.83,-34.47,-10.01,-40.89,0,0,-0.79,-2.69,-1.51,-6.32,-1.41,-9.7,-2.04,-20.95,-3.39,-31.81,-5.56,-38.72,-4.7,-47.24,-3.12,-55.25,0,0,0.18,-0.84,0.38,-2.04,1.52,-5.86,3.64,-22.91,4.35,-39.69,3.57,-47.83,4.49,-54.84,5.63,-62.48,0,0,0,0,0,0,1.36,-3.44,8.32,-23.55,14.02,-44.69,14.35,-54.75,14,-64.48,13.78,-74.37,0,0,0,0,0,0,1.44,-2.87,13.06,-25.74,24.02,-51.49,24.86,-63.05,22.36,-75.13,19.85,-87.01,0,0,0,0,0,0,1.53,-2.3,17.75,-27.92,33.92,-58.28,34.64,-70.28,29.74,-81.77,24.32,-93.6]}]},{"name":"B_HAND.16","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.58,-0.72,-3.58,-0.72,-3.58,-0.72,-3.58,-0.72,-3.58,-0.72,-3.79,4.34,-4.39,9.96,-5.15,15.81,-5.83,21.54,-3.58,-0.72,-3.52,-0.71,-3.45,-0.69,-3.4,-0.68,-3.37,-0.68,-3.47,5.48,-4.05,11.79,-4.81,18.13,-5.46,24.37,-3.58,-0.72,-3.45,-0.7,-3.31,-0.67,-3.2,-0.64,-3.14,-0.63,-3.12,6.69,-3.67,13.78,-4.44,20.7,-5.06,27.5,-3.58,-0.72,-3.4,-0.69,-3.2,-0.64,-3.03,-0.61,-2.95,-0.59,-2.82,7.79,-3.36,15.47,-4.14,22.77,-4.73,30.04,-3.58,-0.72,-3.37,-0.68,-3.14,-0.63,-2.95,-0.59,-2.87,-0.58,-2.71,8.62,-3.21,16.39,-3.97,23.59,-4.6,31.08,-3.58,-0.72,-3.48,-0.04,-3.31,0.3,-3.16,0.56,-3.13,0.98,-3.03,9.64,-3.57,17.13,-4.32,23.96,-4.88,30.69,-3.57,-0.73,-3.67,0.93,-3.66,2.34,-3.67,3.58,-3.79,4.76,-3.82,12.42,-4.32,18.68,-5,24.23,-5.56,29.73,-3.56,-0.74,-3.86,2.04,-4.1,4.82,-4.33,7.36,-4.6,9.43,-4.77,15.91,-5.24,20.57,-5.84,24.44,-6.4,28.54,-3.55,-0.76,-4.02,3.09,-4.5,7.08,-4.95,10.76,-5.34,13.66,-5.61,19.07,-6.08,22.3,-6.64,24.67,-7.16,27.47]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.87,-5.31,0.91,-7.37,0.96,-9.65,1,-11.5,1.01,-12.26,1.01,-12.87,0.99,-14.36,0.96,-16.21,0.94,-17.88,0.87,-5.31,0.93,-7.02,1.01,-8.88,1.08,-10.37,1.1,-10.98,1.08,-11.55,1.05,-12.94,1,-14.65,0.96,-16.21,0.87,-5.31,0.96,-6.65,1.07,-8.04,1.16,-9.13,1.19,-9.58,1.17,-10.09,1.11,-11.35,1.05,-12.92,0.99,-14.36,0.87,-5.31,0.98,-6.32,1.12,-7.34,1.23,-8.12,1.27,-8.44,1.24,-8.91,1.17,-10.08,1.08,-11.53,1.01,-12.87,0.87,-5.31,1,-6.1,1.14,-6.97,1.26,-7.68,1.3,-7.97,1.27,-8.44,1.19,-9.58,1.1,-10.98,1.01,-12.26,0.89,-5.32,1,-5.97,1.12,-6.75,1.21,-7.41,1.26,-7.68,1.22,-8.12,1.15,-9.18,1.07,-10.45,1,-11.5,0.94,-5.36,1.01,-5.8,1.08,-6.34,1.14,-6.8,1.15,-6.98,1.11,-7.29,1.06,-8.04,1.01,-8.93,0.96,-9.65,1.03,-5.42,1.05,-5.62,1.06,-5.87,1.05,-6.06,1.02,-6.12,0.99,-6.25,0.96,-6.6,0.93,-7.02,0.91,-7.37,1.16,-5.51,1.12,-5.49,1.07,-5.45,1,-5.4,0.92,-5.35,0.89,-5.33,0.88,-5.32,0.87,-5.31,0.87,-5.31]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_R_02","timeline":[{"name":"B_CLOTHES.25","type":50,"frame":[{"duration":-60,"tweenEasing":0,"offset":114,"value":[0.29,-0.07,2.83,-0.72,5.37,-1.37,4.88,-1.2,3.22,-0.68,1.45,-0.34,0,0,0,0,0,0,0.61,-0.09,6.76,-0.92,12.9,-1.75,12.62,-1.74,9.97,-1.64,7.11,-1.65,0,0,0,0,0,0,0.91,-0.09,10.64,-1,20.37,-1.91,20.4,-2.12,16.96,-2.58,13.24,-3.08]},{"duration":60,"tweenEasing":0,"offset":114,"value":[0.29,-0.07,2.83,-0.72,5.37,-1.37,4.88,-1.2,3.22,-0.68,1.45,-0.34,0,0,0,0,0,0,0.61,-0.09,6.76,-0.92,12.9,-1.75,12.62,-1.74,9.97,-1.64,7.11,-1.65,0,0,0,0,0,0,0.91,-0.09,10.64,-1,20.37,-1.91,20.4,-2.12,16.96,-2.58,13.24,-3.08]},{"duration":60,"tweenEasing":0,"offset":18,"value":[4.76,-3,2.63,-1.68,0.65,-0.38,0.35,0,3.09,0.21,5.84,0.43,7.26,2.77,5.61,6.45,3.39,9.77,9.17,-5.78,5.04,-3.22,1.21,-0.72,0.65,0,5.95,0.41,11.26,0.82,14.14,5.38,10.86,12.4,6.53,18.81,10.14,-6.52,3.92,-3.96,-1.93,-1.99,-2.6,-1.45,4.53,-0.27,11.67,0.91,15.13,6.04,11.65,13.51,7.21,20.89,8.52,-6.83,-1.35,-4.4,-10.7,-2.74,-12.19,-2.26,-5.02,-0.43,2.16,1.41,5.03,5.02,5.58,11.65,5.91,18.49,6.9,-7.14,-5.17,-4.2,-16.41,-1.61,-18.94,-0.81,-15.65,0.85,-12.35,2.52,-9.68,4.51,-2.8,10.07,4.62,16.09,6.01,-6.39,-6.13,-3.51,-17.36,-0.82,-20.45,-0.02,-21.72,0.94,-22.99,1.89,-20.24,3.55,-7.82,8.99,5.45,13.8,3.12,-3.32,-8.19,-0.78,-18.65,1.58,-21.83,2.28,-26.44,3.11,-31.05,3.94,-27.2,4.38,-9.66,5.33,9.19,5.69,0,0,-10.43,2.18,-20.07,4.19,-23.27,4.78,-31.17,5.64,-39.07,6.5,-34.01,5.52,-11.32,1.39,13.24,-3.08]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":60,"value":[-0.01,-0.01,0,-0.09,0,-0.17,0,-0.17,-0.01,-0.13,0,0,0,0,0,0,0,0,0,-0.09,-0.03,-1,-0.06,-1.91,-0.06,-1.78,-0.03,-0.93,0,0,0,0,0,0,0,0,0,-0.17,-0.06,-1.91,-0.12,-3.66,-0.11,-3.39,-0.05,-1.72,0,0,0,0,0,0,0,0,0.3,-0.26,2.97,-3.07,5.05,-6.72,4.11,-6.81,2.76,-3.95,1.45,-0.34,0,0,0,0,0,0,0.59,-0.51,6.4,-6.41,10.75,-14.37,9.59,-14.86,8.38,-8.67,7.11,-1.65,0,0,0,0,0,0,0.88,-0.79,9.69,-9.97,16.15,-22.46,14.99,-23.33,14.15,-13.61,13.24,-3.08]}]},{"name":"B_CLOTHES.28","type":50,"frame":[{"duration":-60,"tweenEasing":0,"offset":2,"value":[-11.12,-2.97,-21.4,-5.71,-23.03,-6.2,-12.41,-3.96,-1.78,-1.71,-0.7,-1.34,-0.36,-0.7,0,0,0,0,-9.54,-4.64,-18.33,-9.09,-19.63,-9.84,-10.43,-5.52,-1.24,-1.21,-0.39,-0.72,-0.2,-0.39,0,0,0,0,-8.04,-6.23,-15.45,-12.23,-16.47,-13.2,-8.61,-6.97,-0.75,-0.75,-0.09,-0.16,-0.05,-0.11,0,0,0,0,-6.12,-5.97,-11.9,-12.05,-13.17,-13.07,-7.04,-6.83,-0.92,-0.59,0,0,0,0,0,0,0,0,4.3,-1.23,8.4,-2.38,8.92,-2.56,4.69,-1.34,0.46,-0.11,0,0,0,0,0,0,0,0,14.89,3.58,28.78,7.32,30.96,7.96,16.42,4.16,1.88,0.36,0,0,0,0,0,0,0,0,14.09,3.7,27.23,7.36,29.36,7.97,15.61,4.16,1.86,0.36,0,0,0,0,0,0,0,0,7.26,1.89,14.06,3.82,15.23,4.14,8.11,2.16,0.99,0.19]},{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.12,-2.97,-21.4,-5.71,-23.03,-6.2,-12.41,-3.96,-1.78,-1.71,-0.7,-1.34,-0.36,-0.7,0,0,0,0,-9.54,-4.64,-18.33,-9.09,-19.63,-9.84,-10.43,-5.52,-1.24,-1.21,-0.39,-0.72,-0.2,-0.39,0,0,0,0,-8.04,-6.23,-15.45,-12.23,-16.47,-13.2,-8.61,-6.97,-0.75,-0.75,-0.09,-0.16,-0.05,-0.11,0,0,0,0,-6.12,-5.97,-11.9,-12.05,-13.17,-13.07,-7.04,-6.83,-0.92,-0.59,0,0,0,0,0,0,0,0,4.3,-1.23,8.4,-2.38,8.92,-2.56,4.69,-1.34,0.46,-0.11,0,0,0,0,0,0,0,0,14.89,3.58,28.78,7.32,30.96,7.96,16.42,4.16,1.88,0.36,0,0,0,0,0,0,0,0,14.09,3.7,27.23,7.36,29.36,7.97,15.61,4.16,1.86,0.36,0,0,0,0,0,0,0,0,7.26,1.89,14.06,3.82,15.23,4.14,8.11,2.16,0.99,0.19]},{"duration":60,"tweenEasing":0,"offset":2,"value":[1.12,-6.91,2.16,-13.29,2.29,-14.88,0.84,-14.51,-0.61,-14.13,-0.66,-12.56,-0.35,-6.53,0,0,0,0,1.81,-12.55,2.8,-28.01,2.77,-34.74,1.24,-31.21,-0.28,-27.69,-0.29,-23.5,-0.42,-9.97,0,0,0,0,2.02,-13.54,2.99,-30.44,2.66,-39.69,1.33,-29.03,0,-18.37,-0.12,-14.82,-0.17,-6.02,0,0,0,0,3.15,-8.35,3.82,-18.4,1.54,-26.58,0.8,-13.89,0.07,-1.19,0,0,0,0,0,0,0,0,7.79,-2.5,7.07,-7.92,0.73,-13.89,0.42,-7.25,0.11,-0.62,0,0,0,0,0,0,0,0,12.57,3.36,10.23,2.62,0.05,-1.19,0.04,-0.62,0.03,-0.05,0,0,0,0,0,0,0,0,10.73,3.25,8.59,2.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5.37,1.62,4.29,1.3]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":56,"value":[0.67,-0.84,0.64,-0.17,0.25,0.27,-0.02,0.48,-0.29,0.69,-0.3,0.69,-0.15,0.52,0,0,0,0,3.26,-2.74,3.75,0.97,2.17,3.2,-0.22,5.59,-2.61,7.99,-2.56,7.32,-1.3,3.8,0,0,0,0,5.88,-4.66,6.87,2.1,4.11,6.12,-0.42,10.71,-4.95,15.29,-4.79,13.94,-2.49,7.09,0,0,0,0,4.51,-0.91,4.69,9.96,2.12,14.82,-1.48,17.87,-5.08,20.93,-4.6,18.49,-2.48,8.55,0,0,0,0,1.67,1.97,1.09,11.39,-0.39,14.89,-1.71,15.23,-3.04,15.57,-2.55,13.45,-1.37,5.85]}]},{"name":"B_CLOTHES.33","type":11,"frame":[{"duration":-60,"tweenEasing":0,"x":21.65,"y":1.6},{"duration":60,"tweenEasing":0,"x":21.65,"y":1.6},{"duration":121}]},{"name":"B_CLOTHES.33","type":12,"frame":[{"duration":-60,"tweenEasing":0,"x":75.1},{"duration":60,"tweenEasing":0,"x":75.1},{"duration":60,"tweenEasing":0,"x":27.6},{"duration":60,"tweenEasing":0},{"x":-34}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_L_02","timeline":[{"name":"B_CLOTHES.36","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.08","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_L","timeline":[{"name":"B_CLOTHES.08","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-0.11,-0.44,-0.23,-0.88,-0.24,-0.96,-0.13,-0.5,-0.01,-0.04,0,0,0,0,0,0,0,0,-0.22,-0.85,-0.43,-1.7,-0.47,-1.85,-0.25,-0.96,-0.02,-0.08,0,0,0,0,0,0,0,0,-0.24,-0.93,-0.47,-1.84,-0.51,-1.98,-0.27,-1.04,-0.02,-0.09,0,0,0,0,0,0,0,0,-0.13,-0.5,-0.25,-0.96,-0.27,-1.04,-0.14,-0.54,-0.01,-0.05,0,0,0,0,0,0,0,0,-0.02,-0.07,-0.03,-0.09,-0.02,-0.09,-0.01,-0.05]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.54,1.35,1.06,2.74,1.28,3,1.67,1.97,2.07,0.93,1.84,0.74,0.95,0.36,0,0,0,0,1.05,2.62,2.06,5.28,2.46,5.78,3.22,3.79,3.98,1.79,3.56,1.42,1.83,0.7,0,0,0,0,1.15,2.89,2.23,5.69,2.63,6.22,3.46,4.07,4.29,1.92,3.86,1.53,2,0.77,0,0,0,0,0.62,1.55,1.17,2.99,1.37,3.25,1.81,2.13,2.25,1,2.04,0.8,1.06,0.42,0,0,0,0,0.08,0.22,0.12,0.28,0.1,0.28,0.16,0.18,0.21,0.08,0.23,0.07,0.13,0.06]}]},{"name":"B_HAND.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[40.01,14.54,33.74,10.25,26.97,6.03,21.14,1.84,17.68,-2.35,16.84,-2.27,14.91,-1.94,12.64,-1.37,10.8,-0.6,38.45,21.52,32.62,15.86,26.41,10.06,20.96,4.47,17.38,-0.54,16.56,-0.69,14.72,-0.89,12.6,-0.98,10.92,-0.78,36.7,29.22,31.39,22.06,25.73,14.51,20.64,7.37,17.02,1.43,16.26,1.01,14.53,0.19,12.57,-0.61,11.1,-1.02,35.28,35.44,30.41,26.96,25.26,18.01,20.47,9.66,16.71,2.97,16.01,2.33,14.4,1.02,12.61,-0.4,11.35,-1.37,34.68,37.98,30.01,28.7,25.28,19.2,20.71,10.46,16.54,3.48,15.89,2.77,14.38,1.27,12.74,-0.45,11.67,-1.83,37.9,36.18,32.7,27.92,27.1,19.03,21.88,10.66,17.8,3.93,17.29,3.17,15.52,1.52,13.46,-0.49,12.1,-2.36,41.69,32.39,36.15,25.61,30.16,18.31,24.75,11.26,20.94,5.24,20.09,4.32,17.56,2.27,14.62,-0.28,12.47,-2.72,45.75,27.84,39.97,22.69,33.75,17.39,28.3,12.08,24.88,6.94,23.44,5.82,19.95,3.29,15.88,0.13,12.76,-2.9,49.77,23.76,43.75,20.15,37.14,16.67,31.53,12.94,28.52,8.58,26.55,7.3,22.11,4.37,16.97,0.68,12.9,-2.89]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[20.27,-65.55,18.9,-54.78,17.53,-44.02,16.15,-33.26,14.78,-22.5,13.41,-11.73,12.04,-0.97,10.66,9.79,9.29,20.56,16.24,-66.79,14.86,-56.03,13.49,-45.27,12.12,-34.51,10.74,-23.74,9.37,-12.98,8,-2.22,6.62,8.55,5.25,19.31,12.2,-68.04,10.83,-57.28,9.45,-46.52,8.08,-35.75,6.71,-24.99,5.33,-14.23,3.96,-3.46,2.59,7.3,1.21,18.06,8.16,-69.29,6.79,-58.53,5.41,-47.76,4.04,-37,2.67,-26.24,1.29,-15.47,-0.08,-4.71,-1.45,6.05,-2.83,16.82,4.12,-70.54,2.75,-59.77,1.38,-49.01,0,-38.25,-1.37,-27.48,-2.74,-16.72,-4.12,-5.96,-5.49,4.81,-6.86,15.57,0.08,-71.78,-1.29,-61.02,-2.66,-50.26,-4.04,-39.49,-5.41,-28.73,-6.78,-17.97,-8.15,-7.2,-9.53,3.56,-10.9,14.32,-3.95,-73.03,-5.33,-62.27,-6.7,-51.5,-8.07,-40.74,-9.45,-29.98,-10.82,-19.21,-12.19,-8.45,-13.57,2.31,-14.94,13.07,-7.99,-74.28,-9.36,-63.51,-10.74,-52.75,-12.11,-41.99,-13.48,-31.22,-14.86,-20.46,-16.23,-9.7,-17.6,1.06,-18.98,11.83,-12.03,-75.52,-13.4,-64.76,-14.78,-54,-16.15,-43.23,-17.52,-32.47,-18.9,-21.71,-20.27,-10.95,-21.64,-0.18,-23.02,10.58]}]},{"name":"B_HAND.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[19.38,1.82,15.27,1.77,10.69,1.54,6.99,1.22,5.48,0.95,5.47,0.87,5.5,0.81,5.61,0.74,5.84,0.63,26.27,1.6,21,1.43,15.15,1.04,10.43,0.58,8.51,0.23,8.09,0.23,7.32,0.36,6.49,0.5,5.9,0.54,33.4,1.64,27,1.3,19.89,0.62,14.15,-0.1,11.85,-0.57,10.94,-0.49,9.31,-0.16,7.48,0.22,6,0.4,40.02,1.13,32.44,0.71,24.04,-0.02,17.25,-0.77,14.54,-1.26,13.31,-1.12,10.99,-0.63,8.34,-0.09,6.14,0.22,45.34,-0.76,36.51,-0.98,26.76,-1.17,18.87,-1.36,15.62,-1.61,14.52,-1.47,11.91,-0.97,8.83,-0.4,6.32,-0.02,53.96,-0.98,45.05,-1.22,35.41,-1.58,27.2,-1.93,22.53,-2.16,19.91,-1.67,15.59,-1.13,10.72,-0.59,6.43,-0.12,63.65,-2.21,54.84,-2.33,45.5,-2.57,37.19,-2.78,31.43,-2.85,26.74,-1.98,20.22,-1.29,13.06,-0.69,6.48,-0.1,73.8,-3.76,65.18,-3.73,56.23,-3.74,47.89,-3.71,41.13,-3.58,34.13,-2.3,25.19,-1.41,15.57,-0.7,6.49,0.04,83.85,-4.96,75.36,-4.81,66.73,-4.68,58.32,-4.5,50.47,-4.21,41.25,-2.53,29.98,-1.44,17.95,-0.62,6.49,0.27]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[15.43,-49.79,13.76,-37,12.06,-23.8,10.41,-11.42,8.83,-1.07,8.76,3.05,7.58,7.93,5.96,13.12,4.56,18.15,10.62,-55.34,9.42,-42.77,8.16,-29.83,6.98,-17.52,6.01,-6.84,6.05,-2.79,5.28,3.18,4.19,9.89,3.27,16.14,5.73,-61.61,4.97,-49.25,4.08,-36.52,3.3,-24.24,2.89,-13.22,3.1,-9.18,2.76,-1.99,2.23,6.37,1.85,13.91,0.98,-66.43,0.76,-54.3,0.36,-41.87,0.12,-29.71,0.37,-18.39,0.64,-14.48,0.67,-6.34,0.63,3.41,0.69,12.1,-3.4,-67.63,-2.87,-55.78,-2.44,-43.89,-1.81,-32.09,-0.67,-20.52,-0.58,-17.03,-0.34,-8.57,-0.05,1.89,0.22,11.36,-5.29,-69.57,-5.59,-57.98,-5.29,-46.09,-3.91,-34.19,-0.93,-22.56,-0.86,-19.05,-0.55,-10.5,-0.16,0.1,0.16,9.74,-6.99,-72.33,-8.32,-61.39,-8.22,-50.15,-6.14,-38.8,-1.55,-27.53,-1.42,-23.9,-0.99,-15.07,-0.45,-4.14,0.01,5.79,-8.61,-75.41,-11.01,-65.28,-11.14,-54.96,-8.42,-44.43,-2.31,-33.66,-2.09,-29.89,-1.52,-20.71,-0.81,-9.36,-0.18,0.92,-10.26,-78.33,-13.71,-68.92,-14.04,-59.4,-10.67,-49.56,-3,-39.21,-2.71,-35.31,-2.01,-25.81,-1.14,-14.09,-0.35,-3.48]}]},{"name":"B_HAND.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[23.14,1.08,17.91,1.21,12.11,1.19,7.42,1.05,5.5,0.84,5.52,0.7,5.64,0.6,5.87,0.64,6.23,0.96,29.17,2.67,22.51,2.35,15.13,1.78,9.16,1.18,6.74,0.77,6.61,0.65,6.44,0.57,6.35,0.6,6.45,0.8,35.22,4.41,27.15,3.61,18.2,2.42,10.99,1.28,8.11,0.63,7.8,0.52,7.32,0.44,6.89,0.42,6.71,0.5,41.17,5.37,31.66,4.2,21.1,2.65,12.59,1.24,9.2,0.46,8.79,0.35,8.09,0.23,7.4,0.14,7.02,0.09,46.93,4.58,35.85,3.33,23.62,2.02,13.71,0.93,9.63,0.3,9.3,0.17,8.54,0,7.76,-0.2,7.35,-0.39,57.36,5.39,45.53,4.27,32.8,2.7,21.81,1.25,15.19,0.5,14.72,0.35,12.5,0.08,9.71,-0.21,7.52,-0.46,68.75,3.61,56.44,2.99,43.51,2.02,31.78,1.08,23.05,0.6,21.83,0.46,17.56,0.19,12.17,-0.11,7.59,-0.38,80.57,0.85,67.89,0.89,54.87,0.84,42.52,0.74,31.83,0.66,29.55,0.56,22.99,0.35,14.79,0.09,7.59,-0.17,92.28,-1.24,79.18,-0.64,65.98,0.02,52.91,0.54,40.17,0.79,36.91,0.74,28.17,0.6,17.27,0.4,7.55,0.16]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-1.54,-10.15,-1.08,-7.14,-0.58,-3.81,-0.17,-1.11,0,0,0,0,0,0,0,0,0,0,-2.78,-14.51,-1.99,-11.25,-1.12,-7.61,-0.42,-4.67,-0.1,-3.45,-0.04,-3.38,0.07,-3.21,0.21,-3.01,0.33,-2.84,-4.14,-19.34,-2.99,-15.8,-1.74,-11.83,-0.71,-8.6,-0.21,-7.26,-0.09,-7.11,0.15,-6.75,0.44,-6.33,0.7,-5.99,-5.25,-23.24,-3.8,-19.46,-2.22,-15.23,-0.92,-11.77,-0.3,-10.35,-0.13,-10.14,0.21,-9.63,0.62,-9.03,0.99,-8.53,-5.7,-24.85,-4.11,-20.92,-2.35,-16.58,-0.92,-13.07,-0.34,-11.62,-0.18,-11.4,0.21,-10.85,0.68,-10.19,1.11,-9.58,-6.05,-25.54,-4.48,-21.19,-2.69,-16.56,-1.23,-12.89,-0.67,-11.4,-0.54,-11.13,-0.08,-10.45,0.5,-9.53,0.99,-8.53,-6.9,-27.23,-5.32,-22.23,-3.52,-16.87,-2.05,-12.6,-1.48,-10.86,-1.29,-10.37,-0.7,-9.15,0.05,-7.56,0.7,-5.99,-7.95,-29.31,-6.34,-23.58,-4.54,-17.31,-3.07,-12.26,-2.49,-10.19,-2.2,-9.4,-1.44,-7.48,-0.5,-5.07,0.33,-2.84,-8.89,-31.19,-7.26,-24.78,-5.46,-17.69,-4,-11.95,-3.4,-9.59,-3.03,-8.54,-2.12,-5.99,-1.01,-2.85]}]},{"name":"B_HAND.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[24.45,7.62,18.81,5.59,12.58,3.42,7.53,1.63,5.45,0.76,5.56,0.65,5.87,0.58,6.3,0.6,6.77,0.78,33.1,9.87,25.47,7.37,17.33,4.67,10.32,2.18,6.1,0.31,6.17,0.22,6.38,0.16,6.69,0.17,7.06,0.31,42.14,12.43,32.49,9.41,22.32,6.05,13.23,2.72,6.82,-0.18,6.82,-0.24,6.92,-0.26,7.1,-0.22,7.35,-0.1,50.42,14.32,38.9,10.88,26.82,7.12,15.79,3.24,7.4,-0.59,7.37,-0.62,7.37,-0.59,7.45,-0.53,7.62,-0.44,56.75,14.54,43.7,10.93,30.12,7.48,17.57,3.73,7.63,-0.8,7.64,-0.8,7.64,-0.77,7.69,-0.71,7.85,-0.65,68.21,16.58,55.06,13.18,41.36,9.37,28.43,5.43,17.61,1.7,15.9,1.38,13.36,0.47,10.49,-0.36,7.82,-0.48,76.59,12.82,63.56,10,50.16,6.66,37.28,3.39,25.83,0.81,22.81,0.7,18.16,0.05,12.83,-0.48,7.79,-0.23,82.71,5.5,69.9,3.46,56.93,1.01,44.24,-1.16,32.27,-2.4,28.41,-1.92,22.09,-1.5,14.73,-0.92,7.75,0.07,87.4,-3.12,74.76,-4.39,62.08,-5.91,49.43,-6.97,36.89,-6.86,32.84,-5.57,25.26,-3.68,16.2,-1.57,7.72,0.4]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[-0.22,3.63,-0.15,3.63,-0.07,3.71,-0.01,3.57,0.01,2.9,0,2.56,0.01,1.75,0.01,0.8,0,0,-0.46,7.64,-0.32,7.62,-0.15,7.77,-0.02,7.47,0.03,6.1,0.02,5.38,0.02,3.66,0.01,1.64,0,0,-0.66,10.89,-0.45,10.88,-0.21,11.14,-0.02,10.72,0.04,8.69,0.04,7.68,0.02,5.26,0.01,2.39,0,0,-0.74,12.23,-0.49,12.28,-0.22,12.79,0,12.39,0.04,9.76,0.04,8.69,0.03,6.1,0.01,2.9,0,0,-0.66,12.43,-0.39,12.25,-0.08,12.39,0.16,11.91,0.21,9.87,0.21,8.8,0.16,6.19,0.07,2.95,0,0,-0.46,12.93,-0.13,12.48,0.24,12.22,0.52,11.61,0.61,10.13,0.57,9.03,0.4,6.35,0.19,3.03,0,0,-0.22,13.53,0.18,12.81,0.62,12.13,0.97,11.39,1.1,10.46,0.99,9.32,0.7,6.54,0.33,3.11,0,0,0,14.08,0.46,13.1,0.97,12,1.38,11.12,1.55,10.76,1.38,9.58,0.97,6.72,0.46,3.19]}]},{"name":"B_HAND.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[6.98,1.49,2.89,1.85,-1.63,2.33,-5.28,2.72,-6.77,2.82,-5.01,2.29,-1.14,1.41,3.43,0.5,7.23,-0.16,15.92,2.7,10.12,2.54,3.86,2.38,-1.43,2,-4.33,1.19,-2.71,0.97,0.58,0.8,4.35,0.71,7.42,0.7,25.29,4.31,17.67,3.52,9.52,2.46,2.42,1.05,-2.04,-0.75,-0.52,-0.58,2.19,0.14,5.2,1.04,7.57,1.77,33.93,5.32,24.75,4.1,14.94,2.57,6.28,0.57,0.57,-2.03,1.91,-1.59,3.95,-0.25,6.07,1.38,7.66,2.71,40.7,4.72,30.52,3.58,19.67,2.77,10.14,1.33,3.97,-1.67,4.91,-1.29,6.06,-0.04,7.1,1.61,7.69,3.21,48.86,4.08,37.86,2.82,26.11,1.19,15.8,-0.84,9.11,-3.34,9.67,-2.5,9.42,-0.84,8.65,1.17,7.65,3.06,54.68,0.33,43.75,-0.57,32.07,-1.79,22.06,-3.26,16.14,-4.94,15.85,-3.74,13.7,-1.86,10.63,0.3,7.58,2.37,59.55,-4.68,49.05,-5.03,37.75,-5.38,28.46,-5.85,23.98,-6.53,22.6,-5.01,18.35,-2.99,12.79,-0.76,7.49,1.43,64.86,-9.09,54.64,-8.97,43.52,-8.72,34.74,-8.41,31.55,-8.15,29.14,-6.28,22.85,-4.1,14.88,-1.76,7.42,0.57]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[1.41,43.43,1.14,36.12,0.93,28.59,0.61,21.51,-0.01,15.55,-0.01,13.85,-0.01,9.72,0,4.62,0,0,2.21,40.94,2.22,34.62,2.38,28.25,2.37,22.17,1.89,16.69,1.66,14.35,1.16,9.95,0.55,4.75,0,0,3.1,38.18,3.42,32.9,3.96,27.84,4.3,22.89,4,17.95,3.49,14.96,2.43,10.25,1.15,4.91,0,0,3.82,35.95,4.42,31.59,5.27,27.57,5.86,23.5,5.7,18.97,5.02,15.37,3.5,10.44,1.65,5.03,0,0,4.12,35.03,4.91,31.29,5.86,27.66,6.5,23.81,6.4,19.39,5.78,15.26,4.07,10.33,1.93,5.09,0,0,7.09,36.27,7.2,32.68,7.4,28.68,7.36,24.25,6.77,19.33,6,15.22,4.21,10.31,2,5.08,0,0,9.71,36.48,9.34,33.18,9.03,29.15,8.55,24.47,7.67,19.18,6.61,15.12,4.59,10.25,2.2,5.05,0,0,12.19,36.29,11.42,33.32,10.7,29.41,9.88,24.61,8.78,18.99,7.37,14.99,5.09,10.16,2.46,5,0,0,14.74,36.29,13.53,33.65,12.35,29.77,11.14,24.79,9.78,18.82,8.05,14.87,5.53,10.08,2.68,4.96]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_TWIN_R","timeline":[{"name":"B_HAIR_TWIN.15","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.19,0,-0.35,0,-0.28,0,-0.42,-0.02,-0.56,-0.04,-0.53,-0.04,-0.53,-0.03,-0.53,0,0,0,-1.64,0,-3.15,0,-3.65,-0.02,-4.86,-0.23,-6.07,-0.43,-6.19,-0.4,-6.19,-0.21,-6.19,0,0,0,-3.08,0,-5.94,0,-7.02,-0.04,-9.3,-0.43,-11.58,-0.83,-11.84,-0.77,-11.84,-0.39,-11.84,0,0,0,-5.32,0,-10.31,0,-12.36,-0.03,-15.45,-0.4,-18.54,-0.77,-18.37,-0.71,-17.63,-0.36,-16.9,0,0,0,-6.85,0,-13.22,0,-15.47,-0.02,-18.69,-0.21,-21.9,-0.4,-22.01,-0.37,-21.9,-0.18,-21.83,0,0,0,-8.18,0,-15.74,0,-17.98,0,-21.21,0,-24.44,0,-24.94,0,-25.69,0,-26.51]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":19,"value":[0.42,0.37,0.24,0.71,0.05,0.77,0,0.41,0,0.05,0,0,0,0,0,0,0,0,0.81,0.71,0.45,1.37,0.09,1.49,0,0.79,0,0.09,0,0,0,0,0,0,0,1.9,1.13,2.24,0.66,2.51,0.14,2.21,0,1.45,-0.02,0.69,-0.04,0.71,-0.04,0.38,-0.03,0,0,6.41,0.79,7.29,0.48,8.06,0.1,7.91,-0.02,7.51,-0.23,7.11,-0.43,6.3,-0.4,3.27,-0.21,0,0,8.67,0.08,10.95,0.04,13.06,0.01,13.62,-0.04,13.57,-0.43,13.52,-0.83,11.87,-0.77,6.15,-0.39,0,0,9.42,0,13.11,0,16.6,0,18.07,-0.04,18.74,-0.45,19.4,-0.87,16.91,-0.81,8.73,-0.42,0,0,11.68,0,15.3,0,18.68,0,19.94,-0.04,20.74,-0.45,21.54,-0.87,18.97,-0.81,9.82,-0.42,0,0,14.14,0,17.41,0,20.43,0,21.28,-0.04,22.09,-0.45,22.9,-0.87,20.46,-0.81,10.63,-0.42]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_TWIN_L","timeline":[{"name":"B_HAIR_TWIN.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.12,-0.02,-0.23,-0.03,-0.16,-0.03,-0.37,-0.04,-0.58,-0.05,-0.56,-0.05,-0.48,-0.04,-0.39,0,0,0,-1.05,-0.14,-2.03,-0.27,-2.45,-0.31,-4.27,-0.45,-6.09,-0.58,-6.08,-0.53,-5.35,-0.27,-4.55,0.01,0,0,-1.99,-0.26,-3.83,-0.51,-4.75,-0.6,-8.18,-0.86,-11.61,-1.12,-11.6,-1.01,-10.21,-0.51,-8.72,0.01,0,0,-4.76,-0.31,-9.2,-0.68,-10.37,-0.79,-12.52,-0.92,-14.67,-1.05,-14.19,-0.93,-12.42,-0.45,-10.48,0.02,0,0,-7.96,-0.16,-15.34,-0.36,-17.37,-0.42,-19.83,-0.47,-22.3,-0.52,-21.67,-0.46,-18.88,-0.21,-15.84,0.03,0,0,-11.07,0.02,-21.3,0.04,-24.2,0.04,-27.33,0.05,-30.45,0.05,-29.75,0.05,-25.85,0.04,-21.63,0.04]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":54,"value":[0.34,0.03,1.02,0.02,1.68,0.02,2.05,0.02,2.17,-0.06,2.29,-0.14,1.55,-0.26,0.73,-0.17,-0.05,-0.21,3.99,0.3,5.32,0.3,6.61,0.29,7.36,0.28,8.4,0.18,9.44,0.07,6.45,-0.7,2.87,-1.56,-0.58,-2.43,7.63,0.57,8.71,0.57,9.72,0.57,10.26,0.56,12.22,0.55,14.19,0.53,9.56,-0.94,4.1,-2.87,-1.12,-4.65,10.71,0.59,10.83,0.55,11,0.53,11.43,0.49,12.61,0.14,13.8,-0.22,9.97,-1.71,4.44,-3.97,-1.05,-5.87,21.43,0.57,18.68,0.42,16.18,0.29,15.75,0.23,16.05,0.01,16.35,-0.21,13.42,-0.98,6.6,-2.21,-0.55,-3.21,33.02,0.55,27.22,0.28,21.87,0.03,20.45,-0.03,19.93,-0.03,19.41,-0.03,17.24,-0.03,8.96,-0.02]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_SIDE_L","timeline":[{"name":"B_HAIR_SIDE.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-0.23,0,-0.48,0,-0.68,0,-0.79,0,-0.68,0,-0.48,0,-0.23,0,0,0,0,0,-0.48,0,-0.99,0,-1.43,0,-1.66,0,-1.43,0,-0.99,0,-0.48,0,0,0,0,0,-0.68,0,-1.43,0,-2.05,0,-2.36,0,-2.05,0,-1.43,0,-0.68,0,0,0,0,0,-0.79,0,-1.66,0,-2.36,0,-2.65,0,-2.36,0,-1.66,0,-0.79,0,0,0,-0.87,-0.1,-6.03,-0.07,-10.34,-0.04,-13,-0.04,-13.22,-0.14,-13.51,-0.29,-11.79,-0.32,-8.65,-0.22,-4.64,0,-2.98,-0.33,-13.59,-0.29,-22.42,-0.22,-28.16,-0.25,-29.51,-0.45,-30.63,-0.73,-28.15,-0.72,-22.94,-0.46,-15.89,0,-5.59,-0.62,-21.57,-0.55,-34.88,-0.44,-43.72,-0.46,-46.28,-0.75,-48.74,-1.16,-46.01,-1.12,-39.3,-0.71,-29.8,0,-7.95,-0.88,-28.36,-0.75,-45.12,-0.55,-55.88,-0.51,-58.28,-0.88,-62.78,-1.43,-60.64,-1.41,-53.34,-0.91,-42.38]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.23,0,0.48,0,0.68,0,0.79,0,0.68,0,0.48,0,0.23,0,0,0,0,0,0.48,0,0.99,0,1.43,0,1.66,0,1.43,0,0.99,0,0.48,0,0,0,0,0,0.68,0,1.43,0,2.05,0,2.36,0,2.05,0,1.43,0,0.68,0,0,0,0,0,0.79,0,1.66,0,2.36,0,2.65,0,2.36,0,1.66,0,0.79,0,0,0,8.24,0,9.43,0.06,10.8,0.18,11.83,0.31,12.04,0.37,11.53,0.31,9.63,0.18,6.22,0.06,1.16,0,16.89,0,18.91,0.05,21.18,0.16,22.96,0.28,23.51,0.33,22.66,0.28,19.46,0.16,13.41,0.05,3.97,0,25.7,0,28.72,0.02,32.07,0.06,34.76,0.1,35.8,0.12,34.57,0.1,30.03,0.06,21.29,0.02,7.45,0,34.44,0,38.37,0,42.71,0,46.23,0,47.68,0,46.08,0,40.22,0,28.82,0,10.6]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_SIDE_R","timeline":[{"name":"B_HAIR_SIDE.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":90,"value":[-0.28,0,-4.37,0,-6.76,0,-6.74,0,-3.61,0,-6.53,-0.13,-8.92,-0.17,-10.53,-0.13,-11.14,0,-0.95,0,-10.31,0,-16.28,0,-17.43,0,-12.36,0,-16.84,-0.26,-20.23,-0.35,-22.06,-0.26,-21.88,0,-1.78,0,-16.76,0,-26.71,0,-29.55,0,-23.18,0,-28.7,-0.4,-32.56,-0.53,-34.04,-0.4,-32.46,0,-2.54,0,-22.86,0,-36.55,0,-40.84,0,-32.97,0,-39.82,-0.53,-44.42,-0.71,-45.84,-0.53,-43.12]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":90,"value":[1.66,0,5.39,0,9.21,0.02,12.86,0.03,16.08,0.03,15.06,0.23,12.01,0.67,7.24,1.12,1.11,1.32,5.71,0,11.35,0.01,17.17,0.02,22.64,0.03,27.25,0.04,26.68,0.31,22.14,0.9,14.3,1.49,3.8,1.76,10.7,0,16.19,0.01,21.94,0.02,27.17,0.03,31.14,0.03,33.22,0.23,29.25,0.67,20.22,1.11,7.13,1.32,15.22,0,18.23,0,21.56,0,24.25,0,25.36,0,33.21,0,32.34,0,24.17,0,10.15]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_MOUTH_OPEN_Y","timeline":[{"name":"D_MOUTH.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_MOUTH_FORM","timeline":[{"name":"D_MOUTH.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_MOUTH.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_MOUTH.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_MOUTH.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_MOUTH_SIZE","timeline":[{"name":"B_MOUTH.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[41.89,26.96,32.49,26.96,23.08,26.96,13.68,26.96,4.27,26.96,-5.14,26.95,-14.54,26.95,-23.95,26.95,-33.35,26.95,41.89,21.14,32.48,21.14,23.08,21.13,13.69,21.13,4.4,21.13,-4.9,21.13,-14.32,21.12,-23.83,21.12,-33.35,21.12,41.89,15.31,32.48,15.31,23.08,15.31,13.7,15.31,4.51,15.3,-4.68,15.3,-14.12,15.3,-23.73,15.3,-33.35,15.3,41.89,9.49,32.48,9.49,23.08,9.49,13.69,9.48,4.57,9.48,-4.56,9.49,-14,9.48,-23.66,9.48,-33.35,9.47,41.89,3.66,32.48,3.66,23.08,3.66,13.72,3.66,4.83,3.72,-4.05,3.77,-13.53,3.76,-23.42,3.71,-33.36,3.65,41.89,-2.16,32.48,-2.16,23.08,-2.16,13.75,-2.15,5.1,-2.05,-3.54,-1.94,-13.06,-1.96,-23.18,-2.06,-33.36,-2.17,41.88,-7.98,32.48,-7.99,23.07,-7.99,13.74,-7.98,5.18,-7.9,-3.38,-7.81,-12.91,-7.83,-23.1,-7.92,-33.36,-8,41.88,-13.81,32.48,-13.81,23.07,-13.81,13.76,-13.82,5.36,-13.84,-3.04,-13.87,-12.59,-13.87,-22.93,-13.86,-33.36,-13.82,41.88,-19.63,32.48,-19.63,23.07,-19.64,13.78,-19.65,5.56,-19.8,-2.67,-19.95,-12.24,-19.93,-22.76,-19.8,-33.36,-19.65]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-6.4,-1.4,-12.33,-4.01,-17.8,-6.41,-17.87,-7.02,-3.73,-7.02,10.4,-7.03,11.03,-6.26,8.3,-3.25,5.33,0,-6.4,1.85,-11.32,-2.04,-15.79,-5.93,-14.61,-7.94,-0.88,-8.02,11.03,-7.35,11.74,-5.49,9.48,-1.06,6.32,3.9,-6.4,4.85,-10.36,-0.22,-13.88,-5.45,-11.46,-8.81,1.88,-8.99,11.57,-7.67,12.37,-4.77,10.58,0.94,7.23,7.51,-6.22,5.74,-9.68,0.97,-12.71,-4.21,-9.95,-7.91,2.93,-8.13,11.52,-6.57,12.68,-3.63,11.27,1.93,7.56,8.43,-4.27,7.03,-7.59,6.6,-10.47,6.03,-8.8,4.61,3.2,5.06,12.73,6.53,14.7,6.81,13.27,6.82,8.53,8.43,-2.32,8.31,-5.12,12.23,-7.67,16.28,-7.03,17.14,3.2,18.27,12.83,19.65,15.87,17.24,14.74,11.68,9.51,8.43,-1.9,7.51,-3.52,11.94,-5.03,16.54,-4.65,17.78,3.18,18.05,11.01,18.31,13.75,15.93,13.27,10.96,9.48,7.66,-0.99,3.9,-1.77,6.85,-2.49,9.9,-2.07,10.68,4.24,10.42,10.55,10.16,12.03,8.91,11.38,6.36,9.03,4.66,0,0,0,1.3,0,2.5,0.46,2.75,5.33,2.11,10.21,1.46,10.43,1.4,9.52,1.4,8.53,1.4]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_FORM","timeline":[{"name":"D_BROW.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[7.51,62.86,4.31,118.99,-3.75,114.04,1.49,63.76,-6.21,14.82,0,0,0,-14.82,0.56,-5.39,1.73,10.79,8.26,77.22,-0.56,124.81,-2.25,8.08,-2.44,50.28,-0.74,105.5,0.56,122.57,-7.88,130.2,0.19,81.71,-3.38,24.24,0,1.35,-1.13,123.92,-5.82,119.88,6.01,80.82,-4.34,99.69,1.66,37.72,0,56.12,-1.69,2.69,0,0,-3.36,126.84,-1.51,113.14,-1.18,90,-1.14,53.06,-1.7,29.63,-5.07,5.38,-1.15,129.26,-0.4,111.42,3.07,86.26,4.33,56.62,-1.1,30.51,0.01,9.42,0,0,0.56,-9.43,2.04,104.97,-2.83,99.03,4.88,102.42]},{"duration":60,"tweenEasing":0,"offset":87},{"value":[21.77,-63.75,4.88,-30.53,-3.38,-56.57,7.13,-72.73,2.25,-67.35,0,-34.12,-22.52,-35.92,-3.75,-62.86,6.38,-64.65,6.38,-45.8,2.63,-51.18,-1.5,-61.96,5.26,-61.96,2.25,-54.77,0,-42.2,-0.75,-47.59,6.76,-57.47,2.25,-63.75,-0.75,-43.1,1.13,-43.1,1.13,-44,3.75,-61.06,0,-66.45,5.26,-65.55,6.76,-56.57,4.13,-47.59,1.5,-66.45,-1.67,-49.31,-1.05,-55.83,4.55,-63.24,6.13,-66.99,3.78,-64.61,0.33,-64.58,1.41,-47.04,2.43,-53.09,4.19,-50.57,5.85,-53.49,5.76,-63.17,2.4,-63.29,-2.72,-62.45,-7.44,-34.72,8.46,-50.58,9.2,-51.73,11.36,-43.28]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_FORM","timeline":[{"name":"D_BROW.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[2.37,-26.18,0.52,1.33,2.96,48.43,13.61,115.18,-5.33,90.31,0,23.56,2.37,102.09,-4.73,53.66,0.41,-16.02,1.52,9.15,0.98,84.35,4.73,98.16,0.13,57.88,-2.37,-11.78,-5.12,-7.43,1.18,75.91,9.47,112.56,3.55,83.76,-3.55,-23.56,-2.96,-9.6,3.22,20.95,0,0,2.96,81.15,3.6,109.71,2.88,82.02,6.6,105.39,3.03,2.22,0.53,29.32,1.69,26.14,2.37,5.41]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[34.32,-44.5,-1.18,-18.32,-1.18,-47.12,-1.18,-60.21,-2.37,-61.95,-14.2,-74.17,-3.16,-59.33,-13.41,-51.48,-5.92,-18.32,-11.44,-36.65,0,-58.46,-1.97,-55.84,-5.92,-50.61,2.37,-20.94,-7.1,-20.94,-1.58,-54.97,0,-54.1,-1.97,-57.59,14.2,-23.56,2.37,-18.32,-7.1,-30.54,-4.73,-23.56,-1.18,-36.65,0.79,-47.96,-8.99,-46.83,0.72,-55.97,-7.07,-26.14,-7.02,-43.55,-13.55,-46.07,-6.94,-33.22]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_Y","timeline":[{"name":"B_BROW.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_X","timeline":[{"name":"B_BROW.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_Y","timeline":[{"name":"B_BROW.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_X","timeline":[{"name":"B_BROW.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_ANGLE","timeline":[{"name":"B_BROW.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-11.34,70.86,-13.2,55.55,-15.05,40.24,-16.9,24.93,-18.75,9.63,-20.6,-5.68,-22.45,-21,-24.3,-36.33,-26.15,-51.66,-6.44,69.75,-8.3,54.43,-10.15,39.13,-12.01,23.84,-13.86,8.55,-15.71,-6.74,-17.56,-22.04,-19.41,-37.35,-21.26,-52.68,-1.54,68.67,-3.4,53.36,-5.26,38.06,-7.11,22.78,-8.96,7.52,-10.82,-7.78,-12.67,-23.08,-14.52,-38.39,-16.38,-53.72,3.36,67.64,1.5,52.32,-0.36,37.03,-2.22,21.76,-4.07,6.51,-5.92,-8.79,-7.78,-24.09,-9.63,-39.42,-11.49,-54.76,8.25,66.63,6.39,51.32,4.53,36.03,2.68,20.77,0.82,5.54,-1.03,-9.77,-2.88,-25.09,-4.74,-40.43,-6.6,-55.79,13.15,65.61,11.29,50.3,9.43,35.01,7.57,19.75,5.72,4.5,3.87,-10.8,2.02,-26.1,0.16,-41.41,-1.69,-56.75,18.04,64.63,16.18,49.32,14.32,34.03,12.47,18.75,10.61,3.49,8.76,-11.81,6.91,-27.11,5.06,-42.42,3.2,-57.76,22.92,63.72,21.06,48.41,19.21,33.1,17.36,17.81,15.51,2.51,13.66,-12.8,11.8,-28.1,9.95,-43.42,8.1,-58.76,27.79,62.91,25.94,47.58,24.09,32.25,22.25,16.91,20.4,1.59,18.55,-13.73,16.7,-29.06,14.85,-44.39,13.01,-59.73]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[34.49,-61.13,31.86,-43.02,29.24,-24.91,26.62,-6.8,24,11.31,21.38,29.42,18.76,47.52,16.14,65.61,13.53,83.7,28.7,-62.66,26.08,-44.56,23.45,-26.44,20.83,-8.32,18.21,9.82,15.59,27.94,12.96,46.05,10.34,64.16,7.72,82.25,22.92,-64.16,20.29,-46.05,17.66,-27.93,15.03,-9.79,12.41,8.36,9.79,26.48,7.17,44.6,4.54,62.71,1.92,80.79,17.12,-65.61,14.49,-47.51,11.87,-29.38,9.24,-11.23,6.62,6.93,4,25.05,1.37,43.16,-1.25,61.26,-3.88,79.33,11.33,-67.04,8.7,-48.94,6.07,-30.8,3.45,-12.65,0.82,5.54,-1.8,23.65,-4.42,41.75,-7.05,59.83,-9.68,77.88,5.54,-68.48,2.91,-50.38,0.28,-32.24,-2.35,-14.09,-4.97,4.08,-7.59,22.2,-10.21,40.32,-12.84,58.43,-15.46,76.5,-0.26,-69.88,-2.89,-51.78,-5.52,-33.65,-8.14,-15.51,-10.76,2.64,-13.38,20.76,-16.01,38.89,-18.63,57,-21.25,75.07,-6.06,-71.22,-8.69,-53.11,-11.31,-35,-13.94,-16.87,-16.56,1.25,-19.18,19.36,-21.8,37.47,-24.42,55.57,-27.04,73.65,-11.88,-72.45,-14.5,-54.35,-17.12,-36.27,-19.73,-18.19,-22.35,-0.09,-24.97,18,-27.59,36.1,-30.21,54.18,-32.82,72.26]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_ANGLE","timeline":[{"name":"B_BROW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[21.06,-45.35,19.9,-33.32,18.74,-21.29,17.58,-9.26,16.43,2.78,15.27,14.81,14.11,26.84,12.95,38.87,11.79,50.9,16.96,-46.04,15.8,-34.01,14.64,-21.98,13.48,-9.95,12.32,2.08,11.16,14.11,10,26.14,8.84,38.18,7.68,50.21,12.85,-46.74,11.69,-34.71,10.53,-22.67,9.37,-10.64,8.21,1.39,7.05,13.42,5.9,25.45,4.74,37.48,3.58,49.51,8.74,-47.43,7.58,-35.4,6.42,-23.37,5.27,-11.34,4.11,0.69,2.95,12.73,1.79,24.76,0.63,36.79,-0.53,48.82,4.64,-48.12,3.48,-36.09,2.32,-24.06,1.16,-12.03,0,0,-1.16,12.03,-2.32,24.06,-3.48,36.09,-4.64,48.12,0.53,-48.82,-0.63,-36.79,-1.79,-24.76,-2.95,-12.72,-4.11,-0.69,-5.27,11.34,-6.42,23.37,-7.58,35.4,-8.74,47.43,-3.58,-49.51,-4.74,-37.48,-5.9,-25.45,-7.05,-13.42,-8.21,-1.39,-9.37,10.64,-10.53,22.67,-11.69,34.71,-12.85,46.74,-7.68,-50.21,-8.84,-38.17,-10,-26.14,-11.16,-14.11,-12.32,-2.08,-13.48,9.95,-14.64,21.98,-15.8,34.01,-16.96,46.04,-11.79,-50.9,-12.95,-38.87,-14.11,-26.84,-15.27,-14.81,-16.43,-2.78,-17.58,9.26,-18.74,21.29,-19.9,33.32,-21.06,45.35]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-14.01,79.68,-16.75,61.4,-19.49,43.12,-22.22,24.84,-24.96,6.55,-27.7,-11.73,-30.43,-30.01,-33.17,-48.29,-35.91,-66.57,-7.77,78.05,-10.51,59.76,-13.25,41.48,-15.98,23.2,-18.72,4.92,-21.46,-13.37,-24.19,-31.65,-26.93,-49.93,-29.67,-68.21,-1.53,76.41,-4.27,58.12,-7.01,39.84,-9.74,21.56,-12.48,3.28,-15.22,-15.01,-17.95,-33.29,-20.69,-51.57,-23.43,-69.85,4.71,74.77,1.97,56.49,-0.77,38.2,-3.5,19.92,-6.24,1.64,-8.98,-16.64,-11.71,-34.93,-14.45,-53.21,-17.19,-71.49,10.95,73.13,8.21,54.85,5.47,36.56,2.74,18.28,0,0,-2.74,-18.28,-5.47,-36.56,-8.21,-54.85,-10.95,-73.13,17.19,71.49,14.45,53.21,11.71,34.93,8.98,16.64,6.24,-1.64,3.5,-19.92,0.77,-38.2,-1.97,-56.49,-4.71,-74.77,23.43,69.85,20.69,51.57,17.95,33.29,15.22,15,12.48,-3.28,9.74,-21.56,7.01,-39.84,4.27,-58.12,1.53,-76.41,29.67,68.21,26.93,49.93,24.19,31.65,21.46,13.37,18.72,-4.92,15.98,-23.2,13.25,-41.48,10.51,-59.76,7.77,-78.05,35.91,66.57,33.17,48.29,30.43,30.01,27.7,11.73,24.96,-6.56,22.22,-24.84,19.49,-43.12,16.75,-61.4,14.01,-79.68]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_Y","timeline":[{"name":"B_EYE_BALL.05","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE_BALL.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_X","timeline":[{"name":"B_EYE_BALL.05","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EYE_BALL.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_FORM","timeline":[{"name":"B_EYE_BALL.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[31.56,49.59,14.93,44.1,1.94,38.11,-4.15,31.15,-0.1,22.73,6.1,26.72,1.36,30.92,-10.32,35.85,-24.94,41.99,26.88,39.39,12.49,34.48,1.35,28.93,-3.77,22.77,-0.07,15.98,4.49,19.04,0.48,22.31,-8.92,26.09,-20.5,30.67,21.89,28.93,9.82,24.52,0.58,19.27,-3.49,13.75,-0.04,8.52,3.04,10.72,-0.16,13.23,-7.18,16.04,-15.58,19.14,17.53,18.98,7.66,15.23,0.17,10.57,-3.02,5.99,-0.01,2.49,1.28,3.67,-1.35,5.08,-6.2,6.58,-11.61,8.02,14.72,10.33,6.7,7.59,0.62,4.3,-2.1,1.43,0,0,-1.1,-0.23,-3.76,-0.78,-7.05,-1.45,-10.03,-2.07,18.53,-2.16,10.59,-3.37,3.96,-4.17,0.19,-4.68,0.83,-5.02,-0.13,-6.53,-3.61,-9.96,-8.07,-13.66,-11.99,-15.98,22.38,-16.97,14.8,-17.42,7.86,-17.39,3.29,-17.22,2.83,-17.21,1.55,-18.84,-3.15,-22.58,-9.19,-26.73,-14.51,-29.57,26.26,-32.7,19.14,-32.7,11.99,-32.51,6.75,-32.31,5.31,-32.27,3.19,-33.55,-3.16,-36.57,-11.2,-40.14,-18.38,-43.04,30.12,-47.97,23.42,-47.36,16.02,-46.68,10.03,-46.13,7.56,-45.9,4.06,-47.06,-4.42,-49.89,-14.91,-53.38,-24.39,-56.53]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[11.15,21.7,7.83,15.26,4.17,8.91,1.22,3.54,0,0,-0.14,1.29,-0.46,4.65,-0.87,9.3,-1.24,14.47,2.2,17.99,-2.81,12.86,-4.57,7.61,-3.49,3.05,0,0,1.59,0.73,2.66,2.98,3.01,6.28,2.42,10.15,-5.19,13.93,-12.34,10.2,-12.58,6.15,-7.83,2.51,0,0,3.44,0,6,0.82,7.17,2.44,6.45,4.85,-10.22,10.65,-19.98,8.22,-19.31,5.1,-11.53,2.09,0,0,5.1,-0.59,8.94,-0.93,10.74,-0.72,9.71,0.36,-12.08,9.3,-24.94,7.86,-24.12,5,-14.25,1.96,0,0,6.26,-0.77,10.88,-1.38,12.82,-1.68,11.06,-1.54,-10.76,8.28,-19.97,6.68,-18.82,3.87,-10.89,1.03,0.27,-0.68,4.93,-1.29,7.96,-1.82,8.83,-2.13,6.98,-2.05,-7.55,5.81,-13.36,4.11,-12.25,1.53,-6.67,-0.94,0.93,-2.32,3.72,-2.74,4.93,-3.11,4.48,-3.33,2.32,-3.29,-3.59,2.76,-6.15,1,-5.22,-1.29,-2.14,-3.34,1.74,-4.36,2.58,-4.56,1.85,-4.74,-0.01,-4.85,-2.57,-4.83,0,0,0.74,-1.84,1.55,-3.88,2.21,-5.52,2.48,-6.2,1.4,-6.2,-1.2,-6.2,-4.42,-6.21,-7.34,-6.21]}]},{"name":"B_EYE_BALL.09","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[17.16,61.85,11.71,55.12,5.69,48.34,0.81,41.68,-1.18,35.32,-3,41.02,-9.17,45.53,-17.08,49.57,-24.12,53.84,14,44.74,9.52,39.55,4.65,34.47,0.75,29.56,-0.83,24.84,-2.63,29.21,-8.34,32.8,-15.63,36.04,-22.17,39.35,10.51,25.84,7.12,22.27,3.47,19.15,0.6,16.22,-0.44,13.25,-2.15,16.35,-7.38,19.16,-14.03,21.73,-20,24.14,7.68,10.53,5.24,8.39,2.58,6.74,0.53,5.31,-0.13,3.86,-1.84,5.58,-6.67,7.33,-12.76,8.98,-18.25,10.36,6.52,4.23,4.59,2.97,2.45,1.59,0.71,0.46,0,0,-1.91,0.02,-6.57,0.06,-12.31,0.11,-17.51,0.16,12.45,-0.02,8.89,-0.84,5.06,-2.06,1.8,-3.04,-0.02,-3.13,-3.53,-3.35,-9.31,-3.49,-15.34,-3.6,-19.61,-3.72,21.56,-10.42,15.59,-10.53,9.26,-11.01,3.68,-11.27,-0.05,-10.72,-5.95,-11.36,-13.6,-12.05,-20.64,-12.69,-24.7,-13.16,31.94,-23.28,23.25,-22.58,14.12,-22.08,5.89,-21.38,-0.1,-20.1,-8.67,-21.22,-18.46,-22.61,-26.81,-23.93,-30.99,-24.81,41.69,-34.91,30.44,-33.46,18.66,-32.09,7.93,-30.55,-0.15,-28.59,-11.21,-30.14,-23.01,-32.17,-32.52,-34.1,-36.69,-35.35]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[-4.56,-0.09,-3.72,-0.07,-2.45,-0.04,-1.08,-0.01,0,0,0.86,-0.01,2.58,-0.02,4.64,-0.04,6.54,-0.05,-9.59,-0.18,-7.81,-0.14,-5.13,-0.09,-2.29,-0.03,0,0,1.87,-0.01,5.48,-0.04,9.8,-0.08,13.76,-0.1,-13.67,-0.26,-11.18,-0.2,-7.34,-0.12,-3.25,-0.04,0,0,2.54,-0.02,7.71,-0.06,13.92,-0.11,19.61,-0.15,-15.35,-0.29,-12.73,-0.22,-8.34,-0.13,-3.62,-0.05,0,0,2.41,-0.02,8.26,-0.06,15.48,-0.12,22.02,-0.17,-13.67,-0.26,-8.82,-0.18,-4.2,-0.09,-0.89,-0.02,0,0,2.4,0.27,7.63,0.33,14.1,0.18,20.23,-0.14,-9.59,-0.18,-3.1,-0.1,1.14,-0.02,2.42,0.02,0,0,1.69,0.57,5.53,0.73,10.46,0.51,15.41,-0.09,-4.56,-0.09,3.29,0,6.91,0.05,5.93,0.05,0,0,0.46,0.85,2.36,1.13,5.18,0.83,8.39,-0.04,0,0,9.31,0.09,12.42,0.12,9.31,0.09,0,0,-1.12,1.12,-1.5,1.5,-1.12,1.12]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_KIRAKIRA","timeline":[{"name":"D_EYE_BALL.07","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.08","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.09","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.10","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.11","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.12","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_L_OPEN","timeline":[{"name":"D_EYE.01","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[3.05,110.77,4.21,108.19,0.23,107.78,-1.27,93.36,-19.98,70.89,-20.98,38.83,2.9,99.81,-6.12,118.5,-5.37,93.04,-7.75,49.38,3.07,79.83,-6.86,100.94,-8.08,106.09,-6.38,97.55,-16.18,78.14,-11.92,103.52,-4.58,86.76,0.18,107.22,-6.49,103.27,0.68,106.42,-2.8,100.29,8.34,107.54,-6.77,104.64,-2.49,116.57,-2.7,105.53,-2.26,96.43,-15.26,82.09,-2.96,96.26,1.52,50.27,-18.3,58.32,10.76,83.7,9.73,78.46,-11.84,92.24,-11.63,80.72,-8.47,22.07,7.19,78.2,-0.37,88.04,-9.63,67.09,-21.47,52.53,-16.54,72.63,-11.74,45.11,2.1,87.11,-16.31,78.12,-4.28,104.08,-2.34,102.97,-9.56,103.09,-11.32,102.82,1.58,106.05,-11.75,105.12,-2.71,102.37,-5.56,101.84,-2.53,102.3,-7.83,98.55,-11.83,103.97,-4.64,95.78]},{"duration":40,"tweenEasing":0,"value":[1.03,103.6,7.05,138.24,1.5,140.17,-8.67,93.45,-13.43,85.07,-13.16,53,4.91,115.67,-4.12,134.37,-3.37,121.16,-9.78,69.12,1.71,87.97,-0.83,123.9,-4.05,140.01,4.55,109.08,1.73,82.17,-1.17,136.79,-3.59,100.7,2.19,141.78,-1.79,140.65,3.53,123.41,3.92,136.78,3.46,125.83,-0.05,132.11,-0.49,132.43,-1.86,139.36,-6.29,108.92,-5.84,94.9,17.89,108.91,4.63,59.44,-8.8,65.73,12.78,99.56,14.52,77.01,5.31,96.19,-5.33,94.41,-1.41,36.24,17.28,86.98,17.29,95.37,2.82,67.58,-13.9,66.71,-7.8,83.34,-5.68,53.88,2.76,99.76,-9.26,106.87,-0.93,112.22,2.86,128.18,-3.52,135.07,-2.59,141.89,4.26,139.97,-2.35,138.39,1.48,121.14,2.5,135.11,-1.87,138.15,-3.81,122.79,-1.08,140.46,-4.66,112.94]},{"duration":40,"tweenEasing":0,"offset":109},{"offset":2,"value":[-2.52,-3.37,0,0,0,0,0,0,0,0,8.07,-14.5,-1.01,-7.73,0,0,0,-13.53,0,0,-3.03,-6.77,0.64,-12.58,3.03,-3.87,0,0,-5.05,-11.6,0,-4.83,1.68,-4.83,-3.36,-6.77,-1.52,-1.44,5.34,-18.37,1.01,-4.83,5.05,-9.67,6.06,-16.43,-0.67,-5.48,5.05,-4.83,0,0,6.06,-8.7,0,0,0,0,0,0,0,0,3.03,-2.9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.02,-1.93,0,0,0.48,-3.39,-3.03,-5.79,-4.04,-5.8,-0.72,-16.12,0.67,-4.83,-3.41,-11.92,-1.52,-5.31,-3.7,-6.59,0,-8.7,-1.01,-4.83,-4.43,-9.35,-2.02,-2.9]}]},{"name":"D_EYE.03","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[49.79,123.74,8.07,118.58,-26.91,63.16,-12.28,11.76,0,0,0,0,13.46,28.36,29.6,92.8,8.07,58,-2.69,70.89,18.84,95.38,6.73,58]},{"duration":40,"tweenEasing":0,"value":[49.79,123.74,8.07,118.58,-26.91,63.16,-6.73,16.59,0,0,0,0,13.46,28.36,29.6,92.8,8.07,58,-2.69,70.89,18.84,95.38,6.73,58]},{"duration":40,"tweenEasing":0,"offset":23},{"offset":6,"value":[0.03,4.51,0.03,3.87,-2,3.23]}]},{"name":"D_EYE.05","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[2.23,-35.01,18.89,-29,14.59,-0.68,-6.66,1.12,-10.95,-20.83,3.45,-14.9]},{"duration":40,"tweenEasing":0,"offset":11},{"duration":40,"tweenEasing":0,"offset":11},{"value":[0.67,0,0.67,0,0.68,1.28,0.67,0,0.67,0,0.67]}]},{"name":"D_EYE.09","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-11.01,99.57,-20.26,94.16,-22.76,84.33,-18.26,74.46,-14.43,80.21,-11.41,91.45,-17.51,87.58]},{"duration":40,"tweenEasing":0,"value":[-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69]},{"duration":40,"tweenEasing":0,"offset":13},{"value":[4.04,-0.97,2.02,-0.97,0,-1.93,0,-4.83,0,-4.83,0,-4.83,0,-4.83]}]},{"name":"D_EYE.10","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-12.55,99.26,-19.43,94.67,-25.63,88.38,-39.41,81.98,-28.75,82.73,-17.99,92.08]},{"duration":40,"tweenEasing":0,"value":[-4.04,105.69,-2.69,110.2,-4.71,110.2,-8.75,104.4,-2.02,107.62,-4.04,106.98]},{"duration":40,"tweenEasing":0,"offset":11},{"value":[-1.35,-2.02,-2.68,-3.53,-2.95,-6.12,-1.74,-7.68,-1.24,-5.78,-1.09,-3.74]}]},{"name":"D_EYE.11","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-5.05,77.33,0,0,0,0,0,0,0,0,0,0,-1.01,48.33,9.08,141.14,-7.06,147.9,11.1,180.77,-17.16,183.67,5.05,119.87,21.19,175.94,-2.02,34.8,-11.1,109.23,0.42,51.9,0.49,59.92,0,0,-2.59,35.9,-2.55,176.91,-4.69,30.32,0,0,-2.29,35.83,0,0,8.27,157.69,-1.97,27.94,-1.11,19.06,-1.37,36.65]},{"duration":40,"tweenEasing":0,"value":[-5.05,77.33,0,0,0,0,0,0,0,0,0,0,-1.01,48.33,-3.03,141.14,-7.06,147.9,9.08,169.17,-16.15,174.97,5.05,119.87,-3.03,164.34,-2.02,34.8,-15.14,107.3,0.42,51.9,0.49,59.92,0,0,-2.59,35.9,-3.56,169.18,-4.69,30.32,0,0,-2.29,35.83,0,0,1.2,149.96,-1.97,27.94,-1.11,19.06,-1.37,36.65]},{"duration":41,"offset":55}]},{"name":"D_EYE.13","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-3.36,56.31,-25.74,47.13,-17.07,20.54,-11.86,8.62,4.88,-4.03,-4.54,20.22,-9.08,44.95,-9.5,28.76,-13.71,46.64,-4.54,8.7]},{"duration":40,"tweenEasing":0,"value":[0.58,60.48,-21.46,51.1,-13.81,30.44,-9.77,21.28,-4.05,12.34,-1.51,29.46,-1.65,50,-4.74,36.47,-9.23,53.84,-3.6,20.76]},{"duration":40,"tweenEasing":0,"offset":19},{"offset":2,"value":[0.66,-1.29,4.07,4.49,2.72,3.85,2.02,0.63,2.02,0.63,2.02,-0.01,0.67,0,0,0,0.68,0.64]}]},{"name":"D_EYE.17","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[20.45,98.49,22.43,104.67,24.76,112.64,18.51,109.93,17.1,105.8]},{"duration":40,"tweenEasing":0,"value":[15.25,134.19,17.81,144.17,20.74,157.01,11.08,152.18,9.24,145.5]},{"duration":40,"tweenEasing":0,"offset":9},{"value":[1.35,-7.09,1.35,-7.09,1.35,-7.09,1.35,-7.09,1.35,-7.09]}]},{"name":"D_EYE.18","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22]},{"duration":40,"tweenEasing":0,"value":[-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25]},{"duration":41,"offset":15}]},{"name":"D_EYE.19","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58]},{"duration":40,"tweenEasing":0,"value":[-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35]},{"duration":41,"offset":15}]},{"name":"B_EYE_BALL.08","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":1,"value":[149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84]},{"duration":41,"offset":161}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_R_OPEN","timeline":[{"name":"D_EYE.00","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-3.94,111.73,-0.37,105.09,12.83,103.17,6.96,100.08,-1.47,67.18,26.02,92,-5.31,129.22,-22.62,81.2,27.39,78.92,-4.76,42.47,-5.86,93.93,-22.9,112.58,-0.92,69.59,6.6,101.23,-8.61,106.26,17.77,97.44,10.26,87.04,-11.36,97.76,1.28,132.72,-17.77,110.34,-8.61,116.1,13.38,99.96,15.63,44.87,8.71,58.39,10.9,84.93,2.84,105.64,-4.86,109.41,-7.51,108.32,-4.21,103.09,-16.86,113.07,-30.78,106.52,12.28,101.81,15.58,98.86,24.74,108.33,-7.15,107.48,-7.02,102.94,-1.47,101.17,25.45,106.32,19.56,99.19,14.84,79.99,4.4,87.53,16.49,100.14,22.23,122.86,-5,101.67,-13.8,108.37,-18.14,118.18,-9.99,93.14,-18.44,102.67,-16,120.96,-12.38,109.96,8.73,105.07,8.61,97.56,12.28,73.2,5.18,44.82,-16.56,63.94,19.42,60.4,15.63,103.6,18.83,99.66,21.9,96.47]},{"duration":40,"tweenEasing":0,"value":[2.66,111.72,0.37,134.92,9.18,114.69,-5.88,96.7,-5.88,72.78,19.4,100.15,-0.92,156.18,-22.35,87.06,27.39,83,-4.77,46.55,-5.87,98.01,-22.91,116.66,-1.19,74.94,10.62,144.46,-2.75,144.92,13.54,109.82,3.64,95.69,-8.43,137.75,1.28,136.79,-16.68,115.94,-8.61,120.15,13.37,104.04,15.62,48.95,8.71,62.47,10.9,89.01,2.84,109.71,-4.31,110.95,-6.05,134.09,2.38,147.17,-9.53,132.74,-6.05,137.55,13.92,129.28,13.73,133.11,5.33,103.76,-0.55,147.49,-1.16,140.24,7.33,139.15,15.03,112.42,6.35,99.37,13.72,92.71,-2.22,91.44,12.27,135.41,22.23,126.94,1.6,147.78,-9.41,134.82,-18.14,122.25,-10.54,97.39,-15.7,109.8,-3.36,144.86,-5.78,143.87,9.46,141.02,8.61,101.63,12.27,77.28,5.18,48.9,-16.56,68.02,19.42,64.48,11.6,141.41,13.13,123.74,16.39,109.19]},{"duration":40,"tweenEasing":0,"offset":117},{"value":[1.47,6.78,-3.66,-8.81,1.47,1.36,0,0,-6.59,-2.03,4.47,-4.08,0,0,-8.06,-3.39,0,0,0,0,-4.03,-9.49,-8.43,-8.14,-6.6,-2.03,2.2,-11.52,-4.4,-11.86,2.2,-6.78,-3.73,-5.41,0,-6.78,0,0,-5.86,-8.81,-8.8,-2.71,0,0,0,0,-2.2,0,-1.1,0,0.37,-0.34,1.1,-3.05,-2.93,-5.42,-2.2,-8.14,-6.96,-13.22,0,0,2.2,-6.1,0.73,-7.46,1.5,4.06,-3.66,-16.27,-1.47,-7.46,1.47,-8.14,-0.03,-5.42,2.2,0,0.73,-2.71,0,0,4.4,-8.14,0,0,-1.47,-13.9,-6.23,-11.86,-4.4,-3.05,-6.23,-4.41,-1.47,-1.36,-1.47,-2.03,-7.33,-11.86,-1.47,-10.85,0,0,-2.2,1.02,0,0,0,0,0,0,5.86,-7.46,4.44,-5.43,5.94,-3.4]}]},{"name":"D_EYE.02","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[25.29,84.4,2.2,104.74,-28.23,74.19,-5.01,10.15,-10.9,-23.69,-2.2,-28.47,10.99,2.03,17.59,40.68,-6.6,19.32,-12.83,38.64]},{"duration":40,"tweenEasing":0,"value":[26.75,93.89,3.66,121.01,-38.79,94.56,-12.37,6.77,-6.43,-10.14,-0.73,-20.34,12.46,2.03,19.06,40.68,-5.13,31.52,-5.5,53.56]},{"duration":40,"tweenEasing":0,"offset":19},{"value":[-5.5,-7.12,-1.1,-13.22,-0.02,-2.03,0,0,1.13,1.01,-8.43,0.68,0,0,-5.5,-8.14,-7.7,-13.22,-3.3,-11.19]}]},{"name":"D_EYE.04","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-21.4,-14.62,-24.11,-28.65,-18.27,-44.95,-4.59,-37.7,-4.95,-20.49,-13.97,-29.3]},{"duration":40,"tweenEasing":0,"value":[-10.7,-7.31,-12.05,-14.32,-5.47,-23.15,-0.46,-15.8,-2.47,-10.25,-6.98,-14.65]},{"duration":40,"tweenEasing":0,"offset":11},{"offset":2,"value":[-1.1,3.05,0,0,0,0,0,0,0,3.05]}]},{"name":"D_EYE.06","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-2.57,85.76,24.92,65.08,-27.12,31.18,-6.96,6.1,31.88,-16.61,30.05,-18.3,7.33,70.5,27.49,124.74,20.16,181.68,0,159.99,7.33,166.09,-11.36,174.9,12.46,114.23,15.03,180.67,-0.37,79.66,5.13,75.59,-2.63,66.47,-0.55,77.91,11.15,71.54,16.68,77,-9.57,99.9]},{"duration":40,"tweenEasing":0,"value":[7.33,70.5,24.92,65.08,-27.12,31.18,-8.06,5.08,35.18,-19.66,47.64,-53.89,7.33,70.5,30.63,119.7,34.41,150.88,5.5,131.18,13.93,158.97,-7.33,184.73,12.46,114.23,13.19,173.21,8.43,90.84,11.73,91.86,1.3,65.05,-15.78,69.07,13.96,63.4,20.61,64.74,-6.21,96.27]},{"duration":41,"offset":41}]},{"name":"D_EYE.07","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[40.33,58.76,45.62,72.58,42.37,86.67,27.34,89.3,29.22,76.13,33.37,63.75,39.01,71.57,36.66,80.63]},{"duration":40,"tweenEasing":0,"value":[21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47]},{"duration":40,"tweenEasing":0,"offset":15},{"offset":1,"value":[-4.75,0,-4.75,-3.66,4.07,-0.01,-4.74,0,-4.75,0,-4.75,0,-4.75,0.73,-3.39]}]},{"name":"D_EYE.08","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[65.96,61.69,46.18,76.61,33.35,81.69,26.39,73.89,39.58,73.22,46.18,67.79,41.59,73.89,38.66,78.64,32.98,80.33,33.72,77.96,47.09,71.01,40.31,76.77,51.31,71.18,32.43,77.96,39.42,77.68]},{"duration":40,"tweenEasing":0,"value":[34.45,105.76,21.26,113.21,20.16,108.13,21.26,109.15,21.26,109.15,21.26,109.15,21.8,113.21,21.8,113.21,21.26,106.09,21.26,109.15,23.64,111.69,21.99,111.35,27.12,109.82,20.71,107.11,21.09,112.26]},{"duration":40,"tweenEasing":0,"offset":29},{"offset":1,"value":[-6.78,0,-6.78,0,-6.78,-0.02,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78]}]},{"name":"D_EYE.12","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[13.01,40.22,8.8,54.55,11.73,31.36,10.08,2.71,-8.25,-12.14,12.46,5.66,15.39,22.65,10.99,38.62,9.35,13.55,13.93,26.91,5.86,0.96,10.26,39.89]},{"duration":40,"tweenEasing":0,"value":[10.26,45.3,8.8,63.71,11.73,40.51,11.73,18.98,8.8,14.3,12.46,14.81,15.39,31.8,10.99,47.78,13.19,27.78,13.93,36.06,14.66,19.27,10.26,49.04]},{"duration":40,"tweenEasing":0,"offset":23},{"value":[-6.6,0.68,-5.86,-0.68,-3.66,0,-2.93,-7.46,-5.13,-4.75,-5.13,-5.42,-3.66,0,-2.2,0,-2.93,-3.39,-0.73,0.68,-2.2,-2.71,-5.86,-0.68]}]},{"name":"D_EYE.14","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-40.61,126.07,-31.45,102.69,-20.14,80.58,-2.5,105.34,-14.88,120.74,-16.18,104.09,-22.24,112.72,-9.74,95.17]},{"duration":40,"tweenEasing":0,"value":[-36.21,166.75,-27.05,143.36,-15.74,121.26,1.9,146.02,-10.48,161.41,-11.79,144.76,-17.84,153.39,-5.35,135.85]},{"duration":40,"tweenEasing":0,"offset":15},{"value":[-10.26,-0.68,-4.4,-6.1,-13.93,-14.24,-8.06,-14.91,-4.4,-6.1,-7.33,-11.52,-4.4,-6.1,-10.26,-13.56]}]},{"name":"D_EYE.15","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2]},{"duration":40,"tweenEasing":0,"value":[16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57]},{"duration":40,"tweenEasing":0,"offset":15},{"value":[-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08]}]},{"name":"D_EYE.16","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-1.47,17.55,9.18,24.97,12.76,34.06,-0.27,32.77,4.66,28.7]},{"duration":40,"tweenEasing":0,"value":[-1.47,17.55,9.18,24.97,12.76,34.06,-0.27,32.77,4.66,28.7]},{"duration":40,"tweenEasing":0,"offset":9},{"value":[-2.2,-2.03,-2.2,-2.03,-2.2,-2.03,-2.2,-2.03,-2.2,-2.03]}]},{"name":"B_EYE_BALL.02","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":1,"value":[127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83]},{"duration":40,"tweenEasing":0,"offset":1,"value":[127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83]},{"duration":41,"offset":161}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ANGLE_Z","timeline":[{"name":"B_FACE.02","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-9.7},{"duration":60,"tweenEasing":0},{"x":10.7}]},{"name":"B_HAIR_SIDE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.47,-0.01,-0.86,-0.01,-0.77,-0.01,-0.61,0,-0.44,0,-0.54,0,-0.3,0,0,0,0,0,-4,-0.07,-7.7,-0.13,-8.5,-0.14,-7.05,-0.04,-5.6,0.05,-4.87,0.05,-2.53,0.03,0,0,0,0,-7.51,-0.13,-14.5,-0.25,-16.24,-0.26,-13.5,-0.08,-10.77,0.09,-9.2,0.1,-4.77,0.05,0,0,-1.89,-0.03,-13.33,-0.03,-24.15,-0.04,-27.34,-0.04,-23.65,-0.09,-19.95,-0.14,-18.92,-0.14,-15.94,-0.08,-12.58,0.06,-9.28,-0.16,-20.95,0.04,-31.89,0.23,-35.17,0.2,-35.11,-0.67,-35.05,-1.55,-34.09,-1.5,-30.26,-0.97,-26.04,-0.36,-17.28,-0.29,-28.55,0.12,-38.97,0.5,-42.02,0.43,-46.19,-1.33,-50.36,-3.09,-49.45,-2.99,-44.33,-1.97,-38.79,-0.85]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":54,"value":[0.83,-0.02,0.71,-0.04,0.6,-0.04,0.53,-0.04,0.61,-0.02,0.68,-0.01,0.79,0,0.65,-0.01,0.45,-0.03,9.69,-0.28,8.62,-0.39,7.63,-0.5,7.08,-0.5,7.64,-0.29,8.19,-0.07,8.22,-0.08,6.87,-0.22,5.27,-0.37,18.54,-0.53,16.53,-0.74,14.66,-0.95,14.19,-0.96,16.97,-0.54,19.75,-0.11,19.07,-0.14,14.79,-0.42,10.09,-0.72,24.57,-0.32,20.6,-0.48,16.8,-0.79,15.98,-0.82,22.88,-0.06,29.78,0.7,28.96,0.61,22.34,0.07,15.18,-0.28,24.41,-0.92,20.93,-0.56,17.63,-0.33,17.29,-0.22,25.98,0.4,34.68,1.02,33.63,1.06,25.8,1.05,17.34,1.19,23.19,-1.64,20.63,-0.7,18.27,0.16,18.62,0.42,28.8,0.83,38.98,1.23,37.63,1.43,28.62,2.07,18.86,2.76]}]},{"name":"B_HAIR_SIDE.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-0.2,-0.01,-0.43,-0.03,-0.61,-0.04,-0.7,-0.04,-0.61,-0.04,-0.43,-0.03,-0.2,-0.01,0,0,0,0,-0.43,-0.02,-0.89,-0.05,-1.28,-0.08,-1.48,-0.09,-1.28,-0.08,-0.89,-0.05,-0.43,-0.02,0,0,0,0,-0.61,-0.03,-1.28,-0.08,-1.83,-0.11,-2.11,-0.13,-1.83,-0.11,-1.28,-0.08,-0.61,-0.03,0,0,0,0,-0.7,-0.04,-1.48,-0.09,-2.11,-0.13,-2.37,-0.14,-2.11,-0.13,-1.48,-0.09,-0.7,-0.04,0,0,-0.52,-0.03,-8.11,-0.3,-14.2,-0.66,-17.65,-0.95,-17.35,-1.06,-16,-0.87,-13.56,-0.42,-10.68,0.07,-8.01,0.43,-1.78,-0.11,-15.38,-0.58,-25.94,-1.18,-31.45,-1.67,-29.9,-1.85,-27.55,-1.56,-23.37,-0.9,-18.47,-0.13,-13.92,0.44,-3.33,-0.2,-22.22,-0.84,-36.47,-1.6,-43.15,-2.22,-39.33,-2.42,-36.54,-2.1,-31.2,-1.34,-24.84,-0.44,-18.99,0.3,-4.73,-0.28,-28.42,-1.06,-45.67,-1.88,-52.51,-2.5,-44.98,-2.68,-42.74,-2.36,-37.29,-1.59,-30.57,-0.63,-24.48,0.24]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.41,-0.03,0.85,-0.06,1.22,-0.08,1.4,-0.09,1.96,-0.13,1.51,-0.1,0.65,-0.04,0,0,0,0,0.85,-0.05,1.77,-0.12,2.55,-0.17,2.95,-0.19,4.03,-0.27,3.09,-0.2,1.34,-0.08,0,0,0,0,1.22,-0.08,2.55,-0.17,3.65,-0.24,4.2,-0.28,5.88,-0.39,4.53,-0.3,1.96,-0.12,0,0,0,0,1.4,-0.09,2.95,-0.19,4.2,-0.28,4.72,-0.31,7.19,-0.47,5.6,-0.37,2.4,-0.16,0,0,5.05,-0.33,8.29,-0.28,11.76,-0.07,14.77,0.15,16.63,0.25,16.8,0.02,12.69,-0.14,6.87,-0.19,1.91,-0.13,9.73,-0.64,14.57,-0.53,19.71,-0.23,24.23,0.09,27.17,0.24,25.05,0.04,18.45,-0.15,10.05,-0.25,2.54,-0.17,14.27,-0.94,19.71,-0.87,25.55,-0.65,30.6,-0.42,33.68,-0.31,30.02,-0.38,21.61,-0.39,11.28,-0.32,1.91,-0.13,18.88,-1.24,23.21,-1.28,28.01,-1.31,31.89,-1.34,33.48,-1.35,29.82,-1.21,20.93,-0.85,9.94,-0.4]}]},{"name":"B_HAIR_TWIN.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[1.34,-0.12,2.83,-0.26,4.03,-0.36,4.53,-0.41,4.03,-0.36,2.83,-0.26,1.34,-0.12,0,0,-2.31,-0.35,-1.25,-0.43,-0.09,-0.52,0.86,-0.58,1.28,-0.6,-0.36,-0.56,-1.19,-0.4,-1.11,-0.2,0,0,-4.73,-0.8,-3.93,-0.83,-3.06,-0.85,-2.33,-0.85,-1.96,-0.84,-4.73,-0.8,-5.2,-0.58,-3.56,-0.28,0,0,-6.93,-1.06,-6.45,-1.06,-5.93,-1.03,-5.49,-1,-5.23,-0.98,-9.13,-0.95,-9.23,-0.7,-6.02,-0.34,0,0,-8.57,-0.86,-8.57,-0.86,-8.57,-0.86,-8.57,-0.86,-8.57,-0.86,-13.59,-0.88,-13.3,-0.69,-8.5,-0.37,0,0,-14.9,-1.04,-17.51,-1.14,-20.42,-1.31,-22.71,-1.47,-23.45,-1.54,-26.1,-1.53,-23.73,-1.33,-17.53,-1.05,-8.73,-0.78,-16.25,-0.98,-22.09,-1.14,-28.55,-1.39,-33.78,-1.63,-35.92,-1.73,-36.42,-1.72,-32.22,-1.59,-24.93,-1.42,-16.16,-1.3,-15.6,-0.84,-24.69,-1.01,-34.69,-1.26,-42.86,-1.48,-46.44,-1.58,-45.1,-1.61,-39.43,-1.62,-31.42,-1.65,-23.07,-1.71,-15.95,-0.74,-27.69,-0.89,-40.66,-1.06,-51.16,-1.2,-55.49,-1.25,-52.72,-1.35,-46.02,-1.6,-37.73,-1.9,-30.23,-2.17]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.33,-0.03,0.68,-0.08,0.98,-0.11,1.13,-0.13,1.22,-0.09,1.39,-0.02,1.6,0.07,1.8,0.14,0,0,0.68,-0.07,1.42,-0.16,2.05,-0.23,2.37,-0.26,2.57,-0.2,2.94,-0.04,3.38,0.15,3.78,0.3,0,0,0.98,-0.1,2.05,-0.23,2.94,-0.33,3.38,-0.38,3.65,-0.28,4.17,-0.06,4.81,0.21,5.39,0.43,0,0,1.13,-0.13,2.37,-0.26,3.38,-0.38,3.8,-0.42,4.04,-0.32,4.64,-0.08,5.38,0.21,6.05,0.48,2.12,0.01,4.4,-0.03,6.98,-0.21,8.97,-0.4,9.5,-0.49,9.44,-0.35,8.8,-0.03,7.94,0.35,7.19,0.67,5.05,-0.34,9.06,-0.17,13.53,-0.1,17.07,-0.08,18.28,-0.08,17.54,0.06,15.31,0.39,12.48,0.79,9.95,1.13,8.3,-0.84,14.26,-0.4,20.87,0.04,26.19,0.38,28.29,0.51,26.72,0.65,22.75,0.97,17.81,1.36,13.36,1.7,11.39,-1.26,19.19,-0.59,27.82,0.16,34.8,0.77,37.68,1.01,35.36,1.15,29.71,1.47,22.75,1.86,16.44,2.22]}]},{"name":"B_HAIR_TWIN.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[3.62,0.34,7.63,0.72,10.87,1.02,12.21,1.15,10.87,1.02,7.63,0.72,3.62,0.34,0,0,0,0,0.05,-0.14,1.23,0.03,2.99,0.42,4.81,0.96,2.73,0.91,-0.03,0.99,-2.62,1.17,-4.17,1.4,0,0,-3.67,-0.62,-5.5,-0.66,-5.43,-0.18,-3.38,0.76,-6.12,0.79,-8.33,1.33,-9.4,2.12,-8.77,2.96,0,0,-7.01,-1.09,-11.45,-1.33,-12.67,-0.75,-10,0.6,-13.59,0.67,-15.4,1.53,-15.14,2.83,-12.5,4.21,0,0,-9.52,-1.58,-15.66,-2,-17.16,-1.28,-12.73,0.53,-17.54,0.51,-19.37,1.43,-18.21,2.94,-14.04,4.73,-7,-1.1,-17.3,-4.12,-26.02,-5.67,-30.71,-5.76,-28.93,-4.39,-31.31,-3.62,-30.5,-1.2,-27.03,1.65,-21.43,3.74,-10.38,-2.6,-21.3,-6.5,-32.39,-7.94,-40.06,-7.58,-40.66,-6.08,-40.99,-5.19,-37.93,-2.75,-32.57,-0.04,-26.04,1.66,-11.24,-4.34,-22.71,-8.66,-36.13,-8.99,-46.7,-7.18,-49.63,-5.09,-48.3,-4.55,-43.37,-3.16,-36.55,-1.68,-29.53,-0.86,-10.64,-6.19,-22.74,-10.57,-38.57,-9.01,-52.16,-4.98,-57.51,-1.95,-54.89,-2.08,-48.54,-2.4,-40.68,-2.8,-33.58,-3.16]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[2.16,-0.05,2.13,-0.14,2.1,-0.25,2.07,-0.35,2.05,-0.38,1.73,-0.33,1.17,-0.22,0.54,-0.1,0,0,4.56,-0.11,4.49,-0.3,4.41,-0.53,4.35,-0.73,4.32,-0.81,3.62,-0.7,2.45,-0.47,1.14,-0.2,0,0,6.49,-0.16,6.4,-0.43,6.29,-0.76,6.2,-1.04,6.15,-1.15,5.18,-1,3.51,-0.67,1.62,-0.3,0,0,7.29,-0.18,7.18,-0.51,7.05,-0.88,6.95,-1.17,6.91,-1.3,5.95,-1.13,4.04,-0.77,1.84,-0.36,0,0,15.33,0.09,16.28,-1.61,16.77,-1.97,16.86,-1.68,16.63,-1.43,15.85,-1.25,13.39,-0.87,10.32,-0.46,7.71,-0.18,20.11,0.44,22.55,-2.53,24.09,-2.64,24.81,-1.51,24.81,-0.77,24.25,-0.68,21.23,-0.5,17.28,-0.32,13.9,-0.22,23.58,0.81,27.69,-3.38,30.45,-3.14,31.98,-1.07,32.39,0.2,31.42,0.17,27.25,0.1,21.83,-0.01,17.09,-0.12,27.71,1.16,33.4,-4.27,37.3,-3.72,39.55,-0.76,40.27,1.02,37.59,0.91,31.09,0.67,23.06,0.37,15.79,0.09]}]},{"name":"B_NECK.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-9.33,-34.67,-6.96,-33.08,-4.33,-31.33,-2.21,-29.92,-1.33,-29.33,-1.04,-28.17,-0.33,-25.33,0.54,-21.83,1.33,-18.67,-6.94,-26.83,-5.15,-25.71,-3.18,-24.47,-1.59,-23.44,-0.94,-22.94,-0.49,-22.18,0.56,-20.14,1.77,-17.58,2.71,-15.27,-4.5,-19.33,-3.31,-18.57,-1.99,-17.75,-0.94,-17.01,-0.5,-16.5,0,-15.83,1.16,-14.23,2.49,-12.26,3.49,-10.46,-2.15,-11.17,-1.55,-10.95,-0.89,-10.74,-0.36,-10.49,-0.15,-10.15,0.3,-9.56,1.35,-8.41,2.57,-7.03,3.52,-5.75,0,-1.33,0,-2.13,0,-3,0,-3.71,0,-4,0.29,-3.85,1,-3.5,1.88,-3.06,2.67,-2.67,0,-1.19,0.18,-1.14,0.56,-1.09,0.95,-1.05,1.13,-1,1.32,-0.77,1.81,-0.06,2.45,0.83,3.08,1.63,0,-0.83,0.16,0,0.5,0.92,0.84,1.67,1,2,1.17,2.43,1.58,3.58,2.13,5.03,2.67,6.33,0,-0.4,0.06,1.2,0.19,2.97,0.32,4.4,0.38,5,0.54,5.66,0.94,7.31,1.44,9.36,1.92,11.21,0,0,0,2.38,0,5,0,7.12,0,8,0.15,8.88,0.5,11,0.94,13.62,1.33,16]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[10.67,20,7.9,20,4.83,20,2.35,20,1.33,20,0.9,20.58,-0.17,22,-1.48,23.75,-2.67,25.33,9.88,16.83,7.24,16.4,4.37,15.92,2.07,15.54,1.13,15.42,0.4,16.11,-1.34,17.44,-3.43,19.03,-5.23,20.48,9,13.33,6.52,12.5,3.91,11.58,1.84,10.87,1,10.67,-0.08,11.66,-2.64,13.08,-5.68,14.66,-8.17,16.17,8.29,10.5,5.93,9.2,3.45,7.75,1.5,6.61,0.71,6.25,-0.59,7.2,-3.67,8.34,-7.33,9.57,-10.35,10.77,8,9.33,5.63,7.35,3,5.17,0.88,3.4,0,2.67,-1.17,2.67,-4,2.67,-7.5,2.67,-10.67,2.67,11.56,2.32,8.49,1.89,4.81,1.22,1.73,0.97,0.44,1.79,-0.68,1.84,-3.37,1.67,-6.6,1.41,-9.35,1.21,13.83,-1.91,10.4,-1.8,6.33,-1.92,2.93,-1.64,1.5,-0.33,0.62,-0.46,-1.5,-1,-4.03,-1.71,-6.17,-2.33,15.19,-2.85,11.63,-3.15,7.56,-3.65,4.2,-3.77,2.81,-2.96,2.24,-3.34,0.88,-4.33,-0.78,-5.58,-2.23,-6.71,16,0,12.44,-1.58,8.5,-3.33,5.31,-4.75,4,-5.33,3.71,-5.92,3,-7.33,2.13,-9.08,1.33,-10.67]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_TERE","timeline":[{"name":"D_HOHO.00","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_HOHO.00","type":22,"frame":[{"duration":120,"tweenEasing":0,"offset":6,"value":[-4.6,0,-3.68,-1.57,0,0,0,0,0,0,0,0,-3.68]},{"offset":6,"value":[3.07,0,2.45,1.05,0,0,0,0,0,0,0,0,2.45]}]},{"name":"D_HOHO.01","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_HOHO.01","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[2.42,4.92,0,3.94]},{"value":[-1.61,-3.28,0,-2.63]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_DONYORI","timeline":[{"name":"D_FACESHADOW.01","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_FACESHADOW.01","type":22,"frame":[{"duration":120,"tweenEasing":0,"offset":47},{"value":[-10.07,35.25,-15.69,12.95,6.38,26.71,22.77,159.17,-14.6,94.19,-9.86,161.55,-1.89,47.22,-11.86,61.32,-24.28,90.28,8.14,53.36,4.08,83.23,-6.75,40.11,3.24,34.51,-14.04,75.34,-7.4,55.02,-7.14,28.35,6.95,74.36,4.19,50.93,3.09,22.19,-4.95,89.08,11.9,121.61,-12.84,75.47,-4.23,96.95,-1.88,86.44]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_FRONT","timeline":[{"name":"B_FACESHADOW.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.13,0,-0.25,0,-0.14,0,-0.46,0,-0.79,0,0.34,0,0.82,0,-0.23,0,0,0,-1.15,0,-2.21,0,-2.68,0,-5.47,0,-8.26,0,-3.41,0,-0.23,0,-3.3,0,0,0,-2.16,0,-4.16,0,-5.32,0,-10.83,0,-16.34,0,-8.38,0.01,-3.31,0.01,-9.17,0,-0.36,-1,-3.6,-0.69,-6.54,-0.16,-7.61,0.01,-12.83,0.13,-18.04,0.25,-10.69,0.26,-6.43,0.22,-13.65,0.13,-1.77,-0.63,-7.89,-0.43,-13.51,-0.1,-15.08,0.06,-17.77,0.64,-20.47,1.23,-12.81,1.22,-7.48,0.96,-12.87,0.65,-3.3,0,-12.48,0,-20.96,0,-23.13,0.1,-23.13,1.19,-23.13,2.28,-14.92,2.26,-8.24,1.76,-11.56,1.2]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[1.37,0,2.64,0,2.88,0,1.53,0,0.18,0,0,0,0,0,0,0,0,0,2.65,0,5.12,0,5.55,0,2.94,0,0.33,0,0,0,0,0,0,0,0.5,0,3.87,-0.08,7.02,-0.1,7.55,-0.1,4.31,-0.05,1.07,0,0.74,0,0.4,0,0,0,5.78,0,8.93,-0.55,11.87,-1.06,12.47,-1.14,10.12,-0.6,7.77,-0.05,6.62,0,3.44,0,0,0,11.07,0,13.46,-1.03,15.66,-2.02,16.16,-2.18,15.23,-1.14,14.29,-0.1,12.48,0,6.47,0,0,0,13.01,0,10.36,-1.01,12.58,-1.93,16.42,-2.04,15.87,-1.19,15.32,-0.34,13.64,-0.25,7.1,-0.17,0,0,18.66,0,7.33,-0.67,8.4,-1.12,16.5,-1.11,16.58,-1.19,16.66,-1.27,14.87,-1.15,7.73,-0.62,0,0,24.78,0,4.73,-0.29,4.44,-0.23,16.59,-0.1,17.34,-1.19,18.1,-2.28,16.18,-2.12,8.41,-1.1]}]},{"name":"B_HAIR_FRONT.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":18,"value":[-0.14,0,-0.4,0,-0.68,0,-0.92,0,-1.03,0,-1.02,0,-0.98,0,-0.94,0,-0.9,0,-0.29,0,-0.83,0,-1.42,0,-1.92,0,-2.18,0,-2.14,0,-2.06,0,-1.97,0,-1.89,0.01,-0.41,0,-1.19,0,-2.04,0,-2.74,0,-3.1,0,-3.05,0,-2.94,0,-2.81,0.01,-2.69,0.01,-0.46,0,-1.36,0,-2.35,0,-3.15,0,-3.48,0,-3.43,0,-3.31,0.01,-3.16,0.01,-3.02,0.01,-2.95,0,-4.2,0,-5.62,0,-6.71,0,-6.97,0.01,-7.23,0.01,-7.21,0.01,-7.08,0.01,-7.01,0.02,-5.82,0,-7.78,0,-9.99,0,-11.71,0.01,-12.25,0.01,-12.22,0.01,-11.71,0.01,-11,0.01,-10.39,0.01,-8.84,-0.01,-11.65,0,-14.78,0.01,-17.28,0.01,-18.25,0.01,-17.77,0.01,-16.61,0.01,-15.17,0.01,-13.86,0.01,-11.79,-0.01,-15.38,0,-19.35,0.01,-22.56,0.01,-23.88,0.02,-23.26,0.02,-21.73,0.02,-19.84,0.02,-18.14,0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.28,0.04,0.59,0.12,0.84,0.2,0.91,0.24,0.84,0.2,0.59,0.12,0.28,0.04,0,0,0,0,0.52,0.1,1.12,0.32,1.57,0.55,1.68,0.65,1.57,0.55,1.12,0.32,0.52,0.1,0,0,0,0,0.84,0.11,1.78,0.36,2.51,0.61,2.72,0.73,2.52,0.61,1.78,0.36,0.84,0.11,0,0,0,0,1.33,0,2.8,0,3.98,0,4.47,0,3.98,0,2.8,0,1.33,0,0,0,1.61,0,3.85,0,6.26,0,8.34,0,9.58,-0.01,8.36,-0.01,6.11,-0.05,3.45,-0.1,0.99,-0.19,5.52,0,7.93,0,10.52,0,12.74,-0.01,13.99,-0.01,12.58,-0.07,9.8,-0.23,6.46,-0.43,3.4,-0.66,10.35,0.01,12.62,0,15.1,0,17.15,-0.01,18.12,-0.01,16.74,-0.14,13.63,-0.46,9.83,-0.86,6.37,-1.23,14.72,0.01,17,0,19.51,0,21.55,-0.01,22.39,-0.01,20.93,-0.2,17.39,-0.67,13.02,-1.23,9.06,-1.75]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ANGLE_Y","timeline":[{"name":"B_FACESHADOW.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_FACE.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.05","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.06","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_MOUTH.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NOSE.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_FRONT.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_SIDE.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.07","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.16","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.17","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.18","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.19","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.20","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.21","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.11","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.08","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.09","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.11","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.12","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.13","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.14","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.05","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.06","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.07","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.08","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.09","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_BACK.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_BACK.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NECK.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ANGLE_X","timeline":[{"name":"D_REF.MOUTH","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[6.11,-40.48,6.11,-40.48,6.11,-40.48,6.11,-40.48]},{"duration":30,"tweenEasing":0,"value":[6.11,-40.48,6.11,-40.48,6.11,-40.48,6.11,-40.48]},{"duration":30,"tweenEasing":0,"offset":7},{"value":[3.87,49.92,3.87,49.92,3.87,49.92,3.87,49.92]}]},{"name":"B_FACESHADOW.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HOHO.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HOHO.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_FACE.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EYE.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EYE.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_BROW.05","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_BROW.06","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_MOUTH.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_NOSE.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_NOSE.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_NOSE.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EAR.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EAR.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_FRONT.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_SIDE.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_SIDE.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_SIDE.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_SIDE.01","type":23,"frame":[{"duration":90,"value":540},{"duration":30,"value":540},{"value":490}]},{"name":"D_HAIR_SIDE.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":119},{"duration":30,"tweenEasing":0,"offset":119},{"duration":30,"tweenEasing":0,"offset":6,"value":[7.05,-0.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19.12,0.05,13.67,0.02,7.08,0.94,0,0,0,0,0,0,19.41,-1.36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10.51,0.48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21.2,0.49,12.29,-0.44]},{"offset":26,"value":[13.68,0.89,0,0,0,0,0,0,0,0,0,0,28.36,2.69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13.67,0.89,0,0,7.65,-0.01,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7.44,0.43,0,0,0,0,0,0,7.78,0.44,32.44,-0.02]}]},{"name":"B_HAIR_TWIN.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.07","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.16","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.17","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.18","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.19","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.20","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.21","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.11","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.12","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[20.33,-1.95,3.06,-0.53,1.05,-0.55,1.07,-0.55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.31,0.06,7.97,1.83,0,0,0,0,0,0,0,0,4.55,0.07]},{"duration":91,"offset":47}]},{"name":"D_HAIR_TWIN.14","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[16.02,-3.03,6.29,-2.59,2.3,0.56,2.34,0.67,15.57,-1.54,16.14,0.1,6.09,0.55,0,0,1.43,2.53,0,0,0,0,-1.2,-1.03,-7.25,-1.57,-3.65,-0.54,-6.01,-0.04,8.63,-0.59,12.95,-2.67,-5.77,0.51]},{"duration":30,"tweenEasing":0,"value":[22.54,-2.54,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12.43,-0.43]},{"duration":30,"tweenEasing":0,"offset":37},{"duration":30,"tweenEasing":0,"offset":10,"value":[4.66,-0.98,3.79,-0.27,0,0,0,0,0,0,0,0,0,0,-2.52,-0.74,-7.77,-0.35,-4.74,0.39,0,0,0,0,-5.74,-0.09]},{"offset":10,"value":[9.32,-1.97,7.58,-0.55,0,0,0,0,0,0,0,0,0,0,-5.04,-1.47,-15.54,-0.7,-9.49,0.77,0,0,0,0,-11.48,-0.18]}]},{"name":"D_HAIR_TWIN.15","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[34.23,-2.89,19.05,0.38,13.14,-1.55,5.27,0.71,0,0,-10.6,-0.03,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-8.91,0.67,0,0,7.85,-3.72,8.26,-5.59,12.58,0.37,0,0,-4.67,1.36,0,0,0,0,7.58,-1.02,2.77,-0.92]},{"duration":30,"tweenEasing":0,"value":[9.77,-3.59,4.86,-1.61,3.13,-2.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12.84,-4.08]},{"duration":30,"tweenEasing":0,"offset":61},{"duration":30,"tweenEasing":0,"value":[-3.24,0.61,-3.12,0.18,-2.12,-0.05,-0.57,-0.07,1.59,-0.04,3.88,0.08,5.56,0.15,7.22,0.02,8.16,-0.16,7.89,-0.54,8.59,-0.02,8.53,0.3,7.16,0.63,5.75,0.66,4.36,0.55,2.09,0.3,-0.49,0.31,-2.07,0.59,-2.23,0.31,0.7,0.11,3.32,0.23,5.18,0.38,6.54,0.36,-1.54,0.11,-0.55,0.11,1.87,0.13,4.58,0.25,6.16,0.37,7.79,0.21,7.11,0.27,8.36,0.01]},{"value":[-6.49,1.23,-6.24,0.36,-4.24,-0.1,-1.14,-0.14,3.19,-0.08,-4.22,-0.62,3.87,0.25,14.43,0.03,16.32,-0.31,15.78,-1.08,17.19,-0.05,17.05,0.6,14.33,1.27,11.5,1.31,-0.8,1.17,4.18,0.61,-0.98,0.61,-4.13,1.18,-4.45,0.62,1.41,0.22,6.64,0.45,0.76,0.64,13.08,0.72,-3.07,0.23,-1.11,0.22,3.74,0.26,5.34,0.46,10.57,0.71,15.57,0.41,14.21,0.55,16.73,0.03]}]},{"name":"B_HAIR_TWIN.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.08","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.09","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.11","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.12","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.13","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.14","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.05","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.06","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.07","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.08","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.09","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_BACK.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_BACK.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_NECK.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_NECK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[1.69,21.02,0,0,-25.39,-23.35,-23.69,-32.69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.77,-1.17]},{"duration":60,"tweenEasing":0,"offset":27},{"value":[5.08,-19.85,10.15,-17.51,0,0,-8.46,19.85,5.08,0,5.08,0,0,0,0,0,0,0,0,0,5.08,-1.17,0,0,0,0,5.08,-2.34]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BODY_Z","timeline":[{"name":"D_REF.BODY","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BODY.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-8.92,2.89,-15.78,3.25,-19.9,3.46,-18.53,5.77,-17.16,8.08,-14.07,8.37,-10.98,8.66,-6.86,5.41,0,0,-5.92,3.25,-12.01,4.04,-15.7,4.55,-15.14,6.85,-14.58,9.16,-14.71,9.09,-14.84,9.02,-9.19,5.64,0,0,-4.12,3.46,-9.27,4.55,-12.35,5.2,-12.7,7.5,-13.04,9.81,-15.1,9.52,-17.16,9.24,-10.72,5.77,0,0,-2.4,7.79,-6.31,7.9,-9.27,7.79,-10.55,7.72,-10.81,7.65,-13.13,7.29,-15.44,6.93,-9.65,4.33,0,0,-0.69,12.12,-3.35,11.26,-6.18,10.39,-7.89,7.5,-7.55,4.62,-10.64,4.62,-13.73,4.62,-8.58,2.89,0,0,-0.34,10.68,-1.8,8.02,-3.6,6.06,-4.72,4.51,-4.8,2.96,-9.44,2.63,-14.07,2.31,-8.79,1.44,0,0,0,9.24,1.29,5.63,2.06,3.46,1.03,1.73,0,0,-7.21,0,-14.41,0,-9.01,0,0,0,0,5.77,0.77,3.61,1.29,2.16,0.64,1.08,0,0,-4.5,0,-9.01,0,-5.42]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":2,"value":[2.14,3.25,3.43,5.2,5.83,7.22,8.24,9.24,7.21,5.48,6.18,1.73,3.86,1.08,0,0,4.29,6.49,7.21,8.23,9.01,9.16,10.55,9.2,12.1,9.24,9.65,5.16,7.21,1.08,4.5,0.87,0,0,6.86,10.39,10.29,11.11,12.35,11.54,12.35,10.39,12.35,9.24,10.29,6.35,8.24,3.46,5.15,2.16,0,0,3.43,4.91,9.72,7.29,12.01,8.66,10.72,7.65,9.44,7.5,8.7,8.29,7.21,7.79,4.5,4.87,0,0,0,-0.58,9.14,3.47,11.67,5.77,8.58,4.91,5.49,5.77,6.61,10.25,6.18,12.12,3.86,7.58,0,0,-0.34,-0.58,7.23,0.65,10.29,1.37,6.52,1.7,2.75,2.89,3.32,6.21,3.13,8.23,1.95,4.87,0,0,-0.69,-0.58,5.32,-2.38,8.92,-3.46,4.46,-1.73,0,0,0,0,0,0,0,0,0,0,-0.43,-0.36,3.18,-1.45,5.58,-2.16,2.79,-1.08]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BODY_Y","timeline":[{"name":"D_REF.BODY","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.13","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BODY.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":19,"value":[3.57,0,5.17,0,6.24,-0.17,8.62,-0.34,10.99,0.08,8.84,0.51,6.69,0.3,4.01,0,0,0,5.71,0,8.38,0,9.98,-0.27,13.79,-0.54,17.59,0.14,14.14,0.81,10.7,0.51,6.69,0,0,-0.87,8.61,-1.74,12.44,0.2,14.96,1.44,17.82,-0.57,20.41,-0.09,17.98,2.7,14.5,2.68,8.39,0,0,-1.74,11.52,-3.8,17.09,-0.27,21.16,2.03,19.4,-2.16,17.12,-1.11,16.62,4.59,14.03,4.84,7.94,0,0,-0.87,5.76,1.4,12.12,5.11,16.76,3.28,18.98,-1.49,18.54,-1.35,17.92,0.29,14.6,1.38,8.38,0,0,0,0,5.59,7.93,8.46,13.96,3.57,19.4,-0.81,19.97,-0.15,16.44,-1.08,9.51,-0.68,5.94,0,0,0,0,3.33,4.84,5.29,8.73,2.27,11.81,-0.51,12.48,-0.19,10.06,-0.68,5.94,-0.41,3.57]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[8.1,-0.71,6.08,-1.6,4.86,-2.14,2.43,-1.07,0,0,0.41,1.07,0.81,2.14,0.51,1.34,0,0,6.58,-1.16,4.56,-2.45,3.44,-3.48,1.46,-2.53,-0.52,-1.06,-1.22,-1.95,-1.92,-1.78,-1.17,-0.8,0,0,5.67,-1.43,3.14,-1.87,1.62,-2.14,0.41,-4.46,-0.81,-5.71,-2.43,-4.28,-4.05,-0.71,-2.53,-0.45,0,0,4.46,-1.78,1.85,-4.95,0.69,-8.12,0.44,-7.94,-0.41,-7.49,-1.3,-7.12,-2.79,-5.7,-1.6,-3.39,0,0,3.24,-2.14,-0.1,-3.83,-1.62,-5.71,-0.2,-7.22,0,-9.27,1.01,-8.56,0.81,-7.84,0.51,-4.9,0,0,3.24,-3.21,0.3,-4.5,-1.22,-5.71,-2.08,-6.99,0,-7.13,3.03,-7.68,1.22,-6.06,0.76,-3.79,0,0,3.24,-4.28,0.71,-5.17,-0.81,-5.71,-3.96,-6.76,0,-4.99,5.05,-6.8,1.62,-4.28,1.01,-2.67,0,0,2.03,-2.67,0.51,-3.21,-0.51,-3.57,-2.03,-4.05,0,-3.12,2.63,-3.98,1.01,-2.67,0.61,-1.6]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_R_02","timeline":[{"name":"B_CLOTHES.38","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.39","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.63","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.62","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.17","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.16","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.17","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_R_01","timeline":[{"name":"B_CLOTHES.38","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.39","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.63","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.62","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAND.17","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.16","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.17","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_R","timeline":[{"name":"B_CLOTHES.17","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":56,"value":[-0.21,0.09,-0.38,0.11,-0.36,0.11,-0.16,0.06,0.04,0.01,0,0,0,0,0,0,0,0,-1.76,0.63,-3.39,1.21,-3.64,1.3,-1.9,0.68,-0.16,0.06,0,0,0,0,0,0,0,0,-3.32,1.17,-6.41,2.31,-6.92,2.49,-3.64,1.3,-0.37,0.11,0,0,0,0,0,0,0,0,-4.15,1.06,-7.95,2.14,-8.48,2.32,-4.36,1.21,-0.25,0.1,0,0,0,0,0,0,0,0,-6.12,0.55,-11.75,1.11,-12.59,1.2,-6.53,0.63,-0.48,0.05,0,0,0,0,0,0,0,0,-8.22,0,-15.82,0,-17,0,-8.88,0,-0.76]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":56,"value":[0.04,-1.33,0.05,-3.48,0.06,-3.93,0.02,-2.06,-0.01,-0.18,0,0,0,0,0,0,0,0,0.32,-3.34,0.5,-8.58,0.64,-9.69,0.31,-5.06,-0.02,-0.43,0,0,0,0,0,0,0,0,0.56,-2.06,1.04,-4.94,1.17,-5.52,0.6,-2.88,0.04,-0.25,0,0,0,0,0,0,0,0,0.23,-0.71,0.47,-1.43,0.54,-1.54,0.32,-0.81,0.1,-0.07,0,0,0,0,0,0,0,0,-0.87,-0.37,-1.66,-0.74,-1.77,-0.8,-0.9,-0.42,-0.03,-0.04,0,0,0,0,0,0,0,0,-2.06,0,-3.96,0,-4.25,0,-2.22,0,-0.19]},{"offset":56,"value":[-0.1,0,-0.19,0,-0.18,0,-0.08,0,0.02,0,0,0,0,0,0,0,0,0,-0.88,0,-1.7,0,-1.82,0,-0.95,0,-0.08,0,0,0,0,0,0,0,0,0,-1.66,0,-3.2,0,-3.46,0,-1.82,0,-0.18,0,0,0,0,0,0,0,0,0,-1.8,0,-3.46,0,-3.72,0,-1.94,0,-0.15,0,0,0,0,0,0,0,0,0,-1.92,0,-3.7,0,-3.98,0,-2.07,0,-0.17,0,0,0,0,0,0,0,0,0,-2.06,0,-3.96,0,-4.25,0,-2.22,0,-0.19]}]},{"name":"B_CLOTHES.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.07","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.30","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":2,"value":[-2.63,-0.81,-5.07,-1.55,-6.04,-1.72,-9.77,-1.48,-13.5,-1.23,-12.34,-1.08,-6.41,-0.56,0,0,0,0,-1.76,-1.02,-3.37,-1.98,-4.14,-2.17,-8.36,-1.53,-12.58,-0.88,-11.6,-0.73,-6.03,-0.39,0,0,0,0,-0.94,-1.22,-1.79,-2.38,-2.39,-2.58,-7.06,-1.57,-11.74,-0.56,-10.91,-0.42,-5.67,-0.23,0,0,0,0,-1.56,-1.55,-1.95,-2.74,-1.84,-2.88,-6.55,-1.88,-11.25,-0.87,-10.35,-0.73,-5.48,-0.53,-0.24,-0.24,0,0,-3.98,-2.76,-3.43,-4.7,-0.79,-4.95,-4.59,-5.01,-8.4,-5.08,-8.1,-4.84,-5.53,-3.87,-2.76,-2.82,0,0,-6.4,-3.98,-4.93,-6.66,0.26,-7.01,-2.64,-8.15,-5.55,-9.29,-5.87,-8.94,-5.6,-7.2,-5.28,-5.41,3.98,-2.62,-0.06,-6.73,2.32,-10.72,6.85,-11.54,2.17,-12.44,-2.51,-13.33,-2.37,-12.68,-3.99,-10.21,-5.9,-8.68,19.55,-12.85,21.78,-14.13,26.95,-15.52,29.54,-15.9,18.98,-17.46,8.41,-19.02,6.37,-19.11,-0.15,-19.26,-7.38,-20.52,36.39,-23.92,45.19,-21.99,53.31,-20.2,53.8,-19.84,36.82,-20.83,19.84,-21.82,15.26,-23.16,3.62,-28.05,-8.98,-33.33]},{"offset":2,"value":[-2.63,-0.81,-5.07,-1.55,-6.04,-1.72,-9.77,-1.48,-13.5,-1.23,-12.34,-1.08,-6.41,-0.56,0,0,0.66,-1.79,-0.51,-3.26,-1.57,-4.68,-2.14,-5.03,-6.18,-4.88,-10.23,-4.73,-9.54,-4.17,-4.96,-2.08,0,0,1.28,-3.45,1.48,-5.54,1.69,-7.57,1.47,-8.09,-2.87,-8.03,-7.21,-7.96,-6.93,-7.03,-3.62,-3.52,0,0,1.74,-4.96,1.43,-6.99,2.02,-8.99,1.79,-9.11,-2.08,-9.23,-5.95,-9.36,-5.71,-8.42,-2.86,-4.87,0.21,-1.44,4.8,-17.13,-0.57,-15.97,-2.32,-13.73,-3.06,-11.6,-2.71,-13.51,-2.36,-15.42,-1.85,-15.73,0.23,-16.23,2.39,-16.77,7.14,-32.01,-2.92,-26.81,-6.96,-18.89,-7.92,-14.08,-3.34,-17.78,1.23,-21.49,2.06,-23.03,3.27,-27.59,4.58,-32.1,17.26,-41.44,8.9,-32.87,5.6,-20.21,5.71,-14.53,6.19,-20.32,4.9,-26.21,4.39,-27.64,4.64,-30.91,4.84,-34.73,47.07,-46.41,42.8,-38.29,41.11,-27.12,40.69,-23.16,29.56,-28.98,14.2,-35.04,9.58,-36.07,7.42,-37.42,5.04,-39.37,78.78,-50.8,76.06,-46.86,73.55,-43.21,71.1,-42.24,50.24,-41.92,22.67,-41.98,14.51,-42.47,10.06,-43.39,5.25,-44.4]}]},{"name":"B_CLOTHES.26","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"value":[-8.72,-7.08,-8.3,-6.32,-4.77,-2.84,0,0,0,0,0,0,0,0,0,0,0,0,-6.2,-12.92,-10.34,-10.24,-5.98,-4.9,0.01,-0.73,0.01,-0.38,0,-0.03,0,0,0,0,0,0,-3.88,-18.32,-12.49,-13.85,-7.26,-6.85,0.02,-1.4,0.01,-0.73,0,-0.06,0,0,0,0,0,0,-2.82,-19.95,-12.82,-14.37,-7.31,-7.31,0.05,-1.1,0.03,-0.57,0,-0.05,0,0,0,0,0,0,2.04,-22.57,-4.94,-13.61,-3.06,-3.55,0.35,3.96,0.19,2.07,0.03,0.18,0,0,0,0,0,0,6.9,-25.2,2.91,-12.86,1.09,0.2,0.66,9.02,0.35,4.71,0.03,0.4,0,0,0,0,0,0,6.55,-22.66,4.25,-11.44,1.94,0.98,0.61,8.46,0.32,4.42,0.03,0.38,0,0,0,0,0,0,3.4,-11.78,2.15,-5.97,1.1,0.58,0.31,4.39,0.17,2.3,0.02,0.2]},{"value":[-8.72,-7.08,-8.3,-6.32,-4.77,-2.84,0,0,0,0,0,0,0,0,0,0,0,0,-16.65,-20.84,-19.08,-16.28,-11.15,-7.73,0.01,-0.73,0.01,-0.38,0,-0.03,0,0,0,0,0,0,-23.97,-33.55,-29.55,-25.51,-17.54,-12.44,0.02,-1.4,0.01,-0.73,0,-0.06,0,0,0,0,0,0,-25.38,-36.62,-32.04,-27.23,-19.16,-13.77,-0.55,-1.33,-0.25,-0.69,0.06,-0.06,0,0,0,0,0,0,-20.37,-34.65,-23.71,-23.43,-16.16,-9.79,-5.76,1.32,-3.01,0.69,-0.26,0.06,0,0,0,0,0,0,-15.36,-32.68,-15.56,-19.66,-13.31,-5.83,-10.98,3.97,-5.77,2.07,-0.57,0.18,0,0,0,0,0,0,-13.26,-28.94,-11.78,-17.1,-10.56,-4.12,-10.16,3.76,-5.37,1.96,-0.59,0.17,0,0,0,0,0,0,-6.89,-15.04,-6.19,-8.92,-5.42,-2.07,-5.26,1.95,-2.79,1.02,-0.32,0.09]}]},{"name":"B_CLOTHES.31","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.32","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.29","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-1.28,10.56,-1.32,10.52,-1.38,10.46,-1.38,10.46,-1.36,10.45,-2.04,10.6,-1.31,10.46,-5.12,14.73,-1.32,10.5]},{"duration":40,"tweenEasing":0,"offset":17},{"duration":40,"tweenEasing":0,"value":[4.89,4.92,4.4,5.05,5.47,5.72,5.42,4.99,4.61,3.94,4.29,4.25,-1.23,7.09,7.64,-10.76,4.08,4.61]},{"value":[2.78,6.9,0,0,0,0,0,0,0,0,0,0,-0.19,13.1,11.45,0.85]}]},{"name":"D_CLOTHES.11","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-0.97,-2.71,6.74,9.58,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.27,5.57,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,6.74,23.64,6.08,9.34,-1.94]},{"duration":40,"tweenEasing":0,"offset":71},{"duration":40,"tweenEasing":0,"value":[-7.95,1.7,5.38,-18.2,-22.24,-15.56,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-16.33,-18.63,-1.94,0,-1.91,3.91,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.66,0.23,4.75,-18.46,-19.76,-16.85]},{"value":[-4.41,-7.61,10.53,-18.48,-22.24,-15.56,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-16.33,-18.63,-1.94,0,-1.91,3.91,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,2.44,6.18,9.6,-9.87,-19.76,-16.85]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_L","timeline":[{"name":"B_CLOTHES.15","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":60,"value":[-0.03,0,0.13,0.02,0.28,0.04,0.3,0.04,0.16,0.03,0,0,0,0,0,0,0,0,0.13,0.02,1.48,0.23,2.84,0.44,2.64,0.41,1.37,0.21,0,0,0,0,0,0,0,0,0.28,0.04,2.84,0.44,5.39,0.85,4.99,0.78,2.58,0.4,0,0,0,0,0,0,0,0,0.3,0.04,2.64,0.41,4.99,0.79,4.59,0.73,2.37,0.36,0,0,0,0,0,0,0,0,0.16,0.02,1.37,0.21,2.58,0.41,2.37,0.38,1.22,0.19]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":24,"value":[0.04,-0.31,0.46,-3.58,0.88,-6.85,0.91,-7.09,0.86,-6.84,0.81,-6.59,0,0,0,0,0,0,0.1,-0.59,0.89,-6.89,1.68,-13.18,1.75,-13.64,1.65,-13.16,1.55,-12.68,0,0,0,0,0,0,0.11,-0.64,0.89,-7.4,1.67,-14.16,1.73,-14.67,1.7,-14.15,1.67,-13.62,0,0,0,0,0,0,-0.04,-0.33,-0.25,-3.87,-0.46,-7.4,-0.35,-7.66,0.24,-7.4,0.87,-7.12,0,0,0,0,0,0,-0.17,-0.03,-1.39,-0.33,-2.62,-0.64,-2.44,-0.66,-1.23,-0.65,0.07,-0.61,0,0,0,0,0,0,-0.15,0,-1.34,0,-2.52,0,-2.32,0,-1.2,0,0,0,0,0,0,0,0,0,-0.08,0,-0.69,0,-1.31,0,-1.2,0,-0.62]},{"offset":24,"value":[0.04,-0.31,0.46,-3.58,0.88,-6.85,0.91,-7.09,0.86,-6.84,0.81,-6.59,0,0,0,0,0,0,0.1,-0.59,0.89,-6.89,1.68,-13.18,1.75,-13.64,1.65,-13.16,1.55,-12.68,0,0,0,0,0,0,0.12,-0.64,0.87,-7.45,1.62,-14.25,1.68,-14.75,1.67,-14.22,1.67,-13.62,0,0,0,0,0,0,-0.06,-0.38,-0.5,-4.39,-0.94,-8.41,-0.8,-8.6,0,-7.89,0.87,-7.12,0,0,0,0,0,0,-0.21,-0.12,-1.87,-1.34,-3.53,-2.57,-3.28,-2.45,-1.66,-1.56,0.07,-0.61,0,0,0,0,0,0,-0.2,-0.08,-1.78,-0.94,-3.36,-1.8,-3.1,-1.66,-1.6,-0.83,0,0,0,0,0,0,0,0,-0.11,-0.04,-0.93,-0.49,-1.74,-0.93,-1.6,-0.86,-0.83,-0.43]}]},{"name":"B_CLOTHES.01","type":50,"frame":[{"duration":80,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"offset":2,"value":[-13.65,-1.45,-26.26,-2.78,-28.21,-2.99,-14.74,-1.56,-1.27,-0.13,0,0,0,0,0,0,0,0,-12.75,-6.97,-24.42,-13.99,-26.29,-15.15,-13.71,-7.92,-1.13,-0.68,0.08,-0.29,0.34,-1.36,0.61,-2.41,0,0,-11.87,-12.24,-22.87,-24.39,-24.44,-26.4,-12.75,-13.79,-1.07,-1.19,0.16,-0.54,0.65,-2.6,1.18,-4.64,0,0,-11.04,-13.4,-21.36,-26.29,-23.06,-28.35,-12.24,-14.76,-1.42,-1.18,-0.09,-0.47,0.44,-2.73,1,-5.23,0,0,-7.37,-9.01,-14.03,-17.37,-15.31,-18.62,-9.34,-9.16,-3.37,0.3,-2.78,0.46,-2.61,-2.37,-2.42,-5.44,0,0,-3.63,-4.63,-6.83,-8.45,-7.56,-8.89,-6.44,-3.56,-5.32,1.77,-5.47,1.39,-5.66,-2.01,-5.84,-5.64,0,0,-2.67,-3.3,-5.17,-6.63,-5.9,-7.1,-5.49,-2.7,-5.08,1.7,-5.09,1.28,-5.29,-1.9,-5.49,-5.04,0,0,-1.38,-1.7,-2.67,-3.44,-3.07,-3.69,-2.85,-1.4,-2.64,0.88,-2.65,0.66,-2.75,-1,-2.85,-2.62]}]},{"name":"B_CLOTHES.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.05","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":6,"value":[1.82,1.4,9,3.36,14.45,3.5,13.29,3.09,6.91,1.61,0,0,0,0,0,0,0,0,0.96,0.85,4.96,1.94,7.89,1.89,7.31,1.68,3.83,0.91,0,0,0,0,0,0,0,0,0.18,0.33,1.2,0.59,1.78,0.41,1.74,0.36,0.94,0.25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.01,-0.04,0.02,-0.43,0.05,-0.83,0.03,-0.94,-0.01,-1.4,-0.11,-2.38,0,0,0,0,0,0,0,-0.18,0.11,-2.13,0.21,-4.08,0.12,-5.02,-0.16,-8.09,-0.54,-11.71,0,0,0,0,0,0,0.02,-0.34,0.2,-3.97,0.38,-7.6,0.24,-9.46,-0.35,-15.38,-1,-21.79]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":6,"value":[-0.4,-0.06,-4.71,-0.75,-9.01,-1.44,-8.38,-1.34,-4.36,-0.7,0,0,0,0,0,0,0,0,-0.13,-0.03,-2.53,-0.41,-4.92,-0.78,-3.32,-0.74,2.91,-0.44,9.63,-0.08,0,0,0,0,0,0,0.07,-0.01,-0.51,-0.08,-1.1,-0.16,1.32,-0.17,9.6,-0.19,18.52,-0.16,0,0,0,0,0,0,-0.1,0,0.43,-0.05,0.96,-0.1,3.25,-0.12,11.7,-0.17,20.8,-0.18,0,0,0,0,0,0,0.43,-0.05,5.05,-0.6,9.67,-1.14,11.27,-1.08,15.85,-0.65,20.8,-0.18,0,0,0,0,0,0,0.95,-0.1,9.67,-1.14,18.39,-2.18,19.27,-2.04,19.98,-1.12,20.8,-0.18,1.21,-3.67,-0.3,-3.4,-1.59,-3.28,-1.32,-3.37,2.46,-4.61,6.24,-5.85,8.57,-5.67,11.8,-4.62,15,-3.86,5.96,-18,-0.15,-17.02,-5.72,-16.2,-7.54,-16.04,-10.49,-16.46,-13.44,-16.87,-12.21,-17.03,-9.89,-17.53,-7.67,-18.23,11.1,-33.51,0.13,-31.79,-10.01,-30.2,-13.27,-29.78,-20.3,-29.68,-27.33,-29.59,-28.45,-30.04,-30.25,-31.84,-32.2,-33.79]},{"offset":2,"value":[-7.69,2.46,-14.79,4.72,-16.79,5.35,-18.74,5.79,-20.7,6.23,-18.6,5.58,-9.67,2.9,0,0,0,0,-4.62,0.36,-8.81,0.47,-9.44,0.35,-8.02,-1.04,-6.61,-2.43,-4.72,-2.16,2.21,-0.81,9.63,-0.08,0,0,-1.72,-1.63,-3.22,-3.48,-2.68,-4.24,1.92,-7.1,6.51,-9.95,8.23,-8.89,13.16,-4.11,18.52,-0.16,0.19,-0.98,-0.47,-2.97,-1.08,-5.04,0.18,-5.77,8.99,-7.65,17.81,-9.52,18.52,-8.66,19.4,-4.62,20.56,-0.31,2.16,-11.39,2.26,-11.05,2.38,-10.74,4.14,-10.76,13.83,-11.87,23.53,-12.98,23.06,-11.78,20.47,-6.79,18,-1.65,4.14,-21.8,5.01,-19.12,5.83,-16.43,6.74,-15.76,12.78,-16.13,18.82,-16.5,18.72,-15.02,17.11,-9.17,15.44,-3,11.24,-26.01,8.89,-23.05,6.68,-20.3,4.7,-19.75,4.29,-21.34,5.33,-22.92,6.33,-21.29,5.33,-14.68,4.06,-8.67,17.13,-39.12,10.96,-36.23,5.23,-33.56,0.29,-32.89,-7.88,-32.95,-12.41,-32.98,-13.42,-32.23,-18.66,-29.53,-24.55,-27.42,22.42,-53.32,12.57,-50.51,3.46,-47.9,-4.25,-47.08,-20.08,-45.14,-30.02,-43.16,-33.44,-43.48,-43.67,-45.43,-54.75,-47.55]}]},{"name":"B_CLOTHES.07","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.36","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.37","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":28,"value":[-0.05,-0.02,-0.15,-0.07,-0.27,-0.13,-0.38,-0.18,0,0,0,0,0,0,0,0,0,0,-0.11,-0.04,-0.32,-0.15,-0.57,-0.27,-0.8,-0.37,0,0,0,0,0,0,0,0,0,0,-0.15,-0.06,-0.45,-0.21,-0.81,-0.39,-1.14,-0.53,0,0,0,0,0,0,0,0,0,0,-0.14,-0.07,-0.48,-0.22,-0.9,-0.42,-1.28,-0.6,0,0,0,0,0,0,0,0,0,0,-0.15,-0.06,-0.45,-0.21,-0.81,-0.39,-1.14,-0.53,0,0,0,0,0,0,0,0,0,0,-0.11,-0.04,-0.32,-0.15,-0.57,-0.27,-0.8,-0.37,0,0,0,0,0,0,0,0,0,0,-0.05,-0.02,-0.15,-0.07,-0.27,-0.13,-0.38,-0.18]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"value":[-8.96,-6.49,-9.64,-5.53,-10.38,-4.46,-10.99,-3.6,-11.24,-3.25,-15.44,2.2,-19.9,5.14,-24.46,7.07,-28.98,9.5,-8.96,-6.49,-9.44,-5.79,-9.98,-5.05,-10.4,-4.45,-10.56,-4.21,-14.02,-0.12,-18.09,2.14,-22.44,3.7,-26.71,5.69,-8.96,-6.49,-9.23,-6.07,-9.53,-5.68,-9.76,-5.39,-9.81,-5.27,-12.48,-2.56,-16.13,-1.09,-20.22,-0.02,-24.21,1.47,-8.96,-6.49,-9.05,-6.32,-9.16,-6.21,-9.22,-6.15,-9.21,-6.14,-11.12,-4.72,-14.47,-3.83,-18.44,-3.04,-22.18,-1.94,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.32,-6.15,-13.61,-5.31,-17.67,-4.28,-21.35,-3.34,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.38,-6.21,-13.54,-5.57,-17.42,-4.9,-20.96,-4.54,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.29,-6.54,-13.19,-6.69,-16.74,-6.98,-20.03,-7.45,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.11,-6.97,-12.71,-8.14,-15.92,-9.63,-18.87,-11.05,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-9.93,-7.35,-12.29,-9.42,-15.19,-11.98,-17.83,-14.3]},{"value":[-11.56,-10.47,-14.89,-8.57,-18.62,-6.54,-21.72,-5.07,-23.12,-4.87,-24.09,-4.1,-26.42,-2.24,-29.28,0.05,-31.86,2.09,-11.81,-10.29,-14.39,-8.89,-17.24,-7.38,-19.62,-6.31,-20.76,-6.23,-21.37,-5.63,-22.96,-4.11,-24.94,-2.18,-26.75,-0.33,-12.01,-10.26,-13.85,-9.32,-15.85,-8.26,-17.53,-7.53,-18.41,-7.55,-18.61,-7.16,-19.42,-6.12,-20.48,-4.67,-21.47,-3.08,-12.19,-10.31,-13.23,-9.87,-14.32,-9.36,-15.25,-9.04,-15.8,-9.2,-15.74,-8.87,-15.92,-7.97,-16.22,-6.67,-16.5,-5.19,-12.34,-10.42,-12.45,-10.58,-12.51,-10.83,-12.57,-11.16,-12.66,-11.56,-12.64,-10.94,-12.56,-9.37,-12.45,-7.44,-12.36,-5.72,-11.98,-10.66,-12.03,-10.8,-12.05,-11.03,-12.06,-11.33,-12.09,-11.61,-12.06,-11.02,-12.19,-9.73,-12.43,-8.4,-12.72,-7.7,-11.68,-10.82,-11.7,-10.93,-11.69,-11.16,-11.69,-11.41,-11.69,-11.59,-11.98,-11.55,-12.67,-11.66,-13.59,-12.06,-14.59,-12.88,-11.43,-10.92,-11.43,-11,-11.43,-11.19,-11.42,-11.38,-11.42,-11.44,-12.1,-12.18,-13.52,-14.18,-15.3,-16.8,-17.08,-19.35,-11.23,-10.97,-11.24,-11,-11.24,-11.12,-11.24,-11.21,-11.24,-11.15,-12.11,-12.57,-14.25,-16.3,-16.88,-20.98,-19.27,-25.22]}]},{"name":"B_HAND.01","type":50,"frame":[{"duration":80,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"value":[-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.91,-11.37,-4.03,-6.74,-3.44,-3.66,-3.81,-1.92,-4.25,1.33,-7.06,4.03,-9.76,4.24,-7.77,2.39,-4.77,-0.4,-4.99,-17.96,-3.52,-10.24,-2.64,-5.62,-3.22,-3.14,-3.93,2.37,-8.45,7.22,-12.75,7.03,-9.76,4.24,-4.77,-0.4,-4.54,-17.24,-3.81,-13.39,-3.36,-11.07,-3.5,-7.8,-3.79,-0.99,-10.94,6.66,-17.24,11.37,-13.22,9.69,-6.52,6.87,-4.09,-16.53,-4.09,-16.53,-4.09,-16.53,-3.79,-12.46,-3.65,-4.35,-13.43,6.13,-21.74,15.72,-16.68,15.13,-8.26,14.15,-4.63,-3.76,-1.51,-6.87,0.37,-8.74,-2.02,-7.5,-4.24,-1.7,-13.69,5.26,-22.07,12.32,-16.62,15.05,-7.42,16.92,-5.17,9.01,1.08,2.79,4.83,-0.94,-0.25,-2.55,-4.83,0.95,-13.96,4.4,-22.41,8.92,-16.56,14.97,-6.58,19.69,-5.02,5.48,2.25,3.06,6.53,1.22,1.24,0.35,-3.8,2.04,-12.37,5.04,-20.6,8.56,-15.08,11.22,-5.9,12.15,-4.77,-0.4,4.07,2.87,9.38,4.83,3.65,4.35,-2.08,3.87,-9.83,5.92,-17.58,7.97,-12.78,4.83,-4.77,-0.4]}]},{"name":"B_HAND.08","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.13","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.31","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.32","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BODY_X","timeline":[{"name":"B_CLOTHES.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[5.62,2.75,0.27,3.52,-4.67,4.15,-6.14,3.37,-8.28,1.47,-10.42,0.11,-10.62,0,-10.62,0,-10.62,0,2.91,-2.69,-2.12,-0.65,-6.76,1.39,-9.13,1.68,-10.79,0.59,-10.85,0.04,-10.84,0.07,-10.76,0.04,-10.62,0,0.21,-7.87,-4.53,-4.61,-8.97,-1.27,-12.21,0.04,-13.36,-0.26,-11.3,-0.04,-11.07,0.14,-10.9,0.09,-10.62,0,-1.98,-10.04,-6.96,-6.35,-11.68,-2.61,-15.64,-0.69,-16.26,-0.6,-12.22,-0.02,-11.44,0.21,-11.11,0.14,-10.62,0,-3.63,-9.21,-9.12,-6.3,-14.27,-3.4,-18.36,-1.42,-19.71,-0.62,-15.55,0.51,-13.64,0.67,-12.23,0.36,-10.62,0,-4.89,-8.21,-10.96,-6.13,-16.62,-4.16,-20.94,-2.14,-23.28,-0.63,-19.35,1.05,-16.3,1.13,-13.58,0.58,-10.62,0,-5.84,-8.53,-12.23,-6.51,-18.19,-4.31,-21.95,-2.29,-24.24,-0.77,-21.43,0.75,-18.58,0.8,-15,0.36,-11.13,0,-5.74,-7.83,-13.25,-6.39,-20.25,-4.82,-23.81,-3.31,-25.31,-1.91,-23.75,-0.69,-21.71,-0.52,-17.58,-0.31,-13.14,0,-5.47,-6.95,-14.2,-6.18,-22.4,-5.38,-25.86,-4.42,-26.49,-3.15,-26.14,-2.25,-24.9,-1.93,-20.29,-1.01,-15.31]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[11.87,0,9.7,0,7.7,0,7.1,0,6.25,0,5.39,0,5.11,0,4.3,0,3.44,0,11.87,0,11.25,0,10.69,0,11.46,-0.01,11.91,-0.09,9.96,-0.17,8.42,-0.16,6.44,-0.1,4.3,0,11.87,0,12.7,0,13.5,0,15.58,-0.02,17.4,-0.2,14.46,-0.39,11.69,-0.37,8.53,-0.22,5.11,0,11.87,0,13.25,0.03,14.51,0.04,17.24,0,20.43,-0.4,17.34,-0.79,13.88,-0.74,9.82,-0.37,5.43,0,11.87,0,13.82,0.2,15.63,0.39,18.39,0.4,21.72,0,19.25,-0.4,15.9,-0.39,11.49,-0.2,6.72,0,11.87,0,14.4,0.37,16.74,0.74,19.54,0.79,23.01,0.4,21.15,0,17.92,-0.04,13.15,-0.03,8,0,11.87,0,14.59,0.34,17.09,0.68,20.18,0.76,24.2,0.44,22.01,0.06,18.43,0,13.67,0,8.53,0,11.87,0,14.95,0.17,17.79,0.35,21.62,0.44,26.61,0.34,23.81,0.08,19.69,0,15.1,0,10.13,0,11.87,0,15.34,0,18.55,0,23.14,0.09,29.12,0.22,25.71,0.09,21.05,0,16.64,0,11.87]}]},{"name":"B_CLOTHES.11","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-2.34,-0.43,-3.32,-0.43,-4.39,-0.43,-5.26,-0.43,-5.62,-0.43,-5.88,-0.43,-6.5,-0.43,-7.27,-0.43,-7.97,-0.43,-3.26,-0.56,-4.31,-0.55,-5.48,-0.53,-6.42,-0.51,-6.82,-0.5,-7.16,-0.5,-7.91,-0.48,-8.81,-0.46,-9.63,-0.43,-4.16,-0.71,-5.3,-0.68,-6.56,-0.62,-7.58,-0.57,-8.02,-0.54,-8.5,-0.54,-9.41,-0.52,-10.49,-0.48,-11.48,-0.43,-5.09,-0.82,-6.3,-0.79,-7.64,-0.73,-8.73,-0.67,-9.2,-0.64,-9.73,-0.62,-10.72,-0.58,-11.89,-0.51,-12.97,-0.43,-6.09,-0.87,-7.34,-0.87,-8.73,-0.87,-9.85,-0.87,-10.31,-0.87,-10.67,-0.82,-11.54,-0.71,-12.61,-0.56,-13.59,-0.43,-7.05,-1.24,-8.65,-1.18,-10.41,-1.11,-11.86,-1.04,-12.56,-1,-12.77,-0.96,-13.48,-0.85,-14.39,-0.72,-15.2,-0.62,-8.38,-1.19,-10.17,-1.11,-12.14,-1.01,-13.76,-0.91,-14.52,-0.87,-14.73,-0.84,-15.43,-0.76,-16.31,-0.67,-17.1,-0.6,-9.85,-0.99,-11.77,-0.89,-13.89,-0.77,-15.62,-0.67,-16.37,-0.62,-16.64,-0.61,-17.38,-0.57,-18.3,-0.53,-19.12,-0.5,-11.24,-0.87,-13.33,-0.74,-15.64,-0.6,-17.5,-0.48,-18.27,-0.43,-18.58,-0.43,-19.33,-0.43,-20.25,-0.43,-21.08,-0.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-5,0,-3.51,0,-1.87,0,-0.55,0,0,0,0,0,0,0,0,0,0,0,-3.78,0,-2.04,0,-0.11,0,1.44,0,2.07,0,2.27,0,2.55,0,2.86,0,3.15,0,-2.58,0,-0.6,0,1.6,0,3.36,0,4.06,0,4.57,0,5.23,0,5.95,0,6.64,0,-1.34,0,0.91,0,3.41,0,5.41,0,6.21,0,6.81,0,7.65,0,8.58,0,9.46,0,0,0,2.6,0,5.47,0,7.79,0,8.75,0,8.95,0,9.45,0,10.06,0,10.62,0,2.28,0.24,4.9,0.17,7.77,0,10.13,-0.17,11.22,-0.24,11.05,-0.21,11.06,-0.12,11.13,-0.04,11.17,0,5.15,0.22,7.51,0.15,10.09,0,12.22,-0.15,13.2,-0.22,12.98,-0.18,12.81,-0.11,12.66,-0.03,12.49,0,8.26,0.08,10.24,0.06,12.43,0,14.21,-0.06,14.98,-0.08,14.84,-0.07,14.62,-0.04,14.37,-0.01,14.13,0,11.24,0,12.91,0,14.76,0,16.25,0,16.87,0,16.73,0,16.4,0,15.99,0,15.62]}]},{"name":"B_CLOTHES.12","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-9.37,-0.58,-9.37,-0.58,-9.37,-0.58,-9.37,-0.58,-9.37,-0.58,-8.82,-0.71,-7.5,-1.01,-5.86,-1.39,-4.37,-1.74,-10.07,-0.58,-10.02,-0.59,-9.98,-0.62,-9.93,-0.65,-9.89,-0.66,-9.32,-0.8,-7.9,-1.12,-6.15,-1.53,-4.56,-1.91,-10.83,-0.58,-10.72,-0.61,-10.6,-0.69,-10.48,-0.76,-10.37,-0.8,-9.78,-0.93,-8.29,-1.27,-6.44,-1.69,-4.76,-2.1,-11.46,-0.58,-11.33,-0.62,-11.19,-0.7,-11.06,-0.79,-10.93,-0.82,-10.31,-0.97,-8.71,-1.34,-6.72,-1.81,-4.93,-2.25,-11.71,-0.58,-11.71,-0.58,-11.71,-0.58,-11.71,-0.58,-11.71,-0.58,-10.98,-0.77,-9.2,-1.23,-6.99,-1.8,-5,-2.32,-13.21,-0.58,-13.15,-0.58,-13.08,-0.58,-13.01,-0.58,-12.97,-0.58,-12.05,-0.76,-10.07,-1.19,-7.67,-1.7,-5.48,-2.13,-14.35,-0.58,-14.25,-0.58,-14.14,-0.58,-14.05,-0.58,-14,-0.58,-13.11,-0.71,-11.16,-1.01,-8.79,-1.37,-6.64,-1.67,-15.34,-0.58,-15.22,-0.58,-15.1,-0.58,-14.99,-0.58,-14.94,-0.58,-14.16,-0.64,-12.34,-0.78,-10.1,-0.95,-8.07,-1.1,-16.4,-0.58,-16.26,-0.58,-16.11,-0.58,-15.98,-0.58,-15.93,-0.58,-15.21,-0.58,-13.47,-0.58,-11.32,-0.58,-9.37,-0.58]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[6.25,1.16,4.95,0.47,3.51,-0.29,2.35,-0.91,1.87,-1.16,1.27,-1.66,0.47,-2.24,-0.41,-2.87,-1.25,-3.48,7.55,0.81,6.18,0.24,4.71,-0.37,3.46,-0.88,2.8,-1.16,2.16,-1.68,1.16,-2.46,0.01,-3.35,-1.06,-4.16,8.98,0.43,7.55,-0.02,6.02,-0.47,4.68,-0.87,3.83,-1.16,3.13,-1.71,1.91,-2.72,0.47,-3.89,-0.86,-4.92,10.14,0.13,8.65,-0.22,7.09,-0.53,5.68,-0.84,4.66,-1.16,3.95,-1.72,2.54,-2.9,0.85,-4.31,-0.69,-5.54,10.62,0,9.13,-0.26,7.57,-0.51,6.14,-0.79,5,-1.16,4.38,-1.67,2.89,-2.9,1.04,-4.42,-0.62,-5.79,11.68,0.06,10.33,-0.15,8.89,-0.33,7.61,-0.52,6.73,-0.79,5.79,-1.31,3.86,-2.55,1.55,-4,-0.56,-5.16,12.26,0.22,10.94,0.02,9.52,-0.14,8.3,-0.31,7.57,-0.51,6.56,-0.89,4.46,-1.78,1.93,-2.82,-0.39,-3.62,12.64,0.41,11.32,0.22,9.89,0.04,8.69,-0.13,8.07,-0.26,7.11,-0.44,4.93,-0.85,2.25,-1.33,-0.19,-1.72,13.12,0.58,11.82,0.41,10.39,0.22,9.22,0.06,8.75,0,7.79,0,5.47,0,2.6]}]},{"name":"B_CLOTHES.14","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-5.3,-0.54,-6.13,-0.76,-6.87,-1.02,-6.8,-1.04,-4.97,-0.55,-3.14,-0.05,-2.73,0.47,-2,0.59,-1.25,0,-9.04,-1.03,-10.8,-1.45,-12.4,-1.92,-12.31,-1.96,-8.61,-1.03,-4.91,-0.09,-4.12,0.95,-2.71,1.18,-1.25,0,-9.97,-1.16,-13.39,-1.5,-16.55,-1.85,-17.01,-1.87,-11.84,-0.73,-5.71,0.49,-4.36,1.61,-2.85,1.55,-1.25,0,-9.68,-1.16,-14.66,-1.09,-19.27,-1.04,-20.8,-1.07,-16.37,-0.33,-8.07,0.75,-5.22,1.42,-3.33,1.06,-1.25,0,-9.4,-1.16,-15.87,-0.69,-21.85,-0.22,-24.67,-0.3,-22.07,-0.46,-12.84,-0.03,-8.23,0.33,-4.89,0.26,-1.25,0,-8.96,-0.78,-16.32,0.28,-23.31,1.72,-26.71,1.77,-20.82,-0.22,-9.21,-1.71,-4.56,-1.43,-2.48,-0.57,-0.29,0,-7.36,0.71,-12.9,2.09,-18.21,4.14,-19.81,4.36,-7.96,1.32,6.81,-1.47,9.23,-1.42,6.47,-0.63,3.45,0,-5.62,2.32,-7.36,2.59,-8.96,2.83,-7.89,2.72,7.89,0.87,23.66,-0.98,23.21,-1.03,15.67,-0.54,7.5]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-17.34,-4.24,-11.63,-3.65,-6.35,-3.1,-6.95,-2.92,-9.38,-2.61,-8.02,-2.57,-7.93,-2.62,-11.47,-2.2,-15.32,-1.75,-6.71,-2.28,-3.25,-2.03,-0.08,-1.88,-1.72,-1.82,-6.27,-1.54,-6.18,-1.42,-5.1,-1.02,-6.95,0.71,-8.98,1.96,3.49,-0.46,4.88,-0.51,6.12,-0.68,3.54,-0.72,-3.09,-0.5,-4.24,-0.36,-2.34,0.34,-2.68,2.86,-3.08,4.59,8.12,0,9.63,0,11.02,0,8.86,0,1.41,-0.05,-0.7,-0.09,0.72,0.02,-0.32,0.45,-1.44,0.9,8.12,0,12.04,0,15.69,0,15.18,-0.01,8.88,-0.16,5.64,-0.3,5.13,-0.27,1.12,-0.09,-3.17,0.11,8.12,0,13.95,0,19.36,0,20.14,-0.02,14.91,-0.28,10.45,-0.53,8.38,-0.58,1.98,-0.64,-4.89,-0.69,8.12,0,14.44,0.08,20.28,0.21,21.43,0.21,15.58,-0.19,9.73,-0.6,7.47,-0.65,1.36,-0.69,-5.2,-0.69,8.12,0,14.48,0.05,20.37,0.13,21.24,0.11,13.08,-0.35,4.91,-0.8,3,-0.8,-1.24,-0.62,-5.79,-0.4,8.12,0,14.48,0,20.36,0,20.87,-0.05,10.31,-0.54,-0.26,-1.03,-1.81,-0.97,-4.03,-0.54,-6.42,-0.08]}]},{"name":"B_CLOTHES.18","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[9.37,-4.06,8.21,-2.98,7.15,-1.99,11.31,-1.31,19.76,-0.14,18.28,0.53,14.72,0.52,13.65,0.27,12.49,0,8.79,-3.25,6.35,-2.76,4.08,-2.37,6,-1.96,9.21,-0.8,6.2,0.05,3.73,0.13,2.72,0.12,1.62,0,8.26,-2.51,4.61,-2.57,1.22,-2.72,0.94,-2.57,-1.13,-1.35,-5.69,-0.25,-7.09,-0.1,-8.06,0.04,-9.12,0,7.83,-2.39,3.6,-2.57,-0.3,-2.79,-1.79,-2.7,-7.42,-1.15,-13.04,0.41,-13.9,0.49,-14.68,0.25,-15.48,0,4.69,-3.19,0.62,-2.78,-3.09,-2.41,-4.45,-2.21,-10.82,-1.01,-17.18,0.18,-17.52,0.26,-15.87,0.13,-14.06,0,1.54,-3.98,-2.83,-2.99,-6.83,-2.04,-8.39,-1.71,-15.4,-0.88,-22.41,-0.05,-21.95,0.02,-17.47,0.02,-12.63,0,0.84,-3.61,-2.7,-2.75,-5.99,-1.85,-7.75,-1.54,-15.32,-0.81,-22.89,-0.07,-22.36,0,-17.55,0,-12.36,0,-0.76,-1.88,-1.6,-1.56,-2.38,-1.21,-3.47,-1.07,-11.81,-0.56,-20.14,-0.05,-19.95,0,-16.04,0,-11.82,0,-2.5,0,-0.76,-0.27,0.84,-0.52,0.42,-0.55,-8.43,-0.29,-17.28,-0.02,-17.37,0,-14.43,0,-11.24]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.32,-0.01,3.5,-0.02,3.68,-0.02,4.64,-0.01,5.6,0,5.37,0,4.28,0,3.12,0,3.12,0,3.5,-0.01,3.85,-0.03,4.19,-0.03,6.04,-0.02,7.9,0,7.46,0,5.37,0,3.12,0,3.12,0,4.02,-0.16,4.87,-0.36,5.46,-0.4,8.08,-0.22,10.69,-0.04,9.9,-0.02,6.77,-0.02,3.42,-0.02,3.12,0,4.24,-0.56,5.3,-1.29,6.31,-1.45,11.43,-0.89,16.55,-0.34,15.61,-0.29,11.23,-0.29,6.56,-0.29,3.12,0,3.94,-0.65,4.69,-1.37,5.66,-1.53,12.91,-1.06,20.16,-0.6,19.59,-0.55,14.83,-0.55,9.7,-0.55,2.34,-0.24,3.02,-0.57,3.69,-0.74,4.8,-0.76,11.9,-0.64,19,-0.51,18.23,-0.5,13.88,-0.51,9.24,-0.52,-0.73,0.05,-1.42,-0.14,-2.04,-0.16,-1.31,-0.15,5.43,-0.19,12.16,-0.22,11.82,-0.23,9.13,-0.25,6.3,-0.27,-4.06,0.42,-6.23,0.09,-8.23,-0.21,-8.24,-0.28,-2.81,-0.15,2.61,-0.01,3.12,0,3.12,0,3.12]}]},{"name":"B_CLOTHES.34","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[23.74,0,6.1,0,-10.2,0,-13.91,0,-9.06,0,-4.2,0,-3.75,0,-3.75,0,-3.75,0,22,0,5.62,0.23,-9.49,0.47,-14.54,0.51,-12.86,0.26,-6.26,0.02,-3.75,0,-3.75,0,-3.75,0,20.4,0,5.21,0.46,-8.79,0.91,-15.24,0.98,-16.7,0.51,-8.32,0.04,-3.75,0,-3.75,0,-3.75,0,20.48,0.17,5.54,0.61,-8.27,1.01,-15.95,1.08,-19.07,0.6,-9.5,0.07,-3.26,-0.05,-3.13,-0.06,-3.75,0,22.02,0.22,6.55,0.4,-7.77,0.52,-15.29,0.62,-17.57,0.5,-8.69,0.12,-1.78,-0.18,-1.29,-0.23,-3.75,0,23.03,0.02,7.19,0.02,-7.46,0,-14.63,0.17,-16.07,0.4,-7.88,0.18,-0.31,-0.32,0.55,-0.4,-3.75,0,23.59,0.05,7.38,0.03,-7.58,0.01,-13.58,0.16,-13.58,0.35,-6.73,0.15,-0.8,-0.27,-0.06,-0.34,-3.75,0,25.46,0.31,8.41,0.3,-7.32,0.28,-12.25,0.35,-10.54,0.32,-5.4,0.09,-2.27,-0.14,-1.91,-0.17,-3.75,0,27.49,0.58,9.56,0.58,-7.01,0.58,-10.92,0.55,-7.5,0.29,-4.07,0.02,-3.75,0,-3.75,0,-3.75]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[3.12,0,5.29,0,7.3,0,8.09,0,11.09,0,14.09,0,10.75,-0.19,-3.42,-0.93,-18.74,-1.74,3.12,0,5,0.04,6.73,0.1,9.51,0.11,14.54,0.16,14.04,0.25,8.52,0.14,-5.4,-0.36,-20.48,-0.93,3.12,0,4.69,0.06,6.14,0.15,10.9,0.17,18.02,0.3,14.12,0.48,6.46,0.45,-7.24,0.16,-22.08,-0.19,3.12,0,3.67,-0.05,5.06,-0.04,12,-0.01,20.97,0.2,14.9,0.48,5.72,0.46,-7.89,0.22,-22.62,-0.03,3.12,0,1.54,-0.21,3.6,-0.17,12.46,-0.02,20.7,-0.06,13.47,-0.05,4.06,-0.07,-9.45,-0.19,-24.06,-0.32,3.12,0,-0.61,-0.37,2.13,-0.29,12.92,-0.03,20.41,-0.31,12.05,-0.58,2.4,-0.6,-11,-0.6,-25.5,-0.62,3.12,0,-0.8,-0.36,0.93,-0.3,9.56,-0.09,15.59,-0.48,9.61,-0.87,1.5,-0.87,-11.57,-0.73,-25.7,-0.64,3.12,0,-0.39,-0.3,-0.97,-0.39,3.1,-0.31,7.25,-0.55,5.39,-0.79,-0.08,-0.79,-12.52,-0.69,-25.96,-0.62,3.12,0,-0.06,-0.25,-3,-0.49,-3.54,-0.55,-1.24,-0.6,1.06,-0.65,-1.74,-0.65,-13.51,-0.63,-26.25,-0.61]}]},{"name":"B_CLOTHES.19","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91]}]},{"name":"B_CLOTHES.21","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[2.81,6.52,2.39,4.96,1.93,3.37,1.56,1.83,1.41,0.43,-1.13,-0.07,-2.28,-0.38,-2.88,-0.6,-3.75,-0.87,2.95,2.91,1.33,2.11,0.03,1.45,-1.02,0.86,-1.87,0.31,-4.11,-0.11,-4.99,-0.43,-5.32,-0.7,-5.92,-1,3.1,-1.09,0.24,-1.06,-1.98,-0.66,-3.78,-0.17,-5.39,0.16,-7.28,-0.16,-7.83,-0.49,-7.85,-0.81,-8.14,-1.14,3.23,-4.32,-0.73,-3.59,-3.77,-2.39,-6.23,-1.05,-8.43,0.05,-10.07,-0.19,-10.39,-0.52,-10.2,-0.9,-10.27,-1.26,3.28,-5.65,-1.51,-4.5,-5.06,-3.13,-7.84,-1.61,-10.31,0,-11.9,-0.14,-12.24,-0.49,-12.09,-0.92,-12.18,-1.3,3.07,-6.08,-2.09,-4.83,-6.47,-3.38,-10.08,-1.81,-12.95,-0.17,-14.28,-0.37,-15.1,-0.81,-15.72,-1.26,-16.44,-1.48,2.58,-7.11,-2.67,-5.77,-7.54,-4.28,-11.62,-2.68,-14.52,-1,-15.73,-1.04,-17.19,-1.12,-18.74,-1.14,-20.26,-0.98,1.96,-8.4,-3.21,-6.94,-8.4,-5.44,-12.78,-3.84,-15.51,-2.09,-16.7,-1.9,-18.9,-1.43,-21.5,-0.82,-23.91,-0.2,1.41,-9.56,-3.68,-7.99,-9.2,-6.46,-13.86,-4.85,-16.4,-3.04,-17.63,-2.66,-20.62,-1.74,-24.31,-0.6,-27.64,0.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[4.37,0,5.49,0,6.72,0,7.71,0,8.12,0,9.62,0,13.28,0,17.78,0,21.87,0,3.26,0,4.68,-0.2,6.37,-0.35,7.86,-0.41,8.67,-0.34,11.28,-0.3,15.25,-0.2,19.31,-0.08,22.24,0,2.03,0,3.82,-0.42,6.04,-0.73,8.1,-0.86,9.37,-0.72,13.06,-0.63,17.3,-0.41,20.9,-0.17,22.65,0,1.03,0,3.06,-0.61,5.68,-1.07,8.15,-1.24,9.76,-1.03,14.58,-0.9,19.16,-0.59,22.35,-0.24,22.98,0,0.62,0,2.55,-0.77,5.2,-1.3,7.76,-1.46,9.37,-1.16,15.49,-1.01,20.57,-0.67,23.49,-0.29,23.11,0,-0.98,0,1.43,-0.61,4.47,-1.06,7.27,-1.24,8.96,-1.03,14.25,-1.01,19.05,-0.75,22.22,-0.41,22.64,-0.13,-2.19,0,0.46,-0.41,3.63,-0.73,6.43,-0.86,7.97,-0.72,12.39,-0.88,16.88,-0.83,20.3,-0.66,21.47,-0.43,-3.24,0,-0.46,-0.2,2.74,-0.35,5.44,-0.41,6.74,-0.34,10.29,-0.7,14.47,-0.91,18.1,-0.96,20.04,-0.81,-4.37,0,-1.41,0,1.87,0,4.53,0,5.62,0,8.32,-0.54,12.18,-0.99,16.04,-1.23,18.74,-1.16]}]},{"name":"B_CLOTHES.23","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-14.99,0,-11.01,0,-6.6,0,-3.03,0,-1.56,0,-1.19,-0.1,-0.27,-0.33,0.85,-0.61,1.87,-0.87,-16.11,0.52,-12.6,0.38,-8.73,0.23,-5.59,0.11,-4.26,0.06,-3.59,-0.02,-1.93,-0.23,0.12,-0.48,1.97,-0.7,-17.34,1.09,-14.27,0.82,-10.89,0.51,-8.13,0.27,-6.91,0.16,-5.95,0.09,-3.56,-0.1,-0.6,-0.32,2.07,-0.51,-18.33,1.55,-15.79,1.15,-12.99,0.7,-10.7,0.33,-9.66,0.18,-8.39,0.12,-5.25,-0.03,-1.36,-0.21,2.15,-0.35,-18.74,1.74,-16.93,1.22,-14.93,0.65,-13.32,0.19,-12.65,0,-11.03,-0.03,-7.09,-0.11,-2.22,-0.2,2.19,-0.29,-19.24,2.16,-19.11,1.86,-17.41,1.51,-14.87,1.21,-12.19,1.03,-10.34,1.08,-6.24,1.19,-1.25,1.28,3.29,1.27,-19.44,2.72,-20.9,2.63,-19.41,2.48,-15.85,2.3,-11.07,2.12,-9.33,2.16,-5.49,2.24,-0.79,2.29,3.47,2.26,-19.53,3.33,-22.55,3.44,-21.24,3.48,-16.62,3.43,-9.69,3.24,-8.21,3.22,-4.77,3.18,-0.55,3.12,3.28,3.03,-19.68,3.91,-24.29,4.23,-23.17,4.47,-17.5,4.54,-8.43,4.34,-7.15,4.3,-4.04,4.18,-0.2,4.04,3.28,3.91]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[8.12,0,4.6,0.17,0.7,0.36,-2.45,0.52,-3.75,0.58,-3.2,0.45,-1.87,0.14,-0.23,-0.24,1.25,-0.58,9.42,0,6.49,0.14,3.26,0.3,0.64,0.43,-0.4,0.49,-0.44,0.39,-0.34,0.15,-0.18,-0.15,-0.05,-0.41,10.85,0,8.56,0.11,6,0.25,3.96,0.38,3.2,0.43,2.46,0.36,1.24,0.18,-0.17,-0.04,-1.48,-0.22,12.02,0,10.29,0.07,8.37,0.17,6.84,0.27,6.3,0.31,5.03,0.26,2.69,0.16,-0.09,0.03,-2.65,-0.06,12.49,0,11.2,0,9.76,0,8.6,0,8.12,0,6.89,0,3.9,0,0.21,0,-3.12,0,12.49,0,12.39,-0.29,11.65,-0.39,10.48,-0.29,9.08,0,7.93,0,4.76,0,0.79,0,-2.78,0,12.49,0,13.92,-0.59,14.21,-0.78,13.37,-0.59,11.4,0,10.07,0,6.51,0,2.06,0,-1.95,0,12.49,0,15.62,-0.89,17.09,-1.19,16.71,-0.89,14.27,0,12.66,0,8.62,0,3.6,0,-0.93,0,12.49,0,17.26,-1.19,19.84,-1.59,19.85,-1.19,16.87,0,15.02,0,10.54,0,5.01]}]},{"name":"B_CLOTHES.13","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-3.96,0.6,-7.62,1.16,-8.54,1.27,-7.51,0.83,-5.19,0.01,-3.63,-0.26,-1.89,-0.1,0,0,0,0,-7.84,1.2,-15.1,2.32,-16.93,2.55,-14.92,1.71,-10.32,0.15,-7.23,-0.41,-3.75,-0.15,0,0,0,0,-10.41,1.54,-20.07,3.09,-22.75,3.45,-20.38,2.57,-14.05,0.74,-9.88,-0.02,-5.15,-0.02,0,0,0,0,-10.38,0.87,-20.01,1.73,-23.83,2,-23.61,1.5,-18,0.24,-13.37,-0.26,-6.96,-0.13,0,0,0,0,-9.89,0.12,-19.04,0.17,-23.79,0.32,-26.42,0.3,-22.41,-0.27,-17.47,-0.49,-9.08,-0.25,0,0,0,0,-8.4,-0.04,-16.15,-0.06,-20.13,0.08,-22.92,0.23,-20.32,0,-16.29,-0.13,-8.48,-0.07,0,0,0,0,-6.36,-0.15,-12.23,-0.28,-14.83,-0.2,-17.47,0.26,-17.42,0.54,-14.72,0.45,-7.66,0.23,0,0,0,0,-4.34,-0.27,-8.35,-0.52,-9.61,-0.5,-12.18,0.29,-14.75,1.08,-13.35,1.03,-6.94,0.54]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[2.08,-0.05,4.01,-0.13,4.54,-0.15,4.15,-0.08,3.76,-0.01,3.24,0,1.67,0,0,0,0,0,4.11,-0.08,7.91,-0.21,8.94,-0.23,8.1,-0.12,7.26,-0.01,6.27,0,3.24,0,0,0,0,0,6.43,-0.03,12.39,-0.12,13.82,-0.14,11.73,-0.15,9.63,-0.17,8.28,-0.14,4.29,-0.05,0,0,0,0,9.78,0.07,18.88,0.08,21.01,0.06,16.79,-0.07,12.56,-0.2,10.48,-0.18,5.42,-0.07,0,0,0,0,11.89,0.24,22.9,0.47,25.26,0.51,19.48,0.25,13.7,0,11.54,-0.02,5.99,-0.01,0,0,0,0,11.92,0.23,22.95,0.46,24.61,0.49,18.18,0.26,13.33,0.02,11.91,0,6.2,0,0,0,0,0,11.19,0.12,21.54,0.24,22.22,0.26,15.68,0.13,13.08,0.01,12.61,0,6.56,0,0,0,0,0,10.41,0,20.03,0,19.7,0,13.11,0,12.85,0,13.35,0,6.94]}]},{"name":"B_NECK.02","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-4.69},{"duration":60,"tweenEasing":0},{"x":4.06}]},{"name":"B_NECK.02","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-0.1},{"duration":61}]},{"name":"D_CLOTHES.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[0.03,-0.44,0.04,-0.34,0.04,2.86,0.8,2.68,0.42,-0.63,0.57,-1.33,0.41,-1.8,-0.44,-0.98,-0.56,-2.32,9.56,-1.05,3.03,-0.85,-1.7,-1.35,-1.94,-1.42,0.13,-0.84,-0.92,-2.12,-0.56,-2.1,0.58,-1.63,-1.17,-2.29,3.26,2.15,0.6,-1.7,0.78,-1.81,-0.45,-2.07,0.86,-1.83,0.65,-1.67,1.7,-1.78,0.34,-1.21,0.01,-0.61,0.03,-0.43,0.11,-0.34,0.28,-0.96,0.13,-0.86,-6.57,-8.4,0.03,-0.66,0.02,-0.56,0.07,-0.93,0.49,-1.39,0.03,-0.43,0.04,-0.29,0.04,-0.32,0.03,0.7,0.67,-1.49,0.74,-1.59,0.45,-1.23,0.13,-0.5,0.17,-0.57,0.33,-1.07,0.56,-1.35,0.42,-2.17,-0.19,-1.33,-8.01,2.02,-2.83,-5.46,-1.96,-5.44,-4.36,-0.91,-0.88,-1.17,-6.78,-7.61,-0.5,-2.03,-0.57,-0.55,-0.63,-2.01,0.72,-1.72,-4.78,-5.43,-0.88,-2.58,-1.3,-2.32,-0.62,-2.21,-0.2,-2.01,-1.28,-2.39,-0.81,-2.1,-0.13,-1.96,-0.22,-1.95,-0.48,-2.12,0.62,-1.69,-0.23,-1.87]},{"duration":60,"tweenEasing":0,"offset":141},{"value":[-0.01,1.04,-0.02,0.7,-0.02,3.57,-6.48,2.63,-0.04,1.49,-1.05,3.1,0.09,4.17,16.25,-3.46,17.89,5.58,14.69,7.15,20.51,11.76,6.31,-0.26,2.43,14.74,-0.33,2.19,2.16,4.56,6.72,3.12,13.62,3.47,2.99,5.21,14.71,8.79,-0.14,3.62,-3.99,4.77,9.84,1.91,0.03,3.96,-3.05,3.91,1.33,3.85,-0.19,3.09,-0.02,1.44,-0.02,1.01,-0.03,0.72,-0.92,2.43,0.04,1.47,-0.67,4.8,-0.01,1.56,-0.02,1.23,-0.55,2.19,-0.18,3.44,-0.02,1.02,-0.02,0.56,-0.02,0.81,-0.02,1.72,-0.49,3.51,-0.83,3.61,-0.63,3.03,-0.03,1.17,3.99,1.44,3.72,1.48,-0.56,3.24,9.15,0.87,14.1,5.6,2.18,15.99,-0.18,7.48,-3.43,9.68,-2.01,13.26,3.65,13.01,-4.43,3.73,0.78,3.92,6.85,-2.09,6,1,-0.13,3.71,-2.38,4.47,7.83,-1.46,3.19,5.14,12.41,5.14,14.6,3.79,3.68,5.7,4.54,3.8,-5.25,4.66,8.93,6.64,14.42,3.95,-6.06,7.91,-1.9,4.22]}]},{"name":"D_CLOTHES.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[11.69,4.17,0.05,0,0.05,0.03,-0.92,4.64,0.07,0.11,0.1,0.24,2.21,2.39,-5.45,10.3,1.28,-0.17,12.54,2.12,-3.04,-0.27,-1.53,-6.76,12.69,2.39,0.74,-0.03,0.31,0.07,0.49,3.4,-1.56,-0.76,11.39,1.93,1.47,0.2,0.66,0.22,-2.14,-0.31,0.07,0.09,3.96,1.13,0.06,0.1,-0.64,0.8,4.75,0.53,0.07,0.02,0.05,0.01,-1.34,2.2,-2.36,0,0.76,-0.04,0.16,0.11,0.45,0.05,0.17,0.08,-1.65,-0.88,4.43,-0.59,6.02,1.93,-0.35,0.09,-0.22,0.15,0.05,0.09,-2.29,1.87,0.63,10.29,3.37,5.16,0.67,0.29,1.25,5.74,-8.13,3.14,2.28,1.29,-1.72,-0.78,3.45,1.75,5.55,3.63,-1.05,-0.32,3.32,4.11,-2.88,3.93,-2.95,-0.45,-3.14,2.16,-2.55,4.75,0.45,-1.06,-2.94,1.27,0.66,-1.53,0.38,-0.69,0.3,0.09,1.32,-0.67,8.27,-0.11,2.66,-1.06]},{"duration":60,"tweenEasing":0,"offset":127},{"value":[11.59,4.33,-0.06,0.24,-0.13,0.48,4.35,-5.37,-9.94,-2.47,-7.92,-0.25,-1.94,6.7,-2.72,12.98,4.24,4.69,0.9,4.71,0,4.61,0.02,4.22,-0.24,3.39,-2.44,2.22,6.88,1.07,-0.23,3.89,0.6,3.98,4.55,3.3,-1.23,3.16,-2.86,1.96,-1.71,1.32,-17.96,-3.21,3.73,1.71,-9.08,-1.36,-1.09,1.28,4.52,0.92,-6.25,-0.47,-6.93,-0.74,1.54,5.68,2.05,3.8,-1.02,2.96,1.07,0.16,6.01,1.49,2.6,0.84,2.18,1.2,7.49,0.52,-2.66,2.54,-16.19,-1.28,-5.75,0.36,-1.51,1.64,-7.5,-1.31,-0.22,11.35,-5.32,6.6,-6.66,0.05,-1.09,6.91,-2.52,7.67,-0.46,0.54,0.01,4.34,-0.25,3.59,-0.45,3.49,0.55,3.6,-4,6.86,-5.35,10.56,0.95,-0.77,-1.58,4.7,-3.21,6.92,-2.16,2.59,-0.71,5.08,-2.18,2.59,4.76,1.91,-2.34,1.52,-1.23,3.44,-0.27,3.37,1.73,2.12]}]},{"name":"D_CLOTHES.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[24.14,5.84,0,0,0,0,0,0,0,0,-0.91,1.96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8.62,3.66]},{"duration":60,"tweenEasing":0,"offset":57},{"offset":10,"value":[-35.89,7.81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-17.74,0.01]}]},{"name":"B_BODY.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.9,-0.45,3.7,-0.24,-1.11,-0.04,-2.34,0.01,-2.34,0,-2.34,-0.01,-3.32,0.22,-7.13,1.12,-11.25,2.09,9.34,0.72,3.94,0.42,-1.05,0.1,-2.47,0.01,-3.42,-0.1,-4.38,-0.22,-5.24,-0.12,-8.33,0.34,-11.68,0.87,9.74,1.8,4.16,1.02,-1,0.23,-2.58,0,-4.42,-0.2,-6.27,-0.41,-7.03,-0.43,-9.45,-0.38,-12.08,-0.25,9.78,2.01,4.18,1.11,-1,0.26,-2.54,0.01,-4.71,-0.21,-6.88,-0.43,-7.65,-0.46,-9.81,-0.49,-12.15,-0.56,9.15,1.2,3.83,0.65,-1.09,0.16,-2.58,0.03,-5.02,0,-7.47,-0.03,-8.14,-0.12,-9.86,-0.44,-11.74,-0.77,8.51,0.39,3.47,0.2,-1.17,0.07,-2.61,0.04,-5.34,0.2,-8.06,0.37,-8.62,0.21,-9.91,-0.39,-11.32,-0.98,8.7,0.27,3.56,0.16,-1.19,0.06,-2.65,0.04,-5.04,0.2,-7.42,0.36,-8.06,0.21,-9.14,-0.36,-10.3,-0.89,9.7,0.13,4.1,0.08,-1.06,0.05,-2.51,0.03,-3.74,0.1,-4.97,0.18,-5.32,0.09,-5.88,-0.21,-6.48,-0.47,10.78,-0.03,4.7,0,-0.91,0.03,-2.35,0.03,-2.34,0,-2.33,-0.02,-2.34,-0.03,-2.35,-0.04,-2.34,-0.01]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[4.22,-0.01,4.22,-0.01,4.22,-0.02,4.22,-0.02,4.22,0,4.21,0.01,1.86,0,-7.36,-0.03,-17.34,-0.05,4.22,-0.02,4.22,-0.02,4.22,-0.03,4.08,-0.02,3.03,0.08,1.97,0.18,-0.06,0.16,-7.93,0.03,-16.47,-0.09,4.22,-0.03,4.22,-0.03,4.22,-0.04,3.96,-0.03,1.93,0.16,-0.11,0.34,-1.87,0.31,-8.49,0.09,-15.67,-0.13,4.22,-0.05,4.22,-0.04,4.22,-0.06,3.97,-0.04,1.75,0.17,-0.47,0.37,-2.24,0.35,-8.63,0.11,-15.55,-0.13,4.22,-0.06,4.22,-0.06,4.22,-0.07,4.11,-0.05,2.93,0.08,1.74,0.21,-0.35,0.2,-8.08,0.04,-16.42,-0.14,4.22,-0.07,4.21,-0.07,4.22,-0.06,4.25,-0.04,4.1,0,3.95,0.03,1.53,0.04,-7.53,-0.04,-17.29,-0.16,4.22,-0.06,4.21,-0.07,4.22,-0.06,4.22,-0.04,4.21,-0.01,4.2,0.01,1.78,0.02,-7.26,-0.04,-17.02,-0.15,4.22,-0.04,4.22,-0.06,4.22,-0.07,4.22,-0.05,4.22,-0.01,4.2,0.02,1.98,0.03,-6.47,-0.01,-15.59,-0.1,4.22,-0.02,4.22,-0.06,4.22,-0.07,4.22,-0.05,4.21,0,4.2,0.04,2.21,0.05,-5.59,0.03,-14.05,-0.05]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.38","timeline":[{"name":"B_CLOTHES.38_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.38_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.38_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.38_00","timeline":[{"name":"B_CLOTHES.38","type":12,"frame":[{"duration":121,"x":-1.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.38_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.38_02","timeline":[{"name":"B_CLOTHES.38","type":12,"frame":[{"duration":121,"x":5.4}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.39","timeline":[{"name":"B_CLOTHES.39_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.39_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.39_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.39_00","timeline":[{"name":"B_CLOTHES.39","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":26.5,"y":2.97},{"duration":60,"tweenEasing":0},{"x":-19.88,"y":-2.23}]},{"name":"B_CLOTHES.39","type":12,"frame":[{"duration":121,"x":6.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.39_01","timeline":[{"name":"B_CLOTHES.39","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":38.5,"y":3.57},{"duration":60,"tweenEasing":0},{"x":-27.88,"y":-2.59}]},{"name":"B_CLOTHES.39","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":-1.7}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.39_02","timeline":[{"name":"B_CLOTHES.39","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":29.33,"y":-0.05},{"duration":60,"tweenEasing":0},{"x":-24,"y":0.04}]},{"name":"B_CLOTHES.39","type":12,"frame":[{"duration":121,"x":-15.1}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.63","timeline":[{"name":"B_CLOTHES.63_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.63_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.63_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.63_00","timeline":[{"name":"B_CLOTHES.63","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":26.5,"y":2.97},{"duration":60,"tweenEasing":0},{"x":-19.88,"y":-2.23}]},{"name":"B_CLOTHES.63","type":12,"frame":[{"duration":121,"x":6.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.63_01","timeline":[{"name":"B_CLOTHES.63","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":38.5,"y":3.57},{"duration":60,"tweenEasing":0},{"x":-27.88,"y":-2.59}]},{"name":"B_CLOTHES.63","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":-1.7}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.63_02","timeline":[{"name":"B_CLOTHES.63","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":29.33,"y":-0.05},{"duration":60,"tweenEasing":0},{"x":-24,"y":0.04}]},{"name":"B_CLOTHES.63","type":12,"frame":[{"duration":121,"x":-15.1}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.62","timeline":[{"name":"B_CLOTHES.62_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.62_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.62_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.62_00","timeline":[{"name":"B_CLOTHES.62","type":12,"frame":[{"duration":121,"x":-1.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.62_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.62_02","timeline":[{"name":"B_CLOTHES.62","type":12,"frame":[{"duration":121,"x":5.4}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_REF.BODY","timeline":[{"name":"D_REF.BODY_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_REF.BODY_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_REF.BODY_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_REF.BODY_00","timeline":[{"name":"D_REF.BODY","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-54,64.99,-26,64.76,0,1.19,0,1.47]},{"duration":60,"tweenEasing":0,"offset":1,"value":[40.63,0,40.23,0,1.93,0,2.42]},{"value":[54,64.63,54,64.23,0,1.94,0,2.42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_REF.BODY_01","timeline":[{"name":"D_REF.BODY","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-54,40,-32,40]},{"duration":60,"tweenEasing":0,"offset":7},{"value":[32,24,54,24]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_REF.BODY_02","timeline":[{"name":"D_REF.BODY","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-54,20.79,-34,20.99,0,-0.91,0,-1.15]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-9.6,0,-9.51,0,-0.46,0,-0.57]},{"value":[34,14.4,54,14.49,0,-0.46,0,-0.57]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_FACESHADOW.01","timeline":[{"name":"B_FACESHADOW.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_FACESHADOW.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_FACESHADOW.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_FACESHADOW.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_FACESHADOW.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_00","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-104.32,-16.06,-90.4,-52.76,-76.2,-88.24,-58.56,-102.73,-40.07,-81.07,-29.17,-62.49,-29.93,-61.89,-36.2,-54.85,-42.99,-46.87,-90.9,-18.06,-80.86,-54.37,-70.96,-89.24,-58.37,-105.73,-45.4,-89.2,-36.92,-70.2,-37.07,-63.47,-40.87,-55.52,-44.84,-47.21,-78.49,-19.92,-72.06,-55.95,-66.1,-90.66,-58.34,-108.96,-50.81,-97.36,-44.75,-77.78,-44.27,-64.87,-45.48,-56.11,-46.55,-47.52,-74.93,-18.73,-69.64,-55.69,-63.86,-91.83,-58.96,-112.35,-54.92,-103.75,-50.33,-82.5,-49.46,-67.08,-48.22,-55.55,-47.11,-47.57,-67.32,-13.01,-63.18,-49.68,-58.61,-85.57,-55.09,-107.86,-52.4,-102.58,-49.15,-82.38,-49.41,-73.11,-48.92,-54.05,-48.82,-47.74,-57.47,-5.47,-55.01,-42.07,-52.5,-77.98,-50.68,-102.34,-49.59,-100.76,-47.95,-82.07,-49.62,-79.52,-50.78,-53.63,-52.22,-49.58,-56.25,4.41,-54.36,-33.35,-52.03,-71.1,-50.57,-97.13,-49.93,-97.54,-49.04,-81.07,-52.25,-77.94,-55.64,-53.34,-58.8,-47.36,-53.87,11.7,-53.12,-26.62,-52.01,-65.79,-50.99,-92.23,-52.46,-93.42,-54.08,-79.01,-58.59,-72.13,-62.89,-54.45,-66.87,-45.67,-50.99,18.61,-51.52,-20.22,-51.83,-60.78,-51.33,-87.51,-55.15,-89.39,-59.54,-76.93,-65.3,-66.4,-70.31,-55.8,-74.99,-44.45]},{"duration":60,"tweenEasing":0,"value":[-54.66,-16.06,-40.73,-52.76,-26.53,-88.24,-8.9,-102.73,9.6,-81.07,20.49,-62.49,19.74,-61.89,13.47,-54.85,6.68,-46.87,-41.23,-18.06,-31.19,-54.37,-21.3,-89.24,-8.71,-105.73,4.27,-89.2,12.75,-70.2,12.6,-63.47,8.79,-55.52,4.83,-47.21,-28.83,-19.92,-22.39,-55.95,-16.44,-90.66,-8.67,-108.96,-1.15,-97.36,4.92,-77.78,5.39,-64.87,4.18,-56.11,3.12,-47.52,-25.26,-18.77,-19.97,-55.7,-14.19,-91.82,-9.29,-112.35,-5.26,-103.75,-0.66,-82.5,0.21,-67.08,1.45,-55.55,2.56,-47.57,-17.65,-13.51,-13.51,-49.94,-8.94,-85.63,-5.42,-107.86,-2.73,-102.58,0.52,-82.38,0.26,-73.11,0.74,-54.05,0.84,-47.74,-7.8,-6.43,-5.35,-42.59,-2.84,-78.09,-1.02,-102.34,0.08,-100.76,1.72,-82.07,0.05,-79.52,-1.11,-53.63,-2.55,-49.58,-6.17,1.49,-4.41,-34.93,-2.3,-71.47,-0.9,-97.13,-0.27,-97.54,0.63,-81.07,-2.58,-77.94,-5.97,-53.34,-9.13,-47.36,-3.94,6.69,-3.28,-29.23,-2.3,-66.35,-1.32,-92.23,-2.79,-93.42,-4.41,-79.01,-8.92,-72.13,-13.22,-54.45,-17.2,-45.67,-1.32,11.61,-1.85,-23.8,-2.17,-61.49,-1.67,-87.51,-5.49,-89.39,-9.87,-76.93,-15.63,-66.4,-20.64,-55.8,-25.32,-44.45]},{"value":[-31.99,-16.06,-18.07,-52.76,-3.86,-88.24,13.77,-102.73,32.26,-81.07,43.16,-62.49,42.41,-61.89,36.13,-54.85,29.35,-46.87,-18.56,-18.06,-8.52,-54.37,1.37,-89.24,13.96,-105.73,26.94,-89.2,35.42,-70.2,35.26,-63.47,31.46,-55.52,27.49,-47.21,-6.16,-19.92,0.28,-55.95,6.23,-90.66,14,-108.96,21.52,-97.36,27.58,-77.78,28.06,-64.87,26.85,-56.11,25.78,-47.52,-2.59,-18.77,2.7,-55.7,8.47,-91.82,13.38,-112.35,17.41,-103.75,22,-82.5,22.87,-67.08,24.11,-55.55,25.22,-47.57,5.01,-13.51,9.15,-49.94,13.72,-85.63,17.24,-107.86,19.94,-102.58,23.18,-82.38,22.92,-73.11,23.41,-54.05,23.51,-47.74,14.87,-6.43,17.32,-42.59,19.83,-78.09,21.65,-102.34,22.75,-100.76,24.39,-82.07,22.72,-79.52,21.56,-53.63,20.11,-49.58,16.5,1.49,18.26,-34.93,20.37,-71.47,21.76,-97.13,22.4,-97.54,23.3,-81.07,20.08,-77.94,16.7,-53.34,13.53,-47.36,18.72,6.69,19.39,-29.23,20.36,-66.35,21.34,-92.23,19.87,-93.42,18.26,-79.01,13.74,-72.13,9.45,-54.45,5.46,-45.67,21.34,11.61,20.82,-23.8,20.5,-61.49,21,-87.51,17.18,-89.39,12.8,-76.93,7.03,-66.4,2.02,-55.8,-2.66,-44.45]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_01","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-49.67,-19.72,-49.67,-24.72,-49.67,-29.67,-49.67,-33.77,-49.67,-33.32,-49.67,-32.86,-49.67,-36.08,-49.67,-37.6,-49.67,-38.87,-50.37,-12.84,-50,-23.48,-49.73,-33.66,-49.67,-38.88,-49.67,-36.24,-49.67,-33.59,-49.67,-36.35,-49.67,-37.3,-49.67,-37.97,-51.2,-5.71,-50.42,-21.93,-49.81,-37.27,-49.67,-43.63,-49.67,-38.93,-49.67,-34.24,-49.67,-36.61,-49.67,-37.03,-49.67,-37.14,-52.51,3.06,-51.29,-17.93,-50.05,-37.67,-49.72,-45.19,-49.65,-39.71,-49.59,-34.22,-49.77,-38.03,-49.66,-36.33,-49.67,-37.01,-51.5,9.4,-50.96,-15.42,-50.46,-38.74,-50.26,-47.2,-49.5,-40.56,-48.74,-33.92,-49.53,-41.83,-49.44,-34.61,-49.67,-37.9,-50.49,14.48,-50.63,-13.75,-50.87,-40.21,-50.81,-49.22,-49.35,-41.42,-47.89,-33.63,-49.28,-45.61,-49.21,-32.89,-49.67,-38.79,-50.56,20.89,-50.78,-10.21,-50.96,-39.29,-50.87,-48.93,-49.44,-41.48,-48.02,-34.03,-49.22,-44.64,-49.24,-33.95,-49.67,-39.19,-50.13,28.06,-50.54,-5.53,-50.91,-36.92,-50.9,-47.29,-49.87,-41.4,-48.84,-35.51,-49.41,-42.18,-49.44,-37.39,-49.67,-40.44,-49.67,35.28,-50.28,-0.78,-50.85,-34.44,-50.94,-45.52,-50.33,-41.31,-49.72,-37.09,-49.67,-39.86,-49.67,-40.96,-49.67,-41.78]},{"duration":60,"tweenEasing":0,"offset":1,"value":[4.28,0,-11.83,0,-27.05,0,-33.77,0,-33.32,0,-32.86,0,-36.08,0,-37.6,0,-38.87,-1.23,2.43,-0.7,-15.25,-0.15,-31.94,0,-38.88,0,-36.24,0,-33.59,0,-36.35,0,-37.3,0,-37.97,-2.37,0.71,-1.33,-18.43,-0.28,-36.49,0,-43.63,0,-38.93,0,-34.24,0,-36.61,0,-37.03,0,-37.14,-2.55,0.45,-1.44,-19.45,-0.34,-38.15,-0.05,-45.19,0.01,-39.71,0.08,-34.22,-0.1,-38.03,0.01,-36.33,0,-37.01,-1.33,2.28,-1.02,-19.39,-0.74,-39.74,-0.6,-47.2,0.17,-40.56,0.93,-33.92,0.14,-41.83,0.23,-34.61,0,-37.9,-0.11,4.1,-0.6,-19.32,-1.13,-41.33,-1.14,-49.22,0.32,-41.42,1.78,-33.63,0.39,-45.61,0.45,-32.89,0,-38.79,0,4.28,-0.62,-19.12,-1.19,-41.1,-1.2,-48.93,0.22,-41.48,1.65,-34.03,0.45,-44.64,0.43,-33.95,0,-39.19,0,4.28,-0.62,-18.3,-1.19,-39.52,-1.24,-47.29,-0.2,-41.4,0.83,-35.51,0.25,-42.18,0.23,-37.39,0,-40.44,0,4.28,-0.62,-17.43,-1.19,-37.83,-1.28,-45.52,-0.67,-41.31,-0.06,-37.09,0,-39.86,0,-40.96,0,-41.78]},{"value":[22.67,4.28,22.67,-11.83,22.67,-27.05,22.67,-33.77,22.67,-33.32,22.67,-32.86,22.67,-36.08,22.67,-37.6,22.67,-38.87,21.43,2.43,21.97,-15.25,22.52,-31.94,22.67,-38.88,22.67,-36.24,22.67,-33.59,22.67,-36.35,22.67,-37.3,22.67,-37.97,20.29,0.71,21.33,-18.43,22.39,-36.49,22.67,-43.63,22.67,-38.93,22.67,-34.24,22.67,-36.61,22.67,-37.03,22.67,-37.14,20.11,0.45,21.22,-19.45,22.32,-38.15,22.62,-45.19,22.68,-39.71,22.75,-34.22,22.56,-38.03,22.67,-36.33,22.67,-37.01,21.33,2.28,21.64,-19.39,21.93,-39.74,22.07,-47.2,22.83,-40.56,23.6,-33.92,22.81,-41.83,22.9,-34.61,22.67,-37.9,22.55,4.1,22.06,-19.32,21.53,-41.33,21.53,-49.22,22.99,-41.42,24.44,-33.63,23.05,-45.61,23.12,-32.89,22.67,-38.79,22.67,4.28,22.05,-19.12,21.48,-41.1,21.47,-48.93,22.89,-41.48,24.31,-34.03,23.12,-44.64,23.1,-33.95,22.67,-39.19,22.67,4.28,22.05,-18.3,21.48,-39.52,21.43,-47.29,22.46,-41.4,23.5,-35.51,22.92,-42.18,22.89,-37.39,22.67,-40.44,22.67,4.28,22.05,-17.43,21.48,-37.83,21.39,-45.52,22,-41.31,22.61,-37.09,22.67,-39.86,22.67,-40.96,22.67,-41.78]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_02","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_03","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-49.67,29.2,-49.67,40.11,-49.67,50.31,-49.62,53.72,-49.17,52.35,-48.71,50.99,-48.78,45.11,-49.2,18.96,-49.67,-9.46,-49.67,29.2,-49.67,40.11,-49.67,50.31,-49.52,54.92,-49.12,54.92,-49.03,51.76,-49.29,45.42,-49.93,21.42,-50.59,-4.72,-49.67,29.2,-49.67,40.11,-49.67,50.31,-49.42,56.12,-49.05,57.49,-49.32,52.57,-49.77,45.63,-50.59,23.64,-51.45,-0.34,-49.67,29.2,-49.67,40.14,-49.67,50.36,-49.38,57.1,-49,59.6,-49.38,53.42,-49.88,44.99,-50.69,23.53,-51.49,0.25,-49.67,29.2,-49.67,40.35,-49.67,50.76,-49.49,57.89,-49.26,60.81,-49.49,54.22,-49.67,42.98,-49.67,19.61,-49.67,-5.34,-49.67,29.2,-49.67,40.56,-49.67,51.17,-49.6,58.68,-49.52,62.02,-49.6,55.01,-49.45,40.99,-48.63,15.7,-47.84,-10.94,-49.67,29.2,-49.67,40.71,-49.67,51.46,-49.54,59.12,-49.37,62.37,-49.54,54.94,-49.46,40.61,-48.67,15.23,-47.89,-11.47,-49.67,29.2,-49.67,41.11,-49.67,52.22,-49.38,59.91,-49.02,62.4,-49.38,54.16,-49.56,40.17,-49.14,15.03,-48.74,-11.49,-49.67,29.2,-49.67,41.53,-49.67,53.04,-49.23,60.75,-48.67,62.42,-49.23,53.34,-49.67,39.68,-49.67,14.8,-49.67,-11.51]},{"duration":60,"tweenEasing":0,"offset":1,"value":[29.2,0,40.11,0,50.31,0.04,53.72,0.5,52.35,0.96,50.99,0.89,45.11,0.46,18.96,0,-9.46,0,29.2,0,40.11,0,50.31,0.15,54.92,0.55,54.92,0.64,51.76,0.37,45.42,-0.26,21.42,-0.93,-4.72,0,29.2,0,40.11,0,50.31,0.25,56.12,0.62,57.49,0.35,52.57,-0.1,45.63,-0.92,23.64,-1.78,-0.34,0,29.2,0,40.14,0,50.36,0.29,57.1,0.66,59.6,0.29,53.42,-0.21,44.99,-1.03,23.53,-1.83,0.25,0,29.2,0,40.35,0,50.76,0.18,57.89,0.41,60.81,0.18,54.22,0,42.98,0,19.61,0,-5.34,0,29.2,0,40.56,0,51.17,0.06,58.68,0.15,62.02,0.06,55.01,0.22,40.99,1.03,15.7,1.83,-10.94,0,29.2,0,40.71,0,51.46,0.13,59.12,0.3,62.37,0.13,54.94,0.21,40.61,1,15.23,1.78,-11.47,0,29.2,0,41.11,0,52.22,0.28,59.91,0.65,62.4,0.28,54.16,0.11,40.17,0.52,15.03,0.93,-11.49,0,29.2,0,41.53,0,53.04,0.44,60.75,1,62.42,0.44,53.34,0,39.68,0,14.8,0,-11.51]},{"value":[22.67,29.2,22.67,40.11,22.67,50.31,22.71,53.72,23.17,52.35,23.62,50.99,23.56,45.11,23.13,18.96,22.67,-9.46,22.67,29.2,22.67,40.11,22.67,50.31,22.81,54.92,23.22,54.92,23.3,51.76,23.04,45.42,22.41,21.42,21.74,-4.72,22.67,29.2,22.67,40.11,22.67,50.31,22.92,56.12,23.28,57.49,23.02,52.57,22.56,45.63,21.74,23.64,20.89,-0.34,22.67,29.2,22.67,40.14,22.67,50.36,22.96,57.1,23.33,59.6,22.96,53.42,22.45,44.99,21.64,23.53,20.84,0.25,22.67,29.2,22.67,40.35,22.67,50.76,22.84,57.89,23.07,60.81,22.84,54.22,22.67,42.98,22.67,19.61,22.67,-5.34,22.67,29.2,22.67,40.56,22.67,51.17,22.73,58.68,22.82,62.02,22.73,55.01,22.88,40.99,23.7,15.7,24.49,-10.94,22.67,29.2,22.67,40.71,22.67,51.46,22.8,59.12,22.96,62.37,22.8,54.94,22.87,40.61,23.67,15.23,24.45,-11.47,22.67,29.2,22.67,41.11,22.67,52.22,22.95,59.91,23.31,62.4,22.95,54.16,22.78,40.17,23.19,15.03,23.59,-11.49,22.67,29.2,22.67,41.53,22.67,53.04,23.1,60.75,23.66,62.42,23.1,53.34,22.67,39.68,22.67,14.8,22.67,-11.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_04","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-45.72,62.2,-47.59,83.3,-49.32,102.9,-49.72,108.72,-49.26,107.35,-48.8,105.99,-49.82,92.94,-51.91,64.55,-54.74,36.54,-47.11,61.27,-48.38,82.79,-49.48,102.78,-49.62,110.03,-49.21,110.85,-49.13,108.51,-50.25,91.96,-51.65,60.79,-54.11,31.25,-48.39,60.42,-49.09,82.32,-49.63,102.68,-49.51,111.33,-49.15,114.29,-49.42,110.94,-50.67,91.04,-51.4,57.27,-53.53,26.36,-48.85,60.37,-49.24,82.32,-49.65,102.71,-49.47,112.3,-49.1,116.53,-49.48,112.07,-50.82,89.93,-51.37,55.21,-53.19,23.83,-50.22,62.19,-50.01,83.53,-49.81,103.36,-49.58,112.98,-49.36,116.81,-49.59,111.13,-50.49,86.68,-50.46,51.58,-51.06,18.4,-51.6,64.02,-50.78,84.75,-49.97,104,-49.7,113.65,-49.61,117.09,-49.7,110.2,-50.06,82.9,-49.18,46.73,-48.36,11.01,-52.6,63.75,-51.13,84.77,-50.02,104.28,-49.62,114.34,-49.39,116.52,-49.49,107.82,-49.75,79.27,-48.48,41.42,-47.24,3.47,-56.02,62.04,-53.02,84.23,-50.42,104.84,-49.45,114.68,-48.75,112.5,-48.79,99.46,-49.36,70.92,-48.56,32.88,-47.73,-5.4,-59.72,60.18,-55.11,83.63,-50.85,105.42,-49.27,114.95,-48.1,108.08,-48.04,90.47,-48.97,62,-48.75,23.94,-48.38,-14.51]},{"duration":60,"tweenEasing":0,"value":[3.94,62.2,2.07,83.3,0.35,102.9,-0.05,108.72,0.4,107.35,0.86,105.99,0.13,91.95,-0.85,59.62,-2.41,27.21,2.56,61.27,1.29,82.79,0.18,102.78,0.05,110.03,0.45,110.85,0.54,108.51,-0.52,91.49,-1.6,57.9,-3.63,25.62,1.27,60.42,0.58,82.32,0.03,102.68,0.16,111.33,0.52,114.29,0.25,110.94,-1.13,91.01,-2.27,56.24,-4.76,24.15,0.82,60.37,0.43,82.32,0.02,102.71,0.2,112.3,0.57,116.53,0.19,112.07,-1.27,90.17,-2.35,54.92,-4.75,22.74,-0.56,62.19,-0.34,83.53,-0.15,103.36,0.08,112.98,0.31,116.81,0.08,111.13,-0.79,88.76,-0.8,53.96,-1.56,20.57,-1.93,64.02,-1.12,84.75,-0.31,104,-0.03,113.65,0.05,117.09,-0.03,110.2,-0.32,87.61,0.75,53.54,1.64,19.24,-2.94,63.75,-1.46,84.77,-0.35,104.28,0.03,114.16,0.2,117.19,0.04,109.48,-0.23,86.1,0.6,50.45,1.72,14.16,-6.35,62.04,-3.36,84.23,-0.75,104.84,0.19,114.86,0.55,116.35,0.19,107.09,-0.23,83.11,0.01,45.68,0.87,7.78,-10.05,60.18,-5.44,83.63,-1.19,105.42,0.34,115.58,0.9,115.42,0.35,104.51,-0.25,80.02,-0.62,40.9,-0.05,1.49]},{"value":[26.61,62.2,24.74,83.3,23.01,102.9,22.61,108.72,23.07,107.35,23.53,105.99,21.41,83.67,17.71,46.13,13.59,14.54,25.22,61.27,23.96,82.79,22.85,102.78,22.72,110.03,23.12,110.85,23.21,108.51,21.16,85.35,17.88,47.13,13.61,13.72,23.94,60.42,23.24,82.32,22.7,102.68,22.82,111.33,23.19,114.29,22.92,110.94,20.94,86.95,18.07,48.12,13.62,12.97,23.48,60.37,23.1,82.32,22.68,102.71,22.86,112.3,23.23,116.53,22.86,112.07,20.99,87.64,18.32,48.47,14.15,11.74,22.11,62.19,22.32,83.53,22.52,103.36,22.75,112.98,22.98,116.81,22.75,111.13,21.74,86.82,21.17,47.7,19.61,9.4,20.74,64.02,21.55,84.75,22.36,104,22.64,113.65,22.72,117.09,22.64,110.2,22.4,86.16,23.64,47.11,24.51,7.35,19.73,63.75,21.21,84.77,22.31,104.28,22.7,114.16,22.87,117.19,22.7,109.48,22.48,85.27,23.37,46.72,24.28,7.08,16.31,62.04,19.31,84.23,21.92,104.84,22.85,114.86,23.22,116.35,22.86,107.09,22.49,83.33,22.75,46.74,23,9.2,12.61,60.18,17.22,83.63,21.48,105.42,23.01,115.58,23.57,115.42,23.01,104.51,22.48,81.28,22.07,46.8,21.62,11.49]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HOHO.01","timeline":[{"name":"B_HOHO.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HOHO.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HOHO.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HOHO.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_00","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-16.64,18.74,-22.42,18.62,-28.26,18.48,-33.96,18.36,-39.3,18.32,-44.13,18.36,-48.6,18.48,-52.92,18.62,-57.31,18.74,-16.64,18.74,-22.39,18.65,-28.2,18.55,-33.88,18.48,-39.2,18.44,-44.04,18.48,-48.54,18.55,-52.89,18.65,-57.31,18.74,-16.64,18.74,-22.36,18.69,-28.14,18.64,-33.78,18.6,-39.09,18.58,-43.95,18.6,-48.47,18.64,-52.86,18.69,-57.31,18.74,-16.64,18.74,-22.33,18.72,-28.08,18.71,-33.71,18.7,-39,18.7,-43.87,18.7,-48.42,18.71,-52.83,18.72,-57.31,18.74,-16.64,18.74,-22.32,18.74,-28.05,18.74,-33.67,18.74,-38.97,18.74,-43.83,18.74,-48.39,18.74,-52.82,18.74,-57.31,18.74,-16.64,18.74,-22.3,18.74,-28.03,18.74,-33.63,18.74,-38.93,18.74,-43.8,18.74,-48.36,18.74,-52.81,18.74,-57.31,18.74,-16.64,18.74,-22.28,18.74,-27.97,18.74,-33.55,18.74,-38.84,18.74,-43.72,18.74,-48.31,18.74,-52.78,18.74,-57.31,18.74,-16.64,18.74,-22.25,18.74,-27.91,18.74,-33.46,18.74,-38.73,18.74,-43.62,18.74,-48.24,18.74,-52.75,18.74,-57.31,18.74,-16.64,18.74,-22.22,18.74,-27.85,18.74,-33.37,18.74,-38.64,18.74,-43.54,18.74,-48.18,18.74,-52.72,18.74,-57.31,18.74]},{"duration":60,"tweenEasing":0,"value":[-17.51,0,-23.28,-0.13,-29.13,-0.27,-34.83,-0.38,-40.16,-0.43,-44.99,-0.38,-49.46,-0.27,-53.78,-0.13,-58.18,0,-17.51,0,-23.25,-0.09,-29.07,-0.19,-34.74,-0.27,-40.07,-0.3,-44.91,-0.27,-49.4,-0.19,-53.75,-0.09,-58.18,0,-17.51,0,-23.22,-0.05,-29,-0.11,-34.65,-0.14,-39.96,-0.16,-44.81,-0.14,-49.34,-0.11,-53.72,-0.05,-58.18,0,-17.51,0,-23.19,-0.02,-28.95,-0.04,-34.57,-0.04,-39.87,-0.05,-44.74,-0.04,-49.28,-0.04,-53.7,-0.02,-58.18,0,-17.51,0,-23.18,0,-28.92,0,-34.53,0,-39.83,0,-44.7,0,-49.25,0,-53.68,0,-58.18,0,-17.51,0,-23.17,0,-28.89,0,-34.49,0,-39.8,0,-44.66,0,-49.22,0,-53.67,0,-58.18,0,-17.51,0,-23.14,0,-28.84,0,-34.41,0,-39.71,0,-44.58,0,-49.17,0,-53.64,0,-58.18,0,-17.51,0,-23.11,0,-28.77,0,-34.32,0,-39.6,0,-44.49,0,-49.11,0,-53.61,0,-58.18,0,-17.51,0,-23.08,0,-28.71,0,-34.24,0,-39.5,0,-44.4,0,-49.05,0,-53.59,0,-58.18]},{"value":[-15.78,-11.93,-21.55,-12.05,-27.4,-12.19,-33.1,-12.31,-38.44,-12.35,-43.27,-12.31,-47.73,-12.19,-52.05,-12.05,-56.45,-11.93,-15.78,-11.93,-21.52,-12.02,-27.34,-12.12,-33.01,-12.2,-38.34,-12.23,-43.18,-12.2,-47.67,-12.12,-52.03,-12.02,-56.45,-11.93,-15.78,-11.93,-21.49,-11.98,-27.27,-12.03,-32.92,-12.07,-38.23,-12.09,-43.09,-12.07,-47.61,-12.03,-51.99,-11.98,-56.45,-11.93,-15.78,-11.93,-21.47,-11.95,-27.22,-11.96,-32.84,-11.97,-38.14,-11.97,-43.01,-11.97,-47.55,-11.96,-51.97,-11.95,-56.45,-11.93,-15.78,-11.93,-21.45,-11.93,-27.19,-11.93,-32.8,-11.93,-38.1,-11.93,-42.97,-11.93,-47.53,-11.93,-51.96,-11.93,-56.45,-11.93,-15.78,-11.93,-21.44,-11.93,-27.16,-11.93,-32.76,-11.93,-38.07,-11.93,-42.93,-11.93,-47.5,-11.93,-51.94,-11.93,-56.45,-11.93,-15.78,-11.93,-21.41,-11.93,-27.11,-11.93,-32.69,-11.93,-37.98,-11.93,-42.85,-11.93,-47.44,-11.93,-51.92,-11.93,-56.45,-11.93,-15.78,-11.93,-21.38,-11.93,-27.04,-11.93,-32.59,-11.93,-37.87,-11.93,-42.76,-11.93,-47.38,-11.93,-51.89,-11.93,-56.45,-11.93,-15.78,-11.93,-21.36,-11.93,-26.98,-11.93,-32.51,-11.93,-37.77,-11.93,-42.67,-11.93,-47.32,-11.93,-51.86,-11.93,-56.45,-11.93]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_01","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-8.64,20.45,-11.91,20.32,-15.26,20.18,-18.43,20.07,-21.13,20.02,-23.16,20.07,-24.72,20.18,-26.1,20.32,-27.57,20.45,-8.64,20.45,-11.87,20.36,-15.19,20.26,-18.32,20.18,-21,20.15,-23.05,20.18,-24.65,20.26,-26.06,20.36,-27.57,20.45,-8.64,20.45,-11.83,20.39,-15.1,20.34,-18.2,20.3,-20.86,20.29,-22.93,20.3,-24.56,20.34,-26.02,20.39,-27.57,20.45,-8.64,20.45,-11.8,20.42,-15.03,20.41,-18.1,20.4,-20.74,20.4,-22.83,20.4,-24.49,20.41,-25.99,20.42,-27.57,20.45,-8.64,20.45,-11.78,20.45,-14.99,20.45,-18.05,20.45,-20.7,20.45,-22.78,20.45,-24.45,20.45,-25.97,20.45,-27.57,20.45,-8.64,20.45,-11.76,20.45,-14.96,20.45,-18,20.45,-20.65,20.45,-22.73,20.45,-24.42,20.45,-25.95,20.45,-27.57,20.45,-8.64,20.45,-11.73,20.45,-14.89,20.45,-17.9,20.45,-20.53,20.45,-22.63,20.45,-24.35,20.45,-25.92,20.45,-27.57,20.45,-8.64,20.45,-11.69,20.45,-14.8,20.45,-17.77,20.45,-20.39,20.45,-22.5,20.45,-24.26,20.45,-25.88,20.45,-27.57,20.45,-8.64,20.45,-11.65,20.45,-14.72,20.45,-17.66,20.45,-20.26,20.45,-22.39,20.45,-24.18,20.45,-25.84,20.45,-27.57,20.45]},{"duration":60,"tweenEasing":0,"value":[-8.64,0,-11.91,-0.13,-15.26,-0.27,-18.43,-0.38,-21.13,-0.43,-23.16,-0.38,-24.72,-0.27,-26.1,-0.13,-27.57,0,-8.64,0,-11.87,-0.09,-15.19,-0.19,-18.32,-0.27,-21,-0.3,-23.05,-0.27,-24.65,-0.19,-26.06,-0.09,-27.57,0,-8.64,0,-11.83,-0.05,-15.1,-0.11,-18.2,-0.14,-20.86,-0.16,-22.93,-0.14,-24.56,-0.11,-26.02,-0.05,-27.57,0,-8.64,0,-11.8,-0.02,-15.03,-0.04,-18.1,-0.04,-20.74,-0.05,-22.83,-0.04,-24.49,-0.04,-25.99,-0.02,-27.57,0,-8.64,0,-11.78,0,-14.99,0,-18.05,0,-20.7,0,-22.78,0,-24.45,0,-25.97,0,-27.57,0,-8.64,0,-11.76,0,-14.96,0,-18,0,-20.65,0,-22.73,0,-24.42,0,-25.95,0,-27.57,0,-8.64,0,-11.73,0,-14.89,0,-17.9,0,-20.53,0,-22.63,0,-24.35,0,-25.92,0,-27.57,0,-8.64,0,-11.69,0,-14.8,0,-17.77,0,-20.39,0,-22.5,0,-24.26,0,-25.88,0,-27.57,0,-8.64,0,-11.65,0,-14.72,0,-17.66,0,-20.26,0,-22.39,0,-24.18,0,-25.84,0,-27.57]},{"value":[-8.64,-15.34,-11.91,-15.46,-15.26,-15.6,-18.43,-15.71,-21.13,-15.76,-23.16,-15.71,-24.72,-15.6,-26.1,-15.46,-27.57,-15.34,-8.64,-15.34,-11.87,-15.43,-15.19,-15.53,-18.32,-15.6,-21,-15.64,-23.05,-15.6,-24.65,-15.53,-26.06,-15.43,-27.57,-15.34,-8.64,-15.34,-11.83,-15.39,-15.1,-15.44,-18.2,-15.48,-20.86,-15.5,-22.93,-15.48,-24.56,-15.44,-26.02,-15.39,-27.57,-15.34,-8.64,-15.34,-11.8,-15.36,-15.03,-15.37,-18.1,-15.38,-20.74,-15.38,-22.83,-15.38,-24.49,-15.37,-25.99,-15.36,-27.57,-15.34,-8.64,-15.34,-11.78,-15.34,-14.99,-15.34,-18.05,-15.34,-20.7,-15.34,-22.78,-15.34,-24.45,-15.34,-25.97,-15.34,-27.57,-15.34,-8.64,-15.34,-11.76,-15.34,-14.96,-15.34,-18,-15.34,-20.65,-15.34,-22.73,-15.34,-24.42,-15.34,-25.95,-15.34,-27.57,-15.34,-8.64,-15.34,-11.73,-15.34,-14.89,-15.34,-17.9,-15.34,-20.53,-15.34,-22.63,-15.34,-24.35,-15.34,-25.92,-15.34,-27.57,-15.34,-8.64,-15.34,-11.69,-15.34,-14.8,-15.34,-17.77,-15.34,-20.39,-15.34,-22.5,-15.34,-24.26,-15.34,-25.88,-15.34,-27.57,-15.34,-8.64,-15.34,-11.65,-15.34,-14.72,-15.34,-17.66,-15.34,-20.26,-15.34,-22.39,-15.34,-24.18,-15.34,-25.84,-15.34,-27.57,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_02","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_03","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[31.13,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.06,20.48,44.25,20.49,46.43,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.06,20.48,44.25,20.49,46.43,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.06,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.63,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.26,20.49,46.44,20.49,48.63,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.89,20.48,42.07,20.48,44.26,20.49,46.44,20.49,48.63,20.49]},{"duration":60,"tweenEasing":0,"value":[31.13,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.06,0.04,44.25,0.04,46.43,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.06,0.04,44.25,0.04,46.43,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.06,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.63,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.26,0.04,46.44,0.04,48.63,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.89,0.03,42.07,0.04,44.26,0.04,46.44,0.04,48.63,0.04]},{"value":[32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.17,-17.43,43.36,-17.43,45.54,-17.43,47.73,-17.43,49.91,-17.42,32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.17,-17.43,43.36,-17.43,45.54,-17.43,47.73,-17.43,49.92,-17.42,32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.17,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.43,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.74,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.37,-17.43,45.55,-17.43,47.74,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,39,-17.43,41.18,-17.43,43.37,-17.43,45.55,-17.43,47.74,-17.43,49.92,-17.42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_04","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[62.27,20.5,66.64,20.5,71.01,20.51,75.38,20.51,79.75,20.51,84.12,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.27,20.5,66.64,20.5,71.01,20.51,75.38,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.27,20.5,66.64,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.27,20.5,66.65,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.28,20.5,66.65,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.88,20.53,97.25,20.53,62.28,20.5,66.65,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.25,20.53,62.28,20.5,66.65,20.5,71.02,20.51,75.4,20.51,79.77,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.25,20.53,62.28,20.5,66.66,20.5,71.03,20.51,75.4,20.51,79.77,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.25,20.53,62.29,20.5,66.66,20.5,71.03,20.51,75.4,20.51,79.77,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.26,20.53]},{"duration":60,"tweenEasing":0,"value":[62.27,0.05,66.64,0.05,71.01,0.06,75.38,0.06,79.75,0.07,84.12,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.27,0.05,66.64,0.05,71.01,0.06,75.38,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.27,0.05,66.64,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.27,0.05,66.65,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.28,0.05,66.65,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.88,0.08,97.25,0.08,62.28,0.05,66.65,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.25,0.08,62.28,0.05,66.65,0.05,71.02,0.06,75.4,0.06,79.77,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.25,0.08,62.28,0.05,66.66,0.05,71.03,0.06,75.4,0.06,79.77,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.25,0.08,62.29,0.05,66.66,0.05,71.03,0.06,75.4,0.06,79.77,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.26,0.08]},{"value":[64.86,-19.55,69.23,-19.54,73.6,-19.54,77.97,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.83,-19.51,64.86,-19.55,69.23,-19.54,73.6,-19.54,77.98,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.83,-19.51,64.86,-19.55,69.24,-19.54,73.61,-19.54,77.98,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.83,-19.51,64.87,-19.55,69.24,-19.54,73.61,-19.54,77.98,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.84,-19.51,64.87,-19.55,69.24,-19.54,73.61,-19.54,77.98,-19.53,82.35,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.84,-19.51,64.87,-19.55,69.24,-19.54,73.61,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.84,-19.51,64.87,-19.55,69.24,-19.54,73.62,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.84,-19.51,64.88,-19.55,69.25,-19.54,73.62,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.85,-19.51,64.88,-19.55,69.25,-19.54,73.62,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.11,-19.52,95.48,-19.52,99.85,-19.51]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HOHO.02","timeline":[{"name":"B_HOHO.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HOHO.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HOHO.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HOHO.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_00","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-76.73,26.41,-77.96,26.41,-75.93,26.41,-70.97,26.41,-63.4,26.41,-60.9,26.41,-57.48,26.41,-53.68,26.41,-50.06,26.41,-76.14,26.41,-77.15,26.41,-75.13,26.41,-70.39,26.41,-63.25,26.41,-60.77,26.41,-57.39,26.41,-53.63,26.41,-50.06,26.41,-75.48,26.41,-76.28,26.41,-74.29,26.41,-69.79,26.41,-63.08,26.41,-60.63,26.41,-57.29,26.41,-53.59,26.41,-50.06,26.41,-74.96,26.41,-75.53,26.41,-73.53,26.41,-69.24,26.41,-62.95,26.41,-60.52,26.41,-57.21,26.41,-53.55,26.41,-50.06,26.41,-74.74,26.41,-75.03,26.41,-72.98,26.41,-68.85,26.41,-62.9,26.41,-60.46,26.41,-57.16,26.41,-53.53,26.41,-50.06,26.41,-74.63,26.41,-75.48,26.39,-73.64,26.38,-69.35,26.39,-62.84,26.41,-60.4,26.41,-57.12,26.41,-53.51,26.41,-50.06,26.41,-74.36,26.41,-75.79,26.37,-74.18,26.36,-69.76,26.37,-62.71,26.41,-60.28,26.41,-57.04,26.41,-53.47,26.41,-50.06,26.41,-74.04,26.41,-76.04,26.35,-74.67,26.33,-70.12,26.35,-62.55,26.41,-60.14,26.41,-56.94,26.41,-53.42,26.41,-50.06,26.41,-73.74,26.41,-76.32,26.33,-75.19,26.31,-70.5,26.33,-62.4,26.41,-60.02,26.41,-56.85,26.41,-53.38,26.41,-50.06,26.41]},{"duration":60,"tweenEasing":0,"value":[-80.19,0,-81.42,0,-79.39,0,-74.42,0,-66.85,0,-64.36,0,-60.93,0,-57.13,0,-53.52,0,-79.59,0,-80.61,0,-78.59,0,-73.85,0,-66.7,0,-64.23,0,-60.84,0,-57.09,0,-53.52,0,-78.94,0,-79.74,0,-77.74,0,-73.24,0,-66.54,0,-64.09,0,-60.74,0,-57.04,0,-53.52,0,-78.41,0,-78.98,0,-76.99,0,-72.7,0,-66.41,0,-63.97,0,-60.66,0,-57,0,-53.52,0,-78.19,0,-78.49,0,-76.44,0,-72.3,0,-66.35,0,-63.91,0,-60.62,0,-56.98,0,-53.52,0,-78.08,0,-78.94,-0.02,-77.1,-0.03,-72.81,-0.02,-66.3,0,-63.86,0,-60.58,0,-56.96,0,-53.52,0,-77.82,0,-79.24,-0.04,-77.64,-0.05,-73.21,-0.04,-66.17,0,-63.74,0,-60.5,0,-56.93,0,-53.52,0,-77.49,0,-79.49,-0.06,-78.13,-0.08,-73.57,-0.06,-66,0,-63.6,0,-60.4,0,-56.88,0,-53.52,0,-77.2,0,-79.77,-0.08,-78.64,-0.1,-73.96,-0.08,-65.86,0,-63.47,0,-60.31,0,-56.84,0,-53.52]},{"value":[-82.78,-22.15,-84.01,-22.15,-81.98,-22.15,-77.01,-22.15,-69.44,-22.15,-66.95,-22.15,-63.52,-22.15,-59.72,-22.15,-56.11,-22.15,-82.19,-22.15,-83.2,-22.15,-81.18,-22.15,-76.44,-22.15,-69.3,-22.15,-66.82,-22.15,-63.43,-22.15,-59.68,-22.15,-56.11,-22.15,-81.53,-22.15,-82.33,-22.15,-80.33,-22.15,-75.84,-22.15,-69.13,-22.15,-66.68,-22.15,-63.34,-22.15,-59.63,-22.15,-56.11,-22.15,-81,-22.15,-81.57,-22.15,-79.58,-22.15,-75.29,-22.15,-69,-22.15,-66.56,-22.15,-63.25,-22.15,-59.59,-22.15,-56.11,-22.15,-80.79,-22.15,-81.08,-22.15,-79.03,-22.15,-74.9,-22.15,-68.95,-22.15,-66.51,-22.15,-63.21,-22.15,-59.58,-22.15,-56.11,-22.15,-80.68,-22.15,-81.53,-22.17,-79.69,-22.18,-75.4,-22.17,-68.89,-22.15,-66.45,-22.15,-63.17,-22.15,-59.56,-22.15,-56.11,-22.15,-80.41,-22.15,-81.84,-22.19,-80.23,-22.2,-75.8,-22.19,-68.76,-22.15,-66.33,-22.15,-63.09,-22.15,-59.52,-22.15,-56.11,-22.15,-80.09,-22.15,-82.09,-22.21,-80.72,-22.23,-76.17,-22.21,-68.6,-22.15,-66.19,-22.15,-62.99,-22.15,-59.47,-22.15,-56.11,-22.15,-79.79,-22.15,-82.36,-22.23,-81.23,-22.26,-76.55,-22.23,-68.45,-22.15,-66.06,-22.15,-62.9,-22.15,-59.43,-22.15,-56.11,-22.15]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_01","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-38.88,20.45,-41.55,20.45,-41.38,20.45,-38.67,20.45,-33.7,20.45,-33.13,20.45,-31.75,20.45,-30.05,20.45,-28.51,20.45,-38.37,20.45,-40.84,20.45,-40.68,20.45,-38.17,20.45,-33.57,20.45,-33.02,20.45,-31.67,20.45,-30.01,20.45,-28.51,20.45,-37.8,20.45,-40.09,20.45,-39.95,20.45,-37.65,20.45,-33.43,20.45,-32.89,20.45,-31.59,20.45,-29.97,20.45,-28.51,20.45,-37.34,20.45,-39.43,20.45,-39.3,20.45,-37.17,20.45,-33.31,20.45,-32.79,20.45,-31.52,20.45,-29.94,20.45,-28.51,20.45,-37.15,20.45,-39.01,20.45,-38.82,20.45,-36.83,20.45,-33.26,20.45,-32.74,20.45,-31.48,20.45,-29.92,20.45,-28.51,20.45,-37.06,20.45,-39.39,20.43,-39.4,20.42,-37.27,20.43,-33.22,20.45,-32.69,20.45,-31.44,20.45,-29.91,20.45,-28.51,20.45,-36.83,20.45,-39.66,20.41,-39.86,20.39,-37.62,20.41,-33.1,20.45,-32.59,20.45,-31.37,20.45,-29.87,20.45,-28.51,20.45,-36.54,20.45,-39.88,20.39,-40.29,20.37,-37.93,20.39,-32.96,20.45,-32.47,20.45,-31.29,20.45,-29.83,20.45,-28.51,20.45,-36.29,20.45,-40.12,20.37,-40.73,20.34,-38.26,20.37,-32.83,20.45,-32.36,20.45,-31.21,20.45,-29.79,20.45,-28.51,20.45]},{"duration":60,"tweenEasing":0,"value":[-38.88,0,-41.55,0,-41.38,0,-38.67,0,-33.7,0,-33.13,0,-31.75,0,-30.05,0,-28.51,0,-38.37,0,-40.84,0,-40.68,0,-38.17,0,-33.57,0,-33.02,0,-31.67,0,-30.01,0,-28.51,0,-37.8,0,-40.09,0,-39.95,0,-37.65,0,-33.43,0,-32.89,0,-31.59,0,-29.97,0,-28.51,0,-37.34,0,-39.43,0,-39.3,0,-37.17,0,-33.31,0,-32.79,0,-31.52,0,-29.94,0,-28.51,0,-37.15,0,-39.01,0,-38.82,0,-36.83,0,-33.26,0,-32.74,0,-31.48,0,-29.92,0,-28.51,0,-37.06,0,-39.39,-0.02,-39.4,-0.03,-37.27,-0.02,-33.22,0,-32.69,0,-31.44,0,-29.91,0,-28.51,0,-36.83,0,-39.66,-0.04,-39.86,-0.05,-37.62,-0.04,-33.1,0,-32.59,0,-31.37,0,-29.87,0,-28.51,0,-36.54,0,-39.88,-0.06,-40.29,-0.08,-37.93,-0.06,-32.96,0,-32.47,0,-31.29,0,-29.83,0,-28.51,0,-36.29,0,-40.12,-0.08,-40.73,-0.1,-38.26,-0.08,-32.83,0,-32.36,0,-31.21,0,-29.79,0,-28.51]},{"value":[-40.61,-16.19,-43.27,-16.19,-43.11,-16.19,-40.4,-16.19,-35.42,-16.19,-34.86,-16.19,-33.48,-16.19,-31.78,-16.19,-30.24,-16.19,-40.09,-16.19,-42.57,-16.19,-42.41,-16.19,-39.9,-16.19,-35.3,-16.19,-34.74,-16.19,-33.4,-16.19,-31.74,-16.19,-30.24,-16.19,-39.53,-16.19,-41.82,-16.19,-41.68,-16.19,-39.37,-16.19,-35.15,-16.19,-34.62,-16.19,-33.32,-16.19,-31.7,-16.19,-30.24,-16.19,-39.07,-16.19,-41.16,-16.19,-41.02,-16.19,-38.9,-16.19,-35.04,-16.19,-34.52,-16.19,-33.25,-16.19,-31.67,-16.19,-30.24,-16.19,-38.88,-16.19,-40.73,-16.19,-40.55,-16.19,-38.56,-16.19,-34.99,-16.19,-34.47,-16.19,-33.21,-16.19,-31.65,-16.19,-30.24,-16.19,-38.78,-16.19,-41.12,-16.21,-41.12,-16.21,-39,-16.21,-34.94,-16.19,-34.42,-16.19,-33.17,-16.19,-31.63,-16.19,-30.24,-16.19,-38.56,-16.19,-41.39,-16.23,-41.59,-16.24,-39.35,-16.23,-34.83,-16.19,-34.32,-16.19,-33.1,-16.19,-31.6,-16.19,-30.24,-16.19,-38.27,-16.19,-41.6,-16.25,-42.02,-16.27,-39.66,-16.25,-34.69,-16.19,-34.2,-16.19,-33.02,-16.19,-31.56,-16.19,-30.24,-16.19,-38.02,-16.19,-41.84,-16.27,-42.46,-16.29,-39.99,-16.27,-34.56,-16.19,-34.09,-16.19,-32.94,-16.19,-31.52,-16.19,-30.24,-16.19]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_02","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_03","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45]},{"duration":60,"tweenEasing":0,"value":[45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91]},{"value":[45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_04","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[87.4,20.52,81.1,20.52,74.81,20.51,68.51,20.51,62.21,20.5,55.91,20.5,49.61,20.5,43.31,20.49,37.01,20.49,87.4,20.52,81.1,20.52,74.8,20.51,68.5,20.51,62.2,20.5,55.9,20.5,49.61,20.5,43.31,20.49,37.01,20.49,87.39,20.52,81.09,20.52,74.8,20.51,68.5,20.51,62.2,20.5,55.9,20.5,49.6,20.5,43.3,20.49,37,20.49,87.39,20.52,81.09,20.52,74.79,20.51,68.49,20.51,62.19,20.5,55.9,20.5,49.6,20.5,43.3,20.49,37,20.49,87.38,20.52,81.08,20.52,74.79,20.51,68.49,20.51,62.19,20.5,55.89,20.5,49.59,20.5,43.29,20.49,36.99,20.49,87.38,20.52,81.08,20.52,74.78,20.51,68.48,20.51,62.18,20.5,55.89,20.5,49.59,20.5,43.29,20.49,36.99,20.49,87.37,20.52,81.07,20.52,74.78,20.51,68.48,20.51,62.18,20.5,55.88,20.5,49.58,20.5,43.28,20.49,36.98,20.49,87.37,20.52,81.07,20.52,74.77,20.51,68.47,20.51,62.17,20.5,55.88,20.5,49.58,20.5,43.28,20.49,36.98,20.49,87.36,20.52,81.06,20.52,74.77,20.51,68.47,20.51,62.17,20.5,55.87,20.5,49.57,20.5,43.27,20.49,36.97,20.49]},{"duration":60,"tweenEasing":0,"value":[87.4,0.07,81.1,0.07,74.81,0.07,68.51,0.06,62.21,0.06,55.91,0.05,49.61,0.05,43.31,0.05,37.01,0.04,87.4,0.07,81.1,0.07,74.8,0.07,68.5,0.06,62.2,0.06,55.9,0.05,49.61,0.05,43.31,0.05,37.01,0.04,87.39,0.07,81.09,0.07,74.8,0.07,68.5,0.06,62.2,0.06,55.9,0.05,49.6,0.05,43.3,0.05,37,0.04,87.39,0.07,81.09,0.07,74.79,0.07,68.49,0.06,62.19,0.06,55.9,0.05,49.6,0.05,43.3,0.05,37,0.04,87.38,0.07,81.08,0.07,74.79,0.07,68.49,0.06,62.19,0.06,55.89,0.05,49.59,0.05,43.29,0.05,36.99,0.04,87.38,0.07,81.08,0.07,74.78,0.07,68.48,0.06,62.18,0.06,55.89,0.05,49.59,0.05,43.29,0.05,36.99,0.04,87.37,0.07,81.07,0.07,74.78,0.07,68.48,0.06,62.18,0.06,55.88,0.05,49.58,0.05,43.28,0.05,36.98,0.04,87.37,0.07,81.07,0.07,74.77,0.07,68.47,0.06,62.17,0.06,55.88,0.05,49.58,0.05,43.28,0.05,36.98,0.04,87.36,0.07,81.06,0.07,74.77,0.07,68.47,0.06,62.17,0.06,55.87,0.05,49.57,0.05,43.27,0.05,36.97,0.04]},{"value":[87.4,-15.26,81.1,-15.27,74.81,-15.27,68.51,-15.27,62.21,-15.28,55.91,-15.28,49.61,-15.29,43.31,-15.29,37.01,-15.29,87.4,-15.26,81.1,-15.27,74.8,-15.27,68.5,-15.27,62.2,-15.28,55.9,-15.28,49.61,-15.29,43.31,-15.29,37.01,-15.29,87.39,-15.26,81.09,-15.27,74.8,-15.27,68.5,-15.27,62.2,-15.28,55.9,-15.28,49.6,-15.29,43.3,-15.29,37,-15.29,87.39,-15.26,81.09,-15.27,74.79,-15.27,68.49,-15.27,62.19,-15.28,55.9,-15.28,49.6,-15.29,43.3,-15.29,37,-15.29,87.38,-15.26,81.08,-15.27,74.79,-15.27,68.49,-15.27,62.19,-15.28,55.89,-15.28,49.59,-15.29,43.29,-15.29,36.99,-15.29,87.38,-15.26,81.08,-15.27,74.78,-15.27,68.48,-15.27,62.18,-15.28,55.89,-15.28,49.59,-15.29,43.29,-15.29,36.99,-15.29,87.37,-15.26,81.07,-15.27,74.78,-15.27,68.48,-15.27,62.18,-15.28,55.88,-15.28,49.58,-15.29,43.28,-15.29,36.98,-15.29,87.37,-15.26,81.07,-15.27,74.77,-15.27,68.47,-15.27,62.17,-15.28,55.88,-15.28,49.58,-15.29,43.28,-15.29,36.98,-15.29,87.36,-15.26,81.06,-15.27,74.77,-15.27,68.47,-15.27,62.17,-15.28,55.87,-15.28,49.57,-15.29,43.27,-15.29,36.97,-15.29]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_FACE.00","timeline":[{"name":"D_FACE.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_FACE.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_FACE.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_FACE.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_FACE.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_00","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-37.79,11.49,-49.02,8.09,-45.63,-0.43,-33.57,-0.96,-32.16,-2.97,-32.56,14.29,-42.99,9.8,-49.39,14.46,-49.06,10.51,-33.29,10.49,-35.29,9.83,-45.96,-20.14,-40.83,5.56,-37.82,11.51,-46.5,16.01,-47.35,14.9,-39.71,14.03,-31.08,2.68,-26.76,11.33,-34.76,17.96,-35.84,22.1,-36.69,5.56,-37.42,11.02,-28.89,6.96,-52.87,30.47,-37.48,16.93,-37.79,10.39,-37.79,11.5,-37.49,11.69,-37.28,11.28,-37.83,11.52,-37.8,11.5,-41.32,5.94,-38.49,9.07,-37.03,4.81,-42.91,11.18,-34.6,12.94,-30.49,11.4,-32.93,8.34,-37.95,10.19,-38.47,11.26,-40.75,12.47,-44.87,13.05,-49.22,14.16,-46.62,13.33,-46.11,13.22,-50.83,13.73,-44.84,14.96,-42.22,16.78,-41.48,4.2,-39.44,5.74,-38.4,-1.07,-33.88,9.33,-33.46,12.41,-35.42,11.2,-41.15,12.12,-41.1,14.51,-44.39,14.09,-29.77,7.35,-31.31,16.08,-35.52,13.64,-37.48,15.87,-43.92,16.07,-33.41,13.07,-47.03,15.94,-34.31,7.75,-34.1,12.56,-34.33,12.5,-37.28,7,-44.42,5.01,-38.93,7.89,-33.61,11.67,-41.84,6.44,-36.18,9.61,-34.95,11.09,-44.41,15.41,-48.45,14.71,-51.41,15.27,-46.2,15.87,-43.72,15.27,-40.94,15.6,-33.8,14.33,-47.47,0.8]},{"duration":60,"tweenEasing":0,"value":[-37.78,-0.01,-49.04,-3.41,-45.58,-11.93,-35.41,-11.92,-35.46,-5.14,-31.39,-4.33,-33.67,-5.39,-38.65,1.28,-54.46,-1.35,-37.79,-2.54,-32.45,-6.81,-37.75,-24.87,-33.92,-3.81,-37.83,0.01,-50.32,0.12,-39.53,0.87,-37.97,0.78,-33.27,-2.16,-27.03,0.17,-43.98,-3.87,-39.67,0.08,-33.16,-5.11,-37.36,-0.47,-29.15,-4.69,-54.25,5.86,-37.95,3.8,-37.87,0.24,-37.8,0,-37.8,-0.05,-37.2,-0.1,-37.85,0.02,-37.8,0,-41.26,-5.54,-40.58,-8.88,-40.3,-9.62,-46.09,-1.27,-44.06,-0.56,-36.85,-4.16,-38.3,-7.09,-41.62,-3.51,-41.8,-1.94,-44.83,-0.29,-36.81,-3.66,-41.66,0.78,-43.55,-2.39,-49.09,1.29,-47.69,-0.01,-37.98,2.52,-47.32,0.24,-39.51,-8.96,-39.38,-8.63,-32.42,-8.34,-31.97,-6.21,-33.99,-5.7,-34.85,-4.09,-35.43,-2.74,-34.37,-1.6,-35.45,-4.69,-30.06,-2.32,-32.04,0.66,-32.61,-1.06,-32.9,-0.51,-36.43,-1.58,-32.31,-0.84,-37.34,1.27,-32.14,-7.04,-32.61,-5.9,-33.15,-4.19,-35.69,-5.99,-41.78,-8.23,-42.04,-7.72,-39.92,-4.36,-41.85,-8.48,-41.27,-6.66,-39.72,-3.19,-34.44,-1.03,-40.7,-0.02,-45.64,1.08,-39.52,0.64,-34.41,-1.69,-35.18,-0.9,-31.23,-2.23,-44.36,-10.89]},{"value":[-37.78,-7.46,-49.04,-10.87,-45.58,-19.39,-35.48,-19.39,-35.32,-12.62,-27.05,-18.49,-33.81,-15.51,-39.05,-9.66,-50.9,-13.28,-38.92,-13.21,-32.75,-17.07,-37.8,-32.25,-33.91,-11.27,-37.83,-7.45,-49.78,-7.31,-40.05,-8.97,-37.82,-7.76,-32.68,-15.95,-26.94,-7.12,-45.83,-13.64,-39.89,-9.92,-33.21,-12.84,-37.4,-7.82,-29.21,-12.13,-53.22,-2.19,-38.2,-5.29,-37.69,-7.16,-37.8,-7.46,-37.85,-7.32,-37.28,-7.5,-37.85,-7.44,-37.8,-7.46,-41.25,-13,-41.63,-19.27,-44.66,-24.18,-45.82,-13.44,-43.07,-10.8,-39.08,-15.49,-41.75,-18.75,-43.76,-14.86,-42.65,-13.45,-46.16,-13.11,-30.33,-18.89,-43.41,-7.26,-38.14,-16.35,-48.7,-8.72,-38.66,-14.34,-48.51,-7.87,-47.22,-8.12,-40.58,-19.87,-43.68,-22.15,-33.41,-16.21,-32.04,-15.4,-34.9,-15.83,-36.35,-14.85,-31.68,-17.48,-33.81,-12.17,-30.68,-19.66,-28.23,-12.82,-28.11,-14.78,-30.35,-11.26,-29.07,-14.31,-31.69,-16.34,-28.87,-15.47,-37.63,-8.39,-33.81,-15.61,-34.34,-16.2,-34.74,-14.1,-38.04,-16.97,-45.06,-18.91,-45.64,-19.44,-41.49,-14.5,-45.38,-19.92,-43.48,-16.83,-40.93,-13.86,-33.06,-11.77,-37.2,-10.84,-40.8,-11.67,-35.67,-10.71,-30.15,-14.86,-30.6,-15.59,-27.41,-16.56,-48.86,-22.21]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_01","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-18.9,11.5,-24.5,9.8,-22.84,5.54,-15.87,5,-14.43,-0.4,-16.87,16.45,-26.15,12.5,-30.06,13.82,-27.01,11.19,-14.39,11.76,-17.12,16.43,-25.36,-9.41,-23.87,7.46,-18.91,11.51,-25.23,11.69,-27.58,14.47,-20.73,13.64,-14.45,3.76,-13.24,11.25,-17.96,11.38,-18.17,14.82,-18.39,8.12,-18.74,11.25,-14.31,9.31,-31.79,17.74,-18.5,15.03,-18.86,10.27,-18.89,11.5,-18.59,11.71,-18.68,11.33,-18.9,11.5,-18.9,11.5,-20.69,8.72,-17.34,10.53,-19.9,4.94,-19.87,11.82,-14.3,12.79,-14.65,10.92,-18.1,6.78,-20.17,10.24,-18.43,11.38,-20.06,12.19,-27.32,13.18,-28.39,13.77,-27.87,12.39,-25.03,12.15,-28.71,12.89,-25.85,13.7,-19.86,12.83,-21.29,12.94,-22.34,6.64,-24.14,-4.36,-18.98,8.39,-15.16,14.62,-17.13,15.8,-23.44,13.5,-23.91,15.31,-27.1,13.45,-14.74,8.51,-15.3,15.75,-19.22,14.17,-21.03,16.12,-26.57,14.73,-17.26,13.49,-28.36,15.31,-21.48,7.44,-18.66,12.31,-16.89,16.3,-18.14,12.12,-24.4,8.28,-20.5,9.2,-15.38,12.58,-21.78,8.55,-18.14,10.81,-16.82,11.41,-27.19,15.5,-29.83,14.72,-30.32,14.3,-27.73,15.13,-26.51,15.26,-23.78,16.05,-18.18,15.44,-27.02,5.82]},{"duration":60,"tweenEasing":0,"value":[-18.89,0,-24.52,-1.71,-22.79,-5.97,-17.71,-5.96,-17.73,-2.57,-15.69,-2.16,-16.84,-2.7,-19.33,0.64,-27.23,-0.67,-18.89,-1.27,-16.23,-3.41,-18.88,-12.43,-16.96,-1.9,-18.91,0,-25.16,0.06,-19.77,0.43,-18.99,0.39,-16.63,-1.08,-13.52,0.08,-21.99,-1.94,-19.83,0.04,-16.58,-2.56,-18.68,-0.23,-14.58,-2.35,-27.13,2.93,-18.98,1.9,-18.94,0.12,-18.9,0,-18.9,-0.03,-18.6,-0.05,-18.93,0.01,-18.9,0,-20.63,-2.77,-20.29,-4.44,-20.15,-4.81,-23.04,-0.63,-22.03,-0.28,-18.42,-2.08,-19.15,-3.55,-20.81,-1.75,-20.9,-0.97,-22.42,-0.15,-18.41,-1.83,-20.83,0.39,-21.77,-1.2,-24.54,0.64,-23.85,0,-18.99,1.26,-23.66,0.12,-19.75,-4.48,-19.69,-4.31,-16.21,-4.17,-15.99,-3.11,-17,-2.85,-17.43,-2.05,-17.71,-1.37,-17.18,-0.8,-17.72,-2.35,-15.03,-1.16,-16.02,0.33,-16.3,-0.53,-16.45,-0.25,-18.22,-0.79,-16.16,-0.42,-18.67,0.64,-16.07,-3.52,-16.31,-2.95,-16.57,-2.1,-17.85,-2.99,-20.89,-4.12,-21.02,-3.86,-19.96,-2.18,-20.92,-4.24,-20.64,-3.33,-19.86,-1.59,-17.22,-0.51,-20.35,-0.01,-22.82,0.54,-19.76,0.32,-17.21,-0.85,-17.59,-0.45,-15.61,-1.11,-22.18,-5.45]},{"value":[-18.89,-7.46,-24.52,-9.16,-22.79,-13.42,-17.77,-13.43,-17.59,-10.05,-11.36,-16.33,-16.97,-12.81,-19.72,-10.3,-27.12,-11.97,-20.02,-11.93,-16.52,-13.66,-18.92,-19.81,-16.95,-9.37,-18.92,-7.45,-24.62,-7.37,-20.28,-9.41,-18.84,-8.15,-16.05,-14.86,-13.42,-7.21,-23.85,-11.7,-20.06,-9.96,-16.63,-10.28,-18.72,-7.58,-14.64,-9.78,-26.09,-5.12,-19.22,-7.2,-18.76,-7.28,-18.9,-7.46,-18.95,-7.29,-18.68,-7.45,-18.92,-7.45,-18.9,-7.46,-20.62,-10.22,-21.34,-14.83,-24.51,-19.36,-22.78,-12.81,-22.34,-9.89,-20.66,-13.41,-21.96,-16.17,-22.95,-13.11,-22.08,-12.8,-27.96,-12.96,-11.92,-17.92,-22.57,-7.65,-16.8,-16.43,-24.16,-9.37,-14.39,-14.76,-15.26,-8.27,-23.56,-8.24,-20.83,-15.39,-23.99,-17.83,-17.2,-12.04,-16.05,-12.29,-17.9,-12.98,-18.6,-11.84,-13.97,-16.11,-16.63,-11.37,-12.96,-17.31,-13.2,-11.66,-12.1,-15.11,-14.05,-10.72,-12.61,-14.06,-13.47,-15.55,-12.71,-15.05,-18.96,-9.03,-17.74,-12.09,-18.04,-13.25,-17.19,-11.36,-19.55,-14.29,-24.17,-14.79,-24.63,-15.58,-21.53,-12.32,-24.46,-15.69,-22.52,-14.14,-21.07,-12.26,-15.84,-11.26,-17.71,-11.26,-19.28,-11.79,-16.34,-11.03,-12.95,-14.02,-13.01,-15.14,-11.8,-15.45,-26.68,-16.76]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_02","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.01,11.5,0.02,11.5,-0.05,11.5,1.84,10.96,3.3,2.17,-1.17,18.62,-9.32,15.19,-10.74,13.17,0.22,11.86,4.5,13.03,-2.84,16.64,-6.48,3.02,-6.91,9.37,0.01,11.5,-0.07,11.63,-7.82,14.04,-1.74,13.26,2.19,4.84,0.28,11.16,4.03,13.31,1.66,14.78,-1.81,10.68,-0.05,11.49,0.26,11.65,-4.67,14.81,0.47,13.12,0.08,10.15,0.01,11.5,0.31,11.74,-0.08,11.38,0.02,11.49,0.01,11.5,-0.06,11.49,2.95,14.97,0.25,9.75,3.17,12.45,7.72,13.07,3.77,13,1.05,10.32,0.65,11.99,2.47,12.35,2.36,12.33,-8.92,15.01,-7.56,13.38,-6.1,13.59,-0.48,11.51,-4.87,12.89,-6.86,12.44,3.8,12.71,-1.54,17.42,-2.65,10.96,-7.93,-0.19,-4.93,4.47,0.53,14.28,-1,15.29,-5.72,14.87,-6.73,16.11,-9.38,15.8,0.29,9.67,0.72,15.42,-2.91,14.71,-4.58,16.37,-8.35,15.52,-1.1,13.91,-9.69,14.67,-7.35,4.57,-6.25,6.95,-1.61,15.85,-0.29,15.12,-3.51,12.39,0.52,13.06,4.58,14.76,-0.86,12.79,2.5,14.13,3.04,13,-9.97,16.02,-9.48,14.73,-7.49,13.76,-7.97,14.81,-9.31,16.11,-6.19,16.5,-2.57,16.55,-4.84,11.26]},{"duration":60,"tweenEasing":0,"offset":165},{"offset":1,"value":[-7.45,0,-7.45,0,-7.46,-0.06,-7.47,0.14,-7.48,4.33,-14.16,-0.13,-10.12,-0.4,-10.94,0.11,-11.3,-1.13,-10.66,-0.3,-10.25,-0.05,-7.38,0.01,-7.46,0,-7.45,0.54,-7.43,-0.51,-9.84,0.15,-8.54,0.58,-13.78,0.1,-7.29,-1.86,-9.77,-0.22,-10,-0.06,-7.73,-0.04,-7.35,-0.06,-7.44,1.04,-8.05,-0.25,-9.1,0.18,-7.4,0,-7.46,-0.05,-7.26,-0.07,-7.39,0.01,-7.46,0,-7.46,0.01,-7.45,-1.05,-10.39,-4.36,-14.55,0.26,-12.17,-0.31,-9.61,-2.23,-11.33,-2.81,-12.62,-2.14,-11.36,-1.18,-11.83,-5.54,-12.82,6.49,-16.09,-1.74,-8.04,4.97,-15.23,0.39,-10.01,9.46,-14.76,3.72,-9.53,0.1,-8.36,-1.08,-10.91,-4.3,-13.52,-1,-7.87,-0.07,-9.18,-0.91,-10.13,-1.17,-9.8,3.74,-14.74,0.56,-10.58,4.76,-14.96,1.83,-10.5,3.92,-15.44,2.25,-10.19,3.84,-13.81,4.75,-14.76,3.45,-14.63,-0.29,-9.67,-1.67,-8.57,-1.73,-10.31,-0.62,-9.27,-1.7,-11.3,-3.28,-10.68,-3.61,-11.72,-1.57,-10.14,-3.53,-11.45,-1.88,-10.81,-1.21,-10.67,1.38,-10.75,2.64,-11.25,3.54,-12.33,3.42,-11.34,4.26,-13.17,4.58,-14.69,3.82,-14.33,-4.5,-11.32]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_03","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[23.32,11.43,22.98,11.55,16.18,12.07,19.83,9.35,25.73,-17.73,21.67,14.78,15.22,10.73,12.61,11.5,25.52,11.21,29.03,12.43,18.92,17.15,13.47,-0.22,19.93,5.74,26.89,9.55,28.82,14.08,14.33,13.2,17.24,12.31,21.68,2.5,25.18,6.72,26.45,13.26,24.49,14.98,20.86,9.96,25.52,9.32,27.64,8.52,22.39,14.28,24.21,14.22,26.79,5.48,23.24,11.43,29.6,11.19,25.6,9.9,26.47,9.82,23.12,11.45,24.28,13.03,24.78,14.81,23.74,8.94,34.71,14.14,39.84,14.42,30.47,13.65,24.69,9.5,30.14,13.53,35.15,14.21,32.16,12.84,16.91,12,19.76,12.97,21.68,10.89,27.74,11.28,22.16,11.8,19.6,11.61,26.75,12.68,21.47,20.2,21.12,11.2,12.25,-1.23,15.83,3.81,22.33,14.17,21.52,17.06,18.27,12.34,16.31,13.42,15.58,13.53,21.5,7.73,21,15.27,19.96,14.63,17.64,15.33,15.36,13.13,20.72,11.61,13.31,13.19,13.27,3.57,14.7,7.12,20.18,17.47,23.27,16.41,19.97,12.09,24.26,12.7,31.02,16.18,22.73,12.44,25.94,13.79,31.45,14.87,14.22,13.33,14.39,13.12,17.2,12.53,16.04,12.6,15.02,13.15,16.75,13.79,19.68,14.67,18.21,11.05]},{"duration":60,"tweenEasing":0,"value":[23.33,-0.08,22.96,0.04,16.23,0.57,17.99,-1.61,22.43,-19.9,22.84,-3.84,24.53,-4.46,23.35,-1.67,27.73,-0.97,24.53,-0.6,21.77,0.51,19.95,-3.24,26.84,-3.63,26.88,-1.95,28.89,2.45,22.15,-0.84,18.98,-0.94,19.5,-2.34,24.9,-4.44,22.42,-0.05,22.83,0.2,22.67,-0.72,25.58,-2.17,27.38,-3.14,27.06,-0.53,23.74,1.1,26.72,-4.67,23.23,-0.07,29.29,-0.55,25.67,-1.49,26.45,-1.68,23.11,-0.06,24.34,1.54,21.83,-0.16,23.49,-0.81,31.54,1.69,32.11,1.35,26.7,0.65,23.65,-0.83,29.49,1.54,32.68,1.86,31.58,0.98,23.4,-2.21,27.32,-0.4,25.83,-2.06,28.55,-0.23,25.57,-0.77,26.46,-0.83,22.94,-0.03,23.01,2.78,23.77,0.24,20.18,-1.04,20.76,-0.66,21.79,-0.11,22.52,1.76,23.99,-2.53,23.04,-2.69,25.28,-3.39,21.22,-1.94,20.28,-0.15,22.87,-0.07,22.22,-1.05,23.38,-2.71,21.82,-2.3,23,-1.48,20.63,-0.99,20.95,0.17,21.79,1.63,23.56,1.3,23.48,-0.3,23.74,-0.36,26.44,1.42,23.59,-0.34,23.44,-0.34,28.41,1.87,23.05,-2.05,21.44,-0.49,22.59,-0.6,23.2,-1.73,24.33,-3.44,23.27,-2.07,22.25,-1.88,23.05,-0.21]},{"value":[23.33,-7.53,22.96,-7.41,16.23,-6.89,14.36,-14.83,20.63,-28.34,27.18,-18,24.4,-14.58,22.95,-12.61,27.84,-12.27,23.4,-11.27,21.47,-9.74,19.9,-10.62,26.85,-11.09,26.88,-9.41,29.43,-4.98,21.64,-10.68,19.13,-9.48,20.08,-16.13,25,-11.73,20.56,-9.82,22.61,-9.8,22.61,-8.45,25.54,-9.52,27.32,-10.57,28.09,-8.58,23.49,-8,26.89,-12.08,23.23,-7.53,29.24,-7.82,25.6,-8.88,26.45,-9.14,23.11,-7.51,24.35,-5.91,20.78,-10.55,19.13,-15.37,31.8,-10.48,31.8,-8.25,24.47,-10.69,20.84,-13.45,27.36,-9.82,31.5,-9.96,26.04,-11.84,29.88,-18.3,25.58,-8.45,28.54,-15.85,28.94,-10.24,32.28,-14.56,30.18,-10.36,23.04,-8.39,21.94,-8.12,19.48,-13.28,19.19,-8.91,20.7,-9.84,20.89,-10.24,21.35,-8.04,27.74,-17.27,23.59,-13.27,30.05,-18.35,22.72,-13.72,22.9,-16.54,25.13,-10.27,26.06,-14.85,27.81,-16.84,24.4,-16.08,22.71,-11.14,18.96,-9.56,19.21,-10.13,21.18,-7.64,21.86,-10,20.2,-10.98,20.13,-12.09,24.87,-8.72,20.05,-11.79,21.56,-11.16,27.2,-8.8,25.89,-13.76,24.57,-12.21,26.78,-13.25,26.62,-13.08,29.24,-17.09,27.85,-16.77,25.64,-16.01,18.55,-11.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_04","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[46.65,11.35,45.93,11.59,32.41,12.64,37.82,7.73,48.16,-37.63,44.51,10.94,39.75,6.27,35.96,9.83,50.83,10.56,53.56,11.83,40.69,17.66,33.42,-3.46,46.76,2.11,53.76,7.59,57.7,16.53,36.48,12.36,36.22,11.37,41.18,0.15,50.08,2.28,48.88,13.2,47.33,15.19,43.52,9.24,51.1,7.15,55.02,5.38,49.45,13.75,47.96,15.32,53.51,0.81,46.47,11.36,58.89,10.63,51.27,8.41,52.92,8.14,46.22,11.39,48.62,14.57,45.74,15.92,45.93,9.83,66.25,15.83,67.19,15.77,56.75,14.29,49.64,10.8,58.77,15.5,65.67,16.07,61.96,13.34,42.74,8.99,47.08,12.57,49.45,8.2,55.97,11.04,49.2,10.72,46.05,10.78,49.69,12.65,44.49,22.99,44.03,12.29,32.44,-2.27,36.59,3.15,44.12,14.06,44.04,18.82,42.27,9.81,39.34,10.72,40.54,11.27,42.72,5.79,41.28,15.13,42.83,14.56,39.85,14.28,39.06,10.73,42.54,9.31,36.32,11.72,33.9,2.58,35.65,7.29,41.98,19.1,46.83,17.71,43.45,11.79,47.13,12.76,57.03,18.02,46.32,12.1,48.95,14.3,58.99,17.16,38.4,10.63,38.27,11.52,41.89,11.3,40.05,10.38,39.35,10.19,39.7,11.07,41.94,12.79,41.25,10.84]},{"duration":60,"tweenEasing":0,"value":[46.65,-0.15,45.91,0.08,32.46,1.13,35.98,-3.23,44.86,-39.8,45.68,-7.68,49.06,-8.92,46.7,-3.34,55.47,-1.94,49.06,-1.21,43.53,1.02,39.91,-6.49,53.67,-7.26,53.75,-3.91,57.78,4.91,44.29,-1.68,37.96,-1.89,39,-4.69,49.8,-8.88,44.84,-0.11,45.66,0.41,45.33,-1.44,51.15,-4.33,54.75,-6.28,54.11,-1.06,47.48,2.2,53.43,-9.35,46.47,-0.14,58.58,-1.11,51.35,-2.97,52.9,-3.35,46.22,-0.11,48.68,3.08,43.65,-0.33,46.98,-1.63,63.08,3.38,64.22,2.7,53.41,1.29,47.29,-1.65,58.99,3.08,65.36,3.73,63.17,1.97,46.8,-4.42,54.64,-0.81,51.66,-4.11,57.1,-0.46,51.15,-1.53,52.92,-1.66,45.88,-0.06,46.02,5.57,47.55,0.48,40.37,-2.08,41.53,-1.32,43.58,-0.22,45.05,3.53,47.99,-5.06,46.08,-5.38,50.56,-6.77,42.43,-3.88,40.55,-0.3,45.74,-0.15,44.44,-2.09,46.77,-5.43,43.64,-4.6,46.01,-2.95,41.25,-1.98,41.89,0.34,43.59,3.26,47.12,2.59,46.96,-0.6,47.48,-0.72,52.87,2.84,47.18,-0.68,46.88,-0.69,56.82,3.73,46.1,-4.1,42.88,-0.97,45.18,-1.19,46.4,-3.47,48.66,-6.87,46.54,-4.15,44.51,-3.77,46.09,-0.43]},{"value":[46.65,-7.61,45.91,-7.37,32.46,-6.33,28.79,-22.2,41.11,-49.2,50.02,-21.84,48.93,-19.04,46.3,-14.29,55.57,-13.24,47.93,-11.87,43.24,-9.23,39.86,-13.86,53.69,-14.72,53.75,-11.36,58.32,-2.53,43.78,-11.52,38.11,-10.43,39.58,-18.47,49.9,-16.17,42.99,-9.88,45.44,-9.59,45.27,-9.17,51.11,-11.69,54.69,-13.71,55.15,-9.11,47.24,-6.9,53.61,-16.75,46.47,-7.6,58.53,-8.37,51.27,-10.37,52.9,-10.81,46.22,-7.57,48.69,-4.37,42.6,-10.72,42.62,-16.18,63.34,-8.79,63.91,-6.9,51.17,-10.04,44.49,-14.28,56.85,-8.28,64.18,-8.1,57.63,-10.85,53.28,-20.51,52.9,-8.85,52.1,-16.47,57.49,-10.47,55.1,-14.37,56.64,-11.19,45.98,-8.42,44.95,-5.34,43.25,-13.04,39.37,-9.95,41.46,-10.51,42.68,-10.35,43.87,-6.27,51.73,-19.79,46.63,-15.96,55.33,-21.73,43.61,-16.93,41.88,-17.65,48,-10.34,48.27,-15.9,50.87,-18.91,45.36,-17.53,45.72,-12.62,39.58,-10.55,40.16,-9.96,42.97,-6.01,45.42,-8.71,43.67,-11.28,43.87,-12.45,51.31,-7.3,43.64,-12.13,45,-11.5,55.6,-6.93,50.4,-16.77,46.5,-13.18,50.02,-14.16,49.82,-14.81,54.22,-21,51.12,-18.84,47.46,-17.68,41.59,-11.74]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE.02","timeline":[{"name":"B_EYE.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EYE.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EYE.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_00","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-52.74,-61.09,-47.31,-71.89,-41.9,-82.55,-37.05,-91.26,-33.28,-93.7,-30.47,-91.99,-31.91,-97.6,-35.12,-106.7,-38.36,-115.71,-49.03,-54.33,-44.71,-65.75,-40.46,-76.98,-36.28,-86.39,-33.55,-89.25,-32.35,-88.44,-34.34,-94.48,-37.49,-104.26,-40.58,-114.07,-45.51,-47.43,-42.26,-59.48,-39.09,-71.32,-35.54,-81.41,-33.78,-84.75,-34.13,-84.86,-36.64,-91.36,-39.65,-101.88,-42.53,-112.56,-43.87,-38.7,-41.64,-51.37,-39.63,-63.78,-37.07,-74.16,-36.09,-78.42,-37.07,-80.32,-39.19,-88.31,-40.61,-100.04,-42.31,-112.05,-39.76,-29.56,-38.5,-43.17,-37.72,-56.36,-36.95,-66.31,-37.42,-71.5,-38.29,-75.87,-39.43,-85.76,-39.68,-98.18,-40.37,-110.79,-33.97,-21.42,-32.88,-36.21,-32,-50.5,-32.66,-60.17,-34.91,-66.39,-36,-73.34,-36.62,-84.69,-37.07,-97.23,-37.6,-109.81,-29.13,-16.1,-28.93,-30.67,-28.73,-44.74,-30.05,-54.78,-32.92,-62.63,-34.53,-71.65,-35.19,-83.3,-35.87,-96.14,-36.44,-109.1,-21.81,-11.33,-23.13,-25.37,-24.42,-39.05,-26.04,-49.97,-27.57,-59.2,-28.44,-69.49,-29.34,-80.95,-30.44,-94.51,-31.23,-108.36,-14.16,-6.47,-17.01,-20.01,-19.82,-33.41,-21.83,-45.13,-22.79,-55.63,-23.7,-67.1,-24.59,-78.45,-25.01,-92.83,-25.38,-107.69]},{"duration":60,"tweenEasing":0,"value":[-23.25,-50.24,-16.58,-61.4,-10.02,-72.37,-4.47,-81.71,-0.2,-87.63,2.82,-87.09,1.58,-91.96,-1.63,-103.06,-4.87,-114.24,-21.99,-45.85,-16.48,-57.59,-11.07,-69.02,-5.43,-78.64,-1.55,-84.26,0.41,-84.64,-1.51,-90.19,-4.23,-101.43,-6.95,-112.89,-20.77,-41.4,-16.33,-53.77,-11.94,-65.74,-6.16,-75.66,-2.65,-80.96,-1.73,-82.24,-4.33,-88.46,-6.61,-99.88,-8.82,-111.63,-19.6,-36.12,-16.13,-48.82,-12.61,-61.05,-7.18,-70.86,-3.89,-76,-3.26,-78.27,-5.78,-86.09,-7.17,-98.47,-8.6,-111.2,-14.22,-31.27,-11.79,-43.33,-9.34,-54.82,-5.5,-63.56,-3.63,-69.32,-3.17,-73.33,-4.65,-83.39,-5.06,-96.61,-5.73,-110.01,-5.75,-27.44,-4,-39.25,-2,-50.49,0.29,-58.57,-0.11,-65.5,-0.65,-71.88,-1.61,-83.36,-2.21,-96.09,-2.86,-108.83,-1.59,-26.33,-1.11,-37.52,-0.3,-48.23,0.64,-56.48,-1.58,-64.61,-3.44,-72.99,-3.55,-84.27,-2.39,-96.3,-1.8,-108.36,1.87,-26.8,0.76,-37.26,-0.07,-47.43,-0.14,-56.05,-1.2,-64.44,-1.78,-73.72,-1.58,-83.89,-0.91,-95.33,-0.4,-106.98,5.57,-27.31,2.82,-37.02,0.27,-46.76,-0.9,-55.67,-1.38,-64.25,-1.27,-74.37,-0.61,-83.38,0.24,-94.26,1.06,-105.48]},{"value":[-34.25,-40.88,-23.36,-55.57,-12.23,-69.88,-1.1,-81.3,6.26,-88.53,12.24,-86.98,11.58,-91.29,8.36,-103.66,5.12,-116.22,-26.51,-37.57,-16.97,-52.32,-7.42,-66.53,2.77,-78,10.31,-84.3,15.35,-84.09,13.37,-89.14,9.41,-101.38,5.54,-113.96,-19.3,-34.13,-10.97,-48.99,-2.82,-63.26,6.54,-74.78,14.22,-80.12,18.31,-81.24,15.03,-87.03,10.39,-99.18,5.91,-111.81,-15.97,-29.9,-9,-44.52,-2.28,-58.47,5.97,-69.59,13.62,-74.51,17.49,-77.01,14.23,-84.67,10.4,-97.47,6.53,-110.82,-6.97,-27.75,-2.04,-41.01,2.52,-53.4,8.66,-63,13.92,-68.56,17.13,-72.65,15.27,-82.6,13.2,-95.79,10.77,-109.33,4.28,-26.63,8.19,-39.01,12.27,-50.73,16.7,-59.09,18.53,-65.7,20.07,-71.82,18.92,-83.12,17.07,-95.47,15.01,-107.84,8.29,-27.92,10.77,-39.49,13.16,-50.52,15.65,-58.81,15.33,-65.64,15.37,-72.73,15.39,-83.88,16.21,-95.49,16.09,-107.13,11.32,-31.07,13.21,-41.73,14.95,-52.11,16.12,-60.58,16.06,-66.69,16.49,-73.7,16.72,-83.5,17.1,-94.13,17.07,-104.9,14.55,-34.3,15.97,-44.02,17.27,-53.76,17.09,-62.37,16.61,-67.75,16.73,-74.67,17.28,-83.05,17.71,-92.64,18.07,-102.47]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_01","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-43.45,-37.3,-41.35,-42.52,-39.22,-47.7,-37.15,-51.74,-35.51,-51.21,-34.22,-49.78,-35.03,-52.95,-36.64,-56.51,-38.26,-59.92,-42.22,-31.36,-40.05,-37.52,-37.89,-43.62,-36.34,-48.37,-35.34,-48.22,-34.91,-47.01,-35.91,-50.32,-37.71,-54.67,-39.43,-58.96,-41.02,-25.39,-38.82,-32.45,-36.67,-39.44,-35.65,-44.86,-35.24,-45.15,-35.64,-44.23,-36.8,-47.7,-38.68,-52.87,-40.46,-58.07,-40.23,-19.1,-38.43,-26.69,-36.91,-34.16,-36.69,-39.97,-36.93,-41.27,-37.81,-41.62,-38.62,-45.75,-39.35,-51.71,-40.34,-57.78,-36.98,-13.75,-36.09,-21.72,-35.76,-29.53,-36.68,-35.21,-38,-37.61,-39.04,-40.04,-39.42,-44.95,-39.47,-50.99,-39.84,-57.12,-33.61,-8.91,-33,-17.3,-32.82,-25.51,-34.56,-31.01,-36.88,-34.32,-37.98,-38.63,-38.14,-44.29,-38.29,-50.49,-38.5,-56.73,-30.67,-4.27,-30.44,-12.97,-30.38,-21.45,-32.13,-27.3,-34.07,-31.78,-34.91,-37.29,-35.56,-43.33,-36.94,-49.76,-37.87,-56.25,-25.08,0.74,-25.71,-8.62,-26.44,-17.73,-28.01,-24.47,-29.08,-30.17,-29.74,-36.48,-30.77,-42.7,-32.27,-49.41,-33.36,-56.21,-19.27,5.85,-20.75,-4.22,-22.29,-14.04,-23.72,-21.69,-24.43,-28.59,-25.4,-35.68,-26.62,-42.1,-27.46,-49.11,-28.24,-56.29]},{"duration":60,"tweenEasing":0,"value":[-11.63,-25.12,-8.29,-30.7,-5.01,-36.19,-2.24,-40.86,-0.1,-43.82,1.41,-43.54,0.79,-45.98,-0.82,-51.53,-2.44,-57.12,-10.99,-22.92,-8.24,-28.79,-5.54,-34.52,-2.72,-39.32,-0.78,-42.14,0.21,-42.33,-0.75,-45.1,-2.12,-50.72,-3.48,-56.44,-10.39,-20.7,-8.16,-26.87,-5.97,-32.88,-3.08,-37.83,-1.32,-40.48,-0.86,-41.12,-2.16,-44.23,-3.3,-49.94,-4.41,-55.82,-9.8,-18.06,-8.07,-24.4,-6.31,-30.54,-3.59,-35.43,-1.95,-37.99,-1.63,-39.13,-2.91,-43.02,-3.59,-49.22,-4.3,-55.6,-7.11,-15.63,-5.89,-21.65,-4.67,-27.42,-2.76,-31.77,-1.82,-34.65,-1.59,-36.67,-2.35,-41.67,-2.53,-48.29,-2.87,-55.01,-2.87,-13.72,-2,-19.62,-1,-25.24,0.14,-29.28,-0.06,-32.75,-0.33,-35.94,-0.81,-41.68,-1.1,-48.05,-1.43,-54.41,-0.8,-13.17,-0.55,-18.76,-0.15,-24.12,0.32,-28.25,-0.79,-32.3,-1.72,-36.49,-1.78,-42.14,-1.2,-48.15,-0.9,-54.18,0.94,-13.4,0.38,-18.62,-0.04,-23.73,-0.07,-28.03,-0.6,-32.22,-0.89,-36.86,-0.79,-41.94,-0.45,-47.67,-0.2,-53.49,2.79,-13.66,1.41,-18.51,0.13,-23.38,-0.45,-27.83,-0.69,-32.12,-0.63,-37.19,-0.31,-41.69,0.12,-47.13,0.53,-52.74]},{"value":[-13.29,-19.09,-6.29,-27.99,0.89,-36.37,8.04,-41.72,12.03,-45.38,14.13,-43.49,13.12,-45.31,11.51,-52.13,9.89,-59.1,-9.42,-17.36,-2.09,-26.14,5.29,-34.45,12.51,-39.84,17.01,-42.98,18.65,-42.25,15.89,-44.47,12.5,-50.65,9.32,-57.03,-5.82,-15.57,1.84,-24.27,9.46,-32.56,16.73,-38,21.72,-40.6,22.89,-40.99,18.43,-43.63,13.45,-49.27,8.81,-55.12,-3.84,-13.75,3.5,-22.1,10.7,-30.05,17.47,-35.36,22.4,-37.59,23.41,-38.85,18.72,-42.54,13.95,-48.44,9.33,-54.58,2.47,-13.11,8.29,-20.32,13.87,-27.08,18.99,-31.73,21.93,-34.42,22.66,-36.5,19.89,-41.38,17,-47.6,13.97,-53.99,9.48,-12.99,14.23,-19.23,18.92,-25.12,22.57,-29.27,23.07,-32.69,23.13,-35.9,22.02,-41.53,20.44,-47.46,18.6,-53.4,12.08,-14.75,16,-20.22,20.17,-25.5,22.69,-29.57,21.99,-33,21.46,-36.56,21.12,-42.05,20.41,-47.51,19.32,-52.95,15.94,-17.67,18.41,-22.39,21,-27.02,22.27,-31.09,21.96,-33.82,21.88,-37,21.68,-41.74,20.73,-46.56,19.6,-51.41,20.1,-20.64,21.04,-24.58,21.91,-28.6,21.87,-32.62,21.64,-34.62,21.7,-37.4,21.7,-41.36,20.85,-45.51,19.87,-49.73]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_02","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-38.49,-9.33,-38.19,-8.72,-37.91,-8.15,-37.86,-7.66,-38.16,-4,-38.46,-0.35,-38.49,0,-38.49,0,-38.49,0,-36.04,-6.67,-36.78,-6.54,-37.6,-6.41,-37.85,-6.11,-38.15,-3.42,-38.44,-0.72,-38.41,-0.4,-38.21,-0.21,-38.01,0,-33.74,-3.92,-35.44,-4.29,-37.25,-4.63,-37.76,-4.52,-38.07,-2.79,-38.37,-1.06,-38.3,-0.77,-37.91,-0.4,-37.52,0,-33.51,-0.61,-35.19,-1.84,-36.85,-2.96,-37.21,-3.1,-37.66,-2.12,-38.1,-1.15,-38.1,-1.02,-37.89,-0.87,-37.51,-0.71,-37.29,3.49,-37.76,0.9,-38.35,-1.43,-38.09,-1.82,-38.47,-1.54,-38.84,-1.26,-38.82,-1.37,-38.49,-1.84,-37.89,-2.33,-42.2,9.27,-41.11,5.04,-40.03,1.16,-38.98,0.19,-39.28,-0.54,-39.59,-1.27,-39.36,-1.57,-38.34,-2.45,-37.16,-3.4,-38.93,14.47,-37.82,9.25,-36.88,4.45,-36,3.13,-36.31,1.25,-36.62,-0.62,-36.34,-1.23,-35.13,-2.6,-33.91,-4.06,-30.27,18.89,-29.44,12.98,-28.76,7.53,-28.26,5.88,-28.35,2.6,-28.44,-0.69,-28.23,-1.42,-27.41,-2.85,-26.56,-4.38,-21.39,23.33,-20.79,16.7,-20.23,10.57,-20.07,8.55,-19.91,3.83,-19.74,-0.89,-19.62,-1.7,-19.21,-3.13,-18.77,-4.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-1.33,9.03,3.57,5.25,8.61,1.93,13.25,0.92,14.8,-2.07,15.08,-2.73,14.34,-2.33,13.05,-3.6,11.66,-4.98,2.83,7.17,8.54,3.91,14.31,1.03,19.08,0.47,20.93,-1.13,20.85,-1.46,18.97,-1.07,16.82,-1.89,14.75,-2.82,6.68,5.46,13.16,2.68,19.61,0.21,24.5,0.08,26.63,-0.17,26.2,-0.23,23.2,0.09,20.29,-0.31,17.61,-0.82,8.3,4.31,14.85,2.08,21.27,0.09,25.97,0.21,28.13,0.59,27.55,0.3,24.3,0.33,21.37,0.08,18.69,-0.26,11.91,2.52,17.23,1.21,22.28,0.09,26.24,0.61,27.82,0.98,27.35,0.24,25.52,0.24,23.98,0.33,22.5,0.35,14.69,0.73,19.04,0.36,23.15,0.06,26.51,1.01,27.51,1.37,27.16,0.18,26.73,0.17,26.59,0.56,26.31,0.95,15.21,-1.59,19.28,-1.47,23.43,-1.38,26.18,-0.46,26.9,0.43,26.78,0.05,26.69,0.09,26.46,0.64,26.12,1.23,17.34,-4.27,20.57,-3.77,23.77,-3.3,25.44,-2.64,25.81,-1.04,25.76,-0.08,25.56,0.2,24.83,1.1,23.98,2.08,19.65,-6.99,21.97,-6.07,24.11,-5.22,24.66,-4.79,24.66,-2.5,24.67,-0.21,24.34,0.33,23.06,1.62,21.67,3.01]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_03","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-39.57,48.5,-38.6,51.41,-37.65,54.19,-37.11,55.99,-37.31,60.83,-37.71,66.28,-38.14,67.8,-38.96,67.58,-40.19,66.91,-38.12,51.51,-37.67,53.82,-37.44,56,-36.82,57.94,-36.72,61.94,-37.27,65.79,-37.94,67.07,-38.51,66.82,-39.34,66.2,-36.77,54.58,-36.79,56.27,-37.21,57.85,-36.49,59.92,-36.12,63.08,-36.85,65.31,-37.75,66.36,-38.1,66.05,-38.55,65.46,-36.9,58.06,-36.62,58.74,-36.49,59.42,-35.52,61.54,-35.57,63.67,-36.84,64.68,-37.94,65.28,-38.5,64.65,-38.84,63.83,-38.79,62.43,-37.89,61.16,-36.91,60.2,-35.96,62.03,-37,62.49,-38.74,62.79,-39.47,62.99,-39.7,62.24,-39.63,61.42,-41.67,68.63,-40.57,64.92,-39.44,61.83,-38.63,62.95,-39.63,61.58,-40.8,61.02,-40.87,60.96,-40.12,60.37,-39.23,59.84,-37.42,74.4,-36.48,69.3,-35.71,64.88,-35.17,65.19,-35.95,62.64,-36.61,61.11,-36.39,60.99,-35.54,60.05,-34.64,59.14,-28.58,79.68,-27.51,73.75,-26.59,68.45,-26.15,67.85,-26.52,64.15,-26.62,61.31,-26.3,61.37,-25.84,60.19,-25.36,58.93,-19.65,85.02,-18.4,78.23,-17.24,72.02,-16.87,70.5,-16.75,65.62,-16.2,61.46,-15.79,61.71,-15.73,60.32,-15.68,58.75]},{"duration":60,"tweenEasing":0,"value":[0.92,57.83,1.59,60.13,2.26,62.34,2.75,63.65,2.85,64.83,2.75,66.63,2.35,67.8,1.53,67.59,0.3,66.91,-0.08,58.17,1.11,60.35,2.16,62.41,3.03,64.05,3.42,65.35,3.16,66.51,2.47,67.47,1.7,67.03,0.67,66.2,-1.04,58.5,0.65,60.56,2.04,62.48,3.27,64.44,3.95,65.87,3.52,66.37,2.55,67.13,1.81,66.45,0.97,65.46,-1.48,58.67,0.54,60.6,2.34,62.41,3.69,64.64,4.1,65.84,3.25,65.9,2.16,66.36,1.39,65.55,0.67,64.54,-0.5,58.95,1.22,60.38,3.11,61.87,3.98,64.08,3.42,64.5,2.02,64.71,1.28,64.88,0.75,64.35,0.26,63.75,0.62,59.36,1.27,60.1,1.95,61.11,2.05,63.21,1.55,63.03,0.63,63.54,0.35,63.52,0.15,63.33,-0.07,63.24,0.18,60.46,0.78,60.87,1.61,61.52,1.7,63.18,1.35,63.05,0.8,63.65,0.8,63.69,1.04,63.41,1.26,63.2,0.63,61.59,1,62.01,1.52,62.57,1.66,63.75,1.66,63.85,1.56,64.33,1.76,64.51,2.46,63.93,3.2,63.31,1.24,62.69,1.27,63.15,1.3,63.64,1.42,64.34,1.87,64.67,2.31,65,2.72,65.34,3.86,64.45,5.1,63.42]},{"value":[6.92,66.36,11.82,65.08,16.84,64.24,21.26,65.08,22.15,63.34,21.57,64.56,20.15,66.07,17.25,64.3,13.8,61.94,11.24,65.08,17.06,64.19,22.79,63.6,27.39,64.92,28.31,64.4,27.31,65.28,24.85,66.64,21.52,64.93,17.95,62.69,15.2,63.9,21.91,63.4,28.27,63.04,33.03,64.82,34,65.47,32.6,65.97,29.11,67.13,25.4,65.45,21.75,63.3,16.46,63.01,23.48,62.97,30.15,62.99,34.77,65.12,35.35,66.09,33.53,65.91,29.8,66.52,26.09,64.85,22.68,62.85,19,61.72,24.9,62.06,30.73,62.5,34.5,64.88,34.26,65.36,32.34,64.79,30.1,65.03,27.93,64.27,25.85,63.35,20.83,60.56,25.1,61.09,29.24,61.8,32.01,64.34,32,64.49,31,63.69,30.36,63.69,29.8,63.87,29.09,64.13,20.56,59.32,24.63,59.95,29.03,60.65,31.37,62.83,31.44,63.62,30.93,63.72,30.83,63.79,30.64,64.05,30.33,64.43,22.5,57.55,25.79,58.53,29.21,59.53,30.75,61.16,30.97,62.88,30.91,64.25,30.9,64.72,30.77,65.03,30.55,65.39,24.72,55.7,27.07,57.08,29.24,58.43,29.91,59.55,30.36,62.17,30.81,64.78,30.89,65.67,30.76,66.06,30.6,66.42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_04","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-41.66,106.33,-40.01,111.55,-38.39,116.54,-37.36,119.64,-37.46,125.65,-37.96,132.91,-38.8,135.6,-40.43,135.17,-42.89,133.83,-41.2,109.68,-39.56,114.17,-38.28,118.41,-36.79,121.98,-36.3,127.29,-37.11,132.29,-38.46,134.55,-39.81,133.85,-41.67,132.4,-40.81,113.08,-39.15,116.84,-38.16,120.33,-36.21,124.37,-35.17,128.95,-36.33,131.68,-38.2,133.49,-39.29,132.5,-40.58,130.92,-41.3,116.73,-39.04,119.33,-37.13,121.8,-34.84,126.13,-34.49,129.25,-36.59,130.14,-38.77,131.27,-40.1,130.01,-41.16,128.37,-41.29,121.38,-39.01,121.42,-36.47,121.81,-34.84,125.8,-36.55,126.09,-39.64,126.08,-41.12,126.68,-41.91,125.98,-42.37,125.17,-42.14,127.99,-41.04,124.8,-39.84,122.5,-39.27,125.67,-40.99,123.36,-43.02,122.66,-43.38,122.89,-42.9,122.89,-42.3,123.08,-36.92,134.33,-36.14,129.35,-35.53,125.33,-35.33,127.22,-36.59,123.73,-37.61,122.29,-37.44,122.69,-36.94,122.44,-36.38,122.34,-27.89,140.47,-26.57,134.52,-25.42,129.37,-25.04,129.79,-25.7,125.55,-25.81,123.03,-25.38,123.89,-25.28,123.09,-25.16,122.24,-18.91,146.7,-17.02,139.76,-15.25,133.48,-14.67,132.44,-14.59,127.42,-13.67,123.8,-12.95,125.12,-13.25,123.77,-13.58,122.17]},{"duration":60,"tweenEasing":0,"value":[1.83,115.66,3.17,120.26,4.52,124.68,5.5,127.3,5.71,129.65,5.5,133.26,4.69,135.6,3.06,135.17,0.6,133.83,-0.17,116.35,2.22,120.71,4.33,124.83,6.06,128.1,6.85,130.7,6.32,133.01,4.95,134.95,3.4,134.06,1.33,132.4,-2.08,117,1.29,121.13,4.08,124.95,6.54,128.89,7.89,131.74,7.04,132.74,5.1,134.26,3.62,132.9,1.94,130.92,-2.96,117.35,1.08,121.21,4.68,124.82,7.37,129.28,8.19,131.67,6.5,131.8,4.31,132.72,2.77,131.11,1.34,129.07,-1,117.89,2.45,120.75,6.23,123.72,7.96,128.16,6.83,129.01,4.05,129.42,2.55,129.76,1.5,128.69,0.53,127.51,1.23,118.71,2.53,120.21,3.9,122.23,4.11,126.42,3.09,126.06,1.27,127.07,0.7,127.03,0.29,126.67,-0.15,126.48,0.37,120.92,1.55,121.74,3.21,123.03,3.4,126.36,2.7,126.09,1.59,127.31,1.6,127.38,2.07,126.83,2.53,126.4,1.26,123.19,1.99,124.03,3.05,125.15,3.31,127.49,3.31,127.7,3.11,128.65,3.52,129.02,4.93,127.86,6.4,126.62,2.48,125.37,2.53,126.3,2.6,127.29,2.85,128.67,3.73,129.34,4.62,130,5.44,130.68,7.73,128.9,10.19,126.83]},{"value":[15.17,123.69,20.08,124.91,25.07,126.55,29.27,129.24,29.51,128.76,28.06,131.85,25.95,134.46,21.45,132.2,15.93,128.85,19.65,122.98,25.59,124.48,31.26,126.18,35.69,129.37,35.7,129.92,33.78,132.02,30.73,134.35,26.22,131.74,21.14,128.19,23.72,122.35,30.65,124.12,36.94,125.87,41.57,129.56,41.36,131.11,39,132.16,35.02,134.16,30.51,131.21,25.89,127.43,24.62,121.7,32.11,123.86,39.04,125.88,43.56,130.03,42.57,131.58,39.52,131.52,35.29,132.7,30.8,129.61,26.66,125.95,26.08,120.91,32.57,122.9,39.18,124.9,42.76,129.15,40.72,129.73,37.34,129.33,34.69,129.83,31.88,128.22,29.2,126.36,26.98,120.4,31.15,121.83,35.32,123.54,37.51,127.67,36.49,127.6,34.84,127.19,33.99,127.21,33.02,127.18,31.87,127.31,25.91,120.22,29.99,121.37,34.63,122.69,36.56,126.12,35.97,126.81,35.09,127.39,34.97,127.48,34.81,127.46,34.53,127.63,27.66,119.38,31.01,120.83,34.65,122.36,36.07,124.96,36.13,126.8,36.05,128.58,36.24,129.23,36.7,128.97,37.12,128.7,29.8,118.38,32.17,120.23,34.38,122.07,35.17,123.89,36.06,126.84,36.95,129.78,37.44,131.01,38.45,130.51,39.53,129.84]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE.04","timeline":[{"name":"B_EYE.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EYE.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EYE.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_00","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-57.27,-110.11,-52.92,-112.96,-48.56,-116.8,-44.95,-111.17,-44.01,-98.49,-43.91,-87.77,-43.85,-84.4,-43.57,-80.92,-43.27,-77.34,-54.12,-105.67,-50.06,-109.53,-46.07,-113.76,-42.29,-109.65,-41.65,-99.45,-42.91,-89.96,-43.99,-85.76,-44.89,-82.26,-45.59,-78.74,-51.38,-101.11,-47.53,-105.99,-43.82,-110.61,-39.84,-108.03,-39.4,-100.44,-41.9,-92.27,-44.09,-87.29,-45.98,-83.81,-47.57,-80.37,-52.58,-95.43,-48.58,-101.1,-44.35,-106.13,-40.28,-104.75,-39.09,-100.2,-40.87,-94.56,-43.06,-89.78,-45.08,-86.73,-46.86,-83.76,-51.43,-88.85,-48.58,-94.88,-45.63,-100.21,-42.86,-99.03,-40.85,-97.12,-39.92,-95.09,-40.62,-91.75,-42.49,-89.57,-43.94,-87.46,-49.42,-82,-48,-88.51,-46.76,-94.31,-45.52,-93.36,-43.65,-93.97,-40.99,-95.4,-39.96,-93.92,-40.57,-93.28,-41.03,-92.7,-46.44,-76.45,-44.53,-83.75,-42.01,-90.35,-40.96,-90.13,-40.3,-92.44,-38.44,-95.76,-37.5,-95.56,-38.58,-96.69,-39.23,-97.99,-36.57,-72.06,-35.57,-80.32,-34.17,-87.78,-33.65,-88.51,-33.21,-91.92,-31.87,-96.18,-31.23,-96.65,-31.84,-99.32,-32.18,-102.34,-26.05,-67.73,-26.21,-76.97,-26.36,-85.32,-26.5,-86.97,-26.14,-91.43,-25.16,-96.58,-24.74,-97.7,-24.61,-101.92,-24.47,-106.68]},{"duration":60,"tweenEasing":0,"value":[-14,-110.11,-9.65,-113.43,-5.29,-117.69,-1.65,-112.35,-0.41,-101.65,-0.02,-92.92,0,-90.02,0,-87.68,0,-85.34,-12.35,-104.48,-8.18,-108.85,-4.01,-113.59,-0.29,-110.17,1.22,-102.33,0.89,-94.89,0.36,-91.03,-0.06,-87.52,-0.46,-83.93,-10.9,-99.1,-6.9,-104.42,-2.91,-109.53,0.92,-107.91,2.76,-102.93,1.76,-96.75,0.69,-91.99,-0.1,-87.39,-0.89,-82.63,-10.79,-95.57,-7.21,-100.78,-3.71,-105.41,-0.02,-104.37,2.89,-101.63,2.83,-96.96,1.72,-92.03,0.32,-87.33,-0.95,-82.43,-8.66,-92.02,-6.37,-96.9,-4.22,-101.2,-1.58,-99.81,1.92,-98.17,4.08,-95.61,3.79,-91.44,1.41,-87.71,-0.5,-83.82,-7.11,-88.75,-5.9,-93.23,-4.83,-97.18,-3.27,-95.41,-0.53,-94.98,2.51,-94.63,3.38,-91.19,1.57,-88.24,-0.04,-85.21,-6.46,-87.88,-4.81,-91.66,-2.97,-95,-1.75,-93.62,-0.02,-94.53,2.44,-94.73,3.3,-91.17,1.65,-88.28,0,-85.34,-3.03,-88.45,-1.08,-91.27,0.92,-93.71,1.73,-93.01,2.38,-95.36,3.57,-95.31,3.79,-91.33,1.93,-88.36,0,-85.34,0.67,-89.07,2.83,-90.89,4.83,-92.4,5.17,-92.35,4.69,-96.18,4.56,-95.91,4.16,-91.51,2.16,-88.45,0,-85.34]},{"value":[5,-107.11,13.52,-112.28,21.72,-118.26,27.28,-113.11,29.42,-102.78,29.03,-94.84,26.44,-92.79,21.34,-93.44,16,-94.34,8.04,-102.4,16.18,-108.01,24.16,-113.9,30.28,-110.54,32.62,-102.91,31.57,-95.92,27.99,-92.85,23.15,-91.5,18.12,-90.22,10.77,-97.89,18.54,-103.85,26.3,-109.57,32.99,-107.94,35.58,-103,33.95,-96.97,29.37,-92.92,24.73,-89.64,19.99,-86.24,11.53,-94.57,18.57,-100.26,25.82,-105.34,32.44,-104.43,36.09,-101.74,35.57,-97.03,30.85,-92.65,25.67,-88.63,20.81,-84.34,17.59,-91.14,22.38,-96.62,27.54,-101.47,32.15,-100.33,36.36,-98.8,38.18,-95.92,35.54,-91.83,30.74,-88.31,26.38,-84.57,25.61,-88.42,27.55,-93.47,29.55,-97.93,31.72,-96.39,35.14,-96.12,37.96,-95.19,37.66,-91.14,34.6,-87.62,31.53,-83.96,28.54,-87.88,30.12,-92.19,31.92,-96.01,33.16,-94.73,35.01,-95.27,36.96,-94.47,37.1,-90.08,34.49,-86.29,31.8,-82.39,31.97,-88.45,33.66,-91.99,35.44,-95.09,36.2,-94.44,36.86,-95.47,37.74,-93.79,37.6,-89.27,35.26,-85.81,32.81,-82.28,35.67,-89.07,37.37,-91.82,38.93,-94.18,39.17,-94.14,38.69,-95.68,38.56,-93.13,38.16,-88.51,36.16,-85.45,34,-82.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_01","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-48.77,-55.72,-45.9,-57.15,-43.08,-59.07,-40.97,-56.14,-40.45,-48.58,-40.75,-42,-40.89,-40,-40.75,-37.48,-40.61,-34.84,-48.86,-52.81,-45.93,-54.96,-43.08,-57.27,-40.68,-55.21,-39.92,-49.53,-40.56,-43.94,-41.21,-41.18,-41.97,-39.12,-42.61,-37.1,-49.01,-49.88,-46,-52.76,-43.09,-55.44,-40.4,-54.26,-39.38,-50.48,-40.33,-45.88,-41.44,-42.41,-42.96,-40.87,-44.31,-39.52,-50.01,-46.66,-46.71,-50.12,-43.12,-53.19,-40.26,-52.6,-38.87,-50.65,-39.39,-47.49,-40.41,-44.1,-42.03,-43.26,-43.53,-42.69,-47.53,-42.41,-45.34,-46.54,-42.89,-50.23,-40.99,-49.91,-39.49,-49.3,-38.5,-48.15,-38.58,-46.13,-39.78,-46.04,-40.74,-46.15,-44.55,-37.95,-44,-42.84,-43.55,-47.26,-42.9,-47.22,-41.62,-47.79,-39.47,-48.49,-38.42,-48.22,-38.42,-49.52,-38.37,-50.95,-41.24,-33.93,-40.59,-39.68,-39.62,-44.91,-39.15,-45.36,-38.49,-46.88,-36.73,-49.03,-35.71,-49.92,-35.73,-52.62,-35.49,-55.52,-32.38,-30.38,-32.19,-37.06,-31.78,-43.15,-31.56,-44.16,-30.86,-46.3,-29.39,-49.49,-28.59,-51.07,-28.13,-55.04,-27.48,-59.37,-23.05,-26.87,-23.45,-34.49,-23.81,-41.45,-23.89,-43.01,-23.07,-45.72,-21.8,-49.89,-21.17,-52.15,-20.11,-57.4,-18.97,-63.17]},{"duration":60,"tweenEasing":0,"value":[-7,-55.05,-4.83,-56.72,-2.65,-58.85,-0.83,-56.18,-0.21,-50.83,-0.01,-46.46,0,-45.01,0,-43.84,0,-42.67,-6.17,-52.24,-4.09,-54.43,-2.01,-56.81,-0.14,-55.08,0.61,-51.17,0.45,-47.44,0.18,-45.52,-0.03,-43.76,-0.23,-41.97,-5.45,-49.55,-3.44,-52.22,-1.46,-54.78,0.46,-53.96,1.38,-51.46,0.88,-48.38,0.34,-46,-0.05,-43.7,-0.44,-41.32,-5.39,-47.78,-3.61,-50.39,-1.85,-52.71,-0.01,-52.19,1.44,-50.81,1.41,-48.48,0.86,-46.02,0.16,-43.66,-0.48,-41.21,-4.33,-46.01,-3.18,-48.45,-2.11,-50.61,-0.79,-49.91,0.96,-49.08,2.04,-47.8,1.9,-45.72,0.71,-43.85,-0.25,-41.91,-3.55,-44.38,-2.95,-46.61,-2.42,-48.59,-1.64,-47.71,-0.27,-47.49,1.26,-47.31,1.69,-45.6,0.79,-44.12,-0.02,-42.61,-3.23,-43.94,-2.4,-45.83,-1.49,-47.5,-0.88,-46.81,-0.01,-47.26,1.22,-47.37,1.65,-45.58,0.82,-44.14,0,-42.67,-1.52,-44.22,-0.54,-45.63,0.46,-46.85,0.87,-46.5,1.19,-47.68,1.79,-47.66,1.89,-45.67,0.96,-44.18,0,-42.67,0.33,-44.53,1.41,-45.45,2.41,-46.2,2.59,-46.18,2.35,-48.09,2.28,-47.96,2.08,-45.75,1.08,-44.23,0,-42.67]},{"value":[9,-52.05,15.34,-55.57,21.37,-59.41,25.05,-56.93,25.96,-51.95,24.76,-48.38,22.25,-47.78,17.72,-49.6,13,-51.67,11.22,-50.17,17.32,-53.64,23.25,-57.18,27.56,-55.51,28.86,-51.81,27.47,-48.48,24.17,-47.33,19.82,-47.74,15.35,-48.25,13.22,-48.33,19.09,-51.75,24.9,-54.97,29.85,-54.09,31.55,-51.68,29.98,-48.61,25.9,-46.92,21.69,-45.94,17.43,-44.92,14.04,-46.81,19.37,-49.98,24.88,-52.8,29.82,-52.34,32.09,-51.03,31.17,-48.53,27,-46.64,22.51,-44.96,18.28,-43.12,20.04,-45.32,23.4,-48.25,26.93,-50.81,30.13,-50.24,32.49,-49.49,33.02,-47.97,30.64,-46.12,27.04,-44.45,23.63,-42.66,27.03,-44.19,28.1,-46.75,29.13,-48.99,30.37,-48.22,32.14,-48.08,33.46,-47.59,32.97,-45.55,30.82,-43.5,28.55,-41.35,28.77,-43.94,29.39,-46.16,30.05,-48.12,30.6,-47.49,31.53,-47.6,32.5,-47.05,32.45,-44.66,30.67,-42.23,28.8,-39.72,30.48,-44.22,31.12,-46.25,31.76,-48.04,32.07,-47.71,32.4,-47.6,32.84,-46.13,32.71,-43.7,31.3,-41.68,29.81,-39.61,32.33,-44.53,32.95,-46.37,33.52,-47.98,33.59,-47.96,33.35,-47.59,33.28,-45.17,33.08,-42.75,32.08,-41.23,31,-39.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_02","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-40.27,-1.33,-38.88,-1.33,-37.6,-1.33,-36.99,-1.11,-36.89,1.33,-37.59,3.77,-37.93,4.4,-37.93,5.97,-37.94,7.67,-43.6,0.05,-41.81,-0.39,-40.08,-0.77,-39.08,-0.78,-38.19,0.38,-38.22,2.09,-38.42,3.4,-39.04,4.03,-39.64,4.55,-46.64,1.34,-44.47,0.47,-42.35,-0.27,-40.96,-0.48,-39.34,-0.52,-38.76,0.52,-38.79,2.47,-39.93,2.07,-41.05,1.33,-47.44,2.11,-44.84,0.87,-41.89,-0.23,-40.23,-0.45,-38.66,-1.09,-37.91,-0.4,-37.75,1.58,-38.98,0.21,-40.2,-1.62,-43.64,4.04,-42.1,1.79,-40.15,-0.24,-39.11,-0.79,-38.13,-1.47,-37.08,-1.21,-36.53,-0.5,-37.07,-2.51,-37.53,-4.85,-39.68,6.11,-40,2.82,-40.33,-0.21,-40.28,-1.07,-39.6,-1.61,-37.95,-1.59,-36.87,-2.52,-36.27,-5.77,-35.71,-9.2,-36.04,8.59,-36.66,4.39,-37.23,0.51,-37.34,-0.6,-36.68,-1.32,-35.01,-2.3,-33.93,-4.26,-32.87,-8.54,-31.76,-13.06,-28.19,11.31,-28.81,6.19,-29.39,1.47,-29.46,0.18,-28.51,-0.69,-26.91,-2.79,-25.95,-5.48,-24.43,-10.76,-22.79,-16.41,-20.05,14,-20.68,7.98,-21.26,2.42,-21.29,0.96,-20,0,-18.43,-3.21,-17.6,-6.61,-15.62,-12.88,-13.47,-19.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[11,3,15.17,1.15,19.02,-0.56,20.82,-0.76,20.5,-1.13,18.5,-1.92,16.06,-2.77,12.1,-5.76,8,-9,12.39,2.07,16.46,0.74,20.34,-0.45,22.83,-0.48,23.1,-0.71,21.36,-1.05,18.35,-1.82,14.5,-3.98,10.58,-6.29,13.67,1.22,17.64,0.37,21.52,-0.34,24.7,-0.25,25.52,-0.35,24.01,-0.25,20.42,-0.93,16.64,-2.25,12.88,-3.61,14.56,0.96,18.18,0.29,21.94,-0.26,25.21,-0.25,26.1,-0.33,24.77,-0.04,21.14,-0.63,17.35,-1.29,13.76,-1.91,20.5,0.5,22.42,0.13,24.32,-0.14,26.12,-0.14,26.62,-0.19,25.87,-0.02,23.75,-0.41,21.33,-0.59,18.87,-0.75,26.44,0.04,26.66,-0.02,26.7,-0.05,27.02,-0.04,27.15,-0.05,26.96,-0.01,26.28,0.04,25.03,0.62,23.57,1.25,27,0,26.66,-0.13,26.18,-0.24,26.05,-0.25,26.05,0.05,26.05,0.36,25.8,0.77,24.84,1.84,23.8,2.95,27,0,26.57,-0.51,26.07,-0.98,25.94,-0.99,25.94,0.27,25.94,1.53,25.81,1.87,25.33,2.45,24.81,3.06,27,0,26.54,-0.93,26.11,-1.78,26,-1.79,26,0.5,26,2.79,26,3,26,3,26,3]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_03","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-48.06,64.31,-45.88,58.83,-43.73,53.48,-42.29,50.1,-43.16,50.93,-45.52,50.97,-48.66,46.38,-50.94,39.97,-53.1,33.4,-50.65,65.64,-48.17,59.71,-45.89,54.04,-43.44,50.75,-42.17,49.88,-42.8,48.51,-45.51,44.42,-48.04,37.7,-50.84,30.34,-52.98,66.89,-49.7,60.5,-46.45,54.44,-42.82,51.28,-40.33,48.82,-40.14,46.15,-42.47,42.54,-45.15,35.39,-48.54,27.1,-53.03,67.9,-49.03,61.09,-44.56,54.63,-40.39,51.46,-38.07,47.75,-37.88,44.05,-39.64,40.15,-42.06,32.16,-45.3,22.86,-47.88,69.78,-44.99,62.1,-41.44,54.8,-38.63,50.63,-36.77,45.55,-35.61,40.59,-36.22,35.38,-37.59,26.77,-39.35,17.27,-42.3,71.79,-41.57,63.09,-40.69,54.83,-39.73,49.66,-38.29,43.64,-36.14,37.85,-35.44,30.88,-35.28,20.83,-35.23,10.37,-37.22,74.07,-37.04,64.55,-36.73,55.48,-36.29,49.8,-35.02,43.19,-32.84,36.22,-31.79,28.15,-30.85,17.19,-29.79,5.95,-26.83,76.26,-26.82,65.97,-26.71,56.17,-26.32,50.25,-25.01,43.44,-23.21,35.34,-22.16,26.54,-20.42,14.96,-18.52,3.01,-15.97,78.41,-16.17,67.37,-16.34,56.83,-16.01,50.69,-14.61,43.75,-13.15,34.55,-12.1,25.04,-9.56,12.79,-6.81,0.14]},{"duration":60,"tweenEasing":0,"value":[-12.29,65.65,-11.04,60.01,-9.74,54.52,-9.04,50.74,-10.71,49.1,-12.58,47.04,-15.23,41.98,-17.51,34,-19.66,25.74,-12.78,65.13,-11.36,59.71,-10.1,54.48,-8.66,51.1,-8.73,49.16,-9.64,46.47,-12.27,41.45,-14.51,33.68,-16.74,25.53,-13.21,64.67,-11.08,59.41,-8.99,54.35,-6.61,51.35,-5.98,49.18,-6.81,45.91,-9.48,40.89,-11.62,33.26,-13.89,25.14,-12.86,64.74,-10.22,59.51,-7.35,54.47,-4.59,51.46,-4.09,48.66,-5.24,44.68,-7.72,39.4,-9.8,31.78,-11.97,23.66,-9.83,65.07,-7.75,59.92,-5.44,54.93,-3.53,51.24,-2.87,46.86,-3.16,41.77,-4.76,36.26,-6.52,29.21,-8.15,21.83,-6.79,65.4,-5.64,60.27,-4.47,55.29,-3.6,50.98,-2.93,45.33,-2.55,39.39,-3.02,33.42,-3.64,26.48,-4.2,19.39,-5.57,65.76,-4.67,60.48,-3.62,55.34,-3.04,50.8,-2.63,44.73,-2.31,38.55,-2.37,32.41,-2.47,25.73,-2.53,19,-2.61,66.4,-2.14,60.65,-1.56,55.04,-1.13,50.3,-0.88,44.25,-0.79,38.16,-0.71,32.02,-0.49,25.71,-0.22,19.42,0.58,67.08,0.55,60.82,0.53,54.7,0.78,49.73,0.89,43.75,0.78,37.76,1,31.64,1.56,25.67,2.16,19.81]},{"value":[-2.13,68.65,2.37,61.16,6.66,53.95,8.99,49.96,7.46,47.64,4.04,44.49,-1.82,38.49,-8.22,28.47,-14.5,18.07,-1.23,67.2,3.77,60.44,8.48,54.04,12.2,50.58,12.22,47.85,9.57,44.21,3.44,38.3,-2.69,29.04,-8.84,19.34,-0.37,65.88,5.59,59.77,11.5,54.01,16.78,51.08,17.51,47.99,14.8,43.91,8.32,38.08,2.45,29.53,-3.55,20.49,0.86,65.69,7.13,59.81,13.75,54.21,19.45,51.2,20.01,47.48,17.1,42.84,10.84,36.95,4.98,28.92,-0.88,20.47,9.84,65.57,13.83,60.04,18.05,54.81,21.54,51.1,22.06,46.24,20.58,40.8,16.21,34.96,11.18,27.83,6.23,20.41,18.82,65.45,20.18,60.24,21.4,55.25,22.51,50.96,22.82,45.26,22.59,39.29,20.27,33.49,16.7,27.1,13.04,20.58,20.59,65.76,21.16,60.35,21.73,55.11,22.14,50.55,22.14,44.79,22.05,38.91,20.69,33.28,17.99,27.64,15.39,21.96,23.56,66.4,23.6,60.14,23.68,54.06,23.95,49.3,23.99,44.52,23.87,39.69,23.28,33.93,22.16,28.2,21.13,22.49,26.75,67.08,26.25,59.9,25.8,52.92,25.95,47.95,26.05,44.25,25.95,40.55,26.17,34.64,26.73,28.67,27.32,22.81]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_04","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-55.85,129.96,-52.88,119,-49.86,108.29,-47.59,101.31,-49.42,100.54,-53.45,98.18,-59.39,88.37,-63.95,73.97,-68.27,59.14,-57.69,131.23,-54.53,119.81,-51.69,108.9,-47.81,102.26,-46.16,99.36,-47.38,94.92,-52.62,85.47,-57.02,71.4,-62.04,56.14,-59.32,132.45,-54.92,120.52,-50.53,109.19,-44.69,103.02,-41.33,98.16,-41.53,91.78,-46.19,82.65,-50.34,68.75,-56.02,52.87,-58.79,133.69,-53.36,121.38,-47.4,109.58,-40.55,103.37,-37.5,96.59,-37.85,88.5,-41.55,78.71,-45.12,64.14,-50.41,47.34,-54.12,135.51,-49.34,122.67,-43.64,110.18,-38.16,102.03,-35.44,92.55,-34.14,82.4,-35.94,71.27,-38.09,56.1,-41.16,39.39,-48.74,137.47,-45.93,123.83,-42.6,110.56,-39.18,100.39,-36.99,88.88,-34.32,77.3,-34.02,64.29,-34.29,47.44,-34.75,29.93,-41.96,139.55,-40.01,125.11,-37.6,111.06,-35.25,100.2,-33.36,87.7,-30.67,74.74,-29.66,60.55,-28.82,42.94,-27.82,24.95,-27.33,141.21,-26.17,125.95,-24.73,111.18,-23.18,100.32,-21.51,87.57,-19.51,73.48,-18.37,58.55,-16.41,40.67,-14.24,22.43,-11.89,142.83,-11.66,126.76,-11.42,111.24,-10.73,100.42,-9.22,87.5,-7.87,72.32,-6.6,56.68,-3.5,38.46,-0.16,19.94]},{"duration":60,"tweenEasing":0,"value":[-24.58,131.29,-22.08,120.03,-19.48,109.03,-18.08,101.49,-21.42,98.2,-25.17,94.09,-30.47,83.97,-35.02,68,-39.33,51.48,-25.56,130.25,-22.71,119.41,-20.2,109,-17.31,102.18,-17.48,98.32,-19.29,92.96,-24.58,82.95,-29,67.4,-33.48,51.06,-26.42,129.33,-22.16,118.81,-17.97,108.73,-13.22,102.69,-11.98,98.34,-13.63,91.82,-19.03,81.86,-23.22,66.58,-27.78,50.29,-25.72,129.47,-20.43,119.03,-14.71,108.93,-9.19,102.92,-8.2,97.31,-10.48,89.36,-15.48,78.88,-19.58,63.6,-23.93,47.31,-19.65,130.14,-15.5,119.83,-10.88,109.85,-7.07,102.46,-5.76,93.71,-6.33,83.53,-9.56,72.6,-13.03,58.47,-16.3,43.66,-13.58,130.81,-11.28,120.53,-8.94,110.58,-7.21,101.95,-5.87,90.65,-5.1,78.78,-6.05,66.84,-7.27,52.98,-8.4,38.77,-11.14,131.51,-9.34,120.95,-7.23,110.66,-6.07,101.6,-5.26,89.46,-4.63,77.11,-4.74,64.82,-4.95,51.47,-5.06,38.01,-5.21,132.81,-4.27,121.3,-3.12,110.08,-2.26,100.59,-1.77,88.51,-1.58,76.32,-1.42,64.04,-0.98,51.42,-0.45,38.84,1.17,134.16,1.1,121.64,1.06,109.41,1.56,99.47,1.77,87.5,1.56,75.53,2,63.28,3.12,51.34,4.31,39.61]},{"value":[-15.25,134.29,-10.43,121.17,-5.7,108.47,-2.84,100.67,-5.59,96.41,-10.42,90.89,-19.69,79.74,-28.53,62.7,-37,45.15,-14.84,132.33,-8.93,120.14,-3.36,108.59,1.57,101.63,1.32,96.41,-2.23,89.48,-11.5,78.43,-19.88,62.08,-28.26,44.97,-14.42,130.55,-6.46,119.16,1.49,108.39,8.85,102.38,9.48,96.31,5.57,88.08,-3.82,77.12,-11.73,61.35,-19.98,44.59,-12.83,130.43,-3.92,119.33,5.54,108.65,13.7,102.63,13.9,95.27,9.41,85.71,0.49,74.59,-7.37,59.17,-15.52,42.85,-0.82,130.64,5.24,119.95,11.79,109.76,16.96,102.32,17.46,92.64,15.27,81.62,8.58,70.41,1.06,56.28,-6.42,41.57,11.19,130.85,13.71,120.49,16.1,110.57,17.99,101.96,18.49,90.55,18.22,78.59,14.25,66.96,8.37,53.59,2.51,39.91,14.19,131.51,15.66,120.82,17.29,110.43,18.22,101.35,18.23,89.51,18.05,77.47,15.57,65.78,11.15,53.46,6.98,40.96,20.12,132.81,20.63,120.78,21.28,109.1,21.97,99.6,22.04,88.77,21.8,77.84,20.76,65.95,18.99,53.98,17.45,41.91,26.5,134.16,25.97,120.72,25.5,107.62,25.89,97.68,26.11,88,25.89,78.31,26.33,66.28,27.45,54.34,28.64,42.61]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE_BALL.05","timeline":[{"name":"B_EYE_BALL.05_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE_BALL.05_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE_BALL.05_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.05_00","timeline":[{"name":"B_EYE_BALL.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-21.58,5.4,-22.32,6.15,-23.18,7.47,-23.83,8.72,-23.95,9.28,-23.93,9.32,-24,9.47,-24.1,9.74,-24.19,10.17,-17.59,2.54,-19.34,3.55,-21.31,5.09,-22.86,6.5,-23.36,7.12,-23.42,7.4,-23.64,8.13,-23.92,9.12,-24.19,10.17,-13.06,0.44,-15.92,1.5,-19.09,2.83,-21.64,3.97,-22.64,4.45,-22.8,5.06,-23.21,6.55,-23.72,8.42,-24.19,10.17,-8.8,-2.03,-12.71,-0.83,-17.04,0.51,-20.55,1.59,-21.99,2.03,-22.23,2.92,-22.81,5.08,-23.53,7.75,-24.19,10.17]},{"duration":60,"tweenEasing":0,"value":[-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19]},{"value":[-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.05_01","timeline":[{"name":"B_EYE_BALL.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.05_02","timeline":[{"name":"B_EYE_BALL.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17]},{"duration":60,"tweenEasing":0,"value":[15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39]},{"value":[15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE_BALL.10","timeline":[{"name":"B_EYE_BALL.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE_BALL.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE_BALL.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.10_00","timeline":[{"name":"B_EYE_BALL.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67]},{"duration":60,"tweenEasing":0,"value":[-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17]},{"value":[-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.10_01","timeline":[{"name":"B_EYE_BALL.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.10_02","timeline":[{"name":"B_EYE_BALL.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.39,11.81,18.52,12.19,18.74,12.34,18.84,11.96,18.61,10.75,18.35,9.87,17.74,9.31,17.13,9,16.84,8.85,18.92,12.33,19.27,12.85,19.79,12.63,20.06,11.35,19.68,8.7,18.54,6.5,16.68,4.45,14.81,2.89,13.62,2.18,19.59,12.96,20.19,13.53,21.03,12.74,21.5,10.35,21,6.16,18.76,2.5,15.37,-1.43,11.97,-4.61,9.65,-6.07,20.18,13.53,21.03,14.21,22.17,12.94,22.82,9.55,22.2,3.87,18.99,-1.18,14.19,-6.79,9.36,-11.42,6.06,-13.53]},{"duration":60,"tweenEasing":0,"value":[18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17]},{"value":[18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.03","timeline":[{"name":"B_BROW.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.03_00","timeline":[{"name":"B_BROW.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.44,42.44,28.42,42.44,28.41,42.44,28.4,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.44,42.44,28.43,42.44,28.42,42.44,28.41,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.44,42.44,28.43,42.44,28.42,42.44,28.41,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.43,42.44,28.43,42.44,28.42,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.44,42.44,28.43,42.44,28.43,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.44,42.44,28.43,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.44,42.44,28.44,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45]},{"duration":60,"tweenEasing":0,"value":[41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.04,41.61,-0.05,41.61,-0.06,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.05,41.61,-0.05,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.04,41.61,-0.05,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.04,41.61,-0.04,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.04,41.61,-0.04,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02,41.61,-0.03,41.61,-0.03,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02,41.61,-0.03,41.61,-0.03,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02,41.61,-0.02,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02]},{"value":[41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.74,41.61,-20.76,41.61,-20.77,41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.74,41.61,-20.75,41.61,-20.76,41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.75,41.61,-20.75,41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.74,41.61,-20.75,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.74,41.61,-20.74,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.73,41.61,-20.74,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.72,41.61,-20.73,41.61,-20.73,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.72,41.61,-20.73,41.61,-20.73,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.72,41.61,-20.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.03_01","timeline":[{"name":"B_BROW.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.03_02","timeline":[{"name":"B_BROW.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46]},{"duration":60,"tweenEasing":0,"value":[-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66]},{"value":[-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.04","timeline":[{"name":"B_BROW.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.04_00","timeline":[{"name":"B_BROW.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.86,26.13,-26.86,26.13,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.85,26.13,-26.86,26.13,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.85,26.12,-26.86,26.13,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.85,26.12,-26.86,26.12,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.86,26.11,-26.86,26.12,-26.86,26.12,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.11,-26.86,26.11,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.11,-26.86,26.11,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.1,-26.86,26.1,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.1]},{"duration":60,"tweenEasing":0,"value":[-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.86,0.03,-26.86,0.04,-26.86,0.05,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.86,0.04,-26.86,0.04,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.85,0.04,-26.86,0.04,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.85,0.03,-26.86,0.04,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.86,0.03,-26.86,0.03,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.02,-26.86,0.02,-26.86,0.02,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.01,-26.86,0.02,-26.86,0.02,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.01,-26.86,0.02,-26.86,0.02,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.01,-26.86,0.01,-26.86,0.01]},{"value":[-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.86,-26.86,-20.84,-26.86,-20.82,-26.86,-20.82,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.86,-26.85,-20.85,-26.86,-20.83,-26.86,-20.83,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.86,-26.85,-20.85,-26.85,-20.83,-26.86,-20.83,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.85,-26.85,-20.84,-26.86,-20.83,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.85,-26.85,-20.84,-26.86,-20.84,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.85,-26.86,-20.84,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.85,-26.86,-20.85,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.85,-26.86,-20.85,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.86,-26.86,-20.85]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.04_01","timeline":[{"name":"B_BROW.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.04_02","timeline":[{"name":"B_BROW.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09]},{"duration":60,"tweenEasing":0,"value":[17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85]},{"value":[17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.05","timeline":[{"name":"B_BROW.05_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.05_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_BROW.05_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.05_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_BROW.05_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_00","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-59.36,-43.36,-52.32,-65.17,-44.99,-85.95,-36.15,-96.75,-28.73,-97.1,-21.99,-94.34,-20.35,-99.72,-21.49,-106.79,-22.72,-113.66,-56.04,-39.6,-49.22,-60.61,-43,-80.41,-35.82,-91.56,-31.08,-93.07,-27.57,-93.23,-26.97,-100.21,-28.59,-107.79,-30.29,-115.22,-53.15,-35.78,-46.44,-56.1,-41.15,-75.08,-35.57,-86.61,-33.23,-89.2,-32.65,-92.18,-33.04,-100.65,-35.09,-108.71,-37.23,-116.65,-52.45,-30.7,-45.82,-51.45,-40.42,-70.96,-35.62,-82.96,-33.54,-86.52,-33.35,-91.45,-34.14,-100.32,-36.22,-108.69,-38.37,-117.04,-46.13,-23.72,-41.8,-46.16,-38.09,-67.37,-34.13,-79.74,-33.58,-84.86,-34.14,-90.78,-34.63,-98.72,-35.69,-107.91,-36.84,-117.34,-40.22,-15.62,-38.06,-39.57,-35.93,-62.36,-32.76,-75.14,-33.72,-82.44,-34.95,-89.94,-35.11,-97.12,-35.16,-107.13,-35.32,-117.64,-36.68,-8.87,-34.4,-33.3,-31.03,-56.77,-28.17,-70.23,-30.34,-79.91,-32.5,-89.59,-32.71,-97.27,-32.75,-107.32,-32.85,-117.81,-26.22,-3.77,-25.4,-28.56,-23.87,-52.43,-22.35,-67.06,-23.59,-78.25,-24.84,-89.45,-25.03,-98.19,-25.32,-108.16,-25.67,-118.38,-14.96,1.29,-15.91,-23.86,-16.73,-48.22,-16.64,-63.91,-16.64,-76.61,-16.64,-89.31,-16.78,-99.12,-17.35,-109.03,-17.97,-119]},{"duration":60,"tweenEasing":0,"value":[-49.02,-22.03,-40.49,-42.85,-31.66,-62.88,-21.85,-75.04,-14.73,-82.44,-8.29,-88.4,-6.39,-96.3,-6.39,-105.65,-6.39,-115,-41.78,-19.68,-32.97,-40.41,-24.55,-60.16,-15.63,-72.77,-10.1,-80.82,-6.22,-88.47,-5.23,-97.18,-5.43,-106.33,-5.63,-115.47,-35.04,-17.51,-25.92,-38.15,-17.87,-57.62,-9.81,-70.64,-5.7,-79.28,-4.21,-88.52,-4.1,-98,-4.48,-106.96,-4.87,-115.9,-32.33,-16.26,-23.32,-37.14,-15.21,-56.89,-7.8,-69.94,-3.94,-78.59,-2.97,-88.37,-3.28,-98.13,-3.68,-107.07,-4.1,-115.97,-24.38,-14.72,-18.34,-36.26,-12.56,-56.7,-6.86,-69.61,-4,-78.37,-2.8,-87.77,-2.91,-97.27,-3.12,-106.39,-3.34,-115.51,-16.56,-13.18,-13.8,-34.92,-11.04,-55.64,-7.13,-68.15,-4.7,-77.51,-2.69,-87.02,-2.54,-96.4,-2.55,-105.72,-2.58,-115.04,-14.03,-11.72,-12.15,-33.55,-9.78,-54.53,-6.82,-67.41,-4.43,-77.16,-2.05,-86.91,-1.82,-96.3,-1.82,-105.65,-1.82,-115,-7.56,-10.55,-6.59,-32.65,-5.32,-54.01,-3.66,-67.82,-2.42,-77.38,-1.18,-86.93,-1.06,-96.3,-1.06,-105.65,-1.06,-115,-0.63,-9.38,-0.65,-31.75,-0.61,-53.54,-0.3,-68.26,-0.3,-77.61,-0.3,-86.96,-0.3,-96.3,-0.3,-105.65,-0.3,-115]},{"value":[-45.02,-11.14,-31.39,-34.02,-17.86,-56.01,-6.72,-69.31,1.78,-78.75,9.58,-86.77,11.61,-95.48,11.61,-105.5,11.61,-115.52,-33.61,-10.18,-21.44,-32.59,-9.99,-53.81,-0.01,-67.48,7.1,-77.37,12.56,-86.86,13.81,-96.29,14.02,-105.92,14.22,-115.53,-23.01,-9.29,-12.17,-31.24,-2.65,-51.8,6.26,-65.75,12.14,-76.04,15.41,-86.93,15.89,-97.05,16.3,-106.32,16.7,-115.54,-19.45,-8.45,-9.24,-30.36,0.02,-51.13,8.45,-65.26,14.1,-75.45,16.87,-86.77,16.94,-97.19,17.4,-106.39,17.94,-115.54,-12.87,-7.83,-4.82,-29.98,2.99,-51.27,10.27,-65.79,14.51,-75.68,17.08,-86.22,17.36,-96.38,18.22,-105.97,19.16,-115.53,-6.43,-7.2,-0.85,-29.17,4.85,-50.47,10.88,-65.2,14.26,-75.28,17.22,-85.52,17.79,-95.57,19.05,-105.55,20.37,-115.52,-4.25,-6.04,0.56,-28.08,5.86,-49.6,11.29,-64.55,14.73,-74.92,18.18,-85.28,18.82,-95.36,20.04,-105.39,21.29,-115.41,1.37,-5.73,5.44,-28.05,9.91,-49.83,14.5,-64.94,17.39,-74.92,20.28,-84.9,20.77,-94.93,21.61,-104.96,22.47,-114.98,7.38,-5.48,10.67,-28.07,14.19,-50.11,17.92,-65.36,20.2,-74.92,22.48,-84.49,22.81,-94.47,23.24,-104.49,23.7,-114.52]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_01","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-31.67,-12.22,-28.14,-26.28,-24.42,-39.97,-20.94,-48.8,-20.33,-48.55,-19.72,-48.31,-19.96,-53.55,-21.1,-57.73,-22.33,-61.72,-34.05,-9.74,-31.71,-24.68,-29.4,-39.01,-26.8,-47.33,-26.64,-47.49,-26.47,-47.66,-26.82,-53.35,-28.24,-58.82,-29.74,-64.19,-36.48,-7.11,-35.21,-22.98,-34.11,-38.04,-32.33,-45.86,-32.52,-46.46,-32.71,-47.05,-33.16,-53.14,-34.83,-59.81,-36.58,-66.47,-37.88,-3.35,-36.92,-19.86,-35.7,-35.45,-34.28,-43.05,-34.33,-44.89,-34.39,-46.72,-34.83,-52.67,-36.5,-59.78,-38.22,-66.99,-33.17,2.35,-33.69,-14.35,-34.17,-30.08,-33.72,-38.05,-34.33,-42.22,-34.94,-46.39,-35.22,-51.75,-36.07,-58.91,-37,-66.38,-29.02,8.61,-30.83,-9.22,-32.71,-26.14,-33.17,-35.02,-34.33,-40.67,-35.5,-46.32,-35.61,-50.82,-35.65,-58.05,-35.78,-65.77,-28.42,13.43,-29.63,-5.47,-30.41,-23.45,-30.74,-32.97,-32.4,-39.69,-34.05,-46.41,-34.22,-51.1,-34.26,-58.26,-34.35,-65.86,-26.14,18.51,-27.3,-0.77,-28.16,-19.08,-28.37,-28.84,-28.43,-37.51,-28.5,-46.18,-28.58,-52.02,-28.87,-59.11,-29.22,-66.43,-23.67,23.62,-24.9,4.05,-26.04,-14.53,-26.16,-24.49,-24.33,-35.22,-22.51,-45.94,-22.48,-52.95,-23.05,-59.98,-23.67,-67.05]},{"duration":60,"tweenEasing":0,"value":[-10.67,3.78,-7.14,-10.9,-3.42,-25.16,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-8.82,3.61,-5.83,-11.37,-2.78,-25.78,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-7.1,3.45,-4.61,-11.84,-2.16,-26.4,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-6.27,3.47,-4.09,-12.04,-1.71,-26.75,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-2,4.18,-1.43,-11.51,-0.78,-26.42,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,2.27,4.89,1.24,-10.98,0.14,-26.12,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,2.52,5.25,1.38,-10.8,0.28,-26.11,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,1.95,6.39,1.06,-10.18,0.22,-25.96,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,1.33,7.62,0.72,-9.49,0.15,-25.78,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05]},{"value":[9.34,8.68,12.87,-6.68,16.59,-21.62,20,-31.9,20,-39.04,20,-46.17,20,-53.31,20,-60.44,20,-67.58,11.19,8.5,14.18,-7.16,17.23,-22.24,20,-31.9,20,-39.03,20,-46.17,20,-53.31,20,-60.44,20,-67.58,12.9,8.34,15.39,-7.62,17.85,-22.86,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.58,13.74,8.37,15.91,-7.82,18.3,-23.21,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,18.01,9.08,18.58,-7.3,19.22,-22.88,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,22.27,9.78,21.25,-6.77,20.15,-22.58,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,22.53,10.14,21.38,-6.59,20.29,-22.57,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,21.96,11.28,21.07,-5.96,20.22,-22.42,20,-31.89,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,21.34,12.52,20.72,-5.27,20.15,-22.24,20,-31.89,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_02","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-21,-16,-21,-15.38,-21,-14.81,-20.94,-14.04,-20.33,-7.33,-19.72,-0.63,-19.96,0.58,-21.1,2.86,-22.33,5.33,-25.23,-13.35,-25.88,-13.3,-26.62,-13.24,-26.8,-12.57,-26.64,-6.27,-26.47,0.02,-26.82,0.78,-28.24,1.77,-29.74,2.86,-29.38,-10.56,-30.6,-11.12,-31.95,-11.63,-32.33,-11.1,-32.52,-5.24,-32.71,0.62,-33.16,0.99,-34.83,0.78,-36.58,0.58,-31.61,-6.83,-32.83,-7.79,-33.98,-8.64,-34.28,-8.3,-34.33,-3.67,-34.39,0.95,-34.83,1.46,-36.5,0.81,-38.22,0.06,-31.17,-1.83,-32.26,-2.76,-33.37,-3.54,-33.72,-3.29,-34.33,-1,-34.94,1.29,-35.22,2.38,-36.07,1.68,-37,0.67,-31.28,3.72,-32.07,1.79,-32.85,0.04,-33.17,-0.26,-34.33,0.55,-35.5,1.35,-35.61,3.31,-35.65,2.54,-35.78,1.28,-30.94,8.19,-31.02,5.3,-30.7,2.6,-30.74,1.79,-32.4,1.53,-34.05,1.27,-34.22,3.03,-34.26,2.33,-34.35,1.19,-28.09,12.12,-28.37,9.39,-28.38,6.85,-28.37,5.92,-28.43,3.71,-28.5,1.49,-28.58,2.12,-28.87,1.49,-29.22,0.62,-25,16,-25.62,13.53,-26.19,11.25,-26.16,10.27,-24.33,6,-22.51,1.73,-22.48,1.19,-23.05,0.62,-23.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[22.67,4.89,28.76,3.25,34.61,1.79,37.89,2.08,39.84,3.35,41.22,4.06,40.75,3.2,38.47,1.39,36,-0.53,20.2,4.89,25.48,3.65,30.39,2.54,33.1,2.45,35.08,2.85,36.3,2.91,35.96,2.14,34.23,0.84,32.3,-0.53,17.92,4.89,22.45,4.04,26.51,3.25,28.68,2.78,30.71,2.38,31.76,1.84,31.53,1.14,30.3,0.32,28.87,-0.52,17.57,4.89,21.72,4.22,25.65,3.54,27.51,2.86,29.49,2.18,30.48,1.51,30.26,0.83,29.13,0.15,27.94,-0.52,20.01,4.89,23.09,4.22,25.94,3.54,27.17,2.86,28.5,2.19,29.28,1.51,29.12,0.83,28.26,0.15,27.33,-0.52,22.44,4.89,24.46,4.22,26.23,3.54,26.83,2.86,27.52,2.19,28.07,1.51,27.97,0.83,27.38,0.15,26.72,-0.52,22.67,4.9,24.24,4.22,25.82,3.54,26.28,2.86,26.83,2.19,27.37,1.51,27.28,0.83,26.75,0.16,26.23,-0.52,22.67,4.9,23.48,4.22,24.3,3.54,24.55,2.86,24.83,2.19,25.11,1.51,25.06,0.83,24.79,0.16,24.52,-0.52,22.67,4.9,22.67,4.22,22.67,3.54,22.67,2.87,22.67,2.19,22.67,1.51,22.67,0.83,22.67,0.16,22.67,-0.52]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_03","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-21.79,33.85,-20.02,39.08,-18.33,44.37,-17.13,50.73,-16.68,60.1,-16.87,69.05,-17.51,74.74,-19.88,78.7,-22.46,82.49,-26.92,36.5,-25.84,40.79,-24.9,45.21,-23.81,51.51,-23.35,61.65,-23.64,70.95,-24.45,76.08,-27.2,78.94,-30.13,81.56,-31.92,39.28,-31.44,42.61,-31.13,46.14,-30.11,52.34,-29.57,63.18,-29.93,72.74,-30.88,77.34,-33.97,79.17,-37.24,80.7,-34.73,42.93,-34.25,45.83,-33.76,48.99,-32.71,54.95,-31.96,64.85,-32.06,73.39,-33,78,-36.07,79.52,-39.21,80.63,-36.1,46.89,-35.57,50.56,-35.15,54.48,-34.58,60.36,-34.76,67.11,-35.42,73.11,-35.92,78.73,-37.35,80.76,-38.9,82.21,-38.04,51.43,-37.27,54.82,-36.63,58.45,-36.45,63.79,-37.56,68.27,-38.78,72.55,-38.85,79.47,-38.64,81.99,-38.59,83.79,-37.97,56.19,-36.69,58.62,-35.02,61.29,-34.7,66.1,-36.29,69.2,-37.88,72.3,-37.95,79.17,-37.67,81.64,-37.36,83.43,-34.82,61.64,-34.25,63.93,-33.42,66.48,-33.16,71.03,-32.89,71.8,-32.63,72.57,-32.53,78.06,-32.25,80.01,-31.94,81.43,-31.38,67.18,-31.69,69.41,-31.98,71.91,-31.82,76.25,-29.38,74.56,-26.95,72.87,-26.64,76.92,-26.36,78.28,-26.05,79.27]},{"duration":60,"tweenEasing":0,"value":[3.71,49.85,5.48,54.46,7.17,59.18,8.32,64.77,8.15,67.43,7.36,69.68,6.95,74.16,5.72,75.83,4.38,77.15,2.81,49.85,4.55,54.09,6.22,58.45,7.5,64.08,7.79,67.93,7.33,70.93,6.88,75.3,5.54,77.17,4.11,78.7,1.96,49.85,3.66,53.73,5.31,57.76,6.72,63.44,7.45,68.42,7.28,72.12,6.78,76.36,5.36,78.4,3.84,80.12,1.38,49.75,3.07,53.62,4.72,57.63,6.08,63.26,6.88,68.53,6.83,72.44,6.33,76.54,4.93,78.71,3.51,80.58,-0.44,48.73,1.18,53.32,2.72,58.02,3.65,63.65,4.08,68.12,4.02,71.82,3.8,76.35,3.22,79.08,2.6,81.55,-2.26,47.7,-0.71,53.03,0.72,58.41,1.21,64.05,1.28,67.72,1.22,71.2,1.27,76.15,1.51,79.45,1.69,82.51,-2.54,48,-1.17,53.32,0.18,58.7,0.54,64.3,0.61,67.67,0.68,71.04,0.76,76.12,1.09,79.3,1.49,82.24,-2.23,49.53,-1.38,54.54,-0.54,59.64,-0.29,65.11,0.04,68.1,0.37,71.08,0.54,75.94,1.12,78.52,1.78,80.82,-1.88,51.18,-1.57,55.87,-1.29,60.66,-1.16,65.98,-0.55,68.56,0.06,71.14,0.34,75.73,1.19,77.66,2.12,79.27]},{"value":[29.05,54.74,36.9,57.71,44.45,60.97,48.87,66.85,50.66,70.78,51.24,73.73,50.37,77.36,46.85,77.22,43.04,76.63,25.99,54.74,33.14,57.53,39.91,60.61,44,66.24,45.82,70.63,46.31,73.82,45.5,77.44,42.44,78.01,39.07,78.17,23.14,54.74,29.62,57.37,35.71,60.29,39.48,65.66,41.34,70.5,41.74,73.92,40.98,77.5,38.33,78.73,35.38,79.6,22.26,54.64,28.36,57.39,34.32,60.36,37.75,65.51,39.55,70.39,40.01,73.92,39.25,77.38,36.73,78.86,34.11,80.05,22.57,53.62,27.41,57.29,31.98,61.13,34.25,66.2,35.5,70.14,35.98,73.31,35.58,77.18,34.15,79.23,32.6,81.02,22.88,52.6,26.45,57.2,29.63,61.89,30.74,66.88,31.44,69.89,31.95,72.71,31.9,76.98,31.56,79.6,31.08,81.99,22.8,52.89,25.74,57.54,28.67,62.24,29.49,67.17,30.1,69.86,30.71,72.55,30.71,76.95,30.51,79.46,30.39,81.72,23.11,54.42,24.76,58.76,26.43,63.18,26.93,67.98,27.54,70.28,28.15,72.59,28.27,76.77,28.58,78.68,28.97,80.29,23.46,56.08,23.76,60.09,24.05,64.2,24.18,68.85,24.79,70.75,25.39,72.65,25.67,76.56,26.52,77.82,27.45,78.75]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_04","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-22.58,83.69,-19.04,93.54,-15.66,103.55,-13.31,115.5,-13.03,127.54,-14.01,138.72,-15.05,148.9,-18.67,154.53,-22.58,159.64,-28.61,86.34,-25.79,94.87,-23.18,103.66,-20.81,115.6,-20.05,129.59,-20.82,141.88,-22.07,151.38,-26.16,156.1,-30.52,160.26,-34.46,89.13,-32.28,96.34,-30.32,103.9,-27.88,115.78,-26.62,131.6,-27.15,144.86,-28.59,153.69,-33.11,157.57,-37.9,160.83,-37.84,92.68,-35.68,99.44,-33.53,106.61,-31.13,118.21,-29.59,133.38,-29.74,145.84,-31.18,154.54,-35.64,158.23,-40.21,161.21,-41.04,95.62,-38.87,103.88,-36.93,112.49,-35.44,124,-35.19,135.23,-35.9,144.93,-36.63,155.06,-38.63,159.84,-40.8,163.76,-44.8,99.13,-42.47,107.84,-40.4,116.85,-39.74,127.83,-40.78,135.99,-42.06,143.75,-42.08,155.62,-41.63,161.44,-41.4,166.3,-45.01,104.18,-42.36,111.95,-39.34,119.98,-38.66,130.4,-40.18,136.87,-41.7,143.34,-41.69,155.3,-41.08,160.95,-40.37,165.67,-41.55,111.17,-40.13,118.48,-38.46,126.12,-37.94,136.15,-37.35,139.9,-36.76,143.65,-36.49,154.01,-35.63,158.54,-34.66,162.25,-37.77,118.36,-37.77,125.28,-37.77,132.57,-37.48,142.23,-34.43,143.12,-31.39,144.01,-30.81,152.64,-29.67,155.95,-28.43,158.54]},{"duration":60,"tweenEasing":0,"value":[7.42,99.69,10.96,108.93,14.34,118.36,16.63,129.54,16.31,134.87,14.72,139.35,13.9,148.32,11.43,151.66,8.75,154.3,5.62,99.69,9.09,108.17,12.44,116.9,14.99,128.17,15.59,135.86,14.65,141.85,13.75,150.61,11.09,154.34,8.22,157.39,3.92,99.69,7.32,107.46,10.63,115.53,13.45,126.89,14.9,136.84,14.56,144.23,13.57,152.72,10.73,156.8,7.69,160.24,2.77,99.5,6.14,107.24,9.45,115.26,12.15,126.51,13.75,137.06,13.65,144.88,12.65,153.09,9.86,157.42,7.01,161.15,-0.87,97.45,2.37,106.64,5.45,116.04,7.29,127.31,8.15,136.25,8.04,143.64,7.59,152.69,6.44,158.16,5.2,163.09,-4.52,95.41,-1.41,106.06,1.45,116.81,2.43,128.1,2.56,135.44,2.44,142.39,2.53,152.3,3.02,158.89,3.38,165.03,-5.07,96,-2.34,106.64,0.36,117.39,1.08,128.61,1.22,135.34,1.35,142.07,1.52,152.25,2.18,158.61,2.99,164.48,-4.47,99.05,-2.76,109.09,-1.08,119.27,-0.57,130.23,0.08,136.19,0.74,142.16,1.09,151.89,2.25,157.04,3.56,161.63,-3.77,102.36,-3.15,111.75,-2.58,121.32,-2.32,131.97,-1.1,137.12,0.12,142.27,0.67,151.46,2.38,155.33,4.23,158.54]},{"value":[35.43,104.59,45.05,112.17,54.28,120.15,59.86,131.62,61.48,138.22,61.27,143.41,59.99,151.52,55.23,153.05,50.09,153.78,31.78,104.59,40.79,111.42,49.44,118.69,54.91,130.03,56.56,138.41,56.33,144.73,55.05,152.75,50.65,155.18,45.85,156.87,28.36,104.59,36.8,110.71,44.91,117.33,50.29,128.54,51.97,138.62,51.73,146.01,50.43,153.87,46.37,157.13,41.89,159.72,26.95,104.4,35,110.57,42.99,117.18,47.99,128.16,49.62,138.61,49.54,146.33,48.25,153.92,44.33,157.57,40.29,160.63,25.13,102.35,31.72,110.37,38.01,118.71,41.32,129.53,42.49,138.1,42.68,145.12,42.04,153.52,40.03,158.32,37.86,162.57,23.32,100.3,28.45,110.19,33.04,120.23,34.66,130.9,35.37,137.6,35.83,143.91,35.83,153.13,35.74,159.05,35.44,164.51,22.93,100.89,27.24,110.86,31.52,120.93,32.7,131.47,33.38,137.52,34.05,143.58,34.14,153.08,34.26,158.77,34.55,163.96,23.54,103.95,26.05,113.31,28.56,122.82,29.31,133.09,30.24,138.38,31.18,143.67,31.49,152.72,32.37,157.2,33.41,161.11,24.24,107.26,24.86,115.97,25.43,124.87,25.68,134.83,26.9,139.31,28.12,143.78,28.67,152.29,30.38,155.49,32.23,158.02]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.06","timeline":[{"name":"B_BROW.06_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.06_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_BROW.06_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.06_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_BROW.06_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_00","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-34.58,-117.44,-33.35,-118.91,-32.21,-119.67,-31.44,-113.49,-30.25,-103.6,-29.64,-94.27,-30.1,-85.69,-32.1,-75.33,-34.26,-64.76,-40.57,-117.75,-39.2,-118.12,-37.84,-117.88,-36.79,-111.79,-35.49,-103.41,-34.54,-95.39,-35.37,-87.15,-37.94,-77.93,-40.41,-68.59,-46.14,-118.03,-44.65,-117.37,-43.09,-116.19,-41.78,-110.23,-40.53,-103.32,-39.41,-96.56,-40.55,-88.63,-43.47,-80.52,-46.12,-72.4,-47.32,-118.08,-45.91,-117.06,-44.38,-115.58,-43.14,-109.84,-42.77,-104.05,-42.39,-98.25,-43.51,-90.63,-45.64,-83.51,-47.84,-76.48,-41.66,-117.77,-40.92,-116.75,-40.16,-115.25,-39.46,-109.46,-39,-104.78,-38.55,-100.11,-39.72,-92.97,-42.09,-86.6,-44.55,-80.33,-36,-117.46,-35.93,-116.45,-35.93,-114.92,-35.75,-109.16,-34.96,-105.87,-34.16,-102.58,-35.39,-95.63,-38.07,-89.42,-40.85,-83.34,-35.17,-117.21,-35.15,-116.19,-35.14,-114.65,-35.11,-108.96,-34.8,-107.17,-34.49,-105.39,-35.44,-98.88,-37.49,-93.57,-39.68,-88.44,-32.9,-116.36,-32.82,-115.27,-32.75,-113.67,-32.71,-108.17,-32.53,-108.3,-32.35,-108.43,-32.87,-102.26,-34.1,-97.67,-35.41,-93.34,-30.41,-115.43,-30.25,-114.27,-30.11,-112.61,-30.07,-107.31,-29.92,-109.42,-29.77,-111.53,-29.86,-105.65,-30.29,-101.71,-30.76,-98.08]},{"duration":60,"tweenEasing":0,"value":[3.75,-114.78,3.75,-116.24,3.75,-117,3.75,-111.79,3.75,-108.27,3.74,-104.74,3.3,-96.91,1.59,-87.4,-0.26,-77.76,2.08,-114.77,2.35,-115.42,2.62,-115.41,2.75,-109.91,3.31,-106.1,3.87,-102.3,3.7,-94.94,2.81,-86.98,1.77,-78.99,0.51,-114.77,1.03,-114.64,1.55,-113.92,1.79,-108.16,2.87,-104.11,3.95,-100.05,4.03,-93.1,3.9,-86.58,3.61,-80.13,-0.11,-114.83,0.46,-114.4,1.02,-113.42,1.27,-107.73,2.46,-103.6,3.65,-99.46,3.76,-92.45,3.73,-86.36,3.65,-80.42,0.67,-115.44,0.98,-114.74,1.26,-113.5,1.42,-107.73,2.33,-103.59,3.24,-99.46,3.18,-92.44,2.61,-86.36,1.99,-80.42,1.46,-116.04,1.5,-115.08,1.51,-113.59,1.57,-107.73,2.2,-103.59,2.83,-99.45,2.6,-92.44,1.49,-86.36,0.33,-80.42,0.84,-116.1,0.93,-115.01,0.98,-113.41,1.04,-107.53,1.65,-103.81,2.25,-100.09,2.03,-93.06,0.97,-86.76,-0.07,-80.56,-0.74,-116.1,-0.39,-114.75,-0.1,-112.92,0.03,-107.11,0.64,-104.66,1.25,-102.22,1.15,-95.12,0.6,-88.1,0.06,-81.13,-2.41,-116.1,-1.79,-114.47,-1.22,-112.38,-1.02,-106.68,-0.42,-105.59,0.19,-104.5,0.25,-97.33,0.24,-89.54,0.24,-81.75]},{"value":[29.76,-113.28,32.22,-115.38,34.5,-116.77,35.11,-112.13,35.41,-108.47,35.71,-104.81,35.08,-98.3,32.51,-92.43,29.73,-86.65,28.08,-113.28,31.63,-114.83,35.01,-115.71,36.25,-110.86,37.28,-107,37.88,-103.14,37.69,-96.57,36.7,-90.55,35.47,-84.64,26.51,-113.28,31.07,-114.31,35.45,-114.72,37.3,-109.69,39,-105.64,39.85,-101.59,40.05,-94.96,40.51,-88.83,40.73,-82.79,25.89,-113.33,30.48,-114.12,34.94,-114.31,37.03,-109.34,39,-105.27,39.82,-101.2,40.05,-94.6,40.75,-88.35,41.51,-82.17,26.68,-113.94,29.14,-114.19,31.42,-113.85,33.03,-108.78,35.56,-105.04,36.9,-101.31,37.16,-94.52,37.79,-87.57,38.49,-80.64,27.46,-114.55,27.79,-114.25,27.9,-113.41,29.02,-108.21,32.12,-104.81,33.97,-101.41,34.26,-94.45,34.83,-86.8,35.46,-79.12,26.84,-114.6,26.94,-114.14,26.98,-113.18,27.88,-107.99,30.79,-104.7,32.74,-101.41,33.04,-94.46,33.52,-86.65,33.94,-78.79,25.27,-114.6,25.61,-113.88,25.9,-112.68,26.48,-107.44,28.57,-104.34,30.19,-101.24,30.33,-94.24,30.31,-86.2,30.22,-78.08,23.59,-114.6,24.21,-113.61,24.78,-112.15,25.03,-106.85,26.25,-103.95,27.47,-101.05,27.43,-94,26.86,-85.7,26.24,-77.3]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_01","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-33.79,-58.72,-33.17,-59.45,-32.6,-59.83,-32.24,-56.6,-31.88,-50.05,-31.8,-43.79,-32.05,-39.13,-33.05,-33.09,-34.13,-26.88,-36.79,-58.87,-36.6,-59.16,-36.44,-59.14,-36.05,-55.95,-35.42,-50.22,-34.96,-44.66,-35.38,-40.19,-36.66,-34.81,-37.9,-29.33,-39.57,-59.02,-39.81,-58.88,-40.01,-58.48,-39.6,-55.38,-38.79,-50.49,-38.06,-45.66,-38.61,-41.36,-40.07,-36.63,-41.4,-31.85,-40.16,-59.04,-40.53,-58.75,-40.81,-58.21,-40.44,-55.33,-40.04,-51.53,-39.63,-47.73,-40.19,-43.72,-41.33,-39.69,-42.45,-35.68,-37.33,-58.88,-37.54,-58.49,-37.69,-57.85,-37.47,-55.01,-37.13,-52.42,-36.78,-49.84,-37.36,-46.31,-38.54,-43.26,-39.71,-40.29,-34.5,-58.73,-34.55,-58.24,-34.57,-57.48,-34.48,-54.65,-34.07,-53.17,-33.67,-51.7,-34.23,-48.47,-35.37,-46.2,-36.55,-44.06,-33.59,-58.5,-33.62,-58.02,-33.63,-57.27,-33.62,-54.54,-33.49,-54.37,-33.36,-54.2,-33.79,-51.42,-34.63,-50.1,-35.57,-48.98,-30.53,-57.64,-30.62,-57.22,-30.7,-56.54,-30.72,-53.95,-30.75,-55.2,-30.78,-56.45,-31.06,-53.93,-31.67,-53.28,-32.36,-52.88,-27.2,-56.71,-27.36,-56.37,-27.5,-55.75,-27.55,-53.31,-27.71,-55.96,-27.86,-58.61,-27.99,-56.32,-28.41,-56.27,-28.88,-56.54]},{"duration":60,"tweenEasing":0,"value":[1.88,-57.39,1.88,-58.12,1.87,-58.5,1.87,-55.9,1.87,-54.13,1.87,-52.37,1.65,-48.45,0.8,-43.7,-0.13,-38.88,1.04,-57.39,1.17,-57.71,1.31,-57.7,1.37,-54.95,1.65,-53.05,1.94,-51.15,1.85,-47.47,1.41,-43.49,0.88,-39.5,0.25,-57.39,0.51,-57.32,0.77,-56.95,0.89,-54.08,1.44,-52.05,1.98,-50.03,2.02,-46.55,1.95,-43.29,1.81,-40.06,-0.05,-57.41,0.23,-57.2,0.51,-56.71,0.64,-53.87,1.23,-51.8,1.83,-49.73,1.88,-46.22,1.87,-43.18,1.82,-40.21,0.34,-57.72,0.49,-57.37,0.63,-56.75,0.71,-53.87,1.17,-51.8,1.62,-49.73,1.59,-46.22,1.3,-43.18,0.99,-40.21,0.73,-58.02,0.75,-57.54,0.75,-56.79,0.78,-53.86,1.1,-51.8,1.42,-49.73,1.3,-46.22,0.74,-43.18,0.17,-40.21,0.42,-58.05,0.47,-57.5,0.49,-56.71,0.52,-53.77,0.82,-51.9,1.13,-50.04,1.02,-46.53,0.49,-43.38,-0.04,-40.28,-0.37,-58.05,-0.19,-57.38,-0.05,-56.46,0.02,-53.56,0.32,-52.33,0.62,-51.11,0.58,-47.56,0.3,-44.05,0.03,-40.56,-1.2,-58.05,-0.9,-57.24,-0.61,-56.19,-0.51,-53.34,-0.21,-52.79,0.1,-52.25,0.12,-48.67,0.12,-44.77,0.12,-40.87]},{"value":[26.21,-55.89,27.44,-57.26,28.58,-58.27,28.89,-56.26,29.04,-54.75,29.19,-53.24,28.87,-50.3,27.59,-47.68,26.2,-45.11,25.38,-55.89,27.15,-56.98,28.84,-57.74,29.46,-55.63,29.97,-54.02,30.27,-52.4,30.18,-49.43,29.68,-46.74,29.06,-44.1,24.59,-55.89,26.87,-56.72,29.06,-57.24,29.98,-55.05,30.83,-53.34,31.26,-51.63,31.36,-48.63,31.59,-45.88,31.7,-43.17,24.28,-55.92,26.58,-56.63,28.8,-57.04,29.85,-54.87,30.83,-53.15,31.24,-51.43,31.36,-48.45,31.71,-45.64,32.09,-42.86,24.67,-56.22,25.9,-56.66,27.04,-56.81,27.85,-54.59,29.11,-53.04,29.78,-51.49,29.91,-48.41,30.23,-45.25,30.57,-42.1,25.06,-56.52,25.23,-56.69,25.28,-56.59,25.84,-54.3,27.39,-52.92,28.32,-51.54,28.46,-48.37,28.75,-44.86,29.06,-41.34,24.76,-56.55,24.8,-56.64,24.82,-56.47,25.27,-54.19,26.73,-52.86,27.7,-51.53,27.85,-48.38,28.09,-44.79,28.3,-41.17,23.97,-56.55,24.14,-56.51,24.29,-56.22,24.58,-53.92,25.62,-52.68,26.43,-51.45,26.5,-48.27,26.48,-44.56,26.44,-40.82,23.13,-56.55,23.44,-56.37,23.72,-55.96,23.85,-53.62,24.46,-52.49,25.07,-51.36,25.05,-48.15,24.76,-44.31,24.45,-40.43]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_02","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-33,0,-33,0,-33,0,-33.04,0.3,-33.5,3.5,-33.96,6.7,-34,7.44,-34,9.15,-34,11,-33,0,-34.01,-0.21,-35.04,-0.4,-35.32,-0.12,-35.35,2.97,-35.39,6.06,-35.39,6.78,-35.39,8.29,-35.39,9.94,-33,0,-34.96,-0.4,-36.93,-0.77,-37.42,-0.54,-37.06,2.35,-36.71,5.24,-36.67,5.91,-36.67,7.25,-36.67,8.7,-33,0,-35.15,-0.44,-37.24,-0.84,-37.74,-0.82,-37.31,0.98,-36.87,2.79,-36.87,3.19,-37.01,4.13,-37.07,5.13,-33,0,-34.16,-0.23,-35.23,-0.44,-35.48,-0.55,-35.25,-0.06,-35.02,0.43,-35,0.36,-34.99,0.07,-34.88,-0.25,-33,0,-33.16,-0.03,-33.21,-0.05,-33.21,-0.13,-33.19,-0.48,-33.17,-0.82,-33.07,-1.31,-32.67,-2.98,-32.26,-4.79,-32.02,0.22,-32.09,0.16,-32.12,0.1,-32.13,-0.11,-32.18,-1.56,-32.23,-3.02,-32.14,-3.96,-31.77,-6.63,-31.45,-9.52,-28.17,1.07,-28.43,0.82,-28.65,0.58,-28.73,0.26,-28.97,-2.1,-29.22,-4.47,-29.24,-5.61,-29.25,-8.88,-29.31,-12.42,-24,2,-24.46,1.54,-24.89,1.11,-25.04,0.7,-25.5,-2.5,-25.96,-5.7,-26.11,-6.98,-26.54,-10.83,-27,-15]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[22.67,1.49,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.67,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.49,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.67,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.24,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.92,22.66,-3.56]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_03","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-39.23,76.64,-39.22,70,-39.22,63.37,-39.7,59.44,-40.98,58.58,-42.78,54.58,-45.02,48.02,-46.65,39.13,-48.23,29.98,-39.85,76.93,-40.19,70.48,-40.53,64.02,-40.88,59.29,-41.32,57.09,-42.31,53.1,-44.54,46.09,-46.44,37.07,-48.28,27.88,-40.4,77.2,-41.05,70.92,-41.7,64.63,-41.92,59.05,-41.6,55.44,-41.85,51.4,-44.08,43.92,-46.24,34.77,-48.33,25.55,-40.1,77.24,-40.83,71.04,-41.53,64.82,-41.65,58.47,-41.21,53.12,-41.28,48.19,-43.52,40.22,-45.94,30.63,-48.19,21.01,-38.58,76.95,-39.07,70.93,-39.53,64.88,-39.59,58.48,-39.13,52.01,-38.96,45.78,-40.87,37.39,-42.8,26.44,-44.6,15.3,-37.05,76.66,-37.31,70.83,-37.53,64.95,-37.56,58.52,-37.36,51,-37.23,43.55,-38.81,34.6,-40.15,22.06,-41.43,9.18,-35.51,76.85,-35.77,70.88,-35.99,64.89,-36.05,58.28,-36.13,49.34,-36.21,40.41,-37.42,30.52,-38.79,16.97,-39.98,3.11,-31.21,77.7,-31.57,71.25,-31.88,64.81,-31.98,57.99,-32.13,48,-32.28,38.01,-32.83,27.26,-33.7,13.18,-34.49,-1.15,-26.59,78.62,-27.05,71.66,-27.47,64.74,-27.6,57.71,-27.83,46.73,-28.07,35.75,-27.94,24.19,-28.23,9.57,-28.59,-5.21]},{"duration":60,"tweenEasing":0,"value":[-7.23,76.64,-7.22,70,-7.22,63.37,-8.69,58.52,-11.61,53.83,-13.78,46.85,-17.51,38.36,-20.46,26.58,-23.23,14.48,-6.7,76.93,-6.73,70.58,-6.76,64.22,-7.72,58.81,-10.09,53.28,-12.52,46.34,-16.17,37.68,-19.2,26.26,-22.12,14.59,-6.17,77.2,-6.23,71.12,-6.3,65.01,-6.76,59.03,-8.59,52.67,-11.32,45.79,-14.9,36.94,-18.01,25.83,-21.1,14.57,-5.71,77.24,-5.79,71.26,-5.86,65.24,-6,58.83,-7.65,51.94,-10.55,45.11,-13.95,36.12,-17.21,24.99,-20.38,13.76,-5.33,76.95,-5.47,71.05,-5.61,65.1,-5.73,58.7,-6.78,51.66,-8.56,44.66,-11.19,35.71,-13.74,24.17,-16.22,12.43,-4.95,76.66,-5.16,70.84,-5.36,64.97,-5.45,58.57,-5.92,51.38,-6.57,44.21,-8.43,35.31,-10.26,23.34,-12.07,11.1,-4.5,76.63,-4.69,70.73,-4.87,64.79,-4.96,58.41,-5.4,51.13,-5.83,43.85,-7.17,34.63,-8.91,22.83,-10.42,10.84,-4.04,76.62,-4.14,70.44,-4.24,64.23,-4.27,57.74,-4.39,50.22,-4.51,42.69,-5.05,32.94,-5.9,21.65,-6.64,10.34,-3.59,76.62,-3.59,70.13,-3.58,63.63,-3.56,57.02,-3.33,49.23,-3.11,41.44,-2.83,31.17,-2.69,20.4,-2.59,9.79]},{"value":[15.44,78.14,15.44,70.86,15.45,63.6,13.98,58.12,11.06,52.8,8.89,45.18,5.15,36.06,2.2,23.65,-0.57,10.92,15.97,78.43,15.94,71.44,15.91,64.45,14.95,58.41,12.58,52.25,10.14,44.68,6.49,35.39,3.47,23.33,0.54,11.03,16.49,78.7,16.43,71.98,16.37,65.25,15.91,58.63,14.07,51.64,11.35,44.13,7.77,34.64,4.65,22.9,1.56,11.01,16.96,78.74,16.88,72.12,16.81,65.47,16.66,58.43,15.02,50.91,12.12,43.45,8.71,33.83,5.45,22.07,2.28,10.2,17.34,78.45,17.19,71.91,17.06,65.34,16.94,58.3,15.88,50.63,14.11,43,11.47,33.42,8.92,21.24,6.44,8.87,17.72,78.15,17.51,71.7,17.31,65.2,17.22,58.17,16.75,50.35,16.1,42.55,14.23,33.01,12.4,20.41,10.59,7.54,18.17,78.13,17.98,71.59,17.79,65.02,17.7,58.01,17.27,50.1,16.83,42.19,15.49,32.34,13.75,19.9,12.25,7.29,18.63,78.12,18.53,71.3,18.43,64.46,18.4,57.34,18.28,49.19,18.16,41.03,17.61,30.65,16.76,18.72,16.02,6.78,19.08,78.12,19.08,70.99,19.08,63.87,19.11,56.62,19.33,48.2,19.55,39.78,19.84,28.88,19.97,17.48,20.07,6.24]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_04","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-45.45,153.29,-45.45,140,-45.44,126.73,-46.34,118.58,-48.09,113.79,-49.6,103.14,-52.08,90.24,-55.24,71.46,-58.46,51.95,-46.71,153.87,-46.37,141.16,-46.01,128.44,-46.45,118.71,-47.15,111.47,-47.67,100.92,-49.8,86.87,-52.43,67.71,-55.16,48.04,-47.8,154.4,-47.14,142.24,-46.47,130.03,-46.46,118.67,-46.21,108.92,-45.84,98.44,-47.65,83.26,-49.84,63.73,-52.13,43.91,-47.2,154.48,-46.5,142.52,-45.81,130.48,-45.58,117.8,-45.05,105.73,-44.46,94.51,-46.25,78.55,-48.71,58.46,-51.12,38.16,-44.15,153.9,-43.99,142.1,-43.83,130.21,-43.64,117.54,-42.07,104.32,-40.45,91.6,-42.14,75.3,-44.88,53.62,-47.66,31.52,-41.11,153.31,-41.47,141.68,-41.85,129.94,-41.76,117.18,-39.71,102.5,-37.66,87.95,-39.28,70.97,-42.33,47.4,-45.46,23.2,-39.01,153.47,-39.46,141.61,-39.87,129.68,-39.83,116.66,-38.3,100.25,-36.78,83.84,-38.08,65.33,-41.15,40.78,-44.05,15.74,-34.25,154.32,-34.71,141.69,-35.12,129.04,-35.15,115.71,-34.36,98.1,-33.57,80.49,-34.04,60.28,-35.73,35.34,-37.35,10.12,-29.18,155.24,-29.63,141.79,-30.06,128.37,-30.16,114.73,-30.17,95.96,-30.18,77.19,-29.76,55.36,-29.92,29.97,-30.18,4.59]},{"duration":60,"tweenEasing":0,"value":[-14.45,153.29,-14.45,140,-14.44,126.73,-17.37,117.05,-23.22,107.67,-27.55,93.69,-35.02,76.71,-40.92,53.16,-46.46,28.95,-13.39,153.87,-13.45,141.16,-13.52,128.44,-15.44,117.62,-20.17,106.56,-25.05,92.69,-32.36,75.37,-38.39,52.53,-44.24,29.19,-12.35,154.4,-12.47,142.24,-12.59,130.03,-13.51,118.06,-17.19,105.35,-22.64,91.59,-29.81,73.87,-36.02,51.68,-42.2,29.15,-11.42,154.48,-11.58,142.52,-11.72,130.48,-12,117.66,-15.29,103.89,-21.09,90.22,-27.92,72.26,-34.42,49.99,-40.76,27.51,-10.65,153.9,-10.95,142.1,-11.22,130.21,-11.45,117.38,-13.57,103.33,-17.12,89.34,-22.38,71.42,-27.48,48.34,-32.45,24.86,-9.89,153.31,-10.32,141.68,-10.72,129.94,-10.9,117.13,-11.84,102.77,-13.13,88.43,-16.85,70.58,-20.53,46.67,-24.14,22.2,-9,153.25,-9.37,141.45,-9.75,129.57,-9.93,116.82,-10.79,102.26,-11.66,87.7,-14.33,69.26,-17.82,45.64,-20.83,21.69,-8.09,153.25,-8.28,140.87,-8.47,128.46,-8.54,115.48,-8.78,100.43,-9.01,85.39,-10.1,65.86,-11.81,43.31,-13.28,20.68,-7.18,153.24,-7.17,140.25,-7.17,127.26,-7.12,114.03,-6.67,98.46,-6.22,82.89,-5.65,62.34,-5.38,40.81,-5.18,19.59]},{"value":[8.22,154.78,8.22,140.86,8.23,126.96,5.29,116.64,-0.55,106.63,-4.89,92.03,-12.36,74.41,-18.25,50.23,-23.8,25.39,9.27,155.36,9.21,142.02,9.15,128.67,7.23,117.22,2.49,105.53,-2.38,91.03,-9.7,73.07,-15.73,49.6,-21.58,25.63,10.32,155.9,10.2,143.11,10.08,130.26,9.15,117.66,5.48,104.31,0.03,89.92,-7.14,71.57,-13.35,48.75,-19.54,25.59,11.25,155.98,11.09,143.38,10.95,130.71,10.66,117.26,7.38,102.85,1.57,88.56,-5.25,69.97,-11.76,47.06,-18.1,23.95,12.01,155.39,11.72,142.96,11.45,130.44,11.21,116.98,9.1,102.3,5.55,87.67,0.28,69.13,-4.81,45.41,-9.79,21.3,12.78,154.81,12.35,142.54,11.95,130.17,11.77,116.73,10.83,101.74,9.53,86.76,5.81,68.29,2.14,43.74,-1.48,18.64,13.67,154.75,13.3,142.32,12.92,129.81,12.74,116.42,11.87,101.23,11,86.04,8.33,66.97,4.84,42.72,1.83,18.13,14.58,154.75,14.39,141.74,14.19,128.69,14.12,115.08,13.89,99.4,13.65,83.72,12.57,63.57,10.85,40.39,9.38,17.12,15.49,154.74,15.5,141.12,15.5,127.5,15.55,113.63,16,97.43,16.45,81.23,17.01,60.05,17.28,37.88,17.49,16.03]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_MOUTH.03","timeline":[{"name":"B_MOUTH.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_MOUTH.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_MOUTH.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_MOUTH.03_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_MOUTH.03_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_00","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32,-44.57,-32.46,-64.72,-32.89,-84.59,-33,-99.68,-32.87,-104.31,-32.32,-91.74,-31.99,-83.25,-31.98,-83.12,-31.98,-82.63,-31.82,-37.67,-32.4,-57.7,-33.01,-77.4,-33.67,-92,-34.58,-97.6,-34.33,-88.73,-33.72,-82.11,-32.89,-82.55,-31.98,-82.74,-31.71,-30.71,-32.36,-50.68,-33.08,-70.3,-34.27,-84.45,-36.26,-90.94,-36.36,-85.62,-35.47,-80.82,-33.81,-81.9,-31.98,-82.83,-31.39,-22.18,-32.03,-42.7,-32.57,-62.68,-34.23,-77.3,-37.02,-84.38,-37.52,-81.96,-36.32,-79.39,-33.9,-81.71,-31.15,-84.01,-25.49,-13.91,-26.99,-34.4,-28.46,-53.92,-30.86,-69.71,-33.71,-77.89,-34.61,-78.78,-32.74,-79.84,-28.61,-84.37,-24.27,-89.03,-17.89,-6.68,-20.37,-26.77,-22.86,-45.41,-26.13,-61.98,-29.52,-71.17,-31.3,-75.21,-28.85,-80.12,-23.1,-87.35,-17.25,-94.81,-10.85,-0.13,-13.58,-20.27,-16.29,-39.17,-19.59,-56.33,-22.93,-67.38,-24.71,-74.98,-22.85,-82.15,-18.54,-91.12,-13.52,-100.54,-2.04,5.27,-4.7,-15.12,-7.33,-34.8,-10.27,-52.29,-13.02,-65,-14.09,-75.61,-12.51,-83.82,-8.27,-94.07,-3.42,-104.85,6.92,10.62,4.33,-10.02,1.8,-30.47,-0.78,-48.27,-2.92,-62.56,-3.25,-76.12,-1.86,-85.29,2.61,-96.81,7.46,-108.92]},{"duration":60,"tweenEasing":0,"value":[0.01,-50.84,-0.45,-67.84,-0.88,-84.72,-0.99,-98.45,-0.87,-104.08,-0.32,-92.51,0.01,-83.15,0.01,-81.96,0.01,-80.41,0.01,-45.72,-0.57,-62.51,-1.18,-79.18,-1.3,-92.66,-0.82,-98.75,-0.4,-89.8,-0.68,-82.12,-0.43,-80.76,0.01,-79.02,0.01,-40.74,-0.63,-57.32,-1.36,-73.76,-1.48,-86.96,-0.78,-93.45,-0.6,-86.98,-1.5,-80.99,-0.91,-79.57,0.01,-77.74,-1.1,-35.94,-1.15,-52.66,-0.86,-69.12,-0.78,-81.61,-0.81,-87.74,-1.53,-83.39,-2.61,-79.42,-1.51,-78.69,-0.16,-77.58,-0.99,-30.49,-1,-47.78,-0.53,-64.5,-0.59,-75.53,-1.56,-80.71,-2.73,-79.05,-3.44,-78.02,-2.84,-78.82,-1.99,-79.4,0.8,-27.54,0.07,-44.57,-0.53,-60.69,-1.09,-69.43,-2.86,-73.35,-4.37,-74,-4.62,-75.98,-4.29,-78.63,-3.82,-81.22,0.9,-26.47,0.05,-42.87,-0.78,-58.47,-1.25,-66.94,-2.95,-70.34,-4.32,-72.19,-4.34,-75.12,-3.95,-78.2,-3.55,-81.29,0.47,-24.92,-0.1,-40.87,-0.61,-56.37,-0.64,-65.98,-1.52,-69.22,-2.24,-71.69,-2.25,-74.7,-2.04,-77.78,-1.84,-80.87,0.01,-23.32,-0.26,-38.83,-0.41,-54.23,0.01,-64.99,0.01,-68.08,0.01,-71.16,0.01,-74.24,0.01,-77.33,0.01,-80.41]},{"value":[15.36,-43.16,20.87,-61.82,26.48,-80.15,31.89,-93.86,36.05,-98.62,39.78,-90.82,39.6,-86.39,35.46,-90.04,30.98,-93.74,18.93,-40.44,23.05,-58.22,27.04,-75.68,31.46,-89.48,35.87,-94.98,39.91,-88.33,39.81,-84,36.21,-86.81,32.53,-89.57,22.16,-37.85,25.06,-54.76,27.65,-71.48,31.14,-85.31,35.54,-91.47,39.63,-85.88,39.64,-81.6,36.76,-83.52,33.96,-85.31,21.79,-35.98,24.77,-52.69,28.36,-69.33,31.37,-82.42,34.09,-87.55,36.62,-82.27,36.74,-78.44,35.1,-79.67,33.52,-80.74,24.26,-33.43,25.42,-50.71,27.27,-67.4,28.72,-78.33,29.24,-80.14,29.83,-75.13,29.89,-73.9,29.28,-76.12,28.85,-78.3,28.69,-31.56,27.11,-48.96,25.62,-65.39,25.12,-73.72,23.68,-72.23,22.58,-67.47,22.77,-69.13,23.71,-72.89,24.73,-76.71,29.37,-30.53,27.62,-48.01,25.8,-64.62,25.1,-72.74,23.89,-68.45,23,-62.6,23.17,-65.16,24.1,-69.59,24.94,-74.14,29.51,-29.26,28.93,-46.71,28.3,-63.58,28.28,-72.68,27.98,-65.83,27.83,-58.2,27.77,-60.69,27.56,-65.44,27.23,-70.34,29.66,-27.98,30.32,-45.34,31.01,-62.46,31.71,-72.48,32.35,-63.08,32.99,-53.67,32.68,-56.09,31.25,-61.16,29.71,-66.4]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_01","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32.5,-20.81,-32.74,-32.46,-32.95,-43.89,-33.01,-52.12,-32.94,-53.94,-32.66,-47.15,-32.49,-43.34,-32.49,-43.8,-32.49,-44.09,-32.32,-16.52,-32.61,-28.1,-32.92,-39.45,-33.53,-47.35,-34.68,-49.92,-34.64,-45.51,-34.04,-42.87,-33.28,-43.93,-32.48,-44.89,-32.22,-12.13,-32.54,-23.72,-32.9,-35.04,-34.04,-42.64,-36.39,-45.93,-36.57,-43.82,-35.54,-42.32,-34.05,-43.99,-32.48,-45.63,-32.19,-6.24,-32.64,-18.46,-32.94,-30.32,-34.44,-38.43,-37.27,-42.23,-37.35,-41.86,-35.91,-41.67,-33.88,-44.24,-31.57,-46.88,-26.52,-0.18,-28.36,-12.61,-30.17,-24.43,-32.21,-33.75,-34.45,-38.71,-34.23,-40.21,-31.9,-42.29,-27.87,-46.56,-23.77,-51,-19.82,5.49,-23.02,-6.62,-26.22,-17.9,-28.78,-28.19,-30.6,-34.9,-30.3,-38.92,-27.21,-43.52,-21.53,-49.58,-15.84,-55.86,-14.53,11.96,-17.85,-0.5,-21.09,-12.21,-23.6,-23.4,-25.24,-32.83,-24.84,-40.35,-22.19,-46.59,-17.41,-53.89,-12.24,-61.57,-5.1,16.57,-8.18,3.63,-11.15,-8.78,-13.48,-20.38,-14.83,-31.78,-14,-41.92,-11.82,-48.9,-7.59,-57.25,-3,-66.08,4.75,20.95,1.94,7.56,-0.72,-5.55,-2.86,-17.48,-3.93,-30.73,-2.62,-43.38,-0.88,-51.02,2.88,-60.43,6.95,-70.39]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-25.42,-0.23,-33.92,-0.44,-42.36,-0.49,-49.22,-0.43,-52.04,-0.16,-46.26,0,-41.58,0,-40.98,0,-40.21,0,-22.86,-0.28,-31.26,-0.59,-39.59,-0.65,-46.34,-0.41,-49.4,-0.2,-44.92,-0.34,-41.06,-0.21,-40.38,0,-39.51,0,-20.37,-0.32,-28.66,-0.68,-36.88,-0.74,-43.49,-0.39,-46.76,-0.3,-43.51,-0.75,-40.49,-0.45,-39.78,0,-38.87,-0.55,-17.97,-0.58,-26.33,-0.43,-34.57,-0.39,-40.81,-0.41,-43.88,-0.76,-41.7,-1.31,-39.71,-0.75,-39.34,-0.08,-38.79,-0.5,-15.25,-0.51,-23.92,-0.27,-32.29,-0.29,-37.77,-0.78,-40.37,-1.37,-39.53,-1.72,-39.01,-1.42,-39.41,-1,-39.7,0.4,-13.77,0.03,-22.3,-0.27,-30.37,-0.54,-34.72,-1.43,-36.68,-2.19,-37,-2.31,-37.99,-2.14,-39.31,-1.91,-40.61,0.45,-13.24,0.02,-21.44,-0.39,-29.23,-0.63,-33.47,-1.47,-35.17,-2.16,-36.09,-2.17,-37.56,-1.97,-39.1,-1.78,-40.64,0.24,-12.46,-0.05,-20.43,-0.3,-28.18,-0.32,-32.99,-0.76,-34.61,-1.12,-35.84,-1.13,-37.35,-1.02,-38.89,-0.92,-40.43,0,-11.66,-0.13,-19.41,-0.21,-27.11,0,-32.5,0,-34.04,0,-35.58,0,-37.12,0,-38.66,0,-40.21]},{"value":[22.86,-17.24,26.85,-27.5,30.79,-37.52,33.79,-44.87,35.85,-50.15,37.71,-49.14,37.37,-47.49,34.3,-50.45,30.97,-53.53,24.11,-17.31,27.58,-26.82,30.89,-36.14,33.57,-43.32,35.77,-47.9,37.78,-46.4,37.37,-44.68,34.61,-47.18,31.75,-49.74,25.2,-17.43,28.24,-26.22,31.03,-34.91,33.4,-41.93,35.6,-45.77,37.64,-43.72,37.19,-41.87,34.82,-43.85,32.47,-45.85,24.73,-17.37,27.75,-26.2,31.13,-34.95,33.31,-41.62,34.64,-43.73,35.87,-40.61,35.4,-38.65,33.66,-39.98,32.01,-41.31,26,-16.87,27.19,-26.11,28.76,-35.02,29.82,-40.56,30.1,-39.82,30.42,-35.64,30.2,-34.85,29.53,-36.53,29.01,-38.27,28.4,-17.27,27.2,-26.38,26.03,-34.98,25.71,-39.01,25.14,-35.56,24.74,-30.48,24.9,-31.14,25.72,-33.56,26.57,-36.07,28.92,-17.29,27.59,-26.59,26.19,-35.41,25.73,-39.27,25.37,-33.28,25.16,-26.51,25.35,-27.6,26.07,-30.49,26.72,-33.5,29.27,-16.8,28.97,-26.28,28.6,-35.41,28.6,-39.69,28.74,-31.21,28.95,-22.35,28.9,-23.34,28.58,-26.55,28.15,-29.9,29.66,-16.31,30.45,-25.93,31.22,-35.34,31.71,-39.99,32.35,-29.04,32.99,-18.09,32.68,-18.96,31.25,-22.5,29.7,-26.19]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_02","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-33.01,2.94,-33.01,-0.21,-33.01,-3.2,-33.01,-4.56,-33,-3.56,-33,-2.56,-32.99,-3.43,-32.99,-4.49,-32.99,-5.55,-32.83,4.64,-32.83,1.49,-32.83,-1.5,-33.38,-2.68,-34.77,-2.19,-34.94,-2.27,-34.35,-3.64,-33.66,-5.32,-32.99,-7.05,-32.72,6.44,-32.72,3.23,-32.72,0.2,-33.81,-0.81,-36.51,-0.84,-36.78,-1.98,-35.61,-3.82,-34.29,-6.08,-32.99,-8.42,-33,9.7,-33.25,5.78,-33.3,2.06,-34.65,0.46,-37.53,0.02,-37.19,-1.71,-35.49,-3.96,-33.86,-6.78,-31.99,-9.76,-27.56,13.55,-29.73,9.2,-31.88,5.07,-33.56,2.26,-35.21,0.65,-33.86,-1.53,-31.05,-4.74,-27.13,-8.75,-23.28,-12.96,-21.76,17.67,-25.67,13.53,-29.59,9.61,-31.42,5.61,-31.68,1.43,-29.3,-2.59,-25.58,-6.92,-19.95,-11.81,-14.43,-16.92,-18.2,24.04,-22.13,19.27,-25.88,14.76,-27.61,9.53,-27.55,1.7,-24.97,-5.72,-21.54,-11.03,-16.27,-16.66,-10.96,-22.59,-8.15,27.86,-11.65,22.38,-14.96,17.23,-16.68,11.53,-16.64,1.44,-13.9,-8.24,-11.14,-13.99,-6.92,-20.44,-2.58,-27.31,2.58,31.28,-0.45,25.13,-3.25,19.37,-4.95,13.3,-4.93,1.1,-1.98,-10.65,0.1,-16.76,3.15,-24.04,6.45,-31.85]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[30.35,8.68,32.82,6.82,35.1,5.11,35.68,4.12,35.66,-1.67,35.65,-7.46,35.14,-8.58,33.13,-10.86,30.97,-13.32,29.29,5.81,32.11,4.57,34.76,3.44,35.67,2.85,35.66,-0.81,35.66,-4.47,34.93,-5.35,33.01,-7.55,30.98,-9.92,28.25,3,31.41,2.31,34.43,1.69,35.67,1.48,35.67,-0.04,35.66,-1.56,34.73,-2.14,32.88,-4.17,30.98,-6.38,27.67,1.23,30.73,0.3,33.9,-0.58,35.26,-0.81,35.18,0.13,35.11,1.06,34.07,1.13,32.21,-0.29,30.5,-1.88,27.75,-0.31,28.96,-1.5,30.26,-2.62,30.91,-2.78,30.96,0.55,31.01,3.88,30.5,4.19,29.77,3.06,29.17,1.77,28.11,-2.99,27.29,-3.79,26.43,-4.54,26.3,-4.29,26.6,1.11,26.89,6.52,27.03,6.84,27.72,5.76,28.4,4.57,28.47,-4.06,27.57,-5.16,26.57,-6.19,26.35,-5.8,26.84,1.89,27.33,9.58,27.52,9.96,28.04,8.61,28.5,7.14,29.04,-4.34,29.02,-5.85,28.91,-7.24,28.92,-6.69,29.5,3.4,30.07,13.49,30.02,14.01,29.6,12.34,29.07,10.53,29.66,-4.65,30.58,-6.51,31.43,-8.23,31.7,-7.49,32.34,5,32.98,17.49,32.68,18.16,31.25,16.17,29.7,14.01]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_03","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32.38,57.84,-32.3,54.57,-32.23,51.34,-32.32,51.86,-32.62,56.25,-32.91,55.57,-32.95,47.5,-32.66,37.04,-32.34,26.5,-32.43,58.87,-32.39,54.94,-32.35,51.12,-32.88,52.34,-33.99,56.63,-34.19,54.07,-33.76,44.68,-33.19,33.15,-32.77,21.72,-32.54,60.04,-32.52,55.4,-32.52,50.92,-33.49,52.72,-35.48,56.67,-35.65,52.04,-34.71,41.44,-33.77,29.11,-33.16,17.04,-32.83,63.1,-33.11,56.92,-33.19,50.96,-34.38,51.82,-36.48,54.77,-36.11,48.76,-34.52,37.47,-32.92,24.75,-31.63,12.28,-27.1,66.46,-29.49,59.2,-31.92,52.24,-33.57,50.41,-34.52,50.63,-32.87,44.36,-30.1,32.83,-26.44,19.65,-22.97,6.5,-21.28,69.68,-25.53,62.32,-29.83,55.27,-31.73,50.83,-31.48,46.57,-28.64,38.67,-24.96,26.76,-19.98,13.42,-14.74,-0.11,-17.87,75.57,-22.02,67.11,-25.94,59.05,-27.67,52.44,-26.95,43.35,-23.64,32.28,-20.19,19.51,-15.93,5.69,-11.15,-8.44,-7.68,78.86,-11.39,69.29,-14.89,60.21,-16.61,52.59,-16.13,40.44,-12.85,27.2,-9.87,13.99,-6.4,-0.34,-2.62,-14.95,3.2,81.71,-0.05,71.08,-3.06,61.04,-4.81,52.54,-4.64,37.46,-1.44,22.21,1.1,8.64,3.78,-6.17,6.59,-21.24]},{"duration":60,"tweenEasing":0,"value":[-0.04,55.66,0.04,55.53,0.12,55.29,0.02,57.17,-0.28,60.56,-0.58,58.88,-1,51.63,-2.21,42.01,-3.52,32.31,-0.27,54.98,-0.22,54.21,-0.18,53.37,-0.26,55.93,-0.51,60.1,-0.77,57.6,-1.27,49.37,-2.46,39.05,-3.83,28.78,-0.48,54.35,-0.47,52.91,-0.46,51.46,-0.52,54.59,-0.87,59.3,-1.2,55.75,-1.76,46.65,-2.77,35.87,-4.12,25.27,-0.5,54.15,-0.53,51.88,-0.55,49.65,-0.61,52.44,-1.1,56.75,-1.56,52.55,-2.03,43.12,-2.58,32.18,-3.63,21.68,-0.21,53.66,-0.44,50.74,-0.71,47.9,-0.8,49.04,-0.84,51.43,-0.83,47.61,-0.99,38.83,-1.12,27.94,-1.61,18,-0.19,52.76,-0.53,49.53,-0.91,46.41,-0.99,45.99,-0.6,46.09,-0.15,42.34,-0.09,34.23,-0.06,23.54,-0.15,14.33,-0.34,52.28,-0.56,48.58,-0.73,45.03,-0.77,43.61,-0.62,42.16,-0.43,38.42,-0.28,30.94,-0.08,20.39,0.08,11.01,-0.19,51.75,-0.42,47.65,-0.59,43.72,-0.63,41.74,-0.46,39.32,-0.27,35.76,-0.08,28.95,0.23,18.52,0.51,8.53,-0.04,51.18,-0.27,46.7,-0.48,42.42,-0.51,39.92,-0.29,36.56,-0.06,33.19,0.19,27.05,0.58,16.72,0.98,6.11]},{"value":[30.31,64.33,33.17,62.2,35.81,60.1,36.34,60.98,35.72,58.73,35.1,51.41,34.13,43.05,30.92,31.15,27.45,18.98,30.93,60.9,33.87,58.77,36.51,56.69,37.24,58.61,36.1,59.2,34.97,53.12,33.66,44,30.54,31.49,27.15,18.86,31.28,57.47,34.37,55.3,37.11,53.19,38.06,56.02,36.32,59.22,34.59,54.19,32.97,44.49,30.1,31.69,26.87,18.88,30.23,54.59,33.46,51.7,36.74,48.88,37.92,51.63,35.79,56.91,33.7,53.62,32.05,44.25,29.63,31.89,26.87,19.8,29.29,52.55,30.79,48.65,32.29,44.89,32.84,46.04,31.55,51.9,30.3,51.5,29.51,43.01,28.65,31,27.56,19.76,28.07,49.69,27.78,45.48,27.38,41.45,27.3,41.24,27.04,46.97,26.83,48.84,26.93,41.07,27.66,29.31,28.25,18.9,28.13,48.22,27.78,43.23,27.42,38.46,27.29,37.39,27.11,43.83,26.98,47.98,27.23,40.9,27.97,29,28.58,18.16,28.85,47.41,29.01,41.7,29.13,36.29,29.18,34.83,29.5,42.61,29.84,49.23,29.95,42.95,29.83,30.86,29.59,19.06,29.62,46.53,30.31,40.19,30.94,34.19,31.19,32.43,32.06,41.56,32.93,50.68,32.86,45.21,31.82,32.89,30.68,20.12]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_04","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-31.75,112.75,-31.59,109.35,-31.44,105.88,-31.63,108.29,-32.23,116.06,-32.83,113.71,-33.09,99.58,-33.22,84.21,-33.36,69.06,-32.04,113.1,-31.94,108.4,-31.86,103.74,-32.38,107.41,-33.2,116.05,-33.44,111.59,-33.61,95.77,-33.86,77.73,-34.08,59.8,-32.36,113.64,-32.33,107.56,-32.31,101.63,-33.16,106.31,-34.43,115.3,-34.53,108.32,-34.53,90.95,-34.58,70.67,-34.69,50.39,-32.67,116.51,-32.98,108.06,-33.07,99.88,-34.11,103.16,-35.43,110.63,-35.04,101.65,-34.32,83.2,-33.19,61.6,-32.24,39.84,-26.63,119.36,-29.24,109.22,-31.96,99.43,-33.59,98.55,-33.82,101.2,-31.87,91.53,-29.6,72.92,-26.54,51.46,-23.35,29.74,-20.8,121.69,-25.39,111.12,-30.07,100.94,-32.03,96.01,-31.27,91.75,-27.98,80.06,-24.44,60.92,-20.24,39.44,-15.23,17.66,-17.54,127.1,-21.9,114.96,-26.01,103.35,-27.72,95.35,-26.35,85.01,-22.31,70.28,-18.86,50.03,-15.56,28.03,-11.34,5.72,-7.21,129.87,-11.14,116.19,-14.81,103.19,-16.55,93.65,-15.62,79.45,-11.81,62.64,-8.61,41.95,-5.88,19.76,-2.66,-2.59,3.83,132.15,0.34,117.02,-2.88,102.71,-4.66,91.77,-4.36,73.83,-0.9,55.08,2.11,34.04,4.42,11.7,6.74,-10.63]},{"duration":60,"tweenEasing":0,"value":[-0.08,111.31,0.09,111.06,0.24,110.57,0.04,114.35,-0.56,121.12,-1.16,117.77,-2.01,103.26,-4.42,84.02,-7.04,64.61,-0.54,109.95,-0.45,108.41,-0.36,106.74,-0.51,111.89,-1.03,120.28,-1.53,115.22,-2.55,98.73,-4.94,78.09,-7.66,57.56,-0.97,108.7,-0.94,105.83,-0.92,102.93,-1.04,109.23,-1.74,118.71,-2.41,111.55,-3.52,93.29,-5.56,71.73,-8.24,50.54,-1.01,108.3,-1.06,103.77,-1.1,99.3,-1.22,104.92,-2.2,113.59,-3.13,105.12,-4.05,86.23,-5.19,64.38,-7.26,43.35,-0.41,107.31,-0.87,101.49,-1.42,95.82,-1.6,98.14,-1.67,102.97,-1.66,95.25,-1.98,77.63,-2.25,55.91,-3.22,36,-0.38,105.52,-1.07,99.07,-1.82,92.83,-1.99,91.99,-1.2,92.2,-0.3,84.68,-0.19,68.46,-0.12,47.09,-0.3,28.67,-0.67,104.55,-1.13,97.17,-1.46,90.07,-1.54,87.21,-1.24,84.3,-0.85,76.83,-0.57,61.89,-0.15,40.78,0.17,22.03,-0.39,103.5,-0.83,95.3,-1.19,87.44,-1.25,83.48,-0.92,78.64,-0.54,71.51,-0.15,57.9,0.46,37.04,1.03,17.05,-0.08,102.37,-0.54,93.39,-0.97,84.84,-1.03,79.85,-0.57,73.11,-0.11,66.37,0.37,54.1,1.15,33.45,1.95,12.21]},{"value":[30.28,119.99,33.52,117.57,36.52,115.09,37,117.83,35.77,119.12,34.54,110.29,33.13,94.67,28.71,73.17,23.93,51.29,32.58,115.99,35.64,112.96,38.26,109.95,38.8,114.4,36.54,119.28,34.29,110.73,32.38,93.35,28.03,70.5,23.31,47.64,34.31,111.95,37.32,108.28,39.78,104.69,40.45,110.61,36.97,118.59,33.52,109.97,31.22,91.12,27.27,67.51,22.75,44.15,32.79,107.94,36.18,103.1,39.58,98.35,40.58,104.11,36.4,113.77,32.28,106.21,30.04,87.33,27.02,64.08,23.24,41.47,30.84,105.41,32.62,98.8,34.32,92.41,34.78,94.9,32.14,103.35,29.59,99.15,28.53,81.75,27.52,58.99,25.95,37.76,28.04,102.37,28.27,94.75,28.33,87.44,28.29,86.78,27.48,92.84,26.77,91.17,26.84,75.29,27.6,52.86,28.11,33.23,27.8,100.5,28,91.62,28.26,83.13,28.22,80.58,27.38,85.76,26.63,86.36,26.95,71.85,27.89,49.39,28.66,29.17,28.65,99.16,28.99,89.25,29.35,79.82,29.44,76.36,29.51,81.81,29.61,84.97,29.87,71.91,30.06,49.38,30.1,27.58,29.58,97.72,30.04,86.88,30.46,76.62,30.67,72.36,31.77,78.11,32.87,83.86,33.05,72.25,32.4,49.62,31.65,26.23]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.00","timeline":[{"name":"D_MOUTH.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.00_00","timeline":[{"name":"D_MOUTH.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[25.3,51.19,-38.74,54.35,-71.15,33.55,-61.71,28.87,-25.93,9.59,32.17,7.28,63.19,28.81,62.11,42.77,22.52,31.54,-24.36,31.6]},{"duration":60,"tweenEasing":0,"value":[25.07,-1.51,-22.66,4.98,-50.98,31.03,-35.86,68.35,-8.29,80.3,31.19,79.01,47.32,51.46,49.04,7.68,21.86,34.76,-7.81,32.72]},{"value":[27.29,-9.01,-38.31,-4.31,-58.89,31.54,-23.93,64.33,-6.51,76.3,10.19,69.95,47.41,47.56,58.98,11.61,4.41,30.95,-7.66,27.23]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.00_01","timeline":[{"name":"D_MOUTH.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[11.6,16.87,-14.75,17.03,-52.36,13.58,-37.22,6.39,-10.07,11.3,13.12,11.72,46.62,11.89,46.81,13.86,10.75,14.44,-9.04,14.56]},{"duration":60,"tweenEasing":0,"value":[5.95,-7.11,-12.72,-7.62,-22.53,19.46,-17.95,57.53,-8.11,74.11,7.28,75.5,17.07,49.19,17.27,9.32,5.62,32.53,-7.68,31.49]},{"value":[3.53,-26.15,1.85,-26.87,1.58,10.78,4.36,63.83,4.8,88.07,4.45,89.55,4.03,53.02,4.27,-3.05,4.24,29.4,4.22,27.87]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.00_02","timeline":[{"name":"D_MOUTH.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":19},{"duration":60,"tweenEasing":0,"value":[-0.39,9.98,2.61,9.67,-0.41,-4.99,5.81,40.99,4.15,35.66,0.26,34.71,-0.66,8.61,-1.85,5.99,-21.87,4.86,12.67,20.55]},{"value":[0.35,-33.44,5.22,-34.25,8.57,8.1,10.2,67.62,7.22,95.32,0.68,96.83,-3.31,55.86,-3.09,-7.4,1.2,29.11,6.45,27.39]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.03","timeline":[{"name":"D_MOUTH.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.03_00","timeline":[{"name":"D_MOUTH.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[53.29,10.63,36.88,21.26,3.84,22.88,-42.9,23.63,-65.75,9.33,-68,-7.38,-40.79,-9.14,-5.71,-11.78,22.21,-7.17,44.54,-4.44,-21.21,3.51,-58.53,5.13,30.27,5.91]},{"duration":60,"tweenEasing":0,"value":[41.49,0.02,28.62,-13.8,3.54,-22.36,-32.94,-22.27,-51.66,-22.65,-52.77,-22.6,-31.24,-22.86,-3.57,-29.22,16.87,-10.14,33.47,-3.41,-16.28,-22.62,-45.87,-22.64,23.17,-13.77]},{"value":[43.61,-31,28.45,-57.29,-2.05,-70.54,-46.65,-64.91,-69.28,-63.05,-71.53,-63.63,-46.35,-67.07,-12.57,-69.94,12.36,-48.26,32.81,-36.85,-27,-68.1,-62.73,-64.37,21.04,-56.22]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.03_01","timeline":[{"name":"D_MOUTH.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[39.53,63.91,22.33,60.44,8,71.29,-24.98,75.26,-46.87,15.88,-49.07,17.6,-16.91,0.1,-4.87,0.05,15.29,2,36.56,32.95,-12.81,24.53,-42.46,22.95,24.28,31.2]},{"duration":60,"tweenEasing":0,"value":[7.51,5.21,1.06,-8.58,-10.81,-17.19,-27.89,-17.11,-37.05,-17.27,-37.63,-17.21,-27.32,-17.37,-14.42,-17.28,-5.85,-5.34,2.7,1.76,-20.26,-17.22,-34.14,-17.23,-2.21,-8.57]},{"value":[0.32,-5.13,-2.66,-32.72,-7.18,-49.94,-14.91,-49.85,-19.64,-50.18,-20.03,-50.4,-15.18,-50.38,-9.24,-50.21,-7.17,-25.9,-4.19,-12.03,-12.13,-50.28,-18.89,-50.45,-5.3,-32.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.03_02","timeline":[{"name":"D_MOUTH.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":25},{"duration":60,"tweenEasing":0,"value":[1.9,-1.68,-1.01,-15.48,-5.98,-24.07,-13.49,-23.98,-17.89,-24.2,-17.94,-24.16,-13.15,-24.1,-7.65,-24.15,-4.68,-12.16,-1.12,-5.13,-10.34,-24.15,-16.77,-24.19,-2.85,-15.46]},{"value":[0.42,10.38,-2.28,-17.2,-6.2,-34.42,-13.14,-34.33,-17.39,-34.66,-17.24,-34.52,-12.86,-34.47,-7.75,-34.48,-6.57,-10.42,-3.96,3.49,-10.33,-34.52,-16.35,-34.6,-4.78,-17.18]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.01","timeline":[{"name":"D_MOUTH.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.01_00","timeline":[{"name":"D_MOUTH.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[46,85.21,27.16,29.8,2.44,-12.45,-33.44,9.75,-51.56,56.73,-57.85,81.11,-60.41,17.05,0,0,0,0,0,0,0,0,18.14,1.15,56.75,10.57,60.97,34.88,-6.97,-16.39,-30.26,-6.71,-44.06,20.23,-68.32,51.72,-43.34,-10.92,17.47,-22.55,60.45,78.85,52.61,58.43,37.37,69.47,48.9,32.25,23.06,-3.02,13.75,-16.15,-30.04,-14.23,-40.65,1.89,-55.53,32.6,-60.68,52.75,-62.84,76.97,-54.36,72.06,-60.84,64.47,-5.35,-21.22,40.8,50.11,45.57,63.34,39.65,30.04,24,8.65,30.07,47.86,10.37,-15.13,16.2,-0.04,-16.3,-17.58,-30.04,-6.29,-20.15,-12.18,-35.83,1.74,-46.32,20.07,-44.32,33.03,-53.69,38.64,-56.96,54.28,-58.17,65.71,34.26,18.37,17.32,-3,16.45,-9.33,-2.77,-16.93,-10.59,-15.08,50.52,43.66,-24.14,-11.14,-1.5,-16.22,11.82,-15.57]},{"duration":60,"tweenEasing":0,"value":[43.72,82.63,26.82,64.05,4.21,43.06,-22.6,54.93,-42.37,76.32,-44.87,67.18,-53.64,-5.02,12.1,-27.27,27.84,-9.46,6.27,18.33,-27.31,-6.63,10.96,-35.53,21.04,27.35,46.73,59.62,-9.06,12.99,-10.29,4.58,-28.59,13.12,-50.01,68.02,-23.02,39.68,11.53,38.52,51.61,64.71,45.14,63.96,38.83,72.47,39.37,58.15,15.37,43.11,12.97,46.06,-21.55,47.46,-23.89,45.98,-37.58,61.62,-43.98,68.26,-50.43,76.5,-48.21,75.76,-42.74,58.75,1.56,42.08,36.63,64.61,43.39,67.02,32.45,59.41,19.75,49.34,30.76,67.53,9.03,41.9,15.21,49.78,-11.99,45.2,-18.29,47.11,-13.38,43.18,-23.02,47.69,-30.02,54.68,-32.91,67.21,-39.35,64.24,-44.68,72.41,-47.83,73.17,28,53.62,11.57,46.29,13.05,44.06,0.38,45.1,-6.77,46.29,40.42,60.9,-15.98,46.59,1.74,43.1,10.25,44.45]},{"value":[45.37,84.3,25.41,81.24,6.14,75.75,-13.83,82.97,-33.63,89.41,-44.8,73.45,-46.31,-26.16,24.21,-54.46,55.67,-18.94,12.54,36.64,-32.9,-3.97,9.28,-36.83,14.91,30.54,40.77,59.58,-11.15,42.34,5.09,16.87,-13.83,7.72,-36.6,75.57,-13.43,65.04,11.57,74.22,54.57,68.26,45.33,68.03,41.05,78.98,36.34,69.91,13,67.31,10.84,77.79,-15.34,76.91,-12.97,74.89,-26.07,75.45,-32.77,76.75,-41.38,76.78,-41.7,80.16,-41.27,62.14,6.02,75.51,37.44,71.48,43.61,71.34,34.28,73.45,16.63,69.18,30.53,80.27,8.55,72.81,14.49,81.12,-8.41,78.26,-10.67,77.07,-6.94,77.88,-12.96,75.38,-21.31,76.88,-22.92,89.04,-30.1,81.02,-35.03,85.71,-39.63,85.12,24.4,69.29,10.86,72.85,8.49,71.07,0.48,76.48,-3.47,77.03,40.1,68.81,-10.38,79.06,1.94,76.09,9.18,74.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.01_01","timeline":[{"name":"D_MOUTH.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[18.95,63.08,20.84,5.19,1.3,-27.05,-27.41,-8.62,-32.99,22.83,-24.41,52.7,-36.85,3.84,0,0,0,0,0,0,0,0,18.14,1.15,40.6,14.18,47.74,30.72,-5.77,-15.9,-30.26,-6.71,-26.97,5.94,-45.1,30.55,-31.86,-9.47,14.81,-12.9,36.65,75.75,34,45.13,19.53,46.88,37.14,20.75,19.15,-5.66,9.58,-14.55,-20.25,-13.36,-31.14,-5.29,-40.32,15.2,-40.29,29.89,-38.76,50.13,-33.3,43.93,-35.13,44.22,-6.65,-11.18,28.56,30.81,27.78,45.19,30.97,14.86,20.33,-2.29,20.18,23.11,10.18,-20.35,13.73,-16.65,-10.65,-19.52,-23.46,-12.38,-17.15,-24.83,-29.04,-8.9,-35.7,4.16,-30.85,7.75,-38.55,16.99,-38.74,28.63,-38.66,36.3,27.26,7.2,15.36,-11.14,14.48,-13.31,-1.54,-17.28,-7,-13.89,35.77,31.38,-17.96,-15.45,0.92,-19.98,9.92,-17.86]},{"duration":60,"tweenEasing":0,"value":[14.25,55.8,9.95,57.89,-1.37,66.17,-9.73,71.75,-17.84,58.94,-20.77,42.1,-22.65,-37.85,35.09,-59.93,29.71,14.78,3.83,34.39,-18.62,20.1,-9.63,-22.89,7,49.72,18.51,54.8,-10.86,53.93,1.65,44.67,4.26,-2.43,-14.75,51.1,-3.95,65.91,-6.9,65.31,19.2,61.37,18.44,42.18,15.51,50.7,12.91,51.27,-7.63,51.97,-9.22,70.74,-6.24,78.55,-3.4,69.83,-12.79,62.99,-14.92,53.41,-22.67,46.43,-23.1,49.48,-17.42,35.77,-6.83,83.84,13.72,43.86,17.16,45.44,12.42,51.95,0.26,54.32,9.55,55.01,0.13,67.57,2.73,61.36,-6.68,76.48,-5.83,75.61,-6.52,68.99,-7.39,69.42,-11.59,64.15,-11.03,60.91,-15.66,60.01,-18.62,58.88,-19.46,50.22,5.26,52.48,-2.99,59.99,-2.78,64.66,-4.77,77.01,-5.68,81.68,15.26,44.61,-5.68,77.61,-1.86,74.35,0.61,71.56]},{"value":[12.92,39.57,2.72,63.33,-5.06,78.39,1.77,80.84,-7.07,60.65,-19.1,21.87,-8.67,-79.33,70.08,-119.79,28.86,23.25,7.64,68.72,-37.23,40.15,-37.59,-46.98,-17.21,57.94,5.57,52.73,0.01,74.15,18.65,42.73,25.92,-32.81,3.23,42.28,11.3,74.79,-15.78,79.64,13.28,44.85,9.58,22.73,12.95,33.07,2.3,46.59,-21.06,56.56,-19.86,84.56,-0.1,89.63,6.41,81.22,5.32,63.82,1.53,43.33,-10.46,22.8,-15.23,34.57,-5.54,11.29,-7.52,95.69,3.43,30.87,11.05,27.11,0.95,50.85,-11.57,59.15,2.51,52.65,-7.21,78.48,-5.58,71.6,-6.55,87.89,3.23,86.18,-1.43,79.9,5.24,77.68,4.32,67.65,3.61,64.34,-0.11,59.26,-5.95,52.14,-8.49,35.51,-7.4,53.96,-15.05,67.24,-13.45,74.37,-7.27,89.14,-6.49,93.28,3.05,33.08,-0.43,88.59,-4.53,86.45,-4.5,84.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.01_02","timeline":[{"name":"D_MOUTH.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":117},{"duration":60,"tweenEasing":0,"value":[-1.19,-2.18,-5.73,27.27,-5.33,51.16,11.9,38.59,-2.03,11.19,2.58,-14.22,7.72,-64.47,23.98,17.74,1.12,33.88,5.09,41.66,-15.33,31.93,-38.39,-35.53,-8.35,30.73,-12.2,5.29,-5.24,61.57,17.25,31.35,15.54,11.42,2.78,-1.91,23,44.96,-17.45,52.79,-1.78,-15.91,0.3,-5,1.72,0.53,-4.66,8.82,-20.46,22.27,-19.81,58.76,13.11,59.1,15.32,43.76,6.8,18.96,0.73,2.72,-7.62,-3.04,-7.27,1.06,0.87,-11.69,-1.68,68.21,-2.91,2.85,1.87,-1.41,-5.11,12.78,-11.32,25.93,-5.64,15.2,-12.7,44.78,-9.4,39.4,-4.18,62.43,8.53,52.32,3.37,45.37,10.78,37.22,6.77,25.37,6.04,25.78,3.59,10.49,-2.21,5.64,-5.69,0.14,-9.27,18.4,-16.48,33.66,-14.46,41.4,-11.91,62.78,-0.68,68.64,-3.96,-1.85,7.77,59.17,-9,55.24,-16.51,49.2]},{"value":[4.36,-3.36,-7.33,32.57,-7.21,75.96,10.4,63.9,-3.45,17.85,-12.55,-7.45,-5.37,43.95,-3.32,50.54,-2.79,49.51,-3.82,50.24,-4.6,51.17,-16.69,-12.04,17.79,69.27,-5.13,-1.96,-3.92,37.78,1.1,42.28,-7.13,58.69,5.35,-4.17,11.26,72.21,-18.7,72.87,1.83,-11.98,2.61,-2.99,2.59,2.17,-6.72,9.17,-24.26,32.71,-19.22,72.52,9.7,74.71,14.21,61.36,10.26,23.97,2.56,5.24,-7.08,-6.45,-10.46,2.52,-0.08,-17.42,-3.29,78.21,-2.37,0.94,3.16,-1.54,-2.17,22.07,-14.7,34.72,-3.33,17.63,-17.4,61.25,-11.37,54.11,-7.05,81.57,10.63,73.41,6.62,72.05,12.53,58.07,11.5,38.02,5.67,36.87,6.07,20.11,-0.6,9.57,-4.18,1.29,-12.5,26.04,-16.88,48.4,-18.76,51.09,-16.54,75.9,-1.43,78.59,-3.42,-1.36,4.25,80.62,-12.35,74.2,-18.2,63.45]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.02","timeline":[{"name":"D_MOUTH.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.02_00","timeline":[{"name":"D_MOUTH.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[58,128.85,8.18,201.42,-21.83,141.41,-45.34,49.15,5.63,-4.42,18.82,48.24,5.05,191.03,-37.79,203.48,-71.73,131.49,-64.48,53.36,-23.23,-17.76,22.98,-6.06,50.86,54.35,29.42,82.79,29.6,-4.63,-17.05,-10.38,-42.98,42.25,-53.14,114.81,-4.64,99.99,-6.28,-20.63,-17.85,36.33,-13.57,104.13,27.12,152.31,-61.2,147.76,-32.36,119.4,-33.93,154.19,-64.06,115.92,-61.42,77.01,-56.11,46.06,-39.86,2.74,-22.62,-20.93,-0.94,-29.39,-77.25,102.28,21.8,-8.58,36.83,23.98,45.15,63.65,45.88,103.23,59.07,84.99,42.24,124.52,40.68,155.7,-3.31,15.09,34.93,46.57,31.31,14.86,23.44,46.93,22.62,-4.34,13.46,-19.91,-11.41,-24.86,-22.61,-18.62,-32.1,-5.53,-39.51,17.18,-28.88,9.78,-48.66,44.63,-54.67,64.5,-55.9,97.22,-48.71,78.57,-58.86,117.33,40.32,73.11,39.46,96.33,40.02,117.94,27.13,116.11,-51.19,15.27,-0.83,-13.79,40.72,22.34,-13.07,-25.2,-11.51,-25.54,14.94,68.56,14.33,8.55,17.35,-10.09,-13,-14.24,8.23,-7.26,-29.75,19.58,-28.6,63.9]},{"duration":60,"tweenEasing":0,"value":[60.61,133.65,8.18,185.25,-21.83,125.24,-45.35,32.98,5.43,-20.59,18.66,32.06,4.58,174.57,-30.01,192.45,-61.83,129.71,-58.03,18.89,-25.81,-70.78,17.42,-42.78,44.48,45.72,31.18,46.7,32.28,-44.09,-14.79,-53.89,-44.74,0.59,-37.2,118.62,-5.16,83.5,-6.34,-36.82,-17.84,20.16,-13.59,87.95,24.49,162.87,-51.5,148.28,-27.92,97.87,-18.92,149.78,-53.76,122.05,-54.4,57.23,-51.32,17.08,-40.8,-33.57,-23.97,-59.67,-1.6,-65.61,-65.25,91.42,22.89,-40.5,38.62,1.4,42.81,62.53,45.8,112.19,55.55,89.68,43.32,137.05,42.88,168.22,-3.31,-1.09,35.72,23.35,33.02,-19.08,25.31,10.82,23.08,-38.02,14.72,-56.54,-11.89,-64.33,-19.29,-56.34,-30.28,-41.37,-40.27,-15.71,-29.13,-24.15,-46.2,17.87,-49.89,40.45,-47.2,85.9,-44.16,54.7,-48.73,118.19,36.77,63.55,37.42,94.57,37.99,119.74,26.43,98.2,-47.03,-26.72,-2.48,-67.17,37.69,-3.82,-13.08,-69.61,-11.68,-65.62,16.16,38.56,16.15,-23.41,19.1,-41.61,-11.61,-47.47,10.72,-48.58,-30.9,-12.9,-29.9,31.68]},{"value":[63.22,138.45,8.18,169.08,-21.83,109.08,-45.35,16.81,5.23,-36.75,18.51,15.88,4.1,158.11,-33.27,147.22,-51.92,127.92,-52.1,-12.96,-24.97,-112.35,13.73,-74.9,40.5,41.02,31.72,5.4,32.08,-78.37,-17.17,-83.74,-45.1,-33.17,-32.05,98.71,-5.68,67.02,-6.4,-53,-17.83,3.99,-13.62,71.77,24.13,169.56,-41.81,148.81,-23.48,76.35,-26.19,111.13,-45.03,122.91,-47.38,37.46,-48.69,-13.9,-40.65,-73.15,-24.77,-100.38,-2.36,-107.05,-54.79,85.19,21.18,-75.11,33.53,-23.26,37.5,61.37,45.72,121.14,52.04,94.37,44.41,149.57,45.09,180.74,-3.32,-17.26,35.08,-2.21,35.34,-53.74,25.75,-30.54,25.06,-74.65,16.79,-90.61,-9.97,-98.4,-21.66,-94.39,-28.35,-75.95,-41.89,-55.23,-27.96,-64.98,-49.02,-24.79,-48.66,8.44,-38.51,74.59,-37.57,27.59,-38.6,119.04,35.25,50.77,35.38,92.81,35.95,121.54,24.09,75.41,-41.46,-62.09,-4.8,-108.8,34.66,-29.99,-13.33,-110.74,-11.41,-105.38,16.54,4.97,16.02,-51.87,18.95,-69.71,-12.78,-74.61,9.77,-82.61,-31.01,-48.73,-30.49,4.75]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.02_01","timeline":[{"name":"D_MOUTH.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[35.11,94.12,-8.11,134.34,-16.19,63.59,-14.97,-5.99,-10.97,-22.53,23.58,-5.83,11.59,94.61,-16.37,125.82,-45.15,92.51,-42.61,29.76,-18.85,-23.3,17.62,-10.6,36.96,32.44,19.6,36.64,17.06,-12.25,-15.43,-21.44,-32.99,10.33,-30.42,58.64,-4.45,10.53,-13.47,-23.54,-3.7,0.02,-13.8,49.49,3.26,82.66,-31.2,97.8,-21.06,37.45,-15.13,69.81,-39.13,72.08,-39.46,42.19,-39.36,18.34,-32.85,-10.61,-19,-23.38,-0.47,-29.06,-49.79,67.77,18.89,-16.15,29.78,5.84,34.09,36.77,29.75,68.05,41.18,57.71,23.9,83.64,20.25,109.51,-3.16,-12.93,26.08,21.07,26.27,1.27,18.17,14.57,18.05,-16.37,13.38,-24.58,-11.06,-29.42,-19.03,-27.31,-25.89,-17.52,-31.7,-3.51,-25.34,-9.9,-35.1,14.5,-37.72,29.81,-34.07,53.59,-33.88,35.28,-35.41,64.93,28.63,41.89,25.36,56.29,21.14,72.8,11.37,60.04,-37.75,2.71,-0.79,-17.01,30.8,8.52,-10.06,-26.05,-9.63,-26.25,12.46,25.42,10.38,-8.3,6.64,-16.1,-14.69,-22.23,2.18,-16.46,-25.95,-1.88,-22.29,10.41]},{"duration":60,"tweenEasing":0,"value":[30.82,98.56,-15.67,171.77,-43.79,120.21,-51.14,30.11,11.3,-11.41,57.56,32.47,36.73,129.82,5.14,166.39,-29.79,100,-28.42,-12.48,-14.95,-92.95,1.5,-72.25,22.72,6.47,-4.23,35.44,-5.65,-70.74,-11.24,-109.1,-9.71,-33.27,-8.04,61.27,23.48,0.52,-6.28,-49.21,-29.38,1.46,-37.07,79.59,-9.98,119.71,-16.52,123.92,6.71,36.53,7.29,84.61,-23.9,87.69,-19.1,28.47,-20.9,-17.24,-16.94,-72.31,-13.75,-92.7,-7.26,-98.8,-37.97,34.68,-1.44,-71.45,8.53,-29.12,15.45,25.18,19.77,77.54,31.62,45.34,15.01,106.42,14.33,134.71,-7.96,-25.23,5.35,-3.16,4.71,-44.48,-8.37,-11.18,-3.83,-69.37,-1.82,-92.25,-9.43,-104.2,-13.03,-96.42,-13.8,-83.14,-11.93,-56.5,-7.92,-70.81,-15.11,-23.81,-16.02,2.06,-13,43.95,-13.1,12.99,-15.47,86.48,10.49,28.83,11.16,51.67,8.51,93.59,-4.47,74.72,-23.61,-58.67,-7.37,-85.13,16.31,-38.42,-11,-96.04,-10.17,-96.11,-11.94,25.03,-13.29,-47.51,-5.87,-63.39,-9.37,-86.58,-8.21,-88.32,-8.47,-39.01,2.74,-20.6]},{"value":[28.27,77.71,-23.08,209.57,-71.46,176.65,-87.27,66.29,33.5,-0.16,91.59,70.57,61.83,165.05,9.09,127.14,-22.17,72.06,-20.14,-46.97,-14.05,-136.49,8.61,-119.32,12.62,-19.54,-21.98,24.3,0.66,-113.31,-6.47,-133.33,-3.15,-65.27,6.42,48.91,51.5,-9.39,0.84,-74.78,-55,2.96,-60.39,109.41,-21.57,123.69,-6.55,88.59,26.16,25.02,28.83,94.88,-14.76,53.18,-11.95,-3.93,-14.23,-53.99,-16.97,-114.72,-12.12,-135.97,-1.85,-143.85,-28.19,12.63,4.99,-117.97,2.83,-66.6,5.73,1.97,10.84,51.08,21.55,34.96,12.58,85.61,9.7,139.68,-12.78,-37.52,-4.41,-34.22,7.23,-91.21,-17.77,-48.02,3.52,-116.27,4.58,-134.27,-6.12,-143.79,-10.97,-139.5,-13.44,-125.17,-10.16,-98.24,-7.83,-112.48,-7.89,-58.19,-8.61,-27.04,-5.18,14.32,-0.04,-5.26,-5.71,58.97,-2.13,9.66,-1.01,43.31,1.54,74.7,-19.45,86.79,-23.71,-100.38,-3.08,-128.35,18.98,-80.73,-8.22,-140.01,-6.93,-139.95,-32.1,17.76,-17.25,-75.89,0.72,-100.16,-3.72,-111.31,-2.6,-122.48,-1.71,-68.7,17.34,-44.31]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.02_02","timeline":[{"name":"D_MOUTH.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":143},{"duration":60,"tweenEasing":0,"value":[8.14,20.52,-17.23,54.58,-29.04,43.42,-34.34,10.06,-20.78,-20.53,37.73,10.01,29.1,60.29,9,62.02,-12.95,19.19,-6.16,-37.13,-2.66,-95.72,-0.91,-80.45,5.32,-29.87,-8.58,-13.29,-5.48,-76.28,-4.9,-114.9,1.7,-61.52,3.64,9.65,9.94,-28.34,4.01,-44.87,-19.34,-26.19,-18.05,-1.98,-15.72,16.65,-7.3,34.98,18.88,5.67,14.75,33.29,-10.39,12.42,-7.58,-16.26,-6.58,-43.45,-0.71,-77.1,-6.06,-96.53,-3.68,-100.57,-15.16,1.04,-1.85,-81.03,0.07,-52.03,1.15,-17.4,2.48,11.17,8.43,-1.44,0.85,20.12,-3.53,34.95,-10.79,-23.41,-2.66,-39.2,-1.61,-60.1,-8.25,-41.63,-3.99,-77.04,-2.55,-90.72,-4.75,-101.26,-6.87,-100.71,1.41,-88.74,-0.25,-70.7,3.56,-83.99,-1.18,-45.27,-2.61,-27.76,-1.99,-0.8,3.39,-12.98,-6.49,13.19,-3.02,-16.71,-3.25,-0.33,-4.05,10.88,-12.3,1.71,-6.15,-70.57,-1.68,-86.83,3.61,-59.57,-2.45,-96.12,-2.96,-100.56,-11.88,-17.24,-9.94,-60.16,-2.24,-65.56,-1.55,-88.56,-5.21,-93.97,2.53,-55.52,4.79,-49.08]},{"value":[12.87,32.73,-29.65,69.91,-58.2,86.8,-68.61,19.93,-41.8,-41.13,76.38,20.82,51.47,93.89,12.39,85.83,-17.52,24.38,-9.71,-55.22,-3.37,-126.51,4.74,-109.36,9.29,-36.17,-7.93,-12.2,-3.41,-89.31,0.01,-116.28,2.98,-63.64,3.71,9.3,20,-56.27,31.54,-50.92,-38.36,-52.83,-35.88,-3.92,-17.85,24,-7.76,45.07,26.64,1.82,20.7,42.87,-11.23,14.73,-7.5,-24.08,-5.19,-57.08,-5.62,-104,-4.93,-123.3,-0.45,-128.77,-21.01,-2.15,3.16,-104.88,4.21,-66.73,4.21,-18.11,5.16,23.21,12.55,3.77,3.31,31.88,-2.98,48.47,-21.4,-46.98,0.69,-49.88,3.8,-76.45,-6.86,-48.96,-0.09,-98.78,2.84,-117.38,1.05,-126.81,-2.87,-121.69,-2.09,-112.46,-2.18,-90.71,-0.24,-103.97,-0.14,-61.81,-0.79,-37.91,-0.02,-9.29,3.58,-23.15,-4.29,13.28,-0.73,-18.34,-1.64,4.84,-2.97,18.69,-13.12,6.01,-13.74,-91.56,0.94,-116.74,9.12,-75.52,-1.42,-128.28,-1.52,-128,-17.25,-24.65,-14.66,-77.57,8.52,-76.21,11.86,-91.71,-1.84,-101.67,13.28,-59.05,9.36,-60.87]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_NOSE.01","timeline":[{"name":"B_NOSE.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_NOSE.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_NOSE.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NOSE.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_NOSE.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_00","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33]},{"value":[42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_01","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70]},{"value":[42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_02","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_03","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-41.88,77.54,-41.88,77.69,-41.88,77.85,-41.88,77.99,-41.88,78.04,-41.88,77.99,-41.88,77.85,-41.88,77.69,-41.88,77.54,-41.88,77.2,-41.89,77.38,-41.9,77.57,-41.9,77.73,-41.9,77.79,-41.9,77.72,-41.89,77.56,-41.88,77.36,-41.87,77.18,-41.88,76.87,-41.9,77.07,-41.91,77.3,-41.91,77.48,-41.91,77.57,-41.91,77.47,-41.88,77.27,-41.86,77.04,-41.84,76.82,-41.88,76.53,-41.91,76.75,-41.92,77,-41.94,77.21,-41.94,77.3,-41.93,77.19,-41.9,76.97,-41.86,76.71,-41.83,76.47,-41.88,76.17,-41.92,76.39,-41.96,76.63,-41.99,76.83,-42.01,76.92,-41.99,76.83,-41.96,76.63,-41.92,76.39,-41.88,76.17,-41.82,75.63,-41.85,75.87,-41.9,76.14,-41.93,76.35,-41.94,76.45,-41.95,76.35,-41.95,76.14,-41.95,75.87,-41.94,75.63,-41.79,75.13,-41.83,75.38,-41.87,75.66,-41.9,75.88,-41.91,75.98,-41.92,75.88,-41.93,75.66,-41.94,75.38,-41.93,75.13,-41.78,74.65,-41.82,74.91,-41.86,75.19,-41.89,75.41,-41.9,75.51,-41.9,75.41,-41.91,75.19,-41.91,74.91,-41.9,74.65,-41.76,74.17,-41.8,74.43,-41.84,74.71,-41.87,74.94,-41.88,75.04,-41.88,74.94,-41.88,74.71,-41.88,74.43,-41.88,74.17]},{"duration":60,"tweenEasing":0,"value":[-0.05,82.04,-0.05,82.19,-0.05,82.35,-0.05,82.49,-0.05,82.54,-0.05,82.49,-0.05,82.35,-0.05,82.19,-0.05,82.04,-0.05,81.7,-0.06,81.88,-0.06,82.07,-0.07,82.23,-0.07,82.3,-0.07,82.22,-0.06,82.06,-0.04,81.86,-0.03,81.69,-0.05,81.37,-0.06,81.57,-0.07,81.8,-0.08,81.99,-0.08,82.07,-0.07,81.97,-0.05,81.78,-0.02,81.54,0,81.32,-0.05,81.03,-0.07,81.25,-0.09,81.5,-0.1,81.71,-0.11,81.8,-0.1,81.69,-0.06,81.47,-0.03,81.21,0,80.98,-0.05,80.67,-0.09,80.89,-0.13,81.14,-0.16,81.33,-0.18,81.42,-0.16,81.33,-0.13,81.14,-0.09,80.89,-0.05,80.67,0.02,80.13,-0.02,80.37,-0.06,80.64,-0.09,80.85,-0.11,80.95,-0.11,80.85,-0.12,80.64,-0.12,80.37,-0.1,80.13,0.04,79.64,0.01,79.88,-0.03,80.16,-0.07,80.38,-0.08,80.48,-0.09,80.38,-0.1,80.16,-0.1,79.88,-0.1,79.64,0.06,79.15,0.02,79.41,-0.02,79.69,-0.06,79.92,-0.07,80.01,-0.07,79.92,-0.07,79.69,-0.07,79.41,-0.07,79.15,0.07,78.67,0.04,78.93,0,79.21,-0.04,79.45,-0.05,79.54,-0.05,79.45,-0.05,79.21,-0.05,78.93,-0.05,78.67]},{"value":[41.95,82.04,41.95,82.19,41.95,82.35,41.95,82.49,41.95,82.54,41.95,82.49,41.95,82.35,41.95,82.19,41.95,82.04,41.95,81.7,41.94,81.88,41.94,82.07,41.93,82.23,41.93,82.3,41.93,82.22,41.94,82.06,41.96,81.86,41.97,81.69,41.95,81.37,41.94,81.57,41.93,81.8,41.92,81.99,41.92,82.07,41.93,81.97,41.95,81.78,41.98,81.54,42,81.32,41.95,81.03,41.93,81.25,41.91,81.5,41.9,81.71,41.89,81.8,41.9,81.69,41.94,81.47,41.97,81.21,42,80.98,41.95,80.67,41.91,80.89,41.87,81.14,41.84,81.33,41.82,81.42,41.84,81.33,41.87,81.14,41.91,80.89,41.95,80.67,42.02,80.13,41.98,80.37,41.94,80.64,41.91,80.85,41.89,80.95,41.89,80.85,41.88,80.64,41.88,80.37,41.9,80.13,42.04,79.64,42.01,79.88,41.97,80.16,41.93,80.38,41.92,80.48,41.91,80.38,41.9,80.16,41.9,79.88,41.9,79.64,42.06,79.15,42.02,79.41,41.98,79.69,41.94,79.92,41.93,80.01,41.93,79.92,41.93,79.69,41.93,79.41,41.93,79.15,42.07,78.67,42.04,78.93,42,79.21,41.96,79.45,41.95,79.54,41.95,79.45,41.95,79.21,41.95,78.93,41.95,78.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_04","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-36.93,157.75,-36.93,158.05,-36.93,158.37,-36.93,158.64,-36.93,158.75,-36.93,158.64,-36.93,158.37,-36.93,158.05,-36.93,157.75,-36.93,157.07,-36.95,157.42,-36.96,157.81,-36.97,158.12,-36.97,158.26,-36.96,158.11,-36.94,157.79,-36.92,157.39,-36.9,157.04,-36.93,156.4,-36.96,156.82,-36.98,157.27,-36.99,157.64,-37,157.81,-36.98,157.61,-36.93,157.22,-36.88,156.74,-36.84,156.31,-36.93,155.72,-36.98,156.17,-37.02,156.67,-37.04,157.08,-37.05,157.27,-37.02,157.05,-36.96,156.61,-36.89,156.09,-36.83,155.62,-36.93,155,-37.01,155.44,-37.09,155.94,-37.16,156.33,-37.18,156.5,-37.16,156.33,-37.09,155.94,-37.01,155.44,-36.93,155,-36.8,153.93,-36.88,154.41,-36.96,154.94,-37.02,155.37,-37.05,155.56,-37.06,155.37,-37.07,154.94,-37.07,154.41,-37.04,153.93,-36.75,152.94,-36.82,153.43,-36.9,153.98,-36.97,154.43,-37,154.62,-37.01,154.43,-37.03,153.98,-37.04,153.43,-37.03,152.94,-36.72,151.98,-36.8,152.48,-36.88,153.04,-36.95,153.5,-36.97,153.69,-36.97,153.5,-36.98,153.04,-36.98,152.48,-36.97,151.98,-36.68,151,-36.76,151.52,-36.84,152.09,-36.91,152.56,-36.93,152.75,-36.93,152.56,-36.93,152.09,-36.93,151.52,-36.93,151]},{"duration":60,"tweenEasing":0,"value":[-0.1,164.08,-0.1,164.38,-0.1,164.71,-0.1,164.97,-0.1,165.08,-0.1,164.97,-0.1,164.71,-0.1,164.38,-0.1,164.08,-0.1,163.41,-0.12,163.76,-0.13,164.14,-0.14,164.45,-0.14,164.59,-0.13,164.44,-0.11,164.12,-0.09,163.73,-0.07,163.37,-0.1,162.74,-0.13,163.15,-0.15,163.6,-0.16,163.97,-0.16,164.15,-0.14,163.94,-0.1,163.55,-0.05,163.08,-0.01,162.65,-0.1,162.06,-0.15,162.51,-0.18,163,-0.21,163.41,-0.22,163.61,-0.19,163.38,-0.13,162.95,-0.06,162.43,0.01,161.95,-0.1,161.33,-0.17,161.78,-0.26,162.27,-0.32,162.67,-0.35,162.83,-0.32,162.67,-0.26,162.27,-0.17,161.78,-0.1,161.33,0.03,160.26,-0.04,160.74,-0.12,161.28,-0.19,161.71,-0.22,161.9,-0.22,161.71,-0.23,161.27,-0.23,160.74,-0.21,160.26,0.09,159.27,0.01,159.77,-0.07,160.32,-0.14,160.77,-0.16,160.96,-0.17,160.76,-0.19,160.32,-0.21,159.77,-0.19,159.27,0.11,158.31,0.04,158.82,-0.05,159.38,-0.11,159.83,-0.14,160.02,-0.14,159.83,-0.14,159.38,-0.14,158.82,-0.14,158.31,0.15,157.33,0.08,157.85,-0.01,158.43,-0.07,158.89,-0.1,159.08,-0.1,158.89,-0.1,158.43,-0.1,157.85,-0.1,157.33]},{"value":[41.9,164.08,41.9,164.38,41.9,164.71,41.9,164.97,41.9,165.08,41.9,164.97,41.9,164.71,41.9,164.38,41.9,164.08,41.9,163.41,41.88,163.76,41.87,164.14,41.86,164.45,41.86,164.59,41.87,164.44,41.89,164.12,41.91,163.73,41.93,163.37,41.9,162.74,41.87,163.15,41.85,163.6,41.84,163.97,41.84,164.15,41.86,163.94,41.9,163.55,41.95,163.08,41.99,162.65,41.9,162.06,41.85,162.51,41.82,163,41.79,163.41,41.78,163.61,41.81,163.38,41.87,162.95,41.94,162.43,42.01,161.95,41.9,161.33,41.83,161.78,41.74,162.27,41.68,162.67,41.65,162.83,41.68,162.67,41.74,162.27,41.83,161.78,41.9,161.33,42.03,160.26,41.96,160.74,41.88,161.28,41.81,161.71,41.78,161.9,41.78,161.71,41.77,161.27,41.77,160.74,41.79,160.26,42.09,159.27,42.01,159.77,41.93,160.32,41.86,160.77,41.84,160.96,41.83,160.76,41.81,160.32,41.79,159.77,41.81,159.27,42.11,158.31,42.04,158.82,41.95,159.38,41.89,159.83,41.86,160.02,41.86,159.83,41.86,159.38,41.86,158.82,41.86,158.31,42.15,157.33,42.08,157.85,41.99,158.43,41.93,158.89,41.9,159.08,41.9,158.89,41.9,158.43,41.9,157.85,41.9,157.33]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_NOSE.00","timeline":[{"name":"D_NOSE.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_NOSE.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_NOSE.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_NOSE.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_00"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_03","timeline":[{"name":"D_NOSE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-21.38,2.28,-42.1,8.37,-41.92,8.7]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_04","timeline":[{"name":"D_NOSE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-21.38,2.28,-42.1,8.37,-41.92,8.7]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_NOSE.01","timeline":[{"name":"D_NOSE.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_NOSE.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_NOSE.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_NOSE.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_00","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"offset":8,"value":[-8.33,4.08,-15.28,-1.36,0,0,0,0,0,0,0,0,0,0,0,0,-8.33,5.44,0,0,-1.39,1.36]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_01","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"offset":8,"value":[-8.33,4.08,-15.28,-1.36,0,0,0,0,0,0,0,0,0,0,0,0,-8.33,5.44,0,0,-1.39,1.36]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_03","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"value":[8.68,0.67,-19.45,-0.18,-85.46,-7.25,-36.09,-3.63,-23.56,0.08,-4.11,2.69,-51.96,-5.64,-35.58,-2.22,-2.72,1.34,-18.71,-0.07,-69.7,7.26,-31.13,-4.28,1.18,-1.34,-43.96,-2.37,-33.84,-1.25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_04","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"value":[8.68,0.67,-19.45,-0.18,-85.46,-7.25,-36.09,-3.63,-23.56,0.08,-4.11,2.69,-51.96,-5.64,-35.58,-2.22,-2.72,1.34,-18.71,-0.07,-69.7,7.26,-31.13,-4.28,1.18,-1.34,-43.96,-2.37,-33.84,-1.25]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EAR.01","timeline":[{"name":"B_EAR.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EAR.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EAR.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EAR.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_00","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-5.26,-39.61,-5.96,-40.18,-6.67,-40.96,-7.37,-41.3,-8.08,-40.55,-8.78,-39.47,-9.49,-39.02,-10.19,-38.82,-10.9,-38.49,-6.95,-40.54,-7.66,-40.5,-8.36,-40.63,-9.07,-40.42,-9.77,-39.4,-10.45,-38.43,-11.11,-38.13,-11.76,-38.08,-12.45,-37.91,-8.65,-41.46,-9.36,-40.77,-10.06,-40.19,-10.76,-39.38,-11.47,-38.02,-12.11,-37.23,-12.68,-37.12,-13.26,-37.3,-13.9,-37.34,-10.34,-42.39,-11.05,-41.14,-11.75,-39.96,-12.46,-38.66,-13.16,-37.09,-13.8,-36.35,-14.35,-36.34,-14.91,-36.62,-15.55,-36.76,-12.04,-43.31,-12.75,-41.79,-13.45,-40.28,-14.16,-38.76,-14.86,-37.25,-15.56,-36.28,-16.27,-36.09,-16.97,-36.21,-17.68,-36.18,-13.59,-45.25,-14.16,-43.63,-14.77,-41.99,-15.43,-40.39,-16.12,-38.9,-16.81,-37.96,-17.47,-37.66,-18.08,-37.61,-18.65,-37.43,-14.93,-48.66,-15.29,-46.83,-15.68,-44.96,-16.14,-43.17,-16.75,-41.59,-17.36,-40.54,-17.83,-39.98,-18.21,-39.62,-18.57,-39.16,-16.19,-52.64,-16.32,-50.57,-16.41,-48.42,-16.63,-46.41,-17.14,-44.7,-17.64,-43.48,-17.86,-42.6,-17.95,-41.87,-18.08,-41.06,-17.49,-56.34,-17.4,-54.03,-17.23,-51.64,-17.23,-49.42,-17.64,-47.61,-18.06,-46.24,-18.05,-45.08,-17.88,-44,-17.8,-42.88]},{"duration":60,"tweenEasing":0,"value":[2.66,-43.36,2.66,-43.91,2.66,-44.67,2.66,-45,2.66,-44.24,2.67,-43.15,2.67,-42.68,2.67,-42.46,2.67,-42.12,0.95,-43.36,0.95,-43.31,0.95,-43.42,0.95,-43.2,0.95,-42.16,0.97,-41.18,1.03,-40.86,1.08,-40.81,1.1,-40.62,-0.77,-43.36,-0.77,-42.66,-0.77,-42.06,-0.77,-41.24,-0.76,-39.87,-0.7,-39.06,-0.57,-38.94,-0.43,-39.1,-0.37,-39.12,-2.48,-43.36,-2.48,-42.11,-2.48,-40.91,-2.48,-39.6,-2.48,-38.01,-2.41,-37.25,-2.26,-37.23,-2.11,-37.5,-2.04,-37.62,-4.2,-43.37,-4.2,-41.84,-4.2,-40.31,-4.19,-38.78,-4.19,-37.25,-4.19,-36.26,-4.19,-36.06,-4.19,-36.17,-4.19,-36.13,-5.91,-43.37,-5.91,-41.84,-5.91,-40.31,-5.91,-38.78,-5.91,-37.25,-5.91,-36.27,-5.91,-36.04,-5.9,-36.1,-5.9,-36.02,-7.63,-43.37,-7.63,-41.84,-7.63,-40.31,-7.62,-38.78,-7.62,-37.25,-7.62,-36.24,-7.62,-35.94,-7.62,-35.92,-7.62,-35.75,-9.34,-43.37,-9.34,-41.84,-9.34,-40.31,-9.34,-38.78,-9.34,-37.25,-9.34,-36.2,-9.34,-35.81,-9.33,-35.68,-9.33,-35.43,-11.06,-43.37,-11.06,-41.84,-11.05,-40.31,-11.05,-38.78,-11.05,-37.25,-11.05,-36.16,-11.05,-35.69,-11.05,-35.47,-11.05,-35.13]},{"value":[19.99,-43.36,19.99,-43.91,20,-44.67,20,-45,20,-44.24,20,-43.15,20,-42.68,20,-42.46,20,-42.12,18.28,-43.36,18.28,-43.31,18.28,-43.42,18.28,-43.2,18.28,-42.16,18.31,-41.18,18.36,-40.86,18.41,-40.81,18.43,-40.62,16.56,-43.36,16.57,-42.66,16.57,-42.06,16.57,-41.24,16.57,-39.87,16.63,-39.06,16.77,-38.94,16.9,-39.1,16.96,-39.12,14.85,-43.36,14.85,-42.11,14.85,-40.91,14.85,-39.6,14.85,-38.01,14.92,-37.25,15.08,-37.23,15.23,-37.5,15.3,-37.62,13.13,-43.37,13.14,-41.84,13.14,-40.31,13.14,-38.78,13.14,-37.25,13.14,-36.26,13.14,-36.06,13.14,-36.17,13.14,-36.13,11.42,-43.37,11.42,-41.84,11.42,-40.31,11.42,-38.78,11.43,-37.25,11.43,-36.27,11.43,-36.04,11.43,-36.1,11.43,-36.02,9.71,-43.37,9.71,-41.84,9.71,-40.31,9.71,-38.78,9.71,-37.25,9.71,-36.24,9.71,-35.94,9.71,-35.92,9.72,-35.75,7.99,-43.37,7.99,-41.84,7.99,-40.31,7.99,-38.78,8,-37.25,8,-36.2,8,-35.81,8,-35.68,8,-35.43,6.28,-43.37,6.28,-41.84,6.28,-40.31,6.28,-38.78,6.28,-37.25,6.28,-36.16,6.28,-35.69,6.28,-35.47,6.29,-35.13]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_01","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.08,-16.43,-0.63,-16.72,-1.33,-17.12,-2.04,-17.3,-2.74,-16.93,-3.45,-16.4,-4.15,-16.18,-4.86,-16.08,-5.56,-15.93,-0.76,-17.36,-1.46,-17.35,-2.17,-17.42,-2.87,-17.32,-3.58,-16.82,-4.27,-16.34,-4.96,-16.19,-5.64,-16.18,-6.33,-16.1,-1.6,-18.28,-2.3,-17.94,-3.01,-17.66,-3.71,-17.26,-4.42,-16.59,-5.09,-16.2,-5.73,-16.15,-6.37,-16.25,-7.05,-16.27,-2.44,-19.2,-3.14,-18.59,-3.85,-18,-4.55,-17.36,-5.26,-16.58,-5.93,-16.22,-6.56,-16.22,-7.19,-16.37,-7.86,-16.45,-3.27,-20.13,-3.98,-19.38,-4.69,-18.62,-5.39,-17.87,-6.1,-17.12,-6.8,-16.65,-7.51,-16.56,-8.21,-16.63,-8.92,-16.62,-3.97,-22.07,-4.53,-21.21,-5.15,-20.34,-5.81,-19.51,-6.5,-18.78,-7.19,-18.32,-7.85,-18.14,-8.46,-18.06,-9.03,-17.93,-4.45,-25.47,-4.81,-24.41,-5.2,-23.3,-5.66,-22.28,-6.27,-21.47,-6.88,-20.92,-7.35,-20.51,-7.73,-20.16,-8.1,-19.78,-4.85,-29.46,-4.98,-28.15,-5.08,-26.77,-5.29,-25.52,-5.8,-24.58,-6.31,-23.88,-6.52,-23.2,-6.62,-22.53,-6.75,-21.85,-5.3,-33.15,-5.21,-31.61,-5.04,-29.98,-5.04,-28.52,-5.45,-27.48,-5.87,-26.66,-5.86,-25.73,-5.69,-24.76,-5.61,-23.81]},{"duration":60,"tweenEasing":0,"value":[1.33,-20.18,1.33,-20.45,1.33,-20.84,1.33,-21,1.33,-20.62,1.33,-20.07,1.33,-19.84,1.33,-19.73,1.33,-19.56,0.47,-20.18,0.47,-20.15,0.47,-20.21,0.47,-20.1,0.48,-19.58,0.49,-19.09,0.51,-18.93,0.54,-18.9,0.55,-18.81,-0.38,-20.18,-0.38,-19.83,-0.38,-19.53,-0.38,-19.12,-0.38,-18.43,-0.35,-18.03,-0.28,-17.97,-0.22,-18.05,-0.18,-18.06,-1.24,-20.18,-1.24,-19.55,-1.24,-18.95,-1.24,-18.3,-1.24,-17.51,-1.2,-17.13,-1.13,-17.11,-1.05,-17.25,-1.02,-17.31,-2.1,-20.18,-2.1,-19.42,-2.1,-18.65,-2.1,-17.89,-2.1,-17.12,-2.1,-16.63,-2.1,-16.53,-2.09,-16.59,-2.09,-16.56,-2.96,-20.18,-2.96,-19.42,-2.96,-18.65,-2.95,-17.89,-2.95,-17.12,-2.95,-16.64,-2.95,-16.52,-2.95,-16.55,-2.95,-16.51,-3.81,-20.18,-3.81,-19.42,-3.81,-18.65,-3.81,-17.89,-3.81,-17.12,-3.81,-16.62,-3.81,-16.47,-3.81,-16.46,-3.81,-16.38,-4.67,-20.19,-4.67,-19.42,-4.67,-18.66,-4.67,-17.89,-4.67,-17.13,-4.67,-16.6,-4.67,-16.4,-4.67,-16.34,-4.67,-16.21,-5.53,-20.19,-5.53,-19.42,-5.53,-18.66,-5.53,-17.89,-5.53,-17.13,-5.53,-16.58,-5.52,-16.35,-5.52,-16.24,-5.52,-16.07]},{"value":[10,-20.18,10,-20.45,10,-20.84,10,-21,10,-20.62,10,-20.07,10,-19.84,10,-19.73,10,-19.56,9.14,-20.18,9.14,-20.15,9.14,-20.21,9.14,-20.1,9.14,-19.58,9.15,-19.09,9.18,-18.93,9.21,-18.9,9.22,-18.81,8.28,-20.18,8.28,-19.83,8.28,-19.53,8.28,-19.12,8.28,-18.43,8.32,-18.03,8.38,-17.97,8.45,-18.05,8.48,-18.06,7.42,-20.18,7.43,-19.55,7.43,-18.95,7.43,-18.3,7.43,-17.51,7.46,-17.13,7.54,-17.11,7.61,-17.25,7.65,-17.31,6.57,-20.18,6.57,-19.42,6.57,-18.65,6.57,-17.89,6.57,-17.12,6.57,-16.63,6.57,-16.53,6.57,-16.59,6.57,-16.56,5.71,-20.18,5.71,-19.42,5.71,-18.65,5.71,-17.89,5.71,-17.12,5.71,-16.64,5.71,-16.52,5.71,-16.55,5.72,-16.51,4.85,-20.18,4.85,-19.42,4.85,-18.65,4.85,-17.89,4.86,-17.12,4.86,-16.62,4.86,-16.47,4.86,-16.46,4.86,-16.38,4,-20.19,4,-19.42,4,-18.66,4,-17.89,4,-17.13,4,-16.6,4,-16.4,4,-16.34,4,-16.21,3.14,-20.19,3.14,-19.42,3.14,-18.66,3.14,-17.89,3.14,-17.13,3.14,-16.58,3.14,-16.35,3.14,-16.24,3.14,-16.07]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_02","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[4.08,3.75,3.38,3.73,2.67,3.72,1.97,3.7,1.26,3.69,0.55,3.67,-0.15,3.66,-0.86,3.65,-1.57,3.63,4.1,2.82,3.4,2.81,2.69,2.8,1.98,2.78,1.28,2.77,0.57,2.75,-0.13,2.74,-0.84,2.72,-1.55,2.71,4.12,1.9,3.41,1.89,2.71,1.87,2,1.86,1.3,1.84,0.59,1.83,-0.12,1.82,-0.82,1.8,-1.53,1.79,4.14,0.98,3.43,0.96,2.73,0.95,2.02,0.94,1.31,0.92,0.61,0.91,-0.1,0.89,-0.8,0.88,-1.51,0.87,4.16,0.06,3.45,0.04,2.75,0.03,2.04,0.01,1.33,0,0.63,-0.01,-0.08,-0.03,-0.79,-0.04,-1.49,-0.06,4.32,-1.89,3.76,-1.8,3.14,-1.69,2.48,-1.62,1.79,-1.65,1.1,-1.69,0.44,-1.62,-0.18,-1.51,-0.74,-1.42,4.7,-5.29,4.33,-4.99,3.95,-4.65,3.48,-4.39,2.87,-4.34,2.26,-4.3,1.79,-4.04,1.41,-3.7,1.05,-3.4,5.15,-9.27,5.02,-8.72,4.93,-8.11,4.71,-7.63,4.2,-7.45,3.7,-7.28,3.48,-6.79,3.38,-6.18,3.25,-5.64,5.57,-12.97,5.65,-12.19,5.82,-11.33,5.82,-10.63,5.41,-10.36,4.99,-10.08,5,-9.38,5.16,-8.52,5.25,-7.75]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_03","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.46,30,-0.1,28.82,-0.64,27.66,-1.21,26.47,-1.86,25.25,-2.62,23.92,-3.46,22.48,-4.33,20.98,-5.18,19.51,0.63,28.25,0.02,27.03,-0.6,25.82,-1.24,24.6,-1.92,23.37,-2.66,22,-3.46,20.51,-4.28,18.98,-5.09,17.48,0.87,26.49,0.19,25.24,-0.53,23.98,-1.26,22.73,-1.98,21.48,-2.7,20.04,-3.46,18.49,-4.22,16.89,-4.99,15.32,0.98,24.75,0.26,23.45,-0.51,22.15,-1.29,20.86,-2.03,19.6,-2.74,18.14,-3.45,16.58,-4.18,14.98,-4.9,13.4,0.78,23.05,0.07,21.7,-0.63,20.35,-1.33,19.01,-2.04,17.73,-2.74,16.4,-3.45,14.98,-4.15,13.51,-4.86,12.07,0.66,21.14,0.14,19.87,-0.38,18.62,-0.94,17.34,-1.58,16,-2.27,14.65,-2.93,13.33,-3.55,12.02,-4.11,10.71,1.07,17.45,0.75,16.42,0.45,15.44,0.07,14.37,-0.5,13.13,-1.11,11.89,-1.58,10.8,-1.96,9.78,-2.32,8.72,1.68,13.06,1.56,12.33,1.5,11.67,1.32,10.88,0.83,9.8,0.32,8.71,0.11,7.91,0.02,7.23,-0.12,6.48,2.19,9.02,2.27,8.57,2.44,8.19,2.45,7.65,2.03,6.7,1.62,5.74,1.63,5.2,1.8,4.83,1.88,4.37]},{"duration":60,"tweenEasing":0,"value":[-3.63,26.25,-3.48,25.09,-3.31,23.94,-3.18,22.77,-3.12,21.57,-3.18,20.25,-3.31,18.82,-3.47,17.34,-3.62,15.88,-3.47,25.42,-3.38,24.22,-3.29,23.03,-3.22,21.82,-3.2,20.6,-3.23,19.24,-3.32,17.77,-3.44,16.26,-3.54,14.77,-3.25,24.59,-3.22,23.35,-3.23,22.11,-3.26,20.87,-3.28,19.63,-3.3,18.21,-3.34,16.67,-3.4,15.09,-3.46,13.53,-3.16,23.77,-3.17,22.49,-3.24,21.2,-3.31,19.92,-3.35,18.67,-3.35,17.24,-3.35,15.69,-3.37,14.1,-3.4,12.54,-3.38,22.99,-3.38,21.66,-3.38,20.32,-3.37,19,-3.37,17.73,-3.37,16.42,-3.37,15.01,-3.37,13.56,-3.37,12.12,-3.66,23.02,-3.61,21.67,-3.52,20.31,-3.42,18.96,-3.37,17.65,-3.37,16.34,-3.37,14.95,-3.37,13.53,-3.37,12.12,-3.63,22.74,-3.59,21.42,-3.5,20.09,-3.41,18.77,-3.37,17.47,-3.37,16.18,-3.37,14.84,-3.37,13.47,-3.37,12.12,-3.47,22.33,-3.46,21.06,-3.42,19.78,-3.39,18.51,-3.37,17.25,-3.37,15.99,-3.37,14.71,-3.37,13.41,-3.37,12.12,-3.38,21.99,-3.38,20.75,-3.38,19.52,-3.37,18.29,-3.37,17.05,-3.37,15.82,-3.37,14.59,-3.37,13.35,-3.37,12.12]},{"value":[-16.96,26.25,-16.81,25.09,-16.65,23.94,-16.51,22.77,-16.46,21.57,-16.51,20.25,-16.64,18.82,-16.8,17.34,-16.95,15.88,-16.81,25.42,-16.71,24.22,-16.62,23.03,-16.56,21.82,-16.53,20.6,-16.57,19.24,-16.66,17.77,-16.77,16.26,-16.88,14.77,-16.59,24.59,-16.55,23.35,-16.57,22.11,-16.6,20.87,-16.61,19.63,-16.63,18.21,-16.67,16.67,-16.73,15.09,-16.79,13.53,-16.49,23.77,-16.5,22.49,-16.57,21.2,-16.64,19.92,-16.68,18.67,-16.68,17.24,-16.69,15.69,-16.7,14.1,-16.73,12.54,-16.71,22.99,-16.71,21.66,-16.71,20.32,-16.71,19,-16.71,17.73,-16.71,16.42,-16.7,15.01,-16.7,13.56,-16.7,12.12,-16.99,23.02,-16.95,21.67,-16.85,20.31,-16.75,18.96,-16.71,17.65,-16.7,16.34,-16.7,14.95,-16.7,13.53,-16.7,12.12,-16.96,22.74,-16.92,21.42,-16.83,20.09,-16.75,18.77,-16.71,17.47,-16.7,16.18,-16.7,14.84,-16.7,13.47,-16.7,12.12,-16.81,22.33,-16.79,21.06,-16.76,19.78,-16.72,18.51,-16.71,17.25,-16.7,15.99,-16.7,14.71,-16.7,13.41,-16.7,12.12,-16.71,21.99,-16.71,20.75,-16.71,19.52,-16.71,18.29,-16.71,17.05,-16.7,15.82,-16.7,14.59,-16.7,13.35,-16.7,12.12]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_04","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.17,56.24,-3.58,53.91,-3.96,51.59,-4.39,49.25,-4.99,46.82,-5.8,44.17,-6.77,41.29,-7.8,38.32,-8.8,35.39,-2.84,53.67,-3.36,51.26,-3.89,48.85,-4.46,46.42,-5.12,43.97,-5.89,41.24,-6.78,38.29,-7.72,35.24,-8.63,32.24,-2.39,51.08,-3.03,48.59,-3.76,46.09,-4.53,43.59,-5.26,41.11,-6,38.24,-6.8,35.16,-7.62,31.99,-8.45,28.86,-2.18,48.52,-2.91,45.94,-3.75,43.35,-4.6,40.78,-5.38,38.27,-6.08,35.38,-6.81,32.27,-7.55,29.08,-8.3,25.94,-2.6,46.04,-3.3,43.36,-4.01,40.66,-4.71,38.01,-5.41,35.45,-6.12,32.82,-6.82,29.99,-7.52,27.07,-8.23,24.19,-3,44.16,-3.47,41.54,-3.89,38.93,-4.36,36.3,-4.96,33.65,-5.64,30.99,-6.3,28.28,-6.92,25.55,-7.48,22.83,-2.56,40.19,-2.84,37.84,-3.05,35.52,-3.35,33.14,-3.88,30.6,-4.48,28.07,-4.95,25.64,-5.33,23.25,-5.69,20.84,-1.79,35.39,-1.89,33.39,-1.92,31.45,-2.07,29.39,-2.54,27.05,-3.05,24.7,-3.26,22.62,-3.35,20.64,-3.48,18.6,-1.19,31.01,-1.1,29.32,-0.93,27.71,-0.93,25.94,-1.34,23.75,-1.75,21.56,-1.75,19.79,-1.57,18.18,-1.49,16.49]},{"duration":60,"tweenEasing":0,"value":[-7.26,52.5,-6.96,50.18,-6.63,47.88,-6.36,45.54,-6.25,43.13,-6.35,40.5,-6.62,37.63,-6.94,34.67,-7.24,31.76,-6.94,50.85,-6.75,48.45,-6.58,46.05,-6.45,43.64,-6.39,41.2,-6.47,38.49,-6.65,35.55,-6.88,32.52,-7.09,29.53,-6.51,49.18,-6.44,46.7,-6.47,44.21,-6.53,41.74,-6.56,39.27,-6.59,36.42,-6.68,33.34,-6.8,30.18,-6.92,27.07,-6.32,47.54,-6.34,44.98,-6.47,42.4,-6.62,39.84,-6.69,37.35,-6.69,34.47,-6.71,31.38,-6.74,28.2,-6.79,25.07,-6.76,45.99,-6.75,43.32,-6.75,40.64,-6.75,37.99,-6.75,35.45,-6.74,32.84,-6.74,30.02,-6.74,27.11,-6.74,24.25,-7.32,46.05,-7.23,43.34,-7.03,40.61,-6.84,37.92,-6.75,35.3,-6.74,32.68,-6.74,29.9,-6.74,27.06,-6.74,24.25,-7.26,45.48,-7.18,42.83,-7,40.17,-6.83,37.53,-6.75,34.94,-6.74,32.36,-6.74,29.68,-6.74,26.95,-6.74,24.24,-6.94,44.66,-6.91,42.12,-6.84,39.56,-6.78,37.02,-6.75,34.5,-6.74,31.98,-6.74,29.41,-6.74,26.82,-6.74,24.24,-6.76,43.97,-6.75,41.51,-6.75,39.04,-6.75,36.57,-6.75,34.1,-6.74,31.64,-6.74,29.17,-6.74,26.7,-6.74,24.24]},{"value":[-10.59,52.5,-10.29,50.18,-9.96,47.88,-9.69,45.54,-9.58,43.13,-9.69,40.5,-9.95,37.63,-10.27,34.67,-10.57,31.76,-10.28,50.85,-10.08,48.45,-9.91,46.05,-9.78,43.64,-9.73,41.2,-9.8,38.49,-9.98,35.55,-10.21,32.52,-10.42,29.53,-9.84,49.18,-9.78,46.7,-9.8,44.21,-9.86,41.74,-9.89,39.27,-9.92,36.42,-10.01,33.34,-10.13,30.18,-10.26,27.07,-9.65,47.54,-9.67,44.98,-9.81,42.4,-9.96,39.84,-10.02,37.35,-10.03,34.47,-10.04,31.38,-10.07,28.2,-10.12,25.07,-10.09,45.99,-10.09,43.32,-10.08,40.64,-10.08,37.99,-10.08,35.45,-10.08,32.84,-10.07,30.02,-10.07,27.11,-10.07,24.25,-10.65,46.05,-10.56,43.34,-10.37,40.61,-10.17,37.92,-10.08,35.3,-10.08,32.68,-10.07,29.9,-10.07,27.06,-10.07,24.25,-10.59,45.48,-10.51,42.83,-10.33,40.17,-10.16,37.53,-10.08,34.94,-10.08,32.36,-10.07,29.68,-10.07,26.95,-10.07,24.24,-10.28,44.66,-10.25,42.12,-10.18,39.56,-10.11,37.02,-10.08,34.5,-10.08,31.98,-10.07,29.41,-10.07,26.82,-10.07,24.24,-10.09,43.97,-10.09,41.51,-10.08,39.04,-10.08,36.57,-10.08,34.1,-10.08,31.64,-10.07,29.17,-10.07,26.7,-10.07,24.24]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EAR.02","timeline":[{"name":"B_EAR.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EAR.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EAR.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EAR.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_00","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-8.02,5.82,-6.89,4.51,-5.75,3.2,-4.61,1.89,-3.47,0.58,-2.33,-0.73,-1.2,-2.04,-0.06,-3.35,1.08,-4.66,-7.93,7.42,-6.8,6.11,-5.66,4.8,-4.52,3.49,-3.38,2.18,-2.24,0.87,-1.11,-0.44,0.03,-1.75,1.17,-3.06,-7.84,9.01,-6.7,7.71,-5.57,6.4,-4.43,5.09,-3.29,3.78,-2.15,2.47,-1.02,1.16,0.12,-0.15,1.26,-1.46,-7.75,10.61,-6.61,9.3,-5.48,7.99,-4.34,6.68,-3.2,5.37,-2.06,4.06,-0.93,2.75,0.21,1.45,1.35,0.14,-7.66,12.21,-6.52,10.9,-5.39,9.59,-4.25,8.28,-3.11,6.97,-1.97,5.66,-0.84,4.35,0.3,3.04,1.44,1.73,-7.57,13.81,-6.43,12.5,-5.3,11.19,-4.16,9.88,-3.02,8.57,-1.88,7.26,-0.75,5.95,0.39,4.64,1.53,3.33,-7.48,15.4,-6.34,14.09,-5.21,12.79,-4.07,11.48,-2.93,10.17,-1.79,8.86,-0.66,7.55,0.48,6.24,1.62,4.93,-7.39,17,-6.25,15.69,-5.12,14.38,-3.98,13.07,-2.84,11.76,-1.7,10.45,-0.56,9.14,0.57,7.83,1.71,6.53,-7.3,18.6,-6.16,17.29,-5.03,15.98,-3.89,14.67,-2.75,13.36,-1.61,12.05,-0.47,10.74,0.66,9.43,1.8,8.12]},{"duration":60,"tweenEasing":0,"offset":1,"value":[11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99]},{"value":[-3.07,16.05,-3.78,14.78,-4.5,13.51,-5.21,12.24,-5.92,10.97,-6.63,9.7,-7.34,8.43,-8.05,7.16,-8.77,5.89,-3.04,15.05,-3.75,13.78,-4.46,12.51,-5.17,11.24,-5.88,9.97,-6.6,8.7,-7.31,7.43,-8.02,6.16,-8.73,4.89,-3,14.05,-3.71,12.78,-4.43,11.51,-5.14,10.24,-5.85,8.97,-6.56,7.7,-7.27,6.43,-7.98,5.16,-8.69,3.89,-2.97,13.05,-3.68,11.78,-4.39,10.51,-5.1,9.24,-5.81,7.97,-6.52,6.7,-7.24,5.43,-7.95,4.16,-8.66,2.89,-2.93,12.05,-3.64,10.78,-4.35,9.51,-5.07,8.24,-5.78,6.97,-6.49,5.7,-7.2,4.43,-7.91,3.16,-8.62,1.89,-2.9,11.05,-3.61,9.78,-4.32,8.51,-5.03,7.24,-5.74,5.97,-6.45,4.7,-7.17,3.43,-7.88,2.16,-8.59,0.89,-2.86,10.05,-3.57,8.78,-4.28,7.51,-5,6.24,-5.71,4.97,-6.42,3.7,-7.13,2.43,-7.84,1.16,-8.55,-0.11,-2.83,9.06,-3.54,7.79,-4.25,6.51,-4.96,5.24,-5.67,3.97,-6.38,2.7,-7.1,1.43,-7.81,0.16,-8.52,-1.11,-2.79,8.06,-3.5,6.79,-4.21,5.52,-4.93,4.25,-5.64,2.98,-6.35,1.7,-7.06,0.43,-7.77,-0.84,-8.48,-2.11]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_01","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-1.36,-0.16,-0.22,-0.84,0.92,-1.53,2.06,-2.22,3.19,-2.9,4.33,-3.59,5.47,-4.28,6.61,-4.96,7.75,-5.65,-1.27,1.44,-0.13,0.75,1.01,0.07,2.15,-0.62,3.28,-1.31,4.42,-1.99,5.56,-2.68,6.7,-3.37,7.84,-4.05,-1.18,3.04,-0.04,2.35,1.1,1.66,2.24,0.98,3.37,0.29,4.51,-0.4,5.65,-1.08,6.79,-1.77,7.93,-2.46,-1.09,4.64,0.05,3.95,1.19,3.26,2.33,2.58,3.47,1.89,4.6,1.2,5.74,0.51,6.88,-0.17,8.02,-0.86,-1,6.23,0.14,5.55,1.28,4.86,2.42,4.17,3.56,3.49,4.69,2.8,5.83,2.11,6.97,1.42,8.11,0.74,-0.9,7.83,0.23,7.14,1.37,6.46,2.51,5.77,3.65,5.08,4.78,4.4,5.92,3.71,7.06,3.02,8.2,2.34,-0.81,9.43,0.32,8.74,1.46,8.05,2.6,7.37,3.74,6.68,4.87,5.99,6.01,5.31,7.15,4.62,8.29,3.93,-0.72,11.03,0.41,10.34,1.55,9.65,2.69,8.96,3.83,8.28,4.96,7.59,6.1,6.9,7.24,6.22,8.38,5.53,-0.63,12.62,0.5,11.94,1.64,11.25,2.78,10.56,3.92,9.88,5.05,9.19,6.19,8.5,7.33,7.81,8.47,7.13]},{"duration":60,"tweenEasing":0,"offset":1,"value":[5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1]},{"value":[-1.07,10.07,-1.78,9.43,-2.5,8.78,-3.21,8.13,-3.92,7.48,-4.63,6.83,-5.34,6.19,-6.05,5.54,-6.77,4.89,-1.04,9.07,-1.75,8.43,-2.46,7.78,-3.17,7.13,-3.88,6.48,-4.6,5.84,-5.31,5.19,-6.02,4.54,-6.73,3.89,-1,8.07,-1.71,7.43,-2.43,6.78,-3.14,6.13,-3.85,5.48,-4.56,4.84,-5.27,4.19,-5.98,3.54,-6.69,2.89,-0.97,7.08,-1.68,6.43,-2.39,5.78,-3.1,5.13,-3.81,4.48,-4.52,3.84,-5.24,3.19,-5.95,2.54,-6.66,1.89,-0.93,6.08,-1.64,5.43,-2.35,4.78,-3.07,4.13,-3.78,3.49,-4.49,2.84,-5.2,2.19,-5.91,1.54,-6.62,0.89,-0.9,5.08,-1.61,4.43,-2.32,3.78,-3.03,3.13,-3.74,2.49,-4.45,1.84,-5.17,1.19,-5.88,0.54,-6.59,-0.1,-0.86,4.08,-1.57,3.43,-2.28,2.78,-3,2.14,-3.71,1.49,-4.42,0.84,-5.13,0.19,-5.84,-0.46,-6.55,-1.1,-0.83,3.08,-1.54,2.43,-2.25,1.78,-2.96,1.14,-3.67,0.49,-4.38,-0.16,-5.1,-0.81,-5.81,-1.45,-6.52,-2.1,-0.79,2.08,-1.5,1.43,-2.21,0.78,-2.93,0.14,-3.64,-0.51,-4.35,-1.16,-5.06,-1.81,-5.77,-2.45,-6.48,-3.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_02","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[3.98,-6.13,5.11,-6.2,6.25,-6.26,7.39,-6.33,8.53,-6.39,9.67,-6.45,10.8,-6.52,11.94,-6.58,13.08,-6.65,4.07,-4.53,5.2,-4.6,6.34,-4.66,7.48,-4.73,8.62,-4.79,9.76,-4.86,10.89,-4.92,12.03,-4.99,13.17,-5.05,4.16,-2.94,5.3,-3,6.43,-3.07,7.57,-3.13,8.71,-3.19,9.85,-3.26,10.98,-3.32,12.12,-3.39,13.26,-3.45,4.25,-1.34,5.39,-1.4,6.52,-1.47,7.66,-1.53,8.8,-1.6,9.94,-1.66,11.07,-1.73,12.21,-1.79,13.35,-1.85,4.34,0.26,5.48,0.19,6.61,0.13,7.75,0.06,8.89,0,10.03,-0.06,11.16,-0.13,12.3,-0.19,13.44,-0.26,4.43,1.85,5.57,1.79,6.7,1.73,7.84,1.66,8.98,1.6,10.12,1.53,11.25,1.47,12.39,1.4,13.53,1.34,4.52,3.45,5.66,3.39,6.79,3.32,7.93,3.26,9.07,3.19,10.21,3.13,11.34,3.07,12.48,3,13.62,2.94,4.61,5.05,5.75,4.99,6.88,4.92,8.02,4.86,9.16,4.79,10.3,4.73,11.44,4.66,12.57,4.6,13.71,4.53,4.7,6.65,5.84,6.58,6.97,6.52,8.11,6.45,9.25,6.39,10.39,6.33,11.53,6.26,12.66,6.2,13.8,6.13]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.93,4.1,0.22,4.07,-0.5,4.05,-1.21,4.02,-1.92,4,-2.63,3.97,-3.34,3.95,-4.05,3.92,-4.77,3.9,0.96,3.1,0.25,3.07,-0.46,3.05,-1.17,3.02,-1.88,3,-2.6,2.97,-3.31,2.95,-4.02,2.92,-4.73,2.9,1,2.1,0.29,2.07,-0.43,2.05,-1.14,2.02,-1.85,2,-2.56,1.97,-3.27,1.95,-3.98,1.92,-4.69,1.9,1.03,1.1,0.32,1.07,-0.39,1.05,-1.1,1.02,-1.81,1,-2.52,0.97,-3.24,0.95,-3.95,0.92,-4.66,0.9,1.07,0.1,0.36,0.08,-0.35,0.05,-1.07,0.03,-1.78,0,-2.49,-0.03,-3.2,-0.05,-3.91,-0.08,-4.62,-0.1,1.1,-0.9,0.39,-0.92,-0.32,-0.95,-1.03,-0.97,-1.74,-1,-2.45,-1.02,-3.17,-1.05,-3.88,-1.07,-4.59,-1.1,1.14,-1.9,0.43,-1.92,-0.28,-1.95,-1,-1.97,-1.71,-2,-2.42,-2.02,-3.13,-2.05,-3.84,-2.07,-4.55,-2.1,1.17,-2.9,0.46,-2.92,-0.25,-2.95,-0.96,-2.97,-1.67,-3,-2.38,-3.02,-3.1,-3.05,-3.81,-3.07,-4.52,-3.1,1.21,-3.9,0.5,-3.92,-0.21,-3.95,-0.93,-3.97,-1.64,-4,-2.35,-4.02,-3.06,-4.05,-3.77,-4.07,-4.48,-4.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_03","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.31,20.14,1.46,20.72,3.3,21.34,5.01,21.88,6.38,22.26,7.52,22.58,8.66,22.97,9.8,23.39,10.93,23.79,-2.08,21.93,-0.33,22.52,1.48,23.14,3.16,23.7,4.52,24.08,5.66,24.47,6.8,25.01,7.93,25.6,9.07,26.17,-3.84,23.25,-2.11,23.97,-0.34,24.73,1.31,25.42,2.66,25.93,3.8,26.4,4.93,27.1,6.07,27.88,7.21,28.62,-5.61,24.77,-3.91,25.56,-2.17,26.39,-0.55,27.15,0.8,27.73,1.94,28.26,3.07,29.09,4.21,30.03,5.34,30.92,-7.43,27.19,-5.76,27.8,-4.02,28.44,-2.4,29.02,-1.07,29.41,0.07,29.93,1.21,30.81,2.34,31.84,3.48,32.8,-9.1,29.35,-7.65,29.88,-6.16,30.44,-4.73,30.94,-3.47,31.3,-2.26,31.94,-0.98,32.86,0.31,33.89,1.54,34.88,-10.48,32.32,-9.27,32.75,-8.06,33.19,-6.86,33.6,-5.7,33.92,-4.47,34.49,-3.14,35.28,-1.79,36.14,-0.5,36.97,-11.75,35.61,-10.78,35.94,-9.85,36.28,-8.87,36.6,-7.81,36.87,-6.58,37.31,-5.25,37.87,-3.89,38.49,-2.58,39.08,-13.07,38.74,-12.33,39,-11.63,39.27,-10.85,39.53,-9.85,39.79,-8.64,40.09,-7.33,40.44,-5.98,40.82,-4.64,41.18]},{"duration":60,"tweenEasing":0,"value":[8.71,26.27,9.35,26.92,10.05,27.6,10.62,28.21,10.86,28.65,10.86,29.03,10.86,29.49,10.86,29.97,10.86,30.44,6.85,26.47,7.46,27.12,8.14,27.81,8.68,28.43,8.9,28.88,8.9,29.33,8.9,29.93,8.9,30.59,8.9,31.22,5.01,26.18,5.59,26.97,6.23,27.8,6.74,28.55,6.95,29.12,6.95,29.66,6.95,30.42,6.95,31.27,6.95,32.08,3.14,26.11,3.7,26.97,4.31,27.86,4.8,28.68,5,29.32,5,29.92,5,30.81,5,31.82,4.99,32.77,1.23,26.93,1.77,27.61,2.36,28.32,2.85,28.95,3.05,29.41,3.04,29.99,3.04,30.94,3.04,32.03,3.04,33.06,-0.53,27.5,-0.21,28.09,0.14,28.71,0.43,29.28,0.55,29.71,0.61,30.4,0.76,31.39,0.92,32.49,1.01,33.54,-2,28.87,-1.93,29.36,-1.85,29.87,-1.79,30.34,-1.77,30.72,-1.68,31.36,-1.48,32.21,-1.27,33.14,-1.12,34.04,-3.36,30.56,-3.53,30.96,-3.73,31.36,-3.9,31.74,-3.97,32.08,-3.88,32.58,-3.69,33.21,-3.47,33.89,-3.29,34.55,-4.77,32.1,-5.17,32.42,-5.61,32.75,-5.96,33.07,-6.1,33.4,-6.03,33.76,-5.86,34.18,-5.64,34.62,-5.44,35.05]},{"value":[20.64,30.37,20.56,30.99,20.56,31.64,20.41,32.23,19.94,32.65,19.23,33,18.51,33.43,17.8,33.89,17.09,34.34,18.81,29.56,18.71,30.19,18.67,30.86,18.51,31.45,18.02,31.87,17.31,32.3,16.6,32.87,15.88,33.51,15.17,34.11,17,28.28,16.88,29.05,16.8,29.84,16.61,30.57,16.1,31.12,15.39,31.64,14.68,32.37,13.97,33.19,13.25,33.97,15.18,27.21,15.02,28.04,14.92,28.91,14.7,29.71,14.19,30.32,13.47,30.89,12.76,31.76,12.05,32.74,11.33,33.67,13.3,27.03,13.12,27.68,13.01,28.37,12.78,28.98,12.27,29.41,11.56,29.96,10.84,30.89,10.13,31.96,9.42,32.96,11.58,26.6,11.18,27.17,10.82,27.76,10.4,28.31,9.81,28.71,9.16,29.38,8.6,30.34,8.04,31.42,7.42,32.44,10.14,26.97,9.5,27.44,8.86,27.92,8.21,28.37,7.52,28.73,6.9,29.34,6.39,30.16,5.89,31.07,5.33,31.94,8.82,27.67,7.93,28.03,7.02,28.41,6.14,28.77,5.36,29.08,4.73,29.55,4.21,30.16,3.73,30.82,3.19,31.45,7.44,28.2,6.33,28.5,5.18,28.8,4.12,29.1,3.26,29.4,2.62,29.74,2.08,30.14,1.59,30.55,1.08,30.95]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_04","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-4.6,46.41,-2.19,47.64,0.36,48.93,2.63,50.09,4.24,50.91,5.38,51.61,6.52,52.45,7.65,53.36,8.79,54.23,-8.23,48.4,-5.87,49.64,-3.39,50.95,-1.16,52.13,0.43,52.96,1.57,53.8,2.7,54.93,3.84,56.19,4.97,57.38,-11.83,49.43,-9.51,50.94,-7.11,52.53,-4.95,53.97,-3.39,55.05,-2.25,56.06,-1.12,57.52,0.02,59.15,1.15,60.7,-15.47,50.88,-13.19,52.53,-10.85,54.26,-8.75,55.84,-7.2,57.05,-6.06,58.18,-4.93,59.9,-3.8,61.85,-2.66,63.69,-19.21,54.13,-16.99,55.41,-14.66,56.76,-12.56,57.97,-11.02,58.81,-9.88,59.91,-8.75,61.75,-7.61,63.87,-6.48,65.86,-22.63,56.85,-20.86,57.97,-19.02,59.15,-17.3,60.22,-15.92,61.01,-14.64,62.34,-13.22,64.24,-11.78,66.38,-10.44,68.41,-25.48,61.19,-24.2,62.1,-22.91,63.06,-21.65,63.95,-20.47,64.64,-19.15,65.85,-17.62,67.48,-16.06,69.29,-14.62,71.01,-28.11,66.18,-27.31,66.89,-26.58,67.64,-25.77,68.35,-24.77,68.95,-23.47,69.88,-21.95,71.08,-20.36,72.38,-18.87,73.63,-30.85,70.84,-30.5,71.43,-30.24,72.01,-29.81,72.6,-28.96,73.19,-27.68,73.85,-26.19,74.63,-24.61,75.44,-23.08,76.23]},{"duration":60,"tweenEasing":0,"value":[17.42,52.54,18.7,53.83,20.1,55.19,21.24,56.42,21.71,57.3,21.71,58.06,21.71,58.97,21.71,59.94,21.71,60.88,13.7,52.93,14.92,54.24,16.27,55.62,17.36,56.86,17.81,57.75,17.81,58.66,17.81,59.86,17.81,61.17,17.8,62.43,10.01,52.37,11.19,53.94,12.46,55.59,13.48,57.1,13.9,58.25,13.9,59.32,13.9,60.84,13.9,62.54,13.9,64.15,6.29,52.22,7.41,53.94,8.63,55.73,9.6,57.37,10,58.65,10,59.84,9.99,61.62,9.99,63.64,9.99,65.54,2.46,53.87,3.53,55.21,4.73,56.63,5.69,57.91,6.09,58.81,6.09,59.98,6.09,61.88,6.08,64.07,6.08,66.11,-1.05,55,-0.43,56.18,0.28,57.42,0.86,58.56,1.1,59.41,1.23,60.8,1.52,62.77,1.84,64.98,2.03,67.07,-4,57.74,-3.86,58.71,-3.71,59.74,-3.59,60.69,-3.54,61.45,-3.36,62.72,-2.97,64.42,-2.53,66.29,-2.24,68.07,-6.71,61.13,-7.06,61.91,-7.46,62.72,-7.79,63.49,-7.93,64.16,-7.77,65.16,-7.38,66.41,-6.93,67.78,-6.58,69.09,-9.54,64.19,-10.34,64.84,-11.21,65.5,-11.92,66.15,-12.21,66.8,-12.06,67.53,-11.71,68.36,-11.28,69.24,-10.88,70.1]},{"value":[40.35,56.64,40.91,57.91,41.61,59.24,42.04,60.44,41.8,61.3,41.08,62.03,40.37,62.92,39.66,63.86,38.95,64.78,36.67,56.03,37.18,57.31,37.81,58.66,38.19,59.88,37.92,60.75,37.21,61.63,36.5,62.8,35.79,64.1,35.07,65.33,33.01,54.47,33.47,56.02,34.04,57.64,34.35,59.12,34.05,60.25,33.34,61.3,32.63,62.79,31.92,64.46,31.2,66.05,29.32,53.32,29.73,55.01,30.24,56.78,30.5,58.4,30.18,59.65,29.47,60.81,28.76,62.57,28.04,64.56,27.33,66.44,25.52,53.97,25.89,55.29,26.37,56.68,26.63,57.93,26.31,58.81,25.6,59.95,24.89,61.83,24.17,63.99,23.46,66.01,22.05,54.1,21.96,55.25,21.96,56.48,21.83,57.59,21.36,58.42,20.77,59.77,20.36,61.72,19.96,63.91,19.44,65.97,19.14,55.84,18.57,56.79,18.01,57.79,17.42,58.72,16.76,59.45,16.21,60.69,15.9,62.37,15.63,64.22,15.21,65.97,16.46,58.23,15.41,58.99,14.29,59.77,13.25,60.52,12.4,61.17,11.85,62.13,11.52,63.37,11.26,64.71,10.9,65.99,13.66,60.3,12.16,60.92,10.58,61.55,9.16,62.18,8.15,62.8,7.59,63.51,7.23,64.32,6.95,65.17,6.63,66]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02","timeline":[{"name":"B_HAIR_FRONT.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_FRONT.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_FRONT.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_FRONT.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_FRONT.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_00","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-70,-27.99,-54.24,-43.61,-37.95,-57.8,-19,-60.63,-6.62,-62.03,2.85,-53.7,3.49,-42.18,-2.61,-33.32,-9.03,-24.18,-65.6,-33.17,-53.11,-51.85,-40.04,-67.04,-25.12,-75,-15.49,-80.97,-8.12,-73.63,-8.4,-57.83,-16.73,-46.53,-24.71,-35.43,-59.1,-40.99,-51.1,-62.43,-43.31,-78.26,-32.9,-90.84,-25.38,-100.6,-19.51,-93.34,-20.41,-72.9,-30.22,-59.17,-39.31,-46.14,-52.23,-46.18,-47.93,-69.73,-44.3,-87.34,-38.26,-103.62,-34.87,-115.52,-31.99,-108.08,-31.8,-84.31,-37.16,-66.88,-42.72,-50.41,-42.17,-44.51,-42.29,-68,-44.45,-88.37,-43.27,-106.83,-43.46,-121.14,-41.86,-117.66,-39.03,-94.83,-35.63,-71.7,-32.9,-48.8,-36.4,-39,-39.59,-62.48,-45.27,-85.84,-48.13,-106.53,-50.2,-123.66,-48.22,-124.66,-43.31,-103.56,-33.51,-75.96,-23.93,-47.62,-35.35,-26.63,-38.66,-51.61,-42.85,-77.03,-46.17,-98.68,-48.11,-118.86,-46.59,-125.45,-42.96,-107.08,-32.93,-79.63,-22.09,-48.48,-21.94,-11.24,-27.07,-37.88,-32.55,-64.45,-36.27,-85.95,-38.62,-109.22,-39.53,-121.89,-38.27,-106.33,-28.64,-80.83,-17.84,-47.58,-7.33,4.09,-14.43,-24.12,-21.4,-51.79,-25.59,-73.03,-28.5,-99.39,-31.97,-118.12,-33.13,-105.35,-24.02,-81.77,-13.33,-46.42]},{"duration":60,"tweenEasing":0,"value":[-74,-4.32,-62.98,-19.9,-50.98,-35.17,-33.94,-45.03,-22.54,-53.28,-10.57,-51.51,-4.93,-46.73,-0.66,-47.73,3.97,-48.51,-59.99,-12.87,-49.28,-32.84,-36.93,-51.54,-21.16,-65.55,-10.45,-73.54,0.14,-67.77,3.4,-60.46,1.74,-56.56,0.9,-52.23,-44.66,-24.08,-35.02,-47.4,-23.7,-68.32,-9.5,-85.86,0.46,-93.77,9.6,-84.15,10.68,-74.18,3.88,-65.33,-1.94,-55.66,-35.23,-33.33,-27.49,-57.75,-19.09,-79.29,-7.57,-98.99,1.49,-109.66,9.65,-100.95,10.3,-87.87,3.88,-72.49,-2.76,-56.12,-27.67,-39.23,-21.14,-61.49,-15.57,-82.24,-7.93,-101.36,-2.14,-117.12,3.86,-114.49,4.7,-97.29,0.59,-74.94,-3.91,-51.65,-22.71,-41.57,-16.59,-62.64,-12.4,-83.74,-8.28,-102.41,-6.18,-121.46,-2.79,-122.46,-1.76,-101.62,-3.58,-74.84,-5.9,-47.17,-21.39,-31.76,-15.76,-53.47,-10.8,-75.66,-7.61,-94.97,-6.15,-116.39,-3.56,-122.32,-3.72,-102.95,-5.39,-76.03,-6.87,-45.44,-10.25,-14.18,-8.04,-38.31,-5.93,-62.65,-4.08,-84.02,-4.69,-107.9,-5.02,-120.23,-6.8,-103.58,-7.54,-75.89,-7.73,-40.29,2,3.79,0.55,-22.88,-0.63,-49.57,-0.26,-73.03,-3.17,-99.39,-6.64,-118.12,-10.06,-104.07,-9.79,-75.49,-8.67,-34.73]},{"value":[-112.33,19.68,-92.29,-17.89,-70.25,-45.88,-47.02,-59.85,-35.29,-73.11,-23.83,-71.3,-17.27,-65.44,-16.34,-69.92,-15.7,-74.85,-83.2,5.22,-65.36,-29.06,-46.17,-55.27,-23.16,-69.82,-9.32,-82.7,2.34,-78.12,4.87,-70.28,0.85,-69.14,-3.7,-68.13,-57.81,-7.87,-41.02,-39.43,-22.77,-64.9,0.56,-80.34,16.24,-92.86,27.84,-85.56,26.28,-75.42,17.13,-68.47,7.31,-61.15,-35.26,-19.49,-20.77,-49.42,-5.78,-75.14,15.24,-92.79,30.83,-106.39,41.37,-99.14,36.9,-85.18,23.54,-70.44,10.09,-54.84,-20.17,-27.56,-8.98,-54.39,-0.4,-78.24,14.91,-96.96,26.79,-114.53,34.53,-112.86,31.84,-95.32,23.41,-73.52,14.43,-50.98,-20.05,-32.08,-7.23,-55.56,2.78,-78.23,15.01,-97.13,22.62,-117.81,26.91,-120.48,25.94,-100.34,22.38,-74.11,17.91,-47.12,-22.37,-25.01,-9.02,-49.95,3.97,-75.14,14.63,-95.15,21.17,-115.75,25.22,-120.95,23.76,-101.91,20.5,-75.49,17.46,-45.44,-8.51,-16.53,0.05,-43.23,8.68,-69.77,15.89,-90.62,19.43,-110.98,21.46,-119.83,19.16,-103.04,17.6,-75.61,16.6,-40.29,6.67,-8.21,10.11,-36.46,13.78,-64.3,17.37,-85.79,17.67,-106.06,17.4,-118.69,14.27,-104.07,14.54,-75.49,15.67,-34.73]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_01","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-54.33,-21.83,-36.32,-29.4,-18.17,-36.4,-1.85,-37.25,6.65,-25.39,11.96,-8.81,7.83,-4.38,-1.49,-2.31,-11.02,0.07,-53.79,-21.53,-41.16,-31.52,-28.63,-38.9,-16.74,-41.3,-10.52,-34.68,-6.51,-21.46,-8.54,-16.82,-14.45,-14.1,-20.84,-11.17,-52.15,-22.59,-45.59,-35.17,-39.86,-43.26,-32.61,-47.03,-27.64,-44.96,-23.94,-34.34,-23.86,-29.06,-26.61,-25.56,-30.03,-21.87,-48.96,-23.11,-46.15,-37.28,-43.46,-46.61,-39.22,-51.85,-34.77,-53.61,-30.41,-45.63,-29.22,-38.58,-31.03,-32.48,-32.41,-26.18,-38.83,-21.56,-41.3,-35.15,-44.34,-45.93,-43.2,-53.26,-41.4,-58.03,-38.09,-53.46,-35.29,-44.53,-30.96,-34.83,-26.28,-24.98,-30.01,-19.08,-37.33,-32.24,-45.42,-44.82,-47.2,-53.96,-48.26,-60.74,-46.2,-58.43,-41.79,-48,-31.3,-36.25,-20.58,-24.2,-26.89,-10.93,-35.25,-25.34,-43.19,-39.66,-45.19,-49.87,-46.35,-58.24,-44.8,-58.82,-41.09,-49.4,-30.23,-38.41,-18.66,-25.76,-14.78,2.8,-24.53,-14.5,-33.57,-31.48,-35.7,-43.24,-36.96,-53.98,-37.01,-58.91,-34.86,-51.33,-24.87,-41.22,-13.98,-27.43,-1.67,16.86,-12.89,-3.4,-23.17,-23.15,-25.46,-36.52,-26.92,-49.7,-28.65,-59.06,-28.1,-53.32,-19.13,-44.03,-9,-29.05]},{"duration":60,"tweenEasing":0,"value":[-37,-2.16,-31.49,-9.95,-25.49,-17.59,-16.97,-22.52,-11.27,-26.64,-5.28,-25.76,-2.46,-23.37,-0.33,-23.86,1.98,-24.26,-30,-6.43,-24.64,-16.44,-18.48,-25.75,-10.59,-32.77,-5.23,-36.75,0.07,-33.88,1.7,-30.23,0.87,-28.29,0.45,-26.11,-22.33,-12.04,-17.51,-23.71,-11.85,-34.14,-4.76,-42.92,0.23,-46.84,4.8,-42.06,5.34,-37.1,1.94,-32.67,-0.97,-27.83,-17.61,-16.67,-13.74,-28.87,-9.53,-39.64,-3.78,-49.52,0.75,-54.87,4.82,-50.49,5.15,-43.93,1.94,-36.24,-1.38,-28.06,-13.83,-19.62,-10.57,-30.73,-7.77,-41.13,-3.96,-50.73,-1.07,-58.69,1.92,-57.32,2.35,-48.62,0.29,-37.46,-1.95,-25.82,-11.36,-20.79,-8.3,-31.31,-6.2,-41.88,-4.14,-51.22,-3.1,-60.8,-1.4,-61.27,-0.88,-50.8,-1.79,-37.41,-2.95,-23.59,-10.7,-15.88,-7.88,-26.74,-5.4,-37.82,-3.8,-47.48,-3.07,-58.2,-1.78,-61.17,-1.86,-51.48,-2.7,-38.02,-3.43,-22.72,-5.12,-7.09,-4.02,-19.15,-2.96,-31.33,-2.04,-42.01,-2.34,-53.96,-2.51,-60.12,-3.4,-51.79,-3.77,-37.95,-3.87,-20.15,1,1.89,0.27,-11.44,-0.31,-24.78,-0.13,-36.51,-1.58,-49.69,-3.32,-59.06,-5.03,-52.04,-4.9,-37.75,-4.33,-17.36]},{"value":[-78.66,35.18,-61.21,18.23,-43.74,2.06,-29.9,-6.92,-23.44,-25.97,-16.69,-40.02,-16.4,-39.36,-17.19,-44.73,-17.68,-50.59,-54.15,20.91,-36.71,5.01,-18.47,-9.98,-4.41,-20.14,2.6,-36.29,8.04,-45.11,5.97,-42.18,0.78,-42.04,-4.14,-42.01,-29.05,4.73,-12.22,-9.61,5.72,-22.75,19.72,-33.68,27.17,-46.77,31.22,-50.2,26.86,-44.86,17.5,-39.26,8.28,-33.32,-12.77,-10.61,1.66,-23.48,16.56,-34.95,29.03,-46.02,36.29,-56.58,38.89,-55.96,33.44,-47.98,22.46,-37.68,11.47,-26.78,-3.17,-16.12,7.73,-28.33,18.12,-39.69,27.34,-50.3,33.13,-60.56,34.23,-60.01,30.38,-50.22,23.56,-37.91,16.38,-25.16,5.7,-19.28,13.17,-31.05,19.19,-42.67,25.24,-52.74,29.59,-62.16,29.17,-61.02,26.91,-49.91,24.22,-36.91,20.87,-23.53,6.24,-14.69,13.41,-26.71,19.85,-38.85,24.6,-48.95,27.99,-59.14,27.71,-60.53,25.62,-50.45,23.2,-37.49,20.9,-22.72,8.96,-6.47,15.31,-19.31,21.16,-32.14,24.38,-42.76,25.41,-54.42,24.47,-59.78,22.56,-51.26,21.37,-37.67,20.47,-20.15,12,1.89,17.45,-11.79,22.56,-25.35,24.2,-36.51,22.75,-49.69,21.02,-59.06,19.3,-52.04,19.44,-37.75,20,-17.36]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_02","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-17.33,-19.67,-4.83,-19.45,7.32,-18.81,15.12,-14.74,17.92,1.25,17.25,16.95,10.3,18.99,-1.16,21.55,-13,24.33,-23.79,-15.09,-16.5,-15.08,-10.14,-13.18,-6.15,-8.53,-5.3,2,-6.6,12.36,-10.24,13.34,-15.32,14.22,-21.29,14.95,-29.82,-10.55,-28.07,-11.44,-28,-9.19,-27.84,-4.14,-27.87,1.8,-28.75,7.66,-29.2,8,-28.55,7.11,-29.06,5.96,-31.34,-6.44,-32.41,-8.4,-33.94,-6.95,-35.44,-2.34,-35.51,1.27,-35.23,4.87,-34.37,5.34,-32.97,3.76,-31.03,1.88,-25,-1.95,-30.71,-4.41,-36.58,-4.8,-39.25,-2.54,-40.35,0.66,-40.02,3.86,-37.63,4.09,-31.22,2.61,-24.33,0.84,-18.66,1.7,-29.03,-0.93,-39.22,-2.94,-43.07,-2.74,-45.18,0.05,-44.8,2.85,-40.9,2.8,-29.48,1.16,-17.63,-0.62,-16.2,4.95,-27.35,1.42,-37.79,-1.86,-41.38,-2.38,-43.27,0,-43.01,2.37,-39.24,2.1,-27.55,-0.39,-15.22,-3.04,-9.65,9.89,-20.5,4.67,-30.61,-0.17,-33.66,-1.23,-34.62,0,-34.5,1.22,-31.46,0.47,-21.11,-3.26,-10.11,-7.29,-2.67,14.97,-13.16,8.04,-22.85,1.63,-25.33,0,-25.33,0,-25.33,0,-23.07,-1.28,-14.23,-6.28,-4.67,-11.69]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-31,38.67,-23.99,28.9,-17.08,19.79,-12.93,15.6,-12.17,0.67,-11.4,-14.26,-14.95,-16.43,-21.88,-23.02,-29,-30.33,-21.54,26.32,-10.67,20.09,0.66,14.42,7.76,12.22,8.08,0.55,8.08,-10.59,2.56,-11.42,-6.85,-15.08,-16.39,-19.28,-12.72,14.1,1.69,11.26,16.9,8.81,26.83,8.57,26.93,0.3,26.42,-6.92,18.96,-6.38,7.1,-7.17,-4.83,-8.3,-8.52,6.38,5.93,4.68,21.22,3.33,31.73,3.57,33.06,-1.04,32.97,-4.25,24.73,-2.73,11.57,-1.94,-1.19,-1.28,7.17,3.33,15.44,1.8,23.86,0.7,30.69,0.48,32.82,-1.48,31.71,-2.03,26.12,-0.91,18.62,-0.66,11,-0.67,22.86,0.29,24.84,-0.53,26.11,-1.14,29.24,-1.51,32.37,-1.27,30.43,0.36,27.49,1.02,25.67,0.55,23.19,-0.06,24.33,0,25.38,-0.53,26.43,-1.03,28.4,-1.46,31.06,-0.92,29.49,0.65,27.48,1.03,25.9,0.53,24.33,0,24.33,0,24.87,-0.28,25.42,-0.53,26.42,-0.75,27.76,-0.46,26.98,0.34,25.97,0.53,25.14,0.28,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_03","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-4.7,-20.21,5.04,-4.77,14.38,11.42,17.67,28.03,14.27,34.09,7.69,33.83,-7.05,23.44,-25.44,13.38,-44.03,3.48,-12.18,-9.27,-7.83,8.25,-5.21,27.87,-5.44,46.62,-8.8,49,-13.79,44.44,-23.22,31.84,-33.71,18.91,-44.8,5.68,-19.93,1.41,-21.05,20.19,-25.23,42.19,-28.95,62.96,-31.42,62.95,-34.05,55.3,-38.4,41,-41.5,24.87,-45.51,8.43,-26.23,8.93,-28.89,27.1,-32.79,49.74,-37.16,70.72,-39.95,71.82,-41.65,65.5,-43.36,51.41,-44.3,33.65,-44.61,15.88,-21.84,18.44,-28.77,33.48,-35.85,54.44,-40,69.34,-42.49,69.33,-43.12,65.05,-42.73,52.54,-38.25,37.67,-33.45,22.96,-17.88,27.52,-29.04,39.3,-39.32,58.37,-43.24,66.9,-45.36,65.07,-44.88,62.19,-42.55,50.89,-33.27,38.47,-23.69,26.56,-16.65,32.22,-28.13,41.67,-38.53,57.18,-41.93,63.3,-44.54,58.88,-44.9,55.2,-42.13,44.68,-31.89,32.1,-21.18,19.92,-12.96,39.74,-22.58,46.12,-31.38,55.93,-33.82,60.78,-34.98,53.39,-34.82,47.84,-31.97,37.57,-22.24,23.08,-12,8.61,-9.06,47.61,-16.66,50.89,-23.58,54.96,-24.96,58.51,-24.43,48.12,-23.49,40.68,-20.66,30.02,-11.83,12.69,-2.37,-4.98]},{"duration":60,"tweenEasing":0,"value":[12.64,-0.54,9.87,14.67,7.05,30.23,2.55,42.76,-3.65,32.84,-9.56,16.88,-17.35,4.45,-24.29,-8.17,-31.03,-20.85,11.61,5.82,8.66,23.33,4.93,41.07,0.71,55.14,-3.48,47.05,-7.17,32.14,-13.02,18.57,-18.37,4.64,-23.51,-9.27,9.89,11.96,7.01,31.63,2.76,51.43,-1.11,67.1,-3.54,61.22,-5.29,47.7,-9.23,33.07,-12.95,17.7,-16.45,2.47,5.12,15.37,3.51,35.53,1.14,56.71,-1.71,73.06,-4.43,70.55,-6.41,60.63,-9,46.07,-11.34,29.9,-13.58,14,3.16,20.39,1.95,37.89,0.73,59.28,-0.74,71.89,-2.13,68.67,-3.1,61.19,-5.09,48.45,-7.03,35.06,-9.12,22.12,0.78,25.82,-0.02,40.22,-0.1,61.32,-0.17,69.64,-0.17,65.02,-0.07,59.34,-1.64,48.09,-3.77,37.32,-6.06,27.18,-0.45,27.27,-0.77,40.25,-0.74,59.06,-0.55,65.67,-1.27,58.89,-1.89,52.84,-2.87,42.57,-4.29,32.5,-5.95,22.97,-3.31,29.85,-2.08,41.45,-0.77,56.12,-0.16,62.01,-0.37,53.39,-0.31,46.62,-0.49,37.07,-1.08,26.34,-1.89,15.9,-6.39,32.64,-3.51,42.85,-0.72,53.33,0.37,58.52,0.9,48.12,1.85,40.69,2.42,31.3,2.41,18.97,2.3,6.71]},{"value":[-18.36,38.13,-15.97,42.95,-13.59,48.83,-14.12,54.83,-20.44,36.55,-25.77,13.49,-35.75,-1.62,-47.48,-18.12,-59.03,-35.18,-7.02,32.94,-1.84,42.59,3.22,53.18,4.64,63.05,-0.91,48.97,-6.05,29.47,-16.71,15,-28.96,-1.12,-41.43,-18.53,3.64,27.94,11.48,42.31,19,57.46,22.32,71.1,17.68,61.18,12.88,45.19,1.08,31.59,-13.12,16.02,-27.41,-1.46,7.5,26.16,16.29,42.51,25.02,60.41,29.46,74.94,26.14,68.18,21.82,55.97,10.04,43.31,-5.11,28.34,-19.95,11.42,15.57,26.47,20.65,41.2,25.95,60.16,29.36,71.38,28.25,66.5,24.72,59.31,16.3,47.56,5.34,33.11,-5.49,17.62,24.07,26.36,25.03,39.81,26.22,60.1,28.43,67.74,29.74,63.24,27.29,59.64,22.4,48.51,16.19,34.63,9.66,20.76,23.88,27.27,24.61,39.72,25.69,58.03,27.31,64.01,27.55,57.99,24.78,54.15,21.95,44.04,18.24,31.64,14.16,19.53,21.03,29.85,22.79,41.18,24.65,55.58,25.96,61.3,26.01,54.64,24.76,50.53,23.58,41.11,21.64,28.79,19.39,16.6,17.94,32.64,20.83,42.85,23.61,53.33,24.66,58.82,24.73,51.62,25.22,47.38,25.64,38.08,25.2,24.9,24.63,11.71]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_04","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[7.94,-20.75,14.91,9.9,21.43,41.64,20.22,70.79,10.62,66.93,-1.88,50.71,-24.39,27.89,-49.73,5.21,-75.06,-17.36,-0.57,-3.45,0.84,31.58,-0.27,68.91,-4.68,101.56,-12.3,95.72,-21.04,76.5,-36.18,50.34,-52.11,23.59,-68.31,-3.59,-10.04,13.37,-14.03,51.82,-22.45,93.57,-30.01,129.72,-34.94,123.66,-39.38,102.9,-47.58,73.97,-54.46,42.65,-61.96,10.91,-21.11,24.31,-25.38,62.62,-31.64,106.44,-38.88,143.83,-44.39,142.44,-48.06,126.14,-52.35,97.49,-55.63,63.56,-58.2,29.88,-18.69,38.82,-26.82,71.36,-35.12,113.71,-40.75,141.28,-44.64,138.07,-46.22,126.26,-47.82,100.96,-45.28,72.75,-42.57,45.09,-17.1,53.34,-29.06,79.52,-39.41,119.68,-43.41,136.54,-45.54,130.1,-44.95,121.53,-44.21,98.93,-37.06,75.76,-29.75,53.74,-17.11,59.48,-28.9,81.91,-39.28,116.24,-42.48,128.97,-45.8,117.77,-46.79,108.04,-45.03,87.17,-36.24,64.55,-27.13,42.89,-16.27,69.59,-24.66,87.58,-32.15,112.05,-33.98,122.8,-35.35,106.79,-35.13,94.46,-32.48,74.61,-23.39,49.39,-13.89,24.51,-15.45,80.25,-20.17,93.74,-24.3,108.29,-24.58,117.03,-23.53,96.25,-21.64,81.37,-18.24,61.32,-9.42,31.66,-0.07,1.73]},{"duration":60,"tweenEasing":0,"value":[25.28,-1.08,19.74,29.34,14.11,60.45,5.11,85.53,-7.29,65.68,-19.13,33.76,-34.69,8.9,-48.57,-16.34,-62.06,-41.69,23.22,11.65,17.33,46.67,9.87,82.14,1.49,109.98,-6.93,93.75,-14.4,64.29,-26.07,37.13,-36.74,9.28,-47.02,-18.54,19.78,23.92,14.02,63.27,5.54,102.84,-2.15,133.81,-7.04,121.93,-10.61,95.35,-18.49,66.11,-25.89,35.4,-32.91,4.95,10.23,30.75,7.03,71.05,2.28,113.43,-3.44,146.17,-8.87,141.17,-12.82,121.26,-17.98,92.15,-22.67,59.81,-27.17,28,6.31,40.77,3.91,75.76,1.46,118.58,-1.48,143.83,-4.27,137.42,-6.19,122.39,-10.19,96.87,-14.06,70.13,-18.24,44.24,1.55,51.64,-0.04,80.44,-0.2,122.63,-0.34,139.29,-0.34,130.05,-0.14,118.67,-3.29,96.13,-7.53,74.62,-12.12,54.36,-0.91,54.54,-1.54,80.49,-1.48,118.13,-1.1,131.34,-2.55,117.78,-3.79,105.69,-5.75,85.04,-8.57,64.97,-11.9,45.93,-6.61,59.69,-4.16,82.9,-1.54,112.24,-0.32,124.02,-0.73,106.8,-0.62,93.25,-0.97,74.08,-2.15,52.65,-3.78,31.8,-12.79,65.28,-7.01,85.7,-1.45,106.65,0.75,117.03,1.8,96.25,3.7,81.37,4.83,62.6,4.81,37.94,4.6,13.42]},{"value":[-5.72,37.59,-7.95,57.01,-10.1,77.87,-15.3,94.07,-28.71,72.43,-40.14,41.25,-56.55,13.2,-73.08,-13.22,-89.06,-40.02,7.51,39.56,7.01,65.1,5.77,91.92,1.49,113.87,-9.92,97.48,-20.18,69.61,-35.89,41.35,-51.09,12.85,-66.47,-17.78,20,41.77,21.29,73.38,21.07,106.07,17.78,133.69,8.42,122.24,-0.63,97.4,-16.74,69.51,-33.35,39.21,-50,5.38,23.53,45.93,26.64,80.34,28.84,117.5,27.19,146.37,19.22,137.52,10.68,116.22,-4.64,89.32,-21.8,58.62,-38.71,24.12,23.98,49.6,25.84,80.57,28.05,119.69,28,142.34,23.65,134.59,17.74,120.68,6.48,96.04,-7.95,66.88,-21.99,35.91,25.28,52.43,25.22,80.13,26.33,121.36,27.61,136.98,27.11,127.76,24.14,118.92,17.31,96.03,6.71,68.7,-3.86,41.57,23.42,54.54,23.84,79.96,24.95,117.09,26.23,129.48,24.06,116.93,20.08,107.66,16.41,86.94,10.63,62.73,3.98,39.06,17.72,59.69,20.71,82.63,23.88,111.7,25.52,123.36,24.27,109.76,22.54,100.73,21.2,81.62,18.18,57.31,14.45,33.21,11.55,65.28,17.32,85.7,22.88,106.65,25,117.64,25.13,103.25,26.12,94.77,26.95,76.17,26.07,49.8,24.93,23.42]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02","timeline":[{"name":"B_HAIR_SIDE.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_SIDE.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_SIDE.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_SIDE.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_00","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-67.76,-49.87,-57.41,-56.77,-49.99,-64.04,-40.89,-65.8,-34.23,-64.45,-30.95,-63.09,-30.6,-64.06,-30.15,-54.9,-29.67,-44.55,-51.46,-47.73,-45.1,-53.68,-41.03,-59.43,-35.83,-61.56,-32.28,-63.24,-30.79,-64.92,-30.59,-65.95,-30.15,-55.88,-29.67,-44.56,-36.36,-45.22,-33.74,-50.28,-32.66,-54.91,-31.2,-57.27,-30.51,-61.87,-30.65,-66.47,-30.57,-67.57,-30.14,-56.72,-29.67,-44.56,-32.31,-39.15,-31.1,-44.48,-30.06,-49.48,-30.32,-53.01,-30.47,-58.92,-30.62,-64.83,-30.53,-66,-30.11,-55.9,-29.67,-44.57,-32.01,-29.49,-30.92,-32.8,-29.96,-36.09,-30.01,-40.03,-30.09,-45.97,-30.17,-51.91,-30.12,-54.72,-29.9,-50.06,-29.67,-44.58,-31.7,-22.25,-30.73,-22.59,-29.85,-23.25,-29.7,-27.05,-29.71,-33.02,-29.72,-38.99,-29.72,-43.49,-29.7,-44.26,-29.67,-44.58,-31.38,-20.53,-30.51,-23.51,-29.47,-26.68,-29.2,-31.16,-29.43,-34.51,-29.65,-37.86,-29.67,-41.86,-29.67,-43.38,-29.67,-44.59,-30.25,-16.25,-30.08,-23.84,-29.77,-31.26,-29.67,-36.58,-29.67,-36.82,-29.67,-37.06,-29.67,-40.94,-29.67,-42.9,-29.67,-44.6,-29.02,-11.62,-29.63,-23.81,-30.19,-35.47,-30.3,-41.64,-30,-38.89,-29.69,-36.14,-29.66,-39.95,-29.67,-42.4,-29.67,-44.6]},{"duration":60,"tweenEasing":0,"value":[-38.02,-28.89,-27.68,-36.26,-20.26,-43.96,-11.12,-46.12,-4.01,-47.97,-0.28,-49.82,-0.01,-52.51,-0.01,-48.91,0,-44.57,-22.89,-32.95,-16.72,-39.4,-12.73,-45.81,-7.29,-49.38,-2.93,-53.3,-0.64,-57.22,-0.42,-59.22,-0.21,-52.38,0,-44.58,-8.91,-36.71,-6.62,-42.2,-5.74,-47.61,-3.79,-52.36,-1.97,-58.23,-0.98,-64.09,-0.8,-65.48,-0.4,-55.63,0,-44.59,-5.19,-35.34,-4.28,-40.63,-3.41,-46,-3.1,-51.81,-2.08,-58.3,-1.06,-64.79,-0.86,-66.02,-0.44,-55.92,0,-44.59,-3.67,-27.51,-2.75,-30.75,-1.89,-34.2,-1.62,-39.41,-1.09,-45.66,-0.56,-51.9,-0.45,-54.74,-0.24,-50.08,0,-44.6,-2.15,-22.1,-1.22,-22.34,-0.37,-22.94,-0.15,-27.01,-0.1,-33.02,-0.06,-39.02,-0.05,-43.52,-0.04,-44.28,0,-44.61,-1.72,-20.55,-0.85,-23.54,0.2,-26.7,0.47,-31.18,0.24,-34.53,0.01,-37.88,-0.01,-41.88,0,-43.4,0,-44.61,-0.58,-16.27,-0.41,-23.86,-0.1,-31.28,-0.01,-36.6,-0.01,-36.84,0,-37.08,0,-40.96,0,-42.92,0,-44.62,0.65,-11.64,0.04,-23.83,-0.52,-35.5,-0.64,-41.66,-0.33,-38.91,-0.03,-36.16,0,-39.97,0,-42.42,0,-44.63]},{"value":[-71.02,-20.56,-53.42,-23.73,-39.38,-27.65,-25.93,-30.05,-15.68,-37.8,-4.31,-43.87,3.8,-45.45,10.38,-45.12,17,-44.57,-43.41,-25.57,-29.37,-30.13,-17.27,-35.09,-6.62,-38.76,0.98,-46.83,9.26,-54.28,14.65,-55.98,18.41,-51.14,22.55,-45.81,-16.83,-30.75,-6.53,-36.63,3.32,-42.61,11.16,-47.36,16.33,-55.5,21.76,-64.04,24.61,-65.8,25.87,-56.85,27.68,-46.96,-3.51,-32.79,3.04,-39.52,9.93,-46.17,15.2,-51.49,20.02,-58.07,24.85,-65.62,26.49,-67.45,27.47,-57.88,28.48,-47.14,5.33,-26.18,9.23,-30.23,13.13,-34.28,16.1,-39.25,18.58,-45.49,21.05,-52.3,21.95,-55.48,22.45,-51.1,23,-45.93,14.16,-21.98,15.43,-22.36,16.33,-23.01,17,-26.96,17.13,-32.92,17.26,-39.02,17.41,-43.57,17.44,-44.36,17.51,-44.72,15.28,-20.55,16.15,-23.54,17.2,-26.7,17.47,-31.18,17.24,-34.53,17.01,-37.88,16.99,-41.88,17,-43.4,17,-44.61,16.42,-16.27,16.59,-23.86,16.9,-31.28,16.99,-36.6,16.99,-36.84,17,-37.08,17,-40.96,17,-42.92,17,-44.62,17.65,-11.64,17.04,-23.83,16.48,-35.5,16.36,-41.66,16.67,-38.91,16.97,-36.16,17,-39.97,17,-42.42,17,-44.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_01","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-29.73,-29.49,-29.73,-34.68,-29.73,-39.7,-29.77,-42.74,-30.22,-41.5,-30.67,-40.26,-30.59,-40.89,-30.15,-36.5,-29.67,-31.51,-28.56,-23.29,-28.4,-27.21,-28.27,-30.84,-28.57,-33.01,-29.58,-36.81,-30.6,-40.62,-30.58,-41.71,-30.14,-36.92,-29.67,-31.51,-27.45,-17.02,-27.14,-19.86,-26.9,-22.3,-27.45,-23.67,-28.99,-32.23,-30.53,-40.79,-30.56,-42.33,-30.14,-37.24,-29.67,-31.51,-27.06,-12.44,-26.8,-15.42,-26.62,-17.99,-27.27,-19.36,-28.87,-29.55,-30.47,-39.75,-30.52,-41.41,-30.1,-36.76,-29.67,-31.51,-27.67,-11.82,-27.8,-15.1,-27.98,-18.11,-28.41,-20.28,-29.25,-28.33,-30.09,-36.39,-30.11,-38.22,-29.9,-35.11,-29.67,-31.51,-28.28,-11.21,-28.81,-14.77,-29.34,-18.24,-29.56,-21.21,-29.63,-27.11,-29.7,-33.02,-29.71,-35.05,-29.7,-33.47,-29.67,-31.51,-28.62,-11.3,-28.96,-14.97,-29.4,-18.56,-29.53,-21.92,-29.59,-26.67,-29.66,-31.42,-29.67,-33.51,-29.67,-32.64,-29.67,-31.51,-29.77,-11.87,-29.34,-16.05,-29.02,-20.12,-28.98,-23.3,-29.31,-25.39,-29.64,-27.47,-29.67,-29.76,-29.67,-30.7,-29.67,-31.51,-31,-12.49,-29.77,-17.22,-28.62,-21.81,-28.39,-24.78,-29,-24,-29.61,-23.22,-29.67,-25.76,-29.67,-28.63,-29.67,-31.51]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-8.51,0,-14.17,0,-19.61,0,-23.06,0,-25.02,0,-26.99,0,-29.34,0,-30.51,0,-31.53,0,-8.51,0,-12.93,0,-17.22,-0.02,-20.83,-0.23,-26.87,-0.44,-32.91,-0.41,-34.96,-0.2,-33.41,0,-31.53,0,-8.51,0,-11.77,0,-14.97,-0.04,-18.76,-0.45,-28.58,-0.85,-38.41,-0.79,-40.21,-0.39,-36.13,0,-31.53,0.06,-8.63,0.01,-11.54,0,-14.45,-0.04,-18.17,-0.48,-28.94,-0.92,-39.7,-0.85,-41.43,-0.43,-36.78,0,-31.53,0.67,-9.84,0.36,-13.03,0.07,-16.19,-0.02,-19.66,-0.25,-28.02,-0.48,-36.38,-0.45,-38.25,-0.23,-35.14,0,-31.53,1.28,-11.06,0.7,-14.52,0.14,-17.94,0,-21.16,-0.02,-27.11,-0.04,-33.05,-0.04,-35.07,-0.03,-33.49,0,-31.53,1.04,-11.32,0.71,-14.99,0.27,-18.58,0.14,-21.94,0.07,-26.69,0.01,-31.45,0,-33.53,0,-32.67,0,-31.53,-0.1,-11.89,0.33,-16.08,0.64,-20.14,0.69,-23.33,0.36,-25.41,0.03,-27.5,0,-29.78,0,-30.73,0,-31.53,-1.33,-12.51,-0.1,-17.24,1.04,-21.83,1.28,-24.8,0.67,-24.02,0.06,-23.24,0,-25.78,0,-28.66,0,-31.53]},{"value":[15,6.49,15.93,0.37,16.78,-5.5,17,-9.14,17,-12.02,17,-14.9,17,-18.65,17,-24.95,17,-31.53,16.19,0.86,16.72,-3.52,17.16,-7.74,17.23,-11.52,16.9,-18.84,16.57,-26.15,16.59,-29.06,16.8,-30.33,17,-31.53,17.2,-4.76,17.35,-7.61,17.41,-10.39,17.37,-14.32,16.77,-25.48,16.17,-36.63,16.21,-38.83,16.6,-35.39,17,-31.53,17.06,-8.63,17.01,-11.54,17,-14.45,16.96,-18.17,16.52,-28.94,16.08,-39.7,16.15,-41.43,16.57,-36.78,17,-31.53,17.67,-9.84,17.36,-13.03,17.07,-16.19,16.98,-19.66,16.75,-28.02,16.52,-36.38,16.55,-38.25,16.77,-35.14,17,-31.53,18.28,-11.06,17.7,-14.52,17.14,-17.94,17,-21.16,16.98,-27.11,16.96,-33.05,16.96,-35.07,16.97,-33.49,17,-31.53,18.04,-11.32,17.71,-14.99,17.27,-18.58,17.14,-21.94,17.07,-26.69,17.01,-31.45,17,-33.53,17,-32.67,17,-31.53,16.9,-11.89,17.33,-16.08,17.64,-20.14,17.69,-23.33,17.36,-25.41,17.03,-27.5,17,-29.78,17,-30.73,17,-31.53,15.67,-12.51,16.9,-17.24,18.04,-21.83,18.28,-24.8,17.67,-24.02,17.06,-23.24,17,-25.78,17,-28.66,17,-31.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_02","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-29.73,-20.98,-29.73,-20.51,-29.73,-20.09,-29.77,-19.68,-30.22,-16.48,-30.67,-13.28,-30.59,-11.55,-30.15,-5.99,-29.67,0.02,-28.56,-14.78,-28.4,-14.27,-28.27,-13.61,-28.55,-12.18,-29.35,-9.94,-30.15,-7.7,-30.17,-6.74,-29.94,-3.5,-29.67,0.02,-27.45,-8.51,-27.14,-8.08,-26.9,-7.3,-27.41,-4.92,-28.54,-3.64,-29.68,-2.37,-29.78,-2.13,-29.74,-1.11,-29.67,0.02,-27.12,-3.81,-26.81,-3.88,-26.63,-3.54,-27.23,-1.19,-28.39,-0.62,-29.56,-0.04,-29.67,0.02,-29.67,0.02,-29.67,0.02,-28.34,-1.98,-28.16,-2.07,-28.05,-1.92,-28.39,-0.62,-29,-0.31,-29.61,-0.01,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.55,-0.15,-29.51,-0.25,-29.48,-0.3,-29.56,-0.04,-29.61,-0.01,-29.66,0.03,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[15,15,15.93,14.54,16.78,14.11,17,13.91,17,13,17,12.09,17,10.69,17,5.55,17,0,16.19,9.37,16.71,9.41,17.16,9.48,17.25,9.33,17.13,8.04,17.01,6.74,17,5.9,17,3.09,17,0,17.2,3.75,17.35,4.16,17.41,4.58,17.4,4.5,17.21,3.11,17.02,1.72,17,1.42,17,0.76,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_03","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-13.86,0.08,-7.53,11.72,-1.33,23.13,2.78,33.77,4.09,50,4.56,64.54,3.72,72.52,0.37,82.31,-3.26,92.37,-13.74,5.51,-10.15,17.56,-6.96,29.46,-4.69,39.72,-3.58,54.2,-2.99,67.64,-3.51,75.17,-5.73,83.82,-8.2,92.64,-13.62,10.8,-12.6,23.21,-12.13,35.46,-11.61,45.37,-10.72,58.23,-10.04,70.66,-10.27,77.78,-11.41,85.29,-12.76,92.89,-13.52,13.89,-13.39,25.95,-13.33,37.82,-13.54,47.4,-12.97,59.28,-12.41,71.17,-12.53,78.29,-13.21,85.48,-13.9,92.73,-13.8,17.02,-13.84,26.79,-14,36.45,-14.18,44.76,-13.88,55.03,-13.59,65.31,-13.57,72.74,-13.59,81.38,-13.72,90.18,-14.5,21.41,-14.58,28.42,-14.73,35.39,-14.81,42.22,-14.79,51.21,-14.78,60.2,-14.67,67.72,-14.27,77.34,-13.95,87.2,-14.85,22.67,-14.86,29.06,-14.86,35.44,-14.87,42.05,-14.88,50.87,-14.89,59.69,-14.83,67.1,-14.58,76.99,-14.33,87.18,-14.85,22.69,-14.86,29.07,-14.86,35.46,-14.87,42.07,-14.88,50.89,-14.89,59.71,-14.86,67.38,-14.74,78.13,-14.62,89.26,-14.85,22.71,-14.86,29.09,-14.86,35.47,-14.87,42.08,-14.88,50.9,-14.88,59.72,-14.89,67.69,-14.91,79.38,-14.93,91.5]},{"duration":60,"tweenEasing":0,"value":[1,10.57,7.8,26.61,14.42,42.08,18.62,53.18,19.7,63.24,19.93,71.61,19.02,78.3,15.44,85.3,11.57,92.36,0.54,12.9,4.39,27.55,7.88,41.75,10.35,51.71,11.5,62.26,12.13,71.76,11.58,78.55,9.24,85.57,6.63,92.63,0.11,15.05,1.17,28.34,1.78,41.21,2.61,50.09,3.82,61.23,4.82,71.94,4.62,78.85,3.46,85.85,2.07,92.88,0.04,15.79,0.01,27.9,-0.02,39.6,0.07,47.99,1.26,59.7,2.45,71.4,2.38,78.49,1.67,85.58,0.93,92.72,0.37,18.01,0.24,27.83,0.03,37.41,0.06,45.22,1.05,56.32,2.05,67.41,2.03,74.63,1.59,82.35,1.12,90.16,0.27,21.49,0.17,28.54,0.01,35.54,0.02,42.45,0.63,52.93,1.24,63.42,1.26,70.67,1.09,78.86,0.88,87.18,-0.02,22.66,-0.02,29.05,-0.03,35.43,0,42.19,0.4,52.2,0.8,62.21,0.79,69.41,0.65,78.18,0.51,87.17,-0.02,22.68,-0.02,29.06,-0.03,35.44,-0.02,42.14,0.19,51.57,0.39,61.01,0.38,68.57,0.3,78.74,0.22,89.24,-0.02,22.7,-0.02,29.08,-0.03,35.46,-0.04,42.07,-0.04,50.89,-0.05,59.71,-0.06,67.68,-0.08,79.37,-0.09,91.49]},{"value":[8.5,18.07,15.3,29.25,21.92,40.23,26.17,50.56,27.7,64.74,28.39,77.22,27.52,83.64,23.94,88.08,20.07,92.36,8.63,17.59,12.4,29.4,15.75,41,18.21,50.48,19.66,63.18,20.6,74.85,20.08,81.49,17.75,87.11,15.13,92.63,8.71,16.93,9.64,29.33,10.03,41.4,10.8,50.09,12.16,61.6,13.31,72.69,13.12,79.55,11.96,86.23,10.57,92.88,8.54,15.79,8.51,27.9,8.48,39.6,8.57,48,9.72,59.59,10.87,71.19,10.8,78.28,10.12,85.47,9.43,92.72,8.87,18.01,8.74,27.83,8.53,37.41,8.52,45.07,9.12,55.19,9.71,65.31,9.77,72.73,9.74,81.37,9.62,90.16,8.77,21.49,8.67,28.54,8.51,35.54,8.47,42.24,8.51,51.21,8.55,60.18,8.67,67.71,9.07,77.33,9.38,87.18,8.48,22.66,8.48,29.05,8.47,35.43,8.46,42.04,8.45,50.86,8.45,59.68,8.51,67.09,8.76,76.98,9.01,87.17,8.48,22.68,8.48,29.06,8.47,35.44,8.46,42.06,8.45,50.88,8.45,59.7,8.47,67.37,8.6,78.12,8.72,89.24,8.48,22.7,8.48,29.08,8.47,35.46,8.46,42.07,8.46,50.89,8.45,59.71,8.44,67.68,8.42,79.37,8.41,91.49]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_04","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-27.72,0.16,-14.13,32.7,-0.88,64.08,7.47,86.68,9.18,110,9.2,129.94,7.44,145.05,0.73,164.62,-6.52,184.74,-27.49,11.02,-19.62,40.81,-12.52,69.94,-7.85,91.24,-6.35,114.57,-5.9,135.8,-7.02,150.34,-11.46,167.64,-16.4,185.28,-27.24,21.59,-24.79,48.61,-23.34,75.18,-22.2,95.28,-20.91,118.81,-20.03,141.51,-20.54,155.56,-22.83,170.59,-25.52,185.78,-27.05,27.78,-26.78,51.92,-26.66,75.66,-27.08,94.79,-25.86,118.78,-24.65,142.76,-24.91,157,-26.33,171.18,-27.8,185.47,-27.6,34.04,-27.68,53.59,-27.99,72.91,-28.28,89.83,-26.89,112.32,-25.51,134.81,-25.61,149.28,-26.49,164.72,-27.43,180.35,-29.01,42.82,-29.16,56.83,-29.45,70.79,-29.52,84.86,-28.34,105.86,-27.17,126.86,-27.15,141.36,-27.49,157.73,-27.91,174.39,-29.7,45.35,-29.71,58.11,-29.73,70.88,-29.67,84.39,-28.87,104.42,-28.07,124.44,-28.08,138.86,-28.37,156.38,-28.66,174.36,-29.7,45.38,-29.71,58.15,-29.73,70.91,-29.7,84.29,-29.29,103.16,-28.89,122.04,-28.9,137.17,-29.07,157.51,-29.23,178.51,-29.7,45.41,-29.71,58.18,-29.73,70.94,-29.74,84.17,-29.76,101.81,-29.77,119.45,-29.79,135.39,-29.82,158.76,-29.86,183]},{"duration":60,"tweenEasing":0,"value":[2.01,21.14,15.6,53.22,28.85,84.17,37.24,106.36,39.4,126.47,39.87,143.22,38.04,156.6,30.88,170.61,23.14,184.72,1.07,25.8,8.77,55.07,15.76,83.52,20.7,103.41,23,124.5,24.25,143.5,23.16,157.08,18.49,171.15,13.27,185.26,0.21,30.11,2.34,56.67,3.57,82.43,5.21,100.2,7.64,122.45,9.64,143.87,9.24,157.69,6.92,171.7,4.14,185.76,0.07,31.59,0.02,55.81,-0.05,79.22,0.15,95.99,2.53,119.39,4.9,142.8,4.75,156.98,3.34,171.16,1.86,185.44,0.73,36.01,0.47,55.66,0.06,74.84,0.11,90.45,2.11,112.63,4.1,134.82,4.06,149.26,3.18,164.7,2.23,180.33,0.54,42.97,0.35,57.09,0.03,71.09,0.04,84.9,1.27,105.87,2.49,126.83,2.51,141.34,2.18,157.71,1.76,174.37,-0.03,45.33,-0.05,58.09,-0.06,70.86,0,84.37,0.8,104.39,1.6,124.42,1.59,138.84,1.3,156.36,1.01,174.33,-0.03,45.36,-0.05,58.12,-0.06,70.89,-0.04,84.27,0.37,103.14,0.78,122.01,0.77,137.15,0.6,157.49,0.43,178.49,-0.03,45.39,-0.05,58.16,-0.06,70.92,-0.08,84.14,-0.09,101.79,-0.1,119.43,-0.12,135.36,-0.15,158.74,-0.19,182.98]},{"value":[17.01,36.14,32.76,64.67,48.01,92.34,57.14,113.77,61.73,134.81,64.64,152.47,62.16,164.91,51.59,174.93,40.14,184.72,17.26,35.17,27.2,62.8,36.86,89.76,42.52,109.22,44.56,130,45.57,148.73,44.02,161.62,37.59,173.57,30.27,185.26,17.41,33.86,21.49,60.44,25.52,86.3,27.77,103.96,27.95,125.03,27.73,145.29,27.08,158.75,24.5,172.31,21.14,185.76,17.07,31.59,17.02,55.81,16.95,79.22,17.15,95.99,19.53,119.39,21.9,142.8,21.75,156.98,20.34,171.16,18.86,185.44,17.73,36.01,17.47,55.66,17.06,74.84,17.11,90.45,19.11,112.63,21.1,134.82,21.06,149.26,20.18,164.7,19.23,180.33,17.54,42.97,17.35,57.09,17.03,71.09,17.04,84.9,18.27,105.87,19.49,126.83,19.51,141.34,19.18,157.71,18.76,174.37,16.97,45.33,16.95,58.09,16.94,70.86,17,84.37,17.8,104.39,18.6,124.42,18.59,138.84,18.3,156.36,18.01,174.33,16.97,45.36,16.95,58.12,16.94,70.89,16.96,84.27,17.37,103.14,17.78,122.01,17.77,137.15,17.6,157.49,17.43,178.49,16.97,45.39,16.95,58.16,16.94,70.92,16.92,84.14,16.91,101.79,16.9,119.43,16.88,135.36,16.85,158.74,16.81,182.98]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04","timeline":[{"name":"B_HAIR_SIDE.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_SIDE.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_SIDE.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_SIDE.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_00","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-17.62,-132.27,-14.8,-117.22,-12.19,-102.69,-11.59,-90.39,-12.23,-73.75,-12.86,-59.65,-12.56,-49.54,-11.13,-35.9,-9.59,-21.81,-17.08,-128.88,-15.22,-118.27,-14.19,-108.23,-14.01,-97.45,-14.22,-77.84,-14.43,-59.83,-14.29,-49.52,-13.69,-36.96,-13.06,-24.06,-16.88,-125.24,-15.87,-118.95,-16.2,-113.3,-16.38,-104.07,-16.2,-81.7,-16.02,-59.97,-16.06,-49.52,-16.29,-38.04,-16.57,-26.31,-18.99,-121.66,-18.06,-117.53,-18.28,-114.02,-18.59,-105.72,-20.15,-82.45,-21.72,-59.17,-21.45,-48.87,-20.17,-38.43,-19.76,-27.81,-19.76,-122.41,-19.69,-116.23,-20.57,-110.41,-21.1,-101.29,-23.37,-78.79,-25.63,-56.29,-25.13,-46.36,-22.79,-37.14,-21.59,-27.81,-22.23,-120.63,-22.47,-112.39,-23.14,-104.25,-23.37,-94.69,-23.63,-74.29,-23.89,-53.89,-23.83,-44.5,-23.55,-36.16,-23.43,-27.81,-25.24,-117.79,-25.24,-109.23,-25.24,-100.7,-25.29,-91.45,-25.78,-75.25,-26.28,-59.06,-26.19,-49.38,-25.75,-39.12,-25.48,-28.68,-27.08,-113.87,-27.09,-105.02,-27.09,-96.23,-27.16,-87.63,-27.89,-78.49,-28.63,-69.36,-28.61,-59.56,-28.34,-46.05,-28.17,-32.1,-28.93,-109.63,-28.93,-100.47,-28.93,-91.39,-29.02,-83.55,-29.93,-81.72,-30.84,-79.89,-30.93,-70.07,-30.93,-53.29,-30.93,-35.81]},{"duration":60,"tweenEasing":0,"value":[12.05,-132.3,14.87,-117.24,17.47,-102.71,18.11,-90.64,17.77,-76.44,17.44,-64.78,17.19,-54.97,16.34,-41.61,15.41,-27.83,12.59,-128.91,14.45,-118.29,15.48,-108.25,15.64,-97.61,15.16,-79.75,14.69,-63.5,14.54,-53.37,14.1,-40.78,13.58,-27.83,12.78,-125.26,13.8,-118.97,13.47,-113.32,13.21,-104.16,12.61,-82.9,12.02,-62.28,11.95,-51.87,11.88,-40.01,11.74,-27.83,10.68,-121.68,11.61,-117.55,11.38,-114.04,11.17,-105.89,10.57,-83.71,9.96,-61.53,9.91,-51.02,9.91,-39.55,9.91,-27.83,9.9,-122.43,9.98,-116.25,9.09,-110.43,8.75,-101.44,8.43,-79.69,8.1,-57.94,8.07,-47.85,8.07,-37.91,8.07,-27.83,7.44,-120.65,7.19,-112.41,6.53,-104.27,6.32,-94.71,6.28,-74.4,6.24,-54.08,6.24,-44.68,6.24,-36.27,6.24,-27.83,4.43,-117.81,4.43,-109.25,4.42,-100.72,4.38,-91.47,3.88,-75.28,3.39,-59.08,3.47,-49.4,3.92,-39.14,4.19,-28.7,2.58,-113.89,2.58,-105.04,2.58,-96.25,2.51,-87.65,1.77,-78.51,1.04,-69.38,1.05,-59.58,1.33,-46.07,1.5,-32.12,0.74,-109.65,0.74,-100.5,0.74,-91.41,0.65,-83.57,-0.26,-81.74,-1.18,-79.91,-1.26,-70.1,-1.26,-53.31,-1.26,-35.83]},{"value":[27.05,-132.3,29.87,-117.24,32.47,-102.71,33.11,-91.15,32.77,-82.44,32.44,-76.26,32.19,-65.66,31.34,-47.16,30.41,-27.83,27.59,-128.91,29.45,-118.29,30.48,-108.25,30.62,-97.92,29.97,-83.5,29.31,-70.69,29.17,-60.04,28.86,-44.25,28.58,-27.83,27.78,-125.26,28.8,-118.97,28.47,-113.32,28.17,-104.29,27.15,-84.4,26.12,-65.16,26.09,-54.54,26.37,-41.39,26.74,-27.83,25.68,-121.68,26.61,-117.55,26.38,-114.04,26.09,-105.89,24.61,-83.71,23.13,-61.53,23.21,-51.02,24.04,-39.55,24.91,-27.83,24.9,-122.43,24.98,-116.25,24.09,-110.43,23.7,-101.44,22.93,-79.69,22.15,-57.94,22.18,-47.85,22.61,-37.91,23.07,-27.83,22.44,-120.65,22.19,-112.41,21.53,-104.27,21.31,-94.71,21.24,-74.4,21.16,-54.08,21.16,-44.68,21.18,-36.27,21.24,-27.83,19.43,-117.81,19.43,-109.25,19.42,-100.72,19.38,-91.47,18.88,-75.28,18.39,-59.08,18.47,-49.4,18.92,-39.14,19.19,-28.7,17.58,-113.89,17.58,-105.04,17.58,-96.25,17.51,-87.65,16.77,-78.51,16.04,-69.38,16.05,-59.58,16.33,-46.07,16.5,-32.12,15.74,-109.65,15.74,-100.5,15.74,-91.41,15.65,-83.57,14.74,-81.74,13.82,-79.91,13.74,-70.1,13.74,-53.31,13.74,-35.83]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_01","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-23.64,-66.13,-22.23,-58.6,-20.93,-51.33,-20.66,-45.04,-21.28,-35.2,-21.9,-26.62,-21.96,-22.12,-21.96,-18.01,-21.96,-13.89,-23.37,-64.43,-22.44,-59.12,-21.93,-54.1,-21.87,-48.58,-22.35,-37.32,-22.83,-26.86,-22.88,-22.12,-22.88,-18.01,-22.88,-13.89,-23.27,-62.61,-22.76,-59.46,-22.93,-56.64,-23.07,-51.89,-23.41,-39.32,-23.76,-27.07,-23.8,-22.12,-23.8,-18.01,-23.8,-13.89,-24.33,-60.82,-23.86,-58.75,-23.97,-57,-24.08,-52.74,-24.38,-39.92,-24.68,-27.1,-24.71,-22.12,-24.71,-18.01,-24.71,-13.89,-24.71,-61.19,-24.68,-58.1,-25.12,-55.19,-25.29,-50.6,-25.45,-38.82,-25.61,-27.04,-25.63,-22.12,-25.63,-18.01,-25.63,-13.89,-25.95,-60.3,-26.07,-56.18,-26.4,-52.11,-26.51,-47.35,-26.53,-37.09,-26.55,-26.83,-26.55,-22.12,-26.55,-18.01,-26.55,-13.89,-27.45,-58.88,-27.45,-54.6,-27.45,-50.34,-27.48,-45.71,-27.73,-37.62,-27.97,-29.52,-27.93,-24.68,-27.71,-19.55,-27.57,-14.33,-28.38,-56.92,-28.38,-52.5,-28.38,-48.1,-28.41,-43.8,-28.78,-39.23,-29.15,-34.67,-29.14,-29.77,-29,-23.01,-28.92,-16.04,-29.3,-54.8,-29.3,-50.23,-29.3,-45.68,-29.34,-41.76,-29.8,-40.85,-30.26,-39.93,-30.3,-35.03,-30.3,-26.63,-30.3,-17.89]},{"duration":60,"tweenEasing":0,"value":[6.02,-66.15,7.43,-58.62,8.74,-51.36,9.05,-45.32,8.89,-38.22,8.72,-32.39,8.6,-27.49,8.17,-20.81,7.71,-13.91,6.3,-64.45,7.22,-59.14,7.74,-54.12,7.82,-48.8,7.58,-39.88,7.35,-31.76,7.27,-26.68,7.05,-20.39,6.79,-13.91,6.39,-62.63,6.9,-59.48,6.74,-56.66,6.61,-52.07,6.31,-41.45,6.01,-31.15,5.97,-25.94,5.94,-20,5.87,-13.91,5.34,-60.84,5.8,-58.78,5.69,-57.02,5.59,-52.94,5.28,-41.86,4.98,-30.77,4.95,-25.51,4.95,-19.77,4.95,-13.91,4.95,-61.22,4.99,-58.12,4.55,-55.21,4.37,-50.71,4.21,-39.84,4.05,-28.98,4.04,-23.92,4.04,-18.95,4.04,-13.91,3.72,-60.33,3.6,-56.2,3.27,-52.14,3.16,-47.35,3.14,-37.2,3.12,-27.04,3.12,-22.34,3.12,-18.14,3.12,-13.91,2.21,-58.91,2.21,-54.63,2.21,-50.36,2.19,-45.73,1.94,-37.64,1.69,-29.55,1.74,-24.7,1.96,-19.57,2.09,-14.35,1.29,-56.95,1.29,-52.52,1.29,-48.12,1.26,-43.82,0.89,-39.26,0.52,-34.69,0.53,-29.79,0.66,-23.04,0.75,-16.06,0.37,-54.83,0.37,-50.25,0.37,-45.71,0.33,-41.78,-0.13,-40.87,-0.59,-39.95,-0.63,-35.05,-0.63,-26.66,-0.63,-17.91]},{"value":[21.02,-66.15,22.43,-58.62,23.74,-51.36,24.01,-45.06,23.39,-35.22,22.76,-26.65,22.71,-22.14,22.71,-18.03,22.71,-13.91,21.3,-64.45,22.22,-59.14,22.74,-54.12,22.79,-48.6,22.31,-37.34,21.83,-26.88,21.79,-22.14,21.79,-18.03,21.79,-13.91,21.39,-62.63,21.9,-59.48,21.74,-56.66,21.6,-51.92,21.25,-39.34,20.9,-27.09,20.87,-22.14,20.87,-18.03,20.87,-13.91,20.34,-60.84,20.8,-58.78,20.69,-57.02,20.59,-52.76,20.28,-39.94,19.98,-27.13,19.95,-22.14,19.95,-18.03,19.95,-13.91,19.95,-61.22,19.99,-58.12,19.55,-55.21,19.37,-50.63,19.21,-38.84,19.05,-27.06,19.04,-22.14,19.04,-18.03,19.04,-13.91,18.72,-60.33,18.6,-56.2,18.27,-52.14,18.16,-47.37,18.14,-37.11,18.12,-26.86,18.12,-22.14,18.12,-18.03,18.12,-13.91,17.21,-58.91,17.21,-54.63,17.21,-50.36,17.19,-45.73,16.94,-37.64,16.69,-29.55,16.74,-24.7,16.96,-19.57,17.09,-14.35,16.29,-56.95,16.29,-52.52,16.29,-48.12,16.26,-43.82,15.89,-39.26,15.52,-34.69,15.53,-29.79,15.66,-23.04,15.75,-16.06,15.37,-54.83,15.37,-50.25,15.37,-45.71,15.33,-41.78,14.87,-40.87,14.41,-39.95,14.37,-35.05,14.37,-26.66,14.37,-17.91]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_02","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.55,0.54,-28.33,6.02,-27.11,11.51,-26.56,12.9,-24.85,16.32,-23,20.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.61,0.22,-28.95,3.24,-28.3,6.27,-27.96,7.35,-26.9,10.27,-25.73,13.41,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.65,-0.06,-29.52,0.68,-29.39,1.41,-29.27,2.13,-28.84,4.42,-28.38,6.83,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.33,-29.67,1.41,-29.67,2.57,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.17,-29.67,0.74,-29.67,1.36,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0,-29.67,0.06,-29.67,0.14,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_03","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-16.38,40.17,-16.37,36.62,-16.37,33.18,-16.29,30.92,-15.45,30.97,-14.61,31.01,-14.42,29.59,-13.99,29.43,-13.53,29.44,-15.68,42.1,-15.58,39.96,-15.47,37.83,-15.4,35.78,-14.95,34.56,-14.5,33.34,-14.45,31.4,-14.43,29.96,-14.32,28.59,-15.04,43.88,-14.84,43.16,-14.64,42.33,-14.58,40.5,-14.49,38.01,-14.39,35.51,-14.47,33.1,-14.79,30.44,-15,27.77,-14.87,44.33,-14.68,44.1,-14.47,43.73,-14.42,42.04,-14.42,38.86,-14.42,35.68,-14.54,33.08,-14.94,29.86,-15.27,26.57,-14.87,44.33,-14.91,42.04,-14.95,39.74,-14.96,37.45,-14.99,34.47,-15.03,31.5,-15.13,29.08,-15.46,26.35,-15.69,23.6,-14.87,44.32,-15.14,40.27,-15.42,36.35,-15.49,33.54,-15.56,30.48,-15.64,27.42,-15.63,25.29,-15.59,23.38,-15.55,21.48,-14.8,43.84,-15.02,39.7,-15.15,35.67,-15.21,32.62,-15.54,28.82,-15.86,25.02,-15.83,22.83,-15.61,20.98,-15.46,19.13,-14.52,41.99,-14.77,38.93,-14.96,35.93,-15.02,33.19,-15.22,28.82,-15.41,24.44,-15.39,22.07,-15.26,19.74,-15.17,17.39,-14.21,39.98,-14.52,38.14,-14.8,36.27,-14.87,33.95,-14.87,29.07,-14.87,24.19,-14.87,21.61,-14.86,18.76,-14.86,15.84]},{"duration":60,"tweenEasing":0,"value":[-1.54,40.16,-1.54,36.61,-1.54,33.17,-1.52,30.65,-1.29,27.95,-1.06,25.26,-1.14,23.14,-1.57,21.27,-2.03,19.43,-0.85,42.09,-0.74,39.95,-0.64,37.82,-0.6,35.68,-0.47,32.94,-0.35,30.2,-0.47,27.72,-0.98,24.82,-1.45,21.88,-0.21,43.87,-0.01,43.15,0.19,42.32,0.25,40.54,0.27,37.67,0.3,34.8,0.16,32.02,-0.37,28.23,-0.81,24.35,-0.04,44.32,0.16,44.09,0.36,43.72,0.41,42.03,0.41,38.85,0.41,35.66,0.3,32.91,-0.11,29.15,-0.44,25.28,-0.04,44.32,-0.08,42.03,-0.11,39.73,-0.12,37.44,-0.16,34.46,-0.2,31.49,-0.29,29,-0.63,25.98,-0.86,22.92,-0.04,44.31,-0.31,40.26,-0.58,36.33,-0.66,33.53,-0.73,30.47,-0.8,27.41,-0.8,25.29,-0.76,23.35,-0.72,21.41,0.03,43.83,-0.18,39.69,-0.32,35.66,-0.38,32.61,-0.7,28.81,-1.03,25.01,-0.99,22.82,-0.78,20.97,-0.62,19.12,0.32,41.98,0.07,38.92,-0.13,35.92,-0.19,33.18,-0.38,28.81,-0.58,24.43,-0.56,22.06,-0.43,19.73,-0.34,17.38,0.63,39.97,0.32,38.13,0.03,36.26,-0.04,33.94,-0.04,29.06,-0.03,24.18,-0.03,21.6,-0.03,18.75,-0.03,15.83]},{"value":[11.46,32.16,10.53,30.16,9.68,28.14,8.96,25.48,7.38,19.29,5.81,13.1,2.56,10.61,-0.94,8.07,-4.36,5.43,13.08,37.79,12.66,36.51,12.32,35.15,11.93,32.79,11.06,27.19,10.18,21.58,8.26,19.02,6.35,16.48,4.41,13.84,14.58,42.99,14.63,42.48,14.77,41.83,14.69,39.77,14.43,34.66,14.16,29.54,13.51,26.98,13.11,24.5,12.58,21.98,14.96,44.32,15.16,44.09,15.36,43.72,15.39,41.84,15.09,36.93,14.8,32.03,14.73,29.56,14.6,27.41,14.56,25.28,14.96,44.32,14.92,42.03,14.89,39.73,14.86,37.35,14.67,33.46,14.48,29.57,14.41,27.22,14.22,25.06,14.14,22.92,14.96,44.31,14.69,40.26,14.42,36.33,14.34,33.55,14.25,30.38,14.17,27.22,14.17,25.09,14.22,23.24,14.28,21.41,15.03,43.83,14.82,39.69,14.68,35.66,14.62,32.61,14.3,28.81,13.97,25.01,14.01,22.82,14.22,20.97,14.38,19.12,15.32,41.98,15.07,38.92,14.87,35.92,14.81,33.18,14.62,28.81,14.42,24.43,14.44,22.06,14.57,19.73,14.66,17.38,15.63,39.97,15.32,38.13,15.03,36.26,14.96,33.94,14.96,29.06,14.97,24.18,14.97,21.6,14.97,18.75,14.97,15.83]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_04","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32.75,80.35,-32.75,73.25,-32.74,66.36,-32.58,61.84,-30.9,61.93,-29.23,62.02,-28.85,59.18,-27.99,58.87,-27.06,58.88,-31.36,84.2,-31.16,79.93,-30.95,75.65,-30.8,71.57,-29.9,69.13,-29,66.69,-28.91,62.81,-28.86,59.92,-28.64,57.17,-30.08,87.76,-29.68,86.32,-29.28,84.66,-29.16,81.01,-28.97,76.02,-28.79,71.03,-28.95,66.19,-29.57,60.89,-30,55.54,-29.75,88.66,-29.36,88.21,-28.95,87.47,-28.84,84.09,-28.84,77.72,-28.85,71.35,-29.07,66.16,-29.89,59.71,-30.55,53.13,-29.75,88.65,-29.82,84.08,-29.89,79.48,-29.91,74.9,-29.99,68.95,-30.06,62.99,-30.26,58.17,-30.92,52.71,-31.39,47.2,-29.75,88.64,-30.28,80.56,-30.83,72.71,-30.99,67.08,-31.13,60.96,-31.27,54.84,-31.26,50.59,-31.19,46.76,-31.11,42.95,-29.6,87.69,-30.03,79.41,-30.31,71.36,-30.43,65.24,-31.07,57.64,-31.72,50.05,-31.66,45.66,-31.22,41.96,-30.91,38.26,-29.03,83.98,-29.53,77.87,-29.92,71.86,-30.04,66.38,-30.43,57.63,-30.82,48.89,-30.78,44.13,-30.52,39.48,-30.34,34.77,-28.42,79.96,-29.03,76.27,-29.6,72.55,-29.74,67.91,-29.74,58.14,-29.74,48.37,-29.73,43.23,-29.73,37.52,-29.73,31.69]},{"duration":60,"tweenEasing":0,"value":[-3.08,80.33,-3.08,73.23,-3.08,66.34,-3.03,61.3,-2.57,55.91,-2.11,50.51,-2.28,46.28,-3.14,42.55,-4.06,38.85,-1.69,84.18,-1.49,79.9,-1.28,75.63,-1.2,71.36,-0.95,65.88,-0.7,60.4,-0.95,55.44,-1.97,49.64,-2.91,43.77,-0.41,87.74,-0.02,86.3,0.38,84.64,0.5,81.08,0.55,75.34,0.6,69.59,0.32,64.02,-0.74,56.44,-1.62,48.71,-0.08,88.64,0.31,88.18,0.72,87.45,0.83,84.06,0.82,77.69,0.82,71.32,0.59,65.81,-0.22,58.29,-0.88,50.56,-0.08,88.63,-0.16,84.05,-0.22,79.46,-0.25,74.88,-0.32,68.92,-0.39,62.97,-0.59,57.99,-1.26,51.96,-1.72,45.84,-0.08,88.62,-0.62,80.54,-1.16,72.69,-1.32,67.06,-1.46,60.94,-1.6,54.82,-1.6,50.59,-1.52,46.69,-1.44,42.81,0.06,87.67,-0.36,79.39,-0.64,71.34,-0.76,65.21,-1.41,57.62,-2.05,50.03,-1.99,45.64,-1.56,41.93,-1.24,38.24,0.63,83.95,0.14,77.85,-0.25,71.84,-0.38,66.36,-0.76,57.61,-1.15,48.87,-1.11,44.11,-0.86,39.46,-0.68,34.75,1.25,79.94,0.64,76.25,0.07,72.52,-0.07,67.88,-0.07,58.12,-0.07,48.35,-0.07,43.2,-0.06,37.49,-0.06,31.66]},{"value":[7.92,64.33,6.07,60.31,4.36,56.28,2.91,50.96,-0.24,38.57,-3.39,26.19,-9.89,21.22,-16.89,16.13,-23.73,10.85,11.16,75.59,10.32,73.01,9.64,70.31,8.86,65.58,7.11,54.37,5.37,43.16,1.55,37.99,-2.3,32.97,-6.18,27.67,14.15,85.99,14.26,84.95,14.53,83.65,14.38,79.56,13.85,69.32,13.32,59.07,12.03,53.92,11.22,49.02,10.15,43.96,14.92,88.64,15.31,88.18,15.72,87.45,15.77,83.68,15.19,73.87,14.6,64.05,14.46,59.11,14.21,54.82,14.12,50.56,14.92,88.63,14.84,84.05,14.78,79.46,14.73,74.72,14.35,66.92,13.97,59.13,13.82,54.44,13.44,50.12,13.28,45.84,14.92,88.62,14.38,80.54,13.84,72.69,13.68,67.1,13.51,60.76,13.34,54.43,13.35,50.19,13.44,46.48,13.56,42.81,15.06,87.67,14.64,79.39,14.36,71.34,14.24,65.21,13.59,57.62,12.95,50.03,13.01,45.64,13.44,41.93,13.76,38.24,15.63,83.95,15.14,77.85,14.75,71.84,14.62,66.36,14.24,57.61,13.85,48.87,13.89,44.11,14.14,39.46,14.32,34.75,16.25,79.94,15.64,76.25,15.07,72.52,14.93,67.88,14.93,58.12,14.93,48.35,14.93,43.2,14.94,37.49,14.94,31.66]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00","timeline":[{"name":"D_HAIR_SIDE.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_SIDE.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_SIDE.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_SIDE.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_SIDE.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_00","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":490}]},{"name":"D_HAIR_SIDE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-31.64,-0.58,-73.13,0.72,-41.53,2.62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-12.8,1.19,0,0,0,0,0,0,-40.41,0.45,0,0,-56.65,-1.3,0,0,-23.71,0.24,0.32,1.39,-10.65,0.67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-18.49,0.68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-22.13,1.4,-20.65,1.31,-32.08,0.32,-18.43,0.21]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_01","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]},{"name":"D_HAIR_SIDE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-21.96,0.09,-40.01,0.14,-8.03,0.69,0,0,0,0,0,0,0,0,0,0,2.38,-0.69,0,0,-9.67,-0.68,0,0,0,0,-5.85,0.01,-4.85,0,-14.62,1.38,0,0,0,0,0,0,-26.69,0.76,0,0,-32.67,0.83,-2.45,0.69,-29.85,0.79,-12.07,-1.32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-4.28,0.37,-6.93,0.35,-20.83,0.07,-15.35,0.35,0,0,-2.79,0.01,-2.76,0.01,-1.27,-0.38]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_02","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_03","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_04","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04","timeline":[{"name":"B_HAIR_TWIN.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_00","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[14.67,-77.09,16.52,-69.47,18.23,-62.14,18.58,-55.54,17.65,-32.43,16.72,-9.32,17.07,-6.23,18.8,-12.58,20.67,-19.78,-2.91,-77.09,-2.27,-70.18,-1.8,-63.5,-1.48,-57.73,0.8,-40.7,3.07,-23.67,3.64,-19.07,5.08,-17.9,6.78,-17,-19.16,-77.09,-19.66,-70.84,-20.32,-64.78,-20.02,-59.77,-14.86,-48.77,-9.7,-37.76,-8.91,-31.77,-7.64,-23.26,-6.05,-14.43,-23.05,-77.43,-23.81,-72.08,-24.53,-66.71,-24.23,-61.64,-19.07,-54.05,-13.91,-46.45,-12.96,-40.58,-11.19,-27.35,-9.43,-13.24,-20.31,-81.09,-19.83,-80.69,-19.05,-79.75,-18.62,-75.06,-16.58,-65.31,-14.53,-55.55,-13.89,-48.17,-12.23,-28.29,-10.83,-6.95,-17.56,-84.75,-16.39,-93.01,-14.98,-100.21,-14.62,-97.71,-14.92,-83.27,-15.23,-68.84,-15.07,-57.84,-14.42,-28.99,-13.93,1.91,-21.33,-93.44,-19.5,-104.86,-16.62,-115.05,-16,-113.25,-18.37,-94.62,-20.33,-71.62,-19.71,-52.13,-18.57,-22.8,-17.46,7.69,-22.65,-104.37,-22.46,-116.72,-21.54,-127.77,-21.5,-125.94,-24.01,-102.22,-25.49,-67.5,-23.7,-37.72,-21.15,-13.9,-18.54,9.39,-23.33,-115.09,-25.19,-128.56,-26.9,-140.71,-27.58,-138.94,-29.8,-109.87,-30.34,-63.09,-27.34,-23.18,-23.41,-5.17,-19.33,10.67]},{"duration":60,"tweenEasing":0,"value":[-1.33,-63.07,-1.33,-59.16,-1.33,-55.24,-1.33,-49.87,-1.35,-30.41,-1.37,-10.96,-1.36,-9.3,-1.35,-19.93,-1.33,-31.76,-1.32,-68.62,-2.53,-63.76,-3.77,-58.96,-3.96,-53.69,-2.46,-38.68,-0.97,-23.67,-0.69,-19.64,-0.13,-20.82,0.52,-22.5,-1.31,-73.76,-3.67,-68.01,-6.04,-62.38,-6.39,-57.27,-3.58,-46.75,-0.76,-36.22,-0.21,-30.11,0.92,-22.14,2.23,-13.94,-1.48,-75.41,-3.97,-70.06,-6.36,-64.69,-6.74,-59.62,-4.2,-52.03,-1.66,-44.43,-0.96,-38.56,0.81,-25.33,2.57,-11.22,-3.31,-79.07,-3.77,-78.68,-3.83,-77.72,-3.75,-73.03,-3.08,-63.28,-2.41,-53.54,-1.89,-46.15,-0.23,-26.27,1.17,-4.93,-5.13,-82.73,-4.09,-90.98,-2.72,-98.19,-2.37,-95.69,-2.79,-81.25,-3.22,-66.82,-3.07,-55.81,-2.42,-26.97,-1.93,3.93,-9.33,-91.42,-7.5,-102.84,-4.62,-113.03,-4,-111.23,-6.37,-92.6,-8.33,-69.6,-7.71,-50.11,-6.57,-20.78,-5.46,9.71,-10.65,-102.35,-10.46,-114.7,-9.54,-125.75,-9.5,-123.92,-12.01,-100.2,-13.49,-65.48,-11.7,-35.7,-9.15,-11.88,-6.54,11.41,-11.33,-113.07,-13.18,-126.54,-14.9,-138.69,-15.58,-136.92,-17.8,-107.85,-18.34,-61.07,-15.34,-21.16,-11.41,-3.15,-7.33,12.69]},{"value":[-28.88,-65.04,-25.18,-64.83,-21.76,-64.34,-18.9,-61.21,-15.65,-56.39,-14.93,-51.56,-13.63,-50.81,-12.22,-55.99,-10.88,-61.73,-7.58,-67.82,-2.23,-65.2,3.41,-62.5,7.11,-58.65,10.38,-54.83,10.19,-50.37,10.1,-48.33,9.56,-50.56,9.08,-53.12,12.11,-70.39,18.72,-65.44,25.94,-60.61,30.29,-56.08,33.39,-53.17,32.08,-48.99,30.65,-45.4,28.33,-44.38,26.15,-43.45,16.45,-71.56,21.17,-66.72,24.92,-61.82,27.97,-56.87,29.88,-53.09,27.4,-47.85,25.33,-42.66,22.24,-36.71,18.97,-30.45,9.15,-77.05,16.93,-77.82,25.92,-78.12,29.52,-73.68,29.78,-66.36,27.56,-58.22,26,-51.59,22.8,-37.24,18.87,-21.9,1.84,-82.53,9.66,-92.35,19.08,-101.17,22.01,-98.99,22.49,-85.95,22.34,-72.7,21.07,-62.56,16.56,-37.53,11.17,-10.79,-1.57,-91.39,3.84,-104.66,10.07,-116.6,11.82,-115.11,12.45,-96.75,13.5,-74,12.59,-55.74,6.78,-29.64,0.74,-2.52,2.25,-102.32,5.63,-116.52,9.52,-129.31,10.73,-127.88,12.48,-104.68,15.28,-70.44,15.67,-41.03,11.24,-17.28,6.51,6.03,7.12,-113.04,8.04,-128.36,8.9,-142.22,9.39,-140.98,12.65,-112.82,17.6,-66.95,19.36,-26.26,16.45,-4.83,13.12,14.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_01","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[15.33,-43.56,17.19,-37.9,18.9,-32.52,19.25,-28.61,18.32,-15.23,17.4,-1.84,17.76,0.42,19.47,-0.62,21.33,-1.9,-2.25,-40.78,-1.01,-36.3,0.09,-32.02,0.5,-28.89,2.03,-19.36,3.56,-9.83,3.99,-7.24,5.15,-5.48,6.52,-3.75,-18.5,-38.21,-17.83,-34.84,-17.3,-31.59,-16.82,-29.14,-13.07,-23.39,-9.32,-17.65,-8.8,-14.71,-8.1,-10.19,-7.17,-5.46,-22.31,-37.73,-21.82,-35.05,-21.35,-32.37,-20.86,-29.83,-16.97,-26.03,-13.08,-22.24,-12.48,-19.32,-11.6,-12.7,-10.71,-5.63,-18.65,-39.56,-17.95,-39.34,-17.13,-38.86,-16.75,-36.55,-15.04,-31.66,-13.33,-26.78,-12.94,-23.13,-12.12,-13.17,-11.42,-2.49,-14.99,-41.39,-14.35,-45.5,-13.62,-49.09,-13.43,-47.87,-13.53,-40.65,-13.62,-33.42,-13.54,-27.93,-13.21,-13.51,-12.96,1.95,-16.67,-45.73,-15.75,-51.43,-14.31,-56.51,-14,-55.65,-15.19,-46.33,-16.17,-34.82,-15.85,-25.06,-15.29,-10.4,-14.73,4.83,-17.32,-51.2,-17.23,-57.36,-16.77,-62.89,-16.75,-61.99,-18.01,-50.13,-18.74,-32.76,-17.85,-17.87,-16.57,-5.97,-15.27,5.68,-17.67,-56.56,-18.59,-63.29,-19.45,-69.36,-19.79,-68.48,-20.9,-53.95,-21.17,-30.55,-19.67,-10.6,-17.7,-1.6,-15.67,6.33]},{"duration":60,"tweenEasing":0,"value":[-0.67,-29.98,-0.67,-28.02,-0.67,-26.06,-0.67,-23.37,-0.68,-13.65,-0.68,-3.92,-0.68,-3.09,-0.67,-8.41,-0.67,-14.32,-0.66,-32.75,-1.27,-30.32,-1.89,-27.92,-1.98,-25.29,-1.23,-17.78,-0.48,-10.28,-0.34,-8.27,-0.07,-8.86,0.26,-9.69,-0.66,-35.32,-1.83,-32.45,-3.02,-29.63,-3.2,-27.07,-1.79,-21.81,-0.38,-16.55,-0.11,-13.49,0.46,-9.51,1.11,-5.41,-0.74,-36.15,-1.98,-33.47,-3.18,-30.79,-3.37,-28.25,-2.1,-24.45,-0.83,-20.65,-0.48,-17.74,0.4,-11.12,1.29,-4.05,-1.65,-37.98,-1.88,-37.76,-1.91,-37.28,-1.88,-34.96,-1.54,-30.08,-1.2,-25.2,-0.94,-21.55,-0.12,-11.59,0.58,-0.91,-2.56,-39.81,-2.05,-43.92,-1.36,-47.51,-1.18,-46.29,-1.4,-39.07,-1.61,-31.84,-1.54,-26.35,-1.21,-11.93,-0.96,3.53,-4.67,-44.15,-3.75,-49.85,-2.31,-54.93,-2,-54.07,-3.19,-44.75,-4.17,-33.24,-3.85,-23.48,-3.29,-8.82,-2.73,6.41,-5.32,-49.62,-5.23,-55.78,-4.77,-61.31,-4.75,-60.41,-6.01,-48.55,-6.74,-31.18,-5.85,-16.29,-4.57,-4.39,-3.27,7.26,-5.67,-54.98,-6.59,-61.71,-7.45,-67.78,-7.79,-66.9,-8.9,-52.37,-9.17,-28.97,-7.67,-9.02,-5.7,-0.02,-3.67,7.91]},{"value":[-27.31,-29.39,-25.46,-29.75,-23.75,-29.93,-22.36,-28.78,-21.19,-29.56,-21.29,-30.35,-22.08,-30.38,-23.19,-33.4,-24.31,-36.73,-6.94,-30.31,-3.86,-28.85,-0.63,-27.34,1.2,-25.72,1.35,-27.09,-0.53,-28.15,-1.93,-27.55,-3.8,-28.9,-5.74,-30.44,11.89,-31.17,15.98,-27.96,20.38,-24.85,22.54,-22.76,21.69,-24.57,18.01,-25.76,16.01,-24.37,13.41,-23.92,10.66,-23.51,16.18,-31.65,18.97,-28.61,20.97,-25.59,22.3,-23.22,20.85,-23.75,16.46,-23.54,14.13,-21.11,10.64,-18,7.06,-14.72,10.7,-34.39,16.11,-34.9,22.82,-35.19,25.12,-33.2,23.51,-30.99,20.23,-28.37,18.68,-25.07,15.95,-17.46,12.69,-9.32,5.22,-37.13,10.55,-42.76,17.55,-47.85,19.65,-47.04,19.35,-41.18,18.62,-35.21,17.75,-30.02,15.01,-16.79,11.56,-2.64,2.8,-41.56,5.5,-48.98,8.62,-55.68,9.55,-55.17,10.39,-45.95,11.45,-34.52,10.69,-25.31,6.46,-11.94,2.17,1.98,2.57,-47.03,4.26,-54.53,6.2,-61.3,6.9,-60.67,8.75,-48.58,11.13,-30.95,11.06,-16.27,7.49,-4.67,3.77,6.68,2.69,-52.39,3.15,-60.05,3.58,-66.98,3.95,-66.27,6.95,-51.28,10.8,-27.43,11.48,-7.22,8.74,2.64,5.69,11.49]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_02","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[16,-12.02,17.85,-8.32,19.56,-4.9,19.91,-3.68,19,-0.02,18.09,3.64,18.44,5.07,20.15,9.35,22,13.98,-1.59,-6.47,0.26,-4.42,1.97,-2.54,2.48,-2.04,3.26,-0.02,4.04,2,4.33,2.59,5.22,4.94,6.26,7.5,-17.84,-1.33,-16,-0.83,-14.28,-0.4,-13.62,-0.51,-11.28,-0.02,-8.94,0.47,-8.7,0.34,-8.57,0.88,-8.28,1.51,-21.57,-0.02,-19.85,-0.02,-18.18,-0.02,-17.5,-0.02,-14.87,-0.02,-12.25,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-17,-0.02,-16.07,-0.02,-15.22,-0.02,-14.87,-0.02,-13.5,-0.02,-12.13,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12.43,-0.02,-12.3,-0.02,-12.26,-0.02,-12.25,-0.02,-12.13,-0.02,-12.01,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-45.33,-1.97,-45.33,-2.9,-45.33,-3.75,-45.59,-4.49,-48.33,-9.97,-51.08,-15.46,-53.68,-16.41,-55.61,-18.12,-57.33,-19.97,-25.89,-1.05,-25.09,-0.73,-24.26,-0.43,-24.4,-0.99,-28.33,-7.06,-32.9,-13.13,-35.48,-14.04,-37.79,-14.97,-40.14,-16,-7.93,-0.19,-6.36,1.28,-4.78,2.67,-4.81,2.31,-9.82,-4.11,-16.08,-10.54,-18.64,-11.35,-21.39,-11.56,-24.43,-11.82,-3.68,0.03,-2.81,1.26,-2.57,2.39,-2.97,2.19,-7.78,-2.64,-14.07,-7.46,-16.66,-7.79,-20.55,-7.52,-24.44,-7.22,-7.33,0.03,-4.27,-0.24,0.14,-0.55,1.11,-0.93,-2.37,-3.85,-6.7,-6.76,-8.23,-6.76,-10.49,-5.9,-13.08,-4.97,-10.99,0.03,-8.14,-1.44,-3.55,-2.85,-2.3,-3.31,-3.39,-4.64,-4.69,-5.97,-5.16,-5.72,-6.13,-4.28,-7.63,-2.72,-12.43,0.03,-12.43,-1.57,-12.43,-3.07,-12.33,-3.45,-11.26,-3.36,-10.18,-3.28,-10.8,-3.11,-13.46,-2.47,-15.99,-1.75,-16.7,0.03,-16.7,-0.8,-16.7,-1.57,-16.52,-1.68,-14.57,-0.69,-12.61,0.31,-13.14,0.26,-15.85,-0.31,-18.56,-0.9,-21.33,0.03,-21.33,0.03,-21.33,0.03,-21.08,0.2,-18.33,2.03,-15.59,3.86,-15.99,3.59,-18.56,1.88,-21.33,0.03]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_03","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[11.99,1.73,11.83,-0.51,11.68,-3.01,10.41,-8.46,5.97,-20.56,1.52,-32.66,-2.28,-32.49,-3.3,-32.13,-4.39,-37.7,-5.14,8.35,-4.31,4.43,-3.81,0.41,-4.25,-5.77,-4.83,-19.72,-5.56,-34.59,-7.73,-39.01,-7.98,-43.53,-8.22,-51.9,-20.96,14.13,-18.3,7.97,-15.72,1.88,-15.08,-5.05,-13.32,-20.03,-11.88,-36.84,-12.58,-45.31,-12.03,-54.46,-11.42,-65.41,-24.41,13.36,-21.35,5.3,-18.32,-2.57,-17.35,-9.95,-15.48,-23.92,-13.97,-40.05,-13.69,-48.42,-12.45,-57.61,-11.12,-67.3,-18.01,8.64,-17.02,-0.63,-16.09,-9.66,-15.73,-17.59,-14.39,-28.5,-13.26,-40.62,-12.74,-44.53,-11.46,-49.18,-10.01,-54.47,-11.61,1.81,-12.67,-7.88,-13.86,-17.3,-14.07,-24.25,-12.88,-29.24,-11.74,-34.54,-10.88,-33.98,-9.33,-35.39,-7.64,-37.56,-11.34,0.88,-12.63,-6.85,-14.36,-14.42,-14.28,-19.06,-12.65,-20.4,-11.22,-21.3,-9.36,-18.54,-7.94,-18,-5.87,-18,-12.62,5.16,-12.44,-0.35,-12.59,-5.87,-11.32,-9.04,-7.98,-10.5,-5.18,-10.9,-1.13,-8.31,2.6,-7.02,6.68,-5.87,-14.01,9.8,-12.16,6.48,-10.46,2.98,-7.91,1.16,-2.78,-0.75,1.5,-0.98,7.84,1.27,14.29,3.15,20.61,5.36]},{"duration":60,"tweenEasing":0,"value":[-4.01,13.76,-6.02,7.81,-7.88,1.88,-9.5,-4.78,-13.03,-20.54,-16.57,-36.29,-20.72,-37.56,-23.45,-41.48,-26.39,-51.68,-3.55,14.82,-4.58,8.84,-5.78,2.94,-6.74,-3.72,-8.09,-19.69,-9.6,-36.6,-12.07,-41.6,-13.2,-48.45,-14.48,-59.39,-3.12,15.46,-2.31,8.8,-1.44,2.27,-1.45,-4.53,-2.04,-19.99,-2.94,-37.32,-3.89,-45.63,-3.47,-55.32,-3.14,-66.92,-2.84,13.38,-1.5,5.33,-0.15,-2.55,0.14,-9.93,-0.61,-23.9,-1.72,-40.03,-1.69,-48.39,-0.45,-57.59,0.88,-67.28,-1.01,8.66,-0.94,-0.6,-0.87,-9.65,-0.86,-17.57,-0.89,-28.48,-1.13,-40.6,-0.74,-44.5,0.54,-49.16,1.99,-54.45,0.82,1.83,-0.37,-7.86,-1.6,-17.28,-1.82,-24.23,-0.75,-29.22,0.27,-34.52,1.12,-33.96,2.67,-35.37,4.36,-37.54,0.66,0.9,-0.63,-6.83,-2.36,-14.4,-2.28,-19.04,-0.65,-20.37,0.78,-21.28,2.64,-18.52,4.06,-17.98,6.13,-17.98,-0.62,5.19,-0.44,-0.33,-0.59,-5.85,0.68,-9.02,4.02,-10.48,6.82,-10.88,10.87,-8.29,14.6,-7,18.68,-5.85,-2.01,9.82,-0.16,6.5,1.54,3,4.09,1.18,9.22,-0.73,13.5,-0.96,19.84,1.3,26.29,3.17,32.61,5.38]},{"value":[-50.68,11.78,-52.69,4.91,-54.55,-1.87,-56.42,-9.27,-62.7,-30.51,-68.97,-51.75,-75.73,-53.97,-80.39,-59.6,-85.05,-71.65,-30.77,13.77,-30.99,8.1,-31.37,2.52,-32.46,-4.76,-37.77,-26.77,-43.85,-49.69,-48.88,-55.63,-52.32,-63.41,-55.96,-75.39,-12.38,15.27,-9.99,10.08,-7.55,4.94,-7.59,-2.27,-13.23,-24.14,-20.38,-47.82,-23.86,-56.97,-26.21,-66.88,-28.9,-78.74,-7.85,13.41,-5.65,6.58,-4.05,-0.15,-4.17,-7.76,-9.76,-26.54,-17.15,-47.47,-19.68,-56.18,-22.33,-65.11,-24.89,-74.51,-9.68,8.69,-6.55,-0.85,-2.06,-10.2,-1.09,-18.53,-4.63,-32.32,-9.19,-47.34,-10.3,-51.27,-11.27,-55.06,-12.43,-59.42,-11.5,1.86,-9.84,-9.3,-6.48,-20.12,-5.46,-27.55,-5.48,-33.86,-5.75,-40.48,-5.37,-39.68,-4.79,-39.66,-4.61,-40.26,-13.1,0.93,-14.39,-8.4,-16.12,-17.46,-15.94,-22.5,-13.23,-23.74,-10.74,-24.55,-9.49,-21.63,-10.73,-20.46,-11.2,-19.74,-18.66,5.21,-18.47,-1.13,-18.63,-7.42,-17.17,-10.71,-11.88,-11.17,-7.12,-10.57,-3.61,-8.03,-2.58,-7.31,-1.21,-6.74,-24.68,9.85,-22.83,6.53,-21.13,3.03,-18.32,1.38,-10.45,1.29,-3.42,2.9,2.52,4.89,6.4,5.05,9.95,5.4]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_04","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[7.98,15.49,5.81,7.3,3.8,-1.13,1.09,-12.72,-5.06,-35.09,-11.22,-57.46,-19.46,-59.43,-24.98,-68.27,-30.78,-89.38,-8.68,23.17,-8.89,13.26,-9.59,3.36,-10.87,-8.92,-11.86,-32.53,-13.14,-57.95,-17.85,-68.52,-20.19,-85.84,-22.7,-111.29,-24.08,29.59,-20.59,16.76,-17.15,4.14,-16.5,-8.92,-15.16,-32.34,-14.42,-59.34,-16.03,-77.39,-15.23,-102.83,-14.56,-132.33,-27.25,26.75,-22.86,10.63,-18.47,-5.13,-17.21,-19.15,-16.1,-40.27,-15.7,-65.59,-15.38,-83.31,-12.9,-108.21,-10.24,-134.59,-19.02,17.31,-17.96,-1.22,-16.97,-19.27,-16.59,-34.83,-15.31,-53.09,-14.41,-73.65,-13.48,-81.75,-10.94,-94.54,-8.03,-108.92,-10.79,3.65,-13.04,-15.72,-15.45,-34.56,-15.89,-48.55,-13.64,-58.13,-11.48,-68.33,-9.76,-67.05,-6.68,-70.27,-3.28,-75.09,-10.68,1.78,-13.27,-13.69,-16.72,-28.82,-16.55,-38.12,-13.28,-40.78,-10.45,-42.57,-6.72,-37.08,-3.88,-35.95,0.26,-35.99,-13.24,10.35,-12.87,-0.69,-13.19,-11.7,-10.62,-18.06,-3.96,-21,1.63,-21.8,9.74,-16.64,17.21,-14,25.37,-11.71,-16.02,19.62,-12.33,12.98,-8.92,5.98,-3.82,2.34,6.44,-1.49,15,-1.94,27.68,2.57,40.57,6.31,53.22,10.73]},{"duration":60,"tweenEasing":0,"value":[-8.02,27.51,-12.04,15.61,-15.76,3.77,-18.83,-9.04,-24.06,-35.07,-29.3,-61.1,-37.9,-64.51,-45.13,-77.62,-52.78,-103.36,-7.09,29.64,-9.16,17.67,-11.57,5.88,-13.36,-6.87,-15.12,-32.5,-17.17,-59.95,-22.19,-71.11,-25.41,-90.74,-28.96,-118.79,-6.24,30.92,-4.61,17.58,-2.87,4.53,-2.88,-8.38,-3.88,-32.29,-5.48,-59.81,-7.34,-77.69,-6.67,-103.65,-6.28,-133.84,-5.68,26.77,-3.01,10.65,-0.3,-5.1,0.29,-19.12,-1.23,-40.24,-3.45,-65.58,-3.38,-83.29,-0.9,-108.19,1.76,-134.57,-2.02,17.33,-1.88,-1.2,-1.75,-19.26,-1.72,-34.81,-1.81,-53.07,-2.28,-73.63,-1.48,-81.73,1.06,-94.52,3.97,-108.9,1.64,3.67,-0.73,-15.7,-3.19,-34.54,-3.65,-48.52,-1.51,-58.11,0.53,-68.31,2.24,-67.02,5.32,-70.25,8.72,-75.07,1.32,1.8,-1.27,-13.67,-4.72,-28.8,-4.55,-38.1,-1.28,-40.76,1.55,-42.55,5.28,-37.06,8.12,-35.93,12.26,-35.97,-1.24,10.37,-0.87,-0.67,-1.19,-11.68,1.38,-18.04,8.04,-20.98,13.63,-21.78,21.74,-16.62,29.21,-13.98,37.37,-11.69,-4.02,19.65,-0.33,13,3.08,6,8.18,2.36,18.44,-1.47,27,-1.92,39.68,2.59,52.57,6.33,65.22,10.76]},{"value":[-60.02,25.54,-65.28,10.25,-70.14,-4.74,-74.69,-18.64,-84.73,-47.71,-93.65,-76.78,-108.98,-83.65,-124.04,-104.07,-138.11,-136.66,-39.65,28.59,-41.6,15.57,-43.74,2.89,-46.33,-10.68,-53.22,-41,-60.34,-73.09,-70.24,-86.65,-78.79,-110.11,-87.23,-141.95,-20.83,30.73,-17.8,18.52,-14.58,6.59,-14.82,-6.81,-21.18,-36.79,-29.03,-70.27,-34.08,-89.25,-36.56,-116.01,-39.7,-147.12,-16.02,26.8,-12.49,11.91,-9.53,-2.7,-9.36,-16.95,-15.75,-42.88,-24.24,-73.01,-26.7,-91.08,-28.11,-115.7,-29.35,-141.79,-16.02,17.36,-12.83,-1.44,-8.27,-19.81,-7.28,-35.81,-10.92,-56.92,-15.7,-80.33,-16.37,-88.5,-16.06,-100.43,-15.78,-113.87,-16.02,3.7,-15.54,-17.15,-13.41,-37.34,-12.62,-51.86,-11.57,-62.75,-10.83,-74.25,-9.58,-72.75,-7.46,-74.54,-5.58,-77.79,-17.77,1.83,-20.36,-15.24,-23.82,-31.86,-23.54,-41.56,-19.2,-44.13,-15.31,-45.82,-12.18,-40.17,-12.01,-38.41,-10.4,-37.72,-24.61,10.4,-24.24,-1.47,-24.56,-13.25,-21.81,-19.73,-13.19,-21.67,-5.65,-21.46,1.93,-16.36,6.69,-14.29,12.15,-12.59,-32.02,19.67,-28.33,13.02,-24.92,6.02,-19.56,2.56,-6.56,0.56,4.74,1.94,17.03,6.18,27.35,8.21,37.22,10.78]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07","timeline":[{"name":"B_HAIR_TWIN.07_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.07_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.07_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.07_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.07_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_00","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-14.37,1.37,-10.96,1.06,-7.51,0.76,-4.05,0.47,-0.55,0.18,2.95,-0.1,6.46,-0.38,9.97,-0.66,13.49,-0.93,-11.44,1.31,-8,1.01,-4.54,0.71,-1.07,0.42,2.43,0.14,5.94,-0.13,9.45,-0.41,12.96,-0.68,16.48,-0.96,-8.51,1.26,-5.05,0.96,-1.57,0.67,1.92,0.38,5.42,0.11,8.92,-0.17,12.42,-0.44,15.92,-0.71,19.41,-0.99,-5.59,1.2,-2.1,0.91,1.39,0.63,4.89,0.35,8.39,0.07,11.89,-0.2,15.38,-0.47,18.86,-0.74,22.32,-1.02,-2.67,1.14,0.84,0.86,4.34,0.58,7.83,0.31,11.33,0.04,14.82,-0.23,18.31,-0.5,21.78,-0.77,25.22,-1.05,0.08,1.1,3.61,0.82,7.12,0.55,10.63,0.28,14.13,0.01,17.64,-0.25,21.14,-0.52,24.62,-0.79,28.09,-1.07,2.82,1.06,6.37,0.79,9.9,0.52,13.41,0.25,16.92,-0.01,20.43,-0.28,23.93,-0.55,27.42,-0.82,30.9,-1.09,5.56,1.02,9.13,0.76,12.67,0.49,16.2,0.23,19.7,-0.04,23.21,-0.31,26.7,-0.57,30.19,-0.84,33.68,-1.12,8.31,0.99,11.89,0.73,15.45,0.47,18.99,0.2,22.5,-0.07,25.99,-0.33,29.47,-0.6,32.95,-0.87,36.43,-1.14]},{"duration":60,"tweenEasing":0,"value":[-14.37,1.37,-10.96,1.06,-7.51,0.76,-4.05,0.47,-0.55,0.18,2.95,-0.1,6.46,-0.38,9.97,-0.66,13.49,-0.93,-11.44,1.31,-8,1.01,-4.54,0.71,-1.07,0.42,2.43,0.14,5.94,-0.13,9.45,-0.41,12.96,-0.68,16.48,-0.96,-8.51,1.26,-5.05,0.96,-1.57,0.67,1.92,0.38,5.42,0.11,8.92,-0.17,12.42,-0.44,15.92,-0.71,19.41,-0.99,-5.59,1.2,-2.1,0.91,1.39,0.63,4.89,0.35,8.39,0.07,11.89,-0.2,15.38,-0.47,18.86,-0.74,22.32,-1.02,-2.67,1.14,0.84,0.86,4.34,0.58,7.83,0.31,11.33,0.04,14.82,-0.23,18.31,-0.5,21.78,-0.77,25.22,-1.05,0.08,1.1,3.61,0.82,7.12,0.55,10.63,0.28,14.13,0.01,17.64,-0.25,21.14,-0.52,24.62,-0.79,28.09,-1.07,2.82,1.06,6.37,0.79,9.9,0.52,13.41,0.25,16.92,-0.01,20.43,-0.28,23.93,-0.55,27.42,-0.82,30.9,-1.09,5.56,1.02,9.13,0.76,12.67,0.49,16.2,0.23,19.7,-0.04,23.21,-0.31,26.7,-0.57,30.19,-0.84,33.68,-1.12,8.31,0.99,11.89,0.73,15.45,0.47,18.99,0.2,22.5,-0.07,25.99,-0.33,29.47,-0.6,32.95,-0.87,36.43,-1.14]},{"value":[-14.37,3.48,-10.95,3.18,-7.51,2.89,-4.04,2.62,-0.55,2.35,2.95,2.08,6.46,1.81,9.97,1.55,13.5,1.28,-11.44,2.73,-8.01,2.5,-4.55,2.29,-1.07,2.08,2.42,1.84,5.93,1.63,9.44,1.47,12.95,1.34,16.47,1.19,-8.53,1.81,-5.06,1.65,-1.59,1.53,1.9,1.4,5.4,1.2,8.9,1.04,12.4,1.01,15.9,1.02,19.39,0.98,-5.62,1.23,-2.13,1.14,1.36,1.1,4.86,1.02,8.36,0.85,11.86,0.73,15.34,0.8,18.82,0.93,22.28,0.99,-2.71,1.51,0.79,1.47,4.29,1.45,7.79,1.4,11.28,1.23,14.78,1.13,18.26,1.22,21.73,1.4,25.18,1.53,0.06,2.85,3.59,2.77,7.1,2.75,10.6,2.69,14.1,2.52,17.6,2.41,21.09,2.48,24.56,2.62,28.02,2.68,2.81,5.14,6.35,5.01,9.87,4.92,13.38,4.81,16.88,4.62,20.38,4.47,23.86,4.45,27.34,4.47,30.8,4.44,5.55,7.83,9.1,7.64,12.62,7.47,16.12,7.29,19.62,7.07,23.11,6.86,26.59,6.72,30.07,6.6,33.53,6.45,8.3,10.38,11.85,10.13,15.35,9.89,18.84,9.64,22.32,9.39,25.81,9.14,29.3,8.89,32.78,8.64,36.26,8.39]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_01","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-4.15,1.36,-3.84,1.06,-3.48,0.77,-3.11,0.47,-2.71,0.18,-2.32,-0.11,-1.92,-0.4,-1.53,-0.69,-1.13,-0.98,-2.27,1.31,-1.93,1.01,-1.56,0.72,-1.18,0.43,-0.79,0.14,-0.39,-0.15,0.01,-0.44,0.41,-0.73,0.81,-1.02,-0.4,1.25,-0.02,0.96,0.36,0.67,0.75,0.38,1.14,0.09,1.53,-0.19,1.93,-0.48,2.33,-0.77,2.73,-1.05,1.46,1.19,1.88,0.91,2.28,0.63,2.68,0.34,3.07,0.05,3.46,-0.23,3.85,-0.52,4.24,-0.8,4.63,-1.09,3.3,1.14,3.76,0.86,4.19,0.58,4.59,0.3,4.98,0.02,5.37,-0.27,5.75,-0.56,6.14,-0.84,6.53,-1.13,5.24,1.11,5.7,0.83,6.12,0.55,6.51,0.27,6.9,-0.02,7.3,-0.31,7.7,-0.59,8.1,-0.88,8.5,-1.17,7.18,1.08,7.63,0.8,8.05,0.52,8.45,0.23,8.83,-0.05,9.23,-0.34,9.63,-0.63,10.04,-0.92,10.44,-1.2,9.11,1.05,9.56,0.77,9.99,0.48,10.39,0.2,10.77,-0.09,11.17,-0.37,11.57,-0.66,11.97,-0.95,12.36,-1.24,11.03,1.01,11.5,0.73,11.94,0.45,12.35,0.16,12.75,-0.12,13.13,-0.41,13.51,-0.7,13.9,-0.98,14.27,-1.27]},{"duration":60,"tweenEasing":0,"value":[-4.15,1.36,-3.84,1.06,-3.48,0.77,-3.11,0.47,-2.71,0.18,-2.32,-0.11,-1.92,-0.4,-1.53,-0.69,-1.13,-0.98,-2.27,1.31,-1.93,1.01,-1.56,0.72,-1.18,0.43,-0.79,0.14,-0.39,-0.15,0.01,-0.44,0.41,-0.73,0.81,-1.02,-0.4,1.25,-0.02,0.96,0.36,0.67,0.75,0.38,1.14,0.09,1.53,-0.19,1.93,-0.48,2.33,-0.77,2.73,-1.05,1.46,1.19,1.88,0.91,2.28,0.63,2.68,0.34,3.07,0.05,3.46,-0.23,3.85,-0.52,4.24,-0.8,4.63,-1.09,3.3,1.14,3.76,0.86,4.19,0.58,4.59,0.3,4.98,0.02,5.37,-0.27,5.75,-0.56,6.14,-0.84,6.53,-1.13,5.24,1.11,5.7,0.83,6.12,0.55,6.51,0.27,6.9,-0.02,7.3,-0.31,7.7,-0.59,8.1,-0.88,8.5,-1.17,7.18,1.08,7.63,0.8,8.05,0.52,8.45,0.23,8.83,-0.05,9.23,-0.34,9.63,-0.63,10.04,-0.92,10.44,-1.2,9.11,1.05,9.56,0.77,9.99,0.48,10.39,0.2,10.77,-0.09,11.17,-0.37,11.57,-0.66,11.97,-0.95,12.36,-1.24,11.03,1.01,11.5,0.73,11.94,0.45,12.35,0.16,12.75,-0.12,13.13,-0.41,13.51,-0.7,13.9,-0.98,14.27,-1.27]},{"value":[-4.14,3.47,-3.83,3.18,-3.48,2.9,-3.1,2.62,-2.71,2.34,-2.31,2.07,-1.92,1.79,-1.53,1.51,-1.13,1.24,-2.28,2.72,-1.93,2.5,-1.57,2.3,-1.19,2.09,-0.8,1.84,-0.4,1.61,0,1.44,0.4,1.3,0.8,1.13,-0.42,1.8,-0.04,1.65,0.35,1.54,0.73,1.4,1.12,1.18,1.51,1.01,1.91,0.97,2.31,0.97,2.7,0.91,1.43,1.22,1.85,1.14,2.25,1.1,2.65,1.02,3.03,0.83,3.42,0.69,3.82,0.75,4.21,0.86,4.6,0.92,3.26,1.51,3.72,1.47,4.14,1.46,4.54,1.39,4.93,1.21,5.32,1.08,5.71,1.16,6.1,1.33,6.48,1.45,5.22,2.86,5.68,2.79,6.09,2.75,6.48,2.67,6.87,2.49,7.26,2.35,7.65,2.41,8.04,2.53,8.43,2.58,7.17,5.16,7.62,5.02,8.02,4.92,8.41,4.79,8.79,4.58,9.18,4.41,9.57,4.37,9.95,4.37,10.33,4.33,9.1,7.85,9.54,7.65,9.94,7.46,10.32,7.26,10.7,7.02,11.08,6.8,11.46,6.64,11.84,6.5,12.22,6.33,11.02,10.4,11.45,10.14,11.84,9.87,12.2,9.6,12.57,9.34,12.96,9.07,13.34,8.8,13.72,8.53,14.1,8.26]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_02","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":161},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[2.11,0,2.12,0,2.13,0,2.15,0,2.16,0,2.18,0,2.19,0,2.2,0,2.22,-0.01,1.42,-0.01,1.49,-0.01,1.58,-0.01,1.66,-0.01,1.7,-0.01,1.76,-0.01,1.88,-0.01,2.02,-0.01,2.15,-0.02,0.55,-0.02,0.69,-0.02,0.87,-0.02,1.02,-0.02,1.09,-0.02,1.2,-0.02,1.45,-0.02,1.73,-0.02,1.97,-0.03,0.03,-0.03,0.23,-0.03,0.47,-0.03,0.68,-0.03,0.77,-0.03,0.93,-0.03,1.27,-0.03,1.67,-0.03,2.01,-0.04,0.37,-0.04,0.61,-0.04,0.87,-0.04,1.09,-0.04,1.19,-0.05,1.35,-0.05,1.72,-0.05,2.17,-0.05,2.58,-0.02,1.75,-0.02,1.95,-0.03,2.2,-0.03,2.41,-0.03,2.51,-0.04,2.66,-0.05,3,-0.06,3.41,-0.07,3.75,-0.01,4.08,-0.01,4.22,-0.03,4.4,-0.04,4.56,-0.03,4.63,-0.05,4.75,-0.07,5,-0.09,5.29,-0.1,5.53,-0.01,6.81,-0.02,6.88,-0.05,6.98,-0.07,7.06,-0.08,7.11,-0.09,7.17,-0.11,7.3,-0.13,7.44,-0.14,7.57,-0.01,9.39,-0.05,9.4,-0.1,9.42,-0.15,9.44,-0.17,9.46,-0.17,9.48,-0.17,9.49,-0.17,9.51,-0.17,9.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_03","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.73,0.12,12.74,0.12,12.7,0.12,12.57,0.13,12.72,0.12,12.77,0.12,12.82,0.11,12.87,0.1,12.91,0.1,12.89,0.1,12.84,0.11,12.75,0.12,12.58,0.13,12.77,0.11,12.85,0.11,12.92,0.1,12.99,0.09,13.06,0.09,13.01,0.09,12.93,0.1,12.8,0.11,12.59,0.13,12.92,0.1,12.98,0.1,13.04,0.09,13.1,0.08,13.16,0.08,13.1,0.08,13,0.09,12.85,0.11,12.64,0.13,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.16,0.08,13.07,0.09,12.92,0.1,12.72,0.12,13.2,0.08,13.21,0.08,13.22,0.08,13.23,0.08,13.23,0.08,13.22,0.08,13.14,0.09,13.01,0.1,12.81,0.11,13.22,0.08,13.26,0.08,13.28,0.08,13.3,0.09,13.32,0.09,13.3,0.09,13.22,0.09,13.07,0.1,12.85,0.11,13.26,0.08,13.32,0.09,13.36,0.09,13.38,0.09,13.4,0.09,13.37,0.09,13.28,0.1,13.11,0.1,12.87,0.11,13.35,0.09,13.4,0.09,13.43,0.1,13.44,0.1,13.44,0.1,13.41,0.1,13.31,0.1,13.13,0.1,12.87,0.11]},{"duration":60,"tweenEasing":0,"value":[12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.73,0.12,12.74,0.12,12.7,0.12,12.57,0.13,12.72,0.12,12.77,0.12,12.82,0.11,12.87,0.1,12.91,0.1,12.89,0.1,12.84,0.11,12.75,0.12,12.58,0.13,12.77,0.11,12.85,0.11,12.92,0.1,12.99,0.09,13.06,0.09,13.01,0.09,12.93,0.1,12.8,0.11,12.59,0.13,12.92,0.1,12.98,0.1,13.04,0.09,13.1,0.08,13.16,0.08,13.1,0.08,13,0.09,12.85,0.11,12.64,0.13,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.16,0.08,13.07,0.09,12.92,0.1,12.72,0.12,13.2,0.08,13.21,0.08,13.22,0.08,13.23,0.08,13.23,0.08,13.22,0.08,13.14,0.09,13.01,0.1,12.81,0.11,13.22,0.08,13.26,0.08,13.28,0.08,13.3,0.09,13.32,0.09,13.3,0.09,13.22,0.09,13.07,0.1,12.85,0.11,13.26,0.08,13.32,0.09,13.36,0.09,13.38,0.09,13.4,0.09,13.37,0.09,13.28,0.1,13.11,0.1,12.87,0.11,13.35,0.09,13.4,0.09,13.43,0.1,13.44,0.1,13.44,0.1,13.41,0.1,13.31,0.1,13.13,0.1,12.87,0.11]},{"value":[3.6,2.7,3.73,2.7,3.88,2.71,4,2.71,4.05,2.72,4.41,2.77,5.27,2.85,6.28,2.95,7.09,3.06,6.3,1.87,6.44,1.94,6.6,2.01,6.73,2.07,6.81,2.11,7.01,2.19,7.57,2.37,8.22,2.58,8.71,2.78,9.34,0.85,9.46,0.98,9.59,1.14,9.71,1.28,9.79,1.34,9.82,1.47,10.06,1.75,10.35,2.08,10.51,2.37,11.89,0.18,11.97,0.38,12.05,0.61,12.12,0.81,12.18,0.9,12.1,1.06,12.1,1.42,12.09,1.85,12,2.21,13.15,0.45,13.15,0.69,13.15,0.95,13.15,1.17,13.15,1.27,13.11,1.43,13.02,1.81,12.87,2.27,12.67,2.7,13.18,1.83,13.19,2.03,13.2,2.28,13.2,2.49,13.21,2.58,13.18,2.74,13.1,3.09,12.95,3.51,12.74,3.86,13.2,4.16,13.24,4.3,13.26,4.48,13.27,4.64,13.28,4.72,13.25,4.84,13.15,5.09,12.98,5.39,12.75,5.64,13.25,6.89,13.3,6.97,13.31,7.07,13.31,7.15,13.32,7.2,13.28,7.26,13.17,7.39,12.99,7.54,12.73,7.68,13.34,9.48,13.36,9.5,13.33,9.52,13.29,9.54,13.27,9.56,13.23,9.57,13.14,9.59,12.96,9.61,12.7,9.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_04","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[19.7,0.28,22.06,0.49,24.77,0.75,26.74,0.92,26.9,0.85,25.31,0.68,23.1,0.62,20.7,0.6,18.61,0.55,28.95,0.6,30.16,0.69,31.65,0.81,32.64,0.85,32.35,0.72,30.89,0.52,28.94,0.38,26.85,0.26,24.97,0.15,38.54,0.97,38.72,0.92,39.11,0.86,39.21,0.75,38.53,0.56,36.82,0.33,34.78,0.1,32.64,-0.11,30.64,-0.28,46.86,1.26,46.27,1.1,45.83,0.89,45.29,0.65,44.43,0.4,42.72,0.15,40.82,-0.13,38.86,-0.39,36.97,-0.61,52.3,1.35,51.32,1.1,50.43,0.84,49.65,0.57,49.01,0.29,48.15,0.03,47.23,-0.22,46.26,-0.46,45.3,-0.7,56.02,1.3,55.12,1.04,54.26,0.75,53.46,0.46,52.74,0.18,51.96,-0.05,51.1,-0.25,50.2,-0.46,49.27,-0.7,59.65,1.21,58.9,0.95,58.14,0.66,57.38,0.37,56.64,0.09,55.88,-0.11,55.06,-0.29,54.18,-0.49,53.25,-0.73,63.26,1.09,62.67,0.84,62.03,0.57,61.34,0.29,60.61,0.03,59.87,-0.15,59.06,-0.34,58.19,-0.56,57.24,-0.82,66.9,0.94,66.47,0.71,65.94,0.47,65.3,0.23,64.56,-0.01,63.83,-0.2,63.05,-0.42,62.19,-0.67,61.22,-0.96]},{"duration":60,"tweenEasing":0,"value":[19.7,0.28,22.06,0.49,24.77,0.75,26.74,0.92,26.9,0.85,25.31,0.68,23.1,0.62,20.7,0.6,18.61,0.55,28.95,0.6,30.16,0.69,31.65,0.81,32.64,0.85,32.35,0.72,30.89,0.52,28.94,0.38,26.85,0.26,24.97,0.15,38.54,0.97,38.72,0.92,39.11,0.86,39.21,0.75,38.53,0.56,36.82,0.33,34.78,0.1,32.64,-0.11,30.64,-0.28,46.86,1.26,46.27,1.1,45.83,0.89,45.29,0.65,44.43,0.4,42.72,0.15,40.82,-0.13,38.86,-0.39,36.97,-0.61,52.3,1.35,51.32,1.1,50.43,0.84,49.65,0.57,49.01,0.29,48.15,0.03,47.23,-0.22,46.26,-0.46,45.3,-0.7,56.02,1.3,55.12,1.04,54.26,0.75,53.46,0.46,52.74,0.18,51.96,-0.05,51.1,-0.25,50.2,-0.46,49.27,-0.7,59.65,1.21,58.9,0.95,58.14,0.66,57.38,0.37,56.64,0.09,55.88,-0.11,55.06,-0.29,54.18,-0.49,53.25,-0.73,63.26,1.09,62.67,0.84,62.03,0.57,61.34,0.29,60.61,0.03,59.87,-0.15,59.06,-0.34,58.19,-0.56,57.24,-0.82,66.9,0.94,66.47,0.71,65.94,0.47,65.3,0.23,64.56,-0.01,63.83,-0.2,63.05,-0.42,62.19,-0.67,61.22,-0.96]},{"value":[19.71,2.39,22.07,2.61,24.77,2.89,26.74,3.07,26.9,3.01,25.32,2.86,23.1,2.81,20.71,2.81,18.61,2.77,28.94,2.02,30.16,2.18,31.65,2.39,32.63,2.51,32.34,2.42,30.88,2.28,28.93,2.26,26.84,2.29,24.96,2.29,38.52,1.52,38.7,1.61,39.09,1.73,39.19,1.77,38.51,1.65,36.8,1.53,34.76,1.56,32.62,1.63,30.62,1.69,46.83,1.29,46.24,1.32,45.8,1.36,45.26,1.33,44.4,1.17,42.69,1.08,40.79,1.15,38.83,1.29,36.93,1.4,52.27,1.72,51.28,1.71,50.39,1.71,49.61,1.66,48.96,1.48,48.11,1.38,47.18,1.5,46.22,1.71,45.25,1.88,56,3.05,55.1,2.99,54.24,2.95,53.44,2.87,52.71,2.68,51.92,2.61,51.06,2.75,50.14,2.95,49.21,3.05,59.64,5.29,58.88,5.17,58.11,5.06,57.34,4.93,56.6,4.73,55.83,4.64,54.99,4.71,54.1,4.8,53.15,4.8,63.25,7.89,62.65,7.72,61.98,7.54,61.27,7.36,60.53,7.14,59.77,7.02,58.95,6.95,58.06,6.89,57.09,6.75,66.89,10.33,66.43,10.11,65.84,9.89,65.15,9.67,64.39,9.45,63.66,9.28,62.88,9.08,62.01,8.84,61.05,8.56]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16","timeline":[{"name":"B_HAIR_TWIN.16_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.16_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.16_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.16_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.16_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_00","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[-0.06,1.94,-0.05,1.94,-0.04,1.94,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.04,1.94,-0.04,1.94,-0.03,1.95,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.02,1.95,-0.02,1.95,-0.02,1.95,-0.01,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.01,1.96,-0.01,1.96,0,1.95,0,1.95,0.01,1.95,0.01,1.95,0.02,1.95,0.02,1.95,0.03,1.95,0.04,1.97,0.04,1.96,0.04,1.96,0.04,1.95,0.04,1.94,0.05,1.94,0.07,1.94,0.09,1.94,0.1,1.94,0.1,1.96,0.09,1.96,0.08,1.95,0.06,1.95,0.05,1.94,0.07,1.94,0.09,1.94,0.12,1.95,0.13,1.95,0.12,1.24,0.13,1,0.15,0.85,0.15,0.76,0.1,0.74,0.25,0.64,0.25,0.66,0.17,0.71,0.12,0.73,-0.15,-1.56,0,-2.34,0.17,-3.13,0.3,-3.75,0.32,-3.99,0.63,-4.24,0.53,-4.22,0.26,-4.11,0.07,-4.05,-0.49,-4.59,-0.16,-5.94,0.18,-7.43,0.46,-8.63,0.57,-9.12,1.03,-9.51,0.82,-9.5,0.35,-9.32,0.01,-9.23]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_01","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[-0.06,1.94,-0.05,1.94,-0.04,1.94,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.04,1.94,-0.04,1.94,-0.03,1.95,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.02,1.95,-0.02,1.95,-0.02,1.95,-0.01,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.01,1.96,-0.01,1.96,0,1.95,0,1.95,0.01,1.95,0.01,1.95,0.02,1.95,0.02,1.95,0.03,1.95,0.04,1.97,0.04,1.96,0.04,1.96,0.04,1.95,0.04,1.94,0.05,1.94,0.07,1.94,0.09,1.94,0.1,1.94,0.1,1.96,0.09,1.96,0.08,1.95,0.06,1.95,0.05,1.94,0.07,1.94,0.09,1.94,0.12,1.95,0.13,1.95,0.2,1.95,0.17,1.95,0.13,1.95,0.1,1.95,0.06,1.95,0.07,1.95,0.09,1.96,0.12,1.96,0.13,1.96,0.26,1.95,0.23,1.95,0.19,1.95,0.15,1.96,0.12,1.96,0.11,1.96,0.12,1.96,0.13,1.96,0.14,1.96,0.26,1.94,0.26,1.95,0.23,1.95,0.21,1.95,0.2,1.95,0.17,1.96,0.15,1.96,0.15,1.97,0.15,1.97]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_03","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[24.3,3.25,20.78,2.96,16.91,2.64,13.76,2.38,12.38,2.28,11.26,2.28,8.73,2.28,5.62,2.28,2.8,2.28,15.02,-0.69,12.91,-0.45,10.57,0.27,8.69,1.04,7.92,1.4,7.21,1.42,5.61,1.46,3.66,1.5,1.88,1.52,6.23,-1.26,5.44,-1,4.55,-0.35,3.84,0.32,3.58,0.62,3.27,0.65,2.6,0.73,1.78,0.8,1.04,0.83,1.84,0.65,1.78,0.68,1.74,0.69,1.66,0.7,1.5,0.7,1.4,0.7,1.23,0.69,1.02,0.68,0.82,0.65,1.84,0.65,2.31,0.83,2.83,1.02,3.23,1.18,3.32,1.24,2.97,1.18,2.32,1.02,1.54,0.83,0.82,0.65,1.84,0.65,2.83,0.97,3.92,1.35,4.8,1.66,5.13,1.79,4.54,1.66,3.41,1.35,2.06,0.97,0.82,0.65,1.84,0.65,2.74,0.94,3.73,1.29,4.53,1.59,4.87,1.71,4.28,1.59,3.22,1.29,1.97,0.94,0.82,0.65,1.84,0.65,2.24,0.8,2.69,0.98,3.05,1.14,3.17,1.2,2.79,1.14,2.18,0.98,1.48,0.8,0.82,0.65,1.84,0.65,1.72,0.65,1.59,0.65,1.46,0.65,1.33,0.65,1.2,0.65,1.08,0.65,0.95,0.65,0.82,0.65]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_04","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[48.59,6.5,41.57,5.92,33.83,5.28,27.51,4.77,24.76,4.55,22.52,4.55,17.45,4.55,11.24,4.55,5.6,4.55,30.03,-1.39,25.82,-0.91,21.14,0.55,17.36,2.08,15.84,2.79,14.42,2.83,11.22,2.92,7.32,3.01,3.77,3.05,12.47,-2.51,10.88,-2,9.1,-0.7,7.68,0.63,7.17,1.24,6.54,1.31,5.19,1.45,3.56,1.59,2.08,1.66,3.69,1.3,4.02,1.31,4.49,1.32,4.69,1.32,4.21,1.32,4.21,1.32,3.5,1.32,2.5,1.31,1.64,1.3,3.69,1.3,8.75,1.36,14.38,1.43,18.89,1.49,20.59,1.51,18.38,1.49,13.36,1.43,7.22,1.36,1.64,1.3,3.69,1.3,13.51,1.42,24.32,1.55,33.14,1.66,36.98,1.71,32.43,1.66,23.12,1.55,11.91,1.41,1.64,1.3,3.69,1.3,12.71,1.41,22.61,1.53,30.77,1.63,34.6,1.68,29.96,1.63,21.32,1.53,11.08,1.4,1.64,1.3,3.69,1.3,8.22,1.35,13.19,1.42,17.3,1.47,19.26,1.5,16.7,1.47,12.09,1.42,6.66,1.35,1.64,1.3,3.69,1.3,3.43,1.3,3.18,1.3,2.92,1.3,2.66,1.3,2.41,1.3,2.15,1.3,1.9,1.3,1.64,1.3]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17","timeline":[{"name":"B_HAIR_TWIN.17_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.17_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.17_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.17_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.17_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_00","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[2.35,0,3.29,0.01,4.28,0.02,5.34,0.03,6.49,0.06,7.9,0.04,8.98,0.04,9.44,0.03,8.97,0.02,2.28,0,3.27,0.03,4.29,0.05,5.36,0.08,6.51,0.11,8.01,0.08,9.24,0.08,10.07,0.09,10.39,0.09,2.22,-0.01,3.23,0.04,4.27,0.07,5.34,0.09,6.46,0.12,7.72,0.09,8.77,0.09,9.65,0.11,10.43,0.12,2.14,-0.01,3.16,0.04,4.22,0.06,5.29,0.08,6.39,0.1,7.4,0.07,8.24,0.08,9.08,0.11,10.09,0.13,1.96,0,2.96,0.02,4.02,0.04,5.1,0.05,6.17,0.06,7.06,0.04,7.75,0.06,8.45,0.08,9.38,0.1,1.71,0,2.68,0.01,3.73,0.03,4.8,0.03,5.82,0.03,6.68,0.03,7.31,0.04,7.97,0.06,8.91,0.08,1.41,0,2.34,0,3.36,0.01,4.4,0.01,5.41,0,6.21,0.01,6.85,0.03,7.54,0.04,8.49,0.06,1.16,0,2.09,0,3.09,-0.01,4.14,-0.01,5.18,-0.03,5.9,0.01,6.54,0.04,7.26,0.07,8.19,0.08,0.97,0,1.9,-0.01,2.91,-0.02,3.97,-0.03,5.05,-0.05,5.71,0.02,6.39,0.06,7.17,0.09,8.12,0.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_01","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[1.18,0,1.64,0.01,2.14,0.01,2.67,0.02,3.25,0.03,3.95,0.02,4.49,0.02,4.72,0.02,4.49,0.01,1.14,0,1.63,0.01,2.14,0.03,2.68,0.04,3.26,0.05,4,0.04,4.62,0.04,5.04,0.04,5.19,0.04,1.11,0,1.62,0.02,2.13,0.03,2.67,0.05,3.23,0.06,3.86,0.05,4.38,0.05,4.83,0.05,5.22,0.06,1.07,0,1.58,0.02,2.11,0.03,2.65,0.04,3.19,0.05,3.7,0.04,4.12,0.04,4.54,0.05,5.05,0.06,0.98,0,1.48,0.01,2.01,0.02,2.55,0.03,3.09,0.03,3.53,0.02,3.87,0.03,4.23,0.04,4.69,0.05,0.85,0,1.34,0.01,1.86,0.01,2.4,0.02,2.91,0.02,3.34,0.01,3.66,0.02,3.99,0.03,4.45,0.04,0.71,0,1.17,0,1.68,0,2.2,0,2.7,0,3.11,0.01,3.43,0.01,3.77,0.02,4.25,0.03,0.58,0,1.04,0,1.55,0,2.07,-0.01,2.59,-0.01,2.95,0.01,3.27,0.02,3.63,0.03,4.09,0.04,0.49,0,0.95,-0.01,1.45,-0.01,1.98,-0.01,2.52,-0.02,2.86,0.01,3.2,0.03,3.58,0.04,4.06,0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_03","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[19.32,1.05,14.58,1.08,9.59,1.13,5.08,1.17,1.8,1.18,-0.48,1.21,-2.84,1.25,-5.14,1.28,-7.23,1.27,18.8,1.05,14.36,1.07,9.69,1.1,5.45,1.13,2.33,1.14,0.03,1.14,-2.35,1.14,-4.68,1.14,-6.83,1.11,18.46,1.01,14.31,1.03,9.96,1.05,5.99,1.07,3.02,1.09,0.65,1.06,-1.77,1.03,-4.17,0.99,-6.43,0.94,18.41,0.99,14.14,1,9.91,1.02,6.2,1.04,3.51,1.06,1.53,1.01,-0.71,0.96,-3.16,0.9,-5.74,0.84,16.28,0.96,11.81,0.98,8.09,0.99,5.39,1,4.02,1,3.09,0.97,1.28,0.92,-1.4,0.87,-4.96,0.82,14.12,0.96,9.4,0.97,6.14,0.98,4.42,0.98,4.33,0.97,4.38,0.95,2.94,0.91,-0.06,0.87,-4.66,0.83,13.6,0.97,9.31,0.98,6.28,0.97,4.53,0.96,4.07,0.94,3.76,0.92,2.18,0.91,-0.74,0.89,-5.04,0.84,13.05,1.01,9.73,1,7.04,0.98,4.98,0.96,3.57,0.93,2.26,0.89,0.33,0.89,-2.27,0.87,-5.58,0.8,12.54,1.03,10.19,1,7.81,0.97,5.43,0.94,3.07,0.9,0.79,0.84,-1.47,0.81,-3.74,0.77,-6.02,0.66]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_04","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[38.63,2.09,29.16,2.17,19.18,2.26,10.17,2.33,3.6,2.36,-0.95,2.43,-5.68,2.5,-10.28,2.55,-14.45,2.55,37.6,2.1,28.72,2.15,19.37,2.2,10.9,2.25,4.65,2.28,0.05,2.28,-4.7,2.29,-9.35,2.27,-13.66,2.21,36.92,2.03,28.63,2.07,19.91,2.11,11.97,2.15,6.03,2.18,1.31,2.12,-3.55,2.06,-8.34,1.99,-12.86,1.88,36.81,1.97,28.29,2,19.83,2.04,12.42,2.07,7.02,2.11,3.06,2.02,-1.43,1.92,-6.32,1.81,-11.49,1.67,32.56,1.93,23.62,1.96,16.17,1.98,10.78,1.99,8.03,2,6.19,1.94,2.58,1.85,-2.8,1.75,-9.92,1.64,28.23,1.92,18.78,1.95,12.25,1.96,8.82,1.96,8.65,1.93,8.76,1.9,5.88,1.83,-0.11,1.73,-9.31,1.66,27.19,1.95,18.62,1.96,12.56,1.95,9.06,1.92,8.14,1.87,7.51,1.85,4.35,1.82,-1.48,1.78,-10.08,1.69,26.09,2.02,19.46,1.99,14.07,1.96,9.95,1.92,7.14,1.85,4.53,1.79,0.65,1.78,-4.55,1.75,-11.15,1.61,25.07,2.05,20.37,1.99,15.62,1.94,10.87,1.89,6.14,1.81,1.58,1.68,-2.95,1.63,-7.48,1.54,-12.04,1.31]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18","timeline":[{"name":"B_HAIR_TWIN.18_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.18_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.18_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.18_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.18_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_00","timeline":[{"name":"B_HAIR_TWIN.18","type":50,"frame":[{"duration":121,"offset":20,"value":[0.9,0.1,1.88,0.22,2.7,0.32,3.12,0.36,2.7,0.32,1.88,0.22,0.9,0.1,0,0,0,0,1.74,0.19,3.64,0.42,5.22,0.62,6.01,0.7,5.21,0.62,3.63,0.42,1.74,0.19,0,0,0,0,1.89,0.21,3.97,0.46,5.68,0.66,6.46,0.75,6.43,0.67,4.69,0.46,2.27,0.21,0.19,0,0,0,1,0.12,2.11,0.24,3.01,0.35,3.37,0.39,6.41,0.35,5.74,0.25,3.58,0.12,2.17,0.01,0,0,0.11,0.02,0.25,0.03,0.34,0.03,0.29,0.03,6.42,0.04,6.82,0.04,4.91,0.04,4.15,0.02,0,0,0,0,0,0,0,0,0,0,5.28,0.01,5.77,0.01,4.34,0.01,3.86,0.02,0,0,0,0,0,0,0,0,0,0,2.66,0.01,2.92,0.01,2.23,0.01,2.01,0.01]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_03","timeline":[{"name":"B_HAIR_TWIN.18","type":50,"frame":[{"duration":121,"value":[15.87,-0.85,15.12,-0.67,14.86,-0.49,13.71,-0.24,10.3,0.16,7.84,0.16,3.1,0.18,-2.44,0.19,-7.28,0.17,10.8,-0.57,9.5,-0.45,8.48,-0.32,6.92,-0.15,3.99,0.11,2.52,0.08,-0.42,0.06,-3.86,0.04,-6.85,0.01,5.56,-0.24,3.95,-0.17,2.41,-0.1,0.67,-0.01,-1.56,0.11,-2.27,0.04,-3.59,-0.02,-5.12,-0.08,-6.44,-0.13,0.89,0,0.02,0.03,-0.92,0.05,-1.84,0.07,-2.68,0.09,-3.24,0.04,-3.89,-0.03,-4.65,-0.12,-5.55,-0.2,1.18,0,0.39,0,-0.45,0,-1.29,-0.01,-2.1,-0.01,-1.62,0.07,-1.33,0.05,-1.49,-0.04,-2.36,-0.21,1.51,0.01,0.76,-0.01,-0.04,-0.03,-0.85,-0.05,-1.66,-0.06,-0.2,0.14,0.96,0.17,1.34,0.05,0.44,-0.21,1.55,0,0.79,-0.03,-0.01,-0.06,-0.84,-0.08,-1.67,-0.1,-0.46,0.07,0.5,0.1,0.79,0,-0.03,-0.25,1.34,-0.02,0.57,-0.07,-0.26,-0.1,-1.12,-0.13,-1.96,-0.16,-1.72,-0.12,-1.59,-0.14,-1.8,-0.23,-2.59,-0.44,1.02,-0.03,0.25,-0.09,-0.61,-0.13,-1.49,-0.17,-2.35,-0.2,-3.08,-0.31,-3.8,-0.42,-4.52,-0.55,-5.28,-0.73]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_04","timeline":[{"name":"B_HAIR_TWIN.18","type":50,"frame":[{"duration":121,"value":[31.74,-1.69,30.24,-1.34,29.72,-0.99,27.43,-0.49,20.6,0.31,15.69,0.33,6.2,0.36,-4.88,0.38,-14.57,0.34,21.61,-1.14,18.99,-0.89,16.93,-0.63,13.79,-0.29,7.98,0.23,5.07,0.17,-0.82,0.13,-7.72,0.09,-13.7,0.02,11.13,-0.49,7.89,-0.34,4.81,-0.2,1.32,-0.02,-3.13,0.22,-4.52,0.08,-7.18,-0.05,-10.24,-0.16,-12.88,-0.26,1.78,0,0.03,0.05,-1.83,0.09,-3.68,0.13,-5.37,0.17,-6.49,0.07,-7.78,-0.07,-9.3,-0.23,-11.1,-0.41,2.37,0.01,0.78,0.01,-0.9,0,-2.59,-0.02,-4.2,-0.01,-3.23,0.14,-2.65,0.11,-2.97,-0.09,-4.71,-0.43,3.02,0.01,1.52,-0.03,-0.07,-0.07,-1.7,-0.1,-3.32,-0.12,-0.39,0.28,1.94,0.34,2.69,0.09,0.88,-0.42,3.09,0,1.58,-0.07,-0.02,-0.12,-1.68,-0.16,-3.33,-0.2,-0.91,0.13,1.02,0.2,1.59,0,-0.07,-0.5,2.69,-0.03,1.15,-0.13,-0.52,-0.21,-2.24,-0.27,-3.92,-0.32,-3.44,-0.25,-3.18,-0.28,-3.61,-0.47,-5.17,-0.88,2.05,-0.06,0.49,-0.18,-1.22,-0.27,-2.98,-0.33,-4.69,-0.39,-6.17,-0.62,-7.6,-0.84,-9.04,-1.1,-10.55,-1.46]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19","timeline":[{"name":"B_HAIR_TWIN.19_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.19_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.19_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.19_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.19_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_00"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_03","timeline":[{"name":"B_HAIR_TWIN.19","type":50,"frame":[{"duration":121,"value":[-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-6.02,0,-5.94,0,-5.8,-0.01,-5.69,-0.03,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.62,-0.04,-4.73,-0.12,-3.64,-0.23,-2.66,-0.33,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.21,-0.07,-3.53,-0.24,-1.48,-0.44,0.38,-0.62,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.21,-0.07,-3.65,-0.23,-1.78,-0.42,-0.06,-0.58,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.56,-0.04,-4.75,-0.12,-3.79,-0.22,-2.9,-0.3,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_04","timeline":[{"name":"B_HAIR_TWIN.19","type":50,"frame":[{"duration":121,"value":[-28.72,1.09,-28.59,1.04,-28.83,1.1,-29.13,1.23,-29.22,1.39,-29.69,1.3,-29.73,1.26,-29.95,1.26,-30.95,1.29,-28.26,0.64,-28.36,0.67,-28.76,0.8,-29.29,0.97,-29.77,1.12,-30.26,1.07,-30.36,1,-30.55,0.95,-31.3,0.93,-28.23,0.34,-28.33,0.46,-28.67,0.66,-29.2,0.87,-29.86,1.01,-30.39,0.99,-30.56,0.87,-30.72,0.72,-31.23,0.64,-28.67,0.33,-28.58,0.45,-28.68,0.64,-29.03,0.82,-29.69,0.93,-29.53,0.97,-28.64,0.95,-27.51,0.9,-26.65,0.87,-29.64,0.54,-29.1,0.53,-28.73,0.54,-28.69,0.57,-29.19,0.64,-26.77,0.74,-22.38,1.03,-17.26,1.34,-12.63,1.54,-30.24,0.72,-29.31,0.58,-28.5,0.43,-28.11,0.34,-28.48,0.37,-24.98,0.47,-18.35,0.9,-10.49,1.41,-3.32,1.77,-32.59,0.8,-32.2,0.53,-31.86,0.29,-32.13,0.16,-33.61,0.2,-28.99,0.25,-20.93,0.62,-11.48,1.1,-2.69,1.51,-43.05,0.71,-40.48,0.19,-37.86,-0.33,-36.15,-0.68,-36.33,-0.72,-33.31,-0.66,-27.23,-0.34,-19.84,0.1,-12.92,0.55,-54.92,0.54,-49.87,-0.25,-44.65,-1.03,-40.66,-1.58,-39.29,-1.68,-38.17,-1.63,-34.39,-1.39,-29.41,-1.01,-24.69,-0.55]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20","timeline":[{"name":"B_HAIR_TWIN.20_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.20_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.20_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.20_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.20_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_00","timeline":[{"name":"B_HAIR_TWIN.20","type":50,"frame":[{"duration":121,"value":[13.92,-0.01,13.76,0.01,13.42,0.06,13.08,0.11,12.92,0.14,13.08,0.12,13.42,0.09,13.77,0.06,13.94,0.05,13.92,-0.01,13.79,0.02,13.51,0.09,13.23,0.16,13.09,0.19,13.18,0.17,13.39,0.13,13.6,0.09,13.68,0.08,13.92,-0.02,13.82,0.02,13.61,0.12,13.41,0.21,13.29,0.25,13.36,0.23,13.48,0.17,13.58,0.11,13.62,0.09,13.89,-0.03,13.83,0.02,13.67,0.12,13.49,0.22,13.38,0.26,13.43,0.23,13.51,0.17,13.57,0.11,13.58,0.08,13.87,-0.01,13.89,0.04,13.74,0.12,13.54,0.2,13.41,0.23,13.39,0.2,13.45,0.14,13.51,0.09,13.45,0.06,13.88,0.01,13.95,0.04,13.76,0.1,13.49,0.14,13.31,0.16,13.24,0.13,13.3,0.09,13.35,0.07,13.24,0.05,14.1,0.03,14.05,0.04,13.7,0.07,13.28,0.08,13.03,0.08,12.98,0.06,13.08,0.05,13.17,0.05,13.09,0.04,14.25,0.04,14.06,0.04,13.53,0.04,12.97,0.04,12.68,0.03,12.69,0.03,12.83,0.03,12.97,0.04,12.96,0.04,14.3,0.07,13.98,0.05,13.27,0.01,12.57,-0.03,12.25,-0.05,12.35,-0.03,12.57,0,12.78,0.04,12.85,0.07]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_01","timeline":[{"name":"B_HAIR_TWIN.20","type":50,"frame":[{"duration":121,"value":[6.96,0,6.88,0.01,6.71,0.03,6.54,0.06,6.46,0.07,6.54,0.06,6.71,0.05,6.88,0.03,6.97,0.03,6.96,-0.01,6.89,0.01,6.76,0.04,6.62,0.08,6.55,0.09,6.59,0.09,6.7,0.07,6.8,0.05,6.84,0.04,6.96,-0.01,6.91,0.01,6.81,0.06,6.7,0.1,6.65,0.12,6.68,0.11,6.74,0.08,6.79,0.05,6.81,0.04,6.95,-0.01,6.92,0.01,6.84,0.06,6.75,0.11,6.69,0.13,6.71,0.12,6.75,0.08,6.79,0.05,6.79,0.04,6.94,0,6.95,0.02,6.87,0.06,6.77,0.1,6.7,0.12,6.69,0.1,6.73,0.07,6.75,0.04,6.73,0.03,6.94,0.01,6.97,0.02,6.88,0.05,6.75,0.07,6.66,0.08,6.62,0.06,6.65,0.05,6.68,0.03,6.62,0.02,7.05,0.01,7.03,0.02,6.85,0.03,6.64,0.04,6.51,0.04,6.49,0.03,6.54,0.03,6.58,0.02,6.54,0.02,7.12,0.02,7.03,0.02,6.76,0.02,6.48,0.02,6.34,0.01,6.34,0.01,6.42,0.01,6.48,0.02,6.48,0.02,7.15,0.04,6.99,0.03,6.64,0.01,6.28,-0.01,6.13,-0.03,6.18,-0.02,6.28,0,6.39,0.02,6.43,0.03]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_04","timeline":[{"name":"B_HAIR_TWIN.20","type":50,"frame":[{"duration":121,"value":[-14.43,0.25,-12.8,0.21,-11.34,0.2,-9.91,0.19,-8.4,0.16,-6.94,0.15,-5.37,0.12,-3.74,0.08,-2.13,0.05,-14.25,0.04,-12.7,0.05,-11.26,0.09,-9.84,0.13,-8.31,0.13,-6.96,0.12,-5.46,0.1,-3.88,0.06,-2.29,0.03,-14.38,-0.1,-12.83,-0.04,-11.36,0.04,-9.88,0.11,-8.27,0.13,-7.02,0.12,-5.59,0.09,-4.05,0.05,-2.47,0.01,-14.92,-0.09,-13.33,-0.04,-11.81,0.03,-10.26,0.09,-8.56,0.1,-7.36,0.11,-5.92,0.08,-4.33,0.03,-2.7,-0.01,-15.84,-0.01,-14.14,-0.01,-12.53,0.03,-10.89,0.05,-9.1,0.02,-7.93,0.06,-6.42,0.05,-4.7,0.02,-2.94,-0.01,-16.83,0.11,-14.9,0.05,-13.09,0.03,-11.24,-0.01,-9.24,-0.09,-8.18,0,-6.67,0.01,-4.91,-0.01,-3.11,-0.02,-17.38,0.2,-16.47,0.27,-15.81,0.49,-14.78,0.69,-12.74,0.72,-11.51,0.69,-9,0.43,-5.92,0.13,-2.97,-0.03,-16.83,0.2,-18.73,0.29,-21.06,0.47,-22.5,0.62,-21.69,0.66,-19.15,0.63,-14.13,0.41,-8.06,0.14,-2.4,-0.04,-15.54,0.06,-20.53,0.18,-26.13,0.29,-30.32,0.37,-31.1,0.4,-27.11,0.42,-19.41,0.3,-10.18,0.13,-1.62,-0.04]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21","timeline":[{"name":"B_HAIR_TWIN.21_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.21_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.21_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.21_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.21_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_00","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"value":[5.31,0,6.35,0.04,7.51,0.07,8.77,0.09,10.06,0.11,11.39,0.12,12.79,0.13,14.34,0.12,16.13,0.09,5.18,-0.01,6.29,0.06,7.51,0.11,8.8,0.15,10.13,0.18,11.42,0.19,12.77,0.19,14.23,0.17,15.84,0.13,5.06,-0.01,6.22,0.07,7.46,0.13,8.76,0.17,10.08,0.2,11.36,0.22,12.68,0.23,14.05,0.21,15.51,0.15,4.35,0,5.65,0.09,7.02,0.14,8.37,0.17,9.62,0.2,10.92,0.22,12.31,0.23,13.77,0.21,15.28,0.14,-1.72,0,0.53,0.15,2.89,0.29,5.07,0.4,6.74,0.45,8.4,0.44,10.38,0.35,12.55,0.23,14.82,0.09,-7.94,0.01,-4.75,0.22,-1.4,0.45,1.56,0.64,3.64,0.73,5.71,0.68,8.3,0.5,11.23,0.27,14.31,0.06,-5.81,0.08,-1.17,0.35,3.62,0.77,8.13,1.16,11.91,1.33,13.57,1.39,15.99,1.49,18.86,1.55,21.85,1.51,6.7,0.34,9.39,0.44,12.21,0.64,15.02,0.84,17.71,0.93,19.6,0.99,22.52,1.11,26,1.24,29.57,1.29,20.42,0.6,20.68,0.53,21.03,0.45,21.63,0.39,22.67,0.36,24.88,0.4,28.4,0.5,32.61,0.63,36.86,0.76]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_01","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"offset":54,"value":[-0.49,0,-0.38,0.02,-0.24,0.03,-0.16,0.03,-0.2,0.03,-0.23,0.03,-0.17,0.03,-0.08,0.02,0,0,-5.75,0,-4.74,0.11,-3.63,0.22,-2.73,0.31,-2.36,0.35,-2.1,0.31,-1.47,0.22,-0.7,0.1,0,0,-11,0,-9.1,0.19,-7.01,0.42,-5.29,0.6,-4.51,0.68,-3.97,0.6,-2.77,0.42,-1.32,0.19,0,0,-10.24,0,-8.49,0.18,-6.58,0.38,-4.99,0.56,-4.2,0.63,-3.65,0.56,-2.55,0.38,-1.22,0.17,0,0,-5.32,0,-4.42,0.09,-3.43,0.2,-2.61,0.29,-2.18,0.33,-1.89,0.29,-1.31,0.2,-0.63,0.09]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_03","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"value":[43.85,0.65,42.67,0.84,41.36,1.05,40.3,1.23,39.86,1.3,40.01,1.23,40.36,1.05,40.8,0.84,41.19,0.65,36.37,0.65,35.38,0.38,34.31,-0.35,33.4,-1.1,32.87,-1.44,32.66,-1.1,32.58,-0.35,32.54,0.38,32.49,0.65,28.09,0.65,27.32,0.38,26.51,-0.27,25.76,-0.93,25.17,-1.23,24.8,-0.93,24.48,-0.27,24.18,0.38,23.88,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_04","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"value":[43.85,0.65,42.67,0.84,41.36,1.05,40.3,1.23,39.86,1.3,40.01,1.23,40.36,1.05,40.8,0.84,41.19,0.65,36.37,0.65,35.38,0.38,34.31,-0.35,33.4,-1.1,32.87,-1.44,32.66,-1.1,32.58,-0.35,32.54,0.38,32.49,0.65,28.09,0.65,27.32,0.38,26.51,-0.27,25.76,-0.93,25.17,-1.23,24.8,-0.93,24.48,-0.27,24.18,0.38,23.88,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03","timeline":[{"name":"D_HAIR_TWIN.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.03_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.03_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_00","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[155.94,2.82,77.85,16.35,-47.4,-4.83,-80.69,-6.42,-97.91,5.26,-35.67,16.31,11.56,19.46,27.12,-28.41,-9.2,12.85,-70.62,2.47,-71.36,-0.14,-60.2,-4.73,-68.94,-4.68,-26.74,-9.69,23.51,-7.16]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_01","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[78.1,-1.86,76.94,0.25,-47.4,-4.83,-47.56,-8.2,-1.71,-0.01,-30.58,-0.1,-26.34,18.01,-5.13,-14.65,-28.4,9.21,-38.2,3.36,-37.27,-3.29,-36.82,6.64,-47.49,-6.77,-26.28,-9.74,19.31,-3.25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_03","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[-18.36,3.02,-37.5,-4.02,-3.55,0,-4.55,0,-6.23,0,28.38,7.03,106.35,1,51.56,6.03,68.47,3.93,44.36,0.44,15.4,4.26,51.64,0.5,-4.13,0,23.99,3.01,-11.42,1.6]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_04","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[-18.36,3.02,-37.5,-4.02,-3.55,0,-4.55,0,-6.23,0,28.38,7.03,106.35,1,51.56,6.03,68.47,3.93,44.36,0.44,15.4,4.26,51.64,0.5,-4.13,0,23.99,3.01,-11.42,1.6]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02","timeline":[{"name":"D_HAIR_TWIN.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_00","timeline":[{"name":"D_HAIR_TWIN.02","type":22,"frame":[{"duration":121,"value":[30.57,0.18,30.68,0.18,30.77,0.18,30.82,0.14,29.97,0.08,30.54,0.07,29.45,0.09,27.74,0.07,26.79,0.02,28.57,0.06,29.54,0.09,30.41,0.06,30.54,0.16,30.76,0.18,30.59,0.18,30.72,0.18,30.85,0.12,30.94,0.07,29.55,0.09]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11","timeline":[{"name":"D_HAIR_TWIN.11_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.11_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.11_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.11_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.11_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_00","timeline":[{"name":"D_HAIR_TWIN.11","type":22,"frame":[{"duration":121,"value":[71.53,1.03,71.18,1,71.65,1.04,71.83,1.08,69.76,1.11,68.04,1.12,63.87,1.07,60.06,0.98,61.84,0.87,63.8,0.65,65.91,0.56,69.85,0.75,72.35,1.05,71.65,1.04,71.57,1.04,71.98,1.05,71.98,0.95,68.38,0.87,66.76,0.86]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_01","timeline":[{"name":"D_HAIR_TWIN.11","type":22,"frame":[{"duration":121,"value":[35.76,0.52,35.59,0.5,35.82,0.52,35.92,0.54,34.88,0.55,34.02,0.56,31.93,0.54,30.03,0.49,30.92,0.43,31.9,0.33,32.95,0.28,34.93,0.38,36.18,0.53,35.82,0.52,35.79,0.52,35.99,0.52,35.99,0.47,34.19,0.44,33.38,0.43]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01","timeline":[{"name":"B_HAIR_TWIN.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_00","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-20,41.71,-9.28,31.92,1.66,22.98,10.6,21.04,17,27,23.4,32.96,24.88,30.21,28.3,25.32,32,20.29,-5.06,53.09,0.94,40.3,6.79,28.44,11.84,24.53,14.55,31.7,17.26,38.88,18.07,34.89,20.26,24.6,22.74,13.81,8.41,64.12,10,49.15,11.03,35.02,12.49,29.61,12.03,37.08,11.57,44.54,11.79,39.29,12.85,23.99,14.19,7.82,7.92,64.81,8.32,54.01,9.34,44.13,9.45,41.15,9.87,42.64,10.18,45.18,10.31,38.38,11.45,21.08,12.49,2.82,21.01,52.97,19.19,44.03,17.61,36.63,16.03,35.88,13.75,29.33,11.06,26.91,10.23,21.56,11.06,8.87,11.75,-4.46,37.48,41.96,33.18,33.45,28.54,26.98,25.02,27.68,18.89,14.33,12.05,8.19,10.02,5.8,10.08,-0.7,10.17,-7.52,37.56,27.75,32.68,16.52,30.09,5.47,25.74,3.21,18.37,-9.67,10.57,-13.46,8.14,-10.95,9.29,-9.86,8.91,-8.59,59.14,17.23,49.02,1.21,41.63,-17.96,34.24,-26.77,25.94,-39.69,17.86,-42.89,13.4,-35.05,9.59,-23.94,4.63,-12.01,78.03,5.75,62.8,-13.38,51.28,-39.47,41.11,-53.98,33.29,-67.98,26.31,-71.87,19.73,-59.31,10.08,-38.32,0,-15.71]},{"duration":60,"tweenEasing":0,"value":[-18,69.73,-10.05,56.24,-1.69,43.88,6.43,40.71,11,43.02,15.57,45.33,16.22,41.79,17.07,35.19,18,28.31,-4.11,73.43,0.68,58.21,5.73,44.04,10.52,39.3,12.25,43.42,13.99,47.55,14.37,43.28,15.23,32.83,16.15,21.83,8.72,76.85,10.43,60.61,12.14,45.26,13.81,39.36,13.16,44.57,12.5,49.77,12.66,44.73,13.52,30.68,14.44,15.84,9.84,72.66,10.23,61.05,11.25,50.41,11.37,47.07,11.82,47.75,12.17,49.48,12.31,43.07,13.45,27.38,14.49,10.84,22.01,58.99,20.19,50.06,18.61,42.66,17.07,41.91,15.25,35.35,13.01,32.92,12.23,27.81,13.06,15.98,13.75,3.56,37.56,46.15,33.26,38.45,28.63,32.74,25.19,33.81,19.94,21.25,13.97,15.92,12.02,13.61,12.08,7.21,12.17,0.5,37.78,32.21,32.89,21.77,30.31,11.46,26.04,9.54,19.48,-2.55,12.5,-5.54,10.14,-2.93,11.29,-1.84,10.91,-0.56,60.21,23.4,50.09,7.79,42.7,-11,35.36,-19.62,27.48,-32.14,19.82,-34.92,15.4,-27.02,11.59,-15.92,6.63,-3.99,80.03,13.77,64.8,-5.36,53.28,-31.45,43.11,-45.96,35.29,-59.96,28.31,-63.85,21.73,-51.29,12.08,-30.3,2,-7.69]},{"value":[-118.67,95.76,-106.22,75.26,-93.35,56.59,-78.26,53.13,-66.17,48.3,-55.76,44.31,-47.73,44.54,-39.27,34.1,-30.67,22.34,-70,92.71,-62.25,73.43,-54.54,55.97,-44.67,51.48,-37.64,48.58,-31.67,46.2,-27.04,44.02,-22.77,32.42,-17.71,19.56,-25.2,89.38,-21.86,71.43,-18.94,55.01,-14.05,49.87,-11.75,48.86,-9.87,48.06,-8.4,43.7,-7.66,30.87,-5.73,16.99,-16.57,80.43,-15.68,65.92,-14.85,52.8,-12.96,49.52,-9.8,48.13,-6.75,47.8,-6.13,41.59,-4.08,27.51,-2.01,12.69,-1.65,64.01,-4.65,53.18,-9.35,44.16,-10.53,43.61,-8.09,35.43,-6.06,31.33,-5.99,26.06,-3.45,15.08,-0.92,3.59,16.64,48.44,12.83,39.06,7.7,31.83,4.37,32.77,0.14,19.85,-4.81,14.09,-6,11.61,-3.41,5.3,-0.67,-1.3,16.45,34.02,13.14,21.99,12.12,10.21,8.2,7.79,0.83,-4.31,-6.97,-7.3,-8.77,-4.69,-5.26,-3.59,-3.29,-2.32,36.32,24.35,27.02,7.91,20.44,-11.6,13.28,-20.52,4.98,-33.04,-3.11,-35.82,-7.23,-27.94,-9.8,-16.8,-13.56,-4.89,53.36,13.8,38.14,-5.33,26.61,-31.43,16.45,-45.93,8.63,-59.94,1.64,-63.82,-4.93,-51.26,-14.59,-30.27,-24.67,-7.66]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_01","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-17,6.84,-10.25,3.8,-3.5,1.04,1.39,0.68,5.5,5.49,9.61,10.3,10.77,9.31,13.76,7.72,17,6.13,-9,16.37,-5.38,11.19,-2.1,6.36,0.58,4.9,2.42,9.99,4.27,15.08,4.88,13.26,6.64,8.2,8.67,2.89,-1.95,25.69,-1.21,18.83,-1.06,12.32,-0.42,9.96,-0.55,14.79,-0.68,19.63,-0.54,16.96,0.08,8.67,0.97,-0.1,-2.99,28.48,-2.8,23.5,-2.29,18.95,-2.23,17.62,-2.05,18.77,-1.91,20.44,-1.85,16.9,-1.28,7.43,-0.76,-2.6,4.01,23.47,3.1,19.03,2.31,15.34,1.49,14.93,0.13,11.63,-1.45,10.43,-1.88,7.68,-1.47,0.9,-1.13,-6.24,12.7,18.88,10.55,14.22,8.23,10.61,6.42,10.76,2.93,3.66,-0.93,0.2,-1.99,-1.02,-1.96,-4.31,-1.92,-7.77,12.67,11.65,10.22,5.64,8.94,-0.33,6.73,-1.55,2.63,-8.34,-1.69,-10.65,-2.93,-9.48,-2.35,-8.94,-2.55,-8.3,23.03,5.53,17.95,-2.67,14.29,-12.54,10.58,-16.96,6.2,-23.57,1.94,-25.38,-0.3,-21.53,-2.2,-15.99,-4.69,-10.01,32.01,-1.14,24.4,-10.7,18.64,-23.75,13.56,-31,9.65,-38,6.15,-39.94,2.87,-33.67,-1.96,-23.17,-7,-11.87]},{"duration":60,"tweenEasing":0,"value":[-9,34.86,-5.03,28.12,-0.84,21.94,3.21,20.36,5.5,21.51,7.79,22.66,8.11,20.9,8.54,17.6,9,14.16,-2.06,36.72,0.34,29.09,2.84,21.97,5.26,19.66,6.13,21.71,6.99,23.77,7.18,21.65,7.61,16.42,8.07,10.92,4.36,38.43,5.22,30.28,6.06,22.56,6.91,19.69,6.58,22.28,6.25,24.87,6.33,22.38,6.76,15.35,7.22,7.92,4.92,36.33,5.12,30.53,5.63,25.22,5.68,23.54,5.91,23.87,6.09,24.74,6.15,21.57,6.72,13.71,7.24,5.42,11.01,29.49,10.1,25.05,9.31,21.36,8.53,20.95,7.63,17.65,6.51,16.45,6.12,13.92,6.53,8,6.88,1.78,18.78,23.08,16.63,19.23,14.32,16.38,12.59,16.89,9.97,10.59,6.99,7.94,6.01,6.8,6.04,3.61,6.08,0.25,18.89,16.11,16.44,10.89,15.16,5.67,13.03,4.78,9.74,-1.22,6.24,-2.73,5.07,-1.46,5.65,-0.92,5.45,-0.28,30.11,11.7,25.02,3.91,21.36,-5.57,17.69,-9.81,13.74,-16.01,9.9,-17.41,7.7,-13.5,5.8,-7.97,3.31,-1.99,40.01,6.88,32.4,-2.68,26.64,-15.73,21.56,-22.98,17.65,-29.98,14.15,-31.92,10.87,-25.65,6.04,-15.15,1,-3.84]},{"value":[-91.67,59.89,-81.81,46.6,-71.84,34.54,-61.71,32.48,-53.17,26.41,-44.62,21.61,-37.28,23.64,-30.95,16.51,-24.67,8.18,-52.26,55.46,-45.7,43.39,-39.15,32.48,-32.13,30.04,-27.28,25.71,-22.43,22.17,-18.21,22.42,-15.27,16.01,-11.71,8.65,-16.01,50.85,-12.65,40.02,-9.37,30.18,-5.35,27.53,-3.88,25.01,-2.4,22.8,-1.09,21.35,-0.92,15.52,0.27,9.07,-8.49,44.1,-7.8,35.43,-7.46,27.64,-5.64,25.98,-2.71,24.26,0.16,23.06,0.71,20.07,2.18,13.83,3.75,7.27,0.34,34.52,-1.74,28.22,-5.65,22.94,-6.07,22.66,-2.71,17.71,0.44,14.82,0.89,12.17,3.02,7.1,5.21,1.81,10.86,25.36,9.2,19.85,6.38,15.52,4.76,15.86,3.18,9.15,1.22,6.08,1,4.8,3.55,1.69,6.25,-1.55,10.57,17.92,9.68,11.11,9.98,4.4,8.19,3.03,4.09,-2.97,-0.23,-4.49,-0.85,-3.21,2.1,-2.68,4.26,-2.04,19.22,12.65,14.94,4.04,12.1,-6.2,8.61,-10.71,4.24,-16.91,-0.03,-18.31,-1.93,-14.41,-2.6,-8.86,-3.87,-2.89,26.35,6.91,18.74,-2.65,12.97,-15.7,7.89,-22.95,3.98,-29.95,0.49,-31.9,-2.8,-25.62,-7.63,-15.12,-12.67,-3.82]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_02","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-10,-26.02,-7.22,-22.32,-4.66,-18.9,-3.83,-17.68,-2,-14.02,-0.17,-10.36,0.66,-9.58,3.22,-7.87,6,-6.02,-8.95,-18.35,-7.71,-15.89,-6.94,-13.62,-6.69,-12.75,-5.7,-9.72,-4.72,-6.69,-4.3,-6.39,-2.97,-6.22,-1.41,-6.02,-8.31,-10.74,-8.42,-9.44,-9.11,-8.26,-9.32,-7.73,-9.13,-5.49,-8.93,-3.25,-8.87,-3.4,-8.68,-4.67,-8.25,-6.02,-9.91,-5.85,-9.91,-5.03,-9.91,-4.27,-9.92,-3.92,-9.96,-3.11,-10,-2.3,-10,-2.66,-10,-4.28,-10,-6.02,-9,-4.02,-9,-4.02,-9,-4.02,-9.04,-4.02,-9.5,-4.02,-9.96,-4.02,-10,-4.24,-10,-5.1,-10,-6.02,-8.09,-2.19,-8.09,-3.01,-8.09,-3.77,-8.17,-4.13,-9.04,-4.94,-9.92,-5.74,-10,-5.82,-10,-5.91,-10,-6.02,-8.22,-2.46,-8.22,-3.26,-8.22,-4.01,-8.3,-4.34,-9.11,-5.13,-9.92,-5.92,-10,-6.02,-10,-6.02,-10,-6.02,-9.07,-4.17,-9.07,-4.58,-9.07,-4.97,-9.11,-5.15,-9.54,-5.56,-9.96,-5.97,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-70.67,24.03,-63.39,17.94,-56.32,12.5,-51.16,11.84,-46.17,4.53,-39.49,-1.1,-32.82,2.75,-28.64,-1.09,-24.67,-5.97,-40.51,18.2,-35.15,13.35,-29.74,9.07,-25.59,8.59,-22.92,2.85,-19.2,-1.85,-15.39,0.79,-13.76,-0.42,-11.71,-2.27,-12.82,12.31,-9.44,8.62,-5.79,5.41,-2.66,5.17,-2,1.16,-0.93,-2.44,0.22,-1.03,-0.17,0.15,0.27,1.15,-6.41,7.77,-5.91,4.9,-6.08,2.45,-4.33,2.44,-1.62,0.38,1.08,-1.68,1.56,-1.51,2.45,0.11,3.51,1.86,-3.67,5.03,-4.83,3.19,-7.95,1.65,-7.61,1.72,-3.34,0.03,0.93,-1.65,1.77,-1.76,3.48,-0.9,5.33,0.03,-0.92,2.29,-0.43,0.64,-0.94,-0.82,-0.83,-1.01,0.2,-1.45,1.24,-1.88,1.99,-2,4.51,-1.91,7.16,-1.8,-1.32,1.81,0.24,0.21,1.82,-1.28,2.16,-1.75,1.35,-1.75,0.53,-1.75,1.08,-1.75,3.45,-1.75,5.8,-1.75,-3.89,0.95,-3.08,0.13,-2.26,-0.65,-2.08,-0.9,-2.5,-0.9,-2.92,-0.9,-2.64,-0.9,-1.39,-0.9,-0.19,-0.9,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_03","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-2.67,-29.48,-0.35,-26.39,1.79,-23.13,2.24,-14.04,3.29,0.89,3.64,16.87,3.36,28.95,4.79,40.76,6.33,53.09,-2.68,-20.01,-2.99,-14.84,-4.05,-9.64,-4.71,-1.4,-5.19,13.64,-6.74,29.17,-7.5,37.31,-6.56,41.89,-5.24,46.49,-3.89,-10.41,-6.6,-4.45,-10.46,1.33,-12.09,8.16,-13.69,24.24,-16.75,40.26,-17.9,44.96,-17.19,42.71,-15.93,39.95,-9.77,-3.1,-11.9,2.29,-13.93,7.48,-15.37,12.55,-16.52,26.94,-19.01,41.01,-20.11,44.56,-19.55,40.37,-18.54,35.4,-0.29,-0.87,-2.83,4.21,-5.31,9.24,-8.18,13.99,-10.75,21.77,-13.53,29.55,-14.78,33.13,-16.29,31.8,-17.17,29.91,8.76,-0.74,5.54,4.03,2.18,8.9,-2.34,13.57,-7.28,15.55,-11.33,17.83,-12.31,21.69,-14.11,23.22,-15.8,24.43,11.91,-3,7.9,1.31,3.76,5.7,-1.77,10.36,-7.21,13.35,-11.18,16.66,-11.92,20.93,-13.59,22.33,-15.78,23.36,16.57,-6.42,11.48,-1.83,6.22,2.74,-0.1,7.33,-4.97,12.94,-8.04,18.72,-9.13,22.68,-12.47,22.2,-16.2,21.23,21.33,-10.12,15.11,-5.14,8.68,-0.3,1.51,4.27,-3.04,12.39,-5.49,20.51,-6.87,24.18,-11.57,21.86,-16.67,18.91]},{"duration":60,"tweenEasing":0,"value":[7.33,-3.46,6.87,-4.07,6.44,-4.23,6.07,3.63,5.29,14.91,3.81,27.23,2.71,38.53,1.57,48.63,0.33,59.11,6.27,-1.67,4.71,1.04,2.89,3.96,1.97,11.35,0.51,23.36,-2.02,35.87,-3.2,43.69,-3.59,48.11,-3.83,52.51,4.43,0.33,1.82,4.98,-1.35,9.58,-2.76,15.89,-4.58,29.73,-7.83,43.51,-9.03,48.38,-8.52,47.39,-7.68,45.97,0.15,2.75,-1.98,7.33,-4.01,11.74,-5.45,16.47,-6.57,30.05,-9.01,43.31,-10.11,47.22,-9.55,44.65,-8.54,41.42,8.71,3.15,6.17,8.24,3.69,13.27,0.86,18.01,-1.25,25.79,-3.58,33.56,-4.78,37.37,-6.29,36.89,-7.17,35.93,16.85,1.45,13.62,7.04,10.27,12.67,5.83,17.7,1.76,20.48,-1.41,23.57,-2.31,27.51,-4.11,29.13,-5.8,30.45,20.13,-0.54,16.12,4.57,11.98,9.71,6.53,14.7,1.89,18.48,-1.26,22.59,-1.92,26.95,-3.59,28.35,-5.78,29.39,25.64,-2.25,20.55,2.75,15.3,7.71,9.01,12.48,4.57,18.5,1.92,24.68,0.87,28.71,-2.47,28.23,-6.2,27.25,31.33,-4.1,25.11,0.88,18.68,5.72,11.51,10.29,6.96,18.41,4.51,26.54,3.13,30.2,-1.57,27.88,-6.67,24.93]},{"value":[-56.33,19.57,-47.67,13.33,-39.32,8.16,-34.05,15.43,-29.38,18.93,-23.72,25.18,-18.66,40.28,-17.76,46.54,-17.33,52.14,-27.25,15.53,-21.76,13.61,-16.71,12.51,-13.11,19.43,-12.07,25.26,-11.05,32.62,-8.78,43.07,-8.84,46.47,-8.54,49.24,-1.4,11.63,0.85,12.62,2.62,14.11,4.61,20.15,2.67,29.49,-0.27,39.21,-0.51,45.59,-0.94,46.15,-0.41,46.12,0.74,9.52,0.4,11.24,-0.54,13.19,0.01,17.85,0.71,28.95,0.1,39.72,-0.7,43.88,0.33,43.33,1.97,42.27,12.04,7.18,9.03,10.45,4.1,13.89,1.72,18.68,3.41,24.57,4.89,30.46,4.43,34.17,4.42,34.76,5.17,34.96,22.92,2.74,20.29,6.69,16.47,10.83,12.13,15.67,9.06,18.01,6.87,20.66,6.72,24.46,7.44,26.19,8.37,27.65,25.81,0.27,23.36,3.78,20.8,7.43,15.69,11.94,10.24,15.73,6.27,19.83,6.16,24.2,6.86,25.6,7.03,26.63,28.75,-2.3,24.47,1.88,20.04,6.07,13.94,10.58,9.07,16.6,5.99,22.78,5.23,26.8,3.13,26.33,0.61,25.35,31.67,-5.08,25.44,-0.1,19.01,4.75,11.84,9.32,7.29,17.44,4.85,25.56,3.46,29.23,-1.24,26.91,-6.33,23.96]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_04","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[4.67,-32.94,6.52,-30.46,8.23,-27.36,8.3,-10.41,8.57,15.79,7.45,44.1,6.07,67.49,6.36,89.38,6.67,112.2,3.59,-21.68,1.73,-13.8,-1.15,-5.69,-2.74,9.95,-4.69,37,-8.76,65.03,-10.7,80.99,-10.15,90.01,-9.07,98.99,0.54,-10.09,-4.79,0.54,-11.8,10.9,-14.85,24.05,-18.27,53.96,-24.58,83.77,-26.93,93.26,-25.68,90.06,-23.61,85.92,-9.62,-0.35,-13.88,9.62,-17.94,19.22,-20.82,29,-23.09,56.99,-28.01,84.34,-30.22,91.77,-29.1,85.03,-27.08,76.81,8.42,2.29,3.33,12.45,-1.62,22.52,-7.31,32,-12.01,47.55,-17.12,63.11,-19.57,70.49,-22.59,68.69,-24.33,65.84,25.61,0.71,19.16,11.07,12.44,21.57,3.5,31.28,-5.5,36.03,-12.75,41.41,-14.61,49.2,-18.21,52.35,-21.59,54.87,32.04,-3.54,24.02,5.88,15.72,15.42,4.76,25.07,-5.33,31.84,-12.45,39.24,-13.84,47.88,-17.17,50.69,-21.55,52.75,42.21,-8.67,32.03,0.92,21.5,10.45,8.91,19.81,-0.41,31.45,-6.12,43.4,-8.27,51.38,-14.94,50.44,-22.41,48.47,52.67,-14.23,40.22,-4.27,27.35,5.42,13.02,14.56,3.92,30.81,-0.97,47.05,-3.74,54.39,-13.15,49.75,-23.33,43.84]},{"duration":60,"tweenEasing":0,"value":[14.67,-6.92,13.74,-8.15,12.89,-8.46,12.13,7.27,10.57,29.81,7.62,54.47,5.42,77.07,3.14,97.26,0.67,118.22,12.53,-3.34,9.41,2.06,5.78,7.88,3.94,22.7,1,46.72,-4.05,71.74,-6.4,87.37,-7.18,96.23,-7.67,105.01,8.85,0.65,3.62,9.97,-2.69,19.15,-5.53,31.78,-9.16,59.45,-15.67,87.02,-18.06,96.69,-17.02,94.76,-15.36,91.94,0.3,5.5,-3.96,14.65,-8.03,23.49,-10.9,32.92,-13.13,60.09,-18.02,86.63,-20.22,94.44,-19.1,89.31,-17.08,82.83,17.42,6.31,12.33,16.47,7.38,26.54,1.73,36.02,-2.51,51.58,-7.16,67.13,-9.57,74.73,-12.59,73.79,-14.33,71.86,33.69,2.9,27.25,14.08,20.54,25.35,11.67,35.4,3.54,40.97,-2.83,47.15,-4.61,55.02,-8.21,58.26,-11.59,60.9,40.26,-1.08,32.24,9.13,23.94,19.43,13.05,29.4,3.78,36.96,-2.52,45.16,-3.84,53.9,-7.17,56.71,-11.55,58.77,51.29,-4.5,41.1,5.5,30.58,15.42,18.02,24.96,9.13,37,3.84,49.37,1.73,57.4,-4.94,56.46,-12.41,54.49,62.67,-8.21,50.22,1.76,37.35,11.44,23.02,20.59,13.92,36.83,9.03,53.07,6.26,60.41,-3.15,55.77,-13.33,49.86]},{"value":[-42,15.11,-31.94,8.72,-22.31,3.81,-16.94,19.02,-12.59,33.34,-7.95,51.45,-4.5,77.82,-6.87,94.17,-10,110.24,-13.98,12.87,-8.36,13.85,-3.68,15.94,-0.63,30.27,-1.24,47.68,-2.92,67.09,-2.17,85.34,-3.93,93.37,-5.37,100.74,10.03,10.96,11.14,16.63,11.04,22.8,11.88,35.12,7.35,57.83,0.4,80.86,-1.24,92.16,-1.71,92.13,-1.09,91.09,7.89,11.27,6.71,17.56,5,23.94,4.35,33.25,3.05,57.51,-0.87,81.14,-2.97,89.27,-1.79,86.56,0.43,82.69,27.75,9.34,22.89,17.69,16.14,26.15,11.05,35.65,10.15,49.11,8.84,62.56,7.09,70.08,5.36,70.43,5,69.89,46.77,3.19,41.01,12.73,33.88,22.48,25.1,32.37,17.93,37.48,12.5,43.2,11.46,50.91,10.36,54.3,9.57,57.09,52.94,-1.27,46.48,7.34,39.75,16.16,29.21,25.65,19.13,33.21,12.01,41.41,11.25,50.14,10.28,52.96,8.25,55.02,61.4,-5.55,52.02,3.62,42.31,12.78,29.95,22.06,20.63,34.11,14.91,46.47,13.1,54.48,7.66,53.57,1.41,51.59,70,-10.18,57.55,-0.22,44.69,9.46,30.36,18.61,21.25,34.86,16.36,51.1,13.59,58.44,4.18,53.8,-6,47.89]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08","timeline":[{"name":"B_HAIR_TWIN.08_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.08_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.08_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.08_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.08_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_00","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-43.39,6.37,-47.11,6.34,-50.46,6.31,-53.48,6.26,-56.2,6.21,-58.78,6.16,-61.37,6.1,-63.97,6.01,-66.59,5.89,-43.08,6.38,-46.79,6.33,-50.13,6.28,-53.13,6.23,-55.84,6.18,-58.42,6.11,-61.01,6.01,-63.6,5.9,-66.21,5.79,-42.78,6.36,-46.49,6.29,-49.8,6.22,-52.78,6.14,-55.49,6.08,-58.07,6.02,-60.65,5.93,-63.24,5.83,-65.83,5.74,-42.5,6.32,-46.2,6.23,-49.49,6.13,-52.44,6.05,-55.14,5.98,-57.72,5.92,-60.3,5.86,-62.88,5.79,-65.46,5.72,-42.23,6.23,-45.92,6.13,-49.18,6.04,-52.1,5.96,-54.77,5.9,-57.36,5.85,-59.94,5.8,-62.52,5.76,-65.09,5.72,-42.14,6.15,-45.76,6.07,-48.95,6,-51.81,5.93,-54.45,5.88,-56.88,5.84,-59.32,5.81,-61.77,5.79,-64.24,5.75,-41.94,6.12,-45.46,6.05,-48.53,5.99,-51.28,5.94,-53.85,5.9,-56.24,5.86,-58.64,5.84,-61.06,5.82,-63.53,5.78,-41.67,6.1,-45.04,6.05,-47.96,6.01,-50.56,5.98,-53,5.95,-55.44,5.91,-57.9,5.88,-60.4,5.84,-62.96,5.79,-41.36,6.1,-44.54,6.07,-47.26,6.05,-49.66,6.04,-51.93,6.03,-54.52,5.98,-57.13,5.93,-59.8,5.87,-62.54,5.8]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_01","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-2.98,0.21,-5.56,0.16,-8.15,0.11,-10.73,0.06,-13.31,0.01,-15.9,-0.04,-18.48,-0.09,-21.06,-0.15,-23.65,-0.2,-2.62,0.2,-5.2,0.15,-7.78,0.1,-10.36,0.05,-12.95,0,-15.53,-0.05,-18.11,-0.1,-20.7,-0.15,-23.28,-0.2,-2.25,0.2,-4.83,0.15,-7.41,0.1,-10,0.05,-12.58,0,-15.16,-0.05,-17.75,-0.1,-20.33,-0.15,-22.91,-0.2,-1.88,0.2,-4.47,0.15,-7.05,0.1,-9.63,0.05,-12.21,0,-14.8,-0.05,-17.38,-0.1,-19.96,-0.15,-22.55,-0.2,-1.52,0.2,-4.1,0.15,-6.68,0.1,-9.26,0.05,-11.85,0,-14.43,-0.05,-17.01,-0.1,-19.6,-0.15,-22.18,-0.2,-1.15,0.2,-3.73,0.15,-6.32,0.1,-8.9,0.05,-11.48,0,-14.06,-0.05,-16.65,-0.1,-19.23,-0.15,-21.81,-0.2,-0.78,0.2,-3.37,0.15,-5.95,0.1,-8.53,0.05,-11.11,0,-13.7,-0.05,-16.28,-0.1,-18.86,-0.15,-21.45,-0.2,-0.42,0.2,-3,0.15,-5.58,0.1,-8.17,0.05,-10.75,0,-13.33,-0.05,-15.91,-0.1,-18.5,-0.15,-21.08,-0.2,-0.05,0.2,-2.63,0.15,-5.22,0.09,-7.8,0.04,-10.38,-0.01,-12.96,-0.06,-15.55,-0.11,-18.13,-0.16,-20.71,-0.21]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_03","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-17.31,-2.66,-16.3,-3.22,-15.15,-3.78,-13.92,-4.36,-12.64,-4.97,-11.64,-5.65,-11.22,-6.33,-11.14,-7.01,-11.17,-7.67,-14.38,-2.78,-12.69,-3.37,-10.89,-3.96,-9.11,-4.56,-7.52,-5.19,-6.78,-5.84,-6.73,-6.49,-7.06,-7.13,-7.49,-7.76,-11.47,-2.9,-9.07,-3.52,-6.57,-4.13,-4.22,-4.74,-2.26,-5.38,-1.78,-6.01,-2.05,-6.64,-2.75,-7.27,-3.55,-7.87,-8.51,-2.97,-5.58,-3.61,-2.56,-4.24,0.19,-4.87,2.32,-5.5,2.76,-6.12,2.33,-6.74,1.43,-7.35,0.43,-7.93,-5.44,-2.93,-2.37,-3.59,0.76,-4.25,3.51,-4.9,5.45,-5.53,6.2,-6.14,5.95,-6.72,5.15,-7.29,4.26,-7.86,-3.42,-2.99,-0.58,-3.6,2.32,-4.23,4.94,-4.87,6.95,-5.5,7.6,-6.09,7.51,-6.66,6.99,-7.23,6.36,-7.79,-1.34,-3.02,1.02,-3.57,3.44,-4.14,5.7,-4.72,7.55,-5.32,8.38,-5.92,8.69,-6.53,8.68,-7.14,8.54,-7.72,0.78,-3.05,2.55,-3.53,4.4,-4.01,6.19,-4.52,7.78,-5.08,8.89,-5.7,9.72,-6.37,10.32,-7.03,10.78,-7.65,2.91,-3.09,4.14,-3.48,5.44,-3.88,6.79,-4.32,8.14,-4.84,9.51,-5.49,10.82,-6.2,12.02,-6.92,13.06,-7.57]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_04","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-29.22,-2.23,-26.6,-3.42,-23.92,-4.53,-21.25,-5.75,-18.71,-7.26,-16.49,-7.62,-14.86,-8.13,-13.71,-8.71,-12.91,-9.25,-24.22,-4.19,-21.15,-5.26,-18.01,-6.22,-14.97,-7.26,-12.17,-8.54,-10.4,-8.78,-9.55,-9.02,-9.31,-9.28,-9.4,-9.58,-19.07,-6.36,-15.58,-7.27,-12.04,-8.03,-8.66,-8.83,-5.63,-9.86,-4.31,-9.98,-4.19,-9.96,-4.84,-9.94,-5.78,-10.01,-14.08,-7.97,-10.3,-8.76,-6.49,-9.4,-2.9,-10.04,0.21,-10.84,1.31,-10.86,0.86,-10.65,-0.49,-10.38,-2.11,-10.25,-9.55,-8.3,-5.71,-9.05,-1.87,-9.77,1.69,-10.46,4.68,-11.11,5.97,-11.09,5.31,-10.74,3.55,-10.3,1.55,-10.01,-8.3,-8.22,-4.89,-8.88,-1.51,-9.55,1.67,-10.19,4.51,-10.76,5.52,-10.74,4.94,-10.41,3.42,-10.01,1.61,-9.8,-7.77,-8.05,-4.92,-8.57,-2.16,-9.1,0.51,-9.61,3.06,-10.05,4.27,-10.1,4.17,-9.92,3.25,-9.7,1.96,-9.62,-7.48,-7.85,-5.29,-8.21,-3.23,-8.56,-1.18,-8.88,0.99,-9.18,2.63,-9.32,3.23,-9.35,3.1,-9.36,2.53,-9.44,-6.94,-7.69,-5.47,-7.89,-4.17,-8.04,-2.78,-8.18,-1.05,-8.32,1.04,-8.55,2.37,-8.78,3.07,-9,3.24,-9.24]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02","timeline":[{"name":"B_HAIR_TWIN.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_00","timeline":[{"name":"B_HAIR_TWIN.02","type":50,"frame":[{"duration":121,"offset":20,"value":[-1.03,-0.19,-2.06,-0.6,-3.08,-1.01,-4.11,-1.19,-4.23,-1.25,-5.44,-1.41,-7.09,-1.68,-8.53,-2.05,0,0,-0.82,-0.15,-1.64,-0.48,-2.47,-0.81,-3.29,-0.96,-4.62,-1.26,-8.11,-2.03,-12.47,-3,-16.41,-3.94,-0.23,-0.05,-0.2,-0.02,-0.18,-0.01,-0.16,0,-0.17,0,-2.38,-0.48,-6.98,-1.64,-12.55,-3.04,-17.63,-4.23,-2.63,-0.63,-2.44,-0.44,-2.22,-0.24,-2.05,-0.07,-1.97,0,-2.77,-0.24,-4.69,-0.83,-7.06,-1.56,-9.21,-2.21,-5.04,-1.21,-4.67,-0.86,-4.26,-0.47,-3.93,-0.14,-3.78,0,-3.2,0,-2.43,-0.02,-1.59,-0.08,-0.79,-0.19,-4.69,-1.13,-4.35,-0.82,-3.98,-0.44,-3.67,-0.13,-3.52,0,-3.06,0,-2.13,0,-1.02,0,0,0,-2.44,-0.59,-2.26,-0.43,-2.07,-0.23,-1.91,-0.07,-1.83,0,-1.58,0,-1.1,0,-0.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_01","timeline":[{"name":"B_HAIR_TWIN.02","type":50,"frame":[{"duration":121,"offset":20,"value":[-1.03,-0.19,-2.06,-0.6,-3.08,-1.01,-4.11,-1.19,-4.23,-1.25,-5.44,-1.41,-7.09,-1.68,-8.53,-2.05,0,0,-0.82,-0.15,-1.64,-0.48,-2.47,-0.81,-3.29,-0.96,-4.62,-1.26,-8.11,-2.03,-12.47,-3,-16.41,-3.94,-0.23,-0.05,-0.2,-0.02,-0.18,-0.01,-0.16,0,-0.17,0,-2.38,-0.48,-6.98,-1.64,-12.55,-3.04,-17.63,-4.23,-2.63,-0.63,-2.44,-0.44,-2.22,-0.24,-2.05,-0.07,-1.97,0,-2.77,-0.24,-4.69,-0.83,-7.06,-1.56,-9.21,-2.21,-5.04,-1.21,-4.67,-0.86,-4.26,-0.47,-3.93,-0.14,-3.78,0,-3.2,0,-2.43,-0.02,-1.59,-0.08,-0.79,-0.19,-4.69,-1.13,-4.35,-0.82,-3.98,-0.44,-3.67,-0.13,-3.52,0,-3.06,0,-2.13,0,-1.02,0,0,0,-2.44,-0.59,-2.26,-0.43,-2.07,-0.23,-1.91,-0.07,-1.83,0,-1.58,0,-1.1,0,-0.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09","timeline":[{"name":"B_HAIR_TWIN.09_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.09_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.09_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.09_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.09_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_00"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10","timeline":[{"name":"B_HAIR_TWIN.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.10_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.10_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_00","timeline":[{"name":"B_HAIR_TWIN.10","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,11.31,-0.26,12.17,0.16,12.87,0.49,13.16,0.63,10.71,0.56,4.77,0.39,-2.57,0.19,-9.21,0,1.39,-0.34,1.82,-0.12,2.3,0.1,2.68,0.27,2.8,0.34,-3.61,0.3,-10.88,0.22,-16.9,0.11,-19.57,0,-7.05,-0.07,-6.95,0,-6.83,0.04,-6.74,0.06,-6.77,0.07,-17.15,0.07,-25.74,0.05,-30.43,0.03,-29.14,0,-9.21,0,-8.33,-0.04,-7.45,-0.14,-6.57,-0.24,-5.68,-0.29,-17.32,-0.24,-26.59,-0.14,-31.69,-0.04,-30.79,0,-9.21,0,-8.4,-0.13,-7.59,-0.41,-6.77,-0.7,-5.96,-0.83,-9.97,-0.7,-14.85,-0.41,-19.39,-0.13,-22.37,0,-9.21,0,-9.38,-0.07,-9.55,-0.22,-9.72,-0.37,-9.89,-0.44,-5.09,-0.37,-4.56,-0.22,-7.71,-0.07,-13.95,0,-7.48,0.07,-7.64,0.04,-7.82,0.01,-7.95,0,-7.92,0,-2.72,0,-2.7,0,-6.93,0,-14.46,0,-0.73,0.34,-1.38,0.23,-2.1,0.12,-2.67,0.03,-2.85,0,-1.65,0,-5.22,0,-11.77,0,-19.52,0,6.58,0.63,5.41,0.44,4.11,0.24,3.06,0.07,2.63,0,-0.39,0,-7.73,0,-16.8,0,-25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_01","timeline":[{"name":"B_HAIR_TWIN.10","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,11.31,-0.26,12.17,0.16,12.87,0.49,13.16,0.63,10.71,0.56,4.77,0.39,-2.57,0.19,-9.21,0,1.39,-0.34,1.82,-0.12,2.3,0.1,2.68,0.27,2.8,0.34,-3.61,0.3,-10.88,0.22,-16.9,0.11,-19.57,0,-7.05,-0.07,-6.95,0,-6.83,0.04,-6.74,0.06,-6.77,0.07,-17.15,0.07,-25.74,0.05,-30.43,0.03,-29.14,0,-9.21,0,-8.33,-0.04,-7.45,-0.14,-6.57,-0.24,-5.68,-0.29,-17.32,-0.24,-26.59,-0.14,-31.69,-0.04,-30.79,0,-9.21,0,-8.4,-0.13,-7.59,-0.41,-6.77,-0.7,-5.96,-0.83,-9.97,-0.7,-14.85,-0.41,-19.39,-0.13,-22.37,0,-9.21,0,-9.38,-0.07,-9.55,-0.22,-9.72,-0.37,-9.89,-0.44,-5.09,-0.37,-4.56,-0.22,-7.71,-0.07,-13.95,0,-7.48,0.07,-7.64,0.04,-7.82,0.01,-7.95,0,-7.92,0,-2.72,0,-2.7,0,-6.93,0,-14.46,0,-0.73,0.34,-1.38,0.23,-2.1,0.12,-2.67,0.03,-2.85,0,-1.65,0,-5.22,0,-11.77,0,-19.52,0,6.58,0.63,5.41,0.44,4.11,0.24,3.06,0.07,2.63,0,-0.39,0,-7.73,0,-16.8,0,-25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11","timeline":[{"name":"B_HAIR_TWIN.11_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.11_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.11_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.11_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.11_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_00","timeline":[{"name":"B_HAIR_TWIN.11","type":50,"frame":[{"duration":121,"offset":10,"value":[-2.45,-0.07,-8.39,-0.24,-15.73,-0.44,-22.37,-0.63,0,0,0,0,0,0,0,0,0,0,-7,-0.17,-15.54,-0.59,-23.89,-1.09,-30.29,-1.51,0,0,0,0,0,0,0,0,0,0,-11.33,-0.27,-22.31,-0.91,-31.53,-1.67,-37.61,-2.32,0,0,0,0,0,0,0,0,0,0,-12.56,-0.28,-23.72,-0.94,-32.47,-1.74,-37.78,-2.42,0,0,0,0,0,0,0,0,0,0,-6.79,-0.14,-12.74,-0.47,-17.26,-0.89,-19.74,-1.26,0,0,0,0,0,0,0,0,0,0,-0.9,0,-1.59,-0.01,-1.9,-0.05,-1.7,-0.11]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_01","timeline":[{"name":"B_HAIR_TWIN.11","type":50,"frame":[{"duration":121,"offset":10,"value":[-2.45,-0.07,-8.39,-0.24,-15.73,-0.44,-22.37,-0.63,0,0,0,0,0,0,0,0,0,0,-7,-0.17,-15.54,-0.59,-23.89,-1.09,-30.29,-1.51,0,0,0,0,0,0,0,0,0,0,-11.33,-0.27,-22.31,-0.91,-31.53,-1.67,-37.61,-2.32,0,0,0,0,0,0,0,0,0,0,-12.56,-0.28,-23.72,-0.94,-32.47,-1.74,-37.78,-2.42,0,0,0,0,0,0,0,0,0,0,-6.79,-0.14,-12.74,-0.47,-17.26,-0.89,-19.74,-1.26,0,0,0,0,0,0,0,0,0,0,-0.9,0,-1.59,-0.01,-1.9,-0.05,-1.7,-0.11]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12","timeline":[{"name":"B_HAIR_TWIN.12_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.12_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.12_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.12_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.12_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_00"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13","timeline":[{"name":"B_HAIR_TWIN.13_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.13_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.13_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.13_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.13_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_00","timeline":[{"name":"B_HAIR_TWIN.13","type":50,"frame":[{"duration":121,"offset":20,"value":[1.23,-0.08,2.57,-0.18,3.69,-0.26,4.26,-0.29,1.37,-0.33,-4.06,-0.41,-10.51,-0.51,-16.45,-0.59,0,0,2.38,-0.16,4.97,-0.34,7.13,-0.5,8.2,-0.56,2.69,-0.63,-7.76,-0.79,-20.2,-0.97,-31.65,-1.13,0,0,2.58,-0.17,5.42,-0.37,7.75,-0.54,8.82,-0.6,3.25,-0.67,-8.2,-0.84,-21.98,-1.04,-34.6,-1.21,0,0,1.37,-0.09,2.88,-0.2,4.1,-0.28,4.61,-0.32,0.66,-0.35,-6.62,-0.44,-15.24,-0.54,-23.2,-0.63,0,0,0.15,-0.02,0.34,-0.02,0.46,-0.03,0.4,-0.03,-0.34,-0.03,-1.95,-0.03,-3.9,-0.04,-5.68,-0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_01","timeline":[{"name":"B_HAIR_TWIN.13","type":50,"frame":[{"duration":121,"offset":20,"value":[1.23,-0.08,2.57,-0.18,3.69,-0.26,4.26,-0.29,1.37,-0.33,-4.06,-0.41,-10.51,-0.51,-16.45,-0.59,0,0,2.38,-0.16,4.97,-0.34,7.13,-0.5,8.2,-0.56,2.69,-0.63,-7.76,-0.79,-20.2,-0.97,-31.65,-1.13,0,0,2.58,-0.17,5.42,-0.37,7.75,-0.54,8.82,-0.6,3.25,-0.67,-8.2,-0.84,-21.98,-1.04,-34.6,-1.21,0,0,1.37,-0.09,2.88,-0.2,4.1,-0.28,4.61,-0.32,0.66,-0.35,-6.62,-0.44,-15.24,-0.54,-23.2,-0.63,0,0,0.15,-0.02,0.34,-0.02,0.46,-0.03,0.4,-0.03,-0.34,-0.03,-1.95,-0.03,-3.9,-0.04,-5.68,-0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14","timeline":[{"name":"B_HAIR_TWIN.14_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.14_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.14_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.14_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.14_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_00","timeline":[{"name":"B_HAIR_TWIN.14","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,3.89,-0.63,-3.45,-0.63,-9.4,-0.63,-11.84,-0.63,-13.86,-0.7,-18.75,-0.87,-24.8,-1.08,-30.27,-1.26,10.53,-0.63,4.39,-0.61,-2.23,-0.57,-7.9,-0.53,-11.18,-0.51,-16.4,-0.28,-23.97,0.22,-32.49,0.7,-40.53,0.87,10.53,-0.63,6.98,-0.63,3.11,-0.61,-0.11,-0.6,-1.73,-0.59,-6.1,-0.41,-12.87,-0.02,-20.6,0.37,-27.85,0.53,10.53,-0.63,8.69,-0.63,6.66,-0.63,5,-0.63,4.23,-0.63,2.33,-0.63,-2.18,-0.64,-7.73,-0.64,-12.76,-0.66,10.53,-0.63,9.55,-0.63,8.47,-0.63,7.6,-0.63,7.24,-0.63,5.51,-0.67,1.32,-0.75,-3.87,-0.85,-8.55,-0.95,10.53,-0.63,10.42,-0.63,10.28,-0.63,10.2,-0.63,10.25,-0.63,8.69,-0.7,4.81,-0.87,0,-1.06,-4.34,-1.24,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,8.79,-0.7,5.4,-0.86,1.35,-1.04,-2.36,-1.19,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,9.6,-0.67,7.85,-0.75,5.75,-0.85,3.83,-0.92,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_01","timeline":[{"name":"B_HAIR_TWIN.14","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,3.89,-0.63,-3.45,-0.63,-9.4,-0.63,-11.84,-0.63,-13.86,-0.7,-18.75,-0.87,-24.8,-1.08,-30.27,-1.26,10.53,-0.63,4.39,-0.61,-2.23,-0.57,-7.9,-0.53,-11.18,-0.51,-16.4,-0.28,-23.97,0.22,-32.49,0.7,-40.53,0.87,10.53,-0.63,6.98,-0.63,3.11,-0.61,-0.11,-0.6,-1.73,-0.59,-6.1,-0.41,-12.87,-0.02,-20.6,0.37,-27.85,0.53,10.53,-0.63,8.69,-0.63,6.66,-0.63,5,-0.63,4.23,-0.63,2.33,-0.63,-2.18,-0.64,-7.73,-0.64,-12.76,-0.66,10.53,-0.63,9.55,-0.63,8.47,-0.63,7.6,-0.63,7.24,-0.63,5.51,-0.67,1.32,-0.75,-3.87,-0.85,-8.55,-0.95,10.53,-0.63,10.42,-0.63,10.28,-0.63,10.2,-0.63,10.25,-0.63,8.69,-0.7,4.81,-0.87,0,-1.06,-4.34,-1.24,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,8.79,-0.7,5.4,-0.86,1.35,-1.04,-2.36,-1.19,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,9.6,-0.67,7.85,-0.75,5.75,-0.85,3.83,-0.92,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01","timeline":[{"name":"D_HAIR_TWIN.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_00","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":550}]},{"name":"D_HAIR_TWIN.01","type":22,"frame":[{"duration":121,"value":[82.47,-8.71,18.8,-7.24,-17.76,-0.07,-43.52,0,27.66,1.51,51.4,1.5,18.69,0.09,10.7,0.86,34.75,0.78,-11.72,0.04,-1.02,0,-29.95,-0.04,47.64,-3.91,31.35,-4.3,45.12,-7.85,1.03,-3.75]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_01","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_02","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_03","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]},{"name":"D_HAIR_TWIN.01","type":22,"frame":[{"duration":121,"value":[-77.6,13.12,-161.4,-30.15,1.86,-5.77,12.57,-4.81,-6.13,5.71,30.68,9.4,11.96,-3.09,22.91,3.31,21.15,3.04,12.26,-3.93,6.5,-4.54,6.93,-5.32,-18.55,-1.94,-46.43,-17.13,-134.12,-14.54,-89.02,-30.45]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_04","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]},{"name":"D_HAIR_TWIN.01","type":22,"frame":[{"duration":121,"value":[-57.19,6.66,-116.21,-24.58,-15.93,-34.98,9.22,-7.28,-2.8,9.22,75.94,16.52,25.87,1.58,47.34,6.32,49.47,4.97,16.73,-6.72,-5.17,-17.16,8.93,-18.22,-3.91,-5.47,-40.61,-15.06,-111.97,-6.41,-79.83,-33.74]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00","timeline":[{"name":"D_HAIR_TWIN.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_00"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04","timeline":[{"name":"D_HAIR_TWIN.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_00","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":410}]},{"name":"D_HAIR_TWIN.04","type":22,"frame":[{"duration":121,"offset":14,"value":[-6.84,-3.25,-11.01,-7.53,2.49,-6.91,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.96,-4.15]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_01","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":410}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_02","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_03","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":510}]},{"name":"D_HAIR_TWIN.04","type":22,"frame":[{"duration":121,"value":[-7.61,-0.32,-7.59,-0.32,-8.26,-0.3,-8.29,-0.32,-8.71,-0.35,-9.63,-0.34,-9.69,-0.34,-9.49,-0.4,-9.38,-0.55,-9.38,-0.51,-9.14,-0.56,-9.38,-0.51,-9.29,-0.39,-9.11,-0.37,-8.95,-0.39,-8.73,-0.35,2,-2.22,-8.1,-0.33,-6.99,-0.27,-9.51,-0.41,-9.24,-0.39,-8.77,-0.35,-9.44,-0.44,-8.66,-0.35,-2.96,-2.21,-9.12,-0.38,-9.51,-0.41,-9.44,-0.41,-9.38,-0.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_04","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":510}]},{"name":"D_HAIR_TWIN.04","type":22,"frame":[{"duration":121,"value":[-15.22,-0.65,-15.19,-0.63,-16.52,-0.6,-16.58,-0.64,-17.43,-0.7,-19.25,-0.68,-19.37,-0.67,-18.98,-0.79,-18.76,-1.11,-18.75,-1.02,-18.28,-1.13,-18.75,-1.02,-18.59,-0.78,-18.22,-0.75,-17.9,-0.77,-17.47,-0.7,3.99,-4.44,-16.19,-0.66,-13.98,-0.54,-19.03,-0.81,-18.48,-0.78,-17.54,-0.71,-18.87,-0.89,-17.31,-0.69,-5.92,-4.42,-18.24,-0.75,-19.03,-0.81,-18.89,-0.82,-18.75,-1.02]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05","timeline":[{"name":"D_HAIR_TWIN.05_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.05_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.05_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.05_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.05_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_00"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06","timeline":[{"name":"D_HAIR_TWIN.06_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.06_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.06_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.06_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.06_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_00","timeline":[{"name":"D_HAIR_TWIN.06","type":22,"frame":[{"duration":121,"value":[5.49,-0.01,-12.53,0.16,16.63,1.79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-9.17,1.69,-9.33,3.04,-19.17,1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_03","timeline":[{"name":"D_HAIR_TWIN.06","type":22,"frame":[{"duration":121,"value":[2.55,-0.02,8.9,0.59,4.9,0.27,2.93,-0.07,3.02,-0.08,4.17,-0.13,3.55,-0.11,2.16,-0.06,0.85,-0.02,0.54,-0.01,1,-0.02,6.76,0.32,1.7,-0.31,1.61,-0.02,1.75,-0.02,2.69,-0.07,1.82,-0.04,1.9,-0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_04","timeline":[{"name":"D_HAIR_TWIN.06","type":22,"frame":[{"duration":121,"value":[5.11,-0.05,21.46,1.04,9.8,0.55,5.85,-0.14,6.04,-0.16,8.35,-0.26,7.1,-0.23,4.32,-0.12,1.71,-0.04,1.08,-0.02,1.99,-0.05,13.52,0.63,3.39,-0.62,3.23,-0.03,3.5,-0.03,5.38,-0.14,3.64,-0.09,3.8,-0.09]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07","timeline":[{"name":"D_HAIR_TWIN.07_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.07_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.07_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.07_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.07_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_00","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":410}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_01","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":410}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_02","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_03","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_04","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08","timeline":[{"name":"D_HAIR_TWIN.08_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.08_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.08_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.08_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.08_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_00","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":420}]},{"name":"D_HAIR_TWIN.08","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":8,"value":[4.16,10.38,0,0,0,0,-4.12,5.73,-8.71,-4.16,-11.92,-13.56,1.17,-7.73,-1.93,-7.03,1.61,8.17,0,0,-33.93,-0.02,-17.41,0.63,-15,0.07,0,0,2.31,10.1,-5.42,9.7,0,0,-17.05,0.65,0,0,-8.9,5.12,0,0,0,0,-7.68,0.77,-0.64,15.18]},{"duration":60,"tweenEasing":0,"value":[-63.33,2.35,-42.66,2.56,0,0,0,0,4.16,10.38,0,0,0,0,-4.12,5.73,-8.71,-4.16,-11.92,-13.56,1.17,-7.73,-1.93,-7.03,1.61,8.17,0,0,-33.93,-0.02,-17.41,0.63,-15,0.07,-12.46,7.83,2.31,10.1,-5.42,9.7,-21.08,0.62,-17.05,0.65,0,0,-8.9,5.12,-18.15,0.66,0,0,-7.68,0.77,-0.64,15.18]},{"offset":8,"value":[4.16,10.38,0,0,0,0,-4.12,5.73,-8.71,-4.16,-11.92,-13.56,1.17,-7.73,-1.93,-7.03,1.61,8.17,0,0,-33.93,-0.02,-17.41,0.63,-15,0.07,0,0,2.31,10.1,-5.42,9.7,0,0,-17.05,0.65,0,0,-8.9,5.12,0,0,0,0,-7.68,0.77,-0.64,15.18]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_01","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":420}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_02","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":520}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_03","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":520}]},{"name":"D_HAIR_TWIN.08","type":22,"frame":[{"duration":121,"value":[1.75,-0.37,5.19,-0.11,1.26,0.29,0,0,0,0,0,0,0,0,-4.17,3.1,0,0,-10.09,-7.32,-1.16,-4.77,-3.88,-1.49,0,0,0,0,0,0,0,0,3.12,-0.05,4.37,-0.07,0,0,0,0,5.24,-0.11,1.73,-0.04,0,0,-5.9,1.33,5.19,-0.11,0,0,0,0,0.79,0.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_04","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":520}]},{"name":"D_HAIR_TWIN.08","type":22,"frame":[{"duration":121,"value":[3.51,-0.75,10.38,-0.21,2.52,0.59,0,0,0,0,0,0,0,0,-8.34,6.19,0,0,-20.17,-14.65,-2.32,-9.54,-7.77,-2.98,0,0,0,0,0,0,0,0,6.24,-0.1,8.75,-0.14,0,0,0,0,10.48,-0.23,3.46,-0.07,0,0,-11.8,2.66,10.38,-0.21,0,0,0,0,1.58,1.43]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09","timeline":[{"name":"D_HAIR_TWIN.09_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.09_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.09_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.09_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.09_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_00","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-100.44,19.26,-82.41,12.98,-79.78,1.24,-47.01,3.73,-25.38,0.58,-21.12,0.69,-27.48,0.77,-20.83,0.68,-20.96,0.93,-20.87,0.68,-34.12,0.47,-26.39,0.91,-18.35,1.05,-16.02,3.06,-30.94,1.5,-43.96,15.64,-70.94,24.23,-33.58,1.74,-20.61,0.78,-26.53,2.25,-44.1,11.26,-70.39,18.13,-36.18,0.78,-85.48,20.64,-57.06,11.3,-36.53,2.55,-24.59,0.19,-23.42,0.72,-33.79,-0.01,-32.18,2.27,-20.84,0.68]},{"duration":60,"tweenEasing":0,"value":[-100.44,19.26,-82.41,12.98,-79.78,1.24,-47.01,3.73,-25.38,0.58,-21.12,0.69,-27.48,0.77,-20.83,0.68,-20.96,0.93,-20.87,0.68,-34.12,0.47,-26.39,0.91,-18.35,1.05,-16.02,3.06,-30.94,1.5,-43.96,15.64,-62.12,19,-33.58,1.74,-20.61,0.78,-26.53,2.25,-44.1,11.26,-69.61,13.75,-36.18,0.78,-85.48,20.64,-57.06,11.3,-36.53,2.55,-24.59,0.19,-23.42,0.72,-33.79,-0.01,-32.18,2.27,-20.84,0.68]},{"value":[-100.44,19.26,-82.41,12.98,-79.78,1.24,-47.01,3.73,-25.38,0.58,-21.12,0.69,-27.48,0.77,-20.83,0.68,-20.96,0.93,-20.87,0.68,-34.12,0.47,-26.39,0.91,-18.35,1.05,-16.02,3.06,-30.94,1.5,-43.96,15.64,-70.94,24.23,-33.58,1.74,-20.61,0.78,-26.53,2.25,-44.1,11.26,-70.39,18.13,-36.18,0.78,-85.48,20.64,-57.06,11.3,-36.53,2.55,-24.59,0.19,-23.42,0.72,-33.79,-0.01,-32.18,2.27,-20.84,0.68]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_01","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":61},{"duration":60,"tweenEasing":0,"value":[-10.2,1.79,-21.6,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.33,-3.38,0,0,-6.26,0.59]},{"offset":61}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_02","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":530}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_03","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":121,"value":[-1.93,-0.1,-0.26,-0.5,-5.82,-2.15,4.83,0.16,6.78,0.75,10.22,1.21,13.14,1.29,16.84,0.67,33.72,-2.57,27.42,1.98,19.48,5.54,3.15,3.04,9.17,1.59,7.64,3.37,4.89,2.41,2.94,1.47,-5.02,1.03,6.18,1.39,6.32,1.8,3.97,1.35,1.53,0.77,-0.81,0.28,13.31,3.87,-1.84,0.08,0.32,0.51,2.78,1.09,5.03,1.66,7.44,2.01,7.78,0.89,23.61,3.49,24.4,0.96]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_04","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":121,"value":[-3.87,-0.2,-0.53,-1,-11.65,-4.29,9.67,0.32,13.55,1.5,20.44,2.41,26.27,2.58,33.68,1.34,67.45,-5.14,54.84,3.97,38.97,11.09,6.3,6.07,18.34,3.17,15.28,6.75,9.78,4.81,5.87,2.94,-10.05,2.05,12.37,2.78,12.63,3.59,7.94,2.7,3.05,1.53,-1.63,0.55,26.61,7.73,-3.67,0.16,0.64,1.02,5.56,2.18,10.07,3.32,14.88,4.01,15.56,1.78,47.22,6.98,48.79,1.92]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10","timeline":[{"name":"D_HAIR_TWIN.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.10_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.10_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_00","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-23.32,3.55,-45.66,5.37,-45.67,5.45,-52.61,6.34,-21.26,2.07,-4.51,8.76,-27.17,5.47,-23.33,4.21,-45.57,5.66,-46.69,6.05,-27.59,7.47]},{"duration":60,"tweenEasing":0,"value":[-23.32,3.55,-79.04,5.12,-85.4,6.46,-52.61,6.34,-21.26,2.07,-4.51,8.76,-27.17,5.47,-23.33,4.21,-45.57,5.66,-46.69,6.05,-27.59,7.47]},{"value":[-23.32,3.55,-45.66,5.37,-45.67,5.45,-52.61,6.34,-21.26,2.07,-4.51,8.76,-27.17,5.47,-23.33,4.21,-45.57,5.66,-46.69,6.05,-27.59,7.47]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_01","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":21},{"duration":60,"tweenEasing":0,"offset":2,"value":[-17.77,0.57,-6.06,2.04]},{"offset":21}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_02","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":530}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_03","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":121,"value":[-1.74,-2.49,-8.78,-6.35,20.52,1.16,-0.8,-0.7,-0.13,4.15,0.98,4.85,-0.26,0.22,-4.83,-4.02,-10.24,-2.78,-6.03,-2.19,2.68,1.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_04","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":121,"value":[-3.47,-4.99,-17.57,-12.71,41.03,2.32,-1.6,-1.39,-0.26,8.31,1.96,9.7,-0.53,0.43,-9.67,-8.03,-20.48,-5.57,-12.05,-4.38,5.36,3.05]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02","timeline":[{"name":"B_HAIR_BACK.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_BACK.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_BACK.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_BACK.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_BACK.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_00","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-58.64,49.98,-30.47,13.5,-3.07,-22.09,14.39,-38.98,23.95,-17.69,27.19,2.46,22.86,2.52,13.16,-3.17,2.67,-9.33,-27.68,35.92,-16.76,-0.99,-8.53,-33.09,-5.83,-53.38,-5.38,-41.68,1.79,-16.16,6.7,-7.44,8.72,-5.19,9.3,-3.3,1.07,27.92,-4.05,-11.2,-13.45,-44.2,-24.83,-67.76,-33.18,-65.1,-21.98,-33.88,-8.21,-16.8,4.34,-7.87,15.43,1.41,10.73,26.93,0.21,-14.01,-12.47,-49.32,-29.08,-74.4,-40.83,-75.04,-27.06,-40.41,-10.28,-20.76,3.56,-11.79,17.06,-2.13,13.66,41.25,7.39,4.96,0.3,-27.54,-8.75,-49.02,-14.13,-50.57,-4.46,-29.91,5.4,-17.16,11.34,-10.52,17.08,-3.59,14.34,64.85,12.53,31.26,11.23,-0.8,9.89,-20.57,11.11,-23.87,16.98,-18.01,19.74,-12.79,17.01,-9.44,14.58,-5.89,12.38,92.14,10.99,58.64,9.75,25.82,9.99,6.4,13.28,-0.05,17.52,-5.74,17.91,-6.27,13.67,-5.98,9.7,-5.6,13.3,117.65,12.13,85.04,11.14,53.07,10.69,34.16,12.19,21.91,14.16,4.25,14.18,-1.37,11.48,-3.16,8.94,-5.06,14.67,142.67,13.34,108.26,11.95,74.42,10.67,55.12,10.67,39.84,10.67,12.74,10.45,3.05,9.59,-0.65,8.67,-4.67]},{"duration":60,"tweenEasing":0,"value":[-67.31,49.98,-47.47,20.3,-27.76,-9.01,-14.75,-25.67,-8.66,-15,-2.57,-4.34,-2.44,-3.99,-4.15,-6.56,-6,-9.33,-39.12,38.23,-26.9,7.25,-15.7,-22.5,-7.89,-43.53,-4.37,-39.47,-1.17,-20.11,-1.51,-10.88,-3.21,-7.17,-5.07,-3.3,-12.94,32.37,-7.93,-1.88,-4.34,-34.68,-1.55,-61.18,-0.39,-63.46,0.15,-35.23,-0.65,-17.61,-2.35,-8.36,-4.22,1.42,-3.76,31.88,-1.86,-4.76,-0.18,-40.17,0.42,-68.97,1.14,-73.33,1.27,-40.75,0.47,-20.78,-1.51,-11.84,-3.66,-2.2,1.25,45.25,1.79,10.97,2.35,-22.27,3,-46.21,4.73,-49.78,6.67,-30.15,6.49,-17.26,3.25,-11.04,0,-4.33,4.84,66.22,3.94,32.8,3.23,0.19,3.91,-20.36,6.92,-23.96,10.94,-18.14,11.55,-12.9,7.65,-9.82,3.66,-6.47,3.71,92.14,2.32,58.64,1.08,25.81,1.33,6.4,4.62,-0.05,8.85,-5.74,9.24,-6.27,5.01,-5.98,1.03,-5.6,4.63,117.65,3.46,85.04,2.48,53.07,2.02,34.16,3.53,21.9,5.5,4.25,5.51,-1.37,2.81,-3.16,0.27,-5.07,6,142.67,4.68,108.26,3.28,74.42,2,55.11,2,39.83,2,12.74,1.78,3.05,0.93,-0.65,0,-4.67]},{"value":[-155.98,77.31,-118.85,29.47,-81.68,-11.87,-56.35,-26.16,-50.39,-16.71,-44.73,-10.59,-53.83,-15.61,-70.4,-29.95,-87.33,-45.33,-109.97,58.07,-71.7,14.72,-34.29,-23.51,-10.57,-42.38,-6.64,-40.26,-6.67,-25.43,-20.1,-20.2,-42.67,-25.34,-65.33,-30.83,-67.11,45.11,-28.14,4.25,9.63,-33.56,31.3,-58.57,33.56,-63.27,28.27,-39.4,10.84,-24.49,-16.95,-21.14,-44.83,-17.43,-51.16,40.56,-18.49,0.14,12.45,-38.11,29.33,-67.34,31.3,-73.49,24.43,-43.61,7.14,-24.58,-19.81,-18.86,-47.83,-12.68,-32.75,51.75,-15.11,14.25,-1.43,-20.15,7.19,-45.42,9.05,-50.86,6.4,-33.58,-6.07,-20.27,-31.35,-15.92,-57.47,-11.33,-15.75,72.22,-7.07,36.52,-1.28,2.5,2.17,-19.04,6.05,-25.13,9.78,-21.91,2.71,-15.43,-19.62,-13.24,-42.96,-11.11,-13.94,97.48,-6.41,61.26,1.34,25.86,3.99,5.58,7.71,-0.8,12.38,-6.42,7.22,-5.95,-13.01,-7.47,-32.66,-9.17,-6.46,120.42,-2.08,84.53,2.47,49.52,3.49,30.06,5.18,22.14,7.34,8.82,4.25,3.52,-7.65,-1.4,-19.16,-6.92,2,142.67,2.53,104.56,2.84,67.29,2,47.97,2,41.83,2,23.88,1.34,13.74,-1.22,4.9,-4,-4.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_01","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-22.68,80,-6.27,34.94,9.57,-6.71,20.21,-15.74,27.94,-2.69,29.36,9.24,25.3,7.86,17.31,-0.4,8.67,-9.33,-6.24,54.24,-2.52,17.68,-1.3,-13.18,-2.76,-23.09,-3.57,-17.17,2.72,0.8,8.08,5.64,11.4,1.6,13.45,-3.16,8.51,35.42,0.45,5.24,-11.28,-18.49,-24.38,-30.26,-33.58,-31.43,-22.29,-7.38,-7.8,3.75,5.75,3.25,17.87,2.53,12.91,27.03,1.23,1.33,-12.49,-18.44,-29.4,-31.57,-41.37,-36.07,-27.41,-10.59,-10.15,2.48,4.52,3.13,18.8,3.79,17.66,20.25,8.59,3.26,-1.43,-9.81,-11.4,-16.84,-15.54,-19.9,-5.01,-6.01,4.4,1.18,10.34,1.45,16.08,1.41,20.17,19.39,14.46,9.15,9.21,0.53,6.45,-2.08,9.52,-3.42,16.23,-0.55,17.61,0.69,14.06,-0.45,10.83,-1.8,18.76,27.39,14.32,18.34,9.84,9.99,9.1,7.5,13.7,4.12,18.3,0.74,17.54,0.24,13.04,-1.74,8.67,-3.98,13.91,34.99,11.63,27.25,9.29,20.12,8.89,17.51,11.31,9.67,13.73,1.82,13.32,0.15,10.93,-4.26,8.67,-9.11,8.67,42.67,8.67,36.19,8.67,30.2,8.67,27.52,8.67,15.34,8.67,3.15,8.67,0.18,8.67,-6.95,8.67,-14.67]},{"duration":60,"tweenEasing":0,"value":[-31.34,80,-23.27,41.74,-15.12,6.38,-8.93,-2.44,-4.67,0,-0.4,2.44,0,1.35,0,-3.78,0,-9.33,-17.68,56.55,-12.77,25.81,-8.44,-2.3,-4.8,-13.24,-2.51,-14.98,-0.22,-3.17,-0.11,2.2,-0.52,-0.36,-0.93,-3.16,-5.5,39.87,-3.43,14.56,-2.2,-8.63,-0.98,-23.67,-0.51,-29.81,-0.04,-8.76,-0.21,2.92,-1,2.77,-1.78,2.54,-1.58,31.97,-0.86,10.53,-0.18,-9.31,0.04,-26.15,0.45,-34.34,0.86,-10.92,0.6,2.46,-0.57,3.08,-1.91,3.71,5.25,24.25,2.99,9.24,0.63,-4.49,0.27,-14.03,3.17,-19.1,6.06,-6.25,5.49,1.1,2.25,0.91,-1,0.67,10.67,20.75,5.87,10.68,1.21,1.53,0.46,-1.86,5.32,-3.5,10.19,-0.68,9.42,0.59,4.71,-0.84,-0.09,-2.38,10.09,27.39,5.65,18.33,1.18,9.99,0.43,7.5,5.03,4.11,9.63,0.73,8.87,0.24,4.37,-1.75,0,-3.98,5.24,34.99,2.96,27.25,0.62,20.12,0.23,17.51,2.64,9.67,5.06,1.82,4.65,0.15,2.26,-4.27,0,-9.11,0,42.67,0,36.19,0,30.2,0,27.52,0,15.33,0,3.15,0,0.18,0,-6.95,0,-14.67]},{"value":[-120.01,107.33,-94.65,50.9,-69.03,3.51,-50.53,-2.92,-46.39,-1.7,-42.56,-3.81,-51.4,-10.27,-66.25,-27.17,-81.33,-45.33,-88.53,76.39,-57.59,33.13,-27.03,-3.41,-7.46,-12.07,-4.74,-15.76,-5.69,-8.48,-18.66,-7.14,-40.05,-18.56,-61.18,-30.69,-59.67,52.61,-23.66,20.64,11.78,-7.6,31.91,-21.05,33.55,-29.62,28.15,-12.93,11.34,-3.93,-15.72,-10.05,-42.4,-16.3,-48.99,40.65,-17.5,15.45,12.45,-7.31,28.94,-24.52,30.56,-34.5,23.99,-13.78,7.27,-1.34,-18.89,-3.95,-46.09,-6.77,-28.75,30.75,-13.79,12.54,-3.16,-2.54,4.45,-13.24,7.44,-20.16,5.77,-9.65,-7.07,-1.88,-32.35,-3.96,-58.47,-6.33,-9.92,26.75,-5.07,14.42,-3.29,3.73,-1.28,-0.55,4.45,-4.66,9.03,-4.44,0.59,-1.92,-22.54,-4.25,-46.7,-7.02,-7.57,32.73,-3.1,20.96,1.43,10.04,3.1,6.68,8.13,3.36,13.15,0.05,6.85,0.57,-13.57,-3.19,-33.69,-7.54,-5.85,37.77,-2.63,26.76,0.6,16.58,1.7,13.41,4.3,9.92,6.9,6.42,3.4,5.03,-8.17,-2.48,-19.43,-10.96,-4,42.67,-2.15,32.48,-0.44,23.07,0,20.38,0,17.33,0,14.29,-0.44,10.86,-2.15,-1.4,-4,-14.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_02","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.67,0,16.99,-6.8,24.69,-13.08,29.14,-13.31,32.61,-2.69,29.76,6.8,25.3,6.51,17.31,3.38,8.67,0,11.44,-2.31,10.25,-8.05,7.1,-11.28,2.05,-9.88,-1.04,-2.26,2.95,3.94,8.18,3.43,11.93,1.96,14.38,0,14.01,-4.45,3.89,-9.19,-9.11,-9.9,-23.34,-6.68,-32.93,-1.84,-22.19,1.28,-7.6,0.83,6.76,0.48,19.65,-0.01,14.49,-4.95,2.08,-9.23,-12.3,-9.1,-29.4,-5.4,-41.73,-1.67,-28.23,0.35,-10.76,0.04,5.1,0.04,20.72,0.07,12.42,-4,5.63,-5.94,-2.09,-5.2,-11.7,-2.81,-18.76,-0.8,-11.09,0.24,-1.09,0.13,8.09,0.51,17.08,0.75,9.5,-1.36,8.6,-1.52,7.99,-0.96,5.98,-0.22,4.17,0.07,6.03,0.13,8.19,0.11,9.35,0.38,10.92,0.58,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-88.67,27.33,-71.38,9.17,-53.92,-2.86,-41.6,-0.49,-41.73,-1.7,-42.16,-6.25,-51.4,-11.63,-66.25,-23.39,-81.33,-36,-70.85,19.84,-44.98,7.63,-18.42,-0.78,-2.67,1.13,-2.25,-0.85,-5.49,-5.34,-18.53,-9.36,-39.55,-18.21,-60.26,-27.53,-54.17,12.74,-20.39,6.32,14.07,1.23,32.87,2.52,34.01,-0.03,28.16,-4.26,11.57,-6.86,-14.77,-12.83,-40.61,-18.84,-47.41,8.68,-16.53,4.9,12.59,1.81,28.89,1.67,30.09,-0.07,23.12,-2.82,6.68,-3.8,-18.34,-7.03,-44.18,-10.48,-34,6.5,-16.81,3.33,-3.8,1.5,4.19,0.85,4.29,-0.98,-0.28,-3.39,-12.55,-3.04,-34.64,-4.85,-57.47,-7,-20.59,6.01,-11.03,3.75,-4.51,2.1,-1.74,1.33,-0.86,-1.15,-1.16,-3.77,-8.83,-2.55,-27.27,-3.39,-46.61,-4.64,-17.66,5.34,-8.76,2.62,0.25,0.04,2.67,-0.81,3.09,-0.75,3.52,-0.69,-2.02,0.28,-18,-1.45,-33.69,-3.56,-11.1,2.78,-5.59,-0.5,-0.02,-3.53,1.47,-4.09,1.65,0.25,1.84,4.59,-1.26,4.88,-10.45,1.77,-19.43,-1.85,-4,0,-2.15,-3.7,-0.44,-7.13,0,-7.14,0,2,0,11.14,-0.44,10.69,-2.15,5.55,-4]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_03","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.67,-12,17.61,-18.8,25.88,-25.08,30.14,-19.69,30.1,-7.22,23.76,-11.78,19.37,-22.47,12.96,-39.86,6.02,-58.67,11.44,-14.31,10.6,-18.69,7.74,-20.62,2.58,-9.12,-2.29,8.72,-0.05,-0.28,5.28,-15.17,9.98,-33.19,13.58,-53.11,14.01,-16.45,3.98,-18.54,-8.96,-16.75,-23.27,0.99,-33.12,24.32,-22.5,11.01,-7.78,-7.69,7.01,-26.98,20.56,-47.99,14.49,-16.95,2.08,-18.11,-12.3,-15.09,-29.44,3.79,-41.83,28.75,-28.28,15.56,-10.63,-3.95,5.8,-24.28,21.95,-46.19,12.42,-16,5.62,-14.54,-2.09,-10.66,-11.72,0.86,-18.81,15.99,-11.12,9.39,-1.09,-3.32,8.1,-21.42,17.1,-41.25,9.5,-13.36,8.59,-9.85,7.99,-5.9,5.97,-2.04,4.15,3.31,6.02,3.25,8.04,-2.72,8.67,-19.18,9.72,-37.16,8.67,-12,9.17,-5.68,9.72,0.16,9.82,1.64,9.26,1.74,8.71,1.85,8.52,-2.69,8,-18.05,7.49,-34.56,8.67,-12,9.7,-2.03,10.71,7.18,10.88,9.26,9.82,6.53,8.76,3.79,8.59,0.21,8.32,-11.32,8.06,-23.73,8.67,-12,10.2,1.58,11.62,14.13,11.84,16.82,10.32,11.34,8.8,5.85,8.66,3.44,8.66,-3.97,8.67,-12]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-12,0.62,-12,1.19,-12,1,-6.39,-2.5,-4.53,-6,-18.58,-5.92,-28.98,-4.35,-43.24,-2.65,-58.67,0,-12,0.35,-10.62,0.64,-9.33,0.53,0.83,-1.25,11.11,-2.99,-4.17,-2.9,-18.55,-1.95,-35.15,-0.8,-53.11,0,-12,0.1,-9.33,0.14,-6.84,0.1,7.79,-0.13,26.43,-0.29,9.85,-0.18,-8.53,0.25,-27.47,0.91,-47.98,0,-12,0,-8.88,0,-6,-0.03,9.15,-0.08,30.34,-0.04,15.18,0.14,-4.01,0.69,-24.32,1.23,-46.27,0,-12,0,-8.61,0,-5.47,-0.02,3.67,-0.05,16.79,-0.03,9.15,-0.01,-3.41,0,-21.94,0.02,-42,0,-12,0,-8.33,0,-4.94,-0.01,-1.82,-0.02,3.25,-0.01,3.13,-0.15,-2.81,-0.68,-19.57,-1.2,-37.74,0,-12,0.5,-5.69,1.05,0.16,1.15,1.63,0.6,1.74,0.04,1.84,-0.14,-2.7,-0.66,-18.05,-1.17,-34.56,0,-12,1.03,-2.04,2.05,7.18,2.21,9.26,1.15,6.52,0.09,3.79,-0.08,0.21,-0.35,-11.32,-0.61,-23.73,0,-12,1.54,1.58,2.96,14.13,3.18,16.82,1.66,11.33,0.13,5.85,-0.01,3.44,0,-3.98,0,-12]},{"value":[-88.67,15.33,-70.77,-2.83,-52.73,-14.86,-40.6,-6.87,-44.23,-6.23,-48.16,-24.83,-57.32,-40.61,-70.6,-66.63,-83.98,-94.67,-70.85,7.84,-44.62,-3,-17.78,-10.12,-2.14,1.9,-3.49,10.13,-8.47,-9.57,-21.44,-27.88,-41.5,-53.35,-61.06,-80.64,-54.17,0.74,-20.27,-3.02,14.19,-5.6,32.97,10.19,33.9,26.12,27.89,5.46,11.38,-15.28,-14.5,-40.28,-39.7,-66.82,-47.41,-3.32,-16.53,-3.98,12.59,-4.2,28.86,10.87,30.01,30.39,23.08,12.41,6.83,-7.8,-17.67,-31.34,-42.94,-56.75,-34,-5.5,-16.8,-5.28,-3.8,-4,4.16,4.56,4.24,15.92,-0.31,5.81,-12.56,-6.42,-34.63,-26.77,-57.46,-49,-20.59,-5.99,-11.03,-4.58,-4.52,-2.86,-1.75,-0.48,-0.88,2.11,-1.17,-0.64,-8.98,-5.34,-27.93,-22.95,-47.82,-42.38,-17.66,-6.66,-8.25,-3.07,1.3,0.18,3.82,0.82,3.69,0.99,3.57,1.16,-2.17,-2.42,-18.72,-19.52,-34.86,-38.13,-11.1,-9.22,-4.56,-2.53,2.03,3.63,3.68,5.16,2.81,6.77,1.93,8.39,-1.34,5.06,-10.82,-9.55,-20.04,-25.58,-4,-12,-0.61,-2.12,2.52,7,3.18,9.68,1.66,13.33,0.13,16.99,-0.45,14.12,-2.15,1.58,-4,-12]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_04","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[4.67,-8,14.54,-18.5,23.66,-28.21,27.13,-19.04,21.6,7.53,8.09,12.85,-7.18,-3.54,-24.75,-36.2,-43.98,-66.67,9.42,-5.29,9.19,-9.88,6.63,-11.94,1.42,5.78,-5.67,34.36,-7.36,29,-8.84,6.06,-11.54,-24.3,-15.91,-54.89,13.48,-2.61,3.84,-1.71,-9.11,2.95,-22.63,29.24,-31.64,60.19,-22.07,44.55,-10.28,16.37,1.14,-13.03,10.88,-43.33,12.58,-0.6,1.15,1.32,-12.34,7.27,-28.25,35.45,-39.63,66.84,-26.37,48.6,-8.94,20.51,6.66,-7.85,21.87,-37.31,11.42,4,6.02,4.07,-0.41,6.67,-9.19,22.07,-16.56,37.61,-9.99,25.09,-0.31,6.73,8.03,-17.93,16.1,-44.25,9.41,10.29,10.3,7.93,11.38,6.38,9.79,8.88,6.32,8.78,6.3,1.74,7.91,-7.02,7.68,-28.61,7.8,-52.04,8.67,12,10.74,11.2,12.87,10.51,13.24,9.88,11.15,4.09,9.07,-1.71,8.33,-10.46,7.17,-32.37,6.15,-55.59,8.67,12,10.51,12.92,12.35,13.8,12.69,13.41,11.28,6.3,9.87,-0.8,9.13,-15.01,9.09,-39.44,9.28,-64.43,8.67,12,10.2,14.47,11.62,16.75,11.93,16.56,11.32,8.34,10.71,0.11,10.03,-19.65,11.21,-46.91,12.67,-74]},{"duration":60,"tweenEasing":0,"value":[-4,-8,-2.46,-11.7,-1.03,-15.12,-2.01,-5.73,-11,10.22,-21.67,6.05,-32.48,-10.05,-42.06,-39.59,-52.65,-66.67,-2.02,-2.97,-1.07,-1.8,-0.48,-0.64,-0.65,15.72,-4.67,36.76,-10.32,25.13,-17.05,3.13,-23.42,-26.39,-30.29,-54.89,-0.53,1.84,-0.04,7.53,-0.03,12.91,0.65,36.08,1.15,62.36,0.05,43.41,-2.66,15.83,-5.67,-13.62,-8.78,-43.32,-1.91,4.34,-0.92,10.58,-0.05,16.39,1.23,40.8,2.28,68.41,1.94,48.21,1.83,20.46,1.53,-7.89,1.15,-37.38,-1,8,0.39,10.01,1.67,11.86,2.51,24.88,2.2,38.41,1.1,24.85,0.78,6.67,-0.07,-18.46,-0.98,-45,-0.09,11.66,1.7,9.44,3.39,7.35,3.8,9.11,2.13,8.72,0.25,1.62,-0.28,-7.1,-1.67,-29.01,-3.12,-52.62,0,12,2.07,11.2,4.2,10.51,4.57,9.88,2.49,4.08,0.41,-1.71,-0.34,-10.46,-1.49,-32.37,-2.52,-55.59,0,12,1.84,12.92,3.68,13.8,4.03,13.41,2.61,6.3,1.2,-0.8,0.46,-15.02,0.42,-39.44,0.61,-64.43,0,12,1.54,14.47,2.96,16.75,3.26,16.56,2.66,8.33,2.05,0.11,1.37,-19.66,2.54,-46.91,4,-74]},{"value":[-92.67,19.33,-73.84,-2.53,-54.95,-17.99,-43.61,-6.22,-52.73,8.52,-63.83,-0.2,-83.87,-21.68,-108.31,-62.98,-133.98,-102.67,-72.87,16.86,-46,5.77,-18.95,-1.45,-3.32,16.78,-6.94,35.74,-15.83,19.71,-35.63,-5.98,-62.95,-44.67,-90.55,-82.42,-54.7,14.58,-20.33,13.79,13.99,14.2,33.5,38.41,35.09,61.96,28.18,39.01,8.89,9.27,-20.43,-26.51,-49.39,-62.17,-49.32,13.02,-17.4,15.46,12.52,18.18,30.14,42.55,32.44,68.49,25.09,45.44,8.53,16.67,-16.87,-14.92,-43.03,-47.86,-35,14.5,-16.42,13.35,-2.13,13.31,6.7,25.81,6.5,37.58,0.82,21.51,-11.77,3.64,-34.71,-23.28,-58.46,-52,-20.68,17.66,-9.37,13.2,-1.13,9.45,2.06,10.45,1.25,7.58,-0.91,-2.15,-9.12,-9.64,-28.88,-32.38,-49.73,-57.26,-17.66,17.34,-6.67,13.82,4.46,10.53,7.24,9.06,5.58,3.33,3.93,-2.4,-2.35,-10.12,-19.41,-33.8,-36.21,-59.16,-11.1,14.78,-3.74,12.42,3.66,10.26,5.5,9.31,4.27,6.55,3.04,3.79,-0.8,-10.13,-10,-37.64,-18.82,-66.29,-4,12,-0.61,10.77,2.52,9.63,3.26,9.42,2.66,10.33,2.05,11.25,0.93,-8.97,0.39,-41.36,0,-74]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00","timeline":[{"name":"D_HAIR_BACK.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_BACK.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_BACK.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_BACK.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_BACK.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_00","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-6.24,-1.37,-3.48,-2.66,9.34,-1.24,0.57,-4.97,-11.22,14.88,-2.84,6.45,-0.24,2.09,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.3,1.95,-4.25,4.29,0,0,-9.7,7.17,-11.69,7.69,0,0,0,0,0,0,0,0,0,0,0,0,-1.57,23.94,0,0,0,0,0,0,0,0,2.52,10.68,-3.69,11.77,-1.73,6.58,0,0,3.3,0.3,0,0,0,0,0,0,0,0,0,0,11.04,-2.72,-7.89,-0.31,-9.64,5.46,-15.71,-1.31,-2.02,-1.54,3.98,-1.83,5.07,-0.67,6.12,-1.84,-2.09,1.37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.58,6.85,-6.68,11.98,-9.35,10.72,-10.79,7.92,-0.13,1.15,-4.6,4.44]},{"duration":60,"tweenEasing":0,"value":[-6.24,-1.37,-3.48,-2.66,9.34,-1.24,2.1,-3.67,-6.34,1.02,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.3,1.95,-4.25,4.29,0,0,-8.57,2.82,-10.33,2.32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.3,0.3,0,0,0,0,0,0,0,0,0,0,11.04,-2.72,-7.89,-0.31,-13.51,-0.19,-15.71,-1.31,-2.02,-1.54,3.98,-1.83,5.07,-0.67,7.59,-2.35,-1.57,-1.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-4.68,1.54,-5.54,1.25,-5.58,1.25,-9.49,2.56,0,0,-3.95,1.3]},{"value":[-6.24,-1.37,-3.48,-2.66,9.34,-1.24,4.3,-4.45,-7.76,-7,-0.74,-0.58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.3,1.95,-4.25,4.29,0,0,-8.57,2.82,-13.24,-9.25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.3,0.3,0,0,0,0,0,0,0,0,0,0,11.04,-2.72,-7.89,-0.31,-13.51,-0.19,-15.71,-1.31,-2.02,-1.54,3.98,-1.83,5.07,-0.67,7.59,-2.35,-1.57,-1.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.24,-2.8,-9.24,-0.84,-7.04,-0.71,-9.49,2.56,0,0,-3.95,1.3]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_01","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.12,-0.68,-1.74,-1.33,4.67,-0.62,2.15,-2.22,-4.13,0.9,-0.81,4.35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.15,0.97,-2.12,2.14,0,0,-4.29,1.41,-5.17,1.16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.65,0.15,0,0,0,0,0,0,0,0,0,0,5.52,-1.36,-3.94,-0.16,-6.76,-0.09,-7.85,-0.66,-1.01,-0.77,1.99,-0.92,2.53,-0.34,3.8,-1.17,-0.78,-0.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.7,2.75,-3.14,2.64,-2.79,0.63,-4.74,1.28,0,0,-1.98,0.65]},{"duration":60,"tweenEasing":0,"value":[-3.12,-0.68,-1.74,-1.33,4.67,-0.62,2.15,-2.22,-4.96,1.72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.15,0.97,-2.12,2.14,0,0,-4.29,1.41,-5.17,1.16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.65,0.15,0,0,0,0,0,0,0,0,0,0,5.52,-1.36,-3.94,-0.16,-6.76,-0.09,-7.85,-0.66,-1.01,-0.77,1.99,-0.92,2.53,-0.34,3.8,-1.17,-0.78,-0.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.34,0.77,-2.77,0.62,-2.79,0.63,-4.74,1.28,0,0,-1.98,0.65]},{"value":[-3.12,-0.68,-1.74,-1.33,4.67,-0.62,2.15,-2.22,-8.44,-5.82,-0.69,-5.22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.15,0.97,-2.12,2.14,0,0,-4.29,1.41,-7.78,-5.95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.88,-4.83,0,0,1.65,0.15,0,0,0,0,0,0,0,0,0,0,5.52,-1.36,-3.94,-0.16,-6.76,-0.09,-7.85,-0.66,-1.01,-0.77,1.99,-0.92,2.53,-0.34,3.8,-1.17,-0.78,-0.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.34,0.77,-2.77,0.62,-3.63,0.08,-6.77,-2.93,0,0,-1.98,0.65]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_03","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-2.56,0.02,-1.21,1.01,-4.02,-2.13,5.49,-4.2,12.11,0.23,0,0,0,0,0,0,0,0,0,0,-0.56,-1.62,0.51,-2.54,-5.5,-9.39,-0.68,-2.51,6.36,-3.62,6.24,-1.84,0,0,20.03,2.37,25.71,4.42,19.57,3.74,33.45,-2.63,26.09,-2.42,10.81,2.02,11.96,1.96,30.8,5.55,31.85,3.47,28.28,4.25,17.43,3.6,3.69,-5.01,11.39,2.52,19.05,-0.32,18.49,4.52,13.03,0.63,17.59,-6.98,5.9,-2.91,5.36,-8.98,20.08,-0.79,6.5,-2.09,-4.33,-4.29,3.54,-1.18,3.3,-0.34,11.84,0.04,5.72,0.36,13.31,1.37,3.71,0.97,-2.98,-1.61,3.13,-2.39,5.42,-0.04,10.13,1.47,1.2,-6.82,-1.22,-9.71,-2.36,-4.75,-1.59,-5.41,-3.68,-4.43,-1.64,-7.38,1.14,-3.71,-1.84,-2.27,1.28,-4.01,10.93,1.3,13.78,2.37,19.46,2.49,22.99,3.44,0,0,9.24,1.1]},{"duration":60,"tweenEasing":0,"value":[-2.56,0.02,-1.21,1.01,-4.02,-2.13,5.49,-4.2,12.11,0.23,0,0,0,0,0,0,0,0,0,0,-0.56,-1.62,0.51,-2.54,-5.5,-9.39,0.9,-1.79,6.36,-3.62,6.24,-1.84,0,0,20.03,2.37,25.71,4.42,19.57,3.74,33.45,-2.63,26.09,-2.42,10.81,2.02,11.96,1.96,30.8,5.55,31.85,3.47,28.28,4.25,17.43,3.6,3.69,-5.01,11.39,2.52,19.05,-0.32,18.49,4.52,13.03,0.63,17.59,-6.98,5.9,-2.91,5.36,-8.98,20.08,-0.79,6.5,-2.09,-4.33,-4.29,3.54,-1.18,3.3,-0.34,11.84,0.04,5.72,0.36,13.31,1.37,3.71,0.97,-2.98,-1.61,3.13,-2.39,5.42,-0.04,10.13,1.47,1.2,-6.82,-1.22,-9.71,0.01,-4.03,-1.59,-5.41,-3.68,-4.43,-1.64,-7.38,1.14,-3.71,-1.84,-2.27,1.28,-4.01,10.93,1.3,13.78,2.37,19.46,2.49,22.99,3.44,0,0,9.24,1.1]},{"value":[-2.56,0.02,-1.21,1.01,-4.02,-2.13,5.49,-4.2,12.11,0.23,0,0,0,0,0,0,0,0,0,0,-0.56,-1.62,0.51,-2.54,-5.5,-9.39,-0.68,-2.51,6.36,-3.62,6.24,-1.84,0,0,20.03,2.37,25.71,4.42,19.57,3.74,33.45,-2.63,26.09,-2.42,10.81,2.02,11.96,1.96,30.8,5.55,31.85,3.47,28.28,4.25,17.43,3.6,3.69,-5.01,11.39,2.52,19.05,-0.32,18.49,4.52,13.03,0.63,17.59,-6.98,5.9,-2.91,5.36,-8.98,20.08,-0.79,6.5,-2.09,-4.33,-4.29,3.54,-1.18,3.3,-0.34,11.84,0.04,5.72,0.36,13.31,1.37,3.71,0.97,-2.98,-1.61,3.13,-2.39,5.42,-0.04,10.13,1.47,1.2,-6.82,-1.22,-9.71,-2.36,-4.75,-1.59,-5.41,-3.68,-4.43,-1.64,-7.38,1.14,-3.71,-1.84,-2.27,1.28,-4.01,10.93,1.3,13.78,2.37,19.46,2.49,22.99,3.44,0,0,9.24,1.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_04","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-5.12,0.03,-2.43,2.02,-8.05,-4.25,2.23,-4.1,24.22,0.45,0,0,0,0,0,0,0,0,0,0,0,0,1.01,-5.07,-8.61,-17.84,3.46,-6.64,15.24,-8.46,12.49,-3.68,0,0,40.07,4.75,51.41,8.85,31.65,20.1,61.44,22.41,47.17,2.96,21.61,4.04,27.75,13.14,61.6,11.1,63.71,6.94,56.56,8.51,34.86,7.2,7.38,-10.02,18.49,6.46,38.09,-0.63,36.99,9.05,26.06,1.25,29.68,1.03,11.8,-5.82,6.91,-10.13,30.63,9.28,11.91,-1.76,-8.67,-8.58,6.82,3.13,6.97,-2.46,23.68,0.09,11.44,0.72,26.63,2.74,7.43,1.93,-5.97,-3.23,-0.23,-1.88,-3.81,-0.14,20.27,2.95,6.84,-10.04,-2.44,-19.42,1.14,-6.66,-2.03,-9.76,-7.37,-8.85,-3.28,-14.75,2.28,-7.43,-3.68,-4.53,2.56,-8.01,21.86,2.59,27.57,4.75,38.91,4.99,45.98,6.88,0,0,18.48,2.19]},{"duration":60,"tweenEasing":0,"value":[-5.12,0.03,-2.43,2.02,-8.05,-4.25,2.23,-4.1,24.22,0.45,0,0,0,0,0,0,0,0,0,0,-1.11,-3.23,1.01,-5.07,-4.49,-17.21,-1.36,-5.02,12.71,-7.24,12.49,-3.68,0,0,40.07,4.75,51.41,8.85,39.14,7.48,64.02,10.1,52.19,-4.85,21.61,4.04,23.92,3.92,61.6,11.1,63.71,6.94,56.56,8.51,34.86,7.2,7.38,-10.02,18.49,6.46,38.09,-0.63,36.99,9.05,26.06,1.25,32.39,-11.79,11.8,-5.82,10.73,-17.97,30.6,-0.56,12.99,-4.19,-8.67,-8.58,7.08,-2.37,6.59,-0.68,23.68,0.09,11.44,0.72,26.63,2.74,7.43,1.93,-5.97,-3.23,-0.23,-1.88,-3.81,-0.14,20.27,2.95,2.41,-13.64,-2.44,-19.42,2.32,-8.69,-3.18,-10.81,-5.76,-8.83,-3.28,-14.75,2.28,-7.43,-3.68,-4.53,2.56,-8.01,21.86,2.59,27.57,4.75,38.91,4.99,45.98,6.88,0,0,18.48,2.19]},{"value":[-5.12,0.03,-2.43,2.02,-8.05,-4.25,2.23,-4.1,24.22,0.45,0,0,0,0,0,0,0,0,0,0,-1.11,-3.23,6.1,-3.32,-5.29,-27.41,-1.31,-7.98,12.71,-7.24,12.49,-3.68,0,0,40.07,4.75,51.41,8.85,33.09,-0.08,61.88,-8.15,52.19,-4.85,21.61,4.04,23.92,3.92,61.6,11.1,63.71,6.94,56.56,8.51,34.86,7.2,7.38,-10.02,18.49,6.46,38.09,-0.63,36.99,9.05,26.06,1.25,32.27,-14.63,11.8,-5.82,10.73,-17.97,30.43,-4.95,12.81,-13.59,-7.04,-13.77,8.33,-5.77,6.59,-0.68,23.68,0.09,11.44,0.72,26.63,2.74,7.43,1.93,-5.97,-3.23,-0.23,-1.88,-3.81,-0.14,20.27,2.95,3.77,-17.5,-1.01,-26.27,-1.48,-12.5,-1.55,-17.56,-5.74,-17.15,-2.47,-21.62,0.77,-12.29,-3.68,-4.53,0.01,-10.83,21.86,2.59,27.57,4.75,38.91,4.99,45.98,6.88,0,0,18.48,2.19]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.04","timeline":[{"name":"B_CLOTHES.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_00","timeline":[{"name":"B_CLOTHES.04","type":12,"frame":[{"duration":121,"x":-3.5}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_02","timeline":[{"name":"B_CLOTHES.04","type":12,"frame":[{"duration":121,"x":59.6}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_03","timeline":[{"name":"B_CLOTHES.04","type":11,"frame":[{"duration":121,"x":-22.7,"y":0.32}]},{"name":"B_CLOTHES.04","type":12,"frame":[{"duration":121,"x":60.9}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.07","timeline":[{"name":"B_CLOTHES.07_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.07_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.07_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.07_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_00","timeline":[{"name":"B_CLOTHES.07","type":12,"frame":[{"duration":121,"x":-11}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_02","timeline":[{"name":"B_CLOTHES.07","type":11,"frame":[{"duration":121,"x":1.65,"y":-12.82}]},{"name":"B_CLOTHES.07","type":12,"frame":[{"duration":121,"x":7.37}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_03","timeline":[{"name":"B_CLOTHES.07","type":11,"frame":[{"duration":121,"x":1.65,"y":-12.82}]},{"name":"B_CLOTHES.07","type":12,"frame":[{"duration":121,"x":8.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.36","timeline":[{"name":"B_CLOTHES.36_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.36_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.36_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.36_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_00","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[1.54,38.07,0.45,24.73,-0.97,14.08,-1.52,5.9,0,0,0,0,0,0,0,0,0,0,1.57,30.68,0.59,19.92,-0.56,11.24,-1.04,4.61,0,0,0,0,0,0,0,0,0,0,1.61,22.52,0.74,14.44,-0.16,8.01,-0.58,3.2,0,0,0,0,0,0,0,0,0,0,1.64,15.91,0.93,10.25,0.23,5.54,-0.17,2.03,0,0,0,0,0,0,0,0,0,0,1.65,13.19,1.16,9.34,0.62,5.01,0.18,1.46,0,0,0,0,0,0,0,0,0,0,1.47,11.75,1.05,8.57,0.58,4.68,0.19,1.39,0,0,0,0,0,0,0,0,0,0,1.03,8.24,0.73,6.06,0.41,3.33,0.15,0.99,0,0,0,0,0,0,0,0,0,0,0.49,3.92,0.34,2.86,0.19,1.56,0.07,0.46]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.89,-5.84,2.04,-8.54,2.19,-8.11,1.47,-5.08,0,0,0,0,0,0,0,0,0,0,0.72,-10.08,1.69,-11.11,1.94,-10.15,1.54,-7.55,0.55,-3.64,0.41,-3.07,0.27,-1.82,0.13,-0.57,0,0,0.53,-14.76,1.24,-13.66,1.49,-11.19,1.32,-8.03,0.74,-4.85,0.54,-4.09,0.35,-2.43,0.17,-0.76,0,0,0.37,-18.55,0.74,-15.08,0.88,-10.57,0.81,-6.33,0.55,-3.64,0.41,-3.07,0.27,-1.82,0.13,-0.57,0,0,0.31,-20.12,0.24,-14.24,0.14,-7.63,0.04,-2.23,0,0,0,0,0,0,0,0,0,0,0.28,-17.91,0.22,-13.07,0.12,-7.14,0.04,-2.12,0,0,0,-0.87,0.01,-1.17,0,-0.87,0,0,0.19,-12.57,0.14,-9.24,0.09,-5.07,0.04,-1.51,0,0,0.01,-1.75,0.01,-2.33,0.01,-1.75,0,0,0.09,-5.97,0.06,-4.36,0.04,-2.38,0.03,-0.71,0,0,0.01,-2.62,0.02,-3.5,0.01,-2.62,0,0,0,0,0,0,0,0,0,0,0,0,0.02,-3.5,0.02,-4.66,0.02,-3.5]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_01","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[1.77,51.28,1.42,34.68,1.14,20.25,0.95,9.27,0.89,3.02,0.79,2.67,0.55,1.85,0.26,0.85,0,0,1.51,45.01,1.05,31.13,0.74,18.85,0.52,9.49,0.36,4.36,0.33,3.85,0.24,2.65,0.11,1.21,0,0,1.22,38.08,0.65,27.02,0.29,17.18,0.04,9.73,-0.22,5.84,-0.16,5.16,-0.1,3.52,-0.04,1.59,0,0,0.98,32.47,0.38,23.96,-0.07,16.01,-0.42,9.94,-0.69,7.05,-0.57,6.22,-0.38,4.25,-0.18,1.92,0,0,0.89,30.16,0.34,23.56,-0.24,16.12,-0.7,10.05,-0.89,7.54,-0.78,6.68,-0.53,4.62,-0.24,2.14,0,0,0.79,26.86,0.33,21.42,-0.17,14.75,-0.59,9.1,-0.79,6.72,-0.68,5.91,-0.46,4,-0.21,1.77,0,0,0.55,18.85,0.21,15.11,-0.11,10.42,-0.39,6.41,-0.55,4.71,-0.48,4.14,-0.32,2.78,-0.14,1.22,0,0,0.26,8.95,0.09,7.14,-0.06,4.92,-0.17,3.03,-0.26,2.24,-0.23,1.97,-0.15,1.33,-0.07,0.59]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":2,"value":[0.25,-1.32,0.54,-2.81,0.78,-4.02,0.89,-4.52,0.78,-4.01,0.53,-2.78,0.24,-1.28,0,0,0.79,-5.82,0.8,-5.57,0.86,-5.13,0.91,-4.71,0.89,-4.52,0.78,-4.01,0.53,-2.78,0.24,-1.28,0,0,1.66,-12.25,1.43,-10.33,1.23,-7.75,1.04,-5.49,0.89,-4.52,0.78,-4.01,0.54,-2.78,0.24,-1.28,0,0,2.37,-17.46,1.95,-14.06,1.5,-9.77,1.11,-6.09,0.89,-4.52,0.78,-4.01,0.54,-2.77,0.24,-1.28,0,0,2.66,-19.61,2.15,-15.2,1.57,-10.24,1.09,-6.2,0.89,-4.52,0.78,-4.01,0.54,-2.77,0.25,-1.28,0,0,2.37,-17.46,1.93,-13.83,1.43,-9.38,1,-5.62,0.79,-4.03,0.68,-3.54,0.46,-2.4,0.21,-1.06,0,0,1.66,-12.25,1.35,-9.76,1.01,-6.63,0.72,-3.96,0.55,-2.83,0.47,-2.48,0.32,-1.67,0.15,-0.73,0,0,0.79,-5.82,0.64,-4.61,0.48,-3.13,0.34,-1.87,0.26,-1.34,0.23,-1.18,0.15,-0.8,0.07,-0.35]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_02","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.2,105.91,0.08,82.08,-4.7,53.43,-5.11,26.58,-0.1,8.12,-0.08,7.2,-0.05,4.98,-0.01,2.3,0,0,9.21,92.64,2.79,71.42,-0.92,46.06,-1.33,22.9,2.14,8.29,2.55,7.48,3.2,5.41,3.1,2.57,1.28,-0.54,10.16,79.26,5.53,60.63,2.9,38.62,2.51,19.23,4.62,8.47,5.39,7.77,6.62,5.81,6.36,2.78,2.69,-1.13,11.24,66.09,8.35,49.99,6.54,31.25,5.93,15.56,6.63,8.62,7.81,8.05,9.67,6.26,9.31,3.09,3.83,-1.61,12.64,53.41,11.22,39.77,9.77,24.09,8.45,11.89,7.45,8.68,9.19,8.31,11.83,6.82,11.49,3.64,4.3,-1.8,19.67,50.66,20.58,37.4,19.15,22.18,15.84,10.62,11.11,8.36,11.6,7.76,12.42,5.9,10.94,2.62,4.5,-2.19,25.52,39.38,28.4,27.87,26.94,15.89,21.57,7.72,12.77,7.61,12.64,6.79,12.28,4.53,10.22,1.12,4.99,-3.14,30.9,24.69,35.65,15.43,34.03,7.82,26.54,4.15,13.63,6.7,13.13,5.65,11.82,2.98,9.41,-0.58,5.6,-4.32,36.52,11.7,43.32,4.4,41.51,0.59,31.8,0.89,14.89,5.87,13.89,4.59,11.51,1.51,8.63,-2.19,6.15,-5.38]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.28,-9.65,0.22,-6.83,0.12,-3.66,0.04,-1.07,0,0,0,0,0,0,0,0,0,0,0.26,-12.96,0.04,-9.56,-0.23,-5.67,-0.46,-2.48,-0.57,-1.15,-0.49,-1.01,-0.34,-0.68,-0.16,-0.3,0,0,0.24,-16.62,-0.15,-12.59,-0.61,-7.91,-1,-4.04,-1.19,-2.42,-1.03,-2.12,-0.7,-1.43,-0.33,-0.62,0,0,0.22,-19.57,-0.31,-15,-0.92,-9.69,-1.45,-5.28,-1.7,-3.45,-1.47,-3.03,-1.01,-2.05,-0.47,-0.91,0,0,0.21,-20.79,-0.39,-15.85,-1.09,-10.29,-1.67,-5.75,-1.91,-3.87,-1.7,-3.43,-1.18,-2.37,-0.55,-1.09,0,0,0.5,-22.87,-1.61,-18.26,-2.76,-12.42,-2.83,-6.95,-1.7,-3.45,-1.47,-3.03,-1.01,-2.05,-0.47,-0.91,0,0,1.2,-27.92,-2.39,-23.07,-4.07,-15.72,-3.7,-8.1,-1.19,-2.42,-1.02,-2.12,-0.7,-1.43,-0.33,-0.62,0,0,2.07,-34.15,-3,-28.85,-5.24,-19.5,-4.5,-9.23,-0.57,-1.15,-0.49,-1.01,-0.34,-0.68,-0.16,-0.3,0,0,2.86,-39.79,-3.67,-34.14,-6.51,-23.05,-5.38,-10.39]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_03","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[7.91,132.11,5.18,113.03,-0.71,87.91,-4.26,51.86,0,0,0,0,0,0,0,0,0,0,10.57,117.82,9.23,100.32,3.93,76.24,-0.69,43.5,0,0,0,0,0,0,0,0,0,0,13.23,103.97,13.34,87.98,8.56,64.86,2.81,35.3,0,0,0,0,0,0,0,0,0,0,15.88,89.25,17.46,74.91,13.19,53.05,6.3,26.97,0,0,0,0,0,0,0,0,0,0,18.52,72.36,21.56,60.01,17.82,40.13,9.79,18.28,0,0,0,0,0,0,0,0,0,0,20.57,56.54,22.2,47.01,18.59,31.23,11.09,13.97,1.08,0,1.16,0,0.84,0,0.37,0,0,0,23.86,37.5,24.23,31.28,20.79,20.74,13.84,9.2,3.69,-0.01,3.46,-0.01,2.43,0,1.11,0,0,0,27.64,17.17,27,14.44,23.61,9.62,17.05,4.28,6.92,-0.02,6.2,-0.02,4.3,-0.01,1.98,-0.01,0,0,31.17,-2.52,29.78,-1.84,26.21,-1.17,19.8,-0.55,9.84,-0.03,8.72,-0.02,6.03,-0.02,2.79,-0.01]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[2.17,-5.43,1.54,-3.96,0.87,-2.16,0.31,-0.64,0,0,0,0,0,0,0,0,0,0,4.57,-11.43,3.28,-8.4,1.86,-4.61,0.66,-1.37,0,0,0,0,0,0,0,0,0,0,6.52,-16.29,4.68,-11.88,2.62,-6.49,0.88,-1.92,0,0,0,0,0,0,0,0,0,0,7.32,-18.29,5.2,-12.94,2.79,-6.93,0.82,-2.03,0,0,0,0,0,0,0,0,0,0,6.52,-16.29,4.68,-11.88,2.62,-6.49,0.88,-1.92,0,0,0,0,0,0,0,0,0,0,4.57,-11.43,3.29,-8.4,1.86,-4.61,0.65,-1.37,0,0,0,0,0,0,0,0,0,0,2.17,-5.43,1.55,-3.96,0.87,-2.16,0.31,-0.64]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAND.08","timeline":[{"name":"B_HAND.08_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAND.08_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_HAND.08_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_HAND.08_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_00","timeline":[{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-6.6},{"duration":60,"tweenEasing":0},{"x":19.5}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_01","timeline":[{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-12.7},{"duration":60,"tweenEasing":0},{"x":14.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_02","timeline":[{"name":"B_HAND.08","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-3.91,"y":-0.85},{"duration":61}]},{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-34.5},{"duration":60,"tweenEasing":0,"x":15},{"x":25.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_03","timeline":[{"name":"B_HAND.08","type":11,"frame":[{"duration":121,"x":10.98,"y":7.2}]},{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-37.8},{"duration":60,"tweenEasing":0,"x":18.1},{"x":24.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.13","timeline":[{"name":"D_CLOTHES.13_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.13_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"D_CLOTHES.13_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"D_CLOTHES.13_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_00","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":121,"value":[-1.76,-2.49,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,0,0,0,0,0,0,0,0,0,0,0,0,1.82,8.32]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_01","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.94,-6.94,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-10.35,-3.91]},{"duration":60,"tweenEasing":0,"offset":41},{"value":[-2.94,4.41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.73,1.88]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_02","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-6.39,-5.27,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,2.2,-3.18,23.13,-15.27,8.11,-17.93,15.38,-2.68,0,0,0,0,0,0,-7.95,-1.01]},{"duration":60,"tweenEasing":0,"value":[-10.85,-2.42,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,2.2,-3.18,23.13,-15.27,8.11,-17.93,15.38,-2.68,0,0,0,0,0,0,-7.29,1.45]},{"value":[-5.74,4.06,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,2.2,-3.18,23.13,-15.27,8.11,-17.93,23.96,-8.41,0,0,0,0,0,0,-6.62,3.9]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_03","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[4.35,-8.53,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,19.05,-5.98,-7.44,-34.98,12.3,-16.28,0,0,0,0,0,0,-7.5,0.63]},{"duration":60,"tweenEasing":0,"value":[-1.07,-2.83,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,19.05,-5.98,-7.44,-34.98,12.3,-16.28,0,0,0,0,0,0,-2.83,3.97]},{"value":[-4.81,4.89,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,19.05,-5.98,-7.44,-34.98,12.3,-16.28,0,0,0,0,0,0,-2.83,3.97]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.31","timeline":[{"name":"B_CLOTHES.31_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.31_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.31_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.31_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_00","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_01","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_02","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_03","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.32","timeline":[{"name":"B_CLOTHES.32_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.32_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.32_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.32_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_00","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_01","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_02","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_03","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.10","timeline":[{"name":"D_CLOTHES.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"D_CLOTHES.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"D_CLOTHES.10_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_00","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.97,-2.48,0,0,0,0,0,0,0,0,0,0,2.25,10.87,-0.94,0.8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-14.67,-2.59,0,0,0,0,-1.95,-4.97]},{"duration":60,"tweenEasing":0,"offset":12,"value":[2.25,10.87,-0.94,0.8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.19,-3.55]},{"value":[1.12,2.47,0,0,0,0,0,0,0,0,0,0,2.25,10.87,-0.94,0.8,0,0,0,0,0,0,4.08,3.99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.97,1.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_01","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[6.74,-2.52,0,0,0,0,0,0,0,0,0,0,2.25,10.87,0,9.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.49,-1.68,0,0,0,0,4.45,-6.7]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[7.14,5.79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.62,1.63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.45,-0.88,0,0,0,0,4.84,4.98,2.47,3.32]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_02","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[27.2,2.02,0,0,0,0,0,0,0,0,-17.97,-13.9,17.9,8.32,0,9.2,0,0,0,0,0,0,10.91,1.49,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,16.32,1.39,0,0,0,0,23.32,-1.78,12.06,1.16,12.09,3.14]},{"duration":60,"tweenEasing":0,"value":[22.2,3.45,0,0,0,0,0,0,0,0,-17.97,-13.9,17.9,8.32,0,9.2,0,0,0,0,0,0,10.91,1.49,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,10.94,3.65,0,0,0,0,21.45,2.39,12.06,1.16,12.09,3.14]},{"value":[24.93,8.59,0,0,0,0,0,0,0,0,-17.97,-13.9,17.9,8.32,0,9.2,0,0,0,0,0,0,16.79,4.32,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,10.94,3.65,0,0,0,0,27.57,5.93,12.06,1.16,12.09,3.14]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_03","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[24.34,9,0,0,0,0,0,0,0,0,-9.57,-14.01,32.19,11.47,0,9.2,0,0,0,0,0,0,17.99,1.07,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,16.1,2.06,0,0,0,0,26.73,1.74,11.63,2.05,12.09,3.14]},{"duration":60,"tweenEasing":0,"value":[24.34,9,0,0,0,0,0,0,0,0,-9.57,-14.01,32.19,11.47,0,9.2,0,0,0,0,0,0,17.99,1.07,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,13.17,3.75,0,0,0,0,27.92,4.52,11.63,2.05,12.09,3.14]},{"value":[21.76,16.17,0,0,0,0,0,0,0,0,-9.57,-14.01,32.19,11.47,0,9.2,0,0,0,0,0,0,17.85,7.39,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,11.23,9.13,0,0,0,0,31.36,8.29,15.46,4.93,11.46,4.92]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.40","timeline":[{"name":"B_CLOTHES.40_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.40_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.40_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.40_00","timeline":[{"name":"B_CLOTHES.40","type":12,"frame":[{"duration":121,"x":2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.40_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.40_02","timeline":[{"name":"B_CLOTHES.40","type":12,"frame":[{"duration":121,"x":-2.5}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.41","timeline":[{"name":"B_CLOTHES.41_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.41_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.41_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.41_00","timeline":[{"name":"B_CLOTHES.41","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":9.21,"y":-1.49},{"duration":60,"tweenEasing":0},{"x":-17.77,"y":2.88}]},{"name":"B_CLOTHES.41","type":12,"frame":[{"duration":121,"x":-6}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.41_01","timeline":[{"name":"B_CLOTHES.41","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":10.58,"y":-1.34},{"duration":60,"tweenEasing":0},{"x":-25.79,"y":3.26}]},{"name":"B_CLOTHES.41","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":1.4}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.41_02","timeline":[{"name":"B_CLOTHES.41","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":9.3,"y":-0.76},{"duration":60,"tweenEasing":0},{"x":-21.93,"y":1.8}]},{"name":"B_CLOTHES.41","type":12,"frame":[{"duration":121,"x":13.2}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAND.18","timeline":[{"name":"B_HAND.18_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAND.18_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.18_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.18_00","timeline":[{"name":"B_HAND.18","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-32.95,"y":-1.53},{"duration":61}]},{"name":"B_HAND.18","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-3.1},{"duration":60,"tweenEasing":0,"x":-3.1},{"x":2.6}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.18_01","timeline":[{"name":"B_HAND.18","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-35.43,"y":-0.47},{"duration":61}]},{"name":"B_HAND.18","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":4.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.18_02","timeline":[{"name":"B_HAND.18","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-29.39,"y":0.98},{"duration":61}]},{"name":"B_HAND.18","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":5.7}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.18","timeline":[{"name":"D_CLOTHES.18_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.18_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.18_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.18_00","timeline":[{"name":"D_CLOTHES.18","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":39},{"duration":60,"tweenEasing":0,"offset":39},{"value":[-20.34,-1.46,6.33,16.06,-20.82,16.07,-24.31,-0.96,0,0,0,0,-8.27,-1.64,0,0,-17.36,0.85,-15.87,2.01,0,0,0,0,0,0,-13.4,0.35,0,0,-15.05,-2.13]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.18_01","timeline":[{"name":"D_CLOTHES.18","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[11.75,7.92,0,0,0,0,0,0,0,0,5.29,-0.67,6.61,-0.84,0,0,0,0,0,0,0,0,0,0,18.52,-2.34,17.53,0.47]},{"duration":60,"tweenEasing":0,"offset":39},{"value":[-20.34,-1.46,-12.06,10.93,-20.82,16.07,-24.31,-0.96,0,0,0,0,-8.27,-1.64,0,0,-17.36,0.85,-15.87,2.01,0,0,0,0,0,0,-13.4,0.35,0,0,-15.05,-2.13]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.18_02","timeline":[{"name":"D_CLOTHES.18","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":39},{"duration":60,"tweenEasing":0,"offset":39},{"value":[-20.34,-1.46,-12.06,10.93,-20.82,16.07,-24.31,-0.96,0,0,0,0,-8.27,-1.64,0,0,-17.36,0.85,-15.87,2.01,0,0,0,0,0,0,-13.4,0.35,0,0,-15.05,-2.13]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.19","timeline":[{"name":"D_CLOTHES.19_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.19_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.19_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.19_00","timeline":[{"name":"D_CLOTHES.19","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-25.3,-2.97,-36.13,-9.51,-29.33,-9.34,-18.08,1.39,-12.88,2.56,-9.98,1.85,-31.68,1.06,-15.19,0.68,-24.29,-1.37,2.47,-4.91,14.6,1.92,5.2,1.17,14.73,7.42,4.91,2.47,0,0,-31.68,1.06,-16.49,0.38,-21.56,4.71,-20.81,-4.69,-37.59,-3,-44.3,-1.86,-23.28,0.22,-32.55,4.96,-58.86,0.4,-53.37,0.27,-32.68,-0.53,-21.69,-0.79,-27.61,-4.85,12,1.34,15.9,2.22]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[2.35,8.63,0.52,4.18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.97,2.35,13.07,2.61]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.19_01","timeline":[{"name":"D_CLOTHES.19","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-25.3,-2.97,-36.13,-9.51,-29.33,-9.34,-18.08,1.39,-12.88,2.56,-9.98,1.85,-31.68,1.06,-15.19,0.68,-24.29,-1.37,2.47,-4.91,14.6,1.92,5.2,1.17,14.73,7.42,4.91,2.47,0,0,-31.68,1.06,-16.49,0.38,-21.56,4.71,-20.81,-4.69,-37.59,-3,-44.3,-1.75,-23.28,0.22,-32.55,4.96,-58.86,0.4,-53.37,0.27,-32.68,-0.53,-21.69,-0.79,-27.61,-4.85,12,1.34,15.9,2.22]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[2.35,8.63,0.52,4.18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.97,2.35,13.07,2.61]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.19_02","timeline":[{"name":"D_CLOTHES.19","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-25.3,-2.97,-36.13,-9.51,-29.33,-9.34,-18.08,1.39,-12.88,2.56,-9.98,1.85,-31.68,1.06,-15.19,0.68,-24.29,-1.37,2.47,-4.91,14.6,1.92,5.2,1.17,14.73,7.42,4.91,2.47,0,0,-31.68,1.06,-16.49,0.38,-21.56,4.71,-20.81,-4.69,-37.59,-3,-44.3,-1.75,-23.28,0.22,-32.55,4.96,-58.86,0.4,-53.37,0.27,-32.68,-0.53,-21.69,-0.79,-27.61,-4.85,12,1.34,15.9,2.22]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[2.35,8.63,0.52,4.18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.97,2.35,13.07,2.61]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAND.17","timeline":[{"name":"B_HAND.17_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAND.17_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.17_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.17_00","timeline":[{"name":"B_HAND.17","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-14.07,"y":4.14},{"duration":61}]},{"name":"B_HAND.17","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-1.7},{"duration":60,"tweenEasing":0,"x":2},{"x":-1.7}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.17_01","timeline":[{"name":"B_HAND.17","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-5.75,"y":-1.58},{"duration":61}]},{"name":"B_HAND.17","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":0.9},{"duration":60,"tweenEasing":0},{"x":-3.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.17_02","timeline":[{"name":"B_HAND.17","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-12,"y":0.31},{"duration":61}]},{"name":"B_HAND.17","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-5},{"duration":60,"tweenEasing":0,"x":-7.1},{"x":-2.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.16","timeline":[{"name":"D_CLOTHES.16_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.16_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.16_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.16_00","timeline":[{"name":"D_CLOTHES.16","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":47},{"duration":60,"tweenEasing":0,"offset":47},{"offset":10,"value":[-25.72,2.97,-24.14,0.44,-24.27,1.77,-30.78,-0.18,-21,-4.63,-1.3,-14.85,0,0,-13.4,0.1,0,0,0,0,0,0,0,0,0,0,0,0,-25.35,-1.01,-33.81,3.56,-26.92,1.52,-31.74,-4.28,-25.72,2.97]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.16_01","timeline":[{"name":"D_CLOTHES.16","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":47},{"duration":60,"tweenEasing":0,"offset":47},{"offset":10,"value":[-25.72,2.97,-24.14,0.44,-24.27,1.77,-30.78,-0.18,-21,-4.63,-1.3,-14.85,0,0,-13.4,0.1,0,0,0,0,0,0,0,0,0,0,0,0,-25.35,-1.01,-33.81,3.56,-26.92,1.52,-31.74,-4.28,-25.72,2.97]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.16_02","timeline":[{"name":"D_CLOTHES.16","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":47},{"duration":60,"tweenEasing":0,"offset":47},{"offset":10,"value":[-25.72,2.97,-24.14,0.44,-24.27,1.77,-30.78,-0.18,-21,-4.63,-1.3,-14.85,0,0,-13.4,0.1,0,0,0,0,0,0,0,0,0,0,0,0,-25.35,-1.01,-33.81,3.56,-26.92,1.52,-31.74,-4.28,-25.72,2.97]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.17","timeline":[{"name":"D_CLOTHES.17_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.17_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.17_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.17_00","timeline":[{"name":"D_CLOTHES.17","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.24,-1.85,-10.2,3.38,1.05,-1.57,-5.23,1.04,0,0,-11.17,0.86,20.87,-1.57,20.55,5.71,30,-9.33,28.83,-7.41,39.18,-19.91,29.24,3.61,0,0,-3.13,-2.1,0,0,-19.09,-0.3,-27.45,-1.36,-1.04,-5.23,-31.39,-3.57,-4.04,3.79,3.55,1.94,26.92,-11.98,27.21,-6.75,35.34,-15.49,9.39,0.9,20.7,2.38,8.21,4.75,0.92,0.36,3.17,4.07,-5.93,-0.69,-13.37,5.81,-15.02,2.54]},{"duration":61,"offset":65}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.17_01","timeline":[{"name":"D_CLOTHES.17","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.24,-1.85,-10.2,3.38,1.05,-1.57,-5.23,1.04,0,0,-11.17,0.86,20.87,-1.57,20.55,5.71,30,-9.33,31.46,1.55,43.13,-8.66,29.24,3.61,0,0,-3.13,-2.1,0,0,-19.09,-0.3,-27.45,-1.36,-1.04,-5.23,-31.39,-3.57,-4.04,3.79,3.55,1.94,30.08,-5.96,27.21,-6.75,35.34,-15.49,9.39,0.9,20.7,2.38,8.21,4.75,0.92,0.36,3.17,4.07,-5.93,-0.69,-13.37,5.81,-15.02,2.54]},{"duration":61,"offset":65}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.17_02","timeline":[{"name":"D_CLOTHES.17","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.24,-1.85,-10.2,3.38,1.05,-1.57,-5.23,1.04,0,0,-11.17,0.86,20.87,-1.57,20.55,5.71,30,-9.33,31.46,1.55,45.73,-2.37,29.24,3.61,0,0,-3.13,-2.1,0,0,-19.09,-0.3,-27.45,-1.36,-1.04,-5.23,-31.39,-3.57,-4.04,3.79,3.55,1.94,30.08,-5.96,27.21,-6.75,35.34,-15.49,9.39,0.9,20.7,2.38,8.21,4.75,0.92,0.36,3.17,4.07,-5.93,-0.69,-13.37,5.81,-15.02,2.54]},{"duration":60,"tweenEasing":0,"offset":65},{"offset":34,"value":[8.14,5.12,16.03,0.91,14.7,0.95,13.36,0.98,0,0,0,0,0,0,0,0,6.16,0.45,0,0,6.7,0.49,0,0,6.53,0.42,0,0,7.02,0.45,4.41,0.28]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_NECK.03","timeline":[{"name":"B_NECK.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_NECK.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_NECK.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NECK.03_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_NECK.03_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_00","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,5.36,21.02,11.28,21.02,16.08,21.02,18.05,21.02,18.67,20.93,20.17,20.72,22.02,20.47,23.69,20.24,0,21.02,4.05,21.03,8.52,21.07,12.14,21.11,13.65,21.13,13.43,21.05,13.16,20.87,12.85,20.65,12.56,20.47,0,21.02,2.75,21.06,5.78,21.16,8.25,21.26,9.31,21.31,8.15,21.24,5.99,21.06,3.42,20.87,1.06,20.72,0,21.02,1.42,21.07,2.98,21.18,4.26,21.29,4.83,21.35,2.94,21.29,-0.89,21.16,-5.49,21.02,-9.71,20.93,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,-2.04,21.02,-6.98,21.02,-13.09,21.02,-18.62,21.02,0,21.02,-5.67,20.97,-11.83,20.85,-17.01,20.74,-19.71,20.69,-20.13,20.69,-21.13,20.69,-22.35,20.69,-23.46,20.69,0,21.02,-10.87,20.93,-22.72,20.72,-32.62,20.52,-37.66,20.43,-35.93,20.48,-32.42,20.58,-28.2,20.68,-24.33,20.72,0,21.02,-15.44,20.93,-32.35,20.74,-46.33,20.55,-53,20.47,-49.4,20.54,-41.64,20.69,-32.21,20.84,-23.62,20.91,0,21.02,-19.26,21.02,-40.55,21.02,-57.78,21.02,-64.88,21.02,-60.37,21.02,-49.43,21.02,-35.92,21.02,-23.69,21.02]},{"duration":60,"tweenEasing":0,"offset":2,"value":[5.36,0,11.28,0,16.08,0,18.05,0,18.67,-0.09,20.17,-0.29,22.02,-0.55,23.69,-0.78,0,0,4.05,0.02,8.52,0.05,12.14,0.09,13.65,0.11,13.43,0.03,13.16,-0.15,12.85,-0.36,12.56,-0.55,0,0,2.75,0.05,5.78,0.15,8.25,0.25,9.31,0.29,8.15,0.22,5.99,0.05,3.42,-0.15,1.06,-0.29,0,0,1.42,0.05,2.98,0.16,4.26,0.28,4.83,0.33,2.94,0.27,-0.89,0.15,-5.49,0.01,-9.71,-0.09,0,0,0,0,0,0,0,0,0,0,-2.04,0,-6.98,0,-13.09,0,-18.62,0,0,0,-5.67,-0.05,-11.83,-0.16,-17.01,-0.28,-19.71,-0.33,-20.13,-0.33,-21.13,-0.33,-22.35,-0.33,-23.46,-0.33,0,0,-10.87,-0.09,-22.72,-0.29,-32.62,-0.49,-37.66,-0.58,-35.93,-0.54,-32.42,-0.44,-28.2,-0.34,-24.33,-0.29,0,0,-15.44,-0.09,-32.35,-0.27,-46.33,-0.46,-53,-0.55,-49.4,-0.48,-41.64,-0.33,-32.21,-0.18,-23.62,-0.11,0,0,-19.26,0,-40.55,0,-57.78,0,-64.88,0,-60.37,0,-49.43,0,-35.92,0,-23.69]},{"offset":1,"value":[-11.29,5.36,-11.29,11.28,-11.29,16.08,-11.29,18.05,-11.29,18.67,-11.37,20.17,-11.58,22.02,-11.83,23.69,-12.07,1,-7.82,4.75,-8.76,8.91,-9.86,12.28,-10.79,13.65,-11.18,13.52,-10.96,13.42,-10.43,13.33,-9.8,13.23,-9.29,2.12,-3.99,4.25,-5.9,6.63,-8.22,8.55,-10.17,9.31,-10.99,8.34,-10.43,6.55,-9.09,4.43,-7.51,2.47,-6.23,3.01,-0.89,3.56,-3.69,4.17,-7.02,4.66,-9.79,4.83,-10.96,3.21,-10.12,-0.09,-8.12,-4.06,-5.74,-7.7,-3.75,3.38,0.39,2.38,-3.08,1.27,-6.91,0.37,-10.01,0,-11.29,-1.79,-10.35,-6.14,-8.08,-11.5,-5.27,-16.36,-2.72,3.01,-0.89,-3.51,-3.76,-10.63,-7.32,-16.61,-10.34,-19.71,-11.62,-19.87,-10.72,-20.33,-8.61,-20.92,-6.09,-21.45,-3.99,2.12,-3.99,-9.35,-6.01,-21.85,-8.63,-32.31,-10.9,-37.66,-11.87,-35.74,-11.19,-31.86,-9.59,-27.19,-7.72,-22.92,-6.23,1,-7.82,-14.73,-8.84,-31.94,-10.18,-46.18,-11.34,-53,-11.83,-49.32,-11.47,-41.38,-10.62,-31.73,-9.63,-22.95,-8.85,0,-11.29,-19.26,-11.29,-40.55,-11.29,-57.78,-11.29,-64.88,-11.29,-60.37,-11.29,-49.43,-11.29,-35.92,-11.29,-23.69,-11.29]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_01","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,5.36,21.02,11.28,21.02,16.08,21.02,18.05,21.02,18.67,20.93,20.17,20.72,22.02,20.47,23.69,20.24,0,21.02,4.05,21.03,8.52,21.07,12.14,21.11,13.65,21.13,14.16,21.05,15.34,20.87,16.78,20.65,18.09,20.47,0,21.02,2.75,21.06,5.78,21.16,8.25,21.26,9.31,21.31,9.76,21.24,10.65,21.07,11.71,20.87,12.69,20.72,0,21.02,1.42,21.07,2.98,21.18,4.26,21.29,4.83,21.35,5.14,21.29,5.68,21.16,6.3,21.02,6.88,20.93,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,-4.08,20.91,-8.53,20.69,-12.23,20.46,-14,20.36,-13.13,20.41,-11.25,20.52,-8.96,20.64,-6.88,20.69,0,21.02,-7.71,20.93,-16.19,20.72,-23.13,20.52,-26.23,20.43,-24.68,20.48,-21.09,20.58,-16.69,20.68,-12.69,20.72,0,21.02,-11.18,20.98,-23.52,20.91,-33.54,20.83,-37.76,20.8,-35.58,20.81,-30.36,20.85,-23.92,20.89,-18.09,20.91,0,21.02,-14.74,21.02,-31.03,21.02,-44.22,21.02,-49.65,21.02,-46.81,21.02,-39.91,21.02,-31.4,21.02,-23.69,21.02]},{"duration":60,"tweenEasing":0,"offset":2,"value":[5.36,0,11.28,0,16.08,0,18.05,0,18.67,-0.09,20.17,-0.29,22.02,-0.55,23.69,-0.78,0,0,4.05,0.02,8.52,0.05,12.14,0.09,13.65,0.11,14.16,0.03,15.34,-0.15,16.78,-0.36,18.09,-0.55,0,0,2.75,0.05,5.78,0.15,8.25,0.25,9.31,0.29,9.76,0.22,10.65,0.05,11.71,-0.15,12.69,-0.29,0,0,1.42,0.05,2.98,0.16,4.26,0.28,4.83,0.33,5.14,0.27,5.68,0.15,6.3,0.01,6.88,-0.09,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-4.08,-0.1,-8.53,-0.33,-12.23,-0.55,-14,-0.66,-13.13,-0.61,-11.25,-0.49,-8.96,-0.38,-6.88,-0.33,0,0,-7.71,-0.09,-16.19,-0.29,-23.13,-0.49,-26.23,-0.58,-24.68,-0.54,-21.09,-0.44,-16.69,-0.34,-12.69,-0.29,0,0,-11.18,-0.03,-23.52,-0.11,-33.54,-0.18,-37.76,-0.22,-35.58,-0.2,-30.36,-0.16,-23.92,-0.13,-18.09,-0.11,0,0,-14.74,0,-31.03,0,-44.22,0,-49.65,0,-46.81,0,-39.91,0,-31.4,0,-23.69]},{"offset":1,"value":[-11.29,5.36,-11.29,11.28,-11.29,16.08,-11.29,18.05,-11.29,18.67,-11.37,20.17,-11.58,22.02,-11.83,23.69,-12.07,1,-7.82,4.75,-8.76,8.91,-9.86,12.28,-10.79,13.65,-11.18,14.11,-10.96,15.21,-10.43,16.55,-9.81,17.75,-9.29,2.12,-3.99,4.25,-5.9,6.63,-8.22,8.55,-10.17,9.31,-10.99,9.66,-10.43,10.37,-9.1,11.22,-7.52,11.99,-6.23,3.01,-0.89,3.56,-3.69,4.17,-7.02,4.66,-9.79,4.83,-10.96,5.01,-10.12,5.28,-8.13,5.59,-5.75,5.87,-3.75,3.38,0.39,2.38,-3.08,1.27,-6.91,0.37,-10.01,0,-11.29,-0.12,-10.35,-0.42,-8.08,-0.79,-5.27,-1.13,-2.72,3.01,-0.89,-1.92,-3.83,-7.34,-7.5,-11.83,-10.62,-14,-11.94,-13.26,-11,-11.65,-8.77,-9.68,-6.14,-7.88,-3.99,2.12,-3.99,-6.2,-6.03,-15.33,-8.65,-22.83,-10.91,-26.23,-11.87,-24.78,-11.19,-21.37,-9.59,-17.19,-7.71,-13.4,-6.23,1,-7.82,-10.47,-8.8,-23.11,-10.03,-33.39,-11.07,-37.76,-11.51,-35.63,-11.19,-30.49,-10.45,-24.15,-9.57,-18.42,-8.85,0,-11.29,-14.74,-11.29,-31.03,-11.29,-44.22,-11.29,-49.65,-11.29,-46.81,-11.29,-39.91,-11.29,-31.4,-11.29,-23.69,-11.29]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_02","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,1,-7.82,0.71,-8.77,0.4,-9.92,0.14,-10.88,0,-11.29,-0.05,-10.99,-0.13,-10.28,-0.23,-9.44,-0.33,-8.74,2.12,-3.99,1.5,-5.95,0.85,-8.37,0.3,-10.42,0,-11.29,-0.1,-10.65,-0.28,-9.15,-0.5,-7.37,-0.71,-5.94,3.01,-0.89,2.14,-3.74,1.19,-7.18,0.4,-10.07,0,-11.29,-0.13,-10.4,-0.4,-8.28,-0.71,-5.75,-1,-3.66,3.38,0.39,2.38,-3.08,1.27,-6.91,0.37,-10.01,0,-11.29,-0.12,-10.35,-0.42,-8.08,-0.79,-5.27,-1.13,-2.72,3.01,-0.89,2.14,-3.74,1.19,-7.18,0.4,-10.07,0,-11.29,-0.13,-10.4,-0.4,-8.28,-0.71,-5.75,-1,-3.66,2.12,-3.99,1.5,-5.95,0.85,-8.37,0.3,-10.42,0,-11.29,-0.1,-10.65,-0.28,-9.15,-0.5,-7.37,-0.71,-5.94,1,-7.82,0.71,-8.77,0.4,-9.92,0.14,-10.88,0,-11.29,-0.05,-10.99,-0.13,-10.28,-0.23,-9.44,-0.33,-8.74,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_03","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,1.34,21.02,1.24,21.02,1.14,21.02,1.05,21.02,1,21.02,1.82,21.02,1.86,21.02,1.23,21.02,0,21.02,2.82,21.02,2.62,21.02,2.4,21.02,2.21,21.02,2.12,21.02,3.71,21.02,3.77,21.02,2.48,21.02,0,21.02,4.02,21.02,3.73,21.02,3.41,21.02,3.15,21.02,3.01,21.02,5.45,21.02,5.58,21.02,3.68,21.02,0,21.02,4.51,21.02,4.18,21.02,3.81,21.02,3.51,21.02,3.38,21.02,6.8,21.02,7.14,21.02,4.75,21.02,0,21.02,12.61,21.84,12.61,21.76,12.62,21.71,12.62,21.68,12.57,21.67,14.52,21.63,13.59,21.53,10.41,21.44,5.57,21.43,20.17,22.18,20.6,21.98,21.08,21.8,21.46,21.66,21.58,21.6,22.3,21.58,20.34,21.55,16.57,21.55,11.85,21.6,27.52,22.33,28.41,22,29.41,21.64,30.2,21.35,30.52,21.24,30.1,21.28,27.19,21.38,22.92,21.52,18.41,21.67,34.98,22.57,36.32,22.11,37.8,21.6,39,21.19,39.49,21.02,37.89,21.1,33.99,21.31,29.18,21.56,24.82,21.8]},{"duration":60,"tweenEasing":0,"offset":18,"value":[1.34,0,1.24,0,1.14,0,1.05,0,1,0,1.82,0,1.86,0,1.23,0,0,0,2.82,0,2.62,0,2.4,0,2.21,0,2.12,0,3.71,0,3.77,0,2.48,0,0,0,4.02,0,3.73,0,3.41,0,3.15,0,3.01,0,5.45,0,5.58,0,3.68,0,0,0,4.51,0,4.18,0,3.81,0,3.51,0,3.38,0,6.8,0,7.14,0,4.75,0,0,0,12.61,0.83,12.61,0.75,12.62,0.69,12.62,0.67,12.57,0.66,14.52,0.61,13.59,0.51,10.41,0.42,5.57,0.41,20.17,1.17,20.6,0.97,21.08,0.78,21.46,0.64,21.58,0.58,22.3,0.57,20.34,0.54,16.57,0.53,11.85,0.58,27.52,1.31,28.41,0.98,29.41,0.62,30.2,0.34,30.52,0.22,30.1,0.26,27.19,0.36,22.92,0.51,18.41,0.66,34.98,1.56,36.32,1.09,37.8,0.58,39,0.17,39.49,0,37.89,0.09,33.99,0.29,29.18,0.55,24.82,0.78]},{"offset":1,"value":[-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,2.34,-7.82,1.95,-8.77,1.53,-9.92,1.19,-10.88,1,-11.29,1.77,-10.99,1.73,-10.28,0.99,-9.44,-0.33,-8.74,4.94,-3.99,4.12,-5.95,3.24,-8.36,2.51,-10.42,2.12,-11.29,3.61,-10.65,3.49,-9.14,1.98,-7.37,-0.71,-5.94,7.03,-0.89,5.87,-3.74,4.6,-7.18,3.54,-10.07,3.01,-11.29,5.32,-10.4,5.18,-8.27,2.96,-5.75,-1,-3.66,7.9,0.39,6.56,-3.08,5.08,-6.91,3.88,-10.01,3.38,-11.29,6.68,-10.35,6.72,-8.08,3.96,-5.27,-1.13,-2.72,15.62,-0.06,14.75,-2.99,13.81,-6.48,13.01,-9.41,12.57,-10.63,14.38,-9.78,13.19,-7.76,9.69,-5.33,4.57,-3.25,22.28,-2.82,22.11,-4.98,21.93,-7.59,21.76,-9.78,21.58,-10.7,22.19,-10.08,20.05,-8.61,16.06,-6.84,11.14,-5.35,28.53,-6.51,29.12,-7.79,29.8,-9.3,30.34,-10.55,30.52,-11.07,30.05,-10.73,27.06,-9.92,22.69,-8.94,18.07,-8.09,34.98,-9.73,36.32,-10.19,37.8,-10.7,39,-11.12,39.49,-11.29,37.89,-11.2,33.99,-10.99,29.18,-10.74,24.82,-10.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_04","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,6.87,21.02,5.17,21.02,3.32,21.02,1.78,21.02,1,21.02,1.82,21.02,1.86,21.02,1.23,21.02,0,21.02,14.46,21.02,10.92,21.02,7.07,21.02,3.83,21.02,2.12,21.02,3.71,21.02,3.77,21.02,2.48,21.02,0,21.02,20.6,21.02,15.52,21.02,9.99,21.02,5.37,21.02,3.01,21.02,5.45,21.02,5.58,21.02,3.68,21.02,0,21.02,23.13,21.02,17.27,21.02,10.79,21.02,5.54,21.02,3.38,21.02,6.8,21.02,7.14,21.02,4.75,21.02,0,21.02,29.19,21.84,24.4,21.76,19.2,21.71,14.84,21.68,12.57,21.67,14.52,21.63,13.59,21.53,10.41,21.44,5.57,21.43,31.8,22.18,28.9,21.99,25.76,21.8,23.08,21.66,21.58,21.6,22.3,21.58,20.34,21.55,16.57,21.55,11.85,21.6,33.05,22.33,32.34,22,31.59,21.64,30.93,21.35,30.52,21.24,30.1,21.28,27.19,21.38,22.92,21.52,18.41,21.67,34.98,22.57,36.32,22.11,37.8,21.6,39,21.19,39.49,21.02,37.89,21.1,33.99,21.31,29.18,21.56,24.82,21.8]},{"duration":60,"tweenEasing":0,"offset":18,"value":[3.85,0.35,3.03,0.25,2.13,0.14,1.38,0.04,1,0,1.82,0,1.86,0,1.23,0,0,0,8.11,0.73,6.39,0.53,4.52,0.29,2.94,0.09,2.12,0,3.71,0,3.77,0,2.48,0,0,0,11.56,1.04,9.09,0.76,6.39,0.41,4.15,0.12,3.01,0,5.45,0,5.58,0,3.68,0,0,0,12.98,1.17,10.13,0.82,6.98,0.44,4.43,0.13,3.38,0,6.8,0,7.14,0,4.75,0,0,0,20.14,1.87,17.97,1.5,15.61,1.11,13.62,0.79,12.57,0.66,14.52,0.61,13.59,0.51,10.41,0.42,5.57,0.41,25.46,1.9,24.37,1.5,23.2,1.07,22.19,0.73,21.58,0.58,22.3,0.57,20.34,0.54,16.57,0.53,11.85,0.58,30.03,1.66,30.2,1.23,30.4,0.76,30.53,0.38,30.52,0.22,30.1,0.26,27.19,0.36,22.92,0.51,18.41,0.66,34.98,1.56,36.32,1.09,37.8,0.58,39,0.17,39.49,0,37.89,0.09,33.99,0.29,29.18,0.55,24.82,0.78]},{"offset":1,"value":[-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,3.85,-7.82,3.02,-8.77,2.13,-9.92,1.39,-10.88,1,-11.29,1.77,-10.99,1.73,-10.28,0.99,-9.44,-0.33,-8.74,8.11,-3.99,6.38,-5.94,4.52,-8.36,2.95,-10.42,2.12,-11.29,3.61,-10.65,3.49,-9.14,1.98,-7.37,-0.71,-5.94,11.56,-0.89,9.09,-3.73,6.39,-7.17,4.15,-10.07,3.01,-11.29,5.32,-10.4,5.18,-8.27,2.96,-5.75,-1,-3.66,12.98,0.39,10.13,-3.08,6.98,-6.91,4.43,-10.01,3.38,-11.29,6.68,-10.35,6.72,-8.08,3.96,-5.27,-1.13,-2.72,20.14,-0.06,17.97,-2.99,15.61,-6.48,13.62,-9.4,12.57,-10.63,14.38,-9.78,13.19,-7.76,9.69,-5.33,4.57,-3.25,25.46,-2.82,24.37,-4.98,23.2,-7.58,22.2,-9.78,21.58,-10.7,22.19,-10.08,20.05,-8.61,16.06,-6.84,11.14,-5.35,30.03,-6.51,30.19,-7.79,30.4,-9.3,30.54,-10.55,30.52,-11.07,30.05,-10.73,27.06,-9.92,22.69,-8.94,18.07,-8.09,34.98,-9.73,36.32,-10.19,37.8,-10.7,39,-11.12,39.49,-11.29,37.89,-11.2,33.99,-10.99,29.18,-10.74,24.82,-10.51]}]}]}],"canvas":{"y":-690,"width":1280,"height":1380}}],"textureAtlas":[{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_00.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_00"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_01.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_01"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_02.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_02"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_03.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_03"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_04.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_04"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/shizuku/shizuku_ske.json.meta b/Cocos/Demos/assets/resources/shizuku/shizuku_ske.json.meta new file mode 100644 index 00000000..266dfd89 --- /dev/null +++ b/Cocos/Demos/assets/resources/shizuku/shizuku_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "de33b25c-c668-492e-88a9-b6e979d4830d", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/skin_1502b.meta b/Cocos/Demos/assets/resources/skin_1502b.meta new file mode 100644 index 00000000..94b70a24 --- /dev/null +++ b/Cocos/Demos/assets/resources/skin_1502b.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "4d9f345f-d5f0-4c92-ae64-26f5ded00340", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_ske.json b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_ske.json new file mode 100644 index 00000000..96ea6448 --- /dev/null +++ b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_ske.json @@ -0,0 +1 @@ +{"frameRate":24,"name":"skin_1502b","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"skin_a","aabb":{"x":-95.11,"y":-233.81,"width":176.64,"height":281.55},"bone":[{"name":"root"},{"inheritScale":false,"length":20,"name":"foot_l","parent":"root","transform":{"x":62.85,"y":-25,"scX":0.9955}},{"inheritScale":false,"length":40,"name":"thigh_l","parent":"root","transform":{"x":8.3,"y":-133.55,"skX":21.9887,"skY":21.9887,"scX":0.9995,"scY":0.9977}},{"inheritScale":false,"length":42,"name":"thigh_r","parent":"root","transform":{"x":-8.55,"y":-112.45,"skX":69.8809,"skY":69.8854,"scX":0.9876,"scY":0.9979}},{"inheritScale":false,"length":20,"name":"pelvis","parent":"root","transform":{"y":-123.15,"skX":-89.9991,"skY":-89.9991}},{"inheritScale":false,"length":20,"name":"foot_r","parent":"root","transform":{"x":-43.8,"y":-4,"scX":0.9955}},{"inheritScale":false,"length":50,"name":"thigh_1_l","parent":"thigh_l","transform":{"x":40.11,"y":-0.04,"skX":97.9614,"skY":97.9621,"scX":0.9894,"scY":0.9971}},{"inheritScale":false,"length":20,"name":"chest","parent":"pelvis","transform":{"x":13.75,"skX":-90,"skY":-90}},{"inheritScale":false,"length":53,"name":"thigh_1_r","parent":"thigh_r","transform":{"x":41.52,"y":-0.01,"skX":105.4235,"skY":105.423,"scX":0.9984,"scY":0.9995}},{"inheritScale":false,"length":20,"name":"shouder_r","parent":"chest","transform":{"x":13.74,"y":31.28,"scX":0.9965,"scY":0.9969}},{"inheritScale":false,"length":20,"name":"shouder_l","parent":"chest","transform":{"x":-2.41,"y":46.59,"scX":0.9965,"scY":0.9969}},{"inheritRotation":false,"inheritScale":false,"length":100,"name":"effects_b","parent":"chest","transform":{"x":11.65,"y":3.13,"skX":130,"skY":130}},{"inheritScale":false,"length":64,"name":"calf_l","parent":"thigh_1_l","transform":{"x":50.91,"y":0.01,"skX":-70.8583,"skY":-70.864,"scX":1.0149,"scY":0.9967}},{"inheritRotation":false,"inheritScale":false,"length":100,"name":"effects_f","parent":"chest","transform":{"x":-20.82,"y":-13.37,"skX":90,"skY":90}},{"inheritScale":false,"length":66,"name":"calf_r","parent":"thigh_1_r","transform":{"x":53.26,"y":-0.02,"skX":-88.4874,"skY":-88.4933,"scX":0.9852,"scY":0.9996}},{"inheritScale":false,"length":100,"name":"weapon_r","parent":"shouder_r","transform":{"x":5.98,"skX":180,"skY":180,"scX":0.9982,"scY":0.9994}},{"inheritScale":false,"length":100,"name":"weapon_l","parent":"shouder_l","transform":{"x":5.6,"y":0.04,"skX":180,"skY":180,"scX":0.998,"scY":0.9993}}],"slot":[{"name":"shouder_l","parent":"shouder_l"},{"name":"foot_l","parent":"foot_l"},{"name":"thigh_1_l","parent":"thigh_1_l"},{"name":"calf_l","parent":"calf_l"},{"name":"thigh_l","parent":"thigh_l"},{"name":"pelvis","parent":"pelvis"},{"name":"chest","parent":"chest"},{"name":"foot_r","parent":"foot_r"},{"name":"thigh_1_r","parent":"thigh_1_r"},{"name":"calf_r","parent":"calf_r"},{"name":"thigh_r","parent":"thigh_r"},{"name":"shouder_r","parent":"shouder_r"}],"ik":[{"bendPositive":false,"chain":1,"name":"calf_l","bone":"calf_l","target":"foot_l"},{"bendPositive":false,"chain":1,"name":"calf_r","bone":"calf_r","target":"foot_r"}],"skin":[{"name":"","slot":[{"name":"calf_r","display":[{"name":"mecha_1003_folder/calf_r_0","transform":{"x":27.79,"y":1.87}}]},{"name":"thigh_l","display":[{"name":"mecha_1003d_folder/thigh_l_0","transform":{"x":19.18,"y":2.88}}]},{"name":"shouder_r","display":[{"name":"mecha_1002_folder/upperarm_r_2","transform":{"y":2.57,"skX":-99.69,"skY":-99.69}}]},{"name":"chest","display":[{"name":"mecha_1004_folder/chest_1","transform":{"x":-8.78,"y":46.41,"skX":89.57,"skY":89.57}}]},{"name":"foot_l","display":[{"name":"mecha_1004d_folder/foot_l_0","transform":{"x":2.31,"y":7.74,"skX":90,"skY":90}}]},{"name":"thigh_1_r","display":[{"name":"mecha_1502b_folder/thigh_1_r_1","transform":{"x":21.55,"y":-1.9,"skX":0.44,"skY":0.44}}]},{"name":"calf_l","display":[{"name":"mecha_1003_folder/calf_l_0","transform":{"x":26.86,"y":4.15}}]},{"name":"thigh_r","display":[{"name":"mecha_1003d_folder/thigh_r_0","transform":{"x":15.04,"y":-7.6}}]},{"name":"pelvis","display":[{"name":"mecha_1502b_folder/pelvis","transform":{"x":3.5,"y":7.5}}]},{"name":"shouder_l","display":[{"name":"mecha_1002_folder/upperarm_l_2","transform":{"x":-0.86,"y":-3.85,"skX":-105.8,"skY":-105.8}}]},{"name":"foot_r","display":[{"name":"mecha_1004d_folder/foot_r_1","transform":{"x":2.57,"y":9.25,"skX":90,"skY":90}}]},{"name":"thigh_1_l","display":[{"name":"mecha_1502b_folder/thigh_1_l_0","transform":{"x":23,"y":-2.95,"skX":0.11,"skY":0.11}}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"empty"}],"defaultActions":[{"gotoAndPlay":"empty"}]},{"type":"Armature","frameRate":24,"name":"skin_b","aabb":{"x":-95.36,"y":-159.15,"width":181.68,"height":216.21},"bone":[{"name":"root"},{"inheritScale":false,"length":20,"name":"foot_l","parent":"root","transform":{"x":62.85,"y":-25,"scX":0.9955}},{"inheritScale":false,"length":40,"name":"thigh_l","parent":"root","transform":{"x":8.3,"y":-133.55,"skX":21.9887,"skY":21.9887,"scX":0.9995,"scY":0.9977}},{"inheritScale":false,"length":42,"name":"thigh_r","parent":"root","transform":{"x":-8.55,"y":-112.45,"skX":69.8809,"skY":69.8854,"scX":0.9876,"scY":0.9979}},{"inheritScale":false,"length":20,"name":"pelvis","parent":"root","transform":{"y":-123.15,"skX":-89.9991,"skY":-89.9991}},{"inheritScale":false,"length":20,"name":"foot_r","parent":"root","transform":{"x":-43.8,"y":-4,"scX":0.9955}},{"inheritScale":false,"length":50,"name":"thigh_1_l","parent":"thigh_l","transform":{"x":40.11,"y":-0.04,"skX":97.9614,"skY":97.9621,"scX":0.9894,"scY":0.9971}},{"inheritScale":false,"length":20,"name":"chest","parent":"pelvis","transform":{"x":13.75,"skX":-90,"skY":-90}},{"inheritScale":false,"length":53,"name":"thigh_1_r","parent":"thigh_r","transform":{"x":41.52,"y":-0.01,"skX":105.4235,"skY":105.423,"scX":0.9984,"scY":0.9995}},{"inheritScale":false,"length":20,"name":"shouder_r","parent":"chest","transform":{"x":13.74,"y":31.28,"scX":0.9965,"scY":0.9969}},{"inheritScale":false,"length":20,"name":"shouder_l","parent":"chest","transform":{"x":-2.41,"y":46.59,"scX":0.9965,"scY":0.9969}},{"inheritRotation":false,"inheritScale":false,"length":100,"name":"effects_b","parent":"chest","transform":{"x":11.65,"y":3.13,"skX":130,"skY":130}},{"inheritScale":false,"length":64,"name":"calf_l","parent":"thigh_1_l","transform":{"x":50.91,"y":0.01,"skX":-70.8583,"skY":-70.864,"scX":1.0149,"scY":0.9967}},{"inheritRotation":false,"inheritScale":false,"length":100,"name":"effects_f","parent":"chest","transform":{"x":-20.82,"y":-13.37,"skX":90,"skY":90}},{"inheritScale":false,"length":66,"name":"calf_r","parent":"thigh_1_r","transform":{"x":53.26,"y":-0.02,"skX":-88.4874,"skY":-88.4933,"scX":0.9852,"scY":0.9996}},{"inheritScale":false,"length":100,"name":"weapon_r","parent":"shouder_r","transform":{"x":5.98,"skX":180,"skY":180,"scX":0.9982,"scY":0.9994}},{"inheritScale":false,"length":100,"name":"weapon_l","parent":"shouder_l","transform":{"x":5.6,"y":0.04,"skX":180,"skY":180,"scX":0.998,"scY":0.9993}}],"slot":[{"name":"foot_l","parent":"foot_l"},{"name":"thigh_1_l","parent":"thigh_1_l"},{"name":"calf_l","parent":"calf_l"},{"name":"thigh_l","parent":"thigh_l"},{"name":"pelvis","parent":"pelvis"},{"name":"foot_r","parent":"foot_r"},{"name":"thigh_1_r","parent":"thigh_1_r"},{"name":"calf_r","parent":"calf_r"},{"name":"thigh_r","parent":"thigh_r"}],"ik":[{"bendPositive":false,"chain":1,"name":"calf_l","bone":"calf_l","target":"foot_l"},{"bendPositive":false,"chain":1,"name":"calf_r","bone":"calf_r","target":"foot_r"}],"skin":[{"name":"","slot":[{"name":"calf_r","display":[{"name":"mecha_1003_folder/calf_r_0","transform":{"x":27.57,"y":2.12}}]},{"name":"thigh_r","display":[{"name":"mecha_1008d_folder/thigh_r_0","transform":{"x":21.88,"y":0.81}}]},{"name":"foot_r","display":[{"name":"mecha_1003_folder/foot_r_0","transform":{"y":10.56,"skX":90,"skY":90}}]},{"name":"thigh_l","display":[{"name":"mecha_1008d_folder/thigh_l_0","transform":{"x":21.27,"y":-0.79}}]},{"name":"calf_l","display":[{"name":"mecha_1003_folder/calf_l_0","transform":{"x":25.8,"y":3.8}}]},{"name":"thigh_1_r","display":[{"name":"mecha_1502b_folder/thigh_1_r_1","transform":{"x":21.55,"y":-1.9,"skX":0.44,"skY":0.44}}]},{"name":"thigh_1_l","display":[{"name":"mecha_1502b_folder/thigh_1_l_0","transform":{"x":23,"y":-2.95,"skX":0.11,"skY":0.11}}]},{"name":"pelvis","display":[{"name":"mecha_1502b_folder/pelvis","transform":{"x":3.5,"y":7.5}}]},{"name":"foot_l","display":[{"name":"mecha_1003_folder/foot_l_0","transform":{"x":-0.28,"y":10.13,"skX":90,"skY":90}}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]},{"type":"Armature","frameRate":24,"name":"skin_c","aabb":{"x":-95.92,"y":-280.98,"width":187.45,"height":328.63},"bone":[{"name":"root"},{"inheritScale":false,"length":20,"name":"foot_l","parent":"root","transform":{"x":62.85,"y":-25,"scX":0.9955}},{"inheritScale":false,"length":40,"name":"thigh_l","parent":"root","transform":{"x":8.3,"y":-133.55,"skX":21.9887,"skY":21.9887,"scX":0.9995,"scY":0.9977}},{"inheritScale":false,"length":42,"name":"thigh_r","parent":"root","transform":{"x":-8.55,"y":-112.45,"skX":69.8809,"skY":69.8854,"scX":0.9876,"scY":0.9979}},{"inheritScale":false,"length":20,"name":"pelvis","parent":"root","transform":{"y":-123.15,"skX":-89.9991,"skY":-89.9991}},{"inheritScale":false,"length":20,"name":"foot_r","parent":"root","transform":{"x":-43.8,"y":-4,"scX":0.9955}},{"inheritScale":false,"length":50,"name":"thigh_1_l","parent":"thigh_l","transform":{"x":40.11,"y":-0.04,"skX":97.9614,"skY":97.9621,"scX":0.9894,"scY":0.9971}},{"inheritScale":false,"length":20,"name":"chest","parent":"pelvis","transform":{"x":13.75,"skX":-90,"skY":-90}},{"inheritScale":false,"length":53,"name":"thigh_1_r","parent":"thigh_r","transform":{"x":41.52,"y":-0.01,"skX":105.4235,"skY":105.423,"scX":0.9984,"scY":0.9995}},{"inheritScale":false,"length":20,"name":"shouder_r","parent":"chest","transform":{"x":13.74,"y":31.28,"scX":0.9965,"scY":0.9969}},{"inheritScale":false,"length":20,"name":"shouder_l","parent":"chest","transform":{"x":-2.41,"y":46.59,"scX":0.9965,"scY":0.9969}},{"inheritRotation":false,"inheritScale":false,"length":100,"name":"effects_b","parent":"chest","transform":{"x":11.65,"y":3.13,"skX":130,"skY":130}},{"inheritScale":false,"length":64,"name":"calf_l","parent":"thigh_1_l","transform":{"x":50.91,"y":0.01,"skX":-70.8583,"skY":-70.864,"scX":1.0149,"scY":0.9967}},{"inheritRotation":false,"inheritScale":false,"length":100,"name":"effects_f","parent":"chest","transform":{"x":-20.82,"y":-13.37,"skX":90,"skY":90}},{"inheritScale":false,"length":66,"name":"calf_r","parent":"thigh_1_r","transform":{"x":53.26,"y":-0.02,"skX":-88.4874,"skY":-88.4933,"scX":0.9852,"scY":0.9996}},{"inheritScale":false,"length":100,"name":"weapon_r","parent":"shouder_r","transform":{"x":5.98,"skX":180,"skY":180,"scX":0.9982,"scY":0.9994}},{"inheritScale":false,"length":100,"name":"weapon_l","parent":"shouder_l","transform":{"x":5.6,"y":0.04,"skX":180,"skY":180,"scX":0.998,"scY":0.9993}}],"slot":[{"name":"shouder_l","parent":"shouder_l"},{"name":"foot_l","parent":"foot_l"},{"name":"thigh_1_l","parent":"thigh_1_l"},{"name":"calf_l","parent":"calf_l"},{"name":"thigh_l","parent":"thigh_l"},{"name":"pelvis","parent":"pelvis"},{"name":"chest","parent":"chest"},{"name":"foot_r","parent":"foot_r"},{"name":"thigh_1_r","parent":"thigh_1_r"},{"name":"calf_r","parent":"calf_r"},{"name":"thigh_r","parent":"thigh_r"},{"name":"shouder_r","parent":"shouder_r"}],"ik":[{"bendPositive":false,"chain":1,"name":"calf_l","bone":"calf_l","target":"foot_l"},{"bendPositive":false,"chain":1,"name":"calf_r","bone":"calf_r","target":"foot_r"}],"skin":[{"name":"","slot":[{"name":"calf_l","display":[{"name":"mecha_1003d_folder/calf_l_0","transform":{"x":27.69,"y":1.89}}]},{"name":"thigh_1_r","display":[{"name":"mecha_1502b_folder/thigh_1_r_1","transform":{"x":21.55,"y":-1.9,"skX":0.44,"skY":0.44}}]},{"name":"foot_l","display":[{"name":"mecha_1007d_folder/foot_l_1","transform":{"x":6.2,"y":9.64,"skX":90,"skY":90}}]},{"name":"chest","display":[{"name":"mecha_1004d_folder/chest_1","transform":{"x":-10.03,"y":52.08,"skX":90,"skY":90}}]},{"name":"shouder_r","display":[{"name":"mecha_1004d_folder/shouder_r_2","transform":{"x":-5.42,"y":-3.1,"skX":-90,"skY":-90}}]},{"name":"thigh_l","display":[{"name":"mecha_1007d_folder/thigh_l_0","transform":{"x":26.88,"y":-0.45}}]},{"name":"calf_r","display":[{"name":"mecha_1003d_folder/calf_r_0","transform":{"x":29.73,"y":1.3}}]},{"name":"thigh_1_l","display":[{"name":"mecha_1502b_folder/thigh_1_l_0","transform":{"x":23,"y":-2.95,"skX":0.11,"skY":0.11}}]},{"name":"foot_r","display":[{"name":"mecha_1007d_folder/foot_r_0","transform":{"x":7.36,"y":11.15,"skX":90,"skY":90}}]},{"name":"shouder_l","display":[{"name":"mecha_1004d_folder/shouder_l_2","transform":{"x":-7.74,"y":-1.16,"skX":-90,"skY":-90}}]},{"name":"pelvis","display":[{"name":"mecha_1502b_folder/pelvis","transform":{"x":3.5,"y":7.5}}]},{"name":"thigh_r","display":[{"name":"mecha_1007d_folder/thigh_r_0","transform":{"x":22.69,"y":1.64}}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_ske.json.meta b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_ske.json.meta new file mode 100644 index 00000000..f30d61d6 --- /dev/null +++ b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "726de812-eff5-4931-a56b-7a4eeaf750de", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.json b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.json new file mode 100644 index 00000000..2e82d63e --- /dev/null +++ b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.json @@ -0,0 +1 @@ +{"width":512,"SubTexture":[{"width":63,"y":240,"height":42,"name":"mecha_1002_folder/upperarm_l_2","x":121},{"width":29,"y":88,"height":83,"name":"mecha_1004d_folder/foot_l_0","x":360},{"width":50,"y":348,"height":32,"name":"mecha_1502b_folder/thigh_1_l_0","x":101},{"width":92,"y":187,"height":51,"name":"mecha_1003_folder/calf_l_0","x":121},{"frameY":0,"y":449,"frameWidth":103,"frameX":-1,"frameHeight":57,"width":102,"height":56,"name":"mecha_1003d_folder/thigh_l_0","x":308},{"width":41,"y":245,"height":65,"name":"mecha_1502b_folder/pelvis","x":341},{"width":118,"y":187,"height":101,"name":"mecha_1004_folder/chest_1","x":1},{"width":30,"y":1,"height":85,"name":"mecha_1004d_folder/foot_r_1","x":360},{"width":55,"y":478,"height":32,"name":"mecha_1502b_folder/thigh_1_r_1","x":1},{"frameY":-1,"y":346,"frameWidth":95,"frameX":0,"frameHeight":52,"width":95,"height":51,"name":"mecha_1003_folder/calf_r_0","x":208},{"width":105,"y":449,"height":58,"name":"mecha_1003d_folder/thigh_r_0","x":98},{"width":67,"y":399,"height":38,"name":"mecha_1002_folder/upperarm_r_2","x":208},{"width":32,"y":348,"height":98,"name":"mecha_1003_folder/foot_l_0","x":390},{"frameY":0,"y":384,"frameWidth":116,"frameX":-3,"frameHeight":63,"width":108,"height":63,"name":"mecha_1008d_folder/thigh_l_0","x":98},{"width":34,"y":245,"height":101,"name":"mecha_1003_folder/foot_r_0","x":305},{"frameY":0,"y":290,"frameWidth":96,"frameX":-3,"frameHeight":54,"width":92,"height":54,"name":"mecha_1008d_folder/thigh_r_0","x":203},{"width":69,"y":187,"height":56,"name":"mecha_1004d_folder/shouder_l_2","x":289},{"width":40,"y":348,"height":80,"name":"mecha_1007d_folder/foot_l_1","x":348},{"frameY":0,"y":384,"frameWidth":96,"frameX":0,"frameHeight":92,"width":95,"height":92,"name":"mecha_1003d_folder/calf_l_0","x":1},{"width":100,"y":290,"height":56,"name":"mecha_1007d_folder/thigh_l_0","x":101},{"width":163,"y":1,"height":184,"name":"mecha_1004d_folder/chest_1","x":1},{"width":41,"y":348,"height":81,"name":"mecha_1007d_folder/foot_r_0","x":305},{"width":98,"y":290,"height":92,"name":"mecha_1003d_folder/calf_r_0","x":1},{"width":101,"y":449,"height":58,"name":"mecha_1007d_folder/thigh_r_0","x":205},{"width":72,"y":187,"height":59,"name":"mecha_1004d_folder/shouder_r_2","x":215}],"height":512,"name":"skin_1502b","imagePath":"skin_1502b_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.json.meta b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.json.meta new file mode 100644 index 00000000..1578e9e3 --- /dev/null +++ b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "ed576eab-c20d-4329-961c-4de4c9188a18", + "atlasJson": "{\"width\":512,\"SubTexture\":[{\"width\":63,\"y\":240,\"height\":42,\"name\":\"mecha_1002_folder/upperarm_l_2\",\"x\":121},{\"width\":29,\"y\":88,\"height\":83,\"name\":\"mecha_1004d_folder/foot_l_0\",\"x\":360},{\"width\":50,\"y\":348,\"height\":32,\"name\":\"mecha_1502b_folder/thigh_1_l_0\",\"x\":101},{\"width\":92,\"y\":187,\"height\":51,\"name\":\"mecha_1003_folder/calf_l_0\",\"x\":121},{\"frameY\":0,\"y\":449,\"frameWidth\":103,\"frameX\":-1,\"frameHeight\":57,\"width\":102,\"height\":56,\"name\":\"mecha_1003d_folder/thigh_l_0\",\"x\":308},{\"width\":41,\"y\":245,\"height\":65,\"name\":\"mecha_1502b_folder/pelvis\",\"x\":341},{\"width\":118,\"y\":187,\"height\":101,\"name\":\"mecha_1004_folder/chest_1\",\"x\":1},{\"width\":30,\"y\":1,\"height\":85,\"name\":\"mecha_1004d_folder/foot_r_1\",\"x\":360},{\"width\":55,\"y\":478,\"height\":32,\"name\":\"mecha_1502b_folder/thigh_1_r_1\",\"x\":1},{\"frameY\":-1,\"y\":346,\"frameWidth\":95,\"frameX\":0,\"frameHeight\":52,\"width\":95,\"height\":51,\"name\":\"mecha_1003_folder/calf_r_0\",\"x\":208},{\"width\":105,\"y\":449,\"height\":58,\"name\":\"mecha_1003d_folder/thigh_r_0\",\"x\":98},{\"width\":67,\"y\":399,\"height\":38,\"name\":\"mecha_1002_folder/upperarm_r_2\",\"x\":208},{\"width\":32,\"y\":348,\"height\":98,\"name\":\"mecha_1003_folder/foot_l_0\",\"x\":390},{\"frameY\":0,\"y\":384,\"frameWidth\":116,\"frameX\":-3,\"frameHeight\":63,\"width\":108,\"height\":63,\"name\":\"mecha_1008d_folder/thigh_l_0\",\"x\":98},{\"width\":34,\"y\":245,\"height\":101,\"name\":\"mecha_1003_folder/foot_r_0\",\"x\":305},{\"frameY\":0,\"y\":290,\"frameWidth\":96,\"frameX\":-3,\"frameHeight\":54,\"width\":92,\"height\":54,\"name\":\"mecha_1008d_folder/thigh_r_0\",\"x\":203},{\"width\":69,\"y\":187,\"height\":56,\"name\":\"mecha_1004d_folder/shouder_l_2\",\"x\":289},{\"width\":40,\"y\":348,\"height\":80,\"name\":\"mecha_1007d_folder/foot_l_1\",\"x\":348},{\"frameY\":0,\"y\":384,\"frameWidth\":96,\"frameX\":0,\"frameHeight\":92,\"width\":95,\"height\":92,\"name\":\"mecha_1003d_folder/calf_l_0\",\"x\":1},{\"width\":100,\"y\":290,\"height\":56,\"name\":\"mecha_1007d_folder/thigh_l_0\",\"x\":101},{\"width\":163,\"y\":1,\"height\":184,\"name\":\"mecha_1004d_folder/chest_1\",\"x\":1},{\"width\":41,\"y\":348,\"height\":81,\"name\":\"mecha_1007d_folder/foot_r_0\",\"x\":305},{\"width\":98,\"y\":290,\"height\":92,\"name\":\"mecha_1003d_folder/calf_r_0\",\"x\":1},{\"width\":101,\"y\":449,\"height\":58,\"name\":\"mecha_1007d_folder/thigh_r_0\",\"x\":205},{\"width\":72,\"y\":187,\"height\":59,\"name\":\"mecha_1004d_folder/shouder_r_2\",\"x\":215}],\"height\":512,\"name\":\"skin_1502b\",\"imagePath\":\"skin_1502b_tex.png\"}", + "texture": "363d4071-e6a0-4470-b17c-96c1ed4c443a", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.png b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.png new file mode 100644 index 00000000..eb1afbbe Binary files /dev/null and b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.png differ diff --git a/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.png.meta b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.png.meta new file mode 100644 index 00000000..08aad468 --- /dev/null +++ b/Cocos/Demos/assets/resources/skin_1502b/skin_1502b_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "363d4071-e6a0-4470-b17c-96c1ed4c443a", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "skin_1502b_tex": { + "ver": "1.0.3", + "uuid": "bbbc4134-4681-4adb-b931-d6049efd45b8", + "rawTextureUuid": "363d4071-e6a0-4470-b17c-96c1ed4c443a", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -44.5, + "offsetY": 0.5, + "trimX": 1, + "trimY": 1, + "width": 421, + "height": 509, + "rawWidth": 512, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/test.meta b/Cocos/Demos/assets/resources/test.meta new file mode 100644 index 00000000..73b53fe3 --- /dev/null +++ b/Cocos/Demos/assets/resources/test.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "9c2e8e2f-304b-4e17-8f4f-fb3489caecaf", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/test/test_ske.json b/Cocos/Demos/assets/resources/test/test_ske.json new file mode 100644 index 00000000..3d765fdb --- /dev/null +++ b/Cocos/Demos/assets/resources/test/test_ske.json @@ -0,0 +1 @@ +{"frameRate":24,"name":"test","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"test","aabb":{"x":-184.87,"y":-267.79,"width":459,"height":422},"bone":[{"name":"root"}],"slot":[{"name":"head_2","parent":"root"}],"skin":[{"slot":[{"name":"head_2","display":[{"type":"mesh","name":"head_2","width":459,"height":422,"vertices":[-344.12,-298.83,485.53,-311.48,-141.82,190.92,178.93,192.22],"uvs":[0,0,1,0,0,1,1,1],"triangles":[0,1,2,1,3,2],"edges":[0,1,1,3,3,2,2,0],"userEdges":[]}]}]}],"animation":[{"duration":10,"playTimes":0,"name":"test","bone":[{"name":"root","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":4.96,"y":-178.62},{"duration":0}],"scaleFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.62,"y":1.62},{"duration":0}]}]}],"defaultActions":[{"gotoAndPlay":"test"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/test/test_ske.json.meta b/Cocos/Demos/assets/resources/test/test_ske.json.meta new file mode 100644 index 00000000..d0f2b2cf --- /dev/null +++ b/Cocos/Demos/assets/resources/test/test_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "94937b9a-89b1-49d2-866e-b6581c1904d5", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/test/test_tex.json b/Cocos/Demos/assets/resources/test/test_tex.json new file mode 100644 index 00000000..0ca97c92 --- /dev/null +++ b/Cocos/Demos/assets/resources/test/test_tex.json @@ -0,0 +1 @@ +{"width":512,"imagePath":"test_tex.png","height":512,"name":"test","SubTexture":[{"width":459,"y":1,"height":422,"name":"head_2","x":1}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/test/test_tex.json.meta b/Cocos/Demos/assets/resources/test/test_tex.json.meta new file mode 100644 index 00000000..61e13fc1 --- /dev/null +++ b/Cocos/Demos/assets/resources/test/test_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "1b26a3f4-a680-4a22-b8a8-cdb7da968db5", + "atlasJson": "{\"width\":512,\"imagePath\":\"test_tex.png\",\"height\":512,\"name\":\"test\",\"SubTexture\":[{\"width\":459,\"y\":1,\"height\":422,\"name\":\"head_2\",\"x\":1}]}", + "texture": "b5ee19f5-7980-453f-ab9e-2c55d9f3b255", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/test/test_tex.png b/Cocos/Demos/assets/resources/test/test_tex.png new file mode 100644 index 00000000..025213d8 Binary files /dev/null and b/Cocos/Demos/assets/resources/test/test_tex.png differ diff --git a/Cocos/Demos/assets/resources/test/test_tex.png.meta b/Cocos/Demos/assets/resources/test/test_tex.png.meta new file mode 100644 index 00000000..89d70835 --- /dev/null +++ b/Cocos/Demos/assets/resources/test/test_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "b5ee19f5-7980-453f-ab9e-2c55d9f3b255", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "test_tex": { + "ver": "1.0.3", + "uuid": "b45883e7-597f-45e1-a477-f312b6a1d9aa", + "rawTextureUuid": "b5ee19f5-7980-453f-ab9e-2c55d9f3b255", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -25.5, + "offsetY": 44, + "trimX": 1, + "trimY": 1, + "width": 459, + "height": 422, + "rawWidth": 512, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1000.meta b/Cocos/Demos/assets/resources/weapon_1000.meta new file mode 100644 index 00000000..43fc11fc --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1000.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "3e801c9a-49c7-4be9-bcaa-585b08778957", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_ske.json b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_ske.json new file mode 100644 index 00000000..8edb04e9 --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_ske.json @@ -0,0 +1 @@ +{"frameRate":24,"name":"weapon_1000","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"weapon_1005","aabb":{"x":-67,"y":-21,"width":150.05,"height":40},"bone":[{"name":"root"},{"inheritScale":false,"name":"fire","parent":"root","transform":{"x":81,"y":-11}}],"slot":[{"name":"back","parent":"root"},{"name":"front","parent":"root"}],"skin":[{"name":"","slot":[{"name":"back","display":[{"name":"weapon_1005_folder/weapon_r_0","transform":{"x":-29.5,"y":-1}}]},{"name":"front","display":[{"name":"weapon_1005_folder/a_folder/boss_zhl.0001","transform":{"x":42.55,"y":-1.9,"skX":-2,"skY":-2}},{"name":"weapon_1005_folder/a_folder/boss_zhl.0002","transform":{"x":42.55,"y":-1.9,"skX":-2,"skY":-2}},{"name":"weapon_1005_folder/a_folder/boss_zhl.0003","transform":{"x":42.55,"y":-1.9,"skX":-2,"skY":-2}},{"name":"weapon_1005_folder/a_folder/boss_zhl.0004","transform":{"x":42.55,"y":-1.9,"skX":-2,"skY":-2}},{"name":"weapon_1005_folder/a_folder/boss_zhl.0005","transform":{"x":42.55,"y":-1.9,"skX":-2,"skY":-2}}]}]}],"animation":[{"playTimes":0,"name":"idle"},{"duration":5,"playTimes":0,"name":"prepare_01","slot":[{"name":"front","frame":[{},{"displayIndex":1},{"displayIndex":2},{"displayIndex":3},{"displayIndex":4},{"duration":0}],"displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"duration":0}]}]},{"duration":2,"name":"fire_01","frame":[{"duration":0,"events":[{"name":"fire","bone":"fire"}]}],"slot":[{"name":"front","frame":[{},{"displayIndex":2},{"duration":0,"displayIndex":4}],"displayFrame":[{},{"value":2},{"duration":0,"value":4}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":24,"name":"weapon_1005b","aabb":{"x":-76,"y":-32,"width":184.05,"height":60},"bone":[{"name":"root"},{"inheritScale":false,"name":"fire","parent":"root","transform":{"x":104,"y":-13}},{"inheritScale":false,"name":"front","parent":"root","transform":{"x":53,"y":-1.4,"skX":-2.7082,"skY":-2.7082}}],"slot":[{"name":"back","parent":"root"},{"name":"front","parent":"front"}],"skin":[{"name":"","slot":[{"name":"front","display":[{"name":"weapon_1005_folder/b_folder/0","transform":{"x":0.05}},{"name":"weapon_1005_folder/b_folder/1","transform":{"x":0.05}},{"name":"weapon_1005_folder/b_folder/2"},{"name":"weapon_1005_folder/b_folder/3"},{"name":"weapon_1005_folder/b_folder/4","transform":{"y":-0.5}}]},{"name":"back","display":[{"name":"weapon_1005_folder/weapon_r_1","transform":{"x":-23.5,"y":-2}}]}]}],"animation":[{"playTimes":0,"name":"idle"},{"duration":5,"playTimes":0,"name":"prepare_01","bone":[{"name":"front","translateFrame":[{},{"x":-0.5,"y":0.05},{"x":0.1,"y":0.05},{"y":-0.95},{"y":-0.45},{"duration":0}]}],"slot":[{"name":"front","frame":[{},{"displayIndex":1},{"displayIndex":2},{"displayIndex":3},{"displayIndex":4},{"duration":0}],"displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"duration":0}]}]},{"duration":2,"name":"fire_01","frame":[{"duration":0,"events":[{"name":"fire","bone":"fire"}]}],"bone":[{"name":"front","translateFrame":[{},{"x":0.1,"y":0.05},{"duration":0,"y":-0.45}]}],"slot":[{"name":"front","frame":[{},{"displayIndex":2},{"duration":0,"displayIndex":4}],"displayFrame":[{},{"value":2},{"duration":0,"value":4}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":24,"name":"weapon_1005c","aabb":{"x":-83,"y":-34,"width":219.1,"height":64},"bone":[{"name":"root"},{"inheritScale":false,"name":"front","parent":"root","transform":{"x":68.1,"y":-1.4,"skX":-2.4482,"skY":-2.4482}},{"inheritScale":false,"name":"fire","parent":"root","transform":{"x":133,"y":-12}}],"slot":[{"name":"back","parent":"root"},{"name":"front","parent":"front"}],"skin":[{"name":"","slot":[{"name":"back","display":[{"name":"weapon_1005_folder/weapon_r_2","transform":{"x":-29,"y":-2}}]},{"name":"front","display":[{"name":"weapon_1005_folder/c_folder/0","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/1","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/2","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/3","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/4","transform":{"x":0.05,"y":0.05}}]}]}],"animation":[{"playTimes":0,"name":"idle"},{"duration":5,"playTimes":0,"name":"prepare_01","bone":[{"name":"front","translateFrame":[{"duration":2},{"y":-0.5},{"x":-0.05,"y":-0.5},{}]}],"slot":[{"name":"front","frame":[{},{"displayIndex":1},{"displayIndex":2},{"displayIndex":3},{"displayIndex":4},{"duration":0}],"displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"duration":0}]}]},{"duration":2,"name":"fire_01","frame":[{"duration":0,"events":[{"name":"fire","bone":"fire"}]}],"bone":[{"name":"front","translateFrame":[{},{"y":-0.5},{"duration":0}]}],"slot":[{"name":"front","frame":[{},{"displayIndex":2},{"duration":0,"displayIndex":4}],"displayFrame":[{},{"value":2},{"duration":0,"value":4}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":24,"name":"weapon_1005d","aabb":{"x":-139,"y":-40,"width":275.1,"height":69},"bone":[{"name":"root"},{"inheritScale":false,"name":"front","parent":"root","transform":{"x":68.1,"y":-1.4,"skX":-2.4482,"skY":-2.4482}},{"inheritScale":false,"name":"fire","parent":"root","transform":{"x":133,"y":-12}}],"slot":[{"name":"front","parent":"front"},{"name":"back","parent":"root"}],"skin":[{"name":"","slot":[{"name":"back","display":[{"name":"weapon_1005_folder/weapon_r_3","transform":{"x":-38,"y":-5.5}}]},{"name":"front","display":[{"name":"weapon_1005_folder/c_folder/0","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/1","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/2","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/3","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/4","transform":{"x":0.05,"y":0.05}}]}]}],"animation":[{"playTimes":0,"name":"idle"},{"duration":5,"playTimes":0,"name":"prepare_01","bone":[{"name":"front","translateFrame":[{"duration":2},{"y":-0.5},{"x":-0.05,"y":-0.5},{}]}],"slot":[{"name":"front","frame":[{},{"displayIndex":1},{"displayIndex":2},{"displayIndex":3},{"displayIndex":4},{"duration":0}],"displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"duration":0}]}]},{"duration":2,"name":"fire_01","frame":[{"duration":0,"events":[{"name":"fire","bone":"fire"}]}],"bone":[{"name":"front","translateFrame":[{},{"y":-0.5},{"duration":0}]}],"slot":[{"name":"front","frame":[{},{"displayIndex":2},{"duration":0,"displayIndex":4}],"displayFrame":[{},{"value":2},{"duration":0,"value":4}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":24,"name":"weapon_1005e","aabb":{"x":-158,"y":-40,"width":352.1,"height":76},"bone":[{"name":"root"},{"inheritScale":false,"name":"front","parent":"root","transform":{"x":126.1,"y":-0.4,"skX":-2.4482,"skY":-2.4482}},{"inheritScale":false,"name":"fire","parent":"root","transform":{"x":191,"y":-11}}],"slot":[{"name":"front","parent":"front"},{"name":"back","parent":"root"}],"skin":[{"name":"","slot":[{"name":"front","display":[{"name":"weapon_1005_folder/c_folder/0","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/1","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/2","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/3","transform":{"y":0.05}},{"name":"weapon_1005_folder/c_folder/4","transform":{"x":0.05,"y":0.05}}]},{"name":"back","display":[{"name":"weapon_1005_folder/weapon_r_4","transform":{"x":-18,"y":-2}}]}]}],"animation":[{"playTimes":0,"name":"idle"},{"duration":5,"playTimes":0,"name":"prepare_01","bone":[{"name":"front","translateFrame":[{"duration":2},{"y":-0.5},{"x":-0.05,"y":-0.5},{}]}],"slot":[{"name":"front","frame":[{},{"displayIndex":1},{"displayIndex":2},{"displayIndex":3},{"displayIndex":4},{"duration":0}],"displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"duration":0}]}]},{"duration":2,"name":"fire_01","frame":[{"duration":0,"events":[{"name":"fire","bone":"fire"}]}],"bone":[{"name":"front","translateFrame":[{},{"y":-0.5},{"duration":0}]}],"slot":[{"name":"front","frame":[{},{"displayIndex":2},{"duration":0,"displayIndex":4}],"displayFrame":[{},{"value":2},{"duration":0,"value":4}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_ske.json.meta b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_ske.json.meta new file mode 100644 index 00000000..d51f7ee4 --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "d407579e-0e84-4fd5-9299-3183e428c966", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.json b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.json new file mode 100644 index 00000000..94b339f5 --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.json @@ -0,0 +1 @@ +{"SubTexture":[{"width":75,"y":266,"height":40,"name":"weapon_1005_folder/weapon_r_0","x":111},{"frameHeight":37,"y":270,"frameX":0,"width":81,"frameY":0,"height":36,"name":"weapon_1005_folder/a_folder/boss_zhl.0002","frameWidth":81,"x":1},{"frameHeight":37,"y":237,"frameX":0,"width":81,"frameY":0,"height":36,"name":"weapon_1005_folder/a_folder/boss_zhl.0003","frameWidth":81,"x":277},{"width":81,"y":237,"height":37,"name":"weapon_1005_folder/a_folder/boss_zhl.0001","x":194},{"width":81,"y":227,"height":37,"name":"weapon_1005_folder/a_folder/boss_zhl.0005","x":111},{"width":81,"y":72,"height":37,"name":"weapon_1005_folder/a_folder/boss_zhl.0004","x":421},{"width":105,"y":128,"height":60,"name":"weapon_1005_folder/weapon_r_1","x":387},{"width":110,"y":178,"height":47,"name":"weapon_1005_folder/b_folder/0","x":1},{"width":108,"y":227,"height":41,"name":"weapon_1005_folder/b_folder/3","x":1},{"width":108,"y":180,"height":45,"name":"weapon_1005_folder/b_folder/2","x":113},{"width":108,"y":194,"height":41,"name":"weapon_1005_folder/b_folder/4","x":223},{"width":109,"y":190,"height":49,"name":"weapon_1005_folder/b_folder/1","x":387},{"width":108,"y":128,"height":64,"name":"weapon_1005_folder/weapon_r_2","x":277},{"width":136,"y":72,"height":54,"name":"weapon_1005_folder/c_folder/1","x":283},{"width":136,"y":132,"height":46,"name":"weapon_1005_folder/c_folder/4","x":139},{"width":136,"y":133,"height":43,"name":"weapon_1005_folder/c_folder/3","x":1},{"width":136,"y":79,"height":52,"name":"weapon_1005_folder/c_folder/0","x":1},{"width":136,"y":79,"height":51,"name":"weapon_1005_folder/c_folder/2","x":139},{"width":202,"y":1,"height":69,"name":"weapon_1005_folder/weapon_r_3","x":283},{"width":280,"y":1,"height":76,"name":"weapon_1005_folder/weapon_r_4","x":1}],"name":"weapon_1000","imagePath":"weapon_1000_tex.png"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.json.meta b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.json.meta new file mode 100644 index 00000000..865fb57c --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "3827476c-bae9-480d-bae5-97f0a74a4222", + "atlasJson": "{\"SubTexture\":[{\"width\":75,\"y\":266,\"height\":40,\"name\":\"weapon_1005_folder/weapon_r_0\",\"x\":111},{\"frameHeight\":37,\"y\":270,\"frameX\":0,\"width\":81,\"frameY\":0,\"height\":36,\"name\":\"weapon_1005_folder/a_folder/boss_zhl.0002\",\"frameWidth\":81,\"x\":1},{\"frameHeight\":37,\"y\":237,\"frameX\":0,\"width\":81,\"frameY\":0,\"height\":36,\"name\":\"weapon_1005_folder/a_folder/boss_zhl.0003\",\"frameWidth\":81,\"x\":277},{\"width\":81,\"y\":237,\"height\":37,\"name\":\"weapon_1005_folder/a_folder/boss_zhl.0001\",\"x\":194},{\"width\":81,\"y\":227,\"height\":37,\"name\":\"weapon_1005_folder/a_folder/boss_zhl.0005\",\"x\":111},{\"width\":81,\"y\":72,\"height\":37,\"name\":\"weapon_1005_folder/a_folder/boss_zhl.0004\",\"x\":421},{\"width\":105,\"y\":128,\"height\":60,\"name\":\"weapon_1005_folder/weapon_r_1\",\"x\":387},{\"width\":110,\"y\":178,\"height\":47,\"name\":\"weapon_1005_folder/b_folder/0\",\"x\":1},{\"width\":108,\"y\":227,\"height\":41,\"name\":\"weapon_1005_folder/b_folder/3\",\"x\":1},{\"width\":108,\"y\":180,\"height\":45,\"name\":\"weapon_1005_folder/b_folder/2\",\"x\":113},{\"width\":108,\"y\":194,\"height\":41,\"name\":\"weapon_1005_folder/b_folder/4\",\"x\":223},{\"width\":109,\"y\":190,\"height\":49,\"name\":\"weapon_1005_folder/b_folder/1\",\"x\":387},{\"width\":108,\"y\":128,\"height\":64,\"name\":\"weapon_1005_folder/weapon_r_2\",\"x\":277},{\"width\":136,\"y\":72,\"height\":54,\"name\":\"weapon_1005_folder/c_folder/1\",\"x\":283},{\"width\":136,\"y\":132,\"height\":46,\"name\":\"weapon_1005_folder/c_folder/4\",\"x\":139},{\"width\":136,\"y\":133,\"height\":43,\"name\":\"weapon_1005_folder/c_folder/3\",\"x\":1},{\"width\":136,\"y\":79,\"height\":52,\"name\":\"weapon_1005_folder/c_folder/0\",\"x\":1},{\"width\":136,\"y\":79,\"height\":51,\"name\":\"weapon_1005_folder/c_folder/2\",\"x\":139},{\"width\":202,\"y\":1,\"height\":69,\"name\":\"weapon_1005_folder/weapon_r_3\",\"x\":283},{\"width\":280,\"y\":1,\"height\":76,\"name\":\"weapon_1005_folder/weapon_r_4\",\"x\":1}],\"name\":\"weapon_1000\",\"imagePath\":\"weapon_1000_tex.png\"}", + "texture": "b18c6e97-e24d-46c9-8fb5-175bb9d386a9", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.png b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.png new file mode 100644 index 00000000..0d6c927b Binary files /dev/null and b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.png differ diff --git a/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.png.meta b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.png.meta new file mode 100644 index 00000000..b362d4be --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1000/weapon_1000_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "b18c6e97-e24d-46c9-8fb5-175bb9d386a9", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "weapon_1000_tex": { + "ver": "1.0.3", + "uuid": "8d001d93-dda1-4b05-a189-087b86fb00fb", + "rawTextureUuid": "b18c6e97-e24d-46c9-8fb5-175bb9d386a9", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -4.5, + "offsetY": 102.5, + "trimX": 1, + "trimY": 1, + "width": 501, + "height": 305, + "rawWidth": 512, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1004_show.meta b/Cocos/Demos/assets/resources/weapon_1004_show.meta new file mode 100644 index 00000000..f36ca571 --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1004_show.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "7bc53939-a9c6-4870-a700-ea7eb07d5e5a", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_ske.json b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_ske.json new file mode 100644 index 00000000..62af4fbb --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_ske.json @@ -0,0 +1 @@ +{"frameRate":25,"armature":[{"animation":[{"ffd":[],"frame":[],"bone":[{"rotateFrame":[],"scaleFrame":[],"translateFrame":[],"name":"root"},{"rotateFrame":[{"duration":1},{"duration":1},{"duration":1},{"duration":1},{"duration":1},{"duration":0}],"scaleFrame":[{"duration":1},{"duration":1},{"duration":1},{"duration":1},{"duration":1},{"duration":0}],"translateFrame":[{"y":0.2759,"duration":1,"x":-5.0241},{"y":-0.2458,"duration":1,"x":-0.3253},{"y":1.511,"duration":1,"x":0.6867},{"y":-1.0205,"duration":1,"x":-3.5783},{"y":-4.2802,"duration":1},{"y":-33.1021,"duration":0,"x":-11.9744}],"name":"weapon_r"}],"playTimes":0,"duration":5,"slot":[{"colorFrame":[{"duration":1},{"duration":1},{"duration":1},{"duration":1},{"duration":1},{"duration":0}],"name":"weapon_r","displayFrame":[{"duration":1},{"value":1,"duration":1},{"value":2,"duration":1},{"value":3,"duration":1},{"value":4,"duration":1},{"value":-1,"duration":0}]}],"name":"newAnimation"}],"slot":[{"color":{},"displayIndex":3,"name":"weapon_r","parent":"weapon_r"}],"skin":[{"name":"","slot":[{"display":[{"path":"weapon_1004c_r","type":"image","name":"weapon_1004c_r","transform":{"y":-27.3462,"x":172.7167}},{"path":"weapon_1004b_r","type":"image","name":"weapon_1004b_r","transform":{"y":-28.072,"x":160.8761}},{"path":"weapon_1004e_r","type":"image","name":"weapon_1004e_r","transform":{"y":-20,"x":198}},{"edges":[0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,0],"uvs":[1,1,0.97814,0.74651,0.95146,0.52209,0.90303,0.28527,0.83464,0.1124,0.77455,0.00853,0.69608,-0.00039,0.69428,0.12946,0.65942,0.21628,0.60583,0.11822,0.28217,0.21047,0.20213,-0.00039,0,-0.00039,0,1,0.40056,1,0.38722,0.82791,0.60258,0.82791,0.67108,0.74109,0.70437,0.89651,0.78105,0.91434,0.85448,0.93721,0.92635,0.97209],"userEdges":[],"type":"mesh","vertices":[432.95,94.9,444.75,25.05,402.65,-44.6,379.05,-84.8,336.9,-126.5,300.75,-150,252.25,-157.2,271.25,-118.35,253.75,-92.7,217.4,-107.95,83.7,-59.55,48,-86.75,-42.15,-86.75,-42.15,42.3,136.5,42.3,130.55,20.1,221.3,28.85,263.35,22.95,268.1,81.8,331.95,61.55,357.6,61.65,383.35,66.95],"transform":{},"path":"weapon_1004d_r","width":446,"height":129,"name":"weapon_1004d_r","triangles":[1,21,0,2,21,1,20,21,2,3,20,2,19,20,3,4,19,3,5,7,4,17,19,4,7,17,4,8,17,7,17,18,19,6,7,5,8,16,17,9,16,8,15,16,9,10,15,9,15,13,14,10,13,15,11,13,10,12,13,11]},{"path":"weapon_1004_r","type":"image","name":"weapon_1004_r","transform":{"y":-21.8616,"x":121.7152}},{"path":"weapon_1004s_r","type":"image","name":"weapon_1004s_r","transform":{"y":-28.07,"x":160.88}}],"name":"weapon_r"}]}],"bone":[{"name":"root","transform":{}},{"transform":{},"name":"weapon_r","parent":"root"}],"frameRate":24,"defaultActions":[{"gotoAndPlay":"newAnimation"}],"ik":[],"type":"Armature","name":"weapon","aabb":{"width":446,"y":-64.5,"height":129,"x":-223}},{"animation":[{"ffd":[],"frame":[],"bone":[{"rotateFrame":[],"scaleFrame":[],"translateFrame":[],"name":"root"}],"playTimes":0,"duration":0,"slot":[{"colorFrame":[],"name":"weapon_1004e_r","displayFrame":[]}],"name":"newAnimation"}],"slot":[{"color":{},"name":"weapon_1004e_r","parent":"root"}],"skin":[{"name":"","slot":[{"display":[{"path":"weapon_1004e_r","type":"image","name":"weapon_1004e_r","transform":{"y":5,"x":75}}],"name":"weapon_1004e_r"}]}],"bone":[{"name":"root","transform":{}}],"frameRate":24,"defaultActions":[{"gotoAndPlay":"newAnimation"}],"ik":[],"type":"Armature","name":"weapon_1004s_r","aabb":{"width":542,"y":-96.5,"height":203,"x":-196}}],"isGlobal":0,"name":"weapon_1004_show","version":"5.5"} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_ske.json.meta b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_ske.json.meta new file mode 100644 index 00000000..cec45cab --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "7d30311e-1cbc-4471-96cf-825713c4a0fd", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.json b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.json new file mode 100644 index 00000000..2b0e5825 --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.json @@ -0,0 +1 @@ +{"width":1024,"imagePath":"weapon_1004_show_tex.png","height":512,"name":"weapon_1004_show","SubTexture":[{"width":446,"y":1,"height":129,"name":"weapon_1004d_r","x":537},{"frameY":0,"y":1,"frameWidth":542,"frameX":0,"frameHeight":203,"width":534,"height":196,"name":"weapon_1004e_r","x":1},{"width":437,"y":132,"height":104,"name":"weapon_1004c_r","x":537},{"width":404,"y":199,"height":98,"name":"weapon_1004b_r","x":1},{"width":404,"y":238,"height":98,"name":"weapon_1004s_r","x":407},{"width":293,"y":299,"height":86,"name":"weapon_1004_r","x":1}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.json.meta b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.json.meta new file mode 100644 index 00000000..d123d19d --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "b40e7782-301b-48d1-b4c7-a3fba8969c5a", + "atlasJson": "{\"width\":1024,\"imagePath\":\"weapon_1004_show_tex.png\",\"height\":512,\"name\":\"weapon_1004_show\",\"SubTexture\":[{\"width\":446,\"y\":1,\"height\":129,\"name\":\"weapon_1004d_r\",\"x\":537},{\"frameY\":0,\"y\":1,\"frameWidth\":542,\"frameX\":0,\"frameHeight\":203,\"width\":534,\"height\":196,\"name\":\"weapon_1004e_r\",\"x\":1},{\"width\":437,\"y\":132,\"height\":104,\"name\":\"weapon_1004c_r\",\"x\":537},{\"width\":404,\"y\":199,\"height\":98,\"name\":\"weapon_1004b_r\",\"x\":1},{\"width\":404,\"y\":238,\"height\":98,\"name\":\"weapon_1004s_r\",\"x\":407},{\"width\":293,\"y\":299,\"height\":86,\"name\":\"weapon_1004_r\",\"x\":1}]}", + "texture": "ccc275f8-7bc0-4dfc-94d4-beca33f12d0e", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.png b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.png new file mode 100644 index 00000000..d5e8ca41 Binary files /dev/null and b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.png differ diff --git a/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.png.meta b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.png.meta new file mode 100644 index 00000000..3f04f0d4 --- /dev/null +++ b/Cocos/Demos/assets/resources/weapon_1004_show/weapon_1004_show_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "ccc275f8-7bc0-4dfc-94d4-beca33f12d0e", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "weapon_1004_show_tex": { + "ver": "1.0.3", + "uuid": "144a4c7f-1a53-454c-8041-7098738eb426", + "rawTextureUuid": "ccc275f8-7bc0-4dfc-94d4-beca33f12d0e", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -20, + "offsetY": 63, + "trimX": 1, + "trimY": 1, + "width": 982, + "height": 384, + "rawWidth": 1024, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin.meta b/Cocos/Demos/assets/resources/you_xin.meta new file mode 100644 index 00000000..efec70da --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "d3ab6ecd-0ae7-447e-b507-374194be7bc9", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/body.meta b/Cocos/Demos/assets/resources/you_xin/body.meta new file mode 100644 index 00000000..faa750de --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/body.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "e6786c6c-c6e2-48a7-946b-6a96c155a6e2", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/body/body_ske.json b/Cocos/Demos/assets/resources/you_xin/body/body_ske.json new file mode 100644 index 00000000..d29ca340 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/body/body_ske.json @@ -0,0 +1 @@ +{"frameRate":30,"name":"body","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"body","aabb":{"x":-929,"y":-1537.14,"width":1142.91,"height":1585.72},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"ik_foot_r","parent":"nv","transform":{"x":124.92,"y":-122.27,"skX":87.84,"skY":87.84}},{"name":"ik_foot_l","parent":"nv","transform":{"x":-58.79,"y":-68.24,"skX":100.64,"skY":100.64}},{"name":"ding","parent":"nv","transform":{"y":-50}},{"name":"pelvis","parent":"nv","transform":{"x":-92.88,"y":-910.14}},{"length":138,"name":"dress0201","parent":"pelvis","transform":{"x":1.75,"y":17.13,"skX":89.26,"skY":89.26}},{"length":169,"name":"dress0301","parent":"pelvis","transform":{"x":113.59,"y":-30.15,"skX":74.24,"skY":74.24}},{"length":93,"name":"bag0101","parent":"pelvis","transform":{"x":75.39,"y":-79.46,"skX":69.69,"skY":69.69}},{"length":407,"name":"thigh_l","parent":"pelvis","transform":{"x":-36.25,"y":30.43,"skX":88.164,"skY":88.164}},{"length":393,"name":"thigh_r","parent":"pelvis","transform":{"x":77.79,"y":26.43,"skX":93.63,"skY":93.63}},{"length":154,"name":"dress0101","parent":"pelvis","transform":{"x":-82.25,"y":-25.45,"skX":102.82,"skY":102.82}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":408,"name":"calf_l","parent":"thigh_l","transform":{"x":407.97,"y":-1.43,"skX":-2.7,"skY":-2.7}},{"length":176,"name":"dress0102","parent":"dress0101","transform":{"x":154.48,"y":1.04,"skX":-1.8,"skY":-1.8}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":161,"name":"dress0202","parent":"dress0201","transform":{"x":138.34,"y":-0.27,"skX":-1.35,"skY":-1.35}},{"length":161,"name":"dress0302","parent":"dress0301","transform":{"x":169.23,"y":-0.5,"skX":2.25,"skY":2.25}},{"length":410,"name":"calf_r","parent":"thigh_r","transform":{"x":395.5,"y":-1.18,"skX":-29.2,"skY":-29.2}},{"length":95,"name":"bag0102","parent":"bag0101","transform":{"x":93.12,"y":-0.29}},{"inheritRotation":false,"length":97,"name":"foot_r","parent":"calf_r","transform":{"x":410.23,"y":-1.14,"skX":87.83,"skY":87.83}},{"length":182,"name":"dress0203","parent":"dress0202","transform":{"x":161.4,"y":-0.1,"skX":-0.9,"skY":-0.9}},{"length":181,"name":"dress0303","parent":"dress0302","transform":{"x":162.95,"y":-0.17,"skX":-1.36,"skY":-1.36}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"inheritRotation":false,"length":108,"name":"foot_l","parent":"calf_l","transform":{"x":411.64,"y":0.23,"skX":103.24,"skY":103.24}},{"length":171,"name":"dress0103","parent":"dress0102","transform":{"x":176.75,"y":-0.35,"skX":-0.9,"skY":-0.9}},{"length":71,"name":"hand_r","parent":"spine2","transform":{"x":-153.8253,"y":279.9232,"skX":121.868,"skY":121.868}},{"length":71,"name":"neck","parent":"spine2","transform":{"x":172.12,"y":0.19,"skX":-17.89,"skY":-17.89}},{"length":195,"name":"upperarm_l","parent":"spine2","transform":{"x":93.55,"y":-65.17,"skX":-179.09,"skY":-179.09}},{"length":200,"name":"upperarm_r","parent":"spine2","transform":{"x":139.2,"y":93.66,"skX":150.94,"skY":150.94}},{"name":"xiong_l","parent":"spine2","transform":{"x":11.36,"y":-82.7}},{"name":"xiong_r","parent":"spine2","transform":{"x":35.43,"y":29.27}},{"length":200,"name":"dress0204","parent":"dress0203","transform":{"x":183.88,"y":1.16,"skX":2.25,"skY":2.25}},{"length":193,"name":"dress0104","parent":"dress0103","transform":{"x":171.1,"y":-0.63}},{"length":54,"name":"hand_l","parent":"spine2","transform":{"x":-263.6517,"y":-107.4376,"skX":-161.27,"skY":-161.27}},{"length":192,"name":"dress0304","parent":"dress0303","transform":{"x":181.23,"y":-0.11}},{"length":88,"name":"head1","parent":"neck","transform":{"x":71.14,"y":-0.04,"skX":-13.29,"skY":-13.29}},{"length":147,"name":"dress0305","parent":"dress0304","transform":{"x":192.32,"y":-0.67,"skX":0.45,"skY":0.45}},{"length":166,"name":"forearm_l","parent":"upperarm_l","transform":{"x":194.88,"y":0.53,"skX":12.43,"skY":12.43}},{"length":178,"name":"dress0105","parent":"dress0104","transform":{"x":193.05,"y":-1.28,"skX":0.9,"skY":0.9}},{"length":157,"name":"dress0205","parent":"dress0204","transform":{"x":200.46,"y":0.5}},{"length":88,"name":"head","parent":"neck","transform":{"x":71.14,"y":-0.04,"skX":-13.29,"skY":-13.29}},{"length":90,"name":"finger_l","parent":"hand_l","transform":{"x":80.65,"y":-18.79,"skX":-37.65,"skY":-37.65}},{"name":"bone_ikTarget","parent":"hand_l","transform":{"x":-0.8992,"y":-0.0558,"skX":-126.65,"skY":-126.65}},{"length":150,"name":"forearm_r","parent":"upperarm_r","transform":{"x":200.51,"y":0.29,"skX":-11.56,"skY":-11.56}},{"name":"bone_ikTarget1","parent":"hand_r","transform":{"x":-0.7403,"y":0.6485,"skX":-66.4,"skY":-66.4}},{"length":74,"name":"figner_r","parent":"hand_r","transform":{"x":74.81,"y":33.28,"skX":24.91,"skY":24.91}},{"name":"face","parent":"head","transform":{"x":28.99,"y":-29.94,"skX":-2.1,"skY":-2.1}},{"name":"face1","parent":"head1","transform":{"x":28.99,"y":-29.94,"skX":-2.1,"skY":-2.1}},{"name":"hair","parent":"head","transform":{"x":187.01,"y":-14.39}},{"length":60,"name":"hair0201","parent":"hair","transform":{"x":-18.14,"y":-16.81,"skX":-156.55,"skY":-156.55}},{"length":60,"name":"hair0301","parent":"hair","transform":{"x":-22.37,"y":20.04,"skX":170.91,"skY":170.91}},{"length":100,"name":"hair0501","parent":"hair","transform":{"x":-113.42,"y":-63.08,"skX":-162.11,"skY":-162.11}},{"length":80,"name":"hair0101","parent":"hair","transform":{"x":-41.95,"y":-73.17,"skX":-167.14,"skY":-167.14}},{"length":80,"name":"hair0401","parent":"hair","transform":{"x":-58.34,"y":59.16,"skX":-179.5,"skY":-179.5}},{"length":100,"name":"hair0601","parent":"hair","transform":{"x":-131.71,"y":66.14,"skX":-172.88,"skY":-172.88}},{"length":70,"name":"hair0202","parent":"hair0201","transform":{"x":62.78,"y":-0.2,"skX":-13.15,"skY":-13.15}},{"length":100,"name":"hair0102","parent":"hair0101","transform":{"x":83.27,"y":-0.72,"skX":-5.51,"skY":-5.51}},{"length":70,"name":"hair0302","parent":"hair0301","transform":{"x":63.79,"y":-0.2,"skX":0.51,"skY":0.51}},{"length":100,"name":"hair0402","parent":"hair0401","transform":{"x":81.06,"y":0.4,"skX":7.99,"skY":7.99}},{"length":120,"name":"hair0502","parent":"hair0501","transform":{"x":104.79,"y":-0.11,"skX":0.45,"skY":0.45}},{"length":120,"name":"hair0602","parent":"hair0601","transform":{"x":100.91,"y":0.05,"skX":2.44,"skY":2.44}},{"length":100,"name":"hair0403","parent":"hair0402","transform":{"x":99.23,"y":0.19,"skX":3.86,"skY":3.86}},{"length":140,"name":"hair0503","parent":"hair0502","transform":{"x":119.54,"y":-0.01,"skX":0.45,"skY":0.45}},{"inheritScale":false,"length":140,"name":"hair0603","parent":"hair0602","transform":{"x":119.43,"y":-0.01,"skX":0.83,"skY":0.83}},{"length":100,"name":"hair0103","parent":"hair0102","transform":{"x":99.3,"y":-0.01,"skX":-2.23,"skY":-2.23}},{"length":146,"name":"hair0504","parent":"hair0503","transform":{"x":144.09,"y":0.47,"skX":4.95,"skY":4.95}},{"length":136,"name":"hair0604","parent":"hair0603","transform":{"x":142.27,"y":-0.51,"skX":-3.46,"skY":-3.46}},{"length":159,"name":"hair0605","parent":"hair0604","transform":{"x":136.59,"y":-0.47,"skX":-2.7,"skY":-2.7}},{"length":148,"name":"hair0505","parent":"hair0504","transform":{"x":146.28,"y":1.15,"skX":0.9,"skY":0.9}}],"slot":[{"name":"logo","parent":"root"},{"name":"blank","parent":"nv"},{"name":"1061","parent":"nv"},{"name":"1059","parent":"nv"},{"name":"1060","parent":"nv"},{"name":"1088","parent":"nv"},{"name":"1087","parent":"nv"},{"name":"1084","parent":"nv"},{"name":"1073","parent":"nv"},{"name":"1058","parent":"nv"},{"name":"1057","parent":"nv"},{"name":"1065","parent":"nv"},{"name":"1074","parent":"nv"},{"name":"1055","parent":"nv"},{"name":"1056","parent":"nv"},{"name":"1066","parent":"nv"},{"name":"1064","parent":"nv"},{"name":"1079","parent":"nv"},{"name":"1039","parent":"nv"},{"name":"a_arm_L","parent":"nv"},{"name":"1054","parent":"nv"},{"name":"1070","parent":"nv"},{"name":"1040","parent":"nv"},{"name":"1042","parent":"nv"},{"name":"1041","parent":"nv"},{"name":"1038","parent":"nv"},{"name":"1072","parent":"nv"},{"name":"1082","parent":"nv"},{"name":"a_leg_L","parent":"nv"},{"name":"1023","parent":"nv"},{"name":"1053","parent":"nv"},{"name":"1078","parent":"nv"},{"name":"1037","parent":"nv"},{"name":"1035","parent":"nv"},{"name":"1033","parent":"nv"},{"name":"a_body","parent":"nv"},{"name":"1052","parent":"nv"},{"name":"1048","parent":"nv"},{"name":"1077","parent":"nv"},{"name":"1031","parent":"nv"},{"name":"a_leg_R","parent":"nv"},{"name":"1022","parent":"nv"},{"name":"1051","parent":"nv"},{"name":"1076","parent":"nv"},{"name":"1036","parent":"nv"},{"name":"1034","parent":"nv"},{"name":"1032","parent":"nv"},{"name":"1044","parent":"nv"},{"name":"1043","parent":"nv"},{"name":"1083","parent":"nv"},{"name":"1029","parent":"nv"},{"name":"1030","parent":"nv"},{"name":"1026","parent":"nv"},{"name":"1025","parent":"nv"},{"name":"1024","parent":"nv"},{"name":"1028","parent":"nv"},{"name":"1027","parent":"nv"},{"name":"1021","parent":"nv"},{"name":"1017","parent":"nv"},{"name":"1016","parent":"nv"},{"name":"1015","parent":"nv"},{"name":"1013","parent":"nv"},{"name":"1012","parent":"nv"},{"name":"1009","parent":"nv"},{"name":"1086","parent":"nv"},{"name":"a_arm_R","parent":"nv"},{"name":"1050","parent":"nv"},{"name":"1075","parent":"nv"},{"name":"1018","parent":"nv"},{"name":"1020","parent":"nv"},{"name":"1019","parent":"nv"},{"name":"1080","parent":"nv"},{"name":"1071","parent":"nv"},{"name":"1081","parent":"nv"},{"name":"1014","parent":"nv"},{"name":"1010","parent":"nv"},{"name":"1067","parent":"nv"},{"name":"1085","parent":"nv"},{"name":"1069","parent":"nv"},{"name":"a_head","parent":"nv"},{"name":"1049","parent":"nv"},{"name":"1047","parent":"nv"},{"name":"1068","parent":"nv"},{"name":"1045","parent":"nv"},{"name":"1011","parent":"nv"},{"name":"1008","parent":"nv"},{"name":"1007","parent":"nv"},{"name":"1006","parent":"nv"},{"name":"1005","parent":"nv"},{"name":"1004","parent":"nv"},{"name":"1003","parent":"nv"},{"name":"1063","parent":"nv"},{"name":"1062","parent":"nv"},{"name":"1002","parent":"nv"},{"name":"1001","parent":"nv"},{"name":"1046","parent":"face1"}],"ik":[{"bendPositive":false,"chain":1,"name":"ik_foot_l","bone":"calf_l","target":"ik_foot_l"},{"bendPositive":false,"chain":1,"name":"ik_foot_r","bone":"calf_r","target":"ik_foot_r"},{"chain":1,"name":"bone_ik","bone":"forearm_l","target":"bone_ikTarget"},{"bendPositive":false,"chain":1,"name":"bone_ik1","bone":"forearm_r","target":"bone_ikTarget1"}],"skin":[{"name":"","slot":[{"name":"1015","display":[{"name":"blank"}]},{"name":"1067","display":[{"name":"blank"}]},{"name":"1062","display":[{"name":"blank"}]},{"name":"1075","display":[{"name":"blank"}]},{"name":"1041","display":[{"name":"blank"}]},{"name":"1020","display":[{"name":"blank"}]},{"name":"1008","display":[{"name":"blank"}]},{"name":"1060","display":[{"name":"blank"}]},{"name":"1011","display":[{"name":"blank"}]},{"name":"1072","display":[{"name":"blank"}]},{"name":"a_leg_L","display":[{"type":"mesh","name":"body/a_leg_L","width":179,"height":1013,"vertices":[-86.18,-882.01,-81.91,-848.44,-92.02,-825.24,-87.85,-797.79,-70.85,-667.06,-66.92,-572.62,-62.78,-526.33,-60.54,-500.62,-57.76,-475.46,-58.7,-450.67,-59.75,-425.89,-52.79,-354.49,-41.86,-212.94,-34.51,-113.84,-31.28,-91.12,-29.71,-70.7,-29.64,-49.28,-29.37,36.9,-44.33,57.74,-102.88,57.91,-107.02,38.81,-87.22,-48.71,-84.71,-67.63,-85.25,-89.42,-87.56,-111.25,-110.32,-207.85,-139.82,-349.75,-137.48,-423.49,-135.58,-448.23,-137.5,-471.8,-144.11,-497.41,-152.24,-521.77,-164.16,-567.25,-187.65,-662.28,-209.67,-797.4,-212.04,-828.9,-212.21,-859.9,-212.36,-890,-208.28,-924.69,-196.4,-954.81,-152.96,-954.83,-109.63,-921.47,-147.97,-881.49],"uvs":[0.70479,0.072,0.72801,0.10527,0.67066,0.1282,0.69292,0.15537,0.78389,0.28452,0.80294,0.37775,0.82467,0.42345,0.83633,0.44883,0.85118,0.47366,0.84541,0.49809,0.83911,0.52254,0.87661,0.59304,0.93491,0.7328,0.97402,0.83065,0.99162,0.85309,1,0.87325,0.99998,0.8944,1,0.97947,0.91607,1,0.58892,0.99998,0.56612,0.98112,0.67824,0.89478,0.69264,0.87611,0.69,0.85458,0.67757,0.83302,0.5523,0.73759,0.39029,0.59742,0.4048,0.52464,0.4158,0.5002,0.4056,0.47691,0.3694,0.45158,0.32474,0.42748,0.25953,0.38254,0.13125,0.28863,0.0123,0.1551,0,0.12399,0,0.09339,0.00004,0.06371,0.02297,0.02968,0.08904,0,0.33172,0,0.57372,0.03294,0.35956,0.07241],"triangles":[26,25,11,11,25,12,25,24,12,12,24,13,23,22,14,20,18,17,21,20,17,14,22,15,15,22,16,22,21,16,21,17,16,13,23,14,24,23,13,20,19,18,3,33,4,10,27,11,27,26,11,4,32,5,33,32,4,28,10,9,29,28,9,29,9,8,7,29,8,5,31,6,28,27,10,6,30,7,30,29,7,34,33,3,31,30,6,32,31,5,0,42,1,41,42,0,2,34,3,35,34,2,40,42,41,38,37,42,37,36,42,42,1,36,36,2,1,36,35,2,38,39,42,40,39,42],"weights":[2,9,0.28537,5,0.71462,2,9,0.65566,5,0.34433,2,9,0.86895,5,0.13104,1,9,1,1,9,1,1,9,1,2,9,0.93466,13,0.06533,2,9,0.7492,13,0.25079,2,9,0.46584,13,0.53415,2,9,0.18125,13,0.81874,2,9,0.01669,13,0.9833,1,13,1,1,13,1,1,13,1,2,13,0.80851,24,0.19148,2,13,0.51678,24,0.4832,2,13,0.18077,24,0.81922,1,24,1,1,24,1,1,24,1,1,24,1,2,13,0.12108,24,0.87891,2,13,0.41515,24,0.58484,2,13,0.79057,24,0.20942,2,13,0.98672,24,0.01327,1,13,1,1,13,1,1,13,1,2,9,0.14873,13,0.85125,2,9,0.52426,13,0.47573,2,9,0.88471,13,0.11528,2,9,0.98959,13,0.0104,1,9,1,1,9,1,1,9,1,1,9,1,2,9,0.99624,5,0.00375,2,9,0.83943,5,0.16056,3,9,0.24652,5,0.61074,12,0.14273,3,9,0.04186,5,0.40613,12,0.55198,3,9,0.03736,5,0.34663,12,0.61599,2,5,0.60799,12,0.392,2,9,0.49599,5,0.504],"slotPose":[1,0,0,1,0,0],"bonePose":[9,0.08646,0.996255,-0.996255,0.08646,-146.29,-879.71,5,1,0,0,1,-107.18,-913,13,0.133294,0.991076,-0.991076,0.133294,-109.592168,-473.391363,24,-0.202787,0.979223,-0.979223,-0.202787,-54.950844,-65.393975,12,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04],"edges":[35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,41,41,40,40,39,39,38,38,37,37,36,36,35],"userEdges":[29,8,30,7,31,6,32,5,28,9,27,10,26,11,25,12,22,15,23,14,24,13,21,16,33,4,34,3,35,2,1,36,37,42,41,42,42,40,39,42,42,0,42,38,42,1]}]},{"name":"1036","display":[{"name":"blank"}]},{"name":"1082","display":[{"name":"blank"}]},{"name":"1087","display":[{"name":"blank"}]},{"name":"1039","display":[{"name":"blank"}]},{"name":"1019","display":[{"name":"blank"}]},{"name":"1001","display":[{"name":"blank"}]},{"name":"1085","display":[{"name":"blank"}]},{"name":"1026","display":[{"name":"blank"}]},{"name":"1002","display":[{"name":"blank"}]},{"name":"1045","display":[{"name":"blank"}]},{"name":"1046","display":[{"type":"mesh","name":"face/10202001","width":141,"height":117,"vertices":[-5.81,-1431.71,-7.25,-1413.78,-5.82,-1344.1,-49.56,-1344.32,-59.21,-1344.11,-146.81,-1344.1,-146.81,-1418.47,-146.81,-1425.05,-146.81,-1461.1,-49.28,-1460.87,-32.92,-1461.08,-5.82,-1461.09,-66.69,-1421.47,-52.04,-1398.21,-40.94,-1394.39,-28.13,-1395.35,-16.7,-1401.52,-18.08,-1441.03,-44.3,-1442.46,-57.51,-1435.54,-29.33,-1443.01,-63.7,-1412.37,-54.57,-1426.83,-41.38,-1433.91,-25.5,-1433.38,-65.47,-1434.18,-58.62,-1443.76,-45.26,-1447.53,-31.01,-1448.15,-97.42,-1409.22,-89,-1385.39,-95.65,-1376.02,-107.36,-1371.98,-120.02,-1371.41,-141.13,-1385.65,-137,-1404.25,-124.8,-1414.24,-108.71,-1414.58,-131.96,-1379.75,-130.3,-1397.19,-120.96,-1406.53,-105.61,-1406.49,-92.39,-1399.98,-103.66,-1418.13,-111.68,-1421.49,-126,-1417.88,-123.92,-1433.26,-109.34,-1432.39,-108.8,-1423.6,-130.05,-1421.25,-75.59,-1444.91,-64.41,-1455.74,-32.78,-1455.95,-45.85,-1454.16,-59.01,-1446.27,-69.07,-1440.12,-75.8,-1381.9,-82.5,-1375.53,-73.18,-1368.41,-65.65,-1374.98,-71.2,-1355.94,-69.9,-1360.8,-65.57,-1363.89,-59.27,-1363.89,-52.91,-1352.11,-57.85,-1349.72,-62.98,-1348.76,-68.81,-1351.15,-50.58,-1355.95,-53.31,-1361.76,-135.56,-1410.89,-117.9,-1423.06,-135.51,-1428.7],"uvs":[0.99999,0.25096,0.98982,0.40435,1,1,0.68976,0.99824,0.62131,0.99998,0,1,0,0.36417,0,0.30797,0,0,0.69179,0.00175,0.80783,0,1,0,0.56819,0.33841,0.67213,0.53736,0.75089,0.57015,0.84173,0.56191,0.92283,0.50922,0.91303,0.17139,0.72703,0.15914,0.63327,0.2183,0.83323,0.15447,0.58945,0.41631,0.65419,0.29276,0.74773,0.23223,0.86039,0.2367,0.57687,0.22999,0.62547,0.14802,0.72023,0.11581,0.82136,0.11052,0.35025,0.44331,0.40996,0.64693,0.36285,0.72715,0.27981,0.7617,0.18996,0.76642,0.04023,0.64466,0.06953,0.48575,0.15604,0.40043,0.27022,0.3975,0.10527,0.69524,0.11704,0.54617,0.1833,0.46638,0.29219,0.46662,0.3859,0.52224,0.30601,0.36709,0.24911,0.3384,0.14754,0.36794,0.16514,0.2348,0.26569,0.24531,0.26956,0.32022,0.1185,0.33659,0.50514,0.13819,0.58438,0.04566,0.80879,0.04393,0.71603,0.05916,0.62271,0.13519,0.5513,0.17918,0.50366,0.67691,0.4561,0.73135,0.52217,0.79225,0.57563,0.73603,0.53626,0.8988,0.54549,0.85722,0.57613,0.83087,0.62083,0.83085,0.66596,0.93157,0.63098,0.95206,0.59453,0.96026,0.55322,0.93979,0.68251,0.89878,0.6631,0.84903,0.07977,0.42905,0.20675,0.3266,0.07904,0.27109],"triangles":[8,51,9,69,68,15,52,28,17,15,68,2,68,3,2,16,15,2,1,16,2,24,1,0,17,24,0,52,17,11,10,52,11,17,0,11,24,16,1,14,69,15,23,14,15,23,15,24,28,20,17,24,15,16,20,24,17,23,22,14,22,13,14,20,23,24,28,18,20,18,23,20,52,27,28,27,18,28,59,69,14,53,27,52,53,52,10,9,53,10,67,5,4,59,63,69,22,21,13,68,64,3,13,59,14,18,19,23,19,22,23,26,19,18,26,18,27,54,26,27,54,27,53,9,54,53,56,59,13,51,54,9,64,65,3,65,4,3,12,21,22,69,64,68,21,56,13,61,60,67,8,50,51,59,62,63,55,25,26,26,25,19,66,4,65,42,56,21,51,55,54,66,67,4,54,55,26,8,47,50,32,5,67,58,62,59,50,55,51,12,42,21,29,42,12,42,30,56,55,50,12,55,12,25,58,61,62,56,58,59,60,32,67,50,43,12,43,29,12,56,57,58,58,60,61,47,43,50,58,57,60,57,31,60,31,32,60,30,57,56,8,46,47,33,5,32,30,31,57,47,48,43,41,31,42,42,31,30,41,32,31,29,41,42,40,39,32,40,32,41,39,33,32,39,38,33,48,44,43,44,37,43,37,40,41,47,71,48,36,40,37,71,44,48,46,71,47,8,72,46,38,5,33,46,49,71,49,45,71,35,39,40,72,49,46,34,38,39,45,70,36,49,70,45,8,7,72,34,5,38,35,34,39,72,6,49,6,70,49,7,6,72,6,35,70,6,34,35,6,5,34,25,19,12,19,12,22,40,35,36,70,35,36,43,29,37,37,41,29,71,44,45,44,36,37,45,36,44,65,63,64,69,63,64,63,65,62,62,66,65,67,61,66,62,61,66],"weights":[2,41,0.44,47,0.55999,2,41,0.928,47,0.07199,1,41,1,1,41,1,1,41,1,1,41,1,2,41,0.96,47,0.03999,2,41,0.96,47,0.03999,1,41,1,2,41,0.94399,47,0.056,2,41,0.96799,47,0.032,1,41,1,2,41,0.55198,47,0.448,2,41,0.856,47,0.14399,1,41,1,1,41,1,1,41,1,2,41,0.672,47,0.32799,2,41,0.60799,47,0.392,2,41,0.592,47,0.40799,2,41,0.66399,47,0.336,2,41,0.488,47,0.51199,2,41,0.456,47,0.54399,2,41,0.47999,47,0.52,2,41,0.488,47,0.51199,2,41,0.728,47,0.27199,2,41,0.78399,47,0.216,2,41,0.79199,47,0.208,2,41,0.75199,47,0.248,2,41,0.68799,47,0.312,2,41,0.91999,47,0.08,1,41,1,1,41,1,2,41,0.944,47,0.05599,2,41,0.58398,47,0.416,2,41,0.616,47,0.38399,2,41,0.6,47,0.39999,2,41,0.688,47,0.31199,2,41,0.50399,47,0.496,2,41,0.496,47,0.50399,2,41,0.43199,47,0.568,2,41,0.456,47,0.54399,2,41,0.504,47,0.49599,2,41,0.79999,47,0.2,2,41,0.8,47,0.19999,2,41,0.77599,47,0.224,2,41,0.94399,47,0.056,2,41,0.94399,47,0.056,2,41,0.936,47,0.06398,2,41,0.96,47,0.03999,2,41,0.91999,47,0.08,2,41,0.90399,47,0.096,2,41,0.95199,47,0.048,2,41,0.928,47,0.07199,2,41,0.912,47,0.08799,2,41,0.91999,47,0.08,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,2,41,0.736,47,0.26399,2,41,0.77599,47,0.224,2,41,0.95,47,0.05],"slotPose":[1,0,0,1,0,0],"bonePose":[41,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473,47,-0.264883,-0.964281,0.964281,-0.264883,-71.928507,-1385.236231],"edges":[5,4,4,3,3,2,2,1,1,0,0,11,11,10,10,9,9,8,8,7,7,6,6,5],"userEdges":[13,14,14,15,15,16,16,1,0,17,18,19,19,12,17,20,20,18,12,21,21,13,14,22,22,19,21,22,15,23,23,18,22,23,16,24,24,20,23,24,24,1,12,25,25,26,26,27,27,28,28,17,30,31,31,32,32,33,35,36,29,37,37,36,33,38,38,34,33,39,39,35,38,39,32,40,40,36,39,40,31,41,41,37,40,41,29,42,42,30,41,42,29,43,43,44,44,45,46,47,47,48,49,6,50,51,51,9,10,52,52,53,53,54,54,55,55,50,56,57,57,58,58,59,59,56,60,61,61,62,62,63,63,64,64,65,65,62,61,66,66,65,60,67,67,66,64,68,68,69,69,63,66,4,64,3,35,34,35,70,70,45,48,71,71,49,7,72,72,46]}]},{"name":"1069","display":[{"name":"blank"}]},{"name":"1013","display":[{"name":"blank"}]},{"name":"1065","display":[{"name":"blank"}]},{"name":"1052","display":[{"name":"blank"}]},{"name":"a_arm_L","display":[{"type":"mesh","name":"body/a_arm_L","width":295,"height":472,"vertices":[-81.59,-1249.92,-82.13,-1222.8,-90.29,-1199.89,-99.94,-1175.35,-140.6,-1076.14,-149.32,-1058.12,-158.96,-1040.32,-169.17,-1023.17,-180.14,-1005.15,-235.14,-935.12,-247.23,-919.56,-254.46,-903.99,-254.92,-886.98,-255.27,-874.4,-264.31,-849.75,-263.48,-823.45,-273.34,-815.62,-288.83,-832.26,-294.13,-867.14,-300.47,-826.86,-312.19,-817.57,-322.39,-849.32,-322.43,-810.31,-342.25,-809.85,-338.27,-831.67,-359.64,-809.84,-376.32,-809.83,-376.32,-823.42,-339.1,-861.24,-321.48,-894.35,-301.07,-912.31,-291.53,-924.54,-282.7,-939.75,-273.62,-956.8,-233.88,-1036.01,-222.22,-1050.63,-211.95,-1065.18,-205.35,-1080.95,-198.23,-1099.87,-164.13,-1199.93,-158.28,-1224,-152.19,-1247.26,-142.98,-1266.72,-123.15,-1281.81,-86.06,-1281.82,-121.9,-1238.14],"uvs":[0.99908,0.06759,0.99724,0.12503,0.96959,0.17358,0.93691,0.22557,0.79917,0.43578,0.76962,0.47396,0.73694,0.51167,0.70231,0.54802,0.66509,0.58622,0.4787,0.73459,0.43772,0.76756,0.41319,0.80054,0.41158,0.83658,0.4104,0.86323,0.37975,0.91548,0.38254,0.97121,0.3491,0.9878,0.29661,0.95254,0.27866,0.87862,0.25715,0.96396,0.2174,0.98364,0.18283,0.91636,0.18269,0.99902,0.11549,1,0.12898,0.95375,0.05652,1,0,1,0,0.97121,0.12618,0.8911,0.18593,0.82095,0.25514,0.78291,0.28748,0.757,0.31745,0.72477,0.34822,0.68865,0.48292,0.52085,0.52241,0.48985,0.55727,0.45903,0.57963,0.42562,0.60376,0.38554,0.7193,0.17354,0.73909,0.12253,0.75972,0.07326,0.79093,0.03199,0.85816,0,0.98391,0,0.86245,0.09251],"triangles":[45,1,0,45,2,1,38,4,3,39,38,3,39,3,2,43,42,45,42,41,45,41,40,45,38,5,4,38,37,5,37,6,5,37,36,6,36,7,6,36,35,7,35,8,7,35,34,8,34,9,8,33,9,34,33,10,9,31,11,10,32,31,10,33,32,10,18,14,13,18,13,12,30,18,12,30,12,11,31,30,11,17,16,15,17,15,14,18,17,14,30,29,18,29,21,18,28,21,29,21,20,19,24,23,22,28,24,21,27,25,24,27,24,28,27,26,25,24,22,21,21,19,18,43,44,45,44,45,0,39,40,2,45,40,2],"weights":[2,28,0.07199,23,0.928,2,28,0.24799,23,0.752,2,28,0.528,23,0.47199,2,28,0.928,23,0.07199,2,38,0.00601,28,0.99398,2,38,0.10823,28,0.89176,2,38,0.4621,28,0.53789,2,38,0.84526,28,0.15473,2,38,0.99634,28,0.00365,1,38,0.99999,2,38,0.91608,34,0.08391,2,38,0.48414,34,0.51585,2,38,0.11944,34,0.88055,2,38,0.02847,34,0.97152,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,2,38,0.14665,34,0.85334,2,38,0.52201,34,0.47798,2,38,0.89834,34,0.10165,1,38,1,1,38,1,2,38,0.89448,28,0.10551,2,38,0.53387,28,0.46612,2,38,0.14666,28,0.85333,1,28,1,1,28,1,1,28,1,1,28,1,2,28,0.90399,23,0.096,2,28,0.84,23,0.15999,2,28,0.512,23,0.48799,2,28,0.63998,23,0.36],"slotPose":[1,0,0,1,0,0],"bonePose":[34,-0.596925,0.802297,-0.802297,-0.596925,-272.622839,-911.231146,28,-0.322761,0.94648,-0.94648,-0.322761,-122.498835,-1238.098661,23,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,38,-0.518922,0.854821,-0.854821,-0.518922,-185.900195,-1053.819626],"edges":[26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,44,44,43,43,42,42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26],"userEdges":[18,21,24,21,36,6,37,5,35,7,38,4,34,8,45,43,42,45,45,41,45,1,45,0,44,45,40,2,39,3,31,11,32,10,33,9,30,12]}]},{"name":"1077","display":[{"name":"blank"}]},{"name":"1024","display":[{"name":"blank"}]},{"name":"1034","display":[{"name":"blank"}]},{"name":"1007","display":[{"name":"blank"}]},{"name":"1088","display":[{"name":"blank"}]},{"name":"a_body","display":[{"type":"mesh","name":"body/a_body","width":274,"height":555,"vertices":[3.85,-1359.46,4.35,-1323.79,4.58,-1307.26,26.65,-1293.37,56.25,-1285.3,74.66,-1271.04,74.67,-1232.65,55.69,-1196.98,37.02,-1162.12,14.62,-1122.77,-4.3,-1086.77,-13.31,-1048.89,-5.56,-1005.33,12.17,-967.78,25.17,-935.12,1.17,-890.77,-67.7,-848.67,-104.99,-839.87,-133.68,-845.76,-174.14,-896.36,-199.36,-942.97,-191.82,-980.99,-174.75,-1018.1,-166.88,-1062.7,-172.42,-1105.69,-173.89,-1141.93,-183.38,-1172.15,-182.19,-1198.85,-151.95,-1221.98,-134.76,-1251.64,-119.87,-1280.7,-88.68,-1289.24,-65.67,-1300.67,-64.3,-1312.71,-63.43,-1326.83,-61.82,-1373.68,-36.93,-1394.83,6.36,-1394.82,-136.53,-1140.84,-103.21,-1157.15,-68.29,-1129.39,-23.28,-1127.2,5.18,-1165.13,-5.44,-1212.94,-39.22,-1285.76,-101.78,-1184.64,-89.06,-1216.72,-36.07,-1228.28,-116.96,-1227.04,-50.5,-1164.02,-157.23,-1176.53,-98.12,-1104.39,-97.42,-1057.84,-97.87,-1008.49,-100.05,-964.28,-101.59,-919.15,-104.98,-875.45,-54.82,-1097.52,-54.63,-1054.45,-54.29,-1007.2,-48.8,-964.31,-41.19,-920.95,-65.81,-880.55,-135.38,-1103.51,-133.8,-1060.29,-139.59,-1011.22,-147.76,-970,-149.84,-925.12,-148.19,-887.34,26.39,-1207.83,-98.82,-1256.44,-55.68,-1256.45,38.68,-1244.3,-2.4,-1250.59],"uvs":[0.74158,0.06374,0.74339,0.12797,0.74423,0.15773,0.82473,0.18283,0.93275,0.19735,0.99999,0.22304,0.99999,0.29223,0.93075,0.3565,0.86258,0.41927,0.78081,0.49018,0.71177,0.55505,0.67888,0.62329,0.70717,0.70179,0.77189,0.76941,0.81935,0.82831,0.73178,0.90824,0.48045,0.98413,0.34427,0.99999,0.23933,0.98941,0.09205,0.89807,0,0.81411,0.02734,0.74567,0.08964,0.6788,0.11835,0.59843,0.09818,0.52096,0.0928,0.45568,0.05817,0.40118,0.0625,0.3531,0.17288,0.31143,0.23564,0.25801,0.28995,0.20566,0.40377,0.19027,0.4878,0.16964,0.49277,0.14794,0.49598,0.12251,0.50184,0.03806,0.59274,0,0.75073,0,0.22915,0.45764,0.35079,0.42824,0.47824,0.47825,0.64251,0.48221,0.7464,0.41383,0.70765,0.32773,0.58431,0.19652,0.356,0.37866,0.40239,0.32086,0.59582,0.30009,0.30057,0.30232,0.54319,0.41587,0.15362,0.39333,0.36933,0.52332,0.37192,0.6072,0.37026,0.69612,0.36232,0.77579,0.35677,0.85712,0.34438,0.93588,0.52739,0.53568,0.52808,0.61328,0.52931,0.69842,0.54939,0.7757,0.57714,0.85383,0.48734,0.92668,0.23336,0.52489,0.23908,0.60278,0.21797,0.6912,0.18817,0.76549,0.18061,0.84636,0.1867,0.91442,0.82379,0.33694,0.36681,0.24935,0.52423,0.24933,0.86865,0.27125,0.71872,0.2599],"triangles":[72,7,6,72,6,5,4,72,5,72,69,7,69,8,7,3,72,4,73,43,69,69,42,8,42,9,8,73,69,72,3,73,72,61,15,14,2,73,3,43,42,69,13,61,14,44,73,2,60,61,13,42,41,9,41,10,9,62,16,15,12,60,13,47,43,73,0,34,1,43,49,42,49,41,42,36,0,37,35,34,0,1,44,2,36,35,0,61,62,15,11,59,12,59,60,12,47,49,43,41,57,10,58,11,10,57,58,10,71,47,73,44,71,73,58,59,11,46,49,47,49,40,41,40,57,41,33,32,44,71,46,47,60,55,61,46,45,49,32,71,44,54,55,60,55,62,61,32,31,71,53,54,59,53,59,58,52,53,58,57,52,58,59,54,60,51,52,57,39,40,49,45,39,49,31,70,71,70,46,71,40,51,57,56,16,62,55,56,62,56,17,16,39,51,40,64,65,52,52,65,53,39,38,51,64,52,51,63,64,51,70,48,46,30,70,31,18,17,56,68,56,55,65,66,54,67,55,54,66,67,54,29,48,70,65,54,53,38,63,51,30,29,70,67,68,55,50,39,45,50,38,39,68,18,56,29,28,48,22,66,65,23,22,65,50,25,38,25,24,38,38,24,63,24,23,63,63,23,64,23,65,64,68,19,18,27,50,28,67,19,68,20,67,66,22,21,66,21,20,66,26,25,50,20,19,67,27,26,50,28,50,48,44,33,1,34,33,1,45,50,46,48,50,46],"weights":[1,27,1,2,23,0.04933,27,0.95066,2,23,0.37053,27,0.62945,1,23,1,1,23,1,1,23,1,1,23,1,1,23,1,3,15,0.07991,23,0.91513,27,0.00495,2,15,0.4598,23,0.54019,2,15,0.89215,23,0.10784,2,12,0.19819,15,0.8018,2,12,0.70197,15,0.29802,3,12,0.76582,15,0.09095,5,0.1432,3,12,0.43807,5,0.44192,10,0.12,2,5,0.496,10,0.50399,2,5,0.632,10,0.36799,3,5,0.83174,10,0.08025,9,0.08799,2,5,0.592,9,0.40799,2,5,0.56,9,0.43999,3,12,0.4652,5,0.40679,9,0.12799,3,12,0.8085,15,0.04201,5,0.14947,2,12,0.72622,15,0.27377,2,12,0.23723,15,0.76276,2,15,0.88129,23,0.1187,3,15,0.44155,23,0.48645,30,0.07199,3,15,0.08109,23,0.8389,30,0.07999,2,23,0.91199,30,0.088,2,23,0.92,30,0.07999,1,23,1,1,23,1,1,23,1,2,23,0.55347,27,0.44652,2,23,0.07085,27,0.92914,1,27,1,2,27,0.46399,41,0.536,1,41,1,2,27,0.49599,41,0.504,3,15,0.45138,23,0.46861,30,0.08,4,15,0.1292,23,0.70983,31,0.08096,30,0.08,4,12,0.00083,15,0.45308,23,0.46607,31,0.08,3,15,0.47376,23,0.43823,31,0.088,4,15,0.08883,23,0.82926,27,0.0019,31,0.07999,2,23,0.91199,31,0.088,2,23,0.53199,27,0.468,3,23,0.85363,31,0.08236,30,0.06398,3,23,0.8686,31,0.06739,30,0.06398,2,23,0.91199,31,0.088,2,23,0.91199,30,0.088,3,15,0.06672,23,0.70927,31,0.224,3,15,0.04243,23,0.75756,30,0.2,1,15,1,1,15,1,2,12,0.75999,15,0.24,1,12,1,1,5,1,1,5,1,2,15,0.78807,23,0.21192,2,12,0.13482,15,0.86517,2,12,0.73937,15,0.26062,3,12,0.75413,15,0.05818,5,0.18768,3,12,0.44072,5,0.45527,10,0.10399,2,5,0.84,10,0.15999,2,15,0.87634,23,0.12365,2,12,0.15863,15,0.84136,2,12,0.66761,15,0.33238,3,12,0.89196,15,0.0134,5,0.09463,2,12,0.52973,5,0.47026,2,5,0.528,9,0.47199,1,23,1,1,23,1,1,23,1,1,23,1,1,23,1],"slotPose":[1,0,0,1,0,0],"bonePose":[27,0.000524,-1,1,0.000524,-36.134534,-1292.746462,23,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,15,0.133294,-0.991076,0.991076,0.133294,-102.984795,-1028.747532,12,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04,5,1,0,0,1,-107.18,-913,10,-0.063313,0.997994,-0.997994,-0.063313,-29.39,-886.57,9,0.08646,0.996255,-0.996255,0.08646,-146.29,-879.71,30,0.307689,-0.951487,0.951487,0.307689,-164.467343,-1165.289724,41,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473,31,0.307689,-0.951487,0.951487,0.307689,-50.523269,-1153.740106],"edges":[20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20],"userEdges":[25,38,38,39,39,40,40,41,41,42,42,43,32,44,44,2,39,45,45,46,46,47,47,43,28,48,48,46,45,49,49,43,47,49,49,46,39,49,49,40,49,41,49,42,42,8,41,9,50,25,50,38,50,39,45,50,50,26,27,50,50,28,50,48,34,0,39,51,51,52,52,53,53,54,54,55,55,56,56,17,10,57,57,51,40,57,57,41,11,58,58,52,57,58,12,59,59,53,58,59,13,60,60,54,59,60,14,61,61,55,60,61,15,62,62,56,61,62,62,16,24,63,63,51,38,63,23,64,64,52,63,64,22,65,65,53,64,65,21,66,66,54,65,66,20,67,67,55,66,67,19,68,68,56,67,68,68,18,7,69,69,43,42,69,31,70,70,48,29,70,44,71,71,46,70,71,4,72,72,69,72,6,71,73,73,72,3,73,73,43,73,47,61,15,33,1,50,46]}]},{"name":"logo","display":[{"name":"logo","transform":{"x":-780,"y":-1200,"scX":2.2483,"scY":2.2353}}]},{"name":"1070","display":[{"name":"blank"}]},{"name":"1012","display":[{"name":"blank"}]},{"name":"1074","display":[{"name":"blank"}]},{"name":"1048","display":[{"name":"blank"}]},{"name":"1054","display":[{"name":"blank"}]},{"name":"1031","display":[{"name":"blank"}]},{"name":"1040","display":[{"name":"blank"}]},{"name":"1055","display":[{"name":"blank"}]},{"name":"1006","display":[{"name":"blank"}]},{"name":"1023","display":[{"name":"blank"}]},{"name":"1073","display":[{"name":"blank"}]},{"name":"1005","display":[{"name":"blank"}]},{"name":"1053","display":[{"name":"blank"}]},{"name":"a_head","display":[{"type":"mesh","name":"body/a_head","width":202,"height":238,"vertices":[16.33,-1504.74,21.98,-1463.91,35.04,-1439.42,31.89,-1407.38,16.33,-1381.63,4.4,-1379.75,-15.71,-1346.47,-47.11,-1321.84,-66.57,-1321.83,-93.58,-1330.14,-121.21,-1343.95,-131.26,-1369.08,-150.74,-1397.97,-166.33,-1434.39,-166.33,-1484.02,-149.48,-1531.75,-99.23,-1559.83,-18.21,-1559.82,8.16,-1417.43],"uvs":[0.90429,0.23145,0.93227,0.40299,0.99689,0.50591,0.98134,0.6405,0.90429,0.74871,0.84521,0.75662,0.74571,0.89649,0.59024,0.99998,0.49384,1,0.36014,0.96511,0.22333,0.90705,0.17358,0.80149,0.07718,0.68009,0,0.52702,0,0.31854,0.0834,0.11797,0.33216,0.00001,0.73327,0,0.86386,0.59828],"triangles":[18,3,2,1,18,2,18,4,3,18,5,4,14,18,1,16,14,1,0,16,1,14,13,18,17,16,0,13,12,18,11,5,18,12,11,18,11,6,5,15,14,16,8,7,6,9,8,6,11,9,6,11,10,9],"weights":[1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1],"slotPose":[1,0,0,1,0,0],"bonePose":[41,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473],"edges":[13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,17,17,16,16,15,15,14,14,13],"userEdges":[5,18,18,1]}]},{"name":"1080","display":[{"name":"blank"}]},{"name":"1058","display":[{"name":"blank"}]},{"name":"1042","display":[{"name":"blank"}]},{"name":"1044","display":[{"name":"blank"}]},{"name":"1028","display":[{"name":"blank"}]},{"name":"1009","display":[{"name":"blank"}]},{"name":"1032","display":[{"name":"blank"}]},{"name":"a_arm_R","display":[{"type":"mesh","name":"body/a_arm_R","width":215,"height":517,"vertices":[81.72,-1255.65,87.23,-1225.62,88.19,-1196.91,89.05,-1176.54,98.96,-1082.13,102.77,-1064.36,108.6,-1048.8,118.88,-1032.21,125.62,-1016.31,156.08,-924.91,160.78,-906.8,166.2,-892.24,194.08,-842.75,193.73,-806.16,173.98,-793.48,141.38,-788.53,126.55,-794.62,112.34,-795.36,113.95,-843.1,115.45,-877,118.69,-891.06,110.15,-906.11,61.38,-987.76,54.84,-1003.94,51.56,-1022.51,47.48,-1043.4,43.92,-1062.12,27.02,-1154.25,23.26,-1172.68,12.23,-1188.43,11.67,-1216.34,12.78,-1251.36,33.69,-1284.82,63.43,-1282.58,46.9,-1237.18],"uvs":[0.32581,0.05643,0.35147,0.11454,0.3559,0.17007,0.35986,0.20948,0.40587,0.39208,0.42359,0.42642,0.45069,0.45649,0.49852,0.4886,0.52983,0.51933,0.6716,0.69609,0.69347,0.7311,0.71873,0.75926,0.8484,0.85497,0.84682,0.92574,0.75493,0.95028,0.60335,0.95987,0.5344,0.94809,0.46827,0.94666,0.47573,0.85433,0.4827,0.78877,0.4977,0.76157,0.45795,0.73247,0.2311,0.57457,0.20065,0.54331,0.18539,0.50737,0.16637,0.46696,0.14986,0.43073,0.07133,0.25255,0.05388,0.21689,0.0026,0.18644,0,0.13246,0.0052,0.0647,0.10243,0,0.24075,0.00432,0.16387,0.09214],"triangles":[18,14,12,11,18,12,12,14,13,18,16,15,19,18,11,18,15,14,22,21,8,8,21,9,10,20,11,20,19,11,9,20,10,21,20,9,18,17,16,7,23,8,23,22,8,3,27,4,6,24,7,24,23,7,25,24,6,5,25,6,27,26,4,4,26,5,26,25,5,0,34,1,2,28,3,28,27,3,33,34,0,30,29,34,32,34,33,32,31,34,31,30,34,29,28,2,29,2,1,34,29,1],"weights":[2,29,0.57599,23,0.424,1,29,1,1,29,1,1,29,1,1,29,1,2,44,0.0888,29,0.91119,2,44,0.44505,29,0.55494,2,44,0.84135,29,0.15864,2,44,0.97337,29,0.02662,2,44,0.93063,26,0.06936,2,44,0.54329,26,0.4567,2,44,0.15151,26,0.84848,1,26,1,1,26,1,1,26,1,1,26,1,1,26,1,1,26,1,2,44,0.00405,26,0.99594,2,44,0.1612,26,0.83879,2,44,0.50837,26,0.49162,2,44,0.9084,26,0.09159,2,44,0.98867,29,0.01132,2,44,0.88838,29,0.11161,2,44,0.61378,29,0.38621,2,44,0.19782,29,0.80217,2,44,0.02531,29,0.97468,1,29,1,2,29,0.91199,23,0.088,2,29,0.472,23,0.52799,2,29,0.264,23,0.73599,2,29,0.06398,23,0.936,2,29,0.096,23,0.90399,2,29,0.168,23,0.83199,2,29,0.488,23,0.51199],"slotPose":[1,0,0,1,0,0],"bonePose":[29,0.193207,0.981158,-0.981158,0.193207,42.671847,-1232.663838,23,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,44,0.385906,0.922538,-0.922538,0.385906,81.127245,-1035.875814,26,0.400349,0.916363,-0.916363,0.400349,139.903737,-897.076346],"edges":[30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,33,33,32,32,31,31,30],"userEdges":[24,6,23,7,25,5,26,4,22,8,20,10,19,11,21,9,28,2,29,1,0,34,34,30,34,31,32,34,34,33,27,3]}]},{"name":"1004","display":[{"name":"blank"}]},{"name":"1086","display":[{"name":"blank"}]},{"name":"1049","display":[{"name":"blank"}]},{"name":"1071","display":[{"name":"blank"}]},{"name":"1057","display":[{"name":"blank"}]},{"name":"1021","display":[{"name":"blank"}]},{"name":"1043","display":[{"name":"blank"}]},{"name":"1027","display":[{"name":"blank"}]},{"name":"1025","display":[{"name":"blank"}]},{"name":"1084","display":[{"name":"blank"}]},{"name":"1056","display":[{"name":"blank"}]},{"name":"1050","display":[{"name":"blank"}]},{"name":"1083","display":[{"name":"blank"}]},{"name":"blank","display":[{"name":"blank"}]},{"name":"1066","display":[{"name":"blank"}]},{"name":"a_leg_R","display":[{"type":"mesh","name":"body/a_leg_R","width":260,"height":930,"vertices":[33.51,-905.49,35.31,-873.55,34.72,-839.5,27.52,-805.57,8.86,-681.07,-10.39,-545.17,-12.95,-522.73,-12.5,-503.27,-1.97,-486.23,11.59,-472.37,63.14,-406.33,105.47,-248.25,129.14,-168.36,140.27,-150.1,149.41,-129.59,152.14,-111.75,156.14,-70.64,155.98,-10.2,112.99,-10.32,89.3,-10.38,96.89,-96.71,96.48,-113.63,90.55,-132.93,82.9,-154.16,51.97,-228.51,-22.56,-367.87,-65.96,-434.45,-82.67,-456.6,-98.05,-481.69,-101.09,-511.7,-102.55,-540.17,-102.47,-679.22,-97.94,-803.63,-94.45,-828.9,-91.92,-852.09,-77.52,-879.17,-55.37,-916.16,-19.98,-940.82,22,-940.82,-26.32,-886.55],"uvs":[0.5225,0.03801,0.52947,0.07233,0.52727,0.10896,0.49966,0.14544,0.4282,0.27933,0.35449,0.42545,0.34469,0.44957,0.34644,0.47046,0.38707,0.48872,0.43938,0.50356,0.63841,0.57439,0.80303,0.7442,0.89499,0.83002,0.93806,0.84961,0.97346,0.87163,0.98417,0.89081,0.99999,0.935,1,1,0.83459,1,0.74351,1,0.77177,0.90716,0.77003,0.88897,0.747,0.86823,0.71733,0.84544,0.59753,0.76561,0.30928,0.61603,0.1416,0.54458,0.07702,0.52081,0.01753,0.49384,0.00569,0.46154,0,0.4309,0,0.28138,0.01711,0.1476,0.03045,0.12042,0.04011,0.09545,0.09547,0.06634,0.18062,0.02652,0.31674,0,0.47818,0,0.29239,0.05838],"triangles":[15,20,16,20,18,16,16,18,17,14,21,15,21,20,15,13,21,14,24,23,11,20,19,18,11,23,12,12,22,13,22,21,13,10,25,11,25,24,11,23,22,12,9,25,10,31,5,4,26,25,9,32,4,3,0,39,1,32,31,4,33,32,3,31,30,5,8,26,9,35,34,39,36,39,37,7,27,8,27,26,8,30,6,5,28,27,7,6,29,7,29,28,7,30,29,6,36,35,39,1,34,2,39,34,1,3,33,2,34,33,2,0,39,38,37,39,38],"weights":[2,10,0.568,5,0.432,2,10,0.928,5,0.07199,1,10,1,1,10,1,1,10,1,2,10,0.97544,18,0.02455,2,10,0.82846,18,0.17153,2,10,0.48724,18,0.51275,2,10,0.15204,18,0.84795,2,10,0.03176,18,0.96823,1,18,1,1,18,1,1,18,1,2,18,0.82076,20,0.17923,2,18,0.51153,20,0.48846,2,18,0.24923,20,0.75076,1,20,1,1,20,1,1,20,1,1,20,1,2,18,0.15793,20,0.84206,2,18,0.44792,20,0.55207,2,18,0.81762,20,0.18237,1,18,1,1,18,1,1,18,1,2,10,0.00055,18,0.99944,2,10,0.18658,18,0.81341,2,10,0.50372,18,0.49627,2,10,0.80275,18,0.19724,2,10,0.97444,18,0.02555,1,10,0.99999,1,10,1,2,10,0.904,5,0.09599,2,10,0.57599,5,0.42399,2,10,0.344,5,0.65599,3,10,0.1966,5,0.57138,12,0.23199,3,10,0.05222,5,0.35577,12,0.592,3,10,0.04409,5,0.3799,12,0.57599,2,10,0.512,5,0.48799],"slotPose":[1,0,0,1,0,0],"bonePose":[10,-0.063313,0.997994,-0.997994,-0.063313,-29.39,-886.57,5,1,0,0,1,-107.18,-913,18,0.431613,0.902059,-0.902059,0.431613,-53.252689,-491.788776,20,0.03769,0.999289,-0.999289,0.03769,124.83646,-122.229299,12,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04],"edges":[30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30],"userEdges":[28,7,29,6,30,5,31,4,27,8,26,9,25,10,24,11,21,14,22,13,23,12,20,15,32,3,34,1,33,2,0,39,39,35,36,39,39,37,39,38]}]},{"name":"1010","display":[{"name":"blank"}]},{"name":"1017","display":[{"name":"blank"}]},{"name":"1022","display":[{"name":"blank"}]},{"name":"1003","display":[{"name":"blank"}]},{"name":"1081","display":[{"name":"blank"}]},{"name":"1037","display":[{"name":"blank"}]},{"name":"1047","display":[{"name":"blank"}]},{"name":"1059","display":[{"name":"blank"}]},{"name":"1079","display":[{"name":"blank"}]},{"name":"1061","display":[{"name":"blank"}]},{"name":"1068","display":[{"name":"blank"}]},{"name":"1014","display":[{"name":"blank"}]},{"name":"1078","display":[{"name":"blank"}]},{"name":"1076","display":[{"name":"blank"}]},{"name":"1016","display":[{"name":"blank"}]},{"name":"1051","display":[{"name":"blank"}]},{"name":"1038","display":[{"name":"blank"}]},{"name":"1035","display":[{"name":"blank"}]},{"name":"1064","display":[{"name":"blank"}]},{"name":"1018","display":[{"name":"blank"}]},{"name":"1030","display":[{"name":"blank"}]},{"name":"1033","display":[{"name":"blank"}]},{"name":"1029","display":[{"name":"blank"}]},{"name":"1063","display":[{"name":"blank"}]}]}],"animation":[{"duration":70,"name":"idle","bone":[{"name":"ik_foot_r","translateFrame":[{"duration":44,"tweenEasing":0},{"duration":26,"tweenEasing":0,"x":6.5},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"curve":[0.2595,0,0.946,0.8400000000000001],"x":-3.82,"y":0.6},{"duration":26,"curve":[0.228,0.135,0.7655000000000001,0.975],"x":-4.65,"y":0.79},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"curve":[0.2595,0,0.946,0.8400000000000001],"rotate":0.17},{"duration":26,"curve":[0.228,0.135,0.7655000000000001,0.975],"rotate":0.2},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":-0.29,"y":-1.62},{"duration":26,"tweenEasing":0,"x":-0.17,"y":-0.95},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.31},{"duration":26,"tweenEasing":0,"rotate":-0.19},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":1.65,"y":0.09},{"duration":26,"tweenEasing":0,"x":1.74,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.23},{"duration":26,"tweenEasing":0,"rotate":-0.17},{"duration":0}]},{"name":"foot_r","rotateFrame":[{"duration":44,"tweenEasing":0},{"duration":26,"tweenEasing":0,"rotate":2.99},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.08,"y":-0.01},{"duration":26,"tweenEasing":0,"x":2.57,"y":-0.29},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.89},{"duration":26,"tweenEasing":0,"rotate":0.47},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.15},{"duration":26,"tweenEasing":0,"rotate":-0.33},{"duration":0}]},{"name":"upperarm_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":0.76},{"duration":26,"tweenEasing":0,"rotate":1.63},{"duration":0}]},{"name":"upperarm_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-3.28},{"duration":26,"tweenEasing":0,"rotate":-4.04},{"duration":0}]},{"name":"xiong_l","translateFrame":[{"duration":15,"tweenEasing":0,"x":-1.48,"y":-4.58},{"duration":20,"tweenEasing":0,"x":-10.09,"y":5.25},{"duration":15,"tweenEasing":0,"x":10.49,"y":10.9},{"duration":20,"tweenEasing":0,"x":27.2,"y":4.5},{"duration":0,"x":-1.48,"y":-4.58}]},{"name":"xiong_r","translateFrame":[{"duration":15,"tweenEasing":0,"x":1.99,"y":6.16},{"duration":20,"tweenEasing":0,"x":-10.63,"y":0.37},{"duration":15,"tweenEasing":0,"x":4.31,"y":-9.17},{"duration":20,"tweenEasing":0,"x":20.58,"y":-8.09},{"duration":0,"x":1.99,"y":6.16}]},{"name":"forearm_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.24},{"duration":6,"tweenEasing":0,"rotate":0.88},{"duration":20,"tweenEasing":0,"rotate":1.2},{"duration":0}]},{"name":"forearm_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":2.2},{"duration":6,"tweenEasing":0,"rotate":1.25},{"duration":20,"tweenEasing":0,"rotate":0.16},{"duration":0}]},{"name":"head","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":-1.11},{"duration":26,"tweenEasing":0,"x":-1.36},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":5.48},{"duration":22,"tweenEasing":0,"rotate":5.11},{"duration":26,"tweenEasing":0,"rotate":5.72},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":15},{"duration":29,"tweenEasing":0},{"duration":26,"tweenEasing":0,"x":0.88},{"duration":0}]},{"name":"hand_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.95},{"duration":26,"tweenEasing":0,"rotate":-0.84},{"duration":0}]},{"name":"hand_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.52},{"duration":6,"tweenEasing":0,"rotate":-0.41},{"duration":20,"tweenEasing":0,"rotate":-1.08},{"duration":0}]},{"name":"dress0101","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":2.94},{"duration":15,"tweenEasing":0,"rotate":-0.24},{"duration":20,"tweenEasing":0,"rotate":-2.57},{"duration":0}]},{"name":"dress0201","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-0.24},{"duration":13,"tweenEasing":0,"rotate":0.27},{"duration":15,"tweenEasing":0,"rotate":-1.35},{"duration":20,"tweenEasing":0,"rotate":-1.99},{"duration":0,"rotate":-0.24}],"scaleFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"x":0.99},{"duration":15,"tweenEasing":0,"x":0.98},{"duration":20,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"dress0301","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":-3.95},{"duration":15,"tweenEasing":0,"rotate":-1.11},{"duration":20,"tweenEasing":0,"rotate":1.42},{"duration":0}]},{"name":"dress0102","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":-1.33},{"duration":15,"tweenEasing":0,"rotate":1.12},{"duration":20,"tweenEasing":0,"rotate":0.58},{"duration":0}]},{"name":"dress0202","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":0.22},{"duration":13,"tweenEasing":0,"rotate":0.71},{"duration":15,"tweenEasing":0,"rotate":1.98},{"duration":20,"tweenEasing":0,"rotate":1.97},{"duration":0,"rotate":0.22}]},{"name":"dress0302","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-2.34},{"duration":13,"tweenEasing":0,"rotate":-2.61},{"duration":15,"tweenEasing":0,"rotate":-4.52},{"duration":20,"tweenEasing":0,"rotate":-3.87},{"duration":0,"rotate":-2.34}]},{"name":"dress0103","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":0.34},{"duration":15,"tweenEasing":0,"rotate":2.76},{"duration":20,"tweenEasing":0,"rotate":3.21},{"duration":0}]},{"name":"dress0203","rotateFrame":[{"duration":22,"rotate":-0.42},{"duration":13,"tweenEasing":0,"rotate":-0.42},{"duration":15,"tweenEasing":0,"rotate":0.11},{"duration":20,"tweenEasing":0,"rotate":-0.41},{"duration":0,"rotate":-0.42}]},{"name":"dress0303","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-0.24},{"duration":13,"tweenEasing":0,"rotate":0.98},{"duration":15,"tweenEasing":0,"rotate":-1.47},{"duration":20,"tweenEasing":0,"rotate":-2.69},{"duration":0,"rotate":-0.24}]},{"name":"dress0104","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":-0.34},{"duration":15,"tweenEasing":0,"rotate":1.23},{"duration":20,"tweenEasing":0,"rotate":2.69},{"duration":0}]},{"name":"dress0204","rotateFrame":[{"duration":22,"rotate":-3.52},{"duration":13,"tweenEasing":0,"rotate":-3.52},{"duration":15,"tweenEasing":0,"rotate":-3.1},{"duration":20,"tweenEasing":0,"rotate":-1.55},{"duration":0,"rotate":-3.52}]},{"name":"dress0304","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-1.06},{"duration":13,"tweenEasing":0,"rotate":2.24},{"duration":15,"tweenEasing":0,"rotate":-2.31},{"duration":20,"tweenEasing":0,"rotate":-2.85},{"duration":0,"rotate":-1.06}]},{"name":"dress0105","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":-1.43},{"duration":15,"tweenEasing":0,"rotate":0.13},{"duration":20,"tweenEasing":0,"rotate":1.34},{"duration":0}]},{"name":"dress0205","rotateFrame":[{"duration":22,"rotate":-3.21},{"duration":13,"tweenEasing":0,"rotate":-3.21},{"duration":15,"tweenEasing":0,"rotate":0.26},{"duration":20,"tweenEasing":0,"rotate":1.24},{"duration":0,"rotate":-3.21}]},{"name":"dress0305","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-1.06},{"duration":13,"tweenEasing":0,"rotate":0.1},{"duration":15,"tweenEasing":0,"rotate":-1.69},{"duration":20,"tweenEasing":0,"rotate":-2.94},{"duration":0,"rotate":-1.06}]},{"name":"hair0302","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-9.49},{"duration":15,"tweenEasing":0,"rotate":-5.83},{"duration":20,"tweenEasing":0,"rotate":-3.14},{"duration":0}]},{"name":"hair0202","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-5.26},{"duration":15,"tweenEasing":0,"rotate":-3.71},{"duration":20,"tweenEasing":0,"rotate":4.87},{"duration":0}]},{"name":"hair0401","rotateFrame":[{"duration":15,"tweenEasing":0,"rotate":-1.25},{"duration":20,"tweenEasing":0,"rotate":3.1},{"duration":15,"tweenEasing":0,"rotate":3.63},{"duration":20,"tweenEasing":0,"rotate":1.4},{"duration":0,"rotate":-1.25}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.01},{"duration":15,"tweenEasing":0,"x":1.01},{"duration":20,"tweenEasing":0,"x":0.99,"y":1.03},{"duration":0}]},{"name":"hair0603","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-0.33},{"duration":15,"tweenEasing":0,"rotate":1.38},{"duration":20,"tweenEasing":0,"rotate":-0.39},{"duration":0}]},{"name":"hair0403","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-9},{"duration":15,"tweenEasing":0,"rotate":-5.55},{"duration":20,"tweenEasing":0,"rotate":1.59},{"duration":0}]},{"name":"hair0101","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":3.16},{"duration":15,"tweenEasing":0,"rotate":3.55},{"duration":20,"tweenEasing":0,"rotate":-0.57},{"duration":0}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.01,"y":1.03},{"duration":15,"tweenEasing":0,"x":1.02,"y":1.06},{"duration":20,"tweenEasing":0,"x":1.02,"y":1.09},{"duration":0}]},{"name":"hair0501","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":0.95},{"duration":15,"tweenEasing":0,"rotate":1.39},{"duration":20,"tweenEasing":0,"rotate":-2.05},{"duration":0}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.02},{"duration":15,"tweenEasing":0,"x":1.01},{"duration":20}]},{"name":"hair0102","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-3.47},{"duration":15,"tweenEasing":0,"rotate":-0.97},{"duration":20,"tweenEasing":0,"rotate":3.04},{"duration":0}]},{"name":"hair0201","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":5.64},{"duration":15,"tweenEasing":0,"rotate":2.37},{"duration":20,"tweenEasing":0,"rotate":-2.93},{"duration":0}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.01},{"duration":15,"tweenEasing":0,"x":1.01},{"duration":20,"tweenEasing":0,"x":0.99,"y":1.1},{"duration":0}]},{"name":"hair0103","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-5.36},{"duration":15,"tweenEasing":0,"rotate":-3.28},{"duration":20,"tweenEasing":0,"rotate":2.54},{"duration":0}]},{"name":"hair0602","rotateFrame":[{"duration":15,"tweenEasing":0,"rotate":-1.51},{"duration":20,"tweenEasing":0,"rotate":-0.71},{"duration":15,"tweenEasing":0,"rotate":-3.86},{"duration":20,"tweenEasing":0,"rotate":-3.17},{"duration":0,"rotate":-1.51}]},{"name":"hair0301","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":5.27},{"duration":15,"tweenEasing":0,"rotate":4.97},{"duration":20,"tweenEasing":0,"rotate":-0.41},{"duration":0}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.01},{"duration":15,"tweenEasing":0,"x":1.03},{"duration":20,"tweenEasing":0,"x":1.01,"y":1.1},{"duration":0}]},{"name":"hair0601","rotateFrame":[{"duration":15,"tweenEasing":0,"rotate":-3.34},{"duration":20,"tweenEasing":0,"rotate":-5.91},{"duration":15,"tweenEasing":0,"rotate":-5.59},{"duration":20,"tweenEasing":0,"rotate":-3.3},{"duration":0,"rotate":-3.34}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.02},{"duration":15,"tweenEasing":0,"x":1.01,"y":1.02},{"duration":20,"tweenEasing":0,"y":1.04},{"duration":0}]},{"name":"hair0502","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":0.42},{"duration":15,"tweenEasing":0,"rotate":-1.83},{"duration":20,"tweenEasing":0,"rotate":3.17},{"duration":0}]},{"name":"hair0503","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-2.64},{"duration":15,"tweenEasing":0,"rotate":-2.78},{"duration":20,"tweenEasing":0,"rotate":1.4},{"duration":0}]},{"name":"hair0402","rotateFrame":[{"duration":15,"tweenEasing":0,"rotate":-0.94},{"duration":20,"tweenEasing":0,"rotate":-4.85},{"duration":15,"tweenEasing":0,"rotate":-1.27},{"duration":20,"tweenEasing":0,"rotate":-3.24},{"duration":0,"rotate":-0.94}]},{"name":"bag0101","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":3.56,"y":-2.67},{"duration":26,"tweenEasing":0,"x":3.31,"y":0.72},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.34},{"duration":26,"tweenEasing":0,"rotate":-3},{"duration":0}]},{"name":"bag0102","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.59,"y":1.36},{"duration":26,"tweenEasing":0,"x":1.17,"y":-1.13},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.19},{"duration":26,"tweenEasing":0,"rotate":0.41},{"duration":0}]},{"name":"hair0504","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-1.51},{"duration":15,"tweenEasing":0,"rotate":0.09},{"duration":20,"tweenEasing":0,"rotate":-3.69},{"duration":0}]},{"name":"hair0604","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":1.62},{"duration":15,"tweenEasing":0,"rotate":1.93},{"duration":20,"tweenEasing":0,"rotate":0.89},{"duration":0}]},{"name":"hair0505","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":2.83},{"duration":15,"tweenEasing":0,"rotate":-0.84},{"duration":20,"tweenEasing":0,"rotate":-4.33},{"duration":0}]},{"name":"hair0605","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":2.85},{"duration":15,"tweenEasing":0,"rotate":1.24},{"duration":20,"tweenEasing":0,"rotate":-0.49},{"duration":0}]},{"name":"finger_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.72},{"duration":26,"tweenEasing":0,"rotate":0.51},{"duration":0}]},{"name":"figner_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":0.64},{"duration":26,"tweenEasing":0,"rotate":-0.88},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":60,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-2.03,-5.52,-2.98,-4.71,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":40,"name":"angry","bone":[{"name":"pelvis","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-15.8,"y":12.43},{"duration":5,"tweenEasing":0,"x":-18.91,"y":18.67},{"duration":15,"tweenEasing":0,"x":30.03,"y":-8.63},{"duration":10,"tweenEasing":0,"x":19.35,"y":0.32},{"duration":0}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-1.23},{"duration":5,"tweenEasing":0,"rotate":-3.19},{"duration":25,"tweenEasing":0,"rotate":2.16},{"duration":0}],"scaleFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.01,"y":1.01},{"duration":10}]},{"name":"spine","rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"rotate":-0.82},{"duration":15,"tweenEasing":0,"rotate":-0.82},{"duration":5,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.36},{"duration":0}]},{"name":"spine1","rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"rotate":-1.06},{"duration":5,"tweenEasing":0,"rotate":-1.06},{"duration":10,"tweenEasing":0,"rotate":0.69},{"duration":5,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":0.12},{"duration":0}]},{"name":"spine2","rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"rotate":-4.74},{"duration":5,"tweenEasing":0,"rotate":-4.74},{"duration":10,"tweenEasing":0,"rotate":-1.49},{"duration":5,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.02},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":9.53},{"duration":5,"tweenEasing":0,"rotate":7.9},{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":0.25},{"duration":10}]},{"name":"head","rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":5.48},{"duration":5,"tweenEasing":0,"rotate":7.06},{"duration":5,"tweenEasing":0,"rotate":9.75},{"duration":10,"tweenEasing":0,"rotate":0.06},{"duration":5,"rotate":3.23},{"duration":10,"tweenEasing":0,"rotate":-0.28},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":15},{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.1},{"duration":10,"x":1.1},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":5.52,"y":-0.79},{"duration":15,"tweenEasing":0,"x":0.25,"y":-7.74},{"duration":10,"tweenEasing":0,"x":0.98,"y":-0.45},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":6.95},{"duration":15,"tweenEasing":0,"rotate":3.13},{"duration":10,"tweenEasing":0,"rotate":11.35},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.47,"y":-3.41},{"duration":10,"tweenEasing":0,"x":3.23,"y":1.87},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":15,"tweenEasing":0,"rotate":-6.79},{"duration":10,"tweenEasing":0,"rotate":-6.79},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":8,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":7,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":15,"tweenEasing":0,"vertices":[-1.87,0.62,-1.98,0.28,0,0,-1.01,-0.08,-2.5,0.57,0,0,5.1,-2.2,4.88,-1.8,0,0,-1.28,0.31,-5.9,-0.75,0,0,0,0,0,0,0,0,0,0,0,0,-0.49,0.11,-0.25,-0.44,-0.82,-1.82,-1.33,0.12,0,0,-0.68,-2.71,-2.19,-0.66,-3.29,-1.44,0,0,0,0,0,0,0,0,2.73,-2.91,0,0,0,0,0,0,0,0,1.88,0.07,0,0,0,0,1.15,-2.74,1.88,0.07,0.12,1.14,0.18,-1.39,0.35,-2.78,0.91,-2.04,2.16,-1.07,0.88,-0.95,0,0,9.65,-0.88,10.24,-4.97,13.91,-3.95,2.73,-0.14,-11.78,6.19,-6.91,8.32,-3.57,-3.84,-1.38,1.31,-3.18,7.19,-3.54,8.05,0,0,0,0,0,0,0,0,-1.89,-1.06,-0.9,0,0,2.94,1.7,-0.28,-2.77,-0.52,-3.56,-1.11,-4.97,-0.67,-4.47,-1.58,-1.09,-0.06,2.34,-0.26,0,0,15.31,0.26,5.27,-1.13]},{"duration":10,"tweenEasing":0,"vertices":[-1.87,0.62,-1.98,0.28,0,0,-1.01,-0.08,-2.5,0.57,0,0,5.1,-2.2,4.88,-1.8,0,0,-1.28,0.31,-5.9,-0.75,0,0,0,0,0,0,0,0,0,0,0,0,-0.49,0.11,-0.25,-0.44,-0.82,-1.82,-1.33,0.12,0,0,-0.68,-2.71,-2.19,-0.66,-3.29,-1.44,0,0,0,0,0,0,0,0,2.73,-2.91,0,0,0,0,0,0,0,0,1.88,0.07,0,0,0,0,1.15,-2.74,1.88,0.07,0.12,1.14,0.18,-1.39,0.35,-2.78,0.91,-2.04,2.16,-1.07,0.88,-0.95,0,0,9.65,-0.88,10.24,-4.97,13.91,-3.95,2.73,-0.14,-11.78,6.19,-6.91,8.32,-3.57,-3.84,-1.38,1.31,-3.18,7.19,-3.54,8.05,0,0,0,0,0,0,0,0,-1.89,-1.06,-0.9,0,0,2.94,1.7,-0.28,-2.77,-0.52,-3.56,-1.11,-4.97,-0.67,-4.47,-1.58,-1.09,-0.06,2.34,-0.26,0,0,15.31,0.26,5.27,-1.13]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":40,"name":"badmemory","bone":[{"name":"head","rotateFrame":[{"duration":16,"tweenEasing":0,"rotate":5.48},{"duration":6,"tweenEasing":0,"rotate":6.92},{"duration":12,"tweenEasing":0,"rotate":-0.07},{"duration":6,"tweenEasing":0,"rotate":0.54},{"duration":0,"rotate":5.48}]},{"name":"spine2","translateFrame":[{"duration":6,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":2.53,"y":-0.33},{"duration":8,"tweenEasing":0,"x":4.82,"y":-0.61},{"duration":17}],"rotateFrame":[{"duration":6,"tweenEasing":0},{"duration":9,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":0.9},{"duration":11,"tweenEasing":0,"rotate":2.2},{"duration":6,"tweenEasing":0,"rotate":2.89},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":12.03,"y":-1.18},{"duration":6,"tweenEasing":0,"x":28.37,"y":-1.65},{"duration":12,"tweenEasing":0,"x":22.59,"y":-1.35},{"duration":6,"tweenEasing":0,"x":20.06,"y":-1.64},{"duration":0}],"rotateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":0.57},{"duration":6,"tweenEasing":0,"rotate":0.16},{"duration":12,"tweenEasing":0,"rotate":-0.71},{"duration":6,"tweenEasing":0,"rotate":-0.71},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":0.01,"y":-2.04},{"duration":24}],"rotateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0},{"duration":6,"tweenEasing":0,"rotate":-1.26},{"duration":12,"tweenEasing":0,"rotate":-1.4},{"duration":6,"tweenEasing":0,"rotate":-1.01},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.38,"y":-0.07},{"duration":6,"tweenEasing":0,"x":1.44,"y":-0.06},{"duration":18}],"rotateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0},{"duration":6,"tweenEasing":0,"rotate":0.33},{"duration":12,"tweenEasing":0,"rotate":1.87},{"duration":6,"tweenEasing":0,"rotate":1.54},{"duration":0}]},{"name":"face","scaleFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.05},{"duration":20,"tweenEasing":0,"x":0.96},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":16,"tweenEasing":0},{"duration":9,"tweenEasing":0,"rotate":1.02},{"duration":9,"rotate":-5.91},{"duration":6,"tweenEasing":0,"rotate":-5.91},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":10.28,"y":-32.99},{"duration":0}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-6.09},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":15.8,"y":12.4},{"duration":0}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":6.59},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":16,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":6,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.43,-0.5,0.25,3.92,2.03,6.25,0.8,5.53,-4.6,-3.81,-4.05,-5.21,-3.78,-5.56,-0.44,-3.11,-2.52,-1.5,2.35,0.75]},{"duration":12,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,0.23,-3.27,-1.91,-3.53,-3.29,-2.4,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.17,-4.3,-2.98,-4.88,-3.41,-3.21,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"cry","bone":[{"name":"pelvis","translateFrame":[{"duration":6,"tweenEasing":0},{"duration":11,"tweenEasing":0,"x":11.5,"y":-0.72},{"duration":11,"tweenEasing":0,"x":18.27,"y":-0.99},{"duration":5,"tweenEasing":0,"x":17.36,"y":-0.99},{"duration":7,"tweenEasing":0,"x":19.78,"y":-0.99},{"duration":5,"tweenEasing":0,"x":11.18,"y":-0.99},{"duration":5,"tweenEasing":0,"x":13.02,"y":-1.49},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":9,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":0.06,"y":0.73},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-0.43},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-0.43},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-0.43},{"duration":9}],"rotateFrame":[{"duration":9,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":-0.31},{"duration":24,"tweenEasing":0,"rotate":0.09},{"duration":9,"tweenEasing":0,"rotate":0.09},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":9,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.84,"y":0.11},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":9}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":-0.47},{"duration":3,"tweenEasing":0,"rotate":-1.54},{"duration":5,"tweenEasing":0,"rotate":-0.78},{"duration":24,"tweenEasing":0,"rotate":-0.93},{"duration":9,"tweenEasing":0,"rotate":-0.93},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":2.8,"y":0.62},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":9}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":6,"tweenEasing":0,"rotate":2.33},{"duration":25,"tweenEasing":0,"rotate":1.32},{"duration":9,"tweenEasing":0,"rotate":1.32},{"duration":0}]},{"name":"head","translateFrame":[{"duration":17,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-2.72,"y":0.02},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-2.72,"y":0.02},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-2.72,"y":0.02},{"duration":9}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":5.48},{"duration":4,"tweenEasing":0,"rotate":6.42},{"duration":3,"tweenEasing":0,"rotate":4.02},{"duration":5,"tweenEasing":0,"rotate":1.91},{"duration":3,"tweenEasing":0,"rotate":3.51},{"duration":5,"tweenEasing":0,"rotate":2.55},{"duration":3,"tweenEasing":0,"rotate":3.51},{"duration":5,"tweenEasing":0,"rotate":2.55},{"duration":3,"tweenEasing":0,"rotate":3.51},{"duration":5,"tweenEasing":0,"rotate":2.55},{"duration":9,"tweenEasing":0,"rotate":3.51},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":17},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.94},{"duration":9}]},{"name":"hand_l","translateFrame":[{"duration":20,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":9.7,"y":-14.97},{"duration":0}],"rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-11.12},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":20,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.59,"y":-7.58},{"duration":20,"tweenEasing":0,"x":1.59,"y":-7.58},{"duration":0}],"rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":2.29},{"duration":20,"tweenEasing":0,"rotate":2.29},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.17,-4.3,-2.98,-4.88,-3.41,-3.21,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.41,13.36,4.11,16.79,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,0.36,1.31,1.27,2.27,0.77,2.38,1.01,1.34,-0.49,-5.68,-3.16,-5.41,-2.61,-3.66,0.47,-0.36,1.28,-1.61,1.7,-0.66,4.7,12.53,3.9,5.11,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.17,-4.3,-2.98,-4.88,-3.41,-3.21,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":10,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"laugh","bone":[{"name":"pelvis","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":11.5,"y":-0.72},{"duration":4,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":4,"tweenEasing":0,"x":21.09,"y":-1.41},{"duration":4,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":5,"tweenEasing":0,"x":21.09,"y":-1.41},{"duration":5,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":6,"tweenEasing":0,"x":21.09,"y":-1.41},{"duration":3,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":9,"tweenEasing":0,"x":13.02,"y":-0.63},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"y":-0.43},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-0.43},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"y":-0.43},{"duration":12}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":28,"tweenEasing":0,"rotate":0.09},{"duration":12,"tweenEasing":0,"rotate":0.09},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":12}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-0.47},{"duration":28,"tweenEasing":0,"rotate":-0.93},{"duration":12,"tweenEasing":0,"rotate":-0.93},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":12}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-0.85},{"duration":28,"tweenEasing":0,"rotate":1.32},{"duration":12,"tweenEasing":0,"rotate":1.32},{"duration":0}]},{"name":"head","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":-1.36,"y":0.01},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-1.36,"y":0.01},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":-1.36,"y":0.01},{"duration":12}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":5.48},{"duration":5,"tweenEasing":0,"rotate":6.42},{"duration":4,"tweenEasing":0,"rotate":19.15},{"duration":4,"tweenEasing":0,"rotate":20.93},{"duration":4,"tweenEasing":0,"rotate":19.15},{"duration":5,"tweenEasing":0,"rotate":20.93},{"duration":5,"tweenEasing":0,"rotate":19.15},{"duration":6,"tweenEasing":0,"rotate":20.93},{"duration":12,"tweenEasing":0,"rotate":19.15},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":10},{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.11},{"duration":11,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":1.11},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":5.29,"y":-10.57},{"duration":10,"tweenEasing":0,"x":5.29,"y":-10.57},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-7.22},{"duration":10,"tweenEasing":0,"rotate":-10.06},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":30,"tweenEasing":0,"y":-8.81},{"duration":10,"tweenEasing":0,"y":-8.81},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":1.46},{"duration":10,"tweenEasing":0,"rotate":3.81},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":10,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":8,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,0.44,1.7,0.44,1.7,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.96,-4.45,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.07,1.35,0.68,2.47,-0.33,2.22,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":6,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,0.44,1.7,0.44,1.7,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.52,-3.81,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,0.65,-2.55,-0.74,-1.42,-1.75,-1.68,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":6,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.66,-4.45,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":10,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,0.44,1.7,0.44,1.7,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.78,-4.46,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,0.94,-2.6,-0.45,-1.48,-1.46,-1.73,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":10,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.3,-3.2,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":55,"name":"sad","bone":[{"name":"pelvis","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":10.08,"y":-0.49},{"duration":15,"tweenEasing":0,"x":23.26,"y":-0.99},{"duration":13,"tweenEasing":0,"x":31.41,"y":-1.99},{"duration":10,"tweenEasing":0,"x":13.02},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":17,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":-0.25,"y":-2.49},{"duration":23,"tweenEasing":0,"y":0.16},{"duration":0}],"rotateFrame":[{"duration":17,"tweenEasing":0},{"duration":15,"tweenEasing":0,"rotate":-0.31},{"duration":23,"tweenEasing":0,"rotate":-0.23},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.36,"y":0.08},{"duration":23,"tweenEasing":0,"x":0.53,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0,"rotate":-0.05},{"duration":15,"tweenEasing":0,"rotate":-0.78},{"duration":23,"tweenEasing":0,"rotate":-0.08},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":2.66,"y":-0.29},{"duration":23,"tweenEasing":0,"x":7.96,"y":-0.97},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0,"rotate":2.66},{"duration":15,"tweenEasing":0,"rotate":4.62},{"duration":23,"tweenEasing":0,"rotate":2.8},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0,"rotate":-3.28},{"duration":15,"tweenEasing":0,"rotate":-4.66},{"duration":13,"tweenEasing":0,"rotate":-5.29},{"duration":10,"tweenEasing":0,"rotate":-3.28},{"duration":0}]},{"name":"head","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":-0.87,"y":0.02},{"duration":15,"tweenEasing":0,"x":-2.72,"y":0.07},{"duration":13,"tweenEasing":0,"x":-2.72,"y":0.07},{"duration":10,"tweenEasing":0,"x":-0.87,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":5.48},{"duration":7,"tweenEasing":0,"rotate":-5.66},{"duration":15,"tweenEasing":0,"rotate":-5.04},{"duration":13,"tweenEasing":0,"rotate":-2.39},{"duration":10,"tweenEasing":0,"rotate":-4.39},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":17},{"duration":15,"tweenEasing":0},{"duration":23,"tweenEasing":0,"x":0.85},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":20,"tweenEasing":0},{"duration":35,"tweenEasing":0,"x":5.12,"y":13.17},{"duration":0}],"rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":35,"tweenEasing":0,"rotate":-8.33},{"duration":0}]},{"name":"hand_r","rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":35,"tweenEasing":0,"rotate":6.75},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":17,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":15,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,0.23,-3.27,-1.91,-3.53,-3.29,-2.4,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":23,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,0.23,-3.27,-1.91,-3.53,-3.29,-2.4,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"shock","bone":[{"name":"pelvis","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":89.53,"y":-0.76},{"duration":25,"tweenEasing":0,"x":82.93,"y":-1.94},{"duration":10,"tweenEasing":0,"x":87.24,"y":-2.19},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":0.42},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.42},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"y":-0.76},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":1.82},{"duration":25,"tweenEasing":0,"rotate":2.4},{"duration":10,"tweenEasing":0,"rotate":2.01},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":0.67,"y":-0.06},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-1.75},{"duration":25,"tweenEasing":0,"rotate":-0.63},{"duration":10,"tweenEasing":0,"rotate":-0.5},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":0.66,"y":-0.1},{"duration":0}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-4.34},{"duration":10,"tweenEasing":0,"rotate":-3.56},{"duration":0}]},{"name":"head","rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":5.48},{"duration":8,"tweenEasing":0,"rotate":9.23},{"duration":25,"tweenEasing":0,"rotate":10.04},{"duration":10,"tweenEasing":0,"rotate":10.04},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":7},{"duration":8,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":1.16},{"duration":10,"tweenEasing":0,"x":1.1},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":19.71,"y":-30.3},{"duration":10,"tweenEasing":0,"x":19.71,"y":-30.3},{"duration":0}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-3.83},{"duration":10,"tweenEasing":0,"rotate":-7.08},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":1.72,"y":-14.9},{"duration":10,"tweenEasing":0,"x":1.72,"y":-14.9},{"duration":0}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":9.15},{"duration":10,"tweenEasing":0,"rotate":11.6},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":7,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":33,"tweenEasing":0,"offset":12,"vertices":[-0.05,-3.42,-0.05,-3.42,0,0,-0.05,-3.42,-0.05,-3.42,0,0,-1.72,-2.68,0,0,0,0,0,0,0,0,-1.73,-2.69,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.73,-2.69,-1.73,-2.7,-1.73,-2.7,-1.73,-2.69,-1.73,-2.69,0,0,0,0,0,0,0,0,0,0,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,0,0,-1.72,-2.67,-1.72,-2.66,-1.72,-2.67,-1.72,-2.67,-1.73,-2.7,-1.73,-2.7,-1.73,-2.7,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0,0,-1.73,-2.69,-0.04,-3.4,-0.05,-3.42]},{"duration":10,"tweenEasing":0,"offset":12,"vertices":[-0.05,-3.42,-0.05,-3.42,0,0,-0.05,-3.42,-0.05,-3.42,0,0,-1.72,-2.68,0,0,0,0,0,0,0,0,-1.73,-2.69,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.73,-2.69,-1.73,-2.7,-1.73,-2.7,-1.73,-2.69,-1.73,-2.69,0,0,0,0,0,0,0,0,0,0,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,0,0,-1.72,-2.67,-1.72,-2.66,-1.72,-2.67,-1.72,-2.67,-1.73,-2.7,-1.73,-2.7,-1.73,-2.7,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0,0,-1.73,-2.69,-0.04,-3.4,-0.05,-3.42]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":60,"name":"shy","bone":[{"name":"pelvis","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":-12.43,"y":3.83},{"duration":17,"tweenEasing":0,"x":0.61,"y":-0.66},{"duration":8,"tweenEasing":0,"x":-12.43,"y":3.83},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":1.66},{"duration":17,"tweenEasing":0,"rotate":-1.18},{"duration":8,"tweenEasing":0,"rotate":1.66},{"duration":0}]},{"name":"spine","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-0.31},{"duration":17,"tweenEasing":0,"rotate":-0.19},{"duration":8,"tweenEasing":0,"rotate":-0.31},{"duration":0}]},{"name":"spine1","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-0.44},{"duration":17,"tweenEasing":0,"rotate":0.22},{"duration":8,"tweenEasing":0,"rotate":-1.24},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":2.66,"y":-0.29},{"duration":17,"tweenEasing":0,"x":3.63,"y":-0.43},{"duration":8,"tweenEasing":0,"x":2.66,"y":-0.29},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-1.47},{"duration":17,"tweenEasing":0,"rotate":0.87},{"duration":8,"tweenEasing":0,"rotate":-1.94},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-0.93},{"duration":17,"tweenEasing":0,"rotate":-0.13},{"duration":8,"tweenEasing":0,"rotate":2.05},{"duration":0}]},{"name":"head","rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":5.48},{"duration":25,"tweenEasing":0,"rotate":-2.36},{"duration":17,"tweenEasing":0,"rotate":-5.94},{"duration":8,"tweenEasing":0,"rotate":-3.97},{"duration":0,"rotate":5.48}],"scaleFrame":[{"duration":10,"tweenEasing":0},{"duration":42,"tweenEasing":0,"y":0.99},{"duration":8,"tweenEasing":0,"y":0.99},{"duration":0}]},{"name":"face","scaleFrame":[{"duration":15},{"duration":15,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.87},{"duration":8}]},{"name":"hand_l","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":1.86,"y":5.96},{"duration":10,"tweenEasing":0,"x":1.86,"y":5.96},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":40,"tweenEasing":0,"rotate":-4.94},{"duration":10,"tweenEasing":0,"rotate":-4.94},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-0.55,"y":-9.54},{"duration":10,"tweenEasing":0,"x":-0.55,"y":-9.54},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":40,"tweenEasing":0,"rotate":9.14},{"duration":10,"tweenEasing":0,"rotate":9.14},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":6,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":14,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-2.03,-5.52,-2.98,-4.71,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-1.49,-2.73,-2.96,-3.31,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.41,0.44,2.42,5.41,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.81,-3.38,-3.84,-3.79,-3.46,-1.22,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-1.49,-2.73,-2.96,-3.31,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":10,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":10,"tweenEasing":0,"vertices":[0.57,3.51,0.2,0.84,0,0,-2.18,-2.55,-3.14,-3.59,0,0,0.39,1.56,0.39,1.56,0,0,0.32,0.83,0.32,0.83,0,0,4.09,7.12,0.23,0.98,0,0,0,0,0,0,2.95,7.47,4.52,14.58,4.82,12.46,3.11,12.5,4.73,6.43,5.16,12.68,5.2,15.26,3.5,12.71,2.99,9.39,4.47,12.98,5.16,12.66,4.1,12.02,2.3,7.66,0.23,1.21,0,0,0,0,0,0,0.76,2.88,4.35,8.58,4.46,11.69,3.58,10.98,0.42,1.93,4.15,10.44,5.42,13.64,4.03,11.8,1.48,6.75,3.33,9.44,2.5,11.46,3.81,11.27,0.39,1.56,0.39,1.56,0.39,1.56,0.39,1.56,0.32,0.83,0.32,0.83,0.32,0.83,0.32,0.83,0.32,0.83,0.32,0.83,0,0,0,0,0,0,0,0,-0.91,0.14,1.75,5.07,2.22,7.68,1.48,5.16,-3.87,-3.87,-4.39,-4.01,-4.07,-4.02,-3.42,-1.48,-2.12,-2.11,1.81,0.04,5.14,9.45,0.39,1.56,0.38,1.2]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":75,"name":"speak","bone":[{"name":"ik_foot_r","translateFrame":[{"duration":44,"tweenEasing":0},{"duration":31,"tweenEasing":0,"x":6.5},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"curve":[0.2595,0,0.946,0.8400000000000001],"x":-3.82,"y":0.6},{"duration":31,"curve":[0.228,0.135,0.7655000000000001,0.975],"x":-4.65,"y":0.79},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"curve":[0.2595,0,0.946,0.8400000000000001],"rotate":0.17},{"duration":31,"curve":[0.228,0.135,0.7655000000000001,0.975],"rotate":0.2},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":-0.29,"y":-1.62},{"duration":31,"tweenEasing":0,"x":-0.17,"y":-0.95},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.31},{"duration":31,"tweenEasing":0,"rotate":-0.19},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":1.65,"y":0.09},{"duration":31,"tweenEasing":0,"x":1.74,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.23},{"duration":31,"tweenEasing":0,"rotate":-0.17},{"duration":0}]},{"name":"foot_r","rotateFrame":[{"duration":44,"tweenEasing":0},{"duration":31,"tweenEasing":0,"rotate":2.99},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.08,"y":-0.01},{"duration":31,"tweenEasing":0,"x":2.57,"y":-0.29},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.89},{"duration":31,"tweenEasing":0,"rotate":0.47},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.15},{"duration":31,"tweenEasing":0,"rotate":-0.33},{"duration":0}]},{"name":"upperarm_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":0.76},{"duration":31,"tweenEasing":0,"rotate":1.63},{"duration":0}]},{"name":"upperarm_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-3.28},{"duration":31,"tweenEasing":0,"rotate":-4.04},{"duration":0}]},{"name":"xiong_l","translateFrame":[{"duration":15,"tweenEasing":0,"x":-1.48,"y":-4.58},{"duration":22,"tweenEasing":0,"x":-10.09,"y":5.25},{"duration":20,"tweenEasing":0,"x":10.49,"y":10.9},{"duration":18,"tweenEasing":0,"x":27.2,"y":4.5},{"duration":0,"x":-1.48,"y":-4.58}]},{"name":"xiong_r","translateFrame":[{"duration":15,"tweenEasing":0,"x":1.99,"y":6.16},{"duration":22,"tweenEasing":0,"x":-10.63,"y":0.37},{"duration":20,"tweenEasing":0,"x":4.31,"y":-9.17},{"duration":18,"tweenEasing":0,"x":20.58,"y":-8.09},{"duration":0,"x":1.99,"y":6.16}]},{"name":"forearm_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.24},{"duration":13,"tweenEasing":0,"rotate":0.88},{"duration":18,"tweenEasing":0,"rotate":1.2},{"duration":0}]},{"name":"forearm_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":2.2},{"duration":13,"tweenEasing":0,"rotate":1.25},{"duration":18,"tweenEasing":0,"rotate":0.16},{"duration":0}]},{"name":"head","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":-1.11},{"duration":31,"tweenEasing":0,"x":-1.36},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":5.48},{"duration":22,"tweenEasing":0,"rotate":5.11},{"duration":31,"tweenEasing":0,"rotate":5.72},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":15},{"duration":25,"tweenEasing":0},{"duration":35,"tweenEasing":0,"x":0.88},{"duration":0}]},{"name":"hand_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.95},{"duration":31,"tweenEasing":0,"rotate":-0.84},{"duration":0}]},{"name":"hand_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.52},{"duration":16,"tweenEasing":0,"rotate":-0.41},{"duration":15,"tweenEasing":0,"rotate":-1.08},{"duration":0}]},{"name":"dress0101","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":2.94},{"duration":21,"tweenEasing":0,"rotate":-0.24},{"duration":17,"tweenEasing":0,"rotate":-2.57},{"duration":0}]},{"name":"dress0201","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":-0.24},{"duration":16,"tweenEasing":0,"rotate":0.27},{"duration":21,"tweenEasing":0,"rotate":-1.35},{"duration":17,"tweenEasing":0,"rotate":-1.99},{"duration":0,"rotate":-0.24}],"scaleFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"x":0.99},{"duration":21,"tweenEasing":0,"x":0.98},{"duration":17,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"dress0301","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":-3.95},{"duration":21,"tweenEasing":0,"rotate":-1.11},{"duration":17,"tweenEasing":0,"rotate":1.42},{"duration":0}]},{"name":"dress0102","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":-1.33},{"duration":21,"tweenEasing":0,"rotate":1.12},{"duration":17,"tweenEasing":0,"rotate":0.58},{"duration":0}]},{"name":"dress0202","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":0.22},{"duration":16,"tweenEasing":0,"rotate":0.71},{"duration":21,"tweenEasing":0,"rotate":1.98},{"duration":17,"tweenEasing":0,"rotate":1.97},{"duration":0,"rotate":0.22}]},{"name":"dress0302","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":-2.34},{"duration":16,"tweenEasing":0,"rotate":-2.61},{"duration":21,"tweenEasing":0,"rotate":-4.52},{"duration":17,"tweenEasing":0,"rotate":-3.87},{"duration":0,"rotate":-2.34}]},{"name":"dress0103","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":0.34},{"duration":21,"tweenEasing":0,"rotate":2.76},{"duration":17,"tweenEasing":0,"rotate":3.21},{"duration":0}]},{"name":"dress0203","rotateFrame":[{"duration":21,"rotate":-0.42},{"duration":16,"tweenEasing":0,"rotate":-0.42},{"duration":21,"tweenEasing":0,"rotate":0.11},{"duration":17,"tweenEasing":0,"rotate":-0.41},{"duration":0,"rotate":-0.42}]},{"name":"dress0303","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":-0.24},{"duration":16,"tweenEasing":0,"rotate":0.98},{"duration":21,"tweenEasing":0,"rotate":-1.47},{"duration":17,"tweenEasing":0,"rotate":-2.69},{"duration":0,"rotate":-0.24}]},{"name":"dress0104","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":-0.34},{"duration":21,"tweenEasing":0,"rotate":1.23},{"duration":17,"tweenEasing":0,"rotate":2.69},{"duration":0}]},{"name":"dress0204","rotateFrame":[{"duration":21,"rotate":-3.52},{"duration":16,"tweenEasing":0,"rotate":-3.52},{"duration":21,"tweenEasing":0,"rotate":-3.1},{"duration":17,"tweenEasing":0,"rotate":-1.55},{"duration":0,"rotate":-3.52}]},{"name":"dress0304","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":-1.06},{"duration":16,"tweenEasing":0,"rotate":2.24},{"duration":21,"tweenEasing":0,"rotate":-2.31},{"duration":17,"tweenEasing":0,"rotate":-2.85},{"duration":0,"rotate":-1.06}]},{"name":"dress0105","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":-1.43},{"duration":21,"tweenEasing":0,"rotate":0.13},{"duration":17,"tweenEasing":0,"rotate":1.34},{"duration":0}]},{"name":"dress0205","rotateFrame":[{"duration":21,"rotate":-3.21},{"duration":16,"tweenEasing":0,"rotate":-3.21},{"duration":21,"tweenEasing":0,"rotate":0.26},{"duration":17,"tweenEasing":0,"rotate":1.24},{"duration":0,"rotate":-3.21}]},{"name":"dress0305","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":-1.06},{"duration":16,"tweenEasing":0,"rotate":0.1},{"duration":21,"tweenEasing":0,"rotate":-1.69},{"duration":17,"tweenEasing":0,"rotate":-2.94},{"duration":0,"rotate":-1.06}]},{"name":"hair0302","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-9.49},{"duration":22,"tweenEasing":0,"rotate":-5.83},{"duration":18,"tweenEasing":0,"rotate":-3.14},{"duration":0}]},{"name":"hair0202","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-5.26},{"duration":22,"tweenEasing":0,"rotate":-3.71},{"duration":18,"tweenEasing":0,"rotate":4.87},{"duration":0}]},{"name":"hair0401","rotateFrame":[{"duration":18,"tweenEasing":0,"rotate":-1.25},{"duration":17,"tweenEasing":0,"rotate":3.1},{"duration":22,"tweenEasing":0,"rotate":3.63},{"duration":18,"tweenEasing":0,"rotate":1.4},{"duration":0,"rotate":-1.25}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.01},{"duration":22,"tweenEasing":0,"x":1.01},{"duration":18,"tweenEasing":0,"x":0.99,"y":1.03},{"duration":0}]},{"name":"hair0603","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-0.33},{"duration":22,"tweenEasing":0,"rotate":1.38},{"duration":18,"tweenEasing":0,"rotate":-0.39},{"duration":0}]},{"name":"hair0403","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-9},{"duration":22,"tweenEasing":0,"rotate":-5.55},{"duration":18,"tweenEasing":0,"rotate":1.59},{"duration":0}]},{"name":"hair0101","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":3.16},{"duration":22,"tweenEasing":0,"rotate":3.55},{"duration":18,"tweenEasing":0,"rotate":-0.57},{"duration":0}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.01,"y":1.03},{"duration":22,"tweenEasing":0,"x":1.02,"y":1.06},{"duration":18,"tweenEasing":0,"x":1.02,"y":1.09},{"duration":0}]},{"name":"hair0501","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":0.95},{"duration":22,"tweenEasing":0,"rotate":1.39},{"duration":18,"tweenEasing":0,"rotate":-2.05},{"duration":0}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.02},{"duration":22,"tweenEasing":0,"x":1.01},{"duration":18}]},{"name":"hair0102","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-3.47},{"duration":22,"tweenEasing":0,"rotate":-0.97},{"duration":18,"tweenEasing":0,"rotate":3.04},{"duration":0}]},{"name":"hair0201","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":5.64},{"duration":22,"tweenEasing":0,"rotate":2.37},{"duration":18,"tweenEasing":0,"rotate":-2.93},{"duration":0}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.01},{"duration":22,"tweenEasing":0,"x":1.01},{"duration":18,"tweenEasing":0,"x":0.99,"y":1.1},{"duration":0}]},{"name":"hair0103","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-5.36},{"duration":22,"tweenEasing":0,"rotate":-3.28},{"duration":18,"tweenEasing":0,"rotate":2.54},{"duration":0}]},{"name":"hair0602","rotateFrame":[{"duration":18,"tweenEasing":0,"rotate":-1.51},{"duration":17,"tweenEasing":0,"rotate":-0.71},{"duration":22,"tweenEasing":0,"rotate":-3.86},{"duration":18,"tweenEasing":0,"rotate":-3.17},{"duration":0,"rotate":-1.51}]},{"name":"hair0301","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":5.27},{"duration":22,"tweenEasing":0,"rotate":4.97},{"duration":18,"tweenEasing":0,"rotate":-0.41},{"duration":0}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.01},{"duration":22,"tweenEasing":0,"x":1.03},{"duration":18,"tweenEasing":0,"x":1.01,"y":1.1},{"duration":0}]},{"name":"hair0601","rotateFrame":[{"duration":18,"tweenEasing":0,"rotate":-3.34},{"duration":17,"tweenEasing":0,"rotate":-5.91},{"duration":22,"tweenEasing":0,"rotate":-5.59},{"duration":18,"tweenEasing":0,"rotate":-3.3},{"duration":0,"rotate":-3.34}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.02},{"duration":22,"tweenEasing":0,"x":1.01,"y":1.02},{"duration":18,"tweenEasing":0,"y":1.04},{"duration":0}]},{"name":"hair0502","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":0.42},{"duration":22,"tweenEasing":0,"rotate":-1.83},{"duration":18,"tweenEasing":0,"rotate":3.17},{"duration":0}]},{"name":"hair0503","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-2.64},{"duration":22,"tweenEasing":0,"rotate":-2.78},{"duration":18,"tweenEasing":0,"rotate":1.4},{"duration":0}]},{"name":"hair0402","rotateFrame":[{"duration":18,"tweenEasing":0,"rotate":-0.94},{"duration":17,"tweenEasing":0,"rotate":-4.85},{"duration":22,"tweenEasing":0,"rotate":-1.27},{"duration":18,"tweenEasing":0,"rotate":-3.24},{"duration":0,"rotate":-0.94}]},{"name":"bag0101","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":3.56,"y":-2.67},{"duration":31,"tweenEasing":0,"x":3.31,"y":0.72},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.34},{"duration":31,"tweenEasing":0,"rotate":-3},{"duration":0}]},{"name":"bag0102","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.59,"y":1.36},{"duration":31,"tweenEasing":0,"x":1.17,"y":-1.13},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.19},{"duration":31,"tweenEasing":0,"rotate":0.41},{"duration":0}]},{"name":"hair0504","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-1.51},{"duration":22,"tweenEasing":0,"rotate":0.09},{"duration":18,"tweenEasing":0,"rotate":-3.69},{"duration":0}]},{"name":"hair0604","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":1.62},{"duration":22,"tweenEasing":0,"rotate":1.93},{"duration":18,"tweenEasing":0,"rotate":0.89},{"duration":0}]},{"name":"hair0505","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":2.83},{"duration":22,"tweenEasing":0,"rotate":-0.84},{"duration":18,"tweenEasing":0,"rotate":-4.33},{"duration":0}]},{"name":"hair0605","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":2.85},{"duration":22,"tweenEasing":0,"rotate":1.24},{"duration":18,"tweenEasing":0,"rotate":-0.49},{"duration":0}]},{"name":"finger_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.72},{"duration":31,"tweenEasing":0,"rotate":0.51},{"duration":0}]},{"name":"figner_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":0.64},{"duration":31,"tweenEasing":0,"rotate":-0.88},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.43,-0.5,0.25,3.92,2.03,6.25,0.8,5.53,-4.6,-3.81,-4.05,-5.21,-3.78,-5.56,-0.44,-3.11,-2.52,-1.5,2.35,0.75]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[0.65,1.49,0.65,1.49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.89,-1.84,0.81,-2.39,-0.58,-2.13,-2.33,-1.59,-0.13,2.84,0.98,2.36,2.38,2.1,3.78,1.98,-1.28,2.95,-3.34,-1.37]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[0.65,1.49,0.65,1.49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.89,-1.84,0.81,-2.39,-0.58,-2.13,-2.33,-1.59,-0.13,2.84,0.98,2.36,2.38,2.1,3.78,1.98,-1.28,2.95,-3.34,-1.37]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[0.65,1.49,0.65,1.49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.89,-1.84,0.81,-2.39,-0.58,-2.13,-2.33,-1.59,-0.13,2.84,0.98,2.36,2.38,2.1,3.78,1.98,-1.28,2.95,-3.34,-1.37]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[0.65,1.49,0.65,1.49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.89,-1.84,0.81,-2.39,-0.58,-2.13,-2.33,-1.59,-0.13,2.84,0.98,2.36,2.38,2.1,3.78,1.98,-1.28,2.95,-3.34,-1.37]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":4,"tweenEasing":0},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"happy","bone":[{"name":"pelvis","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"y":12.05},{"duration":10,"tweenEasing":0,"x":21.21,"y":-2.92},{"duration":10,"tweenEasing":0,"y":-0.56},{"duration":10,"tweenEasing":0,"x":21.21,"y":15.53},{"duration":0}]},{"name":"spine2","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-2.03},{"duration":10,"tweenEasing":0,"rotate":2.08},{"duration":10,"tweenEasing":0,"rotate":-2.9},{"duration":10,"tweenEasing":0,"rotate":-0.12},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-4.56},{"duration":20,"tweenEasing":0,"rotate":14.64},{"duration":10,"tweenEasing":0,"rotate":9.38},{"duration":0}]},{"name":"head","rotateFrame":[{"duration":50,"rotate":5.48}]},{"name":"hand_l","translateFrame":[{"duration":20,"curve":[0.5,0,1,1]},{"duration":10,"tweenEasing":0,"x":32.65,"y":-66.12},{"duration":10,"tweenEasing":0,"x":18.26,"y":-17.89},{"duration":10,"tweenEasing":0,"x":31.24,"y":-46.39},{"duration":0}],"rotateFrame":[{"duration":20,"curve":[0.5,0,1,1]},{"duration":10,"tweenEasing":0,"rotate":39.48},{"duration":10,"tweenEasing":0,"rotate":34.68},{"duration":10,"tweenEasing":0,"rotate":32.83},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":20,"curve":[0.5,0,1,1]},{"duration":10,"tweenEasing":0,"x":60.5,"y":37.73},{"duration":10,"tweenEasing":0,"x":22.37,"y":11.65},{"duration":10,"tweenEasing":0,"x":42.82,"y":10.57},{"duration":0}],"rotateFrame":[{"duration":20,"curve":[0.5,0,1,1]},{"duration":10,"tweenEasing":0,"rotate":-43.89},{"duration":10,"tweenEasing":0,"rotate":-35.32},{"duration":10,"tweenEasing":0,"rotate":-32.36},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":10,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":30,"tweenEasing":0,"vertices":[0.41,2.51,-1.29,-4.08,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-1.67,-5.86,-3.71,-12.26,-4.11,-14.72,-4.84,-10.32,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,-1.26,-3.82,-3.22,-10.79,-3.92,-11.81,-2.73,-7.89,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":10,"tweenEasing":0,"vertices":[0.41,2.51,-1.29,-4.08,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-1.67,-5.86,-3.71,-12.26,-4.11,-14.72,-4.84,-10.32,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,-1.26,-3.82,-3.22,-10.79,-3.92,-11.81,-2.73,-7.89,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.43,-0.5,0.25,3.92,2.03,6.25,0.8,5.53,-4.6,-3.81,-4.05,-5.21,-3.78,-5.56,-0.44,-3.11,-2.52,-1.5,2.35,0.75]}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/body/body_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/body/body_ske.json.meta new file mode 100644 index 00000000..fa1e7a21 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/body/body_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "9d1232fe-1d6c-4fdd-8e42-7f99a0571d29", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/body/body_tex.json b/Cocos/Demos/assets/resources/you_xin/body/body_tex.json new file mode 100644 index 00000000..98e1faa3 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/body/body_tex.json @@ -0,0 +1 @@ +{"width":2048,"imagePath":"body_tex.png","height":1024,"name":"body","SubTexture":[{"frameX":-1,"y":475,"frameY":-1,"frameWidth":298,"width":294,"frameHeight":85,"height":83,"name":"logo","x":937},{"width":10,"y":933,"height":10,"name":"blank","x":1},{"width":295,"y":1,"height":472,"name":"body/a_arm_L","x":720},{"width":179,"y":1,"height":1013,"name":"body/a_leg_L","x":263},{"width":274,"y":1,"height":555,"name":"body/a_body","x":444},{"width":260,"y":1,"height":930,"name":"body/a_leg_R","x":1},{"width":215,"y":475,"height":517,"name":"body/a_arm_R","x":720},{"width":202,"y":558,"height":238,"name":"body/a_head","x":444},{"width":141,"y":798,"height":117,"name":"face/10202001","x":444}]} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/body/body_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/body/body_tex.json.meta new file mode 100644 index 00000000..a4916424 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/body/body_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "cab840d9-4d32-48a5-b3e9-d10badbdc4a8", + "atlasJson": "{\"width\":2048,\"imagePath\":\"body_tex.png\",\"height\":1024,\"name\":\"body\",\"SubTexture\":[{\"frameX\":-1,\"y\":475,\"frameY\":-1,\"frameWidth\":298,\"width\":294,\"frameHeight\":85,\"height\":83,\"name\":\"logo\",\"x\":937},{\"width\":10,\"y\":933,\"height\":10,\"name\":\"blank\",\"x\":1},{\"width\":295,\"y\":1,\"height\":472,\"name\":\"body/a_arm_L\",\"x\":720},{\"width\":179,\"y\":1,\"height\":1013,\"name\":\"body/a_leg_L\",\"x\":263},{\"width\":274,\"y\":1,\"height\":555,\"name\":\"body/a_body\",\"x\":444},{\"width\":260,\"y\":1,\"height\":930,\"name\":\"body/a_leg_R\",\"x\":1},{\"width\":215,\"y\":475,\"height\":517,\"name\":\"body/a_arm_R\",\"x\":720},{\"width\":202,\"y\":558,\"height\":238,\"name\":\"body/a_head\",\"x\":444},{\"width\":141,\"y\":798,\"height\":117,\"name\":\"face/10202001\",\"x\":444}]}", + "texture": "175f9fb2-38a6-4a57-ab00-35ac3a1b1103", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/body/body_tex.png b/Cocos/Demos/assets/resources/you_xin/body/body_tex.png new file mode 100644 index 00000000..512d5b37 Binary files /dev/null and b/Cocos/Demos/assets/resources/you_xin/body/body_tex.png differ diff --git a/Cocos/Demos/assets/resources/you_xin/body/body_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/body/body_tex.png.meta new file mode 100644 index 00000000..bdf7d265 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/body/body_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "175f9fb2-38a6-4a57-ab00-35ac3a1b1103", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "body_tex": { + "ver": "1.0.3", + "uuid": "6227d5ce-15ef-4d77-a13e-a97727fde9c4", + "rawTextureUuid": "175f9fb2-38a6-4a57-ab00-35ac3a1b1103", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -407.5, + "offsetY": 4.5, + "trimX": 2, + "trimY": 2, + "width": 1229, + "height": 1011, + "rawWidth": 2048, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1.meta b/Cocos/Demos/assets/resources/you_xin/suit1.meta new file mode 100644 index 00000000..b617c4ae --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "02a5c3a6-ef1a-4c67-ad0d-62d267f54c8f", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2010600a.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a.meta new file mode 100644 index 00000000..5c66206f --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "714b63f5-b6ca-474b-9e00-19f4e269cadd", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2010600a/2010600a_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2010600a/2010600a_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_ske.json.meta new file mode 100644 index 00000000..1311e6c8 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "bf6c44b0-2b51-4ede-911d-74aae13245cc", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2010600a/2010600a_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2010600a/2010600a_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_tex.json.meta new file mode 100644 index 00000000..d4ca71d0 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "41886473-5e24-4f3e-aed6-e9da179c4703", + "atlasJson": "{\"width\":1024,\"SubTexture\":[{\"width\":528,\"y\":1,\"height\":851,\"name\":\"hair/2010600a\",\"x\":1}],\"height\":1024,\"name\":\"2010600a\",\"imagePath\":\"2010600a_tex.png\"}", + "texture": "217d54ad-1943-4c74-afc4-605dc0e4eac4", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2010600a/2010600a_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2010600a/2010600a_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_tex.png.meta new file mode 100644 index 00000000..1c1566a4 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a/2010600a_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "217d54ad-1943-4c74-afc4-605dc0e4eac4", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "2010600a_tex": { + "ver": "1.0.3", + "uuid": "7751c23f-bb85-4cc7-aa53-86f2a84eae19", + "rawTextureUuid": "217d54ad-1943-4c74-afc4-605dc0e4eac4", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -247, + "offsetY": 85.5, + "trimX": 2, + "trimY": 2, + "width": 526, + "height": 849, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1.meta new file mode 100644 index 00000000..10135b80 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "c9c38ab3-6ab1-4c10-bbb3-85d5edc37508", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2010600a_1/2010600a_1_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2010600a_1/2010600a_1_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_ske.json.meta new file mode 100644 index 00000000..2858e686 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "cff828bd-245a-49fa-8159-ee2b0807e5ac", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2010600a_1/2010600a_1_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2010600a_1/2010600a_1_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_tex.json.meta new file mode 100644 index 00000000..35003e1e --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "13333c19-03a4-4312-8ede-799217d27eb4", + "atlasJson": "{\"width\":512,\"SubTexture\":[{\"width\":291,\"y\":1,\"height\":874,\"name\":\"hair/2010600a_1\",\"x\":1}],\"height\":1024,\"name\":\"2010600a_1\",\"imagePath\":\"2010600a_1_tex.png\"}", + "texture": "3142e41f-406f-495d-9fc2-cad2d368a4d1", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2010600a_1/2010600a_1_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2010600a_1/2010600a_1_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_tex.png.meta new file mode 100644 index 00000000..bcc3457a --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2010600a_1/2010600a_1_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "3142e41f-406f-495d-9fc2-cad2d368a4d1", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "2010600a_1_tex": { + "ver": "1.0.3", + "uuid": "20848a12-b754-4a80-a432-34af2a09bb98", + "rawTextureUuid": "3142e41f-406f-495d-9fc2-cad2d368a4d1", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -109.5, + "offsetY": 74, + "trimX": 2, + "trimY": 2, + "width": 289, + "height": 872, + "rawWidth": 512, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003.meta new file mode 100644 index 00000000..8dee323e --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "f21d9e56-9a6c-4c64-928c-224754f07ed4", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003/20208003_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003/20208003_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_ske.json.meta new file mode 100644 index 00000000..f72cf8b0 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "130e59c7-079d-4fc6-a71a-ba08e06a50e5", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003/20208003_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003/20208003_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_tex.json.meta new file mode 100644 index 00000000..4b8a94c4 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "7d46bf5f-9bb9-4d29-91a7-767dd0647dd9", + "atlasJson": "{\"width\":512,\"SubTexture\":[{\"width\":306,\"y\":1,\"height\":219,\"name\":\"cloak/20208003\",\"x\":1}],\"height\":256,\"name\":\"20208003\",\"imagePath\":\"20208003_tex.png\"}", + "texture": "5e2a14d0-1a92-491f-854b-9a8ecc649d6a", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003/20208003_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003/20208003_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_tex.png.meta new file mode 100644 index 00000000..cc7f54cd --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003/20208003_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "5e2a14d0-1a92-491f-854b-9a8ecc649d6a", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20208003_tex": { + "ver": "1.0.3", + "uuid": "2b4257c1-e2f4-4623-97f7-c592588cfaf8", + "rawTextureUuid": "5e2a14d0-1a92-491f-854b-9a8ecc649d6a", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -102, + "offsetY": 17.5, + "trimX": 2, + "trimY": 2, + "width": 304, + "height": 217, + "rawWidth": 512, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1.meta new file mode 100644 index 00000000..f1288684 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "094c14d6-b8ac-4582-9fdf-d585dea93d06", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_1/20208003_1_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003_1/20208003_1_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_ske.json.meta new file mode 100644 index 00000000..3c964601 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "5ec61e01-c3b4-4820-9c77-58a3fbfb9562", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_1/20208003_1_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003_1/20208003_1_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_tex.json.meta new file mode 100644 index 00000000..af71f6e7 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "1901d0d0-5034-4be3-a073-36a5ebfd5339", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":230,\"y\":1,\"height\":470,\"name\":\"cloak/20208003_1\",\"x\":1}],\"height\":512,\"name\":\"20208003_1\",\"imagePath\":\"20208003_1_tex.png\"}", + "texture": "aff9d8c3-89bd-434f-a4dd-a8c914884ad1", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_1/20208003_1_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003_1/20208003_1_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_tex.png.meta new file mode 100644 index 00000000..cb05d54a --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_1/20208003_1_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "aff9d8c3-89bd-434f-a4dd-a8c914884ad1", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20208003_1_tex": { + "ver": "1.0.3", + "uuid": "d6cb041d-2c34-4a7e-9c82-87210198035c", + "rawTextureUuid": "aff9d8c3-89bd-434f-a4dd-a8c914884ad1", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -12, + "offsetY": 20, + "trimX": 2, + "trimY": 2, + "width": 228, + "height": 468, + "rawWidth": 256, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2.meta new file mode 100644 index 00000000..fbf69867 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "f056a50b-e89c-4e51-844d-fb02de6f2828", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_2/20208003_2_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003_2/20208003_2_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_ske.json.meta new file mode 100644 index 00000000..bc18f27e --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "11e09055-9f12-498a-8a00-77096ba4acc4", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_2/20208003_2_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003_2/20208003_2_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_tex.json.meta new file mode 100644 index 00000000..d84dab64 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "ad16561b-3f4c-44b4-a300-c015e30fb7cd", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":250,\"y\":1,\"height\":367,\"name\":\"cloak/20208003_2\",\"x\":1}],\"height\":512,\"name\":\"20208003_2\",\"imagePath\":\"20208003_2_tex.png\"}", + "texture": "14aea15a-bcf5-4bbc-a3ae-1e16261857f7", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_2/20208003_2_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003_2/20208003_2_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_tex.png.meta new file mode 100644 index 00000000..64a566e9 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_2/20208003_2_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "14aea15a-bcf5-4bbc-a3ae-1e16261857f7", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20208003_2_tex": { + "ver": "1.0.3", + "uuid": "c9c372d3-5ceb-4aea-995a-0ac634ff2264", + "rawTextureUuid": "14aea15a-bcf5-4bbc-a3ae-1e16261857f7", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -2, + "offsetY": 71.5, + "trimX": 2, + "trimY": 2, + "width": 248, + "height": 365, + "rawWidth": 256, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3.meta new file mode 100644 index 00000000..34218d97 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "fae2ac2b-facc-44d3-b5f7-349a7973890e", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_3/20208003_3_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003_3/20208003_3_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_ske.json.meta new file mode 100644 index 00000000..f63ec46d --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "16c60dd4-ce89-492f-86e3-768292200225", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_3/20208003_3_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003_3/20208003_3_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_tex.json.meta new file mode 100644 index 00000000..f8c8cf9b --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "dc8ed815-551d-4d12-8798-88ab94cfb92a", + "atlasJson": "{\"width\":1024,\"SubTexture\":[{\"width\":517,\"y\":1,\"height\":1259,\"name\":\"cloak/20208003_3\",\"x\":1}],\"height\":2048,\"name\":\"20208003_3\",\"imagePath\":\"20208003_3_tex.png\"}", + "texture": "1766bb3a-4e40-465f-a114-00d5542eb23b", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_3/20208003_3_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20208003_3/20208003_3_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_tex.png.meta new file mode 100644 index 00000000..3b236768 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20208003_3/20208003_3_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "1766bb3a-4e40-465f-a114-00d5542eb23b", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20208003_3_tex": { + "ver": "1.0.3", + "uuid": "3cc00f87-39c6-416f-985f-823f849cafd9", + "rawTextureUuid": "1766bb3a-4e40-465f-a114-00d5542eb23b", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -252.5, + "offsetY": 393.5, + "trimX": 2, + "trimY": 2, + "width": 515, + "height": 1257, + "rawWidth": 1024, + "rawHeight": 2048, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20405006.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20405006.meta new file mode 100644 index 00000000..534b2074 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20405006.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "e80b5d6a-faa1-44c6-984f-b5a037289958", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20405006/20405006_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20405006/20405006_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_ske.json.meta new file mode 100644 index 00000000..c390f1c4 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "6c858163-719d-49bb-bdd0-8f2f4c3ac15d", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20405006/20405006_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20405006/20405006_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_tex.json.meta new file mode 100644 index 00000000..74369a32 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "c1254944-d220-44af-9a92-5278553fb491", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":210,\"y\":1,\"height\":409,\"name\":\"cloak/20405006\",\"x\":1}],\"height\":512,\"name\":\"20405006\",\"imagePath\":\"20405006_tex.png\"}", + "texture": "4fea2235-d136-42dd-a09b-43c9da4193e6", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20405006/20405006_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20405006/20405006_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_tex.png.meta new file mode 100644 index 00000000..d2a9380a --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20405006/20405006_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "4fea2235-d136-42dd-a09b-43c9da4193e6", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20405006_tex": { + "ver": "1.0.3", + "uuid": "0eca9345-cc67-4dbc-a16c-6ef8823f6ffa", + "rawTextureUuid": "4fea2235-d136-42dd-a09b-43c9da4193e6", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -22, + "offsetY": 50.5, + "trimX": 2, + "trimY": 2, + "width": 208, + "height": 407, + "rawWidth": 256, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20509005.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20509005.meta new file mode 100644 index 00000000..756bee6a --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20509005.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "fc450519-215e-4b79-a3c8-ec8269952891", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20509005/20509005_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20509005/20509005_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_ske.json.meta new file mode 100644 index 00000000..6e3ef1d9 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "b3bdf1ab-e4a7-446a-a7e1-0c2df2c4f9e9", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20509005/20509005_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20509005/20509005_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_tex.json.meta new file mode 100644 index 00000000..2fb27133 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "0d51a83b-7da6-4209-a564-83f68fc7f3d9", + "atlasJson": "{\"width\":1024,\"SubTexture\":[{\"width\":790,\"y\":1,\"height\":994,\"name\":\"dress/20509005\",\"x\":1}],\"height\":1024,\"name\":\"20509005\",\"imagePath\":\"20509005_tex.png\"}", + "texture": "e7b3b679-8c4d-4547-a9da-e9cd48624040", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20509005/20509005_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20509005/20509005_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_tex.png.meta new file mode 100644 index 00000000..c6349f09 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20509005/20509005_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "e7b3b679-8c4d-4547-a9da-e9cd48624040", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20509005_tex": { + "ver": "1.0.3", + "uuid": "370513cc-c5d3-4835-94b2-10e7ec5f3382", + "rawTextureUuid": "e7b3b679-8c4d-4547-a9da-e9cd48624040", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -116, + "offsetY": 14, + "trimX": 2, + "trimY": 2, + "width": 788, + "height": 992, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20703016.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20703016.meta new file mode 100644 index 00000000..25fc569e --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20703016.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "d1ea36f0-830f-4dbe-a6b5-7aef52d4c21c", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20703016/20703016_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20703016/20703016_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_ske.json.meta new file mode 100644 index 00000000..c62f4752 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "03dcab38-65a2-46ad-abea-d2964081ed37", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20703016/20703016_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20703016/20703016_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_tex.json.meta new file mode 100644 index 00000000..e0b63648 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "6c7e27f5-ac96-4020-8a60-5aae357483a0", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":183,\"y\":1,\"height\":238,\"name\":\"shoe/20703016\",\"x\":1}],\"height\":256,\"name\":\"20703016\",\"imagePath\":\"20703016_tex.png\"}", + "texture": "23756136-49b7-4d13-a1e9-a913ee8b0079", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20703016/20703016_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20703016/20703016_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_tex.png.meta new file mode 100644 index 00000000..6e476907 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20703016/20703016_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "23756136-49b7-4d13-a1e9-a913ee8b0079", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20703016_tex": { + "ver": "1.0.3", + "uuid": "29dfa913-2405-4f1e-8ced-066d73d946b0", + "rawTextureUuid": "23756136-49b7-4d13-a1e9-a913ee8b0079", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -35.5, + "offsetY": 8, + "trimX": 2, + "trimY": 2, + "width": 181, + "height": 236, + "rawWidth": 256, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1.meta new file mode 100644 index 00000000..d9c683e1 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "87f7dd79-2d9a-49bd-9fa8-cabef732326f", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20703016_1/20703016_1_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20703016_1/20703016_1_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_ske.json.meta new file mode 100644 index 00000000..06c18d93 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "05ff3edb-e1fa-4fe9-bb7a-76b7e14dd45f", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20703016_1/20703016_1_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20703016_1/20703016_1_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_tex.json.meta new file mode 100644 index 00000000..0c9bb73f --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "bf5e77dc-d20b-4047-bd26-4f6364677ed7", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":151,\"y\":1,\"height\":217,\"name\":\"shoe/20703016_1\",\"x\":1}],\"height\":256,\"name\":\"20703016_1\",\"imagePath\":\"20703016_1_tex.png\"}", + "texture": "243ec397-f56d-4984-8c98-715958f72abc", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20703016_1/20703016_1_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20703016_1/20703016_1_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_tex.png.meta new file mode 100644 index 00000000..27bbf768 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20703016_1/20703016_1_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "243ec397-f56d-4984-8c98-715958f72abc", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20703016_1_tex": { + "ver": "1.0.3", + "uuid": "05ae9e66-df02-4951-b90e-a32b3292ddec", + "rawTextureUuid": "243ec397-f56d-4984-8c98-715958f72abc", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -51.5, + "offsetY": 18.5, + "trimX": 2, + "trimY": 2, + "width": 149, + "height": 215, + "rawWidth": 256, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100c.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c.meta new file mode 100644 index 00000000..cef73cfd --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "22a9cd97-36d9-491c-b17a-867b3d6fba99", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080100c/2080100c_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080100c/2080100c_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_ske.json.meta new file mode 100644 index 00000000..422c403b --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "d9b7882e-e528-4a2a-b502-b52c87d1eedc", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080100c/2080100c_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080100c/2080100c_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_tex.json.meta new file mode 100644 index 00000000..266b2c25 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "85daefad-d7a6-4d06-8d65-b9a330a4c184", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":195,\"y\":1,\"height\":194,\"name\":\"hat/2080100c\",\"x\":1}],\"height\":256,\"name\":\"2080100c\",\"imagePath\":\"2080100c_tex.png\"}", + "texture": "1ba4f069-d489-49b5-8149-2b18003acade", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080100c/2080100c_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080100c/2080100c_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_tex.png.meta new file mode 100644 index 00000000..69a6f29d --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100c/2080100c_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "1ba4f069-d489-49b5-8149-2b18003acade", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "2080100c_tex": { + "ver": "1.0.3", + "uuid": "fce6bc12-5e96-4dc8-acce-d0152c28602f", + "rawTextureUuid": "1ba4f069-d489-49b5-8149-2b18003acade", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -29.5, + "offsetY": 30, + "trimX": 2, + "trimY": 2, + "width": 193, + "height": 192, + "rawWidth": 256, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100e.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e.meta new file mode 100644 index 00000000..86fdfb79 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "e0091b7e-c67d-4a0d-8d5c-9f255d03c593", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080100e/2080100e_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080100e/2080100e_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_ske.json.meta new file mode 100644 index 00000000..2933eabd --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "f25d286a-f0c5-400e-a915-3fed2eed7194", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080100e/2080100e_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080100e/2080100e_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_tex.json.meta new file mode 100644 index 00000000..99e86771 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "b2962736-eaa8-482c-b58c-9b3029b9496b", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":181,\"y\":1,\"height\":160,\"name\":\"headwear/2080100e\",\"x\":1}],\"height\":256,\"name\":\"2080100e\",\"imagePath\":\"2080100e_tex.png\"}", + "texture": "7316ec86-6c1c-414f-86d4-13b2bda9b0be", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080100e/2080100e_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080100e/2080100e_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_tex.png.meta new file mode 100644 index 00000000..50e916b8 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e/2080100e_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "7316ec86-6c1c-414f-86d4-13b2bda9b0be", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "2080100e_tex": { + "ver": "1.0.3", + "uuid": "80aae66e-2bea-4241-b419-168bb2cd5959", + "rawTextureUuid": "7316ec86-6c1c-414f-86d4-13b2bda9b0be", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -36.5, + "offsetY": 47, + "trimX": 2, + "trimY": 2, + "width": 179, + "height": 158, + "rawWidth": 256, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1.meta new file mode 100644 index 00000000..0df7558c --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "6ca6f4e6-077f-4cfb-9e29-51ffae074932", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080100e_1/2080100e_1_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080100e_1/2080100e_1_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_ske.json.meta new file mode 100644 index 00000000..34ea0335 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "04047d92-1e20-470e-9752-6f408c96d13a", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080100e_1/2080100e_1_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080100e_1/2080100e_1_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_tex.json.meta new file mode 100644 index 00000000..ffdf3c4a --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "42e14d2d-bcd4-4161-9ea7-b1a05cbbd5b4", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":140,\"y\":1,\"height\":152,\"name\":\"headwear/2080100e_1\",\"x\":1}],\"height\":256,\"name\":\"2080100e_1\",\"imagePath\":\"2080100e_1_tex.png\"}", + "texture": "272cd27b-d96d-465e-a486-83ad9b5ff7b9", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080100e_1/2080100e_1_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080100e_1/2080100e_1_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_tex.png.meta new file mode 100644 index 00000000..80099f0b --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080100e_1/2080100e_1_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "272cd27b-d96d-465e-a486-83ad9b5ff7b9", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "2080100e_1_tex": { + "ver": "1.0.3", + "uuid": "cdbf1642-016a-4991-848a-bc2f47e7431e", + "rawTextureUuid": "272cd27b-d96d-465e-a486-83ad9b5ff7b9", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -57, + "offsetY": 51, + "trimX": 2, + "trimY": 2, + "width": 138, + "height": 150, + "rawWidth": 256, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20803005.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20803005.meta new file mode 100644 index 00000000..a6dad8b6 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20803005.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "4e4cecfb-5b0f-4c45-8081-95b2c60f220e", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20803005/20803005_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20803005/20803005_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_ske.json.meta new file mode 100644 index 00000000..f1bc2453 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "cb66e112-f367-429d-808c-072d502d32ca", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20803005/20803005_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20803005/20803005_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_tex.json.meta new file mode 100644 index 00000000..a9e42c7f --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "6affadeb-1be4-4a41-8bab-5975d91b6759", + "atlasJson": "{\"width\":32,\"SubTexture\":[{\"width\":16,\"y\":1,\"height\":26,\"name\":\"earring/20803005\",\"x\":1}],\"height\":32,\"name\":\"20803005\",\"imagePath\":\"20803005_tex.png\"}", + "texture": "0c7bd5d5-c326-44f2-9140-36d7a0702c9c", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/20803005/20803005_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/20803005/20803005_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_tex.png.meta new file mode 100644 index 00000000..800ec43f --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/20803005/20803005_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "0c7bd5d5-c326-44f2-9140-36d7a0702c9c", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20803005_tex": { + "ver": "1.0.3", + "uuid": "6b6a1136-f506-4683-b30b-daf58fb9c217", + "rawTextureUuid": "0c7bd5d5-c326-44f2-9140-36d7a0702c9c", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -7, + "offsetY": 2, + "trimX": 2, + "trimY": 2, + "width": 14, + "height": 24, + "rawWidth": 32, + "rawHeight": 32, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080500b.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b.meta new file mode 100644 index 00000000..a813f4e7 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "f6be9dbf-8892-42a3-b132-4c299c3398a1", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080500b/2080500b_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080500b/2080500b_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_ske.json.meta new file mode 100644 index 00000000..6c0d9a94 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "f9d0f783-4cc6-4a79-9a0a-ebc2b3d95e67", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080500b/2080500b_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080500b/2080500b_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_tex.json.meta new file mode 100644 index 00000000..6ac19ad8 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "29164cb0-eb77-4977-b916-7c880238c669", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":159,\"y\":1,\"height\":323,\"name\":\"glove/2080500b\",\"x\":1}],\"height\":512,\"name\":\"2080500b\",\"imagePath\":\"2080500b_tex.png\"}", + "texture": "d64df66d-7dc0-483b-86dc-b780b39bcf2c", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080500b/2080500b_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080500b/2080500b_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_tex.png.meta new file mode 100644 index 00000000..c49957bb --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b/2080500b_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "d64df66d-7dc0-483b-86dc-b780b39bcf2c", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "2080500b_tex": { + "ver": "1.0.3", + "uuid": "1f9476bd-32f2-4bc8-9c65-349408814851", + "rawTextureUuid": "d64df66d-7dc0-483b-86dc-b780b39bcf2c", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -47.5, + "offsetY": 93.5, + "trimX": 2, + "trimY": 2, + "width": 157, + "height": 321, + "rawWidth": 256, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1.meta new file mode 100644 index 00000000..296401ef --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "c1ccaff4-c320-4260-8165-dda12357b722", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080500b_1/2080500b_1_ske.json b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080500b_1/2080500b_1_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_ske.json.meta new file mode 100644 index 00000000..0d538389 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "546fcc1b-ccdd-46d3-a57c-ae6a75ff8511", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080500b_1/2080500b_1_tex.json b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080500b_1/2080500b_1_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_tex.json.meta new file mode 100644 index 00000000..894a8118 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "a88384db-fcfc-4a71-9371-93ae1e4ae2c2", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":207,\"y\":1,\"height\":240,\"name\":\"glove/2080500b_1\",\"x\":1}],\"height\":256,\"name\":\"2080500b_1\",\"imagePath\":\"2080500b_1_tex.png\"}", + "texture": "afa394f3-3014-4616-bf65-17b435cec69d", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit1/2080500b_1/2080500b_1_tex.png b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit1/2080500b_1/2080500b_1_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_tex.png.meta new file mode 100644 index 00000000..b3754f18 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit1/2080500b_1/2080500b_1_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "afa394f3-3014-4616-bf65-17b435cec69d", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "2080500b_1_tex": { + "ver": "1.0.3", + "uuid": "a33a421f-8255-4950-b65a-bab9716565bc", + "rawTextureUuid": "afa394f3-3014-4616-bf65-17b435cec69d", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -23.5, + "offsetY": 7, + "trimX": 2, + "trimY": 2, + "width": 205, + "height": 238, + "rawWidth": 256, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2.meta b/Cocos/Demos/assets/resources/you_xin/suit2.meta new file mode 100644 index 00000000..20737650 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "0a4a653b-fc38-4351-a3e5-04435855ffe1", + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20106010.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20106010.meta new file mode 100644 index 00000000..1f33ac08 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20106010.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "c5524972-c839-4ce3-af57-b9dcd9efb9e6", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20106010/20106010_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20106010/20106010_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_ske.json.meta new file mode 100644 index 00000000..1298c599 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "f3a048ab-d781-4857-8fdd-6871af552e27", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20106010/20106010_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20106010/20106010_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_tex.json.meta new file mode 100644 index 00000000..ad740f28 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "c42efdf3-e85e-450a-a973-84362e072bcd", + "atlasJson": "{\"width\":1024,\"SubTexture\":[{\"width\":515,\"y\":1,\"height\":750,\"name\":\"hair/20106010\",\"x\":1}],\"height\":1024,\"name\":\"20106010\",\"imagePath\":\"20106010_tex.png\"}", + "texture": "3a0be6da-7518-42cf-91b5-55ef8f929564", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20106010/20106010_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20106010/20106010_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_tex.png.meta new file mode 100644 index 00000000..5d3422ae --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20106010/20106010_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "3a0be6da-7518-42cf-91b5-55ef8f929564", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20106010_tex": { + "ver": "1.0.3", + "uuid": "d58c586c-72db-43c7-a19b-b40e3e805db9", + "rawTextureUuid": "3a0be6da-7518-42cf-91b5-55ef8f929564", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -253.5, + "offsetY": 136, + "trimX": 2, + "trimY": 2, + "width": 513, + "height": 748, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1.meta new file mode 100644 index 00000000..8dfad29b --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "eaa63944-55d5-4cfd-843c-cdbe13ae96e1", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20106010_1/20106010_1_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20106010_1/20106010_1_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_ske.json.meta new file mode 100644 index 00000000..e8b0937e --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "fb1371c5-5242-4d18-9772-905ea2c59fdc", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20106010_1/20106010_1_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20106010_1/20106010_1_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_tex.json.meta new file mode 100644 index 00000000..20dd274d --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "d40f995d-2f76-4a3a-98d4-7715d031ee98", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":226,\"y\":1,\"height\":260,\"name\":\"hair/20106010_1\",\"x\":1}],\"height\":512,\"name\":\"20106010_1\",\"imagePath\":\"20106010_1_tex.png\"}", + "texture": "5127e294-3a97-4969-8511-0ab38410cc43", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20106010_1/20106010_1_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20106010_1/20106010_1_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_tex.png.meta new file mode 100644 index 00000000..556c90af --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20106010_1/20106010_1_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "5127e294-3a97-4969-8511-0ab38410cc43", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20106010_1_tex": { + "ver": "1.0.3", + "uuid": "36bdd02c-88d7-4678-901a-2cc2267c1135", + "rawTextureUuid": "5127e294-3a97-4969-8511-0ab38410cc43", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -14, + "offsetY": 125, + "trimX": 2, + "trimY": 2, + "width": 224, + "height": 258, + "rawWidth": 256, + "rawHeight": 512, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006.meta new file mode 100644 index 00000000..49d89896 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "462ef131-e2fe-4d3c-8ee4-882040f85a61", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006/20208006_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006/20208006_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_ske.json.meta new file mode 100644 index 00000000..39e3b0e5 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "b6c0f675-91ef-4aa6-81b3-18caa7fd5575", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006/20208006_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006/20208006_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_tex.json.meta new file mode 100644 index 00000000..a811e1c0 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "39ee6312-570e-4c69-9bb6-862599209e2c", + "atlasJson": "{\"width\":512,\"SubTexture\":[{\"width\":371,\"y\":1,\"height\":1033,\"name\":\"cloak/20208006\",\"x\":1}],\"height\":2048,\"name\":\"20208006\",\"imagePath\":\"20208006_tex.png\"}", + "texture": "8dbc4fa3-ca0d-4c8b-96a7-286564674b1c", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006/20208006_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006/20208006_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_tex.png.meta new file mode 100644 index 00000000..17a75850 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006/20208006_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "8dbc4fa3-ca0d-4c8b-96a7-286564674b1c", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20208006_tex": { + "ver": "1.0.3", + "uuid": "a56efc33-d6df-412a-bb7c-38a6c200a32a", + "rawTextureUuid": "8dbc4fa3-ca0d-4c8b-96a7-286564674b1c", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -69.5, + "offsetY": 506.5, + "trimX": 2, + "trimY": 2, + "width": 369, + "height": 1031, + "rawWidth": 512, + "rawHeight": 2048, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1.meta new file mode 100644 index 00000000..8e042a3d --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "20752a7c-1d53-48df-b45e-8cce4993eeb3", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_1/20208006_1_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006_1/20208006_1_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_ske.json.meta new file mode 100644 index 00000000..cd1a5d80 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "d9d6744b-f0d5-4f27-b606-16f3b302c075", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_1/20208006_1_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006_1/20208006_1_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_tex.json.meta new file mode 100644 index 00000000..c9dcb363 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "6f6b786e-1614-4675-a728-373800db16ef", + "atlasJson": "{\"width\":512,\"SubTexture\":[{\"width\":507,\"y\":1,\"height\":775,\"name\":\"cloak/20208006_1\",\"x\":1}],\"height\":1024,\"name\":\"20208006_1\",\"imagePath\":\"20208006_1_tex.png\"}", + "texture": "2cb82eb9-5c32-4680-8d1e-376b2ac8d3d5", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_1/20208006_1_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006_1/20208006_1_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_tex.png.meta new file mode 100644 index 00000000..f4c5700f --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_1/20208006_1_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "2cb82eb9-5c32-4680-8d1e-376b2ac8d3d5", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20208006_1_tex": { + "ver": "1.0.3", + "uuid": "ba66f341-dcb8-4039-a6cb-8abf5a943878", + "rawTextureUuid": "2cb82eb9-5c32-4680-8d1e-376b2ac8d3d5", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -1.5, + "offsetY": 123.5, + "trimX": 2, + "trimY": 2, + "width": 505, + "height": 773, + "rawWidth": 512, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2.meta new file mode 100644 index 00000000..b6f3c510 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "33b87542-8c04-42ab-96d3-7cc2ac3d49fc", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_2/20208006_2_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006_2/20208006_2_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_ske.json.meta new file mode 100644 index 00000000..65c4c956 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "1f80993c-65ce-4552-ae05-2f64d4e78090", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_2/20208006_2_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006_2/20208006_2_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_tex.json.meta new file mode 100644 index 00000000..e72121ca --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "93afbc76-dc5b-4537-91a5-fb378585337c", + "atlasJson": "{\"width\":512,\"SubTexture\":[{\"width\":398,\"y\":1,\"height\":782,\"name\":\"cloak/20208006_2\",\"x\":1}],\"height\":1024,\"name\":\"20208006_2\",\"imagePath\":\"20208006_2_tex.png\"}", + "texture": "563f4b37-7be0-45d1-96dc-f1bf6b38a4db", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_2/20208006_2_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006_2/20208006_2_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_tex.png.meta new file mode 100644 index 00000000..b7ee336d --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_2/20208006_2_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "563f4b37-7be0-45d1-96dc-f1bf6b38a4db", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20208006_2_tex": { + "ver": "1.0.3", + "uuid": "8f456cd1-27cf-46c2-a62d-2d3b826655f1", + "rawTextureUuid": "563f4b37-7be0-45d1-96dc-f1bf6b38a4db", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -56, + "offsetY": 120, + "trimX": 2, + "trimY": 2, + "width": 396, + "height": 780, + "rawWidth": 512, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3.meta new file mode 100644 index 00000000..0dc411fd --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "df47e029-f6f9-4644-94f0-5b318c7521e5", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_3/20208006_3_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006_3/20208006_3_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_ske.json.meta new file mode 100644 index 00000000..bd63030b --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "fa1cc6ac-d23d-4bc8-8789-f0d2d989f89f", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_3/20208006_3_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006_3/20208006_3_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_tex.json.meta new file mode 100644 index 00000000..a039b45f --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "0383a038-2e1b-41b0-8524-28407ff1a10f", + "atlasJson": "{\"width\":2048,\"SubTexture\":[{\"width\":1032,\"y\":1,\"height\":855,\"name\":\"cloak/20208006_3\",\"x\":1}],\"height\":1024,\"name\":\"20208006_3\",\"imagePath\":\"20208006_3_tex.png\"}", + "texture": "371ed113-d085-403d-bb1b-5dcb533c456f", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_3/20208006_3_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20208006_3/20208006_3_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_tex.png.meta new file mode 100644 index 00000000..3f2a63c9 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20208006_3/20208006_3_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "371ed113-d085-403d-bb1b-5dcb533c456f", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20208006_3_tex": { + "ver": "1.0.3", + "uuid": "a092f61f-b107-4567-a9cb-b506a1348d59", + "rawTextureUuid": "371ed113-d085-403d-bb1b-5dcb533c456f", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -507, + "offsetY": 83.5, + "trimX": 2, + "trimY": 2, + "width": 1030, + "height": 853, + "rawWidth": 2048, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2040600b.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b.meta new file mode 100644 index 00000000..543f972a --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "b2d8f3fc-4f83-48b6-b745-f70288e9ab34", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/2040600b/2040600b_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/2040600b/2040600b_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_ske.json.meta new file mode 100644 index 00000000..832e071b --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "d8f8c0fb-9211-4baf-ad74-e4e31eb2ed5b", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/2040600b/2040600b_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/2040600b/2040600b_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_tex.json.meta new file mode 100644 index 00000000..d49fd894 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "8bdc41b5-ced1-40f0-a830-0f0abe568cb3", + "atlasJson": "{\"width\":512,\"SubTexture\":[{\"width\":262,\"y\":1,\"height\":936,\"name\":\"coat/2040600b\",\"x\":1}],\"height\":1024,\"name\":\"2040600b\",\"imagePath\":\"2040600b_tex.png\"}", + "texture": "7765dbcd-d72a-4538-9ca9-384fdf4037f2", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/2040600b/2040600b_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/2040600b/2040600b_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_tex.png.meta new file mode 100644 index 00000000..b8269b8a --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b/2040600b_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "7765dbcd-d72a-4538-9ca9-384fdf4037f2", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "2040600b_tex": { + "ver": "1.0.3", + "uuid": "823465d4-7240-41bc-a16d-46dd1dc0b273", + "rawTextureUuid": "7765dbcd-d72a-4538-9ca9-384fdf4037f2", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -124, + "offsetY": 43, + "trimX": 2, + "trimY": 2, + "width": 260, + "height": 934, + "rawWidth": 512, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1.meta new file mode 100644 index 00000000..9d0ecb5e --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "a657e86f-5793-4a68-b133-071c4f8531f2", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/2040600b_1/2040600b_1_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/2040600b_1/2040600b_1_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_ske.json.meta new file mode 100644 index 00000000..a3070113 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "d48db5da-64ee-416c-b160-27f611cd6a3c", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/2040600b_1/2040600b_1_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/2040600b_1/2040600b_1_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_tex.json.meta new file mode 100644 index 00000000..f6d0d494 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "d27ddf8e-1a1d-4433-808e-40f19518390e", + "atlasJson": "{\"width\":128,\"SubTexture\":[{\"width\":76,\"y\":1,\"height\":138,\"name\":\"coat/2040600b_1\",\"x\":1}],\"height\":256,\"name\":\"2040600b_1\",\"imagePath\":\"2040600b_1_tex.png\"}", + "texture": "c46ca05e-1a2b-43d2-b56b-bc5278fd8de0", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/2040600b_1/2040600b_1_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/2040600b_1/2040600b_1_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_tex.png.meta new file mode 100644 index 00000000..884ea16f --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2040600b_1/2040600b_1_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "c46ca05e-1a2b-43d2-b56b-bc5278fd8de0", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "2040600b_1_tex": { + "ver": "1.0.3", + "uuid": "a3a7a9e7-da08-4f76-9092-ff41e3aa560d", + "rawTextureUuid": "c46ca05e-1a2b-43d2-b56b-bc5278fd8de0", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -25, + "offsetY": 58, + "trimX": 2, + "trimY": 2, + "width": 74, + "height": 136, + "rawWidth": 128, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20509007.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20509007.meta new file mode 100644 index 00000000..ce1cfbcc --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20509007.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "9865aa80-0b36-41d5-90df-44cfd7f38854", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20509007/20509007_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20509007/20509007_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_ske.json.meta new file mode 100644 index 00000000..0868fa93 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "60d8c296-918f-4868-88fc-863931ae29af", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20509007/20509007_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20509007/20509007_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_tex.json.meta new file mode 100644 index 00000000..72da5e62 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "c1b4f512-7d33-4535-8a2e-456602dba9d2", + "atlasJson": "{\"width\":1024,\"SubTexture\":[{\"width\":899,\"y\":1,\"height\":1009,\"name\":\"dress/20509007\",\"x\":1}],\"height\":1024,\"name\":\"20509007\",\"imagePath\":\"20509007_tex.png\"}", + "texture": "3bd36e6e-a5e2-4e88-9177-96223bed7909", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20509007/20509007_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20509007/20509007_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_tex.png.meta new file mode 100644 index 00000000..e6d6ccdc --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20509007/20509007_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "3bd36e6e-a5e2-4e88-9177-96223bed7909", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20509007_tex": { + "ver": "1.0.3", + "uuid": "e7b56456-8af4-4451-9c11-1acc0d653343", + "rawTextureUuid": "3bd36e6e-a5e2-4e88-9177-96223bed7909", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -61.5, + "offsetY": 6.5, + "trimX": 2, + "trimY": 2, + "width": 897, + "height": 1007, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20703020.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20703020.meta new file mode 100644 index 00000000..bd12bd94 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20703020.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "12c8cea7-f17f-438a-9e19-d4e6998bc234", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20703020/20703020_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20703020/20703020_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_ske.json.meta new file mode 100644 index 00000000..5220f0df --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "84c9fb84-3ae2-43df-8723-8138a4d116b2", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20703020/20703020_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20703020/20703020_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_tex.json.meta new file mode 100644 index 00000000..7d076584 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "83e94d1d-a1db-4b79-964e-4d2e547d0ff3", + "atlasJson": "{\"width\":128,\"SubTexture\":[{\"width\":92,\"y\":1,\"height\":138,\"name\":\"shoe/20703020\",\"x\":1}],\"height\":256,\"name\":\"20703020\",\"imagePath\":\"20703020_tex.png\"}", + "texture": "f84da456-2ce5-4adf-a588-d903370217f9", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20703020/20703020_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20703020/20703020_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_tex.png.meta new file mode 100644 index 00000000..9274f9b4 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20703020/20703020_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "f84da456-2ce5-4adf-a588-d903370217f9", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20703020_tex": { + "ver": "1.0.3", + "uuid": "4bd58cec-0407-41ce-9db5-56cba8b64dd3", + "rawTextureUuid": "f84da456-2ce5-4adf-a588-d903370217f9", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -17, + "offsetY": 58, + "trimX": 2, + "trimY": 2, + "width": 90, + "height": 136, + "rawWidth": 128, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1.meta new file mode 100644 index 00000000..1e32c899 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "75d4074e-2c4e-44b9-9ef0-416754b2dd02", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20703020_1/20703020_1_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20703020_1/20703020_1_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_ske.json.meta new file mode 100644 index 00000000..867a8616 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "068e89cf-26a0-49f9-b769-d534a69d21a1", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20703020_1/20703020_1_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20703020_1/20703020_1_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_tex.json.meta new file mode 100644 index 00000000..20c19da6 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "3c1a3880-abc7-4b15-93e1-9b520b9db018", + "atlasJson": "{\"width\":128,\"SubTexture\":[{\"width\":79,\"y\":1,\"height\":132,\"name\":\"shoe/20703020_1\",\"x\":1}],\"height\":256,\"name\":\"20703020_1\",\"imagePath\":\"20703020_1_tex.png\"}", + "texture": "23873239-adea-4825-87ea-fc0deb944c7f", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20703020_1/20703020_1_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20703020_1/20703020_1_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_tex.png.meta new file mode 100644 index 00000000..cd66e8c2 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20703020_1/20703020_1_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "23873239-adea-4825-87ea-fc0deb944c7f", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20703020_1_tex": { + "ver": "1.0.3", + "uuid": "5079f761-9d30-42c4-bdfc-ee4fc0a55a06", + "rawTextureUuid": "23873239-adea-4825-87ea-fc0deb944c7f", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -23.5, + "offsetY": 61, + "trimX": 2, + "trimY": 2, + "width": 77, + "height": 130, + "rawWidth": 128, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20801015.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20801015.meta new file mode 100644 index 00000000..0e96189c --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20801015.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "3bb67042-61b3-455c-a97f-7ca7e54a0f12", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20801015/20801015_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20801015/20801015_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_ske.json.meta new file mode 100644 index 00000000..53cc11cb --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "fa1f0d8c-3ec4-4c20-97dc-9d125c5ad9b9", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20801015/20801015_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20801015/20801015_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_tex.json.meta new file mode 100644 index 00000000..d4106246 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "6bb2c1d1-4f86-40fd-8eea-2fe9767c9dbe", + "atlasJson": "{\"width\":256,\"SubTexture\":[{\"width\":243,\"y\":1,\"height\":251,\"name\":\"headwear/20801015\",\"x\":1}],\"height\":256,\"name\":\"20801015\",\"imagePath\":\"20801015_tex.png\"}", + "texture": "e5094076-84f9-40e5-816f-b1982aa42fbc", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/20801015/20801015_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/20801015/20801015_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_tex.png.meta new file mode 100644 index 00000000..449e8164 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/20801015/20801015_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "e5094076-84f9-40e5-816f-b1982aa42fbc", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "20801015_tex": { + "ver": "1.0.3", + "uuid": "338a41f7-d54c-4c09-9792-d673d39c39a5", + "rawTextureUuid": "e5094076-84f9-40e5-816f-b1982aa42fbc", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -5.5, + "offsetY": 1.5, + "trimX": 2, + "trimY": 2, + "width": 241, + "height": 249, + "rawWidth": 256, + "rawHeight": 256, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2080b003.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003.meta new file mode 100644 index 00000000..53889100 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003.meta @@ -0,0 +1,5 @@ +{ + "ver": "1.0.1", + "uuid": "39d2152a-0809-4e21-ba70-b8753383f10a", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/2080b003/2080b003_ske.json b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_ske.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/2080b003/2080b003_ske.json rename to Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_ske.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_ske.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_ske.json.meta new file mode 100644 index 00000000..8dc2c2a3 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_ske.json.meta @@ -0,0 +1,5 @@ +{ + "ver": "2.0.0", + "uuid": "0342e972-4be7-481f-9129-feb57a102fed", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/2080b003/2080b003_tex.json b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_tex.json similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/2080b003/2080b003_tex.json rename to Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_tex.json diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_tex.json.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_tex.json.meta new file mode 100644 index 00000000..f9e70a37 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_tex.json.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.0", + "uuid": "c73a4620-8357-4e9d-a34c-bdf1c1ad15c6", + "atlasJson": "{\"width\":1024,\"SubTexture\":[{\"width\":810,\"y\":1,\"height\":940,\"name\":\"streamer/2080b003\",\"x\":1}],\"height\":1024,\"name\":\"2080b003\",\"imagePath\":\"2080b003_tex.png\"}", + "texture": "a5a4fe2e-b381-4ca8-9c32-083c363fb8a9", + "subMetas": {} +} \ No newline at end of file diff --git a/Egret/Demos/resource/you_xin/suit2/2080b003/2080b003_tex.png b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_tex.png similarity index 100% rename from Egret/Demos/resource/you_xin/suit2/2080b003/2080b003_tex.png rename to Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_tex.png diff --git a/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_tex.png.meta b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_tex.png.meta new file mode 100644 index 00000000..8f03b8d7 --- /dev/null +++ b/Cocos/Demos/assets/resources/you_xin/suit2/2080b003/2080b003_tex.png.meta @@ -0,0 +1,30 @@ +{ + "ver": "1.0.0", + "uuid": "a5a4fe2e-b381-4ca8-9c32-083c363fb8a9", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "subMetas": { + "2080b003_tex": { + "ver": "1.0.3", + "uuid": "05b3a3b2-cdc9-46d0-9a60-f9c6cfd42e39", + "rawTextureUuid": "a5a4fe2e-b381-4ca8-9c32-083c363fb8a9", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": -106, + "offsetY": 41, + "trimX": 2, + "trimY": 2, + "width": 808, + "height": 938, + "rawWidth": 1024, + "rawHeight": 1024, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/Cocos/Demos/creator.d.ts b/Cocos/Demos/creator.d.ts new file mode 100644 index 00000000..c046137d --- /dev/null +++ b/Cocos/Demos/creator.d.ts @@ -0,0 +1,17188 @@ + +/** !#en +The main namespace of Cocos2d-JS, all engine core classes, functions, properties and constants are defined in this namespace. +!#zh +Cocos 引擎的主要命名空间,引擎代码中所有的类,函数,属性和常量都在这个命名空间中定义。 */ +declare module cc { + /** The current version of Cocos2d being used.
+ Please DO NOT remove this String, it is an important flag for bug tracking.
+ If you post a bug to forum, please attach this flag. */ + export var ENGINE_VERSION: string; + /** The element contains the game canvas */ + export var container: HTMLDivElement; + /** + !#en Init Debug setting. + !#zh 设置调试模式。 + @param mode mode + */ + export function _initDebugSetting(mode: DebugMode): void; + /** + !#en + Outputs an error message to the Cocos Creator Console (editor) or Web Console (runtime).
+ - In Cocos Creator, error is red.
+ - In Chrome, error have a red icon along with red message text.
+ !#zh + 输出错误消息到 Cocos Creator 编辑器的 Console 或运行时页面端的 Console 中。
+ - 在 Cocos Creator 中,错误信息显示是红色的。
+ - 在 Chrome 中,错误信息有红色的图标以及红色的消息文本。
+ @param msg A JavaScript string containing zero or more substitution strings. + @param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. + */ + export function error(msg: any, ...subst: any[]): void; + /** + !#en + Outputs a warning message to the Cocos Creator Console (editor) or Web Console (runtime). + - In Cocos Creator, warning is yellow. + - In Chrome, warning have a yellow warning icon with the message text. + !#zh + 输出警告消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。
+ - 在 Cocos Creator 中,警告信息显示是黄色的。
+ - 在 Chrome 中,警告信息有着黄色的图标以及黄色的消息文本。
+ @param msg A JavaScript string containing zero or more substitution strings. + @param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. + */ + export function warn(msg: any, ...subst: any[]): void; + /** + !#en Outputs a message to the Cocos Creator Console (editor) or Web Console (runtime). + !#zh 输出一条消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。 + @param msg A JavaScript string containing zero or more substitution strings. + @param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. + */ + export function log(msg: string|any, ...subst: any[]): void; + /** + !#en + Outputs an informational message to the Cocos Creator Console (editor) or Web Console (runtime). + - In Cocos Creator, info is blue. + - In Firefox and Chrome, a small "i" icon is displayed next to these items in the Web Console's log. + !#zh + 输出一条信息消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。 + - 在 Cocos Creator 中,Info 信息显示是蓝色的。
+ - 在 Firefox 和 Chrome 中,Info 信息有着小 “i” 图标。 + @param msg A JavaScript string containing zero or more substitution strings. + @param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. + */ + export function info(msg: any, ...subst: any[]): void; + /** + !#en + Creates the speed action which changes the speed of an action, making it take longer (speed > 1) + or less (speed < 1) time.
+ Useful to simulate 'slow motion' or 'fast forward' effect. + !#zh 修改目标动作的速率。 + @param action action + @param speed speed + + @example + ```js + // change the target action speed; + var action = cc.scaleTo(0.2, 1, 0.6); + var newAction = cc.speed(action, 0.5); + ``` + */ + export function speed(action: ActionInterval, speed: number): Action; + /** + !#en Create a follow action which makes its target follows another node. + !#zh 追踪目标节点的位置。 + @param followedNode followedNode + @param rect rect + + @example + ```js + // example + // creates the action with a set boundary + var followAction = cc.follow(targetNode, cc.rect(0, 0, screenWidth * 2 - 100, screenHeight)); + node.runAction(followAction); + + // creates the action with no boundary set + var followAction = cc.follow(targetNode); + node.runAction(followAction); + ``` + */ + export function follow(followedNode: Node, rect: Rect): Action; + /** + Points setter + @param points points + */ + export function setPoints(points: any[]): void; + /** + !#en Creates an action with a Cardinal Spline array of points and tension. + !#zh 按基数样条曲线轨迹移动到目标位置。 + @param duration duration + @param points array of control points + @param tension tension + + @example + ```js + //create a cc.CardinalSplineTo + var action1 = cc.cardinalSplineTo(3, array, 0); + ``` + */ + export function cardinalSplineTo(duration: number, points: any[], tension: number): ActionInterval; + /** + update position of target + @param newPos newPos + */ + export function updatePosition(newPos: Vec2): void; + /** + !#en Creates an action with a Cardinal Spline array of points and tension. + !#zh 按基数样条曲线轨迹移动指定的距离。 + @param duration duration + @param points points + @param tension tension + */ + export function cardinalSplineBy(duration: number, points: any[], tension: number): ActionInterval; + /** + !#en Creates an action with a Cardinal Spline array of points and tension. + !#zh 按 Catmull Rom 样条曲线轨迹移动到目标位置。 + @param dt dt + @param points points + + @example + ```js + var action1 = cc.catmullRomTo(3, array); + ``` + */ + export function catmullRomTo(dt: number, points: any[]): ActionInterval; + /** + !#en Creates an action with a Cardinal Spline array of points and tension. + !#zh 按 Catmull Rom 样条曲线轨迹移动指定的距离。 + @param dt dt + @param points points + + @example + ```js + var action1 = cc.catmullRomBy(3, array); + ``` + */ + export function catmullRomBy(dt: number, points: any[]): ActionInterval; + /** + !#en + Creates the action easing object with the rate parameter.
+ From slow to fast. + !#zh 创建 easeIn 缓动对象,由慢到快。 + @param rate rate + + @example + ```js + action.easing(cc.easeIn(3.0)); + ``` + */ + export function easeIn(rate: number): any; + /** + !#en + Creates the action easing object with the rate parameter.
+ From fast to slow. + !#zh 创建 easeOut 缓动对象,由快到慢。 + @param rate rate + + @example + ```js + action.easing(cc.easeOut(3.0)); + ``` + */ + export function easeOut(rate: number): any; + /** + !#en + Creates the action easing object with the rate parameter.
+ Slow to fast then to slow. + !#zh 创建 easeInOut 缓动对象,慢到快,然后慢。 + @param rate rate + + @example + ```js + action.easing(cc.easeInOut(3.0)); + ``` + */ + export function easeInOut(rate: number): any; + /** + !#en + Creates the action easing object with the rate parameter.
+ Reference easeInExpo:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeExponentialIn 缓动对象。
+ EaseExponentialIn 是按指数函数缓动进入的动作。
+ 参考 easeInExpo:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeExponentialIn()); + ``` + */ + export function easeExponentialIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutExpo:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeExponentialOut 缓动对象。
+ EaseExponentialOut 是按指数函数缓动退出的动作。
+ 参考 easeOutExpo:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeExponentialOut()); + ``` + */ + export function easeExponentialOut(): any; + /** + !#en + Creates an EaseExponentialInOut action easing object.
+ Reference easeInOutExpo:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeExponentialInOut 缓动对象。
+ EaseExponentialInOut 是按指数函数缓动进入并退出的动作。
+ 参考 easeInOutExpo:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeExponentialInOut()); + ``` + */ + export function easeExponentialInOut(): any; + /** + !#en + Creates an EaseSineIn action.
+ Reference easeInSine:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 EaseSineIn 缓动对象。
+ EaseSineIn 是按正弦函数缓动进入的动作。
+ 参考 easeInSine:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeSineIn()); + ``` + */ + export function easeSineIn(): any; + /** + !#en + Creates an EaseSineOut action easing object.
+ Reference easeOutSine:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 EaseSineOut 缓动对象。
+ EaseSineIn 是按正弦函数缓动退出的动作。
+ 参考 easeOutSine:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeSineOut()); + ``` + */ + export function easeSineOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutSine:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeSineInOut 缓动对象。
+ EaseSineIn 是按正弦函数缓动进入并退出的动作。
+ 参考 easeInOutSine:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + action.easing(cc.easeSineInOut()); + ``` + */ + export function easeSineInOut(): any; + /** + !#en + Creates the action easing obejct with the period in radians (default is 0.3).
+ Reference easeInElastic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeElasticIn 缓动对象。
+ EaseElasticIn 是按弹性曲线缓动进入的动作。
+ 参数 easeInElastic:http://www.zhihu.com/question/21981571/answer/19925418 + @param period period + + @example + ```js + // example + action.easing(cc.easeElasticIn(3.0)); + ``` + */ + export function easeElasticIn(period: number): any; + /** + !#en + Creates the action easing object with the period in radians (default is 0.3).
+ Reference easeOutElastic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeElasticOut 缓动对象。
+ EaseElasticOut 是按弹性曲线缓动退出的动作。
+ 参考 easeOutElastic:http://www.zhihu.com/question/21981571/answer/19925418 + @param period period + + @example + ```js + // example + action.easing(cc.easeElasticOut(3.0)); + ``` + */ + export function easeElasticOut(period: number): any; + /** + !#en + Creates the action easing object with the period in radians (default is 0.3).
+ Reference easeInOutElastic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeElasticInOut 缓动对象。
+ EaseElasticInOut 是按弹性曲线缓动进入并退出的动作。
+ 参考 easeInOutElastic:http://www.zhihu.com/question/21981571/answer/19925418 + @param period period + + @example + ```js + // example + action.easing(cc.easeElasticInOut(3.0)); + ``` + */ + export function easeElasticInOut(period: number): any; + /** + !#en + Creates the action easing object.
+ Eased bounce effect at the beginning. + !#zh + 创建 easeBounceIn 缓动对象。
+ EaseBounceIn 是按弹跳动作缓动进入的动作。 + + @example + ```js + // example + action.easing(cc.easeBounceIn()); + ``` + */ + export function easeBounceIn(): any; + /** + !#en + Creates the action easing object.
+ Eased bounce effect at the ending. + !#zh + 创建 easeBounceOut 缓动对象。
+ EaseBounceOut 是按弹跳动作缓动退出的动作。 + + @example + ```js + // example + action.easing(cc.easeBounceOut()); + ``` + */ + export function easeBounceOut(): any; + /** + !#en + Creates the action easing object.
+ Eased bounce effect at the begining and ending. + !#zh + 创建 easeBounceInOut 缓动对象。
+ EaseBounceInOut 是按弹跳动作缓动进入并退出的动作。 + + @example + ```js + // example + action.easing(cc.easeBounceInOut()); + ``` + */ + export function easeBounceInOut(): any; + /** + !#en + Creates the action easing object.
+ In the opposite direction to move slowly, and then accelerated to the right direction. + !#zh + 创建 easeBackIn 缓动对象。
+ easeBackIn 是在相反的方向缓慢移动,然后加速到正确的方向。
+ + @example + ```js + // example + action.easing(cc.easeBackIn()); + ``` + */ + export function easeBackIn(): any; + /** + !#en + Creates the action easing object.
+ Fast moving more than the finish, and then slowly back to the finish. + !#zh + 创建 easeBackOut 缓动对象。
+ easeBackOut 快速移动超出目标,然后慢慢回到目标点。 + + @example + ```js + // example + action.easing(cc.easeBackOut()); + ``` + */ + export function easeBackOut(): any; + /** + !#en + Creates the action easing object.
+ Begining of cc.EaseBackIn. Ending of cc.EaseBackOut. + !#zh + 创建 easeBackInOut 缓动对象。
+ + @example + ```js + // example + action.easing(cc.easeBackInOut()); + ``` + */ + export function easeBackInOut(): any; + /** + !#en + Creates the action easing object.
+ Into the 4 reference point.
+ To calculate the motion curve. + !#zh + 创建 easeBezierAction 缓动对象。
+ EaseBezierAction 是按贝塞尔曲线缓动的动作。 + @param p0 The first bezier parameter + @param p1 The second bezier parameter + @param p2 The third bezier parameter + @param p3 The fourth bezier parameter + + @example + ```js + // example + action.easing(cc.easeBezierAction(0.5, 0.5, 1.0, 1.0)); + ``` + */ + export function easeBezierAction(p0: number, p1: number, p2: number, p3: number): any; + /** + !#en + Creates the action easing object.
+ Reference easeInQuad:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuadraticActionIn 缓动对象。
+ EaseQuadraticIn是按二次函数缓动进入的动作。
+ 参考 easeInQuad:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuadraticActionIn()); + ``` + */ + export function easeQuadraticActionIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutQuad:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuadraticActionOut 缓动对象。
+ EaseQuadraticOut 是按二次函数缓动退出的动作。
+ 参考 easeOutQuad:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuadraticActionOut()); + ``` + */ + export function easeQuadraticActionOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutQuad:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuadraticActionInOut 缓动对象。
+ EaseQuadraticInOut 是按二次函数缓动进入并退出的动作。
+ 参考 easeInOutQuad:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuadraticActionInOut()); + ``` + */ + export function easeQuadraticActionInOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeIntQuart:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuarticActionIn 缓动对象。
+ EaseQuarticIn 是按四次函数缓动进入的动作。
+ 参考 easeIntQuart:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuarticActionIn()); + ``` + */ + export function easeQuarticActionIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutQuart:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuarticActionOut 缓动对象。
+ EaseQuarticOut 是按四次函数缓动退出的动作。
+ 参考 easeOutQuart:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.QuarticActionOut()); + ``` + */ + export function easeQuarticActionOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutQuart:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuarticActionInOut 缓动对象。
+ EaseQuarticInOut 是按四次函数缓动进入并退出的动作。
+ 参考 easeInOutQuart:http://www.zhihu.com/question/21981571/answer/19925418 + */ + export function easeQuarticActionInOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInQuint:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuinticActionIn 缓动对象。
+ EaseQuinticIn 是按五次函数缓动进的动作。
+ 参考 easeInQuint:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuinticActionIn()); + ``` + */ + export function easeQuinticActionIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutQuint:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuinticActionOut 缓动对象。
+ EaseQuinticOut 是按五次函数缓动退出的动作 + 参考 easeOutQuint:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuadraticActionOut()); + ``` + */ + export function easeQuinticActionOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutQuint:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeQuinticActionInOut 缓动对象。
+ EaseQuinticInOut是按五次函数缓动进入并退出的动作。
+ 参考 easeInOutQuint:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeQuinticActionInOut()); + ``` + */ + export function easeQuinticActionInOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInCirc:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCircleActionIn 缓动对象。
+ EaseCircleIn是按圆形曲线缓动进入的动作。
+ 参考 easeInCirc:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeCircleActionIn()); + ``` + */ + export function easeCircleActionIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutCirc:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCircleActionOut 缓动对象。
+ EaseCircleOut是按圆形曲线缓动退出的动作。
+ 参考 easeOutCirc:http://www.zhihu.com/question/21981571/answer/19925418 + */ + export function easeCircleActionOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutCirc:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCircleActionInOut 缓动对象。
+ EaseCircleInOut 是按圆形曲线缓动进入并退出的动作。
+ 参考 easeInOutCirc:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeCircleActionInOut()); + ``` + */ + export function easeCircleActionInOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInCubic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCubicActionIn 缓动对象。
+ EaseCubicIn 是按三次函数缓动进入的动作。
+ 参考 easeInCubic:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeCubicActionIn()); + ``` + */ + export function easeCubicActionIn(): any; + /** + !#en + Creates the action easing object.
+ Reference easeOutCubic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCubicActionOut 缓动对象。
+ EaseCubicOut 是按三次函数缓动退出的动作。
+ 参考 easeOutCubic:http://www.zhihu.com/question/21981571/answer/19925418 + + @example + ```js + //example + action.easing(cc.easeCubicActionOut()); + ``` + */ + export function easeCubicActionOut(): any; + /** + !#en + Creates the action easing object.
+ Reference easeInOutCubic:
+ http://www.zhihu.com/question/21981571/answer/19925418 + !#zh + 创建 easeCubicActionInOut 缓动对象。
+ EaseCubicInOut是按三次函数缓动进入并退出的动作。
+ 参考 easeInOutCubic:http://www.zhihu.com/question/21981571/answer/19925418 + */ + export function easeCubicActionInOut(): any; + /** + !#en Show the Node. + !#zh 立即显示。 + + @example + ```js + // example + var showAction = cc.show(); + ``` + */ + export function show(): ActionInstant; + /** + !#en Hide the node. + !#zh 立即隐藏。 + + @example + ```js + // example + var hideAction = cc.hide(); + ``` + */ + export function hide(): ActionInstant; + /** + !#en Toggles the visibility of a node. + !#zh 显隐状态切换。 + + @example + ```js + // example + var toggleVisibilityAction = cc.toggleVisibility(); + ``` + */ + export function toggleVisibility(): ActionInstant; + /** + !#en Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing. + !#zh 从父节点移除自身。 + @param isNeedCleanUp isNeedCleanUp + + @example + ```js + // example + var removeSelfAction = cc.removeSelf(); + ``` + */ + export function removeSelf(isNeedCleanUp ?: boolean): ActionInstant; + /** + !#en Create a FlipX action to flip or unflip the target. + !#zh X轴翻转。 + @param flip Indicate whether the target should be flipped or not + + @example + ```js + var flipXAction = cc.flipX(true); + ``` + */ + export function flipX(flip: boolean): ActionInstant; + /** + !#en Create a FlipY action to flip or unflip the target. + !#zh Y轴翻转。 + @param flip flip + + @example + ```js + var flipYAction = cc.flipY(true); + ``` + */ + export function flipY(flip: boolean): ActionInstant; + /** + !#en Creates a Place action with a position. + !#zh 放置在目标位置。 + @param pos pos + @param y y + + @example + ```js + // example + var placeAction = cc.place(cc.p(200, 200)); + var placeAction = cc.place(200, 200); + ``` + */ + export function place(pos: Vec2|number, y?: number): ActionInstant; + /** + !#en Creates the action with the callback. + !#zh 执行回调函数。 + @param selector selector + @param selectorTarget selectorTarget + @param data data for function, it accepts all data types. + + @example + ```js + // example + // CallFunc without data + var finish = cc.callFunc(this.removeSprite, this); + + // CallFunc with data + var finish = cc.callFunc(this.removeFromParentAndCleanup, this._grossini, true); + ``` + */ + export function callFunc(selector: Function, selectorTarget?: any, data?: any): ActionInstant; + /** + !#en + Helper constructor to create an array of sequenceable actions + The created action will run actions sequentially, one after another. + !#zh 顺序执行动作,创建的动作将按顺序依次运行。 + @param actionOrActionArray actionOrActionArray + @param tempArray tempArray + + @example + ```js + // example + // create sequence with actions + var seq = cc.sequence(act1, act2); + + // create sequence with array + var seq = cc.sequence(actArray); + ``` + */ + export function sequence(actionOrActionArray: FiniteTimeAction|FiniteTimeAction[], ...tempArray: FiniteTimeAction[]): ActionInterval; + /** + !#en Creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30) + !#zh 重复动作,可以按一定次数重复一个动,如果想永远重复一个动作请使用 repeatForever 动作来完成。 + @param action action + @param times times + + @example + ```js + // example + var rep = cc.repeat(cc.sequence(jump2, jump1), 5); + ``` + */ + export function repeat(action: FiniteTimeAction, times: number): ActionInterval; + /** + !#en Create a acton which repeat forever, as it runs forever, it can't be added into cc.sequence and cc.spawn. + !#zh 永远地重复一个动作,有限次数内重复一个动作请使用 repeat 动作,由于这个动作不会停止,所以不能被添加到 cc.sequence 或 cc.spawn 中。 + @param action action + + @example + ```js + // example + var repeat = cc.repeatForever(cc.rotateBy(1.0, 360)); + ``` + */ + export function repeatForever(action: FiniteTimeAction): ActionInterval; + /** + !#en Create a spawn action which runs several actions in parallel. + !#zh 同步执行动作,同步执行一组动作。 + @param actionOrActionArray actionOrActionArray + @param tempArray tempArray + + @example + ```js + // example + var action = cc.spawn(cc.jumpBy(2, cc.p(300, 0), 50, 4), cc.rotateBy(2, 720)); + todo:It should be the direct use new + ``` + */ + export function spawn(actionOrActionArray: FiniteTimeAction|FiniteTimeAction[], ...tempArray: FiniteTimeAction[]): FiniteTimeAction; + /** + !#en + Rotates a Node object to a certain angle by modifying its rotation property.
+ The direction will be decided by the shortest angle. + !#zh 旋转到目标角度,通过逐帧修改它的 rotation 属性,旋转方向将由最短的角度决定。 + @param duration duration in seconds + @param deltaAngleX deltaAngleX in degrees. + @param deltaAngleY deltaAngleY in degrees. + + @example + ```js + // example + var rotateTo = cc.rotateTo(2, 61.0); + ``` + */ + export function rotateTo(duration: number, deltaAngleX: number, deltaAngleY?: number): ActionInterval; + /** + !#en + Rotates a Node object clockwise a number of degrees by modifying its rotation property. + Relative to its properties to modify. + !#zh 旋转指定的角度。 + @param duration duration in seconds + @param deltaAngleX deltaAngleX in degrees + @param deltaAngleY deltaAngleY in degrees + + @example + ```js + // example + var actionBy = cc.rotateBy(2, 360); + ``` + */ + export function rotateBy(duration: number, deltaAngleX: number, deltaAngleY?: number): ActionInterval; + /** + !#en + Moves a Node object x,y pixels by modifying its position property.
+ x and y are relative to the position of the object.
+ Several MoveBy actions can be concurrently called, and the resulting
+ movement will be the sum of individual movements. + !#zh 移动指定的距离。 + @param duration duration in seconds + @param deltaPos deltaPos + @param deltaY deltaY + + @example + ```js + // example + var actionTo = cc.moveBy(2, cc.p(windowSize.width - 40, windowSize.height - 40)); + ``` + */ + export function moveBy(duration: number, deltaPos: Vec2|number, deltaY?: number): ActionInterval; + /** + !#en + Moves a Node object to the position x,y. x and y are absolute coordinates by modifying its position property.
+ Several MoveTo actions can be concurrently called, and the resulting
+ movement will be the sum of individual movements. + !#zh 移动到目标位置。 + @param duration duration in seconds + @param position position + @param y y + + @example + ```js + // example + var actionBy = cc.moveTo(2, cc.p(80, 80)); + ``` + */ + export function moveTo(duration: number, position: Vec2|number, y?: number): ActionInterval; + /** + !#en + Create a action which skews a Node object to given angles by modifying its skewX and skewY properties. + Changes to the specified value. + !#zh 偏斜到目标角度。 + @param t time in seconds + @param sx sx + @param sy sy + + @example + ```js + // example + var actionTo = cc.skewTo(2, 37.2, -37.2); + ``` + */ + export function skewTo(t: number, sx: number, sy: number): ActionInterval; + /** + !#en + Skews a Node object by skewX and skewY degrees.
+ Relative to its property modification. + !#zh 偏斜指定的角度。 + @param t time in seconds + @param sx sx skew in degrees for X axis + @param sy sy skew in degrees for Y axis + + @example + ```js + // example + var actionBy = cc.skewBy(2, 0, -90); + ``` + */ + export function skewBy(t: number, sx: number, sy: number): ActionInterval; + /** + !#en + Moves a Node object simulating a parabolic jump movement by modifying it's position property. + Relative to its movement. + !#zh 用跳跃的方式移动指定的距离。 + @param duration duration + @param position position + @param y y + @param height height + @param jumps jumps + + @example + ```js + // example + var actionBy = cc.jumpBy(2, cc.p(300, 0), 50, 4); + var actionBy = cc.jumpBy(2, 300, 0, 50, 4); + ``` + */ + export function jumpBy(duration: number, position: Vec2|number, y?: number, height?: number, jumps?: number): ActionInterval; + /** + !#en + Moves a Node object to a parabolic position simulating a jump movement by modifying its position property.
+ Jump to the specified location. + !#zh 用跳跃的方式移动到目标位置。 + @param duration duration + @param position position + @param y y + @param height height + @param jumps jumps + + @example + ```js + // example + var actionTo = cc.jumpTo(2, cc.p(300, 300), 50, 4); + var actionTo = cc.jumpTo(2, 300, 300, 50, 4); + ``` + */ + export function jumpTo(duration: number, position: Vec2|number, y?: number, height?: number, jumps?: number): ActionInterval; + /** + !#en + An action that moves the target with a cubic Bezier curve by a certain distance. + Relative to its movement. + !#zh 按贝赛尔曲线轨迹移动指定的距离。 + @param t time in seconds + @param c Array of points + + @example + ```js + // example + var bezier = [cc.p(0, windowSize.height / 2), cc.p(300, -windowSize.height / 2), cc.p(300, 100)]; + var bezierForward = cc.bezierBy(3, bezier); + ``` + */ + export function bezierBy(t: number, c: Vec2[]): ActionInterval; + /** + !#en An action that moves the target with a cubic Bezier curve to a destination point. + !#zh 按贝赛尔曲线轨迹移动到目标位置。 + @param t t + @param c Array of points + + @example + ```js + // example + var bezier = [cc.p(0, windowSize.height / 2), cc.p(300, -windowSize.height / 2), cc.p(300, 100)]; + var bezierTo = cc.bezierTo(2, bezier); + ``` + */ + export function bezierTo(t: number, c: Vec2[]): ActionInterval; + /** + !#en Scales a Node object to a zoom factor by modifying it's scale property. + !#zh 将节点大小缩放到指定的倍数。 + @param duration duration + @param sx scale parameter in X + @param sy scale parameter in Y, if Null equal to sx + + @example + ```js + // example + // It scales to 0.5 in both X and Y. + var actionTo = cc.scaleTo(2, 0.5); + + // It scales to 0.5 in x and 2 in Y + var actionTo = cc.scaleTo(2, 0.5, 2); + ``` + */ + export function scaleTo(duration: number, sx: number, sy?: number): ActionInterval; + /** + !#en + Scales a Node object a zoom factor by modifying it's scale property. + Relative to its changes. + !#zh 按指定的倍数缩放节点大小。 + @param duration duration in seconds + @param sx sx scale parameter in X + @param sy sy scale parameter in Y, if Null equal to sx + + @example + ```js + // example without sy, it scales by 2 both in X and Y + var actionBy = cc.scaleBy(2, 2); + + //example with sy, it scales by 0.25 in X and 4.5 in Y + var actionBy2 = cc.scaleBy(2, 0.25, 4.5); + ``` + */ + export function scaleBy(duration: number, sx: number, sy?: number|void): ActionInterval; + /** + !#en Blinks a Node object by modifying it's visible property. + !#zh 闪烁(基于透明度)。 + @param duration duration in seconds + @param blinks blinks in times + + @example + ```js + // example + var action = cc.blink(2, 10); + ``` + */ + export function blink(duration: number, blinks: number): ActionInterval; + /** + !#en + Fades an object that implements the cc.RGBAProtocol protocol. + It modifies the opacity from the current value to a custom one. + !#zh 修改透明度到指定值。 + @param duration duration + @param opacity 0-255, 0 is transparent + + @example + ```js + // example + var action = cc.fadeTo(1.0, 0); + ``` + */ + export function fadeTo(duration: number, opacity: number): ActionInterval; + /** + !#en Fades In an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 0 to 255. + !#zh 渐显效果。 + @param duration duration in seconds + + @example + ```js + //example + var action = cc.fadeIn(1.0); + ``` + */ + export function fadeIn(duration: number): ActionInterval; + /** + !#en Fades Out an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 255 to 0. + !#zh 渐隐效果。 + @param d duration in seconds + + @example + ```js + // example + var action = cc.fadeOut(1.0); + ``` + */ + export function fadeOut(d: number): ActionInterval; + /** + !#en Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one. + !#zh 修改颜色到指定值。 + @param duration duration + @param red 0-255 + @param green 0-255 + @param blue 0-255 + + @example + ```js + // example + var action = cc.tintTo(2, 255, 0, 255); + ``` + */ + export function tintTo(duration: number, red: number, green: number, blue: number): ActionInterval; + /** + !#en + Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one. + Relative to their own color change. + !#zh 按照指定的增量修改颜色。 + @param duration duration in seconds + @param deltaRed deltaRed + @param deltaGreen deltaGreen + @param deltaBlue deltaBlue + + @example + ```js + // example + var action = cc.tintBy(2, -127, -255, -127); + ``` + */ + export function tintBy(duration: number, deltaRed: number, deltaGreen: number, deltaBlue: number): ActionInterval; + /** + !#en Delays the action a certain amount of seconds. + !#en 延迟指定的时间量。 + @param d duration in seconds + + @example + ```js + // example + var delay = cc.delayTime(1); + ``` + */ + export function delayTime(d: number): ActionInterval; + /** + !#en Executes an action in reverse order, from time=duration to time=0. + !#zh 反转目标动作的时间轴。 + @param action action + + @example + ```js + // example + var reverse = cc.reverseTime(this); + ``` + */ + export function reverseTime(action: FiniteTimeAction): ActionInterval; + /** + !#en Create an action with the specified action and forced target. + !#zh 用已有动作和一个新的目标节点创建动作。 + @param target target + @param action action + */ + export function targetedAction(target: Node, action: FiniteTimeAction): ActionInterval; + /** !#en cc.view is the shared view object. + !#zh cc.view 是全局的视图对象。 */ + export var view: View; + /** !#en Director + !#zh 导演类。 */ + export var director: Director; + /** !#en cc.winSize is the alias object for the size of the current game window. + !#zh cc.winSize 为当前的游戏窗口的大小。 */ + export var winSize: Size; + export var game: Game; + /** !#en The System event singleton for global usage + !#zh 系统事件单例,方便全局使用 */ + export var systemEvent: SystemEvent; + /** + + @param touches touches + */ + export function handleTouchesBegin(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesMove(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesEnd(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesCancel(touches: any[]): void; + /** + + @param touches touches + */ + export function getSetOfTouchesEndOrCancel(touches: any[]): any[]; + /** + + @param element element + */ + export function getHTMLElementPosition(element: HTMLElement): any; + /** + + @param touch touch + */ + export function getPreTouch(touch: Touch): Touch; + /** + + @param touch touch + */ + export function setPreTouch(touch: Touch): void; + /** + + @param tx tx + @param ty ty + @param pos pos + */ + export function getTouchByXY(tx: number, ty: number, pos: Vec2): Touch; + /** + + @param event event + @param pos pos + */ + export function getPointByEvent(event: Touch, pos: Vec2): Vec2; + /** + + @param event event + @param pos pos + */ + export function getTouchesByEvent(event: Touch, pos: Vec2): any[]; + /** + + @param element element + */ + export function registerSystemEvent(element: HTMLElement): void; + /** + !#en Defines a CCClass using the given specification, please see [Class](/docs/editors_and_tools/creator-chapters/scripting/class.html) for details. + !#zh 定义一个 CCClass,传入参数必须是一个包含类型参数的字面量对象,具体用法请查阅[类型定义](/docs/creator/scripting/class.html)。 + @param options options + + @example + ```js + // define base class + var Node = cc.Class(); + + // define sub class + var Sprite = cc.Class({ + name: 'Sprite', + extends: Node, + ctor: function () { + this.url = ""; + this.id = 0; + }, + + statics: { + // define static members + count: 0, + getBounds: function (spriteList) { + // compute bounds... + } + }, + + properties { + width: { + default: 128, + type: 'Integer', + tooltip: 'The width of sprite' + }, + height: 128, + size: { + get: function () { + return cc.v2(this.width, this.height); + } + } + }, + + load: function () { + // load this.url... + }; + }); + + // instantiate + + var obj = new Sprite(); + obj.url = 'sprite.png'; + obj.load(); + ``` + */ + export function Class(options?: {name?: string; extends?: Function; ctor?: Function; __ctor__?: Function; properties?: any; statics?: any; mixins?: Function[]; editor?: {executeInEditMode?: boolean; requireComponent?: Function; menu?: string; executionOrder?: number; disallowMultiple?: boolean; playOnFocus?: boolean; inspector?: string; icon?: string; help?: string; }; update?: Function; lateUpdate?: Function; onLoad?: Function; start?: Function; onEnable?: Function; onDisable?: Function; onDestroy?: Function; onFocusInEditor?: Function; onLostFocusInEditor?: Function; resetInEditor?: Function; onRestore?: Function; _getLocalBounds?: Function; }): Function; + /** + Checks whether subclass is child of superclass or equals to superclass + @param subclass subclass + @param superclass superclass + */ + export function isChildClassOf(subclass: Function, superclass: Function): boolean; + /** + Return all super classes + @param constructor constructor + */ + export function getInheritanceChain(constructor: Function): Function[]; + /** + !#en + Define an enum type.
+ If a enum item has a value of -1, it will be given an Integer number according to it's order in the list.
+ Otherwise it will use the value specified by user who writes the enum definition. + + !#zh + 定义一个枚举类型。
+ 用户可以把枚举值设为任意的整数,如果设为 -1,系统将会分配为上一个枚举值 + 1。 + @param obj a JavaScript literal object containing enum names and values, or a TypeScript enum type + + @example + ```js + // JavaScript: + + var WrapMode = cc.Enum({ + Repeat: -1, + Clamp: -1 + }); + + // Texture.WrapMode.Repeat == 0 + // Texture.WrapMode.Clamp == 1 + // Texture.WrapMode[0] == "Repeat" + // Texture.WrapMode[1] == "Clamp" + + var FlagType = cc.Enum({ + Flag1: 1, + Flag2: 2, + Flag3: 4, + Flag4: 8, + }); + + var AtlasSizeList = cc.Enum({ + 128: 128, + 256: 256, + 512: 512, + 1024: 1024, + }); + + // TypeScript: + + // If used in TypeScript, just define a TypeScript enum: + enum Direction { + Up, + Down, + Left, + Right + } + + // If you need to inspect the enum in Properties panel, you can call cc.Enum: + const {ccclass, property} = cc._decorator; + + @ccclass + class NewScript extends cc.Component { + @property({ + default: Direction.Up, + type: cc.Enum(Direction) // call cc.Enum + }) + direction: Direction = Direction.Up; + } + + ``` + */ + export function Enum(obj: T): T; + /** + whether enable accelerometer event + @param isEnable isEnable + */ + export function setAccelerometerEnabled(isEnable: boolean): void; + /** + set accelerometer interval value + @param interval interval + */ + export function setAccelerometerInterval(interval: number): void; + /** + + @param touches touches + */ + export function handleTouchesBegin(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesMove(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesEnd(touches: any[]): void; + /** + + @param touches touches + */ + export function handleTouchesCancel(touches: any[]): void; + /** + + @param touches touches + */ + export function getSetOfTouchesEndOrCancel(touches: any[]): any[]; + /** + + @param element element + */ + export function getHTMLElementPosition(element: HTMLElement): any; + /** + + @param touch touch + */ + export function getPreTouch(touch: Touch): Touch; + /** + + @param touch touch + */ + export function setPreTouch(touch: Touch): void; + /** + + @param tx tx + @param ty ty + @param pos pos + */ + export function getTouchByXY(tx: number, ty: number, pos: Vec2): Touch; + /** + + @param location location + @param pos pos + @param eventType eventType + */ + export function getTouchByXY(location: Vec2, pos: Vec2, eventType: number): Event.EventMouse; + /** + + @param event event + @param pos pos + */ + export function getPointByEvent(event: Touch, pos: Vec2): Vec2; + /** + + @param event event + @param pos pos + */ + export function getTouchesByEvent(event: Touch, pos: Vec2): any[]; + /** + + @param element element + */ + export function registerSystemEvent(element: HTMLElement): void; + /** + + @param dt dt + */ + export function update(dt: number): void; + /** +

+ Linear interpolation between 2 numbers, the ratio sets how much it is biased to each end +

+ @param a number A + @param b number B + @param r ratio between 0 and 1 + + @example + ```js + ---- + lerp + cc.lerp(2,10,0.5)//returns 6 + cc.lerp(2,10,0.2)//returns 3.6 + + ``` + */ + export function lerp(a: number, b: number, r: number): void; + /** + get a random number from 0 to 0xffffff + */ + export function rand(): number; + /** + returns a random float between -1 and 1 + */ + export function randomMinus1To1(): number; + /** + returns a random float between 0 and 1, use Math.random directly + */ + export function random0To1(): number; + /** + converts degrees to radians + @param angle angle + */ + export function degreesToRadians(angle: number): number; + /** + converts radians to degrees + @param angle angle + */ + export function radiansToDegrees(angle: number): number; + /** + Helpful macro that setups the GL server state, the correct GL program and sets the Model View Projection matrix + @param node setup node + */ + export function nodeDrawSetup(node: Node): void; + /** +

+ Increments the GL Draws counts by one.
+ The number of calls per frame are displayed on the screen when the CCDirector's stats are enabled.
+

+ @param addNumber addNumber + */ + export function incrementGLDraws(addNumber: number): void; + /** + Check webgl error.Error will be shown in console if exists. + */ + export function checkGLErrorDebug(): void; + /** + !#en + Checks whether the object is non-nil and not yet destroyed.
+ When an object's `destroy` is called, it is actually destroyed after the end of this frame. + So `isValid` will return false from the next frame, while `isValid` in the current frame will still be true. + If you want to determine whether the current frame has called `destroy`, use `cc.isValid(obj, true)`, + but this is often caused by a particular logical requirements, which is not normally required. + + !#zh + 检查该对象是否不为 null 并且尚未销毁。
+ 当一个对象的 `destroy` 调用以后,会在这一帧结束后才真正销毁。因此从下一帧开始 `isValid` 就会返回 false,而当前帧内 `isValid` 仍然会是 true。如果希望判断当前帧是否调用过 `destroy`,请使用 `cc.isValid(obj, true)`,不过这往往是特殊的业务需求引起的,通常情况下不需要这样。 + @param value value + @param strictMode If true, Object called destroy() in this frame will also treated as invalid. + + @example + ```js + var node = new cc.Node(); + cc.log(cc.isValid(node)); // true + node.destroy(); + cc.log(cc.isValid(node)); // true, still valid in this frame + // after a frame... + cc.log(cc.isValid(node)); // false, destroyed in the end of last frame + ``` + */ + export function isValid(value: any, strictMode?: boolean): boolean; + /** Specify that the input value must be integer in Inspector. + Also used to indicates that the elements in array should be type integer. */ + export var Integer: string; + /** Indicates that the elements in array should be type double. */ + export var Float: string; + /** Indicates that the elements in array should be type boolean. */ + export var Boolean: string; + /** Indicates that the elements in array should be type string. */ + export var String: string; + /** + !#en Deserialize json to cc.Asset + !#zh 将 JSON 反序列化为对象实例。 + + 当指定了 target 选项时,如果 target 引用的其它 asset 的 uuid 不变,则不会改变 target 对 asset 的引用, + 也不会将 uuid 保存到 result 对象中。 + @param data the serialized cc.Asset json string or json object. + @param details additional loading result + @param options options + */ + export function deserialize(data: string|any, details?: Details, options?: any): any; + /** + !#en Clones the object `original` and returns the clone, or instantiate a node from the Prefab. + !#zh 克隆指定的任意类型的对象,或者从 Prefab 实例化出新节点。 + + (Instantiate 时,function 和 dom 等非可序列化对象会直接保留原有引用,Asset 会直接进行浅拷贝,可序列化类型会进行深拷贝。) + @param original An existing object that you want to make a copy of. + + @example + ```js + // instantiate node from prefab + var scene = cc.director.getScene(); + var node = cc.instantiate(prefabAsset); + node.parent = scene; + // clone node + var scene = cc.director.getScene(); + var node = cc.instantiate(targetNode); + node.parent = scene; + ``` + */ + export function instantiate(original: Prefab): Node; + export function instantiate(original: T): T; + /** + Finds a node by hierarchy path, the path is case-sensitive. + It will traverse the hierarchy by splitting the path using '/' character. + This function will still returns the node even if it is inactive. + It is recommended to not use this function every frame instead cache the result at startup. + @param path path + @param referenceNode referenceNode + */ + export function find(path: string, referenceNode?: Node): Node; + /** + !#en + The convenience method to create a new {{#crossLink "Color/Color:method"}}cc.Color{{/crossLink}} + Alpha channel is optional. Default value is 255. + + !#zh + 通过该方法来创建一个新的 {{#crossLink "Color/Color:method"}}cc.Color{{/crossLink}} 对象。 + Alpha 通道是可选的。默认值是 255。 + @param r r + @param g g + @param b b + @param a a + + @example + ```js + ----------------------- + // 1. All channels seperately as parameters + var color1 = new cc.Color(255, 255, 255, 255); + // 2. Convert a hex string to a color + var color2 = new cc.Color("#000000"); + // 3. An color object as parameter + var color3 = new cc.Color({r: 255, g: 255, b: 255, a: 255}); + + ``` + */ + export function color(r?: number, g?: number, b?: number, a?: number): Color; + /** + !#en returns true if both ccColor3B are equal. Otherwise it returns false. + !#zh 判断两个颜色对象的 RGB 部分是否相等,不比较透明度。 + @param color1 color1 + @param color2 color2 + + @example + ```js + cc.log(cc.colorEqual(cc.Color.RED, new cc.Color(255, 0, 0))); // true + ``` + */ + export function colorEqual(color1: Color, color2: Color): boolean; + /** + !#en + convert a string of color for style to Color. + e.g. "#ff06ff" to : cc.color(255,6,255)。 + !#zh 16 进制转换为 Color + @param hex hex + + @example + ```js + cc.hexToColor("#FFFF33"); // Color {r: 255, g: 255, b: 51, a: 255}; + ``` + */ + export function hexToColor(hex: string): Color; + /** + !#en + convert Color to a string of color for style. + e.g. cc.color(255,6,255) to : "#ff06ff" + !#zh Color 转换为 16进制。 + @param color color + + @example + ```js + var color = new cc.Color(255, 6, 255) + cc.colorToHex(color); // #ff06ff; + ``` + */ + export function colorToHex(color: Color): string; + /** + !#en Returns opposite of Vec2. + !#zh 返回相反的向量。 + @param point point + + @example + ```js + cc.pNeg(cc.v2(10, 10));// Vec2 {x: -10, y: -10}; + ``` + */ + export function pNeg(point: Vec2): Vec2; + /** + !#en Calculates sum of two points. + !#zh 返回两个向量的和。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.pAdd(cc.v2(1, 1), cc.v2(2, 2));// Vec2 {x: 3, y: 3}; + ``` + */ + export function pAdd(v1: Vec2, v2: Vec2): Vec2; + /** + !#en Calculates difference of two points. + !#zh 返回两个向量的差。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.pSub(cc.v2(20, 20), cc.v2(5, 5)); // Vec2 {x: 15, y: 15}; + ``` + */ + export function pSub(v1: Vec2, v2: Vec2): Vec2; + /** + !#en Returns point multiplied by given factor. + !#zh 向量缩放。 + @param point point + @param floatVar floatVar + + @example + ```js + cc.pMult(cc.v2(5, 5), 4); // Vec2 {x: 20, y: 20}; + ``` + */ + export function pMult(point: Vec2, floatVar: number): Vec2; + /** + !#en Calculates midpoint between two points. + !#zh 两个向量之间的中心点。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.pMidpoint(cc.v2(10, 10), cc.v2(5, 5)); // Vec2 {x: 7.5, y: 7.5}; + ``` + */ + export function pMidpoint(v1: Vec2, v2: Vec2): Vec2; + /** + !#en Calculates dot product of two points. + !#zh 两个向量之间进行点乘。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.pDot(cc.v2(20, 20), cc.v2(5, 5)); // 200; + ``` + */ + export function pDot(v1: Vec2, v2: Vec2): number; + /** + !#en Calculates cross product of two points. + !#zh 两个向量之间进行叉乘。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.pCross(cc.v2(20, 20), cc.v2(5, 5)); // 0; + ``` + */ + export function pCross(v1: Vec2, v2: Vec2): number; + /** + !#en Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) greater than 0. + !#zh 返回逆时针旋转 90 度后的新向量。 + @param point point + + @example + ```js + cc.pPerp(cc.v2(20, 20)); // Vec2 {x: -20, y: 20}; + ``` + */ + export function pPerp(point: Vec2): Vec2; + /** + !#en Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) smaller than 0. + !#zh 将指定向量顺时针旋转 90 度并返回。 + @param point point + + @example + ```js + cc.pRPerp(cc.v2(20, 20)); // Vec2 {x: 20, y: -20}; + ``` + */ + export function pRPerp(point: Vec2): Vec2; + /** + !#en Calculates the projection of v1 over v2. + !#zh 返回 v1 在 v2 上的投影向量。 + @param v1 v1 + @param v2 v2 + + @example + ```js + var v1 = cc.v2(20, 20); + var v2 = cc.v2(5, 5); + cc.pProject(v1, v2); // Vec2 {x: 20, y: 20}; + ``` + */ + export function pProject(v1: Vec2, v2: Vec2): Vec2; + /** + !#en Calculates the square length of a cc.Vec2 (not calling sqrt() ). + !#zh 返回指定向量长度的平方。 + @param v v + + @example + ```js + cc.pLengthSQ(cc.v2(20, 20)); // 800; + ``` + */ + export function pLengthSQ(v: Vec2): number; + /** + !#en Calculates the square distance between two points (not calling sqrt() ). + !#zh 返回两个点之间距离的平方。 + @param point1 point1 + @param point2 point2 + + @example + ```js + var point1 = cc.v2(20, 20); + var point2 = cc.v2(5, 5); + cc.pDistanceSQ(point1, point2); // 450; + ``` + */ + export function pDistanceSQ(point1: Vec2, point2: Vec2): number; + /** + !#en Calculates distance between point an origin. + !#zh 返回指定向量的长度. + @param v v + + @example + ```js + cc.pLength(cc.v2(20, 20)); // 28.284271247461902; + ``` + */ + export function pLength(v: Vec2): number; + /** + !#en Calculates the distance between two points. + !#zh 返回指定 2 个向量之间的距离。 + @param v1 v1 + @param v2 v2 + + @example + ```js + var v1 = cc.v2(20, 20); + var v2 = cc.v2(5, 5); + cc.pDistance(v1, v2); // 21.213203435596427; + ``` + */ + export function pDistance(v1: Vec2, v2: Vec2): number; + /** + !#en Returns this vector with a magnitude of 1. + !#zh 返回一个长度为 1 的标准化过后的向量。 + @param v v + + @example + ```js + cc.pNormalize(cc.v2(20, 20)); // Vec2 {x: 0.7071067811865475, y: 0.7071067811865475}; + ``` + */ + export function pNormalize(v: Vec2): Vec2; + /** + !#en Converts radians to a normalized vector. + !#zh 将弧度转换为一个标准化后的向量,返回坐标 x = cos(a) , y = sin(a)。 + @param a a + + @example + ```js + cc.pForAngle(20); // Vec2 {x: 0.40808206181339196, y: 0.9129452507276277}; + ``` + */ + export function pForAngle(a: number): Vec2; + /** + !#en Converts a vector to radians. + !#zh 返回指定向量的弧度。 + @param v v + + @example + ```js + cc.pToAngle(cc.v2(20, 20)); // 0.7853981633974483; + ``` + */ + export function pToAngle(v: Vec2): number; + /** + !#en Clamp a value between from and to. + !#zh + 限定浮点数的最大最小值。
+ 数值大于 max_inclusive 则返回 max_inclusive。
+ 数值小于 min_inclusive 则返回 min_inclusive。
+ 否则返回自身。 + @param value value + @param min_inclusive min_inclusive + @param max_inclusive max_inclusive + + @example + ```js + var v1 = cc.clampf(20, 0, 20); // 20; + var v2 = cc.clampf(-1, 0, 20); // 0; + var v3 = cc.clampf(10, 0, 20); // 10; + ``` + */ + export function clampf(value: number, min_inclusive: number, max_inclusive: number): number; + /** + !#en Clamp a value between 0 and 1. + !#zh 限定浮点数的取值范围为 0 ~ 1 之间。 + @param value value + + @example + ```js + var v1 = cc.clampf(20); // 1; + var v2 = cc.clampf(-1); // 0; + var v3 = cc.clampf(0.5); // 0.5; + ``` + */ + export function clamp01(value: number): number; + /** + !#en Clamp a point between from and to. + !#zh + 返回指定限制区域后的向量。
+ 向量大于 max_inclusive 则返回 max_inclusive。
+ 向量小于 min_inclusive 则返回 min_inclusive。
+ 否则返回自身。 + @param p p + @param min_inclusive min_inclusive + @param max_inclusive max_inclusive + + @example + ```js + var min_inclusive = cc.v2(0, 0); + var max_inclusive = cc.v2(20, 20); + var v1 = cc.pClamp(cc.v2(20, 20), min_inclusive, max_inclusive); // Vec2 {x: 20, y: 20}; + var v2 = cc.pClamp(cc.v2(0, 0), min_inclusive, max_inclusive); // Vec2 {x: 0, y: 0}; + var v3 = cc.pClamp(cc.v2(10, 10), min_inclusive, max_inclusive); // Vec2 {x: 10, y: 10}; + ``` + */ + export function pClamp(p: Vec2, min_inclusive: Vec2, max_inclusive: Vec2): Vec2; + /** + !#en Quickly convert cc.Size to a cc.Vec2. + !#zh 快速转换 cc.Size 为 cc.Vec2。 + @param s s + + @example + ```js + cc.pFromSize(new cc.size(20, 20)); // Vec2 {x: 20, y: 20}; + ``` + */ + export function pFromSize(s: Size): Vec2; + /** + !#en + Run a math operation function on each point component
+ Math.abs, Math.fllor, Math.ceil, Math.round. + !#zh 通过运行指定的数学运算函数来计算指定的向量。 + @param p p + @param opFunc opFunc + + @example + ```js + cc.pCompOp(cc.p(-10, -10), Math.abs); // Vec2 {x: 10, y: 10}; + ``` + */ + export function pCompOp(p: Vec2, opFunc: Function): Vec2; + /** + !#en + Linear Interpolation between two points a and b.
+ alpha == 0 ? a
+ alpha == 1 ? b
+ otherwise a value between a..b. + !#zh + 两个点 A 和 B 之间的线性插值。
+ alpha == 0 ? a
+ alpha == 1 ? b
+ 否则这个数值在 a ~ b 之间。 + @param a a + @param b b + @param alpha alpha + + @example + ```js + cc.pLerp(cc.v2(20, 20), cc.v2(5, 5), 0.5); // Vec2 {x: 12.5, y: 12.5}; + ``` + */ + export function pLerp(a: Vec2, b: Vec2, alpha: number): Vec2; + /** + !#en TODO + !#zh + 近似判断两个点是否相等。
+ 判断 2 个向量是否在指定数值的范围之内,如果在则返回 true,反之则返回 false。 + @param a a + @param b b + @param variance variance + + @example + ```js + var a = cc.v2(20, 20); + var b = cc.v2(5, 5); + var b1 = cc.pFuzzyEqual(a, b, 10); // false; + var b2 = cc.pFuzzyEqual(a, b, 18); // true; + ``` + */ + export function pFuzzyEqual(a: Vec2, b: Vec2, variance: number): boolean; + /** + !#en Multiplies a nd b components, a.x*b.x, a.y*b.y. + !#zh 计算两个向量的每个分量的乘积, a.x * b.x, a.y * b.y。 + @param a a + @param b b + + @example + ```js + cc.pCompMult(acc.v2(20, 20), cc.v2(5, 5)); // Vec2 {x: 100, y: 100}; + ``` + */ + export function pCompMult(a: Vec2, b: Vec2): Vec2; + /** + !#en TODO + !#zh 返回两个向量之间带正负号的弧度。 + @param a a + @param b b + */ + export function pAngleSigned(a: Vec2, b: Vec2): number; + /** + !#en TODO + !#zh 获取当前向量与指定向量之间的弧度角。 + @param a a + @param b b + */ + export function pAngle(a: Vec2, b: Vec2): number; + /** + !#en Rotates a point counter clockwise by the angle around a pivot. + !#zh 返回给定向量围绕指定轴心顺时针旋转一定弧度后的结果。 + @param v v is the point to rotate + @param pivot pivot is the pivot, naturally + @param angle angle is the angle of rotation cw in radians + */ + export function pRotateByAngle(v: Vec2, pivot: Vec2, angle: number): Vec2; + /** + !#en + A general line-line intersection test + indicating successful intersection of a line
+ note that to truly test intersection for segments we have to make
+ sure that s & t lie within [0..1] and for rays, make sure s & t > 0
+ the hit point is p3 + t * (p4 - p3);
+ the hit point also is p1 + s * (p2 - p1); + !#zh + 返回 A 为起点 B 为终点线段 1 所在直线和 C 为起点 D 为终点线段 2 所在的直线是否相交,
+ 如果相交返回 true,反之则为 false,参数 retP 是返回交点在线段 1、线段 2 上的比例。 + @param A A is the startpoint for the first line P1 = (p1 - p2). + @param B B is the endpoint for the first line P1 = (p1 - p2). + @param C C is the startpoint for the second line P2 = (p3 - p4). + @param D D is the endpoint for the second line P2 = (p3 - p4). + @param retP retP.x is the range for a hitpoint in P1 (pa = p1 + s*(p2 - p1)),
+ retP.y is the range for a hitpoint in P3 (pa = p2 + t*(p4 - p3)). + */ + export function pLineIntersect(A: Vec2, B: Vec2, C: Vec2, D: Vec2, retP: Vec2): boolean; + /** + !#en ccpSegmentIntersect return YES if Segment A-B intersects with segment C-D. + !#zh 返回线段 A - B 和线段 C - D 是否相交。 + @param A A + @param B B + @param C C + @param D D + */ + export function pSegmentIntersect(A: Vec2, B: Vec2, C: Vec2, D: Vec2): boolean; + /** + !#en ccpIntersectPoint return the intersection point of line A-B, C-D. + !#zh 返回线段 A - B 和线段 C - D 的交点。 + @param A A + @param B B + @param C C + @param D D + */ + export function pIntersectPoint(A: Vec2, B: Vec2, C: Vec2, D: Vec2): Vec2; + /** + !#en check to see if both points are equal. + !#zh 检查指定的 2 个向量是否相等。 + @param A A ccp a + @param B B ccp b to be compared + */ + export function pSameAs(A: Vec2, B: Vec2): boolean; + /** + !#en sets the position of the point to 0. + !#zh 设置指定向量归 0。 + @param v v + */ + export function pZeroIn(v: Vec2): void; + /** + !#en copies the position of one point to another. + !#zh 令 v1 向量等同于 v2。 + @param v1 v1 + @param v2 v2 + */ + export function pIn(v1: Vec2, v2: Vec2): void; + /** + !#en multiplies the point with the given factor (inplace). + !#zh 向量缩放,结果保存到第一个向量。 + @param point point + @param floatVar floatVar + */ + export function pMultIn(point: Vec2, floatVar: number): void; + /** + !#en subtracts one point from another (inplace). + !#zh 向量减法,结果保存到第一个向量。 + @param v1 v1 + @param v2 v2 + */ + export function pSubIn(v1: Vec2, v2: Vec2): void; + /** + !#en adds one point to another (inplace). + !#zh 向量加法,结果保存到第一个向量。 + @param v1 v1 + @param v2 v2 + */ + export function pAddIn(v1: Vec2, v2: Vec2): void; + /** + !#en normalizes the point (inplace). + !#zh 规范化 v 向量,设置 v 向量长度为 1。 + @param v v + */ + export function pNormalizeIn(v: Vec2): void; + /** + !#en + The convenience method to create a new Rect. + see {{#crossLink "Rect/Rect:method"}}cc.Rect{{/crossLink}} + !#zh + 该方法用来快速创建一个新的矩形。{{#crossLink "Rect/Rect:method"}}cc.Rect{{/crossLink}} + @param x x + @param y y + @param w w + @param h h + + @example + ```js + var a = new cc.Rect(0 , 0, 10, 0); + ``` + */ + export function rect(x?: number, y?: number, w?: number, h?: number): Rect; + /** + !#en Check whether a rect's value equals to another. + !#zh 判断两个矩形是否相等。 + @param rect1 rect1 + @param rect2 rect2 + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Rect(0, 0, 5, 5); + cc.rectEqualToRect(a, b); // false; + var c = new cc.Rect(0, 0, 5, 5); + cc.rectEqualToRect(b, c); // true; + ``` + */ + export function rectEqualToRect(rect1: Rect, rect2: Rect): boolean; + /** + !#en Check whether the rect1 contains rect2. + !#zh + 检查 rect1 矩形是否包含 rect2 矩形。
+ 注意:如果要允许 rect1 和 rect2 的边界重合,应该用 cc.rectOverlapsRect + @param rect1 rect1 + @param rect2 rect2 + + @example + ```js + var a = new cc.Rect(0, 0, 20, 20); + var b = new cc.Rect(10, 10, 20, 20); + cc.rectContainsRect(a, b); // true; + ``` + */ + export function rectContainsRect(rect1: Rect, rect2: Rect): boolean; + /** + !#en Returns the rightmost x-value of a rect. + !#zh 返回矩形在 x 轴上的最大值 + @param rect rect + + @example + ```js + var a = new cc.Rect(10, 0, 20, 20); + cc.rectGetMaxX(a); // 30; + ``` + */ + export function rectGetMaxX(rect: Rect): number; + /** + !#en Return the midpoint x-value of a rect. + !#zh 返回矩形在 x 轴上的中点。 + @param rect rect + + @example + ```js + var a = new cc.Rect(10, 0, 20, 20); + cc.rectGetMidX(a); // 20; + ``` + */ + export function rectGetMidX(rect: Rect): number; + /** + !#en Returns the leftmost x-value of a rect. + !#zh 返回矩形在 x 轴上的最小值。 + @param rect rect + + @example + ```js + var a = new cc.Rect(10, 0, 20, 20); + cc.rectGetMinX(a); // 10; + ``` + */ + export function rectGetMinX(rect: Rect): number; + /** + !#en Return the topmost y-value of a rect. + !#zh 返回矩形在 y 轴上的最大值。 + @param rect rect + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + cc.rectGetMaxY(a); // 30; + ``` + */ + export function rectGetMaxY(rect: Rect): number; + /** + !#en Return the midpoint y-value of `rect'. + !#zh 返回矩形在 y 轴上的中点。 + @param rect rect + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + cc.rectGetMidY(a); // 20; + ``` + */ + export function rectGetMidY(rect: Rect): number; + /** + !#en Return the bottommost y-value of a rect. + !#zh 返回矩形在 y 轴上的最小值。 + @param rect rect + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + cc.rectGetMinY(a); // 10; + ``` + */ + export function rectGetMinY(rect: Rect): number; + /** + !#en Check whether a rect contains a point. + !#zh 检查一个矩形是否包含某个坐标点。 + @param rect rect + @param point point + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + var b = new cc.Vec2(0, 10, 10, 10); + cc.rectContainsPoint(a, b); // true; + ``` + */ + export function rectContainsPoint(rect: Rect, point: Vec2): boolean; + /** + !#en Check whether a rect intersect with another. + !#zh 检查一个矩形是否与另一个相交。 + @param rectA rectA + @param rectB rectB + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + var b = new cc.Rect(0, 10, 10, 10); + cc.rectIntersectsRect(a, b); // true; + ``` + */ + export function rectIntersectsRect(rectA: Rect, rectB: Rect): boolean; + /** + !#en Check whether a rect overlaps another. + !#zh 检查一个矩形是否重叠另一个。 + @param rectA rectA + @param rectB rectB + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + var b = new cc.Rect(0, 10, 10, 10); + cc.rectOverlapsRect(a, b); // true; + ``` + */ + export function rectOverlapsRect(rectA: Rect, rectB: Rect): boolean; + /** + !#en Returns the smallest rectangle that contains the two source rectangles. + !#zh 返回一个包含两个指定矩形的最小矩形。 + @param rectA rectA + @param rectB rectB + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + var b = new cc.Rect(0, 10, 10, 10); + cc.rectUnion(a, b); // Rect {x: 0, y: 10, width: 20, height: 20}; + ``` + */ + export function rectUnion(rectA: Rect, rectB: Rect): Rect; + /** + !#en Returns the overlapping portion of 2 rectangles. + !#zh 返回 2 个矩形重叠的部分。 + @param rectA rectA + @param rectB rectB + + @example + ```js + var a = new cc.Rect(0, 10, 20, 20); + var b = new cc.Rect(0, 10, 10, 10); + cc.rectIntersection(a, b); // Rect {x: 0, y: 10, width: 10, height: 10}; + ``` + */ + export function rectIntersection(rectA: Rect, rectB: Rect): Rect; + /** + !#en + Helper function that creates a cc.Size.
+ Please use cc.p or cc.v2 instead, it will soon replace cc.Size. + !#zh + 创建一个 cc.Size 对象的帮助函数。
+ 注意:可以使用 cc.p 或者是 cc.v2 代替,它们将很快取代 cc.Size。 + @param w width or a size object + @param h height + + @example + ```js + var size1 = cc.size(); + var size2 = cc.size(100,100); + var size3 = cc.size(size2); + var size4 = cc.size({width: 100, height: 100}); + + ``` + */ + export function size(w: number|Size, h?: number): Size; + /** + !#en Check whether a point's value equals to another. + !#zh 检查 Size 对象是否等于另一个。 + @param size1 size1 + @param size2 size2 + + @example + ```js + var a = new cc.size(10, 10); + var b = new cc.size(10, 10); + cc.sizeEqualToSize(a, b);// return true; + var b = new cc.size(5, 10); + cc.sizeEqualToSize(a, b);// return false; + ``` + */ + export function sizeEqualToSize(size1: Size, size2: Size): boolean; + export function V3F_C4B_T2F_QuadZero(): V3F_C4B_T2F_Quad; + /** + + @param sourceQuad sourceQuad + */ + export function V3F_C4B_T2F_QuadCopy(sourceQuad: V3F_C4B_T2F_Quad): V3F_C4B_T2F_Quad; + /** + + @param sourceQuads sourceQuads + */ + export function V3F_C4B_T2F_QuadsCopy(sourceQuads: any[]): any[]; + /** + !#en The convenience method to create a new {{#crossLink "Vec2"}}cc.Vec2{{/crossLink}}. + !#zh 通过该简便的函数进行创建 {{#crossLink "Vec2"}}cc.Vec2{{/crossLink}} 对象。 + @param x x + @param y y + + @example + ```js + var v1 = cc.v2(); + var v2 = cc.v2(0, 0); + var v3 = cc.v2(v2); + var v4 = cc.v2({x: 100, y: 100}); + ``` + */ + export function v2(x?: number|any, y?: number): Vec2; + /** + !#en The convenience method to creates a new {{#crossLink "Vec2"}}cc.Vec2{{/crossLink}}. + !#zh 通过该简便的函数进行创建 {{#crossLink "Vec2"}}cc.Vec2{{/crossLink}} 对象。 + @param x a Number or a size object + @param y y + + @example + ```js + var point1 = cc.p(); + var point2 = cc.p(100, 100); + var point3 = cc.p(point2); + var point4 = cc.p({x: 100, y: 100}); + ``` + */ + export function p(x?: number|any, y?: number): Vec2; + /** + !#en Check whether a point's value equals to another. + !#zh 判断两个向量是否相等。 + @param point1 point1 + @param point2 point2 + */ + export function pointEqualToPoint(point1: Vec2, point2: Vec2): boolean; + /** !#en Enum for debug modes. + !#zh 调试模式 */ + export enum DebugMode { + NONE = 0, + INFO = 0, + WARN = 0, + ERROR = 0, + INFO_FOR_WEB_PAGE = 0, + WARN_FOR_WEB_PAGE = 0, + ERROR_FOR_WEB_PAGE = 0, + } + /** !#en + cc.NodePool is the cache pool designed for node type.
+ It can helps you to improve your game performance for objects which need frequent release and recreate operations
+ + It's recommended to create cc.NodePool instances by node type, the type corresponds to node type in game design, not the class, + for example, a prefab is a specific node type.
+ When you create a node pool, you can pass a Component which contains `unuse`, `reuse` functions to control the content of node.
+ + Some common use case is :
+ 1. Bullets in game (die very soon, massive creation and recreation, no side effect on other objects)
+ 2. Blocks in candy crash (massive creation and recreation)
+ etc... + !#zh + cc.NodePool 是用于管理节点对象的对象缓存池。
+ 它可以帮助您提高游戏性能,适用于优化对象的反复创建和销毁
+ 以前 cocos2d-x 中的 cc.pool 和新的节点事件注册系统不兼容,因此请使用 cc.NodePool 来代替。 + + 新的 NodePool 需要实例化之后才能使用,每种不同的节点对象池需要一个不同的对象池实例,这里的种类对应于游戏中的节点设计,一个 prefab 相当于一个种类的节点。
+ 在创建缓冲池时,可以传入一个包含 unuse, reuse 函数的组件类型用于节点的回收和复用逻辑。
+ + 一些常见的用例是:
+ 1.在游戏中的子弹(死亡很快,频繁创建,对其他对象无副作用)
+ 2.糖果粉碎传奇中的木块(频繁创建)。 + 等等.... */ + export class NodePool { + /** + !#en + Constructor for creating a pool for a specific node template (usually a prefab). You can pass a component (type or name) argument for handling event for reusing and recycling node. + !#zh + 使用构造函数来创建一个节点专用的对象池,您可以传递一个组件类型或名称,用于处理节点回收和复用时的事件逻辑。 + @param poolHandlerComp !#en The constructor or the class name of the component to control the unuse/reuse logic. !#zh 处理节点回收和复用事件逻辑的组件类型或名称。 + + @example + ```js + properties: { + template: cc.Prefab + }, + onLoad () { + // MyTemplateHandler is a component with 'unuse' and 'reuse' to handle events when node is reused or recycled. + this.myPool = new cc.NodePool('MyTemplateHandler'); + } + ``` + */ + constructor(poolHandlerComp?: {prototype: Component}|string); + /** !#en The pool handler component, it could be the class name or the constructor. + !#zh 缓冲池处理组件,用于节点的回收和复用逻辑,这个属性可以是组件类名或组件的构造函数。 */ + poolHandlerComp: Function|string; + /** + !#en The current available size in the pool + !#zh 获取当前缓冲池的可用对象数量 + */ + size(): number; + /** + !#en Destroy all cached nodes in the pool + !#zh 销毁对象池中缓存的所有节点 + */ + clear(): void; + /** + !#en Put a new Node into the pool. + It will automatically remove the node from its parent without cleanup. + It will also invoke unuse method of the poolHandlerComp if exist. + !#zh 向缓冲池中存入一个不再需要的节点对象。 + 这个函数会自动将目标节点从父节点上移除,但是不会进行 cleanup 操作。 + 这个函数会调用 poolHandlerComp 的 unuse 函数,如果组件和函数都存在的话。 + @param obj obj + + @example + ```js + let myNode = cc.instantiate(this.template); + this.myPool.put(myNode); + ``` + */ + put(obj: Node): void; + /** + !#en Get a obj from pool, if no available object in pool, null will be returned. + This function will invoke the reuse function of poolHandlerComp if exist. + !#zh 获取对象池中的对象,如果对象池没有可用对象,则返回空。 + 这个函数会调用 poolHandlerComp 的 reuse 函数,如果组件和函数都存在的话。 + @param params !#en Params to pass to 'reuse' method in poolHandlerComp !#zh 向 poolHandlerComp 中的 'reuse' 函数传递的参数 + + @example + ```js + let newNode = this.myPool.get(); + ``` + */ + get(...params: any[]): Node; + } + /** !#en + Attention: In creator, it's strongly not recommended to use cc.pool to manager cc.Node. + We provided {{#crossLink "NodePool"}}cc.NodePool{{/crossLink}} instead. + + cc.pool is a singleton object serves as an object cache pool.
+ It can helps you to improve your game performance for objects which need frequent release and recreate operations
+ !#zh + 首先请注意,在 Creator 中我们强烈不建议使用 cc.pool 来管理 cc.Node 节点对象,请使用 {{#crossLink "NodePool"}}cc.NodePool{{/crossLink}} 代替 + 因为 cc.pool 是面向类来设计的,而 cc.Node 中使用 Component 来进行组合,它的类永远都一样,实际却千差万别。 + + cc.pool 是一个单例对象,用作为对象缓存池。
+ 它可以帮助您提高游戏性能,适用于优化对象的反复创建和销毁
*/ + export class pool { + /** + !#en Put the obj in pool. + !#zh 加入对象到对象池中。 + @param obj The need put in pool object. + + @example + ```js + --------------------------------- + var sp = new _ccsg.Sprite("a.png"); + this.addChild(sp); + cc.pool.putInPool(sp); + cc.pool.getFromPool(_ccsg.Sprite, "a.png"); + + ``` + */ + putInPool(obj: any): void; + /** + !#en Check if this kind of obj has already in pool. + !#zh 检查对象池中是否有指定对象的存在。 + @param objClass The check object class. + */ + hasObject(objClass: any): boolean; + /** + !#en Remove the obj if you want to delete it. + !#zh 移除在对象池中指定的对象。 + */ + removeObject(): void; + /** + !#en Get the obj from pool. + !#zh 获取对象池中的指定对象。 + */ + getFromPool(): any; + /** + !#en Remove all objs in pool and reset the pool. + !#zh 移除对象池中的所有对象,并且重置对象池。 + */ + drainAllPools(): void; + } + /** !#en Base class cc.Action for action classes. + !#zh Action 类是所有动作类型的基类。 */ + export class Action { + /** + !#en + to copy object with deep copy. + returns a clone of action. + !#zh 返回一个克隆的动作。 + */ + clone(): Action; + /** + !#en + return true if the action has finished. + !#zh 如果动作已完成就返回 true。 + */ + isDone(): boolean; + /** + !#en get the target. + !#zh 获取当前目标节点。 + */ + getTarget(): Node; + /** + !#en The action will modify the target properties. + !#zh 设置目标节点。 + @param target target + */ + setTarget(target: Node): void; + /** + !#en get the original target. + !#zh 获取原始目标节点。 + */ + getOriginalTarget(): Node; + /** + !#en get tag number. + !#zh 获取用于识别动作的标签。 + */ + getTag(): number; + /** + !#en set tag number. + !#zh 设置标签,用于识别动作。 + @param tag tag + */ + setTag(tag: number): void; + /** !#en Default Action tag. + !#zh 默认动作标签。 */ + static TAG_INVALID: number; + } + /** !#en + Base class actions that do have a finite time duration.
+ Possible actions:
+ - An action with a duration of 0 seconds.
+ - An action with a duration of 35.5 seconds. + + Infinite time actions are valid + !#zh 有限时间动作,这种动作拥有时长 duration 属性。 */ + export class FiniteTimeAction extends Action { + /** + !#en get duration of the action. (seconds). + !#zh 获取动作以秒为单位的持续时间。 + */ + getDuration(): number; + /** + !#en set duration of the action. (seconds). + !#zh 设置动作以秒为单位的持续时间。 + @param duration duration + */ + setDuration(duration: number): void; + /** + !#en + Returns a reversed action.
+ For example:
+ - The action will be x coordinates of 0 move to 100.
+ - The reversed action will be x of 100 move to 0. + - Will be rewritten + !#zh 返回一个新的动作,执行与原动作完全相反的动作。 + */ + reverse(): void; + /** + !#en + to copy object with deep copy. + returns a clone of action. + !#zh 返回一个克隆的动作。 + */ + clone(): FiniteTimeAction; + } + /** !#en Base class for Easing actions. + !#zh 所有缓动动作基类,用于修饰 ActionInterval。 */ + export class ActionEase extends ActionInterval { + } + /** !#en Base class for Easing actions with rate parameters + !#zh 拥有速率属性的缓动动作基类。 */ + export class EaseRateAction extends ActionEase { + } + /** !#en Ease Elastic abstract class. + !#zh 弹性缓动动作基类。 */ + export class EaseElastic extends ActionEase { + } + /** !#en cc.EaseBounce abstract class. + !#zh 反弹缓动动作基类。 */ + export class EaseBounce extends ActionEase { + } + /** !#en Instant actions are immediate actions. They don't have a duration like the ActionInterval actions. + !#zh 即时动作,这种动作立即就会执行,继承自 FiniteTimeAction。 */ + export class ActionInstant extends FiniteTimeAction { + } + /** !#en +

An interval action is an action that takes place within a certain period of time.
+ It has an start time, and a finish time. The finish time is the parameter
+ duration plus the start time.

+ +

These CCActionInterval actions have some interesting properties, like:
+ - They can run normally (default)
+ - They can run reversed with the reverse method
+ - They can run with the time altered with the Accelerate, AccelDeccel and Speed actions.

+ +

For example, you can simulate a Ping Pong effect running the action normally and
+ then running it again in Reverse mode.

+ !#zh 时间间隔动作,这种动作在已定时间内完成,继承 FiniteTimeAction。 */ + export class ActionInterval extends FiniteTimeAction { + /** + !#en Implementation of ease motion. + !#zh 缓动运动。 + @param easeObj easeObj + + @example + ```js + action.easing(cc.easeIn(3.0)); + ``` + */ + easing(easeObj: any): ActionInterval; + /** + !#en + Repeats an action a number of times. + To repeat an action forever use the CCRepeatForever action. + !#zh 重复动作可以按一定次数重复一个动作,使用 RepeatForever 动作来永远重复一个动作。 + @param times times + */ + repeat(times: number): ActionInterval; + /** + !#en + Repeats an action for ever.
+ To repeat the an action for a limited number of times use the Repeat action.
+ !#zh 永远地重复一个动作,有限次数内重复一个动作请使用 Repeat 动作。 + */ + repeatForever(): ActionInterval; + } + /** !#en + cc.ActionManager is a class that can manage actions.
+ Normally you won't need to use this class directly. 99% of the cases you will use the CCNode interface, + which uses this class's singleton object. + But there are some cases where you might need to use this class.
+ Examples:
+ - When you want to run an action where the target is different from a CCNode.
+ - When you want to pause / resume the actions
+ !#zh + cc.ActionManager 是可以管理动作的单例类。
+ 通常你并不需要直接使用这个类,99%的情况您将使用 CCNode 的接口。
+ 但也有一些情况下,您可能需要使用这个类。
+ 例如: + - 当你想要运行一个动作,但目标不是 CCNode 类型时。
+ - 当你想要暂停/恢复动作时。
*/ + export class ActionManager { + /** + !#en + Adds an action with a target.
+ If the target is already present, then the action will be added to the existing target. + 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. + When the target is paused, the queued actions won't be 'ticked'. + !#zh + 增加一个动作,同时还需要提供动作的目标对象,目标对象是否暂停作为参数。
+ 如果目标已存在,动作将会被直接添加到现有的节点中。
+ 如果目标不存在,将为这一目标创建一个新的实例,并将动作添加进去。
+ 当目标状态的 paused 为 true,动作将不会被执行 + @param action action + @param target target + @param paused paused + */ + addAction(action: Action, target: Node, paused: boolean): void; + /** + !#en Removes all actions from all the targets. + !#zh 移除所有对象的所有动作。 + */ + removeAllActions(): void; + /** + !#en + Removes all actions from a certain target.
+ All the actions that belongs to the target will be removed. + !#zh + 移除指定对象上的所有动作。
+ 属于该目标的所有的动作将被删除。 + @param target target + @param forceDelete forceDelete + */ + removeAllActionsFromTarget(target: Node, forceDelete: boolean): void; + /** + !#en Removes an action given an action reference. + !#zh 移除指定的动作。 + @param action action + */ + removeAction(action: Action): void; + /** + !#en Removes an action given its tag and the target. + !#zh 删除指定对象下特定标签的一个动作,将删除首个匹配到的动作。 + @param tag tag + @param target target + */ + removeActionByTag(tag: number, target: Node): void; + /** + !#en Gets an action given its tag an a target. + !#zh 通过目标对象和标签获取一个动作。 + @param tag tag + @param target target + */ + getActionByTag(tag: number, target: Node): Action; + /** + !#en + Returns the numbers of actions that are running in a certain target.
+ Composable actions are counted as 1 action.
+ Example:
+ - If you are running 1 Sequence of 7 actions, it will return 1.
+ - If you are running 7 Sequences of 2 actions, it will return 7. + !#zh + 返回指定对象下所有正在运行的动作数量。
+ 组合动作被算作一个动作。
+ 例如:
+ - 如果您正在运行 7 个动作组成的序列动作(Sequence),这个函数将返回 1。
+ - 如果你正在运行 2 个序列动作(Sequence)和 5 个普通动作,这个函数将返回 7。
+ @param target target + */ + getNumberOfRunningActionsInTarget(target: Node): number; + /** + !#en Pauses the target: all running actions and newly added actions will be paused. + !#zh 暂停指定对象:所有正在运行的动作和新添加的动作都将会暂停。 + @param target target + */ + pauseTarget(target: Node): void; + /** + !#en Resumes the target. All queued actions will be resumed. + !#zh 让指定目标恢复运行。在执行序列中所有被暂停的动作将重新恢复运行。 + @param target target + */ + resumeTarget(target: Node): void; + /** + !#en Pauses all running actions, returning a list of targets whose actions were paused. + !#zh 暂停所有正在运行的动作,返回一个包含了那些动作被暂停了的目标对象的列表。 + */ + pauseAllRunningActions(): any[]; + /** + !#en Resume a set of targets (convenience function to reverse a pauseAllRunningActions or pauseTargets call). + !#zh 让一组指定对象恢复运行(用来逆转 pauseAllRunningActions 效果的便捷函数)。 + @param targetsToResume targetsToResume + */ + resumeTargets(targetsToResume: any[]): void; + /** + !#en Pause a set of targets. + !#zh 暂停一组指定对象。 + @param targetsToPause targetsToPause + */ + pauseTargets(targetsToPause: any[]): void; + /** + !#en + purges the shared action manager. It releases the retained instance.
+ because it uses this, so it can not be static. + !#zh + 清除共用的动作管理器。它释放了持有的实例。
+ 因为它使用 this,因此它不能是静态的。 + */ + purgeSharedManager(): void; + /** + !#en The ActionManager update。 + !#zh ActionManager 主循环。 + @param dt delta time in seconds + */ + update(dt: number): void; + } + /** !#en Class for animation data handling. + !#zh 动画剪辑,用于存储动画数据。 */ + export class AnimationClip extends Asset { + /** !#en Duration of this animation. + !#zh 动画的持续时间。 */ + duration: number; + /** !#en FrameRate of this animation. + !#zh 动画的帧速率。 */ + sample: number; + /** !#en Speed of this animation. + !#zh 动画的播放速度。 */ + speed: number; + /** !#en WrapMode of this animation. + !#zh 动画的循环模式。 */ + wrapMode: WrapMode; + /** !#en Curve data. + !#zh 曲线数据。 */ + curveData: any; + /** !#en Event data. + !#zh 事件数据。 */ + events: {frame: number, func: string, params: string[]}[]; + /** + !#en Crate clip with a set of sprite frames + !#zh 使用一组序列帧图片来创建动画剪辑 + @param spriteFrames spriteFrames + @param sample sample + + @example + ```js + var clip = cc.AnimationClip.createWithSpriteFrames(spriteFrames, 10); + ``` + */ + static createWithSpriteFrames(spriteFrames: [SpriteFrame], sample: number): AnimationClip; + } + /** !#en + The AnimationState gives full control over animation playback process. + In most cases the Animation Component is sufficient and easier to use. Use the AnimationState if you need full control. + !#zh + AnimationState 完全控制动画播放过程。
+ 大多数情况下 动画组件 是足够和易于使用的。如果您需要更多的动画控制接口,请使用 AnimationState。 */ + export class AnimationState extends Playable { + /** + + @param clip clip + @param name name + */ + constructor(clip: AnimationClip, name?: string); + animator: AnimationAnimator; + /** !#en The curves list. + !#zh 曲线列表。 */ + curves: any[]; + /** !#en The start delay which represents the number of seconds from an animation's start time to the start of + the active interval. + !#zh 延迟多少秒播放。 */ + delay: number; + /** !#en The animation's iteration count property. + + A real number greater than or equal to zero (including positive infinity) representing the number of times + to repeat the animation node. + + Values less than zero and NaN values are treated as the value 1.0 for the purpose of timing model + calculations. + + !#zh 迭代次数,指动画播放多少次后结束, normalize time。 如 2.5(2次半) */ + repeatCount: number; + /** !#en The iteration duration of this animation in seconds. (length) + !#zh 单次动画的持续时间,秒。 */ + duration: number; + /** !#en The animation's playback speed. 1 is normal playback speed. + !#zh 播放速率。 */ + speed: number; + /** !#en + Wrapping mode of the playing animation. + Notice : dynamic change wrapMode will reset time and repeatCount property + !#zh + 动画循环方式。 + 需要注意的是,动态修改 wrapMode 时,会重置 time 以及 repeatCount */ + wrapMode: WrapMode; + /** !#en The current time of this animation in seconds. + !#zh 动画当前的时间,秒。 */ + time: number; + /** !#en The clip that is being played by this animation state. + !#zh 此动画状态正在播放的剪辑。 */ + clip: AnimationClip; + /** !#en The name of the playing animation. + !#zh 动画的名字 */ + name: string; + } + /** undefined */ + export class Playable { + /** !#en Is playing or paused in play mode? + !#zh 当前是否正在播放。 */ + isPlaying: boolean; + /** !#en Is currently paused? This can be true even if in edit mode(isPlaying == false). + !#zh 当前是否正在暂停 */ + isPaused: boolean; + /** + !#en Play this animation. + !#zh 播放动画。 + */ + play(): void; + /** + !#en Stop this animation. + !#zh 停止动画播放。 + */ + stop(): void; + /** + !#en Pause this animation. + !#zh 暂停动画。 + */ + pause(): void; + /** + !#en Resume this animation. + !#zh 重新播放动画。 + */ + resume(): void; + /** + !#en Perform a single frame step. + !#zh 执行一帧动画。 + */ + step(): void; + } + /** !#en Specifies how time is treated when it is outside of the keyframe range of an Animation. + !#zh 动画使用的循环模式。 */ + export enum WrapMode { + Default = 0, + Normal = 0, + Reverse = 0, + Loop = 0, + LoopReverse = 0, + PingPong = 0, + PingPongReverse = 0, + } + /** !#en +

+ ATTENTION: USE cc.director INSTEAD OF cc.Director.
+ cc.director is a singleton object which manage your game's logic flow.
+ Since the cc.director is a singleton, you don't need to call any constructor or create functions,
+ the standard way to use it is by calling:
+ - cc.director.methodName();
+ + It creates and handle the main Window and manages how and when to execute the Scenes.
+
+ The cc.director is also responsible for:
+ - initializing the OpenGL context
+ - setting the OpenGL pixel format (default on is RGB565)
+ - setting the OpenGL buffer depth (default on is 0-bit)
+ - setting the color for clear screen (default one is BLACK)
+ - setting the projection (default one is 3D)
+ - setting the orientation (default one is Portrait)
+
+
+ The cc.director also sets the default OpenGL context:
+ - GL_TEXTURE_2D is enabled
+ - GL_VERTEX_ARRAY is enabled
+ - GL_COLOR_ARRAY is enabled
+ - GL_TEXTURE_COORD_ARRAY is enabled
+

+

+ cc.director also synchronizes timers with the refresh rate of the display.
+ Features and Limitations:
+ - Scheduled timers & drawing are synchronizes with the refresh rate of the display
+ - Only supports animation intervals of 1/60 1/30 & 1/15
+

+ + !#zh +

+ 注意:用 cc.director 代替 cc.Director。
+ cc.director 一个管理你的游戏的逻辑流程的单例对象。
+ 由于 cc.director 是一个单例,你不需要调用任何构造函数或创建函数,
+ 使用它的标准方法是通过调用:
+ - cc.director.methodName(); +
+ 它创建和处理主窗口并且管理什么时候执行场景。
+
+ cc.director 还负责:
+ - 初始化 OpenGL 环境。
+ - 设置OpenGL像素格式。(默认是 RGB565)
+ - 设置OpenGL缓冲区深度 (默认是 0-bit)
+ - 设置空白场景的颜色 (默认是 黑色)
+ - 设置投影 (默认是 3D)
+ - 设置方向 (默认是 Portrait)
+
+ cc.director 设置了 OpenGL 默认环境
+ - GL_TEXTURE_2D 启用。
+ - GL_VERTEX_ARRAY 启用。
+ - GL_COLOR_ARRAY 启用。
+ - GL_TEXTURE_COORD_ARRAY 启用。
+

+

+ cc.director 也同步定时器与显示器的刷新速率。 +
+ 特点和局限性:
+ - 将计时器 & 渲染与显示器的刷新频率同步。
+ - 只支持动画的间隔 1/60 1/30 & 1/15。
+

*/ + export class Director extends EventTarget { + /** + !#en + Converts an OpenGL coordinate to a view coordinate
+ Useful to convert node points to window points for calls such as glScissor
+ Implementation can be found in CCDirectorWebGL. + !#zh 将触摸点的 WebGL View 坐标转换为屏幕坐标。 + @param glPoint glPoint + */ + convertToUI(glPoint: Vec2): Vec2; + /** + !#en + Returns the size of the WebGL view in points.
+ It takes into account any possible rotation (device orientation) of the window. + !#zh 获取视图的大小,以点为单位。 + */ + getWinSize(): Size; + /** + !#en + Returns the size of the OpenGL view in pixels.
+ It takes into account any possible rotation (device orientation) of the window.
+ On Mac winSize and winSizeInPixels return the same value. + (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()) + !#zh + 获取视图大小,以像素为单位(这里的像素指的是资源分辨率。 + 如果要获取屏幕物理分辨率,需要用 cc.view.getFrameSize()) + */ + getWinSizeInPixels(): Size; + /** + !#en Returns the visible size of the running scene. + !#zh 获取运行场景的可见大小。 + */ + getVisibleSize(): Size; + /** + !#en Returns the visible origin of the running scene. + !#zh 获取视图在游戏内容中的坐标原点。 + */ + getVisibleOrigin(): Vec2; + /** + !#en Pause the director's ticker, only involve the game logic execution. + It won't pause the rendering process nor the event manager. + If you want to pause the entier game including rendering, audio and event, + please use {{#crossLink "Game.pause"}}cc.game.pause{{/crossLink}} + !#zh 暂停正在运行的场景,该暂停只会停止游戏逻辑执行,但是不会停止渲染和 UI 响应。 + 如果想要更彻底得暂停游戏,包含渲染,音频和事件,请使用 {{#crossLink "Game.pause"}}cc.game.pause{{/crossLink}}。 + */ + pause(): void; + /** + !#en + Run a scene. Replaces the running scene with a new one or enter the first scene.
+ The new scene will be launched immediately. + !#zh 立刻切换指定场景。 + @param scene The need run scene. + @param onBeforeLoadScene The function invoked at the scene before loading. + @param onLaunched The function invoked at the scene after launch. + */ + runSceneImmediate(scene: Scene, onBeforeLoadScene?: Function, onLaunched?: Function): void; + /** + !#en Loads the scene by its name. + !#zh 通过场景名称进行加载场景。 + @param sceneName The name of the scene to load. + @param onLaunched callback, will be called after scene launched. + */ + loadScene(sceneName: string, onLaunched?: Function): boolean; + /** + !#en + Preloads the scene to reduces loading time. You can call this method at any time you want. + After calling this method, you still need to launch the scene by `cc.director.loadScene`. + It will be totally fine to call `cc.director.loadScene` at any time even if the preloading is not + yet finished, the scene will be launched after loaded automatically. + !#zh 预加载场景,你可以在任何时候调用这个方法。 + 调用完后,你仍然需要通过 `cc.director.loadScene` 来启动场景,因为这个方法不会执行场景加载操作。 + 就算预加载还没完成,你也可以直接调用 `cc.director.loadScene`,加载完成后场景就会启动。 + @param sceneName The name of the scene to preload. + @param onLoaded callback, will be called after scene loaded. + */ + preloadScene(sceneName: string, onLoaded?: (error: Error) => void): void; + /** + !#en Resume game logic execution after pause, if the current scene is not paused, nothing will happen. + !#zh 恢复暂停场景的游戏逻辑,如果当前场景没有暂停将没任何事情发生。 + */ + resume(): void; + /** + !#en + Enables or disables WebGL depth test.
+ Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js + !#zh 启用/禁用深度测试(在 Canvas 渲染模式下不会生效)。 + @param on on + */ + setDepthTest(on: boolean): void; + /** + !#en + Set color for clear screen.
+ (Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js) + !#zh + 设置场景的默认擦除颜色。
+ 支持全透明,但不支持透明度为中间值。要支持全透明需手工开启 cc.macro.ENABLE_TRANSPARENT_CANVAS。 + @param clearColor clearColor + */ + setClearColor(clearColor: Color): void; + /** + !#en + Sets an OpenGL projection.
+ Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js. + !#zh 设置 OpenGL 投影。 + @param projection projection + */ + setProjection(projection: number): void; + /** + !#en + Update the view port.
+ Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js. + !#zh 设置视窗(请不要主动调用这个接口,除非你知道你在做什么)。 + */ + setViewport(): void; + /** + !#en + Sets an OpenGL projection.
+ Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js. + !#zh 获取 OpenGL 投影。 + */ + getProjection(): number; + /** + !#en + Enables/disables OpenGL alpha blending.
+ Implementation can be found in CCDirectorCanvas.js/CCDirectorWebGL.js. + !#zh 启用/禁用 透明度融合。 + @param on on + */ + setAlphaBlending(on: boolean): void; + /** + !#en + Returns whether or not the replaced scene will receive the cleanup message.
+ If the new scene is pushed, then the old scene won't receive the "cleanup" message.
+ If the new scene replaces the old one, the it will receive the "cleanup" message. + !#zh + 更换场景时是否接收清理消息。
+ 如果新场景是采用 push 方式进入的,那么旧的场景将不会接收到 “cleanup” 消息。
+ 如果新场景取代旧的场景,它将会接收到 “cleanup” 消息。
+ */ + isSendCleanupToScene(): boolean; + /** + !#en Returns current logic Scene. + !#zh 获取当前逻辑场景。 + + @example + ```js + // This will help you to get the Canvas node in scene + cc.director.getScene().getChildByName('Canvas'); + ``` + */ + getScene(): Scene; + /** + !#en Returns the FPS value. + !#zh 获取单位帧执行时间。 + */ + getAnimationInterval(): number; + /** + !#en Returns whether or not to display the FPS informations. + !#zh 获取是否显示 FPS 信息。 + */ + isDisplayStats(): boolean; + /** + !#en Sets whether display the FPS on the bottom-left corner. + !#zh 设置是否在左下角显示 FPS。 + @param displayStats displayStats + */ + setDisplayStats(displayStats: boolean): void; + /** + !#en Returns whether next delta time equals to zero. + !#zh 返回下一个 “delta time” 是否等于零。 + */ + isNextDeltaTimeZero(): boolean; + /** + !#en Returns whether or not the Director is paused. + !#zh 是否处于暂停状态。 + */ + isPaused(): boolean; + /** + !#en Returns how many frames were called since the director started. + !#zh 获取 director 启动以来游戏运行的总帧数。 + */ + getTotalFrames(): number; + /** + !#en Returns the cc.Scheduler associated with this director. + !#zh 获取和 director 相关联的 cc.Scheduler。 + */ + getScheduler(): Scheduler; + /** + !#en Sets the cc.Scheduler associated with this director. + !#zh 设置和 director 相关联的 cc.Scheduler。 + @param scheduler scheduler + */ + setScheduler(scheduler: Scheduler): void; + /** + !#en Returns the cc.ActionManager associated with this director. + !#zh 获取和 director 相关联的 cc.ActionManager(动作管理器)。 + */ + getActionManager(): ActionManager; + /** + !#en Sets the cc.ActionManager associated with this director. + !#zh 设置和 director 相关联的 cc.ActionManager(动作管理器)。 + @param actionManager actionManager + */ + setActionManager(actionManager: ActionManager): void; + /** + Returns the cc.CollisionManager associated with this director. + */ + getCollisionManager(): CollisionManager; + /** + Returns the cc.PhysicsManager associated with this director. + */ + getPhysicsManager(): PhysicsManager; + /** + !#en Returns the delta time since last frame. + !#zh 获取上一帧的 “delta time”。 + */ + getDeltaTime(): number; + /** !#en The event projection changed of cc.Director. + !#zh cc.Director 投影变化的事件。 */ + static EVENT_PROJECTION_CHANGED: string; + /** !#en The event which will be triggered before loading a new scene. + !#zh 加载新场景之前所触发的事件。 */ + static EVENT_BEFORE_SCENE_LOADING: string; + /** !#en The event which will be triggered before launching a new scene. + !#zh 运行新场景之前所触发的事件。 */ + static EVENT_BEFORE_SCENE_LAUNCH: string; + /** !#en The event which will be triggered after launching a new scene. + !#zh 运行新场景之后所触发的事件。 */ + static EVENT_AFTER_SCENE_LAUNCH: string; + /** !#en The event which will be triggered at the beginning of every frame. + !#zh 每个帧的开始时所触发的事件。 */ + static EVENT_BEFORE_UPDATE: string; + /** !#en The event which will be triggered after engine and components update logic. + !#zh 将在引擎和组件 “update” 逻辑之后所触发的事件。 */ + static EVENT_AFTER_UPDATE: string; + /** !#en The event which will be triggered before visiting the rendering scene graph. + !#zh 访问渲染场景树之前所触发的事件。 */ + static EVENT_BEFORE_VISIT: string; + /** !#en + The event which will be triggered after visiting the rendering scene graph, + the render queue is ready but not rendered at this point. + !#zh + 访问渲染场景图之后所触发的事件,渲染队列已准备就绪,但在这一时刻还没有呈现在画布上。 */ + static EVENT_AFTER_VISIT: string; + /** !#en The event which will be triggered after the rendering process. + !#zh 渲染过程之后所触发的事件。 */ + static EVENT_AFTER_DRAW: string; + /** Constant for 2D projection (orthogonal projection) */ + static PROJECTION_2D: number; + /** Constant for 3D projection with a fovy=60, znear=0.5f and zfar=1500. */ + static PROJECTION_3D: number; + /** Constant for custom projection, if cc.Director's projection set to it, it calls "updateProjection" on the projection delegate. */ + static PROJECTION_CUSTOM: number; + /** Constant for default projection of cc.Director, default projection is 2D projection */ + static PROJECTION_DEFAULT: number; + } + /** !#en cc.game is the singleton object for game related functions. + !#zh cc.game 是 Game 的实例,用来驱动整个游戏。 */ + export class Game extends EventTarget { + /** !#en Event triggered when game hide to background. + Please note that this event is not 100% guaranteed to be fired on Web platform, + on native platforms, it corresponds to enter background event, os status bar or notification center may not trigger this event. + !#zh 游戏进入后台时触发的事件。 + 请注意,在 WEB 平台,这个事件不一定会 100% 触发,这完全取决于浏览器的回调行为。 + 在原生平台,它对应的是应用被切换到后台事件,下拉菜单和上拉状态栏等不一定会触发这个事件,这取决于系统行为。 */ + EVENT_HIDE: string; + /** Event triggered when game back to foreground + Please note that this event is not 100% guaranteed to be fired on Web platform, + on native platforms, it corresponds to enter foreground event. + !#zh 游戏进入前台运行时触发的事件。 + 请注意,在 WEB 平台,这个事件不一定会 100% 触发,这完全取决于浏览器的回调行为。 + 在原生平台,它对应的是应用被切换到前台事件。 */ + EVENT_SHOW: string; + /** Event triggered after game inited, at this point all engine objects and game scripts are loaded */ + EVENT_GAME_INITED: string; + /** Event triggered after renderer inited, at this point you will be able to use the render context */ + EVENT_RENDERER_INITED: string; + /** Key of config */ + CONFIG_KEY: any; + /** !#en The outer frame of the game canvas, parent of cc.container. + !#zh 游戏画布的外框,cc.container 的父类。 */ + frame: any; + /** !#en The container of game canvas, equals to cc.container. + !#zh 游戏画布的容器。 */ + container: HTMLDivElement; + /** !#en The canvas of the game, equals to cc._canvas. + !#zh 游戏的画布。 */ + canvas: HTMLCanvasElement; + /** !#en + The current game configuration, including:
+ 1. debugMode
+ "debugMode" possible values :
+ 0 - No message will be printed.
+ 1 - cc.error, cc.assert, cc.warn, cc.log will print in console.
+ 2 - cc.error, cc.assert, cc.warn will print in console.
+ 3 - cc.error, cc.assert will print in console.
+ 4 - cc.error, cc.assert, cc.warn, cc.log will print on canvas, available only on web.
+ 5 - cc.error, cc.assert, cc.warn will print on canvas, available only on web.
+ 6 - cc.error, cc.assert will print on canvas, available only on web.
+ 2. showFPS
+ Left bottom corner fps information will show when "showFPS" equals true, otherwise it will be hide.
+ 3. exposeClassName
+ Expose class name to chrome debug tools, the class intantiate performance is a little bit slower when exposed.
+ 4. frameRate
+ "frameRate" set the wanted frame rate for your game, but the real fps depends on your game implementation and the running environment.
+ 5. id
+ "gameCanvas" sets the id of your canvas element on the web page, it's useful only on web.
+ 6. renderMode
+ "renderMode" sets the renderer type, only useful on web :
+ 0 - Automatically chosen by engine
+ 1 - Forced to use canvas renderer
+ 2 - Forced to use WebGL renderer, but this will be ignored on mobile browsers
+ 7. scenes
+ "scenes" include available scenes in the current bundle.
+
+ Please DO NOT modify this object directly, it won't have any effect.
+ !#zh + 当前的游戏配置,包括:
+ 1. debugMode(debug 模式,但是在浏览器中这个选项会被忽略)
+ "debugMode" 各种设置选项的意义。
+ 0 - 没有消息被打印出来。
+ 1 - cc.error,cc.assert,cc.warn,cc.log 将打印在 console 中。
+ 2 - cc.error,cc.assert,cc.warn 将打印在 console 中。
+ 3 - cc.error,cc.assert 将打印在 console 中。
+ 4 - cc.error,cc.assert,cc.warn,cc.log 将打印在 canvas 中(仅适用于 web 端)。
+ 5 - cc.error,cc.assert,cc.warn 将打印在 canvas 中(仅适用于 web 端)。
+ 6 - cc.error,cc.assert 将打印在 canvas 中(仅适用于 web 端)。
+ 2. showFPS(显示 FPS)
+ 当 showFPS 为 true 的时候界面的左下角将显示 fps 的信息,否则被隐藏。
+ 3. exposeClassName
+ 暴露类名让 Chrome DevTools 可以识别,如果开启会稍稍降低类的创建过程的性能,但对对象构造没有影响。
+ 4. frameRate (帧率)
+ “frameRate” 设置想要的帧率你的游戏,但真正的FPS取决于你的游戏实现和运行环境。
+ 5. id
+ "gameCanvas" Web 页面上的 Canvas Element ID,仅适用于 web 端。
+ 6. renderMode(渲染模式)
+ “renderMode” 设置渲染器类型,仅适用于 web 端:
+ 0 - 通过引擎自动选择。
+ 1 - 强制使用 canvas 渲染。 + 2 - 强制使用 WebGL 渲染,但是在部分 Android 浏览器中这个选项会被忽略。
+ 7. scenes
+ “scenes” 当前包中可用场景。
+
+ 注意:请不要直接修改这个对象,它不会有任何效果。 */ + config: any; + /** + !#en Callback when the scripts of engine have been load. + !#zh 当引擎完成启动后的回调函数。 + */ + onStart(): void; + /** + !#en Set frameRate of game. + !#zh 设置游戏帧率。 + @param frameRate frameRate + */ + setFrameRate(frameRate: number): void; + /** + !#en Run the game frame by frame. + !#zh 执行一帧游戏循环。 + */ + step(): void; + /** + !#en Pause the game main loop. This will pause: + game logic execution, rendering process, event manager, background music and all audio effects. + This is different with cc.director.pause which only pause the game logic execution. + !#zh 暂停游戏主循环。包含:游戏逻辑,渲染,事件处理,背景音乐和所有音效。这点和只暂停游戏逻辑的 cc.director.pause 不同。 + */ + pause(): void; + /** + !#en Resume the game from pause. This will resume: + game logic execution, rendering process, event manager, background music and all audio effects. + !#zh 恢复游戏主循环。包含:游戏逻辑,渲染,事件处理,背景音乐和所有音效。 + */ + resume(): void; + /** + !#en Check whether the game is paused. + !#zh 判断游戏是否暂停。 + */ + isPaused(): boolean; + /** + !#en Restart game. + !#zh 重新开始游戏 + */ + restart(): void; + /** + !#en End game, it will close the game window + !#zh 退出游戏 + */ + end(): void; + /** + !#en Prepare game. + !#zh 准备引擎,请不要直接调用这个函数。 + @param cb cb + */ + prepare(cb: Function): void; + /** + !#en Run game with configuration object and onStart function. + !#zh 运行游戏,并且指定引擎配置和 onStart 的回调。 + @param config Pass configuration object or onStart function + @param onStart function to be executed after game initialized + */ + run(config?: any|Function, onStart?: Function): void; + /** + !#en + Add a persistent root node to the game, the persistent node won't be destroyed during scene transition.
+ The target node must be placed in the root level of hierarchy, otherwise this API won't have any effect. + !#zh + 声明常驻根节点,该节点不会被在场景切换中被销毁。
+ 目标节点必须位于为层级的根节点,否则无效。 + @param node The node to be made persistent + */ + addPersistRootNode(node: Node): void; + /** + !#en Remove a persistent root node. + !#zh 取消常驻根节点。 + @param node The node to be removed from persistent node list + */ + removePersistRootNode(node: Node): void; + /** + !#en Check whether the node is a persistent root node. + !#zh 检查节点是否是常驻根节点。 + @param node The node to be checked + */ + isPersistRootNode(node: Node): boolean; + } + /** !#en + Class of all entities in Cocos Creator scenes.
+ Node also inherits from {{#crossLink "EventTarget"}}Event Target{{/crossLink}}, it permits Node to dispatch events. + For events supported by Node, please refer to {{#crossLink "Node.EventType"}}{{/crossLink}} + !#zh + Cocos Creator 场景中的所有节点类。节点也继承了 {{#crossLink "EventTarget"}}EventTarget{{/crossLink}},它允许节点发送事件。
+ 支持的节点事件,请参阅 {{#crossLink "Node.EventType"}}{{/crossLink}}。 */ + export class Node extends _BaseNode { + /** !#en + Group index of node.
+ Which Group this node belongs to will resolve that this node's collision components can collide with which other collision componentns.
+ !#zh + 节点的分组索引。
+ 节点的分组将关系到节点的碰撞组件可以与哪些碰撞组件相碰撞。
*/ + groupIndex: number; + /** !#en + Group of node.
+ Which Group this node belongs to will resolve that this node's collision components can collide with which other collision componentns.
+ !#zh + 节点的分组。
+ 节点的分组将关系到节点的碰撞组件可以与哪些碰撞组件相碰撞。
*/ + group: string; + /** !#en The position (x, y) of the node in its parent's coordinates. + !#zh 节点在父节点坐标系中的位置(x, y)。 */ + position: Vec2; + /** !#en x axis position of node. + !#zh 节点 X 轴坐标。 */ + x: number; + /** !#en y axis position of node. + !#zh 节点 Y 轴坐标。 */ + y: number; + /** !#en Rotation of node. + !#zh 该节点旋转角度。 */ + rotation: number; + /** !#en Rotation on x axis. + !#zh 该节点 X 轴旋转角度。 */ + rotationX: number; + /** !#en Rotation on y axis. + !#zh 该节点 Y 轴旋转角度。 */ + rotationY: number; + /** !#en Scale on x axis. + !#zh 节点 X 轴缩放。 */ + scaleX: number; + /** !#en Scale on y axis. + !#zh 节点 Y 轴缩放。 */ + scaleY: number; + /** !#en Skew x + !#zh 该节点 Y 轴倾斜角度。 */ + skewX: number; + /** !#en Skew y + !#zh 该节点 X 轴倾斜角度。 */ + skewY: number; + /** !#en Opacity of node, default value is 255. + !#zh 节点透明度,默认值为 255。 */ + opacity: number; + /** !#en Indicate whether node's opacity value affect its child nodes, default value is true. + !#zh 节点的不透明度值是否影响其子节点,默认值为 true。 */ + cascadeOpacity: boolean; + /** !#en Color of node, default value is white: (255, 255, 255). + !#zh 节点颜色。默认为白色,数值为:(255,255,255)。 */ + color: Color; + /** !#en Anchor point's position on x axis. + !#zh 节点 X 轴锚点位置。 */ + anchorX: number; + /** !#en Anchor point's position on y axis. + !#zh 节点 Y 轴锚点位置。 */ + anchorY: number; + /** !#en Width of node. + !#zh 节点宽度。 */ + width: number; + /** !#en Height of node. + !#zh 节点高度。 */ + height: number; + /** !#en Z order in depth which stands for the drawing order. + !#zh 该节点渲染排序的 Z 轴深度。 */ + zIndex: number; + /** + + @param name name + */ + constructor(name?: string); + /** + !#en + Register a callback of a specific event type on Node.
+ Use this method to register touch or mouse event permit propagation based on scene graph, + you can propagate the event to the parents or swallow it by calling stopPropagation on the event.
+ It's the recommended way to register touch/mouse event for Node, + please do not use cc.eventManager directly for Node. + !#zh + 在节点上注册指定类型的回调函数,也可以设置 target 用于绑定响应函数的 this 对象。
+ 同时您可以将事件派发到父节点或者通过调用 stopPropagation 拦截它。
+ 推荐使用这种方式来监听节点上的触摸或鼠标事件,请不要在节点上直接使用 cc.eventManager。 + @param type A string representing the event type to listen for.
+ See {{#crossLink "Node/position-changed:event"}}Node Events{{/crossLink}} for all builtin events. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + this.node.on(cc.Node.EventType.TOUCH_START, this.memberFunction, this); // if "this" is component and the "memberFunction" declared in CCClass. + node.on(cc.Node.EventType.TOUCH_START, callback, this.node); + node.on(cc.Node.EventType.TOUCH_MOVE, callback, this.node); + node.on(cc.Node.EventType.TOUCH_END, callback, this.node); + node.on(cc.Node.EventType.TOUCH_CANCEL, callback, this.node); + node.on("anchor-changed", callback, this); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the callback previously registered with the same type, callback, target and or useCapture. + This method is merely an alias to removeEventListener. + !#zh 删除之前与同类型,回调,目标或 useCapture 注册的回调。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + this.node.off(cc.Node.EventType.TOUCH_START, this.memberFunction, this); + node.off(cc.Node.EventType.TOUCH_START, callback, this.node); + node.off("anchor-changed", callback, this); + ``` + */ + off(type: string, callback: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target. + !#zh 移除目标上的所有注册事件。 + @param target The target to be searched for all related callbacks + + @example + ```js + node.targetOff(target); + ``` + */ + targetOff(target: any): void; + /** + !#en Pause node related system events registered with the current Node. Node system events includes touch and mouse events. + If recursive is set to true, then this API will pause the node system events for the node and all nodes in its sub node tree. + Reference: http://cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/internal-events/ + !#zh 暂停当前节点上注册的所有节点系统事件,节点系统事件包含触摸和鼠标事件。 + 如果传递 recursive 为 true,那么这个 API 将暂停本节点和它的子树上所有节点的节点系统事件。 + 参考:http://cocos.com/docs/creator/scripting/internal-events.html + @param recursive Whether to pause node system events on the sub node tree. + + @example + ```js + node.pauseSystemEvents(true); + ``` + */ + pauseSystemEvents(recursive: boolean): void; + /** + !#en Resume node related system events registered with the current Node. Node system events includes touch and mouse events. + If recursive is set to true, then this API will resume the node system events for the node and all nodes in its sub node tree. + Reference: http://cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/internal-events/ + !#zh 恢复当前节点上注册的所有节点系统事件,节点系统事件包含触摸和鼠标事件。 + 如果传递 recursive 为 true,那么这个 API 将恢复本节点和它的子树上所有节点的节点系统事件。 + 参考:http://cocos.com/docs/creator/scripting/internal-events.html + @param recursive Whether to resume node system events on the sub node tree. + + @example + ```js + node.resumeSystemEvents(true); + ``` + */ + resumeSystemEvents(recursive: boolean): void; + /** + !#en + Executes an action, and returns the action that is executed.
+ The node becomes the action's target. Refer to cc.Action's getTarget()
+ Calling runAction while the node is not active won't have any effect.
+ Note:You shouldn't modify the action after runAction, that won't take any effect.
+ if you want to modify, when you define action plus. + !#zh + 执行并返回该执行的动作。该节点将会变成动作的目标。
+ 调用 runAction 时,节点自身处于不激活状态将不会有任何效果。
+ 注意:你不应该修改 runAction 后的动作,将无法发挥作用,如果想进行修改,请在定义 action 时加入。 + @param action action + + @example + ```js + var action = cc.scaleTo(0.2, 1, 0.6); + node.runAction(action); + node.runAction(action).repeatForever(); // fail + node.runAction(action.repeatForever()); // right + ``` + */ + runAction(action: Action): Action; + /** + !#en Pause all actions running on the current node. Equals to `cc.director.getActionManager().pauseTarget(node)`. + !#zh 暂停本节点上所有正在运行的动作。和 `cc.director.getActionManager().pauseTarget(node);` 等价。 + + @example + ```js + node.pauseAllActions(); + ``` + */ + pauseAllActions(): void; + /** + !#en Resume all paused actions on the current node. Equals to `cc.director.getActionManager().resumeTarget(node)`. + !#zh 恢复运行本节点上所有暂停的动作。和 `cc.director.getActionManager().resumeTarget(node);` 等价。 + + @example + ```js + node.resumeAllActions(); + ``` + */ + resumeAllActions(): void; + /** + !#en Stops and removes all actions from the running action list . + !#zh 停止并且移除所有正在运行的动作列表。 + + @example + ```js + node.stopAllActions(); + ``` + */ + stopAllActions(): void; + /** + !#en Stops and removes an action from the running action list. + !#zh 停止并移除指定的动作。 + @param action An action object to be removed. + + @example + ```js + var action = cc.scaleTo(0.2, 1, 0.6); + node.stopAction(action); + ``` + */ + stopAction(action: Action): void; + /** + !#en Removes an action from the running action list by its tag. + !#zh 停止并且移除指定标签的动作。 + @param tag A tag that indicates the action to be removed. + + @example + ```js + node.stopAction(1); + ``` + */ + stopActionByTag(tag: number): void; + /** + !#en Returns an action from the running action list by its tag. + !#zh 通过标签获取指定动作。 + @param tag tag + + @example + ```js + var action = node.getActionByTag(1); + ``` + */ + getActionByTag(tag: number): Action; + /** + !#en + Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays).
+ Composable actions are counted as 1 action. Example:
+ If you are running 1 Sequence of 7 actions, it will return 1.
+ If you are running 7 Sequences of 2 actions, it will return 7.

+ !#zh + 获取运行着的动作加上正在调度运行的动作的总数。
+ 例如:
+ - 如果你正在运行 7 个动作中的 1 个 Sequence,它将返回 1。
+ - 如果你正在运行 2 个动作中的 7 个 Sequence,它将返回 7。
+ + @example + ```js + var count = node.getNumberOfRunningActions(); + cc.log("Running Action Count: " + count); + ``` + */ + getNumberOfRunningActions(): number; + /** + !#en Returns a copy of the position (x, y) of the node in its parent's coordinates. + !#zh 获取节点在父节点坐标系中的位置(x, y)。 + + @example + ```js + cc.log("Node Position: " + node.getPosition()); + ``` + */ + getPosition(): Vec2; + /** + !#en + Sets the position (x, y) of the node in its parent's coordinates.
+ Usually we use cc.v2(x, y) to compose cc.Vec2 object.
+ and Passing two numbers (x, y) is more efficient than passing cc.Vec2 object. + !#zh + 设置节点在父节点坐标系中的位置。
+ 可以通过两种方式设置坐标点:
+ 1. 传入 2 个数值 x 和 y。
+ 2. 传入 cc.v2(x, y) 类型为 cc.Vec2 的对象。 + @param newPosOrX X coordinate for position or the position (x, y) of the node in coordinates + @param y Y coordinate for position + + @example + ```js + node.setPosition(cc.v2(0, 0)); + node.setPosition(0, 0); + + ``` + */ + setPosition(newPosOrX: Vec2|number, y?: number): void; + /** + !#en + Returns the scale factor of the node. + Assertion will fail when _scaleX != _scaleY. + !#zh 获取节点的缩放。当 X 轴和 Y 轴有相同的缩放数值时。 + + @example + ```js + cc.log("Node Scale: " + node.getScale()); + ``` + */ + getScale(): number; + /** + !#en Sets the scale factor of the node. 1.0 is the default scale factor. This function can modify the X and Y scale at the same time. + !#zh 设置节点的缩放比例,默认值为 1.0。这个函数可以在同一时间修改 X 和 Y 缩放。 + @param scaleX scaleX or scale + @param scaleY scaleY + + @example + ```js + node.setScale(cc.v2(1, 1)); + node.setScale(1, 1); + ``` + */ + setScale(scaleX: number|Vec2, scaleY?: number): void; + /** + !#en + Returns a copy the untransformed size of the node.
+ The contentSize remains the same no matter the node is scaled or rotated.
+ All nodes has a size. Layer and Scene has the same size of the screen by default.
+ !#zh 获取节点自身大小,不受该节点是否被缩放或者旋转的影响。 + @param ignoreSizeProvider true if you need to get the original size of the node + + @example + ```js + cc.log("Content Size: " + node.getContentSize()); + ``` + */ + getContentSize(ignoreSizeProvider?: boolean): Size; + /** + !#en + Sets the untransformed size of the node.
+ The contentSize remains the same no matter the node is scaled or rotated.
+ All nodes has a size. Layer and Scene has the same size of the screen. + !#zh 设置节点原始大小,不受该节点是否被缩放或者旋转的影响。 + @param size The untransformed size of the node or The untransformed size's width of the node. + @param height The untransformed size's height of the node. + + @example + ```js + node.setContentSize(cc.size(100, 100)); + node.setContentSize(100, 100); + ``` + */ + setContentSize(size: Size|number, height?: number): void; + /** + !#en + Set whether color should be changed with the opacity value, + useless in ccsg.Node, but this function is override in some class to have such behavior. + !#zh 设置更改透明度时是否修改RGB值, + @param opacityValue opacityValue + + @example + ```js + node.setOpacityModifyRGB(true); + ``` + */ + setOpacityModifyRGB(opacityValue: boolean): void; + /** + !#en Get whether color should be changed with the opacity value. + !#zh 更改透明度时是否修改RGB值。 + + @example + ```js + var hasChange = node.isOpacityModifyRGB(); + ``` + */ + isOpacityModifyRGB(): boolean; + /** + !#en + Returns a copy of the anchor point.
+ Anchor point is the point around which all transformations and positioning manipulations take place.
+ It's like a pin in the node where it is "attached" to its parent.
+ The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner.
+ But you can use values higher than (1,1) and lower than (0,0) too.
+ The default anchor point is (0.5,0.5), so it starts at the center of the node. + !#zh + 获取节点锚点,用百分比表示。
+ 锚点应用于所有变换和坐标点的操作,它就像在节点上连接其父节点的大头针。
+ 锚点是标准化的,就像百分比一样。(0,0) 表示左下角,(1,1) 表示右上角。
+ 但是你可以使用比(1,1)更高的值或者比(0,0)更低的值。
+ 默认的锚点是(0.5,0.5),因此它开始于节点的中心位置。
+ 注意:Creator 中的锚点仅用于定位所在的节点,子节点的定位不受影响。 + + @example + ```js + cc.log("Node AnchorPoint: " + node.getAnchorPoint()); + ``` + */ + getAnchorPoint(): Vec2; + /** + !#en + Sets the anchor point in percent.
+ anchor point is the point around which all transformations and positioning manipulations take place.
+ It's like a pin in the node where it is "attached" to its parent.
+ The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner.
+ But you can use values higher than (1,1) and lower than (0,0) too.
+ The default anchor point is (0.5,0.5), so it starts at the center of the node. + !#zh + 设置锚点的百分比。
+ 锚点应用于所有变换和坐标点的操作,它就像在节点上连接其父节点的大头针。
+ 锚点是标准化的,就像百分比一样。(0,0) 表示左下角,(1,1) 表示右上角。
+ 但是你可以使用比(1,1)更高的值或者比(0,0)更低的值。
+ 默认的锚点是(0.5,0.5),因此它开始于节点的中心位置。
+ 注意:Creator 中的锚点仅用于定位所在的节点,子节点的定位不受影响。 + @param point The anchor point of node or The x axis anchor of node. + @param y The y axis anchor of node. + + @example + ```js + node.setAnchorPoint(cc.v2(1, 1)); + node.setAnchorPoint(1, 1); + ``` + */ + setAnchorPoint(point: Vec2|number, y?: number): void; + /** + !#en + Returns a copy of the anchor point in absolute pixels.
+ you can only read it. If you wish to modify it, use setAnchorPoint. + !#zh + 返回锚点的绝对像素位置。
+ 你只能读它。如果您要修改它,使用 setAnchorPoint。 + + @example + ```js + cc.log("AnchorPointInPoints: " + node.getAnchorPointInPoints()); + ``` + */ + getAnchorPointInPoints(): Vec2; + /** + !#en + Returns the displayed opacity of Node, + the difference between displayed opacity and opacity is that displayed opacity is calculated based on opacity and parent node's opacity when cascade opacity enabled. + !#zh + 获取节点显示透明度, + 显示透明度和透明度之间的不同之处在于当启用级连透明度时, + 显示透明度是基于自身透明度和父节点透明度计算的。 + + @example + ```js + var displayOpacity = node.getDisplayedOpacity(); + ``` + */ + getDisplayedOpacity(): number; + /** + !#en + Returns the displayed color of Node, + the difference between displayed color and color is that displayed color is calculated based on color and parent node's color when cascade color enabled. + !#zh + 获取节点的显示颜色, + 显示颜色和颜色之间的不同之处在于当启用级连颜色时, + 显示颜色是基于自身颜色和父节点颜色计算的。 + + @example + ```js + var displayColor = node.getDisplayedColor(); + ``` + */ + getDisplayedColor(): Color; + /** + !#en + Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates.
+ The matrix is in Pixels.
+ This method is AR (Anchor Relative). + !#zh + 返回这个将节点(局部)的空间坐标系转换成父节点的空间坐标系的矩阵。
+ 这个矩阵以像素为单位。
+ 该方法基于节点坐标。 + + @example + ```js + var affineTransform = node.getNodeToParentTransformAR(); + ``` + */ + getNodeToParentTransformAR(): AffineTransform; + /** + !#en + Returns a "local" axis aligned bounding box of the node.
+ The returned box is relative only to its parent. + !#zh 返回父节坐标系下的轴向对齐的包围盒。 + + @example + ```js + var boundingBox = node.getBoundingBox(); + ``` + */ + getBoundingBox(): Rect; + /** + !#en + Returns a "world" axis aligned bounding box of the node.
+ The bounding box contains self and active children's world bounding box. + !#zh + 返回节点在世界坐标系下的对齐轴向的包围盒(AABB)。
+ 该边框包含自身和已激活的子节点的世界边框。 + + @example + ```js + var newRect = node.getBoundingBoxToWorld(); + ``` + */ + getBoundingBoxToWorld(): Rect; + /** + !#en + Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates.
+ The matrix is in Pixels. + !#zh 返回这个将节点(局部)的空间坐标系转换成父节点的空间坐标系的矩阵。这个矩阵以像素为单位。 + + @example + ```js + var affineTransform = node.getNodeToParentTransform(); + ``` + */ + getNodeToParentTransform(): AffineTransform; + /** + !#en Returns the world affine transform matrix. The matrix is in Pixels. + !#zh 返回节点到世界坐标系的仿射变换矩阵。矩阵单位是像素。 + + @example + ```js + var affineTransform = node.getNodeToWorldTransform(); + ``` + */ + getNodeToWorldTransform(): AffineTransform; + /** + !#en + Returns the world affine transform matrix. The matrix is in Pixels.
+ This method is AR (Anchor Relative). + !#zh + 返回节点到世界坐标仿射变换矩阵。矩阵单位是像素。
+ 该方法基于节点坐标。 + + @example + ```js + var mat = node.getNodeToWorldTransformAR(); + ``` + */ + getNodeToWorldTransformAR(): AffineTransform; + /** + !#en + Returns the matrix that transform parent's space coordinates to the node's (local) space coordinates.
+ The matrix is in Pixels. The returned transform is readonly and cannot be changed. + !#zh + 返回将父节点的坐标系转换成节点(局部)的空间坐标系的矩阵。
+ 该矩阵以像素为单位。返回的矩阵是只读的,不能更改。 + + @example + ```js + var affineTransform = node.getParentToNodeTransform(); + ``` + */ + getParentToNodeTransform(): AffineTransform; + /** + !#en Returns the inverse world affine transform matrix. The matrix is in Pixels. + !#en 返回世界坐标系到节点坐标系的逆矩阵。 + + @example + ```js + var affineTransform = node.getWorldToNodeTransform(); + ``` + */ + getWorldToNodeTransform(): AffineTransform; + /** + !#en Converts a Point to node (local) space coordinates. The result is in Vec2. + !#zh 将一个点转换到节点 (局部) 坐标系。结果以 Vec2 为单位。 + @param worldPoint worldPoint + + @example + ```js + var newVec2 = node.convertToNodeSpace(cc.v2(100, 100)); + ``` + */ + convertToNodeSpace(worldPoint: Vec2): Vec2; + /** + !#en Converts a Point to world space coordinates. The result is in Points. + !#zh 将一个点转换到世界空间坐标系。结果以 Vec2 为单位。 + @param nodePoint nodePoint + + @example + ```js + var newVec2 = node.convertToWorldSpace(cc.v2(100, 100)); + ``` + */ + convertToWorldSpace(nodePoint: Vec2): Vec2; + /** + !#en + Converts a Point to node (local) space coordinates. The result is in Points.
+ treating the returned/received node point as anchor relative. + !#zh + 将一个点转换到节点 (局部) 空间坐标系。结果以 Vec2 为单位。
+ 返回值将基于节点坐标。 + @param worldPoint worldPoint + + @example + ```js + var newVec2 = node.convertToNodeSpaceAR(cc.v2(100, 100)); + ``` + */ + convertToNodeSpaceAR(worldPoint: Vec2): Vec2; + /** + !#en + Converts a local Point to world space coordinates.The result is in Points.
+ treating the returned/received node point as anchor relative. + !#zh + 将一个点转换到世界空间坐标系。结果以 Vec2 为单位。
+ 返回值将基于世界坐标。 + @param nodePoint nodePoint + + @example + ```js + var newVec2 = node.convertToWorldSpaceAR(cc.v2(100, 100)); + ``` + */ + convertToWorldSpaceAR(nodePoint: Vec2): Vec2; + /** + !#en convenience methods which take a cc.Touch instead of cc.Vec2. + !#zh 将触摸点转换成本地坐标系中位置。 + @param touch The touch object + + @example + ```js + var newVec2 = node.convertTouchToNodeSpace(touch); + ``` + */ + convertTouchToNodeSpace(touch: Touch): Vec2; + /** + !#en converts a cc.Touch (world coordinates) into a local coordinate. This method is AR (Anchor Relative). + !#zh 转换一个 cc.Touch(世界坐标)到一个局部坐标,该方法基于节点坐标。 + @param touch The touch object + + @example + ```js + var newVec2 = node.convertTouchToNodeSpaceAR(touch); + ``` + */ + convertTouchToNodeSpaceAR(touch: Touch): Vec2; + /** + !#en + Adds a child to the node with z order and tag. + !#zh + 添加子节点,并且可以修改该节点的 局部 Z 顺序和标签。 + @param child A child node + @param localZOrder Z order for drawing priority. Please refer to setZOrder(int) + @param tag An integer or a name to identify the node easily. Please refer to setTag(int) and setName(string) + + @example + ```js + node.addChild(newNode, 1, 1001); + ``` + */ + addChild(child: Node, localZOrder?: number, tag?: number|string): void; + /** + !#en Stops all running actions and schedulers. + !#zh 停止所有正在播放的动作和计时器。 + + @example + ```js + node.cleanup(); + ``` + */ + cleanup(): void; + /** + !#en Sorts the children array depends on children's zIndex and arrivalOrder, + normally you won't need to invoke this function. + !#zh 根据子节点的 zIndex 和 arrivalOrder 进行排序,正常情况下开发者不需要手动调用这个函数。 + */ + sortAllChildren(): void; + /** !#en The local scale relative to the parent. + !#zh 节点相对父节点的缩放。 */ + scale: number; + /** + !#en Returns the x axis position of the node in cocos2d coordinates. + !#zh 获取节点 X 轴坐标。 + + @example + ```js + var posX = node.getPositionX(); + ``` + */ + getPositionX(): number; + /** + !#en Sets the x axis position of the node in cocos2d coordinates. + !#zh 设置节点 X 轴坐标。 + @param x x + + @example + ```js + node.setPositionX(1); + ``` + */ + setPositionX(x: number): void; + /** + !#en Returns the y axis position of the node in cocos2d coordinates. + !#zh 获取节点 Y 轴坐标。 + + @example + ```js + var posY = node.getPositionY(); + ``` + */ + getPositionY(): number; + /** + !#en Sets the y axis position of the node in cocos2d coordinates. + !#zh 设置节点 Y 轴坐标。 + @param y The new position in y axis + + @example + ```js + node.setPositionY(100); + ``` + */ + setPositionY(y: number): void; + /** + !#en Returns the local Z order of this node. + !#zh 获取节点局部 Z 轴顺序。 + + @example + ```js + var localZorder = node.getLocalZOrder(); + ``` + */ + getLocalZOrder(): number; + /** + !#en + LocalZOrder is the 'key' used to sort the node relative to its siblings.
+
+ The Node's parent will sort all its children based ont the LocalZOrder value.
+ If two nodes have the same LocalZOrder, then the node that was added first to the children's array
+ will be in front of the other node in the array.
+ Also, the Scene Graph is traversed using the "In-Order" tree traversal algorithm ( http://en.wikipedia.org/wiki/Tree_traversal#In-order )
+ And Nodes that have LocalZOder values smaller than 0 are the "left" subtree
+ While Nodes with LocalZOder greater than 0 are the "right" subtree. + !#zh + LocalZOrder 是 “key” (关键)来分辨节点和它兄弟节点的相关性。 + 父节点将会通过 LocalZOrder 的值来分辨所有的子节点。 + 如果两个节点有同样的 LocalZOrder,那么先加入子节点数组的节点将会显示在后加入的节点的前面。 + 同样的,场景图使用 “In-Order(按顺序)” 遍历数算法来遍历 + ( http://en.wikipedia.org/wiki/Tree_traversal#In-order ) 并且拥有小于 0 的 LocalZOrder 的值的节点是 “ left ” 子树(左子树) + 所以拥有大于 0 的 LocalZOrder 的值得节点是 “ right ”子树(右子树)。 + @param localZOrder localZOrder + + @example + ```js + node.setLocalZOrder(1); + ``` + */ + setLocalZOrder(localZOrder: number): void; + /** + !#en Returns whether node's opacity value affect its child nodes. + !#zh 返回节点的不透明度值是否影响其子节点。 + + @example + ```js + cc.log(node.isCascadeOpacityEnabled()); + ``` + */ + isCascadeOpacityEnabled(): boolean; + /** + !#en Enable or disable cascade opacity, if cascade enabled, child nodes' opacity will be the multiplication of parent opacity and its own opacity. + !#zh 启用或禁用级连不透明度,如果级连启用,子节点的不透明度将是父不透明度乘上它自己的不透明度。 + @param cascadeOpacityEnabled cascadeOpacityEnabled + + @example + ```js + node.setCascadeOpacityEnabled(true); + ``` + */ + setCascadeOpacityEnabled(cascadeOpacityEnabled: boolean): void; + } + /** !#en + cc.Scene is a subclass of cc.Node that is used only as an abstract concept.
+ cc.Scene and cc.Node are almost identical with the difference that users can not modify cc.Scene manually. + !#zh + cc.Scene 是 cc.Node 的子类,仅作为一个抽象的概念。
+ cc.Scene 和 cc.Node 有点不同,用户不应直接修改 cc.Scene。 */ + export class Scene extends Node { + /** !#en Indicates whether all (directly or indirectly) static referenced assets of this scene are releasable by default after scene unloading. + !#zh 指示该场景中直接或间接静态引用到的所有资源是否默认在场景切换后自动释放。 */ + autoReleaseAssets: boolean; + } + /** !#en + Scheduler is responsible of triggering the scheduled callbacks.
+ You should not use NSTimer. Instead use this class.
+
+ There are 2 different types of callbacks (selectors):
+ - update callback: the 'update' callback will be called every frame. You can customize the priority.
+ - custom callback: A custom callback will be called every frame, or with a custom interval of time
+
+ The 'custom selectors' should be avoided when possible. It is faster, + and consumes less memory to use the 'update callback'. * + !#zh + Scheduler 是负责触发回调函数的类。
+ 通常情况下,建议使用 cc.director.getScheduler() 来获取系统定时器。
+ 有两种不同类型的定时器:
+ - update 定时器:每一帧都会触发。您可以自定义优先级。
+ - 自定义定时器:自定义定时器可以每一帧或者自定义的时间间隔触发。
+ 如果希望每帧都触发,应该使用 update 定时器,使用 update 定时器更快,而且消耗更少的内存。 */ + export class Scheduler { + /** + !#en + Modifies the time of all scheduled callbacks.
+ You can use this property to create a 'slow motion' or 'fast forward' effect.
+ Default is 1.0. To create a 'slow motion' effect, use values below 1.0.
+ To create a 'fast forward' effect, use values higher than 1.0.
+ Note:It will affect EVERY scheduled selector / action. + !#zh + 设置时间间隔的缩放比例。
+ 您可以使用这个方法来创建一个 “slow motion(慢动作)” 或 “fast forward(快进)” 的效果。
+ 默认是 1.0。要创建一个 “slow motion(慢动作)” 效果,使用值低于 1.0。
+ 要使用 “fast forward(快进)” 效果,使用值大于 1.0。
+ 注意:它影响该 Scheduler 下管理的所有定时器。 + @param timeScale timeScale + */ + setTimeScale(timeScale: number): void; + /** + !#en Returns time scale of scheduler. + !#zh 获取时间间隔的缩放比例。 + */ + getTimeScale(): number; + /** + !#en 'update' the scheduler. (You should NEVER call this method, unless you know what you are doing.) + !#zh update 调度函数。(不应该直接调用这个方法,除非完全了解这么做的结果) + @param dt delta time + */ + update(dt: number): void; + /** + !#en +

+ The scheduled method will be called every 'interval' seconds.
+ If paused is YES, then it won't be called until it is resumed.
+ If 'interval' is 0, it will be called every frame, but if so, it recommended to use 'scheduleUpdateForTarget:' instead.
+ If the callback function is already scheduled, then only the interval parameter will be updated without re-scheduling it again.
+ repeat let the action be repeated repeat + 1 times, use cc.macro.REPEAT_FOREVER to let the action run continuously
+ delay is the amount of time the action will wait before it'll start
+

+ !#zh + 指定回调函数,调用对象等信息来添加一个新的定时器。
+ 当时间间隔达到指定值时,设置的回调函数将会被调用。
+ 如果 paused 值为 true,那么直到 resume 被调用才开始计时。
+ 如果 interval 值为 0,那么回调函数每一帧都会被调用,但如果是这样, + 建议使用 scheduleUpdateForTarget 代替。
+ 如果回调函数已经被定时器使用,那么只会更新之前定时器的时间间隔参数,不会设置新的定时器。
+ repeat 值可以让定时器触发 repeat + 1 次,使用 cc.macro.REPEAT_FOREVER + 可以让定时器一直循环触发。
+ delay 值指定延迟时间,定时器会在延迟指定的时间之后开始计时。 + @param target target + @param callback_fn callback_fn + @param interval interval + @param repeat repeat + @param delay delay + @param paused paused + + @example + ```js + //register a schedule to scheduler + var scheduler = cc.director.getScheduler(); + scheduler.scheduleCallbackForTarget(this, function, interval, repeat, delay, !this._isRunning); + + ``` + */ + scheduleCallbackForTarget(target: any, callback: Function, interval: number, repeat: number, delay: number, paused?: boolean): void; + scheduleCallbackForTarget(target: any, callback: Function, interval: number, paused?: boolean): void; + /** + !#en The schedule + !#zh 定时器 + @param callback callback + @param target target + @param interval interval + @param repeat repeat + @param delay delay + @param paused paused + + @example + ```js + //register a schedule to scheduler + cc.director.getScheduler().schedule(callback, this, interval, !this._isRunning); + + ``` + */ + schedule(callback: Function, target: any, interval: number, repeat: number, delay: number, paused?: boolean): void; + schedule(callback: Function, target: any, interval: number, paused?: boolean): void; + /** + !#en + Schedules the update callback for a given target, + the callback will be invoked every frame after schedule started. + !#zh + 使用指定的优先级为指定的对象设置 update 定时器。 + update 定时器每一帧都会被触发。优先级的值越低,定时器被触发的越早。 + @param target target + @param priority priority + @param paused paused + @param updateFunc updateFunc + */ + scheduleUpdate(target: any, priority: number, paused: boolean, updateFunc: Function): void; + /** + !#en + Unschedules a callback for a callback and a given target. + If you want to unschedule the "update", use `unscheduleUpdate()` + !#zh + 根据指定的回调函数和调用对象。 + 如果需要取消 update 定时器,请使用 unscheduleUpdate()。 + @param callback The callback to be unscheduled + @param target The target bound to the callback. + */ + unschedule(callback: Function, target: any): void; + /** + !#en Unschedules the update callback for a given target. + !#zh 取消指定对象的 update 定时器。 + @param target The target to be unscheduled. + */ + unscheduleUpdate(target: any): void; + /** + !#en + Unschedules all scheduled callbacks for a given target. + This also includes the "update" callback. + !#zh 取消指定对象的所有定时器,包括 update 定时器。 + @param target The target to be unscheduled. + */ + unscheduleAllForTarget(target: any): void; + /** + !#en + Unschedules all scheduled callbacks from all targets including the system callbacks.
+ You should NEVER call this method, unless you know what you are doing. + !#zh + 取消所有对象的所有定时器,包括系统定时器。
+ 不用调用此函数,除非你确定你在做什么。 + */ + unscheduleAll(): void; + /** + !#en + Unschedules all callbacks from all targets with a minimum priority.
+ You should only call this with `PRIORITY_NON_SYSTEM_MIN` or higher. + !#zh + 取消所有优先级的值大于指定优先级的定时器。
+ 你应该只取消优先级的值大于 PRIORITY_NON_SYSTEM_MIN 的定时器。 + @param minPriority The minimum priority of selector to be unscheduled. Which means, all selectors which + priority is higher than minPriority will be unscheduled. + */ + unscheduleAllWithMinPriority(minPriority: number): void; + /** + !#en Checks whether a callback for a given target is scheduled. + !#zh 检查指定的回调函数和回调对象组合是否存在定时器。 + @param callback The callback to check. + @param target The target of the callback. + */ + isScheduled(callback: Function, target: any): boolean; + /** + !#en + Pause all selectors from all targets.
+ You should NEVER call this method, unless you know what you are doing. + !#zh + 暂停所有对象的所有定时器。
+ 不要调用这个方法,除非你知道你正在做什么。 + */ + pauseAllTargets(): void; + /** + !#en + Pause all selectors from all targets with a minimum priority.
+ You should only call this with kCCPriorityNonSystemMin or higher. + !#zh + 暂停所有优先级的值大于指定优先级的定时器。
+ 你应该只暂停优先级的值大于 PRIORITY_NON_SYSTEM_MIN 的定时器。 + @param minPriority minPriority + */ + pauseAllTargetsWithMinPriority(minPriority: number): void; + /** + !#en + Resume selectors on a set of targets.
+ This can be useful for undoing a call to pauseAllCallbacks. + !#zh + 恢复指定数组中所有对象的定时器。
+ 这个函数是 pauseAllCallbacks 的逆操作。 + @param targetsToResume targetsToResume + */ + resumeTargets(targetsToResume: any[]): void; + /** + !#en + Pauses the target.
+ All scheduled selectors/update for a given target won't be 'ticked' until the target is resumed.
+ If the target is not present, nothing happens. + !#zh + 暂停指定对象的定时器。
+ 指定对象的所有定时器都会被暂停。
+ 如果指定的对象没有定时器,什么也不会发生。 + @param target target + */ + pauseTarget(target: any): void; + /** + !#en + Resumes the target.
+ The 'target' will be unpaused, so all schedule selectors/update will be 'ticked' again.
+ If the target is not present, nothing happens. + !#zh + 恢复指定对象的所有定时器。
+ 指定对象的所有定时器将继续工作。
+ 如果指定的对象没有定时器,什么也不会发生。 + @param target target + */ + resumeTarget(target: any): void; + /** + !#en Returns whether or not the target is paused. + !#zh 返回指定对象的定时器是否暂停了。 + @param target target + */ + isTargetPaused(target: any): boolean; + /** + !#en + Schedules the 'update' callback_fn for a given target with a given priority.
+ The 'update' callback_fn will be called every frame.
+ The lower the priority, the earlier it is called. + !#zh + 为指定对象设置 update 定时器。
+ update 定时器每一帧都会被调用。
+ 优先级的值越低,越早被调用。 + @param target target + @param priority priority + @param paused paused + + @example + ```js + //register this object to scheduler + var scheduler = cc.director.getScheduler(); + scheduler.scheduleUpdateForTarget(this, priority, !this._isRunning ); + + ``` + */ + scheduleUpdateForTarget(target: any, priority: number, paused: boolean): void; + /** + !#en + Unschedule a callback function for a given target.
+ If you want to unschedule the "update", use unscheduleUpdateForTarget. + !#zh + 根据指定的回调函数和调用对象对象取消相应的定时器。
+ 如果需要取消 update 定时器,请使用 unscheduleUpdateForTarget()。 + @param target target + @param callback callback[Function] or key[String] + + @example + ```js + //unschedule a callback of target + var scheduler = cc.director.getScheduler(); + scheduler.unscheduleCallbackForTarget(this, callback); + + ``` + */ + unscheduleCallbackForTarget(target: any, callback: Function): void; + /** + !#en Unschedules the update callback function for a given target. + !#zh 取消指定对象的所有定时器。 + @param target target + + @example + ```js + //unschedules the "update" method. + var scheduler = cc.director.getScheduler(); + scheduler.unscheduleUpdateForTarget(this); + + ``` + */ + unscheduleUpdateForTarget(target: any): void; + /** + !#en + Unschedules all function callbacks for a given target.
+ This also includes the "update" callback function. + !#zh 取消指定对象的所有定时器,包括 update 定时器。 + @param target target + */ + unscheduleAllCallbacksForTarget(target: any): void; + /** + !#en + Unschedules all function callbacks from all targets.
+ You should NEVER call this method, unless you know what you are doing. + !#zh + 取消所有对象的所有定时器。
+ 不要调用这个方法,除非你知道你正在做什么。 + */ + unscheduleAllCallbacks(): void; + /** + !#en + Unschedules all function callbacks from all targets with a minimum priority.
+ You should only call this with kCCPriorityNonSystemMin or higher. + !#zh + 取消所有优先级的值大于指定优先级的所有对象的所有定时器。
+ 你应该只暂停优先级的值大于 PRIORITY_NON_SYSTEM_MIN 的定时器。 + @param minPriority minPriority + */ + unscheduleAllCallbacksWithMinPriority(minPriority: number): void; + /** !#en Priority level reserved for system services. + !#zh 系统服务的优先级。 */ + static PRIORITY_SYSTEM: number; + /** !#en Minimum priority level for user scheduling. + !#zh 用户调度最低优先级。 */ + static PRIORITY_NON_SYSTEM: number; + } + /** !#en cc.audioEngine is the singleton object, it provide simple audio APIs. + !#zh + cc.audioengine是单例对象。
+ 主要用来播放音频,播放的时候会返回一个 audioID,之后都可以通过这个 audioID 来操作这个音频对象。
+ 不使用的时候,请使用 cc.audioEngine.uncache(filePath); 进行资源释放
+ 注意:
+ 在 Android 系统浏览器上,不同浏览器,不同版本的效果不尽相同。
+ 比如说:大多数浏览器都需要用户物理交互才可以开始播放音效,有一些不支持 WebAudio,
+ 有一些不支持多音轨播放。总之如果对音乐依赖比较强,请做尽可能多的测试。 */ + export class audioEngine { + /** + !#en Play audio. + !#zh 播放音频 + @param filePath The path of the audio file without filename extension. + @param loop Whether the music loop or not. + @param volume Volume size. + + @example + ```js + var audioID = cc.audioEngine.play(path, false, 0.5); + ``` + */ + static play(filePath: string, loop: boolean, volume: number): number; + /** + !#en Set audio loop. + !#zh 设置音频是否循环。 + @param audioID audio id. + @param loop Whether cycle. + + @example + ```js + cc.audioEngine.setLoop(id, true); + ``` + */ + static setLoop(audioID: number, loop: boolean): void; + /** + !#en Get audio cycle state. + !#zh 获取音频的循环状态。 + @param audioID audio id. + + @example + ```js + cc.audioEngine.isLoop(id); + ``` + */ + static isLoop(audioID: number): boolean; + /** + !#en Set the volume of audio. + !#zh 设置音量(0.0 ~ 1.0)。 + @param audioID audio id. + @param volume Volume must be in 0.0~1.0 . + + @example + ```js + cc.audioEngine.setVolume(id, 0.5); + ``` + */ + static setVolume(audioID: number, volume: number): void; + /** + !#en The volume of the music max value is 1.0,the min value is 0.0 . + !#zh 获取音量(0.0 ~ 1.0)。 + @param audioID audio id. + + @example + ```js + var volume = cc.audioEngine.getVolume(id); + ``` + */ + static getVolume(audioID: number): number; + /** + !#en Set current time + !#zh 设置当前的音频时间。 + @param audioID audio id. + @param sec current time. + + @example + ```js + cc.audioEngine.setCurrentTime(id, 2); + ``` + */ + static setCurrentTime(audioID: number, sec: number): boolean; + /** + !#en Get current time + !#zh 获取当前的音频播放时间。 + @param audioID audio id. + + @example + ```js + var time = cc.audioEngine.getCurrentTime(id); + ``` + */ + static getCurrentTime(audioID: number): number; + /** + !#en Get audio duration + !#zh 获取音频总时长。 + @param audioID audio id. + + @example + ```js + var time = cc.audioEngine.getDuration(id); + ``` + */ + static getDuration(audioID: number): number; + /** + !#en Get audio state + !#zh 获取音频状态。 + @param audioID audio id. + + @example + ```js + var state = cc.audioEngine.getState(id); + ``` + */ + static getState(audioID: number): audioEngine.AudioState; + /** + !#en Set Audio finish callback + !#zh 设置一个音频结束后的回调 + @param audioID audio id. + @param callback loaded callback. + + @example + ```js + cc.audioEngine.setFinishCallback(id, function () {}); + ``` + */ + static setFinishCallback(audioID: number, callback: Function): void; + /** + !#en Pause playing audio. + !#zh 暂停正在播放音频。 + @param audioID The return value of function play. + + @example + ```js + cc.audioEngine.pause(audioID); + ``` + */ + static pause(audioID: number): void; + /** + !#en Pause all playing audio + !#zh 暂停现在正在播放的所有音频。 + + @example + ```js + cc.audioEngine.pauseAll(); + ``` + */ + static pauseAll(): void; + /** + !#en Resume playing audio. + !#zh 恢复播放指定的音频。 + @param audioID The return value of function play. + + @example + ```js + cc.audioEngine.resume(audioID); + ``` + */ + static resume(audioID: number): void; + /** + !#en Resume all playing audio. + !#zh 恢复播放所有之前暂停的所有音频。 + + @example + ```js + cc.audioEngine.resumeAll(); + ``` + */ + static resumeAll(): void; + /** + !#en Stop playing audio. + !#zh 停止播放指定音频。 + @param audioID The return value of function play. + + @example + ```js + cc.audioEngine.stop(audioID); + ``` + */ + static stop(audioID: number): void; + /** + !#en Stop all playing audio. + !#zh 停止正在播放的所有音频。 + + @example + ```js + cc.audioEngine.stopAll(); + ``` + */ + static stopAll(): void; + /** + !#en Set up an audio can generate a few examples. + !#zh 设置一个音频可以设置几个实例 + @param num a number of instances to be created from within an audio + + @example + ```js + cc.audioEngine.setMaxAudioInstance(20); + ``` + */ + static setMaxAudioInstance(num: number): void; + /** + !#en Getting audio can produce several examples. + !#zh 获取一个音频可以设置几个实例 + + @example + ```js + cc.audioEngine.getMaxAudioInstance(); + ``` + */ + static getMaxAudioInstance(): number; + /** + !#en Unload the preloaded audio from internal buffer. + !#zh 卸载预加载的音频。 + @param filePath filePath + + @example + ```js + cc.audioEngine.uncache(filePath); + ``` + */ + static uncache(filePath: string): void; + /** + !#en Unload all audio from internal buffer. + !#zh 卸载所有音频。 + + @example + ```js + cc.audioEngine.uncacheAll(); + ``` + */ + static uncacheAll(): void; + /** + !#en Preload audio file. + !#zh 预加载一个音频 + @param filePath The file path of an audio. + @param callback The callback of an audio. + + @example + ```js + cc.audioEngine.preload(path); + ``` + */ + static preload(filePath: string, callback?: Function): void; + /** + !#en Set a size, the unit is KB. Over this size is directly resolved into DOM nodes. + !#zh 设置一个以 KB 为单位的尺寸,大于这个尺寸的音频在加载的时候会强制使用 dom 方式加载 + @param kb The file path of an audio. + + @example + ```js + cc.audioEngine.setMaxWebAudioSize(300); + ``` + */ + static setMaxWebAudioSize(kb: number): void; + } + /** !#en + cc.MotionStreak manages a Ribbon based on it's motion in absolute space.
+ You construct it with a fadeTime, minimum segment size, texture path, texture
+ length and color. The fadeTime controls how long it takes each vertex in
+ the streak to fade out, the minimum segment size it how many pixels the
+ streak will move before adding a new ribbon segment, and the texture
+ length is the how many pixels the texture is stretched across. The texture
+ is vertically aligned along the streak segment. + !#zh 运动轨迹,用于游戏对象的运动轨迹上实现拖尾渐隐效果。 */ + export class MotionStreak extends Component { + /** !#en + !#zh 在编辑器模式下预览拖尾效果。 */ + preview: boolean; + /** !#en The fade time to fade. + !#zh 拖尾的渐隐时间,以秒为单位。 */ + fadeTime: number; + /** !#en The minimum segment size. + !#zh 拖尾之间最小距离。 */ + minSeg: number; + /** !#en The stroke's width. + !#zh 拖尾的宽度。 */ + stroke: number; + /** !#en The texture of the MotionStreak. + !#zh 拖尾的贴图。 */ + texture: Texture2D; + /** !#en The color of the MotionStreak. + !#zh 拖尾的颜色 */ + color: Color; + /** !#en The fast Mode. + !#zh 是否启用了快速模式。当启用快速模式,新的点会被更快地添加,但精度较低。 */ + fastMode: boolean; + /** + !#en Remove all living segments of the ribbon. + !#zh 删除当前所有的拖尾片段。 + + @example + ```js + // Remove all living segments of the ribbon. + myMotionStreak.reset(); + ``` + */ + reset(): void; + } + /** Particle System base class.
+ Attributes of a Particle System:
+ - emmision rate of the particles
+ - Gravity Mode (Mode A):
+ - gravity
+ - direction
+ - speed +- variance
+ - tangential acceleration +- variance
+ - radial acceleration +- variance
+ - Radius Mode (Mode B):
+ - startRadius +- variance
+ - endRadius +- variance
+ - rotate +- variance
+ - Properties common to all modes:
+ - life +- life variance
+ - start spin +- variance
+ - end spin +- variance
+ - start size +- variance
+ - end size +- variance
+ - start color +- variance
+ - end color +- variance
+ - life +- variance
+ - blending function
+ - texture
+
+ cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).
+ 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guarateed in cocos2d,
+ cocos2d uses a another approach, but the results are almost identical.
+ cocos2d supports all the variables used by Particle Designer plus a bit more:
+ - spinning particles (supported when using ParticleSystem)
+ - tangential acceleration (Gravity mode)
+ - radial acceleration (Gravity mode)
+ - radius direction (Radius mode) (Particle Designer supports outwards to inwards direction only)
+ It is possible to customize any of the above mentioned properties in runtime. Example:
*/ + export class ParticleSystem extends _RendererUnderSG { + /** !#en Play particle in edit mode. + !#zh 在编辑器模式下预览粒子,启用后选中粒子时,粒子将自动播放。 */ + preview: boolean; + /** !#en + If set custom to true, then use custom properties insteadof read particle file. + !#zh 是否自定义粒子属性。 */ + custom: boolean; + /** !#en The plist file. + !#zh plist 格式的粒子配置文件。 */ + file: string; + /** . */ + texture: Texture2D; + /** !#en Current quantity of particles that are being simulated. + !#zh 当前播放的粒子数量。 */ + particleCount: number; + /** !#en Specify the source Blend Factor. + !#zh 指定原图混合模式。 */ + srcBlendFactor: BlendFactor; + /** !#en Specify the destination Blend Factor. + !#zh 指定目标的混合模式。 */ + dstBlendFactor: BlendFactor; + /** !#en If set to true, the particle system will automatically start playing on onLoad. + !#zh 如果设置为 true 运行时会自动发射粒子。 */ + playOnLoad: boolean; + /** !#en Indicate whether the owner node will be auto-removed when it has no particles left. + !#zh 粒子播放完毕后自动销毁所在的节点。 */ + autoRemoveOnFinish: boolean; + /** !#en Indicate whether the particle system is activated. + !#zh 是否激活粒子。 */ + active: boolean; + /** !#en Maximum particles of the system. + !#zh 粒子最大数量。 */ + totalParticles: number; + /** !#en How many seconds the emitter wil run. -1 means 'forever'. + !#zh 发射器生存时间,单位秒,-1表示持续发射。 */ + duration: number; + /** !#en Emission rate of the particles. + !#zh 每秒发射的粒子数目。 */ + emissionRate: number; + /** !#en Life of each particle setter. + !#zh 粒子的运行时间。 */ + life: number; + /** !#en Variation of life. + !#zh 粒子的运行时间变化范围。 */ + lifeVar: number; + /** !#en Start color of each particle. + !#zh 粒子初始颜色。 */ + startColor: Color; + /** !#en Variation of the start color. + !#zh 粒子初始颜色变化范围。 */ + startColorVar: Color; + /** !#en Ending color of each particle. + !#zh 粒子结束颜色。 */ + endColor: Color; + /** !#en Variation of the end color. + !#zh 粒子结束颜色变化范围。 */ + endColorVar: Color; + /** !#en Angle of each particle setter. + !#zh 粒子角度。 */ + angle: number; + /** !#en Variation of angle of each particle setter. + !#zh 粒子角度变化范围。 */ + angleVar: number; + /** !#en Start size in pixels of each particle. + !#zh 粒子的初始大小。 */ + startSize: number; + /** !#en Variation of start size in pixels. + !#zh 粒子初始大小的变化范围。 */ + startSizeVar: number; + /** !#en End size in pixels of each particle. + !#zh 粒子结束时的大小。 */ + endSize: number; + /** !#en Variation of end size in pixels. + !#zh 粒子结束大小的变化范围。 */ + endSizeVar: number; + /** !#en Start angle of each particle. + !#zh 粒子开始自旋角度。 */ + startSpin: number; + /** !#en Variation of start angle. + !#zh 粒子开始自旋角度变化范围。 */ + startSpinVar: number; + /** !#en End angle of each particle. + !#zh 粒子结束自旋角度。 */ + endSpin: number; + /** !#en Variation of end angle. + !#zh 粒子结束自旋角度变化范围。 */ + endSpinVar: number; + /** !#en Source position of the emitter. + !#zh 发射器位置。 */ + sourcePos: Vec2; + /** !#en Variation of source position. + !#zh 发射器位置的变化范围。(横向和纵向) */ + posVar: Vec2; + /** !#en Particles movement type. + !#zh 粒子位置类型。 */ + positionType: ParticleSystem.PositionType; + /** !#en Particles emitter modes. + !#zh 发射器类型。 */ + emitterMode: ParticleSystem.EmitterMode; + /** !#en Gravity of the emitter. + !#zh 重力。 */ + gravity: Vec2; + /** !#en Speed of the emitter. + !#zh 速度。 */ + speed: number; + /** !#en Variation of the speed. + !#zh 速度变化范围。 */ + speedVar: number; + /** !#en Tangential acceleration of each particle. Only available in 'Gravity' mode. + !#zh 每个粒子的切向加速度,即垂直于重力方向的加速度,只有在重力模式下可用。 */ + tangentialAccel: number; + /** !#en Variation of the tangential acceleration. + !#zh 每个粒子的切向加速度变化范围。 */ + tangentialAccelVar: number; + /** !#en Acceleration of each particle. Only available in 'Gravity' mode. + !#zh 粒子径向加速度,即平行于重力方向的加速度,只有在重力模式下可用。 */ + radialAccel: number; + /** !#en Variation of the radial acceleration. + !#zh 粒子径向加速度变化范围。 */ + radialAccelVar: number; + /** !#en Indicate whether the rotation of each particle equals to its direction. Only available in 'Gravity' mode. + !#zh 每个粒子的旋转是否等于其方向,只有在重力模式下可用。 */ + rotationIsDir: boolean; + /** !#en Starting radius of the particles. Only available in 'Radius' mode. + !#zh 初始半径,表示粒子出生时相对发射器的距离,只有在半径模式下可用。 */ + startRadius: number; + /** !#en Variation of the starting radius. + !#zh 初始半径变化范围。 */ + startRadiusVar: number; + /** !#en Ending radius of the particles. Only available in 'Radius' mode. + !#zh 结束半径,只有在半径模式下可用。 */ + endRadius: number; + /** !#en Variation of the ending radius. + !#zh 结束半径变化范围。 */ + endRadiusVar: number; + /** !#en Number of degress to rotate a particle around the source pos per second. Only available in 'Radius' mode. + !#zh 粒子每秒围绕起始点的旋转角度,只有在半径模式下可用。 */ + rotatePerS: number; + /** !#en Variation of the degress to rotate a particle around the source pos per second. + !#zh 粒子每秒围绕起始点的旋转角度变化范围。 */ + rotatePerSVar: number; + /** !#en The Particle emitter lives forever. + !#zh 表示发射器永久存在 */ + static DURATION_INFINITY: number; + /** !#en The starting size of the particle is equal to the ending size. + !#zh 表示粒子的起始大小等于结束大小。 */ + static START_SIZE_EQUAL_TO_END_SIZE: number; + /** !#en The starting radius of the particle is equal to the ending radius. + !#zh 表示粒子的起始半径等于结束半径。 */ + static START_RADIUS_EQUAL_TO_END_RADIUS: number; + /** + !#en Add a particle to the emitter. + !#zh 添加一个粒子到发射器中。 + */ + addParticle(): boolean; + /** + !#en Stop emitting particles. Running particles will continue to run until they die. + !#zh 停止发射器发射粒子,发射出去的粒子将继续运行,直至粒子生命结束。 + + @example + ```js + // stop particle system. + myParticleSystem.stopSystem(); + ``` + */ + stopSystem(): void; + /** + !#en Kill all living particles. + !#zh 杀死所有存在的粒子,然后重新启动粒子发射器。 + + @example + ```js + // play particle system. + myParticleSystem.resetSystem(); + ``` + */ + resetSystem(): void; + /** + !#en Whether or not the system is full. + !#zh 发射器中粒子是否大于等于设置的总粒子数量。 + */ + isFull(): boolean; + /** + !#en +

Sets a new CCSpriteFrame as particle.
+ WARNING: this method is experimental. Use setTextureWithRect instead. +

+ !#zh +

设置一个新的精灵帧为粒子。
+ 警告:这个函数只是试验,请使用 setTextureWithRect 实现。 +

+ @param spriteFrame spriteFrame + */ + setDisplayFrame(spriteFrame: SpriteFrame): void; + /** + !#en Sets a new texture with a rect. The rect is in texture position and size. + !#zh 设置一张新贴图和关联的矩形。 + @param texture texture + @param rect rect + */ + setTextureWithRect(texture: Texture2D, rect: Rect): void; + } + /** !#en Renders the TMX object. + !#zh 渲染 tmx object。 */ + export class TMXObject { + /** + !#en Get the name of object + !#zh 获取对象的名称 + */ + getObjectName(): string; + /** + !#en Get the property of object + !#zh 获取对象的属性 + @param propertyName propertyName + */ + getProperty(propertyName: string): any; + /** + !#en Get the properties of object + !#zh 获取对象的属性 + */ + getProperties(): any; + /** + !#en Set the object name + !#zh 设置对象名称 + @param name name + */ + setObjectName(name: string): void; + /** + !#en Set the properties of the object + !#zh 设置对象的属性 + @param props props + */ + setProperties(props: any): void; + } + /** !#en Render the TMX layer. + !#zh 渲染 TMX layer。 */ + export class TiledLayer extends _SGComponent { + /** + !#en Gets the layer name. + !#zh 获取层的名称。 + + @example + ```js + var layerName = tiledLayer.getLayerName(); + cc.log(layerName); + ``` + */ + getLayerName(): string; + /** + !#en Set the layer name. + !#zh 设置层的名称 + @param layerName layerName + + @example + ```js + tiledLayer.setLayerName("New Layer"); + ``` + */ + SetLayerName(layerName: string): void; + /** + !#en Return the value for the specific property name. + !#zh 获取指定属性名的值。 + @param propertyName propertyName + + @example + ```js + var property = tiledLayer.getProperty("info"); + cc.log(property); + ``` + */ + getProperty(propertyName: string): any; + /** + !#en Returns the position in pixels of a given tile coordinate. + !#zh 获取指定 tile 的像素坐标。 + @param pos position or x + @param y y + + @example + ```js + var pos = tiledLayer.getPositionAt(cc.v2(0, 0)); + cc.log("Pos: " + pos); + var pos = tiledLayer.getPositionAt(0, 0); + cc.log("Pos: " + pos); + ``` + */ + getPositionAt(pos: Vec2|number, y?: number): Vec2; + /** + !#en Removes a tile at given tile coordinate. + !#zh 删除指定坐标上的 tile。 + @param pos position or x + @param y y + + @example + ```js + tiledLayer.removeTileAt(cc.v2(0, 0)); + tiledLayer.removeTileAt(0, 0); + ``` + */ + removeTileAt(pos: Vec2|number, y?: number): void; + /** + !#en + Sets the tile gid (gid = tile global id) at a given tile coordinate.
+ The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor . Tileset Mgr +1.
+ If a tile is already placed at that position, then it will be removed. + !#zh + 设置给定坐标的 tile 的 gid (gid = tile 全局 id), + tile 的 GID 可以使用方法 “tileGIDAt” 来获得。
+ 如果一个 tile 已经放在那个位置,那么它将被删除。 + @param gid gid + @param posOrX position or x + @param flagsOrY flags or y + @param flags flags + + @example + ```js + tiledLayer.setTileGID(1001, 10, 10, 1) + ``` + */ + setTileGID(gid: number, posOrX: Vec2|number, flagsOrY: number, flags?: number): void; + /** + !#en + Returns the tile gid at a given tile coordinate.
+ if it returns 0, it means that the tile is empty.
+ This method requires the the tile map has not been previously released (eg. don't call layer.releaseMap())
+ !#zh + 通过给定的 tile 坐标、flags(可选)返回 tile 的 GID.
+ 如果它返回 0,则表示该 tile 为空。
+ 该方法要求 tile 地图之前没有被释放过(如:没有调用过layer.releaseMap()). + @param pos or x + @param y y + + @example + ```js + var tileGid = tiledLayer.getTileGIDAt(0, 0); + ``` + */ + getTileGIDAt(pos: Vec2|number, y?: number): number; + /** + !#en + Returns the tile (_ccsg.Sprite) at a given a tile coordinate.
+ The returned _ccsg.Sprite will be already added to the _ccsg.TMXLayer. Don't add it again.
+ The _ccsg.Sprite can be treated like any other _ccsg.Sprite: rotated, scaled, translated, opacity, color, etc.
+ You can remove either by calling:
+ - layer.removeChild(sprite, cleanup);
+ - or layer.removeTileAt(ccp(x,y)); + !#zh + 通过指定的 tile 坐标获取对应的 tile(Sprite)。 返回的 tile(Sprite) 应是已经添加到 TMXLayer,请不要重复添加。
+ 这个 tile(Sprite) 如同其他的 Sprite 一样,可以旋转、缩放、翻转、透明化、设置颜色等。
+ 你可以通过调用以下方法来对它进行删除:
+ 1. layer.removeChild(sprite, cleanup);
+ 2. 或 layer.removeTileAt(cc.v2(x,y)); + @param pos or x + @param y y + + @example + ```js + var title = tiledLayer.getTileAt(100, 100); + cc.log(title); + ``` + */ + getTileAt(pos: Vec2|number, y?: number): _ccsg.Sprite; + /** + !#en + Dealloc the map that contains the tile position from memory.
+ Unless you want to know at runtime the tiles positions, you can safely call this method.
+ If you are going to call layer.getTileGIDAt() then, don't release the map. + !#zh + 从内存中释放包含 tile 位置信息的地图。
+ 除了在运行时想要知道 tiles 的位置信息外,你都可安全的调用此方法。
+ 如果你之后还要调用 layer.tileGIDAt(), 请不要释放地图. + + @example + ```js + tiledLayer.releaseMap(); + ``` + */ + releaseMap(): void; + /** + !#en Sets the untransformed size of the _ccsg.TMXLayer. + !#zh 设置未转换的 layer 大小。 + @param size The untransformed size of the _ccsg.TMXLayer or The untransformed size's width of the TMXLayer. + @param height The untransformed size's height of the _ccsg.TMXLayer. + + @example + ```js + tiledLayer.setContentSize(100, 100); + ``` + */ + setContentSize(size: Size|number, height?: number): void; + /** + !#en Return texture of cc.SpriteBatchNode. + !#zh 获取纹理。 + + @example + ```js + var texture = tiledLayer.getTexture(); + cc.log("Texture: " + texture); + ``` + */ + getTexture(): Texture2D; + /** + !#en Set the texture of cc.SpriteBatchNode. + !#zh 设置纹理。 + @param texture texture + + @example + ```js + tiledLayer.setTexture(texture); + ``` + */ + setTexture(texture: Texture2D): void; + /** + !#en Set the opacity of all tiles + !#zh 设置所有 Tile 的透明度 + @param opacity opacity + + @example + ```js + tiledLayer.setTileOpacity(128); + ``` + */ + setTileOpacity(opacity: number): void; + /** + !#en Gets layer size. + !#zh 获得层大小。 + + @example + ```js + var size = tiledLayer.getLayerSize(); + cc.log("layer size: " + size); + ``` + */ + getLayerSize(): Size; + /** + !#en Set layer size. + !#zh 设置层大小。 + @param layerSize layerSize + + @example + ```js + tiledLayer.setLayerSize(new cc.size(5, 5)); + ``` + */ + setLayerSize(layerSize: Size): void; + /** + !#en Size of the map's tile (could be different from the tile's size). + !#zh 获取 tile 的大小( tile 的大小可能会有所不同)。 + + @example + ```js + var mapTileSize = tiledLayer.getMapTileSize(); + cc.log("MapTile size: " + mapTileSize); + ``` + */ + getMapTileSize(): Size; + /** + !#en Set the map tile size. + !#zh 设置 tile 的大小。 + @param tileSize tileSize + + @example + ```js + tiledLayer.setMapTileSize(new cc.size(10, 10)); + ``` + */ + setMapTileSize(tileSize: Size): void; + /** + !#en Pointer to the map of tiles. + !#zh 获取地图 tiles。 + + @example + ```js + var tiles = tiledLayer.getTiles(); + ``` + */ + getTiles(): any[]; + /** + !#en Pointer to the map of tiles. + !#zh 设置地图 tiles + @param tiles tiles + + @example + ```js + tiledLayer.setTiles(tiles); + ``` + */ + setTiles(tiles: any[]): void; + /** + !#en Tile set information for the layer. + !#zh 获取 layer 的 Tileset 信息。 + + @example + ```js + var tileset = tiledLayer.getTileSet(); + ``` + */ + getTileSet(): TMXTilesetInfo; + /** + !#en Tile set information for the layer. + !#zh 设置 layer 的 Tileset 信息。 + @param tileset tileset + + @example + ```js + tiledLayer.setTileSet(tileset); + ``` + */ + setTileSet(tileset: TMXTilesetInfo): void; + /** + !#en Layer orientation, which is the same as the map orientation. + !#zh 获取 Layer 方向(同地图方向)。 + + @example + ```js + var orientation = tiledLayer.getLayerOrientation(); + cc.log("Layer Orientation: " + orientation); + ``` + */ + getLayerOrientation(): number; + /** + !#en Layer orientation, which is the same as the map orientation. + !#zh 设置 Layer 方向(同地图方向)。 + @param orientation orientation + + @example + ```js + tiledLayer.setLayerOrientation(TiledMap.Orientation.ORTHO); + ``` + */ + setLayerOrientation(orientation: TiledMap.Orientation): void; + /** + !#en properties from the layer. They can be added using Tiled. + !#zh 获取 layer 的属性,可以使用 Tiled 编辑器添加属性。 + + @example + ```js + var properties = tiledLayer.getProperties(); + cc.log("Properties: " + properties); + ``` + */ + getProperties(): any[]; + /** + !#en properties from the layer. They can be added using Tiled. + !#zh 设置层属性。 + @param properties properties + + @example + ```js + tiledLayer.setLayerOrientation(properties); + ``` + */ + setProperties(properties: any[]): void; + } + /** !#en Renders a TMX Tile Map in the scene. + !#zh 在场景中渲染一个 tmx 格式的 Tile Map。 */ + export class TiledMap extends Component { + /** !#en The TiledMap Asset. + !#zh TiledMap 资源。 */ + tmxAsset: TiledMapAsset; + /** + !#en Gets the map size. + !#zh 获取地图大小。 + + @example + ```js + var mapSize = tiledMap.getMapSize(); + cc.log("Map Size: " + mapSize); + ``` + */ + getMapSize(): Size; + /** + !#en Set the map size. + !#zh 设置地图大小。 + @param mapSize mapSize + + @example + ```js + tiledMap.setMapSize(new cc.size(960, 640)); + ``` + */ + setMapSize(mapSize: Size): void; + /** + !#en Gets the tile size. + !#zh 获取地图背景中 tile 元素的大小。 + + @example + ```js + var tileSize = tiledMap.getTileSize(); + cc.log("Tile Size: " + tileSize); + ``` + */ + getTileSize(): Size; + /** + !#en Set the tile size. + !#zh 设置地图背景中 tile 元素的大小。 + @param tileSize tileSize + + @example + ```js + tiledMap.setTileSize(new cc.size(10, 10)); + ``` + */ + setTileSize(tileSize: Size): void; + /** + !#en map orientation. + !#zh 获取地图方向。 + + @example + ```js + var mapOrientation = tiledMap.getMapOrientation(); + cc.log("Map Orientation: " + mapOrientation); + ``` + */ + getMapOrientation(): number; + /** + !#en map orientation. + !#zh 设置地图方向。 + @param orientation orientation + + @example + ```js + tiledMap.setMapOrientation(TiledMap.Orientation.ORTHO); + ``` + */ + setMapOrientation(orientation: TiledMap.Orientation): void; + /** + !#en object groups. + !#zh 获取所有的对象层。 + + @example + ```js + var objGroups = titledMap.getObjectGroups(); + for (var i = 0; i < objGroups.length; ++i) { + cc.log("obj: " + objGroups[i]); + } + ``` + */ + getObjectGroups(): TiledObjectGroup[]; + /** + !#en Gets the map properties. + !#zh 获取地图的属性。 + + @example + ```js + var properties = titledMap.getProperties(); + for (var i = 0; i < properties.length; ++i) { + cc.log("Properties: " + properties[i]); + } + ``` + */ + getProperties(): any[]; + /** + !#en Set the map properties. + !#zh 设置地图的属性。 + @param properties properties + + @example + ```js + titledMap.setProperties(properties); + ``` + */ + setProperties(properties: any[]): void; + /** + !#en Return All layers array. + !#zh 返回包含所有 layer 的数组。 + + @example + ```js + var layers = titledMap.allLayers(); + for (var i = 0; i < layers.length; ++i) { + cc.log("Layers: " + layers[i]); + } + ``` + */ + allLayers(): TiledLayer[]; + /** + !#en return the cc.TiledLayer for the specific layer. + !#zh 获取指定名称的 layer。 + @param layerName layerName + + @example + ```js + var layer = titledMap.getLayer("Player"); + cc.log(layer); + ``` + */ + getLayer(layerName: string): TiledLayer; + /** + !#en Return the TMXObjectGroup for the specific group. + !#zh 获取指定的 TMXObjectGroup。 + @param groupName groupName + + @example + ```js + var group = titledMap.getObjectGroup("Players"); + cc.log("ObjectGroup: " + group); + ``` + */ + getObjectGroup(groupName: string): TiledObjectGroup; + /** + !#en Return the value for the specific property name. + !#zh 通过属性名称,获取指定的属性。 + @param propertyName propertyName + + @example + ```js + var property = titledMap.getProperty("info"); + cc.log("Property: " + property); + ``` + */ + getProperty(propertyName: string): string; + /** + !#en Return properties dictionary for tile GID. + !#zh 通过 GID ,获取指定的属性。 + @param GID GID + + @example + ```js + var properties = titledMap.getPropertiesForGID(GID); + cc.log("Properties: " + properties); + ``` + */ + getPropertiesForGID(GID: number): any; + } + /** Class for tiled map asset handling. */ + export class TiledMapAsset extends Asset { + } + /** !#en Renders the TMX object group. + !#zh 渲染 tmx object group。 */ + export class TiledObjectGroup extends _SGComponent { + /** + !#en Offset position of child objects. + !#zh 获取子对象的偏移位置。 + + @example + ```js + var offset = tMXObjectGroup.getPositionOffset(); + ``` + */ + getPositionOffset(): Vec2; + /** + !#en Offset position of child objects. + !#zh 设置子对象的偏移位置。 + @param offset offset + + @example + ```js + tMXObjectGroup.setPositionOffset(cc.v2(5, 5)); + ``` + */ + setPositionOffset(offset: Vec2): void; + /** + !#en List of properties stored in a dictionary. + !#zh 以映射的形式获取属性列表。 + + @example + ```js + var offset = tMXObjectGroup.getProperties(); + ``` + */ + getProperties(): any; + /** + !#en Set the properties of the object group. + !#zh 设置属性列表。 + @param Var Var + + @example + ```js + tMXObjectGroup.setProperties(obj); + ``` + */ + setProperties(Var: any): void; + /** + !#en Gets the Group name. + !#zh 获取组名称。 + + @example + ```js + var groupName = tMXObjectGroup.getGroupName; + ``` + */ + getGroupName(): string; + /** + !#en Set the Group name. + !#zh 设置组名称。 + @param groupName groupName + + @example + ```js + tMXObjectGroup.setGroupName("New Group"); + ``` + */ + setGroupName(groupName: string): void; + /** + !#en + Return the object for the specific object name.
+ It will return the 1st object found on the array for the given name. + !#zh 获取指定的对象。 + @param objectName objectName + + @example + ```js + var object = tMXObjectGroup.getObject("Group"); + ``` + */ + getObject(objectName: string): any; + /** + !#en Gets the objects. + !#zh 获取对象数组。 + + @example + ```js + var objects = tMXObjectGroup.getObjects(); + ``` + */ + getObjects(): any[]; + } + /** !#en + Base class for handling assets used in Fireball. This class can be instantiate. + + You may want to override:
+ - createNode
+ - cc.Object._serialize
+ - cc.Object._deserialize
+ !#zh + 资源基类,该类可以被实例化。
+ + 您可能需要重写:
+ - createNode
+ - cc.Object._serialize
+ - cc.Object._deserialize
*/ + export class Asset extends RawAsset { + /** !#en + Returns the url of this asset's first raw file, if none of rawFile exists, + it will returns an empty string. + !#zh 返回该资源的原始文件的 URL,如果不支持 RAW 文件,它将返回一个空字符串。 */ + rawUrl: string; + /** !#en + Returns the url of this asset's raw files, if none of rawFile exists, + it will returns an empty array. + !#zh 返回该资源的原文件的 URL 数组,如果不支持 RAW 文件,它将返回一个空数组。 */ + rawUrls: string[]; + /** !#en Indicates whether its dependent raw assets can support deferred load if the owner scene (or prefab) is marked as `asyncLoadAssets`. + !#zh 当场景或 Prefab 被标记为 `asyncLoadAssets`,禁止延迟加载该资源所依赖的其它 RawAsset。 */ + static preventDeferredLoadDependents: boolean; + /** + !#en + Create a new node using this asset in the scene.
+ If this type of asset dont have its corresponding node type, this method should be null. + !#zh + 使用该资源在场景中创建一个新节点。
+ 如果这类资源没有相应的节点类型,该方法应该是空的。 + @param callback callback + */ + createNode(callback: (error: string, node: any) => void): void; + } + /** !#en Class for audio data handling. + !#zh 音频资源类。 */ + export class AudioClip extends RawAsset { + } + /** !#en Class for BitmapFont handling. + !#zh 位图字体资源类。 */ + export class BitmapFont extends RawAsset { + } + /** !#en Class for Font handling. + !#zh 字体资源类。 */ + export class Font extends RawAsset { + } + /** !#en Class for LabelAtlas handling. + !#zh 艺术数字字体资源类。 */ + export class LabelAtlas extends BitmapFont { + } + /** !#en Class for prefab handling. + !#zh 预制资源类。 */ + export class Prefab extends Asset { + /** the main cc.Node in the prefab */ + data: Node; + /** !#en Indicates the raw assets of this prefab can be load after prefab loaded. + !#zh 指示该 Prefab 依赖的资源可否在 Prefab 加载后再延迟加载。 */ + asyncLoadAssets: boolean; + /** + Dynamically translation prefab data into minimized code.
+ This method will be called automatically before the first time the prefab being instantiated, + but you can re-call to refresh the create function once you modified the original prefab data in script. + */ + compileCreateFunction(): void; + } + /** !#en + The base class for registering asset types. + + You may want to override: + - createNode (static) + !#zh + 注册用的资源基类。
+ 你可能要重写:
+ - createNode (static) */ + export class RawAsset extends Object { + /** + !#en + Create a new node in the scene.
+ If this type of asset dont have its corresponding node type, this method should be null. + !#zh + 在场景中创建一个新节点。
+ 如果这类资源没有相应的节点类型,该方法应该是空的。 + @param Info Info + @param callback callback + */ + static createNodeByInfo(Info: any, callback: (error: string, node: any) => void): void; + } + /** !#en Class for scene handling. + !#zh 场景资源类。 */ + export class SceneAsset extends Asset { + scene: Scene; + /** !#en Indicates the raw assets of this scene can be load after scene launched. + !#zh 指示该场景依赖的资源可否在场景切换后再延迟加载。 */ + asyncLoadAssets: boolean; + } + /** !#en Class for script handling. + !#zh Script 资源类。 */ + export class _Script extends Asset { + } + /** !#en Class for JavaScript handling. + !#zh JavaScript 资源类。 */ + export class _JavaScript extends Asset { + } + /** !#en Class for coffeescript handling. + !#zh CoffeeScript 资源类。 */ + export class CoffeeScript extends Asset { + } + /** !#en Class for TypeScript handling. + !#zh TypeScript 资源类。 */ + export class TypeScript extends Asset { + } + /** !#en Class for sprite atlas handling. + !#zh 精灵图集资源类。 */ + export class SpriteAtlas extends RawAsset { + /** + Returns the texture of the sprite atlas + */ + getTexture(): Texture2D; + /** + Returns the sprite frame correspond to the given key in sprite atlas. + @param key key + */ + getSpriteFrame(key: string): SpriteFrame; + /** + Returns the sprite frames in sprite atlas. + */ + getSpriteFrames(): [SpriteFrame]; + } + /** !#en Class for TTFFont handling. + !#zh TTF 字体资源类。 */ + export class TTFFont extends Asset { + } + /** !#en Class for text file. + !#zh 文本资源类。 */ + export class TextAsset extends Asset { + } + /** !#en + Camera is usefull when making reel game or other games which need scroll screen. + Using camera will be more efficient than moving node to scroll screen. + Camera + !#zh + 摄像机在制作卷轴或是其他需要移动屏幕的游戏时比较有用,使用摄像机将会比移动节点来移动屏幕更加高效。 */ + export class Camera extends _RendererUnderSG { + /** !#en + The camera zoom ratio. + !#zh + 摄像机缩放比率 */ + zoomRatio: number; + /** !#en + Current active camera, the scene should only have one active camera at the same time. + !#zh + 当前激活的摄像机,场景中在同一时间内只能有一个激活的摄像机。 */ + static main: Camera; + /** + !#en + Add the specified target to camera. + !#zh + 将指定的节点添加到摄像机中。 + @param target target + */ + addTarget(target: Node): void; + /** + !#en + Remove the specified target from camera. + !#zh + 将指定的节点从摄像机中移除。 + @param target target + */ + removeTarget(target: Node): void; + /** + !#en + Get all camera targets. + !#zh + 获取所有摄像机目标节点。 + */ + getTargets(): [Node]; + /** + !#en + Returns the matrix that transform the node's (local) space coordinates into the camera's space coordinates. + !#zh + 返回一个将节点坐标系转换到摄像机坐标系下的矩阵 + @param node the node which should transform + */ + getNodeToCameraTransform(node: Node): AffineTransform; + /** + !#en + Conver a camera coordinates point to world coordinates. + !#zh + 将一个摄像机坐标系下的点转换到世界坐标系下。 + @param point the point which should transform + */ + getCameraToWorldPoint(point: Node): Vec2; + /** + !#en + Check whether the node is in the camera. + !#zh + 检测节点是否被此摄像机影响 + @param node the node which need to check + */ + containsNode(node: Node): boolean; + } + /** !#en Box Collider. + !#zh 包围盒碰撞组件 */ + export class BoxCollider extends Collider implements Collider.Box { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Box size + !#zh 包围盒大小 */ + size: Size; + } + /** !#en Circle Collider. + !#zh 圆形碰撞组件 */ + export class CircleCollider extends Collider implements Collider.Circle { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Circle radius + !#zh 圆形半径 */ + radius: number; + } + /** !#en Collider component base class. + !#zh 碰撞组件基类 */ + export class Collider extends Component { + /** !#en Tag. If a node has several collider components, you can judge which type of collider is collided according to the tag. + !#zh 标签。当一个节点上有多个碰撞组件时,在发生碰撞后,可以使用此标签来判断是节点上的哪个碰撞组件被碰撞了。 */ + tag: number; + } + /** !#en + A simple collision manager class. + It will calculate whether the collider collides other colliders, if collides then call the callbacks. + !#zh + 一个简单的碰撞组件管理类,用于处理节点之间的碰撞组件是否产生了碰撞,并调用相应回调函数。 */ + export class CollisionManager implements EventTarget { + /** !#en + !#zh + 是否开启碰撞管理,默认为不开启 */ + enabled: boolean; + /** !#en + !#zh + 是否绘制碰撞组件的包围盒,默认为不绘制 */ + enabledDrawBoundingBox: boolean; + /** !#en + !#zh + 是否绘制碰撞组件的形状,默认为不绘制 */ + enabledDebugDraw: boolean; + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** !#en Intersection helper class + !#zh 辅助类,用于测试形状与形状是否相交 */ + export class Intersection { + /** + !#en Test line and line + !#zh 测试线段与线段是否相交 + @param a1 The start point of the first line + @param a2 The end point of the first line + @param b1 The start point of the second line + @param b2 The end point of the second line + */ + static lineLine(a1: Vec2, a2: Vec2, b1: Vec2, b2: Vec2): boolean; + /** + !#en Test line and rect + !#zh 测试线段与矩形是否相交 + @param a1 The start point of the line + @param a2 The end point of the line + @param b The rect + */ + static lineRect(a1: Vec2, a2: Vec2, b: Rect): boolean; + /** + !#en Test line and polygon + !#zh 测试线段与多边形是否相交 + @param a1 The start point of the line + @param a2 The end point of the line + @param b The polygon, a set of points + */ + static linePolygon(a1: Vec2, a2: Vec2, b: Vec2[]): boolean; + /** + !#en Test rect and rect + !#zh 测试矩形与矩形是否相交 + @param a The first rect + @param b The second rect + */ + static rectRect(a: Rect, b: Rect): boolean; + /** + !#en Test rect and polygon + !#zh 测试矩形与多边形是否相交 + @param a The rect + @param b The polygon, a set of points + */ + static rectPolygon(a: Rect, b: Vec2[]): boolean; + /** + !#en Test polygon and polygon + !#zh 测试多边形与多边形是否相交 + @param a The first polygon, a set of points + @param b The second polygon, a set of points + */ + static polygonPolygon(a: Vec2[], b: Vec2[]): boolean; + /** + !#en Test circle and circle + !#zh 测试圆形与圆形是否相交 + @param a Object contains position and radius + @param b Object contains position and radius + */ + static circleCircle(a: {position: Vec2, radius: number}, b: {position: Vec2, radius: number}): boolean; + /** + !#en Test polygon and circle + !#zh 测试矩形与圆形是否相交 + @param polygon The Polygon, a set of points + @param circle Object contains position and radius + */ + static polygonCircle(polygon: Vec2[], circle: {position: Vec2, radius: number}): boolean; + /** + !#en Test whether the point is in the polygon + !#zh 测试一个点是否在一个多边形中 + @param point The point + @param polygon The polygon, a set of points + */ + static pointInPolygon(point: Vec2, polygon: Vec2[]): boolean; + /** + !#en Calculate the distance of point to line. + !#zh 计算点到直线的距离。如果这是一条线段并且垂足不在线段内,则会计算点到线段端点的距离。 + @param point The point + @param start The start point of line + @param end The end point of line + @param isSegment whether this line is a segment + */ + static pointLineDistance(point: Vec2, start: Vec2, end: Vec2, isSegment: boolean): boolean; + } + /** !#en Polygon Collider. + !#zh 多边形碰撞组件 */ + export class PolygonCollider extends Collider implements Collider.Polygon { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Polygon points + !#zh 多边形顶点数组 */ + points: [Vec2]; + } + /** !#en The animation component is used to play back animations. + + Animation provide several events to register: + - play : Emit when begin playing animation + - stop : Emit when stop playing animation + - pause : Emit when pause animation + - resume : Emit when resume animation + - lastframe : If animation repeat count is larger than 1, emit when animation play to the last frame + - finished : Emit when finish playing animation + + !#zh Animation 组件用于播放动画。 + + Animation 提供了一系列可注册的事件: + - play : 开始播放时 + - stop : 停止播放时 + - pause : 暂停播放时 + - resume : 恢复播放时 + - lastframe : 假如动画循环次数大于 1,当动画播放到最后一帧时 + - finished : 动画播放完成时 */ + export class Animation extends Component implements EventTarget { + /** !#en Animation will play the default clip when start game. + !#zh 在勾选自动播放或调用 play() 时默认播放的动画剪辑。 */ + defaultClip: AnimationClip; + /** !#en Current played clip. + !#zh 当前播放的动画剪辑。 */ + currentClip: AnimationClip; + /** !#en Whether the animation should auto play the default clip when start game. + !#zh 是否在运行游戏后自动播放默认动画剪辑。 */ + playOnLoad: boolean; + /** + !#en Get all the clips used in this animation. + !#zh 获取动画组件上的所有动画剪辑。 + */ + getClips(): AnimationClip[]; + /** + !#en Plays an animation and stop other animations. + !#zh 播放指定的动画,并且停止当前正在播放动画。如果没有指定动画,则播放默认动画。 + @param name The name of animation to play. If no name is supplied then the default animation will be played. + @param startTime play an animation from startTime + + @example + ```js + var animCtrl = this.node.getComponent(cc.Animation); + animCtrl.play("linear"); + ``` + */ + play(name?: string, startTime?: number): AnimationState; + /** + !#en + Plays an additive animation, it will not stop other animations. + If there are other animations playing, then will play several animations at the same time. + !#zh 播放指定的动画(将不会停止当前播放的动画)。如果没有指定动画,则播放默认动画。 + @param name The name of animation to play. If no name is supplied then the default animation will be played. + @param startTime play an animation from startTime + + @example + ```js + // linear_1 and linear_2 at the same time playing. + var animCtrl = this.node.getComponent(cc.Animation); + animCtrl.playAdditive("linear_1"); + animCtrl.playAdditive("linear_2"); + ``` + */ + playAdditive(name?: string, startTime?: number): AnimationState; + /** + !#en Stops an animation named name. If no name is supplied then stops all playing animations that were started with this Animation.
+ Stopping an animation also Rewinds it to the Start. + !#zh 停止指定的动画。如果没有指定名字,则停止当前正在播放的动画。 + @param name The animation to stop, if not supplied then stops all playing animations. + */ + stop(name?: string): void; + /** + !#en Pauses an animation named name. If no name is supplied then pauses all playing animations that were started with this Animation. + !#zh 暂停当前或者指定的动画。如果没有指定名字,则暂停当前正在播放的动画。 + @param name The animation to pauses, if not supplied then pauses all playing animations. + */ + pause(name?: string): void; + /** + !#en Resumes an animation named name. If no name is supplied then resumes all paused animations that were started with this Animation. + !#zh 重新播放指定的动画,如果没有指定名字,则重新播放当前正在播放的动画。 + @param name The animation to resumes, if not supplied then resumes all paused animations. + */ + resume(name?: string): void; + /** + !#en Make an animation named name go to the specified time. If no name is supplied then make all animations go to the specified time. + !#zh 设置指定动画的播放时间。如果没有指定名字,则设置当前播放动画的播放时间。 + @param time The time to go to + @param name Specified animation name, if not supplied then make all animations go to the time. + */ + setCurrentTime(time?: number, name?: string): void; + /** + !#en Returns the animation state named name. If no animation with the specified name, the function will return null. + !#zh 获取当前或者指定的动画状态,如果未找到指定动画剪辑则返回 null。 + @param name name + */ + getAnimationState(name: string): AnimationState; + /** + !#en Adds a clip to the animation with name newName. If a clip with that name already exists it will be replaced with the new clip. + !#zh 添加动画剪辑,并且可以重新设置该动画剪辑的名称。 + @param clip the clip to add + @param newName newName + */ + addClip(clip: AnimationClip, newName?: string): AnimationState; + /** + !#en + Remove clip from the animation list. This will remove the clip and any animation states based on it. + If there are animation states depand on the clip are playing or clip is defaultClip, it will not delete the clip. + But if force is true, then will always remove the clip and any animation states based on it. If clip is defaultClip, defaultClip will be reset to null + !#zh + 从动画列表中移除指定的动画剪辑,
+ 如果依赖于 clip 的 AnimationState 正在播放或者 clip 是 defaultClip 的话,默认是不会删除 clip 的。 + 但是如果 force 参数为 true,则会强制停止该动画,然后移除该动画剪辑和相关的动画。这时候如果 clip 是 defaultClip,defaultClip 将会被重置为 null。 + @param clip clip + @param force If force is true, then will always remove the clip and any animation states based on it. + */ + removeClip(clip: AnimationClip, force?: boolean): void; + /** + !#en + Samples animations at the current state.
+ This is useful when you explicitly want to set up some animation state, and sample it once. + !#zh 对指定或当前动画进行采样。你可以手动将动画设置到某一个状态,然后采样一次。 + @param name name + */ + sample(name: string): void; + /** + !#en + Register animation event callback. + The event arguments will provide the AnimationState which emit the event. + When play an animation, will auto register the event callback to the AnimationState, and unregister the event callback from the AnimationState when animation stopped. + !#zh + 注册动画事件回调。 + 回调的事件里将会附上发送事件的 AnimationState。 + 当播放一个动画时,会自动将事件注册到对应的 AnimationState 上,停止播放时会将事件从这个 AnimationState 上取消注册。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + onPlay: function (event) { + var state = event.detail; // state instanceof cc.AnimationState + var type = event.type; // type === 'play'; + } + + // register event to all animation + animation.on('play', this.onPlay, this); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Unregister animation event callback. + !#zh + 取消注册动画事件回调。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // unregister event to all animation + animation.off('play', this.onPlay, this); + ``` + */ + off(type: string, callback: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** !#en Audio Source. + !#zh 音频源组件,能对音频剪辑。 */ + export class AudioSource extends Component { + /** !#en + Is the audio source playing (Read Only).
+ Note: isPlaying is not supported for Native platforms. + !#zh + 该音频剪辑是否正播放(只读)。
+ 注意:Native 平台暂时不支持 isPlaying。 */ + isPlaying: boolean; + /** !#en The clip of the audio source. + !#zh 默认要播放的音频剪辑。 */ + clip: AudioClip; + /** !#en The volume of the audio source. + !#zh 音频源的音量(0.0 ~ 1.0)。 */ + volume: number; + /** !#en Is the audio source mute? + !#zh 是否静音音频源。Mute 是设置音量为 0,取消静音是恢复原来的音量。 */ + mute: boolean; + /** !#en Is the audio source looping? + !#zh 音频源是否循环播放? */ + loop: boolean; + /** !#en If set to true, the audio source will automatically start playing on onLoad. + !#zh 如果设置为true,音频源将在 onLoad 时自动播放。 */ + playOnLoad: boolean; + /** + !#en Plays the clip. + !#zh 播放音频剪辑。 + */ + play(): void; + /** + !#en Stops the clip. + !#zh 停止当前音频剪辑。 + */ + stop(): void; + /** + !#en Pause the clip. + !#zh 暂停当前音频剪辑。 + */ + pause(): void; + /** + !#en Resume the clip. + !#zh 恢复播放。 + */ + resume(): void; + /** + !#en Rewind playing music. + !#zh 从头开始播放。 + */ + rewind(): void; + /** + !#en Get current time + !#zh 获取当前的播放时间 + */ + getCurrentTime(): void; + /** + !#en Set current time + !#zh 设置当前的播放时间 + @param time time + */ + setCurrentTime(time: number): void; + /** + !#en Get audio duration + !#zh 获取当前音频的长度 + */ + getDuration(): void; + } + /** !#en + This component will block all input events (mouse and touch) within the bounding box of the node, preventing the input from penetrating into the underlying node, typically for the background of the top UI.
+ This component does not have any API interface and can be added directly to the scene to take effect. + !#zh + 该组件将拦截所属节点 bounding box 内的所有输入事件(鼠标和触摸),防止输入穿透到下层节点,一般用于上层 UI 的背景。
+ 该组件没有任何 API 接口,直接添加到场景即可生效。 */ + export class BlockInputEvents extends Component { + } + /** !#en + Button has 4 Transition types + When Button state changed: + If Transition type is Button.Transition.NONE, Button will do nothing + If Transition type is Button.Transition.COLOR, Button will change target's color + If Transition type is Button.Transition.SPRITE, Button will change target Sprite's sprite + If Transition type is Button.Transition.SCALE, Button will change target node's scale + + Button will trigger 5 events: + Button.EVENT_TOUCH_DOWN + Button.EVENT_TOUCH_UP + Button.EVENT_HOVER_IN + Button.EVENT_HOVER_MOVE + Button.EVENT_HOVER_OUT + + !#zh + 按钮组件。可以被按下,或者点击。
+ + 按钮可以通过修改 Transition 来设置按钮状态过渡的方式:
+ -Button.Transition.NONE // 不做任何过渡
+ -Button.Transition.COLOR // 进行颜色之间过渡
+ -Button.Transition.SPRITE // 进行精灵之间过渡
+ -Button.Transition.SCALE // 进行缩放过渡
+ + 按钮可以绑定事件(但是必须要在按钮的 Node 上才能绑定事件):
+ // 以下事件可以在全平台上都触发
+ -cc.Node.EventType.TOUCH_START // 按下时事件
+ -cc.Node.EventType.TOUCH_Move // 按住移动后事件
+ -cc.Node.EventType.TOUCH_END // 按下后松开后事件
+ -cc.Node.EventType.TOUCH_CANCEL // 按下取消事件
+ // 以下事件只在 PC 平台上触发
+ -cc.Node.EventType.MOUSE_DOWN // 鼠标按下时事件
+ -cc.Node.EventType.MOUSE_MOVE // 鼠标按住移动后事件
+ -cc.Node.EventType.MOUSE_ENTER // 鼠标进入目标事件
+ -cc.Node.EventType.MOUSE_LEAVE // 鼠标离开目标事件
+ -cc.Node.EventType.MOUSE_UP // 鼠标松开事件
+ -cc.Node.EventType.MOUSE_WHEEL // 鼠标滚轮事件
*/ + export class Button extends Component { + /** !#en + Whether the Button is disabled. + If true, the Button will trigger event and do transition. + !#zh + 按钮事件是否被响应,如果为 false,则按钮将被禁用。 */ + interactable: boolean; + /** !#en When this flag is true, Button target sprite will turn gray when interactable is false. + !#zh 如果这个标记为 true,当 button 的 interactable 属性为 false 的时候,会使用内置 shader 让 button 的 target 节点的 sprite 组件变灰 */ + enableAutoGrayEffect: boolean; + /** !#en Transition type + !#zh 按钮状态改变时过渡方式。 */ + transition: Button.Transition; + /** !#en Normal state color. + !#zh 普通状态下按钮所显示的颜色。 */ + normalColor: Color; + /** !#en Pressed state color + !#zh 按下状态时按钮所显示的颜色。 */ + pressedColor: Color; + /** !#en Hover state color + !#zh 悬停状态下按钮所显示的颜色。 */ + hoverColor: Color; + /** !#en Disabled state color + !#zh 禁用状态下按钮所显示的颜色。 */ + disabledColor: Color; + /** !#en Color and Scale transition duration + !#zh 颜色过渡和缩放过渡时所需时间 */ + duration: number; + /** !#en When user press the button, the button will zoom to a scale. + The final scale of the button equals (button original scale * zoomScale) + !#zh 当用户点击按钮后,按钮会缩放到一个值,这个值等于 Button 原始 scale * zoomScale */ + zoomScale: number; + /** !#en Normal state sprite + !#zh 普通状态下按钮所显示的 Sprite 。 */ + normalSprite: SpriteFrame; + /** !#en Pressed state sprite + !#zh 按下状态时按钮所显示的 Sprite 。 */ + pressedSprite: SpriteFrame; + /** !#en Hover state sprite + !#zh 悬停状态下按钮所显示的 Sprite 。 */ + hoverSprite: SpriteFrame; + /** !#en Disabled state sprite + !#zh 禁用状态下按钮所显示的 Sprite 。 */ + disabledSprite: SpriteFrame; + /** !#en + Transition target. + When Button state changed: + If Transition type is Button.Transition.NONE, Button will do nothing + If Transition type is Button.Transition.COLOR, Button will change target's color + If Transition type is Button.Transition.SPRITE, Button will change target Sprite's sprite + !#zh + 需要过渡的目标。 + 当前按钮状态改变规则: + -如果 Transition type 选择 Button.Transition.NONE,按钮不做任何过渡。 + -如果 Transition type 选择 Button.Transition.COLOR,按钮会对目标颜色进行颜色之间的过渡。 + -如果 Transition type 选择 Button.Transition.Sprite,按钮会对目标 Sprite 进行 Sprite 之间的过渡。 */ + target: Node; + /** !#en If Button is clicked, it will trigger event's handler + !#zh 按钮的点击事件列表。 */ + clickEvents: Component.EventHandler[]; + } + /** !#zh: 作为 UI 根节点,为所有子节点提供视窗四边的位置信息以供对齐,另外提供屏幕适配策略接口,方便从编辑器设置。 + 注:由于本节点的尺寸会跟随屏幕拉伸,所以 anchorPoint 只支持 (0.5, 0.5),否则适配不同屏幕时坐标会有偏差。 */ + export class Canvas extends Component { + /** !#en Current active canvas, the scene should only have one active canvas at the same time. + !#zh 当前激活的画布组件,场景同一时间只能有一个激活的画布。 */ + static instance: Canvas; + /** !#en The desigin resolution for current scene. + !#zh 当前场景设计分辨率。 */ + designResolution: Size; + /** !#en TODO + !#zh: 是否优先将设计分辨率高度撑满视图高度。 */ + fitHeight: boolean; + /** !#en TODO + !#zh: 是否优先将设计分辨率宽度撑满视图宽度。 */ + fitWidth: boolean; + } + /** !#en + Base class for everything attached to Node(Entity).
+
+ NOTE: Not allowed to use construction parameters for Component's subclasses, + because Component is created by the engine. + !#zh + 所有附加到节点的基类。
+
+ 注意:不允许使用组件的子类构造参数,因为组件是由引擎创建的。 */ + export class Component extends Object { + /** !#en The node this component is attached to. A component is always attached to a node. + !#zh 该组件被附加到的节点。组件总会附加到一个节点。 */ + node: Node; + /** !#en The uuid for editor. + !#zh 组件的 uuid,用于编辑器。 */ + uuid: string; + /** !#en indicates whether this component is enabled or not. + !#zh 表示该组件自身是否启用。 */ + enabled: boolean; + /** !#en indicates whether this component is enabled and its node is also active in the hierarchy. + !#zh 表示该组件是否被启用并且所在的节点也处于激活状态。 */ + enabledInHierarchy: boolean; + /** !#en Returns a value which used to indicate the onLoad get called or not. + !#zh 返回一个值用来判断 onLoad 是否被调用过,不等于 0 时调用过,等于 0 时未调用。 */ + _isOnLoadCalled: number; + /** + !#en Update is called every frame, if the Component is enabled. + !#zh 如果该组件启用,则每帧调用 update。 + @param dt the delta time in seconds it took to complete the last frame + */ + protected update(dt: number): void; + /** + !#en LateUpdate is called every frame, if the Component is enabled. + !#zh 如果该组件启用,则每帧调用 LateUpdate。 + */ + protected lateUpdate(): void; + /** + !#en + When attaching to an active node or its node first activated. + onLoad is always called before any start functions, this allows you to order initialization of scripts. + !#zh + 当附加到一个激活的节点上或者其节点第一次激活时候调用。onLoad 总是会在任何 start 方法调用前执行,这能用于安排脚本的初始化顺序。 + */ + protected onLoad(): void; + /** + !#en + Called before all scripts' update if the Component is enabled the first time. + Usually used to initialize some logic which need to be called after all components' `onload` methods called. + !#zh + 如果该组件第一次启用,则在所有组件的 update 之前调用。通常用于需要在所有组件的 onLoad 初始化完毕后执行的逻辑。 + */ + protected start(): void; + /** + !#en Called when this component becomes enabled and its node is active. + !#zh 当该组件被启用,并且它的节点也激活时。 + */ + protected onEnable(): void; + /** + !#en Called when this component becomes disabled or its node becomes inactive. + !#zh 当该组件被禁用或节点变为无效时调用。 + */ + protected onDisable(): void; + /** + !#en Called when this component will be destroyed. + !#zh 当该组件被销毁时调用 + */ + protected onDestroy(): void; + protected onFocusInEditor(): void; + protected onLostFocusInEditor(): void; + /** + !#en Called to initialize the component or node’s properties when adding the component the first time or when the Reset command is used. This function is only called in editor. + !#zh 用来初始化组件或节点的一些属性,当该组件被第一次添加到节点上或用户点击了它的 Reset 菜单时调用。这个回调只会在编辑器下调用。 + */ + protected resetInEditor(): void; + /** + !#en Adds a component class to the node. You can also add component to node by passing in the name of the script. + !#zh 向节点添加一个组件类,你还可以通过传入脚本的名称来添加组件。 + @param typeOrClassName the constructor or the class name of the component to add + + @example + ```js + var sprite = node.addComponent(cc.Sprite); + var test = node.addComponent("Test"); + ``` + */ + addComponent(type: {new(): T}): T; + addComponent(className: string): any; + /** + !#en + Returns the component of supplied type if the node has one attached, null if it doesn't.
+ You can also get component in the node by passing in the name of the script. + !#zh + 获取节点上指定类型的组件,如果节点有附加指定类型的组件,则返回,如果没有则为空。
+ 传入参数也可以是脚本的名称。 + @param typeOrClassName typeOrClassName + + @example + ```js + // get sprite component. + var sprite = node.getComponent(cc.Sprite); + // get custom test calss. + var test = node.getComponent("Test"); + ``` + */ + getComponent(type: {prototype: T}): T; + getComponent(className: string): any; + /** + !#en Returns all components of supplied Type in the node. + !#zh 返回节点上指定类型的所有组件。 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprites = node.getComponents(cc.Sprite); + var tests = node.getComponents("Test"); + ``` + */ + getComponents(type: {prototype: T}): T[]; + getComponents(className: string): any[]; + /** + !#en Returns the component of supplied type in any of its children using depth first search. + !#zh 递归查找所有子节点中第一个匹配指定类型的组件。 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprite = node.getComponentInChildren(cc.Sprite); + var Test = node.getComponentInChildren("Test"); + ``` + */ + getComponentInChildren(type: {prototype: T}): T; + getComponentInChildren(className: string): any; + /** + !#en Returns the components of supplied type in self or any of its children using depth first search. + !#zh 递归查找自身或所有子节点中指定类型的组件 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprites = node.getComponentsInChildren(cc.Sprite); + var tests = node.getComponentsInChildren("Test"); + ``` + */ + getComponentsInChildren(type: {prototype: T}): T[]; + getComponentsInChildren(className: string): any[]; + /** + !#en + If the component's bounding box is different from the node's, you can implement this method to supply + a custom axis aligned bounding box (AABB), so the editor's scene view can perform hit test properly. + !#zh + 如果组件的包围盒与节点不同,您可以实现该方法以提供自定义的轴向对齐的包围盒(AABB), + 以便编辑器的场景视图可以正确地执行点选测试。 + @param out_rect the Rect to receive the bounding box + */ + _getLocalBounds(out_rect: Rect): void; + /** + !#en + onRestore is called after the user clicks the Reset item in the Inspector's context menu or performs + an undo operation on this component.
+
+ If the component contains the "internal state", short for "temporary member variables which not included
+ in its CCClass properties", then you may need to implement this function.
+
+ The editor will call the getset accessors of your component to record/restore the component's state
+ for undo/redo operation. However, in extreme cases, it may not works well. Then you should implement
+ this function to manually synchronize your component's "internal states" with its public properties.
+ Once you implement this function, all the getset accessors of your component will not be called when
+ the user performs an undo/redo operation. Which means that only the properties with default value
+ will be recorded or restored by editor.
+
+ Similarly, the editor may failed to reset your component correctly in extreme cases. Then if you need
+ to support the reset menu, you should manually synchronize your component's "internal states" with its
+ properties in this function. Once you implement this function, all the getset accessors of your component
+ will not be called during reset operation. Which means that only the properties with default value
+ will be reset by editor. + + This function is only called in editor mode. + !#zh + onRestore 是用户在检查器菜单点击 Reset 时,对此组件执行撤消操作后调用的。
+
+ 如果组件包含了“内部状态”(不在 CCClass 属性中定义的临时成员变量),那么你可能需要实现该方法。
+
+ 编辑器执行撤销/重做操作时,将调用组件的 get set 来录制和还原组件的状态。 + 然而,在极端的情况下,它可能无法良好运作。
+ 那么你就应该实现这个方法,手动根据组件的属性同步“内部状态”。 + 一旦你实现这个方法,当用户撤销或重做时,组件的所有 get set 都不会再被调用。 + 这意味着仅仅指定了默认值的属性将被编辑器记录和还原。
+
+ 同样的,编辑可能无法在极端情况下正确地重置您的组件。
+ 于是如果你需要支持组件重置菜单,你需要在该方法中手工同步组件属性到“内部状态”。
+ 一旦你实现这个方法,组件的所有 get set 都不会在重置操作时被调用。 + 这意味着仅仅指定了默认值的属性将被编辑器重置。 +
+ 此方法仅在编辑器下会被调用。 + */ + onRestore(): void; + /** + !#en + Schedules a custom selector.
+ If the selector is already scheduled, then the interval parameter will be updated without scheduling it again. + !#zh + 调度一个自定义的回调函数。
+ 如果回调函数已调度,那么将不会重复调度它,只会更新时间间隔参数。 + @param callback The callback function + @param interval Tick interval in seconds. 0 means tick every frame. + @param repeat The selector will be executed (repeat + 1) times, you can use cc.macro.REPEAT_FOREVER for tick infinitely. + @param delay The amount of time that the first tick will wait before execution. + + @example + ```js + var timeCallback = function (dt) { + cc.log("time: " + dt); + } + this.schedule(timeCallback, 1); + ``` + */ + schedule(callback: Function, interval?: number, repeat?: number, delay?: number): void; + /** + !#en Schedules a callback function that runs only once, with a delay of 0 or larger. + !#zh 调度一个只运行一次的回调函数,可以指定 0 让回调函数在下一帧立即执行或者在一定的延时之后执行。 + @param callback A function wrapped as a selector + @param delay The amount of time that the first tick will wait before execution. + + @example + ```js + var timeCallback = function (dt) { + cc.log("time: " + dt); + } + this.scheduleOnce(timeCallback, 2); + ``` + */ + scheduleOnce(callback: Function, delay?: number): void; + /** + !#en Unschedules a custom callback function. + !#zh 取消调度一个自定义的回调函数。 + @param callback_fn A function wrapped as a selector + + @example + ```js + this.unschedule(_callback); + ``` + */ + unschedule(callback_fn: Function): void; + /** + !#en + unschedule all scheduled callback functions: custom callback functions, and the 'update' callback function.
+ Actions are not affected by this method. + !#zh 取消调度所有已调度的回调函数:定制的回调函数以及 'update' 回调函数。动作不受此方法影响。 + + @example + ```js + this.unscheduleAllCallbacks(); + ``` + */ + unscheduleAllCallbacks(): void; + } + /** !#en cc.EditBox is a component for inputing text, you can use it to gather small amounts of text from users. + !#zh EditBox 组件,用于获取用户的输入文本。 */ + export class EditBox extends _RendererUnderSG { + /** !#en Input string of EditBox. + !#zh 输入框的初始输入内容,如果为空则会显示占位符的文本。 */ + string: string; + /** !#en The background image of EditBox. + !#zh 输入框的背景图片 */ + backgroundImage: SpriteFrame; + /** !#en + The return key type of EditBox. + Note: it is meaningless for web platforms and desktop platforms. + !#zh + 指定移动设备上面回车按钮的样式。 + 注意:这个选项对 web 平台与 desktop 平台无效。 */ + returnType: EditBox.KeyboardReturnType; + /** !#en Set the input flags that are to be applied to the EditBox. + !#zh 指定输入标志位,可以指定输入方式为密码或者单词首字母大写。 */ + inputFlag: EditBox.InputFlag; + /** !#en + Set the input mode of the edit box. + If you pass ANY, it will create a multiline EditBox. + !#zh + 指定输入模式: ANY表示多行输入,其它都是单行输入,移动平台上还可以指定键盘样式。 */ + inputMode: EditBox.InputMode; + /** !#en Font size of the input text. + !#zh 输入框文本的字体大小 */ + fontSize: number; + /** !#en Change the lineHeight of displayed text. + !#zh 输入框文本的行高。 */ + lineHeight: number; + /** !#en Font color of the input text. + !#zh 输入框文本的颜色。 */ + fontColor: Color; + /** !#en The display text of placeholder. + !#zh 输入框占位符的文本内容。 */ + placeholder: string; + /** !#en The font size of placeholder. + !#zh 输入框占位符的字体大小。 */ + placeholderFontSize: number; + /** !#en The font color of placeholder. + !#zh 输入框占位符的字体颜色。 */ + placeholderFontColor: Color; + /** !#en The maximize input length of EditBox. + - If pass a value less than 0, it won't limit the input number of characters. + - If pass 0, it doesn't allow input any characters. + !#zh 输入框最大允许输入的字符个数。 + - 如果值为小于 0 的值,则不会限制输入字符个数。 + - 如果值为 0,则不允许用户进行任何输入。 */ + maxLength: number; + /** !#en The input is always visible and be on top of the game view. + !zh 输入框总是可见,并且永远在游戏视图的上面 + Note: only available on Web at the moment. */ + stayOnTop: boolean; + /** !#en Set the tabIndex of the DOM input element, only useful on Web. + !#zh 修改 DOM 输入元素的 tabIndex,这个属性只有在 Web 上面修改有意义。 */ + tabIndex: number; + /** !#en The event handler to be called when EditBox began to edit text. + !#zh 开始编辑文本输入框触发的事件回调。 */ + editingDidBegan: Component.EventHandler[]; + /** !#en The event handler to be called when EditBox text changes. + !#zh 编辑文本输入框时触发的事件回调。 */ + textChanged: Component.EventHandler[]; + /** !#en The event handler to be called when EditBox edit ends. + !#zh 结束编辑文本输入框时触发的事件回调。 */ + editingDidEnded: Component.EventHandler[]; + /** !#en The event handler to be called when return key is pressed. Windows is not supported. + !#zh 当用户按下回车按键时的事件回调,目前不支持 windows 平台 */ + editingReturn: Component.EventHandler[]; + /** + !#en Let the EditBox get focus, only valid when stayOnTop is true. + !#zh 让当前 EditBox 获得焦点,只有在 stayOnTop 为 true 的时候设置有效 + Note: only available on Web at the moment. + */ + setFocus(): void; + /** + !#en Determine whether EditBox is getting focus or not. + !#zh 判断 EditBox 是否获得了焦点 + Note: only available on Web at the moment. + */ + isFocused(): void; + /** + !#en if you don't need the EditBox and it isn't in any running Scene, you should + call the destroy method on this component or the associated node explicitly. + Otherwise, the created DOM element won't be removed from web page. + !#zh + 如果你不再使用 EditBox,并且组件未添加到场景中,那么你必须手动对组件或所在节点调用 destroy。 + 这样才能移除网页上的 DOM 节点,避免 Web 平台内存泄露。 + + @example + ```js + editbox.node.parent = null; // or editbox.node.removeFromParent(false); + // when you don't need editbox anymore + editbox.node.destroy(); + ``` + */ + destroy(): boolean; + } + /** !#en The Label Component. + !#zh 文字标签组件 */ + export class Label extends _RendererUnderSG { + /** !#en Content string of label. + !#zh 标签显示的文本内容。 */ + string: string; + /** !#en Horizontal Alignment of label. + !#zh 文本内容的水平对齐方式。 */ + horizontalAlign: Label.HorizontalAlign; + /** !#en Vertical Alignment of label. + !#zh 文本内容的垂直对齐方式。 */ + verticalAlign: Label.VerticalAlign; + /** !#en The actual rendering font size in shrink mode + !#zh SHRINK 模式下面文本实际渲染的字体大小 */ + actualFontSize: number; + /** !#en Font size of label. + !#zh 文本字体大小。 */ + fontSize: number; + /** !#en Font family of label, only take effect when useSystemFont property is true. + !#zh 文本字体名称, 只在 useSystemFont 属性为 true 的时候生效。 */ + fontFamily: string; + /** !#en Line Height of label. + !#zh 文本行高。 */ + lineHeight: number; + /** !#en Overflow of label. + !#zh 文字显示超出范围时的处理方式。 */ + overflow: Label.Overflow; + /** !#en Whether auto wrap label when string width is large than label width. + !#zh 是否自动换行。 */ + enableWrapText: boolean; + /** !#en The font of label. + !#zh 文本字体。 */ + font: Font; + /** !#en Whether use system font name or not. + !#zh 是否使用系统字体。 */ + isSystemFontUsed: boolean; + } + /** !#en Outline effect used to change the display, only used for TTF font + !#zh 描边效果组件,用于字体描边,只能用于系统字体 */ + export class LabelOutline extends Component { + /** !#en Change the outline color + !#zh 改变描边的颜色 */ + color: Color; + /** !#en Change the outline width + !#zh 改变描边的宽度 */ + width: number; + } + /** !#en + The Layout is a container component, use it to arrange child elements easily.
+ Note:
+ 1.Scaling and rotation of child nodes are not considered.
+ 2.After setting the Layout, the results need to be updated until the next frame, + unless you manually call {{#crossLink "Layout/updateLayout:method"}}{{/crossLink}}。 + !#zh + Layout 组件相当于一个容器,能自动对它的所有子节点进行统一排版。
+ 注意:
+ 1.不会考虑子节点的缩放和旋转。
+ 2.对 Layout 设置后结果需要到下一帧才会更新,除非你设置完以后手动调用 {{#crossLink "Layout/updateLayout:method"}}{{/crossLink}}。 */ + export class Layout extends Component { + /** !#en The layout type. + !#zh 布局类型 */ + type: Layout.Type; + /** !#en + The are three resize modes for Layout. + None, resize Container and resize children. + !#zh 缩放模式 */ + resizeMode: Layout.ResizeMode; + /** !#en The cell size for grid layout. + !#zh 每个格子的大小,只有布局类型为 GRID 的时候才有效。 */ + cellSize: Size; + /** !#en + The start axis for grid layout. If you choose horizontal, then children will layout horizontally at first, + and then break line on demand. Choose vertical if you want to layout vertically at first . + !#zh 起始轴方向类型,可进行水平和垂直布局排列,只有布局类型为 GRID 的时候才有效。 */ + startAxis: Layout.AxisDirection; + /** !#en The left padding of layout, it only effect the layout in one direction. + !#zh 容器内左边距,只会在一个布局方向上生效。 */ + paddingLeft: number; + /** !#en The right padding of layout, it only effect the layout in one direction. + !#zh 容器内右边距,只会在一个布局方向上生效。 */ + paddingRight: number; + /** !#en The top padding of layout, it only effect the layout in one direction. + !#zh 容器内上边距,只会在一个布局方向上生效。 */ + paddingTop: number; + /** !#en The bottom padding of layout, it only effect the layout in one direction. + !#zh 容器内下边距,只会在一个布局方向上生效。 */ + paddingBottom: number; + /** !#en The distance in x-axis between each element in layout. + !#zh 子节点之间的水平间距。 */ + spacingX: number; + /** !#en The distance in y-axis between each element in layout. + !#zh 子节点之间的垂直间距。 */ + spacingY: number; + /** !#en + Only take effect in Vertical layout mode. + This option changes the start element's positioning. + !#zh 垂直排列子节点的方向。 */ + verticalDirection: Layout.VerticalDirection; + /** !#en + Only take effect in Horizontal layout mode. + This option changes the start element's positioning. + !#zh 水平排列子节点的方向。 */ + horizontalDirection: Layout.HorizontalDirection; + /** + !#en Perform the layout update + !#zh 立即执行更新布局 + + @example + ```js + layout.type = cc.Layout.HORIZONTAL; + layout.node.addChild(childNode); + cc.log(childNode.x); // not yet changed + layout.updateLayout(); + cc.log(childNode.x); // changed + ``` + */ + updateLayout(): void; + /** !#en The padding of layout, it effects the layout in four direction. + !#zh 容器内边距,该属性会在四个布局方向上生效。 */ + padding: number; + } + /** !#en The Mask Component + !#zh 遮罩组件 */ + export class Mask extends _RendererInSG { + /** !#en The mask type. + !#zh 遮罩类型 */ + type: Mask.Type; + /** !#en The mask image + !#zh 遮罩所需要的贴图 */ + spriteFrame: SpriteFrame; + /** !#en + The alpha threshold.(Not supported Canvas Mode)
+ The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold.
+ Should be a float between 0 and 1.
+ This default to 1 (so alpha test is disabled). + !#zh + Alpha 阈值(不支持 Canvas 模式)
+ 只有当模板的像素的 alpha 大于 alphaThreshold 时,才会绘制内容。
+ 该数值 0 ~ 1 之间的浮点数,默认值为 1(因此禁用 alpha) */ + alphaThreshold: number; + /** !#en Reverse mask (Not supported Canvas Mode) + !#zh 反向遮罩(不支持 Canvas 模式) */ + inverted: boolean; + /** !#en The segements for ellipse mask. + !#zh 椭圆遮罩的曲线细分数 */ + segements: number; + } + /** !#en The PageView control + !#zh 页面视图组件 */ + export class PageView extends ScrollView { + /** !#en Specify the size type of each page in PageView. + !#zh 页面视图中每个页面大小类型 */ + sizeMode: PageView.SizeMode; + /** !#en The page view direction + !#zh 页面视图滚动类型 */ + direction: PageView.Direction; + /** !#en + The scroll threshold value, when drag exceeds this value, + release the next page will automatically scroll, less than the restore + !#zh 滚动临界值,默认单位百分比,当拖拽超出该数值时,松开会自动滚动下一页,小于时则还原。 */ + scrollThreshold: number; + /** !#en + Auto page turning velocity threshold. When users swipe the PageView quickly, + it will calculate a velocity based on the scroll distance and time, + if the calculated velocity is larger than the threshold, then it will trigger page turning. + !#zh + 快速滑动翻页临界值。 + 当用户快速滑动时,会根据滑动开始和结束的距离与时间计算出一个速度值, + 该值与此临界值相比较,如果大于临界值,则进行自动翻页。 */ + autoPageTurningThreshold: number; + /** !#en Change the PageTurning event timing of PageView. + !#zh 设置 PageView PageTurning 事件的发送时机。 */ + pageTurningEventTiming: number; + /** !#en The Page View Indicator + !#zh 页面视图指示器组件 */ + indicator: PageViewIndicator; + /** !#en The time required to turn over a page. unit: second + !#zh 每个页面翻页时所需时间。单位:秒 */ + pageTurningSpeed: number; + /** !#en PageView events callback + !#zh 滚动视图的事件回调函数 */ + pageEvents: Component.EventHandler[]; + /** + !#en Returns current page index + !#zh 返回当前页面索引 + */ + getCurrentPageIndex(): number; + /** + !#en Set current page index + !#zh 设置当前页面索引 + @param index index + */ + setCurrentPageIndex(index: number): void; + /** + !#en Returns all pages of pageview + !#zh 返回视图中的所有页面 + */ + getPages(): Node[]; + /** + !#en At the end of the current page view to insert a new view + !#zh 在当前页面视图的尾部插入一个新视图 + @param page page + */ + addPage(page: Node): void; + /** + !#en Inserts a page in the specified location + !#zh 将页面插入指定位置中 + @param page page + @param index index + */ + insertPage(page: Node, index: number): void; + /** + !#en Removes a page from PageView. + !#zh 移除指定页面 + @param page page + */ + removePage(page: Node): void; + /** + !#en Removes a page at index of PageView. + !#zh 移除指定下标的页面 + @param index index + */ + removePageAtIndex(index: number): void; + /** + !#en Removes all pages from PageView + !#zh 移除所有页面 + */ + removeAllPages(): void; + /** + !#en Scroll PageView to index. + !#zh 滚动到指定页面 + @param idx index of page. + @param timeInSecond scrolling time + */ + scrollToPage(idx: number, timeInSecond: number): void; + } + /** !#en The Page View Indicator Component + !#zh 页面视图每页标记组件 */ + export class PageViewIndicator extends Component { + /** !#en The spriteFrame for each element. + !#zh 每个页面标记显示的图片 */ + spriteFrame: SpriteFrame; + /** !#en The location direction of PageViewIndicator. + !#zh 页面标记摆放方向 */ + direction: PageViewIndicator.Direction; + /** !#en The cellSize for each element. + !#zh 每个页面标记的大小 */ + cellSize: Size; + /** !#en The distance between each element. + !#zh 每个页面标记之间的边距 */ + spacing: number; + /** + !#en Set Page View + !#zh 设置页面视图 + @param target target + */ + setPageView(target: PageView): void; + } + /** !#en + Visual indicator of progress in some operation. + Displays a bar to the user representing how far the operation has progressed. + !#zh + 进度条组件,可用于显示加载资源时的进度。 */ + export class ProgressBar extends Component { + /** !#en The targeted Sprite which will be changed progressively. + !#zh 用来显示进度条比例的 Sprite 对象。 */ + barSprite: Sprite; + /** !#en The progress mode, there are two modes supported now: horizontal and vertical. + !#zh 进度条的模式 */ + mode: ProgressBar.Mode; + /** !#en The total width or height of the bar sprite. + !#zh 进度条实际的总长度 */ + totalLength: number; + /** !#en The current progress of the bar sprite. The valid value is between 0-1. + !#zh 当前进度值,该数值的区间是 0-1 之间。 */ + progress: number; + /** !#en Whether reverse the progress direction of the bar sprite. + !#zh 进度条是否进行反方向变化。 */ + reverse: boolean; + } + /** Rendering component in scene graph. + Maintains a node which will be the scene graph of component's Node. */ + export class _RendererInSG extends _SGComponent { + } + /** The base rendering component which will attach a leaf node to the cocos2d scene graph. */ + export class _RendererUnderSG extends _SGComponent { + } + /** !#en The RichText Component. + !#zh 富文本组件 */ + export class RichText extends Component { + /** !#en Content string of RichText. + !#zh 富文本显示的文本内容。 */ + string: string; + /** !#en Horizontal Alignment of each line in RichText. + !#zh 文本内容的水平对齐方式。 */ + horizontalAlign: TextAlignment; + /** !#en Font size of RichText. + !#zh 富文本字体大小。 */ + fontSize: number; + /** !#en Custom TTF font of RichText + !#zh 富文本定制字体 */ + font: cc.TTFFont; + /** !#en The maximize width of the RichText + !#zh 富文本的最大宽度 */ + maxWidth: number; + /** !#en Line Height of RichText. + !#zh 富文本行高。 */ + lineHeight: number; + /** !#en The image atlas for the img tag. For each src value in the img tag, there should be a valid spriteFrame in the image atlas. + !#zh 对于 img 标签里面的 src 属性名称,都需要在 imageAtlas 里面找到一个有效的 spriteFrame,否则 img tag 会判定为无效。 */ + imageAtlas: SpriteAtlas; + /** !#en + Once checked, the RichText will block all input events (mouse and touch) within + the bounding box of the node, preventing the input from penetrating into the underlying node. + !#zh + 选中此选项后,RichText 将阻止节点边界框中的所有输入事件(鼠标和触摸),从而防止输入事件穿透到底层节点。 */ + handleTouchEvent: boolean; + } + /** The base class for all rendering component in scene graph. + + You should override: + - _createSgNode + - _initSgNode */ + export class _SGComponent extends Component { + } + /** !#en + The Scrollbar control allows the user to scroll an image or other view that is too large to see completely + !#zh 滚动条组件 */ + export class Scrollbar extends Component { + /** !#en The "handle" part of the scrollbar. + !#zh 作为当前滚动区域位置显示的滑块 Sprite。 */ + handle: Sprite; + /** !#en The direction of scrollbar. + !#zh ScrollBar 的滚动方向。 */ + direction: Scrollbar.Direction; + /** !#en Whether enable auto hide or not. + !#zh 是否在没有滚动动作时自动隐藏 ScrollBar。 */ + enableAutoHide: boolean; + /** !#en + The time to hide scrollbar when scroll finished. + Note: This value is only useful when enableAutoHide is true. + !#zh + 没有滚动动作后经过多久会自动隐藏。 + 注意:只要当 “enableAutoHide” 为 true 时,才有效。 */ + autoHideTime: number; + } + /** !#en + Layout container for a view hierarchy that can be scrolled by the user, + allowing it to be larger than the physical display. + + !#zh + 滚动视图组件 */ + export class ScrollView extends Component { + /** !#en This is a reference to the UI element to be scrolled. + !#zh 可滚动展示内容的节点。 */ + content: Node; + /** !#en Enable horizontal scroll. + !#zh 是否开启水平滚动。 */ + horizontal: boolean; + /** !#en Enable vertical scroll. + !#zh 是否开启垂直滚动。 */ + vertical: boolean; + /** !#en When inertia is set, the content will continue to move when touch ended. + !#zh 是否开启滚动惯性。 */ + inertia: boolean; + /** !#en + It determines how quickly the content stop moving. A value of 1 will stop the movement immediately. + A value of 0 will never stop the movement until it reaches to the boundary of scrollview. + !#zh + 开启惯性后,在用户停止触摸后滚动多快停止,0表示永不停止,1表示立刻停止。 */ + brake: number; + /** !#en When elastic is set, the content will be bounce back when move out of boundary. + !#zh 是否允许滚动内容超过边界,并在停止触摸后回弹。 */ + elastic: boolean; + /** !#en The elapse time of bouncing back. A value of 0 will bounce back immediately. + !#zh 回弹持续的时间,0 表示将立即反弹。 */ + bounceDuration: number; + /** !#en The horizontal scrollbar reference. + !#zh 水平滚动的 ScrollBar。 */ + horizontalScrollBar: Scrollbar; + /** !#en The vertical scrollbar reference. + !#zh 垂直滚动的 ScrollBar。 */ + verticalScrollBar: Scrollbar; + /** !#en Scrollview events callback + !#zh 滚动视图的事件回调函数 */ + scrollEvents: Component.EventHandler[]; + /** !#en If cancelInnerEvents is set to true, the scroll behavior will cancel touch events on inner content nodes + It's set to true by default. + !#zh 如果这个属性被设置为 true,那么滚动行为会取消子节点上注册的触摸事件,默认被设置为 true。 + 注意,子节点上的 touchstart 事件仍然会触发,触点移动距离非常短的情况下 touchmove 和 touchend 也不会受影响。 */ + cancelInnerEvents: boolean; + /** + !#en Scroll the content to the bottom boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图底部。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the bottom boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the bottom of the view. + scrollView.scrollToBottom(0.1); + ``` + */ + scrollToBottom(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the top boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图顶部。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the top boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the top of the view. + scrollView.scrollToTop(0.1); + ``` + */ + scrollToTop(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the left boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图左边。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the left boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the left of the view. + scrollView.scrollToLeft(0.1); + ``` + */ + scrollToLeft(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the right boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图右边。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the right boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the right of the view. + scrollView.scrollToRight(0.1); + ``` + */ + scrollToRight(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the top left boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图左上角。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the top left boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the upper left corner of the view. + scrollView.scrollToTopLeft(0.1); + ``` + */ + scrollToTopLeft(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the top right boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图右上角。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the top right boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the top right corner of the view. + scrollView.scrollToTopRight(0.1); + ``` + */ + scrollToTopRight(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the bottom left boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图左下角。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the bottom left boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the lower left corner of the view. + scrollView.scrollToBottomLeft(0.1); + ``` + */ + scrollToBottomLeft(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the bottom right boundary of ScrollView. + !#zh 视图内容将在规定时间内滚动到视图右下角。 + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the bottom right boundary immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to the lower right corner of the view. + scrollView.scrollToBottomRight(0.1); + ``` + */ + scrollToBottomRight(timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll with an offset related to the ScrollView's top left origin, if timeInSecond is omitted, then it will jump to the + specific offset immediately. + !#zh 视图内容在规定时间内将滚动到 ScrollView 相对左上角原点的偏移位置, 如果 timeInSecond参数不传,则立即滚动到指定偏移位置。 + @param offset A Vec2, the value of which each axis between 0 and maxScrollOffset + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the specific offset of ScrollView immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to middle position in 0.1 second in x-axis + var maxScrollOffset = this.getMaxScrollOffset(); + scrollView.scrollToOffset(cc.p(maxScrollOffset.x / 2, 0), 0.1); + ``` + */ + scrollToOffset(offset: Vec2, timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Get the positive offset value corresponds to the content's top left boundary. + !#zh 获取滚动视图相对于左上角原点的当前滚动偏移 + */ + getScrollOffset(): Vec2; + /** + !#en Get the maximize available scroll offset + !#zh 获取滚动视图最大可以滚动的偏移量 + */ + getMaxScrollOffset(): Vec2; + /** + !#en Scroll the content to the horizontal percent position of ScrollView. + !#zh 视图内容在规定时间内将滚动到 ScrollView 水平方向的百分比位置上。 + @param percent A value between 0 and 1. + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the horizontal percent position of ScrollView immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Scroll to middle position. + scrollView.scrollToBottomRight(0.5, 0.1); + ``` + */ + scrollToPercentHorizontal(percent: number, timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the percent position of ScrollView in any direction. + !#zh 视图内容在规定时间内进行垂直方向和水平方向的滚动,并且滚动到指定百分比位置上。 + @param anchor A point which will be clamp between cc.p(0,0) and cc.p(1,1). + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the percent position of ScrollView immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + + @example + ```js + // Vertical scroll to the bottom of the view. + scrollView.scrollTo(cc.p(0, 1), 0.1); + + // Horizontal scroll to view right. + scrollView.scrollTo(cc.p(1, 0), 0.1); + ``` + */ + scrollTo(anchor: Vec2, timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Scroll the content to the vertical percent position of ScrollView. + !#zh 视图内容在规定时间内滚动到 ScrollView 垂直方向的百分比位置上。 + @param percent A value between 0 and 1. + @param timeInSecond Scroll time in second, if you don't pass timeInSecond, + the content will jump to the vertical percent position of ScrollView immediately. + @param attenuated Whether the scroll acceleration attenuated, default is true. + // Scroll to middle position. + scrollView.scrollToPercentVertical(0.5, 0.1); + */ + scrollToPercentVertical(percent: number, timeInSecond?: number, attenuated?: boolean): void; + /** + !#en Stop auto scroll immediately + !#zh 停止自动滚动, 调用此 API 可以让 Scrollview 立即停止滚动 + */ + stopAutoScroll(): void; + /** + !#en Modify the content position. + !#zh 设置当前视图内容的坐标点。 + @param position The position in content's parent space. + */ + setContentPosition(position: Vec2): void; + /** + !#en Query the content's position in its parent space. + !#zh 获取当前视图内容的坐标点。 + */ + getContentPosition(): Position; + /** + !#en Query whether the user is currently dragging the ScrollView to scroll it + !#zh 用户是否在拖拽当前滚动视图 + */ + isScrolling(): boolean; + /** + !#en Query whether the ScrollView is currently scrolling because of a bounceback or inertia slowdown. + !#zh 当前滚动视图是否在惯性滚动 + */ + isAutoScrolling(): boolean; + } + /** !#en The Slider Control + !#zh 滑动器组件 */ + export class Slider extends Component { + /** !#en The "handle" part of the slider + !#zh 滑动器滑块按钮部件 */ + handle: Button; + /** !#en The slider direction + !#zh 滑动器方向 */ + direction: Slider.Direction; + /** !#en The current progress of the slider. The valid value is between 0-1 + !#zh 当前进度值,该数值的区间是 0-1 之间 */ + progress: number; + /** !#en The slider events callback + !#zh 滑动器组件事件回调函数 */ + slideEvents: Component.EventHandler[]; + } + /** !#en Renders a sprite in the scene. + !#zh 该组件用于在场景中渲染精灵。 */ + export class Sprite extends _RendererUnderSG { + /** !#en The sprite frame of the sprite. + !#zh 精灵的精灵帧 */ + spriteFrame: SpriteFrame; + /** !#en The sprite render type. + !#zh 精灵渲染类型 */ + type: Sprite.Type; + /** !#en + The fill type, This will only have any effect if the "type" is set to “cc.Sprite.Type.FILLED”. + !#zh + 精灵填充类型,仅渲染类型设置为 cc.Sprite.Type.FILLED 时有效。 */ + fillType: Sprite.FillType; + /** !#en + The fill Center, This will only have any effect if the "type" is set to “cc.Sprite.Type.FILLED”. + !#zh + 填充中心点,仅渲染类型设置为 cc.Sprite.Type.FILLED 时有效。 */ + fillCenter: Vec2; + /** !#en + The fill Start, This will only have any effect if the "type" is set to “cc.Sprite.Type.FILLED”. + !#zh + 填充起始点,仅渲染类型设置为 cc.Sprite.Type.FILLED 时有效。 */ + fillStart: number; + /** !#en + The fill Range, This will only have any effect if the "type" is set to “cc.Sprite.Type.FILLED”. + !#zh + 填充范围,仅渲染类型设置为 cc.Sprite.Type.FILLED 时有效。 */ + fillRange: number; + /** !#en specify the frame is trimmed or not. + !#zh 是否使用裁剪模式 */ + trim: boolean; + /** !#en specify the source Blend Factor. + !#zh 指定原图的混合模式 */ + srcBlendFactor: BlendFactor; + /** !#en specify the destination Blend Factor. + !#zh 指定目标的混合模式 */ + dstBlendFactor: BlendFactor; + /** !#en specify the size tracing mode. + !#zh 精灵尺寸调整模式 */ + sizeMode: Sprite.SizeMode; + /** + !#en Change the left sprite's cap inset. + !#zh 设置精灵左边框-用于九宫格。 + @param insetLeft The values to use for the cap inset. + + @example + ```js + sprite.setInsetLeft(5); + ``` + */ + setInsetLeft(insetLeft: number): void; + /** + !#en Query the left sprite's cap inset. + !#zh 获取精灵左边框 + + @example + ```js + var insetLeft = sprite.getInsetLeft(); + cc.log("Inset Left:" + insetLeft); + ``` + */ + getInsetLeft(): number; + /** + !#en Change the top sprite's cap inset. + !#zh 设置精灵上边框-用于九宫格。 + @param insetTop The values to use for the cap inset. + + @example + ```js + sprite.setInsetTop(5); + ``` + */ + setInsetTop(insetTop: number): void; + /** + !#en Query the top sprite's cap inset. + !#zh 获取精灵上边框。 + + @example + ```js + var insetTop = sprite.getInsetTop(); + cc.log("Inset Top:" + insetTop); + ``` + */ + getInsetTop(): number; + /** + !#en Change the right sprite's cap inset. + !#zh 设置精灵右边框-用于九宫格。 + @param insetRight The values to use for the cap inset. + + @example + ```js + sprite.setInsetRight(5); + ``` + */ + setInsetRight(insetRight: number): void; + /** + !#en Query the right sprite's cap inset. + !#zh 获取精灵右边框。 + + @example + ```js + var insetRight = sprite.getInsetRight(); + cc.log("Inset Right:" + insetRight); + ``` + */ + getInsetRight(): number; + /** + !#en Change the bottom sprite's cap inset. + !#zh 设置精灵下边框-用于九宫格。 + @param bottomInset The values to use for the cap inset. + + @example + ```js + sprite.setInsetBottom(5); + ``` + */ + setInsetBottom(bottomInset: number): void; + /** + !#en Query the bottom sprite's cap inset. + !#zh 获取精灵下边框。 + + @example + ```js + var insetBottom = sprite.getInsetBottom(); + cc.log("Inset Bottom:" + insetBottom); + ``` + */ + getInsetBottom(): number; + } + /** !#en A distortion used to change the rendering of simple sprite.If will take effect after sprite component is added. + !#zh 扭曲效果组件,用于改变SIMPLE类型sprite的渲染,只有当sprite组件已经添加后,才能起作用. */ + export class SpriteDistortion extends Component { + /** !#en Change the UV offset for distortion rendering. + !#zh 在渲染时改变UV的整体偏移. */ + offset: Vec2; + /** !#en Change the UV scale for distortion rendering. + !#zh 在渲染时改变UV的寻址系数 */ + tiling: Vec2; + } + /** !#en The toggle component is a CheckBox, when it used together with a ToggleGroup, it + could be treated as a RadioButton. + !#zh Toggle 是一个 CheckBox,当它和 ToggleGroup 一起使用的时候,可以变成 RadioButton。 */ + export class Toggle extends Button { + /** !#en When this value is true, the check mark component will be enabled, otherwise + the check mark component will be disabled. + !#zh 如果这个设置为 true,则 check mark 组件会处于 enabled 状态,否则处于 disabled 状态。 */ + isChecked: boolean; + /** !#en The toggle group which the toggle belongs to, when it is null, the toggle is a CheckBox. + Otherwise, the toggle is a RadioButton. + !#zh Toggle 所属的 ToggleGroup,这个属性是可选的。如果这个属性为 null,则 Toggle 是一个 CheckBox, + 否则,Toggle 是一个 RadioButton。 */ + toggleGroup: ToggleGroup; + /** !#en The image used for the checkmark. + !#zh Toggle 处于选中状态时显示的图片 */ + checkMark: Sprite; + /** !#en If Toggle is clicked, it will trigger event's handler + !#zh Toggle 按钮的点击事件列表。 */ + checkEvents: Component.EventHandler[]; + /** + !#en Make the toggle button checked. + !#zh 使 toggle 按钮处于选中状态 + */ + check(): void; + /** + !#en Make the toggle button unchecked. + !#zh 使 toggle 按钮处于未选中状态 + */ + uncheck(): void; + } + /** !#en ToggleContainer is not a visiable UI component but a way to modify the behavior of a set of Toggles.
+ Toggles that belong to the same group could only have one of them to be switched on at a time.
+ Note: All the first layer child node containing the toggle component will auto be added to the container + !#zh ToggleContainer 不是一个可见的 UI 组件,它可以用来修改一组 Toggle 组件的行为。
+ 当一组 Toggle 属于同一个 ToggleContainer 的时候,任何时候只能有一个 Toggle 处于选中状态。
+ 注意:所有包含 Toggle 组件的一级子节点都会自动被添加到该容器中 */ + export class ToggleContainer extends Component { + /** !#en If this setting is true, a toggle could be switched off and on when pressed. + If it is false, it will make sure there is always only one toggle could be switched on + and the already switched on toggle can't be switched off. + !#zh 如果这个设置为 true, 那么 toggle 按钮在被点击的时候可以反复地被选中和未选中。 */ + allowSwitchOff: boolean; + /** !#en Read only property, return the toggle items array reference managed by ToggleContainer. + !#zh 只读属性,返回 ToggleContainer 管理的 toggle 数组引用 */ + toggleItems: Toggle[]; + } + /** !#en ToggleGroup is not a visiable UI component but a way to modify the behavior of a set of Toggles. + Toggles that belong to the same group could only have one of them to be switched on at a time. + !#zh ToggleGroup 不是一个可见的 UI 组件,它可以用来修改一组 Toggle 组件的行为。当一组 Toggle 属于同一个 ToggleGroup 的时候, + 任何时候只能有一个 Toggle 处于选中状态。 */ + export class ToggleGroup extends Component { + /** !#en If this setting is true, a toggle could be switched off and on when pressed. + If it is false, it will make sure there is always only one toggle could be switched on + and the already switched on toggle can't be switched off. + !#zh 如果这个设置为 true, 那么 toggle 按钮在被点击的时候可以反复地被选中和未选中。 */ + allowSwitchOff: boolean; + /** !#en Read only property, return the toggle items array reference managed by toggleGroup. + !#zh 只读属性,返回 toggleGroup 管理的 toggle 数组引用 */ + toggleItems: any[]; + } + /** !#en cc.VideoPlayer is a component for playing videos, you can use it for showing videos in your game. + !#zh Video 组件,用于在游戏中播放视频 */ + export class VideoPlayer extends _RendererUnderSG { + /** !#en The resource type of videoplayer, REMOTE for remote url and LOCAL for local file path. + !#zh 视频来源:REMOTE 表示远程视频 URL,LOCAL 表示本地视频地址。 */ + resourceType: VideoPlayer.ResourceType; + /** !#en The remote URL of video. + !#zh 远程视频的 URL */ + remoteURL: string; + /** !#en The local video full path. + !#zh 本地视频的 URL */ + clip: string; + /** !#en The current playback time of the now playing item in seconds, you could also change the start playback time. + !#zh 指定视频从什么时间点开始播放,单位是秒,也可以用来获取当前视频播放的时间进度。 */ + currentTime: number; + /** !#en Whether keep the aspect ration of the original video. + !#zh 是否保持视频原来的宽高比 */ + keepAspectRatio: boolean; + /** !#en Whether play video in fullscreen mode. + !#zh 是否全屏播放视频 */ + isFullscreen: boolean; + /** !#en the video player's callback, it will be triggered when certain event occurs, like: playing, paused, stopped and completed. + !#zh 视频播放回调函数,该回调函数会在特定情况被触发,比如播放中,暂时,停止和完成播放。 */ + videoPlayerEvent: Component.EventHandler[]; + /** + !#en If a video is paused, call this method could resume playing. If a video is stopped, call this method to play from scratch. + !#zh 如果视频被暂停播放了,调用这个接口可以继续播放。如果视频被停止播放了,调用这个接口可以从头开始播放。 + */ + play(): void; + /** + !#en If a video is paused, call this method to resume playing. + !#zh 如果一个视频播放被暂停播放了,调用这个接口可以继续播放。 + */ + resume(): void; + /** + !#en If a video is playing, call this method to pause playing. + !#zh 如果一个视频正在播放,调用这个接口可以暂停播放。 + */ + pause(): void; + /** + !#en If a video is playing, call this method to stop playing immediately. + !#zh 如果一个视频正在播放,调用这个接口可以立马停止播放。 + */ + stop(): void; + /** + !#en Gets the duration of the video + !#zh 获取视频文件的播放总时长 + */ + getDuration(): number; + /** + !#en Determine whether video is playing or not. + !#zh 判断当前视频是否处于播放状态 + */ + isPlaying(): boolean; + /** + !#en if you don't need the VideoPlayer and it isn't in any running Scene, you should + call the destroy method on this component or the associated node explicitly. + Otherwise, the created DOM element won't be removed from web page. + !#zh + 如果你不再使用 VideoPlayer,并且组件未添加到场景中,那么你必须手动对组件或所在节点调用 destroy。 + 这样才能移除网页上的 DOM 节点,避免 Web 平台内存泄露。 + + @example + ```js + videoplayer.node.parent = null; // or videoplayer.node.removeFromParent(false); + // when you don't need videoplayer anymore + videoplayer.node.destroy(); + ``` + */ + destroy(): boolean; + } + /** !#en + Handling touch events in a ViewGroup takes special care, + because it's common for a ViewGroup to have children that are targets for different touch events than the ViewGroup itself. + To make sure that each view correctly receives the touch events intended for it, + ViewGroup should register capture phase event and handle the event propagation properly. + Please refer to Scrollview for more information. + + !#zh + ViewGroup的事件处理比较特殊,因为 ViewGroup 里面的子节点关心的事件跟 ViewGroup 本身可能不一样。 + 为了让子节点能够正确地处理事件,ViewGroup 需要注册 capture 阶段的事件,并且合理地处理 ViewGroup 之间的事件传递。 + 请参考 ScrollView 的实现来获取更多信息。 */ + export class ViewGroup extends Component { + } + /** !#en cc.WebView is a component for display web pages in the game + !#zh WebView 组件,用于在游戏中显示网页 */ + export class WebView extends _RendererUnderSG { + /** !#en A given URL to be loaded by the WebView, it should have a http or https prefix. + !#zh 指定 WebView 加载的网址,它应该是一个 http 或者 https 开头的字符串 */ + url: string; + /** !#en The webview's event callback , it will be triggered when certain webview event occurs. + !#zh WebView 的回调事件,当网页加载过程中,加载完成后或者加载出错时都会回调此函数 */ + webviewLoadedEvents: Component.EventHandler[]; + /** + !#en + Set javascript interface scheme (see also setOnJSCallback).
+ Note: Supports only on the Android and iOS. For HTML5, please refer to the official documentation.
+ Please refer to the official documentation for more details. + !#zh + 设置 JavaScript 接口方案(与 'setOnJSCallback' 配套使用)。
+ 注意:只支持 Android 和 iOS ,Web 端用法请前往官方文档查看。
+ 详情请参阅官方文档 + @param scheme scheme + */ + setJavascriptInterfaceScheme(scheme: string): void; + /** + !#en + This callback called when load URL that start with javascript + interface scheme (see also setJavascriptInterfaceScheme).
+ Note: Supports only on the Android and iOS. For HTML5, please refer to the official documentation.
+ Please refer to the official documentation for more details. + !#zh + 当加载 URL 以 JavaScript 接口方案开始时调用这个回调函数。
+ 注意:只支持 Android 和 iOS,Web 端用法请前往官方文档查看。 + 详情请参阅官方文档 + @param callback callback + */ + setOnJSCallback(callback: Function): void; + /** + !#en + Evaluates JavaScript in the context of the currently displayed page.
+ Please refer to the official document for more details
+ Note: Cross domain issues need to be resolved by yourself
+ !#zh + 执行 WebView 内部页面脚本(详情请参阅官方文档)
+ 注意:需要自行解决跨域问题 + @param str str + */ + evaluateJS(str: string): void; + /** + !#en if you don't need the WebView and it isn't in any running Scene, you should + call the destroy method on this component or the associated node explicitly. + Otherwise, the created DOM element won't be removed from web page. + !#zh + 如果你不再使用 WebView,并且组件未添加到场景中,那么你必须手动对组件或所在节点调用 destroy。 + 这样才能移除网页上的 DOM 节点,避免 Web 平台内存泄露。 + + @example + ```js + webview.node.parent = null; // or webview.node.removeFromParent(false); + // when you don't need webview anymore + webview.node.destroy(); + ``` + */ + destroy(): void; + } + /** !#en + Stores and manipulate the anchoring based on its parent. + Widget are used for GUI but can also be used for other things. + Widget will adjust current node's position and size automatically, but the results after adjustment can not be obtained until the next frame unless you call {{#crossLink "Widget/updateAlignment:method"}}{{/crossLink}} manually. + !#zh + Widget 组件,用于设置和适配其相对于父节点的边距,Widget 通常被用于 UI 界面,也可以用于其他地方。 + Widget 会自动调整当前节点的坐标和宽高,不过目前调整后的结果要到下一帧才能在脚本里获取到,除非你先手动调用 {{#crossLink "Widget/updateAlignment:method"}}{{/crossLink}}。 */ + export class Widget extends Component { + /** !#en Specifies an alignment target that can only be one of the parent nodes of the current node. + The default value is null, and when null, indicates the current parent. + !#zh 指定一个对齐目标,只能是当前节点的其中一个父节点,默认为空,为空时表示当前父节点。 */ + target: Node; + /** !#en Whether to align the top. + !#zh 是否对齐上边。 */ + isAlignTop: boolean; + /** !#en + Vertically aligns the midpoint, This will open the other vertical alignment options cancel. + !#zh + 是否垂直方向对齐中点,开启此项会将垂直方向其他对齐选项取消。 */ + isAlignVerticalCenter: boolean; + /** !#en Whether to align the bottom. + !#zh 是否对齐下边。 */ + isAlignBottom: boolean; + /** !#en Whether to align the left. + !#zh 是否对齐左边 */ + isAlignLeft: boolean; + /** !#en + Horizontal aligns the midpoint. This will open the other horizontal alignment options canceled. + !#zh + 是否水平方向对齐中点,开启此选项会将水平方向其他对齐选项取消。 */ + isAlignHorizontalCenter: boolean; + /** !#en Whether to align the right. + !#zh 是否对齐右边。 */ + isAlignRight: boolean; + /** !#en + Whether the stretched horizontally, when enable the left and right alignment will be stretched horizontally, + the width setting is invalid (read only). + !#zh + 当前是否水平拉伸。当同时启用左右对齐时,节点将会被水平拉伸,此时节点的宽度只读。 */ + isStretchWidth: boolean; + /** !#en + Whether the stretched vertically, when enable the left and right alignment will be stretched vertically, + then height setting is invalid (read only) + !#zh + 当前是否垂直拉伸。当同时启用上下对齐时,节点将会被垂直拉伸,此时节点的高度只读。 */ + isStretchHeight: boolean; + /** !#en + The margins between the top of this node and the top of parent node, + the value can be negative, Only available in 'isAlignTop' open. + !#zh + 本节点顶边和父节点顶边的距离,可填写负值,只有在 isAlignTop 开启时才有作用。 */ + top: number; + /** !#en + The margins between the bottom of this node and the bottom of parent node, + the value can be negative, Only available in 'isAlignBottom' open. + !#zh + 本节点底边和父节点底边的距离,可填写负值,只有在 isAlignBottom 开启时才有作用。 */ + bottom: number; + /** !#en + The margins between the left of this node and the left of parent node, + the value can be negative, Only available in 'isAlignLeft' open. + !#zh + 本节点左边和父节点左边的距离,可填写负值,只有在 isAlignLeft 开启时才有作用。 */ + left: number; + /** !#en + The margins between the right of this node and the right of parent node, + the value can be negative, Only available in 'isAlignRight' open. + !#zh + 本节点右边和父节点右边的距离,可填写负值,只有在 isAlignRight 开启时才有作用。 */ + right: number; + /** !#en + Horizontal aligns the midpoint offset value, + the value can be negative, Only available in 'isAlignHorizontalCenter' open. + !#zh 水平居中的偏移值,可填写负值,只有在 isAlignHorizontalCenter 开启时才有作用。 */ + horizontalCenter: number; + /** !#en + Vertical aligns the midpoint offset value, + the value can be negative, Only available in 'isAlignVerticalCenter' open. + !#zh 垂直居中的偏移值,可填写负值,只有在 isAlignVerticalCenter 开启时才有作用。 */ + verticalCenter: number; + /** !#en If true, horizontalCenter is pixel margin, otherwise is percentage (0 - 1) margin. + !#zh 如果为 true,"horizontalCenter" 将会以像素作为偏移值,反之为百分比(0 到 1)。 */ + isAbsoluteHorizontalCenter: boolean; + /** !#en If true, verticalCenter is pixel margin, otherwise is percentage (0 - 1) margin. + !#zh 如果为 true,"verticalCenter" 将会以像素作为偏移值,反之为百分比(0 到 1)。 */ + isAbsoluteVerticalCenter: boolean; + /** !#en + If true, top is pixel margin, otherwise is percentage (0 - 1) margin relative to the parent's height. + !#zh + 如果为 true,"top" 将会以像素作为边距,否则将会以相对父物体高度的百分比(0 到 1)作为边距。 */ + isAbsoluteTop: boolean; + /** !#en + If true, bottom is pixel margin, otherwise is percentage (0 - 1) margin relative to the parent's height. + !#zh + 如果为 true,"bottom" 将会以像素作为边距,否则将会以相对父物体高度的百分比(0 到 1)作为边距。 */ + isAbsoluteBottom: boolean; + /** !#en + If true, left is pixel margin, otherwise is percentage (0 - 1) margin relative to the parent's width. + !#zh + 如果为 true,"left" 将会以像素作为边距,否则将会以相对父物体宽度的百分比(0 到 1)作为边距。 */ + isAbsoluteLeft: boolean; + /** !#en + If true, right is pixel margin, otherwise is percentage (0 - 1) margin relative to the parent's width. + !#zh + 如果为 true,"right" 将会以像素作为边距,否则将会以相对父物体宽度的百分比(0 到 1)作为边距。 */ + isAbsoluteRight: boolean; + /** !#en TODO + !#zh + 开启后仅会在 onEnable 的当帧结束时对齐一次,然后立刻禁用当前组件。 + 这样便于脚本或动画继续控制当前节点。 + 注意:onEnable 时所在的那一帧仍然会进行对齐。 */ + isAlignOnce: boolean; + /** + !#en + Immediately perform the widget alignment. You need to manually call this method only if + you need to get the latest results after the alignment before the end of current frame. + !#zh + 立刻执行 widget 对齐操作。这个接口一般不需要手工调用。 + 只有当你需要在当前帧结束前获得 widget 对齐后的最新结果时才需要手动调用这个方法。 + + @example + ```js + widget.top = 10; // change top margin + cc.log(widget.node.y); // not yet changed + widget.updateAlignment(); + cc.log(widget.node.y); // changed + ``` + */ + updateAlignment(): void; + } + /** !#en + EventTarget is an object to which an event is dispatched when something has occurred. + Entity are the most common event targets, but other objects can be event targets too. + + Event targets are an important part of the Fireball event model. + The event target serves as the focal point for how events flow through the scene graph. + When an event such as a mouse click or a keypress occurs, Fireball dispatches an event object + into the event flow from the root of the hierarchy. The event object then makes its way through + the scene graph until it reaches the event target, at which point it begins its return trip through + the scene graph. This round-trip journey to the event target is conceptually divided into three phases: + - The capture phase comprises the journey from the root to the last node before the event target's node + - The target phase comprises only the event target node + - The bubbling phase comprises any subsequent nodes encountered on the return trip to the root of the tree + See also: http://www.w3.org/TR/DOM-Level-3-Events/#event-flow + + Event targets can implement the following methods: + - _getCapturingTargets + - _getBubblingTargets + + !#zh + 事件目标是事件触发时,分派的事件对象,Node 是最常见的事件目标, + 但是其他对象也可以是事件目标。
*/ + export class EventTarget { + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** !#en Base class of all kinds of events. + !#zh 包含事件相关信息的对象。 */ + export class Event { + /** + + @param type The name of the event (case-sensitive), e.g. "click", "fire", or "submit" + @param bubbles A boolean indicating whether the event bubbles up through the tree or not + */ + constructor(type: string, bubbles: boolean); + /** !#en The name of the event (case-sensitive), e.g. "click", "fire", or "submit". + !#zh 事件类型。 */ + type: string; + /** !#en Indicate whether the event bubbles up through the tree or not. + !#zh 表示该事件是否进行冒泡。 */ + bubbles: boolean; + /** !#en A reference to the target to which the event was originally dispatched. + !#zh 最初事件触发的目标 */ + target: any; + /** !#en A reference to the currently registered target for the event. + !#zh 当前目标 */ + currentTarget: any; + /** !#en + Indicates which phase of the event flow is currently being evaluated. + Returns an integer value represented by 4 constants: + - Event.NONE = 0 + - Event.CAPTURING_PHASE = 1 + - Event.AT_TARGET = 2 + - Event.BUBBLING_PHASE = 3 + The phases are explained in the [section 3.1, Event dispatch and DOM event flow] + (http://www.w3.org/TR/DOM-Level-3-Events/#event-flow), of the DOM Level 3 Events specification. + !#zh 事件阶段 */ + eventPhase: number; + /** + !#en Reset the event for being stored in the object pool. + !#zh 重置对象池中存储的事件。 + */ + unuse(): string; + /** + !#en Reuse the event for being used again by the object pool. + !#zh 用于对象池再次使用的事件。 + */ + reuse(): string; + /** + !#en Stops propagation for current event. + !#zh 停止传递当前事件。 + */ + stopPropagation(): void; + /** + !#en Stops propagation for current event immediately, + the event won't even be dispatched to the listeners attached in the current target. + !#zh 立即停止当前事件的传递,事件甚至不会被分派到所连接的当前目标。 + */ + stopPropagationImmediate(): void; + /** + !#en Checks whether the event has been stopped. + !#zh 检查该事件是否已经停止传递. + */ + isStopped(): boolean; + /** + !#en +

+ Gets current target of the event
+ note: It only be available when the event listener is associated with node.
+ It returns 0 when the listener is associated with fixed priority. +

+ !#zh 获取当前目标节点 + */ + getCurrentTarget(): Node; + /** + !#en Gets the event type. + !#zh 获取事件类型 + */ + getType(): string; + /** !#en Code for event without type. + !#zh 没有类型的事件 */ + static NO_TYPE: string; + /** !#en The type code of Touch event. + !#zh 触摸事件类型 */ + static TOUCH: string; + /** !#en The type code of Mouse event. + !#zh 鼠标事件类型 */ + static MOUSE: string; + /** !#en The type code of Keyboard event. + !#zh 键盘事件类型 */ + static KEYBOARD: string; + /** !#en The type code of Acceleration event. + !#zh 加速器事件类型 */ + static ACCELERATION: string; + /** !#en Events not currently dispatched are in this phase + !#zh 尚未派发事件阶段 */ + static NONE: number; + /** !#en + The capturing phase comprises the journey from the root to the last node before the event target's node + see http://www.w3.org/TR/DOM-Level-3-Events/#event-flow + !#zh 捕获阶段,包括事件目标节点之前从根节点到最后一个节点的过程。 */ + static CAPTURING_PHASE: number; + /** !#en + The target phase comprises only the event target node + see http://www.w3.org/TR/DOM-Level-3-Events/#event-flow + !#zh 目标阶段仅包括事件目标节点。 */ + static AT_TARGET: number; + /** !#en + The bubbling phase comprises any subsequent nodes encountered on the return trip to the root of the hierarchy + see http://www.w3.org/TR/DOM-Level-3-Events/#event-flow + !#zh 冒泡阶段, 包括回程遇到到层次根节点的任何后续节点。 */ + static BUBBLING_PHASE: number; + } + /** !#en The System event, it currently supports the key events and accelerometer events + !#zh 系统事件,它目前支持按键事件和重力感应事件 */ + export class SystemEvent extends EventTarget { + /** + !#en whether enable accelerometer event + !#zh 是否启用加速度计事件 + @param isEnable isEnable + */ + setAccelerometerEnabled(isEnable: boolean): void; + /** + !#en set accelerometer interval value + !#zh 设置加速度计间隔值 + @param interval interval + */ + setAccelerometerInterval(interval: number): void; + } + /** !#en +

+ The base class of event listener.
+ If you need custom listener which with different callback, you need to inherit this class.
+ For instance, you could refer to EventListenerAcceleration, EventListenerKeyboard,
+ EventListenerTouchOneByOne, EventListenerCustom. +

+ + !#zh + 封装用户的事件处理逻辑。 + 注意:这是一个抽象类,开发者不应该直接实例化这个类,请参考 {{#crossLink "EventListener/create:method"}}cc.EventListener.create{{/crossLink}}。 */ + export class EventListener { + /** + Constructor + @param type type + @param listenerID listenerID + @param callback callback + */ + constructor(type: number, listenerID: number, callback: number); + /** + !#en Checks whether the listener is available. + !#zh 检测监听器是否有效 + */ + checkAvailable(): boolean; + /** + !#en Clones the listener, its subclasses have to override this method. + !#zh 克隆监听器,它的子类必须重写此方法。 + */ + clone(): EventListener; + /** + !#en Enables or disables the listener + !#zh 启用或禁用监听器。 + @param enabled enabled + */ + setEnabled(enabled: boolean): void; + /** + !#en Checks whether the listener is enabled + !#zh 检查监听器是否可用。 + */ + isEnabled(): boolean; + /** !#en The type code of unknown event listener. + !#zh 未知的事件监听器类型 */ + static UNKNOWN: number; + /** !#en The type code of keyboard event listener. + !#zh 键盘事件监听器类型 */ + static KEYBOARD: number; + /** !#en The type code of acceleration event listener. + !#zh 加速器事件监听器类型 */ + static ACCELERATION: number; + /** + !#en + Create a EventListener object with configuration including the event type, handlers and other parameters. + In handlers, this refer to the event listener object itself. + You can also pass custom parameters in the configuration object, + all custom parameters will be polyfilled into the event listener object and can be accessed in handlers. + !#zh 通过指定不同的 Event 对象来设置想要创建的事件监听器。 + @param argObj a json object + + @example + ```js + // Create KEYBOARD EventListener. + cc.EventListener.create({ + event: cc.EventListener.KEYBOARD, + onKeyPressed: function (keyCode, event) { + cc.log('pressed key: ' + keyCode); + }, + onKeyReleased: function (keyCode, event) { + cc.log('released key: ' + keyCode); + } + }); + + // Create ACCELERATION EventListener. + cc.EventListener.create({ + event: cc.EventListener.ACCELERATION, + callback: function (acc, event) { + cc.log('acc: ' + keyCode); + } + }); + ``` + */ + static create(argObj: any): EventListener; + } + /** !#en + This class has been deprecated, please use cc.systemEvent or cc.EventTarget instead. See [Listen to and launch events](../../../manual/en/scripting/events.md) for details.
+
+ cc.eventManager is a singleton object which manages event listener subscriptions and event dispatching. + The EventListener list is managed in such way so that event listeners can be added and removed + while events are being dispatched. + + !#zh + 该类已废弃,请使用 cc.systemEvent 或 cc.EventTarget 代替,详见 [监听和发射事件](../../../manual/zh/scripting/events.md)。
+
+ 事件管理器,它主要管理事件监听器注册和派发系统事件。 */ + export class eventManager { + /** + !#en Pauses all listeners which are associated the specified target. + !#zh 暂停传入的 node 相关的所有监听器的事件响应。 + @param node node + @param recursive recursive + */ + static pauseTarget(node: Node, recursive?: boolean): void; + /** + !#en Resumes all listeners which are associated the specified target. + !#zh 恢复传入的 node 相关的所有监听器的事件响应。 + @param node node + @param recursive recursive + */ + static resumeTarget(node: Node, recursive?: boolean): void; + /** + !#en Query whether the specified event listener id has been added. + !#zh 查询指定的事件 ID 是否存在 + @param listenerID The listener id. + */ + static hasEventListener(listenerID: string|number): boolean; + /** + !#en +

+ Adds a event listener for a specified event.
+ if the parameter "nodeOrPriority" is a node, + it means to add a event listener for a specified event with the priority of scene graph.
+ if the parameter "nodeOrPriority" is a Number, + it means to add a event listener for a specified event with the fixed priority.
+

+ !#zh + 将事件监听器添加到事件管理器中。
+ 如果参数 “nodeOrPriority” 是节点,优先级由 node 的渲染顺序决定,显示在上层的节点将优先收到事件。
+ 如果参数 “nodeOrPriority” 是数字,优先级则固定为该参数的数值,数字越小,优先级越高。
+ @param listener The listener of a specified event or a object of some event parameters. + @param nodeOrPriority The priority of the listener is based on the draw order of this node or fixedPriority The fixed priority of the listener. + */ + static addListener(listener: EventListener|any, nodeOrPriority: Node|number): EventListener; + /** + !#en Remove a listener. + !#zh 移除一个已添加的监听器。 + @param listener an event listener or a registered node target + + @example + ```js + + // 1. remove eventManager add Listener; + var mouseListener1 = cc.eventManager.addListener({ + event: cc.EventListener.MOUSE, + onMouseDown: function(keyCode, event){ }, + onMouseUp: function(keyCode, event){ }, + onMouseMove: function () { }, + onMouseScroll: function () { } + }, node); + + cc.eventManager.removeListener(mouseListener1); + + // 2. remove eventListener create Listener; + var mouseListener2 = cc.EventListener.create({ + event: cc.EventListener.MOUSE, + onMouseDown: function(keyCode, event){ }, + onMouseUp: function(keyCode, event){ }, + onMouseMove: function () { }, + onMouseScroll: function () { } + }); + + cc.eventManager.removeListener(mouseListener2); + + ``` + */ + static removeListener(listener: EventListener): void; + /** + !#en Removes all listeners with the same event listener type or removes all listeners of a node. + !#zh + 移除注册到 eventManager 中指定类型的所有事件监听器。
+ 1. 如果传入的第一个参数类型是 Node,那么事件管理器将移除与该对象相关的所有事件监听器。 + (如果第二参数 recursive 是 true 的话,就会连同该对象的子控件上所有的事件监听器也一并移除)
+ 2. 如果传入的第一个参数类型是 Number(该类型 EventListener 中定义的事件类型), + 那么事件管理器将移除该类型的所有事件监听器。
+ + 下列是目前存在监听器类型:
+ cc.EventListener.UNKNOWN
+ cc.EventListener.KEYBOARD
+ cc.EventListener.ACCELERATION,
+ @param listenerType listenerType or a node + @param recursive recursive + */ + static removeListeners(listenerType: number|Node, recursive?: boolean): void; + /** + !#en Removes all listeners + !#zh 移除所有事件监听器。 + */ + static removeAllListeners(): void; + /** + !#en Sets listener's priority with fixed value. + !#zh 设置 FixedPriority 类型监听器的优先级。 + @param listener listener + @param fixedPriority fixedPriority + */ + static setPriority(listener: EventListener, fixedPriority: number): void; + /** + !#en Whether to enable dispatching events + !#zh 启用或禁用事件管理器,禁用后不会分发任何事件。 + @param enabled enabled + */ + static setEnabled(enabled: boolean): void; + /** + !#en Checks whether dispatching events is enabled + !#zh 检测事件管理器是否启用。 + */ + static isEnabled(): boolean; + } + /** !#en The touch event class + !#zh 封装了触摸相关的信息。 */ + export class Touch { + /** + !#en Returns the current touch location in OpenGL coordinates.、 + !#zh 获取当前触点位置。 + */ + getLocation(): Vec2; + /** + !#en Returns X axis location value. + !#zh 获取当前触点 X 轴位置。 + */ + getLocationX(): number; + /** + !#en Returns Y axis location value. + !#zh 获取当前触点 Y 轴位置。 + */ + getLocationY(): number; + /** + !#en Returns the previous touch location in OpenGL coordinates. + !#zh 获取触点在上一次事件时的位置对象,对象包含 x 和 y 属性。 + */ + getPreviousLocation(): Vec2; + /** + !#en Returns the start touch location in OpenGL coordinates. + !#zh 获获取触点落下时的位置对象,对象包含 x 和 y 属性。 + */ + getStartLocation(): Vec2; + /** + !#en Returns the delta distance from the previous touche to the current one in screen coordinates. + !#zh 获取触点距离上一次事件移动的距离对象,对象包含 x 和 y 属性。 + */ + getDelta(): Vec2; + /** + !#en Returns the current touch location in screen coordinates. + !#zh 获取当前事件在游戏窗口内的坐标位置对象,对象包含 x 和 y 属性。 + */ + getLocationInView(): Vec2; + /** + !#en Returns the previous touch location in screen coordinates. + !#zh 获取触点在上一次事件时在游戏窗口中的位置对象,对象包含 x 和 y 属性。 + */ + getPreviousLocationInView(): Vec2; + /** + !#en Returns the start touch location in screen coordinates. + !#zh 获取触点落下时在游戏窗口中的位置对象,对象包含 x 和 y 属性。 + */ + getStartLocationInView(): Vec2; + /** + !#en Returns the id of cc.Touch. + !#zh 触点的标识 ID,可以用来在多点触摸中跟踪触点。 + */ + getID(): number; + /** + !#en Sets information to touch. + !#zh 设置触摸相关的信息。用于监控触摸事件。 + @param id id + @param x x + @param y y + */ + setTouchInfo(id: number, x: number, y: number): void; + } + /** undefined */ + export class Graphics extends _RendererUnderSG { + /** !#en + Current line width. + !#zh + 当前线条宽度 */ + lineWidth: number; + /** !#en + lineJoin determines how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together. + !#zh + lineJoin 用来设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性。 */ + lineJoin: Graphics.LineJoin; + /** !#en + lineCap determines how the end points of every line are drawn. + !#zh + lineCap 指定如何绘制每一条线段末端。 */ + lineCap: Graphics.LineCap; + /** !#en + stroke color + !#zh + 线段颜色 */ + strokeColor: Color; + /** !#en + fill color + !#zh + 填充颜色 */ + fillColor: Color; + /** !#en + Sets the miter limit ratio + !#zh + 设置斜接面限制比例 */ + miterLimit: number; + /** + !#en Move path start point to (x,y). + !#zh 移动路径起点到坐标(x, y) + @param x The x axis of the coordinate for the end point. + @param y The y axis of the coordinate for the end point. + */ + moveTo(x?: number, y?: number): void; + /** + !#en Adds a straight line to the path + !#zh 绘制直线路径 + @param x The x axis of the coordinate for the end point. + @param y The y axis of the coordinate for the end point. + */ + lineTo(x?: number, y?: number): void; + /** + !#en Adds a cubic Bézier curve to the path + !#zh 绘制三次贝赛尔曲线路径 + @param c1x The x axis of the coordinate for the first control point. + @param c1y The y axis of the coordinate for first control point. + @param c2x The x axis of the coordinate for the second control point. + @param c2y The y axis of the coordinate for the second control point. + @param x The x axis of the coordinate for the end point. + @param y The y axis of the coordinate for the end point. + */ + bezierCurveTo(c1x?: number, c1y?: number, c2x?: number, c2y?: number, x?: number, y?: number): void; + /** + !#en Adds a quadratic Bézier curve to the path + !#zh 绘制二次贝赛尔曲线路径 + @param cx The x axis of the coordinate for the control point. + @param cy The y axis of the coordinate for the control point. + @param x The x axis of the coordinate for the end point. + @param y The y axis of the coordinate for the end point. + */ + quadraticCurveTo(cx?: number, cy?: number, x?: number, y?: number): void; + /** + !#en Adds an arc to the path which is centered at (cx, cy) position with radius r starting at startAngle and ending at endAngle going in the given direction by counterclockwise (defaulting to false). + !#zh 绘制圆弧路径。圆弧路径的圆心在 (cx, cy) 位置,半径为 r ,根据 counterclockwise (默认为false)指定的方向从 startAngle 开始绘制,到 endAngle 结束。 + @param cx The x axis of the coordinate for the center point. + @param cy The y axis of the coordinate for the center point. + @param r The arc's radius. + @param startAngle The angle at which the arc starts, measured clockwise from the positive x axis and expressed in radians. + @param endAngle The angle at which the arc ends, measured clockwise from the positive x axis and expressed in radians. + @param counterclockwise An optional Boolean which, if true, causes the arc to be drawn counter-clockwise between the two angles. By default it is drawn clockwise. + */ + arc(cx?: number, cy?: number, r?: number, startAngle?: number, endAngle?: number, counterclockwise?: number): void; + /** + !#en Adds an ellipse to the path. + !#zh 绘制椭圆路径。 + @param cx The x axis of the coordinate for the center point. + @param cy The y axis of the coordinate for the center point. + @param rx The ellipse's x-axis radius. + @param ry The ellipse's y-axis radius. + */ + ellipse(cx?: number, cy?: number, rx?: number, ry?: number): void; + /** + !#en Adds an circle to the path. + !#zh 绘制圆形路径。 + @param cx The x axis of the coordinate for the center point. + @param cy The y axis of the coordinate for the center point. + @param r The circle's radius. + */ + circle(cx?: number, cy?: number, r?: number): void; + /** + !#en Adds an rectangle to the path. + !#zh 绘制矩形路径。 + @param x The x axis of the coordinate for the rectangle starting point. + @param y The y axis of the coordinate for the rectangle starting point. + @param w The rectangle's width. + @param h The rectangle's height. + */ + rect(x?: number, y?: number, w?: number, h?: number): void; + /** + !#en Adds an round corner rectangle to the path. + !#zh 绘制圆角矩形路径。 + @param x The x axis of the coordinate for the rectangle starting point. + @param y The y axis of the coordinate for the rectangle starting point. + @param w The rectangles width. + @param h The rectangle's height. + @param r The radius of the rectangle. + */ + roundRect(x?: number, y?: number, w?: number, h?: number, r?: number): void; + /** + !#en Draws a filled rectangle. + !#zh 绘制填充矩形。 + @param x The x axis of the coordinate for the rectangle starting point. + @param y The y axis of the coordinate for the rectangle starting point. + @param w The rectangle's width. + @param h The rectangle's height. + */ + fillRect(x?: number, y?: number, w?: number, h?: number): void; + /** + !#en Erasing any previously drawn content. + !#zh 擦除之前绘制的所有内容的方法。 + @param clean Whether to clean the graphics inner cache. + */ + clear(clean?: boolean): void; + /** + !#en Causes the point of the pen to move back to the start of the current path. It tries to add a straight line from the current point to the start. + !#zh 将笔点返回到当前路径起始点的。它尝试从当前点到起始点绘制一条直线。 + */ + close(): void; + /** + !#en Strokes the current or given path with the current stroke style. + !#zh 根据当前的画线样式,绘制当前或已经存在的路径。 + */ + stroke(): void; + /** + !#en Fills the current or given path with the current fill style. + !#zh 根据当前的画线样式,填充当前或已经存在的路径。 + */ + fill(): void; + } + /** Loader for resource loading process. It's a singleton object. */ + export class loader extends Pipeline { + /** The asset loader in cc.loader's pipeline, it's by default the first pipe. + It's used to identify an asset's type, and determine how to download it. */ + static assetLoader: any; + /** The downloader in cc.loader's pipeline, it's by default the second pipe. + It's used to download files with several handlers: pure text, image, script, audio, font, uuid. + You can add your own download function with addDownloadHandlers */ + static downloader: any; + /** The downloader in cc.loader's pipeline, it's by default the third pipe. + It's used to parse downloaded content with several handlers: JSON, image, plist, fnt, uuid. + You can add your own download function with addLoadHandlers */ + static loader: any; + /** + Gets a new XMLHttpRequest instance. + */ + static getXMLHttpRequest(): XMLHttpRequest; + /** + Add custom supported types handler or modify existing type handler for download process. + @param extMap Custom supported types with corresponded handler + + @example + ```js + cc.loader.addDownloadHandlers({ + // This will match all url with `.scene` extension or all url with `scene` type + 'scene' : function (url, callback) {} + }); + ``` + */ + static addDownloadHandlers(extMap: any): void; + /** + Add custom supported types handler or modify existing type handler for load process. + @param extMap Custom supported types with corresponded handler + + @example + ```js + cc.loader.addLoadHandlers({ + // This will match all url with `.scene` extension or all url with `scene` type + 'scene' : function (url, callback) {} + }); + ``` + */ + static addLoadHandlers(extMap: any): void; + /** + Load resources with a progression callback and a complete callback. + The progression callback is the same as Pipeline's {{#crossLink "LoadingItems/onProgress:method"}}onProgress{{/crossLink}} + The complete callback is almost the same as Pipeline's {{#crossLink "LoadingItems/onComplete:method"}}onComplete{{/crossLink}} + The only difference is when user pass a single url as resources, the complete callback will set its result directly as the second parameter. + @param resources Url list in an array + @param progressCallback Callback invoked when progression change + @param completeCallback Callback invoked when all resources loaded + + @example + ```js + cc.loader.load('a.png', function (err, tex) { + cc.log('Result should be a texture: ' + (tex instanceof cc.Texture2D)); + }); + + cc.loader.load('http://example.com/a.png', function (err, tex) { + cc.log('Should load a texture from external url: ' + (tex instanceof cc.Texture2D)); + }); + + cc.loader.load({url: 'http://example.com/getImageREST?file=a.png', type: 'png'}, function (err, tex) { + cc.log('Should load a texture from RESTful API by specify the type: ' + (tex instanceof cc.Texture2D)); + }); + + cc.loader.load(['a.png', 'b.json'], function (errors, results) { + if (errors) { + for (var i = 0; i < errors.length; i++) { + cc.log('Error url [' + errors[i] + ']: ' + results.getError(errors[i])); + } + } + var aTex = results.getContent('a.png'); + var bJsonObj = results.getContent('b.json'); + }); + ``` + */ + static load(resources: string|string[]|{uuid?: string, url?: string, type?: string}, completeCallback?: Function): void; + static load(resources: string|string[]|{uuid?: string, url?: string, type?: string}, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: Function|null): void; + /** + Load resources from the "resources" folder inside the "assets" folder of your project.
+
+ Note: All asset URLs in Creator use forward slashes, URLs using backslashes will not work. + @param url Url of the target resource. + The url is relative to the "resources" folder, extensions must be omitted. + @param type Only asset of type will be loaded if this argument is supplied. + @param progressCallback Callback invoked when progression change. + @param completeCallback Callback invoked when the resource loaded. + + @example + ```js + // load the prefab (project/assets/resources/misc/character/cocos) from resources folder + cc.loader.loadRes('misc/character/cocos', function (err, prefab) { + if (err) { + cc.error(err.message || err); + return; + } + cc.log('Result should be a prefab: ' + (prefab instanceof cc.Prefab)); + }); + + // load the sprite frame of (project/assets/resources/imgs/cocos.png) from resources folder + cc.loader.loadRes('imgs/cocos', cc.SpriteFrame, function (err, spriteFrame) { + if (err) { + cc.error(err.message || err); + return; + } + cc.log('Result should be a sprite frame: ' + (spriteFrame instanceof cc.SpriteFrame)); + }); + ``` + */ + static loadRes(url: string, type: typeof cc.Asset, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any) => void)|null): void; + static loadRes(url: string, type: typeof cc.Asset, completeCallback: (error: Error, resource: any) => void): void; + static loadRes(url: string, type: typeof cc.Asset): void; + static loadRes(url: string, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any) => void)|null): void; + static loadRes(url: string, completeCallback: (error: Error, resource: any) => void): void; + static loadRes(url: string): void; + /** + This method is like {{#crossLink "loader/loadRes:method"}}{{/crossLink}} except that it accepts array of url. + @param urls Array of URLs of the target resource. + The url is relative to the "resources" folder, extensions must be omitted. + @param type Only asset of type will be loaded if this argument is supplied. + @param progressCallback Callback invoked when progression change. + @param completeCallback A callback which is called when all assets have been loaded, or an error occurs. + + @example + ```js + // load the SpriteFrames from resources folder + var spriteFrames; + var urls = ['misc/characters/character_01', 'misc/weapons/weapons_01']; + cc.loader.loadResArray(urls, cc.SpriteFrame, function (err, assets) { + if (err) { + cc.error(err); + return; + } + spriteFrames = assets; + // ... + }); + ``` + */ + static loadResArray(url: string[], type: typeof cc.Asset, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[]) => void)|null): void; + static loadResArray(url: string[], type: typeof cc.Asset, completeCallback: (error: Error, resource: any[]) => void): void; + static loadResArray(url: string[], type: typeof cc.Asset): void; + static loadResArray(url: string[], progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[]) => void)|null): void; + static loadResArray(url: string[], completeCallback: (error: Error, resource: any[]) => void): void; + static loadResArray(url: string[]): void; + /** + Load all assets in a folder inside the "assets/resources" folder of your project.
+
+ Note: All asset URLs in Creator use forward slashes, URLs using backslashes will not work. + @param url Url of the target folder. + The url is relative to the "resources" folder, extensions must be omitted. + @param type Only asset of type will be loaded if this argument is supplied. + @param progressCallback Callback invoked when progression change. + @param completeCallback A callback which is called when all assets have been loaded, or an error occurs. + + @example + ```js + // load the texture (resources/imgs/cocos.png) and the corresponding sprite frame + cc.loader.loadResDir('imgs/cocos', function (err, assets) { + if (err) { + cc.error(err); + return; + } + var texture = assets[0]; + var spriteFrame = assets[1]; + }); + + // load all textures in "resources/imgs/" + cc.loader.loadResDir('imgs', cc.Texture2D, function (err, textures) { + var texture1 = textures[0]; + var texture2 = textures[1]; + }); + + // load all JSONs in "resources/data/" + cc.loader.loadResDir('data', function (err, objects, urls) { + var data = objects[0]; + var url = urls[0]; + }); + ``` + */ + static loadResDir(url: string, type: typeof cc.Asset, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[], urls: string[]) => void)|null): void; + static loadResDir(url: string, type: typeof cc.Asset, completeCallback: (error: Error, resource: any[], urls: string[]) => void): void; + static loadResDir(url: string, type: typeof cc.Asset): void; + static loadResDir(url: string, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[], urls: string[]) => void)|null): void; + static loadResDir(url: string, completeCallback: (error: Error, resource: any[], urls: string[]) => void): void; + static loadResDir(url: string): void; + /** + Get resource data by id.
+ When you load resources with {{#crossLink "loader/load:method"}}{{/crossLink}} or {{#crossLink "loader/loadRes:method"}}{{/crossLink}}, + the url will be the unique identity of the resource. + After loaded, you can acquire them by passing the url to this API. + @param url url + @param type Only asset of type will be returned if this argument is supplied. + */ + static getRes(url: string, type?: Function): any; + /** + !#en Get all resource dependencies of the requested asset in an array, including itself. + The owner parameter accept the following types: 1. The asset itself; 2. The resource url; 3. The asset's uuid.
+ The returned array stores the dependencies with their uuids, after retrieve dependencies, + you can release them, access dependent assets by passing the uuid to {{#crossLink "loader/getRes:method"}}{{/crossLink}}, or other stuffs you want.
+ For release all dependencies of an asset, please refer to {{#crossLink "loader/release:method"}}{{/crossLink}} + Here is some examples: + !#zh 获取一个指定资源的所有依赖资源,包含它自身,并保存在数组中返回。owner 参数接收以下几种类型:1. 资源 asset 对象;2. 资源目录下的 url;3. 资源的 uuid。
+ 返回的数组将仅保存依赖资源的 uuid,获取这些 uuid 后,你可以从 loader 释放这些资源;通过 {{#crossLink "loader/getRes:method"}}{{/crossLink}} 获取某个资源或者进行其他你需要的操作。
+ 想要释放一个资源及其依赖资源,可以参考 {{#crossLink "loader/release:method"}}{{/crossLink}}。下面是一些示例代码: + @param owner The owner asset or the resource url or the asset's uuid + + @example + ```js + // Release all dependencies of a loaded prefab + var deps = cc.loader.getDependsRecursively(prefab); + cc.loader.release(deps); + // Retrieve all dependent textures + var deps = cc.loader.getDependsRecursively('prefabs/sample'); + var textures = []; + for (var i = 0; i < deps.length; ++i) { + var item = cc.loader.getRes(deps[i]); + if (item instanceof cc.Texture2D) { + textures.push(item); + } + } + ``` + */ + static getDependsRecursively(owner: Asset|RawAsset|string): any[]; + /** + !#en + Release the content of an asset or an array of assets by uuid. + Start from v1.3, this method will not only remove the cache of the asset in loader, but also clean up its content. + For example, if you release a texture, the texture asset and its gl texture data will be freed up. + In complexe project, you can use this function with {{#crossLink "loader/getDependsRecursively:method"}}{{/crossLink}} to free up memory in critical circumstances. + Notice, this method may cause the texture to be unusable, if there are still other nodes use the same texture, they may turn to black and report gl errors. + If you only want to remove the cache of an asset, please use {{#crossLink "pipeline/removeItem:method"}}{{/crossLink}} + !#zh + 通过 id(通常是资源 url)来释放一个资源或者一个资源数组。 + 从 v1.3 开始,这个方法不仅会从 loader 中删除资源的缓存引用,还会清理它的资源内容。 + 比如说,当你释放一个 texture 资源,这个 texture 和它的 gl 贴图数据都会被释放。 + 在复杂项目中,我们建议你结合 {{#crossLink "loader/getDependsRecursively:method"}}{{/crossLink}} 来使用,便于在设备内存告急的情况下更快地释放不再需要的资源的内存。 + 注意,这个函数可能会导致资源贴图或资源所依赖的贴图不可用,如果场景中存在节点仍然依赖同样的贴图,它们可能会变黑并报 GL 错误。 + 如果你只想删除一个资源的缓存引用,请使用 {{#crossLink "pipeline/removeItem:method"}}{{/crossLink}} + @param asset asset + + @example + ```js + // Release a texture which is no longer need + cc.loader.release(texture); + // Release all dependencies of a loaded prefab + var deps = cc.loader.getDependsRecursively('prefabs/sample'); + cc.loader.release(deps); + // If there is no instance of this prefab in the scene, the prefab and its dependencies like textures, sprite frames, etc, will be freed up. + // If you have some other nodes share a texture in this prefab, you can skip it in two ways: + // 1. Forbid auto release a texture before release + cc.loader.setAutoRelease(texture2d, false); + // 2. Remove it from the dependencies array + var deps = cc.loader.getDependsRecursively('prefabs/sample'); + var index = deps.indexOf(texture2d._uuid); + if (index !== -1) + deps.splice(index, 1); + cc.loader.release(deps); + ``` + */ + static release(asset: Asset|RawAsset|string|any[]): void; + /** + !#en Release the asset by its object. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations. + !#zh 通过资源对象自身来释放资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}} + @param asset asset + */ + static releaseAsset(asset: Asset): void; + /** + !#en Release the asset loaded by {{#crossLink "loader/loadRes:method"}}{{/crossLink}}. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations. + !#zh 释放通过 {{#crossLink "loader/loadRes:method"}}{{/crossLink}} 加载的资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}} + @param url url + @param type Only asset of type will be released if this argument is supplied. + */ + static releaseRes(url: string, type?: Function): void; + /** + !#en Release the all assets loaded by {{#crossLink "loader/loadResDir:method"}}{{/crossLink}}. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations. + !#zh 释放通过 {{#crossLink "loader/loadResDir:method"}}{{/crossLink}} 加载的资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}} + @param url url + @param type Only asset of type will be released if this argument is supplied. + */ + static releaseResDir(url: string, type?: Function): void; + /** + !#en Resource all assets. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations. + !#zh 释放所有资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}} + */ + static releaseAll(): void; + /** + !#en + Indicates whether to release the asset when loading a new scene.
+ By default, when loading a new scene, all assets in the previous scene will be released or preserved + according to whether the previous scene checked the "Auto Release Assets" option. + On the other hand, assets dynamically loaded by using `cc.loader.loadRes` or `cc.loader.loadResDir` + will not be affected by that option, remain not released by default.
+ Use this API to change the default behavior on a single asset, to force preserve or release specified asset when scene switching.
+
+ See: {{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}}, {{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}} + !#zh + 设置当场景切换时是否自动释放资源。
+ 默认情况下,当加载新场景时,旧场景的资源根据旧场景是否勾选“Auto Release Assets”,将会被释放或者保留。 + 而使用 `cc.loader.loadRes` 或 `cc.loader.loadResDir` 动态加载的资源,则不受场景设置的影响,默认不自动释放。
+ 使用这个 API 可以在单个资源上改变这个默认行为,强制在切换场景时保留或者释放指定资源。
+
+ 参考:{{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}},{{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}} + @param assetOrUrlOrUuid asset object or the raw asset's url or uuid + @param autoRelease indicates whether should release automatically + + @example + ```js + // auto release the texture event if "Auto Release Assets" disabled in current scene + cc.loader.setAutoRelease(texture2d, true); + // don't release the texture even if "Auto Release Assets" enabled in current scene + cc.loader.setAutoRelease(texture2d, false); + // first parameter can be url + cc.loader.setAutoRelease(audioUrl, false); + ``` + */ + static setAutoRelease(assetOrUrlOrUuid: Asset|string, autoRelease: boolean): void; + /** + !#en + Indicates whether to release the asset and its referenced other assets when loading a new scene.
+ By default, when loading a new scene, all assets in the previous scene will be released or preserved + according to whether the previous scene checked the "Auto Release Assets" option. + On the other hand, assets dynamically loaded by using `cc.loader.loadRes` or `cc.loader.loadResDir` + will not be affected by that option, remain not released by default.
+ Use this API to change the default behavior on the specified asset and its recursively referenced assets, to force preserve or release specified asset when scene switching.
+
+ See: {{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}}, {{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}} + !#zh + 设置当场景切换时是否自动释放资源及资源引用的其它资源。
+ 默认情况下,当加载新场景时,旧场景的资源根据旧场景是否勾选“Auto Release Assets”,将会被释放或者保留。 + 而使用 `cc.loader.loadRes` 或 `cc.loader.loadResDir` 动态加载的资源,则不受场景设置的影响,默认不自动释放。
+ 使用这个 API 可以在指定资源及资源递归引用到的所有资源上改变这个默认行为,强制在切换场景时保留或者释放指定资源。
+
+ 参考:{{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}},{{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}} + @param assetOrUrlOrUuid asset object or the raw asset's url or uuid + @param autoRelease indicates whether should release automatically + + @example + ```js + // auto release the SpriteFrame and its Texture event if "Auto Release Assets" disabled in current scene + cc.loader.setAutoReleaseRecursively(spriteFrame, true); + // don't release the SpriteFrame and its Texture even if "Auto Release Assets" enabled in current scene + cc.loader.setAutoReleaseRecursively(spriteFrame, false); + // don't release the Prefab and all the referenced assets + cc.loader.setAutoReleaseRecursively(prefab, false); + ``` + */ + static setAutoReleaseRecursively(assetOrUrlOrUuid: Asset|string, autoRelease: boolean): void; + /** + !#en + Returns whether the asset is configured as auto released, despite how "Auto Release Assets" property is set on scene asset.
+
+ See: {{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}}, {{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}} + + !#zh + 返回指定的资源是否有被设置为自动释放,不论场景的“Auto Release Assets”如何设置。
+
+ 参考:{{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}},{{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}} + @param assetOrUrl asset object or the raw asset's url + */ + static isAutoRelease(assetOrUrl: Asset|string): boolean; + } + /** !#en + LoadingItems is the queue of items which can flow them into the loading pipeline.
+ Please don't construct it directly, use {{#crossLink "LoadingItems.create"}}cc.LoadingItems.create{{/crossLink}} instead, because we use an internal pool to recycle the queues.
+ It hold a map of items, each entry in the map is a url to object key value pair.
+ Each item always contains the following property:
+ - id: The identification of the item, usually it's identical to url
+ - url: The url
+ - type: The type, it's the extension name of the url by default, could be specified manually too.
+ - error: The error happened in pipeline will be stored in this property.
+ - content: The content processed by the pipeline, the final result will also be stored in this property.
+ - complete: The flag indicate whether the item is completed by the pipeline.
+ - states: An object stores the states of each pipe the item go through, the state can be: Pipeline.ItemState.WORKING | Pipeline.ItemState.ERROR | Pipeline.ItemState.COMPLETE
+
+ Item can hold other custom properties.
+ Each LoadingItems object will be destroyed for recycle after onComplete callback
+ So please don't hold its reference for later usage, you can copy properties in it though. + !#zh + LoadingItems 是一个加载对象队列,可以用来输送加载对象到加载管线中。
+ 请不要直接使用 new 构造这个类的对象,你可以使用 {{#crossLink "LoadingItems.create"}}cc.LoadingItems.create{{/crossLink}} 来创建一个新的加载队列,这样可以允许我们的内部对象池回收并重利用加载队列。 + 它有一个 map 属性用来存放加载项,在 map 对象中已 url 为 key 值。
+ 每个对象都会包含下列属性:
+ - id:该对象的标识,通常与 url 相同。
+ - url:路径
+ - type: 类型,它这是默认的 URL 的扩展名,可以手动指定赋值。
+ - error:pipeline 中发生的错误将被保存在这个属性中。
+ - content: pipeline 中处理的临时结果,最终的结果也将被存储在这个属性中。
+ - complete:该标志表明该对象是否通过 pipeline 完成。
+ - states:该对象存储每个管道中对象经历的状态,状态可以是 Pipeline.ItemState.WORKING | Pipeline.ItemState.ERROR | Pipeline.ItemState.COMPLETE
+
+ 对象可容纳其他自定义属性。
+ 每个 LoadingItems 对象都会在 onComplete 回调之后被销毁,所以请不要持有它的引用并在结束回调之后依赖它的内容执行任何逻辑,有这种需求的话你可以提前复制它的内容。 */ + export class LoadingItems extends CallbacksInvoker { + /** + !#en This is a callback which will be invoked while an item flow out the pipeline. + You can pass the callback function in LoadingItems.create or set it later. + !#zh 这个回调函数将在 item 加载结束后被调用。你可以在构造时传递这个回调函数或者是在构造之后直接设置。 + @param completedCount The number of the items that are already completed. + @param totalCount The total number of the items. + @param item The latest item which flow out the pipeline. + + @example + ```js + loadingItems.onProgress = function (completedCount, totalCount, item) { + var progress = (100 * completedCount / totalCount).toFixed(2); + cc.log(progress + '%'); + } + ``` + */ + onProgress(completedCount: number, totalCount: number, item: any): void; + /** + !#en This is a callback which will be invoked while all items is completed, + You can pass the callback function in LoadingItems.create or set it later. + !#zh 该函数将在加载队列全部完成时被调用。你可以在构造时传递这个回调函数或者是在构造之后直接设置。 + @param errors All errored urls will be stored in this array, if no error happened, then it will be null + @param items All items. + + @example + ```js + loadingItems.onComplete = function (errors, items) { + if (error) + cc.log('Completed with ' + errors.length + ' errors'); + else + cc.log('Completed ' + items.totalCount + ' items'); + } + ``` + */ + onComplete(errors: any[], items: LoadingItems): void; + /** !#en The map of all items. + !#zh 存储所有加载项的对象。 */ + map: any; + /** !#en The map of completed items. + !#zh 存储已经完成的加载项。 */ + completed: any; + /** !#en Total count of all items. + !#zh 所有加载项的总数。 */ + totalCount: number; + /** !#en Total count of completed items. + !#zh 所有完成加载项的总数。 */ + completedCount: number; + /** !#en Activated or not. + !#zh 是否启用。 */ + active: boolean; + /** + !#en The constructor function of LoadingItems, this will use recycled LoadingItems in the internal pool if possible. + You can pass onProgress and onComplete callbacks to visualize the loading process. + !#zh LoadingItems 的构造函数,这种构造方式会重用内部对象缓冲池中的 LoadingItems 队列,以尽量避免对象创建。 + 你可以传递 onProgress 和 onComplete 回调函数来获知加载进度信息。 + @param pipeline The pipeline to process the queue. + @param urlList The items array. + @param onProgress The progression callback, refer to {{#crossLink "LoadingItems.onProgress"}}{{/crossLink}} + @param onComplete The completion callback, refer to {{#crossLink "LoadingItems.onComplete"}}{{/crossLink}} + + @example + ```js + cc.LoadingItems.create(cc.loader, ['a.png', 'b.plist'], function (completedCount, totalCount, item) { + var progress = (100 * completedCount / totalCount).toFixed(2); + cc.log(progress + '%'); + }, function (errors, items) { + if (errors) { + for (var i = 0; i < errors.length; ++i) { + cc.log('Error url: ' + errors[i] + ', error: ' + items.getError(errors[i])); + } + } + else { + var result_a = items.getContent('a.png'); + // ... + } + }) + ``` + */ + static create(pipeline: Pipeline, urlList: any[], onProgress: Function, onComplete: Function): LoadingItems; + /** + !#en Retrieve the LoadingItems queue object for an item. + !#zh 通过 item 对象获取它的 LoadingItems 队列。 + @param item The item to query + */ + static getQueue(item: any): LoadingItems; + /** + !#en Complete an item in the LoadingItems queue, please do not call this method unless you know what's happening. + !#zh 通知 LoadingItems 队列一个 item 对象已完成,请不要调用这个函数,除非你知道自己在做什么。 + @param item The item which has completed + */ + static itemComplete(item: any): void; + /** + !#en Add urls to the LoadingItems queue. + !#zh 向一个 LoadingItems 队列添加加载项。 + @param urlList The url list to be appended, the url can be object or string + */ + append(urlList: any[]): any[]; + /** + !#en Complete a LoadingItems queue, please do not call this method unless you know what's happening. + !#zh 完成一个 LoadingItems 队列,请不要调用这个函数,除非你知道自己在做什么。 + */ + allComplete(): void; + /** + !#en Check whether all items are completed. + !#zh 检查是否所有加载项都已经完成。 + */ + isCompleted(): boolean; + /** + !#en Check whether an item is completed. + !#zh 通过 id 检查指定加载项是否已经加载完成。 + @param id The item's id. + */ + isItemCompleted(id: string): boolean; + /** + !#en Check whether an item exists. + !#zh 通过 id 检查加载项是否存在。 + @param id The item's id. + */ + exists(id: string): boolean; + /** + !#en Returns the content of an internal item. + !#zh 通过 id 获取指定对象的内容。 + @param id The item's id. + */ + getContent(id: string): any; + /** + !#en Returns the error of an internal item. + !#zh 通过 id 获取指定对象的错误信息。 + @param id The item's id. + */ + getError(id: string): any; + /** + !#en Add a listener for an item, the callback will be invoked when the item is completed. + !#zh 监听加载项(通过 key 指定)的完成事件。 + @param key key + @param callback can be null + @param target can be null + */ + addListener(key: string, callback: Function, target: any): boolean; + /** + !#en + Check if the specified key has any registered callback.
+ If a callback is also specified, it will only return true if the callback is registered. + !#zh + 检查指定的加载项是否有完成事件监听器。
+ 如果同时还指定了一个回调方法,并且回调有注册,它只会返回 true。 + @param key key + @param callback callback + @param target target + */ + hasListener(key: string, callback?: Function, target?: any): boolean; + /** + !#en + Removes a listener.
+ It will only remove when key, callback, target all match correctly. + !#zh + 移除指定加载项已经注册的完成事件监听器。
+ 只会删除 key, callback, target 均匹配的监听器。 + @param key key + @param callback callback + @param target target + */ + remove(key: string, callback: Function, target: any): boolean; + /** + !#en + Removes all callbacks registered in a certain event + type or all callbacks registered with a certain target. + !#zh 删除指定目标的所有完成事件监听器。 + @param key The event key to be removed or the target to be removed + */ + removeAllListeners(key: string|any): void; + /** + !#en Complete an item in the LoadingItems queue, please do not call this method unless you know what's happening. + !#zh 通知 LoadingItems 队列一个 item 对象已完成,请不要调用这个函数,除非你知道自己在做什么。 + @param id The item url + */ + itemComplete(id: string): void; + /** + !#en Destroy the LoadingItems queue, the queue object won't be garbage collected, it will be recycled, so every after destroy is not reliable. + !#zh 销毁一个 LoadingItems 队列,这个队列对象会被内部缓冲池回收,所以销毁后的所有内部信息都是不可依赖的。 + */ + destroy(): void; + } + /** !#en + A pipeline describes a sequence of manipulations, each manipulation is called a pipe.
+ It's designed for loading process. so items should be urls, and the url will be the identity of each item during the process.
+ A list of items can flow in the pipeline and it will output the results of all pipes.
+ They flow in the pipeline like water in tubes, they go through pipe by pipe separately.
+ Finally all items will flow out the pipeline and the process is finished. + + !#zh + pipeline 描述了一系列的操作,每个操作都被称为 pipe。
+ 它被设计来做加载过程的流程管理。所以 item 应该是 url,并且该 url 将是在处理中的每个 item 的身份标识。
+ 一个 item 列表可以在 pipeline 中流动,它将输出加载项经过所有 pipe 之后的结果。
+ 它们穿过 pipeline 就像水在管子里流动,将会按顺序流过每个 pipe。
+ 最后当所有加载项都流出 pipeline 时,整个加载流程就结束了。 */ + export class Pipeline { + /** + !#en + Constructor, pass an array of pipes to construct a new Pipeline, + the pipes will be chained in the given order.
+ A pipe is an object which must contain an `id` in string and a `handle` function, + the id must be unique in the pipeline.
+ It can also include `async` property to identify whether it's an asynchronous process. + !#zh + 构造函数,通过一系列的 pipe 来构造一个新的 pipeline,pipes 将会在给定的顺序中被锁定。
+ 一个 pipe 就是一个对象,它包含了字符串类型的 ‘id’ 和 ‘handle’ 函数,在 pipeline 中 id 必须是唯一的。
+ 它还可以包括 ‘async’ 属性以确定它是否是一个异步过程。 + @param pipes pipes + + @example + ```js + var pipeline = new Pipeline([ + { + id: 'Downloader', + handle: function (item, callback) {}, + async: true + }, + {id: 'Parser', handle: function (item) {}, async: false} + ]); + ``` + */ + constructor(pipes: any[]); + /** + !#en + Insert a new pipe at the given index of the pipeline.
+ A pipe must contain an `id` in string and a `handle` function, the id must be unique in the pipeline. + !#zh + 在给定的索引位置插入一个新的 pipe。
+ 一个 pipe 必须包含一个字符串类型的 ‘id’ 和 ‘handle’ 函数,该 id 在 pipeline 必须是唯一标识。 + @param pipe The pipe to be inserted + @param index The index to insert + */ + insertPipe(pipe: any, index: number): void; + /** + !en + Insert a pipe to the end of an existing pipe. The existing pipe must be a valid pipe in the pipeline. + !zh + 在当前 pipeline 的一个已知 pipe 后面插入一个新的 pipe。 + @param refPipe An existing pipe in the pipeline. + @param newPipe The pipe to be inserted. + */ + insertPipeAfter(refPipe: any, newPipe: any): void; + /** + !#en + Add a new pipe at the end of the pipeline.
+ A pipe must contain an `id` in string and a `handle` function, the id must be unique in the pipeline. + !#zh + 添加一个新的 pipe 到 pipeline 尾部。
+ 该 pipe 必须包含一个字符串类型 ‘id’ 和 ‘handle’ 函数,该 id 在 pipeline 必须是唯一标识。 + @param pipe The pipe to be appended + */ + appendPipe(pipe: any): void; + /** + !#en + Let new items flow into the pipeline.
+ Each item can be a simple url string or an object, + if it's an object, it must contain `id` property.
+ You can specify its type by `type` property, by default, the type is the extension name in url.
+ By adding a `skips` property including pipe ids, you can skip these pipe.
+ The object can contain any supplementary property as you want.
+ !#zh + 让新的 item 流入 pipeline 中。
+ 这里的每个 item 可以是一个简单字符串类型的 url 或者是一个对象, + 如果它是一个对象的话,他必须要包含 ‘id’ 属性。
+ 你也可以指定它的 ‘type’ 属性类型,默认情况下,该类型是 ‘url’ 的后缀名。
+ 也通过添加一个 包含 ‘skips’ 属性的 item 对象,你就可以跳过 skips 中包含的 pipe。
+ 该对象可以包含任何附加属性。 + @param items items + + @example + ```js + pipeline.flowIn([ + 'res/Background.png', + { + id: 'res/scene.json', + type: 'scene', + name: 'scene', + skips: ['Downloader'] + } + ]); + ``` + */ + flowIn(items: any[]): void; + /** + !#en + Let new items flow into the pipeline and give a callback when the list of items are all completed.
+ This is for loading dependencies for an existing item in flow, usually used in a pipe logic.
+ For example, we have a loader for scene configuration file in JSON, the scene will only be fully loaded
+ after all its dependencies are loaded, then you will need to use function to flow in all dependencies
+ found in the configuration file, and finish the loader pipe only after all dependencies are loaded (in the callback). + !#zh + 让新 items 流入 pipeline 并且当 item 列表完成时进行回调函数。
+ 这个 API 的使用通常是为了加载依赖项。
+ 例如:
+ 我们需要加载一个场景配置的 JSON 文件,该场景会将所有的依赖项全部都加载完毕以后,进行回调表示加载完毕。 + @param urlList urlList + @param callback callback + */ + flowInDeps(urlList: any[], callback: Function): any[]; + /** + !#en + Copy the item states from one source item to all destination items.
+ It's quite useful when a pipe generate new items from one source item,
+ then you should flowIn these generated items into pipeline,
+ but you probably want them to skip all pipes the source item already go through,
+ you can achieve it with this API.
+
+ For example, an unzip pipe will generate more items, but you won't want them to pass unzip or download pipe again. + !#zh + 从一个源 item 向所有目标 item 复制它的 pipe 状态,用于避免重复通过部分 pipe。
+ 当一个源 item 生成了一系列新的 items 时很有用,
+ 你希望让这些新的依赖项进入 pipeline,但是又不希望它们通过源 item 已经经过的 pipe,
+ 但是你可能希望他们源 item 已经通过并跳过所有 pipes,
+ 这个时候就可以使用这个 API。 + @param srcItem The source item + @param dstItems A single destination item or an array of destination items + */ + copyItemStates(srcItem: any, dstItems: any[]|any): void; + /** + !#en Returns whether the pipeline is flowing (contains item) currently. + !#zh 获取 pipeline 当前是否正在处理中。 + */ + isFlowing(): boolean; + /** + !#en Returns all items in pipeline. Returns null, please use API of Loader or LoadingItems. + !#zh 获取 pipeline 中的所有 items。返回 null,请使用 Loader / LoadingItems API。 + */ + getItems(): LoadingItems; + /** + !#en Returns an item in pipeline. + !#zh 根据 id 获取一个 item + @param id The id of the item + */ + getItem(id: any): any; + /** + !#en Removes an completed item in pipeline. + It will only remove the cache in the pipeline or loader, its dependencies won't be released. + cc.loader provided another method to completely cleanup the resource and its dependencies, + please refer to {{#crossLink "loader/release:method"}}cc.loader.release{{/crossLink}} + !#zh 移除指定的已完成 item。 + 这将仅仅从 pipeline 或者 loader 中删除其缓存,并不会释放它所依赖的资源。 + cc.loader 中提供了另一种删除资源及其依赖的清理方法,请参考 {{#crossLink "loader/release:method"}}cc.loader.release{{/crossLink}} + @param id The id of the item + */ + removeItem(id: any): boolean; + /** + !#en Clear the current pipeline, this function will clean up the items. + !#zh 清空当前 pipeline,该函数将清理 items。 + */ + clear(): void; + } + /** undefined */ + export class WorldManifold { + /** !#en + world contact point (point of intersection) + !#zh + 碰撞点集合 */ + points: [Vec2]; + /** !#en + world vector pointing from A to B + !#zh + 世界坐标系下由 A 指向 B 的向量 */ + normal: Vec2; + } + /** !#en + A manifold point is a contact point belonging to a contact manifold. + It holds details related to the geometry and dynamics of the contact points. + Note: the impulses are used for internal caching and may not + provide reliable contact forces, especially for high speed collisions. + !#zh + ManifoldPoint 是接触信息中的接触点信息。它拥有关于几何和接触点的详细信息。 + 注意:信息中的冲量用于系统内部缓存,提供的接触力可能不是很准确,特别是高速移动中的碰撞信息。 */ + export class ManifoldPoint { + /** !#en + The local point usage depends on the manifold type: + -e_circles: the local center of circleB + -e_faceA: the local center of circleB or the clip point of polygonB + -e_faceB: the clip point of polygonA + !#zh + 本地坐标点的用途取决于 manifold 的类型 + - e_circles: circleB 的本地中心点 + - e_faceA: circleB 的本地中心点 或者是 polygonB 的截取点 + - e_faceB: polygonB 的截取点 */ + localPoint: Vec2; + /** !#en + Normal impulse. + !#zh + 法线冲量。 */ + normalImpulse: number; + /** !#en + Tangent impulse. + !#zh + 切线冲量。 */ + tangentImpulse: number; + } + /** undefined */ + export class Manifold { + /** !#en + Manifold type : 0: e_circles, 1: e_faceA, 2: e_faceB + !#zh + Manifold 类型 : 0: e_circles, 1: e_faceA, 2: e_faceB */ + type: number; + /** !#en + The local point usage depends on the manifold type: + -e_circles: the local center of circleA + -e_faceA: the center of faceA + -e_faceB: the center of faceB + !#zh + 用途取决于 manifold 类型 + -e_circles: circleA 的本地中心点 + -e_faceA: faceA 的本地中心点 + -e_faceB: faceB 的本地中心点 */ + localPoint: Vec2; + /** !#en + -e_circles: not used + -e_faceA: the normal on polygonA + -e_faceB: the normal on polygonB + !#zh + -e_circles: 没被使用到 + -e_faceA: polygonA 的法向量 + -e_faceB: polygonB 的法向量 */ + localNormal: Vec2; + /** !#en + the points of contact. + !#zh + 接触点信息。 */ + points: [ManifoldPoint]; + } + /** !#en + Contact impulses for reporting. + !#zh + 用于返回给回调的接触冲量。 */ + export class PhysicsImpulse { + /** !#en + Normal impulses. + !#zh + 法线方向的冲量 */ + normalImpulses: void; + /** !#en + Tangent impulses + !#zh + 切线方向的冲量 */ + tangentImpulses: void; + } + /** !#en + PhysicsContact will be generated during begin and end collision as a parameter of the collision callback. + Note that contacts will be reused for speed up cpu time, so do not cache anything in the contact. + !#zh + 物理接触会在开始和结束碰撞之间生成,并作为参数传入到碰撞回调函数中。 + 注意:传入的物理接触会被系统进行重用,所以不要在使用中缓存里面的任何信息。 */ + export class PhysicsContact { + /** + !#en + Get the world manifold. + !#zh + 获取世界坐标系下的碰撞信息。 + */ + getWorldManifold(): WorldManifold; + /** + !#en + Get the manifold. + !#zh + 获取世界坐标系下的碰撞信息。 + */ + getManifold(): Manifold; + /** + !#en + Get the impulses. + Note: PhysicsImpulse can only used in onPostSolve callback. + !#zh + 获取冲量信息 + 注意:这个信息只有在 onPostSolve 回调中才能获取到 + */ + getImpulse(): PhysicsImpulse; + colliderA: Collider; + colliderB: Collider; + /** !#en + If set disabled to true, the contact will be ignored until contact end. + If you just want to disabled contact for current time step or sub-step, please use disabledOnce. + !#zh + 如果 disabled 被设置为 true,那么直到接触结束此接触都将被忽略。 + 如果只是希望在当前时间步或子步中忽略此接触,请使用 disabledOnce 。 */ + disabled: boolean; + /** !#en + Disabled contact for current time step or sub-step. + !#zh + 在当前时间步或子步中忽略此接触。 */ + disabledOnce: boolean; + /** + !#en + Is this contact touching? + !#zh + 返回碰撞体是否已经接触到。 + */ + isTouching(): boolean; + /** + !#en + Set the desired tangent speed for a conveyor belt behavior. + !#zh + 为传送带设置期望的切线速度 + @param tangentSpeed tangentSpeed + */ + setTangentSpeed(tangentSpeed: number): void; + /** + !#en + Get the desired tangent speed. + !#zh + 获取切线速度 + */ + getTangentSpeed(): number; + /** + !#en + Override the default friction mixture. You can call this in onPreSolve callback. + !#zh + 覆盖默认的摩擦力系数。你可以在 onPreSolve 回调中调用此函数。 + @param friction friction + */ + setFriction(friction: number): void; + /** + !#en + Get the friction. + !#zh + 获取当前摩擦力系数 + */ + getFriction(): number; + /** + !#en + Reset the friction mixture to the default value. + !#zh + 重置摩擦力系数到默认值 + */ + resetFriction(): void; + /** + !#en + Override the default restitution mixture. You can call this in onPreSolve callback. + !#zh + 覆盖默认的恢复系数。你可以在 onPreSolve 回调中调用此函数。 + @param restitution restitution + */ + setRestitution(restitution: number): void; + /** + !#en + Get the restitution. + !#zh + 获取当前恢复系数 + */ + getRestitution(): number; + /** + !#en + Reset the restitution mixture to the default value. + !#zh + 重置恢复系数到默认值 + */ + resetRestitution(): void; + } + /** !#en + Physics manager uses box2d as the inner physics system, and hide most box2d implement details(creating rigidbody, synchronize rigidbody info to node). + You can visit some common box2d function through physics manager(hit testing, raycast, debug info). + Physics manager distributes the collision information to each collision callback when collision is produced. + Note: You need first enable the collision listener in the rigidbody. + !#zh + 物理系统将 box2d 作为内部物理系统,并且隐藏了大部分 box2d 实现细节(比如创建刚体,同步刚体信息到节点中等)。 + 你可以通过物理系统访问一些 box2d 常用的功能,比如点击测试,射线测试,设置测试信息等。 + 物理系统还管理碰撞信息的分发,她会在产生碰撞时,将碰撞信息分发到各个碰撞回调中。 + 注意:你需要先在刚体中开启碰撞接听才会产生相应的碰撞回调。 */ + export class PhysicsManager implements EventTarget { + /** !#en + The draw bits for drawing physics debug information. + !#zh + 指定物理系统需要绘制哪些调试信息。 */ + static DrawBits: DrawBits; + /** !#en + The ratio transform between physics unit and pixel unit, generally is 32. + !#zh + 物理单位与像素单位互相转换的比率,一般是 32。 */ + static PTM_RATIO: number; + /** !#en + The velocity iterations for the velocity constraint solver. + !#zh + 速度更新迭代数 */ + static VELOCITY_ITERATIONS: number; + /** !#en + The position Iterations for the position constraint solver. + !#zh + 位置迭代更新数 */ + static POSITION_ITERATIONS: number; + /** !#en + Specify the fixed time step. + Need enabledAccumulator to make it work. + !#zh + 指定固定的物理更新间隔时间,需要开启 enabledAccumulator 才有效。 */ + static FIXED_TIME_STEP: number; + /** !#en + Specify the max accumulator time. + Need enabledAccumulator to make it work. + !#zh + 每次可用于更新物理系统的最大时间,需要开启 enabledAccumulator 才有效。 */ + static MAX_ACCUMULATOR: number; + /** !#en + If enabled accumulator, then will call step function with the fixed time step FIXED_TIME_STEP. + And if the update dt is bigger than the time step, then will call step function several times. + If disabled accumulator, then will call step function with a time step calculated with the frame rate. + !#zh + 如果开启此选项,那么将会以固定的间隔时间 FIXED_TIME_STEP 来更新物理引擎,如果一个 update 的间隔时间大于 FIXED_TIME_STEP,则会对物理引擎进行多次更新。 + 如果关闭此选项,那么将会根据设定的 frame rate 计算出一个间隔时间来更新物理引擎。 */ + enabledAccumulator: boolean; + /** + !#en + Test which collider contains the given world point + !#zh + 获取包含给定世界坐标系点的碰撞体 + @param point the world point + */ + testPoint(point: Vec2): PhysicsCollider; + /** + !#en + Test which colliders intersect the given world rect + !#zh + 获取与给定世界坐标系矩形相交的碰撞体 + @param rect the world rect + */ + testAABB(rect: Rect): [PhysicsCollider]; + /** + !#en + Raycast the world for all colliders in the path of the ray. + The raycast ignores colliders that contain the starting point. + !#zh + 检测哪些碰撞体在给定射线的路径上,射线检测将忽略包含起始点的碰撞体。 + @param p1 start point of the raycast + @param p2 end point of the raycast + @param type optional, default is RayCastType.Closest + */ + rayCast(p1: Vec2, p2: Vec2, type: RayCastType): [PhysicsRayCastResult]; + /** + !#en + Attach physics debug draw to camera + !#zh + 将物理的调试绘制信息附加到指定摄像机上 + @param camera camera + */ + attachDebugDrawToCamera(camera: Camera): void; + /** + !#en + Detach physics debug draw to camera + !#zh + 将物理的调试绘制信息从指定摄像机上移除 + @param camera camera + */ + detachDebugDrawFromCamera(camera: Camera): void; + /** !#en + Enabled the physics manager? + !#zh + 指定是否启用物理系统? */ + enabled: boolean; + /** !#en + Debug draw flags. + !#zh + 设置调试绘制标志 */ + debugDrawFlags: number; + /** !#en + The physics world gravity. + !#zh + 物理世界重力值 */ + gravity: Vec2; + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** undefined */ + export enum DrawBits { + e_aabbBit = 0, + e_pairBit = 0, + e_centerOfMassBit = 0, + e_jointBit = 0, + e_shapeBit = 0, + } + /** undefined */ + export class PhysicsRayCastResult { + /** !#en + The PhysicsCollider which intersects with the raycast + !#zh + 与射线相交的碰撞体 */ + collider: PhysicsCollider; + /** !#en + The intersection point + !#zh + 射线与碰撞体相交的点 */ + point: Vec2; + /** !#en + The normal vector at the point of intersection + !#zh + 射线与碰撞体相交的点的法向量 */ + normal: Vec2; + /** !#en + The fraction of the raycast path at the point of intersection + !#zh + 射线与碰撞体相交的点占射线长度的分数 */ + fraction: number; + } + /** !#en Enum for RigidBodyType. + !#zh 刚体类型 */ + export enum RigidBodyType { + Static = 0, + Kinematic = 0, + Dynamic = 0, + Animated = 0, + } + /** !#en Enum for RayCastType. + !#zh 射线检测类型 */ + export enum RayCastType { + Closest = 0, + Any = 0, + AllClosest = 0, + All = 0, + } + /** undefined */ + export class RigidBody extends Component { + /** !#en + Should enabled contact listener? + When a collision is trigger, the collision callback will only be called when enabled contact listener. + !#zh + 是否启用接触接听器。 + 当 collider 产生碰撞时,只有开启了接触接听器才会调用相应的回调函数 */ + enabledContactListener: boolean; + /** + !#en + Collision callback. + Called when two collider begin to touch. + !#zh + 碰撞回调。 + 如果你的脚本中实现了这个函数,那么它将会在两个碰撞体开始接触时被调用。 + @param contact contact information + @param selfCollider the collider belong to this rigidbody + @param otherCollider the collider belong to another rigidbody + */ + onBeginContact(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void; + /** + !#en + Collision callback. + Called when two collider cease to touch. + !#zh + 碰撞回调。 + 如果你的脚本中实现了这个函数,那么它将会在两个碰撞体停止接触时被调用。 + @param contact contact information + @param selfCollider the collider belong to this rigidbody + @param otherCollider the collider belong to another rigidbody + */ + onEndContact(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void; + /** + !#en + Collision callback. + This is called when a contact is updated. + This allows you to inspect a contact before it goes to the solver(e.g. disable contact). + Note: this is called only for awake bodies. + Note: this is called even when the number of contact points is zero. + Note: this is not called for sensors. + !#zh + 碰撞回调。 + 如果你的脚本中实现了这个函数,那么它将会在接触更新时被调用。 + 你可以在接触被处理前根据他包含的信息作出相应的处理,比如将这个接触禁用掉。 + 注意:回调只会为醒着的刚体调用。 + 注意:接触点为零的时候也有可能被调用。 + 注意:感知体(sensor)的回调不会被调用。 + @param contact contact information + @param selfCollider the collider belong to this rigidbody + @param otherCollider the collider belong to another rigidbody + */ + onPreSolve(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void; + /** + !#en + Collision callback. + This is called after a contact is updated. + You can get the impulses from the contact in this callback. + !#zh + 碰撞回调。 + 如果你的脚本中实现了这个函数,那么它将会在接触更新完后被调用。 + 你可以在这个回调中从接触信息中获取到冲量信息。 + @param contact contact information + @param selfCollider the collider belong to this rigidbody + @param otherCollider the collider belong to another rigidbody + */ + onPostSolve(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void; + /** !#en + Is this a fast moving body that should be prevented from tunneling through + other moving bodies? + Note : + - All bodies are prevented from tunneling through kinematic and static bodies. This setting is only considered on dynamic bodies. + - You should use this flag sparingly since it increases processing time. + !#zh + 这个刚体是否是一个快速移动的刚体,并且需要禁止穿过其他快速移动的刚体? + 需要注意的是 : + - 所有刚体都被禁止从 运动刚体 和 静态刚体 中穿过。此选项只关注于 动态刚体。 + - 应该尽量少的使用此选项,因为它会增加程序处理时间。 */ + bullet: boolean; + /** !#en + Rigidbody type : Static, Kinematic, Dynamic or Animated. + !#zh + 刚体类型: Static, Kinematic, Dynamic or Animated. */ + type: RigidBodyType; + /** !#en + Set this flag to false if this body should never fall asleep. + Note that this increases CPU usage. + !#zh + 如果此刚体永远都不应该进入睡眠,那么设置这个属性为 false。 + 需要注意这将使 CPU 占用率提高。 */ + allowSleep: boolean; + /** !#en + Scale the gravity applied to this body. + !#zh + 缩放应用在此刚体上的重力值 */ + gravityScale: number; + /** !#en + Linear damping is use to reduce the linear velocity. + The damping parameter can be larger than 1, but the damping effect becomes sensitive to the + time step when the damping parameter is large. + !#zh + Linear damping 用于衰减刚体的线性速度。衰减系数可以大于 1,但是当衰减系数比较大的时候,衰减的效果会变得比较敏感。 */ + linearDamping: number; + /** !#en + Angular damping is use to reduce the angular velocity. The damping parameter + can be larger than 1 but the damping effect becomes sensitive to the + time step when the damping parameter is large. + !#zh + Angular damping 用于衰减刚体的角速度。衰减系数可以大于 1,但是当衰减系数比较大的时候,衰减的效果会变得比较敏感。 */ + angularDamping: number; + /** !#en + The linear velocity of the body's origin in world co-ordinates. + !#zh + 刚体在世界坐标下的线性速度 */ + linearVelocity: Vec2; + /** !#en + The angular velocity of the body. + !#zh + 刚体的角速度 */ + angularVelocity: number; + /** !#en + Should this body be prevented from rotating? + !#zh + 是否禁止此刚体进行旋转 */ + fixedRotation: boolean; + /** !#en + Is this body initially awake or sleeping? + !#zh + 是否立刻唤醒此刚体 */ + awake: boolean; + /** !#en + Set the active state of the body. An inactive body is not + simulated and cannot be collided with or woken up. + If body is active, all fixtures will be added to the + broad-phase. + If body is inactive, all fixtures will be removed from + the broad-phase and all contacts will be destroyed. + Fixtures on an inactive body are implicitly inactive and will + not participate in collisions, ray-casts, or queries. + Joints connected to an inactive body are implicitly inactive. + !#zh + 设置刚体的激活状态。一个非激活状态下的刚体是不会被模拟和碰撞的,不管它是否处于睡眠状态下。 + 如果刚体处于激活状态下,所有夹具会被添加到 粗测阶段(broad-phase)。 + 如果刚体处于非激活状态下,所有夹具会被从 粗测阶段(broad-phase)中移除。 + 在非激活状态下的夹具不会参与到碰撞,射线,或者查找中 + 链接到非激活状态下刚体的关节也是非激活的。 */ + active: boolean; + /** + !#en + Gets a local point relative to the body's origin given a world point. + !#zh + 将一个给定的世界坐标系下的点转换为刚体本地坐标系下的点 + @param worldPoint a point in world coordinates. + @param out optional, the receiving point + */ + getLocalPoint(worldPoint: Vec2, out: Vec2): Vec2; + /** + !#en + Get the world coordinates of a point given the local coordinates. + !#zh + 将一个给定的刚体本地坐标系下的点转换为世界坐标系下的点 + @param localPoint a point in local coordinates. + @param out optional, the receiving point + */ + getWorldPoint(localPoint: Vec2, out: Vec2): Vec2; + /** + !#en + Get the world coordinates of a vector given the local coordinates. + !#zh + 将一个给定的世界坐标系下的向量转换为刚体本地坐标系下的向量 + @param localVector a vector in world coordinates. + @param out optional, the receiving vector + */ + getWorldVector(localVector: Vec2, out: Vec2): Vec2; + /** + !#en + Gets a local vector relative to the body's origin given a world vector. + !#zh + 将一个给定的世界坐标系下的点转换为刚体本地坐标系下的点 + @param worldVector a vector in world coordinates. + @param out optional, the receiving vector + */ + getLocalVector(worldVector: Vec2, out: Vec2): Vec2; + /** + !#en + Get the world body origin position. + !#zh + 获取刚体世界坐标系下的原点值 + @param out optional, the receiving point + */ + getWorldPosition(out: Vec2): Vec2; + /** + !#en + Get the world body rotation angle. + !#zh + 获取刚体世界坐标系下的旋转值。 + */ + getWorldRotation(): number; + /** + !#en + Get the local position of the center of mass. + !#zh + 获取刚体本地坐标系下的质心 + */ + getLocalCenter(): Vec2; + /** + !#en + Get the world position of the center of mass. + !#zh + 获取刚体世界坐标系下的质心 + */ + getWorldCenter(): Vec2; + /** + !#en + Get the world linear velocity of a world point attached to this body. + !#zh + 获取刚体上指定点的线性速度 + @param worldPoint a point in world coordinates. + @param out optional, the receiving point + */ + getLinearVelocityFromWorldPoint(worldPoint: Vec2, out: Vec2): Vec2; + /** + !#en + Get total mass of the body. + !#zh + 获取刚体的质量。 + */ + getMass(): number; + /** + !#en + Get the rotational inertia of the body about the local origin. + !#zh + 获取刚体本地坐标系下原点的旋转惯性 + */ + getInertia(): number; + /** + !#en + Get all the joints connect to the rigidbody. + !#zh + 获取链接到此刚体的所有关节 + */ + getJointList(): [Joint]; + /** + !#en + Apply a force at a world point. If the force is not + applied at the center of mass, it will generate a torque and + affect the angular velocity. + !#zh + 施加一个力到刚体上的一个点。如果力没有施加到刚体的质心上,还会产生一个扭矩并且影响到角速度。 + @param force the world force vector. + @param point the world position. + @param wake also wake up the body. + */ + applyForce(force: Vec2, point: Vec2, wake: boolean): void; + /** + !#en + Apply a force to the center of mass. + !#zh + 施加一个力到刚体上的质心上。 + @param force the world force vector. + @param wake also wake up the body. + */ + applyForceToCenter(force: Vec2, wake: boolean): void; + /** + !#en + Apply a torque. This affects the angular velocity. + !#zh + 施加一个扭矩力,将影响刚体的角速度 + @param torque about the z-axis (out of the screen), usually in N-m. + @param wake also wake up the body + */ + applyTorque(torque: number, wake: boolean): void; + /** + !#en + Apply a impulse at a world point, This immediately modifies the velocity. + If the impulse is not applied at the center of mass, it will generate a torque and + affect the angular velocity. + !#zh + 施加冲量到刚体上的一个点,将立即改变刚体的线性速度。 + 如果冲量施加到的点不是刚体的质心,那么将产生一个扭矩并影响刚体的角速度。 + @param impulse the world impulse vector, usually in N-seconds or kg-m/s. + @param point the world position + @param wake alse wake up the body + */ + applyLinearImpulse(impulse: Vec2, point: Vec2, wake: boolean): void; + /** + !#en + Apply an angular impulse. + !#zh + 施加一个角速度冲量。 + @param impulse the angular impulse in units of kg*m*m/s + @param wake also wake up the body + */ + applyAngularImpulse(impulse: number, wake: boolean): void; + /** + !#en + Synchronize node's world position to box2d rigidbody's position. + If enableAnimated is true and rigidbody's type is Animated type, + will set linear velocity instead of directly set rigidbody's position. + !#zh + 同步节点的世界坐标到 box2d 刚体的坐标上。 + 如果 enableAnimated 是 true,并且刚体的类型是 Animated ,那么将设置刚体的线性速度来代替直接设置刚体的位置。 + @param enableAnimated enableAnimated + */ + syncPosition(enableAnimated: boolean): void; + /** + !#en + Synchronize node's world angle to box2d rigidbody's angle. + If enableAnimated is true and rigidbody's type is Animated type, + will set angular velocity instead of directly set rigidbody's angle. + !#zh + 同步节点的世界旋转角度值到 box2d 刚体的旋转值上。 + 如果 enableAnimated 是 true,并且刚体的类型是 Animated ,那么将设置刚体的角速度来代替直接设置刚体的角度。 + @param enableAnimated enableAnimated + */ + syncRotation(enableAnimated: boolean): void; + } + /** !#en Key map for keyboard event + !#zh 键盘事件的按键值 */ + export enum KEY { + none = 0, + back = 0, + menu = 0, + backspace = 0, + tab = 0, + enter = 0, + shift = 0, + ctrl = 0, + alt = 0, + pause = 0, + capslock = 0, + escape = 0, + space = 0, + pageup = 0, + pagedown = 0, + end = 0, + home = 0, + left = 0, + up = 0, + right = 0, + down = 0, + select = 0, + insert = 0, + Delete = 0, + a = 0, + b = 0, + c = 0, + d = 0, + e = 0, + f = 0, + g = 0, + h = 0, + i = 0, + j = 0, + k = 0, + l = 0, + m = 0, + n = 0, + o = 0, + p = 0, + q = 0, + r = 0, + s = 0, + t = 0, + u = 0, + v = 0, + w = 0, + x = 0, + y = 0, + z = 0, + num0 = 0, + num1 = 0, + num2 = 0, + num3 = 0, + num4 = 0, + num5 = 0, + num6 = 0, + num7 = 0, + num8 = 0, + num9 = 0, + '*' = 0, + '+' = 0, + '-' = 0, + numdel = 0, + '/' = 0, + f1 = 0, + f2 = 0, + f3 = 0, + f4 = 0, + f5 = 0, + f6 = 0, + f7 = 0, + f8 = 0, + f9 = 0, + f10 = 0, + f11 = 0, + f12 = 0, + numlock = 0, + scrolllock = 0, + ';' = 0, + semicolon = 0, + equal = 0, + '=' = 0, + ',' = 0, + comma = 0, + dash = 0, + '.' = 0, + period = 0, + forwardslash = 0, + grave = 0, + '[' = 0, + openbracket = 0, + backslash = 0, + ']' = 0, + closebracket = 0, + quote = 0, + dpadLeft = 0, + dpadRight = 0, + dpadUp = 0, + dpadDown = 0, + dpadCenter = 0, + } + /** Image formats */ + export enum ImageFormat { + JPG = 0, + PNG = 0, + TIFF = 0, + WEBP = 0, + PVR = 0, + ETC = 0, + S3TC = 0, + ATITC = 0, + TGA = 0, + RAWDATA = 0, + UNKNOWN = 0, + getImageFormatByData = 0, + } + /** Predefined constants */ + export enum macro { + INVALID_INDEX = 0, + NODE_TAG_INVALID = 0, + PI = 0, + PI2 = 0, + FLT_MAX = 0, + FLT_MIN = 0, + RAD = 0, + DEG = 0, + UINT_MAX = 0, + REPEAT_FOREVER = 0, + FLT_EPSILON = 0, + ONE = 0, + ZERO = 0, + SRC_ALPHA = 0, + SRC_ALPHA_SATURATE = 0, + SRC_COLOR = 0, + DST_ALPHA = 0, + DST_COLOR = 0, + ONE_MINUS_SRC_ALPHA = 0, + ONE_MINUS_SRC_COLOR = 0, + ONE_MINUS_DST_ALPHA = 0, + ONE_MINUS_DST_COLOR = 0, + ONE_MINUS_CONSTANT_ALPHA = 0, + ONE_MINUS_CONSTANT_COLOR = 0, + LINEAR = 0, + BLEND_DST = 0, + WEB_ORIENTATION_PORTRAIT = 0, + WEB_ORIENTATION_LANDSCAPE_LEFT = 0, + WEB_ORIENTATION_PORTRAIT_UPSIDE_DOWN = 0, + WEB_ORIENTATION_LANDSCAPE_RIGHT = 0, + ORIENTATION_PORTRAIT = 0, + ORIENTATION_LANDSCAPE = 0, + ORIENTATION_AUTO = 0, + VERTEX_ATTRIB_FLAG_NONE = 0, + VERTEX_ATTRIB_FLAG_POSITION = 0, + VERTEX_ATTRIB_FLAG_COLOR = 0, + VERTEX_ATTRIB_FLAG_TEX_COORDS = 0, + VERTEX_ATTRIB_FLAG_POS_COLOR_TEX = 0, + GL_ALL = 0, + VERTEX_ATTRIB_POSITION = 0, + VERTEX_ATTRIB_COLOR = 0, + VERTEX_ATTRIB_TEX_COORDS = 0, + VERTEX_ATTRIB_MAX = 0, + UNIFORM_PMATRIX = 0, + UNIFORM_MVMATRIX = 0, + UNIFORM_MVPMATRIX = 0, + UNIFORM_TIME = 0, + UNIFORM_SINTIME = 0, + UNIFORM_COSTIME = 0, + UNIFORM_RANDOM01 = 0, + UNIFORM_SAMPLER = 0, + UNIFORM_MAX = 0, + SHADER_POSITION_TEXTURECOLOR = 0, + SHADER_SPRITE_POSITION_TEXTURECOLOR = 0, + SHADER_POSITION_TEXTURECOLORALPHATEST = 0, + SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST = 0, + SHADER_POSITION_COLOR = 0, + SHADER_SPRITE_POSITION_COLOR = 0, + SHADER_POSITION_TEXTURE = 0, + SHADER_POSITION_TEXTURE_UCOLOR = 0, + SHADER_POSITION_TEXTUREA8COLOR = 0, + SHADER_POSITION_UCOLOR = 0, + SHADER_POSITION_LENGTHTEXTURECOLOR = 0, + UNIFORM_PMATRIX_S = 0, + UNIFORM_MVMATRIX_S = 0, + UNIFORM_MVPMATRIX_S = 0, + UNIFORM_TIME_S = 0, + UNIFORM_SINTIME_S = 0, + UNIFORM_COSTIME_S = 0, + UNIFORM_RANDOM01_S = 0, + UNIFORM_SAMPLER_S = 0, + UNIFORM_ALPHA_TEST_VALUE_S = 0, + ATTRIBUTE_NAME_COLOR = 0, + ATTRIBUTE_NAME_POSITION = 0, + ATTRIBUTE_NAME_TEX_COORD = 0, + ITEM_SIZE = 0, + CURRENT_ITEM = 0, + ZOOM_ACTION_TAG = 0, + NORMAL_TAG = 0, + SELECTED_TAG = 0, + DISABLE_TAG = 0, + FIX_ARTIFACTS_BY_STRECHING_TEXEL = 0, + FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX = 0, + DIRECTOR_STATS_POSITION = 0, + DIRECTOR_FPS_INTERVAL = 0, + COCOSNODE_RENDER_SUBPIXEL = 0, + SPRITEBATCHNODE_RENDER_SUBPIXEL = 0, + AUTO_PREMULTIPLIED_ALPHA_FOR_PNG = 0, + OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA = 0, + TEXTURE_NPOT_SUPPORT = 0, + USE_LA88_LABELS = 0, + SPRITE_DEBUG_DRAW = 0, + LABELBMFONT_DEBUG_DRAW = 0, + LABELATLAS_DEBUG_DRAW = 0, + ENABLE_STACKABLE_ACTIONS = 0, + ENABLE_GL_STATE_CACHE = 0, + TOUCH_TIMEOUT = 0, + BATCH_VERTEX_COUNT = 0, + ENABLE_GC_FOR_NATIVE_OBJECTS = 0, + ENABLE_TILEDMAP_CULLING = 0, + DOWNLOAD_MAX_CONCURRENT = 0, + ENABLE_TRANSPARENT_CANVAS = 0, + ENABLE_WEBGL_ANTIALIAS = 0, + ENABLE_CULLING = 0, + BLEND_SRC = 0, + } + /** The base class of most of all the objects in Fireball. */ + export class Object { + /** !#en The name of the object. + !#zh 该对象的名称。 */ + name: string; + /** !#en + Indicates whether the object is not yet destroyed. (It will not be available after being destroyed)
+ When an object's `destroy` is called, it is actually destroyed after the end of this frame. + So `isValid` will return false from the next frame, while `isValid` in the current frame will still be true. + If you want to determine whether the current frame has called `destroy`, use `cc.isValid(obj, true)`, + but this is often caused by a particular logical requirements, which is not normally required. + + !#zh + 表示该对象是否可用(被 destroy 后将不可用)。
+ 当一个对象的 `destroy` 调用以后,会在这一帧结束后才真正销毁。因此从下一帧开始 `isValid` 就会返回 false,而当前帧内 `isValid` 仍然会是 true。如果希望判断当前帧是否调用过 `destroy`,请使用 `cc.isValid(obj, true)`,不过这往往是特殊的业务需求引起的,通常情况下不需要这样。 */ + isValid: boolean; + /** + !#en + Destroy this Object, and release all its own references to other objects.
+ Actual object destruction will delayed until before rendering. + From the next frame, this CCObject is not usable any more. + You can use cc.isValid(obj) to check whether the object is destroyed before accessing it. + !#zh + 销毁该对象,并释放所有它对其它对象的引用。
+ 实际销毁操作会延迟到当前帧渲染前执行。从下一帧开始,CCObject 将不再可用。 + 您可以在访问对象之前使用 cc.isValid(obj) 来检查对象是否已被销毁。 + + @example + ```js + obj.destroy(); + ``` + */ + destroy(): boolean; + } + /** Bit mask that controls object states. */ + export enum Flags { + DontSave = 0, + EditorOnly = 0, + } + /** The fullscreen API provides an easy way for web content to be presented using the user's entire screen. + It's invalid on safari, QQbrowser and android browser */ + export class screen { + /** + initialize + */ + init(): void; + /** + return true if it's full now. + */ + fullScreen(): boolean; + /** + change the screen to full mode. + @param element element + @param onFullScreenChange onFullScreenChange + */ + requestFullScreen(element: Element, onFullScreenChange: Function): void; + /** + exit the full mode. + */ + exitFullScreen(): boolean; + /** + Automatically request full screen with a touch/click event + @param element element + @param onFullScreenChange onFullScreenChange + */ + autoFullScreen(element: Element, onFullScreenChange: Function): void; + } + /** System variables */ + export class sys { + /** English language code */ + static LANGUAGE_ENGLISH: string; + /** Chinese language code */ + static LANGUAGE_CHINESE: string; + /** French language code */ + static LANGUAGE_FRENCH: string; + /** Italian language code */ + static LANGUAGE_ITALIAN: string; + /** German language code */ + static LANGUAGE_GERMAN: string; + /** Spanish language code */ + static LANGUAGE_SPANISH: string; + /** Spanish language code */ + static LANGUAGE_DUTCH: string; + /** Russian language code */ + static LANGUAGE_RUSSIAN: string; + /** Korean language code */ + static LANGUAGE_KOREAN: string; + /** Japanese language code */ + static LANGUAGE_JAPANESE: string; + /** Hungarian language code */ + static LANGUAGE_HUNGARIAN: string; + /** Portuguese language code */ + static LANGUAGE_PORTUGUESE: string; + /** Arabic language code */ + static LANGUAGE_ARABIC: string; + /** Norwegian language code */ + static LANGUAGE_NORWEGIAN: string; + /** Polish language code */ + static LANGUAGE_POLISH: string; + /** Turkish language code */ + static LANGUAGE_TURKISH: string; + /** Ukrainian language code */ + static LANGUAGE_UKRAINIAN: string; + /** Romanian language code */ + static LANGUAGE_ROMANIAN: string; + /** Bulgarian language code */ + static LANGUAGE_BULGARIAN: string; + /** Unknown language code */ + static LANGUAGE_UNKNOWN: string; + static OS_IOS: string; + static OS_ANDROID: string; + static OS_WINDOWS: string; + static OS_MARMALADE: string; + static OS_LINUX: string; + static OS_BADA: string; + static OS_BLACKBERRY: string; + static OS_OSX: string; + static OS_WP8: string; + static OS_WINRT: string; + static OS_UNKNOWN: string; + static UNKNOWN: number; + static WIN32: number; + static LINUX: number; + static MACOS: number; + static ANDROID: number; + static IPHONE: number; + static IPAD: number; + static BLACKBERRY: number; + static NACL: number; + static EMSCRIPTEN: number; + static TIZEN: number; + static WINRT: number; + static WP8: number; + static MOBILE_BROWSER: number; + static DESKTOP_BROWSER: number; + /** Indicates whether executes in editor's window process (Electron's renderer context) */ + static EDITOR_PAGE: number; + /** Indicates whether executes in editor's main process (Electron's browser context) */ + static EDITOR_CORE: number; + static WECHAT_GAME: number; + static QQ_PLAY: number; + /** BROWSER_TYPE_WECHAT */ + static BROWSER_TYPE_WECHAT: string; + /** BROWSER_TYPE_WECHAT_GAME */ + static BROWSER_TYPE_WECHAT_GAME: string; + /** BROWSER_TYPE_QQ_PLAY */ + static BROWSER_TYPE_QQ_PLAY: string; + static BROWSER_TYPE_ANDROID: string; + static BROWSER_TYPE_IE: string; + static BROWSER_TYPE_QQ: string; + static BROWSER_TYPE_MOBILE_QQ: string; + static BROWSER_TYPE_UC: string; + static BROWSER_TYPE_360: string; + static BROWSER_TYPE_BAIDU_APP: string; + static BROWSER_TYPE_BAIDU: string; + static BROWSER_TYPE_MAXTHON: string; + static BROWSER_TYPE_OPERA: string; + static BROWSER_TYPE_OUPENG: string; + static BROWSER_TYPE_MIUI: string; + static BROWSER_TYPE_FIREFOX: string; + static BROWSER_TYPE_SAFARI: string; + static BROWSER_TYPE_CHROME: string; + static BROWSER_TYPE_LIEBAO: string; + static BROWSER_TYPE_QZONE: string; + static BROWSER_TYPE_SOUGOU: string; + static BROWSER_TYPE_UNKNOWN: string; + /** Is native ? This is set to be true in jsb auto. */ + static isNative: boolean; + /** Is web browser ? */ + static isBrowser: boolean; + /** Indicate whether system is mobile system */ + static isMobile: boolean; + /** Indicate the running platform */ + static platform: number; + /** Indicate the current language of the running system */ + static language: string; + /** Indicate the running os name */ + static os: string; + /** Indicate the running os version */ + static osVersion: string; + /** Indicate the running os main version */ + static osMainVersion: number; + /** Indicate the running browser type */ + static browserType: string; + /** Indicate the running browser version */ + static browserVersion: string; + /** Indicate the real pixel resolution of the whole game window */ + static windowPixelResolution: Size; + /** cc.sys.localStorage is a local storage component. */ + static localStorage: any; + /** The capabilities of the current platform */ + static capabilities: any; + /** + Forces the garbage collection, only available in JSB + */ + static garbageCollect(): void; + /** + Dumps rooted objects, only available in JSB + */ + static dumpRoot(): void; + /** + Restart the JS VM, only available in JSB + */ + static restartVM(): void; + /** + Clean a script in the JS VM, only available in JSB + @param jsfile jsfile + */ + static cleanScript(jsfile: string): void; + /** + Check whether an object is valid, + In web engine, it will return true if the object exist + In native engine, it will return true if the JS object and the correspond native object are both valid + @param obj obj + */ + static isObjectValid(obj: any): boolean; + /** + Dump system informations + */ + static dump(): void; + /** + Open a url in browser + @param url url + */ + static openURL(url: string): void; + /** + Get the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. + */ + static now(): number; + } + /** cc.view is the singleton object which represents the game window.
+ It's main task include:
+ - Apply the design resolution policy
+ - Provide interaction with the window, like resize event on web, retina display support, etc...
+ - Manage the game view port which can be different with the window
+ - Manage the content scale and translation
+
+ Since the cc.view is a singleton, you don't need to call any constructor or create functions,
+ the standard way to use it is by calling:
+ - cc.view.methodName();
*/ + export class View { + /** +

+ Sets view's target-densitydpi for android mobile browser. it can be set to:
+ 1. cc.macro.DENSITYDPI_DEVICE, value is "device-dpi"
+ 2. cc.macro.DENSITYDPI_HIGH, value is "high-dpi" (default value)
+ 3. cc.macro.DENSITYDPI_MEDIUM, value is "medium-dpi" (browser's default value)
+ 4. cc.macro.DENSITYDPI_LOW, value is "low-dpi"
+ 5. Custom value, e.g: "480"
+

+ @param densityDPI densityDPI + */ + setTargetDensityDPI(densityDPI: string): void; + /** + Returns the current target-densitydpi value of cc.view. + */ + getTargetDensityDPI(): string; + /** + Sets whether resize canvas automatically when browser's size changed.
+ Useful only on web. + @param enabled Whether enable automatic resize with browser's resize event + */ + resizeWithBrowserSize(enabled: boolean): void; + /** + Sets the callback function for cc.view's resize action,
+ this callback will be invoked before applying resolution policy,
+ so you can do any additional modifications within the callback.
+ Useful only on web. + @param callback The callback function + */ + setResizeCallback(callback: Function|void): void; + /** + Sets the orientation of the game, it can be landscape, portrait or auto. + When set it to landscape or portrait, and screen w/h ratio doesn't fit, + cc.view will automatically rotate the game canvas using CSS. + Note that this function doesn't have any effect in native, + in native, you need to set the application orientation in native project settings + @param orientation Possible values: cc.macro.ORIENTATION_LANDSCAPE | cc.macro.ORIENTATION_PORTRAIT | cc.macro.ORIENTATION_AUTO + */ + setOrientation(orientation: number): void; + /** + Sets whether the engine modify the "viewport" meta in your web page.
+ It's enabled by default, we strongly suggest you not to disable it.
+ And even when it's enabled, you can still set your own "viewport" meta, it won't be overridden
+ Only useful on web + @param enabled Enable automatic modification to "viewport" meta + */ + adjustViewPort(enabled: boolean): void; + /** + Retina support is enabled by default for Apple device but disabled for other devices,
+ it takes effect only when you called setDesignResolutionPolicy
+ Only useful on web + @param enabled Enable or disable retina display + */ + enableRetina(enabled: boolean): void; + /** + Check whether retina display is enabled.
+ Only useful on web + */ + isRetinaEnabled(): boolean; + /** + !#en Whether to Enable on anti-alias + !#zh 控制抗锯齿是否开启 + @param enabled Enable or not anti-alias + */ + enableAntiAlias(enabled: boolean): void; + /** + !#en Returns whether the current enable on anti-alias + !#zh 返回当前是否抗锯齿 + */ + isAntiAliasEnabled(): boolean; + /** + If enabled, the application will try automatically to enter full screen mode on mobile devices
+ You can pass true as parameter to enable it and disable it by passing false.
+ Only useful on web + @param enabled Enable or disable auto full screen on mobile devices + */ + enableAutoFullScreen(enabled: boolean): void; + /** + Check whether auto full screen is enabled.
+ Only useful on web + */ + isAutoFullScreenEnabled(): boolean; + /** + Get whether render system is ready(no matter opengl or canvas),
+ this name is for the compatibility with cocos2d-x, subclass must implement this method. + */ + isViewReady(): boolean; + /** + Sets the resolution translate on View. + @param offsetLeft offsetLeft + @param offsetTop offsetTop + */ + setContentTranslateLeftTop(offsetLeft: number, offsetTop: number): void; + /** + Returns the resolution translate on View + */ + getContentTranslateLeftTop(): Size; + /** + Returns the frame size of the view.
+ On native platforms, it returns the screen size since the view is a fullscreen view.
+ On web, it returns the size of the canvas's outer DOM element. + */ + getFrameSize(): Size; + /** + On native, it sets the frame size of view.
+ On web, it sets the size of the canvas's outer DOM element. + @param width width + @param height height + */ + setFrameSize(width: number, height: number): void; + /** + Returns the visible area size of the view port. + */ + getVisibleSize(): Size; + /** + Returns the visible area size of the view port. + */ + getVisibleSizeInPixel(): Size; + /** + Returns the visible origin of the view port. + */ + getVisibleOrigin(): Vec2; + /** + Returns the visible origin of the view port. + */ + getVisibleOriginInPixel(): Vec2; + /** + Returns whether developer can set content's scale factor. + */ + canSetContentScaleFactor(): boolean; + /** + Returns the current resolution policy + */ + getResolutionPolicy(): ResolutionPolicy; + /** + Sets the current resolution policy + @param resolutionPolicy resolutionPolicy + */ + setResolutionPolicy(resolutionPolicy: ResolutionPolicy|number): void; + /** + Sets the resolution policy with designed view size in points.
+ The resolution policy include:
+ [1] ResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched.
+ [2] ResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut.
+ [3] ResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown.
+ [4] ResolutionFixedHeight Scale the content's height to screen's height and proportionally scale its width
+ [5] ResolutionFixedWidth Scale the content's width to screen's width and proportionally scale its height
+ [cc.ResolutionPolicy] [Web only feature] Custom resolution policy, constructed by cc.ResolutionPolicy
+ @param width Design resolution width. + @param height Design resolution height. + @param resolutionPolicy The resolution policy desired + */ + setDesignResolutionSize(width: number, height: number, resolutionPolicy: ResolutionPolicy|number): void; + /** + Returns the designed size for the view. + Default resolution size is the same as 'getFrameSize'. + */ + getDesignResolutionSize(): Size; + /** + Sets the container to desired pixel resolution and fit the game content to it. + This function is very useful for adaptation in mobile browsers. + In some HD android devices, the resolution is very high, but its browser performance may not be very good. + In this case, enabling retina display is very costy and not suggested, and if retina is disabled, the image may be blurry. + But this API can be helpful to set a desired pixel resolution which is in between. + This API will do the following: + 1. Set viewport's width to the desired width in pixel + 2. Set body width to the exact pixel resolution + 3. The resolution policy will be reset with designed view size in points. + @param width Design resolution width. + @param height Design resolution height. + @param resolutionPolicy The resolution policy desired + */ + setRealPixelResolution(width: number, height: number, resolutionPolicy: ResolutionPolicy|number): void; + /** + Sets view port rectangle with points. + @param x x + @param y y + @param w width + @param h height + */ + setViewPortInPoints(x: number, y: number, w: number, h: number): void; + /** + Sets Scissor rectangle with points. + @param x x + @param y y + @param w w + @param h h + */ + setScissorInPoints(x: number, y: number, w: number, h: number): void; + /** + Returns whether GL_SCISSOR_TEST is enable + */ + isScissorEnabled(): boolean; + /** + Returns the current scissor rectangle + */ + getScissorRect(): Rect; + /** + Sets the name of the view + @param viewName viewName + */ + setViewName(viewName: string): void; + /** + Returns the name of the view + */ + getViewName(): string; + /** + Returns the view port rectangle. + */ + getViewPortRect(): Rect; + /** + Returns scale factor of the horizontal direction (X axis). + */ + getScaleX(): number; + /** + Returns scale factor of the vertical direction (Y axis). + */ + getScaleY(): number; + /** + Returns device pixel ratio for retina display. + */ + getDevicePixelRatio(): number; + /** + Returns the real location in view for a translation based on a related position + @param tx The X axis translation + @param ty The Y axis translation + @param relatedPos The related position object including "left", "top", "width", "height" informations + */ + convertToLocationInView(tx: number, ty: number, relatedPos: any): Vec2; + } + /**

cc.ContainerStrategy class is the root strategy class of container's scale strategy, + it controls the behavior of how to scale the cc.container and cc.game.canvas object

*/ + export class ContainerStrategy { + /** + Manipulation before appling the strategy + @param view The target view + */ + preApply(view: View): void; + /** + Function to apply this strategy + @param view view + @param designedResolution designedResolution + */ + apply(view: View, designedResolution: Size): void; + /** + Manipulation after applying the strategy + @param view The target view + */ + postApply(view: View): void; + } + /**

cc.ContentStrategy class is the root strategy class of content's scale strategy, + it controls the behavior of how to scale the scene and setup the viewport for the game

*/ + export class ContentStrategy { + /** + Manipulation before applying the strategy + @param view The target view + */ + preApply(view: View): void; + /** + Function to apply this strategy + The return value is {scale: [scaleX, scaleY], viewport: {cc.Rect}}, + The target view can then apply these value to itself, it's preferred not to modify directly its private variables + @param view view + @param designedResolution designedResolution + */ + apply(view: View, designedResolution: Size): any; + /** + Manipulation after applying the strategy + @param view The target view + */ + postApply(view: View): void; + } + /** undefined */ + export class EqualToFrame extends ContainerStrategy { + } + /** undefined */ + export class ProportionalToFrame extends ContainerStrategy { + } + /** undefined */ + export class EqualToWindow extends EqualToFrame { + } + /** undefined */ + export class ProportionalToWindow extends ProportionalToFrame { + } + /** undefined */ + export class OriginalContainer extends ContainerStrategy { + } + /**

cc.ResolutionPolicy class is the root strategy class of scale strategy, + its main task is to maintain the compatibility with Cocos2d-x

*/ + export class ResolutionPolicy { + /** + + @param containerStg The container strategy + @param contentStg The content strategy + */ + constructor(containerStg: ContainerStrategy, contentStg: ContentStrategy); + /** + Manipulation before applying the resolution policy + @param view The target view + */ + preApply(view: View): void; + /** + Function to apply this resolution policy + The return value is {scale: [scaleX, scaleY], viewport: {cc.Rect}}, + The target view can then apply these value to itself, it's preferred not to modify directly its private variables + @param view The target view + @param designedResolution The user defined design resolution + */ + apply(view: View, designedResolution: Size): any; + /** + Manipulation after appyling the strategy + @param view The target view + */ + postApply(view: View): void; + /** + Setup the container's scale strategy + @param containerStg containerStg + */ + setContainerStrategy(containerStg: ContainerStrategy): void; + /** + Setup the content's scale strategy + @param contentStg contentStg + */ + setContentStrategy(contentStg: ContentStrategy): void; + /** The entire application is visible in the specified area without trying to preserve the original aspect ratio.
+ Distortion can occur, and the application may appear stretched or compressed. */ + static EXACT_FIT: number; + /** The entire application fills the specified area, without distortion but possibly with some cropping,
+ while maintaining the original aspect ratio of the application. */ + static NO_BORDER: number; + /** The entire application is visible in the specified area without distortion while maintaining the original
+ aspect ratio of the application. Borders can appear on two sides of the application. */ + static SHOW_ALL: number; + /** The application takes the height of the design resolution size and modifies the width of the internal
+ canvas so that it fits the aspect ratio of the device
+ no distortion will occur however you must make sure your application works on different
+ aspect ratios */ + static FIXED_HEIGHT: number; + /** The application takes the width of the design resolution size and modifies the height of the internal
+ canvas so that it fits the aspect ratio of the device
+ no distortion will occur however you must make sure your application works on different
+ aspect ratios */ + static FIXED_WIDTH: number; + /** Unknow policy */ + static UNKNOWN: number; + } + /** cc.visibleRect is a singleton object which defines the actual visible rect of the current view, + it should represent the same rect as cc.view.getViewportRect() */ + export class visibleRect { + /** + initialize + @param visibleRect visibleRect + */ + init(visibleRect: Rect): void; + /** Top left coordinate of the screen related to the game scene. */ + topLeft: Vec2; + /** Top right coordinate of the screen related to the game scene. */ + topRight: Vec2; + /** Top center coordinate of the screen related to the game scene. */ + top: Vec2; + /** Bottom left coordinate of the screen related to the game scene. */ + bottomLeft: Vec2; + /** Bottom right coordinate of the screen related to the game scene. */ + bottomRight: Vec2; + /** Bottom center coordinate of the screen related to the game scene. */ + bottom: Vec2; + /** Center coordinate of the screen related to the game scene. */ + center: Vec2; + /** Left center coordinate of the screen related to the game scene. */ + left: Vec2; + /** Right center coordinate of the screen related to the game scene. */ + right: Vec2; + /** Width of the screen. */ + width: number; + /** Height of the screen. */ + height: number; + } + /** The CallbacksHandler is an abstract class that can register and unregister callbacks by key. + Subclasses should implement their own methods about how to invoke the callbacks. */ + export class _CallbacksHandler { + /** + + @param key key + @param callback callback + @param target can be null + */ + add(key: string, callback: Function, target?: any): void; + /** + Check if the specified key has any registered callback. If a callback is also specified, + it will only return true if the callback is registered. + @param key key + @param callback callback + @param target target + */ + has(key: string, callback?: Function, target?: any): boolean; + /** + Removes all callbacks registered in a certain event type or all callbacks registered with a certain target + @param keyOrTarget The event key to be removed or the target to be removed + */ + removeAll(keyOrTarget: string|any): void; + /** + + @param key key + @param callback callback + @param target target + */ + remove(key: string, callback: Function, target?: any): void; + } + /** !#en The callbacks invoker to handle and invoke callbacks by key. + !#zh CallbacksInvoker 用来根据 Key 管理并调用回调方法。 */ + export class CallbacksInvoker extends _CallbacksHandler { + /** + + @param key key + @param p1 p1 + @param p2 p2 + @param p3 p3 + @param p4 p4 + @param p5 p5 + */ + invoke(key: string, p1?: any, p2?: any, p3?: any, p4?: any, p5?: any): void; + } + /** !#en Contains information collected during deserialization + !#zh 包含反序列化时的一些信息 */ + export class Details { + /** list of the depends assets' uuid */ + uuidList: string[]; + /** the obj list whose field needs to load asset by uuid */ + uuidObjList: any[]; + /** the corresponding field name which referenced to the asset */ + uuidPropList: string[]; + /** the corresponding field name which referenced to the raw object */ + rawProp: string; + reset(): void; + /** + + @param obj obj + @param propName propName + */ + getUuidOf(obj: any, propName: string): string; + /** + + @param obj obj + @param propName propName + @param uuid uuid + */ + push(obj: any, propName: string, uuid: string): void; + } + /** undefined */ + export class url { + /** + Returns the url of raw assets, you will only need this if the raw asset is inside the "resources" folder. + @param url url + + @example + ```js + --- + var url = cc.url.raw("textures/myTexture.png"); + console.log(url); // "resources/raw/textures/myTexture.png" + + ``` + */ + static raw(url: string): string; + /** + Returns the url of builtin raw assets. This method can only used in editor. + @param url url + + @example + ```js + --- + var url = cc.url.builtinRaw("textures/myTexture.png"); + console.log(url); // "resources/default-raw/textures/myTexture.png" + + ``` + */ + static builtinRaw(url: string): string; + } + /** !#en + A cc.SpriteFrame has:
+ - texture: A cc.Texture2D that will be used by the _ccsg.Sprite
+ - rectangle: A rectangle of the texture + + !#zh + 一个 SpriteFrame 包含:
+ - 纹理:会被 Sprite 使用的 Texture2D 对象。
+ - 矩形:在纹理中的矩形区域。 */ + export class SpriteFrame extends Asset implements EventTarget { + /** + !#en + Constructor of SpriteFrame class. + !#zh + SpriteFrame 类的构造函数。 + @param filename filename + @param rect rect + @param rotated Whether the frame is rotated in the texture + @param offset The offset of the frame in the texture + @param originalSize The size of the frame in the texture + */ + constructor(filename?: string|Texture2D, rect?: Rect, rotated?: boolean, offset?: Vec2, originalSize?: Size); + /** !#en Top border of the sprite + !#zh sprite 的顶部边框 */ + insetTop: number; + /** !#en Bottom border of the sprite + !#zh sprite 的底部边框 */ + insetBottom: number; + /** !#en Left border of the sprite + !#zh sprite 的左边边框 */ + insetLeft: number; + /** !#en Right border of the sprite + !#zh sprite 的左边边框 */ + insetRight: number; + /** + !#en Returns whether the texture have been loaded + !#zh 返回是否已加载纹理 + */ + textureLoaded(): boolean; + /** + Add a event listener for texture loaded event. + @param callback callback + @param target target + */ + addLoadedEventListener(callback: Function, target: any): void; + /** + !#en Returns whether the sprite frame is rotated in the texture. + !#zh 获取 SpriteFrame 是否旋转 + */ + isRotated(): boolean; + /** + !#en Set whether the sprite frame is rotated in the texture. + !#zh 设置 SpriteFrame 是否旋转 + @param bRotated bRotated + */ + setRotated(bRotated: boolean): void; + /** + !#en Returns the rect of the sprite frame in the texture. + !#zh 获取 SpriteFrame 的纹理矩形区域 + */ + getRect(): Rect; + /** + !#en Sets the rect of the sprite frame in the texture. + !#zh 设置 SpriteFrame 的纹理矩形区域 + @param rect rect + */ + setRect(rect: Rect): void; + /** + !#en Returns the original size of the trimmed image. + !#zh 获取修剪前的原始大小 + */ + getOriginalSize(): Size; + /** + !#en Sets the original size of the trimmed image. + !#zh 设置修剪前的原始大小 + @param size size + */ + setOriginalSize(size: Size): void; + /** + !#en Returns the texture of the frame. + !#zh 获取使用的纹理实例 + */ + getTexture(): Texture2D; + /** + !#en Returns the offset of the frame in the texture. + !#zh 获取偏移量 + */ + getOffset(): Vec2; + /** + !#en Sets the offset of the frame in the texture. + !#zh 设置偏移量 + @param offsets offsets + */ + setOffset(offsets: Vec2): void; + /** + !#en Clone the sprite frame. + !#zh 克隆 SpriteFrame + */ + clone(): SpriteFrame; + /** + !#en Set SpriteFrame with Texture, rect, rotated, offset and originalSize.
+ !#zh 通过 Texture,rect,rotated,offset 和 originalSize 设置 SpriteFrame + @param textureOrTextureFile textureOrTextureFile + @param rect rect + @param rotated rotated + @param offset offset + @param originalSize originalSize + */ + setTexture(textureOrTextureFile: string|Texture2D, rect?: Rect, rotated?: boolean, offset?: Vec2, originalSize?: Size): boolean; + /** + !#en If a loading scene (or prefab) is marked as `asyncLoadAssets`, all the textures of the SpriteFrame which + associated by user's custom Components in the scene, will not preload automatically. + These textures will be load when Sprite component is going to render the SpriteFrames. + You can call this method if you want to load the texture early. + !#zh 当加载中的场景或 Prefab 被标记为 `asyncLoadAssets` 时,用户在场景中由自定义组件关联到的所有 SpriteFrame 的贴图都不会被提前加载。 + 只有当 Sprite 组件要渲染这些 SpriteFrame 时,才会检查贴图是否加载。如果你希望加载过程提前,你可以手工调用这个方法。 + + @example + ```js + if (spriteFrame.textureLoaded()) { + this._onSpriteFrameLoaded(); + } + else { + spriteFrame.once('load', this._onSpriteFrameLoaded, this); + spriteFrame.ensureLoadTexture(); + } + ``` + */ + ensureLoadTexture(): void; + /** + !#en + If you do not need to use the SpriteFrame temporarily, you can call this method so that its texture could be garbage collected. Then when you need to render the SpriteFrame, you should call `ensureLoadTexture` manually to reload texture. + !#zh + 当你暂时不再使用这个 SpriteFrame 时,可以调用这个方法来保证引用的贴图对象能被 GC。然后当你要渲染 SpriteFrame 时,你需要手动调用 `ensureLoadTexture` 来重新加载贴图。 + + @example + ```js + spriteFrame.clearTexture(); + // when you need the SpriteFrame again... + spriteFrame.once('load', onSpriteFrameLoaded); + spriteFrame.ensureLoadTexture(); + ``` + */ + clearTexture(): void; + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /**

+ This class allows to easily create OpenGL or Canvas 2D textures from images, text or raw data.
+ The created cc.Texture2D object will always have power-of-two dimensions.
+ Depending on how you create the cc.Texture2D object, the actual image area of the texture might be smaller than the texture dimensions
+ i.e. "contentSize" != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0).
+ Be aware that the content of the generated textures will be upside-down!

*/ + export class Texture2D extends RawAsset implements EventTarget { + /** !#en + The url of the texture, this coule be empty if the texture wasn't created via a file. + !#zh + 贴图文件的 url,当贴图不是由文件创建时值可能为空 */ + url: string; + /** !#en + Whether the texture is loaded or not + !#zh + 贴图是否已经成功加载 */ + loaded: boolean; + /** !#en + Texture width in pixel + !#zh + 贴图像素宽度 */ + width: number; + /** !#en + Texture height in pixel + !#zh + 贴图像素高度 */ + height: number; + /** + Update texture options, not available in Canvas render mode. + image, format, premultiplyAlpha can not be updated in native. + @param options options + */ + update(options: {image: DOMImageElement; mipmap: boolean; format: PixelFormat; minFilter: Filter; magFilter: Filter; wrapS: WrapMode; wrapT: WrapMode; premultiplyAlpha: boolean; }): void; + /** + Get width in pixels. + */ + getPixelWidth(): number; + /** + Get height of in pixels. + */ + getPixelHeight(): number; + /** + Get content size. + */ + getContentSize(): Size; + /** + Get content size in pixels. + */ + getContentSizeInPixels(): Size; + /** + Init with HTML element. + @param element element + + @example + ```js + var img = new Image(); + img.src = dataURL; + texture.initWithElement(img); + texture.handleLoadedTexture(); + ``` + */ + initWithElement(element: HTMLImageElement|HTMLCanvasElement): void; + /** + Intializes with a texture2d with data. + @param data data + @param pixelFormat pixelFormat + @param pixelsWidth pixelsWidth + @param pixelsHeight pixelsHeight + @param contentSize contentSize is deprecated and ignored + */ + initWithData(data: TypedArray, pixelFormat: number, pixelsWidth: number, pixelsHeight: number, contentSize: Size): boolean; + /** + Initializes a texture from a UIImage object. + Extensions to make it easy to create a CCTexture2D object from an image file. + Note that RGBA type textures will have their alpha premultiplied - use the blending mode (gl.ONE, gl.ONE_MINUS_SRC_ALPHA). + @param uiImage uiImage + */ + initWithImage(uiImage: HTMLImageElement): boolean; + /** + HTMLElement Object getter, available only on web. + In most case, it will return null, because we are recycling the dom image element for better loading performance and lower image cache memory usage. + */ + getHtmlElementObj(): HTMLImageElement; + /** + Check whether texture is loaded. + */ + isLoaded(): boolean; + /** + Handler of texture loaded event. + @param premultiplied premultiplied + */ + handleLoadedTexture(premultiplied?: boolean): void; + /** + Description of cc.Texture2D. + */ + description(): string; + /** + Release texture. + */ + releaseTexture(): void; + /** + Pixel format of the texture. + */ + getPixelFormat(): number; + /** + Whether or not the texture has their Alpha premultiplied, + support only in WebGl rendering mode. + */ + hasPremultipliedAlpha(): boolean; + /** + Whether or not use mipmap, support only in WebGl rendering mode. + */ + hasMipmaps(): boolean; + /** + Sets the min filter, mag filter, wrap s and wrap t texture parameters.
+ If the texture size is NPOT (non power of 2), then in can only use gl.CLAMP_TO_EDGE in gl.TEXTURE_WRAP_{S,T}. + @param texParams texParams object or minFilter + @param magFilter magFilter + @param wrapS wrapS + @param wrapT wrapT + */ + setTexParameters(texParams: any|number, magFilter?: number, wrapS?: Texture2D.WrapMode, wrapT?: Texture2D.WrapMode): void; + /** + sets antialias texture parameters:
+ - GL_TEXTURE_MIN_FILTER = GL_NEAREST
+ - GL_TEXTURE_MAG_FILTER = GL_NEAREST
+ supported only in native or WebGl rendering mode + */ + setAntiAliasTexParameters(): void; + /** + Sets alias texture parameters:
+ GL_TEXTURE_MIN_FILTER = GL_NEAREST
+ GL_TEXTURE_MAG_FILTER = GL_NEAREST
+ supported only in native or WebGl rendering mode + */ + setAliasTexParameters(): void; + /** Pixel format of the texture. */ + pixelFormat: number; + /** Width in pixels. */ + pixelWidth: number; + /** Height in pixels. */ + pixelHeight: number; + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** cc.textureCache is a singleton object, it's the global cache for cc.Texture2D */ + export class textureCache { + /** + Description + */ + static description(): string; + /** + Returns an already created texture. Returns null if the texture doesn't exist. + @param textureKeyName textureKeyName + + @example + ```js + ------------------ + var key = cc.textureCache.textureForKey("hello.png"); + + ``` + */ + static textureForKey(textureKeyName: string): Texture2D; + /** + Returns an already created texture. Returns null if the texture doesn't exist. + @param textureKeyName textureKeyName + + @example + ```js + ------------------ + var key = cc.textureCache.getTextureForKey("hello.png"); + + ``` + */ + static getTextureForKey(textureKeyName: string): Texture2D; + /** + + @param texture texture + + @example + ```js + --------------- + var cacheTextureForColor = cc.textureCache.getTextureColors(texture); + + ``` + */ + static getTextureColors(texture: HTMLImageElement): any[]; + /** + !#en get all textures + !#zh 获取所有贴图 + */ + static getAllTextures(): Texture2D[]; + /** +

Purges the dictionary of loaded textures.
+ Call this method if you receive the "Memory Warning"
+ In the short term: it will free some resources preventing your app from being killed
+ In the medium term: it will allocate more resources
+ In the long term: it will be the same

+ + @example + ```js + -------- + cc.textureCache.removeAllTextures(); + + ``` + */ + static removeAllTextures(): void; + /** + Deletes a texture from the cache given a texture. + @param texture texture + + @example + ```js + ----- + cc.textureCache.removeTexture(texture); + + ``` + */ + static removeTexture(texture: HTMLImageElement): void; + /** + Deletes a texture from the cache given a its key name. + @param textureKeyName textureKeyName + + @example + ```js + ------ + cc.textureCache.removeTexture("hello.png"); + + ``` + */ + static removeTextureForKey(textureKeyName: string): void; + /** +

Returns a Texture2D object given an file image
+ If the file image was not previously loaded, it will create a new Texture2D
+ object and it will return it. It will use the filename as a key.
+ Otherwise it will return a reference of a previously loaded image.
+ Supported image extensions: .png, .jpg, .gif

+ @param url url + @param cb cb + @param target target + + @example + ```js + ---- + cc.textureCache.addImage("hello.png"); + + ``` + */ + static addImage(url: string, cb: Function, target: any): Texture2D; + /** + Cache the image data. + @param path path + @param texture texture + */ + static cacheImage(path: string, texture: HTMLImageElement|HTMLCanvasElement): void; + } + /** A base node for CCNode, it will: + - maintain scene hierarchy and active logic + - notifications if some properties changed + - define some interfaces shares between CCNode + - define machanisms for Enity Component Systems + - define prefab and serialize functions */ + export class _BaseNode extends Object implements EventTarget { + /** !#en Name of node. + !#zh 该节点名称。 */ + name: string; + /** !#en The uuid for editor, will be stripped before building project. + !#zh 主要用于编辑器的 uuid,在编辑器下可用于持久化存储,在项目构建之后将变成自增的 id。 */ + uuid: string; + /** !#en All children nodes. + !#zh 节点的所有子节点。 */ + children: Node[]; + /** !#en All children nodes. + !#zh 节点的子节点数量。 */ + childrenCount: number; + /** !#en + The local active state of this node.
+ Note that a Node may be inactive because a parent is not active, even if this returns true.
+ Use {{#crossLink "Node/activeInHierarchy:property"}}{{/crossLink}} if you want to check if the Node is actually treated as active in the scene. + !#zh + 当前节点的自身激活状态。
+ 值得注意的是,一个节点的父节点如果不被激活,那么即使它自身设为激活,它仍然无法激活。
+ 如果你想检查节点在场景中实际的激活状态可以使用 {{#crossLink "Node/activeInHierarchy:property"}}{{/crossLink}}。 */ + active: boolean; + /** !#en Indicates whether this node is active in the scene. + !#zh 表示此节点是否在场景中激活。 */ + activeInHierarchy: boolean; + /** !#en Tag of node. + !#zh 节点标签。 */ + tag: number; + /** + + @param name name + */ + constructor(name?: string); + /** !#en The parent of the node. + !#zh 该节点的父节点。 */ + parent: Node; + /** + !#en + Properties configuration function
+ All properties in attrs will be set to the node,
+ when the setter of the node is available,
+ the property will be set via setter function.
+ !#zh 属性配置函数。在 attrs 的所有属性将被设置为节点属性。 + @param attrs Properties to be set to node + + @example + ```js + var attrs = { key: 0, num: 100 }; + node.attr(attrs); + ``` + */ + attr(attrs: any): void; + /** + !#en Returns a child from the container given its tag. + !#zh 通过标签获取节点的子节点。 + @param aTag An identifier to find the child node. + + @example + ```js + var child = node.getChildByTag(1001); + ``` + */ + getChildByTag(aTag: number): Node; + /** + !#en Returns a child from the container given its uuid. + !#zh 通过 uuid 获取节点的子节点。 + @param uuid The uuid to find the child node. + + @example + ```js + var child = node.getChildByUuid(uuid); + ``` + */ + getChildByUuid(uuid: string): Node; + /** + !#en Returns a child from the container given its name. + !#zh 通过名称获取节点的子节点。 + @param name A name to find the child node. + + @example + ```js + var child = node.getChildByName("Test Node"); + ``` + */ + getChildByName(name: string): Node; + /** + !#en + Inserts a child to the node at a specified index. + !#zh + 插入子节点到指定位置 + @param child the child node to be inserted + @param siblingIndex the sibling index to place the child in + + @example + ```js + node.insertChild(child, 2); + ``` + */ + insertChild(child: Node, siblingIndex: number): void; + /** + !#en Get the sibling index. + !#zh 获取同级索引。 + + @example + ```js + var index = node.getSiblingIndex(); + ``` + */ + getSiblingIndex(): number; + /** + !#en Set the sibling index of this node. + !#zh 设置节点同级索引。 + @param index index + + @example + ```js + node.setSiblingIndex(1); + ``` + */ + setSiblingIndex(index: number): void; + /** + !#en + Remove itself from its parent node. If cleanup is `true`, then also remove all events and actions.
+ If the cleanup parameter is not passed, it will force a cleanup, so it is recommended that you always pass in the `false` parameter when calling this API.
+ If the node orphan, then nothing happens. + !#zh + 从父节点中删除该节点。如果不传入 cleanup 参数或者传入 `true`,那么这个节点上所有绑定的事件、action 都会被删除。
+ 因此建议调用这个 API 时总是传入 `false` 参数。
+ 如果这个节点是一个孤节点,那么什么都不会发生。 + @param cleanup true if all actions and callbacks on this node should be removed, false otherwise. + + @example + ```js + node.removeFromParent(); + node.removeFromParent(false); + ``` + */ + removeFromParent(cleanup?: boolean): void; + /** + !#en + Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter.

+ If the cleanup parameter is not passed, it will force a cleanup.
+ "remove" logic MUST only be on this method
+ If a class wants to extend the 'removeChild' behavior it only needs
+ to override this method. + !#zh + 移除节点中指定的子节点,是否需要清理所有正在运行的行为取决于 cleanup 参数。
+ 如果 cleanup 参数不传入,默认为 true 表示清理。
+ @param child The child node which will be removed. + @param cleanup true if all running actions and callbacks on the child node will be cleanup, false otherwise. + + @example + ```js + node.removeChild(newNode); + node.removeChild(newNode, false); + ``` + */ + removeChild(child: Node, cleanup?: boolean): void; + /** + !#en + Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter. + If the cleanup parameter is not passed, it will force a cleanup.
+ !#zh + 通过标签移除节点中指定的子节点,是否需要清理所有正在运行的行为取决于 cleanup 参数。
+ 如果 cleanup 参数不传入,默认为 true 表示清理。 + @param tag An integer number that identifies a child node + @param cleanup true if all running actions and callbacks on the child node will be cleanup, false otherwise. + + @example + ```js + node.removeChildByTag(1001); + node.removeChildByTag(1001, false); + ``` + */ + removeChildByTag(tag: number, cleanup?: boolean): void; + /** + !#en + Removes all children from the container and do a cleanup all running actions depending on the cleanup parameter.
+ If the cleanup parameter is not passed, it will force a cleanup. + !#zh + 移除节点所有的子节点,是否需要清理所有正在运行的行为取决于 cleanup 参数。
+ 如果 cleanup 参数不传入,默认为 true 表示清理。 + @param cleanup true if all running actions on all children nodes should be cleanup, false otherwise. + + @example + ```js + node.removeAllChildren(); + node.removeAllChildren(false); + ``` + */ + removeAllChildren(cleanup?: boolean): void; + /** + !#en Is this node a child of the given node? + !#zh 是否是指定节点的子节点? + @param parent parent + + @example + ```js + node.isChildOf(newNode); + ``` + */ + isChildOf(parent: Node): boolean; + /** + !#en + Returns the component of supplied type if the node has one attached, null if it doesn't.
+ You can also get component in the node by passing in the name of the script. + !#zh + 获取节点上指定类型的组件,如果节点有附加指定类型的组件,则返回,如果没有则为空。
+ 传入参数也可以是脚本的名称。 + @param typeOrClassName typeOrClassName + + @example + ```js + // get sprite component. + var sprite = node.getComponent(cc.Sprite); + // get custom test calss. + var test = node.getComponent("Test"); + ``` + */ + getComponent(type: {prototype: T}): T; + getComponent(className: string): any; + /** + !#en Returns all components of supplied type in the node. + !#zh 返回节点上指定类型的所有组件。 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprites = node.getComponents(cc.Sprite); + var tests = node.getComponents("Test"); + ``` + */ + getComponents(type: {prototype: T}): T[]; + getComponents(className: string): any[]; + /** + !#en Returns the component of supplied type in any of its children using depth first search. + !#zh 递归查找所有子节点中第一个匹配指定类型的组件。 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprite = node.getComponentInChildren(cc.Sprite); + var Test = node.getComponentInChildren("Test"); + ``` + */ + getComponentInChildren(type: {prototype: T}): T; + getComponentInChildren(className: string): any; + /** + !#en Returns all components of supplied type in self or any of its children. + !#zh 递归查找自身或所有子节点中指定类型的组件 + @param typeOrClassName typeOrClassName + + @example + ```js + var sprites = node.getComponentsInChildren(cc.Sprite); + var tests = node.getComponentsInChildren("Test"); + ``` + */ + getComponentsInChildren(type: {prototype: T}): T[]; + getComponentsInChildren(className: string): any[]; + /** + !#en Adds a component class to the node. You can also add component to node by passing in the name of the script. + !#zh 向节点添加一个指定类型的组件类,你还可以通过传入脚本的名称来添加组件。 + @param typeOrClassName The constructor or the class name of the component to add + + @example + ```js + var sprite = node.addComponent(cc.Sprite); + var test = node.addComponent("Test"); + ``` + */ + addComponent(type: {new(): T}): T; + addComponent(className: string): any; + /** + !#en + Removes a component identified by the given name or removes the component object given. + You can also use component.destroy() if you already have the reference. + !#zh + 删除节点上的指定组件,传入参数可以是一个组件构造函数或组件名,也可以是已经获得的组件引用。 + 如果你已经获得组件引用,你也可以直接调用 component.destroy() + @param component The need remove component. + + @example + ```js + node.removeComponent(cc.Sprite); + var Test = require("Test"); + node.removeComponent(Test); + ``` + */ + removeComponent(component: string|Function|Component): void; + /** + !#en + Destroy all children from the node, and release all their own references to other objects.
+ Actual destruct operation will delayed until before rendering. + !#zh + 销毁所有子节点,并释放所有它们对其它对象的引用。
+ 实际销毁操作会延迟到当前帧渲染前执行。 + + @example + ```js + node.destroyAllChildren(); + ``` + */ + destroyAllChildren(): void; + /** + !#en + Register an callback of a specific event type on the EventTarget. + !#zh + 注册事件目标的特定事件类型回调。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + on(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Removes the listeners previously registered with the same type, callback, target and or useCapture, + if only type is passed as parameter, all listeners registered with that type will be removed. + !#zh + 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。 + @param type A string representing the event type being removed. + @param callback The callback to remove. + @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed + @param useCapture Specifies whether the callback being removed was registered as a capturing callback or not. + If not specified, useCapture defaults to false. If a callback was registered twice, + one with capture and one without, each must be removed separately. Removal of a capturing callback + does not affect a non-capturing version of the same listener, and vice versa. + + @example + ```js + // register touchEnd eventListener + var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + // remove touch end event listener + node.off(cc.Node.EventType.TOUCH_END, touchEnd, node); + // remove all touch end event listeners + node.off(cc.Node.EventType.TOUCH_END); + ``` + */ + off(type: string, callback?: Function, target?: any, useCapture?: boolean): void; + /** + !#en Removes all callbacks previously registered with the same target (passed as parameter). + This is not for removing all listeners in the current event target, + and this is not for removing all listeners the target parameter have registered. + It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter. + !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 + 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 + 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。 + @param target The target to be searched for all related listeners + */ + targetOff(target: any): void; + /** + !#en + Register an callback of a specific event type on the EventTarget, + the callback will remove itself after the first time it is triggered. + !#zh + 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。 + @param type A string representing the event type to listen for. + @param 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). + @param target The target (this object) to invoke the callback, can be null + @param useCapture When set to true, the capture argument prevents callback + from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. + When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE. + Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET. + + @example + ```js + node.once(cc.Node.EventType.TOUCH_END, function (event) { + cc.log("this is callback"); + }, node); + ``` + */ + once(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void; + once(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void; + /** + !#en + Dispatches an event into the event flow. + The event target is the EventTarget object upon which the dispatchEvent() method is called. + !#zh 分发事件到事件流中。 + @param event The Event object that is dispatched into the event flow + */ + dispatchEvent(event: Event): void; + /** + !#en + Send an event to this object directly, this method will not propagate the event to any other objects. + The event will be created from the supplied message, you can get the "detail" argument from event.detail. + !#zh + 该对象直接发送事件, 这种方法不会对事件传播到任何其他对象。 + @param message the message to send + @param detail whatever argument the message needs + */ + emit(message: string, detail?: any): void; + } + /** !#en + cc.AffineTransform class represent an affine transform matrix. It's composed basically by translation, rotation, scale transformations.
+ Please do not use its constructor directly, use cc.affineTransformMake alias function instead. + !#zh + cc.AffineTransform 类代表一个仿射变换矩阵。它基本上是由平移旋转,缩放转变所组成。
+ 请不要直接使用它的构造,请使用 cc.affineTransformMake 函数代替。 */ + export class AffineTransform { + /** + !#en Create a cc.AffineTransform object with all contents in the matrix. + !#zh 用在矩阵中的所有内容创建一个 cc.AffineTransform 对象。 + @param a a + @param b b + @param c c + @param d d + @param tx tx + @param ty ty + */ + affineTransformMake(a: number, b: number, c: number, d: number, tx: number, ty: number): AffineTransform; + /** + !#en Clone a cc.AffineTransform object from the specified transform. + !#zh 克隆指定的 cc.AffineTransform 对象。 + @param t t + */ + affineTransformClone(t: AffineTransform): AffineTransform; + /** + !#en Apply the affine transformation on a point. + !#zh 对一个点应用矩阵变换。 + @param point or x. + @param transOrY transform matrix or y. + @param t transform matrix or y. + */ + pointApplyAffineTransform(point: Vec2|number, transOrY: AffineTransform|number, t: AffineTransform): Vec2; + /** + !#en Apply the affine transformation on a size. + !#zh 应用 Size 到仿射变换矩阵上。 + @param size size + @param t t + */ + sizeApplyAffineTransform(size: Size, t: AffineTransform): Size; + /** + !#en + Create a identity transformation matrix:
+ [ 1, 0, 0,
+ 0, 1, 0 ] + !#zh + 单位矩阵:
+ [ 1, 0, 0,
+ 0, 1, 0 ] + */ + affineTransformMakeIdentity(): AffineTransform; + /** + !#en Apply the affine transformation on a rect. + !#zh 应用 Rect 到仿射变换矩阵上。 + @param rect rect + @param anAffineTransform anAffineTransform + */ + rectApplyAffineTransform(rect: Rect, anAffineTransform: AffineTransform): Rect; + /** + !#en Apply the affine transformation on a rect, and truns to an Oriented Bounding Box. + !#zh 应用 Rect 到仿射变换矩阵上, 并转换为有向包围盒 + @param rect rect + @param anAffineTransform anAffineTransform + @param out_bl out_bl + @param out_tl out_tl + @param out_tr out_tr + @param out_br out_br + */ + obbApplyAffineTransform(rect: Rect, anAffineTransform: AffineTransform, out_bl: Vec2, out_tl: Vec2, out_tr: Vec2, out_br: Vec2): void; + /** + !#en Create a new affine transformation with a base transformation matrix and a translation based on it. + !#zh 基于一个基础矩阵加上一个平移操作来创建一个新的矩阵。 + @param t The base affine transform object. + @param tx The translation on x axis. + @param ty The translation on y axis. + */ + affineTransformTranslate(t: AffineTransform, tx: number, ty: number): AffineTransform; + /** + !#en Create a new affine transformation with a base transformation matrix and a scale based on it. + !#zh 创建一个基础变换矩阵,并在此基础上进行了 Scale 仿射变换。 + @param t The base affine transform object. + @param sx The scale on x axis. + @param sy The scale on y axis. + */ + affineTransformScale(t: AffineTransform, sx: number, sy: number): AffineTransform; + /** + !#en Create a new affine transformation with a base transformation matrix and a rotation based on it. + !#zh 创建一个基础变换矩阵,并在此基础上进行了 Rotation 仿射变换。 + @param aTransform The base affine transform object. + @param anAngle The angle to rotate. + */ + affineTransformRotate(aTransform: AffineTransform, anAngle: number): AffineTransform; + /** + !#en + Concatenate a transform matrix to another and return the result:
+ t' = t1 * t2 + !#zh 拼接两个矩阵,并返回结果:
+ t' = t1 * t2 + @param t1 The first transform object. + @param t2 The transform object to concatenate. + */ + affineTransformConcat(t1: AffineTransform, t2: AffineTransform): AffineTransform; + /** + !#en + Concatenate a transform matrix to another
+ The results are reflected in the first matrix.
+ t' = t1 * t2 + !#zh + 拼接两个矩阵,将结果保存到第一个矩阵。
+ t' = t1 * t2 + @param t1 The first transform object. + @param t2 The transform object to concatenate. + */ + affineTransformConcatIn(t1: AffineTransform, t2: AffineTransform): AffineTransform; + /** + !#en Return true if an affine transform equals to another, false otherwise. + !#zh 判断两个矩阵是否相等。 + @param t1 t1 + @param t2 t2 + */ + affineTransformEqualToTransform(t1: AffineTransform, t2: AffineTransform): boolean; + /** + !#en Get the invert transform of an AffineTransform object. + !#zh 求逆矩阵。 + @param t t + */ + affineTransformInvert(t: AffineTransform): AffineTransform; + /** + !#en Put the invert transform of an AffineTransform object into the out AffineTransform object. + !#zh 求逆矩阵并存入用户传入的矩阵对象参数。 + @param t t + @param out out + */ + affineTransformInvert(t: AffineTransform, out: AffineTransform): void; + } + /** !#en + Representation of RGBA colors. + + Each color component is a floating point value with a range from 0 to 255. + + You can also use the convenience method {{#crossLink "cc/color:method"}}cc.color{{/crossLink}} to create a new Color. + + !#zh + cc.Color 用于表示颜色。 + + 它包含 RGBA 四个以浮点数保存的颜色分量,每个的值都在 0 到 255 之间。 + + 您也可以通过使用 {{#crossLink "cc/color:method"}}cc.color{{/crossLink}} 的便捷方法来创建一个新的 Color。 */ + export class Color extends ValueType { + /** + + @param r red component of the color, default value is 0. + @param g green component of the color, defualt value is 0. + @param b blue component of the color, default value is 0. + @param a alpha component of the color, default value is 255. + */ + constructor(r?: number, g?: number, b?: number, a?: number); + /** !#en Solid white, RGBA is [255, 255, 255, 255]. + !#zh 纯白色,RGBA 是 [255, 255, 255, 255]。 */ + static WHITE: Color; + /** !#en Solid black, RGBA is [0, 0, 0, 255]. + !#zh 纯黑色,RGBA 是 [0, 0, 0, 255]。 */ + static BLACK: Color; + /** !#en Transparent, RGBA is [0, 0, 0, 0]. + !#zh 透明,RGBA 是 [0, 0, 0, 0]。 */ + static TRANSPARENT: Color; + /** !#en Grey, RGBA is [127.5, 127.5, 127.5]. + !#zh 灰色,RGBA 是 [127.5, 127.5, 127.5]。 */ + static GRAY: Color; + /** !#en Solid red, RGBA is [255, 0, 0]. + !#zh 纯红色,RGBA 是 [255, 0, 0]。 */ + static RED: Color; + /** !#en Solid green, RGBA is [0, 255, 0]. + !#zh 纯绿色,RGBA 是 [0, 255, 0]。 */ + static GREEN: Color; + /** !#en Solid blue, RGBA is [0, 0, 255]. + !#zh 纯蓝色,RGBA 是 [0, 0, 255]。 */ + static BLUE: Color; + /** !#en Yellow, RGBA is [255, 235, 4]. + !#zh 黄色,RGBA 是 [255, 235, 4]。 */ + static YELLOW: Color; + /** !#en Orange, RGBA is [255, 127, 0]. + !#zh 橙色,RGBA 是 [255, 127, 0]。 */ + static ORANGE: Color; + /** !#en Cyan, RGBA is [0, 255, 255]. + !#zh 青色,RGBA 是 [0, 255, 255]。 */ + static CYAN: Color; + /** !#en Magenta, RGBA is [255, 0, 255]. + !#zh 洋红色(品红色),RGBA 是 [255, 0, 255]。 */ + static MAGENTA: Color; + /** + !#en Clone a new color from the current color. + !#zh 克隆当前颜色。 + + @example + ```js + var color = new cc.Color(); + var newColor = color.clone();// Color {r: 0, g: 0, b: 0, a: 255} + ``` + */ + clone(): Color; + /** + !#en TODO + !#zh 判断两个颜色是否相等。 + @param other other + + @example + ```js + var color1 = cc.Color.WHITE; + var color2 = new cc.Color(255, 255, 255); + cc.log(color1.equals(color2)); // true; + color2 = cc.Color.RED; + cc.log(color2.equals(color1)); // false; + ``` + */ + equals(other: Color): boolean; + /** + !#en TODO + !#zh 线性插值 + @param to to + @param ratio the interpolation coefficient. + @param out optional, the receiving vector. + + @example + ```js + // Converts a white color to a black one trough time. + update: function (dt) { + var color = this.node.color; + if (color.equals(cc.Color.BLACK)) { + return; + } + this.ratio += dt * 0.1; + this.node.color = cc.Color.WHITE.lerp(cc.Color.BLACK, ratio); + } + + ``` + */ + lerp(to: Color, ratio: number, out?: Color): Color; + /** + !#en TODO + !#zh 转换为方便阅读的字符串。 + + @example + ```js + var color = cc.Color.WHITE; + color.toString(); // "rgba(255, 255, 255, 255)" + ``` + */ + toString(): string; + /** + !#en Gets red channel value + !#zh 获取当前颜色的红色值。 + */ + getR(): number; + /** + !#en Sets red value and return the current color object + !#zh 设置当前的红色值,并返回当前对象。 + @param red the new Red component. + + @example + ```js + var color = new cc.Color(); + color.setR(255); // Color {r: 255, g: 0, b: 0, a: 255} + ``` + */ + setR(red: number): Color; + /** + !#en Gets green channel value + !#zh 获取当前颜色的绿色值。 + */ + getG(): number; + /** + !#en Sets green value and return the current color object + !#zh 设置当前的绿色值,并返回当前对象。 + @param green the new Green component. + + @example + ```js + var color = new cc.Color(); + color.setG(255); // Color {r: 0, g: 255, b: 0, a: 255} + ``` + */ + setG(green: number): Color; + /** + !#en Gets blue channel value + !#zh 获取当前颜色的蓝色值。 + */ + getB(): number; + /** + !#en Sets blue value and return the current color object + !#zh 设置当前的蓝色值,并返回当前对象。 + @param blue the new Blue component. + + @example + ```js + var color = new cc.Color(); + color.setB(255); // Color {r: 0, g: 0, b: 255, a: 255} + ``` + */ + setB(blue: number): Color; + /** + !#en Gets alpha channel value + !#zh 获取当前颜色的透明度值。 + */ + getA(): number; + /** + !#en Sets alpha value and return the current color object + !#zh 设置当前的透明度,并返回当前对象。 + @param alpha the new Alpha component. + + @example + ```js + var color = new cc.Color(); + color.setA(0); // Color {r: 0, g: 0, b: 0, a: 0} + ``` + */ + setA(alpha: number): Color; + /** + !#en Convert color to css format. + !#zh 转换为 CSS 格式。 + @param opt "rgba", "rgb", "#rgb" or "#rrggbb". + + @example + ```js + var color = cc.Color.BLACK; + color.toCSS(); // "#000"; + color.toCSS("rgba"); // "rgba(0,0,0,1.00)"; + color.toCSS("rgb"); // "rgba(0,0,0)"; + color.toCSS("#rgb"); // "#000"; + color.toCSS("#rrggbb"); // "#000000"; + ``` + */ + toCSS(opt: string): string; + /** + !#en Clamp this color to make all components between 0 to 255。 + !#zh 限制颜色数值,在 0 到 255 之间。 + + @example + ```js + var color = new cc.Color(1000, 0, 0, 255); + color.clamp(); + cc.log(color); // (255, 0, 0, 255) + ``` + */ + clamp(): void; + /** + !#en Read hex string and store color data into the current color object, the hex string must be formated as rgba or rgb. + !#zh 读取 16 进制颜色。 + @param hexString hexString + + @example + ```js + var color = cc.Color.BLACK; + color.fromHEX("#FFFF33"); // Color {r: 255, g: 255, b: 51, a: 255}; + ``` + */ + fromHEX(hexString: string): Color; + /** + !#en TODO + !#zh 转换为 16 进制。 + @param fmt "#rgb" or "#rrggbb". + + @example + ```js + var color = cc.Color.BLACK; + color.toHEX("#rgb"); // "000"; + color.toHEX("#rrggbb"); // "000000"; + ``` + */ + toHEX(fmt: string): string; + /** + !#en Convert to 24bit rgb value. + !#zh 转换为 24bit 的 RGB 值。 + + @example + ```js + var color = cc.Color.YELLOW; + color.toRGBValue(); // 16771844; + ``` + */ + toRGBValue(): number; + /** + !#en TODO + !#zh 读取 HSV(色彩模型)格式。 + @param h h + @param s s + @param v v + + @example + ```js + var color = cc.Color.YELLOW; + color.fromHSV(0, 0, 1); // Color {r: 255, g: 255, b: 255, a: 255}; + ``` + */ + fromHSV(h: number, s: number, v: number): Color; + /** + !#en TODO + !#zh 转换为 HSV(色彩模型)格式。 + + @example + ```js + var color = cc.Color.YELLOW; + color.toHSV(); // Object {h: 0.1533864541832669, s: 0.9843137254901961, v: 1}; + ``` + */ + toHSV(): any; + /** + !#en TODO + !#zh RGB 转换为 HSV。 + @param r red, must be [0, 255]. + @param g red, must be [0, 255]. + @param b red, must be [0, 255]. + + @example + ```js + cc.Color.rgb2hsv(255, 255, 255); // Object {h: 0, s: 0, v: 1}; + ``` + */ + static rgb2hsv(r: number, g: number, b: number): any; + /** + !#en TODO + !#zh HSV 转换为 RGB。 + @param h h + @param s s + @param v v + + @example + ```js + cc.Color.hsv2rgb(0, 0, 1); // Object {r: 255, g: 255, b: 255}; + ``` + */ + static hsv2rgb(h: number, s: number, v: number): any; + } + /** !#en A 2D rectangle defined by x, y position and width, height. + !#zh 通过位置和宽高定义的 2D 矩形。 */ + export class Rect extends ValueType { + /** + !#en + Constructor of cc.Rect class. + see {{#crossLink "cc/rect:method"}} cc.rect {{/crossLink}} for convenience method. + !#zh + cc.Rect类的构造函数。可以通过 {{#crossLink "cc/rect:method"}} cc.rect {{/crossLink}} 简便方法进行创建。 + @param x x + @param y y + @param w w + @param h h + */ + constructor(x?: number, y?: number, w?: number, h?: number); + x: number; + y: number; + width: number; + height: number; + /** + !#en Creates a rectangle from two coordinate values. + !#zh 根据指定 2 个坐标创建出一个矩形区域。 + @param v1 v1 + @param v2 v2 + + @example + ```js + cc.Rect.fromMinMax(cc.v2(10, 10), cc.v2(20, 20)); // Rect {x: 10, y: 10, width: 10, height: 10}; + ``` + */ + static fromMinMax(v1: Vec2, v2: Vec2): Rect; + /** + !#en Checks if rect contains. + !#zh + 判断 2 个矩形是否有包含。
+ 返回 1 为 a 包含 b,如果 -1 为 b 包含 a, + 0 这则都不包含。 + @param a Rect a + @param b Rect b + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Rect(5, 5, 5, 5); + var c = new cc.Rect(20, 20, 10, 10); + cc.Rect.contain(a, b); // 1; + cc.Rect.contain(b, a); // -1; + cc.Rect.contain(a, c); // 0; + ``` + */ + static contain(a: Rect, b: Rect): number; + /** + !#en TODO + !#zh 克隆一个新的 Rect。 + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + a.clone();// Rect {x: 0, y: 0, width: 10, height: 10} + ``` + */ + clone(): Rect; + /** + !#en TODO + !#zh 是否等于指定的矩形。 + @param other other + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Rect(0, 0, 10, 10); + a.equals(b);// true; + ``` + */ + equals(other: Rect): boolean; + /** + !#en TODO + !#zh 线性插值 + @param to to + @param ratio the interpolation coefficient. + @param out optional, the receiving vector. + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Rect(50, 50, 100, 100); + update (dt) { + // method 1; + var c = a.lerp(b, dt * 0.1); + // method 2; + a.lerp(b, dt * 0.1, c); + } + ``` + */ + lerp(to: Rect, ratio: number, out?: Rect): Rect; + /** + !#en TODO + !#zh 转换为方便阅读的字符串 + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + a.toString();// "(0.00, 0.00, 10.00, 10.00)"; + ``` + */ + toString(): string; + /** !#en TODO + !#zh 矩形 x 轴上的最小值。 */ + xMin: number; + /** !#en TODO + !#zh 矩形 y 轴上的最小值。 */ + yMin: number; + /** !#en TODO + !#zh 矩形 x 轴上的最大值。 */ + xMax: number; + /** !#en TODO + !#zh 矩形 y 轴上的最大值。 */ + yMax: number; + /** !#en The position of the center of the rectangle. + !#zh 矩形的中心点。 */ + center: Vec2; + /** !#en The X and Y position of the rectangle. + !#zh 矩形的 x 和 y 坐标。 */ + origin: Vec2; + /** !#en Width and height of the rectangle. + !#zh 矩形的大小。 */ + size: Size; + /** + !#en TODO + !#zh 当前矩形与指定矩形是否相交。 + @param rect rect + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Rect(0, 0, 20, 20); + a.intersects(b);// true + ``` + */ + intersects(rect: Rect): void; + /** + !#en TODO + !#zh 当前矩形是否包含指定坐标点。 + Returns true if the point inside this rectangle. + @param point point + + @example + ```js + var a = new cc.Rect(0, 0, 10, 10); + var b = new cc.Vec2(0, 5); + a.contains(b);// true + ``` + */ + contains(point: Vec2): void; + /** + !#en Returns true if the other rect totally inside this rectangle. + !#zh 当前矩形是否包含指定矩形。 + @param rect rect + + @example + ```js + var a = new cc.Rect(0, 0, 20, 20); + var b = new cc.Rect(0, 0, 10, 10); + a.containsRect(b);// true + ``` + */ + containsRect(rect: Rect): void; + } + /** !#en + cc.Size is the class for size object,
+ please do not use its constructor to create sizes,
+ use {{#crossLink "cc/size:method"}}{{/crossLink}} alias function instead.
+ It will be deprecated soon, please use cc.Vec2 instead. + + !#zh + cc.Size 是 size 对象的类。
+ 请不要使用它的构造函数创建的 size,
+ 使用 {{#crossLink "cc/size:method"}}{{/crossLink}} 别名函数。
+ 它不久将被取消,请使用cc.Vec2代替。 */ + export class Size { + /** + + @param width width + @param height height + */ + constructor(width: number|Size, height?: number); + width: number; + height: number; + /** !#en return a Size object with width = 0 and height = 0. + !#zh 返回一个宽度为 0 和高度为 0 的 Size 对象。 */ + static ZERO: Size; + /** + !#en TODO + !#zh 克隆 size 对象。 + + @example + ```js + var a = new cc.size(10, 10); + a.clone();// return Size {width: 0, height: 0}; + ``` + */ + clone(): Size; + /** + !#en TODO + !#zh 当前 Size 对象是否等于指定 Size 对象。 + @param other other + + @example + ```js + var a = new cc.size(10, 10); + a.equals(new cc.size(10, 10));// return true; + ``` + */ + equals(other: Size): boolean; + /** + !#en TODO + !#zh 线性插值。 + @param to to + @param ratio the interpolation coefficient. + @param out optional, the receiving vector. + + @example + ```js + var a = new cc.size(10, 10); + var b = new cc.rect(50, 50, 100, 100); + update (dt) { + // method 1; + var c = a.lerp(b, dt * 0.1); + // method 2; + a.lerp(b, dt * 0.1, c); + } + ``` + */ + lerp(to: Rect, ratio: number, out?: Size): Size; + /** + !#en TODO + !#zh 转换为方便阅读的字符串。 + + @example + ```js + var a = new cc.size(10, 10); + a.toString();// return "(10.00, 10.00)"; + ``` + */ + toString(): string; + } + /** !#en the device accelerometer reports values for each axis in units of g-force. + !#zh 设备重力传感器传递的各个轴的数据。 */ + export class Acceleration { + /** + + @param x x + @param y y + @param z z + @param timestamp timestamp + */ + constructor(x: number, y: number, z: number, timestamp: number); + } + /** !#en Blend Function used for textures. + !#zh 图像的混合方式。 */ + export class BlendFunc { + /** + + @param src1 source blend function + @param dst1 destination blend function + */ + constructor(src1: number, dst1: number); + } + /** !#en + Enum for blend factor + Refer to: http://www.andersriggelsen.dk/glblendfunc.php + !#zh + 混合因子 + 可参考: http://www.andersriggelsen.dk/glblendfunc.php */ + export enum BlendFactor { + ONE = 0, + ZERO = 0, + SRC_ALPHA = 0, + SRC_COLOR = 0, + DST_ALPHA = 0, + DST_COLOR = 0, + ONE_MINUS_SRC_ALPHA = 0, + ONE_MINUS_SRC_COLOR = 0, + ONE_MINUS_DST_ALPHA = 0, + ONE_MINUS_DST_COLOR = 0, + blendFuncDisable = 0, + } + /** undefined */ + export enum TextAlignment { + LEFT = 0, + CENTER = 0, + RIGHT = 0, + } + /** undefined */ + export class WebGLColor { + /** + + @param r r + @param g g + @param b b + @param a a + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(r: number, g: number, b: number, a: number, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class Vertex2F { + /** + + @param x x + @param y y + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(x: number, y: number, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class Vertex3F { + /** + + @param x x + @param y y + @param z z + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(x: number, y: number, z: number, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class Tex2F { + /** + + @param u u + @param v v + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(u: number, v: number, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class Quad2 { + /** + + @param tl tl + @param tr tr + @param bl bl + @param br br + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(tl: Vertex2F, tr: Vertex2F, bl: Vertex2F, br: Vertex2F, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** A 3D Quad. 4 * 3 floats */ + export class Quad3 { + /** + + @param bl1 bl1 + @param br1 br1 + @param tl1 tl1 + @param tr1 tr1 + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(bl1: Vertex3F, br1: Vertex3F, tl1: Vertex3F, tr1: Vertex3F, arrayBuffer: any[], offset: number); + } + /** undefined */ + export class V3F_C4B_T2F { + /** + + @param vertices vertices + @param colors colors + @param texCoords texCoords + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(vertices: Vertex3F, colors: Color, texCoords: Tex2F, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT(): void; + } + /** undefined */ + export class V3F_C4B_T2F_Quad { + /** + + @param tl tl + @param bl bl + @param tr tr + @param br br + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(tl: V3F_C4B_T2F, bl: V3F_C4B_T2F, tr: V3F_C4B_T2F, br: V3F_C4B_T2F, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class V2F_C4B_T2F { + /** + + @param vertices vertices + @param colors colors + @param texCoords texCoords + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(vertices: Vertex2F, colors: Color, texCoords: Tex2F, arrayBuffer: any[], offset: number); + BYTES_PER_ELEMENT: number; + } + /** undefined */ + export class V2F_C4B_T2F_Triangle { + /** + + @param a a + @param b b + @param c c + @param arrayBuffer arrayBuffer + @param offset offset + */ + constructor(a: V2F_C4B_T2F, b: V2F_C4B_T2F, c: V2F_C4B_T2F, arrayBuffer: any[], offset: number); + } + /** !#en The base class of all value types. + !#zh 所有值类型的基类。 */ + export class ValueType { + /** + !#en This method returns an exact copy of current value. + !#zh 克隆当前值,该方法返回一个新对象,新对象的值和原对象相等。 + */ + clone(): ValueType; + /** + !#en Compares this object with the other one. + !#zh 当前对象是否等于指定对象。 + @param other other + */ + equals(other: ValueType): boolean; + /** + !#en + Linearly interpolates between this value to to value by ratio which is in the range [0, 1]. + When ratio = 0 returns this. When ratio = 1 return to. When ratio = 0.5 returns the average of this and to. + !#zh + 线性插值。
+ 当 ratio = 0 时返回自身,ratio = 1 时返回目标,ratio = 0.5 返回自身和目标的平均值。。 + @param to the to value + @param ratio the interpolation coefficient + */ + lerp(to: ValueType, ratio: number): ValueType; + /** + !#en TODO + !#zh 转换为方便阅读的字符串。 + */ + toString(): string; + } + /** !#en Representation of 2D vectors and points. + !#zh 表示 2D 向量和坐标 */ + export class Vec2 extends ValueType { + /** + !#en + Constructor + see {{#crossLink "cc/vec2:method"}}cc.v2{{/crossLink}} or {{#crossLink "cc/p:method"}}cc.p{{/crossLink}} + !#zh + 构造函数,可查看 {{#crossLink "cc/vec2:method"}}cc.v2{{/crossLink}} 或者 {{#crossLink "cc/p:method"}}cc.p{{/crossLink}} + @param x x + @param y y + */ + constructor(x?: number, y?: number); + x: number; + y: number; + /** + !#en clone a Vec2 value + !#zh 克隆一个 Vec2 值 + */ + clone(): Vec2; + /** + !#en TODO + !#zh 设置向量值。 + @param newValue !#en new value to set. !#zh 要设置的新值 + */ + set(newValue: Vec2): Vec2; + /** + !#en TODO + !#zh 当前的向量是否与指定的向量相等。 + @param other other + */ + equals(other: Vec2): boolean; + /** + !#en TODO + !#zh 转换为方便阅读的字符串。 + */ + toString(): string; + /** + !#en TODO + !#zh 线性插值。 + @param to to + @param ratio the interpolation coefficient + @param out optional, the receiving vector + */ + lerp(to: Vec2, ratio: number, out?: Vec2): Vec2; + /** + !#en Adds this vector. If you want to save result to another vector, use add() instead. + !#zh 向量加法。如果你想保存结果到另一个向量,使用 add() 代替。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.addSelf(cc.v2(5, 5));// return Vec2 {x: 15, y: 15}; + ``` + */ + addSelf(vector: Vec2): Vec2; + /** + !#en Adds two vectors, and returns the new result. + !#zh 向量加法,并返回新结果。 + @param vector vector + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + v.add(cc.v2(5, 5)); // return Vec2 {x: 15, y: 15}; + var v1; + v.add(cc.v2(5, 5), v1); // return Vec2 {x: 15, y: 15}; + ``` + */ + add(vector: Vec2, out?: Vec2): Vec2; + /** + !#en Subtracts one vector from this. If you want to save result to another vector, use sub() instead. + !#zh 向量减法。如果你想保存结果到另一个向量,可使用 sub() 代替。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.subSelf(cc.v2(5, 5));// return Vec2 {x: 5, y: 5}; + ``` + */ + subSelf(vector: Vec2): Vec2; + /** + !#en Subtracts one vector from this, and returns the new result. + !#zh 向量减法,并返回新结果。 + @param vector vector + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + v.sub(cc.v2(5, 5)); // return Vec2 {x: 5, y: 5}; + var v1; + v.sub(cc.v2(5, 5), v1); // return Vec2 {x: 5, y: 5}; + ``` + */ + sub(vector: Vec2, out?: Vec2): Vec2; + /** + !#en Multiplies this by a number. If you want to save result to another vector, use mul() instead. + !#zh 缩放当前向量。如果你想结果保存到另一个向量,可使用 mul() 代替。 + @param num num + + @example + ```js + var v = cc.v2(10, 10); + v.mulSelf(5);// return Vec2 {x: 50, y: 50}; + ``` + */ + mulSelf(num: number): Vec2; + /** + !#en Multiplies by a number, and returns the new result. + !#zh 缩放向量,并返回新结果。 + @param num num + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + v.mul(5); // return Vec2 {x: 50, y: 50}; + var v1; + v.mul(5, v1); // return Vec2 {x: 50, y: 50}; + ``` + */ + mul(num: number, out?: Vec2): Vec2; + /** + !#en Multiplies two vectors. + !#zh 分量相乘。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.scaleSelf(cc.v2(5, 5));// return Vec2 {x: 50, y: 50}; + ``` + */ + scaleSelf(vector: Vec2): Vec2; + /** + !#en Multiplies two vectors, and returns the new result. + !#zh 分量相乘,并返回新的结果。 + @param vector vector + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + v.scale(cc.v2(5, 5)); // return Vec2 {x: 50, y: 50}; + var v1; + v.scale(cc.v2(5, 5), v1); // return Vec2 {x: 50, y: 50}; + ``` + */ + scale(vector: Vec2, out?: Vec2): Vec2; + /** + !#en Divides by a number. If you want to save result to another vector, use div() instead. + !#zh 向量除法。如果你想结果保存到另一个向量,可使用 div() 代替。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.divSelf(5); // return Vec2 {x: 2, y: 2}; + ``` + */ + divSelf(vector: Vec2): Vec2; + /** + !#en Divides by a number, and returns the new result. + !#zh 向量除法,并返回新的结果。 + @param vector vector + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + v.div(5); // return Vec2 {x: 2, y: 2}; + var v1; + v.div(5, v1); // return Vec2 {x: 2, y: 2}; + ``` + */ + div(vector: Vec2, out?: Vec2): Vec2; + /** + !#en Negates the components. If you want to save result to another vector, use neg() instead. + !#zh 向量取反。如果你想结果保存到另一个向量,可使用 neg() 代替。 + + @example + ```js + var v = cc.v2(10, 10); + v.negSelf(); // return Vec2 {x: -10, y: -10}; + ``` + */ + negSelf(): Vec2; + /** + !#en Negates the components, and returns the new result. + !#zh 返回取反后的新向量。 + @param out optional, the receiving vector + + @example + ```js + var v = cc.v2(10, 10); + var v1; + v.neg(v1); // return Vec2 {x: -10, y: -10}; + ``` + */ + neg(out?: Vec2): Vec2; + /** + !#en Dot product + !#zh 当前向量与指定向量进行点乘。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.dot(cc.v2(5, 5)); // return 100; + ``` + */ + dot(vector?: Vec2): number; + /** + !#en Cross product + !#zh 当前向量与指定向量进行叉乘。 + @param vector vector + + @example + ```js + var v = cc.v2(10, 10); + v.cross(cc.v2(5, 5)); // return 0; + ``` + */ + cross(vector?: Vec2): number; + /** + !#en Returns the length of this vector. + !#zh 返回该向量的长度。 + + @example + ```js + var v = cc.v2(10, 10); + v.mag(); // return 14.142135623730951; + ``` + */ + mag(): number; + /** + !#en Returns the squared length of this vector. + !#zh 返回该向量的长度平方。 + + @example + ```js + var v = cc.v2(10, 10); + v.magSqr(); // return 200; + ``` + */ + magSqr(): number; + /** + !#en Make the length of this vector to 1. + !#zh 向量归一化,让这个向量的长度为 1。 + + @example + ```js + var v = cc.v2(10, 10); + v.normalizeSelf(); // return Vec2 {x: 0.7071067811865475, y: 0.7071067811865475}; + ``` + */ + normalizeSelf(): Vec2; + /** + !#en + Returns this vector with a magnitude of 1.
+
+ Note that the current vector is unchanged and a new normalized vector is returned. If you want to normalize the current vector, use normalizeSelf function. + !#zh + 返回归一化后的向量。
+
+ 注意,当前向量不变,并返回一个新的归一化向量。如果你想来归一化当前向量,可使用 normalizeSelf 函数。 + @param out optional, the receiving vector + */ + normalize(out?: Vec2): Vec2; + /** + !#en Get angle in radian between this and vector. + !#zh 夹角的弧度。 + @param vector vector + */ + angle(vector: Vec2): number; + /** + !#en Get angle in radian between this and vector with direction. + !#zh 带方向的夹角的弧度。 + @param vector vector + */ + signAngle(vector: Vec2): number; + /** + !#en rotate + !#zh 返回旋转给定弧度后的新向量。 + @param radians radians + @param out optional, the receiving vector + */ + rotate(radians: number, out?: Vec2): Vec2; + /** + !#en rotate self + !#zh 按指定弧度旋转向量。 + @param radians radians + */ + rotateSelf(radians: number): Vec2; + /** !#en return a Vec2 object with x = 1 and y = 1. + !#zh 新 Vec2 对象。 */ + static ONE: Vec2; + /** !#en return a Vec2 object with x = 0 and y = 0. + !#zh 返回 x = 0 和 y = 0 的 Vec2 对象。 */ + static ZERO: Vec2; + /** !#en return a Vec2 object with x = 0 and y = 1. + !#zh 返回 x = 0 和 y = 1 的 Vec2 对象。 */ + static UP: Vec2; + /** !#en return a Vec2 object with x = 1 and y = 0. + !#zh 返回 x = 1 和 y = 0 的 Vec2 对象。 */ + static RIGHT: Vec2; + } + /** undefined */ + export class PhysicsBoxCollider extends PhysicsCollider implements Collider.Box { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Box size + !#zh 包围盒大小 */ + size: Size; + } + /** undefined */ + export class PhysicsChainCollider extends PolygonCollider { + /** !#en Whether the chain is loop + !#zh 链条是否首尾相连 */ + loop: boolean; + /** !#en Chain points + !#zh 链条顶点数组 */ + points: [Vec2]; + } + /** undefined */ + export class PhysicsCircleCollider extends PhysicsCollider implements Collider.Circle { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Circle radius + !#zh 圆形半径 */ + radius: number; + } + /** undefined */ + export class PhysicsCollider { + /** !#en + The density. + !#zh + 密度 */ + density: number; + /** !#en + A sensor collider collects contact information but never generates a collision response + !#zh + 一个传感器类型的碰撞体会产生碰撞回调,但是不会发生物理碰撞效果。 */ + sensor: boolean; + /** !#en + The friction coefficient, usually in the range [0,1]. + !#zh + 摩擦系数,取值一般在 [0, 1] 之间 */ + friction: number; + /** !#en + The restitution (elasticity) usually in the range [0,1]. + !#zh + 弹性系数,取值一般在 [0, 1]之间 */ + restitution: number; + /** !#en + Physics collider will find the rigidbody component on the node and set to this property. + !#zh + 碰撞体会在初始化时查找节点上是否存在刚体,如果查找成功则赋值到这个属性上。 */ + body: RigidBody; + /** + !#en + Apply current changes to collider, this will regenerate inner box2d fixtures. + !#zh + 应用当前 collider 中的修改,调用此函数会重新生成内部 box2d 的夹具。 + */ + apply(): void; + /** + !#en + Get the world aabb of the collider + !#zh + 获取碰撞体的世界坐标系下的包围盒 + */ + getAABB(): void; + } + /** undefined */ + export class PhysicsPolygonCollider extends PhysicsCollider implements Collider.Polygon { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Polygon points + !#zh 多边形顶点数组 */ + points: [Vec2]; + } + /** !#en + A distance joint constrains two points on two bodies + to remain at a fixed distance from each other. You can view + this as a massless, rigid rod. + !#zh + 距离关节通过一个固定的长度来约束关节链接的两个刚体。你可以将它想象成一个无质量,坚固的木棍。 */ + export class DistanceJoint extends Joint { + /** !#en + The distance separating the two ends of the joint. + !#zh + 关节两端的距离 */ + distance: number; + /** !#en + The spring frequency. + !#zh + 弹性系数。 */ + frequency: number; + /** !#en + The damping ratio. + !#zh + 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */ + 0: number; + } + /** !#en + Base class for joints to connect rigidbody. + !#zh + 关节类的基类 */ + export class Joint extends Component { + /** !#en + The anchor of the rigidbody. + !#zh + 刚体的锚点。 */ + anchor: Vec2; + /** !#en + The anchor of the connected rigidbody. + !#zh + 关节另一端刚体的锚点。 */ + connectedAnchor: Vec2; + /** !#en + The rigidbody to which the other end of the joint is attached. + !#zh + 关节另一端链接的刚体 */ + connectedBody: RigidBody; + /** !#en + Should the two rigid bodies connected with this joint collide with each other? + !#zh + 链接到关节上的两个刚体是否应该相互碰撞? */ + collideConnected: boolean; + /** + !#en + Apply current changes to joint, this will regenerate inner box2d joint. + !#zh + 应用当前关节中的修改,调用此函数会重新生成内部 box2d 的关节。 + */ + apply(): void; + /** + !#en + Get the anchor point on rigidbody in world coordinates. + !#zh + 获取刚体世界坐标系下的锚点。 + */ + getWorldAnchor(): Vec2; + /** + !#en + Get the anchor point on connected rigidbody in world coordinates. + !#zh + 获取链接刚体世界坐标系下的锚点。 + */ + getWorldConnectedAnchor(): Vec2; + /** + !#en + Gets the reaction force of the joint. + !#zh + 获取关节的反作用力。 + @param timeStep The time to calculate the reaction force for. + */ + getReactionForce(timeStep: number): number; + /** + !#en + Gets the reaction torque of the joint. + !#zh + 获取关节的反扭矩。 + @param timeStep The time to calculate the reaction torque for. + */ + getReactionTorque(timeStep: number): number; + } + /** !#en + A motor joint is used to control the relative motion + between two bodies. A typical usage is to control the movement + of a dynamic body with respect to the ground. + !#zh + 马达关节被用来控制两个刚体间的相对运动。 + 一个典型的例子是用来控制一个动态刚体相对于地面的运动。 */ + export class MotorJoint extends Joint { + /** !#en + The anchor of the rigidbody. + !#zh + 刚体的锚点。 */ + anchor: Vec2; + /** !#en + The anchor of the connected rigidbody. + !#zh + 关节另一端刚体的锚点。 */ + connectedAnchor: Vec2; + /** !#en + The linear offset from connected rigidbody to rigidbody. + !#zh + 关节另一端的刚体相对于起始端刚体的位置偏移量 */ + linearOffset: Vec2; + /** !#en + The angular offset from connected rigidbody to rigidbody. + !#zh + 关节另一端的刚体相对于起始端刚体的角度偏移量 */ + angularOffset: number; + /** !#en + The maximum force can be applied to rigidbody. + !#zh + 可以应用于刚体的最大的力值 */ + maxForce: number; + /** !#en + The maximum torque can be applied to rigidbody. + !#zh + 可以应用于刚体的最大扭矩值 */ + maxTorque: number; + /** !#en + The position correction factor in the range [0,1]. + !#zh + 位置矫正系数,范围为 [0, 1] */ + correctionFactor: number; + } + /** !#en + A mouse joint is used to make a point on a body track a + specified world point. This a soft constraint with a maximum + force. This allows the constraint to stretch and without + applying huge forces. + Mouse Joint will auto register the touch event with the mouse region node, + and move the choosed rigidbody in touch move event. + Note : generally mouse joint only used in test bed. + !#zh + 鼠标关节用于使刚体上的一个点追踪一个指定的世界坐标系下的位置。 + 鼠标关节可以指定一个最大的里来施加一个柔和的约束。 + 鼠标关节会自动使用 mouse region 节点来注册鼠标事件,并且在触摸移动事件中移动选中的刚体。 + 注意:一般鼠标关节只在测试环境中使用。 */ + export class MouseJoint extends Joint { + /** !#en + The anchor of the rigidbody. + !#zh + 刚体的锚点。 */ + anchor: Vec2; + /** !#en + The anchor of the connected rigidbody. + !#zh + 关节另一端刚体的锚点。 */ + connectedAnchor: Vec2; + /** !#en + The node used to register touch evnet. + If this is null, it will be the joint's node. + !#zh + 用于注册触摸事件的节点。 + 如果没有设置这个值,那么将会使用关节的节点来注册事件。 */ + mouseRegion: Node; + /** !#en + The target point. + The mouse joint will move choosed rigidbody to target point. + !#zh + 目标点,鼠标关节将会移动选中的刚体到指定的目标点 */ + target: Vec2; + /** !#en + The spring frequency. + !#zh + 弹簧系数。 */ + frequency: number; + /** !#en + The damping ratio. + !#zh + 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */ + 0: number; + /** !#en + The maximum force + !#zh + 最大阻力值 */ + maxForce: number; + } + /** !#en + A prismatic joint. This joint provides one degree of freedom: translation + along an axis fixed in rigidbody. Relative rotation is prevented. You can + use a joint limit to restrict the range of motion and a joint motor to + drive the motion or to model joint friction. + !#zh + 移动关节指定了只能在一个方向上移动刚体。 + 你可以开启关节限制来设置刚体运行移动的间距,也可以开启马达来使用关节马达驱动刚体的运行。 */ + export class PrismaticJoint extends Joint { + /** !#en + The local joint axis relative to rigidbody. + !#zh + 指定刚体可以移动的方向。 */ + localAxisA: Vec2; + /** !#en + The reference angle. + !#zh + 相对角度 */ + referenceAngle: number; + /** !#en + Enable joint distance limit? + !#zh + 是否开启关节的距离限制? */ + enableLimit: boolean; + /** !#en + Enable joint motor? + !#zh + 是否开启关节马达? */ + enableMotor: boolean; + /** !#en + The lower joint limit. + !#zh + 刚体能够移动的最小值 */ + lowerLimit: number; + /** !#en + The upper joint limit. + !#zh + 刚体能够移动的最大值 */ + upperLimit: number; + /** !#en + The maxium force can be applied to rigidbody to rearch the target motor speed. + !#zh + 可以施加到刚体的最大力。 */ + maxMotorForce: number; + /** !#en + The expected motor speed. + !#zh + 期望的马达速度。 */ + motorSpeed: number; + } + /** !#en + A revolute joint constrains two bodies to share a common point while they + are free to rotate about the point. The relative rotation about the shared + point is the joint angle. You can limit the relative rotation with + a joint limit that specifies a lower and upper angle. You can use a motor + to drive the relative rotation about the shared point. A maximum motor torque + is provided so that infinite forces are not generated. + !#zh + 旋转关节可以约束两个刚体围绕一个点来进行旋转。 + 你可以通过开启关节限制来限制旋转的最大角度和最小角度。 + 你可以通过开启马达来施加一个扭矩力来驱动这两个刚体在这一点上的相对速度。 */ + export class RevoluteJoint extends Joint { + /** !#en + The reference angle. + An angle between bodies considered to be zero for the joint angle. + !#zh + 相对角度。 + 两个物体之间角度为零时可以看作相等于关节角度 */ + referenceAngle: number; + /** !#en + The lower angle. + !#zh + 角度的最低限制。 */ + lowerAngle: number; + /** !#en + The upper angle. + !#zh + 角度的最高限制。 */ + upperAngle: number; + /** !#en + The maxium torque can be applied to rigidbody to rearch the target motor speed. + !#zh + 可以施加到刚体的最大扭矩。 */ + maxMotorTorque: number; + /** !#en + The expected motor speed. + !#zh + 期望的马达速度。 */ + motorSpeed: number; + /** !#en + Enable joint limit? + !#zh + 是否开启关节的限制? */ + enableLimit: boolean; + /** !#en + Enable joint motor? + !#zh + 是否开启关节马达? */ + enableMotor: boolean; + /** + !#en + Get the joint angle. + !#zh + 获取关节角度。 + */ + getJointAngle(): number; + } + /** !#en + A rope joint enforces a maximum distance between two points + on two bodies. It has no other effect. + Warning: if you attempt to change the maximum length during + the simulation you will get some non-physical behavior. + !#zh + 绳子关节只指定两个刚体间的最大距离,没有其他的效果。 + 注意:如果你试图动态修改关节的长度,这有可能会得到一些意外的效果。 */ + export class RopeJoint extends Joint { + /** !#en + The max length. + !#zh + 最大长度。 */ + maxLength: number; + } + /** !#en + A weld joint essentially glues two bodies together. A weld joint may + distort somewhat because the island constraint solver is approximate. + !#zh + 熔接关节相当于将两个刚体粘在了一起。 + 熔接关节可能会使某些东西失真,因为约束求解器算出的都是近似值。 */ + export class WeldJoint extends Joint { + /** !#en + The reference angle. + !#zh + 相对角度。 */ + referenceAngle: number; + /** !#en + The frequency. + !#zh + 弹性系数。 */ + frequency: number; + /** !#en + The damping ratio. + !#zh + 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */ + 0: number; + } + /** !#en + A wheel joint. This joint provides two degrees of freedom: translation + along an axis fixed in bodyA and rotation in the plane. You can use a joint motor to drive + the rotation or to model rotational friction. + This joint is designed for vehicle suspensions. + !#zh + 轮子关节提供两个维度的自由度:旋转和沿着指定方向上位置的移动。 + 你可以通过开启关节马达来使用马达驱动刚体的旋转。 + 轮组关节是专门为机动车类型设计的。 */ + export class WheelJoint extends Joint { + /** !#en + The local joint axis relative to rigidbody. + !#zh + 指定刚体可以移动的方向。 */ + localAxisA: Vec2; + /** !#en + The maxium torque can be applied to rigidbody to rearch the target motor speed. + !#zh + 可以施加到刚体的最大扭矩。 */ + maxMotorTorque: number; + /** !#en + The expected motor speed. + !#zh + 期望的马达速度。 */ + motorSpeed: number; + /** !#en + Enable joint motor? + !#zh + 是否开启关节马达? */ + enableMotor: boolean; + /** !#en + The spring frequency. + !#zh + 弹性系数。 */ + frequency: number; + /** !#en + The damping ratio. + !#zh + 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */ + dampingRatio: number; + } + /**************************************************** + * Node + *****************************************************/ + + export module Node { + /** !#en The event type supported by Node + !#zh Node 支持的事件类型 */ + export class EventType { + /** !#en The event type for touch start event, you can use its value directly: 'touchstart' + !#zh 当手指触摸到屏幕时。 */ + static TOUCH_START: string; + /** !#en The event type for touch move event, you can use its value directly: 'touchmove' + !#zh 当手指在屏幕上目标节点区域内移动时。 */ + static TOUCH_MOVE: string; + /** !#en The event type for touch end event, you can use its value directly: 'touchend' + !#zh 当手指在目标节点区域内离开屏幕时。 */ + static TOUCH_END: string; + /** !#en The event type for touch end event, you can use its value directly: 'touchcancel' + !#zh 当手指在目标节点区域外离开屏幕时。 */ + static TOUCH_CANCEL: string; + /** !#en The event type for mouse down events, you can use its value directly: 'mousedown' + !#zh 当鼠标按下时触发一次。 */ + static MOUSE_DOWN: string; + /** !#en The event type for mouse move events, you can use its value directly: 'mousemove' + !#zh 当鼠标在目标节点在目标节点区域中移动时,不论是否按下。 */ + static MOUSE_MOVE: string; + /** !#en The event type for mouse enter target events, you can use its value directly: 'mouseenter' + !#zh 当鼠标移入目标节点区域时,不论是否按下。 */ + static MOUSE_ENTER: string; + /** !#en The event type for mouse leave target events, you can use its value directly: 'mouseleave' + !#zh 当鼠标移出目标节点区域时,不论是否按下。 */ + static MOUSE_LEAVE: string; + /** !#en The event type for mouse up events, you can use its value directly: 'mouseup' + !#zh 当鼠标从按下状态松开时触发一次。 */ + static MOUSE_UP: string; + /** !#en The event type for mouse wheel events, you can use its value directly: 'mousewheel' + !#zh 当鼠标滚轮滚动时。 */ + static MOUSE_WHEEL: string; + } + } + + /**************************************************** + * audioEngine + *****************************************************/ + + export module audioEngine { + /** !#en Audio state. + !#zh 声音播放状态 */ + export enum AudioState { + ERROR = 0, + INITIALZING = 0, + PLAYING = 0, + PAUSED = 0, + } + } + + /**************************************************** + * ParticleSystem + *****************************************************/ + + export module ParticleSystem { + /** !#en Enum for emitter modes + !#zh 发射模式 */ + export enum EmitterMode { + GRAVITY = 0, + RADIUS = 0, + } + } + + /**************************************************** + * ParticleSystem + *****************************************************/ + + export module ParticleSystem { + /** !#en Enum for particles movement type. + !#zh 粒子位置类型 */ + export enum PositionType { + FREE = 0, + RELATIVE = 0, + GROUPED = 0, + } + } + + /**************************************************** + * TiledMap + *****************************************************/ + + export module TiledMap { + /** !#en The orientation of tiled map. + !#zh Tiled Map 地图方向。 */ + export enum Orientation { + ORTHO = 0, + HEX = 0, + ISO = 0, + NONE = 0, + MAP = 0, + LAYER = 0, + OBJECTGROUP = 0, + OBJECT = 0, + TILE = 0, + HORIZONTAL = 0, + VERTICAL = 0, + DIAGONAL = 0, + FLIPPED_ALL = 0, + FLIPPED_MASK = 0, + STAGGERAXIS_X = 0, + STAGGERAXIS_Y = 0, + STAGGERINDEX_ODD = 0, + STAGGERINDEX_EVEN = 0, + } + } + + /**************************************************** + * Collider + *****************************************************/ + + export module Collider { + /** !#en Defines a Box Collider . + !#zh 用来定义包围盒碰撞体 */ + export class Box { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Box size + !#zh 包围盒大小 */ + size: Size; + } + } + + /**************************************************** + * Collider + *****************************************************/ + + export module Collider { + /** !#en Defines a Circle Collider . + !#zh 用来定义圆形碰撞体 */ + export class Circle { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Circle radius + !#zh 圆形半径 */ + radius: number; + } + } + + /**************************************************** + * Collider + *****************************************************/ + + export module Collider { + /** !#en Defines a Polygon Collider . + !#zh 用来定义多边形碰撞体 */ + export class Polygon { + /** !#en Position offset + !#zh 位置偏移量 */ + offset: Vec2; + /** !#en Polygon points + !#zh 多边形顶点数组 */ + points: [Vec2]; + } + } + + /**************************************************** + * Button + *****************************************************/ + + export module Button { + /** !#en Enum for transition type. + !#zh 过渡类型 */ + export enum Transition { + NONE = 0, + COLOR = 0, + SPRITE = 0, + SCALE = 0, + } + } + + /**************************************************** + * Component + *****************************************************/ + + export module Component { + /** !#en + Component will register a event to target component's handler. + And it will trigger the handler when a certain event occurs. + + !@zh + “EventHandler” 类用来设置场景中的事件回调, + 该类允许用户设置回调目标节点,目标组件名,组件方法名, + 并可通过 emit 方法调用目标函数。 */ + export class EventHandler { + /** !#en Event target + !#zh 目标节点 */ + target: Node; + /** !#en Component name + !#zh 目标组件名 */ + component: string; + /** !#en Event handler + !#zh 响应事件函数名 */ + handler: string; + /** !#en Custom Event Data + !#zh 自定义事件数据 */ + customEventData: string; + /** + + @param events events + @param params params + */ + static emitEvents(events: Component.EventHandler[], ...params: any[]): void; + /** + !#en Emit event with params + !#zh 触发目标组件上的指定 handler 函数,该参数是回调函数的参数值(可不填)。 + @param params params + + @example + ```js + // Call Function + var eventHandler = new cc.Component.EventHandler(); + eventHandler.target = newTarget; + eventHandler.component = "MainMenu"; + eventHandler.handler = "OnClick" + eventHandler.emit(["param1", "param2", ....]); + ``` + */ + emit(params: any[]): void; + } + } + + /**************************************************** + * EditBox + *****************************************************/ + + export module EditBox { + /** !#en Enum for keyboard return types + !#zh 键盘的返回键类型 */ + export enum KeyboardReturnType { + DEFAULT = 0, + DONE = 0, + SEND = 0, + SEARCH = 0, + GO = 0, + } + } + + /**************************************************** + * EditBox + *****************************************************/ + + export module EditBox { + /** !#en The EditBox's InputMode defines the type of text that the user is allowed to enter. + !#zh 输入模式 */ + export enum InputMode { + ANY = 0, + EMAIL_ADDR = 0, + NUMERIC = 0, + PHONE_NUMBER = 0, + URL = 0, + DECIMAL = 0, + SINGLE_LINE = 0, + } + } + + /**************************************************** + * EditBox + *****************************************************/ + + export module EditBox { + /** !#en Enum for the EditBox's input flags + !#zh 定义了一些用于设置文本显示和文本格式化的标志位。 */ + export enum InputFlag { + PASSWORD = 0, + SENSITIVE = 0, + INITIAL_CAPS_WORD = 0, + INITIAL_CAPS_SENTENCE = 0, + INITIAL_CAPS_ALL_CHARACTERS = 0, + } + } + + /**************************************************** + * Label + *****************************************************/ + + export module Label { + /** !#en Enum for text alignment. + !#zh 文本横向对齐类型 */ + export enum HorizontalAlign { + LEFT = 0, + CENTER = 0, + RIGHT = 0, + } + } + + /**************************************************** + * Label + *****************************************************/ + + export module Label { + /** !#en Enum for vertical text alignment. + !#zh 文本垂直对齐类型 */ + export enum VerticalAlign { + TOP = 0, + CENTER = 0, + BOTTOM = 0, + } + } + + /**************************************************** + * Label + *****************************************************/ + + export module Label { + /** !#en Enum for Overflow. + !#zh Overflow 类型 */ + export enum Overflow { + NONE = 0, + CLAMP = 0, + SHRINK = 0, + RESIZE_HEIGHT = 0, + } + } + + /**************************************************** + * Label + *****************************************************/ + + export module Label { + /** !#en Enum for font type. + !#zh Type 类型 */ + export enum Type { + TTF = 0, + BMFont = 0, + SystemFont = 0, + } + } + + /**************************************************** + * Layout + *****************************************************/ + + export module Layout { + /** !#en Enum for Layout type + !#zh 布局类型 */ + export enum Type { + NONE = 0, + HORIZONTAL = 0, + VERTICAL = 0, + GRID = 0, + } + } + + /**************************************************** + * Layout + *****************************************************/ + + export module Layout { + /** !#en Enum for Layout Resize Mode + !#zh 缩放模式 */ + export enum ResizeMode { + NONE = 0, + CONTAINER = 0, + CHILDREN = 0, + } + } + + /**************************************************** + * Layout + *****************************************************/ + + export module Layout { + /** !#en Enum for Grid Layout start axis direction. + The items in grid layout will be arranged in each axis at first.; + !#zh 布局轴向,只用于 GRID 布局。 */ + export enum AxisDirection { + HORIZONTAL = 0, + VERTICAL = 0, + } + } + + /**************************************************** + * Layout + *****************************************************/ + + export module Layout { + /** !#en Enum for vertical layout direction. + Used in Grid Layout together with AxisDirection is VERTICAL + !#zh 垂直方向布局方式 */ + export enum VerticalDirection { + BOTTOM_TO_TOP = 0, + TOP_TO_BOTTOM = 0, + } + } + + /**************************************************** + * Layout + *****************************************************/ + + export module Layout { + /** !#en Enum for horizontal layout direction. + Used in Grid Layout together with AxisDirection is HORIZONTAL + !#zh 水平方向布局方式 */ + export enum HorizontalDirection { + LEFT_TO_RIGHT = 0, + RIGHT_TO_LEFT = 0, + } + } + + /**************************************************** + * Mask + *****************************************************/ + + export module Mask { + /** !#en the type for mask. + !#zh 遮罩组件类型 */ + export enum Type { + RECT = 0, + ELLIPSE = 0, + IMAGE_STENCIL = 0, + } + } + + /**************************************************** + * PageView + *****************************************************/ + + export module PageView { + /** !#en The Page View Size Mode + !#zh 页面视图每个页面统一的大小类型 */ + export enum SizeMode { + Unified = 0, + Free = 0, + } + } + + /**************************************************** + * PageView + *****************************************************/ + + export module PageView { + /** !#en The Page View Direction + !#zh 页面视图滚动类型 */ + export enum Direction { + Horizontal = 0, + Vertical = 0, + } + } + + /**************************************************** + * PageView + *****************************************************/ + + export module PageView { + /** !#en Enum for ScrollView event type. + !#zh 滚动视图事件类型 */ + export enum EventType { + PAGE_TURNING = 0, + } + } + + /**************************************************** + * PageViewIndicator + *****************************************************/ + + export module PageViewIndicator { + /** !#en Enum for PageView Indicator direction + !#zh 页面视图指示器的摆放方向 */ + export enum Direction { + HORIZONTAL = 0, + VERTICAL = 0, + } + } + + /**************************************************** + * ProgressBar + *****************************************************/ + + export module ProgressBar { + /** !#en Enum for ProgressBar mode + !#zh 进度条模式 */ + export enum Mode { + HORIZONTAL = 0, + VERTICAL = 0, + FILLED = 0, + } + } + + /**************************************************** + * Scrollbar + *****************************************************/ + + export module Scrollbar { + /** Enum for Scrollbar direction */ + export enum Direction { + HORIZONTAL = 0, + VERTICAL = 0, + } + } + + /**************************************************** + * ScrollView + *****************************************************/ + + export module ScrollView { + /** !#en Enum for ScrollView event type. + !#zh 滚动视图事件类型 */ + export enum EventType { + SCROLL_TO_TOP = 0, + SCROLL_TO_BOTTOM = 0, + SCROLL_TO_LEFT = 0, + SCROLL_TO_RIGHT = 0, + SCROLLING = 0, + BOUNCE_TOP = 0, + BOUNCE_BOTTOM = 0, + BOUNCE_LEFT = 0, + BOUNCE_RIGHT = 0, + SCROLL_ENDED = 0, + TOUCH_UP = 0, + AUTOSCROLL_ENDED_WITH_THRESHOLD = 0, + SCROLL_BEGAN = 0, + } + } + + /**************************************************** + * Slider + *****************************************************/ + + export module Slider { + /** !#en The Slider Direction + !#zh 滑动器方向 */ + export enum Direction { + Horizontal = 0, + Vertical = 0, + } + } + + /**************************************************** + * Sprite + *****************************************************/ + + export module Sprite { + /** !#en Enum for sprite type. + !#zh Sprite 类型 */ + export enum Type { + SIMPLE = 0, + SLICED = 0, + TILED = 0, + FILLED = 0, + } + } + + /**************************************************** + * Sprite + *****************************************************/ + + export module Sprite { + /** !#en Enum for fill type. + !#zh 填充类型 */ + export enum FillType { + HORIZONTAL = 0, + VERTICAL = 0, + RADIAL = 0, + } + } + + /**************************************************** + * Sprite + *****************************************************/ + + export module Sprite { + /** !#en Sprite Size can track trimmed size, raw size or none. + !#zh 精灵尺寸调整模式 */ + export enum SizeMode { + CUSTOM = 0, + TRIMMED = 0, + RAW = 0, + } + } + + /**************************************************** + * VideoPlayer + *****************************************************/ + + export module VideoPlayer { + /** !#en Video event type + !#zh 视频事件类型 */ + export enum EventType { + PLAYING = 0, + PAUSED = 0, + STOPPED = 0, + COMPLETED = 0, + META_LOADED = 0, + CLICKED = 0, + READY_TO_PLAY = 0, + } + } + + /**************************************************** + * VideoPlayer + *****************************************************/ + + export module VideoPlayer { + /** !#en Enum for video resouce type type. + !#zh 视频来源 */ + export enum ResourceType { + REMOTE = 0, + LOCAL = 0, + } + } + + /**************************************************** + * WebView + *****************************************************/ + + export module WebView { + /** !#en WebView event type + !#zh 网页视图事件类型 */ + export enum EventType { + LOADED = 0, + LOADING = 0, + ERROR = 0, + } + } + + /**************************************************** + * Event + *****************************************************/ + + export module Event { + /** !#en The Custom event + !#zh 自定义事件 */ + export class EventCustom extends Event { + /** + + @param type The name of the event (case-sensitive), e.g. "click", "fire", or "submit" + @param bubbles A boolean indicating whether the event bubbles up through the tree or not + */ + constructor(type: string, bubbles: boolean); + /** !#en A reference to the detailed data of the event + !#zh 事件的详细数据 */ + detail: any; + /** + !#en Sets user data + !#zh 设置用户数据 + @param data data + */ + setUserData(data: any): void; + /** + !#en Gets user data + !#zh 获取用户数据 + */ + getUserData(): any; + /** + !#en Gets event name + !#zh 获取事件名称 + */ + getEventName(): string; + /** !#en + The keyCode read-only property represents a system and implementation dependent numerical code identifying the unmodified value of the pressed key.
+ This is usually the decimal ASCII (RFC 20) or Windows 1252 code corresponding to the key.
+ If the key can't be identified, this value is 0.
+ + !#zh + keyCode 是只读属性它表示一个系统和依赖于实现的数字代码,可以识别按键的未修改值。
+ 这通常是十进制 ASCII (RFC20) 或者 Windows 1252 代码,所对应的密钥。
+ 如果无法识别该键,则该值为 0。 */ + keyCode: number; + } + } + + /**************************************************** + * SystemEvent + *****************************************************/ + + export module SystemEvent { + /** !#en The event type supported by SystemEvent + !#zh SystemEvent 支持的事件类型 */ + export class EventType { + /** !#en The event type for press the key down event, you can use its value directly: 'keydown' + !#zh 当按下按键时触发的事件 */ + static KEY_DOWN: string; + /** !#en The event type for press the key up event, you can use its value directly: 'keyup' + !#zh 当松开按键时触发的事件 */ + static KEY_UP: string; + /** !#en The event type for press the devicemotion event, you can use its value directly: 'devicemotion' + !#zh 重力感应 */ + static DEVICEMOTION: string; + } + } + + /**************************************************** + * Event + *****************************************************/ + + export module Event { + /** !#en The mouse event + !#zh 鼠标事件类型 */ + export class EventMouse extends Event { + /** + !#en Sets scroll data. + !#zh 设置鼠标的滚动数据。 + @param scrollX scrollX + @param scrollY scrollY + */ + setScrollData(scrollX: number, scrollY: number): void; + /** + !#en Returns the x axis scroll value. + !#zh 获取鼠标滚动的X轴距离,只有滚动时才有效。 + */ + getScrollX(): number; + /** + !#en Returns the y axis scroll value. + !#zh 获取滚轮滚动的 Y 轴距离,只有滚动时才有效。 + */ + getScrollY(): number; + /** + !#en Sets cursor location. + !#zh 设置当前鼠标位置。 + @param x x + @param y y + */ + setLocation(x: number, y: number): void; + /** + !#en Returns cursor location. + !#zh 获取鼠标位置对象,对象包含 x 和 y 属性。 + */ + getLocation(): Vec2; + /** + !#en Returns the current cursor location in screen coordinates. + !#zh 获取当前事件在游戏窗口内的坐标位置对象,对象包含 x 和 y 属性。 + */ + getLocationInView(): Vec2; + /** + !#en Returns the previous touch location. + !#zh 获取鼠标点击在上一次事件时的位置对象,对象包含 x 和 y 属性。 + */ + getPreviousLocation(): Vec2; + /** + !#en Returns the delta distance from the previous location to current location. + !#zh 获取鼠标距离上一次事件移动的距离对象,对象包含 x 和 y 属性。 + */ + getDelta(): Vec2; + /** + !#en Returns the X axis delta distance from the previous location to current location. + !#zh 获取鼠标距离上一次事件移动的 X 轴距离。 + */ + getDeltaX(): number; + /** + !#en Returns the Y axis delta distance from the previous location to current location. + !#zh 获取鼠标距离上一次事件移动的 Y 轴距离。 + */ + getDeltaY(): number; + /** + !#en Sets mouse button. + !#zh 设置鼠标按键。 + @param button button + */ + setButton(button: number): void; + /** + !#en Returns mouse button. + !#zh 获取鼠标按键。 + */ + getButton(): number; + /** + !#en Returns location X axis data. + !#zh 获取鼠标当前位置 X 轴。 + */ + getLocationX(): number; + /** + !#en Returns location Y axis data. + !#zh 获取鼠标当前位置 Y 轴。 + */ + getLocationY(): number; + /** !#en The none event code of mouse event. + !#zh 无。 */ + static NONE: number; + /** !#en The event type code of mouse down event. + !#zh 鼠标按下事件。 */ + static DOWN: number; + /** !#en The event type code of mouse up event. + !#zh 鼠标按下后释放事件。 */ + static UP: number; + /** !#en The event type code of mouse move event. + !#zh 鼠标移动事件。 */ + static MOVE: number; + /** !#en The event type code of mouse scroll event. + !#zh 鼠标滚轮事件。 */ + static SCROLL: number; + /** !#en The tag of Mouse left button. + !#zh 鼠标左键的标签。 */ + static BUTTON_LEFT: number; + /** !#en The tag of Mouse right button (The right button number is 2 on browser). + !#zh 鼠标右键的标签。 */ + static BUTTON_RIGHT: number; + /** !#en The tag of Mouse middle button (The right button number is 1 on browser). + !#zh 鼠标中键的标签。 */ + static BUTTON_MIDDLE: number; + /** !#en The tag of Mouse button 4. + !#zh 鼠标按键 4 的标签。 */ + static BUTTON_4: number; + /** !#en The tag of Mouse button 5. + !#zh 鼠标按键 5 的标签。 */ + static BUTTON_5: number; + /** !#en The tag of Mouse button 6. + !#zh 鼠标按键 6 的标签。 */ + static BUTTON_6: number; + /** !#en The tag of Mouse button 7. + !#zh 鼠标按键 7 的标签。 */ + static BUTTON_7: number; + /** !#en The tag of Mouse button 8. + !#zh 鼠标按键 8 的标签。 */ + static BUTTON_8: number; + } + } + + /**************************************************** + * Event + *****************************************************/ + + export module Event { + /** !#en The touch event + !#zh 触摸事件 */ + export class EventTouch extends Event { + /** + + @param touchArr The array of the touches + @param bubbles A boolean indicating whether the event bubbles up through the tree or not + */ + constructor(touchArr: any[], bubbles: boolean); + /** !#en The current touch object + !#zh 当前触点对象 */ + touch: Touch; + /** + !#en Returns event code. + !#zh 获取事件类型。 + */ + getEventCode(): number; + /** + !#en Returns touches of event. + !#zh 获取触摸点的列表。 + */ + getTouches(): any[]; + /** + !#en Sets touch location. + !#zh 设置当前触点位置 + @param x x + @param y y + */ + setLocation(x: number, y: number): void; + /** + !#en Returns touch location. + !#zh 获取触点位置。 + */ + getLocation(): Vec2; + /** + !#en Returns the current touch location in screen coordinates. + !#zh 获取当前触点在游戏窗口中的位置。 + */ + getLocationInView(): Vec2; + /** + !#en Returns the previous touch location. + !#zh 获取触点在上一次事件时的位置对象,对象包含 x 和 y 属性。 + */ + getPreviousLocation(): Vec2; + /** + !#en Returns the start touch location. + !#zh 获获取触点落下时的位置对象,对象包含 x 和 y 属性。 + */ + getStartLocation(): Vec2; + /** + !#en Returns the id of cc.Touch. + !#zh 触点的标识 ID,可以用来在多点触摸中跟踪触点。 + */ + getID(): number; + /** + !#en Returns the delta distance from the previous location to current location. + !#zh 获取触点距离上一次事件移动的距离对象,对象包含 x 和 y 属性。 + */ + getDelta(): Vec2; + /** + !#en Returns the X axis delta distance from the previous location to current location. + !#zh 获取触点距离上一次事件移动的 x 轴距离。 + */ + getDeltaX(): number; + /** + !#en Returns the Y axis delta distance from the previous location to current location. + !#zh 获取触点距离上一次事件移动的 y 轴距离。 + */ + getDeltaY(): number; + /** + !#en Returns location X axis data. + !#zh 获取当前触点 X 轴位置。 + */ + getLocationX(): number; + /** + !#en Returns location Y axis data. + !#zh 获取当前触点 Y 轴位置。 + */ + getLocationY(): number; + } + } + + /**************************************************** + * Event + *****************************************************/ + + export module Event { + /** !#en The acceleration event + !#zh 加速度事件 */ + export class EventAcceleration extends Event { + } + } + + /**************************************************** + * Event + *****************************************************/ + + export module Event { + /** !#en The keyboard event + !#zh 键盘事件 */ + export class EventKeyboard extends Event { + } + } + + /**************************************************** + * Graphics + *****************************************************/ + + export module Graphics { + /** !#en Enum for LineCap. + !#zh 线段末端属性 */ + export enum LineCap { + BUTT = 0, + ROUND = 0, + SQUARE = 0, + } + } + + /**************************************************** + * Graphics + *****************************************************/ + + export module Graphics { + /** !#en Enum for LineJoin. + !#zh 线段拐角属性 */ + export enum LineJoin { + BEVEL = 0, + ROUND = 0, + MITER = 0, + } + } + + /**************************************************** + * Pipeline + *****************************************************/ + + export module Pipeline { + /** The downloader pipe, it can download several types of files: + 1. Text + 2. Image + 3. Script + 4. Audio + 5. Assets + All unknown type will be downloaded as plain text. + You can pass custom supported types in the constructor. */ + export class Downloader { + /** + Constructor of Downloader, you can pass custom supported types. + @param extMap Custom supported types with corresponded handler + + @example + ```js + var downloader = new Downloader({ + // This will match all url with `.scene` extension or all url with `scene` type + 'scene' : function (url, callback) {} + }); + ``` + */ + constructor(extMap: any); + /** + Add custom supported types handler or modify existing type handler. + @param extMap Custom supported types with corresponded handler + */ + addHandlers(extMap: any): void; + } + } + + /**************************************************** + * Pipeline + *****************************************************/ + + export module Pipeline { + /** The loader pipe, it can load several types of files: + 1. Images + 2. JSON + 3. Plist + 4. Audio + 5. Font + 6. Cocos Creator scene + It will not interfere with items of unknown type. + You can pass custom supported types in the constructor. */ + export class Loader { + /** + Constructor of Loader, you can pass custom supported types. + @param extMap Custom supported types with corresponded handler + + @example + ```js + var loader = new Loader({ + // This will match all url with `.scene` extension or all url with `scene` type + 'scene' : function (url, callback) {} + }); + ``` + */ + constructor(extMap: any); + /** + Add custom supported types handler or modify existing type handler. + @param extMap Custom supported types with corresponded handler + */ + addHandlers(extMap: any): void; + } + } + + /**************************************************** + * LoadingItems + *****************************************************/ + + export module LoadingItems { + /** !#en The item states of the LoadingItems, its value could be LoadingItems.ItemState.WORKING | LoadingItems.ItemState.COMPLETET | LoadingItems.ItemState.ERROR + !#zh LoadingItems 队列中的加载项状态,状态的值可能是 LoadingItems.ItemState.WORKING | LoadingItems.ItemState.COMPLETET | LoadingItems.ItemState.ERROR */ + export enum ItemState { + WORKING = 0, + COMPLETET = 0, + ERROR = 0, + } + } + + /**************************************************** + * Texture2D + *****************************************************/ + + export module Texture2D { + /** The texture pixel format, default value is RGBA8888 */ + export enum PixelFormat { + RGB565 = 0, + RGB5A1 = 0, + RGBA4444 = 0, + RGB888 = 0, + RGBA8888 = 0, + A8 = 0, + I8 = 0, + AI88 = 0, + } + } + + /**************************************************** + * Texture2D + *****************************************************/ + + export module Texture2D { + /** The texture wrap mode */ + export enum WrapMode { + REPEAT = 0, + CLAMP_TO_EDGE = 0, + MIRRORED_REPEAT = 0, + } + } + + /**************************************************** + * Texture2D + *****************************************************/ + + export module Texture2D { + /** The texture filter mode */ + export enum Filter { + LINEAR = 0, + NEAREST = 0, + } + } + +} + +/** !#en +AnySDK is a third party solution that offers game developers SDK integration without making changes to the SDK's features or parameters.It can do all of this while remaining invisible to your end user.Our goal is to handle all the tedious SDK integration work for you so that you can use your time to focus on the game itself.No matter if it’s the channel SDK, user system, payment system, ad system, statistics system, sharing system or any other type of SDK: we’ll take care of it for you. +!#zh +AnySDK 为 CP 提供一套第三方 SDK 接入解决方案,整个接入过程,不改变任何 SDK 的功能、特性、参数等,对于最终玩家而言是完全透明无感知的。 +目的是让 CP 商能有更多时间更专注于游戏本身的品质,所有 SDK 的接入工作统统交给我们吧。第三方 SDK 包括了渠道SDK、用户系统、支付系统、广告系统、统计系统、分享系统等等。 */ +declare module anysdk { + /** !#en + agent manager of plugin + !#zh + 插件管理对象 */ + export var agentManager: anysdk.AgentManager; + /** !#en + agent manager of plugin + !#zh + 插件管理类 */ + export class AgentManager { + /** + !#en + AppKey appSecret and privateKey are the only three parameters generated + after the packing tool client finishes creating the game. + The oauthLoginServer parameter is the API address provided by the game service + to login verification + !#zh + appKey、appSecret、privateKey是通过 AnySDK 客户端工具创建游戏后生成的。 + oauthLoginServer参数是游戏服务提供的用来做登陆验证转发的接口地址。 + @param appKey appKey + @param appSecret appSecret + @param privateKey privateKey + @param oauthLoginServer oauthLoginServer + */ + init(appKey: string, appSecret: string, privateKey: string, oauthLoginServer: string): void; + /** + !#en + load all plugins, the operation includes SDK`s initialization + !#zh + 加载所有插件,该操作包含了 SDKs 初始化 + @param callback callback + @param target The object to bind to. + */ + loadAllPlugins(callback: Function, target: any): void; + /** + !#en + unload all plugins + !#zh + 卸载插件 + */ + unloadAllPlugins(): void; + /** + !#en + get user system plugin + !#zh + 获取用户系统插件 + */ + getUserPlugin(): anysdk.ProtocolUser; + /** + !#en + get IAP system plugins + !#zh + 获取支付系统插件 + */ + getIAPPlugins(): anysdk.ProtocolIAP[]; + /** + !#en + get IAP system plugin + !#zh + 获取支付系统插件 + */ + getIAPPlugin(): anysdk.ProtocolIAP; + /** + !#en + get social system plugin + !#zh + 获取社交系统插件 + */ + getSocialPlugin(): anysdk.ProtocolSocial; + /** + !#en + get share system plugin + !#zh + 获取分享系统插件 + */ + getSharePlugin(): anysdk.ProtocolShare; + /** + !#en + get analytics system plugin + !#zh + 获取统计系统插件 + */ + getAnalyticsPlugin(): anysdk.ProtocolAnalytics; + /** + !#en + get ads system plugin + !#zh + 获取广告系统插件 + */ + getAdsPlugin(): anysdk.ProtocolAds; + /** + !#en + get push system plugin + !#zh + 获取推送系统插件 + */ + getPushPlugin(): anysdk.ProtocolPush; + /** + !#en + get REC system plugin + !#zh + 获取录屏系统插件 + */ + getRECPlugin(): anysdk.ProtocolREC; + /** + !#en + get crash system plugin + !#zh + 获取崩溃分析系统插件 + */ + getCrashPlugin(): anysdk.ProtocolCrash; + /** + !#en + get ad track system plugin + !#zh + 获取广告追踪系统插件 + */ + getAdTrackingPlugin(): anysdk.ProtocolAdTracking; + /** + !#en + get custom system plugin + !#zh + 获取自定义系统插件 + */ + getCustomPlugin(): anysdk.ProtocolCustom; + /** + !#en + get custom parameter + !#zh + 获取自定义参数 + */ + getCustomParam(): string; + /** + !#en + get channel id + !#zh + 获取渠道唯一表示符 + */ + getChannelId(): string; + /** + !#en + get status of analytics + !#zh + 获取统计状态 + */ + isAnaylticsEnabled(): boolean; + /** + !#en + set whether to analytics + !#zh + 设置是否统计 + @param enabled enabled + */ + setIsAnaylticsEnabled(enabled: boolean): void; + /** + !#en + destory instance + !#zh + 销毁单例 + */ + static end(): void; + /** + !#en + get instance + !#zh + 获取单例 + */ + static getInstance(): anysdk.AgentManager; + } + /** !#en + plugin protocol + !#zh + 插件协议 */ + export class PluginProtocol { + /** + !#en + Check whether the function is supported + !#zh + 判断函数是否支持 + @param functionName functionName + */ + isFunctionSupported(functionName: string): boolean; + /** + !#en + get plugin name + !#zh + 获取插件名称 + */ + getPluginName(): string; + /** + !#en + get plugin version + !#zh + 获取插件版本 + */ + getPluginVersion(): string; + /** + !#en + get SDK version + !#zh + 获取 SDK 版本 + */ + getSDKVersion(): string; + /** + !#en + void methods for reflections with parameter + !#zh + 反射调用带参数的void方法 + @param funName funName + @param args optional arguments + */ + callFuncWithParam(funName: string, ...args: any|anysdk.PluginParam[]): void; + /** + !#en + String methods for reflections with parameter + !#zh + 反射调用带参数的 String 方法 + @param funName funName + @param args optional arguments + */ + callStringFuncWithParam(funName: string, ...args: any|anysdk.PluginParam[]): string; + /** + !#en + int methods for reflections with parameter + !#zh + 反射调用带参数的 Int 方法 + @param funName funName + @param args optional arguments + */ + callIntFuncWithParam(funName: string, ...args: any|anysdk.PluginParam[]): number; + /** + !#en + boolean methods for reflections with parameter + !#zh + 反射调用带参数的 boolean 方法 + @param funName funName + @param args optional arguments + */ + callBoolFuncWithParam(funName: string, ...args: any|anysdk.PluginParam[]): boolean; + /** + !#en + float methods for reflections with parameter + !#zh + 反射调用带参数的 float 方法 + @param funName funName + @param args optional arguments + */ + callFloatFuncWithParam(funName: string, ...args: any|anysdk.PluginParam[]): number; + } + /** !#en + user protocol + !#zh + 用户系统协议接口 */ + export class ProtocolUser extends PluginProtocol { + /** + !#en + login interface + !#zh + 登录接口 + @param args optional arguments + */ + login(...args: string|any[]): void; + /** + !#en + get status of login + !#zh + 获取登录状态 + */ + isLogined(): boolean; + /** + !#en + get user ID + !#zh + 获取用户唯一标示符 + */ + getUserID(): string; + /** + !#en + get plugin ID + !#zh + 获取插件ID + */ + getPluginId(): string; + /** + !#en + set listener + !#zh + 设置用户系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取用户系统的监听 + */ + getListener(): Function; + /** + !#en + logout + Before to invoke, you need to verdict whether this properties existed + !#zh + 登出,调用前需要判断属性是否存在 + */ + logout(): void; + /** + !#en + show toolbar + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示悬浮窗,调用前需要判断属性是否存在 + @param place place + */ + showToolBar(place: anysdk.ToolBarPlace): void; + /** + !#en + hide toolbar + Before to invoke, you need to verdict whether this properties existed + !#zh + 隐藏悬浮窗,调用前需要判断属性是否存在 + */ + hideToolBar(): void; + /** + !#en + enter platform + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示平台中心,调用前需要判断属性是否存在 + */ + enterPlatform(): void; + /** + !#en + show exit page + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示退出界面,调用前需要判断属性是否存在 + */ + exit(): void; + /** + !#en + show pause page + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示暂停界面,调用前需要判断属性是否存在 + */ + pause(): void; + /** + !#en + Real-name registration + Before to invoke, you need to verdict whether this properties existed + !#zh + 实名注册,调用前需要判断属性是否存在 + */ + realNameRegister(): void; + /** + !#en + Anti-addiction query + Before to invoke, you need to verdict whether this properties existed + !#zh + 防沉迷查询,调用前需要判断属性是否存在 + */ + antiAddictionQuery(): void; + /** + !#en + submit game role information + Before to invoke, you need to verdict whether this properties existed + !#zh + 提交角色信息,调用前需要判断属性是否存在 + @param data data + */ + submitLoginGameRole(data: any): void; + /** + !#en + get user information + Before to invoke, you need to verdict whether this properties existed + !#zh + 获取用户信息,调用前需要判断属性是否存在 + @param info info + */ + getUserInfo(info: any): void; + /** + !#en + set login type + Before to invoke, you need to verdict whether this properties existed + !#zh + 设置登录类型,调用前需要判断属性是否存在 + @param info info + */ + getAvailableLoginType(info: any): void; + /** + !#en + set login type + Before to invoke, you need to verdict whether this properties existed + !#zh + 设置登录类型,调用前需要判断属性是否存在 + @param loginType loginType + */ + setLoginType(loginType: string): void; + /** + !#en + send to desktop + Before to invoke, you need to verdict whether this properties existed + !#zh + 发送到桌面,调用前需要判断属性是否存在 + */ + sendToDesktop(): void; + /** + !#en + open bbs + Before to invoke, you need to verdict whether this properties existed + !#zh + 打开论坛,调用前需要判断属性是否存在 + */ + openBBS(): void; + } + /** !#en + IAP protocol + !#zh + 支付系统协议接口 */ + export class ProtocolIAP extends PluginProtocol { + /** + !#en + pay interface + !#zh + 支付接口 + @param info Type:map + */ + payForProduct(info: any): void; + /** + !#en + get order ID + !#zh + 获取订单ID + */ + getOrderId(): string; + /** + !#en + reset the pay status + !#zh + 重置支付状态 + */ + static resetPayState(): void; + /** + !#en + get plugin ID + !#zh + 获取插件ID + */ + getPluginId(): string; + /** + !#en + set listener + !#zh + 设置支付系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取支付系统的监听 + */ + getListener(): Function; + } + /** !#en + analytics protocol + !#zh + 统计系统协议接口 */ + export class ProtocolAnalytics extends PluginProtocol { + /** + !#en + Start a new session. + !#zh + 启动会话 + */ + startSession(): void; + /** + !#en + Stop a session. + !#zh + 关闭会话 + */ + stopSession(): void; + /** + !#en + Set the timeout for expiring a session. + !#zh + 设置会话超时时间 + @param millis Type: long + */ + setSessionContinueMillis(millis: number): void; + /** + !#en + log an error + !#zh + 捕捉异常 + @param errorId errorId + @param message message + */ + logError(errorId: string, message: string): void; + /** + !#en + log an event. + !#zh + 捕捉事件 + @param errorId errorId + @param args optional arguments Type: map + */ + logEvent(errorId: string, ...args: any[]): void; + /** + !#en + Track an event begin. + !#zh + 统计事件开始 + @param eventId eventId + */ + logTimedEventBegin(eventId: string): void; + /** + !#en + Track an event end. + !#zh + 统计事件结束 + @param eventId eventId + */ + logTimedEventEnd(eventId: string): void; + /** + !#en + set Whether to catch uncaught exceptions to server. + !#zh + 设置是否开启自动异常捕捉 + @param enabled enabled + */ + setCaptureUncaughtException(enabled: boolean): void; + /** + !#en + analytics account information + !#zh + 统计玩家帐户信息 + @param paramMap Type: map + */ + setAccount(paramMap: any): void; + /** + !#en + track user to request payment + !#zh + 跟踪用户支付请求 + @param paramMap Type: map + */ + onChargeRequest(paramMap: any): void; + /** + !#en + track Successful payment + !#zh + 追踪用户支付成功 + @param orderID orderID + */ + onChargeSuccess(orderID: string): void; + /** + !#en + track failed payment + !#zh + 追踪用户支付失败 + @param paramMap Type: map + */ + onChargeFail(paramMap: any): void; + /** + !#en + track Successful payment + !#zh + 统计玩家支付成功 + @param paramMap Type: map + */ + onChargeOnlySuccess(paramMap: any): void; + /** + !#en + track user purchase + !#zh + 统计玩家消费 + @param paramMap Type: map + */ + onPurchase(paramMap: any): void; + /** + !#en + track user to use goods + !#zh + 统计玩家使用道具 + @param paramMap Type: map + */ + onUse(paramMap: any): void; + /** + !#en + track user to reward goods + !#zh + 统计玩家获取奖励 + @param paramMap Type: map + */ + onReward(paramMap: any): void; + /** + !#en + start level + !#zh + 开始关卡 + @param paramMap Type: map + */ + startLevel(paramMap: any): void; + /** + !#en + finish level + !#zh + 结束关卡 + @param levelID levelID + */ + finishLevel(levelID: string): void; + /** + !#en + failed level + !#zh + 关卡失败 + @param paramMap Type: map + */ + failLevel(paramMap: any): void; + /** + !#en + start task + !#zh + 开始任务 + @param paramMap Type: map + */ + startTask(paramMap: any): void; + /** + !#en + finish task + !#zh + 完成任务 + @param taskID taskID + */ + finishTask(taskID: string): void; + /** + !#en + failed task + !#zh + 任务失败 + @param paramMap Type: map + */ + failTask(paramMap: any): void; + } + /** !#en + share protocol + !#zh + 分享系统协议接口 */ + export class ProtocolShare extends PluginProtocol { + /** + !#en + share interface + !#zh + 分享 + @param info Type: map + */ + share(info: any): void; + /** + !#en + set listener + !#zh + 设置分享系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取分享系统的监听 + */ + getListener(): Function; + } + /** !#en + ads protocol + !#zh + 广告系统协议接口 */ + export class ProtocolAds extends PluginProtocol { + /** + !#en + hide ads view + !#zh + 隐藏广告 + @param adstype adstype + @param idx idx + */ + hideAds(adstype: anysdk.AdsType, idx: number): void; + /** + !#en + preload ads view + !#zh + 预加载广告 + @param adstype adstype + @param idx idx + */ + preloadAds(adstype: anysdk.AdsType, idx: number): void; + /** + !#en + query points + !#zh + 查询分数 + */ + queryPoints(): number; + /** + !#en + get whether the ads type is supported + !#zh + 获取广告类型是否支持 + @param arg0 arg0 + */ + isAdTypeSupported(arg0: anysdk.AdsType): boolean; + /** + !#en + spend point + !#zh + 消费分数 + @param points points + */ + spendPoints(points: number): void; + /** + !#en + set listener + !#zh + 设置广告系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取广告系统的监听 + */ + getListener(): Function; + } + /** !#en + social protocol + !#zh + 社交系统协议接口 */ + export class ProtocolSocial extends PluginProtocol { + /** + !#en + sign in + !#zh + 登录 + */ + signIn(): void; + /** + !#en + sign out + !#zh + 登出 + */ + signOut(): void; + /** + !#en + submit score + !#zh + 提交分数 + @param leadboardID leadboardID + @param score Type: long + */ + submitScore(leadboardID: string, score: number): void; + /** + !#en + show the id of Leaderboard page + !#zh + 根据唯一标识符显示排行榜 + @param leaderboardID leaderboardID + */ + showLeaderboard(leaderboardID: string): void; + /** + !#en + show the page of achievements + !#zh + 显示成就榜 + */ + showAchievements(): void; + /** + !#en + unlock achievement + !#zh + 解锁成就 + @param info Type: map + */ + share(info: any): void; + /** + !#en + set listener + !#zh + 设置社交系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取社交系统的监听 + */ + getListener(): Function; + /** + !#en + get friends info + Before to invoke, you need to verdict whether this properties existed + !#zh + 获取好友信息,调用前需要判断属性是否存在 + */ + pauseRecording(): void; + /** + !#en + interact + Before to invoke, you need to verdict whether this properties existed + !#zh + 订阅,调用前需要判断属性是否存在 + */ + interact(): void; + /** + !#en + subscribe + Before to invoke, you need to verdict whether this properties existed + !#zh + 关注,调用前需要判断属性是否存在 + */ + subscribe(): void; + } + /** !#en + push protocol + !#zh + 推送系统协议接口 */ + export class ProtocolPush extends PluginProtocol { + /** + !#en + start Push services + !#zh + 启动推送服务 + */ + startPush(): void; + /** + !#en + close Push services + !#zh + 暂停推送服务 + */ + closePush(): void; + /** + !#en + delete alias + !#zh + 删除别名 + @param alias alias + */ + delAlias(alias: string): void; + /** + !#en + set alias + !#zh + 设置别名 + @param alias alias + */ + setAlias(alias: string): void; + /** + !#en + delete tags + !#zh + 删除标签 + @param tags Type: list + */ + delTags(tags: any): void; + /** + !#en + set tags + !#zh + 设置标签 + @param tags Type: list + */ + setTags(tags: any): void; + /** + !#en + set listener + !#zh + 设置推送系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取推送系统的监听 + */ + getListener(): Function; + } + /** !#en + crash protocol + !#zh + 崩溃分析系统协议接口 */ + export class ProtocolCrash extends PluginProtocol { + /** + !#en + set user identifier + !#zh + 统计用户唯一标识符 + @param identifier identifier + */ + setUserIdentifier(identifier: string): void; + /** + !#en + The uploader captured in exception information + !#zh + 上报异常信息 + @param message message + @param exception exception + */ + reportException(message: string, exception: string): void; + /** + !#en + customize logging + !#zh + 自定义日志记录 + @param breadcrumb breadcrumb + */ + leaveBreadcrumb(breadcrumb: string): void; + } + /** !#en + REC protocol + !#zh + 录屏系统协议接口 */ + export class ProtocolREC extends PluginProtocol { + /** + !#en + share video + !#zh + 分享视频 + @param info Type: map + */ + share(info: any): void; + /** + !#en + Start to record video + !#zh + 开始录制视频 + */ + startRecording(): void; + /** + !#en + Start to record video + !#zh + 结束录制视频 + */ + stopRecording(): void; + /** + !#en + set listener + !#zh + 设置录屏系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取录屏系统的监听 + */ + getListener(): Function; + /** + !#en + pause to record video + Before to invoke, you need to verdict whether this properties existed + !#zh + 暂停录制视频,调用前需要判断属性是否存在 + */ + pauseRecording(): void; + /** + !#en + resume to record video + Before to invoke, you need to verdict whether this properties existed + !#zh + 恢复录制视频,调用前需要判断属性是否存在 + */ + resumeRecording(): void; + /** + !#en + get whether the device is isAvailable + Before to invoke, you need to verdict whether this properties existed + !#zh + 获取设备是否可用,调用前需要判断属性是否存在 + */ + isAvailable(): boolean; + /** + !#en + get status of recording + Before to invoke, you need to verdict whether this properties existed + !#zh + 获取录制状态,调用前需要判断属性是否存在 + */ + isRecording(): boolean; + /** + !#en + show toolbar + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示悬浮窗,调用前需要判断属性是否存在 + */ + showToolBar(): void; + /** + !#en + hide toolbar + Before to invoke, you need to verdict whether this properties existed + !#zh + 隐藏悬浮窗,调用前需要判断属性是否存在 + */ + hideToolBar(): void; + /** + !#en + show video center + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示视频中心,调用前需要判断属性是否存在 + */ + showVideoCenter(): void; + /** + !#en + enter platform + Before to invoke, you need to verdict whether this properties existed + !#zh + 显示平台中心,调用前需要判断属性是否存在 + */ + enterPlatform(): void; + /** + !#en + Set the video data, it is recommended to check whether are recorded firstly + Before to invoke, you need to verdict whether this properties existed + !#zh + 设置视频相关数据,建议先检查是否是正在录制,调用前需要判断属性是否存在 + @param info Type: map + */ + setMetaData(info: any): void; + } + /** !#en + ad tracking protocol + !#zh + 广告追踪系统协议接口 */ + export class ProtocolAdTracking extends PluginProtocol { + /** + !#en + Call this method if you want to track register events as happening during a section. + !#zh + 统计用户注册信息 + @param productInfo Type: map + */ + onPay(productInfo: any): void; + /** + !#en + Call this method if you want to track register events as happening during a section. + !#zh + 统计用户注册信息 + @param userInfo Type: map + */ + onLogin(userInfo: any): void; + /** + !#en + Call this method if you want to track register events as happening during a section. + !#zh + 统计用户注册信息 + @param userId userId + */ + onRegister(userId: string): void; + /** + !#en + Call this method if you want to track custom events with parameters as happening during a section. + !#zh + 统计自定义事件 + @param eventId eventId + @param paramMap Type: map + */ + trackEvent(eventId: string, paramMap: any): void; + /** + !#en + Call this method with parameters if you want to create role as happening during a section. + !#zh + 统计创建角色事件,调用前需要判断属性是否存在 + @param userInfo Type: map + */ + onCreateRole(userInfo: any): void; + /** + !#en + Call this method if you want to track levelup events with parameters as happening during a section. + Before to invoke, you need to verdict whether this properties existed + !#zh + 统计角色升级事件,调用前需要判断属性是否存在 + @param info Type: map + */ + onLevelUp(info: any): void; + /** + !#en + Invoke this method with parameters if you want to start to pay as happening during a section. + Before to invoke, you need to verdict whether this properties existed + !#zh + 统计开始充值事件,调用前需要判断属性是否存在 + @param info Type: map + */ + onStartToPay(info: any): void; + } + /** !#en + custom protocol + !#zh + 自定义系统协议接口 */ + export class ProtocolCustom extends PluginProtocol { + /** + !#en + set listener + !#zh + 设置自定义系统的监听 + @param listener listener + @param target target + */ + setListener(listener: Function, target: any): void; + /** + !#en + get listener + !#zh + 获取自定义系统的监听 + */ + getListener(): Function; + } + /** !#en + Data structure class + !#zh + 数据结构类 */ + export class PluginParam { + /** + !#en + create plugin parameters + !#zh + 创建对象 + @param parameters parameters + */ + static create(parameters: number|string|any): anysdk.PluginParam; + } + /** !#en The callback of user system + !#zh 用户系统回调 */ + export enum UserActionResultCode { + kInitSuccess = 0, + kInitFail = 0, + kLoginSuccess = 0, + kLoginNetworkError = 0, + kLoginNoNeed = 0, + kLoginFail = 0, + kLoginCancel = 0, + kLogoutSuccess = 0, + kLogoutFail = 0, + kPlatformEnter = 0, + kPlatformBack = 0, + kPausePage = 0, + kExitPage = 0, + kAntiAddictionQuery = 0, + kRealNameRegister = 0, + kAccountSwitchSuccess = 0, + kAccountSwitchFail = 0, + kOpenShop = 0, + kAccountSwitchCancel = 0, + kUserExtension = 0, + kSendToDesktopSuccess = 0, + kSendToDesktopFail = 0, + kGetAvailableLoginTypeSuccess = 0, + kGetAvailableLoginTypeFail = 0, + kGetUserInfoSuccess = 0, + kGetUserInfoFail = 0, + kOpenBBSSuccess = 0, + kOpenBBSFail = 0, + } + /** !#en The toolbar position of user type + !#zh 用户系统悬浮窗位置 */ + export enum ToolBarPlace { + kToolBarTopLeft = 0, + kToolBarTopRight = 0, + kToolBarMidLeft = 0, + kToolBarMidRight = 0, + kToolBarBottomLeft = 0, + kToolBarBottomRight = 0, + } + /** !#en The callback of requesting reStringge + !#zh 支付系统支付请求回调 */ + export enum PayResultCode { + kPaySuccess = 0, + kPayFail = 0, + kPayCancel = 0, + kPayNetworkError = 0, + kPayProductionInforIncomplete = 0, + kPayInitSuccess = 0, + kPayInitFail = 0, + kPayNowPaying = 0, + kPayReStringgeSuccess = 0, + kPayExtension = 0, + kPayNeedLoginAgain = 0, + kRequestSuccess = 0, + kRequestFail = 0, + } + /** !#en The enum of account type + !#zh 统计系统的账号类型 */ + export enum AccountType { + ANONYMOUS = 0, + REGISTED = 0, + SINA_WEIBO = 0, + TENCENT_WEIBO = 0, + QQ = 0, + ND91 = 0, + } + /** !#en The enum of account operation + !#zh 统计系统的账号操作 */ + export enum AccountOperate { + LOGIN = 0, + LOGOUT = 0, + REGISTER = 0, + } + /** !#en The enum of gender + !#zh 统计系统的账号性别 */ + export enum AccountGender { + MALE = 0, + FEMALE = 0, + UNKNOWN = 0, + } + /** !#en The enum of task type + !#zh 统计系统的任务类型 */ + export enum TaskType { + GUIDE_LINE = 0, + MAIN_LINE = 0, + BRANCH_LINE = 0, + DAILY = 0, + ACTIVITY = 0, + OTHER = 0, + } + /** !#en The callback of share system + !#zh 分享系统回调 */ + export enum ShareResultCode { + kShareSuccess = 0, + kShareFail = 0, + kShareCancel = 0, + kShareNetworkError = 0, + kShareExtension = 0, + } + /** !#en The callback of social system + !#zh 社交系统回调 */ + export enum SocialRetCode { + kScoreSubmitSucceed = 0, + kScoreSubmitfail = 0, + kAchUnlockSucceed = 0, + kAchUnlockFail = 0, + kSocialSignInSucceed = 0, + kSocialSignInFail = 0, + kSocialSignOutSucceed = 0, + kSocialSignOutFail = 0, + kSocialGetGameFriends = 0, + kSocialExtensionCode = 0, + kSocialGetFriendsInfoSuccess = 0, + kSocialGetFriendsInfoFail = 0, + kSocialAlreadySubscription = 0, + kSocialNoSubscription = 0, + kSocialSubscriptionFail = 0, + } + /** !#en The callback of ads system + !#zh 广告系统回调 */ + export enum AdsResultCode { + kAdsReceived = 0, + kAdsShown = 0, + kAdsDismissed = 0, + kPointsSpendSucceed = 0, + kPointsSpendFailed = 0, + kNetworkError = 0, + kUnknownError = 0, + kOfferWallOnPointsChanged = 0, + kRewardedVideoWithReward = 0, + kInAppPurchaseFinished = 0, + kAdsClicked = 0, + kAdsExtension = 0, + } + /** !#en The enum of ads position + !#zh 广告位置 */ + export enum AdsPos { + kPosCenter = 0, + kPosTop = 0, + kPosTopLeft = 0, + kPosTopRight = 0, + kPosBottom = 0, + kPosBottomLeft = 0, + kPosBottomRight = 0, + } + /** !#en The enum of ads type + !#zh 广告类型 */ + export enum AdsType { + AD_TYPE_BANNER = 0, + AD_TYPE_FULLSCREEN = 0, + AD_TYPE_MOREAPP = 0, + AD_TYPE_OFFERWALL = 0, + AD_TYPE_REWARDEDVIDEO = 0, + AD_TYPE_NATIVEEXPRESS = 0, + AD_TYPE_NATIVEADVANCED = 0, + } + /** !#en The callback of push system + !#zh 推送系统回调 */ + export enum PushActionResultCode { + kPushReceiveMessage = 0, + kPushExtensionCode = 0, + } + /** !#en The callback of custom system + !#zh 自定义系统回调 */ + export enum CustomResultCode { + kCustomExtension = 0, + } + /** !#en The callback of REC system + !#zh 录屏系统回调 */ + export enum RECResultCode { + kRECInitSuccess = 0, + kRECInitFail = 0, + kRECStartRecording = 0, + kRECStopRecording = 0, + kRECPauseRecording = 0, + kRECResumeRecording = 0, + kRECEnterSDKPage = 0, + kRECQuitSDKPage = 0, + kRECShareSuccess = 0, + kRECShareFail = 0, + kRECExtension = 0, + } +} + +/** !#en +The global main namespace of Spine, all classes, functions, +properties and constants of Spine are defined in this namespace +!#zh +Spine 的全局的命名空间, +与 Spine 相关的所有的类,函数,属性,常量都在这个命名空间中定义。 */ +declare module sp { + /** !#en + The skeleton of Spine
+
+ (Skeleton has a reference to a SkeletonData and stores the state for skeleton instance, + which consists of the current pose's bone SRT, slot colors, and which slot attachments are visible.
+ Multiple skeletons can use the same SkeletonData which includes all animations, skins, and attachments.)
+ !#zh + Spine 骨骼动画
+
+ (Skeleton 具有对骨骼数据的引用并且存储了骨骼实例的状态, + 它由当前的骨骼动作,slot 颜色,和可见的 slot attachments 组成。
+ 多个 Skeleton 可以使用相同的骨骼数据,其中包括所有的动画,皮肤和 attachments。 */ + export class Skeleton extends cc._RendererUnderSG { + /** !#en The skeletal animation is paused? + !#zh 该骨骼动画是否暂停。 */ + paused: boolean; + /** !#en + The skeleton data contains the skeleton information (bind pose bones, slots, draw order, + attachments, skins, etc) and animations but does not hold any state.
+ Multiple skeletons can share the same skeleton data. + !#zh + 骨骼数据包含了骨骼信息(绑定骨骼动作,slots,渲染顺序, + attachments,皮肤等等)和动画但不持有任何状态。
+ 多个 Skeleton 可以共用相同的骨骼数据。 */ + skeletonData: SkeletonData; + /** !#en The name of default skin. + !#zh 默认的皮肤名称。 */ + defaultSkin: string; + /** !#en The name of default animation. + !#zh 默认的动画名称。 */ + defaultAnimation: string; + /** !#en The name of current playing animation. + !#zh 当前播放的动画名称。 */ + animation: string; + _defaultSkinIndex: number; + /** !#en TODO + !#zh 是否循环播放当前骨骼动画。 */ + loop: boolean; + /** !#en Indicates whether to enable premultiplied alpha. + You should disable this option when image's transparent area appears to have opaque pixels, + or enable this option when image's half transparent area appears to be darken. + !#zh 是否启用贴图预乘。 + 当图片的透明区域出现色块时需要关闭该选项,当图片的半透明区域颜色变黑时需要启用该选项。 */ + premultipliedAlpha: boolean; + /** !#en The time scale of this skeleton. + !#zh 当前骨骼中所有动画的时间缩放率。 */ + timeScale: number; + /** !#en Indicates whether open debug slots. + !#zh 是否显示 slot 的 debug 信息。 */ + debugSlots: boolean; + /** !#en Indicates whether open debug bones. + !#zh 是否显示 bone 的 debug 信息。 */ + debugBones: boolean; + /** + !#en Computes the world SRT from the local SRT for each bone. + !#zh 重新更新所有骨骼的世界 Transform, + 当获取 bone 的数值未更新时,即可使用该函数进行更新数值。 + + @example + ```js + var bone = spine.findBone('head'); + cc.log(bone.worldX); // return 0; + spine.updateWorldTransform(); + bone = spine.findBone('head'); + cc.log(bone.worldX); // return -23.12; + ``` + */ + updateWorldTransform(): void; + /** + !#en Sets the bones and slots to the setup pose. + !#zh 还原到起始动作 + */ + setToSetupPose(): void; + /** + !#en + Sets the bones to the setup pose, + using the values from the `BoneData` list in the `SkeletonData`. + !#zh + 设置 bone 到起始动作 + 使用 SkeletonData 中的 BoneData 列表中的值。 + */ + setBonesToSetupPose(): void; + /** + !#en + Sets the slots to the setup pose, + using the values from the `SlotData` list in the `SkeletonData`. + !#zh + 设置 slot 到起始动作。 + 使用 SkeletonData 中的 SlotData 列表中的值。 + */ + setSlotsToSetupPose(): void; + /** + !#en + Finds a bone by name. + This does a string comparison for every bone.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Bone object. + !#zh + 通过名称查找 bone。 + 这里对每个 bone 的名称进行了对比。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Bone 对象。 + @param boneName boneName + */ + findBone(boneName: string): sp.spine.Bone; + /** + !#en + Finds a slot by name. This does a string comparison for every slot.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Slot object. + !#zh + 通过名称查找 slot。这里对每个 slot 的名称进行了比较。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Slot 对象。 + @param slotName slotName + */ + findSlot(slotName: string): sp.spine.Slot; + /** + !#en + Finds a skin by name and makes it the active skin. + This does a string comparison for every skin.
+ Note that setting the skin does not change which attachments are visible.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Skin object. + !#zh + 按名称查找皮肤,激活该皮肤。这里对每个皮肤的名称进行了比较。
+ 注意:设置皮肤不会改变 attachment 的可见性。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Skin 对象。 + @param skinName skinName + */ + setSkin(skinName: string): sp.spine.Skin; + /** + !#en + Returns the attachment for the slot and attachment name. + The skeleton looks first in its skin, then in the skeleton data’s default skin.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Attachment object. + !#zh + 通过 slot 和 attachment 的名称获取 attachment。Skeleton 优先查找它的皮肤,然后才是 Skeleton Data 中默认的皮肤。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.Attachment 对象。 + @param slotName slotName + @param attachmentName attachmentName + */ + getAttachment(slotName: string, attachmentName: string): sp.spine.Attachment; + /** + !#en + Sets the attachment for the slot and attachment name. + The skeleton looks first in its skin, then in the skeleton data’s default skin. + !#zh + 通过 slot 和 attachment 的名字来设置 attachment。 + Skeleton 优先查找它的皮肤,然后才是 Skeleton Data 中默认的皮肤。 + @param slotName slotName + @param attachmentName attachmentName + */ + setAttachment(slotName: string, attachmentName: string): void; + /** + !#en + Sets runtime skeleton data to sp.Skeleton.
+ This method is different from the `skeletonData` property. This method is passed in the raw data provided by the Spine runtime, and the skeletonData type is the asset type provided by Creator. + !#zh + 设置底层运行时用到的 SkeletonData。
+ 这个接口有别于 `skeletonData` 属性,这个接口传入的是 Spine runtime 提供的原始数据,而 skeletonData 的类型是 Creator 提供的资源类型。 + @param skeletonData skeletonData + @param ownsSkeletonData ownsSkeletonData + */ + setSkeletonData(skeletonData: sp.spine.SkeletonData, ownsSkeletonData: sp.spine.SkeletonData): void; + /** + !#en Sets animation state data.
+ The parameter type is {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.AnimationStateData. + !#zh 设置动画状态数据。
+ 参数是 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.AnimationStateData。 + @param stateData stateData + */ + setAnimationStateData(stateData: sp.spine.AnimationStateData): void; + /** + !#en + Mix applies all keyframe values, + interpolated for the specified time and mixed with the current values. + !#zh 为所有关键帧设定混合及混合时间(从当前值开始差值)。 + @param fromAnimation fromAnimation + @param toAnimation toAnimation + @param duration duration + */ + setMix(fromAnimation: string, toAnimation: string, duration: number): void; + /** + !#en Sets event listener. + !#zh 设置动画事件监听器。 + @param target target + @param callback callback + */ + setAnimationListener(target: any, callback: Function): void; + /** + !#en Set the current animation. Any queued animations are cleared.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry object. + !#zh 设置当前动画。队列中的任何的动画将被清除。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry 对象。 + @param trackIndex trackIndex + @param name name + @param loop loop + */ + setAnimation(trackIndex: number, name: string, loop: boolean): sp.spine.TrackEntry; + /** + !#en Adds an animation to be played delay seconds after the current or last queued animation.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry object. + !#zh 添加一个动画到动画队列尾部,还可以延迟指定的秒数。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry 对象。 + @param trackIndex trackIndex + @param name name + @param loop loop + @param delay delay + */ + addAnimation(trackIndex: number, name: string, loop: boolean, delay?: number): sp.spine.TrackEntry; + /** + !#en Find animation with specified name. + !#zh 查找指定名称的动画 + @param name name + */ + findAnimation(name: string): sp.spine.Animation; + /** + !#en Returns track entry by trackIndex.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry object. + !#zh 通过 track 索引获取 TrackEntry。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.TrackEntry 对象。 + @param trackIndex trackIndex + */ + getCurrent(trackIndex: void): sp.spine.TrackEntry; + /** + !#en Clears all tracks of animation state. + !#zh 清除所有 track 的动画状态。 + */ + clearTracks(): void; + /** + !#en Clears track of animation state by trackIndex. + !#zh 清除出指定 track 的动画状态。 + @param trackIndex trackIndex + */ + clearTrack(trackIndex: number): void; + /** + !#en Set the start event listener. + !#zh 用来设置开始播放动画的事件监听。 + @param listener listener + */ + setStartListener(listener: Function): void; + /** + !#en Set the interrupt event listener. + !#zh 用来设置动画被打断的事件监听。 + @param listener listener + */ + setInterruptListener(listener: Function): void; + /** + !#en Set the end event listener. + !#zh 用来设置动画播放完后的事件监听。 + @param listener listener + */ + setEndListener(listener: Function): void; + /** + !#en Set the dispose event listener. + !#zh 用来设置动画将被销毁的事件监听。 + @param listener listener + */ + setDisposeListener(listener: Function): void; + /** + !#en Set the complete event listener. + !#zh 用来设置动画播放一次循环结束后的事件监听。 + @param listener listener + */ + setCompleteListener(listener: Function): void; + /** + !#en Set the animation event listener. + !#zh 用来设置动画播放过程中帧事件的监听。 + @param listener listener + */ + setEventListener(listener: Function): void; + /** + !#en Set the start event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画开始播放的事件监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackStartListener(entry: sp.spine.TrackEntry, listener: Function): void; + /** + !#en Set the interrupt event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画被打断的事件监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackInterruptListener(entry: sp.spine.TrackEntry, listener: Function): void; + /** + !#en Set the end event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画播放结束的事件监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackEndListener(entry: sp.spine.TrackEntry, listener: Function): void; + /** + !#en Set the dispose event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画即将被销毁的事件监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackDisposeListener(entry: sp.spine.TrackEntry, listener: Function): void; + /** + !#en Set the complete event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画一次循环播放结束的事件监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackCompleteListener(entry: sp.spine.TrackEntry, listener: Function): void; + /** + !#en Set the event listener for specified TrackEntry (only supported on Web). + !#zh 用来为指定的 TrackEntry 设置动画帧事件的监听。(只支持 Web 平台) + @param entry entry + @param listener listener + */ + setTrackEventListener(entry: sp.spine.TrackEntry, listener: Function): void; + } + /** !#en The skeleton data of spine. + !#zh Spine 的 骨骼数据。 */ + export class SkeletonData extends cc.Asset { + /** !#en See http://en.esotericsoftware.com/spine-json-format + !#zh 可查看 Spine 官方文档 http://zh.esotericsoftware.com/spine-json-format */ + skeletonJson: any; + atlasText: string; + textures: cc.Texture2D[]; + /** !#en + A scale can be specified on the JSON or binary loader which will scale the bone positions, + image sizes, and animation translations. + This can be useful when using different sized images than were used when designing the skeleton + in Spine. For example, if using images that are half the size than were used in Spine, + a scale of 0.5 can be used. This is commonly used for games that can run with either low or high + resolution texture atlases. + see http://en.esotericsoftware.com/spine-using-runtimes#Scaling + !#zh 可查看 Spine 官方文档: http://zh.esotericsoftware.com/spine-using-runtimes#Scaling */ + scale: number; + /** + !#en Get the included SkeletonData used in spine runtime.
+ Returns a {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.SkeletonData object. + !#zh 获取 Spine Runtime 使用的 SkeletonData。
+ 返回一个 {{#crossLinkModule "sp.spine"}}sp.spine{{/crossLinkModule}}.SkeletonData 对象。 + @param quiet quiet + */ + getRuntimeData(quiet?: boolean): sp.spine.SkeletonData; + } + /** !#en The event type of spine skeleton animation. + !#zh 骨骼动画事件类型。 */ + export enum AnimationEventType { + START = 0, + END = 0, + COMPLETE = 0, + EVENT = 0, + } +} + +/** !#en +`sp.spine` is the namespace for official Spine Runtime, which officially implemented and maintained by Spine.
+Please refer to the official documentation for its detailed usage: [http://en.esotericsoftware.com/spine-using-runtimes](http://en.esotericsoftware.com/spine-using-runtimes) +!#zh +sp.spine 模块是 Spine 官方运行库的 API 入口,由 Spine 官方统一实现和维护,具体用法请参考:[http://zh.esotericsoftware.com/spine-using-runtimes](http://zh.esotericsoftware.com/spine-using-runtimes) */ +declare module sp.spine { +} + +/** !#en Some JavaScript decorators which can be accessed with "cc._decorator". +!#zh 一些 JavaScript 装饰器,目前可以通过 "cc._decorator" 来访问。 +(这些 API 仍不完全稳定,有可能随着 JavaScript 装饰器的标准实现而调整) */ +declare module cc._decorator { + /** + !#en + Declare the standard [ES6 Class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) + as CCClass, please see [Class](/docs/editors_and_tools/creator-chapters/scripting/class/) for details. + !#zh + 将标准写法的 [ES6 Class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) 声明为 CCClass,具体用法请参阅[类型定义](/docs/creator/scripting/class/)。 + @param name The class name used for serialization. + + @example + ```js + const {ccclass} = cc._decorator; + + // define a CCClass, omit the name + @ccclass + class NewScript extends cc.Component { + // ... + } + + // define a CCClass with a name + @ccclass('LoginData') + class LoginData { + // ... + } + ``` + */ + export function ccclass(name?: string): Function; + export function ccclass(_class?: Function): void; + /** + !#en + Declare property for [CCClass](/docs/editors_and_tools/creator-chapters/scripting/class/). + !#zh + 定义 [CCClass](/docs/creator/scripting/class/) 所用的属性。 + @param options an object with some property attributes + + @example + ```js + const {ccclass, property} = cc._decorator; + + @ccclass + class NewScript extends cc.Component { + @property({ + type: cc.Node + }) + targetNode1 = null; + + @property(cc.Node) + targetNode2 = null; + + @property(cc.Button) + targetButton = null; + + @property + _width = 100; + + @property + get width () { + return this._width; + } + + @property + set width (value) { + this._width = value; + } + + @property + offset = new cc.Vec2(100, 100); + + @property(cc.Vec2) + offsets = []; + + @property(cc.Texture2D) + texture = ""; + } + + // above is equivalent to (上面的代码相当于): + + var NewScript = cc.Class({ + properties: { + targetNode1: { + default: null, + type: cc.Node + }, + + targetNode2: { + default: null, + type: cc.Node + }, + + targetButton: { + default: null, + type: cc.Button + }, + + _width: 100, + + width: { + get () { + return this._width; + }, + set (value) { + this._width = value; + } + }, + + offset: new cc.Vec2(100, 100) + + offsets: { + default: [], + type: cc.Vec2 + } + + texture: { + default: "", + url: cc.Texture2D + }, + } + }); + ``` + */ + export function property(options?: {type?: any; url?: typeof cc.RawAsset; visible?: boolean|(() => boolean); displayName?: string; tooltip?: string; multiline?: boolean; readonly?: boolean; min?: number; max?: number; step?: number; range?: number[]; slide?: boolean; serializable?: boolean; formerlySerializedAs?: string; editorOnly?: boolean; override?: boolean; animatable?: boolean} | any[]|Function|cc.ValueType|number|string|boolean): Function; + export function property(_target: Object, _key: any, _desc?: any): void; + /** + !#en + Makes a CCClass that inherit from component execute in edit mode.
+ By default, all components are only executed in play mode, + which means they will not have their callback functions executed while the Editor is in edit mode. + !#zh + 允许继承自 Component 的 CCClass 在编辑器里执行。
+ 默认情况下,所有 Component 都只会在运行时才会执行,也就是说它们的生命周期回调不会在编辑器里触发。 + + @example + ```js + const {ccclass, executeInEditMode} = cc._decorator; + + @ccclass + @executeInEditMode + class NewScript extends cc.Component { + // ... + } + ``` + */ + export function executeInEditMode(): Function; + export function executeInEditMode(_class: Function): void; + /** + !#en + Automatically add required component as a dependency for the CCClass that inherit from component. + !#zh + 为声明为 CCClass 的组件添加依赖的其它组件。当组件添加到节点上时,如果依赖的组件不存在,引擎将会自动将依赖组件添加到同一个节点,防止脚本出错。该设置在运行时同样有效。 + @param requiredComponent requiredComponent + + @example + ```js + const {ccclass, requireComponent} = cc._decorator; + + @ccclass + @requireComponent(cc.Sprite) + class SpriteCtrl extends cc.Component { + // ... + } + ``` + */ + export function requireComponent(requiredComponent: typeof cc.Component): Function; + /** + !#en + The menu path to register a component to the editors "Component" menu. Eg. "Rendering/CameraCtrl". + !#zh + 将当前组件添加到组件菜单中,方便用户查找。例如 "Rendering/CameraCtrl"。 + @param path The path is the menu represented like a pathname. + For example the menu could be "Rendering/CameraCtrl". + + @example + ```js + const {ccclass, menu} = cc._decorator; + + @ccclass + @menu("Rendering/CameraCtrl") + class NewScript extends cc.Component { + // ... + } + ``` + */ + export function menu(path: string): Function; + /** + !#en + The execution order of lifecycle methods for Component. + Those less than 0 will execute before while those greater than 0 will execute after. + The order will only affect onLoad, onEnable, start, update and lateUpdate while onDisable and onDestroy will not be affected. + !#zh + 设置脚本生命周期方法调用的优先级。优先级小于 0 的组件将会优先执行,优先级大于 0 的组件将会延后执行。优先级仅会影响 onLoad, onEnable, start, update 和 lateUpdate,而 onDisable 和 onDestroy 不受影响。 + @param order The execution order of lifecycle methods for Component. Those less than 0 will execute before while those greater than 0 will execute after. + + @example + ```js + const {ccclass, executionOrder} = cc._decorator; + + @ccclass + @executionOrder(1) + class CameraCtrl extends cc.Component { + // ... + } + ``` + */ + export function executionOrder(order: number): Function; + /** + !#en + Prevents Component of the same type (or subtype) to be added more than once to a Node. + !#zh + 防止多个相同类型(或子类型)的组件被添加到同一个节点。 + + @example + ```js + const {ccclass, disallowMultiple} = cc._decorator; + + @ccclass + @disallowMultiple + class CameraCtrl extends cc.Component { + // ... + } + ``` + */ + export function disallowMultiple(): Function; + export function disallowMultiple(_class: Function): void; + /** + !#en + If specified, the editor's scene view will keep updating this node in 60 fps when it is selected, otherwise, it will update only if necessary.
+ This property is only available if executeInEditMode is true. + !#zh + 当指定了 "executeInEditMode" 以后,playOnFocus 可以在选中当前组件所在的节点时,提高编辑器的场景刷新频率到 60 FPS,否则场景就只会在必要的时候进行重绘。 + + @example + ```js + const {ccclass, playOnFocus, executeInEditMode} = cc._decorator; + + @ccclass + @executeInEditMode + @playOnFocus + class CameraCtrl extends cc.Component { + // ... + } + ``` + */ + export function playOnFocus(): Function; + export function playOnFocus(_class: Function): void; + /** + !#en + Specifying the url of the custom html to draw the component in **Properties**. + !#zh + 自定义当前组件在 **属性检查器** 中渲染时所用的网页 url。 + @param url url + + @example + ```js + const {ccclass, inspector} = cc._decorator; + + @ccclass + @inspector("packages://inspector/inspectors/comps/camera-ctrl.js") + class NewScript extends cc.Component { + // ... + } + ``` + */ + export function inspector(path: string): Function; + /** + !#en + The custom documentation URL. + !#zh + 指定当前组件的帮助文档的 url,设置过后,在 **属性检查器** 中就会出现一个帮助图标,用户点击将打开指定的网页。 + @param url url + + @example + ```js + const {ccclass, help} = cc._decorator; + + @ccclass + @help("app://docs/html/components/spine.html") + class NewScript extends cc.Component { + // ... + } + ``` + */ + export function help(path: string): Function; + /** + NOTE:
+ The old mixins implemented in cc.Class(ES5) behaves exact the same as multiple inheritance. + But since ES6, class constructor can't be function-called and class methods become non-enumerable, + so we can not mix in ES6 Classes.
+ See:
+ [https://esdiscuss.org/topic/traits-are-now-impossible-in-es6-until-es7-since-rev32](https://esdiscuss.org/topic/traits-are-now-impossible-in-es6-until-es7-since-rev32)
+ One possible solution (but IDE unfriendly):
+ [http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes](http://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/)
+
+ NOTE:
+ You must manually call mixins constructor, this is different from cc.Class(ES5). + @param ctor constructors to mix, only support ES5 constructors or classes defined by using `cc.Class`, + not support ES6 Classes. + + @example + ```js + const {ccclass, mixins} = cc._decorator; + + class Animal { ... } + + const Fly = cc.Class({ + constructor () { ... } + }); + + @ccclass + @mixins(cc.EventTarget, Fly) + class Bird extends Animal { + constructor () { + super(); + + // You must manually call mixins constructor, this is different from cc.Class(ES5) + cc.EventTarget.call(this); + Fly.call(this); + } + // ... + } + ``` + */ + export function mixins(ctor: Function, ...rest: Function[]): Function; +} + +/** This module provides some JavaScript utilities. +All members can be accessed with "cc.js". */ +declare module cc.js { + /** + Check the obj whether is number or not + If a number is created by using 'new Number(10086)', the typeof it will be "object"... + Then you can use this function if you care about this case. + @param obj obj + */ + export function isNumber(obj: any): boolean; + /** + Check the obj whether is string or not. + If a string is created by using 'new String("blabla")', the typeof it will be "object"... + Then you can use this function if you care about this case. + @param obj obj + */ + export function isString(obj: any): boolean; + /** + This method is deprecated, use cc.js.mixin please.
+ Copy all properties not defined in obj from arguments[1...n] + @param obj object to extend its properties + @param sourceObj source object to copy properties from + */ + export function addon(obj: any, ...sourceObj: any[]): any; + /** + copy all properties from arguments[1...n] to obj + @param obj obj + @param sourceObj sourceObj + */ + export function mixin(obj: any, ...sourceObj: any[]): any; + /** + Derive the class from the supplied base class. + Both classes are just native javascript constructors, not created by cc.Class, so + usually you will want to inherit using {{#crossLink "cc/Class:method"}}cc.Class {{/crossLink}} instead. + @param cls cls + @param base the baseclass to inherit + */ + export function extend(cls: Function, base: Function): Function; + /** + Get super class + @param ctor the constructor of subclass + */ + export function getSuper(ctor: Function): Function; + /** + Removes all enumerable properties from object + @param obj obj + */ + export function clear(obj: any): void; + /** + Get property descriptor in object and all its ancestors + @param obj obj + @param name name + */ + export function getPropertyDescriptor(obj: any, name: string): any; + /** + Define value, just help to call Object.defineProperty.
+ The configurable will be true. + @param obj obj + @param prop prop + @param value value + @param writable writable + @param enumerable enumerable + */ + export function value(obj: any, prop: string, value: any, writable?: boolean, enumerable?: boolean): void; + /** + Define get set accessor, just help to call Object.defineProperty(...) + @param obj obj + @param prop prop + @param getter getter + @param setter setter + @param enumerable enumerable + */ + export function getset(obj: any, prop: string, getter: Function, setter: Function, enumerable?: boolean): void; + /** + Define get accessor, just help to call Object.defineProperty(...) + @param obj obj + @param prop prop + @param getter getter + @param enumerable enumerable + @param configurable configurable + */ + export function get(obj: any, prop: string, getter: Function, enumerable?: boolean, configurable?: boolean): void; + /** + Define set accessor, just help to call Object.defineProperty(...) + @param obj obj + @param prop prop + @param setter setter + @param enumerable enumerable + @param configurable configurable + */ + export function set(obj: any, prop: string, setter: Function, enumerable?: boolean, configurable?: boolean): void; + /** + Get class name of the object, if object is just a {} (and which class named 'Object'), it will return "". + (modified from the code from this stackoverflow post) + @param objOrCtor instance or constructor + */ + export function getClassName(objOrCtor: any|Function): string; + /** + Register the class by specified name manually + @param className className + @param constructor constructor + */ + export function setClassName(className: string, constructor: Function): void; + /** + Unregister a class from fireball. + + If you dont need a registered class anymore, you should unregister the class so that Fireball will not keep its reference anymore. + Please note that its still your responsibility to free other references to the class. + @param constructor the class you will want to unregister, any number of classes can be added + */ + export function unregisterClass(...constructor: Function[]): void; + /** + Get the registered class by name + @param classname classname + */ + export function getClassByName(classname: string): Function; + /** + Defines a polyfill field for obsoleted codes. + @param obj YourObject or YourClass.prototype + @param obsoleted "OldParam" or "YourClass.OldParam" + @param newPropName "NewParam" + @param writable writable + */ + export function obsolete(obj: any, obsoleted: string, newPropName: string, writable?: boolean): void; + /** + Defines all polyfill fields for obsoleted codes corresponding to the enumerable properties of props. + @param obj YourObject or YourClass.prototype + @param objName "YourObject" or "YourClass" + @param props props + @param writable writable + */ + export function obsoletes(obj: any, objName: any, props: any, writable?: boolean): void; + /** + A string tool to construct a string with format string. + @param msg A JavaScript string containing zero or more substitution strings (%s). + @param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output. + + @example + ```js + cc.js.formatStr("a: %s, b: %s", a, b); + cc.js.formatStr(a, b, c); + ``` + */ + export function formatStr(msg: string|any, ...subst: any[]): string; + /** + !#en + A simple wrapper of `Object.create(null)` which ensures the return object have no prototype (and thus no inherited members). So we can skip `hasOwnProperty` calls on property lookups. It is a worthwhile optimization than the `{}` literal when `hasOwnProperty` calls are necessary. + !#zh + 该方法是对 `Object.create(null)` 的简单封装。`Object.create(null)` 用于创建无 prototype (也就无继承)的空对象。这样我们在该对象上查找属性时,就不用进行 `hasOwnProperty` 判断。在需要频繁判断 `hasOwnProperty` 时,使用这个方法性能会比 `{}` 更高。 + @param forceDictMode Apply the delete operator to newly created map object. This causes V8 to put the object in "dictionary mode" and disables creation of hidden classes which are very expensive for objects that are constantly changing shape. + */ + export function createMap(forceDictMode?: boolean): any; + /** undefined */ + export class array { + /** + Removes the array item at the specified index. + @param array array + @param index index + */ + static removeAt(array: any[], index: number): void; + /** + Removes the array item at the specified index. + It's faster but the order of the array will be changed. + @param array array + @param index index + */ + static fastRemoveAt(array: any[], index: number): void; + /** + Removes the first occurrence of a specific object from the array. + @param array array + @param value value + */ + static remove(array: any[], value: any): boolean; + /** + Removes the first occurrence of a specific object from the array. + It's faster but the order of the array will be changed. + @param array array + @param value value + */ + static fastRemove(array: any[], value: number): void; + /** + Verify array's Type + @param array array + @param type type + */ + static verifyType(array: any[], type: Function): boolean; + /** + Removes from array all values in minusArr. For each Value in minusArr, the first matching instance in array will be removed. + @param array Source Array + @param minusArr minus Array + */ + static removeArray(array: any[], minusArr: any[]): void; + /** + Inserts some objects at index + @param array array + @param addObjs addObjs + @param index index + */ + static appendObjectsAt(array: any[], addObjs: any[], index: number): any[]; + /** + Exact same function as Array.prototype.indexOf.
+ HACK: ugliy hack for Baidu mobile browser compatibility, stupid Baidu guys modify Array.prototype.indexOf for all pages loaded, their version changes strict comparison to non-strict comparison, it also ignores the second parameter of the original API, and this will cause event handler enter infinite loop.
+ Baidu developers, if you ever see this documentation, here is the standard: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf, Seriously! + @param searchElement Element to locate in the array. + @param fromIndex The index to start the search at + */ + static indexOf(searchElement: any, fromIndex?: number): number; + /** + Determines whether the array contains a specific value. + @param array array + @param value value + */ + static contains(array: any[], value: any): boolean; + /** + Copy an array's item to a new array (its performance is better than Array.slice) + @param array array + */ + static copy(array: any[]): any[]; + } + /** !#en + A fixed-length object pool designed for general type.
+ The implementation of this object pool is very simple, + it can helps you to improve your game performance for objects which need frequent release and recreate operations
+ !#zh + 长度固定的对象缓存池,可以用来缓存各种对象类型。
+ 这个对象池的实现非常精简,它可以帮助您提高游戏性能,适用于优化对象的反复创建和销毁。 */ + export class Pool { + /** + !#en + Constructor for creating an object pool for the specific object type. + You can pass a callback argument for process the cleanup logic when the object is recycled. + !#zh + 使用构造函数来创建一个指定对象类型的对象池,您可以传递一个回调函数,用于处理对象回收时的清理逻辑。 + @param cleanupFunc the callback method used to process the cleanup logic when the object is recycled. + @param size initializes the length of the array + */ + constructor(cleanupFunc: (obj: any) => void, size: number); + constructor(size: number); + /** + !#en + Get and initialize an object from pool. This method defaults to null and requires the user to implement it. + !#zh + 获取并初始化对象池中的对象。这个方法默认为空,需要用户自己实现。 + @param params parameters to used to initialize the object + */ + get(...params: any[]): any; + /** !#en + The current number of available objects, the default is 0, it will gradually increase with the recycle of the object, + the maximum will not exceed the size specified when the constructor is called. + !#zh + 当前可用对象数量,一开始默认是 0,随着对象的回收会逐渐增大,最大不会超过调用构造函数时指定的 size。 */ + count: number; + /** + !#en + Get an object from pool, if no available object in the pool, null will be returned. + !#zh + 获取对象池中的对象,如果对象池没有可用对象,则返回空。 + */ + _get(): any; + /** + !#en Put an object into the pool. + !#zh 向对象池返还一个不再需要的对象。 + */ + put(): void; + /** + !#en Resize the pool. + !#zh 设置对象池容量。 + */ + resize(): void; + } +} + +declare let jsb: any; +/** Running in the editor. */ +declare let CC_EDITOR: boolean; +/** Preview in browser or simulator. */ +declare let CC_PREVIEW: boolean; +/** Running in the editor or preview. */ +declare let CC_DEV: boolean; +/** Running in the editor or preview, or build in debug mode. */ +declare let CC_DEBUG: boolean; +/** Running in published project. */ +declare let CC_BUILD: boolean; +/** Running in native platform (mobile app, desktop app, or simulator). */ +declare let CC_JSB: boolean; +/** Running in the engine's unit test. */ +declare let CC_TEST: boolean; \ No newline at end of file diff --git a/Cocos/Demos/declaration/dragonBones.d.ts b/Cocos/Demos/declaration/dragonBones.d.ts new file mode 100644 index 00000000..3da55988 --- /dev/null +++ b/Cocos/Demos/declaration/dragonBones.d.ts @@ -0,0 +1,6518 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + const enum ArmatureType { + Armature = 0, + MovieClip = 1, + Stage = 2, + } + /** + * @private + */ + const enum BoneType { + Bone = 0, + Surface = 1, + } + /** + * @private + */ + const enum DisplayType { + Image = 0, + Armature = 1, + Mesh = 2, + BoundingBox = 3, + Path = 4, + } + /** + * - Bounding box type. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框类型。 + * @version DragonBones 5.0 + * @language zh_CN + */ + const enum BoundingBoxType { + Rectangle = 0, + Ellipse = 1, + Polygon = 2, + } + /** + * @private + */ + const enum ActionType { + Play = 0, + Frame = 10, + Sound = 11, + } + /** + * @private + */ + const enum BlendMode { + Normal = 0, + Add = 1, + Alpha = 2, + Darken = 3, + Difference = 4, + Erase = 5, + HardLight = 6, + Invert = 7, + Layer = 8, + Lighten = 9, + Multiply = 10, + Overlay = 11, + Screen = 12, + Subtract = 13, + } + /** + * @private + */ + const enum TweenType { + None = 0, + Line = 1, + Curve = 2, + QuadIn = 3, + QuadOut = 4, + QuadInOut = 5, + } + /** + * @private + */ + const enum TimelineType { + Action = 0, + ZOrder = 1, + BoneAll = 10, + BoneTranslate = 11, + BoneRotate = 12, + BoneScale = 13, + Surface = 50, + BoneAlpha = 60, + SlotDisplay = 20, + SlotColor = 21, + SlotDeform = 22, + SlotZIndex = 23, + SlotAlpha = 24, + IKConstraint = 30, + AnimationProgress = 40, + AnimationWeight = 41, + AnimationParameter = 42, + } + /** + * - Offset mode. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 偏移模式。 + * @version DragonBones 5.5 + * @language zh_CN + */ + const enum OffsetMode { + None = 0, + Additive = 1, + Override = 2, + } + /** + * - Animation fade out mode. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出模式。 + * @version DragonBones 4.5 + * @language zh_CN + */ + const enum AnimationFadeOutMode { + /** + * - Fade out the animation states of the same layer. + * @language en_US + */ + /** + * - 淡出同层的动画状态。 + * @language zh_CN + */ + SameLayer = 1, + /** + * - Fade out the animation states of the same group. + * @language en_US + */ + /** + * - 淡出同组的动画状态。 + * @language zh_CN + */ + SameGroup = 2, + /** + * - Fade out the animation states of the same layer and group. + * @language en_US + */ + /** + * - 淡出同层并且同组的动画状态。 + * @language zh_CN + */ + SameLayerAndGroup = 3, + /** + * - Fade out of all animation states. + * @language en_US + */ + /** + * - 淡出所有的动画状态。 + * @language zh_CN + */ + All = 4, + /** + * - Does not replace the animation state with the same name. + * @language en_US + */ + /** + * - 不替换同名的动画状态。 + * @language zh_CN + */ + Single = 5, + } + /** + * @private + */ + const enum AnimationBlendType { + None = 0, + E1D = 1, + } + /** + * @private + */ + const enum AnimationBlendMode { + Additive = 0, + Override = 1, + } + /** + * @private + */ + const enum ConstraintType { + IK = 0, + Path = 1, + } + /** + * @private + */ + const enum PositionMode { + Fixed = 0, + Percent = 1, + } + /** + * @private + */ + const enum SpacingMode { + Length = 0, + Fixed = 1, + Percent = 2, + } + /** + * @private + */ + const enum RotateMode { + Tangent = 0, + Chain = 1, + ChainScale = 2, + } + /** + * @private + */ + interface Map { + [key: string]: T; + } + /** + * @private + */ + class DragonBones { + static readonly VERSION: string; + static yDown: boolean; + static debug: boolean; + static debugDraw: boolean; + private readonly _clock; + private readonly _events; + private readonly _objects; + private _eventManager; + constructor(eventManager: IEventDispatcher); + advanceTime(passedTime: number): void; + bufferEvent(value: EventObject): void; + bufferObject(object: BaseObject): void; + readonly clock: WorldClock; + readonly eventManager: IEventDispatcher; + } +} +declare var __extends: any; +declare var exports: any; +declare var module: any; +declare var define: any; +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The BaseObject is the base class for all objects in the DragonBones framework. + * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 基础对象,通常 DragonBones 的对象都继承自该类。 + * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。 + * @version DragonBones 4.5 + * @language zh_CN + */ + abstract class BaseObject { + private static _hashCode; + private static _defaultMaxCount; + private static readonly _maxCountMap; + private static readonly _poolsMap; + private static _returnObject(object); + static toString(): string; + /** + * - Set the maximum cache count of the specify object pool. + * @param objectConstructor - The specify class. (Set all object pools max cache count if not set) + * @param maxCount - Max count. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 设置特定对象池的最大缓存数量。 + * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量) + * @param maxCount - 最大缓存数量。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static setMaxCount(objectConstructor: (typeof BaseObject) | null, maxCount: number): void; + /** + * - Clear the cached instances of a specify object pool. + * @param objectConstructor - Specify class. (Clear all cached instances if not set) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除特定对象池的缓存实例。 + * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例) + * @version DragonBones 4.5 + * @language zh_CN + */ + static clearPool(objectConstructor?: (typeof BaseObject) | null): void; + /** + * - Get an instance of the specify class from object pool. + * @param objectConstructor - The specify class. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从对象池中获取特定类的实例。 + * @param objectConstructor - 特定的类。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static borrowObject(objectConstructor: { + new (): T; + }): T; + /** + * - A unique identification number assigned to the object. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分配给此实例的唯一标识号。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly hashCode: number; + private _isInPool; + protected abstract _onClear(): void; + /** + * - Clear the object and return it back to object pool。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除该实例的所有数据并将其返还对象池。 + * @version DragonBones 4.5 + * @language zh_CN + */ + returnToPool(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - 2D Transform matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 转换矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Matrix { + /** + * - The value that affects the positioning of pixels along the x axis when scaling or rotating an image. + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 缩放或旋转图像时影响像素沿 x 轴定位的值。 + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + a: number; + /** + * - The value that affects the positioning of pixels along the y axis when rotating or skewing an image. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转或倾斜图像时影响像素沿 y 轴定位的值。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + b: number; + /** + * - The value that affects the positioning of pixels along the x axis when rotating or skewing an image. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转或倾斜图像时影响像素沿 x 轴定位的值。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + c: number; + /** + * - The value that affects the positioning of pixels along the y axis when scaling or rotating an image. + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 缩放或旋转图像时影响像素沿 y 轴定位的值。 + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + d: number; + /** + * - The distance by which to translate each point along the x axis. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 沿 x 轴平移每个点的距离。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + tx: number; + /** + * - The distance by which to translate each point along the y axis. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 沿 y 轴平移每个点的距离。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + ty: number; + /** + * @private + */ + constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number); + toString(): string; + /** + * @private + */ + copyFrom(value: Matrix): Matrix; + /** + * @private + */ + copyFromArray(value: Array, offset?: number): Matrix; + /** + * - Convert to unit matrix. + * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为单位矩阵。 + * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + identity(): Matrix; + /** + * - Multiplies the current matrix with another matrix. + * @param value - The matrix that needs to be multiplied. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将当前矩阵与另一个矩阵相乘。 + * @param value - 需要相乘的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + concat(value: Matrix): Matrix; + /** + * - Convert to inverse matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为逆矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + invert(): Matrix; + /** + * - Apply a matrix transformation to a specific point. + * @param x - X coordinate. + * @param y - Y coordinate. + * @param result - The point after the transformation is applied. + * @param delta - Whether to ignore tx, ty's conversion to point. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将矩阵转换应用于特定点。 + * @param x - 横坐标。 + * @param y - 纵坐标。 + * @param result - 应用转换之后的点。 + * @param delta - 是否忽略 tx,ty 对点的转换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + transformPoint(x: number, y: number, result: { + x: number; + y: number; + }, delta?: boolean): void; + /** + * @private + */ + transformRectangle(rectangle: { + x: number; + y: number; + width: number; + height: number; + }, delta?: boolean): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - 2D Transform. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 变换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Transform { + /** + * @private + */ + static readonly PI: number; + /** + * @private + */ + static readonly PI_D: number; + /** + * @private + */ + static readonly PI_H: number; + /** + * @private + */ + static readonly PI_Q: number; + /** + * @private + */ + static readonly RAD_DEG: number; + /** + * @private + */ + static readonly DEG_RAD: number; + /** + * @private + */ + static normalizeRadian(value: number): number; + /** + * - Horizontal translate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 水平位移。 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - Vertical translate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 垂直位移。 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - Skew. (In radians) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 倾斜。 (以弧度为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + skew: number; + /** + * - rotation. (In radians) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转。 (以弧度为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + rotation: number; + /** + * - Horizontal Scaling. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 水平缩放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + scaleX: number; + /** + * - Vertical scaling. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 垂直缩放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + scaleY: number; + /** + * @private + */ + constructor(x?: number, y?: number, skew?: number, rotation?: number, scaleX?: number, scaleY?: number); + toString(): string; + /** + * @private + */ + copyFrom(value: Transform): Transform; + /** + * @private + */ + identity(): Transform; + /** + * @private + */ + add(value: Transform): Transform; + /** + * @private + */ + minus(value: Transform): Transform; + /** + * @private + */ + fromMatrix(matrix: Matrix): Transform; + /** + * @private + */ + toMatrix(matrix: Matrix): Transform; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class ColorTransform { + alphaMultiplier: number; + redMultiplier: number; + greenMultiplier: number; + blueMultiplier: number; + alphaOffset: number; + redOffset: number; + greenOffset: number; + blueOffset: number; + constructor(alphaMultiplier?: number, redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaOffset?: number, redOffset?: number, greenOffset?: number, blueOffset?: number); + copyFrom(value: ColorTransform): void; + identity(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The Point object represents a location in a two-dimensional coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Point 对象表示二维坐标系统中的某个位置。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Point { + /** + * - The horizontal coordinate. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 该点的水平坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - The vertical coordinate. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 该点的垂直坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @param x - The horizontal coordinate. + * @param y - The vertical coordinate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。 + * @param x - 该对象的x属性值,默认为 0.0。 + * @param y - 该对象的y属性值,默认为 0.0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(x?: number, y?: number); + /** + * @private + */ + copyFrom(value: Point): void; + /** + * @private + */ + clear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its + * width and its height.
+ * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of + * one property has no effect on the others. However, the right and bottom properties are integrally related to those + * four properties. For example, if you change the value of the right property, the value of the width property changes; + * if you change the bottom property, the value of the height property changes. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
+ * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 + * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width + * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Rectangle { + /** + * - The x coordinate of the top-left corner of the rectangle. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形左上角的 x 坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - The y coordinate of the top-left corner of the rectangle. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形左上角的 y 坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - The width of the rectangle, in pixels. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形的宽度(以像素为单位)。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + width: number; + /** + * - 矩形的高度(以像素为单位)。 + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - The height of the rectangle, in pixels. + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + height: number; + /** + * @private + */ + constructor(x?: number, y?: number, width?: number, height?: number); + /** + * @private + */ + copyFrom(value: Rectangle): void; + /** + * @private + */ + clear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The user custom data. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 用户自定义数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + class UserData extends BaseObject { + static toString(): string; + /** + * - The custom int numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly ints: Array; + /** + * - The custom float numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly floats: Array; + /** + * - The custom strings. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly strings: Array; + protected _onClear(): void; + /** + * - Get the custom int number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getInt(index?: number): number; + /** + * - Get the custom float number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getFloat(index?: number): number; + /** + * - Get the custom string. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getString(index?: number): string; + } + /** + * @private + */ + class ActionData extends BaseObject { + static toString(): string; + type: ActionType; + name: string; + bone: BoneData | null; + slot: SlotData | null; + data: UserData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The DragonBones data. + * A DragonBones data contains multiple armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据。 + * 一个龙骨数据包含多个骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + class DragonBonesData extends BaseObject { + static toString(): string; + /** + * @private + */ + autoSearch: boolean; + /** + * - The animation frame rate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画帧频。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameRate: number; + /** + * - The data version. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 数据版本。 + * @version DragonBones 3.0 + * @language zh_CN + */ + version: string; + /** + * - The DragonBones data name. + * The name is consistent with the DragonBones project name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据名称。 + * 该名称与龙骨项目名保持一致。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + stage: ArmatureData | null; + /** + * - All armature data names. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly armatureNames: Array; + /** + * @private + */ + readonly armatures: Map; + /** + * @private + */ + userData: UserData | null; + protected _onClear(): void; + /** + * - Get a specific armature data. + * @param armatureName - The armature data name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param armatureName - 骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getArmature(armatureName: string): ArmatureData | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The armature data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class ArmatureData extends BaseObject { + static toString(): string; + /** + * @private + */ + type: ArmatureType; + /** + * - The animation frame rate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画帧率。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameRate: number; + /** + * @private + */ + cacheFrameRate: number; + /** + * @private + */ + scale: number; + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly aabb: Rectangle; + /** + * - The names of all the animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的动画数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animationNames: Array; + /** + * @private + */ + readonly sortedBones: Array; + /** + * @private + */ + readonly sortedSlots: Array; + /** + * @private + */ + readonly defaultActions: Array; + /** + * @private + */ + readonly actions: Array; + /** + * @private + */ + readonly bones: Map; + /** + * @private + */ + readonly slots: Map; + /** + * @private + */ + readonly constraints: Map; + /** + * @private + */ + readonly skins: Map; + /** + * @private + */ + readonly animations: Map; + /** + * - The default skin data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 默认插槽数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + defaultSkin: SkinData | null; + /** + * - The default animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 默认动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + defaultAnimation: AnimationData | null; + /** + * @private + */ + canvas: CanvasData | null; + /** + * @private + */ + userData: UserData | null; + /** + * @private + */ + parent: DragonBonesData; + protected _onClear(): void; + /** + * - Get a specific done data. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼数据。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getBone(boneName: string): BoneData | null; + /** + * - Get a specific slot data. + * @param slotName - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽数据。 + * @param slotName - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlot(slotName: string): SlotData | null; + /** + * @private + */ + getConstraint(constraintName: string): ConstraintData | null; + /** + * - Get a specific skin data. + * @param skinName - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定皮肤数据。 + * @param skinName - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getSkin(skinName: string): SkinData | null; + /** + * @private + */ + getMesh(skinName: string, slotName: string, meshName: string): MeshDisplayData | null; + /** + * - Get a specific animation data. + * @param animationName - The animation animationName. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的动画数据。 + * @param animationName - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getAnimation(animationName: string): AnimationData | null; + } + /** + * - The bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class BoneData extends BaseObject { + static toString(): string; + /** + * @private + */ + inheritTranslation: boolean; + /** + * @private + */ + inheritRotation: boolean; + /** + * @private + */ + inheritScale: boolean; + /** + * @private + */ + inheritReflection: boolean; + /** + * @private + */ + type: BoneType; + /** + * - The bone length. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼长度。 + * @version DragonBones 3.0 + * @language zh_CN + */ + length: number; + /** + * @private + */ + alpha: number; + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly transform: Transform; + /** + * @private + */ + userData: UserData | null; + /** + * - The parent bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 父骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + parent: BoneData | null; + protected _onClear(): void; + } + /** + * - The slot data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class SlotData extends BaseObject { + static toString(): string; + /** + * @private + */ + blendMode: BlendMode; + /** + * @private + */ + displayIndex: number; + /** + * @private + */ + zOrder: number; + /** + * @private + */ + zIndex: number; + /** + * @private + */ + alpha: number; + /** + * - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + color: ColorTransform; + /** + * @private + */ + userData: UserData | null; + /** + * - The parent bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 父骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + parent: BoneData; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class CanvasData extends BaseObject { + static toString(): string; + hasBackground: boolean; + color: number; + x: number; + y: number; + width: number; + height: number; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The skin data, typically a armature data instance contains at least one skinData. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class SkinData extends BaseObject { + static toString(): string; + /** + * - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly displays: Map>; + /** + * @private + */ + parent: ArmatureData; + protected _onClear(): void; + /** + * @private + */ + getDisplay(slotName: string, displayName: string): DisplayData | null; + /** + * @private + */ + getDisplays(slotName: string): Array | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + abstract class ConstraintData extends BaseObject { + order: number; + name: string; + type: ConstraintType; + target: BoneData; + root: BoneData; + bone: BoneData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class GeometryData { + isShared: boolean; + inheritDeform: boolean; + offset: number; + data: DragonBonesData; + weight: WeightData | null; + clear(): void; + shareFrom(value: GeometryData): void; + readonly vertexCount: number; + readonly triangleCount: number; + } + /** + * @private + */ + abstract class DisplayData extends BaseObject { + type: DisplayType; + name: string; + path: string; + readonly transform: Transform; + parent: SkinData; + protected _onClear(): void; + } + /** + * @private + */ + class ImageDisplayData extends DisplayData { + static toString(): string; + readonly pivot: Point; + texture: TextureData | null; + protected _onClear(): void; + } + /** + * @private + */ + class ArmatureDisplayData extends DisplayData { + static toString(): string; + inheritAnimation: boolean; + readonly actions: Array; + armature: ArmatureData | null; + protected _onClear(): void; + /** + * @private + */ + addAction(value: ActionData): void; + } + /** + * @private + */ + class MeshDisplayData extends DisplayData { + static toString(): string; + readonly geometry: GeometryData; + texture: TextureData | null; + protected _onClear(): void; + } + /** + * @private + */ + class BoundingBoxDisplayData extends DisplayData { + static toString(): string; + boundingBox: BoundingBoxData | null; + protected _onClear(): void; + } + /** + * @private + */ + class PathDisplayData extends DisplayData { + static toString(): string; + closed: boolean; + constantSpeed: boolean; + readonly geometry: GeometryData; + readonly curveLengths: Array; + protected _onClear(): void; + } + /** + * @private + */ + class WeightData extends BaseObject { + static toString(): string; + count: number; + offset: number; + readonly bones: Array; + protected _onClear(): void; + addBone(value: BoneData): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The base class of bounding box data. + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框数据基类。 + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract class BoundingBoxData extends BaseObject { + /** + * - The bounding box type. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框类型。 + * @version DragonBones 5.0 + * @language zh_CN + */ + type: BoundingBoxType; + /** + * @private + */ + color: number; + /** + * @private + */ + width: number; + /** + * @private + */ + height: number; + protected _onClear(): void; + /** + * - Check whether the bounding box contains a specific point. (Local coordinate system) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查边界框是否包含特定点。(本地坐标系) + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract containsPoint(pX: number, pY: number): boolean; + /** + * - Check whether the bounding box intersects a specific segment. (Local coordinate system) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查边界框是否与特定线段相交。(本地坐标系) + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA: { + x: number; + y: number; + } | null, intersectionPointB: { + x: number; + y: number; + } | null, normalRadians: { + x: number; + y: number; + } | null): number; + } + /** + * - The rectangle bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 矩形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class RectangleBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * - Compute the bit code for a point (x, y) using the clip rectangle + */ + private static _computeOutCode(x, y, xMin, yMin, xMax, yMax); + /** + * @private + */ + static rectangleIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xMin: number, yMin: number, xMax: number, yMax: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } + /** + * - The ellipse bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 椭圆边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class EllipseBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * @private + */ + static ellipseIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xC: number, yC: number, widthH: number, heightH: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } + /** + * - The polygon bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class PolygonBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * @private + */ + static polygonIntersectsSegment(xA: number, yA: number, xB: number, yB: number, vertices: Array, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + /** + * @private + */ + x: number; + /** + * @private + */ + y: number; + /** + * - The polygon vertices. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形顶点。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly vertices: Array; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class AnimationData extends BaseObject { + static toString(): string; + /** + * @private + */ + blendType: AnimationBlendType; + /** + * - The frame count of the animation. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的帧数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameCount: number; + /** + * - The play times of the animation. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The duration of the animation. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的持续时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + duration: number; + /** + * @private + */ + scale: number; + /** + * - The fade in time of the animation. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的淡入时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + fadeInTime: number; + /** + * @private + */ + cacheFrameRate: number; + /** + * - The animation name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly cachedFrames: Array; + /** + * @private + */ + readonly boneTimelines: Map>; + /** + * @private + */ + readonly slotTimelines: Map>; + /** + * @private + */ + readonly constraintTimelines: Map>; + /** + * @private + */ + readonly animationTimelines: Map>; + /** + * @private + */ + readonly boneCachedFrameIndices: Map>; + /** + * @private + */ + readonly slotCachedFrameIndices: Map>; + /** + * @private + */ + actionTimeline: TimelineData | null; + /** + * @private + */ + zOrderTimeline: TimelineData | null; + /** + * @private + */ + parent: ArmatureData; + protected _onClear(): void; + /** + * @private + */ + addBoneTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addSlotTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addConstraintTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addAnimationTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + getBoneTimelines(timelineName: string): Array | null; + /** + * @private + */ + getSlotTimelines(timelineName: string): Array | null; + /** + * @private + */ + getConstraintTimelines(timelineName: string): Array | null; + /** + * @private + */ + getAnimationTimelines(timelineName: string): Array | null; + /** + * @private + */ + getBoneCachedFrameIndices(boneName: string): Array | null; + /** + * @private + */ + getSlotCachedFrameIndices(slotName: string): Array | null; + } + /** + * @private + */ + class TimelineData extends BaseObject { + static toString(): string; + type: TimelineType; + offset: number; + frameIndicesOffset: number; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation config is used to describe all the information needed to play an animation state. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画配置用来描述播放一个动画状态所需要的全部信息。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + class AnimationConfig extends BaseObject { + static toString(): string; + /** + * @private + */ + pauseFadeOut: boolean; + /** + * - Fade out the pattern of other animation states when the animation state is fade in. + * This property is typically used to specify the substitution of multiple animation states blend. + * @default dragonBones.AnimationFadeOutMode.All + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 淡入动画状态时淡出其他动画状态的模式。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @default dragonBones.AnimationFadeOutMode.All + * @version DragonBones 5.0 + * @language zh_CN + */ + fadeOutMode: AnimationFadeOutMode; + /** + * @private + */ + fadeOutTweenType: TweenType; + /** + * @private + */ + fadeOutTime: number; + /** + * @private + */ + pauseFadeIn: boolean; + /** + * @private + */ + actionEnabled: boolean; + /** + * @private + */ + additive: boolean; + /** + * - Whether the animation state has control over the display property of the slots. + * Sometimes blend a animation state does not want it to control the display properties of the slots, + * especially if other animation state are controlling the display properties of the slots. + * @default true + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态是否对插槽的显示对象属性有控制权。 + * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, + * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 + * @default true + * @version DragonBones 5.0 + * @language zh_CN + */ + displayControl: boolean; + /** + * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. + * This property should usually be set to false when blend multiple animation states. + * @default true + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 + * 通常在混合多个动画状态时应该将该属性设置为 false。 + * @default true + * @version DragonBones 5.1 + * @language zh_CN + */ + resetToPose: boolean; + /** + * @private + */ + fadeInTweenType: TweenType; + /** + * - The play times. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The blend layer. + * High layer animation state will get the blend weight first. + * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合图层。 + * 图层高的动画状态会优先获取混合权重。 + * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + layer: number; + /** + * - The start time of play. (In seconds) + * @default 0.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 播放的开始时间。 (以秒为单位) + * @default 0.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + position: number; + /** + * - The duration of play. + * [-1: Use the default value of the animation data, 0: Stop play, (0~N]: The duration] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 播放的持续时间。 + * [-1: 使用动画数据默认值, 0: 动画停止, (0~N]: 持续时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + duration: number; + /** + * - The play speed. + * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. + * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度。 + * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 + * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + weight: number; + /** + * - The fade in time. + * [-1: Use the default value of the animation data, [0~N]: The fade in time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 淡入时间。 + * [-1: 使用动画数据默认值, [0~N]: 淡入时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + fadeInTime: number; + /** + * - The auto fade out time when the animation state play completed. + * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态播放完成后的自动淡出时间。 + * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + autoFadeOutTime: number; + /** + * - The name of the animation state. (Can be different from the name of the animation data) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态名称。 (可以不同于动画数据) + * @version DragonBones 5.0 + * @language zh_CN + */ + name: string; + /** + * - The animation data name. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画数据名称。 + * @version DragonBones 5.0 + * @language zh_CN + */ + animation: string; + /** + * - The blend group name of the animation state. + * This property is typically used to specify the substitution of multiple animation states blend. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合组名称。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + group: string; + /** + * @private + */ + readonly boneMask: Array; + protected _onClear(): void; + /** + * @private + */ + clear(): void; + /** + * @private + */ + copyFrom(value: AnimationConfig): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class TextureAtlasData extends BaseObject { + /** + * @private + */ + autoSearch: boolean; + /** + * @private + */ + width: number; + /** + * @private + */ + height: number; + /** + * @private + */ + scale: number; + /** + * - The texture atlas name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * - The image path of the texture atlas. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集图片路径。 + * @version DragonBones 3.0 + * @language zh_CN + */ + imagePath: string; + /** + * @private + */ + readonly textures: Map; + protected _onClear(): void; + /** + * @private + */ + copyFrom(value: TextureAtlasData): void; + /** + * @private + */ + getTexture(textureName: string): TextureData | null; + } + /** + * @private + */ + abstract class TextureData extends BaseObject { + static createRectangle(): Rectangle; + rotated: boolean; + name: string; + readonly region: Rectangle; + parent: TextureAtlasData; + frame: Rectangle | null; + protected _onClear(): void; + copyFrom(value: TextureData): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The armature proxy interface, the docking engine needs to implement it concretely. + * @see dragonBones.Armature + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 骨架代理接口,对接的引擎需要对其进行具体实现。 + * @see dragonBones.Armature + * @version DragonBones 5.0 + * @language zh_CN + */ + interface IArmatureProxy extends IEventDispatcher { + /** + * - Dispose the instance and the Armature instance. (The Armature instance will return to the object pool) + * @example + *
+         *     removeChild(armatureDisplay);
+         *     armatureDisplay.dispose();
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 释放该实例和骨架。 (骨架会回收到对象池) + * @example + *
+         *     removeChild(armatureDisplay);
+         *     armatureDisplay.dispose();
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + dispose(disposeProxy: boolean): void; + /** + * - The armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly armature: Armature; + /** + * - The animation player. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animation: Animation; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Armature is the core of the skeleton animation system. + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架是骨骼动画系统的核心。 + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + class Armature extends BaseObject implements IAnimatable { + static toString(): string; + private static _onSortSlots(a, b); + /** + * - Whether to inherit the animation control of the parent armature. + * True to try to have the child armature play an animation with the same name when the parent armature play the animation. + * @default true + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 是否继承父骨架的动画控制。 + * 如果该值为 true,当父骨架播放动画时,会尝试让子骨架播放同名动画。 + * @default true + * @version DragonBones 4.5 + * @language zh_CN + */ + inheritAnimation: boolean; + /** + * @private + */ + userData: any; + private _slotsDirty; + private _zOrderDirty; + private _flipX; + private _flipY; + private _alpha; + private readonly _bones; + private readonly _slots; + private readonly _actions; + private _animation; + private _proxy; + private _display; + private _replacedTexture; + private _clock; + protected _onClear(): void; + /** + * - Dispose the armature. (Return to the object pool) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 释放骨架。 (回收到对象池) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + dispose(): void; + /** + * @inheritDoc + */ + advanceTime(passedTime: number): void; + /** + * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. + * @param boneName - The bone name. (If not set, all bones will be update) + * @param updateSlot - Whether to update the bone's slots. (Default: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 + * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) + * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + invalidUpdate(boneName?: string | null, updateSlot?: boolean): void; + /** + * - Check whether a specific point is inside a custom bounding box in a slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在某个插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + containsPoint(x: number, y: number): Slot | null; + /** + * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 + * @version DragonBones 5.0 + * @language zh_CN + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): Slot | null; + /** + * - Get a specific bone. + * @param name - The bone name. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼。 + * @param name - 骨骼名称。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBone(name: string): Bone | null; + /** + * - Get a specific bone by the display. + * @param display - The display object. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的骨骼。 + * @param display - 显示对象。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBoneByDisplay(display: any): Bone | null; + /** + * - Get a specific slot. + * @param name - The slot name. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽。 + * @param name - 插槽名称。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlot(name: string): Slot | null; + /** + * - Get a specific slot by the display. + * @param display - The display object. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的插槽。 + * @param display - 显示对象。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlotByDisplay(display: any): Slot | null; + /** + * - Get all bones. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBones(): Array; + /** + * - Get all slots. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的插槽。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlots(): Array; + /** + * - Whether to flip the armature horizontally. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架水平翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + flipX: boolean; + /** + * - Whether to flip the armature vertically. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架垂直翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + flipY: boolean; + /** + * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. + * There is a certain amount of memory overhead to improve performance by caching animation data in memory. + * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. + * When the animation cache is turned on, some features will fail, such as the offset property of bone. + * @example + *
+         *     armature.cacheFrameRate = 24;
+         * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 + * @example + *
+         *     armature.cacheFrameRate = 24;
+         * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language zh_CN + */ + cacheFrameRate: number; + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - The armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly armatureData: ArmatureData; + /** + * - The animation player. + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animation: Animation; + /** + * @pivate + */ + readonly proxy: IArmatureProxy; + /** + * - The EventDispatcher instance of the armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架的 EventDispatcher 实例。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly eventDispatcher: IEventDispatcher; + /** + * - The display container. + * The display of the slot is displayed as the parent. + * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 显示容器实例。 + * 插槽的显示对象都会以此显示容器为父级。 + * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly display: any; + /** + * @private + */ + replacedTexture: any; + /** + * @inheritDoc + */ + clock: WorldClock | null; + /** + * - Get the parent slot which the armature belongs to. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架所属的父插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly parent: Slot | null; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + getDisplay(): any; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The base class of the transform object. + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 变换对象的基类。 + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language zh_CN + */ + abstract class TransformObject extends BaseObject { + protected static readonly _helpMatrix: Matrix; + protected static readonly _helpTransform: Transform; + protected static readonly _helpPoint: Point; + /** + * - A matrix relative to the armature coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly globalTransformMatrix: Matrix; + /** + * - A transform relative to the armature coordinate system. + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的变换。 + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly global: Transform; + /** + * - The offset transform relative to the armature or the parent bone coordinate system. + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架或父骨骼坐标系的偏移变换。 + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly offset: Transform; + /** + * @private + */ + origin: Transform | null; + /** + * @private + */ + userData: any; + protected _globalDirty: boolean; + /** + */ + protected _onClear(): void; + /** + * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, + * some engines do not rely on these attributes to update rendering, such as Egret. + * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 + * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + updateGlobalTransform(): void; + /** + * - The armature to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的骨架。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly armature: Armature; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Bone is one of the most important logical units in the armature animation system, + * and is responsible for the realization of translate, rotation, scaling in the animations. + * A armature can contain multiple bones. + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 + * 一个骨架中可以包含多个骨骼。 + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + class Bone extends TransformObject { + static toString(): string; + /** + * - The offset mode. + * @see #offset + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 偏移模式。 + * @see #offset + * @version DragonBones 5.5 + * @language zh_CN + */ + offsetMode: OffsetMode; + protected _localDirty: boolean; + protected _visible: boolean; + protected _cachedFrameIndex: number; + /** + * @private + */ + protected _parent: Bone | null; + protected _onClear(): void; + protected _updateGlobalTransformMatrix(isCache: boolean): void; + /** + * - Forces the bone to update the transform in the next frame. + * When the bone is not animated or its animation state is finished, the bone will not continue to update, + * and when the skeleton must be updated for some reason, the method needs to be called explicitly. + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制骨骼在下一帧更新变换。 + * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + invalidUpdate(): void; + /** + * - Check whether the bone contains a specific bone. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查该骨骼是否包含特定的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + contains(value: Bone): boolean; + /** + * - The bone data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly boneData: BoneData; + /** + * - The visible of all slots in the bone. + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 此骨骼所有插槽的可见。 + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language zh_CN + */ + visible: boolean; + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly parent: Bone | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class DisplayFrame extends BaseObject { + static toString(): string; + rawDisplayData: DisplayData | null; + displayData: DisplayData | null; + textureData: TextureData | null; + display: any | Armature | null; + readonly deformVertices: Array; + protected _onClear(): void; + updateDeformVertices(): void; + getGeometryData(): GeometryData | null; + getBoundingBox(): BoundingBoxData | null; + getTextureData(): TextureData | null; + } + /** + * - The slot attached to the armature, controls the display status and properties of the display object. + * A bone can contain multiple slots. + * A slot can contain multiple display objects, displaying only one of the display objects at a time, + * but you can toggle the display object into frame animation while the animation is playing. + * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, + * and a custom other display object. + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class Slot extends TransformObject { + /** + * - Displays the animated state or mixed group name controlled by the object, set to null to be controlled by all animation states. + * @default null + * @see dragonBones.AnimationState#displayControl + * @see dragonBones.AnimationState#name + * @see dragonBones.AnimationState#group + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 显示对象受到控制的动画状态或混合组名称,设置为 null 则表示受所有的动画状态控制。 + * @default null + * @see dragonBones.AnimationState#displayControl + * @see dragonBones.AnimationState#name + * @see dragonBones.AnimationState#group + * @version DragonBones 4.5 + * @language zh_CN + */ + displayController: string | null; + protected _displayDataDirty: boolean; + protected _displayDirty: boolean; + protected _geometryDirty: boolean; + protected _textureDirty: boolean; + protected _visibleDirty: boolean; + protected _blendModeDirty: boolean; + protected _zOrderDirty: boolean; + protected _transformDirty: boolean; + protected _visible: boolean; + protected _blendMode: BlendMode; + protected _displayIndex: number; + protected _animationDisplayIndex: number; + protected _cachedFrameIndex: number; + protected readonly _localMatrix: Matrix; + protected _boundingBoxData: BoundingBoxData | null; + protected _textureData: TextureData | null; + protected _rawDisplay: any; + protected _meshDisplay: any; + protected _display: any | null; + protected _childArmature: Armature | null; + /** + * @private + */ + protected _parent: Bone; + protected _onClear(): void; + protected abstract _initDisplay(value: any, isRetain: boolean): void; + protected abstract _disposeDisplay(value: any, isRelease: boolean): void; + protected abstract _onUpdateDisplay(): void; + protected abstract _addDisplay(): void; + protected abstract _replaceDisplay(value: any): void; + protected abstract _removeDisplay(): void; + protected abstract _updateZOrder(): void; + protected abstract _updateBlendMode(): void; + protected abstract _updateColor(): void; + protected abstract _updateFrame(): void; + protected abstract _updateMesh(): void; + protected abstract _updateTransform(): void; + protected abstract _identityTransform(): void; + protected _hasDisplay(display: any): boolean; + protected _updateDisplayData(): void; + protected _updateDisplay(): void; + protected _updateGlobalTransformMatrix(isCache: boolean): void; + /** + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + invalidUpdate(): void; + /** + * @private + */ + updateTransformAndMatrix(): void; + /** + * @private + */ + replaceRawDisplayData(displayData: DisplayData | null, index?: number): void; + /** + * @private + */ + replaceDisplayData(displayData: DisplayData | null, index?: number): void; + /** + * @private + */ + replaceTextureData(textureData: TextureData | null, index?: number): void; + /** + * @private + */ + replaceDisplay(value: any | Armature | null, index?: number): void; + /** + * - Check whether a specific point is inside a custom bounding box in the slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + containsPoint(x: number, y: number): boolean; + /** + * - Check whether a specific segment intersects a custom bounding box for the slot. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] + * @version DragonBones 5.0 + * @language zh_CN + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + /** + * @private + */ + getDisplayFrameAt(index: number): DisplayFrame; + /** + * - The visible of slot's display object. + * @default true + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 插槽的显示对象的可见。 + * @default true + * @version DragonBones 5.6 + * @language zh_CN + */ + visible: boolean; + /** + * @private + */ + displayFrameCount: number; + /** + * - The index of the display object displayed in the display list. + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     slot.displayIndex = 3;
+         *     slot.displayController = "none";
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 此时显示的显示对象在显示列表中的索引。 + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     slot.displayIndex = 3;
+         *     slot.displayController = "none";
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + displayIndex: number; + /** + * - The slot name. + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - Contains a display list of display objects or child armatures. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + * @language zh_CN + */ + displayList: Array; + /** + * - The slot data. + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 插槽数据。 + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly slotData: SlotData; + /** + * - The custom bounding box data for the slot at current time. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 插槽此时的自定义包围盒数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly boundingBoxData: BoundingBoxData | null; + /** + * @private + */ + readonly rawDisplay: any; + /** + * @private + */ + readonly meshDisplay: any; + /** + * - The display object that the slot displays at this time. + * @example + *
+         *     let slot = armature.getSlot("text");
+         *     slot.display = new yourEngine.TextField();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的显示对象。 + * @example + *
+         *     let slot = armature.getSlot("text");
+         *     slot.display = new yourEngine.TextField();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + display: any; + /** + * - The child armature that the slot displayed at current time. + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
+         *     }
+         *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的子骨架。 + * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
+         *     }
+         *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + childArmature: Armature | null; + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly parent: Bone; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + getDisplay(): any; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + setDisplay(value: any): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Play animation interface. (Both Armature and Wordclock implement the interface) + * Any instance that implements the interface can be added to the Worldclock instance and advance time by Worldclock instance uniformly. + * @see dragonBones.WorldClock + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放动画接口。 (Armature 和 WordClock 都实现了该接口) + * 任何实现了此接口的实例都可以添加到 WorldClock 实例中,由 WorldClock 实例统一更新时间。 + * @see dragonBones.WorldClock + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + interface IAnimatable { + /** + * - Advance time. + * @param passedTime - Passed time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 更新时间。 + * @param passedTime - 前进的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + advanceTime(passedTime: number): void; + /** + * - The Wordclock instance to which the current belongs. + * @example + *
+         *     armature.clock = factory.clock; // Add armature to clock.
+         *     armature.clock = null; // Remove armature from clock.
+         * 
+ * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 当前所属的 WordClock 实例。 + * @example + *
+         *     armature.clock = factory.clock; // 将骨架添加到时钟。
+         *     armature.clock = null; // 将骨架从时钟移除。
+         * 
+ * @version DragonBones 5.0 + * @language zh_CN + */ + clock: WorldClock | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + class WorldClock implements IAnimatable { + /** + * - Current time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + time: number; + /** + * - The play speed, used to control animation speed-shift play. + * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度,用于控制动画变速播放。 + * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + private _systemTime; + private readonly _animatebles; + private _clock; + /** + * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. + * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 + * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(time?: number); + /** + * - Advance time for all IAnimatable instances. + * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 为所有的 IAnimatable 实例更新时间。 + * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + advanceTime(passedTime: number): void; + /** + * - Check whether contains a specific instance of IAnimatable. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + contains(value: IAnimatable): boolean; + /** + * - Add IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + add(value: IAnimatable): void; + /** + * - Removes a specified IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + remove(value: IAnimatable): void; + /** + * - Clear all IAnimatable instances. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + clear(): void; + /** + * @inheritDoc + */ + clock: WorldClock | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation player is used to play the animation data and manage the animation states. + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器用来播放动画数据和管理动画状态。 + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + class Animation extends BaseObject { + static toString(): string; + /** + * - The play speed of all animations. [0: Stop, (0~1): Slow, 1: Normal, (1~N): Fast] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有动画的播放速度。 [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * Update bones and slots cachedFrameIndices. + */ + private _animationDirty; + private _inheritTimeScale; + private readonly _animationNames; + private readonly _animationStates; + private readonly _animations; + private readonly _blendStates; + private _armature; + private _animationConfig; + private _lastAnimationState; + protected _onClear(): void; + private _fadeOut(animationConfig); + /** + * - Clear all animations states. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除所有的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + reset(): void; + /** + * - Pause a specific animation state. + * @param animationName - The name of animation state. (If not set, it will pause all animations) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停指定动画状态的播放。 + * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + stop(animationName?: string | null): void; + /** + * - Play animation with a specific animation config. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @param animationConfig - The animation config. + * @returns The playing animation state. + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 通过指定的动画配置来播放动画。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @param animationConfig - 动画配置。 + * @returns 播放的动画状态。 + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + playConfig(animationConfig: AnimationConfig): AnimationState | null; + /** + * - Play a specific animation. + * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) + * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放指定动画。 + * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + play(animationName?: string | null, playTimes?: number): AnimationState | null; + /** + * - Fade in a specific animation. + * @param animationName - The name of animation data. + * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) + * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) + * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) + * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 淡入播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) + * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) + * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + fadeIn(animationName: string, fadeInTime?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode): AnimationState | null; + /** + * - Play a specific animation from the specific time. + * @param animationName - The name of animation data. + * @param time - The start time point of playing. (In seconds) + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定时间开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param time - 播放开始的时间。 (以秒为单位) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByTime(animationName: string, time?: number, playTimes?: number): AnimationState | null; + /** + * - Play a specific animation from the specific frame. + * @param animationName - The name of animation data. + * @param frame - The start frame of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定帧开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param frame - 播放开始的帧数。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByFrame(animationName: string, frame?: number, playTimes?: number): AnimationState | null; + /** + * - Play a specific animation from the specific progress. + * @param animationName - The name of animation data. + * @param progress - The start progress value of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定进度开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param progress - 开始播放的进度。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByProgress(animationName: string, progress?: number, playTimes?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific time. + * @param animationName - The name of animation data. + * @param time - The stop time. (In seconds) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定时间停止指定动画播放 + * @param animationName - 动画数据名称。 + * @param time - 停止的时间。 (以秒为单位) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByTime(animationName: string, time?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific frame. + * @param animationName - The name of animation data. + * @param frame - The stop frame. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定帧停止指定动画的播放 + * @param animationName - 动画数据名称。 + * @param frame - 停止的帧数。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByFrame(animationName: string, frame?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific progress. + * @param animationName - The name of animation data. + * @param progress - The stop progress value. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定的进度停止指定的动画播放。 + * @param animationName - 动画数据名称。 + * @param progress - 停止进度。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByProgress(animationName: string, progress?: number): AnimationState | null; + /** + * - Get a specific animation state. + * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取指定的动画状态。 + * @param animationName - 动画状态名称。 + * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + getState(animationName: string, layer?: number): AnimationState | null; + /** + * - Check whether a specific animation data is included. + * @param animationName - The name of animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含指定的动画数据 + * @param animationName - 动画数据名称。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + hasAnimation(animationName: string): boolean; + /** + * - Get all the animation states. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取所有的动画状态 + * @version DragonBones 5.1 + * @language zh_CN + */ + getStates(): ReadonlyArray; + /** + * - Check whether there is an animation state is playing + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否有动画状态正在播放 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isPlaying: boolean; + /** + * - Check whether all the animation states' playing were finished. + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否所有的动画状态均已播放完毕。 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isCompleted: boolean; + /** + * - The name of the last playing animation state. + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态名称 + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly lastAnimationName: string; + /** + * - The name of all animation data + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有动画数据的名称 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly animationNames: ReadonlyArray; + /** + * - All animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有的动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + animations: Map; + /** + * - An AnimationConfig instance that can be used quickly. + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 一个可以快速使用的动画配置实例。 + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly animationConfig: AnimationConfig; + /** + * - The last playing animation state + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly lastAnimationState: AnimationState | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation state is generated when the animation data is played. + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画状态由播放动画数据时产生。 + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + class AnimationState extends BaseObject { + static toString(): string; + /** + * @private + */ + actionEnabled: boolean; + /** + * @private + */ + additive: boolean; + /** + * - Whether the animation state has control over the display object properties of the slots. + * Sometimes blend a animation state does not want it to control the display object properties of the slots, + * especially if other animation state are controlling the display object properties of the slots. + * @default true + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态是否对插槽的显示对象属性有控制权。 + * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, + * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 + * @default true + * @version DragonBones 5.0 + * @language zh_CN + */ + displayControl: boolean; + /** + * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. + * This property should usually be set to false when blend multiple animation states. + * @default true + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 + * 通常在混合多个动画状态时应该将该属性设置为 false。 + * @default true + * @version DragonBones 5.1 + * @language zh_CN + */ + resetToPose: boolean; + /** + * @private + */ + blendType: AnimationBlendType; + /** + * - The play times. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The blend layer. + * High layer animation state will get the blend weight first. + * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合图层。 + * 图层高的动画状态会优先获取混合权重。 + * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + layer: number; + /** + * - The play speed. + * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. + * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度。 + * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 + * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * @private + */ + parameterX: number; + /** + * @private + */ + parameterY: number; + /** + * @private + */ + positionX: number; + /** + * @private + */ + positionY: number; + /** + * - The auto fade out time when the animation state play completed. + * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态播放完成后的自动淡出时间。 + * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + autoFadeOutTime: number; + /** + * @private + */ + fadeTotalTime: number; + /** + * - The name of the animation state. (Can be different from the name of the animation data) + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态名称。 (可以不同于动画数据) + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + name: string; + /** + * - The blend group name of the animation state. + * This property is typically used to specify the substitution of multiple animation states blend. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合组名称。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + group: string; + private _timelineDirty; + private _weight; + private _fadeTime; + private _time; + private readonly _boneMask; + private readonly _boneTimelines; + private readonly _boneBlendTimelines; + private readonly _slotTimelines; + private readonly _slotBlendTimelines; + private readonly _constraintTimelines; + private readonly _animationTimelines; + private readonly _poseTimelines; + private _animationData; + private _armature; + private _zOrderTimeline; + private _activeChildA; + private _activeChildB; + protected _onClear(): void; + private _updateTimelines(); + private _updateBoneAndSlotTimelines(); + private _advanceFadeTime(passedTime); + /** + * - Continue play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 继续播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + play(): void; + /** + * - Stop play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + stop(): void; + /** + * - Fade out the animation state. + * @param fadeOutTime - The fade out time. (In seconds) + * @param pausePlayhead - Whether to pause the animation playing when fade out. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 淡出动画状态。 + * @param fadeOutTime - 淡出时间。 (以秒为单位) + * @param pausePlayhead - 淡出时是否暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + fadeOut(fadeOutTime: number, pausePlayhead?: boolean): void; + /** + * - Check if a specific bone mask is included. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + containsBoneMask(boneName: string): boolean; + /** + * - Add a specific bone mask. + * @param boneName - The bone name. + * @param recursive - Whether or not to add a mask to the bone's sub-bone. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加特定的骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + addBoneMask(boneName: string, recursive?: boolean): void; + /** + * - Remove the mask of a specific bone. + * @param boneName - The bone name. + * @param recursive - Whether to remove the bone's sub-bone mask. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除特定骨骼的遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + removeBoneMask(boneName: string, recursive?: boolean): void; + /** + * - Remove all bone masks. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + removeAllBoneMask(): void; + /** + * @private + */ + addState(animationState: AnimationState, timelineDatas?: TimelineData[] | null): void; + /** + * - Whether the animation state is fading in. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡入。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeIn: boolean; + /** + * - Whether the animation state is fading out. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡出。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeOut: boolean; + /** + * - Whether the animation state is fade completed. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否淡入或淡出完毕。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeComplete: boolean; + /** + * - Whether the animation state is playing. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否正在播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isPlaying: boolean; + /** + * - Whether the animation state is play completed. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否播放完毕。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isCompleted: boolean; + /** + * - The times has been played. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 已经循环播放的次数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly currentPlayTimes: number; + /** + * - The total time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 总播放时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly totalTime: number; + /** + * - The time is currently playing. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前播放的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + currentTime: number; + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + /** + * - The animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + weight: number; + /** + * - 动画数据。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animationData: AnimationData; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The properties of the object carry basic information about an event, + * which are passed as parameter or parameter's parameter to event listeners when an event occurs. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 + * @version DragonBones 4.5 + * @language zh_CN + */ + class EventObject extends BaseObject { + /** + * - Animation start play. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画开始播放。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly START: string; + /** + * - Animation loop play complete once. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画循环播放完成一次。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly LOOP_COMPLETE: string; + /** + * - Animation play complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画播放完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly COMPLETE: string; + /** + * - Animation fade in start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_IN: string; + /** + * - Animation fade in complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_IN_COMPLETE: string; + /** + * - Animation fade out start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_OUT: string; + /** + * - Animation fade out complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_OUT_COMPLETE: string; + /** + * - Animation frame event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FRAME_EVENT: string; + /** + * - Animation frame sound event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧声音事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly SOUND_EVENT: string; + static toString(): string; + /** + * - If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 如果是帧事件,此值用来描述该事件在动画时间轴中所处的时间。(以秒为单位) + * @version DragonBones 4.5 + * @language zh_CN + */ + time: number; + /** + * - The event type。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件类型。 + * @version DragonBones 4.5 + * @language zh_CN + */ + type: EventStringType; + /** + * - The event name. (The frame event name or the frame sound name) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件名称。 (帧事件的名称或帧声音的名称) + * @version DragonBones 4.5 + * @language zh_CN + */ + name: string; + /** + * - The armature that dispatch the event. + * @see dragonBones.Armature + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的骨架。 + * @see dragonBones.Armature + * @version DragonBones 4.5 + * @language zh_CN + */ + armature: Armature; + /** + * - The bone that dispatch the event. + * @see dragonBones.Bone + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 4.5 + * @language zh_CN + */ + bone: Bone | null; + /** + * - The slot that dispatch the event. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + slot: Slot | null; + /** + * - The animation state that dispatch the event. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + animationState: AnimationState; + /** + * @private + */ + actionData: ActionData | null; + /** + * @private + */ + /** + * - The custom data. + * @see dragonBones.CustomData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义数据。 + * @see dragonBones.CustomData + * @version DragonBones 5.0 + * @language zh_CN + */ + data: UserData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + type EventStringType = string | "start" | "loopComplete" | "complete" | "fadeIn" | "fadeInComplete" | "fadeOut" | "fadeOutComplete" | "frameEvent" | "soundEvent"; + /** + * - The event dispatcher interface. + * Dragonbones event dispatch usually relies on docking engine to implement, which defines the event method to be implemented when docking the engine. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件派发接口。 + * DragonBones 的事件派发通常依赖于对接的引擎来实现,该接口定义了对接引擎时需要实现的事件方法。 + * @version DragonBones 4.5 + * @language zh_CN + */ + interface IEventDispatcher { + /** + * - Checks whether the object has any listeners registered for a specific type of event。 + * @param type - Event type. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 检查是否为特定的事件类型注册了任何侦听器。 + * @param type - 事件类型。 + * @version DragonBones 4.5 + * @language zh_CN + */ + hasDBEventListener(type: EventStringType): boolean; + /** + * - Dispatches an event into the event flow. + * @param type - Event type. + * @param eventObject - Event object. + * @see dragonBones.EventObject + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分派特定的事件到事件流中。 + * @param type - 事件类型。 + * @param eventObject - 事件数据。 + * @see dragonBones.EventObject + * @version DragonBones 4.5 + * @language zh_CN + */ + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + /** + * - Add an event listener object so that the listener receives notification of an event. + * @param type - Event type. + * @param listener - Event listener. + * @param thisObject - The listener function's "this". + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 添加特定事件类型的事件侦听器,以使侦听器能够接收事件通知。 + * @param type - 事件类型。 + * @param listener - 事件侦听器。 + * @param thisObject - 侦听函数绑定的 this 对象。 + * @version DragonBones 4.5 + * @language zh_CN + */ + addDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; + /** + * - Removes a listener from the object. + * @param type - Event type. + * @param listener - Event listener. + * @param thisObject - The listener function's "this". + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 删除特定事件类型的侦听器。 + * @param type - 事件类型。 + * @param listener - 事件侦听器。 + * @param thisObject - 侦听函数绑定的 this 对象。 + * @version DragonBones 4.5 + * @language zh_CN + */ + removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + abstract class DataParser { + protected static readonly DATA_VERSION_2_3: string; + protected static readonly DATA_VERSION_3_0: string; + protected static readonly DATA_VERSION_4_0: string; + protected static readonly DATA_VERSION_4_5: string; + protected static readonly DATA_VERSION_5_0: string; + protected static readonly DATA_VERSION_5_5: string; + protected static readonly DATA_VERSION_5_6: string; + protected static readonly DATA_VERSION: string; + protected static readonly DATA_VERSIONS: Array; + protected static readonly TEXTURE_ATLAS: string; + protected static readonly SUB_TEXTURE: string; + protected static readonly FORMAT: string; + protected static readonly IMAGE_PATH: string; + protected static readonly WIDTH: string; + protected static readonly HEIGHT: string; + protected static readonly ROTATED: string; + protected static readonly FRAME_X: string; + protected static readonly FRAME_Y: string; + protected static readonly FRAME_WIDTH: string; + protected static readonly FRAME_HEIGHT: string; + protected static readonly DRADON_BONES: string; + protected static readonly USER_DATA: string; + protected static readonly ARMATURE: string; + protected static readonly CANVAS: string; + protected static readonly BONE: string; + protected static readonly SURFACE: string; + protected static readonly SLOT: string; + protected static readonly CONSTRAINT: string; + protected static readonly SKIN: string; + protected static readonly DISPLAY: string; + protected static readonly FRAME: string; + protected static readonly IK: string; + protected static readonly PATH_CONSTRAINT: string; + protected static readonly ANIMATION: string; + protected static readonly TIMELINE: string; + protected static readonly FFD: string; + protected static readonly TRANSLATE_FRAME: string; + protected static readonly ROTATE_FRAME: string; + protected static readonly SCALE_FRAME: string; + protected static readonly DISPLAY_FRAME: string; + protected static readonly COLOR_FRAME: string; + protected static readonly DEFAULT_ACTIONS: string; + protected static readonly ACTIONS: string; + protected static readonly EVENTS: string; + protected static readonly INTS: string; + protected static readonly FLOATS: string; + protected static readonly STRINGS: string; + protected static readonly TRANSFORM: string; + protected static readonly PIVOT: string; + protected static readonly AABB: string; + protected static readonly COLOR: string; + protected static readonly VERSION: string; + protected static readonly COMPATIBLE_VERSION: string; + protected static readonly FRAME_RATE: string; + protected static readonly TYPE: string; + protected static readonly SUB_TYPE: string; + protected static readonly NAME: string; + protected static readonly PARENT: string; + protected static readonly TARGET: string; + protected static readonly STAGE: string; + protected static readonly SHARE: string; + protected static readonly PATH: string; + protected static readonly LENGTH: string; + protected static readonly DISPLAY_INDEX: string; + protected static readonly Z_ORDER: string; + protected static readonly Z_INDEX: string; + protected static readonly BLEND_MODE: string; + protected static readonly INHERIT_TRANSLATION: string; + protected static readonly INHERIT_ROTATION: string; + protected static readonly INHERIT_SCALE: string; + protected static readonly INHERIT_REFLECTION: string; + protected static readonly INHERIT_ANIMATION: string; + protected static readonly INHERIT_DEFORM: string; + protected static readonly SEGMENT_X: string; + protected static readonly SEGMENT_Y: string; + protected static readonly BEND_POSITIVE: string; + protected static readonly CHAIN: string; + protected static readonly WEIGHT: string; + protected static readonly BLEND_TYPE: string; + protected static readonly FADE_IN_TIME: string; + protected static readonly PLAY_TIMES: string; + protected static readonly SCALE: string; + protected static readonly OFFSET: string; + protected static readonly POSITION: string; + protected static readonly DURATION: string; + protected static readonly TWEEN_EASING: string; + protected static readonly TWEEN_ROTATE: string; + protected static readonly TWEEN_SCALE: string; + protected static readonly CLOCK_WISE: string; + protected static readonly CURVE: string; + protected static readonly SOUND: string; + protected static readonly EVENT: string; + protected static readonly ACTION: string; + protected static readonly X: string; + protected static readonly Y: string; + protected static readonly SKEW_X: string; + protected static readonly SKEW_Y: string; + protected static readonly SCALE_X: string; + protected static readonly SCALE_Y: string; + protected static readonly VALUE: string; + protected static readonly ROTATE: string; + protected static readonly SKEW: string; + protected static readonly ALPHA: string; + protected static readonly ALPHA_OFFSET: string; + protected static readonly RED_OFFSET: string; + protected static readonly GREEN_OFFSET: string; + protected static readonly BLUE_OFFSET: string; + protected static readonly ALPHA_MULTIPLIER: string; + protected static readonly RED_MULTIPLIER: string; + protected static readonly GREEN_MULTIPLIER: string; + protected static readonly BLUE_MULTIPLIER: string; + protected static readonly UVS: string; + protected static readonly VERTICES: string; + protected static readonly TRIANGLES: string; + protected static readonly WEIGHTS: string; + protected static readonly SLOT_POSE: string; + protected static readonly BONE_POSE: string; + protected static readonly BONES: string; + protected static readonly POSITION_MODE: string; + protected static readonly SPACING_MODE: string; + protected static readonly ROTATE_MODE: string; + protected static readonly SPACING: string; + protected static readonly ROTATE_OFFSET: string; + protected static readonly ROTATE_MIX: string; + protected static readonly TRANSLATE_MIX: string; + protected static readonly TARGET_DISPLAY: string; + protected static readonly CLOSED: string; + protected static readonly CONSTANT_SPEED: string; + protected static readonly VERTEX_COUNT: string; + protected static readonly LENGTHS: string; + protected static readonly GOTO_AND_PLAY: string; + protected static readonly DEFAULT_NAME: string; + protected static _getArmatureType(value: string): ArmatureType; + protected static _getBoneType(value: string): BoneType; + protected static _getPositionMode(value: string): PositionMode; + protected static _getSpacingMode(value: string): SpacingMode; + protected static _getRotateMode(value: string): RotateMode; + protected static _getDisplayType(value: string): DisplayType; + protected static _getBoundingBoxType(value: string): BoundingBoxType; + protected static _getBlendMode(value: string): BlendMode; + protected static _getAnimationBlendType(value: string): AnimationBlendType; + protected static _getActionType(value: string): ActionType; + abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null; + abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + const enum FrameValueType { + Step = 0, + Int = 1, + Float = 2, + } + /** + * @private + */ + class ObjectDataParser extends DataParser { + protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean; + protected static _getNumber(rawData: any, key: string, defaultValue: number): number; + protected static _getString(rawData: any, key: string, defaultValue: string): string; + protected _rawTextureAtlasIndex: number; + protected readonly _rawBones: Array; + protected _data: DragonBonesData; + protected _armature: ArmatureData; + protected _bone: BoneData; + protected _geometry: GeometryData; + protected _slot: SlotData; + protected _skin: SkinData; + protected _mesh: MeshDisplayData; + protected _animation: AnimationData; + protected _timeline: TimelineData; + protected _rawTextureAtlases: Array | null; + private _frameValueType; + private _defaultColorOffset; + private _prevClockwise; + private _prevRotation; + private _frameDefaultValue; + private _frameValueScale; + private readonly _helpMatrixA; + private readonly _helpMatrixB; + private readonly _helpTransform; + private readonly _helpColorTransform; + private readonly _helpPoint; + private readonly _helpArray; + private readonly _intArray; + private readonly _floatArray; + private readonly _frameIntArray; + private readonly _frameFloatArray; + private readonly _frameArray; + private readonly _timelineArray; + private readonly _colorArray; + private readonly _cacheRawMeshes; + private readonly _cacheMeshes; + private readonly _actionFrames; + private readonly _weightSlotPose; + private readonly _weightBonePoses; + private readonly _cacheBones; + private readonly _slotChildActions; + private _getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, t, result); + private _samplingEasingCurve(curve, samples); + private _parseActionDataInFrame(rawData, frameStart, bone, slot); + private _mergeActionFrame(rawData, frameStart, type, bone, slot); + protected _parseArmature(rawData: any, scale: number): ArmatureData; + protected _parseBone(rawData: any): BoneData; + protected _parseIKConstraint(rawData: any): ConstraintData | null; + protected _parsePathConstraint(rawData: any): ConstraintData | null; + protected _parseSlot(rawData: any, zOrder: number): SlotData; + protected _parseSkin(rawData: any): SkinData; + protected _parseDisplay(rawData: any): DisplayData | null; + protected _parsePath(rawData: any, display: PathDisplayData): void; + protected _parsePivot(rawData: any, display: ImageDisplayData): void; + protected _parseMesh(rawData: any, mesh: MeshDisplayData): void; + protected _parseBoundingBox(rawData: any): BoundingBoxData | null; + protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData; + protected _parseAnimation(rawData: any): AnimationData; + protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, timelineType: TimelineType, frameValueType: FrameValueType, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number, timeline?: TimelineData | null): TimelineData | null; + protected _parseBoneTimeline(rawData: any): void; + protected _parseSlotTimeline(rawData: any): void; + protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSingleValueFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseDoubleValueFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number; + protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotDeformFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array; + protected _parseDeformFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseTransform(rawData: any, transform: Transform, scale: number): void; + protected _parseColorTransform(rawData: any, color: ColorTransform): void; + protected _parseGeometry(rawData: any, geometry: GeometryData): void; + protected _parseArray(rawData: any): void; + protected _modifyArray(): void; + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null; + parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale?: number): boolean; + private static _objectDataParserInstance; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + static getInstance(): ObjectDataParser; + } + /** + * @private + */ + class ActionFrame { + frameStart: number; + readonly actions: Array; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class BinaryDataParser extends ObjectDataParser { + private _binaryOffset; + private _binary; + private _intArrayBuffer; + private _frameArrayBuffer; + private _timelineArrayBuffer; + private _inRange(a, min, max); + private _decodeUTF8(data); + private _parseBinaryTimeline(type, offset, timelineData?); + protected _parseAnimation(rawData: any): AnimationData; + protected _parseGeometry(rawData: any, geometry: GeometryData): void; + protected _parseArray(rawData: any): void; + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null; + private static _binaryDataParserInstance; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + static getInstance(): BinaryDataParser; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) + * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. + * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) + * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 + * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class BaseFactory { + protected static _objectParser: ObjectDataParser; + protected static _binaryParser: BinaryDataParser; + /** + * @private + */ + autoSearch: boolean; + protected readonly _dragonBonesDataMap: Map; + protected readonly _textureAtlasDataMap: Map>; + protected _dragonBones: DragonBones; + protected _dataParser: DataParser; + /** + * - Create a factory instance. (typically only one global factory instance is required) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(dataParser?: DataParser | null); + protected _isSupportMesh(): boolean; + protected _getTextureData(textureAtlasName: string, textureName: string): TextureData | null; + protected _fillBuildArmaturePackage(dataPackage: BuildArmaturePackage, dragonBonesName: string, armatureName: string, skinName: string, textureAtlasName: string): boolean; + protected _buildBones(dataPackage: BuildArmaturePackage, armature: Armature): void; + /** + * @private + */ + protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void; + protected _buildConstraints(dataPackage: BuildArmaturePackage, armature: Armature): void; + protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, _slot: Slot, displayData: ArmatureDisplayData): Armature | null; + protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, slot: Slot): any; + protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData; + protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature; + protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot; + /** + * - Parse the raw data to a DragonBonesData instance and cache it to the factory. + * @param rawData - The raw data. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for all armatures. (Default: 1.0) + * @returns DragonBonesData instance + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 + * @param rawData - 原始数据。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) + * @returns DragonBonesData 实例 + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language zh_CN + */ + parseDragonBonesData(rawData: any, name?: string | null, scale?: number): DragonBonesData | null; + /** + * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. + * @param rawData - The raw texture atlas data. + * @param textureAtlas - The texture atlas object. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for the map set. (Default: 1.0) + * @returns TextureAtlasData instance + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 + * @param rawData - 原始贴图集数据。 + * @param textureAtlas - 贴图集对象。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) + * @returns TextureAtlasData 实例 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language zh_CN + */ + parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData; + /** + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN + */ + updateTextureAtlases(textureAtlases: Array, name: string): void; + /** + * - Get a specific DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @returns DragonBonesData instance + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 DragonBonesData 实例。 + * @param name - DragonBonesData 实例的缓存名称。 + * @returns DragonBonesData 实例 + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + getDragonBonesData(name: string): DragonBonesData | null; + /** + * - Cache a DragonBonesData instance to the factory. + * @param data - The DragonBonesData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 DragonBonesData 实例缓存到工厂中。 + * @param data - DragonBonesData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + addDragonBonesData(data: DragonBonesData, name?: string | null): void; + /** + * - Remove a DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @param disposeData - Whether to dispose data. (Default: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 DragonBonesData 实例。 + * @param name - DragonBonesData 实例缓存名称。 + * @param disposeData - 是否释放数据。 (默认: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + removeDragonBonesData(name: string, disposeData?: boolean): void; + /** + * - Get a list of specific TextureAtlasData instances. + * @param name - The TextureAtlasData cahce name. + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 TextureAtlasData 实例列表。 + * @param name - TextureAtlasData 实例缓存名称。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + getTextureAtlasData(name: string): Array | null; + /** + * - Cache a TextureAtlasData instance to the factory. + * @param data - The TextureAtlasData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 TextureAtlasData 实例缓存到工厂中。 + * @param data - TextureAtlasData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + addTextureAtlasData(data: TextureAtlasData, name?: string | null): void; + /** + * - Remove a TextureAtlasData instance. + * @param name - The TextureAtlasData instance cache name. + * @param disposeData - Whether to dispose data. + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 TextureAtlasData 实例。 + * @param name - TextureAtlasData 实例的缓存名称。 + * @param disposeData - 是否释放数据。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + removeTextureAtlasData(name: string, disposeData?: boolean): void; + /** + * - Get a specific armature data. + * @param name - The armature data name. + * @param dragonBonesName - The cached name for DragonbonesData instance. + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param name - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language zh_CN + */ + getArmatureData(name: string, dragonBonesName?: string): ArmatureData | null; + /** + * - Clear all cached DragonBonesData instances and TextureAtlasData instances. + * @param disposeData - Whether to dispose data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 + * @param disposeData - 是否释放数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + clear(disposeData?: boolean): void; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. + * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature. + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 + * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架。 + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + buildArmature(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): Armature | null; + /** + * @private + */ + replaceDisplay(slot: Slot, displayData: DisplayData | null, displayIndex?: number): void; + /** + * - Replaces the current display data for a particular slot with a specific display data. + * Specify display data with "dragonBonesName/armatureName/slotName/displayName". + * @param dragonBonesName - The DragonBonesData instance cache name. + * @param armatureName - The armature data name. + * @param slotName - The slot data name. + * @param displayName - The display data name. + * @param slot - The slot. + * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 + * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @param armatureName - 骨架数据名称。 + * @param slotName - 插槽数据名称。 + * @param displayName - 显示对象数据名称。 + * @param slot - 插槽。 + * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + replaceSlotDisplay(dragonBonesName: string, armatureName: string, slotName: string, displayName: string, slot: Slot, displayIndex?: number): boolean; + /** + * @private + */ + replaceSlotDisplayList(dragonBonesName: string | null, armatureName: string, slotName: string, slot: Slot): boolean; + /** + * - Share specific skin data with specific armature. + * @param armature - The armature. + * @param skin - The skin data. + * @param isOverride - Whether it completely override the original skin. (Default: false) + * @param exclude - A list of slot names that do not need to be replace. + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 将特定的皮肤数据共享给特定的骨架使用。 + * @param armature - 骨架。 + * @param skin - 皮肤数据。 + * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) + * @param exclude - 不需要被替换的插槽名称列表。 + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language zh_CN + */ + replaceSkin(armature: Armature, skin: SkinData, isOverride?: boolean, exclude?: Array | null): boolean; + /** + * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. + * This enables you to make a armature template so that other armature without animations can share it's animations. + * @param armature - The armtaure. + * @param armatureData - The armature data. + * @param isOverride - Whether to completely overwrite the original animation. (Default: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 + * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 + * @param armature - 骨架。 + * @param armatureData - 骨架数据。 + * @param isOverride - 是否完全覆盖原来的动画。(默认: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language zh_CN + */ + replaceAnimation(armature: Armature, armatureData: ArmatureData, isOverride?: boolean): boolean; + /** + * @private + */ + getAllDragonBonesData(): Map; + /** + * @private + */ + getAllTextureAtlasData(): Map>; + /** + * - An Worldclock instance updated by engine. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 由引擎驱动的 WorldClock 实例。 + * @version DragonBones 5.7 + * @language zh_CN + */ + readonly clock: WorldClock; + /** + * @private + */ + readonly dragonBones: DragonBones; + } + /** + * @private + */ + class BuildArmaturePackage { + dataName: string; + textureAtlasName: string; + data: DragonBonesData; + armature: ArmatureData; + skin: SkinData | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + class DragonBonesAsset extends cc.Asset { + url: string; + } + class TextureAtlasAsset extends cc.Asset { + url: string; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The Cocos texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class CocosTextureAtlasData extends TextureAtlasData { + static toString(): string; + private _renderTexture; + protected _onClear(): void; + createTexture(): TextureData; + /** + * - The Cocos texture. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 贴图。 + * @version DragonBones 3.0 + * @language zh_CN + */ + renderTexture: cc.Texture2D | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @see dragonBones.IArmatureProxy + */ + class CocosArmatureComponent extends cc._RendererUnderSG implements IArmatureProxy { + /** + * @private + */ + debugDraw: boolean; + private _debugDraw; + dbInit(armature: Armature): void; + dbClear(): void; + dbUpdate(): void; + dispose(_isposeProxy?: boolean): void; + destroy(): true; + /** + * @private + */ + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + hasDBEventListener(type: EventStringType): boolean; + addDBEventListener(type: EventStringType, listener: (event: cc.Event.EventCustom) => void, target: any): void; + removeDBEventListener(type: EventStringType, listener: (event: cc.Event.EventCustom) => void, target: any): void; + readonly armature: Armature; + readonly animation: Animation; + start(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The Cocos slot. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 插槽。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class CocosSlot extends Slot { + static toString(): string; + private _textureScale; + private _renderDisplay; + protected _onClear(): void; + protected _initDisplay(_value: any, _isRetain: boolean): void; + protected _disposeDisplay(value: any, isRelease: boolean): void; + protected _onUpdateDisplay(): void; + protected _addDisplay(): void; + protected _replaceDisplay(value: any): void; + protected _removeDisplay(): void; + protected _updateZOrder(): void; + protected _updateBlendMode(): void; + protected _updateColor(): void; + protected _updateFrame(): void; + protected _updateMesh(): void; + protected _updateTransform(): void; + protected _identityTransform(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The Cocos factory. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 工厂。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class CocosFactory extends BaseFactory { + private static _dragonBonesInstance; + private static _factory; + /** + * - A global factory instance that can be used directly. + * @version DragonBones 4.7 + * @language en_US + */ + /** + * - 一个可以直接使用的全局工厂实例。 + * @version DragonBones 4.7 + * @language zh_CN + */ + static readonly factory: CocosFactory; + protected _node: cc.Node | null; + protected _armatureNode: cc.Node | null; + constructor(dataParser?: DataParser | null); + protected _isSupportMesh(): boolean; + protected _buildTextureAtlasData(textureAtlasData: CocosTextureAtlasData | null, textureAtlas: cc.Texture2D | null): CocosTextureAtlasData; + protected _buildArmature(dataPackage: BuildArmaturePackage): Armature; + protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, slot: Slot, displayData: ArmatureDisplayData): Armature | null; + protected _buildSlot(_dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot; + /** + * - Create a armature component from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it. + * - The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update. + * - Note that when the created armature proxy that is no longer in use, you need to explicitly dispose {@link #dragonBones.IArmatureProxy#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature component. + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + * + *
+         *     let armatureComponent = factory.buildArmatureComponent("armatureName", "dragonBonesName");
+         * 
+ * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架组件,并用 {@link #clock} 更新该骨架。 + * - 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。 + * - 注意,创建的骨架代理不再使用时,需要显式释放 {@link #dragonBones.IArmatureProxy#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架组件。 + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + * + *
+         *     let armatureComponent = factory.buildArmatureComponent("armatureName", "dragonBonesName");
+         * 
+ * @language zh_CN + */ + buildArmatureComponent(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string, node?: cc.Node | null): CocosArmatureComponent | null; + /** + * - Create the display object with the specified texture. + * @param textureName - The texture data name. + * @param textureAtlasName - The texture atlas data name. (Of not set, all texture atlas data will be searched) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建带有指定贴图的显示对象。 + * @param textureName - 贴图数据名称。 + * @param textureAtlasName - 贴图集数据名称。 (如果未设置,将检索所有的贴图集数据) + * @version DragonBones 3.0 + * @language zh_CN + */ + getTextureDisplay(textureName: string, textureAtlasName?: string | null): cc.Sprite | null; + /** + * - A global sound event manager. + * Sound events can be listened to uniformly from the manager. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 全局声音事件管理器。 + * 声音事件可以从该管理器统一侦听。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly soundEventManager: cc.Node; + } +} diff --git a/Cocos/Demos/jsconfig.json b/Cocos/Demos/jsconfig.json new file mode 100644 index 00000000..80c25632 --- /dev/null +++ b/Cocos/Demos/jsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "experimentalDecorators": true + }, + "exclude": [ + "node_modules", + ".vscode", + "library", + "local", + "settings", + "temp" + ] +} \ No newline at end of file diff --git a/Cocos/Demos/packages/dragonbones/assets/dragonBones.js b/Cocos/Demos/packages/dragonbones/assets/dragonBones.js new file mode 100755 index 00000000..e3fcdf6e --- /dev/null +++ b/Cocos/Demos/packages/dragonbones/assets/dragonBones.js @@ -0,0 +1,16258 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DragonBones = (function () { + function DragonBones(eventManager) { + this._clock = new dragonBones.WorldClock(); + this._events = []; + this._objects = []; + this._eventManager = null; + this._eventManager = eventManager; + console.info("DragonBones: " + DragonBones.VERSION + "\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/"); + } + DragonBones.prototype.advanceTime = function (passedTime) { + if (this._objects.length > 0) { + for (var _i = 0, _a = this._objects; _i < _a.length; _i++) { + var object = _a[_i]; + object.returnToPool(); + } + this._objects.length = 0; + } + this._clock.advanceTime(passedTime); + if (this._events.length > 0) { + for (var i = 0; i < this._events.length; ++i) { + var eventObject = this._events[i]; + var armature = eventObject.armature; + if (armature._armatureData !== null) { + armature.eventDispatcher.dispatchDBEvent(eventObject.type, eventObject); + if (eventObject.type === dragonBones.EventObject.SOUND_EVENT) { + this._eventManager.dispatchDBEvent(eventObject.type, eventObject); + } + } + this.bufferObject(eventObject); + } + this._events.length = 0; + } + }; + DragonBones.prototype.bufferEvent = function (value) { + if (this._events.indexOf(value) < 0) { + this._events.push(value); + } + }; + DragonBones.prototype.bufferObject = function (object) { + if (this._objects.indexOf(object) < 0) { + this._objects.push(object); + } + }; + Object.defineProperty(DragonBones.prototype, "clock", { + get: function () { + return this._clock; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragonBones.prototype, "eventManager", { + get: function () { + return this._eventManager; + }, + enumerable: true, + configurable: true + }); + DragonBones.VERSION = "5.7.000"; + DragonBones.yDown = true; + DragonBones.debug = false; + DragonBones.debugDraw = false; + return DragonBones; + }()); + dragonBones.DragonBones = DragonBones; +})(dragonBones || (dragonBones = {})); +// +if (!console.warn) { + console.warn = function () { }; +} +if (!console.assert) { + console.assert = function () { }; +} +// +if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; +} +// Weixin can not support typescript extends. +var __extends = function (t, e) { + function r() { + this.constructor = t; + } + for (var i in e) { + if (e.hasOwnProperty(i)) { + t[i] = e[i]; + } + } + r.prototype = e.prototype, t.prototype = new r(); +}; +// +if (typeof global === "undefined" && typeof window !== "undefined") { + var global = window; +} +if (typeof exports === "object" && typeof module === "object") { + module.exports = dragonBones; +} +else if (typeof define === "function" && define["amd"]) { + define(["dragonBones"], function () { return dragonBones; }); +} +else if (typeof exports === "object") { + exports = dragonBones; +} +else if (typeof global !== "undefined") { + global.dragonBones = dragonBones; +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The BaseObject is the base class for all objects in the DragonBones framework. + * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 基础对象,通常 DragonBones 的对象都继承自该类。 + * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。 + * @version DragonBones 4.5 + * @language zh_CN + */ + var BaseObject = (function () { + function BaseObject() { + /** + * - A unique identification number assigned to the object. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分配给此实例的唯一标识号。 + * @version DragonBones 4.5 + * @language zh_CN + */ + this.hashCode = BaseObject._hashCode++; + this._isInPool = false; + } + BaseObject._returnObject = function (object) { + var classType = String(object.constructor); + var maxCount = classType in BaseObject._maxCountMap ? BaseObject._maxCountMap[classType] : BaseObject._defaultMaxCount; + var pool = BaseObject._poolsMap[classType] = BaseObject._poolsMap[classType] || []; + if (pool.length < maxCount) { + if (!object._isInPool) { + object._isInPool = true; + pool.push(object); + } + else { + console.warn("The object is already in the pool."); + } + } + else { + } + }; + BaseObject.toString = function () { + throw new Error(); + }; + /** + * - Set the maximum cache count of the specify object pool. + * @param objectConstructor - The specify class. (Set all object pools max cache count if not set) + * @param maxCount - Max count. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 设置特定对象池的最大缓存数量。 + * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量) + * @param maxCount - 最大缓存数量。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.setMaxCount = function (objectConstructor, maxCount) { + if (maxCount < 0 || maxCount !== maxCount) { + maxCount = 0; + } + if (objectConstructor !== null) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > maxCount) { + pool.length = maxCount; + } + BaseObject._maxCountMap[classType] = maxCount; + } + else { + BaseObject._defaultMaxCount = maxCount; + for (var classType in BaseObject._poolsMap) { + var pool = BaseObject._poolsMap[classType]; + if (pool.length > maxCount) { + pool.length = maxCount; + } + if (classType in BaseObject._maxCountMap) { + BaseObject._maxCountMap[classType] = maxCount; + } + } + } + }; + /** + * - Clear the cached instances of a specify object pool. + * @param objectConstructor - Specify class. (Clear all cached instances if not set) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除特定对象池的缓存实例。 + * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例) + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.clearPool = function (objectConstructor) { + if (objectConstructor === void 0) { objectConstructor = null; } + if (objectConstructor !== null) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > 0) { + pool.length = 0; + } + } + else { + for (var k in BaseObject._poolsMap) { + var pool = BaseObject._poolsMap[k]; + pool.length = 0; + } + } + }; + /** + * - Get an instance of the specify class from object pool. + * @param objectConstructor - The specify class. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从对象池中获取特定类的实例。 + * @param objectConstructor - 特定的类。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.borrowObject = function (objectConstructor) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > 0) { + var object_1 = pool.pop(); + object_1._isInPool = false; + return object_1; + } + var object = new objectConstructor(); + object._onClear(); + return object; + }; + /** + * - Clear the object and return it back to object pool。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除该实例的所有数据并将其返还对象池。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.prototype.returnToPool = function () { + this._onClear(); + BaseObject._returnObject(this); + }; + BaseObject._hashCode = 0; + BaseObject._defaultMaxCount = 3000; + BaseObject._maxCountMap = {}; + BaseObject._poolsMap = {}; + return BaseObject; + }()); + dragonBones.BaseObject = BaseObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - 2D Transform matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 转换矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Matrix = (function () { + /** + * @private + */ + function Matrix(a, b, c, d, tx, ty) { + if (a === void 0) { a = 1.0; } + if (b === void 0) { b = 0.0; } + if (c === void 0) { c = 0.0; } + if (d === void 0) { d = 1.0; } + if (tx === void 0) { tx = 0.0; } + if (ty === void 0) { ty = 0.0; } + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.tx = tx; + this.ty = ty; + } + Matrix.prototype.toString = function () { + return "[object dragonBones.Matrix] a:" + this.a + " b:" + this.b + " c:" + this.c + " d:" + this.d + " tx:" + this.tx + " ty:" + this.ty; + }; + /** + * @private + */ + Matrix.prototype.copyFrom = function (value) { + this.a = value.a; + this.b = value.b; + this.c = value.c; + this.d = value.d; + this.tx = value.tx; + this.ty = value.ty; + return this; + }; + /** + * @private + */ + Matrix.prototype.copyFromArray = function (value, offset) { + if (offset === void 0) { offset = 0; } + this.a = value[offset]; + this.b = value[offset + 1]; + this.c = value[offset + 2]; + this.d = value[offset + 3]; + this.tx = value[offset + 4]; + this.ty = value[offset + 5]; + return this; + }; + /** + * - Convert to unit matrix. + * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为单位矩阵。 + * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.identity = function () { + this.a = this.d = 1.0; + this.b = this.c = 0.0; + this.tx = this.ty = 0.0; + return this; + }; + /** + * - Multiplies the current matrix with another matrix. + * @param value - The matrix that needs to be multiplied. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将当前矩阵与另一个矩阵相乘。 + * @param value - 需要相乘的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.concat = function (value) { + var aA = this.a * value.a; + var bA = 0.0; + var cA = 0.0; + var dA = this.d * value.d; + var txA = this.tx * value.a + value.tx; + var tyA = this.ty * value.d + value.ty; + if (this.b !== 0.0 || this.c !== 0.0) { + aA += this.b * value.c; + bA += this.b * value.d; + cA += this.c * value.a; + dA += this.c * value.b; + } + if (value.b !== 0.0 || value.c !== 0.0) { + bA += this.a * value.b; + cA += this.d * value.c; + txA += this.ty * value.c; + tyA += this.tx * value.b; + } + this.a = aA; + this.b = bA; + this.c = cA; + this.d = dA; + this.tx = txA; + this.ty = tyA; + return this; + }; + /** + * - Convert to inverse matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为逆矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.invert = function () { + var aA = this.a; + var bA = this.b; + var cA = this.c; + var dA = this.d; + var txA = this.tx; + var tyA = this.ty; + if (bA === 0.0 && cA === 0.0) { + this.b = this.c = 0.0; + if (aA === 0.0 || dA === 0.0) { + this.a = this.b = this.tx = this.ty = 0.0; + } + else { + aA = this.a = 1.0 / aA; + dA = this.d = 1.0 / dA; + this.tx = -aA * txA; + this.ty = -dA * tyA; + } + return this; + } + var determinant = aA * dA - bA * cA; + if (determinant === 0.0) { + this.a = this.d = 1.0; + this.b = this.c = 0.0; + this.tx = this.ty = 0.0; + return this; + } + determinant = 1.0 / determinant; + var k = this.a = dA * determinant; + bA = this.b = -bA * determinant; + cA = this.c = -cA * determinant; + dA = this.d = aA * determinant; + this.tx = -(k * txA + cA * tyA); + this.ty = -(bA * txA + dA * tyA); + return this; + }; + /** + * - Apply a matrix transformation to a specific point. + * @param x - X coordinate. + * @param y - Y coordinate. + * @param result - The point after the transformation is applied. + * @param delta - Whether to ignore tx, ty's conversion to point. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将矩阵转换应用于特定点。 + * @param x - 横坐标。 + * @param y - 纵坐标。 + * @param result - 应用转换之后的点。 + * @param delta - 是否忽略 tx,ty 对点的转换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.transformPoint = function (x, y, result, delta) { + if (delta === void 0) { delta = false; } + result.x = this.a * x + this.c * y; + result.y = this.b * x + this.d * y; + if (!delta) { + result.x += this.tx; + result.y += this.ty; + } + }; + /** + * @private + */ + Matrix.prototype.transformRectangle = function (rectangle, delta) { + if (delta === void 0) { delta = false; } + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + var tx = delta ? 0.0 : this.tx; + var ty = delta ? 0.0 : this.ty; + var x = rectangle.x; + var y = rectangle.y; + var xMax = x + rectangle.width; + var yMax = y + rectangle.height; + var x0 = a * x + c * y + tx; + var y0 = b * x + d * y + ty; + var x1 = a * xMax + c * y + tx; + var y1 = b * xMax + d * y + ty; + var x2 = a * xMax + c * yMax + tx; + var y2 = b * xMax + d * yMax + ty; + var x3 = a * x + c * yMax + tx; + var y3 = b * x + d * yMax + ty; + var tmp = 0.0; + if (x0 > x1) { + tmp = x0; + x0 = x1; + x1 = tmp; + } + if (x2 > x3) { + tmp = x2; + x2 = x3; + x3 = tmp; + } + rectangle.x = Math.floor(x0 < x2 ? x0 : x2); + rectangle.width = Math.ceil((x1 > x3 ? x1 : x3) - rectangle.x); + if (y0 > y1) { + tmp = y0; + y0 = y1; + y1 = tmp; + } + if (y2 > y3) { + tmp = y2; + y2 = y3; + y3 = tmp; + } + rectangle.y = Math.floor(y0 < y2 ? y0 : y2); + rectangle.height = Math.ceil((y1 > y3 ? y1 : y3) - rectangle.y); + }; + return Matrix; + }()); + dragonBones.Matrix = Matrix; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - 2D Transform. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 变换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Transform = (function () { + /** + * @private + */ + function Transform(x, y, skew, rotation, scaleX, scaleY) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (skew === void 0) { skew = 0.0; } + if (rotation === void 0) { rotation = 0.0; } + if (scaleX === void 0) { scaleX = 1.0; } + if (scaleY === void 0) { scaleY = 1.0; } + this.x = x; + this.y = y; + this.skew = skew; + this.rotation = rotation; + this.scaleX = scaleX; + this.scaleY = scaleY; + } + /** + * @private + */ + Transform.normalizeRadian = function (value) { + value = (value + Math.PI) % (Math.PI * 2.0); + value += value > 0.0 ? -Math.PI : Math.PI; + return value; + }; + Transform.prototype.toString = function () { + return "[object dragonBones.Transform] x:" + this.x + " y:" + this.y + " skewX:" + this.skew * 180.0 / Math.PI + " skewY:" + this.rotation * 180.0 / Math.PI + " scaleX:" + this.scaleX + " scaleY:" + this.scaleY; + }; + /** + * @private + */ + Transform.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + this.skew = value.skew; + this.rotation = value.rotation; + this.scaleX = value.scaleX; + this.scaleY = value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.identity = function () { + this.x = this.y = 0.0; + this.skew = this.rotation = 0.0; + this.scaleX = this.scaleY = 1.0; + return this; + }; + /** + * @private + */ + Transform.prototype.add = function (value) { + this.x += value.x; + this.y += value.y; + this.skew += value.skew; + this.rotation += value.rotation; + this.scaleX *= value.scaleX; + this.scaleY *= value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.minus = function (value) { + this.x -= value.x; + this.y -= value.y; + this.skew -= value.skew; + this.rotation -= value.rotation; + this.scaleX /= value.scaleX; + this.scaleY /= value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.fromMatrix = function (matrix) { + var backupScaleX = this.scaleX, backupScaleY = this.scaleY; + var PI_Q = Transform.PI_Q; + this.x = matrix.tx; + this.y = matrix.ty; + this.rotation = Math.atan(matrix.b / matrix.a); + var skewX = Math.atan(-matrix.c / matrix.d); + this.scaleX = (this.rotation > -PI_Q && this.rotation < PI_Q) ? matrix.a / Math.cos(this.rotation) : matrix.b / Math.sin(this.rotation); + this.scaleY = (skewX > -PI_Q && skewX < PI_Q) ? matrix.d / Math.cos(skewX) : -matrix.c / Math.sin(skewX); + if (backupScaleX >= 0.0 && this.scaleX < 0.0) { + this.scaleX = -this.scaleX; + this.rotation = this.rotation - Math.PI; + } + if (backupScaleY >= 0.0 && this.scaleY < 0.0) { + this.scaleY = -this.scaleY; + skewX = skewX - Math.PI; + } + this.skew = skewX - this.rotation; + return this; + }; + /** + * @private + */ + Transform.prototype.toMatrix = function (matrix) { + if (this.rotation === 0.0) { + matrix.a = 1.0; + matrix.b = 0.0; + } + else { + matrix.a = Math.cos(this.rotation); + matrix.b = Math.sin(this.rotation); + } + if (this.skew === 0.0) { + matrix.c = -matrix.b; + matrix.d = matrix.a; + } + else { + matrix.c = -Math.sin(this.skew + this.rotation); + matrix.d = Math.cos(this.skew + this.rotation); + } + if (this.scaleX !== 1.0) { + matrix.a *= this.scaleX; + matrix.b *= this.scaleX; + } + if (this.scaleY !== 1.0) { + matrix.c *= this.scaleY; + matrix.d *= this.scaleY; + } + matrix.tx = this.x; + matrix.ty = this.y; + return this; + }; + /** + * @private + */ + Transform.PI = Math.PI; + /** + * @private + */ + Transform.PI_D = Math.PI * 2.0; + /** + * @private + */ + Transform.PI_H = Math.PI / 2.0; + /** + * @private + */ + Transform.PI_Q = Math.PI / 4.0; + /** + * @private + */ + Transform.RAD_DEG = 180.0 / Math.PI; + /** + * @private + */ + Transform.DEG_RAD = Math.PI / 180.0; + return Transform; + }()); + dragonBones.Transform = Transform; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ColorTransform = (function () { + function ColorTransform(alphaMultiplier, redMultiplier, greenMultiplier, blueMultiplier, alphaOffset, redOffset, greenOffset, blueOffset) { + if (alphaMultiplier === void 0) { alphaMultiplier = 1.0; } + if (redMultiplier === void 0) { redMultiplier = 1.0; } + if (greenMultiplier === void 0) { greenMultiplier = 1.0; } + if (blueMultiplier === void 0) { blueMultiplier = 1.0; } + if (alphaOffset === void 0) { alphaOffset = 0; } + if (redOffset === void 0) { redOffset = 0; } + if (greenOffset === void 0) { greenOffset = 0; } + if (blueOffset === void 0) { blueOffset = 0; } + this.alphaMultiplier = alphaMultiplier; + this.redMultiplier = redMultiplier; + this.greenMultiplier = greenMultiplier; + this.blueMultiplier = blueMultiplier; + this.alphaOffset = alphaOffset; + this.redOffset = redOffset; + this.greenOffset = greenOffset; + this.blueOffset = blueOffset; + } + ColorTransform.prototype.copyFrom = function (value) { + this.alphaMultiplier = value.alphaMultiplier; + this.redMultiplier = value.redMultiplier; + this.greenMultiplier = value.greenMultiplier; + this.blueMultiplier = value.blueMultiplier; + this.alphaOffset = value.alphaOffset; + this.redOffset = value.redOffset; + this.greenOffset = value.greenOffset; + this.blueOffset = value.blueOffset; + }; + ColorTransform.prototype.identity = function () { + this.alphaMultiplier = this.redMultiplier = this.greenMultiplier = this.blueMultiplier = 1.0; + this.alphaOffset = this.redOffset = this.greenOffset = this.blueOffset = 0; + }; + return ColorTransform; + }()); + dragonBones.ColorTransform = ColorTransform; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The Point object represents a location in a two-dimensional coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Point 对象表示二维坐标系统中的某个位置。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Point = (function () { + /** + * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @param x - The horizontal coordinate. + * @param y - The vertical coordinate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。 + * @param x - 该对象的x属性值,默认为 0.0。 + * @param y - 该对象的y属性值,默认为 0.0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + function Point(x, y) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + this.x = x; + this.y = y; + } + /** + * @private + */ + Point.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + }; + /** + * @private + */ + Point.prototype.clear = function () { + this.x = this.y = 0.0; + }; + return Point; + }()); + dragonBones.Point = Point; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its + * width and its height.
+ * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of + * one property has no effect on the others. However, the right and bottom properties are integrally related to those + * four properties. For example, if you change the value of the right property, the value of the width property changes; + * if you change the bottom property, the value of the height property changes. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
+ * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 + * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width + * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Rectangle = (function () { + /** + * @private + */ + function Rectangle(x, y, width, height) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (width === void 0) { width = 0.0; } + if (height === void 0) { height = 0.0; } + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + /** + * @private + */ + Rectangle.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + this.width = value.width; + this.height = value.height; + }; + /** + * @private + */ + Rectangle.prototype.clear = function () { + this.x = this.y = 0.0; + this.width = this.height = 0.0; + }; + return Rectangle; + }()); + dragonBones.Rectangle = Rectangle; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The user custom data. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 用户自定义数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + var UserData = (function (_super) { + __extends(UserData, _super); + function UserData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - The custom int numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.ints = []; + /** + * - The custom float numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.floats = []; + /** + * - The custom strings. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.strings = []; + return _this; + } + UserData.toString = function () { + return "[class dragonBones.UserData]"; + }; + UserData.prototype._onClear = function () { + this.ints.length = 0; + this.floats.length = 0; + this.strings.length = 0; + }; + /** + * @internal + */ + UserData.prototype.addInt = function (value) { + this.ints.push(value); + }; + /** + * @internal + */ + UserData.prototype.addFloat = function (value) { + this.floats.push(value); + }; + /** + * @internal + */ + UserData.prototype.addString = function (value) { + this.strings.push(value); + }; + /** + * - Get the custom int number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getInt = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.ints.length ? this.ints[index] : 0; + }; + /** + * - Get the custom float number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getFloat = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.floats.length ? this.floats[index] : 0.0; + }; + /** + * - Get the custom string. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getString = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.strings.length ? this.strings[index] : ""; + }; + return UserData; + }(dragonBones.BaseObject)); + dragonBones.UserData = UserData; + /** + * @private + */ + var ActionData = (function (_super) { + __extends(ActionData, _super); + function ActionData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.data = null; // + return _this; + } + ActionData.toString = function () { + return "[class dragonBones.ActionData]"; + }; + ActionData.prototype._onClear = function () { + if (this.data !== null) { + this.data.returnToPool(); + } + this.type = 0 /* Play */; + this.name = ""; + this.bone = null; + this.slot = null; + this.data = null; + }; + return ActionData; + }(dragonBones.BaseObject)); + dragonBones.ActionData = ActionData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The DragonBones data. + * A DragonBones data contains multiple armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据。 + * 一个龙骨数据包含多个骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + var DragonBonesData = (function (_super) { + __extends(DragonBonesData, _super); + function DragonBonesData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @internal + */ + _this.frameIndices = []; + /** + * @internal + */ + _this.cachedFrames = []; + /** + * - All armature data names. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.armatureNames = []; + /** + * @private + */ + _this.armatures = {}; + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + DragonBonesData.toString = function () { + return "[class dragonBones.DragonBonesData]"; + }; + DragonBonesData.prototype._onClear = function () { + for (var k in this.armatures) { + this.armatures[k].returnToPool(); + delete this.armatures[k]; + } + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.autoSearch = false; + this.frameRate = 0; + this.version = ""; + this.name = ""; + this.stage = null; + this.frameIndices.length = 0; + this.cachedFrames.length = 0; + this.armatureNames.length = 0; + //this.armatures.clear(); + this.binary = null; // + this.intArray = null; // + this.floatArray = null; // + this.frameIntArray = null; // + this.frameFloatArray = null; // + this.frameArray = null; // + this.timelineArray = null; // + this.colorArray = null; // + this.userData = null; + }; + /** + * @internal + */ + DragonBonesData.prototype.addArmature = function (value) { + if (value.name in this.armatures) { + console.warn("Same armature: " + value.name); + return; + } + value.parent = this; + this.armatures[value.name] = value; + this.armatureNames.push(value.name); + }; + /** + * - Get a specific armature data. + * @param armatureName - The armature data name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param armatureName - 骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + DragonBonesData.prototype.getArmature = function (armatureName) { + return armatureName in this.armatures ? this.armatures[armatureName] : null; + }; + return DragonBonesData; + }(dragonBones.BaseObject)); + dragonBones.DragonBonesData = DragonBonesData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The armature data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var ArmatureData = (function (_super) { + __extends(ArmatureData, _super); + function ArmatureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.aabb = new dragonBones.Rectangle(); + /** + * - The names of all the animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的动画数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.animationNames = []; + /** + * @private + */ + _this.sortedBones = []; + /** + * @private + */ + _this.sortedSlots = []; + /** + * @private + */ + _this.defaultActions = []; + /** + * @private + */ + _this.actions = []; + /** + * @private + */ + _this.bones = {}; + /** + * @private + */ + _this.slots = {}; + /** + * @private + */ + _this.constraints = {}; + /** + * @private + */ + _this.skins = {}; + /** + * @private + */ + _this.animations = {}; + /** + * @private + */ + _this.canvas = null; // Initial value. + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + ArmatureData.toString = function () { + return "[class dragonBones.ArmatureData]"; + }; + ArmatureData.prototype._onClear = function () { + for (var _i = 0, _a = this.defaultActions; _i < _a.length; _i++) { + var action = _a[_i]; + action.returnToPool(); + } + for (var _b = 0, _c = this.actions; _b < _c.length; _b++) { + var action = _c[_b]; + action.returnToPool(); + } + for (var k in this.bones) { + this.bones[k].returnToPool(); + delete this.bones[k]; + } + for (var k in this.slots) { + this.slots[k].returnToPool(); + delete this.slots[k]; + } + for (var k in this.constraints) { + this.constraints[k].returnToPool(); + delete this.constraints[k]; + } + for (var k in this.skins) { + this.skins[k].returnToPool(); + delete this.skins[k]; + } + for (var k in this.animations) { + this.animations[k].returnToPool(); + delete this.animations[k]; + } + if (this.canvas !== null) { + this.canvas.returnToPool(); + } + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.type = 0 /* Armature */; + this.frameRate = 0; + this.cacheFrameRate = 0; + this.scale = 1.0; + this.name = ""; + this.aabb.clear(); + this.animationNames.length = 0; + this.sortedBones.length = 0; + this.sortedSlots.length = 0; + this.defaultActions.length = 0; + this.actions.length = 0; + // this.bones.clear(); + // this.slots.clear(); + // this.constraints.clear(); + // this.skins.clear(); + // this.animations.clear(); + this.defaultSkin = null; + this.defaultAnimation = null; + this.canvas = null; + this.userData = null; + this.parent = null; // + }; + /** + * @internal + */ + ArmatureData.prototype.sortBones = function () { + var total = this.sortedBones.length; + if (total <= 0) { + return; + } + var sortHelper = this.sortedBones.concat(); + var index = 0; + var count = 0; + this.sortedBones.length = 0; + while (count < total) { + var bone = sortHelper[index++]; + if (index >= total) { + index = 0; + } + if (this.sortedBones.indexOf(bone) >= 0) { + continue; + } + var flag = false; + for (var k in this.constraints) { + var constraint = this.constraints[k]; + if (constraint.root === bone && this.sortedBones.indexOf(constraint.target) < 0) { + flag = true; + break; + } + } + if (flag) { + continue; + } + if (bone.parent !== null && this.sortedBones.indexOf(bone.parent) < 0) { + continue; + } + this.sortedBones.push(bone); + count++; + } + }; + /** + * @internal + */ + ArmatureData.prototype.cacheFrames = function (frameRate) { + if (this.cacheFrameRate > 0) { + return; + } + this.cacheFrameRate = frameRate; + for (var k in this.animations) { + this.animations[k].cacheFrames(this.cacheFrameRate); + } + }; + /** + * @internal + */ + ArmatureData.prototype.setCacheFrame = function (globalTransformMatrix, transform) { + var dataArray = this.parent.cachedFrames; + var arrayOffset = dataArray.length; + dataArray.length += 10; + dataArray[arrayOffset] = globalTransformMatrix.a; + dataArray[arrayOffset + 1] = globalTransformMatrix.b; + dataArray[arrayOffset + 2] = globalTransformMatrix.c; + dataArray[arrayOffset + 3] = globalTransformMatrix.d; + dataArray[arrayOffset + 4] = globalTransformMatrix.tx; + dataArray[arrayOffset + 5] = globalTransformMatrix.ty; + dataArray[arrayOffset + 6] = transform.rotation; + dataArray[arrayOffset + 7] = transform.skew; + dataArray[arrayOffset + 8] = transform.scaleX; + dataArray[arrayOffset + 9] = transform.scaleY; + return arrayOffset; + }; + /** + * @internal + */ + ArmatureData.prototype.getCacheFrame = function (globalTransformMatrix, transform, arrayOffset) { + var dataArray = this.parent.cachedFrames; + globalTransformMatrix.a = dataArray[arrayOffset]; + globalTransformMatrix.b = dataArray[arrayOffset + 1]; + globalTransformMatrix.c = dataArray[arrayOffset + 2]; + globalTransformMatrix.d = dataArray[arrayOffset + 3]; + globalTransformMatrix.tx = dataArray[arrayOffset + 4]; + globalTransformMatrix.ty = dataArray[arrayOffset + 5]; + transform.rotation = dataArray[arrayOffset + 6]; + transform.skew = dataArray[arrayOffset + 7]; + transform.scaleX = dataArray[arrayOffset + 8]; + transform.scaleY = dataArray[arrayOffset + 9]; + transform.x = globalTransformMatrix.tx; + transform.y = globalTransformMatrix.ty; + }; + /** + * @internal + */ + ArmatureData.prototype.addBone = function (value) { + if (value.name in this.bones) { + console.warn("Same bone: " + value.name); + return; + } + this.bones[value.name] = value; + this.sortedBones.push(value); + }; + /** + * @internal + */ + ArmatureData.prototype.addSlot = function (value) { + if (value.name in this.slots) { + console.warn("Same slot: " + value.name); + return; + } + this.slots[value.name] = value; + this.sortedSlots.push(value); + }; + /** + * @internal + */ + ArmatureData.prototype.addConstraint = function (value) { + if (value.name in this.constraints) { + console.warn("Same constraint: " + value.name); + return; + } + this.constraints[value.name] = value; + }; + /** + * @internal + */ + ArmatureData.prototype.addSkin = function (value) { + if (value.name in this.skins) { + console.warn("Same skin: " + value.name); + return; + } + value.parent = this; + this.skins[value.name] = value; + if (this.defaultSkin === null) { + this.defaultSkin = value; + } + if (value.name === "default") { + this.defaultSkin = value; + } + }; + /** + * @internal + */ + ArmatureData.prototype.addAnimation = function (value) { + if (value.name in this.animations) { + console.warn("Same animation: " + value.name); + return; + } + value.parent = this; + this.animations[value.name] = value; + this.animationNames.push(value.name); + if (this.defaultAnimation === null) { + this.defaultAnimation = value; + } + }; + /** + * @internal + */ + ArmatureData.prototype.addAction = function (value, isDefault) { + if (isDefault) { + this.defaultActions.push(value); + } + else { + this.actions.push(value); + } + }; + /** + * - Get a specific done data. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼数据。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getBone = function (boneName) { + return boneName in this.bones ? this.bones[boneName] : null; + }; + /** + * - Get a specific slot data. + * @param slotName - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽数据。 + * @param slotName - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getSlot = function (slotName) { + return slotName in this.slots ? this.slots[slotName] : null; + }; + /** + * @private + */ + ArmatureData.prototype.getConstraint = function (constraintName) { + return constraintName in this.constraints ? this.constraints[constraintName] : null; + }; + /** + * - Get a specific skin data. + * @param skinName - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定皮肤数据。 + * @param skinName - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getSkin = function (skinName) { + return skinName in this.skins ? this.skins[skinName] : null; + }; + /** + * @private + */ + ArmatureData.prototype.getMesh = function (skinName, slotName, meshName) { + var skin = this.getSkin(skinName); + if (skin === null) { + return null; + } + return skin.getDisplay(slotName, meshName); + }; + /** + * - Get a specific animation data. + * @param animationName - The animation animationName. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的动画数据。 + * @param animationName - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getAnimation = function (animationName) { + return animationName in this.animations ? this.animations[animationName] : null; + }; + return ArmatureData; + }(dragonBones.BaseObject)); + dragonBones.ArmatureData = ArmatureData; + /** + * - The bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var BoneData = (function (_super) { + __extends(BoneData, _super); + function BoneData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.transform = new dragonBones.Transform(); + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + BoneData.toString = function () { + return "[class dragonBones.BoneData]"; + }; + BoneData.prototype._onClear = function () { + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.inheritTranslation = false; + this.inheritRotation = false; + this.inheritScale = false; + this.inheritReflection = false; + this.type = 0 /* Bone */; + this.length = 0.0; + this.alpha = 1.0; + this.name = ""; + this.transform.identity(); + this.userData = null; + this.parent = null; + }; + return BoneData; + }(dragonBones.BaseObject)); + dragonBones.BoneData = BoneData; + /** + * @internal + */ + var SurfaceData = (function (_super) { + __extends(SurfaceData, _super); + function SurfaceData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new dragonBones.GeometryData(); + return _this; + } + SurfaceData.toString = function () { + return "[class dragonBones.SurfaceData]"; + }; + SurfaceData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 1 /* Surface */; + this.segmentX = 0; + this.segmentY = 0; + this.geometry.clear(); + }; + return SurfaceData; + }(BoneData)); + dragonBones.SurfaceData = SurfaceData; + /** + * - The slot data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var SlotData = (function (_super) { + __extends(SlotData, _super); + function SlotData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.color = null; // Initial value. + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + /** + * @internal + */ + SlotData.createColor = function () { + return new dragonBones.ColorTransform(); + }; + SlotData.toString = function () { + return "[class dragonBones.SlotData]"; + }; + SlotData.prototype._onClear = function () { + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.blendMode = 0 /* Normal */; + this.displayIndex = 0; + this.zOrder = 0; + this.zIndex = 0; + this.alpha = 1.0; + this.name = ""; + this.color = null; // + this.userData = null; + this.parent = null; // + }; + /** + * @internal + */ + SlotData.DEFAULT_COLOR = new dragonBones.ColorTransform(); + return SlotData; + }(dragonBones.BaseObject)); + dragonBones.SlotData = SlotData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var CanvasData = (function (_super) { + __extends(CanvasData, _super); + function CanvasData() { + return _super !== null && _super.apply(this, arguments) || this; + } + CanvasData.toString = function () { + return "[class dragonBones.CanvasData]"; + }; + CanvasData.prototype._onClear = function () { + this.hasBackground = false; + this.color = 0x000000; + this.x = 0; + this.y = 0; + this.width = 0; + this.height = 0; + }; + return CanvasData; + }(dragonBones.BaseObject)); + dragonBones.CanvasData = CanvasData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The skin data, typically a armature data instance contains at least one skinData. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var SkinData = (function (_super) { + __extends(SkinData, _super); + function SkinData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.displays = {}; + return _this; + } + SkinData.toString = function () { + return "[class dragonBones.SkinData]"; + }; + SkinData.prototype._onClear = function () { + for (var k in this.displays) { + var slotDisplays = this.displays[k]; + for (var _i = 0, slotDisplays_1 = slotDisplays; _i < slotDisplays_1.length; _i++) { + var display = slotDisplays_1[_i]; + if (display !== null) { + display.returnToPool(); + } + } + delete this.displays[k]; + } + this.name = ""; + // this.displays.clear(); + this.parent = null; // + }; + /** + * @internal + */ + SkinData.prototype.addDisplay = function (slotName, value) { + if (!(slotName in this.displays)) { + this.displays[slotName] = []; + } + if (value !== null) { + value.parent = this; + } + var slotDisplays = this.displays[slotName]; // TODO clear prev + slotDisplays.push(value); + }; + /** + * @private + */ + SkinData.prototype.getDisplay = function (slotName, displayName) { + var slotDisplays = this.getDisplays(slotName); + if (slotDisplays !== null) { + for (var _i = 0, slotDisplays_2 = slotDisplays; _i < slotDisplays_2.length; _i++) { + var display = slotDisplays_2[_i]; + if (display !== null && display.name === displayName) { + return display; + } + } + } + return null; + }; + /** + * @private + */ + SkinData.prototype.getDisplays = function (slotName) { + if (!(slotName in this.displays)) { + return null; + } + return this.displays[slotName]; + }; + return SkinData; + }(dragonBones.BaseObject)); + dragonBones.SkinData = SkinData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ConstraintData = (function (_super) { + __extends(ConstraintData, _super); + function ConstraintData() { + return _super !== null && _super.apply(this, arguments) || this; + } + ConstraintData.prototype._onClear = function () { + this.order = 0; + this.name = ""; + this.type = 0 /* IK */; + this.target = null; // + this.root = null; // + this.bone = null; + }; + return ConstraintData; + }(dragonBones.BaseObject)); + dragonBones.ConstraintData = ConstraintData; + /** + * @internal + */ + var IKConstraintData = (function (_super) { + __extends(IKConstraintData, _super); + function IKConstraintData() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraintData.toString = function () { + return "[class dragonBones.IKConstraintData]"; + }; + IKConstraintData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.scaleEnabled = false; + this.bendPositive = false; + this.weight = 1.0; + }; + return IKConstraintData; + }(ConstraintData)); + dragonBones.IKConstraintData = IKConstraintData; + /** + * @internal + */ + var PathConstraintData = (function (_super) { + __extends(PathConstraintData, _super); + function PathConstraintData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.bones = []; + return _this; + } + PathConstraintData.toString = function () { + return "[class dragonBones.PathConstraintData]"; + }; + PathConstraintData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.pathSlot = null; + this.pathDisplayData = null; + this.bones.length = 0; + this.positionMode = 0 /* Fixed */; + this.spacingMode = 1 /* Fixed */; + this.rotateMode = 1 /* Chain */; + this.position = 0.0; + this.spacing = 0.0; + this.rotateOffset = 0.0; + this.rotateMix = 0.0; + this.translateMix = 0.0; + }; + PathConstraintData.prototype.AddBone = function (value) { + this.bones.push(value); + }; + return PathConstraintData; + }(ConstraintData)); + dragonBones.PathConstraintData = PathConstraintData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var GeometryData = (function () { + function GeometryData() { + this.weight = null; // Initial value. + } + GeometryData.prototype.clear = function () { + if (!this.isShared && this.weight !== null) { + this.weight.returnToPool(); + } + this.isShared = false; + this.inheritDeform = false; + this.offset = 0; + this.data = null; + this.weight = null; + }; + GeometryData.prototype.shareFrom = function (value) { + this.isShared = true; + this.offset = value.offset; + this.weight = value.weight; + }; + Object.defineProperty(GeometryData.prototype, "vertexCount", { + get: function () { + var intArray = this.data.intArray; + return intArray[this.offset + 0 /* GeometryVertexCount */]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GeometryData.prototype, "triangleCount", { + get: function () { + var intArray = this.data.intArray; + return intArray[this.offset + 1 /* GeometryTriangleCount */]; + }, + enumerable: true, + configurable: true + }); + return GeometryData; + }()); + dragonBones.GeometryData = GeometryData; + /** + * @private + */ + var DisplayData = (function (_super) { + __extends(DisplayData, _super); + function DisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.transform = new dragonBones.Transform(); + return _this; + } + DisplayData.prototype._onClear = function () { + this.name = ""; + this.path = ""; + this.transform.identity(); + this.parent = null; // + }; + return DisplayData; + }(dragonBones.BaseObject)); + dragonBones.DisplayData = DisplayData; + /** + * @private + */ + var ImageDisplayData = (function (_super) { + __extends(ImageDisplayData, _super); + function ImageDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.pivot = new dragonBones.Point(); + return _this; + } + ImageDisplayData.toString = function () { + return "[class dragonBones.ImageDisplayData]"; + }; + ImageDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 0 /* Image */; + this.pivot.clear(); + this.texture = null; + }; + return ImageDisplayData; + }(DisplayData)); + dragonBones.ImageDisplayData = ImageDisplayData; + /** + * @private + */ + var ArmatureDisplayData = (function (_super) { + __extends(ArmatureDisplayData, _super); + function ArmatureDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.actions = []; + return _this; + } + ArmatureDisplayData.toString = function () { + return "[class dragonBones.ArmatureDisplayData]"; + }; + ArmatureDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + for (var _i = 0, _a = this.actions; _i < _a.length; _i++) { + var action = _a[_i]; + action.returnToPool(); + } + this.type = 1 /* Armature */; + this.inheritAnimation = false; + this.actions.length = 0; + this.armature = null; + }; + /** + * @private + */ + ArmatureDisplayData.prototype.addAction = function (value) { + this.actions.push(value); + }; + return ArmatureDisplayData; + }(DisplayData)); + dragonBones.ArmatureDisplayData = ArmatureDisplayData; + /** + * @private + */ + var MeshDisplayData = (function (_super) { + __extends(MeshDisplayData, _super); + function MeshDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new GeometryData(); + return _this; + } + MeshDisplayData.toString = function () { + return "[class dragonBones.MeshDisplayData]"; + }; + MeshDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 2 /* Mesh */; + this.geometry.clear(); + this.texture = null; + }; + return MeshDisplayData; + }(DisplayData)); + dragonBones.MeshDisplayData = MeshDisplayData; + /** + * @private + */ + var BoundingBoxDisplayData = (function (_super) { + __extends(BoundingBoxDisplayData, _super); + function BoundingBoxDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.boundingBox = null; // Initial value. + return _this; + } + BoundingBoxDisplayData.toString = function () { + return "[class dragonBones.BoundingBoxDisplayData]"; + }; + BoundingBoxDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this.boundingBox !== null) { + this.boundingBox.returnToPool(); + } + this.type = 3 /* BoundingBox */; + this.boundingBox = null; + }; + return BoundingBoxDisplayData; + }(DisplayData)); + dragonBones.BoundingBoxDisplayData = BoundingBoxDisplayData; + /** + * @private + */ + var PathDisplayData = (function (_super) { + __extends(PathDisplayData, _super); + function PathDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new GeometryData(); + _this.curveLengths = []; + return _this; + } + PathDisplayData.toString = function () { + return "[class dragonBones.PathDisplayData]"; + }; + PathDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 4 /* Path */; + this.closed = false; + this.constantSpeed = false; + this.geometry.clear(); + this.curveLengths.length = 0; + }; + return PathDisplayData; + }(DisplayData)); + dragonBones.PathDisplayData = PathDisplayData; + /** + * @private + */ + var WeightData = (function (_super) { + __extends(WeightData, _super); + function WeightData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.bones = []; + return _this; + } + WeightData.toString = function () { + return "[class dragonBones.WeightData]"; + }; + WeightData.prototype._onClear = function () { + this.count = 0; + this.offset = 0; + this.bones.length = 0; + }; + WeightData.prototype.addBone = function (value) { + this.bones.push(value); + }; + return WeightData; + }(dragonBones.BaseObject)); + dragonBones.WeightData = WeightData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The base class of bounding box data. + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框数据基类。 + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language zh_CN + */ + var BoundingBoxData = (function (_super) { + __extends(BoundingBoxData, _super); + function BoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoundingBoxData.prototype._onClear = function () { + this.color = 0x000000; + this.width = 0.0; + this.height = 0.0; + }; + return BoundingBoxData; + }(dragonBones.BaseObject)); + dragonBones.BoundingBoxData = BoundingBoxData; + /** + * - The rectangle bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 矩形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var RectangleBoundingBoxData = (function (_super) { + __extends(RectangleBoundingBoxData, _super); + function RectangleBoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + RectangleBoundingBoxData.toString = function () { + return "[class dragonBones.RectangleBoundingBoxData]"; + }; + /** + * - Compute the bit code for a point (x, y) using the clip rectangle + */ + RectangleBoundingBoxData._computeOutCode = function (x, y, xMin, yMin, xMax, yMax) { + var code = 0 /* InSide */; // initialised as being inside of [[clip window]] + if (x < xMin) { + code |= 1 /* Left */; + } + else if (x > xMax) { + code |= 2 /* Right */; + } + if (y < yMin) { + code |= 4 /* Top */; + } + else if (y > yMax) { + code |= 8 /* Bottom */; + } + return code; + }; + /** + * @private + */ + RectangleBoundingBoxData.rectangleIntersectsSegment = function (xA, yA, xB, yB, xMin, yMin, xMax, yMax, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var inSideA = xA > xMin && xA < xMax && yA > yMin && yA < yMax; + var inSideB = xB > xMin && xB < xMax && yB > yMin && yB < yMax; + if (inSideA && inSideB) { + return -1; + } + var intersectionCount = 0; + var outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax); + var outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax); + while (true) { + if ((outcode0 | outcode1) === 0) { + intersectionCount = 2; + break; + } + else if ((outcode0 & outcode1) !== 0) { + break; + } + // failed both tests, so calculate the line segment to clip + // from an outside point to an intersection with clip edge + var x = 0.0; + var y = 0.0; + var normalRadian = 0.0; + // At least one endpoint is outside the clip rectangle; pick it. + var outcodeOut = outcode0 !== 0 ? outcode0 : outcode1; + // Now find the intersection point; + if ((outcodeOut & 4 /* Top */) !== 0) { + x = xA + (xB - xA) * (yMin - yA) / (yB - yA); + y = yMin; + if (normalRadians !== null) { + normalRadian = -Math.PI * 0.5; + } + } + else if ((outcodeOut & 8 /* Bottom */) !== 0) { + x = xA + (xB - xA) * (yMax - yA) / (yB - yA); + y = yMax; + if (normalRadians !== null) { + normalRadian = Math.PI * 0.5; + } + } + else if ((outcodeOut & 2 /* Right */) !== 0) { + y = yA + (yB - yA) * (xMax - xA) / (xB - xA); + x = xMax; + if (normalRadians !== null) { + normalRadian = 0; + } + } + else if ((outcodeOut & 1 /* Left */) !== 0) { + y = yA + (yB - yA) * (xMin - xA) / (xB - xA); + x = xMin; + if (normalRadians !== null) { + normalRadian = Math.PI; + } + } + // Now we move outside point to intersection point to clip + // and get ready for next pass. + if (outcodeOut === outcode0) { + xA = x; + yA = y; + outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax); + if (normalRadians !== null) { + normalRadians.x = normalRadian; + } + } + else { + xB = x; + yB = y; + outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax); + if (normalRadians !== null) { + normalRadians.y = normalRadian; + } + } + } + if (intersectionCount) { + if (inSideA) { + intersectionCount = 2; // 10 + if (intersectionPointA !== null) { + intersectionPointA.x = xB; + intersectionPointA.y = yB; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = xB; + } + if (normalRadians !== null) { + normalRadians.x = normalRadians.y + Math.PI; + } + } + else if (inSideB) { + intersectionCount = 1; // 01 + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA; + intersectionPointB.y = yA; + } + if (normalRadians !== null) { + normalRadians.y = normalRadians.x + Math.PI; + } + } + else { + intersectionCount = 3; // 11 + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = yB; + } + } + } + return intersectionCount; + }; + RectangleBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 0 /* Rectangle */; + }; + /** + * @inheritDoc + */ + RectangleBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var widthH = this.width * 0.5; + if (pX >= -widthH && pX <= widthH) { + var heightH = this.height * 0.5; + if (pY >= -heightH && pY <= heightH) { + return true; + } + } + return false; + }; + /** + * @inheritDoc + */ + RectangleBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var widthH = this.width * 0.5; + var heightH = this.height * 0.5; + var intersectionCount = RectangleBoundingBoxData.rectangleIntersectsSegment(xA, yA, xB, yB, -widthH, -heightH, widthH, heightH, intersectionPointA, intersectionPointB, normalRadians); + return intersectionCount; + }; + return RectangleBoundingBoxData; + }(BoundingBoxData)); + dragonBones.RectangleBoundingBoxData = RectangleBoundingBoxData; + /** + * - The ellipse bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 椭圆边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var EllipseBoundingBoxData = (function (_super) { + __extends(EllipseBoundingBoxData, _super); + function EllipseBoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + EllipseBoundingBoxData.toString = function () { + return "[class dragonBones.EllipseData]"; + }; + /** + * @private + */ + EllipseBoundingBoxData.ellipseIntersectsSegment = function (xA, yA, xB, yB, xC, yC, widthH, heightH, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var d = widthH / heightH; + var dd = d * d; + yA *= d; + yB *= d; + var dX = xB - xA; + var dY = yB - yA; + var lAB = Math.sqrt(dX * dX + dY * dY); + var xD = dX / lAB; + var yD = dY / lAB; + var a = (xC - xA) * xD + (yC - yA) * yD; + var aa = a * a; + var ee = xA * xA + yA * yA; + var rr = widthH * widthH; + var dR = rr - ee + aa; + var intersectionCount = 0; + if (dR >= 0.0) { + var dT = Math.sqrt(dR); + var sA = a - dT; + var sB = a + dT; + var inSideA = sA < 0.0 ? -1 : (sA <= lAB ? 0 : 1); + var inSideB = sB < 0.0 ? -1 : (sB <= lAB ? 0 : 1); + var sideAB = inSideA * inSideB; + if (sideAB < 0) { + return -1; + } + else if (sideAB === 0) { + if (inSideA === -1) { + intersectionCount = 2; // 10 + xB = xA + sB * xD; + yB = (yA + sB * yD) / d; + if (intersectionPointA !== null) { + intersectionPointA.x = xB; + intersectionPointA.y = yB; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = yB; + } + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yB / rr * dd, xB / rr); + normalRadians.y = normalRadians.x + Math.PI; + } + } + else if (inSideB === 1) { + intersectionCount = 1; // 01 + xA = xA + sA * xD; + yA = (yA + sA * yD) / d; + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA; + intersectionPointB.y = yA; + } + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yA / rr * dd, xA / rr); + normalRadians.y = normalRadians.x + Math.PI; + } + } + else { + intersectionCount = 3; // 11 + if (intersectionPointA !== null) { + intersectionPointA.x = xA + sA * xD; + intersectionPointA.y = (yA + sA * yD) / d; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(intersectionPointA.y / rr * dd, intersectionPointA.x / rr); + } + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA + sB * xD; + intersectionPointB.y = (yA + sB * yD) / d; + if (normalRadians !== null) { + normalRadians.y = Math.atan2(intersectionPointB.y / rr * dd, intersectionPointB.x / rr); + } + } + } + } + } + return intersectionCount; + }; + EllipseBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 1 /* Ellipse */; + }; + /** + * @inheritDoc + */ + EllipseBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var widthH = this.width * 0.5; + if (pX >= -widthH && pX <= widthH) { + var heightH = this.height * 0.5; + if (pY >= -heightH && pY <= heightH) { + pY *= widthH / heightH; + return Math.sqrt(pX * pX + pY * pY) <= widthH; + } + } + return false; + }; + /** + * @inheritDoc + */ + EllipseBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var intersectionCount = EllipseBoundingBoxData.ellipseIntersectsSegment(xA, yA, xB, yB, 0.0, 0.0, this.width * 0.5, this.height * 0.5, intersectionPointA, intersectionPointB, normalRadians); + return intersectionCount; + }; + return EllipseBoundingBoxData; + }(BoundingBoxData)); + dragonBones.EllipseBoundingBoxData = EllipseBoundingBoxData; + /** + * - The polygon bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var PolygonBoundingBoxData = (function (_super) { + __extends(PolygonBoundingBoxData, _super); + function PolygonBoundingBoxData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - The polygon vertices. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形顶点。 + * @version DragonBones 5.1 + * @language zh_CN + */ + _this.vertices = []; + return _this; + } + PolygonBoundingBoxData.toString = function () { + return "[class dragonBones.PolygonBoundingBoxData]"; + }; + /** + * @private + */ + PolygonBoundingBoxData.polygonIntersectsSegment = function (xA, yA, xB, yB, vertices, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + if (xA === xB) { + xA = xB + 0.000001; + } + if (yA === yB) { + yA = yB + 0.000001; + } + var count = vertices.length; + var dXAB = xA - xB; + var dYAB = yA - yB; + var llAB = xA * yB - yA * xB; + var intersectionCount = 0; + var xC = vertices[count - 2]; + var yC = vertices[count - 1]; + var dMin = 0.0; + var dMax = 0.0; + var xMin = 0.0; + var yMin = 0.0; + var xMax = 0.0; + var yMax = 0.0; + for (var i = 0; i < count; i += 2) { + var xD = vertices[i]; + var yD = vertices[i + 1]; + if (xC === xD) { + xC = xD + 0.0001; + } + if (yC === yD) { + yC = yD + 0.0001; + } + var dXCD = xC - xD; + var dYCD = yC - yD; + var llCD = xC * yD - yC * xD; + var ll = dXAB * dYCD - dYAB * dXCD; + var x = (llAB * dXCD - dXAB * llCD) / ll; + if (((x >= xC && x <= xD) || (x >= xD && x <= xC)) && (dXAB === 0.0 || (x >= xA && x <= xB) || (x >= xB && x <= xA))) { + var y = (llAB * dYCD - dYAB * llCD) / ll; + if (((y >= yC && y <= yD) || (y >= yD && y <= yC)) && (dYAB === 0.0 || (y >= yA && y <= yB) || (y >= yB && y <= yA))) { + if (intersectionPointB !== null) { + var d = x - xA; + if (d < 0.0) { + d = -d; + } + if (intersectionCount === 0) { + dMin = d; + dMax = d; + xMin = x; + yMin = y; + xMax = x; + yMax = y; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + normalRadians.y = normalRadians.x; + } + } + else { + if (d < dMin) { + dMin = d; + xMin = x; + yMin = y; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + } + } + if (d > dMax) { + dMax = d; + xMax = x; + yMax = y; + if (normalRadians !== null) { + normalRadians.y = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + } + } + } + intersectionCount++; + } + else { + xMin = x; + yMin = y; + xMax = x; + yMax = y; + intersectionCount++; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + normalRadians.y = normalRadians.x; + } + break; + } + } + } + xC = xD; + yC = yD; + } + if (intersectionCount === 1) { + if (intersectionPointA !== null) { + intersectionPointA.x = xMin; + intersectionPointA.y = yMin; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xMin; + intersectionPointB.y = yMin; + } + if (normalRadians !== null) { + normalRadians.y = normalRadians.x + Math.PI; + } + } + else if (intersectionCount > 1) { + intersectionCount++; + if (intersectionPointA !== null) { + intersectionPointA.x = xMin; + intersectionPointA.y = yMin; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xMax; + intersectionPointB.y = yMax; + } + } + return intersectionCount; + }; + PolygonBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 2 /* Polygon */; + this.x = 0.0; + this.y = 0.0; + this.vertices.length = 0; + }; + /** + * @inheritDoc + */ + PolygonBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var isInSide = false; + if (pX >= this.x && pX <= this.width && pY >= this.y && pY <= this.height) { + for (var i = 0, l = this.vertices.length, iP = l - 2; i < l; i += 2) { + var yA = this.vertices[iP + 1]; + var yB = this.vertices[i + 1]; + if ((yB < pY && yA >= pY) || (yA < pY && yB >= pY)) { + var xA = this.vertices[iP]; + var xB = this.vertices[i]; + if ((pY - yB) * (xA - xB) / (yA - yB) + xB < pX) { + isInSide = !isInSide; + } + } + iP = i; + } + } + return isInSide; + }; + /** + * @inheritDoc + */ + PolygonBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var intersectionCount = 0; + if (RectangleBoundingBoxData.rectangleIntersectsSegment(xA, yA, xB, yB, this.x, this.y, this.x + this.width, this.y + this.height, null, null, null) !== 0) { + intersectionCount = PolygonBoundingBoxData.polygonIntersectsSegment(xA, yA, xB, yB, this.vertices, intersectionPointA, intersectionPointB, normalRadians); + } + return intersectionCount; + }; + return PolygonBoundingBoxData; + }(BoundingBoxData)); + dragonBones.PolygonBoundingBoxData = PolygonBoundingBoxData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var AnimationData = (function (_super) { + __extends(AnimationData, _super); + function AnimationData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.cachedFrames = []; + /** + * @private + */ + _this.boneTimelines = {}; + /** + * @private + */ + _this.slotTimelines = {}; + /** + * @private + */ + _this.constraintTimelines = {}; + /** + * @private + */ + _this.animationTimelines = {}; + /** + * @private + */ + _this.boneCachedFrameIndices = {}; + /** + * @private + */ + _this.slotCachedFrameIndices = {}; + /** + * @private + */ + _this.actionTimeline = null; // Initial value. + /** + * @private + */ + _this.zOrderTimeline = null; // Initial value. + return _this; + } + AnimationData.toString = function () { + return "[class dragonBones.AnimationData]"; + }; + AnimationData.prototype._onClear = function () { + for (var k in this.boneTimelines) { + for (var _i = 0, _a = this.boneTimelines[k]; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.returnToPool(); + } + delete this.boneTimelines[k]; + } + for (var k in this.slotTimelines) { + for (var _b = 0, _c = this.slotTimelines[k]; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.returnToPool(); + } + delete this.slotTimelines[k]; + } + for (var k in this.constraintTimelines) { + for (var _d = 0, _e = this.constraintTimelines[k]; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.returnToPool(); + } + delete this.constraintTimelines[k]; + } + for (var k in this.animationTimelines) { + for (var _f = 0, _g = this.animationTimelines[k]; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.returnToPool(); + } + delete this.animationTimelines[k]; + } + for (var k in this.boneCachedFrameIndices) { + delete this.boneCachedFrameIndices[k]; + } + for (var k in this.slotCachedFrameIndices) { + delete this.slotCachedFrameIndices[k]; + } + if (this.actionTimeline !== null) { + this.actionTimeline.returnToPool(); + } + if (this.zOrderTimeline !== null) { + this.zOrderTimeline.returnToPool(); + } + this.frameIntOffset = 0; + this.frameFloatOffset = 0; + this.frameOffset = 0; + this.blendType = 0 /* None */; + this.frameCount = 0; + this.playTimes = 0; + this.duration = 0.0; + this.scale = 1.0; + this.fadeInTime = 0.0; + this.cacheFrameRate = 0.0; + this.name = ""; + this.cachedFrames.length = 0; + // this.boneTimelines.clear(); + // this.slotTimelines.clear(); + // this.constraintTimelines.clear(); + // this.animationTimelines.clear(); + // this.boneCachedFrameIndices.clear(); + // this.slotCachedFrameIndices.clear(); + this.actionTimeline = null; + this.zOrderTimeline = null; + this.parent = null; // + }; + /** + * @internal + */ + AnimationData.prototype.cacheFrames = function (frameRate) { + if (this.cacheFrameRate > 0.0) { + return; + } + this.cacheFrameRate = Math.max(Math.ceil(frameRate * this.scale), 1.0); + var cacheFrameCount = Math.ceil(this.cacheFrameRate * this.duration) + 1; // Cache one more frame. + this.cachedFrames.length = cacheFrameCount; + for (var i = 0, l = this.cacheFrames.length; i < l; ++i) { + this.cachedFrames[i] = false; + } + for (var _i = 0, _a = this.parent.sortedBones; _i < _a.length; _i++) { + var bone = _a[_i]; + var indices = new Array(cacheFrameCount); + for (var i = 0, l = indices.length; i < l; ++i) { + indices[i] = -1; + } + this.boneCachedFrameIndices[bone.name] = indices; + } + for (var _b = 0, _c = this.parent.sortedSlots; _b < _c.length; _b++) { + var slot = _c[_b]; + var indices = new Array(cacheFrameCount); + for (var i = 0, l = indices.length; i < l; ++i) { + indices[i] = -1; + } + this.slotCachedFrameIndices[slot.name] = indices; + } + }; + /** + * @private + */ + AnimationData.prototype.addBoneTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : (this.boneTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addSlotTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : (this.slotTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addConstraintTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : (this.constraintTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addAnimationTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.animationTimelines ? this.animationTimelines[timelineName] : (this.animationTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.getBoneTimelines = function (timelineName) { + return timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getSlotTimelines = function (timelineName) { + return timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getConstraintTimelines = function (timelineName) { + return timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getAnimationTimelines = function (timelineName) { + return timelineName in this.animationTimelines ? this.animationTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getBoneCachedFrameIndices = function (boneName) { + return boneName in this.boneCachedFrameIndices ? this.boneCachedFrameIndices[boneName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getSlotCachedFrameIndices = function (slotName) { + return slotName in this.slotCachedFrameIndices ? this.slotCachedFrameIndices[slotName] : null; + }; + return AnimationData; + }(dragonBones.BaseObject)); + dragonBones.AnimationData = AnimationData; + /** + * @private + */ + var TimelineData = (function (_super) { + __extends(TimelineData, _super); + function TimelineData() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimelineData.toString = function () { + return "[class dragonBones.TimelineData]"; + }; + TimelineData.prototype._onClear = function () { + this.type = 10 /* BoneAll */; + this.offset = 0; + this.frameIndicesOffset = -1; + }; + return TimelineData; + }(dragonBones.BaseObject)); + dragonBones.TimelineData = TimelineData; + /** + * @internal + */ + var AnimationTimelineData = (function (_super) { + __extends(AnimationTimelineData, _super); + function AnimationTimelineData() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationTimelineData.toString = function () { + return "[class dragonBones.AnimationTimelineData]"; + }; + AnimationTimelineData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.x = 0.0; + this.y = 0.0; + }; + return AnimationTimelineData; + }(TimelineData)); + dragonBones.AnimationTimelineData = AnimationTimelineData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation config is used to describe all the information needed to play an animation state. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画配置用来描述播放一个动画状态所需要的全部信息。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + var AnimationConfig = (function (_super) { + __extends(AnimationConfig, _super); + function AnimationConfig() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.boneMask = []; + return _this; + } + AnimationConfig.toString = function () { + return "[class dragonBones.AnimationConfig]"; + }; + AnimationConfig.prototype._onClear = function () { + this.pauseFadeOut = true; + this.fadeOutMode = 4 /* All */; + this.fadeOutTweenType = 1 /* Line */; + this.fadeOutTime = -1.0; + this.actionEnabled = true; + this.additive = false; + this.displayControl = true; + this.pauseFadeIn = true; + this.resetToPose = true; + this.fadeInTweenType = 1 /* Line */; + this.playTimes = -1; + this.layer = 0; + this.position = 0.0; + this.duration = -1.0; + this.timeScale = -100.0; + this.weight = 1.0; + this.fadeInTime = -1.0; + this.autoFadeOutTime = -1.0; + this.name = ""; + this.animation = ""; + this.group = ""; + this.boneMask.length = 0; + }; + /** + * @private + */ + AnimationConfig.prototype.clear = function () { + this._onClear(); + }; + /** + * @private + */ + AnimationConfig.prototype.copyFrom = function (value) { + this.pauseFadeOut = value.pauseFadeOut; + this.fadeOutMode = value.fadeOutMode; + this.autoFadeOutTime = value.autoFadeOutTime; + this.fadeOutTweenType = value.fadeOutTweenType; + this.actionEnabled = value.actionEnabled; + this.additive = value.additive; + this.displayControl = value.displayControl; + this.pauseFadeIn = value.pauseFadeIn; + this.resetToPose = value.resetToPose; + this.playTimes = value.playTimes; + this.layer = value.layer; + this.position = value.position; + this.duration = value.duration; + this.timeScale = value.timeScale; + this.fadeInTime = value.fadeInTime; + this.fadeOutTime = value.fadeOutTime; + this.fadeInTweenType = value.fadeInTweenType; + this.weight = value.weight; + this.name = value.name; + this.animation = value.animation; + this.group = value.group; + this.boneMask.length = value.boneMask.length; + for (var i = 0, l = this.boneMask.length; i < l; ++i) { + this.boneMask[i] = value.boneMask[i]; + } + }; + return AnimationConfig; + }(dragonBones.BaseObject)); + dragonBones.AnimationConfig = AnimationConfig; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var TextureAtlasData = (function (_super) { + __extends(TextureAtlasData, _super); + function TextureAtlasData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.textures = {}; + return _this; + } + TextureAtlasData.prototype._onClear = function () { + for (var k in this.textures) { + this.textures[k].returnToPool(); + delete this.textures[k]; + } + this.autoSearch = false; + this.width = 0; + this.height = 0; + this.scale = 1.0; + // this.textures.clear(); + this.name = ""; + this.imagePath = ""; + }; + /** + * @private + */ + TextureAtlasData.prototype.copyFrom = function (value) { + this.autoSearch = value.autoSearch; + this.scale = value.scale; + this.width = value.width; + this.height = value.height; + this.name = value.name; + this.imagePath = value.imagePath; + for (var k in this.textures) { + this.textures[k].returnToPool(); + delete this.textures[k]; + } + // this.textures.clear(); + for (var k in value.textures) { + var texture = this.createTexture(); + texture.copyFrom(value.textures[k]); + this.textures[k] = texture; + } + }; + /** + * @internal + */ + TextureAtlasData.prototype.addTexture = function (value) { + if (value.name in this.textures) { + console.warn("Same texture: " + value.name); + return; + } + value.parent = this; + this.textures[value.name] = value; + }; + /** + * @private + */ + TextureAtlasData.prototype.getTexture = function (textureName) { + return textureName in this.textures ? this.textures[textureName] : null; + }; + return TextureAtlasData; + }(dragonBones.BaseObject)); + dragonBones.TextureAtlasData = TextureAtlasData; + /** + * @private + */ + var TextureData = (function (_super) { + __extends(TextureData, _super); + function TextureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.region = new dragonBones.Rectangle(); + _this.frame = null; // Initial value. + return _this; + } + TextureData.createRectangle = function () { + return new dragonBones.Rectangle(); + }; + TextureData.prototype._onClear = function () { + this.rotated = false; + this.name = ""; + this.region.clear(); + this.parent = null; // + this.frame = null; + }; + TextureData.prototype.copyFrom = function (value) { + this.rotated = value.rotated; + this.name = value.name; + this.region.copyFrom(value.region); + this.parent = value.parent; + if (this.frame === null && value.frame !== null) { + this.frame = TextureData.createRectangle(); + } + else if (this.frame !== null && value.frame === null) { + this.frame = null; + } + if (this.frame !== null && value.frame !== null) { + this.frame.copyFrom(value.frame); + } + }; + return TextureData; + }(dragonBones.BaseObject)); + dragonBones.TextureData = TextureData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones_1) { + /** + * - Armature is the core of the skeleton animation system. + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架是骨骼动画系统的核心。 + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + var Armature = (function (_super) { + __extends(Armature, _super); + function Armature() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._bones = []; + _this._slots = []; + /** + * @internal + */ + _this._constraints = []; + _this._actions = []; + _this._animation = null; // Initial value. + _this._proxy = null; // Initial value. + /** + * @internal + */ + _this._replaceTextureAtlasData = null; // Initial value. + _this._clock = null; // Initial value. + return _this; + } + Armature.toString = function () { + return "[class dragonBones.Armature]"; + }; + Armature._onSortSlots = function (a, b) { + return a._zIndex * 1000 + a._zOrder > b._zIndex * 1000 + b._zOrder ? 1 : -1; + }; + Armature.prototype._onClear = function () { + if (this._clock !== null) { + this._clock.remove(this); + } + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + bone.returnToPool(); + } + for (var _b = 0, _c = this._slots; _b < _c.length; _b++) { + var slot = _c[_b]; + slot.returnToPool(); + } + for (var _d = 0, _e = this._constraints; _d < _e.length; _d++) { + var constraint = _e[_d]; + constraint.returnToPool(); + } + for (var _f = 0, _g = this._actions; _f < _g.length; _f++) { + var action = _g[_f]; + action.returnToPool(); + } + if (this._animation !== null) { + this._animation.returnToPool(); + } + if (this._proxy !== null) { + this._proxy.dbClear(); + } + if (this._replaceTextureAtlasData !== null) { + this._replaceTextureAtlasData.returnToPool(); + } + this.inheritAnimation = true; + this.userData = null; + this._lockUpdate = false; + this._slotsDirty = true; + this._zOrderDirty = false; + this._zIndexDirty = false; + this._alphaDirty = true; + this._flipX = false; + this._flipY = false; + this._cacheFrameIndex = -1; + this._alpha = 1.0; + this._globalAlpha = 1.0; + this._bones.length = 0; + this._slots.length = 0; + this._constraints.length = 0; + this._actions.length = 0; + this._armatureData = null; // + this._animation = null; // + this._proxy = null; // + this._display = null; + this._replaceTextureAtlasData = null; + this._replacedTexture = null; + this._dragonBones = null; // + this._clock = null; + this._parent = null; + }; + /** + * @internal + */ + Armature.prototype._sortZOrder = function (slotIndices, offset) { + var slotDatas = this._armatureData.sortedSlots; + var isOriginal = slotIndices === null; + if (this._zOrderDirty || !isOriginal) { + for (var i = 0, l = slotDatas.length; i < l; ++i) { + var slotIndex = isOriginal ? i : slotIndices[offset + i]; + if (slotIndex < 0 || slotIndex >= l) { + continue; + } + var slotData = slotDatas[slotIndex]; + var slot = this.getSlot(slotData.name); + if (slot !== null) { + slot._setZOrder(i); + } + } + this._slotsDirty = true; + this._zOrderDirty = !isOriginal; + } + }; + /** + * @internal + */ + Armature.prototype._addBone = function (value) { + if (this._bones.indexOf(value) < 0) { + this._bones.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._addSlot = function (value) { + if (this._slots.indexOf(value) < 0) { + this._slots.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._addConstraint = function (value) { + if (this._constraints.indexOf(value) < 0) { + this._constraints.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._bufferAction = function (action, append) { + if (this._actions.indexOf(action) < 0) { + if (append) { + this._actions.push(action); + } + else { + this._actions.unshift(action); + } + } + }; + /** + * - Dispose the armature. (Return to the object pool) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 释放骨架。 (回收到对象池) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.dispose = function () { + if (this._armatureData !== null) { + this._lockUpdate = true; + this._dragonBones.bufferObject(this); + } + }; + /** + * @internal + */ + Armature.prototype.init = function (armatureData, proxy, display, dragonBones) { + if (this._armatureData !== null) { + return; + } + this._armatureData = armatureData; + this._animation = dragonBones_1.BaseObject.borrowObject(dragonBones_1.Animation); + this._proxy = proxy; + this._display = display; + this._dragonBones = dragonBones; + this._proxy.dbInit(this); + this._animation.init(this); + this._animation.animations = this._armatureData.animations; + }; + /** + * @inheritDoc + */ + Armature.prototype.advanceTime = function (passedTime) { + if (this._lockUpdate) { + return; + } + this._lockUpdate = true; + if (this._armatureData === null) { + console.warn("The armature has been disposed."); + return; + } + else if (this._armatureData.parent === null) { + console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear()."); + return; + } + var prevCacheFrameIndex = this._cacheFrameIndex; + // Update animation. + this._animation.advanceTime(passedTime); + // Sort slots. + if (this._slotsDirty || this._zIndexDirty) { + this._slots.sort(Armature._onSortSlots); + if (this._zIndexDirty) { + for (var i = 0, l = this._slots.length; i < l; ++i) { + this._slots[i]._setZOrder(i); // + } + } + this._slotsDirty = false; + this._zIndexDirty = false; + } + // Update alpha. + if (this._alphaDirty) { + this._alphaDirty = false; + this._globalAlpha = this._alpha * (this._parent !== null ? this._parent._globalAlpha : 1.0); + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + bone._updateAlpha(); + } + for (var _b = 0, _c = this._slots; _b < _c.length; _b++) { + var slot = _c[_b]; + slot._updateAlpha(); + } + } + // Update bones and slots. + if (this._cacheFrameIndex < 0 || this._cacheFrameIndex !== prevCacheFrameIndex) { + var i = 0, l = 0; + for (i = 0, l = this._bones.length; i < l; ++i) { + this._bones[i].update(this._cacheFrameIndex); + } + for (i = 0, l = this._slots.length; i < l; ++i) { + this._slots[i].update(this._cacheFrameIndex); + } + } + // Do actions. + if (this._actions.length > 0) { + for (var _d = 0, _e = this._actions; _d < _e.length; _d++) { + var action = _e[_d]; + var actionData = action.actionData; + if (actionData !== null) { + if (actionData.type === 0 /* Play */) { + if (action.slot !== null) { + var childArmature = action.slot.childArmature; + if (childArmature !== null) { + childArmature.animation.fadeIn(actionData.name); + } + } + else if (action.bone !== null) { + for (var _f = 0, _g = this.getSlots(); _f < _g.length; _f++) { + var slot = _g[_f]; + if (slot.parent === action.bone) { + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.animation.fadeIn(actionData.name); + } + } + } + } + else { + this._animation.fadeIn(actionData.name); + } + } + } + action.returnToPool(); + } + this._actions.length = 0; + } + this._lockUpdate = false; + this._proxy.dbUpdate(); + }; + /** + * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. + * @param boneName - The bone name. (If not set, all bones will be update) + * @param updateSlot - Whether to update the bone's slots. (Default: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 + * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) + * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.invalidUpdate = function (boneName, updateSlot) { + if (boneName === void 0) { boneName = null; } + if (updateSlot === void 0) { updateSlot = false; } + if (boneName !== null && boneName.length > 0) { + var bone = this.getBone(boneName); + if (bone !== null) { + bone.invalidUpdate(); + if (updateSlot) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.parent === bone) { + slot.invalidUpdate(); + } + } + } + } + } + else { + for (var _b = 0, _c = this._bones; _b < _c.length; _b++) { + var bone = _c[_b]; + bone.invalidUpdate(); + } + if (updateSlot) { + for (var _d = 0, _e = this._slots; _d < _e.length; _d++) { + var slot = _e[_d]; + slot.invalidUpdate(); + } + } + } + }; + /** + * - Check whether a specific point is inside a custom bounding box in a slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在某个插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Armature.prototype.containsPoint = function (x, y) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.containsPoint(x, y)) { + return slot; + } + } + return null; + }; + /** + * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Armature.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var isV = xA === xB; + var dMin = 0.0; + var dMax = 0.0; + var intXA = 0.0; + var intYA = 0.0; + var intXB = 0.0; + var intYB = 0.0; + var intAN = 0.0; + var intBN = 0.0; + var intSlotA = null; + var intSlotB = null; + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var intersectionCount = slot.intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); + if (intersectionCount > 0) { + if (intersectionPointA !== null || intersectionPointB !== null) { + if (intersectionPointA !== null) { + var d = isV ? intersectionPointA.y - yA : intersectionPointA.x - xA; + if (d < 0.0) { + d = -d; + } + if (intSlotA === null || d < dMin) { + dMin = d; + intXA = intersectionPointA.x; + intYA = intersectionPointA.y; + intSlotA = slot; + if (normalRadians) { + intAN = normalRadians.x; + } + } + } + if (intersectionPointB !== null) { + var d = intersectionPointB.x - xA; + if (d < 0.0) { + d = -d; + } + if (intSlotB === null || d > dMax) { + dMax = d; + intXB = intersectionPointB.x; + intYB = intersectionPointB.y; + intSlotB = slot; + if (normalRadians !== null) { + intBN = normalRadians.y; + } + } + } + } + else { + intSlotA = slot; + break; + } + } + } + if (intSlotA !== null && intersectionPointA !== null) { + intersectionPointA.x = intXA; + intersectionPointA.y = intYA; + if (normalRadians !== null) { + normalRadians.x = intAN; + } + } + if (intSlotB !== null && intersectionPointB !== null) { + intersectionPointB.x = intXB; + intersectionPointB.y = intYB; + if (normalRadians !== null) { + normalRadians.y = intBN; + } + } + return intSlotA; + }; + /** + * - Get a specific bone. + * @param name - The bone name. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼。 + * @param name - 骨骼名称。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBone = function (name) { + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + if (bone.name === name) { + return bone; + } + } + return null; + }; + /** + * - Get a specific bone by the display. + * @param display - The display object. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的骨骼。 + * @param display - 显示对象。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBoneByDisplay = function (display) { + var slot = this.getSlotByDisplay(display); + return slot !== null ? slot.parent : null; + }; + /** + * - Get a specific slot. + * @param name - The slot name. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽。 + * @param name - 插槽名称。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlot = function (name) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.name === name) { + return slot; + } + } + return null; + }; + /** + * - Get a specific slot by the display. + * @param display - The display object. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的插槽。 + * @param display - 显示对象。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlotByDisplay = function (display) { + if (display !== null) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.display === display) { + return slot; + } + } + } + return null; + }; + /** + * - Get all bones. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBones = function () { + return this._bones; + }; + /** + * - Get all slots. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的插槽。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlots = function () { + return this._slots; + }; + Object.defineProperty(Armature.prototype, "flipX", { + /** + * - Whether to flip the armature horizontally. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架水平翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + get: function () { + return this._flipX; + }, + set: function (value) { + if (this._flipX === value) { + return; + } + this._flipX = value; + this.invalidUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "flipY", { + /** + * - Whether to flip the armature vertically. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架垂直翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + get: function () { + return this._flipY; + }, + set: function (value) { + if (this._flipY === value) { + return; + } + this._flipY = value; + this.invalidUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "cacheFrameRate", { + /** + * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. + * There is a certain amount of memory overhead to improve performance by caching animation data in memory. + * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. + * When the animation cache is turned on, some features will fail, such as the offset property of bone. + * @example + *
+             *     armature.cacheFrameRate = 24;
+             * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 + * @example + *
+             *     armature.cacheFrameRate = 24;
+             * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._armatureData.cacheFrameRate; + }, + set: function (value) { + if (this._armatureData.cacheFrameRate !== value) { + this._armatureData.cacheFrames(value); + // Set child armature frameRate. + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.cacheFrameRate = value; + } + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "name", { + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._armatureData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "armatureData", { + /** + * - The armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._armatureData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "animation", { + /** + * - The animation player. + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._animation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "proxy", { + /** + * @pivate + */ + get: function () { + return this._proxy; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "eventDispatcher", { + /** + * - The EventDispatcher instance of the armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架的 EventDispatcher 实例。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._proxy; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "display", { + /** + * - The display container. + * The display of the slot is displayed as the parent. + * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 显示容器实例。 + * 插槽的显示对象都会以此显示容器为父级。 + * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._display; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "replacedTexture", { + /** + * @private + */ + get: function () { + return this._replacedTexture; + }, + set: function (value) { + if (this._replacedTexture === value) { + return; + } + if (this._replaceTextureAtlasData !== null) { + this._replaceTextureAtlasData.returnToPool(); + this._replaceTextureAtlasData = null; + } + this._replacedTexture = value; + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + slot.invalidUpdate(); + slot.update(-1); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "clock", { + /** + * @inheritDoc + */ + get: function () { + return this._clock; + }, + set: function (value) { + if (this._clock === value) { + return; + } + if (this._clock !== null) { + this._clock.remove(this); + } + this._clock = value; + if (this._clock) { + this._clock.add(this); + } + // Update childArmature clock. + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.clock = this._clock; + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "parent", { + /** + * - Get the parent slot which the armature belongs to. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架所属的父插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Armature.prototype.getDisplay = function () { + return this._display; + }; + return Armature; + }(dragonBones_1.BaseObject)); + dragonBones_1.Armature = Armature; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The base class of the transform object. + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 变换对象的基类。 + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language zh_CN + */ + var TransformObject = (function (_super) { + __extends(TransformObject, _super); + function TransformObject() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - A matrix relative to the armature coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.globalTransformMatrix = new dragonBones.Matrix(); + /** + * - A transform relative to the armature coordinate system. + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的变换。 + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.global = new dragonBones.Transform(); + /** + * - The offset transform relative to the armature or the parent bone coordinate system. + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架或父骨骼坐标系的偏移变换。 + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.offset = new dragonBones.Transform(); + return _this; + } + /** + */ + TransformObject.prototype._onClear = function () { + this.globalTransformMatrix.identity(); + this.global.identity(); + this.offset.identity(); + this.origin = null; + this.userData = null; + this._globalDirty = false; + this._alpha = 1.0; + this._globalAlpha = 1.0; + this._armature = null; // + }; + /** + * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, + * some engines do not rely on these attributes to update rendering, such as Egret. + * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 + * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + TransformObject.prototype.updateGlobalTransform = function () { + if (this._globalDirty) { + this._globalDirty = false; + this.global.fromMatrix(this.globalTransformMatrix); + } + }; + Object.defineProperty(TransformObject.prototype, "armature", { + /** + * - The armature to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的骨架。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._armature; + }, + enumerable: true, + configurable: true + }); + TransformObject._helpMatrix = new dragonBones.Matrix(); + TransformObject._helpTransform = new dragonBones.Transform(); + TransformObject._helpPoint = new dragonBones.Point(); + return TransformObject; + }(dragonBones.BaseObject)); + dragonBones.TransformObject = TransformObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Bone is one of the most important logical units in the armature animation system, + * and is responsible for the realization of translate, rotation, scaling in the animations. + * A armature can contain multiple bones. + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 + * 一个骨架中可以包含多个骨骼。 + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + var Bone = (function (_super) { + __extends(Bone, _super); + function Bone() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @internal + */ + _this.animationPose = new dragonBones.Transform(); + return _this; + } + Bone.toString = function () { + return "[class dragonBones.Bone]"; + }; + Bone.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.offsetMode = 1 /* Additive */; + this.animationPose.identity(); + this._transformDirty = false; + this._childrenTransformDirty = false; + this._localDirty = true; + this._hasConstraint = false; + this._visible = true; + this._cachedFrameIndex = -1; + this._boneData = null; // + this._parent = null; // + this._cachedFrameIndices = null; + }; + Bone.prototype._updateGlobalTransformMatrix = function (isCache) { + // For typescript. + var boneData = this._boneData; + var global = this.global; + var globalTransformMatrix = this.globalTransformMatrix; + var origin = this.origin; + var offset = this.offset; + var animationPose = this.animationPose; + var parent = this._parent; // + var flipX = this._armature.flipX; + var flipY = this._armature.flipY === dragonBones.DragonBones.yDown; + var inherit = parent !== null; + var rotation = 0.0; + if (this.offsetMode === 1 /* Additive */) { + if (origin !== null) { + // global.copyFrom(this.origin).add(this.offset).add(this.animationPose); + global.x = origin.x + offset.x + animationPose.x; + global.scaleX = origin.scaleX * offset.scaleX * animationPose.scaleX; + global.scaleY = origin.scaleY * offset.scaleY * animationPose.scaleY; + if (dragonBones.DragonBones.yDown) { + global.y = origin.y + offset.y + animationPose.y; + global.skew = origin.skew + offset.skew + animationPose.skew; + global.rotation = origin.rotation + offset.rotation + animationPose.rotation; + } + else { + global.y = origin.y - offset.y + animationPose.y; + global.skew = origin.skew - offset.skew + animationPose.skew; + global.rotation = origin.rotation - offset.rotation + animationPose.rotation; + } + } + else { + global.copyFrom(offset); + if (!dragonBones.DragonBones.yDown) { + global.y = -global.y; + global.skew = -global.skew; + global.rotation = -global.rotation; + } + global.add(animationPose); + } + } + else if (this.offsetMode === 0 /* None */) { + if (origin !== null) { + global.copyFrom(origin).add(animationPose); + } + else { + global.copyFrom(animationPose); + } + } + else { + inherit = false; + global.copyFrom(offset); + if (!dragonBones.DragonBones.yDown) { + global.y = -global.y; + global.skew = -global.skew; + global.rotation = -global.rotation; + } + } + if (inherit) { + var isSurface = parent._boneData.type === 1 /* Surface */; + var surfaceBone = isSurface ? parent._bone : null; + var parentMatrix = isSurface ? parent._getGlobalTransformMatrix(global.x, global.y) : parent.globalTransformMatrix; + if (boneData.inheritScale && (!isSurface || surfaceBone !== null)) { + if (isSurface) { + if (boneData.inheritRotation) { + global.rotation += parent.global.rotation; + } + surfaceBone.updateGlobalTransform(); + global.scaleX *= surfaceBone.global.scaleX; + global.scaleY *= surfaceBone.global.scaleY; + parentMatrix.transformPoint(global.x, global.y, global); + global.toMatrix(globalTransformMatrix); + if (boneData.inheritTranslation) { + global.x = globalTransformMatrix.tx; + global.y = globalTransformMatrix.ty; + } + else { + globalTransformMatrix.tx = global.x; + globalTransformMatrix.ty = global.y; + } + } + else { + if (!boneData.inheritRotation) { + parent.updateGlobalTransform(); + if (flipX && flipY) { + rotation = global.rotation - (parent.global.rotation + Math.PI); + } + else if (flipX) { + rotation = global.rotation + parent.global.rotation + Math.PI; + } + else if (flipY) { + rotation = global.rotation + parent.global.rotation; + } + else { + rotation = global.rotation - parent.global.rotation; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + globalTransformMatrix.concat(parentMatrix); + if (boneData.inheritTranslation) { + global.x = globalTransformMatrix.tx; + global.y = globalTransformMatrix.ty; + } + else { + globalTransformMatrix.tx = global.x; + globalTransformMatrix.ty = global.y; + } + if (isCache) { + global.fromMatrix(globalTransformMatrix); + } + else { + this._globalDirty = true; + } + } + } + else { + if (boneData.inheritTranslation) { + var x = global.x; + var y = global.y; + global.x = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + global.y = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + } + else { + if (flipX) { + global.x = -global.x; + } + if (flipY) { + global.y = -global.y; + } + } + if (boneData.inheritRotation) { + parent.updateGlobalTransform(); + if (parent.global.scaleX < 0.0) { + rotation = global.rotation + parent.global.rotation + Math.PI; + } + else { + rotation = global.rotation + parent.global.rotation; + } + if (parentMatrix.a * parentMatrix.d - parentMatrix.b * parentMatrix.c < 0.0) { + rotation -= global.rotation * 2.0; + if (flipX !== flipY || boneData.inheritReflection) { + global.skew += Math.PI; + } + if (!dragonBones.DragonBones.yDown) { + global.skew = -global.skew; + } + } + global.rotation = rotation; + } + else if (flipX || flipY) { + if (flipX && flipY) { + rotation = global.rotation + Math.PI; + } + else { + if (flipX) { + rotation = Math.PI - global.rotation; + } + else { + rotation = -global.rotation; + } + global.skew += Math.PI; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + } + } + else { + if (flipX || flipY) { + if (flipX) { + global.x = -global.x; + } + if (flipY) { + global.y = -global.y; + } + if (flipX && flipY) { + rotation = global.rotation + Math.PI; + } + else { + if (flipX) { + rotation = Math.PI - global.rotation; + } + else { + rotation = -global.rotation; + } + global.skew += Math.PI; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + } + }; + /** + * @internal + */ + Bone.prototype._updateAlpha = function () { + if (this._parent !== null) { + this._globalAlpha = this._alpha * this._parent._globalAlpha; + } + else { + this._globalAlpha = this._alpha * this._armature._globalAlpha; + } + }; + /** + * @internal + */ + Bone.prototype.init = function (boneData, armatureValue) { + if (this._boneData !== null) { + return; + } + this._boneData = boneData; + this._armature = armatureValue; + this._alpha = this._boneData.alpha; + if (this._boneData.parent !== null) { + this._parent = this._armature.getBone(this._boneData.parent.name); + } + this._armature._addBone(this); + // + this.origin = this._boneData.transform; + }; + /** + * @internal + */ + Bone.prototype.update = function (cacheFrameIndex) { + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else { + if (this._hasConstraint) { + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || + (this._parent !== null && this._parent._childrenTransformDirty)) { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + } + else { + if (this._hasConstraint) { + for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) { + var constraint = _c[_b]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + if (this._transformDirty) { + this._transformDirty = false; + this._childrenTransformDirty = true; + // + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + if (this._localDirty) { + this._updateGlobalTransformMatrix(isCache); + } + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + // + } + else if (this._childrenTransformDirty) { + this._childrenTransformDirty = false; + } + this._localDirty = true; + }; + /** + * @internal + */ + Bone.prototype.updateByConstraint = function () { + if (this._localDirty) { + this._localDirty = false; + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { + this._updateGlobalTransformMatrix(true); + } + this._transformDirty = true; + } + }; + /** + * - Forces the bone to update the transform in the next frame. + * When the bone is not animated or its animation state is finished, the bone will not continue to update, + * and when the skeleton must be updated for some reason, the method needs to be called explicitly. + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制骨骼在下一帧更新变换。 + * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Bone.prototype.invalidUpdate = function () { + this._transformDirty = true; + }; + /** + * - Check whether the bone contains a specific bone. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查该骨骼是否包含特定的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Bone.prototype.contains = function (value) { + if (value === this) { + return false; + } + var ancestor = value; + while (ancestor !== this && ancestor !== null) { + ancestor = ancestor.parent; + } + return ancestor === this; + }; + Object.defineProperty(Bone.prototype, "boneData", { + /** + * - The bone data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._boneData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "visible", { + /** + * - The visible of all slots in the bone. + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 此骨骼所有插槽的可见。 + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._visible; + }, + set: function (value) { + if (this._visible === value) { + return; + } + this._visible = value; + for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.parent === this) { + slot._updateVisible(); + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "name", { + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._boneData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "parent", { + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return Bone; + }(dragonBones.TransformObject)); + dragonBones.Bone = Bone; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var Surface = (function (_super) { + __extends(Surface, _super); + function Surface() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._vertices = []; + _this._deformVertices = []; + /** + * - x1, y1, x2, y2, x3, y3, x4, y4, d1X, d1Y, d2X, d2Y + */ + _this._hullCache = []; + /** + * - Inside [flag, a, b, c, d, tx, ty], Outside [flag, a, b, c, d, tx, ty] + */ + _this._matrixCahce = []; + return _this; + } + Surface.toString = function () { + return "[class dragonBones.Surface]"; + }; + Surface.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._dX = 0.0; + this._dY = 0.0; + this._k = 0.0; + this._kX = 0.0; + this._kY = 0.0; + this._vertices.length = 0; + this._deformVertices.length = 0; + this._matrixCahce.length = 0; + this._hullCache.length = 0; + this._bone = null; + }; + Surface.prototype._getAffineTransform = function (x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown) { + var dabX = bX - aX; + var dabY = bY - aY; + var dacX = cX - aX; + var dacY = cY - aY; + transform.rotation = Math.atan2(dabY, dabX); + transform.skew = Math.atan2(dacY, dacX) - Math.PI * 0.5 - transform.rotation; + if (isDown) { + transform.rotation += Math.PI; + } + transform.scaleX = Math.sqrt(dabX * dabX + dabY * dabY) / lX; + transform.scaleY = Math.sqrt(dacX * dacX + dacY * dacY) / lY; + transform.toMatrix(matrix); + transform.x = matrix.tx = aX - (matrix.a * x + matrix.c * y); + transform.y = matrix.ty = aY - (matrix.b * x + matrix.d * y); + }; + Surface.prototype._updateVertices = function () { + var data = this._armature.armatureData.parent; + var geometry = this._boneData.geometry; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometry.offset + 0 /* GeometryVertexCount */]; + var verticesOffset = intArray[geometry.offset + 2 /* GeometryFloatOffset */]; + var vertices = this._vertices; + var animationVertices = this._deformVertices; + if (this._parent !== null) { + if (this._parent._boneData.type === 1 /* Surface */) { + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + var x = floatArray[verticesOffset + iD] + animationVertices[iD]; + var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + var matrix = this._parent._getGlobalTransformMatrix(x, y); + // + vertices[iD] = matrix.a * x + matrix.c * y + matrix.tx; + vertices[iD + 1] = matrix.b * x + matrix.d * y + matrix.ty; + } + } + else { + var parentMatrix = this._parent.globalTransformMatrix; + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + var x = floatArray[verticesOffset + iD] + animationVertices[iD]; + var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + // + vertices[iD] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + vertices[iD + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + } + } + } + else { + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + vertices[iD] = floatArray[verticesOffset + iD] + animationVertices[iD]; + vertices[iD + 1] = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + } + } + }; + Surface.prototype._updateGlobalTransformMatrix = function (isCache) { + // tslint:disable-next-line:no-unused-expression + isCache; + var segmentXD = this._boneData.segmentX * 2; + var lastIndex = this._vertices.length - 2; + var lA = 200.0; + // + var raX = this._vertices[0]; + var raY = this._vertices[1]; + var rbX = this._vertices[segmentXD]; + var rbY = this._vertices[segmentXD + 1]; + var rcX = this._vertices[lastIndex]; + var rcY = this._vertices[lastIndex + 1]; + var rdX = this._vertices[lastIndex - segmentXD]; + var rdY = this._vertices[lastIndex - segmentXD + 1]; + // + var dacX = raX + (rcX - raX) * 0.5; + var dacY = raY + (rcY - raY) * 0.5; + var dbdX = rbX + (rdX - rbX) * 0.5; + var dbdY = rbY + (rdY - rbY) * 0.5; + var aX = dacX + (dbdX - dacX) * 0.5; + var aY = dacY + (dbdY - dacY) * 0.5; + var bX = rbX + (rcX - rbX) * 0.5; + var bY = rbY + (rcY - rbY) * 0.5; + var cX = rdX + (rcX - rdX) * 0.5; + var cY = rdY + (rcY - rdY) * 0.5; + // TODO interpolation + this._getAffineTransform(0.0, 0.0, lA, lA, aX, aY, bX, bY, cX, cY, this.global, this.globalTransformMatrix, false); + this._globalDirty = false; + }; + Surface.prototype._getGlobalTransformMatrix = function (x, y) { + var lA = 200.0; + var lB = 1000.0; + if (x < -lB || lB < x || y < -lB || lB < y) { + return this.globalTransformMatrix; + } + var isDown = false; + var surfaceData = this._boneData; + var segmentX = surfaceData.segmentX; + var segmentY = surfaceData.segmentY; + var segmentXD = surfaceData.segmentX * 2; + var dX = this._dX; + var dY = this._dY; + var indexX = Math.floor((x + lA) / dX); // -1 ~ segmentX - 1 + var indexY = Math.floor((y + lA) / dY); // -1 ~ segmentY - 1 + var matrixIndex = 0; + var pX = indexX * dX - lA; + var pY = indexY * dY - lA; + // + var matrices = this._matrixCahce; + var helpMatrix = Surface._helpMatrix; + if (x < -lA) { + if (y < -lA || y >= lA) { + return this.globalTransformMatrix; + } + // Left. + isDown = y > this._kX * (x + lA) + pY; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexY * (segmentXD + 2); + var ddX = this._hullCache[4]; + var ddY = this._hullCache[5]; + var sX = this._hullCache[2] - (segmentY - indexY) * ddX; + var sY = this._hullCache[3] - (segmentY - indexY) * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(-lA, pY + dY, lB - lA, dY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], sX + ddX, sY + ddY, vertices[vertexIndex], vertices[vertexIndex + 1], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(-lB, pY, lB - lA, dY, sX, sY, vertices[vertexIndex], vertices[vertexIndex + 1], sX + ddX, sY + ddY, Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (x >= lA) { + if (y < -lA || y >= lA) { + return this.globalTransformMatrix; + } + // Right. + isDown = y > this._kX * (x - lB) + pY; + matrixIndex = ((segmentX * segmentY + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = (indexY + 1) * (segmentXD + 2) - 2; + var ddX = this._hullCache[4]; + var ddY = this._hullCache[5]; + var sX = this._hullCache[0] + indexY * ddX; + var sY = this._hullCache[1] + indexY * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(lB, pY + dY, lB - lA, dY, sX + ddX, sY + ddY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], sX, sY, Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(lA, pY, lB - lA, dY, vertices[vertexIndex], vertices[vertexIndex + 1], sX, sY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (y < -lA) { + if (x < -lA || x >= lA) { + return this.globalTransformMatrix; + } + // Up. + isDown = y > this._kY * (x - pX - dX) - lB; + matrixIndex = ((segmentX * segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexX * 2; + var ddX = this._hullCache[10]; + var ddY = this._hullCache[11]; + var sX = this._hullCache[8] + indexX * ddX; + var sY = this._hullCache[9] + indexX * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, -lA, dX, lB - lA, vertices[vertexIndex + 2], vertices[vertexIndex + 3], vertices[vertexIndex], vertices[vertexIndex + 1], sX + ddX, sY + ddY, Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, -lB, dX, lB - lA, sX, sY, sX + ddX, sY + ddY, vertices[vertexIndex], vertices[vertexIndex + 1], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (y >= lA) { + if (x < -lA || x >= lA) { + return this.globalTransformMatrix; + } + // Down + isDown = y > this._kY * (x - pX - dX) + lA; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = segmentY * (segmentXD + 2) + indexX * 2; + var ddX = this._hullCache[10]; + var ddY = this._hullCache[11]; + var sX = this._hullCache[6] - (segmentX - indexX) * ddX; + var sY = this._hullCache[7] - (segmentX - indexX) * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, lB, dX, lB - lA, sX + ddX, sY + ddY, sX, sY, vertices[vertexIndex + 2], vertices[vertexIndex + 3], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, lA, dX, lB - lA, vertices[vertexIndex], vertices[vertexIndex + 1], vertices[vertexIndex + 2], vertices[vertexIndex + 3], sX, sY, Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else { + isDown = y > this._k * (x - pX - dX) + pY; + matrixIndex = ((segmentX * indexY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexX * 2 + indexY * (segmentXD + 2); + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, pY + dY, dX, dY, vertices[vertexIndex + segmentXD + 4], vertices[vertexIndex + segmentXD + 5], vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], vertices[vertexIndex + 2], vertices[vertexIndex + 3], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, pY, dX, dY, vertices[vertexIndex], vertices[vertexIndex + 1], vertices[vertexIndex + 2], vertices[vertexIndex + 3], vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + return helpMatrix; + }; + /** + * @internal + * @private + */ + Surface.prototype.init = function (surfaceData, armatureValue) { + if (this._boneData !== null) { + return; + } + _super.prototype.init.call(this, surfaceData, armatureValue); + var segmentX = surfaceData.segmentX; + var segmentY = surfaceData.segmentY; + var vertexCount = this._armature.armatureData.parent.intArray[surfaceData.geometry.offset + 0 /* GeometryVertexCount */]; + var lB = 1000.0; + var lA = 200.0; + // + this._dX = lA * 2.0 / segmentX; + this._dY = lA * 2.0 / segmentY; + this._k = -this._dY / this._dX; + this._kX = -this._dY / (lB - lA); + this._kY = -(lB - lA) / this._dX; + this._vertices.length = vertexCount * 2; + this._deformVertices.length = vertexCount * 2; + this._matrixCahce.length = (segmentX * segmentY + segmentX * 2 + segmentY * 2) * 2 * 7; + this._hullCache.length = 10; + for (var i = 0; i < vertexCount * 2; ++i) { + this._deformVertices[i] = 0.0; + } + if (this._parent !== null) { + if (this._parent.boneData.type === 0 /* Bone */) { + this._bone = this._parent; + } + else { + this._bone = this._parent._bone; + } + } + }; + /** + * @internal + */ + Surface.prototype.update = function (cacheFrameIndex) { + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else { + if (this._hasConstraint) { + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || + (this._parent !== null && this._parent._childrenTransformDirty)) { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + } + else { + if (this._hasConstraint) { + for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) { + var constraint = _c[_b]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + if (this._transformDirty) { + this._transformDirty = false; + this._childrenTransformDirty = true; + // + for (var i = 0, l = this._matrixCahce.length; i < l; i += 7) { + this._matrixCahce[i] = -1.0; + } + // + this._updateVertices(); + // + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + if (this._localDirty) { + this._updateGlobalTransformMatrix(isCache); + } + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + // Update hull vertices. + var lB = 1000.0; + var lA = 200.0; + var ddX = 2 * this.global.x; + var ddY = 2 * this.global.y; + // + var helpPoint = Surface._helpPoint; + this.globalTransformMatrix.transformPoint(lB, -lA, helpPoint); + this._hullCache[0] = helpPoint.x; + this._hullCache[1] = helpPoint.y; + this._hullCache[2] = ddX - helpPoint.x; + this._hullCache[3] = ddY - helpPoint.y; + this.globalTransformMatrix.transformPoint(0.0, this._dY, helpPoint, true); + this._hullCache[4] = helpPoint.x; + this._hullCache[5] = helpPoint.y; + // + this.globalTransformMatrix.transformPoint(lA, lB, helpPoint); + this._hullCache[6] = helpPoint.x; + this._hullCache[7] = helpPoint.y; + this._hullCache[8] = ddX - helpPoint.x; + this._hullCache[9] = ddY - helpPoint.y; + this.globalTransformMatrix.transformPoint(this._dX, 0.0, helpPoint, true); + this._hullCache[10] = helpPoint.x; + this._hullCache[11] = helpPoint.y; + } + else if (this._childrenTransformDirty) { + this._childrenTransformDirty = false; + } + this._localDirty = true; + }; + return Surface; + }(dragonBones.Bone)); + dragonBones.Surface = Surface; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DisplayFrame = (function (_super) { + __extends(DisplayFrame, _super); + function DisplayFrame() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.deformVertices = []; + return _this; + } + DisplayFrame.toString = function () { + return "[class dragonBones.DisplayFrame]"; + }; + DisplayFrame.prototype._onClear = function () { + this.rawDisplayData = null; + this.displayData = null; + this.textureData = null; + this.display = null; + this.deformVertices.length = 0; + }; + DisplayFrame.prototype.updateDeformVertices = function () { + if (this.rawDisplayData === null || this.deformVertices.length !== 0) { + return; + } + var rawGeometryData; + if (this.rawDisplayData.type === 2 /* Mesh */) { + rawGeometryData = this.rawDisplayData.geometry; + } + else if (this.rawDisplayData.type === 4 /* Path */) { + rawGeometryData = this.rawDisplayData.geometry; + } + else { + return; + } + var vertexCount = 0; + if (rawGeometryData.weight !== null) { + vertexCount = rawGeometryData.weight.count * 2; + } + else { + vertexCount = rawGeometryData.data.intArray[rawGeometryData.offset + 0 /* GeometryVertexCount */] * 2; + } + this.deformVertices.length = vertexCount; + for (var i = 0, l = this.deformVertices.length; i < l; ++i) { + this.deformVertices[i] = 0.0; + } + }; + DisplayFrame.prototype.getGeometryData = function () { + if (this.displayData !== null) { + if (this.displayData.type === 2 /* Mesh */) { + return this.displayData.geometry; + } + if (this.displayData.type === 4 /* Path */) { + return this.displayData.geometry; + } + } + if (this.rawDisplayData !== null) { + if (this.rawDisplayData.type === 2 /* Mesh */) { + return this.rawDisplayData.geometry; + } + if (this.rawDisplayData.type === 4 /* Path */) { + return this.rawDisplayData.geometry; + } + } + return null; + }; + DisplayFrame.prototype.getBoundingBox = function () { + if (this.displayData !== null && this.displayData.type === 3 /* BoundingBox */) { + return this.displayData.boundingBox; + } + if (this.rawDisplayData !== null && this.rawDisplayData.type === 3 /* BoundingBox */) { + return this.rawDisplayData.boundingBox; + } + return null; + }; + DisplayFrame.prototype.getTextureData = function () { + if (this.displayData !== null) { + if (this.displayData.type === 0 /* Image */) { + return this.displayData.texture; + } + if (this.displayData.type === 2 /* Mesh */) { + return this.displayData.texture; + } + } + if (this.textureData !== null) { + return this.textureData; + } + if (this.rawDisplayData !== null) { + if (this.rawDisplayData.type === 0 /* Image */) { + return this.rawDisplayData.texture; + } + if (this.rawDisplayData.type === 2 /* Mesh */) { + return this.rawDisplayData.texture; + } + } + return null; + }; + return DisplayFrame; + }(dragonBones.BaseObject)); + dragonBones.DisplayFrame = DisplayFrame; + /** + * - The slot attached to the armature, controls the display status and properties of the display object. + * A bone can contain multiple slots. + * A slot can contain multiple display objects, displaying only one of the display objects at a time, + * but you can toggle the display object into frame animation while the animation is playing. + * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, + * and a custom other display object. + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language zh_CN + */ + var Slot = (function (_super) { + __extends(Slot, _super); + function Slot() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._localMatrix = new dragonBones.Matrix(); + /** + * @internal + */ + _this._colorTransform = new dragonBones.ColorTransform(); + /** + * @internal + */ + _this._displayFrames = []; + /** + * @internal + */ + _this._geometryBones = []; + _this._rawDisplay = null; // Initial value. + _this._meshDisplay = null; // Initial value. + _this._display = null; + return _this; + } + Slot.prototype._onClear = function () { + _super.prototype._onClear.call(this); + var disposeDisplayList = []; + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var dispayFrame = _a[_i]; + var display = dispayFrame.display; + if (display !== this._rawDisplay && display !== this._meshDisplay && + disposeDisplayList.indexOf(display) < 0) { + disposeDisplayList.push(display); + } + dispayFrame.returnToPool(); + } + for (var _b = 0, disposeDisplayList_1 = disposeDisplayList; _b < disposeDisplayList_1.length; _b++) { + var eachDisplay = disposeDisplayList_1[_b]; + if (eachDisplay instanceof dragonBones.Armature) { + eachDisplay.dispose(); + } + else { + this._disposeDisplay(eachDisplay, true); + } + } + if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) { + this._disposeDisplay(this._meshDisplay, false); + } + if (this._rawDisplay !== null) { + this._disposeDisplay(this._rawDisplay, false); + } + this.displayController = null; + this._displayDataDirty = false; + this._displayDirty = false; + this._geometryDirty = false; + this._textureDirty = false; + this._visibleDirty = false; + this._blendModeDirty = false; + this._zOrderDirty = false; + this._colorDirty = false; + this._verticesDirty = false; + this._transformDirty = false; + this._visible = true; + this._blendMode = 0 /* Normal */; + this._displayIndex = -1; + this._animationDisplayIndex = -1; + this._zOrder = 0; + this._zIndex = 0; + this._cachedFrameIndex = -1; + this._pivotX = 0.0; + this._pivotY = 0.0; + this._localMatrix.identity(); + this._colorTransform.identity(); + this._displayFrames.length = 0; + this._geometryBones.length = 0; + this._slotData = null; // + this._displayFrame = null; + this._geometryData = null; + this._boundingBoxData = null; + this._textureData = null; + this._rawDisplay = null; + this._meshDisplay = null; + this._display = null; + this._childArmature = null; + this._parent = null; // + this._cachedFrameIndices = null; + }; + Slot.prototype._hasDisplay = function (display) { + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var displayFrame = _a[_i]; + if (displayFrame.display === display) { + return true; + } + } + return false; + }; + /** + * @internal + */ + Slot.prototype._isBonesUpdate = function () { + for (var _i = 0, _a = this._geometryBones; _i < _a.length; _i++) { + var bone = _a[_i]; + if (bone !== null && bone._childrenTransformDirty) { + return true; + } + } + return false; + }; + /** + * @internal + */ + Slot.prototype._updateAlpha = function () { + var globalAlpha = this._alpha * this._parent._globalAlpha; + if (this._globalAlpha !== globalAlpha) { + this._globalAlpha = globalAlpha; + this._colorDirty = true; + } + }; + Slot.prototype._updateDisplayData = function () { + var prevDisplayFrame = this._displayFrame; + var prevGeometryData = this._geometryData; + var prevTextureData = this._textureData; + var rawDisplayData = null; + var displayData = null; + this._displayFrame = null; + this._geometryData = null; + this._boundingBoxData = null; + this._textureData = null; + if (this._displayIndex >= 0 && this._displayIndex < this._displayFrames.length) { + this._displayFrame = this._displayFrames[this._displayIndex]; + rawDisplayData = this._displayFrame.rawDisplayData; + displayData = this._displayFrame.displayData; + this._geometryData = this._displayFrame.getGeometryData(); + this._boundingBoxData = this._displayFrame.getBoundingBox(); + this._textureData = this._displayFrame.getTextureData(); + } + if (this._displayFrame !== prevDisplayFrame || + this._geometryData !== prevGeometryData || this._textureData !== prevTextureData) { + // Update pivot offset. + if (this._geometryData === null && this._textureData !== null) { + var imageDisplayData = ((displayData !== null && displayData.type === 0 /* Image */) ? displayData : rawDisplayData); // + var scale = this._textureData.parent.scale * this._armature._armatureData.scale; + var frame = this._textureData.frame; + this._pivotX = imageDisplayData.pivot.x; + this._pivotY = imageDisplayData.pivot.y; + var rect = frame !== null ? frame : this._textureData.region; + var width = rect.width; + var height = rect.height; + if (this._textureData.rotated && frame === null) { + width = rect.height; + height = rect.width; + } + this._pivotX *= width * scale; + this._pivotY *= height * scale; + if (frame !== null) { + this._pivotX += frame.x * scale; + this._pivotY += frame.y * scale; + } + // Update replace pivot. TODO + if (rawDisplayData !== null && imageDisplayData !== rawDisplayData) { + rawDisplayData.transform.toMatrix(Slot._helpMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint); + this._pivotX -= Slot._helpPoint.x; + this._pivotY -= Slot._helpPoint.y; + imageDisplayData.transform.toMatrix(Slot._helpMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint); + this._pivotX += Slot._helpPoint.x; + this._pivotY += Slot._helpPoint.y; + } + if (!dragonBones.DragonBones.yDown) { + this._pivotY = (this._textureData.rotated ? this._textureData.region.width : this._textureData.region.height) * scale - this._pivotY; + } + } + else { + this._pivotX = 0.0; + this._pivotY = 0.0; + } + // Update original transform. + if (rawDisplayData !== null) { + this.origin = rawDisplayData.transform; + } + else if (displayData !== null) { + this.origin = displayData.transform; + } + else { + this.origin = null; + } + // TODO remove slot offset. + if (this.origin !== null) { + this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix); + } + else { + this.global.copyFrom(this.offset).toMatrix(this._localMatrix); + } + // Update geometry. + if (this._geometryData !== prevGeometryData) { + this._geometryDirty = true; + this._verticesDirty = true; + if (this._geometryData !== null) { + this._geometryBones.length = 0; + if (this._geometryData.weight !== null) { + for (var i = 0, l = this._geometryData.weight.bones.length; i < l; ++i) { + var bone = this._armature.getBone(this._geometryData.weight.bones[i].name); + this._geometryBones.push(bone); + } + } + } + else { + this._geometryBones.length = 0; + this._geometryData = null; + } + } + this._textureDirty = this._textureData !== prevTextureData; + this._transformDirty = true; + } + }; + Slot.prototype._updateDisplay = function () { + var prevDisplay = this._display !== null ? this._display : this._rawDisplay; + var prevChildArmature = this._childArmature; + // Update display and child armature. + if (this._displayFrame !== null) { + this._display = this._displayFrame.display; + if (this._display !== null && this._display instanceof dragonBones.Armature) { + this._childArmature = this._display; + this._display = this._childArmature.display; + } + else { + this._childArmature = null; + } + } + else { + this._display = null; + this._childArmature = null; + } + // Update display. + var currentDisplay = this._display !== null ? this._display : this._rawDisplay; + if (currentDisplay !== prevDisplay) { + this._textureDirty = true; + this._visibleDirty = true; + this._blendModeDirty = true; + // this._zOrderDirty = true; + this._colorDirty = true; + this._transformDirty = true; + this._onUpdateDisplay(); + this._replaceDisplay(prevDisplay); + } + // Update child armature. + if (this._childArmature !== prevChildArmature) { + if (prevChildArmature !== null) { + prevChildArmature._parent = null; // Update child armature parent. + prevChildArmature.clock = null; + if (prevChildArmature.inheritAnimation) { + prevChildArmature.animation.reset(); + } + } + if (this._childArmature !== null) { + this._childArmature._parent = this; // Update child armature parent. + this._childArmature.clock = this._armature.clock; + if (this._childArmature.inheritAnimation) { + if (this._childArmature.cacheFrameRate === 0) { + var cacheFrameRate = this._armature.cacheFrameRate; + if (cacheFrameRate !== 0) { + this._childArmature.cacheFrameRate = cacheFrameRate; + } + } + // Child armature action. + if (this._displayFrame !== null) { + var actions = null; + var displayData = this._displayFrame.displayData !== null ? this._displayFrame.displayData : this._displayFrame.rawDisplayData; + if (displayData !== null && displayData.type === 1 /* Armature */) { + actions = displayData.actions; + } + if (actions !== null && actions.length > 0) { + for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) { + var action = actions_1[_i]; + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + eventObject.slot = this; + this._armature._bufferAction(eventObject, false); + } + } + else { + this._childArmature.animation.play(); + } + } + } + } + } + }; + Slot.prototype._updateGlobalTransformMatrix = function (isCache) { + var parentMatrix = this._parent._boneData.type === 0 /* Bone */ ? this._parent.globalTransformMatrix : this._parent._getGlobalTransformMatrix(this.global.x, this.global.y); + this.globalTransformMatrix.copyFrom(this._localMatrix); + this.globalTransformMatrix.concat(parentMatrix); + if (isCache) { + this.global.fromMatrix(this.globalTransformMatrix); + } + else { + this._globalDirty = true; + } + }; + /** + * @internal + */ + Slot.prototype._setDisplayIndex = function (value, isAnimation) { + if (isAnimation === void 0) { isAnimation = false; } + if (isAnimation) { + if (this._animationDisplayIndex === value) { + return; + } + this._animationDisplayIndex = value; + } + if (this._displayIndex === value) { + return; + } + this._displayIndex = value < this._displayFrames.length ? value : this._displayFrames.length - 1; + this._displayDataDirty = true; + this._displayDirty = this._displayIndex < 0 || this._display !== this._displayFrames[this._displayIndex].display; + }; + /** + * @internal + */ + Slot.prototype._setZOrder = function (value) { + if (this._zOrder === value) { + // return false; + } + this._zOrder = value; + this._zOrderDirty = true; + return this._zOrderDirty; + }; + /** + * @internal + */ + Slot.prototype._setColor = function (value) { + this._colorTransform.copyFrom(value); + return this._colorDirty = true; + }; + /** + * @internal + */ + Slot.prototype.init = function (slotData, armatureValue, rawDisplay, meshDisplay) { + if (this._slotData !== null) { + return; + } + this._slotData = slotData; + this._colorDirty = true; // + this._blendModeDirty = true; // + this._blendMode = this._slotData.blendMode; + this._zOrder = this._slotData.zOrder; + this._zIndex = this._slotData.zIndex; + this._alpha = this._slotData.alpha; + this._colorTransform.copyFrom(this._slotData.color); + this._rawDisplay = rawDisplay; + this._meshDisplay = meshDisplay; + // + this._armature = armatureValue; + var slotParent = this._armature.getBone(this._slotData.parent.name); + if (slotParent !== null) { + this._parent = slotParent; + } + else { + // Never; + } + this._armature._addSlot(this); + // + this._initDisplay(this._rawDisplay, false); + if (this._rawDisplay !== this._meshDisplay) { + this._initDisplay(this._meshDisplay, false); + } + this._onUpdateDisplay(); + this._addDisplay(); + }; + /** + * @internal + */ + Slot.prototype.update = function (cacheFrameIndex) { + if (this._displayDataDirty) { + this._updateDisplayData(); + this._displayDataDirty = false; + } + if (this._displayDirty) { + this._updateDisplay(); + this._displayDirty = false; + } + if (this._geometryDirty || this._textureDirty) { + if (this._display === null || this._display === this._rawDisplay || this._display === this._meshDisplay) { + this._updateFrame(); + } + this._geometryDirty = false; + this._textureDirty = false; + } + if (this._display === null) { + return; + } + if (this._visibleDirty) { + this._updateVisible(); + this._visibleDirty = false; + } + if (this._blendModeDirty) { + this._updateBlendMode(); + this._blendModeDirty = false; + } + if (this._colorDirty) { + this._updateColor(); + this._colorDirty = false; + } + if (this._zOrderDirty) { + this._updateZOrder(); + this._zOrderDirty = false; + } + if (this._geometryData !== null && this._display === this._meshDisplay) { + var isSkinned = this._geometryData.weight !== null; + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + if (this._verticesDirty || + (isSkinned && this._isBonesUpdate()) || + (isSurface && this._parent._childrenTransformDirty)) { + this._verticesDirty = false; // Allow update mesh to reset the dirty value. + this._updateMesh(); + } + if (isSkinned || isSurface) { + return; + } + } + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else if (this._transformDirty || this._parent._childrenTransformDirty) { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + else if (this._transformDirty || this._parent._childrenTransformDirty) { + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + if (this._transformDirty) { + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + this._updateGlobalTransformMatrix(isCache); + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + this._updateTransform(); + this._transformDirty = false; + } + }; + /** + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Slot.prototype.invalidUpdate = function () { + this._displayDataDirty = true; + this._displayDirty = true; + // + this._transformDirty = true; + }; + /** + * @private + */ + Slot.prototype.updateTransformAndMatrix = function () { + if (this._transformDirty) { + this._updateGlobalTransformMatrix(false); + this._transformDirty = false; + } + }; + /** + * @private + */ + Slot.prototype.replaceRawDisplayData = function (displayData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.rawDisplayData !== displayData) { + displayFrame.deformVertices.length = 0; + displayFrame.rawDisplayData = displayData; + if (displayFrame.rawDisplayData === null) { + var defaultSkin = this._armature._armatureData.defaultSkin; + if (defaultSkin !== null) { + var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name); + if (defaultRawDisplayDatas !== null && index < defaultRawDisplayDatas.length) { + displayFrame.rawDisplayData = defaultRawDisplayDatas[index]; + } + } + } + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceDisplayData = function (displayData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.displayData !== displayData && displayFrame.rawDisplayData !== displayData) { + displayFrame.displayData = displayData; + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceTextureData = function (textureData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.textureData !== textureData) { + displayFrame.textureData = textureData; + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceDisplay = function (value, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.display !== value) { + var prevDisplay = displayFrame.display; + displayFrame.display = value; + if (prevDisplay !== null && + prevDisplay !== this._rawDisplay && prevDisplay !== this._meshDisplay && + !this._hasDisplay(prevDisplay)) { + if (prevDisplay instanceof dragonBones.Armature) { + // (eachDisplay as Armature).dispose(); + } + else { + this._disposeDisplay(prevDisplay, true); + } + } + if (value !== null && + value !== this._rawDisplay && value !== this._meshDisplay && + !this._hasDisplay(prevDisplay) && + !(value instanceof dragonBones.Armature)) { + this._initDisplay(value, true); + } + if (index === this._displayIndex) { + this._displayDirty = true; + } + } + }; + /** + * - Check whether a specific point is inside a custom bounding box in the slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Slot.prototype.containsPoint = function (x, y) { + if (this._boundingBoxData === null) { + return false; + } + this.updateTransformAndMatrix(); + Slot._helpMatrix.copyFrom(this.globalTransformMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(x, y, Slot._helpPoint); + return this._boundingBoxData.containsPoint(Slot._helpPoint.x, Slot._helpPoint.y); + }; + /** + * - Check whether a specific segment intersects a custom bounding box for the slot. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] + * @version DragonBones 5.0 + * @language zh_CN + */ + Slot.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + if (this._boundingBoxData === null) { + return 0; + } + this.updateTransformAndMatrix(); + Slot._helpMatrix.copyFrom(this.globalTransformMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(xA, yA, Slot._helpPoint); + xA = Slot._helpPoint.x; + yA = Slot._helpPoint.y; + Slot._helpMatrix.transformPoint(xB, yB, Slot._helpPoint); + xB = Slot._helpPoint.x; + yB = Slot._helpPoint.y; + var intersectionCount = this._boundingBoxData.intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); + if (intersectionCount > 0) { + if (intersectionCount === 1 || intersectionCount === 2) { + if (intersectionPointA !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointA.x, intersectionPointA.y, intersectionPointA); + if (intersectionPointB !== null) { + intersectionPointB.x = intersectionPointA.x; + intersectionPointB.y = intersectionPointA.y; + } + } + else if (intersectionPointB !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointB.x, intersectionPointB.y, intersectionPointB); + } + } + else { + if (intersectionPointA !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointA.x, intersectionPointA.y, intersectionPointA); + } + if (intersectionPointB !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointB.x, intersectionPointB.y, intersectionPointB); + } + } + if (normalRadians !== null) { + this.globalTransformMatrix.transformPoint(Math.cos(normalRadians.x), Math.sin(normalRadians.x), Slot._helpPoint, true); + normalRadians.x = Math.atan2(Slot._helpPoint.y, Slot._helpPoint.x); + this.globalTransformMatrix.transformPoint(Math.cos(normalRadians.y), Math.sin(normalRadians.y), Slot._helpPoint, true); + normalRadians.y = Math.atan2(Slot._helpPoint.y, Slot._helpPoint.x); + } + } + return intersectionCount; + }; + /** + * @private + */ + Slot.prototype.getDisplayFrameAt = function (index) { + return this._displayFrames[index]; + }; + Object.defineProperty(Slot.prototype, "visible", { + /** + * - The visible of slot's display object. + * @default true + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 插槽的显示对象的可见。 + * @default true + * @version DragonBones 5.6 + * @language zh_CN + */ + get: function () { + return this._visible; + }, + set: function (value) { + if (this._visible === value) { + return; + } + this._visible = value; + this._updateVisible(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayFrameCount", { + /** + * @private + */ + get: function () { + return this._displayFrames.length; + }, + set: function (value) { + var prevCount = this._displayFrames.length; + if (prevCount < value) { + this._displayFrames.length = value; + for (var i = prevCount; i < value; ++i) { + this._displayFrames[i] = dragonBones.BaseObject.borrowObject(DisplayFrame); + } + } + else if (prevCount > value) { + for (var i = prevCount - 1; i < value; --i) { + this.replaceDisplay(null, i); + this._displayFrames[i].returnToPool(); + } + this._displayFrames.length = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayIndex", { + /** + * - The index of the display object displayed in the display list. + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     slot.displayIndex = 3;
+             *     slot.displayController = "none";
+             * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 此时显示的显示对象在显示列表中的索引。 + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     slot.displayIndex = 3;
+             *     slot.displayController = "none";
+             * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._displayIndex; + }, + set: function (value) { + this._setDisplayIndex(value); + this.update(-1); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "name", { + /** + * - The slot name. + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._slotData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayList", { + /** + * - Contains a display list of display objects or child armatures. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + var displays = new Array(); + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var displayFrame = _a[_i]; + displays.push(displayFrame.display); + } + return displays; + }, + set: function (value) { + this.displayFrameCount = value.length; + var index = 0; + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var eachDisplay = value_1[_i]; + this.replaceDisplay(eachDisplay, index++); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "slotData", { + /** + * - The slot data. + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 插槽数据。 + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._slotData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "boundingBoxData", { + /** + * - The custom bounding box data for the slot at current time. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 插槽此时的自定义包围盒数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + get: function () { + return this._boundingBoxData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "rawDisplay", { + /** + * @private + */ + get: function () { + return this._rawDisplay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "meshDisplay", { + /** + * @private + */ + get: function () { + return this._meshDisplay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "display", { + /** + * - The display object that the slot displays at this time. + * @example + *
+             *     let slot = armature.getSlot("text");
+             *     slot.display = new yourEngine.TextField();
+             * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的显示对象。 + * @example + *
+             *     let slot = armature.getSlot("text");
+             *     slot.display = new yourEngine.TextField();
+             * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._display; + }, + set: function (value) { + if (this._display === value) { + return; + } + if (this._displayFrames.length === 0) { + this.displayFrameCount = 1; + this._displayIndex = 0; + } + this.replaceDisplay(value, this._displayIndex); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "childArmature", { + /** + * - The child armature that the slot displayed at current time. + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
+             *     }
+             *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+             * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的子骨架。 + * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
+             *     }
+             *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+             * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._childArmature; + }, + set: function (value) { + if (this._childArmature === value) { + return; + } + this.display = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "parent", { + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Slot.prototype.getDisplay = function () { + return this._display; + }; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Slot.prototype.setDisplay = function (value) { + this.display = value; + }; + return Slot; + }(dragonBones.TransformObject)); + dragonBones.Slot = Slot; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var Constraint = (function (_super) { + __extends(Constraint, _super); + function Constraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + Constraint.prototype._onClear = function () { + this._armature = null; // + this._target = null; // + this._root = null; // + this._bone = null; + }; + Object.defineProperty(Constraint.prototype, "name", { + get: function () { + return this._constraintData.name; + }, + enumerable: true, + configurable: true + }); + Constraint._helpMatrix = new dragonBones.Matrix(); + Constraint._helpTransform = new dragonBones.Transform(); + Constraint._helpPoint = new dragonBones.Point(); + return Constraint; + }(dragonBones.BaseObject)); + dragonBones.Constraint = Constraint; + /** + * @internal + */ + var IKConstraint = (function (_super) { + __extends(IKConstraint, _super); + function IKConstraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraint.toString = function () { + return "[class dragonBones.IKConstraint]"; + }; + IKConstraint.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._scaleEnabled = false; + this._bendPositive = false; + this._weight = 1.0; + this._constraintData = null; + }; + IKConstraint.prototype._computeA = function () { + var ikGlobal = this._target.global; + var global = this._root.global; + var globalTransformMatrix = this._root.globalTransformMatrix; + var radian = Math.atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); + if (global.scaleX < 0.0) { + radian += Math.PI; + } + global.rotation += dragonBones.Transform.normalizeRadian(radian - global.rotation) * this._weight; + global.toMatrix(globalTransformMatrix); + }; + IKConstraint.prototype._computeB = function () { + var boneLength = this._bone._boneData.length; + var parent = this._root; + var ikGlobal = this._target.global; + var parentGlobal = parent.global; + var global = this._bone.global; + var globalTransformMatrix = this._bone.globalTransformMatrix; + var x = globalTransformMatrix.a * boneLength; + var y = globalTransformMatrix.b * boneLength; + var lLL = x * x + y * y; + var lL = Math.sqrt(lLL); + var dX = global.x - parentGlobal.x; + var dY = global.y - parentGlobal.y; + var lPP = dX * dX + dY * dY; + var lP = Math.sqrt(lPP); + var rawRadian = global.rotation; + var rawParentRadian = parentGlobal.rotation; + var rawRadianA = Math.atan2(dY, dX); + dX = ikGlobal.x - parentGlobal.x; + dY = ikGlobal.y - parentGlobal.y; + var lTT = dX * dX + dY * dY; + var lT = Math.sqrt(lTT); + var radianA = 0.0; + if (lL + lP <= lT || lT + lL <= lP || lT + lP <= lL) { + radianA = Math.atan2(ikGlobal.y - parentGlobal.y, ikGlobal.x - parentGlobal.x); + if (lL + lP <= lT) { + } + else if (lP < lL) { + radianA += Math.PI; + } + } + else { + var h = (lPP - lLL + lTT) / (2.0 * lTT); + var r = Math.sqrt(lPP - h * h * lTT) / lT; + var hX = parentGlobal.x + (dX * h); + var hY = parentGlobal.y + (dY * h); + var rX = -dY * r; + var rY = dX * r; + var isPPR = false; + var parentParent = parent.parent; + if (parentParent !== null) { + var parentParentMatrix = parentParent.globalTransformMatrix; + isPPR = parentParentMatrix.a * parentParentMatrix.d - parentParentMatrix.b * parentParentMatrix.c < 0.0; + } + if (isPPR !== this._bendPositive) { + global.x = hX - rX; + global.y = hY - rY; + } + else { + global.x = hX + rX; + global.y = hY + rY; + } + radianA = Math.atan2(global.y - parentGlobal.y, global.x - parentGlobal.x); + } + var dR = dragonBones.Transform.normalizeRadian(radianA - rawRadianA); + parentGlobal.rotation = rawParentRadian + dR * this._weight; + parentGlobal.toMatrix(parent.globalTransformMatrix); + // + var currentRadianA = rawRadianA + dR * this._weight; + global.x = parentGlobal.x + Math.cos(currentRadianA) * lP; + global.y = parentGlobal.y + Math.sin(currentRadianA) * lP; + // + var radianB = Math.atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); + if (global.scaleX < 0.0) { + radianB += Math.PI; + } + global.rotation = parentGlobal.rotation + rawRadian - rawParentRadian + dragonBones.Transform.normalizeRadian(radianB - dR - rawRadian) * this._weight; + global.toMatrix(globalTransformMatrix); + }; + IKConstraint.prototype.init = function (constraintData, armature) { + if (this._constraintData !== null) { + return; + } + this._constraintData = constraintData; + this._armature = armature; + this._target = this._armature.getBone(this._constraintData.target.name); + this._root = this._armature.getBone(this._constraintData.root.name); + this._bone = this._constraintData.bone !== null ? this._armature.getBone(this._constraintData.bone.name) : null; + { + var ikConstraintData = this._constraintData; + this._scaleEnabled = ikConstraintData.scaleEnabled; + this._bendPositive = ikConstraintData.bendPositive; + this._weight = ikConstraintData.weight; + } + this._root._hasConstraint = true; + }; + IKConstraint.prototype.update = function () { + this._root.updateByConstraint(); + if (this._bone !== null) { + this._bone.updateByConstraint(); + this._computeB(); + } + else { + this._computeA(); + } + }; + IKConstraint.prototype.invalidUpdate = function () { + this._root.invalidUpdate(); + if (this._bone !== null) { + this._bone.invalidUpdate(); + } + }; + return IKConstraint; + }(Constraint)); + dragonBones.IKConstraint = IKConstraint; + /** + * @internal + */ + var PathConstraint = (function (_super) { + __extends(PathConstraint, _super); + function PathConstraint() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._bones = []; + _this._spaces = []; + _this._positions = []; + _this._curves = []; + _this._boneLengths = []; + _this._pathGlobalVertices = []; + _this._segments = [10]; + return _this; + } + PathConstraint.toString = function () { + return "[class dragonBones.PathConstraint]"; + }; + PathConstraint.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.dirty = false; + this.pathOffset = 0; + this.position = 0.0; + this.spacing = 0.0; + this.rotateOffset = 0.0; + this.rotateMix = 1.0; + this.translateMix = 1.0; + this._pathSlot = null; + this._bones.length = 0; + this._spaces.length = 0; + this._positions.length = 0; + this._curves.length = 0; + this._boneLengths.length = 0; + this._pathGlobalVertices.length = 0; + }; + PathConstraint.prototype._updatePathVertices = function (verticesData) { + //计算曲线的节点数据 + var armature = this._armature; + var dragonBonesData = armature.armatureData.parent; + var scale = armature.armatureData.scale; + var intArray = dragonBonesData.intArray; + var floatArray = dragonBonesData.floatArray; + var pathOffset = verticesData.offset; + var pathVertexCount = intArray[pathOffset + 0 /* GeometryVertexCount */]; + var pathVertexOffset = intArray[pathOffset + 2 /* GeometryFloatOffset */]; + this._pathGlobalVertices.length = pathVertexCount * 2; + var weightData = verticesData.weight; + //没有骨骼约束我,那节点只受自己的Bone控制 + if (weightData === null) { + var parentBone = this._pathSlot.parent; + parentBone.updateByConstraint(); + var matrix = parentBone.globalTransformMatrix; + for (var i = 0, iV_1 = pathVertexOffset; i < pathVertexCount; i += 2) { + var vx = floatArray[iV_1++] * scale; + var vy = floatArray[iV_1++] * scale; + var x = matrix.a * vx + matrix.c * vy + matrix.tx; + var y = matrix.b * vx + matrix.d * vy + matrix.ty; + // + this._pathGlobalVertices[i] = x; + this._pathGlobalVertices[i + 1] = y; + } + return; + } + //有骨骼约束我,那我的节点受骨骼权重控制 + var bones = this._pathSlot._geometryBones; + var weightBoneCount = weightData.bones.length; + var weightOffset = weightData.offset; + var floatOffset = intArray[weightOffset + 1 /* WeigthFloatOffset */]; + var iV = floatOffset; + var iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount; + for (var i = 0, iW = 0; i < pathVertexCount; i++) { + var vertexBoneCount = intArray[iB++]; // + var xG = 0.0, yG = 0.0; + for (var ii = 0, ll = vertexBoneCount; ii < ll; ii++) { + var boneIndex = intArray[iB++]; + var bone = bones[boneIndex]; + if (bone === null) { + continue; + } + bone.updateByConstraint(); + var matrix = bone.globalTransformMatrix; + var weight = floatArray[iV++]; + var vx = floatArray[iV++] * scale; + var vy = floatArray[iV++] * scale; + xG += (matrix.a * vx + matrix.c * vy + matrix.tx) * weight; + yG += (matrix.b * vx + matrix.d * vy + matrix.ty) * weight; + } + this._pathGlobalVertices[iW++] = xG; + this._pathGlobalVertices[iW++] = yG; + } + }; + PathConstraint.prototype._computeVertices = function (start, count, offset, out) { + //TODO优化 + for (var i = offset, iW = start; i < count; i += 2) { + out[i] = this._pathGlobalVertices[iW++]; + out[i + 1] = this._pathGlobalVertices[iW++]; + } + }; + PathConstraint.prototype._computeBezierCurve = function (pathDisplayDta, spaceCount, tangents, percentPosition, percentSpacing) { + //计算当前的骨骼在曲线上的位置 + var armature = this._armature; + var intArray = armature.armatureData.parent.intArray; + var vertexCount = intArray[pathDisplayDta.geometry.offset + 0 /* GeometryVertexCount */]; + var positions = this._positions; + var spaces = this._spaces; + var isClosed = pathDisplayDta.closed; + var curveVertices = Array(); + var verticesLength = vertexCount * 2; + var curveCount = verticesLength / 6; + var preCurve = -1; + var position = this.position; + positions.length = spaceCount * 3 + 2; + var pathLength = 0.0; + //不需要匀速运动,效率高些 + if (!pathDisplayDta.constantSpeed) { + var lenghts = pathDisplayDta.curveLengths; + curveCount -= isClosed ? 1 : 2; + pathLength = lenghts[curveCount]; + if (percentPosition) { + position *= pathLength; + } + if (percentSpacing) { + for (var i = 0; i < spaceCount; i++) { + spaces[i] *= pathLength; + } + } + curveVertices.length = 8; + for (var i = 0, o = 0, curve = 0; i < spaceCount; i++, o += 3) { + var space = spaces[i]; + position += space; + if (isClosed) { + position %= pathLength; + if (position < 0) { + position += pathLength; + } + curve = 0; + } + else if (position < 0) { + //TODO + continue; + } + else if (position > pathLength) { + //TODO + continue; + } + var percent = 0.0; + for (;; curve++) { + var len = lenghts[curve]; + if (position > len) { + continue; + } + if (curve === 0) { + percent = position / len; + } + else { + var preLen = lenghts[curve - 1]; + percent = (position - preLen) / (len - preLen); + } + break; + } + if (curve !== preCurve) { + preCurve = curve; + if (isClosed && curve === curveCount) { + //计算曲线 + this._computeVertices(verticesLength - 4, 4, 0, curveVertices); + this._computeVertices(0, 4, 4, curveVertices); + } + else { + this._computeVertices(curve * 6 + 2, 8, 0, curveVertices); + } + } + // + this.addCurvePosition(percent, curveVertices[0], curveVertices[1], curveVertices[2], curveVertices[3], curveVertices[4], curveVertices[5], curveVertices[6], curveVertices[7], positions, o, tangents); + } + return; + } + //匀速的 + if (isClosed) { + verticesLength += 2; + curveVertices.length = vertexCount; + this._computeVertices(2, verticesLength - 4, 0, curveVertices); + this._computeVertices(0, 2, verticesLength - 4, curveVertices); + curveVertices[verticesLength - 2] = curveVertices[0]; + curveVertices[verticesLength - 1] = curveVertices[1]; + } + else { + curveCount--; + verticesLength -= 4; + curveVertices.length = verticesLength; + this._computeVertices(2, verticesLength, 0, curveVertices); + } + // + var curves = new Array(curveCount); + pathLength = 0; + var x1 = curveVertices[0], y1 = curveVertices[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = curveVertices[w]; + cy1 = curveVertices[w + 1]; + cx2 = curveVertices[w + 2]; + cy2 = curveVertices[w + 3]; + x2 = curveVertices[w + 4]; + y2 = curveVertices[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) { + position *= pathLength; + } + if (percentSpacing) { + for (var i = 0; i < spaceCount; i++) { + spaces[i] *= pathLength; + } + } + var segments = this._segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spaceCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (isClosed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + continue; + } + else if (p > pathLength) { + continue; + } + // Determine curve containing position. + for (;; curve++) { + var length_1 = curves[curve]; + if (p > length_1) + continue; + if (curve === 0) + p /= length_1; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_1 - prev); + } + break; + } + if (curve !== preCurve) { + preCurve = curve; + var ii = curve * 6; + x1 = curveVertices[ii]; + y1 = curveVertices[ii + 1]; + cx1 = curveVertices[ii + 2]; + cy1 = curveVertices[ii + 3]; + cx2 = curveVertices[ii + 4]; + cy2 = curveVertices[ii + 5]; + x2 = curveVertices[ii + 6]; + y2 = curveVertices[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + // Weight by segment length. + p *= curveLength; + for (;; segment++) { + var length_2 = segments[segment]; + if (p > length_2) + continue; + if (segment === 0) + p /= length_2; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_2 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, positions, o, tangents); + } + }; + //Calculates a point on the curve, for a given t value between 0 and 1. + PathConstraint.prototype.addCurvePosition = function (t, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, offset, tangents) { + if (t === 0) { + out[offset] = x1; + out[offset + 1] = y1; + out[offset + 2] = 0; + return; + } + if (t === 1) { + out[offset] = x2; + out[offset + 1] = y2; + out[offset + 2] = 0; + return; + } + var mt = 1 - t; + var mt2 = mt * mt; + var t2 = t * t; + var a = mt2 * mt; + var b = mt2 * t * 3; + var c = mt * t2 * 3; + var d = t * t2; + var x = a * x1 + b * cx1 + c * cx2 + d * x2; + var y = a * y1 + b * cy1 + c * cy2 + d * y2; + out[offset] = x; + out[offset + 1] = y; + if (tangents) { + //Calculates the curve tangent at the specified t value + out[offset + 2] = Math.atan2(y - (a * y1 + b * cy1 + c * cy2), x - (a * x1 + b * cx1 + c * cx2)); + } + else { + out[offset + 2] = 0; + } + }; + PathConstraint.prototype.init = function (constraintData, armature) { + this._constraintData = constraintData; + this._armature = armature; + var data = constraintData; + this.pathOffset = data.pathDisplayData.geometry.offset; + // + this.position = data.position; + this.spacing = data.spacing; + this.rotateOffset = data.rotateOffset; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + // + this._root = this._armature.getBone(data.root.name); + this._target = this._armature.getBone(data.target.name); + this._pathSlot = this._armature.getSlot(data.pathSlot.name); + for (var i = 0, l = data.bones.length; i < l; i++) { + var bone = this._armature.getBone(data.bones[i].name); + if (bone !== null) { + this._bones.push(bone); + } + } + if (data.rotateMode === 2 /* ChainScale */) { + this._boneLengths.length = this._bones.length; + } + this._root._hasConstraint = true; + }; + PathConstraint.prototype.update = function () { + var pathSlot = this._pathSlot; + if (pathSlot._geometryData === null || + pathSlot._geometryData.offset !== this.pathOffset) { + return; + } + var constraintData = this._constraintData; + // + //曲线节点数据改变:父亲bone改变,权重bones改变,变形顶点改变 + var isPathVerticeDirty = false; + if (this._root._childrenTransformDirty) { + this._updatePathVertices(pathSlot._geometryData); + isPathVerticeDirty = true; + } + else if (pathSlot._verticesDirty || pathSlot._isBonesUpdate()) { + this._updatePathVertices(pathSlot._geometryData); + pathSlot._verticesDirty = false; + isPathVerticeDirty = true; + } + if (!isPathVerticeDirty && !this.dirty) { + return; + } + // + var positionMode = constraintData.positionMode; + var spacingMode = constraintData.spacingMode; + var rotateMode = constraintData.rotateMode; + var bones = this._bones; + var isLengthMode = spacingMode === 0 /* Length */; + var isChainScaleMode = rotateMode === 2 /* ChainScale */; + var isTangentMode = rotateMode === 0 /* Tangent */; + var boneCount = bones.length; + var spacesCount = isTangentMode ? boneCount : boneCount + 1; + var spacing = this.spacing; + var spaces = this._spaces; + spaces.length = spacesCount; + //计曲线间隔和长度 + if (isChainScaleMode || isLengthMode) { + //Bone改变和spacing改变触发 + spaces[0] = 0; + for (var i = 0, l = spacesCount - 1; i < l; i++) { + var bone = bones[i]; + bone.updateByConstraint(); + var boneLength = bone._boneData.length; + var matrix = bone.globalTransformMatrix; + var x = boneLength * matrix.a; + var y = boneLength * matrix.b; + var len = Math.sqrt(x * x + y * y); + if (isChainScaleMode) { + this._boneLengths[i] = len; + } + spaces[i + 1] = (boneLength + spacing) * len / boneLength; + } + } + else { + for (var i = 0; i < spacesCount; i++) { + spaces[i] = spacing; + } + } + // + this._computeBezierCurve(pathSlot._displayFrame.rawDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); + //根据新的节点数据重新采样 + var positions = this._positions; + var rotateOffset = this.rotateOffset; + var boneX = positions[0], boneY = positions[1]; + var tip; + if (rotateOffset === 0) { + tip = rotateMode === 1 /* Chain */; + } + else { + tip = false; + var bone = pathSlot.parent; + if (bone !== null) { + var matrix = bone.globalTransformMatrix; + rotateOffset *= matrix.a * matrix.d - matrix.b * matrix.c > 0 ? dragonBones.Transform.DEG_RAD : -dragonBones.Transform.DEG_RAD; + } + } + // + var rotateMix = this.rotateMix; + var translateMix = this.translateMix; + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.updateByConstraint(); + var matrix = bone.globalTransformMatrix; + matrix.tx += (boneX - matrix.tx) * translateMix; + matrix.ty += (boneY - matrix.ty) * translateMix; + var x = positions[p], y = positions[p + 1]; + var dx = x - boneX, dy = y - boneY; + if (isChainScaleMode) { + var lenght = this._boneLengths[i]; + var s = (Math.sqrt(dx * dx + dy * dy) / lenght - 1) * rotateMix + 1; + matrix.a *= s; + matrix.b *= s; + } + boneX = x; + boneY = y; + if (rotateMix > 0) { + var a = matrix.a, b = matrix.b, c = matrix.c, d = matrix.d, r = void 0, cos = void 0, sin = void 0; + if (isTangentMode) { + r = positions[p - 1]; + } + else { + r = Math.atan2(dy, dx); + } + r -= Math.atan2(b, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_3 = bone._boneData.length; + boneX += (length_3 * (cos * a - sin * b) - dx) * rotateMix; + boneY += (length_3 * (sin * a + cos * b) - dy) * rotateMix; + } + else { + r += rotateOffset; + } + if (r > dragonBones.Transform.PI) { + r -= dragonBones.Transform.PI_D; + } + else if (r < -dragonBones.Transform.PI) { + r += dragonBones.Transform.PI_D; + } + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + matrix.a = cos * a - sin * b; + matrix.b = sin * a + cos * b; + matrix.c = cos * c - sin * d; + matrix.d = sin * c + cos * d; + } + bone.global.fromMatrix(matrix); + } + this.dirty = false; + }; + PathConstraint.prototype.invalidUpdate = function () { + }; + return PathConstraint; + }(Constraint)); + dragonBones.PathConstraint = PathConstraint; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + var WorldClock = (function () { + /** + * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. + * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 + * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 + * @version DragonBones 3.0 + * @language zh_CN + */ + function WorldClock(time) { + if (time === void 0) { time = 0.0; } + /** + * - Current time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + this.time = 0.0; + /** + * - The play speed, used to control animation speed-shift play. + * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度,用于控制动画变速播放。 + * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + this.timeScale = 1.0; + this._systemTime = 0.0; + this._animatebles = []; + this._clock = null; + this.time = time; + this._systemTime = new Date().getTime() * 0.001; + } + /** + * - Advance time for all IAnimatable instances. + * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 为所有的 IAnimatable 实例更新时间。 + * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.advanceTime = function (passedTime) { + if (passedTime !== passedTime) { + passedTime = 0.0; + } + var currentTime = Date.now() * 0.001; + if (passedTime < 0.0) { + passedTime = currentTime - this._systemTime; + } + this._systemTime = currentTime; + if (this.timeScale !== 1.0) { + passedTime *= this.timeScale; + } + if (passedTime === 0.0) { + return; + } + if (passedTime < 0.0) { + this.time -= passedTime; + } + else { + this.time += passedTime; + } + var i = 0, r = 0, l = this._animatebles.length; + for (; i < l; ++i) { + var animatable = this._animatebles[i]; + if (animatable !== null) { + if (r > 0) { + this._animatebles[i - r] = animatable; + this._animatebles[i] = null; + } + animatable.advanceTime(passedTime); + } + else { + r++; + } + } + if (r > 0) { + l = this._animatebles.length; + for (; i < l; ++i) { + var animateble = this._animatebles[i]; + if (animateble !== null) { + this._animatebles[i - r] = animateble; + } + else { + r++; + } + } + this._animatebles.length -= r; + } + }; + /** + * - Check whether contains a specific instance of IAnimatable. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.contains = function (value) { + if (value === this) { + return false; + } + var ancestor = value; + while (ancestor !== this && ancestor !== null) { + ancestor = ancestor.clock; + } + return ancestor === this; + }; + /** + * - Add IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.add = function (value) { + if (this._animatebles.indexOf(value) < 0) { + this._animatebles.push(value); + value.clock = this; + } + }; + /** + * - Removes a specified IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.remove = function (value) { + var index = this._animatebles.indexOf(value); + if (index >= 0) { + this._animatebles[index] = null; + value.clock = null; + } + }; + /** + * - Clear all IAnimatable instances. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.clear = function () { + for (var _i = 0, _a = this._animatebles; _i < _a.length; _i++) { + var animatable = _a[_i]; + if (animatable !== null) { + animatable.clock = null; + } + } + }; + Object.defineProperty(WorldClock.prototype, "clock", { + /** + * @inheritDoc + */ + get: function () { + return this._clock; + }, + set: function (value) { + if (this._clock === value) { + return; + } + if (this._clock !== null) { + this._clock.remove(this); + } + this._clock = value; + if (this._clock !== null) { + this._clock.add(this); + } + }, + enumerable: true, + configurable: true + }); + return WorldClock; + }()); + dragonBones.WorldClock = WorldClock; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation player is used to play the animation data and manage the animation states. + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器用来播放动画数据和管理动画状态。 + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + var Animation = (function (_super) { + __extends(Animation, _super); + function Animation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._animationNames = []; + _this._animationStates = []; + _this._animations = {}; + _this._blendStates = {}; + _this._animationConfig = null; // Initial value. + return _this; + } + Animation.toString = function () { + return "[class dragonBones.Animation]"; + }; + Animation.prototype._onClear = function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.returnToPool(); + } + for (var k in this._animations) { + delete this._animations[k]; + } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].returnToPool(); + } + delete this._blendStates[k]; + } + if (this._animationConfig !== null) { + this._animationConfig.returnToPool(); + } + this.timeScale = 1.0; + this._animationDirty = false; + this._inheritTimeScale = 1.0; + this._animationNames.length = 0; + this._animationStates.length = 0; + //this._animations.clear(); + this._armature = null; // + this._animationConfig = null; // + this._lastAnimationState = null; + }; + Animation.prototype._fadeOut = function (animationConfig) { + switch (animationConfig.fadeOutMode) { + case 1 /* SameLayer */: + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (animationState._parent !== null) { + continue; + } + if (animationState.layer === animationConfig.layer) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 2 /* SameGroup */: + for (var _b = 0, _c = this._animationStates; _b < _c.length; _b++) { + var animationState = _c[_b]; + if (animationState._parent !== null) { + continue; + } + if (animationState.group === animationConfig.group) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 3 /* SameLayerAndGroup */: + for (var _d = 0, _e = this._animationStates; _d < _e.length; _d++) { + var animationState = _e[_d]; + if (animationState._parent !== null) { + continue; + } + if (animationState.layer === animationConfig.layer && + animationState.group === animationConfig.group) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 4 /* All */: + for (var _f = 0, _g = this._animationStates; _f < _g.length; _f++) { + var animationState = _g[_f]; + if (animationState._parent !== null) { + continue; + } + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + break; + case 5 /* Single */: // TODO + default: + break; + } + }; + /** + * @internal + */ + Animation.prototype.init = function (armature) { + if (this._armature !== null) { + return; + } + this._armature = armature; + this._animationConfig = dragonBones.BaseObject.borrowObject(dragonBones.AnimationConfig); + }; + /** + * @internal + */ + Animation.prototype.advanceTime = function (passedTime) { + if (passedTime < 0.0) { + passedTime = -passedTime; + } + if (this._armature.inheritAnimation && this._armature._parent !== null) { + this._inheritTimeScale = this._armature._parent._armature.animation._inheritTimeScale * this.timeScale; + } + else { + this._inheritTimeScale = this.timeScale; + } + if (this._inheritTimeScale !== 1.0) { + passedTime *= this._inheritTimeScale; + } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].reset(); + } + } + var animationStateCount = this._animationStates.length; + if (animationStateCount === 1) { + var animationState = this._animationStates[0]; + if (animationState._fadeState > 0 && animationState._subFadeState > 0) { + this._armature._dragonBones.bufferObject(animationState); + this._animationStates.length = 0; + this._lastAnimationState = null; + } + else { + var animationData = animationState.animationData; + var cacheFrameRate = animationData.cacheFrameRate; + if (this._animationDirty && cacheFrameRate > 0.0) { + this._animationDirty = false; + for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { + var bone = _a[_i]; + bone._cachedFrameIndices = animationData.getBoneCachedFrameIndices(bone.name); + } + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { + var slot = _c[_b]; + if (slot.displayFrameCount > 0) { + var rawDisplayData = slot.getDisplayFrameAt(0).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.parent === this._armature.armatureData.defaultSkin) { + slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); + continue; + } + } + slot._cachedFrameIndices = null; + } + } + animationState.advanceTime(passedTime, cacheFrameRate); + } + } + else if (animationStateCount > 1) { + for (var i = 0, r = 0; i < animationStateCount; ++i) { + var animationState = this._animationStates[i]; + if (animationState._fadeState > 0 && animationState._subFadeState > 0) { + r++; + this._armature._dragonBones.bufferObject(animationState); + this._animationDirty = true; + if (this._lastAnimationState === animationState) { + this._lastAnimationState = null; + } + } + else { + if (r > 0) { + this._animationStates[i - r] = animationState; + } + animationState.advanceTime(passedTime, 0.0); + } + if (i === animationStateCount - 1 && r > 0) { + this._animationStates.length -= r; + if (this._lastAnimationState === null && this._animationStates.length > 0) { + this._lastAnimationState = this._animationStates[this._animationStates.length - 1]; + } + } + } + this._armature._cacheFrameIndex = -1; + } + else { + this._armature._cacheFrameIndex = -1; + } + }; + /** + * - Clear all animations states. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除所有的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.reset = function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.returnToPool(); + } + this._animationDirty = false; + this._animationConfig.clear(); + this._animationStates.length = 0; + this._lastAnimationState = null; + }; + /** + * - Pause a specific animation state. + * @param animationName - The name of animation state. (If not set, it will pause all animations) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停指定动画状态的播放。 + * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.stop = function (animationName) { + if (animationName === void 0) { animationName = null; } + if (animationName !== null) { + var animationState = this.getState(animationName); + if (animationState !== null) { + animationState.stop(); + } + } + else { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.stop(); + } + } + }; + /** + * - Play animation with a specific animation config. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @param animationConfig - The animation config. + * @returns The playing animation state. + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 通过指定的动画配置来播放动画。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @param animationConfig - 动画配置。 + * @returns 播放的动画状态。 + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + Animation.prototype.playConfig = function (animationConfig) { + var animationName = animationConfig.animation; + if (!(animationName in this._animations)) { + console.warn("Non-existent animation.\n", "DragonBones name: " + this._armature.armatureData.parent.name, "Armature name: " + this._armature.name, "Animation name: " + animationName); + return null; + } + var animationData = this._animations[animationName]; + if (animationConfig.fadeOutMode === 5 /* Single */) { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState_1 = _a[_i]; + if (animationState_1._fadeState < 1 && + animationState_1.layer === animationConfig.layer && + animationState_1.animationData === animationData) { + return animationState_1; + } + } + } + if (this._animationStates.length === 0) { + animationConfig.fadeInTime = 0.0; + } + else if (animationConfig.fadeInTime < 0.0) { + animationConfig.fadeInTime = animationData.fadeInTime; + } + if (animationConfig.fadeOutTime < 0.0) { + animationConfig.fadeOutTime = animationConfig.fadeInTime; + } + if (animationConfig.timeScale <= -100.0) { + animationConfig.timeScale = 1.0 / animationData.scale; + } + if (animationData.frameCount > 0) { + if (animationConfig.position < 0.0) { + animationConfig.position %= animationData.duration; + animationConfig.position = animationData.duration - animationConfig.position; + } + else if (animationConfig.position === animationData.duration) { + animationConfig.position -= 0.000001; // Play a little time before end. + } + else if (animationConfig.position > animationData.duration) { + animationConfig.position %= animationData.duration; + } + if (animationConfig.duration > 0.0 && animationConfig.position + animationConfig.duration > animationData.duration) { + animationConfig.duration = animationData.duration - animationConfig.position; + } + if (animationConfig.playTimes < 0) { + animationConfig.playTimes = animationData.playTimes; + } + } + else { + animationConfig.playTimes = 1; + animationConfig.position = 0.0; + if (animationConfig.duration > 0.0) { + animationConfig.duration = 0.0; + } + } + if (animationConfig.duration === 0.0) { + animationConfig.duration = -1.0; + } + this._fadeOut(animationConfig); + // + var animationState = dragonBones.BaseObject.borrowObject(dragonBones.AnimationState); + animationState.init(this._armature, animationData, animationConfig); + this._animationDirty = true; + this._armature._cacheFrameIndex = -1; + if (this._animationStates.length > 0) { + var added = false; + for (var i = 0, l = this._animationStates.length; i < l; ++i) { + if (animationState.layer > this._animationStates[i].layer) { + added = true; + this._animationStates.splice(i, 0, animationState); + break; + } + else if (i !== l - 1 && animationState.layer > this._animationStates[i + 1].layer) { + added = true; + this._animationStates.splice(i + 1, 0, animationState); + break; + } + } + if (!added) { + this._animationStates.push(animationState); + } + } + else { + this._animationStates.push(animationState); + } + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { + var slot = _c[_b]; + var childArmature = slot.childArmature; + if (childArmature !== null && childArmature.inheritAnimation && + childArmature.animation.hasAnimation(animationName) && + childArmature.animation.getState(animationName) === null) { + childArmature.animation.fadeIn(animationName); // + } + } + for (var k in animationData.animationTimelines) { + var childAnimationState = this.fadeIn(k, 0.0, 1, animationState.layer, "", 5 /* Single */); + if (childAnimationState === null) { + continue; + } + var timelines = animationData.animationTimelines[k]; + childAnimationState.actionEnabled = false; + childAnimationState.resetToPose = false; + childAnimationState.stop(); + animationState.addState(childAnimationState, timelines); + // + var index = this._animationStates.indexOf(animationState); + var childIndex = this._animationStates.indexOf(childAnimationState); + if (childIndex < index) { + this._animationStates.splice(index, 1); + this._animationStates.splice(childIndex, 0, animationState); + } + } + // if (!this._armature._lockUpdate && animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. + // this._armature.advanceTime(0.0); + // } + this._lastAnimationState = animationState; + return animationState; + }; + /** + * - Play a specific animation. + * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) + * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放指定动画。 + * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.play = function (animationName, playTimes) { + if (animationName === void 0) { animationName = null; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName !== null ? animationName : ""; + if (animationName !== null && animationName.length > 0) { + this.playConfig(this._animationConfig); + } + else if (this._lastAnimationState === null) { + var defaultAnimation = this._armature.armatureData.defaultAnimation; + if (defaultAnimation !== null) { + this._animationConfig.animation = defaultAnimation.name; + this.playConfig(this._animationConfig); + } + } + else if (!this._lastAnimationState.isPlaying && !this._lastAnimationState.isCompleted) { + this._lastAnimationState.play(); + } + else { + this._animationConfig.animation = this._lastAnimationState.name; + this.playConfig(this._animationConfig); + } + return this._lastAnimationState; + }; + /** + * - Fade in a specific animation. + * @param animationName - The name of animation data. + * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) + * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) + * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) + * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 淡入播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) + * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) + * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.fadeIn = function (animationName, fadeInTime, playTimes, layer, group, fadeOutMode) { + if (fadeInTime === void 0) { fadeInTime = -1.0; } + if (playTimes === void 0) { playTimes = -1; } + if (layer === void 0) { layer = 0; } + if (group === void 0) { group = null; } + if (fadeOutMode === void 0) { fadeOutMode = 3 /* SameLayerAndGroup */; } + this._animationConfig.clear(); + this._animationConfig.fadeOutMode = fadeOutMode; + this._animationConfig.playTimes = playTimes; + this._animationConfig.layer = layer; + this._animationConfig.fadeInTime = fadeInTime; + this._animationConfig.animation = animationName; + this._animationConfig.group = group !== null ? group : ""; + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific time. + * @param animationName - The name of animation data. + * @param time - The start time point of playing. (In seconds) + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定时间开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param time - 播放开始的时间。 (以秒为单位) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByTime = function (animationName, time, playTimes) { + if (time === void 0) { time = 0.0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.position = time; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific frame. + * @param animationName - The name of animation data. + * @param frame - The start frame of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定帧开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param frame - 播放开始的帧数。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByFrame = function (animationName, frame, playTimes) { + if (frame === void 0) { frame = 0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + var animationData = animationName in this._animations ? this._animations[animationName] : null; + if (animationData !== null) { + this._animationConfig.position = animationData.frameCount > 0 ? animationData.duration * frame / animationData.frameCount : 0.0; + } + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific progress. + * @param animationName - The name of animation data. + * @param progress - The start progress value of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定进度开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param progress - 开始播放的进度。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByProgress = function (animationName, progress, playTimes) { + if (progress === void 0) { progress = 0.0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + var animationData = animationName in this._animations ? this._animations[animationName] : null; + if (animationData !== null) { + this._animationConfig.position = animationData.duration * (progress > 0.0 ? progress : 0.0); + } + return this.playConfig(this._animationConfig); + }; + /** + * - Stop a specific animation at the specific time. + * @param animationName - The name of animation data. + * @param time - The stop time. (In seconds) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定时间停止指定动画播放 + * @param animationName - 动画数据名称。 + * @param time - 停止的时间。 (以秒为单位) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByTime = function (animationName, time) { + if (time === void 0) { time = 0.0; } + var animationState = this.gotoAndPlayByTime(animationName, time, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * - Stop a specific animation at the specific frame. + * @param animationName - The name of animation data. + * @param frame - The stop frame. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定帧停止指定动画的播放 + * @param animationName - 动画数据名称。 + * @param frame - 停止的帧数。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByFrame = function (animationName, frame) { + if (frame === void 0) { frame = 0; } + var animationState = this.gotoAndPlayByFrame(animationName, frame, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * - Stop a specific animation at the specific progress. + * @param animationName - The name of animation data. + * @param progress - The stop progress value. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定的进度停止指定的动画播放。 + * @param animationName - 动画数据名称。 + * @param progress - 停止进度。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByProgress = function (animationName, progress) { + if (progress === void 0) { progress = 0.0; } + var animationState = this.gotoAndPlayByProgress(animationName, progress, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * @internal + */ + Animation.prototype.getBlendState = function (type, name, target) { + if (!(type in this._blendStates)) { + this._blendStates[type] = {}; + } + var blendStates = this._blendStates[type]; + if (!(name in blendStates)) { + var blendState = blendStates[name] = dragonBones.BaseObject.borrowObject(dragonBones.BlendState); + blendState.target = target; + } + return blendStates[name]; + }; + /** + * - Get a specific animation state. + * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取指定的动画状态。 + * @param animationName - 动画状态名称。 + * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.getState = function (animationName, layer) { + if (layer === void 0) { layer = -1; } + var i = this._animationStates.length; + while (i--) { + var animationState = this._animationStates[i]; + if (animationState.name === animationName && (layer < 0 || animationState.layer === layer)) { + return animationState; + } + } + return null; + }; + /** + * - Check whether a specific animation data is included. + * @param animationName - The name of animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含指定的动画数据 + * @param animationName - 动画数据名称。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.hasAnimation = function (animationName) { + return animationName in this._animations; + }; + /** + * - Get all the animation states. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取所有的动画状态 + * @version DragonBones 5.1 + * @language zh_CN + */ + Animation.prototype.getStates = function () { + return this._animationStates; + }; + Object.defineProperty(Animation.prototype, "isPlaying", { + /** + * - Check whether there is an animation state is playing + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否有动画状态正在播放 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (animationState.isPlaying) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "isCompleted", { + /** + * - Check whether all the animation states' playing were finished. + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否所有的动画状态均已播放完毕。 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (!animationState.isCompleted) { + return false; + } + } + return this._animationStates.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "lastAnimationName", { + /** + * - The name of the last playing animation state. + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态名称 + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._lastAnimationState !== null ? this._lastAnimationState.name : ""; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animationNames", { + /** + * - The name of all animation data + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有动画数据的名称 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._animationNames; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animations", { + /** + * - All animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有的动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._animations; + }, + set: function (value) { + if (this._animations === value) { + return; + } + this._animationNames.length = 0; + for (var k in this._animations) { + delete this._animations[k]; + } + for (var k in value) { + this._animationNames.push(k); + this._animations[k] = value[k]; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animationConfig", { + /** + * - An AnimationConfig instance that can be used quickly. + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 一个可以快速使用的动画配置实例。 + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language zh_CN + */ + get: function () { + this._animationConfig.clear(); + return this._animationConfig; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "lastAnimationState", { + /** + * - The last playing animation state + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._lastAnimationState; + }, + enumerable: true, + configurable: true + }); + return Animation; + }(dragonBones.BaseObject)); + dragonBones.Animation = Animation; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation state is generated when the animation data is played. + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画状态由播放动画数据时产生。 + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + var AnimationState = (function (_super) { + __extends(AnimationState, _super); + function AnimationState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._boneMask = []; + _this._boneTimelines = []; + _this._boneBlendTimelines = []; + _this._slotTimelines = []; + _this._slotBlendTimelines = []; + _this._constraintTimelines = []; + _this._animationTimelines = []; + _this._poseTimelines = []; + /** + * @internal + */ + _this._actionTimeline = null; // Initial value. + _this._zOrderTimeline = null; // Initial value. + return _this; + } + AnimationState.toString = function () { + return "[class dragonBones.AnimationState]"; + }; + AnimationState.prototype._onClear = function () { + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.returnToPool(); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.returnToPool(); + } + for (var _d = 0, _e = this._slotTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.returnToPool(); + } + for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.returnToPool(); + } + for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) { + var timeline = _j[_h]; + timeline.returnToPool(); + } + for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) { + var timeline = _l[_k]; + var animationState = timeline.target; + if (animationState._parent === this) { + animationState._fadeState = 1; + animationState._subFadeState = 1; + animationState._parent = null; + } + timeline.returnToPool(); + } + if (this._actionTimeline !== null) { + this._actionTimeline.returnToPool(); + } + if (this._zOrderTimeline !== null) { + this._zOrderTimeline.returnToPool(); + } + this.actionEnabled = false; + this.additive = false; + this.displayControl = false; + this.resetToPose = false; + this.blendType = 0 /* None */; + this.playTimes = 1; + this.layer = 0; + this.timeScale = 1.0; + this._weight = 1.0; + this.parameterX = 0.0; + this.parameterY = 0.0; + this.positionX = 0.0; + this.positionY = 0.0; + this.autoFadeOutTime = 0.0; + this.fadeTotalTime = 0.0; + this.name = ""; + this.group = ""; + this._timelineDirty = 2; + this._playheadState = 0; + this._fadeState = -1; + this._subFadeState = -1; + this._position = 0.0; + this._duration = 0.0; + this._fadeTime = 0.0; + this._time = 0.0; + this._fadeProgress = 0.0; + this._weightResult = 0.0; + this._boneMask.length = 0; + this._boneTimelines.length = 0; + this._boneBlendTimelines.length = 0; + this._slotTimelines.length = 0; + this._slotBlendTimelines.length = 0; + this._constraintTimelines.length = 0; + this._animationTimelines.length = 0; + this._poseTimelines.length = 0; + // this._bonePoses.clear(); + this._animationData = null; // + this._armature = null; // + this._actionTimeline = null; // + this._zOrderTimeline = null; + this._activeChildA = null; + this._activeChildB = null; + this._parent = null; + }; + AnimationState.prototype._updateTimelines = function () { + { + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + var timelineDatas = this._animationData.getConstraintTimelines(constraint.name); + if (timelineDatas !== null) { + for (var _b = 0, timelineDatas_1 = timelineDatas; _b < timelineDatas_1.length; _b++) { + var timelineData = timelineDatas_1[_b]; + switch (timelineData.type) { + case 30 /* IKConstraint */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState); + timeline.target = constraint; + timeline.init(this._armature, this, timelineData); + this._constraintTimelines.push(timeline); + break; + } + default: + break; + } + } + } + else if (this.resetToPose) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState); + timeline.target = constraint; + timeline.init(this._armature, this, null); + this._constraintTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + }; + AnimationState.prototype._updateBoneAndSlotTimelines = function () { + { + var boneTimelines = {}; + // Create bone timelines map. + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + var timelineName = timeline.target.target.name; + if (!(timelineName in boneTimelines)) { + boneTimelines[timelineName] = []; + } + boneTimelines[timelineName].push(timeline); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + var timelineName = timeline.target.target.name; + if (!(timelineName in boneTimelines)) { + boneTimelines[timelineName] = []; + } + boneTimelines[timelineName].push(timeline); + } + // + for (var _d = 0, _e = this._armature.getBones(); _d < _e.length; _d++) { + var bone = _e[_d]; + var timelineName = bone.name; + if (!this.containsBoneMask(timelineName)) { + continue; + } + if (timelineName in boneTimelines) { + delete boneTimelines[timelineName]; + } + else { + var timelineDatas = this._animationData.getBoneTimelines(timelineName); + var blendState = this._armature.animation.getBlendState(BlendState.BONE_TRANSFORM, bone.name, bone); + if (timelineDatas !== null) { + for (var _f = 0, timelineDatas_2 = timelineDatas; _f < timelineDatas_2.length; _f++) { + var timelineData = timelineDatas_2[_f]; + switch (timelineData.type) { + case 10 /* BoneAll */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 11 /* BoneTranslate */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneTranslateTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 12 /* BoneRotate */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneRotateTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 13 /* BoneScale */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneScaleTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 60 /* BoneAlpha */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.BONE_ALPHA, bone.name, bone); + timeline.init(this._armature, this, timelineData); + this._boneBlendTimelines.push(timeline); + break; + } + case 50 /* Surface */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone); + timeline.init(this._armature, this, timelineData); + this._boneBlendTimelines.push(timeline); + break; + } + default: + break; + } + } + } + else if (this.resetToPose) { + if (bone._boneData.type === 0 /* Bone */) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, null); + this._boneTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + else { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone); + timeline.init(this._armature, this, null); + this._boneBlendTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + } + for (var k in boneTimelines) { + for (var _g = 0, _h = boneTimelines[k]; _g < _h.length; _g++) { + var timeline = _h[_g]; + var index = this._boneTimelines.indexOf(timeline); + if (index >= 0) { + this._boneTimelines.splice(index, 1); + timeline.returnToPool(); + } + index = this._boneBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._boneBlendTimelines.splice(index, 1); + timeline.returnToPool(); + } + } + } + } + { + var slotTimelines = {}; + var ffdFlags = []; + // Create slot timelines map. + for (var _j = 0, _k = this._slotTimelines; _j < _k.length; _j++) { + var timeline = _k[_j]; + var timelineName = timeline.target.name; + if (!(timelineName in slotTimelines)) { + slotTimelines[timelineName] = []; + } + slotTimelines[timelineName].push(timeline); + } + for (var _l = 0, _m = this._slotBlendTimelines; _l < _m.length; _l++) { + var timeline = _m[_l]; + var timelineName = timeline.target.target.name; + if (!(timelineName in slotTimelines)) { + slotTimelines[timelineName] = []; + } + slotTimelines[timelineName].push(timeline); + } + // + for (var _o = 0, _p = this._armature.getSlots(); _o < _p.length; _o++) { + var slot = _p[_o]; + var boneName = slot.parent.name; + if (!this.containsBoneMask(boneName)) { + continue; + } + var timelineName = slot.name; + if (timelineName in slotTimelines) { + delete slotTimelines[timelineName]; + } + else { + var displayIndexFlag = false; + var colorFlag = false; + ffdFlags.length = 0; + var timelineDatas = this._animationData.getSlotTimelines(timelineName); + if (timelineDatas !== null) { + for (var _q = 0, timelineDatas_3 = timelineDatas; _q < timelineDatas_3.length; _q++) { + var timelineData = timelineDatas_3[_q]; + switch (timelineData.type) { + case 20 /* SlotDisplay */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, timelineData); + this._slotTimelines.push(timeline); + displayIndexFlag = true; + break; + } + case 23 /* SlotZIndex */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotZIndexTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_Z_INDEX, slot.name, slot); + timeline.init(this._armature, this, timelineData); + this._slotBlendTimelines.push(timeline); + break; + } + case 21 /* SlotColor */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, timelineData); + this._slotTimelines.push(timeline); + colorFlag = true; + break; + } + case 22 /* SlotDeform */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot); + timeline.init(this._armature, this, timelineData); + if (timeline.target !== null) { + this._slotBlendTimelines.push(timeline); + ffdFlags.push(timeline.geometryOffset); + } + else { + timeline.returnToPool(); + } + break; + } + case 24 /* SlotAlpha */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_ALPHA, slot.name, slot); + timeline.init(this._armature, this, timelineData); + this._slotBlendTimelines.push(timeline); + break; + } + default: + break; + } + } + } + if (this.resetToPose) { + if (!displayIndexFlag) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, null); + this._slotTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + if (!colorFlag) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, null); + this._slotTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayFrame = slot.getDisplayFrameAt(i); + if (displayFrame.deformVertices.length === 0) { + continue; + } + var geometryData = displayFrame.getGeometryData(); + if (geometryData !== null && ffdFlags.indexOf(geometryData.offset) < 0) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState); + timeline.geometryOffset = geometryData.offset; // + timeline.displayFrame = displayFrame; // + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot); + timeline.init(this._armature, this, null); + this._slotBlendTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + } + } + for (var k in slotTimelines) { + for (var _r = 0, _s = slotTimelines[k]; _r < _s.length; _r++) { + var timeline = _s[_r]; + var index = this._slotTimelines.indexOf(timeline); + if (index >= 0) { + this._slotTimelines.splice(index, 1); + timeline.returnToPool(); + } + index = this._slotBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._slotBlendTimelines.splice(index, 1); + timeline.returnToPool(); + } + } + } + } + }; + AnimationState.prototype._advanceFadeTime = function (passedTime) { + var isFadeOut = this._fadeState > 0; + if (this._subFadeState < 0) { + this._subFadeState = 0; + var eventActive = this._parent === null && this.actionEnabled; + if (eventActive) { + var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN; + if (this._armature.eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = eventType; + eventObject.armature = this._armature; + eventObject.animationState = this; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + if (passedTime < 0.0) { + passedTime = -passedTime; + } + this._fadeTime += passedTime; + if (this._fadeTime >= this.fadeTotalTime) { + this._subFadeState = 1; + this._fadeProgress = isFadeOut ? 0.0 : 1.0; + } + else if (this._fadeTime > 0.0) { + this._fadeProgress = isFadeOut ? (1.0 - this._fadeTime / this.fadeTotalTime) : (this._fadeTime / this.fadeTotalTime); + } + else { + this._fadeProgress = isFadeOut ? 1.0 : 0.0; + } + if (this._subFadeState > 0) { + if (!isFadeOut) { + this._playheadState |= 1; // x1 + this._fadeState = 0; + } + var eventActive = this._parent === null && this.actionEnabled; + if (eventActive) { + var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE; + if (this._armature.eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = eventType; + eventObject.armature = this._armature; + eventObject.animationState = this; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + }; + /** + * @internal + */ + AnimationState.prototype.init = function (armature, animationData, animationConfig) { + if (this._armature !== null) { + return; + } + this._armature = armature; + this._animationData = animationData; + // + this.resetToPose = animationConfig.resetToPose; + this.additive = animationConfig.additive; + this.displayControl = animationConfig.displayControl; + this.actionEnabled = animationConfig.actionEnabled; + this.blendType = animationData.blendType; + this.layer = animationConfig.layer; + this.playTimes = animationConfig.playTimes; + this.timeScale = animationConfig.timeScale; + this.fadeTotalTime = animationConfig.fadeInTime; + this.autoFadeOutTime = animationConfig.autoFadeOutTime; + this.name = animationConfig.name.length > 0 ? animationConfig.name : animationConfig.animation; + this.group = animationConfig.group; + // + this._weight = animationConfig.weight; + if (animationConfig.pauseFadeIn) { + this._playheadState = 2; // 10 + } + else { + this._playheadState = 3; // 11 + } + if (animationConfig.duration < 0.0) { + this._position = 0.0; + this._duration = this._animationData.duration; + if (animationConfig.position !== 0.0) { + if (this.timeScale >= 0.0) { + this._time = animationConfig.position; + } + else { + this._time = animationConfig.position - this._duration; + } + } + else { + this._time = 0.0; + } + } + else { + this._position = animationConfig.position; + this._duration = animationConfig.duration; + this._time = 0.0; + } + if (this.timeScale < 0.0 && this._time === 0.0) { + this._time = -0.000001; // Turn to end. + } + if (this.fadeTotalTime <= 0.0) { + this._fadeProgress = 0.999999; // Make different. + } + if (animationConfig.boneMask.length > 0) { + this._boneMask.length = animationConfig.boneMask.length; + for (var i = 0, l = this._boneMask.length; i < l; ++i) { + this._boneMask[i] = animationConfig.boneMask[i]; + } + } + this._actionTimeline = dragonBones.BaseObject.borrowObject(dragonBones.ActionTimelineState); + this._actionTimeline.init(this._armature, this, this._animationData.actionTimeline); + this._actionTimeline.currentTime = this._time; + if (this._actionTimeline.currentTime < 0.0) { + this._actionTimeline.currentTime = this._duration - this._actionTimeline.currentTime; + } + if (this._animationData.zOrderTimeline !== null) { + this._zOrderTimeline = dragonBones.BaseObject.borrowObject(dragonBones.ZOrderTimelineState); + this._zOrderTimeline.init(this._armature, this, this._animationData.zOrderTimeline); + } + }; + /** + * @internal + */ + AnimationState.prototype.advanceTime = function (passedTime, cacheFrameRate) { + // Update fade time. + if (this._fadeState !== 0 || this._subFadeState !== 0) { + this._advanceFadeTime(passedTime); + } + // Update time. + if (this._playheadState === 3) { + if (this.timeScale !== 1.0) { + passedTime *= this.timeScale; + } + this._time += passedTime; + } + // Update timeline. + if (this._timelineDirty !== 0) { + if (this._timelineDirty === 2) { + this._updateTimelines(); + } + this._timelineDirty = 0; + this._updateBoneAndSlotTimelines(); + } + var isBlendDirty = this._fadeState !== 0 || this._subFadeState === 0; + var isCacheEnabled = this._fadeState === 0 && cacheFrameRate > 0.0; + var isUpdateTimeline = true; + var isUpdateBoneTimeline = true; + var time = this._time; + this._weightResult = this._weight * this._fadeProgress; + if (this._parent !== null) { + this._weightResult *= this._parent._weightResult; + } + if (this._actionTimeline.playState <= 0) { + this._actionTimeline.update(time); + } + if (this._weight === 0.0) { + return; + } + if (isCacheEnabled) { + var internval = cacheFrameRate * 2.0; + this._actionTimeline.currentTime = Math.floor(this._actionTimeline.currentTime * internval) / internval; + } + if (this._zOrderTimeline !== null && this._zOrderTimeline.playState <= 0) { + this._zOrderTimeline.update(time); + } + if (isCacheEnabled) { + var cacheFrameIndex = Math.floor(this._actionTimeline.currentTime * cacheFrameRate); // uint + if (this._armature._cacheFrameIndex === cacheFrameIndex) { + isUpdateTimeline = false; + isUpdateBoneTimeline = false; + } + else { + this._armature._cacheFrameIndex = cacheFrameIndex; + if (this._animationData.cachedFrames[cacheFrameIndex]) { + isUpdateBoneTimeline = false; + } + else { + this._animationData.cachedFrames[cacheFrameIndex] = true; + } + } + } + if (isUpdateTimeline) { + var isBlend = false; + var prevTarget = null; // + if (isUpdateBoneTimeline) { + for (var i = 0, l = this._boneTimelines.length; i < l; ++i) { + var timeline = this._boneTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (timeline.target !== prevTarget) { + var blendState = timeline.target; + isBlend = blendState.update(this); + prevTarget = blendState; + if (blendState.dirty === 1) { + var pose = blendState.target.animationPose; + pose.x = 0.0; + pose.y = 0.0; + pose.rotation = 0.0; + pose.skew = 0.0; + pose.scaleX = 1.0; + pose.scaleY = 1.0; + } + } + if (isBlend) { + timeline.blend(isBlendDirty); + } + } + } + for (var i = 0, l = this._boneBlendTimelines.length; i < l; ++i) { + var timeline = this._boneBlendTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (timeline.target.update(this)) { + timeline.blend(isBlendDirty); + } + } + if (this.displayControl) { + for (var i = 0, l = this._slotTimelines.length; i < l; ++i) { + var timeline = this._slotTimelines[i]; + if (timeline.playState <= 0) { + var slot = timeline.target; + var displayController = slot.displayController; + if (displayController === null || + displayController === this.name || + displayController === this.group) { + timeline.update(time); + } + } + } + } + for (var i = 0, l = this._slotBlendTimelines.length; i < l; ++i) { + var timeline = this._slotBlendTimelines[i]; + if (timeline.playState <= 0) { + var blendState = timeline.target; + timeline.update(time); + if (blendState.update(this)) { + timeline.blend(isBlendDirty); + } + } + } + for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) { + var timeline = this._constraintTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + } + if (this._animationTimelines.length > 0) { + var dL = 100.0; + var dR = 100.0; + var leftState = null; + var rightState = null; + for (var i = 0, l = this._animationTimelines.length; i < l; ++i) { + var timeline = this._animationTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (this.blendType === 1 /* E1D */) { + var animationState = timeline.target; + var d = this.parameterX - animationState.positionX; + if (d >= 0.0) { + if (d < dL) { + dL = d; + leftState = animationState; + } + } + else { + if (-d < dR) { + dR = -d; + rightState = animationState; + } + } + } + } + if (leftState !== null) { + if (this._activeChildA !== leftState) { + if (this._activeChildA !== null) { + this._activeChildA.weight = 0.0; + } + this._activeChildA = leftState; + this._activeChildA.activeTimeline(); + } + if (this._activeChildB !== rightState) { + if (this._activeChildB !== null) { + this._activeChildB.weight = 0.0; + } + this._activeChildB = rightState; + } + leftState.weight = dR / (dL + dR); + if (rightState) { + rightState.weight = 1.0 - leftState.weight; + } + } + } + } + if (this._fadeState === 0) { + if (this._subFadeState > 0) { + this._subFadeState = 0; + if (this._poseTimelines.length > 0) { + for (var _i = 0, _a = this._poseTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + var index = this._boneTimelines.indexOf(timeline); + if (index >= 0) { + this._boneTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._boneBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._boneBlendTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._slotTimelines.indexOf(timeline); + if (index >= 0) { + this._slotTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._slotBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._slotBlendTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._constraintTimelines.indexOf(timeline); + if (index >= 0) { + this._constraintTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + } + this._poseTimelines.length = 0; + } + } + if (this._actionTimeline.playState > 0) { + if (this.autoFadeOutTime >= 0.0) { + this.fadeOut(this.autoFadeOutTime); + } + } + } + }; + /** + * - Continue play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 继续播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.play = function () { + this._playheadState = 3; // 11 + }; + /** + * - Stop play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.stop = function () { + this._playheadState &= 1; // 0x + }; + /** + * - Fade out the animation state. + * @param fadeOutTime - The fade out time. (In seconds) + * @param pausePlayhead - Whether to pause the animation playing when fade out. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 淡出动画状态。 + * @param fadeOutTime - 淡出时间。 (以秒为单位) + * @param pausePlayhead - 淡出时是否暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.fadeOut = function (fadeOutTime, pausePlayhead) { + if (pausePlayhead === void 0) { pausePlayhead = true; } + if (fadeOutTime < 0.0) { + fadeOutTime = 0.0; + } + if (pausePlayhead) { + this._playheadState &= 2; // x0 + } + if (this._fadeState > 0) { + if (fadeOutTime > this.fadeTotalTime - this._fadeTime) { + return; + } + } + else { + this._fadeState = 1; + this._subFadeState = -1; + if (fadeOutTime <= 0.0 || this._fadeProgress <= 0.0) { + this._fadeProgress = 0.000001; // Modify fade progress to different value. + } + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.fadeOut(); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.fadeOut(); + } + for (var _d = 0, _e = this._slotTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.fadeOut(); + } + for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.fadeOut(); + } + for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) { + var timeline = _j[_h]; + timeline.fadeOut(); + } + for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) { + var timeline = _l[_k]; + timeline.fadeOut(); + // + var animaitonState = timeline.target; + animaitonState.fadeOut(999999.0, true); + } + } + this.displayControl = false; // + this.fadeTotalTime = this._fadeProgress > 0.000001 ? fadeOutTime / this._fadeProgress : 0.0; + this._fadeTime = this.fadeTotalTime * (1.0 - this._fadeProgress); + }; + /** + * - Check if a specific bone mask is included. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.containsBoneMask = function (boneName) { + return this._boneMask.length === 0 || this._boneMask.indexOf(boneName) >= 0; + }; + /** + * - Add a specific bone mask. + * @param boneName - The bone name. + * @param recursive - Whether or not to add a mask to the bone's sub-bone. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加特定的骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.addBoneMask = function (boneName, recursive) { + if (recursive === void 0) { recursive = true; } + var currentBone = this._armature.getBone(boneName); + if (currentBone === null) { + return; + } + if (this._boneMask.indexOf(boneName) < 0) { + this._boneMask.push(boneName); + } + if (recursive) { + for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { + var bone = _a[_i]; + if (this._boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) { + this._boneMask.push(bone.name); + } + } + } + this._timelineDirty = 1; + }; + /** + * - Remove the mask of a specific bone. + * @param boneName - The bone name. + * @param recursive - Whether to remove the bone's sub-bone mask. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除特定骨骼的遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.removeBoneMask = function (boneName, recursive) { + if (recursive === void 0) { recursive = true; } + var index = this._boneMask.indexOf(boneName); + if (index >= 0) { + this._boneMask.splice(index, 1); + } + if (recursive) { + var currentBone = this._armature.getBone(boneName); + if (currentBone !== null) { + var bones = this._armature.getBones(); + if (this._boneMask.length > 0) { + for (var _i = 0, bones_1 = bones; _i < bones_1.length; _i++) { + var bone = bones_1[_i]; + var index_1 = this._boneMask.indexOf(bone.name); + if (index_1 >= 0 && currentBone.contains(bone)) { + this._boneMask.splice(index_1, 1); + } + } + } + else { + for (var _a = 0, bones_2 = bones; _a < bones_2.length; _a++) { + var bone = bones_2[_a]; + if (bone === currentBone) { + continue; + } + if (!currentBone.contains(bone)) { + this._boneMask.push(bone.name); + } + } + } + } + } + this._timelineDirty = 1; + }; + /** + * - Remove all bone masks. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.removeAllBoneMask = function () { + this._boneMask.length = 0; + this._timelineDirty = 1; + }; + /** + * @private + */ + AnimationState.prototype.addState = function (animationState, timelineDatas) { + if (timelineDatas === void 0) { timelineDatas = null; } + if (timelineDatas !== null) { + for (var _i = 0, timelineDatas_4 = timelineDatas; _i < timelineDatas_4.length; _i++) { + var timelineData = timelineDatas_4[_i]; + switch (timelineData.type) { + case 40 /* AnimationProgress */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationProgressTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + if (this.blendType !== 0 /* None */) { + var animaitonTimelineData = timelineData; + animationState.positionX = animaitonTimelineData.x; + animationState.positionY = animaitonTimelineData.y; + animationState.weight = 0.0; + } + animationState._parent = this; + this.resetToPose = false; + break; + } + case 41 /* AnimationWeight */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationWeightTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + break; + } + case 42 /* AnimationParameter */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationParametersTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + break; + } + default: + break; + } + } + } + if (animationState._parent === null) { + animationState._parent = this; + } + }; + /** + * @internal + */ + AnimationState.prototype.activeTimeline = function () { + for (var _i = 0, _a = this._slotTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.dirty = true; + timeline.currentTime = -1.0; + } + }; + Object.defineProperty(AnimationState.prototype, "isFadeIn", { + /** + * - Whether the animation state is fading in. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡入。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState < 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isFadeOut", { + /** + * - Whether the animation state is fading out. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡出。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isFadeComplete", { + /** + * - Whether the animation state is fade completed. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否淡入或淡出完毕。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState === 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isPlaying", { + /** + * - Whether the animation state is playing. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否正在播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return (this._playheadState & 2) !== 0 && this._actionTimeline.playState <= 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isCompleted", { + /** + * - Whether the animation state is play completed. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否播放完毕。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.playState > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "currentPlayTimes", { + /** + * - The times has been played. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 已经循环播放的次数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.currentPlayTimes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "totalTime", { + /** + * - The total time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 总播放时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._duration; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "currentTime", { + /** + * - The time is currently playing. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前播放的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.currentTime; + }, + set: function (value) { + var currentPlayTimes = this._actionTimeline.currentPlayTimes - (this._actionTimeline.playState > 0 ? 1 : 0); + if (value < 0 || this._duration < value) { + value = (value % this._duration) + currentPlayTimes * this._duration; + if (value < 0) { + value += this._duration; + } + } + if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 && + value === this._duration && this._parent === null) { + value = this._duration - 0.000001; // + } + if (this._time === value) { + return; + } + this._time = value; + this._actionTimeline.setCurrentTime(this._time); + if (this._zOrderTimeline !== null) { + this._zOrderTimeline.playState = -1; + } + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.playState = -1; + } + for (var _b = 0, _c = this._slotTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.playState = -1; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "weight", { + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + /** + * - The animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + get: function () { + return this._weight; + }, + set: function (value) { + if (this._weight === value) { + return; + } + this._weight = value; + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.dirty = true; + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.dirty = true; + } + for (var _d = 0, _e = this._slotBlendTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.dirty = true; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "animationData", { + /** + * - 动画数据。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._animationData; + }, + enumerable: true, + configurable: true + }); + return AnimationState; + }(dragonBones.BaseObject)); + dragonBones.AnimationState = AnimationState; + /** + * @internal + */ + var BlendState = (function (_super) { + __extends(BlendState, _super); + function BlendState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlendState.toString = function () { + return "[class dragonBones.BlendState]"; + }; + BlendState.prototype._onClear = function () { + this.reset(); + this.target = null; + }; + BlendState.prototype.update = function (animationState) { + var animationLayer = animationState.layer; + var animationWeight = animationState._weightResult; + if (this.dirty > 0) { + if (this.leftWeight > 0.0) { + if (this.layer !== animationLayer) { + if (this.layerWeight >= this.leftWeight) { + this.dirty++; + this.layer = animationLayer; + this.leftWeight = 0.0; + this.blendWeight = 0.0; + return false; + } + this.layer = animationLayer; + this.leftWeight -= this.layerWeight; + this.layerWeight = 0.0; + } + animationWeight *= this.leftWeight; + this.dirty++; + this.blendWeight = animationWeight; + this.layerWeight += this.blendWeight; + return true; + } + return false; + } + this.dirty++; + this.layer = animationLayer; + this.leftWeight = 1.0; + this.blendWeight = animationWeight; + this.layerWeight = animationWeight; + return true; + }; + BlendState.prototype.reset = function () { + this.dirty = 0; + this.layer = 0; + this.leftWeight = 0.0; + this.layerWeight = 0.0; + this.blendWeight = 0.0; + }; + BlendState.BONE_TRANSFORM = "boneTransform"; + BlendState.BONE_ALPHA = "boneAlpha"; + BlendState.SURFACE = "surface"; + BlendState.SLOT_DEFORM = "slotDeform"; + BlendState.SLOT_ALPHA = "slotAlpha"; + BlendState.SLOT_Z_INDEX = "slotZIndex"; + return BlendState; + }(dragonBones.BaseObject)); + dragonBones.BlendState = BlendState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var TimelineState = (function (_super) { + __extends(TimelineState, _super); + function TimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimelineState.prototype._onClear = function () { + this.dirty = false; + this.playState = -1; + this.currentPlayTimes = -1; + this.currentTime = -1.0; + this.target = null; + this._isTween = false; + this._valueOffset = 0; + this._frameValueOffset = 0; + this._frameOffset = 0; + this._frameRate = 0; + this._frameCount = 0; + this._frameIndex = -1; + this._frameRateR = 0.0; + this._position = 0.0; + this._duration = 0.0; + this._timeScale = 1.0; + this._timeOffset = 0.0; + this._animationData = null; // + this._timelineData = null; // + this._armature = null; // + this._animationState = null; // + this._actionTimeline = null; // + this._frameArray = null; // + this._valueArray = null; // + this._timelineArray = null; // + this._frameIndices = null; // + }; + TimelineState.prototype._setCurrentTime = function (passedTime) { + var prevState = this.playState; + var prevPlayTimes = this.currentPlayTimes; + var prevTime = this.currentTime; + if (this._actionTimeline !== null && this._frameCount <= 1) { + this.playState = this._actionTimeline.playState >= 0 ? 1 : -1; + this.currentPlayTimes = 1; + this.currentTime = this._actionTimeline.currentTime; + } + else if (this._actionTimeline === null || this._timeScale !== 1.0 || this._timeOffset !== 0.0) { + var playTimes = this._animationState.playTimes; + var totalTime = playTimes * this._duration; + passedTime *= this._timeScale; + if (this._timeOffset !== 0.0) { + passedTime += this._timeOffset * this._animationData.duration; + } + if (playTimes > 0 && (passedTime >= totalTime || passedTime <= -totalTime)) { + if (this.playState <= 0 && this._animationState._playheadState === 3) { + this.playState = 1; + } + this.currentPlayTimes = playTimes; + if (passedTime < 0.0) { + this.currentTime = 0.0; + } + else { + this.currentTime = this.playState === 1 ? this._duration + 0.000001 : this._duration; // Precision problem + } + } + else { + if (this.playState !== 0 && this._animationState._playheadState === 3) { + this.playState = 0; + } + if (passedTime < 0.0) { + passedTime = -passedTime; + this.currentPlayTimes = Math.floor(passedTime / this._duration); + this.currentTime = this._duration - (passedTime % this._duration); + } + else { + this.currentPlayTimes = Math.floor(passedTime / this._duration); + this.currentTime = passedTime % this._duration; + } + } + this.currentTime += this._position; + } + else { + this.playState = this._actionTimeline.playState; + this.currentPlayTimes = this._actionTimeline.currentPlayTimes; + this.currentTime = this._actionTimeline.currentTime; + } + if (this.currentPlayTimes === prevPlayTimes && this.currentTime === prevTime) { + return false; + } + // Clear frame flag when timeline start or loopComplete. + if ((prevState < 0 && this.playState !== prevState) || + (this.playState <= 0 && this.currentPlayTimes !== prevPlayTimes)) { + this._frameIndex = -1; + } + return true; + }; + TimelineState.prototype.init = function (armature, animationState, timelineData) { + this._armature = armature; + this._animationState = animationState; + this._timelineData = timelineData; + this._actionTimeline = this._animationState._actionTimeline; + if (this === this._actionTimeline) { + this._actionTimeline = null; // + } + this._animationData = this._animationState.animationData; + // + this._frameRate = this._animationData.parent.frameRate; + this._frameRateR = 1.0 / this._frameRate; + this._position = this._animationState._position; + this._duration = this._animationState._duration; + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data. + this._frameArray = dragonBonesData.frameArray; + this._timelineArray = dragonBonesData.timelineArray; + this._frameIndices = dragonBonesData.frameIndices; + // + this._frameCount = this._timelineArray[this._timelineData.offset + 2 /* TimelineKeyFrameCount */]; + this._frameValueOffset = this._timelineArray[this._timelineData.offset + 4 /* TimelineFrameValueOffset */]; + this._timeScale = 100.0 / this._timelineArray[this._timelineData.offset + 0 /* TimelineScale */]; + this._timeOffset = this._timelineArray[this._timelineData.offset + 1 /* TimelineOffset */] * 0.01; + } + }; + TimelineState.prototype.fadeOut = function () { + this.dirty = false; + }; + TimelineState.prototype.update = function (passedTime) { + if (this._setCurrentTime(passedTime)) { + if (this._frameCount > 1) { + var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint + var frameIndex = this._frameIndices[this._timelineData.frameIndicesOffset + timelineFrameIndex]; + if (this._frameIndex !== frameIndex) { + this._frameIndex = frameIndex; + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex]; + this._onArriveAtFrame(); + } + } + else if (this._frameIndex < 0) { + this._frameIndex = 0; + if (this._timelineData !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */]; + } + this._onArriveAtFrame(); + } + if (this._isTween || this.dirty) { + this._onUpdateFrame(); + } + } + }; + TimelineState.prototype.blend = function (_isDirty) { + }; + return TimelineState; + }(dragonBones.BaseObject)); + dragonBones.TimelineState = TimelineState; + /** + * @internal + */ + var TweenTimelineState = (function (_super) { + __extends(TweenTimelineState, _super); + function TweenTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + TweenTimelineState._getEasingValue = function (tweenType, progress, easing) { + var value = progress; + switch (tweenType) { + case 3 /* QuadIn */: + value = Math.pow(progress, 2.0); + break; + case 4 /* QuadOut */: + value = 1.0 - Math.pow(1.0 - progress, 2.0); + break; + case 5 /* QuadInOut */: + value = 0.5 * (1.0 - Math.cos(progress * Math.PI)); + break; + } + return (value - progress) * easing + progress; + }; + TweenTimelineState._getEasingCurveValue = function (progress, samples, count, offset) { + if (progress <= 0.0) { + return 0.0; + } + else if (progress >= 1.0) { + return 1.0; + } + var isOmited = count > 0; + var segmentCount = count + 1; // + 2 - 1 + var valueIndex = Math.floor(progress * segmentCount); + var fromValue = 0.0; + var toValue = 0.0; + if (isOmited) { + fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1]; + toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex]; + } + else { + fromValue = samples[offset + valueIndex - 1]; + toValue = samples[offset + valueIndex]; + } + return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001; + }; + TweenTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._tweenType = 0 /* None */; + this._curveCount = 0; + this._framePosition = 0.0; + this._frameDurationR = 0.0; + this._tweenEasing = 0.0; + this._tweenProgress = 0.0; + this._valueScale = 1.0; + }; + TweenTimelineState.prototype._onArriveAtFrame = function () { + if (this._frameCount > 1 && + (this._frameIndex !== this._frameCount - 1 || + this._animationState.playTimes === 0 || + this._animationState.currentPlayTimes < this._animationState.playTimes - 1)) { + this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */]; + this._isTween = this._tweenType !== 0 /* None */; + if (this._isTween) { + if (this._tweenType === 2 /* Curve */) { + this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */]; + } + else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) { + this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01; + } + } + else { + this.dirty = true; + } + this._framePosition = this._frameArray[this._frameOffset] * this._frameRateR; + if (this._frameIndex === this._frameCount - 1) { + this._frameDurationR = 1.0 / (this._animationData.duration - this._framePosition); + } + else { + var nextFrameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex + 1]; + var frameDuration = this._frameArray[nextFrameOffset] * this._frameRateR - this._framePosition; + if (frameDuration > 0) { + this._frameDurationR = 1.0 / frameDuration; + } + else { + this._frameDurationR = 0.0; + } + } + } + else { + this.dirty = true; + this._isTween = false; + } + }; + TweenTimelineState.prototype._onUpdateFrame = function () { + if (this._isTween) { + this.dirty = true; + this._tweenProgress = (this.currentTime - this._framePosition) * this._frameDurationR; + if (this._tweenType === 2 /* Curve */) { + this._tweenProgress = TweenTimelineState._getEasingCurveValue(this._tweenProgress, this._frameArray, this._curveCount, this._frameOffset + 3 /* FrameCurveSamples */); + } + else if (this._tweenType !== 1 /* Line */) { + this._tweenProgress = TweenTimelineState._getEasingValue(this._tweenType, this._tweenProgress, this._tweenEasing); + } + } + }; + return TweenTimelineState; + }(TimelineState)); + dragonBones.TweenTimelineState = TweenTimelineState; + /** + * @internal + */ + var SingleValueTimelineState = (function (_super) { + __extends(SingleValueTimelineState, _super); + function SingleValueTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SingleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._current = 0.0; + this._difference = 0.0; + this._result = 0.0; + }; + SingleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + 1; + if (valueScale === 1.0) { + this._current = valueArray[valueOffset]; + this._difference = valueArray[nextValueOffset] - this._current; + } + else { + this._current = valueArray[valueOffset] * valueScale; + this._difference = valueArray[nextValueOffset] * valueScale - this._current; + } + } + else { + this._result = valueArray[valueOffset] * valueScale; + } + } + else { + this._result = 0.0; + } + }; + SingleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._result = this._current + this._difference * this._tweenProgress; + } + }; + return SingleValueTimelineState; + }(TweenTimelineState)); + dragonBones.SingleValueTimelineState = SingleValueTimelineState; + /** + * @internal + */ + var DoubleValueTimelineState = (function (_super) { + __extends(DoubleValueTimelineState, _super); + function DoubleValueTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + DoubleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._currentA = 0.0; + this._currentB = 0.0; + this._differenceA = 0.0; + this._differenceB = 0.0; + this._resultA = 0.0; + this._resultB = 0.0; + }; + DoubleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * 2; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + 2; + if (valueScale === 1.0) { + this._currentA = valueArray[valueOffset]; + this._currentB = valueArray[valueOffset + 1]; + this._differenceA = valueArray[nextValueOffset] - this._currentA; + this._differenceB = valueArray[nextValueOffset + 1] - this._currentB; + } + else { + this._currentA = valueArray[valueOffset] * valueScale; + this._currentB = valueArray[valueOffset + 1] * valueScale; + this._differenceA = valueArray[nextValueOffset] * valueScale - this._currentA; + this._differenceB = valueArray[nextValueOffset + 1] * valueScale - this._currentB; + } + } + else { + this._resultA = valueArray[valueOffset] * valueScale; + this._resultB = valueArray[valueOffset + 1] * valueScale; + } + } + else { + this._resultA = 0.0; + this._resultB = 0.0; + } + }; + DoubleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._resultA = this._currentA + this._differenceA * this._tweenProgress; + this._resultB = this._currentB + this._differenceB * this._tweenProgress; + } + }; + return DoubleValueTimelineState; + }(TweenTimelineState)); + dragonBones.DoubleValueTimelineState = DoubleValueTimelineState; + /** + * @internal + */ + var MutilpleValueTimelineState = (function (_super) { + __extends(MutilpleValueTimelineState, _super); + function MutilpleValueTimelineState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._rd = []; + return _this; + } + MutilpleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._valueCount = 0; + this._rd.length = 0; + }; + MutilpleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + var valueCount = this._valueCount; + var rd = this._rd; + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + valueCount; + if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[valueCount + i] = valueArray[nextValueOffset + i] - valueArray[valueOffset + i]; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[valueCount + i] = (valueArray[nextValueOffset + i] - valueArray[valueOffset + i]) * valueScale; + } + } + } + else if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i]; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] * valueScale; + } + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = 0.0; + } + } + }; + MutilpleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + var valueCount = this._valueCount; + var valueScale = this._valueScale; + var tweenProgress = this._tweenProgress; + var valueArray = this._valueArray; + var rd = this._rd; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount; + if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] + rd[valueCount + i] * tweenProgress; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] * valueScale + rd[valueCount + i] * tweenProgress; + } + } + } + }; + return MutilpleValueTimelineState; + }(TweenTimelineState)); + dragonBones.MutilpleValueTimelineState = MutilpleValueTimelineState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var ActionTimelineState = (function (_super) { + __extends(ActionTimelineState, _super); + function ActionTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + ActionTimelineState.toString = function () { + return "[class dragonBones.ActionTimelineState]"; + }; + ActionTimelineState.prototype._onCrossFrame = function (frameIndex) { + var eventDispatcher = this._armature.eventDispatcher; + if (this._animationState.actionEnabled) { + var frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + frameIndex]; + var actionCount = this._frameArray[frameOffset + 1]; + var actions = this._animationData.parent.actions; // May be the animaton data not belong to this armature data. + for (var i = 0; i < actionCount; ++i) { + var actionIndex = this._frameArray[frameOffset + 2 + i]; + var action = actions[actionIndex]; + if (action.type === 0 /* Play */) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + // eventObject.time = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + eventObject.time = this._frameArray[frameOffset] / this._frameRate; + eventObject.animationState = this._animationState; + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + this._armature._bufferAction(eventObject, true); + } + else { + var eventType = action.type === 10 /* Frame */ ? dragonBones.EventObject.FRAME_EVENT : dragonBones.EventObject.SOUND_EVENT; + if (action.type === 11 /* Sound */ || eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + // eventObject.time = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + eventObject.time = this._frameArray[frameOffset] / this._frameRate; + eventObject.animationState = this._animationState; + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + } + }; + ActionTimelineState.prototype._onArriveAtFrame = function () { }; + ActionTimelineState.prototype._onUpdateFrame = function () { }; + ActionTimelineState.prototype.update = function (passedTime) { + var prevState = this.playState; + var prevPlayTimes = this.currentPlayTimes; + var prevTime = this.currentTime; + if (this._setCurrentTime(passedTime)) { + var eventActive = this._animationState._parent === null && this._animationState.actionEnabled; + var eventDispatcher = this._armature.eventDispatcher; + if (prevState < 0) { + if (this.playState !== prevState) { + if (this._animationState.displayControl && this._animationState.resetToPose) { + this._armature._sortZOrder(null, 0); + } + prevPlayTimes = this.currentPlayTimes; + if (eventActive && eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = dragonBones.EventObject.START; + eventObject.armature = this._armature; + eventObject.animationState = this._animationState; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + else { + return; + } + } + var isReverse = this._animationState.timeScale < 0.0; + var loopCompleteEvent = null; + var completeEvent = null; + if (eventActive && this.currentPlayTimes !== prevPlayTimes) { + if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.LOOP_COMPLETE)) { + loopCompleteEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + loopCompleteEvent.type = dragonBones.EventObject.LOOP_COMPLETE; + loopCompleteEvent.armature = this._armature; + loopCompleteEvent.animationState = this._animationState; + } + if (this.playState > 0) { + if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.COMPLETE)) { + completeEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + completeEvent.type = dragonBones.EventObject.COMPLETE; + completeEvent.armature = this._armature; + completeEvent.animationState = this._animationState; + } + } + } + if (this._frameCount > 1) { + var timelineData = this._timelineData; + var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint + var frameIndex = this._frameIndices[timelineData.frameIndicesOffset + timelineFrameIndex]; + if (this._frameIndex !== frameIndex) { + var crossedFrameIndex = this._frameIndex; + this._frameIndex = frameIndex; + if (this._timelineArray !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex]; + if (isReverse) { + if (crossedFrameIndex < 0) { + var prevFrameIndex = Math.floor(prevTime * this._frameRate); + crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex]; + if (this.currentPlayTimes === prevPlayTimes) { + if (crossedFrameIndex === frameIndex) { + crossedFrameIndex = -1; + } + } + } + while (crossedFrameIndex >= 0) { + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this._position <= framePosition && + framePosition <= this._position + this._duration) { + this._onCrossFrame(crossedFrameIndex); + } + if (loopCompleteEvent !== null && crossedFrameIndex === 0) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + if (crossedFrameIndex > 0) { + crossedFrameIndex--; + } + else { + crossedFrameIndex = this._frameCount - 1; + } + if (crossedFrameIndex === frameIndex) { + break; + } + } + } + else { + if (crossedFrameIndex < 0) { + var prevFrameIndex = Math.floor(prevTime * this._frameRate); + crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex]; + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this.currentPlayTimes === prevPlayTimes) { + if (prevTime <= framePosition) { + if (crossedFrameIndex > 0) { + crossedFrameIndex--; + } + else { + crossedFrameIndex = this._frameCount - 1; + } + } + else if (crossedFrameIndex === frameIndex) { + crossedFrameIndex = -1; + } + } + } + while (crossedFrameIndex >= 0) { + if (crossedFrameIndex < this._frameCount - 1) { + crossedFrameIndex++; + } + else { + crossedFrameIndex = 0; + } + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this._position <= framePosition && + framePosition <= this._position + this._duration // + ) { + this._onCrossFrame(crossedFrameIndex); + } + if (loopCompleteEvent !== null && crossedFrameIndex === 0) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + if (crossedFrameIndex === frameIndex) { + break; + } + } + } + } + } + } + else if (this._frameIndex < 0) { + this._frameIndex = 0; + if (this._timelineData !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */]; + // Arrive at frame. + var framePosition = this._frameArray[this._frameOffset] / this._frameRate; + if (this.currentPlayTimes === prevPlayTimes) { + if (prevTime <= framePosition) { + this._onCrossFrame(this._frameIndex); + } + } + else if (this._position <= framePosition) { + if (!isReverse && loopCompleteEvent !== null) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + this._onCrossFrame(this._frameIndex); + } + } + } + if (loopCompleteEvent !== null) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + } + if (completeEvent !== null) { + this._armature._dragonBones.bufferEvent(completeEvent); + } + } + }; + ActionTimelineState.prototype.setCurrentTime = function (value) { + this._setCurrentTime(value); + this._frameIndex = -1; + }; + return ActionTimelineState; + }(dragonBones.TimelineState)); + dragonBones.ActionTimelineState = ActionTimelineState; + /** + * @internal + */ + var ZOrderTimelineState = (function (_super) { + __extends(ZOrderTimelineState, _super); + function ZOrderTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + ZOrderTimelineState.toString = function () { + return "[class dragonBones.ZOrderTimelineState]"; + }; + ZOrderTimelineState.prototype._onArriveAtFrame = function () { + if (this.playState >= 0) { + var count = this._frameArray[this._frameOffset + 1]; + if (count > 0) { + this._armature._sortZOrder(this._frameArray, this._frameOffset + 2); + } + else { + this._armature._sortZOrder(null, 0); + } + } + }; + ZOrderTimelineState.prototype._onUpdateFrame = function () { }; + return ZOrderTimelineState; + }(dragonBones.TimelineState)); + dragonBones.ZOrderTimelineState = ZOrderTimelineState; + /** + * @internal + */ + var BoneAllTimelineState = (function (_super) { + __extends(BoneAllTimelineState, _super); + function BoneAllTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneAllTimelineState.toString = function () { + return "[class dragonBones.BoneAllTimelineState]"; + }; + BoneAllTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._isTween && this._frameIndex === this._frameCount - 1) { + this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]); + this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]); + } + if (this._timelineData === null) { + this._rd[4] = 1.0; + this._rd[5] = 1.0; + } + }; + BoneAllTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = 6; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneAllTimelineState.prototype.fadeOut = function () { + this.dirty = false; + this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]); + this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]); + }; + BoneAllTimelineState.prototype.blend = function (isDirty) { + var valueScale = this._armature.armatureData.scale; + var rd = this._rd; + // + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.x += rd[0] * blendWeight * valueScale; + result.y += rd[1] * blendWeight * valueScale; + result.rotation += rd[2] * blendWeight; + result.skew += rd[3] * blendWeight; + result.scaleX += (rd[4] - 1.0) * blendWeight; + result.scaleY += (rd[5] - 1.0) * blendWeight; + } + else { + result.x = rd[0] * blendWeight * valueScale; + result.y = rd[1] * blendWeight * valueScale; + result.rotation = rd[2] * blendWeight; + result.skew = rd[3] * blendWeight; + result.scaleX = (rd[4] - 1.0) * blendWeight + 1.0; // + result.scaleY = (rd[5] - 1.0) * blendWeight + 1.0; // + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneAllTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.BoneAllTimelineState = BoneAllTimelineState; + /** + * @internal + */ + var BoneTranslateTimelineState = (function (_super) { + __extends(BoneTranslateTimelineState, _super); + function BoneTranslateTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneTranslateTimelineState.toString = function () { + return "[class dragonBones.BoneTranslateTimelineState]"; + }; + BoneTranslateTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneTranslateTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.x += this._resultA * blendWeight; + result.y += this._resultB * blendWeight; + } + else if (blendWeight !== 1.0) { + result.x = this._resultA * blendWeight; + result.y = this._resultB * blendWeight; + } + else { + result.x = this._resultA; + result.y = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneTranslateTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneTranslateTimelineState = BoneTranslateTimelineState; + /** + * @internal + */ + var BoneRotateTimelineState = (function (_super) { + __extends(BoneRotateTimelineState, _super); + function BoneRotateTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneRotateTimelineState.toString = function () { + return "[class dragonBones.BoneRotateTimelineState]"; + }; + BoneRotateTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._isTween && this._frameIndex === this._frameCount - 1) { + this._differenceA = dragonBones.Transform.normalizeRadian(this._differenceA); + this._differenceB = dragonBones.Transform.normalizeRadian(this._differenceB); + } + }; + BoneRotateTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneRotateTimelineState.prototype.fadeOut = function () { + this.dirty = false; + this._resultA = dragonBones.Transform.normalizeRadian(this._resultA); + this._resultB = dragonBones.Transform.normalizeRadian(this._resultB); + }; + BoneRotateTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.rotation += this._resultA * blendWeight; + result.skew += this._resultB * blendWeight; + } + else if (blendWeight !== 1.0) { + result.rotation = this._resultA * blendWeight; + result.skew = this._resultB * blendWeight; + } + else { + result.rotation = this._resultA; + result.skew = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneRotateTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneRotateTimelineState = BoneRotateTimelineState; + /** + * @internal + */ + var BoneScaleTimelineState = (function (_super) { + __extends(BoneScaleTimelineState, _super); + function BoneScaleTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneScaleTimelineState.toString = function () { + return "[class dragonBones.BoneScaleTimelineState]"; + }; + BoneScaleTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { + this._resultA = 1.0; + this._resultB = 1.0; + } + }; + BoneScaleTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneScaleTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.scaleX += (this._resultA - 1.0) * blendWeight; + result.scaleY += (this._resultB - 1.0) * blendWeight; + } + else if (blendWeight !== 1.0) { + result.scaleX = (this._resultA - 1.0) * blendWeight + 1.0; + result.scaleY = (this._resultB - 1.0) * blendWeight + 1.0; + } + else { + result.scaleX = this._resultA; + result.scaleY = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneScaleTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneScaleTimelineState = BoneScaleTimelineState; + /** + * @internal + */ + var SurfaceTimelineState = (function (_super) { + __extends(SurfaceTimelineState, _super); + function SurfaceTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SurfaceTimelineState.toString = function () { + return "[class dragonBones.SurfaceTimelineState]"; + }; + SurfaceTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._deformCount = 0; + this._deformOffset = 0; + this._sameValueOffset = 0; + }; + SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; + var frameIntArray = dragonBonesData.frameIntArray; + var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */]; + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */]; + this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */]; + this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */]; + this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = dragonBonesData.frameFloatArray; + this._rd.length = this._valueCount * 2; + } + else { + this._deformCount = this.target.target._deformVertices.length; + } + }; + SurfaceTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var surface = blendState.target; + var blendWeight = blendState.blendWeight; + var result = surface._deformVertices; + var valueArray = this._valueArray; + if (valueArray !== null) { + var valueCount = this._valueCount; + var deformOffset = this._deformOffset; + var sameValueOffset = this._sameValueOffset; + var rd = this._rd; + for (var i = 0; i < this._deformCount; ++i) { + var value = 0.0; + if (i < deformOffset) { + value = valueArray[sameValueOffset + i]; + } + else if (i < deformOffset + valueCount) { + value = rd[i - deformOffset]; + } + else { + value = valueArray[sameValueOffset + i - valueCount]; + } + if (blendState.dirty > 1) { + result[i] += value * blendWeight; + } + else { + result[i] = value * blendWeight; + } + } + } + else if (blendState.dirty === 1) { + for (var i = 0; i < this._deformCount; ++i) { + result[i] = 0.0; + } + } + if (isDirty || this.dirty) { + this.dirty = false; + surface._transformDirty = true; + } + }; + return SurfaceTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.SurfaceTimelineState = SurfaceTimelineState; + /** + * @internal + */ + var AlphaTimelineState = (function (_super) { + __extends(AlphaTimelineState, _super); + function AlphaTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AlphaTimelineState.toString = function () { + return "[class dragonBones.AlphaTimelineState]"; + }; + AlphaTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { + this._result = 1.0; + } + }; + AlphaTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.01; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + AlphaTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var alphaTarget = blendState.target; + var blendWeight = blendState.blendWeight; + if (blendState.dirty > 1) { + alphaTarget._alpha += this._result * blendWeight; + if (alphaTarget._alpha > 1.0) { + alphaTarget._alpha = 1.0; + } + } + else { + alphaTarget._alpha = this._result * blendWeight; + } + if (isDirty || this.dirty) { + this.dirty = false; + this._armature._alphaDirty = true; + } + }; + return AlphaTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AlphaTimelineState = AlphaTimelineState; + /** + * @internal + */ + var SlotDisplayTimelineState = (function (_super) { + __extends(SlotDisplayTimelineState, _super); + function SlotDisplayTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SlotDisplayTimelineState.toString = function () { + return "[class dragonBones.SlotDisplayTimelineState]"; + }; + SlotDisplayTimelineState.prototype._onArriveAtFrame = function () { + if (this.playState >= 0) { + var slot = this.target; + var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : slot._slotData.displayIndex; + if (slot.displayIndex !== displayIndex) { + slot._setDisplayIndex(displayIndex, true); + } + } + }; + SlotDisplayTimelineState.prototype._onUpdateFrame = function () { + }; + return SlotDisplayTimelineState; + }(dragonBones.TimelineState)); + dragonBones.SlotDisplayTimelineState = SlotDisplayTimelineState; + /** + * @internal + */ + var SlotColorTimelineState = (function (_super) { + __extends(SlotColorTimelineState, _super); + function SlotColorTimelineState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._current = [0, 0, 0, 0, 0, 0, 0, 0]; + _this._difference = [0, 0, 0, 0, 0, 0, 0, 0]; + _this._result = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]; + return _this; + } + SlotColorTimelineState.toString = function () { + return "[class dragonBones.SlotColorTimelineState]"; + }; + SlotColorTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; + var colorArray = dragonBonesData.colorArray; + var frameIntArray = dragonBonesData.frameIntArray; + var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex; + var colorOffset = frameIntArray[valueOffset]; + if (colorOffset < 0) { + colorOffset += 65536; // Fixed out of bounds bug. + } + if (this._isTween) { + this._current[0] = colorArray[colorOffset++]; + this._current[1] = colorArray[colorOffset++]; + this._current[2] = colorArray[colorOffset++]; + this._current[3] = colorArray[colorOffset++]; + this._current[4] = colorArray[colorOffset++]; + this._current[5] = colorArray[colorOffset++]; + this._current[6] = colorArray[colorOffset++]; + this._current[7] = colorArray[colorOffset++]; + if (this._frameIndex === this._frameCount - 1) { + colorOffset = frameIntArray[this._animationData.frameIntOffset + this._frameValueOffset]; + } + else { + colorOffset = frameIntArray[valueOffset + 1]; + } + if (colorOffset < 0) { + colorOffset += 65536; // Fixed out of bounds bug. + } + this._difference[0] = colorArray[colorOffset++] - this._current[0]; + this._difference[1] = colorArray[colorOffset++] - this._current[1]; + this._difference[2] = colorArray[colorOffset++] - this._current[2]; + this._difference[3] = colorArray[colorOffset++] - this._current[3]; + this._difference[4] = colorArray[colorOffset++] - this._current[4]; + this._difference[5] = colorArray[colorOffset++] - this._current[5]; + this._difference[6] = colorArray[colorOffset++] - this._current[6]; + this._difference[7] = colorArray[colorOffset++] - this._current[7]; + } + else { + this._result[0] = colorArray[colorOffset++] * 0.01; + this._result[1] = colorArray[colorOffset++] * 0.01; + this._result[2] = colorArray[colorOffset++] * 0.01; + this._result[3] = colorArray[colorOffset++] * 0.01; + this._result[4] = colorArray[colorOffset++]; + this._result[5] = colorArray[colorOffset++]; + this._result[6] = colorArray[colorOffset++]; + this._result[7] = colorArray[colorOffset++]; + } + } + else { + var slot = this.target; + var color = slot.slotData.color; + this._result[0] = color.alphaMultiplier; + this._result[1] = color.redMultiplier; + this._result[2] = color.greenMultiplier; + this._result[3] = color.blueMultiplier; + this._result[4] = color.alphaOffset; + this._result[5] = color.redOffset; + this._result[6] = color.greenOffset; + this._result[7] = color.blueOffset; + } + }; + SlotColorTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._result[0] = (this._current[0] + this._difference[0] * this._tweenProgress) * 0.01; + this._result[1] = (this._current[1] + this._difference[1] * this._tweenProgress) * 0.01; + this._result[2] = (this._current[2] + this._difference[2] * this._tweenProgress) * 0.01; + this._result[3] = (this._current[3] + this._difference[3] * this._tweenProgress) * 0.01; + this._result[4] = this._current[4] + this._difference[4] * this._tweenProgress; + this._result[5] = this._current[5] + this._difference[5] * this._tweenProgress; + this._result[6] = this._current[6] + this._difference[6] * this._tweenProgress; + this._result[7] = this._current[7] + this._difference[7] * this._tweenProgress; + } + }; + SlotColorTimelineState.prototype.fadeOut = function () { + this._isTween = false; + }; + SlotColorTimelineState.prototype.update = function (passedTime) { + _super.prototype.update.call(this, passedTime); + // Fade animation. + if (this._isTween || this.dirty) { + var slot = this.target; + var result = slot._colorTransform; + if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) { + if (result.alphaMultiplier !== this._result[0] || + result.redMultiplier !== this._result[1] || + result.greenMultiplier !== this._result[2] || + result.blueMultiplier !== this._result[3] || + result.alphaOffset !== this._result[4] || + result.redOffset !== this._result[5] || + result.greenOffset !== this._result[6] || + result.blueOffset !== this._result[7]) { + var fadeProgress = Math.pow(this._animationState._fadeProgress, 4); + result.alphaMultiplier += (this._result[0] - result.alphaMultiplier) * fadeProgress; + result.redMultiplier += (this._result[1] - result.redMultiplier) * fadeProgress; + result.greenMultiplier += (this._result[2] - result.greenMultiplier) * fadeProgress; + result.blueMultiplier += (this._result[3] - result.blueMultiplier) * fadeProgress; + result.alphaOffset += (this._result[4] - result.alphaOffset) * fadeProgress; + result.redOffset += (this._result[5] - result.redOffset) * fadeProgress; + result.greenOffset += (this._result[6] - result.greenOffset) * fadeProgress; + result.blueOffset += (this._result[7] - result.blueOffset) * fadeProgress; + slot._colorDirty = true; + } + } + else if (this.dirty) { + this.dirty = false; + if (result.alphaMultiplier !== this._result[0] || + result.redMultiplier !== this._result[1] || + result.greenMultiplier !== this._result[2] || + result.blueMultiplier !== this._result[3] || + result.alphaOffset !== this._result[4] || + result.redOffset !== this._result[5] || + result.greenOffset !== this._result[6] || + result.blueOffset !== this._result[7]) { + result.alphaMultiplier = this._result[0]; + result.redMultiplier = this._result[1]; + result.greenMultiplier = this._result[2]; + result.blueMultiplier = this._result[3]; + result.alphaOffset = this._result[4]; + result.redOffset = this._result[5]; + result.greenOffset = this._result[6]; + result.blueOffset = this._result[7]; + slot._colorDirty = true; + } + } + } + }; + return SlotColorTimelineState; + }(dragonBones.TweenTimelineState)); + dragonBones.SlotColorTimelineState = SlotColorTimelineState; + /** + * @internal + */ + var SlotZIndexTimelineState = (function (_super) { + __extends(SlotZIndexTimelineState, _super); + function SlotZIndexTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SlotZIndexTimelineState.toString = function () { + return "[class dragonBones.SlotZIndexTimelineState]"; + }; + SlotZIndexTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { + var blendState = this.target; + var slot = blendState.target; + this._result = slot.slotData.zIndex; + } + }; + SlotZIndexTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + SlotZIndexTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var slot = blendState.target; + var blendWeight = blendState.blendWeight; + if (blendState.dirty > 1) { + slot._zIndex += this._result * blendWeight; + } + else { + slot._zIndex = this._result * blendWeight; + } + if (isDirty || this.dirty) { + this.dirty = false; + this._armature._zIndexDirty = true; + } + }; + return SlotZIndexTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.SlotZIndexTimelineState = SlotZIndexTimelineState; + /** + * @internal + */ + var DeformTimelineState = (function (_super) { + __extends(DeformTimelineState, _super); + function DeformTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + DeformTimelineState.toString = function () { + return "[class dragonBones.DeformTimelineState]"; + }; + DeformTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.geometryOffset = 0; + this.displayFrame = null; + this._deformCount = 0; + this._deformOffset = 0; + this._sameValueOffset = 0; + }; + DeformTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + if (this._timelineData !== null) { + var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */]; + var dragonBonesData = this._animationData.parent.parent; + var frameIntArray = dragonBonesData.frameIntArray; + var slot = this.target.target; + this.geometryOffset = frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */]; + if (this.geometryOffset < 0) { + this.geometryOffset += 65536; // Fixed out of bounds bug. + } + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayFrame = slot.getDisplayFrameAt(i); + var geometryData = displayFrame.getGeometryData(); + if (geometryData === null) { + continue; + } + if (geometryData.offset === this.geometryOffset) { + this.displayFrame = displayFrame; + this.displayFrame.updateDeformVertices(); + break; + } + } + if (this.displayFrame === null) { + this.returnToPool(); // + return; + } + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */]; + this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */]; + this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */]; + this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = dragonBonesData.frameFloatArray; + this._rd.length = this._valueCount * 2; + } + else { + this._deformCount = this.displayFrame.deformVertices.length; + } + }; + DeformTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var slot = blendState.target; + var blendWeight = blendState.blendWeight; + var result = this.displayFrame.deformVertices; + var valueArray = this._valueArray; + if (valueArray !== null) { + var valueCount = this._valueCount; + var deformOffset = this._deformOffset; + var sameValueOffset = this._sameValueOffset; + var rd = this._rd; + for (var i = 0; i < this._deformCount; ++i) { + var value = 0.0; + if (i < deformOffset) { + value = valueArray[sameValueOffset + i]; + } + else if (i < deformOffset + valueCount) { + value = rd[i - deformOffset]; + } + else { + value = valueArray[sameValueOffset + i - valueCount]; + } + if (blendState.dirty > 1) { + result[i] += value * blendWeight; + } + else { + result[i] = value * blendWeight; + } + } + } + else if (blendState.dirty === 1) { + for (var i = 0; i < this._deformCount; ++i) { + result[i] = 0.0; + } + } + if (isDirty || this.dirty) { + this.dirty = false; + if (slot._geometryData === this.displayFrame.getGeometryData()) { + slot._verticesDirty = true; + } + } + }; + return DeformTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.DeformTimelineState = DeformTimelineState; + /** + * @internal + */ + var IKConstraintTimelineState = (function (_super) { + __extends(IKConstraintTimelineState, _super); + function IKConstraintTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraintTimelineState.toString = function () { + return "[class dragonBones.IKConstraintTimelineState]"; + }; + IKConstraintTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var ikConstraint = this.target; + if (this._timelineData !== null) { + ikConstraint._bendPositive = this._currentA > 0.0; + ikConstraint._weight = this._currentB; + } + else { + var ikConstraintData = ikConstraint._constraintData; + ikConstraint._bendPositive = ikConstraintData.bendPositive; + ikConstraint._weight = ikConstraintData.weight; + } + ikConstraint.invalidUpdate(); + this.dirty = false; + }; + IKConstraintTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.01; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return IKConstraintTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.IKConstraintTimelineState = IKConstraintTimelineState; + /** + * @internal + */ + var AnimationProgressTimelineState = (function (_super) { + __extends(AnimationProgressTimelineState, _super); + function AnimationProgressTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationProgressTimelineState.toString = function () { + return "[class dragonBones.AnimationProgressTimelineState]"; + }; + AnimationProgressTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.currentTime = this._result * animationState.totalTime; + } + this.dirty = false; + }; + AnimationProgressTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationProgressTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AnimationProgressTimelineState = AnimationProgressTimelineState; + /** + * @internal + */ + var AnimationWeightTimelineState = (function (_super) { + __extends(AnimationWeightTimelineState, _super); + function AnimationWeightTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationWeightTimelineState.toString = function () { + return "[class dragonBones.AnimationWeightTimelineState]"; + }; + AnimationWeightTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.weight = this._result; + } + this.dirty = false; + }; + AnimationWeightTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationWeightTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AnimationWeightTimelineState = AnimationWeightTimelineState; + /** + * @internal + */ + var AnimationParametersTimelineState = (function (_super) { + __extends(AnimationParametersTimelineState, _super); + function AnimationParametersTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationParametersTimelineState.toString = function () { + return "[class dragonBones.AnimationParametersTimelineState]"; + }; + AnimationParametersTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.parameterX = this._resultA; + animationState.parameterY = this._resultB; + } + this.dirty = false; + }; + AnimationParametersTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationParametersTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.AnimationParametersTimelineState = AnimationParametersTimelineState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The properties of the object carry basic information about an event, + * which are passed as parameter or parameter's parameter to event listeners when an event occurs. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 + * @version DragonBones 4.5 + * @language zh_CN + */ + var EventObject = (function (_super) { + __extends(EventObject, _super); + function EventObject() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @internal + * @private + */ + EventObject.actionDataToInstance = function (data, instance, armature) { + if (data.type === 0 /* Play */) { + instance.type = EventObject.FRAME_EVENT; + } + else { + instance.type = data.type === 10 /* Frame */ ? EventObject.FRAME_EVENT : EventObject.SOUND_EVENT; + } + instance.name = data.name; + instance.armature = armature; + instance.actionData = data; + instance.data = data.data; + if (data.bone !== null) { + instance.bone = armature.getBone(data.bone.name); + } + if (data.slot !== null) { + instance.slot = armature.getSlot(data.slot.name); + } + }; + EventObject.toString = function () { + return "[class dragonBones.EventObject]"; + }; + EventObject.prototype._onClear = function () { + this.time = 0.0; + this.type = ""; + this.name = ""; + this.armature = null; + this.bone = null; + this.slot = null; + this.animationState = null; + this.actionData = null; + this.data = null; + }; + /** + * - Animation start play. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画开始播放。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.START = "start"; + /** + * - Animation loop play complete once. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画循环播放完成一次。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.LOOP_COMPLETE = "loopComplete"; + /** + * - Animation play complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画播放完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.COMPLETE = "complete"; + /** + * - Animation fade in start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_IN = "fadeIn"; + /** + * - Animation fade in complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_IN_COMPLETE = "fadeInComplete"; + /** + * - Animation fade out start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_OUT = "fadeOut"; + /** + * - Animation fade out complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_OUT_COMPLETE = "fadeOutComplete"; + /** + * - Animation frame event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FRAME_EVENT = "frameEvent"; + /** + * - Animation frame sound event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧声音事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.SOUND_EVENT = "soundEvent"; + return EventObject; + }(dragonBones.BaseObject)); + dragonBones.EventObject = EventObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DataParser = (function () { + function DataParser() { + } + DataParser._getArmatureType = function (value) { + switch (value.toLowerCase()) { + case "stage": + return 2 /* Stage */; + case "armature": + return 0 /* Armature */; + case "movieclip": + return 1 /* MovieClip */; + default: + return 0 /* Armature */; + } + }; + DataParser._getBoneType = function (value) { + switch (value.toLowerCase()) { + case "bone": + return 0 /* Bone */; + case "surface": + return 1 /* Surface */; + default: + return 0 /* Bone */; + } + }; + DataParser._getPositionMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "percent": + return 1 /* Percent */; + case "fixed": + return 0 /* Fixed */; + default: + return 1 /* Percent */; + } + }; + DataParser._getSpacingMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "length": + return 0 /* Length */; + case "percent": + return 2 /* Percent */; + case "fixed": + return 1 /* Fixed */; + default: + return 0 /* Length */; + } + }; + DataParser._getRotateMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "tangent": + return 0 /* Tangent */; + case "chain": + return 1 /* Chain */; + case "chainscale": + return 2 /* ChainScale */; + default: + return 0 /* Tangent */; + } + }; + DataParser._getDisplayType = function (value) { + switch (value.toLowerCase()) { + case "image": + return 0 /* Image */; + case "mesh": + return 2 /* Mesh */; + case "armature": + return 1 /* Armature */; + case "boundingbox": + return 3 /* BoundingBox */; + case "path": + return 4 /* Path */; + default: + return 0 /* Image */; + } + }; + DataParser._getBoundingBoxType = function (value) { + switch (value.toLowerCase()) { + case "rectangle": + return 0 /* Rectangle */; + case "ellipse": + return 1 /* Ellipse */; + case "polygon": + return 2 /* Polygon */; + default: + return 0 /* Rectangle */; + } + }; + DataParser._getBlendMode = function (value) { + switch (value.toLowerCase()) { + case "normal": + return 0 /* Normal */; + case "add": + return 1 /* Add */; + case "alpha": + return 2 /* Alpha */; + case "darken": + return 3 /* Darken */; + case "difference": + return 4 /* Difference */; + case "erase": + return 5 /* Erase */; + case "hardlight": + return 6 /* HardLight */; + case "invert": + return 7 /* Invert */; + case "layer": + return 8 /* Layer */; + case "lighten": + return 9 /* Lighten */; + case "multiply": + return 10 /* Multiply */; + case "overlay": + return 11 /* Overlay */; + case "screen": + return 12 /* Screen */; + case "subtract": + return 13 /* Subtract */; + default: + return 0 /* Normal */; + } + }; + DataParser._getAnimationBlendType = function (value) { + switch (value.toLowerCase()) { + case "none": + return 0 /* None */; + case "1d": + return 1 /* E1D */; + default: + return 0 /* None */; + } + }; + DataParser._getActionType = function (value) { + switch (value.toLowerCase()) { + case "play": + return 0 /* Play */; + case "frame": + return 10 /* Frame */; + case "sound": + return 11 /* Sound */; + default: + return 0 /* Play */; + } + }; + DataParser.DATA_VERSION_2_3 = "2.3"; + DataParser.DATA_VERSION_3_0 = "3.0"; + DataParser.DATA_VERSION_4_0 = "4.0"; + DataParser.DATA_VERSION_4_5 = "4.5"; + DataParser.DATA_VERSION_5_0 = "5.0"; + DataParser.DATA_VERSION_5_5 = "5.5"; + DataParser.DATA_VERSION_5_6 = "5.6"; + DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_6; + DataParser.DATA_VERSIONS = [ + DataParser.DATA_VERSION_4_0, + DataParser.DATA_VERSION_4_5, + DataParser.DATA_VERSION_5_0, + DataParser.DATA_VERSION_5_5, + DataParser.DATA_VERSION_5_6 + ]; + DataParser.TEXTURE_ATLAS = "textureAtlas"; + DataParser.SUB_TEXTURE = "SubTexture"; + DataParser.FORMAT = "format"; + DataParser.IMAGE_PATH = "imagePath"; + DataParser.WIDTH = "width"; + DataParser.HEIGHT = "height"; + DataParser.ROTATED = "rotated"; + DataParser.FRAME_X = "frameX"; + DataParser.FRAME_Y = "frameY"; + DataParser.FRAME_WIDTH = "frameWidth"; + DataParser.FRAME_HEIGHT = "frameHeight"; + DataParser.DRADON_BONES = "dragonBones"; + DataParser.USER_DATA = "userData"; + DataParser.ARMATURE = "armature"; + DataParser.CANVAS = "canvas"; + DataParser.BONE = "bone"; + DataParser.SURFACE = "surface"; + DataParser.SLOT = "slot"; + DataParser.CONSTRAINT = "constraint"; + DataParser.SKIN = "skin"; + DataParser.DISPLAY = "display"; + DataParser.FRAME = "frame"; + DataParser.IK = "ik"; + DataParser.PATH_CONSTRAINT = "path"; + DataParser.ANIMATION = "animation"; + DataParser.TIMELINE = "timeline"; + DataParser.FFD = "ffd"; + DataParser.TRANSLATE_FRAME = "translateFrame"; + DataParser.ROTATE_FRAME = "rotateFrame"; + DataParser.SCALE_FRAME = "scaleFrame"; + DataParser.DISPLAY_FRAME = "displayFrame"; + DataParser.COLOR_FRAME = "colorFrame"; + DataParser.DEFAULT_ACTIONS = "defaultActions"; + DataParser.ACTIONS = "actions"; + DataParser.EVENTS = "events"; + DataParser.INTS = "ints"; + DataParser.FLOATS = "floats"; + DataParser.STRINGS = "strings"; + DataParser.TRANSFORM = "transform"; + DataParser.PIVOT = "pivot"; + DataParser.AABB = "aabb"; + DataParser.COLOR = "color"; + DataParser.VERSION = "version"; + DataParser.COMPATIBLE_VERSION = "compatibleVersion"; + DataParser.FRAME_RATE = "frameRate"; + DataParser.TYPE = "type"; + DataParser.SUB_TYPE = "subType"; + DataParser.NAME = "name"; + DataParser.PARENT = "parent"; + DataParser.TARGET = "target"; + DataParser.STAGE = "stage"; + DataParser.SHARE = "share"; + DataParser.PATH = "path"; + DataParser.LENGTH = "length"; + DataParser.DISPLAY_INDEX = "displayIndex"; + DataParser.Z_ORDER = "zOrder"; + DataParser.Z_INDEX = "zIndex"; + DataParser.BLEND_MODE = "blendMode"; + DataParser.INHERIT_TRANSLATION = "inheritTranslation"; + DataParser.INHERIT_ROTATION = "inheritRotation"; + DataParser.INHERIT_SCALE = "inheritScale"; + DataParser.INHERIT_REFLECTION = "inheritReflection"; + DataParser.INHERIT_ANIMATION = "inheritAnimation"; + DataParser.INHERIT_DEFORM = "inheritDeform"; + DataParser.SEGMENT_X = "segmentX"; + DataParser.SEGMENT_Y = "segmentY"; + DataParser.BEND_POSITIVE = "bendPositive"; + DataParser.CHAIN = "chain"; + DataParser.WEIGHT = "weight"; + DataParser.BLEND_TYPE = "blendType"; + DataParser.FADE_IN_TIME = "fadeInTime"; + DataParser.PLAY_TIMES = "playTimes"; + DataParser.SCALE = "scale"; + DataParser.OFFSET = "offset"; + DataParser.POSITION = "position"; + DataParser.DURATION = "duration"; + DataParser.TWEEN_EASING = "tweenEasing"; + DataParser.TWEEN_ROTATE = "tweenRotate"; + DataParser.TWEEN_SCALE = "tweenScale"; + DataParser.CLOCK_WISE = "clockwise"; + DataParser.CURVE = "curve"; + DataParser.SOUND = "sound"; + DataParser.EVENT = "event"; + DataParser.ACTION = "action"; + DataParser.X = "x"; + DataParser.Y = "y"; + DataParser.SKEW_X = "skX"; + DataParser.SKEW_Y = "skY"; + DataParser.SCALE_X = "scX"; + DataParser.SCALE_Y = "scY"; + DataParser.VALUE = "value"; + DataParser.ROTATE = "rotate"; + DataParser.SKEW = "skew"; + DataParser.ALPHA = "alpha"; + DataParser.ALPHA_OFFSET = "aO"; + DataParser.RED_OFFSET = "rO"; + DataParser.GREEN_OFFSET = "gO"; + DataParser.BLUE_OFFSET = "bO"; + DataParser.ALPHA_MULTIPLIER = "aM"; + DataParser.RED_MULTIPLIER = "rM"; + DataParser.GREEN_MULTIPLIER = "gM"; + DataParser.BLUE_MULTIPLIER = "bM"; + DataParser.UVS = "uvs"; + DataParser.VERTICES = "vertices"; + DataParser.TRIANGLES = "triangles"; + DataParser.WEIGHTS = "weights"; + DataParser.SLOT_POSE = "slotPose"; + DataParser.BONE_POSE = "bonePose"; + DataParser.BONES = "bones"; + DataParser.POSITION_MODE = "positionMode"; + DataParser.SPACING_MODE = "spacingMode"; + DataParser.ROTATE_MODE = "rotateMode"; + DataParser.SPACING = "spacing"; + DataParser.ROTATE_OFFSET = "rotateOffset"; + DataParser.ROTATE_MIX = "rotateMix"; + DataParser.TRANSLATE_MIX = "translateMix"; + DataParser.TARGET_DISPLAY = "targetDisplay"; + DataParser.CLOSED = "closed"; + DataParser.CONSTANT_SPEED = "constantSpeed"; + DataParser.VERTEX_COUNT = "vertexCount"; + DataParser.LENGTHS = "lengths"; + DataParser.GOTO_AND_PLAY = "gotoAndPlay"; + DataParser.DEFAULT_NAME = "default"; + return DataParser; + }()); + dragonBones.DataParser = DataParser; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ObjectDataParser = (function (_super) { + __extends(ObjectDataParser, _super); + function ObjectDataParser() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._rawTextureAtlasIndex = 0; + _this._rawBones = []; + _this._data = null; // + _this._armature = null; // + _this._bone = null; // + _this._geometry = null; // + _this._slot = null; // + _this._skin = null; // + _this._mesh = null; // + _this._animation = null; // + _this._timeline = null; // + _this._rawTextureAtlases = null; + _this._frameValueType = 0 /* Step */; + _this._defaultColorOffset = -1; + _this._prevClockwise = 0; + _this._prevRotation = 0.0; + _this._frameDefaultValue = 0.0; + _this._frameValueScale = 1.0; + _this._helpMatrixA = new dragonBones.Matrix(); + _this._helpMatrixB = new dragonBones.Matrix(); + _this._helpTransform = new dragonBones.Transform(); + _this._helpColorTransform = new dragonBones.ColorTransform(); + _this._helpPoint = new dragonBones.Point(); + _this._helpArray = []; + _this._intArray = []; + _this._floatArray = []; + _this._frameIntArray = []; + _this._frameFloatArray = []; + _this._frameArray = []; + _this._timelineArray = []; + _this._colorArray = []; + _this._cacheRawMeshes = []; + _this._cacheMeshes = []; + _this._actionFrames = []; + _this._weightSlotPose = {}; + _this._weightBonePoses = {}; + _this._cacheBones = {}; + _this._slotChildActions = {}; + return _this; + } + ObjectDataParser._getBoolean = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + var type = typeof value; + if (type === "boolean") { + return value; + } + else if (type === "string") { + switch (value) { + case "0": + case "NaN": + case "": + case "false": + case "null": + case "undefined": + return false; + default: + return true; + } + } + else { + return !!value; + } + } + return defaultValue; + }; + ObjectDataParser._getNumber = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + if (value === null || value === "NaN") { + return defaultValue; + } + return +value || 0; + } + return defaultValue; + }; + ObjectDataParser._getString = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + var type = typeof value; + if (type === "string") { + return value; + } + return String(value); + } + return defaultValue; + }; + ObjectDataParser.prototype._getCurvePoint = function (x1, y1, x2, y2, x3, y3, x4, y4, t, result) { + var l_t = 1.0 - t; + var powA = l_t * l_t; + var powB = t * t; + var kA = l_t * powA; + var kB = 3.0 * t * powA; + var kC = 3.0 * l_t * powB; + var kD = t * powB; + result.x = kA * x1 + kB * x2 + kC * x3 + kD * x4; + result.y = kA * y1 + kB * y2 + kC * y3 + kD * y4; + }; + ObjectDataParser.prototype._samplingEasingCurve = function (curve, samples) { + var curveCount = curve.length; + if (curveCount % 3 === 1) { + var stepIndex = -2; + for (var i = 0, l = samples.length; i < l; ++i) { + var t = (i + 1) / (l + 1); // float + while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) { + stepIndex += 6; + } + var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount; + var x1 = isInCurve ? curve[stepIndex] : 0.0; + var y1 = isInCurve ? curve[stepIndex + 1] : 0.0; + var x2 = curve[stepIndex + 2]; + var y2 = curve[stepIndex + 3]; + var x3 = curve[stepIndex + 4]; + var y3 = curve[stepIndex + 5]; + var x4 = isInCurve ? curve[stepIndex + 6] : 1.0; + var y4 = isInCurve ? curve[stepIndex + 7] : 1.0; + var lower = 0.0; + var higher = 1.0; + while (higher - lower > 0.0001) { + var percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } + } + samples[i] = this._helpPoint.y; + } + return true; + } + else { + var stepIndex = 0; + for (var i = 0, l = samples.length; i < l; ++i) { + var t = (i + 1) / (l + 1); // float + while (curve[stepIndex + 6] < t) { + stepIndex += 6; + } + var x1 = curve[stepIndex]; + var y1 = curve[stepIndex + 1]; + var x2 = curve[stepIndex + 2]; + var y2 = curve[stepIndex + 3]; + var x3 = curve[stepIndex + 4]; + var y3 = curve[stepIndex + 5]; + var x4 = curve[stepIndex + 6]; + var y4 = curve[stepIndex + 7]; + var lower = 0.0; + var higher = 1.0; + while (higher - lower > 0.0001) { + var percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } + } + samples[i] = this._helpPoint.y; + } + return false; + } + }; + ObjectDataParser.prototype._parseActionDataInFrame = function (rawData, frameStart, bone, slot) { + if (dragonBones.DataParser.EVENT in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.EVENT], frameStart, 10 /* Frame */, bone, slot); + } + if (dragonBones.DataParser.SOUND in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.SOUND], frameStart, 11 /* Sound */, bone, slot); + } + if (dragonBones.DataParser.ACTION in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.ACTION], frameStart, 0 /* Play */, bone, slot); + } + if (dragonBones.DataParser.EVENTS in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.EVENTS], frameStart, 10 /* Frame */, bone, slot); + } + if (dragonBones.DataParser.ACTIONS in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.ACTIONS], frameStart, 0 /* Play */, bone, slot); + } + }; + ObjectDataParser.prototype._mergeActionFrame = function (rawData, frameStart, type, bone, slot) { + var actionOffset = this._armature.actions.length; + var actions = this._parseActionData(rawData, type, bone, slot); + var frameIndex = 0; + var frame = null; + for (var _i = 0, actions_2 = actions; _i < actions_2.length; _i++) { + var action = actions_2[_i]; + this._armature.addAction(action, false); + } + if (this._actionFrames.length === 0) { + frame = new ActionFrame(); + frame.frameStart = 0; + this._actionFrames.push(frame); + frame = null; + } + for (var _a = 0, _b = this._actionFrames; _a < _b.length; _a++) { + var eachFrame = _b[_a]; + if (eachFrame.frameStart === frameStart) { + frame = eachFrame; + break; + } + else if (eachFrame.frameStart > frameStart) { + break; + } + frameIndex++; + } + if (frame === null) { + frame = new ActionFrame(); + frame.frameStart = frameStart; + this._actionFrames.splice(frameIndex, 0, frame); + } + for (var i = 0; i < actions.length; ++i) { + frame.actions.push(actionOffset + i); + } + }; + ObjectDataParser.prototype._parseArmature = function (rawData, scale) { + var armature = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureData); + armature.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + armature.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, this._data.frameRate); + armature.scale = scale; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + armature.type = dragonBones.DataParser._getArmatureType(rawData[dragonBones.DataParser.TYPE]); + } + else { + armature.type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Armature */); + } + if (armature.frameRate === 0) { + armature.frameRate = 24; + } + this._armature = armature; + if (dragonBones.DataParser.CANVAS in rawData) { + var rawCanvas = rawData[dragonBones.DataParser.CANVAS]; + var canvas = dragonBones.BaseObject.borrowObject(dragonBones.CanvasData); + if (dragonBones.DataParser.COLOR in rawCanvas) { + canvas.hasBackground = true; + } + else { + canvas.hasBackground = false; + } + canvas.color = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.COLOR, 0); + canvas.x = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.X, 0) * armature.scale; + canvas.y = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.Y, 0) * armature.scale; + canvas.width = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.WIDTH, 0) * armature.scale; + canvas.height = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.HEIGHT, 0) * armature.scale; + armature.canvas = canvas; + } + if (dragonBones.DataParser.AABB in rawData) { + var rawAABB = rawData[dragonBones.DataParser.AABB]; + armature.aabb.x = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.X, 0.0) * armature.scale; + armature.aabb.y = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.Y, 0.0) * armature.scale; + armature.aabb.width = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.WIDTH, 0.0) * armature.scale; + armature.aabb.height = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.HEIGHT, 0.0) * armature.scale; + } + if (dragonBones.DataParser.BONE in rawData) { + var rawBones = rawData[dragonBones.DataParser.BONE]; + for (var _i = 0, rawBones_1 = rawBones; _i < rawBones_1.length; _i++) { + var rawBone = rawBones_1[_i]; + var parentName = ObjectDataParser._getString(rawBone, dragonBones.DataParser.PARENT, ""); + var bone = this._parseBone(rawBone); + if (parentName.length > 0) { + var parent_1 = armature.getBone(parentName); + if (parent_1 !== null) { + bone.parent = parent_1; + } + else { + if (!(parentName in this._cacheBones)) { + this._cacheBones[parentName] = []; + } + this._cacheBones[parentName].push(bone); + } + } + if (bone.name in this._cacheBones) { + for (var _a = 0, _b = this._cacheBones[bone.name]; _a < _b.length; _a++) { + var child = _b[_a]; + child.parent = bone; + } + delete this._cacheBones[bone.name]; + } + armature.addBone(bone); + this._rawBones.push(bone); // Cache raw bones sort. + } + } + if (dragonBones.DataParser.IK in rawData) { + var rawIKS = rawData[dragonBones.DataParser.IK]; + for (var _c = 0, rawIKS_1 = rawIKS; _c < rawIKS_1.length; _c++) { + var rawIK = rawIKS_1[_c]; + var constraint = this._parseIKConstraint(rawIK); + if (constraint) { + armature.addConstraint(constraint); + } + } + } + armature.sortBones(); + if (dragonBones.DataParser.SLOT in rawData) { + var zOrder = 0; + var rawSlots = rawData[dragonBones.DataParser.SLOT]; + for (var _d = 0, rawSlots_1 = rawSlots; _d < rawSlots_1.length; _d++) { + var rawSlot = rawSlots_1[_d]; + armature.addSlot(this._parseSlot(rawSlot, zOrder++)); + } + } + if (dragonBones.DataParser.SKIN in rawData) { + var rawSkins = rawData[dragonBones.DataParser.SKIN]; + for (var _e = 0, rawSkins_1 = rawSkins; _e < rawSkins_1.length; _e++) { + var rawSkin = rawSkins_1[_e]; + armature.addSkin(this._parseSkin(rawSkin)); + } + } + if (dragonBones.DataParser.PATH_CONSTRAINT in rawData) { + var rawPaths = rawData[dragonBones.DataParser.PATH_CONSTRAINT]; + for (var _f = 0, rawPaths_1 = rawPaths; _f < rawPaths_1.length; _f++) { + var rawPath = rawPaths_1[_f]; + var constraint = this._parsePathConstraint(rawPath); + if (constraint) { + armature.addConstraint(constraint); + } + } + } + for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) { + var rawData_1 = this._cacheRawMeshes[i]; + var shareName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SHARE, ""); + if (shareName.length === 0) { + continue; + } + var skinName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME); + if (skinName.length === 0) { + skinName = dragonBones.DataParser.DEFAULT_NAME; + } + var shareMesh = armature.getMesh(skinName, "", shareName); // TODO slot; + if (shareMesh === null) { + continue; // Error. + } + var mesh = this._cacheMeshes[i]; + mesh.geometry.shareFrom(shareMesh.geometry); + } + if (dragonBones.DataParser.ANIMATION in rawData) { + var rawAnimations = rawData[dragonBones.DataParser.ANIMATION]; + for (var _g = 0, rawAnimations_1 = rawAnimations; _g < rawAnimations_1.length; _g++) { + var rawAnimation = rawAnimations_1[_g]; + var animation = this._parseAnimation(rawAnimation); + armature.addAnimation(animation); + } + } + if (dragonBones.DataParser.DEFAULT_ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.DEFAULT_ACTIONS], 0 /* Play */, null, null); + for (var _h = 0, actions_3 = actions; _h < actions_3.length; _h++) { + var action = actions_3[_h]; + armature.addAction(action, true); + if (action.type === 0 /* Play */) { + var animation = armature.getAnimation(action.name); + if (animation !== null) { + armature.defaultAnimation = animation; + } + } + } + } + if (dragonBones.DataParser.ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + for (var _j = 0, actions_4 = actions; _j < actions_4.length; _j++) { + var action = actions_4[_j]; + armature.addAction(action, false); + } + } + // Clear helper. + this._rawBones.length = 0; + this._cacheRawMeshes.length = 0; + this._cacheMeshes.length = 0; + this._armature = null; + for (var k in this._weightSlotPose) { + delete this._weightSlotPose[k]; + } + for (var k in this._weightBonePoses) { + delete this._weightBonePoses[k]; + } + for (var k in this._cacheBones) { + delete this._cacheBones[k]; + } + for (var k in this._slotChildActions) { + delete this._slotChildActions[k]; + } + return armature; + }; + ObjectDataParser.prototype._parseBone = function (rawData) { + var type = 0 /* Bone */; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + type = dragonBones.DataParser._getBoneType(rawData[dragonBones.DataParser.TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Bone */); + } + if (type === 0 /* Bone */) { + var scale = this._armature.scale; + var bone = dragonBones.BaseObject.borrowObject(dragonBones.BoneData); + bone.inheritTranslation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_TRANSLATION, true); + bone.inheritRotation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_ROTATION, true); + bone.inheritScale = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_SCALE, true); + bone.inheritReflection = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_REFLECTION, true); + bone.length = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.LENGTH, 0) * scale; + bone.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + bone.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + if (dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], bone.transform, scale); + } + return bone; + } + var surface = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceData); + surface.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + surface.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + surface.segmentX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_X, 0); + surface.segmentY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_Y, 0); + this._parseGeometry(rawData, surface.geometry); + return surface; + }; + ObjectDataParser.prototype._parseIKConstraint = function (rawData) { + var bone = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.BONE, "")); + if (bone === null) { + return null; + } + var target = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET, "")); + if (target === null) { + return null; + } + var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0); + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintData); + constraint.scaleEnabled = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.SCALE, false); + constraint.bendPositive = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true); + constraint.weight = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0); + constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + constraint.type = 0 /* IK */; + constraint.target = target; + if (chain > 0 && bone.parent !== null) { + constraint.root = bone.parent; + constraint.bone = bone; + } + else { + constraint.root = bone; + constraint.bone = null; + } + return constraint; + }; + ObjectDataParser.prototype._parsePathConstraint = function (rawData) { + var target = this._armature.getSlot(ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET, "")); + if (target === null) { + return null; + } + var defaultSkin = this._armature.defaultSkin; + if (defaultSkin === null) { + return null; + } + //TODO + var targetDisplay = defaultSkin.getDisplay(target.name, ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET_DISPLAY, target.name)); + if (targetDisplay === null || !(targetDisplay instanceof dragonBones.PathDisplayData)) { + return null; + } + var bones = rawData[dragonBones.DataParser.BONES]; + if (bones === null || bones.length === 0) { + return null; + } + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.PathConstraintData); + constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + constraint.type = 1 /* Path */; + constraint.pathSlot = target; + constraint.pathDisplayData = targetDisplay; + constraint.target = target.parent; + constraint.positionMode = dragonBones.DataParser._getPositionMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.POSITION_MODE, "")); + constraint.spacingMode = dragonBones.DataParser._getSpacingMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.SPACING_MODE, "")); + constraint.rotateMode = dragonBones.DataParser._getRotateMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.ROTATE_MODE, "")); + constraint.position = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.POSITION, 0); + constraint.spacing = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SPACING, 0); + constraint.rotateOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE_OFFSET, 0); + constraint.rotateMix = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE_MIX, 1); + constraint.translateMix = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TRANSLATE_MIX, 1); + // + for (var _i = 0, bones_3 = bones; _i < bones_3.length; _i++) { + var boneName = bones_3[_i]; + var bone = this._armature.getBone(boneName); + if (bone !== null) { + constraint.AddBone(bone); + if (constraint.root === null) { + constraint.root = bone; + } + } + } + return constraint; + }; + ObjectDataParser.prototype._parseSlot = function (rawData, zOrder) { + var slot = dragonBones.BaseObject.borrowObject(dragonBones.SlotData); + slot.displayIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0); + slot.zOrder = zOrder; + slot.zIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Z_INDEX, 0); + slot.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + slot.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + slot.parent = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.PARENT, "")); // + if (dragonBones.DataParser.BLEND_MODE in rawData && typeof rawData[dragonBones.DataParser.BLEND_MODE] === "string") { + slot.blendMode = dragonBones.DataParser._getBlendMode(rawData[dragonBones.DataParser.BLEND_MODE]); + } + else { + slot.blendMode = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLEND_MODE, 0 /* Normal */); + } + if (dragonBones.DataParser.COLOR in rawData) { + slot.color = dragonBones.SlotData.createColor(); + this._parseColorTransform(rawData[dragonBones.DataParser.COLOR], slot.color); + } + else { + slot.color = dragonBones.SlotData.DEFAULT_COLOR; + } + if (dragonBones.DataParser.ACTIONS in rawData) { + this._slotChildActions[slot.name] = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + } + return slot; + }; + ObjectDataParser.prototype._parseSkin = function (rawData) { + var skin = dragonBones.BaseObject.borrowObject(dragonBones.SkinData); + skin.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (skin.name.length === 0) { + skin.name = dragonBones.DataParser.DEFAULT_NAME; + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawSlots = rawData[dragonBones.DataParser.SLOT]; + this._skin = skin; + for (var _i = 0, rawSlots_2 = rawSlots; _i < rawSlots_2.length; _i++) { + var rawSlot = rawSlots_2[_i]; + var slotName = ObjectDataParser._getString(rawSlot, dragonBones.DataParser.NAME, ""); + var slot = this._armature.getSlot(slotName); + if (slot !== null) { + this._slot = slot; + if (dragonBones.DataParser.DISPLAY in rawSlot) { + var rawDisplays = rawSlot[dragonBones.DataParser.DISPLAY]; + for (var _a = 0, rawDisplays_1 = rawDisplays; _a < rawDisplays_1.length; _a++) { + var rawDisplay = rawDisplays_1[_a]; + if (rawDisplay) { + skin.addDisplay(slotName, this._parseDisplay(rawDisplay)); + } + else { + skin.addDisplay(slotName, null); + } + } + } + this._slot = null; // + } + } + this._skin = null; // + } + return skin; + }; + ObjectDataParser.prototype._parseDisplay = function (rawData) { + var name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + var path = ObjectDataParser._getString(rawData, dragonBones.DataParser.PATH, ""); + var type = 0 /* Image */; + var display = null; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + type = dragonBones.DataParser._getDisplayType(rawData[dragonBones.DataParser.TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, type); + } + switch (type) { + case 0 /* Image */: { + var imageDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ImageDisplayData); + imageDisplay.name = name; + imageDisplay.path = path.length > 0 ? path : name; + this._parsePivot(rawData, imageDisplay); + break; + } + case 1 /* Armature */: { + var armatureDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureDisplayData); + armatureDisplay.name = name; + armatureDisplay.path = path.length > 0 ? path : name; + armatureDisplay.inheritAnimation = true; + if (dragonBones.DataParser.ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + for (var _i = 0, actions_5 = actions; _i < actions_5.length; _i++) { + var action = actions_5[_i]; + armatureDisplay.addAction(action); + } + } + else if (this._slot.name in this._slotChildActions) { + var displays = this._skin.getDisplays(this._slot.name); + if (displays === null ? this._slot.displayIndex === 0 : this._slot.displayIndex === displays.length) { + for (var _a = 0, _b = this._slotChildActions[this._slot.name]; _a < _b.length; _a++) { + var action = _b[_a]; + armatureDisplay.addAction(action); + } + delete this._slotChildActions[this._slot.name]; + } + } + break; + } + case 2 /* Mesh */: { + var meshDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.MeshDisplayData); + meshDisplay.geometry.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true); + meshDisplay.name = name; + meshDisplay.path = path.length > 0 ? path : name; + if (dragonBones.DataParser.SHARE in rawData) { + meshDisplay.geometry.data = this._data; + this._cacheRawMeshes.push(rawData); + this._cacheMeshes.push(meshDisplay); + } + else { + this._parseMesh(rawData, meshDisplay); + } + break; + } + case 3 /* BoundingBox */: { + var boundingBox = this._parseBoundingBox(rawData); + if (boundingBox !== null) { + var boundingBoxDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.BoundingBoxDisplayData); + boundingBoxDisplay.name = name; + boundingBoxDisplay.path = path.length > 0 ? path : name; + boundingBoxDisplay.boundingBox = boundingBox; + } + break; + } + case 4 /* Path */: { + var rawCurveLengths = rawData[dragonBones.DataParser.LENGTHS]; + var pathDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.PathDisplayData); + pathDisplay.closed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CLOSED, false); + pathDisplay.constantSpeed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CONSTANT_SPEED, false); + pathDisplay.name = name; + pathDisplay.path = path.length > 0 ? path : name; + pathDisplay.curveLengths.length = rawCurveLengths.length; + for (var i = 0, l = rawCurveLengths.length; i < l; ++i) { + pathDisplay.curveLengths[i] = rawCurveLengths[i]; + } + this._parsePath(rawData, pathDisplay); + break; + } + } + if (display !== null && dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], display.transform, this._armature.scale); + } + return display; + }; + ObjectDataParser.prototype._parsePath = function (rawData, display) { + this._parseGeometry(rawData, display.geometry); + }; + ObjectDataParser.prototype._parsePivot = function (rawData, display) { + if (dragonBones.DataParser.PIVOT in rawData) { + var rawPivot = rawData[dragonBones.DataParser.PIVOT]; + display.pivot.x = ObjectDataParser._getNumber(rawPivot, dragonBones.DataParser.X, 0.0); + display.pivot.y = ObjectDataParser._getNumber(rawPivot, dragonBones.DataParser.Y, 0.0); + } + else { + display.pivot.x = 0.5; + display.pivot.y = 0.5; + } + }; + ObjectDataParser.prototype._parseMesh = function (rawData, mesh) { + this._parseGeometry(rawData, mesh.geometry); + if (dragonBones.DataParser.WEIGHTS in rawData) { + var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE]; + var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE]; + var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; + this._weightSlotPose[meshName] = rawSlotPose; + this._weightBonePoses[meshName] = rawBonePoses; + } + }; + ObjectDataParser.prototype._parseBoundingBox = function (rawData) { + var boundingBox = null; + var type = 0 /* Rectangle */; + if (dragonBones.DataParser.SUB_TYPE in rawData && typeof rawData[dragonBones.DataParser.SUB_TYPE] === "string") { + type = dragonBones.DataParser._getBoundingBoxType(rawData[dragonBones.DataParser.SUB_TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SUB_TYPE, type); + } + switch (type) { + case 0 /* Rectangle */: + boundingBox = dragonBones.BaseObject.borrowObject(dragonBones.RectangleBoundingBoxData); + break; + case 1 /* Ellipse */: + boundingBox = dragonBones.BaseObject.borrowObject(dragonBones.EllipseBoundingBoxData); + break; + case 2 /* Polygon */: + boundingBox = this._parsePolygonBoundingBox(rawData); + break; + } + if (boundingBox !== null) { + boundingBox.color = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.COLOR, 0x000000); + if (boundingBox.type === 0 /* Rectangle */ || boundingBox.type === 1 /* Ellipse */) { + boundingBox.width = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WIDTH, 0.0); + boundingBox.height = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.HEIGHT, 0.0); + } + } + return boundingBox; + }; + ObjectDataParser.prototype._parsePolygonBoundingBox = function (rawData) { + var polygonBoundingBox = dragonBones.BaseObject.borrowObject(dragonBones.PolygonBoundingBoxData); + if (dragonBones.DataParser.VERTICES in rawData) { + var scale = this._armature.scale; + var rawVertices = rawData[dragonBones.DataParser.VERTICES]; + var vertices = polygonBoundingBox.vertices; + vertices.length = rawVertices.length; + for (var i = 0, l = rawVertices.length; i < l; i += 2) { + var x = rawVertices[i] * scale; + var y = rawVertices[i + 1] * scale; + vertices[i] = x; + vertices[i + 1] = y; + // AABB. + if (i === 0) { + polygonBoundingBox.x = x; + polygonBoundingBox.y = y; + polygonBoundingBox.width = x; + polygonBoundingBox.height = y; + } + else { + if (x < polygonBoundingBox.x) { + polygonBoundingBox.x = x; + } + else if (x > polygonBoundingBox.width) { + polygonBoundingBox.width = x; + } + if (y < polygonBoundingBox.y) { + polygonBoundingBox.y = y; + } + else if (y > polygonBoundingBox.height) { + polygonBoundingBox.height = y; + } + } + } + polygonBoundingBox.width -= polygonBoundingBox.x; + polygonBoundingBox.height -= polygonBoundingBox.y; + } + else { + console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug."); + } + return polygonBoundingBox; + }; + ObjectDataParser.prototype._parseAnimation = function (rawData) { + var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData); + animation.blendType = dragonBones.DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, "")); + animation.frameCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0); + animation.playTimes = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1); + animation.duration = animation.frameCount / this._armature.frameRate; // float + animation.fadeInTime = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0); + animation.scale = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0); + animation.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (animation.name.length === 0) { + animation.name = dragonBones.DataParser.DEFAULT_NAME; + } + animation.frameIntOffset = this._frameIntArray.length; + animation.frameFloatOffset = this._frameFloatArray.length; + animation.frameOffset = this._frameArray.length; + this._animation = animation; + if (dragonBones.DataParser.FRAME in rawData) { + var rawFrames = rawData[dragonBones.DataParser.FRAME]; + var keyFrameCount = rawFrames.length; + if (keyFrameCount > 0) { + for (var i = 0, frameStart = 0; i < keyFrameCount; ++i) { + var rawFrame = rawFrames[i]; + this._parseActionDataInFrame(rawFrame, frameStart, null, null); + frameStart += ObjectDataParser._getNumber(rawFrame, dragonBones.DataParser.DURATION, 1); + } + } + } + if (dragonBones.DataParser.Z_ORDER in rawData) { + this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, 0 /* Step */, 0, this._parseZOrderFrame); + } + if (dragonBones.DataParser.BONE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.BONE]; + for (var _i = 0, rawTimelines_1 = rawTimelines; _i < rawTimelines_1.length; _i++) { + var rawTimeline = rawTimelines_1[_i]; + this._parseBoneTimeline(rawTimeline); + } + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.SLOT]; + for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) { + var rawTimeline = rawTimelines_2[_a]; + this._parseSlotTimeline(rawTimeline); + } + } + if (dragonBones.DataParser.FFD in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.FFD]; + for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) { + var rawTimeline = rawTimelines_3[_b]; + var skinName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME); + var slotName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SLOT, ""); + var displayName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + if (skinName.length === 0) { + skinName = dragonBones.DataParser.DEFAULT_NAME; + } + this._slot = this._armature.getSlot(slotName); + this._mesh = this._armature.getMesh(skinName, slotName, displayName); + if (this._slot === null || this._mesh === null) { + continue; + } + var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, 2 /* Float */, 0, this._parseSlotDeformFrame); + if (timeline !== null) { + this._animation.addSlotTimeline(slotName, timeline); + } + this._slot = null; // + this._mesh = null; // + } + } + if (dragonBones.DataParser.IK in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.IK]; + for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) { + var rawTimeline = rawTimelines_4[_c]; + var constraintName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var constraint = this._armature.getConstraint(constraintName); + if (constraint === null) { + continue; + } + var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, 1 /* Int */, 2, this._parseIKConstraintFrame); + if (timeline !== null) { + this._animation.addConstraintTimeline(constraintName, timeline); + } + } + } + if (this._actionFrames.length > 0) { + this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, 0 /* Step */, 0, this._parseActionFrame); + this._actionFrames.length = 0; + } + if (dragonBones.DataParser.TIMELINE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.TIMELINE]; + for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) { + var rawTimeline = rawTimelines_5[_d]; + var timelineType = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */); + var timelineName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var timeline = null; + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 20 /* SlotDisplay */: // TODO + case 23 /* SlotZIndex */: + case 60 /* BoneAlpha */: + case 24 /* SlotAlpha */: + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + if (timelineType === 20 /* SlotDisplay */) { + this._frameValueType = 0 /* Step */; + this._frameValueScale = 1.0; + } + else { + this._frameValueType = 1 /* Int */; + if (timelineType === 23 /* SlotZIndex */) { + this._frameValueScale = 1.0; + } + else if (timelineType === 40 /* AnimationProgress */ || + timelineType === 41 /* AnimationWeight */) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + if (timelineType === 60 /* BoneAlpha */ || + timelineType === 24 /* SlotAlpha */ || + timelineType === 41 /* AnimationWeight */) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData); + var animaitonTimeline = timeline; + animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0); + animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0); + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 1, this._parseSingleValueFrame, timeline); + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 30 /* IKConstraint */: + case 42 /* AnimationParameter */: + if (timelineType === 30 /* IKConstraint */ || + timelineType === 42 /* AnimationParameter */) { + this._frameValueType = 1 /* Int */; + if (timelineType === 42 /* AnimationParameter */) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + else { + if (timelineType === 12 /* BoneRotate */) { + this._frameValueScale = dragonBones.Transform.DEG_RAD; + } + else { + this._frameValueScale = 1.0; + } + this._frameValueType = 2 /* Float */; + } + if (timelineType === 13 /* BoneScale */ || + timelineType === 30 /* IKConstraint */) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 2, this._parseDoubleValueFrame); + break; + case 1 /* ZOrder */: + // TODO + break; + case 50 /* Surface */: { + var surface = this._armature.getBone(timelineName); + if (surface === null) { + continue; + } + this._geometry = surface.geometry; + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame); + this._geometry = null; // + break; + } + case 22 /* SlotDeform */: { + this._geometry = null; // + for (var skinName in this._armature.skins) { + var skin = this._armature.skins[skinName]; + for (var slontName in skin.displays) { + var displays = skin.displays[slontName]; + for (var _e = 0, displays_1 = displays; _e < displays_1.length; _e++) { + var display = displays_1[_e]; + if (display !== null && display.name === timelineName) { + this._geometry = display.geometry; + break; + } + } + } + } + if (this._geometry === null) { + continue; + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame); + this._geometry = null; // + break; + } + case 21 /* SlotColor */: + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 1 /* Int */, 1, this._parseSlotColorFrame); + break; + } + if (timeline !== null) { + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 1 /* ZOrder */: + // TODO + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 50 /* Surface */: + case 60 /* BoneAlpha */: + this._animation.addBoneTimeline(timelineName, timeline); + break; + case 20 /* SlotDisplay */: + case 21 /* SlotColor */: + case 22 /* SlotDeform */: + case 23 /* SlotZIndex */: + case 24 /* SlotAlpha */: + this._animation.addSlotTimeline(timelineName, timeline); + break; + case 30 /* IKConstraint */: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + case 42 /* AnimationParameter */: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null; // + return animation; + }; + ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, timelineType, frameValueType, frameValueCount, frameParser, timeline) { + if (timeline === void 0) { timeline = null; } + if (rawData !== null && framesKey.length > 0 && framesKey in rawData) { + rawFrames = rawData[framesKey]; + } + if (rawFrames === null) { + return null; + } + var keyFrameCount = rawFrames.length; + if (keyFrameCount === 0) { + return null; + } + var frameIntArrayLength = this._frameIntArray.length; + var frameFloatArrayLength = this._frameFloatArray.length; + var timelineOffset = this._timelineArray.length; + if (timeline === null) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData); + } + timeline.type = timelineType; + timeline.offset = timelineOffset; + this._frameValueType = frameValueType; + this._timeline = timeline; + this._timelineArray.length += 1 + 1 + 1 + 1 + 1 + keyFrameCount; + if (rawData !== null) { + this._timelineArray[timelineOffset + 0 /* TimelineScale */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0) * 100); + this._timelineArray[timelineOffset + 1 /* TimelineOffset */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0.0) * 100); + } + else { + this._timelineArray[timelineOffset + 0 /* TimelineScale */] = 100; + this._timelineArray[timelineOffset + 1 /* TimelineOffset */] = 0; + } + this._timelineArray[timelineOffset + 2 /* TimelineKeyFrameCount */] = keyFrameCount; + this._timelineArray[timelineOffset + 3 /* TimelineFrameValueCount */] = frameValueCount; + switch (this._frameValueType) { + case 0 /* Step */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0; + break; + case 1 /* Int */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset; + break; + case 2 /* Float */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset; + break; + } + if (keyFrameCount === 1) { + timeline.frameIndicesOffset = -1; + this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + 0] = frameParser.call(this, rawFrames[0], 0, 0) - this._animation.frameOffset; + } + else { + var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. + var frameIndices = this._data.frameIndices; + var frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; + timeline.frameIndicesOffset = frameIndicesOffset; + for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) { + if (frameStart + frameCount <= i && iK < keyFrameCount) { + var rawFrame = rawFrames[iK]; + frameStart = i; // frame.frameStart; + if (iK === keyFrameCount - 1) { + frameCount = this._animation.frameCount - frameStart; + } + else { + if (rawFrame instanceof ActionFrame) { + frameCount = this._actionFrames[iK + 1].frameStart - frameStart; + } + else { + frameCount = ObjectDataParser._getNumber(rawFrame, dragonBones.DataParser.DURATION, 1); + } + } + this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + iK] = frameParser.call(this, rawFrame, frameStart, frameCount) - this._animation.frameOffset; + iK++; + } + frameIndices[frameIndicesOffset + i] = iK - 1; + } + } + this._timeline = null; // + return timeline; + }; + ObjectDataParser.prototype._parseBoneTimeline = function (rawData) { + var bone = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "")); + if (bone === null) { + return; + } + this._bone = bone; + this._slot = this._armature.getSlot(this._bone.name); + if (dragonBones.DataParser.TRANSLATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, 2 /* Float */, 2, this._parseDoubleValueFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.ROTATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, 2 /* Float */, 2, this._parseBoneRotateFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.SCALE_FRAME in rawData) { + this._frameDefaultValue = 1.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, 2 /* Float */, 2, this._parseBoneScaleFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.FRAME in rawData) { + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, 2 /* Float */, 6, this._parseBoneAllFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + this._bone = null; // + this._slot = null; // + }; + ObjectDataParser.prototype._parseSlotTimeline = function (rawData) { + var slot = this._armature.getSlot(ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "")); + if (slot === null) { + return; + } + var displayTimeline = null; + var colorTimeline = null; + this._slot = slot; + if (dragonBones.DataParser.DISPLAY_FRAME in rawData) { + displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame); + } + else { + displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame); + } + if (dragonBones.DataParser.COLOR_FRAME in rawData) { + colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame); + } + else { + colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame); + } + if (displayTimeline !== null) { + this._animation.addSlotTimeline(slot.name, displayTimeline); + } + if (colorTimeline !== null) { + this._animation.addSlotTimeline(slot.name, colorTimeline); + } + this._slot = null; // + }; + ObjectDataParser.prototype._parseFrame = function (rawData, frameStart, frameCount) { + // tslint:disable-next-line:no-unused-expression + rawData; + // tslint:disable-next-line:no-unused-expression + frameCount; + var frameOffset = this._frameArray.length; + this._frameArray.length += 1; + this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart; + return frameOffset; + }; + ObjectDataParser.prototype._parseTweenFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + if (frameCount > 0) { + if (dragonBones.DataParser.CURVE in rawData) { + var sampleCount = frameCount + 1; + this._helpArray.length = sampleCount; + var isOmited = this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray); + this._frameArray.length += 1 + 1 + this._helpArray.length; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 2 /* Curve */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = isOmited ? sampleCount : -sampleCount; + for (var i = 0; i < sampleCount; ++i) { + this._frameArray[frameOffset + 3 /* FrameCurveSamples */ + i] = Math.round(this._helpArray[i] * 10000.0); + } + } + else { + var noTween = -2.0; + var tweenEasing = noTween; + if (dragonBones.DataParser.TWEEN_EASING in rawData) { + tweenEasing = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TWEEN_EASING, noTween); + } + if (tweenEasing === noTween) { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 0 /* None */; + } + else if (tweenEasing === 0.0) { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 1 /* Line */; + } + else if (tweenEasing < 0.0) { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 3 /* QuadIn */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(-tweenEasing * 100.0); + } + else if (tweenEasing <= 1.0) { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 4 /* QuadOut */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(tweenEasing * 100.0); + } + else { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 5 /* QuadInOut */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(tweenEasing * 100.0 - 100.0); + } + } + } + else { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 0 /* None */; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseSingleValueFrame = function (rawData, frameStart, frameCount) { + var frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue); + break; + } + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale); + break; + } + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 1; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + return frameOffset; + }; + ObjectDataParser.prototype._parseDoubleValueFrame = function (rawData, frameStart, frameCount) { + var frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 2; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue); + this._frameArray[frameOffset + 2] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue); + break; + } + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale); + this._frameIntArray[frameValueOffset + 1] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale); + break; + } + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale; + this._frameFloatArray[frameValueOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + return frameOffset; + }; + ObjectDataParser.prototype._parseActionFrame = function (frame, frameStart, frameCount) { + // tslint:disable-next-line:no-unused-expression + frameCount; + var frameOffset = this._frameArray.length; + var actionCount = frame.actions.length; + this._frameArray.length += 1 + 1 + actionCount; + this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart; + this._frameArray[frameOffset + 0 /* FramePosition */ + 1] = actionCount; // Action count. + for (var i = 0; i < actionCount; ++i) { + this._frameArray[frameOffset + 0 /* FramePosition */ + 2 + i] = frame.actions[i]; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseZOrderFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + if (dragonBones.DataParser.Z_ORDER in rawData) { + var rawZOrder = rawData[dragonBones.DataParser.Z_ORDER]; + if (rawZOrder.length > 0) { + var slotCount = this._armature.sortedSlots.length; + var unchanged = new Array(slotCount - rawZOrder.length / 2); + var zOrders = new Array(slotCount); + for (var i_1 = 0; i_1 < unchanged.length; ++i_1) { + unchanged[i_1] = 0; + } + for (var i_2 = 0; i_2 < slotCount; ++i_2) { + zOrders[i_2] = -1; + } + var originalIndex = 0; + var unchangedIndex = 0; + for (var i_3 = 0, l = rawZOrder.length; i_3 < l; i_3 += 2) { + var slotIndex = rawZOrder[i_3]; + var zOrderOffset = rawZOrder[i_3 + 1]; + while (originalIndex !== slotIndex) { + unchanged[unchangedIndex++] = originalIndex++; + } + var index = originalIndex + zOrderOffset; + zOrders[index] = originalIndex++; + } + while (originalIndex < slotCount) { + unchanged[unchangedIndex++] = originalIndex++; + } + this._frameArray.length += 1 + slotCount; + this._frameArray[frameOffset + 1] = slotCount; + var i = slotCount; + while (i--) { + if (zOrders[i] === -1) { + this._frameArray[frameOffset + 2 + i] = unchanged[--unchangedIndex] || 0; + } + else { + this._frameArray[frameOffset + 2 + i] = zOrders[i] || 0; + } + } + return frameOffset; + } + } + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = 0; + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneAllFrame = function (rawData, frameStart, frameCount) { + this._helpTransform.identity(); + if (dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], this._helpTransform, 1.0); + } + // Modify rotation. + var rotation = this._helpTransform.rotation; + if (frameStart !== 0) { + if (this._prevClockwise === 0) { + rotation = this._prevRotation + dragonBones.Transform.normalizeRadian(rotation - this._prevRotation); + } + else { + if (this._prevClockwise > 0 ? rotation >= this._prevRotation : rotation <= this._prevRotation) { + this._prevClockwise = this._prevClockwise > 0 ? this._prevClockwise - 1 : this._prevClockwise + 1; + } + rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise; + } + } + this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TWEEN_ROTATE, 0.0); + this._prevRotation = rotation; + // + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 6; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.x; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.y; + this._frameFloatArray[frameFloatOffset++] = rotation; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.skew; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleX; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleY; + this._parseActionDataInFrame(rawData, frameStart, this._bone, this._slot); + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneTranslateFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0); + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneRotateFrame = function (rawData, frameStart, frameCount) { + // Modify rotation. + var rotation = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE, 0.0) * dragonBones.Transform.DEG_RAD; + if (frameStart !== 0) { + if (this._prevClockwise === 0) { + rotation = this._prevRotation + dragonBones.Transform.normalizeRadian(rotation - this._prevRotation); + } + else { + if (this._prevClockwise > 0 ? rotation >= this._prevRotation : rotation <= this._prevRotation) { + this._prevClockwise = this._prevClockwise > 0 ? this._prevClockwise - 1 : this._prevClockwise + 1; + } + rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise; + } + } + this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CLOCK_WISE, 0); + this._prevRotation = rotation; + // + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = rotation; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD; + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneScaleFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 1.0); + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotDisplayFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + if (dragonBones.DataParser.VALUE in rawData) { + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, 0); + } + else { + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0); + } + this._parseActionDataInFrame(rawData, frameStart, this._slot.parent, this._slot); + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotColorFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var colorOffset = -1; + if (dragonBones.DataParser.VALUE in rawData || dragonBones.DataParser.COLOR in rawData) { + var rawColor = dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : rawData[dragonBones.DataParser.COLOR]; + for (var k in rawColor) { + // tslint:disable-next-line:no-unused-expression + k; + this._parseColorTransform(rawColor, this._helpColorTransform); + colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset); + colorOffset -= 8; + break; + } + } + if (colorOffset < 0) { + if (this._defaultColorOffset < 0) { + this._defaultColorOffset = colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + } + colorOffset = this._defaultColorOffset; + } + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameIntOffset] = colorOffset; + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotDeformFrame = function (rawData, frameStart, frameCount) { + var frameFloatOffset = this._frameFloatArray.length; + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var rawVertices = dragonBones.DataParser.VERTICES in rawData ? rawData[dragonBones.DataParser.VERTICES] : null; + var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint + var vertexCount = this._intArray[this._mesh.geometry.offset + 0 /* GeometryVertexCount */]; + var meshName = this._mesh.parent.name + "_" + this._slot.name + "_" + this._mesh.name; + var weight = this._mesh.geometry.weight; + var x = 0.0; + var y = 0.0; + var iB = 0; + var iV = 0; + if (weight !== null) { + var rawSlotPose = this._weightSlotPose[meshName]; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + this._frameFloatArray.length += weight.count * 2; + iB = weight.offset + 2 /* WeigthBoneIndices */ + weight.bones.length; + } + else { + this._frameFloatArray.length += vertexCount * 2; + } + for (var i = 0; i < vertexCount * 2; i += 2) { + if (rawVertices === null) { + x = 0.0; + y = 0.0; + } + else { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + if (weight !== null) { + var rawBonePoses = this._weightBonePoses[meshName]; + var vertexBoneCount = this._intArray[iB++]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint, true); + x = this._helpPoint.x; + y = this._helpPoint.y; + for (var j = 0; j < vertexBoneCount; ++j) { + var boneIndex = this._intArray[iB++]; + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint, true); + this._frameFloatArray[frameFloatOffset + iV++] = this._helpPoint.x; + this._frameFloatArray[frameFloatOffset + iV++] = this._helpPoint.y; + } + } + else { + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + if (frameStart === 0) { + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.geometry.offset; + this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0; + this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseIKConstraintFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameIntOffset++] = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true) ? 1 : 0; + this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseActionData = function (rawData, type, bone, slot) { + var actions = new Array(); + if (typeof rawData === "string") { + var action = dragonBones.BaseObject.borrowObject(dragonBones.ActionData); + action.type = type; + action.name = rawData; + action.bone = bone; + action.slot = slot; + actions.push(action); + } + else if (rawData instanceof Array) { + for (var _i = 0, rawData_2 = rawData; _i < rawData_2.length; _i++) { + var rawAction = rawData_2[_i]; + var action = dragonBones.BaseObject.borrowObject(dragonBones.ActionData); + if (dragonBones.DataParser.GOTO_AND_PLAY in rawAction) { + action.type = 0 /* Play */; + action.name = ObjectDataParser._getString(rawAction, dragonBones.DataParser.GOTO_AND_PLAY, ""); + } + else { + if (dragonBones.DataParser.TYPE in rawAction && typeof rawAction[dragonBones.DataParser.TYPE] === "string") { + action.type = dragonBones.DataParser._getActionType(rawAction[dragonBones.DataParser.TYPE]); + } + else { + action.type = ObjectDataParser._getNumber(rawAction, dragonBones.DataParser.TYPE, type); + } + action.name = ObjectDataParser._getString(rawAction, dragonBones.DataParser.NAME, ""); + } + if (dragonBones.DataParser.BONE in rawAction) { + var boneName = ObjectDataParser._getString(rawAction, dragonBones.DataParser.BONE, ""); + action.bone = this._armature.getBone(boneName); + } + else { + action.bone = bone; + } + if (dragonBones.DataParser.SLOT in rawAction) { + var slotName = ObjectDataParser._getString(rawAction, dragonBones.DataParser.SLOT, ""); + action.slot = this._armature.getSlot(slotName); + } + else { + action.slot = slot; + } + var userData = null; + if (dragonBones.DataParser.INTS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawInts = rawAction[dragonBones.DataParser.INTS]; + for (var _a = 0, rawInts_1 = rawInts; _a < rawInts_1.length; _a++) { + var rawValue = rawInts_1[_a]; + userData.addInt(rawValue); + } + } + if (dragonBones.DataParser.FLOATS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawFloats = rawAction[dragonBones.DataParser.FLOATS]; + for (var _b = 0, rawFloats_1 = rawFloats; _b < rawFloats_1.length; _b++) { + var rawValue = rawFloats_1[_b]; + userData.addFloat(rawValue); + } + } + if (dragonBones.DataParser.STRINGS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawStrings = rawAction[dragonBones.DataParser.STRINGS]; + for (var _c = 0, rawStrings_1 = rawStrings; _c < rawStrings_1.length; _c++) { + var rawValue = rawStrings_1[_c]; + userData.addString(rawValue); + } + } + action.data = userData; + actions.push(action); + } + } + return actions; + }; + ObjectDataParser.prototype._parseDeformFrame = function (rawData, frameStart, frameCount) { + var frameFloatOffset = this._frameFloatArray.length; + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var rawVertices = dragonBones.DataParser.VERTICES in rawData ? + rawData[dragonBones.DataParser.VERTICES] : + (dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : null); + var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint + var vertexCount = this._intArray[this._geometry.offset + 0 /* GeometryVertexCount */]; + var weight = this._geometry.weight; + var x = 0.0; + var y = 0.0; + if (weight !== null) { + // TODO + } + else { + this._frameFloatArray.length += vertexCount * 2; + for (var i = 0; i < vertexCount * 2; i += 2) { + if (rawVertices !== null) { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + else { + x = 0.0; + y = 0.0; + } + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + if (frameStart === 0) { + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._geometry.offset; + this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0; + this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseTransform = function (rawData, transform, scale) { + transform.x = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0) * scale; + transform.y = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0) * scale; + if (dragonBones.DataParser.ROTATE in rawData || dragonBones.DataParser.SKEW in rawData) { + transform.rotation = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE, 0.0) * dragonBones.Transform.DEG_RAD); + transform.skew = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD); + } + else if (dragonBones.DataParser.SKEW_X in rawData || dragonBones.DataParser.SKEW_Y in rawData) { + transform.rotation = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW_Y, 0.0) * dragonBones.Transform.DEG_RAD); + transform.skew = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW_X, 0.0) * dragonBones.Transform.DEG_RAD) - transform.rotation; + } + transform.scaleX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE_X, 1.0); + transform.scaleY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE_Y, 1.0); + }; + ObjectDataParser.prototype._parseColorTransform = function (rawData, color) { + color.alphaMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA_MULTIPLIER, 100) * 0.01; + color.redMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.RED_MULTIPLIER, 100) * 0.01; + color.greenMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_MULTIPLIER, 100) * 0.01; + color.blueMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_MULTIPLIER, 100) * 0.01; + color.alphaOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA_OFFSET, 0); + color.redOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.RED_OFFSET, 0); + color.greenOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_OFFSET, 0); + color.blueOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_OFFSET, 0); + }; + ObjectDataParser.prototype._parseGeometry = function (rawData, geometry) { + var rawVertices = rawData[dragonBones.DataParser.VERTICES]; + var vertexCount = Math.floor(rawVertices.length / 2); // uint + var triangleCount = 0; + var geometryOffset = this._intArray.length; + var verticesOffset = this._floatArray.length; + // + geometry.offset = geometryOffset; + geometry.data = this._data; + // + this._intArray.length += 1 + 1 + 1 + 1; + this._intArray[geometryOffset + 0 /* GeometryVertexCount */] = vertexCount; + this._intArray[geometryOffset + 2 /* GeometryFloatOffset */] = verticesOffset; + this._intArray[geometryOffset + 3 /* GeometryWeightOffset */] = -1; // + // + this._floatArray.length += vertexCount * 2; + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[verticesOffset + i] = rawVertices[i]; + } + if (dragonBones.DataParser.TRIANGLES in rawData) { + var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES]; + triangleCount = Math.floor(rawTriangles.length / 3); // uint + // + this._intArray.length += triangleCount * 3; + for (var i = 0, l = triangleCount * 3; i < l; ++i) { + this._intArray[geometryOffset + 4 /* GeometryVertexIndices */ + i] = rawTriangles[i]; + } + } + // Fill triangle count. + this._intArray[geometryOffset + 1 /* GeometryTriangleCount */] = triangleCount; + if (dragonBones.DataParser.UVS in rawData) { + var rawUVs = rawData[dragonBones.DataParser.UVS]; + var uvOffset = verticesOffset + vertexCount * 2; + this._floatArray.length += vertexCount * 2; + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[uvOffset + i] = rawUVs[i]; + } + } + if (dragonBones.DataParser.WEIGHTS in rawData) { + var rawWeights = rawData[dragonBones.DataParser.WEIGHTS]; + var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint + var weightOffset = this._intArray.length; + var floatOffset = this._floatArray.length; + var weightBoneCount = 0; + var sortedBones = this._armature.sortedBones; + var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData); + weight.count = weightCount; + weight.offset = weightOffset; + this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount; + this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset; + if (dragonBones.DataParser.BONE_POSE in rawData) { + var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE]; + var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE]; + var weightBoneIndices = new Array(); + weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint + weightBoneIndices.length = weightBoneCount; + for (var i = 0; i < weightBoneCount; ++i) { + var rawBoneIndex = rawBonePoses[i * 7]; // uint + var bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + weightBoneIndices[i] = rawBoneIndex; + this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone); + } + this._floatArray.length += weightCount * 3; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) { + var iD = i * 2; + var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint + var x = this._floatArray[verticesOffset + iD]; + var y = this._floatArray[verticesOffset + iD + 1]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint); + x = this._helpPoint.x; + y = this._helpPoint.y; + for (var j = 0; j < vertexBoneCount; ++j) { + var rawBoneIndex = rawWeights[iW++]; // uint + var boneIndex = weightBoneIndices.indexOf(rawBoneIndex); + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint); + this._intArray[iB++] = boneIndex; + this._floatArray[iV++] = rawWeights[iW++]; + this._floatArray[iV++] = this._helpPoint.x; + this._floatArray[iV++] = this._helpPoint.y; + } + } + } + else { + var rawBones = rawData[dragonBones.DataParser.BONES]; + weightBoneCount = rawBones.length; + for (var i = 0; i < weightBoneCount; i++) { + var rawBoneIndex = rawBones[i]; + var bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone); + } + this._floatArray.length += weightCount * 3; + for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) { + var vertexBoneCount = rawWeights[iW++]; + this._intArray[iB++] = vertexBoneCount; + for (var j = 0; j < vertexBoneCount; j++) { + var boneIndex = rawWeights[iW++]; + var boneWeight = rawWeights[iW++]; + var x = rawVertices[iV++]; + var y = rawVertices[iV++]; + this._intArray[iB++] = rawBones.indexOf(boneIndex); + this._floatArray[iF++] = boneWeight; + this._floatArray[iF++] = x; + this._floatArray[iF++] = y; + } + } + } + geometry.weight = weight; + } + }; + ObjectDataParser.prototype._parseArray = function (rawData) { + // tslint:disable-next-line:no-unused-expression + rawData; + this._intArray.length = 0; + this._floatArray.length = 0; + this._frameIntArray.length = 0; + this._frameFloatArray.length = 0; + this._frameArray.length = 0; + this._timelineArray.length = 0; + this._colorArray.length = 0; + }; + ObjectDataParser.prototype._modifyArray = function () { + // Align. + if ((this._intArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._intArray.push(0); + } + if ((this._frameIntArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._frameIntArray.push(0); + } + if ((this._frameArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._frameArray.push(0); + } + if ((this._timelineArray.length % Uint16Array.BYTES_PER_ELEMENT) !== 0) { + this._timelineArray.push(0); + } + if ((this._timelineArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._colorArray.push(0); + } + var l1 = this._intArray.length * Int16Array.BYTES_PER_ELEMENT; + var l2 = this._floatArray.length * Float32Array.BYTES_PER_ELEMENT; + var l3 = this._frameIntArray.length * Int16Array.BYTES_PER_ELEMENT; + var l4 = this._frameFloatArray.length * Float32Array.BYTES_PER_ELEMENT; + var l5 = this._frameArray.length * Int16Array.BYTES_PER_ELEMENT; + var l6 = this._timelineArray.length * Uint16Array.BYTES_PER_ELEMENT; + var l7 = this._colorArray.length * Int16Array.BYTES_PER_ELEMENT; + var lTotal = l1 + l2 + l3 + l4 + l5 + l6 + l7; + // + var binary = new ArrayBuffer(lTotal); + var intArray = new Int16Array(binary, 0, this._intArray.length); + var floatArray = new Float32Array(binary, l1, this._floatArray.length); + var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length); + var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length); + var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length); + var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length); + var colorArray = new Int16Array(binary, l1 + l2 + l3 + l4 + l5 + l6, this._colorArray.length); + for (var i = 0, l = this._intArray.length; i < l; ++i) { + intArray[i] = this._intArray[i]; + } + for (var i = 0, l = this._floatArray.length; i < l; ++i) { + floatArray[i] = this._floatArray[i]; + } + for (var i = 0, l = this._frameIntArray.length; i < l; ++i) { + frameIntArray[i] = this._frameIntArray[i]; + } + for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) { + frameFloatArray[i] = this._frameFloatArray[i]; + } + for (var i = 0, l = this._frameArray.length; i < l; ++i) { + frameArray[i] = this._frameArray[i]; + } + for (var i = 0, l = this._timelineArray.length; i < l; ++i) { + timelineArray[i] = this._timelineArray[i]; + } + for (var i = 0, l = this._colorArray.length; i < l; ++i) { + colorArray[i] = this._colorArray[i]; + } + this._data.binary = binary; + this._data.intArray = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = frameArray; + this._data.timelineArray = timelineArray; + this._data.colorArray = colorArray; + this._defaultColorOffset = -1; + }; + ObjectDataParser.prototype.parseDragonBonesData = function (rawData, scale) { + if (scale === void 0) { scale = 1; } + console.assert(rawData !== null && rawData !== undefined, "Data error."); + var version = ObjectDataParser._getString(rawData, dragonBones.DataParser.VERSION, ""); + var compatibleVersion = ObjectDataParser._getString(rawData, dragonBones.DataParser.COMPATIBLE_VERSION, ""); + if (dragonBones.DataParser.DATA_VERSIONS.indexOf(version) >= 0 || + dragonBones.DataParser.DATA_VERSIONS.indexOf(compatibleVersion) >= 0) { + var data = dragonBones.BaseObject.borrowObject(dragonBones.DragonBonesData); + data.version = version; + data.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + data.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, 24); + if (data.frameRate === 0) { + data.frameRate = 24; + } + if (dragonBones.DataParser.ARMATURE in rawData) { + this._data = data; + this._parseArray(rawData); + var rawArmatures = rawData[dragonBones.DataParser.ARMATURE]; + for (var _i = 0, rawArmatures_1 = rawArmatures; _i < rawArmatures_1.length; _i++) { + var rawArmature = rawArmatures_1[_i]; + data.addArmature(this._parseArmature(rawArmature, scale)); + } + if (!this._data.binary) { + this._modifyArray(); + } + if (dragonBones.DataParser.STAGE in rawData) { + data.stage = data.getArmature(ObjectDataParser._getString(rawData, dragonBones.DataParser.STAGE, "")); + } + else if (data.armatureNames.length > 0) { + data.stage = data.getArmature(data.armatureNames[0]); + } + this._data = null; + } + if (dragonBones.DataParser.TEXTURE_ATLAS in rawData) { + this._rawTextureAtlases = rawData[dragonBones.DataParser.TEXTURE_ATLAS]; + } + return data; + } + else { + console.assert(false, "Nonsupport data version: " + version + "\n" + + "Please convert DragonBones data to support version.\n" + + "Read more: https://github.com/DragonBones/Tools/"); + } + return null; + }; + ObjectDataParser.prototype.parseTextureAtlasData = function (rawData, textureAtlasData, scale) { + if (scale === void 0) { scale = 1.0; } + console.assert(rawData !== undefined); + if (rawData === null) { + if (this._rawTextureAtlases === null || this._rawTextureAtlases.length === 0) { + return false; + } + var rawTextureAtlas = this._rawTextureAtlases[this._rawTextureAtlasIndex++]; + this.parseTextureAtlasData(rawTextureAtlas, textureAtlasData, scale); + if (this._rawTextureAtlasIndex >= this._rawTextureAtlases.length) { + this._rawTextureAtlasIndex = 0; + this._rawTextureAtlases = null; + } + return true; + } + // Texture format. + textureAtlasData.width = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WIDTH, 0); + textureAtlasData.height = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.HEIGHT, 0); + textureAtlasData.scale = scale === 1.0 ? (1.0 / ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0)) : scale; + textureAtlasData.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + textureAtlasData.imagePath = ObjectDataParser._getString(rawData, dragonBones.DataParser.IMAGE_PATH, ""); + if (dragonBones.DataParser.SUB_TEXTURE in rawData) { + var rawTextures = rawData[dragonBones.DataParser.SUB_TEXTURE]; + for (var i = 0, l = rawTextures.length; i < l; ++i) { + var rawTexture = rawTextures[i]; + var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0); + var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0); + var textureData = textureAtlasData.createTexture(); + textureData.rotated = ObjectDataParser._getBoolean(rawTexture, dragonBones.DataParser.ROTATED, false); + textureData.name = ObjectDataParser._getString(rawTexture, dragonBones.DataParser.NAME, ""); + textureData.region.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.X, 0.0); + textureData.region.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.Y, 0.0); + textureData.region.width = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.WIDTH, 0.0); + textureData.region.height = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.HEIGHT, 0.0); + if (frameWidth > 0.0 && frameHeight > 0.0) { + textureData.frame = dragonBones.TextureData.createRectangle(); + textureData.frame.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_X, 0.0); + textureData.frame.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_Y, 0.0); + textureData.frame.width = frameWidth; + textureData.frame.height = frameHeight; + } + textureAtlasData.addTexture(textureData); + } + } + return true; + }; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + ObjectDataParser.getInstance = function () { + if (ObjectDataParser._objectDataParserInstance === null) { + ObjectDataParser._objectDataParserInstance = new ObjectDataParser(); + } + return ObjectDataParser._objectDataParserInstance; + }; + ObjectDataParser._objectDataParserInstance = null; + return ObjectDataParser; + }(dragonBones.DataParser)); + dragonBones.ObjectDataParser = ObjectDataParser; + /** + * @private + */ + var ActionFrame = (function () { + function ActionFrame() { + this.frameStart = 0; + this.actions = []; + } + return ActionFrame; + }()); + dragonBones.ActionFrame = ActionFrame; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var BinaryDataParser = (function (_super) { + __extends(BinaryDataParser, _super); + function BinaryDataParser() { + return _super !== null && _super.apply(this, arguments) || this; + } + BinaryDataParser.prototype._inRange = function (a, min, max) { + return min <= a && a <= max; + }; + BinaryDataParser.prototype._decodeUTF8 = function (data) { + var EOF_byte = -1; + var EOF_code_point = -1; + var FATAL_POINT = 0xFFFD; + var pos = 0; + var result = ""; + var code_point; + var utf8_code_point = 0; + var utf8_bytes_needed = 0; + var utf8_bytes_seen = 0; + var utf8_lower_boundary = 0; + while (data.length > pos) { + var _byte = data[pos++]; + if (_byte === EOF_byte) { + if (utf8_bytes_needed !== 0) { + code_point = FATAL_POINT; + } + else { + code_point = EOF_code_point; + } + } + else { + if (utf8_bytes_needed === 0) { + if (this._inRange(_byte, 0x00, 0x7F)) { + code_point = _byte; + } + else { + if (this._inRange(_byte, 0xC2, 0xDF)) { + utf8_bytes_needed = 1; + utf8_lower_boundary = 0x80; + utf8_code_point = _byte - 0xC0; + } + else if (this._inRange(_byte, 0xE0, 0xEF)) { + utf8_bytes_needed = 2; + utf8_lower_boundary = 0x800; + utf8_code_point = _byte - 0xE0; + } + else if (this._inRange(_byte, 0xF0, 0xF4)) { + utf8_bytes_needed = 3; + utf8_lower_boundary = 0x10000; + utf8_code_point = _byte - 0xF0; + } + else { + } + utf8_code_point = utf8_code_point * Math.pow(64, utf8_bytes_needed); + code_point = null; + } + } + else if (!this._inRange(_byte, 0x80, 0xBF)) { + utf8_code_point = 0; + utf8_bytes_needed = 0; + utf8_bytes_seen = 0; + utf8_lower_boundary = 0; + pos--; + code_point = _byte; + } + else { + utf8_bytes_seen += 1; + utf8_code_point = utf8_code_point + (_byte - 0x80) * Math.pow(64, utf8_bytes_needed - utf8_bytes_seen); + if (utf8_bytes_seen !== utf8_bytes_needed) { + code_point = null; + } + else { + var cp = utf8_code_point; + var lower_boundary = utf8_lower_boundary; + utf8_code_point = 0; + utf8_bytes_needed = 0; + utf8_bytes_seen = 0; + utf8_lower_boundary = 0; + if (this._inRange(cp, lower_boundary, 0x10FFFF) && !this._inRange(cp, 0xD800, 0xDFFF)) { + code_point = cp; + } + else { + code_point = _byte; + } + } + } + } + //Decode string + if (code_point !== null && code_point !== EOF_code_point) { + if (code_point <= 0xFFFF) { + if (code_point > 0) + result += String.fromCharCode(code_point); + } + else { + code_point -= 0x10000; + result += String.fromCharCode(0xD800 + ((code_point >> 10) & 0x3ff)); + result += String.fromCharCode(0xDC00 + (code_point & 0x3ff)); + } + } + } + return result; + }; + BinaryDataParser.prototype._parseBinaryTimeline = function (type, offset, timelineData) { + if (timelineData === void 0) { timelineData = null; } + var timeline = timelineData !== null ? timelineData : dragonBones.BaseObject.borrowObject(dragonBones.TimelineData); + timeline.type = type; + timeline.offset = offset; + this._timeline = timeline; + var keyFrameCount = this._timelineArrayBuffer[timeline.offset + 2 /* TimelineKeyFrameCount */]; + if (keyFrameCount === 1) { + timeline.frameIndicesOffset = -1; + } + else { + var frameIndicesOffset = 0; + var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. + var frameIndices = this._data.frameIndices; + frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; + timeline.frameIndicesOffset = frameIndicesOffset; + for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) { + if (frameStart + frameCount <= i && iK < keyFrameCount) { + frameStart = this._frameArrayBuffer[this._animation.frameOffset + this._timelineArrayBuffer[timeline.offset + 5 /* TimelineFrameOffset */ + iK]]; + if (iK === keyFrameCount - 1) { + frameCount = this._animation.frameCount - frameStart; + } + else { + frameCount = this._frameArrayBuffer[this._animation.frameOffset + this._timelineArrayBuffer[timeline.offset + 5 /* TimelineFrameOffset */ + iK + 1]] - frameStart; + } + iK++; + } + frameIndices[frameIndicesOffset + i] = iK - 1; + } + } + this._timeline = null; // + return timeline; + }; + BinaryDataParser.prototype._parseAnimation = function (rawData) { + var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData); + animation.blendType = dragonBones.DataParser._getAnimationBlendType(dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, "")); + animation.frameCount = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0); + animation.playTimes = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1); + animation.duration = animation.frameCount / this._armature.frameRate; // float + animation.fadeInTime = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0); + animation.scale = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0); + animation.name = dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (animation.name.length === 0) { + animation.name = dragonBones.DataParser.DEFAULT_NAME; + } + // Offsets. + var offsets = rawData[dragonBones.DataParser.OFFSET]; + animation.frameIntOffset = offsets[0]; + animation.frameFloatOffset = offsets[1]; + animation.frameOffset = offsets[2]; + this._animation = animation; + if (dragonBones.DataParser.ACTION in rawData) { + animation.actionTimeline = this._parseBinaryTimeline(0 /* Action */, rawData[dragonBones.DataParser.ACTION]); + } + if (dragonBones.DataParser.Z_ORDER in rawData) { + animation.zOrderTimeline = this._parseBinaryTimeline(1 /* ZOrder */, rawData[dragonBones.DataParser.Z_ORDER]); + } + if (dragonBones.DataParser.BONE in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.BONE]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var bone = this._armature.getBone(k); + if (bone === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addBoneTimeline(bone.name, timeline); + } + } + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.SLOT]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var slot = this._armature.getSlot(k); + if (slot === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addSlotTimeline(slot.name, timeline); + } + } + } + if (dragonBones.DataParser.CONSTRAINT in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.CONSTRAINT]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var constraint = this._armature.getConstraint(k); + if (constraint === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addConstraintTimeline(constraint.name, timeline); + } + } + } + if (dragonBones.DataParser.TIMELINE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.TIMELINE]; + for (var _i = 0, rawTimelines_6 = rawTimelines; _i < rawTimelines_6.length; _i++) { + var rawTimeline = rawTimelines_6[_i]; + var timelineOffset = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.OFFSET, 0); + if (timelineOffset >= 0) { + var timelineType = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */); + var timelineName = dragonBones.ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var timeline = null; + if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData); + var animaitonTimeline = timeline; + animaitonTimeline.x = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0); + animaitonTimeline.y = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0); + } + timeline = this._parseBinaryTimeline(timelineType, timelineOffset, timeline); + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 1 /* ZOrder */: + // TODO + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 50 /* Surface */: + case 60 /* BoneAlpha */: + this._animation.addBoneTimeline(timelineName, timeline); + break; + case 20 /* SlotDisplay */: + case 21 /* SlotColor */: + case 22 /* SlotDeform */: + case 23 /* SlotZIndex */: + case 24 /* SlotAlpha */: + this._animation.addSlotTimeline(timelineName, timeline); + break; + case 30 /* IKConstraint */: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + case 42 /* AnimationParameter */: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null; + return animation; + }; + BinaryDataParser.prototype._parseGeometry = function (rawData, geometry) { + geometry.offset = rawData[dragonBones.DataParser.OFFSET]; + geometry.data = this._data; + var weightOffset = this._intArrayBuffer[geometry.offset + 3 /* GeometryWeightOffset */]; + if (weightOffset >= 0) { + var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData); + var vertexCount = this._intArrayBuffer[geometry.offset + 0 /* GeometryVertexCount */]; + var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */]; + weight.offset = weightOffset; + for (var i = 0; i < boneCount; ++i) { + var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i]; + weight.addBone(this._rawBones[boneIndex]); + } + var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount; + var weightCount = 0; + for (var i = 0, l = vertexCount; i < l; ++i) { + var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++]; + weightCount += vertexBoneCount; + boneIndicesOffset += vertexBoneCount; + } + weight.count = weightCount; + geometry.weight = weight; + } + }; + BinaryDataParser.prototype._parseArray = function (rawData) { + var offsets = rawData[dragonBones.DataParser.OFFSET]; + var l1 = offsets[1]; + var l2 = offsets[3]; + var l3 = offsets[5]; + var l4 = offsets[7]; + var l5 = offsets[9]; + var l6 = offsets[11]; + var l7 = offsets.length > 12 ? offsets[13] : 0; // Color. + var intArray = new Int16Array(this._binary, this._binaryOffset + offsets[0], l1 / Int16Array.BYTES_PER_ELEMENT); + var floatArray = new Float32Array(this._binary, this._binaryOffset + offsets[2], l2 / Float32Array.BYTES_PER_ELEMENT); + var frameIntArray = new Int16Array(this._binary, this._binaryOffset + offsets[4], l3 / Int16Array.BYTES_PER_ELEMENT); + var frameFloatArray = new Float32Array(this._binary, this._binaryOffset + offsets[6], l4 / Float32Array.BYTES_PER_ELEMENT); + var frameArray = new Int16Array(this._binary, this._binaryOffset + offsets[8], l5 / Int16Array.BYTES_PER_ELEMENT); + var timelineArray = new Uint16Array(this._binary, this._binaryOffset + offsets[10], l6 / Uint16Array.BYTES_PER_ELEMENT); + var colorArray = l7 > 0 ? new Int16Array(this._binary, this._binaryOffset + offsets[12], l7 / Int16Array.BYTES_PER_ELEMENT) : intArray; // Color. + this._data.binary = this._binary; + this._data.intArray = this._intArrayBuffer = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = this._frameArrayBuffer = frameArray; + this._data.timelineArray = this._timelineArrayBuffer = timelineArray; + this._data.colorArray = colorArray; + }; + BinaryDataParser.prototype.parseDragonBonesData = function (rawData, scale) { + if (scale === void 0) { scale = 1; } + console.assert(rawData !== null && rawData !== undefined && rawData instanceof ArrayBuffer, "Data error."); + var tag = new Uint8Array(rawData, 0, 8); + if (tag[0] !== "D".charCodeAt(0) || + tag[1] !== "B".charCodeAt(0) || + tag[2] !== "D".charCodeAt(0) || + tag[3] !== "T".charCodeAt(0)) { + console.assert(false, "Nonsupport data."); + return null; + } + var headerLength = new Uint32Array(rawData, 8, 1)[0]; + var headerBytes = new Uint8Array(rawData, 8 + 4, headerLength); + var headerString = this._decodeUTF8(headerBytes); + var header = JSON.parse(headerString); + // + this._binaryOffset = 8 + 4 + headerLength; + this._binary = rawData; + return _super.prototype.parseDragonBonesData.call(this, header, scale); + }; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + BinaryDataParser.getInstance = function () { + if (BinaryDataParser._binaryDataParserInstance === null) { + BinaryDataParser._binaryDataParserInstance = new BinaryDataParser(); + } + return BinaryDataParser._binaryDataParserInstance; + }; + BinaryDataParser._binaryDataParserInstance = null; + return BinaryDataParser; + }(dragonBones.ObjectDataParser)); + dragonBones.BinaryDataParser = BinaryDataParser; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) + * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. + * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) + * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 + * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + var BaseFactory = (function () { + /** + * - Create a factory instance. (typically only one global factory instance is required) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) + * @version DragonBones 3.0 + * @language zh_CN + */ + function BaseFactory(dataParser) { + if (dataParser === void 0) { dataParser = null; } + /** + * @private + */ + this.autoSearch = false; + this._dragonBonesDataMap = {}; + this._textureAtlasDataMap = {}; + this._dragonBones = null; + this._dataParser = null; + if (BaseFactory._objectParser === null) { + BaseFactory._objectParser = new dragonBones.ObjectDataParser(); + } + if (BaseFactory._binaryParser === null) { + BaseFactory._binaryParser = new dragonBones.BinaryDataParser(); + } + this._dataParser = dataParser !== null ? dataParser : BaseFactory._objectParser; + } + BaseFactory.prototype._isSupportMesh = function () { + return true; + }; + BaseFactory.prototype._getTextureData = function (textureAtlasName, textureName) { + if (textureAtlasName in this._textureAtlasDataMap) { + for (var _i = 0, _a = this._textureAtlasDataMap[textureAtlasName]; _i < _a.length; _i++) { + var textureAtlasData = _a[_i]; + var textureData = textureAtlasData.getTexture(textureName); + if (textureData !== null) { + return textureData; + } + } + } + if (this.autoSearch) { + for (var k in this._textureAtlasDataMap) { + for (var _b = 0, _c = this._textureAtlasDataMap[k]; _b < _c.length; _b++) { + var textureAtlasData = _c[_b]; + if (textureAtlasData.autoSearch) { + var textureData = textureAtlasData.getTexture(textureName); + if (textureData !== null) { + return textureData; + } + } + } + } + } + return null; + }; + BaseFactory.prototype._fillBuildArmaturePackage = function (dataPackage, dragonBonesName, armatureName, skinName, textureAtlasName) { + var dragonBonesData = null; + var armatureData = null; + if (dragonBonesName.length > 0) { + if (dragonBonesName in this._dragonBonesDataMap) { + dragonBonesData = this._dragonBonesDataMap[dragonBonesName]; + armatureData = dragonBonesData.getArmature(armatureName); + } + } + if (armatureData === null && (dragonBonesName.length === 0 || this.autoSearch)) { + for (var k in this._dragonBonesDataMap) { + dragonBonesData = this._dragonBonesDataMap[k]; + if (dragonBonesName.length === 0 || dragonBonesData.autoSearch) { + armatureData = dragonBonesData.getArmature(armatureName); + if (armatureData !== null) { + dragonBonesName = k; + break; + } + } + } + } + if (armatureData !== null) { + dataPackage.dataName = dragonBonesName; + dataPackage.textureAtlasName = textureAtlasName; + dataPackage.data = dragonBonesData; + dataPackage.armature = armatureData; + dataPackage.skin = null; + if (skinName.length > 0) { + dataPackage.skin = armatureData.getSkin(skinName); + if (dataPackage.skin === null && this.autoSearch) { + for (var k in this._dragonBonesDataMap) { + var skinDragonBonesData = this._dragonBonesDataMap[k]; + var skinArmatureData = skinDragonBonesData.getArmature(skinName); + if (skinArmatureData !== null) { + dataPackage.skin = skinArmatureData.defaultSkin; + break; + } + } + } + } + if (dataPackage.skin === null) { + dataPackage.skin = armatureData.defaultSkin; + } + return true; + } + return false; + }; + BaseFactory.prototype._buildBones = function (dataPackage, armature) { + for (var _i = 0, _a = dataPackage.armature.sortedBones; _i < _a.length; _i++) { + var boneData = _a[_i]; + var bone = dragonBones.BaseObject.borrowObject(boneData.type === 0 /* Bone */ ? dragonBones.Bone : dragonBones.Surface); + bone.init(boneData, armature); + } + }; + /** + * @private + */ + BaseFactory.prototype._buildSlots = function (dataPackage, armature) { + var currentSkin = dataPackage.skin; + var defaultSkin = dataPackage.armature.defaultSkin; + if (currentSkin === null || defaultSkin === null) { + return; + } + var skinSlots = {}; + for (var k in defaultSkin.displays) { + var displays = defaultSkin.getDisplays(k); + skinSlots[k] = displays; + } + if (currentSkin !== defaultSkin) { + for (var k in currentSkin.displays) { + var displays = currentSkin.getDisplays(k); + skinSlots[k] = displays; + } + } + for (var _i = 0, _a = dataPackage.armature.sortedSlots; _i < _a.length; _i++) { + var slotData = _a[_i]; + var displayDatas = slotData.name in skinSlots ? skinSlots[slotData.name] : null; + var slot = this._buildSlot(dataPackage, slotData, armature); + if (displayDatas !== null) { + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); + if (displayData !== null) { + if (dataPackage.textureAtlasName.length > 0) { + var textureData = this._getTextureData(dataPackage.textureAtlasName, displayData.path); + slot.replaceTextureData(textureData, i); + } + var display = this._getSlotDisplay(dataPackage, displayData, slot); + slot.replaceDisplay(display, i); + } + else { + slot.replaceDisplay(null); + } + } + } + slot._setDisplayIndex(slotData.displayIndex, true); + } + }; + BaseFactory.prototype._buildConstraints = function (dataPackage, armature) { + var constraints = dataPackage.armature.constraints; + for (var k in constraints) { + var constraintData = constraints[k]; + // TODO more constraint type. + switch (constraintData.type) { + case 0 /* IK */: + var ikConstraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraint); + ikConstraint.init(constraintData, armature); + armature._addConstraint(ikConstraint); + break; + case 1 /* Path */: + var pathConstraint = dragonBones.BaseObject.borrowObject(dragonBones.PathConstraint); + pathConstraint.init(constraintData, armature); + armature._addConstraint(pathConstraint); + break; + default: + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraint); + constraint.init(constraintData, armature); + armature._addConstraint(constraint); + break; + } + } + }; + BaseFactory.prototype._buildChildArmature = function (dataPackage, _slot, displayData) { + return this.buildArmature(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage !== null ? dataPackage.textureAtlasName : ""); + }; + BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, slot) { + var dataName = dataPackage !== null ? dataPackage.dataName : displayData.parent.parent.parent.name; + var display = null; + switch (displayData.type) { + case 0 /* Image */: { + var imageDisplayData = displayData; + if (imageDisplayData.texture === null) { + imageDisplayData.texture = this._getTextureData(dataName, displayData.path); + } + display = slot.rawDisplay; + break; + } + case 2 /* Mesh */: { + var meshDisplayData = displayData; + if (meshDisplayData.texture === null) { + meshDisplayData.texture = this._getTextureData(dataName, meshDisplayData.path); + } + if (this._isSupportMesh()) { + display = slot.meshDisplay; + } + else { + display = slot.rawDisplay; + } + break; + } + case 1 /* Armature */: { + var armatureDisplayData = displayData; + var childArmature = this._buildChildArmature(dataPackage, slot, armatureDisplayData); + if (childArmature !== null) { + childArmature.inheritAnimation = armatureDisplayData.inheritAnimation; + if (!childArmature.inheritAnimation) { + var actions = armatureDisplayData.actions.length > 0 ? armatureDisplayData.actions : childArmature.armatureData.defaultActions; + if (actions.length > 0) { + for (var _i = 0, actions_6 = actions; _i < actions_6.length; _i++) { + var action = actions_6[_i]; + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + dragonBones.EventObject.actionDataToInstance(action, eventObject, slot.armature); + eventObject.slot = slot; + slot.armature._bufferAction(eventObject, false); + } + } + else { + childArmature.animation.play(); + } + } + armatureDisplayData.armature = childArmature.armatureData; // + } + display = childArmature; + break; + } + case 3 /* BoundingBox */: + break; + default: + break; + } + return display; + }; + /** + * - Parse the raw data to a DragonBonesData instance and cache it to the factory. + * @param rawData - The raw data. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for all armatures. (Default: 1.0) + * @returns DragonBonesData instance + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 + * @param rawData - 原始数据。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) + * @returns DragonBonesData 实例 + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.parseDragonBonesData = function (rawData, name, scale) { + if (name === void 0) { name = null; } + if (scale === void 0) { scale = 1.0; } + var dataParser = rawData instanceof ArrayBuffer ? BaseFactory._binaryParser : this._dataParser; + var dragonBonesData = dataParser.parseDragonBonesData(rawData, scale); + while (true) { + var textureAtlasData = this._buildTextureAtlasData(null, null); + if (dataParser.parseTextureAtlasData(null, textureAtlasData, scale)) { + this.addTextureAtlasData(textureAtlasData, name); + } + else { + textureAtlasData.returnToPool(); + break; + } + } + if (dragonBonesData !== null) { + this.addDragonBonesData(dragonBonesData, name); + } + return dragonBonesData; + }; + /** + * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. + * @param rawData - The raw texture atlas data. + * @param textureAtlas - The texture atlas object. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for the map set. (Default: 1.0) + * @returns TextureAtlasData instance + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 + * @param rawData - 原始贴图集数据。 + * @param textureAtlas - 贴图集对象。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) + * @returns TextureAtlasData 实例 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.parseTextureAtlasData = function (rawData, textureAtlas, name, scale) { + if (name === void 0) { name = null; } + if (scale === void 0) { scale = 1.0; } + var textureAtlasData = this._buildTextureAtlasData(null, null); + this._dataParser.parseTextureAtlasData(rawData, textureAtlasData, scale); + this._buildTextureAtlasData(textureAtlasData, textureAtlas || null); + this.addTextureAtlasData(textureAtlasData, name); + return textureAtlasData; + }; + /** + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN + */ + BaseFactory.prototype.updateTextureAtlases = function (textureAtlases, name) { + var textureAtlasDatas = this.getTextureAtlasData(name); + if (textureAtlasDatas !== null) { + for (var i = 0, l = textureAtlasDatas.length; i < l; ++i) { + if (i < textureAtlases.length) { + this._buildTextureAtlasData(textureAtlasDatas[i], textureAtlases[i]); + } + } + } + }; + /** + * - Get a specific DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @returns DragonBonesData instance + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 DragonBonesData 实例。 + * @param name - DragonBonesData 实例的缓存名称。 + * @returns DragonBonesData 实例 + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.getDragonBonesData = function (name) { + return (name in this._dragonBonesDataMap) ? this._dragonBonesDataMap[name] : null; + }; + /** + * - Cache a DragonBonesData instance to the factory. + * @param data - The DragonBonesData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 DragonBonesData 实例缓存到工厂中。 + * @param data - DragonBonesData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.addDragonBonesData = function (data, name) { + if (name === void 0) { name = null; } + name = name !== null ? name : data.name; + if (name in this._dragonBonesDataMap) { + if (this._dragonBonesDataMap[name] === data) { + return; + } + console.warn("Can not add same name data: " + name); + return; + } + this._dragonBonesDataMap[name] = data; + }; + /** + * - Remove a DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @param disposeData - Whether to dispose data. (Default: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 DragonBonesData 实例。 + * @param name - DragonBonesData 实例缓存名称。 + * @param disposeData - 是否释放数据。 (默认: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.removeDragonBonesData = function (name, disposeData) { + if (disposeData === void 0) { disposeData = true; } + if (name in this._dragonBonesDataMap) { + if (disposeData) { + this._dragonBones.bufferObject(this._dragonBonesDataMap[name]); + } + delete this._dragonBonesDataMap[name]; + } + }; + /** + * - Get a list of specific TextureAtlasData instances. + * @param name - The TextureAtlasData cahce name. + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 TextureAtlasData 实例列表。 + * @param name - TextureAtlasData 实例缓存名称。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.getTextureAtlasData = function (name) { + return (name in this._textureAtlasDataMap) ? this._textureAtlasDataMap[name] : null; + }; + /** + * - Cache a TextureAtlasData instance to the factory. + * @param data - The TextureAtlasData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 TextureAtlasData 实例缓存到工厂中。 + * @param data - TextureAtlasData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.addTextureAtlasData = function (data, name) { + if (name === void 0) { name = null; } + name = name !== null ? name : data.name; + var textureAtlasList = (name in this._textureAtlasDataMap) ? this._textureAtlasDataMap[name] : (this._textureAtlasDataMap[name] = []); + if (textureAtlasList.indexOf(data) < 0) { + textureAtlasList.push(data); + } + }; + /** + * - Remove a TextureAtlasData instance. + * @param name - The TextureAtlasData instance cache name. + * @param disposeData - Whether to dispose data. + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 TextureAtlasData 实例。 + * @param name - TextureAtlasData 实例的缓存名称。 + * @param disposeData - 是否释放数据。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.removeTextureAtlasData = function (name, disposeData) { + if (disposeData === void 0) { disposeData = true; } + if (name in this._textureAtlasDataMap) { + var textureAtlasDataList = this._textureAtlasDataMap[name]; + if (disposeData) { + for (var _i = 0, textureAtlasDataList_1 = textureAtlasDataList; _i < textureAtlasDataList_1.length; _i++) { + var textureAtlasData = textureAtlasDataList_1[_i]; + this._dragonBones.bufferObject(textureAtlasData); + } + } + delete this._textureAtlasDataMap[name]; + } + }; + /** + * - Get a specific armature data. + * @param name - The armature data name. + * @param dragonBonesName - The cached name for DragonbonesData instance. + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param name - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language zh_CN + */ + BaseFactory.prototype.getArmatureData = function (name, dragonBonesName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + var dataPackage = new BuildArmaturePackage(); + if (!this._fillBuildArmaturePackage(dataPackage, dragonBonesName, name, "", "")) { + return null; + } + return dataPackage.armature; + }; + /** + * - Clear all cached DragonBonesData instances and TextureAtlasData instances. + * @param disposeData - Whether to dispose data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 + * @param disposeData - 是否释放数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.clear = function (disposeData) { + if (disposeData === void 0) { disposeData = true; } + for (var k in this._dragonBonesDataMap) { + if (disposeData) { + this._dragonBones.bufferObject(this._dragonBonesDataMap[k]); + } + delete this._dragonBonesDataMap[k]; + } + for (var k in this._textureAtlasDataMap) { + if (disposeData) { + var textureAtlasDataList = this._textureAtlasDataMap[k]; + for (var _i = 0, textureAtlasDataList_2 = textureAtlasDataList; _i < textureAtlasDataList_2.length; _i++) { + var textureAtlasData = textureAtlasDataList_2[_i]; + this._dragonBones.bufferObject(textureAtlasData); + } + } + delete this._textureAtlasDataMap[k]; + } + }; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. + * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature. + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 + * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架。 + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.buildArmature = function (armatureName, dragonBonesName, skinName, textureAtlasName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + if (skinName === void 0) { skinName = ""; } + if (textureAtlasName === void 0) { textureAtlasName = ""; } + var dataPackage = new BuildArmaturePackage(); + if (!this._fillBuildArmaturePackage(dataPackage, dragonBonesName || "", armatureName, skinName || "", textureAtlasName || "")) { + console.warn("No armature data: " + armatureName + ", " + (dragonBonesName !== null ? dragonBonesName : "")); + return null; + } + var armature = this._buildArmature(dataPackage); + this._buildBones(dataPackage, armature); + this._buildSlots(dataPackage, armature); + this._buildConstraints(dataPackage, armature); + armature.invalidUpdate(null, true); + armature.advanceTime(0.0); // Update armature pose. + return armature; + }; + /** + * @private + */ + BaseFactory.prototype.replaceDisplay = function (slot, displayData, displayIndex) { + if (displayIndex === void 0) { displayIndex = -1; } + if (displayIndex < 0) { + displayIndex = slot.displayIndex; + } + if (displayIndex < 0) { + displayIndex = 0; + } + slot.replaceDisplayData(displayData, displayIndex); + if (displayData !== null) { + var display = this._getSlotDisplay(null, displayData, slot); + if (displayData.type === 0 /* Image */) { + var rawDisplayData = slot.getDisplayFrameAt(displayIndex).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.type === 2 /* Mesh */) { + display = slot.meshDisplay; + } + } + slot.replaceDisplay(display, displayIndex); + } + else { + slot.replaceDisplay(null, displayIndex); + } + }; + /** + * - Replaces the current display data for a particular slot with a specific display data. + * Specify display data with "dragonBonesName/armatureName/slotName/displayName". + * @param dragonBonesName - The DragonBonesData instance cache name. + * @param armatureName - The armature data name. + * @param slotName - The slot data name. + * @param displayName - The display data name. + * @param slot - The slot. + * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 + * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @param armatureName - 骨架数据名称。 + * @param slotName - 插槽数据名称。 + * @param displayName - 显示对象数据名称。 + * @param slot - 插槽。 + * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.replaceSlotDisplay = function (dragonBonesName, armatureName, slotName, displayName, slot, displayIndex) { + if (displayIndex === void 0) { displayIndex = -1; } + var armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); + if (armatureData === null || armatureData.defaultSkin === null) { + return false; + } + var displayData = armatureData.defaultSkin.getDisplay(slotName, displayName); + this.replaceDisplay(slot, displayData, displayIndex); + return true; + }; + /** + * @private + */ + BaseFactory.prototype.replaceSlotDisplayList = function (dragonBonesName, armatureName, slotName, slot) { + var armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); + if (!armatureData || !armatureData.defaultSkin) { + return false; + } + var displayDatas = armatureData.defaultSkin.getDisplays(slotName); + if (!displayDatas) { + return false; + } + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + this.replaceDisplay(slot, displayData, i); + } + return true; + }; + /** + * - Share specific skin data with specific armature. + * @param armature - The armature. + * @param skin - The skin data. + * @param isOverride - Whether it completely override the original skin. (Default: false) + * @param exclude - A list of slot names that do not need to be replace. + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 将特定的皮肤数据共享给特定的骨架使用。 + * @param armature - 骨架。 + * @param skin - 皮肤数据。 + * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) + * @param exclude - 不需要被替换的插槽名称列表。 + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language zh_CN + */ + BaseFactory.prototype.replaceSkin = function (armature, skin, isOverride, exclude) { + if (isOverride === void 0) { isOverride = false; } + if (exclude === void 0) { exclude = null; } + var success = false; + var defaultSkin = skin.parent.defaultSkin; + for (var _i = 0, _a = armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + if (exclude !== null && exclude.indexOf(slot.name) >= 0) { + continue; + } + var displayDatas = skin.getDisplays(slot.name); + if (displayDatas === null) { + if (defaultSkin !== null && skin !== defaultSkin) { + displayDatas = defaultSkin.getDisplays(slot.name); + } + if (displayDatas === null) { + if (isOverride) { + slot.displayFrameCount = 0; + } + continue; + } + } + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); + if (displayData !== null) { + slot.replaceDisplay(this._getSlotDisplay(null, displayData, slot), i); + } + else { + slot.replaceDisplay(null, i); + } + } + success = true; + } + return success; + }; + /** + * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. + * This enables you to make a armature template so that other armature without animations can share it's animations. + * @param armature - The armtaure. + * @param armatureData - The armature data. + * @param isOverride - Whether to completely overwrite the original animation. (Default: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 + * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 + * @param armature - 骨架。 + * @param armatureData - 骨架数据。 + * @param isOverride - 是否完全覆盖原来的动画。(默认: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language zh_CN + */ + BaseFactory.prototype.replaceAnimation = function (armature, armatureData, isOverride) { + if (isOverride === void 0) { isOverride = true; } + var skinData = armatureData.defaultSkin; + if (skinData === null) { + return false; + } + if (isOverride) { + armature.animation.animations = armatureData.animations; + } + else { + var rawAnimations = armature.animation.animations; + var animations = {}; + for (var k in rawAnimations) { + animations[k] = rawAnimations[k]; + } + for (var k in armatureData.animations) { + animations[k] = armatureData.animations[k]; + } + armature.animation.animations = animations; + } + for (var _i = 0, _a = armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + var index = 0; + for (var _b = 0, _c = slot.displayList; _b < _c.length; _b++) { + var display = _c[_b]; + if (display instanceof dragonBones.Armature) { + var displayDatas = skinData.getDisplays(slot.name); + if (displayDatas !== null && index < displayDatas.length) { + var displayData = displayDatas[index]; + if (displayData !== null && displayData.type === 1 /* Armature */) { + var childArmatureData = this.getArmatureData(displayData.path, displayData.parent.parent.parent.name); + if (childArmatureData) { + this.replaceAnimation(display, childArmatureData, isOverride); + } + } + } + } + index++; + } + } + return true; + }; + /** + * @private + */ + BaseFactory.prototype.getAllDragonBonesData = function () { + return this._dragonBonesDataMap; + }; + /** + * @private + */ + BaseFactory.prototype.getAllTextureAtlasData = function () { + return this._textureAtlasDataMap; + }; + Object.defineProperty(BaseFactory.prototype, "clock", { + /** + * - An Worldclock instance updated by engine. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 由引擎驱动的 WorldClock 实例。 + * @version DragonBones 5.7 + * @language zh_CN + */ + get: function () { + return this._dragonBones.clock; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseFactory.prototype, "dragonBones", { + /** + * @private + */ + get: function () { + return this._dragonBones; + }, + enumerable: true, + configurable: true + }); + BaseFactory._objectParser = null; + BaseFactory._binaryParser = null; + return BaseFactory; + }()); + dragonBones.BaseFactory = BaseFactory; + /** + * @private + */ + var BuildArmaturePackage = (function () { + function BuildArmaturePackage() { + this.dataName = ""; + this.textureAtlasName = ""; + this.skin = null; + } + return BuildArmaturePackage; + }()); + dragonBones.BuildArmaturePackage = BuildArmaturePackage; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +if (CC_EDITOR) { + _Scene.Sandbox._globalsVerifier_loadPluginScript.ignoreNames['dragonBones'] = true; +} +var dragonBones; +(function (dragonBones) { + var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property; + var DragonBonesAsset = (function (_super) { + __extends(DragonBonesAsset, _super); + function DragonBonesAsset() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.dragonBonesData = ""; + _this.textureAtlases = []; + _this.textures = []; + return _this; + } + __decorate([ + property + ], DragonBonesAsset.prototype, "dragonBonesData", void 0); + __decorate([ + property([cc.String]) + ], DragonBonesAsset.prototype, "textureAtlases", void 0); + __decorate([ + property([cc.Texture2D]) + ], DragonBonesAsset.prototype, "textures", void 0); + DragonBonesAsset = __decorate([ + ccclass("DragonBones.DragonBonesAsset") + ], DragonBonesAsset); + return DragonBonesAsset; + }(cc.Asset)); + dragonBones.DragonBonesAsset = DragonBonesAsset; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The Cocos texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var CocosTextureAtlasData = (function (_super) { + __extends(CocosTextureAtlasData, _super); + function CocosTextureAtlasData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._renderTexture = null; // Initial value. + return _this; + } + CocosTextureAtlasData.toString = function () { + return "[class dragonBones.CocosTextureAtlasData]"; + }; + CocosTextureAtlasData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this._renderTexture !== null) { + // this._renderTexture.dispose(); + } + this._renderTexture = null; + }; + CocosTextureAtlasData.prototype.createTexture = function () { + return dragonBones.BaseObject.borrowObject(CocosTextureData); + }; + Object.defineProperty(CocosTextureAtlasData.prototype, "renderTexture", { + /** + * - The Cocos texture. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 贴图。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._renderTexture; + }, + set: function (value) { + if (this._renderTexture === value) { + return; + } + this._renderTexture = value; + if (this._renderTexture !== null) { + for (var k in this.textures) { + var textureData = this.textures[k]; + if (textureData.renderTexture !== null) { + textureData.renderTexture.destroy(); + } + var reat = cc.rect(textureData.region.x, textureData.region.y, textureData.rotated ? textureData.region.height : textureData.region.width, textureData.rotated ? textureData.region.width : textureData.region.height); + var offset = cc.v2(); + var originSize = cc.size(reat.size.width, reat.size.height); + textureData.renderTexture = new cc.SpriteFrame(this._renderTexture, reat, textureData.rotated, offset, originSize); + } + } + else { + for (var k in this.textures) { + var textureData = this.textures[k]; + if (textureData.renderTexture !== null) { + textureData.renderTexture.destroy(); + } + textureData.renderTexture = null; + } + } + }, + enumerable: true, + configurable: true + }); + return CocosTextureAtlasData; + }(dragonBones.TextureAtlasData)); + dragonBones.CocosTextureAtlasData = CocosTextureAtlasData; + /** + * @internal + */ + var CocosTextureData = (function (_super) { + __extends(CocosTextureData, _super); + function CocosTextureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.renderTexture = null; // Initial value. + return _this; + } + CocosTextureData.toString = function () { + return "[class dragonBones.CocosTextureData]"; + }; + CocosTextureData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this.renderTexture !== null) { + this.renderTexture.destroy(); + } + this.renderTexture = null; + }; + return CocosTextureData; + }(dragonBones.TextureData)); + dragonBones.CocosTextureData = CocosTextureData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + // const _defaultItems = cc.Enum({ "None": -1 }); + // function _setItems(object: any, key: string, items: any) { + // (cc.Class as any).attr( // creator.d.ts error. + // object, + // key, + // { + // type: "Enum", + // enumList: (cc.Enum as any).getList(items), // creator.d.ts error. + // } + // ); + // } + var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, executeInEditMode = _a.executeInEditMode, disallowMultiple = _a.disallowMultiple, playOnFocus = _a.playOnFocus, menu = _a.menu, help = _a.help; + /** + * @see dragonBones.IArmatureProxy + */ + var CocosArmatureComponent = (function (_super) { + __extends(CocosArmatureComponent, _super); + function CocosArmatureComponent() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.debugDraw = false; + _this._debugDraw = false; + /** + * @internal + */ + _this._armature = null; + // Editor. + /** + * @internal + */ + _this._armatureName = ""; + /** + * @internal + */ + _this._animationName = ""; + // Visibie. + /** + * @internal + */ + _this._dragonBonesAsset = null; + /** + * @internal + */ + _this._armatureNames = []; + /** + * @internal + */ + _this._animationNames = []; + /** + * @internal + */ + _this._playTimes = -1; + /** + * @internal + */ + _this._timeScale = 1.0; + return _this; + } + CocosArmatureComponent.prototype.dbInit = function (armature) { + this._armature = armature; + }; + CocosArmatureComponent.prototype.dbClear = function () { + this._armature = null; + _super.prototype.destroy.call(this); + }; + CocosArmatureComponent.prototype.dbUpdate = function () { + var drawed = dragonBones.DragonBones.debugDraw || this.debugDraw; + if (drawed || this._debugDraw) { + this._debugDraw = drawed; + } + }; + CocosArmatureComponent.prototype.dispose = function (_isposeProxy) { + if (_isposeProxy === void 0) { _isposeProxy = true; } + if (this._armature !== null) { + this._armature.dispose(); + this._armature = null; + } + }; + CocosArmatureComponent.prototype.destroy = function () { + this.dispose(); + if (false) { + _super.prototype.destroy.call(this); + } + return true; + }; + /** + * @private + */ + CocosArmatureComponent.prototype.dispatchDBEvent = function (type, eventObject) { + var event = new cc.Event.EventCustom(type, false); + event.setUserData(eventObject); + this.node.dispatchEvent(event); + }; + CocosArmatureComponent.prototype.hasDBEventListener = function (type) { + return this.node.hasEventListener(type, false); // creator.d.ts error. + }; + CocosArmatureComponent.prototype.addDBEventListener = function (type, listener, target) { + this.node.on(type, listener, target); + }; + CocosArmatureComponent.prototype.removeDBEventListener = function (type, listener, target) { + this.node.off(type, listener, target); + }; + Object.defineProperty(CocosArmatureComponent.prototype, "armature", { + get: function () { + return this._armature; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CocosArmatureComponent.prototype, "animation", { + get: function () { + return this._armature.animation; + }, + enumerable: true, + configurable: true + }); + CocosArmatureComponent.prototype.start = function () { + }; + __decorate([ + property + ], CocosArmatureComponent.prototype, "_armatureName", void 0); + __decorate([ + property + ], CocosArmatureComponent.prototype, "_animationName", void 0); + __decorate([ + property({ + type: dragonBones.DragonBonesAsset, + displayName: "DragonBones", + tooltip: "DragonBones Asset", + visible: true, + }) + ], CocosArmatureComponent.prototype, "_dragonBonesAsset", void 0); + __decorate([ + property({ + type: [cc.String], + displayName: "Armature", + tooltip: "The armature name.", + visible: true, + editorOnly: true, + serializable: false, + }) + ], CocosArmatureComponent.prototype, "_armatureNames", void 0); + __decorate([ + property({ + type: [cc.String], + displayName: "Animation", + tooltip: "The animation name.", + visible: true, + editorOnly: true, + serializable: false, + }) + ], CocosArmatureComponent.prototype, "_animationNames", void 0); + __decorate([ + property({ + type: cc.Integer, + displayName: "Play times", + tooltip: "The animation play times.", + visible: true, + slide: true, + range: [-1, 99, 1], + }) + ], CocosArmatureComponent.prototype, "_playTimes", void 0); + __decorate([ + property({ + type: cc.Float, + displayName: "TimeScale", + tooltip: "The animation play speed.", + visible: true, + slide: true, + range: [-2, 2, 0.01], + }) + ], CocosArmatureComponent.prototype, "_timeScale", void 0); + CocosArmatureComponent = __decorate([ + ccclass("CocosArmatureComponent"), + executeInEditMode, + disallowMultiple, + playOnFocus, + menu("DragonBones/Armature"), + executeInEditMode, + help("https://github.com/DragonBones/") + ], CocosArmatureComponent); + return CocosArmatureComponent; + }(cc.Component)); + dragonBones.CocosArmatureComponent = CocosArmatureComponent; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The Cocos slot. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 插槽。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var CocosSlot = (function (_super) { + __extends(CocosSlot, _super); + function CocosSlot() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._ccMeshDirty = false; + return _this; + } + CocosSlot.toString = function () { + return "[class dragonBones.CocosSlot]"; + }; + CocosSlot.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._textureScale = 1.0; + this._renderDisplay = null; + }; + CocosSlot.prototype._initDisplay = function (_value, _isRetain) { + }; + CocosSlot.prototype._disposeDisplay = function (value, isRelease) { + if (!isRelease) { + value.destroy(); + } + }; + CocosSlot.prototype._onUpdateDisplay = function () { + this._renderDisplay = (this._display ? this._display : this._rawDisplay); + }; + CocosSlot.prototype._addDisplay = function () { + var container = this._armature.display; + container.addChild(this._renderDisplay, this._zOrder); + }; + CocosSlot.prototype._replaceDisplay = function (value) { + var container = this._armature.display; + var prevDisplay = value; + if (this._renderDisplay.parent !== container) { + container.addChild(this._renderDisplay, prevDisplay.getLocalZOrder()); + } + // container.removeChild(prevDisplay, false); + this._renderDisplay.active = true; + prevDisplay.active = false; + this._textureScale = 1.0; + }; + CocosSlot.prototype._removeDisplay = function () { + this._renderDisplay.parent.removeChild(this._renderDisplay, false); + }; + CocosSlot.prototype._updateZOrder = function () { + if (this._renderDisplay.getLocalZOrder() === this._zOrder) { + return; + } + this._renderDisplay.setLocalZOrder(this._zOrder); + }; + /** + * @internal + */ + CocosSlot.prototype._updateVisible = function () { + this._renderDisplay.active = this._parent.visible && this._visible; + }; + CocosSlot.prototype._updateBlendMode = function () { + var sprite = this._renderDisplay.getComponent(cc.Sprite); + if (sprite) { + switch (this._blendMode) { + case 0 /* Normal */: + break; + case 1 /* Add */: + var texture = sprite.spriteFrame.getTexture(); + var BlendFunc = cc.BlendFunc; // creator.d.ts error. + if (texture && texture.hasPremultipliedAlpha()) { + sprite._sgNode.setBlendFunc(BlendFunc.BlendFactor.ONE, BlendFunc.BlendFactor.ONE); // creator.d.ts error. + } + else { + sprite._sgNode.setBlendFunc(BlendFunc.BlendFactor.SRC_ALPHA, BlendFunc.BlendFactor.ONE); // creator.d.ts error. + } + break; + case 3 /* Darken */: + break; + case 4 /* Difference */: + break; + case 6 /* HardLight */: + break; + case 9 /* Lighten */: + break; + case 10 /* Multiply */: + break; + case 11 /* Overlay */: + break; + case 12 /* Screen */: + break; + default: + break; + } + } + else if (this._childArmature !== null) { + for (var _i = 0, _a = this._childArmature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + slot._blendMode = this._blendMode; + slot._updateBlendMode(); + } + } + }; + CocosSlot.prototype._updateColor = function () { + var alpha = this._colorTransform.alphaMultiplier * this._globalAlpha * 255; + var color = this._renderDisplay.color; + this._renderDisplay.opacity = alpha; + color.setR(this._colorTransform.redMultiplier * 0xFF); + color.setG(this._colorTransform.greenMultiplier * 0xFF); + color.setB(this._colorTransform.blueMultiplier * 0xFF); + this._renderDisplay.setColor(color); // creator.d.ts error. + }; + CocosSlot.prototype._updateFrame = function () { + var currentTextureData = this._textureData; + var sprite = this._renderDisplay.getComponent(cc.Sprite); + if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) { + var currentTextureAtlasData = currentTextureData.parent; + if (this._armature.replacedTexture !== null) { + if (this._armature._replaceTextureAtlasData === null) { + currentTextureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.CocosTextureAtlasData); + currentTextureAtlasData.copyFrom(currentTextureData.parent); + currentTextureAtlasData.renderTexture = this._armature.replacedTexture; + this._armature._replaceTextureAtlasData = currentTextureAtlasData; + } + else { + currentTextureAtlasData = this._armature._replaceTextureAtlasData; + } + currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name); + } + var renderTexture = currentTextureData.renderTexture; + if (renderTexture !== null) { + if (this._geometryData !== null) { + var data = this._geometryData.data; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[this._geometryData.offset + 0 /* GeometryVertexCount */]; + var triangleCount = intArray[this._geometryData.offset + 1 /* GeometryTriangleCount */]; + var vertexOffset = intArray[this._geometryData.offset + 2 /* GeometryFloatOffset */]; + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + var uvOffset = vertexOffset + vertexCount * 2; + var scale = this._armature._armatureData.scale; + var textureAtlasSize = renderTexture.getTexture().getContentSizeInPixels(); + var textureAtlasWidth = currentTextureAtlasData.width > 0.0 ? currentTextureAtlasData.width : textureAtlasSize.width; + var textureAtlasHeight = currentTextureAtlasData.height > 0.0 ? currentTextureAtlasData.height : textureAtlasSize.height; + var region = currentTextureData.region; + var boundsRect = cc.rect(999999.0, 999999.0, -999999.0, -999999.0); + var polygonInfo = { + triangles: { + verts: [], + indices: [] + }, + rect: boundsRect + }; + for (var i = 0, l = vertexCount * 2; i < l; i += 2) { + var vertex = { + x: floatArray[vertexOffset + i] * scale, + y: -floatArray[vertexOffset + i + 1] * scale, + u: floatArray[uvOffset + i], + v: floatArray[uvOffset + i + 1] + }; + if (currentTextureData.rotated) { + var backU = vertex.u; + vertex.u = (region.x + (1.0 - vertex.v) * region.width) / textureAtlasWidth; + vertex.v = (region.y + backU * region.height) / textureAtlasHeight; + } + else { + vertex.u = (region.x + vertex.u * region.width) / textureAtlasWidth; + vertex.v = (region.y + vertex.v * region.height) / textureAtlasHeight; + } + polygonInfo.triangles.verts[i / 2] = vertex; + if (boundsRect.x > vertex.x) { + boundsRect.x = vertex.x; + } + if (boundsRect.width < vertex.x) { + boundsRect.width = vertex.x; + } + if (boundsRect.y > vertex.y) { + boundsRect.y = vertex.y; + } + if (boundsRect.height < vertex.y) { + boundsRect.height = vertex.y; + } + } + for (var i = 0; i < triangleCount * 3; ++i) { + polygonInfo.triangles.indices[i] = intArray[this._geometryData.offset + 4 /* GeometryVertexIndices */ + i]; + } + this._textureScale = 1.0; + sprite._sgNode.setRenderingType(cc.Scale9Sprite.RenderingType.MESH); // creator.d.ts error. + sprite.spriteFrame = renderTexture; + sprite._sgNode.setMeshPolygonInfo(polygonInfo); // creator.d.ts error. + sprite._sgNode.setContentSize(cc.size(boundsRect.width, boundsRect.height)); // creator.d.ts error. + var isSkinned = this._geometryData.weight !== null; + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + if (isSkinned || isSurface) { + this._identityTransform(); + } + // Delay to update cocos mesh. (some cocos bug.) + this._ccMeshDirty = true; + } + else { + this._textureScale = currentTextureData.parent.scale * this._armature._armatureData.scale; + sprite._sgNode.setRenderingType(cc.Scale9Sprite.RenderingType.SIMPLE); // creator.d.ts error. + sprite.spriteFrame = renderTexture; + sprite._sgNode.setContentSize(renderTexture.getOriginalSize()); // creator.d.ts error. + } + this._visibleDirty = true; + // this._blendModeDirty = true; + // this._colorDirty = true; + return; + } + } + this._renderDisplay.active = false; + this._renderDisplay.setPosition(0.0, 0.0); + }; + CocosSlot.prototype._updateMesh = function () { + var scale = this._armature._armatureData.scale; + var deformVertices = this._displayFrame.deformVertices; + var bones = this._geometryBones; + var geometryData = this._geometryData; + var weightData = geometryData.weight; + var hasDeform = deformVertices.length > 0 && geometryData.inheritDeform; + var meshDisplay = this._renderDisplay.getComponent(cc.Sprite)._sgNode; // as cc.Scale9Sprite; + var polygonInfo = meshDisplay.getMeshPolygonInfo(); + if (!polygonInfo) { + return; + } + var verticesAndUVs = polygonInfo.triangles.verts; + var boundsRect = cc.rect(999999.0, 999999.0, -999999.0, -999999.0); + if (weightData !== null) { + var data = geometryData.data; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometryData.offset + 0 /* GeometryVertexCount */]; + var weightFloatOffset = intArray[weightData.offset + 1 /* WeigthFloatOffset */]; + if (weightFloatOffset < 0) { + weightFloatOffset += 65536; // Fixed out of bouds bug. + } + for (var i = 0, iB = weightData.offset + 2 /* WeigthBoneIndices */ + bones.length, iV = weightFloatOffset, iF = 0; i < vertexCount; ++i) { + var boneCount = intArray[iB++]; + var xG = 0.0, yG = 0.0; + for (var j = 0; j < boneCount; ++j) { + var boneIndex = intArray[iB++]; + var bone = bones[boneIndex]; + if (bone !== null) { + var matrix = bone.globalTransformMatrix; + var weight = floatArray[iV++]; + var xL = floatArray[iV++] * scale; + var yL = floatArray[iV++] * scale; + if (hasDeform) { + xL += deformVertices[iF++]; + yL += deformVertices[iF++]; + } + xG += (matrix.a * xL + matrix.c * yL + matrix.tx) * weight; + yG += (matrix.b * xL + matrix.d * yL + matrix.ty) * weight; + } + } + var vertex = verticesAndUVs[i]; + vertex.x = xG; + vertex.y = yG; + if (boundsRect.x > xG) { + boundsRect.x = xG; + } + if (boundsRect.width < xG) { + boundsRect.width = xG; + } + if (boundsRect.y > yG) { + boundsRect.y = yG; + } + if (boundsRect.height < yG) { + boundsRect.height = yG; + } + } + } + else { + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + var data = geometryData.data; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometryData.offset + 0 /* GeometryVertexCount */]; + var vertexOffset = intArray[geometryData.offset + 2 /* GeometryFloatOffset */]; + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + for (var i = 0, l = vertexCount * 2; i < l; i += 2) { + var iH = i / 2; // int. + var x = floatArray[vertexOffset + i] * scale; + var y = floatArray[vertexOffset + i + 1] * scale; + if (hasDeform) { + x += deformVertices[i]; + y += deformVertices[i + 1]; + } + var vertex = verticesAndUVs[iH]; + if (isSurface) { + var matrix = this._parent._getGlobalTransformMatrix(x, y); + vertex.x = matrix.a * x + matrix.c * y + matrix.tx; + vertex.y = matrix.b * x + matrix.d * y + matrix.ty; + // + x = vertex.x; + y = vertex.y; + } + else { + vertex.x = x; + y = vertex.y = -y; + } + if (boundsRect.x > x) { + boundsRect.x = x; + } + if (boundsRect.width < x) { + boundsRect.width = x; + } + if (boundsRect.y > y) { + boundsRect.y = y; + } + if (boundsRect.height < y) { + boundsRect.height = y; + } + } + } + boundsRect.width -= boundsRect.x; + boundsRect.height -= boundsRect.y; + polygonInfo.rect = boundsRect; + meshDisplay.setContentSize(cc.size(boundsRect.width, boundsRect.height)); + meshDisplay.setMeshPolygonInfo(polygonInfo); + if (weightData !== null) { + this._identityTransform(); + } + else { + var transform = this.global; + var globalTransformMatrix = this.globalTransformMatrix; + this._renderDisplay.x = transform.x - (globalTransformMatrix.a * this._pivotX - globalTransformMatrix.c * this._pivotY); + this._renderDisplay.y = transform.y - (globalTransformMatrix.b * this._pivotX - globalTransformMatrix.d * this._pivotY); + this._renderDisplay.rotationX = -(transform.rotation + transform.skew) * dragonBones.Transform.RAD_DEG; + this._renderDisplay.rotationY = -transform.rotation * dragonBones.Transform.RAD_DEG; + this._renderDisplay.scaleX = transform.scaleX * this._textureScale; + this._renderDisplay.scaleY = -transform.scaleY * this._textureScale; + } + if (this._ccMeshDirty) { + this._ccMeshDirty = false; + this._verticesDirty = true; + } + }; + CocosSlot.prototype._updateTransform = function () { + // const globalTransformMatrix = this.globalTransformMatrix; + // const helpMatrix = TransformObject._helpMatrix; + // helpMatrix.a = globalTransformMatrix.a; + // helpMatrix.b = globalTransformMatrix.b; + // helpMatrix.c = -globalTransformMatrix.c; + // helpMatrix.d = -globalTransformMatrix.d; + // if (this._renderDisplay === this._rawDisplay || this._renderDisplay === this._meshDisplay) { + // helpMatrix.tx = globalTransformMatrix.tx - (globalTransformMatrix.a * this._pivotX + globalTransformMatrix.c * this._pivotY); + // helpMatrix.ty = (globalTransformMatrix.ty - (globalTransformMatrix.b * this._pivotX + globalTransformMatrix.d * this._pivotY)); + // } + // else { + // helpMatrix.tx = globalTransformMatrix.tx; + // helpMatrix.ty = globalTransformMatrix.ty; + // } + // (this._renderDisplay as any)._sgNode._renderCmd.setNodeToParentTransform(helpMatrix); // creator.d.ts error. + this.updateGlobalTransform(); + var transform = this.global; + var globalTransformMatrix = this.globalTransformMatrix; + if (this._renderDisplay === this._rawDisplay || this._renderDisplay === this._meshDisplay) { + this._renderDisplay.x = transform.x - (globalTransformMatrix.a * this._pivotX - globalTransformMatrix.c * this._pivotY); + this._renderDisplay.y = transform.y - (globalTransformMatrix.b * this._pivotX - globalTransformMatrix.d * this._pivotY); + } + else { + this._renderDisplay.x = transform.x; + this._renderDisplay.y = transform.y; + } + this._renderDisplay.rotationX = -(transform.rotation + transform.skew) * dragonBones.Transform.RAD_DEG; + this._renderDisplay.rotationY = -transform.rotation * dragonBones.Transform.RAD_DEG; + this._renderDisplay.scaleX = transform.scaleX * this._textureScale; + this._renderDisplay.scaleY = -transform.scaleY * this._textureScale; + }; + CocosSlot.prototype._identityTransform = function () { + // const helpMatrix = TransformObject._helpMatrix; + // helpMatrix.a = 1.0; + // helpMatrix.b = 0.0; + // helpMatrix.c = -0.0; + // helpMatrix.d = -1.0; + // helpMatrix.tx = 0.0; + // helpMatrix.ty = 0.0; + // (this._renderDisplay as any)._renderCmd.setNodeToParentTransform(helpMatrix); + this._renderDisplay.x = 0.0; + this._renderDisplay.y = 0.0; + this._renderDisplay.rotationX = 0.0; + this._renderDisplay.rotationY = 0.0; + this._renderDisplay.scaleX = 1.0; + this._renderDisplay.scaleY = 1.0; + }; + return CocosSlot; + }(dragonBones.Slot)); + dragonBones.CocosSlot = CocosSlot; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + var ccclass = cc._decorator.ccclass; + var ClockHandler = (function (_super) { + __extends(ClockHandler, _super); + function ClockHandler() { + return _super !== null && _super.apply(this, arguments) || this; + } + ClockHandler.prototype.update = function (passedTime) { + CocosFactory.factory.dragonBones.advanceTime(passedTime); + }; + ClockHandler = __decorate([ + ccclass + ], ClockHandler); + return ClockHandler; + }(cc.Component)); + /** + * - The Cocos factory. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Cocos 工厂。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var CocosFactory = (function (_super) { + __extends(CocosFactory, _super); + function CocosFactory(dataParser) { + if (dataParser === void 0) { dataParser = null; } + var _this = _super.call(this, dataParser) || this; + _this._node = null; + _this._armatureNode = null; + if (!CC_EDITOR) { + if (_this._node === null) { + var nodeName = "DragonBones Node"; + _this._node = cc.find(nodeName); + if (_this._node === null) { + _this._node = new cc.Node(nodeName); + cc.game.addPersistRootNode(_this._node); + } + } + if (!_this._node.getComponent(ClockHandler)) { + _this._node.addComponent(ClockHandler); + } + var eventManager = _this._node.getComponent(dragonBones.CocosArmatureComponent) || _this._node.addComponent(dragonBones.CocosArmatureComponent); + if (CocosFactory._dragonBonesInstance === null) { + CocosFactory._dragonBonesInstance = new dragonBones.DragonBones(eventManager); + // + dragonBones.DragonBones.yDown = false; + } + } + else { + if (CocosFactory._dragonBonesInstance === null) { + CocosFactory._dragonBonesInstance = new dragonBones.DragonBones(null); + // + dragonBones.DragonBones.yDown = false; + } + } + _this._dragonBones = CocosFactory._dragonBonesInstance; + return _this; + } + Object.defineProperty(CocosFactory, "factory", { + /** + * - A global factory instance that can be used directly. + * @version DragonBones 4.7 + * @language en_US + */ + /** + * - 一个可以直接使用的全局工厂实例。 + * @version DragonBones 4.7 + * @language zh_CN + */ + get: function () { + if (this._factory === null) { + this._factory = new CocosFactory(); + } + return this._factory; + }, + enumerable: true, + configurable: true + }); + CocosFactory.prototype._isSupportMesh = function () { + if (cc._renderType !== cc.game.RENDER_TYPE_WEBGL) { + console.warn("Only webgl mode can support mesh."); + return false; + } + return true; + }; + CocosFactory.prototype._buildTextureAtlasData = function (textureAtlasData, textureAtlas) { + if (textureAtlasData !== null) { + textureAtlasData.renderTexture = textureAtlas; + } + else { + textureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.CocosTextureAtlasData); + } + return textureAtlasData; + }; + CocosFactory.prototype._buildArmature = function (dataPackage) { + var armature = dragonBones.BaseObject.borrowObject(dragonBones.Armature); + var armatureDisplay = this._armatureNode === null ? new cc.Node(dataPackage.armature.name) : this._armatureNode; + var armatureComponent = armatureDisplay.getComponent(dragonBones.CocosArmatureComponent) || armatureDisplay.addComponent(dragonBones.CocosArmatureComponent); + armatureDisplay.setOpacityModifyRGB(false); + armatureDisplay.setCascadeOpacityEnabled(true); + armatureDisplay._sgNode.setCascadeColorEnabled(true); // creator.d.ts error. + this._armatureNode = null; + armatureComponent._armature = armature; + armature.init(dataPackage.armature, armatureComponent, armatureDisplay, this._dragonBones); + return armature; + }; + CocosFactory.prototype._buildChildArmature = function (dataPackage, slot, displayData) { + var childDisplayName = slot.slotData.name + " (" + displayData.path.replace("/", "_") + ")"; // + var proxy = slot.armature.proxy; + var childNode = cc.find(childDisplayName, proxy.node); + var childArmature = null; + if (!childNode) { + if (dataPackage !== null) { + childArmature = this.buildArmature(displayData.path, dataPackage.dataName); + } + else { + childArmature = this.buildArmature(displayData.path, displayData.parent.parent.parent.name); + } + } + else { + var childArmatureComponent = childNode.getComponent(dragonBones.CocosArmatureComponent) || null; + if (childArmatureComponent === null) { + if (dataPackage !== null) { + childArmatureComponent = this.buildArmatureComponent(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage.textureAtlasName, childNode); + } + else { + childArmatureComponent = this.buildArmatureComponent(displayData.path, "", "", "", childNode); + } + } + if (childArmatureComponent !== null) { + childArmature = childArmatureComponent.armature; + } + } + if (childArmature === null) { + return null; + } + var childArmatureDisplay = childArmature.display; + childArmatureDisplay.name = childDisplayName; + if (childArmatureDisplay.parent !== proxy.node) { + proxy.node.addChild(childArmatureDisplay, slot._zOrder); + } + childArmatureDisplay.active = false; + return childArmature; + }; + CocosFactory.prototype._buildSlot = function (_dataPackage, slotData, armature) { + var slot = dragonBones.BaseObject.borrowObject(dragonBones.CocosSlot); + var armatureDisplay = armature.display; + var rawSlotDisplay = cc.find(slotData.name, armatureDisplay) || new cc.Node(slotData.name); + rawSlotDisplay.addComponent(cc.Sprite); + rawSlotDisplay.setAnchorPoint(0.0, 0.0); + rawSlotDisplay.setOpacityModifyRGB(false); + rawSlotDisplay.setCascadeOpacityEnabled(true); + rawSlotDisplay._sgNode.setCascadeColorEnabled(true); // creator.d.ts error. + slot.init(slotData, armature, rawSlotDisplay, rawSlotDisplay); + return slot; + }; + /** + * - Create a armature component from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it. + * - The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update. + * - Note that when the created armature proxy that is no longer in use, you need to explicitly dispose {@link #dragonBones.IArmatureProxy#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature component. + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + * + *
+         *     let armatureComponent = factory.buildArmatureComponent("armatureName", "dragonBonesName");
+         * 
+ * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架组件,并用 {@link #clock} 更新该骨架。 + * - 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。 + * - 注意,创建的骨架代理不再使用时,需要显式释放 {@link #dragonBones.IArmatureProxy#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架组件。 + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + * + *
+         *     let armatureComponent = factory.buildArmatureComponent("armatureName", "dragonBonesName");
+         * 
+ * @language zh_CN + */ + CocosFactory.prototype.buildArmatureComponent = function (armatureName, dragonBonesName, skinName, textureAtlasName, node) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + if (skinName === void 0) { skinName = ""; } + if (textureAtlasName === void 0) { textureAtlasName = ""; } + if (node === void 0) { node = null; } + this._armatureNode = node; + var armature = this.buildArmature(armatureName, dragonBonesName || "", skinName || "", textureAtlasName || ""); + if (armature !== null) { + this._dragonBones.clock.add(armature); + return armature.proxy; + } + return null; + }; + /** + * - Create the display object with the specified texture. + * @param textureName - The texture data name. + * @param textureAtlasName - The texture atlas data name. (Of not set, all texture atlas data will be searched) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建带有指定贴图的显示对象。 + * @param textureName - 贴图数据名称。 + * @param textureAtlasName - 贴图集数据名称。 (如果未设置,将检索所有的贴图集数据) + * @version DragonBones 3.0 + * @language zh_CN + */ + CocosFactory.prototype.getTextureDisplay = function (textureName, textureAtlasName) { + if (textureAtlasName === void 0) { textureAtlasName = null; } + var textureData = this._getTextureData(textureAtlasName !== null ? textureAtlasName : "", textureName); + if (textureData !== null && textureData.renderTexture !== null) { + var texture = textureData.renderTexture; + var sprite = new cc.Sprite(); + sprite.spriteFrame = texture; + return sprite; + } + return null; + }; + Object.defineProperty(CocosFactory.prototype, "soundEventManager", { + /** + * - A global sound event manager. + * Sound events can be listened to uniformly from the manager. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 全局声音事件管理器。 + * 声音事件可以从该管理器统一侦听。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._dragonBones.eventManager.node; + }, + enumerable: true, + configurable: true + }); + CocosFactory._dragonBonesInstance = null; + CocosFactory._factory = null; + return CocosFactory; + }(dragonBones.BaseFactory)); + dragonBones.CocosFactory = CocosFactory; +})(dragonBones || (dragonBones = {})); diff --git a/Cocos/Demos/packages/dragonbones/assets/dragonBones.js.meta b/Cocos/Demos/packages/dragonbones/assets/dragonBones.js.meta new file mode 100644 index 00000000..682bdb23 --- /dev/null +++ b/Cocos/Demos/packages/dragonbones/assets/dragonBones.js.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "72d29433-04e7-47ff-99b8-1c2de3cc3913", + "isPlugin": true, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": true, + "subMetas": {} +} \ No newline at end of file diff --git a/Cocos/Demos/packages/dragonbones/editor/dragonbones-asset.js b/Cocos/Demos/packages/dragonbones/editor/dragonbones-asset.js new file mode 100644 index 00000000..d9e3a3ff --- /dev/null +++ b/Cocos/Demos/packages/dragonbones/editor/dragonbones-asset.js @@ -0,0 +1,66 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property; +var DragonBonesAsset = /** @class */ (function (_super) { + __extends(DragonBonesAsset, _super); + function DragonBonesAsset() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.dragonBonesData = ""; + _this.textureAtlases = []; + _this.textures = []; + return _this; + } + __decorate([ + property + ], DragonBonesAsset.prototype, "dragonBonesData", void 0); + __decorate([ + property([cc.String]) + ], DragonBonesAsset.prototype, "textureAtlases", void 0); + __decorate([ + property + ], DragonBonesAsset.prototype, "textures", void 0); + DragonBonesAsset = __decorate([ + ccclass("DragonBones.DragonBonesAsset") + ], DragonBonesAsset); + return DragonBonesAsset; +}(cc.Asset)); + +module.exports = DragonBonesAsset; diff --git a/Cocos/Demos/packages/dragonbones/editor/dragonbones-meta.js b/Cocos/Demos/packages/dragonbones/editor/dragonbones-meta.js new file mode 100644 index 00000000..f12fb1d7 --- /dev/null +++ b/Cocos/Demos/packages/dragonbones/editor/dragonbones-meta.js @@ -0,0 +1,85 @@ + +require('./polyfills'); + +const fs = require('fire-fs'); +const ps = require('fire-path'); +const { promisify } = require('util'); + +const DragonBonesAsset = Editor.isMainProcess ? require('./dragonbones-asset') : dragonBones.DragonBonesAsset; + +const DRAGONBONES_ENCODING = 'utf8'; + +function searchAtlas (skeletonPath) { + function next (index) { + var path = skeletonPath.replace(/_ske\.json$/i, '_tex.json'); + var exists = fs.existsSync(path); + if (exists) { + return path; + } + else { + throw new Error(`Can not find ${path}`); + } + } + return next(0); +} + +async function loadAtlas (skeletonPath) { + var path = searchAtlas(skeletonPath); + var data = await promisify(fs.readFile)(path, DRAGONBONES_ENCODING); + return { data, path }; +} + +class DragonBonesMeta extends Editor.metas['custom-asset'] { + // constructor (assetdb) { + // super(assetdb); + // } + + static version () { return '2.0.0'; } + static defaultType () { return 'dragonbones'; } + + static validate (assetPath) { + var json; + try { + json = fs.readJsonSync(assetPath, DRAGONBONES_ENCODING); + } + catch (e) { + return false; + } + + return Array.isArray(json.armature); + } + + postImport (assetPath, cb) { + (async () => { + var skeData = await promisify(fs.readFile)(assetPath, DRAGONBONES_ENCODING); + + var asset = new DragonBonesAsset(); + asset.name = ps.basenameNoExt(assetPath); + + asset.dragonBonesData = skeData; + + // TODO - support JSON.parse(skeData.textureAtlas) + var atlasInfo = await loadAtlas(assetPath); + asset.textureAtlases = [atlasInfo.data]; + + // parse the depended texture + var json = JSON.parse(atlasInfo.data); + var imagePath = ps.resolve(atlasInfo.path, '..', json.imagePath); + var uuid = this._assetdb.fspathToUuid(imagePath); + if (uuid) { + asset.textures = [Editor.serialize.asAsset(uuid)]; + } + else if (!fs.existsSync(imagePath)) { + Editor.error(`Can not find texture "${json.imagePath}" for atlas "${atlasInfo.path}"`); + } + else { + // AssetDB may call postImport more than once, we can get uuid in the next time. + console.warn('WARN: UUID not yet initialized for "%s".', json.imagePath); + } + + this._assetdb.saveAssetToLibrary(this.uuid, asset); + })().then(cb, cb); + } +} + +module.exports = DragonBonesMeta; diff --git a/Cocos/Demos/packages/dragonbones/editor/polyfills.js b/Cocos/Demos/packages/dragonbones/editor/polyfills.js new file mode 100644 index 00000000..3393f82b --- /dev/null +++ b/Cocos/Demos/packages/dragonbones/editor/polyfills.js @@ -0,0 +1,20 @@ +'use strict'; + +const util = require('util'); + +if (!util.promisify) { + util.promisify = function (handle) { + return function (...args) { + return new Promise(function (resolve, reject) { + handle(...args, (err, res) => { + if (err) { + reject(err); + } + else { + resolve(res); + } + }); + }); + }; + }; +} diff --git a/Cocos/Demos/packages/dragonbones/main.js b/Cocos/Demos/packages/dragonbones/main.js new file mode 100644 index 00000000..261a2b60 --- /dev/null +++ b/Cocos/Demos/packages/dragonbones/main.js @@ -0,0 +1,43 @@ +'use strict'; + +// 仅提供基础示例,项目、源码结构欢迎大佬后续优化。 + +const ps = require('path'); +const newAsset = require('./editor/dragonbones-asset'); +const newMeta = require('./editor/dragonbones-meta'); + +const MOUNT_PATH = ps.join(__dirname, 'assets'); + +var origin = null; + +module.exports = { + load () { + origin = { + assets: { + dragonbones: Editor.assets.dragonbones, + }, + metas: { + dragonbones: Editor.metas.dragonbones, + }, + }; + + Editor.assets.dragonbones = newAsset; + Editor.metas.dragonbones = newMeta; + newMeta['asset-icon'] = origin.metas.dragonbones['asset-icon']; + + Editor.assetdb.register( '.json', false, newMeta); + Editor.assetdb.mount(MOUNT_PATH, 'DragonBones', { + hidden: false + }); + }, + + unload () { + Editor.assets.dragonbones = origin.assets.dragonbones; + Editor.metas.dragonbones = origin.metas.dragonbones; + Editor.assetdb.unregister(newMeta); + Editor.assetdb.unmount(MOUNT_PATH); + cc.js.unregisterClass(newAsset); + + Editor.Ipc.sendToWins('dragonbones:unloaded'); + } +}; diff --git a/Cocos/Demos/packages/dragonbones/package.json b/Cocos/Demos/packages/dragonbones/package.json new file mode 100644 index 00000000..b7b02683 --- /dev/null +++ b/Cocos/Demos/packages/dragonbones/package.json @@ -0,0 +1,11 @@ +{ + "name": "dragonbones", + "version": "0.0.1", + "description": "", + "author": "", + "main": "main.js", + "reload": { + "ignore": "**/*" + }, + "scene-script": "scene.js" +} \ No newline at end of file diff --git a/Cocos/Demos/packages/dragonbones/scene.js b/Cocos/Demos/packages/dragonbones/scene.js new file mode 100644 index 00000000..cac0caf8 --- /dev/null +++ b/Cocos/Demos/packages/dragonbones/scene.js @@ -0,0 +1,40 @@ +'use strict'; + +// 仅提供基础示例,项目、源码结构欢迎大佬后续优化。 + +const { ipcRenderer } = require('electron'); + +const newAsset = dragonBones.DragonBonesAsset; +const newMeta = require('./editor/dragonbones-meta'); + +var origin = null; + +function load () { + const AssetId = cc.js._getClassId(newAsset); + origin = { + assets: { + dragonbones: Editor.assets.dragonbones, + }, + metas: { + dragonbones: Editor.metas.dragonbones, + }, + assettype2name: {}, + }; + origin.assettype2name[AssetId] = Editor.assettype2name[AssetId]; + + Editor.assets.dragonbones = newAsset; + Editor.metas.dragonbones = newMeta; + newMeta['asset-icon'] = origin.metas.dragonbones['asset-icon']; + Editor.assettype2name[AssetId] = newMeta.defaultType(); + + ipcRenderer.once('dragonbones:unloaded', unload); +} + +function unload () { + Editor.assets.dragonbones = origin.assets.dragonbones; + Editor.metas.dragonbones = origin.metas.dragonbones; + const AssetId = cc.js._getClassId(newAsset); + Editor.assettype2name[AssetId] = origin.assettype2name[AssetId]; +} + +load(); diff --git a/Cocos/Demos/project.json b/Cocos/Demos/project.json new file mode 100644 index 00000000..4257d041 --- /dev/null +++ b/Cocos/Demos/project.json @@ -0,0 +1,4 @@ +{ + "engine": "cocos2d-html5", + "packages": "packages" +} \ No newline at end of file diff --git a/Cocos/Demos/settings/builder.json b/Cocos/Demos/settings/builder.json new file mode 100644 index 00000000..635c73bf --- /dev/null +++ b/Cocos/Demos/settings/builder.json @@ -0,0 +1,13 @@ +{ + "excludeScenes": [], + "orientation": { + "landscapeLeft": true, + "landscapeRight": true, + "portrait": false, + "upsideDown": false + }, + "packageName": "org.cocos2d.hellodragonbones", + "startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49", + "title": "hello_dragonbones", + "webOrientation": "auto" +} \ No newline at end of file diff --git a/Cocos/Demos/settings/builder.panel.json b/Cocos/Demos/settings/builder.panel.json new file mode 100644 index 00000000..bc3a5b33 --- /dev/null +++ b/Cocos/Demos/settings/builder.panel.json @@ -0,0 +1,7 @@ +{ + "excludeScenes": [], + "packageName": "org.cocos2d.hellodragonbones", + "platform": "web-mobile", + "startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49", + "title": "HelloDragonbones" +} \ No newline at end of file diff --git a/Cocos/Demos/settings/project.json b/Cocos/Demos/settings/project.json new file mode 100644 index 00000000..ac399c65 --- /dev/null +++ b/Cocos/Demos/settings/project.json @@ -0,0 +1,28 @@ +{ + "collision-matrix": [ + [ + true + ] + ], + "excluded-modules": [], + "group-list": [ + "default" + ], + "start-scene": "current", + "design-resolution-width": 960, + "design-resolution-height": 640, + "fit-width": false, + "fit-height": true, + "use-project-simulator-setting": false, + "simulator-orientation": false, + "use-customize-simulator": false, + "simulator-resolution": { + "width": 960, + "height": 640 + }, + "cocos-analytics": { + "enable": false, + "appID": "13798", + "appSecret": "959b3ac0037d0f3c2fdce94f8421a9b2" + } +} \ No newline at end of file diff --git a/Cocos/Demos/template-banner.png b/Cocos/Demos/template-banner.png new file mode 100644 index 00000000..2aa766ff Binary files /dev/null and b/Cocos/Demos/template-banner.png differ diff --git a/Cocos/Demos/template.json b/Cocos/Demos/template.json new file mode 100644 index 00000000..78d02bc4 --- /dev/null +++ b/Cocos/Demos/template.json @@ -0,0 +1,5 @@ +{ + "name": "TEMPLATES.helloworld-ts.name", + "desc": "TEMPLATES.helloworld-ts.desc", + "banner": "template-banner.png" +} \ No newline at end of file diff --git a/Cocos/Demos/tsconfig.json b/Cocos/Demos/tsconfig.json new file mode 100644 index 00000000..9ff390e1 --- /dev/null +++ b/Cocos/Demos/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es5", + "es2015.promise" + ], + "target": "es5", + "allowJs": true, + "experimentalDecorators": true, + "skipLibCheck": true + }, + "exclude": [ + "node_modules", + "library", + "local", + "temp", + "build", + "settings" + ] +} \ No newline at end of file diff --git a/Cocos/README.md b/Cocos/README.md new file mode 100644 index 00000000..09b04ee4 --- /dev/null +++ b/Cocos/README.md @@ -0,0 +1,6 @@ +# DragonBones Cocos Creator library + +## [Demos](./Demos/) +* [Hello DragonBones](./Demos/assets/Script/HelloDragonBones.ts) + +## [Cocos Creator website](http://www.cocos.com/) \ No newline at end of file diff --git a/DragonBones/README.md b/DragonBones/README.md index 97288353..eb92477a 100644 --- a/DragonBones/README.md +++ b/DragonBones/README.md @@ -1,5 +1,8 @@ # DragonBones common library ## How to build +* Clone or download [DragonBonesJS](https://github.com/DragonBones/DragonBonesJS/). +* Install [Node.JS](https://nodejs.org/). +* Open `DragonBonesJS/DragonBones/` in command. * $ `npm install` * $ `npm run build` \ No newline at end of file diff --git a/DragonBones/package.json b/DragonBones/package.json index 0a566bd9..d96a5fb4 100644 --- a/DragonBones/package.json +++ b/DragonBones/package.json @@ -1,17 +1,18 @@ { "name": "dragonbones-js", - "version": "5.6.2", + "version": "5.7.0", "main": "", "scripts": { "build": "tsc & uglifyjs ./out/dragonBones.js -o ./out/dragonBones.min.js -m", - "build-egret-4.x": "cd.. & cd Egret & cd 4.x & npm run build & cd.. & cd.. & cd DragonBones", - "build-pixi": "cd.. & cd Pixi & cd 4.x & npm run build & cd.. & cd Demos & tsc & cd.. & cd.. & cd DragonBones", - "build-phaser": "cd.. & cd Phaser & cd 2.x & npm run build & cd.. & cd Demos & tsc & cd.. & cd.. & cd DragonBones", - "build-hilo": "cd.. & cd hilo & cd 1.x & npm run build & cd.. & cd Demos & tsc & cd.. & cd.. & cd DragonBones", - "build-all": "npm run build-egret-4.x & npm run build-pixi & npm run build-phaser & npm run build-hilo" + "build-egret": "cd .. & cd Egret & cd 4.x & npm run build & cd .. & cd .. & cd DragonBones", + "build-pixi": "cd .. & cd Pixi & cd 4.x & npm run build & cd .. & cd Demos & tsc & cd .. & cd .. & cd DragonBones", + "build-phaser": "cd .. & cd Phaser & cd 2.x & npm run build & cd .. & cd Demos & tsc & cd .. & cd .. & cd DragonBones", + "build-hilo": "cd .. & cd Hilo & cd 1.x & npm run build & cd .. & cd Demos & tsc & cd .. & cd .. & cd DragonBones", + "build-cocos": "cd .. & cd Cocos & cd 1.x & npm run build & cd .. & cd .. & cd DragonBones", + "build-all": "npm run build-egret & npm run build-pixi & npm run build-phaser & npm run build-hilo & npm run build-cocos" }, "devDependencies": { "typescript": "^2.4.2", "uglify-js": "^3.0.26" } -} \ No newline at end of file +} diff --git a/DragonBones/src/dragonBones/animation/Animation.ts b/DragonBones/src/dragonBones/animation/Animation.ts index 5eeeab22..ce82c6e7 100644 --- a/DragonBones/src/dragonBones/animation/Animation.ts +++ b/DragonBones/src/dragonBones/animation/Animation.ts @@ -52,17 +52,19 @@ namespace dragonBones { * @language zh_CN */ public timeScale: number; - - private _lockUpdate: boolean; - private _animationDirty: boolean; // Update bones and slots cachedFrameIndices. + /** + * Update bones and slots cachedFrameIndices. + */ + private _animationDirty: boolean; // private _inheritTimeScale: number; private readonly _animationNames: Array = []; private readonly _animationStates: Array = []; private readonly _animations: Map = {}; + private readonly _blendStates: Map> = {}; private _armature: Armature; private _animationConfig: AnimationConfig = null as any; // Initial value. private _lastAnimationState: AnimationState | null; - + protected _onClear(): void { for (const animationState of this._animationStates) { animationState.returnToPool(); @@ -72,13 +74,21 @@ namespace dragonBones { delete this._animations[k]; } + for (let k in this._blendStates) { + const blendStates = this._blendStates[k]; + for (let kB in blendStates) { + blendStates[kB].returnToPool(); + } + + delete this._blendStates[k]; + } + if (this._animationConfig !== null) { this._animationConfig.returnToPool(); } this.timeScale = 1.0; - this._lockUpdate = false; this._animationDirty = false; this._inheritTimeScale = 1.0; this._animationNames.length = 0; @@ -140,8 +150,7 @@ namespace dragonBones { } break; - case AnimationFadeOutMode.None: - case AnimationFadeOutMode.Single: + case AnimationFadeOutMode.Single: // TODO default: break; } @@ -176,6 +185,13 @@ namespace dragonBones { passedTime *= this._inheritTimeScale; } + for (let k in this._blendStates) { + const blendStates = this._blendStates[k]; + for (let kB in blendStates) { + blendStates[kB].reset(); + } + } + const animationStateCount = this._animationStates.length; if (animationStateCount === 1) { const animationState = this._animationStates[0]; @@ -185,23 +201,25 @@ namespace dragonBones { this._lastAnimationState = null; } else { - const animationData = animationState._animationData; + const animationData = animationState.animationData; const cacheFrameRate = animationData.cacheFrameRate; + if (this._animationDirty && cacheFrameRate > 0.0) { // Update cachedFrameIndices. this._animationDirty = false; + for (const bone of this._armature.getBones()) { bone._cachedFrameIndices = animationData.getBoneCachedFrameIndices(bone.name); } for (const slot of this._armature.getSlots()) { - const rawDisplayDatas = slot.rawDisplayDatas; - if (rawDisplayDatas !== null && rawDisplayDatas.length > 0) { - const rawDsplayData = rawDisplayDatas[0]; - if (rawDsplayData !== null) { - if (rawDsplayData.parent === this._armature.armatureData.defaultSkin) { - slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); - continue; - } + if (slot.displayFrameCount > 0) { + const rawDisplayData = slot.getDisplayFrameAt(0).rawDisplayData; + if ( + rawDisplayData !== null && + rawDisplayData.parent === this._armature.armatureData.defaultSkin + ) { + slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); + continue; } } @@ -219,6 +237,7 @@ namespace dragonBones { r++; this._armature._dragonBones.bufferObject(animationState); this._animationDirty = true; + if (this._lastAnimationState === animationState) { // Update last animation state. this._lastAnimationState = null; } @@ -233,6 +252,7 @@ namespace dragonBones { if (i === animationStateCount - 1 && r > 0) { // Modify animation states size. this._animationStates.length -= r; + if (this._lastAnimationState === null && this._animationStates.length > 0) { this._lastAnimationState = this._animationStates[this._animationStates.length - 1]; } @@ -331,7 +351,11 @@ namespace dragonBones { if (animationConfig.fadeOutMode === AnimationFadeOutMode.Single) { for (const animationState of this._animationStates) { - if (animationState._animationData === animationData) { + if ( + animationState._fadeState < 1 && + animationState.layer === animationConfig.layer && + animationState.animationData === animationData + ) { return animationState; } } @@ -352,7 +376,7 @@ namespace dragonBones { animationConfig.timeScale = 1.0 / animationData.scale; } - if (animationData.frameCount > 1) { + if (animationData.frameCount > 0) { if (animationConfig.position < 0.0) { animationConfig.position %= animationData.duration; animationConfig.position = animationData.duration - animationConfig.position; @@ -375,6 +399,7 @@ namespace dragonBones { else { animationConfig.playTimes = 1; animationConfig.position = 0.0; + if (animationConfig.duration > 0.0) { animationConfig.duration = 0.0; } @@ -385,14 +410,15 @@ namespace dragonBones { } this._fadeOut(animationConfig); - + // const animationState = BaseObject.borrowObject(AnimationState); animationState.init(this._armature, animationData, animationConfig); this._animationDirty = true; this._armature._cacheFrameIndex = -1; - if (this._animationStates.length > 0) { + if (this._animationStates.length > 0) { // Sort animation state. let added = false; + for (let i = 0, l = this._animationStates.length; i < l; ++i) { if (animationState.layer > this._animationStates[i].layer) { added = true; @@ -414,8 +440,7 @@ namespace dragonBones { this._animationStates.push(animationState); } - // Child armature play same name animation. - for (const slot of this._armature.getSlots()) { + for (const slot of this._armature.getSlots()) { // Child armature play same name animation. const childArmature = slot.childArmature; if ( childArmature !== null && childArmature.inheritAnimation && @@ -426,32 +451,31 @@ namespace dragonBones { } } - let isLocked = false; - for (let k in animationData.animationTimelines) { - if (!this._lockUpdate) { - isLocked = true; - this._lockUpdate = true; + for (let k in animationData.animationTimelines) { // Blend animation node. + const childAnimationState = this.fadeIn(k, 0.0, 1, animationState.layer, "", AnimationFadeOutMode.Single); + if (childAnimationState === null) { + continue; } - const childAnimatiionState = this.fadeIn(k, animationConfig.fadeInTime, 1, animationState.layer, null, AnimationFadeOutMode.None); - if (childAnimatiionState !== null) { - childAnimatiionState.resetToPose = false; - childAnimatiionState._parent = animationState; - childAnimatiionState.stop(); + const timelines = animationData.animationTimelines[k]; + childAnimationState.actionEnabled = false; + childAnimationState.resetToPose = false; + childAnimationState.stop(); + animationState.addState(childAnimationState, timelines); + // + const index = this._animationStates.indexOf(animationState); + const childIndex = this._animationStates.indexOf(childAnimationState); + if (childIndex < index) { + this._animationStates.splice(index, 1); + this._animationStates.splice(childIndex, 0, animationState); } } - if (isLocked) { - this._lockUpdate = false; - } + // if (!this._armature._lockUpdate && animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. + // this._armature.advanceTime(0.0); + // } - if (!this._lockUpdate) { - if (animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. - this._armature.advanceTime(0.0); - } - - this._lastAnimationState = animationState; - } + this._lastAnimationState = animationState; return animationState; } @@ -609,7 +633,7 @@ namespace dragonBones { const animationData = animationName in this._animations ? this._animations[animationName] : null; if (animationData !== null) { - this._animationConfig.position = animationData.duration * frame / animationData.frameCount; + this._animationConfig.position = animationData.frameCount > 0 ? animationData.duration * frame / animationData.frameCount : 0.0; } return this.playConfig(this._animationConfig); @@ -718,9 +742,26 @@ namespace dragonBones { return animationState; } + /** + * @internal + */ + public getBlendState(type: string, name: string, target: BaseObject): BlendState { + if (!(type in this._blendStates)) { + this._blendStates[type] = {}; + } + + const blendStates = this._blendStates[type]; + if (!(name in blendStates)) { + const blendState = blendStates[name] = BaseObject.borrowObject(BlendState); + blendState.target = target; + } + + return blendStates[name]; + } /** * - Get a specific animation state. * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) * @example *
          *     armature.animation.play("walk");
@@ -731,8 +772,9 @@ namespace dragonBones {
          * @language en_US
          */
         /**
-         * - 获取指定的动画状态
+         * - 获取指定的动画状态。
          * @param animationName - 动画状态名称。
+         * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1)
          * @example
          * 
          *     armature.animation.play("walk");
@@ -742,11 +784,11 @@ namespace dragonBones {
          * @version DragonBones 3.0
          * @language zh_CN
          */
-        public getState(animationName: string): AnimationState | null {
+        public getState(animationName: string, layer: number = -1): AnimationState | null {
             let i = this._animationStates.length;
             while (i--) {
                 const animationState = this._animationStates[i];
-                if (animationState.name === animationName) {
+                if (animationState.name === animationName && (layer < 0 || animationState.layer === layer)) {
                     return animationState;
                 }
             }
@@ -780,7 +822,7 @@ namespace dragonBones {
          * @version DragonBones 5.1
          * @language zh_CN
          */
-        public getStates(): Array {
+        public getStates(): ReadonlyArray {
             return this._animationStates;
         }
         /**
@@ -850,7 +892,7 @@ namespace dragonBones {
          * @version DragonBones 4.5
          * @language zh_CN
          */
-        public get animationNames(): Array {
+        public get animationNames(): ReadonlyArray {
             return this._animationNames;
         }
         /**
@@ -913,90 +955,5 @@ namespace dragonBones {
         public get lastAnimationState(): AnimationState | null {
             return this._lastAnimationState;
         }
-
-        /**
-         * - Deprecated, please refer to {@link #play()} {@link #fadeIn()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #play()} {@link #fadeIn()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public gotoAndPlay(
-            animationName: string, fadeInTime: number = -1, duration: number = -1, playTimes: number = -1,
-            layer: number = 0, group: string | null = null, fadeOutMode: AnimationFadeOutMode = AnimationFadeOutMode.SameLayerAndGroup,
-            pauseFadeOut: boolean = true, pauseFadeIn: boolean = true
-        ): AnimationState | null {
-            console.warn("Deprecated.");
-            // tslint:disable-next-line:no-unused-expression
-            pauseFadeOut;
-            // tslint:disable-next-line:no-unused-expression
-            pauseFadeIn;
-
-            this._animationConfig.clear();
-            this._animationConfig.resetToPose = true;
-            this._animationConfig.fadeOutMode = fadeOutMode;
-            this._animationConfig.playTimes = playTimes;
-            this._animationConfig.layer = layer;
-            this._animationConfig.fadeInTime = fadeInTime;
-            this._animationConfig.animation = animationName;
-            this._animationConfig.group = group !== null ? group : "";
-
-            const animationData = this._animations[animationName];
-            if (animationData && duration > 0.0) {
-                this._animationConfig.timeScale = animationData.duration / duration;
-            }
-
-            return this.playConfig(this._animationConfig);
-        }
-        /**
-         * - Deprecated, please refer to {@link #gotoAndStopByTime()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #gotoAndStopByTime()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public gotoAndStop(animationName: string, time: number = 0): AnimationState | null {
-            console.warn("Deprecated.");
-            return this.gotoAndStopByTime(animationName, time);
-        }
-        /**
-         * - Deprecated, please refer to {@link #animationNames}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #animationNames}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get animationList(): Array {
-            console.warn("Deprecated.");
-            return this._animationNames;
-        }
-        /**
-         * - Deprecated, please refer to {@link #animationNames}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #animationNames}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get animationDataList(): Array {
-            console.warn("Deprecated.");
-            const list: AnimationData[] = [];
-            for (let i = 0, l = this._animationNames.length; i < l; ++i) {
-                list.push(this._animations[this._animationNames[i]]);
-            }
-
-            return list;
-        }
     }
 }
diff --git a/DragonBones/src/dragonBones/animation/AnimationState.ts b/DragonBones/src/dragonBones/animation/AnimationState.ts
index 123037a5..21c535f2 100644
--- a/DragonBones/src/dragonBones/animation/AnimationState.ts
+++ b/DragonBones/src/dragonBones/animation/AnimationState.ts
@@ -46,7 +46,7 @@ namespace dragonBones {
         /**
          * @private
          */
-        public additiveBlending: boolean;
+        public additive: boolean;
         /**
          * - Whether the animation state has control over the display object properties of the slots.
          * Sometimes blend a animation state does not want it to control the display object properties of the slots,
@@ -79,6 +79,10 @@ namespace dragonBones {
          * @language zh_CN
          */
         public resetToPose: boolean;
+        /**
+         * @private
+         */
+        public blendType: AnimationBlendType;
         /**
          * - The play times. [0: Loop play, [1~N]: Play N times]
          * @version DragonBones 3.0
@@ -125,18 +129,21 @@ namespace dragonBones {
          */
         public timeScale: number;
         /**
-         * - The blend weight.
-         * @default 1.0
-         * @version DragonBones 5.0
-         * @language en_US
+         * @private
          */
+        public parameterX: number;
         /**
-         * - 混合权重。
-         * @default 1.0
-         * @version DragonBones 5.0
-         * @language zh_CN
+         * @private
+         */
+        public parameterY: number;
+        /**
+         * @private
+         */
+        public positionX: number;
+        /**
+         * @private
          */
-        public weight: number;
+        public positionY: number;
         /**
          * - The auto fade out time when the animation state play completed.
          * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds)
@@ -208,6 +215,7 @@ namespace dragonBones {
          * @internal
          */
         public _duration: number;
+        private _weight: number;
         private _fadeTime: number;
         private _time: number;
         /**
@@ -218,39 +226,34 @@ namespace dragonBones {
          * @internal
          */
         public _weightResult: number;
-        /**
-         * @internal
-         */
-        public readonly _blendState: BlendState = new BlendState();
         private readonly _boneMask: Array = [];
-        private readonly _boneTimelines: Array = [];
-        private readonly _surfaceTimelines: Array = [];
-        private readonly _slotTimelines: Array = [];
-        private readonly _constraintTimelines: Array = [];
-        private readonly _animationTimelines: Array = [];
+        private readonly _boneTimelines: Array = [];
+        private readonly _boneBlendTimelines: Array = [];
+        private readonly _slotTimelines: Array = [];
+        private readonly _slotBlendTimelines: Array = [];
+        private readonly _constraintTimelines: Array = [];
+        private readonly _animationTimelines: Array = [];
         private readonly _poseTimelines: Array = [];
-        private readonly _bonePoses: Map = {};
-        /**
-         * @internal
-         */
-        public _animationData: AnimationData;
+        private _animationData: AnimationData;
         private _armature: Armature;
         /**
          * @internal
          */
         public _actionTimeline: ActionTimelineState = null as any; // Initial value.
         private _zOrderTimeline: ZOrderTimelineState | null = null; // Initial value.
+        private _activeChildA: AnimationState | null;
+        private _activeChildB: AnimationState | null;
         /**
          * @internal
          */
-        public _parent: AnimationState = null as any; // Initial value.
+        public _parent: AnimationState | null;
 
         protected _onClear(): void {
             for (const timeline of this._boneTimelines) {
                 timeline.returnToPool();
             }
 
-            for (const timeline of this._surfaceTimelines) {
+            for (const timeline of this._boneBlendTimelines) {
                 timeline.returnToPool();
             }
 
@@ -258,17 +261,23 @@ namespace dragonBones {
                 timeline.returnToPool();
             }
 
-            for (const timeline of this._constraintTimelines) {
+            for (const timeline of this._slotBlendTimelines) {
                 timeline.returnToPool();
             }
 
-            for (const timeline of this._animationTimelines) {
+            for (const timeline of this._constraintTimelines) {
                 timeline.returnToPool();
             }
 
-            for (let k in this._bonePoses) {
-                this._bonePoses[k].returnToPool();
-                delete this._bonePoses[k];
+            for (const timeline of this._animationTimelines) {
+                const animationState = timeline.target as AnimationState;
+                if (animationState._parent === this) {
+                    animationState._fadeState = 1;
+                    animationState._subFadeState = 1;
+                    animationState._parent = null;
+                }
+
+                timeline.returnToPool();
             }
 
             if (this._actionTimeline !== null) {
@@ -280,13 +289,18 @@ namespace dragonBones {
             }
 
             this.actionEnabled = false;
-            this.additiveBlending = false;
+            this.additive = false;
             this.displayControl = false;
             this.resetToPose = false;
+            this.blendType = AnimationBlendType.None;
             this.playTimes = 1;
             this.layer = 0;
             this.timeScale = 1.0;
-            this.weight = 1.0;
+            this._weight = 1.0;
+            this.parameterX = 0.0;
+            this.parameterY = 0.0;
+            this.positionX = 0.0;
+            this.positionY = 0.0;
             this.autoFadeOutTime = 0.0;
             this.fadeTotalTime = 0.0;
             this.name = "";
@@ -302,11 +316,11 @@ namespace dragonBones {
             this._time = 0.0;
             this._fadeProgress = 0.0;
             this._weightResult = 0.0;
-            this._blendState.clear();
             this._boneMask.length = 0;
             this._boneTimelines.length = 0;
-            this._surfaceTimelines.length = 0;
+            this._boneBlendTimelines.length = 0;
             this._slotTimelines.length = 0;
+            this._slotBlendTimelines.length = 0;
             this._constraintTimelines.length = 0;
             this._animationTimelines.length = 0;
             this._poseTimelines.length = 0;
@@ -315,7 +329,9 @@ namespace dragonBones {
             this._armature = null as any; //
             this._actionTimeline = null as any; //
             this._zOrderTimeline = null;
-            this._parent = null as any; //
+            this._activeChildA = null;
+            this._activeChildB = null;
+            this._parent = null;
         }
 
         private _updateTimelines(): void {
@@ -328,7 +344,7 @@ namespace dragonBones {
                             switch (timelineData.type) {
                                 case TimelineType.IKConstraint: {
                                     const timeline = BaseObject.borrowObject(IKConstraintTimelineState);
-                                    timeline.constraint = constraint;
+                                    timeline.target = constraint;
                                     timeline.init(this._armature, this, timelineData);
                                     this._constraintTimelines.push(timeline);
                                     break;
@@ -341,48 +357,21 @@ namespace dragonBones {
                     }
                     else if (this.resetToPose) { // Pose timeline.
                         const timeline = BaseObject.borrowObject(IKConstraintTimelineState);
-                        timeline.constraint = constraint;
+                        timeline.target = constraint;
                         timeline.init(this._armature, this, null);
                         this._constraintTimelines.push(timeline);
                         this._poseTimelines.push(timeline);
                     }
                 }
             }
-
-            { // Update animation timelines.
-                for (const animationState of this._armature.animation.getStates()) {
-                    if (animationState._parent !== this) {
-                        continue;
-                    }
-
-                    const timelineDatas = this._animationData.getAnimationTimelines(animationState.name);
-                    if (timelineDatas === null) {
-                        continue;
-                    }
-
-                    for (const timelineData of timelineDatas) {
-                        switch (timelineData.type) {
-                            case TimelineType.AnimationTime: {
-                                const timeline = BaseObject.borrowObject(AnimationTimelineState);
-                                timeline.animationState = animationState;
-                                timeline.init(this._armature, this, timelineData);
-                                this._animationTimelines.push(timeline);
-                                break;
-                            }
-
-                            default:
-                                break;
-                        }
-                    }
-                }
-            }
         }
 
         private _updateBoneAndSlotTimelines(): void {
             { // Update bone and surface timelines.
-                const boneTimelines: Map> = {};
-                for (const timeline of this._boneTimelines) { // Create bone timelines map.
-                    const timelineName = timeline.bone.name;
+                const boneTimelines: Map> = {};
+                // Create bone timelines map.
+                for (const timeline of this._boneTimelines) {
+                    const timelineName = ((timeline.target as BlendState).target as Bone).name;
                     if (!(timelineName in boneTimelines)) {
                         boneTimelines[timelineName] = [];
                     }
@@ -390,6 +379,15 @@ namespace dragonBones {
                     boneTimelines[timelineName].push(timeline);
                 }
 
+                for (const timeline of this._boneBlendTimelines) {
+                    const timelineName = ((timeline.target as BlendState).target as Bone).name;
+                    if (!(timelineName in boneTimelines)) {
+                        boneTimelines[timelineName] = [];
+                    }
+
+                    boneTimelines[timelineName].push(timeline);
+                }
+                //
                 for (const bone of this._armature.getBones()) {
                     const timelineName = bone.name;
                     if (!this.containsBoneMask(timelineName)) {
@@ -399,17 +397,16 @@ namespace dragonBones {
                     if (timelineName in boneTimelines) { // Remove bone timeline from map.
                         delete boneTimelines[timelineName];
                     }
-                    else if (bone._boneData.type === BoneType.Bone) { // Create new bone timeline.
+                    else { // Create new bone timeline.
                         const timelineDatas = this._animationData.getBoneTimelines(timelineName);
-                        const bonePose = timelineName in this._bonePoses ? this._bonePoses[timelineName] : (this._bonePoses[timelineName] = BaseObject.borrowObject(BonePose));
+                        const blendState = this._armature.animation.getBlendState(BlendState.BONE_TRANSFORM, bone.name, bone);
 
                         if (timelineDatas !== null) {
                             for (const timelineData of timelineDatas) {
                                 switch (timelineData.type) {
                                     case TimelineType.BoneAll: {
                                         const timeline = BaseObject.borrowObject(BoneAllTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
@@ -417,8 +414,7 @@ namespace dragonBones {
 
                                     case TimelineType.BoneTranslate: {
                                         const timeline = BaseObject.borrowObject(BoneTranslateTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
@@ -426,8 +422,7 @@ namespace dragonBones {
 
                                     case TimelineType.BoneRotate: {
                                         const timeline = BaseObject.borrowObject(BoneRotateTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
@@ -435,37 +430,25 @@ namespace dragonBones {
 
                                     case TimelineType.BoneScale: {
                                         const timeline = BaseObject.borrowObject(BoneScaleTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
 
-                                    default:
+                                    case TimelineType.BoneAlpha: {
+                                        const timeline = BaseObject.borrowObject(AlphaTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.BONE_ALPHA, bone.name, bone);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._boneBlendTimelines.push(timeline);
                                         break;
-                                }
-                            }
-                        }
-                        else if (this.resetToPose) { // Pose timeline.
-                            const timeline = BaseObject.borrowObject(BoneAllTimelineState);
-                            timeline.bone = bone;
-                            timeline.bonePose = bonePose;
-                            timeline.init(this._armature, this, null);
-                            this._boneTimelines.push(timeline);
-                            this._poseTimelines.push(timeline);
-                        }
-                    }
-                    else if (bone._boneData.type === BoneType.Surface) {
-                        const timelineDatas = this._animationData.getSurfaceTimelines(timelineName);
-                        if (timelineDatas !== null) {
-                            for (const timelineData of timelineDatas) {
-                                switch (timelineData.type) {
+                                    }
+
                                     case TimelineType.Surface: {
                                         const timeline = BaseObject.borrowObject(SurfaceTimelineState);
-                                        timeline.surface = bone as Surface;
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone);
                                         timeline.init(this._armature, this, timelineData);
-                                        this._surfaceTimelines.push(timeline);
+                                        this._boneBlendTimelines.push(timeline);
                                         break;
                                     }
 
@@ -475,29 +458,47 @@ namespace dragonBones {
                             }
                         }
                         else if (this.resetToPose) { // Pose timeline.
-                            const timeline = BaseObject.borrowObject(SurfaceTimelineState);
-                            timeline.surface = bone as Surface;
-                            timeline.init(this._armature, this, null);
-                            this._surfaceTimelines.push(timeline);
-                            this._poseTimelines.push(timeline);
+                            if (bone._boneData.type === BoneType.Bone) {
+                                const timeline = BaseObject.borrowObject(BoneAllTimelineState);
+                                timeline.target = blendState;
+                                timeline.init(this._armature, this, null);
+                                this._boneTimelines.push(timeline);
+                                this._poseTimelines.push(timeline);
+                            }
+                            else {
+                                const timeline = BaseObject.borrowObject(SurfaceTimelineState);
+                                timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone);
+                                timeline.init(this._armature, this, null);
+                                this._boneBlendTimelines.push(timeline);
+                                this._poseTimelines.push(timeline);
+                            }
                         }
                     }
                 }
 
                 for (let k in boneTimelines) { // Remove bone timelines.
                     for (const timeline of boneTimelines[k]) {
-                        this._boneTimelines.splice(this._boneTimelines.indexOf(timeline), 1);
-                        timeline.returnToPool();
+                        let index = this._boneTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._boneTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
+
+                        index = this._boneBlendTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._boneBlendTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
                     }
                 }
             }
 
             { // Update slot timelines.
-                const slotTimelines: Map> = {};
+                const slotTimelines: Map> = {};
                 const ffdFlags: Array = [];
-
-                for (const timeline of this._slotTimelines) { // Create slot timelines map.
-                    const timelineName = timeline.slot.name;
+                // Create slot timelines map.
+                for (const timeline of this._slotTimelines) {
+                    const timelineName = (timeline.target as Slot).name;
                     if (!(timelineName in slotTimelines)) {
                         slotTimelines[timelineName] = [];
                     }
@@ -505,6 +506,15 @@ namespace dragonBones {
                     slotTimelines[timelineName].push(timeline);
                 }
 
+                for (const timeline of this._slotBlendTimelines) {
+                    const timelineName = ((timeline.target as BlendState).target as Slot).name;
+                    if (!(timelineName in slotTimelines)) {
+                        slotTimelines[timelineName] = [];
+                    }
+
+                    slotTimelines[timelineName].push(timeline);
+                }
+                //
                 for (const slot of this._armature.getSlots()) {
                     const boneName = slot.parent.name;
                     if (!this.containsBoneMask(boneName)) {
@@ -512,8 +522,6 @@ namespace dragonBones {
                     }
 
                     const timelineName = slot.name;
-                    const timelineDatas = this._animationData.getSlotTimelines(timelineName);
-
                     if (timelineName in slotTimelines) { // Remove slot timeline from map.
                         delete slotTimelines[timelineName];
                     }
@@ -522,21 +530,30 @@ namespace dragonBones {
                         let colorFlag = false;
                         ffdFlags.length = 0;
 
+                        const timelineDatas = this._animationData.getSlotTimelines(timelineName);
                         if (timelineDatas !== null) {
                             for (const timelineData of timelineDatas) {
                                 switch (timelineData.type) {
                                     case TimelineType.SlotDisplay: {
-                                        const timeline = BaseObject.borrowObject(SlotDislayTimelineState);
-                                        timeline.slot = slot;
+                                        const timeline = BaseObject.borrowObject(SlotDisplayTimelineState);
+                                        timeline.target = slot;
                                         timeline.init(this._armature, this, timelineData);
                                         this._slotTimelines.push(timeline);
                                         displayIndexFlag = true;
                                         break;
                                     }
 
+                                    case TimelineType.SlotZIndex: {
+                                        const timeline = BaseObject.borrowObject(SlotZIndexTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_Z_INDEX, slot.name, slot);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._slotBlendTimelines.push(timeline);
+                                        break;
+                                    }
+
                                     case TimelineType.SlotColor: {
                                         const timeline = BaseObject.borrowObject(SlotColorTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = slot;
                                         timeline.init(this._armature, this, timelineData);
                                         this._slotTimelines.push(timeline);
                                         colorFlag = true;
@@ -544,11 +561,45 @@ namespace dragonBones {
                                     }
 
                                     case TimelineType.SlotDeform: {
-                                        const timeline = BaseObject.borrowObject(DeformTimelineState);
-                                        timeline.slot = slot;
+                                        const dragonBonesData = this._animationData.parent.parent;
+                                        const timelineArray = dragonBonesData.timelineArray;
+
+                                        const frameIntOffset = this._animationData.frameIntOffset + timelineArray[timelineData.offset + BinaryOffset.TimelineFrameValueCount];
+                                        const frameIntArray = dragonBonesData.frameIntArray;
+                                        let geometryOffset = frameIntArray[frameIntOffset + BinaryOffset.DeformVertexOffset];
+
+                                        if (geometryOffset < 0) {
+                                            geometryOffset += 65536; // Fixed out of bounds bug. 
+                                        }
+
+                                        for (let i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                                            const displayFrame = slot.getDisplayFrameAt(i);
+                                            const geometryData = displayFrame.getGeometryData();
+
+                                            if (geometryData === null) {
+                                                continue;
+                                            }
+
+                                            if (geometryData.offset === geometryOffset) {
+                                                const timeline = BaseObject.borrowObject(DeformTimelineState);
+                                                timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, displayFrame.rawDisplayData!.name, slot);
+                                                timeline.displayFrame = displayFrame;
+                                                timeline.init(this._armature, this, timelineData);
+                                                this._slotBlendTimelines.push(timeline);
+
+                                                displayFrame.updateDeformVertices();
+                                                ffdFlags.push(geometryOffset);
+                                                break;
+                                            }
+                                        }
+                                        break;
+                                    }
+
+                                    case TimelineType.SlotAlpha: {
+                                        const timeline = BaseObject.borrowObject(AlphaTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_ALPHA, slot.name, slot);
                                         timeline.init(this._armature, this, timelineData);
-                                        this._slotTimelines.push(timeline);
-                                        ffdFlags.push(timeline.vertexOffset);
+                                        this._slotBlendTimelines.push(timeline);
                                         break;
                                     }
 
@@ -560,8 +611,8 @@ namespace dragonBones {
 
                         if (this.resetToPose) { // Pose timeline.
                             if (!displayIndexFlag) {
-                                const timeline = BaseObject.borrowObject(SlotDislayTimelineState);
-                                timeline.slot = slot;
+                                const timeline = BaseObject.borrowObject(SlotDisplayTimelineState);
+                                timeline.target = slot;
                                 timeline.init(this._armature, this, null);
                                 this._slotTimelines.push(timeline);
                                 this._poseTimelines.push(timeline);
@@ -569,25 +620,26 @@ namespace dragonBones {
 
                             if (!colorFlag) {
                                 const timeline = BaseObject.borrowObject(SlotColorTimelineState);
-                                timeline.slot = slot;
+                                timeline.target = slot;
                                 timeline.init(this._armature, this, null);
                                 this._slotTimelines.push(timeline);
                                 this._poseTimelines.push(timeline);
                             }
 
-                            if (slot.rawDisplayDatas !== null) {
-                                for (const displayData of slot.rawDisplayDatas) {
-                                    if (displayData !== null && displayData.type === DisplayType.Mesh) {
-                                        const meshOffset = (displayData as MeshDisplayData).vertices.offset;
-                                        if (ffdFlags.indexOf(meshOffset) < 0) {
-                                            const timeline = BaseObject.borrowObject(DeformTimelineState);
-                                            timeline.vertexOffset = meshOffset; //
-                                            timeline.slot = slot;
-                                            timeline.init(this._armature, this, null);
-                                            this._slotTimelines.push(timeline);
-                                            this._poseTimelines.push(timeline);
-                                        }
-                                    }
+                            for (let i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                                const displayFrame = slot.getDisplayFrameAt(i);
+                                if (displayFrame.deformVertices.length === 0) {
+                                    continue;
+                                }
+
+                                const geometryData = displayFrame.getGeometryData();
+                                if (geometryData !== null && ffdFlags.indexOf(geometryData.offset) < 0) {
+                                    const timeline = BaseObject.borrowObject(DeformTimelineState);
+                                    timeline.displayFrame = displayFrame; //
+                                    timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot);
+                                    timeline.init(this._armature, this, null);
+                                    this._slotBlendTimelines.push(timeline);
+                                    this._poseTimelines.push(timeline);
                                 }
                             }
                         }
@@ -596,8 +648,17 @@ namespace dragonBones {
 
                 for (let k in slotTimelines) { // Remove slot timelines.
                     for (const timeline of slotTimelines[k]) {
-                        this._slotTimelines.splice(this._slotTimelines.indexOf(timeline), 1);
-                        timeline.returnToPool();
+                        let index = this._slotTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._slotTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
+
+                        index = this._slotBlendTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._slotBlendTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
                     }
                 }
             }
@@ -609,13 +670,16 @@ namespace dragonBones {
             if (this._subFadeState < 0) { // Fade start event.
                 this._subFadeState = 0;
 
-                const eventType = isFadeOut ? EventObject.FADE_OUT : EventObject.FADE_IN;
-                if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
-                    const eventObject = BaseObject.borrowObject(EventObject);
-                    eventObject.type = eventType;
-                    eventObject.armature = this._armature;
-                    eventObject.animationState = this;
-                    this._armature._dragonBones.bufferEvent(eventObject);
+                const eventActive = this._parent === null && this.actionEnabled;
+                if (eventActive) {
+                    const eventType = isFadeOut ? EventObject.FADE_OUT : EventObject.FADE_IN;
+                    if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
+                        const eventObject = BaseObject.borrowObject(EventObject);
+                        eventObject.type = eventType;
+                        eventObject.armature = this._armature;
+                        eventObject.animationState = this;
+                        this._armature._dragonBones.bufferEvent(eventObject);
+                    }
                 }
             }
 
@@ -642,13 +706,16 @@ namespace dragonBones {
                     this._fadeState = 0;
                 }
 
-                const eventType = isFadeOut ? EventObject.FADE_OUT_COMPLETE : EventObject.FADE_IN_COMPLETE;
-                if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
-                    const eventObject = BaseObject.borrowObject(EventObject);
-                    eventObject.type = eventType;
-                    eventObject.armature = this._armature;
-                    eventObject.animationState = this;
-                    this._armature._dragonBones.bufferEvent(eventObject);
+                const eventActive = this._parent === null && this.actionEnabled;
+                if (eventActive) {
+                    const eventType = isFadeOut ? EventObject.FADE_OUT_COMPLETE : EventObject.FADE_IN_COMPLETE;
+                    if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
+                        const eventObject = BaseObject.borrowObject(EventObject);
+                        eventObject.type = eventType;
+                        eventObject.armature = this._armature;
+                        eventObject.animationState = this;
+                        this._armature._dragonBones.bufferEvent(eventObject);
+                    }
                 }
             }
         }
@@ -664,17 +731,19 @@ namespace dragonBones {
             this._animationData = animationData;
             //
             this.resetToPose = animationConfig.resetToPose;
-            this.additiveBlending = animationConfig.additiveBlending;
+            this.additive = animationConfig.additive;
             this.displayControl = animationConfig.displayControl;
             this.actionEnabled = animationConfig.actionEnabled;
+            this.blendType = animationData.blendType;
             this.layer = animationConfig.layer;
             this.playTimes = animationConfig.playTimes;
             this.timeScale = animationConfig.timeScale;
             this.fadeTotalTime = animationConfig.fadeInTime;
             this.autoFadeOutTime = animationConfig.autoFadeOutTime;
-            this.weight = animationConfig.weight;
             this.name = animationConfig.name.length > 0 ? animationConfig.name : animationConfig.animation;
             this.group = animationConfig.group;
+            //
+            this._weight = animationConfig.weight;
 
             if (animationConfig.pauseFadeIn) {
                 this._playheadState = 2; // 10
@@ -723,6 +792,7 @@ namespace dragonBones {
             this._actionTimeline = BaseObject.borrowObject(ActionTimelineState);
             this._actionTimeline.init(this._armature, this, this._animationData.actionTimeline);
             this._actionTimeline.currentTime = this._time;
+
             if (this._actionTimeline.currentTime < 0.0) {
                 this._actionTimeline.currentTime = this._duration - this._actionTimeline.currentTime;
             }
@@ -736,13 +806,10 @@ namespace dragonBones {
          * @internal
          */
         public advanceTime(passedTime: number, cacheFrameRate: number): void {
-            this._blendState.dirty = false;
-
             // Update fade time.
             if (this._fadeState !== 0 || this._subFadeState !== 0) {
                 this._advanceFadeTime(passedTime);
             }
-
             // Update time.
             if (this._playheadState === 3) { // 11
                 if (this.timeScale !== 1.0) {
@@ -751,7 +818,6 @@ namespace dragonBones {
 
                 this._time += passedTime;
             }
-
             // Update timeline.
             if (this._timelineDirty !== 0) {
                 if (this._timelineDirty === 2) {
@@ -762,22 +828,23 @@ namespace dragonBones {
                 this._updateBoneAndSlotTimelines();
             }
 
-            if (this.weight === 0.0) {
-                return;
-            }
-
+            const isBlendDirty = this._fadeState !== 0 || this._subFadeState === 0;
             const isCacheEnabled = this._fadeState === 0 && cacheFrameRate > 0.0;
             let isUpdateTimeline = true;
             let isUpdateBoneTimeline = true;
             let time = this._time;
-            this._weightResult = this.weight * this._fadeProgress;
+            this._weightResult = this._weight * this._fadeProgress;
 
             if (this._parent !== null) {
-                this._weightResult *= this._parent._weightResult / this._parent._fadeProgress;
+                this._weightResult *= this._parent._weightResult;
+            }
+
+            if (this._actionTimeline.playState <= 0) { // Update main timeline.
+                this._actionTimeline.update(time);
             }
 
-            if (this._actionTimeline.playState <= 0) {
-                this._actionTimeline.update(time); // Update main timeline.
+            if (this._weight === 0.0) {
+                return;
             }
 
             if (isCacheEnabled) { // Cache time internval.
@@ -797,6 +864,7 @@ namespace dragonBones {
                 }
                 else {
                     this._armature._cacheFrameIndex = cacheFrameIndex;
+
                     if (this._animationData.cachedFrames[cacheFrameIndex]) { // Cached.
                         isUpdateBoneTimeline = false;
                     }
@@ -807,7 +875,10 @@ namespace dragonBones {
             }
 
             if (isUpdateTimeline) {
-                if (isUpdateBoneTimeline) { // Update bone timelines.
+                let isBlend = false;
+                let prevTarget: BlendState | null = null as any; //
+
+                if (isUpdateBoneTimeline) {
                     for (let i = 0, l = this._boneTimelines.length; i < l; ++i) {
                         const timeline = this._boneTimelines[i];
 
@@ -815,45 +886,70 @@ namespace dragonBones {
                             timeline.update(time);
                         }
 
-                        if (i === l - 1 || timeline.bone !== this._boneTimelines[i + 1].bone) {
-                            const state = timeline.bone._blendState.update(this._weightResult, this.layer);
-                            if (state !== 0) {
-                                timeline.blend(state);
+                        if (timeline.target !== prevTarget) {
+                            const blendState = timeline.target as BlendState;
+                            isBlend = blendState.update(this);
+                            prevTarget = blendState;
+
+                            if (blendState.dirty === 1) {
+                                const pose = (blendState.target as Bone).animationPose;
+                                pose.x = 0.0;
+                                pose.y = 0.0;
+                                pose.rotation = 0.0;
+                                pose.skew = 0.0;
+                                pose.scaleX = 1.0;
+                                pose.scaleY = 1.0;
                             }
                         }
+
+                        if (isBlend) {
+                            timeline.blend(isBlendDirty);
+                        }
                     }
                 }
 
-                for (let i = 0, l = this._surfaceTimelines.length; i < l; ++i) {
-                    const timeline = this._surfaceTimelines[i];
-                    const state = timeline.surface._blendState.update(this._weightResult, this.layer);
+                for (let i = 0, l = this._boneBlendTimelines.length; i < l; ++i) {
+                    const timeline = this._boneBlendTimelines[i];
 
                     if (timeline.playState <= 0) {
                         timeline.update(time);
                     }
 
-                    if (state !== 0) {
-                        timeline.blend(state);
+                    if ((timeline.target as BlendState).update(this)) {
+                        timeline.blend(isBlendDirty);
                     }
                 }
 
                 if (this.displayControl) {
                     for (let i = 0, l = this._slotTimelines.length; i < l; ++i) {
                         const timeline = this._slotTimelines[i];
-                        const displayController = timeline.slot.displayController;
-
-                        if (
-                            displayController === null ||
-                            displayController === this.name ||
-                            displayController === this.group
-                        ) {
-                            if (timeline.playState <= 0) {
+                        if (timeline.playState <= 0) {
+                            const slot = timeline.target as Slot;
+                            const displayController = slot.displayController;
+
+                            if (
+                                displayController === null ||
+                                displayController === this.name ||
+                                displayController === this.group
+                            ) {
                                 timeline.update(time);
                             }
                         }
                     }
                 }
 
+                for (let i = 0, l = this._slotBlendTimelines.length; i < l; ++i) {
+                    const timeline = this._slotBlendTimelines[i];
+                    if (timeline.playState <= 0) {
+                        const blendState = timeline.target as BlendState;
+                        timeline.update(time);
+
+                        if (blendState.update(this)) {
+                            timeline.blend(isBlendDirty);
+                        }
+                    }
+                }
+
                 for (let i = 0, l = this._constraintTimelines.length; i < l; ++i) {
                     const timeline = this._constraintTimelines[i];
                     if (timeline.playState <= 0) {
@@ -861,16 +957,60 @@ namespace dragonBones {
                     }
                 }
 
-                for (let i = 0, l = this._animationTimelines.length; i < l; ++i) {
-                    const timeline = this._animationTimelines[i];
-                    const state = timeline.animationState._blendState.update(this._weightResult, this.layer);
+                if (this._animationTimelines.length > 0) {
+                    let dL = 100.0;
+                    let dR = 100.0;
+                    let leftState: AnimationState | null = null;
+                    let rightState: AnimationState | null = null;
 
-                    if (timeline.playState <= 0) {
-                        timeline.update(time);
+                    for (let i = 0, l = this._animationTimelines.length; i < l; ++i) {
+                        const timeline = this._animationTimelines[i];
+                        if (timeline.playState <= 0) {
+                            timeline.update(time);
+                        }
+
+                        if (this.blendType === AnimationBlendType.E1D) { // TODO
+                            const animationState = timeline.target as AnimationState;
+                            const d = this.parameterX - animationState.positionX;
+
+                            if (d >= 0.0) {
+                                if (d < dL) {
+                                    dL = d;
+                                    leftState = animationState;
+                                }
+                            }
+                            else {
+                                if (-d < dR) {
+                                    dR = -d;
+                                    rightState = animationState;
+                                }
+                            }
+                        }
                     }
 
-                    if (state !== 0) {
-                        timeline.blend(state);
+                    if (leftState !== null) {
+                        if (this._activeChildA !== leftState) {
+                            if (this._activeChildA !== null) {
+                                this._activeChildA.weight = 0.0;
+                            }
+
+                            this._activeChildA = leftState;
+                            this._activeChildA.activeTimeline();
+                        }
+
+                        if (this._activeChildB !== rightState) {
+                            if (this._activeChildB !== null) {
+                                this._activeChildB.weight = 0.0;
+                            }
+
+                            this._activeChildB = rightState;
+                        }
+
+                        leftState.weight = dR / (dL + dR);
+
+                        if (rightState) {
+                            rightState.weight = 1.0 - leftState.weight;
+                        }
                     }
                 }
             }
@@ -881,20 +1021,40 @@ namespace dragonBones {
 
                     if (this._poseTimelines.length > 0) { // Remove pose timelines.
                         for (const timeline of this._poseTimelines) {
-                            if (timeline instanceof BoneTimelineState) {
-                                this._boneTimelines.splice(this._boneTimelines.indexOf(timeline), 1);
+                            let index = this._boneTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._boneTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof SurfaceTimelineState) {
-                                this._surfaceTimelines.splice(this._surfaceTimelines.indexOf(timeline), 1);
+
+                            index = this._boneBlendTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._boneBlendTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof SlotTimelineState) {
-                                this._slotTimelines.splice(this._slotTimelines.indexOf(timeline), 1);
+
+                            index = this._slotTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._slotTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof ConstraintTimelineState) {
-                                this._constraintTimelines.splice(this._constraintTimelines.indexOf(timeline), 1);
+
+                            index = this._slotBlendTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._slotBlendTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
 
-                            timeline.returnToPool();
+                            index = this._constraintTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._constraintTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
+                            }
                         }
 
                         this._poseTimelines.length = 0;
@@ -974,7 +1134,7 @@ namespace dragonBones {
                     timeline.fadeOut();
                 }
 
-                for (const timeline of this._surfaceTimelines) {
+                for (const timeline of this._boneBlendTimelines) {
                     timeline.fadeOut();
                 }
 
@@ -982,13 +1142,19 @@ namespace dragonBones {
                     timeline.fadeOut();
                 }
 
+                for (const timeline of this._slotBlendTimelines) {
+                    timeline.fadeOut();
+                }
+
                 for (const timeline of this._constraintTimelines) {
                     timeline.fadeOut();
                 }
 
                 for (const timeline of this._animationTimelines) {
-                    timeline.animationState.fadeOut(fadeOutTime, pausePlayhead);
                     timeline.fadeOut();
+                    //
+                    const animaitonState = timeline.target as AnimationState;
+                    animaitonState.fadeOut(999999.0, true);
                 }
             }
 
@@ -1107,6 +1273,66 @@ namespace dragonBones {
             this._boneMask.length = 0;
             this._timelineDirty = 1;
         }
+        /**
+         * @private
+         */
+        public addState(animationState: AnimationState, timelineDatas: TimelineData[] | null = null) {
+            if (timelineDatas !== null) {
+                for (const timelineData of timelineDatas) {
+                    switch (timelineData.type) {
+                        case TimelineType.AnimationProgress: {
+                            const timeline = BaseObject.borrowObject(AnimationProgressTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+
+                            if (this.blendType !== AnimationBlendType.None) {
+                                const animaitonTimelineData = timelineData as AnimationTimelineData;
+                                animationState.positionX = animaitonTimelineData.x;
+                                animationState.positionY = animaitonTimelineData.y;
+                                animationState.weight = 0.0;
+                            }
+
+                            animationState._parent = this;
+                            this.resetToPose = false;
+                            break;
+                        }
+
+                        case TimelineType.AnimationWeight: {
+                            const timeline = BaseObject.borrowObject(AnimationWeightTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            break;
+                        }
+
+                        case TimelineType.AnimationParameter: {
+                            const timeline = BaseObject.borrowObject(AnimationParametersTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            break;
+                        }
+
+                        default:
+                            break;
+                    }
+                }
+            }
+
+            if (animationState._parent === null) {
+                animationState._parent = this;
+            }
+        }
+        /**
+         * @internal
+         */
+        public activeTimeline(): void {
+            for (const timeline of this._slotTimelines) {
+                timeline.dirty = true;
+                timeline.currentTime = -1.0;
+            }
+        }
         /**
          * - Whether the animation state is fading in.
          * @version DragonBones 5.1
@@ -1220,8 +1446,11 @@ namespace dragonBones {
                 }
             }
 
-            if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 && value === this._duration) {
-                value = this._duration - 0.000001;
+            if (
+                this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 &&
+                value === this._duration && this._parent === null
+            ) {
+                value = this._duration - 0.000001; // 
             }
 
             if (this._time === value) {
@@ -1243,12 +1472,46 @@ namespace dragonBones {
                 timeline.playState = -1;
             }
         }
+        /**
+         * - The blend weight.
+         * @default 1.0
+         * @version DragonBones 5.0
+         * @language en_US
+         */
+        /**
+         * - 混合权重。
+         * @default 1.0
+         * @version DragonBones 5.0
+         * @language zh_CN
+         */
         /**
          * - The animation data.
          * @see dragonBones.AnimationData
          * @version DragonBones 3.0
          * @language en_US
          */
+        public get weight(): number {
+            return this._weight;
+        }
+        public set weight(value: number) {
+            if (this._weight === value) {
+                return;
+            }
+
+            this._weight = value;
+
+            for (const timeline of this._boneTimelines) {
+                timeline.dirty = true;
+            }
+
+            for (const timeline of this._boneBlendTimelines) {
+                timeline.dirty = true;
+            }
+
+            for (const timeline of this._slotBlendTimelines) {
+                timeline.dirty = true;
+            }
+        }
         /**
          * - 动画数据。
          * @see dragonBones.AnimationData
@@ -1262,76 +1525,78 @@ namespace dragonBones {
     /**
      * @internal
      */
-    export class BonePose extends BaseObject {
+    export class BlendState extends BaseObject {
+        public static readonly BONE_TRANSFORM: string = "boneTransform";
+        public static readonly BONE_ALPHA: string = "boneAlpha";
+        public static readonly SURFACE: string = "surface";
+        public static readonly SLOT_DEFORM: string = "slotDeform";
+        public static readonly SLOT_ALPHA: string = "slotAlpha";
+        public static readonly SLOT_Z_INDEX: string = "slotZIndex";
+
         public static toString(): string {
-            return "[class dragonBones.BonePose]";
+            return "[class dragonBones.BlendState]";
         }
 
-        public readonly current: Transform = new Transform();
-        public readonly delta: Transform = new Transform();
-        public readonly result: Transform = new Transform();
-
-        protected _onClear(): void {
-            this.current.identity();
-            this.delta.identity();
-            this.result.identity();
-        }
-    }
-    /**
-     * @internal
-     */
-    export class BlendState {
-        public dirty: boolean;
+        public dirty: number;
         public layer: number;
         public leftWeight: number;
         public layerWeight: number;
         public blendWeight: number;
+        public target: BaseObject;
 
-        /**
-         * -1: First blending, 0: No blending, 1: Blending.
-         */
-        public update(weight: number, p_layer: number): number {
-            if (this.dirty) {
+        protected _onClear(): void {
+            this.reset();
+
+            this.target = null as any;
+        }
+
+        public update(animationState: AnimationState): boolean {
+            const animationLayer = animationState.layer;
+            let animationWeight = animationState._weightResult;
+
+            if (this.dirty > 0) {
                 if (this.leftWeight > 0.0) {
-                    if (this.layer !== p_layer) {
+                    if (this.layer !== animationLayer) {
                         if (this.layerWeight >= this.leftWeight) {
+                            this.dirty++;
+                            this.layer = animationLayer;
                             this.leftWeight = 0.0;
+                            this.blendWeight = 0.0;
 
-                            return 0;
-                        }
-                        else {
-                            this.layer = p_layer;
-                            this.leftWeight -= this.layerWeight;
-                            this.layerWeight = 0.0;
+                            return false;
                         }
+
+                        this.layer = animationLayer;
+                        this.leftWeight -= this.layerWeight;
+                        this.layerWeight = 0.0;
                     }
-                }
-                else {
-                    return 0;
-                }
 
-                weight *= this.leftWeight;
-                this.layerWeight += weight;
-                this.blendWeight = weight;
+                    animationWeight *= this.leftWeight;
+                    this.dirty++;
+                    this.blendWeight = animationWeight;
+                    this.layerWeight += this.blendWeight;
+
+                    return true;
+                }
 
-                return 2;
+                return false;
             }
 
-            this.dirty = true;
-            this.layer = p_layer;
-            this.layerWeight = weight;
+            this.dirty++;
+            this.layer = animationLayer;
             this.leftWeight = 1.0;
-            this.blendWeight = weight;
+            this.blendWeight = animationWeight;
+            this.layerWeight = animationWeight;
 
-            return 1;
+            return true;
         }
 
-        public clear(): void {
-            this.dirty = false;
+        public reset(): void {
+            this.dirty = 0;
             this.layer = 0;
             this.leftWeight = 0.0;
             this.layerWeight = 0.0;
             this.blendWeight = 0.0;
         }
     }
-}
\ No newline at end of file
+}
diff --git a/DragonBones/src/dragonBones/animation/BaseTimelineState.ts b/DragonBones/src/dragonBones/animation/BaseTimelineState.ts
index 1f9a2013..884dc00d 100644
--- a/DragonBones/src/dragonBones/animation/BaseTimelineState.ts
+++ b/DragonBones/src/dragonBones/animation/BaseTimelineState.ts
@@ -21,73 +21,67 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 namespace dragonBones {
-    /**
-     * @internal
-     */
-    export const enum TweenState {
-        None,
-        Once,
-        Always
-    }
     /**
      * @internal
      */
     export abstract class TimelineState extends BaseObject {
+        public dirty: boolean;
         /**
          * -1: start, 0: play, 1: complete;
          */
         public playState: number;
         public currentPlayTimes: number;
         public currentTime: number;
+        public target: BaseObject;
 
-        protected _tweenState: TweenState;
-        protected _frameRate: number;
+        protected _isTween: boolean;
+        protected _valueOffset: number;
         protected _frameValueOffset: number;
-        protected _frameCount: number;
         protected _frameOffset: number;
+        protected _frameRate: number;
+        protected _frameCount: number;
         protected _frameIndex: number;
         protected _frameRateR: number;
         protected _position: number;
         protected _duration: number;
         protected _timeScale: number;
         protected _timeOffset: number;
-        protected _dragonBonesData: DragonBonesData;
         protected _animationData: AnimationData;
         protected _timelineData: TimelineData | null;
         protected _armature: Armature;
         protected _animationState: AnimationState;
         protected _actionTimeline: TimelineState;
-        protected _frameArray: Array | Int16Array;
-        protected _frameIntArray: Array | Int16Array;
-        protected _frameFloatArray: Array | Int16Array;
         protected _timelineArray: Array | Uint16Array;
+        protected _frameArray: Array | Int16Array;
+        protected _valueArray: Array | Int16Array | Float32Array;
         protected _frameIndices: Array;
 
         protected _onClear(): void {
+            this.dirty = false;
             this.playState = -1;
-            this.currentPlayTimes = -1;
+            this.currentPlayTimes = 0;
             this.currentTime = -1.0;
+            this.target = null as any;
 
-            this._tweenState = TweenState.None;
-            this._frameRate = 0;
+            this._isTween = false;
+            this._valueOffset = 0;
             this._frameValueOffset = 0;
-            this._frameCount = 0;
             this._frameOffset = 0;
+            this._frameRate = 0;
+            this._frameCount = 0;
             this._frameIndex = -1;
             this._frameRateR = 0.0;
             this._position = 0.0;
             this._duration = 0.0;
             this._timeScale = 1.0;
             this._timeOffset = 0.0;
-            this._dragonBonesData = null as any; //
             this._animationData = null as any; //
             this._timelineData = null as any; //
             this._armature = null as any; //
             this._animationState = null as any; //
             this._actionTimeline = null as any; //
             this._frameArray = null as any; //
-            this._frameIntArray = null as any; //
-            this._frameFloatArray = null as any; //
+            this._valueArray = null as any; //
             this._timelineArray = null as any; //
             this._frameIndices = null as any; //
         }
@@ -124,7 +118,7 @@ namespace dragonBones {
                         this.currentTime = 0.0;
                     }
                     else {
-                        this.currentTime = this._duration + 0.000001; // Precision problem
+                        this.currentTime = this.playState === 1 ? this._duration + 0.000001 : this._duration; // Precision problem
                     }
                 }
                 else {
@@ -176,21 +170,19 @@ namespace dragonBones {
                 this._actionTimeline = null as any; //
             }
 
-            this._animationData = this._animationState._animationData;
-
+            this._animationData = this._animationState.animationData;
+            //
             this._frameRate = this._animationData.parent.frameRate;
             this._frameRateR = 1.0 / this._frameRate;
             this._position = this._animationState._position;
             this._duration = this._animationState._duration;
-            this._dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data.
 
             if (this._timelineData !== null) {
-                this._frameIntArray = this._dragonBonesData.frameIntArray;
-                this._frameFloatArray = this._dragonBonesData.frameFloatArray;
-                this._frameArray = this._dragonBonesData.frameArray;
-                this._timelineArray = this._dragonBonesData.timelineArray;
-                this._frameIndices = this._dragonBonesData.frameIndices;
-
+                const dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data.
+                this._frameArray = dragonBonesData.frameArray;
+                this._timelineArray = dragonBonesData.timelineArray;
+                this._frameIndices = dragonBonesData.frameIndices;
+                //
                 this._frameCount = this._timelineArray[this._timelineData.offset + BinaryOffset.TimelineKeyFrameCount];
                 this._frameValueOffset = this._timelineArray[this._timelineData.offset + BinaryOffset.TimelineFrameValueOffset];
                 this._timeScale = 100.0 / this._timelineArray[this._timelineData.offset + BinaryOffset.TimelineScale];
@@ -198,13 +190,16 @@ namespace dragonBones {
             }
         }
 
-        public fadeOut(): void { }
+        public fadeOut(): void {
+            this.dirty = false;
+        }
 
         public update(passedTime: number): void {
             if (this._setCurrentTime(passedTime)) {
                 if (this._frameCount > 1) {
                     const timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint
                     const frameIndex = this._frameIndices[(this._timelineData as TimelineData).frameIndicesOffset + timelineFrameIndex];
+
                     if (this._frameIndex !== frameIndex) {
                         this._frameIndex = frameIndex;
                         this._frameOffset = this._animationData.frameOffset + this._timelineArray[(this._timelineData as TimelineData).offset + BinaryOffset.TimelineFrameOffset + this._frameIndex];
@@ -214,6 +209,7 @@ namespace dragonBones {
                 }
                 else if (this._frameIndex < 0) {
                     this._frameIndex = 0;
+
                     if (this._timelineData !== null) { // May be pose timeline.
                         this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + BinaryOffset.TimelineFrameOffset];
                     }
@@ -221,11 +217,14 @@ namespace dragonBones {
                     this._onArriveAtFrame();
                 }
 
-                if (this._tweenState !== TweenState.None) {
+                if (this._isTween || this.dirty) {
                     this._onUpdateFrame();
                 }
             }
         }
+
+        public blend(_isDirty: boolean): void {
+        }
     }
     /**
      * @internal
@@ -259,10 +258,20 @@ namespace dragonBones {
                 return 1.0;
             }
 
+            const isOmited = count > 0;
             const segmentCount = count + 1; // + 2 - 1
             const valueIndex = Math.floor(progress * segmentCount);
-            const fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1];
-            const toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex];
+            let fromValue = 0.0;
+            let toValue = 0.0;
+
+            if (isOmited) {
+                fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1];
+                toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex];
+            }
+            else {
+                fromValue = samples[offset + valueIndex - 1];
+                toValue = samples[offset + valueIndex];
+            }
 
             return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001;
         }
@@ -271,8 +280,9 @@ namespace dragonBones {
         protected _curveCount: number;
         protected _framePosition: number;
         protected _frameDurationR: number;
-        protected _tweenProgress: number;
         protected _tweenEasing: number;
+        protected _tweenProgress: number;
+        protected _valueScale: number;
 
         protected _onClear(): void {
             super._onClear();
@@ -281,8 +291,9 @@ namespace dragonBones {
             this._curveCount = 0;
             this._framePosition = 0.0;
             this._frameDurationR = 0.0;
-            this._tweenProgress = 0.0;
             this._tweenEasing = 0.0;
+            this._tweenProgress = 0.0;
+            this._valueScale = 1.0;
         }
 
         protected _onArriveAtFrame(): void {
@@ -294,16 +305,23 @@ namespace dragonBones {
                     this._animationState.currentPlayTimes < this._animationState.playTimes - 1
                 )
             ) {
-                this._tweenType = this._frameArray[this._frameOffset + BinaryOffset.FrameTweenType]; // TODO recode ture tween type.
-                this._tweenState = this._tweenType === TweenType.None ? TweenState.Once : TweenState.Always;
-                if (this._tweenType === TweenType.Curve) {
-                    this._curveCount = this._frameArray[this._frameOffset + BinaryOffset.FrameTweenEasingOrCurveSampleCount];
+                this._tweenType = this._frameArray[this._frameOffset + BinaryOffset.FrameTweenType];
+                this._isTween = this._tweenType !== TweenType.None;
+
+                if (this._isTween) {
+                    if (this._tweenType === TweenType.Curve) {
+                        this._curveCount = this._frameArray[this._frameOffset + BinaryOffset.FrameTweenEasingOrCurveSampleCount];
+                    }
+                    else if (this._tweenType !== TweenType.None && this._tweenType !== TweenType.Line) {
+                        this._tweenEasing = this._frameArray[this._frameOffset + BinaryOffset.FrameTweenEasingOrCurveSampleCount] * 0.01;
+                    }
                 }
-                else if (this._tweenType !== TweenType.None && this._tweenType !== TweenType.Line) {
-                    this._tweenEasing = this._frameArray[this._frameOffset + BinaryOffset.FrameTweenEasingOrCurveSampleCount] * 0.01;
+                else {
+                    this.dirty = true;
                 }
 
                 this._framePosition = this._frameArray[this._frameOffset] * this._frameRateR;
+
                 if (this._frameIndex === this._frameCount - 1) {
                     this._frameDurationR = 1.0 / (this._animationData.duration - this._framePosition);
                 }
@@ -320,13 +338,16 @@ namespace dragonBones {
                 }
             }
             else {
-                this._tweenState = TweenState.Once;
+                this.dirty = true;
+                this._isTween = false;
             }
         }
 
         protected _onUpdateFrame(): void {
-            if (this._tweenState === TweenState.Always) {
+            if (this._isTween) {
+                this.dirty = true;
                 this._tweenProgress = (this.currentTime - this._framePosition) * this._frameDurationR;
+
                 if (this._tweenType === TweenType.Curve) {
                     this._tweenProgress = TweenTimelineState._getEasingCurveValue(this._tweenProgress, this._frameArray, this._curveCount, this._frameOffset + BinaryOffset.FrameCurveSamples);
                 }
@@ -334,82 +355,216 @@ namespace dragonBones {
                     this._tweenProgress = TweenTimelineState._getEasingValue(this._tweenType, this._tweenProgress, this._tweenEasing);
                 }
             }
-            else {
-                this._tweenProgress = 0.0;
-            }
         }
     }
     /**
      * @internal
      */
-    export abstract class BoneTimelineState extends TweenTimelineState {
-        public bone: Bone;
-        public bonePose: BonePose;
+    export abstract class SingleValueTimelineState extends TweenTimelineState {
+        protected _current: number;
+        protected _difference: number;
+        protected _result: number;
 
         protected _onClear(): void {
             super._onClear();
 
-            this.bone = null as any; //
-            this.bonePose = null as any; //
+            this._current = 0.0;
+            this._difference = 0.0;
+            this._result = 0.0;
         }
 
-        public blend(state: number): void {
-            const blendWeight = this.bone._blendState.blendWeight;
-            const animationPose = this.bone.animationPose;
-            const result = this.bonePose.result;
-
-            if (state === 2) {
-                animationPose.x += result.x * blendWeight;
-                animationPose.y += result.y * blendWeight;
-                animationPose.rotation += result.rotation * blendWeight;
-                animationPose.skew += result.skew * blendWeight;
-                animationPose.scaleX += (result.scaleX - 1.0) * blendWeight;
-                animationPose.scaleY += (result.scaleY - 1.0) * blendWeight;
-            }
-            else if (blendWeight !== 1.0) {
-                animationPose.x = result.x * blendWeight;
-                animationPose.y = result.y * blendWeight;
-                animationPose.rotation = result.rotation * blendWeight;
-                animationPose.skew = result.skew * blendWeight;
-                animationPose.scaleX = (result.scaleX - 1.0) * blendWeight + 1.0;
-                animationPose.scaleY = (result.scaleY - 1.0) * blendWeight + 1.0;
+        protected _onArriveAtFrame(): void {
+            super._onArriveAtFrame();
+
+            if (this._timelineData !== null) {
+                const valueScale = this._valueScale;
+                const valueArray = this._valueArray;
+                //
+                const valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex;
+
+                if (this._isTween) {
+                    const nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + 1;
+
+                    if (valueScale === 1.0) {
+                        this._current = valueArray[valueOffset];
+                        this._difference = valueArray[nextValueOffset] - this._current;
+                    }
+                    else {
+                        this._current = valueArray[valueOffset] * valueScale;
+                        this._difference = valueArray[nextValueOffset] * valueScale - this._current;
+                    }
+                }
+                else {
+                    this._result = valueArray[valueOffset] * valueScale;
+                }
             }
             else {
-                animationPose.x = result.x;
-                animationPose.y = result.y;
-                animationPose.rotation = result.rotation;
-                animationPose.skew = result.skew;
-                animationPose.scaleX = result.scaleX;
-                animationPose.scaleY = result.scaleY;
+                this._result = 0.0;
             }
+        }
 
-            if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                this.bone._transformDirty = true;
+        protected _onUpdateFrame(): void {
+            super._onUpdateFrame();
+
+            if (this._isTween) {
+                this._result = this._current + this._difference * this._tweenProgress;
             }
         }
     }
     /**
      * @internal
      */
-    export abstract class SlotTimelineState extends TweenTimelineState {
-        public slot: Slot;
+    export abstract class DoubleValueTimelineState extends TweenTimelineState {
+        protected _currentA: number;
+        protected _currentB: number;
+        protected _differenceA: number;
+        protected _differenceB: number;
+        protected _resultA: number;
+        protected _resultB: number;
 
         protected _onClear(): void {
             super._onClear();
 
-            this.slot = null as any; //
+            this._currentA = 0.0;
+            this._currentB = 0.0;
+            this._differenceA = 0.0;
+            this._differenceB = 0.0;
+            this._resultA = 0.0;
+            this._resultB = 0.0;
+        }
+
+        protected _onArriveAtFrame(): void {
+            super._onArriveAtFrame();
+
+            if (this._timelineData !== null) {
+                const valueScale = this._valueScale;
+                const valueArray = this._valueArray;
+                //
+                const valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * 2;
+
+                if (this._isTween) {
+                    const nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + 2;
+
+                    if (valueScale === 1.0) {
+                        this._currentA = valueArray[valueOffset];
+                        this._currentB = valueArray[valueOffset + 1];
+                        this._differenceA = valueArray[nextValueOffset] - this._currentA;
+                        this._differenceB = valueArray[nextValueOffset + 1] - this._currentB;
+                    }
+                    else {
+                        this._currentA = valueArray[valueOffset] * valueScale;
+                        this._currentB = valueArray[valueOffset + 1] * valueScale;
+                        this._differenceA = valueArray[nextValueOffset] * valueScale - this._currentA;
+                        this._differenceB = valueArray[nextValueOffset + 1] * valueScale - this._currentB;
+                    }
+                }
+                else {
+                    this._resultA = valueArray[valueOffset] * valueScale;
+                    this._resultB = valueArray[valueOffset + 1] * valueScale;
+                }
+            }
+            else {
+                this._resultA = 0.0;
+                this._resultB = 0.0;
+            }
+        }
+
+        protected _onUpdateFrame(): void {
+            super._onUpdateFrame();
+
+            if (this._isTween) {
+                this._resultA = this._currentA + this._differenceA * this._tweenProgress;
+                this._resultB = this._currentB + this._differenceB * this._tweenProgress;
+            }
         }
     }
     /**
      * @internal
      */
-    export abstract class ConstraintTimelineState extends TweenTimelineState {
-        public constraint: Constraint;
+    export abstract class MutilpleValueTimelineState extends TweenTimelineState {
+        protected _valueCount: number;
+        protected readonly _rd: Array = [];
 
         protected _onClear(): void {
             super._onClear();
 
-            this.constraint = null as any; //
+            this._valueCount = 0;
+            this._rd.length = 0;
+        }
+
+        protected _onArriveAtFrame(): void {
+            super._onArriveAtFrame();
+
+            const valueCount = this._valueCount;
+            const rd = this._rd;
+
+            if (this._timelineData !== null) {
+                const valueScale = this._valueScale;
+                const valueArray = this._valueArray;
+                //
+                const valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount;
+
+                if (this._isTween) {
+                    const nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + valueCount;
+
+                    if (valueScale === 1.0) {
+                        for (let i = 0; i < valueCount; ++i) {
+                            rd[valueCount + i] = valueArray[nextValueOffset + i] - valueArray[valueOffset + i];
+                        }
+                    }
+                    else {
+                        for (let i = 0; i < valueCount; ++i) {
+                            rd[valueCount + i] = (valueArray[nextValueOffset + i] - valueArray[valueOffset + i]) * valueScale;
+                        }
+                    }
+                }
+                else if (valueScale === 1.0) {
+                    for (let i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i];
+                    }
+                }
+                else {
+                    for (let i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] * valueScale;
+                    }
+                }
+            }
+            else {
+                for (let i = 0; i < valueCount; ++i) {
+                    rd[i] = 0.0;
+                }
+            }
+        }
+
+        protected _onUpdateFrame(): void {
+            super._onUpdateFrame();
+
+            if (this._isTween) {
+                const valueCount = this._valueCount;
+                const valueScale = this._valueScale;
+                const tweenProgress = this._tweenProgress;
+                const valueArray = this._valueArray;
+                const rd = this._rd;
+                //
+                const valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount;
+
+                if (valueScale === 1.0) {
+                    for (let i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] + rd[valueCount + i] * tweenProgress;
+                    }
+                }
+                else {
+                    for (let i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] * valueScale + rd[valueCount + i] * tweenProgress;
+                    }
+                }
+            }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/DragonBones/src/dragonBones/animation/IAnimatable.ts b/DragonBones/src/dragonBones/animation/IAnimatable.ts
index c921e102..a2ffc808 100644
--- a/DragonBones/src/dragonBones/animation/IAnimatable.ts
+++ b/DragonBones/src/dragonBones/animation/IAnimatable.ts
@@ -73,4 +73,4 @@ namespace dragonBones {
          */
         clock: WorldClock | null;
     }
-}
\ No newline at end of file
+}
diff --git a/DragonBones/src/dragonBones/animation/TimelineState.ts b/DragonBones/src/dragonBones/animation/TimelineState.ts
index fc0c9214..2d9863c9 100644
--- a/DragonBones/src/dragonBones/animation/TimelineState.ts
+++ b/DragonBones/src/dragonBones/animation/TimelineState.ts
@@ -72,6 +72,7 @@ namespace dragonBones {
             let prevTime = this.currentTime;
 
             if (this._setCurrentTime(passedTime)) {
+                const eventActive = this._animationState._parent === null && this._animationState.actionEnabled;
                 const eventDispatcher = this._armature.eventDispatcher;
                 if (prevState < 0) {
                     if (this.playState !== prevState) {
@@ -79,9 +80,9 @@ namespace dragonBones {
                             this._armature._sortZOrder(null, 0);
                         }
 
-                        prevPlayTimes = this.currentPlayTimes;
+                        // prevPlayTimes = this.currentPlayTimes; // TODO
 
-                        if (eventDispatcher.hasDBEventListener(EventObject.START)) {
+                        if (eventActive && eventDispatcher.hasDBEventListener(EventObject.START)) {
                             const eventObject = BaseObject.borrowObject(EventObject);
                             eventObject.type = EventObject.START;
                             eventObject.armature = this._armature;
@@ -98,7 +99,7 @@ namespace dragonBones {
                 let loopCompleteEvent: EventObject | null = null;
                 let completeEvent: EventObject | null = null;
 
-                if (this.currentPlayTimes !== prevPlayTimes) {
+                if (eventActive && this.currentPlayTimes !== prevPlayTimes) {
                     if (eventDispatcher.hasDBEventListener(EventObject.LOOP_COMPLETE)) {
                         loopCompleteEvent = BaseObject.borrowObject(EventObject);
                         loopCompleteEvent.type = EventObject.LOOP_COMPLETE;
@@ -206,7 +207,7 @@ namespace dragonBones {
 
                                     if (
                                         this._position <= framePosition &&
-                                        framePosition <= this._position + this._duration
+                                        framePosition <= this._position + this._duration //
                                     ) { // Support interval play.
                                         this._onCrossFrame(crossedFrameIndex);
                                     }
@@ -287,7 +288,7 @@ namespace dragonBones {
     /**
      * @internal
      */
-    export class BoneAllTimelineState extends BoneTimelineState {
+    export class BoneAllTimelineState extends MutilpleValueTimelineState {
         public static toString(): string {
             return "[class dragonBones.BoneAllTimelineState]";
         }
@@ -295,148 +296,108 @@ namespace dragonBones {
         protected _onArriveAtFrame(): void {
             super._onArriveAtFrame();
 
-            if (this._timelineData !== null) {
-                let valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 6; // ...(timeline value offset)|xxxxxx|xxxxxx|(Value offset)xxxxx|(Next offset)xxxxx|xxxxxx|xxxxxx|...
-                const scale = this._armature._armatureData.scale;
-                const frameFloatArray = this._frameFloatArray;
-                const current = this.bonePose.current;
-                const delta = this.bonePose.delta;
-                current.x = frameFloatArray[valueOffset++] * scale;
-                current.y = frameFloatArray[valueOffset++] * scale;
-                current.rotation = frameFloatArray[valueOffset++];
-                current.skew = frameFloatArray[valueOffset++];
-                current.scaleX = frameFloatArray[valueOffset++];
-                current.scaleY = frameFloatArray[valueOffset++];
-
-                if (this._tweenState === TweenState.Always) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 6
-                    }
-
-                    delta.x = frameFloatArray[valueOffset++] * scale - current.x;
-                    delta.y = frameFloatArray[valueOffset++] * scale - current.y;
-                    delta.rotation = frameFloatArray[valueOffset++] - current.rotation;
-                    delta.skew = frameFloatArray[valueOffset++] - current.skew;
-                    delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX;
-                    delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY;
-                }
-                else {
-                    delta.x = 0.0;
-                    delta.y = 0.0;
-                    delta.rotation = 0.0;
-                    delta.skew = 0.0;
-                    delta.scaleX = 0.0;
-                    delta.scaleY = 0.0;
-                }
+            if (this._isTween && this._frameIndex === this._frameCount - 1) {
+                this._rd[2] = Transform.normalizeRadian(this._rd[2]);
+                this._rd[3] = Transform.normalizeRadian(this._rd[3]);
             }
-            else { // Pose.
-                const current = this.bonePose.current;
-                const delta = this.bonePose.delta;
-                current.x = 0.0;
-                current.y = 0.0;
-                current.rotation = 0.0;
-                current.skew = 0.0;
-                current.scaleX = 1.0;
-                current.scaleY = 1.0;
-                delta.x = 0.0;
-                delta.y = 0.0;
-                delta.rotation = 0.0;
-                delta.skew = 0.0;
-                delta.scaleX = 0.0;
-                delta.scaleY = 0.0;
+
+            if (this._timelineData === null) { // Pose.
+                this._rd[4] = 1.0;
+                this._rd[5] = 1.0;
             }
         }
 
-        protected _onUpdateFrame(): void {
-            super._onUpdateFrame();
-
-            const current = this.bonePose.current;
-            const delta = this.bonePose.delta;
-            const result = this.bonePose.result;
-
-            this.bone._transformDirty = true;
-            if (this._tweenState !== TweenState.Always) {
-                this._tweenState = TweenState.None;
-            }
+        public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
+            super.init(armature, animationState, timelineData);
 
-            result.x = current.x + delta.x * this._tweenProgress;
-            result.y = current.y + delta.y * this._tweenProgress;
-            result.rotation = current.rotation + delta.rotation * this._tweenProgress;
-            result.skew = current.skew + delta.skew * this._tweenProgress;
-            result.scaleX = current.scaleX + delta.scaleX * this._tweenProgress;
-            result.scaleY = current.scaleY + delta.scaleY * this._tweenProgress;
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueCount = 6;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
         }
 
         public fadeOut(): void {
-            const result = this.bonePose.result;
-            result.rotation = Transform.normalizeRadian(result.rotation);
-            result.skew = Transform.normalizeRadian(result.skew);
+            this.dirty = false;
+            this._rd[2] = Transform.normalizeRadian(this._rd[2]);
+            this._rd[3] = Transform.normalizeRadian(this._rd[3]);
+        }
+
+        public blend(isDirty: boolean): void {
+            const valueScale = this._armature.armatureData.scale;
+            const rd = this._rd;
+            //
+            const blendState = this.target as BlendState;
+            const bone = blendState.target as Bone;
+            const blendWeight = blendState.blendWeight;
+            const result = bone.animationPose;
+
+            if (blendState.dirty > 1) {
+                result.x += rd[0] * blendWeight * valueScale;
+                result.y += rd[1] * blendWeight * valueScale;
+                result.rotation += rd[2] * blendWeight;
+                result.skew += rd[3] * blendWeight;
+                result.scaleX += (rd[4] - 1.0) * blendWeight;
+                result.scaleY += (rd[5] - 1.0) * blendWeight;
+            }
+            else {
+                result.x = rd[0] * blendWeight * valueScale;
+                result.y = rd[1] * blendWeight * valueScale;
+                result.rotation = rd[2] * blendWeight;
+                result.skew = rd[3] * blendWeight;
+                result.scaleX = (rd[4] - 1.0) * blendWeight + 1.0; // 
+                result.scaleY = (rd[5] - 1.0) * blendWeight + 1.0; //
+            }
+
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         }
     }
     /**
      * @internal
      */
-    export class BoneTranslateTimelineState extends BoneTimelineState {
+    export class BoneTranslateTimelineState extends DoubleValueTimelineState {
         public static toString(): string {
             return "[class dragonBones.BoneTranslateTimelineState]";
         }
 
-        protected _onArriveAtFrame(): void {
-            super._onArriveAtFrame();
-
-            if (this._timelineData !== null) {
-                let valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                const scale = this._armature._armatureData.scale;
-                const frameFloatArray = this._frameFloatArray;
-                const current = this.bonePose.current;
-                const delta = this.bonePose.delta;
+        public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
+            super.init(armature, animationState, timelineData);
 
-                current.x = frameFloatArray[valueOffset++] * scale;
-                current.y = frameFloatArray[valueOffset++] * scale;
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueScale = this._armature.armatureData.scale;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
+        }
 
-                if (this._tweenState === TweenState.Always) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                    }
+        public blend(isDirty: boolean): void {
+            const blendState = this.target as BlendState;
+            const bone = blendState.target as Bone;
+            const blendWeight = blendState.blendWeight;
+            const result = bone.animationPose;
 
-                    delta.x = frameFloatArray[valueOffset++] * scale - current.x;
-                    delta.y = frameFloatArray[valueOffset++] * scale - current.y;
-                }
-                else {
-                    delta.x = 0.0;
-                    delta.y = 0.0;
-                }
+            if (blendState.dirty > 1) {
+                result.x += this._resultA * blendWeight;
+                result.y += this._resultB * blendWeight;
             }
-            else { // Pose.
-                const current = this.bonePose.current;
-                const delta = this.bonePose.delta;
-                current.x = 0.0;
-                current.y = 0.0;
-                delta.x = 0.0;
-                delta.y = 0.0;
+            else if (blendWeight !== 1.0) {
+                result.x = this._resultA * blendWeight;
+                result.y = this._resultB * blendWeight;
             }
-        }
-
-        protected _onUpdateFrame(): void {
-            super._onUpdateFrame();
-
-            const current = this.bonePose.current;
-            const delta = this.bonePose.delta;
-            const result = this.bonePose.result;
-
-            this.bone._transformDirty = true;
-            if (this._tweenState !== TweenState.Always) {
-                this._tweenState = TweenState.None;
+            else {
+                result.x = this._resultA;
+                result.y = this._resultB;
             }
 
-            result.x = (current.x + delta.x * this._tweenProgress);
-            result.y = (current.y + delta.y * this._tweenProgress);
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         }
     }
     /**
      * @internal
      */
-    export class BoneRotateTimelineState extends BoneTimelineState {
+    export class BoneRotateTimelineState extends DoubleValueTimelineState {
         public static toString(): string {
             return "[class dragonBones.BoneRotateTimelineState]";
         }
@@ -444,67 +405,54 @@ namespace dragonBones {
         protected _onArriveAtFrame(): void {
             super._onArriveAtFrame();
 
-            if (this._timelineData !== null) {
-                let valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                const frameFloatArray = this._frameFloatArray;
-                const current = this.bonePose.current;
-                const delta = this.bonePose.delta;
-
-                current.rotation = frameFloatArray[valueOffset++];
-                current.skew = frameFloatArray[valueOffset++];
+            if (this._isTween && this._frameIndex === this._frameCount - 1) {
+                this._differenceA = Transform.normalizeRadian(this._differenceA);
+                this._differenceB = Transform.normalizeRadian(this._differenceB);
+            }
+        }
 
-                if (this._tweenState === TweenState.Always) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                        delta.rotation = Transform.normalizeRadian(frameFloatArray[valueOffset++] - current.rotation);
-                    }
-                    else {
-                        delta.rotation = frameFloatArray[valueOffset++] - current.rotation;
-                    }
+        public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
+            super.init(armature, animationState, timelineData);
 
-                    delta.skew = frameFloatArray[valueOffset++] - current.skew;
-                }
-                else {
-                    delta.rotation = 0.0;
-                    delta.skew = 0.0;
-                }
-            }
-            else { // Pose.
-                const current = this.bonePose.current;
-                const delta = this.bonePose.delta;
-                current.rotation = 0.0;
-                current.skew = 0.0;
-                delta.rotation = 0.0;
-                delta.skew = 0.0;
-            }
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
         }
 
-        protected _onUpdateFrame(): void {
-            super._onUpdateFrame();
+        public fadeOut(): void {
+            this.dirty = false;
+            this._resultA = Transform.normalizeRadian(this._resultA);
+            this._resultB = Transform.normalizeRadian(this._resultB);
+        }
 
-            const current = this.bonePose.current;
-            const delta = this.bonePose.delta;
-            const result = this.bonePose.result;
+        public blend(isDirty: boolean): void {
+            const blendState = this.target as BlendState;
+            const bone = blendState.target as Bone;
+            const blendWeight = blendState.blendWeight;
+            const result = bone.animationPose;
 
-            this.bone._transformDirty = true;
-            if (this._tweenState !== TweenState.Always) {
-                this._tweenState = TweenState.None;
+            if (blendState.dirty > 1) {
+                result.rotation += this._resultA * blendWeight;
+                result.skew += this._resultB * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.rotation = this._resultA * blendWeight;
+                result.skew = this._resultB * blendWeight;
+            }
+            else {
+                result.rotation = this._resultA;
+                result.skew = this._resultB;
             }
 
-            result.rotation = current.rotation + delta.rotation * this._tweenProgress;
-            result.skew = current.skew + delta.skew * this._tweenProgress;
-        }
-
-        public fadeOut(): void {
-            const result = this.bonePose.result;
-            result.rotation = Transform.normalizeRadian(result.rotation);
-            result.skew = Transform.normalizeRadian(result.skew);
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         }
     }
     /**
      * @internal
      */
-    export class BoneScaleTimelineState extends BoneTimelineState {
+    export class BoneScaleTimelineState extends DoubleValueTimelineState {
         public static toString(): string {
             return "[class dragonBones.BoneScaleTimelineState]";
         }
@@ -512,312 +460,304 @@ namespace dragonBones {
         protected _onArriveAtFrame(): void {
             super._onArriveAtFrame();
 
-            if (this._timelineData !== null) {
-                let valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                const frameFloatArray = this._frameFloatArray;
-                const current = this.bonePose.current;
-                const delta = this.bonePose.delta;
-
-                current.scaleX = frameFloatArray[valueOffset++];
-                current.scaleY = frameFloatArray[valueOffset++];
-
-                if (this._tweenState === TweenState.Always) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                    }
-
-                    delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX;
-                    delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY;
-                }
-                else {
-                    delta.scaleX = 0.0;
-                    delta.scaleY = 0.0;
-                }
-            }
-            else { // Pose.
-                const current = this.bonePose.current;
-                const delta = this.bonePose.delta;
-                current.scaleX = 1.0;
-                current.scaleY = 1.0;
-                delta.scaleX = 0.0;
-                delta.scaleY = 0.0;
+            if (this._timelineData === null) { // Pose.
+                this._resultA = 1.0;
+                this._resultB = 1.0;
             }
         }
 
-        protected _onUpdateFrame(): void {
-            super._onUpdateFrame();
+        public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
+            super.init(armature, animationState, timelineData);
 
-            const current = this.bonePose.current;
-            const delta = this.bonePose.delta;
-            const result = this.bonePose.result;
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
+        }
+
+        public blend(isDirty: boolean): void {
+            const blendState = this.target as BlendState;
+            const bone = blendState.target as Bone;
+            const blendWeight = blendState.blendWeight;
+            const result = bone.animationPose;
 
-            this.bone._transformDirty = true;
-            if (this._tweenState !== TweenState.Always) {
-                this._tweenState = TweenState.None;
+            if (blendState.dirty > 1) {
+                result.scaleX += (this._resultA - 1.0) * blendWeight;
+                result.scaleY += (this._resultB - 1.0) * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.scaleX = (this._resultA - 1.0) * blendWeight + 1.0;
+                result.scaleY = (this._resultB - 1.0) * blendWeight + 1.0;
+            }
+            else {
+                result.scaleX = this._resultA;
+                result.scaleY = this._resultB;
             }
 
-            result.scaleX = current.scaleX + delta.scaleX * this._tweenProgress;
-            result.scaleY = current.scaleY + delta.scaleY * this._tweenProgress;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         }
     }
     /**
      * @internal
      */
-    export class SurfaceTimelineState extends TweenTimelineState {
+    export class SurfaceTimelineState extends MutilpleValueTimelineState {
         public static toString(): string {
             return "[class dragonBones.SurfaceTimelineState]";
         }
 
-        public surface: Surface;
-
-        private _frameFloatOffset: number;
-        private _valueCount: number;
         private _deformCount: number;
-        private _valueOffset: number;
-        private readonly _current: Array = [];
-        private readonly _delta: Array = [];
-        private readonly _result: Array = [];
+        private _deformOffset: number;
+        private _sameValueOffset: number;
 
         protected _onClear(): void {
             super._onClear();
 
-            this.surface = null as any;
-
-            this._frameFloatOffset = 0;
-            this._valueCount = 0;
             this._deformCount = 0;
-            this._valueOffset = 0;
-            this._current.length = 0;
-            this._delta.length = 0;
-            this._result.length = 0;
+            this._deformOffset = 0;
+            this._sameValueOffset = 0;
         }
 
-        protected _onArriveAtFrame(): void {
-            super._onArriveAtFrame();
+        public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
+            super.init(armature, animationState, timelineData);
 
             if (this._timelineData !== null) {
-                const valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * this._valueCount;
-                const scale = this._armature._armatureData.scale;
-                const frameFloatArray = this._frameFloatArray;
+                const dragonBonesData = this._animationData.parent.parent;
+                const frameIntArray = dragonBonesData.frameIntArray;
+                const frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + BinaryOffset.TimelineFrameValueCount];
+                this._valueOffset = this._animationData.frameFloatOffset;
+                this._valueCount = frameIntArray[frameIntOffset + BinaryOffset.DeformValueCount];
+                this._deformCount = frameIntArray[frameIntOffset + BinaryOffset.DeformCount];
+                this._deformOffset = frameIntArray[frameIntOffset + BinaryOffset.DeformValueOffset];
+                this._sameValueOffset = frameIntArray[frameIntOffset + BinaryOffset.DeformFloatOffset] + this._animationData.frameFloatOffset;
+                this._valueScale = this._armature.armatureData.scale;
+                this._valueArray = dragonBonesData.frameFloatArray;
+                this._rd.length = this._valueCount * 2;
+            }
+            else {
+                this._deformCount = ((this.target as BlendState).target as Surface)._deformVertices.length;
+            }
+        }
 
-                if (this._tweenState === TweenState.Always) {
-                    let nextValueOffset = valueOffset + this._valueCount;
-                    if (this._frameIndex === this._frameCount - 1) {
-                        nextValueOffset = this._animationData.frameFloatOffset + this._frameValueOffset;
+        public blend(isDirty: boolean): void {
+            const blendState = this.target as BlendState;
+            const surface = blendState.target as Surface;
+            const blendWeight = blendState.blendWeight;
+            const result = surface._deformVertices;
+            const valueArray = this._valueArray;
+
+            if (valueArray !== null) {
+                const valueCount = this._valueCount;
+                const deformOffset = this._deformOffset;
+                const sameValueOffset = this._sameValueOffset;
+                const rd = this._rd;
+
+                for (let i = 0; i < this._deformCount; ++i) {
+                    let value = 0.0;
+
+                    if (i < deformOffset) {
+                        value = valueArray[sameValueOffset + i];
+                    }
+                    else if (i < deformOffset + valueCount) {
+                        value = rd[i - deformOffset];
+                    }
+                    else {
+                        value = valueArray[sameValueOffset + i - valueCount];
                     }
 
-                    for (let i = 0; i < this._valueCount; ++i) {
-                        this._delta[i] = frameFloatArray[nextValueOffset + i] * scale - (this._current[i] = frameFloatArray[valueOffset + i] * scale);
+                    if (blendState.dirty > 1) {
+                        result[i] += value * blendWeight;
                     }
-                }
-                else {
-                    for (let i = 0; i < this._valueCount; ++i) {
-                        this._current[i] = frameFloatArray[valueOffset + i] * scale;
+                    else {
+                        result[i] = value * blendWeight;
                     }
                 }
             }
-            else {
-                for (let i = 0; i < this._valueCount; ++i) {
-                    this._current[i] = 0.0;
+            else if (blendState.dirty === 1) {
+                for (let i = 0; i < this._deformCount; ++i) {
+                    result[i] = 0.0;
                 }
             }
-        }
-
-        protected _onUpdateFrame(): void {
-            super._onUpdateFrame();
-
-            this.surface._transformDirty = true;
 
-            if (this._tweenState !== TweenState.Always) {
-                this._tweenState = TweenState.None;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                surface._transformDirty = true;
             }
+        }
+    }
+    /**
+     * @internal
+     */
+    export class AlphaTimelineState extends SingleValueTimelineState {
+        public static toString(): string {
+            return "[class dragonBones.AlphaTimelineState]";
+        }
+
+        protected _onArriveAtFrame(): void {
+            super._onArriveAtFrame();
 
-            for (let i = 0; i < this._valueCount; ++i) {
-                this._result[i] = this._current[i] + this._delta[i] * this._tweenProgress;
+            if (this._timelineData === null) { // Pose.
+                this._result = 1.0;
             }
         }
 
         public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
             super.init(armature, animationState, timelineData);
 
-            if (this._timelineData !== null) {
-                const frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + BinaryOffset.TimelineFrameValueCount];
-                this._deformCount = this._frameIntArray[frameIntOffset + BinaryOffset.DeformCount];
-                this._valueCount = this._frameIntArray[frameIntOffset + BinaryOffset.DeformValueCount];
-                this._valueOffset = this._frameIntArray[frameIntOffset + BinaryOffset.DeformValueOffset];
-                this._frameFloatOffset = this._frameIntArray[frameIntOffset + BinaryOffset.DeformFloatOffset] + this._animationData.frameFloatOffset;
-            }
-            else {
-                this._deformCount = this.surface._deformVertices.length;
-                this._valueCount = this._deformCount;
-                this._valueOffset = 0;
-                this._frameFloatOffset = 0;
-            }
-
-            this._current.length = this._valueCount;
-            this._delta.length = this._valueCount;
-            this._result.length = this._valueCount;
-
-            for (let i = 0; i < this._valueCount; ++i) {
-                this._delta[i] = 0.0;
-            }
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.01;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         }
 
-        public blend(state: number): void {
-            const blendWeight = this.surface._blendState.blendWeight;
-            const result = this.surface._deformVertices;
-
-            for (let i = 0; i < this._deformCount; ++i) {
-                let value = 0.0;
-
-                if (i < this._valueOffset) {
-                    value = this._frameFloatArray[this._frameFloatOffset + i];
-                }
-                else if (i < this._valueOffset + this._valueCount) {
-                    value = this._result[i - this._valueOffset];
-                }
-                else {
-                    value = this._frameFloatArray[this._frameFloatOffset + i - this._valueCount];
-                }
+        public blend(isDirty: boolean): void {
+            const blendState = this.target as BlendState;
+            const alphaTarget = blendState.target as TransformObject;
+            const blendWeight = blendState.blendWeight;
 
-                if (state === 2) {
-                    result[i] += value * blendWeight;
-                }
-                else if (blendWeight !== 1.0) {
-                    result[i] = value * blendWeight;
-                }
-                else {
-                    result[i] = value;
+            if (blendState.dirty > 1) {
+                alphaTarget._alpha += this._result * blendWeight;
+                if (alphaTarget._alpha > 1.0) {
+                    alphaTarget._alpha = 1.0;
                 }
             }
+            else {
+                alphaTarget._alpha = this._result * blendWeight;
+            }
 
-            if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                this.surface._transformDirty = true;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                this._armature._alphaDirty = true;
             }
         }
     }
     /**
      * @internal
      */
-    export class SlotDislayTimelineState extends SlotTimelineState {
+    export class SlotDisplayTimelineState extends TimelineState {
         public static toString(): string {
-            return "[class dragonBones.SlotDislayTimelineState]";
+            return "[class dragonBones.SlotDisplayTimelineState]";
         }
 
         protected _onArriveAtFrame(): void {
             if (this.playState >= 0) {
-                const displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : this.slot._slotData.displayIndex;
-                if (this.slot.displayIndex !== displayIndex) {
-                    this.slot._setDisplayIndex(displayIndex, true);
+                const slot = this.target as Slot;
+                const displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : slot._slotData.displayIndex;
+
+                if (slot.displayIndex !== displayIndex) {
+                    slot._setDisplayIndex(displayIndex, true);
                 }
             }
         }
+
+        protected _onUpdateFrame(): void {
+        }
     }
     /**
      * @internal
      */
-    export class SlotColorTimelineState extends SlotTimelineState {
+    export class SlotColorTimelineState extends TweenTimelineState {
         public static toString(): string {
             return "[class dragonBones.SlotColorTimelineState]";
         }
 
-        private _dirty: boolean;
         private readonly _current: Array = [0, 0, 0, 0, 0, 0, 0, 0];
-        private readonly _delta: Array = [0, 0, 0, 0, 0, 0, 0, 0];
+        private readonly _difference: Array = [0, 0, 0, 0, 0, 0, 0, 0];
         private readonly _result: Array = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
 
-        protected _onClear(): void {
-            super._onClear();
-
-            this._dirty = false;
-        }
-
         protected _onArriveAtFrame(): void {
             super._onArriveAtFrame();
 
             if (this._timelineData !== null) {
-                const intArray = this._dragonBonesData.intArray;
-                const frameIntArray = this._frameIntArray;
-                const valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 1; // ...(timeline value offset)|x|x|(Value offset)|(Next offset)|x|x|...
+                const dragonBonesData = this._animationData.parent.parent;
+                const colorArray = dragonBonesData.colorArray;
+                const frameIntArray = dragonBonesData.frameIntArray;
+                const valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex;
                 let colorOffset = frameIntArray[valueOffset];
 
                 if (colorOffset < 0) {
-                    colorOffset += 65536; // Fixed out of bouds bug. 
+                    colorOffset += 65536; // Fixed out of bounds bug. 
                 }
 
-                this._current[0] = intArray[colorOffset++];
-                this._current[1] = intArray[colorOffset++];
-                this._current[2] = intArray[colorOffset++];
-                this._current[3] = intArray[colorOffset++];
-                this._current[4] = intArray[colorOffset++];
-                this._current[5] = intArray[colorOffset++];
-                this._current[6] = intArray[colorOffset++];
-                this._current[7] = intArray[colorOffset++];
+                if (this._isTween) {
+                    this._current[0] = colorArray[colorOffset++];
+                    this._current[1] = colorArray[colorOffset++];
+                    this._current[2] = colorArray[colorOffset++];
+                    this._current[3] = colorArray[colorOffset++];
+                    this._current[4] = colorArray[colorOffset++];
+                    this._current[5] = colorArray[colorOffset++];
+                    this._current[6] = colorArray[colorOffset++];
+                    this._current[7] = colorArray[colorOffset++];
 
-                if (this._tweenState === TweenState.Always) {
                     if (this._frameIndex === this._frameCount - 1) {
                         colorOffset = frameIntArray[this._animationData.frameIntOffset + this._frameValueOffset];
                     }
                     else {
-                        colorOffset = frameIntArray[valueOffset + 1 * 1];
+                        colorOffset = frameIntArray[valueOffset + 1];
                     }
 
                     if (colorOffset < 0) {
-                        colorOffset += 65536; // Fixed out of bouds bug. 
+                        colorOffset += 65536; // Fixed out of bounds bug. 
                     }
 
-                    this._delta[0] = intArray[colorOffset++] - this._current[0];
-                    this._delta[1] = intArray[colorOffset++] - this._current[1];
-                    this._delta[2] = intArray[colorOffset++] - this._current[2];
-                    this._delta[3] = intArray[colorOffset++] - this._current[3];
-                    this._delta[4] = intArray[colorOffset++] - this._current[4];
-                    this._delta[5] = intArray[colorOffset++] - this._current[5];
-                    this._delta[6] = intArray[colorOffset++] - this._current[6];
-                    this._delta[7] = intArray[colorOffset++] - this._current[7];
+                    this._difference[0] = colorArray[colorOffset++] - this._current[0];
+                    this._difference[1] = colorArray[colorOffset++] - this._current[1];
+                    this._difference[2] = colorArray[colorOffset++] - this._current[2];
+                    this._difference[3] = colorArray[colorOffset++] - this._current[3];
+                    this._difference[4] = colorArray[colorOffset++] - this._current[4];
+                    this._difference[5] = colorArray[colorOffset++] - this._current[5];
+                    this._difference[6] = colorArray[colorOffset++] - this._current[6];
+                    this._difference[7] = colorArray[colorOffset++] - this._current[7];
+                }
+                else {
+                    this._result[0] = colorArray[colorOffset++] * 0.01;
+                    this._result[1] = colorArray[colorOffset++] * 0.01;
+                    this._result[2] = colorArray[colorOffset++] * 0.01;
+                    this._result[3] = colorArray[colorOffset++] * 0.01;
+                    this._result[4] = colorArray[colorOffset++];
+                    this._result[5] = colorArray[colorOffset++];
+                    this._result[6] = colorArray[colorOffset++];
+                    this._result[7] = colorArray[colorOffset++];
                 }
             }
             else { // Pose.
-                const color = this.slot._slotData.color;
-                this._current[0] = color.alphaMultiplier * 100.0;
-                this._current[1] = color.redMultiplier * 100.0;
-                this._current[2] = color.greenMultiplier * 100.0;
-                this._current[3] = color.blueMultiplier * 100.0;
-                this._current[4] = color.alphaOffset;
-                this._current[5] = color.redOffset;
-                this._current[6] = color.greenOffset;
-                this._current[7] = color.blueOffset;
+                const slot = this.target as Slot;
+                const color = slot.slotData.color;
+                this._result[0] = color.alphaMultiplier;
+                this._result[1] = color.redMultiplier;
+                this._result[2] = color.greenMultiplier;
+                this._result[3] = color.blueMultiplier;
+                this._result[4] = color.alphaOffset;
+                this._result[5] = color.redOffset;
+                this._result[6] = color.greenOffset;
+                this._result[7] = color.blueOffset;
             }
         }
 
         protected _onUpdateFrame(): void {
             super._onUpdateFrame();
 
-            this._dirty = true;
-            if (this._tweenState !== TweenState.Always) {
-                this._tweenState = TweenState.None;
+            if (this._isTween) {
+                this._result[0] = (this._current[0] + this._difference[0] * this._tweenProgress) * 0.01;
+                this._result[1] = (this._current[1] + this._difference[1] * this._tweenProgress) * 0.01;
+                this._result[2] = (this._current[2] + this._difference[2] * this._tweenProgress) * 0.01;
+                this._result[3] = (this._current[3] + this._difference[3] * this._tweenProgress) * 0.01;
+                this._result[4] = this._current[4] + this._difference[4] * this._tweenProgress;
+                this._result[5] = this._current[5] + this._difference[5] * this._tweenProgress;
+                this._result[6] = this._current[6] + this._difference[6] * this._tweenProgress;
+                this._result[7] = this._current[7] + this._difference[7] * this._tweenProgress;
             }
-
-            this._result[0] = (this._current[0] + this._delta[0] * this._tweenProgress) * 0.01;
-            this._result[1] = (this._current[1] + this._delta[1] * this._tweenProgress) * 0.01;
-            this._result[2] = (this._current[2] + this._delta[2] * this._tweenProgress) * 0.01;
-            this._result[3] = (this._current[3] + this._delta[3] * this._tweenProgress) * 0.01;
-            this._result[4] = this._current[4] + this._delta[4] * this._tweenProgress;
-            this._result[5] = this._current[5] + this._delta[5] * this._tweenProgress;
-            this._result[6] = this._current[6] + this._delta[6] * this._tweenProgress;
-            this._result[7] = this._current[7] + this._delta[7] * this._tweenProgress;
         }
 
         public fadeOut(): void {
-            this._tweenState = TweenState.None;
-            this._dirty = false;
+            this._isTween = false;
         }
 
         public update(passedTime: number): void {
             super.update(passedTime);
-
             // Fade animation.
-            if (this._tweenState !== TweenState.None || this._dirty) {
-                const result = this.slot._colorTransform;
+            if (this._isTween || this.dirty) {
+                const slot = this.target as Slot;
+                const result = slot._colorTransform;
 
                 if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
                     if (
@@ -831,7 +771,6 @@ namespace dragonBones {
                         result.blueOffset !== this._result[7]
                     ) {
                         const fadeProgress = Math.pow(this._animationState._fadeProgress, 4);
-
                         result.alphaMultiplier += (this._result[0] - result.alphaMultiplier) * fadeProgress;
                         result.redMultiplier += (this._result[1] - result.redMultiplier) * fadeProgress;
                         result.greenMultiplier += (this._result[2] - result.greenMultiplier) * fadeProgress;
@@ -840,12 +779,12 @@ namespace dragonBones {
                         result.redOffset += (this._result[5] - result.redOffset) * fadeProgress;
                         result.greenOffset += (this._result[6] - result.greenOffset) * fadeProgress;
                         result.blueOffset += (this._result[7] - result.blueOffset) * fadeProgress;
-
-                        this.slot._colorDirty = true;
+                        slot._colorDirty = true;
                     }
                 }
-                else if (this._dirty) {
-                    this._dirty = false;
+                else if (this.dirty) {
+                    this.dirty = false;
+
                     if (
                         result.alphaMultiplier !== this._result[0] ||
                         result.redMultiplier !== this._result[1] ||
@@ -864,8 +803,7 @@ namespace dragonBones {
                         result.redOffset = this._result[5];
                         result.greenOffset = this._result[6];
                         result.blueOffset = this._result[7];
-
-                        this.slot._colorDirty = true;
+                        slot._colorDirty = true;
                     }
                 }
             }
@@ -874,79 +812,68 @@ namespace dragonBones {
     /**
      * @internal
      */
-    export class DeformTimelineState extends SlotTimelineState {
+    export class SlotZIndexTimelineState extends SingleValueTimelineState {
         public static toString(): string {
-            return "[class dragonBones.DeformTimelineState]";
+            return "[class dragonBones.SlotZIndexTimelineState]";
         }
 
-        public vertexOffset: number;
-
-        private _dirty: boolean;
-        private _frameFloatOffset: number;
-        private _valueCount: number;
-        private _deformCount: number;
-        private _valueOffset: number;
-        private readonly _current: Array = [];
-        private readonly _delta: Array = [];
-        private readonly _result: Array = [];
-
-        protected _onClear(): void {
-            super._onClear();
-
-            this.vertexOffset = 0;
+        protected _onArriveAtFrame(): void {
+            super._onArriveAtFrame();
 
-            this._dirty = false;
-            this._frameFloatOffset = 0;
-            this._valueCount = 0;
-            this._deformCount = 0;
-            this._valueOffset = 0;
-            this._current.length = 0;
-            this._delta.length = 0;
-            this._result.length = 0;
+            if (this._timelineData === null) { // Pose.
+                const blendState = this.target as BlendState;
+                const slot = blendState.target as Slot;
+                this._result = slot.slotData.zIndex;
+            }
         }
 
-        protected _onArriveAtFrame(): void {
-            super._onArriveAtFrame();
+        public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
+            super.init(armature, animationState, timelineData);
 
-            if (this._timelineData !== null) {
-                const valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * this._valueCount;
-                const scale = this._armature._armatureData.scale;
-                const frameFloatArray = this._frameFloatArray;
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        }
 
-                if (this._tweenState === TweenState.Always) {
-                    let nextValueOffset = valueOffset + this._valueCount;
-                    if (this._frameIndex === this._frameCount - 1) {
-                        nextValueOffset = this._animationData.frameFloatOffset + this._frameValueOffset;
-                    }
+        public blend(isDirty: boolean): void {
+            const blendState = this.target as BlendState;
+            const slot = blendState.target as Slot;
+            const blendWeight = blendState.blendWeight;
 
-                    for (let i = 0; i < this._valueCount; ++i) {
-                        this._delta[i] = frameFloatArray[nextValueOffset + i] * scale - (this._current[i] = frameFloatArray[valueOffset + i] * scale);
-                    }
-                }
-                else {
-                    for (let i = 0; i < this._valueCount; ++i) {
-                        this._current[i] = frameFloatArray[valueOffset + i] * scale;
-                    }
-                }
+            if (blendState.dirty > 1) {
+                slot._zIndex += this._result * blendWeight;
             }
             else {
-                for (let i = 0; i < this._valueCount; ++i) {
-                    this._current[i] = 0.0;
-                }
+                slot._zIndex = this._result * blendWeight;
             }
+
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                this._armature._zIndexDirty = true;
+            }
+        }
+    }
+    /**
+     * @internal
+     */
+    export class DeformTimelineState extends MutilpleValueTimelineState {
+        public static toString(): string {
+            return "[class dragonBones.DeformTimelineState]";
         }
 
-        protected _onUpdateFrame(): void {
-            super._onUpdateFrame();
+        public displayFrame: DisplayFrame;
 
-            this._dirty = true;
-            if (this._tweenState !== TweenState.Always) {
-                this._tweenState = TweenState.None;
-            }
+        private _deformCount: number;
+        private _deformOffset: number;
+        private _sameValueOffset: number;
 
-            for (let i = 0; i < this._valueCount; ++i) {
-                this._result[i] = this._current[i] + this._delta[i] * this._tweenProgress;
-            }
+        protected _onClear(): void {
+            super._onClear();
+
+            this.displayFrame = null as any;
+
+            this._deformCount = 0;
+            this._deformOffset = 0;
+            this._sameValueOffset = 0;
         }
 
         public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
@@ -954,84 +881,75 @@ namespace dragonBones {
 
             if (this._timelineData !== null) {
                 const frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + BinaryOffset.TimelineFrameValueCount];
-                this.vertexOffset = this._frameIntArray[frameIntOffset + BinaryOffset.DeformVertexOffset];
-
-                if (this.vertexOffset < 0) {
-                    this.vertexOffset += 65536; // Fixed out of bouds bug. 
+                const dragonBonesData = this._animationData.parent.parent;
+                const frameIntArray = dragonBonesData.frameIntArray;
+
+                this._valueOffset = this._animationData.frameFloatOffset;
+                this._valueCount = frameIntArray[frameIntOffset + BinaryOffset.DeformValueCount];
+                this._deformCount = frameIntArray[frameIntOffset + BinaryOffset.DeformCount];
+                this._deformOffset = frameIntArray[frameIntOffset + BinaryOffset.DeformValueOffset];
+                this._sameValueOffset = frameIntArray[frameIntOffset + BinaryOffset.DeformFloatOffset];
+                
+                if (this._sameValueOffset < 0) {
+                    this._sameValueOffset += 65536; // Fixed out of bounds bug. 
                 }
 
-                this._deformCount = this._frameIntArray[frameIntOffset + BinaryOffset.DeformCount];
-                this._valueCount = this._frameIntArray[frameIntOffset + BinaryOffset.DeformValueCount];
-                this._valueOffset = this._frameIntArray[frameIntOffset + BinaryOffset.DeformValueOffset];
-                this._frameFloatOffset = this._frameIntArray[frameIntOffset + BinaryOffset.DeformFloatOffset] + this._animationData.frameFloatOffset;
+                this._sameValueOffset += this._animationData.frameFloatOffset
+
+                this._valueScale = this._armature.armatureData.scale;
+                this._valueArray = dragonBonesData.frameFloatArray;
+                this._rd.length = this._valueCount * 2;
             }
             else {
-                const deformVertices = this.slot._deformVertices;
-                this._deformCount = deformVertices !== null ? deformVertices.vertices.length : 0;
-                this._valueCount = this._deformCount;
-                this._valueOffset = 0;
-                this._frameFloatOffset = 0;
-            }
-
-            this._current.length = this._valueCount;
-            this._delta.length = this._valueCount;
-            this._result.length = this._valueCount;
-
-            for (let i = 0; i < this._valueCount; ++i) {
-                this._delta[i] = 0.0;
+                this._deformCount = this.displayFrame.deformVertices.length;
             }
         }
 
-        public fadeOut(): void {
-            this._tweenState = TweenState.None;
-            this._dirty = false;
-        }
+        public blend(isDirty: boolean): void {
+            const blendState = this.target as BlendState;
+            const slot = blendState.target as Slot;
+            const blendWeight = blendState.blendWeight;
+            const result = this.displayFrame.deformVertices;
+            const valueArray = this._valueArray;
 
-        public update(passedTime: number): void {
-            const deformVertices = this.slot._deformVertices;
-            if (deformVertices === null || deformVertices.verticesData === null || deformVertices.verticesData.offset !== this.vertexOffset) {
-                return;
-            }
+            if (valueArray !== null) {
+                const valueCount = this._valueCount;
+                const deformOffset = this._deformOffset;
+                const sameValueOffset = this._sameValueOffset;
+                const rd = this._rd;
 
-            super.update(passedTime);
+                for (let i = 0; i < this._deformCount; ++i) {
+                    let value = 0.0;
 
-            // Fade animation.
-            if (this._tweenState !== TweenState.None || this._dirty) {
-                const result = deformVertices.vertices;
-
-                if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                    const fadeProgress = Math.pow(this._animationState._fadeProgress, 2);
-
-                    for (let i = 0; i < this._deformCount; ++i) {
-                        if (i < this._valueOffset) {
-                            result[i] += (this._frameFloatArray[this._frameFloatOffset + i] - result[i]) * fadeProgress;
-                        }
-                        else if (i < this._valueOffset + this._valueCount) {
-                            result[i] += (this._result[i - this._valueOffset] - result[i]) * fadeProgress;
-                        }
-                        else {
-                            result[i] += (this._frameFloatArray[this._frameFloatOffset + i - this._valueCount] - result[i]) * fadeProgress;
-                        }
+                    if (i < deformOffset) {
+                        value = valueArray[sameValueOffset + i];
+                    }
+                    else if (i < deformOffset + valueCount) {
+                        value = rd[i - deformOffset];
+                    }
+                    else {
+                        value = valueArray[sameValueOffset + i - valueCount];
                     }
 
-                    deformVertices.verticesDirty = true;
+                    if (blendState.dirty > 1) {
+                        result[i] += value * blendWeight;
+                    }
+                    else {
+                        result[i] = value * blendWeight;
+                    }
+                }
+            }
+            else if (blendState.dirty === 1) {
+                for (let i = 0; i < this._deformCount; ++i) {
+                    result[i] = 0.0;
                 }
-                else if (this._dirty) {
-                    this._dirty = false;
+            }
 
-                    for (let i = 0; i < this._deformCount; ++i) {
-                        if (i < this._valueOffset) {
-                            result[i] = this._frameFloatArray[this._frameFloatOffset + i];
-                        }
-                        else if (i < this._valueOffset + this._valueCount) {
-                            result[i] = this._result[i - this._valueOffset];
-                        }
-                        else {
-                            result[i] = this._frameFloatArray[this._frameFloatOffset + i - this._valueCount];
-                        }
-                    }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
 
-                    deformVertices.verticesDirty = true;
+                if (slot._geometryData === this.displayFrame.getGeometryData()) {
+                    slot._verticesDirty = true;
                 }
             }
         }
@@ -1039,141 +957,118 @@ namespace dragonBones {
     /**
      * @internal
      */
-    export class IKConstraintTimelineState extends ConstraintTimelineState {
+    export class IKConstraintTimelineState extends DoubleValueTimelineState {
         public static toString(): string {
             return "[class dragonBones.IKConstraintTimelineState]";
         }
 
-        private _current: number;
-        private _delta: number;
-
-        protected _onClear(): void {
-            super._onClear();
-
-            this._current = 0.0;
-            this._delta = 0.0;
-        }
-
-        protected _onArriveAtFrame(): void {
-            super._onArriveAtFrame();
+        protected _onUpdateFrame(): void {
+            super._onUpdateFrame();
 
-            const ikConstraint = this.constraint as IKConstraint;
+            const ikConstraint = this.target as IKConstraint;
 
             if (this._timelineData !== null) {
-                let valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 2;
-                const frameIntArray = this._frameIntArray;
-                const bendPositive = frameIntArray[valueOffset++] !== 0;
-                this._current = frameIntArray[valueOffset++] * 0.01;
-
-                if (this._tweenState === TweenState.Always) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameIntOffset + this._frameValueOffset; // + 0 * 2
-                    }
-
-                    this._delta = frameIntArray[valueOffset + 1] * 0.01 - this._current;
-                }
-                else {
-                    this._delta = 0.0;
-                }
-
-                ikConstraint._bendPositive = bendPositive;
+                ikConstraint._bendPositive = this._currentA > 0.0;
+                ikConstraint._weight = this._currentB;
             }
             else {
                 const ikConstraintData = ikConstraint._constraintData as IKConstraintData;
-                this._current = ikConstraintData.weight;
-                this._delta = 0.0;
                 ikConstraint._bendPositive = ikConstraintData.bendPositive;
+                ikConstraint._weight = ikConstraintData.weight;
             }
 
             ikConstraint.invalidUpdate();
+            this.dirty = false;
         }
 
-        protected _onUpdateFrame(): void {
-            super._onUpdateFrame();
-
-            if (this._tweenState !== TweenState.Always) {
-                this._tweenState = TweenState.None;
-            }
-
-            const ikConstraint = this.constraint as IKConstraint;
-            ikConstraint._weight = this._current + this._delta * this._tweenProgress;
-            ikConstraint.invalidUpdate();
+        public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
+            super.init(armature, animationState, timelineData);
 
-            // TODO fade update.
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.01;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         }
     }
     /**
      * @internal
      */
-    export class AnimationTimelineState extends TweenTimelineState {
+    export class AnimationProgressTimelineState extends SingleValueTimelineState {
         public static toString(): string {
-            return "[class dragonBones.AnimationTimelineState]";
+            return "[class dragonBones.AnimationProgressTimelineState]";
         }
 
-        public animationState: AnimationState;
+        protected _onUpdateFrame(): void {
+            super._onUpdateFrame();
+
+            const animationState = this.target as AnimationState;
+            if (animationState._parent !== null) {
+                animationState.currentTime = this._result * animationState.totalTime;
+            }
 
-        private readonly _floats: Array = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
+            this.dirty = false;
+        }
 
-        protected _onClear(): void {
-            super._onClear();
+        public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
+            super.init(armature, animationState, timelineData);
 
-            this.animationState = null as any;
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        }
+    }
+    /**
+     * @internal
+     */
+    export class AnimationWeightTimelineState extends SingleValueTimelineState {
+        public static toString(): string {
+            return "[class dragonBones.AnimationWeightTimelineState]";
         }
 
-        protected _onArriveAtFrame(): void {
-            super._onArriveAtFrame();
+        protected _onUpdateFrame(): void {
+            super._onUpdateFrame();
 
-            if (this._timelineData === null) {
-                return;
+            const animationState = this.target as AnimationState;
+            if (animationState._parent !== null) {
+                animationState.weight = this._result;
             }
 
-            let valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 2;
-            const frameRateR = 1.0 / this.animationState._animationData.parent.frameRate;
-            const frameIntArray = this._frameIntArray;
-
-            this._floats[0] = frameIntArray[valueOffset++] * frameRateR;
-            this._floats[3] = frameIntArray[valueOffset++] * 0.01;
+            this.dirty = false;
+        }
 
-            if (this._tweenState === TweenState.Always) {
-                if (this._frameIndex === this._frameCount - 1) {
-                    valueOffset = this._animationData.frameIntOffset + this._frameValueOffset; // + 0 * 2
-                }
+        public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
+            super.init(armature, animationState, timelineData);
 
-                this._floats[1] = frameIntArray[valueOffset++] * frameRateR - this._floats[0];
-                this._floats[4] = frameIntArray[valueOffset++] * 0.01 - this._floats[3];
-            }
-            else {
-                this._floats[1] = 0.0;
-                this._floats[4] = 0.0;
-            }
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        }
+    }
+    /**
+     * @internal
+     */
+    export class AnimationParametersTimelineState extends DoubleValueTimelineState {
+        public static toString(): string {
+            return "[class dragonBones.AnimationParametersTimelineState]";
         }
 
         protected _onUpdateFrame(): void {
             super._onUpdateFrame();
 
-            if (this._tweenState !== TweenState.Always) {
-                this._tweenState = TweenState.None;
+            const animationState = this.target as AnimationState;
+            if (animationState._parent !== null) {
+                animationState.parameterX = this._resultA;
+                animationState.parameterY = this._resultB;
             }
 
-            if (this._floats[0] >= 0.0) {
-                this._floats[2] = this._floats[0] + this._floats[1] * this._tweenProgress;
-            }
-
-            this._floats[5] = this._floats[3] + this._floats[4] * this._tweenProgress;
+            this.dirty = false;
         }
 
-        public blend(state: number): void {
-            const animationState = this.animationState;
-            const blendWeight = animationState._blendState.blendWeight;
+        public init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void {
+            super.init(armature, animationState, timelineData);
 
-            if (state === 2) {
-                animationState.weight += this._floats[5] * blendWeight;
-                animationState.currentTime += this._floats[2] * blendWeight;
-            }
-            else {
-                animationState.weight = this._floats[5] * blendWeight;
-                animationState.currentTime = this._floats[2] * blendWeight;
-            }
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         }
     }
-}
\ No newline at end of file
+}
diff --git a/DragonBones/src/dragonBones/animation/WorldClock.ts b/DragonBones/src/dragonBones/animation/WorldClock.ts
index d4c42244..6a8990c5 100644
--- a/DragonBones/src/dragonBones/animation/WorldClock.ts
+++ b/DragonBones/src/dragonBones/animation/WorldClock.ts
@@ -252,17 +252,5 @@ namespace dragonBones {
                 this._clock.add(this);
             }
         }
-
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static readonly clock: WorldClock = new WorldClock();
     }
 }
diff --git a/DragonBones/src/dragonBones/armature/Armature.ts b/DragonBones/src/dragonBones/armature/Armature.ts
index 464d4541..803f53a3 100644
--- a/DragonBones/src/dragonBones/armature/Armature.ts
+++ b/DragonBones/src/dragonBones/armature/Armature.ts
@@ -44,7 +44,7 @@ namespace dragonBones {
             return "[class dragonBones.Armature]";
         }
         private static _onSortSlots(a: Slot, b: Slot): number {
-            return a._zOrder > b._zOrder ? 1 : -1;
+            return a._zIndex * 1000 + a._zOrder > b._zIndex * 1000 + b._zOrder ? 1 : -1;
         }
         /**
          * - Whether to inherit the animation control of the parent armature.
@@ -65,16 +65,31 @@ namespace dragonBones {
          * @private
          */
         public userData: any;
-
-        private _lockUpdate: boolean;
+        /**
+         * @internal
+         */
+        public _lockUpdate: boolean;
         private _slotsDirty: boolean;
         private _zOrderDirty: boolean;
+        /**
+         * @internal
+         */
+        public _zIndexDirty: boolean;
+        /**
+         * @internal
+         */
+        public _alphaDirty: boolean;
         private _flipX: boolean;
         private _flipY: boolean;
         /**
          * @internal
          */
         public _cacheFrameIndex: number;
+        private _alpha: number;
+        /**
+         * @internal
+         */
+        public _globalAlpha: number;
         private readonly _bones: Array = [];
         private readonly _slots: Array = [];
         /**
@@ -103,7 +118,7 @@ namespace dragonBones {
          * @internal
          */
         public _parent: Slot | null;
-        
+
         protected _onClear(): void {
             if (this._clock !== null) { // Remove clock first.
                 this._clock.remove(this);
@@ -143,9 +158,13 @@ namespace dragonBones {
             this._lockUpdate = false;
             this._slotsDirty = true;
             this._zOrderDirty = false;
+            this._zIndexDirty = false;
+            this._alphaDirty = true;
             this._flipX = false;
             this._flipY = false;
             this._cacheFrameIndex = -1;
+            this._alpha = 1.0;
+            this._globalAlpha = 1.0;
             this._bones.length = 0;
             this._slots.length = 0;
             this._constraints.length = 0;
@@ -176,8 +195,9 @@ namespace dragonBones {
 
                     const slotData = slotDatas[slotIndex];
                     const slot = this.getSlot(slotData.name);
+
                     if (slot !== null) {
-                        slot._setZorder(i);
+                        slot._setZOrder(i);
                     }
                 }
 
@@ -277,6 +297,8 @@ namespace dragonBones {
                 return;
             }
 
+            this._lockUpdate = true;
+
             if (this._armatureData === null) {
                 console.warn("The armature has been disposed.");
                 return;
@@ -287,16 +309,34 @@ namespace dragonBones {
             }
 
             const prevCacheFrameIndex = this._cacheFrameIndex;
-
             // Update animation.
             this._animation.advanceTime(passedTime);
-
             // Sort slots.
-            if (this._slotsDirty) {
-                this._slotsDirty = false;
+            if (this._slotsDirty || this._zIndexDirty) {
                 this._slots.sort(Armature._onSortSlots);
+
+                if (this._zIndexDirty) {
+                    for (let i = 0, l = this._slots.length; i < l; ++i) {
+                        this._slots[i]._setZOrder(i); // 
+                    }
+                }
+
+                this._slotsDirty = false;
+                this._zIndexDirty = false;
             }
+            // Update alpha.
+            if (this._alphaDirty) {
+                this._alphaDirty = false;
+                this._globalAlpha = this._alpha * (this._parent !== null ? this._parent._globalAlpha : 1.0);
+
+                for (const bone of this._bones) {
+                    bone._updateAlpha();
+                }
 
+                for (const slot of this._slots) {
+                    slot._updateAlpha();
+                }
+            }
             // Update bones and slots.
             if (this._cacheFrameIndex < 0 || this._cacheFrameIndex !== prevCacheFrameIndex) {
                 let i = 0, l = 0;
@@ -308,11 +348,8 @@ namespace dragonBones {
                     this._slots[i].update(this._cacheFrameIndex);
                 }
             }
-
             // Do actions.
             if (this._actions.length > 0) {
-                this._lockUpdate = true;
-
                 for (const action of this._actions) {
                     const actionData = action.actionData;
                     if (actionData !== null) {
@@ -321,8 +358,8 @@ namespace dragonBones {
                                 const childArmature = action.slot.childArmature;
                                 if (childArmature !== null) {
                                     childArmature.animation.fadeIn(actionData.name);
-                    }
-                }
+                                }
+                            }
                             else if (action.bone !== null) {
                                 for (const slot of this.getSlots()) {
                                     if (slot.parent === action.bone) {
@@ -343,9 +380,9 @@ namespace dragonBones {
                 }
 
                 this._actions.length = 0;
-                this._lockUpdate = false;
             }
 
+            this._lockUpdate = false;
             this._proxy.dbUpdate();
         }
         /**
@@ -887,70 +924,6 @@ namespace dragonBones {
         public get parent(): Slot | null {
             return this._parent;
         }
-
-        /**
-         * @deprecated
-         * @private
-         */
-        public replaceTexture(texture: any): void {
-            this.replacedTexture = texture;
-        }
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public hasEventListener(type: EventStringType): boolean {
-            console.warn("Deprecated.");
-            return this._proxy.hasDBEventListener(type);
-        }
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public addEventListener(type: EventStringType, listener: Function, target: any): void {
-            console.warn("Deprecated.");
-            this._proxy.addDBEventListener(type, listener, target);
-        }
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public removeEventListener(type: EventStringType, listener: Function, target: any): void {
-            console.warn("Deprecated.");
-            this._proxy.removeDBEventListener(type, listener, target);
-        }
-        /**
-         * - Deprecated, please refer to {@link #cacheFrameRate}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #cacheFrameRate}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public enableAnimationCache(frameRate: number): void {
-            console.warn("Deprecated.");
-            this.cacheFrameRate = frameRate;
-        }
         /**
          * - Deprecated, please refer to {@link #display}.
          * @deprecated
diff --git a/DragonBones/src/dragonBones/armature/Bone.ts b/DragonBones/src/dragonBones/armature/Bone.ts
index 47050342..d6980122 100644
--- a/DragonBones/src/dragonBones/armature/Bone.ts
+++ b/DragonBones/src/dragonBones/armature/Bone.ts
@@ -76,10 +76,6 @@ namespace dragonBones {
         public _hasConstraint: boolean;
         protected _visible: boolean;
         protected _cachedFrameIndex: number;
-        /**
-         * @internal
-         */
-        public readonly _blendState: BlendState = new BlendState();
         /**
          * @internal
          */
@@ -105,12 +101,11 @@ namespace dragonBones {
             this._hasConstraint = false;
             this._visible = true;
             this._cachedFrameIndex = -1;
-            this._blendState.clear();
             this._boneData = null as any; //
             this._parent = null as any; //
             this._cachedFrameIndices = null;
         }
-        
+
         protected _updateGlobalTransformMatrix(isCache: boolean): void {
             // For typescript.
             const boneData = this._boneData;
@@ -130,14 +125,30 @@ namespace dragonBones {
                 if (origin !== null) {
                     // global.copyFrom(this.origin).add(this.offset).add(this.animationPose);
                     global.x = origin.x + offset.x + animationPose.x;
-                    global.y = origin.y + offset.y + animationPose.y;
-                    global.skew = origin.skew + offset.skew + animationPose.skew;
-                    global.rotation = origin.rotation + offset.rotation + animationPose.rotation;
                     global.scaleX = origin.scaleX * offset.scaleX * animationPose.scaleX;
                     global.scaleY = origin.scaleY * offset.scaleY * animationPose.scaleY;
+
+                    if (DragonBones.yDown) {
+                        global.y = origin.y + offset.y + animationPose.y;
+                        global.skew = origin.skew + offset.skew + animationPose.skew;
+                        global.rotation = origin.rotation + offset.rotation + animationPose.rotation;
+                    }
+                    else {
+                        global.y = origin.y - offset.y + animationPose.y;
+                        global.skew = origin.skew - offset.skew + animationPose.skew;
+                        global.rotation = origin.rotation - offset.rotation + animationPose.rotation;
+                    }
                 }
                 else {
-                    global.copyFrom(offset).add(animationPose);
+                    global.copyFrom(offset);
+
+                    if (!DragonBones.yDown) {
+                        global.y = -global.y;
+                        global.skew = -global.skew;
+                        global.rotation = -global.rotation;
+                    }
+
+                    global.add(animationPose);
                 }
             }
             else if (this.offsetMode === OffsetMode.None) {
@@ -151,48 +162,78 @@ namespace dragonBones {
             else {
                 inherit = false;
                 global.copyFrom(offset);
+
+                if (!DragonBones.yDown) {
+                    global.y = -global.y;
+                    global.skew = -global.skew;
+                    global.rotation = -global.rotation;
+                }
             }
 
             if (inherit) {
-                const parentMatrix = parent._boneData.type === BoneType.Bone ? parent.globalTransformMatrix : (parent as Surface)._getGlobalTransformMatrix(global.x, global.y);
+                const isSurface = parent._boneData.type === BoneType.Surface;
+                const surfaceBone = isSurface ? (parent as Surface)._bone : null;
+                const parentMatrix = isSurface ? (parent as Surface)._getGlobalTransformMatrix(global.x, global.y) : parent.globalTransformMatrix;
+
+                if (boneData.inheritScale && (!isSurface || surfaceBone !== null)) {
+                    if (isSurface) {
+                        if (boneData.inheritRotation) {
+                            global.rotation += parent.global.rotation;
+                        }
 
-                if (boneData.inheritScale) {
-                    if (!boneData.inheritRotation) {
-                        parent.updateGlobalTransform();
+                        (surfaceBone as Bone).updateGlobalTransform();
+                        global.scaleX *= (surfaceBone as Bone).global.scaleX;
+                        global.scaleY *= (surfaceBone as Bone).global.scaleY;
+                        parentMatrix.transformPoint(global.x, global.y, global);
+                        global.toMatrix(globalTransformMatrix);
 
-                        if (flipX && flipY) {
-                            rotation = global.rotation - (parent.global.rotation + Math.PI);
-                        }
-                        else if (flipX) {
-                            rotation = global.rotation + parent.global.rotation + Math.PI;
-                        }
-                        else if (flipY) {
-                            rotation = global.rotation + parent.global.rotation;
+                        if (boneData.inheritTranslation) {
+                            global.x = globalTransformMatrix.tx;
+                            global.y = globalTransformMatrix.ty;
                         }
                         else {
-                            rotation = global.rotation - parent.global.rotation;
+                            globalTransformMatrix.tx = global.x;
+                            globalTransformMatrix.ty = global.y;
                         }
-
-                        global.rotation = rotation;
                     }
+                    else {
+                        if (!boneData.inheritRotation) {
+                            parent.updateGlobalTransform();
 
-                    global.toMatrix(globalTransformMatrix);
-                    globalTransformMatrix.concat(parentMatrix);
+                            if (flipX && flipY) {
+                                rotation = global.rotation - (parent.global.rotation + Math.PI);
+                            }
+                            else if (flipX) {
+                                rotation = global.rotation + parent.global.rotation + Math.PI;
+                            }
+                            else if (flipY) {
+                                rotation = global.rotation + parent.global.rotation;
+                            }
+                            else {
+                                rotation = global.rotation - parent.global.rotation;
+                            }
 
-                    if (boneData.inheritTranslation) {
-                        global.x = globalTransformMatrix.tx;
-                        global.y = globalTransformMatrix.ty;
-                    }
-                    else {
-                        globalTransformMatrix.tx = global.x;
-                        globalTransformMatrix.ty = global.y;
-                    }
+                            global.rotation = rotation;
+                        }
 
-                    if (isCache) {
-                        global.fromMatrix(globalTransformMatrix);
-                    }
-                    else {
-                        this._globalDirty = true;
+                        global.toMatrix(globalTransformMatrix);
+                        globalTransformMatrix.concat(parentMatrix);
+
+                        if (boneData.inheritTranslation) {
+                            global.x = globalTransformMatrix.tx;
+                            global.y = globalTransformMatrix.ty;
+                        }
+                        else {
+                            globalTransformMatrix.tx = global.x;
+                            globalTransformMatrix.ty = global.y;
+                        }
+
+                        if (isCache) {
+                            global.fromMatrix(globalTransformMatrix);
+                        }
+                        else {
+                            this._globalDirty = true;
+                        }
                     }
                 }
                 else {
@@ -228,6 +269,10 @@ namespace dragonBones {
                             if (flipX !== flipY || boneData.inheritReflection) {
                                 global.skew += Math.PI;
                             }
+
+                            if (!dragonBones.DragonBones.yDown) {
+                                global.skew = -global.skew;
+                            }
                         }
 
                         global.rotation = rotation;
@@ -283,6 +328,17 @@ namespace dragonBones {
                 global.toMatrix(globalTransformMatrix);
             }
         }
+        /**
+         * @internal
+         */
+        public _updateAlpha() {
+            if (this._parent !== null) {
+                this._globalAlpha = this._alpha * this._parent._globalAlpha;
+            }
+            else {
+                this._globalAlpha = this._alpha * this._armature._globalAlpha;
+            }
+        }
         /**
          * @internal
          */
@@ -293,6 +349,7 @@ namespace dragonBones {
 
             this._boneData = boneData;
             this._armature = armatureValue;
+            this._alpha = this._boneData.alpha;
 
             if (this._boneData.parent !== null) {
                 this._parent = this._armature.getBone(this._boneData.parent.name);
@@ -306,8 +363,6 @@ namespace dragonBones {
          * @internal
          */
         public update(cacheFrameIndex: number): void {
-            this._blendState.dirty = false;
-
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 const cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
                 if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache.
@@ -519,70 +574,5 @@ namespace dragonBones {
         public get parent(): Bone | null {
             return this._parent;
         }
-
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getBones()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getBones()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public getBones(): Array {
-            console.warn("Deprecated.");
-            const bones = new Array();
-
-            for (const bone of this._armature.getBones()) {
-                if (bone.parent === this) {
-                    bones.push(bone);
-                }
-            }
-
-            return bones;
-        }
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getSlots()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getSlots()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public getSlots(): Array {
-            console.warn("Deprecated.");
-            const slots = new Array();
-
-            for (const slot of this._armature.getSlots()) {
-                if (slot.parent === this) {
-                    slots.push(slot);
-                }
-            }
-
-            return slots;
-        }
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getSlot()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getSlot()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get slot(): Slot | null {
-            console.warn("Deprecated.");
-            for (const slot of this._armature.getSlots()) {
-                if (slot.parent === this) {
-                    return slot;
-                }
-            }
-
-            return null;
-        }
     }
 }
\ No newline at end of file
diff --git a/DragonBones/src/dragonBones/armature/Constraint.ts b/DragonBones/src/dragonBones/armature/Constraint.ts
index 4d24a495..10b4c79e 100644
--- a/DragonBones/src/dragonBones/armature/Constraint.ts
+++ b/DragonBones/src/dragonBones/armature/Constraint.ts
@@ -69,7 +69,7 @@ namespace dragonBones {
             return "[class dragonBones.IKConstraint]";
         }
 
-        private _scaleEnabled: boolean; // TODO
+        // private _scaleEnabled: boolean; // TODO
         /**
          * - For timeline state.
          * @internal
@@ -84,7 +84,7 @@ namespace dragonBones {
         protected _onClear(): void {
             super._onClear();
 
-            this._scaleEnabled = false;
+            // this._scaleEnabled = false;
             this._bendPositive = false;
             this._weight = 1.0;
             this._constraintData = null as any;
@@ -195,7 +195,7 @@ namespace dragonBones {
 
             {
                 const ikConstraintData = this._constraintData as IKConstraintData;
-                this._scaleEnabled = ikConstraintData.scaleEnabled;
+                // this._scaleEnabled = ikConstraintData.scaleEnabled;
                 this._bendPositive = ikConstraintData.bendPositive;
                 this._weight = ikConstraintData.weight;
             }
@@ -275,7 +275,7 @@ namespace dragonBones {
             this._pathGlobalVertices.length = 0;
         }
 
-        protected _updatePathVertices(verticesData: VerticesData): void {
+        protected _updatePathVertices(verticesData: GeometryData): void {
             //计算曲线的节点数据
             const armature = this._armature;
             const dragonBonesData = armature.armatureData.parent;
@@ -284,8 +284,8 @@ namespace dragonBones {
             const floatArray = dragonBonesData.floatArray;
 
             const pathOffset = verticesData.offset;
-            const pathVertexCount = intArray[pathOffset + BinaryOffset.PathVertexCount];
-            const pathVertexOffset = intArray[pathOffset + BinaryOffset.PathFloatOffset];
+            const pathVertexCount = intArray[pathOffset + BinaryOffset.GeometryVertexCount];
+            const pathVertexOffset = intArray[pathOffset + BinaryOffset.GeometryFloatOffset];
 
             this._pathGlobalVertices.length = pathVertexCount * 2;
 
@@ -312,7 +312,7 @@ namespace dragonBones {
             }
 
             //有骨骼约束我,那我的节点受骨骼权重控制
-            const bones = (this._pathSlot._deformVertices as DeformVertices).bones;
+            const bones = this._pathSlot._geometryBones;
             const weightBoneCount = weightData.bones.length;
 
             const weightOffset = weightData.offset;
@@ -358,7 +358,7 @@ namespace dragonBones {
             //计算当前的骨骼在曲线上的位置
             const armature = this._armature;
             const intArray = armature.armatureData.parent.intArray;
-            const vertexCount = intArray[pathDisplayDta.vertices.offset + BinaryOffset.PathVertexCount];
+            const vertexCount = intArray[pathDisplayDta.geometry.offset + BinaryOffset.GeometryVertexCount];
 
             const positions = this._positions;
             const spaces = this._spaces;
@@ -389,7 +389,7 @@ namespace dragonBones {
                 }
 
                 curveVertices.length = 8;
-                for (let i = 0, o = 0, curve = 0; i < spaceCount; i++ , o += 3) {
+                for (let i = 0, o = 0, curve = 0; i < spaceCount; i++, o += 3) {
                     const space = spaces[i];
                     position += space;
 
@@ -466,7 +466,7 @@ namespace dragonBones {
             let x1 = curveVertices[0], y1 = curveVertices[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;
             let tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy;
 
-            for (let i = 0, w = 2; i < curveCount; i++ , w += 6) {
+            for (let i = 0, w = 2; i < curveCount; i++, w += 6) {
                 cx1 = curveVertices[w];
                 cy1 = curveVertices[w + 1];
                 cx2 = curveVertices[w + 2];
@@ -509,7 +509,7 @@ namespace dragonBones {
 
             let segments = this._segments;
             let curveLength: number = 0;
-            for (let i = 0, o = 0, curve = 0, segment = 0; i < spaceCount; i++ , o += 3) {
+            for (let i = 0, o = 0, curve = 0, segment = 0; i < spaceCount; i++, o += 3) {
                 const space = spaces[i];
                 position += space;
                 let p = position;
@@ -639,7 +639,7 @@ namespace dragonBones {
 
             let data = constraintData as PathConstraintData;
 
-            this.pathOffset = data.pathDisplayData.vertices.offset;
+            this.pathOffset = data.pathDisplayData.geometry.offset;
 
             //
             this.position = data.position;
@@ -671,28 +671,25 @@ namespace dragonBones {
             const pathSlot = this._pathSlot;
 
             if (
-                pathSlot._deformVertices === null ||
-                pathSlot._deformVertices.verticesData === null ||
-                pathSlot._deformVertices.verticesData.offset !== this.pathOffset
+                pathSlot._geometryData === null ||
+                pathSlot._geometryData.offset !== this.pathOffset
             ) {
                 return;
             }
 
             const constraintData = this._constraintData as PathConstraintData;
-            const pathDisplayData = pathSlot._displayData as PathDisplayData; // TODO
 
             //
 
             //曲线节点数据改变:父亲bone改变,权重bones改变,变形顶点改变
             let isPathVerticeDirty = false;
-            let deformVertices = pathSlot._deformVertices;
             if (this._root._childrenTransformDirty) {
-                this._updatePathVertices(pathDisplayData.vertices);
+                this._updatePathVertices(pathSlot._geometryData);
                 isPathVerticeDirty = true;
             }
-            else if (deformVertices !== null && (deformVertices.verticesDirty || deformVertices.isBonesUpdate())) {
-                this._updatePathVertices(pathDisplayData.vertices);
-                deformVertices.verticesDirty = false;
+            else if (pathSlot._verticesDirty || pathSlot._isBonesUpdate()) {
+                this._updatePathVertices(pathSlot._geometryData);
+                pathSlot._verticesDirty = false;
                 isPathVerticeDirty = true;
             }
 
@@ -741,8 +738,9 @@ namespace dragonBones {
                     spaces[i] = spacing;
                 }
             }
+
             //
-            this._computeBezierCurve(pathDisplayData, spacesCount, isTangentMode, positionMode === PositionMode.Percent, spacingMode === SpacingMode.Percent);
+            this._computeBezierCurve(((pathSlot._displayFrame as DisplayFrame).rawDisplayData as PathDisplayData), spacesCount, isTangentMode, positionMode === PositionMode.Percent, spacingMode === SpacingMode.Percent);
 
             //根据新的节点数据重新采样
             const positions = this._positions;
@@ -764,7 +762,7 @@ namespace dragonBones {
             //
             const rotateMix = this.rotateMix;
             const translateMix = this.translateMix;
-            for (let i = 0, p = 3; i < boneCount; i++ , p += 3) {
+            for (let i = 0, p = 3; i < boneCount; i++, p += 3) {
                 let bone = bones[i];
                 bone.updateByConstraint();
                 let matrix = bone.globalTransformMatrix;
diff --git a/DragonBones/src/dragonBones/armature/DeformVertices.ts b/DragonBones/src/dragonBones/armature/DeformVertices.ts
deleted file mode 100644
index 97978d29..00000000
--- a/DragonBones/src/dragonBones/armature/DeformVertices.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2018 DragonBones team and other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-namespace dragonBones {
-    /**
-     * @internal
-     */
-    export class DeformVertices extends BaseObject {
-        public static toString(): string {
-            return "[class dragonBones.DeformVertices]";
-        }
-
-        public verticesDirty: boolean;
-        public readonly vertices: Array = [];
-        public readonly bones: Array = [];
-        public verticesData: VerticesData | null;
-
-        protected _onClear(): void {
-            this.verticesDirty = false;
-            this.vertices.length = 0;
-            this.bones.length = 0;
-            this.verticesData = null;
-        }
-
-        public init(verticesDataValue: VerticesData | null, armature: Armature): void {
-            this.verticesData = verticesDataValue;
-
-            if (this.verticesData !== null) {
-                let vertexCount = 0;
-                if (this.verticesData.weight !== null) {
-                    vertexCount = this.verticesData.weight.count * 2;
-                }
-                else {
-                    vertexCount = this.verticesData.data.intArray[this.verticesData.offset + BinaryOffset.MeshVertexCount] * 2;
-                }
-
-                this.verticesDirty = true;
-                this.vertices.length = vertexCount;
-                this.bones.length = 0;
-                //
-                for (let i = 0, l = this.vertices.length; i < l; ++i) {
-                    this.vertices[i] = 0.0;
-                }
-
-                if (this.verticesData.weight !== null) {
-                    for (let i = 0, l = this.verticesData.weight.bones.length; i < l; ++i) {
-                        const bone = armature.getBone(this.verticesData.weight.bones[i].name);
-                        this.bones.push(bone);
-                    }
-                }
-            }
-            else {
-                this.verticesDirty = false;
-                this.vertices.length = 0;
-                this.bones.length = 0;
-                this.verticesData = null;
-            }
-        }
-
-        public isBonesUpdate(): boolean {
-            for (const bone of this.bones) {
-                if (bone !== null && bone._childrenTransformDirty) {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-    }
-} 
diff --git a/DragonBones/src/dragonBones/armature/Slot.ts b/DragonBones/src/dragonBones/armature/Slot.ts
index dcc3d856..6abef743 100644
--- a/DragonBones/src/dragonBones/armature/Slot.ts
+++ b/DragonBones/src/dragonBones/armature/Slot.ts
@@ -21,6 +21,122 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 namespace dragonBones {
+    /**
+     * @private
+     */
+    export class DisplayFrame extends BaseObject {
+        public static toString(): string {
+            return "[class dragonBones.DisplayFrame]";
+        }
+
+        public rawDisplayData: DisplayData | null;
+        public displayData: DisplayData | null;
+        public textureData: TextureData | null;
+        public display: any | Armature | null;
+        public readonly deformVertices: Array = [];
+
+        protected _onClear(): void {
+            this.rawDisplayData = null;
+            this.displayData = null;
+            this.textureData = null;
+            this.display = null;
+            this.deformVertices.length = 0;
+        }
+
+        public updateDeformVertices(): void {
+            if (this.rawDisplayData === null || this.deformVertices.length !== 0) {
+                return;
+            }
+
+            let rawGeometryData: GeometryData;
+            if (this.rawDisplayData.type === DisplayType.Mesh) {
+                rawGeometryData = (this.rawDisplayData as MeshDisplayData).geometry;
+            }
+            else if (this.rawDisplayData.type === DisplayType.Path) {
+                rawGeometryData = (this.rawDisplayData as PathDisplayData).geometry;
+            }
+            else {
+                return;
+            }
+
+            let vertexCount = 0;
+            if (rawGeometryData.weight !== null) {
+                vertexCount = rawGeometryData.weight.count * 2;
+            }
+            else {
+                vertexCount = rawGeometryData.data.intArray[rawGeometryData.offset + BinaryOffset.GeometryVertexCount] * 2;
+            }
+
+            this.deformVertices.length = vertexCount;
+            for (let i = 0, l = this.deformVertices.length; i < l; ++i) {
+                this.deformVertices[i] = 0.0;
+            }
+        }
+
+        public getGeometryData(): GeometryData | null {
+            if (this.displayData !== null) {
+                if (this.displayData.type === DisplayType.Mesh) {
+                    return (this.displayData as MeshDisplayData).geometry;
+                }
+
+                if (this.displayData.type === DisplayType.Path) {
+                    return (this.displayData as PathDisplayData).geometry;
+                }
+            }
+
+            if (this.rawDisplayData !== null) {
+                if (this.rawDisplayData.type === DisplayType.Mesh) {
+                    return (this.rawDisplayData as MeshDisplayData).geometry;
+                }
+
+                if (this.rawDisplayData.type === DisplayType.Path) {
+                    return (this.rawDisplayData as PathDisplayData).geometry;
+                }
+            }
+
+            return null;
+        }
+
+        public getBoundingBox(): BoundingBoxData | null {
+            if (this.displayData !== null && this.displayData.type === DisplayType.BoundingBox) {
+                return (this.displayData as BoundingBoxDisplayData).boundingBox;
+            }
+
+            if (this.rawDisplayData !== null && this.rawDisplayData.type === DisplayType.BoundingBox) {
+                return (this.rawDisplayData as BoundingBoxDisplayData).boundingBox;
+            }
+
+            return null;
+        }
+
+        public getTextureData(): TextureData | null {
+            if (this.displayData !== null) {
+                if (this.displayData.type === DisplayType.Image) {
+                    return (this.displayData as ImageDisplayData).texture;
+                }
+
+                if (this.displayData.type === DisplayType.Mesh) {
+                    return (this.displayData as MeshDisplayData).texture;
+                }
+            }
+
+            if (this.textureData !== null) {
+                return this.textureData;
+            }
+
+            if (this.rawDisplayData !== null) {
+                if (this.rawDisplayData.type === DisplayType.Image) {
+                    return (this.rawDisplayData as ImageDisplayData).texture;
+                }
+
+                if (this.rawDisplayData.type === DisplayType.Mesh) {
+                    return (this.rawDisplayData as MeshDisplayData).texture;
+                }
+            }
+
+            return null;
+        }
+    }
     /**
      * - The slot attached to the armature, controls the display status and properties of the display object.
      * A bone can contain multiple slots.
@@ -65,24 +181,35 @@ namespace dragonBones {
          * @language zh_CN
          */
         public displayController: string | null;
+        protected _displayDataDirty: boolean;
         protected _displayDirty: boolean;
-        protected _zOrderDirty: boolean;
+        protected _geometryDirty: boolean;
+        protected _textureDirty: boolean;
         protected _visibleDirty: boolean;
         protected _blendModeDirty: boolean;
+        protected _zOrderDirty: boolean;
         /**
          * @internal
          */
         public _colorDirty: boolean;
+        /**
+         * @internal
+         */
+        public _verticesDirty: boolean;
         protected _transformDirty: boolean;
         protected _visible: boolean;
         protected _blendMode: BlendMode;
         protected _displayIndex: number;
         protected _animationDisplayIndex: number;
+        protected _cachedFrameIndex: number;
         /**
          * @internal
          */
         public _zOrder: number;
-        protected _cachedFrameIndex: number;
+        /**
+         * @internal
+         */
+        public _zIndex: number;
         /**
          * @internal
          */
@@ -96,26 +223,31 @@ namespace dragonBones {
          * @internal
          */
         public readonly _colorTransform: ColorTransform = new ColorTransform();
-        protected readonly _displayDatas: Array = [];
-        protected readonly _displayList: Array = [];
+        /**
+         * @internal
+         */
+        public readonly _displayFrames: Array = [];
+        /**
+         * @internal
+         */
+        public readonly _geometryBones: Array = [];
         /**
          * @internal
          */
         public _slotData: SlotData;
-        protected _rawDisplayDatas: Array | null;
         /**
          * @internal
          */
-        public _displayData: DisplayData | null;
-        protected _boundingBoxData: BoundingBoxData | null;
-        protected _textureData: TextureData | null;
+        public _displayFrame: DisplayFrame | null;
         /**
          * @internal
          */
-        public _deformVertices: DeformVertices | null = null;
+        public _geometryData: GeometryData | null;
+        protected _boundingBoxData: BoundingBoxData | null;
+        protected _textureData: TextureData | null;
         protected _rawDisplay: any = null; // Initial value.
         protected _meshDisplay: any = null; // Initial value.
-        protected _display: any;
+        protected _display: any | null = null;
         protected _childArmature: Armature | null;
         /**
          * @private
@@ -130,13 +262,16 @@ namespace dragonBones {
             super._onClear();
 
             const disposeDisplayList: Array = [];
-            for (const eachDisplay of this._displayList) {
+            for (const dispayFrame of this._displayFrames) {
+                const display = dispayFrame.display;
                 if (
-                    eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                    disposeDisplayList.indexOf(eachDisplay) < 0
+                    display !== this._rawDisplay && display !== this._meshDisplay &&
+                    disposeDisplayList.indexOf(display) < 0
                 ) {
-                    disposeDisplayList.push(eachDisplay);
+                    disposeDisplayList.push(display);
                 }
+
+                dispayFrame.returnToPool();
             }
 
             for (const eachDisplay of disposeDisplayList) {
@@ -148,10 +283,6 @@ namespace dragonBones {
                 }
             }
 
-            if (this._deformVertices !== null) {
-                this._deformVertices.returnToPool();
-            }
-
             if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) { // May be _meshDisplay and _rawDisplay is the same one.
                 this._disposeDisplay(this._meshDisplay, false);
             }
@@ -162,29 +293,34 @@ namespace dragonBones {
 
             this.displayController = null;
 
+            this._displayDataDirty = false;
             this._displayDirty = false;
-            this._zOrderDirty = false;
+            this._geometryDirty = false;
+            this._textureDirty = false;
+            this._visibleDirty = false;
             this._blendModeDirty = false;
+            this._zOrderDirty = false;
             this._colorDirty = false;
+            this._verticesDirty = false;
             this._transformDirty = false;
             this._visible = true;
             this._blendMode = BlendMode.Normal;
             this._displayIndex = -1;
             this._animationDisplayIndex = -1;
             this._zOrder = 0;
+            this._zIndex = 0;
             this._cachedFrameIndex = -1;
             this._pivotX = 0.0;
             this._pivotY = 0.0;
             this._localMatrix.identity();
             this._colorTransform.identity();
-            this._displayList.length = 0;
-            this._displayDatas.length = 0;
+            this._displayFrames.length = 0;
+            this._geometryBones.length = 0;
             this._slotData = null as any; //
-            this._rawDisplayDatas = null;
-            this._displayData = null;
+            this._displayFrame = null;
+            this._geometryData = null;
             this._boundingBoxData = null;
             this._textureData = null;
-            this._deformVertices = null;
             this._rawDisplay = null;
             this._meshDisplay = null;
             this._display = null;
@@ -208,89 +344,71 @@ namespace dragonBones {
         protected abstract _updateColor(): void;
         protected abstract _updateFrame(): void;
         protected abstract _updateMesh(): void;
-        /**
-         * @internal
-         */
-        public abstract _updateGlueMesh(): void;
         protected abstract _updateTransform(): void;
         protected abstract _identityTransform(): void;
+
+        protected _hasDisplay(display: any): boolean {
+            for (const displayFrame of this._displayFrames) {
+                if (displayFrame.display === display) {
+                    return true;
+                }
+            }
+
+            return false;
+        }
         /**
-         * - Support default skin data.
+         * @internal
          */
-        protected _getDefaultRawDisplayData(displayIndex: number): DisplayData | null {
-            const defaultSkin = this._armature._armatureData.defaultSkin;
-            if (defaultSkin !== null) {
-                const defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name);
-                if (defaultRawDisplayDatas !== null) {
-                    return displayIndex < defaultRawDisplayDatas.length ? defaultRawDisplayDatas[displayIndex] : null;
+        public _isBonesUpdate(): boolean {
+            for (const bone of this._geometryBones) {
+                if (bone !== null && bone._childrenTransformDirty) {
+                    return true;
                 }
             }
 
-            return null;
+            return false;
+        }
+        /**
+         * @internal
+         */
+        public _updateAlpha() {
+            const globalAlpha = this._alpha * this._parent._globalAlpha;
+
+            if (this._globalAlpha !== globalAlpha) {
+                this._globalAlpha = globalAlpha;
+                this._colorDirty = true;
+            }
         }
 
         protected _updateDisplayData(): void {
-            const prevDisplayData = this._displayData;
-            const prevVerticesData = this._deformVertices !== null ? this._deformVertices.verticesData : null;
+            const prevDisplayFrame = this._displayFrame;
+            const prevGeometryData = this._geometryData;
             const prevTextureData = this._textureData;
             let rawDisplayData: DisplayData | null = null;
-            let currentVerticesData: VerticesData | null = null;
+            let displayData: DisplayData | null = null;
 
-            this._displayData = null;
+            this._displayFrame = null;
+            this._geometryData = null;
             this._boundingBoxData = null;
             this._textureData = null;
 
-            if (this._displayIndex >= 0) {
-                if (this._rawDisplayDatas !== null) {
-                    rawDisplayData = this._displayIndex < this._rawDisplayDatas.length ? this._rawDisplayDatas[this._displayIndex] : null;
-                }
-
-                if (rawDisplayData === null) {
-                    rawDisplayData = this._getDefaultRawDisplayData(this._displayIndex);
-                }
-
-                if (this._displayIndex < this._displayDatas.length) {
-                    this._displayData = this._displayDatas[this._displayIndex];
-                }
-            }
-
-            if (this._displayData !== null) {
-                if (this._displayData.type === DisplayType.Mesh) {
-                    currentVerticesData = (this._displayData as MeshDisplayData).vertices;
-                }
-                else if (this._displayData.type === DisplayType.Path) {
-                    currentVerticesData = (this._displayData as PathDisplayData).vertices;
-                }
-                else if (rawDisplayData !== null) {
-                    if (rawDisplayData.type === DisplayType.Mesh) {
-                        currentVerticesData = (rawDisplayData as MeshDisplayData).vertices;
-                    }
-                    else if (rawDisplayData.type === DisplayType.Path) {
-                        currentVerticesData = (rawDisplayData as PathDisplayData).vertices;
-                    }
-                }
-
-                if (this._displayData.type === DisplayType.BoundingBox) {
-                    this._boundingBoxData = (this._displayData as BoundingBoxDisplayData).boundingBox;
-                }
-                else if (rawDisplayData !== null) {
-                    if (rawDisplayData.type === DisplayType.BoundingBox) {
-                        this._boundingBoxData = (rawDisplayData as BoundingBoxDisplayData).boundingBox;
-                    }
-                }
+            if (this._displayIndex >= 0 && this._displayIndex < this._displayFrames.length) {
+                this._displayFrame = this._displayFrames[this._displayIndex];
+                rawDisplayData = this._displayFrame.rawDisplayData;
+                displayData = this._displayFrame.displayData;
 
-                if (this._displayData.type === DisplayType.Image) {
-                    this._textureData = (this._displayData as ImageDisplayData).texture;
-                }
-                else if (this._displayData.type === DisplayType.Mesh) {
-                    this._textureData = (this._displayData as MeshDisplayData).texture;
-                }
+                this._geometryData = this._displayFrame.getGeometryData();
+                this._boundingBoxData = this._displayFrame.getBoundingBox();
+                this._textureData = this._displayFrame.getTextureData();
             }
 
-            if (this._displayData !== prevDisplayData || currentVerticesData !== prevVerticesData || this._textureData !== prevTextureData) {
+            if (
+                this._displayFrame !== prevDisplayFrame ||
+                this._geometryData !== prevGeometryData || this._textureData !== prevTextureData
+            ) {
                 // Update pivot offset.
-                if (currentVerticesData === null && this._textureData !== null) { // TODO
-                    const imageDisplayData = this._displayData as ImageDisplayData;
+                if (this._geometryData === null && this._textureData !== null) {
+                    const imageDisplayData = ((displayData !== null && displayData.type === DisplayType.Image) ? displayData : rawDisplayData) as ImageDisplayData; //
                     const scale = this._textureData.parent.scale * this._armature._armatureData.scale;
                     const frame = this._textureData.frame;
 
@@ -315,14 +433,14 @@ namespace dragonBones {
                     }
 
                     // Update replace pivot. TODO
-                    if (this._displayData !== null && rawDisplayData !== null && this._displayData !== rawDisplayData) {
+                    if (rawDisplayData !== null && imageDisplayData !== rawDisplayData) {
                         rawDisplayData.transform.toMatrix(Slot._helpMatrix);
                         Slot._helpMatrix.invert();
                         Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint);
                         this._pivotX -= Slot._helpPoint.x;
                         this._pivotY -= Slot._helpPoint.y;
 
-                        this._displayData.transform.toMatrix(Slot._helpMatrix);
+                        imageDisplayData.transform.toMatrix(Slot._helpMatrix);
                         Slot._helpMatrix.invert();
                         Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint);
                         this._pivotX += Slot._helpPoint.x;
@@ -342,26 +460,42 @@ namespace dragonBones {
                 if (rawDisplayData !== null) { // Compatible.
                     this.origin = rawDisplayData.transform;
                 }
-                else if (this._displayData !== null) { // Compatible.
-                    this.origin = this._displayData.transform;
+                else if (displayData !== null) { // Compatible.
+                    this.origin = displayData.transform;
                 }
                 else {
                     this.origin = null;
                 }
 
-                // Update vertices.
-                if (currentVerticesData !== prevVerticesData) {
-                    if (this._deformVertices === null) {
-                        this._deformVertices = BaseObject.borrowObject(DeformVertices);
-                    }
-
-                    this._deformVertices.init(currentVerticesData, this._armature);
+                // TODO remove slot offset.
+                if (this.origin !== null) {
+                    this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix);
+                }
+                else {
+                    this.global.copyFrom(this.offset).toMatrix(this._localMatrix);
                 }
-                else if (this._deformVertices !== null && this._textureData !== prevTextureData) { // Update mesh after update frame.
-                    this._deformVertices.verticesDirty = true;
+
+                // Update geometry.
+                if (this._geometryData !== prevGeometryData) {
+                    this._geometryDirty = true;
+                    this._verticesDirty = true;
+
+                    if (this._geometryData !== null) {
+                        this._geometryBones.length = 0;
+                        if (this._geometryData.weight !== null) {
+                            for (let i = 0, l = this._geometryData.weight.bones.length; i < l; ++i) {
+                                const bone = this._armature.getBone(this._geometryData.weight.bones[i].name);
+                                this._geometryBones.push(bone);
+                            }
+                        }
+                    }
+                    else {
+                        this._geometryBones.length = 0;
+                        this._geometryData = null;
+                    }
                 }
 
-                this._displayDirty = true;
+                this._textureDirty = this._textureData !== prevTextureData;
                 this._transformDirty = true;
             }
         }
@@ -371,8 +505,8 @@ namespace dragonBones {
             const prevChildArmature = this._childArmature;
 
             // Update display and child armature.
-            if (this._displayIndex >= 0 && this._displayIndex < this._displayList.length) {
-                this._display = this._displayList[this._displayIndex];
+            if (this._displayFrame !== null) {
+                this._display = this._displayFrame.display;
                 if (this._display !== null && this._display instanceof Armature) {
                     this._childArmature = this._display as Armature;
                     this._display = this._childArmature.display;
@@ -389,18 +523,15 @@ namespace dragonBones {
             // Update display.
             const currentDisplay = this._display !== null ? this._display : this._rawDisplay;
             if (currentDisplay !== prevDisplay) {
-                this._onUpdateDisplay();
-                this._replaceDisplay(prevDisplay);
-
-                this._transformDirty = true;
+                this._textureDirty = true;
                 this._visibleDirty = true;
                 this._blendModeDirty = true;
+                // this._zOrderDirty = true;
                 this._colorDirty = true;
-            }
+                this._transformDirty = true;
 
-            // Update frame.
-            if (currentDisplay === this._rawDisplay || currentDisplay === this._meshDisplay) {
-                this._updateFrame();
+                this._onUpdateDisplay();
+                this._replaceDisplay(prevDisplay);
             }
 
             // Update child armature.
@@ -425,33 +556,25 @@ namespace dragonBones {
                         }
 
                         // Child armature action.
-                        let actions: Array | null = null;
-                        if (this._displayData !== null && this._displayData.type === DisplayType.Armature) {
-                            actions = (this._displayData as ArmatureDisplayData).actions;
-                        }
-                        else if (this._displayIndex >= 0 && this._rawDisplayDatas !== null) {
-                            let rawDisplayData = this._displayIndex < this._rawDisplayDatas.length ? this._rawDisplayDatas[this._displayIndex] : null;
-
-                            if (rawDisplayData === null) {
-                                rawDisplayData = this._getDefaultRawDisplayData(this._displayIndex);
+                        if (this._displayFrame !== null) {
+                            let actions: Array | null = null;
+                            let displayData = this._displayFrame.displayData !== null ? this._displayFrame.displayData : this._displayFrame.rawDisplayData;
+                            if (displayData !== null && displayData.type === DisplayType.Armature) {
+                                actions = (displayData as ArmatureDisplayData).actions;
                             }
 
-                            if (rawDisplayData !== null && rawDisplayData.type === DisplayType.Armature) {
-                                actions = (rawDisplayData as ArmatureDisplayData).actions;
+                            if (actions !== null && actions.length > 0) {
+                                for (const action of actions) {
+                                    const eventObject = BaseObject.borrowObject(EventObject);
+                                    EventObject.actionDataToInstance(action, eventObject, this._armature);
+                                    eventObject.slot = this;
+                                    this._armature._bufferAction(eventObject, false);
+                                }
                             }
-                        }
-
-                        if (actions !== null && actions.length > 0) {
-                            for (const action of actions) {
-                                const eventObject = BaseObject.borrowObject(EventObject);
-                                EventObject.actionDataToInstance(action, eventObject, this._armature);
-                                eventObject.slot = this;
-                                this._armature._bufferAction(eventObject, false);
+                            else {
+                                this._childArmature.animation.play();
                             }
                         }
-                        else {
-                            this._childArmature.animation.play();
-                        }
                     }
                 }
             }
@@ -472,32 +595,29 @@ namespace dragonBones {
         /**
          * @internal
          */
-        public _setDisplayIndex(value: number, isAnimation: boolean = false): boolean {
+        public _setDisplayIndex(value: number, isAnimation: boolean = false): void {
             if (isAnimation) {
                 if (this._animationDisplayIndex === value) {
-                    return false;
+                    return;
                 }
 
                 this._animationDisplayIndex = value;
             }
 
             if (this._displayIndex === value) {
-                return false;
+                return;
             }
 
-            this._displayIndex = value;
-            this._displayDirty = true;
-
-            this._updateDisplayData();
-
-            return this._displayDirty;
+            this._displayIndex = value < this._displayFrames.length ? value : this._displayFrames.length - 1;
+            this._displayDataDirty = true;
+            this._displayDirty = this._displayIndex < 0 || this._display !== this._displayFrames[this._displayIndex].display;
         }
         /**
          * @internal
          */
-        public _setZorder(value: number): boolean {
+        public _setZOrder(value: number): boolean {
             if (this._zOrder === value) {
-                //return false;
+                // return false;
             }
 
             this._zOrder = value;
@@ -510,45 +630,8 @@ namespace dragonBones {
          */
         public _setColor(value: ColorTransform): boolean {
             this._colorTransform.copyFrom(value);
-            this._colorDirty = true;
-
-            return this._colorDirty;
-        }
-        /**
-         * @internal
-         */
-        public _setDisplayList(value: Array | null): boolean {
-            if (value !== null && value.length > 0) {
-                if (this._displayList.length !== value.length) {
-                    this._displayList.length = value.length;
-                }
-
-                for (let i = 0, l = value.length; i < l; ++i) { // Retain input render displays.
-                    const eachDisplay = value[i];
-                    if (
-                        eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                        !(eachDisplay instanceof Armature) && this._displayList.indexOf(eachDisplay) < 0
-                    ) {
-                        this._initDisplay(eachDisplay, true);
-                    }
-
-                    this._displayList[i] = eachDisplay;
-                }
-            }
-            else if (this._displayList.length > 0) {
-                this._displayList.length = 0;
-            }
-
-            if (this._displayIndex >= 0 && this._displayIndex < this._displayList.length) {
-                this._displayDirty = this._display !== this._displayList[this._displayIndex];
-            }
-            else {
-                this._displayDirty = this._display !== null;
-            }
 
-            this._updateDisplayData();
-
-            return this._displayDirty;
+            return this._colorDirty = true;
         }
         /**
          * @internal
@@ -559,19 +642,19 @@ namespace dragonBones {
             }
 
             this._slotData = slotData;
-            //
-            this._visibleDirty = true;
-            this._blendModeDirty = true;
-            this._colorDirty = true;
+            this._colorDirty = true; //
+            this._blendModeDirty = true; //
             this._blendMode = this._slotData.blendMode;
             this._zOrder = this._slotData.zOrder;
+            this._zIndex = this._slotData.zIndex;
+            this._alpha = this._slotData.alpha;
             this._colorTransform.copyFrom(this._slotData.color);
             this._rawDisplay = rawDisplay;
             this._meshDisplay = meshDisplay;
             //
             this._armature = armatureValue;
-            //
             const slotParent = this._armature.getBone(this._slotData.parent.name);
+
             if (slotParent !== null) {
                 this._parent = slotParent;
             }
@@ -593,24 +676,65 @@ namespace dragonBones {
          * @internal
          */
         public update(cacheFrameIndex: number): void {
+            if (this._displayDataDirty) {
+                this._updateDisplayData();
+                this._displayDataDirty = false;
+            }
+
             if (this._displayDirty) {
-                this._displayDirty = false;
                 this._updateDisplay();
+                this._displayDirty = false;
+            }
 
-                // TODO remove slot offset.
-                if (this._transformDirty) { // Update local matrix. (Only updated when both display and transform are dirty.)
-                    if (this.origin !== null) {
-                        this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix);
-                    }
-                    else {
-                        this.global.copyFrom(this.offset).toMatrix(this._localMatrix);
-                    }
+            if (this._geometryDirty || this._textureDirty) {
+                if (this._display === null || this._display === this._rawDisplay || this._display === this._meshDisplay) {
+                    this._updateFrame();
                 }
+
+                this._geometryDirty = false;
+                this._textureDirty = false;
+            }
+
+            if (this._display === null) {
+                return;
+            }
+
+            if (this._visibleDirty) {
+                this._updateVisible();
+                this._visibleDirty = false;
+            }
+
+            if (this._blendModeDirty) {
+                this._updateBlendMode();
+                this._blendModeDirty = false;
+            }
+
+            if (this._colorDirty) {
+                this._updateColor();
+                this._colorDirty = false;
             }
 
             if (this._zOrderDirty) {
-                this._zOrderDirty = false;
                 this._updateZOrder();
+                this._zOrderDirty = false;
+            }
+
+            if (this._geometryData !== null && this._display === this._meshDisplay) {
+                const isSkinned = this._geometryData.weight !== null;
+                const isSurface = this._parent._boneData.type !== BoneType.Bone;
+
+                if (
+                    this._verticesDirty ||
+                    (isSkinned && this._isBonesUpdate()) ||
+                    (isSurface && this._parent._childrenTransformDirty)
+                ) {
+                    this._verticesDirty = false; // Allow update mesh to reset the dirty value.
+                    this._updateMesh();
+                }
+
+                if (isSkinned || isSurface) { // Compatible.
+                    return;
+                }
             }
 
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
@@ -641,46 +765,7 @@ namespace dragonBones {
                 this._cachedFrameIndex = -1;
             }
 
-            if (this._display === null) {
-                return;
-            }
-
-            if (this._visibleDirty) {
-                this._visibleDirty = false;
-                this._updateVisible();
-            }
-
-            if (this._blendModeDirty) {
-                this._blendModeDirty = false;
-                this._updateBlendMode();
-            }
-
-            if (this._colorDirty) {
-                this._colorDirty = false;
-                this._updateColor();
-            }
-
-            if (this._deformVertices !== null && this._deformVertices.verticesData !== null && this._display === this._meshDisplay) {
-                const isSkinned = this._deformVertices.verticesData.weight !== null;
-                const isSurface = this._parent._boneData.type !== BoneType.Bone;
-
-                if (
-                    this._deformVertices.verticesDirty ||
-                    (isSkinned && this._deformVertices.isBonesUpdate()) ||
-                    (isSurface && this._parent._childrenTransformDirty)
-                ) {
-                    this._deformVertices.verticesDirty = false;
-                    this._updateMesh();
-                }
-
-                if (isSkinned || isSurface) { // Compatible.
-                    return;
-                }
-            }
-
             if (this._transformDirty) {
-                this._transformDirty = false;
-
                 if (this._cachedFrameIndex < 0) {
                     const isCache = cacheFrameIndex >= 0;
                     this._updateGlobalTransformMatrix(isCache);
@@ -694,41 +779,146 @@ namespace dragonBones {
                 }
 
                 this._updateTransform();
+                this._transformDirty = false;
             }
         }
+        /**
+         * - Forces the slot to update the state of the display object in the next frame.
+         * @version DragonBones 4.5
+         * @language en_US
+         */
+        /**
+         * - 强制插槽在下一帧更新显示对象的状态。
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        public invalidUpdate(): void {
+            this._displayDataDirty = true;
+            this._displayDirty = true;
+            //
+            this._transformDirty = true;
+        }
         /**
          * @private
          */
         public updateTransformAndMatrix(): void {
             if (this._transformDirty) {
-                this._transformDirty = false;
                 this._updateGlobalTransformMatrix(false);
+                this._transformDirty = false;
             }
         }
         /**
          * @private
          */
-        public replaceDisplayData(value: DisplayData | null, displayIndex: number = -1): void {
-            if (displayIndex < 0) {
-                if (this._displayIndex < 0) {
-                    displayIndex = 0;
+        public replaceRawDisplayData(displayData: DisplayData | null, index: number = -1): void {
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+
+            const displayFrame = this._displayFrames[index];
+            if (displayFrame.rawDisplayData !== displayData) {
+                displayFrame.deformVertices.length = 0;
+                displayFrame.rawDisplayData = displayData;
+                if (displayFrame.rawDisplayData === null) {
+                    const defaultSkin = this._armature._armatureData.defaultSkin;
+                    if (defaultSkin !== null) {
+                        const defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name);
+                        if (defaultRawDisplayDatas !== null && index < defaultRawDisplayDatas.length) {
+                            displayFrame.rawDisplayData = defaultRawDisplayDatas[index];
+                        }
+                    }
                 }
-                else {
-                    displayIndex = this._displayIndex;
+
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
                 }
             }
+        }
+        /**
+         * @private
+         */
+        public replaceDisplayData(displayData: DisplayData | null, index: number = -1): void {
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
 
-            if (this._displayDatas.length <= displayIndex) {
-                this._displayDatas.length = displayIndex + 1;
+            const displayFrame = this._displayFrames[index];
+            if (displayFrame.displayData !== displayData && displayFrame.rawDisplayData !== displayData) {
+                displayFrame.displayData = displayData;
 
-                for (let i = 0, l = this._displayDatas.length; i < l; ++i) { // Clean undefined.
-                    if (!this._displayDatas[i]) {
-                        this._displayDatas[i] = null;
-                    }
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
+            }
+        }
+        /**
+         * @private
+         */
+        public replaceTextureData(textureData: TextureData | null, index: number = -1): void {
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+
+            const displayFrame = this._displayFrames[index];
+            if (displayFrame.textureData !== textureData) {
+                displayFrame.textureData = textureData;
+
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
                 }
             }
+        }
+        /**
+         * @private
+         */
+        public replaceDisplay(value: any | Armature | null, index: number = -1): void {
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+
+            const displayFrame = this._displayFrames[index];
+            if (displayFrame.display !== value) {
+                const prevDisplay = displayFrame.display;
+                displayFrame.display = value;
+
+                if (
+                    prevDisplay !== null &&
+                    prevDisplay !== this._rawDisplay && prevDisplay !== this._meshDisplay &&
+                    !this._hasDisplay(prevDisplay)
+                ) {
+                    if (prevDisplay instanceof Armature) {
+                        // (eachDisplay as Armature).dispose();
+                    }
+                    else {
+                        this._disposeDisplay(prevDisplay, true);
+                    }
+                }
+
+                if (
+                    value !== null &&
+                    value !== this._rawDisplay && value !== this._meshDisplay &&
+                    !this._hasDisplay(prevDisplay) &&
+                    !(value instanceof Armature)
+                ) {
+                    this._initDisplay(value, true);
+                }
 
-            this._displayDatas[displayIndex] = value;
+                if (index === this._displayIndex) {
+                    this._displayDirty = true;
+                }
+            }
         }
         /**
          * - Check whether a specific point is inside a custom bounding box in the slot.
@@ -847,18 +1037,10 @@ namespace dragonBones {
             return intersectionCount;
         }
         /**
-         * - Forces the slot to update the state of the display object in the next frame.
-         * @version DragonBones 4.5
-         * @language en_US
-         */
-        /**
-         * - 强制插槽在下一帧更新显示对象的状态。
-         * @version DragonBones 4.5
-         * @language zh_CN
+         * @private
          */
-        public invalidUpdate(): void {
-            this._displayDirty = true;
-            this._transformDirty = true;
+        public getDisplayFrameAt(index: number): DisplayFrame {
+            return this._displayFrames[index];
         }
         /**
          * - The visible of slot's display object.
@@ -883,6 +1065,30 @@ namespace dragonBones {
             this._visible = value;
             this._updateVisible();
         }
+        /**
+         * @private
+         */
+        public get displayFrameCount(): number {
+            return this._displayFrames.length;
+        }
+        public set displayFrameCount(value: number) {
+            const prevCount = this._displayFrames.length;
+            if (prevCount < value) {
+                this._displayFrames.length = value;
+
+                for (let i = prevCount; i < value; ++i) {
+                    this._displayFrames[i] = BaseObject.borrowObject(DisplayFrame);
+                }
+            }
+            else if (prevCount > value) {
+                for (let i = prevCount - 1; i < value; --i) {
+                    this.replaceDisplay(null, i);
+                    this._displayFrames[i].returnToPool();
+                }
+
+                this._displayFrames.length = value;
+            }
+        }
         /**
          * - The index of the display object displayed in the display list.
          * @example
@@ -909,9 +1115,8 @@ namespace dragonBones {
             return this._displayIndex;
         }
         public set displayIndex(value: number) {
-            if (this._setDisplayIndex(value)) {
-                this.update(-1);
-            }
+            this._setDisplayIndex(value);
+            this.update(-1);
         }
         /**
          * - The slot name.
@@ -939,34 +1144,18 @@ namespace dragonBones {
          * @language zh_CN
          */
         public get displayList(): Array {
-            return this._displayList.concat();
-        }
-        public set displayList(value: Array) {
-            const backupDisplayList = this._displayList.concat(); // Copy.
-            const disposeDisplayList = new Array();
-
-            if (this._setDisplayList(value)) {
-                this.update(-1);
+            const displays = new Array();
+            for (const displayFrame of this._displayFrames) {
+                displays.push(displayFrame.display);
             }
 
-            // Release replaced displays.
-            for (const eachDisplay of backupDisplayList) {
-                if (
-                    eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                    this._displayList.indexOf(eachDisplay) < 0 &&
-                    disposeDisplayList.indexOf(eachDisplay) < 0
-                ) {
-                    disposeDisplayList.push(eachDisplay);
-                }
-            }
-
-            for (const eachDisplay of disposeDisplayList) {
-                if (eachDisplay instanceof Armature) {
-                    // (eachDisplay as Armature).dispose();
-                }
-                else {
-                    this._disposeDisplay(eachDisplay, true);
-                }
+            return displays;
+        }
+        public set displayList(value: Array) {
+            this.displayFrameCount = value.length;
+            let index = 0;
+            for (const eachDisplay of value) {
+                this.replaceDisplay(eachDisplay, index++);
             }
         }
         /**
@@ -984,43 +1173,6 @@ namespace dragonBones {
         public get slotData(): SlotData {
             return this._slotData;
         }
-        /**
-         * @private
-         */
-        public get rawDisplayDatas(): Array | null {
-            return this._rawDisplayDatas;
-        }
-        public set rawDisplayDatas(value: Array | null) {
-            if (this._rawDisplayDatas === value) {
-                return;
-            }
-
-            this._displayDirty = true;
-            this._rawDisplayDatas = value;
-
-            if (this._rawDisplayDatas !== null) {
-                this._displayDatas.length = this._rawDisplayDatas.length;
-
-                for (let i = 0, l = this._displayDatas.length; i < l; ++i) {
-                    let rawDisplayData = this._rawDisplayDatas[i];
-
-                    if (rawDisplayData === null) {
-                        rawDisplayData = this._getDefaultRawDisplayData(i);
-                    }
-
-                    this._displayDatas[i] = rawDisplayData;
-                }
-            }
-            else {
-                this._displayDatas.length = 0;
-            }
-        }
-        /**
-         * @private
-         */
-        public get displayData(): DisplayData | null {
-            return this._displayData;
-        }
         /**
          * - The custom bounding box data for the slot at current time.
          * @version DragonBones 5.0
@@ -1074,32 +1226,21 @@ namespace dragonBones {
                 return;
             }
 
-            const displayListLength = this._displayList.length;
-            if (this._displayIndex < 0 && displayListLength === 0) {  // Emprty.
+            if (this._displayFrames.length === 0) {
+                this.displayFrameCount = 1;
                 this._displayIndex = 0;
             }
 
-            if (this._displayIndex < 0) {
-                return;
-            }
-            else {
-                const replaceDisplayList = this.displayList; // Copy.
-                if (displayListLength <= this._displayIndex) {
-                    replaceDisplayList.length = this._displayIndex + 1;
-                }
-
-                replaceDisplayList[this._displayIndex] = value;
-                this.displayList = replaceDisplayList;
-            }
+            this.replaceDisplay(value, this._displayIndex);
         }
         /**
          * - The child armature that the slot displayed at current time.
          * @example
          * 
          *     let slot = armature.getSlot("weapon");
-         * let prevChildArmature = slot.childArmature;
-         * if (prevChildArmature) {
-         * prevChildArmature.dispose();
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
          *     }
          *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
          * 
@@ -1112,9 +1253,9 @@ namespace dragonBones { * @example *
          *     let slot = armature.getSlot("weapon");
-         * let prevChildArmature = slot.childArmature;
-         * if (prevChildArmature) {
-         * prevChildArmature.dispose();
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
          *     }
          *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
          * 
diff --git a/DragonBones/src/dragonBones/armature/Surface.ts b/DragonBones/src/dragonBones/armature/Surface.ts index e298807e..da185035 100644 --- a/DragonBones/src/dragonBones/armature/Surface.ts +++ b/DragonBones/src/dragonBones/armature/Surface.ts @@ -46,6 +46,8 @@ namespace dragonBones { */ private readonly _matrixCahce: Array = []; + public _bone: Bone | null; + protected _onClear(): void { super._onClear(); @@ -58,6 +60,7 @@ namespace dragonBones { this._deformVertices.length = 0; this._matrixCahce.length = 0; this._hullCache.length = 0; + this._bone = null; } private _getAffineTransform( @@ -80,43 +83,49 @@ namespace dragonBones { transform.scaleX = Math.sqrt(dabX * dabX + dabY * dabY) / lX; transform.scaleY = Math.sqrt(dacX * dacX + dacY * dacY) / lY; transform.toMatrix(matrix); - transform.x = matrix.tx = aX - (matrix.a * x + matrix.c * y); transform.y = matrix.ty = aY - (matrix.b * x + matrix.d * y); } private _updateVertices(): void { - const originalVertices = (this._boneData as SurfaceData).vertices; + const data = this._armature.armatureData.parent; + const geometry = (this._boneData as SurfaceData).geometry; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[geometry.offset + BinaryOffset.GeometryVertexCount]; + const verticesOffset = intArray[geometry.offset + BinaryOffset.GeometryFloatOffset]; const vertices = this._vertices; const animationVertices = this._deformVertices; if (this._parent !== null) { if (this._parent._boneData.type === BoneType.Surface) { - for (let i = 0, l = originalVertices.length; i < l; i += 2) { - const x = originalVertices[i] + animationVertices[i]; - const y = originalVertices[i + 1] + animationVertices[i]; + for (let i = 0, l = vertexCount; i < l; ++i) { + const iD = i * 2; + const x = floatArray[verticesOffset + iD] + animationVertices[iD]; + const y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; const matrix = (this._parent as Surface)._getGlobalTransformMatrix(x, y); // - vertices[i] = matrix.a * x + matrix.c * y + matrix.tx; - vertices[i + 1] = matrix.b * x + matrix.d * y + matrix.ty; + vertices[iD] = matrix.a * x + matrix.c * y + matrix.tx; + vertices[iD + 1] = matrix.b * x + matrix.d * y + matrix.ty; } } else { const parentMatrix = this._parent.globalTransformMatrix; - - for (let i = 0, l = originalVertices.length; i < l; i += 2) { - const x = originalVertices[i] + animationVertices[i]; - const y = originalVertices[i + 1] + animationVertices[i + 1]; + for (let i = 0, l = vertexCount; i < l; ++i) { + const iD = i * 2; + const x = floatArray[verticesOffset + iD] + animationVertices[iD]; + const y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; // - vertices[i] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; - vertices[i + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + vertices[iD] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + vertices[iD + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; } } } else { - for (let i = 0, l = originalVertices.length; i < l; i += 2) { - vertices[i] = originalVertices[i] + animationVertices[i]; - vertices[i + 1] = originalVertices[i + 1] + animationVertices[i + 1]; + for (let i = 0, l = vertexCount; i < l; ++i) { + const iD = i * 2; + vertices[iD] = floatArray[verticesOffset + iD] + animationVertices[iD]; + vertices[iD + 1] = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; } } } @@ -148,19 +157,19 @@ namespace dragonBones { const bY = rbY + (rcY - rbY) * 0.5; const cX = rdX + (rcX - rdX) * 0.5; const cY = rdY + (rcY - rdY) * 0.5; - // - this._globalDirty = false; + // TODO interpolation this._getAffineTransform(0.0, 0.0, lA, lA, aX, aY, bX, bY, cX, cY, this.global, this.globalTransformMatrix, false); + this._globalDirty = false; } public _getGlobalTransformMatrix(x: number, y: number): Matrix { + const lA = 200.0; const lB = 1000.0; if (x < -lB || lB < x || y < -lB || lB < y) { return this.globalTransformMatrix; } let isDown = false; - const lA = 200.0; const surfaceData = this._boneData as SurfaceData; const segmentX = surfaceData.segmentX; const segmentY = surfaceData.segmentY; @@ -172,6 +181,7 @@ namespace dragonBones { let matrixIndex = 0; let pX = indexX * dX - lA; let pY = indexY * dY - lA; + // const matrices = this._matrixCahce; const helpMatrix = Surface._helpMatrix; @@ -181,9 +191,9 @@ namespace dragonBones { } // Left. isDown = y > this._kX * (x + lA) + pY; - matrixIndex = ((segmentX * (segmentY + 1) + segmentX * 2 + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7; - if (this._matrixCahce[matrixIndex] > 0.0) { + if (matrices[matrixIndex] > 0.0) { helpMatrix.copyFromArray(matrices, matrixIndex + 1); } else { @@ -232,9 +242,9 @@ namespace dragonBones { } // Right. isDown = y > this._kX * (x - lB) + pY; - matrixIndex = ((segmentX * (segmentY + 1) + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7; + matrixIndex = ((segmentX * segmentY + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7; - if (this._matrixCahce[matrixIndex] > 0.0) { + if (matrices[matrixIndex] > 0.0) { helpMatrix.copyFromArray(matrices, matrixIndex + 1); } else { @@ -283,9 +293,9 @@ namespace dragonBones { } // Up. isDown = y > this._kY * (x - pX - dX) - lB; - matrixIndex = (segmentX * (segmentY + 1) + indexX * 2 + (isDown ? 1 : 0)) * 7; + matrixIndex = ((segmentX * segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; - if (this._matrixCahce[matrixIndex] > 0.0) { + if (matrices[matrixIndex] > 0.0) { helpMatrix.copyFromArray(matrices, matrixIndex + 1); } else { @@ -334,9 +344,9 @@ namespace dragonBones { } // Down isDown = y > this._kY * (x - pX - dX) + lA; - matrixIndex = ((segmentX * (segmentY + 1) + segmentX + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; - if (this._matrixCahce[matrixIndex] > 0.0) { + if (matrices[matrixIndex] > 0.0) { helpMatrix.copyFromArray(matrices, matrixIndex + 1); } else { @@ -383,7 +393,7 @@ namespace dragonBones { isDown = y > this._k * (x - pX - dX) + pY; matrixIndex = ((segmentX * indexY + indexX) * 2 + (isDown ? 1 : 0)) * 7; - if (this._matrixCahce[matrixIndex] > 0.0) { + if (matrices[matrixIndex] > 0.0) { helpMatrix.copyFromArray(matrices, matrixIndex + 1); } else { @@ -438,7 +448,7 @@ namespace dragonBones { const segmentX = surfaceData.segmentX; const segmentY = surfaceData.segmentY; - const vertexCount = surfaceData.vertices.length; + const vertexCount = this._armature.armatureData.parent.intArray[surfaceData.geometry.offset + BinaryOffset.GeometryVertexCount]; const lB = 1000.0; const lA = 200.0; // @@ -447,21 +457,28 @@ namespace dragonBones { this._k = -this._dY / this._dX; this._kX = -this._dY / (lB - lA); this._kY = -(lB - lA) / this._dX; - this._vertices.length = vertexCount; - this._deformVertices.length = vertexCount; + this._vertices.length = vertexCount * 2; + this._deformVertices.length = vertexCount * 2; this._matrixCahce.length = (segmentX * segmentY + segmentX * 2 + segmentY * 2) * 2 * 7; this._hullCache.length = 10; - for (let i = 0; i < vertexCount; ++i) { + for (let i = 0; i < vertexCount * 2; ++i) { this._deformVertices[i] = 0.0; } + + if (this._parent !== null) { + if (this._parent.boneData.type === BoneType.Bone) { + this._bone = this._parent; + } + else { + this._bone = (this._parent as Surface)._bone; + } + } } /** * @internal */ public update(cacheFrameIndex: number): void { - this._blendState.dirty = false; - if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { const cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache. diff --git a/DragonBones/src/dragonBones/armature/TransformObject.ts b/DragonBones/src/dragonBones/armature/TransformObject.ts index c83b7c1e..75135998 100644 --- a/DragonBones/src/dragonBones/armature/TransformObject.ts +++ b/DragonBones/src/dragonBones/armature/TransformObject.ts @@ -83,6 +83,14 @@ namespace dragonBones { */ public userData: any; protected _globalDirty: boolean; + /** + * @internal + */ + public _alpha: number; + /** + * @internal + */ + public _globalAlpha: number; /** * @internal */ @@ -97,6 +105,8 @@ namespace dragonBones { this.userData = null; this._globalDirty = false; + this._alpha = 1.0; + this._globalAlpha = 1.0; this._armature = null as any; // } /** @@ -141,5 +151,5 @@ namespace dragonBones { public get armature(): Armature { return this._armature; } - } + } } \ No newline at end of file diff --git a/DragonBones/src/dragonBones/core/DragonBones.ts b/DragonBones/src/dragonBones/core/DragonBones.ts index 7637881a..8acd2bf6 100644 --- a/DragonBones/src/dragonBones/core/DragonBones.ts +++ b/DragonBones/src/dragonBones/core/DragonBones.ts @@ -22,18 +22,18 @@ */ namespace dragonBones { /** - * @internal + * @private */ export const enum BinaryOffset { WeigthBoneCount = 0, WeigthFloatOffset = 1, WeigthBoneIndices = 2, - MeshVertexCount = 0, - MeshTriangleCount = 1, - MeshFloatOffset = 2, - MeshWeightOffset = 3, - MeshVertexIndices = 4, + GeometryVertexCount = 0, + GeometryTriangleCount = 1, + GeometryFloatOffset = 2, + GeometryWeightOffset = 3, + GeometryVertexIndices = 4, TimelineScale = 0, TimelineOffset = 1, @@ -51,14 +51,10 @@ namespace dragonBones { DeformCount = 1, DeformValueCount = 2, DeformValueOffset = 3, - DeformFloatOffset = 4, - - PathVertexCount = 0, - PathFloatOffset = 2, - PathWeightOffset = 3, + DeformFloatOffset = 4 } /** - * @internal + * @private */ export const enum ArmatureType { Armature = 0, @@ -66,7 +62,7 @@ namespace dragonBones { Stage = 2 } /** - * @internal + * @private */ export const enum BoneType { Bone = 0, @@ -98,7 +94,7 @@ namespace dragonBones { Polygon = 2 } /** - * @internal + * @private */ export const enum ActionType { Play = 0, @@ -106,7 +102,7 @@ namespace dragonBones { Sound = 11 } /** - * @internal + * @private */ export const enum BlendMode { Normal = 0, @@ -125,7 +121,7 @@ namespace dragonBones { Subtract = 13 } /** - * @internal + * @private */ export const enum TweenType { None = 0, @@ -136,7 +132,7 @@ namespace dragonBones { QuadInOut = 5 } /** - * @internal + * @private */ export const enum TimelineType { Action = 0, @@ -148,15 +144,19 @@ namespace dragonBones { BoneScale = 13, Surface = 50, + BoneAlpha = 60, SlotDisplay = 20, SlotColor = 21, SlotDeform = 22, + SlotZIndex = 23, + SlotAlpha = 24, IKConstraint = 30, - AnimationTime = 40, - AnimationWeight = 41 + AnimationProgress = 40, + AnimationWeight = 41, + AnimationParameter = 42, } /** * - Offset mode. @@ -171,7 +171,7 @@ namespace dragonBones { export const enum OffsetMode { None, Additive, - Override + Override, } /** * - Animation fade out mode. @@ -184,15 +184,6 @@ namespace dragonBones { * @language zh_CN */ export const enum AnimationFadeOutMode { - /** - * - Do not fade out of any animation states. - * @language en_US - */ - /** - * - 不淡出任何的动画状态。 - * @language zh_CN - */ - None = 0, /** * - Fade out the animation states of the same layer. * @language en_US @@ -237,31 +228,52 @@ namespace dragonBones { * - 不替换同名的动画状态。 * @language zh_CN */ - Single = 5 + Single = 5, } - + /** + * @private + */ + export const enum AnimationBlendType { + None, + E1D, + } + /** + * @private + */ + export const enum AnimationBlendMode { + Additive, + Override, + } + /** + * @private + */ export const enum ConstraintType { IK, Path } - + /** + * @private + */ export const enum PositionMode { Fixed, Percent } - + /** + * @private + */ export const enum SpacingMode { Length, Fixed, Percent } - + /** + * @private + */ export const enum RotateMode { Tangent, Chain, ChainScale } - /** * @private */ @@ -272,12 +284,11 @@ namespace dragonBones { * @private */ export class DragonBones { - public static readonly VERSION: string = "5.6.300"; + public static readonly VERSION: string = "5.7.000"; public static yDown: boolean = true; public static debug: boolean = false; public static debugDraw: boolean = false; - public static webAssembly: boolean = false; private readonly _clock: WorldClock = new WorldClock(); private readonly _events: Array = []; @@ -305,6 +316,7 @@ namespace dragonBones { for (let i = 0; i < this._events.length; ++i) { const eventObject = this._events[i]; const armature = eventObject.armature; + if (armature._armatureData !== null) { // May be armature disposed before advanceTime. armature.eventDispatcher.dispatchDBEvent(eventObject.type, eventObject); if (eventObject.type === EventObject.SOUND_EVENT) { @@ -341,10 +353,6 @@ namespace dragonBones { } } // -if (typeof global === "undefined") { - var global = window as any; -} -// if (!console.warn) { console.warn = function () { }; } @@ -369,4 +377,24 @@ var __extends: any = function (t: any, e: any) { } } r.prototype = e.prototype, t.prototype = new (r as any)(); -}; \ No newline at end of file +}; +// +if (typeof global === "undefined" && typeof window !== "undefined") { + var global = window as any; +} +// +declare var exports: any; +declare var module: any; +declare var define: any; +if (typeof exports === "object" && typeof module === "object") { + module.exports = dragonBones; +} +else if (typeof define === "function" && define["amd"]) { + define(["dragonBones"], function () { return dragonBones; }); +} +else if (typeof exports === "object") { + exports = dragonBones; +} +else if (typeof global !== "undefined") { + global.dragonBones = dragonBones; +} \ No newline at end of file diff --git a/DragonBones/src/dragonBones/event/IEventDispatcher.ts b/DragonBones/src/dragonBones/event/IEventDispatcher.ts index d2c20b25..5cbe89c3 100644 --- a/DragonBones/src/dragonBones/event/IEventDispatcher.ts +++ b/DragonBones/src/dragonBones/event/IEventDispatcher.ts @@ -105,39 +105,5 @@ namespace dragonBones { * @language zh_CN */ removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; - - /** - * - Deprecated, please refer to {@link #hasDBEventListener()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #hasDBEventListener()}。 - * @deprecated - * @language zh_CN - */ - hasEvent(type: EventStringType): boolean; - /** - * - Deprecated, please refer to {@link #addDBEventListener()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #addDBEventListener()}。 - * @deprecated - * @language zh_CN - */ - addEvent(type: EventStringType, listener: Function, thisObject: any): void; - /** - * - Deprecated, please refer to {@link #removeDBEventListener()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #removeDBEventListener()}。 - * @deprecated - * @language zh_CN - */ - removeEvent(type: EventStringType, listener: Function, thisObject: any): void; } } \ No newline at end of file diff --git a/DragonBones/src/dragonBones/factory/BaseFactory.ts b/DragonBones/src/dragonBones/factory/BaseFactory.ts index a1a68d1b..7ad62d59 100644 --- a/DragonBones/src/dragonBones/factory/BaseFactory.ts +++ b/DragonBones/src/dragonBones/factory/BaseFactory.ts @@ -169,8 +169,8 @@ namespace dragonBones { for (const boneData of dataPackage.armature.sortedBones) { const bone = BaseObject.borrowObject(boneData.type === BoneType.Bone ? Bone : Surface); bone.init(boneData, armature); - } - } + } + } /** * @private */ @@ -197,24 +197,26 @@ namespace dragonBones { for (const slotData of dataPackage.armature.sortedSlots) { const displayDatas = slotData.name in skinSlots ? skinSlots[slotData.name] : null; const slot = this._buildSlot(dataPackage, slotData, armature); - slot.rawDisplayDatas = displayDatas; if (displayDatas !== null) { - const displayList = new Array(); - - // for (const displayData of displays) - for (let i = 0, l = DragonBones.webAssembly ? (displayDatas as any).size() : displayDatas.length; i < l; ++i) { - const displayData = DragonBones.webAssembly ? (displayDatas as any).get(i) : displayDatas[i]; + slot.displayFrameCount = displayDatas.length; + for (let i = 0, l = slot.displayFrameCount; i < l; ++i) { + const displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); if (displayData !== null) { - displayList.push(this._getSlotDisplay(dataPackage, displayData, null, slot)); + if (dataPackage.textureAtlasName.length > 0) { + const textureData = this._getTextureData(dataPackage.textureAtlasName, displayData.path); + slot.replaceTextureData(textureData, i); + } + + const display = this._getSlotDisplay(dataPackage, displayData, slot); + slot.replaceDisplay(display, i); } else { - displayList.push(null); + slot.replaceDisplay(null); } } - - slot._setDisplayList(displayList); } slot._setDisplayIndex(slotData.displayIndex, true); @@ -249,13 +251,11 @@ namespace dragonBones { } } - protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, slot: Slot, displayData: DisplayData): Armature | null { - // tslint:disable-next-line:no-unused-expression - slot; + protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, _slot: Slot, displayData: ArmatureDisplayData): Armature | null { return this.buildArmature(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage !== null ? dataPackage.textureAtlasName : ""); } - protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, rawDisplayData: DisplayData | null, slot: Slot): any { + protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, slot: Slot): any { const dataName = dataPackage !== null ? dataPackage.dataName : displayData.parent.parent.parent.name; let display: any = null; switch (displayData.type) { @@ -264,16 +264,8 @@ namespace dragonBones { if (imageDisplayData.texture === null) { imageDisplayData.texture = this._getTextureData(dataName, displayData.path); } - else if (dataPackage !== null && dataPackage.textureAtlasName.length > 0) { - imageDisplayData.texture = this._getTextureData(dataPackage.textureAtlasName, displayData.path); - } - if (rawDisplayData !== null && rawDisplayData.type === DisplayType.Mesh && this._isSupportMesh()) { - display = slot.meshDisplay; - } - else { - display = slot.rawDisplay; - } + display = slot.rawDisplay; break; } @@ -282,9 +274,6 @@ namespace dragonBones { if (meshDisplayData.texture === null) { meshDisplayData.texture = this._getTextureData(dataName, meshDisplayData.path); } - else if (dataPackage !== null && dataPackage.textureAtlasName.length > 0) { - meshDisplayData.texture = this._getTextureData(dataPackage.textureAtlasName, meshDisplayData.path); - } if (this._isSupportMesh()) { display = slot.meshDisplay; @@ -297,7 +286,7 @@ namespace dragonBones { case DisplayType.Armature: { const armatureDisplayData = displayData as ArmatureDisplayData; - const childArmature = this._buildChildArmature(dataPackage, slot, displayData); + const childArmature = this._buildChildArmature(dataPackage, slot, armatureDisplayData); if (childArmature !== null) { childArmature.inheritAnimation = armatureDisplayData.inheritAnimation; if (!childArmature.inheritAnimation) { @@ -419,9 +408,20 @@ namespace dragonBones { return textureAtlasData; } /** - * @private + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN */ - public updateTextureAtlasData(name: string, textureAtlases: Array): void { + public updateTextureAtlases(textureAtlases: Array, name: string): void { const textureAtlasDatas = this.getTextureAtlasData(name); if (textureAtlasDatas !== null) { for (let i = 0, l = textureAtlasDatas.length; i < l; ++i) { @@ -717,7 +717,7 @@ namespace dragonBones { /** * @private */ - public replaceDisplay(slot: Slot, displayData: DisplayData, displayIndex: number = -1): void { + public replaceDisplay(slot: Slot, displayData: DisplayData | null, displayIndex: number = -1): void { if (displayIndex < 0) { displayIndex = slot.displayIndex; } @@ -728,46 +728,23 @@ namespace dragonBones { slot.replaceDisplayData(displayData, displayIndex); - const displayList = slot.displayList; // Copy. - if (displayList.length <= displayIndex) { - displayList.length = displayIndex + 1; - - for (let i = 0, l = displayList.length; i < l; ++i) { // Clean undefined. - if (!displayList[i]) { - displayList[i] = null; - } - } - } - if (displayData !== null) { - const rawDisplayDatas = slot.rawDisplayDatas; - let rawDisplayData: DisplayData | null = null; - - if (rawDisplayDatas) { - if (DragonBones.webAssembly) { - if (displayIndex < (rawDisplayDatas as any).size()) { - rawDisplayData = (rawDisplayDatas as any).get(displayIndex); - } - } - else { - if (displayIndex < rawDisplayDatas.length) { - rawDisplayData = rawDisplayDatas[displayIndex]; - } + let display = this._getSlotDisplay(null, displayData, slot); + if (displayData.type === DisplayType.Image) { + const rawDisplayData = slot.getDisplayFrameAt(displayIndex).rawDisplayData; + if ( + rawDisplayData !== null && + rawDisplayData.type === DisplayType.Mesh + ) { + display = slot.meshDisplay; } } - displayList[displayIndex] = this._getSlotDisplay( - null, - displayData, - rawDisplayData, - slot - ); + slot.replaceDisplay(display, displayIndex); } else { - displayList[displayIndex] = null; + slot.replaceDisplay(null, displayIndex); } - - slot.displayList = displayList; } /** * - Replaces the current display data for a particular slot with a specific display data. @@ -808,15 +785,11 @@ namespace dragonBones { slot: Slot, displayIndex: number = -1 ): boolean { const armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); - if (!armatureData || !armatureData.defaultSkin) { + if (armatureData === null || armatureData.defaultSkin === null) { return false; } const displayData = armatureData.defaultSkin.getDisplay(slotName, displayName); - if (!displayData) { - return false; - } - this.replaceDisplay(slot, displayData, displayIndex); return true; @@ -833,16 +806,15 @@ namespace dragonBones { return false; } - const displays = armatureData.defaultSkin.getDisplays(slotName); - if (!displays) { + const displayDatas = armatureData.defaultSkin.getDisplays(slotName); + if (!displayDatas) { return false; } - let displayIndex = 0; - // for (const displayData of displays) - for (let i = 0, l = DragonBones.webAssembly ? (displays as any).size() : displays.length; i < l; ++i) { - const displayData = DragonBones.webAssembly ? (displays as any).get(i) : displays[i]; - this.replaceDisplay(slot, displayData, displayIndex++); + slot.displayFrameCount = displayDatas.length; + for (let i = 0, l = slot.displayFrameCount; i < l; ++i) { + const displayData = displayDatas[i]; + this.replaceDisplay(slot, displayData, i); } return true; @@ -894,38 +866,34 @@ namespace dragonBones { continue; } - let displays = skin.getDisplays(slot.name); - if (!displays) { + let displayDatas = skin.getDisplays(slot.name); + if (displayDatas === null) { if (defaultSkin !== null && skin !== defaultSkin) { - displays = defaultSkin.getDisplays(slot.name); + displayDatas = defaultSkin.getDisplays(slot.name); } - if (!displays) { + if (displayDatas === null) { if (isOverride) { - slot.rawDisplayDatas = null; - slot.displayList = []; // + slot.displayFrameCount = 0; } continue; } } - const displayCount = DragonBones.webAssembly ? (displays as any).size() : displays.length; - const displayList = slot.displayList; // Copy. - displayList.length = displayCount; // Modify displayList length. + slot.displayFrameCount = displayDatas.length; + for (let i = 0, l = slot.displayFrameCount; i < l; ++i) { + const displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); - for (let i = 0, l = displayCount; i < l; ++i) { - const displayData = DragonBones.webAssembly ? (displays as any).get(i) : displays[i]; if (displayData !== null) { - displayList[i] = this._getSlotDisplay(null, displayData, null, slot); + slot.replaceDisplay(this._getSlotDisplay(null, displayData, slot), i); } else { - displayList[i] = null; + slot.replaceDisplay(null, i); } } success = true; - slot.rawDisplayDatas = displays; - slot.displayList = displayList; } return success; @@ -997,8 +965,8 @@ namespace dragonBones { for (const display of slot.displayList) { if (display instanceof Armature) { const displayDatas = skinData.getDisplays(slot.name); - if (displayDatas !== null && index < (DragonBones.webAssembly ? (displayDatas as any).size() : displayDatas.length)) { - const displayData = DragonBones.webAssembly ? (displayDatas as any).get(index) : displayDatas[index]; + if (displayDatas !== null && index < displayDatas.length) { + const displayData = displayDatas[index]; if (displayData !== null && displayData.type === DisplayType.Armature) { const childArmatureData = this.getArmatureData(displayData.path, displayData.parent.parent.parent.name); if (childArmatureData) { @@ -1045,48 +1013,9 @@ namespace dragonBones { public get dragonBones(): DragonBones { return this._dragonBones; } - - /** - * - Deprecated, please refer to {@link #replaceSkin}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #replaceSkin}。 - * @deprecated - * @language zh_CN - */ - public changeSkin(armature: Armature, skin: SkinData, exclude: Array | null = null): boolean { - return this.replaceSkin(armature, skin, false, exclude); - } - /** - * - Deprecated, please refer to {@link #replaceAnimation}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #replaceAnimation}。 - * @deprecated - * @language zh_CN - */ - public copyAnimationsToArmature( - toArmature: Armature, - fromArmatreName: string, fromSkinName: string = "", fromDragonBonesDataName: string = "", - replaceOriginalAnimation: boolean = true - ): boolean { - // tslint:disable-next-line:no-unused-expression - fromSkinName; - - const armatureData = this.getArmatureData(fromArmatreName, fromDragonBonesDataName); - if (!armatureData) { - return false; - } - - return this.replaceAnimation(toArmature, armatureData, replaceOriginalAnimation); - } } /** - * @internal + * @private */ export class BuildArmaturePackage { public dataName: string = ""; diff --git a/DragonBones/src/dragonBones/geom/ColorTransform.ts b/DragonBones/src/dragonBones/geom/ColorTransform.ts index 6858308f..3b754487 100644 --- a/DragonBones/src/dragonBones/geom/ColorTransform.ts +++ b/DragonBones/src/dragonBones/geom/ColorTransform.ts @@ -22,7 +22,7 @@ */ namespace dragonBones { /** - * @internal + * @private */ export class ColorTransform { public alphaMultiplier: number; diff --git a/DragonBones/src/dragonBones/model/AnimationConfig.ts b/DragonBones/src/dragonBones/model/AnimationConfig.ts index 2820e6a9..0b49500e 100644 --- a/DragonBones/src/dragonBones/model/AnimationConfig.ts +++ b/DragonBones/src/dragonBones/model/AnimationConfig.ts @@ -79,7 +79,7 @@ namespace dragonBones { /** * @private */ - public additiveBlending: boolean; + public additive: boolean; /** * - Whether the animation state has control over the display property of the slots. * Sometimes blend a animation state does not want it to control the display properties of the slots, @@ -281,7 +281,7 @@ namespace dragonBones { this.fadeOutTime = -1.0; this.actionEnabled = true; - this.additiveBlending = false; + this.additive = false; this.displayControl = true; this.pauseFadeIn = true; this.resetToPose = true; @@ -315,7 +315,7 @@ namespace dragonBones { this.fadeOutTweenType = value.fadeOutTweenType; this.actionEnabled = value.actionEnabled; - this.additiveBlending = value.additiveBlending; + this.additive = value.additive; this.displayControl = value.displayControl; this.pauseFadeIn = value.pauseFadeIn; this.resetToPose = value.resetToPose; @@ -337,66 +337,5 @@ namespace dragonBones { this.boneMask[i] = value.boneMask[i]; } } - /** - * @private - */ - public containsBoneMask(boneName: string): boolean { - return this.boneMask.length === 0 || this.boneMask.indexOf(boneName) >= 0; - } - /** - * @private - */ - public addBoneMask(armature: Armature, boneName: string, recursive: boolean = true): void { - const currentBone = armature.getBone(boneName); - if (currentBone === null) { - return; - } - - if (this.boneMask.indexOf(boneName) < 0) { // Add mixing - this.boneMask.push(boneName); - } - - if (recursive) { // Add recursive mixing. - for (const bone of armature.getBones()) { - if (this.boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) { - this.boneMask.push(bone.name); - } - } - } - } - /** - * @private - */ - public removeBoneMask(armature: Armature, boneName: string, recursive: boolean = true): void { - const index = this.boneMask.indexOf(boneName); - if (index >= 0) { // Remove mixing. - this.boneMask.splice(index, 1); - } - - if (recursive) { - const currentBone = armature.getBone(boneName); - if (currentBone !== null) { - if (this.boneMask.length > 0) { // Remove recursive mixing. - for (const bone of armature.getBones()) { - const index = this.boneMask.indexOf(bone.name); - if (index >= 0 && currentBone.contains(bone)) { - this.boneMask.splice(index, 1); - } - } - } - else { // Add unrecursive mixing. - for (const bone of armature.getBones()) { - if (bone === currentBone) { - continue; - } - - if (!currentBone.contains(bone)) { - this.boneMask.push(bone.name); - } - } - } - } - } - } } } \ No newline at end of file diff --git a/DragonBones/src/dragonBones/model/AnimationData.ts b/DragonBones/src/dragonBones/model/AnimationData.ts index ae4868b3..a70d275f 100644 --- a/DragonBones/src/dragonBones/model/AnimationData.ts +++ b/DragonBones/src/dragonBones/model/AnimationData.ts @@ -50,6 +50,10 @@ namespace dragonBones { * @internal */ public frameOffset: number; + /** + * @private + */ + public blendType: AnimationBlendType; /** * - The frame count of the animation. * @version DragonBones 3.0 @@ -121,10 +125,6 @@ namespace dragonBones { * @private */ public readonly boneTimelines: Map> = {}; - /** - * @private - */ - public readonly surfaceTimelines: Map> = {}; /** * @private */ @@ -167,14 +167,6 @@ namespace dragonBones { delete this.boneTimelines[k]; } - for (let k in this.surfaceTimelines) { - for (const timeline of this.surfaceTimelines[k]) { - timeline.returnToPool(); - } - - delete this.surfaceTimelines[k]; - } - for (let k in this.slotTimelines) { for (const timeline of this.slotTimelines[k]) { timeline.returnToPool(); @@ -218,6 +210,7 @@ namespace dragonBones { this.frameIntOffset = 0; this.frameFloatOffset = 0; this.frameOffset = 0; + this.blendType = AnimationBlendType.None; this.frameCount = 0; this.playTimes = 0; this.duration = 0.0; @@ -227,7 +220,6 @@ namespace dragonBones { this.name = ""; this.cachedFrames.length = 0; // this.boneTimelines.clear(); - // this.surfaceTimelines.clear(); // this.slotTimelines.clear(); // this.constraintTimelines.clear(); // this.animationTimelines.clear(); @@ -274,17 +266,8 @@ namespace dragonBones { /** * @private */ - public addBoneTimeline(bone: BoneData, timeline: TimelineData): void { - const timelines = bone.name in this.boneTimelines ? this.boneTimelines[bone.name] : (this.boneTimelines[bone.name] = []); - if (timelines.indexOf(timeline) < 0) { - timelines.push(timeline); - } - } - /** - * @private - */ - public addSurfaceTimeline(surface: SurfaceData, timeline: TimelineData): void { - const timelines = surface.name in this.surfaceTimelines ? this.surfaceTimelines[surface.name] : (this.surfaceTimelines[surface.name] = []); + public addBoneTimeline(timelineName: string, timeline: TimelineData): void { + const timelines = timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : (this.boneTimelines[timelineName] = []); if (timelines.indexOf(timeline) < 0) { timelines.push(timeline); } @@ -292,8 +275,8 @@ namespace dragonBones { /** * @private */ - public addSlotTimeline(slot: SlotData, timeline: TimelineData): void { - const timelines = slot.name in this.slotTimelines ? this.slotTimelines[slot.name] : (this.slotTimelines[slot.name] = []); + public addSlotTimeline(timelineName: string, timeline: TimelineData): void { + const timelines = timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : (this.slotTimelines[timelineName] = []); if (timelines.indexOf(timeline) < 0) { timelines.push(timeline); } @@ -301,8 +284,8 @@ namespace dragonBones { /** * @private */ - public addConstraintTimeline(constraint: ConstraintData, timeline: TimelineData): void { - const timelines = constraint.name in this.constraintTimelines ? this.constraintTimelines[constraint.name] : (this.constraintTimelines[constraint.name] = []); + public addConstraintTimeline(timelineName: string, timeline: TimelineData): void { + const timelines = timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : (this.constraintTimelines[timelineName] = []); if (timelines.indexOf(timeline) < 0) { timelines.push(timeline); } @@ -322,12 +305,6 @@ namespace dragonBones { public getBoneTimelines(timelineName: string): Array | null { return timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : null; } - /** - * @private - */ - public getSurfaceTimelines(timelineName: string): Array | null { - return timelineName in this.surfaceTimelines ? this.surfaceTimelines[timelineName] : null; - } /** * @private */ @@ -360,7 +337,7 @@ namespace dragonBones { } } /** - * @internal + * @private */ export class TimelineData extends BaseObject { public static toString(): string { @@ -377,4 +354,22 @@ namespace dragonBones { this.frameIndicesOffset = -1; } } + /** + * @internal + */ + export class AnimationTimelineData extends TimelineData { + public static toString(): string { + return "[class dragonBones.AnimationTimelineData]"; + } + + public x: number; + public y: number; + + protected _onClear(): void { + super._onClear(); + + this.x = 0.0; + this.y = 0.0; + } + } } \ No newline at end of file diff --git a/DragonBones/src/dragonBones/model/ArmatureData.ts b/DragonBones/src/dragonBones/model/ArmatureData.ts index 43391f28..8ed1a4a4 100644 --- a/DragonBones/src/dragonBones/model/ArmatureData.ts +++ b/DragonBones/src/dragonBones/model/ArmatureData.ts @@ -519,6 +519,10 @@ namespace dragonBones { * @language zh_CN */ public length: number; + /** + * @private + */ + public alpha: number; /** * - The bone name. * @version DragonBones 3.0 @@ -561,6 +565,7 @@ namespace dragonBones { this.inheritReflection = false; this.type = BoneType.Bone; this.length = 0.0; + this.alpha = 1.0; this.name = ""; this.transform.identity(); this.userData = null; @@ -574,9 +579,10 @@ namespace dragonBones { public static toString(): string { return "[class dragonBones.SurfaceData]"; } + public segmentX: number; public segmentY: number; - public readonly vertices: Array = []; + public readonly geometry: GeometryData = new GeometryData(); protected _onClear(): void { super._onClear(); @@ -584,7 +590,7 @@ namespace dragonBones { this.type = BoneType.Surface; this.segmentX = 0; this.segmentY = 0; - this.vertices.length = 0; + this.geometry.clear(); } } /** @@ -624,6 +630,14 @@ namespace dragonBones { * @private */ public zOrder: number; + /** + * @private + */ + public zIndex: number; + /** + * @private + */ + public alpha: number; /** * - The slot name. * @version DragonBones 3.0 @@ -663,6 +677,8 @@ namespace dragonBones { this.blendMode = BlendMode.Normal; this.displayIndex = 0; this.zOrder = 0; + this.zIndex = 0; + this.alpha = 1.0; this.name = ""; this.color = null as any; // this.userData = null; diff --git a/DragonBones/src/dragonBones/model/CanvasData.ts b/DragonBones/src/dragonBones/model/CanvasData.ts index 9ee4abd2..6a61a1de 100644 --- a/DragonBones/src/dragonBones/model/CanvasData.ts +++ b/DragonBones/src/dragonBones/model/CanvasData.ts @@ -22,7 +22,7 @@ */ namespace dragonBones { /** - * @internal + * @private */ export class CanvasData extends BaseObject { public static toString(): string { diff --git a/DragonBones/src/dragonBones/model/ConstraintData.ts b/DragonBones/src/dragonBones/model/ConstraintData.ts index 82b417cb..a2f7bf6d 100644 --- a/DragonBones/src/dragonBones/model/ConstraintData.ts +++ b/DragonBones/src/dragonBones/model/ConstraintData.ts @@ -22,7 +22,7 @@ */ namespace dragonBones { /** - * @internal + * @private */ export abstract class ConstraintData extends BaseObject { public order: number; @@ -61,7 +61,6 @@ namespace dragonBones { this.weight = 1.0; } } - /** * @internal */ diff --git a/DragonBones/src/dragonBones/model/DisplayData.ts b/DragonBones/src/dragonBones/model/DisplayData.ts index 79f1c55a..759d9058 100644 --- a/DragonBones/src/dragonBones/model/DisplayData.ts +++ b/DragonBones/src/dragonBones/model/DisplayData.ts @@ -22,9 +22,9 @@ */ namespace dragonBones { /** - * @internal + * @private */ - export class VerticesData { + export class GeometryData { public isShared: boolean; public inheritDeform: boolean; public offset: number; @@ -43,14 +43,24 @@ namespace dragonBones { this.weight = null; } - public shareFrom(value: VerticesData): void { + public shareFrom(value: GeometryData): void { this.isShared = true; this.offset = value.offset; this.weight = value.weight; } + + public get vertexCount(): number { + const intArray = this.data.intArray; + return intArray[this.offset + dragonBones.BinaryOffset.GeometryVertexCount]; + } + + public get triangleCount(): number { + const intArray = this.data.intArray; + return intArray[this.offset + dragonBones.BinaryOffset.GeometryTriangleCount]; + } } /** - * @internal + * @private */ export abstract class DisplayData extends BaseObject { public type: DisplayType; @@ -67,7 +77,7 @@ namespace dragonBones { } } /** - * @internal + * @private */ export class ImageDisplayData extends DisplayData { public static toString(): string { @@ -86,7 +96,7 @@ namespace dragonBones { } } /** - * @internal + * @private */ export class ArmatureDisplayData extends DisplayData { public static toString(): string { @@ -117,26 +127,26 @@ namespace dragonBones { } } /** - * @internal + * @private */ export class MeshDisplayData extends DisplayData { public static toString(): string { return "[class dragonBones.MeshDisplayData]"; } - public readonly vertices: VerticesData = new VerticesData(); + public readonly geometry: GeometryData = new GeometryData(); public texture: TextureData | null; protected _onClear(): void { super._onClear(); this.type = DisplayType.Mesh; - this.vertices.clear(); + this.geometry.clear(); this.texture = null; } } /** - * @internal + * @private */ export class BoundingBoxDisplayData extends DisplayData { public static toString(): string { @@ -157,7 +167,7 @@ namespace dragonBones { } } /** - * @internal + * @private */ export class PathDisplayData extends DisplayData { public static toString(): string { @@ -165,7 +175,7 @@ namespace dragonBones { } public closed: boolean; public constantSpeed: boolean; - public readonly vertices: VerticesData = new VerticesData(); + public readonly geometry: GeometryData = new GeometryData(); public readonly curveLengths: Array = []; protected _onClear(): void { @@ -174,12 +184,12 @@ namespace dragonBones { this.type = DisplayType.Path; this.closed = false; this.constantSpeed = false; - this.vertices.clear(); + this.geometry.clear(); this.curveLengths.length = 0; } } /** - * @internal + * @private */ export class WeightData extends BaseObject { public static toString(): string { diff --git a/DragonBones/src/dragonBones/model/DragonBonesData.ts b/DragonBones/src/dragonBones/model/DragonBonesData.ts index 0f6c510f..fb182498 100644 --- a/DragonBones/src/dragonBones/model/DragonBonesData.ts +++ b/DragonBones/src/dragonBones/model/DragonBonesData.ts @@ -133,6 +133,10 @@ namespace dragonBones { * @internal */ public timelineArray: Uint16Array; + /** + * @internal + */ + public colorArray: Int16Array | Uint16Array; /** * @private */ @@ -164,6 +168,7 @@ namespace dragonBones { this.frameFloatArray = null as any; // this.frameArray = null as any; // this.timelineArray = null as any; // + this.colorArray = null as any; // this.userData = null; } /** @@ -194,20 +199,5 @@ namespace dragonBones { public getArmature(armatureName: string): ArmatureData | null { return armatureName in this.armatures ? this.armatures[armatureName] : null; } - - /** - * - Deprecated, please refer to {@link #dragonBones.BaseFactory#removeDragonBonesData()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #dragonBones.BaseFactory#removeDragonBonesData()}。 - * @deprecated - * @language zh_CN - */ - public dispose(): void { - console.warn("已废弃"); - this.returnToPool(); - } } } \ No newline at end of file diff --git a/DragonBones/src/dragonBones/model/TextureAtlasData.ts b/DragonBones/src/dragonBones/model/TextureAtlasData.ts index 8fb3be86..d675311b 100644 --- a/DragonBones/src/dragonBones/model/TextureAtlasData.ts +++ b/DragonBones/src/dragonBones/model/TextureAtlasData.ts @@ -137,7 +137,7 @@ namespace dragonBones { } } /** - * @internal + * @private */ export abstract class TextureData extends BaseObject { public static createRectangle(): Rectangle { diff --git a/DragonBones/src/dragonBones/model/UserData.ts b/DragonBones/src/dragonBones/model/UserData.ts index 5a868d9e..64ed69b3 100644 --- a/DragonBones/src/dragonBones/model/UserData.ts +++ b/DragonBones/src/dragonBones/model/UserData.ts @@ -133,7 +133,7 @@ namespace dragonBones { } } /** - * @internal + * @private */ export class ActionData extends BaseObject { public static toString(): string { diff --git a/DragonBones/src/dragonBones/modules.ts b/DragonBones/src/dragonBones/modules.ts deleted file mode 100644 index dfe21be5..00000000 --- a/DragonBones/src/dragonBones/modules.ts +++ /dev/null @@ -1,14 +0,0 @@ -namespace dragonBones { - /** - * @internal - * @private - */ - export declare const webAssemblyModule: { - HEAP16: Int16Array; - _malloc(byteSize: number): number; - _free(pointer: number): void; - - // DragonBones embinding. - setDataBinary(data: DragonBonesData, binaryPointer: number, intBytesLength: number, floatBytesLength: number, frameIntBytesLength: number, frameFloatBytesLength: number, frameBytesLength: number, timelineBytesLength: number): void; - }; -} \ No newline at end of file diff --git a/DragonBones/src/dragonBones/parser/BinaryDataParser.ts b/DragonBones/src/dragonBones/parser/BinaryDataParser.ts index 57dcde53..4753bca9 100644 --- a/DragonBones/src/dragonBones/parser/BinaryDataParser.ts +++ b/DragonBones/src/dragonBones/parser/BinaryDataParser.ts @@ -22,15 +22,12 @@ */ namespace dragonBones { /** - * @internal + * @private */ export class BinaryDataParser extends ObjectDataParser { private _binaryOffset: number; private _binary: ArrayBuffer; private _intArrayBuffer: Int16Array; - private _floatArrayBuffer: Float32Array; - private _frameIntArrayBuffer: Int16Array; - private _frameFloatArrayBuffer: Float32Array; private _frameArrayBuffer: Int16Array; private _timelineArrayBuffer: Uint16Array; @@ -141,16 +138,6 @@ namespace dragonBones { return result; } - private _getUTF16Key(value: string): string { - for (let i = 0, l = value.length; i < l; ++i) { - if (value.charCodeAt(i) > 255) { - return encodeURI(value); - } - } - - return value; - } - private _parseBinaryTimeline(type: TimelineType, offset: number, timelineData: TimelineData | null = null): TimelineData { const timeline = timelineData !== null ? timelineData : BaseObject.borrowObject(TimelineData); timeline.type = type; @@ -166,16 +153,8 @@ namespace dragonBones { let frameIndicesOffset = 0; const totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. const frameIndices = this._data.frameIndices; - - if (DragonBones.webAssembly) { - frameIndicesOffset = (frameIndices as any).size(); - (frameIndices as any).resize(frameIndicesOffset + totalFrameCount, 0); - } - else { - frameIndicesOffset = frameIndices.length; - frameIndices.length += totalFrameCount; - } - + frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; timeline.frameIndicesOffset = frameIndicesOffset; for ( @@ -195,12 +174,7 @@ namespace dragonBones { iK++; } - if (DragonBones.webAssembly) { - (frameIndices as any).set(frameIndicesOffset + i, iK - 1); - } - else { - frameIndices[frameIndicesOffset + i] = iK - 1; - } + frameIndices[frameIndicesOffset + i] = iK - 1; } } @@ -209,45 +183,10 @@ namespace dragonBones { return timeline; } - private _parseVertices(rawData: any, vertices: VerticesData): void { - vertices.offset = rawData[DataParser.OFFSET]; - - const weightOffset = this._intArrayBuffer[vertices.offset + BinaryOffset.MeshWeightOffset]; - if (weightOffset >= 0) { - const weight = BaseObject.borrowObject(WeightData); - const vertexCount = this._intArrayBuffer[vertices.offset + BinaryOffset.MeshVertexCount]; - const boneCount = this._intArrayBuffer[weightOffset + BinaryOffset.WeigthBoneCount]; - weight.offset = weightOffset; - - for (let i = 0; i < boneCount; ++i) { - const boneIndex = this._intArrayBuffer[weightOffset + BinaryOffset.WeigthBoneIndices + i]; - weight.addBone(this._rawBones[boneIndex]); - } - - let boneIndicesOffset = weightOffset + BinaryOffset.WeigthBoneIndices + boneCount; - let weightCount = 0; - for (let i = 0, l = vertexCount; i < l; ++i) { - const vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++]; - weightCount += vertexBoneCount; - boneIndicesOffset += vertexBoneCount; - } - - weight.count = weightCount; - vertices.weight = weight; - } - } - - protected _parseMesh(rawData: any, mesh: MeshDisplayData): void { - this._parseVertices(rawData, mesh.vertices); - } - - protected _parsePath(rawData: any, path: PathDisplayData): void { - this._parseVertices(rawData, path.vertices); - } - protected _parseAnimation(rawData: any): AnimationData { const animation = BaseObject.borrowObject(AnimationData); - animation.frameCount = Math.max(ObjectDataParser._getNumber(rawData, DataParser.DURATION, 1), 1); + animation.blendType = DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, DataParser.BLEND_TYPE, "")); + animation.frameCount = ObjectDataParser._getNumber(rawData, DataParser.DURATION, 0); animation.playTimes = ObjectDataParser._getNumber(rawData, DataParser.PLAY_TIMES, 1); animation.duration = animation.frameCount / this._armature.frameRate; // float animation.fadeInTime = ObjectDataParser._getNumber(rawData, DataParser.FADE_IN_TIME, 0.0); @@ -277,10 +216,6 @@ namespace dragonBones { const rawTimeliness = rawData[DataParser.BONE]; for (let k in rawTimeliness) { const rawTimelines = rawTimeliness[k] as Array; - if (DragonBones.webAssembly) { - k = this._getUTF16Key(k); - } - const bone = this._armature.getBone(k); if (bone === null) { continue; @@ -290,29 +225,7 @@ namespace dragonBones { const timelineType = rawTimelines[i]; const timelineOffset = rawTimelines[i + 1]; const timeline = this._parseBinaryTimeline(timelineType, timelineOffset); - this._animation.addBoneTimeline(bone, timeline); - } - } - } - - if (DataParser.SURFACE in rawData) { - const rawTimeliness = rawData[DataParser.SURFACE]; - for (let k in rawTimeliness) { - const rawTimelines = rawTimeliness[k] as Array; - if (DragonBones.webAssembly) { - k = this._getUTF16Key(k); - } - - const surface = this._armature.getBone(k) as SurfaceData; - if (surface === null) { - continue; - } - - for (let i = 0, l = rawTimelines.length; i < l; i += 2) { - const timelineType = rawTimelines[i]; - const timelineOffset = rawTimelines[i + 1]; - const timeline = this._parseBinaryTimeline(timelineType, timelineOffset); - this._animation.addSurfaceTimeline(surface, timeline); + this._animation.addBoneTimeline(bone.name, timeline); } } } @@ -321,10 +234,6 @@ namespace dragonBones { const rawTimeliness = rawData[DataParser.SLOT]; for (let k in rawTimeliness) { const rawTimelines = rawTimeliness[k] as Array; - if (DragonBones.webAssembly) { - k = this._getUTF16Key(k); - } - const slot = this._armature.getSlot(k); if (slot === null) { continue; @@ -334,7 +243,7 @@ namespace dragonBones { const timelineType = rawTimelines[i]; const timelineOffset = rawTimelines[i + 1]; const timeline = this._parseBinaryTimeline(timelineType, timelineOffset); - this._animation.addSlotTimeline(slot, timeline); + this._animation.addSlotTimeline(slot.name, timeline); } } } @@ -343,10 +252,6 @@ namespace dragonBones { const rawTimeliness = rawData[DataParser.CONSTRAINT]; for (let k in rawTimeliness) { const rawTimelines = rawTimeliness[k] as Array; - if (DragonBones.webAssembly) { - k = this._getUTF16Key(k); - } - const constraint = this._armature.getConstraint(k); if (constraint === null) { continue; @@ -356,24 +261,64 @@ namespace dragonBones { const timelineType = rawTimelines[i]; const timelineOffset = rawTimelines[i + 1]; const timeline = this._parseBinaryTimeline(timelineType, timelineOffset); - this._animation.addConstraintTimeline(constraint, timeline); + this._animation.addConstraintTimeline(constraint.name, timeline); } } } - if (DataParser.ANIMATION in rawData) { - const rawTimeliness = rawData[DataParser.ANIMATION]; - for (let k in rawTimeliness) { - const rawTimelines = rawTimeliness[k] as Array; - if (DragonBones.webAssembly) { - k = this._getUTF16Key(k); - } + if (DataParser.TIMELINE in rawData) { + const rawTimelines = rawData[DataParser.TIMELINE] as Array; + for (const rawTimeline of rawTimelines) { + const timelineOffset = ObjectDataParser._getNumber(rawTimeline, DataParser.OFFSET, 0); + if (timelineOffset >= 0) { + const timelineType = ObjectDataParser._getNumber(rawTimeline, DataParser.TYPE, TimelineType.Action); + const timelineName = ObjectDataParser._getString(rawTimeline, DataParser.NAME, ""); + let timeline: TimelineData | null = null; + + if (timelineType === TimelineType.AnimationProgress && animation.blendType !== AnimationBlendType.None) { + timeline = BaseObject.borrowObject(AnimationTimelineData); + const animaitonTimeline = timeline as AnimationTimelineData; + animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, DataParser.X, 0.0); + animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, DataParser.Y, 0.0); + } - for (let i = 0, l = rawTimelines.length; i < l; i += 2) { - const timelineType = rawTimelines[i]; - const timelineOffset = rawTimelines[i + 1]; - const timeline = this._parseBinaryTimeline(timelineType, timelineOffset); - this._animation.addAnimationTimeline(k, timeline); + timeline = this._parseBinaryTimeline(timelineType, timelineOffset, timeline); + + switch (timelineType) { + case TimelineType.Action: + // TODO + break; + + case TimelineType.ZOrder: + // TODO + break; + + case TimelineType.BoneTranslate: + case TimelineType.BoneRotate: + case TimelineType.BoneScale: + case TimelineType.Surface: + case TimelineType.BoneAlpha: + this._animation.addBoneTimeline(timelineName, timeline); + break; + + case TimelineType.SlotDisplay: + case TimelineType.SlotColor: + case TimelineType.SlotDeform: + case TimelineType.SlotZIndex: + case TimelineType.SlotAlpha: + this._animation.addSlotTimeline(timelineName, timeline); + break; + + case TimelineType.IKConstraint: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + + case TimelineType.AnimationProgress: + case TimelineType.AnimationWeight: + case TimelineType.AnimationParameter: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } } } } @@ -383,6 +328,42 @@ namespace dragonBones { return animation; } + protected _parseGeometry(rawData: any, geometry: GeometryData): void { + geometry.offset = rawData[DataParser.OFFSET]; + geometry.data = this._data; + + let weightOffset = this._intArrayBuffer[geometry.offset + BinaryOffset.GeometryWeightOffset]; + + if (weightOffset < -1) { // -1 is a special flag that there is no bones weight. + weightOffset += 65536; // Fixed out of bounds bug. + } + + if (weightOffset >= 0) { + const weight = BaseObject.borrowObject(WeightData); + const vertexCount = this._intArrayBuffer[geometry.offset + BinaryOffset.GeometryVertexCount]; + const boneCount = this._intArrayBuffer[weightOffset + BinaryOffset.WeigthBoneCount]; + + weight.offset = weightOffset; + + for (let i = 0; i < boneCount; ++i) { + const boneIndex = this._intArrayBuffer[weightOffset + BinaryOffset.WeigthBoneIndices + i]; + weight.addBone(this._rawBones[boneIndex]); + } + + let boneIndicesOffset = weightOffset + BinaryOffset.WeigthBoneIndices + boneCount; + let weightCount = 0; + + for (let i = 0, l = vertexCount; i < l; ++i) { + const vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++]; + weightCount += vertexBoneCount; + boneIndicesOffset += vertexBoneCount; + } + + weight.count = weightCount; + geometry.weight = weight; + } + } + protected _parseArray(rawData: any): void { const offsets = rawData[DataParser.OFFSET] as Array; const l1 = offsets[1]; @@ -391,41 +372,23 @@ namespace dragonBones { const l4 = offsets[7]; const l5 = offsets[9]; const l6 = offsets[11]; + const l7 = offsets.length > 12 ? offsets[13] : 0; // Color. const intArray = new Int16Array(this._binary, this._binaryOffset + offsets[0], l1 / Int16Array.BYTES_PER_ELEMENT); const floatArray = new Float32Array(this._binary, this._binaryOffset + offsets[2], l2 / Float32Array.BYTES_PER_ELEMENT); const frameIntArray = new Int16Array(this._binary, this._binaryOffset + offsets[4], l3 / Int16Array.BYTES_PER_ELEMENT); const frameFloatArray = new Float32Array(this._binary, this._binaryOffset + offsets[6], l4 / Float32Array.BYTES_PER_ELEMENT); const frameArray = new Int16Array(this._binary, this._binaryOffset + offsets[8], l5 / Int16Array.BYTES_PER_ELEMENT); const timelineArray = new Uint16Array(this._binary, this._binaryOffset + offsets[10], l6 / Uint16Array.BYTES_PER_ELEMENT); - - if (DragonBones.webAssembly) { - const lTotal = l1 + l2 + l3 + l4 + l5 + l6; - const bufferPointer = webAssemblyModule._malloc(lTotal); - const rawArray = new Uint8Array(this._binary, this._binaryOffset, lTotal / Uint8Array.BYTES_PER_ELEMENT); - const copyArray = new Uint8Array(webAssemblyModule.HEAP16.buffer, bufferPointer, rawArray.length); - - for (let i = 0, l = rawArray.length; i < l; ++i) { - copyArray[i] = rawArray[i]; - } - - webAssemblyModule.setDataBinary(this._data, bufferPointer, l1, l2, l3, l4, l5, l6); - - this._intArrayBuffer = intArray; - this._floatArrayBuffer = floatArray; - this._frameIntArrayBuffer = frameIntArray; - this._frameFloatArrayBuffer = frameFloatArray; - this._frameArrayBuffer = frameArray; - this._timelineArrayBuffer = timelineArray; - } - else { - this._data.binary = this._binary; - this._data.intArray = this._intArrayBuffer = intArray; - this._data.floatArray = this._floatArrayBuffer = floatArray; - this._data.frameIntArray = this._frameIntArrayBuffer = frameIntArray; - this._data.frameFloatArray = this._frameFloatArrayBuffer = frameFloatArray; - this._data.frameArray = this._frameArrayBuffer = frameArray; - this._data.timelineArray = this._timelineArrayBuffer = timelineArray; - } + const colorArray = l7 > 0 ? new Int16Array(this._binary, this._binaryOffset + offsets[12], l7 / Uint16Array.BYTES_PER_ELEMENT) : intArray; // Color. + + this._data.binary = this._binary; + this._data.intArray = this._intArrayBuffer = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = this._frameArrayBuffer = frameArray; + this._data.timelineArray = this._timelineArrayBuffer = timelineArray; + this._data.colorArray = colorArray; } public parseDragonBonesData(rawData: any, scale: number = 1): DragonBonesData | null { diff --git a/DragonBones/src/dragonBones/parser/DataParser.ts b/DragonBones/src/dragonBones/parser/DataParser.ts index 043294df..6901102e 100644 --- a/DragonBones/src/dragonBones/parser/DataParser.ts +++ b/DragonBones/src/dragonBones/parser/DataParser.ts @@ -22,7 +22,7 @@ */ namespace dragonBones { /** - * @internal + * @private */ export abstract class DataParser { protected static readonly DATA_VERSION_2_3: string = "2.3"; @@ -31,13 +31,15 @@ namespace dragonBones { protected static readonly DATA_VERSION_4_5: string = "4.5"; protected static readonly DATA_VERSION_5_0: string = "5.0"; protected static readonly DATA_VERSION_5_5: string = "5.5"; - protected static readonly DATA_VERSION: string = DataParser.DATA_VERSION_5_5; + protected static readonly DATA_VERSION_5_6: string = "5.6"; + protected static readonly DATA_VERSION: string = DataParser.DATA_VERSION_5_6; protected static readonly DATA_VERSIONS: Array = [ DataParser.DATA_VERSION_4_0, DataParser.DATA_VERSION_4_5, DataParser.DATA_VERSION_5_0, - DataParser.DATA_VERSION_5_5 + DataParser.DATA_VERSION_5_5, + DataParser.DATA_VERSION_5_6 ]; protected static readonly TEXTURE_ATLAS: string = "textureAtlas"; @@ -55,19 +57,20 @@ namespace dragonBones { protected static readonly DRADON_BONES: string = "dragonBones"; protected static readonly USER_DATA: string = "userData"; protected static readonly ARMATURE: string = "armature"; + protected static readonly CANVAS: string = "canvas"; protected static readonly BONE: string = "bone"; protected static readonly SURFACE: string = "surface"; protected static readonly SLOT: string = "slot"; protected static readonly CONSTRAINT: string = "constraint"; + protected static readonly SKIN: string = "skin"; + protected static readonly DISPLAY: string = "display"; + protected static readonly FRAME: string = "frame"; protected static readonly IK: string = "ik"; protected static readonly PATH_CONSTRAINT: string = "path"; - protected static readonly SKIN: string = "skin"; - protected static readonly DISPLAY: string = "display"; protected static readonly ANIMATION: string = "animation"; - protected static readonly Z_ORDER: string = "zOrder"; + protected static readonly TIMELINE: string = "timeline"; protected static readonly FFD: string = "ffd"; - protected static readonly FRAME: string = "frame"; protected static readonly TRANSLATE_FRAME: string = "translateFrame"; protected static readonly ROTATE_FRAME: string = "rotateFrame"; protected static readonly SCALE_FRAME: string = "scaleFrame"; @@ -76,10 +79,10 @@ namespace dragonBones { protected static readonly DEFAULT_ACTIONS: string = "defaultActions"; protected static readonly ACTIONS: string = "actions"; protected static readonly EVENTS: string = "events"; + protected static readonly INTS: string = "ints"; protected static readonly FLOATS: string = "floats"; protected static readonly STRINGS: string = "strings"; - protected static readonly CANVAS: string = "canvas"; protected static readonly TRANSFORM: string = "transform"; protected static readonly PIVOT: string = "pivot"; @@ -99,6 +102,8 @@ namespace dragonBones { protected static readonly PATH: string = "path"; protected static readonly LENGTH: string = "length"; protected static readonly DISPLAY_INDEX: string = "displayIndex"; + protected static readonly Z_ORDER: string = "zOrder"; + protected static readonly Z_INDEX: string = "zIndex"; protected static readonly BLEND_MODE: string = "blendMode"; protected static readonly INHERIT_TRANSLATION: string = "inheritTranslation"; protected static readonly INHERIT_ROTATION: string = "inheritRotation"; @@ -112,6 +117,7 @@ namespace dragonBones { protected static readonly CHAIN: string = "chain"; protected static readonly WEIGHT: string = "weight"; + protected static readonly BLEND_TYPE: string = "blendType"; protected static readonly FADE_IN_TIME: string = "fadeInTime"; protected static readonly PLAY_TIMES: string = "playTimes"; protected static readonly SCALE: string = "scale"; @@ -136,6 +142,7 @@ namespace dragonBones { protected static readonly VALUE: string = "value"; protected static readonly ROTATE: string = "rotate"; protected static readonly SKEW: string = "skew"; + protected static readonly ALPHA: string = "alpha"; protected static readonly ALPHA_OFFSET: string = "aO"; protected static readonly RED_OFFSET: string = "rO"; @@ -152,8 +159,6 @@ namespace dragonBones { protected static readonly WEIGHTS: string = "weights"; protected static readonly SLOT_POSE: string = "slotPose"; protected static readonly BONE_POSE: string = "bonePose"; - protected static readonly GLUE_WEIGHTS: string = "glueWeights"; - protected static readonly GLUE_MESHES: string = "glueMeshes"; protected static readonly BONES: string = "bones"; protected static readonly POSITION_MODE: string = "positionMode"; @@ -164,7 +169,7 @@ namespace dragonBones { protected static readonly ROTATE_MIX: string = "rotateMix"; protected static readonly TRANSLATE_MIX: string = "translateMix"; - protected static readonly TARGET_DISPLAY : string = "targetDisplay"; + protected static readonly TARGET_DISPLAY: string = "targetDisplay"; protected static readonly CLOSED: string = "closed"; protected static readonly CONSTANT_SPEED: string = "constantSpeed"; protected static readonly VERTEX_COUNT: string = "vertexCount"; @@ -203,6 +208,51 @@ namespace dragonBones { } } + protected static _getPositionMode(value: string): PositionMode { + switch (value.toLocaleLowerCase()) { + case "percent": + return PositionMode.Percent; + + case "fixed": + return PositionMode.Fixed; + + default: + return PositionMode.Percent; + } + } + + protected static _getSpacingMode(value: string): SpacingMode { + switch (value.toLocaleLowerCase()) { + case "length": + return SpacingMode.Length; + + case "percent": + return SpacingMode.Percent; + + case "fixed": + return SpacingMode.Fixed; + + default: + return SpacingMode.Length; + } + } + + protected static _getRotateMode(value: string): RotateMode { + switch (value.toLocaleLowerCase()) { + case "tangent": + return RotateMode.Tangent; + + case "chain": + return RotateMode.Chain; + + case "chainscale": + return RotateMode.ChainScale; + + default: + return RotateMode.Tangent; + } + } + protected static _getDisplayType(value: string): DisplayType { switch (value.toLowerCase()) { case "image": @@ -241,22 +291,6 @@ namespace dragonBones { } } - protected static _getActionType(value: string): ActionType { - switch (value.toLowerCase()) { - case "play": - return ActionType.Play; - - case "frame": - return ActionType.Frame; - - case "sound": - return ActionType.Sound; - - default: - return ActionType.Play; - } - } - protected static _getBlendMode(value: string): BlendMode { switch (value.toLowerCase()) { case "normal": @@ -306,106 +340,36 @@ namespace dragonBones { } } - protected static _getPositionMode(value: string): PositionMode { - switch (value.toLocaleLowerCase()) { - case "percent": - return PositionMode.Percent; + protected static _getAnimationBlendType(value: string): AnimationBlendType { + switch (value.toLowerCase()) { + case "none": + return AnimationBlendType.None; - case "fixed": - return PositionMode.Fixed; + case "1d": + return AnimationBlendType.E1D; default: - return PositionMode.Percent; + return AnimationBlendType.None; } } - protected static _getSpacingMode(value: string): SpacingMode { - switch (value.toLocaleLowerCase()) { - case "length": - return SpacingMode.Length; - case "percent": - return SpacingMode.Percent; - case "fixed": - return SpacingMode.Fixed; - default: - return SpacingMode.Length; - } - } + protected static _getActionType(value: string): ActionType { + switch (value.toLowerCase()) { + case "play": + return ActionType.Play; + + case "frame": + return ActionType.Frame; + + case "sound": + return ActionType.Sound; - protected static _getRotateMode(value: string): RotateMode { - switch (value.toLocaleLowerCase()) { - case "tangent": - return RotateMode.Tangent; - case "chain": - return RotateMode.Chain; - case "chainscale": - return RotateMode.ChainScale; default: - return RotateMode.Tangent; + return ActionType.Play; } } public abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null; public abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean; - - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。 - * @deprecated - * @language zh_CN - */ - public static parseDragonBonesData(rawData: any): DragonBonesData | null { - console.warn("Deprecated."); - if (rawData instanceof ArrayBuffer) { - return BinaryDataParser.getInstance().parseDragonBonesData(rawData); - } - else { - return ObjectDataParser.getInstance().parseDragonBonesData(rawData); - } - } - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。 - * @deprecated - * @language zh_CN - */ - public static parseTextureAtlasData(rawData: any, scale: number = 1): any { - console.warn("已废弃"); - - const textureAtlasData = {} as any; - - const subTextureList = rawData[DataParser.SUB_TEXTURE]; - for (let i = 0, len = subTextureList.length; i < len; i++) { - const subTextureObject = subTextureList[i]; - const subTextureName = subTextureObject[DataParser.NAME]; - const subTextureRegion = new Rectangle(); - let subTextureFrame: Rectangle | null = null; - - subTextureRegion.x = subTextureObject[DataParser.X] / scale; - subTextureRegion.y = subTextureObject[DataParser.Y] / scale; - subTextureRegion.width = subTextureObject[DataParser.WIDTH] / scale; - subTextureRegion.height = subTextureObject[DataParser.HEIGHT] / scale; - - if (DataParser.FRAME_WIDTH in subTextureObject) { - subTextureFrame = new Rectangle(); - subTextureFrame.x = subTextureObject[DataParser.FRAME_X] / scale; - subTextureFrame.y = subTextureObject[DataParser.FRAME_Y] / scale; - subTextureFrame.width = subTextureObject[DataParser.FRAME_WIDTH] / scale; - subTextureFrame.height = subTextureObject[DataParser.FRAME_HEIGHT] / scale; - } - - textureAtlasData[subTextureName] = { region: subTextureRegion, frame: subTextureFrame, rotated: false }; - } - - return textureAtlasData; - } } } diff --git a/DragonBones/src/dragonBones/parser/ObjectDataParser.ts b/DragonBones/src/dragonBones/parser/ObjectDataParser.ts index b07e323e..c4e6e35c 100644 --- a/DragonBones/src/dragonBones/parser/ObjectDataParser.ts +++ b/DragonBones/src/dragonBones/parser/ObjectDataParser.ts @@ -22,13 +22,22 @@ */ namespace dragonBones { /** - * @internal + * @private + */ + export const enum FrameValueType { + Step, + Int, + Float, + } + /** + * @private */ export class ObjectDataParser extends DataParser { protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean { if (key in rawData) { const value = rawData[key]; const type = typeof value; + if (type === "boolean") { return value; } @@ -71,15 +80,8 @@ namespace dragonBones { if (key in rawData) { const value = rawData[key]; const type = typeof value; - if (type === "string") { - if (DragonBones.webAssembly) { - for (let i = 0, l = (value as string).length; i < l; ++i) { - if ((value as string).charCodeAt(i) > 255) { - return encodeURI(value); - } - } - } + if (type === "string") { return value; } @@ -94,7 +96,7 @@ namespace dragonBones { protected _data: DragonBonesData = null as any; // protected _armature: ArmatureData = null as any; // protected _bone: BoneData = null as any; // - protected _surface: SurfaceData = null as any; // + protected _geometry: GeometryData = null as any; // protected _slot: SlotData = null as any; // protected _skin: SkinData = null as any; // protected _mesh: MeshDisplayData = null as any; // @@ -102,9 +104,12 @@ namespace dragonBones { protected _timeline: TimelineData = null as any; // protected _rawTextureAtlases: Array | null = null; + private _frameValueType: FrameValueType = FrameValueType.Step; private _defaultColorOffset: number = -1; private _prevClockwise: number = 0; private _prevRotation: number = 0.0; + private _frameDefaultValue: number = 0.0; + private _frameValueScale: number = 1.0; private readonly _helpMatrixA: Matrix = new Matrix(); private readonly _helpMatrixB: Matrix = new Matrix(); private readonly _helpTransform: Transform = new Transform(); @@ -117,6 +122,7 @@ namespace dragonBones { private readonly _frameFloatArray: Array = []; private readonly _frameArray: Array = []; private readonly _timelineArray: Array = []; + private readonly _colorArray: Array = []; private readonly _cacheRawMeshes: Array = []; private readonly _cacheMeshes: Array = []; private readonly _actionFrames: Array = []; @@ -138,39 +144,79 @@ namespace dragonBones { result.y = kA * y1 + kB * y2 + kC * y3 + kD * y4; } - private _samplingEasingCurve(curve: Array, samples: Array): void { + private _samplingEasingCurve(curve: Array, samples: Array): boolean { const curveCount = curve.length; - let stepIndex = -2; - for (let i = 0, l = samples.length; i < l; ++i) { - let t = (i + 1) / (l + 1); // float - while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) { // stepIndex + 3 * 2 - stepIndex += 6; - } - - const isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount; - const x1 = isInCurve ? curve[stepIndex] : 0.0; - const y1 = isInCurve ? curve[stepIndex + 1] : 0.0; - const x2 = curve[stepIndex + 2]; - const y2 = curve[stepIndex + 3]; - const x3 = curve[stepIndex + 4]; - const y3 = curve[stepIndex + 5]; - const x4 = isInCurve ? curve[stepIndex + 6] : 1.0; - const y4 = isInCurve ? curve[stepIndex + 7] : 1.0; - - let lower = 0.0; - let higher = 1.0; - while (higher - lower > 0.0001) { - const percentage = (higher + lower) * 0.5; - this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); - if (t - this._helpPoint.x > 0.0) { - lower = percentage; + + if (curveCount % 3 === 1) { + let stepIndex = -2; + for (let i = 0, l = samples.length; i < l; ++i) { + let t = (i + 1) / (l + 1); // float + while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) { // stepIndex + 3 * 2 + stepIndex += 6; + } + + const isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount; + const x1 = isInCurve ? curve[stepIndex] : 0.0; + const y1 = isInCurve ? curve[stepIndex + 1] : 0.0; + const x2 = curve[stepIndex + 2]; + const y2 = curve[stepIndex + 3]; + const x3 = curve[stepIndex + 4]; + const y3 = curve[stepIndex + 5]; + const x4 = isInCurve ? curve[stepIndex + 6] : 1.0; + const y4 = isInCurve ? curve[stepIndex + 7] : 1.0; + + let lower = 0.0; + let higher = 1.0; + while (higher - lower > 0.0001) { + const percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } } - else { - higher = percentage; + + samples[i] = this._helpPoint.y; + } + + return true; + } + else { + let stepIndex = 0; + for (let i = 0, l = samples.length; i < l; ++i) { + let t = (i + 1) / (l + 1); // float + while (curve[stepIndex + 6] < t) { // stepIndex + 3 * 2 + stepIndex += 6; + } + + const x1 = curve[stepIndex]; + const y1 = curve[stepIndex + 1]; + const x2 = curve[stepIndex + 2]; + const y2 = curve[stepIndex + 3]; + const x3 = curve[stepIndex + 4]; + const y3 = curve[stepIndex + 5]; + const x4 = curve[stepIndex + 6]; + const y4 = curve[stepIndex + 7]; + + let lower = 0.0; + let higher = 1.0; + while (higher - lower > 0.0001) { + const percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } } + + samples[i] = this._helpPoint.y; } - samples[i] = this._helpPoint.y; + return false; } } @@ -197,7 +243,7 @@ namespace dragonBones { } private _mergeActionFrame(rawData: any, frameStart: number, type: ActionType, bone: BoneData | null, slot: SlotData | null): void { - const actionOffset = DragonBones.webAssembly ? (this._armature.actions as any).size() : this._armature.actions.length; + const actionOffset = this._armature.actions.length; const actions = this._parseActionData(rawData, type, bone, slot); let frameIndex = 0; let frame: ActionFrame | null = null; @@ -228,7 +274,7 @@ namespace dragonBones { if (frame === null) { // Create and cache frame. frame = new ActionFrame(); frame.frameStart = frameStart; - this._actionFrames.splice(frameIndex + 1, 0, frame); + this._actionFrames.splice(frameIndex, 0, frame); } for (let i = 0; i < actions.length; ++i) { // Cache action offsets. @@ -352,15 +398,6 @@ namespace dragonBones { } } - for (let i = 0, l = this._cacheRawMeshes.length; i < l; ++i) { // Link glue mesh. - const rawMeshData = this._cacheRawMeshes[i]; - if (!(DataParser.GLUE_WEIGHTS in rawMeshData) || !(DataParser.GLUE_MESHES in rawMeshData)) { - continue; - } - - this._parseMeshGlue(rawMeshData, this._cacheMeshes[i]); - } - for (let i = 0, l = this._cacheRawMeshes.length; i < l; ++i) { // Link mesh. const rawData = this._cacheRawMeshes[i]; const shareName = ObjectDataParser._getString(rawData, DataParser.SHARE, ""); @@ -379,7 +416,7 @@ namespace dragonBones { } const mesh = this._cacheMeshes[i]; - mesh.vertices.shareFrom(shareMesh.vertices); + mesh.geometry.shareFrom(shareMesh.geometry); } if (DataParser.ANIMATION in rawData) { @@ -406,7 +443,6 @@ namespace dragonBones { if (DataParser.ACTIONS in rawData) { const actions = this._parseActionData(rawData[DataParser.ACTIONS], ActionType.Play, null, null); - for (const action of actions) { armature.addAction(action, false); } @@ -436,7 +472,6 @@ namespace dragonBones { protected _parseBone(rawData: any): BoneData { let type: BoneType = BoneType.Bone; - const scale = this._armature.scale; if (DataParser.TYPE in rawData && typeof rawData[DataParser.TYPE] === "string") { type = DataParser._getBoneType(rawData[DataParser.TYPE]); @@ -446,12 +481,14 @@ namespace dragonBones { } if (type === BoneType.Bone) { + const scale = this._armature.scale; const bone = BaseObject.borrowObject(BoneData); bone.inheritTranslation = ObjectDataParser._getBoolean(rawData, DataParser.INHERIT_TRANSLATION, true); bone.inheritRotation = ObjectDataParser._getBoolean(rawData, DataParser.INHERIT_ROTATION, true); bone.inheritScale = ObjectDataParser._getBoolean(rawData, DataParser.INHERIT_SCALE, true); bone.inheritReflection = ObjectDataParser._getBoolean(rawData, DataParser.INHERIT_REFLECTION, true); bone.length = ObjectDataParser._getNumber(rawData, DataParser.LENGTH, 0) * scale; + bone.alpha = ObjectDataParser._getNumber(rawData, DataParser.ALPHA, 1.0); bone.name = ObjectDataParser._getString(rawData, DataParser.NAME, ""); if (DataParser.TRANSFORM in rawData) { @@ -462,23 +499,11 @@ namespace dragonBones { } const surface = BaseObject.borrowObject(SurfaceData); + surface.alpha = ObjectDataParser._getNumber(rawData, DataParser.ALPHA, 1.0); surface.name = ObjectDataParser._getString(rawData, DataParser.NAME, ""); surface.segmentX = ObjectDataParser._getNumber(rawData, DataParser.SEGMENT_X, 0); surface.segmentY = ObjectDataParser._getNumber(rawData, DataParser.SEGMENT_Y, 0); - surface.vertices.length = (surface.segmentX + 1) * (surface.segmentY + 1) * 2; - - if (DataParser.VERTICES in rawData) { - const rawVertices = rawData[DataParser.VERTICES] as Array; - - for (let i = 0, l = surface.vertices.length; i < l; ++i) { - if (i < rawVertices.length) { - surface.vertices[i] = rawVertices[i] * scale; - } - else { - surface.vertices[i] = 0.0; - } - } - } + this._parseGeometry(rawData, surface.geometry); return surface; } @@ -494,6 +519,7 @@ namespace dragonBones { return null; } + const chain = ObjectDataParser._getNumber(rawData, DataParser.CHAIN, 0); const constraint = BaseObject.borrowObject(IKConstraintData); constraint.scaleEnabled = ObjectDataParser._getBoolean(rawData, DataParser.SCALE, false); constraint.bendPositive = ObjectDataParser._getBoolean(rawData, DataParser.BEND_POSITIVE, true); @@ -502,7 +528,6 @@ namespace dragonBones { constraint.type = ConstraintType.IK; constraint.target = target; - const chain = ObjectDataParser._getNumber(rawData, DataParser.CHAIN, 0); if (chain > 0 && bone.parent !== null) { constraint.root = bone.parent; constraint.bone = bone; @@ -516,7 +541,6 @@ namespace dragonBones { } protected _parsePathConstraint(rawData: any): ConstraintData | null { - const target = this._armature.getSlot(ObjectDataParser._getString(rawData, DataParser.TARGET, "")); if (target === null) { return null; @@ -526,7 +550,6 @@ namespace dragonBones { if (defaultSkin === null) { return null; } - //TODO const targetDisplay = defaultSkin.getDisplay(target.name, ObjectDataParser._getString(rawData, DataParser.TARGET_DISPLAY, target.name)); if (targetDisplay === null || !(targetDisplay instanceof PathDisplayData)) { @@ -552,7 +575,6 @@ namespace dragonBones { constraint.rotateOffset = ObjectDataParser._getNumber(rawData, DataParser.ROTATE_OFFSET, 0); constraint.rotateMix = ObjectDataParser._getNumber(rawData, DataParser.ROTATE_MIX, 1); constraint.translateMix = ObjectDataParser._getNumber(rawData, DataParser.TRANSLATE_MIX, 1); - // for (var boneName of bones) { const bone = this._armature.getBone(boneName); @@ -572,6 +594,8 @@ namespace dragonBones { const slot = BaseObject.borrowObject(SlotData); slot.displayIndex = ObjectDataParser._getNumber(rawData, DataParser.DISPLAY_INDEX, 0); slot.zOrder = zOrder; + slot.zIndex = ObjectDataParser._getNumber(rawData, DataParser.Z_INDEX, 0); + slot.alpha = ObjectDataParser._getNumber(rawData, DataParser.ALPHA, 1.0); slot.name = ObjectDataParser._getString(rawData, DataParser.NAME, ""); slot.parent = this._armature.getBone(ObjectDataParser._getString(rawData, DataParser.PARENT, "")) as any; // @@ -600,6 +624,7 @@ namespace dragonBones { protected _parseSkin(rawData: any): SkinData { const skin = BaseObject.borrowObject(SkinData); skin.name = ObjectDataParser._getString(rawData, DataParser.NAME, DataParser.DEFAULT_NAME); + if (skin.name.length === 0) { skin.name = DataParser.DEFAULT_NAME; } @@ -611,6 +636,7 @@ namespace dragonBones { for (const rawSlot of rawSlots) { const slotName = ObjectDataParser._getString(rawSlot, DataParser.NAME, ""); const slot = this._armature.getSlot(slotName); + if (slot !== null) { this._slot = slot; @@ -650,14 +676,15 @@ namespace dragonBones { } switch (type) { - case DisplayType.Image: + case DisplayType.Image: { const imageDisplay = display = BaseObject.borrowObject(ImageDisplayData); imageDisplay.name = name; imageDisplay.path = path.length > 0 ? path : name; this._parsePivot(rawData, imageDisplay); break; + } - case DisplayType.Armature: + case DisplayType.Armature: { const armatureDisplay = display = BaseObject.borrowObject(ArmatureDisplayData); armatureDisplay.name = name; armatureDisplay.path = path.length > 0 ? path : name; @@ -665,7 +692,6 @@ namespace dragonBones { if (DataParser.ACTIONS in rawData) { const actions = this._parseActionData(rawData[DataParser.ACTIONS], ActionType.Play, null, null); - for (const action of actions) { armatureDisplay.addAction(action); } @@ -681,29 +707,26 @@ namespace dragonBones { } } break; + } - case DisplayType.Mesh: + case DisplayType.Mesh: { const meshDisplay = display = BaseObject.borrowObject(MeshDisplayData); - meshDisplay.vertices.inheritDeform = ObjectDataParser._getBoolean(rawData, DataParser.INHERIT_DEFORM, true); + meshDisplay.geometry.inheritDeform = ObjectDataParser._getBoolean(rawData, DataParser.INHERIT_DEFORM, true); meshDisplay.name = name; meshDisplay.path = path.length > 0 ? path : name; - meshDisplay.vertices.data = this._data; if (DataParser.SHARE in rawData) { + meshDisplay.geometry.data = this._data; this._cacheRawMeshes.push(rawData); this._cacheMeshes.push(meshDisplay); } else { this._parseMesh(rawData, meshDisplay); } - - if ((DataParser.GLUE_WEIGHTS in rawData) && (DataParser.GLUE_MESHES in rawData)) { - this._cacheRawMeshes.push(rawData); - this._cacheMeshes.push(meshDisplay); - } break; + } - case DisplayType.BoundingBox: + case DisplayType.BoundingBox: { const boundingBox = this._parseBoundingBox(rawData); if (boundingBox !== null) { const boundingBoxDisplay = display = BaseObject.borrowObject(BoundingBoxDisplayData); @@ -712,22 +735,24 @@ namespace dragonBones { boundingBoxDisplay.boundingBox = boundingBox; } break; - case DisplayType.Path: + } + + case DisplayType.Path: { const rawCurveLengths = rawData[DataParser.LENGTHS] as Array; const pathDisplay = display = BaseObject.borrowObject(PathDisplayData); pathDisplay.closed = ObjectDataParser._getBoolean(rawData, DataParser.CLOSED, false); pathDisplay.constantSpeed = ObjectDataParser._getBoolean(rawData, DataParser.CONSTANT_SPEED, false); pathDisplay.name = name; pathDisplay.path = path.length > 0 ? path : name; - pathDisplay.vertices.data = this._data; - pathDisplay.curveLengths.length = rawCurveLengths.length; + for (let i = 0, l = rawCurveLengths.length; i < l; ++i) { pathDisplay.curveLengths[i] = rawCurveLengths[i]; } this._parsePath(rawData, pathDisplay); break; + } } if (display !== null && DataParser.TRANSFORM in rawData) { @@ -738,67 +763,7 @@ namespace dragonBones { } protected _parsePath(rawData: any, display: PathDisplayData) { - const rawVertices = rawData[DataParser.VERTICES] as Array; - const vertexCount = ObjectDataParser._getNumber(rawData, DataParser.VERTEX_COUNT, 0); // uint - const vertexOffset = this._floatArray.length; - - const pathOffset = this._intArray.length; - display.vertices.offset = pathOffset; - - this._intArray.length += 1 + 1; - this._intArray[pathOffset + BinaryOffset.PathVertexCount] = vertexCount; - this._intArray[pathOffset + BinaryOffset.PathFloatOffset] = vertexOffset; - - if (!(DataParser.WEIGHTS in rawData)) { - this._floatArray.length += rawVertices.length; - for (let i = 0, l = rawVertices.length; i < l; ++i) { - this._floatArray[vertexOffset + i] = rawVertices[i]; - } - } - else { - const rawWeights = rawData[DataParser.WEIGHTS] as Array; - const rawBones = rawData[DataParser.BONES] as Array; - const weightBoneCount = rawBones.length; - const weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint - const weightOffset = this._intArray.length; - const floatOffset = this._floatArray.length; - - const sortedBones = this._armature.sortedBones; - const weight = BaseObject.borrowObject(WeightData); - weight.count = weightCount; - weight.offset = weightOffset; - - this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount; - // - this._intArray[weightOffset + BinaryOffset.WeigthBoneCount] = weightBoneCount; - this._intArray[weightOffset + BinaryOffset.WeigthFloatOffset] = floatOffset; - for (let i = 0; i < weightBoneCount; i++) { - const rawBoneIndex = rawBones[i]; - const bone = this._rawBones[rawBoneIndex]; - weight.addBone(bone); - this._intArray[weightOffset + BinaryOffset.WeigthBoneIndices + i] = sortedBones.indexOf(bone); - } - - this._floatArray.length += weightCount * 3; - for (let i = 0, iW = 0, iV = 0, iB = weightOffset + BinaryOffset.WeigthBoneIndices + weightBoneCount, iF = floatOffset; i < weightCount; i++) { - const boneCount = rawWeights[iW++]; - this._intArray[iB++] = boneCount; - - for (let j = 0; j < boneCount; j++) { - const boneIndex = rawWeights[iW++]; - const boneWeight = rawWeights[iW++]; - const x = rawVertices[iV++]; - const y = rawVertices[iV++]; - - this._intArray[iB++] = rawBones.indexOf(boneIndex); - this._floatArray[iF++] = boneWeight; - this._floatArray[iF++] = x; - this._floatArray[iF++] = y; - } - } - - display.vertices.weight = weight; - } + this._parseGeometry(rawData, display.geometry); } protected _parsePivot(rawData: any, display: ImageDisplayData): void { @@ -814,110 +779,17 @@ namespace dragonBones { } protected _parseMesh(rawData: any, mesh: MeshDisplayData): void { - const rawVertices = rawData[DataParser.VERTICES] as Array; - const rawUVs = rawData[DataParser.UVS] as Array; - const rawTriangles = rawData[DataParser.TRIANGLES] as Array; - const vertexCount = Math.floor(rawVertices.length / 2); // uint - const triangleCount = Math.floor(rawTriangles.length / 3); // uint - const vertexOffset = this._floatArray.length; - const uvOffset = vertexOffset + vertexCount * 2; - const meshOffset = this._intArray.length; - const meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; // Cache pose data. - - mesh.vertices.offset = meshOffset; - this._intArray.length += 1 + 1 + 1 + 1 + triangleCount * 3; - this._intArray[meshOffset + BinaryOffset.MeshVertexCount] = vertexCount; - this._intArray[meshOffset + BinaryOffset.MeshTriangleCount] = triangleCount; - this._intArray[meshOffset + BinaryOffset.MeshFloatOffset] = vertexOffset; - for (let i = 0, l = triangleCount * 3; i < l; ++i) { - this._intArray[meshOffset + BinaryOffset.MeshVertexIndices + i] = rawTriangles[i]; - } - - this._floatArray.length += vertexCount * 2 + vertexCount * 2; - for (let i = 0, l = vertexCount * 2; i < l; ++i) { - this._floatArray[vertexOffset + i] = rawVertices[i]; - this._floatArray[uvOffset + i] = rawUVs[i]; - } + this._parseGeometry(rawData, mesh.geometry); - if (DataParser.WEIGHTS in rawData) { - const rawWeights = rawData[DataParser.WEIGHTS] as Array; + if (DataParser.WEIGHTS in rawData) { // Cache pose data. const rawSlotPose = rawData[DataParser.SLOT_POSE] as Array; const rawBonePoses = rawData[DataParser.BONE_POSE] as Array; - const sortedBones = this._armature.sortedBones; - const weightBoneIndices = new Array(); - const weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint - const floatOffset = this._floatArray.length; - const weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint - const weightOffset = this._intArray.length; - const weight = BaseObject.borrowObject(WeightData); - - weight.count = weightCount; - weight.offset = weightOffset; - weightBoneIndices.length = weightBoneCount; - this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount; - this._intArray[weightOffset + BinaryOffset.WeigthFloatOffset] = floatOffset; - - for (let i = 0; i < weightBoneCount; ++i) { - const rawBoneIndex = rawBonePoses[i * 7]; // uint - const bone = this._rawBones[rawBoneIndex]; - weight.addBone(bone); - weightBoneIndices[i] = rawBoneIndex; - this._intArray[weightOffset + BinaryOffset.WeigthBoneIndices + i] = sortedBones.indexOf(bone); - } - - this._floatArray.length += weightCount * 3; - this._helpMatrixA.copyFromArray(rawSlotPose, 0); - - for ( - let i = 0, iW = 0, iB = weightOffset + BinaryOffset.WeigthBoneIndices + weightBoneCount, iV = floatOffset; - i < vertexCount; - ++i - ) { - const iD = i * 2; - const vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint - - let x = this._floatArray[vertexOffset + iD]; - let y = this._floatArray[vertexOffset + iD + 1]; - this._helpMatrixA.transformPoint(x, y, this._helpPoint); - x = this._helpPoint.x; - y = this._helpPoint.y; - - for (let j = 0; j < vertexBoneCount; ++j) { - const rawBoneIndex = rawWeights[iW++]; // uint - const boneIndex = weightBoneIndices.indexOf(rawBoneIndex); - this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); - this._helpMatrixB.invert(); - this._helpMatrixB.transformPoint(x, y, this._helpPoint); - this._intArray[iB++] = boneIndex; - this._floatArray[iV++] = rawWeights[iW++]; - this._floatArray[iV++] = this._helpPoint.x; - this._floatArray[iV++] = this._helpPoint.y; - } - } - - mesh.vertices.weight = weight; + const meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; this._weightSlotPose[meshName] = rawSlotPose; this._weightBonePoses[meshName] = rawBonePoses; } } - protected _parseMeshGlue(rawData: any, mesh: MeshDisplayData): void { - rawData; mesh; - // const rawWeights = rawData[DataParser.GLUE_WEIGHTS] as Array; - // const rawMeshes = rawData[DataParser.GLUE_MESHES] as Array; - // mesh.glue = BaseObject.borrowObject(GlueData); - // mesh.glue.weights.length = rawWeights.length; - - // for (let i = 0, l = rawWeights.length; i < l; ++i) { - // mesh.glue.weights[i] = rawWeights[i]; - // } - - // for (let i = 0, l = rawMeshes.length; i < l; i += 3) { - // const glueMesh = this._armature.getMesh(rawMeshes[i], rawMeshes[i + 1], rawMeshes[i + 2]); - // mesh.glue.addMesh(glueMesh); - // } - } - protected _parseBoundingBox(rawData: any): BoundingBoxData | null { let boundingBox: BoundingBoxData | null = null; let type = BoundingBoxType.Rectangle; @@ -961,26 +833,13 @@ namespace dragonBones { const scale = this._armature.scale; const rawVertices = rawData[DataParser.VERTICES] as Array; const vertices = polygonBoundingBox.vertices; - - if (DragonBones.webAssembly) { - (vertices as any).resize(rawVertices.length, 0.0); - } - else { - vertices.length = rawVertices.length; - } + vertices.length = rawVertices.length; for (let i = 0, l = rawVertices.length; i < l; i += 2) { const x = rawVertices[i] * scale; const y = rawVertices[i + 1] * scale; - - if (DragonBones.webAssembly) { - (vertices as any).set(i, x); - (vertices as any).set(i + 1, y); - } - else { - vertices[i] = x; - vertices[i + 1] = y; - } + vertices[i] = x; + vertices[i + 1] = y; // AABB. if (i === 0) { @@ -1018,7 +877,8 @@ namespace dragonBones { protected _parseAnimation(rawData: any): AnimationData { const animation = BaseObject.borrowObject(AnimationData); - animation.frameCount = Math.max(ObjectDataParser._getNumber(rawData, DataParser.DURATION, 1), 1); + animation.blendType = DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, DataParser.BLEND_TYPE, "")); + animation.frameCount = ObjectDataParser._getNumber(rawData, DataParser.DURATION, 0); animation.playTimes = ObjectDataParser._getNumber(rawData, DataParser.PLAY_TIMES, 1); animation.duration = animation.frameCount / this._armature.frameRate; // float animation.fadeInTime = ObjectDataParser._getNumber(rawData, DataParser.FADE_IN_TIME, 0.0); @@ -1032,12 +892,12 @@ namespace dragonBones { animation.frameIntOffset = this._frameIntArray.length; animation.frameFloatOffset = this._frameFloatArray.length; animation.frameOffset = this._frameArray.length; - this._animation = animation; if (DataParser.FRAME in rawData) { const rawFrames = rawData[DataParser.FRAME] as Array; const keyFrameCount = rawFrames.length; + if (keyFrameCount > 0) { for (let i = 0, frameStart = 0; i < keyFrameCount; ++i) { const rawFrame = rawFrames[i]; @@ -1050,7 +910,7 @@ namespace dragonBones { if (DataParser.Z_ORDER in rawData) { this._animation.zOrderTimeline = this._parseTimeline( rawData[DataParser.Z_ORDER], null, DataParser.FRAME, TimelineType.ZOrder, - false, false, 0, + FrameValueType.Step, 0, this._parseZOrderFrame ); } @@ -1062,29 +922,6 @@ namespace dragonBones { } } - if (DataParser.SURFACE in rawData) { - const rawTimelines = rawData[DataParser.SURFACE] as Array; - for (const rawTimeline of rawTimelines) { - const surfaceName = ObjectDataParser._getString(rawTimeline, DataParser.NAME, ""); - this._surface = this._armature.getBone(surfaceName) as SurfaceData; - if (this._surface === null) { - continue; - } - - const timeline = this._parseTimeline( - rawTimeline, null, DataParser.FRAME, TimelineType.Surface, - false, true, 0, - this._parseSurfaceFrame - ); - - if (timeline !== null) { - this._animation.addSurfaceTimeline(this._surface, timeline); - } - - this._surface = null as any; // - } - } - if (DataParser.SLOT in rawData) { const rawTimelines = rawData[DataParser.SLOT] as Array; for (const rawTimeline of rawTimelines) { @@ -1111,12 +948,12 @@ namespace dragonBones { const timeline = this._parseTimeline( rawTimeline, null, DataParser.FRAME, TimelineType.SlotDeform, - false, true, 0, - this._parseSlotFFDFrame + FrameValueType.Float, 0, + this._parseSlotDeformFrame ); if (timeline !== null) { - this._animation.addSlotTimeline(this._slot, timeline); + this._animation.addSlotTimeline(slotName, timeline); } this._slot = null as any; // @@ -1135,29 +972,12 @@ namespace dragonBones { const timeline = this._parseTimeline( rawTimeline, null, DataParser.FRAME, TimelineType.IKConstraint, - true, false, 2, + FrameValueType.Int, 2, this._parseIKConstraintFrame ); if (timeline !== null) { - this._animation.addConstraintTimeline(constraint, timeline); - } - } - } - - if (DataParser.ANIMATION in rawData) { - const rawTimelines = rawData[DataParser.ANIMATION]; - for (const rawTimeline of rawTimelines) { - const animationName = ObjectDataParser._getString(rawTimeline, DataParser.NAME, ""); - - const timeline = this._parseTimeline( - rawTimeline, null, DataParser.FRAME, TimelineType.AnimationTime, - true, false, 2, - this._parseAnimationFrame - ); - - if (timeline !== null) { - this._animation.addAnimationTimeline(animationName, timeline); + this._animation.addConstraintTimeline(constraintName, timeline); } } } @@ -1165,21 +985,232 @@ namespace dragonBones { if (this._actionFrames.length > 0) { this._animation.actionTimeline = this._parseTimeline( null, this._actionFrames, "", TimelineType.Action, - false, false, 0, + FrameValueType.Step, 0, this._parseActionFrame ); this._actionFrames.length = 0; } + if (DataParser.TIMELINE in rawData) { + const rawTimelines = rawData[DataParser.TIMELINE]; + for (const rawTimeline of rawTimelines) { + const timelineType = ObjectDataParser._getNumber(rawTimeline, DataParser.TYPE, TimelineType.Action) as TimelineType; + const timelineName = ObjectDataParser._getString(rawTimeline, DataParser.NAME, ""); + let timeline: TimelineData | null = null; + + switch (timelineType) { + case TimelineType.Action: + // TODO + break; + + case TimelineType.SlotDisplay: // TODO + case TimelineType.SlotZIndex: + case TimelineType.BoneAlpha: + case TimelineType.SlotAlpha: + case TimelineType.AnimationProgress: + case TimelineType.AnimationWeight: + if ( + timelineType === TimelineType.SlotDisplay + ) { + this._frameValueType = FrameValueType.Step; + this._frameValueScale = 1.0; + } + else { + this._frameValueType = FrameValueType.Int; + + if (timelineType === TimelineType.SlotZIndex) { + this._frameValueScale = 1.0; + } + else if ( + timelineType === TimelineType.AnimationProgress || + timelineType === TimelineType.AnimationWeight + ) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + + if ( + timelineType === TimelineType.BoneAlpha || + timelineType === TimelineType.SlotAlpha || + timelineType === TimelineType.AnimationWeight + ) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + + if (timelineType === TimelineType.AnimationProgress && animation.blendType !== AnimationBlendType.None) { + timeline = BaseObject.borrowObject(AnimationTimelineData); + const animaitonTimeline = timeline as AnimationTimelineData; + animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, DataParser.X, 0.0); + animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, DataParser.Y, 0.0); + } + + timeline = this._parseTimeline( + rawTimeline, null, DataParser.FRAME, timelineType, + this._frameValueType, 1, + this._parseSingleValueFrame, timeline + ); + break; + + case TimelineType.BoneTranslate: + case TimelineType.BoneRotate: + case TimelineType.BoneScale: + case TimelineType.IKConstraint: + case TimelineType.AnimationParameter: + if ( + timelineType === TimelineType.IKConstraint || + timelineType === TimelineType.AnimationParameter + ) { + this._frameValueType = FrameValueType.Int; + + if (timelineType === TimelineType.AnimationParameter) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + else { + if (timelineType === TimelineType.BoneRotate) { + this._frameValueScale = Transform.DEG_RAD; + } + else { + this._frameValueScale = 1.0; + } + + this._frameValueType = FrameValueType.Float; + } + + if ( + timelineType === TimelineType.BoneScale || + timelineType === TimelineType.IKConstraint + ) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + + timeline = this._parseTimeline( + rawTimeline, null, DataParser.FRAME, timelineType, + this._frameValueType, 2, + this._parseDoubleValueFrame + ); + break; + + case TimelineType.ZOrder: + // TODO + break; + + case TimelineType.Surface: { + const surface = this._armature.getBone(timelineName) as SurfaceData; + if (surface === null) { + continue; + } + + this._geometry = surface.geometry; + timeline = this._parseTimeline( + rawTimeline, null, DataParser.FRAME, timelineType, + FrameValueType.Float, 0, + this._parseDeformFrame + ); + + this._geometry = null as any; // + break; + } + + case TimelineType.SlotDeform: { + this._geometry = null as any; // + for (const skinName in this._armature.skins) { + const skin = this._armature.skins[skinName]; + for (const slontName in skin.displays) { + const displays = skin.displays[slontName]; + for (const display of displays) { + if (display !== null && display.name === timelineName) { + this._geometry = (display as MeshDisplayData).geometry; + break; + } + } + } + } + + if (this._geometry === null) { + continue; + } + + timeline = this._parseTimeline( + rawTimeline, null, DataParser.FRAME, timelineType, + FrameValueType.Float, 0, + this._parseDeformFrame + ); + + this._geometry = null as any; // + break; + } + + case TimelineType.SlotColor: + timeline = this._parseTimeline( + rawTimeline, null, DataParser.FRAME, timelineType, + FrameValueType.Int, 1, + this._parseSlotColorFrame + ); + break; + } + + if (timeline !== null) { + switch (timelineType) { + case TimelineType.Action: + // TODO + break; + + case TimelineType.ZOrder: + // TODO + break; + + case TimelineType.BoneTranslate: + case TimelineType.BoneRotate: + case TimelineType.BoneScale: + case TimelineType.Surface: + case TimelineType.BoneAlpha: + this._animation.addBoneTimeline(timelineName, timeline); + break; + + case TimelineType.SlotDisplay: + case TimelineType.SlotColor: + case TimelineType.SlotDeform: + case TimelineType.SlotZIndex: + case TimelineType.SlotAlpha: + this._animation.addSlotTimeline(timelineName, timeline); + break; + + case TimelineType.IKConstraint: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + + case TimelineType.AnimationProgress: + case TimelineType.AnimationWeight: + case TimelineType.AnimationParameter: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null as any; // return animation; } protected _parseTimeline( - rawData: any, rawFrames: Array | null, framesKey: string, type: TimelineType, - addIntOffset: boolean, addFloatOffset: boolean, frameValueCount: number, - frameParser: (rawData: any, frameStart: number, frameCount: number) => number + rawData: any, rawFrames: Array | null, framesKey: string, + timelineType: TimelineType, frameValueType: FrameValueType, frameValueCount: number, + frameParser: (rawData: any, frameStart: number, frameCount: number) => number, timeline: TimelineData | null = null ): TimelineData | null { if (rawData !== null && framesKey.length > 0 && framesKey in rawData) { rawFrames = rawData[framesKey]; @@ -1196,8 +1227,15 @@ namespace dragonBones { const frameIntArrayLength = this._frameIntArray.length; const frameFloatArrayLength = this._frameFloatArray.length; - const timeline = BaseObject.borrowObject(TimelineData); const timelineOffset = this._timelineArray.length; + if (timeline === null) { + timeline = BaseObject.borrowObject(TimelineData); + } + + timeline.type = timelineType; + timeline.offset = timelineOffset; + this._frameValueType = frameValueType; + this._timeline = timeline; this._timelineArray.length += 1 + 1 + 1 + 1 + 1 + keyFrameCount; if (rawData !== null) { @@ -1212,19 +1250,19 @@ namespace dragonBones { this._timelineArray[timelineOffset + BinaryOffset.TimelineKeyFrameCount] = keyFrameCount; this._timelineArray[timelineOffset + BinaryOffset.TimelineFrameValueCount] = frameValueCount; - if (addIntOffset) { - this._timelineArray[timelineOffset + BinaryOffset.TimelineFrameValueOffset] = frameIntArrayLength - this._animation.frameIntOffset; - } - else if (addFloatOffset) { - this._timelineArray[timelineOffset + BinaryOffset.TimelineFrameValueOffset] = frameFloatArrayLength - this._animation.frameFloatOffset; - } - else { - this._timelineArray[timelineOffset + BinaryOffset.TimelineFrameValueOffset] = 0; - } + switch (this._frameValueType) { + case FrameValueType.Step: + this._timelineArray[timelineOffset + BinaryOffset.TimelineFrameValueOffset] = 0; + break; - this._timeline = timeline; - timeline.type = type; - timeline.offset = timelineOffset; + case FrameValueType.Int: + this._timelineArray[timelineOffset + BinaryOffset.TimelineFrameValueOffset] = frameIntArrayLength - this._animation.frameIntOffset; + break; + + case FrameValueType.Float: + this._timelineArray[timelineOffset + BinaryOffset.TimelineFrameValueOffset] = frameFloatArrayLength - this._animation.frameFloatOffset; + break; + } if (keyFrameCount === 1) { // Only one frame. timeline.frameIndicesOffset = -1; @@ -1233,17 +1271,8 @@ namespace dragonBones { else { const totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. const frameIndices = this._data.frameIndices; - let frameIndicesOffset = 0; - - if (DragonBones.webAssembly) { - frameIndicesOffset = (frameIndices as any).size(); - (frameIndices as any).resize(frameIndicesOffset + totalFrameCount, 0); - } - else { - frameIndicesOffset = frameIndices.length; - frameIndices.length += totalFrameCount; - } - + const frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; timeline.frameIndicesOffset = frameIndicesOffset; for ( @@ -1271,12 +1300,7 @@ namespace dragonBones { iK++; } - if (DragonBones.webAssembly) { - (frameIndices as any).set(frameIndicesOffset + i, iK - 1); - } - else { - frameIndices[frameIndicesOffset + i] = iK - 1; - } + frameIndices[frameIndicesOffset + i] = iK - 1; } } @@ -1295,50 +1319,56 @@ namespace dragonBones { this._slot = this._armature.getSlot(this._bone.name) as any; if (DataParser.TRANSLATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; const timeline = this._parseTimeline( rawData, null, DataParser.TRANSLATE_FRAME, TimelineType.BoneTranslate, - false, true, 2, - this._parseBoneTranslateFrame + FrameValueType.Float, 2, + this._parseDoubleValueFrame ); if (timeline !== null) { - this._animation.addBoneTimeline(bone, timeline); + this._animation.addBoneTimeline(bone.name, timeline); } } if (DataParser.ROTATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; const timeline = this._parseTimeline( rawData, null, DataParser.ROTATE_FRAME, TimelineType.BoneRotate, - false, true, 2, + FrameValueType.Float, 2, this._parseBoneRotateFrame ); if (timeline !== null) { - this._animation.addBoneTimeline(bone, timeline); + this._animation.addBoneTimeline(bone.name, timeline); } } if (DataParser.SCALE_FRAME in rawData) { + this._frameDefaultValue = 1.0; + this._frameValueScale = 1.0; const timeline = this._parseTimeline( rawData, null, DataParser.SCALE_FRAME, TimelineType.BoneScale, - false, true, 2, + FrameValueType.Float, 2, this._parseBoneScaleFrame ); if (timeline !== null) { - this._animation.addBoneTimeline(bone, timeline); + this._animation.addBoneTimeline(bone.name, timeline); } } if (DataParser.FRAME in rawData) { const timeline = this._parseTimeline( rawData, null, DataParser.FRAME, TimelineType.BoneAll, - false, true, 6, + FrameValueType.Float, 6, this._parseBoneAllFrame ); if (timeline !== null) { - this._animation.addBoneTimeline(bone, timeline); + this._animation.addBoneTimeline(bone.name, timeline); } } @@ -1352,45 +1382,46 @@ namespace dragonBones { return; } - this._slot = slot; - // Display timeline. let displayTimeline: TimelineData | null = null; + let colorTimeline: TimelineData | null = null; + this._slot = slot; if (DataParser.DISPLAY_FRAME in rawData) { displayTimeline = this._parseTimeline( rawData, null, DataParser.DISPLAY_FRAME, TimelineType.SlotDisplay, - false, false, 0, + FrameValueType.Step, 0, this._parseSlotDisplayFrame ); } else { displayTimeline = this._parseTimeline( rawData, null, DataParser.FRAME, TimelineType.SlotDisplay, - false, false, 0, + FrameValueType.Step, 0, this._parseSlotDisplayFrame ); } - if (displayTimeline !== null) { - this._animation.addSlotTimeline(slot, displayTimeline); - } - let colorTimeline: TimelineData | null = null; if (DataParser.COLOR_FRAME in rawData) { colorTimeline = this._parseTimeline( rawData, null, DataParser.COLOR_FRAME, TimelineType.SlotColor, - true, false, 1, + FrameValueType.Int, 1, this._parseSlotColorFrame ); } else { colorTimeline = this._parseTimeline( rawData, null, DataParser.FRAME, TimelineType.SlotColor, - true, false, 1, + FrameValueType.Int, 1, this._parseSlotColorFrame ); } + + if (displayTimeline !== null) { + this._animation.addSlotTimeline(slot.name, displayTimeline); + } + if (colorTimeline !== null) { - this._animation.addSlotTimeline(slot, colorTimeline); + this._animation.addSlotTimeline(slot.name, colorTimeline); } this._slot = null as any; // @@ -1416,11 +1447,11 @@ namespace dragonBones { if (DataParser.CURVE in rawData) { const sampleCount = frameCount + 1; this._helpArray.length = sampleCount; - this._samplingEasingCurve(rawData[DataParser.CURVE], this._helpArray); + const isOmited = this._samplingEasingCurve(rawData[DataParser.CURVE], this._helpArray); this._frameArray.length += 1 + 1 + this._helpArray.length; this._frameArray[frameOffset + BinaryOffset.FrameTweenType] = TweenType.Curve; - this._frameArray[frameOffset + BinaryOffset.FrameTweenEasingOrCurveSampleCount] = sampleCount; + this._frameArray[frameOffset + BinaryOffset.FrameTweenEasingOrCurveSampleCount] = isOmited ? sampleCount : -sampleCount; for (let i = 0; i < sampleCount; ++i) { this._frameArray[frameOffset + BinaryOffset.FrameCurveSamples + i] = Math.round(this._helpArray[i] * 10000.0); } @@ -1465,6 +1496,69 @@ namespace dragonBones { return frameOffset; } + protected _parseSingleValueFrame(rawData: any, frameStart: number, frameCount: number): number { + let frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, DataParser.VALUE, this._frameDefaultValue); + break; + } + + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + const frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale); + break; + } + + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + const frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 1; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + + return frameOffset; + } + + protected _parseDoubleValueFrame(rawData: any, frameStart: number, frameCount: number): number { + let frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 2; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, DataParser.X, this._frameDefaultValue); + this._frameArray[frameOffset + 2] = ObjectDataParser._getNumber(rawData, DataParser.Y, this._frameDefaultValue); + break; + } + + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + const frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, DataParser.X, this._frameDefaultValue) * this._frameValueScale); + this._frameIntArray[frameValueOffset + 1] = Math.round(ObjectDataParser._getNumber(rawData, DataParser.Y, this._frameDefaultValue) * this._frameValueScale); + break; + } + + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + const frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, DataParser.X, this._frameDefaultValue) * this._frameValueScale; + this._frameFloatArray[frameValueOffset + 1] = ObjectDataParser._getNumber(rawData, DataParser.Y, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + + return frameOffset; + } + protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number { // tslint:disable-next-line:no-unused-expression frameCount; @@ -1574,7 +1668,6 @@ namespace dragonBones { this._frameFloatArray[frameFloatOffset++] = this._helpTransform.skew; this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleX; this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleY; - this._parseActionDataInFrame(rawData, frameStart, this._bone, this._slot); return frameOffset; @@ -1582,7 +1675,6 @@ namespace dragonBones { protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number { const frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); - let frameFloatOffset = this._frameFloatArray.length; this._frameFloatArray.length += 2; this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, DataParser.X, 0.0); @@ -1622,7 +1714,6 @@ namespace dragonBones { protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number { const frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); - let frameFloatOffset = this._frameFloatArray.length; this._frameFloatArray.length += 2; this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, DataParser.X, 1.0); @@ -1631,56 +1722,8 @@ namespace dragonBones { return frameOffset; } - protected _parseSurfaceFrame(rawData: any, frameStart: number, frameCount: number): number { - const frameFloatOffset = this._frameFloatArray.length; - const frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); - const rawVertices = rawData[DataParser.VERTICES] as Array; - const offset = ObjectDataParser._getNumber(rawData, DataParser.OFFSET, 0); // uint - const vertexCount = this._surface.vertices.length / 2; // uint - let x = 0.0; - let y = 0.0; - this._frameFloatArray.length += vertexCount * 2; - - for ( - let i = 0; - i < vertexCount * 2; - i += 2 - ) { - if (i < offset || i - offset >= rawVertices.length) { - x = 0.0; - } - else { - x = rawVertices[i - offset]; - } - - if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { - y = 0.0; - } - else { - y = rawVertices[i + 1 - offset]; - } - - this._frameFloatArray[frameFloatOffset + i] = x; - this._frameFloatArray[frameFloatOffset + i + 1] = y; - } - - if (frameStart === 0) { - const frameIntOffset = this._frameIntArray.length; - this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; - this._frameIntArray[frameIntOffset + BinaryOffset.DeformVertexOffset] = 0; // - this._frameIntArray[frameIntOffset + BinaryOffset.DeformCount] = this._frameFloatArray.length - frameFloatOffset; - this._frameIntArray[frameIntOffset + BinaryOffset.DeformValueCount] = this._frameFloatArray.length - frameFloatOffset; - this._frameIntArray[frameIntOffset + BinaryOffset.DeformValueOffset] = 0; - this._frameIntArray[frameIntOffset + BinaryOffset.DeformFloatOffset] = frameFloatOffset - this._animation.frameFloatOffset; - this._timelineArray[this._timeline.offset + BinaryOffset.TimelineFrameValueCount] = frameIntOffset - this._animation.frameIntOffset; - } - - return frameOffset; - } - protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number { const frameOffset = this._parseFrame(rawData, frameStart, frameCount); - this._frameArray.length += 1; if (DataParser.VALUE in rawData) { @@ -1705,16 +1748,16 @@ namespace dragonBones { // tslint:disable-next-line:no-unused-expression k; this._parseColorTransform(rawColor, this._helpColorTransform); - colorOffset = this._intArray.length; - this._intArray.length += 8; - this._intArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100); - this._intArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100); - this._intArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100); - this._intArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100); - this._intArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset); - this._intArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset); - this._intArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset); - this._intArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset); + colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset); colorOffset -= 8; break; } @@ -1722,16 +1765,16 @@ namespace dragonBones { if (colorOffset < 0) { if (this._defaultColorOffset < 0) { - this._defaultColorOffset = colorOffset = this._intArray.length; - this._intArray.length += 8; - this._intArray[colorOffset++] = 100; - this._intArray[colorOffset++] = 100; - this._intArray[colorOffset++] = 100; - this._intArray[colorOffset++] = 100; - this._intArray[colorOffset++] = 0; - this._intArray[colorOffset++] = 0; - this._intArray[colorOffset++] = 0; - this._intArray[colorOffset++] = 0; + this._defaultColorOffset = colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; } colorOffset = this._defaultColorOffset; @@ -1744,14 +1787,14 @@ namespace dragonBones { return frameOffset; } - protected _parseSlotFFDFrame(rawData: any, frameStart: number, frameCount: number): number { + protected _parseSlotDeformFrame(rawData: any, frameStart: number, frameCount: number): number { const frameFloatOffset = this._frameFloatArray.length; const frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); const rawVertices = DataParser.VERTICES in rawData ? rawData[DataParser.VERTICES] as Array : null; const offset = ObjectDataParser._getNumber(rawData, DataParser.OFFSET, 0); // uint - const vertexCount = this._intArray[this._mesh.vertices.offset + BinaryOffset.MeshVertexCount]; + const vertexCount = this._intArray[this._mesh.geometry.offset + BinaryOffset.GeometryVertexCount]; const meshName = this._mesh.parent.name + "_" + this._slot.name + "_" + this._mesh.name; - const weight = this._mesh.vertices.weight; + const weight = this._mesh.geometry.weight; let x = 0.0; let y = 0.0; @@ -1819,7 +1862,7 @@ namespace dragonBones { if (frameStart === 0) { const frameIntOffset = this._frameIntArray.length; this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; - this._frameIntArray[frameIntOffset + BinaryOffset.DeformVertexOffset] = this._mesh.vertices.offset; + this._frameIntArray[frameIntOffset + BinaryOffset.DeformVertexOffset] = this._mesh.geometry.offset; this._frameIntArray[frameIntOffset + BinaryOffset.DeformCount] = this._frameFloatArray.length - frameFloatOffset; this._frameIntArray[frameIntOffset + BinaryOffset.DeformValueCount] = this._frameFloatArray.length - frameFloatOffset; this._frameIntArray[frameIntOffset + BinaryOffset.DeformValueOffset] = 0; @@ -1832,7 +1875,6 @@ namespace dragonBones { protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number { const frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); - let frameIntOffset = this._frameIntArray.length; this._frameIntArray.length += 2; this._frameIntArray[frameIntOffset++] = ObjectDataParser._getBoolean(rawData, DataParser.BEND_POSITIVE, true) ? 1 : 0; @@ -1841,17 +1883,6 @@ namespace dragonBones { return frameOffset; } - protected _parseAnimationFrame(rawData: any, frameStart: number, frameCount: number): number { - const frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); - - let frameIntOffset = this._frameIntArray.length; - this._frameIntArray.length += 2; - this._frameIntArray[frameIntOffset++] = ObjectDataParser._getNumber(rawData, DataParser.VALUE, 0); - this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, DataParser.WEIGHT, 1.0) * 100.0); - - return frameOffset; - } - protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array { const actions = new Array(); @@ -1941,6 +1972,68 @@ namespace dragonBones { return actions; } + protected _parseDeformFrame(rawData: any, frameStart: number, frameCount: number): number { + const frameFloatOffset = this._frameFloatArray.length; + const frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + const rawVertices = DataParser.VERTICES in rawData ? + rawData[DataParser.VERTICES] as Array : + (DataParser.VALUE in rawData ? rawData[DataParser.VALUE] as Array : null); + const offset = ObjectDataParser._getNumber(rawData, DataParser.OFFSET, 0); // uint + const vertexCount = this._intArray[this._geometry.offset + BinaryOffset.GeometryVertexCount]; + const weight = this._geometry.weight; + let x = 0.0; + let y = 0.0; + + if (weight !== null) { + // TODO + } + else { + this._frameFloatArray.length += vertexCount * 2; + + for ( + let i = 0; + i < vertexCount * 2; + i += 2 + ) { + if (rawVertices !== null) { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + else { + x = 0.0; + y = 0.0; + } + + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + + if (frameStart === 0) { + const frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + BinaryOffset.DeformVertexOffset] = this._geometry.offset; + this._frameIntArray[frameIntOffset + BinaryOffset.DeformCount] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + BinaryOffset.DeformValueCount] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + BinaryOffset.DeformValueOffset] = 0; + this._frameIntArray[frameIntOffset + BinaryOffset.DeformFloatOffset] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + BinaryOffset.TimelineFrameValueCount] = frameIntOffset - this._animation.frameIntOffset; + } + + return frameOffset; + } + protected _parseTransform(rawData: any, transform: Transform, scale: number): void { transform.x = ObjectDataParser._getNumber(rawData, DataParser.X, 0.0) * scale; transform.y = ObjectDataParser._getNumber(rawData, DataParser.Y, 0.0) * scale; @@ -1969,6 +2062,144 @@ namespace dragonBones { color.blueOffset = ObjectDataParser._getNumber(rawData, DataParser.BLUE_OFFSET, 0); } + protected _parseGeometry(rawData: any, geometry: GeometryData): void { + const rawVertices = rawData[DataParser.VERTICES] as Array; + const vertexCount = Math.floor(rawVertices.length / 2); // uint + let triangleCount = 0; + const geometryOffset = this._intArray.length; + const verticesOffset = this._floatArray.length; + // + geometry.offset = geometryOffset; + geometry.data = this._data; + // + this._intArray.length += 1 + 1 + 1 + 1; + this._intArray[geometryOffset + BinaryOffset.GeometryVertexCount] = vertexCount; + this._intArray[geometryOffset + BinaryOffset.GeometryFloatOffset] = verticesOffset; + this._intArray[geometryOffset + BinaryOffset.GeometryWeightOffset] = -1; // + // + this._floatArray.length += vertexCount * 2; + for (let i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[verticesOffset + i] = rawVertices[i]; + } + + if (DataParser.TRIANGLES in rawData) { + const rawTriangles = rawData[DataParser.TRIANGLES] as Array; + triangleCount = Math.floor(rawTriangles.length / 3); // uint + // + this._intArray.length += triangleCount * 3; + for (let i = 0, l = triangleCount * 3; i < l; ++i) { + this._intArray[geometryOffset + BinaryOffset.GeometryVertexIndices + i] = rawTriangles[i]; + } + } + // Fill triangle count. + this._intArray[geometryOffset + BinaryOffset.GeometryTriangleCount] = triangleCount; + + if (DataParser.UVS in rawData) { + const rawUVs = rawData[DataParser.UVS] as Array; + const uvOffset = verticesOffset + vertexCount * 2; + this._floatArray.length += vertexCount * 2; + for (let i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[uvOffset + i] = rawUVs[i]; + } + } + + if (DataParser.WEIGHTS in rawData) { + const rawWeights = rawData[DataParser.WEIGHTS] as Array; + const weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint + const weightOffset = this._intArray.length; + const floatOffset = this._floatArray.length; + let weightBoneCount = 0; + const sortedBones = this._armature.sortedBones; + const weight = BaseObject.borrowObject(WeightData); + weight.count = weightCount; + weight.offset = weightOffset; + + this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount; + this._intArray[weightOffset + BinaryOffset.WeigthFloatOffset] = floatOffset; + + if (DataParser.BONE_POSE in rawData) { + const rawSlotPose = rawData[DataParser.SLOT_POSE] as Array; + const rawBonePoses = rawData[DataParser.BONE_POSE] as Array; + const weightBoneIndices = new Array(); + + weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint + weightBoneIndices.length = weightBoneCount; + + for (let i = 0; i < weightBoneCount; ++i) { + const rawBoneIndex = rawBonePoses[i * 7]; // uint + const bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + weightBoneIndices[i] = rawBoneIndex; + this._intArray[weightOffset + BinaryOffset.WeigthBoneIndices + i] = sortedBones.indexOf(bone); + } + + this._floatArray.length += weightCount * 3; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + + for ( + let i = 0, iW = 0, iB = weightOffset + BinaryOffset.WeigthBoneIndices + weightBoneCount, iV = floatOffset; + i < vertexCount; + ++i + ) { + const iD = i * 2; + const vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint + + let x = this._floatArray[verticesOffset + iD]; + let y = this._floatArray[verticesOffset + iD + 1]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint); + x = this._helpPoint.x; + y = this._helpPoint.y; + + for (let j = 0; j < vertexBoneCount; ++j) { + const rawBoneIndex = rawWeights[iW++]; // uint + const boneIndex = weightBoneIndices.indexOf(rawBoneIndex); + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint); + this._intArray[iB++] = boneIndex; + this._floatArray[iV++] = rawWeights[iW++]; + this._floatArray[iV++] = this._helpPoint.x; + this._floatArray[iV++] = this._helpPoint.y; + } + } + } + else { + const rawBones = rawData[DataParser.BONES] as Array; + weightBoneCount = rawBones.length; + + for (let i = 0; i < weightBoneCount; i++) { + const rawBoneIndex = rawBones[i]; + const bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + this._intArray[weightOffset + BinaryOffset.WeigthBoneIndices + i] = sortedBones.indexOf(bone); + } + + this._floatArray.length += weightCount * 3; + for (let i = 0, iW = 0, iV = 0, iB = weightOffset + BinaryOffset.WeigthBoneIndices + weightBoneCount, iF = floatOffset; + i < weightCount; + i++ + ) { + const vertexBoneCount = rawWeights[iW++]; + this._intArray[iB++] = vertexBoneCount; + + for (let j = 0; j < vertexBoneCount; j++) { + const boneIndex = rawWeights[iW++]; + const boneWeight = rawWeights[iW++]; + const x = rawVertices[iV++]; + const y = rawVertices[iV++]; + + this._intArray[iB++] = rawBones.indexOf(boneIndex); + this._floatArray[iF++] = boneWeight; + this._floatArray[iF++] = x; + this._floatArray[iF++] = y; + } + } + } + + geometry.weight = weight; + } + } + protected _parseArray(rawData: any): void { // tslint:disable-next-line:no-unused-expression rawData; @@ -1978,6 +2209,7 @@ namespace dragonBones { this._frameFloatArray.length = 0; this._frameArray.length = 0; this._timelineArray.length = 0; + this._colorArray.length = 0; } protected _modifyArray(): void { @@ -1998,92 +2230,64 @@ namespace dragonBones { this._timelineArray.push(0); } + if ((this._timelineArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._colorArray.push(0); + } + const l1 = this._intArray.length * Int16Array.BYTES_PER_ELEMENT; const l2 = this._floatArray.length * Float32Array.BYTES_PER_ELEMENT; const l3 = this._frameIntArray.length * Int16Array.BYTES_PER_ELEMENT; const l4 = this._frameFloatArray.length * Float32Array.BYTES_PER_ELEMENT; const l5 = this._frameArray.length * Int16Array.BYTES_PER_ELEMENT; const l6 = this._timelineArray.length * Uint16Array.BYTES_PER_ELEMENT; - const lTotal = l1 + l2 + l3 + l4 + l5 + l6; - - if (DragonBones.webAssembly) { - const shareBuffer = webAssemblyModule.HEAP16.buffer; - const bufferPointer = webAssemblyModule._malloc(lTotal); - const intArray = new Int16Array(shareBuffer, bufferPointer, this._intArray.length); - const floatArray = new Float32Array(shareBuffer, bufferPointer + l1, this._floatArray.length); - const frameIntArray = new Int16Array(shareBuffer, bufferPointer + l1 + l2, this._frameIntArray.length); - const frameFloatArray = new Float32Array(shareBuffer, bufferPointer + l1 + l2 + l3, this._frameFloatArray.length); - const frameArray = new Int16Array(shareBuffer, bufferPointer + l1 + l2 + l3 + l4, this._frameArray.length); - const timelineArray = new Uint16Array(shareBuffer, bufferPointer + l1 + l2 + l3 + l4 + l5, this._timelineArray.length); - - for (let i = 0, l = this._intArray.length; i < l; ++i) { - intArray[i] = this._intArray[i]; - } - - for (let i = 0, l = this._floatArray.length; i < l; ++i) { - floatArray[i] = this._floatArray[i]; - } - - for (let i = 0, l = this._frameIntArray.length; i < l; ++i) { - frameIntArray[i] = this._frameIntArray[i]; - } - - for (let i = 0, l = this._frameFloatArray.length; i < l; ++i) { - frameFloatArray[i] = this._frameFloatArray[i]; - } - - for (let i = 0, l = this._frameArray.length; i < l; ++i) { - frameArray[i] = this._frameArray[i]; - } - - for (let i = 0, l = this._timelineArray.length; i < l; ++i) { - timelineArray[i] = this._timelineArray[i]; - } + const l7 = this._colorArray.length * Int16Array.BYTES_PER_ELEMENT; + const lTotal = l1 + l2 + l3 + l4 + l5 + l6 + l7; + // + const binary = new ArrayBuffer(lTotal); + const intArray = new Int16Array(binary, 0, this._intArray.length); + const floatArray = new Float32Array(binary, l1, this._floatArray.length); + const frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length); + const frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length); + const frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length); + const timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length); + const colorArray = new Int16Array(binary, l1 + l2 + l3 + l4 + l5 + l6, this._colorArray.length); - webAssemblyModule.setDataBinary(this._data, bufferPointer, l1, l2, l3, l4, l5, l6); + for (let i = 0, l = this._intArray.length; i < l; ++i) { + intArray[i] = this._intArray[i]; } - else { - const binary = new ArrayBuffer(lTotal); - const intArray = new Int16Array(binary, 0, this._intArray.length); - const floatArray = new Float32Array(binary, l1, this._floatArray.length); - const frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length); - const frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length); - const frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length); - const timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length); - - for (let i = 0, l = this._intArray.length; i < l; ++i) { - intArray[i] = this._intArray[i]; - } - for (let i = 0, l = this._floatArray.length; i < l; ++i) { - floatArray[i] = this._floatArray[i]; - } + for (let i = 0, l = this._floatArray.length; i < l; ++i) { + floatArray[i] = this._floatArray[i]; + } - for (let i = 0, l = this._frameIntArray.length; i < l; ++i) { - frameIntArray[i] = this._frameIntArray[i]; - } + for (let i = 0, l = this._frameIntArray.length; i < l; ++i) { + frameIntArray[i] = this._frameIntArray[i]; + } - for (let i = 0, l = this._frameFloatArray.length; i < l; ++i) { - frameFloatArray[i] = this._frameFloatArray[i]; - } + for (let i = 0, l = this._frameFloatArray.length; i < l; ++i) { + frameFloatArray[i] = this._frameFloatArray[i]; + } - for (let i = 0, l = this._frameArray.length; i < l; ++i) { - frameArray[i] = this._frameArray[i]; - } + for (let i = 0, l = this._frameArray.length; i < l; ++i) { + frameArray[i] = this._frameArray[i]; + } - for (let i = 0, l = this._timelineArray.length; i < l; ++i) { - timelineArray[i] = this._timelineArray[i]; - } + for (let i = 0, l = this._timelineArray.length; i < l; ++i) { + timelineArray[i] = this._timelineArray[i]; + } - this._data.binary = binary; - this._data.intArray = intArray; - this._data.floatArray = floatArray; - this._data.frameIntArray = frameIntArray; - this._data.frameFloatArray = frameFloatArray; - this._data.frameArray = frameArray; - this._data.timelineArray = timelineArray; + for (let i = 0, l = this._colorArray.length; i < l; ++i) { + colorArray[i] = this._colorArray[i]; } + this._data.binary = binary; + this._data.intArray = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = frameArray; + this._data.timelineArray = timelineArray; + this._data.colorArray = colorArray; this._defaultColorOffset = -1; } @@ -2108,7 +2312,6 @@ namespace dragonBones { if (DataParser.ARMATURE in rawData) { this._data = data; - this._parseArray(rawData); const rawArmatures = rawData[DataParser.ARMATURE] as Array; @@ -2158,6 +2361,7 @@ namespace dragonBones { const rawTextureAtlas = this._rawTextureAtlases[this._rawTextureAtlasIndex++]; this.parseTextureAtlasData(rawTextureAtlas, textureAtlasData, scale); + if (this._rawTextureAtlasIndex >= this._rawTextureAtlases.length) { this._rawTextureAtlasIndex = 0; this._rawTextureAtlases = null; @@ -2177,7 +2381,10 @@ namespace dragonBones { const rawTextures = rawData[DataParser.SUB_TEXTURE] as Array; for (let i = 0, l = rawTextures.length; i < l; ++i) { const rawTexture = rawTextures[i]; + const frameWidth = ObjectDataParser._getNumber(rawTexture, DataParser.FRAME_WIDTH, -1.0); + const frameHeight = ObjectDataParser._getNumber(rawTexture, DataParser.FRAME_HEIGHT, -1.0); const textureData = textureAtlasData.createTexture(); + textureData.rotated = ObjectDataParser._getBoolean(rawTexture, DataParser.ROTATED, false); textureData.name = ObjectDataParser._getString(rawTexture, DataParser.NAME, ""); textureData.region.x = ObjectDataParser._getNumber(rawTexture, DataParser.X, 0.0); @@ -2185,8 +2392,6 @@ namespace dragonBones { textureData.region.width = ObjectDataParser._getNumber(rawTexture, DataParser.WIDTH, 0.0); textureData.region.height = ObjectDataParser._getNumber(rawTexture, DataParser.HEIGHT, 0.0); - const frameWidth = ObjectDataParser._getNumber(rawTexture, DataParser.FRAME_WIDTH, -1.0); - const frameHeight = ObjectDataParser._getNumber(rawTexture, DataParser.FRAME_HEIGHT, -1.0); if (frameWidth > 0.0 && frameHeight > 0.0) { textureData.frame = TextureData.createRectangle(); textureData.frame.x = ObjectDataParser._getNumber(rawTexture, DataParser.FRAME_X, 0.0); @@ -2222,7 +2427,7 @@ namespace dragonBones { } } /** - * @internal + * @private */ export class ActionFrame { public frameStart: number = 0; diff --git a/DragonBones/tsconfig.json b/DragonBones/tsconfig.json index 433160b0..10a22512 100644 --- a/DragonBones/tsconfig.json +++ b/DragonBones/tsconfig.json @@ -3,6 +3,7 @@ "watch": false, "sourceMap": false, "declaration": true, + "stripInternal": true, "alwaysStrict": true, "noImplicitAny": true, "noImplicitThis": true, @@ -24,7 +25,6 @@ "out" ], "files": [ - "./src/dragonBones/modules.ts", "./src/dragonBones/core/DragonBones.ts", "./src/dragonBones/core/BaseObject.ts", @@ -45,8 +45,6 @@ "./src/dragonBones/model/AnimationData.ts", "./src/dragonBones/model/AnimationConfig.ts", "./src/dragonBones/model/TextureAtlasData.ts", - - "./src/dragonBones/armature/DeformVertices.ts", "./src/dragonBones/armature/IArmatureProxy.ts", "./src/dragonBones/armature/Armature.ts", diff --git a/Egret/4.x/README.md b/Egret/4.x/README.md index 4da03ffe..0afe3fd8 100644 --- a/Egret/4.x/README.md +++ b/Egret/4.x/README.md @@ -1,4 +1,7 @@ ## How to build +* Clone or download [DragonBonesJS](https://github.com/DragonBones/DragonBonesJS/). +* Install [Node.JS](https://nodejs.org/). +* Open `DragonBonesJS/Egret/4.x/` in command. * $ `npm install` * $ `npm run build` diff --git a/Egret/4.x/libs/.gitkeep b/Egret/4.x/libs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Egret/4.x/out/dragonBones.d.ts b/Egret/4.x/out/dragonBones.d.ts index a2cb345f..e6e80540 100644 --- a/Egret/4.x/out/dragonBones.d.ts +++ b/Egret/4.x/out/dragonBones.d.ts @@ -1,15 +1,3 @@ -declare namespace dragonBones { - /** - * @internal - * @private - */ - const webAssemblyModule: { - HEAP16: Int16Array; - _malloc(byteSize: number): number; - _free(pointer: number): void; - setDataBinary(data: DragonBonesData, binaryPointer: number, intBytesLength: number, floatBytesLength: number, frameIntBytesLength: number, frameFloatBytesLength: number, frameBytesLength: number, timelineBytesLength: number): void; - }; -} /** * The MIT License (MIT) * @@ -34,17 +22,17 @@ declare namespace dragonBones { */ declare namespace dragonBones { /** - * @internal + * @private */ const enum BinaryOffset { WeigthBoneCount = 0, WeigthFloatOffset = 1, WeigthBoneIndices = 2, - MeshVertexCount = 0, - MeshTriangleCount = 1, - MeshFloatOffset = 2, - MeshWeightOffset = 3, - MeshVertexIndices = 4, + GeometryVertexCount = 0, + GeometryTriangleCount = 1, + GeometryFloatOffset = 2, + GeometryWeightOffset = 3, + GeometryVertexIndices = 4, TimelineScale = 0, TimelineOffset = 1, TimelineKeyFrameCount = 2, @@ -59,25 +47,22 @@ declare namespace dragonBones { DeformCount = 1, DeformValueCount = 2, DeformValueOffset = 3, - DeformFloatOffset = 4, - PathVertexCount = 0, - PathFloatOffset = 2, - PathWeightOffset = 3, + DeformFloatOffset = 4 } /** - * @internal + * @private */ const enum ArmatureType { Armature = 0, MovieClip = 1, - Stage = 2, + Stage = 2 } /** - * @internal + * @private */ const enum BoneType { Bone = 0, - Surface = 1, + Surface = 1 } /** * @private @@ -87,7 +72,7 @@ declare namespace dragonBones { Armature = 1, Mesh = 2, BoundingBox = 3, - Path = 4, + Path = 4 } /** * - Bounding box type. @@ -102,18 +87,18 @@ declare namespace dragonBones { const enum BoundingBoxType { Rectangle = 0, Ellipse = 1, - Polygon = 2, + Polygon = 2 } /** - * @internal + * @private */ const enum ActionType { Play = 0, Frame = 10, - Sound = 11, + Sound = 11 } /** - * @internal + * @private */ const enum BlendMode { Normal = 0, @@ -129,10 +114,10 @@ declare namespace dragonBones { Multiply = 10, Overlay = 11, Screen = 12, - Subtract = 13, + Subtract = 13 } /** - * @internal + * @private */ const enum TweenType { None = 0, @@ -140,10 +125,10 @@ declare namespace dragonBones { Curve = 2, QuadIn = 3, QuadOut = 4, - QuadInOut = 5, + QuadInOut = 5 } /** - * @internal + * @private */ const enum TimelineType { Action = 0, @@ -153,12 +138,16 @@ declare namespace dragonBones { BoneRotate = 12, BoneScale = 13, Surface = 50, + BoneAlpha = 60, SlotDisplay = 20, SlotColor = 21, SlotDeform = 22, + SlotZIndex = 23, + SlotAlpha = 24, IKConstraint = 30, - AnimationTime = 40, + AnimationProgress = 40, AnimationWeight = 41, + AnimationParameter = 42 } /** * - Offset mode. @@ -173,7 +162,7 @@ declare namespace dragonBones { const enum OffsetMode { None = 0, Additive = 1, - Override = 2, + Override = 2 } /** * - Animation fade out mode. @@ -186,15 +175,6 @@ declare namespace dragonBones { * @language zh_CN */ const enum AnimationFadeOutMode { - /** - * - Do not fade out of any animation states. - * @language en_US - */ - /** - * - 不淡出任何的动画状态。 - * @language zh_CN - */ - None = 0, /** * - Fade out the animation states of the same layer. * @language en_US @@ -239,25 +219,51 @@ declare namespace dragonBones { * - 不替换同名的动画状态。 * @language zh_CN */ - Single = 5, + Single = 5 + } + /** + * @private + */ + const enum AnimationBlendType { + None = 0, + E1D = 1 } + /** + * @private + */ + const enum AnimationBlendMode { + Additive = 0, + Override = 1 + } + /** + * @private + */ const enum ConstraintType { IK = 0, - Path = 1, + Path = 1 } + /** + * @private + */ const enum PositionMode { Fixed = 0, - Percent = 1, + Percent = 1 } + /** + * @private + */ const enum SpacingMode { Length = 0, Fixed = 1, - Percent = 2, + Percent = 2 } + /** + * @private + */ const enum RotateMode { Tangent = 0, Chain = 1, - ChainScale = 2, + ChainScale = 2 } /** * @private @@ -273,7 +279,6 @@ declare namespace dragonBones { static yDown: boolean; static debug: boolean; static debugDraw: boolean; - static webAssembly: boolean; private readonly _clock; private readonly _events; private readonly _objects; @@ -287,6 +292,9 @@ declare namespace dragonBones { } } +declare var exports: any; +declare var module: any; +declare var define: any; /** * The MIT License (MIT) * @@ -327,7 +335,7 @@ declare namespace dragonBones { private static _defaultMaxCount; private static readonly _maxCountMap; private static readonly _poolsMap; - private static _returnObject(object); + private static _returnObject; static toString(): string; /** * - Set the maximum cache count of the specify object pool. @@ -776,7 +784,7 @@ declare namespace dragonBones { */ declare namespace dragonBones { /** - * @internal + * @private */ class ColorTransform { alphaMultiplier: number; @@ -1054,18 +1062,6 @@ declare namespace dragonBones { */ readonly strings: Array; protected _onClear(): void; - /** - * @internal - */ - addInt(value: number): void; - /** - * @internal - */ - addFloat(value: number): void; - /** - * @internal - */ - addString(value: string): void; /** * - Get the custom int number. * @version DragonBones 5.0 @@ -1101,7 +1097,7 @@ declare namespace dragonBones { getString(index?: number): string; } /** - * @internal + * @private */ class ActionData extends BaseObject { static toString(): string; @@ -1195,14 +1191,6 @@ declare namespace dragonBones { * @private */ stage: ArmatureData | null; - /** - * @internal - */ - readonly frameIndices: Array; - /** - * @internal - */ - readonly cachedFrames: Array; /** * - All armature data names. * @version DragonBones 3.0 @@ -1218,43 +1206,11 @@ declare namespace dragonBones { * @private */ readonly armatures: Map; - /** - * @internal - */ - binary: ArrayBuffer; - /** - * @internal - */ - intArray: Int16Array; - /** - * @internal - */ - floatArray: Float32Array; - /** - * @internal - */ - frameIntArray: Int16Array; - /** - * @internal - */ - frameFloatArray: Float32Array; - /** - * @internal - */ - frameArray: Int16Array; - /** - * @internal - */ - timelineArray: Uint16Array; /** * @private */ userData: UserData | null; protected _onClear(): void; - /** - * @internal - */ - addArmature(value: ArmatureData): void; /** * - Get a specific armature data. * @param armatureName - The armature data name. @@ -1268,17 +1224,6 @@ declare namespace dragonBones { * @language zh_CN */ getArmature(armatureName: string): ArmatureData | null; - /** - * - Deprecated, please refer to {@link #dragonBones.BaseFactory#removeDragonBonesData()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #dragonBones.BaseFactory#removeDragonBonesData()}。 - * @deprecated - * @language zh_CN - */ - dispose(): void; } } /** @@ -1436,46 +1381,6 @@ declare namespace dragonBones { */ parent: DragonBonesData; protected _onClear(): void; - /** - * @internal - */ - sortBones(): void; - /** - * @internal - */ - cacheFrames(frameRate: number): void; - /** - * @internal - */ - setCacheFrame(globalTransformMatrix: Matrix, transform: Transform): number; - /** - * @internal - */ - getCacheFrame(globalTransformMatrix: Matrix, transform: Transform, arrayOffset: number): void; - /** - * @internal - */ - addBone(value: BoneData): void; - /** - * @internal - */ - addSlot(value: SlotData): void; - /** - * @internal - */ - addConstraint(value: ConstraintData): void; - /** - * @internal - */ - addSkin(value: SkinData): void; - /** - * @internal - */ - addAnimation(value: AnimationData): void; - /** - * @internal - */ - addAction(value: ActionData, isDefault: boolean): void; /** * - Get a specific done data. * @param boneName - The bone name. @@ -1580,6 +1485,10 @@ declare namespace dragonBones { * @language zh_CN */ length: number; + /** + * @private + */ + alpha: number; /** * - The bone name. * @version DragonBones 3.0 @@ -1612,16 +1521,6 @@ declare namespace dragonBones { parent: BoneData | null; protected _onClear(): void; } - /** - * @internal - */ - class SurfaceData extends BoneData { - static toString(): string; - segmentX: number; - segmentY: number; - readonly vertices: Array; - protected _onClear(): void; - } /** * - The slot data. * @version DragonBones 3.0 @@ -1633,14 +1532,6 @@ declare namespace dragonBones { * @language zh_CN */ class SlotData extends BaseObject { - /** - * @internal - */ - static readonly DEFAULT_COLOR: ColorTransform; - /** - * @internal - */ - static createColor(): ColorTransform; static toString(): string; /** * @private @@ -1654,6 +1545,14 @@ declare namespace dragonBones { * @private */ zOrder: number; + /** + * @private + */ + zIndex: number; + /** + * @private + */ + alpha: number; /** * - The slot name. * @version DragonBones 3.0 @@ -1711,7 +1610,7 @@ declare namespace dragonBones { */ declare namespace dragonBones { /** - * @internal + * @private */ class CanvasData extends BaseObject { static toString(): string; @@ -1779,10 +1678,6 @@ declare namespace dragonBones { */ parent: ArmatureData; protected _onClear(): void; - /** - * @internal - */ - addDisplay(slotName: string, value: DisplayData | null): void; /** * @private */ @@ -1817,7 +1712,7 @@ declare namespace dragonBones { */ declare namespace dragonBones { /** - * @internal + * @private */ abstract class ConstraintData extends BaseObject { order: number; @@ -1828,35 +1723,6 @@ declare namespace dragonBones { bone: BoneData | null; protected _onClear(): void; } - /** - * @internal - */ - class IKConstraintData extends ConstraintData { - static toString(): string; - scaleEnabled: boolean; - bendPositive: boolean; - weight: number; - protected _onClear(): void; - } - /** - * @internal - */ - class PathConstraintData extends ConstraintData { - static toString(): string; - pathSlot: SlotData; - pathDisplayData: PathDisplayData; - bones: Array; - positionMode: PositionMode; - spacingMode: SpacingMode; - rotateMode: RotateMode; - position: number; - spacing: number; - rotateOffset: number; - rotateMix: number; - translateMix: number; - protected _onClear(): void; - AddBone(value: BoneData): void; - } } /** * The MIT License (MIT) @@ -1882,19 +1748,21 @@ declare namespace dragonBones { */ declare namespace dragonBones { /** - * @internal + * @private */ - class VerticesData { + class GeometryData { isShared: boolean; inheritDeform: boolean; offset: number; data: DragonBonesData; weight: WeightData | null; clear(): void; - shareFrom(value: VerticesData): void; + shareFrom(value: GeometryData): void; + readonly vertexCount: number; + readonly triangleCount: number; } /** - * @internal + * @private */ abstract class DisplayData extends BaseObject { type: DisplayType; @@ -1905,7 +1773,7 @@ declare namespace dragonBones { protected _onClear(): void; } /** - * @internal + * @private */ class ImageDisplayData extends DisplayData { static toString(): string; @@ -1914,7 +1782,7 @@ declare namespace dragonBones { protected _onClear(): void; } /** - * @internal + * @private */ class ArmatureDisplayData extends DisplayData { static toString(): string; @@ -1928,16 +1796,16 @@ declare namespace dragonBones { addAction(value: ActionData): void; } /** - * @internal + * @private */ class MeshDisplayData extends DisplayData { static toString(): string; - readonly vertices: VerticesData; + readonly geometry: GeometryData; texture: TextureData | null; protected _onClear(): void; } /** - * @internal + * @private */ class BoundingBoxDisplayData extends DisplayData { static toString(): string; @@ -1945,18 +1813,18 @@ declare namespace dragonBones { protected _onClear(): void; } /** - * @internal + * @private */ class PathDisplayData extends DisplayData { static toString(): string; closed: boolean; constantSpeed: boolean; - readonly vertices: VerticesData; + readonly geometry: GeometryData; readonly curveLengths: Array; protected _onClear(): void; } /** - * @internal + * @private */ class WeightData extends BaseObject { static toString(): string; @@ -2078,7 +1946,7 @@ declare namespace dragonBones { /** * - Compute the bit code for a point (x, y) using the clip rectangle */ - private static _computeOutCode(x, y, xMin, yMin, xMax, yMax); + private static _computeOutCode; /** * @private */ @@ -2255,20 +2123,9 @@ declare namespace dragonBones { class AnimationData extends BaseObject { static toString(): string; /** - * - FrameIntArray. - * @internal - */ - frameIntOffset: number; - /** - * - FrameFloatArray. - * @internal - */ - frameFloatOffset: number; - /** - * - FrameArray. - * @internal + * @private */ - frameOffset: number; + blendType: AnimationBlendType; /** * - The frame count of the animation. * @version DragonBones 3.0 @@ -2340,10 +2197,6 @@ declare namespace dragonBones { * @private */ readonly boneTimelines: Map>; - /** - * @private - */ - readonly surfaceTimelines: Map>; /** * @private */ @@ -2377,26 +2230,18 @@ declare namespace dragonBones { */ parent: ArmatureData; protected _onClear(): void; - /** - * @internal - */ - cacheFrames(frameRate: number): void; - /** - * @private - */ - addBoneTimeline(bone: BoneData, timeline: TimelineData): void; /** * @private */ - addSurfaceTimeline(surface: SurfaceData, timeline: TimelineData): void; + addBoneTimeline(timelineName: string, timeline: TimelineData): void; /** * @private */ - addSlotTimeline(slot: SlotData, timeline: TimelineData): void; + addSlotTimeline(timelineName: string, timeline: TimelineData): void; /** * @private */ - addConstraintTimeline(constraint: ConstraintData, timeline: TimelineData): void; + addConstraintTimeline(timelineName: string, timeline: TimelineData): void; /** * @private */ @@ -2405,10 +2250,6 @@ declare namespace dragonBones { * @private */ getBoneTimelines(timelineName: string): Array | null; - /** - * @private - */ - getSurfaceTimelines(timelineName: string): Array | null; /** * @private */ @@ -2431,7 +2272,7 @@ declare namespace dragonBones { getSlotCachedFrameIndices(slotName: string): Array | null; } /** - * @internal + * @private */ class TimelineData extends BaseObject { static toString(): string; @@ -2520,7 +2361,7 @@ declare namespace dragonBones { /** * @private */ - additiveBlending: boolean; + additive: boolean; /** * - Whether the animation state has control over the display property of the slots. * Sometimes blend a animation state does not want it to control the display properties of the slots, @@ -2723,18 +2564,6 @@ declare namespace dragonBones { * @private */ copyFrom(value: AnimationConfig): void; - /** - * @private - */ - containsBoneMask(boneName: string): boolean; - /** - * @private - */ - addBoneMask(armature: Armature, boneName: string, recursive?: boolean): void; - /** - * @private - */ - removeBoneMask(armature: Armature, boneName: string, recursive?: boolean): void; } } /** @@ -2818,21 +2647,13 @@ declare namespace dragonBones { * @private */ copyFrom(value: TextureAtlasData): void; - /** - * @internal - */ - abstract createTexture(): TextureData; - /** - * @internal - */ - addTexture(value: TextureData): void; /** * @private */ getTexture(textureName: string): TextureData | null; } /** - * @internal + * @private */ abstract class TextureData extends BaseObject { static createRectangle(): Rectangle; @@ -2845,43 +2666,6 @@ declare namespace dragonBones { copyFrom(value: TextureData): void; } } -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -declare namespace dragonBones { - /** - * @internal - */ - class DeformVertices extends BaseObject { - static toString(): string; - verticesDirty: boolean; - readonly vertices: Array; - readonly bones: Array; - verticesData: VerticesData | null; - protected _onClear(): void; - init(verticesDataValue: VerticesData | null, armature: Armature): void; - isBonesUpdate(): boolean; - } -} /** * The MIT License (MIT) * @@ -2918,18 +2702,6 @@ declare namespace dragonBones { * @language zh_CN */ interface IArmatureProxy extends IEventDispatcher { - /** - * @internal - */ - dbInit(armature: Armature): void; - /** - * @internal - */ - dbClear(): void; - /** - * @internal - */ - dbUpdate(): void; /** * - Dispose the instance and the Armature instance. (The Armature instance will return to the object pool) * @example @@ -3018,7 +2790,7 @@ declare namespace dragonBones { */ class Armature extends BaseObject implements IAnimatable { static toString(): string; - private static _onSortSlots(a, b); + private static _onSortSlots; /** * - Whether to inherit the animation control of the parent armature. * True to try to have the child armature play an animation with the same name when the parent armature play the animation. @@ -3038,64 +2810,20 @@ declare namespace dragonBones { * @private */ userData: any; - private _lockUpdate; private _slotsDirty; private _zOrderDirty; private _flipX; private _flipY; - /** - * @internal - */ - _cacheFrameIndex: number; + private _alpha; private readonly _bones; private readonly _slots; - /** - * @internal - */ - readonly _constraints: Array; private readonly _actions; - /** - * @internal - */ - _armatureData: ArmatureData; private _animation; private _proxy; private _display; - /** - * @internal - */ - _replaceTextureAtlasData: TextureAtlasData | null; private _replacedTexture; - /** - * @internal - */ - _dragonBones: DragonBones; private _clock; - /** - * @internal - */ - _parent: Slot | null; protected _onClear(): void; - /** - * @internal - */ - _sortZOrder(slotIndices: Array | Int16Array | null, offset: number): void; - /** - * @internal - */ - _addBone(value: Bone): void; - /** - * @internal - */ - _addSlot(value: Slot): void; - /** - * @internal - */ - _addConstraint(value: Constraint): void; - /** - * @internal - */ - _bufferAction(action: EventObject, append: boolean): void; /** * - Dispose the armature. (Return to the object pool) * @example @@ -3117,10 +2845,6 @@ declare namespace dragonBones { * @language zh_CN */ dispose(): void; - /** - * @internal - */ - init(armatureData: ArmatureData, proxy: IArmatureProxy, display: any, dragonBones: DragonBones): void; /** * @inheritDoc */ @@ -3429,61 +3153,12 @@ declare namespace dragonBones { */ readonly parent: Slot | null; /** - * @deprecated - * @private - */ - replaceTexture(texture: any): void; - /** - * - Deprecated, please refer to {@link #eventDispatcher}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #eventDispatcher}。 - * @deprecated - * @language zh_CN - */ - hasEventListener(type: EventStringType): boolean; - /** - * - Deprecated, please refer to {@link #eventDispatcher}. + * - Deprecated, please refer to {@link #display}. * @deprecated * @language en_US */ /** - * - 已废弃,请参考 {@link #eventDispatcher}。 - * @deprecated - * @language zh_CN - */ - addEventListener(type: EventStringType, listener: Function, target: any): void; - /** - * - Deprecated, please refer to {@link #eventDispatcher}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #eventDispatcher}。 - * @deprecated - * @language zh_CN - */ - removeEventListener(type: EventStringType, listener: Function, target: any): void; - /** - * - Deprecated, please refer to {@link #cacheFrameRate}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #cacheFrameRate}。 - * @deprecated - * @language zh_CN - */ - enableAnimationCache(frameRate: number): void; - /** - * - Deprecated, please refer to {@link #display}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #display}。 + * - 已废弃,请参考 {@link #display}。 * @deprecated * @language zh_CN */ @@ -3575,10 +3250,6 @@ declare namespace dragonBones { */ userData: any; protected _globalDirty: boolean; - /** - * @internal - */ - _armature: Armature; /** */ protected _onClear(): void; @@ -3676,55 +3347,15 @@ declare namespace dragonBones { * @language zh_CN */ offsetMode: OffsetMode; - /** - * @internal - */ - readonly animationPose: Transform; - /** - * @internal - */ - _transformDirty: boolean; - /** - * @internal - */ - _childrenTransformDirty: boolean; protected _localDirty: boolean; - /** - * @internal - */ - _hasConstraint: boolean; protected _visible: boolean; protected _cachedFrameIndex: number; - /** - * @internal - */ - readonly _blendState: BlendState; - /** - * @internal - */ - _boneData: BoneData; /** * @private */ protected _parent: Bone | null; - /** - * @internal - */ - _cachedFrameIndices: Array | null; protected _onClear(): void; protected _updateGlobalTransformMatrix(isCache: boolean): void; - /** - * @internal - */ - init(boneData: BoneData, armatureValue: Armature): void; - /** - * @internal - */ - update(cacheFrameIndex: number): void; - /** - * @internal - */ - updateByConstraint(): void; /** * - Forces the bone to update the transform in the next frame. * When the bone is not animated or its animation state is finished, the bone will not continue to update, @@ -3812,39 +3443,6 @@ declare namespace dragonBones { * @language zh_CN */ readonly parent: Bone | null; - /** - * - Deprecated, please refer to {@link dragonBones.Armature#getBones()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.Armature#getBones()}。 - * @deprecated - * @language zh_CN - */ - getBones(): Array; - /** - * - Deprecated, please refer to {@link dragonBones.Armature#getSlots()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.Armature#getSlots()}。 - * @deprecated - * @language zh_CN - */ - getSlots(): Array; - /** - * - Deprecated, please refer to {@link dragonBones.Armature#getSlot()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.Armature#getSlot()}。 - * @deprecated - * @language zh_CN - */ - readonly slot: Slot | null; } } /** @@ -3870,41 +3468,6 @@ declare namespace dragonBones { * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ declare namespace dragonBones { - /** - * @internal - */ - class Surface extends Bone { - static toString(): string; - private _dX; - private _dY; - private _k; - private _kX; - private _kY; - readonly _vertices: Array; - readonly _deformVertices: Array; - /** - * - x1, y1, x2, y2, x3, y3, x4, y4, d1X, d1Y, d2X, d2Y - */ - private readonly _hullCache; - /** - * - Inside [flag, a, b, c, d, tx, ty], Outside [flag, a, b, c, d, tx, ty] - */ - private readonly _matrixCahce; - protected _onClear(): void; - private _getAffineTransform(x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown); - private _updateVertices(); - protected _updateGlobalTransformMatrix(isCache: boolean): void; - _getGlobalTransformMatrix(x: number, y: number): Matrix; - /** - * @internal - * @private - */ - init(surfaceData: SurfaceData, armatureValue: Armature): void; - /** - * @internal - */ - update(cacheFrameIndex: number): void; - } } /** * The MIT License (MIT) @@ -3929,6 +3492,22 @@ declare namespace dragonBones { * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ declare namespace dragonBones { + /** + * @private + */ + class DisplayFrame extends BaseObject { + static toString(): string; + rawDisplayData: DisplayData | null; + displayData: DisplayData | null; + textureData: TextureData | null; + display: any | Armature | null; + readonly deformVertices: Array; + protected _onClear(): void; + updateDeformVertices(): void; + getGeometryData(): GeometryData | null; + getBoundingBox(): BoundingBoxData | null; + getTextureData(): TextureData | null; + } /** * - The slot attached to the armature, controls the display status and properties of the display object. * A bone can contain multiple slots. @@ -3973,66 +3552,30 @@ declare namespace dragonBones { * @language zh_CN */ displayController: string | null; + protected _displayDataDirty: boolean; protected _displayDirty: boolean; - protected _zOrderDirty: boolean; + protected _geometryDirty: boolean; + protected _textureDirty: boolean; protected _visibleDirty: boolean; protected _blendModeDirty: boolean; - /** - * @internal - */ - _colorDirty: boolean; + protected _zOrderDirty: boolean; protected _transformDirty: boolean; protected _visible: boolean; protected _blendMode: BlendMode; protected _displayIndex: number; protected _animationDisplayIndex: number; - /** - * @internal - */ - _zOrder: number; protected _cachedFrameIndex: number; - /** - * @internal - */ - _pivotX: number; - /** - * @internal - */ - _pivotY: number; protected readonly _localMatrix: Matrix; - /** - * @internal - */ - readonly _colorTransform: ColorTransform; - protected readonly _displayDatas: Array; - protected readonly _displayList: Array; - /** - * @internal - */ - _slotData: SlotData; - protected _rawDisplayDatas: Array | null; - /** - * @internal - */ - _displayData: DisplayData | null; protected _boundingBoxData: BoundingBoxData | null; protected _textureData: TextureData | null; - /** - * @internal - */ - _deformVertices: DeformVertices | null; protected _rawDisplay: any; protected _meshDisplay: any; - protected _display: any; + protected _display: any | null; protected _childArmature: Armature | null; /** * @private */ protected _parent: Bone; - /** - * @internal - */ - _cachedFrameIndices: Array | null; protected _onClear(): void; protected abstract _initDisplay(value: any, isRetain: boolean): void; protected abstract _disposeDisplay(value: any, isRelease: boolean): void; @@ -4041,59 +3584,47 @@ declare namespace dragonBones { protected abstract _replaceDisplay(value: any): void; protected abstract _removeDisplay(): void; protected abstract _updateZOrder(): void; - /** - * @internal - */ - abstract _updateVisible(): void; protected abstract _updateBlendMode(): void; protected abstract _updateColor(): void; protected abstract _updateFrame(): void; protected abstract _updateMesh(): void; - /** - * @internal - */ - abstract _updateGlueMesh(): void; protected abstract _updateTransform(): void; protected abstract _identityTransform(): void; - /** - * - Support default skin data. - */ - protected _getDefaultRawDisplayData(displayIndex: number): DisplayData | null; + protected _hasDisplay(display: any): boolean; protected _updateDisplayData(): void; protected _updateDisplay(): void; protected _updateGlobalTransformMatrix(isCache: boolean): void; /** - * @internal - */ - _setDisplayIndex(value: number, isAnimation?: boolean): boolean; - /** - * @internal + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US */ - _setZorder(value: number): boolean; /** - * @internal + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN */ - _setColor(value: ColorTransform): boolean; + invalidUpdate(): void; /** - * @internal + * @private */ - _setDisplayList(value: Array | null): boolean; + updateTransformAndMatrix(): void; /** - * @internal + * @private */ - init(slotData: SlotData, armatureValue: Armature, rawDisplay: any, meshDisplay: any): void; + replaceRawDisplayData(displayData: DisplayData | null, index?: number): void; /** - * @internal + * @private */ - update(cacheFrameIndex: number): void; + replaceDisplayData(displayData: DisplayData | null, index?: number): void; /** * @private */ - updateTransformAndMatrix(): void; + replaceTextureData(textureData: TextureData | null, index?: number): void; /** * @private */ - replaceDisplayData(value: DisplayData | null, displayIndex?: number): void; + replaceDisplay(value: any | Armature | null, index?: number): void; /** * - Check whether a specific point is inside a custom bounding box in the slot. * The coordinate system of the point is the inner coordinate system of the armature. @@ -4154,16 +3685,9 @@ declare namespace dragonBones { y: number; } | null): number; /** - * - Forces the slot to update the state of the display object in the next frame. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 强制插槽在下一帧更新显示对象的状态。 - * @version DragonBones 4.5 - * @language zh_CN + * @private */ - invalidUpdate(): void; + getDisplayFrameAt(index: number): DisplayFrame; /** * - The visible of slot's display object. * @default true @@ -4177,6 +3701,10 @@ declare namespace dragonBones { * @language zh_CN */ visible: boolean; + /** + * @private + */ + displayFrameCount: number; /** * - The index of the display object displayed in the display list. * @example @@ -4237,14 +3765,6 @@ declare namespace dragonBones { * @language zh_CN */ readonly slotData: SlotData; - /** - * @private - */ - rawDisplayDatas: Array | null; - /** - * @private - */ - readonly displayData: DisplayData | null; /** * - The custom bounding box data for the slot at current time. * @version DragonBones 5.0 @@ -4290,9 +3810,9 @@ declare namespace dragonBones { * @example *
          *     let slot = armature.getSlot("weapon");
-         * let prevChildArmature = slot.childArmature;
-         * if (prevChildArmature) {
-         * prevChildArmature.dispose();
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
          *     }
          *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
          * 
@@ -4305,9 +3825,9 @@ declare namespace dragonBones { * @example *
          *     let slot = armature.getSlot("weapon");
-         * let prevChildArmature = slot.childArmature;
-         * if (prevChildArmature) {
-         * prevChildArmature.dispose();
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
          *     }
          *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
          * 
@@ -4373,88 +3893,6 @@ declare namespace dragonBones { * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ declare namespace dragonBones { - /** - * @internal - */ - abstract class Constraint extends BaseObject { - protected static readonly _helpMatrix: Matrix; - protected static readonly _helpTransform: Transform; - protected static readonly _helpPoint: Point; - /** - * - For timeline state. - * @internal - */ - _constraintData: ConstraintData; - protected _armature: Armature; - /** - * - For sort bones. - * @internal - */ - _target: Bone; - /** - * - For sort bones. - * @internal - */ - _root: Bone; - protected _bone: Bone | null; - protected _onClear(): void; - abstract init(constraintData: ConstraintData, armature: Armature): void; - abstract update(): void; - abstract invalidUpdate(): void; - readonly name: string; - } - /** - * @internal - */ - class IKConstraint extends Constraint { - static toString(): string; - private _scaleEnabled; - /** - * - For timeline state. - * @internal - */ - _bendPositive: boolean; - /** - * - For timeline state. - * @internal - */ - _weight: number; - protected _onClear(): void; - private _computeA(); - private _computeB(); - init(constraintData: ConstraintData, armature: Armature): void; - update(): void; - invalidUpdate(): void; - } - /** - * @internal - */ - class PathConstraint extends Constraint { - dirty: boolean; - pathOffset: number; - position: number; - spacing: number; - rotateOffset: number; - rotateMix: number; - translateMix: number; - private _pathSlot; - private _bones; - private _spaces; - private _positions; - private _curves; - private _boneLengths; - private _pathGlobalVertices; - private _segments; - static toString(): string; - protected _onClear(): void; - protected _updatePathVertices(verticesData: VerticesData): void; - protected _computeVertices(start: number, count: number, offset: number, out: Array): void; - protected _computeBezierCurve(pathDisplayDta: PathDisplayData, spaceCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): void; - private addCurvePosition(t, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, offset, tangents); - init(constraintData: ConstraintData, armature: Armature): void; - update(): void; - invalidUpdate(): void; - } } /** * The MIT License (MIT) @@ -4679,17 +4117,6 @@ declare namespace dragonBones { * @inheritDoc */ clock: WorldClock | null; - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#clock}。 - * @deprecated - * @language zh_CN - */ - static readonly clock: WorldClock; } } /** @@ -4744,25 +4171,20 @@ declare namespace dragonBones { * @language zh_CN */ timeScale: number; - private _lockUpdate; + /** + * Update bones and slots cachedFrameIndices. + */ private _animationDirty; private _inheritTimeScale; private readonly _animationNames; private readonly _animationStates; private readonly _animations; + private readonly _blendStates; private _armature; private _animationConfig; private _lastAnimationState; protected _onClear(): void; - private _fadeOut(animationConfig); - /** - * @internal - */ - init(armature: Armature): void; - /** - * @internal - */ - advanceTime(passedTime: number): void; + private _fadeOut; /** * - Clear all animations states. * @see dragonBones.AnimationState @@ -4983,6 +4405,7 @@ declare namespace dragonBones { /** * - Get a specific animation state. * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) * @example *
          *     armature.animation.play("walk");
@@ -4993,8 +4416,9 @@ declare namespace dragonBones {
          * @language en_US
          */
         /**
-         * - 获取指定的动画状态
+         * - 获取指定的动画状态。
          * @param animationName - 动画状态名称。
+         * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1)
          * @example
          * 
          *     armature.animation.play("walk");
@@ -5004,7 +4428,7 @@ declare namespace dragonBones {
          * @version DragonBones 3.0
          * @language zh_CN
          */
-        getState(animationName: string): AnimationState | null;
+        getState(animationName: string, layer?: number): AnimationState | null;
         /**
          * - Check whether a specific animation data is included.
          * @param animationName - The name of animation data.
@@ -5030,7 +4454,7 @@ declare namespace dragonBones {
          * @version DragonBones 5.1
          * @language zh_CN
          */
-        getStates(): Array;
+        getStates(): ReadonlyArray;
         /**
          * - Check whether there is an animation state is playing
          * @see dragonBones.AnimationState
@@ -5080,7 +4504,7 @@ declare namespace dragonBones {
          * @version DragonBones 4.5
          * @language zh_CN
          */
-        readonly animationNames: Array;
+        readonly animationNames: ReadonlyArray;
         /**
          * - All animation data.
          * @version DragonBones 4.5
@@ -5118,50 +4542,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly lastAnimationState: AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #play()} {@link #fadeIn()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #play()} {@link #fadeIn()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        gotoAndPlay(animationName: string, fadeInTime?: number, duration?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode, pauseFadeOut?: boolean, pauseFadeIn?: boolean): AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #gotoAndStopByTime()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #gotoAndStopByTime()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        gotoAndStop(animationName: string, time?: number): AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #animationNames}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #animationNames}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly animationList: Array;
-        /**
-         * - Deprecated, please refer to {@link #animationNames}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #animationNames}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly animationDataList: Array;
     }
 }
 /**
@@ -5210,7 +4590,7 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        additiveBlending: boolean;
+        additive: boolean;
         /**
          * - Whether the animation state has control over the display object properties of the slots.
          * Sometimes blend a animation state does not want it to control the display object properties of the slots,
@@ -5243,6 +4623,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         resetToPose: boolean;
+        /**
+         * @private
+         */
+        blendType: AnimationBlendType;
         /**
          * - The play times. [0: Loop play, [1~N]: Play N times]
          * @version DragonBones 3.0
@@ -5289,18 +4673,21 @@ declare namespace dragonBones {
          */
         timeScale: number;
         /**
-         * - The blend weight.
-         * @default 1.0
-         * @version DragonBones 5.0
-         * @language en_US
+         * @private
          */
+        parameterX: number;
         /**
-         * - 混合权重。
-         * @default 1.0
-         * @version DragonBones 5.0
-         * @language zh_CN
+         * @private
          */
-        weight: number;
+        parameterY: number;
+        /**
+         * @private
+         */
+        positionX: number;
+        /**
+         * @private
+         */
+        positionY: number;
         /**
          * - The auto fade out time when the animation state play completed.
          * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds)
@@ -5349,77 +4736,26 @@ declare namespace dragonBones {
          */
         group: string;
         private _timelineDirty;
-        /**
-         * - xx: Play Enabled, Fade Play Enabled
-         * @internal
-         */
-        _playheadState: number;
-        /**
-         * -1: Fade in, 0: Fade complete, 1: Fade out;
-         * @internal
-         */
-        _fadeState: number;
-        /**
-         * -1: Fade start, 0: Fading, 1: Fade complete;
-         * @internal
-         */
-        _subFadeState: number;
-        /**
-         * @internal
-         */
-        _position: number;
-        /**
-         * @internal
-         */
-        _duration: number;
+        private _weight;
         private _fadeTime;
         private _time;
-        /**
-         * @internal
-         */
-        _fadeProgress: number;
-        /**
-         * @internal
-         */
-        _weightResult: number;
-        /**
-         * @internal
-         */
-        readonly _blendState: BlendState;
         private readonly _boneMask;
         private readonly _boneTimelines;
-        private readonly _surfaceTimelines;
+        private readonly _boneBlendTimelines;
         private readonly _slotTimelines;
+        private readonly _slotBlendTimelines;
         private readonly _constraintTimelines;
         private readonly _animationTimelines;
         private readonly _poseTimelines;
-        private readonly _bonePoses;
-        /**
-         * @internal
-         */
-        _animationData: AnimationData;
+        private _animationData;
         private _armature;
-        /**
-         * @internal
-         */
-        _actionTimeline: ActionTimelineState;
         private _zOrderTimeline;
-        /**
-         * @internal
-         */
-        _parent: AnimationState;
+        private _activeChildA;
+        private _activeChildB;
         protected _onClear(): void;
-        private _updateTimelines();
-        private _updateBoneAndSlotTimelines();
-        private _advanceFadeTime(passedTime);
-        /**
-         * @internal
-         */
-        init(armature: Armature, animationData: AnimationData, animationConfig: AnimationConfig): void;
-        /**
-         * @internal
-         */
-        advanceTime(passedTime: number, cacheFrameRate: number): void;
+        private _updateTimelines;
+        private _updateBoneAndSlotTimelines;
+        private _advanceFadeTime;
         /**
          * - Continue play.
          * @version DragonBones 3.0
@@ -5511,6 +4847,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         removeAllBoneMask(): void;
+        /**
+         * @private
+         */
+        addState(animationState: AnimationState, timelineDatas?: TimelineData[] | null): void;
         /**
          * - Whether the animation state is fading in.
          * @version DragonBones 5.1
@@ -5599,12 +4939,25 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         currentTime: number;
+        /**
+         * - The blend weight.
+         * @default 1.0
+         * @version DragonBones 5.0
+         * @language en_US
+         */
+        /**
+         * - 混合权重。
+         * @default 1.0
+         * @version DragonBones 5.0
+         * @language zh_CN
+         */
         /**
          * - The animation data.
          * @see dragonBones.AnimationData
          * @version DragonBones 3.0
          * @language en_US
          */
+        weight: number;
         /**
          * - 动画数据。
          * @see dragonBones.AnimationData
@@ -5613,31 +4966,6 @@ declare namespace dragonBones {
          */
         readonly animationData: AnimationData;
     }
-    /**
-     * @internal
-     */
-    class BonePose extends BaseObject {
-        static toString(): string;
-        readonly current: Transform;
-        readonly delta: Transform;
-        readonly result: Transform;
-        protected _onClear(): void;
-    }
-    /**
-     * @internal
-     */
-    class BlendState {
-        dirty: boolean;
-        layer: number;
-        leftWeight: number;
-        layerWeight: number;
-        blendWeight: number;
-        /**
-         * -1: First blending, 0: No blending, 1: Blending.
-         */
-        update(weight: number, p_layer: number): number;
-        clear(): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -5662,93 +4990,6 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
-    /**
-     * @internal
-     */
-    const enum TweenState {
-        None = 0,
-        Once = 1,
-        Always = 2,
-    }
-    /**
-     * @internal
-     */
-    abstract class TimelineState extends BaseObject {
-        /**
-         * -1: start, 0: play, 1: complete;
-         */
-        playState: number;
-        currentPlayTimes: number;
-        currentTime: number;
-        protected _tweenState: TweenState;
-        protected _frameRate: number;
-        protected _frameValueOffset: number;
-        protected _frameCount: number;
-        protected _frameOffset: number;
-        protected _frameIndex: number;
-        protected _frameRateR: number;
-        protected _position: number;
-        protected _duration: number;
-        protected _timeScale: number;
-        protected _timeOffset: number;
-        protected _dragonBonesData: DragonBonesData;
-        protected _animationData: AnimationData;
-        protected _timelineData: TimelineData | null;
-        protected _armature: Armature;
-        protected _animationState: AnimationState;
-        protected _actionTimeline: TimelineState;
-        protected _frameArray: Array | Int16Array;
-        protected _frameIntArray: Array | Int16Array;
-        protected _frameFloatArray: Array | Int16Array;
-        protected _timelineArray: Array | Uint16Array;
-        protected _frameIndices: Array;
-        protected _onClear(): void;
-        protected abstract _onArriveAtFrame(): void;
-        protected abstract _onUpdateFrame(): void;
-        protected _setCurrentTime(passedTime: number): boolean;
-        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        fadeOut(): void;
-        update(passedTime: number): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class TweenTimelineState extends TimelineState {
-        private static _getEasingValue(tweenType, progress, easing);
-        private static _getEasingCurveValue(progress, samples, count, offset);
-        protected _tweenType: TweenType;
-        protected _curveCount: number;
-        protected _framePosition: number;
-        protected _frameDurationR: number;
-        protected _tweenProgress: number;
-        protected _tweenEasing: number;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class BoneTimelineState extends TweenTimelineState {
-        bone: Bone;
-        bonePose: BonePose;
-        protected _onClear(): void;
-        blend(state: number): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class SlotTimelineState extends TweenTimelineState {
-        slot: Slot;
-        protected _onClear(): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class ConstraintTimelineState extends TweenTimelineState {
-        constraint: Constraint;
-        protected _onClear(): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -5773,144 +5014,6 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
-    /**
-     * @internal
-     */
-    class ActionTimelineState extends TimelineState {
-        static toString(): string;
-        private _onCrossFrame(frameIndex);
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        update(passedTime: number): void;
-        setCurrentTime(value: number): void;
-    }
-    /**
-     * @internal
-     */
-    class ZOrderTimelineState extends TimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneAllTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        fadeOut(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneTranslateTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneRotateTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        fadeOut(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneScaleTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class SurfaceTimelineState extends TweenTimelineState {
-        static toString(): string;
-        surface: Surface;
-        private _frameFloatOffset;
-        private _valueCount;
-        private _deformCount;
-        private _valueOffset;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        blend(state: number): void;
-    }
-    /**
-     * @internal
-     */
-    class SlotDislayTimelineState extends SlotTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class SlotColorTimelineState extends SlotTimelineState {
-        static toString(): string;
-        private _dirty;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        fadeOut(): void;
-        update(passedTime: number): void;
-    }
-    /**
-     * @internal
-     */
-    class DeformTimelineState extends SlotTimelineState {
-        static toString(): string;
-        vertexOffset: number;
-        private _dirty;
-        private _frameFloatOffset;
-        private _valueCount;
-        private _deformCount;
-        private _valueOffset;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        fadeOut(): void;
-        update(passedTime: number): void;
-    }
-    /**
-     * @internal
-     */
-    class IKConstraintTimelineState extends ConstraintTimelineState {
-        static toString(): string;
-        private _current;
-        private _delta;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class AnimationTimelineState extends TweenTimelineState {
-        static toString(): string;
-        animationState: AnimationState;
-        private readonly _floats;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        blend(state: number): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -6046,11 +5149,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         static readonly SOUND_EVENT: string;
-        /**
-         * @internal
-         * @private
-         */
-        static actionDataToInstance(data: ActionData, instance: EventObject, armature: Armature): void;
         static toString(): string;
         /**
          * - If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds)
@@ -6264,39 +5362,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void;
-        /**
-         * - Deprecated, please refer to {@link #hasDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #hasDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        hasEvent(type: EventStringType): boolean;
-        /**
-         * - Deprecated, please refer to {@link #addDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #addDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        addEvent(type: EventStringType, listener: Function, thisObject: any): void;
-        /**
-         * - Deprecated, please refer to {@link #removeDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #removeDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        removeEvent(type: EventStringType, listener: Function, thisObject: any): void;
     }
 }
 /**
@@ -6323,7 +5388,7 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     abstract class DataParser {
         protected static readonly DATA_VERSION_2_3: string;
@@ -6332,6 +5397,7 @@ declare namespace dragonBones {
         protected static readonly DATA_VERSION_4_5: string;
         protected static readonly DATA_VERSION_5_0: string;
         protected static readonly DATA_VERSION_5_5: string;
+        protected static readonly DATA_VERSION_5_6: string;
         protected static readonly DATA_VERSION: string;
         protected static readonly DATA_VERSIONS: Array;
         protected static readonly TEXTURE_ATLAS: string;
@@ -6348,18 +5414,19 @@ declare namespace dragonBones {
         protected static readonly DRADON_BONES: string;
         protected static readonly USER_DATA: string;
         protected static readonly ARMATURE: string;
+        protected static readonly CANVAS: string;
         protected static readonly BONE: string;
         protected static readonly SURFACE: string;
         protected static readonly SLOT: string;
         protected static readonly CONSTRAINT: string;
-        protected static readonly IK: string;
-        protected static readonly PATH_CONSTRAINT: string;
         protected static readonly SKIN: string;
         protected static readonly DISPLAY: string;
+        protected static readonly FRAME: string;
+        protected static readonly IK: string;
+        protected static readonly PATH_CONSTRAINT: string;
         protected static readonly ANIMATION: string;
-        protected static readonly Z_ORDER: string;
+        protected static readonly TIMELINE: string;
         protected static readonly FFD: string;
-        protected static readonly FRAME: string;
         protected static readonly TRANSLATE_FRAME: string;
         protected static readonly ROTATE_FRAME: string;
         protected static readonly SCALE_FRAME: string;
@@ -6371,7 +5438,6 @@ declare namespace dragonBones {
         protected static readonly INTS: string;
         protected static readonly FLOATS: string;
         protected static readonly STRINGS: string;
-        protected static readonly CANVAS: string;
         protected static readonly TRANSFORM: string;
         protected static readonly PIVOT: string;
         protected static readonly AABB: string;
@@ -6389,6 +5455,8 @@ declare namespace dragonBones {
         protected static readonly PATH: string;
         protected static readonly LENGTH: string;
         protected static readonly DISPLAY_INDEX: string;
+        protected static readonly Z_ORDER: string;
+        protected static readonly Z_INDEX: string;
         protected static readonly BLEND_MODE: string;
         protected static readonly INHERIT_TRANSLATION: string;
         protected static readonly INHERIT_ROTATION: string;
@@ -6401,6 +5469,7 @@ declare namespace dragonBones {
         protected static readonly BEND_POSITIVE: string;
         protected static readonly CHAIN: string;
         protected static readonly WEIGHT: string;
+        protected static readonly BLEND_TYPE: string;
         protected static readonly FADE_IN_TIME: string;
         protected static readonly PLAY_TIMES: string;
         protected static readonly SCALE: string;
@@ -6424,6 +5493,7 @@ declare namespace dragonBones {
         protected static readonly VALUE: string;
         protected static readonly ROTATE: string;
         protected static readonly SKEW: string;
+        protected static readonly ALPHA: string;
         protected static readonly ALPHA_OFFSET: string;
         protected static readonly RED_OFFSET: string;
         protected static readonly GREEN_OFFSET: string;
@@ -6438,8 +5508,6 @@ declare namespace dragonBones {
         protected static readonly WEIGHTS: string;
         protected static readonly SLOT_POSE: string;
         protected static readonly BONE_POSE: string;
-        protected static readonly GLUE_WEIGHTS: string;
-        protected static readonly GLUE_MESHES: string;
         protected static readonly BONES: string;
         protected static readonly POSITION_MODE: string;
         protected static readonly SPACING_MODE: string;
@@ -6457,37 +5525,16 @@ declare namespace dragonBones {
         protected static readonly DEFAULT_NAME: string;
         protected static _getArmatureType(value: string): ArmatureType;
         protected static _getBoneType(value: string): BoneType;
-        protected static _getDisplayType(value: string): DisplayType;
-        protected static _getBoundingBoxType(value: string): BoundingBoxType;
-        protected static _getActionType(value: string): ActionType;
-        protected static _getBlendMode(value: string): BlendMode;
         protected static _getPositionMode(value: string): PositionMode;
         protected static _getSpacingMode(value: string): SpacingMode;
         protected static _getRotateMode(value: string): RotateMode;
+        protected static _getDisplayType(value: string): DisplayType;
+        protected static _getBoundingBoxType(value: string): BoundingBoxType;
+        protected static _getBlendMode(value: string): BlendMode;
+        protected static _getAnimationBlendType(value: string): AnimationBlendType;
+        protected static _getActionType(value: string): ActionType;
         abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null;
         abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static parseDragonBonesData(rawData: any): DragonBonesData | null;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static parseTextureAtlasData(rawData: any, scale?: number): any;
     }
 }
 /**
@@ -6514,7 +5561,15 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
+     */
+    const enum FrameValueType {
+        Step = 0,
+        Int = 1,
+        Float = 2
+    }
+    /**
+     * @private
      */
     class ObjectDataParser extends DataParser {
         protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean;
@@ -6525,16 +5580,19 @@ declare namespace dragonBones {
         protected _data: DragonBonesData;
         protected _armature: ArmatureData;
         protected _bone: BoneData;
-        protected _surface: SurfaceData;
+        protected _geometry: GeometryData;
         protected _slot: SlotData;
         protected _skin: SkinData;
         protected _mesh: MeshDisplayData;
         protected _animation: AnimationData;
         protected _timeline: TimelineData;
         protected _rawTextureAtlases: Array | null;
+        private _frameValueType;
         private _defaultColorOffset;
         private _prevClockwise;
         private _prevRotation;
+        private _frameDefaultValue;
+        private _frameValueScale;
         private readonly _helpMatrixA;
         private readonly _helpMatrixB;
         private readonly _helpTransform;
@@ -6547,6 +5605,7 @@ declare namespace dragonBones {
         private readonly _frameFloatArray;
         private readonly _frameArray;
         private readonly _timelineArray;
+        private readonly _colorArray;
         private readonly _cacheRawMeshes;
         private readonly _cacheMeshes;
         private readonly _actionFrames;
@@ -6554,10 +5613,10 @@ declare namespace dragonBones {
         private readonly _weightBonePoses;
         private readonly _cacheBones;
         private readonly _slotChildActions;
-        private _getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, t, result);
-        private _samplingEasingCurve(curve, samples);
-        private _parseActionDataInFrame(rawData, frameStart, bone, slot);
-        private _mergeActionFrame(rawData, frameStart, type, bone, slot);
+        private _getCurvePoint;
+        private _samplingEasingCurve;
+        private _parseActionDataInFrame;
+        private _mergeActionFrame;
         protected _parseArmature(rawData: any, scale: number): ArmatureData;
         protected _parseBone(rawData: any): BoneData;
         protected _parseIKConstraint(rawData: any): ConstraintData | null;
@@ -6568,30 +5627,31 @@ declare namespace dragonBones {
         protected _parsePath(rawData: any, display: PathDisplayData): void;
         protected _parsePivot(rawData: any, display: ImageDisplayData): void;
         protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;
-        protected _parseMeshGlue(rawData: any, mesh: MeshDisplayData): void;
         protected _parseBoundingBox(rawData: any): BoundingBoxData | null;
         protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData;
         protected _parseAnimation(rawData: any): AnimationData;
-        protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, type: TimelineType, addIntOffset: boolean, addFloatOffset: boolean, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number): TimelineData | null;
+        protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, timelineType: TimelineType, frameValueType: FrameValueType, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number, timeline?: TimelineData | null): TimelineData | null;
         protected _parseBoneTimeline(rawData: any): void;
         protected _parseSlotTimeline(rawData: any): void;
         protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseSingleValueFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseDoubleValueFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number;
         protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseSurfaceFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseSlotFFDFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseSlotDeformFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseAnimationFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array;
+        protected _parseDeformFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseTransform(rawData: any, transform: Transform, scale: number): void;
         protected _parseColorTransform(rawData: any, color: ColorTransform): void;
+        protected _parseGeometry(rawData: any, geometry: GeometryData): void;
         protected _parseArray(rawData: any): void;
         protected _modifyArray(): void;
         parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;
@@ -6610,7 +5670,7 @@ declare namespace dragonBones {
         static getInstance(): ObjectDataParser;
     }
     /**
-     * @internal
+     * @private
      */
     class ActionFrame {
         frameStart: number;
@@ -6641,25 +5701,19 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     class BinaryDataParser extends ObjectDataParser {
         private _binaryOffset;
         private _binary;
         private _intArrayBuffer;
-        private _floatArrayBuffer;
-        private _frameIntArrayBuffer;
-        private _frameFloatArrayBuffer;
         private _frameArrayBuffer;
         private _timelineArrayBuffer;
-        private _inRange(a, min, max);
-        private _decodeUTF8(data);
-        private _getUTF16Key(value);
-        private _parseBinaryTimeline(type, offset, timelineData?);
-        private _parseVertices(rawData, vertices);
-        protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;
-        protected _parsePath(rawData: any, path: PathDisplayData): void;
+        private _inRange;
+        private _decodeUTF8;
+        private _parseBinaryTimeline;
         protected _parseAnimation(rawData: any): AnimationData;
+        protected _parseGeometry(rawData: any, geometry: GeometryData): void;
         protected _parseArray(rawData: any): void;
         parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;
         private static _binaryDataParserInstance;
@@ -6752,8 +5806,8 @@ declare namespace dragonBones {
          */
         protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void;
         protected _buildConstraints(dataPackage: BuildArmaturePackage, armature: Armature): void;
-        protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, slot: Slot, displayData: DisplayData): Armature | null;
-        protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, rawDisplayData: DisplayData | null, slot: Slot): any;
+        protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, _slot: Slot, displayData: ArmatureDisplayData): Armature | null;
+        protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, slot: Slot): any;
         protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData;
         protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature;
         protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;
@@ -6814,9 +5868,20 @@ declare namespace dragonBones {
          */
         parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData;
         /**
-         * @private
+         * - Update texture atlases.
+         * @param textureAtlases - The texture atlas objects.
+         * @param name - The texture atlas name.
+         * @version DragonBones 5.7
+         * @language en_US
          */
-        updateTextureAtlasData(name: string, textureAtlases: Array): void;
+        /**
+         * - 更新贴图集对象。
+         * @param textureAtlases - 多个贴图集对象。
+         * @param name - 贴图集名称。
+         * @version DragonBones 5.7
+         * @language zh_CN
+         */
+        updateTextureAtlases(textureAtlases: Array, name: string): void;
         /**
          * - Get a specific DragonBonesData instance.
          * @param name - The DragonBonesData instance cache name.
@@ -7021,7 +6086,7 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        replaceDisplay(slot: Slot, displayData: DisplayData, displayIndex?: number): void;
+        replaceDisplay(slot: Slot, displayData: DisplayData | null, displayIndex?: number): void;
         /**
          * - Replaces the current display data for a particular slot with a specific display data.
          * Specify display data with "dragonBonesName/armatureName/slotName/displayName".
@@ -7162,31 +6227,9 @@ declare namespace dragonBones {
          * @private
          */
         readonly dragonBones: DragonBones;
-        /**
-         * - Deprecated, please refer to {@link #replaceSkin}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceSkin}。
-         * @deprecated
-         * @language zh_CN
-         */
-        changeSkin(armature: Armature, skin: SkinData, exclude?: Array | null): boolean;
-        /**
-         * - Deprecated, please refer to {@link #replaceAnimation}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceAnimation}。
-         * @deprecated
-         * @language zh_CN
-         */
-        copyAnimationsToArmature(toArmature: Armature, fromArmatreName: string, fromSkinName?: string, fromDragonBonesDataName?: string, replaceOriginalAnimation?: boolean): boolean;
     }
     /**
-     * @internal
+     * @private
      */
     class BuildArmaturePackage {
         dataName: string;
@@ -7231,10 +6274,6 @@ declare namespace dragonBones {
      */
     class EgretTextureAtlasData extends TextureAtlasData {
         static toString(): string;
-        /**
-         * @internal
-         */
-        disposeEnabled: boolean;
         private _renderTexture;
         protected _onClear(): void;
         /**
@@ -7252,36 +6291,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         renderTexture: egret.Texture | null;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#removeTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#removeTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        dispose(): void;
-        /**
-         * - Deprecated, please refer to {@link #renderTexture}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #renderTexture}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly texture: egret.Texture | null;
-    }
-    /**
-     * @internal
-     */
-    class EgretTextureData extends TextureData {
-        static toString(): string;
-        renderTexture: egret.Texture | null;
-        protected _onClear(): void;
     }
 }
 /**
@@ -7331,255 +6340,16 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly eventObject: EventObject;
+    }
+    /**
+     * @inheritDoc
+     */
+    class EgretArmatureDisplay extends egret.DisplayObjectContainer implements IArmatureProxy {
+        private static _cleanBeforeRender;
         /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly animationName: string;
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#armature}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#armature}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly armature: Armature;
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#bone}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#bone}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly bone: Bone | null;
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#slot}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#slot}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly slot: Slot | null;
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly animationState: AnimationState | null;
-        /**
-         * Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#name}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#name}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly frameLabel: string;
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#name}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#name}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly sound: string;
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly movementID: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.START}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.START}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static START: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.LOOP_COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.LOOP_COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static LOOP_COMPLETE: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static COMPLETE: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_IN}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_IN}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static FADE_IN: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_IN_COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_IN_COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static FADE_IN_COMPLETE: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_OUT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_OUT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static FADE_OUT: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_OUT_COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_OUT_COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static FADE_OUT_COMPLETE: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static FRAME_EVENT: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.SOUND_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.SOUND_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static SOUND_EVENT: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static ANIMATION_FRAME_EVENT: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static BONE_FRAME_EVENT: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static MOVEMENT_FRAME_EVENT: string;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.SOUND_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.SOUND_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static SOUND: string;
-    }
-    /**
-     * @inheritDoc
-     */
-    class EgretArmatureDisplay extends egret.DisplayObjectContainer implements IArmatureProxy {
-        private static _cleanBeforeRender();
-        /**
-         * @private
+         * @private
          */
         debugDraw: boolean;
-        /**
-         * @internal
-         */
-        _batchEnabled: boolean;
-        /**
-         * @internal
-         */
-        _childDirty: boolean;
         private _debugDraw;
         private _armature;
         private _bounds;
@@ -7644,141 +6414,6 @@ declare namespace dragonBones {
          * @inheritDoc
          */
         $measureContentBounds(bounds: egret.Rectangle): void;
-        /**
-         * @inheritDoc
-         */
-        hasEvent(type: EventStringType): boolean;
-        /**
-         * @inheritDoc
-         */
-        addEvent(type: EventStringType, listener: (event: EgretEvent) => void, target: any): void;
-        /**
-         * @inheritDoc
-         */
-        removeEvent(type: EventStringType, listener: (event: EgretEvent) => void, target: any): void;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#clock} {@link dragonBones.BaseFactory#clock}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#clock} {@link dragonBones.BaseFactory#clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        advanceTimeBySelf(on: boolean): void;
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.Armature}。
-     * @deprecated
-     * @language zh_CN
-     */
-    type FastArmature = Armature;
-    /**
-     * 已废弃,请参考 {@link dragonBones.Bone}。
-     * @deprecated
-     * @language zh_CN
-     */
-    type FastBone = Bone;
-    /**
-     * 已废弃,请参考 {@link dragonBones.Slot}。
-     * @deprecated
-     * @language zh_CN
-     */
-    type FastSlot = Slot;
-    /**
-     * 已废弃,请参考 {@link dragonBones.Animation}。
-     * @deprecated
-     * @language zh_CN
-     */
-    type FastAnimation = Animation;
-    /**
-     * 已废弃,请参考 {@link dragonBones.AnimationState}。
-     * @deprecated
-     * @language zh_CN
-     */
-    type FastAnimationState = AnimationState;
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    class Event extends EgretEvent {
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    class ArmatureEvent extends EgretEvent {
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    class AnimationEvent extends EgretEvent {
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    class FrameEvent extends EgretEvent {
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    class SoundEvent extends EgretEvent {
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。
-     * @deprecated
-     * @language zh_CN
-     */
-    class EgretTextureAtlas extends EgretTextureAtlasData {
-        static toString(): string;
-        /**
-         * 已废弃,请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        constructor(texture: egret.Texture, rawData: any, scale?: number);
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。
-     * @deprecated
-     * @language zh_CN
-     */
-    class EgretSheetAtlas extends EgretTextureAtlas {
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretFactory#soundEventManager}。
-     * @deprecated
-     * @language zh_CN
-     */
-    class SoundEventManager {
-        /**
-         * 已废弃,请参考 {@link dragonBones.EgretFactory#soundEventManager}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static getInstance(): EgretArmatureDisplay;
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.Armature#cacheFrameRate}。
-     * @deprecated
-     * @language zh_CN
-     */
-    class AnimationCacheManager {
-        /**
-         * 已废弃,请参考 {@link dragonBones.Armature#cacheFrameRate}。
-         * @deprecated
-         * @language zh_CN
-         */
-        constructor();
     }
 }
 /**
@@ -7846,22 +6481,14 @@ declare namespace dragonBones {
         protected _replaceDisplay(value: any): void;
         protected _removeDisplay(): void;
         protected _updateZOrder(): void;
-        /**
-         * @internal
-         */
-        _updateVisible(): void;
         protected _updateBlendMode(): void;
         protected _updateColor(): void;
         protected _updateFrame(): void;
         protected _updateMesh(): void;
-        /**
-         * @internal
-         */
-        _updateGlueMesh(): void;
         protected _updateTransform(): void;
         protected _identityTransform(): void;
-        private _updateTransformV4();
-        private _updateTransformV5();
+        private _updateTransformV4;
+        private _updateTransformV5;
     }
 }
 /**
@@ -7887,10 +6514,6 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
-    /**
-     * @internal
-     */
-    const isV5: boolean;
     /**
      * - The Egret factory.
      * @version DragonBones 3.0
@@ -7905,7 +6528,7 @@ declare namespace dragonBones {
         private static _time;
         private static _dragonBonesInstance;
         private static _factory;
-        private static _clockHandler(time);
+        private static _clockHandler;
         /**
          * - A global factory instance that can be used directly.
          * @version DragonBones 4.7
@@ -7924,7 +6547,7 @@ declare namespace dragonBones {
         protected _isSupportMesh(): boolean;
         protected _buildTextureAtlasData(textureAtlasData: EgretTextureAtlasData | null, textureAtlas: egret.Texture | HTMLImageElement | null): EgretTextureAtlasData;
         protected _buildArmature(dataPackage: BuildArmaturePackage): Armature;
-        protected _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;
+        protected _buildSlot(_dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;
         /**
          * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it.
          * Note that when the created armature proxy that is no longer in use, you need to explicitly dispose {@link #dragonBones.IArmatureProxy#dispose()}.
@@ -7988,484 +6611,5 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly soundEventManager: EgretArmatureDisplay;
-        /**
-         * - Deprecated, please refer to {@link #clock}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static readonly clock: WorldClock;
-        /**
-         * - Deprecated, please refer to {@link #addDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #addDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        addSkeletonData(dragonBonesData: DragonBonesData, dragonBonesName?: string | null): void;
-        /**
-         * - Deprecated, please refer to {@link #getDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #getDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        getSkeletonData(dragonBonesName: string): DragonBonesData | null;
-        /**
-         * - Deprecated, please refer to {@link #removeDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #removeDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        removeSkeletonData(dragonBonesName: string): void;
-        /**
-         * - Deprecated, please refer to {@link #addTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #addTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        addTextureAtlas(textureAtlasData: TextureAtlasData, dragonBonesName?: string | null): void;
-        /**
-         * - Deprecated, please refer to {@link #getTextureAtlas()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #getTextureAtlas()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        getTextureAtlas(dragonBonesName: string): TextureAtlasData[] | null;
-        /**
-         * - Deprecated, please refer to {@link #removeTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #removeTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        removeTextureAtlas(dragonBonesName: string): void;
-        /**
-         * - Deprecated, please refer to {@link #buildArmature()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #buildArmature()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        buildFastArmature(armatureName: string, dragonBonesName?: string, skinName?: string): FastArmature | null;
-        /**
-         * - Deprecated, please refer to {@link #clear()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #clear()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        dispose(): void;
-    }
-}
-/**
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2018 DragonBones team and other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-declare const _super: any;
-declare namespace dragonBones {
-    /**
-     * 是否包含指定名称的动画组。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function hasMovieGroup(groupName: string): boolean;
-    /**
-     * 添加动画组。
-     * @param groupData 动画二进制数据。
-     * @param textureAtlas 贴图集或贴图集列表。
-     * @param groupName 为动画组指定一个名称,如果未设置,则使用数据中的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function addMovieGroup(groupData: ArrayBuffer, textureAtlas: egret.Texture | egret.Texture[], groupName?: string | null): void;
-    /**
-     * 移除动画组。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function removeMovieGroup(groupName: string): void;
-    /**
-     * 移除所有的动画组。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function removeAllMovieGroup(): void;
-    /**
-     * 创建一个动画。
-     * @param movieName 动画的名称。
-     * @param groupName 动画组的名称,如果未设置,将检索所有的动画组,当多个动画组中包含同名的动画时,可能无法创建出准确的动画。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function buildMovie(movieName: string, groupName?: string | null): Movie | null;
-    /**
-     * 获取指定动画组内包含的所有动画名称。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function getMovieNames(groupName: string): string[] | null;
-    /**
-     * 动画事件。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    class MovieEvent extends egret.Event {
-        /**
-         * 动画剪辑开始播放。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        static START: string;
-        /**
-         * 动画剪辑循环播放一次完成。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        static LOOP_COMPLETE: string;
-        /**
-         * 动画剪辑播放完成。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        static COMPLETE: string;
-        /**
-         * 动画剪辑帧事件。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        static FRAME_EVENT: string;
-        /**
-         * 动画剪辑声音事件。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        static SOUND_EVENT: string;
-        /**
-         * 事件名称。 (帧标签的名称或声音的名称)
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        name: string;
-        /**
-         * 发出事件的插槽名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        slotName: string;
-        /**
-         * 发出事件的动画剪辑名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        clipName: string;
-        /**
-         * 发出事件的动画。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        movie: Movie;
-        /**
-         * @private
-         */
-        constructor(type: string);
-        /**
-         * @private
-         */
-        readonly armature: any;
-        /**
-         * @private
-         */
-        readonly bone: any;
-        /**
-         * @private
-         */
-        readonly animationState: any;
-        /**
-         * @private
-         */
-        readonly frameLabel: any;
-        /**
-         * @private
-         */
-        readonly movementID: any;
-    }
-    /**
-     * 通过读取缓存的二进制动画数据来更新动画,具有良好的运行性能,同时对内存的占用也非常低。
-     * @see dragonBones.buildMovie
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    class Movie extends egret.DisplayObjectContainer implements IAnimatable {
-        private static _cleanBeforeRender();
-        /**
-         * 动画的播放速度。 [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]
-         * @default 1
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        timeScale: number;
-        /**
-         * 动画剪辑的播放速度。 [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]
-         * (当再次播放其他动画剪辑时,此值将被重置为 1)
-         * @default 1
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        clipTimeScale: number;
-        private _batchEnabled;
-        private _isLockDispose;
-        private _isDelayDispose;
-        private _isStarted;
-        private _isPlaying;
-        private _isReversing;
-        private _isCompleted;
-        private _playTimes;
-        private _time;
-        private _currentTime;
-        private _currentPlayTimes;
-        private _cacheFrameIndex;
-        private _frameSize;
-        private _cacheRectangle;
-        private _clock;
-        private _groupConfig;
-        private _config;
-        private _clipConfig;
-        private _currentFrameConfig;
-        private _clipArray;
-        private _clipNames;
-        private _slots;
-        private _childMovies;
-        constructor(createMovieHelper: any);
-        private _configToEvent(config, event);
-        private _onCrossFrame(frameConfig);
-        private _updateSlotBlendMode(slot);
-        private _updateSlotColor(slot, aM, rM, gM, bM, aO, rO, gO, bO);
-        private _updateSlotDisplay(slot);
-        private _getSlot(name);
-        /**
-         * @inheritDoc
-         */
-        $render(): void;
-        /**
-         * @inheritDoc
-         */
-        $updateRenderNode(): void;
-        /**
-         * @inheritDoc
-         */
-        $measureContentBounds(bounds: egret.Rectangle): void;
-        /**
-         * @inheritDoc
-         */
-        $doAddChild(child: egret.DisplayObject, index: number, notifyListeners?: boolean): egret.DisplayObject;
-        /**
-         * @inheritDoc
-         */
-        $doRemoveChild(index: number, notifyListeners?: boolean): egret.DisplayObject;
-        /**
-         * 释放动画。
-         * @version DragonBones 3.0
-         * @language zh_CN
-         */
-        dispose(): void;
-        /**
-         * @inheritDoc
-         */
-        advanceTime(passedTime: number): void;
-        /**
-         * 播放动画剪辑。
-         * @param clipName 动画剪辑的名称,如果未设置,则播放默认动画剪辑,或将暂停状态切换为播放状态,或重新播放上一个正在播放的动画剪辑。
-         * @param playTimes 动画剪辑需要播放的次数。 [-1: 使用动画剪辑默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次]
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        play(clipName?: string | null, playTimes?: number): void;
-        /**
-         * 暂停播放动画。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        stop(): void;
-        /**
-         * 从指定时间播放动画。
-         * @param clipName 动画剪辑的名称。
-         * @param time 指定时间。(以秒为单位)
-         * @param playTimes 动画剪辑需要播放的次数。 [-1: 使用动画剪辑默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次]
-         * @version DragonBones 5.0
-         * @language zh_CN
-         */
-        gotoAndPlay(clipName: string | null | undefined, time: number, playTimes?: number): void;
-        /**
-         * 将动画停止到指定时间。
-         * @param clipName 动画剪辑的名称。
-         * @param time 指定时间。(以秒为单位)
-         * @version DragonBones 5.0
-         * @language zh_CN
-         */
-        gotoAndStop(clipName: string | null | undefined, time: number): void;
-        /**
-         * 是否包含指定动画剪辑。
-         * @param clipName 动画剪辑的名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        hasClip(clipName: string): boolean;
-        /**
-         * 动画剪辑是否处正在播放。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        readonly isPlaying: boolean;
-        /**
-         * 动画剪辑是否均播放完毕。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        readonly isComplete: boolean;
-        /**
-         * 当前动画剪辑的播放时间。 (以秒为单位)
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        readonly currentTime: number;
-        /**
-         * 当前动画剪辑的总时间。 (以秒为单位)
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        readonly totalTime: number;
-        /**
-         * 当前动画剪辑的播放次数。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        readonly currentPlayTimes: number;
-        /**
-         * 当前动画剪辑需要播放的次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次]
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        readonly playTimes: number;
-        readonly groupName: string;
-        /**
-         * 正在播放的动画剪辑名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        readonly clipName: string;
-        /**
-         * 所有动画剪辑的名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        readonly clipNames: string[];
-        /**
-         * @inheritDoc
-         */
-        clock: WorldClock | null;
-        /**
-         * 已废弃,请参考 {@link dragonBones.Movie#clock} {@link dragonBones.Movie#clock} {@link dragonBones.EgretFactory#clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        advanceTimeBySelf(on: boolean): void;
-        /**
-         * @private
-         */
-        readonly display: any;
-        /**
-         * @private
-         */
-        readonly animation: any;
-        /**
-         * @private
-         */
-        readonly armature: any;
-        /**
-         * @private
-         */
-        getAnimation(): any;
-        /**
-         * @private
-         */
-        getArmature(): any;
-        /**
-         * @private
-         */
-        getDisplay(): any;
-        /**
-         * @private
-         */
-        hasAnimation(name: string): boolean;
-        /**
-         * @private
-         */
-        invalidUpdate(...args: any[]): void;
-        /**
-         * @private
-         */
-        readonly lastAnimationName: string;
-        /**
-         * @private
-         */
-        readonly animationNames: string[];
-        /**
-         * @private
-         */
-        readonly animationList: string[];
     }
 }
diff --git a/Egret/4.x/out/dragonBones.js b/Egret/4.x/out/dragonBones.js
index 59091a98..e88692ae 100644
--- a/Egret/4.x/out/dragonBones.js
+++ b/Egret/4.x/out/dragonBones.js
@@ -9,9 +9,6 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
-var dragonBones;
-(function (dragonBones) {
-})(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
  *
@@ -61,7 +58,7 @@ var dragonBones;
                 for (var i = 0; i < this._events.length; ++i) {
                     var eventObject = this._events[i];
                     var armature = eventObject.armature;
-                    if (armature._armatureData !== null) {
+                    if (armature._armatureData !== null) { // May be armature disposed before advanceTime.
                         armature.eventDispatcher.dispatchDBEvent(eventObject.type, eventObject);
                         if (eventObject.type === dragonBones.EventObject.SOUND_EVENT) {
                             this._eventManager.dispatchDBEvent(eventObject.type, eventObject);
@@ -96,20 +93,15 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        DragonBones.VERSION = "5.6.300";
+        DragonBones.VERSION = "5.7.000";
         DragonBones.yDown = true;
         DragonBones.debug = false;
         DragonBones.debugDraw = false;
-        DragonBones.webAssembly = false;
         return DragonBones;
     }());
     dragonBones.DragonBones = DragonBones;
 })(dragonBones || (dragonBones = {}));
 //
-if (typeof global === "undefined") {
-    var global = window;
-}
-//
 if (!console.warn) {
     console.warn = function () { };
 }
@@ -134,6 +126,22 @@ var __extends = function (t, e) {
     }
     r.prototype = e.prototype, t.prototype = new r();
 };
+//
+if (typeof global === "undefined" && typeof window !== "undefined") {
+    var global = window;
+}
+if (typeof exports === "object" && typeof module === "object") {
+    module.exports = dragonBones;
+}
+else if (typeof define === "function" && define["amd"]) {
+    define(["dragonBones"], function () { return dragonBones; });
+}
+else if (typeof exports === "object") {
+    exports = dragonBones;
+}
+else if (typeof global !== "undefined") {
+    global.dragonBones = dragonBones;
+}
 /**
  * The MIT License (MIT)
  *
@@ -219,7 +227,7 @@ var dragonBones;
          * @language zh_CN
          */
         BaseObject.setMaxCount = function (objectConstructor, maxCount) {
-            if (maxCount < 0 || maxCount !== maxCount) {
+            if (maxCount < 0 || maxCount !== maxCount) { // isNaN
                 maxCount = 0;
             }
             if (objectConstructor !== null) {
@@ -796,7 +804,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ColorTransform = /** @class */ (function () {
         function ColorTransform(alphaMultiplier, redMultiplier, greenMultiplier, blueMultiplier, alphaOffset, redOffset, greenOffset, blueOffset) {
@@ -1128,7 +1136,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.UserData = UserData;
     /**
-     * @internal
+     * @private
      */
     var ActionData = /** @class */ (function (_super) {
         __extends(ActionData, _super);
@@ -1252,6 +1260,7 @@ var dragonBones;
             this.frameFloatArray = null; //
             this.frameArray = null; //
             this.timelineArray = null; //
+            this.colorArray = null; //
             this.userData = null;
         };
         /**
@@ -1281,20 +1290,6 @@ var dragonBones;
         DragonBonesData.prototype.getArmature = function (armatureName) {
             return armatureName in this.armatures ? this.armatures[armatureName] : null;
         };
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.BaseFactory#removeDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.BaseFactory#removeDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DragonBonesData.prototype.dispose = function () {
-            console.warn("已废弃");
-            this.returnToPool();
-        };
         return DragonBonesData;
     }(dragonBones.BaseObject));
     dragonBones.DragonBonesData = DragonBonesData;
@@ -1479,7 +1474,7 @@ var dragonBones;
                     continue;
                 }
                 var flag = false;
-                for (var k in this.constraints) {
+                for (var k in this.constraints) { // Wait constraint.
                     var constraint = this.constraints[k];
                     if (constraint.root === bone && this.sortedBones.indexOf(constraint.target) < 0) {
                         flag = true;
@@ -1489,7 +1484,7 @@ var dragonBones;
                 if (flag) {
                     continue;
                 }
-                if (bone.parent !== null && this.sortedBones.indexOf(bone.parent) < 0) {
+                if (bone.parent !== null && this.sortedBones.indexOf(bone.parent) < 0) { // Wait parent.
                     continue;
                 }
                 this.sortedBones.push(bone);
@@ -1500,7 +1495,7 @@ var dragonBones;
          * @internal
          */
         ArmatureData.prototype.cacheFrames = function (frameRate) {
-            if (this.cacheFrameRate > 0) {
+            if (this.cacheFrameRate > 0) { // TODO clear cache.
                 return;
             }
             this.cacheFrameRate = frameRate;
@@ -1736,6 +1731,7 @@ var dragonBones;
             this.inheritReflection = false;
             this.type = 0 /* Bone */;
             this.length = 0.0;
+            this.alpha = 1.0;
             this.name = "";
             this.transform.identity();
             this.userData = null;
@@ -1751,7 +1747,7 @@ var dragonBones;
         __extends(SurfaceData, _super);
         function SurfaceData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = [];
+            _this.geometry = new dragonBones.GeometryData();
             return _this;
         }
         SurfaceData.toString = function () {
@@ -1762,7 +1758,7 @@ var dragonBones;
             this.type = 1 /* Surface */;
             this.segmentX = 0;
             this.segmentY = 0;
-            this.vertices.length = 0;
+            this.geometry.clear();
         };
         return SurfaceData;
     }(BoneData));
@@ -1807,6 +1803,8 @@ var dragonBones;
             this.blendMode = 0 /* Normal */;
             this.displayIndex = 0;
             this.zOrder = 0;
+            this.zIndex = 0;
+            this.alpha = 1.0;
             this.name = "";
             this.color = null; //
             this.userData = null;
@@ -1845,7 +1843,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var CanvasData = /** @class */ (function (_super) {
         __extends(CanvasData, _super);
@@ -1995,7 +1993,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ConstraintData = /** @class */ (function (_super) {
         __extends(ConstraintData, _super);
@@ -2092,13 +2090,13 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
-    var VerticesData = /** @class */ (function () {
-        function VerticesData() {
+    var GeometryData = /** @class */ (function () {
+        function GeometryData() {
             this.weight = null; // Initial value.
         }
-        VerticesData.prototype.clear = function () {
+        GeometryData.prototype.clear = function () {
             if (!this.isShared && this.weight !== null) {
                 this.weight.returnToPool();
             }
@@ -2108,16 +2106,32 @@ var dragonBones;
             this.data = null;
             this.weight = null;
         };
-        VerticesData.prototype.shareFrom = function (value) {
+        GeometryData.prototype.shareFrom = function (value) {
             this.isShared = true;
             this.offset = value.offset;
             this.weight = value.weight;
         };
-        return VerticesData;
+        Object.defineProperty(GeometryData.prototype, "vertexCount", {
+            get: function () {
+                var intArray = this.data.intArray;
+                return intArray[this.offset + 0 /* GeometryVertexCount */];
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(GeometryData.prototype, "triangleCount", {
+            get: function () {
+                var intArray = this.data.intArray;
+                return intArray[this.offset + 1 /* GeometryTriangleCount */];
+            },
+            enumerable: true,
+            configurable: true
+        });
+        return GeometryData;
     }());
-    dragonBones.VerticesData = VerticesData;
+    dragonBones.GeometryData = GeometryData;
     /**
-     * @internal
+     * @private
      */
     var DisplayData = /** @class */ (function (_super) {
         __extends(DisplayData, _super);
@@ -2136,7 +2150,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.DisplayData = DisplayData;
     /**
-     * @internal
+     * @private
      */
     var ImageDisplayData = /** @class */ (function (_super) {
         __extends(ImageDisplayData, _super);
@@ -2158,7 +2172,7 @@ var dragonBones;
     }(DisplayData));
     dragonBones.ImageDisplayData = ImageDisplayData;
     /**
-     * @internal
+     * @private
      */
     var ArmatureDisplayData = /** @class */ (function (_super) {
         __extends(ArmatureDisplayData, _super);
@@ -2191,13 +2205,13 @@ var dragonBones;
     }(DisplayData));
     dragonBones.ArmatureDisplayData = ArmatureDisplayData;
     /**
-     * @internal
+     * @private
      */
     var MeshDisplayData = /** @class */ (function (_super) {
         __extends(MeshDisplayData, _super);
         function MeshDisplayData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = new VerticesData();
+            _this.geometry = new GeometryData();
             return _this;
         }
         MeshDisplayData.toString = function () {
@@ -2206,14 +2220,14 @@ var dragonBones;
         MeshDisplayData.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
             this.type = 2 /* Mesh */;
-            this.vertices.clear();
+            this.geometry.clear();
             this.texture = null;
         };
         return MeshDisplayData;
     }(DisplayData));
     dragonBones.MeshDisplayData = MeshDisplayData;
     /**
-     * @internal
+     * @private
      */
     var BoundingBoxDisplayData = /** @class */ (function (_super) {
         __extends(BoundingBoxDisplayData, _super);
@@ -2237,13 +2251,13 @@ var dragonBones;
     }(DisplayData));
     dragonBones.BoundingBoxDisplayData = BoundingBoxDisplayData;
     /**
-     * @internal
+     * @private
      */
     var PathDisplayData = /** @class */ (function (_super) {
         __extends(PathDisplayData, _super);
         function PathDisplayData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = new VerticesData();
+            _this.geometry = new GeometryData();
             _this.curveLengths = [];
             return _this;
         }
@@ -2255,14 +2269,14 @@ var dragonBones;
             this.type = 4 /* Path */;
             this.closed = false;
             this.constantSpeed = false;
-            this.vertices.clear();
+            this.geometry.clear();
             this.curveLengths.length = 0;
         };
         return PathDisplayData;
     }(DisplayData));
     dragonBones.PathDisplayData = PathDisplayData;
     /**
-     * @internal
+     * @private
      */
     var WeightData = /** @class */ (function (_super) {
         __extends(WeightData, _super);
@@ -2362,16 +2376,16 @@ var dragonBones;
          */
         RectangleBoundingBoxData._computeOutCode = function (x, y, xMin, yMin, xMax, yMax) {
             var code = 0 /* InSide */; // initialised as being inside of [[clip window]]
-            if (x < xMin) {
+            if (x < xMin) { // to the left of clip window
                 code |= 1 /* Left */;
             }
-            else if (x > xMax) {
+            else if (x > xMax) { // to the right of clip window
                 code |= 2 /* Right */;
             }
-            if (y < yMin) {
+            if (y < yMin) { // below the clip window
                 code |= 4 /* Top */;
             }
-            else if (y > yMax) {
+            else if (y > yMax) { // above the clip window
                 code |= 8 /* Bottom */;
             }
             return code;
@@ -2392,11 +2406,11 @@ var dragonBones;
             var outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax);
             var outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax);
             while (true) {
-                if ((outcode0 | outcode1) === 0) {
+                if ((outcode0 | outcode1) === 0) { // Bitwise OR is 0. Trivially accept and get out of loop
                     intersectionCount = 2;
                     break;
                 }
-                else if ((outcode0 & outcode1) !== 0) {
+                else if ((outcode0 & outcode1) !== 0) { // Bitwise AND is not 0. Trivially reject and get out of loop
                     break;
                 }
                 // failed both tests, so calculate the line segment to clip
@@ -2407,28 +2421,28 @@ var dragonBones;
                 // At least one endpoint is outside the clip rectangle; pick it.
                 var outcodeOut = outcode0 !== 0 ? outcode0 : outcode1;
                 // Now find the intersection point;
-                if ((outcodeOut & 4 /* Top */) !== 0) {
+                if ((outcodeOut & 4 /* Top */) !== 0) { // point is above the clip rectangle
                     x = xA + (xB - xA) * (yMin - yA) / (yB - yA);
                     y = yMin;
                     if (normalRadians !== null) {
                         normalRadian = -Math.PI * 0.5;
                     }
                 }
-                else if ((outcodeOut & 8 /* Bottom */) !== 0) {
+                else if ((outcodeOut & 8 /* Bottom */) !== 0) { // point is below the clip rectangle
                     x = xA + (xB - xA) * (yMax - yA) / (yB - yA);
                     y = yMax;
                     if (normalRadians !== null) {
                         normalRadian = Math.PI * 0.5;
                     }
                 }
-                else if ((outcodeOut & 2 /* Right */) !== 0) {
+                else if ((outcodeOut & 2 /* Right */) !== 0) { // point is to the right of clip rectangle
                     y = yA + (yB - yA) * (xMax - xA) / (xB - xA);
                     x = xMax;
                     if (normalRadians !== null) {
                         normalRadian = 0;
                     }
                 }
-                else if ((outcodeOut & 1 /* Left */) !== 0) {
+                else if ((outcodeOut & 1 /* Left */) !== 0) { // point is to the left of clip rectangle
                     y = yA + (yB - yA) * (xMin - xA) / (xB - xA);
                     x = xMin;
                     if (normalRadians !== null) {
@@ -2910,10 +2924,6 @@ var dragonBones;
              * @private
              */
             _this.boneTimelines = {};
-            /**
-             * @private
-             */
-            _this.surfaceTimelines = {};
             /**
              * @private
              */
@@ -2955,30 +2965,23 @@ var dragonBones;
                 }
                 delete this.boneTimelines[k];
             }
-            for (var k in this.surfaceTimelines) {
-                for (var _b = 0, _c = this.surfaceTimelines[k]; _b < _c.length; _b++) {
-                    var timeline = _c[_b];
-                    timeline.returnToPool();
-                }
-                delete this.surfaceTimelines[k];
-            }
             for (var k in this.slotTimelines) {
-                for (var _d = 0, _e = this.slotTimelines[k]; _d < _e.length; _d++) {
-                    var timeline = _e[_d];
+                for (var _b = 0, _c = this.slotTimelines[k]; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
                     timeline.returnToPool();
                 }
                 delete this.slotTimelines[k];
             }
             for (var k in this.constraintTimelines) {
-                for (var _f = 0, _g = this.constraintTimelines[k]; _f < _g.length; _f++) {
-                    var timeline = _g[_f];
+                for (var _d = 0, _e = this.constraintTimelines[k]; _d < _e.length; _d++) {
+                    var timeline = _e[_d];
                     timeline.returnToPool();
                 }
                 delete this.constraintTimelines[k];
             }
             for (var k in this.animationTimelines) {
-                for (var _h = 0, _j = this.animationTimelines[k]; _h < _j.length; _h++) {
-                    var timeline = _j[_h];
+                for (var _f = 0, _g = this.animationTimelines[k]; _f < _g.length; _f++) {
+                    var timeline = _g[_f];
                     timeline.returnToPool();
                 }
                 delete this.animationTimelines[k];
@@ -2998,6 +3001,7 @@ var dragonBones;
             this.frameIntOffset = 0;
             this.frameFloatOffset = 0;
             this.frameOffset = 0;
+            this.blendType = 0 /* None */;
             this.frameCount = 0;
             this.playTimes = 0;
             this.duration = 0.0;
@@ -3007,7 +3011,6 @@ var dragonBones;
             this.name = "";
             this.cachedFrames.length = 0;
             // this.boneTimelines.clear();
-            // this.surfaceTimelines.clear();
             // this.slotTimelines.clear();
             // this.constraintTimelines.clear();
             // this.animationTimelines.clear();
@@ -3021,7 +3024,7 @@ var dragonBones;
          * @internal
          */
         AnimationData.prototype.cacheFrames = function (frameRate) {
-            if (this.cacheFrameRate > 0.0) {
+            if (this.cacheFrameRate > 0.0) { // TODO clear cache.
                 return;
             }
             this.cacheFrameRate = Math.max(Math.ceil(frameRate * this.scale), 1.0);
@@ -3050,17 +3053,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addBoneTimeline = function (bone, timeline) {
-            var timelines = bone.name in this.boneTimelines ? this.boneTimelines[bone.name] : (this.boneTimelines[bone.name] = []);
-            if (timelines.indexOf(timeline) < 0) {
-                timelines.push(timeline);
-            }
-        };
-        /**
-         * @private
-         */
-        AnimationData.prototype.addSurfaceTimeline = function (surface, timeline) {
-            var timelines = surface.name in this.surfaceTimelines ? this.surfaceTimelines[surface.name] : (this.surfaceTimelines[surface.name] = []);
+        AnimationData.prototype.addBoneTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : (this.boneTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3068,8 +3062,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addSlotTimeline = function (slot, timeline) {
-            var timelines = slot.name in this.slotTimelines ? this.slotTimelines[slot.name] : (this.slotTimelines[slot.name] = []);
+        AnimationData.prototype.addSlotTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : (this.slotTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3077,8 +3071,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addConstraintTimeline = function (constraint, timeline) {
-            var timelines = constraint.name in this.constraintTimelines ? this.constraintTimelines[constraint.name] : (this.constraintTimelines[constraint.name] = []);
+        AnimationData.prototype.addConstraintTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : (this.constraintTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3098,12 +3092,6 @@ var dragonBones;
         AnimationData.prototype.getBoneTimelines = function (timelineName) {
             return timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : null;
         };
-        /**
-         * @private
-         */
-        AnimationData.prototype.getSurfaceTimelines = function (timelineName) {
-            return timelineName in this.surfaceTimelines ? this.surfaceTimelines[timelineName] : null;
-        };
         /**
          * @private
          */
@@ -3138,7 +3126,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.AnimationData = AnimationData;
     /**
-     * @internal
+     * @private
      */
     var TimelineData = /** @class */ (function (_super) {
         __extends(TimelineData, _super);
@@ -3156,6 +3144,25 @@ var dragonBones;
         return TimelineData;
     }(dragonBones.BaseObject));
     dragonBones.TimelineData = TimelineData;
+    /**
+     * @internal
+     */
+    var AnimationTimelineData = /** @class */ (function (_super) {
+        __extends(AnimationTimelineData, _super);
+        function AnimationTimelineData() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationTimelineData.toString = function () {
+            return "[class dragonBones.AnimationTimelineData]";
+        };
+        AnimationTimelineData.prototype._onClear = function () {
+            _super.prototype._onClear.call(this);
+            this.x = 0.0;
+            this.y = 0.0;
+        };
+        return AnimationTimelineData;
+    }(TimelineData));
+    dragonBones.AnimationTimelineData = AnimationTimelineData;
 })(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
@@ -3216,7 +3223,7 @@ var dragonBones;
             this.fadeOutTweenType = 1 /* Line */;
             this.fadeOutTime = -1.0;
             this.actionEnabled = true;
-            this.additiveBlending = false;
+            this.additive = false;
             this.displayControl = true;
             this.pauseFadeIn = true;
             this.resetToPose = true;
@@ -3249,7 +3256,7 @@ var dragonBones;
             this.autoFadeOutTime = value.autoFadeOutTime;
             this.fadeOutTweenType = value.fadeOutTweenType;
             this.actionEnabled = value.actionEnabled;
-            this.additiveBlending = value.additiveBlending;
+            this.additive = value.additive;
             this.displayControl = value.displayControl;
             this.pauseFadeIn = value.pauseFadeIn;
             this.resetToPose = value.resetToPose;
@@ -3270,68 +3277,6 @@ var dragonBones;
                 this.boneMask[i] = value.boneMask[i];
             }
         };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.containsBoneMask = function (boneName) {
-            return this.boneMask.length === 0 || this.boneMask.indexOf(boneName) >= 0;
-        };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.addBoneMask = function (armature, boneName, recursive) {
-            if (recursive === void 0) { recursive = true; }
-            var currentBone = armature.getBone(boneName);
-            if (currentBone === null) {
-                return;
-            }
-            if (this.boneMask.indexOf(boneName) < 0) {
-                this.boneMask.push(boneName);
-            }
-            if (recursive) {
-                for (var _i = 0, _a = armature.getBones(); _i < _a.length; _i++) {
-                    var bone = _a[_i];
-                    if (this.boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) {
-                        this.boneMask.push(bone.name);
-                    }
-                }
-            }
-        };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.removeBoneMask = function (armature, boneName, recursive) {
-            if (recursive === void 0) { recursive = true; }
-            var index = this.boneMask.indexOf(boneName);
-            if (index >= 0) {
-                this.boneMask.splice(index, 1);
-            }
-            if (recursive) {
-                var currentBone = armature.getBone(boneName);
-                if (currentBone !== null) {
-                    if (this.boneMask.length > 0) {
-                        for (var _i = 0, _a = armature.getBones(); _i < _a.length; _i++) {
-                            var bone = _a[_i];
-                            var index_1 = this.boneMask.indexOf(bone.name);
-                            if (index_1 >= 0 && currentBone.contains(bone)) {
-                                this.boneMask.splice(index_1, 1);
-                            }
-                        }
-                    }
-                    else {
-                        for (var _b = 0, _c = armature.getBones(); _b < _c.length; _b++) {
-                            var bone = _c[_b];
-                            if (bone === currentBone) {
-                                continue;
-                            }
-                            if (!currentBone.contains(bone)) {
-                                this.boneMask.push(bone.name);
-                            }
-                        }
-                    }
-                }
-            }
-        };
         return AnimationConfig;
     }(dragonBones.BaseObject));
     dragonBones.AnimationConfig = AnimationConfig;
@@ -3435,7 +3380,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.TextureAtlasData = TextureAtlasData;
     /**
-     * @internal
+     * @private
      */
     var TextureData = /** @class */ (function (_super) {
         __extends(TextureData, _super);
@@ -3497,94 +3442,6 @@ var dragonBones;
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 var dragonBones;
-(function (dragonBones) {
-    /**
-     * @internal
-     */
-    var DeformVertices = /** @class */ (function (_super) {
-        __extends(DeformVertices, _super);
-        function DeformVertices() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = [];
-            _this.bones = [];
-            return _this;
-        }
-        DeformVertices.toString = function () {
-            return "[class dragonBones.DeformVertices]";
-        };
-        DeformVertices.prototype._onClear = function () {
-            this.verticesDirty = false;
-            this.vertices.length = 0;
-            this.bones.length = 0;
-            this.verticesData = null;
-        };
-        DeformVertices.prototype.init = function (verticesDataValue, armature) {
-            this.verticesData = verticesDataValue;
-            if (this.verticesData !== null) {
-                var vertexCount = 0;
-                if (this.verticesData.weight !== null) {
-                    vertexCount = this.verticesData.weight.count * 2;
-                }
-                else {
-                    vertexCount = this.verticesData.data.intArray[this.verticesData.offset + 0 /* MeshVertexCount */] * 2;
-                }
-                this.verticesDirty = true;
-                this.vertices.length = vertexCount;
-                this.bones.length = 0;
-                //
-                for (var i = 0, l = this.vertices.length; i < l; ++i) {
-                    this.vertices[i] = 0.0;
-                }
-                if (this.verticesData.weight !== null) {
-                    for (var i = 0, l = this.verticesData.weight.bones.length; i < l; ++i) {
-                        var bone = armature.getBone(this.verticesData.weight.bones[i].name);
-                        this.bones.push(bone);
-                    }
-                }
-            }
-            else {
-                this.verticesDirty = false;
-                this.vertices.length = 0;
-                this.bones.length = 0;
-                this.verticesData = null;
-            }
-        };
-        DeformVertices.prototype.isBonesUpdate = function () {
-            for (var _i = 0, _a = this.bones; _i < _a.length; _i++) {
-                var bone = _a[_i];
-                if (bone !== null && bone._childrenTransformDirty) {
-                    return true;
-                }
-            }
-            return false;
-        };
-        return DeformVertices;
-    }(dragonBones.BaseObject));
-    dragonBones.DeformVertices = DeformVertices;
-})(dragonBones || (dragonBones = {}));
-/**
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2018 DragonBones team and other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-var dragonBones;
 (function (dragonBones_1) {
     /**
      * - Armature is the core of the skeleton animation system.
@@ -3628,10 +3485,10 @@ var dragonBones;
             return "[class dragonBones.Armature]";
         };
         Armature._onSortSlots = function (a, b) {
-            return a._zOrder > b._zOrder ? 1 : -1;
+            return a._zIndex * 1000 + a._zOrder > b._zIndex * 1000 + b._zOrder ? 1 : -1;
         };
         Armature.prototype._onClear = function () {
-            if (this._clock !== null) {
+            if (this._clock !== null) { // Remove clock first.
                 this._clock.remove(this);
             }
             for (var _i = 0, _a = this._bones; _i < _a.length; _i++) {
@@ -3664,9 +3521,13 @@ var dragonBones;
             this._lockUpdate = false;
             this._slotsDirty = true;
             this._zOrderDirty = false;
+            this._zIndexDirty = false;
+            this._alphaDirty = true;
             this._flipX = false;
             this._flipY = false;
             this._cacheFrameIndex = -1;
+            this._alpha = 1.0;
+            this._globalAlpha = 1.0;
             this._bones.length = 0;
             this._slots.length = 0;
             this._constraints.length = 0;
@@ -3696,7 +3557,7 @@ var dragonBones;
                     var slotData = slotDatas[slotIndex];
                     var slot = this.getSlot(slotData.name);
                     if (slot !== null) {
-                        slot._setZorder(i);
+                        slot._setZOrder(i);
                     }
                 }
                 this._slotsDirty = true;
@@ -3789,6 +3650,7 @@ var dragonBones;
             if (this._lockUpdate) {
                 return;
             }
+            this._lockUpdate = true;
             if (this._armatureData === null) {
                 console.warn("The armature has been disposed.");
                 return;
@@ -3801,9 +3663,28 @@ var dragonBones;
             // Update animation.
             this._animation.advanceTime(passedTime);
             // Sort slots.
-            if (this._slotsDirty) {
-                this._slotsDirty = false;
+            if (this._slotsDirty || this._zIndexDirty) {
                 this._slots.sort(Armature._onSortSlots);
+                if (this._zIndexDirty) {
+                    for (var i = 0, l = this._slots.length; i < l; ++i) {
+                        this._slots[i]._setZOrder(i); // 
+                    }
+                }
+                this._slotsDirty = false;
+                this._zIndexDirty = false;
+            }
+            // Update alpha.
+            if (this._alphaDirty) {
+                this._alphaDirty = false;
+                this._globalAlpha = this._alpha * (this._parent !== null ? this._parent._globalAlpha : 1.0);
+                for (var _i = 0, _a = this._bones; _i < _a.length; _i++) {
+                    var bone = _a[_i];
+                    bone._updateAlpha();
+                }
+                for (var _b = 0, _c = this._slots; _b < _c.length; _b++) {
+                    var slot = _c[_b];
+                    slot._updateAlpha();
+                }
             }
             // Update bones and slots.
             if (this._cacheFrameIndex < 0 || this._cacheFrameIndex !== prevCacheFrameIndex) {
@@ -3817,9 +3698,8 @@ var dragonBones;
             }
             // Do actions.
             if (this._actions.length > 0) {
-                this._lockUpdate = true;
-                for (var _i = 0, _a = this._actions; _i < _a.length; _i++) {
-                    var action = _a[_i];
+                for (var _d = 0, _e = this._actions; _d < _e.length; _d++) {
+                    var action = _e[_d];
                     var actionData = action.actionData;
                     if (actionData !== null) {
                         if (actionData.type === 0 /* Play */) {
@@ -3830,8 +3710,8 @@ var dragonBones;
                                 }
                             }
                             else if (action.bone !== null) {
-                                for (var _b = 0, _c = this.getSlots(); _b < _c.length; _b++) {
-                                    var slot = _c[_b];
+                                for (var _f = 0, _g = this.getSlots(); _f < _g.length; _f++) {
+                                    var slot = _g[_f];
                                     if (slot.parent === action.bone) {
                                         var childArmature = slot.childArmature;
                                         if (childArmature !== null) {
@@ -3848,8 +3728,8 @@ var dragonBones;
                     action.returnToPool();
                 }
                 this._actions.length = 0;
-                this._lockUpdate = false;
             }
+            this._lockUpdate = false;
             this._proxy.dbUpdate();
         };
         /**
@@ -4422,69 +4302,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * @deprecated
-         * @private
-         */
-        Armature.prototype.replaceTexture = function (texture) {
-            this.replacedTexture = texture;
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.hasEventListener = function (type) {
-            console.warn("Deprecated.");
-            return this._proxy.hasDBEventListener(type);
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.addEventListener = function (type, listener, target) {
-            console.warn("Deprecated.");
-            this._proxy.addDBEventListener(type, listener, target);
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.removeEventListener = function (type, listener, target) {
-            console.warn("Deprecated.");
-            this._proxy.removeDBEventListener(type, listener, target);
-        };
-        /**
-         * - Deprecated, please refer to {@link #cacheFrameRate}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #cacheFrameRate}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.enableAnimationCache = function (frameRate) {
-            console.warn("Deprecated.");
-            this.cacheFrameRate = frameRate;
-        };
         /**
          * - Deprecated, please refer to {@link #display}.
          * @deprecated
@@ -4590,6 +4407,8 @@ var dragonBones;
             this.origin = null;
             this.userData = null;
             this._globalDirty = false;
+            this._alpha = 1.0;
+            this._globalAlpha = 1.0;
             this._armature = null; //
         };
         /**
@@ -4696,10 +4515,6 @@ var dragonBones;
              * @internal
              */
             _this.animationPose = new dragonBones.Transform();
-            /**
-             * @internal
-             */
-            _this._blendState = new dragonBones.BlendState();
             return _this;
         }
         Bone.toString = function () {
@@ -4715,7 +4530,6 @@ var dragonBones;
             this._hasConstraint = false;
             this._visible = true;
             this._cachedFrameIndex = -1;
-            this._blendState.clear();
             this._boneData = null; //
             this._parent = null; //
             this._cachedFrameIndices = null;
@@ -4737,14 +4551,27 @@ var dragonBones;
                 if (origin !== null) {
                     // global.copyFrom(this.origin).add(this.offset).add(this.animationPose);
                     global.x = origin.x + offset.x + animationPose.x;
-                    global.y = origin.y + offset.y + animationPose.y;
-                    global.skew = origin.skew + offset.skew + animationPose.skew;
-                    global.rotation = origin.rotation + offset.rotation + animationPose.rotation;
                     global.scaleX = origin.scaleX * offset.scaleX * animationPose.scaleX;
                     global.scaleY = origin.scaleY * offset.scaleY * animationPose.scaleY;
+                    if (dragonBones.DragonBones.yDown) {
+                        global.y = origin.y + offset.y + animationPose.y;
+                        global.skew = origin.skew + offset.skew + animationPose.skew;
+                        global.rotation = origin.rotation + offset.rotation + animationPose.rotation;
+                    }
+                    else {
+                        global.y = origin.y - offset.y + animationPose.y;
+                        global.skew = origin.skew - offset.skew + animationPose.skew;
+                        global.rotation = origin.rotation - offset.rotation + animationPose.rotation;
+                    }
                 }
                 else {
-                    global.copyFrom(offset).add(animationPose);
+                    global.copyFrom(offset);
+                    if (!dragonBones.DragonBones.yDown) {
+                        global.y = -global.y;
+                        global.skew = -global.skew;
+                        global.rotation = -global.rotation;
+                    }
+                    global.add(animationPose);
                 }
             }
             else if (this.offsetMode === 0 /* None */) {
@@ -4758,41 +4585,68 @@ var dragonBones;
             else {
                 inherit = false;
                 global.copyFrom(offset);
+                if (!dragonBones.DragonBones.yDown) {
+                    global.y = -global.y;
+                    global.skew = -global.skew;
+                    global.rotation = -global.rotation;
+                }
             }
             if (inherit) {
-                var parentMatrix = parent._boneData.type === 0 /* Bone */ ? parent.globalTransformMatrix : parent._getGlobalTransformMatrix(global.x, global.y);
-                if (boneData.inheritScale) {
-                    if (!boneData.inheritRotation) {
-                        parent.updateGlobalTransform();
-                        if (flipX && flipY) {
-                            rotation = global.rotation - (parent.global.rotation + Math.PI);
-                        }
-                        else if (flipX) {
-                            rotation = global.rotation + parent.global.rotation + Math.PI;
+                var isSurface = parent._boneData.type === 1 /* Surface */;
+                var surfaceBone = isSurface ? parent._bone : null;
+                var parentMatrix = isSurface ? parent._getGlobalTransformMatrix(global.x, global.y) : parent.globalTransformMatrix;
+                if (boneData.inheritScale && (!isSurface || surfaceBone !== null)) {
+                    if (isSurface) {
+                        if (boneData.inheritRotation) {
+                            global.rotation += parent.global.rotation;
                         }
-                        else if (flipY) {
-                            rotation = global.rotation + parent.global.rotation;
+                        surfaceBone.updateGlobalTransform();
+                        global.scaleX *= surfaceBone.global.scaleX;
+                        global.scaleY *= surfaceBone.global.scaleY;
+                        parentMatrix.transformPoint(global.x, global.y, global);
+                        global.toMatrix(globalTransformMatrix);
+                        if (boneData.inheritTranslation) {
+                            global.x = globalTransformMatrix.tx;
+                            global.y = globalTransformMatrix.ty;
                         }
                         else {
-                            rotation = global.rotation - parent.global.rotation;
+                            globalTransformMatrix.tx = global.x;
+                            globalTransformMatrix.ty = global.y;
                         }
-                        global.rotation = rotation;
-                    }
-                    global.toMatrix(globalTransformMatrix);
-                    globalTransformMatrix.concat(parentMatrix);
-                    if (boneData.inheritTranslation) {
-                        global.x = globalTransformMatrix.tx;
-                        global.y = globalTransformMatrix.ty;
-                    }
-                    else {
-                        globalTransformMatrix.tx = global.x;
-                        globalTransformMatrix.ty = global.y;
-                    }
-                    if (isCache) {
-                        global.fromMatrix(globalTransformMatrix);
                     }
                     else {
-                        this._globalDirty = true;
+                        if (!boneData.inheritRotation) {
+                            parent.updateGlobalTransform();
+                            if (flipX && flipY) {
+                                rotation = global.rotation - (parent.global.rotation + Math.PI);
+                            }
+                            else if (flipX) {
+                                rotation = global.rotation + parent.global.rotation + Math.PI;
+                            }
+                            else if (flipY) {
+                                rotation = global.rotation + parent.global.rotation;
+                            }
+                            else {
+                                rotation = global.rotation - parent.global.rotation;
+                            }
+                            global.rotation = rotation;
+                        }
+                        global.toMatrix(globalTransformMatrix);
+                        globalTransformMatrix.concat(parentMatrix);
+                        if (boneData.inheritTranslation) {
+                            global.x = globalTransformMatrix.tx;
+                            global.y = globalTransformMatrix.ty;
+                        }
+                        else {
+                            globalTransformMatrix.tx = global.x;
+                            globalTransformMatrix.ty = global.y;
+                        }
+                        if (isCache) {
+                            global.fromMatrix(globalTransformMatrix);
+                        }
+                        else {
+                            this._globalDirty = true;
+                        }
                     }
                 }
                 else {
@@ -4823,6 +4677,9 @@ var dragonBones;
                             if (flipX !== flipY || boneData.inheritReflection) {
                                 global.skew += Math.PI;
                             }
+                            if (!dragonBones.DragonBones.yDown) {
+                                global.skew = -global.skew;
+                            }
                         }
                         global.rotation = rotation;
                     }
@@ -4869,6 +4726,17 @@ var dragonBones;
                 global.toMatrix(globalTransformMatrix);
             }
         };
+        /**
+         * @internal
+         */
+        Bone.prototype._updateAlpha = function () {
+            if (this._parent !== null) {
+                this._globalAlpha = this._alpha * this._parent._globalAlpha;
+            }
+            else {
+                this._globalAlpha = this._alpha * this._armature._globalAlpha;
+            }
+        };
         /**
          * @internal
          */
@@ -4878,6 +4746,7 @@ var dragonBones;
             }
             this._boneData = boneData;
             this._armature = armatureValue;
+            this._alpha = this._boneData.alpha;
             if (this._boneData.parent !== null) {
                 this._parent = this._armature.getBone(this._boneData.parent.name);
             }
@@ -4889,18 +4758,17 @@ var dragonBones;
          * @internal
          */
         Bone.prototype.update = function (cacheFrameIndex) {
-            this._blendState.dirty = false;
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
-                if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) {
+                if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache.
                     this._transformDirty = false;
                 }
-                else if (cachedFrameIndex >= 0) {
+                else if (cachedFrameIndex >= 0) { // Has been Cached.
                     this._transformDirty = true;
                     this._cachedFrameIndex = cachedFrameIndex;
                 }
                 else {
-                    if (this._hasConstraint) {
+                    if (this._hasConstraint) { // Update constraints.
                         for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) {
                             var constraint = _a[_i];
                             if (constraint._root === this) {
@@ -4909,22 +4777,22 @@ var dragonBones;
                         }
                     }
                     if (this._transformDirty ||
-                        (this._parent !== null && this._parent._childrenTransformDirty)) {
+                        (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty.
                         this._transformDirty = true;
                         this._cachedFrameIndex = -1;
                     }
-                    else if (this._cachedFrameIndex >= 0) {
+                    else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet.
                         this._transformDirty = false;
                         this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex;
                     }
-                    else {
+                    else { // Dirty.
                         this._transformDirty = true;
                         this._cachedFrameIndex = -1;
                     }
                 }
             }
             else {
-                if (this._hasConstraint) {
+                if (this._hasConstraint) { // Update constraints.
                     for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) {
                         var constraint = _c[_b];
                         if (constraint._root === this) {
@@ -4932,7 +4800,7 @@ var dragonBones;
                         }
                     }
                 }
-                if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) {
+                if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty.
                     cacheFrameIndex = -1;
                     this._transformDirty = true;
                     this._cachedFrameIndex = -1;
@@ -5107,72 +4975,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getBones()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getBones()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Bone.prototype.getBones = function () {
-            console.warn("Deprecated.");
-            var bones = new Array();
-            for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) {
-                var bone = _a[_i];
-                if (bone.parent === this) {
-                    bones.push(bone);
-                }
-            }
-            return bones;
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getSlots()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getSlots()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Bone.prototype.getSlots = function () {
-            console.warn("Deprecated.");
-            var slots = new Array();
-            for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) {
-                var slot = _a[_i];
-                if (slot.parent === this) {
-                    slots.push(slot);
-                }
-            }
-            return slots;
-        };
-        Object.defineProperty(Bone.prototype, "slot", {
-            /**
-             * - Deprecated, please refer to {@link dragonBones.Armature#getSlot()}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link dragonBones.Armature#getSlot()}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) {
-                    var slot = _a[_i];
-                    if (slot.parent === this) {
-                        return slot;
-                    }
-                }
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         return Bone;
     }(dragonBones.TransformObject));
     dragonBones.Bone = Bone;
@@ -5234,6 +5036,7 @@ var dragonBones;
             this._deformVertices.length = 0;
             this._matrixCahce.length = 0;
             this._hullCache.length = 0;
+            this._bone = null;
         };
         Surface.prototype._getAffineTransform = function (x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown) {
             var dabX = bX - aX;
@@ -5252,35 +5055,43 @@ var dragonBones;
             transform.y = matrix.ty = aY - (matrix.b * x + matrix.d * y);
         };
         Surface.prototype._updateVertices = function () {
-            var originalVertices = this._boneData.vertices;
+            var data = this._armature.armatureData.parent;
+            var geometry = this._boneData.geometry;
+            var intArray = data.intArray;
+            var floatArray = data.floatArray;
+            var vertexCount = intArray[geometry.offset + 0 /* GeometryVertexCount */];
+            var verticesOffset = intArray[geometry.offset + 2 /* GeometryFloatOffset */];
             var vertices = this._vertices;
             var animationVertices = this._deformVertices;
             if (this._parent !== null) {
                 if (this._parent._boneData.type === 1 /* Surface */) {
-                    for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                        var x = originalVertices[i] + animationVertices[i];
-                        var y = originalVertices[i + 1] + animationVertices[i];
+                    for (var i = 0, l = vertexCount; i < l; ++i) {
+                        var iD = i * 2;
+                        var x = floatArray[verticesOffset + iD] + animationVertices[iD];
+                        var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                         var matrix = this._parent._getGlobalTransformMatrix(x, y);
                         //
-                        vertices[i] = matrix.a * x + matrix.c * y + matrix.tx;
-                        vertices[i + 1] = matrix.b * x + matrix.d * y + matrix.ty;
+                        vertices[iD] = matrix.a * x + matrix.c * y + matrix.tx;
+                        vertices[iD + 1] = matrix.b * x + matrix.d * y + matrix.ty;
                     }
                 }
                 else {
                     var parentMatrix = this._parent.globalTransformMatrix;
-                    for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                        var x = originalVertices[i] + animationVertices[i];
-                        var y = originalVertices[i + 1] + animationVertices[i + 1];
+                    for (var i = 0, l = vertexCount; i < l; ++i) {
+                        var iD = i * 2;
+                        var x = floatArray[verticesOffset + iD] + animationVertices[iD];
+                        var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                         //
-                        vertices[i] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx;
-                        vertices[i + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty;
+                        vertices[iD] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx;
+                        vertices[iD + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty;
                     }
                 }
             }
             else {
-                for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                    vertices[i] = originalVertices[i] + animationVertices[i];
-                    vertices[i + 1] = originalVertices[i + 1] + animationVertices[i + 1];
+                for (var i = 0, l = vertexCount; i < l; ++i) {
+                    var iD = i * 2;
+                    vertices[iD] = floatArray[verticesOffset + iD] + animationVertices[iD];
+                    vertices[iD + 1] = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                 }
             }
         };
@@ -5310,17 +5121,17 @@ var dragonBones;
             var bY = rbY + (rcY - rbY) * 0.5;
             var cX = rdX + (rcX - rdX) * 0.5;
             var cY = rdY + (rcY - rdY) * 0.5;
-            //
-            this._globalDirty = false;
+            // TODO interpolation
             this._getAffineTransform(0.0, 0.0, lA, lA, aX, aY, bX, bY, cX, cY, this.global, this.globalTransformMatrix, false);
+            this._globalDirty = false;
         };
         Surface.prototype._getGlobalTransformMatrix = function (x, y) {
+            var lA = 200.0;
             var lB = 1000.0;
             if (x < -lB || lB < x || y < -lB || lB < y) {
                 return this.globalTransformMatrix;
             }
             var isDown = false;
-            var lA = 200.0;
             var surfaceData = this._boneData;
             var segmentX = surfaceData.segmentX;
             var segmentY = surfaceData.segmentY;
@@ -5332,16 +5143,17 @@ var dragonBones;
             var matrixIndex = 0;
             var pX = indexX * dX - lA;
             var pY = indexY * dY - lA;
+            //
             var matrices = this._matrixCahce;
             var helpMatrix = Surface._helpMatrix;
             if (x < -lA) {
-                if (y < -lA || y >= lA) {
+                if (y < -lA || y >= lA) { // Out.
                     return this.globalTransformMatrix;
                 }
                 // Left.
                 isDown = y > this._kX * (x + lA) + pY;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX * 2 + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + segmentY + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5367,13 +5179,13 @@ var dragonBones;
                 }
             }
             else if (x >= lA) {
-                if (y < -lA || y >= lA) {
+                if (y < -lA || y >= lA) { // Out.
                     return this.globalTransformMatrix;
                 }
                 // Right.
                 isDown = y > this._kX * (x - lB) + pY;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5399,13 +5211,13 @@ var dragonBones;
                 }
             }
             else if (y < -lA) {
-                if (x < -lA || x >= lA) {
+                if (x < -lA || x >= lA) { // Out.
                     return this.globalTransformMatrix;
                 }
                 // Up.
                 isDown = y > this._kY * (x - pX - dX) - lB;
-                matrixIndex = (segmentX * (segmentY + 1) + indexX * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5431,13 +5243,13 @@ var dragonBones;
                 }
             }
             else if (y >= lA) {
-                if (x < -lA || x >= lA) {
+                if (x < -lA || x >= lA) { //  Out.
                     return this.globalTransformMatrix;
                 }
                 // Down
                 isDown = y > this._kY * (x - pX - dX) + lA;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5462,10 +5274,10 @@ var dragonBones;
                     matrices[matrixIndex + 6] = helpMatrix.ty;
                 }
             }
-            else {
+            else { // Center.
                 isDown = y > this._k * (x - pX - dX) + pY;
                 matrixIndex = ((segmentX * indexY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5499,7 +5311,7 @@ var dragonBones;
             _super.prototype.init.call(this, surfaceData, armatureValue);
             var segmentX = surfaceData.segmentX;
             var segmentY = surfaceData.segmentY;
-            var vertexCount = surfaceData.vertices.length;
+            var vertexCount = this._armature.armatureData.parent.intArray[surfaceData.geometry.offset + 0 /* GeometryVertexCount */];
             var lB = 1000.0;
             var lA = 200.0;
             //
@@ -5508,30 +5320,37 @@ var dragonBones;
             this._k = -this._dY / this._dX;
             this._kX = -this._dY / (lB - lA);
             this._kY = -(lB - lA) / this._dX;
-            this._vertices.length = vertexCount;
-            this._deformVertices.length = vertexCount;
+            this._vertices.length = vertexCount * 2;
+            this._deformVertices.length = vertexCount * 2;
             this._matrixCahce.length = (segmentX * segmentY + segmentX * 2 + segmentY * 2) * 2 * 7;
             this._hullCache.length = 10;
-            for (var i = 0; i < vertexCount; ++i) {
+            for (var i = 0; i < vertexCount * 2; ++i) {
                 this._deformVertices[i] = 0.0;
             }
+            if (this._parent !== null) {
+                if (this._parent.boneData.type === 0 /* Bone */) {
+                    this._bone = this._parent;
+                }
+                else {
+                    this._bone = this._parent._bone;
+                }
+            }
         };
         /**
          * @internal
          */
         Surface.prototype.update = function (cacheFrameIndex) {
-            this._blendState.dirty = false;
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
-                if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) {
+                if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache.
                     this._transformDirty = false;
                 }
-                else if (cachedFrameIndex >= 0) {
+                else if (cachedFrameIndex >= 0) { // Has been Cached.
                     this._transformDirty = true;
                     this._cachedFrameIndex = cachedFrameIndex;
                 }
                 else {
-                    if (this._hasConstraint) {
+                    if (this._hasConstraint) { // Update constraints.
                         for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) {
                             var constraint = _a[_i];
                             if (constraint._root === this) {
@@ -5540,22 +5359,22 @@ var dragonBones;
                         }
                     }
                     if (this._transformDirty ||
-                        (this._parent !== null && this._parent._childrenTransformDirty)) {
+                        (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty.
                         this._transformDirty = true;
                         this._cachedFrameIndex = -1;
                     }
-                    else if (this._cachedFrameIndex >= 0) {
+                    else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet.
                         this._transformDirty = false;
                         this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex;
                     }
-                    else {
+                    else { // Dirty.
                         this._transformDirty = true;
                         this._cachedFrameIndex = -1;
                     }
                 }
             }
             else {
-                if (this._hasConstraint) {
+                if (this._hasConstraint) { // Update constraints.
                     for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) {
                         var constraint = _c[_b];
                         if (constraint._root === this) {
@@ -5563,7 +5382,7 @@ var dragonBones;
                         }
                     }
                 }
-                if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) {
+                if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty.
                     cacheFrameIndex = -1;
                     this._transformDirty = true;
                     this._cachedFrameIndex = -1;
@@ -5649,6 +5468,105 @@ var dragonBones;
  */
 var dragonBones;
 (function (dragonBones) {
+    /**
+     * @private
+     */
+    var DisplayFrame = /** @class */ (function (_super) {
+        __extends(DisplayFrame, _super);
+        function DisplayFrame() {
+            var _this = _super !== null && _super.apply(this, arguments) || this;
+            _this.deformVertices = [];
+            return _this;
+        }
+        DisplayFrame.toString = function () {
+            return "[class dragonBones.DisplayFrame]";
+        };
+        DisplayFrame.prototype._onClear = function () {
+            this.rawDisplayData = null;
+            this.displayData = null;
+            this.textureData = null;
+            this.display = null;
+            this.deformVertices.length = 0;
+        };
+        DisplayFrame.prototype.updateDeformVertices = function () {
+            if (this.rawDisplayData === null || this.deformVertices.length !== 0) {
+                return;
+            }
+            var rawGeometryData;
+            if (this.rawDisplayData.type === 2 /* Mesh */) {
+                rawGeometryData = this.rawDisplayData.geometry;
+            }
+            else if (this.rawDisplayData.type === 4 /* Path */) {
+                rawGeometryData = this.rawDisplayData.geometry;
+            }
+            else {
+                return;
+            }
+            var vertexCount = 0;
+            if (rawGeometryData.weight !== null) {
+                vertexCount = rawGeometryData.weight.count * 2;
+            }
+            else {
+                vertexCount = rawGeometryData.data.intArray[rawGeometryData.offset + 0 /* GeometryVertexCount */] * 2;
+            }
+            this.deformVertices.length = vertexCount;
+            for (var i = 0, l = this.deformVertices.length; i < l; ++i) {
+                this.deformVertices[i] = 0.0;
+            }
+        };
+        DisplayFrame.prototype.getGeometryData = function () {
+            if (this.displayData !== null) {
+                if (this.displayData.type === 2 /* Mesh */) {
+                    return this.displayData.geometry;
+                }
+                if (this.displayData.type === 4 /* Path */) {
+                    return this.displayData.geometry;
+                }
+            }
+            if (this.rawDisplayData !== null) {
+                if (this.rawDisplayData.type === 2 /* Mesh */) {
+                    return this.rawDisplayData.geometry;
+                }
+                if (this.rawDisplayData.type === 4 /* Path */) {
+                    return this.rawDisplayData.geometry;
+                }
+            }
+            return null;
+        };
+        DisplayFrame.prototype.getBoundingBox = function () {
+            if (this.displayData !== null && this.displayData.type === 3 /* BoundingBox */) {
+                return this.displayData.boundingBox;
+            }
+            if (this.rawDisplayData !== null && this.rawDisplayData.type === 3 /* BoundingBox */) {
+                return this.rawDisplayData.boundingBox;
+            }
+            return null;
+        };
+        DisplayFrame.prototype.getTextureData = function () {
+            if (this.displayData !== null) {
+                if (this.displayData.type === 0 /* Image */) {
+                    return this.displayData.texture;
+                }
+                if (this.displayData.type === 2 /* Mesh */) {
+                    return this.displayData.texture;
+                }
+            }
+            if (this.textureData !== null) {
+                return this.textureData;
+            }
+            if (this.rawDisplayData !== null) {
+                if (this.rawDisplayData.type === 0 /* Image */) {
+                    return this.rawDisplayData.texture;
+                }
+                if (this.rawDisplayData.type === 2 /* Mesh */) {
+                    return this.rawDisplayData.texture;
+                }
+            }
+            return null;
+        };
+        return DisplayFrame;
+    }(dragonBones.BaseObject));
+    dragonBones.DisplayFrame = DisplayFrame;
     /**
      * - The slot attached to the armature, controls the display status and properties of the display object.
      * A bone can contain multiple slots.
@@ -5682,25 +5600,30 @@ var dragonBones;
              * @internal
              */
             _this._colorTransform = new dragonBones.ColorTransform();
-            _this._displayDatas = [];
-            _this._displayList = [];
             /**
              * @internal
              */
-            _this._deformVertices = null;
+            _this._displayFrames = [];
+            /**
+             * @internal
+             */
+            _this._geometryBones = [];
             _this._rawDisplay = null; // Initial value.
             _this._meshDisplay = null; // Initial value.
+            _this._display = null;
             return _this;
         }
         Slot.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
             var disposeDisplayList = [];
-            for (var _i = 0, _a = this._displayList; _i < _a.length; _i++) {
-                var eachDisplay = _a[_i];
-                if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                    disposeDisplayList.indexOf(eachDisplay) < 0) {
-                    disposeDisplayList.push(eachDisplay);
+            for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                var dispayFrame = _a[_i];
+                var display = dispayFrame.display;
+                if (display !== this._rawDisplay && display !== this._meshDisplay &&
+                    disposeDisplayList.indexOf(display) < 0) {
+                    disposeDisplayList.push(display);
                 }
+                dispayFrame.returnToPool();
             }
             for (var _b = 0, disposeDisplayList_1 = disposeDisplayList; _b < disposeDisplayList_1.length; _b++) {
                 var eachDisplay = disposeDisplayList_1[_b];
@@ -5711,39 +5634,41 @@ var dragonBones;
                     this._disposeDisplay(eachDisplay, true);
                 }
             }
-            if (this._deformVertices !== null) {
-                this._deformVertices.returnToPool();
-            }
-            if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) {
+            if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) { // May be _meshDisplay and _rawDisplay is the same one.
                 this._disposeDisplay(this._meshDisplay, false);
             }
             if (this._rawDisplay !== null) {
                 this._disposeDisplay(this._rawDisplay, false);
             }
             this.displayController = null;
+            this._displayDataDirty = false;
             this._displayDirty = false;
-            this._zOrderDirty = false;
+            this._geometryDirty = false;
+            this._textureDirty = false;
+            this._visibleDirty = false;
             this._blendModeDirty = false;
+            this._zOrderDirty = false;
             this._colorDirty = false;
+            this._verticesDirty = false;
             this._transformDirty = false;
             this._visible = true;
             this._blendMode = 0 /* Normal */;
             this._displayIndex = -1;
             this._animationDisplayIndex = -1;
             this._zOrder = 0;
+            this._zIndex = 0;
             this._cachedFrameIndex = -1;
             this._pivotX = 0.0;
             this._pivotY = 0.0;
             this._localMatrix.identity();
             this._colorTransform.identity();
-            this._displayList.length = 0;
-            this._displayDatas.length = 0;
+            this._displayFrames.length = 0;
+            this._geometryBones.length = 0;
             this._slotData = null; //
-            this._rawDisplayDatas = null;
-            this._displayData = null;
+            this._displayFrame = null;
+            this._geometryData = null;
             this._boundingBoxData = null;
             this._textureData = null;
-            this._deformVertices = null;
             this._rawDisplay = null;
             this._meshDisplay = null;
             this._display = null;
@@ -5751,73 +5676,60 @@ var dragonBones;
             this._parent = null; //
             this._cachedFrameIndices = null;
         };
+        Slot.prototype._hasDisplay = function (display) {
+            for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                var displayFrame = _a[_i];
+                if (displayFrame.display === display) {
+                    return true;
+                }
+            }
+            return false;
+        };
         /**
-         * - Support default skin data.
+         * @internal
          */
-        Slot.prototype._getDefaultRawDisplayData = function (displayIndex) {
-            var defaultSkin = this._armature._armatureData.defaultSkin;
-            if (defaultSkin !== null) {
-                var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name);
-                if (defaultRawDisplayDatas !== null) {
-                    return displayIndex < defaultRawDisplayDatas.length ? defaultRawDisplayDatas[displayIndex] : null;
+        Slot.prototype._isBonesUpdate = function () {
+            for (var _i = 0, _a = this._geometryBones; _i < _a.length; _i++) {
+                var bone = _a[_i];
+                if (bone !== null && bone._childrenTransformDirty) {
+                    return true;
                 }
             }
-            return null;
+            return false;
+        };
+        /**
+         * @internal
+         */
+        Slot.prototype._updateAlpha = function () {
+            var globalAlpha = this._alpha * this._parent._globalAlpha;
+            if (this._globalAlpha !== globalAlpha) {
+                this._globalAlpha = globalAlpha;
+                this._colorDirty = true;
+            }
         };
         Slot.prototype._updateDisplayData = function () {
-            var prevDisplayData = this._displayData;
-            var prevVerticesData = this._deformVertices !== null ? this._deformVertices.verticesData : null;
+            var prevDisplayFrame = this._displayFrame;
+            var prevGeometryData = this._geometryData;
             var prevTextureData = this._textureData;
             var rawDisplayData = null;
-            var currentVerticesData = null;
-            this._displayData = null;
+            var displayData = null;
+            this._displayFrame = null;
+            this._geometryData = null;
             this._boundingBoxData = null;
             this._textureData = null;
-            if (this._displayIndex >= 0) {
-                if (this._rawDisplayDatas !== null) {
-                    rawDisplayData = this._displayIndex < this._rawDisplayDatas.length ? this._rawDisplayDatas[this._displayIndex] : null;
-                }
-                if (rawDisplayData === null) {
-                    rawDisplayData = this._getDefaultRawDisplayData(this._displayIndex);
-                }
-                if (this._displayIndex < this._displayDatas.length) {
-                    this._displayData = this._displayDatas[this._displayIndex];
-                }
-            }
-            if (this._displayData !== null) {
-                if (this._displayData.type === 2 /* Mesh */) {
-                    currentVerticesData = this._displayData.vertices;
-                }
-                else if (this._displayData.type === 4 /* Path */) {
-                    currentVerticesData = this._displayData.vertices;
-                }
-                else if (rawDisplayData !== null) {
-                    if (rawDisplayData.type === 2 /* Mesh */) {
-                        currentVerticesData = rawDisplayData.vertices;
-                    }
-                    else if (rawDisplayData.type === 4 /* Path */) {
-                        currentVerticesData = rawDisplayData.vertices;
-                    }
-                }
-                if (this._displayData.type === 3 /* BoundingBox */) {
-                    this._boundingBoxData = this._displayData.boundingBox;
-                }
-                else if (rawDisplayData !== null) {
-                    if (rawDisplayData.type === 3 /* BoundingBox */) {
-                        this._boundingBoxData = rawDisplayData.boundingBox;
-                    }
-                }
-                if (this._displayData.type === 0 /* Image */) {
-                    this._textureData = this._displayData.texture;
-                }
-                else if (this._displayData.type === 2 /* Mesh */) {
-                    this._textureData = this._displayData.texture;
-                }
-            }
-            if (this._displayData !== prevDisplayData || currentVerticesData !== prevVerticesData || this._textureData !== prevTextureData) {
+            if (this._displayIndex >= 0 && this._displayIndex < this._displayFrames.length) {
+                this._displayFrame = this._displayFrames[this._displayIndex];
+                rawDisplayData = this._displayFrame.rawDisplayData;
+                displayData = this._displayFrame.displayData;
+                this._geometryData = this._displayFrame.getGeometryData();
+                this._boundingBoxData = this._displayFrame.getBoundingBox();
+                this._textureData = this._displayFrame.getTextureData();
+            }
+            if (this._displayFrame !== prevDisplayFrame ||
+                this._geometryData !== prevGeometryData || this._textureData !== prevTextureData) {
                 // Update pivot offset.
-                if (currentVerticesData === null && this._textureData !== null) {
-                    var imageDisplayData = this._displayData;
+                if (this._geometryData === null && this._textureData !== null) {
+                    var imageDisplayData = ((displayData !== null && displayData.type === 0 /* Image */) ? displayData : rawDisplayData); //
                     var scale = this._textureData.parent.scale * this._armature._armatureData.scale;
                     var frame = this._textureData.frame;
                     this._pivotX = imageDisplayData.pivot.x;
@@ -5836,13 +5748,13 @@ var dragonBones;
                         this._pivotY += frame.y * scale;
                     }
                     // Update replace pivot. TODO
-                    if (this._displayData !== null && rawDisplayData !== null && this._displayData !== rawDisplayData) {
+                    if (rawDisplayData !== null && imageDisplayData !== rawDisplayData) {
                         rawDisplayData.transform.toMatrix(Slot._helpMatrix);
                         Slot._helpMatrix.invert();
                         Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint);
                         this._pivotX -= Slot._helpPoint.x;
                         this._pivotY -= Slot._helpPoint.y;
-                        this._displayData.transform.toMatrix(Slot._helpMatrix);
+                        imageDisplayData.transform.toMatrix(Slot._helpMatrix);
                         Slot._helpMatrix.invert();
                         Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint);
                         this._pivotX += Slot._helpPoint.x;
@@ -5857,26 +5769,41 @@ var dragonBones;
                     this._pivotY = 0.0;
                 }
                 // Update original transform.
-                if (rawDisplayData !== null) {
+                if (rawDisplayData !== null) { // Compatible.
                     this.origin = rawDisplayData.transform;
                 }
-                else if (this._displayData !== null) {
-                    this.origin = this._displayData.transform;
+                else if (displayData !== null) { // Compatible.
+                    this.origin = displayData.transform;
                 }
                 else {
                     this.origin = null;
                 }
-                // Update vertices.
-                if (currentVerticesData !== prevVerticesData) {
-                    if (this._deformVertices === null) {
-                        this._deformVertices = dragonBones.BaseObject.borrowObject(dragonBones.DeformVertices);
-                    }
-                    this._deformVertices.init(currentVerticesData, this._armature);
+                // TODO remove slot offset.
+                if (this.origin !== null) {
+                    this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix);
                 }
-                else if (this._deformVertices !== null && this._textureData !== prevTextureData) {
-                    this._deformVertices.verticesDirty = true;
+                else {
+                    this.global.copyFrom(this.offset).toMatrix(this._localMatrix);
+                }
+                // Update geometry.
+                if (this._geometryData !== prevGeometryData) {
+                    this._geometryDirty = true;
+                    this._verticesDirty = true;
+                    if (this._geometryData !== null) {
+                        this._geometryBones.length = 0;
+                        if (this._geometryData.weight !== null) {
+                            for (var i = 0, l = this._geometryData.weight.bones.length; i < l; ++i) {
+                                var bone = this._armature.getBone(this._geometryData.weight.bones[i].name);
+                                this._geometryBones.push(bone);
+                            }
+                        }
+                    }
+                    else {
+                        this._geometryBones.length = 0;
+                        this._geometryData = null;
+                    }
                 }
-                this._displayDirty = true;
+                this._textureDirty = this._textureData !== prevTextureData;
                 this._transformDirty = true;
             }
         };
@@ -5884,8 +5811,8 @@ var dragonBones;
             var prevDisplay = this._display !== null ? this._display : this._rawDisplay;
             var prevChildArmature = this._childArmature;
             // Update display and child armature.
-            if (this._displayIndex >= 0 && this._displayIndex < this._displayList.length) {
-                this._display = this._displayList[this._displayIndex];
+            if (this._displayFrame !== null) {
+                this._display = this._displayFrame.display;
                 if (this._display !== null && this._display instanceof dragonBones.Armature) {
                     this._childArmature = this._display;
                     this._display = this._childArmature.display;
@@ -5901,16 +5828,14 @@ var dragonBones;
             // Update display.
             var currentDisplay = this._display !== null ? this._display : this._rawDisplay;
             if (currentDisplay !== prevDisplay) {
-                this._onUpdateDisplay();
-                this._replaceDisplay(prevDisplay);
-                this._transformDirty = true;
+                this._textureDirty = true;
                 this._visibleDirty = true;
                 this._blendModeDirty = true;
+                // this._zOrderDirty = true;
                 this._colorDirty = true;
-            }
-            // Update frame.
-            if (currentDisplay === this._rawDisplay || currentDisplay === this._meshDisplay) {
-                this._updateFrame();
+                this._transformDirty = true;
+                this._onUpdateDisplay();
+                this._replaceDisplay(prevDisplay);
             }
             // Update child armature.
             if (this._childArmature !== prevChildArmature) {
@@ -5924,7 +5849,7 @@ var dragonBones;
                 if (this._childArmature !== null) {
                     this._childArmature._parent = this; // Update child armature parent.
                     this._childArmature.clock = this._armature.clock;
-                    if (this._childArmature.inheritAnimation) {
+                    if (this._childArmature.inheritAnimation) { // Set child armature cache frameRate.
                         if (this._childArmature.cacheFrameRate === 0) {
                             var cacheFrameRate = this._armature.cacheFrameRate;
                             if (cacheFrameRate !== 0) {
@@ -5932,31 +5857,25 @@ var dragonBones;
                             }
                         }
                         // Child armature action.
-                        var actions = null;
-                        if (this._displayData !== null && this._displayData.type === 1 /* Armature */) {
-                            actions = this._displayData.actions;
-                        }
-                        else if (this._displayIndex >= 0 && this._rawDisplayDatas !== null) {
-                            var rawDisplayData = this._displayIndex < this._rawDisplayDatas.length ? this._rawDisplayDatas[this._displayIndex] : null;
-                            if (rawDisplayData === null) {
-                                rawDisplayData = this._getDefaultRawDisplayData(this._displayIndex);
+                        if (this._displayFrame !== null) {
+                            var actions = null;
+                            var displayData = this._displayFrame.displayData !== null ? this._displayFrame.displayData : this._displayFrame.rawDisplayData;
+                            if (displayData !== null && displayData.type === 1 /* Armature */) {
+                                actions = displayData.actions;
                             }
-                            if (rawDisplayData !== null && rawDisplayData.type === 1 /* Armature */) {
-                                actions = rawDisplayData.actions;
+                            if (actions !== null && actions.length > 0) {
+                                for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
+                                    var action = actions_1[_i];
+                                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                                    dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature);
+                                    eventObject.slot = this;
+                                    this._armature._bufferAction(eventObject, false);
+                                }
                             }
-                        }
-                        if (actions !== null && actions.length > 0) {
-                            for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
-                                var action = actions_1[_i];
-                                var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                                dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature);
-                                eventObject.slot = this;
-                                this._armature._bufferAction(eventObject, false);
+                            else {
+                                this._childArmature.animation.play();
                             }
                         }
-                        else {
-                            this._childArmature.animation.play();
-                        }
                     }
                 }
             }
@@ -5979,24 +5898,23 @@ var dragonBones;
             if (isAnimation === void 0) { isAnimation = false; }
             if (isAnimation) {
                 if (this._animationDisplayIndex === value) {
-                    return false;
+                    return;
                 }
                 this._animationDisplayIndex = value;
             }
             if (this._displayIndex === value) {
-                return false;
+                return;
             }
-            this._displayIndex = value;
-            this._displayDirty = true;
-            this._updateDisplayData();
-            return this._displayDirty;
+            this._displayIndex = value < this._displayFrames.length ? value : this._displayFrames.length - 1;
+            this._displayDataDirty = true;
+            this._displayDirty = this._displayIndex < 0 || this._display !== this._displayFrames[this._displayIndex].display;
         };
         /**
          * @internal
          */
-        Slot.prototype._setZorder = function (value) {
+        Slot.prototype._setZOrder = function (value) {
             if (this._zOrder === value) {
-                //return false;
+                // return false;
             }
             this._zOrder = value;
             this._zOrderDirty = true;
@@ -6007,37 +5925,7 @@ var dragonBones;
          */
         Slot.prototype._setColor = function (value) {
             this._colorTransform.copyFrom(value);
-            this._colorDirty = true;
-            return this._colorDirty;
-        };
-        /**
-         * @internal
-         */
-        Slot.prototype._setDisplayList = function (value) {
-            if (value !== null && value.length > 0) {
-                if (this._displayList.length !== value.length) {
-                    this._displayList.length = value.length;
-                }
-                for (var i = 0, l = value.length; i < l; ++i) {
-                    var eachDisplay = value[i];
-                    if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                        !(eachDisplay instanceof dragonBones.Armature) && this._displayList.indexOf(eachDisplay) < 0) {
-                        this._initDisplay(eachDisplay, true);
-                    }
-                    this._displayList[i] = eachDisplay;
-                }
-            }
-            else if (this._displayList.length > 0) {
-                this._displayList.length = 0;
-            }
-            if (this._displayIndex >= 0 && this._displayIndex < this._displayList.length) {
-                this._displayDirty = this._display !== this._displayList[this._displayIndex];
-            }
-            else {
-                this._displayDirty = this._display !== null;
-            }
-            this._updateDisplayData();
-            return this._displayDirty;
+            return this._colorDirty = true;
         };
         /**
          * @internal
@@ -6047,18 +5935,17 @@ var dragonBones;
                 return;
             }
             this._slotData = slotData;
-            //
-            this._visibleDirty = true;
-            this._blendModeDirty = true;
-            this._colorDirty = true;
+            this._colorDirty = true; //
+            this._blendModeDirty = true; //
             this._blendMode = this._slotData.blendMode;
             this._zOrder = this._slotData.zOrder;
+            this._zIndex = this._slotData.zIndex;
+            this._alpha = this._slotData.alpha;
             this._colorTransform.copyFrom(this._slotData.color);
             this._rawDisplay = rawDisplay;
             this._meshDisplay = meshDisplay;
             //
             this._armature = armatureValue;
-            //
             var slotParent = this._armature.getBone(this._slotData.parent.name);
             if (slotParent !== null) {
                 this._parent = slotParent;
@@ -6079,80 +5966,81 @@ var dragonBones;
          * @internal
          */
         Slot.prototype.update = function (cacheFrameIndex) {
+            if (this._displayDataDirty) {
+                this._updateDisplayData();
+                this._displayDataDirty = false;
+            }
             if (this._displayDirty) {
-                this._displayDirty = false;
                 this._updateDisplay();
-                // TODO remove slot offset.
-                if (this._transformDirty) {
-                    if (this.origin !== null) {
-                        this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix);
-                    }
-                    else {
-                        this.global.copyFrom(this.offset).toMatrix(this._localMatrix);
-                    }
+                this._displayDirty = false;
+            }
+            if (this._geometryDirty || this._textureDirty) {
+                if (this._display === null || this._display === this._rawDisplay || this._display === this._meshDisplay) {
+                    this._updateFrame();
                 }
+                this._geometryDirty = false;
+                this._textureDirty = false;
+            }
+            if (this._display === null) {
+                return;
+            }
+            if (this._visibleDirty) {
+                this._updateVisible();
+                this._visibleDirty = false;
+            }
+            if (this._blendModeDirty) {
+                this._updateBlendMode();
+                this._blendModeDirty = false;
+            }
+            if (this._colorDirty) {
+                this._updateColor();
+                this._colorDirty = false;
             }
             if (this._zOrderDirty) {
-                this._zOrderDirty = false;
                 this._updateZOrder();
+                this._zOrderDirty = false;
+            }
+            if (this._geometryData !== null && this._display === this._meshDisplay) {
+                var isSkinned = this._geometryData.weight !== null;
+                var isSurface = this._parent._boneData.type !== 0 /* Bone */;
+                if (this._verticesDirty ||
+                    (isSkinned && this._isBonesUpdate()) ||
+                    (isSurface && this._parent._childrenTransformDirty)) {
+                    this._verticesDirty = false; // Allow update mesh to reset the dirty value.
+                    this._updateMesh();
+                }
+                if (isSkinned || isSurface) { // Compatible.
+                    return;
+                }
             }
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
-                if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) {
+                if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache.
                     this._transformDirty = false;
                 }
-                else if (cachedFrameIndex >= 0) {
+                else if (cachedFrameIndex >= 0) { // Has been Cached.
                     this._transformDirty = true;
                     this._cachedFrameIndex = cachedFrameIndex;
                 }
-                else if (this._transformDirty || this._parent._childrenTransformDirty) {
+                else if (this._transformDirty || this._parent._childrenTransformDirty) { // Dirty.
                     this._transformDirty = true;
                     this._cachedFrameIndex = -1;
                 }
-                else if (this._cachedFrameIndex >= 0) {
+                else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet.
                     this._transformDirty = false;
                     this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex;
                 }
-                else {
+                else { // Dirty.
                     this._transformDirty = true;
                     this._cachedFrameIndex = -1;
                 }
             }
-            else if (this._transformDirty || this._parent._childrenTransformDirty) {
+            else if (this._transformDirty || this._parent._childrenTransformDirty) { // Dirty.
                 cacheFrameIndex = -1;
                 this._transformDirty = true;
                 this._cachedFrameIndex = -1;
             }
-            if (this._display === null) {
-                return;
-            }
-            if (this._visibleDirty) {
-                this._visibleDirty = false;
-                this._updateVisible();
-            }
-            if (this._blendModeDirty) {
-                this._blendModeDirty = false;
-                this._updateBlendMode();
-            }
-            if (this._colorDirty) {
-                this._colorDirty = false;
-                this._updateColor();
-            }
-            if (this._deformVertices !== null && this._deformVertices.verticesData !== null && this._display === this._meshDisplay) {
-                var isSkinned = this._deformVertices.verticesData.weight !== null;
-                var isSurface = this._parent._boneData.type !== 0 /* Bone */;
-                if (this._deformVertices.verticesDirty ||
-                    (isSkinned && this._deformVertices.isBonesUpdate()) ||
-                    (isSurface && this._parent._childrenTransformDirty)) {
-                    this._deformVertices.verticesDirty = false;
-                    this._updateMesh();
-                }
-                if (isSkinned || isSurface) {
-                    return;
-                }
-            }
             if (this._transformDirty) {
-                this._transformDirty = false;
                 if (this._cachedFrameIndex < 0) {
                     var isCache = cacheFrameIndex >= 0;
                     this._updateGlobalTransformMatrix(isCache);
@@ -6164,39 +6052,136 @@ var dragonBones;
                     this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex);
                 }
                 this._updateTransform();
+                this._transformDirty = false;
             }
         };
+        /**
+         * - Forces the slot to update the state of the display object in the next frame.
+         * @version DragonBones 4.5
+         * @language en_US
+         */
+        /**
+         * - 强制插槽在下一帧更新显示对象的状态。
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        Slot.prototype.invalidUpdate = function () {
+            this._displayDataDirty = true;
+            this._displayDirty = true;
+            //
+            this._transformDirty = true;
+        };
         /**
          * @private
          */
         Slot.prototype.updateTransformAndMatrix = function () {
             if (this._transformDirty) {
-                this._transformDirty = false;
                 this._updateGlobalTransformMatrix(false);
+                this._transformDirty = false;
             }
         };
         /**
          * @private
          */
-        Slot.prototype.replaceDisplayData = function (value, displayIndex) {
-            if (displayIndex === void 0) { displayIndex = -1; }
-            if (displayIndex < 0) {
-                if (this._displayIndex < 0) {
-                    displayIndex = 0;
+        Slot.prototype.replaceRawDisplayData = function (displayData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.rawDisplayData !== displayData) {
+                displayFrame.deformVertices.length = 0;
+                displayFrame.rawDisplayData = displayData;
+                if (displayFrame.rawDisplayData === null) {
+                    var defaultSkin = this._armature._armatureData.defaultSkin;
+                    if (defaultSkin !== null) {
+                        var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name);
+                        if (defaultRawDisplayDatas !== null && index < defaultRawDisplayDatas.length) {
+                            displayFrame.rawDisplayData = defaultRawDisplayDatas[index];
+                        }
+                    }
                 }
-                else {
-                    displayIndex = this._displayIndex;
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
+            }
+        };
+        /**
+         * @private
+         */
+        Slot.prototype.replaceDisplayData = function (displayData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.displayData !== displayData && displayFrame.rawDisplayData !== displayData) {
+                displayFrame.displayData = displayData;
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
+            }
+        };
+        /**
+         * @private
+         */
+        Slot.prototype.replaceTextureData = function (textureData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.textureData !== textureData) {
+                displayFrame.textureData = textureData;
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
                 }
             }
-            if (this._displayDatas.length <= displayIndex) {
-                this._displayDatas.length = displayIndex + 1;
-                for (var i = 0, l = this._displayDatas.length; i < l; ++i) {
-                    if (!this._displayDatas[i]) {
-                        this._displayDatas[i] = null;
+        };
+        /**
+         * @private
+         */
+        Slot.prototype.replaceDisplay = function (value, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.display !== value) {
+                var prevDisplay = displayFrame.display;
+                displayFrame.display = value;
+                if (prevDisplay !== null &&
+                    prevDisplay !== this._rawDisplay && prevDisplay !== this._meshDisplay &&
+                    !this._hasDisplay(prevDisplay)) {
+                    if (prevDisplay instanceof dragonBones.Armature) {
+                        // (eachDisplay as Armature).dispose();
                     }
+                    else {
+                        this._disposeDisplay(prevDisplay, true);
+                    }
+                }
+                if (value !== null &&
+                    value !== this._rawDisplay && value !== this._meshDisplay &&
+                    !this._hasDisplay(prevDisplay) &&
+                    !(value instanceof dragonBones.Armature)) {
+                    this._initDisplay(value, true);
+                }
+                if (index === this._displayIndex) {
+                    this._displayDirty = true;
                 }
             }
-            this._displayDatas[displayIndex] = value;
         };
         /**
          * - Check whether a specific point is inside a custom bounding box in the slot.
@@ -6304,18 +6289,10 @@ var dragonBones;
             return intersectionCount;
         };
         /**
-         * - Forces the slot to update the state of the display object in the next frame.
-         * @version DragonBones 4.5
-         * @language en_US
-         */
-        /**
-         * - 强制插槽在下一帧更新显示对象的状态。
-         * @version DragonBones 4.5
-         * @language zh_CN
+         * @private
          */
-        Slot.prototype.invalidUpdate = function () {
-            this._displayDirty = true;
-            this._transformDirty = true;
+        Slot.prototype.getDisplayFrameAt = function (index) {
+            return this._displayFrames[index];
         };
         Object.defineProperty(Slot.prototype, "visible", {
             /**
@@ -6343,6 +6320,32 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Slot.prototype, "displayFrameCount", {
+            /**
+             * @private
+             */
+            get: function () {
+                return this._displayFrames.length;
+            },
+            set: function (value) {
+                var prevCount = this._displayFrames.length;
+                if (prevCount < value) {
+                    this._displayFrames.length = value;
+                    for (var i = prevCount; i < value; ++i) {
+                        this._displayFrames[i] = dragonBones.BaseObject.borrowObject(DisplayFrame);
+                    }
+                }
+                else if (prevCount > value) {
+                    for (var i = prevCount - 1; i < value; --i) {
+                        this.replaceDisplay(null, i);
+                        this._displayFrames[i].returnToPool();
+                    }
+                    this._displayFrames.length = value;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(Slot.prototype, "displayIndex", {
             /**
              * - The index of the display object displayed in the display list.
@@ -6370,9 +6373,8 @@ var dragonBones;
                 return this._displayIndex;
             },
             set: function (value) {
-                if (this._setDisplayIndex(value)) {
-                    this.update(-1);
-                }
+                this._setDisplayIndex(value);
+                this.update(-1);
             },
             enumerable: true,
             configurable: true
@@ -6408,31 +6410,19 @@ var dragonBones;
              * @language zh_CN
              */
             get: function () {
-                return this._displayList.concat();
+                var displays = new Array();
+                for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                    var displayFrame = _a[_i];
+                    displays.push(displayFrame.display);
+                }
+                return displays;
             },
             set: function (value) {
-                var backupDisplayList = this._displayList.concat(); // Copy.
-                var disposeDisplayList = new Array();
-                if (this._setDisplayList(value)) {
-                    this.update(-1);
-                }
-                // Release replaced displays.
-                for (var _i = 0, backupDisplayList_1 = backupDisplayList; _i < backupDisplayList_1.length; _i++) {
-                    var eachDisplay = backupDisplayList_1[_i];
-                    if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                        this._displayList.indexOf(eachDisplay) < 0 &&
-                        disposeDisplayList.indexOf(eachDisplay) < 0) {
-                        disposeDisplayList.push(eachDisplay);
-                    }
-                }
-                for (var _a = 0, disposeDisplayList_2 = disposeDisplayList; _a < disposeDisplayList_2.length; _a++) {
-                    var eachDisplay = disposeDisplayList_2[_a];
-                    if (eachDisplay instanceof dragonBones.Armature) {
-                        // (eachDisplay as Armature).dispose();
-                    }
-                    else {
-                        this._disposeDisplay(eachDisplay, true);
-                    }
+                this.displayFrameCount = value.length;
+                var index = 0;
+                for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {
+                    var eachDisplay = value_1[_i];
+                    this.replaceDisplay(eachDisplay, index++);
                 }
             },
             enumerable: true,
@@ -6457,46 +6447,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Slot.prototype, "rawDisplayDatas", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this._rawDisplayDatas;
-            },
-            set: function (value) {
-                if (this._rawDisplayDatas === value) {
-                    return;
-                }
-                this._displayDirty = true;
-                this._rawDisplayDatas = value;
-                if (this._rawDisplayDatas !== null) {
-                    this._displayDatas.length = this._rawDisplayDatas.length;
-                    for (var i = 0, l = this._displayDatas.length; i < l; ++i) {
-                        var rawDisplayData = this._rawDisplayDatas[i];
-                        if (rawDisplayData === null) {
-                            rawDisplayData = this._getDefaultRawDisplayData(i);
-                        }
-                        this._displayDatas[i] = rawDisplayData;
-                    }
-                }
-                else {
-                    this._displayDatas.length = 0;
-                }
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Slot.prototype, "displayData", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this._displayData;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(Slot.prototype, "boundingBoxData", {
             /**
              * - The custom bounding box data for the slot at current time.
@@ -6562,21 +6512,11 @@ var dragonBones;
                 if (this._display === value) {
                     return;
                 }
-                var displayListLength = this._displayList.length;
-                if (this._displayIndex < 0 && displayListLength === 0) {
+                if (this._displayFrames.length === 0) {
+                    this.displayFrameCount = 1;
                     this._displayIndex = 0;
                 }
-                if (this._displayIndex < 0) {
-                    return;
-                }
-                else {
-                    var replaceDisplayList = this.displayList; // Copy.
-                    if (displayListLength <= this._displayIndex) {
-                        replaceDisplayList.length = this._displayIndex + 1;
-                    }
-                    replaceDisplayList[this._displayIndex] = value;
-                    this.displayList = replaceDisplayList;
-                }
+                this.replaceDisplay(value, this._displayIndex);
             },
             enumerable: true,
             configurable: true
@@ -6587,9 +6527,9 @@ var dragonBones;
              * @example
              * 
              *     let slot = armature.getSlot("weapon");
-             * let prevChildArmature = slot.childArmature;
-             * if (prevChildArmature) {
-             * prevChildArmature.dispose();
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
              *     }
              *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
              * 
@@ -6602,9 +6542,9 @@ var dragonBones; * @example *
              *     let slot = armature.getSlot("weapon");
-             * let prevChildArmature = slot.childArmature;
-             * if (prevChildArmature) {
-             * prevChildArmature.dispose();
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
              *     }
              *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
              * 
@@ -6734,7 +6674,7 @@ var dragonBones; }; IKConstraint.prototype._onClear = function () { _super.prototype._onClear.call(this); - this._scaleEnabled = false; + // this._scaleEnabled = false; this._bendPositive = false; this._weight = 1.0; this._constraintData = null; @@ -6830,7 +6770,7 @@ var dragonBones; this._bone = this._constraintData.bone !== null ? this._armature.getBone(this._constraintData.bone.name) : null; { var ikConstraintData = this._constraintData; - this._scaleEnabled = ikConstraintData.scaleEnabled; + // this._scaleEnabled = ikConstraintData.scaleEnabled; this._bendPositive = ikConstraintData.bendPositive; this._weight = ikConstraintData.weight; } @@ -6899,8 +6839,8 @@ var dragonBones; var intArray = dragonBonesData.intArray; var floatArray = dragonBonesData.floatArray; var pathOffset = verticesData.offset; - var pathVertexCount = intArray[pathOffset + 0 /* PathVertexCount */]; - var pathVertexOffset = intArray[pathOffset + 2 /* PathFloatOffset */]; + var pathVertexCount = intArray[pathOffset + 0 /* GeometryVertexCount */]; + var pathVertexOffset = intArray[pathOffset + 2 /* GeometryFloatOffset */]; this._pathGlobalVertices.length = pathVertexCount * 2; var weightData = verticesData.weight; //没有骨骼约束我,那节点只受自己的Bone控制 @@ -6920,7 +6860,7 @@ var dragonBones; return; } //有骨骼约束我,那我的节点受骨骼权重控制 - var bones = this._pathSlot._deformVertices.bones; + var bones = this._pathSlot._geometryBones; var weightBoneCount = weightData.bones.length; var weightOffset = weightData.offset; var floatOffset = intArray[weightOffset + 1 /* WeigthFloatOffset */]; @@ -6958,7 +6898,7 @@ var dragonBones; //计算当前的骨骼在曲线上的位置 var armature = this._armature; var intArray = armature.armatureData.parent.intArray; - var vertexCount = intArray[pathDisplayDta.vertices.offset + 0 /* PathVertexCount */]; + var vertexCount = intArray[pathDisplayDta.geometry.offset + 0 /* GeometryVertexCount */]; var positions = this._positions; var spaces = this._spaces; var isClosed = pathDisplayDta.closed; @@ -7215,7 +7155,7 @@ var dragonBones; this._constraintData = constraintData; this._armature = armature; var data = constraintData; - this.pathOffset = data.pathDisplayData.vertices.offset; + this.pathOffset = data.pathDisplayData.geometry.offset; // this.position = data.position; this.spacing = data.spacing; @@ -7239,24 +7179,21 @@ var dragonBones; }; PathConstraint.prototype.update = function () { var pathSlot = this._pathSlot; - if (pathSlot._deformVertices === null || - pathSlot._deformVertices.verticesData === null || - pathSlot._deformVertices.verticesData.offset !== this.pathOffset) { + if (pathSlot._geometryData === null || + pathSlot._geometryData.offset !== this.pathOffset) { return; } var constraintData = this._constraintData; - var pathDisplayData = pathSlot._displayData; // TODO // //曲线节点数据改变:父亲bone改变,权重bones改变,变形顶点改变 var isPathVerticeDirty = false; - var deformVertices = pathSlot._deformVertices; if (this._root._childrenTransformDirty) { - this._updatePathVertices(pathDisplayData.vertices); + this._updatePathVertices(pathSlot._geometryData); isPathVerticeDirty = true; } - else if (deformVertices !== null && (deformVertices.verticesDirty || deformVertices.isBonesUpdate())) { - this._updatePathVertices(pathDisplayData.vertices); - deformVertices.verticesDirty = false; + else if (pathSlot._verticesDirty || pathSlot._isBonesUpdate()) { + this._updatePathVertices(pathSlot._geometryData); + pathSlot._verticesDirty = false; isPathVerticeDirty = true; } if (!isPathVerticeDirty && !this.dirty) { @@ -7299,7 +7236,7 @@ var dragonBones; } } // - this._computeBezierCurve(pathDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); + this._computeBezierCurve(pathSlot._displayFrame.rawDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); //根据新的节点数据重新采样 var positions = this._positions; var rotateOffset = this.rotateOffset; @@ -7623,17 +7560,6 @@ var dragonBones; enumerable: true, configurable: true }); - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#clock}。 - * @deprecated - * @language zh_CN - */ - WorldClock.clock = new WorldClock(); return WorldClock; }()); dragonBones.WorldClock = WorldClock; @@ -7683,6 +7609,7 @@ var dragonBones; _this._animationNames = []; _this._animationStates = []; _this._animations = {}; + _this._blendStates = {}; _this._animationConfig = null; // Initial value. return _this; } @@ -7697,11 +7624,17 @@ var dragonBones; for (var k in this._animations) { delete this._animations[k]; } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].returnToPool(); + } + delete this._blendStates[k]; + } if (this._animationConfig !== null) { this._animationConfig.returnToPool(); } this.timeScale = 1.0; - this._lockUpdate = false; this._animationDirty = false; this._inheritTimeScale = 1.0; this._animationNames.length = 0; @@ -7756,8 +7689,7 @@ var dragonBones; animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); } break; - case 0 /* None */: - case 5 /* Single */: + case 5 /* Single */: // TODO default: break; } @@ -7776,10 +7708,10 @@ var dragonBones; * @internal */ Animation.prototype.advanceTime = function (passedTime) { - if (passedTime < 0.0) { + if (passedTime < 0.0) { // Only animationState can reverse play. passedTime = -passedTime; } - if (this._armature.inheritAnimation && this._armature._parent !== null) { + if (this._armature.inheritAnimation && this._armature._parent !== null) { // Inherit parent animation timeScale. this._inheritTimeScale = this._armature._parent._armature.animation._inheritTimeScale * this.timeScale; } else { @@ -7788,6 +7720,12 @@ var dragonBones; if (this._inheritTimeScale !== 1.0) { passedTime *= this._inheritTimeScale; } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].reset(); + } + } var animationStateCount = this._animationStates.length; if (animationStateCount === 1) { var animationState = this._animationStates[0]; @@ -7797,9 +7735,9 @@ var dragonBones; this._lastAnimationState = null; } else { - var animationData = animationState._animationData; + var animationData = animationState.animationData; var cacheFrameRate = animationData.cacheFrameRate; - if (this._animationDirty && cacheFrameRate > 0.0) { + if (this._animationDirty && cacheFrameRate > 0.0) { // Update cachedFrameIndices. this._animationDirty = false; for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { var bone = _a[_i]; @@ -7807,14 +7745,12 @@ var dragonBones; } for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { var slot = _c[_b]; - var rawDisplayDatas = slot.rawDisplayDatas; - if (rawDisplayDatas !== null && rawDisplayDatas.length > 0) { - var rawDsplayData = rawDisplayDatas[0]; - if (rawDsplayData !== null) { - if (rawDsplayData.parent === this._armature.armatureData.defaultSkin) { - slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); - continue; - } + if (slot.displayFrameCount > 0) { + var rawDisplayData = slot.getDisplayFrameAt(0).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.parent === this._armature.armatureData.defaultSkin) { + slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); + continue; } } slot._cachedFrameIndices = null; @@ -7830,7 +7766,7 @@ var dragonBones; r++; this._armature._dragonBones.bufferObject(animationState); this._animationDirty = true; - if (this._lastAnimationState === animationState) { + if (this._lastAnimationState === animationState) { // Update last animation state. this._lastAnimationState = null; } } @@ -7840,7 +7776,7 @@ var dragonBones; } animationState.advanceTime(passedTime, 0.0); } - if (i === animationStateCount - 1 && r > 0) { + if (i === animationStateCount - 1 && r > 0) { // Modify animation states size. this._animationStates.length -= r; if (this._lastAnimationState === null && this._animationStates.length > 0) { this._lastAnimationState = this._animationStates[this._animationStates.length - 1]; @@ -7934,7 +7870,9 @@ var dragonBones; if (animationConfig.fadeOutMode === 5 /* Single */) { for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { var animationState_1 = _a[_i]; - if (animationState_1._animationData === animationData) { + if (animationState_1._fadeState < 1 && + animationState_1.layer === animationConfig.layer && + animationState_1.animationData === animationData) { return animationState_1; } } @@ -7951,7 +7889,7 @@ var dragonBones; if (animationConfig.timeScale <= -100.0) { animationConfig.timeScale = 1.0 / animationData.scale; } - if (animationData.frameCount > 1) { + if (animationData.frameCount > 0) { if (animationConfig.position < 0.0) { animationConfig.position %= animationData.duration; animationConfig.position = animationData.duration - animationConfig.position; @@ -7980,11 +7918,12 @@ var dragonBones; animationConfig.duration = -1.0; } this._fadeOut(animationConfig); + // var animationState = dragonBones.BaseObject.borrowObject(dragonBones.AnimationState); animationState.init(this._armature, animationData, animationConfig); this._animationDirty = true; this._armature._cacheFrameIndex = -1; - if (this._animationStates.length > 0) { + if (this._animationStates.length > 0) { // Sort animation state. var added = false; for (var i = 0, l = this._animationStates.length; i < l; ++i) { if (animationState.layer > this._animationStates[i].layer) { @@ -8005,8 +7944,7 @@ var dragonBones; else { this._animationStates.push(animationState); } - // Child armature play same name animation. - for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { // Child armature play same name animation. var slot = _c[_b]; var childArmature = slot.childArmature; if (childArmature !== null && childArmature.inheritAnimation && @@ -8015,28 +7953,28 @@ var dragonBones; childArmature.animation.fadeIn(animationName); // } } - var isLocked = false; - for (var k in animationData.animationTimelines) { - if (!this._lockUpdate) { - isLocked = true; - this._lockUpdate = true; - } - var childAnimatiionState = this.fadeIn(k, animationConfig.fadeInTime, 1, animationState.layer, null, 0 /* None */); - if (childAnimatiionState !== null) { - childAnimatiionState.resetToPose = false; - childAnimatiionState._parent = animationState; - childAnimatiionState.stop(); + for (var k in animationData.animationTimelines) { // Blend animation node. + var childAnimationState = this.fadeIn(k, 0.0, 1, animationState.layer, "", 5 /* Single */); + if (childAnimationState === null) { + continue; } - } - if (isLocked) { - this._lockUpdate = false; - } - if (!this._lockUpdate) { - if (animationConfig.fadeInTime <= 0.0) { - this._armature.advanceTime(0.0); + var timelines = animationData.animationTimelines[k]; + childAnimationState.actionEnabled = false; + childAnimationState.resetToPose = false; + childAnimationState.stop(); + animationState.addState(childAnimationState, timelines); + // + var index = this._animationStates.indexOf(animationState); + var childIndex = this._animationStates.indexOf(childAnimationState); + if (childIndex < index) { + this._animationStates.splice(index, 1); + this._animationStates.splice(childIndex, 0, animationState); } - this._lastAnimationState = animationState; } + // if (!this._armature._lockUpdate && animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. + // this._armature.advanceTime(0.0); + // } + this._lastAnimationState = animationState; return animationState; }; /** @@ -8196,7 +8134,7 @@ var dragonBones; this._animationConfig.animation = animationName; var animationData = animationName in this._animations ? this._animations[animationName] : null; if (animationData !== null) { - this._animationConfig.position = animationData.duration * frame / animationData.frameCount; + this._animationConfig.position = animationData.frameCount > 0 ? animationData.duration * frame / animationData.frameCount : 0.0; } return this.playConfig(this._animationConfig); }; @@ -8304,9 +8242,24 @@ var dragonBones; } return animationState; }; + /** + * @internal + */ + Animation.prototype.getBlendState = function (type, name, target) { + if (!(type in this._blendStates)) { + this._blendStates[type] = {}; + } + var blendStates = this._blendStates[type]; + if (!(name in blendStates)) { + var blendState = blendStates[name] = dragonBones.BaseObject.borrowObject(dragonBones.BlendState); + blendState.target = target; + } + return blendStates[name]; + }; /** * - Get a specific animation state. * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) * @example *
          *     armature.animation.play("walk");
@@ -8317,8 +8270,9 @@ var dragonBones;
          * @language en_US
          */
         /**
-         * - 获取指定的动画状态
+         * - 获取指定的动画状态。
          * @param animationName - 动画状态名称。
+         * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1)
          * @example
          * 
          *     armature.animation.play("walk");
@@ -8328,11 +8282,12 @@ var dragonBones;
          * @version DragonBones 3.0
          * @language zh_CN
          */
-        Animation.prototype.getState = function (animationName) {
+        Animation.prototype.getState = function (animationName, layer) {
+            if (layer === void 0) { layer = -1; }
             var i = this._animationStates.length;
             while (i--) {
                 var animationState = this._animationStates[i];
-                if (animationState.name === animationName) {
+                if (animationState.name === animationName && (layer < 0 || animationState.layer === layer)) {
                     return animationState;
                 }
             }
@@ -8523,99 +8478,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link #play()} {@link #fadeIn()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #play()} {@link #fadeIn()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Animation.prototype.gotoAndPlay = function (animationName, fadeInTime, duration, playTimes, layer, group, fadeOutMode, pauseFadeOut, pauseFadeIn) {
-            if (fadeInTime === void 0) { fadeInTime = -1; }
-            if (duration === void 0) { duration = -1; }
-            if (playTimes === void 0) { playTimes = -1; }
-            if (layer === void 0) { layer = 0; }
-            if (group === void 0) { group = null; }
-            if (fadeOutMode === void 0) { fadeOutMode = 3 /* SameLayerAndGroup */; }
-            if (pauseFadeOut === void 0) { pauseFadeOut = true; }
-            if (pauseFadeIn === void 0) { pauseFadeIn = true; }
-            console.warn("Deprecated.");
-            // tslint:disable-next-line:no-unused-expression
-            pauseFadeOut;
-            // tslint:disable-next-line:no-unused-expression
-            pauseFadeIn;
-            this._animationConfig.clear();
-            this._animationConfig.resetToPose = true;
-            this._animationConfig.fadeOutMode = fadeOutMode;
-            this._animationConfig.playTimes = playTimes;
-            this._animationConfig.layer = layer;
-            this._animationConfig.fadeInTime = fadeInTime;
-            this._animationConfig.animation = animationName;
-            this._animationConfig.group = group !== null ? group : "";
-            var animationData = this._animations[animationName];
-            if (animationData && duration > 0.0) {
-                this._animationConfig.timeScale = animationData.duration / duration;
-            }
-            return this.playConfig(this._animationConfig);
-        };
-        /**
-         * - Deprecated, please refer to {@link #gotoAndStopByTime()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #gotoAndStopByTime()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Animation.prototype.gotoAndStop = function (animationName, time) {
-            if (time === void 0) { time = 0; }
-            console.warn("Deprecated.");
-            return this.gotoAndStopByTime(animationName, time);
-        };
-        Object.defineProperty(Animation.prototype, "animationList", {
-            /**
-             * - Deprecated, please refer to {@link #animationNames}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #animationNames}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                return this._animationNames;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Animation.prototype, "animationDataList", {
-            /**
-             * - Deprecated, please refer to {@link #animationNames}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #animationNames}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                var list = [];
-                for (var i = 0, l = this._animationNames.length; i < l; ++i) {
-                    list.push(this._animations[this._animationNames[i]]);
-                }
-                return list;
-            },
-            enumerable: true,
-            configurable: true
-        });
         return Animation;
     }(dragonBones.BaseObject));
     dragonBones.Animation = Animation;
@@ -8662,27 +8524,19 @@ var dragonBones;
         __extends(AnimationState, _super);
         function AnimationState() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            /**
-             * @internal
-             */
-            _this._blendState = new BlendState();
             _this._boneMask = [];
             _this._boneTimelines = [];
-            _this._surfaceTimelines = [];
+            _this._boneBlendTimelines = [];
             _this._slotTimelines = [];
+            _this._slotBlendTimelines = [];
             _this._constraintTimelines = [];
             _this._animationTimelines = [];
             _this._poseTimelines = [];
-            _this._bonePoses = {};
             /**
              * @internal
              */
             _this._actionTimeline = null; // Initial value.
             _this._zOrderTimeline = null; // Initial value.
-            /**
-             * @internal
-             */
-            _this._parent = null; // Initial value.
             return _this;
         }
         AnimationState.toString = function () {
@@ -8693,7 +8547,7 @@ var dragonBones;
                 var timeline = _a[_i];
                 timeline.returnToPool();
             }
-            for (var _b = 0, _c = this._surfaceTimelines; _b < _c.length; _b++) {
+            for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
                 var timeline = _c[_b];
                 timeline.returnToPool();
             }
@@ -8701,17 +8555,23 @@ var dragonBones;
                 var timeline = _e[_d];
                 timeline.returnToPool();
             }
-            for (var _f = 0, _g = this._constraintTimelines; _f < _g.length; _f++) {
+            for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) {
                 var timeline = _g[_f];
                 timeline.returnToPool();
             }
-            for (var _h = 0, _j = this._animationTimelines; _h < _j.length; _h++) {
+            for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) {
                 var timeline = _j[_h];
                 timeline.returnToPool();
             }
-            for (var k in this._bonePoses) {
-                this._bonePoses[k].returnToPool();
-                delete this._bonePoses[k];
+            for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) {
+                var timeline = _l[_k];
+                var animationState = timeline.target;
+                if (animationState._parent === this) {
+                    animationState._fadeState = 1;
+                    animationState._subFadeState = 1;
+                    animationState._parent = null;
+                }
+                timeline.returnToPool();
             }
             if (this._actionTimeline !== null) {
                 this._actionTimeline.returnToPool();
@@ -8720,13 +8580,18 @@ var dragonBones;
                 this._zOrderTimeline.returnToPool();
             }
             this.actionEnabled = false;
-            this.additiveBlending = false;
+            this.additive = false;
             this.displayControl = false;
             this.resetToPose = false;
+            this.blendType = 0 /* None */;
             this.playTimes = 1;
             this.layer = 0;
             this.timeScale = 1.0;
-            this.weight = 1.0;
+            this._weight = 1.0;
+            this.parameterX = 0.0;
+            this.parameterY = 0.0;
+            this.positionX = 0.0;
+            this.positionY = 0.0;
             this.autoFadeOutTime = 0.0;
             this.fadeTotalTime = 0.0;
             this.name = "";
@@ -8741,11 +8606,11 @@ var dragonBones;
             this._time = 0.0;
             this._fadeProgress = 0.0;
             this._weightResult = 0.0;
-            this._blendState.clear();
             this._boneMask.length = 0;
             this._boneTimelines.length = 0;
-            this._surfaceTimelines.length = 0;
+            this._boneBlendTimelines.length = 0;
             this._slotTimelines.length = 0;
+            this._slotBlendTimelines.length = 0;
             this._constraintTimelines.length = 0;
             this._animationTimelines.length = 0;
             this._poseTimelines.length = 0;
@@ -8754,10 +8619,12 @@ var dragonBones;
             this._armature = null; //
             this._actionTimeline = null; //
             this._zOrderTimeline = null;
-            this._parent = null; //
+            this._activeChildA = null;
+            this._activeChildB = null;
+            this._parent = null;
         };
         AnimationState.prototype._updateTimelines = function () {
-            {
+            { // Update constraint timelines.
                 for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) {
                     var constraint = _a[_i];
                     var timelineDatas = this._animationData.getConstraintTimelines(constraint.name);
@@ -8767,7 +8634,7 @@ var dragonBones;
                             switch (timelineData.type) {
                                 case 30 /* IKConstraint */: {
                                     var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState);
-                                    timeline.constraint = constraint;
+                                    timeline.target = constraint;
                                     timeline.init(this._armature, this, timelineData);
                                     this._constraintTimelines.push(timeline);
                                     break;
@@ -8777,126 +8644,93 @@ var dragonBones;
                             }
                         }
                     }
-                    else if (this.resetToPose) {
+                    else if (this.resetToPose) { // Pose timeline.
                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState);
-                        timeline.constraint = constraint;
+                        timeline.target = constraint;
                         timeline.init(this._armature, this, null);
                         this._constraintTimelines.push(timeline);
                         this._poseTimelines.push(timeline);
                     }
                 }
             }
-            {
-                for (var _c = 0, _d = this._armature.animation.getStates(); _c < _d.length; _c++) {
-                    var animationState = _d[_c];
-                    if (animationState._parent !== this) {
-                        continue;
-                    }
-                    var timelineDatas = this._animationData.getAnimationTimelines(animationState.name);
-                    if (timelineDatas === null) {
-                        continue;
-                    }
-                    for (var _e = 0, timelineDatas_2 = timelineDatas; _e < timelineDatas_2.length; _e++) {
-                        var timelineData = timelineDatas_2[_e];
-                        switch (timelineData.type) {
-                            case 40 /* AnimationTime */: {
-                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineState);
-                                timeline.animationState = animationState;
-                                timeline.init(this._armature, this, timelineData);
-                                this._animationTimelines.push(timeline);
-                                break;
-                            }
-                            default:
-                                break;
-                        }
-                    }
-                }
-            }
         };
         AnimationState.prototype._updateBoneAndSlotTimelines = function () {
-            {
+            { // Update bone and surface timelines.
                 var boneTimelines = {};
+                // Create bone timelines map.
                 for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) {
                     var timeline = _a[_i];
-                    var timelineName = timeline.bone.name;
+                    var timelineName = timeline.target.target.name;
                     if (!(timelineName in boneTimelines)) {
                         boneTimelines[timelineName] = [];
                     }
                     boneTimelines[timelineName].push(timeline);
                 }
-                for (var _b = 0, _c = this._armature.getBones(); _b < _c.length; _b++) {
-                    var bone = _c[_b];
-                    var timelineName = bone.name;
-                    if (!this.containsBoneMask(timelineName)) {
-                        continue;
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
+                    var timelineName = timeline.target.target.name;
+                    if (!(timelineName in boneTimelines)) {
+                        boneTimelines[timelineName] = [];
+                    }
+                    boneTimelines[timelineName].push(timeline);
+                }
+                //
+                for (var _d = 0, _e = this._armature.getBones(); _d < _e.length; _d++) {
+                    var bone = _e[_d];
+                    var timelineName = bone.name;
+                    if (!this.containsBoneMask(timelineName)) {
+                        continue;
                     }
-                    if (timelineName in boneTimelines) {
+                    if (timelineName in boneTimelines) { // Remove bone timeline from map.
                         delete boneTimelines[timelineName];
                     }
-                    else if (bone._boneData.type === 0 /* Bone */) {
+                    else { // Create new bone timeline.
                         var timelineDatas = this._animationData.getBoneTimelines(timelineName);
-                        var bonePose = timelineName in this._bonePoses ? this._bonePoses[timelineName] : (this._bonePoses[timelineName] = dragonBones.BaseObject.borrowObject(BonePose));
+                        var blendState = this._armature.animation.getBlendState(BlendState.BONE_TRANSFORM, bone.name, bone);
                         if (timelineDatas !== null) {
-                            for (var _d = 0, timelineDatas_3 = timelineDatas; _d < timelineDatas_3.length; _d++) {
-                                var timelineData = timelineDatas_3[_d];
+                            for (var _f = 0, timelineDatas_2 = timelineDatas; _f < timelineDatas_2.length; _f++) {
+                                var timelineData = timelineDatas_2[_f];
                                 switch (timelineData.type) {
                                     case 10 /* BoneAll */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 11 /* BoneTranslate */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneTranslateTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 12 /* BoneRotate */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneRotateTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 13 /* BoneScale */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneScaleTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
-                                    default:
+                                    case 60 /* BoneAlpha */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.BONE_ALPHA, bone.name, bone);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._boneBlendTimelines.push(timeline);
                                         break;
-                                }
-                            }
-                        }
-                        else if (this.resetToPose) {
-                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
-                            timeline.bone = bone;
-                            timeline.bonePose = bonePose;
-                            timeline.init(this._armature, this, null);
-                            this._boneTimelines.push(timeline);
-                            this._poseTimelines.push(timeline);
-                        }
-                    }
-                    else if (bone._boneData.type === 1 /* Surface */) {
-                        var timelineDatas = this._animationData.getSurfaceTimelines(timelineName);
-                        if (timelineDatas !== null) {
-                            for (var _e = 0, timelineDatas_4 = timelineDatas; _e < timelineDatas_4.length; _e++) {
-                                var timelineData = timelineDatas_4[_e];
-                                switch (timelineData.type) {
+                                    }
                                     case 50 /* Surface */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
-                                        timeline.surface = bone;
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone);
                                         timeline.init(this._armature, this, timelineData);
-                                        this._surfaceTimelines.push(timeline);
+                                        this._boneBlendTimelines.push(timeline);
                                         break;
                                     }
                                     default:
@@ -8904,75 +8738,136 @@ var dragonBones;
                                 }
                             }
                         }
-                        else if (this.resetToPose) {
-                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
-                            timeline.surface = bone;
-                            timeline.init(this._armature, this, null);
-                            this._surfaceTimelines.push(timeline);
-                            this._poseTimelines.push(timeline);
+                        else if (this.resetToPose) { // Pose timeline.
+                            if (bone._boneData.type === 0 /* Bone */) {
+                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
+                                timeline.target = blendState;
+                                timeline.init(this._armature, this, null);
+                                this._boneTimelines.push(timeline);
+                                this._poseTimelines.push(timeline);
+                            }
+                            else {
+                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
+                                timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone);
+                                timeline.init(this._armature, this, null);
+                                this._boneBlendTimelines.push(timeline);
+                                this._poseTimelines.push(timeline);
+                            }
                         }
                     }
                 }
-                for (var k in boneTimelines) {
-                    for (var _f = 0, _g = boneTimelines[k]; _f < _g.length; _f++) {
-                        var timeline = _g[_f];
-                        this._boneTimelines.splice(this._boneTimelines.indexOf(timeline), 1);
-                        timeline.returnToPool();
+                for (var k in boneTimelines) { // Remove bone timelines.
+                    for (var _g = 0, _h = boneTimelines[k]; _g < _h.length; _g++) {
+                        var timeline = _h[_g];
+                        var index = this._boneTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._boneTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
+                        index = this._boneBlendTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._boneBlendTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
                     }
                 }
             }
-            {
+            { // Update slot timelines.
                 var slotTimelines = {};
                 var ffdFlags = [];
-                for (var _h = 0, _j = this._slotTimelines; _h < _j.length; _h++) {
-                    var timeline = _j[_h];
-                    var timelineName = timeline.slot.name;
+                // Create slot timelines map.
+                for (var _j = 0, _k = this._slotTimelines; _j < _k.length; _j++) {
+                    var timeline = _k[_j];
+                    var timelineName = timeline.target.name;
+                    if (!(timelineName in slotTimelines)) {
+                        slotTimelines[timelineName] = [];
+                    }
+                    slotTimelines[timelineName].push(timeline);
+                }
+                for (var _l = 0, _m = this._slotBlendTimelines; _l < _m.length; _l++) {
+                    var timeline = _m[_l];
+                    var timelineName = timeline.target.target.name;
                     if (!(timelineName in slotTimelines)) {
                         slotTimelines[timelineName] = [];
                     }
                     slotTimelines[timelineName].push(timeline);
                 }
-                for (var _k = 0, _l = this._armature.getSlots(); _k < _l.length; _k++) {
-                    var slot = _l[_k];
+                //
+                for (var _o = 0, _p = this._armature.getSlots(); _o < _p.length; _o++) {
+                    var slot = _p[_o];
                     var boneName = slot.parent.name;
                     if (!this.containsBoneMask(boneName)) {
                         continue;
                     }
                     var timelineName = slot.name;
-                    var timelineDatas = this._animationData.getSlotTimelines(timelineName);
-                    if (timelineName in slotTimelines) {
+                    if (timelineName in slotTimelines) { // Remove slot timeline from map.
                         delete slotTimelines[timelineName];
                     }
-                    else {
+                    else { // Create new slot timeline.
                         var displayIndexFlag = false;
                         var colorFlag = false;
                         ffdFlags.length = 0;
+                        var timelineDatas = this._animationData.getSlotTimelines(timelineName);
                         if (timelineDatas !== null) {
-                            for (var _m = 0, timelineDatas_5 = timelineDatas; _m < timelineDatas_5.length; _m++) {
-                                var timelineData = timelineDatas_5[_m];
+                            for (var _q = 0, timelineDatas_3 = timelineDatas; _q < timelineDatas_3.length; _q++) {
+                                var timelineData = timelineDatas_3[_q];
                                 switch (timelineData.type) {
                                     case 20 /* SlotDisplay */: {
-                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDislayTimelineState);
-                                        timeline.slot = slot;
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState);
+                                        timeline.target = slot;
                                         timeline.init(this._armature, this, timelineData);
                                         this._slotTimelines.push(timeline);
                                         displayIndexFlag = true;
                                         break;
                                     }
+                                    case 23 /* SlotZIndex */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotZIndexTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_Z_INDEX, slot.name, slot);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._slotBlendTimelines.push(timeline);
+                                        break;
+                                    }
                                     case 21 /* SlotColor */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = slot;
                                         timeline.init(this._armature, this, timelineData);
                                         this._slotTimelines.push(timeline);
                                         colorFlag = true;
                                         break;
                                     }
                                     case 22 /* SlotDeform */: {
-                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
-                                        timeline.slot = slot;
+                                        var dragonBonesData = this._animationData.parent.parent;
+                                        var timelineArray = dragonBonesData.timelineArray;
+                                        var frameIntOffset = this._animationData.frameIntOffset + timelineArray[timelineData.offset + 3 /* TimelineFrameValueCount */];
+                                        var frameIntArray = dragonBonesData.frameIntArray;
+                                        var geometryOffset = frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */];
+                                        if (geometryOffset < 0) {
+                                            geometryOffset += 65536; // Fixed out of bounds bug. 
+                                        }
+                                        for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                                            var displayFrame = slot.getDisplayFrameAt(i);
+                                            var geometryData = displayFrame.getGeometryData();
+                                            if (geometryData === null) {
+                                                continue;
+                                            }
+                                            if (geometryData.offset === geometryOffset) {
+                                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
+                                                timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, displayFrame.rawDisplayData.name, slot);
+                                                timeline.displayFrame = displayFrame;
+                                                timeline.init(this._armature, this, timelineData);
+                                                this._slotBlendTimelines.push(timeline);
+                                                displayFrame.updateDeformVertices();
+                                                ffdFlags.push(geometryOffset);
+                                                break;
+                                            }
+                                        }
+                                        break;
+                                    }
+                                    case 24 /* SlotAlpha */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_ALPHA, slot.name, slot);
                                         timeline.init(this._armature, this, timelineData);
-                                        this._slotTimelines.push(timeline);
-                                        ffdFlags.push(timeline.vertexOffset);
+                                        this._slotBlendTimelines.push(timeline);
                                         break;
                                     }
                                     default:
@@ -8980,88 +8875,101 @@ var dragonBones;
                                 }
                             }
                         }
-                        if (this.resetToPose) {
+                        if (this.resetToPose) { // Pose timeline.
                             if (!displayIndexFlag) {
-                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDislayTimelineState);
-                                timeline.slot = slot;
+                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState);
+                                timeline.target = slot;
                                 timeline.init(this._armature, this, null);
                                 this._slotTimelines.push(timeline);
                                 this._poseTimelines.push(timeline);
                             }
                             if (!colorFlag) {
                                 var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState);
-                                timeline.slot = slot;
+                                timeline.target = slot;
                                 timeline.init(this._armature, this, null);
                                 this._slotTimelines.push(timeline);
                                 this._poseTimelines.push(timeline);
                             }
-                            if (slot.rawDisplayDatas !== null) {
-                                for (var _o = 0, _p = slot.rawDisplayDatas; _o < _p.length; _o++) {
-                                    var displayData = _p[_o];
-                                    if (displayData !== null && displayData.type === 2 /* Mesh */) {
-                                        var meshOffset = displayData.vertices.offset;
-                                        if (ffdFlags.indexOf(meshOffset) < 0) {
-                                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
-                                            timeline.vertexOffset = meshOffset; //
-                                            timeline.slot = slot;
-                                            timeline.init(this._armature, this, null);
-                                            this._slotTimelines.push(timeline);
-                                            this._poseTimelines.push(timeline);
-                                        }
-                                    }
+                            for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                                var displayFrame = slot.getDisplayFrameAt(i);
+                                if (displayFrame.deformVertices.length === 0) {
+                                    continue;
+                                }
+                                var geometryData = displayFrame.getGeometryData();
+                                if (geometryData !== null && ffdFlags.indexOf(geometryData.offset) < 0) {
+                                    var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
+                                    timeline.displayFrame = displayFrame; //
+                                    timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot);
+                                    timeline.init(this._armature, this, null);
+                                    this._slotBlendTimelines.push(timeline);
+                                    this._poseTimelines.push(timeline);
                                 }
                             }
                         }
                     }
                 }
-                for (var k in slotTimelines) {
-                    for (var _q = 0, _r = slotTimelines[k]; _q < _r.length; _q++) {
-                        var timeline = _r[_q];
-                        this._slotTimelines.splice(this._slotTimelines.indexOf(timeline), 1);
-                        timeline.returnToPool();
+                for (var k in slotTimelines) { // Remove slot timelines.
+                    for (var _r = 0, _s = slotTimelines[k]; _r < _s.length; _r++) {
+                        var timeline = _s[_r];
+                        var index = this._slotTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._slotTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
+                        index = this._slotBlendTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._slotBlendTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
                     }
                 }
             }
         };
         AnimationState.prototype._advanceFadeTime = function (passedTime) {
             var isFadeOut = this._fadeState > 0;
-            if (this._subFadeState < 0) {
+            if (this._subFadeState < 0) { // Fade start event.
                 this._subFadeState = 0;
-                var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN;
-                if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
-                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                    eventObject.type = eventType;
-                    eventObject.armature = this._armature;
-                    eventObject.animationState = this;
-                    this._armature._dragonBones.bufferEvent(eventObject);
+                var eventActive = this._parent === null && this.actionEnabled;
+                if (eventActive) {
+                    var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN;
+                    if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
+                        var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                        eventObject.type = eventType;
+                        eventObject.armature = this._armature;
+                        eventObject.animationState = this;
+                        this._armature._dragonBones.bufferEvent(eventObject);
+                    }
                 }
             }
             if (passedTime < 0.0) {
                 passedTime = -passedTime;
             }
             this._fadeTime += passedTime;
-            if (this._fadeTime >= this.fadeTotalTime) {
+            if (this._fadeTime >= this.fadeTotalTime) { // Fade complete.
                 this._subFadeState = 1;
                 this._fadeProgress = isFadeOut ? 0.0 : 1.0;
             }
-            else if (this._fadeTime > 0.0) {
+            else if (this._fadeTime > 0.0) { // Fading.
                 this._fadeProgress = isFadeOut ? (1.0 - this._fadeTime / this.fadeTotalTime) : (this._fadeTime / this.fadeTotalTime);
             }
-            else {
+            else { // Before fade.
                 this._fadeProgress = isFadeOut ? 1.0 : 0.0;
             }
-            if (this._subFadeState > 0) {
+            if (this._subFadeState > 0) { // Fade complete event.
                 if (!isFadeOut) {
                     this._playheadState |= 1; // x1
                     this._fadeState = 0;
                 }
-                var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE;
-                if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
-                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                    eventObject.type = eventType;
-                    eventObject.armature = this._armature;
-                    eventObject.animationState = this;
-                    this._armature._dragonBones.bufferEvent(eventObject);
+                var eventActive = this._parent === null && this.actionEnabled;
+                if (eventActive) {
+                    var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE;
+                    if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
+                        var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                        eventObject.type = eventType;
+                        eventObject.armature = this._armature;
+                        eventObject.animationState = this;
+                        this._armature._dragonBones.bufferEvent(eventObject);
+                    }
                 }
             }
         };
@@ -9076,17 +8984,19 @@ var dragonBones;
             this._animationData = animationData;
             //
             this.resetToPose = animationConfig.resetToPose;
-            this.additiveBlending = animationConfig.additiveBlending;
+            this.additive = animationConfig.additive;
             this.displayControl = animationConfig.displayControl;
             this.actionEnabled = animationConfig.actionEnabled;
+            this.blendType = animationData.blendType;
             this.layer = animationConfig.layer;
             this.playTimes = animationConfig.playTimes;
             this.timeScale = animationConfig.timeScale;
             this.fadeTotalTime = animationConfig.fadeInTime;
             this.autoFadeOutTime = animationConfig.autoFadeOutTime;
-            this.weight = animationConfig.weight;
             this.name = animationConfig.name.length > 0 ? animationConfig.name : animationConfig.animation;
             this.group = animationConfig.group;
+            //
+            this._weight = animationConfig.weight;
             if (animationConfig.pauseFadeIn) {
                 this._playheadState = 2; // 10
             }
@@ -9140,13 +9050,12 @@ var dragonBones;
          * @internal
          */
         AnimationState.prototype.advanceTime = function (passedTime, cacheFrameRate) {
-            this._blendState.dirty = false;
             // Update fade time.
             if (this._fadeState !== 0 || this._subFadeState !== 0) {
                 this._advanceFadeTime(passedTime);
             }
             // Update time.
-            if (this._playheadState === 3) {
+            if (this._playheadState === 3) { // 11
                 if (this.timeScale !== 1.0) {
                     passedTime *= this.timeScale;
                 }
@@ -9160,123 +9069,201 @@ var dragonBones;
                 this._timelineDirty = 0;
                 this._updateBoneAndSlotTimelines();
             }
-            if (this.weight === 0.0) {
-                return;
-            }
+            var isBlendDirty = this._fadeState !== 0 || this._subFadeState === 0;
             var isCacheEnabled = this._fadeState === 0 && cacheFrameRate > 0.0;
             var isUpdateTimeline = true;
             var isUpdateBoneTimeline = true;
             var time = this._time;
-            this._weightResult = this.weight * this._fadeProgress;
+            this._weightResult = this._weight * this._fadeProgress;
             if (this._parent !== null) {
-                this._weightResult *= this._parent._weightResult / this._parent._fadeProgress;
+                this._weightResult *= this._parent._weightResult;
+            }
+            if (this._actionTimeline.playState <= 0) { // Update main timeline.
+                this._actionTimeline.update(time);
             }
-            if (this._actionTimeline.playState <= 0) {
-                this._actionTimeline.update(time); // Update main timeline.
+            if (this._weight === 0.0) {
+                return;
             }
-            if (isCacheEnabled) {
+            if (isCacheEnabled) { // Cache time internval.
                 var internval = cacheFrameRate * 2.0;
                 this._actionTimeline.currentTime = Math.floor(this._actionTimeline.currentTime * internval) / internval;
             }
-            if (this._zOrderTimeline !== null && this._zOrderTimeline.playState <= 0) {
+            if (this._zOrderTimeline !== null && this._zOrderTimeline.playState <= 0) { // Update zOrder timeline.
                 this._zOrderTimeline.update(time);
             }
-            if (isCacheEnabled) {
+            if (isCacheEnabled) { // Update cache.
                 var cacheFrameIndex = Math.floor(this._actionTimeline.currentTime * cacheFrameRate); // uint
-                if (this._armature._cacheFrameIndex === cacheFrameIndex) {
+                if (this._armature._cacheFrameIndex === cacheFrameIndex) { // Same cache.
                     isUpdateTimeline = false;
                     isUpdateBoneTimeline = false;
                 }
                 else {
                     this._armature._cacheFrameIndex = cacheFrameIndex;
-                    if (this._animationData.cachedFrames[cacheFrameIndex]) {
+                    if (this._animationData.cachedFrames[cacheFrameIndex]) { // Cached.
                         isUpdateBoneTimeline = false;
                     }
-                    else {
+                    else { // Cache.
                         this._animationData.cachedFrames[cacheFrameIndex] = true;
                     }
                 }
             }
             if (isUpdateTimeline) {
+                var isBlend = false;
+                var prevTarget = null; //
                 if (isUpdateBoneTimeline) {
                     for (var i = 0, l = this._boneTimelines.length; i < l; ++i) {
                         var timeline = this._boneTimelines[i];
                         if (timeline.playState <= 0) {
                             timeline.update(time);
                         }
-                        if (i === l - 1 || timeline.bone !== this._boneTimelines[i + 1].bone) {
-                            var state = timeline.bone._blendState.update(this._weightResult, this.layer);
-                            if (state !== 0) {
-                                timeline.blend(state);
+                        if (timeline.target !== prevTarget) {
+                            var blendState = timeline.target;
+                            isBlend = blendState.update(this);
+                            prevTarget = blendState;
+                            if (blendState.dirty === 1) {
+                                var pose = blendState.target.animationPose;
+                                pose.x = 0.0;
+                                pose.y = 0.0;
+                                pose.rotation = 0.0;
+                                pose.skew = 0.0;
+                                pose.scaleX = 1.0;
+                                pose.scaleY = 1.0;
                             }
                         }
+                        if (isBlend) {
+                            timeline.blend(isBlendDirty);
+                        }
                     }
                 }
-                for (var i = 0, l = this._surfaceTimelines.length; i < l; ++i) {
-                    var timeline = this._surfaceTimelines[i];
-                    var state = timeline.surface._blendState.update(this._weightResult, this.layer);
+                for (var i = 0, l = this._boneBlendTimelines.length; i < l; ++i) {
+                    var timeline = this._boneBlendTimelines[i];
                     if (timeline.playState <= 0) {
                         timeline.update(time);
                     }
-                    if (state !== 0) {
-                        timeline.blend(state);
+                    if (timeline.target.update(this)) {
+                        timeline.blend(isBlendDirty);
                     }
                 }
                 if (this.displayControl) {
                     for (var i = 0, l = this._slotTimelines.length; i < l; ++i) {
                         var timeline = this._slotTimelines[i];
-                        var displayController = timeline.slot.displayController;
-                        if (displayController === null ||
-                            displayController === this.name ||
-                            displayController === this.group) {
-                            if (timeline.playState <= 0) {
+                        if (timeline.playState <= 0) {
+                            var slot = timeline.target;
+                            var displayController = slot.displayController;
+                            if (displayController === null ||
+                                displayController === this.name ||
+                                displayController === this.group) {
                                 timeline.update(time);
                             }
                         }
                     }
                 }
-                for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) {
-                    var timeline = this._constraintTimelines[i];
+                for (var i = 0, l = this._slotBlendTimelines.length; i < l; ++i) {
+                    var timeline = this._slotBlendTimelines[i];
                     if (timeline.playState <= 0) {
+                        var blendState = timeline.target;
                         timeline.update(time);
+                        if (blendState.update(this)) {
+                            timeline.blend(isBlendDirty);
+                        }
                     }
                 }
-                for (var i = 0, l = this._animationTimelines.length; i < l; ++i) {
-                    var timeline = this._animationTimelines[i];
-                    var state = timeline.animationState._blendState.update(this._weightResult, this.layer);
+                for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) {
+                    var timeline = this._constraintTimelines[i];
                     if (timeline.playState <= 0) {
                         timeline.update(time);
                     }
-                    if (state !== 0) {
-                        timeline.blend(state);
+                }
+                if (this._animationTimelines.length > 0) {
+                    var dL = 100.0;
+                    var dR = 100.0;
+                    var leftState = null;
+                    var rightState = null;
+                    for (var i = 0, l = this._animationTimelines.length; i < l; ++i) {
+                        var timeline = this._animationTimelines[i];
+                        if (timeline.playState <= 0) {
+                            timeline.update(time);
+                        }
+                        if (this.blendType === 1 /* E1D */) { // TODO
+                            var animationState = timeline.target;
+                            var d = this.parameterX - animationState.positionX;
+                            if (d >= 0.0) {
+                                if (d < dL) {
+                                    dL = d;
+                                    leftState = animationState;
+                                }
+                            }
+                            else {
+                                if (-d < dR) {
+                                    dR = -d;
+                                    rightState = animationState;
+                                }
+                            }
+                        }
+                    }
+                    if (leftState !== null) {
+                        if (this._activeChildA !== leftState) {
+                            if (this._activeChildA !== null) {
+                                this._activeChildA.weight = 0.0;
+                            }
+                            this._activeChildA = leftState;
+                            this._activeChildA.activeTimeline();
+                        }
+                        if (this._activeChildB !== rightState) {
+                            if (this._activeChildB !== null) {
+                                this._activeChildB.weight = 0.0;
+                            }
+                            this._activeChildB = rightState;
+                        }
+                        leftState.weight = dR / (dL + dR);
+                        if (rightState) {
+                            rightState.weight = 1.0 - leftState.weight;
+                        }
                     }
                 }
             }
             if (this._fadeState === 0) {
                 if (this._subFadeState > 0) {
                     this._subFadeState = 0;
-                    if (this._poseTimelines.length > 0) {
+                    if (this._poseTimelines.length > 0) { // Remove pose timelines.
                         for (var _i = 0, _a = this._poseTimelines; _i < _a.length; _i++) {
                             var timeline = _a[_i];
-                            if (timeline instanceof dragonBones.BoneTimelineState) {
-                                this._boneTimelines.splice(this._boneTimelines.indexOf(timeline), 1);
+                            var index = this._boneTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._boneTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.SurfaceTimelineState) {
-                                this._surfaceTimelines.splice(this._surfaceTimelines.indexOf(timeline), 1);
+                            index = this._boneBlendTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._boneBlendTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.SlotTimelineState) {
-                                this._slotTimelines.splice(this._slotTimelines.indexOf(timeline), 1);
+                            index = this._slotTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._slotTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.ConstraintTimelineState) {
-                                this._constraintTimelines.splice(this._constraintTimelines.indexOf(timeline), 1);
+                            index = this._slotBlendTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._slotBlendTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
+                            }
+                            index = this._constraintTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._constraintTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            timeline.returnToPool();
                         }
                         this._poseTimelines.length = 0;
                     }
                 }
                 if (this._actionTimeline.playState > 0) {
-                    if (this.autoFadeOutTime >= 0.0) {
+                    if (this.autoFadeOutTime >= 0.0) { // Auto fade out.
                         this.fadeOut(this.autoFadeOutTime);
                     }
                 }
@@ -9331,7 +9318,7 @@ var dragonBones;
                 this._playheadState &= 2; // x0
             }
             if (this._fadeState > 0) {
-                if (fadeOutTime > this.fadeTotalTime - this._fadeTime) {
+                if (fadeOutTime > this.fadeTotalTime - this._fadeTime) { // If the animation is already in fade out, the new fade out will be ignored.
                     return;
                 }
             }
@@ -9345,7 +9332,7 @@ var dragonBones;
                     var timeline = _a[_i];
                     timeline.fadeOut();
                 }
-                for (var _b = 0, _c = this._surfaceTimelines; _b < _c.length; _b++) {
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
                     var timeline = _c[_b];
                     timeline.fadeOut();
                 }
@@ -9353,15 +9340,21 @@ var dragonBones;
                     var timeline = _e[_d];
                     timeline.fadeOut();
                 }
-                for (var _f = 0, _g = this._constraintTimelines; _f < _g.length; _f++) {
+                for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) {
                     var timeline = _g[_f];
                     timeline.fadeOut();
                 }
-                for (var _h = 0, _j = this._animationTimelines; _h < _j.length; _h++) {
+                for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) {
                     var timeline = _j[_h];
-                    timeline.animationState.fadeOut(fadeOutTime, pausePlayhead);
                     timeline.fadeOut();
                 }
+                for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) {
+                    var timeline = _l[_k];
+                    timeline.fadeOut();
+                    //
+                    var animaitonState = timeline.target;
+                    animaitonState.fadeOut(999999.0, true);
+                }
             }
             this.displayControl = false; //
             this.fadeTotalTime = this._fadeProgress > 0.000001 ? fadeOutTime / this._fadeProgress : 0.0;
@@ -9402,10 +9395,10 @@ var dragonBones;
             if (currentBone === null) {
                 return;
             }
-            if (this._boneMask.indexOf(boneName) < 0) {
+            if (this._boneMask.indexOf(boneName) < 0) { // Add mixing
                 this._boneMask.push(boneName);
             }
-            if (recursive) {
+            if (recursive) { // Add recursive mixing.
                 for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) {
                     var bone = _a[_i];
                     if (this._boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) {
@@ -9432,23 +9425,23 @@ var dragonBones;
         AnimationState.prototype.removeBoneMask = function (boneName, recursive) {
             if (recursive === void 0) { recursive = true; }
             var index = this._boneMask.indexOf(boneName);
-            if (index >= 0) {
+            if (index >= 0) { // Remove mixing.
                 this._boneMask.splice(index, 1);
             }
             if (recursive) {
                 var currentBone = this._armature.getBone(boneName);
                 if (currentBone !== null) {
                     var bones = this._armature.getBones();
-                    if (this._boneMask.length > 0) {
+                    if (this._boneMask.length > 0) { // Remove recursive mixing.
                         for (var _i = 0, bones_1 = bones; _i < bones_1.length; _i++) {
                             var bone = bones_1[_i];
-                            var index_2 = this._boneMask.indexOf(bone.name);
-                            if (index_2 >= 0 && currentBone.contains(bone)) {
-                                this._boneMask.splice(index_2, 1);
+                            var index_1 = this._boneMask.indexOf(bone.name);
+                            if (index_1 >= 0 && currentBone.contains(bone)) {
+                                this._boneMask.splice(index_1, 1);
                             }
                         }
                     }
-                    else {
+                    else { // Add unrecursive mixing.
                         for (var _a = 0, bones_2 = bones; _a < bones_2.length; _a++) {
                             var bone = bones_2[_a];
                             if (bone === currentBone) {
@@ -9477,6 +9470,63 @@ var dragonBones;
             this._boneMask.length = 0;
             this._timelineDirty = 1;
         };
+        /**
+         * @private
+         */
+        AnimationState.prototype.addState = function (animationState, timelineDatas) {
+            if (timelineDatas === void 0) { timelineDatas = null; }
+            if (timelineDatas !== null) {
+                for (var _i = 0, timelineDatas_4 = timelineDatas; _i < timelineDatas_4.length; _i++) {
+                    var timelineData = timelineDatas_4[_i];
+                    switch (timelineData.type) {
+                        case 40 /* AnimationProgress */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationProgressTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            if (this.blendType !== 0 /* None */) {
+                                var animaitonTimelineData = timelineData;
+                                animationState.positionX = animaitonTimelineData.x;
+                                animationState.positionY = animaitonTimelineData.y;
+                                animationState.weight = 0.0;
+                            }
+                            animationState._parent = this;
+                            this.resetToPose = false;
+                            break;
+                        }
+                        case 41 /* AnimationWeight */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationWeightTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            break;
+                        }
+                        case 42 /* AnimationParameter */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationParametersTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            break;
+                        }
+                        default:
+                            break;
+                    }
+                }
+            }
+            if (animationState._parent === null) {
+                animationState._parent = this;
+            }
+        };
+        /**
+         * @internal
+         */
+        AnimationState.prototype.activeTimeline = function () {
+            for (var _i = 0, _a = this._slotTimelines; _i < _a.length; _i++) {
+                var timeline = _a[_i];
+                timeline.dirty = true;
+                timeline.currentTime = -1.0;
+            }
+        };
         Object.defineProperty(AnimationState.prototype, "isFadeIn", {
             /**
              * - Whether the animation state is fading in.
@@ -9618,8 +9668,9 @@ var dragonBones;
                         value += this._duration;
                     }
                 }
-                if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 && value === this._duration) {
-                    value = this._duration - 0.000001;
+                if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 &&
+                    value === this._duration && this._parent === null) {
+                    value = this._duration - 0.000001; // 
                 }
                 if (this._time === value) {
                     return;
@@ -9641,13 +9692,50 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(AnimationState.prototype, "animationData", {
+        Object.defineProperty(AnimationState.prototype, "weight", {
+            /**
+             * - The blend weight.
+             * @default 1.0
+             * @version DragonBones 5.0
+             * @language en_US
+             */
+            /**
+             * - 混合权重。
+             * @default 1.0
+             * @version DragonBones 5.0
+             * @language zh_CN
+             */
             /**
              * - The animation data.
              * @see dragonBones.AnimationData
              * @version DragonBones 3.0
              * @language en_US
              */
+            get: function () {
+                return this._weight;
+            },
+            set: function (value) {
+                if (this._weight === value) {
+                    return;
+                }
+                this._weight = value;
+                for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) {
+                    var timeline = _a[_i];
+                    timeline.dirty = true;
+                }
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
+                    timeline.dirty = true;
+                }
+                for (var _d = 0, _e = this._slotBlendTimelines; _d < _e.length; _d++) {
+                    var timeline = _e[_d];
+                    timeline.dirty = true;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(AnimationState.prototype, "animationData", {
             /**
              * - 动画数据。
              * @see dragonBones.AnimationData
@@ -9666,74 +9754,65 @@ var dragonBones;
     /**
      * @internal
      */
-    var BonePose = /** @class */ (function (_super) {
-        __extends(BonePose, _super);
-        function BonePose() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.current = new dragonBones.Transform();
-            _this.delta = new dragonBones.Transform();
-            _this.result = new dragonBones.Transform();
-            return _this;
+    var BlendState = /** @class */ (function (_super) {
+        __extends(BlendState, _super);
+        function BlendState() {
+            return _super !== null && _super.apply(this, arguments) || this;
         }
-        BonePose.toString = function () {
-            return "[class dragonBones.BonePose]";
+        BlendState.toString = function () {
+            return "[class dragonBones.BlendState]";
         };
-        BonePose.prototype._onClear = function () {
-            this.current.identity();
-            this.delta.identity();
-            this.result.identity();
+        BlendState.prototype._onClear = function () {
+            this.reset();
+            this.target = null;
         };
-        return BonePose;
-    }(dragonBones.BaseObject));
-    dragonBones.BonePose = BonePose;
-    /**
-     * @internal
-     */
-    var BlendState = /** @class */ (function () {
-        function BlendState() {
-        }
-        /**
-         * -1: First blending, 0: No blending, 1: Blending.
-         */
-        BlendState.prototype.update = function (weight, p_layer) {
-            if (this.dirty) {
+        BlendState.prototype.update = function (animationState) {
+            var animationLayer = animationState.layer;
+            var animationWeight = animationState._weightResult;
+            if (this.dirty > 0) {
                 if (this.leftWeight > 0.0) {
-                    if (this.layer !== p_layer) {
+                    if (this.layer !== animationLayer) {
                         if (this.layerWeight >= this.leftWeight) {
+                            this.dirty++;
+                            this.layer = animationLayer;
                             this.leftWeight = 0.0;
-                            return 0;
-                        }
-                        else {
-                            this.layer = p_layer;
-                            this.leftWeight -= this.layerWeight;
-                            this.layerWeight = 0.0;
+                            this.blendWeight = 0.0;
+                            return false;
                         }
-                    }
-                }
-                else {
-                    return 0;
+                        this.layer = animationLayer;
+                        this.leftWeight -= this.layerWeight;
+                        this.layerWeight = 0.0;
+                    }
+                    animationWeight *= this.leftWeight;
+                    this.dirty++;
+                    this.blendWeight = animationWeight;
+                    this.layerWeight += this.blendWeight;
+                    return true;
                 }
-                weight *= this.leftWeight;
-                this.layerWeight += weight;
-                this.blendWeight = weight;
-                return 2;
+                return false;
             }
-            this.dirty = true;
-            this.layer = p_layer;
-            this.layerWeight = weight;
+            this.dirty++;
+            this.layer = animationLayer;
             this.leftWeight = 1.0;
-            this.blendWeight = weight;
-            return 1;
+            this.blendWeight = animationWeight;
+            this.layerWeight = animationWeight;
+            return true;
         };
-        BlendState.prototype.clear = function () {
-            this.dirty = false;
+        BlendState.prototype.reset = function () {
+            this.dirty = 0;
             this.layer = 0;
             this.leftWeight = 0.0;
             this.layerWeight = 0.0;
             this.blendWeight = 0.0;
         };
+        BlendState.BONE_TRANSFORM = "boneTransform";
+        BlendState.BONE_ALPHA = "boneAlpha";
+        BlendState.SURFACE = "surface";
+        BlendState.SLOT_DEFORM = "slotDeform";
+        BlendState.SLOT_ALPHA = "slotAlpha";
+        BlendState.SLOT_Z_INDEX = "slotZIndex";
         return BlendState;
-    }());
+    }(dragonBones.BaseObject));
     dragonBones.BlendState = BlendState;
 })(dragonBones || (dragonBones = {}));
 /**
@@ -9769,29 +9848,30 @@ var dragonBones;
             return _super !== null && _super.apply(this, arguments) || this;
         }
         TimelineState.prototype._onClear = function () {
+            this.dirty = false;
             this.playState = -1;
-            this.currentPlayTimes = -1;
+            this.currentPlayTimes = 0;
             this.currentTime = -1.0;
-            this._tweenState = 0 /* None */;
-            this._frameRate = 0;
+            this.target = null;
+            this._isTween = false;
+            this._valueOffset = 0;
             this._frameValueOffset = 0;
-            this._frameCount = 0;
             this._frameOffset = 0;
+            this._frameRate = 0;
+            this._frameCount = 0;
             this._frameIndex = -1;
             this._frameRateR = 0.0;
             this._position = 0.0;
             this._duration = 0.0;
             this._timeScale = 1.0;
             this._timeOffset = 0.0;
-            this._dragonBonesData = null; //
             this._animationData = null; //
             this._timelineData = null; //
             this._armature = null; //
             this._animationState = null; //
             this._actionTimeline = null; //
             this._frameArray = null; //
-            this._frameIntArray = null; //
-            this._frameFloatArray = null; //
+            this._valueArray = null; //
             this._timelineArray = null; //
             this._frameIndices = null; //
         };
@@ -9799,12 +9879,12 @@ var dragonBones;
             var prevState = this.playState;
             var prevPlayTimes = this.currentPlayTimes;
             var prevTime = this.currentTime;
-            if (this._actionTimeline !== null && this._frameCount <= 1) {
+            if (this._actionTimeline !== null && this._frameCount <= 1) { // No frame or only one frame.
                 this.playState = this._actionTimeline.playState >= 0 ? 1 : -1;
                 this.currentPlayTimes = 1;
                 this.currentTime = this._actionTimeline.currentTime;
             }
-            else if (this._actionTimeline === null || this._timeScale !== 1.0 || this._timeOffset !== 0.0) {
+            else if (this._actionTimeline === null || this._timeScale !== 1.0 || this._timeOffset !== 0.0) { // Action timeline or has scale and offset.
                 var playTimes = this._animationState.playTimes;
                 var totalTime = playTimes * this._duration;
                 passedTime *= this._timeScale;
@@ -9820,7 +9900,7 @@ var dragonBones;
                         this.currentTime = 0.0;
                     }
                     else {
-                        this.currentTime = this._duration + 0.000001; // Precision problem
+                        this.currentTime = this.playState === 1 ? this._duration + 0.000001 : this._duration; // Precision problem
                     }
                 }
                 else {
@@ -9839,7 +9919,7 @@ var dragonBones;
                 }
                 this.currentTime += this._position;
             }
-            else {
+            else { // Multi frames.
                 this.playState = this._actionTimeline.playState;
                 this.currentPlayTimes = this._actionTimeline.currentPlayTimes;
                 this.currentTime = this._actionTimeline.currentTime;
@@ -9862,25 +9942,27 @@ var dragonBones;
             if (this === this._actionTimeline) {
                 this._actionTimeline = null; //
             }
-            this._animationData = this._animationState._animationData;
+            this._animationData = this._animationState.animationData;
+            //
             this._frameRate = this._animationData.parent.frameRate;
             this._frameRateR = 1.0 / this._frameRate;
             this._position = this._animationState._position;
             this._duration = this._animationState._duration;
-            this._dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data.
             if (this._timelineData !== null) {
-                this._frameIntArray = this._dragonBonesData.frameIntArray;
-                this._frameFloatArray = this._dragonBonesData.frameFloatArray;
-                this._frameArray = this._dragonBonesData.frameArray;
-                this._timelineArray = this._dragonBonesData.timelineArray;
-                this._frameIndices = this._dragonBonesData.frameIndices;
+                var dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data.
+                this._frameArray = dragonBonesData.frameArray;
+                this._timelineArray = dragonBonesData.timelineArray;
+                this._frameIndices = dragonBonesData.frameIndices;
+                //
                 this._frameCount = this._timelineArray[this._timelineData.offset + 2 /* TimelineKeyFrameCount */];
                 this._frameValueOffset = this._timelineArray[this._timelineData.offset + 4 /* TimelineFrameValueOffset */];
                 this._timeScale = 100.0 / this._timelineArray[this._timelineData.offset + 0 /* TimelineScale */];
                 this._timeOffset = this._timelineArray[this._timelineData.offset + 1 /* TimelineOffset */] * 0.01;
             }
         };
-        TimelineState.prototype.fadeOut = function () { };
+        TimelineState.prototype.fadeOut = function () {
+            this.dirty = false;
+        };
         TimelineState.prototype.update = function (passedTime) {
             if (this._setCurrentTime(passedTime)) {
                 if (this._frameCount > 1) {
@@ -9894,16 +9976,18 @@ var dragonBones;
                 }
                 else if (this._frameIndex < 0) {
                     this._frameIndex = 0;
-                    if (this._timelineData !== null) {
+                    if (this._timelineData !== null) { // May be pose timeline.
                         this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */];
                     }
                     this._onArriveAtFrame();
                 }
-                if (this._tweenState !== 0 /* None */) {
+                if (this._isTween || this.dirty) {
                     this._onUpdateFrame();
                 }
             }
         };
+        TimelineState.prototype.blend = function (_isDirty) {
+        };
         return TimelineState;
     }(dragonBones.BaseObject));
     dragonBones.TimelineState = TimelineState;
@@ -9937,10 +10021,19 @@ var dragonBones;
             else if (progress >= 1.0) {
                 return 1.0;
             }
+            var isOmited = count > 0;
             var segmentCount = count + 1; // + 2 - 1
             var valueIndex = Math.floor(progress * segmentCount);
-            var fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1];
-            var toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex];
+            var fromValue = 0.0;
+            var toValue = 0.0;
+            if (isOmited) {
+                fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1];
+                toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex];
+            }
+            else {
+                fromValue = samples[offset + valueIndex - 1];
+                toValue = samples[offset + valueIndex];
+            }
             return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001;
         };
         TweenTimelineState.prototype._onClear = function () {
@@ -9949,21 +10042,27 @@ var dragonBones;
             this._curveCount = 0;
             this._framePosition = 0.0;
             this._frameDurationR = 0.0;
-            this._tweenProgress = 0.0;
             this._tweenEasing = 0.0;
+            this._tweenProgress = 0.0;
+            this._valueScale = 1.0;
         };
         TweenTimelineState.prototype._onArriveAtFrame = function () {
             if (this._frameCount > 1 &&
                 (this._frameIndex !== this._frameCount - 1 ||
                     this._animationState.playTimes === 0 ||
                     this._animationState.currentPlayTimes < this._animationState.playTimes - 1)) {
-                this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */]; // TODO recode ture tween type.
-                this._tweenState = this._tweenType === 0 /* None */ ? 1 /* Once */ : 2 /* Always */;
-                if (this._tweenType === 2 /* Curve */) {
-                    this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */];
+                this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */];
+                this._isTween = this._tweenType !== 0 /* None */;
+                if (this._isTween) {
+                    if (this._tweenType === 2 /* Curve */) {
+                        this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */];
+                    }
+                    else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) {
+                        this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01;
+                    }
                 }
-                else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) {
-                    this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01;
+                else {
+                    this.dirty = true;
                 }
                 this._framePosition = this._frameArray[this._frameOffset] * this._frameRateR;
                 if (this._frameIndex === this._frameCount - 1) {
@@ -9981,11 +10080,13 @@ var dragonBones;
                 }
             }
             else {
-                this._tweenState = 1 /* Once */;
+                this.dirty = true;
+                this._isTween = false;
             }
         };
         TweenTimelineState.prototype._onUpdateFrame = function () {
-            if (this._tweenState === 2 /* Always */) {
+            if (this._isTween) {
+                this.dirty = true;
                 this._tweenProgress = (this.currentTime - this._framePosition) * this._frameDurationR;
                 if (this._tweenType === 2 /* Curve */) {
                     this._tweenProgress = TweenTimelineState._getEasingCurveValue(this._tweenProgress, this._frameArray, this._curveCount, this._frameOffset + 3 /* FrameCurveSamples */);
@@ -9994,9 +10095,6 @@ var dragonBones;
                     this._tweenProgress = TweenTimelineState._getEasingValue(this._tweenType, this._tweenProgress, this._tweenEasing);
                 }
             }
-            else {
-                this._tweenProgress = 0.0;
-            }
         };
         return TweenTimelineState;
     }(TimelineState));
@@ -10004,98 +10102,213 @@ var dragonBones;
     /**
      * @internal
      */
-    var BoneTimelineState = /** @class */ (function (_super) {
-        __extends(BoneTimelineState, _super);
-        function BoneTimelineState() {
+    var SingleValueTimelineState = /** @class */ (function (_super) {
+        __extends(SingleValueTimelineState, _super);
+        function SingleValueTimelineState() {
             return _super !== null && _super.apply(this, arguments) || this;
         }
-        BoneTimelineState.prototype._onClear = function () {
+        SingleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.bone = null; //
-            this.bonePose = null; //
-        };
-        BoneTimelineState.prototype.blend = function (state) {
-            var blendWeight = this.bone._blendState.blendWeight;
-            var animationPose = this.bone.animationPose;
-            var result = this.bonePose.result;
-            if (state === 2) {
-                animationPose.x += result.x * blendWeight;
-                animationPose.y += result.y * blendWeight;
-                animationPose.rotation += result.rotation * blendWeight;
-                animationPose.skew += result.skew * blendWeight;
-                animationPose.scaleX += (result.scaleX - 1.0) * blendWeight;
-                animationPose.scaleY += (result.scaleY - 1.0) * blendWeight;
-            }
-            else if (blendWeight !== 1.0) {
-                animationPose.x = result.x * blendWeight;
-                animationPose.y = result.y * blendWeight;
-                animationPose.rotation = result.rotation * blendWeight;
-                animationPose.skew = result.skew * blendWeight;
-                animationPose.scaleX = (result.scaleX - 1.0) * blendWeight + 1.0;
-                animationPose.scaleY = (result.scaleY - 1.0) * blendWeight + 1.0;
+            this._current = 0.0;
+            this._difference = 0.0;
+            this._result = 0.0;
+        };
+        SingleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + 1;
+                    if (valueScale === 1.0) {
+                        this._current = valueArray[valueOffset];
+                        this._difference = valueArray[nextValueOffset] - this._current;
+                    }
+                    else {
+                        this._current = valueArray[valueOffset] * valueScale;
+                        this._difference = valueArray[nextValueOffset] * valueScale - this._current;
+                    }
+                }
+                else {
+                    this._result = valueArray[valueOffset] * valueScale;
+                }
             }
             else {
-                animationPose.x = result.x;
-                animationPose.y = result.y;
-                animationPose.rotation = result.rotation;
-                animationPose.skew = result.skew;
-                animationPose.scaleX = result.scaleX;
-                animationPose.scaleY = result.scaleY;
+                this._result = 0.0;
             }
-            if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                this.bone._transformDirty = true;
+        };
+        SingleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                this._result = this._current + this._difference * this._tweenProgress;
             }
         };
-        return BoneTimelineState;
+        return SingleValueTimelineState;
     }(TweenTimelineState));
-    dragonBones.BoneTimelineState = BoneTimelineState;
+    dragonBones.SingleValueTimelineState = SingleValueTimelineState;
     /**
      * @internal
      */
-    var SlotTimelineState = /** @class */ (function (_super) {
-        __extends(SlotTimelineState, _super);
-        function SlotTimelineState() {
+    var DoubleValueTimelineState = /** @class */ (function (_super) {
+        __extends(DoubleValueTimelineState, _super);
+        function DoubleValueTimelineState() {
             return _super !== null && _super.apply(this, arguments) || this;
         }
-        SlotTimelineState.prototype._onClear = function () {
+        DoubleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.slot = null; //
+            this._currentA = 0.0;
+            this._currentB = 0.0;
+            this._differenceA = 0.0;
+            this._differenceB = 0.0;
+            this._resultA = 0.0;
+            this._resultB = 0.0;
+        };
+        DoubleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * 2;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + 2;
+                    if (valueScale === 1.0) {
+                        this._currentA = valueArray[valueOffset];
+                        this._currentB = valueArray[valueOffset + 1];
+                        this._differenceA = valueArray[nextValueOffset] - this._currentA;
+                        this._differenceB = valueArray[nextValueOffset + 1] - this._currentB;
+                    }
+                    else {
+                        this._currentA = valueArray[valueOffset] * valueScale;
+                        this._currentB = valueArray[valueOffset + 1] * valueScale;
+                        this._differenceA = valueArray[nextValueOffset] * valueScale - this._currentA;
+                        this._differenceB = valueArray[nextValueOffset + 1] * valueScale - this._currentB;
+                    }
+                }
+                else {
+                    this._resultA = valueArray[valueOffset] * valueScale;
+                    this._resultB = valueArray[valueOffset + 1] * valueScale;
+                }
+            }
+            else {
+                this._resultA = 0.0;
+                this._resultB = 0.0;
+            }
+        };
+        DoubleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                this._resultA = this._currentA + this._differenceA * this._tweenProgress;
+                this._resultB = this._currentB + this._differenceB * this._tweenProgress;
+            }
         };
-        return SlotTimelineState;
+        return DoubleValueTimelineState;
     }(TweenTimelineState));
-    dragonBones.SlotTimelineState = SlotTimelineState;
+    dragonBones.DoubleValueTimelineState = DoubleValueTimelineState;
     /**
      * @internal
      */
-    var ConstraintTimelineState = /** @class */ (function (_super) {
-        __extends(ConstraintTimelineState, _super);
-        function ConstraintTimelineState() {
-            return _super !== null && _super.apply(this, arguments) || this;
+    var MutilpleValueTimelineState = /** @class */ (function (_super) {
+        __extends(MutilpleValueTimelineState, _super);
+        function MutilpleValueTimelineState() {
+            var _this = _super !== null && _super.apply(this, arguments) || this;
+            _this._rd = [];
+            return _this;
         }
-        ConstraintTimelineState.prototype._onClear = function () {
+        MutilpleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.constraint = null; //
+            this._valueCount = 0;
+            this._rd.length = 0;
         };
-        return ConstraintTimelineState;
-    }(TweenTimelineState));
-    dragonBones.ConstraintTimelineState = ConstraintTimelineState;
-})(dragonBones || (dragonBones = {}));
-/**
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2018 DragonBones team and other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+        MutilpleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            var valueCount = this._valueCount;
+            var rd = this._rd;
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + valueCount;
+                    if (valueScale === 1.0) {
+                        for (var i = 0; i < valueCount; ++i) {
+                            rd[valueCount + i] = valueArray[nextValueOffset + i] - valueArray[valueOffset + i];
+                        }
+                    }
+                    else {
+                        for (var i = 0; i < valueCount; ++i) {
+                            rd[valueCount + i] = (valueArray[nextValueOffset + i] - valueArray[valueOffset + i]) * valueScale;
+                        }
+                    }
+                }
+                else if (valueScale === 1.0) {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i];
+                    }
+                }
+                else {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] * valueScale;
+                    }
+                }
+            }
+            else {
+                for (var i = 0; i < valueCount; ++i) {
+                    rd[i] = 0.0;
+                }
+            }
+        };
+        MutilpleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                var valueCount = this._valueCount;
+                var valueScale = this._valueScale;
+                var tweenProgress = this._tweenProgress;
+                var valueArray = this._valueArray;
+                var rd = this._rd;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount;
+                if (valueScale === 1.0) {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] + rd[valueCount + i] * tweenProgress;
+                    }
+                }
+                else {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] * valueScale + rd[valueCount + i] * tweenProgress;
+                    }
+                }
+            }
+        };
+        return MutilpleValueTimelineState;
+    }(TweenTimelineState));
+    dragonBones.MutilpleValueTimelineState = MutilpleValueTimelineState;
+})(dragonBones || (dragonBones = {}));
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
@@ -10153,14 +10366,15 @@ var dragonBones;
             var prevPlayTimes = this.currentPlayTimes;
             var prevTime = this.currentTime;
             if (this._setCurrentTime(passedTime)) {
+                var eventActive = this._animationState._parent === null && this._animationState.actionEnabled;
                 var eventDispatcher = this._armature.eventDispatcher;
                 if (prevState < 0) {
                     if (this.playState !== prevState) {
-                        if (this._animationState.displayControl && this._animationState.resetToPose) {
+                        if (this._animationState.displayControl && this._animationState.resetToPose) { // Reset zorder to pose.
                             this._armature._sortZOrder(null, 0);
                         }
-                        prevPlayTimes = this.currentPlayTimes;
-                        if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) {
+                        // prevPlayTimes = this.currentPlayTimes; // TODO
+                        if (eventActive && eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) {
                             var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
                             eventObject.type = dragonBones.EventObject.START;
                             eventObject.armature = this._armature;
@@ -10175,7 +10389,7 @@ var dragonBones;
                 var isReverse = this._animationState.timeScale < 0.0;
                 var loopCompleteEvent = null;
                 var completeEvent = null;
-                if (this.currentPlayTimes !== prevPlayTimes) {
+                if (eventActive && this.currentPlayTimes !== prevPlayTimes) {
                     if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.LOOP_COMPLETE)) {
                         loopCompleteEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
                         loopCompleteEvent.type = dragonBones.EventObject.LOOP_COMPLETE;
@@ -10195,7 +10409,7 @@ var dragonBones;
                     var timelineData = this._timelineData;
                     var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint
                     var frameIndex = this._frameIndices[timelineData.frameIndicesOffset + timelineFrameIndex];
-                    if (this._frameIndex !== frameIndex) {
+                    if (this._frameIndex !== frameIndex) { // Arrive at frame.                   
                         var crossedFrameIndex = this._frameIndex;
                         this._frameIndex = frameIndex;
                         if (this._timelineArray !== null) {
@@ -10204,8 +10418,8 @@ var dragonBones;
                                 if (crossedFrameIndex < 0) {
                                     var prevFrameIndex = Math.floor(prevTime * this._frameRate);
                                     crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex];
-                                    if (this.currentPlayTimes === prevPlayTimes) {
-                                        if (crossedFrameIndex === frameIndex) {
+                                    if (this.currentPlayTimes === prevPlayTimes) { // Start.
+                                        if (crossedFrameIndex === frameIndex) { // Uncrossed.
                                             crossedFrameIndex = -1;
                                         }
                                     }
@@ -10215,10 +10429,10 @@ var dragonBones;
                                     // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem
                                     var framePosition = this._frameArray[frameOffset] / this._frameRate;
                                     if (this._position <= framePosition &&
-                                        framePosition <= this._position + this._duration) {
+                                        framePosition <= this._position + this._duration) { // Support interval play.
                                         this._onCrossFrame(crossedFrameIndex);
                                     }
-                                    if (loopCompleteEvent !== null && crossedFrameIndex === 0) {
+                                    if (loopCompleteEvent !== null && crossedFrameIndex === 0) { // Add loop complete event after first frame.
                                         this._armature._dragonBones.bufferEvent(loopCompleteEvent);
                                         loopCompleteEvent = null;
                                     }
@@ -10240,8 +10454,8 @@ var dragonBones;
                                     var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex];
                                     // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem
                                     var framePosition = this._frameArray[frameOffset] / this._frameRate;
-                                    if (this.currentPlayTimes === prevPlayTimes) {
-                                        if (prevTime <= framePosition) {
+                                    if (this.currentPlayTimes === prevPlayTimes) { // Start.
+                                        if (prevTime <= framePosition) { // Crossed.
                                             if (crossedFrameIndex > 0) {
                                                 crossedFrameIndex--;
                                             }
@@ -10249,7 +10463,7 @@ var dragonBones;
                                                 crossedFrameIndex = this._frameCount - 1;
                                             }
                                         }
-                                        else if (crossedFrameIndex === frameIndex) {
+                                        else if (crossedFrameIndex === frameIndex) { // Uncrossed.
                                             crossedFrameIndex = -1;
                                         }
                                     }
@@ -10265,10 +10479,11 @@ var dragonBones;
                                     // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem
                                     var framePosition = this._frameArray[frameOffset] / this._frameRate;
                                     if (this._position <= framePosition &&
-                                        framePosition <= this._position + this._duration) {
+                                        framePosition <= this._position + this._duration //
+                                    ) { // Support interval play.
                                         this._onCrossFrame(crossedFrameIndex);
                                     }
-                                    if (loopCompleteEvent !== null && crossedFrameIndex === 0) {
+                                    if (loopCompleteEvent !== null && crossedFrameIndex === 0) { // Add loop complete event before first frame.
                                         this._armature._dragonBones.bufferEvent(loopCompleteEvent);
                                         loopCompleteEvent = null;
                                     }
@@ -10286,13 +10501,13 @@ var dragonBones;
                         this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */];
                         // Arrive at frame.
                         var framePosition = this._frameArray[this._frameOffset] / this._frameRate;
-                        if (this.currentPlayTimes === prevPlayTimes) {
+                        if (this.currentPlayTimes === prevPlayTimes) { // Start.
                             if (prevTime <= framePosition) {
                                 this._onCrossFrame(this._frameIndex);
                             }
                         }
-                        else if (this._position <= framePosition) {
-                            if (!isReverse && loopCompleteEvent !== null) {
+                        else if (this._position <= framePosition) { // Loop complete.
+                            if (!isReverse && loopCompleteEvent !== null) { // Add loop complete event before first frame.
                                 this._armature._dragonBones.bufferEvent(loopCompleteEvent);
                                 loopCompleteEvent = null;
                             }
@@ -10354,78 +10569,57 @@ var dragonBones;
         };
         BoneAllTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 6; // ...(timeline value offset)|xxxxxx|xxxxxx|(Value offset)xxxxx|(Next offset)xxxxx|xxxxxx|xxxxxx|...
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = frameFloatArray[valueOffset++] * scale;
-                current.y = frameFloatArray[valueOffset++] * scale;
-                current.rotation = frameFloatArray[valueOffset++];
-                current.skew = frameFloatArray[valueOffset++];
-                current.scaleX = frameFloatArray[valueOffset++];
-                current.scaleY = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 6
-                    }
-                    delta.x = frameFloatArray[valueOffset++] * scale - current.x;
-                    delta.y = frameFloatArray[valueOffset++] * scale - current.y;
-                    delta.rotation = frameFloatArray[valueOffset++] - current.rotation;
-                    delta.skew = frameFloatArray[valueOffset++] - current.skew;
-                    delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX;
-                    delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY;
-                }
-                else {
-                    delta.x = 0.0;
-                    delta.y = 0.0;
-                    delta.rotation = 0.0;
-                    delta.skew = 0.0;
-                    delta.scaleX = 0.0;
-                    delta.scaleY = 0.0;
-                }
+            if (this._isTween && this._frameIndex === this._frameCount - 1) {
+                this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]);
+                this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]);
+            }
+            if (this._timelineData === null) { // Pose.
+                this._rd[4] = 1.0;
+                this._rd[5] = 1.0;
             }
-            else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = 0.0;
-                current.y = 0.0;
-                current.rotation = 0.0;
-                current.skew = 0.0;
-                current.scaleX = 1.0;
-                current.scaleY = 1.0;
-                delta.x = 0.0;
-                delta.y = 0.0;
-                delta.rotation = 0.0;
-                delta.skew = 0.0;
-                delta.scaleX = 0.0;
-                delta.scaleY = 0.0;
-            }
-        };
-        BoneAllTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            result.x = current.x + delta.x * this._tweenProgress;
-            result.y = current.y + delta.y * this._tweenProgress;
-            result.rotation = current.rotation + delta.rotation * this._tweenProgress;
-            result.skew = current.skew + delta.skew * this._tweenProgress;
-            result.scaleX = current.scaleX + delta.scaleX * this._tweenProgress;
-            result.scaleY = current.scaleY + delta.scaleY * this._tweenProgress;
+        };
+        BoneAllTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueCount = 6;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
         };
         BoneAllTimelineState.prototype.fadeOut = function () {
-            var result = this.bonePose.result;
-            result.rotation = dragonBones.Transform.normalizeRadian(result.rotation);
-            result.skew = dragonBones.Transform.normalizeRadian(result.skew);
+            this.dirty = false;
+            this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]);
+            this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]);
+        };
+        BoneAllTimelineState.prototype.blend = function (isDirty) {
+            var valueScale = this._armature.armatureData.scale;
+            var rd = this._rd;
+            //
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.x += rd[0] * blendWeight * valueScale;
+                result.y += rd[1] * blendWeight * valueScale;
+                result.rotation += rd[2] * blendWeight;
+                result.skew += rd[3] * blendWeight;
+                result.scaleX += (rd[4] - 1.0) * blendWeight;
+                result.scaleY += (rd[5] - 1.0) * blendWeight;
+            }
+            else {
+                result.x = rd[0] * blendWeight * valueScale;
+                result.y = rd[1] * blendWeight * valueScale;
+                result.rotation = rd[2] * blendWeight;
+                result.skew = rd[3] * blendWeight;
+                result.scaleX = (rd[4] - 1.0) * blendWeight + 1.0; // 
+                result.scaleY = (rd[5] - 1.0) * blendWeight + 1.0; //
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         };
         return BoneAllTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.MutilpleValueTimelineState));
     dragonBones.BoneAllTimelineState = BoneAllTimelineState;
     /**
      * @internal
@@ -10438,51 +10632,36 @@ var dragonBones;
         BoneTranslateTimelineState.toString = function () {
             return "[class dragonBones.BoneTranslateTimelineState]";
         };
-        BoneTranslateTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = frameFloatArray[valueOffset++] * scale;
-                current.y = frameFloatArray[valueOffset++] * scale;
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    delta.x = frameFloatArray[valueOffset++] * scale - current.x;
-                    delta.y = frameFloatArray[valueOffset++] * scale - current.y;
-                }
-                else {
-                    delta.x = 0.0;
-                    delta.y = 0.0;
-                }
+        BoneTranslateTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueScale = this._armature.armatureData.scale;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
+        };
+        BoneTranslateTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.x += this._resultA * blendWeight;
+                result.y += this._resultB * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.x = this._resultA * blendWeight;
+                result.y = this._resultB * blendWeight;
             }
             else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = 0.0;
-                current.y = 0.0;
-                delta.x = 0.0;
-                delta.y = 0.0;
+                result.x = this._resultA;
+                result.y = this._resultB;
             }
-        };
-        BoneTranslateTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
             }
-            result.x = (current.x + delta.x * this._tweenProgress);
-            result.y = (current.y + delta.y * this._tweenProgress);
         };
         return BoneTranslateTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneTranslateTimelineState = BoneTranslateTimelineState;
     /**
      * @internal
@@ -10497,56 +10676,45 @@ var dragonBones;
         };
         BoneRotateTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.rotation = frameFloatArray[valueOffset++];
-                current.skew = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                        delta.rotation = dragonBones.Transform.normalizeRadian(frameFloatArray[valueOffset++] - current.rotation);
-                    }
-                    else {
-                        delta.rotation = frameFloatArray[valueOffset++] - current.rotation;
-                    }
-                    delta.skew = frameFloatArray[valueOffset++] - current.skew;
-                }
-                else {
-                    delta.rotation = 0.0;
-                    delta.skew = 0.0;
-                }
-            }
-            else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.rotation = 0.0;
-                current.skew = 0.0;
-                delta.rotation = 0.0;
-                delta.skew = 0.0;
+            if (this._isTween && this._frameIndex === this._frameCount - 1) {
+                this._differenceA = dragonBones.Transform.normalizeRadian(this._differenceA);
+                this._differenceB = dragonBones.Transform.normalizeRadian(this._differenceB);
             }
         };
-        BoneRotateTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            result.rotation = current.rotation + delta.rotation * this._tweenProgress;
-            result.skew = current.skew + delta.skew * this._tweenProgress;
+        BoneRotateTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
         };
         BoneRotateTimelineState.prototype.fadeOut = function () {
-            var result = this.bonePose.result;
-            result.rotation = dragonBones.Transform.normalizeRadian(result.rotation);
-            result.skew = dragonBones.Transform.normalizeRadian(result.skew);
+            this.dirty = false;
+            this._resultA = dragonBones.Transform.normalizeRadian(this._resultA);
+            this._resultB = dragonBones.Transform.normalizeRadian(this._resultB);
+        };
+        BoneRotateTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.rotation += this._resultA * blendWeight;
+                result.skew += this._resultB * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.rotation = this._resultA * blendWeight;
+                result.skew = this._resultB * blendWeight;
+            }
+            else {
+                result.rotation = this._resultA;
+                result.skew = this._resultB;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         };
         return BoneRotateTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneRotateTimelineState = BoneRotateTimelineState;
     /**
      * @internal
@@ -10561,48 +10729,40 @@ var dragonBones;
         };
         BoneScaleTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.scaleX = frameFloatArray[valueOffset++];
-                current.scaleY = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX;
-                    delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY;
-                }
-                else {
-                    delta.scaleX = 0.0;
-                    delta.scaleY = 0.0;
-                }
+            if (this._timelineData === null) { // Pose.
+                this._resultA = 1.0;
+                this._resultB = 1.0;
+            }
+        };
+        BoneScaleTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
+        };
+        BoneScaleTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.scaleX += (this._resultA - 1.0) * blendWeight;
+                result.scaleY += (this._resultB - 1.0) * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.scaleX = (this._resultA - 1.0) * blendWeight + 1.0;
+                result.scaleY = (this._resultB - 1.0) * blendWeight + 1.0;
             }
             else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.scaleX = 1.0;
-                current.scaleY = 1.0;
-                delta.scaleX = 0.0;
-                delta.scaleY = 0.0;
+                result.scaleX = this._resultA;
+                result.scaleY = this._resultB;
             }
-        };
-        BoneScaleTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
             }
-            result.scaleX = current.scaleX + delta.scaleX * this._tweenProgress;
-            result.scaleY = current.scaleY + delta.scaleY * this._tweenProgress;
         };
         return BoneScaleTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneScaleTimelineState = BoneScaleTimelineState;
     /**
      * @internal
@@ -10610,138 +10770,148 @@ var dragonBones;
     var SurfaceTimelineState = /** @class */ (function (_super) {
         __extends(SurfaceTimelineState, _super);
         function SurfaceTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._current = [];
-            _this._delta = [];
-            _this._result = [];
-            return _this;
+            return _super !== null && _super.apply(this, arguments) || this;
         }
         SurfaceTimelineState.toString = function () {
             return "[class dragonBones.SurfaceTimelineState]";
         };
         SurfaceTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.surface = null;
-            this._frameFloatOffset = 0;
-            this._valueCount = 0;
             this._deformCount = 0;
-            this._valueOffset = 0;
-            this._current.length = 0;
-            this._delta.length = 0;
-            this._result.length = 0;
+            this._deformOffset = 0;
+            this._sameValueOffset = 0;
         };
-        SurfaceTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
+        SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * this._valueCount;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                if (this._tweenState === 2 /* Always */) {
-                    var nextValueOffset = valueOffset + this._valueCount;
-                    if (this._frameIndex === this._frameCount - 1) {
-                        nextValueOffset = this._animationData.frameFloatOffset + this._frameValueOffset;
+                var dragonBonesData = this._animationData.parent.parent;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
+                this._valueOffset = this._animationData.frameFloatOffset;
+                this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
+                this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */];
+                this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
+                this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
+                this._valueScale = this._armature.armatureData.scale;
+                this._valueArray = dragonBonesData.frameFloatArray;
+                this._rd.length = this._valueCount * 2;
+            }
+            else {
+                this._deformCount = this.target.target._deformVertices.length;
+            }
+        };
+        SurfaceTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var surface = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = surface._deformVertices;
+            var valueArray = this._valueArray;
+            if (valueArray !== null) {
+                var valueCount = this._valueCount;
+                var deformOffset = this._deformOffset;
+                var sameValueOffset = this._sameValueOffset;
+                var rd = this._rd;
+                for (var i = 0; i < this._deformCount; ++i) {
+                    var value = 0.0;
+                    if (i < deformOffset) {
+                        value = valueArray[sameValueOffset + i];
+                    }
+                    else if (i < deformOffset + valueCount) {
+                        value = rd[i - deformOffset];
                     }
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._delta[i] = frameFloatArray[nextValueOffset + i] * scale - (this._current[i] = frameFloatArray[valueOffset + i] * scale);
+                    else {
+                        value = valueArray[sameValueOffset + i - valueCount];
                     }
-                }
-                else {
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._current[i] = frameFloatArray[valueOffset + i] * scale;
+                    if (blendState.dirty > 1) {
+                        result[i] += value * blendWeight;
+                    }
+                    else {
+                        result[i] = value * blendWeight;
                     }
                 }
             }
-            else {
-                for (var i = 0; i < this._valueCount; ++i) {
-                    this._current[i] = 0.0;
+            else if (blendState.dirty === 1) {
+                for (var i = 0; i < this._deformCount; ++i) {
+                    result[i] = 0.0;
                 }
             }
-        };
-        SurfaceTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            this.surface._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                surface._transformDirty = true;
             }
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._result[i] = this._current[i] + this._delta[i] * this._tweenProgress;
+        };
+        return SurfaceTimelineState;
+    }(dragonBones.MutilpleValueTimelineState));
+    dragonBones.SurfaceTimelineState = SurfaceTimelineState;
+    /**
+     * @internal
+     */
+    var AlphaTimelineState = /** @class */ (function (_super) {
+        __extends(AlphaTimelineState, _super);
+        function AlphaTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AlphaTimelineState.toString = function () {
+            return "[class dragonBones.AlphaTimelineState]";
+        };
+        AlphaTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData === null) { // Pose.
+                this._result = 1.0;
             }
         };
-        SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) {
+        AlphaTimelineState.prototype.init = function (armature, animationState, timelineData) {
             _super.prototype.init.call(this, armature, animationState, timelineData);
-            if (this._timelineData !== null) {
-                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
-                this._deformCount = this._frameIntArray[frameIntOffset + 1 /* DeformCount */];
-                this._valueCount = this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
-                this._valueOffset = this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
-                this._frameFloatOffset = this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
-            }
-            else {
-                this._deformCount = this.surface._deformVertices.length;
-                this._valueCount = this._deformCount;
-                this._valueOffset = 0;
-                this._frameFloatOffset = 0;
-            }
-            this._current.length = this._valueCount;
-            this._delta.length = this._valueCount;
-            this._result.length = this._valueCount;
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._delta[i] = 0.0;
-            }
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.01;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
-        SurfaceTimelineState.prototype.blend = function (state) {
-            var blendWeight = this.surface._blendState.blendWeight;
-            var result = this.surface._deformVertices;
-            for (var i = 0; i < this._deformCount; ++i) {
-                var value = 0.0;
-                if (i < this._valueOffset) {
-                    value = this._frameFloatArray[this._frameFloatOffset + i];
-                }
-                else if (i < this._valueOffset + this._valueCount) {
-                    value = this._result[i - this._valueOffset];
-                }
-                else {
-                    value = this._frameFloatArray[this._frameFloatOffset + i - this._valueCount];
-                }
-                if (state === 2) {
-                    result[i] += value * blendWeight;
-                }
-                else if (blendWeight !== 1.0) {
-                    result[i] = value * blendWeight;
-                }
-                else {
-                    result[i] = value;
+        AlphaTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var alphaTarget = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            if (blendState.dirty > 1) {
+                alphaTarget._alpha += this._result * blendWeight;
+                if (alphaTarget._alpha > 1.0) {
+                    alphaTarget._alpha = 1.0;
                 }
             }
-            if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                this.surface._transformDirty = true;
+            else {
+                alphaTarget._alpha = this._result * blendWeight;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                this._armature._alphaDirty = true;
             }
         };
-        return SurfaceTimelineState;
-    }(dragonBones.TweenTimelineState));
-    dragonBones.SurfaceTimelineState = SurfaceTimelineState;
+        return AlphaTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AlphaTimelineState = AlphaTimelineState;
     /**
      * @internal
      */
-    var SlotDislayTimelineState = /** @class */ (function (_super) {
-        __extends(SlotDislayTimelineState, _super);
-        function SlotDislayTimelineState() {
+    var SlotDisplayTimelineState = /** @class */ (function (_super) {
+        __extends(SlotDisplayTimelineState, _super);
+        function SlotDisplayTimelineState() {
             return _super !== null && _super.apply(this, arguments) || this;
         }
-        SlotDislayTimelineState.toString = function () {
-            return "[class dragonBones.SlotDislayTimelineState]";
+        SlotDisplayTimelineState.toString = function () {
+            return "[class dragonBones.SlotDisplayTimelineState]";
         };
-        SlotDislayTimelineState.prototype._onArriveAtFrame = function () {
+        SlotDisplayTimelineState.prototype._onArriveAtFrame = function () {
             if (this.playState >= 0) {
-                var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : this.slot._slotData.displayIndex;
-                if (this.slot.displayIndex !== displayIndex) {
-                    this.slot._setDisplayIndex(displayIndex, true);
+                var slot = this.target;
+                var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : slot._slotData.displayIndex;
+                if (slot.displayIndex !== displayIndex) {
+                    slot._setDisplayIndex(displayIndex, true);
                 }
             }
         };
-        return SlotDislayTimelineState;
-    }(dragonBones.SlotTimelineState));
-    dragonBones.SlotDislayTimelineState = SlotDislayTimelineState;
+        SlotDisplayTimelineState.prototype._onUpdateFrame = function () {
+        };
+        return SlotDisplayTimelineState;
+    }(dragonBones.TimelineState));
+    dragonBones.SlotDisplayTimelineState = SlotDisplayTimelineState;
     /**
      * @internal
      */
@@ -10750,91 +10920,97 @@ var dragonBones;
         function SlotColorTimelineState() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
             _this._current = [0, 0, 0, 0, 0, 0, 0, 0];
-            _this._delta = [0, 0, 0, 0, 0, 0, 0, 0];
+            _this._difference = [0, 0, 0, 0, 0, 0, 0, 0];
             _this._result = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
             return _this;
         }
         SlotColorTimelineState.toString = function () {
             return "[class dragonBones.SlotColorTimelineState]";
         };
-        SlotColorTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this._dirty = false;
-        };
         SlotColorTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
             if (this._timelineData !== null) {
-                var intArray = this._dragonBonesData.intArray;
-                var frameIntArray = this._frameIntArray;
-                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 1; // ...(timeline value offset)|x|x|(Value offset)|(Next offset)|x|x|...
+                var dragonBonesData = this._animationData.parent.parent;
+                var colorArray = dragonBonesData.colorArray;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex;
                 var colorOffset = frameIntArray[valueOffset];
                 if (colorOffset < 0) {
-                    colorOffset += 65536; // Fixed out of bouds bug. 
-                }
-                this._current[0] = intArray[colorOffset++];
-                this._current[1] = intArray[colorOffset++];
-                this._current[2] = intArray[colorOffset++];
-                this._current[3] = intArray[colorOffset++];
-                this._current[4] = intArray[colorOffset++];
-                this._current[5] = intArray[colorOffset++];
-                this._current[6] = intArray[colorOffset++];
-                this._current[7] = intArray[colorOffset++];
-                if (this._tweenState === 2 /* Always */) {
+                    colorOffset += 65536; // Fixed out of bounds bug. 
+                }
+                if (this._isTween) {
+                    this._current[0] = colorArray[colorOffset++];
+                    this._current[1] = colorArray[colorOffset++];
+                    this._current[2] = colorArray[colorOffset++];
+                    this._current[3] = colorArray[colorOffset++];
+                    this._current[4] = colorArray[colorOffset++];
+                    this._current[5] = colorArray[colorOffset++];
+                    this._current[6] = colorArray[colorOffset++];
+                    this._current[7] = colorArray[colorOffset++];
                     if (this._frameIndex === this._frameCount - 1) {
                         colorOffset = frameIntArray[this._animationData.frameIntOffset + this._frameValueOffset];
                     }
                     else {
-                        colorOffset = frameIntArray[valueOffset + 1 * 1];
+                        colorOffset = frameIntArray[valueOffset + 1];
                     }
                     if (colorOffset < 0) {
-                        colorOffset += 65536; // Fixed out of bouds bug. 
+                        colorOffset += 65536; // Fixed out of bounds bug. 
                     }
-                    this._delta[0] = intArray[colorOffset++] - this._current[0];
-                    this._delta[1] = intArray[colorOffset++] - this._current[1];
-                    this._delta[2] = intArray[colorOffset++] - this._current[2];
-                    this._delta[3] = intArray[colorOffset++] - this._current[3];
-                    this._delta[4] = intArray[colorOffset++] - this._current[4];
-                    this._delta[5] = intArray[colorOffset++] - this._current[5];
-                    this._delta[6] = intArray[colorOffset++] - this._current[6];
-                    this._delta[7] = intArray[colorOffset++] - this._current[7];
+                    this._difference[0] = colorArray[colorOffset++] - this._current[0];
+                    this._difference[1] = colorArray[colorOffset++] - this._current[1];
+                    this._difference[2] = colorArray[colorOffset++] - this._current[2];
+                    this._difference[3] = colorArray[colorOffset++] - this._current[3];
+                    this._difference[4] = colorArray[colorOffset++] - this._current[4];
+                    this._difference[5] = colorArray[colorOffset++] - this._current[5];
+                    this._difference[6] = colorArray[colorOffset++] - this._current[6];
+                    this._difference[7] = colorArray[colorOffset++] - this._current[7];
                 }
-            }
-            else {
-                var color = this.slot._slotData.color;
-                this._current[0] = color.alphaMultiplier * 100.0;
-                this._current[1] = color.redMultiplier * 100.0;
-                this._current[2] = color.greenMultiplier * 100.0;
-                this._current[3] = color.blueMultiplier * 100.0;
-                this._current[4] = color.alphaOffset;
-                this._current[5] = color.redOffset;
-                this._current[6] = color.greenOffset;
-                this._current[7] = color.blueOffset;
+                else {
+                    this._result[0] = colorArray[colorOffset++] * 0.01;
+                    this._result[1] = colorArray[colorOffset++] * 0.01;
+                    this._result[2] = colorArray[colorOffset++] * 0.01;
+                    this._result[3] = colorArray[colorOffset++] * 0.01;
+                    this._result[4] = colorArray[colorOffset++];
+                    this._result[5] = colorArray[colorOffset++];
+                    this._result[6] = colorArray[colorOffset++];
+                    this._result[7] = colorArray[colorOffset++];
+                }
+            }
+            else { // Pose.
+                var slot = this.target;
+                var color = slot.slotData.color;
+                this._result[0] = color.alphaMultiplier;
+                this._result[1] = color.redMultiplier;
+                this._result[2] = color.greenMultiplier;
+                this._result[3] = color.blueMultiplier;
+                this._result[4] = color.alphaOffset;
+                this._result[5] = color.redOffset;
+                this._result[6] = color.greenOffset;
+                this._result[7] = color.blueOffset;
             }
         };
         SlotColorTimelineState.prototype._onUpdateFrame = function () {
             _super.prototype._onUpdateFrame.call(this);
-            this._dirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            this._result[0] = (this._current[0] + this._delta[0] * this._tweenProgress) * 0.01;
-            this._result[1] = (this._current[1] + this._delta[1] * this._tweenProgress) * 0.01;
-            this._result[2] = (this._current[2] + this._delta[2] * this._tweenProgress) * 0.01;
-            this._result[3] = (this._current[3] + this._delta[3] * this._tweenProgress) * 0.01;
-            this._result[4] = this._current[4] + this._delta[4] * this._tweenProgress;
-            this._result[5] = this._current[5] + this._delta[5] * this._tweenProgress;
-            this._result[6] = this._current[6] + this._delta[6] * this._tweenProgress;
-            this._result[7] = this._current[7] + this._delta[7] * this._tweenProgress;
+            if (this._isTween) {
+                this._result[0] = (this._current[0] + this._difference[0] * this._tweenProgress) * 0.01;
+                this._result[1] = (this._current[1] + this._difference[1] * this._tweenProgress) * 0.01;
+                this._result[2] = (this._current[2] + this._difference[2] * this._tweenProgress) * 0.01;
+                this._result[3] = (this._current[3] + this._difference[3] * this._tweenProgress) * 0.01;
+                this._result[4] = this._current[4] + this._difference[4] * this._tweenProgress;
+                this._result[5] = this._current[5] + this._difference[5] * this._tweenProgress;
+                this._result[6] = this._current[6] + this._difference[6] * this._tweenProgress;
+                this._result[7] = this._current[7] + this._difference[7] * this._tweenProgress;
+            }
         };
         SlotColorTimelineState.prototype.fadeOut = function () {
-            this._tweenState = 0 /* None */;
-            this._dirty = false;
+            this._isTween = false;
         };
         SlotColorTimelineState.prototype.update = function (passedTime) {
             _super.prototype.update.call(this, passedTime);
             // Fade animation.
-            if (this._tweenState !== 0 /* None */ || this._dirty) {
-                var result = this.slot._colorTransform;
+            if (this._isTween || this.dirty) {
+                var slot = this.target;
+                var result = slot._colorTransform;
                 if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
                     if (result.alphaMultiplier !== this._result[0] ||
                         result.redMultiplier !== this._result[1] ||
@@ -10853,11 +11029,11 @@ var dragonBones;
                         result.redOffset += (this._result[5] - result.redOffset) * fadeProgress;
                         result.greenOffset += (this._result[6] - result.greenOffset) * fadeProgress;
                         result.blueOffset += (this._result[7] - result.blueOffset) * fadeProgress;
-                        this.slot._colorDirty = true;
+                        slot._colorDirty = true;
                     }
                 }
-                else if (this._dirty) {
-                    this._dirty = false;
+                else if (this.dirty) {
+                    this.dirty = false;
                     if (result.alphaMultiplier !== this._result[0] ||
                         result.redMultiplier !== this._result[1] ||
                         result.greenMultiplier !== this._result[2] ||
@@ -10874,152 +11050,141 @@ var dragonBones;
                         result.redOffset = this._result[5];
                         result.greenOffset = this._result[6];
                         result.blueOffset = this._result[7];
-                        this.slot._colorDirty = true;
+                        slot._colorDirty = true;
                     }
                 }
             }
         };
         return SlotColorTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.TweenTimelineState));
     dragonBones.SlotColorTimelineState = SlotColorTimelineState;
+    /**
+     * @internal
+     */
+    var SlotZIndexTimelineState = /** @class */ (function (_super) {
+        __extends(SlotZIndexTimelineState, _super);
+        function SlotZIndexTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        SlotZIndexTimelineState.toString = function () {
+            return "[class dragonBones.SlotZIndexTimelineState]";
+        };
+        SlotZIndexTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData === null) { // Pose.
+                var blendState = this.target;
+                var slot = blendState.target;
+                this._result = slot.slotData.zIndex;
+            }
+        };
+        SlotZIndexTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        SlotZIndexTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var slot = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            if (blendState.dirty > 1) {
+                slot._zIndex += this._result * blendWeight;
+            }
+            else {
+                slot._zIndex = this._result * blendWeight;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                this._armature._zIndexDirty = true;
+            }
+        };
+        return SlotZIndexTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.SlotZIndexTimelineState = SlotZIndexTimelineState;
     /**
      * @internal
      */
     var DeformTimelineState = /** @class */ (function (_super) {
         __extends(DeformTimelineState, _super);
         function DeformTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._current = [];
-            _this._delta = [];
-            _this._result = [];
-            return _this;
+            return _super !== null && _super.apply(this, arguments) || this;
         }
         DeformTimelineState.toString = function () {
             return "[class dragonBones.DeformTimelineState]";
         };
         DeformTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.vertexOffset = 0;
-            this._dirty = false;
-            this._frameFloatOffset = 0;
-            this._valueCount = 0;
+            this.displayFrame = null;
             this._deformCount = 0;
-            this._valueOffset = 0;
-            this._current.length = 0;
-            this._delta.length = 0;
-            this._result.length = 0;
-        };
-        DeformTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * this._valueCount;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                if (this._tweenState === 2 /* Always */) {
-                    var nextValueOffset = valueOffset + this._valueCount;
-                    if (this._frameIndex === this._frameCount - 1) {
-                        nextValueOffset = this._animationData.frameFloatOffset + this._frameValueOffset;
-                    }
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._delta[i] = frameFloatArray[nextValueOffset + i] * scale - (this._current[i] = frameFloatArray[valueOffset + i] * scale);
-                    }
-                }
-                else {
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._current[i] = frameFloatArray[valueOffset + i] * scale;
-                    }
-                }
-            }
-            else {
-                for (var i = 0; i < this._valueCount; ++i) {
-                    this._current[i] = 0.0;
-                }
-            }
-        };
-        DeformTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            this._dirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._result[i] = this._current[i] + this._delta[i] * this._tweenProgress;
-            }
+            this._deformOffset = 0;
+            this._sameValueOffset = 0;
         };
         DeformTimelineState.prototype.init = function (armature, animationState, timelineData) {
             _super.prototype.init.call(this, armature, animationState, timelineData);
             if (this._timelineData !== null) {
                 var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
-                this.vertexOffset = this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */];
-                if (this.vertexOffset < 0) {
-                    this.vertexOffset += 65536; // Fixed out of bouds bug. 
-                }
-                this._deformCount = this._frameIntArray[frameIntOffset + 1 /* DeformCount */];
-                this._valueCount = this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
-                this._valueOffset = this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
-                this._frameFloatOffset = this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
+                var dragonBonesData = this._animationData.parent.parent;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                this._valueOffset = this._animationData.frameFloatOffset;
+                this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
+                this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */];
+                this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
+                this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */];
+                if (this._sameValueOffset < 0) {
+                    this._sameValueOffset += 65536; // Fixed out of bounds bug. 
+                }
+                this._sameValueOffset += this._animationData.frameFloatOffset;
+                this._valueScale = this._armature.armatureData.scale;
+                this._valueArray = dragonBonesData.frameFloatArray;
+                this._rd.length = this._valueCount * 2;
             }
             else {
-                var deformVertices = this.slot._deformVertices;
-                this._deformCount = deformVertices !== null ? deformVertices.vertices.length : 0;
-                this._valueCount = this._deformCount;
-                this._valueOffset = 0;
-                this._frameFloatOffset = 0;
-            }
-            this._current.length = this._valueCount;
-            this._delta.length = this._valueCount;
-            this._result.length = this._valueCount;
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._delta[i] = 0.0;
-            }
-        };
-        DeformTimelineState.prototype.fadeOut = function () {
-            this._tweenState = 0 /* None */;
-            this._dirty = false;
-        };
-        DeformTimelineState.prototype.update = function (passedTime) {
-            var deformVertices = this.slot._deformVertices;
-            if (deformVertices === null || deformVertices.verticesData === null || deformVertices.verticesData.offset !== this.vertexOffset) {
-                return;
-            }
-            _super.prototype.update.call(this, passedTime);
-            // Fade animation.
-            if (this._tweenState !== 0 /* None */ || this._dirty) {
-                var result = deformVertices.vertices;
-                if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                    var fadeProgress = Math.pow(this._animationState._fadeProgress, 2);
-                    for (var i = 0; i < this._deformCount; ++i) {
-                        if (i < this._valueOffset) {
-                            result[i] += (this._frameFloatArray[this._frameFloatOffset + i] - result[i]) * fadeProgress;
-                        }
-                        else if (i < this._valueOffset + this._valueCount) {
-                            result[i] += (this._result[i - this._valueOffset] - result[i]) * fadeProgress;
-                        }
-                        else {
-                            result[i] += (this._frameFloatArray[this._frameFloatOffset + i - this._valueCount] - result[i]) * fadeProgress;
-                        }
+                this._deformCount = this.displayFrame.deformVertices.length;
+            }
+        };
+        DeformTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var slot = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = this.displayFrame.deformVertices;
+            var valueArray = this._valueArray;
+            if (valueArray !== null) {
+                var valueCount = this._valueCount;
+                var deformOffset = this._deformOffset;
+                var sameValueOffset = this._sameValueOffset;
+                var rd = this._rd;
+                for (var i = 0; i < this._deformCount; ++i) {
+                    var value = 0.0;
+                    if (i < deformOffset) {
+                        value = valueArray[sameValueOffset + i];
+                    }
+                    else if (i < deformOffset + valueCount) {
+                        value = rd[i - deformOffset];
                     }
-                    deformVertices.verticesDirty = true;
-                }
-                else if (this._dirty) {
-                    this._dirty = false;
-                    for (var i = 0; i < this._deformCount; ++i) {
-                        if (i < this._valueOffset) {
-                            result[i] = this._frameFloatArray[this._frameFloatOffset + i];
-                        }
-                        else if (i < this._valueOffset + this._valueCount) {
-                            result[i] = this._result[i - this._valueOffset];
-                        }
-                        else {
-                            result[i] = this._frameFloatArray[this._frameFloatOffset + i - this._valueCount];
-                        }
+                    else {
+                        value = valueArray[sameValueOffset + i - valueCount];
+                    }
+                    if (blendState.dirty > 1) {
+                        result[i] += value * blendWeight;
                     }
-                    deformVertices.verticesDirty = true;
+                    else {
+                        result[i] = value * blendWeight;
+                    }
+                }
+            }
+            else if (blendState.dirty === 1) {
+                for (var i = 0; i < this._deformCount; ++i) {
+                    result[i] = 0.0;
+                }
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                if (slot._geometryData === this.displayFrame.getGeometryData()) {
+                    slot._verticesDirty = true;
                 }
             }
         };
         return DeformTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.MutilpleValueTimelineState));
     dragonBones.DeformTimelineState = DeformTimelineState;
     /**
      * @internal
@@ -11032,115 +11197,115 @@ var dragonBones;
         IKConstraintTimelineState.toString = function () {
             return "[class dragonBones.IKConstraintTimelineState]";
         };
-        IKConstraintTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this._current = 0.0;
-            this._delta = 0.0;
-        };
-        IKConstraintTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            var ikConstraint = this.constraint;
+        IKConstraintTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var ikConstraint = this.target;
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameIntArray = this._frameIntArray;
-                var bendPositive = frameIntArray[valueOffset++] !== 0;
-                this._current = frameIntArray[valueOffset++] * 0.01;
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameIntOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    this._delta = frameIntArray[valueOffset + 1] * 0.01 - this._current;
-                }
-                else {
-                    this._delta = 0.0;
-                }
-                ikConstraint._bendPositive = bendPositive;
+                ikConstraint._bendPositive = this._currentA > 0.0;
+                ikConstraint._weight = this._currentB;
             }
             else {
                 var ikConstraintData = ikConstraint._constraintData;
-                this._current = ikConstraintData.weight;
-                this._delta = 0.0;
                 ikConstraint._bendPositive = ikConstraintData.bendPositive;
+                ikConstraint._weight = ikConstraintData.weight;
             }
             ikConstraint.invalidUpdate();
+            this.dirty = false;
         };
-        IKConstraintTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            var ikConstraint = this.constraint;
-            ikConstraint._weight = this._current + this._delta * this._tweenProgress;
-            ikConstraint.invalidUpdate();
-            // TODO fade update.
+        IKConstraintTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.01;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
         return IKConstraintTimelineState;
-    }(dragonBones.ConstraintTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.IKConstraintTimelineState = IKConstraintTimelineState;
     /**
      * @internal
      */
-    var AnimationTimelineState = /** @class */ (function (_super) {
-        __extends(AnimationTimelineState, _super);
-        function AnimationTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._floats = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
-            return _this;
+    var AnimationProgressTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationProgressTimelineState, _super);
+        function AnimationProgressTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
         }
-        AnimationTimelineState.toString = function () {
-            return "[class dragonBones.AnimationTimelineState]";
-        };
-        AnimationTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this.animationState = null;
+        AnimationProgressTimelineState.toString = function () {
+            return "[class dragonBones.AnimationProgressTimelineState]";
         };
-        AnimationTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData === null) {
-                return;
-            }
-            var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 2;
-            var frameRateR = 1.0 / this.animationState._animationData.parent.frameRate;
-            var frameIntArray = this._frameIntArray;
-            this._floats[0] = frameIntArray[valueOffset++] * frameRateR;
-            this._floats[3] = frameIntArray[valueOffset++] * 0.01;
-            if (this._tweenState === 2 /* Always */) {
-                if (this._frameIndex === this._frameCount - 1) {
-                    valueOffset = this._animationData.frameIntOffset + this._frameValueOffset; // + 0 * 2
-                }
-                this._floats[1] = frameIntArray[valueOffset++] * frameRateR - this._floats[0];
-                this._floats[4] = frameIntArray[valueOffset++] * 0.01 - this._floats[3];
-            }
-            else {
-                this._floats[1] = 0.0;
-                this._floats[4] = 0.0;
+        AnimationProgressTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.currentTime = this._result * animationState.totalTime;
             }
+            this.dirty = false;
+        };
+        AnimationProgressTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
-        AnimationTimelineState.prototype._onUpdateFrame = function () {
+        return AnimationProgressTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AnimationProgressTimelineState = AnimationProgressTimelineState;
+    /**
+     * @internal
+     */
+    var AnimationWeightTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationWeightTimelineState, _super);
+        function AnimationWeightTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationWeightTimelineState.toString = function () {
+            return "[class dragonBones.AnimationWeightTimelineState]";
+        };
+        AnimationWeightTimelineState.prototype._onUpdateFrame = function () {
             _super.prototype._onUpdateFrame.call(this);
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.weight = this._result;
             }
-            if (this._floats[0] >= 0.0) {
-                this._floats[2] = this._floats[0] + this._floats[1] * this._tweenProgress;
-            }
-            this._floats[5] = this._floats[3] + this._floats[4] * this._tweenProgress;
+            this.dirty = false;
         };
-        AnimationTimelineState.prototype.blend = function (state) {
-            var animationState = this.animationState;
-            var blendWeight = animationState._blendState.blendWeight;
-            if (state === 2) {
-                animationState.weight += this._floats[5] * blendWeight;
-                animationState.currentTime += this._floats[2] * blendWeight;
-            }
-            else {
-                animationState.weight = this._floats[5] * blendWeight;
-                animationState.currentTime = this._floats[2] * blendWeight;
+        AnimationWeightTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        return AnimationWeightTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AnimationWeightTimelineState = AnimationWeightTimelineState;
+    /**
+     * @internal
+     */
+    var AnimationParametersTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationParametersTimelineState, _super);
+        function AnimationParametersTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationParametersTimelineState.toString = function () {
+            return "[class dragonBones.AnimationParametersTimelineState]";
+        };
+        AnimationParametersTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.parameterX = this._resultA;
+                animationState.parameterY = this._resultB;
             }
+            this.dirty = false;
         };
-        return AnimationTimelineState;
-    }(dragonBones.TweenTimelineState));
-    dragonBones.AnimationTimelineState = AnimationTimelineState;
+        AnimationParametersTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        return AnimationParametersTimelineState;
+    }(dragonBones.DoubleValueTimelineState));
+    dragonBones.AnimationParametersTimelineState = AnimationParametersTimelineState;
 })(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
@@ -11346,7 +11511,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var DataParser = /** @class */ (function () {
         function DataParser() {
@@ -11373,6 +11538,40 @@ var dragonBones;
                     return 0 /* Bone */;
             }
         };
+        DataParser._getPositionMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "percent":
+                    return 1 /* Percent */;
+                case "fixed":
+                    return 0 /* Fixed */;
+                default:
+                    return 1 /* Percent */;
+            }
+        };
+        DataParser._getSpacingMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "length":
+                    return 0 /* Length */;
+                case "percent":
+                    return 2 /* Percent */;
+                case "fixed":
+                    return 1 /* Fixed */;
+                default:
+                    return 0 /* Length */;
+            }
+        };
+        DataParser._getRotateMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "tangent":
+                    return 0 /* Tangent */;
+                case "chain":
+                    return 1 /* Chain */;
+                case "chainscale":
+                    return 2 /* ChainScale */;
+                default:
+                    return 0 /* Tangent */;
+            }
+        };
         DataParser._getDisplayType = function (value) {
             switch (value.toLowerCase()) {
                 case "image":
@@ -11401,18 +11600,6 @@ var dragonBones;
                     return 0 /* Rectangle */;
             }
         };
-        DataParser._getActionType = function (value) {
-            switch (value.toLowerCase()) {
-                case "play":
-                    return 0 /* Play */;
-                case "frame":
-                    return 10 /* Frame */;
-                case "sound":
-                    return 11 /* Sound */;
-                default:
-                    return 0 /* Play */;
-            }
-        };
         DataParser._getBlendMode = function (value) {
             switch (value.toLowerCase()) {
                 case "normal":
@@ -11447,93 +11634,27 @@ var dragonBones;
                     return 0 /* Normal */;
             }
         };
-        DataParser._getPositionMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "percent":
-                    return 1 /* Percent */;
-                case "fixed":
-                    return 0 /* Fixed */;
-                default:
-                    return 1 /* Percent */;
-            }
-        };
-        DataParser._getSpacingMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "length":
-                    return 0 /* Length */;
-                case "percent":
-                    return 2 /* Percent */;
-                case "fixed":
-                    return 1 /* Fixed */;
+        DataParser._getAnimationBlendType = function (value) {
+            switch (value.toLowerCase()) {
+                case "none":
+                    return 0 /* None */;
+                case "1d":
+                    return 1 /* E1D */;
                 default:
-                    return 0 /* Length */;
+                    return 0 /* None */;
             }
         };
-        DataParser._getRotateMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "tangent":
-                    return 0 /* Tangent */;
-                case "chain":
-                    return 1 /* Chain */;
-                case "chainscale":
-                    return 2 /* ChainScale */;
+        DataParser._getActionType = function (value) {
+            switch (value.toLowerCase()) {
+                case "play":
+                    return 0 /* Play */;
+                case "frame":
+                    return 10 /* Frame */;
+                case "sound":
+                    return 11 /* Sound */;
                 default:
-                    return 0 /* Tangent */;
-            }
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DataParser.parseDragonBonesData = function (rawData) {
-            console.warn("Deprecated.");
-            if (rawData instanceof ArrayBuffer) {
-                return dragonBones.BinaryDataParser.getInstance().parseDragonBonesData(rawData);
-            }
-            else {
-                return dragonBones.ObjectDataParser.getInstance().parseDragonBonesData(rawData);
-            }
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DataParser.parseTextureAtlasData = function (rawData, scale) {
-            if (scale === void 0) { scale = 1; }
-            console.warn("已废弃");
-            var textureAtlasData = {};
-            var subTextureList = rawData[DataParser.SUB_TEXTURE];
-            for (var i = 0, len = subTextureList.length; i < len; i++) {
-                var subTextureObject = subTextureList[i];
-                var subTextureName = subTextureObject[DataParser.NAME];
-                var subTextureRegion = new dragonBones.Rectangle();
-                var subTextureFrame = null;
-                subTextureRegion.x = subTextureObject[DataParser.X] / scale;
-                subTextureRegion.y = subTextureObject[DataParser.Y] / scale;
-                subTextureRegion.width = subTextureObject[DataParser.WIDTH] / scale;
-                subTextureRegion.height = subTextureObject[DataParser.HEIGHT] / scale;
-                if (DataParser.FRAME_WIDTH in subTextureObject) {
-                    subTextureFrame = new dragonBones.Rectangle();
-                    subTextureFrame.x = subTextureObject[DataParser.FRAME_X] / scale;
-                    subTextureFrame.y = subTextureObject[DataParser.FRAME_Y] / scale;
-                    subTextureFrame.width = subTextureObject[DataParser.FRAME_WIDTH] / scale;
-                    subTextureFrame.height = subTextureObject[DataParser.FRAME_HEIGHT] / scale;
-                }
-                textureAtlasData[subTextureName] = { region: subTextureRegion, frame: subTextureFrame, rotated: false };
+                    return 0 /* Play */;
             }
-            return textureAtlasData;
         };
         DataParser.DATA_VERSION_2_3 = "2.3";
         DataParser.DATA_VERSION_3_0 = "3.0";
@@ -11541,12 +11662,14 @@ var dragonBones;
         DataParser.DATA_VERSION_4_5 = "4.5";
         DataParser.DATA_VERSION_5_0 = "5.0";
         DataParser.DATA_VERSION_5_5 = "5.5";
-        DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_5;
+        DataParser.DATA_VERSION_5_6 = "5.6";
+        DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_6;
         DataParser.DATA_VERSIONS = [
             DataParser.DATA_VERSION_4_0,
             DataParser.DATA_VERSION_4_5,
             DataParser.DATA_VERSION_5_0,
-            DataParser.DATA_VERSION_5_5
+            DataParser.DATA_VERSION_5_5,
+            DataParser.DATA_VERSION_5_6
         ];
         DataParser.TEXTURE_ATLAS = "textureAtlas";
         DataParser.SUB_TEXTURE = "SubTexture";
@@ -11562,18 +11685,19 @@ var dragonBones;
         DataParser.DRADON_BONES = "dragonBones";
         DataParser.USER_DATA = "userData";
         DataParser.ARMATURE = "armature";
+        DataParser.CANVAS = "canvas";
         DataParser.BONE = "bone";
         DataParser.SURFACE = "surface";
         DataParser.SLOT = "slot";
         DataParser.CONSTRAINT = "constraint";
-        DataParser.IK = "ik";
-        DataParser.PATH_CONSTRAINT = "path";
         DataParser.SKIN = "skin";
         DataParser.DISPLAY = "display";
+        DataParser.FRAME = "frame";
+        DataParser.IK = "ik";
+        DataParser.PATH_CONSTRAINT = "path";
         DataParser.ANIMATION = "animation";
-        DataParser.Z_ORDER = "zOrder";
+        DataParser.TIMELINE = "timeline";
         DataParser.FFD = "ffd";
-        DataParser.FRAME = "frame";
         DataParser.TRANSLATE_FRAME = "translateFrame";
         DataParser.ROTATE_FRAME = "rotateFrame";
         DataParser.SCALE_FRAME = "scaleFrame";
@@ -11585,7 +11709,6 @@ var dragonBones;
         DataParser.INTS = "ints";
         DataParser.FLOATS = "floats";
         DataParser.STRINGS = "strings";
-        DataParser.CANVAS = "canvas";
         DataParser.TRANSFORM = "transform";
         DataParser.PIVOT = "pivot";
         DataParser.AABB = "aabb";
@@ -11603,6 +11726,8 @@ var dragonBones;
         DataParser.PATH = "path";
         DataParser.LENGTH = "length";
         DataParser.DISPLAY_INDEX = "displayIndex";
+        DataParser.Z_ORDER = "zOrder";
+        DataParser.Z_INDEX = "zIndex";
         DataParser.BLEND_MODE = "blendMode";
         DataParser.INHERIT_TRANSLATION = "inheritTranslation";
         DataParser.INHERIT_ROTATION = "inheritRotation";
@@ -11615,6 +11740,7 @@ var dragonBones;
         DataParser.BEND_POSITIVE = "bendPositive";
         DataParser.CHAIN = "chain";
         DataParser.WEIGHT = "weight";
+        DataParser.BLEND_TYPE = "blendType";
         DataParser.FADE_IN_TIME = "fadeInTime";
         DataParser.PLAY_TIMES = "playTimes";
         DataParser.SCALE = "scale";
@@ -11638,6 +11764,7 @@ var dragonBones;
         DataParser.VALUE = "value";
         DataParser.ROTATE = "rotate";
         DataParser.SKEW = "skew";
+        DataParser.ALPHA = "alpha";
         DataParser.ALPHA_OFFSET = "aO";
         DataParser.RED_OFFSET = "rO";
         DataParser.GREEN_OFFSET = "gO";
@@ -11652,8 +11779,6 @@ var dragonBones;
         DataParser.WEIGHTS = "weights";
         DataParser.SLOT_POSE = "slotPose";
         DataParser.BONE_POSE = "bonePose";
-        DataParser.GLUE_WEIGHTS = "glueWeights";
-        DataParser.GLUE_MESHES = "glueMeshes";
         DataParser.BONES = "bones";
         DataParser.POSITION_MODE = "positionMode";
         DataParser.SPACING_MODE = "spacingMode";
@@ -11698,7 +11823,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ObjectDataParser = /** @class */ (function (_super) {
         __extends(ObjectDataParser, _super);
@@ -11709,16 +11834,19 @@ var dragonBones;
             _this._data = null; //
             _this._armature = null; //
             _this._bone = null; //
-            _this._surface = null; //
+            _this._geometry = null; //
             _this._slot = null; //
             _this._skin = null; //
             _this._mesh = null; //
             _this._animation = null; //
             _this._timeline = null; //
             _this._rawTextureAtlases = null;
+            _this._frameValueType = 0 /* Step */;
             _this._defaultColorOffset = -1;
             _this._prevClockwise = 0;
             _this._prevRotation = 0.0;
+            _this._frameDefaultValue = 0.0;
+            _this._frameValueScale = 1.0;
             _this._helpMatrixA = new dragonBones.Matrix();
             _this._helpMatrixB = new dragonBones.Matrix();
             _this._helpTransform = new dragonBones.Transform();
@@ -11731,6 +11859,7 @@ var dragonBones;
             _this._frameFloatArray = [];
             _this._frameArray = [];
             _this._timelineArray = [];
+            _this._colorArray = [];
             _this._cacheRawMeshes = [];
             _this._cacheMeshes = [];
             _this._actionFrames = [];
@@ -11781,13 +11910,6 @@ var dragonBones;
                 var value = rawData[key];
                 var type = typeof value;
                 if (type === "string") {
-                    if (dragonBones.DragonBones.webAssembly) {
-                        for (var i = 0, l = value.length; i < l; ++i) {
-                            if (value.charCodeAt(i) > 255) {
-                                return encodeURI(value);
-                            }
-                        }
-                    }
                     return value;
                 }
                 return String(value);
@@ -11807,34 +11929,68 @@ var dragonBones;
         };
         ObjectDataParser.prototype._samplingEasingCurve = function (curve, samples) {
             var curveCount = curve.length;
-            var stepIndex = -2;
-            for (var i = 0, l = samples.length; i < l; ++i) {
-                var t = (i + 1) / (l + 1); // float
-                while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) {
-                    stepIndex += 6;
-                }
-                var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount;
-                var x1 = isInCurve ? curve[stepIndex] : 0.0;
-                var y1 = isInCurve ? curve[stepIndex + 1] : 0.0;
-                var x2 = curve[stepIndex + 2];
-                var y2 = curve[stepIndex + 3];
-                var x3 = curve[stepIndex + 4];
-                var y3 = curve[stepIndex + 5];
-                var x4 = isInCurve ? curve[stepIndex + 6] : 1.0;
-                var y4 = isInCurve ? curve[stepIndex + 7] : 1.0;
-                var lower = 0.0;
-                var higher = 1.0;
-                while (higher - lower > 0.0001) {
-                    var percentage = (higher + lower) * 0.5;
-                    this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
-                    if (t - this._helpPoint.x > 0.0) {
-                        lower = percentage;
+            if (curveCount % 3 === 1) {
+                var stepIndex = -2;
+                for (var i = 0, l = samples.length; i < l; ++i) {
+                    var t = (i + 1) / (l + 1); // float
+                    while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) { // stepIndex + 3 * 2
+                        stepIndex += 6;
+                    }
+                    var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount;
+                    var x1 = isInCurve ? curve[stepIndex] : 0.0;
+                    var y1 = isInCurve ? curve[stepIndex + 1] : 0.0;
+                    var x2 = curve[stepIndex + 2];
+                    var y2 = curve[stepIndex + 3];
+                    var x3 = curve[stepIndex + 4];
+                    var y3 = curve[stepIndex + 5];
+                    var x4 = isInCurve ? curve[stepIndex + 6] : 1.0;
+                    var y4 = isInCurve ? curve[stepIndex + 7] : 1.0;
+                    var lower = 0.0;
+                    var higher = 1.0;
+                    while (higher - lower > 0.0001) {
+                        var percentage = (higher + lower) * 0.5;
+                        this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
+                        if (t - this._helpPoint.x > 0.0) {
+                            lower = percentage;
+                        }
+                        else {
+                            higher = percentage;
+                        }
                     }
-                    else {
-                        higher = percentage;
+                    samples[i] = this._helpPoint.y;
+                }
+                return true;
+            }
+            else {
+                var stepIndex = 0;
+                for (var i = 0, l = samples.length; i < l; ++i) {
+                    var t = (i + 1) / (l + 1); // float
+                    while (curve[stepIndex + 6] < t) { // stepIndex + 3 * 2
+                        stepIndex += 6;
+                    }
+                    var x1 = curve[stepIndex];
+                    var y1 = curve[stepIndex + 1];
+                    var x2 = curve[stepIndex + 2];
+                    var y2 = curve[stepIndex + 3];
+                    var x3 = curve[stepIndex + 4];
+                    var y3 = curve[stepIndex + 5];
+                    var x4 = curve[stepIndex + 6];
+                    var y4 = curve[stepIndex + 7];
+                    var lower = 0.0;
+                    var higher = 1.0;
+                    while (higher - lower > 0.0001) {
+                        var percentage = (higher + lower) * 0.5;
+                        this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
+                        if (t - this._helpPoint.x > 0.0) {
+                            lower = percentage;
+                        }
+                        else {
+                            higher = percentage;
+                        }
                     }
+                    samples[i] = this._helpPoint.y;
                 }
-                samples[i] = this._helpPoint.y;
+                return false;
             }
         };
         ObjectDataParser.prototype._parseActionDataInFrame = function (rawData, frameStart, bone, slot) {
@@ -11855,7 +12011,7 @@ var dragonBones;
             }
         };
         ObjectDataParser.prototype._mergeActionFrame = function (rawData, frameStart, type, bone, slot) {
-            var actionOffset = dragonBones.DragonBones.webAssembly ? this._armature.actions.size() : this._armature.actions.length;
+            var actionOffset = this._armature.actions.length;
             var actions = this._parseActionData(rawData, type, bone, slot);
             var frameIndex = 0;
             var frame = null;
@@ -11863,13 +12019,13 @@ var dragonBones;
                 var action = actions_2[_i];
                 this._armature.addAction(action, false);
             }
-            if (this._actionFrames.length === 0) {
+            if (this._actionFrames.length === 0) { // First frame.
                 frame = new ActionFrame();
                 frame.frameStart = 0;
                 this._actionFrames.push(frame);
                 frame = null;
             }
-            for (var _a = 0, _b = this._actionFrames; _a < _b.length; _a++) {
+            for (var _a = 0, _b = this._actionFrames; _a < _b.length; _a++) { // Get same frame.
                 var eachFrame = _b[_a];
                 if (eachFrame.frameStart === frameStart) {
                     frame = eachFrame;
@@ -11880,12 +12036,12 @@ var dragonBones;
                 }
                 frameIndex++;
             }
-            if (frame === null) {
+            if (frame === null) { // Create and cache frame.
                 frame = new ActionFrame();
                 frame.frameStart = frameStart;
-                this._actionFrames.splice(frameIndex + 1, 0, frame);
+                this._actionFrames.splice(frameIndex, 0, frame);
             }
-            for (var i = 0; i < actions.length; ++i) {
+            for (var i = 0; i < actions.length; ++i) { // Cache action offsets.
                 frame.actions.push(actionOffset + i);
             }
         };
@@ -11900,7 +12056,7 @@ var dragonBones;
             else {
                 armature.type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Armature */);
             }
-            if (armature.frameRate === 0) {
+            if (armature.frameRate === 0) { // Data error.
                 armature.frameRate = 24;
             }
             this._armature = armature;
@@ -11933,12 +12089,12 @@ var dragonBones;
                     var rawBone = rawBones_1[_i];
                     var parentName = ObjectDataParser._getString(rawBone, dragonBones.DataParser.PARENT, "");
                     var bone = this._parseBone(rawBone);
-                    if (parentName.length > 0) {
+                    if (parentName.length > 0) { // Get bone parent.
                         var parent_1 = armature.getBone(parentName);
                         if (parent_1 !== null) {
                             bone.parent = parent_1;
                         }
-                        else {
+                        else { // Cache.
                             if (!(parentName in this._cacheBones)) {
                                 this._cacheBones[parentName] = [];
                             }
@@ -11992,21 +12148,14 @@ var dragonBones;
                     }
                 }
             }
-            for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) {
-                var rawMeshData = this._cacheRawMeshes[i];
-                if (!(dragonBones.DataParser.GLUE_WEIGHTS in rawMeshData) || !(dragonBones.DataParser.GLUE_MESHES in rawMeshData)) {
-                    continue;
-                }
-                this._parseMeshGlue(rawMeshData, this._cacheMeshes[i]);
-            }
-            for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) {
+            for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) { // Link mesh.
                 var rawData_1 = this._cacheRawMeshes[i];
                 var shareName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SHARE, "");
                 if (shareName.length === 0) {
                     continue;
                 }
                 var skinName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME);
-                if (skinName.length === 0) {
+                if (skinName.length === 0) { // 
                     skinName = dragonBones.DataParser.DEFAULT_NAME;
                 }
                 var shareMesh = armature.getMesh(skinName, "", shareName); // TODO slot;
@@ -12014,7 +12163,7 @@ var dragonBones;
                     continue; // Error.
                 }
                 var mesh = this._cacheMeshes[i];
-                mesh.vertices.shareFrom(shareMesh.vertices);
+                mesh.geometry.shareFrom(shareMesh.geometry);
             }
             if (dragonBones.DataParser.ANIMATION in rawData) {
                 var rawAnimations = rawData[dragonBones.DataParser.ANIMATION];
@@ -12029,7 +12178,7 @@ var dragonBones;
                 for (var _h = 0, actions_3 = actions; _h < actions_3.length; _h++) {
                     var action = actions_3[_h];
                     armature.addAction(action, true);
-                    if (action.type === 0 /* Play */) {
+                    if (action.type === 0 /* Play */) { // Set default animation from default action.
                         var animation = armature.getAnimation(action.name);
                         if (animation !== null) {
                             armature.defaultAnimation = animation;
@@ -12065,7 +12214,6 @@ var dragonBones;
         };
         ObjectDataParser.prototype._parseBone = function (rawData) {
             var type = 0 /* Bone */;
-            var scale = this._armature.scale;
             if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") {
                 type = dragonBones.DataParser._getBoneType(rawData[dragonBones.DataParser.TYPE]);
             }
@@ -12073,12 +12221,14 @@ var dragonBones;
                 type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Bone */);
             }
             if (type === 0 /* Bone */) {
+                var scale = this._armature.scale;
                 var bone = dragonBones.BaseObject.borrowObject(dragonBones.BoneData);
                 bone.inheritTranslation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_TRANSLATION, true);
                 bone.inheritRotation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_ROTATION, true);
                 bone.inheritScale = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_SCALE, true);
                 bone.inheritReflection = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_REFLECTION, true);
                 bone.length = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.LENGTH, 0) * scale;
+                bone.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
                 bone.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
                 if (dragonBones.DataParser.TRANSFORM in rawData) {
                     this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], bone.transform, scale);
@@ -12086,21 +12236,11 @@ var dragonBones;
                 return bone;
             }
             var surface = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceData);
+            surface.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
             surface.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             surface.segmentX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_X, 0);
             surface.segmentY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_Y, 0);
-            surface.vertices.length = (surface.segmentX + 1) * (surface.segmentY + 1) * 2;
-            if (dragonBones.DataParser.VERTICES in rawData) {
-                var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-                for (var i = 0, l = surface.vertices.length; i < l; ++i) {
-                    if (i < rawVertices.length) {
-                        surface.vertices[i] = rawVertices[i] * scale;
-                    }
-                    else {
-                        surface.vertices[i] = 0.0;
-                    }
-                }
-            }
+            this._parseGeometry(rawData, surface.geometry);
             return surface;
         };
         ObjectDataParser.prototype._parseIKConstraint = function (rawData) {
@@ -12112,6 +12252,7 @@ var dragonBones;
             if (target === null) {
                 return null;
             }
+            var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0);
             var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintData);
             constraint.scaleEnabled = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.SCALE, false);
             constraint.bendPositive = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true);
@@ -12119,7 +12260,6 @@ var dragonBones;
             constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             constraint.type = 0 /* IK */;
             constraint.target = target;
-            var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0);
             if (chain > 0 && bone.parent !== null) {
                 constraint.root = bone.parent;
                 constraint.bone = bone;
@@ -12179,6 +12319,8 @@ var dragonBones;
             var slot = dragonBones.BaseObject.borrowObject(dragonBones.SlotData);
             slot.displayIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0);
             slot.zOrder = zOrder;
+            slot.zIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Z_INDEX, 0);
+            slot.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
             slot.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             slot.parent = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.PARENT, "")); //
             if (dragonBones.DataParser.BLEND_MODE in rawData && typeof rawData[dragonBones.DataParser.BLEND_MODE] === "string") {
@@ -12245,13 +12387,14 @@ var dragonBones;
                 type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, type);
             }
             switch (type) {
-                case 0 /* Image */:
+                case 0 /* Image */: {
                     var imageDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ImageDisplayData);
                     imageDisplay.name = name;
                     imageDisplay.path = path.length > 0 ? path : name;
                     this._parsePivot(rawData, imageDisplay);
                     break;
-                case 1 /* Armature */:
+                }
+                case 1 /* Armature */: {
                     var armatureDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureDisplayData);
                     armatureDisplay.name = name;
                     armatureDisplay.path = path.length > 0 ? path : name;
@@ -12274,25 +12417,23 @@ var dragonBones;
                         }
                     }
                     break;
-                case 2 /* Mesh */:
+                }
+                case 2 /* Mesh */: {
                     var meshDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.MeshDisplayData);
-                    meshDisplay.vertices.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true);
+                    meshDisplay.geometry.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true);
                     meshDisplay.name = name;
                     meshDisplay.path = path.length > 0 ? path : name;
-                    meshDisplay.vertices.data = this._data;
                     if (dragonBones.DataParser.SHARE in rawData) {
+                        meshDisplay.geometry.data = this._data;
                         this._cacheRawMeshes.push(rawData);
                         this._cacheMeshes.push(meshDisplay);
                     }
                     else {
                         this._parseMesh(rawData, meshDisplay);
                     }
-                    if ((dragonBones.DataParser.GLUE_WEIGHTS in rawData) && (dragonBones.DataParser.GLUE_MESHES in rawData)) {
-                        this._cacheRawMeshes.push(rawData);
-                        this._cacheMeshes.push(meshDisplay);
-                    }
                     break;
-                case 3 /* BoundingBox */:
+                }
+                case 3 /* BoundingBox */: {
                     var boundingBox = this._parseBoundingBox(rawData);
                     if (boundingBox !== null) {
                         var boundingBoxDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.BoundingBoxDisplayData);
@@ -12301,20 +12442,21 @@ var dragonBones;
                         boundingBoxDisplay.boundingBox = boundingBox;
                     }
                     break;
-                case 4 /* Path */:
+                }
+                case 4 /* Path */: {
                     var rawCurveLengths = rawData[dragonBones.DataParser.LENGTHS];
                     var pathDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.PathDisplayData);
                     pathDisplay.closed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CLOSED, false);
                     pathDisplay.constantSpeed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CONSTANT_SPEED, false);
                     pathDisplay.name = name;
                     pathDisplay.path = path.length > 0 ? path : name;
-                    pathDisplay.vertices.data = this._data;
                     pathDisplay.curveLengths.length = rawCurveLengths.length;
                     for (var i = 0, l = rawCurveLengths.length; i < l; ++i) {
                         pathDisplay.curveLengths[i] = rawCurveLengths[i];
                     }
                     this._parsePath(rawData, pathDisplay);
                     break;
+                }
             }
             if (display !== null && dragonBones.DataParser.TRANSFORM in rawData) {
                 this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], display.transform, this._armature.scale);
@@ -12322,58 +12464,7 @@ var dragonBones;
             return display;
         };
         ObjectDataParser.prototype._parsePath = function (rawData, display) {
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var vertexCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VERTEX_COUNT, 0); // uint
-            var vertexOffset = this._floatArray.length;
-            var pathOffset = this._intArray.length;
-            display.vertices.offset = pathOffset;
-            this._intArray.length += 1 + 1;
-            this._intArray[pathOffset + 0 /* PathVertexCount */] = vertexCount;
-            this._intArray[pathOffset + 2 /* PathFloatOffset */] = vertexOffset;
-            if (!(dragonBones.DataParser.WEIGHTS in rawData)) {
-                this._floatArray.length += rawVertices.length;
-                for (var i = 0, l = rawVertices.length; i < l; ++i) {
-                    this._floatArray[vertexOffset + i] = rawVertices[i];
-                }
-            }
-            else {
-                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
-                var rawBones = rawData[dragonBones.DataParser.BONES];
-                var weightBoneCount = rawBones.length;
-                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
-                var weightOffset = this._intArray.length;
-                var floatOffset = this._floatArray.length;
-                var sortedBones = this._armature.sortedBones;
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                weight.count = weightCount;
-                weight.offset = weightOffset;
-                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
-                //
-                this._intArray[weightOffset + 0 /* WeigthBoneCount */] = weightBoneCount;
-                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
-                for (var i = 0; i < weightBoneCount; i++) {
-                    var rawBoneIndex = rawBones[i];
-                    var bone = this._rawBones[rawBoneIndex];
-                    weight.addBone(bone);
-                    this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
-                }
-                this._floatArray.length += weightCount * 3;
-                for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) {
-                    var boneCount = rawWeights[iW++];
-                    this._intArray[iB++] = boneCount;
-                    for (var j = 0; j < boneCount; j++) {
-                        var boneIndex = rawWeights[iW++];
-                        var boneWeight = rawWeights[iW++];
-                        var x = rawVertices[iV++];
-                        var y = rawVertices[iV++];
-                        this._intArray[iB++] = rawBones.indexOf(boneIndex);
-                        this._floatArray[iF++] = boneWeight;
-                        this._floatArray[iF++] = x;
-                        this._floatArray[iF++] = y;
-                    }
-                }
-                display.vertices.weight = weight;
-            }
+            this._parseGeometry(rawData, display.geometry);
         };
         ObjectDataParser.prototype._parsePivot = function (rawData, display) {
             if (dragonBones.DataParser.PIVOT in rawData) {
@@ -12387,93 +12478,15 @@ var dragonBones;
             }
         };
         ObjectDataParser.prototype._parseMesh = function (rawData, mesh) {
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var rawUVs = rawData[dragonBones.DataParser.UVS];
-            var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES];
-            var vertexCount = Math.floor(rawVertices.length / 2); // uint
-            var triangleCount = Math.floor(rawTriangles.length / 3); // uint
-            var vertexOffset = this._floatArray.length;
-            var uvOffset = vertexOffset + vertexCount * 2;
-            var meshOffset = this._intArray.length;
-            var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; // Cache pose data.
-            mesh.vertices.offset = meshOffset;
-            this._intArray.length += 1 + 1 + 1 + 1 + triangleCount * 3;
-            this._intArray[meshOffset + 0 /* MeshVertexCount */] = vertexCount;
-            this._intArray[meshOffset + 1 /* MeshTriangleCount */] = triangleCount;
-            this._intArray[meshOffset + 2 /* MeshFloatOffset */] = vertexOffset;
-            for (var i = 0, l = triangleCount * 3; i < l; ++i) {
-                this._intArray[meshOffset + 4 /* MeshVertexIndices */ + i] = rawTriangles[i];
-            }
-            this._floatArray.length += vertexCount * 2 + vertexCount * 2;
-            for (var i = 0, l = vertexCount * 2; i < l; ++i) {
-                this._floatArray[vertexOffset + i] = rawVertices[i];
-                this._floatArray[uvOffset + i] = rawUVs[i];
-            }
-            if (dragonBones.DataParser.WEIGHTS in rawData) {
-                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
+            this._parseGeometry(rawData, mesh.geometry);
+            if (dragonBones.DataParser.WEIGHTS in rawData) { // Cache pose data.
                 var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE];
                 var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE];
-                var sortedBones = this._armature.sortedBones;
-                var weightBoneIndices = new Array();
-                var weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint
-                var floatOffset = this._floatArray.length;
-                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
-                var weightOffset = this._intArray.length;
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                weight.count = weightCount;
-                weight.offset = weightOffset;
-                weightBoneIndices.length = weightBoneCount;
-                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
-                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
-                for (var i = 0; i < weightBoneCount; ++i) {
-                    var rawBoneIndex = rawBonePoses[i * 7]; // uint
-                    var bone = this._rawBones[rawBoneIndex];
-                    weight.addBone(bone);
-                    weightBoneIndices[i] = rawBoneIndex;
-                    this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
-                }
-                this._floatArray.length += weightCount * 3;
-                this._helpMatrixA.copyFromArray(rawSlotPose, 0);
-                for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) {
-                    var iD = i * 2;
-                    var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint
-                    var x = this._floatArray[vertexOffset + iD];
-                    var y = this._floatArray[vertexOffset + iD + 1];
-                    this._helpMatrixA.transformPoint(x, y, this._helpPoint);
-                    x = this._helpPoint.x;
-                    y = this._helpPoint.y;
-                    for (var j = 0; j < vertexBoneCount; ++j) {
-                        var rawBoneIndex = rawWeights[iW++]; // uint
-                        var boneIndex = weightBoneIndices.indexOf(rawBoneIndex);
-                        this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1);
-                        this._helpMatrixB.invert();
-                        this._helpMatrixB.transformPoint(x, y, this._helpPoint);
-                        this._intArray[iB++] = boneIndex;
-                        this._floatArray[iV++] = rawWeights[iW++];
-                        this._floatArray[iV++] = this._helpPoint.x;
-                        this._floatArray[iV++] = this._helpPoint.y;
-                    }
-                }
-                mesh.vertices.weight = weight;
+                var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name;
                 this._weightSlotPose[meshName] = rawSlotPose;
                 this._weightBonePoses[meshName] = rawBonePoses;
             }
         };
-        ObjectDataParser.prototype._parseMeshGlue = function (rawData, mesh) {
-            rawData;
-            mesh;
-            // const rawWeights = rawData[DataParser.GLUE_WEIGHTS] as Array;
-            // const rawMeshes = rawData[DataParser.GLUE_MESHES] as Array;
-            // mesh.glue = BaseObject.borrowObject(GlueData);
-            // mesh.glue.weights.length = rawWeights.length;
-            // for (let i = 0, l = rawWeights.length; i < l; ++i) {
-            //     mesh.glue.weights[i] = rawWeights[i];
-            // }
-            // for (let i = 0, l = rawMeshes.length; i < l; i += 3) {
-            //     const glueMesh = this._armature.getMesh(rawMeshes[i], rawMeshes[i + 1], rawMeshes[i + 2]);
-            //     mesh.glue.addMesh(glueMesh);
-            // }
-        };
         ObjectDataParser.prototype._parseBoundingBox = function (rawData) {
             var boundingBox = null;
             var type = 0 /* Rectangle */;
@@ -12509,23 +12522,12 @@ var dragonBones;
                 var scale = this._armature.scale;
                 var rawVertices = rawData[dragonBones.DataParser.VERTICES];
                 var vertices = polygonBoundingBox.vertices;
-                if (dragonBones.DragonBones.webAssembly) {
-                    vertices.resize(rawVertices.length, 0.0);
-                }
-                else {
-                    vertices.length = rawVertices.length;
-                }
+                vertices.length = rawVertices.length;
                 for (var i = 0, l = rawVertices.length; i < l; i += 2) {
                     var x = rawVertices[i] * scale;
                     var y = rawVertices[i + 1] * scale;
-                    if (dragonBones.DragonBones.webAssembly) {
-                        vertices.set(i, x);
-                        vertices.set(i + 1, y);
-                    }
-                    else {
-                        vertices[i] = x;
-                        vertices[i + 1] = y;
-                    }
+                    vertices[i] = x;
+                    vertices[i + 1] = y;
                     // AABB.
                     if (i === 0) {
                         polygonBoundingBox.x = x;
@@ -12558,7 +12560,8 @@ var dragonBones;
         };
         ObjectDataParser.prototype._parseAnimation = function (rawData) {
             var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData);
-            animation.frameCount = Math.max(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 1), 1);
+            animation.blendType = dragonBones.DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, ""));
+            animation.frameCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0);
             animation.playTimes = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1);
             animation.duration = animation.frameCount / this._armature.frameRate; // float
             animation.fadeInTime = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0);
@@ -12583,7 +12586,7 @@ var dragonBones;
                 }
             }
             if (dragonBones.DataParser.Z_ORDER in rawData) {
-                this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, false, false, 0, this._parseZOrderFrame);
+                this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, 0 /* Step */, 0, this._parseZOrderFrame);
             }
             if (dragonBones.DataParser.BONE in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.BONE];
@@ -12592,37 +12595,21 @@ var dragonBones;
                     this._parseBoneTimeline(rawTimeline);
                 }
             }
-            if (dragonBones.DataParser.SURFACE in rawData) {
-                var rawTimelines = rawData[dragonBones.DataParser.SURFACE];
+            if (dragonBones.DataParser.SLOT in rawData) {
+                var rawTimelines = rawData[dragonBones.DataParser.SLOT];
                 for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) {
                     var rawTimeline = rawTimelines_2[_a];
-                    var surfaceName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
-                    this._surface = this._armature.getBone(surfaceName);
-                    if (this._surface === null) {
-                        continue;
-                    }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 50 /* Surface */, false, true, 0, this._parseSurfaceFrame);
-                    if (timeline !== null) {
-                        this._animation.addSurfaceTimeline(this._surface, timeline);
-                    }
-                    this._surface = null; //
+                    this._parseSlotTimeline(rawTimeline);
                 }
             }
-            if (dragonBones.DataParser.SLOT in rawData) {
-                var rawTimelines = rawData[dragonBones.DataParser.SLOT];
+            if (dragonBones.DataParser.FFD in rawData) {
+                var rawTimelines = rawData[dragonBones.DataParser.FFD];
                 for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) {
                     var rawTimeline = rawTimelines_3[_b];
-                    this._parseSlotTimeline(rawTimeline);
-                }
-            }
-            if (dragonBones.DataParser.FFD in rawData) {
-                var rawTimelines = rawData[dragonBones.DataParser.FFD];
-                for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) {
-                    var rawTimeline = rawTimelines_4[_c];
                     var skinName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME);
                     var slotName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SLOT, "");
                     var displayName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
-                    if (skinName.length === 0) {
+                    if (skinName.length === 0) { //
                         skinName = dragonBones.DataParser.DEFAULT_NAME;
                     }
                     this._slot = this._armature.getSlot(slotName);
@@ -12630,9 +12617,9 @@ var dragonBones;
                     if (this._slot === null || this._mesh === null) {
                         continue;
                     }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, false, true, 0, this._parseSlotFFDFrame);
+                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, 2 /* Float */, 0, this._parseSlotDeformFrame);
                     if (timeline !== null) {
-                        this._animation.addSlotTimeline(this._slot, timeline);
+                        this._animation.addSlotTimeline(slotName, timeline);
                     }
                     this._slot = null; //
                     this._mesh = null; //
@@ -12640,38 +12627,184 @@ var dragonBones;
             }
             if (dragonBones.DataParser.IK in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.IK];
-                for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) {
-                    var rawTimeline = rawTimelines_5[_d];
+                for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) {
+                    var rawTimeline = rawTimelines_4[_c];
                     var constraintName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
                     var constraint = this._armature.getConstraint(constraintName);
                     if (constraint === null) {
                         continue;
                     }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, true, false, 2, this._parseIKConstraintFrame);
+                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, 1 /* Int */, 2, this._parseIKConstraintFrame);
                     if (timeline !== null) {
-                        this._animation.addConstraintTimeline(constraint, timeline);
+                        this._animation.addConstraintTimeline(constraintName, timeline);
                     }
                 }
             }
-            if (dragonBones.DataParser.ANIMATION in rawData) {
-                var rawTimelines = rawData[dragonBones.DataParser.ANIMATION];
-                for (var _e = 0, rawTimelines_6 = rawTimelines; _e < rawTimelines_6.length; _e++) {
-                    var rawTimeline = rawTimelines_6[_e];
-                    var animationName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 40 /* AnimationTime */, true, false, 2, this._parseAnimationFrame);
+            if (this._actionFrames.length > 0) {
+                this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, 0 /* Step */, 0, this._parseActionFrame);
+                this._actionFrames.length = 0;
+            }
+            if (dragonBones.DataParser.TIMELINE in rawData) {
+                var rawTimelines = rawData[dragonBones.DataParser.TIMELINE];
+                for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) {
+                    var rawTimeline = rawTimelines_5[_d];
+                    var timelineType = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */);
+                    var timelineName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
+                    var timeline = null;
+                    switch (timelineType) {
+                        case 0 /* Action */:
+                            // TODO
+                            break;
+                        case 20 /* SlotDisplay */: // TODO
+                        case 23 /* SlotZIndex */:
+                        case 60 /* BoneAlpha */:
+                        case 24 /* SlotAlpha */:
+                        case 40 /* AnimationProgress */:
+                        case 41 /* AnimationWeight */:
+                            if (timelineType === 20 /* SlotDisplay */) {
+                                this._frameValueType = 0 /* Step */;
+                                this._frameValueScale = 1.0;
+                            }
+                            else {
+                                this._frameValueType = 1 /* Int */;
+                                if (timelineType === 23 /* SlotZIndex */) {
+                                    this._frameValueScale = 1.0;
+                                }
+                                else if (timelineType === 40 /* AnimationProgress */ ||
+                                    timelineType === 41 /* AnimationWeight */) {
+                                    this._frameValueScale = 10000.0;
+                                }
+                                else {
+                                    this._frameValueScale = 100.0;
+                                }
+                            }
+                            if (timelineType === 60 /* BoneAlpha */ ||
+                                timelineType === 24 /* SlotAlpha */ ||
+                                timelineType === 41 /* AnimationWeight */) {
+                                this._frameDefaultValue = 1.0;
+                            }
+                            else {
+                                this._frameDefaultValue = 0.0;
+                            }
+                            if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) {
+                                timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData);
+                                var animaitonTimeline = timeline;
+                                animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0);
+                                animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0);
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 1, this._parseSingleValueFrame, timeline);
+                            break;
+                        case 11 /* BoneTranslate */:
+                        case 12 /* BoneRotate */:
+                        case 13 /* BoneScale */:
+                        case 30 /* IKConstraint */:
+                        case 42 /* AnimationParameter */:
+                            if (timelineType === 30 /* IKConstraint */ ||
+                                timelineType === 42 /* AnimationParameter */) {
+                                this._frameValueType = 1 /* Int */;
+                                if (timelineType === 42 /* AnimationParameter */) {
+                                    this._frameValueScale = 10000.0;
+                                }
+                                else {
+                                    this._frameValueScale = 100.0;
+                                }
+                            }
+                            else {
+                                if (timelineType === 12 /* BoneRotate */) {
+                                    this._frameValueScale = dragonBones.Transform.DEG_RAD;
+                                }
+                                else {
+                                    this._frameValueScale = 1.0;
+                                }
+                                this._frameValueType = 2 /* Float */;
+                            }
+                            if (timelineType === 13 /* BoneScale */ ||
+                                timelineType === 30 /* IKConstraint */) {
+                                this._frameDefaultValue = 1.0;
+                            }
+                            else {
+                                this._frameDefaultValue = 0.0;
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 2, this._parseDoubleValueFrame);
+                            break;
+                        case 1 /* ZOrder */:
+                            // TODO
+                            break;
+                        case 50 /* Surface */: {
+                            var surface = this._armature.getBone(timelineName);
+                            if (surface === null) {
+                                continue;
+                            }
+                            this._geometry = surface.geometry;
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame);
+                            this._geometry = null; //
+                            break;
+                        }
+                        case 22 /* SlotDeform */: {
+                            this._geometry = null; //
+                            for (var skinName in this._armature.skins) {
+                                var skin = this._armature.skins[skinName];
+                                for (var slontName in skin.displays) {
+                                    var displays = skin.displays[slontName];
+                                    for (var _e = 0, displays_1 = displays; _e < displays_1.length; _e++) {
+                                        var display = displays_1[_e];
+                                        if (display !== null && display.name === timelineName) {
+                                            this._geometry = display.geometry;
+                                            break;
+                                        }
+                                    }
+                                }
+                            }
+                            if (this._geometry === null) {
+                                continue;
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame);
+                            this._geometry = null; //
+                            break;
+                        }
+                        case 21 /* SlotColor */:
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 1 /* Int */, 1, this._parseSlotColorFrame);
+                            break;
+                    }
                     if (timeline !== null) {
-                        this._animation.addAnimationTimeline(animationName, timeline);
+                        switch (timelineType) {
+                            case 0 /* Action */:
+                                // TODO
+                                break;
+                            case 1 /* ZOrder */:
+                                // TODO
+                                break;
+                            case 11 /* BoneTranslate */:
+                            case 12 /* BoneRotate */:
+                            case 13 /* BoneScale */:
+                            case 50 /* Surface */:
+                            case 60 /* BoneAlpha */:
+                                this._animation.addBoneTimeline(timelineName, timeline);
+                                break;
+                            case 20 /* SlotDisplay */:
+                            case 21 /* SlotColor */:
+                            case 22 /* SlotDeform */:
+                            case 23 /* SlotZIndex */:
+                            case 24 /* SlotAlpha */:
+                                this._animation.addSlotTimeline(timelineName, timeline);
+                                break;
+                            case 30 /* IKConstraint */:
+                                this._animation.addConstraintTimeline(timelineName, timeline);
+                                break;
+                            case 40 /* AnimationProgress */:
+                            case 41 /* AnimationWeight */:
+                            case 42 /* AnimationParameter */:
+                                this._animation.addAnimationTimeline(timelineName, timeline);
+                                break;
+                        }
                     }
                 }
             }
-            if (this._actionFrames.length > 0) {
-                this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, false, false, 0, this._parseActionFrame);
-                this._actionFrames.length = 0;
-            }
             this._animation = null; //
             return animation;
         };
-        ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, type, addIntOffset, addFloatOffset, frameValueCount, frameParser) {
+        ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, timelineType, frameValueType, frameValueCount, frameParser, timeline) {
+            if (timeline === void 0) { timeline = null; }
             if (rawData !== null && framesKey.length > 0 && framesKey in rawData) {
                 rawFrames = rawData[framesKey];
             }
@@ -12684,8 +12817,14 @@ var dragonBones;
             }
             var frameIntArrayLength = this._frameIntArray.length;
             var frameFloatArrayLength = this._frameFloatArray.length;
-            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
             var timelineOffset = this._timelineArray.length;
+            if (timeline === null) {
+                timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
+            }
+            timeline.type = timelineType;
+            timeline.offset = timelineOffset;
+            this._frameValueType = frameValueType;
+            this._timeline = timeline;
             this._timelineArray.length += 1 + 1 + 1 + 1 + 1 + keyFrameCount;
             if (rawData !== null) {
                 this._timelineArray[timelineOffset + 0 /* TimelineScale */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0) * 100);
@@ -12697,34 +12836,26 @@ var dragonBones;
             }
             this._timelineArray[timelineOffset + 2 /* TimelineKeyFrameCount */] = keyFrameCount;
             this._timelineArray[timelineOffset + 3 /* TimelineFrameValueCount */] = frameValueCount;
-            if (addIntOffset) {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset;
-            }
-            else if (addFloatOffset) {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset;
-            }
-            else {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0;
+            switch (this._frameValueType) {
+                case 0 /* Step */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0;
+                    break;
+                case 1 /* Int */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset;
+                    break;
+                case 2 /* Float */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset;
+                    break;
             }
-            this._timeline = timeline;
-            timeline.type = type;
-            timeline.offset = timelineOffset;
-            if (keyFrameCount === 1) {
+            if (keyFrameCount === 1) { // Only one frame.
                 timeline.frameIndicesOffset = -1;
                 this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + 0] = frameParser.call(this, rawFrames[0], 0, 0) - this._animation.frameOffset;
             }
             else {
                 var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation.
                 var frameIndices = this._data.frameIndices;
-                var frameIndicesOffset = 0;
-                if (dragonBones.DragonBones.webAssembly) {
-                    frameIndicesOffset = frameIndices.size();
-                    frameIndices.resize(frameIndicesOffset + totalFrameCount, 0);
-                }
-                else {
-                    frameIndicesOffset = frameIndices.length;
-                    frameIndices.length += totalFrameCount;
-                }
+                var frameIndicesOffset = frameIndices.length;
+                frameIndices.length += totalFrameCount;
                 timeline.frameIndicesOffset = frameIndicesOffset;
                 for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) {
                     if (frameStart + frameCount <= i && iK < keyFrameCount) {
@@ -12744,12 +12875,7 @@ var dragonBones;
                         this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + iK] = frameParser.call(this, rawFrame, frameStart, frameCount) - this._animation.frameOffset;
                         iK++;
                     }
-                    if (dragonBones.DragonBones.webAssembly) {
-                        frameIndices.set(frameIndicesOffset + i, iK - 1);
-                    }
-                    else {
-                        frameIndices[frameIndicesOffset + i] = iK - 1;
-                    }
+                    frameIndices[frameIndicesOffset + i] = iK - 1;
                 }
             }
             this._timeline = null; //
@@ -12763,27 +12889,33 @@ var dragonBones;
             this._bone = bone;
             this._slot = this._armature.getSlot(this._bone.name);
             if (dragonBones.DataParser.TRANSLATE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, false, true, 2, this._parseBoneTranslateFrame);
+                this._frameDefaultValue = 0.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, 2 /* Float */, 2, this._parseDoubleValueFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.ROTATE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, false, true, 2, this._parseBoneRotateFrame);
+                this._frameDefaultValue = 0.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, 2 /* Float */, 2, this._parseBoneRotateFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.SCALE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, false, true, 2, this._parseBoneScaleFrame);
+                this._frameDefaultValue = 1.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, 2 /* Float */, 2, this._parseBoneScaleFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, false, true, 6, this._parseBoneAllFrame);
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, 2 /* Float */, 6, this._parseBoneAllFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             this._bone = null; //
@@ -12794,27 +12926,26 @@ var dragonBones;
             if (slot === null) {
                 return;
             }
-            this._slot = slot;
-            // Display timeline.
             var displayTimeline = null;
+            var colorTimeline = null;
+            this._slot = slot;
             if (dragonBones.DataParser.DISPLAY_FRAME in rawData) {
-                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, false, false, 0, this._parseSlotDisplayFrame);
+                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame);
             }
             else {
-                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, false, false, 0, this._parseSlotDisplayFrame);
-            }
-            if (displayTimeline !== null) {
-                this._animation.addSlotTimeline(slot, displayTimeline);
+                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame);
             }
-            var colorTimeline = null;
             if (dragonBones.DataParser.COLOR_FRAME in rawData) {
-                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, true, false, 1, this._parseSlotColorFrame);
+                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame);
             }
             else {
-                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, true, false, 1, this._parseSlotColorFrame);
+                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame);
+            }
+            if (displayTimeline !== null) {
+                this._animation.addSlotTimeline(slot.name, displayTimeline);
             }
             if (colorTimeline !== null) {
-                this._animation.addSlotTimeline(slot, colorTimeline);
+                this._animation.addSlotTimeline(slot.name, colorTimeline);
             }
             this._slot = null; //
         };
@@ -12834,10 +12965,10 @@ var dragonBones;
                 if (dragonBones.DataParser.CURVE in rawData) {
                     var sampleCount = frameCount + 1;
                     this._helpArray.length = sampleCount;
-                    this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray);
+                    var isOmited = this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray);
                     this._frameArray.length += 1 + 1 + this._helpArray.length;
                     this._frameArray[frameOffset + 1 /* FrameTweenType */] = 2 /* Curve */;
-                    this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = sampleCount;
+                    this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = isOmited ? sampleCount : -sampleCount;
                     for (var i = 0; i < sampleCount; ++i) {
                         this._frameArray[frameOffset + 3 /* FrameCurveSamples */ + i] = Math.round(this._helpArray[i] * 10000.0);
                     }
@@ -12879,6 +13010,61 @@ var dragonBones;
             }
             return frameOffset;
         };
+        ObjectDataParser.prototype._parseSingleValueFrame = function (rawData, frameStart, frameCount) {
+            var frameOffset = 0;
+            switch (this._frameValueType) {
+                case 0: {
+                    frameOffset = this._parseFrame(rawData, frameStart, frameCount);
+                    this._frameArray.length += 1;
+                    this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue);
+                    break;
+                }
+                case 1: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameIntArray.length;
+                    this._frameIntArray.length += 1;
+                    this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale);
+                    break;
+                }
+                case 2: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameFloatArray.length;
+                    this._frameFloatArray.length += 1;
+                    this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale;
+                    break;
+                }
+            }
+            return frameOffset;
+        };
+        ObjectDataParser.prototype._parseDoubleValueFrame = function (rawData, frameStart, frameCount) {
+            var frameOffset = 0;
+            switch (this._frameValueType) {
+                case 0: {
+                    frameOffset = this._parseFrame(rawData, frameStart, frameCount);
+                    this._frameArray.length += 2;
+                    this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue);
+                    this._frameArray[frameOffset + 2] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue);
+                    break;
+                }
+                case 1: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameIntArray.length;
+                    this._frameIntArray.length += 2;
+                    this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale);
+                    this._frameIntArray[frameValueOffset + 1] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale);
+                    break;
+                }
+                case 2: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameFloatArray.length;
+                    this._frameFloatArray.length += 2;
+                    this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale;
+                    this._frameFloatArray[frameValueOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale;
+                    break;
+                }
+            }
+            return frameOffset;
+        };
         ObjectDataParser.prototype._parseActionFrame = function (frame, frameStart, frameCount) {
             // tslint:disable-next-line:no-unused-expression
             frameCount;
@@ -12887,7 +13073,7 @@ var dragonBones;
             this._frameArray.length += 1 + 1 + actionCount;
             this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart;
             this._frameArray[frameOffset + 0 /* FramePosition */ + 1] = actionCount; // Action count.
-            for (var i = 0; i < actionCount; ++i) {
+            for (var i = 0; i < actionCount; ++i) { // Action offsets.
                 this._frameArray[frameOffset + 0 /* FramePosition */ + 2 + i] = frame.actions[i];
             }
             return frameOffset;
@@ -13011,43 +13197,6 @@ var dragonBones;
             this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0);
             return frameOffset;
         };
-        ObjectDataParser.prototype._parseSurfaceFrame = function (rawData, frameStart, frameCount) {
-            var frameFloatOffset = this._frameFloatArray.length;
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
-            var vertexCount = this._surface.vertices.length / 2; // uint
-            var x = 0.0;
-            var y = 0.0;
-            this._frameFloatArray.length += vertexCount * 2;
-            for (var i = 0; i < vertexCount * 2; i += 2) {
-                if (i < offset || i - offset >= rawVertices.length) {
-                    x = 0.0;
-                }
-                else {
-                    x = rawVertices[i - offset];
-                }
-                if (i + 1 < offset || i + 1 - offset >= rawVertices.length) {
-                    y = 0.0;
-                }
-                else {
-                    y = rawVertices[i + 1 - offset];
-                }
-                this._frameFloatArray[frameFloatOffset + i] = x;
-                this._frameFloatArray[frameFloatOffset + i + 1] = y;
-            }
-            if (frameStart === 0) {
-                var frameIntOffset = this._frameIntArray.length;
-                this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
-                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = 0; // 
-                this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
-                this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
-                this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
-                this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset;
-                this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset;
-            }
-            return frameOffset;
-        };
         ObjectDataParser.prototype._parseSlotDisplayFrame = function (rawData, frameStart, frameCount) {
             var frameOffset = this._parseFrame(rawData, frameStart, frameCount);
             this._frameArray.length += 1;
@@ -13065,36 +13214,36 @@ var dragonBones;
             var colorOffset = -1;
             if (dragonBones.DataParser.VALUE in rawData || dragonBones.DataParser.COLOR in rawData) {
                 var rawColor = dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : rawData[dragonBones.DataParser.COLOR];
-                for (var k in rawColor) {
+                for (var k in rawColor) { // Detects the presence of color.
                     // tslint:disable-next-line:no-unused-expression
                     k;
                     this._parseColorTransform(rawColor, this._helpColorTransform);
-                    colorOffset = this._intArray.length;
-                    this._intArray.length += 8;
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset);
+                    colorOffset = this._colorArray.length;
+                    this._colorArray.length += 8;
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset);
                     colorOffset -= 8;
                     break;
                 }
             }
             if (colorOffset < 0) {
                 if (this._defaultColorOffset < 0) {
-                    this._defaultColorOffset = colorOffset = this._intArray.length;
-                    this._intArray.length += 8;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
+                    this._defaultColorOffset = colorOffset = this._colorArray.length;
+                    this._colorArray.length += 8;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
                 }
                 colorOffset = this._defaultColorOffset;
             }
@@ -13103,14 +13252,14 @@ var dragonBones;
             this._frameIntArray[frameIntOffset] = colorOffset;
             return frameOffset;
         };
-        ObjectDataParser.prototype._parseSlotFFDFrame = function (rawData, frameStart, frameCount) {
+        ObjectDataParser.prototype._parseSlotDeformFrame = function (rawData, frameStart, frameCount) {
             var frameFloatOffset = this._frameFloatArray.length;
             var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
             var rawVertices = dragonBones.DataParser.VERTICES in rawData ? rawData[dragonBones.DataParser.VERTICES] : null;
             var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
-            var vertexCount = this._intArray[this._mesh.vertices.offset + 0 /* MeshVertexCount */];
+            var vertexCount = this._intArray[this._mesh.geometry.offset + 0 /* GeometryVertexCount */];
             var meshName = this._mesh.parent.name + "_" + this._slot.name + "_" + this._mesh.name;
-            var weight = this._mesh.vertices.weight;
+            var weight = this._mesh.geometry.weight;
             var x = 0.0;
             var y = 0.0;
             var iB = 0;
@@ -13125,7 +13274,7 @@ var dragonBones;
                 this._frameFloatArray.length += vertexCount * 2;
             }
             for (var i = 0; i < vertexCount * 2; i += 2) {
-                if (rawVertices === null) {
+                if (rawVertices === null) { // Fill 0.
                     x = 0.0;
                     y = 0.0;
                 }
@@ -13143,7 +13292,7 @@ var dragonBones;
                         y = rawVertices[i + 1 - offset];
                     }
                 }
-                if (weight !== null) {
+                if (weight !== null) { // If mesh is skinned, transform point by bone bind pose.
                     var rawBonePoses = this._weightBonePoses[meshName];
                     var vertexBoneCount = this._intArray[iB++];
                     this._helpMatrixA.transformPoint(x, y, this._helpPoint, true);
@@ -13166,7 +13315,7 @@ var dragonBones;
             if (frameStart === 0) {
                 var frameIntOffset = this._frameIntArray.length;
                 this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
-                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.vertices.offset;
+                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.geometry.offset;
                 this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
                 this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
                 this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
@@ -13183,14 +13332,6 @@ var dragonBones;
             this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0);
             return frameOffset;
         };
-        ObjectDataParser.prototype._parseAnimationFrame = function (rawData, frameStart, frameCount) {
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var frameIntOffset = this._frameIntArray.length;
-            this._frameIntArray.length += 2;
-            this._frameIntArray[frameIntOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, 0);
-            this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0);
-            return frameOffset;
-        };
         ObjectDataParser.prototype._parseActionData = function (rawData, type, bone, slot) {
             var actions = new Array();
             if (typeof rawData === "string") {
@@ -13269,6 +13410,57 @@ var dragonBones;
             }
             return actions;
         };
+        ObjectDataParser.prototype._parseDeformFrame = function (rawData, frameStart, frameCount) {
+            var frameFloatOffset = this._frameFloatArray.length;
+            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+            var rawVertices = dragonBones.DataParser.VERTICES in rawData ?
+                rawData[dragonBones.DataParser.VERTICES] :
+                (dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : null);
+            var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
+            var vertexCount = this._intArray[this._geometry.offset + 0 /* GeometryVertexCount */];
+            var weight = this._geometry.weight;
+            var x = 0.0;
+            var y = 0.0;
+            if (weight !== null) {
+                // TODO
+            }
+            else {
+                this._frameFloatArray.length += vertexCount * 2;
+                for (var i = 0; i < vertexCount * 2; i += 2) {
+                    if (rawVertices !== null) {
+                        if (i < offset || i - offset >= rawVertices.length) {
+                            x = 0.0;
+                        }
+                        else {
+                            x = rawVertices[i - offset];
+                        }
+                        if (i + 1 < offset || i + 1 - offset >= rawVertices.length) {
+                            y = 0.0;
+                        }
+                        else {
+                            y = rawVertices[i + 1 - offset];
+                        }
+                    }
+                    else {
+                        x = 0.0;
+                        y = 0.0;
+                    }
+                    this._frameFloatArray[frameFloatOffset + i] = x;
+                    this._frameFloatArray[frameFloatOffset + i + 1] = y;
+                }
+            }
+            if (frameStart === 0) {
+                var frameIntOffset = this._frameIntArray.length;
+                this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
+                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._geometry.offset;
+                this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
+                this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
+                this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
+                this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset;
+                this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset;
+            }
+            return frameOffset;
+        };
         ObjectDataParser.prototype._parseTransform = function (rawData, transform, scale) {
             transform.x = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0) * scale;
             transform.y = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0) * scale;
@@ -13293,6 +13485,120 @@ var dragonBones;
             color.greenOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_OFFSET, 0);
             color.blueOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_OFFSET, 0);
         };
+        ObjectDataParser.prototype._parseGeometry = function (rawData, geometry) {
+            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
+            var vertexCount = Math.floor(rawVertices.length / 2); // uint
+            var triangleCount = 0;
+            var geometryOffset = this._intArray.length;
+            var verticesOffset = this._floatArray.length;
+            //
+            geometry.offset = geometryOffset;
+            geometry.data = this._data;
+            //
+            this._intArray.length += 1 + 1 + 1 + 1;
+            this._intArray[geometryOffset + 0 /* GeometryVertexCount */] = vertexCount;
+            this._intArray[geometryOffset + 2 /* GeometryFloatOffset */] = verticesOffset;
+            this._intArray[geometryOffset + 3 /* GeometryWeightOffset */] = -1; //
+            // 
+            this._floatArray.length += vertexCount * 2;
+            for (var i = 0, l = vertexCount * 2; i < l; ++i) {
+                this._floatArray[verticesOffset + i] = rawVertices[i];
+            }
+            if (dragonBones.DataParser.TRIANGLES in rawData) {
+                var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES];
+                triangleCount = Math.floor(rawTriangles.length / 3); // uint
+                //
+                this._intArray.length += triangleCount * 3;
+                for (var i = 0, l = triangleCount * 3; i < l; ++i) {
+                    this._intArray[geometryOffset + 4 /* GeometryVertexIndices */ + i] = rawTriangles[i];
+                }
+            }
+            // Fill triangle count.
+            this._intArray[geometryOffset + 1 /* GeometryTriangleCount */] = triangleCount;
+            if (dragonBones.DataParser.UVS in rawData) {
+                var rawUVs = rawData[dragonBones.DataParser.UVS];
+                var uvOffset = verticesOffset + vertexCount * 2;
+                this._floatArray.length += vertexCount * 2;
+                for (var i = 0, l = vertexCount * 2; i < l; ++i) {
+                    this._floatArray[uvOffset + i] = rawUVs[i];
+                }
+            }
+            if (dragonBones.DataParser.WEIGHTS in rawData) {
+                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
+                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
+                var weightOffset = this._intArray.length;
+                var floatOffset = this._floatArray.length;
+                var weightBoneCount = 0;
+                var sortedBones = this._armature.sortedBones;
+                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
+                weight.count = weightCount;
+                weight.offset = weightOffset;
+                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
+                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
+                if (dragonBones.DataParser.BONE_POSE in rawData) {
+                    var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE];
+                    var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE];
+                    var weightBoneIndices = new Array();
+                    weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint
+                    weightBoneIndices.length = weightBoneCount;
+                    for (var i = 0; i < weightBoneCount; ++i) {
+                        var rawBoneIndex = rawBonePoses[i * 7]; // uint
+                        var bone = this._rawBones[rawBoneIndex];
+                        weight.addBone(bone);
+                        weightBoneIndices[i] = rawBoneIndex;
+                        this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
+                    }
+                    this._floatArray.length += weightCount * 3;
+                    this._helpMatrixA.copyFromArray(rawSlotPose, 0);
+                    for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) {
+                        var iD = i * 2;
+                        var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint
+                        var x = this._floatArray[verticesOffset + iD];
+                        var y = this._floatArray[verticesOffset + iD + 1];
+                        this._helpMatrixA.transformPoint(x, y, this._helpPoint);
+                        x = this._helpPoint.x;
+                        y = this._helpPoint.y;
+                        for (var j = 0; j < vertexBoneCount; ++j) {
+                            var rawBoneIndex = rawWeights[iW++]; // uint
+                            var boneIndex = weightBoneIndices.indexOf(rawBoneIndex);
+                            this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1);
+                            this._helpMatrixB.invert();
+                            this._helpMatrixB.transformPoint(x, y, this._helpPoint);
+                            this._intArray[iB++] = boneIndex;
+                            this._floatArray[iV++] = rawWeights[iW++];
+                            this._floatArray[iV++] = this._helpPoint.x;
+                            this._floatArray[iV++] = this._helpPoint.y;
+                        }
+                    }
+                }
+                else {
+                    var rawBones = rawData[dragonBones.DataParser.BONES];
+                    weightBoneCount = rawBones.length;
+                    for (var i = 0; i < weightBoneCount; i++) {
+                        var rawBoneIndex = rawBones[i];
+                        var bone = this._rawBones[rawBoneIndex];
+                        weight.addBone(bone);
+                        this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
+                    }
+                    this._floatArray.length += weightCount * 3;
+                    for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) {
+                        var vertexBoneCount = rawWeights[iW++];
+                        this._intArray[iB++] = vertexBoneCount;
+                        for (var j = 0; j < vertexBoneCount; j++) {
+                            var boneIndex = rawWeights[iW++];
+                            var boneWeight = rawWeights[iW++];
+                            var x = rawVertices[iV++];
+                            var y = rawVertices[iV++];
+                            this._intArray[iB++] = rawBones.indexOf(boneIndex);
+                            this._floatArray[iF++] = boneWeight;
+                            this._floatArray[iF++] = x;
+                            this._floatArray[iF++] = y;
+                        }
+                    }
+                }
+                geometry.weight = weight;
+            }
+        };
         ObjectDataParser.prototype._parseArray = function (rawData) {
             // tslint:disable-next-line:no-unused-expression
             rawData;
@@ -13302,6 +13608,7 @@ var dragonBones;
             this._frameFloatArray.length = 0;
             this._frameArray.length = 0;
             this._timelineArray.length = 0;
+            this._colorArray.length = 0;
         };
         ObjectDataParser.prototype._modifyArray = function () {
             // Align.
@@ -13317,76 +13624,55 @@ var dragonBones;
             if ((this._timelineArray.length % Uint16Array.BYTES_PER_ELEMENT) !== 0) {
                 this._timelineArray.push(0);
             }
+            if ((this._timelineArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) {
+                this._colorArray.push(0);
+            }
             var l1 = this._intArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l2 = this._floatArray.length * Float32Array.BYTES_PER_ELEMENT;
             var l3 = this._frameIntArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l4 = this._frameFloatArray.length * Float32Array.BYTES_PER_ELEMENT;
             var l5 = this._frameArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l6 = this._timelineArray.length * Uint16Array.BYTES_PER_ELEMENT;
-            var lTotal = l1 + l2 + l3 + l4 + l5 + l6;
-            if (dragonBones.DragonBones.webAssembly) {
-                var shareBuffer = dragonBones.webAssemblyModule.HEAP16.buffer;
-                var bufferPointer = dragonBones.webAssemblyModule._malloc(lTotal);
-                var intArray = new Int16Array(shareBuffer, bufferPointer, this._intArray.length);
-                var floatArray = new Float32Array(shareBuffer, bufferPointer + l1, this._floatArray.length);
-                var frameIntArray = new Int16Array(shareBuffer, bufferPointer + l1 + l2, this._frameIntArray.length);
-                var frameFloatArray = new Float32Array(shareBuffer, bufferPointer + l1 + l2 + l3, this._frameFloatArray.length);
-                var frameArray = new Int16Array(shareBuffer, bufferPointer + l1 + l2 + l3 + l4, this._frameArray.length);
-                var timelineArray = new Uint16Array(shareBuffer, bufferPointer + l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
-                for (var i = 0, l = this._intArray.length; i < l; ++i) {
-                    intArray[i] = this._intArray[i];
-                }
-                for (var i = 0, l = this._floatArray.length; i < l; ++i) {
-                    floatArray[i] = this._floatArray[i];
-                }
-                for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
-                    frameIntArray[i] = this._frameIntArray[i];
-                }
-                for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
-                    frameFloatArray[i] = this._frameFloatArray[i];
-                }
-                for (var i = 0, l = this._frameArray.length; i < l; ++i) {
-                    frameArray[i] = this._frameArray[i];
-                }
-                for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
-                    timelineArray[i] = this._timelineArray[i];
-                }
-                dragonBones.webAssemblyModule.setDataBinary(this._data, bufferPointer, l1, l2, l3, l4, l5, l6);
-            }
-            else {
-                var binary = new ArrayBuffer(lTotal);
-                var intArray = new Int16Array(binary, 0, this._intArray.length);
-                var floatArray = new Float32Array(binary, l1, this._floatArray.length);
-                var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length);
-                var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length);
-                var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length);
-                var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
-                for (var i = 0, l = this._intArray.length; i < l; ++i) {
-                    intArray[i] = this._intArray[i];
-                }
-                for (var i = 0, l = this._floatArray.length; i < l; ++i) {
-                    floatArray[i] = this._floatArray[i];
-                }
-                for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
-                    frameIntArray[i] = this._frameIntArray[i];
-                }
-                for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
-                    frameFloatArray[i] = this._frameFloatArray[i];
-                }
-                for (var i = 0, l = this._frameArray.length; i < l; ++i) {
-                    frameArray[i] = this._frameArray[i];
-                }
-                for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
-                    timelineArray[i] = this._timelineArray[i];
-                }
-                this._data.binary = binary;
-                this._data.intArray = intArray;
-                this._data.floatArray = floatArray;
-                this._data.frameIntArray = frameIntArray;
-                this._data.frameFloatArray = frameFloatArray;
-                this._data.frameArray = frameArray;
-                this._data.timelineArray = timelineArray;
-            }
+            var l7 = this._colorArray.length * Int16Array.BYTES_PER_ELEMENT;
+            var lTotal = l1 + l2 + l3 + l4 + l5 + l6 + l7;
+            //
+            var binary = new ArrayBuffer(lTotal);
+            var intArray = new Int16Array(binary, 0, this._intArray.length);
+            var floatArray = new Float32Array(binary, l1, this._floatArray.length);
+            var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length);
+            var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length);
+            var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length);
+            var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
+            var colorArray = new Int16Array(binary, l1 + l2 + l3 + l4 + l5 + l6, this._colorArray.length);
+            for (var i = 0, l = this._intArray.length; i < l; ++i) {
+                intArray[i] = this._intArray[i];
+            }
+            for (var i = 0, l = this._floatArray.length; i < l; ++i) {
+                floatArray[i] = this._floatArray[i];
+            }
+            for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
+                frameIntArray[i] = this._frameIntArray[i];
+            }
+            for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
+                frameFloatArray[i] = this._frameFloatArray[i];
+            }
+            for (var i = 0, l = this._frameArray.length; i < l; ++i) {
+                frameArray[i] = this._frameArray[i];
+            }
+            for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
+                timelineArray[i] = this._timelineArray[i];
+            }
+            for (var i = 0, l = this._colorArray.length; i < l; ++i) {
+                colorArray[i] = this._colorArray[i];
+            }
+            this._data.binary = binary;
+            this._data.intArray = intArray;
+            this._data.floatArray = floatArray;
+            this._data.frameIntArray = frameIntArray;
+            this._data.frameFloatArray = frameFloatArray;
+            this._data.frameArray = frameArray;
+            this._data.timelineArray = timelineArray;
+            this._data.colorArray = colorArray;
             this._defaultColorOffset = -1;
         };
         ObjectDataParser.prototype.parseDragonBonesData = function (rawData, scale) {
@@ -13400,7 +13686,7 @@ var dragonBones;
                 data.version = version;
                 data.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
                 data.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, 24);
-                if (data.frameRate === 0) {
+                if (data.frameRate === 0) { // Data error.
                     data.frameRate = 24;
                 }
                 if (dragonBones.DataParser.ARMATURE in rawData) {
@@ -13411,7 +13697,7 @@ var dragonBones;
                         var rawArmature = rawArmatures_1[_i];
                         data.addArmature(this._parseArmature(rawArmature, scale));
                     }
-                    if (!this._data.binary) {
+                    if (!this._data.binary) { // DragonBones.webAssembly ? 0 : null;
                         this._modifyArray();
                     }
                     if (dragonBones.DataParser.STAGE in rawData) {
@@ -13459,6 +13745,8 @@ var dragonBones;
                 var rawTextures = rawData[dragonBones.DataParser.SUB_TEXTURE];
                 for (var i = 0, l = rawTextures.length; i < l; ++i) {
                     var rawTexture = rawTextures[i];
+                    var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0);
+                    var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0);
                     var textureData = textureAtlasData.createTexture();
                     textureData.rotated = ObjectDataParser._getBoolean(rawTexture, dragonBones.DataParser.ROTATED, false);
                     textureData.name = ObjectDataParser._getString(rawTexture, dragonBones.DataParser.NAME, "");
@@ -13466,8 +13754,6 @@ var dragonBones;
                     textureData.region.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.Y, 0.0);
                     textureData.region.width = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.WIDTH, 0.0);
                     textureData.region.height = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.HEIGHT, 0.0);
-                    var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0);
-                    var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0);
                     if (frameWidth > 0.0 && frameHeight > 0.0) {
                         textureData.frame = dragonBones.TextureData.createRectangle();
                         textureData.frame.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_X, 0.0);
@@ -13501,7 +13787,7 @@ var dragonBones;
     }(dragonBones.DataParser));
     dragonBones.ObjectDataParser = ObjectDataParser;
     /**
-     * @internal
+     * @private
      */
     var ActionFrame = /** @class */ (function () {
         function ActionFrame() {
@@ -13537,7 +13823,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var BinaryDataParser = /** @class */ (function (_super) {
         __extends(BinaryDataParser, _super);
@@ -13640,14 +13926,6 @@ var dragonBones;
             }
             return result;
         };
-        BinaryDataParser.prototype._getUTF16Key = function (value) {
-            for (var i = 0, l = value.length; i < l; ++i) {
-                if (value.charCodeAt(i) > 255) {
-                    return encodeURI(value);
-                }
-            }
-            return value;
-        };
         BinaryDataParser.prototype._parseBinaryTimeline = function (type, offset, timelineData) {
             if (timelineData === void 0) { timelineData = null; }
             var timeline = timelineData !== null ? timelineData : dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
@@ -13662,14 +13940,8 @@ var dragonBones;
                 var frameIndicesOffset = 0;
                 var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation.
                 var frameIndices = this._data.frameIndices;
-                if (dragonBones.DragonBones.webAssembly) {
-                    frameIndicesOffset = frameIndices.size();
-                    frameIndices.resize(frameIndicesOffset + totalFrameCount, 0);
-                }
-                else {
-                    frameIndicesOffset = frameIndices.length;
-                    frameIndices.length += totalFrameCount;
-                }
+                frameIndicesOffset = frameIndices.length;
+                frameIndices.length += totalFrameCount;
                 timeline.frameIndicesOffset = frameIndicesOffset;
                 for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) {
                     if (frameStart + frameCount <= i && iK < keyFrameCount) {
@@ -13682,49 +13954,16 @@ var dragonBones;
                         }
                         iK++;
                     }
-                    if (dragonBones.DragonBones.webAssembly) {
-                        frameIndices.set(frameIndicesOffset + i, iK - 1);
-                    }
-                    else {
-                        frameIndices[frameIndicesOffset + i] = iK - 1;
-                    }
+                    frameIndices[frameIndicesOffset + i] = iK - 1;
                 }
             }
             this._timeline = null; //
             return timeline;
         };
-        BinaryDataParser.prototype._parseVertices = function (rawData, vertices) {
-            vertices.offset = rawData[dragonBones.DataParser.OFFSET];
-            var weightOffset = this._intArrayBuffer[vertices.offset + 3 /* MeshWeightOffset */];
-            if (weightOffset >= 0) {
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                var vertexCount = this._intArrayBuffer[vertices.offset + 0 /* MeshVertexCount */];
-                var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */];
-                weight.offset = weightOffset;
-                for (var i = 0; i < boneCount; ++i) {
-                    var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i];
-                    weight.addBone(this._rawBones[boneIndex]);
-                }
-                var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount;
-                var weightCount = 0;
-                for (var i = 0, l = vertexCount; i < l; ++i) {
-                    var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++];
-                    weightCount += vertexBoneCount;
-                    boneIndicesOffset += vertexBoneCount;
-                }
-                weight.count = weightCount;
-                vertices.weight = weight;
-            }
-        };
-        BinaryDataParser.prototype._parseMesh = function (rawData, mesh) {
-            this._parseVertices(rawData, mesh.vertices);
-        };
-        BinaryDataParser.prototype._parsePath = function (rawData, path) {
-            this._parseVertices(rawData, path.vertices);
-        };
         BinaryDataParser.prototype._parseAnimation = function (rawData) {
             var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData);
-            animation.frameCount = Math.max(dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 1), 1);
+            animation.blendType = dragonBones.DataParser._getAnimationBlendType(dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, ""));
+            animation.frameCount = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0);
             animation.playTimes = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1);
             animation.duration = animation.frameCount / this._armature.frameRate; // float
             animation.fadeInTime = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0);
@@ -13749,9 +13988,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.BONE];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var bone = this._armature.getBone(k);
                     if (bone === null) {
                         continue;
@@ -13760,26 +13996,7 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addBoneTimeline(bone, timeline);
-                    }
-                }
-            }
-            if (dragonBones.DataParser.SURFACE in rawData) {
-                var rawTimeliness = rawData[dragonBones.DataParser.SURFACE];
-                for (var k in rawTimeliness) {
-                    var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
-                    var surface = this._armature.getBone(k);
-                    if (surface === null) {
-                        continue;
-                    }
-                    for (var i = 0, l = rawTimelines.length; i < l; i += 2) {
-                        var timelineType = rawTimelines[i];
-                        var timelineOffset = rawTimelines[i + 1];
-                        var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addSurfaceTimeline(surface, timeline);
+                        this._animation.addBoneTimeline(bone.name, timeline);
                     }
                 }
             }
@@ -13787,9 +14004,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.SLOT];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var slot = this._armature.getSlot(k);
                     if (slot === null) {
                         continue;
@@ -13798,7 +14012,7 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addSlotTimeline(slot, timeline);
+                        this._animation.addSlotTimeline(slot.name, timeline);
                     }
                 }
             }
@@ -13806,9 +14020,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.CONSTRAINT];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var constraint = this._armature.getConstraint(k);
                     if (constraint === null) {
                         continue;
@@ -13817,28 +14028,89 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addConstraintTimeline(constraint, timeline);
-                    }
-                }
-            }
-            if (dragonBones.DataParser.ANIMATION in rawData) {
-                var rawTimeliness = rawData[dragonBones.DataParser.ANIMATION];
-                for (var k in rawTimeliness) {
-                    var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
-                    for (var i = 0, l = rawTimelines.length; i < l; i += 2) {
-                        var timelineType = rawTimelines[i];
-                        var timelineOffset = rawTimelines[i + 1];
-                        var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addAnimationTimeline(k, timeline);
+                        this._animation.addConstraintTimeline(constraint.name, timeline);
+                    }
+                }
+            }
+            if (dragonBones.DataParser.TIMELINE in rawData) {
+                var rawTimelines = rawData[dragonBones.DataParser.TIMELINE];
+                for (var _i = 0, rawTimelines_6 = rawTimelines; _i < rawTimelines_6.length; _i++) {
+                    var rawTimeline = rawTimelines_6[_i];
+                    var timelineOffset = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.OFFSET, 0);
+                    if (timelineOffset >= 0) {
+                        var timelineType = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */);
+                        var timelineName = dragonBones.ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
+                        var timeline = null;
+                        if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) {
+                            timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData);
+                            var animaitonTimeline = timeline;
+                            animaitonTimeline.x = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0);
+                            animaitonTimeline.y = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0);
+                        }
+                        timeline = this._parseBinaryTimeline(timelineType, timelineOffset, timeline);
+                        switch (timelineType) {
+                            case 0 /* Action */:
+                                // TODO
+                                break;
+                            case 1 /* ZOrder */:
+                                // TODO
+                                break;
+                            case 11 /* BoneTranslate */:
+                            case 12 /* BoneRotate */:
+                            case 13 /* BoneScale */:
+                            case 50 /* Surface */:
+                            case 60 /* BoneAlpha */:
+                                this._animation.addBoneTimeline(timelineName, timeline);
+                                break;
+                            case 20 /* SlotDisplay */:
+                            case 21 /* SlotColor */:
+                            case 22 /* SlotDeform */:
+                            case 23 /* SlotZIndex */:
+                            case 24 /* SlotAlpha */:
+                                this._animation.addSlotTimeline(timelineName, timeline);
+                                break;
+                            case 30 /* IKConstraint */:
+                                this._animation.addConstraintTimeline(timelineName, timeline);
+                                break;
+                            case 40 /* AnimationProgress */:
+                            case 41 /* AnimationWeight */:
+                            case 42 /* AnimationParameter */:
+                                this._animation.addAnimationTimeline(timelineName, timeline);
+                                break;
+                        }
                     }
                 }
             }
             this._animation = null;
             return animation;
         };
+        BinaryDataParser.prototype._parseGeometry = function (rawData, geometry) {
+            geometry.offset = rawData[dragonBones.DataParser.OFFSET];
+            geometry.data = this._data;
+            var weightOffset = this._intArrayBuffer[geometry.offset + 3 /* GeometryWeightOffset */];
+            if (weightOffset < -1) { // -1 is a special flag that there is no bones weight.
+                weightOffset += 65536; // Fixed out of bounds bug. 
+            }
+            if (weightOffset >= 0) {
+                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
+                var vertexCount = this._intArrayBuffer[geometry.offset + 0 /* GeometryVertexCount */];
+                var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */];
+                weight.offset = weightOffset;
+                for (var i = 0; i < boneCount; ++i) {
+                    var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i];
+                    weight.addBone(this._rawBones[boneIndex]);
+                }
+                var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount;
+                var weightCount = 0;
+                for (var i = 0, l = vertexCount; i < l; ++i) {
+                    var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++];
+                    weightCount += vertexBoneCount;
+                    boneIndicesOffset += vertexBoneCount;
+                }
+                weight.count = weightCount;
+                geometry.weight = weight;
+            }
+        };
         BinaryDataParser.prototype._parseArray = function (rawData) {
             var offsets = rawData[dragonBones.DataParser.OFFSET];
             var l1 = offsets[1];
@@ -13847,37 +14119,22 @@ var dragonBones;
             var l4 = offsets[7];
             var l5 = offsets[9];
             var l6 = offsets[11];
+            var l7 = offsets.length > 12 ? offsets[13] : 0; // Color.
             var intArray = new Int16Array(this._binary, this._binaryOffset + offsets[0], l1 / Int16Array.BYTES_PER_ELEMENT);
             var floatArray = new Float32Array(this._binary, this._binaryOffset + offsets[2], l2 / Float32Array.BYTES_PER_ELEMENT);
             var frameIntArray = new Int16Array(this._binary, this._binaryOffset + offsets[4], l3 / Int16Array.BYTES_PER_ELEMENT);
             var frameFloatArray = new Float32Array(this._binary, this._binaryOffset + offsets[6], l4 / Float32Array.BYTES_PER_ELEMENT);
             var frameArray = new Int16Array(this._binary, this._binaryOffset + offsets[8], l5 / Int16Array.BYTES_PER_ELEMENT);
             var timelineArray = new Uint16Array(this._binary, this._binaryOffset + offsets[10], l6 / Uint16Array.BYTES_PER_ELEMENT);
-            if (dragonBones.DragonBones.webAssembly) {
-                var lTotal = l1 + l2 + l3 + l4 + l5 + l6;
-                var bufferPointer = dragonBones.webAssemblyModule._malloc(lTotal);
-                var rawArray = new Uint8Array(this._binary, this._binaryOffset, lTotal / Uint8Array.BYTES_PER_ELEMENT);
-                var copyArray = new Uint8Array(dragonBones.webAssemblyModule.HEAP16.buffer, bufferPointer, rawArray.length);
-                for (var i = 0, l = rawArray.length; i < l; ++i) {
-                    copyArray[i] = rawArray[i];
-                }
-                dragonBones.webAssemblyModule.setDataBinary(this._data, bufferPointer, l1, l2, l3, l4, l5, l6);
-                this._intArrayBuffer = intArray;
-                this._floatArrayBuffer = floatArray;
-                this._frameIntArrayBuffer = frameIntArray;
-                this._frameFloatArrayBuffer = frameFloatArray;
-                this._frameArrayBuffer = frameArray;
-                this._timelineArrayBuffer = timelineArray;
-            }
-            else {
-                this._data.binary = this._binary;
-                this._data.intArray = this._intArrayBuffer = intArray;
-                this._data.floatArray = this._floatArrayBuffer = floatArray;
-                this._data.frameIntArray = this._frameIntArrayBuffer = frameIntArray;
-                this._data.frameFloatArray = this._frameFloatArrayBuffer = frameFloatArray;
-                this._data.frameArray = this._frameArrayBuffer = frameArray;
-                this._data.timelineArray = this._timelineArrayBuffer = timelineArray;
-            }
+            var colorArray = l7 > 0 ? new Int16Array(this._binary, this._binaryOffset + offsets[12], l7 / Uint16Array.BYTES_PER_ELEMENT) : intArray; // Color.
+            this._data.binary = this._binary;
+            this._data.intArray = this._intArrayBuffer = intArray;
+            this._data.floatArray = floatArray;
+            this._data.frameIntArray = frameIntArray;
+            this._data.frameFloatArray = frameFloatArray;
+            this._data.frameArray = this._frameArrayBuffer = frameArray;
+            this._data.timelineArray = this._timelineArrayBuffer = timelineArray;
+            this._data.colorArray = colorArray;
         };
         BinaryDataParser.prototype.parseDragonBonesData = function (rawData, scale) {
             if (scale === void 0) { scale = 1; }
@@ -14008,7 +14265,7 @@ var dragonBones;
                     }
                 }
             }
-            if (this.autoSearch) {
+            if (this.autoSearch) { // Will be search all data, if the autoSearch is true.
                 for (var k in this._textureAtlasDataMap) {
                     for (var _b = 0, _c = this._textureAtlasDataMap[k]; _b < _c.length; _b++) {
                         var textureAtlasData = _c[_b];
@@ -14032,7 +14289,7 @@ var dragonBones;
                     armatureData = dragonBonesData.getArmature(armatureName);
                 }
             }
-            if (armatureData === null && (dragonBonesName.length === 0 || this.autoSearch)) {
+            if (armatureData === null && (dragonBonesName.length === 0 || this.autoSearch)) { // Will be search all data, if do not give a data name or the autoSearch is true.
                 for (var k in this._dragonBonesDataMap) {
                     dragonBonesData = this._dragonBonesDataMap[k];
                     if (dragonBonesName.length === 0 || dragonBonesData.autoSearch) {
@@ -14101,20 +14358,23 @@ var dragonBones;
                 var slotData = _a[_i];
                 var displayDatas = slotData.name in skinSlots ? skinSlots[slotData.name] : null;
                 var slot = this._buildSlot(dataPackage, slotData, armature);
-                slot.rawDisplayDatas = displayDatas;
                 if (displayDatas !== null) {
-                    var displayList = new Array();
-                    // for (const displayData of displays) 
-                    for (var i = 0, l = dragonBones.DragonBones.webAssembly ? displayDatas.size() : displayDatas.length; i < l; ++i) {
-                        var displayData = dragonBones.DragonBones.webAssembly ? displayDatas.get(i) : displayDatas[i];
+                    slot.displayFrameCount = displayDatas.length;
+                    for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                        var displayData = displayDatas[i];
+                        slot.replaceRawDisplayData(displayData, i);
                         if (displayData !== null) {
-                            displayList.push(this._getSlotDisplay(dataPackage, displayData, null, slot));
+                            if (dataPackage.textureAtlasName.length > 0) {
+                                var textureData = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
+                                slot.replaceTextureData(textureData, i);
+                            }
+                            var display = this._getSlotDisplay(dataPackage, displayData, slot);
+                            slot.replaceDisplay(display, i);
                         }
                         else {
-                            displayList.push(null);
+                            slot.replaceDisplay(null);
                         }
                     }
-                    slot._setDisplayList(displayList);
                 }
                 slot._setDisplayIndex(slotData.displayIndex, true);
             }
@@ -14143,12 +14403,10 @@ var dragonBones;
                 }
             }
         };
-        BaseFactory.prototype._buildChildArmature = function (dataPackage, slot, displayData) {
-            // tslint:disable-next-line:no-unused-expression
-            slot;
+        BaseFactory.prototype._buildChildArmature = function (dataPackage, _slot, displayData) {
             return this.buildArmature(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage !== null ? dataPackage.textureAtlasName : "");
         };
-        BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, rawDisplayData, slot) {
+        BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, slot) {
             var dataName = dataPackage !== null ? dataPackage.dataName : displayData.parent.parent.parent.name;
             var display = null;
             switch (displayData.type) {
@@ -14157,15 +14415,7 @@ var dragonBones;
                     if (imageDisplayData.texture === null) {
                         imageDisplayData.texture = this._getTextureData(dataName, displayData.path);
                     }
-                    else if (dataPackage !== null && dataPackage.textureAtlasName.length > 0) {
-                        imageDisplayData.texture = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
-                    }
-                    if (rawDisplayData !== null && rawDisplayData.type === 2 /* Mesh */ && this._isSupportMesh()) {
-                        display = slot.meshDisplay;
-                    }
-                    else {
-                        display = slot.rawDisplay;
-                    }
+                    display = slot.rawDisplay;
                     break;
                 }
                 case 2 /* Mesh */: {
@@ -14173,9 +14423,6 @@ var dragonBones;
                     if (meshDisplayData.texture === null) {
                         meshDisplayData.texture = this._getTextureData(dataName, meshDisplayData.path);
                     }
-                    else if (dataPackage !== null && dataPackage.textureAtlasName.length > 0) {
-                        meshDisplayData.texture = this._getTextureData(dataPackage.textureAtlasName, meshDisplayData.path);
-                    }
                     if (this._isSupportMesh()) {
                         display = slot.meshDisplay;
                     }
@@ -14186,7 +14433,7 @@ var dragonBones;
                 }
                 case 1 /* Armature */: {
                     var armatureDisplayData = displayData;
-                    var childArmature = this._buildChildArmature(dataPackage, slot, displayData);
+                    var childArmature = this._buildChildArmature(dataPackage, slot, armatureDisplayData);
                     if (childArmature !== null) {
                         childArmature.inheritAnimation = armatureDisplayData.inheritAnimation;
                         if (!childArmature.inheritAnimation) {
@@ -14300,9 +14547,20 @@ var dragonBones;
             return textureAtlasData;
         };
         /**
-         * @private
+         * - Update texture atlases.
+         * @param textureAtlases - The texture atlas objects.
+         * @param name - The texture atlas name.
+         * @version DragonBones 5.7
+         * @language en_US
+         */
+        /**
+         * - 更新贴图集对象。
+         * @param textureAtlases - 多个贴图集对象。
+         * @param name - 贴图集名称。
+         * @version DragonBones 5.7
+         * @language zh_CN
          */
-        BaseFactory.prototype.updateTextureAtlasData = function (name, textureAtlases) {
+        BaseFactory.prototype.updateTextureAtlases = function (textureAtlases, name) {
             var textureAtlasDatas = this.getTextureAtlasData(name);
             if (textureAtlasDatas !== null) {
                 for (var i = 0, l = textureAtlasDatas.length; i < l; ++i) {
@@ -14608,36 +14866,20 @@ var dragonBones;
                 displayIndex = 0;
             }
             slot.replaceDisplayData(displayData, displayIndex);
-            var displayList = slot.displayList; // Copy.
-            if (displayList.length <= displayIndex) {
-                displayList.length = displayIndex + 1;
-                for (var i = 0, l = displayList.length; i < l; ++i) {
-                    if (!displayList[i]) {
-                        displayList[i] = null;
-                    }
-                }
-            }
             if (displayData !== null) {
-                var rawDisplayDatas = slot.rawDisplayDatas;
-                var rawDisplayData = null;
-                if (rawDisplayDatas) {
-                    if (dragonBones.DragonBones.webAssembly) {
-                        if (displayIndex < rawDisplayDatas.size()) {
-                            rawDisplayData = rawDisplayDatas.get(displayIndex);
-                        }
-                    }
-                    else {
-                        if (displayIndex < rawDisplayDatas.length) {
-                            rawDisplayData = rawDisplayDatas[displayIndex];
-                        }
+                var display = this._getSlotDisplay(null, displayData, slot);
+                if (displayData.type === 0 /* Image */) {
+                    var rawDisplayData = slot.getDisplayFrameAt(displayIndex).rawDisplayData;
+                    if (rawDisplayData !== null &&
+                        rawDisplayData.type === 2 /* Mesh */) {
+                        display = slot.meshDisplay;
                     }
                 }
-                displayList[displayIndex] = this._getSlotDisplay(null, displayData, rawDisplayData, slot);
+                slot.replaceDisplay(display, displayIndex);
             }
             else {
-                displayList[displayIndex] = null;
+                slot.replaceDisplay(null, displayIndex);
             }
-            slot.displayList = displayList;
         };
         /**
          * - Replaces the current display data for a particular slot with a specific display data.
@@ -14676,13 +14918,10 @@ var dragonBones;
         BaseFactory.prototype.replaceSlotDisplay = function (dragonBonesName, armatureName, slotName, displayName, slot, displayIndex) {
             if (displayIndex === void 0) { displayIndex = -1; }
             var armatureData = this.getArmatureData(armatureName, dragonBonesName || "");
-            if (!armatureData || !armatureData.defaultSkin) {
+            if (armatureData === null || armatureData.defaultSkin === null) {
                 return false;
             }
             var displayData = armatureData.defaultSkin.getDisplay(slotName, displayName);
-            if (!displayData) {
-                return false;
-            }
             this.replaceDisplay(slot, displayData, displayIndex);
             return true;
         };
@@ -14694,15 +14933,14 @@ var dragonBones;
             if (!armatureData || !armatureData.defaultSkin) {
                 return false;
             }
-            var displays = armatureData.defaultSkin.getDisplays(slotName);
-            if (!displays) {
+            var displayDatas = armatureData.defaultSkin.getDisplays(slotName);
+            if (!displayDatas) {
                 return false;
             }
-            var displayIndex = 0;
-            // for (const displayData of displays) 
-            for (var i = 0, l = dragonBones.DragonBones.webAssembly ? displays.size() : displays.length; i < l; ++i) {
-                var displayData = dragonBones.DragonBones.webAssembly ? displays.get(i) : displays[i];
-                this.replaceDisplay(slot, displayData, displayIndex++);
+            slot.displayFrameCount = displayDatas.length;
+            for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                var displayData = displayDatas[i];
+                this.replaceDisplay(slot, displayData, i);
             }
             return true;
         };
@@ -14754,34 +14992,30 @@ var dragonBones;
                 if (exclude !== null && exclude.indexOf(slot.name) >= 0) {
                     continue;
                 }
-                var displays = skin.getDisplays(slot.name);
-                if (!displays) {
+                var displayDatas = skin.getDisplays(slot.name);
+                if (displayDatas === null) {
                     if (defaultSkin !== null && skin !== defaultSkin) {
-                        displays = defaultSkin.getDisplays(slot.name);
+                        displayDatas = defaultSkin.getDisplays(slot.name);
                     }
-                    if (!displays) {
+                    if (displayDatas === null) {
                         if (isOverride) {
-                            slot.rawDisplayDatas = null;
-                            slot.displayList = []; //
+                            slot.displayFrameCount = 0;
                         }
                         continue;
                     }
                 }
-                var displayCount = dragonBones.DragonBones.webAssembly ? displays.size() : displays.length;
-                var displayList = slot.displayList; // Copy.
-                displayList.length = displayCount; // Modify displayList length.
-                for (var i = 0, l = displayCount; i < l; ++i) {
-                    var displayData = dragonBones.DragonBones.webAssembly ? displays.get(i) : displays[i];
+                slot.displayFrameCount = displayDatas.length;
+                for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                    var displayData = displayDatas[i];
+                    slot.replaceRawDisplayData(displayData, i);
                     if (displayData !== null) {
-                        displayList[i] = this._getSlotDisplay(null, displayData, null, slot);
+                        slot.replaceDisplay(this._getSlotDisplay(null, displayData, slot), i);
                     }
                     else {
-                        displayList[i] = null;
+                        slot.replaceDisplay(null, i);
                     }
                 }
                 success = true;
-                slot.rawDisplayDatas = displays;
-                slot.displayList = displayList;
             }
             return success;
         };
@@ -14850,8 +15084,8 @@ var dragonBones;
                     var display = _c[_b];
                     if (display instanceof dragonBones.Armature) {
                         var displayDatas = skinData.getDisplays(slot.name);
-                        if (displayDatas !== null && index < (dragonBones.DragonBones.webAssembly ? displayDatas.size() : displayDatas.length)) {
-                            var displayData = dragonBones.DragonBones.webAssembly ? displayDatas.get(index) : displayDatas[index];
+                        if (displayDatas !== null && index < displayDatas.length) {
+                            var displayData = displayDatas[index];
                             if (displayData !== null && displayData.type === 1 /* Armature */) {
                                 var childArmatureData = this.getArmatureData(displayData.path, displayData.parent.parent.parent.name);
                                 if (childArmatureData) {
@@ -14904,49 +15138,13 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link #replaceSkin}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceSkin}。
-         * @deprecated
-         * @language zh_CN
-         */
-        BaseFactory.prototype.changeSkin = function (armature, skin, exclude) {
-            if (exclude === void 0) { exclude = null; }
-            return this.replaceSkin(armature, skin, false, exclude);
-        };
-        /**
-         * - Deprecated, please refer to {@link #replaceAnimation}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceAnimation}。
-         * @deprecated
-         * @language zh_CN
-         */
-        BaseFactory.prototype.copyAnimationsToArmature = function (toArmature, fromArmatreName, fromSkinName, fromDragonBonesDataName, replaceOriginalAnimation) {
-            if (fromSkinName === void 0) { fromSkinName = ""; }
-            if (fromDragonBonesDataName === void 0) { fromDragonBonesDataName = ""; }
-            if (replaceOriginalAnimation === void 0) { replaceOriginalAnimation = true; }
-            // tslint:disable-next-line:no-unused-expression
-            fromSkinName;
-            var armatureData = this.getArmatureData(fromArmatreName, fromDragonBonesDataName);
-            if (!armatureData) {
-                return false;
-            }
-            return this.replaceAnimation(toArmature, armatureData, replaceOriginalAnimation);
-        };
         BaseFactory._objectParser = null;
         BaseFactory._binaryParser = null;
         return BaseFactory;
     }());
     dragonBones.BaseFactory = BaseFactory;
     /**
-     * @internal
+     * @private
      */
     var BuildArmaturePackage = /** @class */ (function () {
         function BuildArmaturePackage() {
@@ -15066,38 +15264,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#removeTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#removeTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretTextureAtlasData.prototype.dispose = function () {
-            console.warn("已废弃。");
-            this.returnToPool();
-        };
-        Object.defineProperty(EgretTextureAtlasData.prototype, "texture", {
-            /**
-             * - Deprecated, please refer to {@link #renderTexture}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #renderTexture}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("已废弃。");
-                return this.renderTexture;
-            },
-            enumerable: true,
-            configurable: true
-        });
         return EgretTextureAtlasData;
     }(dragonBones.TextureAtlasData));
     dragonBones.EgretTextureAtlasData = EgretTextureAtlasData;
@@ -15184,333 +15350,53 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(EgretEvent.prototype, "animationName", {
-            /**
-             * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                var animationState = this.eventObject.animationState;
-                return animationState !== null ? animationState.name : "";
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(EgretEvent.prototype, "armature", {
-            /**
-             * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#armature}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#armature}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                return this.eventObject.armature;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(EgretEvent.prototype, "bone", {
-            /**
-             * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#bone}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#bone}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                return this.eventObject.bone;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(EgretEvent.prototype, "slot", {
-            /**
-             * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#slot}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#slot}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                return this.eventObject.slot;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(EgretEvent.prototype, "animationState", {
-            /**
-             * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                return this.eventObject.animationState;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(EgretEvent.prototype, "frameLabel", {
-            /**
-             * Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#name}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#name}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                return this.eventObject.name;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(EgretEvent.prototype, "sound", {
-            /**
-             * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#name}.
-             * @deprecated
-             * @language en_US
-             */
+        return EgretEvent;
+    }(egret.Event));
+    dragonBones.EgretEvent = EgretEvent;
+    /**
+     * @inheritDoc
+     */
+    var EgretArmatureDisplay = /** @class */ (function (_super) {
+        __extends(EgretArmatureDisplay, _super);
+        function EgretArmatureDisplay() {
+            var _this = _super !== null && _super.apply(this, arguments) || this;
             /**
-             * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#name}。
-             * @deprecated
-             * @language zh_CN
+             * @private
              */
-            get: function () {
-                return this.eventObject.name;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(EgretEvent.prototype, "movementID", {
+            _this.debugDraw = false;
             /**
-             * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.
-             * @deprecated
-             * @language en_US
+             * @internal
              */
+            _this._batchEnabled = !(global["nativeRender"] || global["bricks"]); //
             /**
-             * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。
-             * @deprecated
-             * @language zh_CN
+             * @internal
              */
-            get: function () {
-                return this.animationName;
-            },
-            enumerable: true,
-            configurable: true
-        });
+            _this._childDirty = true;
+            _this._debugDraw = false;
+            _this._armature = null; //
+            _this._bounds = null;
+            _this._debugDrawer = null;
+            return _this;
+        }
+        EgretArmatureDisplay._cleanBeforeRender = function () { };
         /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.START}.
-         * @deprecated
-         * @language en_US
+         * @inheritDoc
          */
+        EgretArmatureDisplay.prototype.dbInit = function (armature) {
+            this._armature = armature;
+            if (this._batchEnabled) {
+                this.$renderNode = new egret.sys.GroupNode();
+                this.$renderNode.cleanBeforeRender = EgretArmatureDisplay._cleanBeforeRender;
+            }
+        };
         /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.START}。
-         * @deprecated
-         * @language zh_CN
+         * @inheritDoc
          */
-        EgretEvent.START = dragonBones.EventObject.START;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.LOOP_COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.LOOP_COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.LOOP_COMPLETE = dragonBones.EventObject.LOOP_COMPLETE;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.COMPLETE = dragonBones.EventObject.COMPLETE;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_IN}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_IN}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.FADE_IN = dragonBones.EventObject.FADE_IN;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_IN_COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_IN_COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.FADE_IN_COMPLETE = dragonBones.EventObject.FADE_IN_COMPLETE;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_OUT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_OUT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.FADE_OUT = dragonBones.EventObject.FADE_OUT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_OUT_COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_OUT_COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.FADE_OUT_COMPLETE = dragonBones.EventObject.FADE_OUT_COMPLETE;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.FRAME_EVENT = dragonBones.EventObject.FRAME_EVENT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.SOUND_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.SOUND_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.SOUND_EVENT = dragonBones.EventObject.SOUND_EVENT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.ANIMATION_FRAME_EVENT = dragonBones.EventObject.FRAME_EVENT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.BONE_FRAME_EVENT = dragonBones.EventObject.FRAME_EVENT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.MOVEMENT_FRAME_EVENT = dragonBones.EventObject.FRAME_EVENT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.SOUND_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.SOUND_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretEvent.SOUND = dragonBones.EventObject.SOUND_EVENT;
-        return EgretEvent;
-    }(egret.Event));
-    dragonBones.EgretEvent = EgretEvent;
-    /**
-     * @inheritDoc
-     */
-    var EgretArmatureDisplay = /** @class */ (function (_super) {
-        __extends(EgretArmatureDisplay, _super);
-        function EgretArmatureDisplay() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            /**
-             * @private
-             */
-            _this.debugDraw = false;
-            /**
-             * @internal
-             */
-            _this._batchEnabled = !(global["nativeRender"] || global["bricks"]); //
-            /**
-             * @internal
-             */
-            _this._childDirty = true;
-            _this._debugDraw = false;
-            _this._armature = null; //
-            _this._bounds = null;
-            _this._debugDrawer = null;
-            return _this;
-        }
-        EgretArmatureDisplay._cleanBeforeRender = function () { };
-        /**
-         * @inheritDoc
-         */
-        EgretArmatureDisplay.prototype.dbInit = function (armature) {
-            this._armature = armature;
-            if (this._batchEnabled) {
-                this.$renderNode = new egret.sys.GroupNode();
-                this.$renderNode.cleanBeforeRender = EgretArmatureDisplay._cleanBeforeRender;
-            }
-        };
-        /**
-         * @inheritDoc
-         */
-        EgretArmatureDisplay.prototype.dbClear = function () {
-            this._armature = null;
-            this._bounds = null;
-            this._debugDrawer = null;
-        };
+        EgretArmatureDisplay.prototype.dbClear = function () {
+            this._armature = null;
+            this._bounds = null;
+            this._debugDrawer = null;
+        };
         /**
          * @inheritDoc
          */
@@ -15555,7 +15441,7 @@ var dragonBones;
                             var segmentX = surfaceData.segmentX;
                             var segmentY = surfaceData.segmentY;
                             var vertices = surface._vertices;
-                            graphics.lineStyle(2.0, 0xFFFF00, 0.7);
+                            graphics.lineStyle(2.0, 0xFFFF00, 0.3);
                             for (var iY = 0; iY < segmentY; ++iY) {
                                 for (var iX = 0; iX < segmentX; ++iX) {
                                     var vertexIndex = (iX + iY * (segmentX + 1)) * 2;
@@ -15694,7 +15580,7 @@ var dragonBones;
             for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) {
                 var slot = _a[_i];
                 // (slot as EgretSlot).transformUpdateEnabled = true;
-                var display = ((slot._deformVertices && slot._deformVertices.verticesData) ? slot.meshDisplay : slot.rawDisplay);
+                var display = (slot._geometryData ? slot.meshDisplay : slot.rawDisplay);
                 if (!slot.display && display === slot.meshDisplay) {
                     display = slot.rawDisplay;
                 }
@@ -15703,6 +15589,9 @@ var dragonBones;
                 if (node.matrix) {
                     display.$setMatrix(slot.globalTransformMatrix, false);
                 }
+                // Color.
+                node.alpha = 1.0;
+                node.filter = null;
                 // ZOrder.
                 this.addChild(display);
             }
@@ -15770,14 +15659,14 @@ var dragonBones;
                                 continue;
                             }
                         }
-                        else {
-                            var displayData = slot.displayData;
-                            if (displayData && displayData instanceof dragonBones.ImageDisplayData && displayData.texture) {
-                                var scale = displayData.texture.parent.scale;
+                        else if (slot._displayFrame) {
+                            var textureData = slot._displayFrame.getTextureData();
+                            if (textureData) {
+                                var scale = textureData.parent.scale;
                                 helpRectangle.x = 0;
                                 helpRectangle.y = 0;
-                                helpRectangle.width = displayData.texture.region.width * scale;
-                                helpRectangle.height = displayData.texture.region.height * scale;
+                                helpRectangle.width = textureData.region.width * scale;
+                                helpRectangle.height = textureData.region.height * scale;
                             }
                             else {
                                 continue;
@@ -15829,187 +15718,9 @@ var dragonBones;
             }
             return _super.prototype.$measureContentBounds.call(this, bounds); // V5
         };
-        /**
-         * @inheritDoc
-         */
-        EgretArmatureDisplay.prototype.hasEvent = function (type) {
-            return this.hasDBEventListener(type);
-        };
-        /**
-         * @inheritDoc
-         */
-        EgretArmatureDisplay.prototype.addEvent = function (type, listener, target) {
-            this.addDBEventListener(type, listener, target);
-        };
-        /**
-         * @inheritDoc
-         */
-        EgretArmatureDisplay.prototype.removeEvent = function (type, listener, target) {
-            this.removeDBEventListener(type, listener, target);
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#clock} {@link dragonBones.BaseFactory#clock}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#clock} {@link dragonBones.BaseFactory#clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretArmatureDisplay.prototype.advanceTimeBySelf = function (on) {
-            if (on) {
-                this._armature.clock = dragonBones.EgretFactory.factory.clock;
-            }
-            else {
-                this._armature.clock = null;
-            }
-        };
         return EgretArmatureDisplay;
     }(egret.DisplayObjectContainer));
     dragonBones.EgretArmatureDisplay = EgretArmatureDisplay;
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    var Event = /** @class */ (function (_super) {
-        __extends(Event, _super);
-        function Event() {
-            return _super !== null && _super.apply(this, arguments) || this;
-        }
-        return Event;
-    }(EgretEvent));
-    dragonBones.Event = Event;
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    var ArmatureEvent = /** @class */ (function (_super) {
-        __extends(ArmatureEvent, _super);
-        function ArmatureEvent() {
-            return _super !== null && _super.apply(this, arguments) || this;
-        }
-        return ArmatureEvent;
-    }(EgretEvent));
-    dragonBones.ArmatureEvent = ArmatureEvent;
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    var AnimationEvent = /** @class */ (function (_super) {
-        __extends(AnimationEvent, _super);
-        function AnimationEvent() {
-            return _super !== null && _super.apply(this, arguments) || this;
-        }
-        return AnimationEvent;
-    }(EgretEvent));
-    dragonBones.AnimationEvent = AnimationEvent;
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    var FrameEvent = /** @class */ (function (_super) {
-        __extends(FrameEvent, _super);
-        function FrameEvent() {
-            return _super !== null && _super.apply(this, arguments) || this;
-        }
-        return FrameEvent;
-    }(EgretEvent));
-    dragonBones.FrameEvent = FrameEvent;
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    var SoundEvent = /** @class */ (function (_super) {
-        __extends(SoundEvent, _super);
-        function SoundEvent() {
-            return _super !== null && _super.apply(this, arguments) || this;
-        }
-        return SoundEvent;
-    }(EgretEvent));
-    dragonBones.SoundEvent = SoundEvent;
-    /**
-     * 已废弃,请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。
-     * @deprecated
-     * @language zh_CN
-     */
-    var EgretTextureAtlas = /** @class */ (function (_super) {
-        __extends(EgretTextureAtlas, _super);
-        /**
-         * 已废弃,请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        function EgretTextureAtlas(texture, rawData, scale) {
-            if (scale === void 0) { scale = 1; }
-            var _this = _super.call(this) || this;
-            console.warn("已废弃");
-            _this._onClear();
-            dragonBones.ObjectDataParser.getInstance().parseTextureAtlasData(rawData, _this, scale);
-            _this.renderTexture = texture;
-            return _this;
-        }
-        EgretTextureAtlas.toString = function () {
-            return "[class dragonBones.EgretTextureAtlas]";
-        };
-        return EgretTextureAtlas;
-    }(dragonBones.EgretTextureAtlasData));
-    dragonBones.EgretTextureAtlas = EgretTextureAtlas;
-    /**
-     * 已废弃,请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。
-     * @deprecated
-     * @language zh_CN
-     */
-    var EgretSheetAtlas = /** @class */ (function (_super) {
-        __extends(EgretSheetAtlas, _super);
-        function EgretSheetAtlas() {
-            return _super !== null && _super.apply(this, arguments) || this;
-        }
-        return EgretSheetAtlas;
-    }(EgretTextureAtlas));
-    dragonBones.EgretSheetAtlas = EgretSheetAtlas;
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretFactory#soundEventManager}。
-     * @deprecated
-     * @language zh_CN
-     */
-    var SoundEventManager = /** @class */ (function () {
-        function SoundEventManager() {
-        }
-        /**
-         * 已废弃,请参考 {@link dragonBones.EgretFactory#soundEventManager}。
-         * @deprecated
-         * @language zh_CN
-         */
-        SoundEventManager.getInstance = function () {
-            console.warn("已废弃");
-            return dragonBones.EgretFactory.factory.soundEventManager;
-        };
-        return SoundEventManager;
-    }());
-    dragonBones.SoundEventManager = SoundEventManager;
-    /**
-     * 已废弃,请参考 {@link dragonBones.Armature#cacheFrameRate}。
-     * @deprecated
-     * @language zh_CN
-     */
-    var AnimationCacheManager = /** @class */ (function () {
-        /**
-         * 已废弃,请参考 {@link dragonBones.Armature#cacheFrameRate}。
-         * @deprecated
-         * @language zh_CN
-         */
-        function AnimationCacheManager() {
-            console.warn("已废弃");
-        }
-        return AnimationCacheManager;
-    }());
-    dragonBones.AnimationCacheManager = AnimationCacheManager;
 })(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
@@ -16134,7 +15845,8 @@ var dragonBones;
             var prevDisplay = value;
             if (this._armatureDisplay._batchEnabled) {
                 var nodes = this._armatureDisplay.$renderNode.drawData;
-                nodes[nodes.indexOf(prevDisplay.$renderNode)] = this._renderDisplay.$renderNode;
+                var prevIndex = nodes.indexOf(prevDisplay.$renderNode);
+                nodes[prevIndex] = this._renderDisplay.$renderNode;
             }
             else {
                 this._armatureDisplay.addChild(this._renderDisplay);
@@ -16154,7 +15866,13 @@ var dragonBones;
         EgretSlot.prototype._updateZOrder = function () {
             if (this._armatureDisplay._batchEnabled) {
                 var nodes = this._armatureDisplay.$renderNode.drawData;
+                var index = nodes.indexOf(this._renderDisplay.$renderNode);
+                if (index === this._zOrder) {
+                    return;
+                }
                 nodes[this._zOrder] = this._renderDisplay.$renderNode;
+                // nodes.splice(index, 1);
+                // nodes.splice(this._zOrder, 0, this._renderDisplay.$renderNode);
             }
             else {
                 var index = this._armatureDisplay.getChildIndex(this._renderDisplay);
@@ -16197,6 +15915,7 @@ var dragonBones;
             }
         };
         EgretSlot.prototype._updateColor = function () {
+            var alpha = this._colorTransform.alphaMultiplier * this._globalAlpha;
             if (this._colorTransform.redMultiplier !== 1.0 ||
                 this._colorTransform.greenMultiplier !== 1.0 ||
                 this._colorTransform.blueMultiplier !== 1.0 ||
@@ -16211,7 +15930,7 @@ var dragonBones;
                 colorMatrix[0] = this._colorTransform.redMultiplier;
                 colorMatrix[6] = this._colorTransform.greenMultiplier;
                 colorMatrix[12] = this._colorTransform.blueMultiplier;
-                colorMatrix[18] = this._colorTransform.alphaMultiplier;
+                colorMatrix[18] = alpha;
                 colorMatrix[4] = this._colorTransform.redOffset;
                 colorMatrix[9] = this._colorTransform.greenOffset;
                 colorMatrix[14] = this._colorTransform.blueOffset;
@@ -16223,7 +15942,7 @@ var dragonBones;
                     node.alpha = 1.0;
                 }
                 var filters = this._renderDisplay.filters;
-                if (!filters) {
+                if (!filters) { // null or undefined?
                     filters = [];
                 }
                 if (filters.indexOf(this._colorFilter) < 0) {
@@ -16236,18 +15955,17 @@ var dragonBones;
                 if (this._armatureDisplay._batchEnabled) {
                     var node = this._renderDisplay.$renderNode;
                     node.filter = null;
-                    node.alpha = this._colorTransform.alphaMultiplier;
+                    node.alpha = alpha;
                 }
                 this._renderDisplay.filters = null;
-                this._renderDisplay.alpha = this._colorTransform.alphaMultiplier;
+                this._renderDisplay.alpha = alpha;
             }
         };
         EgretSlot.prototype._updateFrame = function () {
-            var currentVerticesData = (this._deformVertices !== null && this._display === this._meshDisplay) ? this._deformVertices.verticesData : null;
             var currentTextureData = this._textureData;
-            if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) {
-                if (this._armature.replacedTexture !== null && this._rawDisplayDatas !== null && this._rawDisplayDatas.indexOf(this._displayData) >= 0) {
-                    var currentTextureAtlasData = currentTextureData.parent;
+            if (this._displayFrame !== null && this._display !== null && currentTextureData !== null) {
+                var currentTextureAtlasData = currentTextureData.parent;
+                if (this._armature.replacedTexture !== null) { // Update replaced texture atlas.
                     if (this._armature._replaceTextureAtlasData === null) {
                         currentTextureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.EgretTextureAtlasData);
                         currentTextureAtlasData.copyFrom(currentTextureData.parent);
@@ -16260,15 +15978,15 @@ var dragonBones;
                     currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name);
                 }
                 if (currentTextureData.renderTexture !== null) {
-                    if (currentVerticesData !== null) {
-                        var data = currentVerticesData.data;
+                    if (this._geometryData !== null) { // Mesh.
+                        var data = this._geometryData.data;
                         var intArray = data.intArray;
                         var floatArray = data.floatArray;
-                        var vertexCount = intArray[currentVerticesData.offset + 0 /* MeshVertexCount */];
-                        var triangleCount = intArray[currentVerticesData.offset + 1 /* MeshTriangleCount */];
-                        var vertexOffset = intArray[currentVerticesData.offset + 2 /* MeshFloatOffset */];
+                        var vertexCount = intArray[this._geometryData.offset + 0 /* GeometryVertexCount */];
+                        var triangleCount = intArray[this._geometryData.offset + 1 /* GeometryTriangleCount */];
+                        var vertexOffset = intArray[this._geometryData.offset + 2 /* GeometryFloatOffset */];
                         if (vertexOffset < 0) {
-                            vertexOffset += 65536; // Fixed out of bouds bug. 
+                            vertexOffset += 65536; // Fixed out of bounds bug. 
                         }
                         var uvOffset = vertexOffset + vertexCount * 2;
                         var scale = this._armature._armatureData.scale;
@@ -16282,7 +16000,7 @@ var dragonBones;
                             meshNode.uvs[i] = floatArray[uvOffset + i];
                         }
                         for (var i = 0; i < triangleCount * 3; ++i) {
-                            meshNode.indices[i] = intArray[currentVerticesData.offset + 4 /* MeshVertexIndices */ + i];
+                            meshNode.indices[i] = intArray[this._geometryData.offset + 4 /* GeometryVertexIndices */ + i];
                         }
                         if (this._armatureDisplay._batchEnabled) {
                             var texture = currentTextureData.renderTexture;
@@ -16310,13 +16028,13 @@ var dragonBones;
                         if (!dragonBones.isV5) {
                             meshDisplay.$invalidateTransform();
                         }
-                        var isSkinned = currentVerticesData.weight !== null;
+                        var isSkinned = this._geometryData.weight !== null;
                         var isSurface = this._parent._boneData.type !== 0 /* Bone */;
                         if (isSkinned || isSurface) {
                             this._identityTransform();
                         }
                     }
-                    else {
+                    else { // Normal texture.
                         var scale = currentTextureData.parent.scale * this._armature._armatureData.scale;
                         var textureWidth = (currentTextureData.rotated ? currentTextureData.region.height : currentTextureData.region.width) * scale;
                         var textureHeight = (currentTextureData.rotated ? currentTextureData.region.width : currentTextureData.region.height) * scale;
@@ -16363,21 +16081,21 @@ var dragonBones;
         };
         EgretSlot.prototype._updateMesh = function () {
             var scale = this._armature._armatureData.scale;
-            var deformVertices = this._deformVertices.vertices;
-            var bones = this._deformVertices.bones;
-            var verticesData = this._deformVertices.verticesData;
-            var weightData = verticesData.weight;
-            var hasDeform = deformVertices.length > 0 && verticesData.inheritDeform;
+            var deformVertices = this._displayFrame.deformVertices;
+            var bones = this._geometryBones;
+            var geometryData = this._geometryData;
+            var weightData = geometryData.weight;
+            var hasDeform = deformVertices.length > 0 && geometryData.inheritDeform;
             var meshDisplay = this._renderDisplay;
             var meshNode = meshDisplay.$renderNode;
             if (weightData !== null) {
-                var data = verticesData.data;
+                var data = geometryData.data;
                 var intArray = data.intArray;
                 var floatArray = data.floatArray;
-                var vertexCount = intArray[verticesData.offset + 0 /* MeshVertexCount */];
+                var vertexCount = intArray[geometryData.offset + 0 /* GeometryVertexCount */];
                 var weightFloatOffset = intArray[weightData.offset + 1 /* WeigthFloatOffset */];
                 if (weightFloatOffset < 0) {
-                    weightFloatOffset += 65536; // Fixed out of bouds bug. 
+                    weightFloatOffset += 65536; // Fixed out of bounds bug. 
                 }
                 for (var i = 0, iD = 0, iB = weightData.offset + 2 /* WeigthBoneIndices */ + bones.length, iV = weightFloatOffset, iF = 0; i < vertexCount; ++i) {
                     var boneCount = intArray[iB++];
@@ -16406,19 +16124,23 @@ var dragonBones;
                     meshDisplay.$invalidateTransform();
                 }
             }
-            else if (hasDeform) {
+            else {
                 var isSurface = this._parent._boneData.type !== 0 /* Bone */;
-                var data = verticesData.data;
+                var data = geometryData.data;
                 var intArray = data.intArray;
                 var floatArray = data.floatArray;
-                var vertexCount = intArray[verticesData.offset + 0 /* MeshVertexCount */];
-                var vertexOffset = intArray[verticesData.offset + 2 /* MeshFloatOffset */];
+                var vertexCount = intArray[geometryData.offset + 0 /* GeometryVertexCount */];
+                var vertexOffset = intArray[geometryData.offset + 2 /* GeometryFloatOffset */];
                 if (vertexOffset < 0) {
-                    vertexOffset += 65536; // Fixed out of bouds bug. 
+                    vertexOffset += 65536; // Fixed out of bounds bug. 
                 }
                 for (var i = 0, l = vertexCount * 2; i < l; i += 2) {
-                    var x = floatArray[vertexOffset + i] * scale + deformVertices[i];
-                    var y = floatArray[vertexOffset + i + 1] * scale + deformVertices[i + 1];
+                    var x = floatArray[vertexOffset + i] * scale;
+                    var y = floatArray[vertexOffset + i + 1] * scale;
+                    if (hasDeform) {
+                        x += deformVertices[i];
+                        y += deformVertices[i + 1];
+                    }
                     if (isSurface) {
                         var matrix = this._parent._getGlobalTransformMatrix(x, y);
                         meshNode.vertices[i] = matrix.a * x + matrix.c * y + matrix.tx;
@@ -16438,11 +16160,6 @@ var dragonBones;
                 this._armatureDisplay._childDirty = true;
             }
         };
-        /**
-         * @internal
-         */
-        EgretSlot.prototype._updateGlueMesh = function () {
-        };
         EgretSlot.prototype._updateTransform = function () {
             throw new Error();
         };
@@ -16569,7 +16286,7 @@ var dragonBones;
         EgretFactory._clockHandler = function (time) {
             time *= 0.001;
             var passedTime = time - this._time;
-            EgretFactory._dragonBonesInstance.advanceTime(passedTime);
+            this._dragonBonesInstance.advanceTime(passedTime);
             this._time = time;
             return false;
         };
@@ -16585,10 +16302,10 @@ var dragonBones;
              * @language zh_CN
              */
             get: function () {
-                if (EgretFactory._factory === null) {
-                    EgretFactory._factory = new EgretFactory();
+                if (this._factory === null) {
+                    this._factory = new EgretFactory();
                 }
-                return EgretFactory._factory;
+                return this._factory;
             },
             enumerable: true,
             configurable: true
@@ -16605,7 +16322,7 @@ var dragonBones;
                 if (textureAtlas instanceof egret.Texture) {
                     textureAtlasData.renderTexture = textureAtlas;
                 }
-                else {
+                else if (textureAtlas) {
                     var egretTexture = new egret.Texture();
                     egretTexture.bitmapData = new egret.BitmapData(textureAtlas);
                     textureAtlasData.disposeEnabled = true;
@@ -16623,9 +16340,7 @@ var dragonBones;
             armature.init(dataPackage.armature, armatureDisplay, armatureDisplay, this._dragonBones);
             return armature;
         };
-        EgretFactory.prototype._buildSlot = function (dataPackage, slotData, armature) {
-            // tslint:disable-next-line:no-unused-expression
-            dataPackage;
+        EgretFactory.prototype._buildSlot = function (_dataPackage, slotData, armature) {
             var slot = dragonBones.BaseObject.borrowObject(dragonBones.EgretSlot);
             slot.init(slotData, armature, new egret.Bitmap(), new egret.Mesh());
             return slot;
@@ -16720,139 +16435,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(EgretFactory, "clock", {
-            /**
-             * - Deprecated, please refer to {@link #clock}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #clock}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                return EgretFactory.factory.clock;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * - Deprecated, please refer to {@link #addDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #addDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretFactory.prototype.addSkeletonData = function (dragonBonesData, dragonBonesName) {
-            if (dragonBonesName === void 0) { dragonBonesName = null; }
-            console.warn("已废弃");
-            this.addDragonBonesData(dragonBonesData, dragonBonesName);
-        };
-        /**
-         * - Deprecated, please refer to {@link #getDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #getDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretFactory.prototype.getSkeletonData = function (dragonBonesName) {
-            console.warn("已废弃");
-            return this.getDragonBonesData(dragonBonesName);
-        };
-        /**
-         * - Deprecated, please refer to {@link #removeDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #removeDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretFactory.prototype.removeSkeletonData = function (dragonBonesName) {
-            console.warn("已废弃");
-            this.removeDragonBonesData(dragonBonesName);
-        };
-        /**
-         * - Deprecated, please refer to {@link #addTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #addTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretFactory.prototype.addTextureAtlas = function (textureAtlasData, dragonBonesName) {
-            if (dragonBonesName === void 0) { dragonBonesName = null; }
-            console.warn("已废弃");
-            this.addTextureAtlasData(textureAtlasData, dragonBonesName);
-        };
-        /**
-         * - Deprecated, please refer to {@link #getTextureAtlas()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #getTextureAtlas()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretFactory.prototype.getTextureAtlas = function (dragonBonesName) {
-            console.warn("已废弃");
-            return this.getTextureAtlasData(dragonBonesName);
-        };
-        /**
-         * - Deprecated, please refer to {@link #removeTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #removeTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretFactory.prototype.removeTextureAtlas = function (dragonBonesName) {
-            console.warn("已废弃");
-            this.removeTextureAtlasData(dragonBonesName);
-        };
-        /**
-         * - Deprecated, please refer to {@link #buildArmature()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #buildArmature()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretFactory.prototype.buildFastArmature = function (armatureName, dragonBonesName, skinName) {
-            if (dragonBonesName === void 0) { dragonBonesName = ""; }
-            if (skinName === void 0) { skinName = ""; }
-            console.warn("已废弃");
-            return this.buildArmature(armatureName, dragonBonesName || "", skinName || "");
-        };
-        /**
-         * - Deprecated, please refer to {@link #clear()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #clear()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        EgretFactory.prototype.dispose = function () {
-            console.warn("已废弃");
-            this.clear();
-        };
         EgretFactory._time = 0.0;
         EgretFactory._dragonBonesInstance = null;
         EgretFactory._factory = null;
@@ -16860,1354 +16442,3 @@ var dragonBones;
     }(dragonBones.BaseFactory));
     dragonBones.EgretFactory = EgretFactory;
 })(dragonBones || (dragonBones = {}));
-var dragonBones;
-(function (dragonBones) {
-    /**
-     * @private
-     */
-    var _helpRectangle = new egret.Rectangle();
-    /**
-     * @private
-     */
-    var _helpMatrix = new egret.Matrix();
-    /**
-     * @private
-     */
-    var _groupConfigMap = {};
-    /**
-     * @private
-     */
-    function _findObjectInArray(array, name) {
-        for (var i = 0, l = array.length; i < l; ++i) {
-            var data = array[i];
-            if (data.name === name) {
-                return data;
-            }
-        }
-        return null;
-    }
-    /**
-     * @private
-     */
-    function _fillCreateMovieHelper(createMovieHelper) {
-        if (createMovieHelper.groupName) {
-            var groupConfig = _groupConfigMap[createMovieHelper.groupName];
-            if (groupConfig) {
-                var movieConfig = _findObjectInArray(groupConfig.movie || groupConfig.animation, createMovieHelper.movieName);
-                if (movieConfig) {
-                    createMovieHelper.groupConfig = groupConfig;
-                    createMovieHelper.movieConfig = movieConfig;
-                    return true;
-                }
-            }
-        }
-        if (!createMovieHelper.groupName) {
-            for (var groupName in _groupConfigMap) {
-                var groupConfig = _groupConfigMap[groupName];
-                if (!createMovieHelper.groupName) {
-                    var movieConfig = _findObjectInArray(groupConfig.movie || groupConfig.animation, createMovieHelper.movieName);
-                    if (movieConfig) {
-                        createMovieHelper.groupName = groupName;
-                        createMovieHelper.groupConfig = groupConfig;
-                        createMovieHelper.movieConfig = movieConfig;
-                        return true;
-                    }
-                }
-            }
-        }
-        return false;
-    }
-    /**
-     * 是否包含指定名称的动画组。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function hasMovieGroup(groupName) {
-        return groupName in _groupConfigMap;
-    }
-    dragonBones.hasMovieGroup = hasMovieGroup;
-    /**
-     * 添加动画组。
-     * @param groupData 动画二进制数据。
-     * @param textureAtlas 贴图集或贴图集列表。
-     * @param groupName 为动画组指定一个名称,如果未设置,则使用数据中的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function addMovieGroup(groupData, textureAtlas, groupName) {
-        if (groupName === void 0) { groupName = null; }
-        if (groupData) {
-            var byteArray = new egret.ByteArray(groupData);
-            byteArray.endian = egret.Endian.LITTLE_ENDIAN;
-            byteArray.position = 8; // TODO format
-            var groupConfig = JSON.parse(byteArray.readUTF());
-            groupConfig.offset = byteArray.position;
-            groupConfig.arrayBuffer = groupData;
-            groupConfig.textures = [];
-            var p = groupConfig.offset % 4;
-            if (p) {
-                groupConfig.offset += 4 - p;
-            }
-            for (var i = 0, l = groupConfig.position.length; i < l; i += 3) {
-                switch (i / 3) {
-                    case 1:
-                        groupConfig.displayFrameArray = new Int16Array(groupConfig.arrayBuffer, groupConfig.offset + groupConfig.position[i], groupConfig.position[i + 1] / groupConfig.position[i + 2]);
-                        break;
-                    case 2:
-                        groupConfig.rectangleArray = new Float32Array(groupConfig.arrayBuffer, groupConfig.offset + groupConfig.position[i], groupConfig.position[i + 1] / groupConfig.position[i + 2]);
-                        break;
-                    case 3:
-                        groupConfig.transformArray = new Float32Array(groupConfig.arrayBuffer, groupConfig.offset + groupConfig.position[i], groupConfig.position[i + 1] / groupConfig.position[i + 2]);
-                        break;
-                    case 4:
-                        groupConfig.colorArray = new Int16Array(groupConfig.arrayBuffer, groupConfig.offset + groupConfig.position[i], groupConfig.position[i + 1] / groupConfig.position[i + 2]);
-                        break;
-                }
-            }
-            groupName = groupName || groupConfig.name;
-            if (_groupConfigMap[groupName]) {
-                console.warn("Replace group: " + groupName);
-            }
-            _groupConfigMap[groupName] = groupConfig;
-            //
-            if (textureAtlas instanceof Array) {
-                for (var i = 0, l = textureAtlas.length; i < l; ++i) {
-                    var texture = textureAtlas[i];
-                    groupConfig.textures.push(texture);
-                }
-            }
-            else {
-                groupConfig.textures.push(textureAtlas);
-            }
-        }
-        else {
-            throw new Error();
-        }
-    }
-    dragonBones.addMovieGroup = addMovieGroup;
-    /**
-     * 移除动画组。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function removeMovieGroup(groupName) {
-        var groupConfig = _groupConfigMap[groupName];
-        if (groupConfig) {
-            delete _groupConfigMap[groupName];
-        }
-    }
-    dragonBones.removeMovieGroup = removeMovieGroup;
-    /**
-     * 移除所有的动画组。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function removeAllMovieGroup() {
-        for (var i in _groupConfigMap) {
-            delete _groupConfigMap[i];
-        }
-    }
-    dragonBones.removeAllMovieGroup = removeAllMovieGroup;
-    /**
-     * 创建一个动画。
-     * @param movieName 动画的名称。
-     * @param groupName 动画组的名称,如果未设置,将检索所有的动画组,当多个动画组中包含同名的动画时,可能无法创建出准确的动画。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function buildMovie(movieName, groupName) {
-        if (groupName === void 0) { groupName = null; }
-        var createMovieHelper = { movieName: movieName, groupName: groupName };
-        if (_fillCreateMovieHelper(createMovieHelper)) {
-            var movie = new Movie(createMovieHelper);
-            movie.clock = dragonBones.EgretFactory.factory.clock;
-            return movie;
-        }
-        else {
-            console.warn("No movie named: " + movieName);
-        }
-        return null;
-    }
-    dragonBones.buildMovie = buildMovie;
-    /**
-     * 获取指定动画组内包含的所有动画名称。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    function getMovieNames(groupName) {
-        var groupConfig = _groupConfigMap[groupName];
-        if (groupConfig) {
-            var movieNameGroup = [];
-            var movie = groupConfig.movie || groupConfig.animation;
-            for (var i = 0, l = movie.length; i < l; ++i) {
-                movieNameGroup.push(movie[i].name);
-            }
-            return movieNameGroup;
-        }
-        else {
-            console.warn("No group named: " + groupName);
-        }
-        return null;
-    }
-    dragonBones.getMovieNames = getMovieNames;
-    /**
-     * 动画事件。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    var MovieEvent = /** @class */ (function (_super) {
-        __extends(MovieEvent, _super);
-        /**
-         * @private
-         */
-        function MovieEvent(type) {
-            var _this = _super.call(this, type) || this;
-            /**
-             * 事件名称。 (帧标签的名称或声音的名称)
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            _this.name = "";
-            /**
-             * 发出事件的插槽名称。
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            _this.slotName = "";
-            /**
-             * 发出事件的动画剪辑名称。
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            _this.clipName = "";
-            return _this;
-        }
-        Object.defineProperty(MovieEvent.prototype, "armature", {
-            //========================================= // 兼容旧数据
-            /**
-             * @private
-             */
-            get: function () {
-                return this.movie;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(MovieEvent.prototype, "bone", {
-            /**
-             * @private
-             */
-            get: function () {
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(MovieEvent.prototype, "animationState", {
-            /**
-             * @private
-             */
-            get: function () {
-                return { name: this.clipName };
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(MovieEvent.prototype, "frameLabel", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this.name;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(MovieEvent.prototype, "movementID", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this.clipName;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * 动画剪辑开始播放。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        MovieEvent.START = "start";
-        /**
-         * 动画剪辑循环播放一次完成。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        MovieEvent.LOOP_COMPLETE = "loopComplete";
-        /**
-         * 动画剪辑播放完成。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        MovieEvent.COMPLETE = "complete";
-        /**
-         * 动画剪辑帧事件。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        MovieEvent.FRAME_EVENT = "frameEvent";
-        /**
-         * 动画剪辑声音事件。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        MovieEvent.SOUND_EVENT = "soundEvent";
-        return MovieEvent;
-    }(egret.Event));
-    dragonBones.MovieEvent = MovieEvent;
-    /**
-     * @private
-     */
-    var MovieSlot = /** @class */ (function (_super) {
-        __extends(MovieSlot, _super);
-        function MovieSlot(slotConfig) {
-            var _this = _super.call(this) || this;
-            _this.displayIndex = -1;
-            _this.colorIndex = -1;
-            _this.transformIndex = -1;
-            _this.rawDisplay = new egret.Bitmap();
-            _this.childMovies = {};
-            _this.displayConfig = null;
-            _this.childMovie = null;
-            _this.colorFilter = null;
-            _this.display = _this.rawDisplay;
-            _this.config = slotConfig;
-            _this.rawDisplay.name = _this.config.name;
-            if (!_this.config.blendMode) {
-                _this.config.blendMode = 0 /* Normal */;
-            }
-            return _this;
-        }
-        MovieSlot.prototype.dispose = function () {
-            this.rawDisplay = null;
-            this.childMovies = null;
-            this.config = null;
-            this.displayConfig = null;
-            this.display = null;
-            this.childMovie = null;
-            this.colorFilter = null;
-        };
-        return MovieSlot;
-    }(egret.HashObject));
-    /**
-     * 通过读取缓存的二进制动画数据来更新动画,具有良好的运行性能,同时对内存的占用也非常低。
-     * @see dragonBones.buildMovie
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    var Movie = /** @class */ (function (_super) {
-        __extends(Movie, _super);
-        function Movie(createMovieHelper) {
-            var _this = _super.call(this) || this;
-            /**
-             * 动画的播放速度。 [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]
-             * @default 1
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            _this.timeScale = 1;
-            /**
-             * 动画剪辑的播放速度。 [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]
-             * (当再次播放其他动画剪辑时,此值将被重置为 1)
-             * @default 1
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            _this.clipTimeScale = 1;
-            _this._batchEnabled = true;
-            _this._isLockDispose = false;
-            _this._isDelayDispose = false;
-            _this._isStarted = false;
-            _this._isPlaying = false;
-            _this._isReversing = false;
-            _this._isCompleted = false;
-            _this._playTimes = 0;
-            _this._time = 0;
-            _this._currentTime = 0;
-            _this._currentPlayTimes = 0;
-            _this._cacheFrameIndex = 0;
-            _this._frameSize = 0;
-            _this._cacheRectangle = null;
-            _this._clock = null;
-            _this._currentFrameConfig = null;
-            _this._clipNames = [];
-            _this._slots = [];
-            _this._childMovies = [];
-            _this._groupConfig = createMovieHelper.groupConfig;
-            _this._config = createMovieHelper.movieConfig;
-            _this._batchEnabled = !(_this._config.isNested || _this._config.hasChildAnimation);
-            if (_this._batchEnabled) {
-                _this.$renderNode = new egret.sys.GroupNode();
-                _this.$renderNode.cleanBeforeRender = Movie._cleanBeforeRender;
-            }
-            _this._clipNames.length = 0;
-            for (var i = 0, l = _this._config.clip.length; i < l; ++i) {
-                _this._clipNames.push(_this._config.clip[i].name);
-            }
-            for (var i = 0, l = _this._config.slot.length; i < l; ++i) {
-                var slot = new MovieSlot(_this._config.slot[i]);
-                _this._updateSlotBlendMode(slot);
-                _this._slots.push(slot);
-                if (_this._batchEnabled) {
-                    _this.$renderNode.addNode(slot.rawDisplay.$renderNode);
-                }
-                else {
-                    _this.addChild(slot.rawDisplay);
-                }
-            }
-            _this._frameSize = (1 + 1) * _this._slots.length; // displayFrame, transformFrame.
-            _this.name = _this._config.name;
-            _this.play();
-            _this.advanceTime(0.000001);
-            _this.stop();
-            return _this;
-        }
-        Movie._cleanBeforeRender = function () { };
-        Movie.prototype._configToEvent = function (config, event) {
-            event.movie = this;
-            event.clipName = this._clipConfig.name;
-            event.name = config.name;
-            event.slotName = config.slot || "";
-        };
-        Movie.prototype._onCrossFrame = function (frameConfig) {
-            for (var i = 0, l = frameConfig.actionAndEvent.length; i < l; ++i) {
-                var actionAndEvent = frameConfig.actionAndEvent[i];
-                if (actionAndEvent) {
-                    switch (actionAndEvent.type) {
-                        case 11 /* Sound */:
-                            if (dragonBones.EgretFactory.factory.soundEventManager.hasEventListener(MovieEvent.SOUND_EVENT)) {
-                                var event_1 = egret.Event.create(MovieEvent, MovieEvent.SOUND_EVENT);
-                                this._configToEvent(actionAndEvent, event_1);
-                                dragonBones.EgretFactory.factory.soundEventManager.dispatchEvent(event_1);
-                                egret.Event.release(event_1);
-                            }
-                            break;
-                        case 10 /* Frame */:
-                            if (this.hasEventListener(MovieEvent.FRAME_EVENT)) {
-                                var event_2 = egret.Event.create(MovieEvent, MovieEvent.FRAME_EVENT);
-                                this._configToEvent(actionAndEvent, event_2);
-                                this.dispatchEvent(event_2);
-                                egret.Event.release(event_2);
-                            }
-                            break;
-                        case 0 /* Play */:
-                            if (actionAndEvent.slot) {
-                                var slot = this._getSlot(actionAndEvent.slot);
-                                if (slot && slot.childMovie) {
-                                    slot.childMovie.play(actionAndEvent.name);
-                                }
-                            }
-                            else {
-                                this.play(actionAndEvent.name);
-                            }
-                            break;
-                    }
-                }
-            }
-        };
-        Movie.prototype._updateSlotBlendMode = function (slot) {
-            var blendMode = "";
-            switch (slot.config.blendMode) {
-                case 0 /* Normal */:
-                    blendMode = egret.BlendMode.NORMAL;
-                    break;
-                case 1 /* Add */:
-                    blendMode = egret.BlendMode.ADD;
-                    break;
-                case 5 /* Erase */:
-                    blendMode = egret.BlendMode.ERASE;
-                    break;
-                default:
-                    break;
-            }
-            if (blendMode) {
-                if (this._batchEnabled) {
-                    // RenderNode display.
-                    slot.display.$renderNode.blendMode = egret.sys.blendModeToNumber(blendMode);
-                }
-                else {
-                    // Classic display.
-                    slot.display.blendMode = blendMode;
-                }
-            }
-        };
-        Movie.prototype._updateSlotColor = function (slot, aM, rM, gM, bM, aO, rO, gO, bO) {
-            if (rM !== 1 ||
-                gM !== 1 ||
-                bM !== 1 ||
-                rO !== 0 ||
-                gO !== 0 ||
-                bO !== 0 ||
-                aO !== 0) {
-                if (!slot.colorFilter) {
-                    slot.colorFilter = new egret.ColorMatrixFilter();
-                }
-                var colorMatrix = slot.colorFilter.matrix;
-                colorMatrix[0] = rM;
-                colorMatrix[6] = gM;
-                colorMatrix[12] = bM;
-                colorMatrix[18] = aM;
-                colorMatrix[4] = rO;
-                colorMatrix[9] = gO;
-                colorMatrix[14] = bO;
-                colorMatrix[19] = aO;
-                slot.colorFilter.matrix = colorMatrix;
-                if (this._batchEnabled) {
-                    // RenderNode display.
-                    slot.display.$renderNode.filter = slot.colorFilter;
-                    slot.display.$renderNode.alpha = 1.0;
-                }
-                else {
-                    // Classic display.
-                    var filters = slot.display.filters;
-                    if (!filters) {
-                        filters = [];
-                    }
-                    if (filters.indexOf(slot.colorFilter) < 0) {
-                        filters.push(slot.colorFilter);
-                    }
-                    slot.display.filters = filters;
-                    slot.display.$setAlpha(1.0);
-                }
-            }
-            else {
-                if (slot.colorFilter) {
-                    slot.colorFilter = null;
-                }
-                if (this._batchEnabled) {
-                    // RenderNode display.
-                    slot.display.$renderNode.filter = null;
-                    slot.display.$renderNode.alpha = aM;
-                }
-                else {
-                    // Classic display.
-                    slot.display.filters = null;
-                    slot.display.$setAlpha(aM);
-                }
-            }
-        };
-        Movie.prototype._updateSlotDisplay = function (slot) {
-            var prevDisplay = slot.display || slot.rawDisplay;
-            var prevChildMovie = slot.childMovie;
-            if (slot.displayIndex >= 0) {
-                slot.displayConfig = this._groupConfig.display[slot.displayIndex];
-                if (slot.displayConfig.type === 1 /* Armature */) {
-                    var childMovie = slot.displayConfig.name in slot.childMovies ? slot.childMovies[slot.displayConfig.name] : null;
-                    if (!childMovie) {
-                        childMovie = buildMovie(slot.displayConfig.name, this._groupConfig.name);
-                        if (childMovie) {
-                            slot.childMovies[slot.displayConfig.name] = childMovie;
-                        }
-                    }
-                    if (childMovie) {
-                        slot.display = childMovie;
-                        slot.childMovie = childMovie;
-                    }
-                    else {
-                        slot.display = slot.rawDisplay;
-                        slot.childMovie = null;
-                    }
-                }
-                else {
-                    slot.display = slot.rawDisplay;
-                    slot.childMovie = null;
-                }
-            }
-            else {
-                slot.displayConfig = null;
-                slot.display = slot.rawDisplay;
-                slot.childMovie = null;
-            }
-            if (slot.display !== prevDisplay) {
-                if (prevDisplay) {
-                    this.addChild(slot.display);
-                    this.swapChildren(slot.display, prevDisplay);
-                    this.removeChild(prevDisplay);
-                }
-                // Update blendMode.
-                this._updateSlotBlendMode(slot);
-            }
-            // Update frame.
-            if (slot.display === slot.rawDisplay) {
-                if (slot.displayConfig && slot.displayConfig.regionIndex !== null && slot.displayConfig.regionIndex !== undefined) {
-                    if (!slot.displayConfig.texture) {
-                        var textureAtlasTexture = this._groupConfig.textures[slot.displayConfig.textureIndex || 0];
-                        var regionIndex = slot.displayConfig.regionIndex * 4;
-                        var x = this._groupConfig.rectangleArray[regionIndex];
-                        var y = this._groupConfig.rectangleArray[regionIndex + 1];
-                        var width = this._groupConfig.rectangleArray[regionIndex + 2];
-                        var height = this._groupConfig.rectangleArray[regionIndex + 3];
-                        slot.displayConfig.texture = new egret.Texture();
-                        slot.displayConfig.texture.bitmapData = textureAtlasTexture.bitmapData;
-                        slot.displayConfig.texture.$initData(x, y, Math.min(width, textureAtlasTexture.textureWidth - x), Math.min(height, textureAtlasTexture.textureHeight - y), 0, 0, Math.min(width, textureAtlasTexture.textureWidth - x), Math.min(height, textureAtlasTexture.textureHeight - y), textureAtlasTexture.textureWidth, textureAtlasTexture.textureHeight);
-                    }
-                    if (this._batchEnabled) {
-                        // RenderNode display.
-                        var texture = slot.displayConfig.texture;
-                        var bitmapNode = slot.rawDisplay.$renderNode;
-                        egret.sys.RenderNode.prototype.cleanBeforeRender.call(slot.rawDisplay.$renderNode);
-                        bitmapNode.image = texture.bitmapData;
-                        if (dragonBones.isV5) {
-                            bitmapNode.drawImage(texture.$bitmapX, texture.$bitmapY, texture.$bitmapWidth, texture.$bitmapHeight, texture.$offsetX, texture.$offsetY, texture.textureWidth, texture.textureHeight);
-                            bitmapNode.imageWidth = texture._sourceWidth;
-                            bitmapNode.imageHeight = texture._sourceHeight;
-                        }
-                        else {
-                            var textureV4 = texture;
-                            bitmapNode.drawImage(textureV4._bitmapX, textureV4._bitmapY, textureV4._bitmapWidth, textureV4._bitmapHeight, textureV4._offsetX, textureV4._offsetY, texture.textureWidth, texture.textureHeight);
-                            bitmapNode.imageWidth = textureV4._sourceWidth;
-                            bitmapNode.imageHeight = textureV4._sourceHeight;
-                        }
-                    }
-                    else {
-                        // Classic display.
-                        slot.rawDisplay.visible = true;
-                        slot.rawDisplay.$setBitmapData(slot.displayConfig.texture);
-                    }
-                }
-                else {
-                    if (this._batchEnabled) {
-                        // RenderNode display.
-                        slot.rawDisplay.$renderNode.image = null;
-                    }
-                    else {
-                        // Classic display.
-                        slot.rawDisplay.visible = false;
-                        slot.rawDisplay.$setBitmapData(null);
-                    }
-                }
-            }
-            // Update child movie.
-            if (slot.childMovie !== prevChildMovie) {
-                if (prevChildMovie) {
-                    prevChildMovie.stop();
-                    this._childMovies.slice(this._childMovies.indexOf(prevChildMovie), 1);
-                }
-                if (slot.childMovie) {
-                    if (this._childMovies.indexOf(slot.childMovie) < 0) {
-                        this._childMovies.push(slot.childMovie);
-                    }
-                    if (slot.config.action) {
-                        slot.childMovie.play(slot.config.action);
-                    }
-                    else {
-                        slot.childMovie.play(slot.childMovie._config.action);
-                    }
-                }
-            }
-        };
-        Movie.prototype._getSlot = function (name) {
-            for (var i = 0, l = this._slots.length; i < l; ++i) {
-                var slot = this._slots[i];
-                if (slot.config.name === name) {
-                    return slot;
-                }
-            }
-            return null;
-        };
-        /**
-         * @inheritDoc
-         */
-        Movie.prototype.$render = function () {
-            if (this._batchEnabled) {
-                // RenderNode display.
-            }
-            else {
-                // Classic display.
-                _super.prototype.$render.call(this);
-            }
-        };
-        /**
-         * @inheritDoc
-         */
-        Movie.prototype.$updateRenderNode = function () {
-            if (this._batchEnabled) {
-                // RenderNode display.
-            }
-            else {
-                // Classic display.
-                _super.prototype.$updateRenderNode.call(this);
-            }
-        };
-        /**
-         * @inheritDoc
-         */
-        Movie.prototype.$measureContentBounds = function (bounds) {
-            if (this._batchEnabled && this._cacheRectangle) {
-                // RenderNode display.
-                bounds.setTo(this._cacheRectangle.x, this._cacheRectangle.y, this._cacheRectangle.width - this._cacheRectangle.x, this._cacheRectangle.height - this._cacheRectangle.y);
-            }
-            else {
-                // Classic display.
-                _super.prototype.$measureContentBounds.call(this, bounds);
-            }
-        };
-        /**
-         * @inheritDoc
-         */
-        Movie.prototype.$doAddChild = function (child, index, notifyListeners) {
-            if (this._batchEnabled) {
-                // RenderNode display.
-                console.warn("Can not add child.");
-                return null;
-            }
-            // Classic display.
-            return _super.prototype.$doAddChild.call(this, child, index, notifyListeners);
-        };
-        /**
-         * @inheritDoc
-         */
-        Movie.prototype.$doRemoveChild = function (index, notifyListeners) {
-            if (this._batchEnabled) {
-                // RenderNode display.
-                console.warn("Can not remove child.");
-                return null;
-            }
-            // Classic display.
-            return _super.prototype.$doRemoveChild.call(this, index, notifyListeners);
-        };
-        /**
-         * 释放动画。
-         * @version DragonBones 3.0
-         * @language zh_CN
-         */
-        Movie.prototype.dispose = function () {
-            if (this._isLockDispose) {
-                this._isDelayDispose = true;
-            }
-            else {
-                if (this._clock) {
-                    this._clock.remove(this);
-                }
-                if (this._slots) {
-                    for (var i = 0, l = this._slots.length; i < l; ++i) {
-                        this._slots[i].dispose();
-                    }
-                }
-                this._isPlaying = false;
-                this._cacheRectangle = null;
-                this._clock = null;
-                this._groupConfig = null;
-                this._config = null;
-                this._clipConfig = null;
-                this._currentFrameConfig = null;
-                this._clipArray = null;
-                this._clipNames = null;
-                this._slots = null;
-                this._childMovies = null;
-            }
-        };
-        /**
-         * @inheritDoc
-         */
-        Movie.prototype.advanceTime = function (passedTime) {
-            if (this._isPlaying) {
-                this._isLockDispose = true;
-                if (passedTime < 0) {
-                    passedTime = -passedTime;
-                }
-                passedTime *= this.timeScale;
-                this._time += passedTime * this.clipTimeScale;
-                // Modify time.            
-                var duration = this._clipConfig.duration;
-                var totalTime = duration * this._playTimes;
-                var currentTime = this._time;
-                var currentPlayTimes = this._currentPlayTimes;
-                if (this._playTimes > 0 && (currentTime >= totalTime || currentTime <= -totalTime)) {
-                    this._isCompleted = true;
-                    currentPlayTimes = this._playTimes;
-                    if (currentTime < 0) {
-                        currentTime = 0;
-                    }
-                    else {
-                        currentTime = duration;
-                    }
-                }
-                else {
-                    this._isCompleted = false;
-                    if (currentTime < 0) {
-                        currentPlayTimes = Math.floor(-currentTime / duration);
-                        currentTime = duration - (-currentTime % duration);
-                    }
-                    else {
-                        currentPlayTimes = Math.floor(currentTime / duration);
-                        currentTime %= duration;
-                    }
-                    if (this._playTimes > 0 && currentPlayTimes > this._playTimes) {
-                        currentPlayTimes = this._playTimes;
-                    }
-                }
-                if (this._currentTime === currentTime) {
-                    return;
-                }
-                var cacheFrameIndex = Math.floor(currentTime * this._clipConfig.cacheTimeToFrameScale);
-                if (this._cacheFrameIndex !== cacheFrameIndex) {
-                    this._cacheFrameIndex = cacheFrameIndex;
-                    var displayFrameArray = this._groupConfig.displayFrameArray;
-                    var transformArray = this._groupConfig.transformArray;
-                    var colorArray = this._groupConfig.colorArray;
-                    //
-                    var isFirst = true;
-                    var hasDisplay = false;
-                    var needCacheRectangle = false;
-                    var prevCacheRectangle = this._cacheRectangle;
-                    this._cacheRectangle = this._clipConfig.cacheRectangles[this._cacheFrameIndex];
-                    if (this._batchEnabled && !this._cacheRectangle) {
-                        needCacheRectangle = true;
-                        this._cacheRectangle = new egret.Rectangle();
-                        this._clipConfig.cacheRectangles[this._cacheFrameIndex] = this._cacheRectangle;
-                    }
-                    // Update slots.
-                    for (var i = 0, l = this._slots.length; i < l; ++i) {
-                        var slot = this._slots[i];
-                        var clipFrameIndex = this._frameSize * this._cacheFrameIndex + i * 2;
-                        if (clipFrameIndex >= this._clipArray.length) {
-                            clipFrameIndex = this._frameSize * (this._cacheFrameIndex - 1) + i * 2;
-                        }
-                        var displayFrameIndex = this._clipArray[clipFrameIndex] * 2;
-                        if (displayFrameIndex >= 0) {
-                            var displayIndex = displayFrameArray[displayFrameIndex];
-                            var colorIndex = displayFrameArray[displayFrameIndex + 1] * 8;
-                            var transformIndex = this._clipArray[clipFrameIndex + 1] * 6;
-                            var colorChange = false;
-                            if (slot.displayIndex !== displayIndex) {
-                                slot.displayIndex = displayIndex;
-                                colorChange = true;
-                                this._updateSlotDisplay(slot);
-                            }
-                            if (slot.colorIndex !== colorIndex || colorChange) {
-                                slot.colorIndex = colorIndex;
-                                if (slot.colorIndex >= 0) {
-                                    this._updateSlotColor(slot, colorArray[colorIndex] * 0.01, colorArray[colorIndex + 1] * 0.01, colorArray[colorIndex + 2] * 0.01, colorArray[colorIndex + 3] * 0.01, colorArray[colorIndex + 4], colorArray[colorIndex + 5], colorArray[colorIndex + 6], colorArray[colorIndex + 7]);
-                                }
-                                else {
-                                    this._updateSlotColor(slot, 1, 1, 1, 1, 0, 0, 0, 0);
-                                }
-                            }
-                            hasDisplay = true;
-                            if (slot.transformIndex !== transformIndex) {
-                                slot.transformIndex = transformIndex;
-                                if (this._batchEnabled) {
-                                    // RenderNode display.
-                                    var matrix = slot.display.$renderNode.matrix;
-                                    if (!matrix) {
-                                        matrix = slot.display.$renderNode.matrix = new egret.Matrix();
-                                    }
-                                    matrix.a = transformArray[transformIndex];
-                                    matrix.b = transformArray[transformIndex + 1];
-                                    matrix.c = transformArray[transformIndex + 2];
-                                    matrix.d = transformArray[transformIndex + 3];
-                                    matrix.tx = transformArray[transformIndex + 4];
-                                    matrix.ty = transformArray[transformIndex + 5];
-                                }
-                                else {
-                                    // Classic display.
-                                    _helpMatrix.a = transformArray[transformIndex];
-                                    _helpMatrix.b = transformArray[transformIndex + 1];
-                                    _helpMatrix.c = transformArray[transformIndex + 2];
-                                    _helpMatrix.d = transformArray[transformIndex + 3];
-                                    _helpMatrix.tx = transformArray[transformIndex + 4];
-                                    _helpMatrix.ty = transformArray[transformIndex + 5];
-                                    slot.display.$setMatrix(_helpMatrix);
-                                }
-                            }
-                            // 
-                            if (this._batchEnabled && needCacheRectangle && slot.displayConfig) {
-                                // RenderNode display.
-                                var matrix = slot.display.$renderNode.matrix;
-                                _helpRectangle.x = 0;
-                                _helpRectangle.y = 0;
-                                _helpRectangle.width = slot.displayConfig.texture.textureWidth;
-                                _helpRectangle.height = slot.displayConfig.texture.textureHeight;
-                                matrix.$transformBounds(_helpRectangle);
-                                if (isFirst) {
-                                    isFirst = false;
-                                    this._cacheRectangle.x = _helpRectangle.x;
-                                    this._cacheRectangle.width = _helpRectangle.x + _helpRectangle.width;
-                                    this._cacheRectangle.y = _helpRectangle.y;
-                                    this._cacheRectangle.height = _helpRectangle.y + _helpRectangle.height;
-                                }
-                                else {
-                                    this._cacheRectangle.x = Math.min(this._cacheRectangle.x, _helpRectangle.x);
-                                    this._cacheRectangle.width = Math.max(this._cacheRectangle.width, _helpRectangle.x + _helpRectangle.width);
-                                    this._cacheRectangle.y = Math.min(this._cacheRectangle.y, _helpRectangle.y);
-                                    this._cacheRectangle.height = Math.max(this._cacheRectangle.height, _helpRectangle.y + _helpRectangle.height);
-                                }
-                            }
-                        }
-                        else if (slot.displayIndex !== -1) {
-                            slot.displayIndex = -1;
-                            this._updateSlotDisplay(slot);
-                        }
-                    }
-                    //
-                    if (this._cacheRectangle) {
-                        if (hasDisplay && needCacheRectangle && isFirst && prevCacheRectangle) {
-                            this._cacheRectangle.x = prevCacheRectangle.x;
-                            this._cacheRectangle.y = prevCacheRectangle.y;
-                            this._cacheRectangle.width = prevCacheRectangle.width;
-                            this._cacheRectangle.height = prevCacheRectangle.height;
-                        }
-                        if (!dragonBones.isV5) {
-                            this.$invalidateContentBounds();
-                        }
-                    }
-                }
-                if (this._isCompleted) {
-                    this._isPlaying = false;
-                }
-                if (!this._isStarted) {
-                    this._isStarted = true;
-                    if (this.hasEventListener(MovieEvent.START)) {
-                        var event_3 = egret.Event.create(MovieEvent, MovieEvent.START);
-                        event_3.movie = this;
-                        event_3.clipName = this._clipConfig.name;
-                        event_3.name = "";
-                        event_3.slotName = "";
-                        this.dispatchEvent(event_3);
-                    }
-                }
-                this._isReversing = this._currentTime > currentTime && this._currentPlayTimes === currentPlayTimes;
-                this._currentTime = currentTime;
-                // Action and event.
-                var frameCount = this._clipConfig.frame ? this._clipConfig.frame.length : 0;
-                if (frameCount > 0) {
-                    var currentFrameIndex = Math.floor(this._currentTime * this._config.frameRate);
-                    var currentFrameConfig = this._groupConfig.frame[this._clipConfig.frame[currentFrameIndex]];
-                    if (this._currentFrameConfig !== currentFrameConfig) {
-                        if (frameCount > 1) {
-                            var crossedFrameConfig = this._currentFrameConfig;
-                            this._currentFrameConfig = currentFrameConfig;
-                            if (!crossedFrameConfig) {
-                                var prevFrameIndex = Math.floor(this._currentTime * this._config.frameRate);
-                                crossedFrameConfig = this._groupConfig.frame[this._clipConfig.frame[prevFrameIndex]];
-                                if (this._isReversing) {
-                                }
-                                else {
-                                    if (this._currentTime <= crossedFrameConfig.position ||
-                                        this._currentPlayTimes !== currentPlayTimes) {
-                                        crossedFrameConfig = this._groupConfig.frame[crossedFrameConfig.prev];
-                                    }
-                                }
-                            }
-                            if (this._isReversing) {
-                                while (crossedFrameConfig !== currentFrameConfig) {
-                                    this._onCrossFrame(crossedFrameConfig);
-                                    crossedFrameConfig = this._groupConfig.frame[crossedFrameConfig.prev];
-                                }
-                            }
-                            else {
-                                while (crossedFrameConfig !== currentFrameConfig) {
-                                    crossedFrameConfig = this._groupConfig.frame[crossedFrameConfig.next];
-                                    this._onCrossFrame(crossedFrameConfig);
-                                }
-                            }
-                        }
-                        else {
-                            this._currentFrameConfig = currentFrameConfig;
-                            if (this._currentFrameConfig) {
-                                this._onCrossFrame(this._currentFrameConfig);
-                            }
-                        }
-                    }
-                }
-                if (this._currentPlayTimes !== currentPlayTimes) {
-                    this._currentPlayTimes = currentPlayTimes;
-                    if (this.hasEventListener(MovieEvent.LOOP_COMPLETE)) {
-                        var event_4 = egret.Event.create(MovieEvent, MovieEvent.LOOP_COMPLETE);
-                        event_4.movie = this;
-                        event_4.clipName = this._clipConfig.name;
-                        event_4.name = "";
-                        event_4.slotName = "";
-                        this.dispatchEvent(event_4);
-                        egret.Event.release(event_4);
-                    }
-                    if (this._isCompleted && this.hasEventListener(MovieEvent.COMPLETE)) {
-                        var event_5 = egret.Event.create(MovieEvent, MovieEvent.COMPLETE);
-                        event_5.movie = this;
-                        event_5.clipName = this._clipConfig.name;
-                        event_5.name = "";
-                        event_5.slotName = "";
-                        this.dispatchEvent(event_5);
-                        egret.Event.release(event_5);
-                    }
-                }
-            }
-            this._isLockDispose = false;
-            if (this._isDelayDispose) {
-                this.dispose();
-            }
-        };
-        /**
-         * 播放动画剪辑。
-         * @param clipName 动画剪辑的名称,如果未设置,则播放默认动画剪辑,或将暂停状态切换为播放状态,或重新播放上一个正在播放的动画剪辑。
-         * @param playTimes 动画剪辑需要播放的次数。 [-1: 使用动画剪辑默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次]
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        Movie.prototype.play = function (clipName, playTimes) {
-            if (clipName === void 0) { clipName = null; }
-            if (playTimes === void 0) { playTimes = -1; }
-            if (clipName) {
-                var clipConfig = null;
-                for (var i = 0, l = this._config.clip.length; i < l; ++i) {
-                    var data = this._config.clip[i];
-                    if (data.name === clipName) {
-                        clipConfig = data;
-                    }
-                }
-                if (clipConfig) {
-                    this._clipConfig = clipConfig;
-                    this._clipArray = new Int16Array(this._groupConfig.arrayBuffer, this._groupConfig.offset + this._groupConfig.position[0] + this._clipConfig.p, this._clipConfig.s / this._groupConfig.position[2]);
-                    if (!this._clipConfig.cacheRectangles) {
-                        this._clipConfig.cacheRectangles = [];
-                    }
-                    this._isPlaying = true;
-                    this._isStarted = false;
-                    this._isCompleted = false;
-                    if (playTimes < 0 || playTimes !== playTimes) {
-                        this._playTimes = this._clipConfig.playTimes;
-                    }
-                    else {
-                        this._playTimes = playTimes;
-                    }
-                    this._time = 0;
-                    this._currentTime = 0;
-                    this._currentPlayTimes = 0;
-                    this._cacheFrameIndex = -1;
-                    this._currentFrameConfig = null;
-                    this._cacheRectangle = null;
-                    this.clipTimeScale = 1 / this._clipConfig.scale;
-                }
-                else {
-                    console.warn("No clip in movie.", this._config.name, clipName);
-                }
-            }
-            else if (this._clipConfig) {
-                if (this._isPlaying || this._isCompleted) {
-                    this.play(this._clipConfig.name, this._playTimes);
-                }
-                else {
-                    this._isPlaying = true;
-                }
-                // playTimes
-            }
-            else if (this._config.action) {
-                this.play(this._config.action, playTimes);
-            }
-        };
-        /**
-         * 暂停播放动画。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        Movie.prototype.stop = function () {
-            this._isPlaying = false;
-        };
-        /**
-         * 从指定时间播放动画。
-         * @param clipName 动画剪辑的名称。
-         * @param time 指定时间。(以秒为单位)
-         * @param playTimes 动画剪辑需要播放的次数。 [-1: 使用动画剪辑默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次]
-         * @version DragonBones 5.0
-         * @language zh_CN
-         */
-        Movie.prototype.gotoAndPlay = function (clipName, time, playTimes) {
-            if (clipName === void 0) { clipName = null; }
-            if (playTimes === void 0) { playTimes = -1; }
-            time %= this._clipConfig.duration;
-            if (time < 0) {
-                time += this._clipConfig.duration;
-            }
-            this.play(clipName, playTimes);
-            this._time = time;
-            this._currentTime = time;
-        };
-        /**
-         * 将动画停止到指定时间。
-         * @param clipName 动画剪辑的名称。
-         * @param time 指定时间。(以秒为单位)
-         * @version DragonBones 5.0
-         * @language zh_CN
-         */
-        Movie.prototype.gotoAndStop = function (clipName, time) {
-            if (clipName === void 0) { clipName = null; }
-            time %= this._clipConfig.duration;
-            if (time < 0) {
-                time += this._clipConfig.duration;
-            }
-            this.play(clipName, 1);
-            this._time = time;
-            this._currentTime = time;
-            this.advanceTime(0.001);
-            this.stop();
-        };
-        /**
-         * 是否包含指定动画剪辑。
-         * @param clipName 动画剪辑的名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        Movie.prototype.hasClip = function (clipName) {
-            for (var i = 0, l = this._config.clip.length; i < l; ++i) {
-                var clip = this._config.clip[i];
-                if (clip.name === clipName) {
-                    return true;
-                }
-            }
-            return false;
-        };
-        Object.defineProperty(Movie.prototype, "isPlaying", {
-            /**
-             * 动画剪辑是否处正在播放。
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            get: function () {
-                return this._isPlaying && !this._isCompleted;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "isComplete", {
-            /**
-             * 动画剪辑是否均播放完毕。
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            get: function () {
-                return this._isCompleted;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "currentTime", {
-            /**
-             * 当前动画剪辑的播放时间。 (以秒为单位)
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            get: function () {
-                return this._currentTime;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "totalTime", {
-            /**
-             * 当前动画剪辑的总时间。 (以秒为单位)
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            get: function () {
-                return this._clipConfig ? this._clipConfig.duration : 0;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "currentPlayTimes", {
-            /**
-             * 当前动画剪辑的播放次数。
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            get: function () {
-                return this._currentPlayTimes;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "playTimes", {
-            /**
-             * 当前动画剪辑需要播放的次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次]
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            get: function () {
-                return this._playTimes;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "groupName", {
-            get: function () {
-                return this._groupConfig.name;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "clipName", {
-            /**
-             * 正在播放的动画剪辑名称。
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            get: function () {
-                return this._clipConfig ? this._clipConfig.name : "";
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "clipNames", {
-            /**
-             * 所有动画剪辑的名称。
-             * @version DragonBones 4.7
-             * @language zh_CN
-             */
-            get: function () {
-                return this._clipNames;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "clock", {
-            /**
-             * @inheritDoc
-             */
-            get: function () {
-                return this._clock;
-            },
-            set: function (value) {
-                if (this._clock === value) {
-                    return;
-                }
-                var prevClock = this._clock;
-                if (prevClock) {
-                    prevClock.remove(this);
-                }
-                this._clock = value;
-                if (this._clock) {
-                    this._clock.add(this);
-                }
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * 已废弃,请参考 {@link dragonBones.Movie#clock} {@link dragonBones.Movie#clock} {@link dragonBones.EgretFactory#clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Movie.prototype.advanceTimeBySelf = function (on) {
-            if (on) {
-                this.clock = dragonBones.EgretFactory.clock;
-            }
-            else {
-                this.clock = null;
-            }
-        };
-        Object.defineProperty(Movie.prototype, "display", {
-            //========================================= // 兼容旧数据
-            /**
-             * @private
-             */
-            get: function () {
-                return this;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "animation", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "armature", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * @private
-         */
-        Movie.prototype.getAnimation = function () {
-            return this;
-        };
-        /**
-         * @private
-         */
-        Movie.prototype.getArmature = function () {
-            return this;
-        };
-        /**
-         * @private
-         */
-        Movie.prototype.getDisplay = function () {
-            return this;
-        };
-        /**
-         * @private
-         */
-        Movie.prototype.hasAnimation = function (name) {
-            return this.hasClip(name);
-        };
-        /**
-         * @private
-         */
-        Movie.prototype.invalidUpdate = function () {
-            var args = [];
-            for (var _i = 0; _i < arguments.length; _i++) {
-                args[_i] = arguments[_i];
-            }
-            // tslint:disable-next-line:no-unused-expression
-            args;
-        };
-        Object.defineProperty(Movie.prototype, "lastAnimationName", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this.clipName;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "animationNames", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this.clipNames;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Movie.prototype, "animationList", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this.clipNames;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return Movie;
-    }(egret.DisplayObjectContainer));
-    dragonBones.Movie = Movie;
-})(dragonBones || (dragonBones = {}));
diff --git a/Egret/4.x/out/dragonBones.min.js b/Egret/4.x/out/dragonBones.min.js
index bfd59c17..8d453381 100644
--- a/Egret/4.x/out/dragonBones.min.js
+++ b/Egret/4.x/out/dragonBones.min.js
@@ -1 +1 @@
-"use strict";var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(e,a){t(e,a);function r(){this.constructor=e}e.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}();var dragonBones;(function(t){})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(a){this._clock=new t.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=a;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var a=0,r=this._objects;a0){for(var n=0;na){i.length=a}t._maxCountMap[r]=a}else{t._defaultMaxCount=a;for(var r in t._poolsMap){var i=t._poolsMap[r];if(i.length>a){i.length=a}if(r in t._maxCountMap){t._maxCountMap[r]=a}}}};t.clearPool=function(e){if(e===void 0){e=null}if(e!==null){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){r.length=0}}else{for(var i in t._poolsMap){var r=t._poolsMap[i];r.length=0}}};t.borrowObject=function(e){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){var i=r.pop();i._isInPool=false;return i}var n=new e;n._onClear();return n};t.prototype.returnToPool=function(){this._onClear();t._returnObject(this)};t._hashCode=0;t._defaultMaxCount=3e3;t._maxCountMap={};t._poolsMap={};return t}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var f=l+t.width;var u=h+t.height;var _=a*l+i*h+s;var c=r*l+n*h+o;var p=a*f+i*h+s;var m=r*f+n*h+o;var d=a*f+i*u+s;var v=r*f+n*u+o;var y=a*l+i*u+s;var g=r*l+n*u+o;var b=0;if(_>p){b=_;_=p;p=b}if(d>y){b=d;d=y;y=b}t.x=Math.floor(_y?p:y)-t.x);if(c>m){b=c;c=m;m=b}if(v>g){b=v;v=g;g=b}t.y=Math.floor(cg?m:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}t.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};t.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};t.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};t.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};t.prototype.fromMatrix=function(e){var a=this.scaleX,r=this.scaleY;var i=t.PI_Q;this.x=e.tx;this.y=e.ty;this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);this.scaleX=this.rotation>-i&&this.rotation-i&&n=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(r>=0&&this.scaleY<0){this.scaleY=-this.scaleY;n=n-Math.PI}this.skew=n-this.rotation;return this};t.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};t.PI=Math.PI;t.PI_D=Math.PI*2;t.PI_H=Math.PI/2;t.PI_Q=Math.PI/4;t.RAD_DEG=180/Math.PI;t.DEG_RAD=Math.PI/180;return t}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.ints=[];e.floats=[];e.strings=[];return e}e.toString=function(){return"[class dragonBones.UserData]"};e.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};e.prototype.addInt=function(t){this.ints.push(t)};e.prototype.addFloat=function(t){this.floats.push(t)};e.prototype.addString=function(t){this.strings.push(t)};e.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};a.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};a.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};a.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};a.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};a.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};a.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};a.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};a.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};a.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return a}(t.BaseObject);t.ArmatureData=e;var a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.transform=new t.Transform;a.userData=null;return a}a.toString=function(){return"[class dragonBones.BoneData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.name="";this.transform.identity();this.userData=null;this.parent=null};return a}(t.BaseObject);t.BoneData=a;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.SurfaceData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.vertices.length=0};return e}(a);t.SurfaceData=r;var i=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}a.createColor=function(){return new t.ColorTransform};a.toString=function(){return"[class dragonBones.SlotData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.name="";this.color=null;this.userData=null;this.parent=null};a.DEFAULT_COLOR=new t.ColorTransform;return a}(t.BaseObject);t.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.displays={};return e}e.toString=function(){return"[class dragonBones.SkinData]"};e.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};e.rectangleIntersectsSegment=function(t,a,r,i,n,s,o,l,h,f,u){if(h===void 0){h=null}if(f===void 0){f=null}if(u===void 0){u=null}var _=t>n&&ts&&an&&rs&&i=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=this.width*.5;var h=this.height*.5;var f=e.rectangleIntersectsSegment(t,a,r,i,-l,-h,l,h,n,s,o);return f};return e}(e);t.RectangleBoundingBoxData=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.EllipseData]"};e.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,f){if(l===void 0){l=null}if(h===void 0){h=null}if(f===void 0){f=null}var u=s/o;var _=u*u;e*=u;r*=u;var c=a-t;var p=r-e;var m=Math.sqrt(c*c+p*p);var d=c/m;var v=p/m;var y=(i-t)*d+(n-e)*v;var g=y*y;var b=t*t+e*e;var D=s*s;var T=D-b+g;var A=0;if(T>=0){var x=Math.sqrt(T);var P=y-x;var O=y+x;var S=P<0?-1:P<=m?0:1;var E=O<0?-1:O<=m?0:1;var M=S*E;if(M<0){return-1}else if(M===0){if(S===-1){A=2;a=t+O*d;r=(e+O*v)/u;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(f!==null){f.x=Math.atan2(r/D*_,a/D);f.y=f.x+Math.PI}}else if(E===1){A=1;t=t+P*d;e=(e+P*v)/u;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(f!==null){f.x=Math.atan2(e/D*_,t/D);f.y=f.x+Math.PI}}else{A=3;if(l!==null){l.x=t+P*d;l.y=(e+P*v)/u;if(f!==null){f.x=Math.atan2(l.y/D*_,l.x/D)}}if(h!==null){h.x=t+O*d;h.y=(e+O*v)/u;if(f!==null){f.y=Math.atan2(h.y/D*_,h.x/D)}}}}}return A};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};e.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=e.ellipseIntersectsSegment(t,a,r,i,0,0,this.width*.5,this.height*.5,n,s,o);return l};return e}(e);t.EllipseBoundingBoxData=r;var i=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};e.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var f=e-r;var u=t*r-e*a;var _=0;var c=i[l-2];var p=i[l-1];var m=0;var d=0;var v=0;var y=0;var g=0;var b=0;for(var D=0;D=c&&E<=T||E>=T&&E<=c)&&(h===0||E>=t&&E<=a||E>=a&&E<=t)){var M=(u*P-f*O)/S;if((M>=p&&M<=A||M>=A&&M<=p)&&(f===0||M>=e&&M<=r||M>=r&&M<=e)){if(s!==null){var B=E-t;if(B<0){B=-B}if(_===0){m=B;d=B;v=E;y=M;g=E;b=M;if(o!==null){o.x=Math.atan2(A-p,T-c)-Math.PI*.5;o.y=o.x}}else{if(Bd){d=B;g=E;b=M;if(o!==null){o.y=Math.atan2(A-p,T-c)-Math.PI*.5}}}_++}else{v=E;y=M;g=E;b=M;_++;if(o!==null){o.x=Math.atan2(A-p,T-c)-Math.PI*.5;o.y=o.x}break}}}c=T;p=A}if(_===1){if(n!==null){n.x=v;n.y=y}if(s!==null){s.x=v;s.y=y}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=v;n.y=y}if(s!==null){s.x=g;s.y=b}}return _};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};e.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;a=0};e.prototype.addBoneMask=function(t,e,a){if(a===void 0){a=true}var r=t.getBone(e);if(r===null){return}if(this.boneMask.indexOf(e)<0){this.boneMask.push(e)}if(a){for(var i=0,n=t.getBones();i=0){this.boneMask.splice(r,1)}if(a){var i=t.getBone(e);if(i!==null){if(this.boneMask.length>0){for(var n=0,s=t.getBones();n=0&&i.contains(o)){this.boneMask.splice(l,1)}}}else{for(var h=0,f=t.getBones();he._zOrder?1:-1};a.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZorder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};a.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};a.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};a.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};a.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};a.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};a.prototype.init=function(e,a,r,i){if(this._armatureData!==null){return}this._armatureData=e;this._animation=t.BaseObject.borrowObject(t.Animation);this._proxy=a;this._display=r;this._dragonBones=i;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};a.prototype.advanceTime=function(t){if(this._lockUpdate){return}if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty){this._slotsDirty=false;this._slots.sort(a._onSortSlots)}if(this._cacheFrameIndex<0||this._cacheFrameIndex!==e){var r=0,i=0;for(r=0,i=this._bones.length;r0){this._lockUpdate=true;for(var n=0,s=this._actions;n0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var T=o?i.y-e:i.x-t;if(T<0){T=-T}if(d===null||Th){h=T;_=n.x;c=n.y;v=b;if(s!==null){m=s.y}}}}else{d=b;break}}}if(d!==null&&i!==null){i.x=f;i.y=u;if(s!==null){s.x=p}}if(v!==null&&n!==null){n.x=_;n.y=c;if(s!==null){s.y=m}}return d};a.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};a.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};a.prototype.invalidUpdate=function(){this._transformDirty=true};a.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(a.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=n){return this.globalTransformMatrix}i=a>this._kX*(t+n)+d;p=((o*(l+1)+o*2+l+c)*2+(i?1:0))*7;if(this._matrixCahce[p]>0){y.copyFromArray(v,p+1)}else{var g=c*(h+2);var b=this._hullCache[4];var D=this._hullCache[5];var T=this._hullCache[2]-(l-c)*b;var A=this._hullCache[3]-(l-c)*D;var x=this._vertices;if(i){this._getAffineTransform(-n,d+u,r-n,u,x[g+h+2],x[g+h+3],T+b,A+D,x[g],x[g+1],e._helpTransform,y,true)}else{this._getAffineTransform(-r,d,r-n,u,T,A,x[g],x[g+1],T+b,A+D,e._helpTransform,y,false)}v[p]=1;v[p+1]=y.a;v[p+2]=y.b;v[p+3]=y.c;v[p+4]=y.d;v[p+5]=y.tx;v[p+6]=y.ty}}else if(t>=n){if(a<-n||a>=n){return this.globalTransformMatrix}i=a>this._kX*(t-r)+d;p=((o*(l+1)+o+c)*2+(i?1:0))*7;if(this._matrixCahce[p]>0){y.copyFromArray(v,p+1)}else{var g=(c+1)*(h+2)-2;var b=this._hullCache[4];var D=this._hullCache[5];var T=this._hullCache[0]+c*b;var A=this._hullCache[1]+c*D;var x=this._vertices;if(i){this._getAffineTransform(r,d+u,r-n,u,T+b,A+D,x[g+h+2],x[g+h+3],T,A,e._helpTransform,y,true)}else{this._getAffineTransform(n,d,r-n,u,x[g],x[g+1],T,A,x[g+h+2],x[g+h+3],e._helpTransform,y,false)}v[p]=1;v[p+1]=y.a;v[p+2]=y.b;v[p+3]=y.c;v[p+4]=y.d;v[p+5]=y.tx;v[p+6]=y.ty}}else if(a<-n){if(t<-n||t>=n){return this.globalTransformMatrix}i=a>this._kY*(t-m-f)-r;p=(o*(l+1)+_*2+(i?1:0))*7;if(this._matrixCahce[p]>0){y.copyFromArray(v,p+1)}else{var g=_*2;var b=this._hullCache[10];var D=this._hullCache[11];var T=this._hullCache[8]+_*b;var A=this._hullCache[9]+_*D;var x=this._vertices;if(i){this._getAffineTransform(m+f,-n,f,r-n,x[g+2],x[g+3],x[g],x[g+1],T+b,A+D,e._helpTransform,y,true)}else{this._getAffineTransform(m,-r,f,r-n,T,A,T+b,A+D,x[g],x[g+1],e._helpTransform,y,false)}v[p]=1;v[p+1]=y.a;v[p+2]=y.b;v[p+3]=y.c;v[p+4]=y.d;v[p+5]=y.tx;v[p+6]=y.ty}}else if(a>=n){if(t<-n||t>=n){return this.globalTransformMatrix}i=a>this._kY*(t-m-f)+n;p=((o*(l+1)+o+l+c)*2+(i?1:0))*7;if(this._matrixCahce[p]>0){y.copyFromArray(v,p+1)}else{var g=l*(h+2)+_*2;var b=this._hullCache[10];var D=this._hullCache[11];var T=this._hullCache[6]-(o-_)*b;var A=this._hullCache[7]-(o-_)*D;var x=this._vertices;if(i){this._getAffineTransform(m+f,r,f,r-n,T+b,A+D,T,A,x[g+2],x[g+3],e._helpTransform,y,true)}else{this._getAffineTransform(m,n,f,r-n,x[g],x[g+1],x[g+2],x[g+3],T,A,e._helpTransform,y,false)}v[p]=1;v[p+1]=y.a;v[p+2]=y.b;v[p+3]=y.c;v[p+4]=y.d;v[p+5]=y.tx;v[p+6]=y.ty}}else{i=a>this._k*(t-m-f)+d;p=((o*c+_)*2+(i?1:0))*7;if(this._matrixCahce[p]>0){y.copyFromArray(v,p+1)}else{var g=_*2+c*(h+2);var x=this._vertices;if(i){this._getAffineTransform(m+f,d+u,f,u,x[g+h+4],x[g+h+5],x[g+h+2],x[g+h+3],x[g+2],x[g+3],e._helpTransform,y,true)}else{this._getAffineTransform(m,d,f,u,x[g],x[g+1],x[g+2],x[g+3],x[g+h+2],x[g+h+3],e._helpTransform,y,false)}v[p]=1;v[p+1]=y.a;v[p+2]=y.b;v[p+3]=y.c;v[p+4]=y.d;v[p+5]=y.tx;v[p+6]=y.ty}}return y};e.prototype.init=function(e,a){if(this._boneData!==null){return}t.prototype.init.call(this,e,a);var r=e.segmentX;var i=e.segmentY;var n=e.vertices.length;var s=1e3;var o=200;this._dX=o*2/r;this._dY=o*2/i;this._k=-this._dY/this._dX;this._kX=-this._dY/(s-o);this._kY=-(s-o)/this._dX;this._vertices.length=n;this._deformVertices.length=n;this._matrixCahce.length=(r*i+r*2+i*2)*2*7;this._hullCache.length=10;for(var l=0;l=0&&this._cachedFrameIndices!==null){var a=this._cachedFrameIndices[t];if(a>=0&&this._cachedFrameIndex===a){this._transformDirty=false}else if(a>=0){this._transformDirty=true;this._cachedFrameIndex=a}else{if(this._hasConstraint){for(var r=0,i=this._armature._constraints;r=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var s=0,o=this._armature._constraints;s=0;if(this._localDirty){this._updateGlobalTransformMatrix(f)}if(f&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var u=1e3;var _=200;var c=2*this.global.x;var p=2*this.global.y;var m=e._helpPoint;this.globalTransformMatrix.transformPoint(u,-_,m);this._hullCache[0]=m.x;this._hullCache[1]=m.y;this._hullCache[2]=c-m.x;this._hullCache[3]=p-m.y;this.globalTransformMatrix.transformPoint(0,this._dY,m,true);this._hullCache[4]=m.x;this._hullCache[5]=m.y;this.globalTransformMatrix.transformPoint(_,u,m);this._hullCache[6]=m.x;this._hullCache[7]=m.y;this._hullCache[8]=c-m.x;this._hullCache[9]=p-m.y;this.globalTransformMatrix.transformPoint(this._dX,0,m,true);this._hullCache[10]=m.x;this._hullCache[11]=m.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return e}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a._localMatrix=new t.Matrix;a._colorTransform=new t.ColorTransform;a._displayDatas=[];a._displayList=[];a._deformVertices=null;a._rawDisplay=null;a._meshDisplay=null;return a}a.prototype._onClear=function(){e.prototype._onClear.call(this);var a=[];for(var r=0,i=this._displayList;r=0){if(this._rawDisplayDatas!==null){n=this._displayIndex=0&&this._displayIndex=0&&this._rawDisplayDatas!==null){var s=this._displayIndex0){for(var o=0,l=n;o0){if(this._displayList.length!==e.length){this._displayList.length=e.length}for(var a=0,r=e.length;a0){this._displayList.length=0}if(this._displayIndex>=0&&this._displayIndex=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._display===null){return}if(this._visibleDirty){this._visibleDirty=false;this._updateVisible()}if(this._blendModeDirty){this._blendModeDirty=false;this._updateBlendMode()}if(this._colorDirty){this._colorDirty=false;this._updateColor()}if(this._deformVertices!==null&&this._deformVertices.verticesData!==null&&this._display===this._meshDisplay){var a=this._deformVertices.verticesData.weight!==null;var r=this._parent._boneData.type!==0;if(this._deformVertices.verticesDirty||a&&this._deformVertices.isBonesUpdate()||r&&this._parent._childrenTransformDirty){this._deformVertices.verticesDirty=false;this._updateMesh()}if(a||r){return}}if(this._transformDirty){this._transformDirty=false;if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform()}};a.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._transformDirty=false;this._updateGlobalTransformMatrix(false)}};a.prototype.replaceDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){if(this._displayIndex<0){e=0}else{e=this._displayIndex}}if(this._displayDatas.length<=e){this._displayDatas.length=e+1;for(var a=0,r=this._displayDatas.length;a0){if(l===1||l===2){if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n);if(s!==null){s.x=n.x;s.y=n.y}}else if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}else{if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}if(o!==null){this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),a._helpPoint,true);o.x=Math.atan2(a._helpPoint.y,a._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),a._helpPoint,true);o.y=Math.atan2(a._helpPoint.y,a._helpPoint.x)}}return l};a.prototype.invalidUpdate=function(){this._displayDirty=true;this._transformDirty=true};Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"displayIndex",{get:function(){return this._displayIndex},set:function(t){if(this._setDisplayIndex(t)){this.update(-1)}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"name",{get:function(){return this._slotData.name},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"displayList",{get:function(){return this._displayList.concat()},set:function(e){var a=this._displayList.concat();var r=new Array;if(this._setDisplayList(e)){this.update(-1)}for(var i=0,n=a;id){continue}var T=0;for(;;b++){var A=v[b];if(m>A){continue}if(b===0){T=m/A}else{var x=v[b-1];T=(m-x)/(A-x)}break}if(b!==p){p=b;if(f&&b===c){this._computeVertices(_-4,4,0,u);this._computeVertices(0,4,4,u)}else{this._computeVertices(b*6+2,8,0,u)}}this.addCurvePosition(T,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],l,g,a)}return}if(f){_+=2;u.length=o;this._computeVertices(2,_-4,0,u);this._computeVertices(0,2,_-4,u);u[_-2]=u[0];u[_-1]=u[1]}else{c--;_-=4;u.length=_;this._computeVertices(2,_,0,u)}var P=new Array(c);d=0;var O=u[0],S=u[1],E=0,M=0,B=0,C=0,w=0,I=0;var F,N,R,k,j,L,V,U;for(var y=0,Y=2;yd){continue}for(;;b++){var W=P[b];if(G>W)continue;if(b===0)G/=W;else{var z=P[b-1];G=(G-z)/(W-z)}break}if(b!==p){p=b;var K=b*6;O=u[K];S=u[K+1];E=u[K+2];M=u[K+3];B=u[K+4];C=u[K+5];w=u[K+6];I=u[K+7];F=(O-E*2+B)*.03;N=(S-M*2+C)*.03;R=((E-B)*3-O+w)*.006;k=((M-C)*3-S+I)*.006;j=F*2+R;L=N*2+k;V=(E-O)*.3+F+R*.16666667;U=(M-S)*.3+N+k*.16666667;H=Math.sqrt(V*V+U*U);X[0]=H;for(K=1;K<8;K++){V+=j;U+=L;j+=R;L+=k;H+=Math.sqrt(V*V+U*U);X[K]=H}V+=j;U+=L;H+=Math.sqrt(V*V+U*U);X[8]=H;V+=j+R;U+=L+k;H+=Math.sqrt(V*V+U*U);X[9]=H;$=0}G*=H;for(;;$++){var Z=X[$];if(G>Z)continue;if($===0)G/=Z;else{var z=X[$-1];G=$+(G-z)/(Z-z)}break}this.addCurvePosition(G*.1,O,S,E,M,B,C,w,I,l,g,a)}};a.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,f,u){if(t===0){h[f]=e;h[f+1]=a;h[f+2]=0;return}if(t===1){h[f]=o;h[f+1]=l;h[f+2]=0;return}var _=1-t;var c=_*_;var p=t*t;var m=c*_;var d=c*t*3;var v=_*p*3;var y=t*p;var g=m*e+d*r+v*n+y*o;var b=m*a+d*i+v*s+y*l;h[f]=g;h[f+1]=b;if(u){h[f+2]=Math.atan2(b-(m*a+d*i+v*s),g-(m*e+d*r+v*n))}else{h[f+2]=0}};a.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.vertices.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD}}var B=this.rotateMix;var C=this.translateMix;for(var v=0,w=3;v0){var k=D.a,j=D.b,L=D.c,V=D.d,U=void 0,Y=void 0,X=void 0;if(_){U=P[w-1]}else{U=Math.atan2(F,I)}U-=Math.atan2(j,k);if(M){Y=Math.cos(U);X=Math.sin(U);var H=g._boneData.length;S+=(H*(Y*k-X*j)-I)*B;E+=(H*(X*k+Y*j)-F)*B}else{U+=O}if(U>t.Transform.PI){U-=t.Transform.PI_D}else if(U<-t.Transform.PI){U+=t.Transform.PI_D}U*=B;Y=Math.cos(U);X=Math.sin(U);D.a=Y*k-X*j;D.b=X*k+Y*j;D.c=Y*L-X*V;D.d=X*L+Y*V}g.global.fromMatrix(D)}this.dirty=false};a.prototype.invalidUpdate=function(){};return a}(e);t.PathConstraint=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=0}this.time=0;this.timeScale=1;this._systemTime=0;this._animatebles=[];this._clock=null;this.time=t;this._systemTime=(new Date).getTime()*.001}t.prototype.advanceTime=function(t){if(t!==t){t=0}var e=Date.now()*.001;if(t<0){t=e-this._systemTime}this._systemTime=e;if(this.timeScale!==1){t*=this.timeScale}if(t===0){return}if(t<0){this.time-=t}else{this.time+=t}var a=0,r=0,i=this._animatebles.length;for(;a0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&a._subFadeState>0){this._armature._dragonBones.bufferObject(a);this._animationStates.length=0;this._lastAnimationState=null}else{var r=a._animationData;var i=r.cacheFrameRate;if(this._animationDirty&&i>0){this._animationDirty=false;for(var n=0,s=this._armature.getBones();n0){var _=u[0];if(_!==null){if(_.parent===this._armature.armatureData.defaultSkin){f._cachedFrameIndices=r.getSlotCachedFrameIndices(f.name);continue}}}f._cachedFrameIndices=null}}a.advanceTime(t,i)}}else if(e>1){for(var c=0,p=0;c0&&a._subFadeState>0){p++;this._armature._dragonBones.bufferObject(a);this._animationDirty=true;if(this._lastAnimationState===a){this._lastAnimationState=null}}else{if(p>0){this._animationStates[c-p]=a}a.advanceTime(t,0)}if(c===e-1&&p>0){this._animationStates.length-=p;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};a.prototype.reset=function(){for(var t=0,e=this._animationStates;t1){if(e.position<0){e.position%=r.duration;e.position=r.duration-e.position}else if(e.position===r.duration){e.position-=1e-6}else if(e.position>r.duration){e.position%=r.duration}if(e.duration>0&&e.position+e.duration>r.duration){e.duration=r.duration-e.position}if(e.playTimes<0){e.playTimes=r.playTimes}}else{e.playTimes=1;e.position=0;if(e.duration>0){e.duration=0}}if(e.duration===0){e.duration=-1}this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);o.init(this._armature,r,e);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var l=false;for(var h=0,f=this._animationStates.length;hthis._animationStates[h].layer){l=true;this._animationStates.splice(h,0,o);break}else if(h!==f-1&&o.layer>this._animationStates[h+1].layer){l=true;this._animationStates.splice(h+1,0,o);break}}if(!l){this._animationStates.push(o)}}else{this._animationStates.push(o)}for(var u=0,_=this._armature.getSlots();u<_.length;u++){var c=_[u];var p=c.childArmature;if(p!==null&&p.inheritAnimation&&p.animation.hasAnimation(a)&&p.animation.getState(a)===null){p.animation.fadeIn(a)}}var m=false;for(var d in r.animationTimelines){if(!this._lockUpdate){m=true;this._lockUpdate=true}var v=this.fadeIn(d,e.fadeInTime,1,o.layer,null,0);if(v!==null){v.resetToPose=false;v._parent=o;v.stop()}}if(m){this._lockUpdate=false}if(!this._lockUpdate){if(e.fadeInTime<=0){this._armature.advanceTime(0)}this._lastAnimationState=o}return o};a.prototype.play=function(t,e){if(t===void 0){t=null}if(e===void 0){e=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t!==null?t:"";if(t!==null&&t.length>0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};a.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*e/r.frameCount}return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};a.prototype.getState=function(t){var e=this._animationStates.length;while(e--){var a=this._animationStates[e];if(a.name===t){return a}}return null};a.prototype.hasAnimation=function(t){return t in this._animations};a.prototype.getStates=function(){return this._animationStates};Object.defineProperty(a.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});a.prototype.gotoAndPlay=function(t,e,a,r,i,n,s,o,l){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=-1}if(i===void 0){i=0}if(n===void 0){n=null}if(s===void 0){s=3}if(o===void 0){o=true}if(l===void 0){l=true}console.warn("Deprecated.");o;l;this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.fadeOutMode=s;this._animationConfig.playTimes=r;this._animationConfig.layer=i;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=n!==null?n:"";var h=this._animations[t];if(h&&a>0){this._animationConfig.timeScale=h.duration/a}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStop=function(t,e){if(e===void 0){e=0}console.warn("Deprecated.");return this.gotoAndStopByTime(t,e)};Object.defineProperty(a.prototype,"animationList",{get:function(){console.warn("Deprecated.");return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationDataList",{get:function(){console.warn("Deprecated.");var t=[];for(var e=0,a=this._animationNames.length;e0;if(this._subFadeState<0){this._subFadeState=0;var r=a?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=t.BaseObject.borrowObject(t.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}if(e<0){e=-e}this._fadeTime+=e;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=a?0:1}else if(this._fadeTime>0){this._fadeProgress=a?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=a?1:0}if(this._subFadeState>0){if(!a){this._playheadState|=1;this._fadeState=0}var r=a?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=t.BaseObject.borrowObject(t.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}};i.prototype.init=function(e,a,r){if(this._armature!==null){return}this._armature=e;this._animationData=a;this.resetToPose=r.resetToPose;this.additiveBlending=r.additiveBlending;this.displayControl=r.displayControl;this.actionEnabled=r.actionEnabled;this.layer=r.layer;this.playTimes=r.playTimes;this.timeScale=r.timeScale;this.fadeTotalTime=r.fadeInTime;this.autoFadeOutTime=r.autoFadeOutTime;this.weight=r.weight;this.name=r.name.length>0?r.name:r.animation;this.group=r.group;if(r.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(r.duration<0){this._position=0;this._duration=this._animationData.duration;if(r.position!==0){if(this.timeScale>=0){this._time=r.position}else{this._time=r.position-this._duration}}else{this._time=0}}else{this._position=r.position;this._duration=r.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(r.boneMask.length>0){this._boneMask.length=r.boneMask.length;for(var i=0,n=this._boneMask.length;i0;var i=true;var n=true;var s=this._time;this._weightResult=this.weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult/this._parent._fadeProgress}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(r){var o=a*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*a);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){if(n){for(var h=0,f=this._boneTimelines.length;h0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var p=0,m=this._poseTimelines;p0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};i.prototype.play=function(){this._playheadState=3};i.prototype.stop=function(){this._playheadState&=1};i.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};i.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};i.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,f=i;h0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.leftWeight=0;return 0}else{this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}}}else{return 0}t*=this.leftWeight;this.layerWeight+=t;this.blendWeight=t;return 2}this.dirty=true;this.layer=e;this.layerWeight=t;this.leftWeight=1;this.blendWeight=t;return 1};t.prototype.clear=function(){this.dirty=false;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};return t}();t.BlendState=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.playState=-1;this.currentPlayTimes=-1;this.currentTime=-1;this._tweenState=0;this._frameRate=0;this._frameValueOffset=0;this._frameCount=0;this._frameOffset=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._dragonBonesData=null;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._frameIntArray=null;this._frameFloatArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this._duration+1e-6}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState._animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;this._dragonBonesData=this._animationData.parent.parent;if(this._timelineData!==null){this._frameIntArray=this._dragonBonesData.frameIntArray;this._frameFloatArray=this._dragonBonesData.frameFloatArray;this._frameArray=this._dragonBonesData.frameArray;this._timelineArray=this._dragonBonesData.timelineArray;this._frameIndices=this._dragonBonesData.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._tweenState!==0){this._onUpdateFrame()}}};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a+1;var n=Math.floor(t*i);var s=n===0?0:e[r+n-1];var o=n===i-1?1e4:e[r+n];return(s+(o-s)*(t*i-n))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenProgress=0;this._tweenEasing=0};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this._tweenState=1}};e.prototype._onUpdateFrame=function(){if(this._tweenState===2){this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}else{this._tweenProgress=0}};return e}(e);t.TweenTimelineState=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.bone=null;this.bonePose=null};e.prototype.blend=function(t){var e=this.bone._blendState.blendWeight;var a=this.bone.animationPose;var r=this.bonePose.result;if(t===2){a.x+=r.x*e;a.y+=r.y*e;a.rotation+=r.rotation*e;a.skew+=r.skew*e;a.scaleX+=(r.scaleX-1)*e;a.scaleY+=(r.scaleY-1)*e}else if(e!==1){a.x=r.x*e;a.y=r.y*e;a.rotation=r.rotation*e;a.skew=r.skew*e;a.scaleX=(r.scaleX-1)*e+1;a.scaleY=(r.scaleY-1)*e+1}else{a.x=r.x;a.y=r.y;a.rotation=r.rotation;a.skew=r.skew;a.scaleX=r.scaleX;a.scaleY=r.scaleY}if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){this.bone._transformDirty=true}};return e}(a);t.BoneTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.slot=null};return e}(a);t.SlotTimelineState=i;var n=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.constraint=null};return e}(a);t.ConstraintTimelineState=n})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.ActionTimelineState]"};a.prototype._onCrossFrame=function(e){var a=this._armature.eventDispatcher;if(this._animationState.actionEnabled){var r=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+e];var i=this._frameArray[r+1];var n=this._animationData.parent.actions;for(var s=0;s0){if(n.hasDBEventListener(t.EventObject.COMPLETE)){h=t.BaseObject.borrowObject(t.EventObject);h.type=t.EventObject.COMPLETE;h.armature=this._armature;h.animationState=this._animationState}}}if(this._frameCount>1){var f=this._timelineData;var u=Math.floor(this.currentTime*this._frameRate);var _=this._frameIndices[f.frameIndicesOffset+u];if(this._frameIndex!==_){var c=this._frameIndex;this._frameIndex=_;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[f.offset+5+this._frameIndex];if(o){if(c<0){var p=Math.floor(i*this._frameRate);c=this._frameIndices[f.frameIndicesOffset+p];if(this.currentPlayTimes===r){if(c===_){c=-1}}}while(c>=0){var m=this._animationData.frameOffset+this._timelineArray[f.offset+5+c];var d=this._frameArray[m]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(c)}if(l!==null&&c===0){this._armature._dragonBones.bufferEvent(l);l=null}if(c>0){c--}else{c=this._frameCount-1}if(c===_){break}}}else{if(c<0){var p=Math.floor(i*this._frameRate);c=this._frameIndices[f.frameIndicesOffset+p];var m=this._animationData.frameOffset+this._timelineArray[f.offset+5+c];var d=this._frameArray[m]/this._frameRate;if(this.currentPlayTimes===r){if(i<=d){if(c>0){c--}else{c=this._frameCount-1}}else if(c===_){c=-1}}}while(c>=0){if(c=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.ZOrderTimelineState=a;var r=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*6;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.x=r[t++]*a;i.y=r[t++]*a;i.rotation=r[t++];i.skew=r[t++];i.scaleX=r[t++];i.scaleY=r[t++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){t=this._animationData.frameFloatOffset+this._frameValueOffset}n.x=r[t++]*a-i.x;n.y=r[t++]*a-i.y;n.rotation=r[t++]-i.rotation;n.skew=r[t++]-i.skew;n.scaleX=r[t++]-i.scaleX;n.scaleY=r[t++]-i.scaleY}else{n.x=0;n.y=0;n.rotation=0;n.skew=0;n.scaleX=0;n.scaleY=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.x=0;i.y=0;i.rotation=0;i.skew=0;i.scaleX=1;i.scaleY=1;n.x=0;n.y=0;n.rotation=0;n.skew=0;n.scaleX=0;n.scaleY=0}};a.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.x=t.x+a.x*this._tweenProgress;r.y=t.y+a.y*this._tweenProgress;r.rotation=t.rotation+a.rotation*this._tweenProgress;r.skew=t.skew+a.skew*this._tweenProgress;r.scaleX=t.scaleX+a.scaleX*this._tweenProgress;r.scaleY=t.scaleY+a.scaleY*this._tweenProgress};a.prototype.fadeOut=function(){var e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation);e.skew=t.Transform.normalizeRadian(e.skew)};return a}(t.BoneTimelineState);t.BoneAllTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.x=r[e++]*a;i.y=r[e++]*a;if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){e=this._animationData.frameFloatOffset+this._frameValueOffset}n.x=r[e++]*a-i.x;n.y=r[e++]*a-i.y}else{n.x=0;n.y=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.x=0;i.y=0;n.x=0;n.y=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.x=e.x+a.x*this._tweenProgress;r.y=e.y+a.y*this._tweenProgress};return e}(t.BoneTimelineState);t.BoneTranslateTimelineState=i;var n=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var a=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.rotation=r[a++];i.skew=r[a++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){a=this._animationData.frameFloatOffset+this._frameValueOffset;n.rotation=t.Transform.normalizeRadian(r[a++]-i.rotation)}else{n.rotation=r[a++]-i.rotation}n.skew=r[a++]-i.skew}else{n.rotation=0;n.skew=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.rotation=0;i.skew=0;n.rotation=0;n.skew=0}};a.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.rotation=t.rotation+a.rotation*this._tweenProgress;r.skew=t.skew+a.skew*this._tweenProgress};a.prototype.fadeOut=function(){var e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation);e.skew=t.Transform.normalizeRadian(e.skew)};return a}(t.BoneTimelineState);t.BoneRotateTimelineState=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var a=this._frameFloatArray;var r=this.bonePose.current;var i=this.bonePose.delta;r.scaleX=a[e++];r.scaleY=a[e++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){e=this._animationData.frameFloatOffset+this._frameValueOffset}i.scaleX=a[e++]-r.scaleX;i.scaleY=a[e++]-r.scaleY}else{i.scaleX=0;i.scaleY=0}}else{var r=this.bonePose.current;var i=this.bonePose.delta;r.scaleX=1;r.scaleY=1;i.scaleX=0;i.scaleY=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.scaleX=e.scaleX+a.scaleX*this._tweenProgress;r.scaleY=e.scaleY+a.scaleY*this._tweenProgress};return e}(t.BoneTimelineState);t.BoneScaleTimelineState=s;var o=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[];e._delta=[];e._result=[];return e}e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.surface=null;this._frameFloatOffset=0;this._valueCount=0;this._deformCount=0;this._valueOffset=0;this._current.length=0;this._delta.length=0;this._result.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;if(this._tweenState===2){var i=e+this._valueCount;if(this._frameIndex===this._frameCount-1){i=this._animationData.frameFloatOffset+this._frameValueOffset}for(var n=0;n=0){var t=this._timelineData!==null?this._frameArray[this._frameOffset+1]:this.slot._slotData.displayIndex;if(this.slot.displayIndex!==t){this.slot._setDisplayIndex(t,true)}}};return e}(t.SlotTimelineState);t.SlotDislayTimelineState=l;var h=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[0,0,0,0,0,0,0,0];e._delta=[0,0,0,0,0,0,0,0];e._result=[0,0,0,0,0,0,0,0];return e}e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._dirty=false};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._dragonBonesData.intArray;var a=this._frameIntArray;var r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex*1;var i=a[r];if(i<0){i+=65536}this._current[0]=e[i++];this._current[1]=e[i++];this._current[2]=e[i++];this._current[3]=e[i++];this._current[4]=e[i++];this._current[5]=e[i++];this._current[6]=e[i++];this._current[7]=e[i++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){i=a[this._animationData.frameIntOffset+this._frameValueOffset]}else{i=a[r+1*1]}if(i<0){i+=65536}this._delta[0]=e[i++]-this._current[0];this._delta[1]=e[i++]-this._current[1];this._delta[2]=e[i++]-this._current[2];this._delta[3]=e[i++]-this._current[3];this._delta[4]=e[i++]-this._current[4];this._delta[5]=e[i++]-this._current[5];this._delta[6]=e[i++]-this._current[6];this._delta[7]=e[i++]-this._current[7]}}else{var n=this.slot._slotData.color;this._current[0]=n.alphaMultiplier*100;this._current[1]=n.redMultiplier*100;this._current[2]=n.greenMultiplier*100;this._current[3]=n.blueMultiplier*100;this._current[4]=n.alphaOffset;this._current[5]=n.redOffset;this._current[6]=n.greenOffset;this._current[7]=n.blueOffset}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);this._dirty=true;if(this._tweenState!==2){this._tweenState=0}this._result[0]=(this._current[0]+this._delta[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._delta[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._delta[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._delta[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._delta[4]*this._tweenProgress;this._result[5]=this._current[5]+this._delta[5]*this._tweenProgress;this._result[6]=this._current[6]+this._delta[6]*this._tweenProgress;this._result[7]=this._current[7]+this._delta[7]*this._tweenProgress};e.prototype.fadeOut=function(){this._tweenState=0;this._dirty=false};e.prototype.update=function(e){t.prototype.update.call(this,e);if(this._tweenState!==0||this._dirty){var a=this.slot._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);a.alphaMultiplier+=(this._result[0]-a.alphaMultiplier)*r;a.redMultiplier+=(this._result[1]-a.redMultiplier)*r;a.greenMultiplier+=(this._result[2]-a.greenMultiplier)*r;a.blueMultiplier+=(this._result[3]-a.blueMultiplier)*r;a.alphaOffset+=(this._result[4]-a.alphaOffset)*r;a.redOffset+=(this._result[5]-a.redOffset)*r;a.greenOffset+=(this._result[6]-a.greenOffset)*r;a.blueOffset+=(this._result[7]-a.blueOffset)*r;this.slot._colorDirty=true}}else if(this._dirty){this._dirty=false;if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){a.alphaMultiplier=this._result[0];a.redMultiplier=this._result[1];a.greenMultiplier=this._result[2];a.blueMultiplier=this._result[3];a.alphaOffset=this._result[4];a.redOffset=this._result[5];a.greenOffset=this._result[6];a.blueOffset=this._result[7];this.slot._colorDirty=true}}}};return e}(t.SlotTimelineState);t.SlotColorTimelineState=h;var f=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[];e._delta=[];e._result=[];return e}e.toString=function(){return"[class dragonBones.DeformTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.vertexOffset=0;this._dirty=false;this._frameFloatOffset=0;this._valueCount=0;this._deformCount=0;this._valueOffset=0;this._current.length=0;this._delta.length=0;this._result.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;if(this._tweenState===2){var i=e+this._valueCount;if(this._frameIndex===this._frameCount-1){i=this._animationData.frameFloatOffset+this._frameValueOffset}for(var n=0;n=0){this._floats[2]=this._floats[0]+this._floats[1]*this._tweenProgress}this._floats[5]=this._floats[3]+this._floats[4]*this._tweenProgress};e.prototype.blend=function(t){var e=this.animationState;var a=e._blendState.blendWeight;if(t===2){e.weight+=this._floats[5]*a;e.currentTime+=this._floats[2]*a}else{e.weight=this._floats[5]*a;e.currentTime=this._floats[2]*a}};return e}(t.TweenTimelineState);t.AnimationTimelineState=_})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.actionDataToInstance=function(t,a,r){if(t.type===0){a.type=e.FRAME_EVENT}else{a.type=t.type===10?e.FRAME_EVENT:e.SOUND_EVENT}a.name=t.name;a.armature=r;a.actionData=t;a.data=t.data;if(t.bone!==null){a.bone=r.getBone(t.bone.name)}if(t.slot!==null){a.slot=r.getSlot(t.slot.name)}};e.toString=function(){return"[class dragonBones.EventObject]"};e.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};e.START="start";e.LOOP_COMPLETE="loopComplete";e.COMPLETE="complete";e.FADE_IN="fadeIn";e.FADE_IN_COMPLETE="fadeInComplete";e.FADE_OUT="fadeOut";e.FADE_OUT_COMPLETE="fadeOutComplete";e.FRAME_EVENT="frameEvent";e.SOUND_EVENT="soundEvent";return e}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(){}e._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};e._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};e._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};e._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};e._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};e._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};e._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};e._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};e._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};e.parseDragonBonesData=function(e){console.warn("Deprecated.");if(e instanceof ArrayBuffer){return t.BinaryDataParser.getInstance().parseDragonBonesData(e)}else{return t.ObjectDataParser.getInstance().parseDragonBonesData(e)}};e.parseTextureAtlasData=function(a,r){if(r===void 0){r=1}console.warn("已废弃");var i={};var n=a[e.SUB_TEXTURE];for(var s=0,o=n.length;s255){return encodeURI(i)}}}return i}return String(i)}return r};r.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var f=1-l;var u=f*f;var _=l*l;var c=f*u;var p=3*l*u;var m=3*f*_;var d=l*_;h.x=c*t+p*a+m*i+d*s;h.y=c*e+p*r+m*n+d*o};r.prototype._samplingEasingCurve=function(t,e){var a=t.length;var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var y=(v+d)*.5;this._getCurvePoint(l,h,f,u,_,c,p,m,y,this._helpPoint);if(s-this._helpPoint.x>0){d=y}else{v=y}}e[i]=this._helpPoint.y}};r.prototype._parseActionDataInFrame=function(e,a,r,i){if(t.DataParser.EVENT in e){this._mergeActionFrame(e[t.DataParser.EVENT],a,10,r,i)}if(t.DataParser.SOUND in e){this._mergeActionFrame(e[t.DataParser.SOUND],a,11,r,i)}if(t.DataParser.ACTION in e){this._mergeActionFrame(e[t.DataParser.ACTION],a,0,r,i)}if(t.DataParser.EVENTS in e){this._mergeActionFrame(e[t.DataParser.EVENTS],a,10,r,i)}if(t.DataParser.ACTIONS in e){this._mergeActionFrame(e[t.DataParser.ACTIONS],a,0,r,i)}};r.prototype._mergeActionFrame=function(e,r,i,n,s){var o=t.DragonBones.webAssembly?this._armature.actions.size():this._armature.actions.length;var l=this._parseActionData(e,i,n,s);var h=0;var f=null;for(var u=0,_=l;u<_.length;u++){var c=_[u];this._armature.addAction(c,false)}if(this._actionFrames.length===0){f=new a;f.frameStart=0;this._actionFrames.push(f);f=null}for(var p=0,m=this._actionFrames;pr){break}h++}if(f===null){f=new a;f.frameStart=r;this._actionFrames.splice(h+1,0,f)}for(var v=0;v0){var p=i.getBone(_);if(p!==null){c.parent=p}else{if(!(_ in this._cacheBones)){this._cacheBones[_]=[]}this._cacheBones[_].push(c)}}if(c.name in this._cacheBones){for(var m=0,d=this._cacheBones[c.name];m0&&a.parent!==null){n.root=a.parent;n.bone=a}else{n.root=a;n.bone=null}return n};r.prototype._parsePathConstraint=function(e){var a=this._armature.getSlot(r._getString(e,t.DataParser.TARGET,""));if(a===null){return null}var i=this._armature.defaultSkin;if(i===null){return null}var n=i.getDisplay(a.name,r._getString(e,t.DataParser.TARGET_DISPLAY,a.name));if(n===null||!(n instanceof t.PathDisplayData)){return null}var s=e[t.DataParser.BONES];if(s===null||s.length===0){return null}var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=r._getString(e,t.DataParser.NAME,"");o.type=1;o.pathSlot=a;o.pathDisplayData=n;o.target=a.parent;o.positionMode=t.DataParser._getPositionMode(r._getString(e,t.DataParser.POSITION_MODE,""));o.spacingMode=t.DataParser._getSpacingMode(r._getString(e,t.DataParser.SPACING_MODE,""));o.rotateMode=t.DataParser._getRotateMode(r._getString(e,t.DataParser.ROTATE_MODE,""));o.position=r._getNumber(e,t.DataParser.POSITION,0);o.spacing=r._getNumber(e,t.DataParser.SPACING,0);o.rotateOffset=r._getNumber(e,t.DataParser.ROTATE_OFFSET,0);o.rotateMix=r._getNumber(e,t.DataParser.ROTATE_MIX,1);o.translateMix=r._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var l=0,h=s;l0?i:a;this._parsePivot(e,o);break;case 1:var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);l.name=a;l.path=i.length>0?i:a;l.inheritAnimation=true;if(t.DataParser.ACTIONS in e){var h=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);for(var f=0,u=h;f0?i:a;d.vertices.data=this._data;if(t.DataParser.SHARE in e){this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}else{this._parseMesh(e,d)}if(t.DataParser.GLUE_WEIGHTS in e&&t.DataParser.GLUE_MESHES in e){this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}break;case 3:var v=this._parseBoundingBox(e);if(v!==null){var y=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);y.name=a;y.path=i.length>0?i:a;y.boundingBox=v}break;case 4:var g=e[t.DataParser.LENGTHS];var b=s=t.BaseObject.borrowObject(t.PathDisplayData);b.closed=r._getBoolean(e,t.DataParser.CLOSED,false);b.constantSpeed=r._getBoolean(e,t.DataParser.CONSTANT_SPEED,false);b.name=a;b.path=i.length>0?i:a;b.vertices.data=this._data;b.curveLengths.length=g.length;for(var D=0,T=g.length;Da.width){a.width=l}if(ha.height){a.height=h}}}a.width-=a.x;a.height-=a.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return a};r.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);a.frameCount=Math.max(r._getNumber(e,t.DataParser.DURATION,1),1);a.playTimes=r._getNumber(e,t.DataParser.PLAY_TIMES,1);a.duration=a.frameCount/this._armature.frameRate;a.fadeInTime=r._getNumber(e,t.DataParser.FADE_IN_TIME,0);a.scale=r._getNumber(e,t.DataParser.SCALE,1);a.name=r._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME);if(a.name.length===0){a.name=t.DataParser.DEFAULT_NAME}a.frameIntOffset=this._frameIntArray.length;a.frameFloatOffset=this._frameFloatArray.length;a.frameOffset=this._frameArray.length;this._animation=a;if(t.DataParser.FRAME in e){var i=e[t.DataParser.FRAME];var n=i.length;if(n>0){for(var s=0,o=0;s0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,false,false,0,this._parseActionFrame);this._actionFrames.length=0}this._animation=null;return a};r.prototype._parseTimeline=function(e,i,n,s,o,l,h,f){if(e!==null&&n.length>0&&n in e){i=e[n]}if(i===null){return null}var u=i.length;if(u===0){return null}var _=this._frameIntArray.length;var c=this._frameFloatArray.length;var p=t.BaseObject.borrowObject(t.TimelineData);var m=this._timelineArray.length;this._timelineArray.length+=1+1+1+1+1+u;if(e!==null){this._timelineArray[m+0]=Math.round(r._getNumber(e,t.DataParser.SCALE,1)*100);this._timelineArray[m+1]=Math.round(r._getNumber(e,t.DataParser.OFFSET,0)*100)}else{this._timelineArray[m+0]=100;this._timelineArray[m+1]=0}this._timelineArray[m+2]=u;this._timelineArray[m+3]=h;if(o){this._timelineArray[m+4]=_-this._animation.frameIntOffset}else if(l){this._timelineArray[m+4]=c-this._animation.frameFloatOffset}else{this._timelineArray[m+4]=0}this._timeline=p;p.type=s;p.offset=m;if(u===1){p.frameIndicesOffset=-1;this._timelineArray[m+5+0]=f.call(this,i[0],0,0)-this._animation.frameOffset}else{var d=this._animation.frameCount+1;var v=this._data.frameIndices;var y=0;if(t.DragonBones.webAssembly){y=v.size();v.resize(y+d,0)}else{y=v.length;v.length+=d}p.frameIndicesOffset=y;for(var g=0,b=0,D=0,T=0;g0){if(t.DataParser.CURVE in e){var s=i+1;this._helpArray.length=s;this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[n+1]=2;this._frameArray[n+2]=s;for(var o=0;o0){var s=this._armature.sortedSlots.length;var o=new Array(s-n.length/2);var l=new Array(s);for(var h=0;h0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.TWEEN_ROTATE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[o++]=this._helpTransform.x;this._frameFloatArray[o++]=this._helpTransform.y;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=this._helpTransform.skew;this._frameFloatArray[o++]=this._helpTransform.scaleX;this._frameFloatArray[o++]=this._helpTransform.scaleY;this._parseActionDataInFrame(e,a,this._bone,this._slot);return s};r.prototype._parseBoneTranslateFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,0);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,0);return n};r.prototype._parseBoneRotateFrame=function(e,a,i){var n=r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;if(a!==0){if(this._prevClockwise===0){n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation)}else{if(this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.CLOCK_WISE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD;return s};r.prototype._parseBoneScaleFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,1);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,1);return n};r.prototype._parseSurfaceFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=e[t.DataParser.VERTICES];var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._surface.vertices.length/2;var f=0;var u=0;this._frameFloatArray.length+=h*2;for(var _=0;_=o.length){f=0}else{f=o[_-l]}if(_+1=o.length){u=0}else{u=o[_+1-l]}this._frameFloatArray[n+_]=f;this._frameFloatArray[n+_+1]=u}if(a===0){var c=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[c+0]=0;this._frameIntArray[c+1]=this._frameFloatArray.length-n;this._frameIntArray[c+2]=this._frameFloatArray.length-n;this._frameIntArray[c+3]=0;this._frameIntArray[c+4]=n-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=c-this._animation.frameIntOffset}return s};r.prototype._parseSlotDisplayFrame=function(e,a,i){var n=this._parseFrame(e,a,i);this._frameArray.length+=1;if(t.DataParser.VALUE in e){this._frameArray[n+1]=r._getNumber(e,t.DataParser.VALUE,0)}else{this._frameArray[n+1]=r._getNumber(e,t.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(e,a,this._slot.parent,this._slot);return n};r.prototype._parseSlotColorFrame=function(e,a,r){var i=this._parseTweenFrame(e,a,r);var n=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){o;this._parseColorTransform(s,this._helpColorTransform);n=this._intArray.length;this._intArray.length+=8;this._intArray[n++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.redMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.alphaOffset);this._intArray[n++]=Math.round(this._helpColorTransform.redOffset);this._intArray[n++]=Math.round(this._helpColorTransform.greenOffset);this._intArray[n++]=Math.round(this._helpColorTransform.blueOffset);n-=8;break}}if(n<0){if(this._defaultColorOffset<0){this._defaultColorOffset=n=this._intArray.length;this._intArray.length+=8;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=0;this._intArray[n++]=0;this._intArray[n++]=0;this._intArray[n++]=0}n=this._defaultColorOffset}var l=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[l]=n;return i};r.prototype._parseSlotFFDFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null;var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._intArray[this._mesh.vertices.offset+0];var f=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var u=this._mesh.vertices.weight;var _=0;var c=0;var p=0;var m=0;if(u!==null){var d=this._weightSlotPose[f];this._helpMatrixA.copyFromArray(d,0);this._frameFloatArray.length+=u.count*2;p=u.offset+2+u.bones.length}else{this._frameFloatArray.length+=h*2}for(var v=0;v=o.length){_=0}else{_=o[v-l]}if(v+1=o.length){c=0}else{c=o[v+1-l]}}if(u!==null){var y=this._weightBonePoses[f];var g=this._intArray[p++];this._helpMatrixA.transformPoint(_,c,this._helpPoint,true);_=this._helpPoint.x;c=this._helpPoint.y;for(var b=0;b=0||t.DataParser.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);s.version=i;s.name=r._getString(e,t.DataParser.NAME,"");s.frameRate=r._getNumber(e,t.DataParser.FRAME_RATE,24);if(s.frameRate===0){s.frameRate=24}if(t.DataParser.ARMATURE in e){this._data=s;this._parseArray(e);var o=e[t.DataParser.ARMATURE];for(var l=0,h=o;l0){s.stage=s.getArmature(s.armatureNames[0])}this._data=null}if(t.DataParser.TEXTURE_ATLAS in e){this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]}return s}else{console.assert(false,"Nonsupport data version: "+i+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};r.prototype.parseTextureAtlasData=function(e,a,i){if(i===void 0){i=1}console.assert(e!==undefined);if(e===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(n,a,i);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}a.width=r._getNumber(e,t.DataParser.WIDTH,0);a.height=r._getNumber(e,t.DataParser.HEIGHT,0);a.scale=i===1?1/r._getNumber(e,t.DataParser.SCALE,1):i;a.name=r._getString(e,t.DataParser.NAME,"");a.imagePath=r._getString(e,t.DataParser.IMAGE_PATH,"");if(t.DataParser.SUB_TEXTURE in e){var s=e[t.DataParser.SUB_TEXTURE];for(var o=0,l=s.length;o0&&_>0){f.frame=t.TextureData.createRectangle();f.frame.x=r._getNumber(h,t.DataParser.FRAME_X,0);f.frame.y=r._getNumber(h,t.DataParser.FRAME_Y,0);f.frame.width=u;f.frame.height=_}a.addTexture(f)}}return true};r.getInstance=function(){if(r._objectDataParserInstance===null){r._objectDataParserInstance=new r}return r._objectDataParserInstance};r._objectDataParserInstance=null;return r}(t.DataParser);t.ObjectDataParser=e;var a=function(){function t(){this.frameStart=0;this.actions=[]}return t}();t.ActionFrame=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.prototype._inRange=function(t,e,a){return e<=t&&t<=a};a.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var f=0;while(t.length>i){var u=t[i++];if(u===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(u,0,127)){s=u}else{if(this._inRange(u,194,223)){l=1;f=128;o=u-192}else if(this._inRange(u,224,239)){l=2;f=2048;o=u-224}else if(this._inRange(u,240,244)){l=3;f=65536;o=u-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(u,128,191)){o=0;l=0;h=0;f=0;i--;s=u}else{h+=1;o=o+(u-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var c=f;o=0;l=0;h=0;f=0;if(this._inRange(_,c,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=u}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};a.prototype._getUTF16Key=function(t){for(var e=0,a=t.length;e255){return encodeURI(t)}}return t};a.prototype._parseBinaryTimeline=function(e,a,r){if(r===void 0){r=null}var i=r!==null?r:t.BaseObject.borrowObject(t.TimelineData);i.type=e;i.offset=a;this._timeline=i;var n=this._timelineArrayBuffer[i.offset+2];if(n===1){i.frameIndicesOffset=-1}else{var s=0;var o=this._animation.frameCount+1;var l=this._data.frameIndices;if(t.DragonBones.webAssembly){s=l.size();l.resize(s+o,0)}else{s=l.length;l.length+=o}i.frameIndicesOffset=s;for(var h=0,f=0,u=0,_=0;h=0){var i=t.BaseObject.borrowObject(t.WeightData);var n=this._intArrayBuffer[a.offset+0];var s=this._intArrayBuffer[r+0];i.offset=r;for(var o=0;o0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};e.prototype._buildBones=function(e,a){for(var r=0,i=e.armature.sortedBones;r0){o.texture=this._getTextureData(e.textureAtlasName,a.path)}if(r!==null&&r.type===2&&this._isSupportMesh()){s=i.meshDisplay}else{s=i.rawDisplay}break}case 2:{var l=a;if(l.texture===null){l.texture=this._getTextureData(n,l.path)}else if(e!==null&&e.textureAtlasName.length>0){l.texture=this._getTextureData(e.textureAtlasName,l.path)}if(this._isSupportMesh()){s=i.meshDisplay}else{s=i.rawDisplay}break}case 1:{var h=a;var f=this._buildChildArmature(e,i,a);if(f!==null){f.inheritAnimation=h.inheritAnimation;if(!f.inheritAnimation){var u=h.actions.length>0?h.actions:f.armatureData.defaultActions;if(u.length>0){for(var _=0,c=u;_=0){continue}var f=a.getDisplays(h.name);if(!f){if(s!==null&&a!==s){f=s.getDisplays(h.name)}if(!f){if(r){h.rawDisplayDatas=null;h.displayList=[]}continue}}var u=t.DragonBones.webAssembly?f.size():f.length;var _=h.displayList;_.length=u;for(var c=0,p=u;c0?this.width:e.width;var r=this.height>0?this.height:e.height;for(var i in this.textures){var n=egret.$TextureScaleFactor;var s=this.textures[i];var o=s.region.width;var l=s.region.height;if(s.renderTexture===null){s.renderTexture=new egret.Texture}s.renderTexture.bitmapData=e;if(s.rotated){s.renderTexture.$initData(s.region.x*n,s.region.y*n,l*n,o*n,0,0,l*n,o*n,a,r,s.rotated)}else{s.renderTexture.$initData(s.region.x*n,s.region.y*n,o*n,l*n,0,0,o*n,l*n,a,r)}}}else{for(var i in this.textures){var s=this.textures[i];s.renderTexture=null}}},enumerable:true,configurable:true});r.prototype.dispose=function(){console.warn("已废弃。");this.returnToPool()};Object.defineProperty(r.prototype,"texture",{get:function(){console.warn("已废弃。");return this.renderTexture},enumerable:true,configurable:true});return r}(t.TextureAtlasData);t.EgretTextureAtlasData=e;var a=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.renderTexture=null;return e}e.toString=function(){return"[class dragonBones.EgretTextureData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);if(this.renderTexture!==null){}this.renderTexture=null};return e}(t.TextureData);t.EgretTextureData=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}Object.defineProperty(a.prototype,"eventObject",{get:function(){return this.data},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationName",{get:function(){var t=this.eventObject.animationState;return t!==null?t.name:""},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"armature",{get:function(){return this.eventObject.armature},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"bone",{get:function(){return this.eventObject.bone},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"slot",{get:function(){return this.eventObject.slot},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationState",{get:function(){return this.eventObject.animationState},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"frameLabel",{get:function(){return this.eventObject.name},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"sound",{get:function(){return this.eventObject.name},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"movementID",{get:function(){return this.animationName},enumerable:true,configurable:true});a.START=t.EventObject.START;a.LOOP_COMPLETE=t.EventObject.LOOP_COMPLETE;a.COMPLETE=t.EventObject.COMPLETE;a.FADE_IN=t.EventObject.FADE_IN;a.FADE_IN_COMPLETE=t.EventObject.FADE_IN_COMPLETE;a.FADE_OUT=t.EventObject.FADE_OUT;a.FADE_OUT_COMPLETE=t.EventObject.FADE_OUT_COMPLETE;a.FRAME_EVENT=t.EventObject.FRAME_EVENT;a.SOUND_EVENT=t.EventObject.SOUND_EVENT;a.ANIMATION_FRAME_EVENT=t.EventObject.FRAME_EVENT;a.BONE_FRAME_EVENT=t.EventObject.FRAME_EVENT;a.MOVEMENT_FRAME_EVENT=t.EventObject.FRAME_EVENT;a.SOUND=t.EventObject.SOUND_EVENT;return a}(egret.Event);t.EgretEvent=e;var a=function(a){__extends(r,a);function r(){var t=a!==null&&a.apply(this,arguments)||this;t.debugDraw=false;t._batchEnabled=!(global["nativeRender"]||global["bricks"]);t._childDirty=true;t._debugDraw=false;t._armature=null;t._bounds=null;t._debugDrawer=null;return t}r._cleanBeforeRender=function(){};r.prototype.dbInit=function(t){this._armature=t;if(this._batchEnabled){this.$renderNode=new egret.sys.GroupNode;this.$renderNode.cleanBeforeRender=r._cleanBeforeRender}};r.prototype.dbClear=function(){this._armature=null;this._bounds=null;this._debugDrawer=null};r.prototype.dbUpdate=function(){var e=t.DragonBones.debugDraw||this.debugDraw;if(e||this._debugDraw){this._debugDraw=e;if(this._debugDraw){if(this._debugDrawer===null){this._debugDrawer=new egret.Sprite}if(this._debugDrawer.parent!==this){this.addChild(this._debugDrawer)}var a=2;var r=this._debugDrawer.graphics;r.clear();for(var i=0,n=this._armature.getBones();i0){i.setTo(999999,999999,-999999,-999999);for(var u=0,_=f.length;u<_;u+=2){var c=f[u];var p=f[u+1];if(i.x>c)i.x=c;if(i.widthp)i.y=p;if(i.heighte.width){e.width=g}if(b>e.height){e.height=b}}}e.width-=e.x;e.height-=e.y;if(t.isV5){if(this._bounds===null){this._bounds=new egret.Rectangle}this._bounds.copyFrom(e)}}else if(t.isV5){if(this._bounds===null){this._bounds=new egret.Rectangle}e.copyFrom(this._bounds)}return e}return a.prototype.$measureContentBounds.call(this,e)};r.prototype.hasEvent=function(t){return this.hasDBEventListener(t)};r.prototype.addEvent=function(t,e,a){this.addDBEventListener(t,e,a)};r.prototype.removeEvent=function(t,e,a){this.removeDBEventListener(t,e,a)};r.prototype.advanceTimeBySelf=function(e){if(e){this._armature.clock=t.EgretFactory.factory.clock}else{this._armature.clock=null}};return r}(egret.DisplayObjectContainer);t.EgretArmatureDisplay=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(e);t.Event=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(e);t.ArmatureEvent=i;var n=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(e);t.AnimationEvent=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(e);t.FrameEvent=s;var o=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(e);t.SoundEvent=o;var l=function(e){__extends(a,e);function a(a,r,i){if(i===void 0){i=1}var n=e.call(this)||this;console.warn("已废弃");n._onClear();t.ObjectDataParser.getInstance().parseTextureAtlasData(r,n,i);n.renderTexture=a;return n}a.toString=function(){return"[class dragonBones.EgretTextureAtlas]"};return a}(t.EgretTextureAtlasData);t.EgretTextureAtlas=l;var h=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(l);t.EgretSheetAtlas=h;var f=function(){function e(){}e.getInstance=function(){console.warn("已废弃");return t.EgretFactory.factory.soundEventManager};return e}();t.SoundEventManager=f;var u=function(){function t(){console.warn("已废弃")}return t}();t.AnimationCacheManager=u})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.transformUpdateEnabled=false;t._armatureDisplay=null;t._renderDisplay=null;t._colorFilter=null;return t}a.toString=function(){return"[class dragonBones.EgretSlot]"};a.prototype.init=function(a,r,i,n){e.prototype.init.call(this,a,r,i,n);if(t.isV5){this._updateTransform=this._updateTransformV5}else{this._updateTransform=this._updateTransformV4}};a.prototype._onClear=function(){e.prototype._onClear.call(this);this._armatureDisplay=null;this._renderDisplay=null;this._colorFilter=null};a.prototype._initDisplay=function(t,e){t;e};a.prototype._disposeDisplay=function(t,e){t;e};a.prototype._onUpdateDisplay=function(){this._armatureDisplay=this._armature.display;this._renderDisplay=this._display!==null?this._display:this._rawDisplay;if(t.isV5&&this._armatureDisplay._batchEnabled){if(this._renderDisplay===this._rawDisplay&&!(this._renderDisplay.$renderNode instanceof egret.sys.BitmapNode)){this._renderDisplay.$renderNode=new egret.sys.BitmapNode}}if(this._armatureDisplay._batchEnabled){if(this._renderDisplay!==this._rawDisplay&&this._renderDisplay!==this._meshDisplay){this._armatureDisplay.disableBatch()}else{var e=this._renderDisplay.$renderNode;if(!e.matrix){e.matrix=new egret.Matrix}}}};a.prototype._addDisplay=function(){if(this._armatureDisplay._batchEnabled){this._armatureDisplay.$renderNode.addNode(this._renderDisplay.$renderNode)}else{this._armatureDisplay.addChild(this._renderDisplay)}};a.prototype._replaceDisplay=function(t){var e=t;if(this._armatureDisplay._batchEnabled){var a=this._armatureDisplay.$renderNode.drawData;a[a.indexOf(e.$renderNode)]=this._renderDisplay.$renderNode}else{this._armatureDisplay.addChild(this._renderDisplay);this._armatureDisplay.swapChildren(this._renderDisplay,e);this._armatureDisplay.removeChild(e)}};a.prototype._removeDisplay=function(){if(this._armatureDisplay._batchEnabled){var t=this._armatureDisplay.$renderNode.drawData;t.splice(t.indexOf(this._renderDisplay.$renderNode),1)}else{this._renderDisplay.parent.removeChild(this._renderDisplay)}};a.prototype._updateZOrder=function(){if(this._armatureDisplay._batchEnabled){var t=this._armatureDisplay.$renderNode.drawData;t[this._zOrder]=this._renderDisplay.$renderNode}else{var e=this._armatureDisplay.getChildIndex(this._renderDisplay);if(e===this._zOrder){return}this._armatureDisplay.addChildAt(this._renderDisplay,this._zOrder)}};a.prototype._updateVisible=function(){var t=this._parent.visible&&this._visible;if(this._armatureDisplay._batchEnabled){var e=this._renderDisplay.$renderNode;e.alpha=t?1:0}else{this._renderDisplay.visible=t}};a.prototype._updateBlendMode=function(){switch(this._blendMode){case 0:this._renderDisplay.blendMode=egret.BlendMode.NORMAL;break;case 1:this._renderDisplay.blendMode=egret.BlendMode.ADD;break;case 5:this._renderDisplay.blendMode=egret.BlendMode.ERASE;break;default:break}if(this._armatureDisplay._batchEnabled){var t=this._renderDisplay.$renderNode;t.blendMode=egret.sys.blendModeToNumber(this._renderDisplay.blendMode)}};a.prototype._updateColor=function(){if(this._colorTransform.redMultiplier!==1||this._colorTransform.greenMultiplier!==1||this._colorTransform.blueMultiplier!==1||this._colorTransform.redOffset!==0||this._colorTransform.greenOffset!==0||this._colorTransform.blueOffset!==0||this._colorTransform.alphaOffset!==0){if(this._colorFilter===null){this._colorFilter=new egret.ColorMatrixFilter}var t=this._colorFilter.matrix;t[0]=this._colorTransform.redMultiplier;t[6]=this._colorTransform.greenMultiplier;t[12]=this._colorTransform.blueMultiplier;t[18]=this._colorTransform.alphaMultiplier;t[4]=this._colorTransform.redOffset;t[9]=this._colorTransform.greenOffset;t[14]=this._colorTransform.blueOffset;t[19]=this._colorTransform.alphaOffset;this._colorFilter.matrix=t;if(this._armatureDisplay._batchEnabled){var e=this._renderDisplay.$renderNode;e.filter=this._colorFilter;e.alpha=1}var a=this._renderDisplay.filters;if(!a){a=[]}if(a.indexOf(this._colorFilter)<0){a.push(this._colorFilter)}this._renderDisplay.filters=a;this._renderDisplay.alpha=1}else{if(this._armatureDisplay._batchEnabled){var e=this._renderDisplay.$renderNode;e.filter=null;e.alpha=this._colorTransform.alphaMultiplier}this._renderDisplay.filters=null;this._renderDisplay.alpha=this._colorTransform.alphaMultiplier}};a.prototype._updateFrame=function(){var e=this._deformVertices!==null&&this._display===this._meshDisplay?this._deformVertices.verticesData:null;var a=this._textureData;if(this._displayIndex>=0&&this._display!==null&&a!==null){if(this._armature.replacedTexture!==null&&this._rawDisplayDatas!==null&&this._rawDisplayDatas.indexOf(this._displayData)>=0){var r=a.parent;if(this._armature._replaceTextureAtlasData===null){r=t.BaseObject.borrowObject(t.EgretTextureAtlasData);r.copyFrom(a.parent);r.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=r}else{r=this._armature._replaceTextureAtlasData}a=r.getTexture(a.name)}if(a.renderTexture!==null){if(e!==null){var i=e.data;var n=i.intArray;var s=i.floatArray;var o=n[e.offset+0];var l=n[e.offset+1];var h=n[e.offset+2];if(h<0){h+=65536}var f=h+o*2;var u=this._armature._armatureData.scale;var _=this._renderDisplay;var c=_.$renderNode;c.uvs.length=o*2;c.vertices.length=o*2;c.indices.length=l*3;for(var p=0,m=o*2;p0&&i.inheritDeform;var o=this._renderDisplay;var l=o.$renderNode;if(n!==null){var h=i.data;var f=h.intArray;var u=h.floatArray;var _=f[i.offset+0];var c=f[n.offset+1];if(c<0){c+=65536}for(var p=0,m=0,d=n.offset+2+r.length,v=c,y=0;p<_;++p){var g=f[d++];var b=0,D=0;for(var T=0;T=5.1;var e=function(e){__extends(a,e);function a(r){if(r===void 0){r=null}var i=e.call(this,r)||this;if(a._dragonBonesInstance===null){var n=new t.EgretArmatureDisplay;a._dragonBonesInstance=new t.DragonBones(n);a._time=egret.getTimer()*.001;egret.startTick(a._clockHandler,a)}i._dragonBones=a._dragonBonesInstance;return i}a._clockHandler=function(t){t*=.001;var e=t-this._time;a._dragonBonesInstance.advanceTime(e);this._time=t;return false};Object.defineProperty(a,"factory",{get:function(){if(a._factory===null){a._factory=new a}return a._factory},enumerable:true,configurable:true});a.prototype._isSupportMesh=function(){if(egret.Capabilities.renderMode==="webgl"||egret.Capabilities.runtimeType===egret.RuntimeType.NATIVE){return true}console.warn("Canvas can not support mesh, please change renderMode to webgl.");return false};a.prototype._buildTextureAtlasData=function(e,a){if(e!==null){if(a instanceof egret.Texture){e.renderTexture=a}else{var r=new egret.Texture;r.bitmapData=new egret.BitmapData(a);e.disposeEnabled=true;e.renderTexture=r}}else{e=t.BaseObject.borrowObject(t.EgretTextureAtlasData)}return e};a.prototype._buildArmature=function(e){var a=t.BaseObject.borrowObject(t.Armature);var r=new t.EgretArmatureDisplay;a.init(e.armature,r,r,this._dragonBones);return a};a.prototype._buildSlot=function(e,a,r){e;var i=t.BaseObject.borrowObject(t.EgretSlot);i.init(a,r,new egret.Bitmap,new egret.Mesh);return i};a.prototype.buildArmatureDisplay=function(t,e,a,r){if(e===void 0){e=""}if(a===void 0){a=""}if(r===void 0){r=""}var i=this.buildArmature(t,e||"",a||"",r||"");if(i!==null){this._dragonBones.clock.add(i);return i.display}return null};a.prototype.getTextureDisplay=function(t,e){if(e===void 0){e=null}var a=this._getTextureData(e!==null?e:"",t);if(a!==null&&a.renderTexture!==null){var r=a.renderTexture;var i=new egret.Bitmap(r);i.width=r.textureWidth*a.parent.scale;i.height=r.textureHeight*a.parent.scale;return i}return null};Object.defineProperty(a.prototype,"soundEventManager",{get:function(){return this._dragonBones.eventManager},enumerable:true,configurable:true});Object.defineProperty(a,"clock",{get:function(){return a.factory.clock},enumerable:true,configurable:true});a.prototype.addSkeletonData=function(t,e){if(e===void 0){e=null}console.warn("已废弃");this.addDragonBonesData(t,e)};a.prototype.getSkeletonData=function(t){console.warn("已废弃");return this.getDragonBonesData(t)};a.prototype.removeSkeletonData=function(t){console.warn("已废弃");this.removeDragonBonesData(t)};a.prototype.addTextureAtlas=function(t,e){if(e===void 0){e=null}console.warn("已废弃");this.addTextureAtlasData(t,e)};a.prototype.getTextureAtlas=function(t){console.warn("已废弃");return this.getTextureAtlasData(t)};a.prototype.removeTextureAtlas=function(t){console.warn("已废弃");this.removeTextureAtlasData(t)};a.prototype.buildFastArmature=function(t,e,a){if(e===void 0){e=""}if(a===void 0){a=""}console.warn("已废弃");return this.buildArmature(t,e||"",a||"")};a.prototype.dispose=function(){console.warn("已废弃");this.clear()};a._time=0;a._dragonBonesInstance=null;a._factory=null;return a}(t.BaseFactory);t.EgretFactory=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=new egret.Rectangle;var a=new egret.Matrix;var r={};function i(t,e){for(var a=0,r=t.length;a=0){e.displayConfig=this._groupConfig.display[e.displayIndex];if(e.displayConfig.type===1){var i=e.displayConfig.name in e.childMovies?e.childMovies[e.displayConfig.name]:null;if(!i){i=f(e.displayConfig.name,this._groupConfig.name);if(i){e.childMovies[e.displayConfig.name]=i}}if(i){e.display=i;e.childMovie=i}else{e.display=e.rawDisplay;e.childMovie=null}}else{e.display=e.rawDisplay;e.childMovie=null}}else{e.displayConfig=null;e.display=e.rawDisplay;e.childMovie=null}if(e.display!==a){if(a){this.addChild(e.display);this.swapChildren(e.display,a);this.removeChild(a)}this._updateSlotBlendMode(e)}if(e.display===e.rawDisplay){if(e.displayConfig&&e.displayConfig.regionIndex!==null&&e.displayConfig.regionIndex!==undefined){if(!e.displayConfig.texture){var n=this._groupConfig.textures[e.displayConfig.textureIndex||0];var s=e.displayConfig.regionIndex*4;var o=this._groupConfig.rectangleArray[s];var l=this._groupConfig.rectangleArray[s+1];var h=this._groupConfig.rectangleArray[s+2];var u=this._groupConfig.rectangleArray[s+3];e.displayConfig.texture=new egret.Texture;e.displayConfig.texture.bitmapData=n.bitmapData;e.displayConfig.texture.$initData(o,l,Math.min(h,n.textureWidth-o),Math.min(u,n.textureHeight-l),0,0,Math.min(h,n.textureWidth-o),Math.min(u,n.textureHeight-l),n.textureWidth,n.textureHeight)}if(this._batchEnabled){var _=e.displayConfig.texture;var c=e.rawDisplay.$renderNode;egret.sys.RenderNode.prototype.cleanBeforeRender.call(e.rawDisplay.$renderNode);c.image=_.bitmapData;if(t.isV5){c.drawImage(_.$bitmapX,_.$bitmapY,_.$bitmapWidth,_.$bitmapHeight,_.$offsetX,_.$offsetY,_.textureWidth,_.textureHeight);c.imageWidth=_._sourceWidth;c.imageHeight=_._sourceHeight}else{var p=_;c.drawImage(p._bitmapX,p._bitmapY,p._bitmapWidth,p._bitmapHeight,p._offsetX,p._offsetY,_.textureWidth,_.textureHeight);c.imageWidth=p._sourceWidth;c.imageHeight=p._sourceHeight}}else{e.rawDisplay.visible=true;e.rawDisplay.$setBitmapData(e.displayConfig.texture)}}else{if(this._batchEnabled){e.rawDisplay.$renderNode.image=null}else{e.rawDisplay.visible=false;e.rawDisplay.$setBitmapData(null)}}}if(e.childMovie!==r){if(r){r.stop();this._childMovies.slice(this._childMovies.indexOf(r),1)}if(e.childMovie){if(this._childMovies.indexOf(e.childMovie)<0){this._childMovies.push(e.childMovie)}if(e.config.action){e.childMovie.play(e.config.action)}else{e.childMovie.play(e.childMovie._config.action)}}}};i.prototype._getSlot=function(t){for(var e=0,a=this._slots.length;e0&&(s>=n||s<=-n)){this._isCompleted=true;o=this._playTimes;if(s<0){s=0}else{s=i}}else{this._isCompleted=false;if(s<0){o=Math.floor(-s/i);s=i- -s%i}else{o=Math.floor(s/i);s%=i}if(this._playTimes>0&&o>this._playTimes){o=this._playTimes}}if(this._currentTime===s){return}var l=Math.floor(s*this._clipConfig.cacheTimeToFrameScale);if(this._cacheFrameIndex!==l){this._cacheFrameIndex=l;var h=this._groupConfig.displayFrameArray;var f=this._groupConfig.transformArray;var u=this._groupConfig.colorArray;var c=true;var p=false;var m=false;var d=this._cacheRectangle;this._cacheRectangle=this._clipConfig.cacheRectangles[this._cacheFrameIndex];if(this._batchEnabled&&!this._cacheRectangle){m=true;this._cacheRectangle=new egret.Rectangle;this._clipConfig.cacheRectangles[this._cacheFrameIndex]=this._cacheRectangle}for(var v=0,y=this._slots.length;v=this._clipArray.length){b=this._frameSize*(this._cacheFrameIndex-1)+v*2}var D=this._clipArray[b]*2;if(D>=0){var T=h[D];var A=h[D+1]*8;var x=this._clipArray[b+1]*6;var P=false;if(g.displayIndex!==T){g.displayIndex=T;P=true;this._updateSlotDisplay(g)}if(g.colorIndex!==A||P){g.colorIndex=A;if(g.colorIndex>=0){this._updateSlotColor(g,u[A]*.01,u[A+1]*.01,u[A+2]*.01,u[A+3]*.01,u[A+4],u[A+5],u[A+6],u[A+7])}else{this._updateSlotColor(g,1,1,1,1,0,0,0,0)}}p=true;if(g.transformIndex!==x){g.transformIndex=x;if(this._batchEnabled){var O=g.display.$renderNode.matrix;if(!O){O=g.display.$renderNode.matrix=new egret.Matrix}O.a=f[x];O.b=f[x+1];O.c=f[x+2];O.d=f[x+3];O.tx=f[x+4];O.ty=f[x+5]}else{a.a=f[x];a.b=f[x+1];a.c=f[x+2];a.d=f[x+3];a.tx=f[x+4];a.ty=f[x+5];g.display.$setMatrix(a)}}if(this._batchEnabled&&m&&g.displayConfig){var O=g.display.$renderNode.matrix;e.x=0;e.y=0;e.width=g.displayConfig.texture.textureWidth;e.height=g.displayConfig.texture.textureHeight;O.$transformBounds(e);if(c){c=false;this._cacheRectangle.x=e.x;this._cacheRectangle.width=e.x+e.width;this._cacheRectangle.y=e.y;this._cacheRectangle.height=e.y+e.height}else{this._cacheRectangle.x=Math.min(this._cacheRectangle.x,e.x);this._cacheRectangle.width=Math.max(this._cacheRectangle.width,e.x+e.width);this._cacheRectangle.y=Math.min(this._cacheRectangle.y,e.y);this._cacheRectangle.height=Math.max(this._cacheRectangle.height,e.y+e.height)}}}else if(g.displayIndex!==-1){g.displayIndex=-1;this._updateSlotDisplay(g)}}if(this._cacheRectangle){if(p&&m&&c&&d){this._cacheRectangle.x=d.x;this._cacheRectangle.y=d.y;this._cacheRectangle.width=d.width;this._cacheRectangle.height=d.height}if(!t.isV5){this.$invalidateContentBounds()}}}if(this._isCompleted){this._isPlaying=false}if(!this._isStarted){this._isStarted=true;if(this.hasEventListener(_.START)){var S=egret.Event.create(_,_.START);S.movie=this;S.clipName=this._clipConfig.name;S.name="";S.slotName="";this.dispatchEvent(S)}}this._isReversing=this._currentTime>s&&this._currentPlayTimes===o;this._currentTime=s;var E=this._clipConfig.frame?this._clipConfig.frame.length:0;if(E>0){var M=Math.floor(this._currentTime*this._config.frameRate);var B=this._groupConfig.frame[this._clipConfig.frame[M]];if(this._currentFrameConfig!==B){if(E>1){var C=this._currentFrameConfig;this._currentFrameConfig=B;if(!C){var w=Math.floor(this._currentTime*this._config.frameRate);C=this._groupConfig.frame[this._clipConfig.frame[w]];if(this._isReversing){}else{if(this._currentTime<=C.position||this._currentPlayTimes!==o){C=this._groupConfig.frame[C.prev]}}}if(this._isReversing){while(C!==B){this._onCrossFrame(C);C=this._groupConfig.frame[C.prev]}}else{while(C!==B){C=this._groupConfig.frame[C.next];this._onCrossFrame(C)}}}else{this._currentFrameConfig=B;if(this._currentFrameConfig){this._onCrossFrame(this._currentFrameConfig)}}}}if(this._currentPlayTimes!==o){this._currentPlayTimes=o;if(this.hasEventListener(_.LOOP_COMPLETE)){var I=egret.Event.create(_,_.LOOP_COMPLETE);I.movie=this;I.clipName=this._clipConfig.name;I.name="";I.slotName="";this.dispatchEvent(I);egret.Event.release(I)}if(this._isCompleted&&this.hasEventListener(_.COMPLETE)){var F=egret.Event.create(_,_.COMPLETE);F.movie=this;F.clipName=this._clipConfig.name;F.name="";F.slotName="";this.dispatchEvent(F);egret.Event.release(F)}}}this._isLockDispose=false;if(this._isDelayDispose){this.dispose()}};i.prototype.play=function(t,e){if(t===void 0){t=null}if(e===void 0){e=-1}if(t){var a=null;for(var r=0,i=this._config.clip.length;r0){for(var e=0,a=this._objects;e0){for(var i=0;ie){r.length=e}n._maxCountMap[a]=e}else{n._defaultMaxCount=e;for(var a in n._poolsMap){var r=n._poolsMap[a];if(r.length>e){r.length=e}if(a in n._maxCountMap){n._maxCountMap[a]=e}}}};n.clearPool=function(t){if(t===void 0){t=null}if(t!==null){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){a.length=0}}else{for(var r in n._poolsMap){var a=n._poolsMap[r];a.length=0}}};n.borrowObject=function(t){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){var r=a.pop();r._isInPool=false;return r}var i=new t;i._onClear();return i};n.prototype.returnToPool=function(){this._onClear();n._returnObject(this)};n._hashCode=0;n._defaultMaxCount=3e3;n._maxCountMap={};n._poolsMap={};return n}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var f=l+t.width;var u=h+t.height;var _=a*l+i*h+s;var m=r*l+n*h+o;var p=a*f+i*h+s;var c=r*f+n*h+o;var d=a*f+i*u+s;var y=r*f+n*u+o;var v=a*l+i*u+s;var g=r*l+n*u+o;var D=0;if(_>p){D=_;_=p;p=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_v?p:v)-t.x);if(m>c){D=m;m=c;c=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(mg?c:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function n(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}n.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};n.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};n.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};n.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};n.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};n.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};n.prototype.fromMatrix=function(t){var e=this.scaleX,a=this.scaleY;var r=n.PI_Q;this.x=t.tx;this.y=t.ty;this.rotation=Math.atan(t.b/t.a);var i=Math.atan(-t.c/t.d);this.scaleX=this.rotation>-r&&this.rotation-r&&i=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(a>=0&&this.scaleY<0){this.scaleY=-this.scaleY;i=i-Math.PI}this.skew=i-this.rotation;return this};n.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};n.PI=Math.PI;n.PI_D=Math.PI*2;n.PI_H=Math.PI/2;n.PI_Q=Math.PI/4;n.RAD_DEG=180/Math.PI;n.DEG_RAD=Math.PI/180;return n}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.ints=[];t.floats=[];t.strings=[];return t}t.toString=function(){return"[class dragonBones.UserData]"};t.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};t.prototype.addInt=function(t){this.ints.push(t)};t.prototype.addFloat=function(t){this.floats.push(t)};t.prototype.addString=function(t){this.strings.push(t)};t.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};t.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};t.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};t.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};t.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};t.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};t.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};t.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};t.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};t.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};t.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};t.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};t.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};t.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};t.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};t.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return t}(a.BaseObject);a.ArmatureData=t;var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.transform=new a.Transform;t.userData=null;return t}t.toString=function(){return"[class dragonBones.BoneData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return t}(a.BaseObject);a.BoneData=e;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.geometry=new a.GeometryData;return t}t.toString=function(){return"[class dragonBones.SurfaceData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return t}(e);a.SurfaceData=r;var i=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}t.createColor=function(){return new a.ColorTransform};t.toString=function(){return"[class dragonBones.SlotData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.zIndex=0;this.alpha=1;this.name="";this.color=null;this.userData=null;this.parent=null};t.DEFAULT_COLOR=new a.ColorTransform;return t}(a.BaseObject);a.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.displays={};return t}t.toString=function(){return"[class dragonBones.SkinData]"};t.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};D.rectangleIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,f){if(l===void 0){l=null}if(h===void 0){h=null}if(f===void 0){f=null}var u=t>i&&tn&&ei&&an&&r=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};D.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=this.width*.5;var l=this.height*.5;var h=D.rectangleIntersectsSegment(t,e,a,r,-o,-l,o,l,i,n,s);return h};return D}(e);t.RectangleBoundingBoxData=h;var a=function(t){__extends(l,t);function l(){return t!==null&&t.apply(this,arguments)||this}l.toString=function(){return"[class dragonBones.EllipseData]"};l.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,f){if(l===void 0){l=null}if(h===void 0){h=null}if(f===void 0){f=null}var u=s/o;var _=u*u;e*=u;r*=u;var m=a-t;var p=r-e;var c=Math.sqrt(m*m+p*p);var d=m/c;var y=p/c;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var b=s*s;var T=b-D+g;var A=0;if(T>=0){var P=Math.sqrt(T);var O=v-P;var S=v+P;var x=O<0?-1:O<=c?0:1;var B=S<0?-1:S<=c?0:1;var E=x*B;if(E<0){return-1}else if(E===0){if(x===-1){A=2;a=t+S*d;r=(e+S*y)/u;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(f!==null){f.x=Math.atan2(r/b*_,a/b);f.y=f.x+Math.PI}}else if(B===1){A=1;t=t+O*d;e=(e+O*y)/u;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(f!==null){f.x=Math.atan2(e/b*_,t/b);f.y=f.x+Math.PI}}else{A=3;if(l!==null){l.x=t+O*d;l.y=(e+O*y)/u;if(f!==null){f.x=Math.atan2(l.y/b*_,l.x/b)}}if(h!==null){h.x=t+S*d;h.y=(e+S*y)/u;if(f!==null){f.y=Math.atan2(h.y/b*_,h.x/b)}}}}}return A};l.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};l.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};l.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=l.ellipseIntersectsSegment(t,e,a,r,0,0,this.width*.5,this.height*.5,i,n,s);return o};return l}(e);t.EllipseBoundingBoxData=a;var r=function(e){__extends(l,e);function l(){var t=e!==null&&e.apply(this,arguments)||this;t.vertices=[];return t}l.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};l.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var f=e-r;var u=t*r-e*a;var _=0;var m=i[l-2];var p=i[l-1];var c=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var b=0;b=m&&B<=T||B>=T&&B<=m)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var E=(u*O-f*S)/x;if((E>=p&&E<=A||E>=A&&E<=p)&&(f===0||E>=e&&E<=r||E>=r&&E<=e)){if(s!==null){var M=B-t;if(M<0){M=-M}if(_===0){c=M;d=M;y=B;v=E;g=B;D=E;if(o!==null){o.x=Math.atan2(A-p,T-m)-Math.PI*.5;o.y=o.x}}else{if(Md){d=M;g=B;D=E;if(o!==null){o.y=Math.atan2(A-p,T-m)-Math.PI*.5}}}_++}else{y=B;v=E;g=B;D=E;_++;if(o!==null){o.x=Math.atan2(A-p,T-m)-Math.PI*.5;o.y=o.x}break}}}m=T;p=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};l.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};l.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;ae._zIndex*1e3+e._zOrder?1:-1};y.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};y.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};y.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};y.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};y.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};y.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};y.prototype.init=function(t,e,a,r){if(this._armatureData!==null){return}this._armatureData=t;this._animation=i.BaseObject.borrowObject(i.Animation);this._proxy=e;this._display=a;this._dragonBones=r;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};y.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty||this._zIndexDirty){this._slots.sort(y._onSortSlots);if(this._zIndexDirty){for(var a=0,r=this._slots.length;a0){for(var f=0,u=this._actions;f0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var T=o?i.y-e:i.x-t;if(T<0){T=-T}if(d===null||Th){h=T;_=n.x;m=n.y;y=D;if(s!==null){c=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=f;i.y=u;if(s!==null){s.x=p}}if(y!==null&&n!==null){n.x=_;n.y=m;if(s!==null){s.y=c}}return d};y.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};t.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};t.prototype.invalidUpdate=function(){this._transformDirty=true};t.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(t.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=a){return this.globalTransformMatrix}i=e>this._kX*(t+a)+c;m=((s*o+s+o+o+_)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=_*(l+2);var g=this._hullCache[4];var D=this._hullCache[5];var b=this._hullCache[2]-(o-_)*g;var T=this._hullCache[3]-(o-_)*D;var A=this._vertices;if(i){this._getAffineTransform(-a,c+f,r-a,f,A[v+l+2],A[v+l+3],b+g,T+D,A[v],A[v+1],P._helpTransform,y,true)}else{this._getAffineTransform(-r,c,r-a,f,b,T,A[v],A[v+1],b+g,T+D,P._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else if(t>=a){if(e<-a||e>=a){return this.globalTransformMatrix}i=e>this._kX*(t-r)+c;m=((s*o+s+_)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=(_+1)*(l+2)-2;var g=this._hullCache[4];var D=this._hullCache[5];var b=this._hullCache[0]+_*g;var T=this._hullCache[1]+_*D;var A=this._vertices;if(i){this._getAffineTransform(r,c+f,r-a,f,b+g,T+D,A[v+l+2],A[v+l+3],b,T,P._helpTransform,y,true)}else{this._getAffineTransform(a,c,r-a,f,A[v],A[v+1],b,T,A[v+l+2],A[v+l+3],P._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else if(e<-a){if(t<-a||t>=a){return this.globalTransformMatrix}i=e>this._kY*(t-p-h)-r;m=((s*o+u)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=u*2;var g=this._hullCache[10];var D=this._hullCache[11];var b=this._hullCache[8]+u*g;var T=this._hullCache[9]+u*D;var A=this._vertices;if(i){this._getAffineTransform(p+h,-a,h,r-a,A[v+2],A[v+3],A[v],A[v+1],b+g,T+D,P._helpTransform,y,true)}else{this._getAffineTransform(p,-r,h,r-a,b,T,b+g,T+D,A[v],A[v+1],P._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else if(e>=a){if(t<-a||t>=a){return this.globalTransformMatrix}i=e>this._kY*(t-p-h)+a;m=((s*o+s+o+u)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=o*(l+2)+u*2;var g=this._hullCache[10];var D=this._hullCache[11];var b=this._hullCache[6]-(s-u)*g;var T=this._hullCache[7]-(s-u)*D;var A=this._vertices;if(i){this._getAffineTransform(p+h,r,h,r-a,b+g,T+D,b,T,A[v+2],A[v+3],P._helpTransform,y,true)}else{this._getAffineTransform(p,a,h,r-a,A[v],A[v+1],A[v+2],A[v+3],b,T,P._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else{i=e>this._k*(t-p-h)+c;m=((s*_+u)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=u*2+_*(l+2);var A=this._vertices;if(i){this._getAffineTransform(p+h,c+f,h,f,A[v+l+4],A[v+l+5],A[v+l+2],A[v+l+3],A[v+2],A[v+3],P._helpTransform,y,true)}else{this._getAffineTransform(p,c,h,f,A[v],A[v+1],A[v+2],A[v+3],A[v+l+2],A[v+l+3],P._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}return y};P.prototype.init=function(t,e){if(this._boneData!==null){return}l.prototype.init.call(this,t,e);var a=t.segmentX;var r=t.segmentY;var i=this._armature.armatureData.parent.intArray[t.geometry.offset+0];var n=1e3;var s=200;this._dX=s*2/a;this._dY=s*2/r;this._k=-this._dY/this._dX;this._kX=-this._dY/(n-s);this._kY=-(n-s)/this._dX;this._vertices.length=i*2;this._deformVertices.length=i*2;this._matrixCahce.length=(a*r+a*2+r*2)*2*7;this._hullCache.length=10;for(var o=0;o=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(h)}if(h&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var f=1e3;var u=200;var _=2*this.global.x;var m=2*this.global.y;var p=P._helpPoint;this.globalTransformMatrix.transformPoint(f,-u,p);this._hullCache[0]=p.x;this._hullCache[1]=p.y;this._hullCache[2]=_-p.x;this._hullCache[3]=m-p.y;this.globalTransformMatrix.transformPoint(0,this._dY,p,true);this._hullCache[4]=p.x;this._hullCache[5]=p.y;this.globalTransformMatrix.transformPoint(u,f,p);this._hullCache[6]=p.x;this._hullCache[7]=p.y;this._hullCache[8]=_-p.x;this._hullCache[9]=m-p.y;this.globalTransformMatrix.transformPoint(this._dX,0,p,true);this._hullCache[10]=p.x;this._hullCache[11]=p.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return P}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(c){var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.deformVertices=[];return t}t.toString=function(){return"[class dragonBones.DisplayFrame]"};t.prototype._onClear=function(){this.rawDisplayData=null;this.displayData=null;this.textureData=null;this.display=null;this.deformVertices.length=0};t.prototype.updateDeformVertices=function(){if(this.rawDisplayData===null||this.deformVertices.length!==0){return}var t;if(this.rawDisplayData.type===2){t=this.rawDisplayData.geometry}else if(this.rawDisplayData.type===4){t=this.rawDisplayData.geometry}else{return}var e=0;if(t.weight!==null){e=t.weight.count*2}else{e=t.data.intArray[t.offset+0]*2}this.deformVertices.length=e;for(var a=0,r=this.deformVertices.length;a=0&&this._displayIndex0){for(var s=0,o=i;s=0&&this._cachedFrameIndices!==null){var r=this._cachedFrameIndices[t];if(r>=0&&this._cachedFrameIndex===r){this._transformDirty=false}else if(r>=0){this._transformDirty=true;this._cachedFrameIndex=r}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._transformDirty){if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform();this._transformDirty=false}};p.prototype.invalidUpdate=function(){this._displayDataDirty=true;this._displayDirty=true;this._transformDirty=true};p.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._updateGlobalTransformMatrix(false);this._transformDirty=false}};p.prototype.replaceRawDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.rawDisplayData!==t){a.deformVertices.length=0;a.rawDisplayData=t;if(a.rawDisplayData===null){var r=this._armature._armatureData.defaultSkin;if(r!==null){var i=r.getDisplays(this._slotData.name);if(i!==null&&e=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.displayData!==t&&a.rawDisplayData!==t){a.displayData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};p.prototype.replaceTextureData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.textureData!==t){a.textureData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};p.prototype.replaceDisplay=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.display!==t){var r=a.display;a.display=t;if(r!==null&&r!==this._rawDisplay&&r!==this._meshDisplay&&!this._hasDisplay(r)){if(r instanceof c.Armature){}else{this._disposeDisplay(r,true)}}if(t!==null&&t!==this._rawDisplay&&t!==this._meshDisplay&&!this._hasDisplay(r)&&!(t instanceof c.Armature)){this._initDisplay(t,true)}if(e===this._displayIndex){this._displayDirty=true}}};p.prototype.containsPoint=function(t,e){if(this._boundingBoxData===null){return false}this.updateTransformAndMatrix();p._helpMatrix.copyFrom(this.globalTransformMatrix);p._helpMatrix.invert();p._helpMatrix.transformPoint(t,e,p._helpPoint);return this._boundingBoxData.containsPoint(p._helpPoint.x,p._helpPoint.y)};p.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}if(this._boundingBoxData===null){return 0}this.updateTransformAndMatrix();p._helpMatrix.copyFrom(this.globalTransformMatrix);p._helpMatrix.invert();p._helpMatrix.transformPoint(t,e,p._helpPoint);t=p._helpPoint.x;e=p._helpPoint.y;p._helpMatrix.transformPoint(a,r,p._helpPoint);a=p._helpPoint.x;r=p._helpPoint.y;var o=this._boundingBoxData.intersectsSegment(t,e,a,r,i,n,s);if(o>0){if(o===1||o===2){if(i!==null){this.globalTransformMatrix.transformPoint(i.x,i.y,i);if(n!==null){n.x=i.x;n.y=i.y}}else if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}}else{if(i!==null){this.globalTransformMatrix.transformPoint(i.x,i.y,i)}if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}}if(s!==null){this.globalTransformMatrix.transformPoint(Math.cos(s.x),Math.sin(s.x),p._helpPoint,true);s.x=Math.atan2(p._helpPoint.y,p._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(s.y),Math.sin(s.y),p._helpPoint,true);s.y=Math.atan2(p._helpPoint.y,p._helpPoint.x)}}return o};p.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]};Object.defineProperty(p.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(p.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(t){var e=this._displayFrames.length;if(et){for(var a=e-1;ad){continue}var T=0;for(;;D++){var A=y[D];if(c>A){continue}if(D===0){T=c/A}else{var P=y[D-1];T=(c-P)/(A-P)}break}if(D!==p){p=D;if(f&&D===m){this._computeVertices(_-4,4,0,u);this._computeVertices(0,4,4,u)}else{this._computeVertices(D*6+2,8,0,u)}}this.addCurvePosition(T,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],l,g,a)}return}if(f){_+=2;u.length=o;this._computeVertices(2,_-4,0,u);this._computeVertices(0,2,_-4,u);u[_-2]=u[0];u[_-1]=u[1]}else{m--;_-=4;u.length=_;this._computeVertices(2,_,0,u)}var O=new Array(m);d=0;var S=u[0],x=u[1],B=0,E=0,M=0,I=0,F=0,w=0;var C,N,R,j,k,L,V,Y;for(var v=0,U=2;vd){continue}for(;;D++){var z=O[D];if(W>z)continue;if(D===0)W/=z;else{var $=O[D-1];W=(W-$)/(z-$)}break}if(D!==p){p=D;var K=D*6;S=u[K];x=u[K+1];B=u[K+2];E=u[K+3];M=u[K+4];I=u[K+5];F=u[K+6];w=u[K+7];C=(S-B*2+M)*.03;N=(x-E*2+I)*.03;R=((B-M)*3-S+F)*.006;j=((E-I)*3-x+w)*.006;k=C*2+R;L=N*2+j;V=(B-S)*.3+C+R*.16666667;Y=(E-x)*.3+N+j*.16666667;G=Math.sqrt(V*V+Y*Y);X[0]=G;for(K=1;K<8;K++){V+=k;Y+=L;k+=R;L+=j;G+=Math.sqrt(V*V+Y*Y);X[K]=G}V+=k;Y+=L;G+=Math.sqrt(V*V+Y*Y);X[8]=G;V+=k+R;Y+=L+j;G+=Math.sqrt(V*V+Y*Y);X[9]=G;H=0}W*=G;for(;;H++){var Z=X[H];if(W>Z)continue;if(H===0)W/=Z;else{var $=X[H-1];W=H+(W-$)/(Z-$)}break}this.addCurvePosition(W*.1,S,x,B,E,M,I,F,w,l,g,a)}};t.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,f,u){if(t===0){h[f]=e;h[f+1]=a;h[f+2]=0;return}if(t===1){h[f]=o;h[f+1]=l;h[f+2]=0;return}var _=1-t;var m=_*_;var p=t*t;var c=m*_;var d=m*t*3;var y=_*p*3;var v=t*p;var g=c*e+d*r+y*n+v*o;var D=c*a+d*i+y*s+v*l;h[f]=g;h[f+1]=D;if(u){h[f+2]=Math.atan2(D-(c*a+d*i+y*s),g-(c*e+d*r+y*n))}else{h[f+2]=0}};t.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?U.Transform.DEG_RAD:-U.Transform.DEG_RAD}}var x=this.rotateMix;var B=this.translateMix;for(var p=0,E=3;p0){var C=v.a,N=v.b,R=v.c,j=v.d,k=void 0,L=void 0,V=void 0;if(h){k=T[E-1]}else{k=Math.atan2(I,M)}k-=Math.atan2(N,C);if(S){L=Math.cos(k);V=Math.sin(k);var Y=d._boneData.length;P+=(Y*(L*C-V*N)-M)*x;O+=(Y*(V*C+L*N)-I)*x}else{k+=A}if(k>U.Transform.PI){k-=U.Transform.PI_D}else if(k<-U.Transform.PI){k+=U.Transform.PI_D}k*=x;L=Math.cos(k);V=Math.sin(k);v.a=L*C-V*N;v.b=V*C+L*N;v.c=L*R-V*j;v.d=V*R+L*j}d.global.fromMatrix(v)}this.dirty=false};t.prototype.invalidUpdate=function(){};return t}(t);U.PathConstraint=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=0}this.time=0;this.timeScale=1;this._systemTime=0;this._animatebles=[];this._clock=null;this.time=t;this._systemTime=(new Date).getTime()*.001}t.prototype.advanceTime=function(t){if(t!==t){t=0}var e=Date.now()*.001;if(t<0){t=e-this._systemTime}this._systemTime=e;if(this.timeScale!==1){t*=this.timeScale}if(t===0){return}if(t<0){this.time-=t}else{this.time+=t}var a=0,r=0,i=this._animatebles.length;for(;a0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&n._subFadeState>0){this._armature._dragonBones.bufferObject(n);this._animationStates.length=0;this._lastAnimationState=null}else{var s=n.animationData;var o=s.cacheFrameRate;if(this._animationDirty&&o>0){this._animationDirty=false;for(var l=0,h=this._armature.getBones();l0){var p=m.getDisplayFrameAt(0).rawDisplayData;if(p!==null&&p.parent===this._armature.armatureData.defaultSkin){m._cachedFrameIndices=s.getSlotCachedFrameIndices(m.name);continue}}m._cachedFrameIndices=null}}n.advanceTime(t,o)}}else if(i>1){for(var c=0,d=0;c0&&n._subFadeState>0){d++;this._armature._dragonBones.bufferObject(n);this._animationDirty=true;if(this._lastAnimationState===n){this._lastAnimationState=null}}else{if(d>0){this._animationStates[c-d]=n}n.advanceTime(t,0)}if(c===i-1&&d>0){this._animationStates.length-=d;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};t.prototype.reset=function(){for(var t=0,e=this._animationStates;t0){if(t.position<0){t.position%=a.duration;t.position=a.duration-t.position}else if(t.position===a.duration){t.position-=1e-6}else if(t.position>a.duration){t.position%=a.duration}if(t.duration>0&&t.position+t.duration>a.duration){t.duration=a.duration-t.position}if(t.playTimes<0){t.playTimes=a.playTimes}}else{t.playTimes=1;t.position=0;if(t.duration>0){t.duration=0}}if(t.duration===0){t.duration=-1}this._fadeOut(t);var s=g.BaseObject.borrowObject(g.AnimationState);s.init(this._armature,a,t);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var o=false;for(var l=0,h=this._animationStates.length;lthis._animationStates[l].layer){o=true;this._animationStates.splice(l,0,s);break}else if(l!==h-1&&s.layer>this._animationStates[l+1].layer){o=true;this._animationStates.splice(l+1,0,s);break}}if(!o){this._animationStates.push(s)}}else{this._animationStates.push(s)}for(var f=0,u=this._armature.getSlots();f0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};t.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.frameCount>0?r.duration*e/r.frameCount:0}return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};t.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};t.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};t.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};t.prototype.getBlendState=function(t,e,a){if(!(t in this._blendStates)){this._blendStates[t]={}}var r=this._blendStates[t];if(!(e in r)){var i=r[e]=g.BaseObject.borrowObject(g.BlendState);i.target=a}return r[e]};t.prototype.getState=function(t,e){if(e===void 0){e=-1}var a=this._animationStates.length;while(a--){var r=this._animationStates[a];if(r.name===t&&(e<0||r.layer===e)){return r}}return null};t.prototype.hasAnimation=function(t){return t in this._animations};t.prototype.getStates=function(){return this._animationStates};Object.defineProperty(t.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});return t}(g.BaseObject);g.Animation=t})(dragonBones||(dragonBones={}));var dragonBones;(function(G){var t=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t._boneMask=[];t._boneTimelines=[];t._boneBlendTimelines=[];t._slotTimelines=[];t._slotBlendTimelines=[];t._constraintTimelines=[];t._animationTimelines=[];t._poseTimelines=[];t._actionTimeline=null;t._zOrderTimeline=null;return t}t.toString=function(){return"[class dragonBones.AnimationState]"};t.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0){this._boneTimelines.splice(v,1);r.returnToPool()}v=this._boneBlendTimelines.indexOf(r);if(v>=0){this._boneBlendTimelines.splice(v,1);r.returnToPool()}}}}{var g={};var D=[];for(var b=0,T=this._slotTimelines;b=0){this._slotTimelines.splice(v,1);r.returnToPool()}v=this._slotBlendTimelines.indexOf(r);if(v>=0){this._slotBlendTimelines.splice(v,1);r.returnToPool()}}}}};t.prototype._advanceFadeTime=function(t){var e=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var a=this._parent===null&&this.actionEnabled;if(a){var r=e?G.EventObject.FADE_OUT:G.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=G.BaseObject.borrowObject(G.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}}if(t<0){t=-t}this._fadeTime+=t;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=e?0:1}else if(this._fadeTime>0){this._fadeProgress=e?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=e?1:0}if(this._subFadeState>0){if(!e){this._playheadState|=1;this._fadeState=0}var a=this._parent===null&&this.actionEnabled;if(a){var r=e?G.EventObject.FADE_OUT_COMPLETE:G.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=G.BaseObject.borrowObject(G.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}}};t.prototype.init=function(t,e,a){if(this._armature!==null){return}this._armature=t;this._animationData=e;this.resetToPose=a.resetToPose;this.additive=a.additive;this.displayControl=a.displayControl;this.actionEnabled=a.actionEnabled;this.blendType=e.blendType;this.layer=a.layer;this.playTimes=a.playTimes;this.timeScale=a.timeScale;this.fadeTotalTime=a.fadeInTime;this.autoFadeOutTime=a.autoFadeOutTime;this.name=a.name.length>0?a.name:a.animation;this.group=a.group;this._weight=a.weight;if(a.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(a.duration<0){this._position=0;this._duration=this._animationData.duration;if(a.position!==0){if(this.timeScale>=0){this._time=a.position}else{this._time=a.position-this._duration}}else{this._time=0}}else{this._position=a.position;this._duration=a.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(a.boneMask.length>0){this._boneMask.length=a.boneMask.length;for(var r=0,i=this._boneMask.length;r0;var i=true;var n=true;var s=this._time;this._weightResult=this._weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(this._weight===0){return}if(r){var o=e*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*e);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){var h=false;var f=null;if(n){for(var u=0,_=this._boneTimelines.length;u<_;++u){var m=this._boneTimelines[u];if(m.playState<=0){m.update(s)}if(m.target!==f){var p=m.target;h=p.update(this);f=p;if(p.dirty===1){var c=p.target.animationPose;c.x=0;c.y=0;c.rotation=0;c.skew=0;c.scaleX=1;c.scaleY=1}}if(h){m.blend(a)}}}for(var u=0,_=this._boneBlendTimelines.length;u<_;++u){var m=this._boneBlendTimelines[u];if(m.playState<=0){m.update(s)}if(m.target.update(this)){m.blend(a)}}if(this.displayControl){for(var u=0,_=this._slotTimelines.length;u<_;++u){var m=this._slotTimelines[u];if(m.playState<=0){var d=m.target;var y=d.displayController;if(y===null||y===this.name||y===this.group){m.update(s)}}}}for(var u=0,_=this._slotBlendTimelines.length;u<_;++u){var m=this._slotBlendTimelines[u];if(m.playState<=0){var p=m.target;m.update(s);if(p.update(this)){m.blend(a)}}}for(var u=0,_=this._constraintTimelines.length;u<_;++u){var m=this._constraintTimelines[u];if(m.playState<=0){m.update(s)}}if(this._animationTimelines.length>0){var v=100;var g=100;var D=null;var b=null;for(var u=0,_=this._animationTimelines.length;u<_;++u){var m=this._animationTimelines[u];if(m.playState<=0){m.update(s)}if(this.blendType===1){var T=m.target;var A=this.parameterX-T.positionX;if(A>=0){if(A0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var P=0,O=this._poseTimelines;P=0){this._boneTimelines.splice(S,1);m.returnToPool();continue}S=this._boneBlendTimelines.indexOf(m);if(S>=0){this._boneBlendTimelines.splice(S,1);m.returnToPool();continue}S=this._slotTimelines.indexOf(m);if(S>=0){this._slotTimelines.splice(S,1);m.returnToPool();continue}S=this._slotBlendTimelines.indexOf(m);if(S>=0){this._slotBlendTimelines.splice(S,1);m.returnToPool();continue}S=this._constraintTimelines.indexOf(m);if(S>=0){this._constraintTimelines.splice(S,1);m.returnToPool();continue}}this._poseTimelines.length=0}}if(this._actionTimeline.playState>0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};t.prototype.play=function(){this._playheadState=3};t.prototype.stop=function(){this._playheadState&=1};t.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};t.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};t.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,f=i;h0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&this._parent===null){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.dirty++;this.layer=e;this.leftWeight=0;this.blendWeight=0;return false}this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}a*=this.leftWeight;this.dirty++;this.blendWeight=a;this.layerWeight+=this.blendWeight;return true}return false}this.dirty++;this.layer=e;this.leftWeight=1;this.blendWeight=a;this.layerWeight=a;return true};e.prototype.reset=function(){this.dirty=0;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};e.BONE_TRANSFORM="boneTransform";e.BONE_ALPHA="boneAlpha";e.SURFACE="surface";e.SLOT_DEFORM="slotDeform";e.SLOT_ALPHA="slotAlpha";e.SLOT_Z_INDEX="slotZIndex";return e}(G.BaseObject);G.BlendState=H})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.dirty=false;this.playState=-1;this.currentPlayTimes=0;this.currentTime=-1;this.target=null;this._isTween=false;this._valueOffset=0;this._frameValueOffset=0;this._frameOffset=0;this._frameRate=0;this._frameCount=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._valueArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this.playState===1?this._duration+1e-6:this._duration}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState.animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;if(this._timelineData!==null){var r=this._animationData.parent.parent;this._frameArray=r.frameArray;this._timelineArray=r.timelineArray;this._frameIndices=r.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){this.dirty=false};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._isTween||this.dirty){this._onUpdateFrame()}}};e.prototype.blend=function(t){};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a>0;var n=a+1;var s=Math.floor(t*n);var o=0;var l=0;if(i){o=s===0?0:e[r+s-1];l=s===n-1?1e4:e[r+s]}else{o=e[r+s-1];l=e[r+s]}return(o+(l-o)*(t*n-s))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenEasing=0;this._tweenProgress=0;this._valueScale=1};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this.dirty=true;this._isTween=false}};e.prototype._onUpdateFrame=function(){if(this._isTween){this.dirty=true;this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}};return e}(e);t.TweenTimelineState=a;var r=function(i){__extends(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}t.prototype._onClear=function(){i.prototype._onClear.call(this);this._current=0;this._difference=0;this._result=0};t.prototype._onArriveAtFrame=function(){i.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._valueScale;var e=this._valueArray;var a=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:a+1;if(t===1){this._current=e[a];this._difference=e[r]-this._current}else{this._current=e[a]*t;this._difference=e[r]*t-this._current}}else{this._result=e[a]*t}}else{this._result=0}};t.prototype._onUpdateFrame=function(){i.prototype._onUpdateFrame.call(this);if(this._isTween){this._result=this._current+this._difference*this._tweenProgress}};return t}(a);t.SingleValueTimelineState=r;var i=function(i){__extends(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}t.prototype._onClear=function(){i.prototype._onClear.call(this);this._currentA=0;this._currentB=0;this._differenceA=0;this._differenceB=0;this._resultA=0;this._resultB=0};t.prototype._onArriveAtFrame=function(){i.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._valueScale;var e=this._valueArray;var a=this._valueOffset+this._frameValueOffset+this._frameIndex*2;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:a+2;if(t===1){this._currentA=e[a];this._currentB=e[a+1];this._differenceA=e[r]-this._currentA;this._differenceB=e[r+1]-this._currentB}else{this._currentA=e[a]*t;this._currentB=e[a+1]*t;this._differenceA=e[r]*t-this._currentA;this._differenceB=e[r+1]*t-this._currentB}}else{this._resultA=e[a]*t;this._resultB=e[a+1]*t}}else{this._resultA=0;this._resultB=0}};t.prototype._onUpdateFrame=function(){i.prototype._onUpdateFrame.call(this);if(this._isTween){this._resultA=this._currentA+this._differenceA*this._tweenProgress;this._resultB=this._currentB+this._differenceB*this._tweenProgress}};return t}(a);t.DoubleValueTimelineState=i;var n=function(o){__extends(t,o);function t(){var t=o!==null&&o.apply(this,arguments)||this;t._rd=[];return t}t.prototype._onClear=function(){o.prototype._onClear.call(this);this._valueCount=0;this._rd.length=0};t.prototype._onArriveAtFrame=function(){o.prototype._onArriveAtFrame.call(this);var t=this._valueCount;var e=this._rd;if(this._timelineData!==null){var a=this._valueScale;var r=this._valueArray;var i=this._valueOffset+this._frameValueOffset+this._frameIndex*t;if(this._isTween){var n=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:i+t;if(a===1){for(var s=0;s0){if(n.hasDBEventListener(y.EventObject.COMPLETE)){h=y.BaseObject.borrowObject(y.EventObject);h.type=y.EventObject.COMPLETE;h.armature=this._armature;h.animationState=this._animationState}}}if(this._frameCount>1){var f=this._timelineData;var u=Math.floor(this.currentTime*this._frameRate);var _=this._frameIndices[f.frameIndicesOffset+u];if(this._frameIndex!==_){var m=this._frameIndex;this._frameIndex=_;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[f.offset+5+this._frameIndex];if(o){if(m<0){var p=Math.floor(r*this._frameRate);m=this._frameIndices[f.frameIndicesOffset+p];if(this.currentPlayTimes===a){if(m===_){m=-1}}}while(m>=0){var c=this._animationData.frameOffset+this._timelineArray[f.offset+5+m];var d=this._frameArray[c]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(m)}if(l!==null&&m===0){this._armature._dragonBones.bufferEvent(l);l=null}if(m>0){m--}else{m=this._frameCount-1}if(m===_){break}}}else{if(m<0){var p=Math.floor(r*this._frameRate);m=this._frameIndices[f.frameIndicesOffset+p];var c=this._animationData.frameOffset+this._timelineArray[f.offset+5+m];var d=this._frameArray[c]/this._frameRate;if(this.currentPlayTimes===a){if(r<=d){if(m>0){m--}else{m=this._frameCount-1}}else if(m===_){m=-1}}}while(m>=0){if(m=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(y.TimelineState);y.ZOrderTimelineState=e;var a=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._rd[2]=y.Transform.normalizeRadian(this._rd[2]);this._rd[3]=y.Transform.normalizeRadian(this._rd[3])}if(this._timelineData===null){this._rd[4]=1;this._rd[5]=1}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=6;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.fadeOut=function(){this.dirty=false;this._rd[2]=y.Transform.normalizeRadian(this._rd[2]);this._rd[3]=y.Transform.normalizeRadian(this._rd[3])};t.prototype.blend=function(t){var e=this._armature.armatureData.scale;var a=this._rd;var r=this.target;var i=r.target;var n=r.blendWeight;var s=i.animationPose;if(r.dirty>1){s.x+=a[0]*n*e;s.y+=a[1]*n*e;s.rotation+=a[2]*n;s.skew+=a[3]*n;s.scaleX+=(a[4]-1)*n;s.scaleY+=(a[5]-1)*n}else{s.x=a[0]*n*e;s.y=a[1]*n*e;s.rotation=a[2]*n;s.skew=a[3]*n;s.scaleX=(a[4]-1)*n+1;s.scaleY=(a[5]-1)*n+1}if(t||this.dirty){this.dirty=false;i._transformDirty=true}};return t}(y.MutilpleValueTimelineState);y.BoneAllTimelineState=a;var r=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.x+=this._resultA*r;i.y+=this._resultB*r}else if(r!==1){i.x=this._resultA*r;i.y=this._resultB*r}else{i.x=this._resultA;i.y=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneTranslateTimelineState=r;var i=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._differenceA=y.Transform.normalizeRadian(this._differenceA);this._differenceB=y.Transform.normalizeRadian(this._differenceB)}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.fadeOut=function(){this.dirty=false;this._resultA=y.Transform.normalizeRadian(this._resultA);this._resultB=y.Transform.normalizeRadian(this._resultB)};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.rotation+=this._resultA*r;i.skew+=this._resultB*r}else if(r!==1){i.rotation=this._resultA*r;i.skew=this._resultB*r}else{i.rotation=this._resultA;i.skew=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneRotateTimelineState=i;var n=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){this._resultA=1;this._resultB=1}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.scaleX+=(this._resultA-1)*r;i.scaleY+=(this._resultB-1)*r}else if(r!==1){i.scaleX=(this._resultA-1)*r+1;i.scaleY=(this._resultB-1)*r+1}else{i.scaleX=this._resultA;i.scaleY=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneScaleTimelineState=n;var s=function(s){__extends(t,s);function t(){return s!==null&&s.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};t.prototype._onClear=function(){s.prototype._onClear.call(this);this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};t.prototype.init=function(t,e,a){s.prototype.init.call(this,t,e,a);if(this._timelineData!==null){var r=this._animationData.parent.parent;var i=r.frameIntArray;var n=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=i[n+2];this._deformCount=i[n+1];this._deformOffset=i[n+3];this._sameValueOffset=i[n+4]+this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=r.frameFloatArray;this._rd.length=this._valueCount*2}else{this._deformCount=this.target.target._deformVertices.length}};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a._deformVertices;var n=this._valueArray;if(n!==null){var s=this._valueCount;var o=this._deformOffset;var l=this._sameValueOffset;var h=this._rd;for(var f=0;f1){i[f]+=u*r}else{i[f]=u*r}}}else if(e.dirty===1){for(var f=0;f1){a._alpha+=this._result*r;if(a._alpha>1){a._alpha=1}}else{a._alpha=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._alphaDirty=true}};return t}(y.SingleValueTimelineState);y.AlphaTimelineState=o;var l=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotDisplayTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target;var e=this._timelineData!==null?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;if(t.displayIndex!==e){t._setDisplayIndex(e,true)}}};e.prototype._onUpdateFrame=function(){};return e}(y.TimelineState);y.SlotDisplayTimelineState=l;var h=function(o){__extends(t,o);function t(){var t=o!==null&&o.apply(this,arguments)||this;t._current=[0,0,0,0,0,0,0,0];t._difference=[0,0,0,0,0,0,0,0];t._result=[0,0,0,0,0,0,0,0];return t}t.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};t.prototype._onArriveAtFrame=function(){o.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.parent.parent;var e=t.colorArray;var a=t.frameIntArray;var r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex;var i=a[r];if(i<0){i+=65536}if(this._isTween){this._current[0]=e[i++];this._current[1]=e[i++];this._current[2]=e[i++];this._current[3]=e[i++];this._current[4]=e[i++];this._current[5]=e[i++];this._current[6]=e[i++];this._current[7]=e[i++];if(this._frameIndex===this._frameCount-1){i=a[this._animationData.frameIntOffset+this._frameValueOffset]}else{i=a[r+1]}if(i<0){i+=65536}this._difference[0]=e[i++]-this._current[0];this._difference[1]=e[i++]-this._current[1];this._difference[2]=e[i++]-this._current[2];this._difference[3]=e[i++]-this._current[3];this._difference[4]=e[i++]-this._current[4];this._difference[5]=e[i++]-this._current[5];this._difference[6]=e[i++]-this._current[6];this._difference[7]=e[i++]-this._current[7]}else{this._result[0]=e[i++]*.01;this._result[1]=e[i++]*.01;this._result[2]=e[i++]*.01;this._result[3]=e[i++]*.01;this._result[4]=e[i++];this._result[5]=e[i++];this._result[6]=e[i++];this._result[7]=e[i++]}}else{var n=this.target;var s=n.slotData.color;this._result[0]=s.alphaMultiplier;this._result[1]=s.redMultiplier;this._result[2]=s.greenMultiplier;this._result[3]=s.blueMultiplier;this._result[4]=s.alphaOffset;this._result[5]=s.redOffset;this._result[6]=s.greenOffset;this._result[7]=s.blueOffset}};t.prototype._onUpdateFrame=function(){o.prototype._onUpdateFrame.call(this);if(this._isTween){this._result[0]=(this._current[0]+this._difference[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._difference[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._difference[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._difference[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress;this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress;this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress;this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress}};t.prototype.fadeOut=function(){this._isTween=false};t.prototype.update=function(t){o.prototype.update.call(this,t);if(this._isTween||this.dirty){var e=this.target;var a=e._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);a.alphaMultiplier+=(this._result[0]-a.alphaMultiplier)*r;a.redMultiplier+=(this._result[1]-a.redMultiplier)*r;a.greenMultiplier+=(this._result[2]-a.greenMultiplier)*r;a.blueMultiplier+=(this._result[3]-a.blueMultiplier)*r;a.alphaOffset+=(this._result[4]-a.alphaOffset)*r;a.redOffset+=(this._result[5]-a.redOffset)*r;a.greenOffset+=(this._result[6]-a.greenOffset)*r;a.blueOffset+=(this._result[7]-a.blueOffset)*r;e._colorDirty=true}}else if(this.dirty){this.dirty=false;if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){a.alphaMultiplier=this._result[0];a.redMultiplier=this._result[1];a.greenMultiplier=this._result[2];a.blueMultiplier=this._result[3];a.alphaOffset=this._result[4];a.redOffset=this._result[5];a.greenOffset=this._result[6];a.blueOffset=this._result[7];e._colorDirty=true}}}};return t}(y.TweenTimelineState);y.SlotColorTimelineState=h;var f=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){var t=this.target;var e=t.target;this._result=e.slotData.zIndex}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueArray=this._animationData.parent.parent.frameIntArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;if(e.dirty>1){a._zIndex+=this._result*r}else{a._zIndex=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._zIndexDirty=true}};return t}(y.SingleValueTimelineState);y.SlotZIndexTimelineState=f;var u=function(s){__extends(t,s);function t(){return s!==null&&s.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.DeformTimelineState]"};t.prototype._onClear=function(){s.prototype._onClear.call(this);this.displayFrame=null;this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};t.prototype.init=function(t,e,a){s.prototype.init.call(this,t,e,a);if(this._timelineData!==null){var r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];var i=this._animationData.parent.parent;var n=i.frameIntArray;this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=n[r+2];this._deformCount=n[r+1];this._deformOffset=n[r+3];this._sameValueOffset=n[r+4];if(this._sameValueOffset<0){this._sameValueOffset+=65536}this._sameValueOffset+=this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=i.frameFloatArray;this._rd.length=this._valueCount*2}else{this._deformCount=this.displayFrame.deformVertices.length}};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=this.displayFrame.deformVertices;var n=this._valueArray;if(n!==null){var s=this._valueCount;var o=this._deformOffset;var l=this._sameValueOffset;var h=this._rd;for(var f=0;f1){i[f]+=u*r}else{i[f]=u*r}}}else if(e.dirty===1){for(var f=0;f0;t._weight=this._currentB}else{var e=t._constraintData;t._bendPositive=e.bendPositive;t._weight=e.weight}t.invalidUpdate();this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=.01;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.DoubleValueTimelineState);y.IKConstraintTimelineState=_;var m=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.currentTime=this._result*t.totalTime}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.SingleValueTimelineState);y.AnimationProgressTimelineState=m;var p=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.weight=this._result}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.SingleValueTimelineState);y.AnimationWeightTimelineState=p;var c=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.parameterX=this._resultA;t.parameterY=this._resultB}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.DoubleValueTimelineState);y.AnimationParametersTimelineState=c})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.actionDataToInstance=function(t,e,a){if(t.type===0){e.type=r.FRAME_EVENT}else{e.type=t.type===10?r.FRAME_EVENT:r.SOUND_EVENT}e.name=t.name;e.armature=a;e.actionData=t;e.data=t.data;if(t.bone!==null){e.bone=a.getBone(t.bone.name)}if(t.slot!==null){e.slot=a.getSlot(t.slot.name)}};r.toString=function(){return"[class dragonBones.EventObject]"};r.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};r.START="start";r.LOOP_COMPLETE="loopComplete";r.COMPLETE="complete";r.FADE_IN="fadeIn";r.FADE_IN_COMPLETE="fadeInComplete";r.FADE_OUT="fadeOut";r.FADE_OUT_COMPLETE="fadeOutComplete";r.FRAME_EVENT="frameEvent";r.SOUND_EVENT="soundEvent";return r}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(){}t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}};t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};t.DATA_VERSION_2_3="2.3";t.DATA_VERSION_3_0="3.0";t.DATA_VERSION_4_0="4.0";t.DATA_VERSION_4_5="4.5";t.DATA_VERSION_5_0="5.0";t.DATA_VERSION_5_5="5.5";t.DATA_VERSION_5_6="5.6";t.DATA_VERSION=t.DATA_VERSION_5_6;t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6];t.TEXTURE_ATLAS="textureAtlas";t.SUB_TEXTURE="SubTexture";t.FORMAT="format";t.IMAGE_PATH="imagePath";t.WIDTH="width";t.HEIGHT="height";t.ROTATED="rotated";t.FRAME_X="frameX";t.FRAME_Y="frameY";t.FRAME_WIDTH="frameWidth";t.FRAME_HEIGHT="frameHeight";t.DRADON_BONES="dragonBones";t.USER_DATA="userData";t.ARMATURE="armature";t.CANVAS="canvas";t.BONE="bone";t.SURFACE="surface";t.SLOT="slot";t.CONSTRAINT="constraint";t.SKIN="skin";t.DISPLAY="display";t.FRAME="frame";t.IK="ik";t.PATH_CONSTRAINT="path";t.ANIMATION="animation";t.TIMELINE="timeline";t.FFD="ffd";t.TRANSLATE_FRAME="translateFrame";t.ROTATE_FRAME="rotateFrame";t.SCALE_FRAME="scaleFrame";t.DISPLAY_FRAME="displayFrame";t.COLOR_FRAME="colorFrame";t.DEFAULT_ACTIONS="defaultActions";t.ACTIONS="actions";t.EVENTS="events";t.INTS="ints";t.FLOATS="floats";t.STRINGS="strings";t.TRANSFORM="transform";t.PIVOT="pivot";t.AABB="aabb";t.COLOR="color";t.VERSION="version";t.COMPATIBLE_VERSION="compatibleVersion";t.FRAME_RATE="frameRate";t.TYPE="type";t.SUB_TYPE="subType";t.NAME="name";t.PARENT="parent";t.TARGET="target";t.STAGE="stage";t.SHARE="share";t.PATH="path";t.LENGTH="length";t.DISPLAY_INDEX="displayIndex";t.Z_ORDER="zOrder";t.Z_INDEX="zIndex";t.BLEND_MODE="blendMode";t.INHERIT_TRANSLATION="inheritTranslation";t.INHERIT_ROTATION="inheritRotation";t.INHERIT_SCALE="inheritScale";t.INHERIT_REFLECTION="inheritReflection";t.INHERIT_ANIMATION="inheritAnimation";t.INHERIT_DEFORM="inheritDeform";t.SEGMENT_X="segmentX";t.SEGMENT_Y="segmentY";t.BEND_POSITIVE="bendPositive";t.CHAIN="chain";t.WEIGHT="weight";t.BLEND_TYPE="blendType";t.FADE_IN_TIME="fadeInTime";t.PLAY_TIMES="playTimes";t.SCALE="scale";t.OFFSET="offset";t.POSITION="position";t.DURATION="duration";t.TWEEN_EASING="tweenEasing";t.TWEEN_ROTATE="tweenRotate";t.TWEEN_SCALE="tweenScale";t.CLOCK_WISE="clockwise";t.CURVE="curve";t.SOUND="sound";t.EVENT="event";t.ACTION="action";t.X="x";t.Y="y";t.SKEW_X="skX";t.SKEW_Y="skY";t.SCALE_X="scX";t.SCALE_Y="scY";t.VALUE="value";t.ROTATE="rotate";t.SKEW="skew";t.ALPHA="alpha";t.ALPHA_OFFSET="aO";t.RED_OFFSET="rO";t.GREEN_OFFSET="gO";t.BLUE_OFFSET="bO";t.ALPHA_MULTIPLIER="aM";t.RED_MULTIPLIER="rM";t.GREEN_MULTIPLIER="gM";t.BLUE_MULTIPLIER="bM";t.UVS="uvs";t.VERTICES="vertices";t.TRIANGLES="triangles";t.WEIGHTS="weights";t.SLOT_POSE="slotPose";t.BONE_POSE="bonePose";t.BONES="bones";t.POSITION_MODE="positionMode";t.SPACING_MODE="spacingMode";t.ROTATE_MODE="rotateMode";t.SPACING="spacing";t.ROTATE_OFFSET="rotateOffset";t.ROTATE_MIX="rotateMix";t.TRANSLATE_MIX="translateMix";t.TARGET_DISPLAY="targetDisplay";t.CLOSED="closed";t.CONSTANT_SPEED="constantSpeed";t.VERTEX_COUNT="vertexCount";t.LENGTHS="lengths";t.GOTO_AND_PLAY="gotoAndPlay";t.DEFAULT_NAME="default";return t}();t.DataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(tt){var t=function(e){__extends(J,e);function J(){var t=e!==null&&e.apply(this,arguments)||this;t._rawTextureAtlasIndex=0;t._rawBones=[];t._data=null;t._armature=null;t._bone=null;t._geometry=null;t._slot=null;t._skin=null;t._mesh=null;t._animation=null;t._timeline=null;t._rawTextureAtlases=null;t._frameValueType=0;t._defaultColorOffset=-1;t._prevClockwise=0;t._prevRotation=0;t._frameDefaultValue=0;t._frameValueScale=1;t._helpMatrixA=new tt.Matrix;t._helpMatrixB=new tt.Matrix;t._helpTransform=new tt.Transform;t._helpColorTransform=new tt.ColorTransform;t._helpPoint=new tt.Point;t._helpArray=[];t._intArray=[];t._floatArray=[];t._frameIntArray=[];t._frameFloatArray=[];t._frameArray=[];t._timelineArray=[];t._colorArray=[];t._cacheRawMeshes=[];t._cacheMeshes=[];t._actionFrames=[];t._weightSlotPose={};t._weightBonePoses={};t._cacheBones={};t._slotChildActions={};return t}J._getBoolean=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="boolean"){return r}else if(i==="string"){switch(r){case"0":case"NaN":case"":case"false":case"null":case"undefined":return false;default:return true}}else{return!!r}}return a};J._getNumber=function(t,e,a){if(e in t){var r=t[e];if(r===null||r==="NaN"){return a}return+r||0}return a};J._getString=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="string"){return r}return String(r)}return a};J.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var f=1-l;var u=f*f;var _=l*l;var m=f*u;var p=3*l*u;var c=3*f*_;var d=l*_;h.x=m*t+p*a+c*i+d*s;h.y=m*e+p*r+c*n+d*o};J.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3===1){var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,f,u,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return true}else{var r=0;for(var i=0,n=e.length;i1e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,f,u,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return false}};J.prototype._parseActionDataInFrame=function(t,e,a,r){if(tt.DataParser.EVENT in t){this._mergeActionFrame(t[tt.DataParser.EVENT],e,10,a,r)}if(tt.DataParser.SOUND in t){this._mergeActionFrame(t[tt.DataParser.SOUND],e,11,a,r)}if(tt.DataParser.ACTION in t){this._mergeActionFrame(t[tt.DataParser.ACTION],e,0,a,r)}if(tt.DataParser.EVENTS in t){this._mergeActionFrame(t[tt.DataParser.EVENTS],e,10,a,r)}if(tt.DataParser.ACTIONS in t){this._mergeActionFrame(t[tt.DataParser.ACTIONS],e,0,a,r)}};J.prototype._mergeActionFrame=function(t,e,a,r,i){var n=this._armature.actions.length;var s=this._parseActionData(t,a,r,i);var o=0;var l=null;for(var h=0,f=s;he){break}o++}if(l===null){l=new D;l.frameStart=e;this._actionFrames.splice(o,0,l)}for(var c=0;c0){var _=a.getBone(f);if(_!==null){u.parent=_}else{if(!(f in this._cacheBones)){this._cacheBones[f]=[]}this._cacheBones[f].push(u)}}if(u.name in this._cacheBones){for(var m=0,p=this._cacheBones[u.name];m0&&e.parent!==null){i.root=e.parent;i.bone=e}else{i.root=e;i.bone=null}return i};J.prototype._parsePathConstraint=function(t){var e=this._armature.getSlot(J._getString(t,tt.DataParser.TARGET,""));if(e===null){return null}var a=this._armature.defaultSkin;if(a===null){return null}var r=a.getDisplay(e.name,J._getString(t,tt.DataParser.TARGET_DISPLAY,e.name));if(r===null||!(r instanceof tt.PathDisplayData)){return null}var i=t[tt.DataParser.BONES];if(i===null||i.length===0){return null}var n=tt.BaseObject.borrowObject(tt.PathConstraintData);n.name=J._getString(t,tt.DataParser.NAME,"");n.type=1;n.pathSlot=e;n.pathDisplayData=r;n.target=e.parent;n.positionMode=tt.DataParser._getPositionMode(J._getString(t,tt.DataParser.POSITION_MODE,""));n.spacingMode=tt.DataParser._getSpacingMode(J._getString(t,tt.DataParser.SPACING_MODE,""));n.rotateMode=tt.DataParser._getRotateMode(J._getString(t,tt.DataParser.ROTATE_MODE,""));n.position=J._getNumber(t,tt.DataParser.POSITION,0);n.spacing=J._getNumber(t,tt.DataParser.SPACING,0);n.rotateOffset=J._getNumber(t,tt.DataParser.ROTATE_OFFSET,0);n.rotateMix=J._getNumber(t,tt.DataParser.ROTATE_MIX,1);n.translateMix=J._getNumber(t,tt.DataParser.TRANSLATE_MIX,1);for(var s=0,o=i;s0?a:e;this._parsePivot(t,n);break}case 1:{var s=i=tt.BaseObject.borrowObject(tt.ArmatureDisplayData);s.name=e;s.path=a.length>0?a:e;s.inheritAnimation=true;if(tt.DataParser.ACTIONS in t){var o=this._parseActionData(t[tt.DataParser.ACTIONS],0,null,null);for(var l=0,h=o;l0?a:e;if(tt.DataParser.SHARE in t){p.geometry.data=this._data;this._cacheRawMeshes.push(t);this._cacheMeshes.push(p)}else{this._parseMesh(t,p)}break}case 3:{var c=this._parseBoundingBox(t);if(c!==null){var d=i=tt.BaseObject.borrowObject(tt.BoundingBoxDisplayData);d.name=e;d.path=a.length>0?a:e;d.boundingBox=c}break}case 4:{var y=t[tt.DataParser.LENGTHS];var v=i=tt.BaseObject.borrowObject(tt.PathDisplayData);v.closed=J._getBoolean(t,tt.DataParser.CLOSED,false);v.constantSpeed=J._getBoolean(t,tt.DataParser.CONSTANT_SPEED,false);v.name=e;v.path=a.length>0?a:e;v.curveLengths.length=y.length;for(var g=0,D=y.length;ge.width){e.width=o}if(le.height){e.height=l}}}e.width-=e.x;e.height-=e.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return e};J.prototype._parseAnimation=function(t){var e=tt.BaseObject.borrowObject(tt.AnimationData);e.blendType=tt.DataParser._getAnimationBlendType(J._getString(t,tt.DataParser.BLEND_TYPE,""));e.frameCount=J._getNumber(t,tt.DataParser.DURATION,0);e.playTimes=J._getNumber(t,tt.DataParser.PLAY_TIMES,1);e.duration=e.frameCount/this._armature.frameRate;e.fadeInTime=J._getNumber(t,tt.DataParser.FADE_IN_TIME,0);e.scale=J._getNumber(t,tt.DataParser.SCALE,1);e.name=J._getString(t,tt.DataParser.NAME,tt.DataParser.DEFAULT_NAME);if(e.name.length===0){e.name=tt.DataParser.DEFAULT_NAME}e.frameIntOffset=this._frameIntArray.length;e.frameFloatOffset=this._frameFloatArray.length;e.frameOffset=this._frameArray.length;this._animation=e;if(tt.DataParser.FRAME in t){var a=t[tt.DataParser.FRAME];var r=a.length;if(r>0){for(var i=0,n=0;i0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame);this._actionFrames.length=0}if(tt.DataParser.TIMELINE in t){var o=t[tt.DataParser.TIMELINE];for(var A=0,P=o;A0&&a in t){e=t[a]}if(e===null){return null}var l=e.length;if(l===0){return null}var h=this._frameIntArray.length;var f=this._frameFloatArray.length;var u=this._timelineArray.length;if(o===null){o=tt.BaseObject.borrowObject(tt.TimelineData)}o.type=r;o.offset=u;this._frameValueType=i;this._timeline=o;this._timelineArray.length+=1+1+1+1+1+l;if(t!==null){this._timelineArray[u+0]=Math.round(J._getNumber(t,tt.DataParser.SCALE,1)*100);this._timelineArray[u+1]=Math.round(J._getNumber(t,tt.DataParser.OFFSET,0)*100)}else{this._timelineArray[u+0]=100;this._timelineArray[u+1]=0}this._timelineArray[u+2]=l;this._timelineArray[u+3]=n;switch(this._frameValueType){case 0:this._timelineArray[u+4]=0;break;case 1:this._timelineArray[u+4]=h-this._animation.frameIntOffset;break;case 2:this._timelineArray[u+4]=f-this._animation.frameFloatOffset;break}if(l===1){o.frameIndicesOffset=-1;this._timelineArray[u+5+0]=s.call(this,e[0],0,0)-this._animation.frameOffset}else{var _=this._animation.frameCount+1;var m=this._data.frameIndices;var p=m.length;m.length+=_;o.frameIndicesOffset=p;for(var c=0,d=0,y=0,v=0;c<_;++c){if(y+v<=c&&d0){if(tt.DataParser.CURVE in t){var i=a+1;this._helpArray.length=i;var n=this._samplingEasingCurve(t[tt.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[r+1]=2;this._frameArray[r+2]=n?i:-i;for(var s=0;s0){var n=this._armature.sortedSlots.length;var s=new Array(n-i.length/2);var o=new Array(n);for(var l=0;l0?r>=this._prevRotation:r<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}r=this._prevRotation+r-this._prevRotation+tt.Transform.PI_D*this._prevClockwise}}this._prevClockwise=J._getNumber(t,tt.DataParser.TWEEN_ROTATE,0);this._prevRotation=r;var i=this._parseTweenFrame(t,e,a);var n=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[n++]=this._helpTransform.x;this._frameFloatArray[n++]=this._helpTransform.y;this._frameFloatArray[n++]=r;this._frameFloatArray[n++]=this._helpTransform.skew;this._frameFloatArray[n++]=this._helpTransform.scaleX;this._frameFloatArray[n++]=this._helpTransform.scaleY;this._parseActionDataInFrame(t,e,this._bone,this._slot);return i};J.prototype._parseBoneTranslateFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[i++]=J._getNumber(t,tt.DataParser.X,0);this._frameFloatArray[i++]=J._getNumber(t,tt.DataParser.Y,0);return r};J.prototype._parseBoneRotateFrame=function(t,e,a){var r=J._getNumber(t,tt.DataParser.ROTATE,0)*tt.Transform.DEG_RAD;if(e!==0){if(this._prevClockwise===0){r=this._prevRotation+tt.Transform.normalizeRadian(r-this._prevRotation)}else{if(this._prevClockwise>0?r>=this._prevRotation:r<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}r=this._prevRotation+r-this._prevRotation+tt.Transform.PI_D*this._prevClockwise}}this._prevClockwise=J._getNumber(t,tt.DataParser.CLOCK_WISE,0);this._prevRotation=r;var i=this._parseTweenFrame(t,e,a);var n=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[n++]=r;this._frameFloatArray[n++]=J._getNumber(t,tt.DataParser.SKEW,0)*tt.Transform.DEG_RAD;return i};J.prototype._parseBoneScaleFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[i++]=J._getNumber(t,tt.DataParser.X,1);this._frameFloatArray[i++]=J._getNumber(t,tt.DataParser.Y,1);return r};J.prototype._parseSlotDisplayFrame=function(t,e,a){var r=this._parseFrame(t,e,a);this._frameArray.length+=1;if(tt.DataParser.VALUE in t){this._frameArray[r+1]=J._getNumber(t,tt.DataParser.VALUE,0)}else{this._frameArray[r+1]=J._getNumber(t,tt.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(t,e,this._slot.parent,this._slot);return r};J.prototype._parseSlotColorFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=-1;if(tt.DataParser.VALUE in t||tt.DataParser.COLOR in t){var n=tt.DataParser.VALUE in t?t[tt.DataParser.VALUE]:t[tt.DataParser.COLOR];for(var s in n){s;this._parseColorTransform(n,this._helpColorTransform);i=this._colorArray.length;this._colorArray.length+=8;this._colorArray[i++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.redMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.alphaOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.redOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.greenOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.blueOffset);i-=8;break}}if(i<0){if(this._defaultColorOffset<0){this._defaultColorOffset=i=this._colorArray.length;this._colorArray.length+=8;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=0;this._colorArray[i++]=0;this._colorArray[i++]=0;this._colorArray[i++]=0}i=this._defaultColorOffset}var o=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[o]=i;return r};J.prototype._parseSlotDeformFrame=function(t,e,a){var r=this._frameFloatArray.length;var i=this._parseTweenFrame(t,e,a);var n=tt.DataParser.VERTICES in t?t[tt.DataParser.VERTICES]:null;var s=J._getNumber(t,tt.DataParser.OFFSET,0);var o=this._intArray[this._mesh.geometry.offset+0];var l=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var h=this._mesh.geometry.weight;var f=0;var u=0;var _=0;var m=0;if(h!==null){var p=this._weightSlotPose[l];this._helpMatrixA.copyFromArray(p,0);this._frameFloatArray.length+=h.count*2;_=h.offset+2+h.bones.length}else{this._frameFloatArray.length+=o*2}for(var c=0;c=n.length){f=0}else{f=n[c-s]}if(c+1=n.length){u=0}else{u=n[c+1-s]}}if(h!==null){var d=this._weightBonePoses[l];var y=this._intArray[_++];this._helpMatrixA.transformPoint(f,u,this._helpPoint,true);f=this._helpPoint.x;u=this._helpPoint.y;for(var v=0;v=n.length){h=0}else{h=n[u-s]}if(u+1=n.length){f=0}else{f=n[u+1-s]}}else{h=0;f=0}this._frameFloatArray[r+u]=h;this._frameFloatArray[r+u+1]=f}}if(e===0){var _=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[_+0]=this._geometry.offset;this._frameIntArray[_+1]=this._frameFloatArray.length-r;this._frameIntArray[_+2]=this._frameFloatArray.length-r;this._frameIntArray[_+3]=0;this._frameIntArray[_+4]=r-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=_-this._animation.frameIntOffset}return i};J.prototype._parseTransform=function(t,e,a){e.x=J._getNumber(t,tt.DataParser.X,0)*a;e.y=J._getNumber(t,tt.DataParser.Y,0)*a;if(tt.DataParser.ROTATE in t||tt.DataParser.SKEW in t){e.rotation=tt.Transform.normalizeRadian(J._getNumber(t,tt.DataParser.ROTATE,0)*tt.Transform.DEG_RAD);e.skew=tt.Transform.normalizeRadian(J._getNumber(t,tt.DataParser.SKEW,0)*tt.Transform.DEG_RAD)}else if(tt.DataParser.SKEW_X in t||tt.DataParser.SKEW_Y in t){e.rotation=tt.Transform.normalizeRadian(J._getNumber(t,tt.DataParser.SKEW_Y,0)*tt.Transform.DEG_RAD);e.skew=tt.Transform.normalizeRadian(J._getNumber(t,tt.DataParser.SKEW_X,0)*tt.Transform.DEG_RAD)-e.rotation}e.scaleX=J._getNumber(t,tt.DataParser.SCALE_X,1);e.scaleY=J._getNumber(t,tt.DataParser.SCALE_Y,1)};J.prototype._parseColorTransform=function(t,e){e.alphaMultiplier=J._getNumber(t,tt.DataParser.ALPHA_MULTIPLIER,100)*.01;e.redMultiplier=J._getNumber(t,tt.DataParser.RED_MULTIPLIER,100)*.01;e.greenMultiplier=J._getNumber(t,tt.DataParser.GREEN_MULTIPLIER,100)*.01;e.blueMultiplier=J._getNumber(t,tt.DataParser.BLUE_MULTIPLIER,100)*.01;e.alphaOffset=J._getNumber(t,tt.DataParser.ALPHA_OFFSET,0);e.redOffset=J._getNumber(t,tt.DataParser.RED_OFFSET,0);e.greenOffset=J._getNumber(t,tt.DataParser.GREEN_OFFSET,0);e.blueOffset=J._getNumber(t,tt.DataParser.BLUE_OFFSET,0)};J.prototype._parseGeometry=function(t,e){var a=t[tt.DataParser.VERTICES];var r=Math.floor(a.length/2);var i=0;var n=this._intArray.length;var s=this._floatArray.length;e.offset=n;e.data=this._data;this._intArray.length+=1+1+1+1;this._intArray[n+0]=r;this._intArray[n+2]=s;this._intArray[n+3]=-1;this._floatArray.length+=r*2;for(var o=0,l=r*2;o=0||tt.DataParser.DATA_VERSIONS.indexOf(r)>=0){var i=tt.BaseObject.borrowObject(tt.DragonBonesData);i.version=a;i.name=J._getString(t,tt.DataParser.NAME,"");i.frameRate=J._getNumber(t,tt.DataParser.FRAME_RATE,24);if(i.frameRate===0){i.frameRate=24}if(tt.DataParser.ARMATURE in t){this._data=i;this._parseArray(t);var n=t[tt.DataParser.ARMATURE];for(var s=0,o=n;s0){i.stage=i.getArmature(i.armatureNames[0])}this._data=null}if(tt.DataParser.TEXTURE_ATLAS in t){this._rawTextureAtlases=t[tt.DataParser.TEXTURE_ATLAS]}return i}else{console.assert(false,"Nonsupport data version: "+a+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};J.prototype.parseTextureAtlasData=function(t,e,a){if(a===void 0){a=1}console.assert(t!==undefined);if(t===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var r=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(r,e,a);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}e.width=J._getNumber(t,tt.DataParser.WIDTH,0);e.height=J._getNumber(t,tt.DataParser.HEIGHT,0);e.scale=a===1?1/J._getNumber(t,tt.DataParser.SCALE,1):a;e.name=J._getString(t,tt.DataParser.NAME,"");e.imagePath=J._getString(t,tt.DataParser.IMAGE_PATH,"");if(tt.DataParser.SUB_TEXTURE in t){var i=t[tt.DataParser.SUB_TEXTURE];for(var n=0,s=i.length;n0&&h>0){f.frame=tt.TextureData.createRectangle();f.frame.x=J._getNumber(o,tt.DataParser.FRAME_X,0);f.frame.y=J._getNumber(o,tt.DataParser.FRAME_Y,0);f.frame.width=l;f.frame.height=h}e.addTexture(f)}}return true};J.getInstance=function(){if(J._objectDataParserInstance===null){J._objectDataParserInstance=new J}return J._objectDataParserInstance};J._objectDataParserInstance=null;return J}(tt.DataParser);tt.ObjectDataParser=t;var D=function(){function t(){this.frameStart=0;this.actions=[]}return t}();tt.ActionFrame=D})(dragonBones||(dragonBones={}));var dragonBones;(function(g){var t=function(o){__extends(t,o);function t(){return o!==null&&o.apply(this,arguments)||this}t.prototype._inRange=function(t,e,a){return e<=t&&t<=a};t.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var f=0;while(t.length>i){var u=t[i++];if(u===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(u,0,127)){s=u}else{if(this._inRange(u,194,223)){l=1;f=128;o=u-192}else if(this._inRange(u,224,239)){l=2;f=2048;o=u-224}else if(this._inRange(u,240,244)){l=3;f=65536;o=u-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(u,128,191)){o=0;l=0;h=0;f=0;i--;s=u}else{h+=1;o=o+(u-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var m=f;o=0;l=0;h=0;f=0;if(this._inRange(_,m,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=u}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};t.prototype._parseBinaryTimeline=function(t,e,a){if(a===void 0){a=null}var r=a!==null?a:g.BaseObject.borrowObject(g.TimelineData);r.type=t;r.offset=e;this._timeline=r;var i=this._timelineArrayBuffer[r.offset+2];if(i===1){r.frameIndicesOffset=-1}else{var n=0;var s=this._animation.frameCount+1;var o=this._data.frameIndices;n=o.length;o.length+=s;r.frameIndicesOffset=n;for(var l=0,h=0,f=0,u=0;l=0){var h=g.ObjectDataParser._getNumber(d,g.DataParser.TYPE,0);var y=g.ObjectDataParser._getString(d,g.DataParser.NAME,"");var u=null;if(h===40&&e.blendType!==0){u=g.BaseObject.borrowObject(g.AnimationTimelineData);var v=u;v.x=g.ObjectDataParser._getNumber(d,g.DataParser.X,0);v.y=g.ObjectDataParser._getNumber(d,g.DataParser.Y,0)}u=this._parseBinaryTimeline(h,f,u);switch(h){case 0:break;case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(y,u);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(y,u);break;case 30:this._animation.addConstraintTimeline(y,u);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(y,u);break}}}}this._animation=null;return e};t.prototype._parseGeometry=function(t,e){e.offset=t[g.DataParser.OFFSET];e.data=this._data;var a=this._intArrayBuffer[e.offset+3];if(a<-1){a+=65536}if(a>=0){var r=g.BaseObject.borrowObject(g.WeightData);var i=this._intArrayBuffer[e.offset+0];var n=this._intArrayBuffer[a+0];r.offset=a;for(var s=0;s12?e[13]:0;var h=new Int16Array(this._binary,this._binaryOffset+e[0],a/Int16Array.BYTES_PER_ELEMENT);var f=new Float32Array(this._binary,this._binaryOffset+e[2],r/Float32Array.BYTES_PER_ELEMENT);var u=new Int16Array(this._binary,this._binaryOffset+e[4],i/Int16Array.BYTES_PER_ELEMENT);var _=new Float32Array(this._binary,this._binaryOffset+e[6],n/Float32Array.BYTES_PER_ELEMENT);var m=new Int16Array(this._binary,this._binaryOffset+e[8],s/Int16Array.BYTES_PER_ELEMENT);var p=new Uint16Array(this._binary,this._binaryOffset+e[10],o/Uint16Array.BYTES_PER_ELEMENT);var c=l>0?new Int16Array(this._binary,this._binaryOffset+e[12],l/Uint16Array.BYTES_PER_ELEMENT):h;this._data.binary=this._binary;this._data.intArray=this._intArrayBuffer=h;this._data.floatArray=f;this._data.frameIntArray=u;this._data.frameFloatArray=_;this._data.frameArray=this._frameArrayBuffer=m;this._data.timelineArray=this._timelineArrayBuffer=p;this._data.colorArray=c};t.prototype.parseDragonBonesData=function(t,e){if(e===void 0){e=1}console.assert(t!==null&&t!==undefined&&t instanceof ArrayBuffer,"Data error.");var a=new Uint8Array(t,0,8);if(a[0]!=="D".charCodeAt(0)||a[1]!=="B".charCodeAt(0)||a[2]!=="D".charCodeAt(0)||a[3]!=="T".charCodeAt(0)){console.assert(false,"Nonsupport data.");return null}var r=new Uint32Array(t,8,1)[0];var i=new Uint8Array(t,8+4,r);var n=this._decodeUTF8(i);var s=JSON.parse(n);this._binaryOffset=8+4+r;this._binary=t;return o.prototype.parseDragonBonesData.call(this,s,e)};t.getInstance=function(){if(t._binaryDataParserInstance===null){t._binaryDataParserInstance=new t}return t._binaryDataParserInstance};t._binaryDataParserInstance=null;return t}(g.ObjectDataParser);g.BinaryDataParser=t})(dragonBones||(dragonBones={}));var dragonBones;(function(y){var t=function(){function s(t){if(t===void 0){t=null}this.autoSearch=false;this._dragonBonesDataMap={};this._textureAtlasDataMap={};this._dragonBones=null;this._dataParser=null;if(s._objectParser===null){s._objectParser=new y.ObjectDataParser}if(s._binaryParser===null){s._binaryParser=new y.BinaryDataParser}this._dataParser=t!==null?t:s._objectParser}s.prototype._isSupportMesh=function(){return true};s.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap){for(var a=0,r=this._textureAtlasDataMap[t];a0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};s.prototype._buildBones=function(t,e){for(var a=0,r=t.armature.sortedBones;a0){var c=this._getTextureData(t.textureAtlasName,p.path);u.replaceTextureData(c,_)}var d=this._getSlotDisplay(t,p,u);u.replaceDisplay(d,_)}else{u.replaceDisplay(null)}}}u._setDisplayIndex(h.displayIndex,true)}};s.prototype._buildConstraints=function(t,e){var a=t.armature.constraints;for(var r in a){var i=a[r];switch(i.type){case 0:var n=y.BaseObject.borrowObject(y.IKConstraint);n.init(i,e);e._addConstraint(n);break;case 1:var s=y.BaseObject.borrowObject(y.PathConstraint);s.init(i,e);e._addConstraint(s);break;default:var o=y.BaseObject.borrowObject(y.IKConstraint);o.init(i,e);e._addConstraint(o);break}}};s.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,t!==null?t.dataName:"","",t!==null?t.textureAtlasName:"")};s.prototype._getSlotDisplay=function(t,e,a){var r=t!==null?t.dataName:e.parent.parent.parent.name;var i=null;switch(e.type){case 0:{var n=e;if(n.texture===null){n.texture=this._getTextureData(r,e.path)}i=a.rawDisplay;break}case 2:{var s=e;if(s.texture===null){s.texture=this._getTextureData(r,s.path)}if(this._isSupportMesh()){i=a.meshDisplay}else{i=a.rawDisplay}break}case 1:{var o=e;var l=this._buildChildArmature(t,a,o);if(l!==null){l.inheritAnimation=o.inheritAnimation;if(!l.inheritAnimation){var h=o.actions.length>0?o.actions:l.armatureData.defaultActions;if(h.length>0){for(var f=0,u=h;f=0){continue}var h=e.getDisplays(l.name);if(h===null){if(n!==null&&e!==n){h=n.getDisplays(l.name)}if(h===null){if(a){l.displayFrameCount=0}continue}}l.displayFrameCount=h.length;for(var f=0,u=l.displayFrameCount;f0?this.width:e.width;var r=this.height>0?this.height:e.height;for(var i in this.textures){var n=egret.$TextureScaleFactor;var s=this.textures[i];var o=s.region.width;var l=s.region.height;if(s.renderTexture===null){s.renderTexture=new egret.Texture}s.renderTexture.bitmapData=e;if(s.rotated){s.renderTexture.$initData(s.region.x*n,s.region.y*n,l*n,o*n,0,0,l*n,o*n,a,r,s.rotated)}else{s.renderTexture.$initData(s.region.x*n,s.region.y*n,o*n,l*n,0,0,o*n,l*n,a,r)}}}else{for(var i in this.textures){var s=this.textures[i];s.renderTexture=null}}},enumerable:true,configurable:true});return t}(a.TextureAtlasData);a.EgretTextureAtlasData=t;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.renderTexture=null;return t}t.toString=function(){return"[class dragonBones.EgretTextureData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);if(this.renderTexture!==null){}this.renderTexture=null};return t}(a.TextureData);a.EgretTextureData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(w){var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"eventObject",{get:function(){return this.data},enumerable:true,configurable:true});return e}(egret.Event);w.EgretEvent=r;var t=function(g){__extends(e,g);function e(){var t=g!==null&&g.apply(this,arguments)||this;t.debugDraw=false;t._batchEnabled=!(global["nativeRender"]||global["bricks"]);t._childDirty=true;t._debugDraw=false;t._armature=null;t._bounds=null;t._debugDrawer=null;return t}e._cleanBeforeRender=function(){};e.prototype.dbInit=function(t){this._armature=t;if(this._batchEnabled){this.$renderNode=new egret.sys.GroupNode;this.$renderNode.cleanBeforeRender=e._cleanBeforeRender}};e.prototype.dbClear=function(){this._armature=null;this._bounds=null;this._debugDrawer=null};e.prototype.dbUpdate=function(){var t=w.DragonBones.debugDraw||this.debugDraw;if(t||this._debugDraw){this._debugDraw=t;if(this._debugDraw){if(this._debugDrawer===null){this._debugDrawer=new egret.Sprite}if(this._debugDrawer.parent!==this){this.addChild(this._debugDrawer)}var e=2;var a=this._debugDrawer.graphics;a.clear();for(var r=0,i=this._armature.getBones();r0){a.setTo(999999,999999,-999999,-999999);for(var h=0,f=l.length;hu)a.x=u;if(a.width_)a.y=_;if(a.height<_)a.height=_}a.width-=a.x;a.height-=a.y}else{continue}}else if(n._displayFrame){var m=n._displayFrame.getTextureData();if(m){var p=m.parent.scale;a.x=0;a.y=0;a.width=m.region.width*p;a.height=m.region.height*p}else{continue}}o.$transformBounds(a);var c=a.x;var d=a.y;var y=a.x+a.width;var v=a.y+a.height;if(e){e=false;t.x=c;t.y=d;t.width=y;t.height=v}else{if(ct.width){t.width=y}if(v>t.height){t.height=v}}}t.width-=t.x;t.height-=t.y;if(w.isV5){if(this._bounds===null){this._bounds=new egret.Rectangle}this._bounds.copyFrom(t)}}else if(w.isV5){if(this._bounds===null){this._bounds=new egret.Rectangle}t.copyFrom(this._bounds)}return t}return g.prototype.$measureContentBounds.call(this,t)};return e}(egret.DisplayObjectContainer);w.EgretArmatureDisplay=t})(dragonBones||(dragonBones={}));var dragonBones;(function(w){var t=function(i){__extends(t,i);function t(){var t=i!==null&&i.apply(this,arguments)||this;t.transformUpdateEnabled=false;t._armatureDisplay=null;t._renderDisplay=null;t._colorFilter=null;return t}t.toString=function(){return"[class dragonBones.EgretSlot]"};t.prototype.init=function(t,e,a,r){i.prototype.init.call(this,t,e,a,r);if(w.isV5){this._updateTransform=this._updateTransformV5}else{this._updateTransform=this._updateTransformV4}};t.prototype._onClear=function(){i.prototype._onClear.call(this);this._armatureDisplay=null;this._renderDisplay=null;this._colorFilter=null};t.prototype._initDisplay=function(t,e){t;e};t.prototype._disposeDisplay=function(t,e){t;e};t.prototype._onUpdateDisplay=function(){this._armatureDisplay=this._armature.display;this._renderDisplay=this._display!==null?this._display:this._rawDisplay;if(w.isV5&&this._armatureDisplay._batchEnabled){if(this._renderDisplay===this._rawDisplay&&!(this._renderDisplay.$renderNode instanceof egret.sys.BitmapNode)){this._renderDisplay.$renderNode=new egret.sys.BitmapNode}}if(this._armatureDisplay._batchEnabled){if(this._renderDisplay!==this._rawDisplay&&this._renderDisplay!==this._meshDisplay){this._armatureDisplay.disableBatch()}else{var t=this._renderDisplay.$renderNode;if(!t.matrix){t.matrix=new egret.Matrix}}}};t.prototype._addDisplay=function(){if(this._armatureDisplay._batchEnabled){this._armatureDisplay.$renderNode.addNode(this._renderDisplay.$renderNode)}else{this._armatureDisplay.addChild(this._renderDisplay)}};t.prototype._replaceDisplay=function(t){var e=t;if(this._armatureDisplay._batchEnabled){var a=this._armatureDisplay.$renderNode.drawData;var r=a.indexOf(e.$renderNode);a[r]=this._renderDisplay.$renderNode}else{this._armatureDisplay.addChild(this._renderDisplay);this._armatureDisplay.swapChildren(this._renderDisplay,e);this._armatureDisplay.removeChild(e)}};t.prototype._removeDisplay=function(){if(this._armatureDisplay._batchEnabled){var t=this._armatureDisplay.$renderNode.drawData;t.splice(t.indexOf(this._renderDisplay.$renderNode),1)}else{this._renderDisplay.parent.removeChild(this._renderDisplay)}};t.prototype._updateZOrder=function(){if(this._armatureDisplay._batchEnabled){var t=this._armatureDisplay.$renderNode.drawData;var e=t.indexOf(this._renderDisplay.$renderNode);if(e===this._zOrder){return}t[this._zOrder]=this._renderDisplay.$renderNode}else{var e=this._armatureDisplay.getChildIndex(this._renderDisplay);if(e===this._zOrder){return}this._armatureDisplay.addChildAt(this._renderDisplay,this._zOrder)}};t.prototype._updateVisible=function(){var t=this._parent.visible&&this._visible;if(this._armatureDisplay._batchEnabled){var e=this._renderDisplay.$renderNode;e.alpha=t?1:0}else{this._renderDisplay.visible=t}};t.prototype._updateBlendMode=function(){switch(this._blendMode){case 0:this._renderDisplay.blendMode=egret.BlendMode.NORMAL;break;case 1:this._renderDisplay.blendMode=egret.BlendMode.ADD;break;case 5:this._renderDisplay.blendMode=egret.BlendMode.ERASE;break;default:break}if(this._armatureDisplay._batchEnabled){var t=this._renderDisplay.$renderNode;t.blendMode=egret.sys.blendModeToNumber(this._renderDisplay.blendMode)}};t.prototype._updateColor=function(){var t=this._colorTransform.alphaMultiplier*this._globalAlpha;if(this._colorTransform.redMultiplier!==1||this._colorTransform.greenMultiplier!==1||this._colorTransform.blueMultiplier!==1||this._colorTransform.redOffset!==0||this._colorTransform.greenOffset!==0||this._colorTransform.blueOffset!==0||this._colorTransform.alphaOffset!==0){if(this._colorFilter===null){this._colorFilter=new egret.ColorMatrixFilter}var e=this._colorFilter.matrix;e[0]=this._colorTransform.redMultiplier;e[6]=this._colorTransform.greenMultiplier;e[12]=this._colorTransform.blueMultiplier;e[18]=t;e[4]=this._colorTransform.redOffset;e[9]=this._colorTransform.greenOffset;e[14]=this._colorTransform.blueOffset;e[19]=this._colorTransform.alphaOffset;this._colorFilter.matrix=e;if(this._armatureDisplay._batchEnabled){var a=this._renderDisplay.$renderNode;a.filter=this._colorFilter;a.alpha=1}var r=this._renderDisplay.filters;if(!r){r=[]}if(r.indexOf(this._colorFilter)<0){r.push(this._colorFilter)}this._renderDisplay.filters=r;this._renderDisplay.alpha=1}else{if(this._armatureDisplay._batchEnabled){var a=this._renderDisplay.$renderNode;a.filter=null;a.alpha=t}this._renderDisplay.filters=null;this._renderDisplay.alpha=t}};t.prototype._updateFrame=function(){var t=this._textureData;if(this._displayFrame!==null&&this._display!==null&&t!==null){var e=t.parent;if(this._armature.replacedTexture!==null){if(this._armature._replaceTextureAtlasData===null){e=w.BaseObject.borrowObject(w.EgretTextureAtlasData);e.copyFrom(t.parent);e.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=e}else{e=this._armature._replaceTextureAtlasData}t=e.getTexture(t.name)}if(t.renderTexture!==null){if(this._geometryData!==null){var a=this._geometryData.data;var r=a.intArray;var i=a.floatArray;var n=r[this._geometryData.offset+0];var s=r[this._geometryData.offset+1];var o=r[this._geometryData.offset+2];if(o<0){o+=65536}var l=o+n*2;var h=this._armature._armatureData.scale;var f=this._renderDisplay;var u=f.$renderNode;u.uvs.length=n*2;u.vertices.length=n*2;u.indices.length=s*3;for(var _=0,m=n*2;_0&&r.inheritDeform;var s=this._renderDisplay;var o=s.$renderNode;if(i!==null){var l=r.data;var h=l.intArray;var f=l.floatArray;var u=h[r.offset+0];var _=h[i.offset+1];if(_<0){_+=65536}for(var m=0,p=0,c=i.offset+2+a.length,d=_,y=0;m=5.1;var t=function(r){__extends(i,r);function i(t){if(t===void 0){t=null}var e=r.call(this,t)||this;if(i._dragonBonesInstance===null){var a=new n.EgretArmatureDisplay;i._dragonBonesInstance=new n.DragonBones(a);i._time=egret.getTimer()*.001;egret.startTick(i._clockHandler,i)}e._dragonBones=i._dragonBonesInstance;return e}i._clockHandler=function(t){t*=.001;var e=t-this._time;this._dragonBonesInstance.advanceTime(e);this._time=t;return false};Object.defineProperty(i,"factory",{get:function(){if(this._factory===null){this._factory=new i}return this._factory},enumerable:true,configurable:true});i.prototype._isSupportMesh=function(){if(egret.Capabilities.renderMode==="webgl"||egret.Capabilities.runtimeType===egret.RuntimeType.NATIVE){return true}console.warn("Canvas can not support mesh, please change renderMode to webgl.");return false};i.prototype._buildTextureAtlasData=function(t,e){if(t!==null){if(e instanceof egret.Texture){t.renderTexture=e}else if(e){var a=new egret.Texture;a.bitmapData=new egret.BitmapData(e);t.disposeEnabled=true;t.renderTexture=a}}else{t=n.BaseObject.borrowObject(n.EgretTextureAtlasData)}return t};i.prototype._buildArmature=function(t){var e=n.BaseObject.borrowObject(n.Armature);var a=new n.EgretArmatureDisplay;e.init(t.armature,a,a,this._dragonBones);return e};i.prototype._buildSlot=function(t,e,a){var r=n.BaseObject.borrowObject(n.EgretSlot);r.init(e,a,new egret.Bitmap,new egret.Mesh);return r};i.prototype.buildArmatureDisplay=function(t,e,a,r){if(e===void 0){e=""}if(a===void 0){a=""}if(r===void 0){r=""}var i=this.buildArmature(t,e||"",a||"",r||"");if(i!==null){this._dragonBones.clock.add(i);return i.display}return null};i.prototype.getTextureDisplay=function(t,e){if(e===void 0){e=null}var a=this._getTextureData(e!==null?e:"",t);if(a!==null&&a.renderTexture!==null){var r=a.renderTexture;var i=new egret.Bitmap(r);i.width=r.textureWidth*a.parent.scale;i.height=r.textureHeight*a.parent.scale;return i}return null};Object.defineProperty(i.prototype,"soundEventManager",{get:function(){return this._dragonBones.eventManager},enumerable:true,configurable:true});i._time=0;i._dragonBonesInstance=null;i._factory=null;return i}(n.BaseFactory);n.EgretFactory=t})(dragonBones||(dragonBones={}));
\ No newline at end of file
diff --git a/Egret/4.x/src/dragonBones/egret/EgretArmatureDisplay.ts b/Egret/4.x/src/dragonBones/egret/EgretArmatureDisplay.ts
index e15527de..becc2c69 100644
--- a/Egret/4.x/src/dragonBones/egret/EgretArmatureDisplay.ts
+++ b/Egret/4.x/src/dragonBones/egret/EgretArmatureDisplay.ts
@@ -48,255 +48,6 @@ namespace dragonBones {
         public get eventObject(): EventObject {
             return this.data;
         }
-
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get animationName(): string {
-            const animationState = this.eventObject.animationState;
-            return animationState !== null ? animationState.name : "";
-        }
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#armature}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#armature}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get armature(): Armature {
-            return this.eventObject.armature;
-        }
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#bone}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#bone}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get bone(): Bone | null {
-            return this.eventObject.bone;
-        }
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#slot}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#slot}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get slot(): Slot | null {
-            return this.eventObject.slot;
-        }
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get animationState(): AnimationState | null {
-            return this.eventObject.animationState;
-        }
-        /**
-         * Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#name}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#name}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get frameLabel(): string {
-            return this.eventObject.name;
-        }
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#name}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#name}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get sound(): string {
-            return this.eventObject.name;
-        }
-        /**
-         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get movementID(): string {
-            return this.animationName;
-        }
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.START}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.START}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static START: string = EventObject.START;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.LOOP_COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.LOOP_COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static LOOP_COMPLETE: string = EventObject.LOOP_COMPLETE;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static COMPLETE: string = EventObject.COMPLETE;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_IN}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_IN}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static FADE_IN: string = EventObject.FADE_IN;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_IN_COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_IN_COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static FADE_IN_COMPLETE: string = EventObject.FADE_IN_COMPLETE;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_OUT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_OUT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static FADE_OUT: string = EventObject.FADE_OUT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_OUT_COMPLETE}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FADE_OUT_COMPLETE}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static FADE_OUT_COMPLETE: string = EventObject.FADE_OUT_COMPLETE;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static FRAME_EVENT: string = EventObject.FRAME_EVENT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.SOUND_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.SOUND_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static SOUND_EVENT: string = EventObject.SOUND_EVENT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static ANIMATION_FRAME_EVENT: string = EventObject.FRAME_EVENT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static BONE_FRAME_EVENT: string = EventObject.FRAME_EVENT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static MOVEMENT_FRAME_EVENT: string = EventObject.FRAME_EVENT;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.EventObject.SOUND_EVENT}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.EventObject.SOUND_EVENT}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static SOUND: string = EventObject.SOUND_EVENT;
     }
     /**
      * @inheritDoc
@@ -384,7 +135,7 @@ namespace dragonBones {
                             const segmentX = surfaceData.segmentX;
                             const segmentY = surfaceData.segmentY;
                             const vertices = surface._vertices;
-                            graphics.lineStyle(2.0, 0xFFFF00, 0.7);
+                            graphics.lineStyle(2.0, 0xFFFF00, 0.3);
 
                             for (let iY = 0; iY < segmentY; ++iY) {
                                 for (let iX = 0; iX < segmentX; ++iX) {
@@ -536,7 +287,7 @@ namespace dragonBones {
 
             for (const slot of this._armature.getSlots()) {
                 // (slot as EgretSlot).transformUpdateEnabled = true;
-                let display = ((slot._deformVertices && slot._deformVertices.verticesData) ? slot.meshDisplay : slot.rawDisplay) as (egret.Mesh | egret.Bitmap);
+                let display = (slot._geometryData ? slot.meshDisplay : slot.rawDisplay) as (egret.Mesh | egret.Bitmap);
                 if (!slot.display && display === slot.meshDisplay) {
                     display = slot.rawDisplay;
                 }
@@ -548,6 +299,10 @@ namespace dragonBones {
                     display.$setMatrix(slot.globalTransformMatrix as any, false);
                 }
 
+                // Color.
+                node.alpha = 1.0;
+                node.filter = null as any;
+
                 // ZOrder.
                 this.addChild(display);
             }
@@ -609,14 +364,14 @@ namespace dragonBones {
                                 continue;
                             }
                         }
-                        else {
-                            const displayData = slot.displayData;
-                            if (displayData && displayData instanceof ImageDisplayData && displayData.texture) {
-                                const scale = displayData.texture.parent.scale;
+                        else if (slot._displayFrame) {
+                            const textureData = slot._displayFrame.getTextureData();
+                            if (textureData) {
+                                const scale = textureData.parent.scale;
                                 helpRectangle.x = 0;
                                 helpRectangle.y = 0;
-                                helpRectangle.width = displayData.texture.region.width * scale;
-                                helpRectangle.height = displayData.texture.region.height * scale;
+                                helpRectangle.width = textureData.region.width * scale;
+                                helpRectangle.height = textureData.region.height * scale;
                             }
                             else {
                                 continue;
@@ -680,165 +435,5 @@ namespace dragonBones {
 
             return super.$measureContentBounds(bounds) as any; // V5
         }
-
-        /**
-         * @inheritDoc
-         */
-        public hasEvent(type: EventStringType): boolean {
-            return this.hasDBEventListener(type);
-        }
-        /**
-         * @inheritDoc
-         */
-        public addEvent(type: EventStringType, listener: (event: EgretEvent) => void, target: any): void {
-            this.addDBEventListener(type, listener, target);
-        }
-        /**
-         * @inheritDoc
-         */
-        public removeEvent(type: EventStringType, listener: (event: EgretEvent) => void, target: any): void {
-            this.removeDBEventListener(type, listener, target);
-        }
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#clock} {@link dragonBones.BaseFactory#clock}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#clock} {@link dragonBones.BaseFactory#clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public advanceTimeBySelf(on: boolean): void {
-            if (on) {
-                this._armature.clock = EgretFactory.factory.clock;
-            }
-            else {
-                this._armature.clock = null;
-            }
-        }
-    }
-
-    /**
-     * 已废弃,请参考 {@link dragonBones.Armature}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export type FastArmature = Armature;
-    /**
-     * 已废弃,请参考 {@link dragonBones.Bone}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export type FastBone = Bone;
-    /**
-     * 已废弃,请参考 {@link dragonBones.Slot}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export type FastSlot = Slot;
-    /**
-     * 已废弃,请参考 {@link dragonBones.Animation}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export type FastAnimation = Animation;
-    /**
-     * 已废弃,请参考 {@link dragonBones.AnimationState}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export type FastAnimationState = AnimationState;
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export class Event extends EgretEvent { }
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export class ArmatureEvent extends EgretEvent { }
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export class AnimationEvent extends EgretEvent { }
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export class FrameEvent extends EgretEvent { }
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretEvent}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export class SoundEvent extends EgretEvent { }
-    /**
-     * 已废弃,请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export class EgretTextureAtlas extends EgretTextureAtlasData {
-        public static toString(): string {
-            return "[class dragonBones.EgretTextureAtlas]";
-        }
-        /**
-         * 已废弃,请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public constructor(texture: egret.Texture, rawData: any, scale: number = 1) {
-            super();
-            console.warn("已废弃");
-
-            this._onClear();
-
-            ObjectDataParser.getInstance().parseTextureAtlasData(rawData, this, scale);
-            this.renderTexture = texture;
-        }
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export class EgretSheetAtlas extends EgretTextureAtlas {
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.EgretFactory#soundEventManager}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export class SoundEventManager {
-        /**
-         * 已废弃,请参考 {@link dragonBones.EgretFactory#soundEventManager}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static getInstance(): EgretArmatureDisplay {
-            console.warn("已废弃");
-            return EgretFactory.factory.soundEventManager;
-        }
-    }
-    /**
-     * 已废弃,请参考 {@link dragonBones.Armature#cacheFrameRate}。
-     * @deprecated
-     * @language zh_CN
-     */
-    export class AnimationCacheManager {
-        /**
-         * 已废弃,请参考 {@link dragonBones.Armature#cacheFrameRate}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public constructor() {
-            console.warn("已废弃");
-        }
     }
 }
\ No newline at end of file
diff --git a/Egret/4.x/src/dragonBones/egret/EgretFactory.ts b/Egret/4.x/src/dragonBones/egret/EgretFactory.ts
index be38724e..a32f4721 100644
--- a/Egret/4.x/src/dragonBones/egret/EgretFactory.ts
+++ b/Egret/4.x/src/dragonBones/egret/EgretFactory.ts
@@ -45,7 +45,7 @@ namespace dragonBones {
             time *= 0.001;
 
             const passedTime = time - this._time;
-            EgretFactory._dragonBonesInstance.advanceTime(passedTime);
+            this._dragonBonesInstance.advanceTime(passedTime);
             this._time = time;
 
             return false;
@@ -61,11 +61,11 @@ namespace dragonBones {
          * @language zh_CN
          */
         public static get factory(): EgretFactory {
-            if (EgretFactory._factory === null) {
-                EgretFactory._factory = new EgretFactory();
+            if (this._factory === null) {
+                this._factory = new EgretFactory();
             }
 
-            return EgretFactory._factory;
+            return this._factory;
         }
         /**
          * @inheritDoc
@@ -99,7 +99,7 @@ namespace dragonBones {
                 if (textureAtlas instanceof egret.Texture) {
                     textureAtlasData.renderTexture = textureAtlas;
                 }
-                else {
+                else if (textureAtlas) {
                     const egretTexture = new egret.Texture();
                     egretTexture.bitmapData = new egret.BitmapData(textureAtlas);
                     textureAtlasData.disposeEnabled = true;
@@ -125,10 +125,7 @@ namespace dragonBones {
             return armature;
         }
 
-        protected _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot {
-            // tslint:disable-next-line:no-unused-expression
-            dataPackage;
-
+        protected _buildSlot(_dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot {
             const slot = BaseObject.borrowObject(EgretSlot);
             slot.init(
                 slotData, armature,
@@ -223,131 +220,5 @@ namespace dragonBones {
         public get soundEventManager(): EgretArmatureDisplay {
             return this._dragonBones.eventManager as EgretArmatureDisplay;
         }
-
-        /**
-         * - Deprecated, please refer to {@link #clock}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static get clock(): WorldClock {
-            return EgretFactory.factory.clock;
-        }
-        /**
-         * - Deprecated, please refer to {@link #addDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #addDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public addSkeletonData(dragonBonesData: DragonBonesData, dragonBonesName: string | null = null): void {
-            console.warn("已废弃");
-            this.addDragonBonesData(dragonBonesData, dragonBonesName);
-        }
-        /**
-         * - Deprecated, please refer to {@link #getDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #getDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public getSkeletonData(dragonBonesName: string) {
-            console.warn("已废弃");
-            return this.getDragonBonesData(dragonBonesName);
-        }
-        /**
-         * - Deprecated, please refer to {@link #removeDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #removeDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public removeSkeletonData(dragonBonesName: string): void {
-            console.warn("已废弃");
-            this.removeDragonBonesData(dragonBonesName);
-        }
-        /**
-         * - Deprecated, please refer to {@link #addTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #addTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public addTextureAtlas(textureAtlasData: TextureAtlasData, dragonBonesName: string | null = null): void {
-            console.warn("已废弃");
-            this.addTextureAtlasData(textureAtlasData, dragonBonesName);
-        }
-        /**
-         * - Deprecated, please refer to {@link #getTextureAtlas()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #getTextureAtlas()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public getTextureAtlas(dragonBonesName: string) {
-            console.warn("已废弃");
-            return this.getTextureAtlasData(dragonBonesName);
-        }
-        /**
-         * - Deprecated, please refer to {@link #removeTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #removeTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public removeTextureAtlas(dragonBonesName: string): void {
-            console.warn("已废弃");
-            this.removeTextureAtlasData(dragonBonesName);
-        }
-        /**
-         * - Deprecated, please refer to {@link #buildArmature()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #buildArmature()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public buildFastArmature(armatureName: string, dragonBonesName: string = "", skinName: string = ""): FastArmature | null {
-            console.warn("已废弃");
-            return this.buildArmature(armatureName, dragonBonesName || "", skinName || "");
-        }
-        /**
-         * - Deprecated, please refer to {@link #clear()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #clear()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public dispose(): void {
-            console.warn("已废弃");
-            this.clear();
-        }
     }
 }
\ No newline at end of file
diff --git a/Egret/4.x/src/dragonBones/egret/EgretSlot.ts b/Egret/4.x/src/dragonBones/egret/EgretSlot.ts
index 2344bab0..03c50954 100644
--- a/Egret/4.x/src/dragonBones/egret/EgretSlot.ts
+++ b/Egret/4.x/src/dragonBones/egret/EgretSlot.ts
@@ -127,7 +127,8 @@ namespace dragonBones {
 
             if (this._armatureDisplay._batchEnabled) {
                 const nodes = (this._armatureDisplay.$renderNode as egret.sys.GroupNode).drawData;
-                nodes[nodes.indexOf(prevDisplay.$renderNode)] = this._renderDisplay.$renderNode;
+                const prevIndex = nodes.indexOf(prevDisplay.$renderNode);
+                nodes[prevIndex] = this._renderDisplay.$renderNode;
             }
             else {
                 this._armatureDisplay.addChild(this._renderDisplay);
@@ -149,7 +150,14 @@ namespace dragonBones {
         protected _updateZOrder(): void {
             if (this._armatureDisplay._batchEnabled) {
                 const nodes = (this._armatureDisplay.$renderNode as egret.sys.GroupNode).drawData;
+                const index = nodes.indexOf(this._renderDisplay.$renderNode);
+                if (index === this._zOrder) {
+                    return;
+                }
+
                 nodes[this._zOrder] = this._renderDisplay.$renderNode;
+                // nodes.splice(index, 1);
+                // nodes.splice(this._zOrder, 0, this._renderDisplay.$renderNode);
             }
             else {
                 const index = this._armatureDisplay.getChildIndex(this._renderDisplay);
@@ -200,6 +208,8 @@ namespace dragonBones {
         }
 
         protected _updateColor(): void {
+            const alpha = this._colorTransform.alphaMultiplier * this._globalAlpha;
+
             if (
                 this._colorTransform.redMultiplier !== 1.0 ||
                 this._colorTransform.greenMultiplier !== 1.0 ||
@@ -217,7 +227,7 @@ namespace dragonBones {
                 colorMatrix[0] = this._colorTransform.redMultiplier;
                 colorMatrix[6] = this._colorTransform.greenMultiplier;
                 colorMatrix[12] = this._colorTransform.blueMultiplier;
-                colorMatrix[18] = this._colorTransform.alphaMultiplier;
+                colorMatrix[18] = alpha;
                 colorMatrix[4] = this._colorTransform.redOffset;
                 colorMatrix[9] = this._colorTransform.greenOffset;
                 colorMatrix[14] = this._colorTransform.blueOffset;
@@ -246,21 +256,21 @@ namespace dragonBones {
                 if (this._armatureDisplay._batchEnabled) {
                     const node = this._renderDisplay.$renderNode as (egret.sys.BitmapNode);
                     node.filter = null as any;
-                    node.alpha = this._colorTransform.alphaMultiplier;
+                    node.alpha = alpha;
                 }
 
                 this._renderDisplay.filters = null as any;
-                this._renderDisplay.alpha = this._colorTransform.alphaMultiplier;
+                this._renderDisplay.alpha = alpha;
             }
         }
 
         protected _updateFrame(): void {
-            const currentVerticesData = (this._deformVertices !== null && this._display === this._meshDisplay) ? this._deformVertices.verticesData : null;
             let currentTextureData = this._textureData as (EgretTextureData | null);
 
-            if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) {
-                if (this._armature.replacedTexture !== null && this._rawDisplayDatas !== null && this._rawDisplayDatas.indexOf(this._displayData) >= 0) { // Update replaced texture atlas.
-                    let currentTextureAtlasData = currentTextureData.parent as EgretTextureAtlasData;
+            if (this._displayFrame !== null && this._display !== null && currentTextureData !== null) {
+                let currentTextureAtlasData = currentTextureData.parent as EgretTextureAtlasData;
+
+                if (this._armature.replacedTexture !== null) { // Update replaced texture atlas.
                     if (this._armature._replaceTextureAtlasData === null) {
                         currentTextureAtlasData = BaseObject.borrowObject(EgretTextureAtlasData);
                         currentTextureAtlasData.copyFrom(currentTextureData.parent);
@@ -275,16 +285,16 @@ namespace dragonBones {
                 }
 
                 if (currentTextureData.renderTexture !== null) {
-                    if (currentVerticesData !== null) { // Mesh.
-                        const data = currentVerticesData.data;
+                    if (this._geometryData !== null) { // Mesh.
+                        const data = this._geometryData.data;
                         const intArray = data.intArray;
                         const floatArray = data.floatArray;
-                        const vertexCount = intArray[currentVerticesData.offset + BinaryOffset.MeshVertexCount];
-                        const triangleCount = intArray[currentVerticesData.offset + BinaryOffset.MeshTriangleCount];
-                        let vertexOffset = intArray[currentVerticesData.offset + BinaryOffset.MeshFloatOffset];
+                        const vertexCount = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexCount];
+                        const triangleCount = intArray[this._geometryData.offset + BinaryOffset.GeometryTriangleCount];
+                        let vertexOffset = intArray[this._geometryData.offset + BinaryOffset.GeometryFloatOffset];
 
                         if (vertexOffset < 0) {
-                            vertexOffset += 65536; // Fixed out of bouds bug. 
+                            vertexOffset += 65536; // Fixed out of bounds bug. 
                         }
 
                         const uvOffset = vertexOffset + vertexCount * 2;
@@ -303,7 +313,7 @@ namespace dragonBones {
                         }
 
                         for (let i = 0; i < triangleCount * 3; ++i) {
-                            meshNode.indices[i] = intArray[currentVerticesData.offset + BinaryOffset.MeshVertexIndices + i];
+                            meshNode.indices[i] = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexIndices + i];
                         }
 
                         if (this._armatureDisplay._batchEnabled) {
@@ -350,7 +360,7 @@ namespace dragonBones {
                             (meshDisplay as any).$invalidateTransform();
                         }
 
-                        const isSkinned = currentVerticesData.weight !== null;
+                        const isSkinned = this._geometryData.weight !== null;
                         const isSurface = this._parent._boneData.type !== BoneType.Bone;
                         if (isSkinned || isSurface) {
                             this._identityTransform();
@@ -425,24 +435,24 @@ namespace dragonBones {
 
         protected _updateMesh(): void {
             const scale = this._armature._armatureData.scale;
-            const deformVertices = (this._deformVertices as DeformVertices).vertices;
-            const bones = (this._deformVertices as DeformVertices).bones;
-            const verticesData = (this._deformVertices as DeformVertices).verticesData as VerticesData;
-            const weightData = verticesData.weight;
+            const deformVertices = (this._displayFrame as DisplayFrame).deformVertices;
+            const bones = this._geometryBones;
+            const geometryData = this._geometryData as GeometryData;
+            const weightData = geometryData.weight;
 
-            const hasDeform = deformVertices.length > 0 && verticesData.inheritDeform;
+            const hasDeform = deformVertices.length > 0 && geometryData.inheritDeform;
             const meshDisplay = this._renderDisplay as egret.Mesh;
             const meshNode = meshDisplay.$renderNode as egret.sys.MeshNode;
 
             if (weightData !== null) {
-                const data = verticesData.data;
+                const data = geometryData.data;
                 const intArray = data.intArray;
                 const floatArray = data.floatArray;
-                const vertexCount = intArray[verticesData.offset + BinaryOffset.MeshVertexCount];
+                const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount];
                 let weightFloatOffset = intArray[weightData.offset + BinaryOffset.WeigthFloatOffset];
 
                 if (weightFloatOffset < 0) {
-                    weightFloatOffset += 65536; // Fixed out of bouds bug. 
+                    weightFloatOffset += 65536; // Fixed out of bounds bug. 
                 }
 
                 for (
@@ -483,21 +493,26 @@ namespace dragonBones {
                     (meshDisplay as any).$invalidateTransform();
                 }
             }
-            else if (hasDeform) {
+            else {
                 const isSurface = this._parent._boneData.type !== BoneType.Bone;
-                const data = verticesData.data;
+                const data = geometryData.data;
                 const intArray = data.intArray;
                 const floatArray = data.floatArray;
-                const vertexCount = intArray[verticesData.offset + BinaryOffset.MeshVertexCount];
-                let vertexOffset = intArray[verticesData.offset + BinaryOffset.MeshFloatOffset];
+                const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount];
+                let vertexOffset = intArray[geometryData.offset + BinaryOffset.GeometryFloatOffset];
 
                 if (vertexOffset < 0) {
-                    vertexOffset += 65536; // Fixed out of bouds bug. 
+                    vertexOffset += 65536; // Fixed out of bounds bug. 
                 }
 
                 for (let i = 0, l = vertexCount * 2; i < l; i += 2) {
-                    const x = floatArray[vertexOffset + i] * scale + deformVertices[i];
-                    const y = floatArray[vertexOffset + i + 1] * scale + deformVertices[i + 1];
+                    let x = floatArray[vertexOffset + i] * scale;
+                    let y = floatArray[vertexOffset + i + 1] * scale;
+
+                    if (hasDeform) {
+                        x += deformVertices[i];
+                        y += deformVertices[i + 1];
+                    }
 
                     if (isSurface) {
                         const matrix = (this._parent as Surface)._getGlobalTransformMatrix(x, y);
@@ -521,11 +536,6 @@ namespace dragonBones {
                 this._armatureDisplay._childDirty = true;
             }
         }
-        /**
-         * @internal
-         */
-        public _updateGlueMesh(): void {
-        }
 
         protected _updateTransform(): void {
             throw new Error();
diff --git a/Egret/4.x/src/dragonBones/egret/EgretTextureAtlasData.ts b/Egret/4.x/src/dragonBones/egret/EgretTextureAtlasData.ts
index 9c48bcf2..bd2232f0 100644
--- a/Egret/4.x/src/dragonBones/egret/EgretTextureAtlasData.ts
+++ b/Egret/4.x/src/dragonBones/egret/EgretTextureAtlasData.ts
@@ -124,35 +124,6 @@ namespace dragonBones {
                 }
             }
         }
-
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#removeTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#removeTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public dispose(): void {
-            console.warn("已废弃。");
-            this.returnToPool();
-        }
-        /**
-         * - Deprecated, please refer to {@link #renderTexture}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #renderTexture}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public get texture() {
-            console.warn("已废弃。");
-            return this.renderTexture;
-        }
     }
     /**
      * @internal
diff --git a/Egret/4.x/src/dragonBones/egret/Movie.ts b/Egret/4.x/src/dragonBones/egret/Movie.ts
deleted file mode 100644
index 32e90a1f..00000000
--- a/Egret/4.x/src/dragonBones/egret/Movie.ts
+++ /dev/null
@@ -1,1521 +0,0 @@
-/**
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2018 DragonBones team and other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-declare const _super: any;
-namespace dragonBones {
-    /**
-     * @private
-     */
-    type GroupConfig = {
-        name: string,
-        version: number,
-
-        position: number[],
-
-        display: DisplayConfig[],
-        frame: FrameConfig[],
-        movie: MovieConfig[],
-        animation: MovieConfig[], // 兼容旧数据
-
-        // Runtime
-        offset: number,
-        arrayBuffer: ArrayBuffer,
-        displayFrameArray: Int16Array,
-        rectangleArray: Float32Array,
-        transformArray: Float32Array,
-        colorArray: Int16Array,
-        textures: egret.Texture[]
-    };
-    /**
-     * @private
-     */
-    type DisplayConfig = {
-        name: string,
-        type: DisplayType,
-        textureIndex?: number,
-        regionIndex?: number,
-
-        // Runtime
-        texture: egret.Texture
-    };
-    /**
-     * @private
-     */
-    type ActionAndEventConfig = {
-        type: ActionType,
-        name: string,
-        data?: any,
-        slot?: string
-    };
-    /**
-     * @private
-     */
-    type MovieConfig = {
-        name: string,
-        frameRate: number,
-        type?: number,
-        action?: string,
-        isNested?: boolean,
-        hasChildAnimation?: boolean, // 兼容旧数据
-
-        slot: SlotConfig[],
-        clip: ClipConfig[]
-    };
-    /**
-     * @private
-     */
-    type SlotConfig = {
-        name: string,
-        blendMode?: BlendMode,
-        action?: string
-    };
-    /**
-     * @private
-     */
-    type ClipConfig = {
-        name: string,
-        playTimes: number,
-        duration: number,
-        scale: number,
-        cacheTimeToFrameScale: number,
-        p: number,
-        s: number,
-
-        frame: number[],
-
-        // Runtime
-        cacheRectangles: egret.Rectangle[]
-    };
-    /**
-     * @private
-     */
-    type FrameConfig = {
-        prev: number,
-        next: number,
-        position: number,
-        actionAndEvent: ActionAndEventConfig[]
-    };
-    /**
-     * @private
-     */
-    type CreateMovieHelper = {
-        groupName: string,
-        movieName: string,
-        groupConfig: GroupConfig,
-        movieConfig: MovieConfig
-    };
-    /**
-     * @private
-     */
-    let _helpRectangle: egret.Rectangle = new egret.Rectangle();
-    /**
-     * @private
-     */
-    let _helpMatrix: egret.Matrix = new egret.Matrix();
-    /**
-     * @private
-     */
-    let _groupConfigMap: Map = {};
-    /**
-     * @private
-     */
-    function _findObjectInArray(array: T[], name: string): T | null {
-        for (let i = 0, l = array.length; i < l; ++i) {
-            const data = array[i];
-            if (data.name === name) {
-                return data;
-            }
-        }
-
-        return null;
-    }
-    /**
-     * @private
-     */
-    function _fillCreateMovieHelper(createMovieHelper: CreateMovieHelper): boolean {
-        if (createMovieHelper.groupName) {
-            const groupConfig = _groupConfigMap[createMovieHelper.groupName];
-            if (groupConfig) {
-                const movieConfig = _findObjectInArray(groupConfig.movie || groupConfig.animation, createMovieHelper.movieName);
-                if (movieConfig) {
-                    createMovieHelper.groupConfig = groupConfig;
-                    createMovieHelper.movieConfig = movieConfig;
-                    return true;
-                }
-            }
-        }
-
-        if (!createMovieHelper.groupName) { // || autoSearch Will be search all data, if do not give a data name or the autoSearch is true.
-            for (let groupName in _groupConfigMap) {
-                const groupConfig = _groupConfigMap[groupName];
-                if (!createMovieHelper.groupName) { // || groupConfig.autoSearch
-                    const movieConfig = _findObjectInArray(groupConfig.movie || groupConfig.animation, createMovieHelper.movieName);
-                    if (movieConfig) {
-                        createMovieHelper.groupName = groupName;
-                        createMovieHelper.groupConfig = groupConfig;
-                        createMovieHelper.movieConfig = movieConfig;
-                        return true;
-                    }
-                }
-            }
-        }
-
-        return false;
-    }
-    /**
-     * 是否包含指定名称的动画组。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    export function hasMovieGroup(groupName: string): boolean {
-        return groupName in _groupConfigMap;
-    }
-    /**
-     * 添加动画组。
-     * @param groupData 动画二进制数据。
-     * @param textureAtlas 贴图集或贴图集列表。
-     * @param groupName 为动画组指定一个名称,如果未设置,则使用数据中的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    export function addMovieGroup(groupData: ArrayBuffer, textureAtlas: egret.Texture | egret.Texture[], groupName: string | null = null): void {
-        if (groupData) {
-            const byteArray = new egret.ByteArray(groupData);
-            byteArray.endian = egret.Endian.LITTLE_ENDIAN;
-            byteArray.position = 8; // TODO format
-
-            const groupConfig = JSON.parse(byteArray.readUTF());
-            groupConfig.offset = byteArray.position;
-            groupConfig.arrayBuffer = groupData;
-            groupConfig.textures = [];
-
-            const p = groupConfig.offset % 4;
-            if (p) {
-                groupConfig.offset += 4 - p;
-            }
-
-            for (let i = 0, l = groupConfig.position.length; i < l; i += 3) {
-                switch (i / 3) {
-                    case 1:
-                        groupConfig.displayFrameArray = new Int16Array(groupConfig.arrayBuffer, groupConfig.offset + groupConfig.position[i], groupConfig.position[i + 1] / groupConfig.position[i + 2]);
-                        break;
-                    case 2:
-                        groupConfig.rectangleArray = new Float32Array(groupConfig.arrayBuffer, groupConfig.offset + groupConfig.position[i], groupConfig.position[i + 1] / groupConfig.position[i + 2]);
-                        break;
-                    case 3:
-                        groupConfig.transformArray = new Float32Array(groupConfig.arrayBuffer, groupConfig.offset + groupConfig.position[i], groupConfig.position[i + 1] / groupConfig.position[i + 2]);
-                        break;
-                    case 4:
-                        groupConfig.colorArray = new Int16Array(groupConfig.arrayBuffer, groupConfig.offset + groupConfig.position[i], groupConfig.position[i + 1] / groupConfig.position[i + 2]);
-                        break;
-                }
-            }
-
-            groupName = groupName || groupConfig.name;
-            if (_groupConfigMap[groupName]) {
-                console.warn("Replace group: " + groupName);
-            }
-
-            _groupConfigMap[groupName] = groupConfig;
-
-            //
-            if (textureAtlas instanceof Array) {
-                for (let i = 0, l = textureAtlas.length; i < l; ++i) {
-                    const texture = textureAtlas[i];
-                    groupConfig.textures.push(texture);
-                }
-            }
-            else {
-                groupConfig.textures.push(textureAtlas);
-            }
-        }
-        else {
-            throw new Error();
-        }
-    }
-    /**
-     * 移除动画组。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    export function removeMovieGroup(groupName: string): void {
-        const groupConfig = _groupConfigMap[groupName];
-        if (groupConfig) {
-            delete _groupConfigMap[groupName];
-        }
-    }
-    /**
-     * 移除所有的动画组。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    export function removeAllMovieGroup(): void {
-        for (let i in _groupConfigMap) {
-            delete _groupConfigMap[i];
-        }
-    }
-    /**
-     * 创建一个动画。
-     * @param movieName 动画的名称。
-     * @param groupName 动画组的名称,如果未设置,将检索所有的动画组,当多个动画组中包含同名的动画时,可能无法创建出准确的动画。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    export function buildMovie(movieName: string, groupName: string | null = null): Movie | null {
-        const createMovieHelper = { movieName: movieName, groupName: groupName };
-        if (_fillCreateMovieHelper(createMovieHelper)) {
-            const movie = new Movie(createMovieHelper);
-            movie.clock = dragonBones.EgretFactory.factory.clock;
-            return movie;
-        }
-        else {
-            console.warn("No movie named: " + movieName);
-        }
-
-        return null;
-    }
-    /**
-     * 获取指定动画组内包含的所有动画名称。
-     * @param groupName 动画组的名称。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    export function getMovieNames(groupName: string): string[] | null {
-        const groupConfig = _groupConfigMap[groupName];
-        if (groupConfig) {
-            const movieNameGroup = [];
-            const movie = groupConfig.movie || groupConfig.animation;
-            for (let i = 0, l = movie.length; i < l; ++i) {
-                movieNameGroup.push(movie[i].name);
-            }
-
-            return movieNameGroup;
-        }
-        else {
-            console.warn("No group named: " + groupName);
-        }
-
-        return null;
-    }
-    /**
-     * 动画事件。
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    export class MovieEvent extends egret.Event {
-        /**
-         * 动画剪辑开始播放。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public static START: string = "start";
-        /**
-         * 动画剪辑循环播放一次完成。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public static LOOP_COMPLETE: string = "loopComplete";
-        /**
-         * 动画剪辑播放完成。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public static COMPLETE: string = "complete";
-        /**
-         * 动画剪辑帧事件。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public static FRAME_EVENT: string = "frameEvent";
-        /**
-         * 动画剪辑声音事件。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public static SOUND_EVENT: string = "soundEvent";
-        /**
-         * 事件名称。 (帧标签的名称或声音的名称)
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public name: string = "";
-        /**
-         * 发出事件的插槽名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public slotName: string = "";
-        /**
-         * 发出事件的动画剪辑名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public clipName: string = "";
-        /**
-         * 发出事件的动画。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public movie: Movie;
-        /**
-         * @private
-         */
-        public constructor(type: string) {
-            super(type);
-        }
-
-        //========================================= // 兼容旧数据
-        /**
-         * @private
-         */
-        public get armature(): any {
-            return this.movie;
-        }
-        /**
-         * @private
-         */
-        public get bone(): any {
-            return null;
-        }
-        /**
-         * @private
-         */
-        public get animationState(): any {
-            return { name: this.clipName };
-        }
-        /**
-         * @private
-         */
-        public get frameLabel(): any {
-            return this.name;
-        }
-        /**
-         * @private
-         */
-        public get movementID(): any {
-            return this.clipName;
-        }
-        //=========================================
-    }
-    /**
-     * @private
-     */
-    class MovieSlot extends egret.HashObject {
-        public displayIndex: number = -1;
-        public colorIndex: number = -1;
-        public transformIndex: number = -1;
-        public rawDisplay: egret.Bitmap = new egret.Bitmap();
-        public childMovies: Map = {};
-        public config: SlotConfig;
-        public displayConfig: DisplayConfig | null = null;
-        public display: egret.DisplayObject;
-        public childMovie: Movie | null = null;
-        public colorFilter: egret.ColorMatrixFilter | null = null;
-
-        public constructor(slotConfig: SlotConfig) {
-            super();
-
-            this.display = this.rawDisplay;
-            this.config = slotConfig;
-            this.rawDisplay.name = this.config.name;
-
-            if (!this.config.blendMode) {
-                this.config.blendMode = BlendMode.Normal;
-            }
-        }
-
-        public dispose(): void {
-            this.rawDisplay = null as any;
-            this.childMovies = null as any;
-            this.config = null as any;
-            this.displayConfig = null as any;
-            this.display = null as any;
-            this.childMovie = null as any;
-            this.colorFilter = null as any;
-        }
-    }
-    /**
-     * 通过读取缓存的二进制动画数据来更新动画,具有良好的运行性能,同时对内存的占用也非常低。
-     * @see dragonBones.buildMovie
-     * @version DragonBones 4.7
-     * @language zh_CN
-     */
-    export class Movie extends egret.DisplayObjectContainer implements IAnimatable {
-        private static _cleanBeforeRender(): void { }
-        /**
-         * 动画的播放速度。 [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]
-         * @default 1
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public timeScale: number = 1;
-        /**
-         * 动画剪辑的播放速度。 [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]
-         * (当再次播放其他动画剪辑时,此值将被重置为 1)
-         * @default 1
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public clipTimeScale: number = 1;
-
-        private _batchEnabled: boolean = true;
-        private _isLockDispose: boolean = false;
-        private _isDelayDispose: boolean = false;
-        private _isStarted: boolean = false;
-        private _isPlaying: boolean = false;
-        private _isReversing: boolean = false;
-        private _isCompleted: boolean = false;
-        private _playTimes: number = 0;
-        private _time: number = 0;
-        private _currentTime: number = 0;
-        private _currentPlayTimes: number = 0;
-        private _cacheFrameIndex: number = 0;
-        private _frameSize: number = 0;
-        private _cacheRectangle: egret.Rectangle | null = null;
-        private _clock: WorldClock | null = null;
-
-        private _groupConfig: GroupConfig;
-        private _config: MovieConfig;
-        private _clipConfig: ClipConfig;
-        private _currentFrameConfig: FrameConfig | null = null;
-        private _clipArray: Int16Array;
-
-        private _clipNames: string[] = [];
-        private _slots: MovieSlot[] = [];
-        private _childMovies: Movie[] = [];
-
-        public constructor(createMovieHelper: any) {
-            super();
-
-            this._groupConfig = (createMovieHelper as CreateMovieHelper).groupConfig;
-            this._config = (createMovieHelper as CreateMovieHelper).movieConfig;
-
-            this._batchEnabled = !(this._config.isNested || this._config.hasChildAnimation);
-
-            if (this._batchEnabled) {
-                this.$renderNode = new egret.sys.GroupNode();
-                this.$renderNode.cleanBeforeRender = Movie._cleanBeforeRender;
-            }
-
-            this._clipNames.length = 0;
-            for (let i = 0, l = this._config.clip.length; i < l; ++i) {
-                this._clipNames.push(this._config.clip[i].name);
-            }
-
-            for (let i = 0, l = this._config.slot.length; i < l; ++i) {
-                const slot = new MovieSlot(this._config.slot[i]);
-                this._updateSlotBlendMode(slot);
-                this._slots.push(slot);
-
-                if (this._batchEnabled) {
-                    (this.$renderNode).addNode(slot.rawDisplay.$renderNode);
-                }
-                else {
-                    this.addChild(slot.rawDisplay);
-                }
-            }
-
-            this._frameSize = (1 + 1) * this._slots.length; // displayFrame, transformFrame.
-            this.name = this._config.name;
-            this.play();
-            this.advanceTime(0.000001);
-            this.stop();
-        }
-
-        private _configToEvent(config: ActionAndEventConfig, event: MovieEvent): void {
-            event.movie = this;
-            event.clipName = this._clipConfig.name;
-            event.name = config.name;
-            event.slotName = config.slot || "";
-        }
-
-        private _onCrossFrame(frameConfig: FrameConfig): void {
-            for (let i = 0, l = frameConfig.actionAndEvent.length; i < l; ++i) {
-                const actionAndEvent = frameConfig.actionAndEvent[i];
-                if (actionAndEvent) {
-                    switch (actionAndEvent.type) {
-                        case ActionType.Sound:
-                            if (EgretFactory.factory.soundEventManager.hasEventListener(MovieEvent.SOUND_EVENT)) {
-                                const event = egret.Event.create(MovieEvent, MovieEvent.SOUND_EVENT);
-                                this._configToEvent(actionAndEvent, event);
-                                EgretFactory.factory.soundEventManager.dispatchEvent(event);
-                                egret.Event.release(event);
-                            }
-                            break;
-
-                        case ActionType.Frame:
-                            if (this.hasEventListener(MovieEvent.FRAME_EVENT)) {
-                                const event = egret.Event.create(MovieEvent, MovieEvent.FRAME_EVENT);
-                                this._configToEvent(actionAndEvent, event);
-                                this.dispatchEvent(event);
-                                egret.Event.release(event);
-                            }
-                            break;
-
-                        case ActionType.Play:
-                            if (actionAndEvent.slot) {
-                                const slot = this._getSlot(actionAndEvent.slot);
-                                if (slot && slot.childMovie) {
-                                    slot.childMovie.play(actionAndEvent.name);
-                                }
-                            }
-                            else {
-                                this.play(actionAndEvent.name);
-                            }
-                            break;
-                    }
-                }
-            }
-        }
-
-        private _updateSlotBlendMode(slot: MovieSlot): void {
-            let blendMode = "";
-
-            switch (slot.config.blendMode) {
-                case BlendMode.Normal:
-                    blendMode = egret.BlendMode.NORMAL;
-                    break;
-
-                case BlendMode.Add:
-                    blendMode = egret.BlendMode.ADD;
-                    break;
-
-                case BlendMode.Erase:
-                    blendMode = egret.BlendMode.ERASE;
-                    break;
-
-                default:
-                    break;
-            }
-
-            if (blendMode) {
-                if (this._batchEnabled) {
-                    // RenderNode display.
-                    (slot.display.$renderNode).blendMode = egret.sys.blendModeToNumber(blendMode);
-                }
-                else {
-                    // Classic display.
-                    slot.display.blendMode = blendMode;
-                }
-            }
-        }
-
-        private _updateSlotColor(slot: MovieSlot, aM: number, rM: number, gM: number, bM: number, aO: number, rO: number, gO: number, bO: number): void {
-            if (
-                rM !== 1 ||
-                gM !== 1 ||
-                bM !== 1 ||
-                rO !== 0 ||
-                gO !== 0 ||
-                bO !== 0 ||
-                aO !== 0
-            ) {
-                if (!slot.colorFilter) {
-                    slot.colorFilter = new egret.ColorMatrixFilter();
-                }
-
-                const colorMatrix = slot.colorFilter.matrix;
-                colorMatrix[0] = rM;
-                colorMatrix[6] = gM;
-                colorMatrix[12] = bM;
-                colorMatrix[18] = aM;
-                colorMatrix[4] = rO;
-                colorMatrix[9] = gO;
-                colorMatrix[14] = bO;
-                colorMatrix[19] = aO;
-
-                slot.colorFilter.matrix = colorMatrix;
-
-                if (this._batchEnabled) {
-                    // RenderNode display.
-                    (slot.display.$renderNode).filter = slot.colorFilter;
-                    (slot.display.$renderNode).alpha = 1.0;
-                }
-                else {
-                    // Classic display.
-                    let filters = slot.display.filters;
-                    if (!filters) {
-                        filters = [];
-                    }
-
-                    if (filters.indexOf(slot.colorFilter) < 0) {
-                        filters.push(slot.colorFilter);
-                    }
-
-                    slot.display.filters = filters;
-                    slot.display.$setAlpha(1.0);
-                }
-            }
-            else {
-                if (slot.colorFilter) {
-                    slot.colorFilter = null;
-                }
-
-                if (this._batchEnabled) {
-                    // RenderNode display.
-                    (slot.display.$renderNode).filter = null as any;
-                    (slot.display.$renderNode).alpha = aM;
-                }
-                else {
-                    // Classic display.
-                    slot.display.filters = null as any;
-                    slot.display.$setAlpha(aM);
-                }
-            }
-        }
-
-        private _updateSlotDisplay(slot: MovieSlot): void {
-            const prevDisplay = slot.display || slot.rawDisplay;
-            const prevChildMovie = slot.childMovie;
-
-            if (slot.displayIndex >= 0) {
-                slot.displayConfig = this._groupConfig.display[slot.displayIndex];
-                if (slot.displayConfig.type === DisplayType.Armature) {
-                    let childMovie = slot.displayConfig.name in slot.childMovies ? slot.childMovies[slot.displayConfig.name] : null;
-
-                    if (!childMovie) {
-                        childMovie = buildMovie(slot.displayConfig.name, this._groupConfig.name);
-                        if (childMovie) {
-                            slot.childMovies[slot.displayConfig.name] = childMovie;
-                        }
-                    }
-
-                    if (childMovie) {
-                        slot.display = childMovie;
-                        slot.childMovie = childMovie;
-                    }
-                    else {
-                        slot.display = slot.rawDisplay;
-                        slot.childMovie = null;
-                    }
-                }
-                else {
-                    slot.display = slot.rawDisplay;
-                    slot.childMovie = null;
-                }
-            }
-            else {
-                slot.displayConfig = null;
-                slot.display = slot.rawDisplay;
-                slot.childMovie = null;
-            }
-
-            if (slot.display !== prevDisplay) {
-                if (prevDisplay) {
-                    this.addChild(slot.display);
-                    this.swapChildren(slot.display, prevDisplay);
-                    this.removeChild(prevDisplay);
-                }
-
-                // Update blendMode.
-                this._updateSlotBlendMode(slot);
-            }
-
-            // Update frame.
-            if (slot.display === slot.rawDisplay) {
-                if (slot.displayConfig && slot.displayConfig.regionIndex !== null && slot.displayConfig.regionIndex !== undefined) {
-                    if (!slot.displayConfig.texture) {
-                        const textureAtlasTexture = this._groupConfig.textures[slot.displayConfig.textureIndex || 0];
-                        const regionIndex = slot.displayConfig.regionIndex * 4;
-                        const x = this._groupConfig.rectangleArray[regionIndex];
-                        const y = this._groupConfig.rectangleArray[regionIndex + 1];
-                        const width = this._groupConfig.rectangleArray[regionIndex + 2];
-                        const height = this._groupConfig.rectangleArray[regionIndex + 3];
-
-                        slot.displayConfig.texture = new egret.Texture();
-                        slot.displayConfig.texture.bitmapData = textureAtlasTexture.bitmapData;
-                        slot.displayConfig.texture.$initData(
-                            x, y,
-                            Math.min(width, textureAtlasTexture.textureWidth - x), Math.min(height, textureAtlasTexture.textureHeight - y),
-                            0, 0,
-                            Math.min(width, textureAtlasTexture.textureWidth - x), Math.min(height, textureAtlasTexture.textureHeight - y),
-                            textureAtlasTexture.textureWidth, textureAtlasTexture.textureHeight
-                        );
-                    }
-
-                    if (this._batchEnabled) {
-                        // RenderNode display.
-                        const texture = slot.displayConfig.texture;
-                        const bitmapNode = slot.rawDisplay.$renderNode as egret.sys.BitmapNode;
-                        egret.sys.RenderNode.prototype.cleanBeforeRender.call(slot.rawDisplay.$renderNode);
-
-                        bitmapNode.image = texture.bitmapData;
-
-                        if (isV5) {
-                            bitmapNode.drawImage(
-                                (texture as any).$bitmapX, (texture as any).$bitmapY,
-                                (texture as any).$bitmapWidth, (texture as any).$bitmapHeight,
-                                (texture as any).$offsetX, (texture as any).$offsetY,
-                                texture.textureWidth, texture.textureHeight
-                            );
-
-                            bitmapNode.imageWidth = (texture as any)._sourceWidth;
-                            bitmapNode.imageHeight = (texture as any)._sourceHeight;
-                        }
-                        else {
-                            const textureV4 = texture as any;
-                            bitmapNode.drawImage(
-                                textureV4._bitmapX, textureV4._bitmapY,
-                                textureV4._bitmapWidth, textureV4._bitmapHeight,
-                                textureV4._offsetX, textureV4._offsetY,
-                                texture.textureWidth, texture.textureHeight
-                            );
-
-                            bitmapNode.imageWidth = textureV4._sourceWidth;
-                            bitmapNode.imageHeight = textureV4._sourceHeight;
-                        }
-                    }
-                    else {
-                        // Classic display.
-                        slot.rawDisplay.visible = true;
-                        slot.rawDisplay.$setBitmapData(slot.displayConfig.texture);
-                    }
-                }
-                else {
-                    if (this._batchEnabled) {
-                        // RenderNode display.
-                        (slot.rawDisplay.$renderNode).image = null as any;
-                    }
-                    else {
-                        // Classic display.
-                        slot.rawDisplay.visible = false;
-                        slot.rawDisplay.$setBitmapData(null as any);
-                    }
-                }
-            }
-
-            // Update child movie.
-            if (slot.childMovie !== prevChildMovie) {
-                if (prevChildMovie) {
-                    prevChildMovie.stop();
-                    this._childMovies.slice(this._childMovies.indexOf(prevChildMovie), 1);
-                }
-
-                if (slot.childMovie) {
-                    if (this._childMovies.indexOf(slot.childMovie) < 0) {
-                        this._childMovies.push(slot.childMovie);
-                    }
-
-                    if (slot.config.action) {
-                        slot.childMovie.play(slot.config.action);
-                    }
-                    else {
-                        slot.childMovie.play(slot.childMovie._config.action);
-                    }
-                }
-            }
-        }
-
-        private _getSlot(name: string): MovieSlot | null {
-            for (let i = 0, l = this._slots.length; i < l; ++i) {
-                const slot = this._slots[i];
-                if (slot.config.name === name) {
-                    return slot;
-                }
-            }
-
-            return null;
-        }
-        /**
-         * @inheritDoc
-         */
-        $render(): void {
-            if (this._batchEnabled) {
-                // RenderNode display.
-            }
-            else {
-                // Classic display.
-                super.$render();
-            }
-        }
-        /**
-         * @inheritDoc
-         */
-        $updateRenderNode(): void {
-            if (this._batchEnabled) {
-                // RenderNode display.
-            }
-            else {
-                // Classic display.
-                super.$updateRenderNode();
-            }
-        }
-        /**
-         * @inheritDoc
-         */
-        $measureContentBounds(bounds: egret.Rectangle): void {
-            if (this._batchEnabled && this._cacheRectangle) {
-                // RenderNode display.
-                bounds.setTo(this._cacheRectangle.x, this._cacheRectangle.y, this._cacheRectangle.width - this._cacheRectangle.x, this._cacheRectangle.height - this._cacheRectangle.y);
-            }
-            else {
-                // Classic display.
-                super.$measureContentBounds(bounds);
-            }
-        }
-        /**
-         * @inheritDoc
-         */
-        $doAddChild(child: egret.DisplayObject, index: number, notifyListeners?: boolean): egret.DisplayObject {
-            if (this._batchEnabled) {
-                // RenderNode display.
-                console.warn("Can not add child.");
-                return null as any;
-            }
-
-            // Classic display.
-            return super.$doAddChild(child, index, notifyListeners);
-        }
-        /**
-         * @inheritDoc
-         */
-        $doRemoveChild(index: number, notifyListeners?: boolean): egret.DisplayObject {
-            if (this._batchEnabled) {
-                // RenderNode display.
-                console.warn("Can not remove child.");
-                return null as any;
-            }
-
-            // Classic display.
-            return super.$doRemoveChild(index, notifyListeners);
-        }
-        /**
-         * 释放动画。
-         * @version DragonBones 3.0
-         * @language zh_CN
-         */
-        public dispose(): void {
-            if (this._isLockDispose) {
-                this._isDelayDispose = true;
-            }
-            else {
-                if (this._clock) {
-                    this._clock.remove(this);
-                }
-
-                if (this._slots) {
-                    for (let i = 0, l = this._slots.length; i < l; ++i) {
-                        this._slots[i].dispose();
-                    }
-                }
-
-                this._isPlaying = false;
-                this._cacheRectangle = null;
-                this._clock = null;
-                this._groupConfig = null as any;
-                this._config = null as any;
-                this._clipConfig = null as any;
-                this._currentFrameConfig = null;
-                this._clipArray = null as any;
-
-                this._clipNames = null as any;
-                this._slots = null as any;
-                this._childMovies = null as any;
-            }
-        }
-        /**
-         * @inheritDoc
-         */
-        public advanceTime(passedTime: number): void {
-            if (this._isPlaying) {
-                this._isLockDispose = true;
-                if (passedTime < 0) {
-                    passedTime = -passedTime;
-                }
-                passedTime *= this.timeScale;
-                this._time += passedTime * this.clipTimeScale;
-
-                // Modify time.            
-                const duration = this._clipConfig.duration;
-                const totalTime = duration * this._playTimes;
-                let currentTime = this._time;
-                let currentPlayTimes = this._currentPlayTimes;
-                if (this._playTimes > 0 && (currentTime >= totalTime || currentTime <= -totalTime)) {
-                    this._isCompleted = true;
-                    currentPlayTimes = this._playTimes;
-
-                    if (currentTime < 0) {
-                        currentTime = 0;
-                    }
-                    else {
-                        currentTime = duration;
-                    }
-                }
-                else {
-                    this._isCompleted = false;
-
-                    if (currentTime < 0) {
-                        currentPlayTimes = Math.floor(-currentTime / duration);
-                        currentTime = duration - (-currentTime % duration);
-                    }
-                    else {
-                        currentPlayTimes = Math.floor(currentTime / duration);
-                        currentTime %= duration;
-                    }
-
-                    if (this._playTimes > 0 && currentPlayTimes > this._playTimes) {
-                        currentPlayTimes = this._playTimes;
-                    }
-                }
-
-                if (this._currentTime === currentTime) {
-                    return;
-                }
-
-                const cacheFrameIndex = Math.floor(currentTime * this._clipConfig.cacheTimeToFrameScale);
-                if (this._cacheFrameIndex !== cacheFrameIndex) {
-                    this._cacheFrameIndex = cacheFrameIndex;
-
-                    const displayFrameArray = this._groupConfig.displayFrameArray;
-                    const transformArray = this._groupConfig.transformArray;
-                    const colorArray = this._groupConfig.colorArray;
-
-                    //
-                    let isFirst = true;
-                    let hasDisplay = false;
-                    let needCacheRectangle = false;
-                    const prevCacheRectangle = this._cacheRectangle;
-                    this._cacheRectangle = this._clipConfig.cacheRectangles[this._cacheFrameIndex];
-                    if (this._batchEnabled && !this._cacheRectangle) {
-                        needCacheRectangle = true;
-                        this._cacheRectangle = new egret.Rectangle();
-                        this._clipConfig.cacheRectangles[this._cacheFrameIndex] = this._cacheRectangle;
-                    }
-
-                    // Update slots.
-                    for (let i = 0, l = this._slots.length; i < l; ++i) {
-                        const slot = this._slots[i];
-                        let clipFrameIndex = this._frameSize * this._cacheFrameIndex + i * 2;
-                        if (clipFrameIndex >= this._clipArray.length) {
-                            clipFrameIndex = this._frameSize * (this._cacheFrameIndex - 1) + i * 2;
-                        }
-                        const displayFrameIndex = this._clipArray[clipFrameIndex] * 2;
-                        if (displayFrameIndex >= 0) {
-                            const displayIndex = displayFrameArray[displayFrameIndex];
-                            const colorIndex = displayFrameArray[displayFrameIndex + 1] * 8;
-                            const transformIndex = this._clipArray[clipFrameIndex + 1] * 6;
-                            let colorChange = false;
-
-                            if (slot.displayIndex !== displayIndex) {
-                                slot.displayIndex = displayIndex;
-                                colorChange = true;
-                                this._updateSlotDisplay(slot);
-                            }
-
-                            if (slot.colorIndex !== colorIndex || colorChange) {
-                                slot.colorIndex = colorIndex;
-                                if (slot.colorIndex >= 0) {
-                                    this._updateSlotColor(
-                                        slot,
-                                        colorArray[colorIndex] * 0.01,
-                                        colorArray[colorIndex + 1] * 0.01,
-                                        colorArray[colorIndex + 2] * 0.01,
-                                        colorArray[colorIndex + 3] * 0.01,
-                                        colorArray[colorIndex + 4],
-                                        colorArray[colorIndex + 5],
-                                        colorArray[colorIndex + 6],
-                                        colorArray[colorIndex + 7]
-                                    );
-                                }
-                                else {
-                                    this._updateSlotColor(slot, 1, 1, 1, 1, 0, 0, 0, 0);
-                                }
-                            }
-
-                            hasDisplay = true;
-
-                            if (slot.transformIndex !== transformIndex) {
-                                slot.transformIndex = transformIndex;
-
-                                if (this._batchEnabled) {
-                                    // RenderNode display.
-                                    let matrix = (slot.display.$renderNode).matrix;
-                                    if (!matrix) {
-                                        matrix = (slot.display.$renderNode).matrix = new egret.Matrix();
-                                    }
-
-                                    matrix.a = transformArray[transformIndex];
-                                    matrix.b = transformArray[transformIndex + 1];
-                                    matrix.c = transformArray[transformIndex + 2];
-                                    matrix.d = transformArray[transformIndex + 3];
-                                    matrix.tx = transformArray[transformIndex + 4];
-                                    matrix.ty = transformArray[transformIndex + 5];
-                                }
-                                else {
-                                    // Classic display.
-                                    _helpMatrix.a = transformArray[transformIndex];
-                                    _helpMatrix.b = transformArray[transformIndex + 1];
-                                    _helpMatrix.c = transformArray[transformIndex + 2];
-                                    _helpMatrix.d = transformArray[transformIndex + 3];
-                                    _helpMatrix.tx = transformArray[transformIndex + 4];
-                                    _helpMatrix.ty = transformArray[transformIndex + 5];
-
-                                    slot.display.$setMatrix(_helpMatrix);
-                                }
-                            }
-
-                            // 
-                            if (this._batchEnabled && needCacheRectangle && slot.displayConfig) {
-                                // RenderNode display.
-                                const matrix = (slot.display.$renderNode).matrix;
-
-                                _helpRectangle.x = 0;
-                                _helpRectangle.y = 0;
-                                _helpRectangle.width = slot.displayConfig.texture.textureWidth;
-                                _helpRectangle.height = slot.displayConfig.texture.textureHeight;
-                                matrix.$transformBounds(_helpRectangle);
-
-                                if (isFirst) {
-                                    isFirst = false;
-                                    this._cacheRectangle.x = _helpRectangle.x;
-                                    this._cacheRectangle.width = _helpRectangle.x + _helpRectangle.width;
-                                    this._cacheRectangle.y = _helpRectangle.y;
-                                    this._cacheRectangle.height = _helpRectangle.y + _helpRectangle.height;
-                                }
-                                else {
-                                    this._cacheRectangle.x = Math.min(this._cacheRectangle.x, _helpRectangle.x);
-                                    this._cacheRectangle.width = Math.max(this._cacheRectangle.width, _helpRectangle.x + _helpRectangle.width);
-                                    this._cacheRectangle.y = Math.min(this._cacheRectangle.y, _helpRectangle.y);
-                                    this._cacheRectangle.height = Math.max(this._cacheRectangle.height, _helpRectangle.y + _helpRectangle.height);
-                                }
-                            }
-                        }
-                        else if (slot.displayIndex !== -1) {
-                            slot.displayIndex = -1;
-                            this._updateSlotDisplay(slot);
-                        }
-                    }
-
-                    //
-                    if (this._cacheRectangle) {
-                        if (hasDisplay && needCacheRectangle && isFirst && prevCacheRectangle) {
-                            this._cacheRectangle.x = prevCacheRectangle.x;
-                            this._cacheRectangle.y = prevCacheRectangle.y;
-                            this._cacheRectangle.width = prevCacheRectangle.width;
-                            this._cacheRectangle.height = prevCacheRectangle.height;
-                        }
-
-                        if (!isV5) {
-                            (this as any).$invalidateContentBounds();
-                        }
-                    }
-                }
-
-                if (this._isCompleted) {
-                    this._isPlaying = false;
-                }
-
-                if (!this._isStarted) {
-                    this._isStarted = true;
-                    if (this.hasEventListener(MovieEvent.START)) {
-                        const event = egret.Event.create(MovieEvent, MovieEvent.START);
-                        event.movie = this;
-                        event.clipName = this._clipConfig.name;
-                        event.name = "";
-                        event.slotName = "";
-                        this.dispatchEvent(event);
-                    }
-                }
-
-                this._isReversing = this._currentTime > currentTime && this._currentPlayTimes === currentPlayTimes;
-                this._currentTime = currentTime;
-
-                // Action and event.
-                const frameCount = this._clipConfig.frame ? this._clipConfig.frame.length : 0;
-                if (frameCount > 0) {
-                    const currentFrameIndex = Math.floor(this._currentTime * this._config.frameRate);
-                    const currentFrameConfig = this._groupConfig.frame[this._clipConfig.frame[currentFrameIndex]];
-                    if (this._currentFrameConfig !== currentFrameConfig) {
-                        if (frameCount > 1) {
-                            let crossedFrameConfig = this._currentFrameConfig;
-                            this._currentFrameConfig = currentFrameConfig;
-
-                            if (!crossedFrameConfig) {
-                                const prevFrameIndex = Math.floor(this._currentTime * this._config.frameRate);
-                                crossedFrameConfig = this._groupConfig.frame[this._clipConfig.frame[prevFrameIndex]];
-
-                                if (this._isReversing) {
-
-                                }
-                                else {
-                                    if (
-                                        this._currentTime <= crossedFrameConfig.position ||
-                                        this._currentPlayTimes !== currentPlayTimes
-                                    ) {
-                                        crossedFrameConfig = this._groupConfig.frame[crossedFrameConfig.prev];
-                                    }
-                                }
-                            }
-
-                            if (this._isReversing) {
-                                while (crossedFrameConfig !== currentFrameConfig) {
-                                    this._onCrossFrame(crossedFrameConfig);
-                                    crossedFrameConfig = this._groupConfig.frame[crossedFrameConfig.prev];
-                                }
-                            }
-                            else {
-                                while (crossedFrameConfig !== currentFrameConfig) {
-                                    crossedFrameConfig = this._groupConfig.frame[crossedFrameConfig.next];
-                                    this._onCrossFrame(crossedFrameConfig);
-                                }
-                            }
-                        }
-                        else {
-                            this._currentFrameConfig = currentFrameConfig;
-                            if (this._currentFrameConfig) {
-                                this._onCrossFrame(this._currentFrameConfig);
-                            }
-                        }
-                    }
-                }
-
-                if (this._currentPlayTimes !== currentPlayTimes) {
-                    this._currentPlayTimes = currentPlayTimes;
-                    if (this.hasEventListener(MovieEvent.LOOP_COMPLETE)) {
-                        const event = egret.Event.create(MovieEvent, MovieEvent.LOOP_COMPLETE);
-                        event.movie = this;
-                        event.clipName = this._clipConfig.name;
-                        event.name = "";
-                        event.slotName = "";
-                        this.dispatchEvent(event);
-                        egret.Event.release(event);
-                    }
-
-                    if (this._isCompleted && this.hasEventListener(MovieEvent.COMPLETE)) {
-                        const event = egret.Event.create(MovieEvent, MovieEvent.COMPLETE);
-                        event.movie = this;
-                        event.clipName = this._clipConfig.name;
-                        event.name = "";
-                        event.slotName = "";
-                        this.dispatchEvent(event);
-                        egret.Event.release(event);
-                    }
-                }
-            }
-
-            this._isLockDispose = false;
-            if (this._isDelayDispose) {
-                this.dispose();
-            }
-        }
-        /**
-         * 播放动画剪辑。
-         * @param clipName 动画剪辑的名称,如果未设置,则播放默认动画剪辑,或将暂停状态切换为播放状态,或重新播放上一个正在播放的动画剪辑。 
-         * @param playTimes 动画剪辑需要播放的次数。 [-1: 使用动画剪辑默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次]
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public play(clipName: string | null = null, playTimes: number = -1): void {
-            if (clipName) {
-                let clipConfig: ClipConfig | null = null;
-                for (let i = 0, l = this._config.clip.length; i < l; ++i) {
-                    const data = this._config.clip[i];
-                    if (data.name === clipName) {
-                        clipConfig = data;
-                    }
-                }
-
-                if (clipConfig) {
-                    this._clipConfig = clipConfig;
-                    this._clipArray = new Int16Array(this._groupConfig.arrayBuffer, this._groupConfig.offset + this._groupConfig.position[0] + this._clipConfig.p, this._clipConfig.s / this._groupConfig.position[2]);
-
-                    if (!this._clipConfig.cacheRectangles) {
-                        this._clipConfig.cacheRectangles = [];
-                    }
-
-                    this._isPlaying = true;
-                    this._isStarted = false;
-                    this._isCompleted = false;
-
-                    if (playTimes < 0 || playTimes !== playTimes) {
-                        this._playTimes = this._clipConfig.playTimes;
-                    }
-                    else {
-                        this._playTimes = playTimes;
-                    }
-
-                    this._time = 0;
-                    this._currentTime = 0;
-                    this._currentPlayTimes = 0;
-                    this._cacheFrameIndex = -1;
-                    this._currentFrameConfig = null;
-                    this._cacheRectangle = null;
-
-                    this.clipTimeScale = 1 / this._clipConfig.scale;
-                }
-                else {
-                    console.warn("No clip in movie.", this._config.name, clipName);
-                }
-            }
-            else if (this._clipConfig) {
-                if (this._isPlaying || this._isCompleted) {
-                    this.play(this._clipConfig.name, this._playTimes);
-                }
-                else {
-                    this._isPlaying = true;
-                }
-                // playTimes
-            }
-            else if (this._config.action) {
-                this.play(this._config.action, playTimes);
-            }
-        }
-        /**
-         * 暂停播放动画。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public stop(): void {
-            this._isPlaying = false;
-        }
-        /**
-         * 从指定时间播放动画。
-         * @param clipName 动画剪辑的名称。 
-         * @param time 指定时间。(以秒为单位)
-         * @param playTimes 动画剪辑需要播放的次数。 [-1: 使用动画剪辑默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次]
-         * @version DragonBones 5.0
-         * @language zh_CN
-         */
-        public gotoAndPlay(clipName: string | null = null, time: number, playTimes: number = -1): void {
-            time %= this._clipConfig.duration;
-            if (time < 0) {
-                time += this._clipConfig.duration;
-            }
-
-            this.play(clipName, playTimes);
-            this._time = time;
-            this._currentTime = time;
-        }
-        /**
-         * 将动画停止到指定时间。
-         * @param clipName 动画剪辑的名称。 
-         * @param time 指定时间。(以秒为单位)
-         * @version DragonBones 5.0
-         * @language zh_CN
-         */
-        public gotoAndStop(clipName: string | null = null, time: number): void {
-            time %= this._clipConfig.duration;
-            if (time < 0) {
-                time += this._clipConfig.duration;
-            }
-
-            this.play(clipName, 1);
-            this._time = time;
-            this._currentTime = time;
-
-            this.advanceTime(0.001);
-            this.stop();
-        }
-        /**
-         * 是否包含指定动画剪辑。
-         * @param clipName 动画剪辑的名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public hasClip(clipName: string): boolean {
-            for (let i = 0, l = this._config.clip.length; i < l; ++i) {
-                const clip = this._config.clip[i];
-                if (clip.name === clipName) {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-        /**
-         * 动画剪辑是否处正在播放。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public get isPlaying(): boolean {
-            return this._isPlaying && !this._isCompleted;
-        }
-        /**
-         * 动画剪辑是否均播放完毕。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public get isComplete(): boolean {
-            return this._isCompleted;
-        }
-        /**
-         * 当前动画剪辑的播放时间。 (以秒为单位)
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public get currentTime(): number {
-            return this._currentTime;
-        }
-        /**
-         * 当前动画剪辑的总时间。 (以秒为单位)
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public get totalTime(): number {
-            return this._clipConfig ? this._clipConfig.duration : 0;
-        }
-        /**
-         * 当前动画剪辑的播放次数。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public get currentPlayTimes(): number {
-            return this._currentPlayTimes;
-        }
-        /**
-         * 当前动画剪辑需要播放的次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次]
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public get playTimes(): number {
-            return this._playTimes;
-        }
-
-        public get groupName(): string {
-            return this._groupConfig.name;
-        }
-        /**
-         * 正在播放的动画剪辑名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public get clipName(): string {
-            return this._clipConfig ? this._clipConfig.name : "";
-        }
-        /**
-         * 所有动画剪辑的名称。
-         * @version DragonBones 4.7
-         * @language zh_CN
-         */
-        public get clipNames(): string[] {
-            return this._clipNames;
-        }
-        /**
-         * @inheritDoc
-         */
-        public get clock(): WorldClock | null {
-            return this._clock;
-        }
-        public set clock(value: WorldClock | null) {
-            if (this._clock === value) {
-                return;
-            }
-
-            const prevClock = this._clock;
-            if (prevClock) {
-                prevClock.remove(this);
-            }
-
-            this._clock = value;
-            if (this._clock) {
-                this._clock.add(this);
-            }
-        }
-
-        /**
-         * 已废弃,请参考 {@link dragonBones.Movie#clock} {@link dragonBones.Movie#clock} {@link dragonBones.EgretFactory#clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public advanceTimeBySelf(on: boolean): void {
-            if (on) {
-                this.clock = EgretFactory.clock;
-            }
-            else {
-                this.clock = null;
-            }
-        }
-
-        //========================================= // 兼容旧数据
-        /**
-         * @private
-         */
-        public get display(): any {
-            return this;
-        }
-        /**
-         * @private
-         */
-        public get animation(): any {
-            return this;
-        }
-        /**
-         * @private
-         */
-        public get armature(): any {
-            return this;
-        }
-        /**
-         * @private
-         */
-        public getAnimation(): any {
-            return this;
-        }
-        /**
-         * @private
-         */
-        public getArmature(): any {
-            return this;
-        }
-        /**
-         * @private
-         */
-        public getDisplay(): any {
-            return this;
-        }
-        /**
-         * @private
-         */
-        public hasAnimation(name: string): boolean {
-            return this.hasClip(name);
-        }
-        /**
-         * @private
-         */
-        public invalidUpdate(...args: any[]): void {
-            // tslint:disable-next-line:no-unused-expression
-            args;
-        }
-        /**
-         * @private
-         */
-        public get lastAnimationName(): string {
-            return this.clipName;
-        }
-        /**
-         * @private
-         */
-        public get animationNames(): string[] {
-            return this.clipNames;
-        }
-        /**
-         * @private
-         */
-        public get animationList(): string[] {
-            return this.clipNames;
-        }
-        //=========================================
-    }
-}
\ No newline at end of file
diff --git a/Egret/4.x/tsconfig.json b/Egret/4.x/tsconfig.json
index a6e300d9..932b2571 100644
--- a/Egret/4.x/tsconfig.json
+++ b/Egret/4.x/tsconfig.json
@@ -3,6 +3,7 @@
 		"watch": false,
 		"sourceMap": false,
 		"declaration": true,
+        "stripInternal": true,
 		"alwaysStrict": true,
 		"noImplicitAny": true,
 		"noImplicitThis": true,
@@ -25,7 +26,6 @@
 	],
 	"files": [
 		"./libs/egret.d.ts",
-		"../../DragonBones/src/dragonBones/modules.ts",
 		
 		"../../DragonBones/src/dragonBones/core/DragonBones.ts",
 		"../../DragonBones/src/dragonBones/core/BaseObject.ts",
@@ -48,8 +48,6 @@
 		"../../DragonBones/src/dragonBones/model/AnimationConfig.ts",
 		"../../DragonBones/src/dragonBones/model/TextureAtlasData.ts",
 
-		"../../DragonBones/src/dragonBones/armature/DeformVertices.ts",
-
 		"../../DragonBones/src/dragonBones/armature/IArmatureProxy.ts",
 		"../../DragonBones/src/dragonBones/armature/Armature.ts",
 		"../../DragonBones/src/dragonBones/armature/TransformObject.ts",
@@ -77,7 +75,6 @@
 		"./src/dragonBones/egret/EgretTextureAtlasData.ts",
 		"./src/dragonBones/egret/EgretArmatureDisplay.ts",
 		"./src/dragonBones/egret/EgretSlot.ts",
-		"./src/dragonBones/egret/EgretFactory.ts",
-		"./src/dragonBones/egret/Movie.ts"
+		"./src/dragonBones/egret/EgretFactory.ts"
 	]
 }
\ No newline at end of file
diff --git a/Egret/Demos/resource/effect/Dragon_ske.json b/Egret/Demos/resource/effect/Dragon_ske.json
new file mode 100644
index 00000000..06b498a8
--- /dev/null
+++ b/Egret/Demos/resource/effect/Dragon_ske.json
@@ -0,0 +1 @@
+{"frameRate":24,"name":"Dragon","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"Dragon","aabb":{"x":-234.41,"y":-431.81,"width":693.28,"height":769.59},"bone":[{"name":"root"},{"length":150,"name":"body","parent":"root","transform":{"x":26.0941,"y":50.5419,"skX":-94.9653,"skY":-94.9653}},{"length":120,"name":"legR","parent":"body","transform":{"x":-95.6182,"y":46.9,"skX":-156.0107,"skY":-156.0107}},{"length":150,"name":"armUpperR","parent":"body","transform":{"x":80.5853,"y":31.3927,"skX":159.9921,"skY":159.9921}},{"length":150,"name":"legL","parent":"body","transform":{"x":-71.0496,"y":-60.2758,"skX":-154.3312,"skY":-154.3312}},{"length":150,"name":"head","parent":"body","transform":{"x":163.1145,"y":-5.8037,"skX":11.4957,"skY":11.4957}},{"length":70,"name":"armUpperL","parent":"body","transform":{"x":74.4813,"y":-93.6047,"skX":-171.7742,"skY":-171.7742}},{"length":250,"name":"tail","parent":"body","transform":{"x":-117.1092,"y":70.127,"skX":79.7425,"skY":79.7425}},{"length":80,"name":"clothes","parent":"body","transform":{"x":1.423,"y":-31.7416,"skX":-37.5342,"skY":-37.5342}},{"length":60,"name":"armL","parent":"armUpperL","transform":{"x":66.7632,"y":2.2256,"skX":30.7088,"skY":30.7088}},{"name":"eyeR","parent":"head","transform":{"x":140.2628,"y":-23.9957,"skX":80.4531,"skY":80.4531}},{"length":150,"name":"tailTip","parent":"tail","transform":{"x":257.8621,"y":-3.1008,"skX":-37.5192,"skY":-37.5192}},{"name":"eyeL","parent":"head","transform":{"x":133.7701,"y":-101.188,"skX":80.4531,"skY":80.4531}},{"length":80,"name":"beardL","parent":"head","transform":{"x":7.4588,"y":-133.6248,"skX":-105.5036,"skY":-105.5036}},{"length":50,"name":"armR","parent":"armUpperR","transform":{"x":138.7492,"y":0.5285,"skX":35.2088,"skY":35.2088}},{"length":80,"name":"beardR","parent":"head","transform":{"x":23.2753,"y":-35.857,"skX":80.4531,"skY":80.4531}},{"length":50,"name":"hair","parent":"head","transform":{"x":104.8249,"y":80.6309,"skX":86.9099,"skY":86.9099}},{"length":40,"name":"handR","parent":"armR","transform":{"x":43.3874,"y":1.1079,"skX":17.875,"skY":17.875}},{"length":80,"name":"handL","parent":"armL","transform":{"x":66.6309,"y":-0.4273,"skX":4.4133,"skY":4.4133}}],"slot":[{"name":"tailTip","parent":"tailTip"},{"name":"armUpperL","parent":"armUpperL"},{"name":"armL","parent":"armL"},{"name":"handL","parent":"handL"},{"name":"legL","parent":"legL"},{"name":"body","parent":"body"},{"name":"tail","parent":"tail"},{"name":"clothes","parent":"clothes"},{"name":"hair","parent":"hair"},{"name":"head","parent":"head"},{"name":"eyeL","parent":"eyeL"},{"name":"eyeR","parent":"eyeR"},{"name":"legR","parent":"legR"},{"name":"armUpperR","parent":"armUpperR"},{"name":"armR","parent":"armR"},{"name":"handR","parent":"handR"},{"name":"beardL","parent":"beardL"},{"name":"beardR","parent":"beardR"}],"skin":[{"slot":[{"name":"eyeR","display":[{"name":"parts/eyeR","transform":{"x":1.5,"y":-0.5}}]},{"name":"legL","display":[{"name":"parts/legL","transform":{"x":101.11,"y":-6.45,"skX":-146.91,"skY":-146.91}}]},{"name":"eyeL","display":[{"name":"parts/eyeL","transform":{"x":0.3,"y":0.4}}]},{"name":"beardL","display":[{"name":"parts/beardL","transform":{"x":49.98,"y":-4.35,"skX":-174.04,"skY":-174.04}}]},{"name":"head","display":[{"name":"parts/head","transform":{"x":122.95,"y":-10.54,"skX":80.45,"skY":80.45}}]},{"name":"armUpperR","display":[{"name":"parts/armUpperR","transform":{"x":56.52,"y":4.74,"skX":13.92,"skY":13.92}}]},{"name":"legR","display":[{"name":"parts/legR","transform":{"x":82.58,"y":-6.01,"skX":-94.02,"skY":-94.02}}]},{"name":"beardR","display":[{"name":"parts/beardR","transform":{"x":61.6,"y":0.2}}]},{"name":"armL","display":[{"name":"parts/armL","transform":{"x":26.69,"y":-2.88,"skX":98.3,"skY":98.3}}]},{"name":"clothes","display":[{"name":"parts/clothes1","transform":{"x":32.4,"y":16.05,"skX":132.5,"skY":132.5}}]},{"name":"armUpperL","display":[{"name":"parts/armUpperL","transform":{"x":27.9,"y":4.32,"skX":-148.26,"skY":-148.26}}]},{"name":"body","display":[{"name":"parts/body","transform":{"x":-0.96,"y":0.62,"skX":94.97,"skY":94.97}}]},{"name":"tailTip","display":[{"name":"parts/tailTip","transform":{"x":81.65,"y":-0.82,"skX":82.74,"skY":82.74}}]},{"name":"handL","display":[{"name":"parts/handL","transform":{"x":34.73,"y":-1.45,"skX":146.62,"skY":146.62}}]},{"name":"handR","display":[{"name":"parts/handR","transform":{"x":23.05,"y":5.06,"skX":-88.11,"skY":-88.11}}]},{"name":"hair","display":[{"name":"parts/hair","transform":{"x":0.04,"y":0.4,"skX":-4.91,"skY":-4.91}}]},{"name":"tail","display":[{"name":"parts/tail","transform":{"x":120.99,"y":-0.31,"skX":45.22,"skY":45.22}}]},{"name":"armR","display":[{"name":"parts/armR","transform":{"x":14.22,"y":2.79,"skX":-85.24,"skY":-85.24}}]}]}],"animation":[{"duration":30,"playTimes":0,"name":"stand","bone":[{"name":"tail","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":-4},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":4.95},{"duration":0}]},{"name":"clothes","translateFrame":[{"duration":12,"tweenEasing":0},{"duration":18,"tweenEasing":0,"x":-2,"y":-2},{"duration":0}]},{"name":"eyeR","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":22,"tweenEasing":0,"y":-2},{"duration":0}]},{"name":"tailTip","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":5.13,"y":-8.06},{"duration":0}],"rotateFrame":[{"duration":8,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-12.64},{"duration":0}]},{"name":"eyeL","translateFrame":[{"duration":8,"tweenEasing":0},{"duration":22,"tweenEasing":0,"y":-2},{"duration":0}]},{"name":"beardL","rotateFrame":[{"duration":15,"tweenEasing":0,"rotate":9.62},{"duration":15,"tweenEasing":0,"rotate":-1.48},{"duration":0,"rotate":9.62}]},{"name":"beardR","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":15,"tweenEasing":0,"rotate":5.44},{"duration":0}]},{"name":"hair","translateFrame":[{"duration":12,"tweenEasing":0},{"duration":18,"tweenEasing":0,"x":2,"y":-4},{"duration":0}]}]},{"duration":20,"playTimes":0,"name":"walk","bone":[{"name":"body","translateFrame":[{"duration":10,"tweenEasing":0,"y":-4},{"duration":10,"tweenEasing":0,"y":-2},{"duration":0,"y":-4}]},{"name":"legR","translateFrame":[{"duration":10,"tweenEasing":0,"x":-6,"y":-14},{"duration":10,"tweenEasing":0,"x":-3.9,"y":-2},{"duration":0,"x":-6,"y":-14}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":-30},{"duration":10,"tweenEasing":0,"rotate":30},{"duration":0,"rotate":-30}]},{"name":"armUpperR","translateFrame":[{"duration":10,"tweenEasing":0,"x":-6,"y":14},{"duration":10,"tweenEasing":0,"y":2},{"duration":0,"x":-6,"y":14}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":45.5},{"duration":10,"tweenEasing":0,"rotate":-22.15},{"duration":0,"rotate":45.5}]},{"name":"legL","translateFrame":[{"duration":10,"tweenEasing":0,"x":-40.34,"y":28.4},{"duration":10,"tweenEasing":0,"x":-22.52,"y":-8.93},{"duration":0,"x":-40.34,"y":28.4}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":49.67},{"duration":10,"tweenEasing":0,"rotate":-19.23},{"duration":0,"rotate":49.67}]},{"name":"head","translateFrame":[{"duration":10,"tweenEasing":0,"y":4},{"duration":10,"tweenEasing":0,"y":2},{"duration":0,"y":4}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":2.95},{"duration":0}]},{"name":"armUpperL","translateFrame":[{"duration":10,"tweenEasing":0,"y":4},{"duration":10,"tweenEasing":0,"y":2},{"duration":0,"y":4}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":-21.2},{"duration":10,"tweenEasing":0,"rotate":30},{"duration":0,"rotate":-21.2}]},{"name":"tail","translateFrame":[{"duration":10,"tweenEasing":0,"x":-8},{"duration":10,"tweenEasing":0,"x":-12,"y":-6},{"duration":0,"x":-8}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-8.7},{"duration":0}]},{"name":"clothes","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-2,"y":-2},{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-2,"y":-2},{"duration":0}]},{"name":"armL","translateFrame":[{"duration":10,"tweenEasing":0,"x":-13.04,"y":-2.2},{"duration":10,"tweenEasing":0,"x":3.9,"y":-5.85},{"duration":0,"x":-13.04,"y":-2.2}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":-38.8},{"duration":10,"tweenEasing":0,"rotate":38.55},{"duration":0,"rotate":-38.8}]},{"name":"eyeR","translateFrame":[{"duration":10,"tweenEasing":0,"x":1.7,"y":0.5},{"duration":10,"tweenEasing":0,"x":-4.11,"y":-0.28},{"duration":0,"x":1.7,"y":0.5}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-2.95},{"duration":0}]},{"name":"tailTip","translateFrame":[{"duration":10,"tweenEasing":0,"x":8.93,"y":-0.54},{"duration":10,"tweenEasing":0,"x":-3,"y":10.08},{"duration":0,"x":8.93,"y":-0.54}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":17.93},{"duration":0}]},{"name":"eyeL","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":-7.55,"y":4.19},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-2.95},{"duration":0}]},{"name":"beardL","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":-3.52,"y":-5.52},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":6.04},{"duration":0}]},{"name":"armR","translateFrame":[{"duration":5,"tweenEasing":0,"x":-2.57,"y":9.96},{"duration":5,"tweenEasing":0,"x":-2.73,"y":5},{"duration":5,"tweenEasing":0,"x":-2.89,"y":0.04},{"duration":5,"tweenEasing":0,"x":-0.22,"y":-5.61},{"duration":0,"x":-2.57,"y":9.96}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":21.72},{"duration":5,"tweenEasing":0,"rotate":31.79},{"duration":5,"tweenEasing":0,"rotate":-15.63},{"duration":5,"tweenEasing":0,"rotate":-19.67},{"duration":0,"rotate":21.72}]},{"name":"beardR","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":-1.45,"y":1.66},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-10.45},{"duration":0}]},{"name":"hair","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.13,"y":-7.17},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-2.95},{"duration":0}]},{"name":"handR","translateFrame":[{"duration":10,"tweenEasing":0,"x":-16.27,"y":2.02},{"duration":10,"tweenEasing":0,"x":1.5,"y":2.17},{"duration":0,"x":-16.27,"y":2.02}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":-45.48},{"duration":10,"tweenEasing":0,"rotate":-0.48},{"duration":0,"rotate":-45.48}]},{"name":"handL","translateFrame":[{"duration":10,"tweenEasing":0,"x":-1.67,"y":0.9},{"duration":10,"tweenEasing":0,"x":-2.78,"y":3.4},{"duration":0,"x":-1.67,"y":0.9}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":15},{"duration":10,"tweenEasing":0,"rotate":6.45},{"duration":0,"rotate":15}]}]},{"duration":5,"playTimes":0,"name":"jump","bone":[{"name":"body","translateFrame":[{"duration":5,"y":-66}]},{"name":"legR","translateFrame":[{"duration":2,"tweenEasing":0,"x":1.18,"y":1.03},{"duration":3,"tweenEasing":0,"x":-3.12,"y":0.66},{"duration":0,"x":1.18,"y":1.03}],"rotateFrame":[{"duration":5,"rotate":-27.69}]},{"name":"armUpperR","translateFrame":[{"duration":2,"tweenEasing":0,"y":10},{"duration":3,"tweenEasing":0,"x":-2.87,"y":9.75},{"duration":0,"y":10}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-24.65},{"duration":3,"tweenEasing":0,"rotate":-23.19},{"duration":0,"rotate":-24.65}]},{"name":"legL","translateFrame":[{"duration":2,"tweenEasing":0,"x":-20.62,"y":38.29},{"duration":3,"tweenEasing":0,"x":-26.35,"y":37.79},{"duration":0,"x":-20.62,"y":38.29}],"rotateFrame":[{"duration":5,"rotate":-15.3}]},{"name":"head","translateFrame":[{"duration":5,"x":3.6,"y":1.9}],"rotateFrame":[{"duration":5,"rotate":10}]},{"name":"armUpperL","translateFrame":[{"duration":2,"tweenEasing":0,"y":4},{"duration":3,"tweenEasing":0,"x":-4.3,"y":3.63},{"duration":0,"y":4}],"rotateFrame":[{"duration":5,"rotate":15}]},{"name":"tail","translateFrame":[{"duration":5,"x":-24,"y":-10}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":9.35},{"duration":3,"tweenEasing":0,"rotate":13.73},{"duration":0,"rotate":9.35}]},{"name":"clothes","translateFrame":[{"duration":2,"tweenEasing":0,"x":-4.77,"y":-4.51},{"duration":3,"tweenEasing":0,"x":-9.07,"y":-4.88},{"duration":0,"x":-4.77,"y":-4.51}]},{"name":"armL","translateFrame":[{"duration":5,"x":-0.6,"y":2.55}],"rotateFrame":[{"duration":5,"rotate":8.55}]},{"name":"eyeR","translateFrame":[{"duration":2,"tweenEasing":0,"x":8.88,"y":-8.7},{"duration":3,"tweenEasing":0,"x":8.12,"y":-9.06},{"duration":0,"x":9.01,"y":-7.73}],"rotateFrame":[{"duration":5,"rotate":-10}]},{"name":"tailTip","translateFrame":[{"duration":2,"tweenEasing":0,"x":2.17,"y":6.3},{"duration":3,"tweenEasing":0,"x":0.64,"y":-0.9},{"duration":0,"x":2.17,"y":6.3}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":2.89},{"duration":3,"tweenEasing":0,"rotate":8.91},{"duration":0,"rotate":2.89}]},{"name":"eyeL","translateFrame":[{"duration":2,"tweenEasing":0,"x":8.94,"y":-6.3},{"duration":3,"tweenEasing":0,"x":8.12,"y":-9.06},{"duration":0,"x":8.94,"y":-6.3}],"rotateFrame":[{"duration":5,"rotate":-10}]},{"name":"beardL","translateFrame":[{"duration":5,"x":-19.78,"y":19.23}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-50.29},{"duration":3,"tweenEasing":0,"rotate":-58.56},{"duration":0,"rotate":-50.29}]},{"name":"armR","translateFrame":[{"duration":5,"x":-8.08,"y":1.16}],"rotateFrame":[{"duration":5,"rotate":-13.13}]},{"name":"beardR","translateFrame":[{"duration":2,"tweenEasing":0,"x":-8.15,"y":6.75},{"duration":3,"tweenEasing":0,"x":-8.03,"y":6.83},{"duration":0,"x":-8.15,"y":6.75}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":42.5},{"duration":3,"tweenEasing":0,"rotate":50.23},{"duration":0,"rotate":42.5}]},{"name":"hair","translateFrame":[{"duration":2,"tweenEasing":0,"x":-0.82,"y":-6.04},{"duration":3,"tweenEasing":0,"x":3.82,"y":-2.8},{"duration":0,"x":-0.82,"y":-6.04}],"rotateFrame":[{"duration":5,"rotate":-10}]},{"name":"handR","translateFrame":[{"duration":5,"x":1.5,"y":2.17}],"rotateFrame":[{"duration":5,"rotate":-0.48}]},{"name":"handL","translateFrame":[{"duration":5,"x":-14.11,"y":-3.85}],"rotateFrame":[{"duration":5,"rotate":-8.55}]}]},{"duration":5,"playTimes":0,"name":"fall","bone":[{"name":"body","translateFrame":[{"duration":5,"y":-66}]},{"name":"legR","translateFrame":[{"duration":2,"tweenEasing":0,"x":6.18,"y":8.96},{"duration":3,"tweenEasing":0,"x":1.71,"y":8.58},{"duration":0,"x":6.18,"y":8.96}],"rotateFrame":[{"duration":5,"rotate":27.76}]},{"name":"armUpperR","translateFrame":[{"duration":2,"tweenEasing":0,"y":10},{"duration":3,"tweenEasing":0,"x":-1.49,"y":9.87},{"duration":0,"y":10}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-69.64},{"duration":3,"tweenEasing":0,"rotate":-66.68},{"duration":0,"rotate":-69.64}]},{"name":"legL","translateFrame":[{"duration":2,"tweenEasing":0,"x":22.6,"y":7.9},{"duration":3,"tweenEasing":0,"x":19.62,"y":7.64},{"duration":0,"x":22.6,"y":7.9}],"rotateFrame":[{"duration":5,"rotate":50.73}]},{"name":"head","translateFrame":[{"duration":5,"x":11,"y":-3.4}],"rotateFrame":[{"duration":5,"rotate":-8.73}]},{"name":"armUpperL","translateFrame":[{"duration":2,"tweenEasing":0,"y":4},{"duration":3,"tweenEasing":0,"x":2.98,"y":4.26},{"duration":0,"y":4}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":92.45},{"duration":3,"tweenEasing":0,"rotate":89.97},{"duration":0,"rotate":92.45}]},{"name":"tail","translateFrame":[{"duration":5,"x":-3.9,"y":-6.1}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-18.47},{"duration":3,"tweenEasing":0,"rotate":-22.44},{"duration":0,"rotate":-18.47}]},{"name":"clothes","translateFrame":[{"duration":2,"tweenEasing":0,"x":-6.01,"y":-4.86},{"duration":3,"tweenEasing":0,"x":-1.54,"y":-4.47},{"duration":0,"x":-6.01,"y":-4.86}]},{"name":"armL","translateFrame":[{"duration":5,"x":4.35,"y":5.81}],"rotateFrame":[{"duration":5,"rotate":-53.9}]},{"name":"eyeR","translateFrame":[{"duration":2,"tweenEasing":0,"x":-17.76,"y":-4.61},{"duration":3,"tweenEasing":0,"x":-14.83,"y":-3.01},{"duration":0,"x":-17.76,"y":-4.61}],"rotateFrame":[{"duration":5,"rotate":8.73}]},{"name":"tailTip","translateFrame":[{"duration":2,"tweenEasing":0,"x":2.8,"y":-1.16},{"duration":3,"tweenEasing":0,"x":1.82,"y":1.79},{"duration":0,"x":2.8,"y":-1.16}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":0.14},{"duration":3,"tweenEasing":0,"rotate":-0.83},{"duration":0,"rotate":0.14}]},{"name":"eyeL","translateFrame":[{"duration":2,"tweenEasing":0,"x":-13,"y":-8.15},{"duration":3,"tweenEasing":0,"x":-13.22,"y":-5.94},{"duration":0,"x":-13,"y":-8.15}],"rotateFrame":[{"duration":5,"rotate":8.73}]},{"name":"beardL","translateFrame":[{"duration":5,"x":0.32,"y":7.78}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-2.54},{"duration":3,"tweenEasing":0,"rotate":25.13},{"duration":0,"rotate":-2.54}]},{"name":"armR","translateFrame":[{"duration":5,"x":-11.21,"y":-3.2}],"rotateFrame":[{"duration":5,"rotate":-13.14}]},{"name":"beardR","translateFrame":[{"duration":5,"x":-7.87,"y":5.25}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":8.96},{"duration":3,"tweenEasing":0,"rotate":-6.04},{"duration":0,"rotate":8.96}]},{"name":"hair","translateFrame":[{"duration":2,"tweenEasing":0,"x":0.59,"y":7.24},{"duration":3,"tweenEasing":0,"x":-6.32,"y":0.21},{"duration":0,"x":0.59,"y":7.24}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-6.27},{"duration":3,"tweenEasing":0,"rotate":-7.09},{"duration":0,"rotate":-6.27}]},{"name":"handR","translateFrame":[{"duration":5,"x":-3.94,"y":-1.37}],"rotateFrame":[{"duration":5,"rotate":29.52}]},{"name":"handL","translateFrame":[{"duration":5,"x":-3.6,"y":1.47}],"rotateFrame":[{"duration":5,"rotate":21.45}]}]}],"defaultActions":[{"gotoAndPlay":"stand"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/effect/Dragon_tex.json b/Egret/Demos/resource/effect/Dragon_tex.json
new file mode 100644
index 00000000..f0eb3832
--- /dev/null
+++ b/Egret/Demos/resource/effect/Dragon_tex.json
@@ -0,0 +1 @@
+{"width":1024,"SubTexture":[{"y":234,"frameWidth":112,"x":456,"frameHeight":210,"width":111,"frameY":0,"height":209,"name":"parts/tailTip","frameX":0},{"width":112,"y":234,"height":86,"name":"parts/armUpperL","x":340},{"width":48,"y":859,"height":80,"name":"parts/armL","x":373},{"width":96,"y":922,"height":78,"name":"parts/handL","x":1},{"y":677,"frameWidth":204,"x":238,"frameHeight":180,"width":203,"frameY":0,"height":180,"name":"parts/legL","frameX":0},{"y":397,"frameWidth":236,"x":1,"frameHeight":348,"width":235,"frameY":0,"height":347,"name":"parts/body","frameX":0},{"width":216,"y":397,"height":278,"name":"parts/tail","x":238},{"width":208,"y":746,"height":174,"name":"parts/clothes1","x":1},{"width":124,"y":677,"height":282,"name":"parts/hair","x":443},{"y":1,"frameWidth":338,"x":1,"frameHeight":394,"width":337,"frameY":0,"height":394,"name":"parts/head","frameX":0},{"width":28,"y":961,"height":46,"name":"parts/eyeL","x":459},{"y":961,"frameWidth":38,"x":420,"frameHeight":58,"width":37,"frameY":0,"height":58,"name":"parts/eyeR","frameX":0},{"y":1,"frameWidth":180,"x":340,"frameHeight":232,"width":180,"frameY":0,"height":231,"name":"parts/legR","frameX":0},{"width":160,"y":859,"height":94,"name":"parts/armUpperR","x":211},{"y":941,"frameWidth":46,"x":373,"frameHeight":78,"width":45,"frameY":0,"height":77,"name":"parts/armR","frameX":0},{"width":98,"y":322,"height":58,"name":"parts/handR","x":340},{"y":955,"frameWidth":120,"x":237,"frameHeight":36,"width":119,"frameY":0,"height":36,"name":"parts/beardL","frameX":0},{"width":136,"y":955,"height":36,"name":"parts/beardR","x":99}],"height":1024,"name":"Dragon","imagePath":"Dragon_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/effect/Dragon_tex.png b/Egret/Demos/resource/effect/Dragon_tex.png
new file mode 100644
index 00000000..02cc3909
Binary files /dev/null and b/Egret/Demos/resource/effect/Dragon_tex.png differ
diff --git a/Egret/Demos/resource/effect/effect_sd_tex.json b/Egret/Demos/resource/effect/effect_sd_tex.json
new file mode 100644
index 00000000..92c758be
--- /dev/null
+++ b/Egret/Demos/resource/effect/effect_sd_tex.json
@@ -0,0 +1 @@
+{"width":256,"SubTexture":[{"width":69,"y":207,"height":62,"name":"jiguang","x":74},{"width":10,"y":142,"height":10,"name":"meigui","x":224},{"y":271,"frameWidth":38,"x":74,"frameHeight":38,"width":36,"frameY":-1,"height":36,"name":"zheng","frameX":-1},{"y":271,"frameWidth":38,"x":112,"frameHeight":38,"width":26,"frameY":-6,"height":26,"name":"zheng2","frameX":-6},{"y":1,"frameWidth":90,"x":173,"frameHeight":80,"width":79,"frameY":-11,"height":68,"name":"1 (6)","frameX":-4},{"y":74,"frameWidth":90,"x":86,"frameHeight":80,"width":77,"frameY":-14,"height":64,"name":"1 (3)","frameX":-4},{"y":142,"frameWidth":90,"x":150,"frameHeight":80,"width":72,"frameY":-15,"height":63,"name":"1 (9)","frameX":-3},{"y":1,"frameWidth":90,"x":1,"frameHeight":80,"width":83,"frameY":-2,"height":77,"name":"1 (2)","frameX":-3},{"y":71,"frameWidth":90,"x":173,"frameHeight":80,"width":75,"frameY":-9,"height":69,"name":"1 (1)","frameX":-3},{"y":148,"frameWidth":90,"x":1,"frameHeight":80,"width":71,"frameY":-14,"height":64,"name":"1 (4)","frameX":-4},{"y":207,"frameWidth":90,"x":150,"frameHeight":80,"width":72,"frameY":-16,"height":63,"name":"1 (10)","frameX":-3},{"y":80,"frameWidth":90,"x":1,"frameHeight":80,"width":72,"frameY":-11,"height":66,"name":"1 (8)","frameX":-4},{"y":1,"frameWidth":90,"x":86,"frameHeight":80,"width":85,"frameY":-6,"height":71,"name":"1 (7)","frameX":-4},{"y":140,"frameWidth":90,"x":75,"frameHeight":80,"width":73,"frameY":-14,"height":65,"name":"1 (5)","frameX":-4}],"height":512,"name":"effect_sd","imagePath":"effect_sd_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/effect/effect_sd_tex.png b/Egret/Demos/resource/effect/effect_sd_tex.png
new file mode 100644
index 00000000..5da02671
Binary files /dev/null and b/Egret/Demos/resource/effect/effect_sd_tex.png differ
diff --git a/Egret/Demos/resource/effect/effect_ske.json b/Egret/Demos/resource/effect/effect_ske.json
new file mode 100644
index 00000000..7243ecc4
--- /dev/null
+++ b/Egret/Demos/resource/effect/effect_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"effect","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"flower","aabb":{"x":-316.56,"y":-256.95,"width":505.88,"height":310.08},"bone":[{"name":"root","transform":{"y":-89.1136}},{"name":"hua","parent":"root","transform":{"x":-1.2207,"y":95.86095}},{"name":"roo2","parent":"root","transform":{"x":-122.72615,"y":99.615}},{"name":"JG","parent":"roo2","transform":{"x":48.5738}},{"name":"MG","parent":"roo2","transform":{"x":11.66245,"y":0.09285,"skX":-5.93,"skY":-5.93}},{"name":"zhen","parent":"roo2","transform":{"x":120.51,"y":-6.995,"skX":-0.06,"skY":-0.06,"scX":6.875,"scY":2.385}},{"name":"zheng3","parent":"roo2","transform":{"x":123.96,"y":-30.985,"scY":0.4}},{"name":"jiguang4","parent":"JG","transform":{"x":-64.595,"y":-205.955,"scX":0.663,"scY":0.461}},{"name":"jiguang3","parent":"JG","transform":{"x":38.125,"y":-181.45,"scX":0.83,"scY":0.458}},{"name":"jiguang","parent":"JG","transform":{"x":194.98,"y":-113.8,"scX":0.799,"scY":0.632}},{"name":"jiguang2","parent":"JG","transform":{"x":53.045,"y":-137.18,"scX":1.013,"scY":1.097}},{"name":"jiguang8","parent":"JG","transform":{"x":-3.45,"y":-103.625,"scX":0.335,"scY":0.363}},{"name":"jiguang9","parent":"JG","transform":{"x":76.46,"y":-97.71,"scX":0.429,"scY":0.288}},{"name":"jiguang10","parent":"JG","transform":{"x":140.585,"y":-85.875,"scX":0.448,"scY":0.245}},{"name":"jiguang11","parent":"JG","transform":{"x":180.375,"y":-95.47,"scX":0.47,"scY":0.209}},{"name":"jiguang7","parent":"JG","transform":{"x":186.32,"y":-176.64,"scX":0.737,"scY":0.562}},{"name":"jiguang5","parent":"JG","transform":{"x":74.91,"y":-126.865,"scX":1.021,"scY":0.438}},{"name":"jiguang6","parent":"JG","transform":{"x":-54.655,"y":-131.37,"scX":0.737,"scY":0.562}},{"name":"jiguang12","parent":"JG","transform":{"x":-173.905,"y":-189.055,"scX":0.598,"scY":0.531}},{"name":"meigui4","parent":"MG","transform":{"x":76.075,"y":-172.265,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui5","parent":"MG","transform":{"x":10.4,"y":-173.51,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui6","parent":"MG","transform":{"x":148.425,"y":-166.045,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui7","parent":"MG","transform":{"x":222.04,"y":-146.435,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui8","parent":"MG","transform":{"x":114.085,"y":-161.615,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui9","parent":"MG","transform":{"x":98.955,"y":-174.72,"skX":-9.41,"skY":-9.41,"scX":1.146,"scY":1.146}},{"name":"meigui10","parent":"MG","transform":{"x":172.865,"y":-145.485,"skX":-9.41,"skY":-9.41,"scX":0.529,"scY":0.529}},{"name":"meigui11","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui12","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui13","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui14","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui","parent":"MG","transform":{"x":53.23,"y":-163.915,"scX":1.111,"scY":1.111}},{"name":"zhen1","parent":"zhen"},{"name":"zhen2","parent":"zhen"},{"name":"meigui2","parent":"MG","transform":{"x":128.11,"y":-172.61,"skX":-57.56,"skY":-57.56,"scX":1.151,"scY":1.151}},{"name":"zzz","parent":"zheng3","transform":{"x":-1.2334}},{"name":"meigui3","parent":"MG","transform":{"x":184.74,"y":-156.28,"skX":-9.41,"skY":-9.41,"scX":1.103,"scY":1.103}}],"slot":[{"blendMode":"add","name":"jiguang12","parent":"jiguang11","color":{"aM":72,"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang9","parent":"jiguang8","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang10","parent":"jiguang9","color":{"aM":81,"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang11","parent":"jiguang10","color":{"aM":40,"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang2","parent":"jiguang2","color":{"rM":25,"gM":20}},{"blendMode":"add","name":"jiguang6","parent":"jiguang6","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang","parent":"jiguang"},{"blendMode":"add","name":"jiguang13","parent":"jiguang12","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang7","parent":"jiguang4","color":{"rM":74,"gM":0}},{"blendMode":"add","name":"jiguang5","parent":"jiguang5"},{"blendMode":"add","name":"jiguang3","parent":"jiguang3"},{"blendMode":"add","name":"jiguang8","parent":"jiguang7","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"meigui","parent":"meigui"},{"blendMode":"add","name":"meigui12","parent":"meigui"},{"blendMode":"add","name":"meigui2","parent":"meigui2"},{"blendMode":"add","displayIndex":-1,"name":"meigui3","parent":"meigui3"},{"blendMode":"add","displayIndex":-1,"name":"meigui4","parent":"meigui4"},{"blendMode":"add","displayIndex":-1,"name":"meigui5","parent":"meigui5"},{"blendMode":"add","displayIndex":-1,"name":"meigui13","parent":"meigui5"},{"blendMode":"add","name":"meigui6","parent":"meigui6"},{"blendMode":"add","name":"meigui7","parent":"meigui7"},{"blendMode":"add","displayIndex":-1,"name":"meigui8","parent":"meigui8"},{"blendMode":"add","name":"meigui9","parent":"meigui9"},{"blendMode":"add","displayIndex":-1,"name":"meigui10","parent":"meigui10"},{"blendMode":"add","displayIndex":-1,"name":"meigui11","parent":"meigui11"},{"blendMode":"add","displayIndex":-1,"name":"meigui14","parent":"meigui12"},{"blendMode":"add","displayIndex":-1,"name":"meigui15","parent":"meigui13"},{"blendMode":"add","displayIndex":-1,"name":"meigui16","parent":"meigui14"},{"blendMode":"add","displayIndex":-1,"name":"zheng","parent":"zhen1"},{"blendMode":"add","displayIndex":-1,"name":"zheng2","parent":"zhen2"},{"blendMode":"add","displayIndex":-1,"name":"zheng3","parent":"zzz"},{"name":"sprite","parent":"hua"}],"skin":[{"slot":[{"name":"meigui12","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[-112.33,33.09,130.41,35.44,130.41,-210.84,-112.33,-213.19],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"meigui16","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui7","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui5","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[-91.11,-46.78,-97.64,-51.68,-95.37,-59.1,-87.14,-55.23,-94.33,-56.63,-92.13,-49.06,-93.57,-52.95],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang3","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang10","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"sprite","display":[{"type":"armature","name":"sprite","transform":{"x":9.52,"y":-33.63},"path":"sprite"}]},{"name":"meigui11","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui2","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang11","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"zheng","display":[{"name":"zheng"}]},{"name":"meigui8","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui13","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang8","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang2","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[209.72,50.23,-180.44,50.23,-180.44,-156.77,209.72,-156.77],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"meigui14","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui3","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang13","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[205.06,63.9,-52.94,63.9,-52.94,-167.1,205.06,-167.1],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang7","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang12","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"zheng2","display":[{"name":"zheng"}]},{"name":"meigui9","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui6","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[100.17,22.33,95.16,21.3,94.47,16.48,100.17,16.48,95.72,17.61,98.98,21.31,97.13,19.5],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang6","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"meigui15","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui4","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang5","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[148.01,35.84,-109.98,35.84,-109.98,-195.16,148.02,-195.16],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang9","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"zheng3","display":[{"name":"zheng2"}]},{"name":"meigui10","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]}]}],"animation":[{"duration":110,"name":"skill","frame":[{"duration":0,"events":[{"name":"playse"}]}],"bone":[{"name":"jiguang","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-28.8},{"duration":26,"tweenEasing":0},{"duration":16,"tweenEasing":0,"y":94.69},{"duration":15,"y":114.63}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":26,"tweenEasing":0},{"duration":16,"tweenEasing":0,"y":2.81},{"duration":15,"y":2.17}]},{"name":"jiguang2","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-36.83},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":54.82},{"duration":17,"y":76.35}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":2.81},{"duration":17,"y":2.17}]},{"name":"jiguang3","translateFrame":[{"duration":39,"tweenEasing":0,"y":-14.01},{"duration":25,"tweenEasing":0},{"duration":26,"tweenEasing":0,"y":177.79},{"duration":20,"y":213.84}],"scaleFrame":[{"duration":39,"tweenEasing":0,"y":0.4},{"duration":25,"tweenEasing":0,"y":1.54},{"duration":26,"tweenEasing":0,"y":3.55},{"duration":20,"y":1.9}]},{"name":"jiguang4","translateFrame":[{"duration":39,"tweenEasing":0,"y":5.39},{"duration":25,"tweenEasing":0,"y":26.44},{"duration":21,"tweenEasing":0,"y":146.04},{"duration":25,"y":184.43}],"scaleFrame":[{"duration":39,"tweenEasing":0,"y":0.27},{"duration":25,"tweenEasing":0},{"duration":21,"tweenEasing":0,"x":1.2,"y":5.46},{"duration":25,"y":2.49}]},{"name":"jiguang5","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-25.44},{"duration":13,"tweenEasing":0},{"duration":39,"tweenEasing":0,"y":50.35},{"duration":5,"y":114.63}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":13,"tweenEasing":0},{"duration":39,"tweenEasing":0,"y":4.76},{"duration":5,"y":2.18}]},{"name":"jiguang6","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-27.58},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":94.69},{"duration":17,"y":114.63}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":2.81},{"duration":17,"y":2.17}]},{"name":"jiguang7","translateFrame":[{"duration":39,"tweenEasing":0,"y":-33.84},{"duration":25,"tweenEasing":0},{"duration":36,"tweenEasing":0,"y":139.54},{"duration":10,"y":184.43}],"scaleFrame":[{"duration":39,"tweenEasing":0},{"duration":25,"tweenEasing":0,"y":3.51},{"duration":36,"tweenEasing":0,"y":3.55},{"duration":10,"y":2.49}]},{"name":"jiguang8","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":15,"tweenEasing":0,"y":-61.98},{"duration":15,"tweenEasing":0,"y":9.89},{"duration":17,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.51},{"duration":15,"tweenEasing":0,"y":1.86},{"duration":15,"tweenEasing":0,"y":3.68},{"duration":17,"y":1.83}]},{"name":"jiguang9","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":15,"tweenEasing":0,"y":-61.98},{"duration":32,"tweenEasing":0,"y":9.89},{"duration":0,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.53},{"duration":15,"tweenEasing":0,"y":1.86},{"duration":32,"tweenEasing":0,"y":3.7},{"duration":0,"y":1.84}]},{"name":"jiguang10","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":17,"tweenEasing":0,"y":-61.98},{"duration":25,"tweenEasing":0,"y":9.89},{"duration":5,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.51},{"duration":17,"tweenEasing":0,"y":1.86},{"duration":25,"tweenEasing":0,"y":3.7},{"duration":5,"y":1.84}]},{"name":"jiguang11","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":15,"tweenEasing":0,"y":-61.98},{"duration":15,"tweenEasing":0,"y":9.89},{"duration":17,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.54},{"duration":15,"tweenEasing":0,"y":1.86},{"duration":15,"tweenEasing":0,"y":3.7},{"duration":17,"y":1.84}]},{"name":"jiguang12","translateFrame":[{"duration":40,"tweenEasing":0,"y":-10.34},{"duration":24,"tweenEasing":0},{"duration":21,"tweenEasing":0,"y":139.54},{"duration":25,"y":184.43}],"scaleFrame":[{"duration":40,"tweenEasing":0,"y":0.25},{"duration":24,"tweenEasing":0},{"duration":21,"tweenEasing":0,"y":3.55},{"duration":25,"y":2.49}]},{"name":"meigui","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":82,"tweenEasing":0,"x":-22,"y":-82.62},{"duration":23,"x":73.47,"y":190.1}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":82,"tweenEasing":0},{"duration":23,"rotate":-71.26}],"scaleFrame":[{"duration":5,"tweenEasing":0},{"duration":82,"tweenEasing":0},{"duration":23,"x":0.29}]},{"name":"meigui2","translateFrame":[{"duration":23,"tweenEasing":0},{"duration":72,"tweenEasing":0,"x":-158.4,"y":-48.2},{"duration":15,"x":-88.77,"y":151.79}],"rotateFrame":[{"duration":23,"tweenEasing":0},{"duration":72,"tweenEasing":0,"rotate":134.69},{"duration":15,"rotate":34.01}]},{"name":"meigui3","translateFrame":[{"duration":40,"tweenEasing":0},{"duration":70,"tweenEasing":0,"x":-80.15,"y":-60.77},{"duration":0,"x":18.74,"y":134.04}],"rotateFrame":[{"duration":40,"tweenEasing":0},{"duration":70,"tweenEasing":0,"rotate":-19.05},{"duration":0,"rotate":-52.29}],"scaleFrame":[{"duration":40,"tweenEasing":0},{"duration":70,"tweenEasing":0},{"duration":0,"x":0.54,"y":1.23}]},{"name":"meigui4","translateFrame":[{"duration":45,"tweenEasing":0},{"duration":55,"tweenEasing":0,"x":-77.82,"y":-37.37},{"duration":10,"x":17.57,"y":106}],"rotateFrame":[{"duration":45,"tweenEasing":0},{"duration":55,"tweenEasing":0},{"duration":10,"rotate":-25.04}]},{"name":"meigui5","translateFrame":[{"duration":42,"tweenEasing":0},{"duration":54,"tweenEasing":0,"x":42.56,"y":22.81},{"duration":14,"x":138.97,"y":149.95}],"rotateFrame":[{"duration":42,"tweenEasing":0},{"duration":54,"tweenEasing":0,"rotate":1.39},{"duration":14,"rotate":-43.42}]},{"name":"meigui6","translateFrame":[{"duration":41,"tweenEasing":0,"x":-185,"y":-40.92},{"duration":11,"tweenEasing":0,"x":-116.91,"y":86.74},{"duration":45,"tweenEasing":0,"x":-225.07,"y":-68.34},{"duration":13,"x":-166.09,"y":78.05}],"rotateFrame":[{"duration":110,"rotate":-29.87}]},{"name":"meigui7","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":71,"tweenEasing":0,"x":-230.82,"y":-98.22},{"duration":26,"x":110.11,"y":172.15}],"rotateFrame":[{"duration":13,"tweenEasing":0},{"duration":71,"tweenEasing":0},{"duration":26,"rotate":-57.52}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":71,"tweenEasing":0,"x":2.01,"y":2.01},{"duration":26,"x":0.89,"y":0.89}]},{"name":"meigui8","translateFrame":[{"duration":60,"tweenEasing":0},{"duration":24,"tweenEasing":0,"x":15.4,"y":-64.94},{"duration":23,"tweenEasing":0,"x":15.4,"y":-64.94},{"duration":3,"x":95.14,"y":57.8}],"rotateFrame":[{"duration":84,"tweenEasing":0},{"duration":23,"tweenEasing":0},{"duration":3,"rotate":-87.86}],"scaleFrame":[{"duration":60,"tweenEasing":0},{"duration":24,"tweenEasing":0},{"duration":23,"tweenEasing":0,"x":0.54},{"duration":3}]},{"name":"meigui9","translateFrame":[{"duration":14,"tweenEasing":0},{"duration":66,"tweenEasing":0,"x":-63.98,"y":-75.86},{"duration":30,"x":10.98,"y":54.38}],"rotateFrame":[{"duration":14,"tweenEasing":0},{"duration":66,"tweenEasing":0},{"duration":30,"rotate":-37.05}],"scaleFrame":[{"duration":14,"tweenEasing":0},{"duration":66,"tweenEasing":0,"x":0.5,"y":0.5},{"duration":30,"x":0.44,"y":0.44}]},{"name":"meigui10","translateFrame":[{"duration":41,"tweenEasing":0},{"duration":32,"tweenEasing":0,"x":-105.16,"y":-77.08},{"duration":36,"tweenEasing":0,"x":-105.16,"y":-77.08},{"x":60.47,"y":195.9}],"rotateFrame":[{"duration":41,"tweenEasing":0},{"duration":32,"tweenEasing":0},{"duration":36,"tweenEasing":0,"rotate":-49.87},{"rotate":-133.85}],"scaleFrame":[{"duration":41,"tweenEasing":0},{"duration":32,"tweenEasing":0},{"duration":36,"tweenEasing":0,"x":0.5,"y":1.82},{"x":1.56,"y":1.82}]},{"name":"meigui11","translateFrame":[{"duration":61,"tweenEasing":0},{"duration":49,"tweenEasing":0,"x":-41.54,"y":-52.83},{"duration":0,"x":107.18,"y":100.08}],"rotateFrame":[{"duration":61,"tweenEasing":0},{"duration":49,"tweenEasing":0},{"duration":0,"rotate":-48.84}],"scaleFrame":[{"duration":61,"tweenEasing":0},{"duration":49,"tweenEasing":0,"x":0.78,"y":2.37},{"duration":0,"x":2.33,"y":2.37}]},{"name":"zhen1","translateFrame":[{"duration":43,"tweenEasing":0},{"duration":67,"y":0.97}],"rotateFrame":[{"duration":43,"tweenEasing":0},{"duration":57,"tweenEasing":0},{"duration":10,"rotate":54.95}],"scaleFrame":[{"duration":43,"tweenEasing":0},{"duration":57,"tweenEasing":0,"x":0.89,"y":0.89},{"duration":10,"x":1.22,"y":1.22}]},{"name":"zhen2","translateFrame":[{"duration":43,"tweenEasing":0},{"duration":67,"y":0.97}],"rotateFrame":[{"duration":43,"tweenEasing":0},{"duration":22,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":23.13},{"duration":15,"rotate":54.95}],"scaleFrame":[{"duration":43,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.89,"y":0.89},{"duration":30,"tweenEasing":0,"x":1.03,"y":1.03},{"duration":15,"x":1.53,"y":1.53}]},{"name":"meigui12","translateFrame":[{"duration":75,"tweenEasing":0},{"duration":35,"tweenEasing":0,"x":-55.5,"y":-67.15},{"duration":0,"x":-7.89,"y":-9.12}],"scaleFrame":[{"duration":75,"tweenEasing":0},{"duration":35,"tweenEasing":0},{"duration":0,"x":2.13,"y":2.13}]},{"name":"meigui13","translateFrame":[{"duration":66,"tweenEasing":0},{"duration":34,"tweenEasing":0,"x":43.72,"y":-53.51},{"duration":10,"x":94.5,"y":-10.07}],"rotateFrame":[{"duration":66,"tweenEasing":0},{"duration":34,"tweenEasing":0},{"duration":10,"rotate":-19.75}],"scaleFrame":[{"duration":66,"tweenEasing":0},{"duration":34,"tweenEasing":0,"x":1.98,"y":1.98},{"duration":10,"x":0.96,"y":0.96}]},{"name":"meigui14","translateFrame":[{"duration":77,"tweenEasing":0},{"duration":33,"tweenEasing":0,"x":132.75,"y":-44.2},{"duration":0,"x":188.19,"y":12.82}],"rotateFrame":[{"duration":77,"tweenEasing":0},{"duration":33,"tweenEasing":0,"rotate":28.72},{"duration":0,"rotate":-53.72}],"scaleFrame":[{"duration":77,"tweenEasing":0},{"duration":33,"x":1.54,"y":1.54}]},{"name":"zheng3","translateFrame":[{"duration":110,"x":2.08,"y":22.52}],"scaleFrame":[{"duration":110,"x":7.47,"y":5.65}]},{"name":"zzz","rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":82.31},{"duration":10,"curve":[0.2295,0.375,0.6765,0.825]},{"duration":55,"curve":[0.283,0.49,0.761,1],"rotate":-35.64},{"duration":5,"rotate":-124.39}],"scaleFrame":[{"duration":20,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.34,"y":0.34},{"duration":55,"curve":[0.283,0.49,0.761,1],"x":0.85,"y":0.85},{"duration":5,"x":1.5,"y":1.5}]},{"name":"hua","scaleFrame":[{"duration":20},{"duration":30,"tweenEasing":0,"x":0.25,"y":0.25},{"duration":60,"tweenEasing":0,"x":1.1,"y":1.1},{"duration":0,"x":2,"y":1.7}]}],"slot":[{"name":"jiguang","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0}},{"duration":26},{"duration":16,"tweenEasing":0},{"duration":15,"value":{"aM":0}}]},{"name":"jiguang2","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0,"rM":25,"gM":19}},{"duration":26,"value":{"rM":25,"gM":19}},{"duration":14,"tweenEasing":0,"value":{"rM":25,"gM":19}},{"duration":17,"value":{"aM":0,"rM":25,"gM":19}}]},{"name":"jiguang3","colorFrame":[{"duration":39,"tweenEasing":0,"value":{"aM":0}},{"duration":25},{"duration":26,"tweenEasing":0},{"duration":20,"value":{"aM":0}}]},{"name":"jiguang5","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0}},{"duration":13},{"duration":39,"tweenEasing":0},{"duration":5,"value":{"aM":0}}]},{"name":"jiguang6","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0,"rM":65,"gM":0}},{"duration":26,"value":{"rM":65,"gM":0}},{"duration":14,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":17,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang7","colorFrame":[{"duration":39,"tweenEasing":0,"value":{"aM":0,"rM":74,"gM":0}},{"duration":25,"value":{"rM":74,"gM":0}},{"duration":21,"tweenEasing":0,"value":{"rM":74,"gM":0}},{"duration":25,"value":{"aM":0,"rM":74,"gM":0}}]},{"name":"jiguang8","colorFrame":[{"duration":39,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":25,"value":{"rM":65,"gM":0}},{"duration":36,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":10,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang9","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":15,"value":{"rM":65,"gM":0}},{"duration":15,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":17,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang10","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":15,"tweenEasing":0,"value":{"aM":80,"rM":65,"gM":0}},{"duration":32,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":0,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang11","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":17,"value":{"rM":65,"gM":0}},{"duration":25,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":5,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang12","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":15,"value":{"aM":72,"rM":65,"gM":0}},{"duration":15,"tweenEasing":0,"value":{"aM":72,"rM":65,"gM":0}},{"duration":17,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang13","colorFrame":[{"duration":40,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":27,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":43,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"meigui","displayFrame":[{"duration":5,"value":-1},{"duration":105}],"colorFrame":[{"duration":5,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":{"aM":0}},{"duration":16},{"duration":32,"tweenEasing":0},{"duration":23,"value":{"aM":0}}]},{"name":"meigui2","displayFrame":[{"duration":23,"value":-1},{"duration":87}],"colorFrame":[{"duration":23,"tweenEasing":0},{"duration":27,"tweenEasing":0,"value":{"aM":0}},{"duration":25},{"duration":20,"tweenEasing":0},{"duration":15,"value":{"aM":0}}]},{"name":"meigui3","displayFrame":[{"duration":40,"value":-1},{"duration":70}],"colorFrame":[{"duration":40,"tweenEasing":0},{"duration":28,"tweenEasing":0,"value":{"aM":0}},{"duration":22},{"duration":20,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"meigui4","displayFrame":[{"duration":45,"value":-1},{"duration":65}],"colorFrame":[{"duration":45,"tweenEasing":0},{"duration":30,"tweenEasing":0,"value":{"aM":0}},{"duration":25,"tweenEasing":0},{"duration":10,"value":{"aM":0}}]},{"name":"meigui5","displayFrame":[{"duration":42,"value":-1},{"duration":68}],"colorFrame":[{"duration":42,"tweenEasing":0},{"duration":27,"tweenEasing":0,"value":{"aM":0}},{"duration":27,"tweenEasing":0},{"duration":14,"value":{"aM":0}}]},{"name":"meigui6","colorFrame":[{"duration":22,"tweenEasing":0,"value":{"aM":0}},{"duration":19,"tweenEasing":0},{"duration":11,"value":{"aM":0}},{"duration":22,"tweenEasing":0,"value":{"aM":0}},{"duration":23,"tweenEasing":0},{"duration":13,"value":{"aM":0}}]},{"name":"meigui7","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":38,"tweenEasing":0,"value":{"aM":0}},{"duration":33,"tweenEasing":0},{"duration":26,"value":{"aM":0}}]},{"name":"meigui8","displayFrame":[{"duration":60,"value":-1},{"duration":50}],"colorFrame":[{"duration":60,"tweenEasing":0},{"duration":24,"tweenEasing":0,"value":{"aM":0}},{"duration":23,"tweenEasing":0},{"duration":3,"value":{"aM":0}}]},{"name":"meigui9","displayFrame":[{"duration":14,"value":-1},{"duration":96}],"colorFrame":[{"duration":14,"tweenEasing":0},{"duration":25,"tweenEasing":0,"value":{"aM":0}},{"duration":41,"tweenEasing":0},{"duration":30,"value":{"aM":0}}]},{"name":"meigui10","displayFrame":[{"duration":41,"value":-1},{"duration":69}],"colorFrame":[{"duration":41,"tweenEasing":0},{"duration":24,"tweenEasing":0,"value":{"aM":0}},{"duration":25},{"duration":19,"tweenEasing":0},{"value":{"aM":0}}]},{"name":"meigui11","displayFrame":[{"duration":61,"value":-1},{"duration":49}],"colorFrame":[{"duration":61,"tweenEasing":0},{"duration":26,"tweenEasing":0,"value":{"aM":0}},{"duration":23,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"meigui12","displayFrame":[{"duration":5,"value":-1},{"duration":105}],"colorFrame":[{"duration":5,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":{"aM":0}},{"duration":16},{"duration":32,"tweenEasing":0},{"duration":23,"value":{"aM":0}}]},{"name":"meigui13","colorFrame":[{"duration":42,"tweenEasing":0},{"duration":27,"tweenEasing":0,"value":{"aM":0}},{"duration":27,"tweenEasing":0},{"duration":14,"value":{"aM":0}}]},{"name":"meigui14","displayFrame":[{"duration":75,"value":-1},{"duration":35}],"colorFrame":[{"duration":76,"tweenEasing":0},{"duration":34,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"meigui15","displayFrame":[{"duration":66,"value":-1},{"duration":44}],"colorFrame":[{"duration":68,"tweenEasing":0},{"duration":32,"tweenEasing":0},{"duration":10,"value":{"aM":0}}]},{"name":"meigui16","displayFrame":[{"duration":77,"value":-1},{"duration":33}],"colorFrame":[{"duration":83,"tweenEasing":0},{"duration":27,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"zheng","displayFrame":[{"duration":43,"value":-1},{"duration":67}],"colorFrame":[{"duration":43,"tweenEasing":0},{"duration":22,"tweenEasing":0,"value":{"aM":0}},{"duration":35,"tweenEasing":0,"value":{"aM":47,"rM":94,"bM":94}},{"duration":10,"value":{"aM":0}}]},{"name":"zheng2","displayFrame":[{"duration":55,"value":-1},{"duration":55}],"colorFrame":[{"duration":55,"tweenEasing":0},{"duration":10,"tweenEasing":0,"value":{"aM":0}},{"duration":30,"tweenEasing":0,"value":{"aM":56}},{"duration":15,"value":{"aM":0}}]},{"name":"zheng3","displayFrame":[{"duration":20,"value":-1},{"duration":90}],"colorFrame":[{"duration":20,"tweenEasing":0},{"duration":30,"tweenEasing":0,"value":{"aM":0}},{"duration":20,"tweenEasing":0,"value":{"aM":22}},{"duration":35,"tweenEasing":0,"value":{"aM":80}},{"duration":5,"value":{"aM":0}}]},{"name":"sprite","displayFrame":[{"duration":20,"value":-1},{"duration":90,"actions":[{"gotoAndPlay":"sprite"}]}],"colorFrame":[{"duration":20},{"duration":30,"tweenEasing":0,"value":{"aM":0}},{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]}],"ffd":[{"name":"jiguang","slot":"jiguang","frame":[{"duration":79},{"duration":16,"tweenEasing":0},{"duration":15,"offset":5,"vertices":[141.47,0,141.47]}]},{"name":"jiguang","slot":"jiguang3","frame":[{"duration":64},{"duration":26,"tweenEasing":0},{"duration":20,"offset":5,"vertices":[169.85,0,169.85]}]},{"name":"jiguang","slot":"jiguang7","frame":[{"duration":64},{"duration":21,"tweenEasing":0},{"duration":25,"offset":5,"vertices":[122.89,0,122.89]}]},{"name":"jiguang","slot":"jiguang8","frame":[{"duration":64},{"duration":36,"tweenEasing":0},{"duration":10,"offset":5,"vertices":[127.94,0,127.94]}]},{"name":"meigui","slot":"meigui2","frame":[{"duration":23,"tweenEasing":0},{"duration":87,"vertices":[-1.93,-2.42,1.8,-1.65,2.33,1.95,-1.93,1.95,1.39,1.11,-1.05,-1.65,0.34,-0.29]}]},{"name":"meigui","slot":"meigui5","frame":[{"duration":42,"tweenEasing":0},{"duration":68,"vertices":[225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98]}]},{"name":"meigui","slot":"meigui6","frame":[{"duration":41,"tweenEasing":0},{"duration":11,"tweenEasing":0,"vertices":[2.77,-4.16,3.42,1.98,-1.86,4.53,-3.95,-2.02,-1.02,2.68,2.03,-2.42,0.62,0.37]},{"duration":45,"tweenEasing":0},{"duration":13,"vertices":[2.77,-4.16,3.42,1.98,-1.86,4.53,-3.95,-2.02,-1.02,2.68,2.03,-2.42,0.62,0.37]}]},{"name":"meigui","slot":"meigui13","frame":[{"duration":42},{"duration":53,"tweenEasing":0,"vertices":[112.61,-72.01,112.69,-72.31,111.03,-65.67,110.53,-63.65,111.33,-66.83,112.35,-70.97,111.86,-69.03]},{"duration":15,"vertices":[225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98]}]}]}],"defaultActions":[{"gotoAndPlay":"skill"}]},{"type":"Sheet","frameRate":10,"name":"sprite","aabb":{"x":-90,"y":-80,"width":180,"height":160},"bone":[{"name":"root"}],"slot":[{"name":"sheetSlot","parent":"root"}],"skin":[{"slot":[{"name":"sheetSlot","display":[{"name":"1 (1)"},{"name":"1 (2)"},{"name":"1 (3)"},{"name":"1 (4)"},{"name":"1 (5)"},{"name":"1 (6)"},{"name":"1 (7)"},{"name":"1 (8)"},{"name":"1 (9)"},{"name":"1 (10)"}]}]}],"animation":[{"duration":10,"playTimes":0,"name":"sprite","slot":[{"name":"sheetSlot","displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"value":5},{"value":6},{"value":7},{"value":8},{"value":9}]}]}],"defaultActions":[{"gotoAndPlay":"sprite"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/effect/effect_tex.json b/Egret/Demos/resource/effect/effect_tex.json
new file mode 100644
index 00000000..27b04611
--- /dev/null
+++ b/Egret/Demos/resource/effect/effect_tex.json
@@ -0,0 +1 @@
+{"width":512,"SubTexture":[{"width":137,"y":421,"height":123,"name":"jiguang","x":1},{"width":20,"y":333,"height":20,"name":"meigui","x":442},{"y":408,"frameWidth":75,"x":292,"frameHeight":75,"width":71,"frameY":-2,"height":71,"name":"zheng","frameX":-2},{"y":280,"frameWidth":75,"x":442,"frameHeight":75,"width":51,"frameY":-12,"height":51,"name":"zheng2","frameX":-12},{"y":1,"frameWidth":180,"x":340,"frameHeight":160,"width":158,"frameY":-22,"height":137,"name":"1 (6)","frameX":-7},{"y":146,"frameWidth":180,"x":168,"frameHeight":160,"width":154,"frameY":-27,"height":127,"name":"1 (3)","frameX":-8},{"y":293,"frameWidth":180,"x":1,"frameHeight":160,"width":145,"frameY":-30,"height":126,"name":"1 (9)","frameX":-7},{"y":1,"frameWidth":180,"x":1,"frameHeight":160,"width":165,"frameY":-4,"height":155,"name":"1 (2)","frameX":-6},{"y":140,"frameWidth":180,"x":340,"frameHeight":160,"width":151,"frameY":-17,"height":138,"name":"1 (1)","frameX":-6},{"y":407,"frameWidth":180,"x":148,"frameHeight":160,"width":142,"frameY":-28,"height":128,"name":"1 (4)","frameX":-8},{"y":280,"frameWidth":180,"x":295,"frameHeight":160,"width":145,"frameY":-33,"height":126,"name":"1 (10)","frameX":-6},{"y":158,"frameWidth":180,"x":1,"frameHeight":160,"width":145,"frameY":-23,"height":133,"name":"1 (8)","frameX":-8},{"y":1,"frameWidth":180,"x":168,"frameHeight":160,"width":170,"frameY":-12,"height":143,"name":"1 (7)","frameX":-7},{"y":275,"frameWidth":180,"x":148,"frameHeight":160,"width":145,"frameY":-27,"height":130,"name":"1 (5)","frameX":-7}],"height":1024,"name":"effect","imagePath":"effect_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/effect/effect_tex.png b/Egret/Demos/resource/effect/effect_tex.png
new file mode 100644
index 00000000..628b5ba7
Binary files /dev/null and b/Egret/Demos/resource/effect/effect_tex.png differ
diff --git a/Egret/Demos/resource/shizuku/shizuku.1024/texture_00.png b/Egret/Demos/resource/shizuku/shizuku.1024/texture_00.png
new file mode 100644
index 00000000..c3005403
Binary files /dev/null and b/Egret/Demos/resource/shizuku/shizuku.1024/texture_00.png differ
diff --git a/Egret/Demos/resource/shizuku/shizuku.1024/texture_01.png b/Egret/Demos/resource/shizuku/shizuku.1024/texture_01.png
new file mode 100644
index 00000000..96566d99
Binary files /dev/null and b/Egret/Demos/resource/shizuku/shizuku.1024/texture_01.png differ
diff --git a/Egret/Demos/resource/shizuku/shizuku.1024/texture_02.png b/Egret/Demos/resource/shizuku/shizuku.1024/texture_02.png
new file mode 100644
index 00000000..6ace01b9
Binary files /dev/null and b/Egret/Demos/resource/shizuku/shizuku.1024/texture_02.png differ
diff --git a/Egret/Demos/resource/shizuku/shizuku.1024/texture_03.png b/Egret/Demos/resource/shizuku/shizuku.1024/texture_03.png
new file mode 100644
index 00000000..93eb4c68
Binary files /dev/null and b/Egret/Demos/resource/shizuku/shizuku.1024/texture_03.png differ
diff --git a/Egret/Demos/resource/shizuku/shizuku_ske.json b/Egret/Demos/resource/shizuku/shizuku_ske.json
new file mode 100644
index 00000000..f3af6ceb
--- /dev/null
+++ b/Egret/Demos/resource/shizuku/shizuku_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"shizuku","version":"5.6","compatibleVersion":"5.5","armature":[{"name":"shizuku","aabb":{"x":-640,"y":-1380,"width":1280,"height":1380},"bone":[{"length":150,"name":"DST_BASE"},{"type":"surface","name":"B_BODY.04","segmentX":8,"segmentY":8,"vertices":[-574.8,-1106.14,-429.1,-1106.14,-283.39,-1106.14,-137.68,-1106.14,8.03,-1106.14,153.74,-1106.14,299.45,-1106.14,445.15,-1106.14,590.86,-1106.14,-574.8,-932.9,-429.1,-932.9,-283.39,-932.9,-137.68,-932.9,8.03,-932.9,153.74,-932.9,299.45,-932.9,445.15,-932.9,590.86,-932.9,-574.8,-759.66,-429.1,-759.66,-283.39,-759.66,-137.68,-759.66,8.03,-759.66,153.74,-759.66,299.45,-759.66,445.15,-759.66,590.86,-759.66,-574.8,-586.43,-429.1,-586.43,-283.39,-586.43,-137.68,-586.43,8.03,-586.43,153.74,-586.43,299.45,-586.43,445.15,-586.43,590.86,-586.43,-574.8,-413.19,-429.1,-413.19,-283.39,-413.19,-137.68,-413.19,8.03,-413.19,153.74,-413.19,299.45,-413.19,445.15,-413.19,590.86,-413.19,-574.8,-239.96,-429.1,-239.96,-283.39,-239.96,-137.68,-239.96,8.03,-239.96,153.74,-239.96,299.45,-239.96,445.15,-239.96,590.86,-239.96,-574.8,-66.72,-429.1,-66.72,-283.39,-66.72,-137.68,-66.72,8.03,-66.72,153.74,-66.72,299.45,-66.72,445.15,-66.72,590.86,-66.72,-574.8,106.51,-429.1,106.51,-283.39,106.51,-137.68,106.51,8.03,106.51,153.74,106.51,299.45,106.51,445.15,106.51,590.86,106.51,-574.8,279.75,-429.1,279.75,-283.39,279.75,-137.68,279.75,8.03,279.75,153.74,279.75,299.45,279.75,445.15,279.75,590.86,279.75]},{"length":150,"name":"B_BACKGROUND.01","transform":{"x":-17.33,"y":-22,"skX":-90,"skY":-90}},{"type":"surface","name":"B_BODY.03","parent":"B_BODY.04","segmentX":8,"segmentY":8,"vertices":[-171.8,-158.29,-129.46,-158.29,-87.11,-158.29,-44.76,-158.29,-2.41,-158.29,39.93,-158.29,82.28,-158.29,124.63,-158.29,166.97,-158.29,-171.8,-117.82,-129.46,-117.82,-87.11,-117.82,-44.76,-117.82,-2.41,-117.82,39.93,-117.82,82.28,-117.82,124.63,-117.82,166.97,-117.82,-171.8,-77.34,-129.46,-77.34,-87.11,-77.34,-44.76,-77.34,-2.41,-77.34,39.93,-77.34,82.28,-77.34,124.63,-77.34,166.97,-77.34,-171.8,-36.87,-129.46,-36.87,-87.11,-36.87,-44.76,-36.87,-2.41,-36.87,39.93,-36.87,82.28,-36.87,124.63,-36.87,166.97,-36.87,-171.8,3.6,-129.46,3.6,-87.11,3.6,-44.76,3.6,-2.41,3.6,39.93,3.6,82.28,3.6,124.63,3.6,166.97,3.6,-171.8,44.07,-129.46,44.07,-87.11,44.07,-44.76,44.07,-2.41,44.07,39.93,44.07,82.28,44.07,124.63,44.07,166.97,44.07,-171.8,84.55,-129.46,84.55,-87.11,84.55,-44.76,84.55,-2.41,84.55,39.93,84.55,82.28,84.55,124.63,84.55,166.97,84.55,-171.8,125.02,-129.46,125.02,-87.11,125.02,-44.76,125.02,-2.41,125.02,39.93,125.02,82.28,125.02,124.63,125.02,166.97,125.02,-171.8,165.49,-129.46,165.49,-87.11,165.49,-44.76,165.49,-2.41,165.49,39.93,165.49,82.28,165.49,124.63,165.49,166.97,165.49]},{"type":"surface","name":"B_BODY.02","parent":"B_BODY.03","segmentX":8,"segmentY":8,"vertices":[-174.86,-165.74,-131.63,-165.74,-88.39,-165.74,-45.15,-165.74,-1.92,-165.74,41.32,-165.74,84.56,-165.74,127.8,-165.74,171.03,-165.74,-174.86,-124.71,-131.63,-124.71,-88.39,-124.71,-45.15,-124.71,-1.92,-124.71,41.32,-124.71,84.56,-124.71,127.8,-124.71,171.03,-124.71,-174.86,-83.67,-131.63,-83.67,-88.39,-83.67,-45.15,-83.67,-1.92,-83.67,41.32,-83.67,84.56,-83.67,127.8,-83.67,171.03,-83.67,-174.86,-42.64,-131.63,-42.64,-88.39,-42.64,-45.15,-42.64,-1.92,-42.64,41.32,-42.64,84.56,-42.64,127.8,-42.64,171.03,-42.64,-174.86,-1.6,-131.63,-1.6,-88.39,-1.6,-45.15,-1.6,-1.92,-1.6,41.32,-1.6,84.56,-1.6,127.8,-1.6,171.03,-1.6,-174.86,39.43,-131.63,39.43,-88.39,39.43,-45.15,39.43,-1.92,39.43,41.32,39.43,84.56,39.43,127.8,39.43,171.03,39.43,-174.86,80.46,-131.63,80.46,-88.39,80.46,-45.15,80.46,-1.92,80.46,41.32,80.46,84.56,80.46,127.8,80.46,171.03,80.46,-174.86,121.5,-131.63,121.5,-88.39,121.5,-45.15,121.5,-1.92,121.5,41.32,121.5,84.56,121.5,127.8,121.5,171.03,121.5,-174.86,162.53,-131.63,162.53,-88.39,162.53,-45.15,162.53,-1.92,162.53,41.32,162.53,84.56,162.53,127.8,162.53,171.03,162.53]},{"type":"surface","name":"B_CLOTHES.10","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-87.08,-101.69,-67.29,-101.69,-47.49,-101.69,-27.7,-101.69,-7.9,-101.69,11.89,-101.69,31.68,-101.69,51.48,-101.69,71.27,-101.69,-87.08,-85.59,-67.29,-85.59,-47.49,-85.59,-27.7,-85.59,-7.9,-85.59,11.89,-85.59,31.68,-85.59,51.48,-85.59,71.27,-85.59,-87.08,-69.49,-67.29,-69.49,-47.49,-69.49,-27.7,-69.49,-7.9,-69.49,11.89,-69.49,31.68,-69.49,51.48,-69.49,71.27,-69.49,-87.08,-53.38,-67.29,-53.38,-47.49,-53.38,-27.7,-53.38,-7.9,-53.38,11.89,-53.38,31.68,-53.38,51.48,-53.38,71.27,-53.38,-87.08,-37.28,-67.29,-37.28,-47.49,-37.28,-27.7,-37.28,-7.9,-37.28,11.89,-37.28,31.68,-37.28,51.48,-37.28,71.27,-37.28,-87.08,-21.17,-67.29,-21.17,-47.49,-21.17,-27.7,-21.17,-7.9,-21.17,11.89,-21.17,31.68,-21.17,51.48,-21.17,71.27,-21.17,-87.08,-5.07,-67.29,-5.07,-47.49,-5.07,-27.7,-5.07,-7.9,-5.07,11.89,-5.07,31.68,-5.07,51.48,-5.07,71.27,-5.07,-87.08,11.03,-67.29,11.03,-47.49,11.03,-27.7,11.03,-7.9,11.03,11.89,11.03,31.68,11.03,51.48,11.03,71.27,11.03,-87.08,27.14,-67.29,27.14,-47.49,27.14,-27.7,27.14,-7.9,27.14,11.89,27.14,31.68,27.14,51.48,27.14,71.27,27.14]},{"type":"surface","name":"B_CLOTHES.11","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-53.62,-108.24,-45.36,-108.24,-37.1,-108.24,-28.84,-108.24,-20.58,-108.24,-12.33,-108.24,-4.07,-108.24,4.19,-108.24,12.45,-108.24,-53.62,-99.87,-45.36,-99.87,-37.1,-99.87,-28.84,-99.87,-20.58,-99.87,-12.33,-99.87,-4.07,-99.87,4.19,-99.87,12.45,-99.87,-53.62,-91.51,-45.36,-91.51,-37.1,-91.51,-28.84,-91.51,-20.58,-91.51,-12.33,-91.51,-4.07,-91.51,4.19,-91.51,12.45,-91.51,-53.62,-83.15,-45.36,-83.15,-37.1,-83.15,-28.84,-83.15,-20.58,-83.15,-12.33,-83.15,-4.07,-83.15,4.19,-83.15,12.45,-83.15,-53.62,-74.78,-45.36,-74.78,-37.1,-74.78,-28.84,-74.78,-20.58,-74.78,-12.33,-74.78,-4.07,-74.78,4.19,-74.78,12.45,-74.78,-53.62,-66.42,-45.36,-66.42,-37.1,-66.42,-28.84,-66.42,-20.58,-66.42,-12.33,-66.42,-4.07,-66.42,4.19,-66.42,12.45,-66.42,-53.62,-58.05,-45.36,-58.05,-37.1,-58.05,-28.84,-58.05,-20.58,-58.05,-12.33,-58.05,-4.07,-58.05,4.19,-58.05,12.45,-58.05,-53.62,-49.69,-45.36,-49.69,-37.1,-49.69,-28.84,-49.69,-20.58,-49.69,-12.33,-49.69,-4.07,-49.69,4.19,-49.69,12.45,-49.69,-53.62,-41.33,-45.36,-41.33,-37.1,-41.33,-28.84,-41.33,-20.58,-41.33,-12.33,-41.33,-4.07,-41.33,4.19,-41.33,12.45,-41.33]},{"type":"surface","name":"B_CLOTHES.12","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-21.62,-111.4,-13.24,-111.4,-4.86,-111.4,3.52,-111.4,11.89,-111.4,20.27,-111.4,28.65,-111.4,37.03,-111.4,45.41,-111.4,-21.62,-102.75,-13.24,-102.75,-4.86,-102.75,3.52,-102.75,11.89,-102.75,20.27,-102.75,28.65,-102.75,37.03,-102.75,45.41,-102.75,-21.62,-94.09,-13.24,-94.09,-4.86,-94.09,3.52,-94.09,11.89,-94.09,20.27,-94.09,28.65,-94.09,37.03,-94.09,45.41,-94.09,-21.62,-85.44,-13.24,-85.44,-4.86,-85.44,3.52,-85.44,11.89,-85.44,20.27,-85.44,28.65,-85.44,37.03,-85.44,45.41,-85.44,-21.62,-76.78,-13.24,-76.78,-4.86,-76.78,3.52,-76.78,11.89,-76.78,20.27,-76.78,28.65,-76.78,37.03,-76.78,45.41,-76.78,-21.62,-68.12,-13.24,-68.12,-4.86,-68.12,3.52,-68.12,11.89,-68.12,20.27,-68.12,28.65,-68.12,37.03,-68.12,45.41,-68.12,-21.62,-59.47,-13.24,-59.47,-4.86,-59.47,3.52,-59.47,11.89,-59.47,20.27,-59.47,28.65,-59.47,37.03,-59.47,45.41,-59.47,-21.62,-50.81,-13.24,-50.81,-4.86,-50.81,3.52,-50.81,11.89,-50.81,20.27,-50.81,28.65,-50.81,37.03,-50.81,45.41,-50.81,-21.62,-42.16,-13.24,-42.16,-4.86,-42.16,3.52,-42.16,11.89,-42.16,20.27,-42.16,28.65,-42.16,37.03,-42.16,45.41,-42.16]},{"type":"surface","name":"B_CLOTHES.14","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-46.57,-148.7,-23.14,-148.7,0.29,-148.7,23.72,-148.7,47.15,-148.7,70.58,-148.7,94.01,-148.7,117.44,-148.7,140.87,-148.7,-46.57,-117.79,-23.14,-117.79,0.29,-117.79,23.72,-117.79,47.15,-117.79,70.58,-117.79,94.01,-117.79,117.44,-117.79,140.87,-117.79,-46.57,-86.89,-23.14,-86.89,0.29,-86.89,23.72,-86.89,47.15,-86.89,70.58,-86.89,94.01,-86.89,117.44,-86.89,140.87,-86.89,-46.57,-55.98,-23.14,-55.98,0.29,-55.98,23.72,-55.98,47.15,-55.98,70.58,-55.98,94.01,-55.98,117.44,-55.98,140.87,-55.98,-46.57,-25.08,-23.14,-25.08,0.29,-25.08,23.72,-25.08,47.15,-25.08,70.58,-25.08,94.01,-25.08,117.44,-25.08,140.87,-25.08,-46.57,5.83,-23.14,5.83,0.29,5.83,23.72,5.83,47.15,5.83,70.58,5.83,94.01,5.83,117.44,5.83,140.87,5.83,-46.57,36.74,-23.14,36.74,0.29,36.74,23.72,36.74,47.15,36.74,70.58,36.74,94.01,36.74,117.44,36.74,140.87,36.74,-46.57,67.64,-23.14,67.64,0.29,67.64,23.72,67.64,47.15,67.64,70.58,67.64,94.01,67.64,117.44,67.64,140.87,67.64,-46.57,98.55,-23.14,98.55,0.29,98.55,23.72,98.55,47.15,98.55,70.58,98.55,94.01,98.55,117.44,98.55,140.87,98.55]},{"type":"surface","name":"B_CLOTHES.15","parent":"B_CLOTHES.14","segmentX":8,"segmentY":8,"vertices":[-170.95,-184.9,-128.03,-184.9,-85.11,-184.9,-42.19,-184.9,0.73,-184.9,43.65,-184.9,86.56,-184.9,129.48,-184.9,172.4,-184.9,-170.95,-139.4,-128.03,-139.4,-85.11,-139.4,-42.19,-139.4,0.73,-139.4,43.65,-139.4,86.56,-139.4,129.48,-139.4,172.4,-139.4,-170.95,-93.91,-128.03,-93.91,-85.11,-93.91,-42.19,-93.91,0.73,-93.91,43.65,-93.91,86.56,-93.91,129.48,-93.91,172.4,-93.91,-170.95,-48.41,-128.03,-48.41,-85.11,-48.41,-42.18,-48.41,0.66,-48.41,43.5,-48.41,86.41,-48.41,129.4,-48.41,172.4,-48.41,-170.95,-2.92,-128.03,-2.92,-85.11,-2.92,-42.26,-2.92,-0.02,-2.92,42.21,-2.92,85.23,-2.92,128.79,-2.92,172.4,-2.92,-170.95,42.58,-128.03,42.58,-85.11,42.58,-42.34,42.58,-0.71,42.58,40.92,42.58,84.04,42.58,128.18,42.58,172.4,42.58,-170.95,88.08,-128.03,88.08,-85.11,88.08,-42.34,88.08,-0.61,88.08,41.12,88.08,84.24,88.08,128.28,88.08,172.4,88.08,-170.95,133.57,-128.03,133.57,-85.11,133.57,-42.27,133.57,0.03,133.57,42.34,133.57,85.36,133.57,128.86,133.57,172.4,133.57,-170.95,179.07,-128.03,179.07,-85.11,179.07,-42.19,179.07,0.73,179.07,43.65,179.07,86.56,179.07,129.48,179.07,172.4,179.07]},{"type":"surface","name":"B_CLOTHES.18","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-154.67,-159.39,-130.05,-159.39,-105.44,-159.39,-80.83,-159.39,-56.22,-159.39,-31.6,-159.39,-6.99,-159.39,17.62,-159.39,42.24,-159.39,-154.67,-127.41,-130.05,-127.41,-105.44,-127.41,-80.83,-127.41,-56.22,-127.41,-31.6,-127.41,-6.99,-127.41,17.62,-127.41,42.24,-127.41,-154.67,-95.43,-130.05,-95.43,-105.44,-95.43,-80.83,-95.43,-56.22,-95.43,-31.6,-95.43,-6.99,-95.43,17.62,-95.43,42.24,-95.43,-154.67,-63.46,-130.05,-63.46,-105.44,-63.46,-80.83,-63.46,-56.22,-63.46,-31.6,-63.46,-6.99,-63.46,17.62,-63.46,42.24,-63.46,-154.67,-31.48,-130.05,-31.48,-105.44,-31.48,-80.83,-31.48,-56.22,-31.48,-31.6,-31.48,-6.99,-31.48,17.62,-31.48,42.24,-31.48,-154.67,0.5,-130.05,0.5,-105.44,0.5,-80.83,0.5,-56.22,0.5,-31.6,0.5,-6.99,0.5,17.62,0.5,42.24,0.5,-154.67,32.47,-130.05,32.47,-105.44,32.47,-80.83,32.47,-56.22,32.47,-31.6,32.47,-6.99,32.47,17.62,32.47,42.24,32.47,-154.67,64.45,-130.05,64.45,-105.44,64.45,-80.83,64.45,-56.22,64.45,-31.6,64.45,-6.99,64.45,17.62,64.45,42.24,64.45,-154.67,96.43,-130.05,96.43,-105.44,96.43,-80.83,96.43,-56.22,96.43,-31.6,96.43,-6.99,96.43,17.62,96.43,42.24,96.43]},{"type":"surface","name":"B_CLOTHES.34","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-133.34,-5.72,-101.37,-5.72,-69.39,-5.72,-37.41,-5.72,-5.43,-5.72,26.54,-5.72,58.52,-5.72,90.5,-5.72,122.48,-5.72,-133.34,16.38,-101.37,16.38,-69.39,16.38,-37.41,16.38,-5.43,16.38,26.54,16.38,58.52,16.38,90.5,16.38,122.48,16.38,-133.34,38.48,-101.37,38.48,-69.39,38.48,-37.41,38.48,-5.43,38.48,26.54,38.48,58.52,38.48,90.5,38.48,122.48,38.48,-133.34,60.58,-101.37,60.58,-69.39,60.58,-37.41,60.58,-5.43,60.58,26.54,60.58,58.52,60.58,90.5,60.58,122.48,60.58,-133.34,82.68,-101.37,82.68,-69.39,82.68,-37.41,82.68,-5.43,82.68,26.54,82.68,58.52,82.68,90.5,82.68,122.48,82.68,-133.34,104.78,-101.37,104.78,-69.39,104.78,-37.41,104.78,-5.43,104.78,26.54,104.78,58.52,104.78,90.5,104.78,122.48,104.78,-133.34,126.88,-101.37,126.88,-69.39,126.88,-37.41,126.88,-5.43,126.88,26.54,126.88,58.52,126.88,90.5,126.88,122.48,126.88,-133.34,148.98,-101.37,148.98,-69.39,148.98,-37.41,148.98,-5.43,148.98,26.54,148.98,58.52,148.98,90.5,148.98,122.48,148.98,-133.34,171.08,-101.37,171.08,-69.39,171.08,-37.41,171.08,-5.43,171.08,26.54,171.08,58.52,171.08,90.5,171.08,122.48,171.08]},{"type":"surface","name":"B_CLOTHES.35","parent":"B_CLOTHES.34","segmentX":8,"segmentY":8,"vertices":[-181.91,-175.57,-137.54,-175.57,-93.18,-175.57,-48.81,-175.57,-4.45,-175.57,39.92,-175.57,84.28,-175.57,128.65,-175.57,173.01,-175.57,-181.91,-131.42,-137.54,-131.42,-93.18,-131.42,-48.81,-131.42,-4.45,-131.42,39.92,-131.42,84.28,-131.42,128.65,-131.42,173.01,-131.42,-181.91,-87.28,-137.54,-87.28,-93.18,-87.28,-48.81,-87.28,-4.45,-87.28,39.92,-87.28,84.28,-87.28,128.65,-87.28,173.01,-87.28,-181.91,-43.13,-137.54,-43.13,-93.18,-43.13,-48.81,-43.13,-4.45,-43.13,39.92,-43.13,84.28,-43.13,128.65,-43.13,173.01,-43.13,-181.91,1.01,-137.54,1.01,-93.18,1.01,-48.81,1.01,-4.45,1.01,39.92,1.01,84.28,1.01,128.65,1.01,173.01,1.01,-181.91,45.16,-137.54,45.16,-93.18,45.16,-48.81,45.16,-4.45,45.16,39.92,45.16,84.28,45.16,128.65,45.16,173.01,45.16,-181.91,89.3,-137.54,89.3,-93.18,89.3,-48.81,89.3,-4.45,89.3,39.92,89.3,84.28,89.3,128.65,89.3,173.01,89.3,-181.91,133.45,-137.54,133.45,-93.18,133.45,-48.81,133.45,-4.45,133.45,39.92,133.45,84.28,133.45,128.65,133.45,173.01,133.45,-181.91,177.6,-137.54,177.6,-93.18,177.6,-48.81,177.6,-4.45,177.6,39.92,177.6,84.28,177.6,128.65,177.6,173.01,177.6]},{"type":"surface","name":"B_CLOTHES.19","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-93.43,-150.46,-72,-150.46,-50.57,-150.46,-29.14,-150.46,-7.72,-150.46,13.71,-150.46,35.14,-150.46,56.57,-150.46,77.99,-150.46,-93.43,-142.03,-72,-142.03,-50.57,-142.03,-29.14,-142.03,-7.72,-142.03,13.71,-142.03,35.14,-142.03,56.57,-142.03,77.99,-142.03,-93.43,-133.61,-72,-133.61,-50.57,-133.61,-29.14,-133.61,-7.72,-133.61,13.71,-133.61,35.14,-133.61,56.57,-133.61,77.99,-133.61,-93.43,-125.19,-72,-125.19,-50.57,-125.19,-29.14,-125.19,-7.72,-125.19,13.71,-125.19,35.14,-125.19,56.57,-125.19,77.99,-125.19,-93.43,-116.76,-72,-116.76,-50.57,-116.76,-29.14,-116.76,-7.72,-116.76,13.71,-116.76,35.14,-116.76,56.57,-116.76,77.99,-116.76,-93.43,-108.34,-72,-108.34,-50.57,-108.34,-29.14,-108.34,-7.72,-108.34,13.71,-108.34,35.14,-108.34,56.57,-108.34,77.99,-108.34,-93.43,-99.92,-72,-99.92,-50.57,-99.92,-29.14,-99.92,-7.72,-99.92,13.71,-99.92,35.14,-99.92,56.57,-99.92,77.99,-99.92,-93.43,-91.49,-72,-91.49,-50.57,-91.49,-29.14,-91.49,-7.72,-91.49,13.71,-91.49,35.14,-91.49,56.57,-91.49,77.99,-91.49,-93.43,-83.07,-72,-83.07,-50.57,-83.07,-29.14,-83.07,-7.72,-83.07,13.71,-83.07,35.14,-83.07,56.57,-83.07,77.99,-83.07]},{"type":"surface","name":"B_CLOTHES.20","parent":"B_CLOTHES.19","segmentX":8,"segmentY":8,"vertices":[-163.31,-157.15,-122.61,-157.15,-81.92,-157.15,-41.22,-157.15,-0.53,-157.15,40.16,-157.15,80.86,-157.15,121.55,-157.15,162.25,-157.15,-163.31,-116.49,-122.61,-116.49,-81.92,-116.49,-41.22,-116.49,-0.53,-116.49,40.16,-116.49,80.86,-116.49,121.55,-116.49,162.25,-116.49,-163.31,-75.84,-122.61,-75.84,-81.92,-75.84,-41.22,-75.84,-0.53,-75.84,40.16,-75.84,80.86,-75.84,121.55,-75.84,162.25,-75.84,-163.31,-35.19,-122.61,-35.19,-81.92,-35.19,-41.22,-35.19,-0.53,-35.19,40.16,-35.19,80.86,-35.19,121.55,-35.19,162.25,-35.19,-163.31,5.46,-122.61,5.46,-81.92,5.46,-41.22,5.46,-0.53,5.46,40.16,5.46,80.86,5.46,121.55,5.46,162.25,5.46,-163.31,46.11,-122.61,46.11,-81.92,46.11,-41.22,46.11,-0.53,46.11,40.16,46.11,80.86,46.11,121.55,46.11,162.25,46.11,-163.31,86.77,-122.61,86.77,-81.92,86.77,-41.22,86.77,-0.53,86.77,40.16,86.77,80.86,86.77,121.55,86.77,162.25,86.77,-163.31,127.42,-122.61,127.42,-81.92,127.42,-41.22,127.42,-0.53,127.42,40.16,127.42,80.86,127.42,121.55,127.42,162.25,127.42,-163.31,168.07,-122.61,168.07,-81.92,168.07,-41.22,168.07,-0.53,168.07,40.16,168.07,80.86,168.07,121.55,168.07,162.25,168.07]},{"type":"surface","name":"B_CLOTHES.21","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-87.05,-156.8,-73.69,-156.8,-60.34,-156.8,-46.98,-156.8,-33.63,-156.8,-20.27,-156.8,-6.92,-156.8,6.44,-156.8,19.79,-156.8,-87.05,-142.85,-73.69,-142.85,-60.34,-142.85,-46.98,-142.85,-33.63,-142.85,-20.27,-142.85,-6.92,-142.85,6.44,-142.85,19.79,-142.85,-87.05,-128.89,-73.69,-128.89,-60.34,-128.89,-46.98,-128.89,-33.63,-128.89,-20.27,-128.89,-6.92,-128.89,6.44,-128.89,19.79,-128.89,-87.05,-114.94,-73.69,-114.94,-60.34,-114.94,-46.98,-114.94,-33.63,-114.94,-20.27,-114.94,-6.92,-114.94,6.44,-114.94,19.79,-114.94,-87.05,-100.99,-73.69,-100.99,-60.34,-100.99,-46.98,-100.99,-33.63,-100.99,-20.27,-100.99,-6.92,-100.99,6.44,-100.99,19.79,-100.99,-87.05,-87.04,-73.69,-87.04,-60.34,-87.04,-46.98,-87.04,-33.63,-87.04,-20.27,-87.04,-6.92,-87.04,6.44,-87.04,19.79,-87.04,-87.05,-73.09,-73.69,-73.09,-60.34,-73.09,-46.98,-73.09,-33.63,-73.09,-20.27,-73.09,-6.92,-73.09,6.44,-73.09,19.79,-73.09,-87.05,-59.13,-73.69,-59.13,-60.34,-59.13,-46.98,-59.13,-33.63,-59.13,-20.27,-59.13,-6.92,-59.13,6.44,-59.13,19.79,-59.13,-87.05,-45.18,-73.69,-45.18,-60.34,-45.18,-46.98,-45.18,-33.63,-45.18,-20.27,-45.18,-6.92,-45.18,6.44,-45.18,19.79,-45.18]},{"type":"surface","name":"B_CLOTHES.22","parent":"B_CLOTHES.21","segmentX":8,"segmentY":8,"vertices":[-160.81,-173.51,-120.55,-173.51,-80.28,-173.51,-40.02,-173.51,0.24,-173.51,40.51,-173.51,80.77,-173.51,121.03,-173.51,161.3,-173.51,-160.81,-130.89,-120.55,-130.89,-80.28,-130.89,-40.02,-130.89,0.24,-130.89,40.51,-130.89,80.77,-130.89,121.03,-130.89,161.3,-130.89,-160.81,-88.27,-120.55,-88.27,-80.28,-88.27,-40.02,-88.27,0.24,-88.27,40.51,-88.27,80.77,-88.27,121.03,-88.27,161.3,-88.27,-160.81,-45.65,-120.55,-45.65,-80.28,-45.65,-40.02,-45.65,0.24,-45.65,40.51,-45.65,80.77,-45.65,121.03,-45.65,161.3,-45.65,-160.81,-3.04,-120.55,-3.04,-80.28,-3.04,-40.02,-3.04,0.24,-3.04,40.51,-3.04,80.77,-3.04,121.03,-3.04,161.3,-3.04,-160.81,39.58,-120.55,39.58,-80.28,39.58,-40.02,39.58,0.24,39.58,40.51,39.58,80.77,39.58,121.03,39.58,161.3,39.58,-160.81,82.2,-120.55,82.2,-80.28,82.2,-40.02,82.2,0.24,82.2,40.51,82.2,80.77,82.2,121.03,82.2,161.3,82.2,-160.81,124.81,-120.55,124.81,-80.28,124.81,-40.02,124.81,0.24,124.81,40.51,124.81,80.77,124.81,121.03,124.81,161.3,124.81,-160.81,167.43,-120.55,167.43,-80.28,167.43,-40.02,167.43,0.24,167.43,40.51,167.43,80.77,167.43,121.03,167.43,161.3,167.43]},{"type":"surface","name":"B_CLOTHES.23","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-36.75,-157.67,-22.96,-157.67,-9.17,-157.67,4.63,-157.67,18.42,-157.67,32.21,-157.67,46.01,-157.67,59.8,-157.67,73.6,-157.67,-36.75,-143.19,-22.96,-143.19,-9.17,-143.19,4.63,-143.19,18.42,-143.19,32.21,-143.19,46.01,-143.19,59.8,-143.19,73.6,-143.19,-36.75,-128.71,-22.96,-128.71,-9.17,-128.71,4.63,-128.71,18.42,-128.71,32.21,-128.71,46.01,-128.71,59.8,-128.71,73.6,-128.71,-36.75,-114.24,-22.96,-114.24,-9.17,-114.24,4.63,-114.24,18.42,-114.24,32.21,-114.24,46.01,-114.24,59.8,-114.24,73.6,-114.24,-36.75,-99.76,-22.96,-99.76,-9.17,-99.76,4.63,-99.76,18.42,-99.76,32.21,-99.76,46.01,-99.76,59.8,-99.76,73.6,-99.76,-36.75,-85.28,-22.96,-85.28,-9.17,-85.28,4.63,-85.28,18.42,-85.28,32.21,-85.28,46.01,-85.28,59.8,-85.28,73.6,-85.28,-36.75,-70.81,-22.96,-70.81,-9.17,-70.81,4.63,-70.81,18.42,-70.81,32.21,-70.81,46.01,-70.81,59.8,-70.81,73.6,-70.81,-36.75,-56.33,-22.96,-56.33,-9.17,-56.33,4.63,-56.33,18.42,-56.33,32.21,-56.33,46.01,-56.33,59.8,-56.33,73.6,-56.33,-36.75,-41.85,-22.96,-41.85,-9.17,-41.85,4.63,-41.85,18.42,-41.85,32.21,-41.85,46.01,-41.85,59.8,-41.85,73.6,-41.85]},{"type":"surface","name":"B_CLOTHES.24","parent":"B_CLOTHES.23","segmentX":8,"segmentY":8,"vertices":[-156.87,-164.06,-118.71,-164.06,-80.56,-164.06,-42.4,-164.06,-4.24,-164.06,33.91,-164.06,72.07,-164.06,110.23,-164.06,148.38,-164.06,-156.87,-121.18,-118.71,-121.18,-80.56,-121.18,-42.4,-121.18,-4.24,-121.18,33.91,-121.18,72.07,-121.18,110.23,-121.18,148.38,-121.18,-156.87,-78.3,-118.71,-78.3,-80.56,-78.3,-42.4,-78.3,-4.24,-78.3,33.91,-78.3,72.07,-78.3,110.23,-78.3,148.38,-78.3,-156.87,-35.42,-118.71,-35.42,-80.56,-35.42,-42.4,-35.42,-4.24,-35.42,33.91,-35.42,72.07,-35.42,110.23,-35.42,148.38,-35.42,-156.87,7.45,-118.71,7.45,-80.56,7.45,-42.4,7.45,-4.24,7.45,33.91,7.45,72.07,7.45,110.23,7.45,148.38,7.45,-156.87,50.33,-118.71,50.33,-80.56,50.33,-42.4,50.33,-4.24,50.33,33.91,50.33,72.07,50.33,110.23,50.33,148.38,50.33,-156.87,93.21,-118.71,93.21,-80.56,93.21,-42.4,93.21,-4.24,93.21,33.91,93.21,72.07,93.21,110.23,93.21,148.38,93.21,-156.87,136.09,-118.71,136.09,-80.56,136.09,-42.4,136.09,-4.24,136.09,33.91,136.09,72.07,136.09,110.23,136.09,148.38,136.09,-156.87,178.97,-118.71,178.97,-80.56,178.97,-42.4,178.97,-4.24,178.97,33.91,178.97,72.07,178.97,110.23,178.97,148.38,178.97]},{"type":"surface","name":"B_CLOTHES.13","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-126.12,-153.96,-96.38,-153.96,-66.63,-153.96,-36.89,-153.96,-7.14,-153.96,22.6,-153.96,52.35,-153.96,82.09,-153.96,111.84,-153.96,-126.12,-122.06,-96.38,-122.06,-66.63,-122.06,-36.89,-122.06,-7.14,-122.06,22.6,-122.06,52.35,-122.06,82.09,-122.06,111.84,-122.06,-126.12,-90.16,-96.38,-90.16,-66.63,-90.16,-36.89,-90.16,-7.14,-90.16,22.6,-90.16,52.35,-90.16,82.09,-90.16,111.84,-90.16,-126.12,-58.26,-96.38,-58.26,-66.63,-58.26,-36.89,-58.26,-7.14,-58.26,22.6,-58.26,52.35,-58.26,82.09,-58.26,111.84,-58.26,-126.12,-26.36,-96.38,-26.36,-66.63,-26.36,-36.89,-26.36,-7.14,-26.36,22.6,-26.36,52.35,-26.36,82.09,-26.36,111.84,-26.36,-126.12,5.54,-96.38,5.54,-66.63,5.54,-36.89,5.54,-7.14,5.54,22.6,5.54,52.35,5.54,82.09,5.54,111.84,5.54,-126.12,37.44,-96.38,37.44,-66.63,37.44,-36.89,37.44,-7.14,37.44,22.6,37.44,52.35,37.44,82.09,37.44,111.84,37.44,-126.12,69.34,-96.38,69.34,-66.63,69.34,-36.89,69.34,-7.14,69.34,22.6,69.34,52.35,69.34,82.09,69.34,111.84,69.34,-126.12,101.24,-96.38,101.24,-66.63,101.24,-36.89,101.24,-7.14,101.24,22.6,101.24,52.35,101.24,82.09,101.24,111.84,101.24]},{"type":"surface","name":"B_CLOTHES.16","parent":"B_CLOTHES.13","segmentX":8,"segmentY":8,"vertices":[-183.16,-186.18,-137.23,-186.18,-91.3,-186.18,-45.37,-186.18,0.56,-186.18,46.5,-186.18,92.43,-186.18,138.36,-186.18,184.29,-186.18,-183.16,-139.66,-137.23,-139.66,-91.3,-139.66,-45.37,-139.66,0.56,-139.66,46.5,-139.66,92.43,-139.66,138.36,-139.66,184.29,-139.66,-183.16,-93.15,-137.23,-93.15,-91.3,-93.15,-45.37,-93.15,0.56,-93.15,46.5,-93.15,92.43,-93.15,138.36,-93.15,184.29,-93.15,-183.16,-46.63,-137.23,-46.63,-91.3,-46.63,-45.37,-46.63,0.56,-46.63,46.5,-46.63,92.43,-46.63,138.36,-46.63,184.29,-46.63,-183.16,-0.11,-137.23,-0.11,-91.3,-0.11,-45.37,-0.11,0.56,-0.11,46.5,-0.11,92.43,-0.11,138.36,-0.11,184.29,-0.11,-183.16,46.4,-137.23,46.4,-91.3,46.4,-45.37,46.4,0.56,46.4,46.5,46.4,92.43,46.4,138.36,46.4,184.29,46.4,-183.16,92.92,-137.23,92.92,-91.3,92.92,-45.37,92.92,0.56,92.92,46.5,92.92,92.43,92.92,138.36,92.92,184.29,92.92,-183.16,139.43,-137.23,139.43,-91.3,139.43,-45.37,139.43,0.56,139.43,46.5,139.43,92.43,139.43,138.36,139.43,184.29,139.43,-183.16,185.95,-137.23,185.95,-91.3,185.95,-45.37,185.95,0.56,185.95,46.5,185.95,92.43,185.95,138.36,185.95,184.29,185.95]},{"length":150,"name":"B_CLOTHES.38","parent":"B_CLOTHES.18","transform":{"x":-106.64,"y":-60.89,"skX":84.7,"skY":84.7}},{"length":150,"name":"B_CLOTHES.39","parent":"B_CLOTHES.38","transform":{"x":291.48,"y":-20.7,"skX":-163.5,"skY":-163.5}},{"length":150,"name":"B_NECK.02","parent":"B_BODY.02","transform":{"x":-8.17,"y":-92.16,"skX":-90,"skY":-90}},{"length":150,"name":"B_CLOTHES.62","parent":"B_CLOTHES.18","transform":{"x":-106.64,"y":-60.89,"skX":84.7,"skY":84.7}},{"length":150,"name":"B_FACE.02","parent":"B_NECK.02","transform":{"x":91.33,"y":-0.17}},{"type":"surface","name":"B_EYE.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[313.89,-214.32,313.89,-189.18,313.89,-164.03,313.89,-138.89,313.89,-113.75,313.89,-88.61,313.89,-63.47,313.89,-38.32,313.89,-13.18,286.99,-214.32,286.99,-189.18,286.99,-164.03,286.99,-138.89,286.99,-113.75,286.99,-88.61,286.99,-63.47,286.99,-38.32,286.99,-13.18,260.08,-214.32,260.08,-189.18,260.08,-164.03,260.08,-138.89,260.08,-113.75,260.08,-88.61,260.08,-63.47,260.08,-38.32,260.08,-13.18,233.18,-214.32,233.18,-189.18,233.18,-164.03,233.18,-138.89,233.18,-113.75,233.18,-88.61,233.18,-63.47,233.18,-38.32,233.18,-13.18,206.28,-214.32,206.28,-189.18,206.28,-164.03,206.28,-138.89,206.28,-113.75,206.28,-88.61,206.28,-63.47,206.28,-38.32,206.28,-13.18,179.37,-214.32,179.37,-189.18,179.37,-164.03,179.37,-138.89,179.37,-113.75,179.37,-88.61,179.37,-63.47,179.37,-38.32,179.37,-13.18,152.47,-214.32,152.47,-189.18,152.47,-164.03,152.47,-138.89,152.47,-113.75,152.47,-88.61,152.47,-63.47,152.47,-38.32,152.47,-13.18,125.56,-214.32,125.56,-189.18,125.56,-164.03,125.56,-138.89,125.56,-113.75,125.56,-88.61,125.56,-63.47,125.56,-38.32,125.56,-13.18,98.66,-214.32,98.66,-189.18,98.66,-164.03,98.66,-138.89,98.66,-113.75,98.66,-88.61,98.66,-63.47,98.66,-38.32,98.66,-13.18]},{"type":"surface","name":"B_EYE.04","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[333.42,-28.13,333.42,-0.2,333.42,27.72,333.42,55.64,333.42,83.56,333.42,111.48,333.42,139.41,333.42,167.33,333.42,195.25,304.22,-28.13,304.22,-0.2,304.22,27.72,304.22,55.64,304.22,83.56,304.22,111.48,304.22,139.41,304.22,167.33,304.22,195.25,275.02,-28.13,275.02,-0.2,275.02,27.72,275.02,55.64,275.02,83.56,275.02,111.48,275.02,139.41,275.02,167.33,275.02,195.25,245.82,-28.13,245.82,-0.2,245.82,27.72,245.82,55.64,245.82,83.56,245.82,111.48,245.82,139.41,245.82,167.33,245.82,195.25,216.61,-28.13,216.61,-0.2,216.61,27.72,216.61,55.64,216.61,83.56,216.61,111.48,216.61,139.41,216.61,167.33,216.61,195.25,187.41,-28.13,187.41,-0.2,187.41,27.72,187.41,55.64,187.41,83.56,187.41,111.48,187.41,139.41,187.41,167.33,187.41,195.25,158.21,-28.13,158.21,-0.2,158.21,27.72,158.21,55.64,158.21,83.56,158.21,111.48,158.21,139.41,158.21,167.33,158.21,195.25,129.01,-28.13,129.01,-0.2,129.01,27.72,129.01,55.64,129.01,83.56,129.01,111.48,129.01,139.41,129.01,167.33,129.01,195.25,99.8,-28.13,99.8,-0.2,99.8,27.72,99.8,55.64,99.8,83.56,99.8,111.48,99.8,139.41,99.8,167.33,99.8,195.25]},{"type":"surface","name":"B_BROW.05","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[401.57,-269.07,401.57,-229.06,401.57,-189.05,401.57,-149.04,401.57,-109.03,401.57,-69.03,401.57,-29.02,401.57,10.99,401.57,51,369.37,-269.07,369.37,-229.06,369.37,-189.05,369.37,-149.04,369.37,-109.03,369.37,-69.03,369.37,-29.02,369.37,10.99,369.37,51,337.16,-269.07,337.16,-229.06,337.16,-189.05,337.16,-149.04,337.16,-109.03,337.16,-69.03,337.16,-29.02,337.16,10.99,337.16,51,304.96,-269.07,304.96,-229.06,304.96,-189.05,304.96,-149.04,304.96,-109.03,304.96,-69.03,304.96,-29.02,304.96,10.99,304.96,51,272.75,-269.07,272.75,-229.06,272.75,-189.05,272.75,-149.04,272.75,-109.03,272.75,-69.03,272.75,-29.02,272.75,10.99,272.75,51,240.55,-269.07,240.55,-229.06,240.55,-189.05,240.55,-149.04,240.55,-109.03,240.55,-69.03,240.55,-29.02,240.55,10.99,240.55,51,208.35,-269.07,208.35,-229.06,208.35,-189.05,208.35,-149.04,208.35,-109.03,208.35,-69.03,208.35,-29.02,208.35,10.99,208.35,51,176.14,-269.07,176.14,-229.06,176.14,-189.05,176.14,-149.04,176.14,-109.03,176.14,-69.03,176.14,-29.02,176.14,10.99,176.14,51,143.94,-269.07,143.94,-229.06,143.94,-189.05,143.94,-149.04,143.94,-109.03,143.94,-69.03,143.94,-29.02,143.94,10.99,143.94,51]},{"type":"surface","name":"B_BROW.06","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[412.5,-68.36,412.5,-31.02,412.5,6.32,412.5,43.67,412.5,81.01,412.5,118.35,412.5,155.69,412.5,193.03,412.5,230.37,380.56,-68.36,380.56,-31.02,380.56,6.32,380.56,43.67,380.56,81.01,380.56,118.35,380.56,155.69,380.56,193.03,380.56,230.37,348.62,-68.36,348.62,-31.02,348.62,6.32,348.62,43.67,348.62,81.01,348.62,118.35,348.62,155.69,348.62,193.03,348.62,230.37,316.68,-68.36,316.68,-31.02,316.68,6.32,316.68,43.67,316.68,81.01,316.68,118.35,316.68,155.69,316.68,193.03,316.68,230.37,284.74,-68.36,284.74,-31.02,284.74,6.32,284.74,43.67,284.74,81.01,284.74,118.35,284.74,155.69,284.74,193.03,284.74,230.37,252.8,-68.36,252.8,-31.02,252.8,6.32,252.8,43.67,252.8,81.01,252.8,118.35,252.8,155.69,252.8,193.03,252.8,230.37,220.86,-68.36,220.86,-31.02,220.86,6.32,220.86,43.67,220.86,81.01,220.86,118.35,220.86,155.69,220.86,193.03,220.86,230.37,188.92,-68.36,188.92,-31.02,188.92,6.32,188.92,43.67,188.92,81.01,188.92,118.35,188.92,155.69,188.92,193.03,188.92,230.37,156.98,-68.36,156.98,-31.02,156.98,6.32,156.98,43.67,156.98,81.01,156.98,118.35,156.98,155.69,156.98,193.03,156.98,230.37]},{"type":"surface","name":"B_MOUTH.03","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[156.33,-132.7,156.33,-101.46,156.33,-70.21,156.33,-38.96,156.33,-7.71,156.33,23.53,156.33,54.78,156.33,86.03,156.33,117.28,132.61,-132.7,132.61,-101.46,132.61,-70.21,132.61,-38.96,132.61,-7.71,132.61,23.53,132.61,54.78,132.61,86.03,132.61,117.28,108.88,-132.7,108.88,-101.46,108.88,-70.21,108.88,-38.96,108.88,-7.71,108.88,23.53,108.88,54.78,108.88,86.03,108.88,117.28,85.16,-132.7,85.16,-101.46,85.16,-70.21,85.16,-38.96,85.16,-7.71,85.16,23.53,85.16,54.78,85.16,86.03,85.16,117.28,61.43,-132.7,61.43,-101.46,61.43,-70.21,61.43,-38.96,61.43,-7.71,61.43,23.53,61.43,54.78,61.43,86.03,61.43,117.28,37.71,-132.7,37.71,-101.46,37.71,-70.21,37.71,-38.96,37.71,-7.71,37.71,23.53,37.71,54.78,37.71,86.03,37.71,117.28,13.98,-132.7,13.98,-101.46,13.98,-70.21,13.98,-38.96,13.98,-7.71,13.98,23.53,13.98,54.78,13.98,86.03,13.98,117.28,-9.74,-132.7,-9.74,-101.46,-9.74,-70.21,-9.74,-38.96,-9.74,-7.71,-9.74,23.53,-9.74,54.78,-9.74,86.03,-9.74,117.28,-33.47,-132.7,-33.47,-101.46,-33.47,-70.21,-33.47,-38.96,-33.47,-7.71,-33.47,23.53,-33.47,54.78,-33.47,86.03,-33.47,117.28]},{"type":"surface","name":"B_NOSE.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[141.96,-33.67,141.96,-29.17,141.96,-24.67,141.96,-20.17,141.96,-15.67,141.96,-11.17,141.96,-6.67,141.96,-2.17,141.96,2.33,137.36,-33.67,137.36,-29.17,137.36,-24.67,137.36,-20.17,137.36,-15.67,137.36,-11.17,137.36,-6.67,137.36,-2.17,137.36,2.33,132.77,-33.67,132.77,-29.17,132.77,-24.67,132.77,-20.17,132.77,-15.67,132.77,-11.17,132.77,-6.67,132.77,-2.17,132.77,2.33,128.18,-33.67,128.18,-29.17,128.18,-24.67,128.18,-20.17,128.18,-15.67,128.18,-11.17,128.18,-6.67,128.18,-2.17,128.18,2.33,123.58,-33.67,123.58,-29.17,123.58,-24.67,123.58,-20.17,123.58,-15.67,123.58,-11.17,123.58,-6.67,123.58,-2.17,123.58,2.33,118.99,-33.67,118.99,-29.17,118.99,-24.67,118.99,-20.17,118.99,-15.67,118.99,-11.17,118.99,-6.67,118.99,-2.17,118.99,2.33,114.4,-33.67,114.4,-29.17,114.4,-24.67,114.4,-20.17,114.4,-15.67,114.4,-11.17,114.4,-6.67,114.4,-2.17,114.4,2.33,109.8,-33.67,109.8,-29.17,109.8,-24.67,109.8,-20.17,109.8,-15.67,109.8,-11.17,109.8,-6.67,109.8,-2.17,109.8,2.33,105.21,-33.67,105.21,-29.17,105.21,-24.67,105.21,-20.17,105.21,-15.67,105.21,-11.17,105.21,-6.67,105.21,-2.17,105.21,2.33]},{"type":"surface","name":"B_EAR.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[252.74,89.02,252.74,106.52,252.74,124.02,252.74,141.52,252.74,159.03,252.74,176.53,252.74,194.03,252.74,211.53,252.74,229.04,229.88,89.02,229.88,106.52,229.88,124.02,229.88,141.52,229.88,159.03,229.88,176.53,229.88,194.03,229.88,211.53,229.88,229.04,207.03,89.02,207.03,106.52,207.03,124.02,207.03,141.52,207.03,159.03,207.03,176.53,207.03,194.03,207.03,211.53,207.03,229.04,184.17,89.02,184.17,106.52,184.17,124.02,184.17,141.52,184.17,159.03,184.17,176.53,184.17,194.03,184.17,211.53,184.17,229.04,161.31,89.02,161.31,106.52,161.31,124.02,161.31,141.52,161.31,159.03,161.31,176.53,161.31,194.03,161.31,211.53,161.31,229.04,138.45,89.02,138.45,106.52,138.45,124.02,138.45,141.52,138.45,159.03,138.45,176.53,138.45,194.03,138.45,211.53,138.45,229.04,115.6,89.02,115.6,106.52,115.6,124.02,115.6,141.52,115.6,159.03,115.6,176.53,115.6,194.03,115.6,211.53,115.6,229.04,92.74,89.02,92.74,106.52,92.74,124.02,92.74,141.52,92.74,159.03,92.74,176.53,92.74,194.03,92.74,211.53,92.74,229.04,69.88,89.02,69.88,106.52,69.88,124.02,69.88,141.52,69.88,159.03,69.88,176.53,69.88,194.03,69.88,211.53,69.88,229.04]},{"type":"surface","name":"B_EAR.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[230.68,-240.08,230.68,-224.94,230.68,-209.8,230.68,-194.65,230.68,-179.51,230.68,-164.37,230.68,-149.22,230.68,-134.08,230.68,-118.94,209.42,-240.08,209.42,-224.94,209.42,-209.8,209.42,-194.65,209.42,-179.51,209.42,-164.37,209.42,-149.22,209.42,-134.08,209.42,-118.94,188.16,-240.08,188.16,-224.94,188.16,-209.8,188.16,-194.65,188.16,-179.51,188.16,-164.37,188.16,-149.22,188.16,-134.08,188.16,-118.94,166.9,-240.08,166.9,-224.94,166.9,-209.8,166.9,-194.65,166.9,-179.51,166.9,-164.37,166.9,-149.22,166.9,-134.08,166.9,-118.94,145.64,-240.08,145.64,-224.94,145.64,-209.8,145.64,-194.65,145.64,-179.51,145.64,-164.37,145.64,-149.22,145.64,-134.08,145.64,-118.94,124.38,-240.08,124.38,-224.94,124.38,-209.8,124.38,-194.65,124.38,-179.51,124.38,-164.37,124.38,-149.22,124.38,-134.08,124.38,-118.94,103.12,-240.08,103.12,-224.94,103.12,-209.8,103.12,-194.65,103.12,-179.51,103.12,-164.37,103.12,-149.22,103.12,-134.08,103.12,-118.94,81.86,-240.08,81.86,-224.94,81.86,-209.8,81.86,-194.65,81.86,-179.51,81.86,-164.37,81.86,-149.22,81.86,-134.08,81.86,-118.94,60.6,-240.08,60.6,-224.94,60.6,-209.8,60.6,-194.65,60.6,-179.51,60.6,-164.37,60.6,-149.22,60.6,-134.08,60.6,-118.94]},{"type":"surface","name":"B_HAIR_FRONT.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[578.23,-284.44,578.23,-217.34,578.23,-150.23,578.23,-83.12,578.23,-16.02,578.23,51.09,578.23,118.2,578.23,185.3,578.23,252.41,520.55,-284.44,520.55,-217.34,520.55,-150.23,520.55,-83.12,520.55,-16.02,520.55,51.09,520.55,118.2,520.55,185.3,520.55,252.41,462.87,-284.44,462.87,-217.34,462.87,-150.23,462.87,-83.12,462.87,-16.02,462.87,51.09,462.87,118.2,462.87,185.3,462.87,252.41,405.18,-284.44,405.18,-217.34,405.18,-150.23,405.18,-83.12,405.18,-16.02,405.18,51.09,405.18,118.2,405.18,185.3,405.18,252.41,347.5,-284.44,347.5,-217.34,347.5,-150.23,347.5,-83.12,347.5,-16.02,347.5,51.09,347.5,118.2,347.5,185.3,347.5,252.41,289.82,-284.44,289.82,-217.34,289.82,-150.23,289.82,-83.12,289.82,-16.02,289.82,51.09,289.82,118.2,289.82,185.3,289.82,252.41,232.13,-284.44,232.13,-217.34,232.13,-150.23,232.13,-83.12,232.13,-16.02,232.13,51.09,232.13,118.2,232.13,185.3,232.13,252.41,174.45,-284.44,174.45,-217.34,174.45,-150.23,174.45,-83.12,174.45,-16.02,174.45,51.09,174.45,118.2,174.45,185.3,174.45,252.41,116.77,-284.44,116.77,-217.34,116.77,-150.23,116.77,-83.12,116.77,-16.02,116.77,51.09,116.77,118.2,116.77,185.3,116.77,252.41]},{"type":"surface","name":"B_HAIR_SIDE.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[531.83,-285.13,531.83,-254.06,531.83,-222.99,531.83,-191.91,531.83,-160.84,531.83,-129.77,531.83,-98.7,531.83,-67.63,531.83,-36.55,449.05,-285.13,449.05,-254.06,449.05,-222.99,449.05,-191.91,449.05,-160.84,449.05,-129.77,449.05,-98.7,449.05,-67.63,449.05,-36.55,366.27,-285.13,366.27,-254.06,366.27,-222.99,366.27,-191.91,366.27,-160.84,366.27,-129.77,366.27,-98.7,366.27,-67.63,366.27,-36.55,283.5,-285.13,283.5,-254.06,283.5,-222.99,283.5,-191.91,283.5,-160.84,283.5,-129.77,283.5,-98.7,283.5,-67.63,283.5,-36.55,200.72,-285.13,200.72,-254.06,200.72,-222.99,200.72,-191.91,200.72,-160.84,200.72,-129.77,200.72,-98.7,200.72,-67.63,200.72,-36.55,117.94,-285.13,117.94,-254.06,117.94,-222.99,117.94,-191.91,117.94,-160.84,117.94,-129.77,117.94,-98.7,117.94,-67.63,117.94,-36.55,35.17,-285.13,35.17,-254.06,35.17,-222.99,35.17,-191.91,35.17,-160.84,35.17,-129.77,35.17,-98.7,35.17,-67.63,35.17,-36.55,-47.61,-285.13,-47.61,-254.06,-47.61,-222.99,-47.61,-191.91,-47.61,-160.84,-47.61,-129.77,-47.61,-98.7,-47.61,-67.63,-47.61,-36.55,-130.39,-285.13,-130.39,-254.06,-130.39,-222.99,-130.39,-191.91,-130.39,-160.84,-130.39,-129.77,-130.39,-98.7,-130.39,-67.63,-130.39,-36.55]},{"type":"surface","name":"B_HAIR_SIDE.04","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[523.74,26.87,523.74,54.63,523.74,82.39,523.74,110.15,523.74,137.91,523.74,165.67,523.74,193.43,523.74,221.18,523.74,248.94,444.15,26.87,444.15,54.63,444.15,82.39,444.15,110.15,444.15,137.91,444.15,165.67,444.15,193.43,444.15,221.18,444.15,248.94,364.55,26.87,364.55,54.63,364.55,82.39,364.55,110.15,364.55,137.91,364.55,165.67,364.55,193.43,364.55,221.18,364.55,248.94,284.96,26.87,284.96,54.63,284.96,82.39,284.96,110.15,284.96,137.91,284.96,165.67,284.96,193.43,284.96,221.18,284.96,248.94,205.36,26.87,205.36,54.63,205.36,82.39,205.36,110.15,205.36,137.91,205.36,165.67,205.36,193.43,205.36,221.18,205.36,248.94,125.77,26.87,125.77,54.63,125.77,82.39,125.77,110.15,125.77,137.91,125.77,165.67,125.77,193.43,125.77,221.18,125.77,248.94,46.18,26.87,46.18,54.63,46.18,82.39,46.18,110.15,46.18,137.91,46.18,165.67,46.18,193.43,46.18,221.18,46.18,248.94,-33.42,26.87,-33.42,54.63,-33.42,82.39,-33.42,110.15,-33.42,137.91,-33.42,165.67,-33.42,193.43,-33.42,221.18,-33.42,248.94,-113.01,26.87,-113.01,54.63,-113.01,82.39,-113.01,110.15,-113.01,137.91,-113.01,165.67,-113.01,193.43,-113.01,221.18,-113.01,248.94]},{"type":"surface","name":"B_HAIR_SIDE.03","parent":"B_HAIR_SIDE.04","segmentX":8,"segmentY":8,"vertices":[-179,-192.14,-133.67,-192.14,-88.34,-192.14,-43,-192.14,2.33,-192.14,47.66,-192.14,92.99,-192.14,138.33,-192.14,183.66,-192.14,-179,-144.38,-133.67,-144.38,-88.34,-144.38,-43.01,-144.38,2.32,-144.38,47.66,-144.38,92.99,-144.38,138.32,-144.38,183.65,-144.38,-179.01,-96.62,-133.68,-96.62,-88.35,-96.62,-43.01,-96.62,2.32,-96.61,47.65,-96.61,92.98,-96.61,138.32,-96.61,183.65,-96.61,-179.01,-48.85,-133.68,-48.85,-88.35,-48.85,-43.02,-48.85,2.31,-48.85,47.65,-48.85,92.98,-48.85,138.31,-48.85,183.64,-48.85,-179.02,-1.09,-133.69,-1.09,-88.35,-1.09,-43.02,-1.09,2.31,-1.09,47.64,-1.09,92.97,-1.09,138.31,-1.09,183.64,-1.09,-179.02,46.67,-133.69,46.67,-88.36,46.68,-43.03,46.68,2.31,46.68,47.64,46.68,92.97,46.68,138.3,46.68,183.63,46.68,-179.03,94.44,-133.7,94.44,-88.36,94.44,-43.03,94.44,2.3,94.44,47.63,94.44,92.96,94.44,138.3,94.44,183.63,94.44,-179.03,142.2,-133.7,142.2,-88.37,142.2,-43.04,142.2,2.3,142.2,47.63,142.2,92.96,142.2,138.29,142.21,183.62,142.21,-179.04,189.97,-133.71,189.97,-88.37,189.97,-43.04,189.97,2.29,189.97,47.62,189.97,92.95,189.97,138.29,189.97,183.62,189.97]},{"type":"surface","name":"B_HAIR_SIDE.06","parent":"B_HAIR_SIDE.03","segmentX":8,"segmentY":8,"vertices":[-177.88,-194.08,-133.49,-194.08,-89.1,-194.08,-44.71,-194.08,-0.32,-194.08,44.06,-194.08,88.45,-194.08,132.84,-194.08,177.23,-194.08,-177.88,-145.91,-133.49,-145.91,-89.1,-145.91,-44.71,-145.91,-0.32,-145.91,44.06,-145.91,88.45,-145.91,132.84,-145.91,177.23,-145.91,-177.88,-97.75,-133.49,-97.75,-89.1,-97.75,-44.71,-97.75,-0.32,-97.75,44.06,-97.75,88.45,-97.75,132.84,-97.75,177.23,-97.75,-177.88,-49.59,-133.49,-49.59,-89.1,-49.59,-44.71,-49.59,-0.32,-49.59,44.06,-49.59,88.45,-49.59,132.84,-49.59,177.23,-49.59,-177.88,-1.42,-133.49,-1.42,-89.1,-1.42,-44.71,-1.42,-0.32,-1.42,44.06,-1.42,88.45,-1.42,132.84,-1.42,177.23,-1.42,-177.88,46.74,-133.49,46.74,-89.1,46.74,-44.71,46.74,-0.32,46.74,44.06,46.74,88.45,46.74,132.84,46.74,177.23,46.74,-177.88,94.9,-133.49,94.9,-89.1,94.9,-44.71,94.9,-0.32,94.9,44.06,94.9,88.45,94.9,132.84,94.9,177.23,94.9,-177.88,143.07,-133.49,143.07,-89.1,143.07,-44.71,143.07,-0.32,143.07,44.06,143.07,88.45,143.07,132.84,143.07,177.23,143.07,-177.88,191.23,-133.49,191.23,-89.1,191.23,-44.71,191.23,-0.32,191.23,44.06,191.23,88.45,191.23,132.84,191.23,177.23,191.23]},{"type":"surface","name":"B_HAIR_TWIN.04","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[575.33,-12.52,575.33,56.5,575.33,125.52,575.33,194.55,575.33,263.57,575.33,332.6,575.33,401.62,575.33,470.64,575.33,539.67,457.83,-12.52,457.83,56.5,457.83,125.52,457.83,194.55,457.83,263.57,457.83,332.6,457.83,401.62,457.83,470.64,457.83,539.67,340.33,-12.52,340.33,56.5,340.33,125.52,340.33,194.55,340.33,263.57,340.33,332.6,340.33,401.62,340.33,470.64,340.33,539.67,222.83,-12.52,222.83,56.5,222.83,125.52,222.83,194.55,222.83,263.57,222.83,332.6,222.83,401.62,222.83,470.64,222.83,539.67,105.33,-12.52,105.33,56.5,105.33,125.52,105.33,194.55,105.33,263.57,105.33,332.6,105.33,401.62,105.33,470.64,105.33,539.67,-12.17,-12.52,-12.17,56.5,-12.17,125.52,-12.17,194.55,-12.17,263.57,-12.17,332.6,-12.17,401.62,-12.17,470.64,-12.17,539.67,-129.67,-12.52,-129.67,56.5,-129.67,125.52,-129.67,194.55,-129.67,263.57,-129.67,332.6,-129.67,401.62,-129.67,470.64,-129.67,539.67,-247.17,-12.52,-247.17,56.5,-247.17,125.52,-247.17,194.55,-247.17,263.57,-247.17,332.6,-247.17,401.62,-247.17,470.64,-247.17,539.67,-364.67,-12.52,-364.67,56.5,-364.67,125.52,-364.67,194.55,-364.67,263.57,-364.67,332.6,-364.67,401.62,-364.67,470.64,-364.67,539.67]},{"type":"surface","name":"B_HAIR_TWIN.06","parent":"B_HAIR_TWIN.04","segmentX":8,"segmentY":8,"vertices":[-163.5,-190.48,-121.09,-190.48,-78.68,-190.48,-36.26,-190.48,6.15,-190.48,48.56,-190.48,90.98,-190.48,133.39,-190.48,175.8,-190.48,-163.5,-143.8,-121.09,-143.8,-78.68,-143.8,-36.26,-143.8,6.15,-143.8,48.56,-143.8,90.98,-143.8,133.39,-143.8,175.8,-143.8,-163.5,-97.13,-121.09,-97.13,-78.68,-97.13,-36.26,-97.13,6.15,-97.13,48.56,-97.13,90.98,-97.13,133.39,-97.13,175.8,-97.13,-163.5,-50.45,-121.09,-50.45,-78.68,-50.45,-36.26,-50.45,6.15,-50.45,48.56,-50.45,90.98,-50.45,133.39,-50.45,175.8,-50.45,-163.5,-3.77,-121.09,-3.77,-78.68,-3.77,-36.26,-3.77,6.15,-3.77,48.56,-3.77,90.98,-3.77,133.39,-3.77,175.8,-3.77,-163.5,42.91,-121.09,42.91,-78.68,42.91,-36.26,42.91,6.15,42.91,48.56,42.91,90.98,42.91,133.39,42.91,175.8,42.91,-163.5,89.59,-121.09,89.59,-78.68,89.59,-36.26,89.59,6.15,89.59,48.56,89.59,90.98,89.59,133.39,89.59,175.8,89.59,-163.5,136.27,-121.09,136.27,-78.68,136.27,-36.26,136.27,6.15,136.27,48.56,136.27,90.98,136.27,133.39,136.27,175.8,136.27,-163.5,182.95,-121.09,182.95,-78.68,182.95,-36.26,182.95,6.15,182.95,48.56,182.95,90.98,182.95,133.39,182.95,175.8,182.95]},{"type":"surface","name":"B_HAIR_TWIN.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[553.74,-528.52,553.74,-463.93,553.74,-399.35,553.74,-334.76,553.74,-270.18,553.74,-205.59,553.74,-141,553.74,-76.42,553.74,-11.83,436.33,-528.52,436.33,-463.93,436.33,-399.35,436.33,-334.76,436.33,-270.18,436.33,-205.59,436.33,-141,436.33,-76.42,436.33,-11.83,318.91,-528.52,318.91,-463.93,318.91,-399.35,318.91,-334.76,318.91,-270.18,318.91,-205.59,318.91,-141,318.91,-76.42,318.91,-11.83,201.5,-528.52,201.5,-463.93,201.5,-399.35,201.5,-334.76,201.5,-270.18,201.5,-205.59,201.5,-141,201.5,-76.42,201.5,-11.83,84.09,-528.52,84.09,-463.93,84.09,-399.35,84.09,-334.76,84.09,-270.18,84.09,-205.59,84.09,-141,84.09,-76.42,84.09,-11.83,-33.32,-528.52,-33.32,-463.93,-33.32,-399.35,-33.32,-334.76,-33.32,-270.18,-33.32,-205.59,-33.32,-141,-33.32,-76.42,-33.32,-11.83,-150.74,-528.52,-150.74,-463.93,-150.74,-399.35,-150.74,-334.76,-150.74,-270.18,-150.74,-205.59,-150.74,-141,-150.74,-76.42,-150.74,-11.83,-268.15,-528.52,-268.15,-463.93,-268.15,-399.35,-268.15,-334.76,-268.15,-270.18,-268.15,-205.59,-268.15,-141,-268.15,-76.42,-268.15,-11.83,-385.56,-528.52,-385.56,-463.93,-385.56,-399.35,-385.56,-334.76,-385.56,-270.18,-385.56,-205.59,-385.56,-141,-385.56,-76.42,-385.56,-11.83]},{"type":"surface","name":"B_HAIR_TWIN.03","parent":"B_HAIR_TWIN.01","segmentX":8,"segmentY":8,"vertices":[-176.96,-189.63,-133.15,-189.63,-89.35,-189.63,-45.54,-189.63,-1.74,-189.63,42.06,-189.63,85.87,-189.63,129.67,-189.63,173.48,-189.63,-176.96,-142.61,-133.15,-142.61,-89.35,-142.61,-45.54,-142.61,-1.74,-142.61,42.06,-142.61,85.87,-142.61,129.67,-142.61,173.48,-142.61,-176.96,-95.59,-133.15,-95.59,-89.35,-95.59,-45.54,-95.59,-1.74,-95.59,42.06,-95.59,85.87,-95.59,129.67,-95.59,173.48,-95.59,-176.96,-48.56,-133.15,-48.56,-89.35,-48.56,-45.54,-48.56,-1.74,-48.56,42.06,-48.56,85.87,-48.56,129.67,-48.56,173.48,-48.56,-176.96,-1.54,-133.15,-1.54,-89.35,-1.54,-45.54,-1.54,-1.74,-1.54,42.06,-1.54,85.87,-1.54,129.67,-1.54,173.48,-1.54,-176.96,45.49,-133.64,46.83,-89.78,46.68,-45.71,45.93,-1.74,45.49,42.06,45.49,85.87,45.49,129.67,45.49,173.48,45.49,-176.96,92.51,-134.13,95.2,-90.22,94.91,-45.87,93.41,-1.74,92.51,42.06,92.51,85.87,92.51,129.67,92.51,173.48,92.51,-176.96,139.53,-134.62,143.58,-90.65,143.13,-46.03,140.88,-1.74,139.53,42.06,139.53,85.87,139.53,129.67,139.53,173.48,139.53,-176.96,186.56,-135.11,191.95,-91.09,191.35,-46.2,188.35,-1.74,186.56,42.06,186.56,85.87,186.56,129.67,186.56,173.48,186.56]},{"type":"surface","name":"B_HAIR_TWIN.15","parent":"B_HAIR_TWIN.03","segmentX":8,"segmentY":8,"vertices":[-182.1,-191.51,-137.34,-191.51,-92.57,-191.51,-47.81,-191.51,-3.05,-191.51,41.72,-191.51,86.48,-191.51,131.25,-191.51,176.01,-191.51,-182.1,-143.74,-137.34,-143.74,-92.57,-143.74,-47.81,-143.74,-3.05,-143.74,41.72,-143.74,86.48,-143.74,131.25,-143.74,176.01,-143.74,-182.1,-95.98,-137.34,-95.98,-92.57,-95.98,-47.81,-95.98,-3.05,-95.98,41.72,-95.98,86.48,-95.98,131.25,-95.98,176.01,-95.98,-182.1,-48.21,-137.34,-48.21,-92.57,-48.21,-47.81,-48.21,-3.05,-48.21,41.72,-48.21,86.48,-48.21,131.25,-48.21,176.01,-48.21,-182.1,-0.44,-137.34,-0.44,-92.57,-0.44,-47.81,-0.44,-3.05,-0.44,41.72,-0.44,86.48,-0.44,131.25,-0.44,176.01,-0.44,-182.1,47.33,-137.34,47.33,-92.57,47.33,-47.81,47.33,-3.05,47.33,41.72,47.33,86.48,47.33,131.25,47.33,176.01,47.33,-182.1,95.1,-137.34,95.1,-92.57,95.1,-47.81,95.1,-3.05,95.1,41.72,95.1,86.48,95.1,131.25,95.1,176.01,95.1,-182.1,142.87,-137.34,142.87,-92.57,142.87,-47.81,142.87,-3.05,142.87,41.72,142.87,86.48,142.87,131.25,142.87,176.01,142.87,-182.1,190.63,-137.34,190.63,-92.57,190.63,-47.81,190.63,-3.05,190.63,41.72,190.63,86.48,190.63,131.25,190.63,176.01,190.63]},{"type":"surface","name":"B_HAIR_BACK.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[622.07,-345.67,622.07,-258.73,622.07,-171.79,622.07,-84.85,622.07,2.09,622.07,89.04,622.07,175.98,622.07,262.92,622.07,349.86,523.94,-345.67,523.94,-258.73,523.94,-171.79,523.94,-84.85,523.94,2.09,523.94,89.04,523.94,175.98,523.94,262.92,523.94,349.86,425.82,-345.67,425.82,-258.73,425.82,-171.79,425.82,-84.85,425.82,2.09,425.82,89.04,425.82,175.98,425.82,262.92,425.82,349.86,327.7,-345.67,327.7,-258.73,327.7,-171.79,327.7,-84.85,327.7,2.09,327.7,89.04,327.7,175.98,327.7,262.92,327.7,349.86,229.57,-345.67,229.57,-258.73,229.57,-171.79,229.57,-84.85,229.57,2.09,229.57,89.04,229.57,175.98,229.57,262.92,229.57,349.86,131.45,-345.67,131.45,-258.73,131.45,-171.79,131.45,-84.85,131.45,2.09,131.45,89.04,131.45,175.98,131.45,262.92,131.45,349.86,33.33,-345.67,33.33,-258.73,33.33,-171.79,33.33,-84.85,33.33,2.09,33.33,89.04,33.33,175.98,33.33,262.92,33.33,349.86,-64.79,-345.67,-64.79,-258.73,-64.79,-171.79,-64.79,-84.85,-64.79,2.09,-64.79,89.04,-64.79,175.98,-64.79,262.92,-64.79,349.86,-162.92,-345.67,-162.92,-258.73,-162.92,-171.79,-162.92,-84.85,-162.92,2.09,-162.92,89.04,-162.92,175.98,-162.92,262.92,-162.92,349.86]},{"length":150,"name":"B_CLOTHES.07","parent":"B_CLOTHES.14","transform":{"x":91.1,"y":-76.67,"skX":85.4,"skY":85.4}},{"length":150,"name":"B_CLOTHES.31","parent":"B_CLOTHES.18","transform":{"x":-106.87,"y":-60.91,"skX":93.9,"skY":93.9}},{"length":150,"name":"B_CLOTHES.32","parent":"B_CLOTHES.31","transform":{"x":355.72,"y":-16.23,"skX":-79.2,"skY":-79.2}},{"length":150,"name":"B_CLOTHES.33","parent":"B_CLOTHES.32","transform":{"x":265.21,"y":2.1,"skX":16.7,"skY":16.7}},{"type":"surface","name":"B_HAND.09","parent":"B_CLOTHES.33","segmentX":8,"segmentY":8,"vertices":[-117.14,-53.77,-80.32,-67.47,-43.49,-81.16,-6.67,-94.86,30.16,-108.55,66.98,-122.25,103.81,-135.94,140.63,-149.64,177.46,-163.33,-107.52,-27.9,-70.7,-41.6,-33.87,-55.29,2.95,-68.99,39.78,-82.68,76.6,-96.38,113.43,-110.07,150.25,-123.77,187.08,-137.46,-97.9,-2.03,-61.08,-15.73,-24.25,-29.42,12.57,-43.12,49.4,-56.81,86.23,-70.51,123.05,-84.2,159.88,-97.9,196.7,-111.59,-88.28,23.84,-51.45,10.14,-14.63,-3.55,22.2,-17.25,59.02,-30.94,95.85,-44.64,132.67,-58.33,169.5,-72.03,206.32,-85.72,-78.66,49.71,-41.83,36.01,-5.01,22.32,31.82,8.62,68.64,-5.07,105.47,-18.77,142.29,-32.46,179.12,-46.16,215.94,-59.85,-69.04,75.58,-32.21,61.88,4.61,48.19,41.44,34.49,78.26,20.8,115.09,7.1,151.91,-6.59,188.74,-20.29,225.56,-33.98,-59.42,101.45,-22.59,87.75,14.23,74.06,51.06,60.36,87.88,46.67,124.71,32.97,161.53,19.28,198.36,5.58,235.18,-8.11,-49.8,127.32,-12.97,113.62,23.85,99.93,60.68,86.23,97.5,72.54,134.33,58.84,171.15,45.15,207.98,31.45,244.81,17.76,-40.18,153.19,-3.35,139.49,33.48,125.8,70.3,112.1,107.13,98.41,143.95,84.71,180.78,71.02,217.6,57.32,254.43,43.63]},{"type":"surface","name":"B_HAND.10","parent":"B_HAND.09","segmentX":8,"segmentY":8,"vertices":[-178.26,-181.8,-134.31,-181.8,-90.37,-181.8,-46.42,-181.8,-2.47,-181.8,41.47,-181.8,85.42,-181.8,129.37,-181.8,173.31,-181.8,-178.26,-137.49,-134.31,-137.49,-90.37,-137.49,-46.42,-137.49,-2.47,-137.49,41.47,-137.49,85.42,-137.49,129.37,-137.49,173.31,-137.49,-178.26,-93.18,-134.31,-93.18,-90.37,-93.18,-46.42,-93.18,-2.47,-93.18,41.47,-93.18,85.42,-93.18,129.37,-93.18,173.31,-93.18,-178.26,-48.88,-134.31,-48.88,-90.37,-48.88,-46.42,-48.88,-2.47,-48.88,41.47,-48.88,85.42,-48.88,129.37,-48.88,173.31,-48.88,-178.26,-4.57,-134.31,-4.57,-90.37,-4.57,-46.42,-4.57,-2.47,-4.57,41.47,-4.57,85.42,-4.57,129.37,-4.57,173.31,-4.57,-178.26,39.74,-134.31,39.74,-90.37,39.74,-45.15,38.83,0.07,37.93,42.75,38.83,85.42,39.74,129.37,39.74,173.31,39.74,-178.26,84.05,-134.31,84.05,-90.37,84.05,-43.87,82.24,2.62,80.43,44.02,82.24,85.42,84.05,129.37,84.05,173.31,84.05,-178.26,128.36,-134.31,128.36,-90.37,128.36,-44.83,127.22,0.71,126.09,43.06,127.22,85.42,128.36,129.37,128.36,173.31,128.36,-178.26,172.66,-134.31,172.66,-90.37,172.66,-46.42,172.66,-2.47,172.66,41.47,172.66,85.42,172.66,129.37,172.66,173.31,172.66]},{"type":"surface","name":"B_HAND.12","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-83.11,2.27,-56.26,2.28,-29.42,2.3,-2.56,2.3,24.32,2.3,51.2,2.29,78.09,2.28,104.96,2.27,131.83,2.27,-83.13,23.08,-56.29,23.1,-29.44,23.13,-2.58,23.14,24.29,23.13,51.15,23.13,78.04,23.1,104.95,23.08,131.83,23.06,-83.16,43.89,-56.3,43.92,-29.42,43.94,-2.55,43.95,24.29,43.96,51.12,43.96,78,43.93,104.93,43.88,131.83,43.85,-83.19,64.71,-56.31,64.74,-29.41,64.75,-2.53,64.77,24.27,64.8,51.07,64.81,77.96,64.76,104.92,64.68,131.83,64.64,-83.23,85.52,-56.37,85.58,-29.48,85.62,-2.63,85.66,24.16,85.69,50.98,85.68,77.92,85.58,104.91,85.48,131.83,85.43,-83.25,106.33,-56.45,106.44,-29.64,106.53,-2.82,106.6,24,106.6,50.88,106.55,77.87,106.41,104.9,106.28,131.83,106.22,-83.26,127.12,-56.54,127.28,-29.81,127.42,-3.03,127.51,23.85,127.48,50.81,127.38,77.86,127.21,104.89,127.07,131.83,127.01,-83.25,147.9,-56.59,148.08,-29.92,148.27,-3.18,148.38,23.74,148.31,50.77,148.17,77.86,147.98,104.9,147.85,131.83,147.8,-83.24,168.68,-56.63,168.88,-30.01,169.08,-3.29,169.19,23.68,169.11,50.78,168.93,77.9,168.73,104.92,168.63,131.83,168.59]},{"type":"surface","name":"B_HAND.13","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-54.07,-46.15,-26,-46.15,2.06,-46.15,30.12,-46.15,58.19,-46.15,86.25,-46.15,114.31,-46.15,142.38,-46.15,170.44,-46.15,-54.07,-21.08,-26,-21.08,2.06,-21.08,30.11,-21.08,58.17,-21.07,86.24,-21.08,114.31,-21.08,142.38,-21.08,170.44,-21.08,-54.07,3.99,-26,4,2.05,4,30.09,4.01,58.15,4.01,86.24,4,114.31,3.99,142.38,3.99,170.44,3.99,-54.04,29.06,-25.97,29.08,2.06,29.11,30.07,29.13,58.11,29.13,86.21,29.09,114.31,29.06,142.37,29.06,170.44,29.06,-53.99,54.14,-25.91,54.18,2.1,54.23,30.04,54.29,58.02,54.29,86.14,54.21,114.28,54.14,142.37,54.13,170.44,54.12,-54.03,79.27,-25.95,79.34,2.02,79.44,29.9,79.53,57.87,79.49,86.06,79.33,114.27,79.22,142.37,79.2,170.44,79.19,-54.21,104.47,-26.26,104.63,1.63,104.78,29.55,104.84,57.69,104.68,86.02,104.42,114.27,104.29,142.37,104.27,170.44,104.26,-54.42,129.66,-26.62,129.9,1.24,130.08,29.27,130.07,57.59,129.8,86.02,129.48,114.27,129.35,142.37,129.33,170.44,129.33,-54.62,154.82,-26.91,155.12,0.94,155.29,29.1,155.2,57.56,154.87,86.05,154.53,114.29,154.41,142.37,154.4,170.44,154.4]},{"type":"surface","name":"B_HAND.14","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-38.29,-98.04,-11.83,-98.04,14.63,-98.04,41.09,-98.04,67.54,-98.04,94,-98.04,120.46,-98.04,146.91,-98.04,173.37,-98.04,-38.29,-67.75,-11.83,-67.75,14.63,-67.75,41.09,-67.75,67.54,-67.75,94,-67.75,120.46,-67.75,146.91,-67.75,173.37,-67.75,-38.29,-37.45,-11.83,-37.45,14.63,-37.45,41.09,-37.45,67.54,-37.45,94,-37.45,120.46,-37.45,146.91,-37.45,173.37,-37.45,-38.24,-7.18,-11.76,-7.19,14.68,-7.18,41.09,-7.16,67.52,-7.14,93.99,-7.14,120.46,-7.15,146.91,-7.15,173.37,-7.15,-38.06,23.02,-11.54,23,14.83,23.04,41.1,23.15,67.46,23.21,93.96,23.18,120.46,23.14,146.91,23.14,173.37,23.14,-37.91,53.27,-11.39,53.25,14.89,53.37,41.01,53.57,67.33,53.62,93.91,53.51,120.46,53.44,146.91,53.44,173.37,53.44,-38.32,83.88,-11.97,83.98,14.24,84.16,40.47,84.28,67.06,84.12,93.85,83.84,120.46,83.74,146.91,83.74,173.37,83.74,-38.96,114.61,-12.79,114.83,13.44,115,39.94,114.95,66.84,114.56,93.82,114.15,120.46,114.03,146.91,114.03,173.37,114.03,-39.49,145.25,-13.45,145.56,12.86,145.66,39.64,145.41,66.75,144.9,93.82,144.45,120.46,144.33,146.91,144.33,173.37,144.33]},{"type":"surface","name":"B_HAND.15","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-16.94,-149.35,6.43,-149.35,29.8,-149.35,53.17,-149.35,76.54,-149.35,99.91,-149.35,123.27,-149.35,146.64,-149.35,170.01,-149.35,-16.94,-110.77,6.43,-110.77,29.8,-110.77,53.17,-110.77,76.54,-110.77,99.91,-110.77,123.27,-110.77,146.64,-110.77,170.01,-110.77,-16.94,-72.18,6.43,-72.18,29.8,-72.18,53.17,-72.18,76.54,-72.18,99.91,-72.18,123.27,-72.18,146.64,-72.18,170.01,-72.18,-16.92,-33.61,6.46,-33.61,29.82,-33.61,53.17,-33.6,76.53,-33.6,99.9,-33.6,123.27,-33.6,146.64,-33.6,170.01,-33.6,-16.73,4.88,6.66,4.88,29.97,4.9,53.23,4.96,76.54,4.99,99.9,4.99,123.27,4.98,146.64,4.98,170.01,4.98,-16.39,43.34,6.96,43.36,30.16,43.44,53.3,43.55,76.56,43.59,99.9,43.58,123.27,43.57,146.64,43.57,170.01,43.57,-16.88,82.36,6.42,82.39,29.68,82.43,52.96,82.43,76.39,82.31,99.87,82.18,123.27,82.15,146.64,82.15,170.01,82.15,-17.82,121.56,5.47,121.6,28.9,121.52,52.49,121.32,76.19,121.02,99.83,120.78,123.27,120.74,146.64,120.74,170.01,120.74,-18.56,160.54,4.74,160.58,28.36,160.4,52.23,160.01,76.11,159.61,99.83,159.36,123.27,159.32,146.64,159.32,170.01,159.32]},{"type":"surface","name":"B_HAND.16","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-6.55,-97.38,13.58,-97.38,33.72,-97.38,53.85,-97.38,73.98,-97.38,94.11,-97.38,114.25,-97.38,134.38,-97.38,154.51,-97.38,-6.55,-82.16,13.58,-82.16,33.72,-82.16,53.85,-82.16,73.98,-82.16,94.11,-82.16,114.25,-82.16,134.38,-82.16,154.51,-82.16,-6.55,-66.94,13.58,-66.94,33.72,-66.94,53.85,-66.94,73.98,-66.94,94.11,-66.94,114.25,-66.94,134.38,-66.94,154.51,-66.94,-6.55,-51.72,13.58,-51.72,33.72,-51.72,53.85,-51.72,73.98,-51.72,94.11,-51.72,114.25,-51.72,134.38,-51.72,154.51,-51.72,-6.55,-36.49,13.58,-36.49,33.72,-36.49,53.85,-36.49,73.98,-36.49,94.11,-36.49,114.25,-36.49,134.38,-36.49,154.51,-36.49,-6.55,-21.27,13.58,-21.27,33.72,-21.27,53.85,-21.27,73.98,-21.27,94.11,-21.27,114.25,-21.27,134.38,-21.27,154.51,-21.27,-6.55,-6.05,13.58,-6.05,33.72,-6.05,53.85,-6.05,73.98,-6.05,94.11,-6.05,114.25,-6.05,134.38,-6.05,154.51,-6.05,-6.55,9.17,13.58,9.17,33.72,9.17,53.85,9.17,73.98,9.17,94.11,9.17,114.25,9.17,134.38,9.17,154.51,9.17,-6.55,24.39,13.58,24.39,33.72,24.39,53.85,24.39,73.98,24.39,94.11,24.39,114.25,24.39,134.38,24.39,154.51,24.39]},{"length":150,"name":"B_CLOTHES.40","parent":"B_CLOTHES.14","transform":{"x":91.11,"y":-76.57,"skX":97.2,"skY":97.2}},{"length":150,"name":"B_CLOTHES.41","parent":"B_CLOTHES.40","transform":{"x":300,"y":13.64,"skX":160.1,"skY":160.1}},{"length":150,"name":"B_HAND.18","parent":"B_CLOTHES.41","transform":{"x":372.97,"y":-9.7}},{"length":150,"name":"B_HAND.17","parent":"B_CLOTHES.39","transform":{"x":396.86,"y":22.99,"skX":-3.2,"skY":-3.2}},{"type":"surface","name":"B_NECK.01","parent":"B_NECK.02","segmentX":8,"segmentY":8,"vertices":[244.58,-117.17,244.58,-87.63,244.58,-58.09,244.58,-28.55,244.58,1,244.58,30.54,244.58,60.08,244.58,89.62,244.58,119.17,201.76,-117.17,201.76,-87.63,201.76,-58.09,201.76,-28.55,201.76,1,201.76,30.54,201.76,60.08,201.76,89.62,201.76,119.17,158.94,-117.17,158.94,-87.63,158.94,-58.09,158.94,-28.55,158.94,1,158.94,30.54,158.94,60.08,158.94,89.62,158.94,119.17,116.11,-117.17,116.11,-87.63,116.11,-58.09,116.11,-28.55,116.11,1,116.11,30.54,116.11,60.08,116.11,89.62,116.11,119.17,73.29,-117.17,73.29,-87.63,73.29,-58.09,73.29,-28.55,73.29,1,73.29,30.54,73.29,60.08,73.29,89.62,73.29,119.17,30.47,-117.17,30.47,-87.63,30.47,-58.09,30.47,-28.55,30.47,1,30.47,30.54,30.47,60.08,30.47,89.62,30.47,119.17,-12.36,-117.17,-12.36,-87.63,-12.36,-58.09,-12.36,-28.55,-12.36,1,-12.36,30.54,-12.36,60.08,-12.36,89.62,-12.36,119.17,-55.18,-117.17,-55.18,-87.63,-55.18,-58.09,-55.18,-28.55,-55.18,1,-55.18,30.54,-55.18,60.08,-55.18,89.62,-55.18,119.17,-98,-117.17,-98,-87.63,-98,-58.09,-98,-28.55,-98,1,-98,30.54,-98,60.08,-98,89.62,-98,119.17]},{"type":"surface","name":"B_NECK.03","parent":"B_NECK.01","segmentX":8,"segmentY":8,"vertices":[-167.24,-149.16,-126.21,-149.16,-85.18,-149.16,-44.15,-149.16,-3.12,-149.16,37.91,-149.16,78.95,-149.16,119.98,-149.16,161.01,-149.16,-167.24,-122.86,-126.21,-122.86,-85.18,-122.86,-44.15,-122.86,-3.12,-122.86,37.91,-122.86,78.95,-122.86,119.98,-122.86,161.01,-122.86,-167.24,-96.55,-126.21,-96.55,-85.18,-96.55,-44.15,-96.55,-3.12,-96.55,37.91,-96.55,78.95,-96.55,119.98,-96.55,161.01,-96.55,-167.24,-70.24,-126.21,-70.24,-85.18,-70.24,-44.15,-70.24,-3.12,-70.24,37.91,-70.24,78.95,-70.24,119.98,-70.24,161.01,-70.24,-167.24,-43.93,-126.21,-43.93,-85.18,-43.93,-44.15,-43.93,-3.12,-43.93,37.91,-43.93,78.95,-43.93,119.98,-43.93,161.01,-43.93,-167.24,-17.63,-126.21,-17.63,-85.18,-17.63,-44.15,-17.63,-3.12,-17.63,37.91,-17.63,78.95,-17.63,119.98,-17.63,161.01,-17.63,-167.24,8.68,-126.21,8.68,-85.18,8.68,-44.15,8.68,-3.12,8.68,37.91,8.68,78.95,8.68,119.98,8.68,161.01,8.68,-167.24,34.99,-126.21,34.99,-85.18,34.99,-44.15,34.99,-3.12,34.99,37.91,34.99,78.95,34.99,119.98,34.99,161.01,34.99,-167.24,61.3,-126.21,61.3,-85.18,61.3,-44.15,61.3,-3.12,61.3,37.91,61.3,78.95,61.3,119.98,61.3,161.01,61.3]},{"type":"surface","name":"B_BODY.01","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-129.18,-158.78,-97.99,-158.78,-66.8,-158.78,-35.6,-158.78,-4.41,-158.78,26.78,-158.78,57.98,-158.78,89.17,-158.78,120.36,-158.78,-129.18,-128.73,-97.99,-128.73,-66.8,-128.73,-35.6,-128.73,-4.41,-128.73,26.78,-128.73,57.98,-128.73,89.17,-128.73,120.36,-128.73,-129.18,-98.69,-97.99,-98.69,-66.8,-98.69,-35.6,-98.69,-4.41,-98.69,26.78,-98.69,57.98,-98.69,89.17,-98.69,120.36,-98.69,-129.18,-68.64,-97.99,-68.64,-66.8,-68.64,-35.6,-68.64,-4.41,-68.64,26.78,-68.64,57.98,-68.64,89.17,-68.64,120.36,-68.64,-129.18,-38.6,-97.99,-38.6,-66.8,-38.6,-35.6,-38.6,-4.41,-38.6,26.78,-38.6,57.98,-38.6,89.17,-38.6,120.36,-38.6,-129.18,-8.55,-97.99,-8.55,-66.8,-8.55,-35.6,-8.55,-4.41,-8.55,26.78,-8.55,57.98,-8.55,89.17,-8.55,120.36,-8.55,-129.18,21.49,-97.99,21.49,-66.8,21.49,-35.6,21.49,-4.41,21.49,26.78,21.49,57.98,21.49,89.17,21.49,120.36,21.49,-129.18,51.54,-97.99,51.54,-66.8,51.54,-35.6,51.54,-4.41,51.54,26.78,51.54,57.98,51.54,89.17,51.54,120.36,51.54,-129.18,81.58,-97.99,81.58,-66.8,81.58,-35.6,81.58,-4.41,81.58,26.78,81.58,57.98,81.58,89.17,81.58,120.36,81.58]},{"type":"surface","name":"B_CLOTHES.09","parent":"B_CLOTHES.10","segmentX":8,"segmentY":8,"vertices":[-170.47,-164.99,-127.16,-164.99,-83.85,-164.99,-40.53,-164.99,2.78,-164.99,46.09,-164.99,89.4,-164.99,132.72,-164.99,176.03,-164.99,-170.47,-122.81,-127.16,-122.81,-83.85,-122.81,-40.53,-122.81,2.78,-122.81,46.09,-122.81,89.4,-122.81,132.72,-122.81,176.03,-122.81,-170.47,-80.63,-127.16,-80.63,-83.85,-80.63,-40.53,-80.63,2.78,-80.63,46.09,-80.63,89.4,-80.63,132.72,-80.63,176.03,-80.63,-170.47,-38.45,-127.16,-38.45,-83.85,-38.45,-40.53,-38.45,2.78,-38.45,46.09,-38.45,89.4,-38.45,132.72,-38.45,176.03,-38.45,-170.47,3.72,-127.16,3.72,-83.85,3.72,-40.53,3.72,2.78,3.72,46.09,3.72,89.4,3.72,132.72,3.72,176.03,3.72,-170.47,45.9,-127.16,45.9,-83.85,45.9,-40.53,45.9,2.78,45.9,46.09,45.9,89.4,45.9,132.72,45.9,176.03,45.9,-170.47,88.08,-127.16,88.08,-83.85,88.08,-40.53,88.08,2.78,88.08,46.09,88.08,89.4,88.08,132.72,88.08,176.03,88.08,-170.47,130.26,-127.16,130.26,-83.85,130.26,-40.53,130.26,2.78,130.26,46.09,130.26,89.4,130.26,132.72,130.26,176.03,130.26,-170.47,172.44,-127.16,172.44,-83.85,172.44,-40.53,172.44,2.78,172.44,46.09,172.44,89.4,172.44,132.72,172.44,176.03,172.44]},{"type":"surface","name":"B_CLOTHES.17","parent":"B_CLOTHES.18","segmentX":8,"segmentY":8,"vertices":[-173.66,-175.19,-131.84,-175.19,-90.02,-175.19,-48.2,-175.19,-6.38,-175.19,35.44,-175.19,77.27,-175.19,119.09,-175.19,160.91,-175.19,-173.66,-130.57,-131.84,-130.57,-90.02,-130.57,-48.2,-130.57,-6.38,-130.57,35.44,-130.57,77.27,-130.57,119.09,-130.57,160.91,-130.57,-173.66,-85.94,-131.84,-85.94,-90.02,-85.94,-48.2,-85.94,-6.38,-85.94,35.44,-85.94,77.27,-85.94,119.09,-85.94,160.91,-85.94,-173.66,-41.32,-131.63,-41.41,-89.64,-41.44,-47.83,-41.43,-6.21,-41.38,35.41,-41.33,77.27,-41.32,119.09,-41.32,160.91,-41.32,-173.66,3.3,-130.08,2.67,-86.63,2.09,-44.56,2,-4.47,2.62,35.61,3.24,77.27,3.3,119.09,3.3,160.91,3.3,-173.66,47.93,-128.52,46.75,-83.61,45.62,-41.28,45.44,-2.73,46.63,35.81,47.81,77.27,47.93,119.09,47.93,160.91,47.93,-173.66,92.55,-127.69,91.49,-82.06,90.41,-39.72,90.23,-2.01,91.34,35.69,92.44,77.27,92.55,119.09,92.55,160.91,92.55,-173.66,137.17,-125.72,136.63,-78.27,136.06,-35.61,135.97,0.16,136.54,35.92,137.12,77.27,137.17,119.09,137.17,160.91,137.17,-173.66,181.8,-123.62,181.8,-74.2,181.8,-31.19,181.8,2.51,181.8,36.21,181.8,77.27,181.8,119.09,181.8,160.91,181.8]},{"length":150,"name":"B_CLOTHES.63","parent":"B_CLOTHES.62","transform":{"x":291.48,"y":-20.7,"skX":-163.5,"skY":-163.5}},{"type":"surface","name":"B_FACESHADOW.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[452,-248.13,452,-187.59,452,-127.05,452,-66.51,452,-5.97,452,54.57,452,115.11,452,175.65,452,236.19,410,-248.13,410,-187.59,410,-127.05,410,-66.51,410,-5.97,410,54.57,410,115.11,410,175.65,410,236.19,368,-248.13,368,-187.59,368,-127.05,368,-66.51,368,-5.97,368,54.57,368,115.11,368,175.65,368,236.19,326,-248.13,326,-187.59,326,-127.05,326,-66.51,326,-5.97,326,54.57,326,115.11,326,175.65,326,236.19,284,-248.13,284,-187.59,284,-127.05,284,-66.51,284,-5.97,284,54.57,284,115.11,284,175.65,284,236.19,242,-248.13,242,-187.59,242,-127.05,242,-66.51,242,-5.97,242,54.57,242,115.11,242,175.65,242,236.19,200,-248.13,200,-187.59,200,-127.05,200,-66.51,200,-5.97,200,54.57,200,115.11,200,175.65,200,236.19,158,-248.13,158,-187.59,158,-127.05,158,-66.51,158,-5.97,158,54.57,158,115.11,158,175.65,158,236.19,116,-248.13,116,-187.59,116,-127.05,116,-66.51,116,-5.97,116,54.57,116,115.11,116,175.65,116,236.19]},{"type":"surface","name":"B_FACESHADOW.02","parent":"B_FACESHADOW.01","segmentX":8,"segmentY":8,"vertices":[-190.79,-186.15,-143.48,-186.15,-96.16,-186.15,-48.85,-186.15,-1.54,-186.15,45.78,-186.15,93.09,-186.15,140.41,-186.15,187.72,-186.15,-190.79,-140.2,-143.48,-140.2,-96.16,-140.2,-48.85,-140.2,-1.54,-140.2,45.78,-140.2,93.09,-140.2,140.41,-140.2,187.72,-140.2,-190.79,-94.26,-143.48,-94.26,-96.16,-94.26,-48.85,-94.26,-1.54,-94.26,45.78,-94.26,93.09,-94.26,140.41,-94.26,187.72,-94.26,-190.79,-48.31,-143.48,-48.31,-96.16,-48.31,-48.85,-48.31,-1.54,-48.31,45.78,-48.31,93.09,-48.31,140.41,-48.31,187.72,-48.31,-190.79,-2.36,-143.48,-2.36,-96.16,-2.36,-48.85,-2.36,-1.54,-2.36,45.78,-2.36,93.09,-2.36,140.41,-2.36,187.72,-2.36,-190.79,43.59,-143.48,43.59,-96.16,43.59,-48.85,43.59,-1.54,43.59,45.78,43.59,93.09,43.59,140.41,43.59,187.72,43.59,-190.79,89.53,-143.48,89.53,-96.16,89.53,-48.85,89.53,-1.54,89.53,45.78,89.53,93.09,89.53,140.41,89.53,187.72,89.53,-190.79,135.48,-143.48,135.48,-96.16,135.48,-48.85,135.48,-1.54,135.48,45.78,135.48,93.09,135.48,140.41,135.48,187.72,135.48,-190.79,181.43,-143.48,181.43,-96.16,181.43,-48.85,181.43,-1.54,181.43,45.78,181.43,93.09,181.43,140.41,181.43,187.72,181.43]},{"type":"surface","name":"B_FACE.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[499,-315.38,499,-240,499,-163.05,499,-85.89,499,-8.73,499,68.43,499,145.59,499,222.75,499,299.92,420.75,-317.16,420.75,-240.23,420.75,-163.05,420.75,-85.89,420.75,-8.73,420.75,68.43,420.75,145.59,420.75,222.75,420.75,299.92,342.5,-317.38,342.5,-240.21,342.5,-163.05,342.5,-85.89,342.5,-8.73,342.5,68.43,342.5,145.59,342.5,222.75,342.5,299.92,264.25,-317.38,264.25,-240.21,264.25,-163.05,264.25,-85.89,264.25,-8.73,264.25,68.43,264.25,145.59,264.25,222.75,264.25,299.92,186,-317.38,186,-240.21,186,-163.05,186,-85.89,186,-8.73,186,68.43,186,145.59,186,222.75,186,299.92,107.75,-317.38,107.75,-240.21,107.75,-163.05,107.75,-85.89,107.75,-8.73,107.75,68.43,107.75,145.59,107.75,222.75,107.75,299.92,29.5,-317.38,29.5,-240.21,29.5,-163.05,29.5,-85.89,29.5,-8.73,29.5,68.43,29.5,145.59,29.5,222.75,29.5,299.92,-48.75,-317.38,-48.75,-240.21,-48.75,-163.05,-48.75,-85.89,-48.75,-8.73,-48.75,68.43,-48.75,145.59,-48.75,222.75,-48.75,299.92,-127,-317.38,-127,-240.21,-127,-163.05,-127,-85.89,-127,-8.73,-127,68.43,-127,145.59,-127,222.75,-127,299.92]},{"type":"surface","name":"B_EYE.01","parent":"B_EYE.02","segmentX":8,"segmentY":8,"vertices":[-184.36,-185.36,-138.97,-185.51,-93.45,-185.6,-48.16,-185.57,-3.07,-185.56,41.98,-185.59,87.16,-185.3,132.43,-185.1,177.71,-185.15,-185.19,-139.79,-139.18,-139.85,-93.41,-139.92,-48.12,-139.87,-3,-139.81,42.03,-139.83,87.16,-139.55,132.35,-139.35,177.58,-139.36,-186.09,-94.19,-139.46,-94.15,-93.44,-94.19,-48.15,-94.11,-2.96,-94,42.08,-94.03,87.18,-93.77,132.32,-93.58,177.52,-93.58,-186.12,-48.67,-139.42,-48.5,-93.44,-48.38,-48.21,-48.25,-2.97,-48.16,42.14,-48.23,87.13,-48.03,132.3,-47.96,177.57,-48.01,-184.74,-3.22,-138.85,-2.98,-93.3,-2.66,-48.17,-2.49,-3.02,-2.4,42.12,-2.43,86.81,-2.33,132.17,-2.47,177.71,-2.61,-184.16,42.69,-138.83,42.85,-93.46,43.1,-48.26,43.23,-3.18,43.36,42.03,43.4,86.43,43.45,131.99,43.25,177.81,43.11,-184.24,88.63,-139.03,88.71,-93.7,88.86,-48.43,88.96,-3.22,89.07,42.01,89.12,86.6,89.15,132.23,88.98,178.04,88.88,-184.39,134.41,-139.18,134.49,-93.9,134.64,-48.61,134.74,-3.19,134.78,42.05,134.8,87.08,134.82,132.72,134.76,178.36,134.73,-184.5,180.12,-139.33,180.22,-94.15,180.39,-48.85,180.5,-3.16,180.5,42.13,180.51,87.61,180.55,133.24,180.63,178.7,180.71]},{"type":"surface","name":"B_EYE.03","parent":"B_EYE.04","segmentX":8,"segmentY":8,"vertices":[-176.82,-176.2,-132.74,-176.23,-88.67,-176.25,-44.6,-176.24,-0.56,-176.15,43.39,-176.01,87.27,-175.91,130.91,-175.72,174.64,-175.51,-176.82,-131.91,-132.41,-133.49,-88.02,-135.1,-43.85,-135.47,0.13,-134.88,44,-134.27,87.75,-133.83,131.14,-132.55,174.59,-131.28,-176.82,-87.63,-132.1,-90.66,-87.41,-93.72,-43.15,-94.41,0.78,-93.37,44.57,-92.32,88.21,-91.59,131.37,-89.33,174.56,-87.06,-176.82,-43.34,-132.04,-46.67,-87.29,-49.9,-43.03,-50.62,0.89,-49.51,44.69,-48.41,88.35,-47.66,131.54,-45.32,174.74,-42.88,-176.82,0.95,-132.36,-0.84,-87.92,-2.49,-43.77,-2.86,0.2,-2.29,44.13,-1.69,87.96,-1.28,131.49,-0.06,175.04,1.28,-176.81,45.23,-132.68,44.98,-88.54,44.9,-44.51,44.89,-0.49,44.92,43.55,45.03,87.53,45.09,131.37,45.2,175.26,45.43,-176.81,89.52,-132.72,89.51,-88.61,89.51,-44.58,89.5,-0.57,89.47,43.48,89.52,87.49,89.56,131.43,89.58,175.42,89.6,-176.83,133.8,-132.72,133.8,-88.61,133.8,-44.57,133.79,-0.56,133.77,43.49,133.81,87.52,133.82,131.53,133.81,175.58,133.8,-176.86,178.08,-132.73,178.08,-88.6,178.08,-44.56,178.08,-0.55,178.07,43.49,178.08,87.55,178.07,131.65,178.03,175.76,178]},{"type":"surface","name":"B_EYE_BALL.05","parent":"B_EYE.01","segmentX":8,"segmentY":8,"vertices":[-109.01,-112.78,-76.73,-112.78,-44.46,-112.78,-12.19,-112.78,20.09,-112.78,52.36,-112.78,84.63,-112.78,116.9,-112.78,149.18,-112.78,-109.01,-77.87,-76.73,-77.87,-44.46,-77.87,-12.19,-77.87,20.09,-77.87,52.36,-77.87,84.63,-77.87,116.9,-77.87,149.18,-77.87,-109.01,-42.96,-76.73,-42.96,-44.46,-42.96,-12.19,-42.96,20.09,-42.96,52.36,-42.96,84.63,-42.96,116.9,-42.96,149.18,-42.96,-109.01,-8.06,-76.73,-8.06,-44.46,-8.06,-12.19,-8.06,20.09,-8.06,52.36,-8.06,84.63,-8.06,116.9,-8.06,149.18,-8.06,-109.01,26.85,-76.73,26.85,-44.46,26.85,-12.19,26.85,20.09,26.85,52.36,26.85,84.63,26.85,116.9,26.85,149.18,26.85,-109.01,61.76,-76.73,61.76,-44.46,61.76,-12.19,61.76,20.09,61.76,52.36,61.76,84.63,61.76,116.9,61.76,149.18,61.76,-109.01,96.67,-76.73,96.67,-44.46,96.67,-12.19,96.67,20.09,96.67,52.36,96.67,84.63,96.67,116.9,96.67,149.18,96.67,-109.01,131.58,-76.73,131.58,-44.46,131.58,-12.19,131.58,20.09,131.58,52.36,131.58,84.63,131.58,116.9,131.58,149.18,131.58,-109.01,166.49,-76.73,166.49,-44.46,166.49,-12.19,166.49,20.09,166.49,52.36,166.49,84.63,166.49,116.9,166.49,149.18,166.49]},{"type":"surface","name":"B_EYE_BALL.10","parent":"B_EYE.03","segmentX":8,"segmentY":8,"vertices":[-133.22,-106.6,-99.27,-106.6,-65.32,-106.6,-31.37,-106.6,2.58,-106.6,36.53,-106.6,70.48,-106.6,104.43,-106.6,138.39,-106.6,-133.22,-72.53,-99.27,-72.53,-65.32,-72.53,-31.37,-72.53,2.58,-72.53,36.53,-72.53,70.48,-72.53,104.43,-72.53,138.39,-72.53,-133.22,-38.47,-99.27,-38.47,-65.32,-38.47,-31.37,-38.47,2.58,-38.47,36.53,-38.47,70.48,-38.47,104.43,-38.47,138.39,-38.47,-133.22,-4.4,-99.27,-4.4,-65.32,-4.4,-31.37,-4.4,2.58,-4.4,36.53,-4.4,70.48,-4.4,104.43,-4.4,138.39,-4.4,-133.22,29.67,-99.27,29.67,-65.32,29.67,-31.37,29.67,2.58,29.67,36.53,29.67,70.48,29.67,104.43,29.67,138.39,29.67,-133.22,63.74,-99.27,63.74,-65.32,63.74,-31.37,63.74,2.58,63.74,36.53,63.74,70.48,63.74,104.43,63.74,138.39,63.74,-133.22,97.81,-99.27,97.81,-65.32,97.81,-31.37,97.81,2.58,97.81,36.53,97.81,70.48,97.81,104.43,97.81,138.39,97.81,-133.22,131.88,-99.27,131.88,-65.32,131.88,-31.37,131.88,2.58,131.88,36.53,131.88,70.48,131.88,104.43,131.88,138.39,131.88,-133.22,165.95,-99.27,165.95,-65.32,165.95,-31.37,165.95,2.58,165.95,36.53,165.95,70.48,165.95,104.43,165.95,138.39,165.95]},{"type":"surface","name":"B_BROW.03","parent":"B_BROW.05","segmentX":8,"segmentY":8,"vertices":[-165.41,-139.73,-128.92,-139.73,-92.43,-139.73,-55.94,-139.73,-19.45,-139.73,17.04,-139.73,53.53,-139.73,90.02,-139.73,126.5,-139.73,-165.41,-105.5,-128.92,-105.5,-92.43,-105.5,-55.94,-105.5,-19.45,-105.5,17.04,-105.5,53.53,-105.5,90.02,-105.5,126.5,-105.5,-165.41,-71.28,-128.92,-71.28,-92.43,-71.28,-55.94,-71.28,-19.45,-71.28,17.04,-71.28,53.53,-71.28,90.02,-71.28,126.5,-71.28,-165.41,-37.05,-128.92,-37.05,-92.43,-37.05,-55.94,-37.05,-19.45,-37.05,17.04,-37.05,53.53,-37.05,90.02,-37.05,126.5,-37.05,-165.41,-2.82,-128.92,-2.82,-92.43,-2.82,-55.94,-2.82,-19.45,-2.82,17.04,-2.82,53.53,-2.82,90.02,-2.82,126.5,-2.82,-165.41,31.4,-128.92,31.4,-92.43,31.4,-55.94,31.4,-19.45,31.4,17.04,31.4,53.53,31.4,90.02,31.4,126.5,31.4,-165.41,65.63,-128.92,65.63,-92.43,65.63,-55.94,65.63,-19.45,65.63,17.04,65.63,53.53,65.63,90.02,65.63,126.5,65.63,-165.41,99.85,-128.92,99.85,-92.43,99.85,-55.94,99.85,-19.45,99.85,17.04,99.85,53.53,99.85,90.02,99.85,126.5,99.85,-165.41,134.08,-128.92,134.08,-92.43,134.08,-55.94,134.08,-19.45,134.08,17.04,134.08,53.53,134.08,90.02,134.08,126.5,134.08]},{"type":"surface","name":"B_BROW.04","parent":"B_BROW.06","segmentX":8,"segmentY":8,"vertices":[-151.79,-142.29,-112.65,-142.29,-73.52,-142.29,-34.38,-142.29,4.76,-142.29,43.89,-142.29,83.03,-142.29,122.17,-142.29,161.3,-142.29,-151.79,-107.29,-112.65,-107.29,-73.52,-107.29,-34.38,-107.29,4.76,-107.29,43.89,-107.29,83.03,-107.29,122.17,-107.29,161.3,-107.29,-151.79,-72.28,-112.65,-72.28,-73.52,-72.28,-34.38,-72.28,4.76,-72.28,43.89,-72.28,83.03,-72.28,122.17,-72.28,161.3,-72.28,-151.79,-37.28,-112.65,-37.28,-73.52,-37.28,-34.38,-37.28,4.76,-37.28,43.89,-37.28,83.03,-37.28,122.17,-37.28,161.3,-37.28,-151.79,-2.27,-112.65,-2.27,-73.52,-2.27,-34.38,-2.27,4.76,-2.27,43.89,-2.27,83.03,-2.27,122.17,-2.27,161.3,-2.27,-151.79,32.73,-112.65,32.73,-73.52,32.73,-34.38,32.73,4.76,32.73,43.89,32.73,83.03,32.73,122.17,32.73,161.3,32.73,-151.79,67.74,-112.65,67.74,-73.52,67.74,-34.38,67.74,4.76,67.74,43.89,67.74,83.03,67.74,122.17,67.74,161.3,67.74,-151.79,102.75,-112.65,102.75,-73.52,102.75,-34.38,102.75,4.76,102.75,43.89,102.75,83.03,102.75,122.17,102.75,161.3,102.75,-151.79,137.75,-112.65,137.75,-73.52,137.75,-34.38,137.75,4.76,137.75,43.89,137.75,83.03,137.75,122.17,137.75,161.3,137.75]},{"type":"surface","name":"B_MOUTH.02","parent":"B_MOUTH.03","segmentX":8,"segmentY":8,"vertices":[-178.57,-176.83,-134.33,-176.83,-90.09,-176.83,-45.85,-176.83,-1.6,-176.83,42.64,-176.83,86.88,-176.83,131.12,-176.83,175.36,-176.83,-178.57,-133.24,-134.33,-133.24,-90.09,-133.24,-45.92,-133.24,-2.2,-133.23,41.52,-133.22,85.85,-133.22,130.59,-133.23,175.36,-133.24,-178.57,-89.65,-134.33,-89.65,-90.09,-89.65,-45.98,-89.64,-2.75,-89.63,40.48,-89.61,84.89,-89.61,130.1,-89.63,175.36,-89.65,-178.57,-46.05,-134.33,-46.05,-90.09,-46.05,-45.93,-46.06,-3.01,-46.08,39.91,-46.09,84.32,-46.1,129.78,-46.1,175.36,-46.05,-178.57,-2.46,-134.33,-2.46,-90.09,-2.46,-46.08,-2.5,-4.28,-2.92,37.51,-3.34,82.11,-3.28,128.64,-2.89,175.36,-2.46,-178.57,41.13,-134.33,41.13,-90.09,41.13,-46.23,41.05,-5.55,40.23,35.12,39.41,79.9,39.54,127.5,40.32,175.36,41.13,-178.57,84.72,-134.33,84.72,-90.09,84.72,-46.17,84.66,-5.89,84.01,34.38,83.37,79.16,83.49,127.1,84.16,175.36,84.72,-178.57,128.31,-134.33,128.31,-90.09,128.31,-46.26,128.33,-6.76,128.53,32.74,128.73,77.65,128.72,126.32,128.57,175.36,128.31,-178.57,171.9,-134.33,171.9,-90.09,171.9,-46.37,172,-7.69,173.12,30.99,174.23,76.04,174.06,125.49,173.02,175.36,171.9]},{"type":"surface","name":"B_MOUTH.01","parent":"B_MOUTH.02","segmentX":8,"segmentY":8,"vertices":[-159.45,-108.81,-117.56,-108.81,-75.66,-108.81,-33.77,-108.81,8.12,-108.81,50.02,-108.81,91.91,-108.81,133.81,-108.81,175.7,-108.81,-159.45,-72.73,-117.56,-72.73,-75.66,-72.73,-33.77,-72.73,8.12,-72.73,50.02,-72.73,91.91,-72.73,133.81,-72.73,175.7,-72.73,-159.45,-36.65,-117.56,-36.65,-75.66,-36.65,-33.77,-36.65,8.12,-36.65,50.02,-36.65,91.91,-36.65,133.81,-36.65,175.7,-36.65,-159.45,-0.57,-117.56,-0.57,-75.66,-0.57,-33.77,-0.57,8.12,-0.57,50.02,-0.57,91.91,-0.57,133.81,-0.57,175.7,-0.57,-159.45,35.51,-117.56,35.51,-75.66,35.51,-33.77,35.51,8.12,35.51,50.02,35.51,91.91,35.51,133.81,35.51,175.7,35.51,-159.45,71.59,-117.56,71.59,-75.66,71.59,-33.77,71.59,8.12,71.59,50.02,71.59,91.91,71.59,133.81,71.59,175.7,71.59,-159.45,107.68,-117.56,107.68,-75.66,107.68,-33.77,107.68,8.12,107.68,50.02,107.68,91.91,107.68,133.81,107.68,175.7,107.68,-159.45,143.76,-117.56,143.76,-75.66,143.76,-33.77,143.76,8.12,143.76,50.02,143.76,91.91,143.76,133.81,143.76,175.7,143.76,-159.45,179.84,-117.56,179.84,-75.66,179.84,-33.77,179.84,8.12,179.84,50.02,179.84,91.91,179.84,133.81,179.84,175.7,179.84]},{"type":"surface","name":"B_MOUTH.04","parent":"B_MOUTH.02","segmentX":8,"segmentY":8,"vertices":[-153.74,-140.09,-113.59,-140.09,-73.44,-140.09,-33.3,-140.09,6.85,-140.09,47,-140.09,87.15,-140.09,127.3,-140.09,167.45,-140.09,-153.74,-116.73,-113.59,-116.73,-73.44,-116.73,-33.3,-116.73,6.85,-116.73,47,-116.73,87.15,-116.73,127.3,-116.73,167.45,-116.73,-153.74,-93.37,-113.59,-93.37,-73.44,-93.37,-33.3,-93.37,6.85,-93.37,47,-93.37,87.15,-93.37,127.3,-93.37,167.45,-93.37,-153.74,-70,-113.59,-70,-73.44,-70,-33.3,-70,6.85,-70,47,-70,87.15,-70,127.3,-70,167.45,-70,-153.74,-46.64,-113.59,-46.64,-73.44,-46.64,-33.3,-46.64,6.85,-46.64,47,-46.64,87.15,-46.64,127.3,-46.64,167.45,-46.64,-153.74,-23.28,-113.59,-23.28,-73.44,-23.28,-33.3,-23.28,6.85,-23.28,47,-23.28,87.15,-23.28,127.3,-23.28,167.45,-23.28,-153.74,0.08,-113.59,0.08,-73.44,0.08,-33.3,0.08,6.85,0.08,47,0.08,87.15,0.08,127.3,0.08,167.45,0.08,-153.74,23.44,-113.59,23.44,-73.44,23.44,-33.3,23.44,6.85,23.44,47,23.44,87.15,23.44,127.3,23.44,167.45,23.44,-153.74,46.8,-113.59,46.8,-73.44,46.8,-33.3,46.8,6.85,46.8,47,46.8,87.15,46.8,127.3,46.8,167.45,46.8]},{"type":"surface","name":"B_MOUTH.05","parent":"B_MOUTH.02","segmentX":8,"segmentY":8,"vertices":[-130.04,-126.13,-94.19,-126.13,-58.34,-126.13,-22.48,-126.13,13.37,-126.13,49.22,-126.13,85.08,-126.13,120.93,-126.13,156.79,-126.13,-130.04,-92.77,-94.19,-92.77,-58.34,-92.77,-22.48,-92.77,13.37,-92.77,49.22,-92.77,85.08,-92.77,120.93,-92.77,156.79,-92.77,-130.04,-59.42,-94.19,-59.42,-58.34,-59.42,-22.48,-59.42,13.37,-59.42,49.22,-59.42,85.08,-59.42,120.93,-59.42,156.79,-59.42,-130.04,-26.06,-94.19,-26.06,-58.34,-26.06,-22.48,-26.06,13.37,-26.06,49.22,-26.06,85.08,-26.06,120.93,-26.06,156.79,-26.06,-130.04,7.29,-94.19,7.29,-58.34,7.29,-22.48,7.29,13.37,7.29,49.22,7.29,85.08,7.29,120.93,7.29,156.79,7.29,-130.04,40.65,-94.19,40.65,-58.34,40.65,-22.48,40.65,13.37,40.65,49.22,40.65,85.08,40.65,120.93,40.65,156.79,40.65,-130.04,74,-94.19,74,-58.34,74,-22.48,74,13.37,74,49.22,74,85.08,74,120.93,74,156.79,74,-130.04,107.36,-94.19,107.36,-58.34,107.36,-22.48,107.36,13.37,107.36,49.22,107.36,85.08,107.36,120.93,107.36,156.79,107.36,-130.04,140.72,-94.19,140.72,-58.34,140.72,-22.48,140.72,13.37,140.72,49.22,140.72,85.08,140.72,120.93,140.72,156.79,140.72]},{"type":"surface","name":"B_HAIR_FRONT.01","parent":"B_HAIR_FRONT.02","segmentX":8,"segmentY":8,"vertices":[-171.64,-167.23,-129.2,-167.23,-86.76,-167.23,-44.31,-167.23,-1.87,-167.23,40.58,-167.23,83.02,-167.23,125.47,-167.23,167.91,-167.23,-171.64,-126.11,-129.2,-126.11,-86.76,-126.11,-44.31,-126.11,-1.87,-126.11,40.58,-126.11,83.02,-126.11,125.47,-126.11,167.91,-126.11,-171.64,-85,-129.2,-85,-86.76,-85,-44.31,-85,-1.87,-85,40.58,-85,83.02,-85,125.47,-85,167.91,-85,-171.64,-43.89,-129.2,-43.89,-86.76,-43.89,-44.31,-43.89,-1.87,-43.89,40.58,-43.89,83.02,-43.89,125.47,-43.89,167.91,-43.89,-171.64,-2.77,-129.2,-2.77,-86.76,-2.77,-44.31,-2.77,-1.87,-2.77,40.58,-2.77,83.02,-2.77,125.47,-2.77,167.91,-2.77,-171.64,38.34,-129.2,38.34,-86.76,38.34,-44.31,38.34,-1.87,38.34,40.58,38.34,83.02,38.34,125.47,38.34,167.91,38.34,-171.64,79.46,-129.2,79.46,-86.76,79.46,-44.31,79.46,-1.87,79.46,40.58,79.46,83.02,79.46,125.47,79.46,167.91,79.46,-171.64,120.57,-129.2,120.57,-86.76,120.57,-44.31,120.57,-1.87,120.57,40.58,120.57,83.02,120.57,125.47,120.57,167.91,120.57,-171.64,161.68,-129.2,161.68,-86.76,161.68,-44.31,161.68,-1.87,161.68,40.58,161.68,83.02,161.68,125.47,161.68,167.91,161.68]},{"type":"surface","name":"B_HAIR_SIDE.01","parent":"B_HAIR_SIDE.02","segmentX":8,"segmentY":8,"vertices":[-168.56,-185.44,-126.27,-185.44,-83.97,-185.44,-41.67,-185.44,0.62,-185.44,42.92,-185.44,85.22,-185.44,127.51,-185.44,169.81,-185.44,-168.56,-139.56,-126.27,-139.56,-83.97,-139.56,-41.67,-139.56,0.62,-139.56,42.92,-139.56,85.22,-139.56,127.51,-139.56,169.81,-139.56,-168.56,-93.68,-126.27,-93.68,-83.97,-93.68,-41.67,-93.68,0.62,-93.68,42.92,-93.68,85.22,-93.68,127.51,-93.68,169.81,-93.68,-168.56,-47.8,-126.27,-47.8,-83.97,-47.8,-41.67,-47.8,0.62,-47.8,42.92,-47.8,85.22,-47.8,127.51,-47.8,169.81,-47.8,-168.56,-1.92,-126.27,-1.92,-83.97,-1.92,-41.67,-1.92,0.62,-1.92,42.92,-1.92,85.22,-1.92,127.51,-1.92,169.81,-1.92,-168.56,43.96,-126.27,43.96,-83.97,43.96,-41.67,43.96,0.62,43.96,42.92,43.96,85.22,43.96,127.51,43.96,169.81,43.96,-168.56,89.85,-126.27,89.85,-83.97,89.85,-41.67,89.85,0.62,89.85,42.92,89.85,85.22,89.85,127.51,89.85,169.81,89.85,-168.56,135.73,-126.27,135.73,-83.97,135.73,-41.67,135.73,0.62,135.73,42.92,135.73,85.22,135.73,127.51,135.73,169.81,135.73,-168.56,181.61,-126.27,181.61,-83.97,181.61,-41.67,181.61,0.62,181.61,42.92,181.61,85.22,181.61,127.51,181.61,169.81,181.61]},{"type":"surface","name":"B_HAIR_SIDE.05","parent":"B_HAIR_SIDE.01","segmentX":8,"segmentY":8,"vertices":[-179.97,-192.78,-135.45,-192.78,-90.94,-192.78,-46.42,-192.78,-1.91,-192.78,42.61,-192.78,87.12,-192.78,131.64,-192.78,176.15,-192.78,-179.97,-144.8,-135.45,-144.8,-90.94,-144.8,-46.42,-144.8,-1.91,-144.8,42.61,-144.8,87.12,-144.8,131.64,-144.8,176.15,-144.8,-179.97,-96.82,-135.45,-96.82,-90.94,-96.82,-46.42,-96.82,-1.91,-96.82,42.61,-96.82,87.12,-96.82,131.64,-96.82,176.15,-96.82,-179.97,-48.84,-135.45,-48.84,-90.94,-48.84,-46.42,-48.84,-1.91,-48.84,42.61,-48.84,87.12,-48.84,131.64,-48.84,176.15,-48.84,-179.97,-0.87,-135.45,-0.87,-90.94,-0.87,-46.42,-0.87,-1.91,-0.87,42.61,-0.86,87.12,-0.86,131.64,-0.86,176.15,-0.86,-179.97,47.11,-135.45,47.11,-90.94,47.11,-46.42,47.11,-1.91,47.11,42.61,47.11,87.12,47.11,131.64,47.11,176.15,47.11,-179.97,95.09,-135.45,95.09,-90.94,95.09,-46.42,95.09,-1.91,95.09,42.61,95.09,87.12,95.09,131.64,95.09,176.15,95.09,-179.97,143.07,-135.45,143.07,-90.94,143.07,-46.42,143.07,-1.91,143.07,42.61,143.07,87.12,143.07,131.64,143.07,176.15,143.07,-179.97,191.05,-135.45,191.05,-90.94,191.05,-46.42,191.05,-1.91,191.05,42.61,191.05,87.12,191.05,131.64,191.05,176.15,191.05]},{"type":"surface","name":"B_HAIR_TWIN.05","parent":"B_HAIR_TWIN.06","segmentX":8,"segmentY":8,"vertices":[-180.41,-188.43,-134.47,-188.43,-88.52,-188.43,-42.57,-188.43,3.38,-188.43,49.32,-188.43,95.27,-188.43,141.22,-188.43,187.17,-188.43,-180.41,-141.72,-134.47,-141.72,-88.52,-141.72,-42.57,-141.72,3.38,-141.72,49.32,-141.72,95.27,-141.72,141.22,-141.72,187.17,-141.72,-180.41,-95.02,-134.47,-95.02,-88.52,-95.02,-42.57,-95.02,3.38,-95.02,49.32,-95.02,95.27,-95.02,141.22,-95.02,187.17,-95.02,-180.41,-48.32,-134.47,-48.32,-88.52,-48.32,-42.57,-48.32,3.38,-48.32,49.32,-48.32,95.27,-48.32,141.22,-48.32,187.17,-48.32,-180.41,-1.62,-134.47,-1.62,-88.52,-1.62,-42.57,-1.62,3.38,-1.62,49.32,-1.62,95.27,-1.62,141.22,-1.62,187.17,-1.62,-180.41,45.08,-134.47,45.08,-88.52,45.08,-42.57,45.08,3.38,45.08,49.32,45.08,95.27,45.08,141.22,45.08,187.17,45.08,-180.41,91.79,-134.47,91.79,-88.52,91.79,-42.57,91.79,3.38,91.79,49.32,91.79,95.27,91.79,141.22,91.79,187.17,91.79,-180.41,138.49,-134.47,138.49,-88.52,138.49,-42.57,138.49,3.38,138.49,49.32,138.49,95.27,138.49,141.22,138.49,187.17,138.49,-180.41,185.19,-134.47,185.19,-88.52,185.19,-42.57,185.19,3.38,185.19,49.32,185.19,95.27,185.19,141.22,185.19,187.17,185.19]},{"type":"surface","name":"B_HAIR_TWIN.07","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-78.23,-162.39,-71.61,-162.39,-64.99,-162.39,-58.37,-162.39,-51.74,-162.39,-45.12,-162.39,-38.5,-162.39,-31.88,-162.39,-25.26,-162.39,-78.23,-150.25,-71.61,-150.25,-64.99,-150.25,-58.37,-150.25,-51.74,-150.25,-45.12,-150.25,-38.5,-150.25,-31.88,-150.25,-25.26,-150.25,-78.23,-138.11,-71.61,-138.11,-64.99,-138.11,-58.37,-138.11,-51.74,-138.11,-45.12,-138.11,-38.5,-138.11,-31.88,-138.11,-25.26,-138.11,-78.23,-125.97,-71.61,-125.97,-64.99,-125.97,-58.37,-125.97,-51.74,-125.97,-45.12,-125.97,-38.5,-125.97,-31.88,-125.97,-25.26,-125.97,-78.23,-113.83,-71.61,-113.83,-64.99,-113.83,-58.37,-113.83,-51.74,-113.83,-45.12,-113.83,-38.5,-113.83,-31.88,-113.83,-25.26,-113.83,-78.23,-101.69,-71.61,-101.69,-64.99,-101.69,-58.37,-101.69,-51.74,-101.69,-45.12,-101.69,-38.5,-101.69,-31.88,-101.69,-25.26,-101.69,-78.23,-89.55,-71.61,-89.55,-64.99,-89.55,-58.37,-89.55,-51.74,-89.55,-45.12,-89.55,-38.5,-89.55,-31.88,-89.55,-25.26,-89.55,-78.23,-77.41,-71.61,-77.41,-64.99,-77.41,-58.37,-77.41,-51.74,-77.41,-45.12,-77.41,-38.5,-77.41,-31.88,-77.41,-25.26,-77.41,-78.23,-65.28,-71.61,-65.28,-64.99,-65.28,-58.37,-65.28,-51.74,-65.28,-45.12,-65.28,-38.5,-65.28,-31.88,-65.28,-25.26,-65.28]},{"type":"surface","name":"B_HAIR_TWIN.16","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-104.3,-187.92,-70.44,-187.92,-36.59,-187.92,-2.74,-187.92,31.11,-187.92,64.97,-187.92,98.82,-187.92,132.67,-187.92,166.53,-187.92,-104.3,-141.39,-70.44,-141.39,-36.59,-141.39,-2.74,-141.39,31.11,-141.39,64.97,-141.39,98.82,-141.39,132.67,-141.39,166.53,-141.39,-104.3,-94.87,-70.44,-94.87,-36.59,-94.87,-2.74,-94.87,31.11,-94.87,64.97,-94.87,98.82,-94.87,132.67,-94.87,166.53,-94.87,-104.3,-48.34,-70.44,-48.34,-36.59,-48.34,-2.74,-48.34,31.11,-48.34,64.97,-48.34,98.82,-48.34,132.67,-48.34,166.53,-48.34,-104.3,-1.81,-70.44,-1.81,-36.59,-1.81,-2.74,-1.81,31.11,-1.81,64.97,-1.81,98.82,-1.81,132.67,-1.81,166.53,-1.81,-104.3,44.71,-70.44,44.71,-36.59,44.71,-2.74,44.71,31.11,44.71,64.97,44.71,98.82,44.71,132.67,44.71,166.53,44.71,-104.3,91.24,-70.44,91.24,-36.59,91.24,-2.74,91.24,31.11,91.24,64.97,91.24,98.82,91.24,132.67,91.24,166.53,91.24,-104.3,137.76,-70.44,137.76,-36.59,137.76,-2.74,137.76,31.11,137.76,64.97,137.76,98.82,137.76,132.67,137.76,166.53,137.76,-104.3,184.29,-70.44,184.29,-36.59,184.29,-2.74,184.29,31.11,184.29,64.97,184.29,98.82,184.29,132.67,184.29,166.53,184.29]},{"type":"surface","name":"B_HAIR_TWIN.17","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-106.57,-180.12,-71.06,-180.12,-35.55,-180.12,-0.04,-180.12,35.47,-180.12,70.98,-180.12,106.5,-180.12,142.01,-180.12,177.52,-180.12,-106.57,-137.16,-71.06,-137.16,-35.55,-137.16,-0.04,-137.16,35.47,-137.16,70.98,-137.16,106.5,-137.16,142.01,-137.16,177.52,-137.16,-106.57,-94.21,-71.06,-94.21,-35.55,-94.21,-0.04,-94.21,35.47,-94.21,70.98,-94.21,106.5,-94.21,142.01,-94.21,177.52,-94.21,-106.57,-51.25,-71.06,-51.25,-35.55,-51.25,-0.04,-51.25,35.47,-51.25,70.98,-51.25,106.5,-51.25,142.01,-51.25,177.52,-51.25,-106.57,-8.29,-71.06,-8.29,-35.55,-8.29,-0.04,-8.29,35.47,-8.29,70.98,-8.29,106.5,-8.29,142.01,-8.29,177.52,-8.29,-106.57,34.67,-71.06,34.67,-35.55,34.67,-0.04,34.67,35.47,34.67,70.98,34.67,106.5,34.67,142.01,34.67,177.52,34.67,-106.57,77.63,-71.06,77.63,-35.55,77.63,-0.04,77.63,35.47,77.63,70.98,77.63,106.5,77.63,142.01,77.63,177.52,77.63,-106.57,120.58,-71.06,120.58,-35.55,120.58,-0.04,120.58,35.47,120.58,70.98,120.58,106.5,120.58,142.01,120.58,177.52,120.58,-106.57,163.54,-71.06,163.54,-35.55,163.54,-0.04,163.54,35.47,163.54,70.98,163.54,106.5,163.54,142.01,163.54,177.52,163.54]},{"type":"surface","name":"B_HAIR_TWIN.18","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-100.75,-179.48,-66.05,-179.48,-31.36,-179.48,3.33,-179.48,38.02,-179.48,72.71,-179.48,107.41,-179.48,142.1,-179.48,176.79,-179.48,-100.75,-133.82,-66.05,-133.82,-31.36,-133.82,3.33,-133.82,38.02,-133.82,72.71,-133.82,107.41,-133.82,142.1,-133.82,176.79,-133.82,-100.75,-88.15,-66.05,-88.15,-31.36,-88.15,3.33,-88.15,38.02,-88.15,72.71,-88.15,107.41,-88.15,142.1,-88.15,176.79,-88.15,-100.75,-42.49,-66.05,-42.49,-31.36,-42.49,3.33,-42.49,38.02,-42.49,72.71,-42.49,107.41,-42.49,142.1,-42.49,176.79,-42.49,-100.75,3.18,-66.05,3.18,-31.36,3.18,3.33,3.18,38.02,3.18,72.71,3.18,107.41,3.18,142.1,3.18,176.79,3.18,-100.75,48.84,-66.05,48.84,-31.36,48.84,3.33,48.84,38.02,48.84,72.71,48.84,107.41,48.84,142.1,48.84,176.79,48.84,-100.75,94.51,-66.05,94.51,-31.36,94.51,3.33,94.51,38.02,94.51,72.71,94.51,107.41,94.51,142.1,94.51,176.79,94.51,-100.75,140.17,-66.05,140.17,-31.36,140.17,3.33,140.17,38.02,140.17,72.71,140.17,107.41,140.17,142.1,140.17,176.79,140.17,-100.75,185.84,-66.05,185.84,-31.36,185.84,3.33,185.84,38.02,185.84,72.71,185.84,107.41,185.84,142.1,185.84,176.79,185.84]},{"type":"surface","name":"B_HAIR_TWIN.19","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-123.6,-175.04,-92.26,-175.04,-60.92,-175.04,-29.57,-175.04,1.77,-175.04,33.11,-175.04,64.45,-175.04,95.8,-175.04,127.14,-175.04,-123.6,-132.49,-92.26,-132.49,-60.92,-132.49,-29.57,-132.49,1.77,-132.49,33.11,-132.49,64.45,-132.49,95.8,-132.49,127.14,-132.49,-123.6,-89.93,-92.26,-89.93,-60.92,-89.93,-29.57,-89.93,1.77,-89.93,33.11,-89.93,64.45,-89.93,95.8,-89.93,127.14,-89.93,-123.6,-47.38,-92.26,-47.38,-60.92,-47.38,-29.57,-47.38,1.77,-47.38,33.11,-47.38,64.45,-47.38,95.8,-47.38,127.14,-47.38,-123.6,-4.83,-92.26,-4.83,-60.92,-4.83,-29.57,-4.83,1.77,-4.83,33.11,-4.83,64.45,-4.83,95.8,-4.83,127.14,-4.83,-123.6,37.73,-92.26,37.73,-60.92,37.73,-29.57,37.73,1.77,37.73,33.11,37.73,64.45,37.73,95.8,37.73,127.14,37.73,-123.6,80.28,-92.26,80.28,-60.92,80.28,-29.57,80.28,1.77,80.28,33.11,80.28,64.45,80.28,95.8,80.28,127.14,80.28,-123.6,122.83,-92.26,122.83,-60.92,122.83,-29.57,122.83,1.77,122.83,33.11,122.83,64.45,122.83,95.8,122.83,127.14,122.83,-123.6,165.38,-92.26,165.38,-60.92,165.38,-29.57,165.38,1.77,165.38,33.11,165.38,64.45,165.38,95.8,165.38,127.14,165.38]},{"type":"surface","name":"B_HAIR_TWIN.20","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-132.4,-166.1,-102.9,-166.1,-73.41,-166.1,-43.92,-166.1,-14.42,-166.1,15.07,-166.1,44.57,-166.1,74.06,-166.1,103.55,-166.1,-132.4,-129.59,-102.9,-129.59,-73.41,-129.59,-43.92,-129.59,-14.42,-129.59,15.07,-129.59,44.57,-129.59,74.06,-129.59,103.55,-129.59,-132.4,-93.08,-102.9,-93.08,-73.41,-93.08,-43.92,-93.08,-14.42,-93.08,15.07,-93.08,44.57,-93.08,74.06,-93.08,103.55,-93.08,-132.4,-56.58,-102.9,-56.58,-73.41,-56.58,-43.92,-56.58,-14.42,-56.58,15.07,-56.58,44.57,-56.58,74.06,-56.58,103.55,-56.58,-132.4,-20.07,-102.9,-20.07,-73.41,-20.07,-43.92,-20.07,-14.42,-20.07,15.07,-20.07,44.57,-20.07,74.06,-20.07,103.55,-20.07,-132.4,16.44,-102.9,16.44,-73.41,16.44,-43.92,16.44,-14.42,16.44,15.07,16.44,44.57,16.44,74.06,16.44,103.55,16.44,-132.4,52.94,-102.9,52.94,-73.41,52.94,-43.92,52.94,-14.42,52.94,15.07,52.94,44.57,52.94,74.06,52.94,103.55,52.94,-132.4,89.45,-102.9,89.45,-73.41,89.45,-43.92,89.45,-14.42,89.45,15.07,89.45,44.57,89.45,74.06,89.45,103.55,89.45,-132.4,125.95,-102.9,125.95,-73.41,125.95,-43.92,125.95,-14.42,125.95,15.07,125.95,44.57,125.95,74.06,125.95,103.55,125.95]},{"type":"surface","name":"B_HAIR_TWIN.21","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-92.9,-166.34,-75.27,-166.34,-57.65,-166.34,-40.02,-166.34,-22.4,-166.34,-4.77,-166.34,12.86,-166.34,30.48,-166.34,48.11,-166.34,-92.9,-126.55,-75.27,-126.55,-57.65,-126.55,-40.02,-126.55,-22.4,-126.55,-4.77,-126.55,12.86,-126.55,30.48,-126.55,48.11,-126.55,-92.9,-86.75,-75.27,-86.75,-57.65,-86.75,-40.02,-86.75,-22.4,-86.75,-4.77,-86.75,12.86,-86.75,30.48,-86.75,48.11,-86.75,-92.9,-46.96,-75.27,-46.96,-57.65,-46.96,-40.02,-46.96,-22.4,-46.96,-4.77,-46.96,12.86,-46.96,30.48,-46.96,48.11,-46.96,-92.9,-7.17,-75.27,-7.17,-57.65,-7.17,-40.02,-7.17,-22.4,-7.17,-4.77,-7.17,12.86,-7.17,30.48,-7.17,48.11,-7.17,-92.9,32.63,-75.27,32.63,-57.65,32.63,-40.02,32.63,-22.4,32.63,-4.77,32.63,12.86,32.63,30.48,32.63,48.11,32.63,-92.9,72.42,-75.27,72.42,-57.65,72.42,-40.02,72.42,-22.4,72.42,-4.77,72.42,12.86,72.42,30.48,72.42,48.11,72.42,-92.9,112.21,-75.27,112.21,-57.65,112.21,-40.02,112.21,-22.4,112.21,-4.77,112.21,12.86,112.21,30.48,112.21,48.11,112.21,-92.9,152,-75.27,152,-57.65,152,-40.02,152,-22.4,152,-4.77,152,12.86,152,30.48,152,48.11,152]},{"type":"surface","name":"B_HAIR_TWIN.08","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-3.5,-163.12,5.94,-163.12,15.38,-163.12,24.81,-163.12,34.25,-163.12,43.69,-163.12,53.13,-163.12,62.57,-163.12,72.01,-163.12,-3.5,-151.57,5.94,-151.57,15.38,-151.57,24.81,-151.57,34.25,-151.57,43.69,-151.57,53.13,-151.57,62.57,-151.57,72.01,-151.57,-3.5,-140.01,5.94,-140.01,15.38,-140.01,24.81,-140.01,34.25,-140.01,43.69,-140.01,53.13,-140.01,62.57,-140.01,72.01,-140.01,-3.5,-128.46,5.94,-128.46,15.38,-128.46,24.81,-128.46,34.25,-128.46,43.69,-128.46,53.13,-128.46,62.57,-128.46,72.01,-128.46,-3.5,-116.91,5.94,-116.91,15.38,-116.91,24.81,-116.91,34.25,-116.91,43.69,-116.91,53.13,-116.91,62.57,-116.91,72.01,-116.91,-3.5,-105.35,5.94,-105.35,15.38,-105.35,24.81,-105.35,34.25,-105.35,43.69,-105.35,53.13,-105.35,62.57,-105.35,72.01,-105.35,-3.5,-93.8,5.94,-93.8,15.38,-93.8,24.81,-93.8,34.25,-93.8,43.69,-93.8,53.13,-93.8,62.57,-93.8,72.01,-93.8,-3.5,-82.25,5.94,-82.25,15.38,-82.25,24.81,-82.25,34.25,-82.25,43.69,-82.25,53.13,-82.25,62.57,-82.25,72.01,-82.25,-3.5,-70.7,5.94,-70.7,15.38,-70.7,24.81,-70.7,34.25,-70.7,43.69,-70.7,53.13,-70.7,62.57,-70.7,72.01,-70.7]},{"type":"surface","name":"B_HAIR_TWIN.02","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-140.26,-182.52,-110.87,-182.52,-81.49,-182.52,-52.11,-182.52,-22.72,-182.52,6.66,-182.52,36.05,-182.52,65.43,-182.52,94.81,-182.52,-140.26,-140.16,-110.87,-140.16,-81.49,-140.16,-52.11,-140.16,-22.72,-140.16,6.66,-140.16,36.05,-140.16,65.43,-140.16,94.81,-140.16,-140.26,-97.8,-110.87,-97.8,-81.49,-97.8,-52.11,-97.8,-22.72,-97.8,6.66,-97.8,36.05,-97.8,65.43,-97.8,94.81,-97.8,-140.26,-55.44,-110.87,-55.44,-81.49,-55.44,-52.11,-55.44,-22.72,-55.44,6.66,-55.44,36.05,-55.44,65.43,-55.44,94.81,-55.44,-140.26,-13.07,-110.87,-13.07,-81.49,-13.07,-52.11,-13.07,-22.72,-13.07,6.66,-13.07,36.05,-13.07,65.43,-13.07,94.81,-13.07,-140.26,29.29,-110.87,29.29,-81.49,29.29,-52.11,29.29,-22.72,29.29,6.66,29.29,36.05,29.29,65.43,29.29,94.81,29.29,-140.26,71.65,-110.87,71.65,-81.49,71.65,-52.11,71.65,-22.72,71.65,6.66,71.65,36.05,71.65,65.43,71.65,94.81,71.65,-140.26,114.02,-110.87,114.02,-81.49,114.02,-52.11,114.02,-22.72,114.02,6.66,114.02,36.05,114.02,65.43,114.02,94.81,114.02,-140.26,156.38,-110.87,156.38,-81.49,156.38,-52.11,156.38,-22.72,156.38,6.66,156.38,36.05,156.38,65.43,156.38,94.81,156.38]},{"type":"surface","name":"B_HAIR_TWIN.09","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-138.59,-191.25,-110.85,-191.29,-83.11,-191.33,-55.38,-191.37,-27.64,-191.41,0.1,-191.45,27.84,-191.49,55.57,-191.53,83.31,-191.57,-138.31,-145.23,-110.57,-145.26,-82.83,-145.3,-55.1,-145.34,-27.36,-145.38,0.38,-145.42,28.12,-145.46,55.85,-145.5,83.59,-145.54,-138.03,-99.2,-110.29,-99.24,-82.55,-99.28,-54.81,-99.32,-27.08,-99.35,0.66,-99.39,28.4,-99.43,56.13,-99.47,83.87,-99.51,-137.75,-53.17,-110.01,-53.21,-82.27,-53.25,-54.53,-53.29,-26.8,-53.33,0.94,-53.37,28.68,-53.41,56.42,-53.44,84.15,-53.48,-137.46,-7.14,-109.73,-7.18,-81.99,-7.22,-54.25,-7.26,-26.52,-7.3,1.22,-7.34,28.96,-7.38,56.7,-7.42,84.43,-7.46,-137.18,38.88,-109.45,38.84,-81.71,38.81,-53.97,38.77,-26.23,38.73,1.5,38.69,29.24,38.65,56.98,38.61,84.71,38.57,-136.9,84.91,-109.17,84.87,-81.43,84.83,-53.69,84.79,-25.95,84.75,1.78,84.72,29.52,84.68,57.26,84.64,85,84.6,-136.62,130.94,-108.88,130.9,-81.15,130.86,-53.41,130.82,-25.67,130.78,2.06,130.74,29.8,130.7,57.54,130.66,85.28,130.63,-136.34,176.96,-108.6,176.93,-80.87,176.89,-53.13,176.85,-25.39,176.81,2.35,176.77,30.08,176.73,57.82,176.69,85.56,176.65]},{"type":"surface","name":"B_HAIR_TWIN.10","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-144.51,-183.13,-104.01,-183.13,-63.52,-183.13,-23.02,-183.13,17.48,-183.13,57.97,-183.13,98.47,-183.13,138.96,-183.13,179.46,-183.13,-144.51,-137.66,-104.01,-137.66,-63.52,-137.66,-23.02,-137.66,17.48,-137.66,57.97,-137.66,98.47,-137.66,138.96,-137.66,179.46,-137.66,-144.51,-92.19,-104.01,-92.19,-63.52,-92.19,-23.02,-92.19,17.48,-92.19,57.97,-92.19,98.47,-92.19,138.96,-92.19,179.46,-92.19,-144.51,-46.71,-104.01,-46.71,-63.52,-46.71,-23.02,-46.71,17.48,-46.71,57.97,-46.71,98.47,-46.71,138.96,-46.71,179.46,-46.71,-144.51,-1.24,-104.01,-1.24,-63.52,-1.24,-23.02,-1.24,17.48,-1.24,57.97,-1.24,98.47,-1.24,138.96,-1.24,179.46,-1.24,-144.51,44.23,-104.01,44.23,-63.52,44.23,-23.02,44.23,17.48,44.23,57.97,44.23,98.47,44.23,138.96,44.23,179.46,44.23,-144.51,89.71,-104.01,89.71,-63.52,89.71,-23.02,89.71,17.48,89.71,57.97,89.71,98.47,89.71,138.96,89.71,179.46,89.71,-144.51,135.18,-104.01,135.18,-63.52,135.18,-23.02,135.18,17.48,135.18,57.97,135.18,98.47,135.18,138.96,135.18,179.46,135.18,-144.51,180.65,-104.01,180.65,-63.52,180.65,-23.02,180.65,17.48,180.65,57.97,180.65,98.47,180.65,138.96,180.65,179.46,180.65]},{"type":"surface","name":"B_HAIR_TWIN.11","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-97.49,-194.19,-67.77,-194.19,-38.05,-194.19,-8.33,-194.19,21.39,-194.19,51.11,-194.19,80.83,-194.19,110.55,-194.19,140.27,-194.19,-97.49,-146.78,-67.77,-146.78,-38.05,-146.78,-8.33,-146.78,21.39,-146.78,51.11,-146.78,80.83,-146.78,110.55,-146.78,140.27,-146.78,-97.49,-99.36,-67.77,-99.36,-38.05,-99.36,-8.33,-99.36,21.39,-99.36,51.11,-99.36,80.83,-99.36,110.55,-99.36,140.27,-99.36,-97.49,-51.95,-67.77,-51.95,-38.05,-51.95,-8.33,-51.95,21.39,-51.95,51.11,-51.95,80.83,-51.95,110.55,-51.95,140.27,-51.95,-97.49,-4.54,-67.77,-4.54,-38.05,-4.54,-8.33,-4.54,21.39,-4.54,51.11,-4.54,80.83,-4.54,110.55,-4.54,140.27,-4.54,-97.49,42.88,-67.77,42.88,-38.05,42.88,-8.33,42.88,21.39,42.88,51.11,42.88,80.83,42.88,110.55,42.88,140.27,42.88,-97.49,90.29,-67.77,90.29,-38.05,90.29,-8.33,90.29,21.39,90.29,51.11,90.29,80.83,90.29,110.55,90.29,140.27,90.29,-97.49,137.71,-67.77,137.71,-38.05,137.71,-8.33,137.71,21.39,137.71,51.11,137.71,80.83,137.71,110.55,137.71,140.27,137.71,-97.49,185.12,-67.77,185.12,-38.05,185.12,-8.33,185.12,21.39,185.12,51.11,185.12,80.83,185.12,110.55,185.12,140.27,185.12]},{"type":"surface","name":"B_HAIR_TWIN.12","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-39.07,-158.26,-20.86,-158.26,-2.66,-158.26,15.54,-158.26,33.74,-158.26,51.94,-158.26,70.14,-158.26,88.34,-158.26,106.54,-158.26,-39.07,-115.02,-20.86,-115.02,-2.66,-115.02,15.54,-115.02,33.74,-115.02,51.94,-115.02,70.14,-115.02,88.34,-115.02,106.54,-115.02,-39.07,-71.77,-20.86,-71.77,-2.66,-71.77,15.54,-71.77,33.74,-71.77,51.94,-71.77,70.14,-71.77,88.34,-71.77,106.54,-71.77,-39.07,-28.53,-20.86,-28.53,-2.66,-28.53,15.54,-28.53,33.74,-28.53,51.94,-28.53,70.14,-28.53,88.34,-28.53,106.54,-28.53,-39.07,14.72,-20.86,14.72,-2.66,14.72,15.54,14.72,33.74,14.72,51.94,14.72,70.14,14.72,88.34,14.72,106.54,14.72,-39.07,57.97,-20.86,57.97,-2.66,57.97,15.54,57.97,33.74,57.97,51.94,57.97,70.14,57.97,88.34,57.97,106.54,57.97,-39.07,101.21,-20.86,101.21,-2.66,101.21,15.54,101.21,33.74,101.21,51.94,101.21,70.14,101.21,88.34,101.21,106.54,101.21,-39.07,144.46,-20.86,144.46,-2.66,144.46,15.54,144.46,33.74,144.46,51.94,144.46,70.14,144.46,88.34,144.46,106.54,144.46,-39.07,187.7,-20.86,187.7,-2.66,187.7,15.54,187.7,33.74,187.7,51.94,187.7,70.14,187.7,88.34,187.7,106.54,187.7]},{"type":"surface","name":"B_HAIR_TWIN.13","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-174.36,-138.73,-138.23,-138.73,-102.11,-138.73,-65.98,-138.73,-29.85,-138.73,6.27,-138.73,42.4,-138.73,78.53,-138.73,114.66,-138.73,-174.36,-101.83,-138.23,-101.83,-102.11,-101.83,-65.98,-101.83,-29.85,-101.83,6.27,-101.83,42.4,-101.83,78.53,-101.83,114.66,-101.83,-174.36,-64.93,-138.23,-64.93,-102.11,-64.93,-65.98,-64.93,-29.85,-64.93,6.27,-64.93,42.4,-64.93,78.53,-64.93,114.66,-64.93,-174.36,-28.03,-138.23,-28.03,-102.11,-28.03,-65.98,-28.03,-29.85,-28.03,6.27,-28.03,42.4,-28.03,78.53,-28.03,114.66,-28.03,-174.36,8.87,-138.23,8.87,-102.11,8.87,-65.98,8.87,-29.85,8.87,6.27,8.87,42.4,8.87,78.53,8.87,114.66,8.87,-174.36,45.77,-138.23,45.77,-102.11,45.77,-65.98,45.77,-29.85,45.77,6.27,45.77,42.4,45.77,78.53,45.77,114.66,45.77,-174.36,82.67,-138.23,82.67,-102.11,82.67,-65.98,82.67,-29.85,82.67,6.27,82.67,42.4,82.67,78.53,82.67,114.66,82.67,-174.36,119.57,-138.23,119.57,-102.11,119.57,-65.98,119.57,-29.85,119.57,6.27,119.57,42.4,119.57,78.53,119.57,114.66,119.57,-174.36,156.47,-138.23,156.47,-102.11,156.47,-65.98,156.47,-29.85,156.47,6.27,156.47,42.4,156.47,78.53,156.47,114.66,156.47]},{"type":"surface","name":"B_HAIR_TWIN.14","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-83.44,-176.67,-61.19,-176.67,-38.94,-176.67,-16.69,-176.67,5.56,-176.67,27.81,-176.67,50.06,-176.67,72.31,-176.67,94.56,-176.67,-83.44,-136.78,-61.19,-136.78,-38.94,-136.78,-16.69,-136.78,5.56,-136.78,27.81,-136.78,50.06,-136.78,72.31,-136.78,94.56,-136.78,-83.44,-96.89,-61.19,-96.89,-38.94,-96.89,-16.69,-96.89,5.56,-96.89,27.81,-96.89,50.06,-96.89,72.31,-96.89,94.56,-96.89,-83.44,-57.01,-61.19,-57.01,-38.94,-57.01,-16.69,-57.01,5.56,-57.01,27.81,-57.01,50.06,-57.01,72.31,-57.01,94.56,-57.01,-83.44,-17.12,-61.19,-17.12,-38.94,-17.12,-16.69,-17.12,5.56,-17.12,27.81,-17.12,50.06,-17.12,72.31,-17.12,94.56,-17.12,-83.44,22.77,-61.19,22.77,-38.94,22.77,-16.69,22.77,5.56,22.77,27.81,22.77,50.06,22.77,72.31,22.77,94.56,22.77,-83.44,62.66,-61.19,62.66,-38.94,62.66,-16.69,62.66,5.56,62.66,27.81,62.66,50.06,62.66,72.31,62.66,94.56,62.66,-83.44,102.55,-61.19,102.55,-38.94,102.55,-16.69,102.55,5.56,102.55,27.81,102.55,50.06,102.55,72.31,102.55,94.56,102.55,-83.44,142.44,-61.19,142.44,-38.94,142.44,-16.69,142.44,5.56,142.44,27.81,142.44,50.06,142.44,72.31,142.44,94.56,142.44]},{"type":"surface","name":"B_HAIR_BACK.01","parent":"B_HAIR_BACK.02","segmentX":8,"segmentY":8,"vertices":[-187.83,-189.04,-141.02,-189.04,-94.22,-189.04,-47.41,-189.04,-0.6,-189.04,46.21,-189.04,93.01,-189.04,139.82,-189.04,186.63,-189.04,-187.83,-141.96,-141.02,-141.96,-94.22,-141.96,-47.41,-141.96,-0.6,-141.96,46.21,-141.96,93.01,-141.96,139.82,-141.96,186.63,-141.96,-187.83,-94.87,-141.02,-94.87,-94.22,-94.87,-47.41,-94.87,-0.6,-94.87,46.21,-94.87,93.01,-94.87,139.82,-94.87,186.63,-94.87,-187.83,-47.79,-141.02,-47.79,-94.22,-47.79,-47.41,-47.79,-0.6,-47.79,46.21,-47.79,93.01,-47.79,139.82,-47.79,186.63,-47.79,-187.83,-0.71,-141.02,-0.71,-94.22,-0.71,-47.41,-0.71,-0.6,-0.71,46.21,-0.71,93.01,-0.71,139.82,-0.71,186.63,-0.71,-187.83,46.38,-141.02,46.38,-94.22,46.38,-47.41,46.38,-0.6,46.38,46.21,46.38,93.01,46.38,139.82,46.38,186.63,46.38,-187.83,93.46,-141.02,93.46,-94.22,93.46,-47.41,93.46,-0.6,93.46,46.21,93.46,93.01,93.46,139.82,93.46,186.63,93.46,-187.83,140.55,-141.02,140.55,-94.22,140.55,-47.41,140.55,-0.6,140.55,46.21,140.55,93.01,140.55,139.82,140.55,186.63,140.55,-187.83,187.63,-141.02,187.63,-94.22,187.63,-47.41,187.63,-0.6,187.63,46.21,187.63,93.01,187.63,139.82,187.63,186.63,187.63]},{"length":150,"name":"B_CLOTHES.04","parent":"B_CLOTHES.07","transform":{"x":378.48,"y":-15.7,"skX":105.9,"skY":105.9}},{"type":"surface","name":"B_CLOTHES.06","parent":"B_CLOTHES.07","segmentX":8,"segmentY":8,"vertices":[-174.38,154.24,-170.89,110.84,-167.4,67.44,-163.9,24.05,-160.41,-19.35,-156.92,-62.74,-153.43,-106.14,-149.94,-149.54,-146.45,-192.93,-84.54,161.47,-81.05,118.07,-77.55,74.67,-74.06,31.28,-70.57,-12.12,-67.08,-55.52,-63.59,-98.91,-60.1,-142.31,-56.6,-185.7,5.3,168.69,8.8,125.3,12.29,81.9,15.78,38.51,19.27,-4.89,22.76,-48.29,26.25,-91.68,29.74,-135.08,33.24,-178.48,95.14,175.92,98.64,132.53,102.13,89.13,105.62,45.73,109.11,2.34,112.6,-41.06,116.09,-84.45,119.59,-127.85,123.08,-171.25,184.99,183.15,188.48,139.75,191.97,96.36,195.46,52.96,198.95,9.57,202.44,-33.83,205.94,-77.23,209.43,-120.62,212.92,-164.02,274.83,190.38,278.32,146.98,281.81,103.59,285.3,60.19,288.79,16.79,292.29,-26.6,295.78,-70,299.27,-113.39,302.76,-156.79,364.67,197.61,368.16,154.21,371.65,110.82,375.14,67.42,378.63,24.02,382.13,-19.37,385.62,-62.77,389.11,-106.17,392.6,-149.56,454.51,204.84,458,161.44,461.49,118.04,464.98,74.65,468.48,31.25,471.97,-12.14,475.46,-55.54,478.95,-98.94,482.44,-142.33,544.35,212.06,547.84,168.67,551.33,125.27,554.83,81.88,558.32,38.48,561.81,-4.92,565.3,-48.31,568.79,-91.71,572.28,-135.1]},{"length":150,"name":"B_HAND.08","parent":"B_CLOTHES.04","transform":{"x":301.23,"y":13.91,"skX":-3.1,"skY":-3.1}},{"type":"surface","name":"B_HAND.11","parent":"B_HAND.08","segmentX":8,"segmentY":8,"vertices":[330.78,106.23,279.15,114.49,227.52,122.75,175.89,131.01,124.26,139.27,72.63,147.53,21.01,155.8,-30.62,164.06,-82.25,172.32,324.91,69.57,273.29,77.83,221.66,86.09,170.03,94.35,118.4,102.61,66.77,110.87,15.14,119.14,-36.49,127.4,-88.12,135.66,319.05,32.9,267.42,41.17,215.79,49.43,164.16,57.69,112.53,65.95,60.9,74.21,9.27,82.47,-42.36,90.74,-93.99,99,313.18,-3.76,261.55,4.51,209.92,12.77,158.29,21.03,106.66,29.29,55.04,37.55,3.41,45.81,-48.22,54.08,-99.85,62.34,307.31,-40.42,255.69,-32.16,204.06,-23.89,152.43,-15.63,100.8,-7.37,49.17,0.89,-2.46,9.15,-54.09,17.41,-105.72,25.68,301.45,-77.08,249.82,-68.82,198.19,-60.55,146.56,-52.29,94.93,-44.03,43.3,-35.77,-8.33,-27.51,-59.96,-19.25,-111.59,-10.98,295.58,-113.74,243.95,-105.48,192.32,-97.21,140.69,-88.95,89.07,-80.69,37.44,-72.43,-14.19,-64.17,-65.82,-55.91,-117.45,-47.64,289.72,-150.4,238.09,-142.14,186.46,-133.88,134.83,-125.61,83.2,-117.35,31.57,-109.09,-20.06,-100.83,-71.69,-92.57,-123.32,-84.3,283.85,-187.06,232.22,-178.8,180.59,-170.54,128.96,-162.27,77.33,-154.01,25.7,-145.75,-25.93,-137.49,-77.55,-129.23,-129.18,-120.97]},{"type":"surface","name":"B_CLOTHES.29","parent":"B_CLOTHES.31","segmentX":8,"segmentY":8,"vertices":[-157.12,151.21,-159.37,118.08,-161.63,84.95,-163.89,51.82,-166.15,18.69,-168.41,-14.44,-170.67,-47.57,-172.93,-80.71,-175.18,-113.84,-72.16,145.42,-74.42,112.29,-76.68,79.16,-78.93,46.03,-81.19,12.9,-83.45,-20.24,-85.71,-53.37,-87.97,-86.5,-90.23,-119.63,12.8,139.63,10.54,106.5,8.28,73.37,6.02,40.23,3.76,7.1,1.5,-26.03,-0.75,-59.16,-3.01,-92.29,-5.27,-125.42,97.75,133.84,95.5,100.7,93.24,67.57,90.98,34.44,88.72,1.31,86.46,-31.82,84.2,-64.95,81.94,-98.08,79.68,-131.21,182.71,128.04,180.45,94.91,178.19,61.78,175.93,28.65,173.68,-4.48,171.42,-37.61,169.16,-70.74,166.9,-103.87,164.64,-137,267.67,122.25,265.41,89.12,263.15,55.99,260.89,22.86,258.63,-10.27,256.37,-43.4,254.12,-76.53,251.86,-109.66,249.6,-142.8,352.62,116.46,350.36,83.33,348.11,50.2,345.85,17.07,343.59,-16.06,341.33,-49.19,339.07,-82.33,336.81,-115.46,334.55,-148.59,437.58,110.67,435.32,77.54,433.06,44.41,430.8,11.28,428.55,-21.86,426.29,-54.99,424.03,-88.12,421.77,-121.25,419.51,-154.38,522.54,104.88,520.28,71.75,518.02,38.61,515.76,5.48,513.5,-27.65,511.24,-60.78,508.98,-93.91,506.73,-127.04,504.47,-160.17]},{"type":"surface","name":"B_CLOTHES.25","parent":"B_CLOTHES.32","segmentX":8,"segmentY":8,"vertices":[-205.93,-75.6,-122.82,-96.93,-40.47,-118.1,34.91,-137.78,107.9,-156.96,180.89,-176.14,253.87,-195.31,326.86,-214.49,399.85,-233.67,-192.95,-39.29,-111.05,-59.36,-29.81,-79.28,45.2,-98.61,118.19,-117.79,191.18,-136.96,264.17,-156.14,337.16,-175.32,410.14,-194.49,-180.17,-2.76,-99.4,-21.65,-19.21,-40.42,55.49,-59.44,128.48,-78.61,201.47,-97.79,274.46,-116.97,347.45,-136.14,420.44,-155.32,-169.07,35.82,-88.76,17.29,-8.98,-1.24,65.78,-20.26,138.77,-39.44,211.76,-58.62,284.75,-77.79,357.74,-96.97,430.73,-116.15,-156.92,75.86,-77.44,56.95,1.55,38.02,76.07,18.91,149.06,-0.27,222.05,-19.44,295.04,-38.62,368.03,-57.8,441.02,-76.97,-144.77,115.89,-66.12,96.61,12.08,77.29,86.36,58.08,159.35,38.91,232.34,19.73,305.33,0.55,378.32,-18.62,451.31,-37.8,-133,155.1,-55.21,135.76,22.28,116.51,96.36,97.33,166.81,78.8,237.26,60.28,310.74,40.93,385.39,21.24,460.15,1.71,-117.57,194.13,-42.11,174.86,33.21,155.65,106.33,136.52,173.18,118.17,240.02,99.83,313.3,80.64,388.94,61.36,464.78,42.2,-101.73,233.13,-28.74,213.96,44.25,194.78,116.32,175.69,179.59,157.43,242.85,139.16,315.8,120.19,392.23,101.48,468.94,82.8]},{"type":"surface","name":"B_CLOTHES.27","parent":"B_CLOTHES.33","segmentX":8,"segmentY":8,"vertices":[-113.21,-50.76,-82.71,-62.11,-52.22,-73.45,-21.72,-84.79,8.78,-96.13,39.28,-107.47,69.78,-118.82,100.27,-130.16,130.77,-141.5,-104.02,-26.04,-73.52,-37.38,-43.02,-48.72,-12.52,-60.06,17.98,-71.41,48.47,-82.75,78.97,-94.09,109.47,-105.43,139.97,-116.77,-94.82,-1.31,-64.32,-12.66,-33.83,-24,-3.33,-35.34,27.17,-46.68,57.67,-58.02,88.17,-69.37,118.66,-80.71,149.16,-92.05,-85.63,23.41,-55.13,12.07,-24.63,0.73,5.87,-10.62,36.37,-21.96,66.86,-33.3,97.36,-44.64,127.86,-55.98,158.36,-67.33,-76.43,48.14,-45.93,36.79,-15.44,25.45,15.06,14.11,45.56,2.77,76.06,-8.57,106.56,-19.92,137.05,-31.26,167.55,-42.6,-67.24,72.86,-36.74,61.52,-6.24,50.18,24.26,38.83,54.76,27.49,85.25,16.15,115.75,4.81,146.25,-6.53,176.75,-17.88,-58.04,97.58,-27.54,86.24,2.95,74.9,33.45,63.56,63.95,52.22,94.45,40.87,124.95,29.53,155.44,18.19,185.94,6.85,-48.85,122.31,-18.35,110.97,12.15,99.62,42.65,88.28,73.15,76.94,103.64,65.6,134.14,54.26,164.64,42.91,195.14,31.57,-39.65,147.03,-9.15,135.69,21.34,124.35,51.84,113.01,82.34,101.67,112.84,90.32,143.34,78.98,173.83,67.64,204.33,56.3]},{"type":"surface","name":"B_HOHO.01","parent":"B_FACE.01","segmentX":8,"segmentY":8,"vertices":[-122.66,2.8,-108.58,2.8,-94.5,2.8,-80.42,2.8,-66.35,2.8,-52.27,2.8,-38.19,2.8,-24.11,2.8,-10.03,2.8,-122.66,10.93,-108.58,10.93,-94.5,10.93,-80.42,10.93,-66.35,10.93,-52.27,10.93,-38.19,10.93,-24.11,10.93,-10.03,10.93,-122.66,19.05,-108.58,19.05,-94.5,19.05,-80.42,19.05,-66.35,19.05,-52.27,19.05,-38.19,19.05,-24.11,19.05,-10.03,19.05,-122.66,27.18,-108.58,27.18,-94.5,27.18,-80.42,27.18,-66.35,27.18,-52.27,27.18,-38.19,27.18,-24.11,27.18,-10.03,27.18,-122.66,35.3,-108.58,35.3,-94.5,35.3,-80.42,35.3,-66.35,35.3,-52.27,35.3,-38.19,35.3,-24.11,35.3,-10.03,35.3,-122.66,43.43,-108.58,43.43,-94.5,43.43,-80.42,43.43,-66.35,43.43,-52.27,43.43,-38.19,43.43,-24.11,43.43,-10.03,43.43,-122.66,51.56,-108.58,51.56,-94.5,51.56,-80.42,51.56,-66.35,51.56,-52.27,51.56,-38.19,51.56,-24.11,51.56,-10.03,51.56,-122.66,59.68,-108.58,59.68,-94.5,59.68,-80.42,59.68,-66.35,59.68,-52.27,59.68,-38.19,59.68,-24.11,59.68,-10.03,59.68,-122.66,67.81,-108.58,67.81,-94.5,67.81,-80.42,67.81,-66.35,67.81,-52.27,67.81,-38.19,67.81,-24.11,67.81,-10.03,67.81]},{"type":"surface","name":"B_HOHO.02","parent":"B_FACE.01","segmentX":8,"segmentY":8,"vertices":[18.1,-8.23,30.17,-8.23,42.24,-8.23,54.3,-8.23,66.37,-8.23,78.44,-8.23,90.51,-8.23,102.58,-8.23,114.65,-8.23,18.1,1.51,30.17,1.51,42.24,1.51,54.3,1.51,66.37,1.51,78.44,1.51,90.51,1.51,102.58,1.51,114.65,1.51,18.1,11.24,30.17,11.24,42.24,11.24,54.3,11.24,66.37,11.24,78.44,11.24,90.51,11.24,102.58,11.24,114.65,11.24,18.1,20.98,30.17,20.98,42.24,20.98,54.3,20.98,66.37,20.98,78.44,20.98,90.51,20.98,102.58,20.98,114.65,20.98,18.1,30.71,30.17,30.71,42.24,30.71,54.3,30.71,66.37,30.71,78.44,30.71,90.51,30.71,102.58,30.71,114.65,30.71,18.1,40.44,30.17,40.44,42.24,40.44,54.3,40.44,66.37,40.44,78.44,40.44,90.51,40.44,102.58,40.44,114.65,40.44,18.1,50.18,30.17,50.18,42.24,50.18,54.3,50.18,66.37,50.18,78.44,50.18,90.51,50.18,102.58,50.18,114.65,50.18,18.1,59.91,30.17,59.91,42.24,59.91,54.3,59.91,66.37,59.91,78.44,59.91,90.51,59.91,102.58,59.91,114.65,59.91,18.1,69.64,30.17,69.64,42.24,69.64,54.3,69.64,66.37,69.64,78.44,69.64,90.51,69.64,102.58,69.64,114.65,69.64]},{"type":"surface","name":"B_EYE_BALL.04","parent":"B_EYE_BALL.05","segmentX":8,"segmentY":8,"vertices":[-184.46,-187.34,-138.63,-187.34,-92.81,-187.34,-46.98,-187.34,-1.15,-187.34,44.67,-187.34,90.5,-187.34,136.33,-187.34,182.15,-187.34,-184.46,-140.36,-138.63,-140.36,-92.81,-140.36,-46.98,-140.36,-1.15,-140.36,44.67,-140.36,90.5,-140.36,136.33,-140.36,182.15,-140.36,-184.46,-93.37,-138.63,-93.37,-92.81,-93.37,-46.98,-93.37,-1.15,-93.37,44.67,-93.37,90.5,-93.37,136.33,-93.37,182.15,-93.37,-184.46,-46.39,-138.63,-46.39,-92.81,-46.39,-46.98,-46.39,-1.15,-46.39,44.67,-46.39,90.5,-46.39,136.33,-46.39,182.15,-46.39,-184.46,0.59,-138.63,0.59,-92.81,0.59,-46.98,0.59,-1.15,0.59,44.67,0.59,90.5,0.59,136.33,0.59,182.15,0.59,-184.46,47.58,-138.63,47.58,-92.81,47.58,-46.98,47.58,-1.15,47.58,44.67,47.58,90.5,47.58,136.33,47.58,182.15,47.58,-184.46,94.57,-138.63,94.57,-92.81,94.57,-46.98,94.57,-1.15,94.57,44.67,94.57,90.5,94.57,136.33,94.57,182.15,94.57,-184.46,141.55,-138.63,141.55,-92.81,141.55,-46.98,141.55,-1.15,141.55,44.67,141.55,90.5,141.55,136.33,141.55,182.15,141.55,-184.46,188.53,-138.63,188.53,-92.81,188.53,-46.98,188.53,-1.15,188.53,44.67,188.53,90.5,188.53,136.33,188.53,182.15,188.53]},{"type":"surface","name":"B_EYE_BALL.06","parent":"B_EYE_BALL.10","segmentX":8,"segmentY":8,"vertices":[-179.86,-180.79,-135.01,-180.79,-90.16,-180.79,-45.31,-180.79,-0.46,-180.79,44.39,-180.79,89.25,-180.79,134.1,-180.79,178.95,-180.79,-179.86,-134.65,-135.01,-134.65,-90.16,-134.65,-45.31,-134.65,-0.46,-134.65,44.39,-134.65,89.25,-134.65,134.1,-134.65,178.95,-134.65,-179.86,-88.52,-135.01,-88.52,-90.16,-88.52,-45.31,-88.52,-0.46,-88.52,44.39,-88.52,89.25,-88.52,134.1,-88.52,178.95,-88.52,-179.86,-42.38,-135.01,-42.38,-90.16,-42.38,-45.31,-42.38,-0.46,-42.38,44.39,-42.38,89.25,-42.38,134.1,-42.38,178.95,-42.38,-179.86,3.76,-135.01,3.76,-90.16,3.76,-45.31,3.76,-0.46,3.76,44.39,3.76,89.25,3.76,134.1,3.76,178.95,3.76,-179.86,49.89,-135.01,49.89,-90.16,49.89,-45.31,49.89,-0.46,49.89,44.39,49.89,89.25,49.89,134.1,49.89,178.95,49.89,-179.86,96.03,-135.01,96.03,-90.16,96.03,-45.31,96.03,-0.46,96.03,44.39,96.03,89.25,96.03,134.1,96.03,178.95,96.03,-179.86,142.17,-135.01,142.17,-90.16,142.17,-45.31,142.17,-0.46,142.17,44.39,142.17,89.25,142.17,134.1,142.17,178.95,142.17,-179.86,188.3,-135.01,188.3,-90.16,188.3,-45.31,188.3,-0.46,188.3,44.39,188.3,89.25,188.3,134.1,188.3,178.95,188.3]},{"type":"surface","name":"B_BROW.01","parent":"B_BROW.03","segmentX":8,"segmentY":8,"vertices":[-147.21,-84.12,-111.03,-84.12,-74.85,-84.12,-38.67,-84.12,-2.5,-84.12,33.68,-84.12,69.86,-84.12,106.04,-84.12,142.21,-84.12,-147.21,-62.46,-111.03,-62.46,-74.85,-62.46,-38.67,-62.46,-2.5,-62.46,33.68,-62.46,69.86,-62.46,106.04,-62.46,142.21,-62.46,-147.21,-40.8,-111.03,-40.8,-74.85,-40.8,-38.67,-40.8,-2.5,-40.8,33.68,-40.8,69.86,-40.8,106.04,-40.8,142.21,-40.8,-147.21,-19.14,-111.03,-19.14,-74.85,-19.14,-38.67,-19.14,-2.5,-19.14,33.68,-19.14,69.86,-19.14,106.04,-19.14,142.21,-19.14,-147.21,2.53,-111.03,2.53,-74.85,2.53,-38.67,2.53,-2.5,2.53,33.68,2.53,69.86,2.53,106.04,2.53,142.21,2.53,-147.21,24.19,-111.03,24.19,-74.85,24.19,-38.67,24.19,-2.5,24.19,33.68,24.19,69.86,24.19,106.04,24.19,142.21,24.19,-147.21,45.85,-111.03,45.85,-74.85,45.85,-38.67,45.85,-2.5,45.85,33.68,45.85,69.86,45.85,106.04,45.85,142.21,45.85,-147.21,67.51,-111.03,67.51,-74.85,67.51,-38.67,67.51,-2.5,67.51,33.68,67.51,69.86,67.51,106.04,67.51,142.21,67.51,-147.21,89.17,-111.03,89.17,-74.85,89.17,-38.67,89.17,-2.5,89.17,33.68,89.17,69.86,89.17,106.04,89.17,142.21,89.17]},{"type":"surface","name":"B_BROW.02","parent":"B_BROW.04","segmentX":8,"segmentY":8,"vertices":[-150.24,-90.12,-112.25,-90.11,-74.27,-90.1,-36.29,-90.1,1.68,-90.1,39.66,-90.09,77.64,-90.07,115.62,-90.04,153.59,-90.02,-150.24,-69.26,-112.26,-69.26,-74.28,-69.26,-36.3,-69.26,1.68,-69.28,39.66,-69.29,77.64,-69.29,115.62,-69.28,153.6,-69.26,-150.25,-48.45,-112.26,-48.44,-74.28,-48.45,-36.3,-48.47,1.68,-48.5,39.66,-48.51,77.64,-48.51,115.63,-48.51,153.61,-48.48,-150.25,-27.68,-112.26,-27.66,-74.28,-27.68,-36.3,-27.71,1.68,-27.76,39.66,-27.76,77.65,-27.76,115.63,-27.74,153.61,-27.69,-150.25,-6.93,-112.26,-6.92,-74.28,-6.93,-36.3,-6.98,1.68,-7.05,39.66,-7.04,77.64,-7.02,115.63,-6.99,153.62,-6.93,-150.25,13.83,-112.27,13.84,-74.28,13.83,-36.3,13.79,1.68,13.74,39.66,13.73,77.64,13.73,115.62,13.73,153.61,13.78,-150.25,34.55,-112.26,34.56,-74.28,34.55,-36.3,34.52,1.68,34.49,39.66,34.49,77.64,34.48,115.62,34.48,153.61,34.52,-150.24,55.2,-112.26,55.22,-74.27,55.22,-36.3,55.21,1.68,55.2,39.66,55.21,77.64,55.21,115.62,55.23,153.6,55.27,-150.22,75.75,-112.24,75.78,-74.26,75.81,-36.29,75.84,1.68,75.87,39.66,75.88,77.64,75.91,115.61,75.94,153.59,75.98]},{"type":"surface","name":"B_CLOTHES.03","parent":"B_CLOTHES.04","segmentX":8,"segmentY":8,"vertices":[608.76,150.34,524.79,167.12,440.82,183.9,356.85,200.67,272.89,217.45,188.92,234.23,104.95,251.01,20.98,267.79,-62.98,284.57,598.31,98.05,514.34,114.83,430.37,131.61,346.4,148.38,262.44,165.16,178.47,181.94,94.5,198.72,10.53,215.5,-73.43,232.28,587.86,45.76,503.89,62.54,419.92,79.32,335.96,96.09,251.99,112.87,168.02,129.65,84.05,146.43,0.09,163.21,-83.88,179.99,577.41,-6.53,493.44,10.25,409.47,27.03,325.51,43.8,241.54,60.58,157.57,77.36,73.6,94.14,-10.36,110.92,-94.33,127.7,566.96,-58.82,482.99,-42.04,399.03,-25.26,315.06,-8.49,231.09,8.29,147.12,25.07,63.16,41.85,-20.81,58.63,-104.78,75.41,556.51,-111.11,472.55,-94.33,388.58,-77.55,304.61,-60.78,220.64,-44,136.67,-27.22,52.71,-10.44,-31.26,6.34,-115.23,23.12,546.06,-163.4,462.1,-146.62,378.13,-129.84,294.16,-113.07,210.19,-96.29,126.23,-79.51,42.26,-62.73,-41.71,-45.95,-125.68,-29.17,535.62,-215.69,451.65,-198.91,367.68,-182.13,283.71,-165.36,199.75,-148.58,115.78,-131.8,31.81,-115.02,-52.16,-98.24,-136.13,-81.46,525.17,-267.98,441.2,-251.2,357.23,-234.43,273.26,-217.65,189.3,-200.87,105.33,-184.09,21.36,-167.31,-62.61,-150.53,-146.57,-133.75]},{"type":"surface","name":"B_CLOTHES.05","parent":"B_CLOTHES.06","segmentX":8,"segmentY":8,"vertices":[-148.34,-178.52,-110.17,-178.52,-71.99,-178.52,-34.21,-178.28,-0.23,-175.75,33.75,-173.21,72.53,-173.58,114.64,-175.95,157.07,-178.52,-148.34,-133.52,-110.17,-133.52,-71.99,-133.52,-33.96,-133.4,1.9,-132.03,37.75,-130.67,76.21,-130.85,116.54,-132.08,157.07,-133.52,-148.34,-88.53,-110.17,-88.53,-71.99,-88.53,-33.75,-88.5,3.86,-88.23,41.47,-87.95,79.64,-87.95,118.32,-88.14,157.07,-88.53,-148.34,-43.53,-110.17,-43.53,-71.99,-43.53,-33.81,-43.53,4.36,-43.53,42.54,-43.53,80.72,-43.53,118.89,-43.53,157.07,-43.53,-148.34,1.46,-110.17,1.46,-71.99,1.46,-33.81,1.46,4.36,1.46,42.54,1.46,80.72,1.46,118.89,1.46,157.07,1.46,-148.34,46.46,-110.17,46.46,-71.99,46.46,-33.81,46.46,4.36,46.46,42.54,46.46,80.72,46.46,118.89,46.46,157.07,46.46,-148.34,91.45,-110.17,91.45,-71.99,91.45,-33.81,91.45,4.36,91.45,42.54,91.45,80.72,91.45,118.89,91.45,157.07,91.45,-148.34,136.45,-110.17,136.45,-71.99,136.45,-33.81,136.45,4.36,136.45,42.54,136.45,80.72,136.45,118.89,136.45,157.07,136.45,-148.34,181.44,-110.17,181.44,-71.99,181.44,-33.81,181.44,4.36,181.44,42.54,181.44,80.72,181.44,118.89,181.44,157.07,181.44]},{"type":"surface","name":"B_CLOTHES.08","parent":"B_HAND.08","segmentX":8,"segmentY":8,"vertices":[219.88,107.15,187.5,111.81,155.13,116.48,122.76,121.14,90.39,125.81,58.02,130.47,25.65,135.14,-6.72,139.8,-39.09,144.47,215.47,76.58,183.1,81.25,150.73,85.91,118.36,90.58,85.99,95.24,53.61,99.91,21.24,104.57,-11.13,109.24,-43.5,113.9,211.07,46.02,178.7,50.68,146.32,55.35,113.95,60.01,81.58,64.68,49.21,69.34,16.84,74.01,-15.53,78.67,-47.9,83.34,206.66,15.45,174.29,20.12,141.92,24.78,109.55,29.45,77.18,34.11,44.81,38.78,12.43,43.44,-19.94,48.1,-52.31,52.77,202.26,-15.11,169.89,-10.45,137.51,-5.79,105.14,-1.12,72.77,3.54,40.4,8.21,8.03,12.87,-24.34,17.54,-56.71,22.2,197.85,-45.68,165.48,-41.02,133.11,-36.35,100.74,-31.69,68.37,-27.02,36,-22.36,3.62,-17.69,-28.75,-13.03,-61.12,-8.36,193.45,-76.25,161.08,-71.58,128.71,-66.92,96.33,-62.25,63.96,-57.59,31.59,-52.92,-0.78,-48.26,-33.15,-43.59,-65.52,-38.93,189.04,-106.81,156.67,-102.15,124.3,-97.48,91.93,-92.82,59.56,-88.15,27.19,-83.49,-5.18,-78.82,-37.56,-74.16,-69.93,-69.5,184.64,-137.38,152.27,-132.72,119.9,-128.05,87.52,-123.39,55.15,-118.72,22.78,-114.06,-9.59,-109.39,-41.96,-104.73,-74.33,-100.06]},{"type":"surface","name":"B_HAND.01","parent":"B_HAND.11","segmentX":8,"segmentY":8,"vertices":[-178.78,-156.52,-134.27,-155.54,-89.77,-154.56,-45.27,-153.59,-0.77,-152.61,43.73,-151.64,88.24,-150.66,132.74,-149.69,177.24,-148.71,-179.22,-116.23,-134.72,-115.26,-90.22,-114.28,-45.71,-113.31,-1.21,-112.33,43.29,-111.36,87.79,-110.38,132.29,-109.41,176.79,-108.43,-179.67,-75.95,-135.16,-74.98,-90.66,-74,-46.16,-73.03,-1.66,-72.05,42.84,-71.08,87.35,-70.1,131.85,-69.13,176.35,-68.15,-180.11,-35.67,-135.61,-34.7,-91.11,-33.72,-46.61,-32.75,-2.1,-31.77,42.4,-30.8,86.9,-29.82,131.4,-28.85,175.9,-27.87,-180.56,4.61,-136.05,5.58,-91.55,6.56,-47.05,7.53,-2.55,8.51,41.95,9.48,86.46,10.46,130.96,11.43,175.46,12.41,-181,44.89,-136.5,45.87,-92,46.84,-47.5,47.82,-2.99,48.79,41.51,49.77,86.01,50.74,130.51,51.72,175.01,52.69,-181.45,85.17,-136.94,86.15,-92.44,87.12,-47.94,88.1,-3.44,89.07,41.06,90.05,85.57,91.02,130.07,92,174.57,92.97,-181.89,125.45,-137.39,126.43,-92.89,127.4,-48.39,128.38,-3.88,129.35,40.62,130.33,85.12,131.3,129.62,132.28,174.12,133.25,-182.34,165.73,-137.83,166.71,-93.33,167.69,-48.83,168.66,-4.33,169.64,40.17,170.61,84.68,171.59,129.18,172.56,173.68,173.54]},{"type":"surface","name":"B_HAND.02","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-124.77,-117.48,-106.66,-117.48,-88.55,-117.48,-70.44,-117.48,-52.32,-117.48,-34.21,-117.48,-16.1,-117.48,2.01,-117.48,20.12,-117.48,-124.77,-101.04,-106.66,-101.04,-88.55,-101.04,-70.44,-101.04,-52.32,-101.04,-34.21,-101.04,-16.1,-101.04,2.01,-101.04,20.12,-101.04,-124.77,-84.59,-106.66,-84.59,-88.55,-84.59,-70.44,-84.59,-52.32,-84.59,-34.21,-84.59,-16.1,-84.59,2.01,-84.59,20.12,-84.59,-124.77,-68.14,-106.66,-68.14,-88.55,-68.14,-70.44,-68.14,-52.32,-68.14,-34.21,-68.14,-16.1,-68.14,2.01,-68.14,20.12,-68.14,-124.77,-51.69,-106.66,-51.69,-88.55,-51.69,-70.44,-51.69,-52.32,-51.69,-34.21,-51.69,-16.1,-51.69,2.01,-51.69,20.12,-51.69,-124.77,-35.24,-106.66,-35.24,-88.55,-35.24,-70.44,-35.24,-52.32,-35.24,-34.21,-35.24,-16.1,-35.24,2.01,-35.24,20.12,-35.24,-124.77,-18.79,-106.66,-18.79,-88.55,-18.79,-70.44,-18.79,-52.32,-18.79,-34.21,-18.79,-16.1,-18.79,2.01,-18.79,20.12,-18.79,-124.77,-2.34,-106.66,-2.34,-88.55,-2.34,-70.44,-2.34,-52.32,-2.34,-34.21,-2.34,-16.1,-2.34,2.01,-2.34,20.12,-2.34,-124.77,14.11,-106.66,14.11,-88.55,14.11,-70.44,14.11,-52.32,14.11,-34.21,14.11,-16.1,14.11,2.01,14.11,20.12,14.11]},{"type":"surface","name":"B_HAND.03","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-133.8,-118.29,-115.55,-118.29,-97.3,-118.29,-79.05,-118.29,-60.8,-118.29,-42.55,-118.29,-24.3,-118.29,-6.05,-118.29,12.2,-118.29,-133.8,-97.82,-115.55,-97.82,-97.3,-97.82,-79.05,-97.82,-60.8,-97.82,-42.55,-97.82,-24.3,-97.82,-6.05,-97.82,12.2,-97.82,-133.8,-77.35,-115.55,-77.35,-97.3,-77.35,-79.05,-77.35,-60.8,-77.35,-42.55,-77.35,-24.3,-77.35,-6.05,-77.35,12.2,-77.35,-133.8,-56.87,-115.55,-56.87,-97.3,-56.87,-79.05,-56.87,-60.8,-56.87,-42.55,-56.87,-24.3,-56.87,-6.05,-56.87,12.2,-56.87,-133.8,-36.4,-115.55,-36.4,-97.3,-36.4,-79.05,-36.4,-60.8,-36.4,-42.55,-36.4,-24.3,-36.4,-6.05,-36.4,12.2,-36.4,-133.8,-15.93,-115.55,-15.93,-97.3,-15.93,-79.05,-15.93,-60.8,-15.93,-42.55,-15.93,-24.3,-15.93,-6.05,-15.93,12.2,-15.93,-133.8,4.54,-115.55,4.54,-97.3,4.54,-79.05,4.54,-60.8,4.54,-42.55,4.54,-24.3,4.54,-6.05,4.54,12.2,4.54,-133.8,25.01,-115.55,25.01,-97.3,25.01,-79.05,25.01,-60.8,25.01,-42.55,25.01,-24.3,25.01,-6.05,25.01,12.2,25.01,-133.8,45.49,-115.55,45.49,-97.3,45.49,-79.05,45.49,-60.8,45.49,-42.55,45.49,-24.3,45.49,-6.05,45.49,12.2,45.49]},{"type":"surface","name":"B_HAND.04","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-133.48,-101.77,-112.79,-101.77,-92.1,-101.77,-71.42,-101.77,-50.73,-101.77,-30.05,-101.77,-9.36,-101.77,11.32,-101.77,32.01,-101.77,-133.48,-81.87,-112.79,-81.87,-92.1,-81.87,-71.42,-81.87,-50.73,-81.87,-30.05,-81.87,-9.36,-81.87,11.32,-81.87,32.01,-81.87,-133.48,-61.96,-112.79,-61.96,-92.1,-61.96,-71.42,-61.96,-50.73,-61.96,-30.05,-61.96,-9.36,-61.96,11.32,-61.96,32.01,-61.96,-133.48,-42.05,-112.79,-42.05,-92.1,-42.05,-71.42,-42.05,-50.73,-42.05,-30.05,-42.05,-9.36,-42.05,11.32,-42.05,32.01,-42.05,-133.48,-22.14,-112.79,-22.14,-92.1,-22.14,-71.42,-22.14,-50.73,-22.14,-30.05,-22.14,-9.36,-22.14,11.32,-22.14,32.01,-22.14,-133.48,-2.24,-112.79,-2.24,-92.1,-2.24,-71.42,-2.24,-50.73,-2.24,-30.05,-2.24,-9.36,-2.24,11.32,-2.24,32.01,-2.24,-133.48,17.67,-112.79,17.67,-92.1,17.67,-71.42,17.67,-50.73,17.67,-30.05,17.67,-9.36,17.67,11.32,17.67,32.01,17.67,-133.48,37.58,-112.79,37.58,-92.1,37.58,-71.42,37.58,-50.73,37.58,-30.05,37.58,-9.36,37.58,11.32,37.58,32.01,37.58,-133.48,57.48,-112.79,57.48,-92.1,57.48,-71.42,57.48,-50.73,57.48,-30.05,57.48,-9.36,57.48,11.32,57.48,32.01,57.48]},{"type":"surface","name":"B_HAND.05","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-121.2,-64.73,-100.75,-64.73,-80.31,-64.73,-59.87,-64.73,-39.43,-64.73,-18.98,-64.73,1.46,-64.73,21.9,-64.73,42.35,-64.73,-121.2,-47.73,-100.75,-47.73,-80.31,-47.73,-59.87,-47.73,-39.43,-47.73,-18.98,-47.73,1.46,-47.73,21.9,-47.73,42.35,-47.73,-121.2,-30.74,-100.75,-30.74,-80.31,-30.74,-59.87,-30.74,-39.43,-30.74,-18.98,-30.74,1.46,-30.74,21.9,-30.74,42.35,-30.74,-121.2,-13.74,-100.75,-13.74,-80.31,-13.74,-59.87,-13.74,-39.43,-13.74,-18.98,-13.74,1.46,-13.74,21.9,-13.74,42.35,-13.74,-121.2,3.25,-100.75,3.25,-80.31,3.25,-59.87,3.25,-39.43,3.25,-18.98,3.25,1.46,3.25,21.9,3.25,42.35,3.25,-121.2,20.25,-100.75,20.25,-80.31,20.25,-59.87,20.25,-39.43,20.25,-18.98,20.25,1.46,20.25,21.9,20.25,42.35,20.25,-121.2,37.24,-100.75,37.24,-80.31,37.24,-59.87,37.24,-39.43,37.24,-18.98,37.24,1.46,37.24,21.9,37.24,42.35,37.24,-121.2,54.24,-100.75,54.24,-80.31,54.24,-59.87,54.24,-39.43,54.24,-18.98,54.24,1.46,54.24,21.9,54.24,42.35,54.24,-121.2,71.23,-100.75,71.23,-80.31,71.23,-59.87,71.23,-39.43,71.23,-18.98,71.23,1.46,71.23,21.9,71.23,42.35,71.23]},{"type":"surface","name":"B_HAND.06","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-84.24,-22.62,-66.23,-22.62,-48.22,-22.62,-30.21,-22.62,-12.21,-22.62,5.8,-22.62,23.81,-22.62,41.82,-22.62,59.83,-22.62,-84.24,-9.22,-66.23,-9.22,-48.22,-9.22,-30.21,-9.22,-12.21,-9.22,5.8,-9.22,23.81,-9.22,41.82,-9.22,59.83,-9.22,-84.24,4.18,-66.23,4.18,-48.22,4.18,-30.21,4.18,-12.21,4.18,5.8,4.18,23.81,4.18,41.82,4.18,59.83,4.18,-84.24,17.57,-66.23,17.57,-48.22,17.57,-30.21,17.57,-12.21,17.57,5.8,17.57,23.81,17.57,41.82,17.57,59.83,17.57,-84.24,30.97,-66.23,30.97,-48.22,30.97,-30.21,30.97,-12.21,30.97,5.8,30.97,23.81,30.97,41.82,30.97,59.83,30.97,-84.24,44.37,-66.23,44.37,-48.22,44.37,-30.21,44.37,-12.21,44.37,5.8,44.37,23.81,44.37,41.82,44.37,59.83,44.37,-84.24,57.77,-66.23,57.77,-48.22,57.77,-30.21,57.77,-12.21,57.77,5.8,57.77,23.81,57.77,41.82,57.77,59.83,57.77,-84.24,71.17,-66.23,71.17,-48.22,71.17,-30.21,71.17,-12.21,71.17,5.8,71.17,23.81,71.17,41.82,71.17,59.83,71.17,-84.24,84.57,-66.23,84.57,-48.22,84.57,-30.21,84.57,-12.21,84.57,5.8,84.57,23.81,84.57,41.82,84.57,59.83,84.57]},{"type":"surface","name":"B_HAND.07","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-66.27,-155.93,-39.15,-155.93,-12.04,-155.93,15.08,-155.93,42.19,-155.93,69.31,-155.93,96.42,-155.93,123.54,-155.93,150.65,-155.93,-66.27,-126.29,-39.15,-126.29,-12.04,-126.29,15.08,-126.29,42.19,-126.29,69.31,-126.29,96.42,-126.29,123.54,-126.29,150.65,-126.29,-66.27,-96.65,-39.15,-96.65,-12.04,-96.65,15.08,-96.65,42.19,-96.65,69.31,-96.65,96.42,-96.65,123.54,-96.65,150.65,-96.65,-66.27,-67,-39.15,-67,-12.04,-67,15.08,-67,42.19,-67,69.31,-67,96.42,-67,123.54,-67,150.65,-67,-66.27,-37.36,-39.15,-37.36,-12.04,-37.36,15.08,-37.36,42.19,-37.36,69.31,-37.36,96.42,-37.36,123.54,-37.36,150.65,-37.36,-66.27,-7.72,-39.15,-7.72,-12.04,-7.72,15.08,-7.72,42.19,-7.72,69.31,-7.72,96.42,-7.72,123.54,-7.72,150.65,-7.72,-66.27,21.92,-39.15,21.92,-12.04,21.92,15.08,21.92,42.19,21.92,69.31,21.92,96.42,21.92,123.54,21.92,150.65,21.92,-66.27,51.56,-39.15,51.56,-12.04,51.56,15.08,51.56,42.19,51.56,69.31,51.56,96.42,51.56,123.54,51.56,150.65,51.56,-66.27,81.2,-39.15,81.2,-12.04,81.2,15.08,81.2,42.19,81.2,69.31,81.2,96.42,81.2,123.54,81.2,150.65,81.2]},{"type":"surface","name":"B_CLOTHES.30","parent":"B_CLOTHES.29","segmentX":8,"segmentY":8,"vertices":[-176.5,-187.2,-131.95,-187.2,-87.39,-187.2,-42.83,-187.21,1.72,-187.21,46.28,-187.21,90.84,-187.21,135.39,-187.21,179.95,-187.22,-176.49,-140.4,-131.93,-140.4,-87.38,-140.4,-42.82,-140.4,1.74,-140.41,46.29,-140.41,90.85,-140.41,135.41,-140.41,179.97,-140.41,-176.47,-93.6,-131.92,-93.6,-87.36,-93.6,-42.8,-93.6,1.75,-93.61,46.31,-93.61,90.87,-93.61,135.42,-93.61,179.98,-93.61,-176.46,-46.8,-131.9,-46.8,-87.35,-46.8,-42.79,-46.8,1.77,-46.8,46.32,-46.81,90.88,-46.81,135.44,-46.81,179.99,-46.81,-176.45,0.01,-131.89,0,-87.33,0,-42.78,0,1.78,0,46.34,0,90.89,-0.01,135.45,-0.01,180.01,-0.01,-176.43,46.81,-131.88,46.8,-87.32,46.8,-42.76,46.8,1.79,46.8,46.35,46.8,90.91,46.79,135.47,46.79,180.02,46.79,-176.42,93.61,-131.86,93.61,-87.3,93.6,-42.75,93.6,1.81,93.6,46.37,93.6,90.92,93.6,135.48,93.59,180.04,93.59,-176.4,140.41,-131.85,140.41,-87.29,140.41,-42.73,140.4,1.82,140.4,46.38,140.4,90.94,140.4,135.49,140.4,180.05,140.39,-176.39,187.21,-131.83,187.21,-87.28,187.21,-42.72,187.2,1.84,187.2,46.39,187.2,90.95,187.2,135.51,187.2,180.07,187.2]},{"type":"surface","name":"B_CLOTHES.26","parent":"B_CLOTHES.25","segmentX":8,"segmentY":8,"vertices":[-184.95,-174.11,-139.36,-174.11,-93.77,-174.11,-48.19,-174.11,-2.6,-174.1,42.98,-174.1,88.57,-174.1,134.16,-174.1,179.74,-174.1,-184.95,-130.6,-139.36,-130.59,-93.77,-130.59,-48.19,-130.59,-2.6,-130.59,42.98,-130.59,88.57,-130.59,134.16,-130.59,179.74,-130.59,-184.95,-87.08,-139.36,-87.08,-93.77,-87.08,-48.19,-87.08,-2.6,-87.08,42.98,-87.08,88.57,-87.08,134.16,-87.08,179.74,-87.08,-184.95,-43.57,-139.36,-43.57,-93.77,-43.57,-48.19,-43.57,-2.6,-43.57,42.98,-43.57,88.57,-43.57,134.16,-43.57,179.74,-43.57,-184.95,-0.06,-139.36,-0.06,-93.77,-0.06,-48.19,-0.06,-2.6,-0.06,42.98,-0.06,88.57,-0.06,134.16,-0.06,179.74,-0.06,-184.95,43.45,-139.36,43.45,-93.77,43.45,-48.19,43.45,-2.6,43.45,42.98,43.45,88.57,43.46,134.16,43.46,179.74,43.46,-184.95,86.96,-139.36,86.96,-93.77,86.96,-48.19,86.97,-2.6,86.97,42.98,86.97,88.57,86.97,134.16,86.97,179.74,86.97,-184.95,130.47,-139.36,130.48,-93.77,130.48,-48.19,130.48,-2.6,130.48,42.98,130.48,88.57,130.48,134.16,130.48,179.74,130.48,-184.95,173.99,-139.36,173.99,-93.77,173.99,-48.19,173.99,-2.6,173.99,42.98,173.99,88.57,173.99,134.16,173.99,179.74,173.99]},{"type":"surface","name":"B_CLOTHES.28","parent":"B_CLOTHES.27","segmentX":8,"segmentY":8,"vertices":[-182.37,-170.22,-137.16,-170.22,-91.95,-170.22,-46.73,-170.22,-1.52,-170.22,43.69,-170.22,88.9,-170.22,134.11,-170.22,179.32,-170.22,-182.37,-126.09,-137.16,-126.09,-91.95,-126.09,-46.73,-126.09,-1.52,-126.09,43.69,-126.09,88.9,-126.09,134.11,-126.09,179.32,-126.09,-182.37,-81.97,-137.16,-81.97,-91.95,-81.97,-46.73,-81.97,-1.52,-81.97,43.69,-81.97,88.9,-81.97,134.11,-81.97,179.32,-81.97,-182.37,-37.85,-137.16,-37.85,-91.95,-37.85,-46.73,-37.85,-1.52,-37.85,43.69,-37.85,88.9,-37.85,134.11,-37.85,179.32,-37.85,-182.37,6.28,-137.16,6.28,-91.95,6.28,-46.73,6.28,-1.52,6.28,43.69,6.28,88.9,6.28,134.11,6.28,179.32,6.28,-182.37,50.4,-137.16,50.4,-91.95,50.4,-46.73,50.4,-1.52,50.4,43.69,50.4,88.9,50.4,134.11,50.4,179.32,50.4,-182.37,94.52,-137.16,94.52,-91.95,94.52,-46.73,94.52,-1.52,94.52,43.69,94.52,88.9,94.52,134.11,94.52,179.32,94.52,-182.37,138.65,-137.16,138.65,-91.95,138.65,-46.73,138.65,-1.52,138.65,43.69,138.65,88.9,138.65,134.11,138.65,179.32,138.65,-182.37,182.77,-137.16,182.77,-91.95,182.77,-46.73,182.77,-1.52,182.77,43.69,182.77,88.9,182.77,134.11,182.77,179.32,182.77]},{"type":"surface","name":"B_EYE_BALL.03","parent":"B_EYE_BALL.04","segmentX":8,"segmentY":8,"vertices":[-171.52,-176.12,-128.59,-176.12,-85.65,-176.12,-42.72,-176.12,0.21,-176.12,43.15,-176.12,86.08,-176.12,129.02,-176.12,171.95,-176.12,-171.52,-131.86,-128.59,-131.86,-85.65,-131.86,-42.72,-131.86,0.21,-131.86,43.15,-131.86,86.08,-131.86,129.02,-131.86,171.95,-131.86,-171.52,-87.6,-128.59,-87.6,-85.65,-87.6,-42.72,-87.6,0.21,-87.6,43.15,-87.6,86.08,-87.6,129.02,-87.6,171.95,-87.6,-171.52,-43.34,-128.59,-43.34,-85.65,-43.34,-42.72,-43.34,0.21,-43.34,43.15,-43.34,86.08,-43.34,129.02,-43.34,171.95,-43.34,-171.52,0.92,-128.59,0.92,-85.65,0.92,-42.72,0.92,0.21,0.92,43.15,0.92,86.08,0.92,129.02,0.92,171.95,0.92,-171.52,45.18,-128.59,45.18,-85.65,45.18,-42.72,45.18,0.21,45.18,43.15,45.18,86.08,45.18,129.02,45.18,171.95,45.18,-171.52,89.43,-128.59,89.43,-85.65,89.43,-42.72,89.43,0.21,89.43,43.15,89.43,86.08,89.43,129.02,89.43,171.95,89.43,-171.52,133.69,-128.59,133.69,-85.65,133.69,-42.72,133.69,0.21,133.69,43.15,133.69,86.08,133.69,129.02,133.69,171.95,133.69,-171.52,177.95,-128.59,177.95,-85.65,177.95,-42.72,177.95,0.21,177.95,43.15,177.95,86.08,177.95,129.02,177.95,171.95,177.95]},{"type":"surface","name":"B_EYE_BALL.09","parent":"B_EYE_BALL.06","segmentX":8,"segmentY":8,"vertices":[-169.79,-174.28,-128.28,-174.28,-86.77,-174.28,-45.27,-174.28,-3.76,-174.28,37.75,-174.28,79.26,-174.28,120.76,-174.28,162.27,-174.28,-169.79,-131.19,-128.28,-131.19,-86.77,-131.19,-45.27,-131.19,-3.76,-131.19,37.75,-131.19,79.26,-131.19,120.76,-131.19,162.27,-131.19,-169.79,-88.09,-128.28,-88.09,-86.77,-88.09,-45.27,-88.09,-3.76,-88.09,37.75,-88.09,79.26,-88.09,120.76,-88.09,162.27,-88.09,-169.79,-45,-128.28,-45,-86.77,-45,-45.27,-45,-3.76,-45,37.75,-45,79.26,-45,120.76,-45,162.27,-45,-169.79,-1.9,-128.28,-1.9,-86.77,-1.9,-45.27,-1.9,-3.76,-1.9,37.75,-1.9,79.26,-1.9,120.76,-1.9,162.27,-1.9,-169.79,41.19,-128.28,41.19,-86.77,41.19,-45.27,41.19,-3.76,41.19,37.75,41.19,79.26,41.19,120.76,41.19,162.27,41.19,-169.79,84.29,-128.28,84.29,-86.77,84.29,-45.27,84.29,-3.76,84.29,37.75,84.29,79.26,84.29,120.76,84.29,162.27,84.29,-169.79,127.38,-128.28,127.38,-86.77,127.38,-45.27,127.38,-3.76,127.38,37.75,127.38,79.26,127.38,120.76,127.38,162.27,127.38,-169.79,170.48,-128.28,170.48,-86.77,170.48,-45.27,170.48,-3.76,170.48,37.75,170.48,79.26,170.48,120.76,170.48,162.27,170.48]},{"type":"surface","name":"B_CLOTHES.01","parent":"B_CLOTHES.03","segmentX":8,"segmentY":8,"vertices":[-166.78,-158.7,-122.8,-158.7,-78.83,-158.7,-34.85,-158.7,9.13,-158.7,53.11,-158.7,97.09,-158.7,141.06,-158.7,185.04,-158.7,-166.78,-117.26,-122.8,-117.26,-78.83,-117.26,-34.85,-117.26,9.13,-117.26,53.11,-117.26,97.09,-117.26,141.06,-117.26,185.04,-117.26,-166.78,-75.81,-122.8,-75.81,-78.83,-75.81,-34.85,-75.81,9.13,-75.81,53.11,-75.81,97.09,-75.81,141.06,-75.81,185.04,-75.81,-166.78,-34.36,-122.8,-34.36,-78.83,-34.36,-34.85,-34.36,9.13,-34.36,53.11,-34.36,97.09,-34.36,141.06,-34.36,185.04,-34.36,-166.78,7.09,-122.8,7.09,-78.83,7.09,-34.85,7.09,9.13,7.09,53.11,7.09,97.09,7.09,141.06,7.09,185.04,7.09,-166.78,48.53,-122.8,48.53,-78.83,48.53,-34.85,48.53,9.13,48.53,53.11,48.53,97.09,48.53,141.06,48.53,185.04,48.53,-166.78,89.98,-122.8,89.98,-78.83,89.98,-34.85,89.98,9.13,89.98,53.11,89.98,97.09,89.98,141.06,89.98,185.04,89.98,-166.78,131.43,-122.8,131.43,-78.83,131.43,-34.85,131.43,9.13,131.43,53.11,131.43,97.09,131.43,141.06,131.43,185.04,131.43,-166.78,172.88,-122.8,172.88,-78.83,172.88,-34.85,172.88,9.13,172.88,53.11,172.88,97.09,172.88,141.06,172.88,185.04,172.88]},{"type":"surface","name":"B_CLOTHES.02","parent":"B_CLOTHES.08","segmentX":8,"segmentY":8,"vertices":[-159.62,-164.08,-120.3,-164.08,-80.98,-164.08,-41.66,-164.08,-2.34,-164.08,36.98,-164.08,76.3,-164.08,115.62,-164.08,154.94,-164.08,-159.62,-122.43,-120.3,-122.43,-80.98,-122.43,-41.66,-122.43,-2.34,-122.43,36.98,-122.43,76.3,-122.43,115.62,-122.43,154.94,-122.43,-159.62,-80.78,-120.3,-80.78,-80.98,-80.78,-41.66,-80.78,-2.34,-80.78,36.98,-80.78,76.3,-80.78,115.62,-80.78,154.94,-80.78,-159.62,-39.12,-120.3,-39.12,-80.98,-39.12,-41.66,-39.12,-2.34,-39.12,36.98,-39.12,76.3,-39.12,115.62,-39.12,154.94,-39.12,-159.62,2.53,-120.3,2.53,-80.98,2.53,-41.66,2.53,-2.34,2.53,36.98,2.53,76.3,2.53,115.62,2.53,154.94,2.53,-159.62,44.18,-120.3,44.18,-80.98,44.18,-41.66,44.18,-2.34,44.18,36.98,44.18,76.3,44.18,115.62,44.18,154.94,44.18,-159.62,85.84,-120.3,85.84,-80.98,85.84,-41.66,85.84,-2.34,85.84,36.98,85.84,76.3,85.84,115.62,85.84,154.94,85.84,-159.62,127.49,-120.3,127.49,-80.98,127.49,-41.66,127.49,-2.34,127.49,36.98,127.49,76.3,127.49,115.62,127.49,154.94,127.49,-159.62,169.14,-120.3,169.14,-80.98,169.14,-41.66,169.14,-2.34,169.14,36.98,169.14,76.3,169.14,115.62,169.14,154.94,169.14]},{"type":"surface","name":"B_CLOTHES.36","parent":"B_CLOTHES.01","segmentX":8,"segmentY":8,"vertices":[-183.83,-177.55,-137.55,-179.07,-90.34,-179.85,-42.51,-180.14,5.64,-180.18,53.7,-180.22,100.93,-180.54,146.51,-181.41,189.6,-183.1,-183.83,-133.77,-137.55,-135.11,-90.34,-135.8,-42.51,-136.06,5.64,-136.09,53.7,-136.14,100.93,-136.42,146.51,-137.19,189.6,-138.68,-183.83,-89.99,-137.55,-91.16,-90.34,-91.76,-42.51,-91.98,5.64,-92.01,53.7,-92.05,100.93,-92.29,146.51,-92.96,189.6,-94.26,-183.83,-46.21,-137.55,-47.2,-90.34,-47.71,-42.51,-47.9,5.64,-47.93,53.7,-47.96,100.93,-48.17,146.51,-48.74,189.6,-49.84,-183.83,-2.43,-137.55,-3.25,-90.34,-3.67,-42.51,-3.82,5.64,-3.85,53.7,-3.87,100.93,-4.04,146.51,-4.51,189.6,-5.42,-183.83,41.35,-137.55,40.71,-90.34,40.38,-42.51,40.26,5.64,40.24,53.7,40.22,100.93,40.08,146.51,39.71,189.6,39,-183.83,85.13,-137.55,84.66,-90.34,84.42,-42.51,84.33,5.64,84.32,53.7,84.31,100.93,84.21,146.51,83.94,189.6,83.42,-183.83,128.91,-137.55,128.62,-90.34,128.47,-42.51,128.41,5.64,128.4,53.7,128.4,100.93,128.33,146.51,128.17,189.6,127.84,-183.83,172.69,-137.55,172.58,-90.34,172.51,-42.51,172.49,5.64,172.49,53.7,172.48,100.93,172.46,146.51,172.39,189.6,172.26]},{"type":"surface","name":"B_CLOTHES.37","parent":"B_CLOTHES.01","segmentX":8,"segmentY":8,"vertices":[71.1,-54.17,85.1,-53.82,99.09,-53.47,113.09,-53.12,127.08,-52.77,141.08,-52.41,155.07,-52.06,169.06,-51.71,183.06,-51.36,70.9,-30.11,84.89,-29.76,98.89,-29.41,112.88,-29.06,126.87,-28.71,140.87,-28.35,154.86,-28,168.86,-27.65,182.85,-27.3,70.69,-6.05,84.68,-5.7,98.68,-5.35,112.67,-5,126.67,-4.64,140.66,-4.29,154.65,-3.94,168.65,-3.59,182.64,-3.24,70.48,18.01,84.47,18.36,98.47,18.71,112.46,19.07,126.46,19.42,140.45,19.77,154.45,20.12,168.44,20.47,182.44,20.82,70.27,42.07,84.27,42.42,98.26,42.77,112.26,43.13,126.25,43.48,140.24,43.83,154.24,44.18,168.23,44.53,182.23,44.88,70.06,66.13,84.06,66.48,98.05,66.84,112.05,67.19,126.04,67.54,140.04,67.89,154.03,68.24,168.02,68.59,182.02,68.94,69.86,90.19,83.85,90.55,97.85,90.9,111.84,91.25,125.83,91.6,139.83,91.95,153.82,92.3,167.82,92.65,181.81,93,69.65,114.26,83.64,114.61,97.64,114.96,111.63,115.31,125.63,115.66,139.62,116.01,153.61,116.36,167.61,116.71,181.6,117.06,69.44,138.32,83.44,138.67,97.43,139.02,111.42,139.37,125.42,139.72,139.41,140.07,153.41,140.42,167.4,140.77,181.4,141.13]},{"type":"surface","name":"B_EYE_BALL.01","parent":"B_EYE_BALL.03","segmentX":8,"segmentY":8,"vertices":[-140.45,43.65,-126.91,43.65,-113.37,43.65,-99.82,43.65,-86.28,43.65,-72.74,43.65,-59.2,43.65,-45.66,43.65,-32.12,43.65,-140.45,53.8,-126.91,53.8,-113.37,53.8,-99.82,53.8,-86.28,53.8,-72.74,53.8,-59.2,53.8,-45.66,53.8,-32.12,53.8,-140.45,63.95,-126.91,63.95,-113.37,63.95,-99.82,63.95,-86.28,63.95,-72.74,63.95,-59.2,63.95,-45.66,63.95,-32.12,63.95,-140.45,74.11,-126.91,74.11,-113.37,74.11,-99.82,74.11,-86.28,74.11,-72.74,74.11,-59.2,74.11,-45.66,74.11,-32.12,74.11,-140.45,84.26,-126.91,84.26,-113.37,84.26,-99.82,84.26,-86.28,84.26,-72.74,84.26,-59.2,84.26,-45.66,84.26,-32.12,84.26,-140.45,94.41,-126.91,94.41,-113.37,94.41,-99.82,94.41,-86.28,94.41,-72.74,94.41,-59.2,94.41,-45.66,94.41,-32.12,94.41,-140.45,104.57,-126.91,104.57,-113.37,104.57,-99.82,104.57,-86.28,104.57,-72.74,104.57,-59.2,104.57,-45.66,104.57,-32.12,104.57,-140.45,114.72,-126.91,114.72,-113.37,114.72,-99.82,114.72,-86.28,114.72,-72.74,114.72,-59.2,114.72,-45.66,114.72,-32.12,114.72,-140.45,124.87,-126.91,124.87,-113.37,124.87,-99.82,124.87,-86.28,124.87,-72.74,124.87,-59.2,124.87,-45.66,124.87,-32.12,124.87]},{"type":"surface","name":"B_EYE_BALL.02","parent":"B_EYE_BALL.03","segmentX":8,"segmentY":8,"vertices":[-75.51,-104.42,-55.85,-104.42,-36.19,-104.42,-16.53,-104.42,3.12,-104.42,22.78,-104.42,42.44,-104.42,62.09,-104.42,81.75,-104.42,-75.51,-91.79,-55.85,-91.79,-36.19,-91.79,-16.53,-91.79,3.12,-91.79,22.78,-91.79,42.44,-91.79,62.09,-91.79,81.75,-91.79,-75.51,-79.17,-55.85,-79.17,-36.19,-79.17,-16.53,-79.17,3.12,-79.17,22.78,-79.17,42.44,-79.17,62.09,-79.17,81.75,-79.17,-75.51,-66.54,-55.85,-66.54,-36.19,-66.54,-16.53,-66.54,3.12,-66.54,22.78,-66.54,42.44,-66.54,62.09,-66.54,81.75,-66.54,-75.51,-53.91,-55.85,-53.91,-36.19,-53.91,-16.53,-53.91,3.12,-53.91,22.78,-53.91,42.44,-53.91,62.09,-53.91,81.75,-53.91,-75.51,-41.28,-55.85,-41.28,-36.19,-41.28,-16.53,-41.28,3.12,-41.28,22.78,-41.28,42.44,-41.28,62.09,-41.28,81.75,-41.28,-75.51,-28.65,-55.85,-28.65,-36.19,-28.65,-16.53,-28.65,3.12,-28.65,22.78,-28.65,42.44,-28.65,62.09,-28.65,81.75,-28.65,-75.51,-16.02,-55.85,-16.02,-36.19,-16.02,-16.53,-16.02,3.12,-16.02,22.78,-16.02,42.44,-16.02,62.09,-16.02,81.75,-16.02,-75.51,-3.39,-55.85,-3.39,-36.19,-3.39,-16.53,-3.39,3.12,-3.39,22.78,-3.39,42.44,-3.39,62.09,-3.39,81.75,-3.39]},{"type":"surface","name":"B_EYE_BALL.07","parent":"B_EYE_BALL.09","segmentX":8,"segmentY":8,"vertices":[-165.25,31.53,-150.87,31.53,-136.49,31.53,-122.1,31.53,-107.72,31.53,-93.34,31.53,-78.96,31.53,-64.58,31.53,-50.2,31.53,-165.25,42.11,-150.87,42.11,-136.49,42.11,-122.1,42.11,-107.72,42.11,-93.34,42.11,-78.96,42.11,-64.58,42.11,-50.2,42.11,-165.25,52.68,-150.87,52.68,-136.49,52.68,-122.1,52.68,-107.72,52.68,-93.34,52.68,-78.96,52.68,-64.58,52.68,-50.2,52.68,-165.25,63.26,-150.87,63.26,-136.49,63.26,-122.1,63.26,-107.72,63.26,-93.34,63.26,-78.96,63.26,-64.58,63.26,-50.2,63.26,-165.25,73.83,-150.87,73.83,-136.49,73.83,-122.1,73.83,-107.72,73.83,-93.34,73.83,-78.96,73.83,-64.58,73.83,-50.2,73.83,-165.25,84.41,-150.87,84.41,-136.49,84.41,-122.1,84.41,-107.72,84.41,-93.34,84.41,-78.96,84.41,-64.58,84.41,-50.2,84.41,-165.25,94.98,-150.87,94.98,-136.49,94.98,-122.1,94.98,-107.72,94.98,-93.34,94.98,-78.96,94.98,-64.58,94.98,-50.2,94.98,-165.25,105.56,-150.87,105.56,-136.49,105.56,-122.1,105.56,-107.72,105.56,-93.34,105.56,-78.96,105.56,-64.58,105.56,-50.2,105.56,-165.25,116.13,-150.87,116.13,-136.49,116.13,-122.1,116.13,-107.72,116.13,-93.34,116.13,-78.96,116.13,-64.58,116.13,-50.2,116.13]},{"type":"surface","name":"B_EYE_BALL.08","parent":"B_EYE_BALL.09","segmentX":8,"segmentY":8,"vertices":[-69.82,-116.3,-50.3,-116.3,-30.78,-116.3,-11.26,-116.3,8.26,-116.3,27.78,-116.3,47.3,-116.3,66.82,-116.3,86.34,-116.3,-69.82,-100.86,-50.3,-100.86,-30.78,-100.86,-11.26,-100.86,8.26,-100.86,27.78,-100.86,47.3,-100.86,66.82,-100.86,86.34,-100.86,-69.82,-85.41,-50.3,-85.41,-30.78,-85.41,-11.26,-85.41,8.26,-85.41,27.78,-85.41,47.3,-85.41,66.82,-85.41,86.34,-85.41,-69.82,-69.96,-50.3,-69.96,-30.78,-69.96,-11.26,-69.96,8.26,-69.96,27.78,-69.96,47.3,-69.96,66.82,-69.96,86.34,-69.96,-69.82,-54.51,-50.3,-54.51,-30.78,-54.51,-11.26,-54.51,8.26,-54.51,27.78,-54.51,47.3,-54.51,66.82,-54.51,86.34,-54.51,-69.82,-39.07,-50.3,-39.07,-30.78,-39.07,-11.26,-39.07,8.26,-39.07,27.78,-39.07,47.3,-39.07,66.82,-39.07,86.34,-39.07,-69.82,-23.62,-50.3,-23.62,-30.78,-23.62,-11.26,-23.62,8.26,-23.62,27.78,-23.62,47.3,-23.62,66.82,-23.62,86.34,-23.62,-69.82,-8.17,-50.3,-8.17,-30.78,-8.17,-11.26,-8.17,8.26,-8.17,27.78,-8.17,47.3,-8.17,66.82,-8.17,86.34,-8.17,-69.82,7.27,-50.3,7.27,-30.78,7.27,-11.26,7.27,8.26,7.27,27.78,7.27,47.3,7.27,66.82,7.27,86.34,7.27]}],"slot":[{"zIndex":100,"name":"D_BACKGROUND.01","parent":"DST_BASE"},{"zIndex":190,"name":"D_CLOTHES.04","parent":"B_CLOTHES.20"},{"zIndex":200,"name":"D_HAIR_TWIN.02","parent":"B_HAIR_TWIN.20"},{"zIndex":200,"name":"D_HAIR_TWIN.00","parent":"B_HAIR_TWIN.12"},{"zIndex":200,"name":"D_HAIR_BACK.00","parent":"B_HAIR_BACK.01"},{"zIndex":210,"name":"D_HAIR_TWIN.11","parent":"B_HAIR_TWIN.21"},{"zIndex":220,"name":"D_HAIR_TWIN.05","parent":"B_HAIR_TWIN.14"},{"zIndex":250,"name":"D_BODY.00","parent":"B_BODY.01"},{"zIndex":300,"name":"D_HAIR_TWIN.06","parent":"B_HAIR_TWIN.09"},{"zIndex":310,"name":"D_HAIR_TWIN.13","parent":"B_HAIR_TWIN.19"},{"zIndex":360,"name":"D_NECK.00","parent":"B_NECK.01"},{"zIndex":365,"name":"D_NECK.01","parent":"B_NECK.03"},{"zIndex":380,"name":"D_CLOTHES.00","parent":"B_CLOTHES.16"},{"zIndex":390,"name":"D_CLOTHES.01","parent":"B_CLOTHES.35"},{"zIndex":390,"name":"D_BACKGROUND.02","parent":"B_BACKGROUND.01"},{"zIndex":399,"name":"D_BACKGROUND.03","parent":"B_BACKGROUND.01"},{"zIndex":400,"name":"D_EAR.00","parent":"B_EAR.01"},{"zIndex":400,"name":"D_EAR.01","parent":"B_EAR.02"},{"zIndex":400,"name":"D_HAIR_TWIN.12","parent":"B_HAIR_TWIN.17"},{"zIndex":400,"name":"D_CLOTHES.13","parent":"B_CLOTHES.05"},{"zIndex":400,"name":"D_CLOTHES.10","parent":"B_CLOTHES.30"},{"zIndex":400,"name":"D_CLOTHES.18","parent":"B_CLOTHES.40"},{"zIndex":400,"name":"D_CLOTHES.16","parent":"B_CLOTHES.38"},{"zIndex":400,"name":"D_CLOTHES.07","parent":"B_CLOTHES.11"},{"zIndex":400,"name":"D_CLOTHES.08","parent":"B_CLOTHES.12"},{"zIndex":400,"name":"D_CLOTHES.02","parent":"B_CLOTHES.17"},{"zIndex":400,"name":"D_CLOTHES.03","parent":"B_CLOTHES.15"},{"zIndex":450,"name":"D_CLOTHES.05","parent":"B_CLOTHES.22"},{"zIndex":450,"name":"D_CLOTHES.06","parent":"B_CLOTHES.24"},{"zIndex":480,"name":"D_HAIR_TWIN.14","parent":"B_HAIR_TWIN.18"},{"zIndex":480,"name":"D_HAIR_TWIN.15","parent":"B_HAIR_TWIN.16"},{"zIndex":500,"name":"D_REF.HAIR","parent":"B_FACE.02"},{"zIndex":500,"name":"D_REF.BODY","parent":"DST_BASE"},{"zIndex":500,"name":"D_REF.ARM_R","parent":"DST_BASE"},{"zIndex":500,"name":"D_REF.ARM_L","parent":"DST_BASE"},{"zIndex":500,"name":"D_REF.HEAD","parent":"B_FACE.02"},{"zIndex":500,"name":"D_FACE.00","parent":"B_FACE.01"},{"zIndex":500,"name":"D_EYE.02","parent":"B_EYE.01"},{"zIndex":500,"alpha":0.9,"name":"D_EYE.03","parent":"B_EYE.03"},{"zIndex":500,"name":"D_EYE.12","parent":"B_EYE.01"},{"zIndex":500,"name":"D_EYE_BALL.00","parent":"B_EYE_BALL.03"},{"zIndex":500,"name":"D_EYE_BALL.01","parent":"B_EYE_BALL.09"},{"zIndex":500,"name":"D_EYE_BALL.03","parent":"B_EYE_BALL.08"},{"zIndex":500,"name":"D_EYE_BALL.05","parent":"B_EYE_BALL.07"},{"zIndex":500,"name":"D_MOUTH.00","parent":"B_MOUTH.05"},{"zIndex":500,"alpha":0.8,"name":"D_NOSE.00","parent":"B_NOSE.01"},{"zIndex":500,"name":"D_NOSE.01","parent":"B_NOSE.01"},{"zIndex":500,"name":"D_HAIR_TWIN.30","parent":"B_CLOTHES.37"},{"zIndex":500,"name":"D_HAIR_TWIN.29","parent":"B_CLOTHES.26"},{"zIndex":500,"name":"D_CLOTHES.09","parent":"B_CLOTHES.09"},{"zIndex":500,"name":"D_BACKGROUND.04","parent":"DST_BASE"},{"zIndex":500,"name":"D_BACKGROUND.05","parent":"DST_BASE"},{"zIndex":500,"name":"D_BACKGROUND.06","parent":"B_BACKGROUND.01"},{"zIndex":500,"name":"D_BACKGROUND.07","parent":"B_BACKGROUND.01"},{"zIndex":505,"name":"D_MOUTH.03","parent":"B_MOUTH.04"},{"zIndex":510,"name":"D_REF.FACE","parent":"B_FACE.02"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.07","parent":"B_EYE_BALL.03"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.08","parent":"B_EYE_BALL.02"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.10","parent":"B_EYE_BALL.01"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.12","parent":"B_EYE_BALL.09"},{"zIndex":510,"name":"D_EYE_BALL.02","parent":"B_EYE_BALL.02"},{"zIndex":510,"name":"D_EYE_BALL.04","parent":"B_EYE_BALL.01"},{"zIndex":510,"name":"D_MOUTH.01","parent":"B_MOUTH.01"},{"zIndex":510,"name":"D_MOUTH.02","parent":"B_MOUTH.04"},{"zIndex":510,"name":"D_HAIR_TWIN.04","parent":"B_HAIR_TWIN.11"},{"zIndex":510,"name":"D_HAIR_TWIN.07","parent":"B_HAIR_TWIN.13"},{"zIndex":511,"alpha":0,"name":"D_EYE_BALL.09","parent":"B_EYE_BALL.08"},{"zIndex":511,"alpha":0,"name":"D_EYE_BALL.11","parent":"B_EYE_BALL.07"},{"zIndex":520,"name":"D_REF.MOUTH","parent":"B_FACE.02"},{"zIndex":520,"name":"D_HAIR_TWIN.03","parent":"B_HAIR_TWIN.07"},{"zIndex":520,"name":"D_HAIR_TWIN.08","parent":"B_HAIR_TWIN.10"},{"zIndex":520,"name":"D_HAND.01","parent":"B_HAND.16"},{"zIndex":530,"name":"D_EYE.06","parent":"B_EYE.01"},{"zIndex":530,"name":"D_EYE.11","parent":"B_EYE.03"},{"zIndex":530,"name":"D_EYE.13","parent":"B_EYE.03"},{"zIndex":530,"name":"D_HAIR_TWIN.09","parent":"B_HAIR_TWIN.02"},{"zIndex":530,"name":"D_HAIR_TWIN.10","parent":"B_HAIR_TWIN.09"},{"zIndex":530,"name":"D_HAND.00","parent":"B_HAND.10"},{"zIndex":540,"alpha":0.96,"name":"D_FACESHADOW.00","parent":"B_FACESHADOW.02"},{"zIndex":540,"alpha":0,"name":"D_FACESHADOW.01","parent":"B_FACESHADOW.02"},{"zIndex":540,"name":"D_EYE.00","parent":"B_EYE.01"},{"zIndex":540,"name":"D_EYE.01","parent":"B_EYE.03"},{"zIndex":540,"name":"D_EYE.04","parent":"B_EYE.01"},{"zIndex":540,"name":"D_EYE.05","parent":"B_EYE.03"},{"zIndex":540,"name":"D_EYE.09","parent":"B_EYE.03"},{"zIndex":540,"name":"D_HAIR_SIDE.00","parent":"B_HAIR_SIDE.05"},{"zIndex":540,"name":"D_HAIR_SIDE.01","parent":"B_HAIR_SIDE.06"},{"zIndex":540,"name":"D_HAND.02","parent":"B_HAND.15"},{"zIndex":542,"name":"D_HAND.03","parent":"B_HAND.14"},{"zIndex":544,"name":"D_HAND.04","parent":"B_HAND.13"},{"zIndex":546,"name":"D_HAND.05","parent":"B_HAND.12"},{"zIndex":550,"name":"D_EYE.07","parent":"B_EYE.01"},{"zIndex":550,"name":"D_EYE.08","parent":"B_EYE.01"},{"zIndex":550,"name":"D_EYE.10","parent":"B_EYE.03"},{"zIndex":550,"name":"D_HAND.07","parent":"B_HAND.02"},{"zIndex":590,"name":"D_HAND.06","parent":"B_HAND.07"},{"zIndex":590,"name":"D_CLOTHES.11","parent":"B_CLOTHES.26"},{"zIndex":595,"name":"D_CLOTHES.12","parent":"B_CLOTHES.28"},{"zIndex":600,"name":"D_EYE.14","parent":"B_EYE.01"},{"zIndex":600,"name":"D_EYE.15","parent":"B_EYE.01"},{"zIndex":600,"name":"D_EYE.16","parent":"B_EYE.01"},{"zIndex":600,"name":"D_EYE.17","parent":"B_EYE.03"},{"zIndex":600,"name":"D_EYE.18","parent":"B_EYE.03"},{"zIndex":600,"name":"D_EYE.19","parent":"B_EYE.03"},{"zIndex":600,"name":"D_HAIR_FRONT.00","parent":"B_HAIR_FRONT.01"},{"zIndex":600,"name":"D_HAIR_TWIN.01","parent":"B_HAIR_TWIN.08"},{"zIndex":600,"name":"D_HAND.08","parent":"B_HAND.03"},{"zIndex":600,"name":"D_HAND.09","parent":"B_HAND.04"},{"zIndex":600,"name":"D_HAND.10","parent":"B_HAND.05"},{"zIndex":600,"name":"D_HAND.11","parent":"B_HAND.06"},{"zIndex":600,"name":"D_BACKGROUND.08","parent":"B_BACKGROUND.01"},{"zIndex":610,"alpha":0.6,"name":"D_HOHO.00","parent":"B_HOHO.01"},{"zIndex":610,"alpha":0.6,"name":"D_HOHO.01","parent":"B_HOHO.02"},{"zIndex":610,"name":"D_CLOTHES.14","parent":"B_CLOTHES.36"},{"zIndex":620,"name":"D_HAND.12","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.13","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.14","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.15","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.16","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.17","parent":"B_HAND.17"},{"zIndex":640,"name":"D_CLOTHES.15","parent":"B_CLOTHES.02"},{"zIndex":640,"name":"D_CLOTHES.17","parent":"B_CLOTHES.39"},{"zIndex":645,"name":"D_HAND.18","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.19","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.20","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.21","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.22","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.23","parent":"B_HAND.18"},{"zIndex":650,"name":"D_CLOTHES.19","parent":"B_CLOTHES.41"},{"zIndex":700,"name":"D_BROW.00","parent":"B_BROW.01"},{"zIndex":700,"name":"D_BROW.01","parent":"B_BROW.02"}],"skin":[{"slot":[{"name":"D_REF.HAIR","display":[{"type":"mesh","name":"D_REF.HAIR","path":"shizuku_00","vertices":[523.16,-338.04,531.58,341.16,-107.18,341.16,-97.47,-333.18],"uvs":[0.000188,0.000156,0.000906,0.000188,0.000906,0.000906,0.00025,0.000875],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.BODY","display":[{"type":"mesh","name":"D_REF.BODY","path":"shizuku_00","vertices":[-186.37,-671,149.73,-666.01,151.73,-190.57,-190.16,-196.56],"uvs":[0.000156,0.000125,0.001031,0.000188,0.001031,0.001031,0.000125,0.000906],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.ARM_R","display":[{"type":"mesh","name":"D_REF.ARM_R","path":"shizuku_00","vertices":[-335.19,-662.53,-195.92,-661.13,-178.71,-152.49,-335.13,-152.32],"uvs":[0.000125,0.000094,0.000906,0.000156,0.000937,0.000937,0.000094,0.000906],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.ARM_L","display":[{"type":"mesh","name":"D_REF.ARM_L","path":"shizuku_00","vertices":[159.85,-620.09,293.03,-624.81,293.03,-159.79,158.75,-159.79],"uvs":[0.000156,0.000156,0.001187,0.000156,0.001187,0.000906,0.000094,0.000906],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.FACE","display":[{"type":"mesh","name":"D_REF.FACE","path":"shizuku_00","vertices":[293.69,-202.02,292.75,187.64,-4.11,186.7,8.75,-202.02],"uvs":[0.000125,0.000094,0.000906,0.000125,0.000875,0.000813,0.000125,0.000781],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.MOUTH","display":[{"type":"mesh","name":"D_REF.MOUTH","path":"shizuku_00","vertices":[107.87,-137.43,111.03,126.11,-6.13,126.11,-6.13,-132.01],"uvs":[0.000125,0.000094,0.001,0.000125,0.001,0.000875,0.000188,0.000875],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.HEAD","display":[{"type":"mesh","name":"D_REF.HEAD","path":"shizuku_00","vertices":[563.01,-290.81,563.01,279.73,-34.85,271.33,-34.85,-295.54],"uvs":[0.000625,0.000625,0.001406,0.000625,0.001438,0.001438,0.000719,0.001438],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_FACESHADOW.00","display":[{"type":"mesh","name":"D_FACESHADOW.00","path":"shizuku_00","vertices":[-44.95,-140.8,38.84,-142.52,113.32,-104.52,152.88,-21.61,158.41,98,138.63,121.75,101.1,70.37,15.56,32.8,-66.77,49.64,-125.25,92.82,-141.54,147.66,-164.81,83.75,-163.65,-26.79,-110.12,-107.98,-129.61,16.39,-93.83,-45.79,-32.15,-42.34,39.42,-55.29,94.7,-16.43,122.63,52.66],"uvs":[0.165365,0.658854,0.259115,0.657552,0.342448,0.686198,0.386719,0.748698,0.384115,0.84375,0.361979,0.864583,0.322917,0.81901,0.236979,0.791667,0.138021,0.795573,0.083333,0.835938,0.057292,0.876302,0.03125,0.828125,0.032552,0.744792,0.092448,0.683594,0.071615,0.78125,0.110677,0.730469,0.186198,0.72526,0.261719,0.713542,0.321615,0.752604,0.356771,0.800781],"triangles":[19,3,18,19,18,6,2,17,18,18,17,7,17,16,7,17,0,16,16,15,8,16,13,15,15,14,8,15,12,14,14,11,9,16,0,13,15,13,12,14,12,11,11,10,9,14,9,8,16,8,7,18,7,6,19,6,5,19,5,4,19,4,3,18,3,2,17,2,1,17,1,0],"userEdges":[]}]},{"name":"D_FACESHADOW.01","display":[{"type":"mesh","name":"D_FACESHADOW.01","path":"shizuku_00","vertices":[-112.17,-137.34,-3.75,-177.32,101.64,-154.69,133.2,-23.69,18.25,-19.29,-140.95,-18.73,-5.89,-112.99,-135.52,-84.32,-89.06,-65.05,124.57,-100.51,91.09,-65.97,-69.01,-127.45,60.77,-138.84,-89.03,-21.26,-77.57,-97.13,-74.16,-151.36,90.94,-28.75,73.09,-105.43,58.84,-163.88,5.88,-67.32,139.39,-65.49,-148.19,-55.54,-39.83,-44.06,57.73,-44.59],"uvs":[0.864583,0.526693,0.926432,0.50651,0.985026,0.521484,0.989583,0.595052,0.938802,0.60026,0.873047,0.598307,0.924479,0.55599,0.868495,0.559789,0.897198,0.578436,0.987118,0.555248,0.964571,0.580045,0.888904,0.538589,0.962012,0.5346,0.899816,0.599102,0.893521,0.55809,0.886269,0.519616,0.966485,0.597421,0.962401,0.555541,0.961233,0.515404,0.93146,0.577566,0.98847,0.577076,0.870617,0.577751,0.916284,0.588448,0.952769,0.589304],"triangles":[23,10,19,22,19,8,22,4,19,23,19,4,23,16,10,23,4,16,22,8,13,22,13,4,17,9,12,18,1,12,18,12,2,17,12,6,15,11,1,14,11,7,14,6,11,15,0,11,20,9,10,17,10,9,16,3,10,20,10,3,17,6,10,19,10,6,12,9,2,14,7,8,21,8,7,21,5,8,13,8,5,19,6,8,14,8,6,11,0,7,11,6,1,12,1,6],"userEdges":[]}]},{"name":"D_HOHO.00","display":[{"type":"mesh","name":"D_HOHO.00","path":"shizuku_00","vertices":[-103.31,-96.89,-31.3,-132.75,61.19,-108.1,103.61,-39.73,104.22,73.54,5.85,140.71,-94.98,122.78,-119.99,-10.59,-47.8,1.74,39.78,-2.74],"uvs":[0.484375,0.023438,0.515299,0.013021,0.555013,0.020182,0.574544,0.040039,0.574544,0.073242,0.53125,0.092448,0.487956,0.08724,0.477214,0.048503,0.516276,0.052083,0.546875,0.050781],"triangles":[9,8,5,9,1,8,8,0,7,8,7,6,8,6,5,9,5,4,9,4,3,9,3,2,9,2,1,8,1,0],"userEdges":[]}]},{"name":"D_HOHO.01","display":[{"type":"mesh","name":"D_HOHO.01","path":"shizuku_00","vertices":[-99.15,-99.63,-12.62,-133.3,86.71,-124.27,155.61,-64.12,151.14,40.89,100.13,132.64,-11.72,148.93,-94.94,111.23,-121.79,3.17,-26.04,35.79,58.07,13.36],"uvs":[0.608073,0.017904,0.638672,0.006836,0.674805,0.008464,0.69987,0.027669,0.698242,0.061198,0.679688,0.090495,0.639648,0.100586,0.608724,0.083659,0.598958,0.049154,0.633789,0.05957,0.664388,0.052409],"triangles":[1,9,10,10,9,6,9,0,8,9,8,7,9,7,6,10,6,5,10,5,4,10,4,3,10,3,2,10,2,1,9,1,0],"userEdges":[]}]},{"name":"D_FACE.00","display":[{"type":"mesh","name":"D_FACE.00","path":"shizuku_00","vertices":[-40.57,-131.63,38.06,-133.33,95.94,-106.92,119.27,-63.47,114.09,3.83,93.35,71.57,66.14,108.2,38.06,123.96,6.95,133.33,-36.25,120.55,-97.81,58.15,-115.73,0.43,-116.6,-71.99,-88.09,-116.29,2.63,97.55,44.1,81.36,65.7,41.32,106.18,29.67,77.8,-4.69,-38.84,81.36,-65.62,48.99,-82.9,8.95,-83.77,-42.17,82.12,-44.73,0.9,52.4,-28.47,8.95,25.96,7.24,-1.69,-43.88,44.97,-37.06,-48.34,-38.76,-63.89,-81.36,0.04,-89.88,58.79,-84.77,-69.84,71.91,-60.16,91.53,-15.35,108.19,-17.78,126.02,-37.76,104.23,-47.98,98.2,-25,114.54,-17.27,118.18,-5.08,120.4,40.43,105.49,20.84,90.44,23.08,112.47,5.74,118.58,15.84,121.09,21.71,128.89,-12.96,91.46,-86.33,75.11,-72.53,84.97,-107.07,27.17,-90.43,37.15,-81.71,53.52,-84.72,64.4,67.67,76.96,82.07,87.76,53.73,94.11,86.43,36.01,100.48,45.64,79.79,55.72,82.88,74.02,67.46,90.45,90.14,52.37,51.45,115.71,-101.99,41.77,-93.12,47.87,-89.52,55.54,-81.1,74.48,-68.67,94.06,-57.3,100.61,-45.4,106.64,-63.17,96.92,-51.45,104.23,-37.09,111.48,53.71,106.89,39.27,114.55,29.54,117.43,45.74,110.42,59.67,100.85,75.73,83,87.79,65.06,-73.55,90.11],"uvs":[0.135417,0.238281,0.253906,0.235677,0.341146,0.276042,0.376302,0.342448,0.36849,0.445313,0.338542,0.549479,0.295573,0.602865,0.253906,0.628906,0.207031,0.643229,0.141927,0.623698,0.052083,0.527344,0.022135,0.440104,0.020833,0.329427,0.063802,0.261719,0.200521,0.588542,0.263021,0.563802,0.295573,0.502604,0.356578,0.486745,0.313802,0.432292,0.138021,0.563802,0.097656,0.514323,0.071615,0.453125,0.070313,0.375,0.320313,0.371094,0.197917,0.519531,0.153646,0.453125,0.235677,0.450521,0.19401,0.372396,0.264323,0.382813,0.123698,0.380208,0.10026,0.315104,0.196615,0.302083,0.285156,0.309896,0.090644,0.550661,0.106547,0.57804,0.173426,0.604799,0.169761,0.632048,0.1403,0.598753,0.124248,0.588236,0.158873,0.61353,0.171504,0.619091,0.18889,0.622483,0.258131,0.598729,0.22796,0.57768,0.229386,0.610366,0.204231,0.619707,0.220427,0.623537,0.229278,0.636432,0.177022,0.57924,0.069032,0.560536,0.086916,0.569976,0.036166,0.480977,0.060272,0.496227,0.073408,0.521251,0.070521,0.538493,0.298538,0.557066,0.318616,0.574235,0.278176,0.581989,0.326808,0.494484,0.349933,0.509859,0.314855,0.523639,0.32048,0.552905,0.297245,0.577046,0.332075,0.51917,0.274096,0.616288,0.043826,0.503291,0.056218,0.511633,0.062617,0.524334,0.077588,0.556626,0.092958,0.584188,0.110198,0.592566,0.128193,0.602431,0.101325,0.587724,0.11866,0.598149,0.141023,0.609837,0.277475,0.600866,0.25606,0.613524,0.239964,0.618364,0.265827,0.607194,0.286501,0.591978,0.309765,0.566666,0.32882,0.538873,0.085223,0.578752],"triangles":[77,76,44,78,76,64,78,42,76,77,7,76,78,64,75,79,57,75,78,75,42,79,75,6,74,71,9,73,71,38,74,37,71,73,38,70,72,70,34,82,69,50,72,34,69,67,53,66,67,66,10,66,52,65,66,65,10,76,7,64,75,64,6,81,63,60,81,5,63,80,62,56,79,62,57,80,55,62,79,6,62,80,56,61,81,60,61,80,61,55,81,61,5,61,60,55,63,58,60,63,59,58,63,5,59,59,17,58,60,58,16,62,55,57,75,57,42,62,6,56,61,56,5,60,16,55,57,55,15,68,54,49,67,54,53,68,33,54,67,10,54,54,33,53,66,53,52,53,20,52,65,52,51,52,21,51,69,34,50,68,49,50,82,50,49,68,50,33,54,10,49,77,46,7,47,7,46,47,46,8,77,44,46,46,44,45,46,45,8,76,42,44,45,44,14,44,42,43,44,43,14,57,15,42,43,42,15,45,14,41,45,41,8,41,40,36,41,35,40,40,39,36,74,39,37,40,35,39,74,9,39,70,38,34,71,37,38,39,35,37,38,37,19,39,9,36,41,36,8,48,19,35,37,35,19,41,14,35,48,35,14,50,34,33,38,19,34,34,19,33,53,33,20,32,31,28,32,1,31,31,30,27,31,0,30,30,22,29,30,29,27,32,28,23,31,27,28,28,27,26,29,25,27,27,25,26,28,26,18,29,21,25,26,25,24,25,20,24,26,24,16,48,24,19,43,15,24,48,14,24,43,24,14,32,23,3,28,18,23,30,12,22,29,22,21,51,21,11,22,11,21,52,20,21,25,21,20,33,19,20,24,20,19,58,18,16,26,16,18,23,18,4,58,17,18,18,17,4,24,15,16,55,16,15,30,0,13,30,13,12,22,12,11,23,4,3,32,3,2,32,2,1,31,1,0],"userEdges":[]}]},{"name":"D_EYE.00","display":[{"type":"mesh","name":"D_EYE.00","path":"shizuku_00","vertices":[-94.67,-62.27,-15.52,-76.5,87.83,-67.01,127.41,-25.66,120.81,15.02,72.44,-5.32,2.07,-11.42,-46.3,21.12,-118.86,2.81,-73.26,47.13,-67.63,-15.65,-46.84,-37.13,-75.14,13.84,30.61,-39.26,-5.88,-40.85,78.15,-29.87,97.67,-12.22,39.95,-73.32,32.49,-8.79,-42.74,-12.11,-52.77,-69.8,-106.99,-29.13,-104.54,46.53,-92.57,28.37,-93.03,-6.5,-82.78,-38.07,-73.84,-48.42,-30.75,-57.35,11.6,-55.83,-22.02,-21.61,-24.79,6.65,57.04,-55.24,56.14,-18.51,107.91,-47.7,15.25,-23.65,-9.42,-56.64,34.49,-54.37,82.55,-46.75,101.49,-27.88,93.37,4.82,120.46,-9.7,55.09,-34.43,54.2,-6.9,13.18,-40.02,-26.03,-39.02,-49.86,-53.75,-58.98,-0.73,-44.3,1.37,-23.62,-12.98,-2.03,-26.62,31.61,-22.95,-90.92,-23.98,-95.65,8.67,-89.69,46.82,-57.85,32.26,-110.75,27.57,43.17,-29.05,66.33,-23.77,75.81,-19.83],"uvs":[0.020508,0.90918,0.055664,0.902344,0.101563,0.905273,0.119141,0.926758,0.115234,0.947266,0.094727,0.936523,0.063477,0.933594,0.041992,0.949219,0.009766,0.94043,0.03002,0.961712,0.032519,0.931563,0.041754,0.921252,0.029184,0.945726,0.076474,0.920553,0.059944,0.919462,0.09759,0.923432,0.10626,0.93191,0.079648,0.903875,0.076984,0.93486,0.043575,0.932288,0.039118,0.905561,0.015038,0.925091,0.016127,0.961422,0.021443,0.9527,0.021239,0.935959,0.027092,0.92145,0.031065,0.915178,0.048897,0.911543,0.067383,0.912598,0.05229,0.927238,0.051544,0.942272,0.088542,0.913203,0.08749,0.930192,0.110482,0.916175,0.069328,0.927723,0.058048,0.91188,0.077743,0.913885,0.099395,0.915183,0.107803,0.925008,0.104023,0.941393,0.117681,0.93442,0.087347,0.922035,0.086627,0.935764,0.06858,0.920032,0.050995,0.920343,0.040413,0.913267,0.036363,0.938728,0.042879,0.939734,0.052067,0.932845,0.061653,0.926298,0.076747,0.928211,0.023476,0.928216,0.020074,0.943241,0.022723,0.961559,0.036865,0.954569,0.013367,0.952315,0.081893,0.925294,0.092165,0.927063,0.096419,0.928787],"triangles":[58,57,5,58,15,57,56,50,32,56,13,50,47,19,46,47,46,7,57,41,32,56,32,41,57,15,41,56,41,13,50,34,18,43,14,34,49,34,14,50,13,34,43,34,13,49,6,34,37,15,33,38,33,15,38,3,33,37,33,2,42,32,18,50,18,32,42,5,32,57,32,5,37,31,15,41,15,31,36,31,17,37,2,31,36,13,31,41,31,13,48,19,30,47,30,19,47,7,30,48,30,6,48,29,19,49,14,29,44,29,14,44,11,29,48,6,29,49,29,6,36,17,28,35,14,28,43,28,14,43,13,28,36,28,13,35,28,1,35,27,14,44,14,27,45,27,20,45,11,27,44,27,11,35,1,27,45,20,26,45,26,11,26,25,11,51,25,21,51,10,25,26,0,25,52,12,24,51,21,24,51,24,10,52,24,8,52,23,12,55,22,23,53,23,22,52,8,23,55,23,8,53,9,23,25,0,21,24,21,8,27,1,20,26,20,0,29,11,19,46,19,10,34,6,18,31,2,17,28,17,1,40,16,4,39,4,16,38,15,16,58,16,15,40,3,16,38,16,3,58,5,16,39,16,5,54,12,9,23,9,12,46,10,12,24,12,10,54,7,12,46,12,7,19,11,10,25,10,11],"userEdges":[]}]},{"name":"D_EYE.01","display":[{"type":"mesh","name":"D_EYE.01","path":"shizuku_00","vertices":[-105.01,-39.22,-52.54,-60.49,26.18,-68.22,85.73,-41.15,107.93,3.31,113.99,44.88,32.24,12.01,-21.25,-1.52,-57.58,10.08,-91.89,47.78,-108.04,-0.55,-61.62,-23.75,1.96,-36.32,63.52,-21.82,76.64,14.91,-32.15,-29.58,-81.53,5.03,-6.18,-65.04,-21.32,-46.65,-77.66,-50.31,16.74,-12.72,42.45,-48.01,29.55,-29.82,9.54,6.27,14.28,-54.96,52.9,-56.08,84.89,-9.72,45.13,-1.93,85.09,48.11,95.76,30.26,42.02,30.31,63.74,35.34,69.3,-5.64,97.79,-16.99,103.76,65.46,54.08,24.95,49.49,13.14,81.22,32.92,111.28,26.33,91.82,9.29,99.05,46.55,-88.24,-10.45,-69.56,23.24,-84.28,-31.83,-57.37,-40.95,-43.59,-13.82,-8.51,-20.61,-26.9,-63.01,-15.23,-32.92,-69.4,-36.63,-41.25,-43.37,-1.78,-49.52,-59.64,-7.21,-26.93,-16.15,-71.41,-9.6],"uvs":[0.148926,0.912109,0.174316,0.901367,0.212402,0.897461,0.241211,0.911133,0.251953,0.933594,0.254883,0.95459,0.215332,0.937988,0.189453,0.931152,0.171875,0.937012,0.155273,0.956055,0.147461,0.931641,0.169922,0.919922,0.200684,0.913574,0.230469,0.920898,0.236816,0.939453,0.18418,0.91698,0.160287,0.934462,0.196742,0.899067,0.189417,0.908358,0.162163,0.906509,0.207835,0.925494,0.220272,0.907671,0.214029,0.916856,0.204352,0.935088,0.207293,0.904487,0.225327,0.903595,0.240808,0.927008,0.221571,0.930944,0.240901,0.956221,0.246067,0.947203,0.220065,0.947229,0.230572,0.94977,0.233265,0.929071,0.247049,0.923339,0.249934,0.964983,0.225899,0.944521,0.223677,0.938557,0.239032,0.948548,0.253575,0.945217,0.244159,0.936611,0.247657,0.955433,0.157039,0.926643,0.166081,0.943658,0.158957,0.915842,0.171979,0.911235,0.178643,0.924937,0.195615,0.921508,0.186718,0.900095,0.192367,0.91529,0.166158,0.913415,0.179779,0.910013,0.198872,0.906907,0.170877,0.928276,0.186703,0.923761,0.165185,0.92707],"triangles":[54,16,52,54,52,11,48,15,46,53,46,15,53,7,46,48,46,12,53,15,45,52,8,45,53,45,7,52,45,11,50,44,15,49,44,19,50,1,44,49,11,44,49,19,43,49,43,11,54,41,16,43,0,41,54,11,41,43,41,11,36,6,35,36,35,14,40,28,34,40,34,5,37,31,28,35,30,31,37,14,31,35,31,14,35,6,30,39,29,4,38,4,29,37,28,29,40,29,28,40,5,29,38,29,5,39,14,29,37,29,14,32,27,14,36,14,27,36,27,6,32,13,27,33,3,26,32,14,26,39,26,14,39,4,26,33,26,4,32,26,13,25,21,3,51,24,17,51,12,24,24,12,21,22,21,12,25,2,21,24,21,2,22,13,21,22,20,13,27,13,20,46,7,20,23,20,7,23,6,20,27,20,6,22,12,20,46,20,12,44,1,19,43,19,0,48,18,15,50,15,18,51,17,18,47,18,17,47,1,18,50,18,1,48,12,18,51,18,12,24,2,17,42,16,9,42,8,16,52,16,8,41,10,16,44,11,15,45,15,11,21,13,3,26,3,13,41,0,10,16,10,9,45,8,7],"userEdges":[]}]},{"name":"D_EYE.02","display":[{"type":"mesh","name":"D_EYE.02","path":"shizuku_00","vertices":[-63.16,-35.83,21.86,-58.88,112.75,-39.9,122.96,45.53,74.89,107.86,-23.58,122.81,-88.08,79.42,-91.01,10.27,-11.85,57.73,61.44,33.32],"uvs":[0.733724,0.386068,0.771484,0.375,0.811849,0.384115,0.816406,0.42513,0.794922,0.455078,0.751302,0.46224,0.722656,0.441406,0.721354,0.408203,0.75651,0.43099,0.789063,0.419271],"triangles":[1,8,9,9,8,4,8,0,7,8,7,6,8,6,5,8,5,4,9,4,3,9,3,2,9,2,1,8,1,0],"userEdges":[]}]},{"name":"D_EYE.03","display":[{"type":"mesh","name":"D_EYE.03","path":"shizuku_00","vertices":[-60.95,-53.4,28.87,-54.36,106.58,-12.8,98.51,69.85,30.89,115.77,-59.94,102.24,-108.38,37.47,-93.24,-25.36,-8.47,43.27,55.11,8.47,-19.57,-8.93,-59.94,29.74],"uvs":[0.736328,0.476074,0.779785,0.475586,0.817383,0.496582,0.815918,0.539063,0.780762,0.561523,0.736816,0.554688,0.713379,0.521973,0.720703,0.490234,0.761719,0.524902,0.79248,0.507324,0.756348,0.498535,0.736816,0.518066],"triangles":[11,10,7,11,8,10,10,9,1,10,8,9,9,8,3,11,5,8,10,0,7,11,7,6,11,6,5,8,5,4,8,4,3,9,3,2,9,2,1,10,1,0],"userEdges":[]}]},{"name":"D_EYE.04","display":[{"type":"mesh","name":"D_EYE.04","path":"shizuku_00","vertices":[-50.88,86.88,-19.37,88.91,6.84,107.04,-10.94,127.72,-46.48,120.09,-23.03,107.89],"uvs":[0.299805,0.963542,0.313802,0.964518,0.329102,0.972982,0.318034,0.986328,0.301758,0.979492,0.312174,0.973633],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.05","display":[{"type":"mesh","name":"D_EYE.05","path":"shizuku_00","vertices":[18.78,119.64,18.78,95.47,60.16,86.77,73.28,112.87,45.02,129.3,46.03,108.04],"uvs":[0.344238,0.983398,0.34668,0.969727,0.368164,0.963379,0.373047,0.978516,0.359375,0.986816,0.359863,0.976074],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.06","display":[{"type":"mesh","name":"D_EYE.06","path":"shizuku_00","vertices":[-86.61,38.74,-130.59,-26.34,-107.13,-117.18,-29.44,-165.99,76.1,-155.14,128.87,-92.77,136.2,-22.27,102.49,8.91,45.32,-16.85,-42.64,3.49,-41.17,-73.79,52.65,-85.99,96.62,-48.03,0.61,-46.28,-86.2,-50.36,-90.57,-11.29,12.77,-124.85,-34.71,-124.61,63.06,-116.71,88.06,-89.14,-73.54,-95.08],"uvs":[0.028646,0.229818,0.007161,0.199219,0.019531,0.154948,0.054036,0.13151,0.100911,0.136719,0.124349,0.166667,0.127604,0.200521,0.11263,0.215495,0.08724,0.203125,0.048177,0.212891,0.048828,0.175781,0.090495,0.169922,0.110026,0.188151,0.067386,0.188992,0.028829,0.187031,0.026888,0.205794,0.072786,0.151265,0.051699,0.151379,0.095122,0.155174,0.106225,0.168409,0.034454,0.165559],"triangles":[19,5,18,19,18,11,20,17,2,20,10,17,18,4,16,17,10,16,17,16,3,18,16,11,15,9,14,20,2,14,15,14,1,20,14,10,19,11,12,19,12,5,13,11,10,16,10,11,13,8,11,12,11,8,14,9,10,13,10,9,15,0,9,13,9,8,12,8,7,12,7,6,12,6,5,18,5,4,16,4,3,17,3,2,14,2,1,15,1,0],"userEdges":[]}]},{"name":"D_EYE.07","display":[{"type":"mesh","name":"D_EYE.07","path":"shizuku_00","vertices":[-19.18,-84.98,23.33,-106.67,70.97,-104.64,87.09,-63.96,43.12,-62.61,0.61,-68.03,23.33,-87.69,54.11,-85.66],"uvs":[0.490885,0.204427,0.509766,0.19401,0.530924,0.194987,0.538086,0.214518,0.518555,0.215169,0.499674,0.212565,0.509766,0.203125,0.523438,0.204102],"triangles":[7,6,4,7,1,6,6,0,5,6,5,4,7,4,3,7,3,2,7,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE.08","display":[{"type":"mesh","name":"D_EYE.08","path":"shizuku_00","vertices":[-29.08,-74.47,17.1,-95.82,63.27,-91.76,84.16,-62.27,32.49,-63.28,2.03,-68.82,25.87,-77.29,45.96,-75.74,72.55,-78.67,55.01,-62.84,7.17,-78.03,33.65,-94.37,-3.79,-86.16,64.25,-69.29,42,-83.53],"uvs":[0.023926,0.648438,0.044434,0.638184,0.064941,0.640137,0.074219,0.654297,0.05127,0.653809,0.03774,0.651151,0.048328,0.647085,0.057251,0.647827,0.069059,0.646422,0.06127,0.654021,0.040023,0.646728,0.051784,0.638884,0.035156,0.642822,0.065377,0.650925,0.055495,0.644087],"triangles":[14,11,6,14,2,11,12,0,10,12,10,1,13,7,9,13,9,3,13,8,7,13,3,8,14,6,7,8,2,7,14,7,2,9,7,4,10,5,6,11,1,6,10,6,1,7,6,4,10,0,5,6,5,4],"userEdges":[]}]},{"name":"D_EYE.09","display":[{"type":"mesh","name":"D_EYE.09","path":"shizuku_00","vertices":[-105.52,-52.27,-78.61,-84.49,-36.89,-89,1.46,-67.09,-24.11,-55.49,-71.88,-49.69,-52.9,-70.81],"uvs":[0.572591,0.207357,0.585612,0.191081,0.605794,0.188802,0.624349,0.19987,0.611979,0.205729,0.588867,0.208659,0.598049,0.19799],"triangles":[6,4,2,6,1,5,6,5,4,4,3,2,6,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.10","display":[{"type":"mesh","name":"D_EYE.10","path":"shizuku_00","vertices":[-91.41,-58.28,-66.86,-76.74,-25.86,-79.37,-1.97,-61.09,-32.13,-54.77,-64.41,-53.58],"uvs":[0.089518,0.650065,0.101563,0.640951,0.121419,0.639974,0.132813,0.649414,0.118164,0.652344,0.102539,0.652669],"triangles":[1,5,4,4,3,2,4,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.11","display":[{"type":"mesh","name":"D_EYE.11","path":"shizuku_00","vertices":[-100.98,27.16,-138.65,-36,-122.51,-112.04,-17.55,-141.69,100.87,-113.33,142.58,-16.66,95.48,64.54,49.73,2.67,-36.39,-5.06,-47.15,-69.51,40.31,-70.8,-81.53,-18.72,1.1,-41.06,85.4,-46.93,95.21,-6.8,-100.28,-50.05,-86.02,-91.45,-72.22,-126.25,-30.53,-110.03,-3.29,-70.16,10.26,-107.62,47.59,-126.09,69.67,-91.42,121.99,-64.37,44.2,-40.48,44.19,-100.22,92.39,-76.97,-61.64,-102.31],"uvs":[0.147135,0.211589,0.128906,0.179688,0.136719,0.141276,0.1875,0.126302,0.244792,0.140625,0.264974,0.189453,0.242188,0.230469,0.220052,0.199219,0.178385,0.195313,0.173177,0.16276,0.215495,0.162109,0.156544,0.188415,0.196521,0.179086,0.237308,0.174164,0.242054,0.194436,0.147475,0.172588,0.154374,0.15168,0.16105,0.134102,0.181219,0.14229,0.194401,0.162434,0.200955,0.143511,0.219018,0.134182,0.229699,0.151693,0.255014,0.165356,0.217375,0.177423,0.21737,0.147249,0.240693,0.158992,0.166167,0.146195],"triangles":[26,13,23,26,23,4,26,22,13,25,22,21,26,4,22,25,10,22,25,21,20,22,4,21,21,3,20,25,20,10,20,18,19,20,19,10,27,18,17,20,3,18,27,9,18,19,18,9,27,17,16,18,3,17,17,2,16,27,16,9,16,2,15,16,15,9,14,13,7,24,7,13,14,5,13,23,13,5,22,10,13,24,13,10,24,12,7,19,9,12,24,10,12,19,12,10,15,11,9,15,1,11,11,8,9,12,9,8,11,0,8,12,8,7,14,7,6,14,6,5,15,2,1,11,1,0],"userEdges":[]}]},{"name":"D_EYE.12","display":[{"type":"mesh","name":"D_EYE.12","path":"shizuku_00","vertices":[-96.8,7.73,-59.01,0.61,-57.83,37.22,-51.92,72.81,-42.08,95.18,-72.39,79.93,-92.86,43.66,-77.86,22.06,-69.82,59.3,-75.22,40.75,-61.63,76.38,-78.64,4.31],"uvs":[0.321289,0.612305,0.336914,0.608887,0.337402,0.626465,0.34082,0.642578,0.342285,0.65332,0.330078,0.646973,0.322266,0.629883,0.32912,0.619187,0.332768,0.637069,0.329886,0.628162,0.335829,0.64462,0.328796,0.610663],"triangles":[10,8,5,9,8,2,9,6,8,10,3,8,9,7,6,11,7,1,11,0,7,9,2,7,7,0,6,8,6,5,10,5,4,10,4,3,8,3,2,7,2,1],"userEdges":[]}]},{"name":"D_EYE.13","display":[{"type":"mesh","name":"D_EYE.13","path":"shizuku_00","vertices":[71.26,10.4,105.58,25.23,96.83,63.89,77.99,84.52,57.13,94.83,61.17,63.25,67.23,32.31,80.01,53.58,83.15,29.37,68.68,77.5],"uvs":[0.396159,0.60612,0.41276,0.613607,0.408529,0.633138,0.400065,0.642904,0.388021,0.647135,0.391276,0.632813,0.394206,0.617188,0.400391,0.62793,0.401908,0.615701,0.395561,0.637733],"triangles":[8,7,1,8,6,7,9,7,5,9,3,7,8,0,6,7,6,5,9,5,4,9,4,3,7,3,2,7,2,1,8,1,0],"userEdges":[]}]},{"name":"D_EYE.14","display":[{"type":"mesh","name":"D_EYE.14","path":"shizuku_00","vertices":[-19.18,-94.13,10.14,-71.08,36.52,-46,-8.19,-36.51,-24.31,-59.56,0.47,-52.85,-9.01,-64.68,10.18,-40.4],"uvs":[0.710286,0.263997,0.723307,0.275065,0.735026,0.287109,0.715169,0.291667,0.708008,0.280599,0.719016,0.283819,0.714806,0.27814,0.723326,0.289795],"triangles":[7,2,5,6,4,5,7,5,3,6,5,1,6,0,4,5,4,3,5,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE.15","display":[{"type":"mesh","name":"D_EYE.15","path":"shizuku_00","vertices":[-119.59,-17.52,-95.41,-22.61,-55.83,-27.35,-70.12,3.15,-96.87,3.83,-111.53,-4.64,-79.95,-8.54,-102.39,-6.62],"uvs":[0.663574,0.29834,0.680664,0.296387,0.698242,0.294434,0.691895,0.309082,0.678711,0.308105,0.667969,0.307129,0.686063,0.30249,0.672194,0.303901],"triangles":[7,4,1,6,1,4,7,0,5,7,5,4,6,4,3,6,3,2,6,2,1,7,1,0],"userEdges":[]}]},{"name":"D_EYE.16","display":[{"type":"mesh","name":"D_EYE.16","path":"shizuku_00","vertices":[-107.41,68.23,-94.22,41.79,-73.33,29.59,-70.03,58.06,-82.66,49.57],"uvs":[0.668945,0.34082,0.674805,0.328125,0.684082,0.322266,0.685547,0.335938,0.679936,0.331857],"triangles":[4,0,3,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_EYE.17","display":[{"type":"mesh","name":"D_EYE.17","path":"shizuku_00","vertices":[-44.46,-47.28,-12.17,-60.16,29.55,-75.63,18.11,-43.41,-3.42,-34.39],"uvs":[0.769857,0.280599,0.785482,0.274089,0.805664,0.266276,0.80013,0.282552,0.789714,0.287109],"triangles":[1,4,3,3,2,1,4,1,0],"userEdges":[]}]},{"name":"D_EYE.18","display":[{"type":"mesh","name":"D_EYE.18","path":"shizuku_00","vertices":[62.18,-20.53,96.49,-12.8,126.1,-4.42,103.89,11.05,79,11.69,62.85,-3.77,83.71,-3.13,100.13,-1.08],"uvs":[0.817383,0.292643,0.833984,0.296549,0.848307,0.300781,0.837565,0.308594,0.825521,0.308919,0.817708,0.301107,0.827799,0.301432,0.835743,0.302467],"triangles":[7,1,6,7,6,3,6,0,5,6,5,4,6,4,3,7,3,2,7,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE.19","display":[{"type":"mesh","name":"D_EYE.19","path":"shizuku_00","vertices":[71.77,4.6,104.06,21.36,130.97,36.83,103.39,42.63,79.17,40.05,74.12,23.78,89.26,27.16,103.72,32.14],"uvs":[0.830078,0.319336,0.845703,0.327799,0.858724,0.335612,0.845378,0.338542,0.833659,0.33724,0.829753,0.328776,0.838542,0.330729,0.845538,0.333247],"triangles":[7,1,6,7,6,3,6,0,5,6,5,4,6,4,3,7,3,2,7,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.07","display":[{"type":"mesh","name":"D_EYE_BALL.07","path":"shizuku_00","vertices":[-22.7,-144.12,96.35,-124.86,164.75,-21.7,156.66,90.3,59.54,151.8,-78.97,136.04,-146.07,25.73,-124.42,-103.85,9.76,29.23,-1.06,-63.57],"uvs":[0.913086,0.32666,0.939941,0.332031,0.955078,0.36084,0.953125,0.39209,0.931641,0.40918,0.900391,0.404785,0.885254,0.374023,0.890137,0.337891,0.92041,0.375,0.917969,0.349121],"triangles":[9,8,2,9,6,8,9,0,7,9,7,6,8,6,5,8,5,4,8,4,3,8,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.08","display":[{"type":"mesh","name":"D_EYE_BALL.08","path":"shizuku_00","vertices":[-51.01,-135.33,136.17,-89.11,147.18,155.85,-17.98,155.85,-161.11,12.57,33.41,7.95],"uvs":[0.905599,0.25,0.922201,0.253255,0.923177,0.270508,0.908529,0.270508,0.895833,0.260417,0.913086,0.260091],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.09","display":[{"type":"mesh","name":"D_EYE_BALL.09","path":"shizuku_00","vertices":[-102.3,-113.07,66.41,-105.67,143.1,92.1,15.29,178.63,-173.87,38.11,-0.05,24.12],"uvs":[0.952148,0.25,0.969238,0.251953,0.976563,0.267578,0.964355,0.274414,0.94873,0.265137,0.962891,0.262207],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.10","display":[{"type":"mesh","name":"D_EYE_BALL.10","path":"shizuku_00","vertices":[-52.92,-153.15,160.18,-78.41,90.92,157.3,-122.18,151.55,-159.47,-20.92,-4.98,7.82],"uvs":[0.888021,0.287109,0.901042,0.291341,0.89681,0.304688,0.883789,0.304362,0.88151,0.294596,0.890951,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.11","display":[{"type":"mesh","name":"D_EYE_BALL.11","path":"shizuku_00","vertices":[-160.05,-23.04,-16.64,-152.36,163.79,-56.77,126.78,145.64,-86.03,156.89,1.87,27.56],"uvs":[0.924154,0.293294,0.934245,0.285807,0.94694,0.291341,0.944336,0.30306,0.929362,0.303711,0.935547,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.12","display":[{"type":"mesh","name":"D_EYE_BALL.12","path":"shizuku_00","vertices":[-12.72,-139.91,107.08,-95.71,127.52,18.11,89.69,132.29,-10.39,154.89,-114.4,119.98,-144.34,14.37,-94.19,-113.56,-15.01,47.96,-15.16,-48.98],"uvs":[0.910645,0.327637,0.941895,0.333008,0.953613,0.362305,0.951172,0.393555,0.929688,0.406738,0.902832,0.40332,0.888184,0.375977,0.890625,0.339844,0.921387,0.37793,0.915527,0.352051],"triangles":[9,6,8,9,8,2,9,0,7,9,7,6,8,6,5,8,5,4,8,4,3,8,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.00","display":[{"type":"mesh","name":"D_EYE_BALL.00","path":"shizuku_00","vertices":[-35.69,-149.38,120.86,-119.02,166.31,26.9,115.81,129.04,-20.54,155.31,-107.11,104.53,-141.74,-47.82,4.35,-31.18,23.83,61.63],"uvs":[0.436035,0.269531,0.470215,0.276367,0.480469,0.318359,0.469727,0.346191,0.438965,0.353516,0.418945,0.340332,0.410156,0.296875,0.44458,0.301514,0.448975,0.327393],"triangles":[8,1,7,8,7,6,7,0,6,8,6,5,8,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.01","display":[{"type":"mesh","name":"D_EYE_BALL.01","path":"shizuku_00","vertices":[19.22,-139.16,129,-73.15,127,73.12,45.17,160.53,-102.53,137.34,-150.43,48.15,-113.17,-107.05,-0.74,-30.34,-14.71,51.72],"uvs":[0.560059,0.268555,0.586914,0.286621,0.586426,0.32666,0.566406,0.350586,0.530273,0.344238,0.518555,0.319824,0.529785,0.275879,0.555176,0.29834,0.551758,0.320801],"triangles":[2,7,8,5,8,7,7,0,6,7,6,5,8,5,4,8,4,3,8,3,2,7,2,1,7,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.02","display":[{"type":"mesh","name":"D_EYE_BALL.02","path":"shizuku_00","vertices":[-51.01,-135.33,136.17,-89.11,147.18,155.85,-17.98,155.85,-161.11,12.57,33.41,7.95],"uvs":[0.905599,0.25,0.922201,0.253255,0.923177,0.270508,0.908529,0.270508,0.895833,0.260417,0.913086,0.260091],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.03","display":[{"type":"mesh","name":"D_EYE_BALL.03","path":"shizuku_00","vertices":[-102.3,-113.07,66.41,-105.67,143.1,92.1,15.29,178.63,-173.87,38.11,-0.05,24.12],"uvs":[0.952148,0.25,0.969238,0.251953,0.976563,0.267578,0.964355,0.274414,0.94873,0.265137,0.962891,0.262207],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.04","display":[{"type":"mesh","name":"D_EYE_BALL.04","path":"shizuku_00","vertices":[-52.92,-153.15,160.18,-78.41,90.92,157.3,-122.18,151.55,-159.47,-20.92,-4.98,7.82],"uvs":[0.888021,0.287109,0.901042,0.291341,0.89681,0.304688,0.883789,0.304362,0.88151,0.294596,0.890951,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.05","display":[{"type":"mesh","name":"D_EYE_BALL.05","path":"shizuku_00","vertices":[-160.05,-23.04,-16.64,-152.36,163.79,-56.77,126.78,145.64,-86.03,156.89,1.87,27.56],"uvs":[0.924154,0.293294,0.934245,0.285807,0.94694,0.291341,0.944336,0.30306,0.929362,0.303711,0.935547,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_BROW.00","display":[{"type":"mesh","name":"D_BROW.00","path":"shizuku_02","vertices":[-160.01,142.01,-112.68,5.9,-30.63,-91.83,68.77,-105.79,128.73,-49.94,153.97,19.86,101.91,5.9,18.28,12.88,-60.61,68.72,-47.7,-0.4,15.68,-98.33,46.61,-53.69,-9.72,-47.07,-107.47,103.27,-81.89,43.05,16.77,-51.52,85.23,-50.33,116.11,-23.66,-138.37,79.78,-109.91,57.73,-63.61,-52.55,-30.67,47.53,55.43,9.78,73.02,-25.23,32.13,-19.67,94.94,-81.41,-76.9,2.43,-38.31,-50.72,-17.78,5.62,-87.59,-23.98],"uvs":[0.08724,0.645833,0.106771,0.620443,0.140625,0.602214,0.181641,0.599609,0.20638,0.610026,0.216797,0.623047,0.195313,0.620443,0.160807,0.621745,0.128255,0.632161,0.133581,0.619267,0.159733,0.601,0.172495,0.609327,0.149252,0.610562,0.108919,0.638607,0.119474,0.627372,0.160185,0.609733,0.18843,0.609955,0.201171,0.614929,0.09617,0.634223,0.107914,0.630112,0.127017,0.609541,0.14061,0.628208,0.176134,0.621166,0.183393,0.614636,0.166522,0.615673,0.192439,0.604156,0.121536,0.619795,0.137458,0.609882,0.145927,0.620391,0.117122,0.614869],"triangles":[29,26,20,29,1,26,23,11,22,24,22,11,24,7,22,23,22,6,28,9,21,28,21,7,26,9,20,27,20,9,27,2,20,19,18,13,19,1,18,25,16,4,17,4,16,23,16,11,23,6,16,17,16,6,25,3,16,24,11,15,24,15,7,26,14,9,19,13,14,26,1,14,19,14,1,18,0,13,14,13,8,28,12,9,27,9,12,15,10,12,28,7,12,15,12,7,27,12,2,15,11,10,16,3,11,11,3,10,12,10,2,14,8,9,21,9,8,17,6,5,17,5,4],"userEdges":[]}]},{"name":"D_BROW.01","display":[{"type":"mesh","name":"D_BROW.01","path":"shizuku_02","vertices":[-147.95,38.77,-118.67,-29.47,-60.87,-68.98,2.95,-72.57,66.76,-34.86,117.81,31.59,159.1,135.75,108.05,107.02,47.24,54.94,-14.32,22.61,-76.63,24.41,88.03,38.21,26.48,-4.84,-38.07,-24.11,-102.67,-8.97,-68.18,-25.69,-7.18,-16.74,56.83,10.83,112.75,70.69,-97.65,-43.84,-105.77,30.28,-42.1,23.41,-29.73,-70.73,34.49,-53.93,18.06,39.61,95.79,2.92,79.63,82.68,-82.01,-38.63,-51.42,-50.39,-18.74,-46.95,15.48,-36.49,46.29,-19.6,77.67,2.61,-88.66,9,-56.18,-1.33,-26.94,-2.22,5.11,9.54,35.8,22.01,67.83,46.49,98.89,75.52,131.46,66.01,-120.27,9.59,-122.27,33.6,-129.91,-3.28],"uvs":[0.295898,0.611979,0.308594,0.599609,0.333659,0.592448,0.361328,0.591797,0.388997,0.598633,0.411133,0.610677,0.429036,0.629557,0.406901,0.624349,0.380534,0.614909,0.353841,0.609049,0.326823,0.609375,0.398218,0.611877,0.37153,0.604074,0.343545,0.60058,0.315531,0.603326,0.33049,0.600295,0.356936,0.601917,0.384691,0.606914,0.408939,0.617764,0.317708,0.597005,0.31419,0.610439,0.341795,0.609195,0.347159,0.59213,0.375007,0.595176,0.367881,0.612131,0.401583,0.605481,0.394578,0.619937,0.324492,0.597949,0.337754,0.595817,0.351924,0.596441,0.366762,0.598336,0.38012,0.601398,0.393725,0.605424,0.321608,0.606582,0.335692,0.60471,0.34837,0.604549,0.362264,0.606681,0.375574,0.60894,0.389463,0.613378,0.402926,0.618639,0.417048,0.616915,0.307901,0.606689,0.307034,0.611041,0.303722,0.604356],"triangles":[42,20,41,43,41,1,43,0,41,42,41,0,39,11,26,38,26,11,38,8,26,39,26,7,32,11,25,32,25,4,37,12,24,36,24,12,36,9,24,37,24,8,30,12,23,31,23,12,31,4,23,30,23,3,28,13,22,29,22,13,29,3,22,28,22,2,34,21,13,35,13,21,34,10,21,35,21,9,33,14,20,41,20,14,33,20,10,27,19,14,27,2,19,40,18,6,39,18,11,40,5,18,39,7,18,32,17,11,38,11,17,31,12,17,37,17,12,32,4,17,31,17,4,37,8,17,38,17,8,30,16,12,36,12,16,29,13,16,35,16,13,30,3,16,29,16,3,35,9,16,36,16,9,28,15,13,34,13,15,27,14,15,33,15,14,28,2,15,27,15,2,33,10,15,34,15,10,19,1,14,41,14,1,25,11,5,18,5,11,18,7,6],"userEdges":[]}]},{"name":"D_MOUTH.00","display":[{"type":"mesh","name":"D_MOUTH.00","path":"shizuku_00","vertices":[-61.02,-100.31,59.04,-101.55,131.33,-54.93,115.1,10.01,42.64,42.13,-63.57,40.92,-136.8,-3.23,-136.55,-72.01,-54.03,-32.54,37.78,-34.13],"uvs":[0.313477,0.874512,0.365723,0.874023,0.397461,0.897949,0.390625,0.931152,0.358887,0.947266,0.312988,0.947754,0.280273,0.924805,0.280273,0.88916,0.316895,0.909668,0.356934,0.908691],"triangles":[9,8,5,9,0,8,8,0,7,8,7,6,8,6,5,9,5,4,9,4,3,9,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_MOUTH.03","display":[{"type":"mesh","name":"D_MOUTH.03","path":"shizuku_00","vertices":[-118.79,20.11,-84.22,-19.56,-17.35,-25.64,77.56,-28.31,126.28,26.08,131.17,88.37,73.43,93.58,2.52,103.85,-53.69,87.29,-100.59,76.14,33.52,46.75,111.46,41.59,-70.85,37.49],"uvs":[0.686035,0.228516,0.70752,0.215332,0.739746,0.212891,0.780273,0.210938,0.809082,0.220215,0.802246,0.234375,0.777832,0.235352,0.748047,0.237305,0.723145,0.23877,0.700195,0.239258,0.761182,0.226558,0.793993,0.225572,0.716008,0.228065],"triangles":[11,3,6,10,6,3,10,2,7,12,8,2,12,1,9,12,9,8,2,8,7,10,7,6,11,6,5,11,5,4,11,4,3,10,3,2,12,2,1,9,1,0],"userEdges":[]}]},{"name":"D_MOUTH.01","display":[{"type":"mesh","name":"D_MOUTH.01","path":"shizuku_00","vertices":[-111.61,-104.94,-73.02,-80.53,-13.74,-52.42,58.49,-66.08,98.01,-96.46,118.84,-102.5,139.78,-5.89,94.19,51.7,55.75,85.04,-2.18,91.62,-59.18,81.52,-103.6,34.92,-86.38,0.61,-107.28,-53.16,7.68,35.98,75.93,21.79,103.67,-10.46,111.47,-66.07,61.78,-22.71,-35.98,-17.44,-126.72,-89.5,-110.4,-77.46,-100.67,-98.27,-93.77,-64.09,-52.46,-42.3,-27.26,-35.48,34.31,-36.53,61.49,-42.85,91.36,-64.12,105.62,-76.93,115.83,-92.44,110.48,-103.96,121.09,-72.38,6.77,-19.93,-96.52,-79.74,-106.27,-85.89,-85.87,-70.65,-60.95,-56.28,-84.72,-88.22,-25.4,-43.5,-42.63,-61.11,12.74,-43.73,44.17,-47.21,29.01,-51.97,59.7,-50.61,79.49,-62.44,81.13,-81.84,94.55,-74.65,103.22,-86.13,109.56,-90.22,-74.48,-59.5,-43.53,-50.02,-38.37,-42.92,-5.27,-40.01,6.96,-36.06,-101.02,-69.91,30.68,-45.72,-8.44,-43.6,-26.2,-40.05],"uvs":[0.874268,0.173096,0.892334,0.16333,0.909424,0.16333,0.928223,0.16333,0.943115,0.163574,0.956055,0.17041,0.958984,0.184082,0.954346,0.199707,0.936523,0.209473,0.912354,0.21167,0.888916,0.208984,0.877441,0.195801,0.894531,0.189453,0.888916,0.178711,0.914307,0.190674,0.932617,0.188965,0.947021,0.18335,0.94165,0.175293,0.927002,0.175537,0.905273,0.17627,0.875412,0.181282,0.881461,0.175853,0.87941,0.170316,0.890266,0.172636,0.900208,0.171204,0.906937,0.171084,0.92042,0.170967,0.92746,0.170956,0.936458,0.170667,0.942103,0.171672,0.947607,0.173274,0.948877,0.166618,0.951739,0.176592,0.914329,0.175964,0.885254,0.171021,0.880559,0.173419,0.89107,0.169017,0.897156,0.168152,0.886814,0.166314,0.908104,0.167444,0.902344,0.16333,0.915454,0.167518,0.923474,0.167978,0.919922,0.16333,0.927786,0.167693,0.933468,0.168003,0.936649,0.163468,0.938815,0.168157,0.942539,0.168187,0.945395,0.169216,0.894316,0.17,0.90252,0.167805,0.904318,0.169247,0.911619,0.169124,0.91443,0.171019,0.886429,0.174038,0.92003,0.16778,0.911373,0.167477,0.907602,0.169009],"triangles":[57,39,53,58,53,39,58,25,53,54,53,25,54,41,53,57,53,41,58,52,25,58,39,52,52,51,24,52,39,51,49,31,48,49,48,29,48,47,29,48,4,47,47,46,45,47,4,46,47,45,28,46,3,45,45,44,27,45,3,44,44,42,27,56,43,41,56,42,43,44,3,42,43,42,3,56,26,42,54,26,41,56,41,26,43,2,41,57,41,2,51,40,37,51,39,40,57,2,39,40,39,2,55,23,34,50,37,36,50,24,37,51,37,24,40,1,37,38,34,36,34,23,36,50,36,23,37,1,36,38,36,1,55,34,21,35,21,34,38,22,34,35,34,22,54,25,33,54,33,26,49,30,31,48,31,4,49,29,30,32,5,30,31,30,5,32,30,17,47,28,29,30,29,17,45,27,28,29,28,17,42,26,27,28,27,18,33,18,26,27,26,18,52,24,25,33,25,19,50,23,24,25,24,19,55,13,23,24,23,13,35,22,0,35,0,21,55,21,13,21,20,13,21,0,20,33,19,14,24,13,19,33,14,18,15,17,18,28,18,17,32,17,16,32,16,6,17,15,16,16,15,7,18,14,15,15,14,9,19,12,14,20,11,13,19,13,12,14,12,10,13,11,12,12,11,10,14,10,9,15,9,8,15,8,7,16,7,6,32,6,5],"userEdges":[]}]},{"name":"D_MOUTH.02","display":[{"type":"mesh","name":"D_MOUTH.02","path":"shizuku_00","vertices":[-120.37,47.27,-113.44,-49.94,-105.36,-113.71,-58.04,-145.02,24.83,-151.81,74.6,-142.66,107.93,-103.24,126.29,-42.28,126.45,29.76,98.87,77.63,33.79,128.23,-43.27,119.99,-94.38,85.05,-90.63,25.4,-52.32,64.08,29.62,73.73,88.25,53.1,111.15,6.98,71.72,-65.81,21.7,-35.22,-55.92,-43.25,-80.28,-42.16,-101.53,-10.77,126.44,6.37,96.86,-20.59,110.82,-34.1,120.61,25.57,107.91,46.9,95.61,69.1,67.01,93.77,33.63,106.28,-7.48,113.09,121.47,48.78,-48.8,100.03,-77.55,83.06,-96.68,59.65,-109.28,41.36,-109.94,69.52,-114.39,29.83,-119.25,10.3,-23.01,-89.98,-83.92,61.01,-69.36,75.21,-73.75,43.06,-50.35,85.96,-32.69,95.22,13.71,98.26,33.46,95.78,52.29,88.68,75.12,78.01,58.28,67.28,90.81,59.89,99.92,47.13,108.11,24.83,102.12,29.27,116.51,16.42,-94.64,45.11,-101.42,33.82,-106.76,24.41,-96.18,6.99,72.94,103.42,-4.37,124.15,-73.42,105.2,14.06,120.99,12.84,109.73,-79.99,4.37,-53.48,29.54,-27.06,30.18,26.64,32.76,-14.78,68.5,64.26,21.26,82.05,8.51],"uvs":[0.722656,0.195313,0.707031,0.18457,0.707031,0.15918,0.728027,0.140137,0.765137,0.135742,0.80127,0.140625,0.810059,0.166992,0.804688,0.184082,0.791016,0.191895,0.780273,0.188151,0.763997,0.188151,0.747396,0.189128,0.734375,0.190755,0.729167,0.179362,0.744792,0.177083,0.764323,0.178385,0.780273,0.178711,0.792643,0.180013,0.787435,0.158203,0.76237,0.157552,0.733724,0.160482,0.718925,0.170024,0.717083,0.182205,0.798009,0.187898,0.790662,0.171715,0.799069,0.175209,0.791677,0.187069,0.785756,0.184544,0.780273,0.184326,0.771572,0.183758,0.764134,0.184065,0.754914,0.184357,0.786888,0.190456,0.746242,0.183789,0.738912,0.184801,0.732395,0.186424,0.72528,0.188885,0.729602,0.192612,0.720416,0.190045,0.71674,0.191245,0.748025,0.149219,0.734781,0.182495,0.741501,0.181402,0.735916,0.178378,0.745595,0.180798,0.750706,0.181333,0.759419,0.181498,0.764223,0.181386,0.768754,0.18167,0.775392,0.181542,0.771603,0.178534,0.780273,0.181274,0.783159,0.181782,0.788888,0.182484,0.786577,0.179374,0.792168,0.183479,0.731085,0.183559,0.726864,0.185005,0.722615,0.186713,0.723054,0.1808,0.771973,0.188151,0.755775,0.188635,0.74044,0.189997,0.759655,0.186337,0.75947,0.184212,0.730563,0.173577,0.74123,0.17174,0.750793,0.170416,0.763588,0.170551,0.753739,0.17768,0.773819,0.171083,0.782959,0.171021],"triangles":[70,71,18,68,50,70,71,70,16,69,68,67,69,15,68,70,19,68,69,67,14,68,19,67,67,66,14,67,20,66,66,65,43,66,20,65,64,63,30,64,31,63,63,31,61,63,61,10,59,58,57,59,22,58,58,36,57,59,57,13,57,35,56,57,56,13,56,35,41,55,53,26,54,52,53,55,17,53,54,53,17,54,16,52,53,52,27,49,28,51,52,51,28,52,16,51,70,50,16,68,15,50,50,48,49,51,16,49,50,49,16,50,15,48,49,48,29,48,47,30,48,15,47,47,46,30,64,30,46,64,46,31,47,15,46,69,45,15,46,15,45,46,45,31,69,14,45,45,44,33,45,14,44,44,42,33,66,43,14,65,13,43,43,41,42,44,14,42,43,42,14,43,13,41,56,41,13,42,41,34,62,11,34,58,38,36,39,0,38,58,22,38,39,38,22,37,35,36,57,36,35,38,0,36,37,36,0,41,35,34,37,12,35,42,34,33,35,12,34,62,34,12,45,33,31,34,11,33,60,9,29,33,11,31,61,31,11,48,30,29,63,10,30,49,29,28,30,10,29,60,29,10,52,28,27,29,9,28,32,26,27,53,27,26,28,9,27,32,27,9,55,26,23,32,8,26,25,6,24,71,16,24,54,24,16,54,17,24,25,24,17,71,24,18,55,23,17,26,8,23,59,21,22,39,22,1,65,20,21,22,21,1,59,13,21,65,21,13,40,19,4,40,3,20,21,20,2,67,19,20,40,20,19,70,18,19,4,19,18,24,6,18,25,17,7,23,7,17,25,7,6,18,6,5,18,5,4,40,4,3,20,3,2,21,2,1],"userEdges":[]}]},{"name":"D_NOSE.00","display":[{"type":"mesh","name":"D_NOSE.00","path":"shizuku_00","vertices":[-14.81,-73.47,114.81,-8.16,129.63,107.94,-37.04,133.33,-133.33,17.23,11.11,13.61],"uvs":[0.567057,0.132161,0.580404,0.13737,0.580078,0.152018,0.56543,0.154297,0.556966,0.14388,0.569661,0.143555],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_NOSE.01","display":[{"type":"mesh","name":"D_NOSE.01","path":"shizuku_00","vertices":[-41.21,-133.33,55.09,-42.63,47.68,117.01,-70.84,11.79,-6.83,-15.87,-58.59,-48.21,-30.86,47.28,52.16,20.5,14.48,-80.88,27.3,-30.62,18.87,46.77,-41.84,-0.74,-22.63,-69.86,-21.28,22.11,24.41,3.39],"uvs":[0.500651,0.125977,0.509115,0.134115,0.508464,0.148438,0.498047,0.138997,0.503673,0.136515,0.499124,0.133614,0.501561,0.142182,0.508857,0.139779,0.505546,0.130683,0.506672,0.135192,0.505931,0.142136,0.500595,0.137873,0.502284,0.131671,0.502402,0.139924,0.506418,0.138244],"triangles":[13,11,6,13,4,11,13,6,10,14,10,7,14,4,10,13,10,4,14,7,9,14,9,4,12,4,8,9,8,4,9,1,8,12,8,0,10,2,7,9,7,1,11,3,6,10,6,2,11,4,5,12,5,4,12,0,5,11,5,3],"userEdges":[]}]},{"name":"D_EAR.00","display":[{"type":"mesh","name":"D_EAR.00","path":"shizuku_00","vertices":[-45.78,-121.45,87.53,-147.7,142.76,-98.12,118,11.25,30.4,92.92,-150.53,145.41,-118.15,22.92,-76.26,-66.04,-0.08,1.04,47.54,-77.7,-72.56,122.79,-39.63,59.92],"uvs":[0.861979,0.01237,0.907552,0.000651,0.926432,0.022786,0.917969,0.071615,0.888021,0.108073,0.826172,0.13151,0.83724,0.076823,0.851563,0.037109,0.877604,0.067057,0.89388,0.031901,0.852827,0.12141,0.864083,0.093342],"triangles":[11,6,10,11,10,4,9,8,3,9,7,8,11,8,6,11,4,8,9,0,7,8,7,6,10,6,5,8,4,3,9,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_EAR.01","display":[{"type":"mesh","name":"D_EAR.01","path":"shizuku_00","vertices":[-107.28,-141.95,71.02,-124.7,150.27,35.22,126.06,141.83,4.99,116.74,-107.28,25.81,-153.51,-79.24,-30.23,-61.99,40.21,30.51],"uvs":[0.729167,0.010417,0.781901,0.017578,0.805339,0.083984,0.798177,0.128255,0.76237,0.117839,0.729167,0.080078,0.715495,0.036458,0.751953,0.04362,0.772786,0.082031],"triangles":[8,1,7,8,7,5,7,0,6,7,6,5,8,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_HAIR_FRONT.00","display":[{"type":"mesh","name":"D_HAIR_FRONT.00","path":"shizuku_02","vertices":[5.72,-163.71,93.5,-148.25,157.86,-82.19,173.08,10.57,170.73,110.37,147.33,156.75,116.9,115.99,85.3,65.39,73.6,87.88,43.17,68.2,20.35,97.01,-19.44,75.23,-73.86,85.07,-101.94,108.96,-132.37,151.13,-159.29,112.83,-166.31,10.57,-148.75,-87.81,-85.56,-144.03,-134.71,96.31,-104.28,55.55,-60.98,33.06,-9.78,20.41,32.06,31.66,4.74,55.3,71.26,14.79,141.48,93.5,116.9,49.93,172.51,62.69,108.71,-18.94,-161,61.61,-130.03,37.28,-94.92,-3.48,-132.37,-30.19,59.56,-59.7,19.48,-38.27,-44.6,-37.21,-96.09,-72.35,-34.07,-86.41,30.3,-93.44,85.3,-97.65],"uvs":[0.264323,0.643229,0.358073,0.653646,0.429688,0.708333,0.46224,0.800781,0.463542,0.891927,0.432292,0.940104,0.408854,0.89974,0.373698,0.852865,0.360677,0.873698,0.326823,0.855469,0.313802,0.878906,0.263021,0.861979,0.196615,0.871094,0.165365,0.893229,0.13151,0.932292,0.105469,0.895833,0.09375,0.802083,0.113281,0.710938,0.183594,0.658854,0.132813,0.88151,0.16276,0.84375,0.210938,0.822917,0.266927,0.811198,0.3125,0.821615,0.287647,0.841889,0.358073,0.80599,0.436198,0.878906,0.408854,0.838542,0.462911,0.847758,0.39974,0.77474,0.099659,0.849359,0.134115,0.826823,0.173177,0.789063,0.13151,0.764323,0.345052,0.736979,0.295573,0.757813,0.229167,0.757813,0.174479,0.723958,0.240885,0.708333,0.311198,0.703125,0.360677,0.695313],"triangles":[1,39,40,40,39,34,0,38,39,39,38,35,38,18,37,38,37,36,37,32,36,38,36,35,36,22,35,39,35,34,40,34,2,35,25,34,34,29,2,37,17,33,37,33,32,33,31,32,36,32,21,33,16,31,32,31,20,31,30,19,31,16,30,34,25,29,29,25,27,29,27,3,27,28,3,28,27,26,28,26,4,27,6,26,35,23,25,27,25,7,25,9,7,25,23,9,24,9,23,35,22,23,24,23,22,24,22,11,36,21,22,22,21,11,32,20,21,21,20,12,31,19,20,20,19,13,30,15,19,38,0,18,37,18,17,33,17,16,19,15,14,19,14,13,20,13,12,21,12,11,24,11,10,24,10,9,9,8,7,27,7,6,26,6,5,26,5,4,29,3,2,40,2,1,39,1,0],"userEdges":[]}]},{"name":"D_HAIR_SIDE.00","display":[{"type":"mesh","name":"D_HAIR_SIDE.00","path":"shizuku_02","vertices":[14.66,-166.1,-0.3,-107.56,14.12,-35.76,37.55,37.41,52.87,103.96,160.36,159.52,26.95,160.44,-74.57,126.59,-98.26,47.02,-124.8,-17.92,-141.37,-86.75,-69.41,-148.26,62.04,139.4,-14.55,100.07,-42.87,4.49,-79.21,-51.77,-80.27,-95.21,-29.78,43.75,-92.78,94.74,-118.58,12.48,27.28,0.33,-131.57,-49.92,1.55,-62.73,-112.54,-71.95,-40.18,-80.35,-31.39,-130.32,-65.55,-26.01,-62.81,69.05,6.27,65.77,14.05,116.08,87.9,130.22,76.8,159.25,95.73,149.29,54.24,124.28,7.47,135.15,-25.88,142.82,-35.94,109.52,44.4,67.2,26.13,82.05,16.67,101.87,-23.19,68.11,-95.46,71.45,-44.67,80.71,-0.35,76.68,-46.86,97.87,-25.5,120.77,47.06,148.38,119.05,142.82,73.78,135.23,113.03,159.37,40.36,128.87,69.48,116.41,18.43,149.38,-30.06,131.24,6.1,40.37,-2.88,20.86,-17.87,-13.17,-10.88,2.59,-67.2,45.53,-71.85,26.74,-82.77,8.7,-88.45,-7.98],"uvs":[0.06901,0.528646,0.063802,0.605469,0.065104,0.709635,0.079427,0.8125,0.092448,0.904948,0.140625,0.989583,0.065104,0.984375,0.033854,0.94401,0.02474,0.828125,0.007813,0.733073,0.001302,0.634115,0.027344,0.55599,0.085938,0.951823,0.057292,0.898438,0.044271,0.765625,0.028646,0.684896,0.027575,0.622073,0.052427,0.820214,0.029853,0.893134,0.015694,0.777331,0.071986,0.759063,0.004901,0.688822,0.0646,0.669293,0.013699,0.657137,0.046655,0.64421,0.044002,0.578597,0.035743,0.721566,0.038809,0.858516,0.069357,0.851597,0.06955,0.921283,0.113259,0.941509,0.095558,0.986475,0.108201,0.967195,0.089156,0.928652,0.063621,0.948475,0.048841,0.963369,0.04894,0.914678,0.085256,0.853887,0.079199,0.874338,0.07357,0.901452,0.054531,0.854044,0.027357,0.861404,0.045756,0.87352,0.065518,0.8665,0.045961,0.896248,0.05362,0.931426,0.077046,0.965716,0.125025,0.962178,0.098346,0.947139,0.115098,0.987823,0.078536,0.93803,0.102314,0.922281,0.064455,0.968669,0.050003,0.946433,0.066815,0.816103,0.061753,0.788935,0.053411,0.74106,0.056913,0.762632,0.037296,0.824537,0.034051,0.798328,0.029211,0.771794,0.023987,0.747514],"triangles":[61,60,14,61,19,60,60,19,59,60,59,14,59,58,17,59,8,58,57,20,56,57,56,14,57,55,20,57,14,55,55,17,54,55,54,3,52,46,34,52,6,46,53,34,45,53,45,7,44,42,18,44,13,42,42,40,27,43,28,40,42,13,40,43,40,13,39,38,13,43,13,38,39,4,38,43,38,28,38,37,28,45,29,36,44,18,36,45,36,7,44,36,13,52,34,35,53,35,34,53,7,35,52,35,6,50,29,34,45,34,29,46,12,34,50,34,12,51,33,30,48,30,33,50,33,29,51,4,33,50,12,33,48,33,12,48,32,30,47,30,32,49,32,31,49,5,32,47,32,5,48,12,32,32,12,31,46,31,12,46,6,31,39,29,4,33,4,29,39,13,29,36,29,13,54,17,28,40,28,17,37,3,28,54,28,3,58,27,17,40,17,27,41,18,27,42,27,18,58,8,27,41,27,8,56,2,26,61,26,9,61,14,26,56,26,14,24,15,22,24,22,1,23,21,15,23,10,21,55,3,20,56,20,2,61,9,19,59,19,8,36,18,7,55,14,17,59,17,14,24,16,15,23,15,16,25,11,16,24,1,16,25,16,1,23,16,10,26,15,9,21,9,15,22,15,2,26,2,15,25,0,11,16,11,10,25,1,0],"userEdges":[]}]},{"name":"D_HAIR_SIDE.01","display":[{"type":"mesh","name":"D_HAIR_SIDE.01","path":"shizuku_02","vertices":[-88.85,-172.54,24.54,-151.6,114.06,-105.18,126,-36.92,115.57,34.08,14.88,150.82,-127.6,158.78,-50.03,108.95,-50.04,-49.66,-85.86,-128.85,12.61,-99.72,-16.14,138.66,16.46,72.81,38.82,-2.96,48.69,-43.67,37.23,32.32,16.04,109.36,-37.53,154.39,-69.66,-93.02,-2.38,-24.61,115.36,-0.62,85.89,-19.83,62.01,-70.84,116.62,-72.68,-21.28,-72.64,27.06,-71.69,-59.93,-71.52,1.98,14.31,80.28,16.05,-12.26,51.66,118.25,71.03,72.56,52.84,-14.42,89.14,59.12,90.94,-30.63,-140.23,30.7,-127.41,-47.16,-117.4,-81.12,128.93,-35.23,121.92,51.42,128.27,57.33,137.6,-67.68,147.96,67.97,113.27,120.34,94.95,69.44,128.03,-28.31,147.61,-2.22,144.11,29.95,137.99,36.47,144.09,-11.49,152.61,68.46,71.9,75.26,33.17,76.78,-1.8,87.19,-40.31,-20.57,109.13,-14.28,70.64,-0.87,31.29,-9.09,-4.76,-10.32,-47.25,-151.88,145.67],"uvs":[0.450521,0.516927,0.5,0.546875,0.533854,0.613281,0.541667,0.710938,0.533854,0.8125,0.498698,0.980469,0.433594,0.990885,0.463542,0.916667,0.467448,0.692708,0.451823,0.579427,0.494792,0.621094,0.484188,0.955256,0.496464,0.867893,0.506226,0.759505,0.507606,0.702572,0.503574,0.809977,0.494327,0.921156,0.4729,0.984596,0.458891,0.63067,0.488247,0.728536,0.537672,0.762864,0.523837,0.735371,0.516349,0.662411,0.537574,0.659781,0.480003,0.659825,0.501097,0.661183,0.463133,0.661425,0.488195,0.784214,0.520408,0.786708,0.483931,0.837646,0.530142,0.866325,0.515084,0.840308,0.48201,0.889306,0.509219,0.892857,0.475924,0.563143,0.49748,0.58278,0.468711,0.595804,0.451536,0.946419,0.472554,0.933511,0.504615,0.94087,0.509505,0.958854,0.460794,0.97173,0.509826,0.923416,0.528025,0.89702,0.515625,0.940918,0.477766,0.971949,0.490698,0.966568,0.500069,0.957513,0.504196,0.969473,0.485717,0.982546,0.513667,0.867092,0.518275,0.811202,0.521822,0.761171,0.524565,0.706737,0.477267,0.918668,0.483049,0.864789,0.485875,0.808502,0.485317,0.756928,0.483606,0.696677,0.42,0.9745],"triangles":[48,47,46,48,40,47,49,46,45,49,5,46,48,46,5,47,11,46,49,45,17,46,11,45,44,43,42,43,33,42,44,42,39,45,41,17,45,11,41,44,39,40,47,40,39,42,16,39,47,39,11,54,38,16,54,7,38,41,11,37,38,37,11,38,7,37,59,6,37,41,37,6,35,34,10,36,10,34,35,1,34,36,34,9,50,33,30,43,30,33,42,33,16,50,12,33,54,16,32,55,32,12,55,7,32,54,32,7,51,15,31,50,30,31,50,31,12,51,31,4,31,30,4,56,29,15,55,12,29,52,28,20,51,28,15,51,4,28,52,13,28,56,15,27,57,27,13,25,24,14,58,14,24,26,24,18,26,8,24,58,24,8,25,10,24,53,22,14,25,14,22,23,2,22,53,3,22,23,22,3,25,22,10,53,14,21,52,20,21,52,21,13,53,21,3,28,4,20,21,20,3,58,19,14,57,13,19,58,8,19,24,10,18,36,18,10,36,9,18,41,6,17,39,16,11,38,11,16,33,12,16,32,16,12,31,15,12,29,12,15,28,13,15,27,15,13,21,14,13,19,13,14,35,10,2,22,2,10,34,0,9,35,2,1,34,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.03","display":[{"type":"mesh","name":"D_HAIR_TWIN.03","path":"shizuku_01","vertices":[-72.51,-133.33,109.94,-123.95,133.33,-32.83,119.3,62.31,95.91,133.33,-39.77,114.57,-133.33,38.19,-109.94,-40.87,-87.88,75.29,7.87,51.67,22.92,93.98,-0.58,2.84,125.28,21.74,11.77,-36.85,23.91,-86.25],"uvs":[0.670573,0.430339,0.695964,0.434896,0.699219,0.479167,0.697266,0.525391,0.69401,0.559896,0.67513,0.550781,0.662109,0.513672,0.665365,0.47526,0.668434,0.531698,0.681759,0.520222,0.683853,0.540776,0.680583,0.496495,0.698098,0.50568,0.682302,0.477215,0.683992,0.453212],"triangles":[14,7,13,14,13,2,13,7,11,12,11,9,12,2,11,13,11,2,10,9,8,10,3,9,12,9,3,11,6,9,9,6,8,10,8,5,14,0,7,11,7,6,10,5,4,10,4,3,14,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.02","display":[{"type":"mesh","name":"D_HAIR_TWIN.02","path":"shizuku_02","vertices":[-59.3,-145.66,-17.56,-98.97,3.31,-41.82,-6.18,14.52,-36.53,58.79,3.31,98.23,86.78,110.3,158.88,118.35,88.68,137.67,-4.28,136.86,-93.45,120.76,-125.7,75.69,-108.63,17.74,-78.27,-34.58,-72.58,-86.09,-44.65,-70.25,-50.25,-13.32,-62.28,43.23,-62.1,86.63],"uvs":[0.764334,0.530345,0.785922,0.586946,0.796791,0.656263,0.792033,0.724631,0.776507,0.77837,0.797102,0.826184,0.840098,0.840754,0.877225,0.850452,0.841135,0.873955,0.793282,0.873066,0.747348,0.853619,0.730646,0.798962,0.739306,0.728634,0.754815,0.665129,0.75763,0.602623,0.772044,0.621825,0.769284,0.690893,0.76322,0.759519,0.763406,0.812177],"triangles":[18,10,5,17,11,4,18,4,11,16,12,3,17,3,12,15,13,2,16,2,13,15,1,14,15,14,13,16,13,12,17,12,11,18,11,10,5,10,9,6,9,8,8,7,6,9,6,5,18,5,4,17,4,3,16,3,2,15,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.11","display":[{"type":"mesh","name":"D_HAIR_TWIN.11","path":"shizuku_02","vertices":[-88.89,-154.22,25.4,-141.66,50.79,-93.67,60.32,-39.02,38.1,23,9.52,73.96,15.87,112.35,133.33,141.15,-19.05,138.2,-130.16,112.35,-133.33,60.66,-98.41,3.07,-82.54,-53.05,-88.89,-112.86,-24.5,-129.09,-17.53,-72.85,-17.87,-18.29,-42.45,40.7,-51.05,90.61],"uvs":[0.693359,0.5,0.728516,0.516602,0.736328,0.580078,0.739258,0.652344,0.732422,0.734375,0.723633,0.801758,0.725586,0.852539,0.761719,0.890625,0.714844,0.886719,0.680664,0.852539,0.679688,0.78418,0.69043,0.708008,0.695313,0.633789,0.693359,0.554688,0.713165,0.533231,0.715311,0.607601,0.715205,0.679764,0.707646,0.757774,0.705001,0.823778],"triangles":[18,9,6,17,10,5,18,5,10,16,11,4,17,4,11,15,12,3,16,3,12,14,13,2,15,2,13,14,0,13,15,13,12,16,12,11,17,11,10,18,10,9,6,9,8,8,7,6,18,6,5,17,5,4,16,4,3,15,3,2,14,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.12","display":[{"type":"mesh","name":"D_HAIR_TWIN.12","path":"shizuku_02","vertices":[-119.52,-153.4,-54.92,-145.2,-28.13,-107.57,-21.83,-68.59,-17.1,-23.44,-10.8,14.18,11.26,58.64,56.96,94.89,112.11,100.37,164.1,99,131.01,120.89,64.84,128.41,15.99,116.78,-23.4,102.42,-69.1,74.37,-95.89,25.12,-116.37,-34.39,-121.1,-88.42,-124.25,-131.52,-39,43.3,-6.07,80.53,-53.02,-1.3,-68.63,-51.65,-76.67,-97.57],"uvs":[0.604492,0.581055,0.644531,0.592773,0.661133,0.646484,0.665039,0.702148,0.667969,0.766602,0.671875,0.820313,0.685547,0.883789,0.713867,0.935547,0.748047,0.943359,0.780273,0.941406,0.759766,0.972656,0.71875,0.983398,0.688477,0.966797,0.664063,0.946289,0.635742,0.90625,0.619141,0.835938,0.606445,0.750977,0.603516,0.673828,0.601563,0.612305,0.654397,0.861881,0.674805,0.915039,0.645708,0.798212,0.63603,0.726322,0.631048,0.660762],"triangles":[23,2,18,22,3,17,23,17,3,21,4,16,22,16,4,19,5,15,21,15,5,20,6,14,19,14,6,20,13,7,23,18,17,22,17,16,21,16,15,19,15,14,20,14,13,7,13,12,7,12,11,7,11,10,10,9,8,10,8,7,20,7,6,19,6,5,21,5,4,22,4,3,23,3,2,18,2,1,18,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.13","display":[{"type":"mesh","name":"D_HAIR_TWIN.13","path":"shizuku_02","vertices":[-45.94,-146.74,18.33,-124.64,64.74,-80.45,104.02,-29.35,132.58,21.75,141.51,72.16,121.87,112.21,59.39,134.99,-44.16,139.83,-42.37,117.73,32.61,91.49,59.39,47.3,34.39,-6.56,-1.31,-56.28,-40.59,-99.79,-104.86,135.46,-141.75,114.28],"uvs":[0.893555,0.585938,0.928711,0.617188,0.954102,0.679688,0.975586,0.751953,0.991211,0.824219,0.996094,0.895508,0.985352,0.952148,0.951172,0.984375,0.894531,0.991211,0.895508,0.959961,0.936523,0.922852,0.951172,0.860352,0.9375,0.78418,0.917969,0.713867,0.896484,0.652344,0.861328,0.985026,0.841146,0.955078],"triangles":[9,16,15,2,14,13,3,13,12,4,12,11,5,11,10,7,10,9,15,8,9,9,8,7,10,7,6,10,6,5,11,5,4,12,4,3,13,3,2,14,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.14","display":[{"type":"mesh","name":"D_HAIR_TWIN.14","path":"shizuku_02","vertices":[-133.33,-154.13,-62.37,-151.56,-8.6,-112.09,43.01,-59.76,83.87,-6.56,129.03,56.07,133.33,101.54,90.32,136.71,2.15,138.43,-68.82,112.69,-62.37,90.39,10.75,101.54,55.91,89.53,51.61,50.92,-6.45,-9.14,-58.06,-61.47,-116.13,-118.1,53.76,116.98,-32.31,112.77],"uvs":[0.773438,0.507813,0.816406,0.511719,0.848958,0.571615,0.880208,0.651042,0.904948,0.731771,0.932292,0.826823,0.934896,0.895833,0.908854,0.949219,0.855469,0.951823,0.8125,0.91276,0.816406,0.878906,0.860677,0.895833,0.888021,0.877604,0.885417,0.81901,0.85026,0.727865,0.81901,0.648438,0.783854,0.5625,0.886719,0.919271,0.834602,0.912871],"triangles":[18,8,11,11,8,17,17,6,12,2,16,15,3,15,14,4,14,13,5,13,12,17,12,11,18,11,10,18,10,9,18,9,8,17,8,7,17,7,6,12,6,5,13,5,4,14,4,3,15,3,2,16,2,1,16,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.15","display":[{"type":"mesh","name":"D_HAIR_TWIN.15","path":"shizuku_02","vertices":[-124.49,-153.6,-30.3,-154.72,16.53,-130.3,29.75,-92.4,36.36,-41.88,29.75,19.59,20.94,79.38,25.34,118.11,62.81,147.59,133.33,148.43,73.83,168.64,-20.94,166.11,-78.24,140.01,-95.87,95.38,-82.64,33.06,-65.01,-34.3,-76.03,-92.4,-133.33,-126.09,-58.4,-132.82,-16.83,-63.85,-23.63,-4.1,-30.32,56.46,-36.52,106.51,-20.41,-115.18,-18.73,-92.4,-17.12,-37.88,-24.3,26.07,-36.54,87.25,-0.51,144.92,-23.38,128.41,25.89,155.75],"uvs":[0.507826,0.49913,0.563478,0.497391,0.591146,0.535156,0.598958,0.59375,0.602865,0.671875,0.598958,0.766927,0.59375,0.859375,0.596354,0.919271,0.61849,0.964844,0.660156,0.966146,0.625,0.997396,0.56901,0.99349,0.535156,0.953125,0.52474,0.884115,0.532552,0.78776,0.542969,0.683594,0.536458,0.59375,0.502604,0.541667,0.546875,0.53125,0.571438,0.637911,0.56742,0.730294,0.563467,0.823937,0.559803,0.901327,0.569323,0.558538,0.570313,0.59375,0.571267,0.678057,0.567022,0.776946,0.559789,0.87155,0.581082,0.960725,0.567569,0.935195,0.596676,0.977473],"triangles":[30,8,28,29,12,28,30,28,11,29,28,7,24,3,23,24,23,16,29,22,12,27,22,6,29,7,22,27,13,22,26,21,5,27,21,13,27,6,21,26,14,21,26,5,20,25,15,20,26,20,14,25,20,4,25,4,19,24,16,19,25,19,15,24,19,3,30,10,8,23,2,18,23,18,16,18,0,17,18,17,16,19,16,15,20,15,14,21,14,13,22,13,12,28,12,11,30,11,10,10,9,8,28,8,7,22,7,6,21,6,5,20,5,4,19,4,3,23,3,2,18,2,1,18,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.01","display":[{"type":"mesh","name":"D_HAIR_TWIN.01","path":"shizuku_01","vertices":[-68.28,-112.72,151.09,-135.68,118.18,-37.6,90.76,64.66,30.44,135.61,-128.6,91.79,-95.7,-6.29,-34.55,80.16,-111.86,41.87,-4.55,28.39,19.94,-23.22,105.21,10.79,-83.25,-54.61,26.82,-74.41,60.42,-126.19,135.09,-87.99],"uvs":[0.616211,0.441406,0.655273,0.430664,0.649414,0.476563,0.644531,0.524414,0.633789,0.557617,0.605469,0.537109,0.611328,0.491211,0.622217,0.531666,0.608451,0.513749,0.627559,0.507441,0.63192,0.483291,0.647104,0.499204,0.613545,0.468602,0.633144,0.459336,0.639129,0.435104,0.652425,0.45298],"triangles":[15,14,13,15,1,14,15,13,2,14,0,13,13,12,10,13,0,12,11,10,9,12,6,10,11,2,10,13,10,2,11,9,3,10,6,9,9,8,7,9,6,8,8,5,7,9,7,3,7,5,4,7,4,3],"userEdges":[]}]},{"name":"D_HAIR_TWIN.00","display":[{"type":"mesh","name":"D_HAIR_TWIN.00","path":"shizuku_02","vertices":[88.14,-141.13,92.66,-103.68,79.1,-62.57,106.21,-11.42,133.33,39.73,119.77,97.28,61.02,135.64,-133.33,166.7,-88.14,126.51,-51.98,70.79,-51.98,15.07,-106.21,-53.44,-47.46,-120.12,-74.99,-88.88,9.8,106.25,39.4,55.47,-74.65,-13.57,-3.46,-33.11,-25.38,130.35,33.79,84.02,54.23,29.2],"uvs":[0.71875,0.059896,0.720052,0.113281,0.716146,0.171875,0.723958,0.244792,0.731771,0.317708,0.727865,0.39974,0.710938,0.454427,0.654948,0.498698,0.667969,0.441406,0.678385,0.361979,0.678385,0.282552,0.66276,0.184896,0.679688,0.089844,0.671757,0.134379,0.696184,0.412527,0.704711,0.340148,0.671853,0.241722,0.692362,0.213867,0.686047,0.446885,0.703093,0.380835,0.708982,0.302701],"triangles":[17,16,3,17,11,16,20,10,15,19,5,15,20,15,4,19,15,9,19,14,5,18,14,8,19,9,14,18,6,14,1,12,13,13,11,2,17,2,11,16,10,3,20,3,10,15,10,9,14,9,8,18,8,7,18,7,6,14,6,5,15,5,4,20,4,3,17,3,2,13,2,1,12,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.04","display":[{"type":"mesh","name":"D_HAIR_TWIN.04","path":"shizuku_02","vertices":[11.17,-118.92,10.14,-102.21,44.63,-71.54,18.34,-24.57,53.67,18.4,133.33,59.41,126.99,109.42,64.34,145.39,-32.92,157.24,-100.43,152.93,-133.33,130.1,-64.73,130.67,0.36,114.84,16.92,72.62,-17.99,35.31,-76.24,-7.63,-88.51,-58.14,-23.91,-107.86,-13.7,-130.54,70.8,90.64,50.2,46.17,-5.5,6.54,-16.18,135.91,-31.64,-40.27,-54.76,-84.12,71.49,66.43,62.88,112.17,26.02,127.09,-83.12,142.14],"uvs":[0.621094,0.008789,0.625,0.064453,0.607422,0.130859,0.601563,0.205078,0.624023,0.270508,0.666992,0.331055,0.670898,0.40918,0.646484,0.467773,0.602539,0.490234,0.570313,0.486328,0.551758,0.452148,0.583984,0.450195,0.612305,0.422852,0.614258,0.356445,0.592773,0.299805,0.55957,0.235352,0.546875,0.157227,0.570313,0.077148,0.597656,0.030273,0.641983,0.382258,0.626216,0.313886,0.594671,0.254497,0.607451,0.456342,0.575982,0.182695,0.55912,0.115388,0.638981,0.344542,0.641231,0.416102,0.626013,0.440869,0.576943,0.468804],"triangles":[27,7,26,27,26,12,27,22,7,27,12,22,25,20,13,25,5,20,25,19,5,26,19,12,25,13,19,26,6,19,24,2,17,24,16,2,23,2,16,23,15,3,21,3,15,21,14,4,20,4,14,22,11,8,28,8,11,1,18,17,23,16,15,21,15,14,20,14,13,19,13,12,22,12,11,28,11,10,28,10,9,28,9,8,22,8,7,26,7,6,19,6,5,20,5,4,21,4,3,23,3,2,17,2,1,18,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.05","display":[{"type":"mesh","name":"D_HAIR_TWIN.05","path":"shizuku_02","vertices":[113.58,-163.03,108.64,-92.92,54.32,-17.53,24.69,51.25,34.57,100.19,133.33,125.32,29.63,134.58,-74.07,121.35,-133.33,73.74,-118.52,-5.63,-64.2,-78.37,4.94,-140.54,-7.6,-49.32,48.88,-120.36,-47.9,22.42],"uvs":[0.81913,0.10087,0.817391,0.193043,0.798261,0.292174,0.787826,0.382609,0.791304,0.446957,0.826087,0.48,0.789565,0.492174,0.753043,0.474783,0.732174,0.412174,0.737391,0.307826,0.756522,0.212174,0.78087,0.130435,0.776455,0.250379,0.796346,0.156966,0.762261,0.344702],"triangles":[13,10,1,12,1,10,12,9,2,14,2,9,14,8,3,13,0,11,13,11,10,12,10,9,14,9,8,4,8,7,4,7,6,6,5,4,8,4,3,14,3,2,12,2,1,13,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.06","display":[{"type":"mesh","name":"D_HAIR_TWIN.06","path":"shizuku_02","vertices":[25.83,-125.3,21,-87.97,20.41,-29.4,22.03,30.47,41.46,88.41,130.07,124.53,85.42,140.59,-14.7,143.08,-105.73,126.27,-134.34,95.34,-109.41,50.31,-79.94,-4.38,-54.94,-57.14,-50.12,-93.83,-34.29,-118.92,23.34,120.58,-43.2,101.86,-42.88,69.67],"uvs":[0.955078,0.099609,0.953125,0.15625,0.953125,0.245117,0.954102,0.335938,0.962891,0.423828,1.001953,0.478516,0.982422,0.50293,0.938477,0.506836,0.898438,0.481445,0.885742,0.43457,0.896484,0.366211,0.90918,0.283203,0.919922,0.203125,0.921875,0.147461,0.928711,0.109375,0.955078,0.472656,0.925781,0.444336,0.925781,0.395508],"triangles":[3,10,17,17,16,4,17,9,16,16,8,15,16,15,4,1,14,13,1,13,12,2,12,11,3,11,10,17,10,9,16,9,8,15,8,7,15,7,6,15,6,5,15,5,4,17,4,3,11,3,2,12,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.07","display":[{"type":"mesh","name":"D_HAIR_TWIN.07","path":"shizuku_02","vertices":[90.91,-142.99,127.41,-88.66,130.45,7.14,90.91,97.22,-6.41,138.69,-109.82,138.69,-143.28,111.52,-58.12,110.09,-0.33,72.92,30.08,-0.01,51.37,-87.23,86.58,-45.22,58.78,43.19,5.83,104.57,90.38,-87.96,82.67,3.74,36.37,82.69,-33.94,123.46,-76.6,120.31],"uvs":[0.652174,0.026087,0.718261,0.005217,0.834783,0.003478,0.944348,0.026087,0.994783,0.081739,0.994783,0.14087,0.961739,0.16,0.96,0.111304,0.914783,0.078261,0.826087,0.06087,0.72,0.048696,0.771096,0.028567,0.878626,0.044463,0.953284,0.074738,0.719108,0.026392,0.830643,0.030803,0.926674,0.057277,0.976265,0.097479,0.972434,0.121873],"triangles":[18,5,17,18,17,7,17,4,13,16,8,13,17,13,7,16,13,3,16,3,12,15,9,12,16,12,8,15,12,2,15,11,9,14,11,1,15,2,11,14,10,11,14,0,10,11,10,9,12,9,8,13,8,7,18,7,6,18,6,5,17,5,4,13,4,3,12,3,2,11,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.08","display":[{"type":"mesh","name":"D_HAIR_TWIN.08","path":"shizuku_02","vertices":[41.06,-154.1,35.32,-113.1,49.54,-63.58,73.92,-8.85,118.61,41.53,138.93,83.23,120.64,121.45,65.79,127.53,-7.34,152.73,-90.63,157.94,-137.35,130.14,-64.22,129.27,-3.28,101.47,21.1,53.69,0.79,-0.17,-27.65,-50.55,-58.12,-100.94,-37.81,-155.66,73.92,91.92,51.57,23.29,-2.7,-135.23,-1.26,-81.21,23.3,-29.63,-5.34,127.47,-4.85,-107.87,12.68,-57.36,41.33,-4.98,65.1,48.21],"uvs":[0.539063,0.016927,0.533854,0.088542,0.542969,0.16276,0.558594,0.244792,0.58724,0.320313,0.60026,0.382813,0.588542,0.440104,0.553385,0.449219,0.50651,0.486979,0.453125,0.494792,0.423177,0.453125,0.470052,0.451823,0.509115,0.410156,0.52474,0.338542,0.511719,0.257813,0.49349,0.182292,0.473958,0.106771,0.486979,0.02474,0.558594,0.395833,0.544271,0.292969,0.509485,0.055372,0.510404,0.13634,0.52615,0.213646,0.507793,0.44913,0.508103,0.096379,0.519341,0.172087,0.537708,0.250593,0.55294,0.330317],"triangles":[26,22,14,25,22,2,25,15,22,26,3,22,25,21,15,24,21,1,24,16,21,25,2,21,24,20,16,24,1,20,26,14,19,26,19,3,27,4,19,27,19,13,27,18,4,27,13,18,18,12,7,23,7,12,23,11,8,20,0,17,20,17,16,21,16,15,22,15,14,19,14,13,18,13,12,23,12,11,11,10,9,11,9,8,23,8,7,18,7,6,18,6,5,18,5,4,19,4,3,22,3,2,21,2,1,20,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.09","display":[{"type":"mesh","name":"D_HAIR_TWIN.09","path":"shizuku_02","vertices":[112.48,-152.51,133.33,-137.63,118.63,-94.27,78.74,-47.42,43.04,-3.36,19.95,44.2,13.65,87.56,45.14,114.13,97.64,139.31,17.85,142.11,-55.64,128.12,-133.33,96.65,-122.83,45.6,-80.84,-1.96,-38.85,-46.02,3.15,-95.67,45.14,-147.42,-53.24,66.99,-26.45,22.95,3.3,-24.06,42.72,-70.41,83.36,-119.78,-19.06,106.71,98.69,-141.48,63.89,-94.94,20.32,-46.72,-15.75,-2.69,-42.81,44.81,-45.21,91.2,-0.48,120.47,30.78,128.86],"uvs":[0.90918,0.080078,0.919922,0.112305,0.913086,0.172852,0.894531,0.238281,0.87793,0.299805,0.867188,0.366211,0.864258,0.426758,0.878906,0.463867,0.90332,0.499023,0.866211,0.50293,0.832031,0.483398,0.795898,0.439453,0.800781,0.368164,0.820313,0.301758,0.839844,0.240234,0.859375,0.170898,0.878906,0.098633,0.833148,0.398041,0.845608,0.336539,0.859446,0.270895,0.87778,0.206175,0.896682,0.137232,0.849046,0.453495,0.903809,0.106934,0.887622,0.171926,0.867362,0.239252,0.850584,0.300732,0.838002,0.367069,0.836882,0.431842,0.857688,0.472708,0.872225,0.484425],"triangles":[30,29,9,30,7,29,29,7,22,28,11,22,28,22,6,29,22,10,23,21,1,24,21,15,23,16,21,24,2,21,24,20,2,25,20,14,24,15,20,25,3,20,25,19,3,26,19,13,25,14,19,26,4,19,26,18,4,27,18,12,26,13,18,27,5,18,27,17,5,28,17,11,27,12,17,28,6,17,23,0,16,21,16,15,20,15,14,19,14,13,18,13,12,17,12,11,22,11,10,29,10,9,30,9,8,30,8,7,22,7,6,17,6,5,18,5,4,19,4,3,20,3,2,21,2,1,23,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.10","display":[{"type":"mesh","name":"D_HAIR_TWIN.10","path":"shizuku_02","vertices":[25.62,-150.51,134.82,-147.54,115.68,-131.8,43.21,-114.96,-6.12,-91.83,-47.49,-85.33,-41.84,-114.29,-7.95,-138.86,64.59,-137,15.2,-128.12,-16.27,-102.62],"uvs":[0.038574,0.466797,0.086426,0.471191,0.078125,0.495117,0.045898,0.521484,0.024902,0.556152,0.004883,0.565918,0.010742,0.522461,0.023438,0.484863,0.055664,0.487305,0.033541,0.501336,0.01879,0.54161],"triangles":[10,3,6,9,6,3,9,8,7,9,3,8,8,0,7,9,7,6,10,6,5,10,5,4,10,4,3,8,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_HAIR_BACK.00","display":[{"type":"mesh","name":"D_HAIR_BACK.00","path":"shizuku_02","vertices":[-6.8,-166.63,54.47,-165.66,126.13,-136.27,154.57,-67.37,152.79,22.85,118.35,85.24,64.19,120.29,48.73,139.82,7.42,150.42,-48.93,141.75,-70.25,118.62,-122.49,87.06,-154.5,21.29,-161.6,-63.63,-132.06,-134.34,-76.82,-164.7,-2.42,107.06,47.9,57.91,94.95,12.62,-61.5,64.65,-107.45,10.69,-103.08,-55.8,-4.61,35.74,-51.66,-6.66,35.87,-5.69,69.78,-72.19,-2.42,-73.15,-58.22,-77,-115.11,-96.28,101.51,-103.99,34.77,-118.44,-45.09,-124.22,124.08,-25.31,-130.13,-15.24,-100.03,-130.61,-132.33,-59.72,-130.44,15.87,-116.54,56.86,-141.15,48.71,-96.06,77.35,-61.57,-145.25,-32.51,-138.15,-3.38,-121.2,20.02,-135.54,74.25,-139.73,96.18,-148.56,114.87,-121.51,135.97,-112.44,43.64,-139.7,-147.73,-42.31,-143.26,4.44,-157.9,-19.39,-143.42,18.79,-147.77,35.11,-138.13,39.46,-130.37,52.28,-133.49,64.44,-119.67,72.72,79.91,70.33,105.8,46.3,121.53,17.32,72.4,34.33,34.08,114.31,56.68,91.52],"uvs":[0.238261,0.001739,0.335652,0.003478,0.452174,0.053913,0.492174,0.18087,0.493913,0.333913,0.452174,0.44,0.368696,0.507826,0.330435,0.554783,0.26087,0.573913,0.163478,0.558261,0.137391,0.516522,0.06087,0.455652,0.003478,0.34087,0,0.189565,0.041739,0.062609,0.126957,0.005217,0.245217,0.495652,0.325217,0.406957,0.4,0.325217,0.151304,0.41913,0.078261,0.321739,0.085217,0.201739,0.241739,0.366957,0.166957,0.290435,0.306087,0.292174,0.36,0.172174,0.245217,0.170435,0.156522,0.163478,0.066087,0.128696,0.410435,0.114783,0.304348,0.088696,0.177391,0.078261,0.443711,0.256765,0.042207,0.274949,0.091707,0.068374,0.042613,0.195653,0.041722,0.331086,0.067745,0.402708,0.027404,0.388721,0.100053,0.439828,0.151189,0.040313,0.197386,0.053125,0.243695,0.08371,0.280897,0.057839,0.367096,0.050279,0.403475,0.032834,0.433088,0.081746,0.466011,0.097832,0.318443,0.050326,0.018598,0.227188,0.021342,0.310463,0.001812,0.268389,0.021082,0.336366,0.015535,0.364983,0.031437,0.372487,0.045073,0.394847,0.041135,0.416183,0.064134,0.430517,0.382911,0.421973,0.424199,0.378455,0.443165,0.329214,0.364155,0.364397,0.31287,0.502322,0.348639,0.461294],"triangles":[63,17,62,63,62,6,60,59,4,61,58,59,60,18,59,61,59,18,63,6,58,59,58,5,61,17,58,63,58,17,57,55,56,57,56,11,57,37,55,56,55,38,55,37,54,55,54,38,54,52,53,54,53,38,54,36,52,53,52,12,52,36,50,51,50,49,51,12,50,52,50,12,50,33,49,51,49,13,47,2,46,47,46,29,46,45,44,46,2,45,48,30,44,46,44,29,45,1,44,48,44,1,48,1,43,48,43,30,43,41,42,43,42,30,42,41,31,43,0,41,41,0,40,41,40,31,57,39,37,57,11,39,39,19,37,54,37,36,50,36,33,37,20,36,49,33,35,49,35,13,40,15,34,40,34,31,36,20,33,35,33,21,60,4,32,60,32,18,34,28,31,42,31,26,44,30,29,42,26,30,47,29,3,30,25,29,31,28,27,34,14,28,35,28,13,35,21,28,28,21,27,31,27,26,27,23,26,23,24,26,30,26,25,26,24,25,32,25,18,32,3,25,29,25,3,25,24,18,61,18,24,61,24,17,27,21,23,24,23,22,23,19,22,24,22,17,33,20,21,23,21,20,37,19,20,23,20,19,39,10,19,22,19,16,22,16,17,62,17,16,19,10,16,62,16,7,40,0,15,34,15,14,28,14,13,39,11,10,16,10,9,16,9,8,16,8,7,62,7,6,58,6,5,59,5,4,32,4,3,43,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.13","display":[{"type":"mesh","name":"D_CLOTHES.13","path":"shizuku_01","vertices":[32.55,-158.8,76.4,-131.65,95.57,-78.03,105.28,-14.22,111.03,47.56,127.32,97.95,115.07,135.22,35.68,150.64,-57.92,142.75,-96.6,117.15,-137.39,63.13,-141.3,-4.73,-139.35,-70.83,-114.92,-110.83,-44.51,-155.02,31.64,120.35,-15.18,77.15,-1.58,25.14,-14.68,-31.01,-23.32,-95.63,-8.42,-4.2],"uvs":[0.295573,0.309896,0.329427,0.356771,0.334635,0.442708,0.342448,0.545573,0.352865,0.647135,0.363281,0.729167,0.354167,0.809896,0.303385,0.821615,0.244792,0.802083,0.220052,0.760417,0.209635,0.671875,0.200521,0.5625,0.192708,0.454427,0.208333,0.389323,0.255208,0.326823,0.302083,0.765625,0.272135,0.695313,0.27474,0.611979,0.268229,0.505208,0.266927,0.414063,0.271338,0.556197],"triangles":[14,19,1,19,12,18,19,18,2,20,3,18,20,18,11,20,11,17,20,17,3,17,16,4,17,10,16,16,9,15,16,15,5,19,14,13,19,13,12,18,12,11,17,11,10,16,10,9,15,9,8,15,8,7,15,7,6,15,6,5,16,5,4,17,4,3,18,3,2,19,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.30","display":[{"type":"mesh","name":"D_HAIR_TWIN.30","path":"shizuku_01","vertices":[-0.7,-144.64,116.64,-99.99,156.31,47.83,112.95,130.55,-24.52,114.3,-127.7,22.79,-106.1,-107.36,-15.96,-19.8,83.29,33.51],"uvs":[0.455078,0.754557,0.507161,0.742839,0.555339,0.770833,0.552734,0.818359,0.50651,0.839193,0.44987,0.832682,0.432943,0.783203,0.477214,0.791667,0.520182,0.788411],"triangles":[8,7,4,8,1,7,7,0,6,7,6,5,7,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.14","display":[{"type":"mesh","name":"D_CLOTHES.14","path":"shizuku_01","vertices":[-116.28,-135.59,-49.18,-131.75,32.44,-85.88,103.95,-61.89,167.78,-24.19,182.77,95.42,134.64,158.2,74.9,158.92,-5.46,91.39,-77.66,71.82,-112.59,-2.82,131.16,86.48,52.26,28.9,-30.94,7.36,-95.45,-30.04,-64.92,-25.64,14.09,-3.49,94.42,53.64,-11.99,-103.64,0.01,-38.2,66.57,-73.21,41.55,-33.1,81.2,-10.49,125.04,33.69,133.27,-44.27,34.84,121.88,63.33,92.46,105.46,114.5,23.15,56.79,-36.92,79.25,-17.5,52.68,-55,31.77,-83.57,-143.46,-72.76,-81.28,-39.72,-66.52,-117.31,-53.88,-107.96,-84.84,154.88,103.5,179.68,67.69,168.64,132.66],"uvs":[0.001739,0.878261,0.097391,0.864348,0.217391,0.852174,0.335652,0.84,0.429565,0.873043,0.452174,0.949565,0.410435,0.982609,0.32,0.993043,0.198261,0.987826,0.090435,0.986087,0.024348,0.968696,0.382609,0.925217,0.265497,0.918218,0.146236,0.92414,0.049947,0.936867,0.093605,0.9306,0.208131,0.917836,0.327683,0.917924,0.152381,0.858769,0.181005,0.888976,0.266915,0.847076,0.239512,0.882543,0.298205,0.881751,0.365137,0.893509,0.377858,0.85485,0.259547,0.990453,0.292137,0.954791,0.35539,0.954705,0.231652,0.953258,0.1503,0.987053,0.173219,0.957171,0.116478,0.957175,0.043396,0.872202,0.072486,0.902415,0.120494,0.892628,0.014944,0.931079,0.024313,0.905703,0.417113,0.937294,0.442476,0.916743,0.43044,0.966771],"triangles":[38,4,37,39,37,6,39,5,37,38,37,5,36,35,14,36,0,35,36,14,32,33,32,14,33,1,32,36,32,0,30,13,29,31,29,13,31,9,29,30,29,8,26,12,25,28,25,12,28,8,25,26,25,7,24,23,4,24,3,23,21,12,20,22,20,12,22,3,20,21,20,2,34,13,18,19,18,13,19,2,18,34,18,1,23,17,11,27,11,17,22,12,17,26,17,12,23,3,17,22,17,3,26,7,17,27,17,7,21,16,12,28,12,16,19,13,16,30,16,13,21,2,16,19,16,2,30,8,16,28,16,8,34,15,13,31,13,15,33,14,15,34,1,15,33,15,1,31,15,9,35,10,14,15,14,9,23,11,4,37,4,11,37,11,6,27,6,11,14,10,9,27,7,6],"userEdges":[]}]},{"name":"D_CLOTHES.15","display":[{"type":"mesh","name":"D_CLOTHES.15","path":"shizuku_01","vertices":[82.93,-106,115.14,-21.06,133.33,85.49,121.58,146.56,25.28,115.48,-51.18,95.98,-93.69,14.78,-130.95,-65.08,-133.33,-122.56,-56.54,-138.75,-76.64,-69.56,-10.62,17.86,44.01,-57.12,67.36,50.01,-26.17,-64.26],"uvs":[0.377604,0.182943,0.409505,0.164714,0.453125,0.151042,0.479167,0.154297,0.470703,0.203776,0.466146,0.242839,0.434245,0.267578,0.399089,0.298177,0.375651,0.294922,0.371745,0.246094,0.397786,0.257813,0.431641,0.225911,0.397786,0.201823,0.441406,0.185547,0.398093,0.237216],"triangles":[13,1,12,13,12,11,14,11,12,14,12,9,13,11,4,14,10,11,11,10,6,14,9,10,12,0,9,10,9,8,10,8,7,10,7,6,11,6,5,11,5,4,13,4,3,13,3,2,13,2,1,12,1,0],"userEdges":[]}]},{"name":"D_HAND.07","display":[{"type":"mesh","name":"D_HAND.07","path":"shizuku_00","vertices":[122.95,-169.04,-5.89,-97.49,-155.18,23.02,-79.51,135.99,51.37,98.33,141.35,41.85,-49.86,41.96,84.11,-23.96,23.99,4.69,132.76,-56.55,-117.73,78.93,-27.02,120.89,-72.06,-44.07,101.12,67.1,68.42,-138.76],"uvs":[0.51888,0.630208,0.477865,0.642578,0.430339,0.663411,0.454427,0.682943,0.496094,0.676432,0.52474,0.666667,0.463866,0.666687,0.506516,0.65529,0.487376,0.660243,0.522006,0.649656,0.442261,0.673078,0.471139,0.680331,0.456798,0.651813,0.511931,0.671033,0.501522,0.635443],"triangles":[9,7,5,13,5,7,14,1,7,8,7,1,9,0,7,14,7,0,8,4,7,13,7,4,8,6,4,11,4,6,12,2,6,10,6,2,8,1,6,12,6,1,10,3,6,11,6,3],"userEdges":[]}]},{"name":"D_HAND.06","display":[{"type":"mesh","name":"D_HAND.06","path":"shizuku_00","vertices":[-157.73,-105.85,-36.84,-125,102.5,-137.77,168.07,-99.47,159.87,50.51,92.25,120.71,-20.31,132.17,-129.05,56.89,77.91,-22.88,-47.08,-19.69,-96.53,-58.2,-144.77,-32.35,-95.53,-115.71,40.44,-132.08,9.21,-84.02,128.06,-65.49,164.92,-41.91,92.94,-93.09,23.66,62.76,12.45,-21.21,32.23,126.82,85.95,57.66,110.38,6.19,-73.63,95.26,-30.72,73.14,-86.66,17.29],"uvs":[0.399414,0.53125,0.457031,0.525391,0.523438,0.521484,0.554688,0.533203,0.550781,0.579102,0.518555,0.600586,0.466797,0.603516,0.413086,0.581055,0.511719,0.556641,0.452148,0.557617,0.428581,0.545833,0.405589,0.553746,0.429061,0.528235,0.49386,0.523224,0.478976,0.537931,0.535621,0.543603,0.553188,0.55082,0.51888,0.535156,0.486907,0.582531,0.48052,0.557152,0.490955,0.602148,0.515553,0.58129,0.527192,0.565538,0.44046,0.592502,0.461104,0.585677,0.433287,0.568934],"triangles":[24,9,23,25,23,9,25,7,23,24,23,6,22,21,4,22,8,21,21,18,5,20,5,18,19,9,18,24,18,9,24,6,18,20,18,6,21,8,18,19,18,8,16,15,4,22,4,15,17,15,2,16,3,15,17,8,15,22,15,8,19,14,9,19,8,14,14,8,13,17,13,8,17,2,13,14,13,1,12,10,1,11,7,10,25,10,7,12,0,10,11,10,0,25,9,10,10,9,1,14,1,9,21,5,4,15,3,2],"userEdges":[]}]},{"name":"D_HAND.08","display":[{"type":"mesh","name":"D_HAND.08","path":"shizuku_00","vertices":[69.96,-158.27,-94.94,-40.39,-198.72,166.85,-92.52,164.81,-9.55,75.06,149.47,-32.63,30.07,-41.2,-90.98,79.18,-8.37,-102.28,67.3,23.02,-140.3,50.18,-51.32,18.59],"uvs":[0.658203,0.37793,0.613281,0.40625,0.581055,0.448242,0.612305,0.448242,0.635742,0.428711,0.680664,0.405273,0.646934,0.403407,0.612738,0.429607,0.636866,0.391381,0.657452,0.417384,0.599197,0.424602,0.624756,0.417725],"triangles":[10,2,7,11,7,4,11,1,7,10,7,1,9,5,6,8,1,6,11,6,1,8,6,0,11,4,6,9,6,4,6,5,0,7,3,4,7,2,3],"userEdges":[]}]},{"name":"D_HAND.09","display":[{"type":"mesh","name":"D_HAND.09","path":"shizuku_00","vertices":[-166.29,149.53,-67.73,-27.18,82.15,-154.28,154.01,-5.48,14.39,81.33,-63.63,161.93,44.16,-22.18,-65.36,82.03,116.1,-83.98,-20.86,34.76,-104.17,157.04,8.8,-92.08,76.77,42.55,-108.66,46.21,-29.09,126.25],"uvs":[0.585286,0.507161,0.616536,0.470052,0.664063,0.443359,0.686849,0.474609,0.642578,0.492839,0.617839,0.509766,0.652017,0.471101,0.617288,0.492985,0.674828,0.458123,0.631401,0.483059,0.604985,0.508737,0.640805,0.456422,0.662356,0.484695,0.603558,0.485464,0.62879,0.502272],"triangles":[10,7,0,13,0,7,14,4,7,9,7,4,9,1,7,13,7,1,10,5,7,14,7,5,9,6,1,11,1,6,12,3,6,8,6,3,8,2,6,11,6,2,9,4,6,12,6,4],"userEdges":[]}]},{"name":"D_HAND.10","display":[{"type":"mesh","name":"D_HAND.10","path":"shizuku_00","vertices":[-172.41,92.67,-30.45,-80.3,111.51,-155.98,179.4,11.59,34.35,76.45,-64.4,152.12,-51.42,63.23,70.7,-33.04,144.51,-74.51,7.46,11.4,-106.21,129.11,-91.89,-5.44,44.33,-120.17,94.58,49.52,-12.59,112.43,-105.69,76.43,-41.22,-6.6,20.96,-56.28,92.01,-97.23,123.09,-11.53,51.95,23.43,-3.2,70.66,-59.07,115.63],"uvs":[0.578125,0.547852,0.623047,0.516602,0.667969,0.50293,0.689453,0.533203,0.643555,0.544922,0.612305,0.558594,0.616413,0.542532,0.655056,0.525139,0.678414,0.517647,0.635044,0.53317,0.599075,0.554436,0.603605,0.530127,0.646712,0.509399,0.662612,0.540056,0.628698,0.551422,0.599238,0.544918,0.619641,0.529917,0.639316,0.520941,0.661798,0.513544,0.671633,0.529026,0.649124,0.535343,0.63167,0.543876,0.613991,0.552],"triangles":[21,6,14,22,14,6,22,5,14,21,14,4,19,7,13,20,13,7,20,4,13,19,13,3,17,7,12,18,12,7,18,2,12,17,12,1,15,6,11,16,11,6,16,1,11,15,11,0,22,6,10,15,10,6,15,0,10,22,10,5,21,9,6,16,6,9,20,7,9,17,9,7,21,4,9,20,9,4,17,1,9,16,9,1,19,8,7,18,7,8,19,3,8,18,8,2],"userEdges":[]}]},{"name":"D_HAND.11","display":[{"type":"mesh","name":"D_HAND.11","path":"shizuku_00","vertices":[-155.43,57.21,-36.32,-83.34,104.99,-169.77,166.86,-4.5,28.49,53.78,-57.34,112.05,-49.48,38.98,61.12,-53.78,134.04,-78.14,-0.28,-7.09,-88.11,94.85,-89.84,-20.19,39.69,-130.95,86.25,29.45,-20.71,87.19,-89.41,45.85,-43.26,-18.81,16.13,-67.43,83.68,-113.42,114.41,-28.94,44.12,2.26,-10.45,46.39],"uvs":[0.597656,0.585449,0.630859,0.56543,0.66748,0.553711,0.6875,0.57666,0.648926,0.584961,0.625,0.593262,0.627191,0.582852,0.658022,0.569641,0.67835,0.566171,0.640906,0.576291,0.616423,0.590811,0.61594,0.574425,0.652049,0.558649,0.665029,0.581496,0.635211,0.589719,0.616061,0.583831,0.628924,0.574621,0.64548,0.567696,0.662885,0.56145,0.672878,0.573178,0.653283,0.577622,0.638073,0.583908],"triangles":[21,6,14,21,14,4,19,7,13,20,13,7,20,4,13,19,13,3,17,7,12,18,12,7,18,2,12,17,12,1,15,6,11,16,11,6,16,1,11,15,11,0,15,10,6,15,0,10,21,9,6,16,6,9,20,7,9,17,9,7,21,4,9,20,9,4,17,1,9,16,9,1,19,8,7,18,7,8,19,3,8,18,8,2,10,5,6,14,6,5],"userEdges":[]}]},{"name":"D_CLOTHES.10","display":[{"type":"mesh","name":"D_CLOTHES.10","path":"shizuku_01","vertices":[37.65,-157.4,116.83,-132.26,176.45,-74.06,167.59,11.7,174.13,91.91,128.92,138.59,-7.2,152.73,-107.79,147.52,-135.23,111.06,-117.32,23.41,-85.28,-60.56,-68.75,-127.84,-11.82,121.22,66.76,85.07,-41.65,53.57,87.48,46.38,6.58,3.04,46.84,-39.9,27.28,-102.11,-122.07,58.38,-102.69,-9.89,-36.65,90.92,-40.57,-28.41,-82.78,80.58,38.69,-129.41,-78.73,-96.82,-35.48,-78.94,-20.69,-143.83,-22.55,-114.66,82.03,-145.05],"uvs":[0.088542,0.309896,0.14974,0.358073,0.171875,0.441406,0.166667,0.570313,0.166667,0.708333,0.143229,0.78776,0.080729,0.830729,0.016927,0.816406,0.009115,0.731771,0.019531,0.606771,0.033854,0.473958,0.039063,0.36849,0.076823,0.763021,0.106771,0.700521,0.059896,0.654948,0.125,0.640625,0.08724,0.574219,0.111979,0.489583,0.098958,0.40625,0.015293,0.657633,0.025267,0.553583,0.062738,0.714611,0.060491,0.523983,0.034018,0.694097,0.094143,0.361708,0.036726,0.415804,0.063372,0.443259,0.062533,0.340696,0.068767,0.387217,0.122668,0.336762],"triangles":[26,18,25,28,25,18,28,11,25,26,25,10,29,24,1,27,11,24,28,24,11,29,0,24,27,24,0,28,18,24,23,21,14,23,8,21,22,20,16,22,10,20,23,14,19,23,19,8,24,18,1,26,17,18,18,17,2,22,16,17,26,10,17,22,17,10,17,16,3,20,9,16,16,15,3,16,14,15,19,14,9,16,9,14,15,14,13,21,13,14,15,13,4,21,12,13,13,12,5,21,8,12,12,8,7,12,7,6,12,6,5,13,5,4,15,4,3,17,3,2,18,2,1],"userEdges":[]}]},{"name":"D_HAIR_TWIN.29","display":[{"type":"mesh","name":"D_HAIR_TWIN.29","path":"shizuku_01","vertices":[-136.49,-100.25,-100.49,-120.03,-65.27,-80.78,-66.8,-11.7,-100.29,19.72,-141.27,2.96,-144.07,-56.58,-125.09,-44.57,-90.83,-54.36],"uvs":[0.455078,0.754557,0.507161,0.742839,0.555339,0.770833,0.552734,0.818359,0.50651,0.839193,0.44987,0.832682,0.432943,0.783203,0.477214,0.791667,0.520182,0.788411],"triangles":[8,7,4,8,1,7,7,0,6,7,6,5,7,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.11","display":[{"type":"mesh","name":"D_CLOTHES.11","path":"shizuku_01","vertices":[-147.25,13.94,-151.97,-51.47,-100.07,-124.65,-59.65,-161.82,7.49,-126.43,83.22,-64.33,141.56,-16.5,139.45,62.44,121.98,154.97,64.28,140.69,-0.8,107.64,-72.08,77.34,96.25,57,34.62,27.51,-32.57,8.96,-87.5,-32.83,-103.49,58.18,-127.06,1.22,-47.92,-69.46,19.95,-46.27,71.41,45.12,47.84,77.97,-40.34,90.84,-14.29,68.1,0.23,14.55,-12.34,-61.03,-78.41,32.17,-61.72,-18.73,-58.59,50.61,52.64,-5.05,35.51,-88.84,-30.31,-141.83,-76.77,-98.59,-132.22,-106.81,-137.91,-45.48,-94.8,-86.17],"uvs":[0.384115,0.334635,0.43099,0.316406,0.5,0.348958,0.535156,0.416667,0.53125,0.509115,0.519531,0.621094,0.511719,0.708333,0.457031,0.71875,0.388021,0.710938,0.378906,0.63151,0.380208,0.539063,0.377604,0.438802,0.446615,0.660156,0.446615,0.572917,0.445313,0.479167,0.447917,0.39974,0.380426,0.39365,0.406857,0.357842,0.491255,0.447207,0.487425,0.542152,0.446615,0.625,0.416426,0.599042,0.378764,0.483453,0.406964,0.514448,0.445927,0.523388,0.491804,0.495368,0.406431,0.422787,0.44671,0.436537,0.4003,0.452332,0.474786,0.59153,0.52649,0.554598,0.533592,0.453679,0.496295,0.409126,0.467092,0.333436,0.436306,0.342579,0.478172,0.370241],"triangles":[34,15,33,35,33,15,35,2,33,34,33,1,35,32,2,35,15,32,27,26,14,28,14,26,28,26,11,27,15,26,24,23,13,24,14,23,23,14,22,28,22,14,28,11,22,23,22,10,29,20,5,21,9,20,29,13,20,21,20,13,30,19,5,29,5,19,25,14,19,24,19,14,30,4,19,25,19,4,24,13,19,29,19,13,31,18,4,25,4,18,32,15,18,27,18,15,31,3,18,32,18,3,27,14,18,25,18,14,34,1,17,34,17,15,26,15,16,17,16,15,17,0,16,26,16,11,21,13,10,23,10,13,20,12,5,20,9,12,21,10,9,12,9,8,12,8,7,12,7,6,12,6,5,32,3,2,17,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.12","display":[{"type":"mesh","name":"D_CLOTHES.12","path":"shizuku_01","vertices":[5.2,-158.2,149.14,-105.13,129.47,-24.31,62.5,57.76,4.04,143.98,-86.76,97.07,-145.77,31.48,-86.4,-79.77,-26.73,3.97,62.33,-76.32,-8.09,-81.93,-88.71,24.47,-11.32,74.1,68.4,-134.9],"uvs":[0.373698,0.03776,0.44401,-0.001302,0.459635,0.022135,0.463542,0.080729,0.467448,0.13151,0.423177,0.152344,0.380208,0.15625,0.367188,0.10026,0.417969,0.104167,0.425781,0.044271,0.395333,0.070212,0.398307,0.131286,0.442754,0.117864,0.40457,0.020609],"triangles":[10,8,9,13,9,1,13,0,9,10,9,0,11,8,7,10,7,8,9,8,3,12,3,8,12,8,5,11,5,8,10,0,7,11,7,6,11,6,5,12,5,4,12,4,3,9,3,2,9,2,1],"userEdges":[]}]},{"name":"D_HAND.01","display":[{"type":"mesh","name":"D_HAND.01","path":"shizuku_00","vertices":[-121.12,-133.66,16.69,-90.24,133.7,-8.21,102.49,117.25,-4.11,131.73,-131.52,73.83,-62.7,-1.16,67.89,33.58,-126.37,-28.92,6.83,14.94,118.97,51.01,-49.78,-111.18,-72.25,100.76,76.55,-48.27,60.92,122.9],"uvs":[0.454427,0.701823,0.488932,0.707682,0.518229,0.71875,0.510417,0.735677,0.483724,0.73763,0.451823,0.729818,0.469054,0.7197,0.501753,0.724388,0.453112,0.715955,0.486464,0.721873,0.514542,0.726739,0.472289,0.704856,0.466664,0.733452,0.503919,0.713344,0.500008,0.736439],"triangles":[13,7,2,10,2,7,9,4,7,14,7,4,14,3,7,10,7,3,13,1,7,9,7,1,11,6,1,9,1,6,8,5,6,12,6,5,12,4,6,9,6,4,11,0,6,8,6,0],"userEdges":[]}]},{"name":"D_HAND.00","display":[{"type":"mesh","name":"D_HAND.00","path":"shizuku_00","vertices":[-118.48,-136.25,-31.61,-119.9,84.23,-79.01,68.3,2.76,20.52,78.39,-30.16,100.88,-96.76,64.09,-145.99,2.76,-148.89,-79.01,-38.84,6.85,17.62,-27.91,-62.01,-54.48],"uvs":[0.430664,0.390625,0.489258,0.398438,0.567383,0.417969,0.556641,0.457031,0.524414,0.493164,0.490234,0.503906,0.445313,0.486328,0.412109,0.457031,0.410156,0.417969,0.484375,0.458984,0.522461,0.442383,0.46875,0.429688],"triangles":[11,10,1,11,9,10,10,9,4,11,6,9,11,0,8,11,8,7,11,7,6,9,6,5,9,5,4,10,4,3,10,3,2,10,2,1,11,1,0],"userEdges":[]}]},{"name":"D_HAND.02","display":[{"type":"mesh","name":"D_HAND.02","path":"shizuku_00","vertices":[-127.91,-62.77,-79.03,-146.25,5.81,-101.69,118.53,-3.24,148.37,156.3,60.48,126.04,5.33,55.36,5.62,-27.36,-54.3,2.65,80.58,81.22,137.37,97.47,-54.09,-84.26,-54.86,-43.38,54.7,-59,61.37,26.38,103.16,110.18,5.47,15.44,61.34,-15.45,5.71,-66.18,46.33,69.43,97.16,44.32,126.89,41.43,28.94,85.44],"uvs":[0.444336,0.766602,0.458984,0.738281,0.483398,0.753906,0.515625,0.788086,0.523438,0.842773,0.498047,0.832031,0.482422,0.807617,0.482936,0.779324,0.465414,0.789301,0.504142,0.816794,0.520557,0.822607,0.465899,0.759594,0.465462,0.773565,0.497374,0.768729,0.498853,0.797952,0.510549,0.826797,0.48267,0.793959,0.49907,0.783649,0.483178,0.766047,0.494245,0.812612,0.50916,0.80425,0.517812,0.803398,0.489082,0.818023],"triangles":[21,20,10,21,3,20,22,5,19,22,19,6,20,14,9,19,9,14,17,7,14,16,14,7,20,3,14,17,14,3,16,6,14,19,14,6,18,7,13,17,13,7,17,3,13,18,13,2,18,11,7,12,7,11,18,2,11,12,11,0,20,9,10,15,10,9,15,4,10,19,5,9,15,9,5,16,7,8,12,8,7,12,0,8,16,8,6,15,5,4,11,2,1,11,1,0],"userEdges":[]}]},{"name":"D_HAND.03","display":[{"type":"mesh","name":"D_HAND.03","path":"shizuku_00","vertices":[-123.64,-51.58,-64.17,-142.55,24.87,-77.09,107.97,-2.54,164.36,162.93,82.74,137.48,22.33,64.44,-40.04,15.06,-48.72,-64.47,23.45,-2.46,138.27,86.37,93.77,76.28,114.59,108.16,62.03,33.38,-8.29,-29.97,-94.14,-96.65,-78.58,-15.41,-18.78,-109.18,-5.27,42.46,60.88,-44.81],"uvs":[0.446289,0.848633,0.46582,0.824219,0.495117,0.841797,0.520508,0.858398,0.536133,0.902344,0.511719,0.895508,0.494141,0.879883,0.473743,0.866562,0.470904,0.845187,0.494603,0.861866,0.528903,0.882009,0.51556,0.879289,0.521575,0.887765,0.506422,0.869876,0.484186,0.854462,0.455959,0.836545,0.461147,0.858336,0.480756,0.83318,0.485087,0.87397,0.506115,0.848988],"triangles":[13,6,11,12,10,11,12,11,5,13,11,3,12,4,10,11,10,3,19,9,3,13,3,9,14,7,9,18,9,7,18,6,9,13,9,6,19,2,9,14,9,2,14,8,7,16,7,8,17,1,8,15,8,1,14,2,8,17,8,2,15,0,8,16,8,0,11,6,5,12,5,4],"userEdges":[]}]},{"name":"D_HAND.04","display":[{"type":"mesh","name":"D_HAND.04","path":"shizuku_00","vertices":[-127.44,15.52,-129.15,-72.24,-67.6,-141.05,31.37,-48.86,148.79,94.82,137.61,156.35,74.3,146.02,-25.83,73.46,-49,-44.08,99.45,34.44,54.17,53.73,120.04,114.58,-95.42,-67.97,4.22,9.15,88.61,82.56,34.3,116.76,71.87,0.69,-70.66,47.92,-22.09,-98.67],"uvs":[0.447917,0.914063,0.447266,0.894531,0.472656,0.884115,0.503255,0.89974,0.544271,0.931641,0.540365,0.945313,0.518229,0.942057,0.483073,0.929036,0.477354,0.904375,0.527031,0.918232,0.511149,0.922047,0.534225,0.935659,0.46111,0.898092,0.493701,0.913608,0.523234,0.928508,0.504102,0.936825,0.517397,0.910738,0.467602,0.922447,0.486722,0.891297],"triangles":[14,11,9,14,6,11,16,10,9,14,9,10,13,7,10,15,10,7,15,6,10,14,10,6,16,3,10,13,10,3,11,4,9,18,8,3,13,3,8,12,0,8,17,8,0,17,7,8,13,8,7,18,2,8,12,8,2,11,6,5,11,5,4,12,2,1,12,1,0],"userEdges":[]}]},{"name":"D_HAND.05","display":[{"type":"mesh","name":"D_HAND.05","path":"shizuku_00","vertices":[-139.53,-31.02,-104.49,-133.36,-36.29,-122.81,65.38,-3.01,141.06,149.3,63.7,155.78,-23.78,91.78,-79.12,-61.34,-91.25,20.48,104.1,74.64,24.37,40.53,-30.7,-21.24,64.66,72.85,22.4,-53.49,15.74,120.46,87.54,107.9,94.2,153.23],"uvs":[0.442057,0.94987,0.45638,0.934896,0.479818,0.936198,0.510417,0.955078,0.535807,0.983073,0.509766,0.984375,0.480469,0.972656,0.46406,0.946935,0.458141,0.959411,0.523376,0.969366,0.496664,0.963151,0.480125,0.953422,0.510105,0.969097,0.497515,0.947118,0.493658,0.977932,0.517797,0.975518,0.52003,0.983862],"triangles":[16,4,15,16,15,5,15,9,12,15,12,5,12,10,5,14,5,10,13,2,10,11,10,2,12,3,10,13,10,3,11,6,10,14,10,6,15,4,9,12,9,3,11,2,7,8,7,0,8,6,7,11,7,6,7,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.18","display":[{"type":"mesh","name":"D_CLOTHES.18","path":"shizuku_04","vertices":[234.62,-66.42,298.53,-50.75,336.16,-22.48,358.44,23.22,-38.06,46.47,-3.82,-1.2,78.74,6.94,191.66,10.22,279.43,10.49,328.89,18.46,-57.52,23.12,-62.79,-26.78,-14.63,-58.16,52.87,-58.94,152.45,-63.26,327.53,80.79,270,82.9,182.61,85.68,62.46,82.28,8.97,67.36],"uvs":[0.41,0.815,0.387,0.875,0.355,0.908,0.308,0.924,0.334,0.537,0.376,0.576,0.358,0.655,0.341,0.764,0.33,0.849,0.316229,0.895947,0.359,0.521,0.408,0.522,0.4325,0.5725,0.425,0.638,0.417,0.735,0.256,0.887,0.261,0.831,0.269,0.746,0.287,0.63,0.308,0.58],"triangles":[19,18,6,18,17,6,17,16,7,16,15,9,14,13,6,13,12,5,12,11,5,5,11,10,15,3,9,16,9,8,9,2,8,16,8,7,14,7,0,8,0,7,14,6,7,17,7,6,13,5,6,19,6,5,19,5,4,10,4,5,9,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.19","display":[{"type":"mesh","name":"D_CLOTHES.19","path":"shizuku_04","vertices":[471.9,-73.52,474.06,-13.2,473.44,45.44,464.46,75.96,419.83,69.05,391.68,86.85,317.5,80.63,229.76,78.7,145.64,93.33,58.58,88.41,-7.94,67.05,-29.68,28.56,-42.68,-49.05,22.1,-80.42,101.07,-81.51,182.94,-86.15,266.59,-89.35,364.27,-108.27,409.97,-87.48,412.32,-18.72,425.84,28.42,349.19,33.19,353.99,-48.66,275.77,-4.35,200.5,-5.47,123.38,-2.86,57.28,0.99,9.66,-6.59,-51.63,36.48,-60.98,-19.3],"uvs":[0.184,0.036,0.241,0.021,0.297,0.009,0.328,0.011,0.331,0.055,0.354,0.078,0.364,0.15,0.381,0.234,0.413,0.311,0.427,0.395,0.418,0.461,0.386,0.489,0.309,0.52,0.274,0.466,0.256,0.391,0.234,0.314,0.213,0.235,0.174,0.146,0.184,0.098,0.249,0.081,0.291,0.058,0.312,0.13,0.233,0.143,0.292,0.208,0.311,0.278,0.332,0.347,0.344,0.415,0.347,0.462,0.3885,0.517,0.3315,0.533],"triangles":[29,28,12,27,26,13,27,9,26,26,8,25,26,25,14,25,8,24,25,24,15,24,7,23,24,23,16,23,22,16,23,21,22,22,21,19,23,6,21,21,5,20,21,20,19,20,1,19,22,19,18,19,0,18,22,18,17,22,17,16,24,16,15,25,15,14,26,14,13,27,13,12,28,11,12,27,12,11,28,10,11,27,11,10,27,10,9,26,9,8,24,8,7,23,7,6,21,6,5,20,5,4,20,4,3,20,3,2,20,2,1,19,1,0],"userEdges":[]}]},{"name":"D_HAND.18","display":[{"type":"mesh","name":"D_HAND.18","path":"shizuku_04","vertices":[126.74,47.26,126.73,68.25,92.38,59.99,61.53,52.51,45.22,45.68,40.46,22.57,49.22,9.32,83.83,23.42,108.84,35.88,57.26,29.5],"uvs":[0.361,0.909,0.381,0.9045,0.3805,0.939,0.38,0.97,0.377,0.987,0.356,0.9965,0.3415,0.991,0.3475,0.955,0.354,0.9285,0.359,0.979],"triangles":[9,3,7,2,0,8,2,8,7,9,7,6,9,6,5,9,5,4,9,4,3,7,3,2,2,1,0],"userEdges":[]}]},{"name":"D_HAND.19","display":[{"type":"mesh","name":"D_HAND.19","path":"shizuku_04","vertices":[39.12,-50.33,85.68,-56.63,105.7,-29.02,114.48,6.54,104.31,44.67,67.52,54.22,34.58,37.35,28.65,-3.88,63.9,-15.88,79.68,16.55],"uvs":[0.197,0.9825,0.181,0.9395,0.203,0.9145,0.235,0.8985,0.2735,0.9,0.2905,0.933,0.2815,0.968,0.2435,0.9825,0.2245,0.9515,0.252,0.9295],"triangles":[6,9,8,9,2,8,8,0,7,8,7,6,9,6,5,9,5,4,9,4,3,9,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_HAND.20","display":[{"type":"mesh","name":"D_HAND.20","path":"shizuku_04","vertices":[82.85,48.09,127.59,54.5,167.5,61.39,195.14,64.47,192.46,34.48,160.38,27.77,121.47,21.1,92.05,16.57],"uvs":[0.394,0.123,0.3905,0.079,0.3885,0.0395,0.3855,0.0125,0.3575,0.0215,0.358,0.0535,0.36,0.092,0.362,0.121],"triangles":[0,6,7,1,5,6,2,4,5,4,2,3,5,1,2,6,0,1],"userEdges":[]}]},{"name":"D_HAND.21","display":[{"type":"mesh","name":"D_HAND.21","path":"shizuku_04","vertices":[206.47,21.78,166.93,20.22,126.94,20.65,97.83,24.07,87.99,-9.12,131.88,-12.87,177.84,-7.24,204.38,-3.88],"uvs":[0.4075,0.867,0.4145,0.905,0.4235,0.943,0.433,0.97,0.4035,0.9865,0.3905,0.9455,0.386,0.9005,0.3835,0.8745],"triangles":[0,7,6,1,6,5,2,5,4,4,3,2,5,2,1,6,1,0],"userEdges":[]}]},{"name":"D_HAND.22","display":[{"type":"mesh","name":"D_HAND.22","path":"shizuku_04","vertices":[185.66,-43.52,195.64,-20.27,153.36,-11.96,117.74,-5.29,89.74,-2.15,83.16,-28.83,116.66,-35.45,157.34,-43.6],"uvs":[0.3745,0.165,0.3945,0.1505,0.4115,0.189,0.4255,0.2215,0.4345,0.2475,0.4105,0.2595,0.397,0.229,0.3805,0.192],"triangles":[2,0,7,2,7,6,3,6,5,5,4,3,6,3,2,2,1,0],"userEdges":[]}]},{"name":"D_HAND.23","display":[{"type":"mesh","name":"D_HAND.23","path":"shizuku_04","vertices":[147.11,-59.39,119.52,-44.09,86.58,-23.7,65.77,-47.81,96.54,-65.54,132.46,-80.54],"uvs":[0.1865,0.294,0.207,0.317,0.2335,0.344,0.215,0.369,0.1915,0.3435,0.1695,0.3125],"triangles":[0,5,4,1,4,3,3,2,1,4,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.16","display":[{"type":"mesh","name":"D_CLOTHES.16","path":"shizuku_04","vertices":[-71.31,-7.55,-66.03,-40.98,-34.5,-72.8,47.21,-88.88,117.77,-95.7,202.32,-98.14,275.38,-98.56,327.28,-92.72,362.15,-47.32,337.22,-0.27,295.16,31.82,230.05,46.35,154.68,49.64,55.75,51.78,-34.26,46.51,-12.4,-16.15,48.63,-4.42,33.23,-49.04,116.64,-39.24,135.08,16.97,201.97,-5.62,199.47,-56.24,279.14,-28.28,320.89,-46],"uvs":[0.035,0.014,0.081,0.007,0.12,0.04,0.143,0.118,0.156,0.186,0.166,0.268,0.173,0.339,0.172,0.39,0.131,0.428,0.083,0.408,0.048,0.37,0.028,0.308,0.018,0.235,0.007,0.139,0.004,0.051,0.063,0.064,0.061,0.127,0.103,0.108,0.101,0.19,0.048,0.213,0.076,0.276,0.125,0.269,0.105,0.349,0.126,0.388],"triangles":[23,22,9,23,6,22,22,6,21,22,21,20,21,18,20,22,20,11,20,19,12,20,18,19,19,18,16,21,4,18,18,3,17,18,17,16,19,16,13,17,15,16,16,15,14,17,2,15,15,0,14,16,14,13,19,13,12,20,12,11,22,11,10,22,10,9,23,9,8,23,8,7,23,7,6,21,6,5,21,5,4,18,4,3,17,3,2,15,2,1,15,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.17","display":[{"type":"mesh","name":"D_CLOTHES.17","path":"shizuku_04","vertices":[469.09,-49.88,473.04,5.53,471.31,60.67,463.13,97.41,410.95,103.53,359.55,127.75,274.71,110.83,167.15,106.84,49.59,94.99,-37.13,75.64,-49.15,0.75,-0.92,-60.79,90.76,-87.37,195.06,-71.49,281.26,-61.87,391.83,-71.12,393.85,2.95,333.18,65.54,298.19,-11.83,227.02,33.17,115.44,8.9,23.55,6.02,-52.52,-29.72,-73.8,15.72,-65.32,47.97,143.31,61.69,103.43,100.42,82.63,51.8,38.07,55.63,193.73,74.13,242.05,109.62,234.87,73.09,260.39,87.51],"uvs":[0.138627,0.445491,0.192463,0.452221,0.244953,0.464334,0.2786,0.479139,0.274563,0.530283,0.288022,0.584118,0.25572,0.66218,0.231494,0.764468,0.197847,0.874832,0.162853,0.95424,0.088829,0.951548,0.039031,0.893674,0.030956,0.800808,0.065949,0.703903,0.091521,0.623149,0.103634,0.515478,0.174966,0.527591,0.223419,0.597577,0.142665,0.61642,0.172275,0.693136,0.12786,0.795424,0.107672,0.882907,0.059,0.949,0.0985,0.978,0.131,0.976,0.183715,0.77874,0.213257,0.824286,0.162736,0.834995,0.157947,0.878405,0.2052,0.732796,0.248363,0.693244,0.212005,0.693192,0.230661,0.671477],"triangles":[32,19,31,32,31,30,31,29,30,32,30,6,30,29,7,31,19,29,28,27,21,28,8,27,27,26,25,27,8,26,29,19,25,26,7,25,29,25,7,27,25,20,24,10,23,23,10,22,28,21,9,27,20,21,21,20,12,25,19,20,20,19,13,32,17,19,19,18,14,19,17,18,32,6,17,18,17,16,17,4,16,4,2,16,18,16,15,16,0,15,18,15,14,19,14,13,20,13,12,21,12,11,22,10,11,21,11,10,24,9,10,21,10,9,28,9,8,17,6,5,17,5,4,4,3,2,16,2,1,16,1,0],"userEdges":[]}]},{"name":"D_HAND.12","display":[{"type":"mesh","name":"D_HAND.12","path":"shizuku_04","vertices":[97.88,-58.85,100.65,-35.46,66.59,-23.95,37.37,-7.44,18.2,-15.08,14.49,-37.83,36.61,-53.34,66.81,-55.52,40.11,-32.12],"uvs":[0.0105,0.3435,0.0335,0.344,0.04,0.3785,0.052,0.409,0.042,0.4265,0.0195,0.427,0.0075,0.4035,0.0095,0.374,0.0285,0.403],"triangles":[8,2,7,8,7,6,8,6,5,8,5,4,8,4,3,8,3,2,7,2,1,7,1,0],"userEdges":[]}]},{"name":"D_HAND.13","display":[{"type":"mesh","name":"D_HAND.13","path":"shizuku_04","vertices":[44.7,-47.97,71.77,-42.98,86.84,-16.66,82.19,20.18,67.8,46.51,50.75,61.31,21.94,55.02,4.86,51.22,0.81,18.69,3.36,-21.99,16.14,-37.75,51.14,-16.82,59.47,13.04,34.75,28.4,27.37,-5.72],"uvs":[0.0055,0.469,0.014,0.4435,0.0415,0.4325,0.0765,0.442,0.1,0.4595,0.112,0.478,0.102,0.505,0.096,0.521,0.064,0.5205,0.025,0.5125,0.0115,0.498,0.0365,0.467,0.0665,0.463,0.078,0.489,0.044,0.4915],"triangles":[10,14,11,14,8,13,14,13,12,13,4,12,14,12,11,12,2,11,11,0,10,14,10,9,14,9,8,13,8,7,13,7,6,13,6,5,13,5,4,12,4,3,12,3,2,11,2,1,11,1,0],"userEdges":[]}]},{"name":"D_HAND.14","display":[{"type":"mesh","name":"D_HAND.14","path":"shizuku_04","vertices":[57.18,-43.38,91.73,-47.72,133.66,-51.03,168.35,-50.73,165.61,-26.05,127.59,-20.71,92.09,-15.72,65.51,-9.91,49.25,-26.24,76.56,-30.6,112.19,-34.57,144.13,-37.25],"uvs":[0.01,0.64,0.0105,0.606,0.013,0.565,0.018,0.5315,0.0415,0.5375,0.0415,0.575,0.0415,0.61,0.0435,0.6365,0.0255,0.65,0.025,0.623,0.026,0.588,0.02775,0.55675],"triangles":[11,2,10,11,10,5,10,1,9,10,9,6,9,0,8,9,8,7,9,7,6,10,6,5,11,5,4,11,4,3,11,3,2,10,2,1,9,1,0],"userEdges":[]}]},{"name":"D_HAND.15","display":[{"type":"mesh","name":"D_HAND.15","path":"shizuku_04","vertices":[74.51,-14.36,109.85,-13.12,144.88,-10.29,178.11,-5.66,174.51,16.56,139.89,20.4,97.47,16.53,69.23,17.92,56.81,-0.5,82.88,1.01,119.8,2.54,151.62,6.34],"uvs":[0.051,0.628,0.057,0.594,0.0645,0.5605,0.0735,0.529,0.0945,0.5355,0.0935,0.5695,0.084,0.61,0.0815,0.6375,0.062,0.647,0.067,0.622,0.0735,0.5865,0.0815,0.55625],"triangles":[11,2,10,11,10,5,10,1,9,10,9,6,9,0,8,9,8,7,9,7,6,10,6,5,11,5,4,11,4,3,11,3,2,10,2,1,9,1,0],"userEdges":[]}]},{"name":"D_HAND.16","display":[{"type":"mesh","name":"D_HAND.16","path":"shizuku_04","vertices":[72.9,6.68,107.06,17.9,134.99,25.35,158.64,35.47,148.31,57.61,111.76,51.37,69.71,42.8,53.58,34.73,50.29,15.02,77.06,25.22],"uvs":[0.007,0.74,0.0225,0.7085,0.0335,0.6825,0.0465,0.661,0.0665,0.674,0.0555,0.7085,0.0415,0.748,0.0315,0.7625,0.012,0.763,0.0255,0.7385],"triangles":[5,1,9,9,0,8,9,8,7,9,7,6,9,6,5,2,5,4,4,3,2,5,2,1,9,1,0],"userEdges":[]}]},{"name":"D_HAND.17","display":[{"type":"mesh","name":"D_HAND.17","path":"shizuku_04","vertices":[67.24,32.59,90.44,54.15,114.58,71.44,99.13,86.54,61.44,68.57,39.32,54.61,45.02,32.62,63.51,50.18,82.59,78.65],"uvs":[0.1755,0.4155,0.1995,0.396,0.2195,0.375,0.232,0.392,0.2095,0.426,0.193,0.4455,0.1725,0.437,0.192,0.4215,0.222129,0.406916],"triangles":[1,8,3,8,1,7,8,7,4,7,0,6,7,6,5,7,5,4,3,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.07","display":[{"type":"mesh","name":"D_CLOTHES.07","path":"shizuku_01","vertices":[-133.33,-95.24,-95.51,-133.33,-36.88,-60.61,40.66,25.97,133.33,128.14,61.47,133.33,-17.97,77.92,-93.62,-13.85,-27.28,9.72,53.58,92.64,-92.19,-80.47],"uvs":[0.788411,0.905599,0.801432,0.891276,0.821615,0.91862,0.848307,0.951172,0.880208,0.989583,0.855469,0.991536,0.828125,0.970703,0.802083,0.936198,0.82492,0.945062,0.852754,0.976236,0.802573,0.911153],"triangles":[8,2,7,10,7,2,9,3,6,8,6,3,10,0,7,8,7,6,9,6,5,9,5,4,9,4,3,8,3,2,10,2,1,10,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.08","display":[{"type":"mesh","name":"D_CLOTHES.08","path":"shizuku_01","vertices":[103.78,-133.33,133.33,-77.08,86.96,1.47,3.92,75.26,-78.8,133.33,-133.33,114.45,-66.08,49.77,28.09,-46.39,14.24,23.35,95.14,-64.09,-76.04,96.79],"uvs":[0.987305,0.890625,0.99707,0.913574,0.979004,0.944336,0.947754,0.972656,0.915527,0.992676,0.897461,0.986328,0.922852,0.961426,0.958496,0.924316,0.952338,0.952028,0.983041,0.918215,0.918475,0.980099],"triangles":[9,7,2,8,2,7,8,6,3,10,3,6,9,0,7,8,7,6,10,6,5,10,5,4,10,4,3,8,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.09","display":[{"type":"mesh","name":"D_CLOTHES.09","path":"shizuku_01","vertices":[-161.78,-68.89,-107.58,-99.81,-26.06,-114.74,20.39,-112.6,95.08,-99.81,160.21,-41.17,131.97,37.19,108.29,89.43,125.14,164.59,63.2,189.11,-13.77,187.51,-102.12,170.98,-105.31,96.89,-125.8,68.64,-164.97,-11.32,-19.69,99.55,45.9,95.29,0.35,-2.79,52.27,1.47,-61.59,2.54,-118.06,-32.64,-57.94,-66.76,4,-62.5,67.76,-50.77],"uvs":[0.777344,0.645182,0.817057,0.624349,0.874349,0.617188,0.907552,0.61849,0.961589,0.624349,0.999349,0.64974,0.988932,0.691406,0.966146,0.714844,0.977865,0.758464,0.939453,0.772135,0.889974,0.782552,0.828776,0.77474,0.827474,0.723307,0.803385,0.711589,0.779948,0.678385,0.880208,0.73112,0.925781,0.727214,0.890625,0.680339,0.936849,0.68099,0.846354,0.681641,0.808594,0.667318,0.851563,0.646484,0.899089,0.645182,0.946615,0.647135],"triangles":[23,22,18,23,3,22,22,21,17,22,2,21,21,1,20,21,20,19,20,13,19,21,19,17,23,18,6,22,17,18,18,17,16,19,15,17,18,16,7,17,15,16,19,12,15,16,15,10,20,0,14,20,14,13,19,13,12,15,12,11,15,11,10,16,10,9,16,9,8,16,8,7,18,7,6,23,6,5,23,5,4,23,4,3,22,3,2,21,2,1,20,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.01","display":[{"type":"mesh","name":"D_CLOTHES.01","path":"shizuku_01","vertices":[-132.32,-144.94,-57.19,-130.16,40.51,-119.06,140.97,-134.84,142.07,-4.18,155.28,110.34,139.87,157.58,66.11,171.9,-7.65,177.63,-78.11,166.17,-145.26,144.7,-146.91,70.26,-142.51,-46.35,-75.9,87.44,-6.55,90.3,59.5,88.87,113.45,98.89,-88.01,-7.04,-6.55,5.84,70.51,-1.32,-93.52,-82.92,-19.76,-67.17,49.6,-71.46,106.01,-76.12],"uvs":[0.019531,0.002604,0.111979,0.011719,0.22526,0.014323,0.34375,0.002604,0.347656,0.128906,0.355469,0.235677,0.34375,0.282552,0.25651,0.295573,0.169271,0.300781,0.085938,0.290365,0.00651,0.270833,0.011719,0.200521,0.011719,0.096354,0.088542,0.21875,0.170573,0.221354,0.248698,0.220052,0.300781,0.222656,0.074219,0.132813,0.171875,0.140625,0.261719,0.138021,0.065104,0.063802,0.153646,0.070313,0.236979,0.074219,0.296875,0.06901],"triangles":[23,2,22,23,22,19,22,2,21,22,21,18,21,1,20,21,20,17,23,19,4,4,19,16,22,18,19,19,18,15,21,17,18,20,12,17,18,17,13,19,15,16,16,15,7,18,14,15,7,15,14,18,13,14,17,11,13,14,13,9,20,0,12,17,12,11,13,11,10,13,10,9,14,9,8,14,8,7,16,7,6,16,6,5,16,5,4,23,4,3,23,3,2,21,2,1,20,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.02","display":[{"type":"mesh","name":"D_CLOTHES.02","path":"shizuku_01","vertices":[-145.93,-110.66,-109.53,-129.9,-49.98,-147.71,1.23,-154.62,16.82,-84.28,46.08,-5.22,91.85,73.19,145.22,145.71,103.1,154.38,-27.23,166.6,-69.77,160.45,-89.35,106.87,-101.47,28.49,-129.91,-50.89,-30.01,110.14,55.35,113.26,102.01,125.71,22.07,140.01,-55.61,136.74,-37.45,50.14,38.8,52.08,-69.03,77.3,8.79,70.22,71.43,36.59,-95.07,70.85,-49.52,-1.21,-68.53,-85.08,-68.56,-112.22,-33.63,-128.89,32.37,-39.24,-10.64,-58.41,-82.51,-2.32,-138.02,-80.44,-102.83,-99.06,-57.39,-53.92,-42.51,23.45,-107.02,-111.62,-78.12,-137.65,-94.7,-123.69,-59.25,-131.64,1.65,22.76,42.23,24.2,1.48,-8.91,-37.63,-102.11,-29,-85.77,-4.84,-25.61,1.67,4.92,-63.5,111.46,-80.89,141.25,-119.47,-21.82,-66.61,13.57,-91.07,10.88,-67.58,39.87,-85.93,51.65,-64.52,32.69,-33.93,78.88,-79.97,91.31,-51.14,92.26,-51.57,62.26,-79.55,24.01,-71.62,124.32,-23.36,138.78,80.73,135.21,123.67,108.44,24.9,163.36,17.03,111.86,74.17,92.61,97.4,98.4,77.29,118.29,68.18,63.68,48.29,87.14],"uvs":[0.486328,0.05957,0.519531,0.037109,0.573242,0.019531,0.62207,0.013672,0.632813,0.099609,0.654297,0.199219,0.692383,0.298828,0.741211,0.376953,0.704102,0.394531,0.613281,0.401367,0.569336,0.389648,0.538086,0.324219,0.526367,0.233398,0.501953,0.143555,0.587891,0.333008,0.650391,0.329102,0.702179,0.356388,0.630656,0.367532,0.577032,0.366156,0.585938,0.254883,0.645508,0.272461,0.559247,0.293557,0.621065,0.295332,0.674801,0.252845,0.533872,0.291559,0.572266,0.172852,0.554688,0.100586,0.554688,0.066406,0.589551,0.039122,0.645137,0.156751,0.604345,0.134045,0.531562,0.155892,0.495039,0.106392,0.525247,0.082922,0.564204,0.139709,0.579603,0.216876,0.522973,0.063235,0.545181,0.028715,0.533555,0.048796,0.566259,0.037173,0.61081,0.23463,0.649708,0.237457,0.613424,0.186081,0.582997,0.078438,0.590876,0.100134,0.610539,0.164395,0.613703,0.208815,0.562097,0.328456,0.558985,0.367977,0.510893,0.176452,0.555834,0.194528,0.529265,0.190166,0.55793,0.244782,0.542142,0.262261,0.558404,0.223455,0.586865,0.291993,0.548367,0.309321,0.572365,0.311625,0.573971,0.272221,0.544407,0.209602,0.557426,0.345044,0.600349,0.36655,0.678947,0.363889,0.719759,0.342631,0.644648,0.399006,0.622322,0.330856,0.672044,0.313491,0.697203,0.327152,0.674157,0.341624,0.671457,0.287057,0.648306,0.304923],"triangles":[67,66,16,68,16,66,69,20,66,70,66,20,67,6,66,69,66,6,70,15,66,68,66,15,67,16,63,67,63,6,68,62,16,68,15,62,58,21,55,57,55,21,57,14,55,58,55,19,59,54,50,59,12,54,58,52,21,53,21,52,54,52,35,54,12,52,53,52,12,58,19,52,59,50,51,59,51,12,54,35,50,51,50,31,51,31,49,51,49,12,60,48,18,60,11,48,60,18,47,57,21,47,56,47,21,56,11,47,60,47,11,57,47,14,44,43,26,44,4,43,45,42,29,46,42,35,46,5,42,45,25,42,41,40,20,46,35,40,41,5,40,46,40,5,38,27,37,39,37,27,39,2,37,38,37,1,38,1,36,38,36,27,52,19,35,40,35,19,42,25,35,50,35,25,36,33,27,36,0,33,33,32,26,33,0,32,34,26,31,49,31,13,50,25,31,34,31,25,34,30,26,44,26,30,45,29,30,44,30,4,34,25,30,45,30,25,42,5,29,30,29,4,43,4,28,39,28,2,39,27,28,43,28,27,43,27,26,33,26,27,32,13,26,31,26,13,56,21,24,53,24,21,53,12,24,56,24,11,41,20,23,69,23,20,69,6,23,41,23,5,70,20,22,55,14,22,65,22,14,65,15,22,70,22,15,55,22,19,40,19,20,22,20,19,61,18,9,61,14,18,47,18,14,48,10,18,62,17,8,64,8,17,65,14,17,61,17,14,61,9,17,64,17,9,62,15,17,65,17,15,62,8,16,63,16,7,18,10,9,16,8,7,28,4,3,28,3,2,36,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.03","display":[{"type":"mesh","name":"D_CLOTHES.03","path":"shizuku_01","vertices":[-8.85,-163.07,48.77,-149.7,112.29,-129.12,157.82,-112.25,140.31,-61.25,96.97,8.82,79.5,38.31,80.9,87.17,45.95,167.82,-39.41,161.92,-119.25,154.83,-160.96,143.23,-131.18,82.91,-63.35,0.05,-28.33,-76.06,-87.01,110.79,-25.58,119.55,-51.4,68.59,23.98,68.87,14.56,14.17,13.29,-41.09,84.34,-59.8,27.68,-115.58,82.07,-109.37,-12.05,-125.09,10.86,-138.4,67.62,-126.17,79.36,-140.84,62.07,135.64,34.76,109.49,-93.7,50.34,21.33,-69.26,-43.28,-43.72,0.08,-97.38,-5.13,-58.55,-27.14,-20.62,-18.8,41.86,89.64,-30.94,118.56,-26.21,53.07,-17.46,65.79,10.72,82.5,63.37,54.71,47.92,55.22,30.1,60.13,80.82,73.11,115.44,22.07,151.85,-71.5,136.87,-37.78,95.57,-70.42,91.2,-3.04,96.64,59.47,65.57,62.37,97.55,28.69,130.7,51.67,123.55,55.67,110.76,40.9,145.65,46.92,133.63,-56.33,40.38,-21.85,7.7,13.78,-18.91,-38.56,23.35,-89.98,75.62,-69.72,60.62],"uvs":[0.627604,0.583333,0.673177,0.589844,0.730469,0.60026,0.769531,0.613281,0.769531,0.678385,0.753906,0.759115,0.752604,0.8125,0.765625,0.882813,0.75,0.980469,0.691406,0.980469,0.619792,0.981771,0.574219,0.97526,0.595052,0.898438,0.613281,0.792969,0.622396,0.692708,0.627604,0.93099,0.683594,0.93099,0.645833,0.864583,0.707031,0.859375,0.6875,0.792969,0.671875,0.722656,0.714844,0.678385,0.657552,0.636719,0.71224,0.632813,0.625211,0.633598,0.642145,0.609253,0.694564,0.61337,0.699932,0.594708,0.756118,0.942229,0.728524,0.904602,0.603284,0.850811,0.666954,0.685805,0.618511,0.735442,0.640894,0.663248,0.647211,0.707728,0.642738,0.75762,0.666409,0.829218,0.731337,0.712471,0.761695,0.718871,0.710897,0.739999,0.728768,0.77193,0.75987,0.851736,0.732665,0.833009,0.727518,0.804974,0.742839,0.873698,0.760534,0.914628,0.727772,0.963906,0.652335,0.955869,0.665756,0.899619,0.6361,0.900042,0.694284,0.898326,0.739109,0.854737,0.748859,0.892659,0.727319,0.937766,0.744313,0.926132,0.746923,0.910365,0.740427,0.954228,0.741996,0.94004,0.632378,0.834981,0.652832,0.792969,0.678159,0.750936,0.642894,0.813174,0.621307,0.880934,0.627399,0.858617],"triangles":[63,30,62,63,62,17,61,36,59,61,59,13,61,58,36,63,58,30,61,13,58,63,17,58,57,53,56,57,56,28,55,54,45,57,54,53,55,29,54,57,28,54,56,53,46,54,29,53,55,45,52,55,52,29,62,12,49,62,49,17,50,18,48,49,15,48,50,48,16,49,48,17,56,46,8,53,16,46,54,28,45,52,45,7,52,44,29,51,44,41,52,7,44,51,18,44,43,19,42,51,41,42,51,42,18,43,42,6,44,7,41,42,41,6,43,6,40,43,40,19,40,39,19,60,19,39,40,5,39,60,39,20,38,4,37,39,37,20,39,5,37,38,37,5,59,36,19,58,17,36,60,35,19,59,19,35,60,20,35,59,35,13,35,20,32,34,32,20,34,14,32,35,32,13,34,20,31,33,31,22,33,14,31,34,31,14,58,13,30,62,30,12,50,29,18,44,18,29,50,16,29,53,29,16,56,8,28,27,26,2,27,1,26,33,22,24,25,24,22,25,0,24,33,24,14,26,23,2,26,22,23,23,22,21,31,21,22,25,22,1,26,1,22,23,21,4,37,4,21,31,20,21,37,21,20,42,19,18,36,18,19,36,17,18,48,18,17,46,16,9,47,9,16,48,15,16,47,16,15,49,12,15,47,15,10,15,12,11,15,11,10,47,10,9,46,9,8,40,6,5,23,4,3,23,3,2,25,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.04","display":[{"type":"mesh","name":"D_CLOTHES.04","path":"shizuku_01","vertices":[-153.11,-115.87,-86.84,-157.35,86.9,-163.9,163.91,-129.2,149.59,115.59,77.94,150.53,-76.09,150.53,-139.67,113.4,-86.84,15.15,6.3,15.15,85.11,6.41,2.64,-155.43,6.3,150.53],"uvs":[0.765625,0.809896,0.821615,0.794271,0.947917,0.789063,1,0.804688,0.99349,0.872396,0.941406,0.882813,0.829427,0.882813,0.779948,0.876302,0.821615,0.842448,0.889323,0.842448,0.946615,0.839844,0.886662,0.791588,0.889323,0.882813],"triangles":[11,9,2,10,2,9,10,9,5,12,5,9,12,9,6,11,1,9,9,1,8,9,8,6,8,0,7,8,7,6,10,5,4,10,4,3,10,3,2,8,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.05","display":[{"type":"mesh","name":"D_CLOTHES.05","path":"shizuku_01","vertices":[-100.13,-133.67,-23.16,-88.66,69.79,-49.17,101.74,69.33,133.69,169.3,42.19,153.4,-55.11,143.3,-108.84,61.91,-130.63,-7.02,-155.32,-116.09,66.88,117.85,-10.09,51.67,-47.85,-20.63,-94.32,-75.98,0.25,-32.3,54.93,61.94,-38.91,-45.25,27.46,4.27,21.92,-69.5,-143.82,-65.29,-110,-46.19,-69.04,-45.87,-78.16,20.4,-33.48,99.29,-55.53,56.39,-0.11,131.83,96.96,141.01,61.6,12.07,85.22,8.06],"uvs":[0.740885,0.452474,0.772135,0.477214,0.817057,0.514323,0.832031,0.560547,0.841797,0.607422,0.796224,0.60612,0.766927,0.599609,0.732422,0.558594,0.71875,0.522786,0.719401,0.465495,0.806641,0.579427,0.776693,0.549479,0.757161,0.51888,0.740885,0.486328,0.781653,0.517017,0.808869,0.555914,0.762581,0.503799,0.795669,0.532952,0.793923,0.495212,0.719098,0.492177,0.731324,0.502077,0.74974,0.504036,0.744866,0.538618,0.771618,0.57553,0.756321,0.553673,0.784833,0.59051,0.822466,0.592029,0.812544,0.537246,0.824289,0.536646],"triangles":[28,27,3,28,2,27,25,10,23,24,7,23,25,23,6,24,23,11,24,11,22,24,22,7,21,20,12,21,13,20,20,13,19,20,19,8,27,17,15,27,2,17,21,16,13,21,12,16,27,15,3,17,11,15,17,14,11,18,1,14,16,14,1,17,2,14,18,14,2,16,12,14,16,1,13,19,13,9,22,12,8,20,8,12,22,11,12,14,12,11,23,10,11,15,11,10,15,10,3,26,3,10,25,5,10,26,10,5,13,0,9,22,8,7,23,7,6,25,6,5,26,5,4,26,4,3,13,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.06","display":[{"type":"mesh","name":"D_CLOTHES.06","path":"shizuku_01","vertices":[72.25,-141.23,131.5,-133.68,149.67,-37.14,108.46,48.25,45.69,118.55,-52.06,136.05,-140.75,144.5,-110.22,49.15,-53.54,-62.52,25.78,-112.24,-13.92,47.95,39.72,-24.77,78.58,-88.35,77.57,-120.44,138.57,-100.59,28.11,-76.91],"uvs":[0.960286,0.444661,0.992188,0.453125,0.997396,0.513021,0.978516,0.556641,0.947917,0.593099,0.903646,0.605469,0.863932,0.610026,0.877604,0.558594,0.905599,0.508464,0.934245,0.472656,0.921224,0.557943,0.951172,0.520182,0.969401,0.481771,0.9646,0.462222,0.994377,0.478304,0.942095,0.494698],"triangles":[13,12,1,14,1,12,15,12,9,13,9,12,14,12,2,15,11,12,12,11,2,15,8,11,11,8,10,11,10,3,10,7,5,13,0,9,15,9,8,10,8,7,7,6,5,10,5,4,10,4,3,11,3,2,13,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.00","display":[{"type":"mesh","name":"D_CLOTHES.00","path":"shizuku_01","vertices":[-135.53,-138.56,-63.22,-162.23,-23.21,-145.88,21.66,-152.23,63.67,-160.04,142.26,-139.29,147.41,-87.32,137.98,-7.53,113.11,56.89,67.67,108.86,4.23,155.71,-48.07,125.7,-96.94,62.74,-128.67,-10.46,-144.1,-83.66,-0.06,97.15,-1.78,42.25,51.38,58.35,-45.5,62.74,-66.94,15.16,70.24,10.04,-2.63,-15.58,-86.66,-44.86,79.67,-44.13,-4.63,-78.54,57.38,-99.52,-81.51,-96.84,107.9,-120.84,-112.13,-119.67],"uvs":[0.665039,0.036133,0.755859,0.012695,0.800781,0.03125,0.860352,0.03125,0.908203,0.011719,0.989258,0.035156,0.995117,0.109375,0.984375,0.21582,0.956055,0.301758,0.904297,0.371094,0.832031,0.433594,0.772461,0.393555,0.716797,0.30957,0.680664,0.211914,0.663086,0.114258,0.827148,0.355469,0.825195,0.282227,0.885742,0.303711,0.775391,0.30957,0.750977,0.246094,0.907227,0.239258,0.824219,0.205078,0.728516,0.166016,0.917969,0.166992,0.823242,0.125,0.908203,0.099609,0.734375,0.09668,0.955324,0.064664,0.6995,0.066226],"triangles":[27,4,25,28,26,1,28,14,26,2,26,24,27,25,6,3,24,25,25,24,23,26,22,24,25,23,6,24,21,23,24,22,21,26,14,22,22,19,21,23,21,20,21,16,20,23,20,7,22,13,19,21,19,16,19,12,18,19,18,16,20,17,8,20,16,17,18,15,16,17,16,15,17,15,9,18,11,15,28,0,14,22,14,13,19,13,12,18,12,11,15,11,10,15,10,9,17,9,8,20,8,7,23,7,6,27,6,5,27,5,4,25,4,3,24,3,2,26,2,1,28,1,0],"userEdges":[]}]},{"name":"D_NECK.00","display":[{"type":"mesh","name":"D_NECK.00","path":"shizuku_00","vertices":[-153.72,-130.04,-53.32,-132.38,56.98,-135.88,157.73,-133.55,134.36,-22.62,122.83,68.45,86.61,126.83,14.18,146.68,-71.43,124.49,-121.91,71.56,-137.26,-38.97,4.3,68.45,-5.58,-13.28,1.01,-81],"uvs":[0.27832,0.035156,0.331055,0.014648,0.396484,0.011719,0.442383,0.030273,0.439453,0.107422,0.435547,0.182617,0.414063,0.231445,0.371094,0.248047,0.320313,0.229492,0.294922,0.186523,0.283203,0.09668,0.365234,0.182617,0.362305,0.113281,0.363281,0.057617],"triangles":[13,12,4,13,10,12,12,11,5,12,9,11,13,0,10,12,10,9,11,9,8,11,8,7,11,7,6,11,6,5,12,5,4,13,4,3,13,3,2,13,2,1,13,1,0],"userEdges":[]}]},{"name":"D_NECK.01","display":[{"type":"mesh","name":"D_NECK.01","path":"shizuku_00","vertices":[-141.94,-73.42,-38.82,-120.02,97.3,-133.33,148.86,-77.12,132.36,34.58,49.87,133.33,-80.07,112.99,-135.75,30.14,-45.01,-29.03,66.37,-37.91],"uvs":[0.020508,0.036133,0.079102,0.013672,0.143555,0.007813,0.177734,0.033203,0.169922,0.081055,0.123047,0.124023,0.05957,0.112305,0.027344,0.081055,0.076172,0.053711,0.128906,0.049805],"triangles":[9,8,5,9,1,8,8,0,7,8,7,6,8,6,5,9,5,4,9,4,3,9,3,2,9,2,1,8,1,0],"userEdges":[]}]},{"name":"D_BODY.00","display":[{"type":"mesh","name":"D_BODY.00","path":"shizuku_00","vertices":[-154.9,-95.96,-87.61,-127.55,-11.05,-148.14,79.74,-135.91,151.46,-90.37,159.4,6.05,142.01,89.75,95.49,135.19,37.69,146.41,-67.97,142.54,-121.15,117.77,-153.57,38.25,-171.38,-42.9,-67.97,67.86,24.32,71.72,87.18,70.44,51.06,-5.53,-53.26,-10.68,-86.69,-77.64,-2.43,-80.22,100.55,-67.34],"uvs":[0.572174,0.646957,0.667826,0.617391,0.768696,0.594783,0.893913,0.608696,0.996522,0.648696,0.991304,0.806957,0.968696,0.92,0.937391,0.984348,0.833043,0.996522,0.695652,0.991304,0.617391,0.966956,0.584348,0.850435,0.558261,0.725217,0.695652,0.890435,0.815652,0.895652,0.897391,0.893913,0.850435,0.791304,0.714783,0.784348,0.671304,0.693913,0.78087,0.690435,0.914783,0.707826],"triangles":[3,19,20,20,19,16,19,18,17,19,1,18,18,12,17,11,13,17,19,17,16,17,14,16,20,16,5,16,15,5,16,14,15,15,14,8,17,13,14,8,14,13,18,0,12,17,12,11,13,11,10,13,10,9,13,9,8,15,8,7,15,7,6,15,6,5,20,5,4,20,4,3,19,3,2,19,2,1,18,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.01","display":[{"type":"mesh","name":"D_BACKGROUND.01","path":"shizuku_03","vertices":[-277.32,-351.93,-3.39,-383.42,250.07,-348.78,254.79,-87.45,10.77,-92.17,-282.04,-90.6],"uvs":[0.055147,0.496324,0.268382,0.471814,0.465686,0.498774,0.469363,0.702206,0.279412,0.698529,0.051471,0.699755],"triangles":[0,5,4,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.02","display":[{"type":"mesh","name":"D_BACKGROUND.02","path":"shizuku_03","vertices":[174.79,-441.38,179.52,-170.6,185.81,191.48,177.94,470.13,15.79,614.96,-39.31,613.39,-48.75,511.06,-327.4,506.34,-324.25,426.05,-168.4,407.16,-162.1,-376.83,-321.1,-383.13,-319.53,-485.46,-62.92,-493.33,-51.9,-573.62,40.98,-576.77,-61.35,-228.85,-164.78,-43.13,-45.61,74.99,-48.75,303.26,-166.64,188.33,79.16,242.3,182.08,323.76,68.87,389.84,-47.19,189.77,75.46,135.93,183.2,40.95,65.9,-46.66,67.98,489.98,92.45,546.49,-10.53,572.59,82.58,-358.39,177.58,-281.53,83.07,-193.93,58.94,-466.7,-62.27,-384.18,101.77,-515.26,-11.29,-534.8,20.5,354.23,18.36,441.9,-48.75,401.96,14.04,499.72,39.4,520.06,49.09,-527.06,107.45,-456.1,5.07,-430.02,-1.89,-479.99,150.22,-419.26,77.69,-487.95,176.17,-362.54,145.03,445.9,115.57,481.39,80.22,518.26,64.13,532.38,36.84,560.59,131.32,511.77,68.4,442.39,112.33,421.83,179.39,418.82,135.26,351.09],"uvs":[0.14951,0.044118,0.360294,0.040441,0.642157,0.035539,0.859069,0.041667,0.971814,0.167892,0.970588,0.210784,0.890931,0.218137,0.887255,0.435049,0.824755,0.432598,0.810049,0.311274,0.199755,0.306373,0.194853,0.430147,0.115196,0.428922,0.109069,0.229167,0.046569,0.220588,0.044118,0.148284,0.314951,0.227941,0.459522,0.308459,0.551471,0.215686,0.729167,0.218137,0.639707,0.309906,0.681719,0.118564,0.745129,0.038448,0.796569,0.126572,0.640822,0.216919,0.598914,0.12144,0.524975,0.037577,0.456775,0.128882,0.874524,0.127266,0.918514,0.10822,0.938829,0.188383,0.214113,0.115899,0.273947,0.041947,0.342138,0.115517,0.129801,0.134301,0.194034,0.228661,0.091997,0.100962,0.07679,0.188971,0.768849,0.164229,0.83709,0.165892,0.806,0.218137,0.882106,0.169259,0.897935,0.149516,0.082811,0.14197,0.138053,0.096541,0.15835,0.176241,0.119452,0.181653,0.166726,0.063247,0.113256,0.11971,0.210879,0.043047,0.84021,0.067286,0.867835,0.090217,0.896535,0.117736,0.907528,0.130266,0.929485,0.151511,0.891486,0.07796,0.837474,0.126936,0.821471,0.092743,0.819126,0.040538,0.766402,0.074892],"triangles":[58,59,57,59,58,22,58,57,50,59,23,57,57,56,51,57,23,56,54,29,53,52,42,53,54,53,42,55,51,52,53,29,52,55,52,29,57,51,50,56,28,51,52,51,28,55,3,51,51,3,50,58,50,3,49,47,31,49,0,47,46,13,45,46,45,34,47,44,31,48,44,36,48,34,44,47,0,44,48,36,43,48,43,34,52,28,42,54,42,30,42,41,30,42,28,41,56,39,28,41,28,39,40,39,38,40,6,39,41,39,6,56,23,39,39,23,38,40,38,19,43,37,34,46,34,37,43,15,37,46,37,13,44,0,36,43,36,15,45,35,31,45,13,35,45,31,34,44,34,31,49,31,32,33,32,31,33,1,32,35,16,31,33,31,16,54,30,4,41,6,30,54,4,29,33,16,27,33,27,1,27,25,26,27,26,1,26,25,2,27,18,25,25,24,21,25,18,24,38,23,21,59,21,23,59,22,21,24,19,21,38,21,19,22,2,21,25,21,2,40,9,6,40,19,9,24,18,20,24,20,19,19,20,9,27,16,18,20,18,17,18,16,17,17,16,10,35,10,16,35,13,10,37,15,14,37,14,13,10,13,12,12,11,10,9,8,7,9,7,6,30,6,5,30,5,4],"userEdges":[]}]},{"name":"D_BACKGROUND.03","display":[{"type":"mesh","name":"D_BACKGROUND.03","path":"shizuku_03","vertices":[17.56,-376.8,134.03,-293.98,132.73,-83.04,131.44,77.43,127.56,327.19,7.21,417.78,3.32,107.2,12.38,-138.68,81.18,-226.52,79.62,-4.96,73.13,237.17],"uvs":[0.026,0.967,0.09,0.877,0.253,0.878,0.377,0.879,0.57,0.882,0.64,0.975,0.4,0.978,0.21,0.971,0.142129,0.917835,0.313332,0.919042,0.500439,0.924058],"triangles":[9,6,3,10,3,6,8,7,2,9,2,7,8,0,7,9,7,6,10,6,5,10,5,4,10,4,3,9,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.04","display":[{"type":"mesh","name":"D_BACKGROUND.04","path":"shizuku_03","vertices":[-354.8,-51.76,-359.55,-116.78,-188.28,-123.13,-183.52,-67.62,-270.58,-87.85],"uvs":[0.655637,0.965686,0.651961,0.915441,0.784314,0.910539,0.78799,0.953431,0.720715,0.937796],"triangles":[4,0,3,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.05","display":[{"type":"mesh","name":"D_BACKGROUND.05","path":"shizuku_03","vertices":[-192.71,-107.62,-146.72,-126.65,-8.74,-117.14,-26.19,-41.01,-153.06,-66.39,-87.81,-84.8],"uvs":[0.031863,0.773284,0.067402,0.758578,0.17402,0.765931,0.160539,0.824755,0.0625,0.805147,0.11292,0.790921],"triangles":[5,1,4,5,4,3,5,3,2,5,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.06","display":[{"type":"mesh","name":"D_BACKGROUND.06","path":"shizuku_03","vertices":[9.32,458.67,7.74,384.14,68,376.21,71.17,463.43,38.61,417.51],"uvs":[0.526961,0.832108,0.469363,0.833333,0.463235,0.786765,0.530637,0.784314,0.495153,0.809475],"triangles":[4,0,3,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.07","display":[{"type":"mesh","name":"D_BACKGROUND.07","path":"shizuku_03","vertices":[94.6,394.84,72.39,451.93,116.8,458.28,126.31,398.01],"uvs":[0.477941,0.765931,0.522059,0.783088,0.526961,0.748775,0.480392,0.741422],"triangles":[0,2,3,2,0,1],"userEdges":[]}]},{"name":"D_BACKGROUND.08","display":[{"type":"mesh","name":"D_BACKGROUND.08","path":"shizuku_03","vertices":[40.07,-473.53,113.02,-471.94,139.98,-389.47,120.95,-224.54,9.94,-213.44,-10.68,-284.8,3.59,-397.4,71.79,-387.89,59.1,-294.32,91.83,-332.83,32.77,-251,88.9,-260.7,67.98,-219.24,27.99,-352.1,65.86,-344.15],"uvs":[0.214461,0.808824,0.215686,0.752451,0.279412,0.731618,0.406863,0.746324,0.415441,0.832108,0.360294,0.848039,0.273284,0.83701,0.280637,0.784314,0.352941,0.794118,0.323186,0.768826,0.386414,0.814464,0.378921,0.77109,0.410956,0.787254,0.308289,0.818161,0.314433,0.788896],"triangles":[14,7,13,14,13,8,12,11,10,12,3,11,12,10,4,11,8,10,11,3,9,14,9,7,14,8,9,11,9,8,10,8,5,13,5,8,9,2,7,13,7,6,7,0,6,13,6,5,10,5,4,9,3,2,7,2,1,7,1,0],"userEdges":[]}]}]}],"animation":[{"type":"tree","duration":0,"fadeInTime":0.5,"name":"f04.exp.json","timeline":[{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"value":0.15}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"value":1}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"value":0.8333}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"value":0.8333}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"value":1}]},{"name":"PARAM_TERE","type":40,"frame":[{"value":1}]}]},{"type":"tree","duration":0,"fadeInTime":0.5,"name":"f03.exp.json","timeline":[{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"value":0.6}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"value":0.4}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"value":0.4}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"value":0.15}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"value":0.65}]}]},{"type":"tree","duration":0,"fadeInTime":0.5,"name":"f02.exp.json","timeline":[{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"value":0.15}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"value":0.5667}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"value":0.5667}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"value":0.7}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{}]}]},{"type":"tree","duration":66,"playTimes":0,"fadeInTime":0.3,"name":"flick_head_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":13,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.415},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.535},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":4,"tweenEasing":0,"value":0.29},{"duration":2,"tweenEasing":0,"value":0.77},{"duration":2,"tweenEasing":0,"value":0.095},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":4,"tweenEasing":0,"value":0.665},{"duration":4,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.335},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.955},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.135},{"duration":4,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.35},{"duration":5,"value":0.04}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":7,"tweenEasing":0,"value":0.145},{"value":0.145},{"duration":58,"value":0.14}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":14,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.64},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":36,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":21,"value":0.505}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.22}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.24}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":14,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.64},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":36,"value":0.6667}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":66,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":23,"tweenEasing":0,"value":0.235},{"duration":6,"tweenEasing":0,"value":0.27},{"duration":2,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.495},{"duration":34,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":22,"tweenEasing":0,"value":0.825},{"tweenEasing":0,"value":0.895},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.845},{"duration":3,"tweenEasing":0,"value":0.795},{"duration":2,"tweenEasing":0,"value":0.615},{"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.51},{"duration":29,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.51},{"duration":4,"value":0.515}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":66,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.5043},{"duration":22,"tweenEasing":0,"value":0.5168},{"duration":17,"tweenEasing":0,"value":0.9757},{"tweenEasing":0,"value":0.9998},{"value":0.9997}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":23,"tweenEasing":0,"value":0.977},{"tweenEasing":0,"value":0.9737},{"duration":2,"tweenEasing":0,"value":0.9478},{"duration":5,"tweenEasing":0,"value":0.8603},{"duration":2,"tweenEasing":0,"value":0.5937},{"tweenEasing":0,"value":0.525},{"duration":30,"tweenEasing":0,"value":0.5065},{"tweenEasing":0,"value":0.4942},{"value":0.494}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.3355},{"duration":10,"tweenEasing":0,"value":0.3456},{"duration":30,"tweenEasing":0,"value":0.4978},{"tweenEasing":0,"value":0.499},{"value":0.4989}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":58,"tweenEasing":0,"value":0.39},{"value":0.39},{"duration":7,"value":0.385}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":52,"tweenEasing":0,"value":0.3367},{"value":0.3367},{"duration":13,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":57,"tweenEasing":0,"value":0.87},{"tweenEasing":0,"value":0.865},{"duration":8,"value":0.86}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":47,"tweenEasing":0,"value":0.375},{"tweenEasing":0,"value":0.495},{"duration":18,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.1933},{"tweenEasing":0,"value":0.19},{"duration":33,"value":0.1867}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":48,"tweenEasing":0,"value":0.815},{"tweenEasing":0,"value":0.82},{"duration":17,"value":0.825}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.385}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":66,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":21,"value":0.505}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":58,"playTimes":0,"fadeInTime":0.3,"name":"flick_head_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":10,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.03},{"duration":4,"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.69},{"duration":2,"tweenEasing":0,"value":0.84},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.555},{"duration":4,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":2,"tweenEasing":0,"value":0.745},{"duration":2,"tweenEasing":0,"value":0.065},{"duration":4,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.21},{"duration":3,"tweenEasing":0,"value":0.03},{"tweenEasing":0,"value":0.01},{"duration":4}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.435},{"tweenEasing":0,"value":0.27},{"value":0.265}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":19,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":23,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.56},{"duration":40,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.57}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":51,"tweenEasing":0,"value":0.305},{"tweenEasing":0,"value":0.245},{"duration":6,"value":0.24}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.57},{"duration":48,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.58}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.295},{"tweenEasing":0,"value":0.255},{"value":0.25}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":19,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":23,"value":0.6667}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.5213},{"tweenEasing":0,"value":0.7707},{"value":0.7733}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.57},{"duration":48,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.58}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":54,"tweenEasing":0,"value":0.24},{"tweenEasing":0,"value":0.315},{"duration":3,"value":0.32}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":58,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":54,"tweenEasing":0,"value":0.2433},{"tweenEasing":0,"value":0.24},{"duration":3,"value":0.2367}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.815}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.4},{"value":0.395}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.56},{"duration":40,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.57}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":78,"playTimes":0,"fadeInTime":0.3,"name":"flick_head_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.06},{"duration":4,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.73},{"duration":6,"tweenEasing":0,"value":0.965},{"duration":4,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.39},{"duration":2,"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.645},{"duration":2,"tweenEasing":0,"value":0.68},{"duration":2,"tweenEasing":0,"value":0.58},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":4,"tweenEasing":0,"value":0.54},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.14},{"tweenEasing":0,"value":0.085},{"duration":13,"value":0.03}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.255},{"tweenEasing":0,"value":0.495},{"duration":43,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":41,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.46}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.5},{"duration":20,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.775},{"duration":43,"value":0.78}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.69},{"duration":44,"value":0.695}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":31,"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.495},{"duration":46,"value":0.5}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":41,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.46}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":19,"tweenEasing":0,"value":0.16},{"duration":15,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.495},{"duration":43,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.505},{"duration":43,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.59},{"duration":45,"value":0.595}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.1208},{"tweenEasing":0,"value":0.499},{"duration":42,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":10,"tweenEasing":0,"value":0.9978},{"duration":22,"tweenEasing":0,"value":0.9422},{"duration":27,"tweenEasing":0,"value":0.5202},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.4632},{"duration":6,"tweenEasing":0,"value":0.4218},{"tweenEasing":0,"value":0.0782},{"tweenEasing":0,"value":0.0368},{"tweenEasing":0,"value":0.01},{"tweenEasing":0},{"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.0368},{"duration":3,"tweenEasing":0,"value":0.0782},{"tweenEasing":0,"value":0.25},{"tweenEasing":0,"value":0.3123}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.675},{"duration":44,"value":0.68}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.2926},{"tweenEasing":0,"value":0.4994},{"duration":42,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.485},{"duration":8,"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.75},{"duration":3,"tweenEasing":0,"value":0.735},{"duration":11,"tweenEasing":0,"value":0.66},{"duration":3,"tweenEasing":0,"value":0.21},{"tweenEasing":0,"value":0.135},{"tweenEasing":0,"value":0.125},{"duration":42,"value":0.12}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.3533},{"tweenEasing":0,"value":0.3367},{"duration":47,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.265},{"duration":8,"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.485},{"tweenEasing":0,"value":0.495},{"duration":63,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":78,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":78,"value":0.815}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.585},{"duration":45,"value":0.59}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"duration":21,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.78},{"tweenEasing":0,"value":0.78},{"duration":43,"value":0.785}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":269,"playTimes":0,"fadeInTime":2,"name":"idle_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":176,"tweenEasing":0},{"tweenEasing":0,"value":0.005},{"duration":92}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6633},{"tweenEasing":0,"value":0.6367},{"duration":2,"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.3567},{"duration":29,"tweenEasing":0,"value":0.33},{"duration":21,"tweenEasing":0,"value":0.3567},{"duration":4,"tweenEasing":0,"value":0.9333},{"duration":7,"tweenEasing":0,"value":0.9933},{"duration":22,"tweenEasing":0,"value":0.9733},{"duration":46,"tweenEasing":0,"value":0.6767},{"tweenEasing":0,"value":0.6533},{"duration":5,"tweenEasing":0,"value":0.6233},{"duration":2,"tweenEasing":0,"value":0.3933},{"duration":2,"tweenEasing":0,"value":0.3433},{"duration":12,"tweenEasing":0,"value":0.34},{"duration":71,"tweenEasing":0,"value":0.6033},{"tweenEasing":0,"value":0.6633},{"duration":10,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6633},{"tweenEasing":0,"value":0.64},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.36},{"duration":29,"tweenEasing":0,"value":0.3367},{"duration":22,"tweenEasing":0,"value":0.3567},{"duration":5,"tweenEasing":0,"value":0.95},{"duration":28,"tweenEasing":0,"value":1},{"duration":45,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.6533},{"duration":5,"tweenEasing":0,"value":0.6233},{"duration":2,"tweenEasing":0,"value":0.3933},{"duration":2,"tweenEasing":0,"value":0.3433},{"duration":12,"tweenEasing":0,"value":0.34},{"duration":71,"tweenEasing":0,"value":0.6033},{"tweenEasing":0,"value":0.6633},{"duration":10,"value":0.6667}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.5},{"duration":87,"tweenEasing":0,"value":0.285},{"duration":27,"tweenEasing":0,"value":0.765},{"duration":66,"tweenEasing":0,"value":0.49},{"duration":50,"tweenEasing":0,"value":0.825},{"tweenEasing":0,"value":0.505},{"duration":3,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.205},{"tweenEasing":0,"value":0.06},{"duration":15,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":0.14},{"duration":8,"tweenEasing":0,"value":0.74},{"duration":7,"tweenEasing":0,"value":0.77},{"duration":17,"tweenEasing":0,"value":0.665},{"duration":5,"tweenEasing":0,"value":0.275},{"duration":24,"tweenEasing":0,"value":0.25},{"duration":4,"tweenEasing":0,"value":0.69},{"duration":7,"tweenEasing":0,"value":0.71},{"duration":30,"tweenEasing":0,"value":0.615},{"duration":32,"tweenEasing":0,"value":0.11},{"duration":45,"tweenEasing":0,"value":0.015},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"duration":3,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":267,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.4998},{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":41,"tweenEasing":0,"value":0.5},{"duration":54,"tweenEasing":0,"value":0.626},{"duration":85,"tweenEasing":0,"value":0.2032},{"duration":31,"tweenEasing":0,"value":0.5232},{"duration":56,"tweenEasing":0,"value":0.1202},{"tweenEasing":0,"value":0.4997},{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":266,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5001},{"duration":2,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":52,"tweenEasing":0,"value":0.5},{"duration":92,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.505},{"duration":124,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":246,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.33},{"duration":22,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.415},{"duration":35,"tweenEasing":0,"value":0.48},{"duration":146,"tweenEasing":0,"value":0.085},{"duration":18,"tweenEasing":0,"value":0.155},{"tweenEasing":0,"value":0.41},{"duration":2,"value":0.415}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.6},{"tweenEasing":0,"value":0.6},{"duration":3,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.63},{"duration":2,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.65},{"duration":3,"tweenEasing":0,"value":0.65},{"duration":46,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.99},{"duration":3,"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.96},{"tweenEasing":0,"value":0.94},{"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":0.91},{"duration":17,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"duration":8,"tweenEasing":0,"value":0.6},{"tweenEasing":0,"value":0.6},{"duration":5,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"duration":4,"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.63},{"duration":3,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.66},{"duration":2,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.67},{"duration":90,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.98},{"tweenEasing":0,"value":0.96},{"duration":11,"tweenEasing":0,"value":0.96},{"tweenEasing":0,"value":0.86},{"duration":28,"tweenEasing":0,"value":0.84},{"tweenEasing":0,"value":0.61},{"duration":4,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":270,"playTimes":0,"fadeInTime":2,"name":"idle_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.6367},{"duration":5,"tweenEasing":0,"value":0.6067},{"duration":2,"tweenEasing":0,"value":0.3833},{"duration":10,"tweenEasing":0,"value":0.3367},{"duration":25,"tweenEasing":0,"value":0.3433},{"duration":20,"tweenEasing":0,"value":0.8833},{"duration":26,"tweenEasing":0,"value":0.9967},{"duration":47,"tweenEasing":0,"value":0.6733},{"tweenEasing":0,"value":0.6567},{"duration":9,"tweenEasing":0,"value":0.64},{"duration":5,"tweenEasing":0,"value":0.2867},{"duration":2,"tweenEasing":0,"value":0.0567},{"duration":30,"tweenEasing":0,"value":0.0067},{"duration":4,"tweenEasing":0,"value":0.0067},{"duration":6,"tweenEasing":0,"value":0.1},{"duration":3,"tweenEasing":0,"value":0.3367},{"duration":6,"tweenEasing":0,"value":0.4667},{"duration":6,"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6633},{"duration":30,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":31,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6533},{"duration":5,"tweenEasing":0,"value":0.6233},{"duration":2,"tweenEasing":0,"value":0.3933},{"duration":10,"tweenEasing":0,"value":0.3433},{"duration":5,"tweenEasing":0,"value":0.34},{"duration":17,"tweenEasing":0,"value":0.4367},{"duration":22,"tweenEasing":0,"value":0.8567},{"duration":27,"tweenEasing":0,"value":1},{"duration":47,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.6567},{"duration":9,"tweenEasing":0,"value":0.64},{"duration":5,"tweenEasing":0,"value":0.2867},{"duration":2,"tweenEasing":0,"value":0.0567},{"duration":30,"tweenEasing":0,"value":0.0067},{"duration":4,"tweenEasing":0,"value":0.0067},{"duration":6,"tweenEasing":0,"value":0.1},{"duration":3,"tweenEasing":0,"value":0.3367},{"duration":6,"tweenEasing":0,"value":0.4667},{"duration":6,"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6633},{"duration":30,"value":0.6667}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":39,"tweenEasing":0,"value":0.5},{"duration":83,"tweenEasing":0,"value":0.285},{"duration":27,"tweenEasing":0,"value":0.765},{"duration":85,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495},{"duration":35,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.69},{"duration":3,"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.14},{"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.015},{"duration":12,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":0.105},{"duration":7,"tweenEasing":0,"value":0.745},{"duration":7,"tweenEasing":0,"value":0.77},{"duration":17,"tweenEasing":0,"value":0.665},{"duration":5,"tweenEasing":0,"value":0.275},{"duration":24,"tweenEasing":0,"value":0.25},{"duration":4,"tweenEasing":0,"value":0.69},{"duration":3,"tweenEasing":0,"value":0.71},{"duration":10,"tweenEasing":0,"value":0.685},{"duration":89,"tweenEasing":0,"value":0.48},{"tweenEasing":0,"value":0.495},{"duration":17,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":222,"tweenEasing":0,"value":0.5},{"duration":45,"tweenEasing":0,"value":0.4515},{"tweenEasing":0,"value":0.5003},{"duration":2,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":41,"tweenEasing":0,"value":0.5},{"duration":54,"tweenEasing":0,"value":0.626},{"duration":110,"tweenEasing":0,"value":0.2032},{"tweenEasing":0,"value":0.5002},{"duration":64,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":179,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.4999},{"duration":90,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":52,"tweenEasing":0,"value":0.5},{"duration":92,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.505},{"duration":125,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":246,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.33},{"duration":23,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"tweenEasing":0,"value":1}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.6},{"tweenEasing":0,"value":0.6},{"duration":3,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.63},{"duration":2,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.65},{"duration":3,"tweenEasing":0,"value":0.65},{"duration":46,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.99},{"duration":3,"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.96},{"tweenEasing":0,"value":0.94},{"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":0.91},{"duration":17,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"duration":179,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":270,"playTimes":0,"fadeInTime":2,"name":"idle_00","timeline":[{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.5},{"duration":24,"tweenEasing":0,"value":0.3902},{"duration":75,"tweenEasing":0,"value":0.6823},{"tweenEasing":0,"value":0.5007},{"duration":90,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.5},{"duration":49,"tweenEasing":0,"value":0.1833},{"duration":23,"tweenEasing":0,"value":0.206},{"duration":165,"tweenEasing":0,"value":0.6368},{"tweenEasing":0,"value":0.5003},{"duration":2,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":84,"tweenEasing":0,"value":0.5},{"duration":184,"tweenEasing":0,"value":0.5616},{"tweenEasing":0,"value":0.4999},{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":60,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":7,"tweenEasing":0,"value":0.57},{"duration":2,"tweenEasing":0,"value":0.91},{"tweenEasing":0,"value":0.975},{"duration":168,"tweenEasing":0,"value":0.995},{"duration":2,"tweenEasing":0,"value":0.995},{"duration":9,"tweenEasing":0,"value":0.95},{"duration":2,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.505},{"duration":15,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":55,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":34,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6567},{"duration":6,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.3567},{"duration":60,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3433},{"duration":6,"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.66},{"duration":49,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":55,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":34,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6567},{"duration":6,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.3567},{"duration":60,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3433},{"duration":6,"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.66},{"duration":49,"value":0.6667}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.5},{"duration":24,"tweenEasing":0,"value":0.43},{"duration":161,"tweenEasing":0,"value":0.685},{"tweenEasing":0,"value":0.505},{"duration":4,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":77,"tweenEasing":0,"value":0.5},{"duration":9,"tweenEasing":0,"value":0.705},{"duration":14,"tweenEasing":0,"value":0.54},{"duration":4,"tweenEasing":0,"value":0.185},{"duration":162,"tweenEasing":0,"value":0.145},{"tweenEasing":0,"value":0.495},{"duration":3,"value":0.5}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":139,"playTimes":0,"fadeInTime":0.3,"name":"pinch_in_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":17,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.095},{"duration":4,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.535},{"duration":2,"tweenEasing":0,"value":1},{"duration":4,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.61},{"duration":20,"tweenEasing":0,"value":0.195},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.3},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":4,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":4,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":14,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.03},{"duration":4,"tweenEasing":0,"value":0.635},{"duration":2,"tweenEasing":0,"value":0.605},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.7},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.635},{"duration":12,"tweenEasing":0,"value":0.895},{"duration":4,"tweenEasing":0,"value":0.66},{"duration":2,"tweenEasing":0,"value":0.155},{"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.01},{"duration":5,"value":0.005}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":129,"tweenEasing":0,"value":0.89},{"duration":8,"tweenEasing":0,"value":0.945},{"tweenEasing":0,"value":0.84},{"tweenEasing":0,"value":0.825}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8733},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.7233},{"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4833},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3733},{"duration":2,"tweenEasing":0,"value":0.4733},{"tweenEasing":0,"value":0.7433},{"tweenEasing":0,"value":0.8433},{"duration":64,"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4367},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.3233},{"tweenEasing":0,"value":0.3433},{"duration":3,"tweenEasing":0,"value":0.3833},{"tweenEasing":0,"value":0.5367},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6033},{"duration":31,"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":93,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.465},{"duration":9,"tweenEasing":0,"value":0.435},{"duration":33,"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.295},{"tweenEasing":0,"value":0.31}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":111,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":27,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.16},{"tweenEasing":0,"value":0.15},{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":61,"tweenEasing":0,"value":0.74},{"duration":8,"tweenEasing":0,"value":0.8},{"duration":18,"tweenEasing":0,"value":0.68},{"duration":6,"tweenEasing":0,"value":0.27},{"duration":44,"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.37}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":133,"tweenEasing":0,"value":0.075},{"duration":4,"tweenEasing":0,"value":0.03},{"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.075}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8767},{"tweenEasing":0,"value":0.7433},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.7233},{"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4833},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3733},{"duration":2,"tweenEasing":0,"value":0.4733},{"tweenEasing":0,"value":0.7433},{"tweenEasing":0,"value":0.8433},{"duration":64,"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.35},{"duration":3,"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.5367},{"tweenEasing":0,"value":0.6},{"duration":31,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":139,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":65,"tweenEasing":0,"value":0.515},{"duration":23,"tweenEasing":0,"value":0.55},{"duration":4,"tweenEasing":0,"value":0.915},{"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":0.915},{"duration":2,"tweenEasing":0,"value":0.885},{"duration":5,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.43},{"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.29},{"tweenEasing":0,"value":0.265},{"duration":31,"tweenEasing":0,"value":0.255},{"tweenEasing":0,"value":0.31},{"tweenEasing":0,"value":0.315}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":93,"tweenEasing":0,"value":0.545},{"duration":3,"tweenEasing":0,"value":0.6},{"duration":7,"tweenEasing":0,"value":0.545},{"duration":31,"tweenEasing":0,"value":0.365},{"duration":3,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.39}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":139,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":129,"tweenEasing":0,"value":0.505},{"duration":8,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.735},{"tweenEasing":0,"value":0.72}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":132,"tweenEasing":0,"value":0.7722},{"duration":5,"tweenEasing":0,"value":0.9732},{"tweenEasing":0,"value":0.9192},{"tweenEasing":0,"value":0.9062}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":84,"tweenEasing":0,"value":0.6392},{"duration":21,"tweenEasing":0,"value":0.5245},{"duration":32,"tweenEasing":0,"value":0.2512},{"tweenEasing":0,"value":0.2923},{"value":0.2997}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":61,"tweenEasing":0,"value":0.745},{"duration":8,"tweenEasing":0,"value":0.805},{"duration":18,"tweenEasing":0,"value":0.685},{"duration":6,"tweenEasing":0,"value":0.27},{"duration":44,"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.31},{"value":0.315}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.4752},{"tweenEasing":0,"value":0.4877},{"tweenEasing":0,"value":0.4883}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":136,"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.285},{"duration":2,"value":0.29}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":136,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.36},{"duration":2,"value":0.3567}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":87,"tweenEasing":0,"value":0.435},{"duration":15,"tweenEasing":0,"value":0.61},{"duration":35,"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.72},{"value":0.715}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":136,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.425},{"duration":2,"value":0.43}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":130,"tweenEasing":0,"value":0.4767},{"duration":7,"tweenEasing":0,"value":0.5433},{"tweenEasing":0,"value":0.4633},{"tweenEasing":0,"value":0.45}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.305},{"duration":3,"tweenEasing":0,"value":0.195},{"duration":129,"tweenEasing":0,"value":0.165},{"tweenEasing":0,"value":0.445},{"tweenEasing":0,"value":0.455}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.455},{"value":0.46}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":134,"tweenEasing":0,"value":0.405},{"tweenEasing":0,"value":0.5},{"duration":4,"value":0.505}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.555},{"tweenEasing":0,"value":0.55}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.44},{"duration":112,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.355}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":96,"tweenEasing":0,"value":0.5},{"duration":9,"tweenEasing":0,"value":0.44},{"duration":32,"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.385}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.58},{"value":0.58},{"duration":113,"value":0.59}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":78,"playTimes":0,"fadeInTime":0.3,"name":"pinch_in_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.005},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.58},{"duration":2,"tweenEasing":0,"value":0.83},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":4,"tweenEasing":0,"value":0.715},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.28},{"duration":2,"tweenEasing":0,"value":0.095},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.205},{"tweenEasing":0,"value":0.04},{"tweenEasing":0,"value":0.535},{"tweenEasing":0,"value":1},{"duration":7,"tweenEasing":0,"value":0.97},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":4,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.58},{"duration":15,"tweenEasing":0,"value":0.07},{"tweenEasing":0,"value":0.065},{"duration":3,"value":0.06}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":78,"value":0.675}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.5933},{"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.73},{"tweenEasing":0,"value":0.8267},{"tweenEasing":0,"value":0.8867},{"duration":30,"tweenEasing":0,"value":0.9067},{"tweenEasing":0,"value":0.8267},{"duration":2,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.3733},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3767},{"duration":2,"tweenEasing":0,"value":0.4767},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.8067},{"tweenEasing":0,"value":0.8667},{"duration":17,"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.8567},{"tweenEasing":0,"value":0.8533}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":78,"value":0.505}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":78,"value":0.305}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":73,"tweenEasing":0,"value":0.855},{"tweenEasing":0,"value":0.915},{"duration":4,"value":0.91}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.5933},{"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.8233},{"tweenEasing":0,"value":0.8833},{"duration":30,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8267},{"duration":2,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.3733},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3767},{"duration":2,"tweenEasing":0,"value":0.4767},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.8067},{"tweenEasing":0,"value":0.8667},{"duration":17,"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.8567},{"tweenEasing":0,"value":0.8533}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":78,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":20,"tweenEasing":0,"value":0.54},{"duration":18,"tweenEasing":0,"value":0.52},{"duration":2,"tweenEasing":0,"value":0.305},{"duration":7,"tweenEasing":0,"value":0.305},{"duration":12,"tweenEasing":0,"value":0.425},{"duration":3,"tweenEasing":0,"value":0.74},{"duration":12,"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.77},{"duration":3,"value":0.765}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.34},{"duration":15,"tweenEasing":0,"value":0.28},{"duration":12,"tweenEasing":0,"value":0.56},{"duration":23,"tweenEasing":0,"value":0.87},{"duration":7,"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.99},{"duration":2,"value":0.985}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":78,"value":0.51}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":76,"tweenEasing":0,"value":0.5833},{"tweenEasing":0,"value":0.5963},{"tweenEasing":0,"value":0.5995}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.4947},{"duration":23,"tweenEasing":0,"value":0.5628},{"duration":41,"tweenEasing":0,"value":0.983},{"tweenEasing":0,"value":0.983},{"value":0.98}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":75,"tweenEasing":0,"value":0.855},{"tweenEasing":0,"value":0.915},{"duration":2,"value":0.91}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":43,"tweenEasing":0,"value":0.4833},{"duration":19,"tweenEasing":0,"value":0.409},{"duration":14,"tweenEasing":0,"value":0.6238},{"tweenEasing":0,"value":0.6174},{"tweenEasing":0,"value":0.6163}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":59,"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.4},{"duration":18,"value":0.405}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":78,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":59,"tweenEasing":0,"value":0.475},{"tweenEasing":0,"value":0.455},{"duration":18,"value":0.46}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.485},{"duration":27,"tweenEasing":0,"value":0.435},{"tweenEasing":0,"value":0.57},{"duration":6,"value":0.565}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.21}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":76,"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.375},{"value":0.38}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":78,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":14,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":55,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":12,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":78,"value":0.51}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":76,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.235},{"value":0.23}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":84,"playTimes":0,"fadeInTime":0.3,"name":"pinch_in_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.225},{"duration":4,"tweenEasing":0,"value":0.635},{"duration":2,"tweenEasing":0,"value":0.66},{"duration":2,"tweenEasing":0,"value":0.175},{"duration":26,"tweenEasing":0,"value":0.015},{"duration":4,"tweenEasing":0,"value":0.22},{"duration":2,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.54},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":10,"tweenEasing":0,"value":0.51},{"duration":2,"tweenEasing":0,"value":0.895},{"duration":3,"tweenEasing":0,"value":0.22},{"tweenEasing":0,"value":0.055},{"duration":4}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.68},{"value":0.68},{"duration":20,"value":0.675}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.92},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5133},{"tweenEasing":0,"value":0.3833},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.7933},{"duration":11,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.81},{"duration":16,"value":0.8133}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":20,"value":0.505}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":20,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.31},{"value":0.31},{"duration":20,"value":0.305}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":53,"tweenEasing":0,"value":0.71},{"duration":29,"tweenEasing":0,"value":0.975},{"tweenEasing":0,"value":0.945},{"value":0.94}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5133},{"tweenEasing":0,"value":0.3833},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.7933},{"duration":28,"value":0.81}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":65,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":73,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.565},{"duration":10,"value":0.56}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.815},{"tweenEasing":0,"value":0.685},{"value":0.68}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.515},{"value":0.515},{"duration":20,"value":0.51}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.7602},{"duration":39,"tweenEasing":0,"value":0.9083},{"duration":27,"tweenEasing":0,"value":0.9885},{"tweenEasing":0,"value":0.5877},{"tweenEasing":0,"value":0.5845},{"duration":8,"value":0.5833}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.4067},{"tweenEasing":0,"value":0.4395},{"tweenEasing":0,"value":0.4405}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":53,"tweenEasing":0,"value":0.71},{"duration":29,"tweenEasing":0,"value":0.975},{"tweenEasing":0,"value":0.945},{"value":0.94}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.4908},{"tweenEasing":0,"value":0.4751},{"duration":2,"value":0.4752}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":72,"tweenEasing":0,"value":0.29},{"tweenEasing":0,"value":0.375},{"duration":11,"value":0.38}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.3333},{"value":0.3333},{"duration":20,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":64,"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.48},{"duration":19,"value":0.475}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":61,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.48},{"duration":22,"value":0.485}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.21}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.54},{"value":0.535}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.44},{"value":0.44},{"duration":20,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":84,"value":0.505}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.51},{"value":0.51},{"value":0.505}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.515},{"value":0.515},{"duration":20,"value":0.51}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.35},{"duration":3,"value":0.355}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":20,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":85,"playTimes":0,"fadeInTime":0.5,"name":"shake_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":6,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":4,"tweenEasing":0,"value":0.12},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.575},{"duration":6,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":4,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.19},{"duration":10,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.025},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":4,"tweenEasing":0,"value":0.275},{"duration":2,"tweenEasing":0,"value":0.995},{"duration":2,"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.445},{"duration":4,"tweenEasing":0,"value":0.995},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.7},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":7,"tweenEasing":0,"value":0.045},{"tweenEasing":0,"value":0.055},{"duration":2,"value":0.06}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":78,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.28},{"duration":6,"value":0.275}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7167},{"duration":3,"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.88},{"duration":5,"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.8767},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.7167},{"tweenEasing":0,"value":0.5033},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.85},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"duration":2,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.8033},{"duration":32,"tweenEasing":0,"value":0.7633},{"tweenEasing":0,"value":0.77},{"duration":7,"value":0.7733}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.47},{"value":0.465}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.35},{"duration":2,"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.03},{"duration":65,"tweenEasing":0},{"tweenEasing":0,"value":0.17},{"tweenEasing":0,"value":0.175}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.415},{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.735},{"tweenEasing":0,"value":0.805},{"duration":39,"tweenEasing":0,"value":0.83},{"duration":26,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.625},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.305},{"duration":2,"tweenEasing":0,"value":0.245},{"tweenEasing":0,"value":0.085},{"tweenEasing":0,"value":0.025},{"duration":65,"tweenEasing":0},{"tweenEasing":0,"value":0.225},{"tweenEasing":0,"value":0.23}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"duration":3,"tweenEasing":0,"value":0.46},{"duration":4,"tweenEasing":0,"value":0.35},{"duration":15,"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.495},{"duration":48,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.7233},{"tweenEasing":0,"value":0.7367},{"duration":4,"tweenEasing":0,"value":0.75},{"tweenEasing":0,"value":0.8833},{"duration":5,"tweenEasing":0,"value":0.8967},{"tweenEasing":0,"value":0.87},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.4967},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.8533},{"tweenEasing":0,"value":0.9067},{"tweenEasing":0,"value":0.7633},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.8633},{"tweenEasing":0,"value":0.9067},{"duration":2,"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.8033},{"duration":40,"value":0.7867}]},{"name":"PARAM_DESK","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.465},{"tweenEasing":0,"value":0.455},{"tweenEasing":0,"value":0.475},{"tweenEasing":0,"value":0.51},{"duration":2,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.51},{"duration":64,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.34},{"tweenEasing":0,"value":0.3},{"duration":18,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.5},{"duration":48,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.29},{"duration":5,"tweenEasing":0,"value":0.265},{"duration":61,"tweenEasing":0,"value":0.355},{"tweenEasing":0,"value":0.455},{"duration":5,"value":0.46}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.48},{"tweenEasing":0,"value":0.46},{"duration":2,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.23},{"duration":10,"tweenEasing":0,"value":0.21},{"duration":15,"tweenEasing":0,"value":0.31},{"duration":31,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.495},{"duration":10,"value":0.49}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.715},{"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.785},{"duration":17,"tweenEasing":0,"value":0.785},{"tweenEasing":0,"value":0.51},{"duration":48,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.515},{"duration":3,"value":0.52}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.8623},{"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.8647},{"duration":2,"tweenEasing":0,"value":0.8193},{"tweenEasing":0,"value":0.6985},{"tweenEasing":0,"value":0.6527},{"duration":65,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.5842},{"value":0.5833}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.5142},{"tweenEasing":0,"value":0.4923},{"value":0.4922}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.575},{"duration":2,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.875},{"duration":65,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.635},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.5272},{"tweenEasing":0,"value":0.5277},{"tweenEasing":0,"value":0.5273}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.125},{"duration":2,"tweenEasing":0,"value":0.19},{"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.415},{"duration":55,"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.265},{"duration":11,"value":0.26}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":7,"tweenEasing":0,"value":0.28},{"duration":3,"tweenEasing":0,"value":0.2833},{"duration":7,"tweenEasing":0,"value":0.3333},{"duration":65,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.3067},{"duration":2,"value":0.3033}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.38},{"duration":4,"tweenEasing":0,"value":0.38},{"duration":64,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.37},{"duration":3,"value":0.365}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.705},{"duration":4,"tweenEasing":0,"value":0.695},{"tweenEasing":0,"value":0.56},{"duration":61,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.57},{"duration":5,"value":0.575}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":10,"tweenEasing":0,"value":0.3233},{"duration":7,"tweenEasing":0,"value":0.34},{"duration":66,"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.29},{"tweenEasing":0,"value":0.2867}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.36},{"duration":3,"value":0.365}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.415},{"tweenEasing":0,"value":0.42},{"duration":4,"tweenEasing":0,"value":0.435},{"tweenEasing":0,"value":0.575},{"duration":16,"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.56},{"duration":50,"value":0.555}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.48},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.335},{"duration":18,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.49},{"duration":48,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.73},{"tweenEasing":0,"value":0.785},{"duration":4,"tweenEasing":0,"value":0.81},{"duration":13,"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.51},{"duration":48,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.485},{"duration":3,"tweenEasing":0,"value":0.455},{"tweenEasing":0,"value":0.345},{"duration":61,"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.475},{"duration":5,"value":0.47}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":2,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":70,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":11,"value":0.505}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.015},{"tweenEasing":0},{"tweenEasing":0,"value":0.065},{"duration":2,"tweenEasing":0,"value":0.22},{"tweenEasing":0,"value":0.625},{"tweenEasing":0,"value":0.78},{"tweenEasing":0,"value":0.845},{"duration":24,"tweenEasing":0,"value":0.845},{"duration":39,"tweenEasing":0,"value":0.39},{"tweenEasing":0,"value":0.245},{"duration":2,"value":0.24}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.475},{"duration":2,"value":0.47}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":86,"playTimes":0,"fadeInTime":0.5,"name":"shake_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":20,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":4,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.95},{"duration":4,"tweenEasing":0,"value":0.8},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":4,"tweenEasing":0,"value":0.205},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":4,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.085},{"duration":2,"tweenEasing":0,"value":0.125},{"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.84},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.59},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.81},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.445},{"duration":6,"tweenEasing":0,"value":0.77},{"duration":2,"tweenEasing":0,"value":0.755},{"tweenEasing":0,"value":0.15},{"tweenEasing":0,"value":0.085},{"duration":4,"value":0.025}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":86,"value":0.68}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.74},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3533},{"duration":2,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5333},{"tweenEasing":0,"value":0.5833},{"tweenEasing":0,"value":0.6167},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.5467},{"duration":3,"tweenEasing":0,"value":0.4633},{"tweenEasing":0,"value":0.1633},{"tweenEasing":0,"value":0.08},{"tweenEasing":0,"value":0.02},{"duration":24,"tweenEasing":0},{"tweenEasing":0},{"duration":37,"value":0.0033}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.305},{"value":0.305},{"duration":48,"value":0.31}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.76},{"duration":5,"tweenEasing":0,"value":0.75},{"duration":10,"tweenEasing":0,"value":0.65},{"duration":4,"tweenEasing":0,"value":0.37},{"duration":28,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.3},{"duration":33,"value":0.295}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.185},{"tweenEasing":0,"value":0.35},{"duration":51,"value":0.355}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"duration":2,"tweenEasing":0,"value":0.6567},{"tweenEasing":0,"value":0.4367},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3533},{"duration":2,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5333},{"tweenEasing":0,"value":0.5833},{"tweenEasing":0,"value":0.6167},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.5467},{"duration":3,"tweenEasing":0,"value":0.4633},{"tweenEasing":0,"value":0.1633},{"tweenEasing":0,"value":0.08},{"tweenEasing":0,"value":0.02},{"duration":24,"tweenEasing":0},{"tweenEasing":0},{"duration":37,"value":0.0033}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":77,"tweenEasing":0,"value":0.415},{"tweenEasing":0,"value":0.475},{"duration":8,"value":0.48}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.565},{"tweenEasing":0,"value":0.62},{"duration":22,"value":0.625}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.49}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":84,"tweenEasing":0,"value":0.6675},{"tweenEasing":0,"value":0.6802},{"tweenEasing":0,"value":0.6773}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.5703},{"duration":16,"tweenEasing":0,"value":0.5522},{"duration":63,"tweenEasing":0,"value":0.1095},{"tweenEasing":0,"value":0.2483},{"tweenEasing":0,"value":0.256}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.765},{"duration":6,"tweenEasing":0,"value":0.755},{"duration":8,"tweenEasing":0,"value":0.62},{"duration":5,"tweenEasing":0,"value":0.375},{"duration":18,"tweenEasing":0,"value":0.31},{"tweenEasing":0,"value":0.305},{"duration":43,"value":0.3}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":64,"tweenEasing":0,"value":0.5517},{"tweenEasing":0,"value":0.5168},{"duration":21,"value":0.5167}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":48,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.425},{"duration":3,"tweenEasing":0,"value":0.355},{"duration":53,"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.36},{"duration":4,"value":0.355}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.4},{"duration":51,"value":0.405}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.485},{"duration":52,"value":0.49}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.2067},{"duration":15,"tweenEasing":0,"value":0.2267},{"duration":63,"tweenEasing":0,"value":0.5633},{"tweenEasing":0,"value":0.51},{"value":0.4967}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.77},{"tweenEasing":0,"value":0.765},{"duration":2,"value":0.76}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.44},{"value":0.44},{"duration":48,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":86,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":86,"value":0.48}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":7,"tweenEasing":0,"value":0.465},{"duration":13,"tweenEasing":0,"value":0.495},{"duration":3,"tweenEasing":0,"value":0.775},{"duration":46,"tweenEasing":0,"value":0.805},{"tweenEasing":0,"value":0.585},{"duration":16,"value":0.58}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":101,"playTimes":0,"fadeInTime":0.5,"name":"shake_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.09},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":4,"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.91},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.375},{"duration":2,"tweenEasing":0,"value":0.07},{"duration":2,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":4,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.605},{"duration":2,"tweenEasing":0,"value":0.44},{"duration":6,"tweenEasing":0,"value":0.07},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.135},{"duration":4,"tweenEasing":0,"value":0.99},{"duration":2,"tweenEasing":0,"value":0.675},{"duration":2,"tweenEasing":0,"value":0.95},{"tweenEasing":0,"value":0.83},{"tweenEasing":0,"value":0.955},{"tweenEasing":0,"value":1},{"duration":3,"tweenEasing":0,"value":0.96},{"duration":2,"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.745},{"duration":2,"tweenEasing":0,"value":0.95},{"duration":2,"tweenEasing":0,"value":0.72},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":12,"tweenEasing":0,"value":0.125},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.06},{"tweenEasing":0,"value":0.015}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.305},{"duration":56,"value":0.3}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7167},{"duration":3,"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.88},{"duration":5,"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.8767},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.7167},{"tweenEasing":0,"value":0.5033},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.85},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"duration":2,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8733},{"tweenEasing":0,"value":0.82},{"duration":18,"tweenEasing":0,"value":0.78},{"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.4367},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.6767},{"duration":25,"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.6867},{"duration":13,"value":0.69}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":86,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.495},{"duration":14,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.35},{"duration":2,"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.03},{"duration":40,"tweenEasing":0},{"tweenEasing":0,"value":0.165},{"duration":53,"value":0.17}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.555},{"tweenEasing":0,"value":0.735},{"tweenEasing":0,"value":0.8},{"duration":17,"tweenEasing":0,"value":0.83},{"duration":10,"tweenEasing":0,"value":0.76},{"duration":12,"tweenEasing":0,"value":0.585},{"duration":3,"tweenEasing":0,"value":0.2},{"duration":14,"tweenEasing":0,"value":0.145},{"duration":24,"tweenEasing":0,"value":0.215},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.49},{"duration":12,"value":0.495}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.305},{"duration":2,"tweenEasing":0,"value":0.245},{"tweenEasing":0,"value":0.085},{"tweenEasing":0,"value":0.025},{"duration":41,"tweenEasing":0},{"tweenEasing":0,"value":0.015},{"duration":52,"value":0.01}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"duration":3,"tweenEasing":0,"value":0.46},{"duration":4,"tweenEasing":0,"value":0.35},{"duration":15,"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.495},{"duration":75,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.7367},{"tweenEasing":0,"value":0.7367},{"tweenEasing":0,"value":0.7533},{"duration":2,"tweenEasing":0,"value":0.7867},{"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.92},{"duration":3,"tweenEasing":0,"value":0.9367},{"duration":2,"tweenEasing":0,"value":0.9267},{"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.8533},{"tweenEasing":0,"value":0.9067},{"tweenEasing":0,"value":0.7633},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.8633},{"tweenEasing":0,"value":0.9067},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":18,"tweenEasing":0,"value":0.8033},{"tweenEasing":0,"value":0.6533},{"duration":2,"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4067},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3233},{"tweenEasing":0,"value":0.3533},{"duration":2,"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.68},{"duration":31,"tweenEasing":0,"value":0.71},{"tweenEasing":0,"value":0.68},{"duration":7,"value":0.6833}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.465},{"tweenEasing":0,"value":0.455},{"tweenEasing":0,"value":0.475},{"tweenEasing":0,"value":0.51},{"duration":2,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.51},{"duration":91,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.34},{"tweenEasing":0,"value":0.3},{"duration":18,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.5},{"duration":75,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":2,"tweenEasing":0,"value":0.26},{"duration":5,"tweenEasing":0,"value":0.265},{"duration":27,"tweenEasing":0,"value":0.355},{"duration":5,"tweenEasing":0,"value":0.43},{"duration":8,"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.725},{"duration":5,"tweenEasing":0,"value":0.675},{"tweenEasing":0,"value":0.39},{"tweenEasing":0,"value":0.355},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.37},{"duration":5,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.705},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.765},{"duration":2,"tweenEasing":0,"value":0.775},{"duration":14,"tweenEasing":0,"value":0.765},{"duration":2,"tweenEasing":0,"value":0.51},{"tweenEasing":0,"value":0.505},{"duration":9,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.48},{"tweenEasing":0,"value":0.455},{"duration":2,"tweenEasing":0,"value":0.405},{"tweenEasing":0,"value":0.275},{"tweenEasing":0,"value":0.23},{"duration":10,"tweenEasing":0,"value":0.21},{"duration":15,"tweenEasing":0,"value":0.31},{"duration":20,"tweenEasing":0,"value":0.5},{"duration":8,"tweenEasing":0,"value":0.44},{"duration":2,"tweenEasing":0,"value":0.575},{"duration":2,"tweenEasing":0,"value":0.585},{"duration":7,"tweenEasing":0,"value":0.57},{"duration":27,"tweenEasing":0,"value":0.445},{"tweenEasing":0,"value":0.535},{"duration":2,"value":0.54}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.715},{"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.785},{"duration":17,"tweenEasing":0,"value":0.785},{"tweenEasing":0,"value":0.51},{"duration":75,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.5},{"duration":18,"tweenEasing":0,"value":0.48},{"duration":9,"tweenEasing":0,"value":0.155},{"duration":26,"tweenEasing":0,"value":0.145},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"duration":9,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"tweenEasing":0,"value":0.889},{"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.8603},{"duration":2,"tweenEasing":0,"value":0.8137},{"tweenEasing":0,"value":0.695},{"tweenEasing":0,"value":0.6513},{"duration":82,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.5835},{"duration":11,"value":0.5833}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.5167},{"duration":3,"tweenEasing":0,"value":0.4937},{"duration":10,"tweenEasing":0,"value":0.4317},{"duration":2,"tweenEasing":0,"value":0.0618},{"duration":27,"tweenEasing":0,"value":0.0168},{"duration":14,"tweenEasing":0,"value":0.0143},{"duration":3,"tweenEasing":0,"value":0.3167},{"duration":6,"tweenEasing":0,"value":0.3985},{"tweenEasing":0,"value":0.4493},{"tweenEasing":0,"value":0.45}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.57},{"duration":2,"tweenEasing":0,"value":0.635},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.875},{"duration":19,"tweenEasing":0,"value":0.9},{"duration":8,"tweenEasing":0,"value":0.815},{"duration":13,"tweenEasing":0,"value":0.67},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":25,"tweenEasing":0,"value":0.095},{"duration":13,"tweenEasing":0,"value":0.145},{"duration":5,"tweenEasing":0,"value":0.465},{"tweenEasing":0,"value":0.49},{"duration":8,"value":0.495}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":36,"tweenEasing":0,"value":0.5333},{"duration":14,"tweenEasing":0,"value":0.5185},{"tweenEasing":0,"value":0.3351},{"tweenEasing":0,"value":0.3333},{"duration":8,"tweenEasing":0,"value":0.343},{"tweenEasing":0,"value":0.611},{"tweenEasing":0,"value":0.6273},{"tweenEasing":0,"value":0.6333},{"duration":8,"tweenEasing":0,"value":0.6237},{"tweenEasing":0,"value":0.3557},{"duration":17,"tweenEasing":0,"value":0.3393},{"tweenEasing":0,"value":0.4985},{"duration":11,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"duration":79,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.495},{"duration":21,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.13},{"duration":2,"tweenEasing":0,"value":0.2},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.45},{"duration":45,"tweenEasing":0,"value":0.48},{"duration":46,"tweenEasing":0,"value":0.24},{"tweenEasing":0,"value":0.275},{"duration":2,"value":0.28}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.36},{"duration":42,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.3467},{"duration":52,"value":0.3433}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":2,"tweenEasing":0,"value":0.375},{"duration":4,"tweenEasing":0,"value":0.38},{"duration":80,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.43},{"duration":14,"value":0.435}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.71},{"tweenEasing":0,"value":0.705},{"duration":4,"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.56},{"duration":28,"tweenEasing":0,"value":0.55},{"duration":15,"tweenEasing":0,"value":0.56},{"duration":3,"tweenEasing":0,"value":0.365},{"duration":7,"tweenEasing":0,"value":0.38},{"duration":2,"tweenEasing":0,"value":0.5},{"duration":11,"tweenEasing":0,"value":0.51},{"duration":25,"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.565},{"duration":2,"value":0.57}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.35},{"duration":84,"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.5767},{"duration":10,"value":0.5733}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":99,"tweenEasing":0,"value":0.27},{"tweenEasing":0,"value":0.35},{"value":0.355}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.42},{"duration":2,"tweenEasing":0,"value":0.43},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.575},{"duration":16,"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.56},{"duration":77,"value":0.555}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.48},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.335},{"duration":18,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.49},{"duration":75,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.73},{"tweenEasing":0,"value":0.785},{"duration":4,"tweenEasing":0,"value":0.81},{"duration":13,"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.51},{"duration":75,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.47},{"duration":2,"tweenEasing":0,"value":0.395},{"tweenEasing":0,"value":0.195},{"tweenEasing":0,"value":0.12},{"tweenEasing":0,"value":0.09},{"duration":23,"tweenEasing":0,"value":0.09},{"duration":14,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495},{"duration":55,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.5},{"duration":4,"tweenEasing":0,"value":0.485},{"duration":8,"tweenEasing":0,"value":0.4},{"duration":4,"tweenEasing":0,"value":0.155},{"duration":23,"tweenEasing":0,"value":0.105},{"duration":5,"tweenEasing":0,"value":0.105},{"duration":7,"tweenEasing":0,"value":0.225},{"duration":3,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.495},{"duration":11,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"value":0.05},{"duration":2,"tweenEasing":0,"value":0.18},{"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.645},{"duration":4,"tweenEasing":0,"value":0.695},{"duration":21,"tweenEasing":0,"value":0.675},{"duration":33,"tweenEasing":0,"value":0.385},{"duration":22,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.31},{"duration":13,"value":0.305}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":124,"playTimes":0,"fadeInTime":0.3,"name":"pinch_out_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":11,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.76},{"duration":4,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.305},{"duration":2,"tweenEasing":0,"value":0.235},{"duration":4,"tweenEasing":0,"value":0.92},{"duration":14,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.155},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.11},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.55},{"duration":4,"tweenEasing":0,"value":0.885},{"tweenEasing":0,"value":0.07},{"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":4,"tweenEasing":0,"value":0.29},{"duration":6,"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.555},{"duration":2,"tweenEasing":0,"value":1},{"duration":6,"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.745},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.025},{"duration":12,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.77},{"duration":15,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.11},{"tweenEasing":0,"value":0.115}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":124,"value":0.655}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.2967},{"duration":2,"tweenEasing":0,"value":0.3},{"duration":9,"tweenEasing":0,"value":0.3333},{"duration":8,"tweenEasing":0,"value":0.6033},{"duration":20,"tweenEasing":0,"value":0.72},{"tweenEasing":0,"value":0.7233},{"value":0.7267}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":46,"tweenEasing":0,"value":0.175},{"value":0.175},{"duration":77,"value":0.18}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":124,"value":0.635}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":124,"value":0.295}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.3033},{"tweenEasing":0,"value":0.31},{"duration":10,"tweenEasing":0,"value":0.3233},{"duration":28,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.67},{"value":0.6733}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":124,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.49},{"value":0.49},{"duration":99,"value":0.485}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":47,"tweenEasing":0,"value":0.64},{"value":0.64},{"duration":76,"value":0.645}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":122,"tweenEasing":0,"value":0.7285},{"tweenEasing":0,"value":0.4833},{"tweenEasing":0,"value":0.4838}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":122,"tweenEasing":0,"value":0.9372},{"tweenEasing":0,"value":0.7333},{"value":0.7232}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":124,"value":0.735}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":119,"tweenEasing":0,"value":0.4995},{"tweenEasing":0,"value":0.5332},{"duration":4,"value":0.5333}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":124,"value":0.445}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":46,"tweenEasing":0,"value":0.3167},{"value":0.3167},{"duration":77,"value":0.3133}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":72,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.5},{"duration":51,"value":0.495}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":115,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.58},{"duration":8,"value":0.585}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":124,"value":0.5933}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":98,"tweenEasing":0,"value":0.305},{"tweenEasing":0,"value":0.275},{"duration":25,"value":0.27}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":124,"value":0.515}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":124,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":124,"value":0.25}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":166,"playTimes":0,"fadeInTime":0.3,"name":"pinch_out_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":45,"tweenEasing":0,"value":0.065},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":6,"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.1},{"duration":2,"tweenEasing":0,"value":0.26},{"duration":8,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.69},{"duration":12,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":4,"tweenEasing":0,"value":0.665},{"duration":2,"tweenEasing":0,"value":0.95},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.555},{"duration":2,"tweenEasing":0,"value":0.84},{"duration":2,"tweenEasing":0,"value":0.165},{"duration":2,"tweenEasing":0,"value":0.55},{"duration":2,"tweenEasing":0,"value":0.72},{"duration":2,"tweenEasing":0,"value":0.68},{"duration":2,"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.44},{"duration":4,"tweenEasing":0,"value":0.085},{"duration":2,"tweenEasing":0,"value":0.11},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.87},{"duration":2,"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.335},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":4,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":4,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.955},{"duration":2,"tweenEasing":0,"value":0.705},{"tweenEasing":0,"value":0.665},{"tweenEasing":0,"value":0.355},{"duration":25,"value":0.04}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":15,"tweenEasing":0,"value":0.3},{"duration":20,"tweenEasing":0,"value":0.33},{"duration":2,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.65},{"duration":128,"value":0.655}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.31},{"tweenEasing":0,"value":0.34},{"duration":2,"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.6967},{"duration":13,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7133},{"duration":5,"tweenEasing":0,"value":0.6733},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3067},{"duration":127,"value":0.2967}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.17},{"value":0.17},{"duration":141,"value":0.175}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.375},{"duration":18,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.63},{"duration":128,"value":0.635}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":151,"tweenEasing":0,"value":0.195},{"tweenEasing":0,"value":0.3},{"duration":14,"value":0.295}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.3433},{"duration":2,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.6967},{"duration":13,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.6733},{"duration":3,"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.43},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3133},{"duration":127,"value":0.3033}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":166,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":93,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":72,"value":0.49}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":117,"tweenEasing":0,"value":0.625},{"tweenEasing":0,"value":0.63},{"duration":48,"value":0.635}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":130,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":35,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.8833},{"duration":20,"tweenEasing":0,"value":0.823},{"duration":126,"tweenEasing":0,"value":0.5843},{"tweenEasing":0,"value":0.5837},{"value":0.5845}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":164,"tweenEasing":0,"value":0.5365},{"tweenEasing":0,"value":0.8502},{"value":0.8507}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.4},{"duration":21,"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.73},{"duration":128,"value":0.735}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":164,"tweenEasing":0,"value":0.5392},{"tweenEasing":0,"value":0.5333},{"value":0.5331}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":36,"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.44},{"duration":129,"value":0.445}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.3033},{"tweenEasing":0,"value":0.3133},{"duration":133,"value":0.3167}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.475},{"duration":135,"value":0.48}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.495},{"duration":136,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":15,"tweenEasing":0,"value":0.27},{"duration":22,"tweenEasing":0,"value":0.2967},{"tweenEasing":0,"value":0.59},{"duration":128,"value":0.5933}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":1},{"duration":5,"tweenEasing":0,"value":0.99},{"duration":16,"tweenEasing":0,"value":0.89},{"duration":4,"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.32},{"duration":128,"value":0.31}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.52},{"duration":131,"value":0.515}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":161,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":4,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.255},{"duration":130,"value":0.25}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":223,"playTimes":0,"fadeInTime":0.3,"name":"pinch_out_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.125},{"duration":4,"tweenEasing":0,"value":0.895},{"duration":2,"tweenEasing":0,"value":0.81},{"duration":2,"tweenEasing":0,"value":0.36},{"duration":2,"tweenEasing":0,"value":0.41},{"duration":2,"tweenEasing":0,"value":0.94},{"duration":4,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.565},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.125},{"duration":4,"tweenEasing":0,"value":0.01},{"duration":4,"tweenEasing":0,"value":0.81},{"duration":2,"tweenEasing":0,"value":0.3},{"duration":6,"tweenEasing":0,"value":0.3},{"duration":2,"tweenEasing":0,"value":0.015},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.955},{"duration":4,"tweenEasing":0,"value":0.55},{"duration":2,"tweenEasing":0,"value":0.375},{"duration":18,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.83},{"duration":2,"tweenEasing":0,"value":0.32},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.36},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.015},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.5},{"duration":4,"tweenEasing":0,"value":0.735},{"duration":4,"tweenEasing":0,"value":0.175},{"duration":6,"tweenEasing":0,"value":0.025},{"tweenEasing":0,"value":0.04},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.955},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.375},{"duration":2,"tweenEasing":0,"value":0.485},{"duration":4,"tweenEasing":0,"value":0.085},{"duration":2,"tweenEasing":0,"value":0.135},{"duration":16,"tweenEasing":0,"value":0.01},{"duration":4,"tweenEasing":0,"value":0.11},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.94},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.69},{"duration":2,"tweenEasing":0,"value":0.94},{"duration":2,"tweenEasing":0,"value":0.72},{"duration":2,"tweenEasing":0,"value":0.87},{"duration":2,"tweenEasing":0,"value":0.84},{"duration":4,"tweenEasing":0,"value":0.205},{"duration":6,"tweenEasing":0,"value":0.9},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":11,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.09},{"tweenEasing":0,"value":0.085}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.3}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.2267},{"tweenEasing":0,"value":0.11},{"tweenEasing":0,"value":0.0333},{"duration":13,"tweenEasing":0,"value":0.0033},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":52,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.6733},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.23},{"tweenEasing":0,"value":0.1133},{"tweenEasing":0,"value":0.0333},{"duration":13,"tweenEasing":0,"value":0.0033},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":37,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7267},{"duration":2,"tweenEasing":0,"value":0.6467},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.3433},{"duration":2,"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.71},{"duration":26,"value":0.7267}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.17}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.47},{"duration":11,"tweenEasing":0,"value":0.49},{"duration":5,"tweenEasing":0,"value":0.295},{"duration":11,"tweenEasing":0,"value":0.29},{"duration":113,"tweenEasing":0,"value":0.485},{"tweenEasing":0,"value":0.38},{"duration":48,"value":0.375}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":14,"tweenEasing":0,"value":0.16},{"tweenEasing":0,"value":0.19},{"duration":208,"value":0.195}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7867},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.2233},{"tweenEasing":0,"value":0.1067},{"tweenEasing":0,"value":0.03},{"duration":13,"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":52,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.79},{"duration":3,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.2233},{"tweenEasing":0,"value":0.1067},{"tweenEasing":0,"value":0.03},{"duration":13,"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":37,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.5133},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.34},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.3433},{"duration":2,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.6867},{"duration":26,"value":0.7}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":223,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":124,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":98,"value":0.495}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":172,"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.62},{"duration":50,"value":0.625}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":223,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":148,"tweenEasing":0,"value":0.5777},{"duration":36,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.883},{"duration":38,"value":0.8833}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.7308},{"duration":2,"tweenEasing":0,"value":0.657},{"duration":9,"tweenEasing":0,"value":0.6102},{"duration":2,"tweenEasing":0,"value":0.2603},{"duration":2,"tweenEasing":0,"value":0.2158},{"tweenEasing":0,"value":0.2},{"duration":2,"tweenEasing":0,"value":0.2058},{"duration":9,"tweenEasing":0,"value":0.2482},{"duration":2,"tweenEasing":0,"value":0.6037},{"duration":55,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.6608},{"duration":9,"tweenEasing":0,"value":0.6185},{"duration":2,"tweenEasing":0,"value":0.263},{"duration":2,"tweenEasing":0,"value":0.2167},{"tweenEasing":0,"value":0.2},{"duration":2,"tweenEasing":0,"value":0.2058},{"duration":9,"tweenEasing":0,"value":0.2482},{"duration":2,"tweenEasing":0,"value":0.6037},{"duration":75,"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4127},{"tweenEasing":0,"value":0.417}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.5},{"duration":14,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.33},{"duration":14,"tweenEasing":0,"value":0.33},{"duration":110,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.405},{"duration":49,"value":0.4}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":221,"tweenEasing":0,"value":0.4835},{"tweenEasing":0,"value":0.5414},{"value":0.5413}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":178,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.34},{"duration":44,"value":0.335}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.3267},{"tweenEasing":0,"value":0.3067},{"duration":198,"value":0.3033}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":176,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.44},{"duration":46,"value":0.435}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.57},{"duration":68,"tweenEasing":0,"value":0.54},{"duration":16,"tweenEasing":0,"value":0.54},{"duration":41,"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.465},{"duration":41,"value":0.46}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":155,"tweenEasing":0,"value":0.2833},{"tweenEasing":0,"value":0.2733},{"duration":67,"value":0.27}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":51,"tweenEasing":0,"value":0.88},{"duration":68,"tweenEasing":0,"value":0.99},{"duration":14,"tweenEasing":0,"value":0.905},{"duration":18,"tweenEasing":0,"value":1},{"duration":30,"tweenEasing":0,"value":0.895},{"tweenEasing":0,"value":0.995},{"duration":41,"value":1}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":155,"tweenEasing":0,"value":0.555},{"value":0.555},{"duration":67,"value":0.56}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":223,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":38,"tweenEasing":0,"value":0.305},{"duration":16,"tweenEasing":0,"value":0.31},{"duration":68,"tweenEasing":0,"value":0.285},{"duration":16,"tweenEasing":0,"value":0.31},{"duration":8,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.33},{"duration":76,"value":0.335}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":53,"playTimes":0,"fadeInTime":0.3,"name":"tap_body_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":11,"tweenEasing":0,"value":0.06},{"duration":2,"tweenEasing":0,"value":0.065},{"duration":2,"tweenEasing":0,"value":0.32},{"duration":4,"tweenEasing":0,"value":0.91},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":4,"tweenEasing":0,"value":0.41},{"duration":2,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":6,"tweenEasing":0,"value":0.91},{"duration":2,"tweenEasing":0,"value":0.8},{"duration":2,"tweenEasing":0,"value":0.555},{"duration":3,"tweenEasing":0,"value":0.19},{"tweenEasing":0,"value":0.045},{"duration":4}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":53,"value":0.455}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.0033},{"tweenEasing":0},{"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.04},{"tweenEasing":0,"value":0.0867},{"duration":7,"tweenEasing":0,"value":0.1467},{"tweenEasing":0,"value":0.6667},{"duration":2,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.8333},{"duration":21,"value":0.84}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":48,"tweenEasing":0,"value":0.23},{"value":0.23},{"duration":4,"value":0.235}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.75},{"duration":11,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.535},{"duration":22,"value":0.525}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":41,"tweenEasing":0,"value":0.22},{"tweenEasing":0,"value":0.23},{"duration":11,"value":0.235}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":17,"tweenEasing":0,"value":0.0033},{"tweenEasing":0,"value":0.0133},{"tweenEasing":0,"value":0.0467},{"tweenEasing":0,"value":0.0933},{"duration":7,"tweenEasing":0,"value":0.15},{"duration":2,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.7767},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.8333},{"duration":21,"value":0.84}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.6},{"duration":23,"value":0.605}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.625},{"duration":11,"tweenEasing":0,"value":0.61},{"duration":2,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.345},{"duration":21,"value":0.34}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"tweenEasing":0,"value":0.6328},{"tweenEasing":0,"value":0.6332},{"duration":51,"value":0.6333}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":4,"tweenEasing":0,"value":0.483},{"duration":10,"tweenEasing":0,"value":0.4697},{"duration":3,"tweenEasing":0,"value":0.2932},{"duration":12,"tweenEasing":0,"value":0.2872},{"duration":2,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.5807},{"duration":21,"value":0.5833}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.75},{"duration":11,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.535},{"duration":22,"value":0.525}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":53,"value":0.24}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":36,"tweenEasing":0,"value":0.2167},{"value":0.2133},{"duration":16,"value":0.2167}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":53,"value":0.455}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":51,"tweenEasing":0,"value":0.2033},{"tweenEasing":0,"value":0.18},{"value":0.1767}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":22,"tweenEasing":0,"value":0.89},{"tweenEasing":0,"value":0.91},{"duration":30,"value":0.915}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":50,"tweenEasing":0,"value":0.685},{"tweenEasing":0,"value":0.665},{"duration":2,"value":0.66}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":8,"value":0.495}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.625},{"duration":11,"tweenEasing":0,"value":0.61},{"duration":2,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.345},{"duration":21,"value":0.34}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":28,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.535},{"duration":24,"value":0.54}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.59}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":100,"playTimes":0,"fadeInTime":0.3,"name":"tap_body_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":23,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":4,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.645},{"duration":2,"tweenEasing":0,"value":0.605},{"duration":2,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.705},{"duration":2,"tweenEasing":0,"value":0.55},{"duration":2,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.61},{"duration":2,"tweenEasing":0,"value":0.25},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":4,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.425},{"duration":2,"tweenEasing":0,"value":0.355},{"duration":2,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.625},{"duration":2,"tweenEasing":0,"value":0.47},{"duration":4,"tweenEasing":0,"value":0.77},{"duration":25,"tweenEasing":0,"value":0.055},{"tweenEasing":0,"value":0.055},{"tweenEasing":0,"value":0.06}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":22,"tweenEasing":0,"value":0.585},{"duration":17,"tweenEasing":0,"value":0.705},{"duration":17,"tweenEasing":0,"value":0.6},{"duration":41,"tweenEasing":0,"value":0.705},{"tweenEasing":0,"value":0.6},{"duration":2,"value":0.595}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":21,"tweenEasing":0,"value":0.75},{"tweenEasing":0,"value":0.7667},{"duration":2,"tweenEasing":0,"value":0.6867},{"tweenEasing":0,"value":0.4433},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3267},{"tweenEasing":0,"value":0.3533},{"duration":3,"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":16,"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5633},{"tweenEasing":0,"value":0.4467},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":35,"tweenEasing":0,"value":0.7567},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.73}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":100,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":98,"tweenEasing":0,"value":0.13},{"tweenEasing":0,"value":0.005},{"value":0.01}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":17,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.745},{"duration":82,"value":0.75}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":96,"tweenEasing":0,"value":0.145},{"tweenEasing":0},{"duration":3,"value":0.005}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":21,"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5633},{"tweenEasing":0,"value":0.4467},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":16,"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.7667},{"duration":2,"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.36},{"duration":3,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":35,"tweenEasing":0,"value":0.7567},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.73}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":100,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":62,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":37,"value":0.495}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.52},{"tweenEasing":0,"value":0.535},{"duration":32,"value":0.54}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":100,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":65,"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.615},{"duration":34,"value":0.62}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":98,"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.5518},{"value":0.5528}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":23,"tweenEasing":0,"value":0.6268},{"duration":13,"tweenEasing":0,"value":0.6552},{"duration":3,"tweenEasing":0,"value":0.4253},{"duration":14,"tweenEasing":0,"value":0.4198},{"duration":3,"tweenEasing":0,"value":0.658},{"duration":13,"tweenEasing":0,"value":0.6635},{"duration":29,"tweenEasing":0,"value":0.4255},{"tweenEasing":0,"value":0.4182},{"value":0.419}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":62,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":0.755},{"duration":37,"value":0.75}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":47,"tweenEasing":0,"value":0.41},{"duration":13,"tweenEasing":0,"value":0.395},{"duration":37,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.36},{"duration":2,"value":0.355}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.5733},{"duration":7,"tweenEasing":0,"value":0.9567},{"duration":17,"tweenEasing":0,"value":0.9867},{"duration":17,"tweenEasing":0,"value":0.9},{"duration":41,"tweenEasing":0,"value":0.9867},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.8733}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.525},{"duration":32,"value":0.52}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.49},{"duration":99,"value":0.495}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":15,"tweenEasing":0,"value":0.4867},{"duration":7,"tweenEasing":0,"value":0.9233},{"duration":18,"tweenEasing":0,"value":0.98},{"duration":17,"tweenEasing":0,"value":0.8867},{"duration":41,"tweenEasing":0,"value":0.9767},{"tweenEasing":0,"value":0.8667},{"tweenEasing":0,"value":0.86}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":68,"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.86},{"duration":31,"value":0.855}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":28,"tweenEasing":0,"value":0.695},{"duration":17,"tweenEasing":0,"value":0.74},{"duration":15,"tweenEasing":0,"value":0.72},{"duration":9,"tweenEasing":0,"value":0.75},{"tweenEasing":0,"value":0.695},{"duration":30,"value":0.69}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":28,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":71,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":62,"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.62},{"duration":37,"value":0.625}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":65,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.495},{"duration":34,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":100,"value":0.59}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":83,"playTimes":0,"fadeInTime":0.3,"name":"tap_body_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":4,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":6,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.715},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":8,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.995},{"duration":6,"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.44},{"duration":2,"tweenEasing":0,"value":0.48},{"duration":10,"tweenEasing":0,"value":0.7},{"duration":2,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":4,"tweenEasing":0,"value":0.885},{"duration":4,"tweenEasing":0,"value":0.5},{"duration":4,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.61},{"duration":6,"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.06},{"duration":2,"value":0.055}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.675}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":4,"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.75},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3767},{"duration":2,"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.84},{"duration":40,"tweenEasing":0,"value":0.86},{"duration":2,"tweenEasing":0,"value":0.85},{"duration":2,"tweenEasing":0,"value":0.8},{"duration":9,"tweenEasing":0,"value":0.7133},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":2,"tweenEasing":0,"value":0.0967},{"duration":5,"tweenEasing":0,"value":0.0433},{"tweenEasing":0,"value":0.0033},{"duration":3}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":83,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.445},{"tweenEasing":0,"value":0.49},{"value":0.495}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.305}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.435},{"duration":14,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.115},{"value":0.11}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":4,"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.75},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3733},{"duration":2,"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.84},{"duration":40,"tweenEasing":0,"value":0.86},{"duration":2,"tweenEasing":0,"value":0.85},{"duration":2,"tweenEasing":0,"value":0.8},{"duration":9,"tweenEasing":0,"value":0.7133},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":2,"tweenEasing":0,"value":0.0967},{"duration":5,"tweenEasing":0,"value":0.0433},{"tweenEasing":0,"value":0.0033},{"duration":3}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":83,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":83,"value":0.43}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":78,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.6},{"duration":4,"value":0.605}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.415},{"duration":7,"tweenEasing":0,"value":0.34},{"duration":65,"tweenEasing":0,"value":0.24},{"tweenEasing":0,"value":0.37},{"duration":2,"value":0.375}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.5313},{"tweenEasing":0,"value":0.5187},{"value":0.5182}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.4487},{"duration":2,"tweenEasing":0,"value":0.444},{"duration":7,"tweenEasing":0,"value":0.4032},{"duration":2,"tweenEasing":0,"value":0.172},{"tweenEasing":0,"value":0.15},{"tweenEasing":0,"value":0.1575},{"duration":8,"tweenEasing":0,"value":0.1778},{"duration":2,"tweenEasing":0,"value":0.4965},{"duration":53,"tweenEasing":0,"value":0.5408},{"tweenEasing":0,"value":0.5653},{"tweenEasing":0,"value":0.563}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.44},{"duration":14,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.115},{"value":0.11}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.4998},{"tweenEasing":0,"value":0.5148},{"value":0.5153}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":79,"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.415},{"duration":3,"value":0.42}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":71,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":11,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":77,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495},{"duration":5,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.21}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.775},{"duration":2,"value":0.78}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":83,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":69,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.415},{"duration":6,"tweenEasing":0,"value":0.34},{"duration":67,"tweenEasing":0,"value":0.25},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.385}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.48},{"value":0.485}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_DESK","timeline":[{"name":"B_BACKGROUND.01","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-8},{"duration":60,"tweenEasing":0},{"x":8}]},{"name":"D_BACKGROUND.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[2,40,0,46,0,24,-1.33,14.67,-5.33,-42,0,0,-2,-22.67,0,-23.33,0,-42.67,0,-39.33,2,-20,0,-10,2,-12,0,-12,1.33,-24,2.67,-22,0,0,0,-84,0,-24,0,-33.33,0,-50,2,-20,0,14,8,-26,0,-22,0,-18,0,30,0,-14,5.33,-25.33,0,-16,2.67,-42.67,0,-18,0,24,0,-32,-2,-3.33,2,-24,-4,-3.33,4,-11.33,1.18,-34.2,0.28,-25.14,-0.95,-33.9,1.23,-36,1.33,-28.25,0.48,-9.97,-1.5,7.92,1.11,-21.85,2.66,-14.66,1.47,24.54,-2.88,-3.33,1.01,32.11,0.15,10.4,2.45,-4.02,2.66,-18,0.71,-21.2,1.44,-30.4,-0.61,-2.06,6.6,-25.65,4.28,-9.8,-0.87,14.43,3.31,-2.54]},{"duration":60,"tweenEasing":0,"offset":119},{"offset":1,"value":[-20,0,-26,0,-72,-1.67,-22.67,10,22,0,6,0,14,0,18,0,12,0,12,0,42,4,40,0,20,0,8,0,30,0,18,0,40,0,24,0,16,0,18,0,20,0,0,-1,-41,8,10,0,26,0,0,0,-58,0,0,4,-12,-2,2,2,16,-1,34,0,-40,0,30,-3,10,0,38,0,8,0,28,0,10,0,14,0,12,0,26,2,8,0,14,0,2,-1,22.67,-1,14,0,-5.61,1.12,9.12,0,-29.86,-4.78,-29.18,-0.33,-20.59,0,-6.99,-2.86,5.2,0.16,9.56,-3.82,-16.19,5.9,-1.54,2.42,-9.12,-2.56,-37.16,0.31,-7.28]}]},{"name":"D_BACKGROUND.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[-17.33,-1.33,10.67,0,9.33,0,12,1.33,16,1.33,-48,0,-28,0,-25.33,0,-9.33,0,-9.33,0,-17.33]},{"duration":60,"tweenEasing":0,"offset":21},{"value":[-3,19.67,0,-16,0,-8,0,-12,0,-18.67,0,4,0,28,-2.67,40,0,5.33,0,13.33,0,8]}]},{"name":"D_BACKGROUND.06","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[-25.33,0,-25.33,0,-25.33,0,-25.33,0,-25.33]},{"duration":60,"tweenEasing":0,"offset":9},{"offset":1,"value":[4,0,4,0,4,0,4,0,4]}]},{"name":"D_BACKGROUND.07","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[-7.33,0,-7.33,0,-7.33,0,-7.33]},{"duration":60,"tweenEasing":0,"offset":7},{"offset":1,"value":[-18.67,0,-18.67,0,-18.67,0,-18.67]}]},{"name":"D_BACKGROUND.08","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[2.67,-4,1.33,8,-1.33,16,0,0,0,0,1.33,-12,1.33,-5.33,1.33,-8,0,-17.33,0,-4,0,-8.05,0,-8.98,0,0,0.75,-10.61,0.71,-12.36]},{"duration":60,"tweenEasing":0,"offset":29},{"value":[-3.33,8.67,-2.67,5.33,0,-10,-2.33,-15.33,18.67,-2.67,0,24,0,16,-1.33,6.67,-2.67,20,-1.33,13.33,0.71,9.72,-0.95,11.22,5.91,-8.76,-1.17,17.76,-2.67,10.23]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BREATH","timeline":[{"name":"B_BODY.04","type":50,"frame":[{"duration":120,"tweenEasing":0,"offset":161},{"value":[-40,-16,-28.13,-17.19,-15,-18.5,-4.38,-19.56,0,-20,5.03,-18.91,17.25,-16.25,32.34,-12.97,46,-10,-34.16,-9.07,-24.66,-10.58,-13.85,-12.3,-4.66,-13.81,0,-14.66,6.88,-13.2,18.27,-10.33,30.89,-6.87,41.47,-3.66,-25.81,-0.36,-19.32,-2.37,-11.47,-4.93,-4.34,-7.3,0,-8.75,7.09,-6.54,15.92,-2.6,24.32,1.87,30.08,5.69,-15.55,7.54,-12.55,4.97,-8.14,1.48,-3.55,-1.86,0,-3.97,6.4,-0.88,11.79,4.4,15.07,10.16,15.15,14.69,-4,12,-4.8,8.98,-4.15,4.76,-2.43,0.66,0,-2,5.62,1.82,7.5,8.14,5.62,14.89,0,20,-3.56,10.69,-4.02,8.11,-3.4,4.27,-1.96,0.52,0,-1.78,4.22,1.57,5.62,7.37,4.22,13.5,0,17.81,-2.5,7.5,-2.78,5.71,-2.33,3,-1.34,0.35,0,-1.25,2.81,1.09,3.75,5.19,2.82,9.52,0,12.5,-1.19,3.56,-1.34,2.7,-1.13,1.42,-0.65,0.17,0,-0.59,1.4,0.52,1.87,2.46,1.41,4.5,0,5.94]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_02_R","timeline":[{"name":"D_HAND.12","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[12.64,12.48,10.25,12.64,9.26,9.12,7.73,6.06,8.61,4.15,10.94,3.89,12.4,6.22,12.46,9.3,10.22,6.47]},{"offset":17}]},{"name":"D_HAND.13","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-0.3,7.45,1.21,8.58,0,0,0,0,0.1,-4.05,-0.84,-5.94]},{"offset":29}]},{"name":"D_HAND.14","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[4.19,8.69,4.43,11.58,5.41,16.32,3.73,27.51,1.22,23.89,2.24,15.8,1.76,11.5,1.37,9.26,2.79,7.96,3.06,10.26,3.26,13.25,3.93,19.88]},{"offset":23}]},{"name":"D_HAND.15","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-0.85,-1.23,-0.56,-3.96,0.1,-4.05,0,0,-0.46,-3.3,-0.56,-3.96,-0.19,-1.32,0,0,0,0,0,0,0.86,-3.49,-2.06,-5.1]},{"offset":23}]},{"name":"D_HAND.16","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-2.21,-3.01,-0.13,-11.93,0.43,-15.96,2.13,-20.55,6.89,-24.9,6.02,-14.92,5.53,-3.15,5.4,4.32,0.08,1.6,1.35,-6.29]},{"offset":19}]},{"name":"D_HAND.17","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-2.46,-9.98,4.5,-28.03,8.55,-37.87,12.6,-34.89,9.12,-15.37,6.87,-0.4,-0.09,-3.81,3.67,-11.78,11.24,-27.28]},{"offset":17}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_02_L","timeline":[{"name":"D_HAND.18","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[4.84,-14.03,9.51,-14.55,8.54,-6.7,7.65,0.36,6.53,4.17,1.51,5.81,-1.66,4.19,0.61,-3.87,2.75,-9.76,2.63,1.89]},{"offset":19}]},{"name":"D_HAND.19","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[1.17,8.46,1.53,9.91,0,0,0,0,7.08,-8.66,-1.17,-8.46]},{"offset":19}]},{"name":"D_HAND.20","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-0.85,-5.32,0.78,-8.02,3.96,-17.56,1.81,-26.24,-3.41,-21.27,-3,-14,-0.85,-5.32,-0.85,-5.32]},{"offset":15}]},{"name":"D_HAND.21","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-5.85,-1.32,-5.98,3.78,-5.98,3.78,-5.98,3.78,-5.98,3.78,-5.98,3.78,-5.98,3.78,-6.29,0.63]},{"offset":15}]},{"name":"D_HAND.22","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-5,24.36,-4.73,19.15,-6.24,13.19,-6.57,11.07,-6.71,9.4,-3.04,0.41,-3.42,14.2,-4.8,18.56]},{"offset":15}]},{"name":"D_HAND.23","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[9.39,38.82,3.16,26.92,-2.34,11.34,9.6,4.86,14.19,19.29,15.87,35.22]},{"offset":11}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_L_02","timeline":[{"name":"B_CLOTHES.40","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.41","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.18","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.18","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.19","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_L_01","timeline":[{"name":"B_CLOTHES.40","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.41","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAND.18","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.18","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.19","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_R","timeline":[{"name":"B_HAND.12","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-1.21,-6.42,2.89,-6.57,6.68,-6.7,7.27,-6.73,3.24,-6.59,-0.8,-6.45,-1.2,-6.43,-1.2,-6.42,-1.2,-6.42,-1.18,-6.44,1.72,-7.26,4.42,-8.12,4.91,-8.52,1.32,-9.11,-2.46,-9.4,-3.31,-8.88,-4.47,-7.37,-5.69,-6.09,-1.14,-6.46,0.46,-7.9,1.96,-9.36,2.31,-10.09,-0.86,-11.35,-4.38,-11.99,-5.6,-11.05,-7.82,-8.32,-10.13,-5.94,-1.13,-6.46,-1.29,-8.37,-1.44,-10.21,-1.57,-11.3,-4.54,-12.58,-8.19,-12.89,-9.68,-11.7,-11.94,-9.64,-14.46,-7.03,-1.13,-6.47,-3.11,-9.11,-4.99,-11.74,-5.39,-13.91,-8.09,-18.13,-12.16,-20.91,-15.55,-17.8,-19.42,-11.98,-23.51,-6.14,-1.14,-6.46,-4.42,-9.57,-7.51,-12.53,-7.91,-15.72,-10.94,-23.51,-16.01,-29.38,-21.36,-24.42,-27.33,-14.87,-33.13,-5.79,-1.16,-6.44,-4.89,-9.82,-8.34,-12.81,-8.66,-15.76,-12.23,-23.96,-19.13,-30.95,-26.89,-26.54,-34.59,-16,-41.69,-6.43,-1.19,-6.43,-5.55,-10.34,-9.59,-13.85,-10.56,-15.84,-15.08,-20.58,-24.38,-25.49,-34.26,-23.18,-41.56,-15.31,-48.38,-7.91,-1.21,-6.42,-6.23,-10.9,-10.9,-15,-12.56,-16.04,-18.19,-16.91,-29.99,-19.27,-41.77,-19.18,-48.46,-14.54,-54.68,-9.58]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-4.82,4.09,-4.85,4.11,-4.88,4.13,-4.91,4.14,-4.91,4.14,-4.88,4.13,-4.84,4.1,-4.83,4.09,-4.83,4.09,-4.81,4.07,-4.85,4.1,-4.93,4.16,-5.02,4.23,-5.06,4.25,-5.04,4.23,-4.94,4.16,-4.86,4.11,-4.83,4.09,-4.76,4.04,-4.81,4.07,-4.92,4.16,-5.09,4.28,-5.2,4.35,-5.19,4.34,-5.04,4.23,-4.89,4.13,-4.83,4.09,-4.7,3.99,-4.72,4.01,-4.83,4.09,-5.05,4.49,-5.32,4.92,-5.42,4.9,-5.27,4.75,-4.99,4.5,-4.83,4.09,-4.63,3.95,-4.6,3.93,-4.67,3.98,-5.05,5.29,-5.98,8.26,-6.65,9.76,-6.46,9.18,-5.61,6.69,-4.83,4.09,-4.6,3.93,-4.51,3.86,-4.51,3.86,-4.99,6.09,-6.59,11.58,-7.83,14.57,-7.56,13.56,-6.21,8.87,-4.83,4.09,-4.61,3.94,-4.49,3.85,-4.45,3.82,-4.74,6.35,-6.27,12.05,-7.67,14.81,-7.47,13.86,-6.27,9.56,-5.04,5.43,-4.65,3.97,-4.53,3.88,-4.47,3.83,-4.44,6.41,-5.59,11.81,-7.01,14.09,-7.03,13.81,-6.43,12.15,-5.86,10.68,-4.7,4,-4.59,3.92,-4.51,3.86,-4.15,6.5,-4.91,11.55,-6.31,13.33,-6.54,13.79,-6.65,15.03,-6.76,16.35]}]},{"name":"B_HAND.13","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.33,-2,0.33,-2,0.44,-2.02,1.36,-2.27,2.28,-2.51,1.02,-2.32,-3.55,-1.56,-8.44,-1.03,0.34,-2.01,0.36,-2.02,0.36,-2.03,0.57,-2.06,2.33,-2.53,4.1,-2.99,1.65,-2.67,-7.29,-1.39,-16.88,-0.47,0.37,-2.03,0.41,-2.06,0.43,-2.08,0.65,-2.09,1.15,-2.34,1.66,-2.59,-1.58,-2.59,-13.04,-2.48,-25.35,-2.2,0.36,-2.03,0.41,-2.06,0.45,-2.09,-0.12,-2.01,-7,-1.1,-13.87,-0.2,-17.62,-0.07,-28.1,0.11,-39.33,0.49,0.34,-2.01,0.39,-2.04,0.42,-2.07,-1.14,-1.96,-15.59,-0.76,-30.04,0.45,-33.76,0.76,-42.36,1.46,-51.68,2.2,0.3,-1.98,-2.04,-1.76,-4.23,-1.52,-7.78,-1.45,-26.89,-0.38,-45.15,0.93,-50.73,1.44,-60.1,2.57,-70.03,3.33,0.26,-1.96,-5.11,-1.43,-10.11,-0.92,-16.14,-0.94,-39.13,-0.11,-59.98,1.33,-67.92,1.59,-78.4,1.55,-89.31,1.21,0.25,-1.95,-8.09,-1.12,-15.82,-0.34,-24.25,-0.48,-51.1,0.03,-74.51,1.52,-84.71,1.47,-96.3,0,-108.13,-1.57]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-2.25,4.18,-2.52,5.65,-2.57,6.09,-2.28,6.6,-1.98,7.1,-1.95,6.62,-1.93,4.65,-1.93,2.73,-1.95,2.74,-2.56,5.56,-3.12,8.4,-3.21,9.23,-2.62,10.19,-2.03,11.15,-1.95,10.24,-1.94,6.47,-1.93,2.73,-1.97,2.75,-2.72,6.02,-3.41,9.09,-3.5,9.99,-2.85,11.15,-2.19,12.31,-2.11,11.35,-2.02,7.23,-1.93,2.73,-1.92,2.71,-2.83,5.41,-3.69,7.92,-3.94,8.81,-3.74,11.15,-3.5,13.47,-3.28,12.47,-2.63,7.79,-1.93,2.73,-1.83,2.66,-2.89,4.76,-3.9,6.68,-4.29,7.56,-4.57,11.12,-4.8,14.63,-4.43,13.58,-3.23,8.34,-1.93,2.73,-1.78,2.62,-2.68,4.3,-3.57,6.04,-3.97,6.9,-4.31,10.62,-4.59,14.28,-4.23,13.27,-3.12,8.14,-1.93,2.73,-1.76,2.6,-2.21,3.46,-2.68,4.38,-2.93,5.03,-3.15,8.78,-3.32,12.49,-3.12,11.7,-2.54,7.35,-1.93,2.73,-1.77,2.61,-1.73,2.58,-1.76,2.6,-1.84,3.01,-1.91,6.8,-1.94,10.56,-1.93,10.01,-1.93,6.51,-1.93,2.73]}]},{"name":"B_HAND.14","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-1.59,5.51,-4.46,6.17,-7.55,6.61,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-2.33,5.64,-8.05,6.73,-14.22,7.47,-0.88,5.35,-1.33,5.24,-1.76,5.13,-1.72,5.11,-2.39,5.26,-3.06,5.4,-5.33,5.55,-13.31,6.08,-21.86,6.53,-1,5.44,-2.56,4.89,-4.01,4.32,-4.77,4.13,-10.63,3.98,-16.49,3.83,-18.63,4.07,-25.26,5.11,-32.41,5.9,-1.05,5.47,-3.28,4.58,-5.3,3.68,-7.05,3.32,-19.12,2.36,-31.19,1.4,-33.32,1.45,-38.08,2.18,-43.3,2.83,-0.9,5.36,-6.41,5.28,-11.49,5.46,-14.18,5.39,-28.91,4.2,-43.64,3.01,-46.1,2.93,-51.44,3.21,-57.3,3.64,-0.71,5.23,-10.66,5.81,-19.91,6.53,-23.85,6.65,-40.29,5.96,-56.73,5.29,-59.88,5.37,-66.75,5.91,-74.21,6.56,-0.58,5.13,-14.94,6.3,-28.3,7.43,-33.42,7.71,-51.54,7.55,-69.68,7.4,-73.64,7.67,-82.13,8.53,-91.28,9.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-0.72,10.22,-0.72,10.22,-0.72,10.22,-0.72,9.93,-0.72,6.81,-0.72,3.7,-0.72,2.36,-0.72,-1.72,-0.72,-6.13,-0.72,10.22,-0.72,10.22,-0.72,10.22,-0.72,9.99,-0.67,7.52,-0.62,5.06,-0.57,3.84,-0.43,-0.03,-0.28,-4.24,-0.72,10.22,-0.72,10.22,-0.72,10.22,-0.72,10.05,-0.62,8.18,-0.52,6.31,-0.43,5.2,-0.15,1.53,0.14,-2.49,-0.83,10.3,-0.86,10.32,-0.87,10.32,-0.81,10.16,-0.76,8.51,-0.72,6.87,-0.62,5.77,-0.21,2.07,0.23,-2.02,-1.09,10.48,-1.2,10.56,-1.24,10.59,-1.24,10.49,-1.93,9.88,-2.64,9.28,-2.37,8.02,-1.17,3.35,0.12,-1.7,-1.19,10.55,-1.37,10.69,-1.43,10.73,-1.5,10.7,-3.01,11.18,-4.55,11.69,-4.12,10.27,-2.14,4.63,0.01,-1.39,-0.89,10.34,-1.01,10.42,-1.05,10.45,-1.01,10.39,-1.8,10.13,-2.6,9.88,-2.41,8.33,-1.31,4.13,-0.16,-0.73,-0.52,10.07,-0.5,10.06,-0.52,10.07,-0.53,10.16,-0.61,10.78,-0.63,11.37,-0.67,9.33,-0.71,5.7,-0.78,1.75,-0.26,9.89,-0.13,9.79,-0.12,9.79,-0.21,10.06,0.42,11.8,1.14,13.47,0.92,10.9,-0.22,7.61,-1.45,4.43]}]},{"name":"B_HAND.15","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-4.07,0.78,-5.25,-0.78,-6.44,-2.34,-6.24,-2.08,-5.11,-0.56,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-4.2,0.65,-6.5,-2.35,-8.81,-5.35,-8.42,-4.87,-6.24,-1.97,-3.9,0.93,-3.9,0.93,-4.22,0.7,-4.47,0.51,-4.62,0.13,-7.7,-3.41,-10.78,-6.95,-10.62,-6.42,-8.67,-3.05,-6.55,0.44,-3.9,0.93,-6.56,-0.91,-8.94,-3.17,-9.64,-3.99,-13.68,-6.15,-17.72,-8.31,-18,-7.66,-17.29,-4.31,-16.51,-0.96,-3.86,0.9,-9.71,-1.64,-15.11,-4.5,-16.89,-5.39,-21.7,-6.78,-26.5,-8.18,-27,-7.66,-27.33,-5,-27.72,-2.18,-3.77,0.84,-11.97,-1.21,-19.18,-2.94,-23.47,-3.46,-30.06,-5.3,-35.82,-7.04,-37.13,-6.95,-40.07,-5.75,-43.25,-4.24,-3.72,0.8,-14.04,-1.78,-22.76,-4.19,-30.68,-4.8,-40.39,-6.31,-48.06,-7.53,-50.11,-7.62,-55.42,-7.38,-61.16,-6.97,-3.75,0.82,-16.15,-2.39,-26.37,-5.63,-37.91,-6.35,-50.79,-7.57,-60.47,-8.32,-63.24,-8.54,-70.85,-9.11,-79.08,-9.72]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":6,"value":[-1.04,0.09,-12.16,1.05,-23.27,2.02,-24.66,1.92,-26.03,1.19,-27.5,0.41,0,0,-1.46,-0.95,-2.82,-1.93,-3.95,-2.76,-11.4,-5.86,-18.8,-8.73,-21.12,-10.39,-22.01,-12.76,-22.73,-15.14,0,0,-2.82,-1.84,-5.45,-3.72,-6.55,-5.43,-10.51,-12.27,-14.41,-18.65,-17.42,-21.83,-17.74,-25.83,-17.57,-29.77,0,0,-2.7,-2.74,-5.23,-5.86,-6.1,-8.28,-7.87,-15.67,-9.77,-22.54,-12.8,-27.53,-11.83,-34.47,-10.01,-40.89,0,0,-0.79,-2.69,-1.51,-6.32,-1.41,-9.7,-2.04,-20.95,-3.39,-31.81,-5.56,-38.72,-4.7,-47.24,-3.12,-55.25,0,0,0.18,-0.84,0.38,-2.04,1.52,-5.86,3.64,-22.91,4.35,-39.69,3.57,-47.83,4.49,-54.84,5.63,-62.48,0,0,0,0,0,0,1.36,-3.44,8.32,-23.55,14.02,-44.69,14.35,-54.75,14,-64.48,13.78,-74.37,0,0,0,0,0,0,1.44,-2.87,13.06,-25.74,24.02,-51.49,24.86,-63.05,22.36,-75.13,19.85,-87.01,0,0,0,0,0,0,1.53,-2.3,17.75,-27.92,33.92,-58.28,34.64,-70.28,29.74,-81.77,24.32,-93.6]}]},{"name":"B_HAND.16","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.58,-0.72,-3.58,-0.72,-3.58,-0.72,-3.58,-0.72,-3.58,-0.72,-3.79,4.34,-4.39,9.96,-5.15,15.81,-5.83,21.54,-3.58,-0.72,-3.52,-0.71,-3.45,-0.69,-3.4,-0.68,-3.37,-0.68,-3.47,5.48,-4.05,11.79,-4.81,18.13,-5.46,24.37,-3.58,-0.72,-3.45,-0.7,-3.31,-0.67,-3.2,-0.64,-3.14,-0.63,-3.12,6.69,-3.67,13.78,-4.44,20.7,-5.06,27.5,-3.58,-0.72,-3.4,-0.69,-3.2,-0.64,-3.03,-0.61,-2.95,-0.59,-2.82,7.79,-3.36,15.47,-4.14,22.77,-4.73,30.04,-3.58,-0.72,-3.37,-0.68,-3.14,-0.63,-2.95,-0.59,-2.87,-0.58,-2.71,8.62,-3.21,16.39,-3.97,23.59,-4.6,31.08,-3.58,-0.72,-3.48,-0.04,-3.31,0.3,-3.16,0.56,-3.13,0.98,-3.03,9.64,-3.57,17.13,-4.32,23.96,-4.88,30.69,-3.57,-0.73,-3.67,0.93,-3.66,2.34,-3.67,3.58,-3.79,4.76,-3.82,12.42,-4.32,18.68,-5,24.23,-5.56,29.73,-3.56,-0.74,-3.86,2.04,-4.1,4.82,-4.33,7.36,-4.6,9.43,-4.77,15.91,-5.24,20.57,-5.84,24.44,-6.4,28.54,-3.55,-0.76,-4.02,3.09,-4.5,7.08,-4.95,10.76,-5.34,13.66,-5.61,19.07,-6.08,22.3,-6.64,24.67,-7.16,27.47]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.87,-5.31,0.91,-7.37,0.96,-9.65,1,-11.5,1.01,-12.26,1.01,-12.87,0.99,-14.36,0.96,-16.21,0.94,-17.88,0.87,-5.31,0.93,-7.02,1.01,-8.88,1.08,-10.37,1.1,-10.98,1.08,-11.55,1.05,-12.94,1,-14.65,0.96,-16.21,0.87,-5.31,0.96,-6.65,1.07,-8.04,1.16,-9.13,1.19,-9.58,1.17,-10.09,1.11,-11.35,1.05,-12.92,0.99,-14.36,0.87,-5.31,0.98,-6.32,1.12,-7.34,1.23,-8.12,1.27,-8.44,1.24,-8.91,1.17,-10.08,1.08,-11.53,1.01,-12.87,0.87,-5.31,1,-6.1,1.14,-6.97,1.26,-7.68,1.3,-7.97,1.27,-8.44,1.19,-9.58,1.1,-10.98,1.01,-12.26,0.89,-5.32,1,-5.97,1.12,-6.75,1.21,-7.41,1.26,-7.68,1.22,-8.12,1.15,-9.18,1.07,-10.45,1,-11.5,0.94,-5.36,1.01,-5.8,1.08,-6.34,1.14,-6.8,1.15,-6.98,1.11,-7.29,1.06,-8.04,1.01,-8.93,0.96,-9.65,1.03,-5.42,1.05,-5.62,1.06,-5.87,1.05,-6.06,1.02,-6.12,0.99,-6.25,0.96,-6.6,0.93,-7.02,0.91,-7.37,1.16,-5.51,1.12,-5.49,1.07,-5.45,1,-5.4,0.92,-5.35,0.89,-5.33,0.88,-5.32,0.87,-5.31,0.87,-5.31]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_R_02","timeline":[{"name":"B_CLOTHES.25","type":50,"frame":[{"duration":-60,"tweenEasing":0,"offset":114,"value":[0.29,-0.07,2.83,-0.72,5.37,-1.37,4.88,-1.2,3.22,-0.68,1.45,-0.34,0,0,0,0,0,0,0.61,-0.09,6.76,-0.92,12.9,-1.75,12.62,-1.74,9.97,-1.64,7.11,-1.65,0,0,0,0,0,0,0.91,-0.09,10.64,-1,20.37,-1.91,20.4,-2.12,16.96,-2.58,13.24,-3.08]},{"duration":60,"tweenEasing":0,"offset":114,"value":[0.29,-0.07,2.83,-0.72,5.37,-1.37,4.88,-1.2,3.22,-0.68,1.45,-0.34,0,0,0,0,0,0,0.61,-0.09,6.76,-0.92,12.9,-1.75,12.62,-1.74,9.97,-1.64,7.11,-1.65,0,0,0,0,0,0,0.91,-0.09,10.64,-1,20.37,-1.91,20.4,-2.12,16.96,-2.58,13.24,-3.08]},{"duration":60,"tweenEasing":0,"offset":18,"value":[4.76,-3,2.63,-1.68,0.65,-0.38,0.35,0,3.09,0.21,5.84,0.43,7.26,2.77,5.61,6.45,3.39,9.77,9.17,-5.78,5.04,-3.22,1.21,-0.72,0.65,0,5.95,0.41,11.26,0.82,14.14,5.38,10.86,12.4,6.53,18.81,10.14,-6.52,3.92,-3.96,-1.93,-1.99,-2.6,-1.45,4.53,-0.27,11.67,0.91,15.13,6.04,11.65,13.51,7.21,20.89,8.52,-6.83,-1.35,-4.4,-10.7,-2.74,-12.19,-2.26,-5.02,-0.43,2.16,1.41,5.03,5.02,5.58,11.65,5.91,18.49,6.9,-7.14,-5.17,-4.2,-16.41,-1.61,-18.94,-0.81,-15.65,0.85,-12.35,2.52,-9.68,4.51,-2.8,10.07,4.62,16.09,6.01,-6.39,-6.13,-3.51,-17.36,-0.82,-20.45,-0.02,-21.72,0.94,-22.99,1.89,-20.24,3.55,-7.82,8.99,5.45,13.8,3.12,-3.32,-8.19,-0.78,-18.65,1.58,-21.83,2.28,-26.44,3.11,-31.05,3.94,-27.2,4.38,-9.66,5.33,9.19,5.69,0,0,-10.43,2.18,-20.07,4.19,-23.27,4.78,-31.17,5.64,-39.07,6.5,-34.01,5.52,-11.32,1.39,13.24,-3.08]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":60,"value":[-0.01,-0.01,0,-0.09,0,-0.17,0,-0.17,-0.01,-0.13,0,0,0,0,0,0,0,0,0,-0.09,-0.03,-1,-0.06,-1.91,-0.06,-1.78,-0.03,-0.93,0,0,0,0,0,0,0,0,0,-0.17,-0.06,-1.91,-0.12,-3.66,-0.11,-3.39,-0.05,-1.72,0,0,0,0,0,0,0,0,0.3,-0.26,2.97,-3.07,5.05,-6.72,4.11,-6.81,2.76,-3.95,1.45,-0.34,0,0,0,0,0,0,0.59,-0.51,6.4,-6.41,10.75,-14.37,9.59,-14.86,8.38,-8.67,7.11,-1.65,0,0,0,0,0,0,0.88,-0.79,9.69,-9.97,16.15,-22.46,14.99,-23.33,14.15,-13.61,13.24,-3.08]}]},{"name":"B_CLOTHES.28","type":50,"frame":[{"duration":-60,"tweenEasing":0,"offset":2,"value":[-11.12,-2.97,-21.4,-5.71,-23.03,-6.2,-12.41,-3.96,-1.78,-1.71,-0.7,-1.34,-0.36,-0.7,0,0,0,0,-9.54,-4.64,-18.33,-9.09,-19.63,-9.84,-10.43,-5.52,-1.24,-1.21,-0.39,-0.72,-0.2,-0.39,0,0,0,0,-8.04,-6.23,-15.45,-12.23,-16.47,-13.2,-8.61,-6.97,-0.75,-0.75,-0.09,-0.16,-0.05,-0.11,0,0,0,0,-6.12,-5.97,-11.9,-12.05,-13.17,-13.07,-7.04,-6.83,-0.92,-0.59,0,0,0,0,0,0,0,0,4.3,-1.23,8.4,-2.38,8.92,-2.56,4.69,-1.34,0.46,-0.11,0,0,0,0,0,0,0,0,14.89,3.58,28.78,7.32,30.96,7.96,16.42,4.16,1.88,0.36,0,0,0,0,0,0,0,0,14.09,3.7,27.23,7.36,29.36,7.97,15.61,4.16,1.86,0.36,0,0,0,0,0,0,0,0,7.26,1.89,14.06,3.82,15.23,4.14,8.11,2.16,0.99,0.19]},{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.12,-2.97,-21.4,-5.71,-23.03,-6.2,-12.41,-3.96,-1.78,-1.71,-0.7,-1.34,-0.36,-0.7,0,0,0,0,-9.54,-4.64,-18.33,-9.09,-19.63,-9.84,-10.43,-5.52,-1.24,-1.21,-0.39,-0.72,-0.2,-0.39,0,0,0,0,-8.04,-6.23,-15.45,-12.23,-16.47,-13.2,-8.61,-6.97,-0.75,-0.75,-0.09,-0.16,-0.05,-0.11,0,0,0,0,-6.12,-5.97,-11.9,-12.05,-13.17,-13.07,-7.04,-6.83,-0.92,-0.59,0,0,0,0,0,0,0,0,4.3,-1.23,8.4,-2.38,8.92,-2.56,4.69,-1.34,0.46,-0.11,0,0,0,0,0,0,0,0,14.89,3.58,28.78,7.32,30.96,7.96,16.42,4.16,1.88,0.36,0,0,0,0,0,0,0,0,14.09,3.7,27.23,7.36,29.36,7.97,15.61,4.16,1.86,0.36,0,0,0,0,0,0,0,0,7.26,1.89,14.06,3.82,15.23,4.14,8.11,2.16,0.99,0.19]},{"duration":60,"tweenEasing":0,"offset":2,"value":[1.12,-6.91,2.16,-13.29,2.29,-14.88,0.84,-14.51,-0.61,-14.13,-0.66,-12.56,-0.35,-6.53,0,0,0,0,1.81,-12.55,2.8,-28.01,2.77,-34.74,1.24,-31.21,-0.28,-27.69,-0.29,-23.5,-0.42,-9.97,0,0,0,0,2.02,-13.54,2.99,-30.44,2.66,-39.69,1.33,-29.03,0,-18.37,-0.12,-14.82,-0.17,-6.02,0,0,0,0,3.15,-8.35,3.82,-18.4,1.54,-26.58,0.8,-13.89,0.07,-1.19,0,0,0,0,0,0,0,0,7.79,-2.5,7.07,-7.92,0.73,-13.89,0.42,-7.25,0.11,-0.62,0,0,0,0,0,0,0,0,12.57,3.36,10.23,2.62,0.05,-1.19,0.04,-0.62,0.03,-0.05,0,0,0,0,0,0,0,0,10.73,3.25,8.59,2.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5.37,1.62,4.29,1.3]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":56,"value":[0.67,-0.84,0.64,-0.17,0.25,0.27,-0.02,0.48,-0.29,0.69,-0.3,0.69,-0.15,0.52,0,0,0,0,3.26,-2.74,3.75,0.97,2.17,3.2,-0.22,5.59,-2.61,7.99,-2.56,7.32,-1.3,3.8,0,0,0,0,5.88,-4.66,6.87,2.1,4.11,6.12,-0.42,10.71,-4.95,15.29,-4.79,13.94,-2.49,7.09,0,0,0,0,4.51,-0.91,4.69,9.96,2.12,14.82,-1.48,17.87,-5.08,20.93,-4.6,18.49,-2.48,8.55,0,0,0,0,1.67,1.97,1.09,11.39,-0.39,14.89,-1.71,15.23,-3.04,15.57,-2.55,13.45,-1.37,5.85]}]},{"name":"B_CLOTHES.33","type":11,"frame":[{"duration":-60,"tweenEasing":0,"x":21.65,"y":1.6},{"duration":60,"tweenEasing":0,"x":21.65,"y":1.6},{"duration":121}]},{"name":"B_CLOTHES.33","type":12,"frame":[{"duration":-60,"tweenEasing":0,"x":75.1},{"duration":60,"tweenEasing":0,"x":75.1},{"duration":60,"tweenEasing":0,"x":27.6},{"duration":60,"tweenEasing":0},{"x":-34}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_L_02","timeline":[{"name":"B_CLOTHES.36","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.08","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_L","timeline":[{"name":"B_CLOTHES.08","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-0.11,-0.44,-0.23,-0.88,-0.24,-0.96,-0.13,-0.5,-0.01,-0.04,0,0,0,0,0,0,0,0,-0.22,-0.85,-0.43,-1.7,-0.47,-1.85,-0.25,-0.96,-0.02,-0.08,0,0,0,0,0,0,0,0,-0.24,-0.93,-0.47,-1.84,-0.51,-1.98,-0.27,-1.04,-0.02,-0.09,0,0,0,0,0,0,0,0,-0.13,-0.5,-0.25,-0.96,-0.27,-1.04,-0.14,-0.54,-0.01,-0.05,0,0,0,0,0,0,0,0,-0.02,-0.07,-0.03,-0.09,-0.02,-0.09,-0.01,-0.05]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.54,1.35,1.06,2.74,1.28,3,1.67,1.97,2.07,0.93,1.84,0.74,0.95,0.36,0,0,0,0,1.05,2.62,2.06,5.28,2.46,5.78,3.22,3.79,3.98,1.79,3.56,1.42,1.83,0.7,0,0,0,0,1.15,2.89,2.23,5.69,2.63,6.22,3.46,4.07,4.29,1.92,3.86,1.53,2,0.77,0,0,0,0,0.62,1.55,1.17,2.99,1.37,3.25,1.81,2.13,2.25,1,2.04,0.8,1.06,0.42,0,0,0,0,0.08,0.22,0.12,0.28,0.1,0.28,0.16,0.18,0.21,0.08,0.23,0.07,0.13,0.06]}]},{"name":"B_HAND.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[40.01,14.54,33.74,10.25,26.97,6.03,21.14,1.84,17.68,-2.35,16.84,-2.27,14.91,-1.94,12.64,-1.37,10.8,-0.6,38.45,21.52,32.62,15.86,26.41,10.06,20.96,4.47,17.38,-0.54,16.56,-0.69,14.72,-0.89,12.6,-0.98,10.92,-0.78,36.7,29.22,31.39,22.06,25.73,14.51,20.64,7.37,17.02,1.43,16.26,1.01,14.53,0.19,12.57,-0.61,11.1,-1.02,35.28,35.44,30.41,26.96,25.26,18.01,20.47,9.66,16.71,2.97,16.01,2.33,14.4,1.02,12.61,-0.4,11.35,-1.37,34.68,37.98,30.01,28.7,25.28,19.2,20.71,10.46,16.54,3.48,15.89,2.77,14.38,1.27,12.74,-0.45,11.67,-1.83,37.9,36.18,32.7,27.92,27.1,19.03,21.88,10.66,17.8,3.93,17.29,3.17,15.52,1.52,13.46,-0.49,12.1,-2.36,41.69,32.39,36.15,25.61,30.16,18.31,24.75,11.26,20.94,5.24,20.09,4.32,17.56,2.27,14.62,-0.28,12.47,-2.72,45.75,27.84,39.97,22.69,33.75,17.39,28.3,12.08,24.88,6.94,23.44,5.82,19.95,3.29,15.88,0.13,12.76,-2.9,49.77,23.76,43.75,20.15,37.14,16.67,31.53,12.94,28.52,8.58,26.55,7.3,22.11,4.37,16.97,0.68,12.9,-2.89]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[20.27,-65.55,18.9,-54.78,17.53,-44.02,16.15,-33.26,14.78,-22.5,13.41,-11.73,12.04,-0.97,10.66,9.79,9.29,20.56,16.24,-66.79,14.86,-56.03,13.49,-45.27,12.12,-34.51,10.74,-23.74,9.37,-12.98,8,-2.22,6.62,8.55,5.25,19.31,12.2,-68.04,10.83,-57.28,9.45,-46.52,8.08,-35.75,6.71,-24.99,5.33,-14.23,3.96,-3.46,2.59,7.3,1.21,18.06,8.16,-69.29,6.79,-58.53,5.41,-47.76,4.04,-37,2.67,-26.24,1.29,-15.47,-0.08,-4.71,-1.45,6.05,-2.83,16.82,4.12,-70.54,2.75,-59.77,1.38,-49.01,0,-38.25,-1.37,-27.48,-2.74,-16.72,-4.12,-5.96,-5.49,4.81,-6.86,15.57,0.08,-71.78,-1.29,-61.02,-2.66,-50.26,-4.04,-39.49,-5.41,-28.73,-6.78,-17.97,-8.15,-7.2,-9.53,3.56,-10.9,14.32,-3.95,-73.03,-5.33,-62.27,-6.7,-51.5,-8.07,-40.74,-9.45,-29.98,-10.82,-19.21,-12.19,-8.45,-13.57,2.31,-14.94,13.07,-7.99,-74.28,-9.36,-63.51,-10.74,-52.75,-12.11,-41.99,-13.48,-31.22,-14.86,-20.46,-16.23,-9.7,-17.6,1.06,-18.98,11.83,-12.03,-75.52,-13.4,-64.76,-14.78,-54,-16.15,-43.23,-17.52,-32.47,-18.9,-21.71,-20.27,-10.95,-21.64,-0.18,-23.02,10.58]}]},{"name":"B_HAND.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[19.38,1.82,15.27,1.77,10.69,1.54,6.99,1.22,5.48,0.95,5.47,0.87,5.5,0.81,5.61,0.74,5.84,0.63,26.27,1.6,21,1.43,15.15,1.04,10.43,0.58,8.51,0.23,8.09,0.23,7.32,0.36,6.49,0.5,5.9,0.54,33.4,1.64,27,1.3,19.89,0.62,14.15,-0.1,11.85,-0.57,10.94,-0.49,9.31,-0.16,7.48,0.22,6,0.4,40.02,1.13,32.44,0.71,24.04,-0.02,17.25,-0.77,14.54,-1.26,13.31,-1.12,10.99,-0.63,8.34,-0.09,6.14,0.22,45.34,-0.76,36.51,-0.98,26.76,-1.17,18.87,-1.36,15.62,-1.61,14.52,-1.47,11.91,-0.97,8.83,-0.4,6.32,-0.02,53.96,-0.98,45.05,-1.22,35.41,-1.58,27.2,-1.93,22.53,-2.16,19.91,-1.67,15.59,-1.13,10.72,-0.59,6.43,-0.12,63.65,-2.21,54.84,-2.33,45.5,-2.57,37.19,-2.78,31.43,-2.85,26.74,-1.98,20.22,-1.29,13.06,-0.69,6.48,-0.1,73.8,-3.76,65.18,-3.73,56.23,-3.74,47.89,-3.71,41.13,-3.58,34.13,-2.3,25.19,-1.41,15.57,-0.7,6.49,0.04,83.85,-4.96,75.36,-4.81,66.73,-4.68,58.32,-4.5,50.47,-4.21,41.25,-2.53,29.98,-1.44,17.95,-0.62,6.49,0.27]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[15.43,-49.79,13.76,-37,12.06,-23.8,10.41,-11.42,8.83,-1.07,8.76,3.05,7.58,7.93,5.96,13.12,4.56,18.15,10.62,-55.34,9.42,-42.77,8.16,-29.83,6.98,-17.52,6.01,-6.84,6.05,-2.79,5.28,3.18,4.19,9.89,3.27,16.14,5.73,-61.61,4.97,-49.25,4.08,-36.52,3.3,-24.24,2.89,-13.22,3.1,-9.18,2.76,-1.99,2.23,6.37,1.85,13.91,0.98,-66.43,0.76,-54.3,0.36,-41.87,0.12,-29.71,0.37,-18.39,0.64,-14.48,0.67,-6.34,0.63,3.41,0.69,12.1,-3.4,-67.63,-2.87,-55.78,-2.44,-43.89,-1.81,-32.09,-0.67,-20.52,-0.58,-17.03,-0.34,-8.57,-0.05,1.89,0.22,11.36,-5.29,-69.57,-5.59,-57.98,-5.29,-46.09,-3.91,-34.19,-0.93,-22.56,-0.86,-19.05,-0.55,-10.5,-0.16,0.1,0.16,9.74,-6.99,-72.33,-8.32,-61.39,-8.22,-50.15,-6.14,-38.8,-1.55,-27.53,-1.42,-23.9,-0.99,-15.07,-0.45,-4.14,0.01,5.79,-8.61,-75.41,-11.01,-65.28,-11.14,-54.96,-8.42,-44.43,-2.31,-33.66,-2.09,-29.89,-1.52,-20.71,-0.81,-9.36,-0.18,0.92,-10.26,-78.33,-13.71,-68.92,-14.04,-59.4,-10.67,-49.56,-3,-39.21,-2.71,-35.31,-2.01,-25.81,-1.14,-14.09,-0.35,-3.48]}]},{"name":"B_HAND.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[23.14,1.08,17.91,1.21,12.11,1.19,7.42,1.05,5.5,0.84,5.52,0.7,5.64,0.6,5.87,0.64,6.23,0.96,29.17,2.67,22.51,2.35,15.13,1.78,9.16,1.18,6.74,0.77,6.61,0.65,6.44,0.57,6.35,0.6,6.45,0.8,35.22,4.41,27.15,3.61,18.2,2.42,10.99,1.28,8.11,0.63,7.8,0.52,7.32,0.44,6.89,0.42,6.71,0.5,41.17,5.37,31.66,4.2,21.1,2.65,12.59,1.24,9.2,0.46,8.79,0.35,8.09,0.23,7.4,0.14,7.02,0.09,46.93,4.58,35.85,3.33,23.62,2.02,13.71,0.93,9.63,0.3,9.3,0.17,8.54,0,7.76,-0.2,7.35,-0.39,57.36,5.39,45.53,4.27,32.8,2.7,21.81,1.25,15.19,0.5,14.72,0.35,12.5,0.08,9.71,-0.21,7.52,-0.46,68.75,3.61,56.44,2.99,43.51,2.02,31.78,1.08,23.05,0.6,21.83,0.46,17.56,0.19,12.17,-0.11,7.59,-0.38,80.57,0.85,67.89,0.89,54.87,0.84,42.52,0.74,31.83,0.66,29.55,0.56,22.99,0.35,14.79,0.09,7.59,-0.17,92.28,-1.24,79.18,-0.64,65.98,0.02,52.91,0.54,40.17,0.79,36.91,0.74,28.17,0.6,17.27,0.4,7.55,0.16]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-1.54,-10.15,-1.08,-7.14,-0.58,-3.81,-0.17,-1.11,0,0,0,0,0,0,0,0,0,0,-2.78,-14.51,-1.99,-11.25,-1.12,-7.61,-0.42,-4.67,-0.1,-3.45,-0.04,-3.38,0.07,-3.21,0.21,-3.01,0.33,-2.84,-4.14,-19.34,-2.99,-15.8,-1.74,-11.83,-0.71,-8.6,-0.21,-7.26,-0.09,-7.11,0.15,-6.75,0.44,-6.33,0.7,-5.99,-5.25,-23.24,-3.8,-19.46,-2.22,-15.23,-0.92,-11.77,-0.3,-10.35,-0.13,-10.14,0.21,-9.63,0.62,-9.03,0.99,-8.53,-5.7,-24.85,-4.11,-20.92,-2.35,-16.58,-0.92,-13.07,-0.34,-11.62,-0.18,-11.4,0.21,-10.85,0.68,-10.19,1.11,-9.58,-6.05,-25.54,-4.48,-21.19,-2.69,-16.56,-1.23,-12.89,-0.67,-11.4,-0.54,-11.13,-0.08,-10.45,0.5,-9.53,0.99,-8.53,-6.9,-27.23,-5.32,-22.23,-3.52,-16.87,-2.05,-12.6,-1.48,-10.86,-1.29,-10.37,-0.7,-9.15,0.05,-7.56,0.7,-5.99,-7.95,-29.31,-6.34,-23.58,-4.54,-17.31,-3.07,-12.26,-2.49,-10.19,-2.2,-9.4,-1.44,-7.48,-0.5,-5.07,0.33,-2.84,-8.89,-31.19,-7.26,-24.78,-5.46,-17.69,-4,-11.95,-3.4,-9.59,-3.03,-8.54,-2.12,-5.99,-1.01,-2.85]}]},{"name":"B_HAND.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[24.45,7.62,18.81,5.59,12.58,3.42,7.53,1.63,5.45,0.76,5.56,0.65,5.87,0.58,6.3,0.6,6.77,0.78,33.1,9.87,25.47,7.37,17.33,4.67,10.32,2.18,6.1,0.31,6.17,0.22,6.38,0.16,6.69,0.17,7.06,0.31,42.14,12.43,32.49,9.41,22.32,6.05,13.23,2.72,6.82,-0.18,6.82,-0.24,6.92,-0.26,7.1,-0.22,7.35,-0.1,50.42,14.32,38.9,10.88,26.82,7.12,15.79,3.24,7.4,-0.59,7.37,-0.62,7.37,-0.59,7.45,-0.53,7.62,-0.44,56.75,14.54,43.7,10.93,30.12,7.48,17.57,3.73,7.63,-0.8,7.64,-0.8,7.64,-0.77,7.69,-0.71,7.85,-0.65,68.21,16.58,55.06,13.18,41.36,9.37,28.43,5.43,17.61,1.7,15.9,1.38,13.36,0.47,10.49,-0.36,7.82,-0.48,76.59,12.82,63.56,10,50.16,6.66,37.28,3.39,25.83,0.81,22.81,0.7,18.16,0.05,12.83,-0.48,7.79,-0.23,82.71,5.5,69.9,3.46,56.93,1.01,44.24,-1.16,32.27,-2.4,28.41,-1.92,22.09,-1.5,14.73,-0.92,7.75,0.07,87.4,-3.12,74.76,-4.39,62.08,-5.91,49.43,-6.97,36.89,-6.86,32.84,-5.57,25.26,-3.68,16.2,-1.57,7.72,0.4]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[-0.22,3.63,-0.15,3.63,-0.07,3.71,-0.01,3.57,0.01,2.9,0,2.56,0.01,1.75,0.01,0.8,0,0,-0.46,7.64,-0.32,7.62,-0.15,7.77,-0.02,7.47,0.03,6.1,0.02,5.38,0.02,3.66,0.01,1.64,0,0,-0.66,10.89,-0.45,10.88,-0.21,11.14,-0.02,10.72,0.04,8.69,0.04,7.68,0.02,5.26,0.01,2.39,0,0,-0.74,12.23,-0.49,12.28,-0.22,12.79,0,12.39,0.04,9.76,0.04,8.69,0.03,6.1,0.01,2.9,0,0,-0.66,12.43,-0.39,12.25,-0.08,12.39,0.16,11.91,0.21,9.87,0.21,8.8,0.16,6.19,0.07,2.95,0,0,-0.46,12.93,-0.13,12.48,0.24,12.22,0.52,11.61,0.61,10.13,0.57,9.03,0.4,6.35,0.19,3.03,0,0,-0.22,13.53,0.18,12.81,0.62,12.13,0.97,11.39,1.1,10.46,0.99,9.32,0.7,6.54,0.33,3.11,0,0,0,14.08,0.46,13.1,0.97,12,1.38,11.12,1.55,10.76,1.38,9.58,0.97,6.72,0.46,3.19]}]},{"name":"B_HAND.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[6.98,1.49,2.89,1.85,-1.63,2.33,-5.28,2.72,-6.77,2.82,-5.01,2.29,-1.14,1.41,3.43,0.5,7.23,-0.16,15.92,2.7,10.12,2.54,3.86,2.38,-1.43,2,-4.33,1.19,-2.71,0.97,0.58,0.8,4.35,0.71,7.42,0.7,25.29,4.31,17.67,3.52,9.52,2.46,2.42,1.05,-2.04,-0.75,-0.52,-0.58,2.19,0.14,5.2,1.04,7.57,1.77,33.93,5.32,24.75,4.1,14.94,2.57,6.28,0.57,0.57,-2.03,1.91,-1.59,3.95,-0.25,6.07,1.38,7.66,2.71,40.7,4.72,30.52,3.58,19.67,2.77,10.14,1.33,3.97,-1.67,4.91,-1.29,6.06,-0.04,7.1,1.61,7.69,3.21,48.86,4.08,37.86,2.82,26.11,1.19,15.8,-0.84,9.11,-3.34,9.67,-2.5,9.42,-0.84,8.65,1.17,7.65,3.06,54.68,0.33,43.75,-0.57,32.07,-1.79,22.06,-3.26,16.14,-4.94,15.85,-3.74,13.7,-1.86,10.63,0.3,7.58,2.37,59.55,-4.68,49.05,-5.03,37.75,-5.38,28.46,-5.85,23.98,-6.53,22.6,-5.01,18.35,-2.99,12.79,-0.76,7.49,1.43,64.86,-9.09,54.64,-8.97,43.52,-8.72,34.74,-8.41,31.55,-8.15,29.14,-6.28,22.85,-4.1,14.88,-1.76,7.42,0.57]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[1.41,43.43,1.14,36.12,0.93,28.59,0.61,21.51,-0.01,15.55,-0.01,13.85,-0.01,9.72,0,4.62,0,0,2.21,40.94,2.22,34.62,2.38,28.25,2.37,22.17,1.89,16.69,1.66,14.35,1.16,9.95,0.55,4.75,0,0,3.1,38.18,3.42,32.9,3.96,27.84,4.3,22.89,4,17.95,3.49,14.96,2.43,10.25,1.15,4.91,0,0,3.82,35.95,4.42,31.59,5.27,27.57,5.86,23.5,5.7,18.97,5.02,15.37,3.5,10.44,1.65,5.03,0,0,4.12,35.03,4.91,31.29,5.86,27.66,6.5,23.81,6.4,19.39,5.78,15.26,4.07,10.33,1.93,5.09,0,0,7.09,36.27,7.2,32.68,7.4,28.68,7.36,24.25,6.77,19.33,6,15.22,4.21,10.31,2,5.08,0,0,9.71,36.48,9.34,33.18,9.03,29.15,8.55,24.47,7.67,19.18,6.61,15.12,4.59,10.25,2.2,5.05,0,0,12.19,36.29,11.42,33.32,10.7,29.41,9.88,24.61,8.78,18.99,7.37,14.99,5.09,10.16,2.46,5,0,0,14.74,36.29,13.53,33.65,12.35,29.77,11.14,24.79,9.78,18.82,8.05,14.87,5.53,10.08,2.68,4.96]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_TWIN_R","timeline":[{"name":"B_HAIR_TWIN.15","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.19,0,-0.35,0,-0.28,0,-0.42,-0.02,-0.56,-0.04,-0.53,-0.04,-0.53,-0.03,-0.53,0,0,0,-1.64,0,-3.15,0,-3.65,-0.02,-4.86,-0.23,-6.07,-0.43,-6.19,-0.4,-6.19,-0.21,-6.19,0,0,0,-3.08,0,-5.94,0,-7.02,-0.04,-9.3,-0.43,-11.58,-0.83,-11.84,-0.77,-11.84,-0.39,-11.84,0,0,0,-5.32,0,-10.31,0,-12.36,-0.03,-15.45,-0.4,-18.54,-0.77,-18.37,-0.71,-17.63,-0.36,-16.9,0,0,0,-6.85,0,-13.22,0,-15.47,-0.02,-18.69,-0.21,-21.9,-0.4,-22.01,-0.37,-21.9,-0.18,-21.83,0,0,0,-8.18,0,-15.74,0,-17.98,0,-21.21,0,-24.44,0,-24.94,0,-25.69,0,-26.51]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":19,"value":[0.42,0.37,0.24,0.71,0.05,0.77,0,0.41,0,0.05,0,0,0,0,0,0,0,0,0.81,0.71,0.45,1.37,0.09,1.49,0,0.79,0,0.09,0,0,0,0,0,0,0,1.9,1.13,2.24,0.66,2.51,0.14,2.21,0,1.45,-0.02,0.69,-0.04,0.71,-0.04,0.38,-0.03,0,0,6.41,0.79,7.29,0.48,8.06,0.1,7.91,-0.02,7.51,-0.23,7.11,-0.43,6.3,-0.4,3.27,-0.21,0,0,8.67,0.08,10.95,0.04,13.06,0.01,13.62,-0.04,13.57,-0.43,13.52,-0.83,11.87,-0.77,6.15,-0.39,0,0,9.42,0,13.11,0,16.6,0,18.07,-0.04,18.74,-0.45,19.4,-0.87,16.91,-0.81,8.73,-0.42,0,0,11.68,0,15.3,0,18.68,0,19.94,-0.04,20.74,-0.45,21.54,-0.87,18.97,-0.81,9.82,-0.42,0,0,14.14,0,17.41,0,20.43,0,21.28,-0.04,22.09,-0.45,22.9,-0.87,20.46,-0.81,10.63,-0.42]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_TWIN_L","timeline":[{"name":"B_HAIR_TWIN.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.12,-0.02,-0.23,-0.03,-0.16,-0.03,-0.37,-0.04,-0.58,-0.05,-0.56,-0.05,-0.48,-0.04,-0.39,0,0,0,-1.05,-0.14,-2.03,-0.27,-2.45,-0.31,-4.27,-0.45,-6.09,-0.58,-6.08,-0.53,-5.35,-0.27,-4.55,0.01,0,0,-1.99,-0.26,-3.83,-0.51,-4.75,-0.6,-8.18,-0.86,-11.61,-1.12,-11.6,-1.01,-10.21,-0.51,-8.72,0.01,0,0,-4.76,-0.31,-9.2,-0.68,-10.37,-0.79,-12.52,-0.92,-14.67,-1.05,-14.19,-0.93,-12.42,-0.45,-10.48,0.02,0,0,-7.96,-0.16,-15.34,-0.36,-17.37,-0.42,-19.83,-0.47,-22.3,-0.52,-21.67,-0.46,-18.88,-0.21,-15.84,0.03,0,0,-11.07,0.02,-21.3,0.04,-24.2,0.04,-27.33,0.05,-30.45,0.05,-29.75,0.05,-25.85,0.04,-21.63,0.04]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":54,"value":[0.34,0.03,1.02,0.02,1.68,0.02,2.05,0.02,2.17,-0.06,2.29,-0.14,1.55,-0.26,0.73,-0.17,-0.05,-0.21,3.99,0.3,5.32,0.3,6.61,0.29,7.36,0.28,8.4,0.18,9.44,0.07,6.45,-0.7,2.87,-1.56,-0.58,-2.43,7.63,0.57,8.71,0.57,9.72,0.57,10.26,0.56,12.22,0.55,14.19,0.53,9.56,-0.94,4.1,-2.87,-1.12,-4.65,10.71,0.59,10.83,0.55,11,0.53,11.43,0.49,12.61,0.14,13.8,-0.22,9.97,-1.71,4.44,-3.97,-1.05,-5.87,21.43,0.57,18.68,0.42,16.18,0.29,15.75,0.23,16.05,0.01,16.35,-0.21,13.42,-0.98,6.6,-2.21,-0.55,-3.21,33.02,0.55,27.22,0.28,21.87,0.03,20.45,-0.03,19.93,-0.03,19.41,-0.03,17.24,-0.03,8.96,-0.02]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_SIDE_L","timeline":[{"name":"B_HAIR_SIDE.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-0.23,0,-0.48,0,-0.68,0,-0.79,0,-0.68,0,-0.48,0,-0.23,0,0,0,0,0,-0.48,0,-0.99,0,-1.43,0,-1.66,0,-1.43,0,-0.99,0,-0.48,0,0,0,0,0,-0.68,0,-1.43,0,-2.05,0,-2.36,0,-2.05,0,-1.43,0,-0.68,0,0,0,0,0,-0.79,0,-1.66,0,-2.36,0,-2.65,0,-2.36,0,-1.66,0,-0.79,0,0,0,-0.87,-0.1,-6.03,-0.07,-10.34,-0.04,-13,-0.04,-13.22,-0.14,-13.51,-0.29,-11.79,-0.32,-8.65,-0.22,-4.64,0,-2.98,-0.33,-13.59,-0.29,-22.42,-0.22,-28.16,-0.25,-29.51,-0.45,-30.63,-0.73,-28.15,-0.72,-22.94,-0.46,-15.89,0,-5.59,-0.62,-21.57,-0.55,-34.88,-0.44,-43.72,-0.46,-46.28,-0.75,-48.74,-1.16,-46.01,-1.12,-39.3,-0.71,-29.8,0,-7.95,-0.88,-28.36,-0.75,-45.12,-0.55,-55.88,-0.51,-58.28,-0.88,-62.78,-1.43,-60.64,-1.41,-53.34,-0.91,-42.38]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.23,0,0.48,0,0.68,0,0.79,0,0.68,0,0.48,0,0.23,0,0,0,0,0,0.48,0,0.99,0,1.43,0,1.66,0,1.43,0,0.99,0,0.48,0,0,0,0,0,0.68,0,1.43,0,2.05,0,2.36,0,2.05,0,1.43,0,0.68,0,0,0,0,0,0.79,0,1.66,0,2.36,0,2.65,0,2.36,0,1.66,0,0.79,0,0,0,8.24,0,9.43,0.06,10.8,0.18,11.83,0.31,12.04,0.37,11.53,0.31,9.63,0.18,6.22,0.06,1.16,0,16.89,0,18.91,0.05,21.18,0.16,22.96,0.28,23.51,0.33,22.66,0.28,19.46,0.16,13.41,0.05,3.97,0,25.7,0,28.72,0.02,32.07,0.06,34.76,0.1,35.8,0.12,34.57,0.1,30.03,0.06,21.29,0.02,7.45,0,34.44,0,38.37,0,42.71,0,46.23,0,47.68,0,46.08,0,40.22,0,28.82,0,10.6]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_SIDE_R","timeline":[{"name":"B_HAIR_SIDE.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":90,"value":[-0.28,0,-4.37,0,-6.76,0,-6.74,0,-3.61,0,-6.53,-0.13,-8.92,-0.17,-10.53,-0.13,-11.14,0,-0.95,0,-10.31,0,-16.28,0,-17.43,0,-12.36,0,-16.84,-0.26,-20.23,-0.35,-22.06,-0.26,-21.88,0,-1.78,0,-16.76,0,-26.71,0,-29.55,0,-23.18,0,-28.7,-0.4,-32.56,-0.53,-34.04,-0.4,-32.46,0,-2.54,0,-22.86,0,-36.55,0,-40.84,0,-32.97,0,-39.82,-0.53,-44.42,-0.71,-45.84,-0.53,-43.12]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":90,"value":[1.66,0,5.39,0,9.21,0.02,12.86,0.03,16.08,0.03,15.06,0.23,12.01,0.67,7.24,1.12,1.11,1.32,5.71,0,11.35,0.01,17.17,0.02,22.64,0.03,27.25,0.04,26.68,0.31,22.14,0.9,14.3,1.49,3.8,1.76,10.7,0,16.19,0.01,21.94,0.02,27.17,0.03,31.14,0.03,33.22,0.23,29.25,0.67,20.22,1.11,7.13,1.32,15.22,0,18.23,0,21.56,0,24.25,0,25.36,0,33.21,0,32.34,0,24.17,0,10.15]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_MOUTH_OPEN_Y","timeline":[{"name":"D_MOUTH.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_MOUTH_FORM","timeline":[{"name":"D_MOUTH.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_MOUTH.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_MOUTH.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_MOUTH.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_MOUTH_SIZE","timeline":[{"name":"B_MOUTH.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[41.89,26.96,32.49,26.96,23.08,26.96,13.68,26.96,4.27,26.96,-5.14,26.95,-14.54,26.95,-23.95,26.95,-33.35,26.95,41.89,21.14,32.48,21.14,23.08,21.13,13.69,21.13,4.4,21.13,-4.9,21.13,-14.32,21.12,-23.83,21.12,-33.35,21.12,41.89,15.31,32.48,15.31,23.08,15.31,13.7,15.31,4.51,15.3,-4.68,15.3,-14.12,15.3,-23.73,15.3,-33.35,15.3,41.89,9.49,32.48,9.49,23.08,9.49,13.69,9.48,4.57,9.48,-4.56,9.49,-14,9.48,-23.66,9.48,-33.35,9.47,41.89,3.66,32.48,3.66,23.08,3.66,13.72,3.66,4.83,3.72,-4.05,3.77,-13.53,3.76,-23.42,3.71,-33.36,3.65,41.89,-2.16,32.48,-2.16,23.08,-2.16,13.75,-2.15,5.1,-2.05,-3.54,-1.94,-13.06,-1.96,-23.18,-2.06,-33.36,-2.17,41.88,-7.98,32.48,-7.99,23.07,-7.99,13.74,-7.98,5.18,-7.9,-3.38,-7.81,-12.91,-7.83,-23.1,-7.92,-33.36,-8,41.88,-13.81,32.48,-13.81,23.07,-13.81,13.76,-13.82,5.36,-13.84,-3.04,-13.87,-12.59,-13.87,-22.93,-13.86,-33.36,-13.82,41.88,-19.63,32.48,-19.63,23.07,-19.64,13.78,-19.65,5.56,-19.8,-2.67,-19.95,-12.24,-19.93,-22.76,-19.8,-33.36,-19.65]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-6.4,-1.4,-12.33,-4.01,-17.8,-6.41,-17.87,-7.02,-3.73,-7.02,10.4,-7.03,11.03,-6.26,8.3,-3.25,5.33,0,-6.4,1.85,-11.32,-2.04,-15.79,-5.93,-14.61,-7.94,-0.88,-8.02,11.03,-7.35,11.74,-5.49,9.48,-1.06,6.32,3.9,-6.4,4.85,-10.36,-0.22,-13.88,-5.45,-11.46,-8.81,1.88,-8.99,11.57,-7.67,12.37,-4.77,10.58,0.94,7.23,7.51,-6.22,5.74,-9.68,0.97,-12.71,-4.21,-9.95,-7.91,2.93,-8.13,11.52,-6.57,12.68,-3.63,11.27,1.93,7.56,8.43,-4.27,7.03,-7.59,6.6,-10.47,6.03,-8.8,4.61,3.2,5.06,12.73,6.53,14.7,6.81,13.27,6.82,8.53,8.43,-2.32,8.31,-5.12,12.23,-7.67,16.28,-7.03,17.14,3.2,18.27,12.83,19.65,15.87,17.24,14.74,11.68,9.51,8.43,-1.9,7.51,-3.52,11.94,-5.03,16.54,-4.65,17.78,3.18,18.05,11.01,18.31,13.75,15.93,13.27,10.96,9.48,7.66,-0.99,3.9,-1.77,6.85,-2.49,9.9,-2.07,10.68,4.24,10.42,10.55,10.16,12.03,8.91,11.38,6.36,9.03,4.66,0,0,0,1.3,0,2.5,0.46,2.75,5.33,2.11,10.21,1.46,10.43,1.4,9.52,1.4,8.53,1.4]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_FORM","timeline":[{"name":"D_BROW.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[7.51,62.86,4.31,118.99,-3.75,114.04,1.49,63.76,-6.21,14.82,0,0,0,-14.82,0.56,-5.39,1.73,10.79,8.26,77.22,-0.56,124.81,-2.25,8.08,-2.44,50.28,-0.74,105.5,0.56,122.57,-7.88,130.2,0.19,81.71,-3.38,24.24,0,1.35,-1.13,123.92,-5.82,119.88,6.01,80.82,-4.34,99.69,1.66,37.72,0,56.12,-1.69,2.69,0,0,-3.36,126.84,-1.51,113.14,-1.18,90,-1.14,53.06,-1.7,29.63,-5.07,5.38,-1.15,129.26,-0.4,111.42,3.07,86.26,4.33,56.62,-1.1,30.51,0.01,9.42,0,0,0.56,-9.43,2.04,104.97,-2.83,99.03,4.88,102.42]},{"duration":60,"tweenEasing":0,"offset":87},{"value":[21.77,-63.75,4.88,-30.53,-3.38,-56.57,7.13,-72.73,2.25,-67.35,0,-34.12,-22.52,-35.92,-3.75,-62.86,6.38,-64.65,6.38,-45.8,2.63,-51.18,-1.5,-61.96,5.26,-61.96,2.25,-54.77,0,-42.2,-0.75,-47.59,6.76,-57.47,2.25,-63.75,-0.75,-43.1,1.13,-43.1,1.13,-44,3.75,-61.06,0,-66.45,5.26,-65.55,6.76,-56.57,4.13,-47.59,1.5,-66.45,-1.67,-49.31,-1.05,-55.83,4.55,-63.24,6.13,-66.99,3.78,-64.61,0.33,-64.58,1.41,-47.04,2.43,-53.09,4.19,-50.57,5.85,-53.49,5.76,-63.17,2.4,-63.29,-2.72,-62.45,-7.44,-34.72,8.46,-50.58,9.2,-51.73,11.36,-43.28]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_FORM","timeline":[{"name":"D_BROW.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[2.37,-26.18,0.52,1.33,2.96,48.43,13.61,115.18,-5.33,90.31,0,23.56,2.37,102.09,-4.73,53.66,0.41,-16.02,1.52,9.15,0.98,84.35,4.73,98.16,0.13,57.88,-2.37,-11.78,-5.12,-7.43,1.18,75.91,9.47,112.56,3.55,83.76,-3.55,-23.56,-2.96,-9.6,3.22,20.95,0,0,2.96,81.15,3.6,109.71,2.88,82.02,6.6,105.39,3.03,2.22,0.53,29.32,1.69,26.14,2.37,5.41]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[34.32,-44.5,-1.18,-18.32,-1.18,-47.12,-1.18,-60.21,-2.37,-61.95,-14.2,-74.17,-3.16,-59.33,-13.41,-51.48,-5.92,-18.32,-11.44,-36.65,0,-58.46,-1.97,-55.84,-5.92,-50.61,2.37,-20.94,-7.1,-20.94,-1.58,-54.97,0,-54.1,-1.97,-57.59,14.2,-23.56,2.37,-18.32,-7.1,-30.54,-4.73,-23.56,-1.18,-36.65,0.79,-47.96,-8.99,-46.83,0.72,-55.97,-7.07,-26.14,-7.02,-43.55,-13.55,-46.07,-6.94,-33.22]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_Y","timeline":[{"name":"B_BROW.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_X","timeline":[{"name":"B_BROW.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_Y","timeline":[{"name":"B_BROW.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_X","timeline":[{"name":"B_BROW.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_ANGLE","timeline":[{"name":"B_BROW.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-11.34,70.86,-13.2,55.55,-15.05,40.24,-16.9,24.93,-18.75,9.63,-20.6,-5.68,-22.45,-21,-24.3,-36.33,-26.15,-51.66,-6.44,69.75,-8.3,54.43,-10.15,39.13,-12.01,23.84,-13.86,8.55,-15.71,-6.74,-17.56,-22.04,-19.41,-37.35,-21.26,-52.68,-1.54,68.67,-3.4,53.36,-5.26,38.06,-7.11,22.78,-8.96,7.52,-10.82,-7.78,-12.67,-23.08,-14.52,-38.39,-16.38,-53.72,3.36,67.64,1.5,52.32,-0.36,37.03,-2.22,21.76,-4.07,6.51,-5.92,-8.79,-7.78,-24.09,-9.63,-39.42,-11.49,-54.76,8.25,66.63,6.39,51.32,4.53,36.03,2.68,20.77,0.82,5.54,-1.03,-9.77,-2.88,-25.09,-4.74,-40.43,-6.6,-55.79,13.15,65.61,11.29,50.3,9.43,35.01,7.57,19.75,5.72,4.5,3.87,-10.8,2.02,-26.1,0.16,-41.41,-1.69,-56.75,18.04,64.63,16.18,49.32,14.32,34.03,12.47,18.75,10.61,3.49,8.76,-11.81,6.91,-27.11,5.06,-42.42,3.2,-57.76,22.92,63.72,21.06,48.41,19.21,33.1,17.36,17.81,15.51,2.51,13.66,-12.8,11.8,-28.1,9.95,-43.42,8.1,-58.76,27.79,62.91,25.94,47.58,24.09,32.25,22.25,16.91,20.4,1.59,18.55,-13.73,16.7,-29.06,14.85,-44.39,13.01,-59.73]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[34.49,-61.13,31.86,-43.02,29.24,-24.91,26.62,-6.8,24,11.31,21.38,29.42,18.76,47.52,16.14,65.61,13.53,83.7,28.7,-62.66,26.08,-44.56,23.45,-26.44,20.83,-8.32,18.21,9.82,15.59,27.94,12.96,46.05,10.34,64.16,7.72,82.25,22.92,-64.16,20.29,-46.05,17.66,-27.93,15.03,-9.79,12.41,8.36,9.79,26.48,7.17,44.6,4.54,62.71,1.92,80.79,17.12,-65.61,14.49,-47.51,11.87,-29.38,9.24,-11.23,6.62,6.93,4,25.05,1.37,43.16,-1.25,61.26,-3.88,79.33,11.33,-67.04,8.7,-48.94,6.07,-30.8,3.45,-12.65,0.82,5.54,-1.8,23.65,-4.42,41.75,-7.05,59.83,-9.68,77.88,5.54,-68.48,2.91,-50.38,0.28,-32.24,-2.35,-14.09,-4.97,4.08,-7.59,22.2,-10.21,40.32,-12.84,58.43,-15.46,76.5,-0.26,-69.88,-2.89,-51.78,-5.52,-33.65,-8.14,-15.51,-10.76,2.64,-13.38,20.76,-16.01,38.89,-18.63,57,-21.25,75.07,-6.06,-71.22,-8.69,-53.11,-11.31,-35,-13.94,-16.87,-16.56,1.25,-19.18,19.36,-21.8,37.47,-24.42,55.57,-27.04,73.65,-11.88,-72.45,-14.5,-54.35,-17.12,-36.27,-19.73,-18.19,-22.35,-0.09,-24.97,18,-27.59,36.1,-30.21,54.18,-32.82,72.26]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_ANGLE","timeline":[{"name":"B_BROW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[21.06,-45.35,19.9,-33.32,18.74,-21.29,17.58,-9.26,16.43,2.78,15.27,14.81,14.11,26.84,12.95,38.87,11.79,50.9,16.96,-46.04,15.8,-34.01,14.64,-21.98,13.48,-9.95,12.32,2.08,11.16,14.11,10,26.14,8.84,38.18,7.68,50.21,12.85,-46.74,11.69,-34.71,10.53,-22.67,9.37,-10.64,8.21,1.39,7.05,13.42,5.9,25.45,4.74,37.48,3.58,49.51,8.74,-47.43,7.58,-35.4,6.42,-23.37,5.27,-11.34,4.11,0.69,2.95,12.73,1.79,24.76,0.63,36.79,-0.53,48.82,4.64,-48.12,3.48,-36.09,2.32,-24.06,1.16,-12.03,0,0,-1.16,12.03,-2.32,24.06,-3.48,36.09,-4.64,48.12,0.53,-48.82,-0.63,-36.79,-1.79,-24.76,-2.95,-12.72,-4.11,-0.69,-5.27,11.34,-6.42,23.37,-7.58,35.4,-8.74,47.43,-3.58,-49.51,-4.74,-37.48,-5.9,-25.45,-7.05,-13.42,-8.21,-1.39,-9.37,10.64,-10.53,22.67,-11.69,34.71,-12.85,46.74,-7.68,-50.21,-8.84,-38.17,-10,-26.14,-11.16,-14.11,-12.32,-2.08,-13.48,9.95,-14.64,21.98,-15.8,34.01,-16.96,46.04,-11.79,-50.9,-12.95,-38.87,-14.11,-26.84,-15.27,-14.81,-16.43,-2.78,-17.58,9.26,-18.74,21.29,-19.9,33.32,-21.06,45.35]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-14.01,79.68,-16.75,61.4,-19.49,43.12,-22.22,24.84,-24.96,6.55,-27.7,-11.73,-30.43,-30.01,-33.17,-48.29,-35.91,-66.57,-7.77,78.05,-10.51,59.76,-13.25,41.48,-15.98,23.2,-18.72,4.92,-21.46,-13.37,-24.19,-31.65,-26.93,-49.93,-29.67,-68.21,-1.53,76.41,-4.27,58.12,-7.01,39.84,-9.74,21.56,-12.48,3.28,-15.22,-15.01,-17.95,-33.29,-20.69,-51.57,-23.43,-69.85,4.71,74.77,1.97,56.49,-0.77,38.2,-3.5,19.92,-6.24,1.64,-8.98,-16.64,-11.71,-34.93,-14.45,-53.21,-17.19,-71.49,10.95,73.13,8.21,54.85,5.47,36.56,2.74,18.28,0,0,-2.74,-18.28,-5.47,-36.56,-8.21,-54.85,-10.95,-73.13,17.19,71.49,14.45,53.21,11.71,34.93,8.98,16.64,6.24,-1.64,3.5,-19.92,0.77,-38.2,-1.97,-56.49,-4.71,-74.77,23.43,69.85,20.69,51.57,17.95,33.29,15.22,15,12.48,-3.28,9.74,-21.56,7.01,-39.84,4.27,-58.12,1.53,-76.41,29.67,68.21,26.93,49.93,24.19,31.65,21.46,13.37,18.72,-4.92,15.98,-23.2,13.25,-41.48,10.51,-59.76,7.77,-78.05,35.91,66.57,33.17,48.29,30.43,30.01,27.7,11.73,24.96,-6.56,22.22,-24.84,19.49,-43.12,16.75,-61.4,14.01,-79.68]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_Y","timeline":[{"name":"B_EYE_BALL.05","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE_BALL.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_X","timeline":[{"name":"B_EYE_BALL.05","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EYE_BALL.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_FORM","timeline":[{"name":"B_EYE_BALL.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[31.56,49.59,14.93,44.1,1.94,38.11,-4.15,31.15,-0.1,22.73,6.1,26.72,1.36,30.92,-10.32,35.85,-24.94,41.99,26.88,39.39,12.49,34.48,1.35,28.93,-3.77,22.77,-0.07,15.98,4.49,19.04,0.48,22.31,-8.92,26.09,-20.5,30.67,21.89,28.93,9.82,24.52,0.58,19.27,-3.49,13.75,-0.04,8.52,3.04,10.72,-0.16,13.23,-7.18,16.04,-15.58,19.14,17.53,18.98,7.66,15.23,0.17,10.57,-3.02,5.99,-0.01,2.49,1.28,3.67,-1.35,5.08,-6.2,6.58,-11.61,8.02,14.72,10.33,6.7,7.59,0.62,4.3,-2.1,1.43,0,0,-1.1,-0.23,-3.76,-0.78,-7.05,-1.45,-10.03,-2.07,18.53,-2.16,10.59,-3.37,3.96,-4.17,0.19,-4.68,0.83,-5.02,-0.13,-6.53,-3.61,-9.96,-8.07,-13.66,-11.99,-15.98,22.38,-16.97,14.8,-17.42,7.86,-17.39,3.29,-17.22,2.83,-17.21,1.55,-18.84,-3.15,-22.58,-9.19,-26.73,-14.51,-29.57,26.26,-32.7,19.14,-32.7,11.99,-32.51,6.75,-32.31,5.31,-32.27,3.19,-33.55,-3.16,-36.57,-11.2,-40.14,-18.38,-43.04,30.12,-47.97,23.42,-47.36,16.02,-46.68,10.03,-46.13,7.56,-45.9,4.06,-47.06,-4.42,-49.89,-14.91,-53.38,-24.39,-56.53]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[11.15,21.7,7.83,15.26,4.17,8.91,1.22,3.54,0,0,-0.14,1.29,-0.46,4.65,-0.87,9.3,-1.24,14.47,2.2,17.99,-2.81,12.86,-4.57,7.61,-3.49,3.05,0,0,1.59,0.73,2.66,2.98,3.01,6.28,2.42,10.15,-5.19,13.93,-12.34,10.2,-12.58,6.15,-7.83,2.51,0,0,3.44,0,6,0.82,7.17,2.44,6.45,4.85,-10.22,10.65,-19.98,8.22,-19.31,5.1,-11.53,2.09,0,0,5.1,-0.59,8.94,-0.93,10.74,-0.72,9.71,0.36,-12.08,9.3,-24.94,7.86,-24.12,5,-14.25,1.96,0,0,6.26,-0.77,10.88,-1.38,12.82,-1.68,11.06,-1.54,-10.76,8.28,-19.97,6.68,-18.82,3.87,-10.89,1.03,0.27,-0.68,4.93,-1.29,7.96,-1.82,8.83,-2.13,6.98,-2.05,-7.55,5.81,-13.36,4.11,-12.25,1.53,-6.67,-0.94,0.93,-2.32,3.72,-2.74,4.93,-3.11,4.48,-3.33,2.32,-3.29,-3.59,2.76,-6.15,1,-5.22,-1.29,-2.14,-3.34,1.74,-4.36,2.58,-4.56,1.85,-4.74,-0.01,-4.85,-2.57,-4.83,0,0,0.74,-1.84,1.55,-3.88,2.21,-5.52,2.48,-6.2,1.4,-6.2,-1.2,-6.2,-4.42,-6.21,-7.34,-6.21]}]},{"name":"B_EYE_BALL.09","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[17.16,61.85,11.71,55.12,5.69,48.34,0.81,41.68,-1.18,35.32,-3,41.02,-9.17,45.53,-17.08,49.57,-24.12,53.84,14,44.74,9.52,39.55,4.65,34.47,0.75,29.56,-0.83,24.84,-2.63,29.21,-8.34,32.8,-15.63,36.04,-22.17,39.35,10.51,25.84,7.12,22.27,3.47,19.15,0.6,16.22,-0.44,13.25,-2.15,16.35,-7.38,19.16,-14.03,21.73,-20,24.14,7.68,10.53,5.24,8.39,2.58,6.74,0.53,5.31,-0.13,3.86,-1.84,5.58,-6.67,7.33,-12.76,8.98,-18.25,10.36,6.52,4.23,4.59,2.97,2.45,1.59,0.71,0.46,0,0,-1.91,0.02,-6.57,0.06,-12.31,0.11,-17.51,0.16,12.45,-0.02,8.89,-0.84,5.06,-2.06,1.8,-3.04,-0.02,-3.13,-3.53,-3.35,-9.31,-3.49,-15.34,-3.6,-19.61,-3.72,21.56,-10.42,15.59,-10.53,9.26,-11.01,3.68,-11.27,-0.05,-10.72,-5.95,-11.36,-13.6,-12.05,-20.64,-12.69,-24.7,-13.16,31.94,-23.28,23.25,-22.58,14.12,-22.08,5.89,-21.38,-0.1,-20.1,-8.67,-21.22,-18.46,-22.61,-26.81,-23.93,-30.99,-24.81,41.69,-34.91,30.44,-33.46,18.66,-32.09,7.93,-30.55,-0.15,-28.59,-11.21,-30.14,-23.01,-32.17,-32.52,-34.1,-36.69,-35.35]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[-4.56,-0.09,-3.72,-0.07,-2.45,-0.04,-1.08,-0.01,0,0,0.86,-0.01,2.58,-0.02,4.64,-0.04,6.54,-0.05,-9.59,-0.18,-7.81,-0.14,-5.13,-0.09,-2.29,-0.03,0,0,1.87,-0.01,5.48,-0.04,9.8,-0.08,13.76,-0.1,-13.67,-0.26,-11.18,-0.2,-7.34,-0.12,-3.25,-0.04,0,0,2.54,-0.02,7.71,-0.06,13.92,-0.11,19.61,-0.15,-15.35,-0.29,-12.73,-0.22,-8.34,-0.13,-3.62,-0.05,0,0,2.41,-0.02,8.26,-0.06,15.48,-0.12,22.02,-0.17,-13.67,-0.26,-8.82,-0.18,-4.2,-0.09,-0.89,-0.02,0,0,2.4,0.27,7.63,0.33,14.1,0.18,20.23,-0.14,-9.59,-0.18,-3.1,-0.1,1.14,-0.02,2.42,0.02,0,0,1.69,0.57,5.53,0.73,10.46,0.51,15.41,-0.09,-4.56,-0.09,3.29,0,6.91,0.05,5.93,0.05,0,0,0.46,0.85,2.36,1.13,5.18,0.83,8.39,-0.04,0,0,9.31,0.09,12.42,0.12,9.31,0.09,0,0,-1.12,1.12,-1.5,1.5,-1.12,1.12]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_KIRAKIRA","timeline":[{"name":"D_EYE_BALL.07","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.08","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.09","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.10","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.11","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.12","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_L_OPEN","timeline":[{"name":"D_EYE.01","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[3.05,110.77,4.21,108.19,0.23,107.78,-1.27,93.36,-19.98,70.89,-20.98,38.83,2.9,99.81,-6.12,118.5,-5.37,93.04,-7.75,49.38,3.07,79.83,-6.86,100.94,-8.08,106.09,-6.38,97.55,-16.18,78.14,-11.92,103.52,-4.58,86.76,0.18,107.22,-6.49,103.27,0.68,106.42,-2.8,100.29,8.34,107.54,-6.77,104.64,-2.49,116.57,-2.7,105.53,-2.26,96.43,-15.26,82.09,-2.96,96.26,1.52,50.27,-18.3,58.32,10.76,83.7,9.73,78.46,-11.84,92.24,-11.63,80.72,-8.47,22.07,7.19,78.2,-0.37,88.04,-9.63,67.09,-21.47,52.53,-16.54,72.63,-11.74,45.11,2.1,87.11,-16.31,78.12,-4.28,104.08,-2.34,102.97,-9.56,103.09,-11.32,102.82,1.58,106.05,-11.75,105.12,-2.71,102.37,-5.56,101.84,-2.53,102.3,-7.83,98.55,-11.83,103.97,-4.64,95.78]},{"duration":40,"tweenEasing":0,"value":[1.03,103.6,7.05,138.24,1.5,140.17,-8.67,93.45,-13.43,85.07,-13.16,53,4.91,115.67,-4.12,134.37,-3.37,121.16,-9.78,69.12,1.71,87.97,-0.83,123.9,-4.05,140.01,4.55,109.08,1.73,82.17,-1.17,136.79,-3.59,100.7,2.19,141.78,-1.79,140.65,3.53,123.41,3.92,136.78,3.46,125.83,-0.05,132.11,-0.49,132.43,-1.86,139.36,-6.29,108.92,-5.84,94.9,17.89,108.91,4.63,59.44,-8.8,65.73,12.78,99.56,14.52,77.01,5.31,96.19,-5.33,94.41,-1.41,36.24,17.28,86.98,17.29,95.37,2.82,67.58,-13.9,66.71,-7.8,83.34,-5.68,53.88,2.76,99.76,-9.26,106.87,-0.93,112.22,2.86,128.18,-3.52,135.07,-2.59,141.89,4.26,139.97,-2.35,138.39,1.48,121.14,2.5,135.11,-1.87,138.15,-3.81,122.79,-1.08,140.46,-4.66,112.94]},{"duration":40,"tweenEasing":0,"offset":109},{"offset":2,"value":[-2.52,-3.37,0,0,0,0,0,0,0,0,8.07,-14.5,-1.01,-7.73,0,0,0,-13.53,0,0,-3.03,-6.77,0.64,-12.58,3.03,-3.87,0,0,-5.05,-11.6,0,-4.83,1.68,-4.83,-3.36,-6.77,-1.52,-1.44,5.34,-18.37,1.01,-4.83,5.05,-9.67,6.06,-16.43,-0.67,-5.48,5.05,-4.83,0,0,6.06,-8.7,0,0,0,0,0,0,0,0,3.03,-2.9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.02,-1.93,0,0,0.48,-3.39,-3.03,-5.79,-4.04,-5.8,-0.72,-16.12,0.67,-4.83,-3.41,-11.92,-1.52,-5.31,-3.7,-6.59,0,-8.7,-1.01,-4.83,-4.43,-9.35,-2.02,-2.9]}]},{"name":"D_EYE.03","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[49.79,123.74,8.07,118.58,-26.91,63.16,-12.28,11.76,0,0,0,0,13.46,28.36,29.6,92.8,8.07,58,-2.69,70.89,18.84,95.38,6.73,58]},{"duration":40,"tweenEasing":0,"value":[49.79,123.74,8.07,118.58,-26.91,63.16,-6.73,16.59,0,0,0,0,13.46,28.36,29.6,92.8,8.07,58,-2.69,70.89,18.84,95.38,6.73,58]},{"duration":40,"tweenEasing":0,"offset":23},{"offset":6,"value":[0.03,4.51,0.03,3.87,-2,3.23]}]},{"name":"D_EYE.05","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[2.23,-35.01,18.89,-29,14.59,-0.68,-6.66,1.12,-10.95,-20.83,3.45,-14.9]},{"duration":40,"tweenEasing":0,"offset":11},{"duration":40,"tweenEasing":0,"offset":11},{"value":[0.67,0,0.67,0,0.68,1.28,0.67,0,0.67,0,0.67]}]},{"name":"D_EYE.09","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-11.01,99.57,-20.26,94.16,-22.76,84.33,-18.26,74.46,-14.43,80.21,-11.41,91.45,-17.51,87.58]},{"duration":40,"tweenEasing":0,"value":[-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69]},{"duration":40,"tweenEasing":0,"offset":13},{"value":[4.04,-0.97,2.02,-0.97,0,-1.93,0,-4.83,0,-4.83,0,-4.83,0,-4.83]}]},{"name":"D_EYE.10","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-12.55,99.26,-19.43,94.67,-25.63,88.38,-39.41,81.98,-28.75,82.73,-17.99,92.08]},{"duration":40,"tweenEasing":0,"value":[-4.04,105.69,-2.69,110.2,-4.71,110.2,-8.75,104.4,-2.02,107.62,-4.04,106.98]},{"duration":40,"tweenEasing":0,"offset":11},{"value":[-1.35,-2.02,-2.68,-3.53,-2.95,-6.12,-1.74,-7.68,-1.24,-5.78,-1.09,-3.74]}]},{"name":"D_EYE.11","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-5.05,77.33,0,0,0,0,0,0,0,0,0,0,-1.01,48.33,9.08,141.14,-7.06,147.9,11.1,180.77,-17.16,183.67,5.05,119.87,21.19,175.94,-2.02,34.8,-11.1,109.23,0.42,51.9,0.49,59.92,0,0,-2.59,35.9,-2.55,176.91,-4.69,30.32,0,0,-2.29,35.83,0,0,8.27,157.69,-1.97,27.94,-1.11,19.06,-1.37,36.65]},{"duration":40,"tweenEasing":0,"value":[-5.05,77.33,0,0,0,0,0,0,0,0,0,0,-1.01,48.33,-3.03,141.14,-7.06,147.9,9.08,169.17,-16.15,174.97,5.05,119.87,-3.03,164.34,-2.02,34.8,-15.14,107.3,0.42,51.9,0.49,59.92,0,0,-2.59,35.9,-3.56,169.18,-4.69,30.32,0,0,-2.29,35.83,0,0,1.2,149.96,-1.97,27.94,-1.11,19.06,-1.37,36.65]},{"duration":41,"offset":55}]},{"name":"D_EYE.13","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-3.36,56.31,-25.74,47.13,-17.07,20.54,-11.86,8.62,4.88,-4.03,-4.54,20.22,-9.08,44.95,-9.5,28.76,-13.71,46.64,-4.54,8.7]},{"duration":40,"tweenEasing":0,"value":[0.58,60.48,-21.46,51.1,-13.81,30.44,-9.77,21.28,-4.05,12.34,-1.51,29.46,-1.65,50,-4.74,36.47,-9.23,53.84,-3.6,20.76]},{"duration":40,"tweenEasing":0,"offset":19},{"offset":2,"value":[0.66,-1.29,4.07,4.49,2.72,3.85,2.02,0.63,2.02,0.63,2.02,-0.01,0.67,0,0,0,0.68,0.64]}]},{"name":"D_EYE.17","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[20.45,98.49,22.43,104.67,24.76,112.64,18.51,109.93,17.1,105.8]},{"duration":40,"tweenEasing":0,"value":[15.25,134.19,17.81,144.17,20.74,157.01,11.08,152.18,9.24,145.5]},{"duration":40,"tweenEasing":0,"offset":9},{"value":[1.35,-7.09,1.35,-7.09,1.35,-7.09,1.35,-7.09,1.35,-7.09]}]},{"name":"D_EYE.18","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22]},{"duration":40,"tweenEasing":0,"value":[-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25]},{"duration":41,"offset":15}]},{"name":"D_EYE.19","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58]},{"duration":40,"tweenEasing":0,"value":[-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35]},{"duration":41,"offset":15}]},{"name":"B_EYE_BALL.08","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":1,"value":[149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84]},{"duration":41,"offset":161}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_R_OPEN","timeline":[{"name":"D_EYE.00","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-3.94,111.73,-0.37,105.09,12.83,103.17,6.96,100.08,-1.47,67.18,26.02,92,-5.31,129.22,-22.62,81.2,27.39,78.92,-4.76,42.47,-5.86,93.93,-22.9,112.58,-0.92,69.59,6.6,101.23,-8.61,106.26,17.77,97.44,10.26,87.04,-11.36,97.76,1.28,132.72,-17.77,110.34,-8.61,116.1,13.38,99.96,15.63,44.87,8.71,58.39,10.9,84.93,2.84,105.64,-4.86,109.41,-7.51,108.32,-4.21,103.09,-16.86,113.07,-30.78,106.52,12.28,101.81,15.58,98.86,24.74,108.33,-7.15,107.48,-7.02,102.94,-1.47,101.17,25.45,106.32,19.56,99.19,14.84,79.99,4.4,87.53,16.49,100.14,22.23,122.86,-5,101.67,-13.8,108.37,-18.14,118.18,-9.99,93.14,-18.44,102.67,-16,120.96,-12.38,109.96,8.73,105.07,8.61,97.56,12.28,73.2,5.18,44.82,-16.56,63.94,19.42,60.4,15.63,103.6,18.83,99.66,21.9,96.47]},{"duration":40,"tweenEasing":0,"value":[2.66,111.72,0.37,134.92,9.18,114.69,-5.88,96.7,-5.88,72.78,19.4,100.15,-0.92,156.18,-22.35,87.06,27.39,83,-4.77,46.55,-5.87,98.01,-22.91,116.66,-1.19,74.94,10.62,144.46,-2.75,144.92,13.54,109.82,3.64,95.69,-8.43,137.75,1.28,136.79,-16.68,115.94,-8.61,120.15,13.37,104.04,15.62,48.95,8.71,62.47,10.9,89.01,2.84,109.71,-4.31,110.95,-6.05,134.09,2.38,147.17,-9.53,132.74,-6.05,137.55,13.92,129.28,13.73,133.11,5.33,103.76,-0.55,147.49,-1.16,140.24,7.33,139.15,15.03,112.42,6.35,99.37,13.72,92.71,-2.22,91.44,12.27,135.41,22.23,126.94,1.6,147.78,-9.41,134.82,-18.14,122.25,-10.54,97.39,-15.7,109.8,-3.36,144.86,-5.78,143.87,9.46,141.02,8.61,101.63,12.27,77.28,5.18,48.9,-16.56,68.02,19.42,64.48,11.6,141.41,13.13,123.74,16.39,109.19]},{"duration":40,"tweenEasing":0,"offset":117},{"value":[1.47,6.78,-3.66,-8.81,1.47,1.36,0,0,-6.59,-2.03,4.47,-4.08,0,0,-8.06,-3.39,0,0,0,0,-4.03,-9.49,-8.43,-8.14,-6.6,-2.03,2.2,-11.52,-4.4,-11.86,2.2,-6.78,-3.73,-5.41,0,-6.78,0,0,-5.86,-8.81,-8.8,-2.71,0,0,0,0,-2.2,0,-1.1,0,0.37,-0.34,1.1,-3.05,-2.93,-5.42,-2.2,-8.14,-6.96,-13.22,0,0,2.2,-6.1,0.73,-7.46,1.5,4.06,-3.66,-16.27,-1.47,-7.46,1.47,-8.14,-0.03,-5.42,2.2,0,0.73,-2.71,0,0,4.4,-8.14,0,0,-1.47,-13.9,-6.23,-11.86,-4.4,-3.05,-6.23,-4.41,-1.47,-1.36,-1.47,-2.03,-7.33,-11.86,-1.47,-10.85,0,0,-2.2,1.02,0,0,0,0,0,0,5.86,-7.46,4.44,-5.43,5.94,-3.4]}]},{"name":"D_EYE.02","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[25.29,84.4,2.2,104.74,-28.23,74.19,-5.01,10.15,-10.9,-23.69,-2.2,-28.47,10.99,2.03,17.59,40.68,-6.6,19.32,-12.83,38.64]},{"duration":40,"tweenEasing":0,"value":[26.75,93.89,3.66,121.01,-38.79,94.56,-12.37,6.77,-6.43,-10.14,-0.73,-20.34,12.46,2.03,19.06,40.68,-5.13,31.52,-5.5,53.56]},{"duration":40,"tweenEasing":0,"offset":19},{"value":[-5.5,-7.12,-1.1,-13.22,-0.02,-2.03,0,0,1.13,1.01,-8.43,0.68,0,0,-5.5,-8.14,-7.7,-13.22,-3.3,-11.19]}]},{"name":"D_EYE.04","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-21.4,-14.62,-24.11,-28.65,-18.27,-44.95,-4.59,-37.7,-4.95,-20.49,-13.97,-29.3]},{"duration":40,"tweenEasing":0,"value":[-10.7,-7.31,-12.05,-14.32,-5.47,-23.15,-0.46,-15.8,-2.47,-10.25,-6.98,-14.65]},{"duration":40,"tweenEasing":0,"offset":11},{"offset":2,"value":[-1.1,3.05,0,0,0,0,0,0,0,3.05]}]},{"name":"D_EYE.06","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-2.57,85.76,24.92,65.08,-27.12,31.18,-6.96,6.1,31.88,-16.61,30.05,-18.3,7.33,70.5,27.49,124.74,20.16,181.68,0,159.99,7.33,166.09,-11.36,174.9,12.46,114.23,15.03,180.67,-0.37,79.66,5.13,75.59,-2.63,66.47,-0.55,77.91,11.15,71.54,16.68,77,-9.57,99.9]},{"duration":40,"tweenEasing":0,"value":[7.33,70.5,24.92,65.08,-27.12,31.18,-8.06,5.08,35.18,-19.66,47.64,-53.89,7.33,70.5,30.63,119.7,34.41,150.88,5.5,131.18,13.93,158.97,-7.33,184.73,12.46,114.23,13.19,173.21,8.43,90.84,11.73,91.86,1.3,65.05,-15.78,69.07,13.96,63.4,20.61,64.74,-6.21,96.27]},{"duration":41,"offset":41}]},{"name":"D_EYE.07","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[40.33,58.76,45.62,72.58,42.37,86.67,27.34,89.3,29.22,76.13,33.37,63.75,39.01,71.57,36.66,80.63]},{"duration":40,"tweenEasing":0,"value":[21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47]},{"duration":40,"tweenEasing":0,"offset":15},{"offset":1,"value":[-4.75,0,-4.75,-3.66,4.07,-0.01,-4.74,0,-4.75,0,-4.75,0,-4.75,0.73,-3.39]}]},{"name":"D_EYE.08","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[65.96,61.69,46.18,76.61,33.35,81.69,26.39,73.89,39.58,73.22,46.18,67.79,41.59,73.89,38.66,78.64,32.98,80.33,33.72,77.96,47.09,71.01,40.31,76.77,51.31,71.18,32.43,77.96,39.42,77.68]},{"duration":40,"tweenEasing":0,"value":[34.45,105.76,21.26,113.21,20.16,108.13,21.26,109.15,21.26,109.15,21.26,109.15,21.8,113.21,21.8,113.21,21.26,106.09,21.26,109.15,23.64,111.69,21.99,111.35,27.12,109.82,20.71,107.11,21.09,112.26]},{"duration":40,"tweenEasing":0,"offset":29},{"offset":1,"value":[-6.78,0,-6.78,0,-6.78,-0.02,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78]}]},{"name":"D_EYE.12","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[13.01,40.22,8.8,54.55,11.73,31.36,10.08,2.71,-8.25,-12.14,12.46,5.66,15.39,22.65,10.99,38.62,9.35,13.55,13.93,26.91,5.86,0.96,10.26,39.89]},{"duration":40,"tweenEasing":0,"value":[10.26,45.3,8.8,63.71,11.73,40.51,11.73,18.98,8.8,14.3,12.46,14.81,15.39,31.8,10.99,47.78,13.19,27.78,13.93,36.06,14.66,19.27,10.26,49.04]},{"duration":40,"tweenEasing":0,"offset":23},{"value":[-6.6,0.68,-5.86,-0.68,-3.66,0,-2.93,-7.46,-5.13,-4.75,-5.13,-5.42,-3.66,0,-2.2,0,-2.93,-3.39,-0.73,0.68,-2.2,-2.71,-5.86,-0.68]}]},{"name":"D_EYE.14","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-40.61,126.07,-31.45,102.69,-20.14,80.58,-2.5,105.34,-14.88,120.74,-16.18,104.09,-22.24,112.72,-9.74,95.17]},{"duration":40,"tweenEasing":0,"value":[-36.21,166.75,-27.05,143.36,-15.74,121.26,1.9,146.02,-10.48,161.41,-11.79,144.76,-17.84,153.39,-5.35,135.85]},{"duration":40,"tweenEasing":0,"offset":15},{"value":[-10.26,-0.68,-4.4,-6.1,-13.93,-14.24,-8.06,-14.91,-4.4,-6.1,-7.33,-11.52,-4.4,-6.1,-10.26,-13.56]}]},{"name":"D_EYE.15","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2]},{"duration":40,"tweenEasing":0,"value":[16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57]},{"duration":40,"tweenEasing":0,"offset":15},{"value":[-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08]}]},{"name":"D_EYE.16","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-1.47,17.55,9.18,24.97,12.76,34.06,-0.27,32.77,4.66,28.7]},{"duration":40,"tweenEasing":0,"value":[-1.47,17.55,9.18,24.97,12.76,34.06,-0.27,32.77,4.66,28.7]},{"duration":40,"tweenEasing":0,"offset":9},{"value":[-2.2,-2.03,-2.2,-2.03,-2.2,-2.03,-2.2,-2.03,-2.2,-2.03]}]},{"name":"B_EYE_BALL.02","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":1,"value":[127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83]},{"duration":40,"tweenEasing":0,"offset":1,"value":[127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83]},{"duration":41,"offset":161}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ANGLE_Z","timeline":[{"name":"B_FACE.02","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-9.7},{"duration":60,"tweenEasing":0},{"x":10.7}]},{"name":"B_HAIR_SIDE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.47,-0.01,-0.86,-0.01,-0.77,-0.01,-0.61,0,-0.44,0,-0.54,0,-0.3,0,0,0,0,0,-4,-0.07,-7.7,-0.13,-8.5,-0.14,-7.05,-0.04,-5.6,0.05,-4.87,0.05,-2.53,0.03,0,0,0,0,-7.51,-0.13,-14.5,-0.25,-16.24,-0.26,-13.5,-0.08,-10.77,0.09,-9.2,0.1,-4.77,0.05,0,0,-1.89,-0.03,-13.33,-0.03,-24.15,-0.04,-27.34,-0.04,-23.65,-0.09,-19.95,-0.14,-18.92,-0.14,-15.94,-0.08,-12.58,0.06,-9.28,-0.16,-20.95,0.04,-31.89,0.23,-35.17,0.2,-35.11,-0.67,-35.05,-1.55,-34.09,-1.5,-30.26,-0.97,-26.04,-0.36,-17.28,-0.29,-28.55,0.12,-38.97,0.5,-42.02,0.43,-46.19,-1.33,-50.36,-3.09,-49.45,-2.99,-44.33,-1.97,-38.79,-0.85]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":54,"value":[0.83,-0.02,0.71,-0.04,0.6,-0.04,0.53,-0.04,0.61,-0.02,0.68,-0.01,0.79,0,0.65,-0.01,0.45,-0.03,9.69,-0.28,8.62,-0.39,7.63,-0.5,7.08,-0.5,7.64,-0.29,8.19,-0.07,8.22,-0.08,6.87,-0.22,5.27,-0.37,18.54,-0.53,16.53,-0.74,14.66,-0.95,14.19,-0.96,16.97,-0.54,19.75,-0.11,19.07,-0.14,14.79,-0.42,10.09,-0.72,24.57,-0.32,20.6,-0.48,16.8,-0.79,15.98,-0.82,22.88,-0.06,29.78,0.7,28.96,0.61,22.34,0.07,15.18,-0.28,24.41,-0.92,20.93,-0.56,17.63,-0.33,17.29,-0.22,25.98,0.4,34.68,1.02,33.63,1.06,25.8,1.05,17.34,1.19,23.19,-1.64,20.63,-0.7,18.27,0.16,18.62,0.42,28.8,0.83,38.98,1.23,37.63,1.43,28.62,2.07,18.86,2.76]}]},{"name":"B_HAIR_SIDE.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-0.2,-0.01,-0.43,-0.03,-0.61,-0.04,-0.7,-0.04,-0.61,-0.04,-0.43,-0.03,-0.2,-0.01,0,0,0,0,-0.43,-0.02,-0.89,-0.05,-1.28,-0.08,-1.48,-0.09,-1.28,-0.08,-0.89,-0.05,-0.43,-0.02,0,0,0,0,-0.61,-0.03,-1.28,-0.08,-1.83,-0.11,-2.11,-0.13,-1.83,-0.11,-1.28,-0.08,-0.61,-0.03,0,0,0,0,-0.7,-0.04,-1.48,-0.09,-2.11,-0.13,-2.37,-0.14,-2.11,-0.13,-1.48,-0.09,-0.7,-0.04,0,0,-0.52,-0.03,-8.11,-0.3,-14.2,-0.66,-17.65,-0.95,-17.35,-1.06,-16,-0.87,-13.56,-0.42,-10.68,0.07,-8.01,0.43,-1.78,-0.11,-15.38,-0.58,-25.94,-1.18,-31.45,-1.67,-29.9,-1.85,-27.55,-1.56,-23.37,-0.9,-18.47,-0.13,-13.92,0.44,-3.33,-0.2,-22.22,-0.84,-36.47,-1.6,-43.15,-2.22,-39.33,-2.42,-36.54,-2.1,-31.2,-1.34,-24.84,-0.44,-18.99,0.3,-4.73,-0.28,-28.42,-1.06,-45.67,-1.88,-52.51,-2.5,-44.98,-2.68,-42.74,-2.36,-37.29,-1.59,-30.57,-0.63,-24.48,0.24]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.41,-0.03,0.85,-0.06,1.22,-0.08,1.4,-0.09,1.96,-0.13,1.51,-0.1,0.65,-0.04,0,0,0,0,0.85,-0.05,1.77,-0.12,2.55,-0.17,2.95,-0.19,4.03,-0.27,3.09,-0.2,1.34,-0.08,0,0,0,0,1.22,-0.08,2.55,-0.17,3.65,-0.24,4.2,-0.28,5.88,-0.39,4.53,-0.3,1.96,-0.12,0,0,0,0,1.4,-0.09,2.95,-0.19,4.2,-0.28,4.72,-0.31,7.19,-0.47,5.6,-0.37,2.4,-0.16,0,0,5.05,-0.33,8.29,-0.28,11.76,-0.07,14.77,0.15,16.63,0.25,16.8,0.02,12.69,-0.14,6.87,-0.19,1.91,-0.13,9.73,-0.64,14.57,-0.53,19.71,-0.23,24.23,0.09,27.17,0.24,25.05,0.04,18.45,-0.15,10.05,-0.25,2.54,-0.17,14.27,-0.94,19.71,-0.87,25.55,-0.65,30.6,-0.42,33.68,-0.31,30.02,-0.38,21.61,-0.39,11.28,-0.32,1.91,-0.13,18.88,-1.24,23.21,-1.28,28.01,-1.31,31.89,-1.34,33.48,-1.35,29.82,-1.21,20.93,-0.85,9.94,-0.4]}]},{"name":"B_HAIR_TWIN.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[1.34,-0.12,2.83,-0.26,4.03,-0.36,4.53,-0.41,4.03,-0.36,2.83,-0.26,1.34,-0.12,0,0,-2.31,-0.35,-1.25,-0.43,-0.09,-0.52,0.86,-0.58,1.28,-0.6,-0.36,-0.56,-1.19,-0.4,-1.11,-0.2,0,0,-4.73,-0.8,-3.93,-0.83,-3.06,-0.85,-2.33,-0.85,-1.96,-0.84,-4.73,-0.8,-5.2,-0.58,-3.56,-0.28,0,0,-6.93,-1.06,-6.45,-1.06,-5.93,-1.03,-5.49,-1,-5.23,-0.98,-9.13,-0.95,-9.23,-0.7,-6.02,-0.34,0,0,-8.57,-0.86,-8.57,-0.86,-8.57,-0.86,-8.57,-0.86,-8.57,-0.86,-13.59,-0.88,-13.3,-0.69,-8.5,-0.37,0,0,-14.9,-1.04,-17.51,-1.14,-20.42,-1.31,-22.71,-1.47,-23.45,-1.54,-26.1,-1.53,-23.73,-1.33,-17.53,-1.05,-8.73,-0.78,-16.25,-0.98,-22.09,-1.14,-28.55,-1.39,-33.78,-1.63,-35.92,-1.73,-36.42,-1.72,-32.22,-1.59,-24.93,-1.42,-16.16,-1.3,-15.6,-0.84,-24.69,-1.01,-34.69,-1.26,-42.86,-1.48,-46.44,-1.58,-45.1,-1.61,-39.43,-1.62,-31.42,-1.65,-23.07,-1.71,-15.95,-0.74,-27.69,-0.89,-40.66,-1.06,-51.16,-1.2,-55.49,-1.25,-52.72,-1.35,-46.02,-1.6,-37.73,-1.9,-30.23,-2.17]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.33,-0.03,0.68,-0.08,0.98,-0.11,1.13,-0.13,1.22,-0.09,1.39,-0.02,1.6,0.07,1.8,0.14,0,0,0.68,-0.07,1.42,-0.16,2.05,-0.23,2.37,-0.26,2.57,-0.2,2.94,-0.04,3.38,0.15,3.78,0.3,0,0,0.98,-0.1,2.05,-0.23,2.94,-0.33,3.38,-0.38,3.65,-0.28,4.17,-0.06,4.81,0.21,5.39,0.43,0,0,1.13,-0.13,2.37,-0.26,3.38,-0.38,3.8,-0.42,4.04,-0.32,4.64,-0.08,5.38,0.21,6.05,0.48,2.12,0.01,4.4,-0.03,6.98,-0.21,8.97,-0.4,9.5,-0.49,9.44,-0.35,8.8,-0.03,7.94,0.35,7.19,0.67,5.05,-0.34,9.06,-0.17,13.53,-0.1,17.07,-0.08,18.28,-0.08,17.54,0.06,15.31,0.39,12.48,0.79,9.95,1.13,8.3,-0.84,14.26,-0.4,20.87,0.04,26.19,0.38,28.29,0.51,26.72,0.65,22.75,0.97,17.81,1.36,13.36,1.7,11.39,-1.26,19.19,-0.59,27.82,0.16,34.8,0.77,37.68,1.01,35.36,1.15,29.71,1.47,22.75,1.86,16.44,2.22]}]},{"name":"B_HAIR_TWIN.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[3.62,0.34,7.63,0.72,10.87,1.02,12.21,1.15,10.87,1.02,7.63,0.72,3.62,0.34,0,0,0,0,0.05,-0.14,1.23,0.03,2.99,0.42,4.81,0.96,2.73,0.91,-0.03,0.99,-2.62,1.17,-4.17,1.4,0,0,-3.67,-0.62,-5.5,-0.66,-5.43,-0.18,-3.38,0.76,-6.12,0.79,-8.33,1.33,-9.4,2.12,-8.77,2.96,0,0,-7.01,-1.09,-11.45,-1.33,-12.67,-0.75,-10,0.6,-13.59,0.67,-15.4,1.53,-15.14,2.83,-12.5,4.21,0,0,-9.52,-1.58,-15.66,-2,-17.16,-1.28,-12.73,0.53,-17.54,0.51,-19.37,1.43,-18.21,2.94,-14.04,4.73,-7,-1.1,-17.3,-4.12,-26.02,-5.67,-30.71,-5.76,-28.93,-4.39,-31.31,-3.62,-30.5,-1.2,-27.03,1.65,-21.43,3.74,-10.38,-2.6,-21.3,-6.5,-32.39,-7.94,-40.06,-7.58,-40.66,-6.08,-40.99,-5.19,-37.93,-2.75,-32.57,-0.04,-26.04,1.66,-11.24,-4.34,-22.71,-8.66,-36.13,-8.99,-46.7,-7.18,-49.63,-5.09,-48.3,-4.55,-43.37,-3.16,-36.55,-1.68,-29.53,-0.86,-10.64,-6.19,-22.74,-10.57,-38.57,-9.01,-52.16,-4.98,-57.51,-1.95,-54.89,-2.08,-48.54,-2.4,-40.68,-2.8,-33.58,-3.16]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[2.16,-0.05,2.13,-0.14,2.1,-0.25,2.07,-0.35,2.05,-0.38,1.73,-0.33,1.17,-0.22,0.54,-0.1,0,0,4.56,-0.11,4.49,-0.3,4.41,-0.53,4.35,-0.73,4.32,-0.81,3.62,-0.7,2.45,-0.47,1.14,-0.2,0,0,6.49,-0.16,6.4,-0.43,6.29,-0.76,6.2,-1.04,6.15,-1.15,5.18,-1,3.51,-0.67,1.62,-0.3,0,0,7.29,-0.18,7.18,-0.51,7.05,-0.88,6.95,-1.17,6.91,-1.3,5.95,-1.13,4.04,-0.77,1.84,-0.36,0,0,15.33,0.09,16.28,-1.61,16.77,-1.97,16.86,-1.68,16.63,-1.43,15.85,-1.25,13.39,-0.87,10.32,-0.46,7.71,-0.18,20.11,0.44,22.55,-2.53,24.09,-2.64,24.81,-1.51,24.81,-0.77,24.25,-0.68,21.23,-0.5,17.28,-0.32,13.9,-0.22,23.58,0.81,27.69,-3.38,30.45,-3.14,31.98,-1.07,32.39,0.2,31.42,0.17,27.25,0.1,21.83,-0.01,17.09,-0.12,27.71,1.16,33.4,-4.27,37.3,-3.72,39.55,-0.76,40.27,1.02,37.59,0.91,31.09,0.67,23.06,0.37,15.79,0.09]}]},{"name":"B_NECK.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-9.33,-34.67,-6.96,-33.08,-4.33,-31.33,-2.21,-29.92,-1.33,-29.33,-1.04,-28.17,-0.33,-25.33,0.54,-21.83,1.33,-18.67,-6.94,-26.83,-5.15,-25.71,-3.18,-24.47,-1.59,-23.44,-0.94,-22.94,-0.49,-22.18,0.56,-20.14,1.77,-17.58,2.71,-15.27,-4.5,-19.33,-3.31,-18.57,-1.99,-17.75,-0.94,-17.01,-0.5,-16.5,0,-15.83,1.16,-14.23,2.49,-12.26,3.49,-10.46,-2.15,-11.17,-1.55,-10.95,-0.89,-10.74,-0.36,-10.49,-0.15,-10.15,0.3,-9.56,1.35,-8.41,2.57,-7.03,3.52,-5.75,0,-1.33,0,-2.13,0,-3,0,-3.71,0,-4,0.29,-3.85,1,-3.5,1.88,-3.06,2.67,-2.67,0,-1.19,0.18,-1.14,0.56,-1.09,0.95,-1.05,1.13,-1,1.32,-0.77,1.81,-0.06,2.45,0.83,3.08,1.63,0,-0.83,0.16,0,0.5,0.92,0.84,1.67,1,2,1.17,2.43,1.58,3.58,2.13,5.03,2.67,6.33,0,-0.4,0.06,1.2,0.19,2.97,0.32,4.4,0.38,5,0.54,5.66,0.94,7.31,1.44,9.36,1.92,11.21,0,0,0,2.38,0,5,0,7.12,0,8,0.15,8.88,0.5,11,0.94,13.62,1.33,16]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[10.67,20,7.9,20,4.83,20,2.35,20,1.33,20,0.9,20.58,-0.17,22,-1.48,23.75,-2.67,25.33,9.88,16.83,7.24,16.4,4.37,15.92,2.07,15.54,1.13,15.42,0.4,16.11,-1.34,17.44,-3.43,19.03,-5.23,20.48,9,13.33,6.52,12.5,3.91,11.58,1.84,10.87,1,10.67,-0.08,11.66,-2.64,13.08,-5.68,14.66,-8.17,16.17,8.29,10.5,5.93,9.2,3.45,7.75,1.5,6.61,0.71,6.25,-0.59,7.2,-3.67,8.34,-7.33,9.57,-10.35,10.77,8,9.33,5.63,7.35,3,5.17,0.88,3.4,0,2.67,-1.17,2.67,-4,2.67,-7.5,2.67,-10.67,2.67,11.56,2.32,8.49,1.89,4.81,1.22,1.73,0.97,0.44,1.79,-0.68,1.84,-3.37,1.67,-6.6,1.41,-9.35,1.21,13.83,-1.91,10.4,-1.8,6.33,-1.92,2.93,-1.64,1.5,-0.33,0.62,-0.46,-1.5,-1,-4.03,-1.71,-6.17,-2.33,15.19,-2.85,11.63,-3.15,7.56,-3.65,4.2,-3.77,2.81,-2.96,2.24,-3.34,0.88,-4.33,-0.78,-5.58,-2.23,-6.71,16,0,12.44,-1.58,8.5,-3.33,5.31,-4.75,4,-5.33,3.71,-5.92,3,-7.33,2.13,-9.08,1.33,-10.67]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_TERE","timeline":[{"name":"D_HOHO.00","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_HOHO.00","type":22,"frame":[{"duration":120,"tweenEasing":0,"offset":6,"value":[-4.6,0,-3.68,-1.57,0,0,0,0,0,0,0,0,-3.68]},{"offset":6,"value":[3.07,0,2.45,1.05,0,0,0,0,0,0,0,0,2.45]}]},{"name":"D_HOHO.01","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_HOHO.01","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[2.42,4.92,0,3.94]},{"value":[-1.61,-3.28,0,-2.63]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_DONYORI","timeline":[{"name":"D_FACESHADOW.01","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_FACESHADOW.01","type":22,"frame":[{"duration":120,"tweenEasing":0,"offset":47},{"value":[-10.07,35.25,-15.69,12.95,6.38,26.71,22.77,159.17,-14.6,94.19,-9.86,161.55,-1.89,47.22,-11.86,61.32,-24.28,90.28,8.14,53.36,4.08,83.23,-6.75,40.11,3.24,34.51,-14.04,75.34,-7.4,55.02,-7.14,28.35,6.95,74.36,4.19,50.93,3.09,22.19,-4.95,89.08,11.9,121.61,-12.84,75.47,-4.23,96.95,-1.88,86.44]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_FRONT","timeline":[{"name":"B_FACESHADOW.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.13,0,-0.25,0,-0.14,0,-0.46,0,-0.79,0,0.34,0,0.82,0,-0.23,0,0,0,-1.15,0,-2.21,0,-2.68,0,-5.47,0,-8.26,0,-3.41,0,-0.23,0,-3.3,0,0,0,-2.16,0,-4.16,0,-5.32,0,-10.83,0,-16.34,0,-8.38,0.01,-3.31,0.01,-9.17,0,-0.36,-1,-3.6,-0.69,-6.54,-0.16,-7.61,0.01,-12.83,0.13,-18.04,0.25,-10.69,0.26,-6.43,0.22,-13.65,0.13,-1.77,-0.63,-7.89,-0.43,-13.51,-0.1,-15.08,0.06,-17.77,0.64,-20.47,1.23,-12.81,1.22,-7.48,0.96,-12.87,0.65,-3.3,0,-12.48,0,-20.96,0,-23.13,0.1,-23.13,1.19,-23.13,2.28,-14.92,2.26,-8.24,1.76,-11.56,1.2]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[1.37,0,2.64,0,2.88,0,1.53,0,0.18,0,0,0,0,0,0,0,0,0,2.65,0,5.12,0,5.55,0,2.94,0,0.33,0,0,0,0,0,0,0,0.5,0,3.87,-0.08,7.02,-0.1,7.55,-0.1,4.31,-0.05,1.07,0,0.74,0,0.4,0,0,0,5.78,0,8.93,-0.55,11.87,-1.06,12.47,-1.14,10.12,-0.6,7.77,-0.05,6.62,0,3.44,0,0,0,11.07,0,13.46,-1.03,15.66,-2.02,16.16,-2.18,15.23,-1.14,14.29,-0.1,12.48,0,6.47,0,0,0,13.01,0,10.36,-1.01,12.58,-1.93,16.42,-2.04,15.87,-1.19,15.32,-0.34,13.64,-0.25,7.1,-0.17,0,0,18.66,0,7.33,-0.67,8.4,-1.12,16.5,-1.11,16.58,-1.19,16.66,-1.27,14.87,-1.15,7.73,-0.62,0,0,24.78,0,4.73,-0.29,4.44,-0.23,16.59,-0.1,17.34,-1.19,18.1,-2.28,16.18,-2.12,8.41,-1.1]}]},{"name":"B_HAIR_FRONT.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":18,"value":[-0.14,0,-0.4,0,-0.68,0,-0.92,0,-1.03,0,-1.02,0,-0.98,0,-0.94,0,-0.9,0,-0.29,0,-0.83,0,-1.42,0,-1.92,0,-2.18,0,-2.14,0,-2.06,0,-1.97,0,-1.89,0.01,-0.41,0,-1.19,0,-2.04,0,-2.74,0,-3.1,0,-3.05,0,-2.94,0,-2.81,0.01,-2.69,0.01,-0.46,0,-1.36,0,-2.35,0,-3.15,0,-3.48,0,-3.43,0,-3.31,0.01,-3.16,0.01,-3.02,0.01,-2.95,0,-4.2,0,-5.62,0,-6.71,0,-6.97,0.01,-7.23,0.01,-7.21,0.01,-7.08,0.01,-7.01,0.02,-5.82,0,-7.78,0,-9.99,0,-11.71,0.01,-12.25,0.01,-12.22,0.01,-11.71,0.01,-11,0.01,-10.39,0.01,-8.84,-0.01,-11.65,0,-14.78,0.01,-17.28,0.01,-18.25,0.01,-17.77,0.01,-16.61,0.01,-15.17,0.01,-13.86,0.01,-11.79,-0.01,-15.38,0,-19.35,0.01,-22.56,0.01,-23.88,0.02,-23.26,0.02,-21.73,0.02,-19.84,0.02,-18.14,0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.28,0.04,0.59,0.12,0.84,0.2,0.91,0.24,0.84,0.2,0.59,0.12,0.28,0.04,0,0,0,0,0.52,0.1,1.12,0.32,1.57,0.55,1.68,0.65,1.57,0.55,1.12,0.32,0.52,0.1,0,0,0,0,0.84,0.11,1.78,0.36,2.51,0.61,2.72,0.73,2.52,0.61,1.78,0.36,0.84,0.11,0,0,0,0,1.33,0,2.8,0,3.98,0,4.47,0,3.98,0,2.8,0,1.33,0,0,0,1.61,0,3.85,0,6.26,0,8.34,0,9.58,-0.01,8.36,-0.01,6.11,-0.05,3.45,-0.1,0.99,-0.19,5.52,0,7.93,0,10.52,0,12.74,-0.01,13.99,-0.01,12.58,-0.07,9.8,-0.23,6.46,-0.43,3.4,-0.66,10.35,0.01,12.62,0,15.1,0,17.15,-0.01,18.12,-0.01,16.74,-0.14,13.63,-0.46,9.83,-0.86,6.37,-1.23,14.72,0.01,17,0,19.51,0,21.55,-0.01,22.39,-0.01,20.93,-0.2,17.39,-0.67,13.02,-1.23,9.06,-1.75]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ANGLE_Y","timeline":[{"name":"B_FACESHADOW.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_FACE.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.05","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.06","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_MOUTH.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NOSE.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_FRONT.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_SIDE.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.07","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.16","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.17","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.18","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.19","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.20","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.21","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.11","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.08","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.09","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.11","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.12","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.13","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.14","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.05","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.06","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.07","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.08","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.09","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_BACK.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_BACK.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NECK.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ANGLE_X","timeline":[{"name":"D_REF.MOUTH","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[6.11,-40.48,6.11,-40.48,6.11,-40.48,6.11,-40.48]},{"duration":30,"tweenEasing":0,"value":[6.11,-40.48,6.11,-40.48,6.11,-40.48,6.11,-40.48]},{"duration":30,"tweenEasing":0,"offset":7},{"value":[3.87,49.92,3.87,49.92,3.87,49.92,3.87,49.92]}]},{"name":"B_FACESHADOW.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HOHO.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HOHO.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_FACE.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EYE.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EYE.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_BROW.05","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_BROW.06","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_MOUTH.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_NOSE.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_NOSE.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_NOSE.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EAR.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EAR.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_FRONT.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_SIDE.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_SIDE.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_SIDE.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_SIDE.01","type":23,"frame":[{"duration":90,"value":540},{"duration":30,"value":540},{"value":490}]},{"name":"D_HAIR_SIDE.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":119},{"duration":30,"tweenEasing":0,"offset":119},{"duration":30,"tweenEasing":0,"offset":6,"value":[7.05,-0.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19.12,0.05,13.67,0.02,7.08,0.94,0,0,0,0,0,0,19.41,-1.36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10.51,0.48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21.2,0.49,12.29,-0.44]},{"offset":26,"value":[13.68,0.89,0,0,0,0,0,0,0,0,0,0,28.36,2.69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13.67,0.89,0,0,7.65,-0.01,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7.44,0.43,0,0,0,0,0,0,7.78,0.44,32.44,-0.02]}]},{"name":"B_HAIR_TWIN.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.07","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.16","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.17","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.18","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.19","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.20","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.21","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.11","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.12","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[20.33,-1.95,3.06,-0.53,1.05,-0.55,1.07,-0.55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.31,0.06,7.97,1.83,0,0,0,0,0,0,0,0,4.55,0.07]},{"duration":91,"offset":47}]},{"name":"D_HAIR_TWIN.14","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[16.02,-3.03,6.29,-2.59,2.3,0.56,2.34,0.67,15.57,-1.54,16.14,0.1,6.09,0.55,0,0,1.43,2.53,0,0,0,0,-1.2,-1.03,-7.25,-1.57,-3.65,-0.54,-6.01,-0.04,8.63,-0.59,12.95,-2.67,-5.77,0.51]},{"duration":30,"tweenEasing":0,"value":[22.54,-2.54,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12.43,-0.43]},{"duration":30,"tweenEasing":0,"offset":37},{"duration":30,"tweenEasing":0,"offset":10,"value":[4.66,-0.98,3.79,-0.27,0,0,0,0,0,0,0,0,0,0,-2.52,-0.74,-7.77,-0.35,-4.74,0.39,0,0,0,0,-5.74,-0.09]},{"offset":10,"value":[9.32,-1.97,7.58,-0.55,0,0,0,0,0,0,0,0,0,0,-5.04,-1.47,-15.54,-0.7,-9.49,0.77,0,0,0,0,-11.48,-0.18]}]},{"name":"D_HAIR_TWIN.15","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[34.23,-2.89,19.05,0.38,13.14,-1.55,5.27,0.71,0,0,-10.6,-0.03,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-8.91,0.67,0,0,7.85,-3.72,8.26,-5.59,12.58,0.37,0,0,-4.67,1.36,0,0,0,0,7.58,-1.02,2.77,-0.92]},{"duration":30,"tweenEasing":0,"value":[9.77,-3.59,4.86,-1.61,3.13,-2.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12.84,-4.08]},{"duration":30,"tweenEasing":0,"offset":61},{"duration":30,"tweenEasing":0,"value":[-3.24,0.61,-3.12,0.18,-2.12,-0.05,-0.57,-0.07,1.59,-0.04,3.88,0.08,5.56,0.15,7.22,0.02,8.16,-0.16,7.89,-0.54,8.59,-0.02,8.53,0.3,7.16,0.63,5.75,0.66,4.36,0.55,2.09,0.3,-0.49,0.31,-2.07,0.59,-2.23,0.31,0.7,0.11,3.32,0.23,5.18,0.38,6.54,0.36,-1.54,0.11,-0.55,0.11,1.87,0.13,4.58,0.25,6.16,0.37,7.79,0.21,7.11,0.27,8.36,0.01]},{"value":[-6.49,1.23,-6.24,0.36,-4.24,-0.1,-1.14,-0.14,3.19,-0.08,-4.22,-0.62,3.87,0.25,14.43,0.03,16.32,-0.31,15.78,-1.08,17.19,-0.05,17.05,0.6,14.33,1.27,11.5,1.31,-0.8,1.17,4.18,0.61,-0.98,0.61,-4.13,1.18,-4.45,0.62,1.41,0.22,6.64,0.45,0.76,0.64,13.08,0.72,-3.07,0.23,-1.11,0.22,3.74,0.26,5.34,0.46,10.57,0.71,15.57,0.41,14.21,0.55,16.73,0.03]}]},{"name":"B_HAIR_TWIN.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.08","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.09","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.11","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.12","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.13","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.14","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.05","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.06","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.07","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.08","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.09","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_BACK.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_BACK.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_NECK.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_NECK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[1.69,21.02,0,0,-25.39,-23.35,-23.69,-32.69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.77,-1.17]},{"duration":60,"tweenEasing":0,"offset":27},{"value":[5.08,-19.85,10.15,-17.51,0,0,-8.46,19.85,5.08,0,5.08,0,0,0,0,0,0,0,0,0,5.08,-1.17,0,0,0,0,5.08,-2.34]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BODY_Z","timeline":[{"name":"D_REF.BODY","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BODY.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-8.92,2.89,-15.78,3.25,-19.9,3.46,-18.53,5.77,-17.16,8.08,-14.07,8.37,-10.98,8.66,-6.86,5.41,0,0,-5.92,3.25,-12.01,4.04,-15.7,4.55,-15.14,6.85,-14.58,9.16,-14.71,9.09,-14.84,9.02,-9.19,5.64,0,0,-4.12,3.46,-9.27,4.55,-12.35,5.2,-12.7,7.5,-13.04,9.81,-15.1,9.52,-17.16,9.24,-10.72,5.77,0,0,-2.4,7.79,-6.31,7.9,-9.27,7.79,-10.55,7.72,-10.81,7.65,-13.13,7.29,-15.44,6.93,-9.65,4.33,0,0,-0.69,12.12,-3.35,11.26,-6.18,10.39,-7.89,7.5,-7.55,4.62,-10.64,4.62,-13.73,4.62,-8.58,2.89,0,0,-0.34,10.68,-1.8,8.02,-3.6,6.06,-4.72,4.51,-4.8,2.96,-9.44,2.63,-14.07,2.31,-8.79,1.44,0,0,0,9.24,1.29,5.63,2.06,3.46,1.03,1.73,0,0,-7.21,0,-14.41,0,-9.01,0,0,0,0,5.77,0.77,3.61,1.29,2.16,0.64,1.08,0,0,-4.5,0,-9.01,0,-5.42]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":2,"value":[2.14,3.25,3.43,5.2,5.83,7.22,8.24,9.24,7.21,5.48,6.18,1.73,3.86,1.08,0,0,4.29,6.49,7.21,8.23,9.01,9.16,10.55,9.2,12.1,9.24,9.65,5.16,7.21,1.08,4.5,0.87,0,0,6.86,10.39,10.29,11.11,12.35,11.54,12.35,10.39,12.35,9.24,10.29,6.35,8.24,3.46,5.15,2.16,0,0,3.43,4.91,9.72,7.29,12.01,8.66,10.72,7.65,9.44,7.5,8.7,8.29,7.21,7.79,4.5,4.87,0,0,0,-0.58,9.14,3.47,11.67,5.77,8.58,4.91,5.49,5.77,6.61,10.25,6.18,12.12,3.86,7.58,0,0,-0.34,-0.58,7.23,0.65,10.29,1.37,6.52,1.7,2.75,2.89,3.32,6.21,3.13,8.23,1.95,4.87,0,0,-0.69,-0.58,5.32,-2.38,8.92,-3.46,4.46,-1.73,0,0,0,0,0,0,0,0,0,0,-0.43,-0.36,3.18,-1.45,5.58,-2.16,2.79,-1.08]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BODY_Y","timeline":[{"name":"D_REF.BODY","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.13","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BODY.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":19,"value":[3.57,0,5.17,0,6.24,-0.17,8.62,-0.34,10.99,0.08,8.84,0.51,6.69,0.3,4.01,0,0,0,5.71,0,8.38,0,9.98,-0.27,13.79,-0.54,17.59,0.14,14.14,0.81,10.7,0.51,6.69,0,0,-0.87,8.61,-1.74,12.44,0.2,14.96,1.44,17.82,-0.57,20.41,-0.09,17.98,2.7,14.5,2.68,8.39,0,0,-1.74,11.52,-3.8,17.09,-0.27,21.16,2.03,19.4,-2.16,17.12,-1.11,16.62,4.59,14.03,4.84,7.94,0,0,-0.87,5.76,1.4,12.12,5.11,16.76,3.28,18.98,-1.49,18.54,-1.35,17.92,0.29,14.6,1.38,8.38,0,0,0,0,5.59,7.93,8.46,13.96,3.57,19.4,-0.81,19.97,-0.15,16.44,-1.08,9.51,-0.68,5.94,0,0,0,0,3.33,4.84,5.29,8.73,2.27,11.81,-0.51,12.48,-0.19,10.06,-0.68,5.94,-0.41,3.57]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[8.1,-0.71,6.08,-1.6,4.86,-2.14,2.43,-1.07,0,0,0.41,1.07,0.81,2.14,0.51,1.34,0,0,6.58,-1.16,4.56,-2.45,3.44,-3.48,1.46,-2.53,-0.52,-1.06,-1.22,-1.95,-1.92,-1.78,-1.17,-0.8,0,0,5.67,-1.43,3.14,-1.87,1.62,-2.14,0.41,-4.46,-0.81,-5.71,-2.43,-4.28,-4.05,-0.71,-2.53,-0.45,0,0,4.46,-1.78,1.85,-4.95,0.69,-8.12,0.44,-7.94,-0.41,-7.49,-1.3,-7.12,-2.79,-5.7,-1.6,-3.39,0,0,3.24,-2.14,-0.1,-3.83,-1.62,-5.71,-0.2,-7.22,0,-9.27,1.01,-8.56,0.81,-7.84,0.51,-4.9,0,0,3.24,-3.21,0.3,-4.5,-1.22,-5.71,-2.08,-6.99,0,-7.13,3.03,-7.68,1.22,-6.06,0.76,-3.79,0,0,3.24,-4.28,0.71,-5.17,-0.81,-5.71,-3.96,-6.76,0,-4.99,5.05,-6.8,1.62,-4.28,1.01,-2.67,0,0,2.03,-2.67,0.51,-3.21,-0.51,-3.57,-2.03,-4.05,0,-3.12,2.63,-3.98,1.01,-2.67,0.61,-1.6]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_R_02","timeline":[{"name":"B_CLOTHES.38","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.39","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.63","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.62","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.17","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.16","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.17","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_R_01","timeline":[{"name":"B_CLOTHES.38","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.39","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.63","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.62","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAND.17","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.16","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.17","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_R","timeline":[{"name":"B_CLOTHES.17","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":56,"value":[-0.21,0.09,-0.38,0.11,-0.36,0.11,-0.16,0.06,0.04,0.01,0,0,0,0,0,0,0,0,-1.76,0.63,-3.39,1.21,-3.64,1.3,-1.9,0.68,-0.16,0.06,0,0,0,0,0,0,0,0,-3.32,1.17,-6.41,2.31,-6.92,2.49,-3.64,1.3,-0.37,0.11,0,0,0,0,0,0,0,0,-4.15,1.06,-7.95,2.14,-8.48,2.32,-4.36,1.21,-0.25,0.1,0,0,0,0,0,0,0,0,-6.12,0.55,-11.75,1.11,-12.59,1.2,-6.53,0.63,-0.48,0.05,0,0,0,0,0,0,0,0,-8.22,0,-15.82,0,-17,0,-8.88,0,-0.76]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":56,"value":[0.04,-1.33,0.05,-3.48,0.06,-3.93,0.02,-2.06,-0.01,-0.18,0,0,0,0,0,0,0,0,0.32,-3.34,0.5,-8.58,0.64,-9.69,0.31,-5.06,-0.02,-0.43,0,0,0,0,0,0,0,0,0.56,-2.06,1.04,-4.94,1.17,-5.52,0.6,-2.88,0.04,-0.25,0,0,0,0,0,0,0,0,0.23,-0.71,0.47,-1.43,0.54,-1.54,0.32,-0.81,0.1,-0.07,0,0,0,0,0,0,0,0,-0.87,-0.37,-1.66,-0.74,-1.77,-0.8,-0.9,-0.42,-0.03,-0.04,0,0,0,0,0,0,0,0,-2.06,0,-3.96,0,-4.25,0,-2.22,0,-0.19]},{"offset":56,"value":[-0.1,0,-0.19,0,-0.18,0,-0.08,0,0.02,0,0,0,0,0,0,0,0,0,-0.88,0,-1.7,0,-1.82,0,-0.95,0,-0.08,0,0,0,0,0,0,0,0,0,-1.66,0,-3.2,0,-3.46,0,-1.82,0,-0.18,0,0,0,0,0,0,0,0,0,-1.8,0,-3.46,0,-3.72,0,-1.94,0,-0.15,0,0,0,0,0,0,0,0,0,-1.92,0,-3.7,0,-3.98,0,-2.07,0,-0.17,0,0,0,0,0,0,0,0,0,-2.06,0,-3.96,0,-4.25,0,-2.22,0,-0.19]}]},{"name":"B_CLOTHES.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.07","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.30","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":2,"value":[-2.63,-0.81,-5.07,-1.55,-6.04,-1.72,-9.77,-1.48,-13.5,-1.23,-12.34,-1.08,-6.41,-0.56,0,0,0,0,-1.76,-1.02,-3.37,-1.98,-4.14,-2.17,-8.36,-1.53,-12.58,-0.88,-11.6,-0.73,-6.03,-0.39,0,0,0,0,-0.94,-1.22,-1.79,-2.38,-2.39,-2.58,-7.06,-1.57,-11.74,-0.56,-10.91,-0.42,-5.67,-0.23,0,0,0,0,-1.56,-1.55,-1.95,-2.74,-1.84,-2.88,-6.55,-1.88,-11.25,-0.87,-10.35,-0.73,-5.48,-0.53,-0.24,-0.24,0,0,-3.98,-2.76,-3.43,-4.7,-0.79,-4.95,-4.59,-5.01,-8.4,-5.08,-8.1,-4.84,-5.53,-3.87,-2.76,-2.82,0,0,-6.4,-3.98,-4.93,-6.66,0.26,-7.01,-2.64,-8.15,-5.55,-9.29,-5.87,-8.94,-5.6,-7.2,-5.28,-5.41,3.98,-2.62,-0.06,-6.73,2.32,-10.72,6.85,-11.54,2.17,-12.44,-2.51,-13.33,-2.37,-12.68,-3.99,-10.21,-5.9,-8.68,19.55,-12.85,21.78,-14.13,26.95,-15.52,29.54,-15.9,18.98,-17.46,8.41,-19.02,6.37,-19.11,-0.15,-19.26,-7.38,-20.52,36.39,-23.92,45.19,-21.99,53.31,-20.2,53.8,-19.84,36.82,-20.83,19.84,-21.82,15.26,-23.16,3.62,-28.05,-8.98,-33.33]},{"offset":2,"value":[-2.63,-0.81,-5.07,-1.55,-6.04,-1.72,-9.77,-1.48,-13.5,-1.23,-12.34,-1.08,-6.41,-0.56,0,0,0.66,-1.79,-0.51,-3.26,-1.57,-4.68,-2.14,-5.03,-6.18,-4.88,-10.23,-4.73,-9.54,-4.17,-4.96,-2.08,0,0,1.28,-3.45,1.48,-5.54,1.69,-7.57,1.47,-8.09,-2.87,-8.03,-7.21,-7.96,-6.93,-7.03,-3.62,-3.52,0,0,1.74,-4.96,1.43,-6.99,2.02,-8.99,1.79,-9.11,-2.08,-9.23,-5.95,-9.36,-5.71,-8.42,-2.86,-4.87,0.21,-1.44,4.8,-17.13,-0.57,-15.97,-2.32,-13.73,-3.06,-11.6,-2.71,-13.51,-2.36,-15.42,-1.85,-15.73,0.23,-16.23,2.39,-16.77,7.14,-32.01,-2.92,-26.81,-6.96,-18.89,-7.92,-14.08,-3.34,-17.78,1.23,-21.49,2.06,-23.03,3.27,-27.59,4.58,-32.1,17.26,-41.44,8.9,-32.87,5.6,-20.21,5.71,-14.53,6.19,-20.32,4.9,-26.21,4.39,-27.64,4.64,-30.91,4.84,-34.73,47.07,-46.41,42.8,-38.29,41.11,-27.12,40.69,-23.16,29.56,-28.98,14.2,-35.04,9.58,-36.07,7.42,-37.42,5.04,-39.37,78.78,-50.8,76.06,-46.86,73.55,-43.21,71.1,-42.24,50.24,-41.92,22.67,-41.98,14.51,-42.47,10.06,-43.39,5.25,-44.4]}]},{"name":"B_CLOTHES.26","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"value":[-8.72,-7.08,-8.3,-6.32,-4.77,-2.84,0,0,0,0,0,0,0,0,0,0,0,0,-6.2,-12.92,-10.34,-10.24,-5.98,-4.9,0.01,-0.73,0.01,-0.38,0,-0.03,0,0,0,0,0,0,-3.88,-18.32,-12.49,-13.85,-7.26,-6.85,0.02,-1.4,0.01,-0.73,0,-0.06,0,0,0,0,0,0,-2.82,-19.95,-12.82,-14.37,-7.31,-7.31,0.05,-1.1,0.03,-0.57,0,-0.05,0,0,0,0,0,0,2.04,-22.57,-4.94,-13.61,-3.06,-3.55,0.35,3.96,0.19,2.07,0.03,0.18,0,0,0,0,0,0,6.9,-25.2,2.91,-12.86,1.09,0.2,0.66,9.02,0.35,4.71,0.03,0.4,0,0,0,0,0,0,6.55,-22.66,4.25,-11.44,1.94,0.98,0.61,8.46,0.32,4.42,0.03,0.38,0,0,0,0,0,0,3.4,-11.78,2.15,-5.97,1.1,0.58,0.31,4.39,0.17,2.3,0.02,0.2]},{"value":[-8.72,-7.08,-8.3,-6.32,-4.77,-2.84,0,0,0,0,0,0,0,0,0,0,0,0,-16.65,-20.84,-19.08,-16.28,-11.15,-7.73,0.01,-0.73,0.01,-0.38,0,-0.03,0,0,0,0,0,0,-23.97,-33.55,-29.55,-25.51,-17.54,-12.44,0.02,-1.4,0.01,-0.73,0,-0.06,0,0,0,0,0,0,-25.38,-36.62,-32.04,-27.23,-19.16,-13.77,-0.55,-1.33,-0.25,-0.69,0.06,-0.06,0,0,0,0,0,0,-20.37,-34.65,-23.71,-23.43,-16.16,-9.79,-5.76,1.32,-3.01,0.69,-0.26,0.06,0,0,0,0,0,0,-15.36,-32.68,-15.56,-19.66,-13.31,-5.83,-10.98,3.97,-5.77,2.07,-0.57,0.18,0,0,0,0,0,0,-13.26,-28.94,-11.78,-17.1,-10.56,-4.12,-10.16,3.76,-5.37,1.96,-0.59,0.17,0,0,0,0,0,0,-6.89,-15.04,-6.19,-8.92,-5.42,-2.07,-5.26,1.95,-2.79,1.02,-0.32,0.09]}]},{"name":"B_CLOTHES.31","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.32","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.29","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-1.28,10.56,-1.32,10.52,-1.38,10.46,-1.38,10.46,-1.36,10.45,-2.04,10.6,-1.31,10.46,-5.12,14.73,-1.32,10.5]},{"duration":40,"tweenEasing":0,"offset":17},{"duration":40,"tweenEasing":0,"value":[4.89,4.92,4.4,5.05,5.47,5.72,5.42,4.99,4.61,3.94,4.29,4.25,-1.23,7.09,7.64,-10.76,4.08,4.61]},{"value":[2.78,6.9,0,0,0,0,0,0,0,0,0,0,-0.19,13.1,11.45,0.85]}]},{"name":"D_CLOTHES.11","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-0.97,-2.71,6.74,9.58,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.27,5.57,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,6.74,23.64,6.08,9.34,-1.94]},{"duration":40,"tweenEasing":0,"offset":71},{"duration":40,"tweenEasing":0,"value":[-7.95,1.7,5.38,-18.2,-22.24,-15.56,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-16.33,-18.63,-1.94,0,-1.91,3.91,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.66,0.23,4.75,-18.46,-19.76,-16.85]},{"value":[-4.41,-7.61,10.53,-18.48,-22.24,-15.56,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-16.33,-18.63,-1.94,0,-1.91,3.91,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,2.44,6.18,9.6,-9.87,-19.76,-16.85]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_L","timeline":[{"name":"B_CLOTHES.15","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":60,"value":[-0.03,0,0.13,0.02,0.28,0.04,0.3,0.04,0.16,0.03,0,0,0,0,0,0,0,0,0.13,0.02,1.48,0.23,2.84,0.44,2.64,0.41,1.37,0.21,0,0,0,0,0,0,0,0,0.28,0.04,2.84,0.44,5.39,0.85,4.99,0.78,2.58,0.4,0,0,0,0,0,0,0,0,0.3,0.04,2.64,0.41,4.99,0.79,4.59,0.73,2.37,0.36,0,0,0,0,0,0,0,0,0.16,0.02,1.37,0.21,2.58,0.41,2.37,0.38,1.22,0.19]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":24,"value":[0.04,-0.31,0.46,-3.58,0.88,-6.85,0.91,-7.09,0.86,-6.84,0.81,-6.59,0,0,0,0,0,0,0.1,-0.59,0.89,-6.89,1.68,-13.18,1.75,-13.64,1.65,-13.16,1.55,-12.68,0,0,0,0,0,0,0.11,-0.64,0.89,-7.4,1.67,-14.16,1.73,-14.67,1.7,-14.15,1.67,-13.62,0,0,0,0,0,0,-0.04,-0.33,-0.25,-3.87,-0.46,-7.4,-0.35,-7.66,0.24,-7.4,0.87,-7.12,0,0,0,0,0,0,-0.17,-0.03,-1.39,-0.33,-2.62,-0.64,-2.44,-0.66,-1.23,-0.65,0.07,-0.61,0,0,0,0,0,0,-0.15,0,-1.34,0,-2.52,0,-2.32,0,-1.2,0,0,0,0,0,0,0,0,0,-0.08,0,-0.69,0,-1.31,0,-1.2,0,-0.62]},{"offset":24,"value":[0.04,-0.31,0.46,-3.58,0.88,-6.85,0.91,-7.09,0.86,-6.84,0.81,-6.59,0,0,0,0,0,0,0.1,-0.59,0.89,-6.89,1.68,-13.18,1.75,-13.64,1.65,-13.16,1.55,-12.68,0,0,0,0,0,0,0.12,-0.64,0.87,-7.45,1.62,-14.25,1.68,-14.75,1.67,-14.22,1.67,-13.62,0,0,0,0,0,0,-0.06,-0.38,-0.5,-4.39,-0.94,-8.41,-0.8,-8.6,0,-7.89,0.87,-7.12,0,0,0,0,0,0,-0.21,-0.12,-1.87,-1.34,-3.53,-2.57,-3.28,-2.45,-1.66,-1.56,0.07,-0.61,0,0,0,0,0,0,-0.2,-0.08,-1.78,-0.94,-3.36,-1.8,-3.1,-1.66,-1.6,-0.83,0,0,0,0,0,0,0,0,-0.11,-0.04,-0.93,-0.49,-1.74,-0.93,-1.6,-0.86,-0.83,-0.43]}]},{"name":"B_CLOTHES.01","type":50,"frame":[{"duration":80,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"offset":2,"value":[-13.65,-1.45,-26.26,-2.78,-28.21,-2.99,-14.74,-1.56,-1.27,-0.13,0,0,0,0,0,0,0,0,-12.75,-6.97,-24.42,-13.99,-26.29,-15.15,-13.71,-7.92,-1.13,-0.68,0.08,-0.29,0.34,-1.36,0.61,-2.41,0,0,-11.87,-12.24,-22.87,-24.39,-24.44,-26.4,-12.75,-13.79,-1.07,-1.19,0.16,-0.54,0.65,-2.6,1.18,-4.64,0,0,-11.04,-13.4,-21.36,-26.29,-23.06,-28.35,-12.24,-14.76,-1.42,-1.18,-0.09,-0.47,0.44,-2.73,1,-5.23,0,0,-7.37,-9.01,-14.03,-17.37,-15.31,-18.62,-9.34,-9.16,-3.37,0.3,-2.78,0.46,-2.61,-2.37,-2.42,-5.44,0,0,-3.63,-4.63,-6.83,-8.45,-7.56,-8.89,-6.44,-3.56,-5.32,1.77,-5.47,1.39,-5.66,-2.01,-5.84,-5.64,0,0,-2.67,-3.3,-5.17,-6.63,-5.9,-7.1,-5.49,-2.7,-5.08,1.7,-5.09,1.28,-5.29,-1.9,-5.49,-5.04,0,0,-1.38,-1.7,-2.67,-3.44,-3.07,-3.69,-2.85,-1.4,-2.64,0.88,-2.65,0.66,-2.75,-1,-2.85,-2.62]}]},{"name":"B_CLOTHES.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.05","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":6,"value":[1.82,1.4,9,3.36,14.45,3.5,13.29,3.09,6.91,1.61,0,0,0,0,0,0,0,0,0.96,0.85,4.96,1.94,7.89,1.89,7.31,1.68,3.83,0.91,0,0,0,0,0,0,0,0,0.18,0.33,1.2,0.59,1.78,0.41,1.74,0.36,0.94,0.25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.01,-0.04,0.02,-0.43,0.05,-0.83,0.03,-0.94,-0.01,-1.4,-0.11,-2.38,0,0,0,0,0,0,0,-0.18,0.11,-2.13,0.21,-4.08,0.12,-5.02,-0.16,-8.09,-0.54,-11.71,0,0,0,0,0,0,0.02,-0.34,0.2,-3.97,0.38,-7.6,0.24,-9.46,-0.35,-15.38,-1,-21.79]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":6,"value":[-0.4,-0.06,-4.71,-0.75,-9.01,-1.44,-8.38,-1.34,-4.36,-0.7,0,0,0,0,0,0,0,0,-0.13,-0.03,-2.53,-0.41,-4.92,-0.78,-3.32,-0.74,2.91,-0.44,9.63,-0.08,0,0,0,0,0,0,0.07,-0.01,-0.51,-0.08,-1.1,-0.16,1.32,-0.17,9.6,-0.19,18.52,-0.16,0,0,0,0,0,0,-0.1,0,0.43,-0.05,0.96,-0.1,3.25,-0.12,11.7,-0.17,20.8,-0.18,0,0,0,0,0,0,0.43,-0.05,5.05,-0.6,9.67,-1.14,11.27,-1.08,15.85,-0.65,20.8,-0.18,0,0,0,0,0,0,0.95,-0.1,9.67,-1.14,18.39,-2.18,19.27,-2.04,19.98,-1.12,20.8,-0.18,1.21,-3.67,-0.3,-3.4,-1.59,-3.28,-1.32,-3.37,2.46,-4.61,6.24,-5.85,8.57,-5.67,11.8,-4.62,15,-3.86,5.96,-18,-0.15,-17.02,-5.72,-16.2,-7.54,-16.04,-10.49,-16.46,-13.44,-16.87,-12.21,-17.03,-9.89,-17.53,-7.67,-18.23,11.1,-33.51,0.13,-31.79,-10.01,-30.2,-13.27,-29.78,-20.3,-29.68,-27.33,-29.59,-28.45,-30.04,-30.25,-31.84,-32.2,-33.79]},{"offset":2,"value":[-7.69,2.46,-14.79,4.72,-16.79,5.35,-18.74,5.79,-20.7,6.23,-18.6,5.58,-9.67,2.9,0,0,0,0,-4.62,0.36,-8.81,0.47,-9.44,0.35,-8.02,-1.04,-6.61,-2.43,-4.72,-2.16,2.21,-0.81,9.63,-0.08,0,0,-1.72,-1.63,-3.22,-3.48,-2.68,-4.24,1.92,-7.1,6.51,-9.95,8.23,-8.89,13.16,-4.11,18.52,-0.16,0.19,-0.98,-0.47,-2.97,-1.08,-5.04,0.18,-5.77,8.99,-7.65,17.81,-9.52,18.52,-8.66,19.4,-4.62,20.56,-0.31,2.16,-11.39,2.26,-11.05,2.38,-10.74,4.14,-10.76,13.83,-11.87,23.53,-12.98,23.06,-11.78,20.47,-6.79,18,-1.65,4.14,-21.8,5.01,-19.12,5.83,-16.43,6.74,-15.76,12.78,-16.13,18.82,-16.5,18.72,-15.02,17.11,-9.17,15.44,-3,11.24,-26.01,8.89,-23.05,6.68,-20.3,4.7,-19.75,4.29,-21.34,5.33,-22.92,6.33,-21.29,5.33,-14.68,4.06,-8.67,17.13,-39.12,10.96,-36.23,5.23,-33.56,0.29,-32.89,-7.88,-32.95,-12.41,-32.98,-13.42,-32.23,-18.66,-29.53,-24.55,-27.42,22.42,-53.32,12.57,-50.51,3.46,-47.9,-4.25,-47.08,-20.08,-45.14,-30.02,-43.16,-33.44,-43.48,-43.67,-45.43,-54.75,-47.55]}]},{"name":"B_CLOTHES.07","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.36","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.37","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":28,"value":[-0.05,-0.02,-0.15,-0.07,-0.27,-0.13,-0.38,-0.18,0,0,0,0,0,0,0,0,0,0,-0.11,-0.04,-0.32,-0.15,-0.57,-0.27,-0.8,-0.37,0,0,0,0,0,0,0,0,0,0,-0.15,-0.06,-0.45,-0.21,-0.81,-0.39,-1.14,-0.53,0,0,0,0,0,0,0,0,0,0,-0.14,-0.07,-0.48,-0.22,-0.9,-0.42,-1.28,-0.6,0,0,0,0,0,0,0,0,0,0,-0.15,-0.06,-0.45,-0.21,-0.81,-0.39,-1.14,-0.53,0,0,0,0,0,0,0,0,0,0,-0.11,-0.04,-0.32,-0.15,-0.57,-0.27,-0.8,-0.37,0,0,0,0,0,0,0,0,0,0,-0.05,-0.02,-0.15,-0.07,-0.27,-0.13,-0.38,-0.18]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"value":[-8.96,-6.49,-9.64,-5.53,-10.38,-4.46,-10.99,-3.6,-11.24,-3.25,-15.44,2.2,-19.9,5.14,-24.46,7.07,-28.98,9.5,-8.96,-6.49,-9.44,-5.79,-9.98,-5.05,-10.4,-4.45,-10.56,-4.21,-14.02,-0.12,-18.09,2.14,-22.44,3.7,-26.71,5.69,-8.96,-6.49,-9.23,-6.07,-9.53,-5.68,-9.76,-5.39,-9.81,-5.27,-12.48,-2.56,-16.13,-1.09,-20.22,-0.02,-24.21,1.47,-8.96,-6.49,-9.05,-6.32,-9.16,-6.21,-9.22,-6.15,-9.21,-6.14,-11.12,-4.72,-14.47,-3.83,-18.44,-3.04,-22.18,-1.94,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.32,-6.15,-13.61,-5.31,-17.67,-4.28,-21.35,-3.34,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.38,-6.21,-13.54,-5.57,-17.42,-4.9,-20.96,-4.54,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.29,-6.54,-13.19,-6.69,-16.74,-6.98,-20.03,-7.45,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.11,-6.97,-12.71,-8.14,-15.92,-9.63,-18.87,-11.05,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-9.93,-7.35,-12.29,-9.42,-15.19,-11.98,-17.83,-14.3]},{"value":[-11.56,-10.47,-14.89,-8.57,-18.62,-6.54,-21.72,-5.07,-23.12,-4.87,-24.09,-4.1,-26.42,-2.24,-29.28,0.05,-31.86,2.09,-11.81,-10.29,-14.39,-8.89,-17.24,-7.38,-19.62,-6.31,-20.76,-6.23,-21.37,-5.63,-22.96,-4.11,-24.94,-2.18,-26.75,-0.33,-12.01,-10.26,-13.85,-9.32,-15.85,-8.26,-17.53,-7.53,-18.41,-7.55,-18.61,-7.16,-19.42,-6.12,-20.48,-4.67,-21.47,-3.08,-12.19,-10.31,-13.23,-9.87,-14.32,-9.36,-15.25,-9.04,-15.8,-9.2,-15.74,-8.87,-15.92,-7.97,-16.22,-6.67,-16.5,-5.19,-12.34,-10.42,-12.45,-10.58,-12.51,-10.83,-12.57,-11.16,-12.66,-11.56,-12.64,-10.94,-12.56,-9.37,-12.45,-7.44,-12.36,-5.72,-11.98,-10.66,-12.03,-10.8,-12.05,-11.03,-12.06,-11.33,-12.09,-11.61,-12.06,-11.02,-12.19,-9.73,-12.43,-8.4,-12.72,-7.7,-11.68,-10.82,-11.7,-10.93,-11.69,-11.16,-11.69,-11.41,-11.69,-11.59,-11.98,-11.55,-12.67,-11.66,-13.59,-12.06,-14.59,-12.88,-11.43,-10.92,-11.43,-11,-11.43,-11.19,-11.42,-11.38,-11.42,-11.44,-12.1,-12.18,-13.52,-14.18,-15.3,-16.8,-17.08,-19.35,-11.23,-10.97,-11.24,-11,-11.24,-11.12,-11.24,-11.21,-11.24,-11.15,-12.11,-12.57,-14.25,-16.3,-16.88,-20.98,-19.27,-25.22]}]},{"name":"B_HAND.01","type":50,"frame":[{"duration":80,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"value":[-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.91,-11.37,-4.03,-6.74,-3.44,-3.66,-3.81,-1.92,-4.25,1.33,-7.06,4.03,-9.76,4.24,-7.77,2.39,-4.77,-0.4,-4.99,-17.96,-3.52,-10.24,-2.64,-5.62,-3.22,-3.14,-3.93,2.37,-8.45,7.22,-12.75,7.03,-9.76,4.24,-4.77,-0.4,-4.54,-17.24,-3.81,-13.39,-3.36,-11.07,-3.5,-7.8,-3.79,-0.99,-10.94,6.66,-17.24,11.37,-13.22,9.69,-6.52,6.87,-4.09,-16.53,-4.09,-16.53,-4.09,-16.53,-3.79,-12.46,-3.65,-4.35,-13.43,6.13,-21.74,15.72,-16.68,15.13,-8.26,14.15,-4.63,-3.76,-1.51,-6.87,0.37,-8.74,-2.02,-7.5,-4.24,-1.7,-13.69,5.26,-22.07,12.32,-16.62,15.05,-7.42,16.92,-5.17,9.01,1.08,2.79,4.83,-0.94,-0.25,-2.55,-4.83,0.95,-13.96,4.4,-22.41,8.92,-16.56,14.97,-6.58,19.69,-5.02,5.48,2.25,3.06,6.53,1.22,1.24,0.35,-3.8,2.04,-12.37,5.04,-20.6,8.56,-15.08,11.22,-5.9,12.15,-4.77,-0.4,4.07,2.87,9.38,4.83,3.65,4.35,-2.08,3.87,-9.83,5.92,-17.58,7.97,-12.78,4.83,-4.77,-0.4]}]},{"name":"B_HAND.08","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.13","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.31","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.32","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BODY_X","timeline":[{"name":"B_CLOTHES.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[5.62,2.75,0.27,3.52,-4.67,4.15,-6.14,3.37,-8.28,1.47,-10.42,0.11,-10.62,0,-10.62,0,-10.62,0,2.91,-2.69,-2.12,-0.65,-6.76,1.39,-9.13,1.68,-10.79,0.59,-10.85,0.04,-10.84,0.07,-10.76,0.04,-10.62,0,0.21,-7.87,-4.53,-4.61,-8.97,-1.27,-12.21,0.04,-13.36,-0.26,-11.3,-0.04,-11.07,0.14,-10.9,0.09,-10.62,0,-1.98,-10.04,-6.96,-6.35,-11.68,-2.61,-15.64,-0.69,-16.26,-0.6,-12.22,-0.02,-11.44,0.21,-11.11,0.14,-10.62,0,-3.63,-9.21,-9.12,-6.3,-14.27,-3.4,-18.36,-1.42,-19.71,-0.62,-15.55,0.51,-13.64,0.67,-12.23,0.36,-10.62,0,-4.89,-8.21,-10.96,-6.13,-16.62,-4.16,-20.94,-2.14,-23.28,-0.63,-19.35,1.05,-16.3,1.13,-13.58,0.58,-10.62,0,-5.84,-8.53,-12.23,-6.51,-18.19,-4.31,-21.95,-2.29,-24.24,-0.77,-21.43,0.75,-18.58,0.8,-15,0.36,-11.13,0,-5.74,-7.83,-13.25,-6.39,-20.25,-4.82,-23.81,-3.31,-25.31,-1.91,-23.75,-0.69,-21.71,-0.52,-17.58,-0.31,-13.14,0,-5.47,-6.95,-14.2,-6.18,-22.4,-5.38,-25.86,-4.42,-26.49,-3.15,-26.14,-2.25,-24.9,-1.93,-20.29,-1.01,-15.31]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[11.87,0,9.7,0,7.7,0,7.1,0,6.25,0,5.39,0,5.11,0,4.3,0,3.44,0,11.87,0,11.25,0,10.69,0,11.46,-0.01,11.91,-0.09,9.96,-0.17,8.42,-0.16,6.44,-0.1,4.3,0,11.87,0,12.7,0,13.5,0,15.58,-0.02,17.4,-0.2,14.46,-0.39,11.69,-0.37,8.53,-0.22,5.11,0,11.87,0,13.25,0.03,14.51,0.04,17.24,0,20.43,-0.4,17.34,-0.79,13.88,-0.74,9.82,-0.37,5.43,0,11.87,0,13.82,0.2,15.63,0.39,18.39,0.4,21.72,0,19.25,-0.4,15.9,-0.39,11.49,-0.2,6.72,0,11.87,0,14.4,0.37,16.74,0.74,19.54,0.79,23.01,0.4,21.15,0,17.92,-0.04,13.15,-0.03,8,0,11.87,0,14.59,0.34,17.09,0.68,20.18,0.76,24.2,0.44,22.01,0.06,18.43,0,13.67,0,8.53,0,11.87,0,14.95,0.17,17.79,0.35,21.62,0.44,26.61,0.34,23.81,0.08,19.69,0,15.1,0,10.13,0,11.87,0,15.34,0,18.55,0,23.14,0.09,29.12,0.22,25.71,0.09,21.05,0,16.64,0,11.87]}]},{"name":"B_CLOTHES.11","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-2.34,-0.43,-3.32,-0.43,-4.39,-0.43,-5.26,-0.43,-5.62,-0.43,-5.88,-0.43,-6.5,-0.43,-7.27,-0.43,-7.97,-0.43,-3.26,-0.56,-4.31,-0.55,-5.48,-0.53,-6.42,-0.51,-6.82,-0.5,-7.16,-0.5,-7.91,-0.48,-8.81,-0.46,-9.63,-0.43,-4.16,-0.71,-5.3,-0.68,-6.56,-0.62,-7.58,-0.57,-8.02,-0.54,-8.5,-0.54,-9.41,-0.52,-10.49,-0.48,-11.48,-0.43,-5.09,-0.82,-6.3,-0.79,-7.64,-0.73,-8.73,-0.67,-9.2,-0.64,-9.73,-0.62,-10.72,-0.58,-11.89,-0.51,-12.97,-0.43,-6.09,-0.87,-7.34,-0.87,-8.73,-0.87,-9.85,-0.87,-10.31,-0.87,-10.67,-0.82,-11.54,-0.71,-12.61,-0.56,-13.59,-0.43,-7.05,-1.24,-8.65,-1.18,-10.41,-1.11,-11.86,-1.04,-12.56,-1,-12.77,-0.96,-13.48,-0.85,-14.39,-0.72,-15.2,-0.62,-8.38,-1.19,-10.17,-1.11,-12.14,-1.01,-13.76,-0.91,-14.52,-0.87,-14.73,-0.84,-15.43,-0.76,-16.31,-0.67,-17.1,-0.6,-9.85,-0.99,-11.77,-0.89,-13.89,-0.77,-15.62,-0.67,-16.37,-0.62,-16.64,-0.61,-17.38,-0.57,-18.3,-0.53,-19.12,-0.5,-11.24,-0.87,-13.33,-0.74,-15.64,-0.6,-17.5,-0.48,-18.27,-0.43,-18.58,-0.43,-19.33,-0.43,-20.25,-0.43,-21.08,-0.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-5,0,-3.51,0,-1.87,0,-0.55,0,0,0,0,0,0,0,0,0,0,0,-3.78,0,-2.04,0,-0.11,0,1.44,0,2.07,0,2.27,0,2.55,0,2.86,0,3.15,0,-2.58,0,-0.6,0,1.6,0,3.36,0,4.06,0,4.57,0,5.23,0,5.95,0,6.64,0,-1.34,0,0.91,0,3.41,0,5.41,0,6.21,0,6.81,0,7.65,0,8.58,0,9.46,0,0,0,2.6,0,5.47,0,7.79,0,8.75,0,8.95,0,9.45,0,10.06,0,10.62,0,2.28,0.24,4.9,0.17,7.77,0,10.13,-0.17,11.22,-0.24,11.05,-0.21,11.06,-0.12,11.13,-0.04,11.17,0,5.15,0.22,7.51,0.15,10.09,0,12.22,-0.15,13.2,-0.22,12.98,-0.18,12.81,-0.11,12.66,-0.03,12.49,0,8.26,0.08,10.24,0.06,12.43,0,14.21,-0.06,14.98,-0.08,14.84,-0.07,14.62,-0.04,14.37,-0.01,14.13,0,11.24,0,12.91,0,14.76,0,16.25,0,16.87,0,16.73,0,16.4,0,15.99,0,15.62]}]},{"name":"B_CLOTHES.12","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-9.37,-0.58,-9.37,-0.58,-9.37,-0.58,-9.37,-0.58,-9.37,-0.58,-8.82,-0.71,-7.5,-1.01,-5.86,-1.39,-4.37,-1.74,-10.07,-0.58,-10.02,-0.59,-9.98,-0.62,-9.93,-0.65,-9.89,-0.66,-9.32,-0.8,-7.9,-1.12,-6.15,-1.53,-4.56,-1.91,-10.83,-0.58,-10.72,-0.61,-10.6,-0.69,-10.48,-0.76,-10.37,-0.8,-9.78,-0.93,-8.29,-1.27,-6.44,-1.69,-4.76,-2.1,-11.46,-0.58,-11.33,-0.62,-11.19,-0.7,-11.06,-0.79,-10.93,-0.82,-10.31,-0.97,-8.71,-1.34,-6.72,-1.81,-4.93,-2.25,-11.71,-0.58,-11.71,-0.58,-11.71,-0.58,-11.71,-0.58,-11.71,-0.58,-10.98,-0.77,-9.2,-1.23,-6.99,-1.8,-5,-2.32,-13.21,-0.58,-13.15,-0.58,-13.08,-0.58,-13.01,-0.58,-12.97,-0.58,-12.05,-0.76,-10.07,-1.19,-7.67,-1.7,-5.48,-2.13,-14.35,-0.58,-14.25,-0.58,-14.14,-0.58,-14.05,-0.58,-14,-0.58,-13.11,-0.71,-11.16,-1.01,-8.79,-1.37,-6.64,-1.67,-15.34,-0.58,-15.22,-0.58,-15.1,-0.58,-14.99,-0.58,-14.94,-0.58,-14.16,-0.64,-12.34,-0.78,-10.1,-0.95,-8.07,-1.1,-16.4,-0.58,-16.26,-0.58,-16.11,-0.58,-15.98,-0.58,-15.93,-0.58,-15.21,-0.58,-13.47,-0.58,-11.32,-0.58,-9.37,-0.58]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[6.25,1.16,4.95,0.47,3.51,-0.29,2.35,-0.91,1.87,-1.16,1.27,-1.66,0.47,-2.24,-0.41,-2.87,-1.25,-3.48,7.55,0.81,6.18,0.24,4.71,-0.37,3.46,-0.88,2.8,-1.16,2.16,-1.68,1.16,-2.46,0.01,-3.35,-1.06,-4.16,8.98,0.43,7.55,-0.02,6.02,-0.47,4.68,-0.87,3.83,-1.16,3.13,-1.71,1.91,-2.72,0.47,-3.89,-0.86,-4.92,10.14,0.13,8.65,-0.22,7.09,-0.53,5.68,-0.84,4.66,-1.16,3.95,-1.72,2.54,-2.9,0.85,-4.31,-0.69,-5.54,10.62,0,9.13,-0.26,7.57,-0.51,6.14,-0.79,5,-1.16,4.38,-1.67,2.89,-2.9,1.04,-4.42,-0.62,-5.79,11.68,0.06,10.33,-0.15,8.89,-0.33,7.61,-0.52,6.73,-0.79,5.79,-1.31,3.86,-2.55,1.55,-4,-0.56,-5.16,12.26,0.22,10.94,0.02,9.52,-0.14,8.3,-0.31,7.57,-0.51,6.56,-0.89,4.46,-1.78,1.93,-2.82,-0.39,-3.62,12.64,0.41,11.32,0.22,9.89,0.04,8.69,-0.13,8.07,-0.26,7.11,-0.44,4.93,-0.85,2.25,-1.33,-0.19,-1.72,13.12,0.58,11.82,0.41,10.39,0.22,9.22,0.06,8.75,0,7.79,0,5.47,0,2.6]}]},{"name":"B_CLOTHES.14","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-5.3,-0.54,-6.13,-0.76,-6.87,-1.02,-6.8,-1.04,-4.97,-0.55,-3.14,-0.05,-2.73,0.47,-2,0.59,-1.25,0,-9.04,-1.03,-10.8,-1.45,-12.4,-1.92,-12.31,-1.96,-8.61,-1.03,-4.91,-0.09,-4.12,0.95,-2.71,1.18,-1.25,0,-9.97,-1.16,-13.39,-1.5,-16.55,-1.85,-17.01,-1.87,-11.84,-0.73,-5.71,0.49,-4.36,1.61,-2.85,1.55,-1.25,0,-9.68,-1.16,-14.66,-1.09,-19.27,-1.04,-20.8,-1.07,-16.37,-0.33,-8.07,0.75,-5.22,1.42,-3.33,1.06,-1.25,0,-9.4,-1.16,-15.87,-0.69,-21.85,-0.22,-24.67,-0.3,-22.07,-0.46,-12.84,-0.03,-8.23,0.33,-4.89,0.26,-1.25,0,-8.96,-0.78,-16.32,0.28,-23.31,1.72,-26.71,1.77,-20.82,-0.22,-9.21,-1.71,-4.56,-1.43,-2.48,-0.57,-0.29,0,-7.36,0.71,-12.9,2.09,-18.21,4.14,-19.81,4.36,-7.96,1.32,6.81,-1.47,9.23,-1.42,6.47,-0.63,3.45,0,-5.62,2.32,-7.36,2.59,-8.96,2.83,-7.89,2.72,7.89,0.87,23.66,-0.98,23.21,-1.03,15.67,-0.54,7.5]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-17.34,-4.24,-11.63,-3.65,-6.35,-3.1,-6.95,-2.92,-9.38,-2.61,-8.02,-2.57,-7.93,-2.62,-11.47,-2.2,-15.32,-1.75,-6.71,-2.28,-3.25,-2.03,-0.08,-1.88,-1.72,-1.82,-6.27,-1.54,-6.18,-1.42,-5.1,-1.02,-6.95,0.71,-8.98,1.96,3.49,-0.46,4.88,-0.51,6.12,-0.68,3.54,-0.72,-3.09,-0.5,-4.24,-0.36,-2.34,0.34,-2.68,2.86,-3.08,4.59,8.12,0,9.63,0,11.02,0,8.86,0,1.41,-0.05,-0.7,-0.09,0.72,0.02,-0.32,0.45,-1.44,0.9,8.12,0,12.04,0,15.69,0,15.18,-0.01,8.88,-0.16,5.64,-0.3,5.13,-0.27,1.12,-0.09,-3.17,0.11,8.12,0,13.95,0,19.36,0,20.14,-0.02,14.91,-0.28,10.45,-0.53,8.38,-0.58,1.98,-0.64,-4.89,-0.69,8.12,0,14.44,0.08,20.28,0.21,21.43,0.21,15.58,-0.19,9.73,-0.6,7.47,-0.65,1.36,-0.69,-5.2,-0.69,8.12,0,14.48,0.05,20.37,0.13,21.24,0.11,13.08,-0.35,4.91,-0.8,3,-0.8,-1.24,-0.62,-5.79,-0.4,8.12,0,14.48,0,20.36,0,20.87,-0.05,10.31,-0.54,-0.26,-1.03,-1.81,-0.97,-4.03,-0.54,-6.42,-0.08]}]},{"name":"B_CLOTHES.18","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[9.37,-4.06,8.21,-2.98,7.15,-1.99,11.31,-1.31,19.76,-0.14,18.28,0.53,14.72,0.52,13.65,0.27,12.49,0,8.79,-3.25,6.35,-2.76,4.08,-2.37,6,-1.96,9.21,-0.8,6.2,0.05,3.73,0.13,2.72,0.12,1.62,0,8.26,-2.51,4.61,-2.57,1.22,-2.72,0.94,-2.57,-1.13,-1.35,-5.69,-0.25,-7.09,-0.1,-8.06,0.04,-9.12,0,7.83,-2.39,3.6,-2.57,-0.3,-2.79,-1.79,-2.7,-7.42,-1.15,-13.04,0.41,-13.9,0.49,-14.68,0.25,-15.48,0,4.69,-3.19,0.62,-2.78,-3.09,-2.41,-4.45,-2.21,-10.82,-1.01,-17.18,0.18,-17.52,0.26,-15.87,0.13,-14.06,0,1.54,-3.98,-2.83,-2.99,-6.83,-2.04,-8.39,-1.71,-15.4,-0.88,-22.41,-0.05,-21.95,0.02,-17.47,0.02,-12.63,0,0.84,-3.61,-2.7,-2.75,-5.99,-1.85,-7.75,-1.54,-15.32,-0.81,-22.89,-0.07,-22.36,0,-17.55,0,-12.36,0,-0.76,-1.88,-1.6,-1.56,-2.38,-1.21,-3.47,-1.07,-11.81,-0.56,-20.14,-0.05,-19.95,0,-16.04,0,-11.82,0,-2.5,0,-0.76,-0.27,0.84,-0.52,0.42,-0.55,-8.43,-0.29,-17.28,-0.02,-17.37,0,-14.43,0,-11.24]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.32,-0.01,3.5,-0.02,3.68,-0.02,4.64,-0.01,5.6,0,5.37,0,4.28,0,3.12,0,3.12,0,3.5,-0.01,3.85,-0.03,4.19,-0.03,6.04,-0.02,7.9,0,7.46,0,5.37,0,3.12,0,3.12,0,4.02,-0.16,4.87,-0.36,5.46,-0.4,8.08,-0.22,10.69,-0.04,9.9,-0.02,6.77,-0.02,3.42,-0.02,3.12,0,4.24,-0.56,5.3,-1.29,6.31,-1.45,11.43,-0.89,16.55,-0.34,15.61,-0.29,11.23,-0.29,6.56,-0.29,3.12,0,3.94,-0.65,4.69,-1.37,5.66,-1.53,12.91,-1.06,20.16,-0.6,19.59,-0.55,14.83,-0.55,9.7,-0.55,2.34,-0.24,3.02,-0.57,3.69,-0.74,4.8,-0.76,11.9,-0.64,19,-0.51,18.23,-0.5,13.88,-0.51,9.24,-0.52,-0.73,0.05,-1.42,-0.14,-2.04,-0.16,-1.31,-0.15,5.43,-0.19,12.16,-0.22,11.82,-0.23,9.13,-0.25,6.3,-0.27,-4.06,0.42,-6.23,0.09,-8.23,-0.21,-8.24,-0.28,-2.81,-0.15,2.61,-0.01,3.12,0,3.12,0,3.12]}]},{"name":"B_CLOTHES.34","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[23.74,0,6.1,0,-10.2,0,-13.91,0,-9.06,0,-4.2,0,-3.75,0,-3.75,0,-3.75,0,22,0,5.62,0.23,-9.49,0.47,-14.54,0.51,-12.86,0.26,-6.26,0.02,-3.75,0,-3.75,0,-3.75,0,20.4,0,5.21,0.46,-8.79,0.91,-15.24,0.98,-16.7,0.51,-8.32,0.04,-3.75,0,-3.75,0,-3.75,0,20.48,0.17,5.54,0.61,-8.27,1.01,-15.95,1.08,-19.07,0.6,-9.5,0.07,-3.26,-0.05,-3.13,-0.06,-3.75,0,22.02,0.22,6.55,0.4,-7.77,0.52,-15.29,0.62,-17.57,0.5,-8.69,0.12,-1.78,-0.18,-1.29,-0.23,-3.75,0,23.03,0.02,7.19,0.02,-7.46,0,-14.63,0.17,-16.07,0.4,-7.88,0.18,-0.31,-0.32,0.55,-0.4,-3.75,0,23.59,0.05,7.38,0.03,-7.58,0.01,-13.58,0.16,-13.58,0.35,-6.73,0.15,-0.8,-0.27,-0.06,-0.34,-3.75,0,25.46,0.31,8.41,0.3,-7.32,0.28,-12.25,0.35,-10.54,0.32,-5.4,0.09,-2.27,-0.14,-1.91,-0.17,-3.75,0,27.49,0.58,9.56,0.58,-7.01,0.58,-10.92,0.55,-7.5,0.29,-4.07,0.02,-3.75,0,-3.75,0,-3.75]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[3.12,0,5.29,0,7.3,0,8.09,0,11.09,0,14.09,0,10.75,-0.19,-3.42,-0.93,-18.74,-1.74,3.12,0,5,0.04,6.73,0.1,9.51,0.11,14.54,0.16,14.04,0.25,8.52,0.14,-5.4,-0.36,-20.48,-0.93,3.12,0,4.69,0.06,6.14,0.15,10.9,0.17,18.02,0.3,14.12,0.48,6.46,0.45,-7.24,0.16,-22.08,-0.19,3.12,0,3.67,-0.05,5.06,-0.04,12,-0.01,20.97,0.2,14.9,0.48,5.72,0.46,-7.89,0.22,-22.62,-0.03,3.12,0,1.54,-0.21,3.6,-0.17,12.46,-0.02,20.7,-0.06,13.47,-0.05,4.06,-0.07,-9.45,-0.19,-24.06,-0.32,3.12,0,-0.61,-0.37,2.13,-0.29,12.92,-0.03,20.41,-0.31,12.05,-0.58,2.4,-0.6,-11,-0.6,-25.5,-0.62,3.12,0,-0.8,-0.36,0.93,-0.3,9.56,-0.09,15.59,-0.48,9.61,-0.87,1.5,-0.87,-11.57,-0.73,-25.7,-0.64,3.12,0,-0.39,-0.3,-0.97,-0.39,3.1,-0.31,7.25,-0.55,5.39,-0.79,-0.08,-0.79,-12.52,-0.69,-25.96,-0.62,3.12,0,-0.06,-0.25,-3,-0.49,-3.54,-0.55,-1.24,-0.6,1.06,-0.65,-1.74,-0.65,-13.51,-0.63,-26.25,-0.61]}]},{"name":"B_CLOTHES.19","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91]}]},{"name":"B_CLOTHES.21","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[2.81,6.52,2.39,4.96,1.93,3.37,1.56,1.83,1.41,0.43,-1.13,-0.07,-2.28,-0.38,-2.88,-0.6,-3.75,-0.87,2.95,2.91,1.33,2.11,0.03,1.45,-1.02,0.86,-1.87,0.31,-4.11,-0.11,-4.99,-0.43,-5.32,-0.7,-5.92,-1,3.1,-1.09,0.24,-1.06,-1.98,-0.66,-3.78,-0.17,-5.39,0.16,-7.28,-0.16,-7.83,-0.49,-7.85,-0.81,-8.14,-1.14,3.23,-4.32,-0.73,-3.59,-3.77,-2.39,-6.23,-1.05,-8.43,0.05,-10.07,-0.19,-10.39,-0.52,-10.2,-0.9,-10.27,-1.26,3.28,-5.65,-1.51,-4.5,-5.06,-3.13,-7.84,-1.61,-10.31,0,-11.9,-0.14,-12.24,-0.49,-12.09,-0.92,-12.18,-1.3,3.07,-6.08,-2.09,-4.83,-6.47,-3.38,-10.08,-1.81,-12.95,-0.17,-14.28,-0.37,-15.1,-0.81,-15.72,-1.26,-16.44,-1.48,2.58,-7.11,-2.67,-5.77,-7.54,-4.28,-11.62,-2.68,-14.52,-1,-15.73,-1.04,-17.19,-1.12,-18.74,-1.14,-20.26,-0.98,1.96,-8.4,-3.21,-6.94,-8.4,-5.44,-12.78,-3.84,-15.51,-2.09,-16.7,-1.9,-18.9,-1.43,-21.5,-0.82,-23.91,-0.2,1.41,-9.56,-3.68,-7.99,-9.2,-6.46,-13.86,-4.85,-16.4,-3.04,-17.63,-2.66,-20.62,-1.74,-24.31,-0.6,-27.64,0.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[4.37,0,5.49,0,6.72,0,7.71,0,8.12,0,9.62,0,13.28,0,17.78,0,21.87,0,3.26,0,4.68,-0.2,6.37,-0.35,7.86,-0.41,8.67,-0.34,11.28,-0.3,15.25,-0.2,19.31,-0.08,22.24,0,2.03,0,3.82,-0.42,6.04,-0.73,8.1,-0.86,9.37,-0.72,13.06,-0.63,17.3,-0.41,20.9,-0.17,22.65,0,1.03,0,3.06,-0.61,5.68,-1.07,8.15,-1.24,9.76,-1.03,14.58,-0.9,19.16,-0.59,22.35,-0.24,22.98,0,0.62,0,2.55,-0.77,5.2,-1.3,7.76,-1.46,9.37,-1.16,15.49,-1.01,20.57,-0.67,23.49,-0.29,23.11,0,-0.98,0,1.43,-0.61,4.47,-1.06,7.27,-1.24,8.96,-1.03,14.25,-1.01,19.05,-0.75,22.22,-0.41,22.64,-0.13,-2.19,0,0.46,-0.41,3.63,-0.73,6.43,-0.86,7.97,-0.72,12.39,-0.88,16.88,-0.83,20.3,-0.66,21.47,-0.43,-3.24,0,-0.46,-0.2,2.74,-0.35,5.44,-0.41,6.74,-0.34,10.29,-0.7,14.47,-0.91,18.1,-0.96,20.04,-0.81,-4.37,0,-1.41,0,1.87,0,4.53,0,5.62,0,8.32,-0.54,12.18,-0.99,16.04,-1.23,18.74,-1.16]}]},{"name":"B_CLOTHES.23","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-14.99,0,-11.01,0,-6.6,0,-3.03,0,-1.56,0,-1.19,-0.1,-0.27,-0.33,0.85,-0.61,1.87,-0.87,-16.11,0.52,-12.6,0.38,-8.73,0.23,-5.59,0.11,-4.26,0.06,-3.59,-0.02,-1.93,-0.23,0.12,-0.48,1.97,-0.7,-17.34,1.09,-14.27,0.82,-10.89,0.51,-8.13,0.27,-6.91,0.16,-5.95,0.09,-3.56,-0.1,-0.6,-0.32,2.07,-0.51,-18.33,1.55,-15.79,1.15,-12.99,0.7,-10.7,0.33,-9.66,0.18,-8.39,0.12,-5.25,-0.03,-1.36,-0.21,2.15,-0.35,-18.74,1.74,-16.93,1.22,-14.93,0.65,-13.32,0.19,-12.65,0,-11.03,-0.03,-7.09,-0.11,-2.22,-0.2,2.19,-0.29,-19.24,2.16,-19.11,1.86,-17.41,1.51,-14.87,1.21,-12.19,1.03,-10.34,1.08,-6.24,1.19,-1.25,1.28,3.29,1.27,-19.44,2.72,-20.9,2.63,-19.41,2.48,-15.85,2.3,-11.07,2.12,-9.33,2.16,-5.49,2.24,-0.79,2.29,3.47,2.26,-19.53,3.33,-22.55,3.44,-21.24,3.48,-16.62,3.43,-9.69,3.24,-8.21,3.22,-4.77,3.18,-0.55,3.12,3.28,3.03,-19.68,3.91,-24.29,4.23,-23.17,4.47,-17.5,4.54,-8.43,4.34,-7.15,4.3,-4.04,4.18,-0.2,4.04,3.28,3.91]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[8.12,0,4.6,0.17,0.7,0.36,-2.45,0.52,-3.75,0.58,-3.2,0.45,-1.87,0.14,-0.23,-0.24,1.25,-0.58,9.42,0,6.49,0.14,3.26,0.3,0.64,0.43,-0.4,0.49,-0.44,0.39,-0.34,0.15,-0.18,-0.15,-0.05,-0.41,10.85,0,8.56,0.11,6,0.25,3.96,0.38,3.2,0.43,2.46,0.36,1.24,0.18,-0.17,-0.04,-1.48,-0.22,12.02,0,10.29,0.07,8.37,0.17,6.84,0.27,6.3,0.31,5.03,0.26,2.69,0.16,-0.09,0.03,-2.65,-0.06,12.49,0,11.2,0,9.76,0,8.6,0,8.12,0,6.89,0,3.9,0,0.21,0,-3.12,0,12.49,0,12.39,-0.29,11.65,-0.39,10.48,-0.29,9.08,0,7.93,0,4.76,0,0.79,0,-2.78,0,12.49,0,13.92,-0.59,14.21,-0.78,13.37,-0.59,11.4,0,10.07,0,6.51,0,2.06,0,-1.95,0,12.49,0,15.62,-0.89,17.09,-1.19,16.71,-0.89,14.27,0,12.66,0,8.62,0,3.6,0,-0.93,0,12.49,0,17.26,-1.19,19.84,-1.59,19.85,-1.19,16.87,0,15.02,0,10.54,0,5.01]}]},{"name":"B_CLOTHES.13","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-3.96,0.6,-7.62,1.16,-8.54,1.27,-7.51,0.83,-5.19,0.01,-3.63,-0.26,-1.89,-0.1,0,0,0,0,-7.84,1.2,-15.1,2.32,-16.93,2.55,-14.92,1.71,-10.32,0.15,-7.23,-0.41,-3.75,-0.15,0,0,0,0,-10.41,1.54,-20.07,3.09,-22.75,3.45,-20.38,2.57,-14.05,0.74,-9.88,-0.02,-5.15,-0.02,0,0,0,0,-10.38,0.87,-20.01,1.73,-23.83,2,-23.61,1.5,-18,0.24,-13.37,-0.26,-6.96,-0.13,0,0,0,0,-9.89,0.12,-19.04,0.17,-23.79,0.32,-26.42,0.3,-22.41,-0.27,-17.47,-0.49,-9.08,-0.25,0,0,0,0,-8.4,-0.04,-16.15,-0.06,-20.13,0.08,-22.92,0.23,-20.32,0,-16.29,-0.13,-8.48,-0.07,0,0,0,0,-6.36,-0.15,-12.23,-0.28,-14.83,-0.2,-17.47,0.26,-17.42,0.54,-14.72,0.45,-7.66,0.23,0,0,0,0,-4.34,-0.27,-8.35,-0.52,-9.61,-0.5,-12.18,0.29,-14.75,1.08,-13.35,1.03,-6.94,0.54]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[2.08,-0.05,4.01,-0.13,4.54,-0.15,4.15,-0.08,3.76,-0.01,3.24,0,1.67,0,0,0,0,0,4.11,-0.08,7.91,-0.21,8.94,-0.23,8.1,-0.12,7.26,-0.01,6.27,0,3.24,0,0,0,0,0,6.43,-0.03,12.39,-0.12,13.82,-0.14,11.73,-0.15,9.63,-0.17,8.28,-0.14,4.29,-0.05,0,0,0,0,9.78,0.07,18.88,0.08,21.01,0.06,16.79,-0.07,12.56,-0.2,10.48,-0.18,5.42,-0.07,0,0,0,0,11.89,0.24,22.9,0.47,25.26,0.51,19.48,0.25,13.7,0,11.54,-0.02,5.99,-0.01,0,0,0,0,11.92,0.23,22.95,0.46,24.61,0.49,18.18,0.26,13.33,0.02,11.91,0,6.2,0,0,0,0,0,11.19,0.12,21.54,0.24,22.22,0.26,15.68,0.13,13.08,0.01,12.61,0,6.56,0,0,0,0,0,10.41,0,20.03,0,19.7,0,13.11,0,12.85,0,13.35,0,6.94]}]},{"name":"B_NECK.02","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-4.69},{"duration":60,"tweenEasing":0},{"x":4.06}]},{"name":"B_NECK.02","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-0.1},{"duration":61}]},{"name":"D_CLOTHES.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[0.03,-0.44,0.04,-0.34,0.04,2.86,0.8,2.68,0.42,-0.63,0.57,-1.33,0.41,-1.8,-0.44,-0.98,-0.56,-2.32,9.56,-1.05,3.03,-0.85,-1.7,-1.35,-1.94,-1.42,0.13,-0.84,-0.92,-2.12,-0.56,-2.1,0.58,-1.63,-1.17,-2.29,3.26,2.15,0.6,-1.7,0.78,-1.81,-0.45,-2.07,0.86,-1.83,0.65,-1.67,1.7,-1.78,0.34,-1.21,0.01,-0.61,0.03,-0.43,0.11,-0.34,0.28,-0.96,0.13,-0.86,-6.57,-8.4,0.03,-0.66,0.02,-0.56,0.07,-0.93,0.49,-1.39,0.03,-0.43,0.04,-0.29,0.04,-0.32,0.03,0.7,0.67,-1.49,0.74,-1.59,0.45,-1.23,0.13,-0.5,0.17,-0.57,0.33,-1.07,0.56,-1.35,0.42,-2.17,-0.19,-1.33,-8.01,2.02,-2.83,-5.46,-1.96,-5.44,-4.36,-0.91,-0.88,-1.17,-6.78,-7.61,-0.5,-2.03,-0.57,-0.55,-0.63,-2.01,0.72,-1.72,-4.78,-5.43,-0.88,-2.58,-1.3,-2.32,-0.62,-2.21,-0.2,-2.01,-1.28,-2.39,-0.81,-2.1,-0.13,-1.96,-0.22,-1.95,-0.48,-2.12,0.62,-1.69,-0.23,-1.87]},{"duration":60,"tweenEasing":0,"offset":141},{"value":[-0.01,1.04,-0.02,0.7,-0.02,3.57,-6.48,2.63,-0.04,1.49,-1.05,3.1,0.09,4.17,16.25,-3.46,17.89,5.58,14.69,7.15,20.51,11.76,6.31,-0.26,2.43,14.74,-0.33,2.19,2.16,4.56,6.72,3.12,13.62,3.47,2.99,5.21,14.71,8.79,-0.14,3.62,-3.99,4.77,9.84,1.91,0.03,3.96,-3.05,3.91,1.33,3.85,-0.19,3.09,-0.02,1.44,-0.02,1.01,-0.03,0.72,-0.92,2.43,0.04,1.47,-0.67,4.8,-0.01,1.56,-0.02,1.23,-0.55,2.19,-0.18,3.44,-0.02,1.02,-0.02,0.56,-0.02,0.81,-0.02,1.72,-0.49,3.51,-0.83,3.61,-0.63,3.03,-0.03,1.17,3.99,1.44,3.72,1.48,-0.56,3.24,9.15,0.87,14.1,5.6,2.18,15.99,-0.18,7.48,-3.43,9.68,-2.01,13.26,3.65,13.01,-4.43,3.73,0.78,3.92,6.85,-2.09,6,1,-0.13,3.71,-2.38,4.47,7.83,-1.46,3.19,5.14,12.41,5.14,14.6,3.79,3.68,5.7,4.54,3.8,-5.25,4.66,8.93,6.64,14.42,3.95,-6.06,7.91,-1.9,4.22]}]},{"name":"D_CLOTHES.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[11.69,4.17,0.05,0,0.05,0.03,-0.92,4.64,0.07,0.11,0.1,0.24,2.21,2.39,-5.45,10.3,1.28,-0.17,12.54,2.12,-3.04,-0.27,-1.53,-6.76,12.69,2.39,0.74,-0.03,0.31,0.07,0.49,3.4,-1.56,-0.76,11.39,1.93,1.47,0.2,0.66,0.22,-2.14,-0.31,0.07,0.09,3.96,1.13,0.06,0.1,-0.64,0.8,4.75,0.53,0.07,0.02,0.05,0.01,-1.34,2.2,-2.36,0,0.76,-0.04,0.16,0.11,0.45,0.05,0.17,0.08,-1.65,-0.88,4.43,-0.59,6.02,1.93,-0.35,0.09,-0.22,0.15,0.05,0.09,-2.29,1.87,0.63,10.29,3.37,5.16,0.67,0.29,1.25,5.74,-8.13,3.14,2.28,1.29,-1.72,-0.78,3.45,1.75,5.55,3.63,-1.05,-0.32,3.32,4.11,-2.88,3.93,-2.95,-0.45,-3.14,2.16,-2.55,4.75,0.45,-1.06,-2.94,1.27,0.66,-1.53,0.38,-0.69,0.3,0.09,1.32,-0.67,8.27,-0.11,2.66,-1.06]},{"duration":60,"tweenEasing":0,"offset":127},{"value":[11.59,4.33,-0.06,0.24,-0.13,0.48,4.35,-5.37,-9.94,-2.47,-7.92,-0.25,-1.94,6.7,-2.72,12.98,4.24,4.69,0.9,4.71,0,4.61,0.02,4.22,-0.24,3.39,-2.44,2.22,6.88,1.07,-0.23,3.89,0.6,3.98,4.55,3.3,-1.23,3.16,-2.86,1.96,-1.71,1.32,-17.96,-3.21,3.73,1.71,-9.08,-1.36,-1.09,1.28,4.52,0.92,-6.25,-0.47,-6.93,-0.74,1.54,5.68,2.05,3.8,-1.02,2.96,1.07,0.16,6.01,1.49,2.6,0.84,2.18,1.2,7.49,0.52,-2.66,2.54,-16.19,-1.28,-5.75,0.36,-1.51,1.64,-7.5,-1.31,-0.22,11.35,-5.32,6.6,-6.66,0.05,-1.09,6.91,-2.52,7.67,-0.46,0.54,0.01,4.34,-0.25,3.59,-0.45,3.49,0.55,3.6,-4,6.86,-5.35,10.56,0.95,-0.77,-1.58,4.7,-3.21,6.92,-2.16,2.59,-0.71,5.08,-2.18,2.59,4.76,1.91,-2.34,1.52,-1.23,3.44,-0.27,3.37,1.73,2.12]}]},{"name":"D_CLOTHES.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[24.14,5.84,0,0,0,0,0,0,0,0,-0.91,1.96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8.62,3.66]},{"duration":60,"tweenEasing":0,"offset":57},{"offset":10,"value":[-35.89,7.81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-17.74,0.01]}]},{"name":"B_BODY.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.9,-0.45,3.7,-0.24,-1.11,-0.04,-2.34,0.01,-2.34,0,-2.34,-0.01,-3.32,0.22,-7.13,1.12,-11.25,2.09,9.34,0.72,3.94,0.42,-1.05,0.1,-2.47,0.01,-3.42,-0.1,-4.38,-0.22,-5.24,-0.12,-8.33,0.34,-11.68,0.87,9.74,1.8,4.16,1.02,-1,0.23,-2.58,0,-4.42,-0.2,-6.27,-0.41,-7.03,-0.43,-9.45,-0.38,-12.08,-0.25,9.78,2.01,4.18,1.11,-1,0.26,-2.54,0.01,-4.71,-0.21,-6.88,-0.43,-7.65,-0.46,-9.81,-0.49,-12.15,-0.56,9.15,1.2,3.83,0.65,-1.09,0.16,-2.58,0.03,-5.02,0,-7.47,-0.03,-8.14,-0.12,-9.86,-0.44,-11.74,-0.77,8.51,0.39,3.47,0.2,-1.17,0.07,-2.61,0.04,-5.34,0.2,-8.06,0.37,-8.62,0.21,-9.91,-0.39,-11.32,-0.98,8.7,0.27,3.56,0.16,-1.19,0.06,-2.65,0.04,-5.04,0.2,-7.42,0.36,-8.06,0.21,-9.14,-0.36,-10.3,-0.89,9.7,0.13,4.1,0.08,-1.06,0.05,-2.51,0.03,-3.74,0.1,-4.97,0.18,-5.32,0.09,-5.88,-0.21,-6.48,-0.47,10.78,-0.03,4.7,0,-0.91,0.03,-2.35,0.03,-2.34,0,-2.33,-0.02,-2.34,-0.03,-2.35,-0.04,-2.34,-0.01]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[4.22,-0.01,4.22,-0.01,4.22,-0.02,4.22,-0.02,4.22,0,4.21,0.01,1.86,0,-7.36,-0.03,-17.34,-0.05,4.22,-0.02,4.22,-0.02,4.22,-0.03,4.08,-0.02,3.03,0.08,1.97,0.18,-0.06,0.16,-7.93,0.03,-16.47,-0.09,4.22,-0.03,4.22,-0.03,4.22,-0.04,3.96,-0.03,1.93,0.16,-0.11,0.34,-1.87,0.31,-8.49,0.09,-15.67,-0.13,4.22,-0.05,4.22,-0.04,4.22,-0.06,3.97,-0.04,1.75,0.17,-0.47,0.37,-2.24,0.35,-8.63,0.11,-15.55,-0.13,4.22,-0.06,4.22,-0.06,4.22,-0.07,4.11,-0.05,2.93,0.08,1.74,0.21,-0.35,0.2,-8.08,0.04,-16.42,-0.14,4.22,-0.07,4.21,-0.07,4.22,-0.06,4.25,-0.04,4.1,0,3.95,0.03,1.53,0.04,-7.53,-0.04,-17.29,-0.16,4.22,-0.06,4.21,-0.07,4.22,-0.06,4.22,-0.04,4.21,-0.01,4.2,0.01,1.78,0.02,-7.26,-0.04,-17.02,-0.15,4.22,-0.04,4.22,-0.06,4.22,-0.07,4.22,-0.05,4.22,-0.01,4.2,0.02,1.98,0.03,-6.47,-0.01,-15.59,-0.1,4.22,-0.02,4.22,-0.06,4.22,-0.07,4.22,-0.05,4.21,0,4.2,0.04,2.21,0.05,-5.59,0.03,-14.05,-0.05]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.38","timeline":[{"name":"B_CLOTHES.38_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.38_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.38_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.38_00","timeline":[{"name":"B_CLOTHES.38","type":12,"frame":[{"duration":121,"x":-1.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.38_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.38_02","timeline":[{"name":"B_CLOTHES.38","type":12,"frame":[{"duration":121,"x":5.4}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.39","timeline":[{"name":"B_CLOTHES.39_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.39_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.39_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.39_00","timeline":[{"name":"B_CLOTHES.39","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":26.5,"y":2.97},{"duration":60,"tweenEasing":0},{"x":-19.88,"y":-2.23}]},{"name":"B_CLOTHES.39","type":12,"frame":[{"duration":121,"x":6.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.39_01","timeline":[{"name":"B_CLOTHES.39","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":38.5,"y":3.57},{"duration":60,"tweenEasing":0},{"x":-27.88,"y":-2.59}]},{"name":"B_CLOTHES.39","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":-1.7}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.39_02","timeline":[{"name":"B_CLOTHES.39","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":29.33,"y":-0.05},{"duration":60,"tweenEasing":0},{"x":-24,"y":0.04}]},{"name":"B_CLOTHES.39","type":12,"frame":[{"duration":121,"x":-15.1}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.63","timeline":[{"name":"B_CLOTHES.63_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.63_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.63_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.63_00","timeline":[{"name":"B_CLOTHES.63","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":26.5,"y":2.97},{"duration":60,"tweenEasing":0},{"x":-19.88,"y":-2.23}]},{"name":"B_CLOTHES.63","type":12,"frame":[{"duration":121,"x":6.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.63_01","timeline":[{"name":"B_CLOTHES.63","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":38.5,"y":3.57},{"duration":60,"tweenEasing":0},{"x":-27.88,"y":-2.59}]},{"name":"B_CLOTHES.63","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":-1.7}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.63_02","timeline":[{"name":"B_CLOTHES.63","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":29.33,"y":-0.05},{"duration":60,"tweenEasing":0},{"x":-24,"y":0.04}]},{"name":"B_CLOTHES.63","type":12,"frame":[{"duration":121,"x":-15.1}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.62","timeline":[{"name":"B_CLOTHES.62_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.62_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.62_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.62_00","timeline":[{"name":"B_CLOTHES.62","type":12,"frame":[{"duration":121,"x":-1.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.62_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.62_02","timeline":[{"name":"B_CLOTHES.62","type":12,"frame":[{"duration":121,"x":5.4}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_REF.BODY","timeline":[{"name":"D_REF.BODY_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_REF.BODY_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_REF.BODY_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_REF.BODY_00","timeline":[{"name":"D_REF.BODY","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-54,64.99,-26,64.76,0,1.19,0,1.47]},{"duration":60,"tweenEasing":0,"offset":1,"value":[40.63,0,40.23,0,1.93,0,2.42]},{"value":[54,64.63,54,64.23,0,1.94,0,2.42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_REF.BODY_01","timeline":[{"name":"D_REF.BODY","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-54,40,-32,40]},{"duration":60,"tweenEasing":0,"offset":7},{"value":[32,24,54,24]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_REF.BODY_02","timeline":[{"name":"D_REF.BODY","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-54,20.79,-34,20.99,0,-0.91,0,-1.15]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-9.6,0,-9.51,0,-0.46,0,-0.57]},{"value":[34,14.4,54,14.49,0,-0.46,0,-0.57]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_FACESHADOW.01","timeline":[{"name":"B_FACESHADOW.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_FACESHADOW.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_FACESHADOW.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_FACESHADOW.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_FACESHADOW.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_00","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-104.32,-16.06,-90.4,-52.76,-76.2,-88.24,-58.56,-102.73,-40.07,-81.07,-29.17,-62.49,-29.93,-61.89,-36.2,-54.85,-42.99,-46.87,-90.9,-18.06,-80.86,-54.37,-70.96,-89.24,-58.37,-105.73,-45.4,-89.2,-36.92,-70.2,-37.07,-63.47,-40.87,-55.52,-44.84,-47.21,-78.49,-19.92,-72.06,-55.95,-66.1,-90.66,-58.34,-108.96,-50.81,-97.36,-44.75,-77.78,-44.27,-64.87,-45.48,-56.11,-46.55,-47.52,-74.93,-18.73,-69.64,-55.69,-63.86,-91.83,-58.96,-112.35,-54.92,-103.75,-50.33,-82.5,-49.46,-67.08,-48.22,-55.55,-47.11,-47.57,-67.32,-13.01,-63.18,-49.68,-58.61,-85.57,-55.09,-107.86,-52.4,-102.58,-49.15,-82.38,-49.41,-73.11,-48.92,-54.05,-48.82,-47.74,-57.47,-5.47,-55.01,-42.07,-52.5,-77.98,-50.68,-102.34,-49.59,-100.76,-47.95,-82.07,-49.62,-79.52,-50.78,-53.63,-52.22,-49.58,-56.25,4.41,-54.36,-33.35,-52.03,-71.1,-50.57,-97.13,-49.93,-97.54,-49.04,-81.07,-52.25,-77.94,-55.64,-53.34,-58.8,-47.36,-53.87,11.7,-53.12,-26.62,-52.01,-65.79,-50.99,-92.23,-52.46,-93.42,-54.08,-79.01,-58.59,-72.13,-62.89,-54.45,-66.87,-45.67,-50.99,18.61,-51.52,-20.22,-51.83,-60.78,-51.33,-87.51,-55.15,-89.39,-59.54,-76.93,-65.3,-66.4,-70.31,-55.8,-74.99,-44.45]},{"duration":60,"tweenEasing":0,"value":[-54.66,-16.06,-40.73,-52.76,-26.53,-88.24,-8.9,-102.73,9.6,-81.07,20.49,-62.49,19.74,-61.89,13.47,-54.85,6.68,-46.87,-41.23,-18.06,-31.19,-54.37,-21.3,-89.24,-8.71,-105.73,4.27,-89.2,12.75,-70.2,12.6,-63.47,8.79,-55.52,4.83,-47.21,-28.83,-19.92,-22.39,-55.95,-16.44,-90.66,-8.67,-108.96,-1.15,-97.36,4.92,-77.78,5.39,-64.87,4.18,-56.11,3.12,-47.52,-25.26,-18.77,-19.97,-55.7,-14.19,-91.82,-9.29,-112.35,-5.26,-103.75,-0.66,-82.5,0.21,-67.08,1.45,-55.55,2.56,-47.57,-17.65,-13.51,-13.51,-49.94,-8.94,-85.63,-5.42,-107.86,-2.73,-102.58,0.52,-82.38,0.26,-73.11,0.74,-54.05,0.84,-47.74,-7.8,-6.43,-5.35,-42.59,-2.84,-78.09,-1.02,-102.34,0.08,-100.76,1.72,-82.07,0.05,-79.52,-1.11,-53.63,-2.55,-49.58,-6.17,1.49,-4.41,-34.93,-2.3,-71.47,-0.9,-97.13,-0.27,-97.54,0.63,-81.07,-2.58,-77.94,-5.97,-53.34,-9.13,-47.36,-3.94,6.69,-3.28,-29.23,-2.3,-66.35,-1.32,-92.23,-2.79,-93.42,-4.41,-79.01,-8.92,-72.13,-13.22,-54.45,-17.2,-45.67,-1.32,11.61,-1.85,-23.8,-2.17,-61.49,-1.67,-87.51,-5.49,-89.39,-9.87,-76.93,-15.63,-66.4,-20.64,-55.8,-25.32,-44.45]},{"value":[-31.99,-16.06,-18.07,-52.76,-3.86,-88.24,13.77,-102.73,32.26,-81.07,43.16,-62.49,42.41,-61.89,36.13,-54.85,29.35,-46.87,-18.56,-18.06,-8.52,-54.37,1.37,-89.24,13.96,-105.73,26.94,-89.2,35.42,-70.2,35.26,-63.47,31.46,-55.52,27.49,-47.21,-6.16,-19.92,0.28,-55.95,6.23,-90.66,14,-108.96,21.52,-97.36,27.58,-77.78,28.06,-64.87,26.85,-56.11,25.78,-47.52,-2.59,-18.77,2.7,-55.7,8.47,-91.82,13.38,-112.35,17.41,-103.75,22,-82.5,22.87,-67.08,24.11,-55.55,25.22,-47.57,5.01,-13.51,9.15,-49.94,13.72,-85.63,17.24,-107.86,19.94,-102.58,23.18,-82.38,22.92,-73.11,23.41,-54.05,23.51,-47.74,14.87,-6.43,17.32,-42.59,19.83,-78.09,21.65,-102.34,22.75,-100.76,24.39,-82.07,22.72,-79.52,21.56,-53.63,20.11,-49.58,16.5,1.49,18.26,-34.93,20.37,-71.47,21.76,-97.13,22.4,-97.54,23.3,-81.07,20.08,-77.94,16.7,-53.34,13.53,-47.36,18.72,6.69,19.39,-29.23,20.36,-66.35,21.34,-92.23,19.87,-93.42,18.26,-79.01,13.74,-72.13,9.45,-54.45,5.46,-45.67,21.34,11.61,20.82,-23.8,20.5,-61.49,21,-87.51,17.18,-89.39,12.8,-76.93,7.03,-66.4,2.02,-55.8,-2.66,-44.45]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_01","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-49.67,-19.72,-49.67,-24.72,-49.67,-29.67,-49.67,-33.77,-49.67,-33.32,-49.67,-32.86,-49.67,-36.08,-49.67,-37.6,-49.67,-38.87,-50.37,-12.84,-50,-23.48,-49.73,-33.66,-49.67,-38.88,-49.67,-36.24,-49.67,-33.59,-49.67,-36.35,-49.67,-37.3,-49.67,-37.97,-51.2,-5.71,-50.42,-21.93,-49.81,-37.27,-49.67,-43.63,-49.67,-38.93,-49.67,-34.24,-49.67,-36.61,-49.67,-37.03,-49.67,-37.14,-52.51,3.06,-51.29,-17.93,-50.05,-37.67,-49.72,-45.19,-49.65,-39.71,-49.59,-34.22,-49.77,-38.03,-49.66,-36.33,-49.67,-37.01,-51.5,9.4,-50.96,-15.42,-50.46,-38.74,-50.26,-47.2,-49.5,-40.56,-48.74,-33.92,-49.53,-41.83,-49.44,-34.61,-49.67,-37.9,-50.49,14.48,-50.63,-13.75,-50.87,-40.21,-50.81,-49.22,-49.35,-41.42,-47.89,-33.63,-49.28,-45.61,-49.21,-32.89,-49.67,-38.79,-50.56,20.89,-50.78,-10.21,-50.96,-39.29,-50.87,-48.93,-49.44,-41.48,-48.02,-34.03,-49.22,-44.64,-49.24,-33.95,-49.67,-39.19,-50.13,28.06,-50.54,-5.53,-50.91,-36.92,-50.9,-47.29,-49.87,-41.4,-48.84,-35.51,-49.41,-42.18,-49.44,-37.39,-49.67,-40.44,-49.67,35.28,-50.28,-0.78,-50.85,-34.44,-50.94,-45.52,-50.33,-41.31,-49.72,-37.09,-49.67,-39.86,-49.67,-40.96,-49.67,-41.78]},{"duration":60,"tweenEasing":0,"offset":1,"value":[4.28,0,-11.83,0,-27.05,0,-33.77,0,-33.32,0,-32.86,0,-36.08,0,-37.6,0,-38.87,-1.23,2.43,-0.7,-15.25,-0.15,-31.94,0,-38.88,0,-36.24,0,-33.59,0,-36.35,0,-37.3,0,-37.97,-2.37,0.71,-1.33,-18.43,-0.28,-36.49,0,-43.63,0,-38.93,0,-34.24,0,-36.61,0,-37.03,0,-37.14,-2.55,0.45,-1.44,-19.45,-0.34,-38.15,-0.05,-45.19,0.01,-39.71,0.08,-34.22,-0.1,-38.03,0.01,-36.33,0,-37.01,-1.33,2.28,-1.02,-19.39,-0.74,-39.74,-0.6,-47.2,0.17,-40.56,0.93,-33.92,0.14,-41.83,0.23,-34.61,0,-37.9,-0.11,4.1,-0.6,-19.32,-1.13,-41.33,-1.14,-49.22,0.32,-41.42,1.78,-33.63,0.39,-45.61,0.45,-32.89,0,-38.79,0,4.28,-0.62,-19.12,-1.19,-41.1,-1.2,-48.93,0.22,-41.48,1.65,-34.03,0.45,-44.64,0.43,-33.95,0,-39.19,0,4.28,-0.62,-18.3,-1.19,-39.52,-1.24,-47.29,-0.2,-41.4,0.83,-35.51,0.25,-42.18,0.23,-37.39,0,-40.44,0,4.28,-0.62,-17.43,-1.19,-37.83,-1.28,-45.52,-0.67,-41.31,-0.06,-37.09,0,-39.86,0,-40.96,0,-41.78]},{"value":[22.67,4.28,22.67,-11.83,22.67,-27.05,22.67,-33.77,22.67,-33.32,22.67,-32.86,22.67,-36.08,22.67,-37.6,22.67,-38.87,21.43,2.43,21.97,-15.25,22.52,-31.94,22.67,-38.88,22.67,-36.24,22.67,-33.59,22.67,-36.35,22.67,-37.3,22.67,-37.97,20.29,0.71,21.33,-18.43,22.39,-36.49,22.67,-43.63,22.67,-38.93,22.67,-34.24,22.67,-36.61,22.67,-37.03,22.67,-37.14,20.11,0.45,21.22,-19.45,22.32,-38.15,22.62,-45.19,22.68,-39.71,22.75,-34.22,22.56,-38.03,22.67,-36.33,22.67,-37.01,21.33,2.28,21.64,-19.39,21.93,-39.74,22.07,-47.2,22.83,-40.56,23.6,-33.92,22.81,-41.83,22.9,-34.61,22.67,-37.9,22.55,4.1,22.06,-19.32,21.53,-41.33,21.53,-49.22,22.99,-41.42,24.44,-33.63,23.05,-45.61,23.12,-32.89,22.67,-38.79,22.67,4.28,22.05,-19.12,21.48,-41.1,21.47,-48.93,22.89,-41.48,24.31,-34.03,23.12,-44.64,23.1,-33.95,22.67,-39.19,22.67,4.28,22.05,-18.3,21.48,-39.52,21.43,-47.29,22.46,-41.4,23.5,-35.51,22.92,-42.18,22.89,-37.39,22.67,-40.44,22.67,4.28,22.05,-17.43,21.48,-37.83,21.39,-45.52,22,-41.31,22.61,-37.09,22.67,-39.86,22.67,-40.96,22.67,-41.78]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_02","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_03","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-49.67,29.2,-49.67,40.11,-49.67,50.31,-49.62,53.72,-49.17,52.35,-48.71,50.99,-48.78,45.11,-49.2,18.96,-49.67,-9.46,-49.67,29.2,-49.67,40.11,-49.67,50.31,-49.52,54.92,-49.12,54.92,-49.03,51.76,-49.29,45.42,-49.93,21.42,-50.59,-4.72,-49.67,29.2,-49.67,40.11,-49.67,50.31,-49.42,56.12,-49.05,57.49,-49.32,52.57,-49.77,45.63,-50.59,23.64,-51.45,-0.34,-49.67,29.2,-49.67,40.14,-49.67,50.36,-49.38,57.1,-49,59.6,-49.38,53.42,-49.88,44.99,-50.69,23.53,-51.49,0.25,-49.67,29.2,-49.67,40.35,-49.67,50.76,-49.49,57.89,-49.26,60.81,-49.49,54.22,-49.67,42.98,-49.67,19.61,-49.67,-5.34,-49.67,29.2,-49.67,40.56,-49.67,51.17,-49.6,58.68,-49.52,62.02,-49.6,55.01,-49.45,40.99,-48.63,15.7,-47.84,-10.94,-49.67,29.2,-49.67,40.71,-49.67,51.46,-49.54,59.12,-49.37,62.37,-49.54,54.94,-49.46,40.61,-48.67,15.23,-47.89,-11.47,-49.67,29.2,-49.67,41.11,-49.67,52.22,-49.38,59.91,-49.02,62.4,-49.38,54.16,-49.56,40.17,-49.14,15.03,-48.74,-11.49,-49.67,29.2,-49.67,41.53,-49.67,53.04,-49.23,60.75,-48.67,62.42,-49.23,53.34,-49.67,39.68,-49.67,14.8,-49.67,-11.51]},{"duration":60,"tweenEasing":0,"offset":1,"value":[29.2,0,40.11,0,50.31,0.04,53.72,0.5,52.35,0.96,50.99,0.89,45.11,0.46,18.96,0,-9.46,0,29.2,0,40.11,0,50.31,0.15,54.92,0.55,54.92,0.64,51.76,0.37,45.42,-0.26,21.42,-0.93,-4.72,0,29.2,0,40.11,0,50.31,0.25,56.12,0.62,57.49,0.35,52.57,-0.1,45.63,-0.92,23.64,-1.78,-0.34,0,29.2,0,40.14,0,50.36,0.29,57.1,0.66,59.6,0.29,53.42,-0.21,44.99,-1.03,23.53,-1.83,0.25,0,29.2,0,40.35,0,50.76,0.18,57.89,0.41,60.81,0.18,54.22,0,42.98,0,19.61,0,-5.34,0,29.2,0,40.56,0,51.17,0.06,58.68,0.15,62.02,0.06,55.01,0.22,40.99,1.03,15.7,1.83,-10.94,0,29.2,0,40.71,0,51.46,0.13,59.12,0.3,62.37,0.13,54.94,0.21,40.61,1,15.23,1.78,-11.47,0,29.2,0,41.11,0,52.22,0.28,59.91,0.65,62.4,0.28,54.16,0.11,40.17,0.52,15.03,0.93,-11.49,0,29.2,0,41.53,0,53.04,0.44,60.75,1,62.42,0.44,53.34,0,39.68,0,14.8,0,-11.51]},{"value":[22.67,29.2,22.67,40.11,22.67,50.31,22.71,53.72,23.17,52.35,23.62,50.99,23.56,45.11,23.13,18.96,22.67,-9.46,22.67,29.2,22.67,40.11,22.67,50.31,22.81,54.92,23.22,54.92,23.3,51.76,23.04,45.42,22.41,21.42,21.74,-4.72,22.67,29.2,22.67,40.11,22.67,50.31,22.92,56.12,23.28,57.49,23.02,52.57,22.56,45.63,21.74,23.64,20.89,-0.34,22.67,29.2,22.67,40.14,22.67,50.36,22.96,57.1,23.33,59.6,22.96,53.42,22.45,44.99,21.64,23.53,20.84,0.25,22.67,29.2,22.67,40.35,22.67,50.76,22.84,57.89,23.07,60.81,22.84,54.22,22.67,42.98,22.67,19.61,22.67,-5.34,22.67,29.2,22.67,40.56,22.67,51.17,22.73,58.68,22.82,62.02,22.73,55.01,22.88,40.99,23.7,15.7,24.49,-10.94,22.67,29.2,22.67,40.71,22.67,51.46,22.8,59.12,22.96,62.37,22.8,54.94,22.87,40.61,23.67,15.23,24.45,-11.47,22.67,29.2,22.67,41.11,22.67,52.22,22.95,59.91,23.31,62.4,22.95,54.16,22.78,40.17,23.19,15.03,23.59,-11.49,22.67,29.2,22.67,41.53,22.67,53.04,23.1,60.75,23.66,62.42,23.1,53.34,22.67,39.68,22.67,14.8,22.67,-11.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_04","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-45.72,62.2,-47.59,83.3,-49.32,102.9,-49.72,108.72,-49.26,107.35,-48.8,105.99,-49.82,92.94,-51.91,64.55,-54.74,36.54,-47.11,61.27,-48.38,82.79,-49.48,102.78,-49.62,110.03,-49.21,110.85,-49.13,108.51,-50.25,91.96,-51.65,60.79,-54.11,31.25,-48.39,60.42,-49.09,82.32,-49.63,102.68,-49.51,111.33,-49.15,114.29,-49.42,110.94,-50.67,91.04,-51.4,57.27,-53.53,26.36,-48.85,60.37,-49.24,82.32,-49.65,102.71,-49.47,112.3,-49.1,116.53,-49.48,112.07,-50.82,89.93,-51.37,55.21,-53.19,23.83,-50.22,62.19,-50.01,83.53,-49.81,103.36,-49.58,112.98,-49.36,116.81,-49.59,111.13,-50.49,86.68,-50.46,51.58,-51.06,18.4,-51.6,64.02,-50.78,84.75,-49.97,104,-49.7,113.65,-49.61,117.09,-49.7,110.2,-50.06,82.9,-49.18,46.73,-48.36,11.01,-52.6,63.75,-51.13,84.77,-50.02,104.28,-49.62,114.34,-49.39,116.52,-49.49,107.82,-49.75,79.27,-48.48,41.42,-47.24,3.47,-56.02,62.04,-53.02,84.23,-50.42,104.84,-49.45,114.68,-48.75,112.5,-48.79,99.46,-49.36,70.92,-48.56,32.88,-47.73,-5.4,-59.72,60.18,-55.11,83.63,-50.85,105.42,-49.27,114.95,-48.1,108.08,-48.04,90.47,-48.97,62,-48.75,23.94,-48.38,-14.51]},{"duration":60,"tweenEasing":0,"value":[3.94,62.2,2.07,83.3,0.35,102.9,-0.05,108.72,0.4,107.35,0.86,105.99,0.13,91.95,-0.85,59.62,-2.41,27.21,2.56,61.27,1.29,82.79,0.18,102.78,0.05,110.03,0.45,110.85,0.54,108.51,-0.52,91.49,-1.6,57.9,-3.63,25.62,1.27,60.42,0.58,82.32,0.03,102.68,0.16,111.33,0.52,114.29,0.25,110.94,-1.13,91.01,-2.27,56.24,-4.76,24.15,0.82,60.37,0.43,82.32,0.02,102.71,0.2,112.3,0.57,116.53,0.19,112.07,-1.27,90.17,-2.35,54.92,-4.75,22.74,-0.56,62.19,-0.34,83.53,-0.15,103.36,0.08,112.98,0.31,116.81,0.08,111.13,-0.79,88.76,-0.8,53.96,-1.56,20.57,-1.93,64.02,-1.12,84.75,-0.31,104,-0.03,113.65,0.05,117.09,-0.03,110.2,-0.32,87.61,0.75,53.54,1.64,19.24,-2.94,63.75,-1.46,84.77,-0.35,104.28,0.03,114.16,0.2,117.19,0.04,109.48,-0.23,86.1,0.6,50.45,1.72,14.16,-6.35,62.04,-3.36,84.23,-0.75,104.84,0.19,114.86,0.55,116.35,0.19,107.09,-0.23,83.11,0.01,45.68,0.87,7.78,-10.05,60.18,-5.44,83.63,-1.19,105.42,0.34,115.58,0.9,115.42,0.35,104.51,-0.25,80.02,-0.62,40.9,-0.05,1.49]},{"value":[26.61,62.2,24.74,83.3,23.01,102.9,22.61,108.72,23.07,107.35,23.53,105.99,21.41,83.67,17.71,46.13,13.59,14.54,25.22,61.27,23.96,82.79,22.85,102.78,22.72,110.03,23.12,110.85,23.21,108.51,21.16,85.35,17.88,47.13,13.61,13.72,23.94,60.42,23.24,82.32,22.7,102.68,22.82,111.33,23.19,114.29,22.92,110.94,20.94,86.95,18.07,48.12,13.62,12.97,23.48,60.37,23.1,82.32,22.68,102.71,22.86,112.3,23.23,116.53,22.86,112.07,20.99,87.64,18.32,48.47,14.15,11.74,22.11,62.19,22.32,83.53,22.52,103.36,22.75,112.98,22.98,116.81,22.75,111.13,21.74,86.82,21.17,47.7,19.61,9.4,20.74,64.02,21.55,84.75,22.36,104,22.64,113.65,22.72,117.09,22.64,110.2,22.4,86.16,23.64,47.11,24.51,7.35,19.73,63.75,21.21,84.77,22.31,104.28,22.7,114.16,22.87,117.19,22.7,109.48,22.48,85.27,23.37,46.72,24.28,7.08,16.31,62.04,19.31,84.23,21.92,104.84,22.85,114.86,23.22,116.35,22.86,107.09,22.49,83.33,22.75,46.74,23,9.2,12.61,60.18,17.22,83.63,21.48,105.42,23.01,115.58,23.57,115.42,23.01,104.51,22.48,81.28,22.07,46.8,21.62,11.49]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HOHO.01","timeline":[{"name":"B_HOHO.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HOHO.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HOHO.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HOHO.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_00","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-16.64,18.74,-22.42,18.62,-28.26,18.48,-33.96,18.36,-39.3,18.32,-44.13,18.36,-48.6,18.48,-52.92,18.62,-57.31,18.74,-16.64,18.74,-22.39,18.65,-28.2,18.55,-33.88,18.48,-39.2,18.44,-44.04,18.48,-48.54,18.55,-52.89,18.65,-57.31,18.74,-16.64,18.74,-22.36,18.69,-28.14,18.64,-33.78,18.6,-39.09,18.58,-43.95,18.6,-48.47,18.64,-52.86,18.69,-57.31,18.74,-16.64,18.74,-22.33,18.72,-28.08,18.71,-33.71,18.7,-39,18.7,-43.87,18.7,-48.42,18.71,-52.83,18.72,-57.31,18.74,-16.64,18.74,-22.32,18.74,-28.05,18.74,-33.67,18.74,-38.97,18.74,-43.83,18.74,-48.39,18.74,-52.82,18.74,-57.31,18.74,-16.64,18.74,-22.3,18.74,-28.03,18.74,-33.63,18.74,-38.93,18.74,-43.8,18.74,-48.36,18.74,-52.81,18.74,-57.31,18.74,-16.64,18.74,-22.28,18.74,-27.97,18.74,-33.55,18.74,-38.84,18.74,-43.72,18.74,-48.31,18.74,-52.78,18.74,-57.31,18.74,-16.64,18.74,-22.25,18.74,-27.91,18.74,-33.46,18.74,-38.73,18.74,-43.62,18.74,-48.24,18.74,-52.75,18.74,-57.31,18.74,-16.64,18.74,-22.22,18.74,-27.85,18.74,-33.37,18.74,-38.64,18.74,-43.54,18.74,-48.18,18.74,-52.72,18.74,-57.31,18.74]},{"duration":60,"tweenEasing":0,"value":[-17.51,0,-23.28,-0.13,-29.13,-0.27,-34.83,-0.38,-40.16,-0.43,-44.99,-0.38,-49.46,-0.27,-53.78,-0.13,-58.18,0,-17.51,0,-23.25,-0.09,-29.07,-0.19,-34.74,-0.27,-40.07,-0.3,-44.91,-0.27,-49.4,-0.19,-53.75,-0.09,-58.18,0,-17.51,0,-23.22,-0.05,-29,-0.11,-34.65,-0.14,-39.96,-0.16,-44.81,-0.14,-49.34,-0.11,-53.72,-0.05,-58.18,0,-17.51,0,-23.19,-0.02,-28.95,-0.04,-34.57,-0.04,-39.87,-0.05,-44.74,-0.04,-49.28,-0.04,-53.7,-0.02,-58.18,0,-17.51,0,-23.18,0,-28.92,0,-34.53,0,-39.83,0,-44.7,0,-49.25,0,-53.68,0,-58.18,0,-17.51,0,-23.17,0,-28.89,0,-34.49,0,-39.8,0,-44.66,0,-49.22,0,-53.67,0,-58.18,0,-17.51,0,-23.14,0,-28.84,0,-34.41,0,-39.71,0,-44.58,0,-49.17,0,-53.64,0,-58.18,0,-17.51,0,-23.11,0,-28.77,0,-34.32,0,-39.6,0,-44.49,0,-49.11,0,-53.61,0,-58.18,0,-17.51,0,-23.08,0,-28.71,0,-34.24,0,-39.5,0,-44.4,0,-49.05,0,-53.59,0,-58.18]},{"value":[-15.78,-11.93,-21.55,-12.05,-27.4,-12.19,-33.1,-12.31,-38.44,-12.35,-43.27,-12.31,-47.73,-12.19,-52.05,-12.05,-56.45,-11.93,-15.78,-11.93,-21.52,-12.02,-27.34,-12.12,-33.01,-12.2,-38.34,-12.23,-43.18,-12.2,-47.67,-12.12,-52.03,-12.02,-56.45,-11.93,-15.78,-11.93,-21.49,-11.98,-27.27,-12.03,-32.92,-12.07,-38.23,-12.09,-43.09,-12.07,-47.61,-12.03,-51.99,-11.98,-56.45,-11.93,-15.78,-11.93,-21.47,-11.95,-27.22,-11.96,-32.84,-11.97,-38.14,-11.97,-43.01,-11.97,-47.55,-11.96,-51.97,-11.95,-56.45,-11.93,-15.78,-11.93,-21.45,-11.93,-27.19,-11.93,-32.8,-11.93,-38.1,-11.93,-42.97,-11.93,-47.53,-11.93,-51.96,-11.93,-56.45,-11.93,-15.78,-11.93,-21.44,-11.93,-27.16,-11.93,-32.76,-11.93,-38.07,-11.93,-42.93,-11.93,-47.5,-11.93,-51.94,-11.93,-56.45,-11.93,-15.78,-11.93,-21.41,-11.93,-27.11,-11.93,-32.69,-11.93,-37.98,-11.93,-42.85,-11.93,-47.44,-11.93,-51.92,-11.93,-56.45,-11.93,-15.78,-11.93,-21.38,-11.93,-27.04,-11.93,-32.59,-11.93,-37.87,-11.93,-42.76,-11.93,-47.38,-11.93,-51.89,-11.93,-56.45,-11.93,-15.78,-11.93,-21.36,-11.93,-26.98,-11.93,-32.51,-11.93,-37.77,-11.93,-42.67,-11.93,-47.32,-11.93,-51.86,-11.93,-56.45,-11.93]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_01","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-8.64,20.45,-11.91,20.32,-15.26,20.18,-18.43,20.07,-21.13,20.02,-23.16,20.07,-24.72,20.18,-26.1,20.32,-27.57,20.45,-8.64,20.45,-11.87,20.36,-15.19,20.26,-18.32,20.18,-21,20.15,-23.05,20.18,-24.65,20.26,-26.06,20.36,-27.57,20.45,-8.64,20.45,-11.83,20.39,-15.1,20.34,-18.2,20.3,-20.86,20.29,-22.93,20.3,-24.56,20.34,-26.02,20.39,-27.57,20.45,-8.64,20.45,-11.8,20.42,-15.03,20.41,-18.1,20.4,-20.74,20.4,-22.83,20.4,-24.49,20.41,-25.99,20.42,-27.57,20.45,-8.64,20.45,-11.78,20.45,-14.99,20.45,-18.05,20.45,-20.7,20.45,-22.78,20.45,-24.45,20.45,-25.97,20.45,-27.57,20.45,-8.64,20.45,-11.76,20.45,-14.96,20.45,-18,20.45,-20.65,20.45,-22.73,20.45,-24.42,20.45,-25.95,20.45,-27.57,20.45,-8.64,20.45,-11.73,20.45,-14.89,20.45,-17.9,20.45,-20.53,20.45,-22.63,20.45,-24.35,20.45,-25.92,20.45,-27.57,20.45,-8.64,20.45,-11.69,20.45,-14.8,20.45,-17.77,20.45,-20.39,20.45,-22.5,20.45,-24.26,20.45,-25.88,20.45,-27.57,20.45,-8.64,20.45,-11.65,20.45,-14.72,20.45,-17.66,20.45,-20.26,20.45,-22.39,20.45,-24.18,20.45,-25.84,20.45,-27.57,20.45]},{"duration":60,"tweenEasing":0,"value":[-8.64,0,-11.91,-0.13,-15.26,-0.27,-18.43,-0.38,-21.13,-0.43,-23.16,-0.38,-24.72,-0.27,-26.1,-0.13,-27.57,0,-8.64,0,-11.87,-0.09,-15.19,-0.19,-18.32,-0.27,-21,-0.3,-23.05,-0.27,-24.65,-0.19,-26.06,-0.09,-27.57,0,-8.64,0,-11.83,-0.05,-15.1,-0.11,-18.2,-0.14,-20.86,-0.16,-22.93,-0.14,-24.56,-0.11,-26.02,-0.05,-27.57,0,-8.64,0,-11.8,-0.02,-15.03,-0.04,-18.1,-0.04,-20.74,-0.05,-22.83,-0.04,-24.49,-0.04,-25.99,-0.02,-27.57,0,-8.64,0,-11.78,0,-14.99,0,-18.05,0,-20.7,0,-22.78,0,-24.45,0,-25.97,0,-27.57,0,-8.64,0,-11.76,0,-14.96,0,-18,0,-20.65,0,-22.73,0,-24.42,0,-25.95,0,-27.57,0,-8.64,0,-11.73,0,-14.89,0,-17.9,0,-20.53,0,-22.63,0,-24.35,0,-25.92,0,-27.57,0,-8.64,0,-11.69,0,-14.8,0,-17.77,0,-20.39,0,-22.5,0,-24.26,0,-25.88,0,-27.57,0,-8.64,0,-11.65,0,-14.72,0,-17.66,0,-20.26,0,-22.39,0,-24.18,0,-25.84,0,-27.57]},{"value":[-8.64,-15.34,-11.91,-15.46,-15.26,-15.6,-18.43,-15.71,-21.13,-15.76,-23.16,-15.71,-24.72,-15.6,-26.1,-15.46,-27.57,-15.34,-8.64,-15.34,-11.87,-15.43,-15.19,-15.53,-18.32,-15.6,-21,-15.64,-23.05,-15.6,-24.65,-15.53,-26.06,-15.43,-27.57,-15.34,-8.64,-15.34,-11.83,-15.39,-15.1,-15.44,-18.2,-15.48,-20.86,-15.5,-22.93,-15.48,-24.56,-15.44,-26.02,-15.39,-27.57,-15.34,-8.64,-15.34,-11.8,-15.36,-15.03,-15.37,-18.1,-15.38,-20.74,-15.38,-22.83,-15.38,-24.49,-15.37,-25.99,-15.36,-27.57,-15.34,-8.64,-15.34,-11.78,-15.34,-14.99,-15.34,-18.05,-15.34,-20.7,-15.34,-22.78,-15.34,-24.45,-15.34,-25.97,-15.34,-27.57,-15.34,-8.64,-15.34,-11.76,-15.34,-14.96,-15.34,-18,-15.34,-20.65,-15.34,-22.73,-15.34,-24.42,-15.34,-25.95,-15.34,-27.57,-15.34,-8.64,-15.34,-11.73,-15.34,-14.89,-15.34,-17.9,-15.34,-20.53,-15.34,-22.63,-15.34,-24.35,-15.34,-25.92,-15.34,-27.57,-15.34,-8.64,-15.34,-11.69,-15.34,-14.8,-15.34,-17.77,-15.34,-20.39,-15.34,-22.5,-15.34,-24.26,-15.34,-25.88,-15.34,-27.57,-15.34,-8.64,-15.34,-11.65,-15.34,-14.72,-15.34,-17.66,-15.34,-20.26,-15.34,-22.39,-15.34,-24.18,-15.34,-25.84,-15.34,-27.57,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_02","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_03","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[31.13,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.06,20.48,44.25,20.49,46.43,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.06,20.48,44.25,20.49,46.43,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.06,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.63,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.26,20.49,46.44,20.49,48.63,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.89,20.48,42.07,20.48,44.26,20.49,46.44,20.49,48.63,20.49]},{"duration":60,"tweenEasing":0,"value":[31.13,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.06,0.04,44.25,0.04,46.43,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.06,0.04,44.25,0.04,46.43,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.06,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.63,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.26,0.04,46.44,0.04,48.63,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.89,0.03,42.07,0.04,44.26,0.04,46.44,0.04,48.63,0.04]},{"value":[32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.17,-17.43,43.36,-17.43,45.54,-17.43,47.73,-17.43,49.91,-17.42,32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.17,-17.43,43.36,-17.43,45.54,-17.43,47.73,-17.43,49.92,-17.42,32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.17,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.43,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.74,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.37,-17.43,45.55,-17.43,47.74,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,39,-17.43,41.18,-17.43,43.37,-17.43,45.55,-17.43,47.74,-17.43,49.92,-17.42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_04","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[62.27,20.5,66.64,20.5,71.01,20.51,75.38,20.51,79.75,20.51,84.12,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.27,20.5,66.64,20.5,71.01,20.51,75.38,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.27,20.5,66.64,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.27,20.5,66.65,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.28,20.5,66.65,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.88,20.53,97.25,20.53,62.28,20.5,66.65,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.25,20.53,62.28,20.5,66.65,20.5,71.02,20.51,75.4,20.51,79.77,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.25,20.53,62.28,20.5,66.66,20.5,71.03,20.51,75.4,20.51,79.77,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.25,20.53,62.29,20.5,66.66,20.5,71.03,20.51,75.4,20.51,79.77,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.26,20.53]},{"duration":60,"tweenEasing":0,"value":[62.27,0.05,66.64,0.05,71.01,0.06,75.38,0.06,79.75,0.07,84.12,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.27,0.05,66.64,0.05,71.01,0.06,75.38,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.27,0.05,66.64,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.27,0.05,66.65,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.28,0.05,66.65,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.88,0.08,97.25,0.08,62.28,0.05,66.65,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.25,0.08,62.28,0.05,66.65,0.05,71.02,0.06,75.4,0.06,79.77,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.25,0.08,62.28,0.05,66.66,0.05,71.03,0.06,75.4,0.06,79.77,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.25,0.08,62.29,0.05,66.66,0.05,71.03,0.06,75.4,0.06,79.77,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.26,0.08]},{"value":[64.86,-19.55,69.23,-19.54,73.6,-19.54,77.97,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.83,-19.51,64.86,-19.55,69.23,-19.54,73.6,-19.54,77.98,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.83,-19.51,64.86,-19.55,69.24,-19.54,73.61,-19.54,77.98,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.83,-19.51,64.87,-19.55,69.24,-19.54,73.61,-19.54,77.98,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.84,-19.51,64.87,-19.55,69.24,-19.54,73.61,-19.54,77.98,-19.53,82.35,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.84,-19.51,64.87,-19.55,69.24,-19.54,73.61,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.84,-19.51,64.87,-19.55,69.24,-19.54,73.62,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.84,-19.51,64.88,-19.55,69.25,-19.54,73.62,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.85,-19.51,64.88,-19.55,69.25,-19.54,73.62,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.11,-19.52,95.48,-19.52,99.85,-19.51]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HOHO.02","timeline":[{"name":"B_HOHO.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HOHO.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HOHO.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HOHO.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_00","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-76.73,26.41,-77.96,26.41,-75.93,26.41,-70.97,26.41,-63.4,26.41,-60.9,26.41,-57.48,26.41,-53.68,26.41,-50.06,26.41,-76.14,26.41,-77.15,26.41,-75.13,26.41,-70.39,26.41,-63.25,26.41,-60.77,26.41,-57.39,26.41,-53.63,26.41,-50.06,26.41,-75.48,26.41,-76.28,26.41,-74.29,26.41,-69.79,26.41,-63.08,26.41,-60.63,26.41,-57.29,26.41,-53.59,26.41,-50.06,26.41,-74.96,26.41,-75.53,26.41,-73.53,26.41,-69.24,26.41,-62.95,26.41,-60.52,26.41,-57.21,26.41,-53.55,26.41,-50.06,26.41,-74.74,26.41,-75.03,26.41,-72.98,26.41,-68.85,26.41,-62.9,26.41,-60.46,26.41,-57.16,26.41,-53.53,26.41,-50.06,26.41,-74.63,26.41,-75.48,26.39,-73.64,26.38,-69.35,26.39,-62.84,26.41,-60.4,26.41,-57.12,26.41,-53.51,26.41,-50.06,26.41,-74.36,26.41,-75.79,26.37,-74.18,26.36,-69.76,26.37,-62.71,26.41,-60.28,26.41,-57.04,26.41,-53.47,26.41,-50.06,26.41,-74.04,26.41,-76.04,26.35,-74.67,26.33,-70.12,26.35,-62.55,26.41,-60.14,26.41,-56.94,26.41,-53.42,26.41,-50.06,26.41,-73.74,26.41,-76.32,26.33,-75.19,26.31,-70.5,26.33,-62.4,26.41,-60.02,26.41,-56.85,26.41,-53.38,26.41,-50.06,26.41]},{"duration":60,"tweenEasing":0,"value":[-80.19,0,-81.42,0,-79.39,0,-74.42,0,-66.85,0,-64.36,0,-60.93,0,-57.13,0,-53.52,0,-79.59,0,-80.61,0,-78.59,0,-73.85,0,-66.7,0,-64.23,0,-60.84,0,-57.09,0,-53.52,0,-78.94,0,-79.74,0,-77.74,0,-73.24,0,-66.54,0,-64.09,0,-60.74,0,-57.04,0,-53.52,0,-78.41,0,-78.98,0,-76.99,0,-72.7,0,-66.41,0,-63.97,0,-60.66,0,-57,0,-53.52,0,-78.19,0,-78.49,0,-76.44,0,-72.3,0,-66.35,0,-63.91,0,-60.62,0,-56.98,0,-53.52,0,-78.08,0,-78.94,-0.02,-77.1,-0.03,-72.81,-0.02,-66.3,0,-63.86,0,-60.58,0,-56.96,0,-53.52,0,-77.82,0,-79.24,-0.04,-77.64,-0.05,-73.21,-0.04,-66.17,0,-63.74,0,-60.5,0,-56.93,0,-53.52,0,-77.49,0,-79.49,-0.06,-78.13,-0.08,-73.57,-0.06,-66,0,-63.6,0,-60.4,0,-56.88,0,-53.52,0,-77.2,0,-79.77,-0.08,-78.64,-0.1,-73.96,-0.08,-65.86,0,-63.47,0,-60.31,0,-56.84,0,-53.52]},{"value":[-82.78,-22.15,-84.01,-22.15,-81.98,-22.15,-77.01,-22.15,-69.44,-22.15,-66.95,-22.15,-63.52,-22.15,-59.72,-22.15,-56.11,-22.15,-82.19,-22.15,-83.2,-22.15,-81.18,-22.15,-76.44,-22.15,-69.3,-22.15,-66.82,-22.15,-63.43,-22.15,-59.68,-22.15,-56.11,-22.15,-81.53,-22.15,-82.33,-22.15,-80.33,-22.15,-75.84,-22.15,-69.13,-22.15,-66.68,-22.15,-63.34,-22.15,-59.63,-22.15,-56.11,-22.15,-81,-22.15,-81.57,-22.15,-79.58,-22.15,-75.29,-22.15,-69,-22.15,-66.56,-22.15,-63.25,-22.15,-59.59,-22.15,-56.11,-22.15,-80.79,-22.15,-81.08,-22.15,-79.03,-22.15,-74.9,-22.15,-68.95,-22.15,-66.51,-22.15,-63.21,-22.15,-59.58,-22.15,-56.11,-22.15,-80.68,-22.15,-81.53,-22.17,-79.69,-22.18,-75.4,-22.17,-68.89,-22.15,-66.45,-22.15,-63.17,-22.15,-59.56,-22.15,-56.11,-22.15,-80.41,-22.15,-81.84,-22.19,-80.23,-22.2,-75.8,-22.19,-68.76,-22.15,-66.33,-22.15,-63.09,-22.15,-59.52,-22.15,-56.11,-22.15,-80.09,-22.15,-82.09,-22.21,-80.72,-22.23,-76.17,-22.21,-68.6,-22.15,-66.19,-22.15,-62.99,-22.15,-59.47,-22.15,-56.11,-22.15,-79.79,-22.15,-82.36,-22.23,-81.23,-22.26,-76.55,-22.23,-68.45,-22.15,-66.06,-22.15,-62.9,-22.15,-59.43,-22.15,-56.11,-22.15]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_01","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-38.88,20.45,-41.55,20.45,-41.38,20.45,-38.67,20.45,-33.7,20.45,-33.13,20.45,-31.75,20.45,-30.05,20.45,-28.51,20.45,-38.37,20.45,-40.84,20.45,-40.68,20.45,-38.17,20.45,-33.57,20.45,-33.02,20.45,-31.67,20.45,-30.01,20.45,-28.51,20.45,-37.8,20.45,-40.09,20.45,-39.95,20.45,-37.65,20.45,-33.43,20.45,-32.89,20.45,-31.59,20.45,-29.97,20.45,-28.51,20.45,-37.34,20.45,-39.43,20.45,-39.3,20.45,-37.17,20.45,-33.31,20.45,-32.79,20.45,-31.52,20.45,-29.94,20.45,-28.51,20.45,-37.15,20.45,-39.01,20.45,-38.82,20.45,-36.83,20.45,-33.26,20.45,-32.74,20.45,-31.48,20.45,-29.92,20.45,-28.51,20.45,-37.06,20.45,-39.39,20.43,-39.4,20.42,-37.27,20.43,-33.22,20.45,-32.69,20.45,-31.44,20.45,-29.91,20.45,-28.51,20.45,-36.83,20.45,-39.66,20.41,-39.86,20.39,-37.62,20.41,-33.1,20.45,-32.59,20.45,-31.37,20.45,-29.87,20.45,-28.51,20.45,-36.54,20.45,-39.88,20.39,-40.29,20.37,-37.93,20.39,-32.96,20.45,-32.47,20.45,-31.29,20.45,-29.83,20.45,-28.51,20.45,-36.29,20.45,-40.12,20.37,-40.73,20.34,-38.26,20.37,-32.83,20.45,-32.36,20.45,-31.21,20.45,-29.79,20.45,-28.51,20.45]},{"duration":60,"tweenEasing":0,"value":[-38.88,0,-41.55,0,-41.38,0,-38.67,0,-33.7,0,-33.13,0,-31.75,0,-30.05,0,-28.51,0,-38.37,0,-40.84,0,-40.68,0,-38.17,0,-33.57,0,-33.02,0,-31.67,0,-30.01,0,-28.51,0,-37.8,0,-40.09,0,-39.95,0,-37.65,0,-33.43,0,-32.89,0,-31.59,0,-29.97,0,-28.51,0,-37.34,0,-39.43,0,-39.3,0,-37.17,0,-33.31,0,-32.79,0,-31.52,0,-29.94,0,-28.51,0,-37.15,0,-39.01,0,-38.82,0,-36.83,0,-33.26,0,-32.74,0,-31.48,0,-29.92,0,-28.51,0,-37.06,0,-39.39,-0.02,-39.4,-0.03,-37.27,-0.02,-33.22,0,-32.69,0,-31.44,0,-29.91,0,-28.51,0,-36.83,0,-39.66,-0.04,-39.86,-0.05,-37.62,-0.04,-33.1,0,-32.59,0,-31.37,0,-29.87,0,-28.51,0,-36.54,0,-39.88,-0.06,-40.29,-0.08,-37.93,-0.06,-32.96,0,-32.47,0,-31.29,0,-29.83,0,-28.51,0,-36.29,0,-40.12,-0.08,-40.73,-0.1,-38.26,-0.08,-32.83,0,-32.36,0,-31.21,0,-29.79,0,-28.51]},{"value":[-40.61,-16.19,-43.27,-16.19,-43.11,-16.19,-40.4,-16.19,-35.42,-16.19,-34.86,-16.19,-33.48,-16.19,-31.78,-16.19,-30.24,-16.19,-40.09,-16.19,-42.57,-16.19,-42.41,-16.19,-39.9,-16.19,-35.3,-16.19,-34.74,-16.19,-33.4,-16.19,-31.74,-16.19,-30.24,-16.19,-39.53,-16.19,-41.82,-16.19,-41.68,-16.19,-39.37,-16.19,-35.15,-16.19,-34.62,-16.19,-33.32,-16.19,-31.7,-16.19,-30.24,-16.19,-39.07,-16.19,-41.16,-16.19,-41.02,-16.19,-38.9,-16.19,-35.04,-16.19,-34.52,-16.19,-33.25,-16.19,-31.67,-16.19,-30.24,-16.19,-38.88,-16.19,-40.73,-16.19,-40.55,-16.19,-38.56,-16.19,-34.99,-16.19,-34.47,-16.19,-33.21,-16.19,-31.65,-16.19,-30.24,-16.19,-38.78,-16.19,-41.12,-16.21,-41.12,-16.21,-39,-16.21,-34.94,-16.19,-34.42,-16.19,-33.17,-16.19,-31.63,-16.19,-30.24,-16.19,-38.56,-16.19,-41.39,-16.23,-41.59,-16.24,-39.35,-16.23,-34.83,-16.19,-34.32,-16.19,-33.1,-16.19,-31.6,-16.19,-30.24,-16.19,-38.27,-16.19,-41.6,-16.25,-42.02,-16.27,-39.66,-16.25,-34.69,-16.19,-34.2,-16.19,-33.02,-16.19,-31.56,-16.19,-30.24,-16.19,-38.02,-16.19,-41.84,-16.27,-42.46,-16.29,-39.99,-16.27,-34.56,-16.19,-34.09,-16.19,-32.94,-16.19,-31.52,-16.19,-30.24,-16.19]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_02","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_03","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45]},{"duration":60,"tweenEasing":0,"value":[45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91]},{"value":[45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_04","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[87.4,20.52,81.1,20.52,74.81,20.51,68.51,20.51,62.21,20.5,55.91,20.5,49.61,20.5,43.31,20.49,37.01,20.49,87.4,20.52,81.1,20.52,74.8,20.51,68.5,20.51,62.2,20.5,55.9,20.5,49.61,20.5,43.31,20.49,37.01,20.49,87.39,20.52,81.09,20.52,74.8,20.51,68.5,20.51,62.2,20.5,55.9,20.5,49.6,20.5,43.3,20.49,37,20.49,87.39,20.52,81.09,20.52,74.79,20.51,68.49,20.51,62.19,20.5,55.9,20.5,49.6,20.5,43.3,20.49,37,20.49,87.38,20.52,81.08,20.52,74.79,20.51,68.49,20.51,62.19,20.5,55.89,20.5,49.59,20.5,43.29,20.49,36.99,20.49,87.38,20.52,81.08,20.52,74.78,20.51,68.48,20.51,62.18,20.5,55.89,20.5,49.59,20.5,43.29,20.49,36.99,20.49,87.37,20.52,81.07,20.52,74.78,20.51,68.48,20.51,62.18,20.5,55.88,20.5,49.58,20.5,43.28,20.49,36.98,20.49,87.37,20.52,81.07,20.52,74.77,20.51,68.47,20.51,62.17,20.5,55.88,20.5,49.58,20.5,43.28,20.49,36.98,20.49,87.36,20.52,81.06,20.52,74.77,20.51,68.47,20.51,62.17,20.5,55.87,20.5,49.57,20.5,43.27,20.49,36.97,20.49]},{"duration":60,"tweenEasing":0,"value":[87.4,0.07,81.1,0.07,74.81,0.07,68.51,0.06,62.21,0.06,55.91,0.05,49.61,0.05,43.31,0.05,37.01,0.04,87.4,0.07,81.1,0.07,74.8,0.07,68.5,0.06,62.2,0.06,55.9,0.05,49.61,0.05,43.31,0.05,37.01,0.04,87.39,0.07,81.09,0.07,74.8,0.07,68.5,0.06,62.2,0.06,55.9,0.05,49.6,0.05,43.3,0.05,37,0.04,87.39,0.07,81.09,0.07,74.79,0.07,68.49,0.06,62.19,0.06,55.9,0.05,49.6,0.05,43.3,0.05,37,0.04,87.38,0.07,81.08,0.07,74.79,0.07,68.49,0.06,62.19,0.06,55.89,0.05,49.59,0.05,43.29,0.05,36.99,0.04,87.38,0.07,81.08,0.07,74.78,0.07,68.48,0.06,62.18,0.06,55.89,0.05,49.59,0.05,43.29,0.05,36.99,0.04,87.37,0.07,81.07,0.07,74.78,0.07,68.48,0.06,62.18,0.06,55.88,0.05,49.58,0.05,43.28,0.05,36.98,0.04,87.37,0.07,81.07,0.07,74.77,0.07,68.47,0.06,62.17,0.06,55.88,0.05,49.58,0.05,43.28,0.05,36.98,0.04,87.36,0.07,81.06,0.07,74.77,0.07,68.47,0.06,62.17,0.06,55.87,0.05,49.57,0.05,43.27,0.05,36.97,0.04]},{"value":[87.4,-15.26,81.1,-15.27,74.81,-15.27,68.51,-15.27,62.21,-15.28,55.91,-15.28,49.61,-15.29,43.31,-15.29,37.01,-15.29,87.4,-15.26,81.1,-15.27,74.8,-15.27,68.5,-15.27,62.2,-15.28,55.9,-15.28,49.61,-15.29,43.31,-15.29,37.01,-15.29,87.39,-15.26,81.09,-15.27,74.8,-15.27,68.5,-15.27,62.2,-15.28,55.9,-15.28,49.6,-15.29,43.3,-15.29,37,-15.29,87.39,-15.26,81.09,-15.27,74.79,-15.27,68.49,-15.27,62.19,-15.28,55.9,-15.28,49.6,-15.29,43.3,-15.29,37,-15.29,87.38,-15.26,81.08,-15.27,74.79,-15.27,68.49,-15.27,62.19,-15.28,55.89,-15.28,49.59,-15.29,43.29,-15.29,36.99,-15.29,87.38,-15.26,81.08,-15.27,74.78,-15.27,68.48,-15.27,62.18,-15.28,55.89,-15.28,49.59,-15.29,43.29,-15.29,36.99,-15.29,87.37,-15.26,81.07,-15.27,74.78,-15.27,68.48,-15.27,62.18,-15.28,55.88,-15.28,49.58,-15.29,43.28,-15.29,36.98,-15.29,87.37,-15.26,81.07,-15.27,74.77,-15.27,68.47,-15.27,62.17,-15.28,55.88,-15.28,49.58,-15.29,43.28,-15.29,36.98,-15.29,87.36,-15.26,81.06,-15.27,74.77,-15.27,68.47,-15.27,62.17,-15.28,55.87,-15.28,49.57,-15.29,43.27,-15.29,36.97,-15.29]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_FACE.00","timeline":[{"name":"D_FACE.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_FACE.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_FACE.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_FACE.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_FACE.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_00","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-37.79,11.49,-49.02,8.09,-45.63,-0.43,-33.57,-0.96,-32.16,-2.97,-32.56,14.29,-42.99,9.8,-49.39,14.46,-49.06,10.51,-33.29,10.49,-35.29,9.83,-45.96,-20.14,-40.83,5.56,-37.82,11.51,-46.5,16.01,-47.35,14.9,-39.71,14.03,-31.08,2.68,-26.76,11.33,-34.76,17.96,-35.84,22.1,-36.69,5.56,-37.42,11.02,-28.89,6.96,-52.87,30.47,-37.48,16.93,-37.79,10.39,-37.79,11.5,-37.49,11.69,-37.28,11.28,-37.83,11.52,-37.8,11.5,-41.32,5.94,-38.49,9.07,-37.03,4.81,-42.91,11.18,-34.6,12.94,-30.49,11.4,-32.93,8.34,-37.95,10.19,-38.47,11.26,-40.75,12.47,-44.87,13.05,-49.22,14.16,-46.62,13.33,-46.11,13.22,-50.83,13.73,-44.84,14.96,-42.22,16.78,-41.48,4.2,-39.44,5.74,-38.4,-1.07,-33.88,9.33,-33.46,12.41,-35.42,11.2,-41.15,12.12,-41.1,14.51,-44.39,14.09,-29.77,7.35,-31.31,16.08,-35.52,13.64,-37.48,15.87,-43.92,16.07,-33.41,13.07,-47.03,15.94,-34.31,7.75,-34.1,12.56,-34.33,12.5,-37.28,7,-44.42,5.01,-38.93,7.89,-33.61,11.67,-41.84,6.44,-36.18,9.61,-34.95,11.09,-44.41,15.41,-48.45,14.71,-51.41,15.27,-46.2,15.87,-43.72,15.27,-40.94,15.6,-33.8,14.33,-47.47,0.8]},{"duration":60,"tweenEasing":0,"value":[-37.78,-0.01,-49.04,-3.41,-45.58,-11.93,-35.41,-11.92,-35.46,-5.14,-31.39,-4.33,-33.67,-5.39,-38.65,1.28,-54.46,-1.35,-37.79,-2.54,-32.45,-6.81,-37.75,-24.87,-33.92,-3.81,-37.83,0.01,-50.32,0.12,-39.53,0.87,-37.97,0.78,-33.27,-2.16,-27.03,0.17,-43.98,-3.87,-39.67,0.08,-33.16,-5.11,-37.36,-0.47,-29.15,-4.69,-54.25,5.86,-37.95,3.8,-37.87,0.24,-37.8,0,-37.8,-0.05,-37.2,-0.1,-37.85,0.02,-37.8,0,-41.26,-5.54,-40.58,-8.88,-40.3,-9.62,-46.09,-1.27,-44.06,-0.56,-36.85,-4.16,-38.3,-7.09,-41.62,-3.51,-41.8,-1.94,-44.83,-0.29,-36.81,-3.66,-41.66,0.78,-43.55,-2.39,-49.09,1.29,-47.69,-0.01,-37.98,2.52,-47.32,0.24,-39.51,-8.96,-39.38,-8.63,-32.42,-8.34,-31.97,-6.21,-33.99,-5.7,-34.85,-4.09,-35.43,-2.74,-34.37,-1.6,-35.45,-4.69,-30.06,-2.32,-32.04,0.66,-32.61,-1.06,-32.9,-0.51,-36.43,-1.58,-32.31,-0.84,-37.34,1.27,-32.14,-7.04,-32.61,-5.9,-33.15,-4.19,-35.69,-5.99,-41.78,-8.23,-42.04,-7.72,-39.92,-4.36,-41.85,-8.48,-41.27,-6.66,-39.72,-3.19,-34.44,-1.03,-40.7,-0.02,-45.64,1.08,-39.52,0.64,-34.41,-1.69,-35.18,-0.9,-31.23,-2.23,-44.36,-10.89]},{"value":[-37.78,-7.46,-49.04,-10.87,-45.58,-19.39,-35.48,-19.39,-35.32,-12.62,-27.05,-18.49,-33.81,-15.51,-39.05,-9.66,-50.9,-13.28,-38.92,-13.21,-32.75,-17.07,-37.8,-32.25,-33.91,-11.27,-37.83,-7.45,-49.78,-7.31,-40.05,-8.97,-37.82,-7.76,-32.68,-15.95,-26.94,-7.12,-45.83,-13.64,-39.89,-9.92,-33.21,-12.84,-37.4,-7.82,-29.21,-12.13,-53.22,-2.19,-38.2,-5.29,-37.69,-7.16,-37.8,-7.46,-37.85,-7.32,-37.28,-7.5,-37.85,-7.44,-37.8,-7.46,-41.25,-13,-41.63,-19.27,-44.66,-24.18,-45.82,-13.44,-43.07,-10.8,-39.08,-15.49,-41.75,-18.75,-43.76,-14.86,-42.65,-13.45,-46.16,-13.11,-30.33,-18.89,-43.41,-7.26,-38.14,-16.35,-48.7,-8.72,-38.66,-14.34,-48.51,-7.87,-47.22,-8.12,-40.58,-19.87,-43.68,-22.15,-33.41,-16.21,-32.04,-15.4,-34.9,-15.83,-36.35,-14.85,-31.68,-17.48,-33.81,-12.17,-30.68,-19.66,-28.23,-12.82,-28.11,-14.78,-30.35,-11.26,-29.07,-14.31,-31.69,-16.34,-28.87,-15.47,-37.63,-8.39,-33.81,-15.61,-34.34,-16.2,-34.74,-14.1,-38.04,-16.97,-45.06,-18.91,-45.64,-19.44,-41.49,-14.5,-45.38,-19.92,-43.48,-16.83,-40.93,-13.86,-33.06,-11.77,-37.2,-10.84,-40.8,-11.67,-35.67,-10.71,-30.15,-14.86,-30.6,-15.59,-27.41,-16.56,-48.86,-22.21]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_01","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-18.9,11.5,-24.5,9.8,-22.84,5.54,-15.87,5,-14.43,-0.4,-16.87,16.45,-26.15,12.5,-30.06,13.82,-27.01,11.19,-14.39,11.76,-17.12,16.43,-25.36,-9.41,-23.87,7.46,-18.91,11.51,-25.23,11.69,-27.58,14.47,-20.73,13.64,-14.45,3.76,-13.24,11.25,-17.96,11.38,-18.17,14.82,-18.39,8.12,-18.74,11.25,-14.31,9.31,-31.79,17.74,-18.5,15.03,-18.86,10.27,-18.89,11.5,-18.59,11.71,-18.68,11.33,-18.9,11.5,-18.9,11.5,-20.69,8.72,-17.34,10.53,-19.9,4.94,-19.87,11.82,-14.3,12.79,-14.65,10.92,-18.1,6.78,-20.17,10.24,-18.43,11.38,-20.06,12.19,-27.32,13.18,-28.39,13.77,-27.87,12.39,-25.03,12.15,-28.71,12.89,-25.85,13.7,-19.86,12.83,-21.29,12.94,-22.34,6.64,-24.14,-4.36,-18.98,8.39,-15.16,14.62,-17.13,15.8,-23.44,13.5,-23.91,15.31,-27.1,13.45,-14.74,8.51,-15.3,15.75,-19.22,14.17,-21.03,16.12,-26.57,14.73,-17.26,13.49,-28.36,15.31,-21.48,7.44,-18.66,12.31,-16.89,16.3,-18.14,12.12,-24.4,8.28,-20.5,9.2,-15.38,12.58,-21.78,8.55,-18.14,10.81,-16.82,11.41,-27.19,15.5,-29.83,14.72,-30.32,14.3,-27.73,15.13,-26.51,15.26,-23.78,16.05,-18.18,15.44,-27.02,5.82]},{"duration":60,"tweenEasing":0,"value":[-18.89,0,-24.52,-1.71,-22.79,-5.97,-17.71,-5.96,-17.73,-2.57,-15.69,-2.16,-16.84,-2.7,-19.33,0.64,-27.23,-0.67,-18.89,-1.27,-16.23,-3.41,-18.88,-12.43,-16.96,-1.9,-18.91,0,-25.16,0.06,-19.77,0.43,-18.99,0.39,-16.63,-1.08,-13.52,0.08,-21.99,-1.94,-19.83,0.04,-16.58,-2.56,-18.68,-0.23,-14.58,-2.35,-27.13,2.93,-18.98,1.9,-18.94,0.12,-18.9,0,-18.9,-0.03,-18.6,-0.05,-18.93,0.01,-18.9,0,-20.63,-2.77,-20.29,-4.44,-20.15,-4.81,-23.04,-0.63,-22.03,-0.28,-18.42,-2.08,-19.15,-3.55,-20.81,-1.75,-20.9,-0.97,-22.42,-0.15,-18.41,-1.83,-20.83,0.39,-21.77,-1.2,-24.54,0.64,-23.85,0,-18.99,1.26,-23.66,0.12,-19.75,-4.48,-19.69,-4.31,-16.21,-4.17,-15.99,-3.11,-17,-2.85,-17.43,-2.05,-17.71,-1.37,-17.18,-0.8,-17.72,-2.35,-15.03,-1.16,-16.02,0.33,-16.3,-0.53,-16.45,-0.25,-18.22,-0.79,-16.16,-0.42,-18.67,0.64,-16.07,-3.52,-16.31,-2.95,-16.57,-2.1,-17.85,-2.99,-20.89,-4.12,-21.02,-3.86,-19.96,-2.18,-20.92,-4.24,-20.64,-3.33,-19.86,-1.59,-17.22,-0.51,-20.35,-0.01,-22.82,0.54,-19.76,0.32,-17.21,-0.85,-17.59,-0.45,-15.61,-1.11,-22.18,-5.45]},{"value":[-18.89,-7.46,-24.52,-9.16,-22.79,-13.42,-17.77,-13.43,-17.59,-10.05,-11.36,-16.33,-16.97,-12.81,-19.72,-10.3,-27.12,-11.97,-20.02,-11.93,-16.52,-13.66,-18.92,-19.81,-16.95,-9.37,-18.92,-7.45,-24.62,-7.37,-20.28,-9.41,-18.84,-8.15,-16.05,-14.86,-13.42,-7.21,-23.85,-11.7,-20.06,-9.96,-16.63,-10.28,-18.72,-7.58,-14.64,-9.78,-26.09,-5.12,-19.22,-7.2,-18.76,-7.28,-18.9,-7.46,-18.95,-7.29,-18.68,-7.45,-18.92,-7.45,-18.9,-7.46,-20.62,-10.22,-21.34,-14.83,-24.51,-19.36,-22.78,-12.81,-22.34,-9.89,-20.66,-13.41,-21.96,-16.17,-22.95,-13.11,-22.08,-12.8,-27.96,-12.96,-11.92,-17.92,-22.57,-7.65,-16.8,-16.43,-24.16,-9.37,-14.39,-14.76,-15.26,-8.27,-23.56,-8.24,-20.83,-15.39,-23.99,-17.83,-17.2,-12.04,-16.05,-12.29,-17.9,-12.98,-18.6,-11.84,-13.97,-16.11,-16.63,-11.37,-12.96,-17.31,-13.2,-11.66,-12.1,-15.11,-14.05,-10.72,-12.61,-14.06,-13.47,-15.55,-12.71,-15.05,-18.96,-9.03,-17.74,-12.09,-18.04,-13.25,-17.19,-11.36,-19.55,-14.29,-24.17,-14.79,-24.63,-15.58,-21.53,-12.32,-24.46,-15.69,-22.52,-14.14,-21.07,-12.26,-15.84,-11.26,-17.71,-11.26,-19.28,-11.79,-16.34,-11.03,-12.95,-14.02,-13.01,-15.14,-11.8,-15.45,-26.68,-16.76]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_02","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.01,11.5,0.02,11.5,-0.05,11.5,1.84,10.96,3.3,2.17,-1.17,18.62,-9.32,15.19,-10.74,13.17,0.22,11.86,4.5,13.03,-2.84,16.64,-6.48,3.02,-6.91,9.37,0.01,11.5,-0.07,11.63,-7.82,14.04,-1.74,13.26,2.19,4.84,0.28,11.16,4.03,13.31,1.66,14.78,-1.81,10.68,-0.05,11.49,0.26,11.65,-4.67,14.81,0.47,13.12,0.08,10.15,0.01,11.5,0.31,11.74,-0.08,11.38,0.02,11.49,0.01,11.5,-0.06,11.49,2.95,14.97,0.25,9.75,3.17,12.45,7.72,13.07,3.77,13,1.05,10.32,0.65,11.99,2.47,12.35,2.36,12.33,-8.92,15.01,-7.56,13.38,-6.1,13.59,-0.48,11.51,-4.87,12.89,-6.86,12.44,3.8,12.71,-1.54,17.42,-2.65,10.96,-7.93,-0.19,-4.93,4.47,0.53,14.28,-1,15.29,-5.72,14.87,-6.73,16.11,-9.38,15.8,0.29,9.67,0.72,15.42,-2.91,14.71,-4.58,16.37,-8.35,15.52,-1.1,13.91,-9.69,14.67,-7.35,4.57,-6.25,6.95,-1.61,15.85,-0.29,15.12,-3.51,12.39,0.52,13.06,4.58,14.76,-0.86,12.79,2.5,14.13,3.04,13,-9.97,16.02,-9.48,14.73,-7.49,13.76,-7.97,14.81,-9.31,16.11,-6.19,16.5,-2.57,16.55,-4.84,11.26]},{"duration":60,"tweenEasing":0,"offset":165},{"offset":1,"value":[-7.45,0,-7.45,0,-7.46,-0.06,-7.47,0.14,-7.48,4.33,-14.16,-0.13,-10.12,-0.4,-10.94,0.11,-11.3,-1.13,-10.66,-0.3,-10.25,-0.05,-7.38,0.01,-7.46,0,-7.45,0.54,-7.43,-0.51,-9.84,0.15,-8.54,0.58,-13.78,0.1,-7.29,-1.86,-9.77,-0.22,-10,-0.06,-7.73,-0.04,-7.35,-0.06,-7.44,1.04,-8.05,-0.25,-9.1,0.18,-7.4,0,-7.46,-0.05,-7.26,-0.07,-7.39,0.01,-7.46,0,-7.46,0.01,-7.45,-1.05,-10.39,-4.36,-14.55,0.26,-12.17,-0.31,-9.61,-2.23,-11.33,-2.81,-12.62,-2.14,-11.36,-1.18,-11.83,-5.54,-12.82,6.49,-16.09,-1.74,-8.04,4.97,-15.23,0.39,-10.01,9.46,-14.76,3.72,-9.53,0.1,-8.36,-1.08,-10.91,-4.3,-13.52,-1,-7.87,-0.07,-9.18,-0.91,-10.13,-1.17,-9.8,3.74,-14.74,0.56,-10.58,4.76,-14.96,1.83,-10.5,3.92,-15.44,2.25,-10.19,3.84,-13.81,4.75,-14.76,3.45,-14.63,-0.29,-9.67,-1.67,-8.57,-1.73,-10.31,-0.62,-9.27,-1.7,-11.3,-3.28,-10.68,-3.61,-11.72,-1.57,-10.14,-3.53,-11.45,-1.88,-10.81,-1.21,-10.67,1.38,-10.75,2.64,-11.25,3.54,-12.33,3.42,-11.34,4.26,-13.17,4.58,-14.69,3.82,-14.33,-4.5,-11.32]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_03","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[23.32,11.43,22.98,11.55,16.18,12.07,19.83,9.35,25.73,-17.73,21.67,14.78,15.22,10.73,12.61,11.5,25.52,11.21,29.03,12.43,18.92,17.15,13.47,-0.22,19.93,5.74,26.89,9.55,28.82,14.08,14.33,13.2,17.24,12.31,21.68,2.5,25.18,6.72,26.45,13.26,24.49,14.98,20.86,9.96,25.52,9.32,27.64,8.52,22.39,14.28,24.21,14.22,26.79,5.48,23.24,11.43,29.6,11.19,25.6,9.9,26.47,9.82,23.12,11.45,24.28,13.03,24.78,14.81,23.74,8.94,34.71,14.14,39.84,14.42,30.47,13.65,24.69,9.5,30.14,13.53,35.15,14.21,32.16,12.84,16.91,12,19.76,12.97,21.68,10.89,27.74,11.28,22.16,11.8,19.6,11.61,26.75,12.68,21.47,20.2,21.12,11.2,12.25,-1.23,15.83,3.81,22.33,14.17,21.52,17.06,18.27,12.34,16.31,13.42,15.58,13.53,21.5,7.73,21,15.27,19.96,14.63,17.64,15.33,15.36,13.13,20.72,11.61,13.31,13.19,13.27,3.57,14.7,7.12,20.18,17.47,23.27,16.41,19.97,12.09,24.26,12.7,31.02,16.18,22.73,12.44,25.94,13.79,31.45,14.87,14.22,13.33,14.39,13.12,17.2,12.53,16.04,12.6,15.02,13.15,16.75,13.79,19.68,14.67,18.21,11.05]},{"duration":60,"tweenEasing":0,"value":[23.33,-0.08,22.96,0.04,16.23,0.57,17.99,-1.61,22.43,-19.9,22.84,-3.84,24.53,-4.46,23.35,-1.67,27.73,-0.97,24.53,-0.6,21.77,0.51,19.95,-3.24,26.84,-3.63,26.88,-1.95,28.89,2.45,22.15,-0.84,18.98,-0.94,19.5,-2.34,24.9,-4.44,22.42,-0.05,22.83,0.2,22.67,-0.72,25.58,-2.17,27.38,-3.14,27.06,-0.53,23.74,1.1,26.72,-4.67,23.23,-0.07,29.29,-0.55,25.67,-1.49,26.45,-1.68,23.11,-0.06,24.34,1.54,21.83,-0.16,23.49,-0.81,31.54,1.69,32.11,1.35,26.7,0.65,23.65,-0.83,29.49,1.54,32.68,1.86,31.58,0.98,23.4,-2.21,27.32,-0.4,25.83,-2.06,28.55,-0.23,25.57,-0.77,26.46,-0.83,22.94,-0.03,23.01,2.78,23.77,0.24,20.18,-1.04,20.76,-0.66,21.79,-0.11,22.52,1.76,23.99,-2.53,23.04,-2.69,25.28,-3.39,21.22,-1.94,20.28,-0.15,22.87,-0.07,22.22,-1.05,23.38,-2.71,21.82,-2.3,23,-1.48,20.63,-0.99,20.95,0.17,21.79,1.63,23.56,1.3,23.48,-0.3,23.74,-0.36,26.44,1.42,23.59,-0.34,23.44,-0.34,28.41,1.87,23.05,-2.05,21.44,-0.49,22.59,-0.6,23.2,-1.73,24.33,-3.44,23.27,-2.07,22.25,-1.88,23.05,-0.21]},{"value":[23.33,-7.53,22.96,-7.41,16.23,-6.89,14.36,-14.83,20.63,-28.34,27.18,-18,24.4,-14.58,22.95,-12.61,27.84,-12.27,23.4,-11.27,21.47,-9.74,19.9,-10.62,26.85,-11.09,26.88,-9.41,29.43,-4.98,21.64,-10.68,19.13,-9.48,20.08,-16.13,25,-11.73,20.56,-9.82,22.61,-9.8,22.61,-8.45,25.54,-9.52,27.32,-10.57,28.09,-8.58,23.49,-8,26.89,-12.08,23.23,-7.53,29.24,-7.82,25.6,-8.88,26.45,-9.14,23.11,-7.51,24.35,-5.91,20.78,-10.55,19.13,-15.37,31.8,-10.48,31.8,-8.25,24.47,-10.69,20.84,-13.45,27.36,-9.82,31.5,-9.96,26.04,-11.84,29.88,-18.3,25.58,-8.45,28.54,-15.85,28.94,-10.24,32.28,-14.56,30.18,-10.36,23.04,-8.39,21.94,-8.12,19.48,-13.28,19.19,-8.91,20.7,-9.84,20.89,-10.24,21.35,-8.04,27.74,-17.27,23.59,-13.27,30.05,-18.35,22.72,-13.72,22.9,-16.54,25.13,-10.27,26.06,-14.85,27.81,-16.84,24.4,-16.08,22.71,-11.14,18.96,-9.56,19.21,-10.13,21.18,-7.64,21.86,-10,20.2,-10.98,20.13,-12.09,24.87,-8.72,20.05,-11.79,21.56,-11.16,27.2,-8.8,25.89,-13.76,24.57,-12.21,26.78,-13.25,26.62,-13.08,29.24,-17.09,27.85,-16.77,25.64,-16.01,18.55,-11.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_04","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[46.65,11.35,45.93,11.59,32.41,12.64,37.82,7.73,48.16,-37.63,44.51,10.94,39.75,6.27,35.96,9.83,50.83,10.56,53.56,11.83,40.69,17.66,33.42,-3.46,46.76,2.11,53.76,7.59,57.7,16.53,36.48,12.36,36.22,11.37,41.18,0.15,50.08,2.28,48.88,13.2,47.33,15.19,43.52,9.24,51.1,7.15,55.02,5.38,49.45,13.75,47.96,15.32,53.51,0.81,46.47,11.36,58.89,10.63,51.27,8.41,52.92,8.14,46.22,11.39,48.62,14.57,45.74,15.92,45.93,9.83,66.25,15.83,67.19,15.77,56.75,14.29,49.64,10.8,58.77,15.5,65.67,16.07,61.96,13.34,42.74,8.99,47.08,12.57,49.45,8.2,55.97,11.04,49.2,10.72,46.05,10.78,49.69,12.65,44.49,22.99,44.03,12.29,32.44,-2.27,36.59,3.15,44.12,14.06,44.04,18.82,42.27,9.81,39.34,10.72,40.54,11.27,42.72,5.79,41.28,15.13,42.83,14.56,39.85,14.28,39.06,10.73,42.54,9.31,36.32,11.72,33.9,2.58,35.65,7.29,41.98,19.1,46.83,17.71,43.45,11.79,47.13,12.76,57.03,18.02,46.32,12.1,48.95,14.3,58.99,17.16,38.4,10.63,38.27,11.52,41.89,11.3,40.05,10.38,39.35,10.19,39.7,11.07,41.94,12.79,41.25,10.84]},{"duration":60,"tweenEasing":0,"value":[46.65,-0.15,45.91,0.08,32.46,1.13,35.98,-3.23,44.86,-39.8,45.68,-7.68,49.06,-8.92,46.7,-3.34,55.47,-1.94,49.06,-1.21,43.53,1.02,39.91,-6.49,53.67,-7.26,53.75,-3.91,57.78,4.91,44.29,-1.68,37.96,-1.89,39,-4.69,49.8,-8.88,44.84,-0.11,45.66,0.41,45.33,-1.44,51.15,-4.33,54.75,-6.28,54.11,-1.06,47.48,2.2,53.43,-9.35,46.47,-0.14,58.58,-1.11,51.35,-2.97,52.9,-3.35,46.22,-0.11,48.68,3.08,43.65,-0.33,46.98,-1.63,63.08,3.38,64.22,2.7,53.41,1.29,47.29,-1.65,58.99,3.08,65.36,3.73,63.17,1.97,46.8,-4.42,54.64,-0.81,51.66,-4.11,57.1,-0.46,51.15,-1.53,52.92,-1.66,45.88,-0.06,46.02,5.57,47.55,0.48,40.37,-2.08,41.53,-1.32,43.58,-0.22,45.05,3.53,47.99,-5.06,46.08,-5.38,50.56,-6.77,42.43,-3.88,40.55,-0.3,45.74,-0.15,44.44,-2.09,46.77,-5.43,43.64,-4.6,46.01,-2.95,41.25,-1.98,41.89,0.34,43.59,3.26,47.12,2.59,46.96,-0.6,47.48,-0.72,52.87,2.84,47.18,-0.68,46.88,-0.69,56.82,3.73,46.1,-4.1,42.88,-0.97,45.18,-1.19,46.4,-3.47,48.66,-6.87,46.54,-4.15,44.51,-3.77,46.09,-0.43]},{"value":[46.65,-7.61,45.91,-7.37,32.46,-6.33,28.79,-22.2,41.11,-49.2,50.02,-21.84,48.93,-19.04,46.3,-14.29,55.57,-13.24,47.93,-11.87,43.24,-9.23,39.86,-13.86,53.69,-14.72,53.75,-11.36,58.32,-2.53,43.78,-11.52,38.11,-10.43,39.58,-18.47,49.9,-16.17,42.99,-9.88,45.44,-9.59,45.27,-9.17,51.11,-11.69,54.69,-13.71,55.15,-9.11,47.24,-6.9,53.61,-16.75,46.47,-7.6,58.53,-8.37,51.27,-10.37,52.9,-10.81,46.22,-7.57,48.69,-4.37,42.6,-10.72,42.62,-16.18,63.34,-8.79,63.91,-6.9,51.17,-10.04,44.49,-14.28,56.85,-8.28,64.18,-8.1,57.63,-10.85,53.28,-20.51,52.9,-8.85,52.1,-16.47,57.49,-10.47,55.1,-14.37,56.64,-11.19,45.98,-8.42,44.95,-5.34,43.25,-13.04,39.37,-9.95,41.46,-10.51,42.68,-10.35,43.87,-6.27,51.73,-19.79,46.63,-15.96,55.33,-21.73,43.61,-16.93,41.88,-17.65,48,-10.34,48.27,-15.9,50.87,-18.91,45.36,-17.53,45.72,-12.62,39.58,-10.55,40.16,-9.96,42.97,-6.01,45.42,-8.71,43.67,-11.28,43.87,-12.45,51.31,-7.3,43.64,-12.13,45,-11.5,55.6,-6.93,50.4,-16.77,46.5,-13.18,50.02,-14.16,49.82,-14.81,54.22,-21,51.12,-18.84,47.46,-17.68,41.59,-11.74]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE.02","timeline":[{"name":"B_EYE.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EYE.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EYE.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_00","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-52.74,-61.09,-47.31,-71.89,-41.9,-82.55,-37.05,-91.26,-33.28,-93.7,-30.47,-91.99,-31.91,-97.6,-35.12,-106.7,-38.36,-115.71,-49.03,-54.33,-44.71,-65.75,-40.46,-76.98,-36.28,-86.39,-33.55,-89.25,-32.35,-88.44,-34.34,-94.48,-37.49,-104.26,-40.58,-114.07,-45.51,-47.43,-42.26,-59.48,-39.09,-71.32,-35.54,-81.41,-33.78,-84.75,-34.13,-84.86,-36.64,-91.36,-39.65,-101.88,-42.53,-112.56,-43.87,-38.7,-41.64,-51.37,-39.63,-63.78,-37.07,-74.16,-36.09,-78.42,-37.07,-80.32,-39.19,-88.31,-40.61,-100.04,-42.31,-112.05,-39.76,-29.56,-38.5,-43.17,-37.72,-56.36,-36.95,-66.31,-37.42,-71.5,-38.29,-75.87,-39.43,-85.76,-39.68,-98.18,-40.37,-110.79,-33.97,-21.42,-32.88,-36.21,-32,-50.5,-32.66,-60.17,-34.91,-66.39,-36,-73.34,-36.62,-84.69,-37.07,-97.23,-37.6,-109.81,-29.13,-16.1,-28.93,-30.67,-28.73,-44.74,-30.05,-54.78,-32.92,-62.63,-34.53,-71.65,-35.19,-83.3,-35.87,-96.14,-36.44,-109.1,-21.81,-11.33,-23.13,-25.37,-24.42,-39.05,-26.04,-49.97,-27.57,-59.2,-28.44,-69.49,-29.34,-80.95,-30.44,-94.51,-31.23,-108.36,-14.16,-6.47,-17.01,-20.01,-19.82,-33.41,-21.83,-45.13,-22.79,-55.63,-23.7,-67.1,-24.59,-78.45,-25.01,-92.83,-25.38,-107.69]},{"duration":60,"tweenEasing":0,"value":[-23.25,-50.24,-16.58,-61.4,-10.02,-72.37,-4.47,-81.71,-0.2,-87.63,2.82,-87.09,1.58,-91.96,-1.63,-103.06,-4.87,-114.24,-21.99,-45.85,-16.48,-57.59,-11.07,-69.02,-5.43,-78.64,-1.55,-84.26,0.41,-84.64,-1.51,-90.19,-4.23,-101.43,-6.95,-112.89,-20.77,-41.4,-16.33,-53.77,-11.94,-65.74,-6.16,-75.66,-2.65,-80.96,-1.73,-82.24,-4.33,-88.46,-6.61,-99.88,-8.82,-111.63,-19.6,-36.12,-16.13,-48.82,-12.61,-61.05,-7.18,-70.86,-3.89,-76,-3.26,-78.27,-5.78,-86.09,-7.17,-98.47,-8.6,-111.2,-14.22,-31.27,-11.79,-43.33,-9.34,-54.82,-5.5,-63.56,-3.63,-69.32,-3.17,-73.33,-4.65,-83.39,-5.06,-96.61,-5.73,-110.01,-5.75,-27.44,-4,-39.25,-2,-50.49,0.29,-58.57,-0.11,-65.5,-0.65,-71.88,-1.61,-83.36,-2.21,-96.09,-2.86,-108.83,-1.59,-26.33,-1.11,-37.52,-0.3,-48.23,0.64,-56.48,-1.58,-64.61,-3.44,-72.99,-3.55,-84.27,-2.39,-96.3,-1.8,-108.36,1.87,-26.8,0.76,-37.26,-0.07,-47.43,-0.14,-56.05,-1.2,-64.44,-1.78,-73.72,-1.58,-83.89,-0.91,-95.33,-0.4,-106.98,5.57,-27.31,2.82,-37.02,0.27,-46.76,-0.9,-55.67,-1.38,-64.25,-1.27,-74.37,-0.61,-83.38,0.24,-94.26,1.06,-105.48]},{"value":[-34.25,-40.88,-23.36,-55.57,-12.23,-69.88,-1.1,-81.3,6.26,-88.53,12.24,-86.98,11.58,-91.29,8.36,-103.66,5.12,-116.22,-26.51,-37.57,-16.97,-52.32,-7.42,-66.53,2.77,-78,10.31,-84.3,15.35,-84.09,13.37,-89.14,9.41,-101.38,5.54,-113.96,-19.3,-34.13,-10.97,-48.99,-2.82,-63.26,6.54,-74.78,14.22,-80.12,18.31,-81.24,15.03,-87.03,10.39,-99.18,5.91,-111.81,-15.97,-29.9,-9,-44.52,-2.28,-58.47,5.97,-69.59,13.62,-74.51,17.49,-77.01,14.23,-84.67,10.4,-97.47,6.53,-110.82,-6.97,-27.75,-2.04,-41.01,2.52,-53.4,8.66,-63,13.92,-68.56,17.13,-72.65,15.27,-82.6,13.2,-95.79,10.77,-109.33,4.28,-26.63,8.19,-39.01,12.27,-50.73,16.7,-59.09,18.53,-65.7,20.07,-71.82,18.92,-83.12,17.07,-95.47,15.01,-107.84,8.29,-27.92,10.77,-39.49,13.16,-50.52,15.65,-58.81,15.33,-65.64,15.37,-72.73,15.39,-83.88,16.21,-95.49,16.09,-107.13,11.32,-31.07,13.21,-41.73,14.95,-52.11,16.12,-60.58,16.06,-66.69,16.49,-73.7,16.72,-83.5,17.1,-94.13,17.07,-104.9,14.55,-34.3,15.97,-44.02,17.27,-53.76,17.09,-62.37,16.61,-67.75,16.73,-74.67,17.28,-83.05,17.71,-92.64,18.07,-102.47]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_01","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-43.45,-37.3,-41.35,-42.52,-39.22,-47.7,-37.15,-51.74,-35.51,-51.21,-34.22,-49.78,-35.03,-52.95,-36.64,-56.51,-38.26,-59.92,-42.22,-31.36,-40.05,-37.52,-37.89,-43.62,-36.34,-48.37,-35.34,-48.22,-34.91,-47.01,-35.91,-50.32,-37.71,-54.67,-39.43,-58.96,-41.02,-25.39,-38.82,-32.45,-36.67,-39.44,-35.65,-44.86,-35.24,-45.15,-35.64,-44.23,-36.8,-47.7,-38.68,-52.87,-40.46,-58.07,-40.23,-19.1,-38.43,-26.69,-36.91,-34.16,-36.69,-39.97,-36.93,-41.27,-37.81,-41.62,-38.62,-45.75,-39.35,-51.71,-40.34,-57.78,-36.98,-13.75,-36.09,-21.72,-35.76,-29.53,-36.68,-35.21,-38,-37.61,-39.04,-40.04,-39.42,-44.95,-39.47,-50.99,-39.84,-57.12,-33.61,-8.91,-33,-17.3,-32.82,-25.51,-34.56,-31.01,-36.88,-34.32,-37.98,-38.63,-38.14,-44.29,-38.29,-50.49,-38.5,-56.73,-30.67,-4.27,-30.44,-12.97,-30.38,-21.45,-32.13,-27.3,-34.07,-31.78,-34.91,-37.29,-35.56,-43.33,-36.94,-49.76,-37.87,-56.25,-25.08,0.74,-25.71,-8.62,-26.44,-17.73,-28.01,-24.47,-29.08,-30.17,-29.74,-36.48,-30.77,-42.7,-32.27,-49.41,-33.36,-56.21,-19.27,5.85,-20.75,-4.22,-22.29,-14.04,-23.72,-21.69,-24.43,-28.59,-25.4,-35.68,-26.62,-42.1,-27.46,-49.11,-28.24,-56.29]},{"duration":60,"tweenEasing":0,"value":[-11.63,-25.12,-8.29,-30.7,-5.01,-36.19,-2.24,-40.86,-0.1,-43.82,1.41,-43.54,0.79,-45.98,-0.82,-51.53,-2.44,-57.12,-10.99,-22.92,-8.24,-28.79,-5.54,-34.52,-2.72,-39.32,-0.78,-42.14,0.21,-42.33,-0.75,-45.1,-2.12,-50.72,-3.48,-56.44,-10.39,-20.7,-8.16,-26.87,-5.97,-32.88,-3.08,-37.83,-1.32,-40.48,-0.86,-41.12,-2.16,-44.23,-3.3,-49.94,-4.41,-55.82,-9.8,-18.06,-8.07,-24.4,-6.31,-30.54,-3.59,-35.43,-1.95,-37.99,-1.63,-39.13,-2.91,-43.02,-3.59,-49.22,-4.3,-55.6,-7.11,-15.63,-5.89,-21.65,-4.67,-27.42,-2.76,-31.77,-1.82,-34.65,-1.59,-36.67,-2.35,-41.67,-2.53,-48.29,-2.87,-55.01,-2.87,-13.72,-2,-19.62,-1,-25.24,0.14,-29.28,-0.06,-32.75,-0.33,-35.94,-0.81,-41.68,-1.1,-48.05,-1.43,-54.41,-0.8,-13.17,-0.55,-18.76,-0.15,-24.12,0.32,-28.25,-0.79,-32.3,-1.72,-36.49,-1.78,-42.14,-1.2,-48.15,-0.9,-54.18,0.94,-13.4,0.38,-18.62,-0.04,-23.73,-0.07,-28.03,-0.6,-32.22,-0.89,-36.86,-0.79,-41.94,-0.45,-47.67,-0.2,-53.49,2.79,-13.66,1.41,-18.51,0.13,-23.38,-0.45,-27.83,-0.69,-32.12,-0.63,-37.19,-0.31,-41.69,0.12,-47.13,0.53,-52.74]},{"value":[-13.29,-19.09,-6.29,-27.99,0.89,-36.37,8.04,-41.72,12.03,-45.38,14.13,-43.49,13.12,-45.31,11.51,-52.13,9.89,-59.1,-9.42,-17.36,-2.09,-26.14,5.29,-34.45,12.51,-39.84,17.01,-42.98,18.65,-42.25,15.89,-44.47,12.5,-50.65,9.32,-57.03,-5.82,-15.57,1.84,-24.27,9.46,-32.56,16.73,-38,21.72,-40.6,22.89,-40.99,18.43,-43.63,13.45,-49.27,8.81,-55.12,-3.84,-13.75,3.5,-22.1,10.7,-30.05,17.47,-35.36,22.4,-37.59,23.41,-38.85,18.72,-42.54,13.95,-48.44,9.33,-54.58,2.47,-13.11,8.29,-20.32,13.87,-27.08,18.99,-31.73,21.93,-34.42,22.66,-36.5,19.89,-41.38,17,-47.6,13.97,-53.99,9.48,-12.99,14.23,-19.23,18.92,-25.12,22.57,-29.27,23.07,-32.69,23.13,-35.9,22.02,-41.53,20.44,-47.46,18.6,-53.4,12.08,-14.75,16,-20.22,20.17,-25.5,22.69,-29.57,21.99,-33,21.46,-36.56,21.12,-42.05,20.41,-47.51,19.32,-52.95,15.94,-17.67,18.41,-22.39,21,-27.02,22.27,-31.09,21.96,-33.82,21.88,-37,21.68,-41.74,20.73,-46.56,19.6,-51.41,20.1,-20.64,21.04,-24.58,21.91,-28.6,21.87,-32.62,21.64,-34.62,21.7,-37.4,21.7,-41.36,20.85,-45.51,19.87,-49.73]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_02","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-38.49,-9.33,-38.19,-8.72,-37.91,-8.15,-37.86,-7.66,-38.16,-4,-38.46,-0.35,-38.49,0,-38.49,0,-38.49,0,-36.04,-6.67,-36.78,-6.54,-37.6,-6.41,-37.85,-6.11,-38.15,-3.42,-38.44,-0.72,-38.41,-0.4,-38.21,-0.21,-38.01,0,-33.74,-3.92,-35.44,-4.29,-37.25,-4.63,-37.76,-4.52,-38.07,-2.79,-38.37,-1.06,-38.3,-0.77,-37.91,-0.4,-37.52,0,-33.51,-0.61,-35.19,-1.84,-36.85,-2.96,-37.21,-3.1,-37.66,-2.12,-38.1,-1.15,-38.1,-1.02,-37.89,-0.87,-37.51,-0.71,-37.29,3.49,-37.76,0.9,-38.35,-1.43,-38.09,-1.82,-38.47,-1.54,-38.84,-1.26,-38.82,-1.37,-38.49,-1.84,-37.89,-2.33,-42.2,9.27,-41.11,5.04,-40.03,1.16,-38.98,0.19,-39.28,-0.54,-39.59,-1.27,-39.36,-1.57,-38.34,-2.45,-37.16,-3.4,-38.93,14.47,-37.82,9.25,-36.88,4.45,-36,3.13,-36.31,1.25,-36.62,-0.62,-36.34,-1.23,-35.13,-2.6,-33.91,-4.06,-30.27,18.89,-29.44,12.98,-28.76,7.53,-28.26,5.88,-28.35,2.6,-28.44,-0.69,-28.23,-1.42,-27.41,-2.85,-26.56,-4.38,-21.39,23.33,-20.79,16.7,-20.23,10.57,-20.07,8.55,-19.91,3.83,-19.74,-0.89,-19.62,-1.7,-19.21,-3.13,-18.77,-4.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-1.33,9.03,3.57,5.25,8.61,1.93,13.25,0.92,14.8,-2.07,15.08,-2.73,14.34,-2.33,13.05,-3.6,11.66,-4.98,2.83,7.17,8.54,3.91,14.31,1.03,19.08,0.47,20.93,-1.13,20.85,-1.46,18.97,-1.07,16.82,-1.89,14.75,-2.82,6.68,5.46,13.16,2.68,19.61,0.21,24.5,0.08,26.63,-0.17,26.2,-0.23,23.2,0.09,20.29,-0.31,17.61,-0.82,8.3,4.31,14.85,2.08,21.27,0.09,25.97,0.21,28.13,0.59,27.55,0.3,24.3,0.33,21.37,0.08,18.69,-0.26,11.91,2.52,17.23,1.21,22.28,0.09,26.24,0.61,27.82,0.98,27.35,0.24,25.52,0.24,23.98,0.33,22.5,0.35,14.69,0.73,19.04,0.36,23.15,0.06,26.51,1.01,27.51,1.37,27.16,0.18,26.73,0.17,26.59,0.56,26.31,0.95,15.21,-1.59,19.28,-1.47,23.43,-1.38,26.18,-0.46,26.9,0.43,26.78,0.05,26.69,0.09,26.46,0.64,26.12,1.23,17.34,-4.27,20.57,-3.77,23.77,-3.3,25.44,-2.64,25.81,-1.04,25.76,-0.08,25.56,0.2,24.83,1.1,23.98,2.08,19.65,-6.99,21.97,-6.07,24.11,-5.22,24.66,-4.79,24.66,-2.5,24.67,-0.21,24.34,0.33,23.06,1.62,21.67,3.01]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_03","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-39.57,48.5,-38.6,51.41,-37.65,54.19,-37.11,55.99,-37.31,60.83,-37.71,66.28,-38.14,67.8,-38.96,67.58,-40.19,66.91,-38.12,51.51,-37.67,53.82,-37.44,56,-36.82,57.94,-36.72,61.94,-37.27,65.79,-37.94,67.07,-38.51,66.82,-39.34,66.2,-36.77,54.58,-36.79,56.27,-37.21,57.85,-36.49,59.92,-36.12,63.08,-36.85,65.31,-37.75,66.36,-38.1,66.05,-38.55,65.46,-36.9,58.06,-36.62,58.74,-36.49,59.42,-35.52,61.54,-35.57,63.67,-36.84,64.68,-37.94,65.28,-38.5,64.65,-38.84,63.83,-38.79,62.43,-37.89,61.16,-36.91,60.2,-35.96,62.03,-37,62.49,-38.74,62.79,-39.47,62.99,-39.7,62.24,-39.63,61.42,-41.67,68.63,-40.57,64.92,-39.44,61.83,-38.63,62.95,-39.63,61.58,-40.8,61.02,-40.87,60.96,-40.12,60.37,-39.23,59.84,-37.42,74.4,-36.48,69.3,-35.71,64.88,-35.17,65.19,-35.95,62.64,-36.61,61.11,-36.39,60.99,-35.54,60.05,-34.64,59.14,-28.58,79.68,-27.51,73.75,-26.59,68.45,-26.15,67.85,-26.52,64.15,-26.62,61.31,-26.3,61.37,-25.84,60.19,-25.36,58.93,-19.65,85.02,-18.4,78.23,-17.24,72.02,-16.87,70.5,-16.75,65.62,-16.2,61.46,-15.79,61.71,-15.73,60.32,-15.68,58.75]},{"duration":60,"tweenEasing":0,"value":[0.92,57.83,1.59,60.13,2.26,62.34,2.75,63.65,2.85,64.83,2.75,66.63,2.35,67.8,1.53,67.59,0.3,66.91,-0.08,58.17,1.11,60.35,2.16,62.41,3.03,64.05,3.42,65.35,3.16,66.51,2.47,67.47,1.7,67.03,0.67,66.2,-1.04,58.5,0.65,60.56,2.04,62.48,3.27,64.44,3.95,65.87,3.52,66.37,2.55,67.13,1.81,66.45,0.97,65.46,-1.48,58.67,0.54,60.6,2.34,62.41,3.69,64.64,4.1,65.84,3.25,65.9,2.16,66.36,1.39,65.55,0.67,64.54,-0.5,58.95,1.22,60.38,3.11,61.87,3.98,64.08,3.42,64.5,2.02,64.71,1.28,64.88,0.75,64.35,0.26,63.75,0.62,59.36,1.27,60.1,1.95,61.11,2.05,63.21,1.55,63.03,0.63,63.54,0.35,63.52,0.15,63.33,-0.07,63.24,0.18,60.46,0.78,60.87,1.61,61.52,1.7,63.18,1.35,63.05,0.8,63.65,0.8,63.69,1.04,63.41,1.26,63.2,0.63,61.59,1,62.01,1.52,62.57,1.66,63.75,1.66,63.85,1.56,64.33,1.76,64.51,2.46,63.93,3.2,63.31,1.24,62.69,1.27,63.15,1.3,63.64,1.42,64.34,1.87,64.67,2.31,65,2.72,65.34,3.86,64.45,5.1,63.42]},{"value":[6.92,66.36,11.82,65.08,16.84,64.24,21.26,65.08,22.15,63.34,21.57,64.56,20.15,66.07,17.25,64.3,13.8,61.94,11.24,65.08,17.06,64.19,22.79,63.6,27.39,64.92,28.31,64.4,27.31,65.28,24.85,66.64,21.52,64.93,17.95,62.69,15.2,63.9,21.91,63.4,28.27,63.04,33.03,64.82,34,65.47,32.6,65.97,29.11,67.13,25.4,65.45,21.75,63.3,16.46,63.01,23.48,62.97,30.15,62.99,34.77,65.12,35.35,66.09,33.53,65.91,29.8,66.52,26.09,64.85,22.68,62.85,19,61.72,24.9,62.06,30.73,62.5,34.5,64.88,34.26,65.36,32.34,64.79,30.1,65.03,27.93,64.27,25.85,63.35,20.83,60.56,25.1,61.09,29.24,61.8,32.01,64.34,32,64.49,31,63.69,30.36,63.69,29.8,63.87,29.09,64.13,20.56,59.32,24.63,59.95,29.03,60.65,31.37,62.83,31.44,63.62,30.93,63.72,30.83,63.79,30.64,64.05,30.33,64.43,22.5,57.55,25.79,58.53,29.21,59.53,30.75,61.16,30.97,62.88,30.91,64.25,30.9,64.72,30.77,65.03,30.55,65.39,24.72,55.7,27.07,57.08,29.24,58.43,29.91,59.55,30.36,62.17,30.81,64.78,30.89,65.67,30.76,66.06,30.6,66.42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_04","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-41.66,106.33,-40.01,111.55,-38.39,116.54,-37.36,119.64,-37.46,125.65,-37.96,132.91,-38.8,135.6,-40.43,135.17,-42.89,133.83,-41.2,109.68,-39.56,114.17,-38.28,118.41,-36.79,121.98,-36.3,127.29,-37.11,132.29,-38.46,134.55,-39.81,133.85,-41.67,132.4,-40.81,113.08,-39.15,116.84,-38.16,120.33,-36.21,124.37,-35.17,128.95,-36.33,131.68,-38.2,133.49,-39.29,132.5,-40.58,130.92,-41.3,116.73,-39.04,119.33,-37.13,121.8,-34.84,126.13,-34.49,129.25,-36.59,130.14,-38.77,131.27,-40.1,130.01,-41.16,128.37,-41.29,121.38,-39.01,121.42,-36.47,121.81,-34.84,125.8,-36.55,126.09,-39.64,126.08,-41.12,126.68,-41.91,125.98,-42.37,125.17,-42.14,127.99,-41.04,124.8,-39.84,122.5,-39.27,125.67,-40.99,123.36,-43.02,122.66,-43.38,122.89,-42.9,122.89,-42.3,123.08,-36.92,134.33,-36.14,129.35,-35.53,125.33,-35.33,127.22,-36.59,123.73,-37.61,122.29,-37.44,122.69,-36.94,122.44,-36.38,122.34,-27.89,140.47,-26.57,134.52,-25.42,129.37,-25.04,129.79,-25.7,125.55,-25.81,123.03,-25.38,123.89,-25.28,123.09,-25.16,122.24,-18.91,146.7,-17.02,139.76,-15.25,133.48,-14.67,132.44,-14.59,127.42,-13.67,123.8,-12.95,125.12,-13.25,123.77,-13.58,122.17]},{"duration":60,"tweenEasing":0,"value":[1.83,115.66,3.17,120.26,4.52,124.68,5.5,127.3,5.71,129.65,5.5,133.26,4.69,135.6,3.06,135.17,0.6,133.83,-0.17,116.35,2.22,120.71,4.33,124.83,6.06,128.1,6.85,130.7,6.32,133.01,4.95,134.95,3.4,134.06,1.33,132.4,-2.08,117,1.29,121.13,4.08,124.95,6.54,128.89,7.89,131.74,7.04,132.74,5.1,134.26,3.62,132.9,1.94,130.92,-2.96,117.35,1.08,121.21,4.68,124.82,7.37,129.28,8.19,131.67,6.5,131.8,4.31,132.72,2.77,131.11,1.34,129.07,-1,117.89,2.45,120.75,6.23,123.72,7.96,128.16,6.83,129.01,4.05,129.42,2.55,129.76,1.5,128.69,0.53,127.51,1.23,118.71,2.53,120.21,3.9,122.23,4.11,126.42,3.09,126.06,1.27,127.07,0.7,127.03,0.29,126.67,-0.15,126.48,0.37,120.92,1.55,121.74,3.21,123.03,3.4,126.36,2.7,126.09,1.59,127.31,1.6,127.38,2.07,126.83,2.53,126.4,1.26,123.19,1.99,124.03,3.05,125.15,3.31,127.49,3.31,127.7,3.11,128.65,3.52,129.02,4.93,127.86,6.4,126.62,2.48,125.37,2.53,126.3,2.6,127.29,2.85,128.67,3.73,129.34,4.62,130,5.44,130.68,7.73,128.9,10.19,126.83]},{"value":[15.17,123.69,20.08,124.91,25.07,126.55,29.27,129.24,29.51,128.76,28.06,131.85,25.95,134.46,21.45,132.2,15.93,128.85,19.65,122.98,25.59,124.48,31.26,126.18,35.69,129.37,35.7,129.92,33.78,132.02,30.73,134.35,26.22,131.74,21.14,128.19,23.72,122.35,30.65,124.12,36.94,125.87,41.57,129.56,41.36,131.11,39,132.16,35.02,134.16,30.51,131.21,25.89,127.43,24.62,121.7,32.11,123.86,39.04,125.88,43.56,130.03,42.57,131.58,39.52,131.52,35.29,132.7,30.8,129.61,26.66,125.95,26.08,120.91,32.57,122.9,39.18,124.9,42.76,129.15,40.72,129.73,37.34,129.33,34.69,129.83,31.88,128.22,29.2,126.36,26.98,120.4,31.15,121.83,35.32,123.54,37.51,127.67,36.49,127.6,34.84,127.19,33.99,127.21,33.02,127.18,31.87,127.31,25.91,120.22,29.99,121.37,34.63,122.69,36.56,126.12,35.97,126.81,35.09,127.39,34.97,127.48,34.81,127.46,34.53,127.63,27.66,119.38,31.01,120.83,34.65,122.36,36.07,124.96,36.13,126.8,36.05,128.58,36.24,129.23,36.7,128.97,37.12,128.7,29.8,118.38,32.17,120.23,34.38,122.07,35.17,123.89,36.06,126.84,36.95,129.78,37.44,131.01,38.45,130.51,39.53,129.84]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE.04","timeline":[{"name":"B_EYE.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EYE.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EYE.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_00","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-57.27,-110.11,-52.92,-112.96,-48.56,-116.8,-44.95,-111.17,-44.01,-98.49,-43.91,-87.77,-43.85,-84.4,-43.57,-80.92,-43.27,-77.34,-54.12,-105.67,-50.06,-109.53,-46.07,-113.76,-42.29,-109.65,-41.65,-99.45,-42.91,-89.96,-43.99,-85.76,-44.89,-82.26,-45.59,-78.74,-51.38,-101.11,-47.53,-105.99,-43.82,-110.61,-39.84,-108.03,-39.4,-100.44,-41.9,-92.27,-44.09,-87.29,-45.98,-83.81,-47.57,-80.37,-52.58,-95.43,-48.58,-101.1,-44.35,-106.13,-40.28,-104.75,-39.09,-100.2,-40.87,-94.56,-43.06,-89.78,-45.08,-86.73,-46.86,-83.76,-51.43,-88.85,-48.58,-94.88,-45.63,-100.21,-42.86,-99.03,-40.85,-97.12,-39.92,-95.09,-40.62,-91.75,-42.49,-89.57,-43.94,-87.46,-49.42,-82,-48,-88.51,-46.76,-94.31,-45.52,-93.36,-43.65,-93.97,-40.99,-95.4,-39.96,-93.92,-40.57,-93.28,-41.03,-92.7,-46.44,-76.45,-44.53,-83.75,-42.01,-90.35,-40.96,-90.13,-40.3,-92.44,-38.44,-95.76,-37.5,-95.56,-38.58,-96.69,-39.23,-97.99,-36.57,-72.06,-35.57,-80.32,-34.17,-87.78,-33.65,-88.51,-33.21,-91.92,-31.87,-96.18,-31.23,-96.65,-31.84,-99.32,-32.18,-102.34,-26.05,-67.73,-26.21,-76.97,-26.36,-85.32,-26.5,-86.97,-26.14,-91.43,-25.16,-96.58,-24.74,-97.7,-24.61,-101.92,-24.47,-106.68]},{"duration":60,"tweenEasing":0,"value":[-14,-110.11,-9.65,-113.43,-5.29,-117.69,-1.65,-112.35,-0.41,-101.65,-0.02,-92.92,0,-90.02,0,-87.68,0,-85.34,-12.35,-104.48,-8.18,-108.85,-4.01,-113.59,-0.29,-110.17,1.22,-102.33,0.89,-94.89,0.36,-91.03,-0.06,-87.52,-0.46,-83.93,-10.9,-99.1,-6.9,-104.42,-2.91,-109.53,0.92,-107.91,2.76,-102.93,1.76,-96.75,0.69,-91.99,-0.1,-87.39,-0.89,-82.63,-10.79,-95.57,-7.21,-100.78,-3.71,-105.41,-0.02,-104.37,2.89,-101.63,2.83,-96.96,1.72,-92.03,0.32,-87.33,-0.95,-82.43,-8.66,-92.02,-6.37,-96.9,-4.22,-101.2,-1.58,-99.81,1.92,-98.17,4.08,-95.61,3.79,-91.44,1.41,-87.71,-0.5,-83.82,-7.11,-88.75,-5.9,-93.23,-4.83,-97.18,-3.27,-95.41,-0.53,-94.98,2.51,-94.63,3.38,-91.19,1.57,-88.24,-0.04,-85.21,-6.46,-87.88,-4.81,-91.66,-2.97,-95,-1.75,-93.62,-0.02,-94.53,2.44,-94.73,3.3,-91.17,1.65,-88.28,0,-85.34,-3.03,-88.45,-1.08,-91.27,0.92,-93.71,1.73,-93.01,2.38,-95.36,3.57,-95.31,3.79,-91.33,1.93,-88.36,0,-85.34,0.67,-89.07,2.83,-90.89,4.83,-92.4,5.17,-92.35,4.69,-96.18,4.56,-95.91,4.16,-91.51,2.16,-88.45,0,-85.34]},{"value":[5,-107.11,13.52,-112.28,21.72,-118.26,27.28,-113.11,29.42,-102.78,29.03,-94.84,26.44,-92.79,21.34,-93.44,16,-94.34,8.04,-102.4,16.18,-108.01,24.16,-113.9,30.28,-110.54,32.62,-102.91,31.57,-95.92,27.99,-92.85,23.15,-91.5,18.12,-90.22,10.77,-97.89,18.54,-103.85,26.3,-109.57,32.99,-107.94,35.58,-103,33.95,-96.97,29.37,-92.92,24.73,-89.64,19.99,-86.24,11.53,-94.57,18.57,-100.26,25.82,-105.34,32.44,-104.43,36.09,-101.74,35.57,-97.03,30.85,-92.65,25.67,-88.63,20.81,-84.34,17.59,-91.14,22.38,-96.62,27.54,-101.47,32.15,-100.33,36.36,-98.8,38.18,-95.92,35.54,-91.83,30.74,-88.31,26.38,-84.57,25.61,-88.42,27.55,-93.47,29.55,-97.93,31.72,-96.39,35.14,-96.12,37.96,-95.19,37.66,-91.14,34.6,-87.62,31.53,-83.96,28.54,-87.88,30.12,-92.19,31.92,-96.01,33.16,-94.73,35.01,-95.27,36.96,-94.47,37.1,-90.08,34.49,-86.29,31.8,-82.39,31.97,-88.45,33.66,-91.99,35.44,-95.09,36.2,-94.44,36.86,-95.47,37.74,-93.79,37.6,-89.27,35.26,-85.81,32.81,-82.28,35.67,-89.07,37.37,-91.82,38.93,-94.18,39.17,-94.14,38.69,-95.68,38.56,-93.13,38.16,-88.51,36.16,-85.45,34,-82.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_01","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-48.77,-55.72,-45.9,-57.15,-43.08,-59.07,-40.97,-56.14,-40.45,-48.58,-40.75,-42,-40.89,-40,-40.75,-37.48,-40.61,-34.84,-48.86,-52.81,-45.93,-54.96,-43.08,-57.27,-40.68,-55.21,-39.92,-49.53,-40.56,-43.94,-41.21,-41.18,-41.97,-39.12,-42.61,-37.1,-49.01,-49.88,-46,-52.76,-43.09,-55.44,-40.4,-54.26,-39.38,-50.48,-40.33,-45.88,-41.44,-42.41,-42.96,-40.87,-44.31,-39.52,-50.01,-46.66,-46.71,-50.12,-43.12,-53.19,-40.26,-52.6,-38.87,-50.65,-39.39,-47.49,-40.41,-44.1,-42.03,-43.26,-43.53,-42.69,-47.53,-42.41,-45.34,-46.54,-42.89,-50.23,-40.99,-49.91,-39.49,-49.3,-38.5,-48.15,-38.58,-46.13,-39.78,-46.04,-40.74,-46.15,-44.55,-37.95,-44,-42.84,-43.55,-47.26,-42.9,-47.22,-41.62,-47.79,-39.47,-48.49,-38.42,-48.22,-38.42,-49.52,-38.37,-50.95,-41.24,-33.93,-40.59,-39.68,-39.62,-44.91,-39.15,-45.36,-38.49,-46.88,-36.73,-49.03,-35.71,-49.92,-35.73,-52.62,-35.49,-55.52,-32.38,-30.38,-32.19,-37.06,-31.78,-43.15,-31.56,-44.16,-30.86,-46.3,-29.39,-49.49,-28.59,-51.07,-28.13,-55.04,-27.48,-59.37,-23.05,-26.87,-23.45,-34.49,-23.81,-41.45,-23.89,-43.01,-23.07,-45.72,-21.8,-49.89,-21.17,-52.15,-20.11,-57.4,-18.97,-63.17]},{"duration":60,"tweenEasing":0,"value":[-7,-55.05,-4.83,-56.72,-2.65,-58.85,-0.83,-56.18,-0.21,-50.83,-0.01,-46.46,0,-45.01,0,-43.84,0,-42.67,-6.17,-52.24,-4.09,-54.43,-2.01,-56.81,-0.14,-55.08,0.61,-51.17,0.45,-47.44,0.18,-45.52,-0.03,-43.76,-0.23,-41.97,-5.45,-49.55,-3.44,-52.22,-1.46,-54.78,0.46,-53.96,1.38,-51.46,0.88,-48.38,0.34,-46,-0.05,-43.7,-0.44,-41.32,-5.39,-47.78,-3.61,-50.39,-1.85,-52.71,-0.01,-52.19,1.44,-50.81,1.41,-48.48,0.86,-46.02,0.16,-43.66,-0.48,-41.21,-4.33,-46.01,-3.18,-48.45,-2.11,-50.61,-0.79,-49.91,0.96,-49.08,2.04,-47.8,1.9,-45.72,0.71,-43.85,-0.25,-41.91,-3.55,-44.38,-2.95,-46.61,-2.42,-48.59,-1.64,-47.71,-0.27,-47.49,1.26,-47.31,1.69,-45.6,0.79,-44.12,-0.02,-42.61,-3.23,-43.94,-2.4,-45.83,-1.49,-47.5,-0.88,-46.81,-0.01,-47.26,1.22,-47.37,1.65,-45.58,0.82,-44.14,0,-42.67,-1.52,-44.22,-0.54,-45.63,0.46,-46.85,0.87,-46.5,1.19,-47.68,1.79,-47.66,1.89,-45.67,0.96,-44.18,0,-42.67,0.33,-44.53,1.41,-45.45,2.41,-46.2,2.59,-46.18,2.35,-48.09,2.28,-47.96,2.08,-45.75,1.08,-44.23,0,-42.67]},{"value":[9,-52.05,15.34,-55.57,21.37,-59.41,25.05,-56.93,25.96,-51.95,24.76,-48.38,22.25,-47.78,17.72,-49.6,13,-51.67,11.22,-50.17,17.32,-53.64,23.25,-57.18,27.56,-55.51,28.86,-51.81,27.47,-48.48,24.17,-47.33,19.82,-47.74,15.35,-48.25,13.22,-48.33,19.09,-51.75,24.9,-54.97,29.85,-54.09,31.55,-51.68,29.98,-48.61,25.9,-46.92,21.69,-45.94,17.43,-44.92,14.04,-46.81,19.37,-49.98,24.88,-52.8,29.82,-52.34,32.09,-51.03,31.17,-48.53,27,-46.64,22.51,-44.96,18.28,-43.12,20.04,-45.32,23.4,-48.25,26.93,-50.81,30.13,-50.24,32.49,-49.49,33.02,-47.97,30.64,-46.12,27.04,-44.45,23.63,-42.66,27.03,-44.19,28.1,-46.75,29.13,-48.99,30.37,-48.22,32.14,-48.08,33.46,-47.59,32.97,-45.55,30.82,-43.5,28.55,-41.35,28.77,-43.94,29.39,-46.16,30.05,-48.12,30.6,-47.49,31.53,-47.6,32.5,-47.05,32.45,-44.66,30.67,-42.23,28.8,-39.72,30.48,-44.22,31.12,-46.25,31.76,-48.04,32.07,-47.71,32.4,-47.6,32.84,-46.13,32.71,-43.7,31.3,-41.68,29.81,-39.61,32.33,-44.53,32.95,-46.37,33.52,-47.98,33.59,-47.96,33.35,-47.59,33.28,-45.17,33.08,-42.75,32.08,-41.23,31,-39.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_02","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-40.27,-1.33,-38.88,-1.33,-37.6,-1.33,-36.99,-1.11,-36.89,1.33,-37.59,3.77,-37.93,4.4,-37.93,5.97,-37.94,7.67,-43.6,0.05,-41.81,-0.39,-40.08,-0.77,-39.08,-0.78,-38.19,0.38,-38.22,2.09,-38.42,3.4,-39.04,4.03,-39.64,4.55,-46.64,1.34,-44.47,0.47,-42.35,-0.27,-40.96,-0.48,-39.34,-0.52,-38.76,0.52,-38.79,2.47,-39.93,2.07,-41.05,1.33,-47.44,2.11,-44.84,0.87,-41.89,-0.23,-40.23,-0.45,-38.66,-1.09,-37.91,-0.4,-37.75,1.58,-38.98,0.21,-40.2,-1.62,-43.64,4.04,-42.1,1.79,-40.15,-0.24,-39.11,-0.79,-38.13,-1.47,-37.08,-1.21,-36.53,-0.5,-37.07,-2.51,-37.53,-4.85,-39.68,6.11,-40,2.82,-40.33,-0.21,-40.28,-1.07,-39.6,-1.61,-37.95,-1.59,-36.87,-2.52,-36.27,-5.77,-35.71,-9.2,-36.04,8.59,-36.66,4.39,-37.23,0.51,-37.34,-0.6,-36.68,-1.32,-35.01,-2.3,-33.93,-4.26,-32.87,-8.54,-31.76,-13.06,-28.19,11.31,-28.81,6.19,-29.39,1.47,-29.46,0.18,-28.51,-0.69,-26.91,-2.79,-25.95,-5.48,-24.43,-10.76,-22.79,-16.41,-20.05,14,-20.68,7.98,-21.26,2.42,-21.29,0.96,-20,0,-18.43,-3.21,-17.6,-6.61,-15.62,-12.88,-13.47,-19.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[11,3,15.17,1.15,19.02,-0.56,20.82,-0.76,20.5,-1.13,18.5,-1.92,16.06,-2.77,12.1,-5.76,8,-9,12.39,2.07,16.46,0.74,20.34,-0.45,22.83,-0.48,23.1,-0.71,21.36,-1.05,18.35,-1.82,14.5,-3.98,10.58,-6.29,13.67,1.22,17.64,0.37,21.52,-0.34,24.7,-0.25,25.52,-0.35,24.01,-0.25,20.42,-0.93,16.64,-2.25,12.88,-3.61,14.56,0.96,18.18,0.29,21.94,-0.26,25.21,-0.25,26.1,-0.33,24.77,-0.04,21.14,-0.63,17.35,-1.29,13.76,-1.91,20.5,0.5,22.42,0.13,24.32,-0.14,26.12,-0.14,26.62,-0.19,25.87,-0.02,23.75,-0.41,21.33,-0.59,18.87,-0.75,26.44,0.04,26.66,-0.02,26.7,-0.05,27.02,-0.04,27.15,-0.05,26.96,-0.01,26.28,0.04,25.03,0.62,23.57,1.25,27,0,26.66,-0.13,26.18,-0.24,26.05,-0.25,26.05,0.05,26.05,0.36,25.8,0.77,24.84,1.84,23.8,2.95,27,0,26.57,-0.51,26.07,-0.98,25.94,-0.99,25.94,0.27,25.94,1.53,25.81,1.87,25.33,2.45,24.81,3.06,27,0,26.54,-0.93,26.11,-1.78,26,-1.79,26,0.5,26,2.79,26,3,26,3,26,3]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_03","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-48.06,64.31,-45.88,58.83,-43.73,53.48,-42.29,50.1,-43.16,50.93,-45.52,50.97,-48.66,46.38,-50.94,39.97,-53.1,33.4,-50.65,65.64,-48.17,59.71,-45.89,54.04,-43.44,50.75,-42.17,49.88,-42.8,48.51,-45.51,44.42,-48.04,37.7,-50.84,30.34,-52.98,66.89,-49.7,60.5,-46.45,54.44,-42.82,51.28,-40.33,48.82,-40.14,46.15,-42.47,42.54,-45.15,35.39,-48.54,27.1,-53.03,67.9,-49.03,61.09,-44.56,54.63,-40.39,51.46,-38.07,47.75,-37.88,44.05,-39.64,40.15,-42.06,32.16,-45.3,22.86,-47.88,69.78,-44.99,62.1,-41.44,54.8,-38.63,50.63,-36.77,45.55,-35.61,40.59,-36.22,35.38,-37.59,26.77,-39.35,17.27,-42.3,71.79,-41.57,63.09,-40.69,54.83,-39.73,49.66,-38.29,43.64,-36.14,37.85,-35.44,30.88,-35.28,20.83,-35.23,10.37,-37.22,74.07,-37.04,64.55,-36.73,55.48,-36.29,49.8,-35.02,43.19,-32.84,36.22,-31.79,28.15,-30.85,17.19,-29.79,5.95,-26.83,76.26,-26.82,65.97,-26.71,56.17,-26.32,50.25,-25.01,43.44,-23.21,35.34,-22.16,26.54,-20.42,14.96,-18.52,3.01,-15.97,78.41,-16.17,67.37,-16.34,56.83,-16.01,50.69,-14.61,43.75,-13.15,34.55,-12.1,25.04,-9.56,12.79,-6.81,0.14]},{"duration":60,"tweenEasing":0,"value":[-12.29,65.65,-11.04,60.01,-9.74,54.52,-9.04,50.74,-10.71,49.1,-12.58,47.04,-15.23,41.98,-17.51,34,-19.66,25.74,-12.78,65.13,-11.36,59.71,-10.1,54.48,-8.66,51.1,-8.73,49.16,-9.64,46.47,-12.27,41.45,-14.51,33.68,-16.74,25.53,-13.21,64.67,-11.08,59.41,-8.99,54.35,-6.61,51.35,-5.98,49.18,-6.81,45.91,-9.48,40.89,-11.62,33.26,-13.89,25.14,-12.86,64.74,-10.22,59.51,-7.35,54.47,-4.59,51.46,-4.09,48.66,-5.24,44.68,-7.72,39.4,-9.8,31.78,-11.97,23.66,-9.83,65.07,-7.75,59.92,-5.44,54.93,-3.53,51.24,-2.87,46.86,-3.16,41.77,-4.76,36.26,-6.52,29.21,-8.15,21.83,-6.79,65.4,-5.64,60.27,-4.47,55.29,-3.6,50.98,-2.93,45.33,-2.55,39.39,-3.02,33.42,-3.64,26.48,-4.2,19.39,-5.57,65.76,-4.67,60.48,-3.62,55.34,-3.04,50.8,-2.63,44.73,-2.31,38.55,-2.37,32.41,-2.47,25.73,-2.53,19,-2.61,66.4,-2.14,60.65,-1.56,55.04,-1.13,50.3,-0.88,44.25,-0.79,38.16,-0.71,32.02,-0.49,25.71,-0.22,19.42,0.58,67.08,0.55,60.82,0.53,54.7,0.78,49.73,0.89,43.75,0.78,37.76,1,31.64,1.56,25.67,2.16,19.81]},{"value":[-2.13,68.65,2.37,61.16,6.66,53.95,8.99,49.96,7.46,47.64,4.04,44.49,-1.82,38.49,-8.22,28.47,-14.5,18.07,-1.23,67.2,3.77,60.44,8.48,54.04,12.2,50.58,12.22,47.85,9.57,44.21,3.44,38.3,-2.69,29.04,-8.84,19.34,-0.37,65.88,5.59,59.77,11.5,54.01,16.78,51.08,17.51,47.99,14.8,43.91,8.32,38.08,2.45,29.53,-3.55,20.49,0.86,65.69,7.13,59.81,13.75,54.21,19.45,51.2,20.01,47.48,17.1,42.84,10.84,36.95,4.98,28.92,-0.88,20.47,9.84,65.57,13.83,60.04,18.05,54.81,21.54,51.1,22.06,46.24,20.58,40.8,16.21,34.96,11.18,27.83,6.23,20.41,18.82,65.45,20.18,60.24,21.4,55.25,22.51,50.96,22.82,45.26,22.59,39.29,20.27,33.49,16.7,27.1,13.04,20.58,20.59,65.76,21.16,60.35,21.73,55.11,22.14,50.55,22.14,44.79,22.05,38.91,20.69,33.28,17.99,27.64,15.39,21.96,23.56,66.4,23.6,60.14,23.68,54.06,23.95,49.3,23.99,44.52,23.87,39.69,23.28,33.93,22.16,28.2,21.13,22.49,26.75,67.08,26.25,59.9,25.8,52.92,25.95,47.95,26.05,44.25,25.95,40.55,26.17,34.64,26.73,28.67,27.32,22.81]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_04","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-55.85,129.96,-52.88,119,-49.86,108.29,-47.59,101.31,-49.42,100.54,-53.45,98.18,-59.39,88.37,-63.95,73.97,-68.27,59.14,-57.69,131.23,-54.53,119.81,-51.69,108.9,-47.81,102.26,-46.16,99.36,-47.38,94.92,-52.62,85.47,-57.02,71.4,-62.04,56.14,-59.32,132.45,-54.92,120.52,-50.53,109.19,-44.69,103.02,-41.33,98.16,-41.53,91.78,-46.19,82.65,-50.34,68.75,-56.02,52.87,-58.79,133.69,-53.36,121.38,-47.4,109.58,-40.55,103.37,-37.5,96.59,-37.85,88.5,-41.55,78.71,-45.12,64.14,-50.41,47.34,-54.12,135.51,-49.34,122.67,-43.64,110.18,-38.16,102.03,-35.44,92.55,-34.14,82.4,-35.94,71.27,-38.09,56.1,-41.16,39.39,-48.74,137.47,-45.93,123.83,-42.6,110.56,-39.18,100.39,-36.99,88.88,-34.32,77.3,-34.02,64.29,-34.29,47.44,-34.75,29.93,-41.96,139.55,-40.01,125.11,-37.6,111.06,-35.25,100.2,-33.36,87.7,-30.67,74.74,-29.66,60.55,-28.82,42.94,-27.82,24.95,-27.33,141.21,-26.17,125.95,-24.73,111.18,-23.18,100.32,-21.51,87.57,-19.51,73.48,-18.37,58.55,-16.41,40.67,-14.24,22.43,-11.89,142.83,-11.66,126.76,-11.42,111.24,-10.73,100.42,-9.22,87.5,-7.87,72.32,-6.6,56.68,-3.5,38.46,-0.16,19.94]},{"duration":60,"tweenEasing":0,"value":[-24.58,131.29,-22.08,120.03,-19.48,109.03,-18.08,101.49,-21.42,98.2,-25.17,94.09,-30.47,83.97,-35.02,68,-39.33,51.48,-25.56,130.25,-22.71,119.41,-20.2,109,-17.31,102.18,-17.48,98.32,-19.29,92.96,-24.58,82.95,-29,67.4,-33.48,51.06,-26.42,129.33,-22.16,118.81,-17.97,108.73,-13.22,102.69,-11.98,98.34,-13.63,91.82,-19.03,81.86,-23.22,66.58,-27.78,50.29,-25.72,129.47,-20.43,119.03,-14.71,108.93,-9.19,102.92,-8.2,97.31,-10.48,89.36,-15.48,78.88,-19.58,63.6,-23.93,47.31,-19.65,130.14,-15.5,119.83,-10.88,109.85,-7.07,102.46,-5.76,93.71,-6.33,83.53,-9.56,72.6,-13.03,58.47,-16.3,43.66,-13.58,130.81,-11.28,120.53,-8.94,110.58,-7.21,101.95,-5.87,90.65,-5.1,78.78,-6.05,66.84,-7.27,52.98,-8.4,38.77,-11.14,131.51,-9.34,120.95,-7.23,110.66,-6.07,101.6,-5.26,89.46,-4.63,77.11,-4.74,64.82,-4.95,51.47,-5.06,38.01,-5.21,132.81,-4.27,121.3,-3.12,110.08,-2.26,100.59,-1.77,88.51,-1.58,76.32,-1.42,64.04,-0.98,51.42,-0.45,38.84,1.17,134.16,1.1,121.64,1.06,109.41,1.56,99.47,1.77,87.5,1.56,75.53,2,63.28,3.12,51.34,4.31,39.61]},{"value":[-15.25,134.29,-10.43,121.17,-5.7,108.47,-2.84,100.67,-5.59,96.41,-10.42,90.89,-19.69,79.74,-28.53,62.7,-37,45.15,-14.84,132.33,-8.93,120.14,-3.36,108.59,1.57,101.63,1.32,96.41,-2.23,89.48,-11.5,78.43,-19.88,62.08,-28.26,44.97,-14.42,130.55,-6.46,119.16,1.49,108.39,8.85,102.38,9.48,96.31,5.57,88.08,-3.82,77.12,-11.73,61.35,-19.98,44.59,-12.83,130.43,-3.92,119.33,5.54,108.65,13.7,102.63,13.9,95.27,9.41,85.71,0.49,74.59,-7.37,59.17,-15.52,42.85,-0.82,130.64,5.24,119.95,11.79,109.76,16.96,102.32,17.46,92.64,15.27,81.62,8.58,70.41,1.06,56.28,-6.42,41.57,11.19,130.85,13.71,120.49,16.1,110.57,17.99,101.96,18.49,90.55,18.22,78.59,14.25,66.96,8.37,53.59,2.51,39.91,14.19,131.51,15.66,120.82,17.29,110.43,18.22,101.35,18.23,89.51,18.05,77.47,15.57,65.78,11.15,53.46,6.98,40.96,20.12,132.81,20.63,120.78,21.28,109.1,21.97,99.6,22.04,88.77,21.8,77.84,20.76,65.95,18.99,53.98,17.45,41.91,26.5,134.16,25.97,120.72,25.5,107.62,25.89,97.68,26.11,88,25.89,78.31,26.33,66.28,27.45,54.34,28.64,42.61]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE_BALL.05","timeline":[{"name":"B_EYE_BALL.05_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE_BALL.05_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE_BALL.05_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.05_00","timeline":[{"name":"B_EYE_BALL.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-21.58,5.4,-22.32,6.15,-23.18,7.47,-23.83,8.72,-23.95,9.28,-23.93,9.32,-24,9.47,-24.1,9.74,-24.19,10.17,-17.59,2.54,-19.34,3.55,-21.31,5.09,-22.86,6.5,-23.36,7.12,-23.42,7.4,-23.64,8.13,-23.92,9.12,-24.19,10.17,-13.06,0.44,-15.92,1.5,-19.09,2.83,-21.64,3.97,-22.64,4.45,-22.8,5.06,-23.21,6.55,-23.72,8.42,-24.19,10.17,-8.8,-2.03,-12.71,-0.83,-17.04,0.51,-20.55,1.59,-21.99,2.03,-22.23,2.92,-22.81,5.08,-23.53,7.75,-24.19,10.17]},{"duration":60,"tweenEasing":0,"value":[-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19]},{"value":[-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.05_01","timeline":[{"name":"B_EYE_BALL.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.05_02","timeline":[{"name":"B_EYE_BALL.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17]},{"duration":60,"tweenEasing":0,"value":[15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39]},{"value":[15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE_BALL.10","timeline":[{"name":"B_EYE_BALL.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE_BALL.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE_BALL.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.10_00","timeline":[{"name":"B_EYE_BALL.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67]},{"duration":60,"tweenEasing":0,"value":[-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17]},{"value":[-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.10_01","timeline":[{"name":"B_EYE_BALL.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.10_02","timeline":[{"name":"B_EYE_BALL.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.39,11.81,18.52,12.19,18.74,12.34,18.84,11.96,18.61,10.75,18.35,9.87,17.74,9.31,17.13,9,16.84,8.85,18.92,12.33,19.27,12.85,19.79,12.63,20.06,11.35,19.68,8.7,18.54,6.5,16.68,4.45,14.81,2.89,13.62,2.18,19.59,12.96,20.19,13.53,21.03,12.74,21.5,10.35,21,6.16,18.76,2.5,15.37,-1.43,11.97,-4.61,9.65,-6.07,20.18,13.53,21.03,14.21,22.17,12.94,22.82,9.55,22.2,3.87,18.99,-1.18,14.19,-6.79,9.36,-11.42,6.06,-13.53]},{"duration":60,"tweenEasing":0,"value":[18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17]},{"value":[18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.03","timeline":[{"name":"B_BROW.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.03_00","timeline":[{"name":"B_BROW.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.44,42.44,28.42,42.44,28.41,42.44,28.4,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.44,42.44,28.43,42.44,28.42,42.44,28.41,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.44,42.44,28.43,42.44,28.42,42.44,28.41,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.43,42.44,28.43,42.44,28.42,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.44,42.44,28.43,42.44,28.43,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.44,42.44,28.43,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.44,42.44,28.44,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45]},{"duration":60,"tweenEasing":0,"value":[41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.04,41.61,-0.05,41.61,-0.06,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.05,41.61,-0.05,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.04,41.61,-0.05,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.04,41.61,-0.04,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.04,41.61,-0.04,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02,41.61,-0.03,41.61,-0.03,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02,41.61,-0.03,41.61,-0.03,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02,41.61,-0.02,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02]},{"value":[41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.74,41.61,-20.76,41.61,-20.77,41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.74,41.61,-20.75,41.61,-20.76,41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.75,41.61,-20.75,41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.74,41.61,-20.75,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.74,41.61,-20.74,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.73,41.61,-20.74,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.72,41.61,-20.73,41.61,-20.73,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.72,41.61,-20.73,41.61,-20.73,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.72,41.61,-20.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.03_01","timeline":[{"name":"B_BROW.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.03_02","timeline":[{"name":"B_BROW.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46]},{"duration":60,"tweenEasing":0,"value":[-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66]},{"value":[-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.04","timeline":[{"name":"B_BROW.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.04_00","timeline":[{"name":"B_BROW.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.86,26.13,-26.86,26.13,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.85,26.13,-26.86,26.13,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.85,26.12,-26.86,26.13,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.85,26.12,-26.86,26.12,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.86,26.11,-26.86,26.12,-26.86,26.12,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.11,-26.86,26.11,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.11,-26.86,26.11,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.1,-26.86,26.1,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.1]},{"duration":60,"tweenEasing":0,"value":[-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.86,0.03,-26.86,0.04,-26.86,0.05,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.86,0.04,-26.86,0.04,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.85,0.04,-26.86,0.04,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.85,0.03,-26.86,0.04,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.86,0.03,-26.86,0.03,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.02,-26.86,0.02,-26.86,0.02,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.01,-26.86,0.02,-26.86,0.02,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.01,-26.86,0.02,-26.86,0.02,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.01,-26.86,0.01,-26.86,0.01]},{"value":[-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.86,-26.86,-20.84,-26.86,-20.82,-26.86,-20.82,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.86,-26.85,-20.85,-26.86,-20.83,-26.86,-20.83,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.86,-26.85,-20.85,-26.85,-20.83,-26.86,-20.83,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.85,-26.85,-20.84,-26.86,-20.83,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.85,-26.85,-20.84,-26.86,-20.84,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.85,-26.86,-20.84,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.85,-26.86,-20.85,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.85,-26.86,-20.85,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.86,-26.86,-20.85]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.04_01","timeline":[{"name":"B_BROW.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.04_02","timeline":[{"name":"B_BROW.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09]},{"duration":60,"tweenEasing":0,"value":[17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85]},{"value":[17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.05","timeline":[{"name":"B_BROW.05_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.05_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_BROW.05_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.05_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_BROW.05_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_00","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-59.36,-43.36,-52.32,-65.17,-44.99,-85.95,-36.15,-96.75,-28.73,-97.1,-21.99,-94.34,-20.35,-99.72,-21.49,-106.79,-22.72,-113.66,-56.04,-39.6,-49.22,-60.61,-43,-80.41,-35.82,-91.56,-31.08,-93.07,-27.57,-93.23,-26.97,-100.21,-28.59,-107.79,-30.29,-115.22,-53.15,-35.78,-46.44,-56.1,-41.15,-75.08,-35.57,-86.61,-33.23,-89.2,-32.65,-92.18,-33.04,-100.65,-35.09,-108.71,-37.23,-116.65,-52.45,-30.7,-45.82,-51.45,-40.42,-70.96,-35.62,-82.96,-33.54,-86.52,-33.35,-91.45,-34.14,-100.32,-36.22,-108.69,-38.37,-117.04,-46.13,-23.72,-41.8,-46.16,-38.09,-67.37,-34.13,-79.74,-33.58,-84.86,-34.14,-90.78,-34.63,-98.72,-35.69,-107.91,-36.84,-117.34,-40.22,-15.62,-38.06,-39.57,-35.93,-62.36,-32.76,-75.14,-33.72,-82.44,-34.95,-89.94,-35.11,-97.12,-35.16,-107.13,-35.32,-117.64,-36.68,-8.87,-34.4,-33.3,-31.03,-56.77,-28.17,-70.23,-30.34,-79.91,-32.5,-89.59,-32.71,-97.27,-32.75,-107.32,-32.85,-117.81,-26.22,-3.77,-25.4,-28.56,-23.87,-52.43,-22.35,-67.06,-23.59,-78.25,-24.84,-89.45,-25.03,-98.19,-25.32,-108.16,-25.67,-118.38,-14.96,1.29,-15.91,-23.86,-16.73,-48.22,-16.64,-63.91,-16.64,-76.61,-16.64,-89.31,-16.78,-99.12,-17.35,-109.03,-17.97,-119]},{"duration":60,"tweenEasing":0,"value":[-49.02,-22.03,-40.49,-42.85,-31.66,-62.88,-21.85,-75.04,-14.73,-82.44,-8.29,-88.4,-6.39,-96.3,-6.39,-105.65,-6.39,-115,-41.78,-19.68,-32.97,-40.41,-24.55,-60.16,-15.63,-72.77,-10.1,-80.82,-6.22,-88.47,-5.23,-97.18,-5.43,-106.33,-5.63,-115.47,-35.04,-17.51,-25.92,-38.15,-17.87,-57.62,-9.81,-70.64,-5.7,-79.28,-4.21,-88.52,-4.1,-98,-4.48,-106.96,-4.87,-115.9,-32.33,-16.26,-23.32,-37.14,-15.21,-56.89,-7.8,-69.94,-3.94,-78.59,-2.97,-88.37,-3.28,-98.13,-3.68,-107.07,-4.1,-115.97,-24.38,-14.72,-18.34,-36.26,-12.56,-56.7,-6.86,-69.61,-4,-78.37,-2.8,-87.77,-2.91,-97.27,-3.12,-106.39,-3.34,-115.51,-16.56,-13.18,-13.8,-34.92,-11.04,-55.64,-7.13,-68.15,-4.7,-77.51,-2.69,-87.02,-2.54,-96.4,-2.55,-105.72,-2.58,-115.04,-14.03,-11.72,-12.15,-33.55,-9.78,-54.53,-6.82,-67.41,-4.43,-77.16,-2.05,-86.91,-1.82,-96.3,-1.82,-105.65,-1.82,-115,-7.56,-10.55,-6.59,-32.65,-5.32,-54.01,-3.66,-67.82,-2.42,-77.38,-1.18,-86.93,-1.06,-96.3,-1.06,-105.65,-1.06,-115,-0.63,-9.38,-0.65,-31.75,-0.61,-53.54,-0.3,-68.26,-0.3,-77.61,-0.3,-86.96,-0.3,-96.3,-0.3,-105.65,-0.3,-115]},{"value":[-45.02,-11.14,-31.39,-34.02,-17.86,-56.01,-6.72,-69.31,1.78,-78.75,9.58,-86.77,11.61,-95.48,11.61,-105.5,11.61,-115.52,-33.61,-10.18,-21.44,-32.59,-9.99,-53.81,-0.01,-67.48,7.1,-77.37,12.56,-86.86,13.81,-96.29,14.02,-105.92,14.22,-115.53,-23.01,-9.29,-12.17,-31.24,-2.65,-51.8,6.26,-65.75,12.14,-76.04,15.41,-86.93,15.89,-97.05,16.3,-106.32,16.7,-115.54,-19.45,-8.45,-9.24,-30.36,0.02,-51.13,8.45,-65.26,14.1,-75.45,16.87,-86.77,16.94,-97.19,17.4,-106.39,17.94,-115.54,-12.87,-7.83,-4.82,-29.98,2.99,-51.27,10.27,-65.79,14.51,-75.68,17.08,-86.22,17.36,-96.38,18.22,-105.97,19.16,-115.53,-6.43,-7.2,-0.85,-29.17,4.85,-50.47,10.88,-65.2,14.26,-75.28,17.22,-85.52,17.79,-95.57,19.05,-105.55,20.37,-115.52,-4.25,-6.04,0.56,-28.08,5.86,-49.6,11.29,-64.55,14.73,-74.92,18.18,-85.28,18.82,-95.36,20.04,-105.39,21.29,-115.41,1.37,-5.73,5.44,-28.05,9.91,-49.83,14.5,-64.94,17.39,-74.92,20.28,-84.9,20.77,-94.93,21.61,-104.96,22.47,-114.98,7.38,-5.48,10.67,-28.07,14.19,-50.11,17.92,-65.36,20.2,-74.92,22.48,-84.49,22.81,-94.47,23.24,-104.49,23.7,-114.52]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_01","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-31.67,-12.22,-28.14,-26.28,-24.42,-39.97,-20.94,-48.8,-20.33,-48.55,-19.72,-48.31,-19.96,-53.55,-21.1,-57.73,-22.33,-61.72,-34.05,-9.74,-31.71,-24.68,-29.4,-39.01,-26.8,-47.33,-26.64,-47.49,-26.47,-47.66,-26.82,-53.35,-28.24,-58.82,-29.74,-64.19,-36.48,-7.11,-35.21,-22.98,-34.11,-38.04,-32.33,-45.86,-32.52,-46.46,-32.71,-47.05,-33.16,-53.14,-34.83,-59.81,-36.58,-66.47,-37.88,-3.35,-36.92,-19.86,-35.7,-35.45,-34.28,-43.05,-34.33,-44.89,-34.39,-46.72,-34.83,-52.67,-36.5,-59.78,-38.22,-66.99,-33.17,2.35,-33.69,-14.35,-34.17,-30.08,-33.72,-38.05,-34.33,-42.22,-34.94,-46.39,-35.22,-51.75,-36.07,-58.91,-37,-66.38,-29.02,8.61,-30.83,-9.22,-32.71,-26.14,-33.17,-35.02,-34.33,-40.67,-35.5,-46.32,-35.61,-50.82,-35.65,-58.05,-35.78,-65.77,-28.42,13.43,-29.63,-5.47,-30.41,-23.45,-30.74,-32.97,-32.4,-39.69,-34.05,-46.41,-34.22,-51.1,-34.26,-58.26,-34.35,-65.86,-26.14,18.51,-27.3,-0.77,-28.16,-19.08,-28.37,-28.84,-28.43,-37.51,-28.5,-46.18,-28.58,-52.02,-28.87,-59.11,-29.22,-66.43,-23.67,23.62,-24.9,4.05,-26.04,-14.53,-26.16,-24.49,-24.33,-35.22,-22.51,-45.94,-22.48,-52.95,-23.05,-59.98,-23.67,-67.05]},{"duration":60,"tweenEasing":0,"value":[-10.67,3.78,-7.14,-10.9,-3.42,-25.16,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-8.82,3.61,-5.83,-11.37,-2.78,-25.78,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-7.1,3.45,-4.61,-11.84,-2.16,-26.4,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-6.27,3.47,-4.09,-12.04,-1.71,-26.75,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-2,4.18,-1.43,-11.51,-0.78,-26.42,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,2.27,4.89,1.24,-10.98,0.14,-26.12,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,2.52,5.25,1.38,-10.8,0.28,-26.11,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,1.95,6.39,1.06,-10.18,0.22,-25.96,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,1.33,7.62,0.72,-9.49,0.15,-25.78,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05]},{"value":[9.34,8.68,12.87,-6.68,16.59,-21.62,20,-31.9,20,-39.04,20,-46.17,20,-53.31,20,-60.44,20,-67.58,11.19,8.5,14.18,-7.16,17.23,-22.24,20,-31.9,20,-39.03,20,-46.17,20,-53.31,20,-60.44,20,-67.58,12.9,8.34,15.39,-7.62,17.85,-22.86,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.58,13.74,8.37,15.91,-7.82,18.3,-23.21,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,18.01,9.08,18.58,-7.3,19.22,-22.88,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,22.27,9.78,21.25,-6.77,20.15,-22.58,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,22.53,10.14,21.38,-6.59,20.29,-22.57,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,21.96,11.28,21.07,-5.96,20.22,-22.42,20,-31.89,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,21.34,12.52,20.72,-5.27,20.15,-22.24,20,-31.89,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_02","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-21,-16,-21,-15.38,-21,-14.81,-20.94,-14.04,-20.33,-7.33,-19.72,-0.63,-19.96,0.58,-21.1,2.86,-22.33,5.33,-25.23,-13.35,-25.88,-13.3,-26.62,-13.24,-26.8,-12.57,-26.64,-6.27,-26.47,0.02,-26.82,0.78,-28.24,1.77,-29.74,2.86,-29.38,-10.56,-30.6,-11.12,-31.95,-11.63,-32.33,-11.1,-32.52,-5.24,-32.71,0.62,-33.16,0.99,-34.83,0.78,-36.58,0.58,-31.61,-6.83,-32.83,-7.79,-33.98,-8.64,-34.28,-8.3,-34.33,-3.67,-34.39,0.95,-34.83,1.46,-36.5,0.81,-38.22,0.06,-31.17,-1.83,-32.26,-2.76,-33.37,-3.54,-33.72,-3.29,-34.33,-1,-34.94,1.29,-35.22,2.38,-36.07,1.68,-37,0.67,-31.28,3.72,-32.07,1.79,-32.85,0.04,-33.17,-0.26,-34.33,0.55,-35.5,1.35,-35.61,3.31,-35.65,2.54,-35.78,1.28,-30.94,8.19,-31.02,5.3,-30.7,2.6,-30.74,1.79,-32.4,1.53,-34.05,1.27,-34.22,3.03,-34.26,2.33,-34.35,1.19,-28.09,12.12,-28.37,9.39,-28.38,6.85,-28.37,5.92,-28.43,3.71,-28.5,1.49,-28.58,2.12,-28.87,1.49,-29.22,0.62,-25,16,-25.62,13.53,-26.19,11.25,-26.16,10.27,-24.33,6,-22.51,1.73,-22.48,1.19,-23.05,0.62,-23.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[22.67,4.89,28.76,3.25,34.61,1.79,37.89,2.08,39.84,3.35,41.22,4.06,40.75,3.2,38.47,1.39,36,-0.53,20.2,4.89,25.48,3.65,30.39,2.54,33.1,2.45,35.08,2.85,36.3,2.91,35.96,2.14,34.23,0.84,32.3,-0.53,17.92,4.89,22.45,4.04,26.51,3.25,28.68,2.78,30.71,2.38,31.76,1.84,31.53,1.14,30.3,0.32,28.87,-0.52,17.57,4.89,21.72,4.22,25.65,3.54,27.51,2.86,29.49,2.18,30.48,1.51,30.26,0.83,29.13,0.15,27.94,-0.52,20.01,4.89,23.09,4.22,25.94,3.54,27.17,2.86,28.5,2.19,29.28,1.51,29.12,0.83,28.26,0.15,27.33,-0.52,22.44,4.89,24.46,4.22,26.23,3.54,26.83,2.86,27.52,2.19,28.07,1.51,27.97,0.83,27.38,0.15,26.72,-0.52,22.67,4.9,24.24,4.22,25.82,3.54,26.28,2.86,26.83,2.19,27.37,1.51,27.28,0.83,26.75,0.16,26.23,-0.52,22.67,4.9,23.48,4.22,24.3,3.54,24.55,2.86,24.83,2.19,25.11,1.51,25.06,0.83,24.79,0.16,24.52,-0.52,22.67,4.9,22.67,4.22,22.67,3.54,22.67,2.87,22.67,2.19,22.67,1.51,22.67,0.83,22.67,0.16,22.67,-0.52]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_03","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-21.79,33.85,-20.02,39.08,-18.33,44.37,-17.13,50.73,-16.68,60.1,-16.87,69.05,-17.51,74.74,-19.88,78.7,-22.46,82.49,-26.92,36.5,-25.84,40.79,-24.9,45.21,-23.81,51.51,-23.35,61.65,-23.64,70.95,-24.45,76.08,-27.2,78.94,-30.13,81.56,-31.92,39.28,-31.44,42.61,-31.13,46.14,-30.11,52.34,-29.57,63.18,-29.93,72.74,-30.88,77.34,-33.97,79.17,-37.24,80.7,-34.73,42.93,-34.25,45.83,-33.76,48.99,-32.71,54.95,-31.96,64.85,-32.06,73.39,-33,78,-36.07,79.52,-39.21,80.63,-36.1,46.89,-35.57,50.56,-35.15,54.48,-34.58,60.36,-34.76,67.11,-35.42,73.11,-35.92,78.73,-37.35,80.76,-38.9,82.21,-38.04,51.43,-37.27,54.82,-36.63,58.45,-36.45,63.79,-37.56,68.27,-38.78,72.55,-38.85,79.47,-38.64,81.99,-38.59,83.79,-37.97,56.19,-36.69,58.62,-35.02,61.29,-34.7,66.1,-36.29,69.2,-37.88,72.3,-37.95,79.17,-37.67,81.64,-37.36,83.43,-34.82,61.64,-34.25,63.93,-33.42,66.48,-33.16,71.03,-32.89,71.8,-32.63,72.57,-32.53,78.06,-32.25,80.01,-31.94,81.43,-31.38,67.18,-31.69,69.41,-31.98,71.91,-31.82,76.25,-29.38,74.56,-26.95,72.87,-26.64,76.92,-26.36,78.28,-26.05,79.27]},{"duration":60,"tweenEasing":0,"value":[3.71,49.85,5.48,54.46,7.17,59.18,8.32,64.77,8.15,67.43,7.36,69.68,6.95,74.16,5.72,75.83,4.38,77.15,2.81,49.85,4.55,54.09,6.22,58.45,7.5,64.08,7.79,67.93,7.33,70.93,6.88,75.3,5.54,77.17,4.11,78.7,1.96,49.85,3.66,53.73,5.31,57.76,6.72,63.44,7.45,68.42,7.28,72.12,6.78,76.36,5.36,78.4,3.84,80.12,1.38,49.75,3.07,53.62,4.72,57.63,6.08,63.26,6.88,68.53,6.83,72.44,6.33,76.54,4.93,78.71,3.51,80.58,-0.44,48.73,1.18,53.32,2.72,58.02,3.65,63.65,4.08,68.12,4.02,71.82,3.8,76.35,3.22,79.08,2.6,81.55,-2.26,47.7,-0.71,53.03,0.72,58.41,1.21,64.05,1.28,67.72,1.22,71.2,1.27,76.15,1.51,79.45,1.69,82.51,-2.54,48,-1.17,53.32,0.18,58.7,0.54,64.3,0.61,67.67,0.68,71.04,0.76,76.12,1.09,79.3,1.49,82.24,-2.23,49.53,-1.38,54.54,-0.54,59.64,-0.29,65.11,0.04,68.1,0.37,71.08,0.54,75.94,1.12,78.52,1.78,80.82,-1.88,51.18,-1.57,55.87,-1.29,60.66,-1.16,65.98,-0.55,68.56,0.06,71.14,0.34,75.73,1.19,77.66,2.12,79.27]},{"value":[29.05,54.74,36.9,57.71,44.45,60.97,48.87,66.85,50.66,70.78,51.24,73.73,50.37,77.36,46.85,77.22,43.04,76.63,25.99,54.74,33.14,57.53,39.91,60.61,44,66.24,45.82,70.63,46.31,73.82,45.5,77.44,42.44,78.01,39.07,78.17,23.14,54.74,29.62,57.37,35.71,60.29,39.48,65.66,41.34,70.5,41.74,73.92,40.98,77.5,38.33,78.73,35.38,79.6,22.26,54.64,28.36,57.39,34.32,60.36,37.75,65.51,39.55,70.39,40.01,73.92,39.25,77.38,36.73,78.86,34.11,80.05,22.57,53.62,27.41,57.29,31.98,61.13,34.25,66.2,35.5,70.14,35.98,73.31,35.58,77.18,34.15,79.23,32.6,81.02,22.88,52.6,26.45,57.2,29.63,61.89,30.74,66.88,31.44,69.89,31.95,72.71,31.9,76.98,31.56,79.6,31.08,81.99,22.8,52.89,25.74,57.54,28.67,62.24,29.49,67.17,30.1,69.86,30.71,72.55,30.71,76.95,30.51,79.46,30.39,81.72,23.11,54.42,24.76,58.76,26.43,63.18,26.93,67.98,27.54,70.28,28.15,72.59,28.27,76.77,28.58,78.68,28.97,80.29,23.46,56.08,23.76,60.09,24.05,64.2,24.18,68.85,24.79,70.75,25.39,72.65,25.67,76.56,26.52,77.82,27.45,78.75]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_04","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-22.58,83.69,-19.04,93.54,-15.66,103.55,-13.31,115.5,-13.03,127.54,-14.01,138.72,-15.05,148.9,-18.67,154.53,-22.58,159.64,-28.61,86.34,-25.79,94.87,-23.18,103.66,-20.81,115.6,-20.05,129.59,-20.82,141.88,-22.07,151.38,-26.16,156.1,-30.52,160.26,-34.46,89.13,-32.28,96.34,-30.32,103.9,-27.88,115.78,-26.62,131.6,-27.15,144.86,-28.59,153.69,-33.11,157.57,-37.9,160.83,-37.84,92.68,-35.68,99.44,-33.53,106.61,-31.13,118.21,-29.59,133.38,-29.74,145.84,-31.18,154.54,-35.64,158.23,-40.21,161.21,-41.04,95.62,-38.87,103.88,-36.93,112.49,-35.44,124,-35.19,135.23,-35.9,144.93,-36.63,155.06,-38.63,159.84,-40.8,163.76,-44.8,99.13,-42.47,107.84,-40.4,116.85,-39.74,127.83,-40.78,135.99,-42.06,143.75,-42.08,155.62,-41.63,161.44,-41.4,166.3,-45.01,104.18,-42.36,111.95,-39.34,119.98,-38.66,130.4,-40.18,136.87,-41.7,143.34,-41.69,155.3,-41.08,160.95,-40.37,165.67,-41.55,111.17,-40.13,118.48,-38.46,126.12,-37.94,136.15,-37.35,139.9,-36.76,143.65,-36.49,154.01,-35.63,158.54,-34.66,162.25,-37.77,118.36,-37.77,125.28,-37.77,132.57,-37.48,142.23,-34.43,143.12,-31.39,144.01,-30.81,152.64,-29.67,155.95,-28.43,158.54]},{"duration":60,"tweenEasing":0,"value":[7.42,99.69,10.96,108.93,14.34,118.36,16.63,129.54,16.31,134.87,14.72,139.35,13.9,148.32,11.43,151.66,8.75,154.3,5.62,99.69,9.09,108.17,12.44,116.9,14.99,128.17,15.59,135.86,14.65,141.85,13.75,150.61,11.09,154.34,8.22,157.39,3.92,99.69,7.32,107.46,10.63,115.53,13.45,126.89,14.9,136.84,14.56,144.23,13.57,152.72,10.73,156.8,7.69,160.24,2.77,99.5,6.14,107.24,9.45,115.26,12.15,126.51,13.75,137.06,13.65,144.88,12.65,153.09,9.86,157.42,7.01,161.15,-0.87,97.45,2.37,106.64,5.45,116.04,7.29,127.31,8.15,136.25,8.04,143.64,7.59,152.69,6.44,158.16,5.2,163.09,-4.52,95.41,-1.41,106.06,1.45,116.81,2.43,128.1,2.56,135.44,2.44,142.39,2.53,152.3,3.02,158.89,3.38,165.03,-5.07,96,-2.34,106.64,0.36,117.39,1.08,128.61,1.22,135.34,1.35,142.07,1.52,152.25,2.18,158.61,2.99,164.48,-4.47,99.05,-2.76,109.09,-1.08,119.27,-0.57,130.23,0.08,136.19,0.74,142.16,1.09,151.89,2.25,157.04,3.56,161.63,-3.77,102.36,-3.15,111.75,-2.58,121.32,-2.32,131.97,-1.1,137.12,0.12,142.27,0.67,151.46,2.38,155.33,4.23,158.54]},{"value":[35.43,104.59,45.05,112.17,54.28,120.15,59.86,131.62,61.48,138.22,61.27,143.41,59.99,151.52,55.23,153.05,50.09,153.78,31.78,104.59,40.79,111.42,49.44,118.69,54.91,130.03,56.56,138.41,56.33,144.73,55.05,152.75,50.65,155.18,45.85,156.87,28.36,104.59,36.8,110.71,44.91,117.33,50.29,128.54,51.97,138.62,51.73,146.01,50.43,153.87,46.37,157.13,41.89,159.72,26.95,104.4,35,110.57,42.99,117.18,47.99,128.16,49.62,138.61,49.54,146.33,48.25,153.92,44.33,157.57,40.29,160.63,25.13,102.35,31.72,110.37,38.01,118.71,41.32,129.53,42.49,138.1,42.68,145.12,42.04,153.52,40.03,158.32,37.86,162.57,23.32,100.3,28.45,110.19,33.04,120.23,34.66,130.9,35.37,137.6,35.83,143.91,35.83,153.13,35.74,159.05,35.44,164.51,22.93,100.89,27.24,110.86,31.52,120.93,32.7,131.47,33.38,137.52,34.05,143.58,34.14,153.08,34.26,158.77,34.55,163.96,23.54,103.95,26.05,113.31,28.56,122.82,29.31,133.09,30.24,138.38,31.18,143.67,31.49,152.72,32.37,157.2,33.41,161.11,24.24,107.26,24.86,115.97,25.43,124.87,25.68,134.83,26.9,139.31,28.12,143.78,28.67,152.29,30.38,155.49,32.23,158.02]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.06","timeline":[{"name":"B_BROW.06_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.06_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_BROW.06_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.06_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_BROW.06_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_00","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-34.58,-117.44,-33.35,-118.91,-32.21,-119.67,-31.44,-113.49,-30.25,-103.6,-29.64,-94.27,-30.1,-85.69,-32.1,-75.33,-34.26,-64.76,-40.57,-117.75,-39.2,-118.12,-37.84,-117.88,-36.79,-111.79,-35.49,-103.41,-34.54,-95.39,-35.37,-87.15,-37.94,-77.93,-40.41,-68.59,-46.14,-118.03,-44.65,-117.37,-43.09,-116.19,-41.78,-110.23,-40.53,-103.32,-39.41,-96.56,-40.55,-88.63,-43.47,-80.52,-46.12,-72.4,-47.32,-118.08,-45.91,-117.06,-44.38,-115.58,-43.14,-109.84,-42.77,-104.05,-42.39,-98.25,-43.51,-90.63,-45.64,-83.51,-47.84,-76.48,-41.66,-117.77,-40.92,-116.75,-40.16,-115.25,-39.46,-109.46,-39,-104.78,-38.55,-100.11,-39.72,-92.97,-42.09,-86.6,-44.55,-80.33,-36,-117.46,-35.93,-116.45,-35.93,-114.92,-35.75,-109.16,-34.96,-105.87,-34.16,-102.58,-35.39,-95.63,-38.07,-89.42,-40.85,-83.34,-35.17,-117.21,-35.15,-116.19,-35.14,-114.65,-35.11,-108.96,-34.8,-107.17,-34.49,-105.39,-35.44,-98.88,-37.49,-93.57,-39.68,-88.44,-32.9,-116.36,-32.82,-115.27,-32.75,-113.67,-32.71,-108.17,-32.53,-108.3,-32.35,-108.43,-32.87,-102.26,-34.1,-97.67,-35.41,-93.34,-30.41,-115.43,-30.25,-114.27,-30.11,-112.61,-30.07,-107.31,-29.92,-109.42,-29.77,-111.53,-29.86,-105.65,-30.29,-101.71,-30.76,-98.08]},{"duration":60,"tweenEasing":0,"value":[3.75,-114.78,3.75,-116.24,3.75,-117,3.75,-111.79,3.75,-108.27,3.74,-104.74,3.3,-96.91,1.59,-87.4,-0.26,-77.76,2.08,-114.77,2.35,-115.42,2.62,-115.41,2.75,-109.91,3.31,-106.1,3.87,-102.3,3.7,-94.94,2.81,-86.98,1.77,-78.99,0.51,-114.77,1.03,-114.64,1.55,-113.92,1.79,-108.16,2.87,-104.11,3.95,-100.05,4.03,-93.1,3.9,-86.58,3.61,-80.13,-0.11,-114.83,0.46,-114.4,1.02,-113.42,1.27,-107.73,2.46,-103.6,3.65,-99.46,3.76,-92.45,3.73,-86.36,3.65,-80.42,0.67,-115.44,0.98,-114.74,1.26,-113.5,1.42,-107.73,2.33,-103.59,3.24,-99.46,3.18,-92.44,2.61,-86.36,1.99,-80.42,1.46,-116.04,1.5,-115.08,1.51,-113.59,1.57,-107.73,2.2,-103.59,2.83,-99.45,2.6,-92.44,1.49,-86.36,0.33,-80.42,0.84,-116.1,0.93,-115.01,0.98,-113.41,1.04,-107.53,1.65,-103.81,2.25,-100.09,2.03,-93.06,0.97,-86.76,-0.07,-80.56,-0.74,-116.1,-0.39,-114.75,-0.1,-112.92,0.03,-107.11,0.64,-104.66,1.25,-102.22,1.15,-95.12,0.6,-88.1,0.06,-81.13,-2.41,-116.1,-1.79,-114.47,-1.22,-112.38,-1.02,-106.68,-0.42,-105.59,0.19,-104.5,0.25,-97.33,0.24,-89.54,0.24,-81.75]},{"value":[29.76,-113.28,32.22,-115.38,34.5,-116.77,35.11,-112.13,35.41,-108.47,35.71,-104.81,35.08,-98.3,32.51,-92.43,29.73,-86.65,28.08,-113.28,31.63,-114.83,35.01,-115.71,36.25,-110.86,37.28,-107,37.88,-103.14,37.69,-96.57,36.7,-90.55,35.47,-84.64,26.51,-113.28,31.07,-114.31,35.45,-114.72,37.3,-109.69,39,-105.64,39.85,-101.59,40.05,-94.96,40.51,-88.83,40.73,-82.79,25.89,-113.33,30.48,-114.12,34.94,-114.31,37.03,-109.34,39,-105.27,39.82,-101.2,40.05,-94.6,40.75,-88.35,41.51,-82.17,26.68,-113.94,29.14,-114.19,31.42,-113.85,33.03,-108.78,35.56,-105.04,36.9,-101.31,37.16,-94.52,37.79,-87.57,38.49,-80.64,27.46,-114.55,27.79,-114.25,27.9,-113.41,29.02,-108.21,32.12,-104.81,33.97,-101.41,34.26,-94.45,34.83,-86.8,35.46,-79.12,26.84,-114.6,26.94,-114.14,26.98,-113.18,27.88,-107.99,30.79,-104.7,32.74,-101.41,33.04,-94.46,33.52,-86.65,33.94,-78.79,25.27,-114.6,25.61,-113.88,25.9,-112.68,26.48,-107.44,28.57,-104.34,30.19,-101.24,30.33,-94.24,30.31,-86.2,30.22,-78.08,23.59,-114.6,24.21,-113.61,24.78,-112.15,25.03,-106.85,26.25,-103.95,27.47,-101.05,27.43,-94,26.86,-85.7,26.24,-77.3]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_01","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-33.79,-58.72,-33.17,-59.45,-32.6,-59.83,-32.24,-56.6,-31.88,-50.05,-31.8,-43.79,-32.05,-39.13,-33.05,-33.09,-34.13,-26.88,-36.79,-58.87,-36.6,-59.16,-36.44,-59.14,-36.05,-55.95,-35.42,-50.22,-34.96,-44.66,-35.38,-40.19,-36.66,-34.81,-37.9,-29.33,-39.57,-59.02,-39.81,-58.88,-40.01,-58.48,-39.6,-55.38,-38.79,-50.49,-38.06,-45.66,-38.61,-41.36,-40.07,-36.63,-41.4,-31.85,-40.16,-59.04,-40.53,-58.75,-40.81,-58.21,-40.44,-55.33,-40.04,-51.53,-39.63,-47.73,-40.19,-43.72,-41.33,-39.69,-42.45,-35.68,-37.33,-58.88,-37.54,-58.49,-37.69,-57.85,-37.47,-55.01,-37.13,-52.42,-36.78,-49.84,-37.36,-46.31,-38.54,-43.26,-39.71,-40.29,-34.5,-58.73,-34.55,-58.24,-34.57,-57.48,-34.48,-54.65,-34.07,-53.17,-33.67,-51.7,-34.23,-48.47,-35.37,-46.2,-36.55,-44.06,-33.59,-58.5,-33.62,-58.02,-33.63,-57.27,-33.62,-54.54,-33.49,-54.37,-33.36,-54.2,-33.79,-51.42,-34.63,-50.1,-35.57,-48.98,-30.53,-57.64,-30.62,-57.22,-30.7,-56.54,-30.72,-53.95,-30.75,-55.2,-30.78,-56.45,-31.06,-53.93,-31.67,-53.28,-32.36,-52.88,-27.2,-56.71,-27.36,-56.37,-27.5,-55.75,-27.55,-53.31,-27.71,-55.96,-27.86,-58.61,-27.99,-56.32,-28.41,-56.27,-28.88,-56.54]},{"duration":60,"tweenEasing":0,"value":[1.88,-57.39,1.88,-58.12,1.87,-58.5,1.87,-55.9,1.87,-54.13,1.87,-52.37,1.65,-48.45,0.8,-43.7,-0.13,-38.88,1.04,-57.39,1.17,-57.71,1.31,-57.7,1.37,-54.95,1.65,-53.05,1.94,-51.15,1.85,-47.47,1.41,-43.49,0.88,-39.5,0.25,-57.39,0.51,-57.32,0.77,-56.95,0.89,-54.08,1.44,-52.05,1.98,-50.03,2.02,-46.55,1.95,-43.29,1.81,-40.06,-0.05,-57.41,0.23,-57.2,0.51,-56.71,0.64,-53.87,1.23,-51.8,1.83,-49.73,1.88,-46.22,1.87,-43.18,1.82,-40.21,0.34,-57.72,0.49,-57.37,0.63,-56.75,0.71,-53.87,1.17,-51.8,1.62,-49.73,1.59,-46.22,1.3,-43.18,0.99,-40.21,0.73,-58.02,0.75,-57.54,0.75,-56.79,0.78,-53.86,1.1,-51.8,1.42,-49.73,1.3,-46.22,0.74,-43.18,0.17,-40.21,0.42,-58.05,0.47,-57.5,0.49,-56.71,0.52,-53.77,0.82,-51.9,1.13,-50.04,1.02,-46.53,0.49,-43.38,-0.04,-40.28,-0.37,-58.05,-0.19,-57.38,-0.05,-56.46,0.02,-53.56,0.32,-52.33,0.62,-51.11,0.58,-47.56,0.3,-44.05,0.03,-40.56,-1.2,-58.05,-0.9,-57.24,-0.61,-56.19,-0.51,-53.34,-0.21,-52.79,0.1,-52.25,0.12,-48.67,0.12,-44.77,0.12,-40.87]},{"value":[26.21,-55.89,27.44,-57.26,28.58,-58.27,28.89,-56.26,29.04,-54.75,29.19,-53.24,28.87,-50.3,27.59,-47.68,26.2,-45.11,25.38,-55.89,27.15,-56.98,28.84,-57.74,29.46,-55.63,29.97,-54.02,30.27,-52.4,30.18,-49.43,29.68,-46.74,29.06,-44.1,24.59,-55.89,26.87,-56.72,29.06,-57.24,29.98,-55.05,30.83,-53.34,31.26,-51.63,31.36,-48.63,31.59,-45.88,31.7,-43.17,24.28,-55.92,26.58,-56.63,28.8,-57.04,29.85,-54.87,30.83,-53.15,31.24,-51.43,31.36,-48.45,31.71,-45.64,32.09,-42.86,24.67,-56.22,25.9,-56.66,27.04,-56.81,27.85,-54.59,29.11,-53.04,29.78,-51.49,29.91,-48.41,30.23,-45.25,30.57,-42.1,25.06,-56.52,25.23,-56.69,25.28,-56.59,25.84,-54.3,27.39,-52.92,28.32,-51.54,28.46,-48.37,28.75,-44.86,29.06,-41.34,24.76,-56.55,24.8,-56.64,24.82,-56.47,25.27,-54.19,26.73,-52.86,27.7,-51.53,27.85,-48.38,28.09,-44.79,28.3,-41.17,23.97,-56.55,24.14,-56.51,24.29,-56.22,24.58,-53.92,25.62,-52.68,26.43,-51.45,26.5,-48.27,26.48,-44.56,26.44,-40.82,23.13,-56.55,23.44,-56.37,23.72,-55.96,23.85,-53.62,24.46,-52.49,25.07,-51.36,25.05,-48.15,24.76,-44.31,24.45,-40.43]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_02","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-33,0,-33,0,-33,0,-33.04,0.3,-33.5,3.5,-33.96,6.7,-34,7.44,-34,9.15,-34,11,-33,0,-34.01,-0.21,-35.04,-0.4,-35.32,-0.12,-35.35,2.97,-35.39,6.06,-35.39,6.78,-35.39,8.29,-35.39,9.94,-33,0,-34.96,-0.4,-36.93,-0.77,-37.42,-0.54,-37.06,2.35,-36.71,5.24,-36.67,5.91,-36.67,7.25,-36.67,8.7,-33,0,-35.15,-0.44,-37.24,-0.84,-37.74,-0.82,-37.31,0.98,-36.87,2.79,-36.87,3.19,-37.01,4.13,-37.07,5.13,-33,0,-34.16,-0.23,-35.23,-0.44,-35.48,-0.55,-35.25,-0.06,-35.02,0.43,-35,0.36,-34.99,0.07,-34.88,-0.25,-33,0,-33.16,-0.03,-33.21,-0.05,-33.21,-0.13,-33.19,-0.48,-33.17,-0.82,-33.07,-1.31,-32.67,-2.98,-32.26,-4.79,-32.02,0.22,-32.09,0.16,-32.12,0.1,-32.13,-0.11,-32.18,-1.56,-32.23,-3.02,-32.14,-3.96,-31.77,-6.63,-31.45,-9.52,-28.17,1.07,-28.43,0.82,-28.65,0.58,-28.73,0.26,-28.97,-2.1,-29.22,-4.47,-29.24,-5.61,-29.25,-8.88,-29.31,-12.42,-24,2,-24.46,1.54,-24.89,1.11,-25.04,0.7,-25.5,-2.5,-25.96,-5.7,-26.11,-6.98,-26.54,-10.83,-27,-15]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[22.67,1.49,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.67,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.49,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.67,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.24,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.92,22.66,-3.56]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_03","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-39.23,76.64,-39.22,70,-39.22,63.37,-39.7,59.44,-40.98,58.58,-42.78,54.58,-45.02,48.02,-46.65,39.13,-48.23,29.98,-39.85,76.93,-40.19,70.48,-40.53,64.02,-40.88,59.29,-41.32,57.09,-42.31,53.1,-44.54,46.09,-46.44,37.07,-48.28,27.88,-40.4,77.2,-41.05,70.92,-41.7,64.63,-41.92,59.05,-41.6,55.44,-41.85,51.4,-44.08,43.92,-46.24,34.77,-48.33,25.55,-40.1,77.24,-40.83,71.04,-41.53,64.82,-41.65,58.47,-41.21,53.12,-41.28,48.19,-43.52,40.22,-45.94,30.63,-48.19,21.01,-38.58,76.95,-39.07,70.93,-39.53,64.88,-39.59,58.48,-39.13,52.01,-38.96,45.78,-40.87,37.39,-42.8,26.44,-44.6,15.3,-37.05,76.66,-37.31,70.83,-37.53,64.95,-37.56,58.52,-37.36,51,-37.23,43.55,-38.81,34.6,-40.15,22.06,-41.43,9.18,-35.51,76.85,-35.77,70.88,-35.99,64.89,-36.05,58.28,-36.13,49.34,-36.21,40.41,-37.42,30.52,-38.79,16.97,-39.98,3.11,-31.21,77.7,-31.57,71.25,-31.88,64.81,-31.98,57.99,-32.13,48,-32.28,38.01,-32.83,27.26,-33.7,13.18,-34.49,-1.15,-26.59,78.62,-27.05,71.66,-27.47,64.74,-27.6,57.71,-27.83,46.73,-28.07,35.75,-27.94,24.19,-28.23,9.57,-28.59,-5.21]},{"duration":60,"tweenEasing":0,"value":[-7.23,76.64,-7.22,70,-7.22,63.37,-8.69,58.52,-11.61,53.83,-13.78,46.85,-17.51,38.36,-20.46,26.58,-23.23,14.48,-6.7,76.93,-6.73,70.58,-6.76,64.22,-7.72,58.81,-10.09,53.28,-12.52,46.34,-16.17,37.68,-19.2,26.26,-22.12,14.59,-6.17,77.2,-6.23,71.12,-6.3,65.01,-6.76,59.03,-8.59,52.67,-11.32,45.79,-14.9,36.94,-18.01,25.83,-21.1,14.57,-5.71,77.24,-5.79,71.26,-5.86,65.24,-6,58.83,-7.65,51.94,-10.55,45.11,-13.95,36.12,-17.21,24.99,-20.38,13.76,-5.33,76.95,-5.47,71.05,-5.61,65.1,-5.73,58.7,-6.78,51.66,-8.56,44.66,-11.19,35.71,-13.74,24.17,-16.22,12.43,-4.95,76.66,-5.16,70.84,-5.36,64.97,-5.45,58.57,-5.92,51.38,-6.57,44.21,-8.43,35.31,-10.26,23.34,-12.07,11.1,-4.5,76.63,-4.69,70.73,-4.87,64.79,-4.96,58.41,-5.4,51.13,-5.83,43.85,-7.17,34.63,-8.91,22.83,-10.42,10.84,-4.04,76.62,-4.14,70.44,-4.24,64.23,-4.27,57.74,-4.39,50.22,-4.51,42.69,-5.05,32.94,-5.9,21.65,-6.64,10.34,-3.59,76.62,-3.59,70.13,-3.58,63.63,-3.56,57.02,-3.33,49.23,-3.11,41.44,-2.83,31.17,-2.69,20.4,-2.59,9.79]},{"value":[15.44,78.14,15.44,70.86,15.45,63.6,13.98,58.12,11.06,52.8,8.89,45.18,5.15,36.06,2.2,23.65,-0.57,10.92,15.97,78.43,15.94,71.44,15.91,64.45,14.95,58.41,12.58,52.25,10.14,44.68,6.49,35.39,3.47,23.33,0.54,11.03,16.49,78.7,16.43,71.98,16.37,65.25,15.91,58.63,14.07,51.64,11.35,44.13,7.77,34.64,4.65,22.9,1.56,11.01,16.96,78.74,16.88,72.12,16.81,65.47,16.66,58.43,15.02,50.91,12.12,43.45,8.71,33.83,5.45,22.07,2.28,10.2,17.34,78.45,17.19,71.91,17.06,65.34,16.94,58.3,15.88,50.63,14.11,43,11.47,33.42,8.92,21.24,6.44,8.87,17.72,78.15,17.51,71.7,17.31,65.2,17.22,58.17,16.75,50.35,16.1,42.55,14.23,33.01,12.4,20.41,10.59,7.54,18.17,78.13,17.98,71.59,17.79,65.02,17.7,58.01,17.27,50.1,16.83,42.19,15.49,32.34,13.75,19.9,12.25,7.29,18.63,78.12,18.53,71.3,18.43,64.46,18.4,57.34,18.28,49.19,18.16,41.03,17.61,30.65,16.76,18.72,16.02,6.78,19.08,78.12,19.08,70.99,19.08,63.87,19.11,56.62,19.33,48.2,19.55,39.78,19.84,28.88,19.97,17.48,20.07,6.24]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_04","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-45.45,153.29,-45.45,140,-45.44,126.73,-46.34,118.58,-48.09,113.79,-49.6,103.14,-52.08,90.24,-55.24,71.46,-58.46,51.95,-46.71,153.87,-46.37,141.16,-46.01,128.44,-46.45,118.71,-47.15,111.47,-47.67,100.92,-49.8,86.87,-52.43,67.71,-55.16,48.04,-47.8,154.4,-47.14,142.24,-46.47,130.03,-46.46,118.67,-46.21,108.92,-45.84,98.44,-47.65,83.26,-49.84,63.73,-52.13,43.91,-47.2,154.48,-46.5,142.52,-45.81,130.48,-45.58,117.8,-45.05,105.73,-44.46,94.51,-46.25,78.55,-48.71,58.46,-51.12,38.16,-44.15,153.9,-43.99,142.1,-43.83,130.21,-43.64,117.54,-42.07,104.32,-40.45,91.6,-42.14,75.3,-44.88,53.62,-47.66,31.52,-41.11,153.31,-41.47,141.68,-41.85,129.94,-41.76,117.18,-39.71,102.5,-37.66,87.95,-39.28,70.97,-42.33,47.4,-45.46,23.2,-39.01,153.47,-39.46,141.61,-39.87,129.68,-39.83,116.66,-38.3,100.25,-36.78,83.84,-38.08,65.33,-41.15,40.78,-44.05,15.74,-34.25,154.32,-34.71,141.69,-35.12,129.04,-35.15,115.71,-34.36,98.1,-33.57,80.49,-34.04,60.28,-35.73,35.34,-37.35,10.12,-29.18,155.24,-29.63,141.79,-30.06,128.37,-30.16,114.73,-30.17,95.96,-30.18,77.19,-29.76,55.36,-29.92,29.97,-30.18,4.59]},{"duration":60,"tweenEasing":0,"value":[-14.45,153.29,-14.45,140,-14.44,126.73,-17.37,117.05,-23.22,107.67,-27.55,93.69,-35.02,76.71,-40.92,53.16,-46.46,28.95,-13.39,153.87,-13.45,141.16,-13.52,128.44,-15.44,117.62,-20.17,106.56,-25.05,92.69,-32.36,75.37,-38.39,52.53,-44.24,29.19,-12.35,154.4,-12.47,142.24,-12.59,130.03,-13.51,118.06,-17.19,105.35,-22.64,91.59,-29.81,73.87,-36.02,51.68,-42.2,29.15,-11.42,154.48,-11.58,142.52,-11.72,130.48,-12,117.66,-15.29,103.89,-21.09,90.22,-27.92,72.26,-34.42,49.99,-40.76,27.51,-10.65,153.9,-10.95,142.1,-11.22,130.21,-11.45,117.38,-13.57,103.33,-17.12,89.34,-22.38,71.42,-27.48,48.34,-32.45,24.86,-9.89,153.31,-10.32,141.68,-10.72,129.94,-10.9,117.13,-11.84,102.77,-13.13,88.43,-16.85,70.58,-20.53,46.67,-24.14,22.2,-9,153.25,-9.37,141.45,-9.75,129.57,-9.93,116.82,-10.79,102.26,-11.66,87.7,-14.33,69.26,-17.82,45.64,-20.83,21.69,-8.09,153.25,-8.28,140.87,-8.47,128.46,-8.54,115.48,-8.78,100.43,-9.01,85.39,-10.1,65.86,-11.81,43.31,-13.28,20.68,-7.18,153.24,-7.17,140.25,-7.17,127.26,-7.12,114.03,-6.67,98.46,-6.22,82.89,-5.65,62.34,-5.38,40.81,-5.18,19.59]},{"value":[8.22,154.78,8.22,140.86,8.23,126.96,5.29,116.64,-0.55,106.63,-4.89,92.03,-12.36,74.41,-18.25,50.23,-23.8,25.39,9.27,155.36,9.21,142.02,9.15,128.67,7.23,117.22,2.49,105.53,-2.38,91.03,-9.7,73.07,-15.73,49.6,-21.58,25.63,10.32,155.9,10.2,143.11,10.08,130.26,9.15,117.66,5.48,104.31,0.03,89.92,-7.14,71.57,-13.35,48.75,-19.54,25.59,11.25,155.98,11.09,143.38,10.95,130.71,10.66,117.26,7.38,102.85,1.57,88.56,-5.25,69.97,-11.76,47.06,-18.1,23.95,12.01,155.39,11.72,142.96,11.45,130.44,11.21,116.98,9.1,102.3,5.55,87.67,0.28,69.13,-4.81,45.41,-9.79,21.3,12.78,154.81,12.35,142.54,11.95,130.17,11.77,116.73,10.83,101.74,9.53,86.76,5.81,68.29,2.14,43.74,-1.48,18.64,13.67,154.75,13.3,142.32,12.92,129.81,12.74,116.42,11.87,101.23,11,86.04,8.33,66.97,4.84,42.72,1.83,18.13,14.58,154.75,14.39,141.74,14.19,128.69,14.12,115.08,13.89,99.4,13.65,83.72,12.57,63.57,10.85,40.39,9.38,17.12,15.49,154.74,15.5,141.12,15.5,127.5,15.55,113.63,16,97.43,16.45,81.23,17.01,60.05,17.28,37.88,17.49,16.03]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_MOUTH.03","timeline":[{"name":"B_MOUTH.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_MOUTH.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_MOUTH.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_MOUTH.03_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_MOUTH.03_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_00","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32,-44.57,-32.46,-64.72,-32.89,-84.59,-33,-99.68,-32.87,-104.31,-32.32,-91.74,-31.99,-83.25,-31.98,-83.12,-31.98,-82.63,-31.82,-37.67,-32.4,-57.7,-33.01,-77.4,-33.67,-92,-34.58,-97.6,-34.33,-88.73,-33.72,-82.11,-32.89,-82.55,-31.98,-82.74,-31.71,-30.71,-32.36,-50.68,-33.08,-70.3,-34.27,-84.45,-36.26,-90.94,-36.36,-85.62,-35.47,-80.82,-33.81,-81.9,-31.98,-82.83,-31.39,-22.18,-32.03,-42.7,-32.57,-62.68,-34.23,-77.3,-37.02,-84.38,-37.52,-81.96,-36.32,-79.39,-33.9,-81.71,-31.15,-84.01,-25.49,-13.91,-26.99,-34.4,-28.46,-53.92,-30.86,-69.71,-33.71,-77.89,-34.61,-78.78,-32.74,-79.84,-28.61,-84.37,-24.27,-89.03,-17.89,-6.68,-20.37,-26.77,-22.86,-45.41,-26.13,-61.98,-29.52,-71.17,-31.3,-75.21,-28.85,-80.12,-23.1,-87.35,-17.25,-94.81,-10.85,-0.13,-13.58,-20.27,-16.29,-39.17,-19.59,-56.33,-22.93,-67.38,-24.71,-74.98,-22.85,-82.15,-18.54,-91.12,-13.52,-100.54,-2.04,5.27,-4.7,-15.12,-7.33,-34.8,-10.27,-52.29,-13.02,-65,-14.09,-75.61,-12.51,-83.82,-8.27,-94.07,-3.42,-104.85,6.92,10.62,4.33,-10.02,1.8,-30.47,-0.78,-48.27,-2.92,-62.56,-3.25,-76.12,-1.86,-85.29,2.61,-96.81,7.46,-108.92]},{"duration":60,"tweenEasing":0,"value":[0.01,-50.84,-0.45,-67.84,-0.88,-84.72,-0.99,-98.45,-0.87,-104.08,-0.32,-92.51,0.01,-83.15,0.01,-81.96,0.01,-80.41,0.01,-45.72,-0.57,-62.51,-1.18,-79.18,-1.3,-92.66,-0.82,-98.75,-0.4,-89.8,-0.68,-82.12,-0.43,-80.76,0.01,-79.02,0.01,-40.74,-0.63,-57.32,-1.36,-73.76,-1.48,-86.96,-0.78,-93.45,-0.6,-86.98,-1.5,-80.99,-0.91,-79.57,0.01,-77.74,-1.1,-35.94,-1.15,-52.66,-0.86,-69.12,-0.78,-81.61,-0.81,-87.74,-1.53,-83.39,-2.61,-79.42,-1.51,-78.69,-0.16,-77.58,-0.99,-30.49,-1,-47.78,-0.53,-64.5,-0.59,-75.53,-1.56,-80.71,-2.73,-79.05,-3.44,-78.02,-2.84,-78.82,-1.99,-79.4,0.8,-27.54,0.07,-44.57,-0.53,-60.69,-1.09,-69.43,-2.86,-73.35,-4.37,-74,-4.62,-75.98,-4.29,-78.63,-3.82,-81.22,0.9,-26.47,0.05,-42.87,-0.78,-58.47,-1.25,-66.94,-2.95,-70.34,-4.32,-72.19,-4.34,-75.12,-3.95,-78.2,-3.55,-81.29,0.47,-24.92,-0.1,-40.87,-0.61,-56.37,-0.64,-65.98,-1.52,-69.22,-2.24,-71.69,-2.25,-74.7,-2.04,-77.78,-1.84,-80.87,0.01,-23.32,-0.26,-38.83,-0.41,-54.23,0.01,-64.99,0.01,-68.08,0.01,-71.16,0.01,-74.24,0.01,-77.33,0.01,-80.41]},{"value":[15.36,-43.16,20.87,-61.82,26.48,-80.15,31.89,-93.86,36.05,-98.62,39.78,-90.82,39.6,-86.39,35.46,-90.04,30.98,-93.74,18.93,-40.44,23.05,-58.22,27.04,-75.68,31.46,-89.48,35.87,-94.98,39.91,-88.33,39.81,-84,36.21,-86.81,32.53,-89.57,22.16,-37.85,25.06,-54.76,27.65,-71.48,31.14,-85.31,35.54,-91.47,39.63,-85.88,39.64,-81.6,36.76,-83.52,33.96,-85.31,21.79,-35.98,24.77,-52.69,28.36,-69.33,31.37,-82.42,34.09,-87.55,36.62,-82.27,36.74,-78.44,35.1,-79.67,33.52,-80.74,24.26,-33.43,25.42,-50.71,27.27,-67.4,28.72,-78.33,29.24,-80.14,29.83,-75.13,29.89,-73.9,29.28,-76.12,28.85,-78.3,28.69,-31.56,27.11,-48.96,25.62,-65.39,25.12,-73.72,23.68,-72.23,22.58,-67.47,22.77,-69.13,23.71,-72.89,24.73,-76.71,29.37,-30.53,27.62,-48.01,25.8,-64.62,25.1,-72.74,23.89,-68.45,23,-62.6,23.17,-65.16,24.1,-69.59,24.94,-74.14,29.51,-29.26,28.93,-46.71,28.3,-63.58,28.28,-72.68,27.98,-65.83,27.83,-58.2,27.77,-60.69,27.56,-65.44,27.23,-70.34,29.66,-27.98,30.32,-45.34,31.01,-62.46,31.71,-72.48,32.35,-63.08,32.99,-53.67,32.68,-56.09,31.25,-61.16,29.71,-66.4]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_01","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32.5,-20.81,-32.74,-32.46,-32.95,-43.89,-33.01,-52.12,-32.94,-53.94,-32.66,-47.15,-32.49,-43.34,-32.49,-43.8,-32.49,-44.09,-32.32,-16.52,-32.61,-28.1,-32.92,-39.45,-33.53,-47.35,-34.68,-49.92,-34.64,-45.51,-34.04,-42.87,-33.28,-43.93,-32.48,-44.89,-32.22,-12.13,-32.54,-23.72,-32.9,-35.04,-34.04,-42.64,-36.39,-45.93,-36.57,-43.82,-35.54,-42.32,-34.05,-43.99,-32.48,-45.63,-32.19,-6.24,-32.64,-18.46,-32.94,-30.32,-34.44,-38.43,-37.27,-42.23,-37.35,-41.86,-35.91,-41.67,-33.88,-44.24,-31.57,-46.88,-26.52,-0.18,-28.36,-12.61,-30.17,-24.43,-32.21,-33.75,-34.45,-38.71,-34.23,-40.21,-31.9,-42.29,-27.87,-46.56,-23.77,-51,-19.82,5.49,-23.02,-6.62,-26.22,-17.9,-28.78,-28.19,-30.6,-34.9,-30.3,-38.92,-27.21,-43.52,-21.53,-49.58,-15.84,-55.86,-14.53,11.96,-17.85,-0.5,-21.09,-12.21,-23.6,-23.4,-25.24,-32.83,-24.84,-40.35,-22.19,-46.59,-17.41,-53.89,-12.24,-61.57,-5.1,16.57,-8.18,3.63,-11.15,-8.78,-13.48,-20.38,-14.83,-31.78,-14,-41.92,-11.82,-48.9,-7.59,-57.25,-3,-66.08,4.75,20.95,1.94,7.56,-0.72,-5.55,-2.86,-17.48,-3.93,-30.73,-2.62,-43.38,-0.88,-51.02,2.88,-60.43,6.95,-70.39]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-25.42,-0.23,-33.92,-0.44,-42.36,-0.49,-49.22,-0.43,-52.04,-0.16,-46.26,0,-41.58,0,-40.98,0,-40.21,0,-22.86,-0.28,-31.26,-0.59,-39.59,-0.65,-46.34,-0.41,-49.4,-0.2,-44.92,-0.34,-41.06,-0.21,-40.38,0,-39.51,0,-20.37,-0.32,-28.66,-0.68,-36.88,-0.74,-43.49,-0.39,-46.76,-0.3,-43.51,-0.75,-40.49,-0.45,-39.78,0,-38.87,-0.55,-17.97,-0.58,-26.33,-0.43,-34.57,-0.39,-40.81,-0.41,-43.88,-0.76,-41.7,-1.31,-39.71,-0.75,-39.34,-0.08,-38.79,-0.5,-15.25,-0.51,-23.92,-0.27,-32.29,-0.29,-37.77,-0.78,-40.37,-1.37,-39.53,-1.72,-39.01,-1.42,-39.41,-1,-39.7,0.4,-13.77,0.03,-22.3,-0.27,-30.37,-0.54,-34.72,-1.43,-36.68,-2.19,-37,-2.31,-37.99,-2.14,-39.31,-1.91,-40.61,0.45,-13.24,0.02,-21.44,-0.39,-29.23,-0.63,-33.47,-1.47,-35.17,-2.16,-36.09,-2.17,-37.56,-1.97,-39.1,-1.78,-40.64,0.24,-12.46,-0.05,-20.43,-0.3,-28.18,-0.32,-32.99,-0.76,-34.61,-1.12,-35.84,-1.13,-37.35,-1.02,-38.89,-0.92,-40.43,0,-11.66,-0.13,-19.41,-0.21,-27.11,0,-32.5,0,-34.04,0,-35.58,0,-37.12,0,-38.66,0,-40.21]},{"value":[22.86,-17.24,26.85,-27.5,30.79,-37.52,33.79,-44.87,35.85,-50.15,37.71,-49.14,37.37,-47.49,34.3,-50.45,30.97,-53.53,24.11,-17.31,27.58,-26.82,30.89,-36.14,33.57,-43.32,35.77,-47.9,37.78,-46.4,37.37,-44.68,34.61,-47.18,31.75,-49.74,25.2,-17.43,28.24,-26.22,31.03,-34.91,33.4,-41.93,35.6,-45.77,37.64,-43.72,37.19,-41.87,34.82,-43.85,32.47,-45.85,24.73,-17.37,27.75,-26.2,31.13,-34.95,33.31,-41.62,34.64,-43.73,35.87,-40.61,35.4,-38.65,33.66,-39.98,32.01,-41.31,26,-16.87,27.19,-26.11,28.76,-35.02,29.82,-40.56,30.1,-39.82,30.42,-35.64,30.2,-34.85,29.53,-36.53,29.01,-38.27,28.4,-17.27,27.2,-26.38,26.03,-34.98,25.71,-39.01,25.14,-35.56,24.74,-30.48,24.9,-31.14,25.72,-33.56,26.57,-36.07,28.92,-17.29,27.59,-26.59,26.19,-35.41,25.73,-39.27,25.37,-33.28,25.16,-26.51,25.35,-27.6,26.07,-30.49,26.72,-33.5,29.27,-16.8,28.97,-26.28,28.6,-35.41,28.6,-39.69,28.74,-31.21,28.95,-22.35,28.9,-23.34,28.58,-26.55,28.15,-29.9,29.66,-16.31,30.45,-25.93,31.22,-35.34,31.71,-39.99,32.35,-29.04,32.99,-18.09,32.68,-18.96,31.25,-22.5,29.7,-26.19]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_02","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-33.01,2.94,-33.01,-0.21,-33.01,-3.2,-33.01,-4.56,-33,-3.56,-33,-2.56,-32.99,-3.43,-32.99,-4.49,-32.99,-5.55,-32.83,4.64,-32.83,1.49,-32.83,-1.5,-33.38,-2.68,-34.77,-2.19,-34.94,-2.27,-34.35,-3.64,-33.66,-5.32,-32.99,-7.05,-32.72,6.44,-32.72,3.23,-32.72,0.2,-33.81,-0.81,-36.51,-0.84,-36.78,-1.98,-35.61,-3.82,-34.29,-6.08,-32.99,-8.42,-33,9.7,-33.25,5.78,-33.3,2.06,-34.65,0.46,-37.53,0.02,-37.19,-1.71,-35.49,-3.96,-33.86,-6.78,-31.99,-9.76,-27.56,13.55,-29.73,9.2,-31.88,5.07,-33.56,2.26,-35.21,0.65,-33.86,-1.53,-31.05,-4.74,-27.13,-8.75,-23.28,-12.96,-21.76,17.67,-25.67,13.53,-29.59,9.61,-31.42,5.61,-31.68,1.43,-29.3,-2.59,-25.58,-6.92,-19.95,-11.81,-14.43,-16.92,-18.2,24.04,-22.13,19.27,-25.88,14.76,-27.61,9.53,-27.55,1.7,-24.97,-5.72,-21.54,-11.03,-16.27,-16.66,-10.96,-22.59,-8.15,27.86,-11.65,22.38,-14.96,17.23,-16.68,11.53,-16.64,1.44,-13.9,-8.24,-11.14,-13.99,-6.92,-20.44,-2.58,-27.31,2.58,31.28,-0.45,25.13,-3.25,19.37,-4.95,13.3,-4.93,1.1,-1.98,-10.65,0.1,-16.76,3.15,-24.04,6.45,-31.85]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[30.35,8.68,32.82,6.82,35.1,5.11,35.68,4.12,35.66,-1.67,35.65,-7.46,35.14,-8.58,33.13,-10.86,30.97,-13.32,29.29,5.81,32.11,4.57,34.76,3.44,35.67,2.85,35.66,-0.81,35.66,-4.47,34.93,-5.35,33.01,-7.55,30.98,-9.92,28.25,3,31.41,2.31,34.43,1.69,35.67,1.48,35.67,-0.04,35.66,-1.56,34.73,-2.14,32.88,-4.17,30.98,-6.38,27.67,1.23,30.73,0.3,33.9,-0.58,35.26,-0.81,35.18,0.13,35.11,1.06,34.07,1.13,32.21,-0.29,30.5,-1.88,27.75,-0.31,28.96,-1.5,30.26,-2.62,30.91,-2.78,30.96,0.55,31.01,3.88,30.5,4.19,29.77,3.06,29.17,1.77,28.11,-2.99,27.29,-3.79,26.43,-4.54,26.3,-4.29,26.6,1.11,26.89,6.52,27.03,6.84,27.72,5.76,28.4,4.57,28.47,-4.06,27.57,-5.16,26.57,-6.19,26.35,-5.8,26.84,1.89,27.33,9.58,27.52,9.96,28.04,8.61,28.5,7.14,29.04,-4.34,29.02,-5.85,28.91,-7.24,28.92,-6.69,29.5,3.4,30.07,13.49,30.02,14.01,29.6,12.34,29.07,10.53,29.66,-4.65,30.58,-6.51,31.43,-8.23,31.7,-7.49,32.34,5,32.98,17.49,32.68,18.16,31.25,16.17,29.7,14.01]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_03","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32.38,57.84,-32.3,54.57,-32.23,51.34,-32.32,51.86,-32.62,56.25,-32.91,55.57,-32.95,47.5,-32.66,37.04,-32.34,26.5,-32.43,58.87,-32.39,54.94,-32.35,51.12,-32.88,52.34,-33.99,56.63,-34.19,54.07,-33.76,44.68,-33.19,33.15,-32.77,21.72,-32.54,60.04,-32.52,55.4,-32.52,50.92,-33.49,52.72,-35.48,56.67,-35.65,52.04,-34.71,41.44,-33.77,29.11,-33.16,17.04,-32.83,63.1,-33.11,56.92,-33.19,50.96,-34.38,51.82,-36.48,54.77,-36.11,48.76,-34.52,37.47,-32.92,24.75,-31.63,12.28,-27.1,66.46,-29.49,59.2,-31.92,52.24,-33.57,50.41,-34.52,50.63,-32.87,44.36,-30.1,32.83,-26.44,19.65,-22.97,6.5,-21.28,69.68,-25.53,62.32,-29.83,55.27,-31.73,50.83,-31.48,46.57,-28.64,38.67,-24.96,26.76,-19.98,13.42,-14.74,-0.11,-17.87,75.57,-22.02,67.11,-25.94,59.05,-27.67,52.44,-26.95,43.35,-23.64,32.28,-20.19,19.51,-15.93,5.69,-11.15,-8.44,-7.68,78.86,-11.39,69.29,-14.89,60.21,-16.61,52.59,-16.13,40.44,-12.85,27.2,-9.87,13.99,-6.4,-0.34,-2.62,-14.95,3.2,81.71,-0.05,71.08,-3.06,61.04,-4.81,52.54,-4.64,37.46,-1.44,22.21,1.1,8.64,3.78,-6.17,6.59,-21.24]},{"duration":60,"tweenEasing":0,"value":[-0.04,55.66,0.04,55.53,0.12,55.29,0.02,57.17,-0.28,60.56,-0.58,58.88,-1,51.63,-2.21,42.01,-3.52,32.31,-0.27,54.98,-0.22,54.21,-0.18,53.37,-0.26,55.93,-0.51,60.1,-0.77,57.6,-1.27,49.37,-2.46,39.05,-3.83,28.78,-0.48,54.35,-0.47,52.91,-0.46,51.46,-0.52,54.59,-0.87,59.3,-1.2,55.75,-1.76,46.65,-2.77,35.87,-4.12,25.27,-0.5,54.15,-0.53,51.88,-0.55,49.65,-0.61,52.44,-1.1,56.75,-1.56,52.55,-2.03,43.12,-2.58,32.18,-3.63,21.68,-0.21,53.66,-0.44,50.74,-0.71,47.9,-0.8,49.04,-0.84,51.43,-0.83,47.61,-0.99,38.83,-1.12,27.94,-1.61,18,-0.19,52.76,-0.53,49.53,-0.91,46.41,-0.99,45.99,-0.6,46.09,-0.15,42.34,-0.09,34.23,-0.06,23.54,-0.15,14.33,-0.34,52.28,-0.56,48.58,-0.73,45.03,-0.77,43.61,-0.62,42.16,-0.43,38.42,-0.28,30.94,-0.08,20.39,0.08,11.01,-0.19,51.75,-0.42,47.65,-0.59,43.72,-0.63,41.74,-0.46,39.32,-0.27,35.76,-0.08,28.95,0.23,18.52,0.51,8.53,-0.04,51.18,-0.27,46.7,-0.48,42.42,-0.51,39.92,-0.29,36.56,-0.06,33.19,0.19,27.05,0.58,16.72,0.98,6.11]},{"value":[30.31,64.33,33.17,62.2,35.81,60.1,36.34,60.98,35.72,58.73,35.1,51.41,34.13,43.05,30.92,31.15,27.45,18.98,30.93,60.9,33.87,58.77,36.51,56.69,37.24,58.61,36.1,59.2,34.97,53.12,33.66,44,30.54,31.49,27.15,18.86,31.28,57.47,34.37,55.3,37.11,53.19,38.06,56.02,36.32,59.22,34.59,54.19,32.97,44.49,30.1,31.69,26.87,18.88,30.23,54.59,33.46,51.7,36.74,48.88,37.92,51.63,35.79,56.91,33.7,53.62,32.05,44.25,29.63,31.89,26.87,19.8,29.29,52.55,30.79,48.65,32.29,44.89,32.84,46.04,31.55,51.9,30.3,51.5,29.51,43.01,28.65,31,27.56,19.76,28.07,49.69,27.78,45.48,27.38,41.45,27.3,41.24,27.04,46.97,26.83,48.84,26.93,41.07,27.66,29.31,28.25,18.9,28.13,48.22,27.78,43.23,27.42,38.46,27.29,37.39,27.11,43.83,26.98,47.98,27.23,40.9,27.97,29,28.58,18.16,28.85,47.41,29.01,41.7,29.13,36.29,29.18,34.83,29.5,42.61,29.84,49.23,29.95,42.95,29.83,30.86,29.59,19.06,29.62,46.53,30.31,40.19,30.94,34.19,31.19,32.43,32.06,41.56,32.93,50.68,32.86,45.21,31.82,32.89,30.68,20.12]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_04","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-31.75,112.75,-31.59,109.35,-31.44,105.88,-31.63,108.29,-32.23,116.06,-32.83,113.71,-33.09,99.58,-33.22,84.21,-33.36,69.06,-32.04,113.1,-31.94,108.4,-31.86,103.74,-32.38,107.41,-33.2,116.05,-33.44,111.59,-33.61,95.77,-33.86,77.73,-34.08,59.8,-32.36,113.64,-32.33,107.56,-32.31,101.63,-33.16,106.31,-34.43,115.3,-34.53,108.32,-34.53,90.95,-34.58,70.67,-34.69,50.39,-32.67,116.51,-32.98,108.06,-33.07,99.88,-34.11,103.16,-35.43,110.63,-35.04,101.65,-34.32,83.2,-33.19,61.6,-32.24,39.84,-26.63,119.36,-29.24,109.22,-31.96,99.43,-33.59,98.55,-33.82,101.2,-31.87,91.53,-29.6,72.92,-26.54,51.46,-23.35,29.74,-20.8,121.69,-25.39,111.12,-30.07,100.94,-32.03,96.01,-31.27,91.75,-27.98,80.06,-24.44,60.92,-20.24,39.44,-15.23,17.66,-17.54,127.1,-21.9,114.96,-26.01,103.35,-27.72,95.35,-26.35,85.01,-22.31,70.28,-18.86,50.03,-15.56,28.03,-11.34,5.72,-7.21,129.87,-11.14,116.19,-14.81,103.19,-16.55,93.65,-15.62,79.45,-11.81,62.64,-8.61,41.95,-5.88,19.76,-2.66,-2.59,3.83,132.15,0.34,117.02,-2.88,102.71,-4.66,91.77,-4.36,73.83,-0.9,55.08,2.11,34.04,4.42,11.7,6.74,-10.63]},{"duration":60,"tweenEasing":0,"value":[-0.08,111.31,0.09,111.06,0.24,110.57,0.04,114.35,-0.56,121.12,-1.16,117.77,-2.01,103.26,-4.42,84.02,-7.04,64.61,-0.54,109.95,-0.45,108.41,-0.36,106.74,-0.51,111.89,-1.03,120.28,-1.53,115.22,-2.55,98.73,-4.94,78.09,-7.66,57.56,-0.97,108.7,-0.94,105.83,-0.92,102.93,-1.04,109.23,-1.74,118.71,-2.41,111.55,-3.52,93.29,-5.56,71.73,-8.24,50.54,-1.01,108.3,-1.06,103.77,-1.1,99.3,-1.22,104.92,-2.2,113.59,-3.13,105.12,-4.05,86.23,-5.19,64.38,-7.26,43.35,-0.41,107.31,-0.87,101.49,-1.42,95.82,-1.6,98.14,-1.67,102.97,-1.66,95.25,-1.98,77.63,-2.25,55.91,-3.22,36,-0.38,105.52,-1.07,99.07,-1.82,92.83,-1.99,91.99,-1.2,92.2,-0.3,84.68,-0.19,68.46,-0.12,47.09,-0.3,28.67,-0.67,104.55,-1.13,97.17,-1.46,90.07,-1.54,87.21,-1.24,84.3,-0.85,76.83,-0.57,61.89,-0.15,40.78,0.17,22.03,-0.39,103.5,-0.83,95.3,-1.19,87.44,-1.25,83.48,-0.92,78.64,-0.54,71.51,-0.15,57.9,0.46,37.04,1.03,17.05,-0.08,102.37,-0.54,93.39,-0.97,84.84,-1.03,79.85,-0.57,73.11,-0.11,66.37,0.37,54.1,1.15,33.45,1.95,12.21]},{"value":[30.28,119.99,33.52,117.57,36.52,115.09,37,117.83,35.77,119.12,34.54,110.29,33.13,94.67,28.71,73.17,23.93,51.29,32.58,115.99,35.64,112.96,38.26,109.95,38.8,114.4,36.54,119.28,34.29,110.73,32.38,93.35,28.03,70.5,23.31,47.64,34.31,111.95,37.32,108.28,39.78,104.69,40.45,110.61,36.97,118.59,33.52,109.97,31.22,91.12,27.27,67.51,22.75,44.15,32.79,107.94,36.18,103.1,39.58,98.35,40.58,104.11,36.4,113.77,32.28,106.21,30.04,87.33,27.02,64.08,23.24,41.47,30.84,105.41,32.62,98.8,34.32,92.41,34.78,94.9,32.14,103.35,29.59,99.15,28.53,81.75,27.52,58.99,25.95,37.76,28.04,102.37,28.27,94.75,28.33,87.44,28.29,86.78,27.48,92.84,26.77,91.17,26.84,75.29,27.6,52.86,28.11,33.23,27.8,100.5,28,91.62,28.26,83.13,28.22,80.58,27.38,85.76,26.63,86.36,26.95,71.85,27.89,49.39,28.66,29.17,28.65,99.16,28.99,89.25,29.35,79.82,29.44,76.36,29.51,81.81,29.61,84.97,29.87,71.91,30.06,49.38,30.1,27.58,29.58,97.72,30.04,86.88,30.46,76.62,30.67,72.36,31.77,78.11,32.87,83.86,33.05,72.25,32.4,49.62,31.65,26.23]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.00","timeline":[{"name":"D_MOUTH.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.00_00","timeline":[{"name":"D_MOUTH.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[25.3,51.19,-38.74,54.35,-71.15,33.55,-61.71,28.87,-25.93,9.59,32.17,7.28,63.19,28.81,62.11,42.77,22.52,31.54,-24.36,31.6]},{"duration":60,"tweenEasing":0,"value":[25.07,-1.51,-22.66,4.98,-50.98,31.03,-35.86,68.35,-8.29,80.3,31.19,79.01,47.32,51.46,49.04,7.68,21.86,34.76,-7.81,32.72]},{"value":[27.29,-9.01,-38.31,-4.31,-58.89,31.54,-23.93,64.33,-6.51,76.3,10.19,69.95,47.41,47.56,58.98,11.61,4.41,30.95,-7.66,27.23]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.00_01","timeline":[{"name":"D_MOUTH.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[11.6,16.87,-14.75,17.03,-52.36,13.58,-37.22,6.39,-10.07,11.3,13.12,11.72,46.62,11.89,46.81,13.86,10.75,14.44,-9.04,14.56]},{"duration":60,"tweenEasing":0,"value":[5.95,-7.11,-12.72,-7.62,-22.53,19.46,-17.95,57.53,-8.11,74.11,7.28,75.5,17.07,49.19,17.27,9.32,5.62,32.53,-7.68,31.49]},{"value":[3.53,-26.15,1.85,-26.87,1.58,10.78,4.36,63.83,4.8,88.07,4.45,89.55,4.03,53.02,4.27,-3.05,4.24,29.4,4.22,27.87]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.00_02","timeline":[{"name":"D_MOUTH.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":19},{"duration":60,"tweenEasing":0,"value":[-0.39,9.98,2.61,9.67,-0.41,-4.99,5.81,40.99,4.15,35.66,0.26,34.71,-0.66,8.61,-1.85,5.99,-21.87,4.86,12.67,20.55]},{"value":[0.35,-33.44,5.22,-34.25,8.57,8.1,10.2,67.62,7.22,95.32,0.68,96.83,-3.31,55.86,-3.09,-7.4,1.2,29.11,6.45,27.39]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.03","timeline":[{"name":"D_MOUTH.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.03_00","timeline":[{"name":"D_MOUTH.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[53.29,10.63,36.88,21.26,3.84,22.88,-42.9,23.63,-65.75,9.33,-68,-7.38,-40.79,-9.14,-5.71,-11.78,22.21,-7.17,44.54,-4.44,-21.21,3.51,-58.53,5.13,30.27,5.91]},{"duration":60,"tweenEasing":0,"value":[41.49,0.02,28.62,-13.8,3.54,-22.36,-32.94,-22.27,-51.66,-22.65,-52.77,-22.6,-31.24,-22.86,-3.57,-29.22,16.87,-10.14,33.47,-3.41,-16.28,-22.62,-45.87,-22.64,23.17,-13.77]},{"value":[43.61,-31,28.45,-57.29,-2.05,-70.54,-46.65,-64.91,-69.28,-63.05,-71.53,-63.63,-46.35,-67.07,-12.57,-69.94,12.36,-48.26,32.81,-36.85,-27,-68.1,-62.73,-64.37,21.04,-56.22]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.03_01","timeline":[{"name":"D_MOUTH.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[39.53,63.91,22.33,60.44,8,71.29,-24.98,75.26,-46.87,15.88,-49.07,17.6,-16.91,0.1,-4.87,0.05,15.29,2,36.56,32.95,-12.81,24.53,-42.46,22.95,24.28,31.2]},{"duration":60,"tweenEasing":0,"value":[7.51,5.21,1.06,-8.58,-10.81,-17.19,-27.89,-17.11,-37.05,-17.27,-37.63,-17.21,-27.32,-17.37,-14.42,-17.28,-5.85,-5.34,2.7,1.76,-20.26,-17.22,-34.14,-17.23,-2.21,-8.57]},{"value":[0.32,-5.13,-2.66,-32.72,-7.18,-49.94,-14.91,-49.85,-19.64,-50.18,-20.03,-50.4,-15.18,-50.38,-9.24,-50.21,-7.17,-25.9,-4.19,-12.03,-12.13,-50.28,-18.89,-50.45,-5.3,-32.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.03_02","timeline":[{"name":"D_MOUTH.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":25},{"duration":60,"tweenEasing":0,"value":[1.9,-1.68,-1.01,-15.48,-5.98,-24.07,-13.49,-23.98,-17.89,-24.2,-17.94,-24.16,-13.15,-24.1,-7.65,-24.15,-4.68,-12.16,-1.12,-5.13,-10.34,-24.15,-16.77,-24.19,-2.85,-15.46]},{"value":[0.42,10.38,-2.28,-17.2,-6.2,-34.42,-13.14,-34.33,-17.39,-34.66,-17.24,-34.52,-12.86,-34.47,-7.75,-34.48,-6.57,-10.42,-3.96,3.49,-10.33,-34.52,-16.35,-34.6,-4.78,-17.18]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.01","timeline":[{"name":"D_MOUTH.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.01_00","timeline":[{"name":"D_MOUTH.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[46,85.21,27.16,29.8,2.44,-12.45,-33.44,9.75,-51.56,56.73,-57.85,81.11,-60.41,17.05,0,0,0,0,0,0,0,0,18.14,1.15,56.75,10.57,60.97,34.88,-6.97,-16.39,-30.26,-6.71,-44.06,20.23,-68.32,51.72,-43.34,-10.92,17.47,-22.55,60.45,78.85,52.61,58.43,37.37,69.47,48.9,32.25,23.06,-3.02,13.75,-16.15,-30.04,-14.23,-40.65,1.89,-55.53,32.6,-60.68,52.75,-62.84,76.97,-54.36,72.06,-60.84,64.47,-5.35,-21.22,40.8,50.11,45.57,63.34,39.65,30.04,24,8.65,30.07,47.86,10.37,-15.13,16.2,-0.04,-16.3,-17.58,-30.04,-6.29,-20.15,-12.18,-35.83,1.74,-46.32,20.07,-44.32,33.03,-53.69,38.64,-56.96,54.28,-58.17,65.71,34.26,18.37,17.32,-3,16.45,-9.33,-2.77,-16.93,-10.59,-15.08,50.52,43.66,-24.14,-11.14,-1.5,-16.22,11.82,-15.57]},{"duration":60,"tweenEasing":0,"value":[43.72,82.63,26.82,64.05,4.21,43.06,-22.6,54.93,-42.37,76.32,-44.87,67.18,-53.64,-5.02,12.1,-27.27,27.84,-9.46,6.27,18.33,-27.31,-6.63,10.96,-35.53,21.04,27.35,46.73,59.62,-9.06,12.99,-10.29,4.58,-28.59,13.12,-50.01,68.02,-23.02,39.68,11.53,38.52,51.61,64.71,45.14,63.96,38.83,72.47,39.37,58.15,15.37,43.11,12.97,46.06,-21.55,47.46,-23.89,45.98,-37.58,61.62,-43.98,68.26,-50.43,76.5,-48.21,75.76,-42.74,58.75,1.56,42.08,36.63,64.61,43.39,67.02,32.45,59.41,19.75,49.34,30.76,67.53,9.03,41.9,15.21,49.78,-11.99,45.2,-18.29,47.11,-13.38,43.18,-23.02,47.69,-30.02,54.68,-32.91,67.21,-39.35,64.24,-44.68,72.41,-47.83,73.17,28,53.62,11.57,46.29,13.05,44.06,0.38,45.1,-6.77,46.29,40.42,60.9,-15.98,46.59,1.74,43.1,10.25,44.45]},{"value":[45.37,84.3,25.41,81.24,6.14,75.75,-13.83,82.97,-33.63,89.41,-44.8,73.45,-46.31,-26.16,24.21,-54.46,55.67,-18.94,12.54,36.64,-32.9,-3.97,9.28,-36.83,14.91,30.54,40.77,59.58,-11.15,42.34,5.09,16.87,-13.83,7.72,-36.6,75.57,-13.43,65.04,11.57,74.22,54.57,68.26,45.33,68.03,41.05,78.98,36.34,69.91,13,67.31,10.84,77.79,-15.34,76.91,-12.97,74.89,-26.07,75.45,-32.77,76.75,-41.38,76.78,-41.7,80.16,-41.27,62.14,6.02,75.51,37.44,71.48,43.61,71.34,34.28,73.45,16.63,69.18,30.53,80.27,8.55,72.81,14.49,81.12,-8.41,78.26,-10.67,77.07,-6.94,77.88,-12.96,75.38,-21.31,76.88,-22.92,89.04,-30.1,81.02,-35.03,85.71,-39.63,85.12,24.4,69.29,10.86,72.85,8.49,71.07,0.48,76.48,-3.47,77.03,40.1,68.81,-10.38,79.06,1.94,76.09,9.18,74.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.01_01","timeline":[{"name":"D_MOUTH.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[18.95,63.08,20.84,5.19,1.3,-27.05,-27.41,-8.62,-32.99,22.83,-24.41,52.7,-36.85,3.84,0,0,0,0,0,0,0,0,18.14,1.15,40.6,14.18,47.74,30.72,-5.77,-15.9,-30.26,-6.71,-26.97,5.94,-45.1,30.55,-31.86,-9.47,14.81,-12.9,36.65,75.75,34,45.13,19.53,46.88,37.14,20.75,19.15,-5.66,9.58,-14.55,-20.25,-13.36,-31.14,-5.29,-40.32,15.2,-40.29,29.89,-38.76,50.13,-33.3,43.93,-35.13,44.22,-6.65,-11.18,28.56,30.81,27.78,45.19,30.97,14.86,20.33,-2.29,20.18,23.11,10.18,-20.35,13.73,-16.65,-10.65,-19.52,-23.46,-12.38,-17.15,-24.83,-29.04,-8.9,-35.7,4.16,-30.85,7.75,-38.55,16.99,-38.74,28.63,-38.66,36.3,27.26,7.2,15.36,-11.14,14.48,-13.31,-1.54,-17.28,-7,-13.89,35.77,31.38,-17.96,-15.45,0.92,-19.98,9.92,-17.86]},{"duration":60,"tweenEasing":0,"value":[14.25,55.8,9.95,57.89,-1.37,66.17,-9.73,71.75,-17.84,58.94,-20.77,42.1,-22.65,-37.85,35.09,-59.93,29.71,14.78,3.83,34.39,-18.62,20.1,-9.63,-22.89,7,49.72,18.51,54.8,-10.86,53.93,1.65,44.67,4.26,-2.43,-14.75,51.1,-3.95,65.91,-6.9,65.31,19.2,61.37,18.44,42.18,15.51,50.7,12.91,51.27,-7.63,51.97,-9.22,70.74,-6.24,78.55,-3.4,69.83,-12.79,62.99,-14.92,53.41,-22.67,46.43,-23.1,49.48,-17.42,35.77,-6.83,83.84,13.72,43.86,17.16,45.44,12.42,51.95,0.26,54.32,9.55,55.01,0.13,67.57,2.73,61.36,-6.68,76.48,-5.83,75.61,-6.52,68.99,-7.39,69.42,-11.59,64.15,-11.03,60.91,-15.66,60.01,-18.62,58.88,-19.46,50.22,5.26,52.48,-2.99,59.99,-2.78,64.66,-4.77,77.01,-5.68,81.68,15.26,44.61,-5.68,77.61,-1.86,74.35,0.61,71.56]},{"value":[12.92,39.57,2.72,63.33,-5.06,78.39,1.77,80.84,-7.07,60.65,-19.1,21.87,-8.67,-79.33,70.08,-119.79,28.86,23.25,7.64,68.72,-37.23,40.15,-37.59,-46.98,-17.21,57.94,5.57,52.73,0.01,74.15,18.65,42.73,25.92,-32.81,3.23,42.28,11.3,74.79,-15.78,79.64,13.28,44.85,9.58,22.73,12.95,33.07,2.3,46.59,-21.06,56.56,-19.86,84.56,-0.1,89.63,6.41,81.22,5.32,63.82,1.53,43.33,-10.46,22.8,-15.23,34.57,-5.54,11.29,-7.52,95.69,3.43,30.87,11.05,27.11,0.95,50.85,-11.57,59.15,2.51,52.65,-7.21,78.48,-5.58,71.6,-6.55,87.89,3.23,86.18,-1.43,79.9,5.24,77.68,4.32,67.65,3.61,64.34,-0.11,59.26,-5.95,52.14,-8.49,35.51,-7.4,53.96,-15.05,67.24,-13.45,74.37,-7.27,89.14,-6.49,93.28,3.05,33.08,-0.43,88.59,-4.53,86.45,-4.5,84.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.01_02","timeline":[{"name":"D_MOUTH.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":117},{"duration":60,"tweenEasing":0,"value":[-1.19,-2.18,-5.73,27.27,-5.33,51.16,11.9,38.59,-2.03,11.19,2.58,-14.22,7.72,-64.47,23.98,17.74,1.12,33.88,5.09,41.66,-15.33,31.93,-38.39,-35.53,-8.35,30.73,-12.2,5.29,-5.24,61.57,17.25,31.35,15.54,11.42,2.78,-1.91,23,44.96,-17.45,52.79,-1.78,-15.91,0.3,-5,1.72,0.53,-4.66,8.82,-20.46,22.27,-19.81,58.76,13.11,59.1,15.32,43.76,6.8,18.96,0.73,2.72,-7.62,-3.04,-7.27,1.06,0.87,-11.69,-1.68,68.21,-2.91,2.85,1.87,-1.41,-5.11,12.78,-11.32,25.93,-5.64,15.2,-12.7,44.78,-9.4,39.4,-4.18,62.43,8.53,52.32,3.37,45.37,10.78,37.22,6.77,25.37,6.04,25.78,3.59,10.49,-2.21,5.64,-5.69,0.14,-9.27,18.4,-16.48,33.66,-14.46,41.4,-11.91,62.78,-0.68,68.64,-3.96,-1.85,7.77,59.17,-9,55.24,-16.51,49.2]},{"value":[4.36,-3.36,-7.33,32.57,-7.21,75.96,10.4,63.9,-3.45,17.85,-12.55,-7.45,-5.37,43.95,-3.32,50.54,-2.79,49.51,-3.82,50.24,-4.6,51.17,-16.69,-12.04,17.79,69.27,-5.13,-1.96,-3.92,37.78,1.1,42.28,-7.13,58.69,5.35,-4.17,11.26,72.21,-18.7,72.87,1.83,-11.98,2.61,-2.99,2.59,2.17,-6.72,9.17,-24.26,32.71,-19.22,72.52,9.7,74.71,14.21,61.36,10.26,23.97,2.56,5.24,-7.08,-6.45,-10.46,2.52,-0.08,-17.42,-3.29,78.21,-2.37,0.94,3.16,-1.54,-2.17,22.07,-14.7,34.72,-3.33,17.63,-17.4,61.25,-11.37,54.11,-7.05,81.57,10.63,73.41,6.62,72.05,12.53,58.07,11.5,38.02,5.67,36.87,6.07,20.11,-0.6,9.57,-4.18,1.29,-12.5,26.04,-16.88,48.4,-18.76,51.09,-16.54,75.9,-1.43,78.59,-3.42,-1.36,4.25,80.62,-12.35,74.2,-18.2,63.45]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.02","timeline":[{"name":"D_MOUTH.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.02_00","timeline":[{"name":"D_MOUTH.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[58,128.85,8.18,201.42,-21.83,141.41,-45.34,49.15,5.63,-4.42,18.82,48.24,5.05,191.03,-37.79,203.48,-71.73,131.49,-64.48,53.36,-23.23,-17.76,22.98,-6.06,50.86,54.35,29.42,82.79,29.6,-4.63,-17.05,-10.38,-42.98,42.25,-53.14,114.81,-4.64,99.99,-6.28,-20.63,-17.85,36.33,-13.57,104.13,27.12,152.31,-61.2,147.76,-32.36,119.4,-33.93,154.19,-64.06,115.92,-61.42,77.01,-56.11,46.06,-39.86,2.74,-22.62,-20.93,-0.94,-29.39,-77.25,102.28,21.8,-8.58,36.83,23.98,45.15,63.65,45.88,103.23,59.07,84.99,42.24,124.52,40.68,155.7,-3.31,15.09,34.93,46.57,31.31,14.86,23.44,46.93,22.62,-4.34,13.46,-19.91,-11.41,-24.86,-22.61,-18.62,-32.1,-5.53,-39.51,17.18,-28.88,9.78,-48.66,44.63,-54.67,64.5,-55.9,97.22,-48.71,78.57,-58.86,117.33,40.32,73.11,39.46,96.33,40.02,117.94,27.13,116.11,-51.19,15.27,-0.83,-13.79,40.72,22.34,-13.07,-25.2,-11.51,-25.54,14.94,68.56,14.33,8.55,17.35,-10.09,-13,-14.24,8.23,-7.26,-29.75,19.58,-28.6,63.9]},{"duration":60,"tweenEasing":0,"value":[60.61,133.65,8.18,185.25,-21.83,125.24,-45.35,32.98,5.43,-20.59,18.66,32.06,4.58,174.57,-30.01,192.45,-61.83,129.71,-58.03,18.89,-25.81,-70.78,17.42,-42.78,44.48,45.72,31.18,46.7,32.28,-44.09,-14.79,-53.89,-44.74,0.59,-37.2,118.62,-5.16,83.5,-6.34,-36.82,-17.84,20.16,-13.59,87.95,24.49,162.87,-51.5,148.28,-27.92,97.87,-18.92,149.78,-53.76,122.05,-54.4,57.23,-51.32,17.08,-40.8,-33.57,-23.97,-59.67,-1.6,-65.61,-65.25,91.42,22.89,-40.5,38.62,1.4,42.81,62.53,45.8,112.19,55.55,89.68,43.32,137.05,42.88,168.22,-3.31,-1.09,35.72,23.35,33.02,-19.08,25.31,10.82,23.08,-38.02,14.72,-56.54,-11.89,-64.33,-19.29,-56.34,-30.28,-41.37,-40.27,-15.71,-29.13,-24.15,-46.2,17.87,-49.89,40.45,-47.2,85.9,-44.16,54.7,-48.73,118.19,36.77,63.55,37.42,94.57,37.99,119.74,26.43,98.2,-47.03,-26.72,-2.48,-67.17,37.69,-3.82,-13.08,-69.61,-11.68,-65.62,16.16,38.56,16.15,-23.41,19.1,-41.61,-11.61,-47.47,10.72,-48.58,-30.9,-12.9,-29.9,31.68]},{"value":[63.22,138.45,8.18,169.08,-21.83,109.08,-45.35,16.81,5.23,-36.75,18.51,15.88,4.1,158.11,-33.27,147.22,-51.92,127.92,-52.1,-12.96,-24.97,-112.35,13.73,-74.9,40.5,41.02,31.72,5.4,32.08,-78.37,-17.17,-83.74,-45.1,-33.17,-32.05,98.71,-5.68,67.02,-6.4,-53,-17.83,3.99,-13.62,71.77,24.13,169.56,-41.81,148.81,-23.48,76.35,-26.19,111.13,-45.03,122.91,-47.38,37.46,-48.69,-13.9,-40.65,-73.15,-24.77,-100.38,-2.36,-107.05,-54.79,85.19,21.18,-75.11,33.53,-23.26,37.5,61.37,45.72,121.14,52.04,94.37,44.41,149.57,45.09,180.74,-3.32,-17.26,35.08,-2.21,35.34,-53.74,25.75,-30.54,25.06,-74.65,16.79,-90.61,-9.97,-98.4,-21.66,-94.39,-28.35,-75.95,-41.89,-55.23,-27.96,-64.98,-49.02,-24.79,-48.66,8.44,-38.51,74.59,-37.57,27.59,-38.6,119.04,35.25,50.77,35.38,92.81,35.95,121.54,24.09,75.41,-41.46,-62.09,-4.8,-108.8,34.66,-29.99,-13.33,-110.74,-11.41,-105.38,16.54,4.97,16.02,-51.87,18.95,-69.71,-12.78,-74.61,9.77,-82.61,-31.01,-48.73,-30.49,4.75]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.02_01","timeline":[{"name":"D_MOUTH.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[35.11,94.12,-8.11,134.34,-16.19,63.59,-14.97,-5.99,-10.97,-22.53,23.58,-5.83,11.59,94.61,-16.37,125.82,-45.15,92.51,-42.61,29.76,-18.85,-23.3,17.62,-10.6,36.96,32.44,19.6,36.64,17.06,-12.25,-15.43,-21.44,-32.99,10.33,-30.42,58.64,-4.45,10.53,-13.47,-23.54,-3.7,0.02,-13.8,49.49,3.26,82.66,-31.2,97.8,-21.06,37.45,-15.13,69.81,-39.13,72.08,-39.46,42.19,-39.36,18.34,-32.85,-10.61,-19,-23.38,-0.47,-29.06,-49.79,67.77,18.89,-16.15,29.78,5.84,34.09,36.77,29.75,68.05,41.18,57.71,23.9,83.64,20.25,109.51,-3.16,-12.93,26.08,21.07,26.27,1.27,18.17,14.57,18.05,-16.37,13.38,-24.58,-11.06,-29.42,-19.03,-27.31,-25.89,-17.52,-31.7,-3.51,-25.34,-9.9,-35.1,14.5,-37.72,29.81,-34.07,53.59,-33.88,35.28,-35.41,64.93,28.63,41.89,25.36,56.29,21.14,72.8,11.37,60.04,-37.75,2.71,-0.79,-17.01,30.8,8.52,-10.06,-26.05,-9.63,-26.25,12.46,25.42,10.38,-8.3,6.64,-16.1,-14.69,-22.23,2.18,-16.46,-25.95,-1.88,-22.29,10.41]},{"duration":60,"tweenEasing":0,"value":[30.82,98.56,-15.67,171.77,-43.79,120.21,-51.14,30.11,11.3,-11.41,57.56,32.47,36.73,129.82,5.14,166.39,-29.79,100,-28.42,-12.48,-14.95,-92.95,1.5,-72.25,22.72,6.47,-4.23,35.44,-5.65,-70.74,-11.24,-109.1,-9.71,-33.27,-8.04,61.27,23.48,0.52,-6.28,-49.21,-29.38,1.46,-37.07,79.59,-9.98,119.71,-16.52,123.92,6.71,36.53,7.29,84.61,-23.9,87.69,-19.1,28.47,-20.9,-17.24,-16.94,-72.31,-13.75,-92.7,-7.26,-98.8,-37.97,34.68,-1.44,-71.45,8.53,-29.12,15.45,25.18,19.77,77.54,31.62,45.34,15.01,106.42,14.33,134.71,-7.96,-25.23,5.35,-3.16,4.71,-44.48,-8.37,-11.18,-3.83,-69.37,-1.82,-92.25,-9.43,-104.2,-13.03,-96.42,-13.8,-83.14,-11.93,-56.5,-7.92,-70.81,-15.11,-23.81,-16.02,2.06,-13,43.95,-13.1,12.99,-15.47,86.48,10.49,28.83,11.16,51.67,8.51,93.59,-4.47,74.72,-23.61,-58.67,-7.37,-85.13,16.31,-38.42,-11,-96.04,-10.17,-96.11,-11.94,25.03,-13.29,-47.51,-5.87,-63.39,-9.37,-86.58,-8.21,-88.32,-8.47,-39.01,2.74,-20.6]},{"value":[28.27,77.71,-23.08,209.57,-71.46,176.65,-87.27,66.29,33.5,-0.16,91.59,70.57,61.83,165.05,9.09,127.14,-22.17,72.06,-20.14,-46.97,-14.05,-136.49,8.61,-119.32,12.62,-19.54,-21.98,24.3,0.66,-113.31,-6.47,-133.33,-3.15,-65.27,6.42,48.91,51.5,-9.39,0.84,-74.78,-55,2.96,-60.39,109.41,-21.57,123.69,-6.55,88.59,26.16,25.02,28.83,94.88,-14.76,53.18,-11.95,-3.93,-14.23,-53.99,-16.97,-114.72,-12.12,-135.97,-1.85,-143.85,-28.19,12.63,4.99,-117.97,2.83,-66.6,5.73,1.97,10.84,51.08,21.55,34.96,12.58,85.61,9.7,139.68,-12.78,-37.52,-4.41,-34.22,7.23,-91.21,-17.77,-48.02,3.52,-116.27,4.58,-134.27,-6.12,-143.79,-10.97,-139.5,-13.44,-125.17,-10.16,-98.24,-7.83,-112.48,-7.89,-58.19,-8.61,-27.04,-5.18,14.32,-0.04,-5.26,-5.71,58.97,-2.13,9.66,-1.01,43.31,1.54,74.7,-19.45,86.79,-23.71,-100.38,-3.08,-128.35,18.98,-80.73,-8.22,-140.01,-6.93,-139.95,-32.1,17.76,-17.25,-75.89,0.72,-100.16,-3.72,-111.31,-2.6,-122.48,-1.71,-68.7,17.34,-44.31]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.02_02","timeline":[{"name":"D_MOUTH.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":143},{"duration":60,"tweenEasing":0,"value":[8.14,20.52,-17.23,54.58,-29.04,43.42,-34.34,10.06,-20.78,-20.53,37.73,10.01,29.1,60.29,9,62.02,-12.95,19.19,-6.16,-37.13,-2.66,-95.72,-0.91,-80.45,5.32,-29.87,-8.58,-13.29,-5.48,-76.28,-4.9,-114.9,1.7,-61.52,3.64,9.65,9.94,-28.34,4.01,-44.87,-19.34,-26.19,-18.05,-1.98,-15.72,16.65,-7.3,34.98,18.88,5.67,14.75,33.29,-10.39,12.42,-7.58,-16.26,-6.58,-43.45,-0.71,-77.1,-6.06,-96.53,-3.68,-100.57,-15.16,1.04,-1.85,-81.03,0.07,-52.03,1.15,-17.4,2.48,11.17,8.43,-1.44,0.85,20.12,-3.53,34.95,-10.79,-23.41,-2.66,-39.2,-1.61,-60.1,-8.25,-41.63,-3.99,-77.04,-2.55,-90.72,-4.75,-101.26,-6.87,-100.71,1.41,-88.74,-0.25,-70.7,3.56,-83.99,-1.18,-45.27,-2.61,-27.76,-1.99,-0.8,3.39,-12.98,-6.49,13.19,-3.02,-16.71,-3.25,-0.33,-4.05,10.88,-12.3,1.71,-6.15,-70.57,-1.68,-86.83,3.61,-59.57,-2.45,-96.12,-2.96,-100.56,-11.88,-17.24,-9.94,-60.16,-2.24,-65.56,-1.55,-88.56,-5.21,-93.97,2.53,-55.52,4.79,-49.08]},{"value":[12.87,32.73,-29.65,69.91,-58.2,86.8,-68.61,19.93,-41.8,-41.13,76.38,20.82,51.47,93.89,12.39,85.83,-17.52,24.38,-9.71,-55.22,-3.37,-126.51,4.74,-109.36,9.29,-36.17,-7.93,-12.2,-3.41,-89.31,0.01,-116.28,2.98,-63.64,3.71,9.3,20,-56.27,31.54,-50.92,-38.36,-52.83,-35.88,-3.92,-17.85,24,-7.76,45.07,26.64,1.82,20.7,42.87,-11.23,14.73,-7.5,-24.08,-5.19,-57.08,-5.62,-104,-4.93,-123.3,-0.45,-128.77,-21.01,-2.15,3.16,-104.88,4.21,-66.73,4.21,-18.11,5.16,23.21,12.55,3.77,3.31,31.88,-2.98,48.47,-21.4,-46.98,0.69,-49.88,3.8,-76.45,-6.86,-48.96,-0.09,-98.78,2.84,-117.38,1.05,-126.81,-2.87,-121.69,-2.09,-112.46,-2.18,-90.71,-0.24,-103.97,-0.14,-61.81,-0.79,-37.91,-0.02,-9.29,3.58,-23.15,-4.29,13.28,-0.73,-18.34,-1.64,4.84,-2.97,18.69,-13.12,6.01,-13.74,-91.56,0.94,-116.74,9.12,-75.52,-1.42,-128.28,-1.52,-128,-17.25,-24.65,-14.66,-77.57,8.52,-76.21,11.86,-91.71,-1.84,-101.67,13.28,-59.05,9.36,-60.87]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_NOSE.01","timeline":[{"name":"B_NOSE.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_NOSE.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_NOSE.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NOSE.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_NOSE.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_00","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33]},{"value":[42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_01","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70]},{"value":[42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_02","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_03","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-41.88,77.54,-41.88,77.69,-41.88,77.85,-41.88,77.99,-41.88,78.04,-41.88,77.99,-41.88,77.85,-41.88,77.69,-41.88,77.54,-41.88,77.2,-41.89,77.38,-41.9,77.57,-41.9,77.73,-41.9,77.79,-41.9,77.72,-41.89,77.56,-41.88,77.36,-41.87,77.18,-41.88,76.87,-41.9,77.07,-41.91,77.3,-41.91,77.48,-41.91,77.57,-41.91,77.47,-41.88,77.27,-41.86,77.04,-41.84,76.82,-41.88,76.53,-41.91,76.75,-41.92,77,-41.94,77.21,-41.94,77.3,-41.93,77.19,-41.9,76.97,-41.86,76.71,-41.83,76.47,-41.88,76.17,-41.92,76.39,-41.96,76.63,-41.99,76.83,-42.01,76.92,-41.99,76.83,-41.96,76.63,-41.92,76.39,-41.88,76.17,-41.82,75.63,-41.85,75.87,-41.9,76.14,-41.93,76.35,-41.94,76.45,-41.95,76.35,-41.95,76.14,-41.95,75.87,-41.94,75.63,-41.79,75.13,-41.83,75.38,-41.87,75.66,-41.9,75.88,-41.91,75.98,-41.92,75.88,-41.93,75.66,-41.94,75.38,-41.93,75.13,-41.78,74.65,-41.82,74.91,-41.86,75.19,-41.89,75.41,-41.9,75.51,-41.9,75.41,-41.91,75.19,-41.91,74.91,-41.9,74.65,-41.76,74.17,-41.8,74.43,-41.84,74.71,-41.87,74.94,-41.88,75.04,-41.88,74.94,-41.88,74.71,-41.88,74.43,-41.88,74.17]},{"duration":60,"tweenEasing":0,"value":[-0.05,82.04,-0.05,82.19,-0.05,82.35,-0.05,82.49,-0.05,82.54,-0.05,82.49,-0.05,82.35,-0.05,82.19,-0.05,82.04,-0.05,81.7,-0.06,81.88,-0.06,82.07,-0.07,82.23,-0.07,82.3,-0.07,82.22,-0.06,82.06,-0.04,81.86,-0.03,81.69,-0.05,81.37,-0.06,81.57,-0.07,81.8,-0.08,81.99,-0.08,82.07,-0.07,81.97,-0.05,81.78,-0.02,81.54,0,81.32,-0.05,81.03,-0.07,81.25,-0.09,81.5,-0.1,81.71,-0.11,81.8,-0.1,81.69,-0.06,81.47,-0.03,81.21,0,80.98,-0.05,80.67,-0.09,80.89,-0.13,81.14,-0.16,81.33,-0.18,81.42,-0.16,81.33,-0.13,81.14,-0.09,80.89,-0.05,80.67,0.02,80.13,-0.02,80.37,-0.06,80.64,-0.09,80.85,-0.11,80.95,-0.11,80.85,-0.12,80.64,-0.12,80.37,-0.1,80.13,0.04,79.64,0.01,79.88,-0.03,80.16,-0.07,80.38,-0.08,80.48,-0.09,80.38,-0.1,80.16,-0.1,79.88,-0.1,79.64,0.06,79.15,0.02,79.41,-0.02,79.69,-0.06,79.92,-0.07,80.01,-0.07,79.92,-0.07,79.69,-0.07,79.41,-0.07,79.15,0.07,78.67,0.04,78.93,0,79.21,-0.04,79.45,-0.05,79.54,-0.05,79.45,-0.05,79.21,-0.05,78.93,-0.05,78.67]},{"value":[41.95,82.04,41.95,82.19,41.95,82.35,41.95,82.49,41.95,82.54,41.95,82.49,41.95,82.35,41.95,82.19,41.95,82.04,41.95,81.7,41.94,81.88,41.94,82.07,41.93,82.23,41.93,82.3,41.93,82.22,41.94,82.06,41.96,81.86,41.97,81.69,41.95,81.37,41.94,81.57,41.93,81.8,41.92,81.99,41.92,82.07,41.93,81.97,41.95,81.78,41.98,81.54,42,81.32,41.95,81.03,41.93,81.25,41.91,81.5,41.9,81.71,41.89,81.8,41.9,81.69,41.94,81.47,41.97,81.21,42,80.98,41.95,80.67,41.91,80.89,41.87,81.14,41.84,81.33,41.82,81.42,41.84,81.33,41.87,81.14,41.91,80.89,41.95,80.67,42.02,80.13,41.98,80.37,41.94,80.64,41.91,80.85,41.89,80.95,41.89,80.85,41.88,80.64,41.88,80.37,41.9,80.13,42.04,79.64,42.01,79.88,41.97,80.16,41.93,80.38,41.92,80.48,41.91,80.38,41.9,80.16,41.9,79.88,41.9,79.64,42.06,79.15,42.02,79.41,41.98,79.69,41.94,79.92,41.93,80.01,41.93,79.92,41.93,79.69,41.93,79.41,41.93,79.15,42.07,78.67,42.04,78.93,42,79.21,41.96,79.45,41.95,79.54,41.95,79.45,41.95,79.21,41.95,78.93,41.95,78.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_04","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-36.93,157.75,-36.93,158.05,-36.93,158.37,-36.93,158.64,-36.93,158.75,-36.93,158.64,-36.93,158.37,-36.93,158.05,-36.93,157.75,-36.93,157.07,-36.95,157.42,-36.96,157.81,-36.97,158.12,-36.97,158.26,-36.96,158.11,-36.94,157.79,-36.92,157.39,-36.9,157.04,-36.93,156.4,-36.96,156.82,-36.98,157.27,-36.99,157.64,-37,157.81,-36.98,157.61,-36.93,157.22,-36.88,156.74,-36.84,156.31,-36.93,155.72,-36.98,156.17,-37.02,156.67,-37.04,157.08,-37.05,157.27,-37.02,157.05,-36.96,156.61,-36.89,156.09,-36.83,155.62,-36.93,155,-37.01,155.44,-37.09,155.94,-37.16,156.33,-37.18,156.5,-37.16,156.33,-37.09,155.94,-37.01,155.44,-36.93,155,-36.8,153.93,-36.88,154.41,-36.96,154.94,-37.02,155.37,-37.05,155.56,-37.06,155.37,-37.07,154.94,-37.07,154.41,-37.04,153.93,-36.75,152.94,-36.82,153.43,-36.9,153.98,-36.97,154.43,-37,154.62,-37.01,154.43,-37.03,153.98,-37.04,153.43,-37.03,152.94,-36.72,151.98,-36.8,152.48,-36.88,153.04,-36.95,153.5,-36.97,153.69,-36.97,153.5,-36.98,153.04,-36.98,152.48,-36.97,151.98,-36.68,151,-36.76,151.52,-36.84,152.09,-36.91,152.56,-36.93,152.75,-36.93,152.56,-36.93,152.09,-36.93,151.52,-36.93,151]},{"duration":60,"tweenEasing":0,"value":[-0.1,164.08,-0.1,164.38,-0.1,164.71,-0.1,164.97,-0.1,165.08,-0.1,164.97,-0.1,164.71,-0.1,164.38,-0.1,164.08,-0.1,163.41,-0.12,163.76,-0.13,164.14,-0.14,164.45,-0.14,164.59,-0.13,164.44,-0.11,164.12,-0.09,163.73,-0.07,163.37,-0.1,162.74,-0.13,163.15,-0.15,163.6,-0.16,163.97,-0.16,164.15,-0.14,163.94,-0.1,163.55,-0.05,163.08,-0.01,162.65,-0.1,162.06,-0.15,162.51,-0.18,163,-0.21,163.41,-0.22,163.61,-0.19,163.38,-0.13,162.95,-0.06,162.43,0.01,161.95,-0.1,161.33,-0.17,161.78,-0.26,162.27,-0.32,162.67,-0.35,162.83,-0.32,162.67,-0.26,162.27,-0.17,161.78,-0.1,161.33,0.03,160.26,-0.04,160.74,-0.12,161.28,-0.19,161.71,-0.22,161.9,-0.22,161.71,-0.23,161.27,-0.23,160.74,-0.21,160.26,0.09,159.27,0.01,159.77,-0.07,160.32,-0.14,160.77,-0.16,160.96,-0.17,160.76,-0.19,160.32,-0.21,159.77,-0.19,159.27,0.11,158.31,0.04,158.82,-0.05,159.38,-0.11,159.83,-0.14,160.02,-0.14,159.83,-0.14,159.38,-0.14,158.82,-0.14,158.31,0.15,157.33,0.08,157.85,-0.01,158.43,-0.07,158.89,-0.1,159.08,-0.1,158.89,-0.1,158.43,-0.1,157.85,-0.1,157.33]},{"value":[41.9,164.08,41.9,164.38,41.9,164.71,41.9,164.97,41.9,165.08,41.9,164.97,41.9,164.71,41.9,164.38,41.9,164.08,41.9,163.41,41.88,163.76,41.87,164.14,41.86,164.45,41.86,164.59,41.87,164.44,41.89,164.12,41.91,163.73,41.93,163.37,41.9,162.74,41.87,163.15,41.85,163.6,41.84,163.97,41.84,164.15,41.86,163.94,41.9,163.55,41.95,163.08,41.99,162.65,41.9,162.06,41.85,162.51,41.82,163,41.79,163.41,41.78,163.61,41.81,163.38,41.87,162.95,41.94,162.43,42.01,161.95,41.9,161.33,41.83,161.78,41.74,162.27,41.68,162.67,41.65,162.83,41.68,162.67,41.74,162.27,41.83,161.78,41.9,161.33,42.03,160.26,41.96,160.74,41.88,161.28,41.81,161.71,41.78,161.9,41.78,161.71,41.77,161.27,41.77,160.74,41.79,160.26,42.09,159.27,42.01,159.77,41.93,160.32,41.86,160.77,41.84,160.96,41.83,160.76,41.81,160.32,41.79,159.77,41.81,159.27,42.11,158.31,42.04,158.82,41.95,159.38,41.89,159.83,41.86,160.02,41.86,159.83,41.86,159.38,41.86,158.82,41.86,158.31,42.15,157.33,42.08,157.85,41.99,158.43,41.93,158.89,41.9,159.08,41.9,158.89,41.9,158.43,41.9,157.85,41.9,157.33]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_NOSE.00","timeline":[{"name":"D_NOSE.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_NOSE.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_NOSE.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_NOSE.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_00"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_03","timeline":[{"name":"D_NOSE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-21.38,2.28,-42.1,8.37,-41.92,8.7]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_04","timeline":[{"name":"D_NOSE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-21.38,2.28,-42.1,8.37,-41.92,8.7]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_NOSE.01","timeline":[{"name":"D_NOSE.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_NOSE.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_NOSE.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_NOSE.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_00","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"offset":8,"value":[-8.33,4.08,-15.28,-1.36,0,0,0,0,0,0,0,0,0,0,0,0,-8.33,5.44,0,0,-1.39,1.36]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_01","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"offset":8,"value":[-8.33,4.08,-15.28,-1.36,0,0,0,0,0,0,0,0,0,0,0,0,-8.33,5.44,0,0,-1.39,1.36]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_03","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"value":[8.68,0.67,-19.45,-0.18,-85.46,-7.25,-36.09,-3.63,-23.56,0.08,-4.11,2.69,-51.96,-5.64,-35.58,-2.22,-2.72,1.34,-18.71,-0.07,-69.7,7.26,-31.13,-4.28,1.18,-1.34,-43.96,-2.37,-33.84,-1.25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_04","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"value":[8.68,0.67,-19.45,-0.18,-85.46,-7.25,-36.09,-3.63,-23.56,0.08,-4.11,2.69,-51.96,-5.64,-35.58,-2.22,-2.72,1.34,-18.71,-0.07,-69.7,7.26,-31.13,-4.28,1.18,-1.34,-43.96,-2.37,-33.84,-1.25]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EAR.01","timeline":[{"name":"B_EAR.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EAR.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EAR.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EAR.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_00","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-5.26,-39.61,-5.96,-40.18,-6.67,-40.96,-7.37,-41.3,-8.08,-40.55,-8.78,-39.47,-9.49,-39.02,-10.19,-38.82,-10.9,-38.49,-6.95,-40.54,-7.66,-40.5,-8.36,-40.63,-9.07,-40.42,-9.77,-39.4,-10.45,-38.43,-11.11,-38.13,-11.76,-38.08,-12.45,-37.91,-8.65,-41.46,-9.36,-40.77,-10.06,-40.19,-10.76,-39.38,-11.47,-38.02,-12.11,-37.23,-12.68,-37.12,-13.26,-37.3,-13.9,-37.34,-10.34,-42.39,-11.05,-41.14,-11.75,-39.96,-12.46,-38.66,-13.16,-37.09,-13.8,-36.35,-14.35,-36.34,-14.91,-36.62,-15.55,-36.76,-12.04,-43.31,-12.75,-41.79,-13.45,-40.28,-14.16,-38.76,-14.86,-37.25,-15.56,-36.28,-16.27,-36.09,-16.97,-36.21,-17.68,-36.18,-13.59,-45.25,-14.16,-43.63,-14.77,-41.99,-15.43,-40.39,-16.12,-38.9,-16.81,-37.96,-17.47,-37.66,-18.08,-37.61,-18.65,-37.43,-14.93,-48.66,-15.29,-46.83,-15.68,-44.96,-16.14,-43.17,-16.75,-41.59,-17.36,-40.54,-17.83,-39.98,-18.21,-39.62,-18.57,-39.16,-16.19,-52.64,-16.32,-50.57,-16.41,-48.42,-16.63,-46.41,-17.14,-44.7,-17.64,-43.48,-17.86,-42.6,-17.95,-41.87,-18.08,-41.06,-17.49,-56.34,-17.4,-54.03,-17.23,-51.64,-17.23,-49.42,-17.64,-47.61,-18.06,-46.24,-18.05,-45.08,-17.88,-44,-17.8,-42.88]},{"duration":60,"tweenEasing":0,"value":[2.66,-43.36,2.66,-43.91,2.66,-44.67,2.66,-45,2.66,-44.24,2.67,-43.15,2.67,-42.68,2.67,-42.46,2.67,-42.12,0.95,-43.36,0.95,-43.31,0.95,-43.42,0.95,-43.2,0.95,-42.16,0.97,-41.18,1.03,-40.86,1.08,-40.81,1.1,-40.62,-0.77,-43.36,-0.77,-42.66,-0.77,-42.06,-0.77,-41.24,-0.76,-39.87,-0.7,-39.06,-0.57,-38.94,-0.43,-39.1,-0.37,-39.12,-2.48,-43.36,-2.48,-42.11,-2.48,-40.91,-2.48,-39.6,-2.48,-38.01,-2.41,-37.25,-2.26,-37.23,-2.11,-37.5,-2.04,-37.62,-4.2,-43.37,-4.2,-41.84,-4.2,-40.31,-4.19,-38.78,-4.19,-37.25,-4.19,-36.26,-4.19,-36.06,-4.19,-36.17,-4.19,-36.13,-5.91,-43.37,-5.91,-41.84,-5.91,-40.31,-5.91,-38.78,-5.91,-37.25,-5.91,-36.27,-5.91,-36.04,-5.9,-36.1,-5.9,-36.02,-7.63,-43.37,-7.63,-41.84,-7.63,-40.31,-7.62,-38.78,-7.62,-37.25,-7.62,-36.24,-7.62,-35.94,-7.62,-35.92,-7.62,-35.75,-9.34,-43.37,-9.34,-41.84,-9.34,-40.31,-9.34,-38.78,-9.34,-37.25,-9.34,-36.2,-9.34,-35.81,-9.33,-35.68,-9.33,-35.43,-11.06,-43.37,-11.06,-41.84,-11.05,-40.31,-11.05,-38.78,-11.05,-37.25,-11.05,-36.16,-11.05,-35.69,-11.05,-35.47,-11.05,-35.13]},{"value":[19.99,-43.36,19.99,-43.91,20,-44.67,20,-45,20,-44.24,20,-43.15,20,-42.68,20,-42.46,20,-42.12,18.28,-43.36,18.28,-43.31,18.28,-43.42,18.28,-43.2,18.28,-42.16,18.31,-41.18,18.36,-40.86,18.41,-40.81,18.43,-40.62,16.56,-43.36,16.57,-42.66,16.57,-42.06,16.57,-41.24,16.57,-39.87,16.63,-39.06,16.77,-38.94,16.9,-39.1,16.96,-39.12,14.85,-43.36,14.85,-42.11,14.85,-40.91,14.85,-39.6,14.85,-38.01,14.92,-37.25,15.08,-37.23,15.23,-37.5,15.3,-37.62,13.13,-43.37,13.14,-41.84,13.14,-40.31,13.14,-38.78,13.14,-37.25,13.14,-36.26,13.14,-36.06,13.14,-36.17,13.14,-36.13,11.42,-43.37,11.42,-41.84,11.42,-40.31,11.42,-38.78,11.43,-37.25,11.43,-36.27,11.43,-36.04,11.43,-36.1,11.43,-36.02,9.71,-43.37,9.71,-41.84,9.71,-40.31,9.71,-38.78,9.71,-37.25,9.71,-36.24,9.71,-35.94,9.71,-35.92,9.72,-35.75,7.99,-43.37,7.99,-41.84,7.99,-40.31,7.99,-38.78,8,-37.25,8,-36.2,8,-35.81,8,-35.68,8,-35.43,6.28,-43.37,6.28,-41.84,6.28,-40.31,6.28,-38.78,6.28,-37.25,6.28,-36.16,6.28,-35.69,6.28,-35.47,6.29,-35.13]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_01","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.08,-16.43,-0.63,-16.72,-1.33,-17.12,-2.04,-17.3,-2.74,-16.93,-3.45,-16.4,-4.15,-16.18,-4.86,-16.08,-5.56,-15.93,-0.76,-17.36,-1.46,-17.35,-2.17,-17.42,-2.87,-17.32,-3.58,-16.82,-4.27,-16.34,-4.96,-16.19,-5.64,-16.18,-6.33,-16.1,-1.6,-18.28,-2.3,-17.94,-3.01,-17.66,-3.71,-17.26,-4.42,-16.59,-5.09,-16.2,-5.73,-16.15,-6.37,-16.25,-7.05,-16.27,-2.44,-19.2,-3.14,-18.59,-3.85,-18,-4.55,-17.36,-5.26,-16.58,-5.93,-16.22,-6.56,-16.22,-7.19,-16.37,-7.86,-16.45,-3.27,-20.13,-3.98,-19.38,-4.69,-18.62,-5.39,-17.87,-6.1,-17.12,-6.8,-16.65,-7.51,-16.56,-8.21,-16.63,-8.92,-16.62,-3.97,-22.07,-4.53,-21.21,-5.15,-20.34,-5.81,-19.51,-6.5,-18.78,-7.19,-18.32,-7.85,-18.14,-8.46,-18.06,-9.03,-17.93,-4.45,-25.47,-4.81,-24.41,-5.2,-23.3,-5.66,-22.28,-6.27,-21.47,-6.88,-20.92,-7.35,-20.51,-7.73,-20.16,-8.1,-19.78,-4.85,-29.46,-4.98,-28.15,-5.08,-26.77,-5.29,-25.52,-5.8,-24.58,-6.31,-23.88,-6.52,-23.2,-6.62,-22.53,-6.75,-21.85,-5.3,-33.15,-5.21,-31.61,-5.04,-29.98,-5.04,-28.52,-5.45,-27.48,-5.87,-26.66,-5.86,-25.73,-5.69,-24.76,-5.61,-23.81]},{"duration":60,"tweenEasing":0,"value":[1.33,-20.18,1.33,-20.45,1.33,-20.84,1.33,-21,1.33,-20.62,1.33,-20.07,1.33,-19.84,1.33,-19.73,1.33,-19.56,0.47,-20.18,0.47,-20.15,0.47,-20.21,0.47,-20.1,0.48,-19.58,0.49,-19.09,0.51,-18.93,0.54,-18.9,0.55,-18.81,-0.38,-20.18,-0.38,-19.83,-0.38,-19.53,-0.38,-19.12,-0.38,-18.43,-0.35,-18.03,-0.28,-17.97,-0.22,-18.05,-0.18,-18.06,-1.24,-20.18,-1.24,-19.55,-1.24,-18.95,-1.24,-18.3,-1.24,-17.51,-1.2,-17.13,-1.13,-17.11,-1.05,-17.25,-1.02,-17.31,-2.1,-20.18,-2.1,-19.42,-2.1,-18.65,-2.1,-17.89,-2.1,-17.12,-2.1,-16.63,-2.1,-16.53,-2.09,-16.59,-2.09,-16.56,-2.96,-20.18,-2.96,-19.42,-2.96,-18.65,-2.95,-17.89,-2.95,-17.12,-2.95,-16.64,-2.95,-16.52,-2.95,-16.55,-2.95,-16.51,-3.81,-20.18,-3.81,-19.42,-3.81,-18.65,-3.81,-17.89,-3.81,-17.12,-3.81,-16.62,-3.81,-16.47,-3.81,-16.46,-3.81,-16.38,-4.67,-20.19,-4.67,-19.42,-4.67,-18.66,-4.67,-17.89,-4.67,-17.13,-4.67,-16.6,-4.67,-16.4,-4.67,-16.34,-4.67,-16.21,-5.53,-20.19,-5.53,-19.42,-5.53,-18.66,-5.53,-17.89,-5.53,-17.13,-5.53,-16.58,-5.52,-16.35,-5.52,-16.24,-5.52,-16.07]},{"value":[10,-20.18,10,-20.45,10,-20.84,10,-21,10,-20.62,10,-20.07,10,-19.84,10,-19.73,10,-19.56,9.14,-20.18,9.14,-20.15,9.14,-20.21,9.14,-20.1,9.14,-19.58,9.15,-19.09,9.18,-18.93,9.21,-18.9,9.22,-18.81,8.28,-20.18,8.28,-19.83,8.28,-19.53,8.28,-19.12,8.28,-18.43,8.32,-18.03,8.38,-17.97,8.45,-18.05,8.48,-18.06,7.42,-20.18,7.43,-19.55,7.43,-18.95,7.43,-18.3,7.43,-17.51,7.46,-17.13,7.54,-17.11,7.61,-17.25,7.65,-17.31,6.57,-20.18,6.57,-19.42,6.57,-18.65,6.57,-17.89,6.57,-17.12,6.57,-16.63,6.57,-16.53,6.57,-16.59,6.57,-16.56,5.71,-20.18,5.71,-19.42,5.71,-18.65,5.71,-17.89,5.71,-17.12,5.71,-16.64,5.71,-16.52,5.71,-16.55,5.72,-16.51,4.85,-20.18,4.85,-19.42,4.85,-18.65,4.85,-17.89,4.86,-17.12,4.86,-16.62,4.86,-16.47,4.86,-16.46,4.86,-16.38,4,-20.19,4,-19.42,4,-18.66,4,-17.89,4,-17.13,4,-16.6,4,-16.4,4,-16.34,4,-16.21,3.14,-20.19,3.14,-19.42,3.14,-18.66,3.14,-17.89,3.14,-17.13,3.14,-16.58,3.14,-16.35,3.14,-16.24,3.14,-16.07]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_02","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[4.08,3.75,3.38,3.73,2.67,3.72,1.97,3.7,1.26,3.69,0.55,3.67,-0.15,3.66,-0.86,3.65,-1.57,3.63,4.1,2.82,3.4,2.81,2.69,2.8,1.98,2.78,1.28,2.77,0.57,2.75,-0.13,2.74,-0.84,2.72,-1.55,2.71,4.12,1.9,3.41,1.89,2.71,1.87,2,1.86,1.3,1.84,0.59,1.83,-0.12,1.82,-0.82,1.8,-1.53,1.79,4.14,0.98,3.43,0.96,2.73,0.95,2.02,0.94,1.31,0.92,0.61,0.91,-0.1,0.89,-0.8,0.88,-1.51,0.87,4.16,0.06,3.45,0.04,2.75,0.03,2.04,0.01,1.33,0,0.63,-0.01,-0.08,-0.03,-0.79,-0.04,-1.49,-0.06,4.32,-1.89,3.76,-1.8,3.14,-1.69,2.48,-1.62,1.79,-1.65,1.1,-1.69,0.44,-1.62,-0.18,-1.51,-0.74,-1.42,4.7,-5.29,4.33,-4.99,3.95,-4.65,3.48,-4.39,2.87,-4.34,2.26,-4.3,1.79,-4.04,1.41,-3.7,1.05,-3.4,5.15,-9.27,5.02,-8.72,4.93,-8.11,4.71,-7.63,4.2,-7.45,3.7,-7.28,3.48,-6.79,3.38,-6.18,3.25,-5.64,5.57,-12.97,5.65,-12.19,5.82,-11.33,5.82,-10.63,5.41,-10.36,4.99,-10.08,5,-9.38,5.16,-8.52,5.25,-7.75]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_03","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.46,30,-0.1,28.82,-0.64,27.66,-1.21,26.47,-1.86,25.25,-2.62,23.92,-3.46,22.48,-4.33,20.98,-5.18,19.51,0.63,28.25,0.02,27.03,-0.6,25.82,-1.24,24.6,-1.92,23.37,-2.66,22,-3.46,20.51,-4.28,18.98,-5.09,17.48,0.87,26.49,0.19,25.24,-0.53,23.98,-1.26,22.73,-1.98,21.48,-2.7,20.04,-3.46,18.49,-4.22,16.89,-4.99,15.32,0.98,24.75,0.26,23.45,-0.51,22.15,-1.29,20.86,-2.03,19.6,-2.74,18.14,-3.45,16.58,-4.18,14.98,-4.9,13.4,0.78,23.05,0.07,21.7,-0.63,20.35,-1.33,19.01,-2.04,17.73,-2.74,16.4,-3.45,14.98,-4.15,13.51,-4.86,12.07,0.66,21.14,0.14,19.87,-0.38,18.62,-0.94,17.34,-1.58,16,-2.27,14.65,-2.93,13.33,-3.55,12.02,-4.11,10.71,1.07,17.45,0.75,16.42,0.45,15.44,0.07,14.37,-0.5,13.13,-1.11,11.89,-1.58,10.8,-1.96,9.78,-2.32,8.72,1.68,13.06,1.56,12.33,1.5,11.67,1.32,10.88,0.83,9.8,0.32,8.71,0.11,7.91,0.02,7.23,-0.12,6.48,2.19,9.02,2.27,8.57,2.44,8.19,2.45,7.65,2.03,6.7,1.62,5.74,1.63,5.2,1.8,4.83,1.88,4.37]},{"duration":60,"tweenEasing":0,"value":[-3.63,26.25,-3.48,25.09,-3.31,23.94,-3.18,22.77,-3.12,21.57,-3.18,20.25,-3.31,18.82,-3.47,17.34,-3.62,15.88,-3.47,25.42,-3.38,24.22,-3.29,23.03,-3.22,21.82,-3.2,20.6,-3.23,19.24,-3.32,17.77,-3.44,16.26,-3.54,14.77,-3.25,24.59,-3.22,23.35,-3.23,22.11,-3.26,20.87,-3.28,19.63,-3.3,18.21,-3.34,16.67,-3.4,15.09,-3.46,13.53,-3.16,23.77,-3.17,22.49,-3.24,21.2,-3.31,19.92,-3.35,18.67,-3.35,17.24,-3.35,15.69,-3.37,14.1,-3.4,12.54,-3.38,22.99,-3.38,21.66,-3.38,20.32,-3.37,19,-3.37,17.73,-3.37,16.42,-3.37,15.01,-3.37,13.56,-3.37,12.12,-3.66,23.02,-3.61,21.67,-3.52,20.31,-3.42,18.96,-3.37,17.65,-3.37,16.34,-3.37,14.95,-3.37,13.53,-3.37,12.12,-3.63,22.74,-3.59,21.42,-3.5,20.09,-3.41,18.77,-3.37,17.47,-3.37,16.18,-3.37,14.84,-3.37,13.47,-3.37,12.12,-3.47,22.33,-3.46,21.06,-3.42,19.78,-3.39,18.51,-3.37,17.25,-3.37,15.99,-3.37,14.71,-3.37,13.41,-3.37,12.12,-3.38,21.99,-3.38,20.75,-3.38,19.52,-3.37,18.29,-3.37,17.05,-3.37,15.82,-3.37,14.59,-3.37,13.35,-3.37,12.12]},{"value":[-16.96,26.25,-16.81,25.09,-16.65,23.94,-16.51,22.77,-16.46,21.57,-16.51,20.25,-16.64,18.82,-16.8,17.34,-16.95,15.88,-16.81,25.42,-16.71,24.22,-16.62,23.03,-16.56,21.82,-16.53,20.6,-16.57,19.24,-16.66,17.77,-16.77,16.26,-16.88,14.77,-16.59,24.59,-16.55,23.35,-16.57,22.11,-16.6,20.87,-16.61,19.63,-16.63,18.21,-16.67,16.67,-16.73,15.09,-16.79,13.53,-16.49,23.77,-16.5,22.49,-16.57,21.2,-16.64,19.92,-16.68,18.67,-16.68,17.24,-16.69,15.69,-16.7,14.1,-16.73,12.54,-16.71,22.99,-16.71,21.66,-16.71,20.32,-16.71,19,-16.71,17.73,-16.71,16.42,-16.7,15.01,-16.7,13.56,-16.7,12.12,-16.99,23.02,-16.95,21.67,-16.85,20.31,-16.75,18.96,-16.71,17.65,-16.7,16.34,-16.7,14.95,-16.7,13.53,-16.7,12.12,-16.96,22.74,-16.92,21.42,-16.83,20.09,-16.75,18.77,-16.71,17.47,-16.7,16.18,-16.7,14.84,-16.7,13.47,-16.7,12.12,-16.81,22.33,-16.79,21.06,-16.76,19.78,-16.72,18.51,-16.71,17.25,-16.7,15.99,-16.7,14.71,-16.7,13.41,-16.7,12.12,-16.71,21.99,-16.71,20.75,-16.71,19.52,-16.71,18.29,-16.71,17.05,-16.7,15.82,-16.7,14.59,-16.7,13.35,-16.7,12.12]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_04","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.17,56.24,-3.58,53.91,-3.96,51.59,-4.39,49.25,-4.99,46.82,-5.8,44.17,-6.77,41.29,-7.8,38.32,-8.8,35.39,-2.84,53.67,-3.36,51.26,-3.89,48.85,-4.46,46.42,-5.12,43.97,-5.89,41.24,-6.78,38.29,-7.72,35.24,-8.63,32.24,-2.39,51.08,-3.03,48.59,-3.76,46.09,-4.53,43.59,-5.26,41.11,-6,38.24,-6.8,35.16,-7.62,31.99,-8.45,28.86,-2.18,48.52,-2.91,45.94,-3.75,43.35,-4.6,40.78,-5.38,38.27,-6.08,35.38,-6.81,32.27,-7.55,29.08,-8.3,25.94,-2.6,46.04,-3.3,43.36,-4.01,40.66,-4.71,38.01,-5.41,35.45,-6.12,32.82,-6.82,29.99,-7.52,27.07,-8.23,24.19,-3,44.16,-3.47,41.54,-3.89,38.93,-4.36,36.3,-4.96,33.65,-5.64,30.99,-6.3,28.28,-6.92,25.55,-7.48,22.83,-2.56,40.19,-2.84,37.84,-3.05,35.52,-3.35,33.14,-3.88,30.6,-4.48,28.07,-4.95,25.64,-5.33,23.25,-5.69,20.84,-1.79,35.39,-1.89,33.39,-1.92,31.45,-2.07,29.39,-2.54,27.05,-3.05,24.7,-3.26,22.62,-3.35,20.64,-3.48,18.6,-1.19,31.01,-1.1,29.32,-0.93,27.71,-0.93,25.94,-1.34,23.75,-1.75,21.56,-1.75,19.79,-1.57,18.18,-1.49,16.49]},{"duration":60,"tweenEasing":0,"value":[-7.26,52.5,-6.96,50.18,-6.63,47.88,-6.36,45.54,-6.25,43.13,-6.35,40.5,-6.62,37.63,-6.94,34.67,-7.24,31.76,-6.94,50.85,-6.75,48.45,-6.58,46.05,-6.45,43.64,-6.39,41.2,-6.47,38.49,-6.65,35.55,-6.88,32.52,-7.09,29.53,-6.51,49.18,-6.44,46.7,-6.47,44.21,-6.53,41.74,-6.56,39.27,-6.59,36.42,-6.68,33.34,-6.8,30.18,-6.92,27.07,-6.32,47.54,-6.34,44.98,-6.47,42.4,-6.62,39.84,-6.69,37.35,-6.69,34.47,-6.71,31.38,-6.74,28.2,-6.79,25.07,-6.76,45.99,-6.75,43.32,-6.75,40.64,-6.75,37.99,-6.75,35.45,-6.74,32.84,-6.74,30.02,-6.74,27.11,-6.74,24.25,-7.32,46.05,-7.23,43.34,-7.03,40.61,-6.84,37.92,-6.75,35.3,-6.74,32.68,-6.74,29.9,-6.74,27.06,-6.74,24.25,-7.26,45.48,-7.18,42.83,-7,40.17,-6.83,37.53,-6.75,34.94,-6.74,32.36,-6.74,29.68,-6.74,26.95,-6.74,24.24,-6.94,44.66,-6.91,42.12,-6.84,39.56,-6.78,37.02,-6.75,34.5,-6.74,31.98,-6.74,29.41,-6.74,26.82,-6.74,24.24,-6.76,43.97,-6.75,41.51,-6.75,39.04,-6.75,36.57,-6.75,34.1,-6.74,31.64,-6.74,29.17,-6.74,26.7,-6.74,24.24]},{"value":[-10.59,52.5,-10.29,50.18,-9.96,47.88,-9.69,45.54,-9.58,43.13,-9.69,40.5,-9.95,37.63,-10.27,34.67,-10.57,31.76,-10.28,50.85,-10.08,48.45,-9.91,46.05,-9.78,43.64,-9.73,41.2,-9.8,38.49,-9.98,35.55,-10.21,32.52,-10.42,29.53,-9.84,49.18,-9.78,46.7,-9.8,44.21,-9.86,41.74,-9.89,39.27,-9.92,36.42,-10.01,33.34,-10.13,30.18,-10.26,27.07,-9.65,47.54,-9.67,44.98,-9.81,42.4,-9.96,39.84,-10.02,37.35,-10.03,34.47,-10.04,31.38,-10.07,28.2,-10.12,25.07,-10.09,45.99,-10.09,43.32,-10.08,40.64,-10.08,37.99,-10.08,35.45,-10.08,32.84,-10.07,30.02,-10.07,27.11,-10.07,24.25,-10.65,46.05,-10.56,43.34,-10.37,40.61,-10.17,37.92,-10.08,35.3,-10.08,32.68,-10.07,29.9,-10.07,27.06,-10.07,24.25,-10.59,45.48,-10.51,42.83,-10.33,40.17,-10.16,37.53,-10.08,34.94,-10.08,32.36,-10.07,29.68,-10.07,26.95,-10.07,24.24,-10.28,44.66,-10.25,42.12,-10.18,39.56,-10.11,37.02,-10.08,34.5,-10.08,31.98,-10.07,29.41,-10.07,26.82,-10.07,24.24,-10.09,43.97,-10.09,41.51,-10.08,39.04,-10.08,36.57,-10.08,34.1,-10.08,31.64,-10.07,29.17,-10.07,26.7,-10.07,24.24]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EAR.02","timeline":[{"name":"B_EAR.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EAR.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EAR.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EAR.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_00","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-8.02,5.82,-6.89,4.51,-5.75,3.2,-4.61,1.89,-3.47,0.58,-2.33,-0.73,-1.2,-2.04,-0.06,-3.35,1.08,-4.66,-7.93,7.42,-6.8,6.11,-5.66,4.8,-4.52,3.49,-3.38,2.18,-2.24,0.87,-1.11,-0.44,0.03,-1.75,1.17,-3.06,-7.84,9.01,-6.7,7.71,-5.57,6.4,-4.43,5.09,-3.29,3.78,-2.15,2.47,-1.02,1.16,0.12,-0.15,1.26,-1.46,-7.75,10.61,-6.61,9.3,-5.48,7.99,-4.34,6.68,-3.2,5.37,-2.06,4.06,-0.93,2.75,0.21,1.45,1.35,0.14,-7.66,12.21,-6.52,10.9,-5.39,9.59,-4.25,8.28,-3.11,6.97,-1.97,5.66,-0.84,4.35,0.3,3.04,1.44,1.73,-7.57,13.81,-6.43,12.5,-5.3,11.19,-4.16,9.88,-3.02,8.57,-1.88,7.26,-0.75,5.95,0.39,4.64,1.53,3.33,-7.48,15.4,-6.34,14.09,-5.21,12.79,-4.07,11.48,-2.93,10.17,-1.79,8.86,-0.66,7.55,0.48,6.24,1.62,4.93,-7.39,17,-6.25,15.69,-5.12,14.38,-3.98,13.07,-2.84,11.76,-1.7,10.45,-0.56,9.14,0.57,7.83,1.71,6.53,-7.3,18.6,-6.16,17.29,-5.03,15.98,-3.89,14.67,-2.75,13.36,-1.61,12.05,-0.47,10.74,0.66,9.43,1.8,8.12]},{"duration":60,"tweenEasing":0,"offset":1,"value":[11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99]},{"value":[-3.07,16.05,-3.78,14.78,-4.5,13.51,-5.21,12.24,-5.92,10.97,-6.63,9.7,-7.34,8.43,-8.05,7.16,-8.77,5.89,-3.04,15.05,-3.75,13.78,-4.46,12.51,-5.17,11.24,-5.88,9.97,-6.6,8.7,-7.31,7.43,-8.02,6.16,-8.73,4.89,-3,14.05,-3.71,12.78,-4.43,11.51,-5.14,10.24,-5.85,8.97,-6.56,7.7,-7.27,6.43,-7.98,5.16,-8.69,3.89,-2.97,13.05,-3.68,11.78,-4.39,10.51,-5.1,9.24,-5.81,7.97,-6.52,6.7,-7.24,5.43,-7.95,4.16,-8.66,2.89,-2.93,12.05,-3.64,10.78,-4.35,9.51,-5.07,8.24,-5.78,6.97,-6.49,5.7,-7.2,4.43,-7.91,3.16,-8.62,1.89,-2.9,11.05,-3.61,9.78,-4.32,8.51,-5.03,7.24,-5.74,5.97,-6.45,4.7,-7.17,3.43,-7.88,2.16,-8.59,0.89,-2.86,10.05,-3.57,8.78,-4.28,7.51,-5,6.24,-5.71,4.97,-6.42,3.7,-7.13,2.43,-7.84,1.16,-8.55,-0.11,-2.83,9.06,-3.54,7.79,-4.25,6.51,-4.96,5.24,-5.67,3.97,-6.38,2.7,-7.1,1.43,-7.81,0.16,-8.52,-1.11,-2.79,8.06,-3.5,6.79,-4.21,5.52,-4.93,4.25,-5.64,2.98,-6.35,1.7,-7.06,0.43,-7.77,-0.84,-8.48,-2.11]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_01","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-1.36,-0.16,-0.22,-0.84,0.92,-1.53,2.06,-2.22,3.19,-2.9,4.33,-3.59,5.47,-4.28,6.61,-4.96,7.75,-5.65,-1.27,1.44,-0.13,0.75,1.01,0.07,2.15,-0.62,3.28,-1.31,4.42,-1.99,5.56,-2.68,6.7,-3.37,7.84,-4.05,-1.18,3.04,-0.04,2.35,1.1,1.66,2.24,0.98,3.37,0.29,4.51,-0.4,5.65,-1.08,6.79,-1.77,7.93,-2.46,-1.09,4.64,0.05,3.95,1.19,3.26,2.33,2.58,3.47,1.89,4.6,1.2,5.74,0.51,6.88,-0.17,8.02,-0.86,-1,6.23,0.14,5.55,1.28,4.86,2.42,4.17,3.56,3.49,4.69,2.8,5.83,2.11,6.97,1.42,8.11,0.74,-0.9,7.83,0.23,7.14,1.37,6.46,2.51,5.77,3.65,5.08,4.78,4.4,5.92,3.71,7.06,3.02,8.2,2.34,-0.81,9.43,0.32,8.74,1.46,8.05,2.6,7.37,3.74,6.68,4.87,5.99,6.01,5.31,7.15,4.62,8.29,3.93,-0.72,11.03,0.41,10.34,1.55,9.65,2.69,8.96,3.83,8.28,4.96,7.59,6.1,6.9,7.24,6.22,8.38,5.53,-0.63,12.62,0.5,11.94,1.64,11.25,2.78,10.56,3.92,9.88,5.05,9.19,6.19,8.5,7.33,7.81,8.47,7.13]},{"duration":60,"tweenEasing":0,"offset":1,"value":[5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1]},{"value":[-1.07,10.07,-1.78,9.43,-2.5,8.78,-3.21,8.13,-3.92,7.48,-4.63,6.83,-5.34,6.19,-6.05,5.54,-6.77,4.89,-1.04,9.07,-1.75,8.43,-2.46,7.78,-3.17,7.13,-3.88,6.48,-4.6,5.84,-5.31,5.19,-6.02,4.54,-6.73,3.89,-1,8.07,-1.71,7.43,-2.43,6.78,-3.14,6.13,-3.85,5.48,-4.56,4.84,-5.27,4.19,-5.98,3.54,-6.69,2.89,-0.97,7.08,-1.68,6.43,-2.39,5.78,-3.1,5.13,-3.81,4.48,-4.52,3.84,-5.24,3.19,-5.95,2.54,-6.66,1.89,-0.93,6.08,-1.64,5.43,-2.35,4.78,-3.07,4.13,-3.78,3.49,-4.49,2.84,-5.2,2.19,-5.91,1.54,-6.62,0.89,-0.9,5.08,-1.61,4.43,-2.32,3.78,-3.03,3.13,-3.74,2.49,-4.45,1.84,-5.17,1.19,-5.88,0.54,-6.59,-0.1,-0.86,4.08,-1.57,3.43,-2.28,2.78,-3,2.14,-3.71,1.49,-4.42,0.84,-5.13,0.19,-5.84,-0.46,-6.55,-1.1,-0.83,3.08,-1.54,2.43,-2.25,1.78,-2.96,1.14,-3.67,0.49,-4.38,-0.16,-5.1,-0.81,-5.81,-1.45,-6.52,-2.1,-0.79,2.08,-1.5,1.43,-2.21,0.78,-2.93,0.14,-3.64,-0.51,-4.35,-1.16,-5.06,-1.81,-5.77,-2.45,-6.48,-3.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_02","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[3.98,-6.13,5.11,-6.2,6.25,-6.26,7.39,-6.33,8.53,-6.39,9.67,-6.45,10.8,-6.52,11.94,-6.58,13.08,-6.65,4.07,-4.53,5.2,-4.6,6.34,-4.66,7.48,-4.73,8.62,-4.79,9.76,-4.86,10.89,-4.92,12.03,-4.99,13.17,-5.05,4.16,-2.94,5.3,-3,6.43,-3.07,7.57,-3.13,8.71,-3.19,9.85,-3.26,10.98,-3.32,12.12,-3.39,13.26,-3.45,4.25,-1.34,5.39,-1.4,6.52,-1.47,7.66,-1.53,8.8,-1.6,9.94,-1.66,11.07,-1.73,12.21,-1.79,13.35,-1.85,4.34,0.26,5.48,0.19,6.61,0.13,7.75,0.06,8.89,0,10.03,-0.06,11.16,-0.13,12.3,-0.19,13.44,-0.26,4.43,1.85,5.57,1.79,6.7,1.73,7.84,1.66,8.98,1.6,10.12,1.53,11.25,1.47,12.39,1.4,13.53,1.34,4.52,3.45,5.66,3.39,6.79,3.32,7.93,3.26,9.07,3.19,10.21,3.13,11.34,3.07,12.48,3,13.62,2.94,4.61,5.05,5.75,4.99,6.88,4.92,8.02,4.86,9.16,4.79,10.3,4.73,11.44,4.66,12.57,4.6,13.71,4.53,4.7,6.65,5.84,6.58,6.97,6.52,8.11,6.45,9.25,6.39,10.39,6.33,11.53,6.26,12.66,6.2,13.8,6.13]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.93,4.1,0.22,4.07,-0.5,4.05,-1.21,4.02,-1.92,4,-2.63,3.97,-3.34,3.95,-4.05,3.92,-4.77,3.9,0.96,3.1,0.25,3.07,-0.46,3.05,-1.17,3.02,-1.88,3,-2.6,2.97,-3.31,2.95,-4.02,2.92,-4.73,2.9,1,2.1,0.29,2.07,-0.43,2.05,-1.14,2.02,-1.85,2,-2.56,1.97,-3.27,1.95,-3.98,1.92,-4.69,1.9,1.03,1.1,0.32,1.07,-0.39,1.05,-1.1,1.02,-1.81,1,-2.52,0.97,-3.24,0.95,-3.95,0.92,-4.66,0.9,1.07,0.1,0.36,0.08,-0.35,0.05,-1.07,0.03,-1.78,0,-2.49,-0.03,-3.2,-0.05,-3.91,-0.08,-4.62,-0.1,1.1,-0.9,0.39,-0.92,-0.32,-0.95,-1.03,-0.97,-1.74,-1,-2.45,-1.02,-3.17,-1.05,-3.88,-1.07,-4.59,-1.1,1.14,-1.9,0.43,-1.92,-0.28,-1.95,-1,-1.97,-1.71,-2,-2.42,-2.02,-3.13,-2.05,-3.84,-2.07,-4.55,-2.1,1.17,-2.9,0.46,-2.92,-0.25,-2.95,-0.96,-2.97,-1.67,-3,-2.38,-3.02,-3.1,-3.05,-3.81,-3.07,-4.52,-3.1,1.21,-3.9,0.5,-3.92,-0.21,-3.95,-0.93,-3.97,-1.64,-4,-2.35,-4.02,-3.06,-4.05,-3.77,-4.07,-4.48,-4.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_03","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.31,20.14,1.46,20.72,3.3,21.34,5.01,21.88,6.38,22.26,7.52,22.58,8.66,22.97,9.8,23.39,10.93,23.79,-2.08,21.93,-0.33,22.52,1.48,23.14,3.16,23.7,4.52,24.08,5.66,24.47,6.8,25.01,7.93,25.6,9.07,26.17,-3.84,23.25,-2.11,23.97,-0.34,24.73,1.31,25.42,2.66,25.93,3.8,26.4,4.93,27.1,6.07,27.88,7.21,28.62,-5.61,24.77,-3.91,25.56,-2.17,26.39,-0.55,27.15,0.8,27.73,1.94,28.26,3.07,29.09,4.21,30.03,5.34,30.92,-7.43,27.19,-5.76,27.8,-4.02,28.44,-2.4,29.02,-1.07,29.41,0.07,29.93,1.21,30.81,2.34,31.84,3.48,32.8,-9.1,29.35,-7.65,29.88,-6.16,30.44,-4.73,30.94,-3.47,31.3,-2.26,31.94,-0.98,32.86,0.31,33.89,1.54,34.88,-10.48,32.32,-9.27,32.75,-8.06,33.19,-6.86,33.6,-5.7,33.92,-4.47,34.49,-3.14,35.28,-1.79,36.14,-0.5,36.97,-11.75,35.61,-10.78,35.94,-9.85,36.28,-8.87,36.6,-7.81,36.87,-6.58,37.31,-5.25,37.87,-3.89,38.49,-2.58,39.08,-13.07,38.74,-12.33,39,-11.63,39.27,-10.85,39.53,-9.85,39.79,-8.64,40.09,-7.33,40.44,-5.98,40.82,-4.64,41.18]},{"duration":60,"tweenEasing":0,"value":[8.71,26.27,9.35,26.92,10.05,27.6,10.62,28.21,10.86,28.65,10.86,29.03,10.86,29.49,10.86,29.97,10.86,30.44,6.85,26.47,7.46,27.12,8.14,27.81,8.68,28.43,8.9,28.88,8.9,29.33,8.9,29.93,8.9,30.59,8.9,31.22,5.01,26.18,5.59,26.97,6.23,27.8,6.74,28.55,6.95,29.12,6.95,29.66,6.95,30.42,6.95,31.27,6.95,32.08,3.14,26.11,3.7,26.97,4.31,27.86,4.8,28.68,5,29.32,5,29.92,5,30.81,5,31.82,4.99,32.77,1.23,26.93,1.77,27.61,2.36,28.32,2.85,28.95,3.05,29.41,3.04,29.99,3.04,30.94,3.04,32.03,3.04,33.06,-0.53,27.5,-0.21,28.09,0.14,28.71,0.43,29.28,0.55,29.71,0.61,30.4,0.76,31.39,0.92,32.49,1.01,33.54,-2,28.87,-1.93,29.36,-1.85,29.87,-1.79,30.34,-1.77,30.72,-1.68,31.36,-1.48,32.21,-1.27,33.14,-1.12,34.04,-3.36,30.56,-3.53,30.96,-3.73,31.36,-3.9,31.74,-3.97,32.08,-3.88,32.58,-3.69,33.21,-3.47,33.89,-3.29,34.55,-4.77,32.1,-5.17,32.42,-5.61,32.75,-5.96,33.07,-6.1,33.4,-6.03,33.76,-5.86,34.18,-5.64,34.62,-5.44,35.05]},{"value":[20.64,30.37,20.56,30.99,20.56,31.64,20.41,32.23,19.94,32.65,19.23,33,18.51,33.43,17.8,33.89,17.09,34.34,18.81,29.56,18.71,30.19,18.67,30.86,18.51,31.45,18.02,31.87,17.31,32.3,16.6,32.87,15.88,33.51,15.17,34.11,17,28.28,16.88,29.05,16.8,29.84,16.61,30.57,16.1,31.12,15.39,31.64,14.68,32.37,13.97,33.19,13.25,33.97,15.18,27.21,15.02,28.04,14.92,28.91,14.7,29.71,14.19,30.32,13.47,30.89,12.76,31.76,12.05,32.74,11.33,33.67,13.3,27.03,13.12,27.68,13.01,28.37,12.78,28.98,12.27,29.41,11.56,29.96,10.84,30.89,10.13,31.96,9.42,32.96,11.58,26.6,11.18,27.17,10.82,27.76,10.4,28.31,9.81,28.71,9.16,29.38,8.6,30.34,8.04,31.42,7.42,32.44,10.14,26.97,9.5,27.44,8.86,27.92,8.21,28.37,7.52,28.73,6.9,29.34,6.39,30.16,5.89,31.07,5.33,31.94,8.82,27.67,7.93,28.03,7.02,28.41,6.14,28.77,5.36,29.08,4.73,29.55,4.21,30.16,3.73,30.82,3.19,31.45,7.44,28.2,6.33,28.5,5.18,28.8,4.12,29.1,3.26,29.4,2.62,29.74,2.08,30.14,1.59,30.55,1.08,30.95]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_04","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-4.6,46.41,-2.19,47.64,0.36,48.93,2.63,50.09,4.24,50.91,5.38,51.61,6.52,52.45,7.65,53.36,8.79,54.23,-8.23,48.4,-5.87,49.64,-3.39,50.95,-1.16,52.13,0.43,52.96,1.57,53.8,2.7,54.93,3.84,56.19,4.97,57.38,-11.83,49.43,-9.51,50.94,-7.11,52.53,-4.95,53.97,-3.39,55.05,-2.25,56.06,-1.12,57.52,0.02,59.15,1.15,60.7,-15.47,50.88,-13.19,52.53,-10.85,54.26,-8.75,55.84,-7.2,57.05,-6.06,58.18,-4.93,59.9,-3.8,61.85,-2.66,63.69,-19.21,54.13,-16.99,55.41,-14.66,56.76,-12.56,57.97,-11.02,58.81,-9.88,59.91,-8.75,61.75,-7.61,63.87,-6.48,65.86,-22.63,56.85,-20.86,57.97,-19.02,59.15,-17.3,60.22,-15.92,61.01,-14.64,62.34,-13.22,64.24,-11.78,66.38,-10.44,68.41,-25.48,61.19,-24.2,62.1,-22.91,63.06,-21.65,63.95,-20.47,64.64,-19.15,65.85,-17.62,67.48,-16.06,69.29,-14.62,71.01,-28.11,66.18,-27.31,66.89,-26.58,67.64,-25.77,68.35,-24.77,68.95,-23.47,69.88,-21.95,71.08,-20.36,72.38,-18.87,73.63,-30.85,70.84,-30.5,71.43,-30.24,72.01,-29.81,72.6,-28.96,73.19,-27.68,73.85,-26.19,74.63,-24.61,75.44,-23.08,76.23]},{"duration":60,"tweenEasing":0,"value":[17.42,52.54,18.7,53.83,20.1,55.19,21.24,56.42,21.71,57.3,21.71,58.06,21.71,58.97,21.71,59.94,21.71,60.88,13.7,52.93,14.92,54.24,16.27,55.62,17.36,56.86,17.81,57.75,17.81,58.66,17.81,59.86,17.81,61.17,17.8,62.43,10.01,52.37,11.19,53.94,12.46,55.59,13.48,57.1,13.9,58.25,13.9,59.32,13.9,60.84,13.9,62.54,13.9,64.15,6.29,52.22,7.41,53.94,8.63,55.73,9.6,57.37,10,58.65,10,59.84,9.99,61.62,9.99,63.64,9.99,65.54,2.46,53.87,3.53,55.21,4.73,56.63,5.69,57.91,6.09,58.81,6.09,59.98,6.09,61.88,6.08,64.07,6.08,66.11,-1.05,55,-0.43,56.18,0.28,57.42,0.86,58.56,1.1,59.41,1.23,60.8,1.52,62.77,1.84,64.98,2.03,67.07,-4,57.74,-3.86,58.71,-3.71,59.74,-3.59,60.69,-3.54,61.45,-3.36,62.72,-2.97,64.42,-2.53,66.29,-2.24,68.07,-6.71,61.13,-7.06,61.91,-7.46,62.72,-7.79,63.49,-7.93,64.16,-7.77,65.16,-7.38,66.41,-6.93,67.78,-6.58,69.09,-9.54,64.19,-10.34,64.84,-11.21,65.5,-11.92,66.15,-12.21,66.8,-12.06,67.53,-11.71,68.36,-11.28,69.24,-10.88,70.1]},{"value":[40.35,56.64,40.91,57.91,41.61,59.24,42.04,60.44,41.8,61.3,41.08,62.03,40.37,62.92,39.66,63.86,38.95,64.78,36.67,56.03,37.18,57.31,37.81,58.66,38.19,59.88,37.92,60.75,37.21,61.63,36.5,62.8,35.79,64.1,35.07,65.33,33.01,54.47,33.47,56.02,34.04,57.64,34.35,59.12,34.05,60.25,33.34,61.3,32.63,62.79,31.92,64.46,31.2,66.05,29.32,53.32,29.73,55.01,30.24,56.78,30.5,58.4,30.18,59.65,29.47,60.81,28.76,62.57,28.04,64.56,27.33,66.44,25.52,53.97,25.89,55.29,26.37,56.68,26.63,57.93,26.31,58.81,25.6,59.95,24.89,61.83,24.17,63.99,23.46,66.01,22.05,54.1,21.96,55.25,21.96,56.48,21.83,57.59,21.36,58.42,20.77,59.77,20.36,61.72,19.96,63.91,19.44,65.97,19.14,55.84,18.57,56.79,18.01,57.79,17.42,58.72,16.76,59.45,16.21,60.69,15.9,62.37,15.63,64.22,15.21,65.97,16.46,58.23,15.41,58.99,14.29,59.77,13.25,60.52,12.4,61.17,11.85,62.13,11.52,63.37,11.26,64.71,10.9,65.99,13.66,60.3,12.16,60.92,10.58,61.55,9.16,62.18,8.15,62.8,7.59,63.51,7.23,64.32,6.95,65.17,6.63,66]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02","timeline":[{"name":"B_HAIR_FRONT.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_FRONT.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_FRONT.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_FRONT.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_FRONT.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_00","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-70,-27.99,-54.24,-43.61,-37.95,-57.8,-19,-60.63,-6.62,-62.03,2.85,-53.7,3.49,-42.18,-2.61,-33.32,-9.03,-24.18,-65.6,-33.17,-53.11,-51.85,-40.04,-67.04,-25.12,-75,-15.49,-80.97,-8.12,-73.63,-8.4,-57.83,-16.73,-46.53,-24.71,-35.43,-59.1,-40.99,-51.1,-62.43,-43.31,-78.26,-32.9,-90.84,-25.38,-100.6,-19.51,-93.34,-20.41,-72.9,-30.22,-59.17,-39.31,-46.14,-52.23,-46.18,-47.93,-69.73,-44.3,-87.34,-38.26,-103.62,-34.87,-115.52,-31.99,-108.08,-31.8,-84.31,-37.16,-66.88,-42.72,-50.41,-42.17,-44.51,-42.29,-68,-44.45,-88.37,-43.27,-106.83,-43.46,-121.14,-41.86,-117.66,-39.03,-94.83,-35.63,-71.7,-32.9,-48.8,-36.4,-39,-39.59,-62.48,-45.27,-85.84,-48.13,-106.53,-50.2,-123.66,-48.22,-124.66,-43.31,-103.56,-33.51,-75.96,-23.93,-47.62,-35.35,-26.63,-38.66,-51.61,-42.85,-77.03,-46.17,-98.68,-48.11,-118.86,-46.59,-125.45,-42.96,-107.08,-32.93,-79.63,-22.09,-48.48,-21.94,-11.24,-27.07,-37.88,-32.55,-64.45,-36.27,-85.95,-38.62,-109.22,-39.53,-121.89,-38.27,-106.33,-28.64,-80.83,-17.84,-47.58,-7.33,4.09,-14.43,-24.12,-21.4,-51.79,-25.59,-73.03,-28.5,-99.39,-31.97,-118.12,-33.13,-105.35,-24.02,-81.77,-13.33,-46.42]},{"duration":60,"tweenEasing":0,"value":[-74,-4.32,-62.98,-19.9,-50.98,-35.17,-33.94,-45.03,-22.54,-53.28,-10.57,-51.51,-4.93,-46.73,-0.66,-47.73,3.97,-48.51,-59.99,-12.87,-49.28,-32.84,-36.93,-51.54,-21.16,-65.55,-10.45,-73.54,0.14,-67.77,3.4,-60.46,1.74,-56.56,0.9,-52.23,-44.66,-24.08,-35.02,-47.4,-23.7,-68.32,-9.5,-85.86,0.46,-93.77,9.6,-84.15,10.68,-74.18,3.88,-65.33,-1.94,-55.66,-35.23,-33.33,-27.49,-57.75,-19.09,-79.29,-7.57,-98.99,1.49,-109.66,9.65,-100.95,10.3,-87.87,3.88,-72.49,-2.76,-56.12,-27.67,-39.23,-21.14,-61.49,-15.57,-82.24,-7.93,-101.36,-2.14,-117.12,3.86,-114.49,4.7,-97.29,0.59,-74.94,-3.91,-51.65,-22.71,-41.57,-16.59,-62.64,-12.4,-83.74,-8.28,-102.41,-6.18,-121.46,-2.79,-122.46,-1.76,-101.62,-3.58,-74.84,-5.9,-47.17,-21.39,-31.76,-15.76,-53.47,-10.8,-75.66,-7.61,-94.97,-6.15,-116.39,-3.56,-122.32,-3.72,-102.95,-5.39,-76.03,-6.87,-45.44,-10.25,-14.18,-8.04,-38.31,-5.93,-62.65,-4.08,-84.02,-4.69,-107.9,-5.02,-120.23,-6.8,-103.58,-7.54,-75.89,-7.73,-40.29,2,3.79,0.55,-22.88,-0.63,-49.57,-0.26,-73.03,-3.17,-99.39,-6.64,-118.12,-10.06,-104.07,-9.79,-75.49,-8.67,-34.73]},{"value":[-112.33,19.68,-92.29,-17.89,-70.25,-45.88,-47.02,-59.85,-35.29,-73.11,-23.83,-71.3,-17.27,-65.44,-16.34,-69.92,-15.7,-74.85,-83.2,5.22,-65.36,-29.06,-46.17,-55.27,-23.16,-69.82,-9.32,-82.7,2.34,-78.12,4.87,-70.28,0.85,-69.14,-3.7,-68.13,-57.81,-7.87,-41.02,-39.43,-22.77,-64.9,0.56,-80.34,16.24,-92.86,27.84,-85.56,26.28,-75.42,17.13,-68.47,7.31,-61.15,-35.26,-19.49,-20.77,-49.42,-5.78,-75.14,15.24,-92.79,30.83,-106.39,41.37,-99.14,36.9,-85.18,23.54,-70.44,10.09,-54.84,-20.17,-27.56,-8.98,-54.39,-0.4,-78.24,14.91,-96.96,26.79,-114.53,34.53,-112.86,31.84,-95.32,23.41,-73.52,14.43,-50.98,-20.05,-32.08,-7.23,-55.56,2.78,-78.23,15.01,-97.13,22.62,-117.81,26.91,-120.48,25.94,-100.34,22.38,-74.11,17.91,-47.12,-22.37,-25.01,-9.02,-49.95,3.97,-75.14,14.63,-95.15,21.17,-115.75,25.22,-120.95,23.76,-101.91,20.5,-75.49,17.46,-45.44,-8.51,-16.53,0.05,-43.23,8.68,-69.77,15.89,-90.62,19.43,-110.98,21.46,-119.83,19.16,-103.04,17.6,-75.61,16.6,-40.29,6.67,-8.21,10.11,-36.46,13.78,-64.3,17.37,-85.79,17.67,-106.06,17.4,-118.69,14.27,-104.07,14.54,-75.49,15.67,-34.73]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_01","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-54.33,-21.83,-36.32,-29.4,-18.17,-36.4,-1.85,-37.25,6.65,-25.39,11.96,-8.81,7.83,-4.38,-1.49,-2.31,-11.02,0.07,-53.79,-21.53,-41.16,-31.52,-28.63,-38.9,-16.74,-41.3,-10.52,-34.68,-6.51,-21.46,-8.54,-16.82,-14.45,-14.1,-20.84,-11.17,-52.15,-22.59,-45.59,-35.17,-39.86,-43.26,-32.61,-47.03,-27.64,-44.96,-23.94,-34.34,-23.86,-29.06,-26.61,-25.56,-30.03,-21.87,-48.96,-23.11,-46.15,-37.28,-43.46,-46.61,-39.22,-51.85,-34.77,-53.61,-30.41,-45.63,-29.22,-38.58,-31.03,-32.48,-32.41,-26.18,-38.83,-21.56,-41.3,-35.15,-44.34,-45.93,-43.2,-53.26,-41.4,-58.03,-38.09,-53.46,-35.29,-44.53,-30.96,-34.83,-26.28,-24.98,-30.01,-19.08,-37.33,-32.24,-45.42,-44.82,-47.2,-53.96,-48.26,-60.74,-46.2,-58.43,-41.79,-48,-31.3,-36.25,-20.58,-24.2,-26.89,-10.93,-35.25,-25.34,-43.19,-39.66,-45.19,-49.87,-46.35,-58.24,-44.8,-58.82,-41.09,-49.4,-30.23,-38.41,-18.66,-25.76,-14.78,2.8,-24.53,-14.5,-33.57,-31.48,-35.7,-43.24,-36.96,-53.98,-37.01,-58.91,-34.86,-51.33,-24.87,-41.22,-13.98,-27.43,-1.67,16.86,-12.89,-3.4,-23.17,-23.15,-25.46,-36.52,-26.92,-49.7,-28.65,-59.06,-28.1,-53.32,-19.13,-44.03,-9,-29.05]},{"duration":60,"tweenEasing":0,"value":[-37,-2.16,-31.49,-9.95,-25.49,-17.59,-16.97,-22.52,-11.27,-26.64,-5.28,-25.76,-2.46,-23.37,-0.33,-23.86,1.98,-24.26,-30,-6.43,-24.64,-16.44,-18.48,-25.75,-10.59,-32.77,-5.23,-36.75,0.07,-33.88,1.7,-30.23,0.87,-28.29,0.45,-26.11,-22.33,-12.04,-17.51,-23.71,-11.85,-34.14,-4.76,-42.92,0.23,-46.84,4.8,-42.06,5.34,-37.1,1.94,-32.67,-0.97,-27.83,-17.61,-16.67,-13.74,-28.87,-9.53,-39.64,-3.78,-49.52,0.75,-54.87,4.82,-50.49,5.15,-43.93,1.94,-36.24,-1.38,-28.06,-13.83,-19.62,-10.57,-30.73,-7.77,-41.13,-3.96,-50.73,-1.07,-58.69,1.92,-57.32,2.35,-48.62,0.29,-37.46,-1.95,-25.82,-11.36,-20.79,-8.3,-31.31,-6.2,-41.88,-4.14,-51.22,-3.1,-60.8,-1.4,-61.27,-0.88,-50.8,-1.79,-37.41,-2.95,-23.59,-10.7,-15.88,-7.88,-26.74,-5.4,-37.82,-3.8,-47.48,-3.07,-58.2,-1.78,-61.17,-1.86,-51.48,-2.7,-38.02,-3.43,-22.72,-5.12,-7.09,-4.02,-19.15,-2.96,-31.33,-2.04,-42.01,-2.34,-53.96,-2.51,-60.12,-3.4,-51.79,-3.77,-37.95,-3.87,-20.15,1,1.89,0.27,-11.44,-0.31,-24.78,-0.13,-36.51,-1.58,-49.69,-3.32,-59.06,-5.03,-52.04,-4.9,-37.75,-4.33,-17.36]},{"value":[-78.66,35.18,-61.21,18.23,-43.74,2.06,-29.9,-6.92,-23.44,-25.97,-16.69,-40.02,-16.4,-39.36,-17.19,-44.73,-17.68,-50.59,-54.15,20.91,-36.71,5.01,-18.47,-9.98,-4.41,-20.14,2.6,-36.29,8.04,-45.11,5.97,-42.18,0.78,-42.04,-4.14,-42.01,-29.05,4.73,-12.22,-9.61,5.72,-22.75,19.72,-33.68,27.17,-46.77,31.22,-50.2,26.86,-44.86,17.5,-39.26,8.28,-33.32,-12.77,-10.61,1.66,-23.48,16.56,-34.95,29.03,-46.02,36.29,-56.58,38.89,-55.96,33.44,-47.98,22.46,-37.68,11.47,-26.78,-3.17,-16.12,7.73,-28.33,18.12,-39.69,27.34,-50.3,33.13,-60.56,34.23,-60.01,30.38,-50.22,23.56,-37.91,16.38,-25.16,5.7,-19.28,13.17,-31.05,19.19,-42.67,25.24,-52.74,29.59,-62.16,29.17,-61.02,26.91,-49.91,24.22,-36.91,20.87,-23.53,6.24,-14.69,13.41,-26.71,19.85,-38.85,24.6,-48.95,27.99,-59.14,27.71,-60.53,25.62,-50.45,23.2,-37.49,20.9,-22.72,8.96,-6.47,15.31,-19.31,21.16,-32.14,24.38,-42.76,25.41,-54.42,24.47,-59.78,22.56,-51.26,21.37,-37.67,20.47,-20.15,12,1.89,17.45,-11.79,22.56,-25.35,24.2,-36.51,22.75,-49.69,21.02,-59.06,19.3,-52.04,19.44,-37.75,20,-17.36]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_02","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-17.33,-19.67,-4.83,-19.45,7.32,-18.81,15.12,-14.74,17.92,1.25,17.25,16.95,10.3,18.99,-1.16,21.55,-13,24.33,-23.79,-15.09,-16.5,-15.08,-10.14,-13.18,-6.15,-8.53,-5.3,2,-6.6,12.36,-10.24,13.34,-15.32,14.22,-21.29,14.95,-29.82,-10.55,-28.07,-11.44,-28,-9.19,-27.84,-4.14,-27.87,1.8,-28.75,7.66,-29.2,8,-28.55,7.11,-29.06,5.96,-31.34,-6.44,-32.41,-8.4,-33.94,-6.95,-35.44,-2.34,-35.51,1.27,-35.23,4.87,-34.37,5.34,-32.97,3.76,-31.03,1.88,-25,-1.95,-30.71,-4.41,-36.58,-4.8,-39.25,-2.54,-40.35,0.66,-40.02,3.86,-37.63,4.09,-31.22,2.61,-24.33,0.84,-18.66,1.7,-29.03,-0.93,-39.22,-2.94,-43.07,-2.74,-45.18,0.05,-44.8,2.85,-40.9,2.8,-29.48,1.16,-17.63,-0.62,-16.2,4.95,-27.35,1.42,-37.79,-1.86,-41.38,-2.38,-43.27,0,-43.01,2.37,-39.24,2.1,-27.55,-0.39,-15.22,-3.04,-9.65,9.89,-20.5,4.67,-30.61,-0.17,-33.66,-1.23,-34.62,0,-34.5,1.22,-31.46,0.47,-21.11,-3.26,-10.11,-7.29,-2.67,14.97,-13.16,8.04,-22.85,1.63,-25.33,0,-25.33,0,-25.33,0,-23.07,-1.28,-14.23,-6.28,-4.67,-11.69]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-31,38.67,-23.99,28.9,-17.08,19.79,-12.93,15.6,-12.17,0.67,-11.4,-14.26,-14.95,-16.43,-21.88,-23.02,-29,-30.33,-21.54,26.32,-10.67,20.09,0.66,14.42,7.76,12.22,8.08,0.55,8.08,-10.59,2.56,-11.42,-6.85,-15.08,-16.39,-19.28,-12.72,14.1,1.69,11.26,16.9,8.81,26.83,8.57,26.93,0.3,26.42,-6.92,18.96,-6.38,7.1,-7.17,-4.83,-8.3,-8.52,6.38,5.93,4.68,21.22,3.33,31.73,3.57,33.06,-1.04,32.97,-4.25,24.73,-2.73,11.57,-1.94,-1.19,-1.28,7.17,3.33,15.44,1.8,23.86,0.7,30.69,0.48,32.82,-1.48,31.71,-2.03,26.12,-0.91,18.62,-0.66,11,-0.67,22.86,0.29,24.84,-0.53,26.11,-1.14,29.24,-1.51,32.37,-1.27,30.43,0.36,27.49,1.02,25.67,0.55,23.19,-0.06,24.33,0,25.38,-0.53,26.43,-1.03,28.4,-1.46,31.06,-0.92,29.49,0.65,27.48,1.03,25.9,0.53,24.33,0,24.33,0,24.87,-0.28,25.42,-0.53,26.42,-0.75,27.76,-0.46,26.98,0.34,25.97,0.53,25.14,0.28,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_03","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-4.7,-20.21,5.04,-4.77,14.38,11.42,17.67,28.03,14.27,34.09,7.69,33.83,-7.05,23.44,-25.44,13.38,-44.03,3.48,-12.18,-9.27,-7.83,8.25,-5.21,27.87,-5.44,46.62,-8.8,49,-13.79,44.44,-23.22,31.84,-33.71,18.91,-44.8,5.68,-19.93,1.41,-21.05,20.19,-25.23,42.19,-28.95,62.96,-31.42,62.95,-34.05,55.3,-38.4,41,-41.5,24.87,-45.51,8.43,-26.23,8.93,-28.89,27.1,-32.79,49.74,-37.16,70.72,-39.95,71.82,-41.65,65.5,-43.36,51.41,-44.3,33.65,-44.61,15.88,-21.84,18.44,-28.77,33.48,-35.85,54.44,-40,69.34,-42.49,69.33,-43.12,65.05,-42.73,52.54,-38.25,37.67,-33.45,22.96,-17.88,27.52,-29.04,39.3,-39.32,58.37,-43.24,66.9,-45.36,65.07,-44.88,62.19,-42.55,50.89,-33.27,38.47,-23.69,26.56,-16.65,32.22,-28.13,41.67,-38.53,57.18,-41.93,63.3,-44.54,58.88,-44.9,55.2,-42.13,44.68,-31.89,32.1,-21.18,19.92,-12.96,39.74,-22.58,46.12,-31.38,55.93,-33.82,60.78,-34.98,53.39,-34.82,47.84,-31.97,37.57,-22.24,23.08,-12,8.61,-9.06,47.61,-16.66,50.89,-23.58,54.96,-24.96,58.51,-24.43,48.12,-23.49,40.68,-20.66,30.02,-11.83,12.69,-2.37,-4.98]},{"duration":60,"tweenEasing":0,"value":[12.64,-0.54,9.87,14.67,7.05,30.23,2.55,42.76,-3.65,32.84,-9.56,16.88,-17.35,4.45,-24.29,-8.17,-31.03,-20.85,11.61,5.82,8.66,23.33,4.93,41.07,0.71,55.14,-3.48,47.05,-7.17,32.14,-13.02,18.57,-18.37,4.64,-23.51,-9.27,9.89,11.96,7.01,31.63,2.76,51.43,-1.11,67.1,-3.54,61.22,-5.29,47.7,-9.23,33.07,-12.95,17.7,-16.45,2.47,5.12,15.37,3.51,35.53,1.14,56.71,-1.71,73.06,-4.43,70.55,-6.41,60.63,-9,46.07,-11.34,29.9,-13.58,14,3.16,20.39,1.95,37.89,0.73,59.28,-0.74,71.89,-2.13,68.67,-3.1,61.19,-5.09,48.45,-7.03,35.06,-9.12,22.12,0.78,25.82,-0.02,40.22,-0.1,61.32,-0.17,69.64,-0.17,65.02,-0.07,59.34,-1.64,48.09,-3.77,37.32,-6.06,27.18,-0.45,27.27,-0.77,40.25,-0.74,59.06,-0.55,65.67,-1.27,58.89,-1.89,52.84,-2.87,42.57,-4.29,32.5,-5.95,22.97,-3.31,29.85,-2.08,41.45,-0.77,56.12,-0.16,62.01,-0.37,53.39,-0.31,46.62,-0.49,37.07,-1.08,26.34,-1.89,15.9,-6.39,32.64,-3.51,42.85,-0.72,53.33,0.37,58.52,0.9,48.12,1.85,40.69,2.42,31.3,2.41,18.97,2.3,6.71]},{"value":[-18.36,38.13,-15.97,42.95,-13.59,48.83,-14.12,54.83,-20.44,36.55,-25.77,13.49,-35.75,-1.62,-47.48,-18.12,-59.03,-35.18,-7.02,32.94,-1.84,42.59,3.22,53.18,4.64,63.05,-0.91,48.97,-6.05,29.47,-16.71,15,-28.96,-1.12,-41.43,-18.53,3.64,27.94,11.48,42.31,19,57.46,22.32,71.1,17.68,61.18,12.88,45.19,1.08,31.59,-13.12,16.02,-27.41,-1.46,7.5,26.16,16.29,42.51,25.02,60.41,29.46,74.94,26.14,68.18,21.82,55.97,10.04,43.31,-5.11,28.34,-19.95,11.42,15.57,26.47,20.65,41.2,25.95,60.16,29.36,71.38,28.25,66.5,24.72,59.31,16.3,47.56,5.34,33.11,-5.49,17.62,24.07,26.36,25.03,39.81,26.22,60.1,28.43,67.74,29.74,63.24,27.29,59.64,22.4,48.51,16.19,34.63,9.66,20.76,23.88,27.27,24.61,39.72,25.69,58.03,27.31,64.01,27.55,57.99,24.78,54.15,21.95,44.04,18.24,31.64,14.16,19.53,21.03,29.85,22.79,41.18,24.65,55.58,25.96,61.3,26.01,54.64,24.76,50.53,23.58,41.11,21.64,28.79,19.39,16.6,17.94,32.64,20.83,42.85,23.61,53.33,24.66,58.82,24.73,51.62,25.22,47.38,25.64,38.08,25.2,24.9,24.63,11.71]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_04","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[7.94,-20.75,14.91,9.9,21.43,41.64,20.22,70.79,10.62,66.93,-1.88,50.71,-24.39,27.89,-49.73,5.21,-75.06,-17.36,-0.57,-3.45,0.84,31.58,-0.27,68.91,-4.68,101.56,-12.3,95.72,-21.04,76.5,-36.18,50.34,-52.11,23.59,-68.31,-3.59,-10.04,13.37,-14.03,51.82,-22.45,93.57,-30.01,129.72,-34.94,123.66,-39.38,102.9,-47.58,73.97,-54.46,42.65,-61.96,10.91,-21.11,24.31,-25.38,62.62,-31.64,106.44,-38.88,143.83,-44.39,142.44,-48.06,126.14,-52.35,97.49,-55.63,63.56,-58.2,29.88,-18.69,38.82,-26.82,71.36,-35.12,113.71,-40.75,141.28,-44.64,138.07,-46.22,126.26,-47.82,100.96,-45.28,72.75,-42.57,45.09,-17.1,53.34,-29.06,79.52,-39.41,119.68,-43.41,136.54,-45.54,130.1,-44.95,121.53,-44.21,98.93,-37.06,75.76,-29.75,53.74,-17.11,59.48,-28.9,81.91,-39.28,116.24,-42.48,128.97,-45.8,117.77,-46.79,108.04,-45.03,87.17,-36.24,64.55,-27.13,42.89,-16.27,69.59,-24.66,87.58,-32.15,112.05,-33.98,122.8,-35.35,106.79,-35.13,94.46,-32.48,74.61,-23.39,49.39,-13.89,24.51,-15.45,80.25,-20.17,93.74,-24.3,108.29,-24.58,117.03,-23.53,96.25,-21.64,81.37,-18.24,61.32,-9.42,31.66,-0.07,1.73]},{"duration":60,"tweenEasing":0,"value":[25.28,-1.08,19.74,29.34,14.11,60.45,5.11,85.53,-7.29,65.68,-19.13,33.76,-34.69,8.9,-48.57,-16.34,-62.06,-41.69,23.22,11.65,17.33,46.67,9.87,82.14,1.49,109.98,-6.93,93.75,-14.4,64.29,-26.07,37.13,-36.74,9.28,-47.02,-18.54,19.78,23.92,14.02,63.27,5.54,102.84,-2.15,133.81,-7.04,121.93,-10.61,95.35,-18.49,66.11,-25.89,35.4,-32.91,4.95,10.23,30.75,7.03,71.05,2.28,113.43,-3.44,146.17,-8.87,141.17,-12.82,121.26,-17.98,92.15,-22.67,59.81,-27.17,28,6.31,40.77,3.91,75.76,1.46,118.58,-1.48,143.83,-4.27,137.42,-6.19,122.39,-10.19,96.87,-14.06,70.13,-18.24,44.24,1.55,51.64,-0.04,80.44,-0.2,122.63,-0.34,139.29,-0.34,130.05,-0.14,118.67,-3.29,96.13,-7.53,74.62,-12.12,54.36,-0.91,54.54,-1.54,80.49,-1.48,118.13,-1.1,131.34,-2.55,117.78,-3.79,105.69,-5.75,85.04,-8.57,64.97,-11.9,45.93,-6.61,59.69,-4.16,82.9,-1.54,112.24,-0.32,124.02,-0.73,106.8,-0.62,93.25,-0.97,74.08,-2.15,52.65,-3.78,31.8,-12.79,65.28,-7.01,85.7,-1.45,106.65,0.75,117.03,1.8,96.25,3.7,81.37,4.83,62.6,4.81,37.94,4.6,13.42]},{"value":[-5.72,37.59,-7.95,57.01,-10.1,77.87,-15.3,94.07,-28.71,72.43,-40.14,41.25,-56.55,13.2,-73.08,-13.22,-89.06,-40.02,7.51,39.56,7.01,65.1,5.77,91.92,1.49,113.87,-9.92,97.48,-20.18,69.61,-35.89,41.35,-51.09,12.85,-66.47,-17.78,20,41.77,21.29,73.38,21.07,106.07,17.78,133.69,8.42,122.24,-0.63,97.4,-16.74,69.51,-33.35,39.21,-50,5.38,23.53,45.93,26.64,80.34,28.84,117.5,27.19,146.37,19.22,137.52,10.68,116.22,-4.64,89.32,-21.8,58.62,-38.71,24.12,23.98,49.6,25.84,80.57,28.05,119.69,28,142.34,23.65,134.59,17.74,120.68,6.48,96.04,-7.95,66.88,-21.99,35.91,25.28,52.43,25.22,80.13,26.33,121.36,27.61,136.98,27.11,127.76,24.14,118.92,17.31,96.03,6.71,68.7,-3.86,41.57,23.42,54.54,23.84,79.96,24.95,117.09,26.23,129.48,24.06,116.93,20.08,107.66,16.41,86.94,10.63,62.73,3.98,39.06,17.72,59.69,20.71,82.63,23.88,111.7,25.52,123.36,24.27,109.76,22.54,100.73,21.2,81.62,18.18,57.31,14.45,33.21,11.55,65.28,17.32,85.7,22.88,106.65,25,117.64,25.13,103.25,26.12,94.77,26.95,76.17,26.07,49.8,24.93,23.42]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02","timeline":[{"name":"B_HAIR_SIDE.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_SIDE.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_SIDE.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_SIDE.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_00","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-67.76,-49.87,-57.41,-56.77,-49.99,-64.04,-40.89,-65.8,-34.23,-64.45,-30.95,-63.09,-30.6,-64.06,-30.15,-54.9,-29.67,-44.55,-51.46,-47.73,-45.1,-53.68,-41.03,-59.43,-35.83,-61.56,-32.28,-63.24,-30.79,-64.92,-30.59,-65.95,-30.15,-55.88,-29.67,-44.56,-36.36,-45.22,-33.74,-50.28,-32.66,-54.91,-31.2,-57.27,-30.51,-61.87,-30.65,-66.47,-30.57,-67.57,-30.14,-56.72,-29.67,-44.56,-32.31,-39.15,-31.1,-44.48,-30.06,-49.48,-30.32,-53.01,-30.47,-58.92,-30.62,-64.83,-30.53,-66,-30.11,-55.9,-29.67,-44.57,-32.01,-29.49,-30.92,-32.8,-29.96,-36.09,-30.01,-40.03,-30.09,-45.97,-30.17,-51.91,-30.12,-54.72,-29.9,-50.06,-29.67,-44.58,-31.7,-22.25,-30.73,-22.59,-29.85,-23.25,-29.7,-27.05,-29.71,-33.02,-29.72,-38.99,-29.72,-43.49,-29.7,-44.26,-29.67,-44.58,-31.38,-20.53,-30.51,-23.51,-29.47,-26.68,-29.2,-31.16,-29.43,-34.51,-29.65,-37.86,-29.67,-41.86,-29.67,-43.38,-29.67,-44.59,-30.25,-16.25,-30.08,-23.84,-29.77,-31.26,-29.67,-36.58,-29.67,-36.82,-29.67,-37.06,-29.67,-40.94,-29.67,-42.9,-29.67,-44.6,-29.02,-11.62,-29.63,-23.81,-30.19,-35.47,-30.3,-41.64,-30,-38.89,-29.69,-36.14,-29.66,-39.95,-29.67,-42.4,-29.67,-44.6]},{"duration":60,"tweenEasing":0,"value":[-38.02,-28.89,-27.68,-36.26,-20.26,-43.96,-11.12,-46.12,-4.01,-47.97,-0.28,-49.82,-0.01,-52.51,-0.01,-48.91,0,-44.57,-22.89,-32.95,-16.72,-39.4,-12.73,-45.81,-7.29,-49.38,-2.93,-53.3,-0.64,-57.22,-0.42,-59.22,-0.21,-52.38,0,-44.58,-8.91,-36.71,-6.62,-42.2,-5.74,-47.61,-3.79,-52.36,-1.97,-58.23,-0.98,-64.09,-0.8,-65.48,-0.4,-55.63,0,-44.59,-5.19,-35.34,-4.28,-40.63,-3.41,-46,-3.1,-51.81,-2.08,-58.3,-1.06,-64.79,-0.86,-66.02,-0.44,-55.92,0,-44.59,-3.67,-27.51,-2.75,-30.75,-1.89,-34.2,-1.62,-39.41,-1.09,-45.66,-0.56,-51.9,-0.45,-54.74,-0.24,-50.08,0,-44.6,-2.15,-22.1,-1.22,-22.34,-0.37,-22.94,-0.15,-27.01,-0.1,-33.02,-0.06,-39.02,-0.05,-43.52,-0.04,-44.28,0,-44.61,-1.72,-20.55,-0.85,-23.54,0.2,-26.7,0.47,-31.18,0.24,-34.53,0.01,-37.88,-0.01,-41.88,0,-43.4,0,-44.61,-0.58,-16.27,-0.41,-23.86,-0.1,-31.28,-0.01,-36.6,-0.01,-36.84,0,-37.08,0,-40.96,0,-42.92,0,-44.62,0.65,-11.64,0.04,-23.83,-0.52,-35.5,-0.64,-41.66,-0.33,-38.91,-0.03,-36.16,0,-39.97,0,-42.42,0,-44.63]},{"value":[-71.02,-20.56,-53.42,-23.73,-39.38,-27.65,-25.93,-30.05,-15.68,-37.8,-4.31,-43.87,3.8,-45.45,10.38,-45.12,17,-44.57,-43.41,-25.57,-29.37,-30.13,-17.27,-35.09,-6.62,-38.76,0.98,-46.83,9.26,-54.28,14.65,-55.98,18.41,-51.14,22.55,-45.81,-16.83,-30.75,-6.53,-36.63,3.32,-42.61,11.16,-47.36,16.33,-55.5,21.76,-64.04,24.61,-65.8,25.87,-56.85,27.68,-46.96,-3.51,-32.79,3.04,-39.52,9.93,-46.17,15.2,-51.49,20.02,-58.07,24.85,-65.62,26.49,-67.45,27.47,-57.88,28.48,-47.14,5.33,-26.18,9.23,-30.23,13.13,-34.28,16.1,-39.25,18.58,-45.49,21.05,-52.3,21.95,-55.48,22.45,-51.1,23,-45.93,14.16,-21.98,15.43,-22.36,16.33,-23.01,17,-26.96,17.13,-32.92,17.26,-39.02,17.41,-43.57,17.44,-44.36,17.51,-44.72,15.28,-20.55,16.15,-23.54,17.2,-26.7,17.47,-31.18,17.24,-34.53,17.01,-37.88,16.99,-41.88,17,-43.4,17,-44.61,16.42,-16.27,16.59,-23.86,16.9,-31.28,16.99,-36.6,16.99,-36.84,17,-37.08,17,-40.96,17,-42.92,17,-44.62,17.65,-11.64,17.04,-23.83,16.48,-35.5,16.36,-41.66,16.67,-38.91,16.97,-36.16,17,-39.97,17,-42.42,17,-44.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_01","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-29.73,-29.49,-29.73,-34.68,-29.73,-39.7,-29.77,-42.74,-30.22,-41.5,-30.67,-40.26,-30.59,-40.89,-30.15,-36.5,-29.67,-31.51,-28.56,-23.29,-28.4,-27.21,-28.27,-30.84,-28.57,-33.01,-29.58,-36.81,-30.6,-40.62,-30.58,-41.71,-30.14,-36.92,-29.67,-31.51,-27.45,-17.02,-27.14,-19.86,-26.9,-22.3,-27.45,-23.67,-28.99,-32.23,-30.53,-40.79,-30.56,-42.33,-30.14,-37.24,-29.67,-31.51,-27.06,-12.44,-26.8,-15.42,-26.62,-17.99,-27.27,-19.36,-28.87,-29.55,-30.47,-39.75,-30.52,-41.41,-30.1,-36.76,-29.67,-31.51,-27.67,-11.82,-27.8,-15.1,-27.98,-18.11,-28.41,-20.28,-29.25,-28.33,-30.09,-36.39,-30.11,-38.22,-29.9,-35.11,-29.67,-31.51,-28.28,-11.21,-28.81,-14.77,-29.34,-18.24,-29.56,-21.21,-29.63,-27.11,-29.7,-33.02,-29.71,-35.05,-29.7,-33.47,-29.67,-31.51,-28.62,-11.3,-28.96,-14.97,-29.4,-18.56,-29.53,-21.92,-29.59,-26.67,-29.66,-31.42,-29.67,-33.51,-29.67,-32.64,-29.67,-31.51,-29.77,-11.87,-29.34,-16.05,-29.02,-20.12,-28.98,-23.3,-29.31,-25.39,-29.64,-27.47,-29.67,-29.76,-29.67,-30.7,-29.67,-31.51,-31,-12.49,-29.77,-17.22,-28.62,-21.81,-28.39,-24.78,-29,-24,-29.61,-23.22,-29.67,-25.76,-29.67,-28.63,-29.67,-31.51]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-8.51,0,-14.17,0,-19.61,0,-23.06,0,-25.02,0,-26.99,0,-29.34,0,-30.51,0,-31.53,0,-8.51,0,-12.93,0,-17.22,-0.02,-20.83,-0.23,-26.87,-0.44,-32.91,-0.41,-34.96,-0.2,-33.41,0,-31.53,0,-8.51,0,-11.77,0,-14.97,-0.04,-18.76,-0.45,-28.58,-0.85,-38.41,-0.79,-40.21,-0.39,-36.13,0,-31.53,0.06,-8.63,0.01,-11.54,0,-14.45,-0.04,-18.17,-0.48,-28.94,-0.92,-39.7,-0.85,-41.43,-0.43,-36.78,0,-31.53,0.67,-9.84,0.36,-13.03,0.07,-16.19,-0.02,-19.66,-0.25,-28.02,-0.48,-36.38,-0.45,-38.25,-0.23,-35.14,0,-31.53,1.28,-11.06,0.7,-14.52,0.14,-17.94,0,-21.16,-0.02,-27.11,-0.04,-33.05,-0.04,-35.07,-0.03,-33.49,0,-31.53,1.04,-11.32,0.71,-14.99,0.27,-18.58,0.14,-21.94,0.07,-26.69,0.01,-31.45,0,-33.53,0,-32.67,0,-31.53,-0.1,-11.89,0.33,-16.08,0.64,-20.14,0.69,-23.33,0.36,-25.41,0.03,-27.5,0,-29.78,0,-30.73,0,-31.53,-1.33,-12.51,-0.1,-17.24,1.04,-21.83,1.28,-24.8,0.67,-24.02,0.06,-23.24,0,-25.78,0,-28.66,0,-31.53]},{"value":[15,6.49,15.93,0.37,16.78,-5.5,17,-9.14,17,-12.02,17,-14.9,17,-18.65,17,-24.95,17,-31.53,16.19,0.86,16.72,-3.52,17.16,-7.74,17.23,-11.52,16.9,-18.84,16.57,-26.15,16.59,-29.06,16.8,-30.33,17,-31.53,17.2,-4.76,17.35,-7.61,17.41,-10.39,17.37,-14.32,16.77,-25.48,16.17,-36.63,16.21,-38.83,16.6,-35.39,17,-31.53,17.06,-8.63,17.01,-11.54,17,-14.45,16.96,-18.17,16.52,-28.94,16.08,-39.7,16.15,-41.43,16.57,-36.78,17,-31.53,17.67,-9.84,17.36,-13.03,17.07,-16.19,16.98,-19.66,16.75,-28.02,16.52,-36.38,16.55,-38.25,16.77,-35.14,17,-31.53,18.28,-11.06,17.7,-14.52,17.14,-17.94,17,-21.16,16.98,-27.11,16.96,-33.05,16.96,-35.07,16.97,-33.49,17,-31.53,18.04,-11.32,17.71,-14.99,17.27,-18.58,17.14,-21.94,17.07,-26.69,17.01,-31.45,17,-33.53,17,-32.67,17,-31.53,16.9,-11.89,17.33,-16.08,17.64,-20.14,17.69,-23.33,17.36,-25.41,17.03,-27.5,17,-29.78,17,-30.73,17,-31.53,15.67,-12.51,16.9,-17.24,18.04,-21.83,18.28,-24.8,17.67,-24.02,17.06,-23.24,17,-25.78,17,-28.66,17,-31.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_02","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-29.73,-20.98,-29.73,-20.51,-29.73,-20.09,-29.77,-19.68,-30.22,-16.48,-30.67,-13.28,-30.59,-11.55,-30.15,-5.99,-29.67,0.02,-28.56,-14.78,-28.4,-14.27,-28.27,-13.61,-28.55,-12.18,-29.35,-9.94,-30.15,-7.7,-30.17,-6.74,-29.94,-3.5,-29.67,0.02,-27.45,-8.51,-27.14,-8.08,-26.9,-7.3,-27.41,-4.92,-28.54,-3.64,-29.68,-2.37,-29.78,-2.13,-29.74,-1.11,-29.67,0.02,-27.12,-3.81,-26.81,-3.88,-26.63,-3.54,-27.23,-1.19,-28.39,-0.62,-29.56,-0.04,-29.67,0.02,-29.67,0.02,-29.67,0.02,-28.34,-1.98,-28.16,-2.07,-28.05,-1.92,-28.39,-0.62,-29,-0.31,-29.61,-0.01,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.55,-0.15,-29.51,-0.25,-29.48,-0.3,-29.56,-0.04,-29.61,-0.01,-29.66,0.03,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[15,15,15.93,14.54,16.78,14.11,17,13.91,17,13,17,12.09,17,10.69,17,5.55,17,0,16.19,9.37,16.71,9.41,17.16,9.48,17.25,9.33,17.13,8.04,17.01,6.74,17,5.9,17,3.09,17,0,17.2,3.75,17.35,4.16,17.41,4.58,17.4,4.5,17.21,3.11,17.02,1.72,17,1.42,17,0.76,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_03","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-13.86,0.08,-7.53,11.72,-1.33,23.13,2.78,33.77,4.09,50,4.56,64.54,3.72,72.52,0.37,82.31,-3.26,92.37,-13.74,5.51,-10.15,17.56,-6.96,29.46,-4.69,39.72,-3.58,54.2,-2.99,67.64,-3.51,75.17,-5.73,83.82,-8.2,92.64,-13.62,10.8,-12.6,23.21,-12.13,35.46,-11.61,45.37,-10.72,58.23,-10.04,70.66,-10.27,77.78,-11.41,85.29,-12.76,92.89,-13.52,13.89,-13.39,25.95,-13.33,37.82,-13.54,47.4,-12.97,59.28,-12.41,71.17,-12.53,78.29,-13.21,85.48,-13.9,92.73,-13.8,17.02,-13.84,26.79,-14,36.45,-14.18,44.76,-13.88,55.03,-13.59,65.31,-13.57,72.74,-13.59,81.38,-13.72,90.18,-14.5,21.41,-14.58,28.42,-14.73,35.39,-14.81,42.22,-14.79,51.21,-14.78,60.2,-14.67,67.72,-14.27,77.34,-13.95,87.2,-14.85,22.67,-14.86,29.06,-14.86,35.44,-14.87,42.05,-14.88,50.87,-14.89,59.69,-14.83,67.1,-14.58,76.99,-14.33,87.18,-14.85,22.69,-14.86,29.07,-14.86,35.46,-14.87,42.07,-14.88,50.89,-14.89,59.71,-14.86,67.38,-14.74,78.13,-14.62,89.26,-14.85,22.71,-14.86,29.09,-14.86,35.47,-14.87,42.08,-14.88,50.9,-14.88,59.72,-14.89,67.69,-14.91,79.38,-14.93,91.5]},{"duration":60,"tweenEasing":0,"value":[1,10.57,7.8,26.61,14.42,42.08,18.62,53.18,19.7,63.24,19.93,71.61,19.02,78.3,15.44,85.3,11.57,92.36,0.54,12.9,4.39,27.55,7.88,41.75,10.35,51.71,11.5,62.26,12.13,71.76,11.58,78.55,9.24,85.57,6.63,92.63,0.11,15.05,1.17,28.34,1.78,41.21,2.61,50.09,3.82,61.23,4.82,71.94,4.62,78.85,3.46,85.85,2.07,92.88,0.04,15.79,0.01,27.9,-0.02,39.6,0.07,47.99,1.26,59.7,2.45,71.4,2.38,78.49,1.67,85.58,0.93,92.72,0.37,18.01,0.24,27.83,0.03,37.41,0.06,45.22,1.05,56.32,2.05,67.41,2.03,74.63,1.59,82.35,1.12,90.16,0.27,21.49,0.17,28.54,0.01,35.54,0.02,42.45,0.63,52.93,1.24,63.42,1.26,70.67,1.09,78.86,0.88,87.18,-0.02,22.66,-0.02,29.05,-0.03,35.43,0,42.19,0.4,52.2,0.8,62.21,0.79,69.41,0.65,78.18,0.51,87.17,-0.02,22.68,-0.02,29.06,-0.03,35.44,-0.02,42.14,0.19,51.57,0.39,61.01,0.38,68.57,0.3,78.74,0.22,89.24,-0.02,22.7,-0.02,29.08,-0.03,35.46,-0.04,42.07,-0.04,50.89,-0.05,59.71,-0.06,67.68,-0.08,79.37,-0.09,91.49]},{"value":[8.5,18.07,15.3,29.25,21.92,40.23,26.17,50.56,27.7,64.74,28.39,77.22,27.52,83.64,23.94,88.08,20.07,92.36,8.63,17.59,12.4,29.4,15.75,41,18.21,50.48,19.66,63.18,20.6,74.85,20.08,81.49,17.75,87.11,15.13,92.63,8.71,16.93,9.64,29.33,10.03,41.4,10.8,50.09,12.16,61.6,13.31,72.69,13.12,79.55,11.96,86.23,10.57,92.88,8.54,15.79,8.51,27.9,8.48,39.6,8.57,48,9.72,59.59,10.87,71.19,10.8,78.28,10.12,85.47,9.43,92.72,8.87,18.01,8.74,27.83,8.53,37.41,8.52,45.07,9.12,55.19,9.71,65.31,9.77,72.73,9.74,81.37,9.62,90.16,8.77,21.49,8.67,28.54,8.51,35.54,8.47,42.24,8.51,51.21,8.55,60.18,8.67,67.71,9.07,77.33,9.38,87.18,8.48,22.66,8.48,29.05,8.47,35.43,8.46,42.04,8.45,50.86,8.45,59.68,8.51,67.09,8.76,76.98,9.01,87.17,8.48,22.68,8.48,29.06,8.47,35.44,8.46,42.06,8.45,50.88,8.45,59.7,8.47,67.37,8.6,78.12,8.72,89.24,8.48,22.7,8.48,29.08,8.47,35.46,8.46,42.07,8.46,50.89,8.45,59.71,8.44,67.68,8.42,79.37,8.41,91.49]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_04","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-27.72,0.16,-14.13,32.7,-0.88,64.08,7.47,86.68,9.18,110,9.2,129.94,7.44,145.05,0.73,164.62,-6.52,184.74,-27.49,11.02,-19.62,40.81,-12.52,69.94,-7.85,91.24,-6.35,114.57,-5.9,135.8,-7.02,150.34,-11.46,167.64,-16.4,185.28,-27.24,21.59,-24.79,48.61,-23.34,75.18,-22.2,95.28,-20.91,118.81,-20.03,141.51,-20.54,155.56,-22.83,170.59,-25.52,185.78,-27.05,27.78,-26.78,51.92,-26.66,75.66,-27.08,94.79,-25.86,118.78,-24.65,142.76,-24.91,157,-26.33,171.18,-27.8,185.47,-27.6,34.04,-27.68,53.59,-27.99,72.91,-28.28,89.83,-26.89,112.32,-25.51,134.81,-25.61,149.28,-26.49,164.72,-27.43,180.35,-29.01,42.82,-29.16,56.83,-29.45,70.79,-29.52,84.86,-28.34,105.86,-27.17,126.86,-27.15,141.36,-27.49,157.73,-27.91,174.39,-29.7,45.35,-29.71,58.11,-29.73,70.88,-29.67,84.39,-28.87,104.42,-28.07,124.44,-28.08,138.86,-28.37,156.38,-28.66,174.36,-29.7,45.38,-29.71,58.15,-29.73,70.91,-29.7,84.29,-29.29,103.16,-28.89,122.04,-28.9,137.17,-29.07,157.51,-29.23,178.51,-29.7,45.41,-29.71,58.18,-29.73,70.94,-29.74,84.17,-29.76,101.81,-29.77,119.45,-29.79,135.39,-29.82,158.76,-29.86,183]},{"duration":60,"tweenEasing":0,"value":[2.01,21.14,15.6,53.22,28.85,84.17,37.24,106.36,39.4,126.47,39.87,143.22,38.04,156.6,30.88,170.61,23.14,184.72,1.07,25.8,8.77,55.07,15.76,83.52,20.7,103.41,23,124.5,24.25,143.5,23.16,157.08,18.49,171.15,13.27,185.26,0.21,30.11,2.34,56.67,3.57,82.43,5.21,100.2,7.64,122.45,9.64,143.87,9.24,157.69,6.92,171.7,4.14,185.76,0.07,31.59,0.02,55.81,-0.05,79.22,0.15,95.99,2.53,119.39,4.9,142.8,4.75,156.98,3.34,171.16,1.86,185.44,0.73,36.01,0.47,55.66,0.06,74.84,0.11,90.45,2.11,112.63,4.1,134.82,4.06,149.26,3.18,164.7,2.23,180.33,0.54,42.97,0.35,57.09,0.03,71.09,0.04,84.9,1.27,105.87,2.49,126.83,2.51,141.34,2.18,157.71,1.76,174.37,-0.03,45.33,-0.05,58.09,-0.06,70.86,0,84.37,0.8,104.39,1.6,124.42,1.59,138.84,1.3,156.36,1.01,174.33,-0.03,45.36,-0.05,58.12,-0.06,70.89,-0.04,84.27,0.37,103.14,0.78,122.01,0.77,137.15,0.6,157.49,0.43,178.49,-0.03,45.39,-0.05,58.16,-0.06,70.92,-0.08,84.14,-0.09,101.79,-0.1,119.43,-0.12,135.36,-0.15,158.74,-0.19,182.98]},{"value":[17.01,36.14,32.76,64.67,48.01,92.34,57.14,113.77,61.73,134.81,64.64,152.47,62.16,164.91,51.59,174.93,40.14,184.72,17.26,35.17,27.2,62.8,36.86,89.76,42.52,109.22,44.56,130,45.57,148.73,44.02,161.62,37.59,173.57,30.27,185.26,17.41,33.86,21.49,60.44,25.52,86.3,27.77,103.96,27.95,125.03,27.73,145.29,27.08,158.75,24.5,172.31,21.14,185.76,17.07,31.59,17.02,55.81,16.95,79.22,17.15,95.99,19.53,119.39,21.9,142.8,21.75,156.98,20.34,171.16,18.86,185.44,17.73,36.01,17.47,55.66,17.06,74.84,17.11,90.45,19.11,112.63,21.1,134.82,21.06,149.26,20.18,164.7,19.23,180.33,17.54,42.97,17.35,57.09,17.03,71.09,17.04,84.9,18.27,105.87,19.49,126.83,19.51,141.34,19.18,157.71,18.76,174.37,16.97,45.33,16.95,58.09,16.94,70.86,17,84.37,17.8,104.39,18.6,124.42,18.59,138.84,18.3,156.36,18.01,174.33,16.97,45.36,16.95,58.12,16.94,70.89,16.96,84.27,17.37,103.14,17.78,122.01,17.77,137.15,17.6,157.49,17.43,178.49,16.97,45.39,16.95,58.16,16.94,70.92,16.92,84.14,16.91,101.79,16.9,119.43,16.88,135.36,16.85,158.74,16.81,182.98]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04","timeline":[{"name":"B_HAIR_SIDE.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_SIDE.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_SIDE.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_SIDE.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_00","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-17.62,-132.27,-14.8,-117.22,-12.19,-102.69,-11.59,-90.39,-12.23,-73.75,-12.86,-59.65,-12.56,-49.54,-11.13,-35.9,-9.59,-21.81,-17.08,-128.88,-15.22,-118.27,-14.19,-108.23,-14.01,-97.45,-14.22,-77.84,-14.43,-59.83,-14.29,-49.52,-13.69,-36.96,-13.06,-24.06,-16.88,-125.24,-15.87,-118.95,-16.2,-113.3,-16.38,-104.07,-16.2,-81.7,-16.02,-59.97,-16.06,-49.52,-16.29,-38.04,-16.57,-26.31,-18.99,-121.66,-18.06,-117.53,-18.28,-114.02,-18.59,-105.72,-20.15,-82.45,-21.72,-59.17,-21.45,-48.87,-20.17,-38.43,-19.76,-27.81,-19.76,-122.41,-19.69,-116.23,-20.57,-110.41,-21.1,-101.29,-23.37,-78.79,-25.63,-56.29,-25.13,-46.36,-22.79,-37.14,-21.59,-27.81,-22.23,-120.63,-22.47,-112.39,-23.14,-104.25,-23.37,-94.69,-23.63,-74.29,-23.89,-53.89,-23.83,-44.5,-23.55,-36.16,-23.43,-27.81,-25.24,-117.79,-25.24,-109.23,-25.24,-100.7,-25.29,-91.45,-25.78,-75.25,-26.28,-59.06,-26.19,-49.38,-25.75,-39.12,-25.48,-28.68,-27.08,-113.87,-27.09,-105.02,-27.09,-96.23,-27.16,-87.63,-27.89,-78.49,-28.63,-69.36,-28.61,-59.56,-28.34,-46.05,-28.17,-32.1,-28.93,-109.63,-28.93,-100.47,-28.93,-91.39,-29.02,-83.55,-29.93,-81.72,-30.84,-79.89,-30.93,-70.07,-30.93,-53.29,-30.93,-35.81]},{"duration":60,"tweenEasing":0,"value":[12.05,-132.3,14.87,-117.24,17.47,-102.71,18.11,-90.64,17.77,-76.44,17.44,-64.78,17.19,-54.97,16.34,-41.61,15.41,-27.83,12.59,-128.91,14.45,-118.29,15.48,-108.25,15.64,-97.61,15.16,-79.75,14.69,-63.5,14.54,-53.37,14.1,-40.78,13.58,-27.83,12.78,-125.26,13.8,-118.97,13.47,-113.32,13.21,-104.16,12.61,-82.9,12.02,-62.28,11.95,-51.87,11.88,-40.01,11.74,-27.83,10.68,-121.68,11.61,-117.55,11.38,-114.04,11.17,-105.89,10.57,-83.71,9.96,-61.53,9.91,-51.02,9.91,-39.55,9.91,-27.83,9.9,-122.43,9.98,-116.25,9.09,-110.43,8.75,-101.44,8.43,-79.69,8.1,-57.94,8.07,-47.85,8.07,-37.91,8.07,-27.83,7.44,-120.65,7.19,-112.41,6.53,-104.27,6.32,-94.71,6.28,-74.4,6.24,-54.08,6.24,-44.68,6.24,-36.27,6.24,-27.83,4.43,-117.81,4.43,-109.25,4.42,-100.72,4.38,-91.47,3.88,-75.28,3.39,-59.08,3.47,-49.4,3.92,-39.14,4.19,-28.7,2.58,-113.89,2.58,-105.04,2.58,-96.25,2.51,-87.65,1.77,-78.51,1.04,-69.38,1.05,-59.58,1.33,-46.07,1.5,-32.12,0.74,-109.65,0.74,-100.5,0.74,-91.41,0.65,-83.57,-0.26,-81.74,-1.18,-79.91,-1.26,-70.1,-1.26,-53.31,-1.26,-35.83]},{"value":[27.05,-132.3,29.87,-117.24,32.47,-102.71,33.11,-91.15,32.77,-82.44,32.44,-76.26,32.19,-65.66,31.34,-47.16,30.41,-27.83,27.59,-128.91,29.45,-118.29,30.48,-108.25,30.62,-97.92,29.97,-83.5,29.31,-70.69,29.17,-60.04,28.86,-44.25,28.58,-27.83,27.78,-125.26,28.8,-118.97,28.47,-113.32,28.17,-104.29,27.15,-84.4,26.12,-65.16,26.09,-54.54,26.37,-41.39,26.74,-27.83,25.68,-121.68,26.61,-117.55,26.38,-114.04,26.09,-105.89,24.61,-83.71,23.13,-61.53,23.21,-51.02,24.04,-39.55,24.91,-27.83,24.9,-122.43,24.98,-116.25,24.09,-110.43,23.7,-101.44,22.93,-79.69,22.15,-57.94,22.18,-47.85,22.61,-37.91,23.07,-27.83,22.44,-120.65,22.19,-112.41,21.53,-104.27,21.31,-94.71,21.24,-74.4,21.16,-54.08,21.16,-44.68,21.18,-36.27,21.24,-27.83,19.43,-117.81,19.43,-109.25,19.42,-100.72,19.38,-91.47,18.88,-75.28,18.39,-59.08,18.47,-49.4,18.92,-39.14,19.19,-28.7,17.58,-113.89,17.58,-105.04,17.58,-96.25,17.51,-87.65,16.77,-78.51,16.04,-69.38,16.05,-59.58,16.33,-46.07,16.5,-32.12,15.74,-109.65,15.74,-100.5,15.74,-91.41,15.65,-83.57,14.74,-81.74,13.82,-79.91,13.74,-70.1,13.74,-53.31,13.74,-35.83]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_01","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-23.64,-66.13,-22.23,-58.6,-20.93,-51.33,-20.66,-45.04,-21.28,-35.2,-21.9,-26.62,-21.96,-22.12,-21.96,-18.01,-21.96,-13.89,-23.37,-64.43,-22.44,-59.12,-21.93,-54.1,-21.87,-48.58,-22.35,-37.32,-22.83,-26.86,-22.88,-22.12,-22.88,-18.01,-22.88,-13.89,-23.27,-62.61,-22.76,-59.46,-22.93,-56.64,-23.07,-51.89,-23.41,-39.32,-23.76,-27.07,-23.8,-22.12,-23.8,-18.01,-23.8,-13.89,-24.33,-60.82,-23.86,-58.75,-23.97,-57,-24.08,-52.74,-24.38,-39.92,-24.68,-27.1,-24.71,-22.12,-24.71,-18.01,-24.71,-13.89,-24.71,-61.19,-24.68,-58.1,-25.12,-55.19,-25.29,-50.6,-25.45,-38.82,-25.61,-27.04,-25.63,-22.12,-25.63,-18.01,-25.63,-13.89,-25.95,-60.3,-26.07,-56.18,-26.4,-52.11,-26.51,-47.35,-26.53,-37.09,-26.55,-26.83,-26.55,-22.12,-26.55,-18.01,-26.55,-13.89,-27.45,-58.88,-27.45,-54.6,-27.45,-50.34,-27.48,-45.71,-27.73,-37.62,-27.97,-29.52,-27.93,-24.68,-27.71,-19.55,-27.57,-14.33,-28.38,-56.92,-28.38,-52.5,-28.38,-48.1,-28.41,-43.8,-28.78,-39.23,-29.15,-34.67,-29.14,-29.77,-29,-23.01,-28.92,-16.04,-29.3,-54.8,-29.3,-50.23,-29.3,-45.68,-29.34,-41.76,-29.8,-40.85,-30.26,-39.93,-30.3,-35.03,-30.3,-26.63,-30.3,-17.89]},{"duration":60,"tweenEasing":0,"value":[6.02,-66.15,7.43,-58.62,8.74,-51.36,9.05,-45.32,8.89,-38.22,8.72,-32.39,8.6,-27.49,8.17,-20.81,7.71,-13.91,6.3,-64.45,7.22,-59.14,7.74,-54.12,7.82,-48.8,7.58,-39.88,7.35,-31.76,7.27,-26.68,7.05,-20.39,6.79,-13.91,6.39,-62.63,6.9,-59.48,6.74,-56.66,6.61,-52.07,6.31,-41.45,6.01,-31.15,5.97,-25.94,5.94,-20,5.87,-13.91,5.34,-60.84,5.8,-58.78,5.69,-57.02,5.59,-52.94,5.28,-41.86,4.98,-30.77,4.95,-25.51,4.95,-19.77,4.95,-13.91,4.95,-61.22,4.99,-58.12,4.55,-55.21,4.37,-50.71,4.21,-39.84,4.05,-28.98,4.04,-23.92,4.04,-18.95,4.04,-13.91,3.72,-60.33,3.6,-56.2,3.27,-52.14,3.16,-47.35,3.14,-37.2,3.12,-27.04,3.12,-22.34,3.12,-18.14,3.12,-13.91,2.21,-58.91,2.21,-54.63,2.21,-50.36,2.19,-45.73,1.94,-37.64,1.69,-29.55,1.74,-24.7,1.96,-19.57,2.09,-14.35,1.29,-56.95,1.29,-52.52,1.29,-48.12,1.26,-43.82,0.89,-39.26,0.52,-34.69,0.53,-29.79,0.66,-23.04,0.75,-16.06,0.37,-54.83,0.37,-50.25,0.37,-45.71,0.33,-41.78,-0.13,-40.87,-0.59,-39.95,-0.63,-35.05,-0.63,-26.66,-0.63,-17.91]},{"value":[21.02,-66.15,22.43,-58.62,23.74,-51.36,24.01,-45.06,23.39,-35.22,22.76,-26.65,22.71,-22.14,22.71,-18.03,22.71,-13.91,21.3,-64.45,22.22,-59.14,22.74,-54.12,22.79,-48.6,22.31,-37.34,21.83,-26.88,21.79,-22.14,21.79,-18.03,21.79,-13.91,21.39,-62.63,21.9,-59.48,21.74,-56.66,21.6,-51.92,21.25,-39.34,20.9,-27.09,20.87,-22.14,20.87,-18.03,20.87,-13.91,20.34,-60.84,20.8,-58.78,20.69,-57.02,20.59,-52.76,20.28,-39.94,19.98,-27.13,19.95,-22.14,19.95,-18.03,19.95,-13.91,19.95,-61.22,19.99,-58.12,19.55,-55.21,19.37,-50.63,19.21,-38.84,19.05,-27.06,19.04,-22.14,19.04,-18.03,19.04,-13.91,18.72,-60.33,18.6,-56.2,18.27,-52.14,18.16,-47.37,18.14,-37.11,18.12,-26.86,18.12,-22.14,18.12,-18.03,18.12,-13.91,17.21,-58.91,17.21,-54.63,17.21,-50.36,17.19,-45.73,16.94,-37.64,16.69,-29.55,16.74,-24.7,16.96,-19.57,17.09,-14.35,16.29,-56.95,16.29,-52.52,16.29,-48.12,16.26,-43.82,15.89,-39.26,15.52,-34.69,15.53,-29.79,15.66,-23.04,15.75,-16.06,15.37,-54.83,15.37,-50.25,15.37,-45.71,15.33,-41.78,14.87,-40.87,14.41,-39.95,14.37,-35.05,14.37,-26.66,14.37,-17.91]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_02","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.55,0.54,-28.33,6.02,-27.11,11.51,-26.56,12.9,-24.85,16.32,-23,20.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.61,0.22,-28.95,3.24,-28.3,6.27,-27.96,7.35,-26.9,10.27,-25.73,13.41,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.65,-0.06,-29.52,0.68,-29.39,1.41,-29.27,2.13,-28.84,4.42,-28.38,6.83,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.33,-29.67,1.41,-29.67,2.57,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.17,-29.67,0.74,-29.67,1.36,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0,-29.67,0.06,-29.67,0.14,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_03","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-16.38,40.17,-16.37,36.62,-16.37,33.18,-16.29,30.92,-15.45,30.97,-14.61,31.01,-14.42,29.59,-13.99,29.43,-13.53,29.44,-15.68,42.1,-15.58,39.96,-15.47,37.83,-15.4,35.78,-14.95,34.56,-14.5,33.34,-14.45,31.4,-14.43,29.96,-14.32,28.59,-15.04,43.88,-14.84,43.16,-14.64,42.33,-14.58,40.5,-14.49,38.01,-14.39,35.51,-14.47,33.1,-14.79,30.44,-15,27.77,-14.87,44.33,-14.68,44.1,-14.47,43.73,-14.42,42.04,-14.42,38.86,-14.42,35.68,-14.54,33.08,-14.94,29.86,-15.27,26.57,-14.87,44.33,-14.91,42.04,-14.95,39.74,-14.96,37.45,-14.99,34.47,-15.03,31.5,-15.13,29.08,-15.46,26.35,-15.69,23.6,-14.87,44.32,-15.14,40.27,-15.42,36.35,-15.49,33.54,-15.56,30.48,-15.64,27.42,-15.63,25.29,-15.59,23.38,-15.55,21.48,-14.8,43.84,-15.02,39.7,-15.15,35.67,-15.21,32.62,-15.54,28.82,-15.86,25.02,-15.83,22.83,-15.61,20.98,-15.46,19.13,-14.52,41.99,-14.77,38.93,-14.96,35.93,-15.02,33.19,-15.22,28.82,-15.41,24.44,-15.39,22.07,-15.26,19.74,-15.17,17.39,-14.21,39.98,-14.52,38.14,-14.8,36.27,-14.87,33.95,-14.87,29.07,-14.87,24.19,-14.87,21.61,-14.86,18.76,-14.86,15.84]},{"duration":60,"tweenEasing":0,"value":[-1.54,40.16,-1.54,36.61,-1.54,33.17,-1.52,30.65,-1.29,27.95,-1.06,25.26,-1.14,23.14,-1.57,21.27,-2.03,19.43,-0.85,42.09,-0.74,39.95,-0.64,37.82,-0.6,35.68,-0.47,32.94,-0.35,30.2,-0.47,27.72,-0.98,24.82,-1.45,21.88,-0.21,43.87,-0.01,43.15,0.19,42.32,0.25,40.54,0.27,37.67,0.3,34.8,0.16,32.02,-0.37,28.23,-0.81,24.35,-0.04,44.32,0.16,44.09,0.36,43.72,0.41,42.03,0.41,38.85,0.41,35.66,0.3,32.91,-0.11,29.15,-0.44,25.28,-0.04,44.32,-0.08,42.03,-0.11,39.73,-0.12,37.44,-0.16,34.46,-0.2,31.49,-0.29,29,-0.63,25.98,-0.86,22.92,-0.04,44.31,-0.31,40.26,-0.58,36.33,-0.66,33.53,-0.73,30.47,-0.8,27.41,-0.8,25.29,-0.76,23.35,-0.72,21.41,0.03,43.83,-0.18,39.69,-0.32,35.66,-0.38,32.61,-0.7,28.81,-1.03,25.01,-0.99,22.82,-0.78,20.97,-0.62,19.12,0.32,41.98,0.07,38.92,-0.13,35.92,-0.19,33.18,-0.38,28.81,-0.58,24.43,-0.56,22.06,-0.43,19.73,-0.34,17.38,0.63,39.97,0.32,38.13,0.03,36.26,-0.04,33.94,-0.04,29.06,-0.03,24.18,-0.03,21.6,-0.03,18.75,-0.03,15.83]},{"value":[11.46,32.16,10.53,30.16,9.68,28.14,8.96,25.48,7.38,19.29,5.81,13.1,2.56,10.61,-0.94,8.07,-4.36,5.43,13.08,37.79,12.66,36.51,12.32,35.15,11.93,32.79,11.06,27.19,10.18,21.58,8.26,19.02,6.35,16.48,4.41,13.84,14.58,42.99,14.63,42.48,14.77,41.83,14.69,39.77,14.43,34.66,14.16,29.54,13.51,26.98,13.11,24.5,12.58,21.98,14.96,44.32,15.16,44.09,15.36,43.72,15.39,41.84,15.09,36.93,14.8,32.03,14.73,29.56,14.6,27.41,14.56,25.28,14.96,44.32,14.92,42.03,14.89,39.73,14.86,37.35,14.67,33.46,14.48,29.57,14.41,27.22,14.22,25.06,14.14,22.92,14.96,44.31,14.69,40.26,14.42,36.33,14.34,33.55,14.25,30.38,14.17,27.22,14.17,25.09,14.22,23.24,14.28,21.41,15.03,43.83,14.82,39.69,14.68,35.66,14.62,32.61,14.3,28.81,13.97,25.01,14.01,22.82,14.22,20.97,14.38,19.12,15.32,41.98,15.07,38.92,14.87,35.92,14.81,33.18,14.62,28.81,14.42,24.43,14.44,22.06,14.57,19.73,14.66,17.38,15.63,39.97,15.32,38.13,15.03,36.26,14.96,33.94,14.96,29.06,14.97,24.18,14.97,21.6,14.97,18.75,14.97,15.83]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_04","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32.75,80.35,-32.75,73.25,-32.74,66.36,-32.58,61.84,-30.9,61.93,-29.23,62.02,-28.85,59.18,-27.99,58.87,-27.06,58.88,-31.36,84.2,-31.16,79.93,-30.95,75.65,-30.8,71.57,-29.9,69.13,-29,66.69,-28.91,62.81,-28.86,59.92,-28.64,57.17,-30.08,87.76,-29.68,86.32,-29.28,84.66,-29.16,81.01,-28.97,76.02,-28.79,71.03,-28.95,66.19,-29.57,60.89,-30,55.54,-29.75,88.66,-29.36,88.21,-28.95,87.47,-28.84,84.09,-28.84,77.72,-28.85,71.35,-29.07,66.16,-29.89,59.71,-30.55,53.13,-29.75,88.65,-29.82,84.08,-29.89,79.48,-29.91,74.9,-29.99,68.95,-30.06,62.99,-30.26,58.17,-30.92,52.71,-31.39,47.2,-29.75,88.64,-30.28,80.56,-30.83,72.71,-30.99,67.08,-31.13,60.96,-31.27,54.84,-31.26,50.59,-31.19,46.76,-31.11,42.95,-29.6,87.69,-30.03,79.41,-30.31,71.36,-30.43,65.24,-31.07,57.64,-31.72,50.05,-31.66,45.66,-31.22,41.96,-30.91,38.26,-29.03,83.98,-29.53,77.87,-29.92,71.86,-30.04,66.38,-30.43,57.63,-30.82,48.89,-30.78,44.13,-30.52,39.48,-30.34,34.77,-28.42,79.96,-29.03,76.27,-29.6,72.55,-29.74,67.91,-29.74,58.14,-29.74,48.37,-29.73,43.23,-29.73,37.52,-29.73,31.69]},{"duration":60,"tweenEasing":0,"value":[-3.08,80.33,-3.08,73.23,-3.08,66.34,-3.03,61.3,-2.57,55.91,-2.11,50.51,-2.28,46.28,-3.14,42.55,-4.06,38.85,-1.69,84.18,-1.49,79.9,-1.28,75.63,-1.2,71.36,-0.95,65.88,-0.7,60.4,-0.95,55.44,-1.97,49.64,-2.91,43.77,-0.41,87.74,-0.02,86.3,0.38,84.64,0.5,81.08,0.55,75.34,0.6,69.59,0.32,64.02,-0.74,56.44,-1.62,48.71,-0.08,88.64,0.31,88.18,0.72,87.45,0.83,84.06,0.82,77.69,0.82,71.32,0.59,65.81,-0.22,58.29,-0.88,50.56,-0.08,88.63,-0.16,84.05,-0.22,79.46,-0.25,74.88,-0.32,68.92,-0.39,62.97,-0.59,57.99,-1.26,51.96,-1.72,45.84,-0.08,88.62,-0.62,80.54,-1.16,72.69,-1.32,67.06,-1.46,60.94,-1.6,54.82,-1.6,50.59,-1.52,46.69,-1.44,42.81,0.06,87.67,-0.36,79.39,-0.64,71.34,-0.76,65.21,-1.41,57.62,-2.05,50.03,-1.99,45.64,-1.56,41.93,-1.24,38.24,0.63,83.95,0.14,77.85,-0.25,71.84,-0.38,66.36,-0.76,57.61,-1.15,48.87,-1.11,44.11,-0.86,39.46,-0.68,34.75,1.25,79.94,0.64,76.25,0.07,72.52,-0.07,67.88,-0.07,58.12,-0.07,48.35,-0.07,43.2,-0.06,37.49,-0.06,31.66]},{"value":[7.92,64.33,6.07,60.31,4.36,56.28,2.91,50.96,-0.24,38.57,-3.39,26.19,-9.89,21.22,-16.89,16.13,-23.73,10.85,11.16,75.59,10.32,73.01,9.64,70.31,8.86,65.58,7.11,54.37,5.37,43.16,1.55,37.99,-2.3,32.97,-6.18,27.67,14.15,85.99,14.26,84.95,14.53,83.65,14.38,79.56,13.85,69.32,13.32,59.07,12.03,53.92,11.22,49.02,10.15,43.96,14.92,88.64,15.31,88.18,15.72,87.45,15.77,83.68,15.19,73.87,14.6,64.05,14.46,59.11,14.21,54.82,14.12,50.56,14.92,88.63,14.84,84.05,14.78,79.46,14.73,74.72,14.35,66.92,13.97,59.13,13.82,54.44,13.44,50.12,13.28,45.84,14.92,88.62,14.38,80.54,13.84,72.69,13.68,67.1,13.51,60.76,13.34,54.43,13.35,50.19,13.44,46.48,13.56,42.81,15.06,87.67,14.64,79.39,14.36,71.34,14.24,65.21,13.59,57.62,12.95,50.03,13.01,45.64,13.44,41.93,13.76,38.24,15.63,83.95,15.14,77.85,14.75,71.84,14.62,66.36,14.24,57.61,13.85,48.87,13.89,44.11,14.14,39.46,14.32,34.75,16.25,79.94,15.64,76.25,15.07,72.52,14.93,67.88,14.93,58.12,14.93,48.35,14.93,43.2,14.94,37.49,14.94,31.66]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00","timeline":[{"name":"D_HAIR_SIDE.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_SIDE.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_SIDE.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_SIDE.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_SIDE.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_00","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":490}]},{"name":"D_HAIR_SIDE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-31.64,-0.58,-73.13,0.72,-41.53,2.62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-12.8,1.19,0,0,0,0,0,0,-40.41,0.45,0,0,-56.65,-1.3,0,0,-23.71,0.24,0.32,1.39,-10.65,0.67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-18.49,0.68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-22.13,1.4,-20.65,1.31,-32.08,0.32,-18.43,0.21]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_01","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]},{"name":"D_HAIR_SIDE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-21.96,0.09,-40.01,0.14,-8.03,0.69,0,0,0,0,0,0,0,0,0,0,2.38,-0.69,0,0,-9.67,-0.68,0,0,0,0,-5.85,0.01,-4.85,0,-14.62,1.38,0,0,0,0,0,0,-26.69,0.76,0,0,-32.67,0.83,-2.45,0.69,-29.85,0.79,-12.07,-1.32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-4.28,0.37,-6.93,0.35,-20.83,0.07,-15.35,0.35,0,0,-2.79,0.01,-2.76,0.01,-1.27,-0.38]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_02","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_03","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_04","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04","timeline":[{"name":"B_HAIR_TWIN.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_00","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[14.67,-77.09,16.52,-69.47,18.23,-62.14,18.58,-55.54,17.65,-32.43,16.72,-9.32,17.07,-6.23,18.8,-12.58,20.67,-19.78,-2.91,-77.09,-2.27,-70.18,-1.8,-63.5,-1.48,-57.73,0.8,-40.7,3.07,-23.67,3.64,-19.07,5.08,-17.9,6.78,-17,-19.16,-77.09,-19.66,-70.84,-20.32,-64.78,-20.02,-59.77,-14.86,-48.77,-9.7,-37.76,-8.91,-31.77,-7.64,-23.26,-6.05,-14.43,-23.05,-77.43,-23.81,-72.08,-24.53,-66.71,-24.23,-61.64,-19.07,-54.05,-13.91,-46.45,-12.96,-40.58,-11.19,-27.35,-9.43,-13.24,-20.31,-81.09,-19.83,-80.69,-19.05,-79.75,-18.62,-75.06,-16.58,-65.31,-14.53,-55.55,-13.89,-48.17,-12.23,-28.29,-10.83,-6.95,-17.56,-84.75,-16.39,-93.01,-14.98,-100.21,-14.62,-97.71,-14.92,-83.27,-15.23,-68.84,-15.07,-57.84,-14.42,-28.99,-13.93,1.91,-21.33,-93.44,-19.5,-104.86,-16.62,-115.05,-16,-113.25,-18.37,-94.62,-20.33,-71.62,-19.71,-52.13,-18.57,-22.8,-17.46,7.69,-22.65,-104.37,-22.46,-116.72,-21.54,-127.77,-21.5,-125.94,-24.01,-102.22,-25.49,-67.5,-23.7,-37.72,-21.15,-13.9,-18.54,9.39,-23.33,-115.09,-25.19,-128.56,-26.9,-140.71,-27.58,-138.94,-29.8,-109.87,-30.34,-63.09,-27.34,-23.18,-23.41,-5.17,-19.33,10.67]},{"duration":60,"tweenEasing":0,"value":[-1.33,-63.07,-1.33,-59.16,-1.33,-55.24,-1.33,-49.87,-1.35,-30.41,-1.37,-10.96,-1.36,-9.3,-1.35,-19.93,-1.33,-31.76,-1.32,-68.62,-2.53,-63.76,-3.77,-58.96,-3.96,-53.69,-2.46,-38.68,-0.97,-23.67,-0.69,-19.64,-0.13,-20.82,0.52,-22.5,-1.31,-73.76,-3.67,-68.01,-6.04,-62.38,-6.39,-57.27,-3.58,-46.75,-0.76,-36.22,-0.21,-30.11,0.92,-22.14,2.23,-13.94,-1.48,-75.41,-3.97,-70.06,-6.36,-64.69,-6.74,-59.62,-4.2,-52.03,-1.66,-44.43,-0.96,-38.56,0.81,-25.33,2.57,-11.22,-3.31,-79.07,-3.77,-78.68,-3.83,-77.72,-3.75,-73.03,-3.08,-63.28,-2.41,-53.54,-1.89,-46.15,-0.23,-26.27,1.17,-4.93,-5.13,-82.73,-4.09,-90.98,-2.72,-98.19,-2.37,-95.69,-2.79,-81.25,-3.22,-66.82,-3.07,-55.81,-2.42,-26.97,-1.93,3.93,-9.33,-91.42,-7.5,-102.84,-4.62,-113.03,-4,-111.23,-6.37,-92.6,-8.33,-69.6,-7.71,-50.11,-6.57,-20.78,-5.46,9.71,-10.65,-102.35,-10.46,-114.7,-9.54,-125.75,-9.5,-123.92,-12.01,-100.2,-13.49,-65.48,-11.7,-35.7,-9.15,-11.88,-6.54,11.41,-11.33,-113.07,-13.18,-126.54,-14.9,-138.69,-15.58,-136.92,-17.8,-107.85,-18.34,-61.07,-15.34,-21.16,-11.41,-3.15,-7.33,12.69]},{"value":[-28.88,-65.04,-25.18,-64.83,-21.76,-64.34,-18.9,-61.21,-15.65,-56.39,-14.93,-51.56,-13.63,-50.81,-12.22,-55.99,-10.88,-61.73,-7.58,-67.82,-2.23,-65.2,3.41,-62.5,7.11,-58.65,10.38,-54.83,10.19,-50.37,10.1,-48.33,9.56,-50.56,9.08,-53.12,12.11,-70.39,18.72,-65.44,25.94,-60.61,30.29,-56.08,33.39,-53.17,32.08,-48.99,30.65,-45.4,28.33,-44.38,26.15,-43.45,16.45,-71.56,21.17,-66.72,24.92,-61.82,27.97,-56.87,29.88,-53.09,27.4,-47.85,25.33,-42.66,22.24,-36.71,18.97,-30.45,9.15,-77.05,16.93,-77.82,25.92,-78.12,29.52,-73.68,29.78,-66.36,27.56,-58.22,26,-51.59,22.8,-37.24,18.87,-21.9,1.84,-82.53,9.66,-92.35,19.08,-101.17,22.01,-98.99,22.49,-85.95,22.34,-72.7,21.07,-62.56,16.56,-37.53,11.17,-10.79,-1.57,-91.39,3.84,-104.66,10.07,-116.6,11.82,-115.11,12.45,-96.75,13.5,-74,12.59,-55.74,6.78,-29.64,0.74,-2.52,2.25,-102.32,5.63,-116.52,9.52,-129.31,10.73,-127.88,12.48,-104.68,15.28,-70.44,15.67,-41.03,11.24,-17.28,6.51,6.03,7.12,-113.04,8.04,-128.36,8.9,-142.22,9.39,-140.98,12.65,-112.82,17.6,-66.95,19.36,-26.26,16.45,-4.83,13.12,14.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_01","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[15.33,-43.56,17.19,-37.9,18.9,-32.52,19.25,-28.61,18.32,-15.23,17.4,-1.84,17.76,0.42,19.47,-0.62,21.33,-1.9,-2.25,-40.78,-1.01,-36.3,0.09,-32.02,0.5,-28.89,2.03,-19.36,3.56,-9.83,3.99,-7.24,5.15,-5.48,6.52,-3.75,-18.5,-38.21,-17.83,-34.84,-17.3,-31.59,-16.82,-29.14,-13.07,-23.39,-9.32,-17.65,-8.8,-14.71,-8.1,-10.19,-7.17,-5.46,-22.31,-37.73,-21.82,-35.05,-21.35,-32.37,-20.86,-29.83,-16.97,-26.03,-13.08,-22.24,-12.48,-19.32,-11.6,-12.7,-10.71,-5.63,-18.65,-39.56,-17.95,-39.34,-17.13,-38.86,-16.75,-36.55,-15.04,-31.66,-13.33,-26.78,-12.94,-23.13,-12.12,-13.17,-11.42,-2.49,-14.99,-41.39,-14.35,-45.5,-13.62,-49.09,-13.43,-47.87,-13.53,-40.65,-13.62,-33.42,-13.54,-27.93,-13.21,-13.51,-12.96,1.95,-16.67,-45.73,-15.75,-51.43,-14.31,-56.51,-14,-55.65,-15.19,-46.33,-16.17,-34.82,-15.85,-25.06,-15.29,-10.4,-14.73,4.83,-17.32,-51.2,-17.23,-57.36,-16.77,-62.89,-16.75,-61.99,-18.01,-50.13,-18.74,-32.76,-17.85,-17.87,-16.57,-5.97,-15.27,5.68,-17.67,-56.56,-18.59,-63.29,-19.45,-69.36,-19.79,-68.48,-20.9,-53.95,-21.17,-30.55,-19.67,-10.6,-17.7,-1.6,-15.67,6.33]},{"duration":60,"tweenEasing":0,"value":[-0.67,-29.98,-0.67,-28.02,-0.67,-26.06,-0.67,-23.37,-0.68,-13.65,-0.68,-3.92,-0.68,-3.09,-0.67,-8.41,-0.67,-14.32,-0.66,-32.75,-1.27,-30.32,-1.89,-27.92,-1.98,-25.29,-1.23,-17.78,-0.48,-10.28,-0.34,-8.27,-0.07,-8.86,0.26,-9.69,-0.66,-35.32,-1.83,-32.45,-3.02,-29.63,-3.2,-27.07,-1.79,-21.81,-0.38,-16.55,-0.11,-13.49,0.46,-9.51,1.11,-5.41,-0.74,-36.15,-1.98,-33.47,-3.18,-30.79,-3.37,-28.25,-2.1,-24.45,-0.83,-20.65,-0.48,-17.74,0.4,-11.12,1.29,-4.05,-1.65,-37.98,-1.88,-37.76,-1.91,-37.28,-1.88,-34.96,-1.54,-30.08,-1.2,-25.2,-0.94,-21.55,-0.12,-11.59,0.58,-0.91,-2.56,-39.81,-2.05,-43.92,-1.36,-47.51,-1.18,-46.29,-1.4,-39.07,-1.61,-31.84,-1.54,-26.35,-1.21,-11.93,-0.96,3.53,-4.67,-44.15,-3.75,-49.85,-2.31,-54.93,-2,-54.07,-3.19,-44.75,-4.17,-33.24,-3.85,-23.48,-3.29,-8.82,-2.73,6.41,-5.32,-49.62,-5.23,-55.78,-4.77,-61.31,-4.75,-60.41,-6.01,-48.55,-6.74,-31.18,-5.85,-16.29,-4.57,-4.39,-3.27,7.26,-5.67,-54.98,-6.59,-61.71,-7.45,-67.78,-7.79,-66.9,-8.9,-52.37,-9.17,-28.97,-7.67,-9.02,-5.7,-0.02,-3.67,7.91]},{"value":[-27.31,-29.39,-25.46,-29.75,-23.75,-29.93,-22.36,-28.78,-21.19,-29.56,-21.29,-30.35,-22.08,-30.38,-23.19,-33.4,-24.31,-36.73,-6.94,-30.31,-3.86,-28.85,-0.63,-27.34,1.2,-25.72,1.35,-27.09,-0.53,-28.15,-1.93,-27.55,-3.8,-28.9,-5.74,-30.44,11.89,-31.17,15.98,-27.96,20.38,-24.85,22.54,-22.76,21.69,-24.57,18.01,-25.76,16.01,-24.37,13.41,-23.92,10.66,-23.51,16.18,-31.65,18.97,-28.61,20.97,-25.59,22.3,-23.22,20.85,-23.75,16.46,-23.54,14.13,-21.11,10.64,-18,7.06,-14.72,10.7,-34.39,16.11,-34.9,22.82,-35.19,25.12,-33.2,23.51,-30.99,20.23,-28.37,18.68,-25.07,15.95,-17.46,12.69,-9.32,5.22,-37.13,10.55,-42.76,17.55,-47.85,19.65,-47.04,19.35,-41.18,18.62,-35.21,17.75,-30.02,15.01,-16.79,11.56,-2.64,2.8,-41.56,5.5,-48.98,8.62,-55.68,9.55,-55.17,10.39,-45.95,11.45,-34.52,10.69,-25.31,6.46,-11.94,2.17,1.98,2.57,-47.03,4.26,-54.53,6.2,-61.3,6.9,-60.67,8.75,-48.58,11.13,-30.95,11.06,-16.27,7.49,-4.67,3.77,6.68,2.69,-52.39,3.15,-60.05,3.58,-66.98,3.95,-66.27,6.95,-51.28,10.8,-27.43,11.48,-7.22,8.74,2.64,5.69,11.49]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_02","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[16,-12.02,17.85,-8.32,19.56,-4.9,19.91,-3.68,19,-0.02,18.09,3.64,18.44,5.07,20.15,9.35,22,13.98,-1.59,-6.47,0.26,-4.42,1.97,-2.54,2.48,-2.04,3.26,-0.02,4.04,2,4.33,2.59,5.22,4.94,6.26,7.5,-17.84,-1.33,-16,-0.83,-14.28,-0.4,-13.62,-0.51,-11.28,-0.02,-8.94,0.47,-8.7,0.34,-8.57,0.88,-8.28,1.51,-21.57,-0.02,-19.85,-0.02,-18.18,-0.02,-17.5,-0.02,-14.87,-0.02,-12.25,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-17,-0.02,-16.07,-0.02,-15.22,-0.02,-14.87,-0.02,-13.5,-0.02,-12.13,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12.43,-0.02,-12.3,-0.02,-12.26,-0.02,-12.25,-0.02,-12.13,-0.02,-12.01,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-45.33,-1.97,-45.33,-2.9,-45.33,-3.75,-45.59,-4.49,-48.33,-9.97,-51.08,-15.46,-53.68,-16.41,-55.61,-18.12,-57.33,-19.97,-25.89,-1.05,-25.09,-0.73,-24.26,-0.43,-24.4,-0.99,-28.33,-7.06,-32.9,-13.13,-35.48,-14.04,-37.79,-14.97,-40.14,-16,-7.93,-0.19,-6.36,1.28,-4.78,2.67,-4.81,2.31,-9.82,-4.11,-16.08,-10.54,-18.64,-11.35,-21.39,-11.56,-24.43,-11.82,-3.68,0.03,-2.81,1.26,-2.57,2.39,-2.97,2.19,-7.78,-2.64,-14.07,-7.46,-16.66,-7.79,-20.55,-7.52,-24.44,-7.22,-7.33,0.03,-4.27,-0.24,0.14,-0.55,1.11,-0.93,-2.37,-3.85,-6.7,-6.76,-8.23,-6.76,-10.49,-5.9,-13.08,-4.97,-10.99,0.03,-8.14,-1.44,-3.55,-2.85,-2.3,-3.31,-3.39,-4.64,-4.69,-5.97,-5.16,-5.72,-6.13,-4.28,-7.63,-2.72,-12.43,0.03,-12.43,-1.57,-12.43,-3.07,-12.33,-3.45,-11.26,-3.36,-10.18,-3.28,-10.8,-3.11,-13.46,-2.47,-15.99,-1.75,-16.7,0.03,-16.7,-0.8,-16.7,-1.57,-16.52,-1.68,-14.57,-0.69,-12.61,0.31,-13.14,0.26,-15.85,-0.31,-18.56,-0.9,-21.33,0.03,-21.33,0.03,-21.33,0.03,-21.08,0.2,-18.33,2.03,-15.59,3.86,-15.99,3.59,-18.56,1.88,-21.33,0.03]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_03","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[11.99,1.73,11.83,-0.51,11.68,-3.01,10.41,-8.46,5.97,-20.56,1.52,-32.66,-2.28,-32.49,-3.3,-32.13,-4.39,-37.7,-5.14,8.35,-4.31,4.43,-3.81,0.41,-4.25,-5.77,-4.83,-19.72,-5.56,-34.59,-7.73,-39.01,-7.98,-43.53,-8.22,-51.9,-20.96,14.13,-18.3,7.97,-15.72,1.88,-15.08,-5.05,-13.32,-20.03,-11.88,-36.84,-12.58,-45.31,-12.03,-54.46,-11.42,-65.41,-24.41,13.36,-21.35,5.3,-18.32,-2.57,-17.35,-9.95,-15.48,-23.92,-13.97,-40.05,-13.69,-48.42,-12.45,-57.61,-11.12,-67.3,-18.01,8.64,-17.02,-0.63,-16.09,-9.66,-15.73,-17.59,-14.39,-28.5,-13.26,-40.62,-12.74,-44.53,-11.46,-49.18,-10.01,-54.47,-11.61,1.81,-12.67,-7.88,-13.86,-17.3,-14.07,-24.25,-12.88,-29.24,-11.74,-34.54,-10.88,-33.98,-9.33,-35.39,-7.64,-37.56,-11.34,0.88,-12.63,-6.85,-14.36,-14.42,-14.28,-19.06,-12.65,-20.4,-11.22,-21.3,-9.36,-18.54,-7.94,-18,-5.87,-18,-12.62,5.16,-12.44,-0.35,-12.59,-5.87,-11.32,-9.04,-7.98,-10.5,-5.18,-10.9,-1.13,-8.31,2.6,-7.02,6.68,-5.87,-14.01,9.8,-12.16,6.48,-10.46,2.98,-7.91,1.16,-2.78,-0.75,1.5,-0.98,7.84,1.27,14.29,3.15,20.61,5.36]},{"duration":60,"tweenEasing":0,"value":[-4.01,13.76,-6.02,7.81,-7.88,1.88,-9.5,-4.78,-13.03,-20.54,-16.57,-36.29,-20.72,-37.56,-23.45,-41.48,-26.39,-51.68,-3.55,14.82,-4.58,8.84,-5.78,2.94,-6.74,-3.72,-8.09,-19.69,-9.6,-36.6,-12.07,-41.6,-13.2,-48.45,-14.48,-59.39,-3.12,15.46,-2.31,8.8,-1.44,2.27,-1.45,-4.53,-2.04,-19.99,-2.94,-37.32,-3.89,-45.63,-3.47,-55.32,-3.14,-66.92,-2.84,13.38,-1.5,5.33,-0.15,-2.55,0.14,-9.93,-0.61,-23.9,-1.72,-40.03,-1.69,-48.39,-0.45,-57.59,0.88,-67.28,-1.01,8.66,-0.94,-0.6,-0.87,-9.65,-0.86,-17.57,-0.89,-28.48,-1.13,-40.6,-0.74,-44.5,0.54,-49.16,1.99,-54.45,0.82,1.83,-0.37,-7.86,-1.6,-17.28,-1.82,-24.23,-0.75,-29.22,0.27,-34.52,1.12,-33.96,2.67,-35.37,4.36,-37.54,0.66,0.9,-0.63,-6.83,-2.36,-14.4,-2.28,-19.04,-0.65,-20.37,0.78,-21.28,2.64,-18.52,4.06,-17.98,6.13,-17.98,-0.62,5.19,-0.44,-0.33,-0.59,-5.85,0.68,-9.02,4.02,-10.48,6.82,-10.88,10.87,-8.29,14.6,-7,18.68,-5.85,-2.01,9.82,-0.16,6.5,1.54,3,4.09,1.18,9.22,-0.73,13.5,-0.96,19.84,1.3,26.29,3.17,32.61,5.38]},{"value":[-50.68,11.78,-52.69,4.91,-54.55,-1.87,-56.42,-9.27,-62.7,-30.51,-68.97,-51.75,-75.73,-53.97,-80.39,-59.6,-85.05,-71.65,-30.77,13.77,-30.99,8.1,-31.37,2.52,-32.46,-4.76,-37.77,-26.77,-43.85,-49.69,-48.88,-55.63,-52.32,-63.41,-55.96,-75.39,-12.38,15.27,-9.99,10.08,-7.55,4.94,-7.59,-2.27,-13.23,-24.14,-20.38,-47.82,-23.86,-56.97,-26.21,-66.88,-28.9,-78.74,-7.85,13.41,-5.65,6.58,-4.05,-0.15,-4.17,-7.76,-9.76,-26.54,-17.15,-47.47,-19.68,-56.18,-22.33,-65.11,-24.89,-74.51,-9.68,8.69,-6.55,-0.85,-2.06,-10.2,-1.09,-18.53,-4.63,-32.32,-9.19,-47.34,-10.3,-51.27,-11.27,-55.06,-12.43,-59.42,-11.5,1.86,-9.84,-9.3,-6.48,-20.12,-5.46,-27.55,-5.48,-33.86,-5.75,-40.48,-5.37,-39.68,-4.79,-39.66,-4.61,-40.26,-13.1,0.93,-14.39,-8.4,-16.12,-17.46,-15.94,-22.5,-13.23,-23.74,-10.74,-24.55,-9.49,-21.63,-10.73,-20.46,-11.2,-19.74,-18.66,5.21,-18.47,-1.13,-18.63,-7.42,-17.17,-10.71,-11.88,-11.17,-7.12,-10.57,-3.61,-8.03,-2.58,-7.31,-1.21,-6.74,-24.68,9.85,-22.83,6.53,-21.13,3.03,-18.32,1.38,-10.45,1.29,-3.42,2.9,2.52,4.89,6.4,5.05,9.95,5.4]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_04","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[7.98,15.49,5.81,7.3,3.8,-1.13,1.09,-12.72,-5.06,-35.09,-11.22,-57.46,-19.46,-59.43,-24.98,-68.27,-30.78,-89.38,-8.68,23.17,-8.89,13.26,-9.59,3.36,-10.87,-8.92,-11.86,-32.53,-13.14,-57.95,-17.85,-68.52,-20.19,-85.84,-22.7,-111.29,-24.08,29.59,-20.59,16.76,-17.15,4.14,-16.5,-8.92,-15.16,-32.34,-14.42,-59.34,-16.03,-77.39,-15.23,-102.83,-14.56,-132.33,-27.25,26.75,-22.86,10.63,-18.47,-5.13,-17.21,-19.15,-16.1,-40.27,-15.7,-65.59,-15.38,-83.31,-12.9,-108.21,-10.24,-134.59,-19.02,17.31,-17.96,-1.22,-16.97,-19.27,-16.59,-34.83,-15.31,-53.09,-14.41,-73.65,-13.48,-81.75,-10.94,-94.54,-8.03,-108.92,-10.79,3.65,-13.04,-15.72,-15.45,-34.56,-15.89,-48.55,-13.64,-58.13,-11.48,-68.33,-9.76,-67.05,-6.68,-70.27,-3.28,-75.09,-10.68,1.78,-13.27,-13.69,-16.72,-28.82,-16.55,-38.12,-13.28,-40.78,-10.45,-42.57,-6.72,-37.08,-3.88,-35.95,0.26,-35.99,-13.24,10.35,-12.87,-0.69,-13.19,-11.7,-10.62,-18.06,-3.96,-21,1.63,-21.8,9.74,-16.64,17.21,-14,25.37,-11.71,-16.02,19.62,-12.33,12.98,-8.92,5.98,-3.82,2.34,6.44,-1.49,15,-1.94,27.68,2.57,40.57,6.31,53.22,10.73]},{"duration":60,"tweenEasing":0,"value":[-8.02,27.51,-12.04,15.61,-15.76,3.77,-18.83,-9.04,-24.06,-35.07,-29.3,-61.1,-37.9,-64.51,-45.13,-77.62,-52.78,-103.36,-7.09,29.64,-9.16,17.67,-11.57,5.88,-13.36,-6.87,-15.12,-32.5,-17.17,-59.95,-22.19,-71.11,-25.41,-90.74,-28.96,-118.79,-6.24,30.92,-4.61,17.58,-2.87,4.53,-2.88,-8.38,-3.88,-32.29,-5.48,-59.81,-7.34,-77.69,-6.67,-103.65,-6.28,-133.84,-5.68,26.77,-3.01,10.65,-0.3,-5.1,0.29,-19.12,-1.23,-40.24,-3.45,-65.58,-3.38,-83.29,-0.9,-108.19,1.76,-134.57,-2.02,17.33,-1.88,-1.2,-1.75,-19.26,-1.72,-34.81,-1.81,-53.07,-2.28,-73.63,-1.48,-81.73,1.06,-94.52,3.97,-108.9,1.64,3.67,-0.73,-15.7,-3.19,-34.54,-3.65,-48.52,-1.51,-58.11,0.53,-68.31,2.24,-67.02,5.32,-70.25,8.72,-75.07,1.32,1.8,-1.27,-13.67,-4.72,-28.8,-4.55,-38.1,-1.28,-40.76,1.55,-42.55,5.28,-37.06,8.12,-35.93,12.26,-35.97,-1.24,10.37,-0.87,-0.67,-1.19,-11.68,1.38,-18.04,8.04,-20.98,13.63,-21.78,21.74,-16.62,29.21,-13.98,37.37,-11.69,-4.02,19.65,-0.33,13,3.08,6,8.18,2.36,18.44,-1.47,27,-1.92,39.68,2.59,52.57,6.33,65.22,10.76]},{"value":[-60.02,25.54,-65.28,10.25,-70.14,-4.74,-74.69,-18.64,-84.73,-47.71,-93.65,-76.78,-108.98,-83.65,-124.04,-104.07,-138.11,-136.66,-39.65,28.59,-41.6,15.57,-43.74,2.89,-46.33,-10.68,-53.22,-41,-60.34,-73.09,-70.24,-86.65,-78.79,-110.11,-87.23,-141.95,-20.83,30.73,-17.8,18.52,-14.58,6.59,-14.82,-6.81,-21.18,-36.79,-29.03,-70.27,-34.08,-89.25,-36.56,-116.01,-39.7,-147.12,-16.02,26.8,-12.49,11.91,-9.53,-2.7,-9.36,-16.95,-15.75,-42.88,-24.24,-73.01,-26.7,-91.08,-28.11,-115.7,-29.35,-141.79,-16.02,17.36,-12.83,-1.44,-8.27,-19.81,-7.28,-35.81,-10.92,-56.92,-15.7,-80.33,-16.37,-88.5,-16.06,-100.43,-15.78,-113.87,-16.02,3.7,-15.54,-17.15,-13.41,-37.34,-12.62,-51.86,-11.57,-62.75,-10.83,-74.25,-9.58,-72.75,-7.46,-74.54,-5.58,-77.79,-17.77,1.83,-20.36,-15.24,-23.82,-31.86,-23.54,-41.56,-19.2,-44.13,-15.31,-45.82,-12.18,-40.17,-12.01,-38.41,-10.4,-37.72,-24.61,10.4,-24.24,-1.47,-24.56,-13.25,-21.81,-19.73,-13.19,-21.67,-5.65,-21.46,1.93,-16.36,6.69,-14.29,12.15,-12.59,-32.02,19.67,-28.33,13.02,-24.92,6.02,-19.56,2.56,-6.56,0.56,4.74,1.94,17.03,6.18,27.35,8.21,37.22,10.78]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07","timeline":[{"name":"B_HAIR_TWIN.07_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.07_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.07_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.07_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.07_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_00","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-14.37,1.37,-10.96,1.06,-7.51,0.76,-4.05,0.47,-0.55,0.18,2.95,-0.1,6.46,-0.38,9.97,-0.66,13.49,-0.93,-11.44,1.31,-8,1.01,-4.54,0.71,-1.07,0.42,2.43,0.14,5.94,-0.13,9.45,-0.41,12.96,-0.68,16.48,-0.96,-8.51,1.26,-5.05,0.96,-1.57,0.67,1.92,0.38,5.42,0.11,8.92,-0.17,12.42,-0.44,15.92,-0.71,19.41,-0.99,-5.59,1.2,-2.1,0.91,1.39,0.63,4.89,0.35,8.39,0.07,11.89,-0.2,15.38,-0.47,18.86,-0.74,22.32,-1.02,-2.67,1.14,0.84,0.86,4.34,0.58,7.83,0.31,11.33,0.04,14.82,-0.23,18.31,-0.5,21.78,-0.77,25.22,-1.05,0.08,1.1,3.61,0.82,7.12,0.55,10.63,0.28,14.13,0.01,17.64,-0.25,21.14,-0.52,24.62,-0.79,28.09,-1.07,2.82,1.06,6.37,0.79,9.9,0.52,13.41,0.25,16.92,-0.01,20.43,-0.28,23.93,-0.55,27.42,-0.82,30.9,-1.09,5.56,1.02,9.13,0.76,12.67,0.49,16.2,0.23,19.7,-0.04,23.21,-0.31,26.7,-0.57,30.19,-0.84,33.68,-1.12,8.31,0.99,11.89,0.73,15.45,0.47,18.99,0.2,22.5,-0.07,25.99,-0.33,29.47,-0.6,32.95,-0.87,36.43,-1.14]},{"duration":60,"tweenEasing":0,"value":[-14.37,1.37,-10.96,1.06,-7.51,0.76,-4.05,0.47,-0.55,0.18,2.95,-0.1,6.46,-0.38,9.97,-0.66,13.49,-0.93,-11.44,1.31,-8,1.01,-4.54,0.71,-1.07,0.42,2.43,0.14,5.94,-0.13,9.45,-0.41,12.96,-0.68,16.48,-0.96,-8.51,1.26,-5.05,0.96,-1.57,0.67,1.92,0.38,5.42,0.11,8.92,-0.17,12.42,-0.44,15.92,-0.71,19.41,-0.99,-5.59,1.2,-2.1,0.91,1.39,0.63,4.89,0.35,8.39,0.07,11.89,-0.2,15.38,-0.47,18.86,-0.74,22.32,-1.02,-2.67,1.14,0.84,0.86,4.34,0.58,7.83,0.31,11.33,0.04,14.82,-0.23,18.31,-0.5,21.78,-0.77,25.22,-1.05,0.08,1.1,3.61,0.82,7.12,0.55,10.63,0.28,14.13,0.01,17.64,-0.25,21.14,-0.52,24.62,-0.79,28.09,-1.07,2.82,1.06,6.37,0.79,9.9,0.52,13.41,0.25,16.92,-0.01,20.43,-0.28,23.93,-0.55,27.42,-0.82,30.9,-1.09,5.56,1.02,9.13,0.76,12.67,0.49,16.2,0.23,19.7,-0.04,23.21,-0.31,26.7,-0.57,30.19,-0.84,33.68,-1.12,8.31,0.99,11.89,0.73,15.45,0.47,18.99,0.2,22.5,-0.07,25.99,-0.33,29.47,-0.6,32.95,-0.87,36.43,-1.14]},{"value":[-14.37,3.48,-10.95,3.18,-7.51,2.89,-4.04,2.62,-0.55,2.35,2.95,2.08,6.46,1.81,9.97,1.55,13.5,1.28,-11.44,2.73,-8.01,2.5,-4.55,2.29,-1.07,2.08,2.42,1.84,5.93,1.63,9.44,1.47,12.95,1.34,16.47,1.19,-8.53,1.81,-5.06,1.65,-1.59,1.53,1.9,1.4,5.4,1.2,8.9,1.04,12.4,1.01,15.9,1.02,19.39,0.98,-5.62,1.23,-2.13,1.14,1.36,1.1,4.86,1.02,8.36,0.85,11.86,0.73,15.34,0.8,18.82,0.93,22.28,0.99,-2.71,1.51,0.79,1.47,4.29,1.45,7.79,1.4,11.28,1.23,14.78,1.13,18.26,1.22,21.73,1.4,25.18,1.53,0.06,2.85,3.59,2.77,7.1,2.75,10.6,2.69,14.1,2.52,17.6,2.41,21.09,2.48,24.56,2.62,28.02,2.68,2.81,5.14,6.35,5.01,9.87,4.92,13.38,4.81,16.88,4.62,20.38,4.47,23.86,4.45,27.34,4.47,30.8,4.44,5.55,7.83,9.1,7.64,12.62,7.47,16.12,7.29,19.62,7.07,23.11,6.86,26.59,6.72,30.07,6.6,33.53,6.45,8.3,10.38,11.85,10.13,15.35,9.89,18.84,9.64,22.32,9.39,25.81,9.14,29.3,8.89,32.78,8.64,36.26,8.39]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_01","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-4.15,1.36,-3.84,1.06,-3.48,0.77,-3.11,0.47,-2.71,0.18,-2.32,-0.11,-1.92,-0.4,-1.53,-0.69,-1.13,-0.98,-2.27,1.31,-1.93,1.01,-1.56,0.72,-1.18,0.43,-0.79,0.14,-0.39,-0.15,0.01,-0.44,0.41,-0.73,0.81,-1.02,-0.4,1.25,-0.02,0.96,0.36,0.67,0.75,0.38,1.14,0.09,1.53,-0.19,1.93,-0.48,2.33,-0.77,2.73,-1.05,1.46,1.19,1.88,0.91,2.28,0.63,2.68,0.34,3.07,0.05,3.46,-0.23,3.85,-0.52,4.24,-0.8,4.63,-1.09,3.3,1.14,3.76,0.86,4.19,0.58,4.59,0.3,4.98,0.02,5.37,-0.27,5.75,-0.56,6.14,-0.84,6.53,-1.13,5.24,1.11,5.7,0.83,6.12,0.55,6.51,0.27,6.9,-0.02,7.3,-0.31,7.7,-0.59,8.1,-0.88,8.5,-1.17,7.18,1.08,7.63,0.8,8.05,0.52,8.45,0.23,8.83,-0.05,9.23,-0.34,9.63,-0.63,10.04,-0.92,10.44,-1.2,9.11,1.05,9.56,0.77,9.99,0.48,10.39,0.2,10.77,-0.09,11.17,-0.37,11.57,-0.66,11.97,-0.95,12.36,-1.24,11.03,1.01,11.5,0.73,11.94,0.45,12.35,0.16,12.75,-0.12,13.13,-0.41,13.51,-0.7,13.9,-0.98,14.27,-1.27]},{"duration":60,"tweenEasing":0,"value":[-4.15,1.36,-3.84,1.06,-3.48,0.77,-3.11,0.47,-2.71,0.18,-2.32,-0.11,-1.92,-0.4,-1.53,-0.69,-1.13,-0.98,-2.27,1.31,-1.93,1.01,-1.56,0.72,-1.18,0.43,-0.79,0.14,-0.39,-0.15,0.01,-0.44,0.41,-0.73,0.81,-1.02,-0.4,1.25,-0.02,0.96,0.36,0.67,0.75,0.38,1.14,0.09,1.53,-0.19,1.93,-0.48,2.33,-0.77,2.73,-1.05,1.46,1.19,1.88,0.91,2.28,0.63,2.68,0.34,3.07,0.05,3.46,-0.23,3.85,-0.52,4.24,-0.8,4.63,-1.09,3.3,1.14,3.76,0.86,4.19,0.58,4.59,0.3,4.98,0.02,5.37,-0.27,5.75,-0.56,6.14,-0.84,6.53,-1.13,5.24,1.11,5.7,0.83,6.12,0.55,6.51,0.27,6.9,-0.02,7.3,-0.31,7.7,-0.59,8.1,-0.88,8.5,-1.17,7.18,1.08,7.63,0.8,8.05,0.52,8.45,0.23,8.83,-0.05,9.23,-0.34,9.63,-0.63,10.04,-0.92,10.44,-1.2,9.11,1.05,9.56,0.77,9.99,0.48,10.39,0.2,10.77,-0.09,11.17,-0.37,11.57,-0.66,11.97,-0.95,12.36,-1.24,11.03,1.01,11.5,0.73,11.94,0.45,12.35,0.16,12.75,-0.12,13.13,-0.41,13.51,-0.7,13.9,-0.98,14.27,-1.27]},{"value":[-4.14,3.47,-3.83,3.18,-3.48,2.9,-3.1,2.62,-2.71,2.34,-2.31,2.07,-1.92,1.79,-1.53,1.51,-1.13,1.24,-2.28,2.72,-1.93,2.5,-1.57,2.3,-1.19,2.09,-0.8,1.84,-0.4,1.61,0,1.44,0.4,1.3,0.8,1.13,-0.42,1.8,-0.04,1.65,0.35,1.54,0.73,1.4,1.12,1.18,1.51,1.01,1.91,0.97,2.31,0.97,2.7,0.91,1.43,1.22,1.85,1.14,2.25,1.1,2.65,1.02,3.03,0.83,3.42,0.69,3.82,0.75,4.21,0.86,4.6,0.92,3.26,1.51,3.72,1.47,4.14,1.46,4.54,1.39,4.93,1.21,5.32,1.08,5.71,1.16,6.1,1.33,6.48,1.45,5.22,2.86,5.68,2.79,6.09,2.75,6.48,2.67,6.87,2.49,7.26,2.35,7.65,2.41,8.04,2.53,8.43,2.58,7.17,5.16,7.62,5.02,8.02,4.92,8.41,4.79,8.79,4.58,9.18,4.41,9.57,4.37,9.95,4.37,10.33,4.33,9.1,7.85,9.54,7.65,9.94,7.46,10.32,7.26,10.7,7.02,11.08,6.8,11.46,6.64,11.84,6.5,12.22,6.33,11.02,10.4,11.45,10.14,11.84,9.87,12.2,9.6,12.57,9.34,12.96,9.07,13.34,8.8,13.72,8.53,14.1,8.26]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_02","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":161},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[2.11,0,2.12,0,2.13,0,2.15,0,2.16,0,2.18,0,2.19,0,2.2,0,2.22,-0.01,1.42,-0.01,1.49,-0.01,1.58,-0.01,1.66,-0.01,1.7,-0.01,1.76,-0.01,1.88,-0.01,2.02,-0.01,2.15,-0.02,0.55,-0.02,0.69,-0.02,0.87,-0.02,1.02,-0.02,1.09,-0.02,1.2,-0.02,1.45,-0.02,1.73,-0.02,1.97,-0.03,0.03,-0.03,0.23,-0.03,0.47,-0.03,0.68,-0.03,0.77,-0.03,0.93,-0.03,1.27,-0.03,1.67,-0.03,2.01,-0.04,0.37,-0.04,0.61,-0.04,0.87,-0.04,1.09,-0.04,1.19,-0.05,1.35,-0.05,1.72,-0.05,2.17,-0.05,2.58,-0.02,1.75,-0.02,1.95,-0.03,2.2,-0.03,2.41,-0.03,2.51,-0.04,2.66,-0.05,3,-0.06,3.41,-0.07,3.75,-0.01,4.08,-0.01,4.22,-0.03,4.4,-0.04,4.56,-0.03,4.63,-0.05,4.75,-0.07,5,-0.09,5.29,-0.1,5.53,-0.01,6.81,-0.02,6.88,-0.05,6.98,-0.07,7.06,-0.08,7.11,-0.09,7.17,-0.11,7.3,-0.13,7.44,-0.14,7.57,-0.01,9.39,-0.05,9.4,-0.1,9.42,-0.15,9.44,-0.17,9.46,-0.17,9.48,-0.17,9.49,-0.17,9.51,-0.17,9.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_03","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.73,0.12,12.74,0.12,12.7,0.12,12.57,0.13,12.72,0.12,12.77,0.12,12.82,0.11,12.87,0.1,12.91,0.1,12.89,0.1,12.84,0.11,12.75,0.12,12.58,0.13,12.77,0.11,12.85,0.11,12.92,0.1,12.99,0.09,13.06,0.09,13.01,0.09,12.93,0.1,12.8,0.11,12.59,0.13,12.92,0.1,12.98,0.1,13.04,0.09,13.1,0.08,13.16,0.08,13.1,0.08,13,0.09,12.85,0.11,12.64,0.13,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.16,0.08,13.07,0.09,12.92,0.1,12.72,0.12,13.2,0.08,13.21,0.08,13.22,0.08,13.23,0.08,13.23,0.08,13.22,0.08,13.14,0.09,13.01,0.1,12.81,0.11,13.22,0.08,13.26,0.08,13.28,0.08,13.3,0.09,13.32,0.09,13.3,0.09,13.22,0.09,13.07,0.1,12.85,0.11,13.26,0.08,13.32,0.09,13.36,0.09,13.38,0.09,13.4,0.09,13.37,0.09,13.28,0.1,13.11,0.1,12.87,0.11,13.35,0.09,13.4,0.09,13.43,0.1,13.44,0.1,13.44,0.1,13.41,0.1,13.31,0.1,13.13,0.1,12.87,0.11]},{"duration":60,"tweenEasing":0,"value":[12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.73,0.12,12.74,0.12,12.7,0.12,12.57,0.13,12.72,0.12,12.77,0.12,12.82,0.11,12.87,0.1,12.91,0.1,12.89,0.1,12.84,0.11,12.75,0.12,12.58,0.13,12.77,0.11,12.85,0.11,12.92,0.1,12.99,0.09,13.06,0.09,13.01,0.09,12.93,0.1,12.8,0.11,12.59,0.13,12.92,0.1,12.98,0.1,13.04,0.09,13.1,0.08,13.16,0.08,13.1,0.08,13,0.09,12.85,0.11,12.64,0.13,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.16,0.08,13.07,0.09,12.92,0.1,12.72,0.12,13.2,0.08,13.21,0.08,13.22,0.08,13.23,0.08,13.23,0.08,13.22,0.08,13.14,0.09,13.01,0.1,12.81,0.11,13.22,0.08,13.26,0.08,13.28,0.08,13.3,0.09,13.32,0.09,13.3,0.09,13.22,0.09,13.07,0.1,12.85,0.11,13.26,0.08,13.32,0.09,13.36,0.09,13.38,0.09,13.4,0.09,13.37,0.09,13.28,0.1,13.11,0.1,12.87,0.11,13.35,0.09,13.4,0.09,13.43,0.1,13.44,0.1,13.44,0.1,13.41,0.1,13.31,0.1,13.13,0.1,12.87,0.11]},{"value":[3.6,2.7,3.73,2.7,3.88,2.71,4,2.71,4.05,2.72,4.41,2.77,5.27,2.85,6.28,2.95,7.09,3.06,6.3,1.87,6.44,1.94,6.6,2.01,6.73,2.07,6.81,2.11,7.01,2.19,7.57,2.37,8.22,2.58,8.71,2.78,9.34,0.85,9.46,0.98,9.59,1.14,9.71,1.28,9.79,1.34,9.82,1.47,10.06,1.75,10.35,2.08,10.51,2.37,11.89,0.18,11.97,0.38,12.05,0.61,12.12,0.81,12.18,0.9,12.1,1.06,12.1,1.42,12.09,1.85,12,2.21,13.15,0.45,13.15,0.69,13.15,0.95,13.15,1.17,13.15,1.27,13.11,1.43,13.02,1.81,12.87,2.27,12.67,2.7,13.18,1.83,13.19,2.03,13.2,2.28,13.2,2.49,13.21,2.58,13.18,2.74,13.1,3.09,12.95,3.51,12.74,3.86,13.2,4.16,13.24,4.3,13.26,4.48,13.27,4.64,13.28,4.72,13.25,4.84,13.15,5.09,12.98,5.39,12.75,5.64,13.25,6.89,13.3,6.97,13.31,7.07,13.31,7.15,13.32,7.2,13.28,7.26,13.17,7.39,12.99,7.54,12.73,7.68,13.34,9.48,13.36,9.5,13.33,9.52,13.29,9.54,13.27,9.56,13.23,9.57,13.14,9.59,12.96,9.61,12.7,9.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_04","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[19.7,0.28,22.06,0.49,24.77,0.75,26.74,0.92,26.9,0.85,25.31,0.68,23.1,0.62,20.7,0.6,18.61,0.55,28.95,0.6,30.16,0.69,31.65,0.81,32.64,0.85,32.35,0.72,30.89,0.52,28.94,0.38,26.85,0.26,24.97,0.15,38.54,0.97,38.72,0.92,39.11,0.86,39.21,0.75,38.53,0.56,36.82,0.33,34.78,0.1,32.64,-0.11,30.64,-0.28,46.86,1.26,46.27,1.1,45.83,0.89,45.29,0.65,44.43,0.4,42.72,0.15,40.82,-0.13,38.86,-0.39,36.97,-0.61,52.3,1.35,51.32,1.1,50.43,0.84,49.65,0.57,49.01,0.29,48.15,0.03,47.23,-0.22,46.26,-0.46,45.3,-0.7,56.02,1.3,55.12,1.04,54.26,0.75,53.46,0.46,52.74,0.18,51.96,-0.05,51.1,-0.25,50.2,-0.46,49.27,-0.7,59.65,1.21,58.9,0.95,58.14,0.66,57.38,0.37,56.64,0.09,55.88,-0.11,55.06,-0.29,54.18,-0.49,53.25,-0.73,63.26,1.09,62.67,0.84,62.03,0.57,61.34,0.29,60.61,0.03,59.87,-0.15,59.06,-0.34,58.19,-0.56,57.24,-0.82,66.9,0.94,66.47,0.71,65.94,0.47,65.3,0.23,64.56,-0.01,63.83,-0.2,63.05,-0.42,62.19,-0.67,61.22,-0.96]},{"duration":60,"tweenEasing":0,"value":[19.7,0.28,22.06,0.49,24.77,0.75,26.74,0.92,26.9,0.85,25.31,0.68,23.1,0.62,20.7,0.6,18.61,0.55,28.95,0.6,30.16,0.69,31.65,0.81,32.64,0.85,32.35,0.72,30.89,0.52,28.94,0.38,26.85,0.26,24.97,0.15,38.54,0.97,38.72,0.92,39.11,0.86,39.21,0.75,38.53,0.56,36.82,0.33,34.78,0.1,32.64,-0.11,30.64,-0.28,46.86,1.26,46.27,1.1,45.83,0.89,45.29,0.65,44.43,0.4,42.72,0.15,40.82,-0.13,38.86,-0.39,36.97,-0.61,52.3,1.35,51.32,1.1,50.43,0.84,49.65,0.57,49.01,0.29,48.15,0.03,47.23,-0.22,46.26,-0.46,45.3,-0.7,56.02,1.3,55.12,1.04,54.26,0.75,53.46,0.46,52.74,0.18,51.96,-0.05,51.1,-0.25,50.2,-0.46,49.27,-0.7,59.65,1.21,58.9,0.95,58.14,0.66,57.38,0.37,56.64,0.09,55.88,-0.11,55.06,-0.29,54.18,-0.49,53.25,-0.73,63.26,1.09,62.67,0.84,62.03,0.57,61.34,0.29,60.61,0.03,59.87,-0.15,59.06,-0.34,58.19,-0.56,57.24,-0.82,66.9,0.94,66.47,0.71,65.94,0.47,65.3,0.23,64.56,-0.01,63.83,-0.2,63.05,-0.42,62.19,-0.67,61.22,-0.96]},{"value":[19.71,2.39,22.07,2.61,24.77,2.89,26.74,3.07,26.9,3.01,25.32,2.86,23.1,2.81,20.71,2.81,18.61,2.77,28.94,2.02,30.16,2.18,31.65,2.39,32.63,2.51,32.34,2.42,30.88,2.28,28.93,2.26,26.84,2.29,24.96,2.29,38.52,1.52,38.7,1.61,39.09,1.73,39.19,1.77,38.51,1.65,36.8,1.53,34.76,1.56,32.62,1.63,30.62,1.69,46.83,1.29,46.24,1.32,45.8,1.36,45.26,1.33,44.4,1.17,42.69,1.08,40.79,1.15,38.83,1.29,36.93,1.4,52.27,1.72,51.28,1.71,50.39,1.71,49.61,1.66,48.96,1.48,48.11,1.38,47.18,1.5,46.22,1.71,45.25,1.88,56,3.05,55.1,2.99,54.24,2.95,53.44,2.87,52.71,2.68,51.92,2.61,51.06,2.75,50.14,2.95,49.21,3.05,59.64,5.29,58.88,5.17,58.11,5.06,57.34,4.93,56.6,4.73,55.83,4.64,54.99,4.71,54.1,4.8,53.15,4.8,63.25,7.89,62.65,7.72,61.98,7.54,61.27,7.36,60.53,7.14,59.77,7.02,58.95,6.95,58.06,6.89,57.09,6.75,66.89,10.33,66.43,10.11,65.84,9.89,65.15,9.67,64.39,9.45,63.66,9.28,62.88,9.08,62.01,8.84,61.05,8.56]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16","timeline":[{"name":"B_HAIR_TWIN.16_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.16_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.16_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.16_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.16_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_00","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[-0.06,1.94,-0.05,1.94,-0.04,1.94,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.04,1.94,-0.04,1.94,-0.03,1.95,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.02,1.95,-0.02,1.95,-0.02,1.95,-0.01,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.01,1.96,-0.01,1.96,0,1.95,0,1.95,0.01,1.95,0.01,1.95,0.02,1.95,0.02,1.95,0.03,1.95,0.04,1.97,0.04,1.96,0.04,1.96,0.04,1.95,0.04,1.94,0.05,1.94,0.07,1.94,0.09,1.94,0.1,1.94,0.1,1.96,0.09,1.96,0.08,1.95,0.06,1.95,0.05,1.94,0.07,1.94,0.09,1.94,0.12,1.95,0.13,1.95,0.12,1.24,0.13,1,0.15,0.85,0.15,0.76,0.1,0.74,0.25,0.64,0.25,0.66,0.17,0.71,0.12,0.73,-0.15,-1.56,0,-2.34,0.17,-3.13,0.3,-3.75,0.32,-3.99,0.63,-4.24,0.53,-4.22,0.26,-4.11,0.07,-4.05,-0.49,-4.59,-0.16,-5.94,0.18,-7.43,0.46,-8.63,0.57,-9.12,1.03,-9.51,0.82,-9.5,0.35,-9.32,0.01,-9.23]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_01","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[-0.06,1.94,-0.05,1.94,-0.04,1.94,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.04,1.94,-0.04,1.94,-0.03,1.95,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.02,1.95,-0.02,1.95,-0.02,1.95,-0.01,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.01,1.96,-0.01,1.96,0,1.95,0,1.95,0.01,1.95,0.01,1.95,0.02,1.95,0.02,1.95,0.03,1.95,0.04,1.97,0.04,1.96,0.04,1.96,0.04,1.95,0.04,1.94,0.05,1.94,0.07,1.94,0.09,1.94,0.1,1.94,0.1,1.96,0.09,1.96,0.08,1.95,0.06,1.95,0.05,1.94,0.07,1.94,0.09,1.94,0.12,1.95,0.13,1.95,0.2,1.95,0.17,1.95,0.13,1.95,0.1,1.95,0.06,1.95,0.07,1.95,0.09,1.96,0.12,1.96,0.13,1.96,0.26,1.95,0.23,1.95,0.19,1.95,0.15,1.96,0.12,1.96,0.11,1.96,0.12,1.96,0.13,1.96,0.14,1.96,0.26,1.94,0.26,1.95,0.23,1.95,0.21,1.95,0.2,1.95,0.17,1.96,0.15,1.96,0.15,1.97,0.15,1.97]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_03","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[24.3,3.25,20.78,2.96,16.91,2.64,13.76,2.38,12.38,2.28,11.26,2.28,8.73,2.28,5.62,2.28,2.8,2.28,15.02,-0.69,12.91,-0.45,10.57,0.27,8.69,1.04,7.92,1.4,7.21,1.42,5.61,1.46,3.66,1.5,1.88,1.52,6.23,-1.26,5.44,-1,4.55,-0.35,3.84,0.32,3.58,0.62,3.27,0.65,2.6,0.73,1.78,0.8,1.04,0.83,1.84,0.65,1.78,0.68,1.74,0.69,1.66,0.7,1.5,0.7,1.4,0.7,1.23,0.69,1.02,0.68,0.82,0.65,1.84,0.65,2.31,0.83,2.83,1.02,3.23,1.18,3.32,1.24,2.97,1.18,2.32,1.02,1.54,0.83,0.82,0.65,1.84,0.65,2.83,0.97,3.92,1.35,4.8,1.66,5.13,1.79,4.54,1.66,3.41,1.35,2.06,0.97,0.82,0.65,1.84,0.65,2.74,0.94,3.73,1.29,4.53,1.59,4.87,1.71,4.28,1.59,3.22,1.29,1.97,0.94,0.82,0.65,1.84,0.65,2.24,0.8,2.69,0.98,3.05,1.14,3.17,1.2,2.79,1.14,2.18,0.98,1.48,0.8,0.82,0.65,1.84,0.65,1.72,0.65,1.59,0.65,1.46,0.65,1.33,0.65,1.2,0.65,1.08,0.65,0.95,0.65,0.82,0.65]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_04","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[48.59,6.5,41.57,5.92,33.83,5.28,27.51,4.77,24.76,4.55,22.52,4.55,17.45,4.55,11.24,4.55,5.6,4.55,30.03,-1.39,25.82,-0.91,21.14,0.55,17.36,2.08,15.84,2.79,14.42,2.83,11.22,2.92,7.32,3.01,3.77,3.05,12.47,-2.51,10.88,-2,9.1,-0.7,7.68,0.63,7.17,1.24,6.54,1.31,5.19,1.45,3.56,1.59,2.08,1.66,3.69,1.3,4.02,1.31,4.49,1.32,4.69,1.32,4.21,1.32,4.21,1.32,3.5,1.32,2.5,1.31,1.64,1.3,3.69,1.3,8.75,1.36,14.38,1.43,18.89,1.49,20.59,1.51,18.38,1.49,13.36,1.43,7.22,1.36,1.64,1.3,3.69,1.3,13.51,1.42,24.32,1.55,33.14,1.66,36.98,1.71,32.43,1.66,23.12,1.55,11.91,1.41,1.64,1.3,3.69,1.3,12.71,1.41,22.61,1.53,30.77,1.63,34.6,1.68,29.96,1.63,21.32,1.53,11.08,1.4,1.64,1.3,3.69,1.3,8.22,1.35,13.19,1.42,17.3,1.47,19.26,1.5,16.7,1.47,12.09,1.42,6.66,1.35,1.64,1.3,3.69,1.3,3.43,1.3,3.18,1.3,2.92,1.3,2.66,1.3,2.41,1.3,2.15,1.3,1.9,1.3,1.64,1.3]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17","timeline":[{"name":"B_HAIR_TWIN.17_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.17_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.17_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.17_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.17_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_00","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[2.35,0,3.29,0.01,4.28,0.02,5.34,0.03,6.49,0.06,7.9,0.04,8.98,0.04,9.44,0.03,8.97,0.02,2.28,0,3.27,0.03,4.29,0.05,5.36,0.08,6.51,0.11,8.01,0.08,9.24,0.08,10.07,0.09,10.39,0.09,2.22,-0.01,3.23,0.04,4.27,0.07,5.34,0.09,6.46,0.12,7.72,0.09,8.77,0.09,9.65,0.11,10.43,0.12,2.14,-0.01,3.16,0.04,4.22,0.06,5.29,0.08,6.39,0.1,7.4,0.07,8.24,0.08,9.08,0.11,10.09,0.13,1.96,0,2.96,0.02,4.02,0.04,5.1,0.05,6.17,0.06,7.06,0.04,7.75,0.06,8.45,0.08,9.38,0.1,1.71,0,2.68,0.01,3.73,0.03,4.8,0.03,5.82,0.03,6.68,0.03,7.31,0.04,7.97,0.06,8.91,0.08,1.41,0,2.34,0,3.36,0.01,4.4,0.01,5.41,0,6.21,0.01,6.85,0.03,7.54,0.04,8.49,0.06,1.16,0,2.09,0,3.09,-0.01,4.14,-0.01,5.18,-0.03,5.9,0.01,6.54,0.04,7.26,0.07,8.19,0.08,0.97,0,1.9,-0.01,2.91,-0.02,3.97,-0.03,5.05,-0.05,5.71,0.02,6.39,0.06,7.17,0.09,8.12,0.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_01","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[1.18,0,1.64,0.01,2.14,0.01,2.67,0.02,3.25,0.03,3.95,0.02,4.49,0.02,4.72,0.02,4.49,0.01,1.14,0,1.63,0.01,2.14,0.03,2.68,0.04,3.26,0.05,4,0.04,4.62,0.04,5.04,0.04,5.19,0.04,1.11,0,1.62,0.02,2.13,0.03,2.67,0.05,3.23,0.06,3.86,0.05,4.38,0.05,4.83,0.05,5.22,0.06,1.07,0,1.58,0.02,2.11,0.03,2.65,0.04,3.19,0.05,3.7,0.04,4.12,0.04,4.54,0.05,5.05,0.06,0.98,0,1.48,0.01,2.01,0.02,2.55,0.03,3.09,0.03,3.53,0.02,3.87,0.03,4.23,0.04,4.69,0.05,0.85,0,1.34,0.01,1.86,0.01,2.4,0.02,2.91,0.02,3.34,0.01,3.66,0.02,3.99,0.03,4.45,0.04,0.71,0,1.17,0,1.68,0,2.2,0,2.7,0,3.11,0.01,3.43,0.01,3.77,0.02,4.25,0.03,0.58,0,1.04,0,1.55,0,2.07,-0.01,2.59,-0.01,2.95,0.01,3.27,0.02,3.63,0.03,4.09,0.04,0.49,0,0.95,-0.01,1.45,-0.01,1.98,-0.01,2.52,-0.02,2.86,0.01,3.2,0.03,3.58,0.04,4.06,0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_03","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[19.32,1.05,14.58,1.08,9.59,1.13,5.08,1.17,1.8,1.18,-0.48,1.21,-2.84,1.25,-5.14,1.28,-7.23,1.27,18.8,1.05,14.36,1.07,9.69,1.1,5.45,1.13,2.33,1.14,0.03,1.14,-2.35,1.14,-4.68,1.14,-6.83,1.11,18.46,1.01,14.31,1.03,9.96,1.05,5.99,1.07,3.02,1.09,0.65,1.06,-1.77,1.03,-4.17,0.99,-6.43,0.94,18.41,0.99,14.14,1,9.91,1.02,6.2,1.04,3.51,1.06,1.53,1.01,-0.71,0.96,-3.16,0.9,-5.74,0.84,16.28,0.96,11.81,0.98,8.09,0.99,5.39,1,4.02,1,3.09,0.97,1.28,0.92,-1.4,0.87,-4.96,0.82,14.12,0.96,9.4,0.97,6.14,0.98,4.42,0.98,4.33,0.97,4.38,0.95,2.94,0.91,-0.06,0.87,-4.66,0.83,13.6,0.97,9.31,0.98,6.28,0.97,4.53,0.96,4.07,0.94,3.76,0.92,2.18,0.91,-0.74,0.89,-5.04,0.84,13.05,1.01,9.73,1,7.04,0.98,4.98,0.96,3.57,0.93,2.26,0.89,0.33,0.89,-2.27,0.87,-5.58,0.8,12.54,1.03,10.19,1,7.81,0.97,5.43,0.94,3.07,0.9,0.79,0.84,-1.47,0.81,-3.74,0.77,-6.02,0.66]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_04","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[38.63,2.09,29.16,2.17,19.18,2.26,10.17,2.33,3.6,2.36,-0.95,2.43,-5.68,2.5,-10.28,2.55,-14.45,2.55,37.6,2.1,28.72,2.15,19.37,2.2,10.9,2.25,4.65,2.28,0.05,2.28,-4.7,2.29,-9.35,2.27,-13.66,2.21,36.92,2.03,28.63,2.07,19.91,2.11,11.97,2.15,6.03,2.18,1.31,2.12,-3.55,2.06,-8.34,1.99,-12.86,1.88,36.81,1.97,28.29,2,19.83,2.04,12.42,2.07,7.02,2.11,3.06,2.02,-1.43,1.92,-6.32,1.81,-11.49,1.67,32.56,1.93,23.62,1.96,16.17,1.98,10.78,1.99,8.03,2,6.19,1.94,2.58,1.85,-2.8,1.75,-9.92,1.64,28.23,1.92,18.78,1.95,12.25,1.96,8.82,1.96,8.65,1.93,8.76,1.9,5.88,1.83,-0.11,1.73,-9.31,1.66,27.19,1.95,18.62,1.96,12.56,1.95,9.06,1.92,8.14,1.87,7.51,1.85,4.35,1.82,-1.48,1.78,-10.08,1.69,26.09,2.02,19.46,1.99,14.07,1.96,9.95,1.92,7.14,1.85,4.53,1.79,0.65,1.78,-4.55,1.75,-11.15,1.61,25.07,2.05,20.37,1.99,15.62,1.94,10.87,1.89,6.14,1.81,1.58,1.68,-2.95,1.63,-7.48,1.54,-12.04,1.31]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18","timeline":[{"name":"B_HAIR_TWIN.18_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.18_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.18_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.18_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.18_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_00","timeline":[{"name":"B_HAIR_TWIN.18","type":50,"frame":[{"duration":121,"offset":20,"value":[0.9,0.1,1.88,0.22,2.7,0.32,3.12,0.36,2.7,0.32,1.88,0.22,0.9,0.1,0,0,0,0,1.74,0.19,3.64,0.42,5.22,0.62,6.01,0.7,5.21,0.62,3.63,0.42,1.74,0.19,0,0,0,0,1.89,0.21,3.97,0.46,5.68,0.66,6.46,0.75,6.43,0.67,4.69,0.46,2.27,0.21,0.19,0,0,0,1,0.12,2.11,0.24,3.01,0.35,3.37,0.39,6.41,0.35,5.74,0.25,3.58,0.12,2.17,0.01,0,0,0.11,0.02,0.25,0.03,0.34,0.03,0.29,0.03,6.42,0.04,6.82,0.04,4.91,0.04,4.15,0.02,0,0,0,0,0,0,0,0,0,0,5.28,0.01,5.77,0.01,4.34,0.01,3.86,0.02,0,0,0,0,0,0,0,0,0,0,2.66,0.01,2.92,0.01,2.23,0.01,2.01,0.01]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_03","timeline":[{"name":"B_HAIR_TWIN.18","type":50,"frame":[{"duration":121,"value":[15.87,-0.85,15.12,-0.67,14.86,-0.49,13.71,-0.24,10.3,0.16,7.84,0.16,3.1,0.18,-2.44,0.19,-7.28,0.17,10.8,-0.57,9.5,-0.45,8.48,-0.32,6.92,-0.15,3.99,0.11,2.52,0.08,-0.42,0.06,-3.86,0.04,-6.85,0.01,5.56,-0.24,3.95,-0.17,2.41,-0.1,0.67,-0.01,-1.56,0.11,-2.27,0.04,-3.59,-0.02,-5.12,-0.08,-6.44,-0.13,0.89,0,0.02,0.03,-0.92,0.05,-1.84,0.07,-2.68,0.09,-3.24,0.04,-3.89,-0.03,-4.65,-0.12,-5.55,-0.2,1.18,0,0.39,0,-0.45,0,-1.29,-0.01,-2.1,-0.01,-1.62,0.07,-1.33,0.05,-1.49,-0.04,-2.36,-0.21,1.51,0.01,0.76,-0.01,-0.04,-0.03,-0.85,-0.05,-1.66,-0.06,-0.2,0.14,0.96,0.17,1.34,0.05,0.44,-0.21,1.55,0,0.79,-0.03,-0.01,-0.06,-0.84,-0.08,-1.67,-0.1,-0.46,0.07,0.5,0.1,0.79,0,-0.03,-0.25,1.34,-0.02,0.57,-0.07,-0.26,-0.1,-1.12,-0.13,-1.96,-0.16,-1.72,-0.12,-1.59,-0.14,-1.8,-0.23,-2.59,-0.44,1.02,-0.03,0.25,-0.09,-0.61,-0.13,-1.49,-0.17,-2.35,-0.2,-3.08,-0.31,-3.8,-0.42,-4.52,-0.55,-5.28,-0.73]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_04","timeline":[{"name":"B_HAIR_TWIN.18","type":50,"frame":[{"duration":121,"value":[31.74,-1.69,30.24,-1.34,29.72,-0.99,27.43,-0.49,20.6,0.31,15.69,0.33,6.2,0.36,-4.88,0.38,-14.57,0.34,21.61,-1.14,18.99,-0.89,16.93,-0.63,13.79,-0.29,7.98,0.23,5.07,0.17,-0.82,0.13,-7.72,0.09,-13.7,0.02,11.13,-0.49,7.89,-0.34,4.81,-0.2,1.32,-0.02,-3.13,0.22,-4.52,0.08,-7.18,-0.05,-10.24,-0.16,-12.88,-0.26,1.78,0,0.03,0.05,-1.83,0.09,-3.68,0.13,-5.37,0.17,-6.49,0.07,-7.78,-0.07,-9.3,-0.23,-11.1,-0.41,2.37,0.01,0.78,0.01,-0.9,0,-2.59,-0.02,-4.2,-0.01,-3.23,0.14,-2.65,0.11,-2.97,-0.09,-4.71,-0.43,3.02,0.01,1.52,-0.03,-0.07,-0.07,-1.7,-0.1,-3.32,-0.12,-0.39,0.28,1.94,0.34,2.69,0.09,0.88,-0.42,3.09,0,1.58,-0.07,-0.02,-0.12,-1.68,-0.16,-3.33,-0.2,-0.91,0.13,1.02,0.2,1.59,0,-0.07,-0.5,2.69,-0.03,1.15,-0.13,-0.52,-0.21,-2.24,-0.27,-3.92,-0.32,-3.44,-0.25,-3.18,-0.28,-3.61,-0.47,-5.17,-0.88,2.05,-0.06,0.49,-0.18,-1.22,-0.27,-2.98,-0.33,-4.69,-0.39,-6.17,-0.62,-7.6,-0.84,-9.04,-1.1,-10.55,-1.46]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19","timeline":[{"name":"B_HAIR_TWIN.19_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.19_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.19_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.19_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.19_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_00"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_03","timeline":[{"name":"B_HAIR_TWIN.19","type":50,"frame":[{"duration":121,"value":[-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-6.02,0,-5.94,0,-5.8,-0.01,-5.69,-0.03,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.62,-0.04,-4.73,-0.12,-3.64,-0.23,-2.66,-0.33,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.21,-0.07,-3.53,-0.24,-1.48,-0.44,0.38,-0.62,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.21,-0.07,-3.65,-0.23,-1.78,-0.42,-0.06,-0.58,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.56,-0.04,-4.75,-0.12,-3.79,-0.22,-2.9,-0.3,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_04","timeline":[{"name":"B_HAIR_TWIN.19","type":50,"frame":[{"duration":121,"value":[-28.72,1.09,-28.59,1.04,-28.83,1.1,-29.13,1.23,-29.22,1.39,-29.69,1.3,-29.73,1.26,-29.95,1.26,-30.95,1.29,-28.26,0.64,-28.36,0.67,-28.76,0.8,-29.29,0.97,-29.77,1.12,-30.26,1.07,-30.36,1,-30.55,0.95,-31.3,0.93,-28.23,0.34,-28.33,0.46,-28.67,0.66,-29.2,0.87,-29.86,1.01,-30.39,0.99,-30.56,0.87,-30.72,0.72,-31.23,0.64,-28.67,0.33,-28.58,0.45,-28.68,0.64,-29.03,0.82,-29.69,0.93,-29.53,0.97,-28.64,0.95,-27.51,0.9,-26.65,0.87,-29.64,0.54,-29.1,0.53,-28.73,0.54,-28.69,0.57,-29.19,0.64,-26.77,0.74,-22.38,1.03,-17.26,1.34,-12.63,1.54,-30.24,0.72,-29.31,0.58,-28.5,0.43,-28.11,0.34,-28.48,0.37,-24.98,0.47,-18.35,0.9,-10.49,1.41,-3.32,1.77,-32.59,0.8,-32.2,0.53,-31.86,0.29,-32.13,0.16,-33.61,0.2,-28.99,0.25,-20.93,0.62,-11.48,1.1,-2.69,1.51,-43.05,0.71,-40.48,0.19,-37.86,-0.33,-36.15,-0.68,-36.33,-0.72,-33.31,-0.66,-27.23,-0.34,-19.84,0.1,-12.92,0.55,-54.92,0.54,-49.87,-0.25,-44.65,-1.03,-40.66,-1.58,-39.29,-1.68,-38.17,-1.63,-34.39,-1.39,-29.41,-1.01,-24.69,-0.55]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20","timeline":[{"name":"B_HAIR_TWIN.20_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.20_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.20_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.20_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.20_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_00","timeline":[{"name":"B_HAIR_TWIN.20","type":50,"frame":[{"duration":121,"value":[13.92,-0.01,13.76,0.01,13.42,0.06,13.08,0.11,12.92,0.14,13.08,0.12,13.42,0.09,13.77,0.06,13.94,0.05,13.92,-0.01,13.79,0.02,13.51,0.09,13.23,0.16,13.09,0.19,13.18,0.17,13.39,0.13,13.6,0.09,13.68,0.08,13.92,-0.02,13.82,0.02,13.61,0.12,13.41,0.21,13.29,0.25,13.36,0.23,13.48,0.17,13.58,0.11,13.62,0.09,13.89,-0.03,13.83,0.02,13.67,0.12,13.49,0.22,13.38,0.26,13.43,0.23,13.51,0.17,13.57,0.11,13.58,0.08,13.87,-0.01,13.89,0.04,13.74,0.12,13.54,0.2,13.41,0.23,13.39,0.2,13.45,0.14,13.51,0.09,13.45,0.06,13.88,0.01,13.95,0.04,13.76,0.1,13.49,0.14,13.31,0.16,13.24,0.13,13.3,0.09,13.35,0.07,13.24,0.05,14.1,0.03,14.05,0.04,13.7,0.07,13.28,0.08,13.03,0.08,12.98,0.06,13.08,0.05,13.17,0.05,13.09,0.04,14.25,0.04,14.06,0.04,13.53,0.04,12.97,0.04,12.68,0.03,12.69,0.03,12.83,0.03,12.97,0.04,12.96,0.04,14.3,0.07,13.98,0.05,13.27,0.01,12.57,-0.03,12.25,-0.05,12.35,-0.03,12.57,0,12.78,0.04,12.85,0.07]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_01","timeline":[{"name":"B_HAIR_TWIN.20","type":50,"frame":[{"duration":121,"value":[6.96,0,6.88,0.01,6.71,0.03,6.54,0.06,6.46,0.07,6.54,0.06,6.71,0.05,6.88,0.03,6.97,0.03,6.96,-0.01,6.89,0.01,6.76,0.04,6.62,0.08,6.55,0.09,6.59,0.09,6.7,0.07,6.8,0.05,6.84,0.04,6.96,-0.01,6.91,0.01,6.81,0.06,6.7,0.1,6.65,0.12,6.68,0.11,6.74,0.08,6.79,0.05,6.81,0.04,6.95,-0.01,6.92,0.01,6.84,0.06,6.75,0.11,6.69,0.13,6.71,0.12,6.75,0.08,6.79,0.05,6.79,0.04,6.94,0,6.95,0.02,6.87,0.06,6.77,0.1,6.7,0.12,6.69,0.1,6.73,0.07,6.75,0.04,6.73,0.03,6.94,0.01,6.97,0.02,6.88,0.05,6.75,0.07,6.66,0.08,6.62,0.06,6.65,0.05,6.68,0.03,6.62,0.02,7.05,0.01,7.03,0.02,6.85,0.03,6.64,0.04,6.51,0.04,6.49,0.03,6.54,0.03,6.58,0.02,6.54,0.02,7.12,0.02,7.03,0.02,6.76,0.02,6.48,0.02,6.34,0.01,6.34,0.01,6.42,0.01,6.48,0.02,6.48,0.02,7.15,0.04,6.99,0.03,6.64,0.01,6.28,-0.01,6.13,-0.03,6.18,-0.02,6.28,0,6.39,0.02,6.43,0.03]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_04","timeline":[{"name":"B_HAIR_TWIN.20","type":50,"frame":[{"duration":121,"value":[-14.43,0.25,-12.8,0.21,-11.34,0.2,-9.91,0.19,-8.4,0.16,-6.94,0.15,-5.37,0.12,-3.74,0.08,-2.13,0.05,-14.25,0.04,-12.7,0.05,-11.26,0.09,-9.84,0.13,-8.31,0.13,-6.96,0.12,-5.46,0.1,-3.88,0.06,-2.29,0.03,-14.38,-0.1,-12.83,-0.04,-11.36,0.04,-9.88,0.11,-8.27,0.13,-7.02,0.12,-5.59,0.09,-4.05,0.05,-2.47,0.01,-14.92,-0.09,-13.33,-0.04,-11.81,0.03,-10.26,0.09,-8.56,0.1,-7.36,0.11,-5.92,0.08,-4.33,0.03,-2.7,-0.01,-15.84,-0.01,-14.14,-0.01,-12.53,0.03,-10.89,0.05,-9.1,0.02,-7.93,0.06,-6.42,0.05,-4.7,0.02,-2.94,-0.01,-16.83,0.11,-14.9,0.05,-13.09,0.03,-11.24,-0.01,-9.24,-0.09,-8.18,0,-6.67,0.01,-4.91,-0.01,-3.11,-0.02,-17.38,0.2,-16.47,0.27,-15.81,0.49,-14.78,0.69,-12.74,0.72,-11.51,0.69,-9,0.43,-5.92,0.13,-2.97,-0.03,-16.83,0.2,-18.73,0.29,-21.06,0.47,-22.5,0.62,-21.69,0.66,-19.15,0.63,-14.13,0.41,-8.06,0.14,-2.4,-0.04,-15.54,0.06,-20.53,0.18,-26.13,0.29,-30.32,0.37,-31.1,0.4,-27.11,0.42,-19.41,0.3,-10.18,0.13,-1.62,-0.04]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21","timeline":[{"name":"B_HAIR_TWIN.21_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.21_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.21_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.21_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.21_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_00","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"value":[5.31,0,6.35,0.04,7.51,0.07,8.77,0.09,10.06,0.11,11.39,0.12,12.79,0.13,14.34,0.12,16.13,0.09,5.18,-0.01,6.29,0.06,7.51,0.11,8.8,0.15,10.13,0.18,11.42,0.19,12.77,0.19,14.23,0.17,15.84,0.13,5.06,-0.01,6.22,0.07,7.46,0.13,8.76,0.17,10.08,0.2,11.36,0.22,12.68,0.23,14.05,0.21,15.51,0.15,4.35,0,5.65,0.09,7.02,0.14,8.37,0.17,9.62,0.2,10.92,0.22,12.31,0.23,13.77,0.21,15.28,0.14,-1.72,0,0.53,0.15,2.89,0.29,5.07,0.4,6.74,0.45,8.4,0.44,10.38,0.35,12.55,0.23,14.82,0.09,-7.94,0.01,-4.75,0.22,-1.4,0.45,1.56,0.64,3.64,0.73,5.71,0.68,8.3,0.5,11.23,0.27,14.31,0.06,-5.81,0.08,-1.17,0.35,3.62,0.77,8.13,1.16,11.91,1.33,13.57,1.39,15.99,1.49,18.86,1.55,21.85,1.51,6.7,0.34,9.39,0.44,12.21,0.64,15.02,0.84,17.71,0.93,19.6,0.99,22.52,1.11,26,1.24,29.57,1.29,20.42,0.6,20.68,0.53,21.03,0.45,21.63,0.39,22.67,0.36,24.88,0.4,28.4,0.5,32.61,0.63,36.86,0.76]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_01","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"offset":54,"value":[-0.49,0,-0.38,0.02,-0.24,0.03,-0.16,0.03,-0.2,0.03,-0.23,0.03,-0.17,0.03,-0.08,0.02,0,0,-5.75,0,-4.74,0.11,-3.63,0.22,-2.73,0.31,-2.36,0.35,-2.1,0.31,-1.47,0.22,-0.7,0.1,0,0,-11,0,-9.1,0.19,-7.01,0.42,-5.29,0.6,-4.51,0.68,-3.97,0.6,-2.77,0.42,-1.32,0.19,0,0,-10.24,0,-8.49,0.18,-6.58,0.38,-4.99,0.56,-4.2,0.63,-3.65,0.56,-2.55,0.38,-1.22,0.17,0,0,-5.32,0,-4.42,0.09,-3.43,0.2,-2.61,0.29,-2.18,0.33,-1.89,0.29,-1.31,0.2,-0.63,0.09]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_03","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"value":[43.85,0.65,42.67,0.84,41.36,1.05,40.3,1.23,39.86,1.3,40.01,1.23,40.36,1.05,40.8,0.84,41.19,0.65,36.37,0.65,35.38,0.38,34.31,-0.35,33.4,-1.1,32.87,-1.44,32.66,-1.1,32.58,-0.35,32.54,0.38,32.49,0.65,28.09,0.65,27.32,0.38,26.51,-0.27,25.76,-0.93,25.17,-1.23,24.8,-0.93,24.48,-0.27,24.18,0.38,23.88,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_04","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"value":[43.85,0.65,42.67,0.84,41.36,1.05,40.3,1.23,39.86,1.3,40.01,1.23,40.36,1.05,40.8,0.84,41.19,0.65,36.37,0.65,35.38,0.38,34.31,-0.35,33.4,-1.1,32.87,-1.44,32.66,-1.1,32.58,-0.35,32.54,0.38,32.49,0.65,28.09,0.65,27.32,0.38,26.51,-0.27,25.76,-0.93,25.17,-1.23,24.8,-0.93,24.48,-0.27,24.18,0.38,23.88,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03","timeline":[{"name":"D_HAIR_TWIN.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.03_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.03_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_00","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[155.94,2.82,77.85,16.35,-47.4,-4.83,-80.69,-6.42,-97.91,5.26,-35.67,16.31,11.56,19.46,27.12,-28.41,-9.2,12.85,-70.62,2.47,-71.36,-0.14,-60.2,-4.73,-68.94,-4.68,-26.74,-9.69,23.51,-7.16]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_01","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[78.1,-1.86,76.94,0.25,-47.4,-4.83,-47.56,-8.2,-1.71,-0.01,-30.58,-0.1,-26.34,18.01,-5.13,-14.65,-28.4,9.21,-38.2,3.36,-37.27,-3.29,-36.82,6.64,-47.49,-6.77,-26.28,-9.74,19.31,-3.25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_03","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[-18.36,3.02,-37.5,-4.02,-3.55,0,-4.55,0,-6.23,0,28.38,7.03,106.35,1,51.56,6.03,68.47,3.93,44.36,0.44,15.4,4.26,51.64,0.5,-4.13,0,23.99,3.01,-11.42,1.6]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_04","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[-18.36,3.02,-37.5,-4.02,-3.55,0,-4.55,0,-6.23,0,28.38,7.03,106.35,1,51.56,6.03,68.47,3.93,44.36,0.44,15.4,4.26,51.64,0.5,-4.13,0,23.99,3.01,-11.42,1.6]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02","timeline":[{"name":"D_HAIR_TWIN.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_00","timeline":[{"name":"D_HAIR_TWIN.02","type":22,"frame":[{"duration":121,"value":[30.57,0.18,30.68,0.18,30.77,0.18,30.82,0.14,29.97,0.08,30.54,0.07,29.45,0.09,27.74,0.07,26.79,0.02,28.57,0.06,29.54,0.09,30.41,0.06,30.54,0.16,30.76,0.18,30.59,0.18,30.72,0.18,30.85,0.12,30.94,0.07,29.55,0.09]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11","timeline":[{"name":"D_HAIR_TWIN.11_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.11_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.11_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.11_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.11_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_00","timeline":[{"name":"D_HAIR_TWIN.11","type":22,"frame":[{"duration":121,"value":[71.53,1.03,71.18,1,71.65,1.04,71.83,1.08,69.76,1.11,68.04,1.12,63.87,1.07,60.06,0.98,61.84,0.87,63.8,0.65,65.91,0.56,69.85,0.75,72.35,1.05,71.65,1.04,71.57,1.04,71.98,1.05,71.98,0.95,68.38,0.87,66.76,0.86]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_01","timeline":[{"name":"D_HAIR_TWIN.11","type":22,"frame":[{"duration":121,"value":[35.76,0.52,35.59,0.5,35.82,0.52,35.92,0.54,34.88,0.55,34.02,0.56,31.93,0.54,30.03,0.49,30.92,0.43,31.9,0.33,32.95,0.28,34.93,0.38,36.18,0.53,35.82,0.52,35.79,0.52,35.99,0.52,35.99,0.47,34.19,0.44,33.38,0.43]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01","timeline":[{"name":"B_HAIR_TWIN.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_00","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-20,41.71,-9.28,31.92,1.66,22.98,10.6,21.04,17,27,23.4,32.96,24.88,30.21,28.3,25.32,32,20.29,-5.06,53.09,0.94,40.3,6.79,28.44,11.84,24.53,14.55,31.7,17.26,38.88,18.07,34.89,20.26,24.6,22.74,13.81,8.41,64.12,10,49.15,11.03,35.02,12.49,29.61,12.03,37.08,11.57,44.54,11.79,39.29,12.85,23.99,14.19,7.82,7.92,64.81,8.32,54.01,9.34,44.13,9.45,41.15,9.87,42.64,10.18,45.18,10.31,38.38,11.45,21.08,12.49,2.82,21.01,52.97,19.19,44.03,17.61,36.63,16.03,35.88,13.75,29.33,11.06,26.91,10.23,21.56,11.06,8.87,11.75,-4.46,37.48,41.96,33.18,33.45,28.54,26.98,25.02,27.68,18.89,14.33,12.05,8.19,10.02,5.8,10.08,-0.7,10.17,-7.52,37.56,27.75,32.68,16.52,30.09,5.47,25.74,3.21,18.37,-9.67,10.57,-13.46,8.14,-10.95,9.29,-9.86,8.91,-8.59,59.14,17.23,49.02,1.21,41.63,-17.96,34.24,-26.77,25.94,-39.69,17.86,-42.89,13.4,-35.05,9.59,-23.94,4.63,-12.01,78.03,5.75,62.8,-13.38,51.28,-39.47,41.11,-53.98,33.29,-67.98,26.31,-71.87,19.73,-59.31,10.08,-38.32,0,-15.71]},{"duration":60,"tweenEasing":0,"value":[-18,69.73,-10.05,56.24,-1.69,43.88,6.43,40.71,11,43.02,15.57,45.33,16.22,41.79,17.07,35.19,18,28.31,-4.11,73.43,0.68,58.21,5.73,44.04,10.52,39.3,12.25,43.42,13.99,47.55,14.37,43.28,15.23,32.83,16.15,21.83,8.72,76.85,10.43,60.61,12.14,45.26,13.81,39.36,13.16,44.57,12.5,49.77,12.66,44.73,13.52,30.68,14.44,15.84,9.84,72.66,10.23,61.05,11.25,50.41,11.37,47.07,11.82,47.75,12.17,49.48,12.31,43.07,13.45,27.38,14.49,10.84,22.01,58.99,20.19,50.06,18.61,42.66,17.07,41.91,15.25,35.35,13.01,32.92,12.23,27.81,13.06,15.98,13.75,3.56,37.56,46.15,33.26,38.45,28.63,32.74,25.19,33.81,19.94,21.25,13.97,15.92,12.02,13.61,12.08,7.21,12.17,0.5,37.78,32.21,32.89,21.77,30.31,11.46,26.04,9.54,19.48,-2.55,12.5,-5.54,10.14,-2.93,11.29,-1.84,10.91,-0.56,60.21,23.4,50.09,7.79,42.7,-11,35.36,-19.62,27.48,-32.14,19.82,-34.92,15.4,-27.02,11.59,-15.92,6.63,-3.99,80.03,13.77,64.8,-5.36,53.28,-31.45,43.11,-45.96,35.29,-59.96,28.31,-63.85,21.73,-51.29,12.08,-30.3,2,-7.69]},{"value":[-118.67,95.76,-106.22,75.26,-93.35,56.59,-78.26,53.13,-66.17,48.3,-55.76,44.31,-47.73,44.54,-39.27,34.1,-30.67,22.34,-70,92.71,-62.25,73.43,-54.54,55.97,-44.67,51.48,-37.64,48.58,-31.67,46.2,-27.04,44.02,-22.77,32.42,-17.71,19.56,-25.2,89.38,-21.86,71.43,-18.94,55.01,-14.05,49.87,-11.75,48.86,-9.87,48.06,-8.4,43.7,-7.66,30.87,-5.73,16.99,-16.57,80.43,-15.68,65.92,-14.85,52.8,-12.96,49.52,-9.8,48.13,-6.75,47.8,-6.13,41.59,-4.08,27.51,-2.01,12.69,-1.65,64.01,-4.65,53.18,-9.35,44.16,-10.53,43.61,-8.09,35.43,-6.06,31.33,-5.99,26.06,-3.45,15.08,-0.92,3.59,16.64,48.44,12.83,39.06,7.7,31.83,4.37,32.77,0.14,19.85,-4.81,14.09,-6,11.61,-3.41,5.3,-0.67,-1.3,16.45,34.02,13.14,21.99,12.12,10.21,8.2,7.79,0.83,-4.31,-6.97,-7.3,-8.77,-4.69,-5.26,-3.59,-3.29,-2.32,36.32,24.35,27.02,7.91,20.44,-11.6,13.28,-20.52,4.98,-33.04,-3.11,-35.82,-7.23,-27.94,-9.8,-16.8,-13.56,-4.89,53.36,13.8,38.14,-5.33,26.61,-31.43,16.45,-45.93,8.63,-59.94,1.64,-63.82,-4.93,-51.26,-14.59,-30.27,-24.67,-7.66]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_01","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-17,6.84,-10.25,3.8,-3.5,1.04,1.39,0.68,5.5,5.49,9.61,10.3,10.77,9.31,13.76,7.72,17,6.13,-9,16.37,-5.38,11.19,-2.1,6.36,0.58,4.9,2.42,9.99,4.27,15.08,4.88,13.26,6.64,8.2,8.67,2.89,-1.95,25.69,-1.21,18.83,-1.06,12.32,-0.42,9.96,-0.55,14.79,-0.68,19.63,-0.54,16.96,0.08,8.67,0.97,-0.1,-2.99,28.48,-2.8,23.5,-2.29,18.95,-2.23,17.62,-2.05,18.77,-1.91,20.44,-1.85,16.9,-1.28,7.43,-0.76,-2.6,4.01,23.47,3.1,19.03,2.31,15.34,1.49,14.93,0.13,11.63,-1.45,10.43,-1.88,7.68,-1.47,0.9,-1.13,-6.24,12.7,18.88,10.55,14.22,8.23,10.61,6.42,10.76,2.93,3.66,-0.93,0.2,-1.99,-1.02,-1.96,-4.31,-1.92,-7.77,12.67,11.65,10.22,5.64,8.94,-0.33,6.73,-1.55,2.63,-8.34,-1.69,-10.65,-2.93,-9.48,-2.35,-8.94,-2.55,-8.3,23.03,5.53,17.95,-2.67,14.29,-12.54,10.58,-16.96,6.2,-23.57,1.94,-25.38,-0.3,-21.53,-2.2,-15.99,-4.69,-10.01,32.01,-1.14,24.4,-10.7,18.64,-23.75,13.56,-31,9.65,-38,6.15,-39.94,2.87,-33.67,-1.96,-23.17,-7,-11.87]},{"duration":60,"tweenEasing":0,"value":[-9,34.86,-5.03,28.12,-0.84,21.94,3.21,20.36,5.5,21.51,7.79,22.66,8.11,20.9,8.54,17.6,9,14.16,-2.06,36.72,0.34,29.09,2.84,21.97,5.26,19.66,6.13,21.71,6.99,23.77,7.18,21.65,7.61,16.42,8.07,10.92,4.36,38.43,5.22,30.28,6.06,22.56,6.91,19.69,6.58,22.28,6.25,24.87,6.33,22.38,6.76,15.35,7.22,7.92,4.92,36.33,5.12,30.53,5.63,25.22,5.68,23.54,5.91,23.87,6.09,24.74,6.15,21.57,6.72,13.71,7.24,5.42,11.01,29.49,10.1,25.05,9.31,21.36,8.53,20.95,7.63,17.65,6.51,16.45,6.12,13.92,6.53,8,6.88,1.78,18.78,23.08,16.63,19.23,14.32,16.38,12.59,16.89,9.97,10.59,6.99,7.94,6.01,6.8,6.04,3.61,6.08,0.25,18.89,16.11,16.44,10.89,15.16,5.67,13.03,4.78,9.74,-1.22,6.24,-2.73,5.07,-1.46,5.65,-0.92,5.45,-0.28,30.11,11.7,25.02,3.91,21.36,-5.57,17.69,-9.81,13.74,-16.01,9.9,-17.41,7.7,-13.5,5.8,-7.97,3.31,-1.99,40.01,6.88,32.4,-2.68,26.64,-15.73,21.56,-22.98,17.65,-29.98,14.15,-31.92,10.87,-25.65,6.04,-15.15,1,-3.84]},{"value":[-91.67,59.89,-81.81,46.6,-71.84,34.54,-61.71,32.48,-53.17,26.41,-44.62,21.61,-37.28,23.64,-30.95,16.51,-24.67,8.18,-52.26,55.46,-45.7,43.39,-39.15,32.48,-32.13,30.04,-27.28,25.71,-22.43,22.17,-18.21,22.42,-15.27,16.01,-11.71,8.65,-16.01,50.85,-12.65,40.02,-9.37,30.18,-5.35,27.53,-3.88,25.01,-2.4,22.8,-1.09,21.35,-0.92,15.52,0.27,9.07,-8.49,44.1,-7.8,35.43,-7.46,27.64,-5.64,25.98,-2.71,24.26,0.16,23.06,0.71,20.07,2.18,13.83,3.75,7.27,0.34,34.52,-1.74,28.22,-5.65,22.94,-6.07,22.66,-2.71,17.71,0.44,14.82,0.89,12.17,3.02,7.1,5.21,1.81,10.86,25.36,9.2,19.85,6.38,15.52,4.76,15.86,3.18,9.15,1.22,6.08,1,4.8,3.55,1.69,6.25,-1.55,10.57,17.92,9.68,11.11,9.98,4.4,8.19,3.03,4.09,-2.97,-0.23,-4.49,-0.85,-3.21,2.1,-2.68,4.26,-2.04,19.22,12.65,14.94,4.04,12.1,-6.2,8.61,-10.71,4.24,-16.91,-0.03,-18.31,-1.93,-14.41,-2.6,-8.86,-3.87,-2.89,26.35,6.91,18.74,-2.65,12.97,-15.7,7.89,-22.95,3.98,-29.95,0.49,-31.9,-2.8,-25.62,-7.63,-15.12,-12.67,-3.82]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_02","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-10,-26.02,-7.22,-22.32,-4.66,-18.9,-3.83,-17.68,-2,-14.02,-0.17,-10.36,0.66,-9.58,3.22,-7.87,6,-6.02,-8.95,-18.35,-7.71,-15.89,-6.94,-13.62,-6.69,-12.75,-5.7,-9.72,-4.72,-6.69,-4.3,-6.39,-2.97,-6.22,-1.41,-6.02,-8.31,-10.74,-8.42,-9.44,-9.11,-8.26,-9.32,-7.73,-9.13,-5.49,-8.93,-3.25,-8.87,-3.4,-8.68,-4.67,-8.25,-6.02,-9.91,-5.85,-9.91,-5.03,-9.91,-4.27,-9.92,-3.92,-9.96,-3.11,-10,-2.3,-10,-2.66,-10,-4.28,-10,-6.02,-9,-4.02,-9,-4.02,-9,-4.02,-9.04,-4.02,-9.5,-4.02,-9.96,-4.02,-10,-4.24,-10,-5.1,-10,-6.02,-8.09,-2.19,-8.09,-3.01,-8.09,-3.77,-8.17,-4.13,-9.04,-4.94,-9.92,-5.74,-10,-5.82,-10,-5.91,-10,-6.02,-8.22,-2.46,-8.22,-3.26,-8.22,-4.01,-8.3,-4.34,-9.11,-5.13,-9.92,-5.92,-10,-6.02,-10,-6.02,-10,-6.02,-9.07,-4.17,-9.07,-4.58,-9.07,-4.97,-9.11,-5.15,-9.54,-5.56,-9.96,-5.97,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-70.67,24.03,-63.39,17.94,-56.32,12.5,-51.16,11.84,-46.17,4.53,-39.49,-1.1,-32.82,2.75,-28.64,-1.09,-24.67,-5.97,-40.51,18.2,-35.15,13.35,-29.74,9.07,-25.59,8.59,-22.92,2.85,-19.2,-1.85,-15.39,0.79,-13.76,-0.42,-11.71,-2.27,-12.82,12.31,-9.44,8.62,-5.79,5.41,-2.66,5.17,-2,1.16,-0.93,-2.44,0.22,-1.03,-0.17,0.15,0.27,1.15,-6.41,7.77,-5.91,4.9,-6.08,2.45,-4.33,2.44,-1.62,0.38,1.08,-1.68,1.56,-1.51,2.45,0.11,3.51,1.86,-3.67,5.03,-4.83,3.19,-7.95,1.65,-7.61,1.72,-3.34,0.03,0.93,-1.65,1.77,-1.76,3.48,-0.9,5.33,0.03,-0.92,2.29,-0.43,0.64,-0.94,-0.82,-0.83,-1.01,0.2,-1.45,1.24,-1.88,1.99,-2,4.51,-1.91,7.16,-1.8,-1.32,1.81,0.24,0.21,1.82,-1.28,2.16,-1.75,1.35,-1.75,0.53,-1.75,1.08,-1.75,3.45,-1.75,5.8,-1.75,-3.89,0.95,-3.08,0.13,-2.26,-0.65,-2.08,-0.9,-2.5,-0.9,-2.92,-0.9,-2.64,-0.9,-1.39,-0.9,-0.19,-0.9,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_03","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-2.67,-29.48,-0.35,-26.39,1.79,-23.13,2.24,-14.04,3.29,0.89,3.64,16.87,3.36,28.95,4.79,40.76,6.33,53.09,-2.68,-20.01,-2.99,-14.84,-4.05,-9.64,-4.71,-1.4,-5.19,13.64,-6.74,29.17,-7.5,37.31,-6.56,41.89,-5.24,46.49,-3.89,-10.41,-6.6,-4.45,-10.46,1.33,-12.09,8.16,-13.69,24.24,-16.75,40.26,-17.9,44.96,-17.19,42.71,-15.93,39.95,-9.77,-3.1,-11.9,2.29,-13.93,7.48,-15.37,12.55,-16.52,26.94,-19.01,41.01,-20.11,44.56,-19.55,40.37,-18.54,35.4,-0.29,-0.87,-2.83,4.21,-5.31,9.24,-8.18,13.99,-10.75,21.77,-13.53,29.55,-14.78,33.13,-16.29,31.8,-17.17,29.91,8.76,-0.74,5.54,4.03,2.18,8.9,-2.34,13.57,-7.28,15.55,-11.33,17.83,-12.31,21.69,-14.11,23.22,-15.8,24.43,11.91,-3,7.9,1.31,3.76,5.7,-1.77,10.36,-7.21,13.35,-11.18,16.66,-11.92,20.93,-13.59,22.33,-15.78,23.36,16.57,-6.42,11.48,-1.83,6.22,2.74,-0.1,7.33,-4.97,12.94,-8.04,18.72,-9.13,22.68,-12.47,22.2,-16.2,21.23,21.33,-10.12,15.11,-5.14,8.68,-0.3,1.51,4.27,-3.04,12.39,-5.49,20.51,-6.87,24.18,-11.57,21.86,-16.67,18.91]},{"duration":60,"tweenEasing":0,"value":[7.33,-3.46,6.87,-4.07,6.44,-4.23,6.07,3.63,5.29,14.91,3.81,27.23,2.71,38.53,1.57,48.63,0.33,59.11,6.27,-1.67,4.71,1.04,2.89,3.96,1.97,11.35,0.51,23.36,-2.02,35.87,-3.2,43.69,-3.59,48.11,-3.83,52.51,4.43,0.33,1.82,4.98,-1.35,9.58,-2.76,15.89,-4.58,29.73,-7.83,43.51,-9.03,48.38,-8.52,47.39,-7.68,45.97,0.15,2.75,-1.98,7.33,-4.01,11.74,-5.45,16.47,-6.57,30.05,-9.01,43.31,-10.11,47.22,-9.55,44.65,-8.54,41.42,8.71,3.15,6.17,8.24,3.69,13.27,0.86,18.01,-1.25,25.79,-3.58,33.56,-4.78,37.37,-6.29,36.89,-7.17,35.93,16.85,1.45,13.62,7.04,10.27,12.67,5.83,17.7,1.76,20.48,-1.41,23.57,-2.31,27.51,-4.11,29.13,-5.8,30.45,20.13,-0.54,16.12,4.57,11.98,9.71,6.53,14.7,1.89,18.48,-1.26,22.59,-1.92,26.95,-3.59,28.35,-5.78,29.39,25.64,-2.25,20.55,2.75,15.3,7.71,9.01,12.48,4.57,18.5,1.92,24.68,0.87,28.71,-2.47,28.23,-6.2,27.25,31.33,-4.1,25.11,0.88,18.68,5.72,11.51,10.29,6.96,18.41,4.51,26.54,3.13,30.2,-1.57,27.88,-6.67,24.93]},{"value":[-56.33,19.57,-47.67,13.33,-39.32,8.16,-34.05,15.43,-29.38,18.93,-23.72,25.18,-18.66,40.28,-17.76,46.54,-17.33,52.14,-27.25,15.53,-21.76,13.61,-16.71,12.51,-13.11,19.43,-12.07,25.26,-11.05,32.62,-8.78,43.07,-8.84,46.47,-8.54,49.24,-1.4,11.63,0.85,12.62,2.62,14.11,4.61,20.15,2.67,29.49,-0.27,39.21,-0.51,45.59,-0.94,46.15,-0.41,46.12,0.74,9.52,0.4,11.24,-0.54,13.19,0.01,17.85,0.71,28.95,0.1,39.72,-0.7,43.88,0.33,43.33,1.97,42.27,12.04,7.18,9.03,10.45,4.1,13.89,1.72,18.68,3.41,24.57,4.89,30.46,4.43,34.17,4.42,34.76,5.17,34.96,22.92,2.74,20.29,6.69,16.47,10.83,12.13,15.67,9.06,18.01,6.87,20.66,6.72,24.46,7.44,26.19,8.37,27.65,25.81,0.27,23.36,3.78,20.8,7.43,15.69,11.94,10.24,15.73,6.27,19.83,6.16,24.2,6.86,25.6,7.03,26.63,28.75,-2.3,24.47,1.88,20.04,6.07,13.94,10.58,9.07,16.6,5.99,22.78,5.23,26.8,3.13,26.33,0.61,25.35,31.67,-5.08,25.44,-0.1,19.01,4.75,11.84,9.32,7.29,17.44,4.85,25.56,3.46,29.23,-1.24,26.91,-6.33,23.96]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_04","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[4.67,-32.94,6.52,-30.46,8.23,-27.36,8.3,-10.41,8.57,15.79,7.45,44.1,6.07,67.49,6.36,89.38,6.67,112.2,3.59,-21.68,1.73,-13.8,-1.15,-5.69,-2.74,9.95,-4.69,37,-8.76,65.03,-10.7,80.99,-10.15,90.01,-9.07,98.99,0.54,-10.09,-4.79,0.54,-11.8,10.9,-14.85,24.05,-18.27,53.96,-24.58,83.77,-26.93,93.26,-25.68,90.06,-23.61,85.92,-9.62,-0.35,-13.88,9.62,-17.94,19.22,-20.82,29,-23.09,56.99,-28.01,84.34,-30.22,91.77,-29.1,85.03,-27.08,76.81,8.42,2.29,3.33,12.45,-1.62,22.52,-7.31,32,-12.01,47.55,-17.12,63.11,-19.57,70.49,-22.59,68.69,-24.33,65.84,25.61,0.71,19.16,11.07,12.44,21.57,3.5,31.28,-5.5,36.03,-12.75,41.41,-14.61,49.2,-18.21,52.35,-21.59,54.87,32.04,-3.54,24.02,5.88,15.72,15.42,4.76,25.07,-5.33,31.84,-12.45,39.24,-13.84,47.88,-17.17,50.69,-21.55,52.75,42.21,-8.67,32.03,0.92,21.5,10.45,8.91,19.81,-0.41,31.45,-6.12,43.4,-8.27,51.38,-14.94,50.44,-22.41,48.47,52.67,-14.23,40.22,-4.27,27.35,5.42,13.02,14.56,3.92,30.81,-0.97,47.05,-3.74,54.39,-13.15,49.75,-23.33,43.84]},{"duration":60,"tweenEasing":0,"value":[14.67,-6.92,13.74,-8.15,12.89,-8.46,12.13,7.27,10.57,29.81,7.62,54.47,5.42,77.07,3.14,97.26,0.67,118.22,12.53,-3.34,9.41,2.06,5.78,7.88,3.94,22.7,1,46.72,-4.05,71.74,-6.4,87.37,-7.18,96.23,-7.67,105.01,8.85,0.65,3.62,9.97,-2.69,19.15,-5.53,31.78,-9.16,59.45,-15.67,87.02,-18.06,96.69,-17.02,94.76,-15.36,91.94,0.3,5.5,-3.96,14.65,-8.03,23.49,-10.9,32.92,-13.13,60.09,-18.02,86.63,-20.22,94.44,-19.1,89.31,-17.08,82.83,17.42,6.31,12.33,16.47,7.38,26.54,1.73,36.02,-2.51,51.58,-7.16,67.13,-9.57,74.73,-12.59,73.79,-14.33,71.86,33.69,2.9,27.25,14.08,20.54,25.35,11.67,35.4,3.54,40.97,-2.83,47.15,-4.61,55.02,-8.21,58.26,-11.59,60.9,40.26,-1.08,32.24,9.13,23.94,19.43,13.05,29.4,3.78,36.96,-2.52,45.16,-3.84,53.9,-7.17,56.71,-11.55,58.77,51.29,-4.5,41.1,5.5,30.58,15.42,18.02,24.96,9.13,37,3.84,49.37,1.73,57.4,-4.94,56.46,-12.41,54.49,62.67,-8.21,50.22,1.76,37.35,11.44,23.02,20.59,13.92,36.83,9.03,53.07,6.26,60.41,-3.15,55.77,-13.33,49.86]},{"value":[-42,15.11,-31.94,8.72,-22.31,3.81,-16.94,19.02,-12.59,33.34,-7.95,51.45,-4.5,77.82,-6.87,94.17,-10,110.24,-13.98,12.87,-8.36,13.85,-3.68,15.94,-0.63,30.27,-1.24,47.68,-2.92,67.09,-2.17,85.34,-3.93,93.37,-5.37,100.74,10.03,10.96,11.14,16.63,11.04,22.8,11.88,35.12,7.35,57.83,0.4,80.86,-1.24,92.16,-1.71,92.13,-1.09,91.09,7.89,11.27,6.71,17.56,5,23.94,4.35,33.25,3.05,57.51,-0.87,81.14,-2.97,89.27,-1.79,86.56,0.43,82.69,27.75,9.34,22.89,17.69,16.14,26.15,11.05,35.65,10.15,49.11,8.84,62.56,7.09,70.08,5.36,70.43,5,69.89,46.77,3.19,41.01,12.73,33.88,22.48,25.1,32.37,17.93,37.48,12.5,43.2,11.46,50.91,10.36,54.3,9.57,57.09,52.94,-1.27,46.48,7.34,39.75,16.16,29.21,25.65,19.13,33.21,12.01,41.41,11.25,50.14,10.28,52.96,8.25,55.02,61.4,-5.55,52.02,3.62,42.31,12.78,29.95,22.06,20.63,34.11,14.91,46.47,13.1,54.48,7.66,53.57,1.41,51.59,70,-10.18,57.55,-0.22,44.69,9.46,30.36,18.61,21.25,34.86,16.36,51.1,13.59,58.44,4.18,53.8,-6,47.89]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08","timeline":[{"name":"B_HAIR_TWIN.08_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.08_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.08_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.08_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.08_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_00","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-43.39,6.37,-47.11,6.34,-50.46,6.31,-53.48,6.26,-56.2,6.21,-58.78,6.16,-61.37,6.1,-63.97,6.01,-66.59,5.89,-43.08,6.38,-46.79,6.33,-50.13,6.28,-53.13,6.23,-55.84,6.18,-58.42,6.11,-61.01,6.01,-63.6,5.9,-66.21,5.79,-42.78,6.36,-46.49,6.29,-49.8,6.22,-52.78,6.14,-55.49,6.08,-58.07,6.02,-60.65,5.93,-63.24,5.83,-65.83,5.74,-42.5,6.32,-46.2,6.23,-49.49,6.13,-52.44,6.05,-55.14,5.98,-57.72,5.92,-60.3,5.86,-62.88,5.79,-65.46,5.72,-42.23,6.23,-45.92,6.13,-49.18,6.04,-52.1,5.96,-54.77,5.9,-57.36,5.85,-59.94,5.8,-62.52,5.76,-65.09,5.72,-42.14,6.15,-45.76,6.07,-48.95,6,-51.81,5.93,-54.45,5.88,-56.88,5.84,-59.32,5.81,-61.77,5.79,-64.24,5.75,-41.94,6.12,-45.46,6.05,-48.53,5.99,-51.28,5.94,-53.85,5.9,-56.24,5.86,-58.64,5.84,-61.06,5.82,-63.53,5.78,-41.67,6.1,-45.04,6.05,-47.96,6.01,-50.56,5.98,-53,5.95,-55.44,5.91,-57.9,5.88,-60.4,5.84,-62.96,5.79,-41.36,6.1,-44.54,6.07,-47.26,6.05,-49.66,6.04,-51.93,6.03,-54.52,5.98,-57.13,5.93,-59.8,5.87,-62.54,5.8]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_01","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-2.98,0.21,-5.56,0.16,-8.15,0.11,-10.73,0.06,-13.31,0.01,-15.9,-0.04,-18.48,-0.09,-21.06,-0.15,-23.65,-0.2,-2.62,0.2,-5.2,0.15,-7.78,0.1,-10.36,0.05,-12.95,0,-15.53,-0.05,-18.11,-0.1,-20.7,-0.15,-23.28,-0.2,-2.25,0.2,-4.83,0.15,-7.41,0.1,-10,0.05,-12.58,0,-15.16,-0.05,-17.75,-0.1,-20.33,-0.15,-22.91,-0.2,-1.88,0.2,-4.47,0.15,-7.05,0.1,-9.63,0.05,-12.21,0,-14.8,-0.05,-17.38,-0.1,-19.96,-0.15,-22.55,-0.2,-1.52,0.2,-4.1,0.15,-6.68,0.1,-9.26,0.05,-11.85,0,-14.43,-0.05,-17.01,-0.1,-19.6,-0.15,-22.18,-0.2,-1.15,0.2,-3.73,0.15,-6.32,0.1,-8.9,0.05,-11.48,0,-14.06,-0.05,-16.65,-0.1,-19.23,-0.15,-21.81,-0.2,-0.78,0.2,-3.37,0.15,-5.95,0.1,-8.53,0.05,-11.11,0,-13.7,-0.05,-16.28,-0.1,-18.86,-0.15,-21.45,-0.2,-0.42,0.2,-3,0.15,-5.58,0.1,-8.17,0.05,-10.75,0,-13.33,-0.05,-15.91,-0.1,-18.5,-0.15,-21.08,-0.2,-0.05,0.2,-2.63,0.15,-5.22,0.09,-7.8,0.04,-10.38,-0.01,-12.96,-0.06,-15.55,-0.11,-18.13,-0.16,-20.71,-0.21]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_03","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-17.31,-2.66,-16.3,-3.22,-15.15,-3.78,-13.92,-4.36,-12.64,-4.97,-11.64,-5.65,-11.22,-6.33,-11.14,-7.01,-11.17,-7.67,-14.38,-2.78,-12.69,-3.37,-10.89,-3.96,-9.11,-4.56,-7.52,-5.19,-6.78,-5.84,-6.73,-6.49,-7.06,-7.13,-7.49,-7.76,-11.47,-2.9,-9.07,-3.52,-6.57,-4.13,-4.22,-4.74,-2.26,-5.38,-1.78,-6.01,-2.05,-6.64,-2.75,-7.27,-3.55,-7.87,-8.51,-2.97,-5.58,-3.61,-2.56,-4.24,0.19,-4.87,2.32,-5.5,2.76,-6.12,2.33,-6.74,1.43,-7.35,0.43,-7.93,-5.44,-2.93,-2.37,-3.59,0.76,-4.25,3.51,-4.9,5.45,-5.53,6.2,-6.14,5.95,-6.72,5.15,-7.29,4.26,-7.86,-3.42,-2.99,-0.58,-3.6,2.32,-4.23,4.94,-4.87,6.95,-5.5,7.6,-6.09,7.51,-6.66,6.99,-7.23,6.36,-7.79,-1.34,-3.02,1.02,-3.57,3.44,-4.14,5.7,-4.72,7.55,-5.32,8.38,-5.92,8.69,-6.53,8.68,-7.14,8.54,-7.72,0.78,-3.05,2.55,-3.53,4.4,-4.01,6.19,-4.52,7.78,-5.08,8.89,-5.7,9.72,-6.37,10.32,-7.03,10.78,-7.65,2.91,-3.09,4.14,-3.48,5.44,-3.88,6.79,-4.32,8.14,-4.84,9.51,-5.49,10.82,-6.2,12.02,-6.92,13.06,-7.57]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_04","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-29.22,-2.23,-26.6,-3.42,-23.92,-4.53,-21.25,-5.75,-18.71,-7.26,-16.49,-7.62,-14.86,-8.13,-13.71,-8.71,-12.91,-9.25,-24.22,-4.19,-21.15,-5.26,-18.01,-6.22,-14.97,-7.26,-12.17,-8.54,-10.4,-8.78,-9.55,-9.02,-9.31,-9.28,-9.4,-9.58,-19.07,-6.36,-15.58,-7.27,-12.04,-8.03,-8.66,-8.83,-5.63,-9.86,-4.31,-9.98,-4.19,-9.96,-4.84,-9.94,-5.78,-10.01,-14.08,-7.97,-10.3,-8.76,-6.49,-9.4,-2.9,-10.04,0.21,-10.84,1.31,-10.86,0.86,-10.65,-0.49,-10.38,-2.11,-10.25,-9.55,-8.3,-5.71,-9.05,-1.87,-9.77,1.69,-10.46,4.68,-11.11,5.97,-11.09,5.31,-10.74,3.55,-10.3,1.55,-10.01,-8.3,-8.22,-4.89,-8.88,-1.51,-9.55,1.67,-10.19,4.51,-10.76,5.52,-10.74,4.94,-10.41,3.42,-10.01,1.61,-9.8,-7.77,-8.05,-4.92,-8.57,-2.16,-9.1,0.51,-9.61,3.06,-10.05,4.27,-10.1,4.17,-9.92,3.25,-9.7,1.96,-9.62,-7.48,-7.85,-5.29,-8.21,-3.23,-8.56,-1.18,-8.88,0.99,-9.18,2.63,-9.32,3.23,-9.35,3.1,-9.36,2.53,-9.44,-6.94,-7.69,-5.47,-7.89,-4.17,-8.04,-2.78,-8.18,-1.05,-8.32,1.04,-8.55,2.37,-8.78,3.07,-9,3.24,-9.24]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02","timeline":[{"name":"B_HAIR_TWIN.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_00","timeline":[{"name":"B_HAIR_TWIN.02","type":50,"frame":[{"duration":121,"offset":20,"value":[-1.03,-0.19,-2.06,-0.6,-3.08,-1.01,-4.11,-1.19,-4.23,-1.25,-5.44,-1.41,-7.09,-1.68,-8.53,-2.05,0,0,-0.82,-0.15,-1.64,-0.48,-2.47,-0.81,-3.29,-0.96,-4.62,-1.26,-8.11,-2.03,-12.47,-3,-16.41,-3.94,-0.23,-0.05,-0.2,-0.02,-0.18,-0.01,-0.16,0,-0.17,0,-2.38,-0.48,-6.98,-1.64,-12.55,-3.04,-17.63,-4.23,-2.63,-0.63,-2.44,-0.44,-2.22,-0.24,-2.05,-0.07,-1.97,0,-2.77,-0.24,-4.69,-0.83,-7.06,-1.56,-9.21,-2.21,-5.04,-1.21,-4.67,-0.86,-4.26,-0.47,-3.93,-0.14,-3.78,0,-3.2,0,-2.43,-0.02,-1.59,-0.08,-0.79,-0.19,-4.69,-1.13,-4.35,-0.82,-3.98,-0.44,-3.67,-0.13,-3.52,0,-3.06,0,-2.13,0,-1.02,0,0,0,-2.44,-0.59,-2.26,-0.43,-2.07,-0.23,-1.91,-0.07,-1.83,0,-1.58,0,-1.1,0,-0.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_01","timeline":[{"name":"B_HAIR_TWIN.02","type":50,"frame":[{"duration":121,"offset":20,"value":[-1.03,-0.19,-2.06,-0.6,-3.08,-1.01,-4.11,-1.19,-4.23,-1.25,-5.44,-1.41,-7.09,-1.68,-8.53,-2.05,0,0,-0.82,-0.15,-1.64,-0.48,-2.47,-0.81,-3.29,-0.96,-4.62,-1.26,-8.11,-2.03,-12.47,-3,-16.41,-3.94,-0.23,-0.05,-0.2,-0.02,-0.18,-0.01,-0.16,0,-0.17,0,-2.38,-0.48,-6.98,-1.64,-12.55,-3.04,-17.63,-4.23,-2.63,-0.63,-2.44,-0.44,-2.22,-0.24,-2.05,-0.07,-1.97,0,-2.77,-0.24,-4.69,-0.83,-7.06,-1.56,-9.21,-2.21,-5.04,-1.21,-4.67,-0.86,-4.26,-0.47,-3.93,-0.14,-3.78,0,-3.2,0,-2.43,-0.02,-1.59,-0.08,-0.79,-0.19,-4.69,-1.13,-4.35,-0.82,-3.98,-0.44,-3.67,-0.13,-3.52,0,-3.06,0,-2.13,0,-1.02,0,0,0,-2.44,-0.59,-2.26,-0.43,-2.07,-0.23,-1.91,-0.07,-1.83,0,-1.58,0,-1.1,0,-0.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09","timeline":[{"name":"B_HAIR_TWIN.09_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.09_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.09_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.09_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.09_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_00"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10","timeline":[{"name":"B_HAIR_TWIN.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.10_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.10_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_00","timeline":[{"name":"B_HAIR_TWIN.10","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,11.31,-0.26,12.17,0.16,12.87,0.49,13.16,0.63,10.71,0.56,4.77,0.39,-2.57,0.19,-9.21,0,1.39,-0.34,1.82,-0.12,2.3,0.1,2.68,0.27,2.8,0.34,-3.61,0.3,-10.88,0.22,-16.9,0.11,-19.57,0,-7.05,-0.07,-6.95,0,-6.83,0.04,-6.74,0.06,-6.77,0.07,-17.15,0.07,-25.74,0.05,-30.43,0.03,-29.14,0,-9.21,0,-8.33,-0.04,-7.45,-0.14,-6.57,-0.24,-5.68,-0.29,-17.32,-0.24,-26.59,-0.14,-31.69,-0.04,-30.79,0,-9.21,0,-8.4,-0.13,-7.59,-0.41,-6.77,-0.7,-5.96,-0.83,-9.97,-0.7,-14.85,-0.41,-19.39,-0.13,-22.37,0,-9.21,0,-9.38,-0.07,-9.55,-0.22,-9.72,-0.37,-9.89,-0.44,-5.09,-0.37,-4.56,-0.22,-7.71,-0.07,-13.95,0,-7.48,0.07,-7.64,0.04,-7.82,0.01,-7.95,0,-7.92,0,-2.72,0,-2.7,0,-6.93,0,-14.46,0,-0.73,0.34,-1.38,0.23,-2.1,0.12,-2.67,0.03,-2.85,0,-1.65,0,-5.22,0,-11.77,0,-19.52,0,6.58,0.63,5.41,0.44,4.11,0.24,3.06,0.07,2.63,0,-0.39,0,-7.73,0,-16.8,0,-25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_01","timeline":[{"name":"B_HAIR_TWIN.10","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,11.31,-0.26,12.17,0.16,12.87,0.49,13.16,0.63,10.71,0.56,4.77,0.39,-2.57,0.19,-9.21,0,1.39,-0.34,1.82,-0.12,2.3,0.1,2.68,0.27,2.8,0.34,-3.61,0.3,-10.88,0.22,-16.9,0.11,-19.57,0,-7.05,-0.07,-6.95,0,-6.83,0.04,-6.74,0.06,-6.77,0.07,-17.15,0.07,-25.74,0.05,-30.43,0.03,-29.14,0,-9.21,0,-8.33,-0.04,-7.45,-0.14,-6.57,-0.24,-5.68,-0.29,-17.32,-0.24,-26.59,-0.14,-31.69,-0.04,-30.79,0,-9.21,0,-8.4,-0.13,-7.59,-0.41,-6.77,-0.7,-5.96,-0.83,-9.97,-0.7,-14.85,-0.41,-19.39,-0.13,-22.37,0,-9.21,0,-9.38,-0.07,-9.55,-0.22,-9.72,-0.37,-9.89,-0.44,-5.09,-0.37,-4.56,-0.22,-7.71,-0.07,-13.95,0,-7.48,0.07,-7.64,0.04,-7.82,0.01,-7.95,0,-7.92,0,-2.72,0,-2.7,0,-6.93,0,-14.46,0,-0.73,0.34,-1.38,0.23,-2.1,0.12,-2.67,0.03,-2.85,0,-1.65,0,-5.22,0,-11.77,0,-19.52,0,6.58,0.63,5.41,0.44,4.11,0.24,3.06,0.07,2.63,0,-0.39,0,-7.73,0,-16.8,0,-25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11","timeline":[{"name":"B_HAIR_TWIN.11_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.11_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.11_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.11_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.11_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_00","timeline":[{"name":"B_HAIR_TWIN.11","type":50,"frame":[{"duration":121,"offset":10,"value":[-2.45,-0.07,-8.39,-0.24,-15.73,-0.44,-22.37,-0.63,0,0,0,0,0,0,0,0,0,0,-7,-0.17,-15.54,-0.59,-23.89,-1.09,-30.29,-1.51,0,0,0,0,0,0,0,0,0,0,-11.33,-0.27,-22.31,-0.91,-31.53,-1.67,-37.61,-2.32,0,0,0,0,0,0,0,0,0,0,-12.56,-0.28,-23.72,-0.94,-32.47,-1.74,-37.78,-2.42,0,0,0,0,0,0,0,0,0,0,-6.79,-0.14,-12.74,-0.47,-17.26,-0.89,-19.74,-1.26,0,0,0,0,0,0,0,0,0,0,-0.9,0,-1.59,-0.01,-1.9,-0.05,-1.7,-0.11]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_01","timeline":[{"name":"B_HAIR_TWIN.11","type":50,"frame":[{"duration":121,"offset":10,"value":[-2.45,-0.07,-8.39,-0.24,-15.73,-0.44,-22.37,-0.63,0,0,0,0,0,0,0,0,0,0,-7,-0.17,-15.54,-0.59,-23.89,-1.09,-30.29,-1.51,0,0,0,0,0,0,0,0,0,0,-11.33,-0.27,-22.31,-0.91,-31.53,-1.67,-37.61,-2.32,0,0,0,0,0,0,0,0,0,0,-12.56,-0.28,-23.72,-0.94,-32.47,-1.74,-37.78,-2.42,0,0,0,0,0,0,0,0,0,0,-6.79,-0.14,-12.74,-0.47,-17.26,-0.89,-19.74,-1.26,0,0,0,0,0,0,0,0,0,0,-0.9,0,-1.59,-0.01,-1.9,-0.05,-1.7,-0.11]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12","timeline":[{"name":"B_HAIR_TWIN.12_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.12_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.12_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.12_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.12_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_00"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13","timeline":[{"name":"B_HAIR_TWIN.13_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.13_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.13_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.13_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.13_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_00","timeline":[{"name":"B_HAIR_TWIN.13","type":50,"frame":[{"duration":121,"offset":20,"value":[1.23,-0.08,2.57,-0.18,3.69,-0.26,4.26,-0.29,1.37,-0.33,-4.06,-0.41,-10.51,-0.51,-16.45,-0.59,0,0,2.38,-0.16,4.97,-0.34,7.13,-0.5,8.2,-0.56,2.69,-0.63,-7.76,-0.79,-20.2,-0.97,-31.65,-1.13,0,0,2.58,-0.17,5.42,-0.37,7.75,-0.54,8.82,-0.6,3.25,-0.67,-8.2,-0.84,-21.98,-1.04,-34.6,-1.21,0,0,1.37,-0.09,2.88,-0.2,4.1,-0.28,4.61,-0.32,0.66,-0.35,-6.62,-0.44,-15.24,-0.54,-23.2,-0.63,0,0,0.15,-0.02,0.34,-0.02,0.46,-0.03,0.4,-0.03,-0.34,-0.03,-1.95,-0.03,-3.9,-0.04,-5.68,-0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_01","timeline":[{"name":"B_HAIR_TWIN.13","type":50,"frame":[{"duration":121,"offset":20,"value":[1.23,-0.08,2.57,-0.18,3.69,-0.26,4.26,-0.29,1.37,-0.33,-4.06,-0.41,-10.51,-0.51,-16.45,-0.59,0,0,2.38,-0.16,4.97,-0.34,7.13,-0.5,8.2,-0.56,2.69,-0.63,-7.76,-0.79,-20.2,-0.97,-31.65,-1.13,0,0,2.58,-0.17,5.42,-0.37,7.75,-0.54,8.82,-0.6,3.25,-0.67,-8.2,-0.84,-21.98,-1.04,-34.6,-1.21,0,0,1.37,-0.09,2.88,-0.2,4.1,-0.28,4.61,-0.32,0.66,-0.35,-6.62,-0.44,-15.24,-0.54,-23.2,-0.63,0,0,0.15,-0.02,0.34,-0.02,0.46,-0.03,0.4,-0.03,-0.34,-0.03,-1.95,-0.03,-3.9,-0.04,-5.68,-0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14","timeline":[{"name":"B_HAIR_TWIN.14_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.14_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.14_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.14_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.14_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_00","timeline":[{"name":"B_HAIR_TWIN.14","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,3.89,-0.63,-3.45,-0.63,-9.4,-0.63,-11.84,-0.63,-13.86,-0.7,-18.75,-0.87,-24.8,-1.08,-30.27,-1.26,10.53,-0.63,4.39,-0.61,-2.23,-0.57,-7.9,-0.53,-11.18,-0.51,-16.4,-0.28,-23.97,0.22,-32.49,0.7,-40.53,0.87,10.53,-0.63,6.98,-0.63,3.11,-0.61,-0.11,-0.6,-1.73,-0.59,-6.1,-0.41,-12.87,-0.02,-20.6,0.37,-27.85,0.53,10.53,-0.63,8.69,-0.63,6.66,-0.63,5,-0.63,4.23,-0.63,2.33,-0.63,-2.18,-0.64,-7.73,-0.64,-12.76,-0.66,10.53,-0.63,9.55,-0.63,8.47,-0.63,7.6,-0.63,7.24,-0.63,5.51,-0.67,1.32,-0.75,-3.87,-0.85,-8.55,-0.95,10.53,-0.63,10.42,-0.63,10.28,-0.63,10.2,-0.63,10.25,-0.63,8.69,-0.7,4.81,-0.87,0,-1.06,-4.34,-1.24,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,8.79,-0.7,5.4,-0.86,1.35,-1.04,-2.36,-1.19,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,9.6,-0.67,7.85,-0.75,5.75,-0.85,3.83,-0.92,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_01","timeline":[{"name":"B_HAIR_TWIN.14","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,3.89,-0.63,-3.45,-0.63,-9.4,-0.63,-11.84,-0.63,-13.86,-0.7,-18.75,-0.87,-24.8,-1.08,-30.27,-1.26,10.53,-0.63,4.39,-0.61,-2.23,-0.57,-7.9,-0.53,-11.18,-0.51,-16.4,-0.28,-23.97,0.22,-32.49,0.7,-40.53,0.87,10.53,-0.63,6.98,-0.63,3.11,-0.61,-0.11,-0.6,-1.73,-0.59,-6.1,-0.41,-12.87,-0.02,-20.6,0.37,-27.85,0.53,10.53,-0.63,8.69,-0.63,6.66,-0.63,5,-0.63,4.23,-0.63,2.33,-0.63,-2.18,-0.64,-7.73,-0.64,-12.76,-0.66,10.53,-0.63,9.55,-0.63,8.47,-0.63,7.6,-0.63,7.24,-0.63,5.51,-0.67,1.32,-0.75,-3.87,-0.85,-8.55,-0.95,10.53,-0.63,10.42,-0.63,10.28,-0.63,10.2,-0.63,10.25,-0.63,8.69,-0.7,4.81,-0.87,0,-1.06,-4.34,-1.24,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,8.79,-0.7,5.4,-0.86,1.35,-1.04,-2.36,-1.19,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,9.6,-0.67,7.85,-0.75,5.75,-0.85,3.83,-0.92,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01","timeline":[{"name":"D_HAIR_TWIN.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_00","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":550}]},{"name":"D_HAIR_TWIN.01","type":22,"frame":[{"duration":121,"value":[82.47,-8.71,18.8,-7.24,-17.76,-0.07,-43.52,0,27.66,1.51,51.4,1.5,18.69,0.09,10.7,0.86,34.75,0.78,-11.72,0.04,-1.02,0,-29.95,-0.04,47.64,-3.91,31.35,-4.3,45.12,-7.85,1.03,-3.75]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_01","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_02","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_03","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]},{"name":"D_HAIR_TWIN.01","type":22,"frame":[{"duration":121,"value":[-77.6,13.12,-161.4,-30.15,1.86,-5.77,12.57,-4.81,-6.13,5.71,30.68,9.4,11.96,-3.09,22.91,3.31,21.15,3.04,12.26,-3.93,6.5,-4.54,6.93,-5.32,-18.55,-1.94,-46.43,-17.13,-134.12,-14.54,-89.02,-30.45]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_04","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]},{"name":"D_HAIR_TWIN.01","type":22,"frame":[{"duration":121,"value":[-57.19,6.66,-116.21,-24.58,-15.93,-34.98,9.22,-7.28,-2.8,9.22,75.94,16.52,25.87,1.58,47.34,6.32,49.47,4.97,16.73,-6.72,-5.17,-17.16,8.93,-18.22,-3.91,-5.47,-40.61,-15.06,-111.97,-6.41,-79.83,-33.74]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00","timeline":[{"name":"D_HAIR_TWIN.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_00"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04","timeline":[{"name":"D_HAIR_TWIN.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_00","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":410}]},{"name":"D_HAIR_TWIN.04","type":22,"frame":[{"duration":121,"offset":14,"value":[-6.84,-3.25,-11.01,-7.53,2.49,-6.91,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.96,-4.15]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_01","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":410}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_02","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_03","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":510}]},{"name":"D_HAIR_TWIN.04","type":22,"frame":[{"duration":121,"value":[-7.61,-0.32,-7.59,-0.32,-8.26,-0.3,-8.29,-0.32,-8.71,-0.35,-9.63,-0.34,-9.69,-0.34,-9.49,-0.4,-9.38,-0.55,-9.38,-0.51,-9.14,-0.56,-9.38,-0.51,-9.29,-0.39,-9.11,-0.37,-8.95,-0.39,-8.73,-0.35,2,-2.22,-8.1,-0.33,-6.99,-0.27,-9.51,-0.41,-9.24,-0.39,-8.77,-0.35,-9.44,-0.44,-8.66,-0.35,-2.96,-2.21,-9.12,-0.38,-9.51,-0.41,-9.44,-0.41,-9.38,-0.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_04","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":510}]},{"name":"D_HAIR_TWIN.04","type":22,"frame":[{"duration":121,"value":[-15.22,-0.65,-15.19,-0.63,-16.52,-0.6,-16.58,-0.64,-17.43,-0.7,-19.25,-0.68,-19.37,-0.67,-18.98,-0.79,-18.76,-1.11,-18.75,-1.02,-18.28,-1.13,-18.75,-1.02,-18.59,-0.78,-18.22,-0.75,-17.9,-0.77,-17.47,-0.7,3.99,-4.44,-16.19,-0.66,-13.98,-0.54,-19.03,-0.81,-18.48,-0.78,-17.54,-0.71,-18.87,-0.89,-17.31,-0.69,-5.92,-4.42,-18.24,-0.75,-19.03,-0.81,-18.89,-0.82,-18.75,-1.02]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05","timeline":[{"name":"D_HAIR_TWIN.05_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.05_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.05_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.05_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.05_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_00"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06","timeline":[{"name":"D_HAIR_TWIN.06_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.06_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.06_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.06_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.06_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_00","timeline":[{"name":"D_HAIR_TWIN.06","type":22,"frame":[{"duration":121,"value":[5.49,-0.01,-12.53,0.16,16.63,1.79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-9.17,1.69,-9.33,3.04,-19.17,1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_03","timeline":[{"name":"D_HAIR_TWIN.06","type":22,"frame":[{"duration":121,"value":[2.55,-0.02,8.9,0.59,4.9,0.27,2.93,-0.07,3.02,-0.08,4.17,-0.13,3.55,-0.11,2.16,-0.06,0.85,-0.02,0.54,-0.01,1,-0.02,6.76,0.32,1.7,-0.31,1.61,-0.02,1.75,-0.02,2.69,-0.07,1.82,-0.04,1.9,-0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_04","timeline":[{"name":"D_HAIR_TWIN.06","type":22,"frame":[{"duration":121,"value":[5.11,-0.05,21.46,1.04,9.8,0.55,5.85,-0.14,6.04,-0.16,8.35,-0.26,7.1,-0.23,4.32,-0.12,1.71,-0.04,1.08,-0.02,1.99,-0.05,13.52,0.63,3.39,-0.62,3.23,-0.03,3.5,-0.03,5.38,-0.14,3.64,-0.09,3.8,-0.09]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07","timeline":[{"name":"D_HAIR_TWIN.07_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.07_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.07_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.07_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.07_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_00","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":410}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_01","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":410}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_02","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_03","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_04","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08","timeline":[{"name":"D_HAIR_TWIN.08_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.08_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.08_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.08_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.08_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_00","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":420}]},{"name":"D_HAIR_TWIN.08","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":8,"value":[4.16,10.38,0,0,0,0,-4.12,5.73,-8.71,-4.16,-11.92,-13.56,1.17,-7.73,-1.93,-7.03,1.61,8.17,0,0,-33.93,-0.02,-17.41,0.63,-15,0.07,0,0,2.31,10.1,-5.42,9.7,0,0,-17.05,0.65,0,0,-8.9,5.12,0,0,0,0,-7.68,0.77,-0.64,15.18]},{"duration":60,"tweenEasing":0,"value":[-63.33,2.35,-42.66,2.56,0,0,0,0,4.16,10.38,0,0,0,0,-4.12,5.73,-8.71,-4.16,-11.92,-13.56,1.17,-7.73,-1.93,-7.03,1.61,8.17,0,0,-33.93,-0.02,-17.41,0.63,-15,0.07,-12.46,7.83,2.31,10.1,-5.42,9.7,-21.08,0.62,-17.05,0.65,0,0,-8.9,5.12,-18.15,0.66,0,0,-7.68,0.77,-0.64,15.18]},{"offset":8,"value":[4.16,10.38,0,0,0,0,-4.12,5.73,-8.71,-4.16,-11.92,-13.56,1.17,-7.73,-1.93,-7.03,1.61,8.17,0,0,-33.93,-0.02,-17.41,0.63,-15,0.07,0,0,2.31,10.1,-5.42,9.7,0,0,-17.05,0.65,0,0,-8.9,5.12,0,0,0,0,-7.68,0.77,-0.64,15.18]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_01","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":420}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_02","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":520}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_03","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":520}]},{"name":"D_HAIR_TWIN.08","type":22,"frame":[{"duration":121,"value":[1.75,-0.37,5.19,-0.11,1.26,0.29,0,0,0,0,0,0,0,0,-4.17,3.1,0,0,-10.09,-7.32,-1.16,-4.77,-3.88,-1.49,0,0,0,0,0,0,0,0,3.12,-0.05,4.37,-0.07,0,0,0,0,5.24,-0.11,1.73,-0.04,0,0,-5.9,1.33,5.19,-0.11,0,0,0,0,0.79,0.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_04","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":520}]},{"name":"D_HAIR_TWIN.08","type":22,"frame":[{"duration":121,"value":[3.51,-0.75,10.38,-0.21,2.52,0.59,0,0,0,0,0,0,0,0,-8.34,6.19,0,0,-20.17,-14.65,-2.32,-9.54,-7.77,-2.98,0,0,0,0,0,0,0,0,6.24,-0.1,8.75,-0.14,0,0,0,0,10.48,-0.23,3.46,-0.07,0,0,-11.8,2.66,10.38,-0.21,0,0,0,0,1.58,1.43]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09","timeline":[{"name":"D_HAIR_TWIN.09_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.09_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.09_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.09_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.09_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_00","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-100.44,19.26,-82.41,12.98,-79.78,1.24,-47.01,3.73,-25.38,0.58,-21.12,0.69,-27.48,0.77,-20.83,0.68,-20.96,0.93,-20.87,0.68,-34.12,0.47,-26.39,0.91,-18.35,1.05,-16.02,3.06,-30.94,1.5,-43.96,15.64,-70.94,24.23,-33.58,1.74,-20.61,0.78,-26.53,2.25,-44.1,11.26,-70.39,18.13,-36.18,0.78,-85.48,20.64,-57.06,11.3,-36.53,2.55,-24.59,0.19,-23.42,0.72,-33.79,-0.01,-32.18,2.27,-20.84,0.68]},{"duration":60,"tweenEasing":0,"value":[-100.44,19.26,-82.41,12.98,-79.78,1.24,-47.01,3.73,-25.38,0.58,-21.12,0.69,-27.48,0.77,-20.83,0.68,-20.96,0.93,-20.87,0.68,-34.12,0.47,-26.39,0.91,-18.35,1.05,-16.02,3.06,-30.94,1.5,-43.96,15.64,-62.12,19,-33.58,1.74,-20.61,0.78,-26.53,2.25,-44.1,11.26,-69.61,13.75,-36.18,0.78,-85.48,20.64,-57.06,11.3,-36.53,2.55,-24.59,0.19,-23.42,0.72,-33.79,-0.01,-32.18,2.27,-20.84,0.68]},{"value":[-100.44,19.26,-82.41,12.98,-79.78,1.24,-47.01,3.73,-25.38,0.58,-21.12,0.69,-27.48,0.77,-20.83,0.68,-20.96,0.93,-20.87,0.68,-34.12,0.47,-26.39,0.91,-18.35,1.05,-16.02,3.06,-30.94,1.5,-43.96,15.64,-70.94,24.23,-33.58,1.74,-20.61,0.78,-26.53,2.25,-44.1,11.26,-70.39,18.13,-36.18,0.78,-85.48,20.64,-57.06,11.3,-36.53,2.55,-24.59,0.19,-23.42,0.72,-33.79,-0.01,-32.18,2.27,-20.84,0.68]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_01","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":61},{"duration":60,"tweenEasing":0,"value":[-10.2,1.79,-21.6,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.33,-3.38,0,0,-6.26,0.59]},{"offset":61}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_02","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":530}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_03","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":121,"value":[-1.93,-0.1,-0.26,-0.5,-5.82,-2.15,4.83,0.16,6.78,0.75,10.22,1.21,13.14,1.29,16.84,0.67,33.72,-2.57,27.42,1.98,19.48,5.54,3.15,3.04,9.17,1.59,7.64,3.37,4.89,2.41,2.94,1.47,-5.02,1.03,6.18,1.39,6.32,1.8,3.97,1.35,1.53,0.77,-0.81,0.28,13.31,3.87,-1.84,0.08,0.32,0.51,2.78,1.09,5.03,1.66,7.44,2.01,7.78,0.89,23.61,3.49,24.4,0.96]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_04","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":121,"value":[-3.87,-0.2,-0.53,-1,-11.65,-4.29,9.67,0.32,13.55,1.5,20.44,2.41,26.27,2.58,33.68,1.34,67.45,-5.14,54.84,3.97,38.97,11.09,6.3,6.07,18.34,3.17,15.28,6.75,9.78,4.81,5.87,2.94,-10.05,2.05,12.37,2.78,12.63,3.59,7.94,2.7,3.05,1.53,-1.63,0.55,26.61,7.73,-3.67,0.16,0.64,1.02,5.56,2.18,10.07,3.32,14.88,4.01,15.56,1.78,47.22,6.98,48.79,1.92]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10","timeline":[{"name":"D_HAIR_TWIN.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.10_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.10_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_00","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-23.32,3.55,-45.66,5.37,-45.67,5.45,-52.61,6.34,-21.26,2.07,-4.51,8.76,-27.17,5.47,-23.33,4.21,-45.57,5.66,-46.69,6.05,-27.59,7.47]},{"duration":60,"tweenEasing":0,"value":[-23.32,3.55,-79.04,5.12,-85.4,6.46,-52.61,6.34,-21.26,2.07,-4.51,8.76,-27.17,5.47,-23.33,4.21,-45.57,5.66,-46.69,6.05,-27.59,7.47]},{"value":[-23.32,3.55,-45.66,5.37,-45.67,5.45,-52.61,6.34,-21.26,2.07,-4.51,8.76,-27.17,5.47,-23.33,4.21,-45.57,5.66,-46.69,6.05,-27.59,7.47]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_01","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":21},{"duration":60,"tweenEasing":0,"offset":2,"value":[-17.77,0.57,-6.06,2.04]},{"offset":21}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_02","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":530}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_03","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":121,"value":[-1.74,-2.49,-8.78,-6.35,20.52,1.16,-0.8,-0.7,-0.13,4.15,0.98,4.85,-0.26,0.22,-4.83,-4.02,-10.24,-2.78,-6.03,-2.19,2.68,1.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_04","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":121,"value":[-3.47,-4.99,-17.57,-12.71,41.03,2.32,-1.6,-1.39,-0.26,8.31,1.96,9.7,-0.53,0.43,-9.67,-8.03,-20.48,-5.57,-12.05,-4.38,5.36,3.05]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02","timeline":[{"name":"B_HAIR_BACK.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_BACK.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_BACK.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_BACK.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_BACK.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_00","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-58.64,49.98,-30.47,13.5,-3.07,-22.09,14.39,-38.98,23.95,-17.69,27.19,2.46,22.86,2.52,13.16,-3.17,2.67,-9.33,-27.68,35.92,-16.76,-0.99,-8.53,-33.09,-5.83,-53.38,-5.38,-41.68,1.79,-16.16,6.7,-7.44,8.72,-5.19,9.3,-3.3,1.07,27.92,-4.05,-11.2,-13.45,-44.2,-24.83,-67.76,-33.18,-65.1,-21.98,-33.88,-8.21,-16.8,4.34,-7.87,15.43,1.41,10.73,26.93,0.21,-14.01,-12.47,-49.32,-29.08,-74.4,-40.83,-75.04,-27.06,-40.41,-10.28,-20.76,3.56,-11.79,17.06,-2.13,13.66,41.25,7.39,4.96,0.3,-27.54,-8.75,-49.02,-14.13,-50.57,-4.46,-29.91,5.4,-17.16,11.34,-10.52,17.08,-3.59,14.34,64.85,12.53,31.26,11.23,-0.8,9.89,-20.57,11.11,-23.87,16.98,-18.01,19.74,-12.79,17.01,-9.44,14.58,-5.89,12.38,92.14,10.99,58.64,9.75,25.82,9.99,6.4,13.28,-0.05,17.52,-5.74,17.91,-6.27,13.67,-5.98,9.7,-5.6,13.3,117.65,12.13,85.04,11.14,53.07,10.69,34.16,12.19,21.91,14.16,4.25,14.18,-1.37,11.48,-3.16,8.94,-5.06,14.67,142.67,13.34,108.26,11.95,74.42,10.67,55.12,10.67,39.84,10.67,12.74,10.45,3.05,9.59,-0.65,8.67,-4.67]},{"duration":60,"tweenEasing":0,"value":[-67.31,49.98,-47.47,20.3,-27.76,-9.01,-14.75,-25.67,-8.66,-15,-2.57,-4.34,-2.44,-3.99,-4.15,-6.56,-6,-9.33,-39.12,38.23,-26.9,7.25,-15.7,-22.5,-7.89,-43.53,-4.37,-39.47,-1.17,-20.11,-1.51,-10.88,-3.21,-7.17,-5.07,-3.3,-12.94,32.37,-7.93,-1.88,-4.34,-34.68,-1.55,-61.18,-0.39,-63.46,0.15,-35.23,-0.65,-17.61,-2.35,-8.36,-4.22,1.42,-3.76,31.88,-1.86,-4.76,-0.18,-40.17,0.42,-68.97,1.14,-73.33,1.27,-40.75,0.47,-20.78,-1.51,-11.84,-3.66,-2.2,1.25,45.25,1.79,10.97,2.35,-22.27,3,-46.21,4.73,-49.78,6.67,-30.15,6.49,-17.26,3.25,-11.04,0,-4.33,4.84,66.22,3.94,32.8,3.23,0.19,3.91,-20.36,6.92,-23.96,10.94,-18.14,11.55,-12.9,7.65,-9.82,3.66,-6.47,3.71,92.14,2.32,58.64,1.08,25.81,1.33,6.4,4.62,-0.05,8.85,-5.74,9.24,-6.27,5.01,-5.98,1.03,-5.6,4.63,117.65,3.46,85.04,2.48,53.07,2.02,34.16,3.53,21.9,5.5,4.25,5.51,-1.37,2.81,-3.16,0.27,-5.07,6,142.67,4.68,108.26,3.28,74.42,2,55.11,2,39.83,2,12.74,1.78,3.05,0.93,-0.65,0,-4.67]},{"value":[-155.98,77.31,-118.85,29.47,-81.68,-11.87,-56.35,-26.16,-50.39,-16.71,-44.73,-10.59,-53.83,-15.61,-70.4,-29.95,-87.33,-45.33,-109.97,58.07,-71.7,14.72,-34.29,-23.51,-10.57,-42.38,-6.64,-40.26,-6.67,-25.43,-20.1,-20.2,-42.67,-25.34,-65.33,-30.83,-67.11,45.11,-28.14,4.25,9.63,-33.56,31.3,-58.57,33.56,-63.27,28.27,-39.4,10.84,-24.49,-16.95,-21.14,-44.83,-17.43,-51.16,40.56,-18.49,0.14,12.45,-38.11,29.33,-67.34,31.3,-73.49,24.43,-43.61,7.14,-24.58,-19.81,-18.86,-47.83,-12.68,-32.75,51.75,-15.11,14.25,-1.43,-20.15,7.19,-45.42,9.05,-50.86,6.4,-33.58,-6.07,-20.27,-31.35,-15.92,-57.47,-11.33,-15.75,72.22,-7.07,36.52,-1.28,2.5,2.17,-19.04,6.05,-25.13,9.78,-21.91,2.71,-15.43,-19.62,-13.24,-42.96,-11.11,-13.94,97.48,-6.41,61.26,1.34,25.86,3.99,5.58,7.71,-0.8,12.38,-6.42,7.22,-5.95,-13.01,-7.47,-32.66,-9.17,-6.46,120.42,-2.08,84.53,2.47,49.52,3.49,30.06,5.18,22.14,7.34,8.82,4.25,3.52,-7.65,-1.4,-19.16,-6.92,2,142.67,2.53,104.56,2.84,67.29,2,47.97,2,41.83,2,23.88,1.34,13.74,-1.22,4.9,-4,-4.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_01","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-22.68,80,-6.27,34.94,9.57,-6.71,20.21,-15.74,27.94,-2.69,29.36,9.24,25.3,7.86,17.31,-0.4,8.67,-9.33,-6.24,54.24,-2.52,17.68,-1.3,-13.18,-2.76,-23.09,-3.57,-17.17,2.72,0.8,8.08,5.64,11.4,1.6,13.45,-3.16,8.51,35.42,0.45,5.24,-11.28,-18.49,-24.38,-30.26,-33.58,-31.43,-22.29,-7.38,-7.8,3.75,5.75,3.25,17.87,2.53,12.91,27.03,1.23,1.33,-12.49,-18.44,-29.4,-31.57,-41.37,-36.07,-27.41,-10.59,-10.15,2.48,4.52,3.13,18.8,3.79,17.66,20.25,8.59,3.26,-1.43,-9.81,-11.4,-16.84,-15.54,-19.9,-5.01,-6.01,4.4,1.18,10.34,1.45,16.08,1.41,20.17,19.39,14.46,9.15,9.21,0.53,6.45,-2.08,9.52,-3.42,16.23,-0.55,17.61,0.69,14.06,-0.45,10.83,-1.8,18.76,27.39,14.32,18.34,9.84,9.99,9.1,7.5,13.7,4.12,18.3,0.74,17.54,0.24,13.04,-1.74,8.67,-3.98,13.91,34.99,11.63,27.25,9.29,20.12,8.89,17.51,11.31,9.67,13.73,1.82,13.32,0.15,10.93,-4.26,8.67,-9.11,8.67,42.67,8.67,36.19,8.67,30.2,8.67,27.52,8.67,15.34,8.67,3.15,8.67,0.18,8.67,-6.95,8.67,-14.67]},{"duration":60,"tweenEasing":0,"value":[-31.34,80,-23.27,41.74,-15.12,6.38,-8.93,-2.44,-4.67,0,-0.4,2.44,0,1.35,0,-3.78,0,-9.33,-17.68,56.55,-12.77,25.81,-8.44,-2.3,-4.8,-13.24,-2.51,-14.98,-0.22,-3.17,-0.11,2.2,-0.52,-0.36,-0.93,-3.16,-5.5,39.87,-3.43,14.56,-2.2,-8.63,-0.98,-23.67,-0.51,-29.81,-0.04,-8.76,-0.21,2.92,-1,2.77,-1.78,2.54,-1.58,31.97,-0.86,10.53,-0.18,-9.31,0.04,-26.15,0.45,-34.34,0.86,-10.92,0.6,2.46,-0.57,3.08,-1.91,3.71,5.25,24.25,2.99,9.24,0.63,-4.49,0.27,-14.03,3.17,-19.1,6.06,-6.25,5.49,1.1,2.25,0.91,-1,0.67,10.67,20.75,5.87,10.68,1.21,1.53,0.46,-1.86,5.32,-3.5,10.19,-0.68,9.42,0.59,4.71,-0.84,-0.09,-2.38,10.09,27.39,5.65,18.33,1.18,9.99,0.43,7.5,5.03,4.11,9.63,0.73,8.87,0.24,4.37,-1.75,0,-3.98,5.24,34.99,2.96,27.25,0.62,20.12,0.23,17.51,2.64,9.67,5.06,1.82,4.65,0.15,2.26,-4.27,0,-9.11,0,42.67,0,36.19,0,30.2,0,27.52,0,15.33,0,3.15,0,0.18,0,-6.95,0,-14.67]},{"value":[-120.01,107.33,-94.65,50.9,-69.03,3.51,-50.53,-2.92,-46.39,-1.7,-42.56,-3.81,-51.4,-10.27,-66.25,-27.17,-81.33,-45.33,-88.53,76.39,-57.59,33.13,-27.03,-3.41,-7.46,-12.07,-4.74,-15.76,-5.69,-8.48,-18.66,-7.14,-40.05,-18.56,-61.18,-30.69,-59.67,52.61,-23.66,20.64,11.78,-7.6,31.91,-21.05,33.55,-29.62,28.15,-12.93,11.34,-3.93,-15.72,-10.05,-42.4,-16.3,-48.99,40.65,-17.5,15.45,12.45,-7.31,28.94,-24.52,30.56,-34.5,23.99,-13.78,7.27,-1.34,-18.89,-3.95,-46.09,-6.77,-28.75,30.75,-13.79,12.54,-3.16,-2.54,4.45,-13.24,7.44,-20.16,5.77,-9.65,-7.07,-1.88,-32.35,-3.96,-58.47,-6.33,-9.92,26.75,-5.07,14.42,-3.29,3.73,-1.28,-0.55,4.45,-4.66,9.03,-4.44,0.59,-1.92,-22.54,-4.25,-46.7,-7.02,-7.57,32.73,-3.1,20.96,1.43,10.04,3.1,6.68,8.13,3.36,13.15,0.05,6.85,0.57,-13.57,-3.19,-33.69,-7.54,-5.85,37.77,-2.63,26.76,0.6,16.58,1.7,13.41,4.3,9.92,6.9,6.42,3.4,5.03,-8.17,-2.48,-19.43,-10.96,-4,42.67,-2.15,32.48,-0.44,23.07,0,20.38,0,17.33,0,14.29,-0.44,10.86,-2.15,-1.4,-4,-14.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_02","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.67,0,16.99,-6.8,24.69,-13.08,29.14,-13.31,32.61,-2.69,29.76,6.8,25.3,6.51,17.31,3.38,8.67,0,11.44,-2.31,10.25,-8.05,7.1,-11.28,2.05,-9.88,-1.04,-2.26,2.95,3.94,8.18,3.43,11.93,1.96,14.38,0,14.01,-4.45,3.89,-9.19,-9.11,-9.9,-23.34,-6.68,-32.93,-1.84,-22.19,1.28,-7.6,0.83,6.76,0.48,19.65,-0.01,14.49,-4.95,2.08,-9.23,-12.3,-9.1,-29.4,-5.4,-41.73,-1.67,-28.23,0.35,-10.76,0.04,5.1,0.04,20.72,0.07,12.42,-4,5.63,-5.94,-2.09,-5.2,-11.7,-2.81,-18.76,-0.8,-11.09,0.24,-1.09,0.13,8.09,0.51,17.08,0.75,9.5,-1.36,8.6,-1.52,7.99,-0.96,5.98,-0.22,4.17,0.07,6.03,0.13,8.19,0.11,9.35,0.38,10.92,0.58,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-88.67,27.33,-71.38,9.17,-53.92,-2.86,-41.6,-0.49,-41.73,-1.7,-42.16,-6.25,-51.4,-11.63,-66.25,-23.39,-81.33,-36,-70.85,19.84,-44.98,7.63,-18.42,-0.78,-2.67,1.13,-2.25,-0.85,-5.49,-5.34,-18.53,-9.36,-39.55,-18.21,-60.26,-27.53,-54.17,12.74,-20.39,6.32,14.07,1.23,32.87,2.52,34.01,-0.03,28.16,-4.26,11.57,-6.86,-14.77,-12.83,-40.61,-18.84,-47.41,8.68,-16.53,4.9,12.59,1.81,28.89,1.67,30.09,-0.07,23.12,-2.82,6.68,-3.8,-18.34,-7.03,-44.18,-10.48,-34,6.5,-16.81,3.33,-3.8,1.5,4.19,0.85,4.29,-0.98,-0.28,-3.39,-12.55,-3.04,-34.64,-4.85,-57.47,-7,-20.59,6.01,-11.03,3.75,-4.51,2.1,-1.74,1.33,-0.86,-1.15,-1.16,-3.77,-8.83,-2.55,-27.27,-3.39,-46.61,-4.64,-17.66,5.34,-8.76,2.62,0.25,0.04,2.67,-0.81,3.09,-0.75,3.52,-0.69,-2.02,0.28,-18,-1.45,-33.69,-3.56,-11.1,2.78,-5.59,-0.5,-0.02,-3.53,1.47,-4.09,1.65,0.25,1.84,4.59,-1.26,4.88,-10.45,1.77,-19.43,-1.85,-4,0,-2.15,-3.7,-0.44,-7.13,0,-7.14,0,2,0,11.14,-0.44,10.69,-2.15,5.55,-4]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_03","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.67,-12,17.61,-18.8,25.88,-25.08,30.14,-19.69,30.1,-7.22,23.76,-11.78,19.37,-22.47,12.96,-39.86,6.02,-58.67,11.44,-14.31,10.6,-18.69,7.74,-20.62,2.58,-9.12,-2.29,8.72,-0.05,-0.28,5.28,-15.17,9.98,-33.19,13.58,-53.11,14.01,-16.45,3.98,-18.54,-8.96,-16.75,-23.27,0.99,-33.12,24.32,-22.5,11.01,-7.78,-7.69,7.01,-26.98,20.56,-47.99,14.49,-16.95,2.08,-18.11,-12.3,-15.09,-29.44,3.79,-41.83,28.75,-28.28,15.56,-10.63,-3.95,5.8,-24.28,21.95,-46.19,12.42,-16,5.62,-14.54,-2.09,-10.66,-11.72,0.86,-18.81,15.99,-11.12,9.39,-1.09,-3.32,8.1,-21.42,17.1,-41.25,9.5,-13.36,8.59,-9.85,7.99,-5.9,5.97,-2.04,4.15,3.31,6.02,3.25,8.04,-2.72,8.67,-19.18,9.72,-37.16,8.67,-12,9.17,-5.68,9.72,0.16,9.82,1.64,9.26,1.74,8.71,1.85,8.52,-2.69,8,-18.05,7.49,-34.56,8.67,-12,9.7,-2.03,10.71,7.18,10.88,9.26,9.82,6.53,8.76,3.79,8.59,0.21,8.32,-11.32,8.06,-23.73,8.67,-12,10.2,1.58,11.62,14.13,11.84,16.82,10.32,11.34,8.8,5.85,8.66,3.44,8.66,-3.97,8.67,-12]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-12,0.62,-12,1.19,-12,1,-6.39,-2.5,-4.53,-6,-18.58,-5.92,-28.98,-4.35,-43.24,-2.65,-58.67,0,-12,0.35,-10.62,0.64,-9.33,0.53,0.83,-1.25,11.11,-2.99,-4.17,-2.9,-18.55,-1.95,-35.15,-0.8,-53.11,0,-12,0.1,-9.33,0.14,-6.84,0.1,7.79,-0.13,26.43,-0.29,9.85,-0.18,-8.53,0.25,-27.47,0.91,-47.98,0,-12,0,-8.88,0,-6,-0.03,9.15,-0.08,30.34,-0.04,15.18,0.14,-4.01,0.69,-24.32,1.23,-46.27,0,-12,0,-8.61,0,-5.47,-0.02,3.67,-0.05,16.79,-0.03,9.15,-0.01,-3.41,0,-21.94,0.02,-42,0,-12,0,-8.33,0,-4.94,-0.01,-1.82,-0.02,3.25,-0.01,3.13,-0.15,-2.81,-0.68,-19.57,-1.2,-37.74,0,-12,0.5,-5.69,1.05,0.16,1.15,1.63,0.6,1.74,0.04,1.84,-0.14,-2.7,-0.66,-18.05,-1.17,-34.56,0,-12,1.03,-2.04,2.05,7.18,2.21,9.26,1.15,6.52,0.09,3.79,-0.08,0.21,-0.35,-11.32,-0.61,-23.73,0,-12,1.54,1.58,2.96,14.13,3.18,16.82,1.66,11.33,0.13,5.85,-0.01,3.44,0,-3.98,0,-12]},{"value":[-88.67,15.33,-70.77,-2.83,-52.73,-14.86,-40.6,-6.87,-44.23,-6.23,-48.16,-24.83,-57.32,-40.61,-70.6,-66.63,-83.98,-94.67,-70.85,7.84,-44.62,-3,-17.78,-10.12,-2.14,1.9,-3.49,10.13,-8.47,-9.57,-21.44,-27.88,-41.5,-53.35,-61.06,-80.64,-54.17,0.74,-20.27,-3.02,14.19,-5.6,32.97,10.19,33.9,26.12,27.89,5.46,11.38,-15.28,-14.5,-40.28,-39.7,-66.82,-47.41,-3.32,-16.53,-3.98,12.59,-4.2,28.86,10.87,30.01,30.39,23.08,12.41,6.83,-7.8,-17.67,-31.34,-42.94,-56.75,-34,-5.5,-16.8,-5.28,-3.8,-4,4.16,4.56,4.24,15.92,-0.31,5.81,-12.56,-6.42,-34.63,-26.77,-57.46,-49,-20.59,-5.99,-11.03,-4.58,-4.52,-2.86,-1.75,-0.48,-0.88,2.11,-1.17,-0.64,-8.98,-5.34,-27.93,-22.95,-47.82,-42.38,-17.66,-6.66,-8.25,-3.07,1.3,0.18,3.82,0.82,3.69,0.99,3.57,1.16,-2.17,-2.42,-18.72,-19.52,-34.86,-38.13,-11.1,-9.22,-4.56,-2.53,2.03,3.63,3.68,5.16,2.81,6.77,1.93,8.39,-1.34,5.06,-10.82,-9.55,-20.04,-25.58,-4,-12,-0.61,-2.12,2.52,7,3.18,9.68,1.66,13.33,0.13,16.99,-0.45,14.12,-2.15,1.58,-4,-12]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_04","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[4.67,-8,14.54,-18.5,23.66,-28.21,27.13,-19.04,21.6,7.53,8.09,12.85,-7.18,-3.54,-24.75,-36.2,-43.98,-66.67,9.42,-5.29,9.19,-9.88,6.63,-11.94,1.42,5.78,-5.67,34.36,-7.36,29,-8.84,6.06,-11.54,-24.3,-15.91,-54.89,13.48,-2.61,3.84,-1.71,-9.11,2.95,-22.63,29.24,-31.64,60.19,-22.07,44.55,-10.28,16.37,1.14,-13.03,10.88,-43.33,12.58,-0.6,1.15,1.32,-12.34,7.27,-28.25,35.45,-39.63,66.84,-26.37,48.6,-8.94,20.51,6.66,-7.85,21.87,-37.31,11.42,4,6.02,4.07,-0.41,6.67,-9.19,22.07,-16.56,37.61,-9.99,25.09,-0.31,6.73,8.03,-17.93,16.1,-44.25,9.41,10.29,10.3,7.93,11.38,6.38,9.79,8.88,6.32,8.78,6.3,1.74,7.91,-7.02,7.68,-28.61,7.8,-52.04,8.67,12,10.74,11.2,12.87,10.51,13.24,9.88,11.15,4.09,9.07,-1.71,8.33,-10.46,7.17,-32.37,6.15,-55.59,8.67,12,10.51,12.92,12.35,13.8,12.69,13.41,11.28,6.3,9.87,-0.8,9.13,-15.01,9.09,-39.44,9.28,-64.43,8.67,12,10.2,14.47,11.62,16.75,11.93,16.56,11.32,8.34,10.71,0.11,10.03,-19.65,11.21,-46.91,12.67,-74]},{"duration":60,"tweenEasing":0,"value":[-4,-8,-2.46,-11.7,-1.03,-15.12,-2.01,-5.73,-11,10.22,-21.67,6.05,-32.48,-10.05,-42.06,-39.59,-52.65,-66.67,-2.02,-2.97,-1.07,-1.8,-0.48,-0.64,-0.65,15.72,-4.67,36.76,-10.32,25.13,-17.05,3.13,-23.42,-26.39,-30.29,-54.89,-0.53,1.84,-0.04,7.53,-0.03,12.91,0.65,36.08,1.15,62.36,0.05,43.41,-2.66,15.83,-5.67,-13.62,-8.78,-43.32,-1.91,4.34,-0.92,10.58,-0.05,16.39,1.23,40.8,2.28,68.41,1.94,48.21,1.83,20.46,1.53,-7.89,1.15,-37.38,-1,8,0.39,10.01,1.67,11.86,2.51,24.88,2.2,38.41,1.1,24.85,0.78,6.67,-0.07,-18.46,-0.98,-45,-0.09,11.66,1.7,9.44,3.39,7.35,3.8,9.11,2.13,8.72,0.25,1.62,-0.28,-7.1,-1.67,-29.01,-3.12,-52.62,0,12,2.07,11.2,4.2,10.51,4.57,9.88,2.49,4.08,0.41,-1.71,-0.34,-10.46,-1.49,-32.37,-2.52,-55.59,0,12,1.84,12.92,3.68,13.8,4.03,13.41,2.61,6.3,1.2,-0.8,0.46,-15.02,0.42,-39.44,0.61,-64.43,0,12,1.54,14.47,2.96,16.75,3.26,16.56,2.66,8.33,2.05,0.11,1.37,-19.66,2.54,-46.91,4,-74]},{"value":[-92.67,19.33,-73.84,-2.53,-54.95,-17.99,-43.61,-6.22,-52.73,8.52,-63.83,-0.2,-83.87,-21.68,-108.31,-62.98,-133.98,-102.67,-72.87,16.86,-46,5.77,-18.95,-1.45,-3.32,16.78,-6.94,35.74,-15.83,19.71,-35.63,-5.98,-62.95,-44.67,-90.55,-82.42,-54.7,14.58,-20.33,13.79,13.99,14.2,33.5,38.41,35.09,61.96,28.18,39.01,8.89,9.27,-20.43,-26.51,-49.39,-62.17,-49.32,13.02,-17.4,15.46,12.52,18.18,30.14,42.55,32.44,68.49,25.09,45.44,8.53,16.67,-16.87,-14.92,-43.03,-47.86,-35,14.5,-16.42,13.35,-2.13,13.31,6.7,25.81,6.5,37.58,0.82,21.51,-11.77,3.64,-34.71,-23.28,-58.46,-52,-20.68,17.66,-9.37,13.2,-1.13,9.45,2.06,10.45,1.25,7.58,-0.91,-2.15,-9.12,-9.64,-28.88,-32.38,-49.73,-57.26,-17.66,17.34,-6.67,13.82,4.46,10.53,7.24,9.06,5.58,3.33,3.93,-2.4,-2.35,-10.12,-19.41,-33.8,-36.21,-59.16,-11.1,14.78,-3.74,12.42,3.66,10.26,5.5,9.31,4.27,6.55,3.04,3.79,-0.8,-10.13,-10,-37.64,-18.82,-66.29,-4,12,-0.61,10.77,2.52,9.63,3.26,9.42,2.66,10.33,2.05,11.25,0.93,-8.97,0.39,-41.36,0,-74]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00","timeline":[{"name":"D_HAIR_BACK.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_BACK.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_BACK.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_BACK.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_BACK.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_00","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-6.24,-1.37,-3.48,-2.66,9.34,-1.24,0.57,-4.97,-11.22,14.88,-2.84,6.45,-0.24,2.09,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.3,1.95,-4.25,4.29,0,0,-9.7,7.17,-11.69,7.69,0,0,0,0,0,0,0,0,0,0,0,0,-1.57,23.94,0,0,0,0,0,0,0,0,2.52,10.68,-3.69,11.77,-1.73,6.58,0,0,3.3,0.3,0,0,0,0,0,0,0,0,0,0,11.04,-2.72,-7.89,-0.31,-9.64,5.46,-15.71,-1.31,-2.02,-1.54,3.98,-1.83,5.07,-0.67,6.12,-1.84,-2.09,1.37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.58,6.85,-6.68,11.98,-9.35,10.72,-10.79,7.92,-0.13,1.15,-4.6,4.44]},{"duration":60,"tweenEasing":0,"value":[-6.24,-1.37,-3.48,-2.66,9.34,-1.24,2.1,-3.67,-6.34,1.02,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.3,1.95,-4.25,4.29,0,0,-8.57,2.82,-10.33,2.32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.3,0.3,0,0,0,0,0,0,0,0,0,0,11.04,-2.72,-7.89,-0.31,-13.51,-0.19,-15.71,-1.31,-2.02,-1.54,3.98,-1.83,5.07,-0.67,7.59,-2.35,-1.57,-1.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-4.68,1.54,-5.54,1.25,-5.58,1.25,-9.49,2.56,0,0,-3.95,1.3]},{"value":[-6.24,-1.37,-3.48,-2.66,9.34,-1.24,4.3,-4.45,-7.76,-7,-0.74,-0.58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.3,1.95,-4.25,4.29,0,0,-8.57,2.82,-13.24,-9.25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.3,0.3,0,0,0,0,0,0,0,0,0,0,11.04,-2.72,-7.89,-0.31,-13.51,-0.19,-15.71,-1.31,-2.02,-1.54,3.98,-1.83,5.07,-0.67,7.59,-2.35,-1.57,-1.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.24,-2.8,-9.24,-0.84,-7.04,-0.71,-9.49,2.56,0,0,-3.95,1.3]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_01","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.12,-0.68,-1.74,-1.33,4.67,-0.62,2.15,-2.22,-4.13,0.9,-0.81,4.35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.15,0.97,-2.12,2.14,0,0,-4.29,1.41,-5.17,1.16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.65,0.15,0,0,0,0,0,0,0,0,0,0,5.52,-1.36,-3.94,-0.16,-6.76,-0.09,-7.85,-0.66,-1.01,-0.77,1.99,-0.92,2.53,-0.34,3.8,-1.17,-0.78,-0.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.7,2.75,-3.14,2.64,-2.79,0.63,-4.74,1.28,0,0,-1.98,0.65]},{"duration":60,"tweenEasing":0,"value":[-3.12,-0.68,-1.74,-1.33,4.67,-0.62,2.15,-2.22,-4.96,1.72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.15,0.97,-2.12,2.14,0,0,-4.29,1.41,-5.17,1.16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.65,0.15,0,0,0,0,0,0,0,0,0,0,5.52,-1.36,-3.94,-0.16,-6.76,-0.09,-7.85,-0.66,-1.01,-0.77,1.99,-0.92,2.53,-0.34,3.8,-1.17,-0.78,-0.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.34,0.77,-2.77,0.62,-2.79,0.63,-4.74,1.28,0,0,-1.98,0.65]},{"value":[-3.12,-0.68,-1.74,-1.33,4.67,-0.62,2.15,-2.22,-8.44,-5.82,-0.69,-5.22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.15,0.97,-2.12,2.14,0,0,-4.29,1.41,-7.78,-5.95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.88,-4.83,0,0,1.65,0.15,0,0,0,0,0,0,0,0,0,0,5.52,-1.36,-3.94,-0.16,-6.76,-0.09,-7.85,-0.66,-1.01,-0.77,1.99,-0.92,2.53,-0.34,3.8,-1.17,-0.78,-0.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.34,0.77,-2.77,0.62,-3.63,0.08,-6.77,-2.93,0,0,-1.98,0.65]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_03","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-2.56,0.02,-1.21,1.01,-4.02,-2.13,5.49,-4.2,12.11,0.23,0,0,0,0,0,0,0,0,0,0,-0.56,-1.62,0.51,-2.54,-5.5,-9.39,-0.68,-2.51,6.36,-3.62,6.24,-1.84,0,0,20.03,2.37,25.71,4.42,19.57,3.74,33.45,-2.63,26.09,-2.42,10.81,2.02,11.96,1.96,30.8,5.55,31.85,3.47,28.28,4.25,17.43,3.6,3.69,-5.01,11.39,2.52,19.05,-0.32,18.49,4.52,13.03,0.63,17.59,-6.98,5.9,-2.91,5.36,-8.98,20.08,-0.79,6.5,-2.09,-4.33,-4.29,3.54,-1.18,3.3,-0.34,11.84,0.04,5.72,0.36,13.31,1.37,3.71,0.97,-2.98,-1.61,3.13,-2.39,5.42,-0.04,10.13,1.47,1.2,-6.82,-1.22,-9.71,-2.36,-4.75,-1.59,-5.41,-3.68,-4.43,-1.64,-7.38,1.14,-3.71,-1.84,-2.27,1.28,-4.01,10.93,1.3,13.78,2.37,19.46,2.49,22.99,3.44,0,0,9.24,1.1]},{"duration":60,"tweenEasing":0,"value":[-2.56,0.02,-1.21,1.01,-4.02,-2.13,5.49,-4.2,12.11,0.23,0,0,0,0,0,0,0,0,0,0,-0.56,-1.62,0.51,-2.54,-5.5,-9.39,0.9,-1.79,6.36,-3.62,6.24,-1.84,0,0,20.03,2.37,25.71,4.42,19.57,3.74,33.45,-2.63,26.09,-2.42,10.81,2.02,11.96,1.96,30.8,5.55,31.85,3.47,28.28,4.25,17.43,3.6,3.69,-5.01,11.39,2.52,19.05,-0.32,18.49,4.52,13.03,0.63,17.59,-6.98,5.9,-2.91,5.36,-8.98,20.08,-0.79,6.5,-2.09,-4.33,-4.29,3.54,-1.18,3.3,-0.34,11.84,0.04,5.72,0.36,13.31,1.37,3.71,0.97,-2.98,-1.61,3.13,-2.39,5.42,-0.04,10.13,1.47,1.2,-6.82,-1.22,-9.71,0.01,-4.03,-1.59,-5.41,-3.68,-4.43,-1.64,-7.38,1.14,-3.71,-1.84,-2.27,1.28,-4.01,10.93,1.3,13.78,2.37,19.46,2.49,22.99,3.44,0,0,9.24,1.1]},{"value":[-2.56,0.02,-1.21,1.01,-4.02,-2.13,5.49,-4.2,12.11,0.23,0,0,0,0,0,0,0,0,0,0,-0.56,-1.62,0.51,-2.54,-5.5,-9.39,-0.68,-2.51,6.36,-3.62,6.24,-1.84,0,0,20.03,2.37,25.71,4.42,19.57,3.74,33.45,-2.63,26.09,-2.42,10.81,2.02,11.96,1.96,30.8,5.55,31.85,3.47,28.28,4.25,17.43,3.6,3.69,-5.01,11.39,2.52,19.05,-0.32,18.49,4.52,13.03,0.63,17.59,-6.98,5.9,-2.91,5.36,-8.98,20.08,-0.79,6.5,-2.09,-4.33,-4.29,3.54,-1.18,3.3,-0.34,11.84,0.04,5.72,0.36,13.31,1.37,3.71,0.97,-2.98,-1.61,3.13,-2.39,5.42,-0.04,10.13,1.47,1.2,-6.82,-1.22,-9.71,-2.36,-4.75,-1.59,-5.41,-3.68,-4.43,-1.64,-7.38,1.14,-3.71,-1.84,-2.27,1.28,-4.01,10.93,1.3,13.78,2.37,19.46,2.49,22.99,3.44,0,0,9.24,1.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_04","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-5.12,0.03,-2.43,2.02,-8.05,-4.25,2.23,-4.1,24.22,0.45,0,0,0,0,0,0,0,0,0,0,0,0,1.01,-5.07,-8.61,-17.84,3.46,-6.64,15.24,-8.46,12.49,-3.68,0,0,40.07,4.75,51.41,8.85,31.65,20.1,61.44,22.41,47.17,2.96,21.61,4.04,27.75,13.14,61.6,11.1,63.71,6.94,56.56,8.51,34.86,7.2,7.38,-10.02,18.49,6.46,38.09,-0.63,36.99,9.05,26.06,1.25,29.68,1.03,11.8,-5.82,6.91,-10.13,30.63,9.28,11.91,-1.76,-8.67,-8.58,6.82,3.13,6.97,-2.46,23.68,0.09,11.44,0.72,26.63,2.74,7.43,1.93,-5.97,-3.23,-0.23,-1.88,-3.81,-0.14,20.27,2.95,6.84,-10.04,-2.44,-19.42,1.14,-6.66,-2.03,-9.76,-7.37,-8.85,-3.28,-14.75,2.28,-7.43,-3.68,-4.53,2.56,-8.01,21.86,2.59,27.57,4.75,38.91,4.99,45.98,6.88,0,0,18.48,2.19]},{"duration":60,"tweenEasing":0,"value":[-5.12,0.03,-2.43,2.02,-8.05,-4.25,2.23,-4.1,24.22,0.45,0,0,0,0,0,0,0,0,0,0,-1.11,-3.23,1.01,-5.07,-4.49,-17.21,-1.36,-5.02,12.71,-7.24,12.49,-3.68,0,0,40.07,4.75,51.41,8.85,39.14,7.48,64.02,10.1,52.19,-4.85,21.61,4.04,23.92,3.92,61.6,11.1,63.71,6.94,56.56,8.51,34.86,7.2,7.38,-10.02,18.49,6.46,38.09,-0.63,36.99,9.05,26.06,1.25,32.39,-11.79,11.8,-5.82,10.73,-17.97,30.6,-0.56,12.99,-4.19,-8.67,-8.58,7.08,-2.37,6.59,-0.68,23.68,0.09,11.44,0.72,26.63,2.74,7.43,1.93,-5.97,-3.23,-0.23,-1.88,-3.81,-0.14,20.27,2.95,2.41,-13.64,-2.44,-19.42,2.32,-8.69,-3.18,-10.81,-5.76,-8.83,-3.28,-14.75,2.28,-7.43,-3.68,-4.53,2.56,-8.01,21.86,2.59,27.57,4.75,38.91,4.99,45.98,6.88,0,0,18.48,2.19]},{"value":[-5.12,0.03,-2.43,2.02,-8.05,-4.25,2.23,-4.1,24.22,0.45,0,0,0,0,0,0,0,0,0,0,-1.11,-3.23,6.1,-3.32,-5.29,-27.41,-1.31,-7.98,12.71,-7.24,12.49,-3.68,0,0,40.07,4.75,51.41,8.85,33.09,-0.08,61.88,-8.15,52.19,-4.85,21.61,4.04,23.92,3.92,61.6,11.1,63.71,6.94,56.56,8.51,34.86,7.2,7.38,-10.02,18.49,6.46,38.09,-0.63,36.99,9.05,26.06,1.25,32.27,-14.63,11.8,-5.82,10.73,-17.97,30.43,-4.95,12.81,-13.59,-7.04,-13.77,8.33,-5.77,6.59,-0.68,23.68,0.09,11.44,0.72,26.63,2.74,7.43,1.93,-5.97,-3.23,-0.23,-1.88,-3.81,-0.14,20.27,2.95,3.77,-17.5,-1.01,-26.27,-1.48,-12.5,-1.55,-17.56,-5.74,-17.15,-2.47,-21.62,0.77,-12.29,-3.68,-4.53,0.01,-10.83,21.86,2.59,27.57,4.75,38.91,4.99,45.98,6.88,0,0,18.48,2.19]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.04","timeline":[{"name":"B_CLOTHES.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_00","timeline":[{"name":"B_CLOTHES.04","type":12,"frame":[{"duration":121,"x":-3.5}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_02","timeline":[{"name":"B_CLOTHES.04","type":12,"frame":[{"duration":121,"x":59.6}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_03","timeline":[{"name":"B_CLOTHES.04","type":11,"frame":[{"duration":121,"x":-22.7,"y":0.32}]},{"name":"B_CLOTHES.04","type":12,"frame":[{"duration":121,"x":60.9}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.07","timeline":[{"name":"B_CLOTHES.07_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.07_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.07_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.07_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_00","timeline":[{"name":"B_CLOTHES.07","type":12,"frame":[{"duration":121,"x":-11}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_02","timeline":[{"name":"B_CLOTHES.07","type":11,"frame":[{"duration":121,"x":1.65,"y":-12.82}]},{"name":"B_CLOTHES.07","type":12,"frame":[{"duration":121,"x":7.37}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_03","timeline":[{"name":"B_CLOTHES.07","type":11,"frame":[{"duration":121,"x":1.65,"y":-12.82}]},{"name":"B_CLOTHES.07","type":12,"frame":[{"duration":121,"x":8.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.36","timeline":[{"name":"B_CLOTHES.36_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.36_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.36_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.36_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_00","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[1.54,38.07,0.45,24.73,-0.97,14.08,-1.52,5.9,0,0,0,0,0,0,0,0,0,0,1.57,30.68,0.59,19.92,-0.56,11.24,-1.04,4.61,0,0,0,0,0,0,0,0,0,0,1.61,22.52,0.74,14.44,-0.16,8.01,-0.58,3.2,0,0,0,0,0,0,0,0,0,0,1.64,15.91,0.93,10.25,0.23,5.54,-0.17,2.03,0,0,0,0,0,0,0,0,0,0,1.65,13.19,1.16,9.34,0.62,5.01,0.18,1.46,0,0,0,0,0,0,0,0,0,0,1.47,11.75,1.05,8.57,0.58,4.68,0.19,1.39,0,0,0,0,0,0,0,0,0,0,1.03,8.24,0.73,6.06,0.41,3.33,0.15,0.99,0,0,0,0,0,0,0,0,0,0,0.49,3.92,0.34,2.86,0.19,1.56,0.07,0.46]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.89,-5.84,2.04,-8.54,2.19,-8.11,1.47,-5.08,0,0,0,0,0,0,0,0,0,0,0.72,-10.08,1.69,-11.11,1.94,-10.15,1.54,-7.55,0.55,-3.64,0.41,-3.07,0.27,-1.82,0.13,-0.57,0,0,0.53,-14.76,1.24,-13.66,1.49,-11.19,1.32,-8.03,0.74,-4.85,0.54,-4.09,0.35,-2.43,0.17,-0.76,0,0,0.37,-18.55,0.74,-15.08,0.88,-10.57,0.81,-6.33,0.55,-3.64,0.41,-3.07,0.27,-1.82,0.13,-0.57,0,0,0.31,-20.12,0.24,-14.24,0.14,-7.63,0.04,-2.23,0,0,0,0,0,0,0,0,0,0,0.28,-17.91,0.22,-13.07,0.12,-7.14,0.04,-2.12,0,0,0,-0.87,0.01,-1.17,0,-0.87,0,0,0.19,-12.57,0.14,-9.24,0.09,-5.07,0.04,-1.51,0,0,0.01,-1.75,0.01,-2.33,0.01,-1.75,0,0,0.09,-5.97,0.06,-4.36,0.04,-2.38,0.03,-0.71,0,0,0.01,-2.62,0.02,-3.5,0.01,-2.62,0,0,0,0,0,0,0,0,0,0,0,0,0.02,-3.5,0.02,-4.66,0.02,-3.5]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_01","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[1.77,51.28,1.42,34.68,1.14,20.25,0.95,9.27,0.89,3.02,0.79,2.67,0.55,1.85,0.26,0.85,0,0,1.51,45.01,1.05,31.13,0.74,18.85,0.52,9.49,0.36,4.36,0.33,3.85,0.24,2.65,0.11,1.21,0,0,1.22,38.08,0.65,27.02,0.29,17.18,0.04,9.73,-0.22,5.84,-0.16,5.16,-0.1,3.52,-0.04,1.59,0,0,0.98,32.47,0.38,23.96,-0.07,16.01,-0.42,9.94,-0.69,7.05,-0.57,6.22,-0.38,4.25,-0.18,1.92,0,0,0.89,30.16,0.34,23.56,-0.24,16.12,-0.7,10.05,-0.89,7.54,-0.78,6.68,-0.53,4.62,-0.24,2.14,0,0,0.79,26.86,0.33,21.42,-0.17,14.75,-0.59,9.1,-0.79,6.72,-0.68,5.91,-0.46,4,-0.21,1.77,0,0,0.55,18.85,0.21,15.11,-0.11,10.42,-0.39,6.41,-0.55,4.71,-0.48,4.14,-0.32,2.78,-0.14,1.22,0,0,0.26,8.95,0.09,7.14,-0.06,4.92,-0.17,3.03,-0.26,2.24,-0.23,1.97,-0.15,1.33,-0.07,0.59]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":2,"value":[0.25,-1.32,0.54,-2.81,0.78,-4.02,0.89,-4.52,0.78,-4.01,0.53,-2.78,0.24,-1.28,0,0,0.79,-5.82,0.8,-5.57,0.86,-5.13,0.91,-4.71,0.89,-4.52,0.78,-4.01,0.53,-2.78,0.24,-1.28,0,0,1.66,-12.25,1.43,-10.33,1.23,-7.75,1.04,-5.49,0.89,-4.52,0.78,-4.01,0.54,-2.78,0.24,-1.28,0,0,2.37,-17.46,1.95,-14.06,1.5,-9.77,1.11,-6.09,0.89,-4.52,0.78,-4.01,0.54,-2.77,0.24,-1.28,0,0,2.66,-19.61,2.15,-15.2,1.57,-10.24,1.09,-6.2,0.89,-4.52,0.78,-4.01,0.54,-2.77,0.25,-1.28,0,0,2.37,-17.46,1.93,-13.83,1.43,-9.38,1,-5.62,0.79,-4.03,0.68,-3.54,0.46,-2.4,0.21,-1.06,0,0,1.66,-12.25,1.35,-9.76,1.01,-6.63,0.72,-3.96,0.55,-2.83,0.47,-2.48,0.32,-1.67,0.15,-0.73,0,0,0.79,-5.82,0.64,-4.61,0.48,-3.13,0.34,-1.87,0.26,-1.34,0.23,-1.18,0.15,-0.8,0.07,-0.35]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_02","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.2,105.91,0.08,82.08,-4.7,53.43,-5.11,26.58,-0.1,8.12,-0.08,7.2,-0.05,4.98,-0.01,2.3,0,0,9.21,92.64,2.79,71.42,-0.92,46.06,-1.33,22.9,2.14,8.29,2.55,7.48,3.2,5.41,3.1,2.57,1.28,-0.54,10.16,79.26,5.53,60.63,2.9,38.62,2.51,19.23,4.62,8.47,5.39,7.77,6.62,5.81,6.36,2.78,2.69,-1.13,11.24,66.09,8.35,49.99,6.54,31.25,5.93,15.56,6.63,8.62,7.81,8.05,9.67,6.26,9.31,3.09,3.83,-1.61,12.64,53.41,11.22,39.77,9.77,24.09,8.45,11.89,7.45,8.68,9.19,8.31,11.83,6.82,11.49,3.64,4.3,-1.8,19.67,50.66,20.58,37.4,19.15,22.18,15.84,10.62,11.11,8.36,11.6,7.76,12.42,5.9,10.94,2.62,4.5,-2.19,25.52,39.38,28.4,27.87,26.94,15.89,21.57,7.72,12.77,7.61,12.64,6.79,12.28,4.53,10.22,1.12,4.99,-3.14,30.9,24.69,35.65,15.43,34.03,7.82,26.54,4.15,13.63,6.7,13.13,5.65,11.82,2.98,9.41,-0.58,5.6,-4.32,36.52,11.7,43.32,4.4,41.51,0.59,31.8,0.89,14.89,5.87,13.89,4.59,11.51,1.51,8.63,-2.19,6.15,-5.38]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.28,-9.65,0.22,-6.83,0.12,-3.66,0.04,-1.07,0,0,0,0,0,0,0,0,0,0,0.26,-12.96,0.04,-9.56,-0.23,-5.67,-0.46,-2.48,-0.57,-1.15,-0.49,-1.01,-0.34,-0.68,-0.16,-0.3,0,0,0.24,-16.62,-0.15,-12.59,-0.61,-7.91,-1,-4.04,-1.19,-2.42,-1.03,-2.12,-0.7,-1.43,-0.33,-0.62,0,0,0.22,-19.57,-0.31,-15,-0.92,-9.69,-1.45,-5.28,-1.7,-3.45,-1.47,-3.03,-1.01,-2.05,-0.47,-0.91,0,0,0.21,-20.79,-0.39,-15.85,-1.09,-10.29,-1.67,-5.75,-1.91,-3.87,-1.7,-3.43,-1.18,-2.37,-0.55,-1.09,0,0,0.5,-22.87,-1.61,-18.26,-2.76,-12.42,-2.83,-6.95,-1.7,-3.45,-1.47,-3.03,-1.01,-2.05,-0.47,-0.91,0,0,1.2,-27.92,-2.39,-23.07,-4.07,-15.72,-3.7,-8.1,-1.19,-2.42,-1.02,-2.12,-0.7,-1.43,-0.33,-0.62,0,0,2.07,-34.15,-3,-28.85,-5.24,-19.5,-4.5,-9.23,-0.57,-1.15,-0.49,-1.01,-0.34,-0.68,-0.16,-0.3,0,0,2.86,-39.79,-3.67,-34.14,-6.51,-23.05,-5.38,-10.39]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_03","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[7.91,132.11,5.18,113.03,-0.71,87.91,-4.26,51.86,0,0,0,0,0,0,0,0,0,0,10.57,117.82,9.23,100.32,3.93,76.24,-0.69,43.5,0,0,0,0,0,0,0,0,0,0,13.23,103.97,13.34,87.98,8.56,64.86,2.81,35.3,0,0,0,0,0,0,0,0,0,0,15.88,89.25,17.46,74.91,13.19,53.05,6.3,26.97,0,0,0,0,0,0,0,0,0,0,18.52,72.36,21.56,60.01,17.82,40.13,9.79,18.28,0,0,0,0,0,0,0,0,0,0,20.57,56.54,22.2,47.01,18.59,31.23,11.09,13.97,1.08,0,1.16,0,0.84,0,0.37,0,0,0,23.86,37.5,24.23,31.28,20.79,20.74,13.84,9.2,3.69,-0.01,3.46,-0.01,2.43,0,1.11,0,0,0,27.64,17.17,27,14.44,23.61,9.62,17.05,4.28,6.92,-0.02,6.2,-0.02,4.3,-0.01,1.98,-0.01,0,0,31.17,-2.52,29.78,-1.84,26.21,-1.17,19.8,-0.55,9.84,-0.03,8.72,-0.02,6.03,-0.02,2.79,-0.01]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[2.17,-5.43,1.54,-3.96,0.87,-2.16,0.31,-0.64,0,0,0,0,0,0,0,0,0,0,4.57,-11.43,3.28,-8.4,1.86,-4.61,0.66,-1.37,0,0,0,0,0,0,0,0,0,0,6.52,-16.29,4.68,-11.88,2.62,-6.49,0.88,-1.92,0,0,0,0,0,0,0,0,0,0,7.32,-18.29,5.2,-12.94,2.79,-6.93,0.82,-2.03,0,0,0,0,0,0,0,0,0,0,6.52,-16.29,4.68,-11.88,2.62,-6.49,0.88,-1.92,0,0,0,0,0,0,0,0,0,0,4.57,-11.43,3.29,-8.4,1.86,-4.61,0.65,-1.37,0,0,0,0,0,0,0,0,0,0,2.17,-5.43,1.55,-3.96,0.87,-2.16,0.31,-0.64]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAND.08","timeline":[{"name":"B_HAND.08_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAND.08_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_HAND.08_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_HAND.08_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_00","timeline":[{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-6.6},{"duration":60,"tweenEasing":0},{"x":19.5}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_01","timeline":[{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-12.7},{"duration":60,"tweenEasing":0},{"x":14.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_02","timeline":[{"name":"B_HAND.08","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-3.91,"y":-0.85},{"duration":61}]},{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-34.5},{"duration":60,"tweenEasing":0,"x":15},{"x":25.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_03","timeline":[{"name":"B_HAND.08","type":11,"frame":[{"duration":121,"x":10.98,"y":7.2}]},{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-37.8},{"duration":60,"tweenEasing":0,"x":18.1},{"x":24.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.13","timeline":[{"name":"D_CLOTHES.13_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.13_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"D_CLOTHES.13_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"D_CLOTHES.13_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_00","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":121,"value":[-1.76,-2.49,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,0,0,0,0,0,0,0,0,0,0,0,0,1.82,8.32]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_01","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.94,-6.94,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-10.35,-3.91]},{"duration":60,"tweenEasing":0,"offset":41},{"value":[-2.94,4.41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.73,1.88]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_02","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-6.39,-5.27,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,2.2,-3.18,23.13,-15.27,8.11,-17.93,15.38,-2.68,0,0,0,0,0,0,-7.95,-1.01]},{"duration":60,"tweenEasing":0,"value":[-10.85,-2.42,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,2.2,-3.18,23.13,-15.27,8.11,-17.93,15.38,-2.68,0,0,0,0,0,0,-7.29,1.45]},{"value":[-5.74,4.06,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,2.2,-3.18,23.13,-15.27,8.11,-17.93,23.96,-8.41,0,0,0,0,0,0,-6.62,3.9]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_03","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[4.35,-8.53,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,19.05,-5.98,-7.44,-34.98,12.3,-16.28,0,0,0,0,0,0,-7.5,0.63]},{"duration":60,"tweenEasing":0,"value":[-1.07,-2.83,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,19.05,-5.98,-7.44,-34.98,12.3,-16.28,0,0,0,0,0,0,-2.83,3.97]},{"value":[-4.81,4.89,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,19.05,-5.98,-7.44,-34.98,12.3,-16.28,0,0,0,0,0,0,-2.83,3.97]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.31","timeline":[{"name":"B_CLOTHES.31_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.31_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.31_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.31_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_00","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_01","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_02","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_03","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.32","timeline":[{"name":"B_CLOTHES.32_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.32_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.32_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.32_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_00","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_01","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_02","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_03","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.10","timeline":[{"name":"D_CLOTHES.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"D_CLOTHES.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"D_CLOTHES.10_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_00","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.97,-2.48,0,0,0,0,0,0,0,0,0,0,2.25,10.87,-0.94,0.8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-14.67,-2.59,0,0,0,0,-1.95,-4.97]},{"duration":60,"tweenEasing":0,"offset":12,"value":[2.25,10.87,-0.94,0.8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.19,-3.55]},{"value":[1.12,2.47,0,0,0,0,0,0,0,0,0,0,2.25,10.87,-0.94,0.8,0,0,0,0,0,0,4.08,3.99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.97,1.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_01","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[6.74,-2.52,0,0,0,0,0,0,0,0,0,0,2.25,10.87,0,9.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.49,-1.68,0,0,0,0,4.45,-6.7]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[7.14,5.79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.62,1.63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.45,-0.88,0,0,0,0,4.84,4.98,2.47,3.32]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_02","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[27.2,2.02,0,0,0,0,0,0,0,0,-17.97,-13.9,17.9,8.32,0,9.2,0,0,0,0,0,0,10.91,1.49,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,16.32,1.39,0,0,0,0,23.32,-1.78,12.06,1.16,12.09,3.14]},{"duration":60,"tweenEasing":0,"value":[22.2,3.45,0,0,0,0,0,0,0,0,-17.97,-13.9,17.9,8.32,0,9.2,0,0,0,0,0,0,10.91,1.49,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,10.94,3.65,0,0,0,0,21.45,2.39,12.06,1.16,12.09,3.14]},{"value":[24.93,8.59,0,0,0,0,0,0,0,0,-17.97,-13.9,17.9,8.32,0,9.2,0,0,0,0,0,0,16.79,4.32,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,10.94,3.65,0,0,0,0,27.57,5.93,12.06,1.16,12.09,3.14]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_03","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[24.34,9,0,0,0,0,0,0,0,0,-9.57,-14.01,32.19,11.47,0,9.2,0,0,0,0,0,0,17.99,1.07,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,16.1,2.06,0,0,0,0,26.73,1.74,11.63,2.05,12.09,3.14]},{"duration":60,"tweenEasing":0,"value":[24.34,9,0,0,0,0,0,0,0,0,-9.57,-14.01,32.19,11.47,0,9.2,0,0,0,0,0,0,17.99,1.07,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,13.17,3.75,0,0,0,0,27.92,4.52,11.63,2.05,12.09,3.14]},{"value":[21.76,16.17,0,0,0,0,0,0,0,0,-9.57,-14.01,32.19,11.47,0,9.2,0,0,0,0,0,0,17.85,7.39,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,11.23,9.13,0,0,0,0,31.36,8.29,15.46,4.93,11.46,4.92]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.40","timeline":[{"name":"B_CLOTHES.40_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.40_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.40_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.40_00","timeline":[{"name":"B_CLOTHES.40","type":12,"frame":[{"duration":121,"x":2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.40_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.40_02","timeline":[{"name":"B_CLOTHES.40","type":12,"frame":[{"duration":121,"x":-2.5}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.41","timeline":[{"name":"B_CLOTHES.41_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.41_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.41_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.41_00","timeline":[{"name":"B_CLOTHES.41","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":9.21,"y":-1.49},{"duration":60,"tweenEasing":0},{"x":-17.77,"y":2.88}]},{"name":"B_CLOTHES.41","type":12,"frame":[{"duration":121,"x":-6}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.41_01","timeline":[{"name":"B_CLOTHES.41","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":10.58,"y":-1.34},{"duration":60,"tweenEasing":0},{"x":-25.79,"y":3.26}]},{"name":"B_CLOTHES.41","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":1.4}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.41_02","timeline":[{"name":"B_CLOTHES.41","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":9.3,"y":-0.76},{"duration":60,"tweenEasing":0},{"x":-21.93,"y":1.8}]},{"name":"B_CLOTHES.41","type":12,"frame":[{"duration":121,"x":13.2}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAND.18","timeline":[{"name":"B_HAND.18_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAND.18_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.18_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.18_00","timeline":[{"name":"B_HAND.18","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-32.95,"y":-1.53},{"duration":61}]},{"name":"B_HAND.18","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-3.1},{"duration":60,"tweenEasing":0,"x":-3.1},{"x":2.6}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.18_01","timeline":[{"name":"B_HAND.18","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-35.43,"y":-0.47},{"duration":61}]},{"name":"B_HAND.18","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":4.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.18_02","timeline":[{"name":"B_HAND.18","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-29.39,"y":0.98},{"duration":61}]},{"name":"B_HAND.18","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":5.7}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.18","timeline":[{"name":"D_CLOTHES.18_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.18_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.18_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.18_00","timeline":[{"name":"D_CLOTHES.18","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":39},{"duration":60,"tweenEasing":0,"offset":39},{"value":[-20.34,-1.46,6.33,16.06,-20.82,16.07,-24.31,-0.96,0,0,0,0,-8.27,-1.64,0,0,-17.36,0.85,-15.87,2.01,0,0,0,0,0,0,-13.4,0.35,0,0,-15.05,-2.13]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.18_01","timeline":[{"name":"D_CLOTHES.18","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[11.75,7.92,0,0,0,0,0,0,0,0,5.29,-0.67,6.61,-0.84,0,0,0,0,0,0,0,0,0,0,18.52,-2.34,17.53,0.47]},{"duration":60,"tweenEasing":0,"offset":39},{"value":[-20.34,-1.46,-12.06,10.93,-20.82,16.07,-24.31,-0.96,0,0,0,0,-8.27,-1.64,0,0,-17.36,0.85,-15.87,2.01,0,0,0,0,0,0,-13.4,0.35,0,0,-15.05,-2.13]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.18_02","timeline":[{"name":"D_CLOTHES.18","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":39},{"duration":60,"tweenEasing":0,"offset":39},{"value":[-20.34,-1.46,-12.06,10.93,-20.82,16.07,-24.31,-0.96,0,0,0,0,-8.27,-1.64,0,0,-17.36,0.85,-15.87,2.01,0,0,0,0,0,0,-13.4,0.35,0,0,-15.05,-2.13]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.19","timeline":[{"name":"D_CLOTHES.19_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.19_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.19_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.19_00","timeline":[{"name":"D_CLOTHES.19","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-25.3,-2.97,-36.13,-9.51,-29.33,-9.34,-18.08,1.39,-12.88,2.56,-9.98,1.85,-31.68,1.06,-15.19,0.68,-24.29,-1.37,2.47,-4.91,14.6,1.92,5.2,1.17,14.73,7.42,4.91,2.47,0,0,-31.68,1.06,-16.49,0.38,-21.56,4.71,-20.81,-4.69,-37.59,-3,-44.3,-1.86,-23.28,0.22,-32.55,4.96,-58.86,0.4,-53.37,0.27,-32.68,-0.53,-21.69,-0.79,-27.61,-4.85,12,1.34,15.9,2.22]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[2.35,8.63,0.52,4.18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.97,2.35,13.07,2.61]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.19_01","timeline":[{"name":"D_CLOTHES.19","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-25.3,-2.97,-36.13,-9.51,-29.33,-9.34,-18.08,1.39,-12.88,2.56,-9.98,1.85,-31.68,1.06,-15.19,0.68,-24.29,-1.37,2.47,-4.91,14.6,1.92,5.2,1.17,14.73,7.42,4.91,2.47,0,0,-31.68,1.06,-16.49,0.38,-21.56,4.71,-20.81,-4.69,-37.59,-3,-44.3,-1.75,-23.28,0.22,-32.55,4.96,-58.86,0.4,-53.37,0.27,-32.68,-0.53,-21.69,-0.79,-27.61,-4.85,12,1.34,15.9,2.22]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[2.35,8.63,0.52,4.18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.97,2.35,13.07,2.61]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.19_02","timeline":[{"name":"D_CLOTHES.19","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-25.3,-2.97,-36.13,-9.51,-29.33,-9.34,-18.08,1.39,-12.88,2.56,-9.98,1.85,-31.68,1.06,-15.19,0.68,-24.29,-1.37,2.47,-4.91,14.6,1.92,5.2,1.17,14.73,7.42,4.91,2.47,0,0,-31.68,1.06,-16.49,0.38,-21.56,4.71,-20.81,-4.69,-37.59,-3,-44.3,-1.75,-23.28,0.22,-32.55,4.96,-58.86,0.4,-53.37,0.27,-32.68,-0.53,-21.69,-0.79,-27.61,-4.85,12,1.34,15.9,2.22]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[2.35,8.63,0.52,4.18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.97,2.35,13.07,2.61]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAND.17","timeline":[{"name":"B_HAND.17_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAND.17_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.17_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.17_00","timeline":[{"name":"B_HAND.17","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-14.07,"y":4.14},{"duration":61}]},{"name":"B_HAND.17","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-1.7},{"duration":60,"tweenEasing":0,"x":2},{"x":-1.7}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.17_01","timeline":[{"name":"B_HAND.17","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-5.75,"y":-1.58},{"duration":61}]},{"name":"B_HAND.17","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":0.9},{"duration":60,"tweenEasing":0},{"x":-3.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.17_02","timeline":[{"name":"B_HAND.17","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-12,"y":0.31},{"duration":61}]},{"name":"B_HAND.17","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-5},{"duration":60,"tweenEasing":0,"x":-7.1},{"x":-2.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.16","timeline":[{"name":"D_CLOTHES.16_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.16_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.16_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.16_00","timeline":[{"name":"D_CLOTHES.16","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":47},{"duration":60,"tweenEasing":0,"offset":47},{"offset":10,"value":[-25.72,2.97,-24.14,0.44,-24.27,1.77,-30.78,-0.18,-21,-4.63,-1.3,-14.85,0,0,-13.4,0.1,0,0,0,0,0,0,0,0,0,0,0,0,-25.35,-1.01,-33.81,3.56,-26.92,1.52,-31.74,-4.28,-25.72,2.97]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.16_01","timeline":[{"name":"D_CLOTHES.16","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":47},{"duration":60,"tweenEasing":0,"offset":47},{"offset":10,"value":[-25.72,2.97,-24.14,0.44,-24.27,1.77,-30.78,-0.18,-21,-4.63,-1.3,-14.85,0,0,-13.4,0.1,0,0,0,0,0,0,0,0,0,0,0,0,-25.35,-1.01,-33.81,3.56,-26.92,1.52,-31.74,-4.28,-25.72,2.97]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.16_02","timeline":[{"name":"D_CLOTHES.16","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":47},{"duration":60,"tweenEasing":0,"offset":47},{"offset":10,"value":[-25.72,2.97,-24.14,0.44,-24.27,1.77,-30.78,-0.18,-21,-4.63,-1.3,-14.85,0,0,-13.4,0.1,0,0,0,0,0,0,0,0,0,0,0,0,-25.35,-1.01,-33.81,3.56,-26.92,1.52,-31.74,-4.28,-25.72,2.97]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.17","timeline":[{"name":"D_CLOTHES.17_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.17_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.17_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.17_00","timeline":[{"name":"D_CLOTHES.17","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.24,-1.85,-10.2,3.38,1.05,-1.57,-5.23,1.04,0,0,-11.17,0.86,20.87,-1.57,20.55,5.71,30,-9.33,28.83,-7.41,39.18,-19.91,29.24,3.61,0,0,-3.13,-2.1,0,0,-19.09,-0.3,-27.45,-1.36,-1.04,-5.23,-31.39,-3.57,-4.04,3.79,3.55,1.94,26.92,-11.98,27.21,-6.75,35.34,-15.49,9.39,0.9,20.7,2.38,8.21,4.75,0.92,0.36,3.17,4.07,-5.93,-0.69,-13.37,5.81,-15.02,2.54]},{"duration":61,"offset":65}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.17_01","timeline":[{"name":"D_CLOTHES.17","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.24,-1.85,-10.2,3.38,1.05,-1.57,-5.23,1.04,0,0,-11.17,0.86,20.87,-1.57,20.55,5.71,30,-9.33,31.46,1.55,43.13,-8.66,29.24,3.61,0,0,-3.13,-2.1,0,0,-19.09,-0.3,-27.45,-1.36,-1.04,-5.23,-31.39,-3.57,-4.04,3.79,3.55,1.94,30.08,-5.96,27.21,-6.75,35.34,-15.49,9.39,0.9,20.7,2.38,8.21,4.75,0.92,0.36,3.17,4.07,-5.93,-0.69,-13.37,5.81,-15.02,2.54]},{"duration":61,"offset":65}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.17_02","timeline":[{"name":"D_CLOTHES.17","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.24,-1.85,-10.2,3.38,1.05,-1.57,-5.23,1.04,0,0,-11.17,0.86,20.87,-1.57,20.55,5.71,30,-9.33,31.46,1.55,45.73,-2.37,29.24,3.61,0,0,-3.13,-2.1,0,0,-19.09,-0.3,-27.45,-1.36,-1.04,-5.23,-31.39,-3.57,-4.04,3.79,3.55,1.94,30.08,-5.96,27.21,-6.75,35.34,-15.49,9.39,0.9,20.7,2.38,8.21,4.75,0.92,0.36,3.17,4.07,-5.93,-0.69,-13.37,5.81,-15.02,2.54]},{"duration":60,"tweenEasing":0,"offset":65},{"offset":34,"value":[8.14,5.12,16.03,0.91,14.7,0.95,13.36,0.98,0,0,0,0,0,0,0,0,6.16,0.45,0,0,6.7,0.49,0,0,6.53,0.42,0,0,7.02,0.45,4.41,0.28]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_NECK.03","timeline":[{"name":"B_NECK.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_NECK.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_NECK.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NECK.03_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_NECK.03_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_00","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,5.36,21.02,11.28,21.02,16.08,21.02,18.05,21.02,18.67,20.93,20.17,20.72,22.02,20.47,23.69,20.24,0,21.02,4.05,21.03,8.52,21.07,12.14,21.11,13.65,21.13,13.43,21.05,13.16,20.87,12.85,20.65,12.56,20.47,0,21.02,2.75,21.06,5.78,21.16,8.25,21.26,9.31,21.31,8.15,21.24,5.99,21.06,3.42,20.87,1.06,20.72,0,21.02,1.42,21.07,2.98,21.18,4.26,21.29,4.83,21.35,2.94,21.29,-0.89,21.16,-5.49,21.02,-9.71,20.93,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,-2.04,21.02,-6.98,21.02,-13.09,21.02,-18.62,21.02,0,21.02,-5.67,20.97,-11.83,20.85,-17.01,20.74,-19.71,20.69,-20.13,20.69,-21.13,20.69,-22.35,20.69,-23.46,20.69,0,21.02,-10.87,20.93,-22.72,20.72,-32.62,20.52,-37.66,20.43,-35.93,20.48,-32.42,20.58,-28.2,20.68,-24.33,20.72,0,21.02,-15.44,20.93,-32.35,20.74,-46.33,20.55,-53,20.47,-49.4,20.54,-41.64,20.69,-32.21,20.84,-23.62,20.91,0,21.02,-19.26,21.02,-40.55,21.02,-57.78,21.02,-64.88,21.02,-60.37,21.02,-49.43,21.02,-35.92,21.02,-23.69,21.02]},{"duration":60,"tweenEasing":0,"offset":2,"value":[5.36,0,11.28,0,16.08,0,18.05,0,18.67,-0.09,20.17,-0.29,22.02,-0.55,23.69,-0.78,0,0,4.05,0.02,8.52,0.05,12.14,0.09,13.65,0.11,13.43,0.03,13.16,-0.15,12.85,-0.36,12.56,-0.55,0,0,2.75,0.05,5.78,0.15,8.25,0.25,9.31,0.29,8.15,0.22,5.99,0.05,3.42,-0.15,1.06,-0.29,0,0,1.42,0.05,2.98,0.16,4.26,0.28,4.83,0.33,2.94,0.27,-0.89,0.15,-5.49,0.01,-9.71,-0.09,0,0,0,0,0,0,0,0,0,0,-2.04,0,-6.98,0,-13.09,0,-18.62,0,0,0,-5.67,-0.05,-11.83,-0.16,-17.01,-0.28,-19.71,-0.33,-20.13,-0.33,-21.13,-0.33,-22.35,-0.33,-23.46,-0.33,0,0,-10.87,-0.09,-22.72,-0.29,-32.62,-0.49,-37.66,-0.58,-35.93,-0.54,-32.42,-0.44,-28.2,-0.34,-24.33,-0.29,0,0,-15.44,-0.09,-32.35,-0.27,-46.33,-0.46,-53,-0.55,-49.4,-0.48,-41.64,-0.33,-32.21,-0.18,-23.62,-0.11,0,0,-19.26,0,-40.55,0,-57.78,0,-64.88,0,-60.37,0,-49.43,0,-35.92,0,-23.69]},{"offset":1,"value":[-11.29,5.36,-11.29,11.28,-11.29,16.08,-11.29,18.05,-11.29,18.67,-11.37,20.17,-11.58,22.02,-11.83,23.69,-12.07,1,-7.82,4.75,-8.76,8.91,-9.86,12.28,-10.79,13.65,-11.18,13.52,-10.96,13.42,-10.43,13.33,-9.8,13.23,-9.29,2.12,-3.99,4.25,-5.9,6.63,-8.22,8.55,-10.17,9.31,-10.99,8.34,-10.43,6.55,-9.09,4.43,-7.51,2.47,-6.23,3.01,-0.89,3.56,-3.69,4.17,-7.02,4.66,-9.79,4.83,-10.96,3.21,-10.12,-0.09,-8.12,-4.06,-5.74,-7.7,-3.75,3.38,0.39,2.38,-3.08,1.27,-6.91,0.37,-10.01,0,-11.29,-1.79,-10.35,-6.14,-8.08,-11.5,-5.27,-16.36,-2.72,3.01,-0.89,-3.51,-3.76,-10.63,-7.32,-16.61,-10.34,-19.71,-11.62,-19.87,-10.72,-20.33,-8.61,-20.92,-6.09,-21.45,-3.99,2.12,-3.99,-9.35,-6.01,-21.85,-8.63,-32.31,-10.9,-37.66,-11.87,-35.74,-11.19,-31.86,-9.59,-27.19,-7.72,-22.92,-6.23,1,-7.82,-14.73,-8.84,-31.94,-10.18,-46.18,-11.34,-53,-11.83,-49.32,-11.47,-41.38,-10.62,-31.73,-9.63,-22.95,-8.85,0,-11.29,-19.26,-11.29,-40.55,-11.29,-57.78,-11.29,-64.88,-11.29,-60.37,-11.29,-49.43,-11.29,-35.92,-11.29,-23.69,-11.29]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_01","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,5.36,21.02,11.28,21.02,16.08,21.02,18.05,21.02,18.67,20.93,20.17,20.72,22.02,20.47,23.69,20.24,0,21.02,4.05,21.03,8.52,21.07,12.14,21.11,13.65,21.13,14.16,21.05,15.34,20.87,16.78,20.65,18.09,20.47,0,21.02,2.75,21.06,5.78,21.16,8.25,21.26,9.31,21.31,9.76,21.24,10.65,21.07,11.71,20.87,12.69,20.72,0,21.02,1.42,21.07,2.98,21.18,4.26,21.29,4.83,21.35,5.14,21.29,5.68,21.16,6.3,21.02,6.88,20.93,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,-4.08,20.91,-8.53,20.69,-12.23,20.46,-14,20.36,-13.13,20.41,-11.25,20.52,-8.96,20.64,-6.88,20.69,0,21.02,-7.71,20.93,-16.19,20.72,-23.13,20.52,-26.23,20.43,-24.68,20.48,-21.09,20.58,-16.69,20.68,-12.69,20.72,0,21.02,-11.18,20.98,-23.52,20.91,-33.54,20.83,-37.76,20.8,-35.58,20.81,-30.36,20.85,-23.92,20.89,-18.09,20.91,0,21.02,-14.74,21.02,-31.03,21.02,-44.22,21.02,-49.65,21.02,-46.81,21.02,-39.91,21.02,-31.4,21.02,-23.69,21.02]},{"duration":60,"tweenEasing":0,"offset":2,"value":[5.36,0,11.28,0,16.08,0,18.05,0,18.67,-0.09,20.17,-0.29,22.02,-0.55,23.69,-0.78,0,0,4.05,0.02,8.52,0.05,12.14,0.09,13.65,0.11,14.16,0.03,15.34,-0.15,16.78,-0.36,18.09,-0.55,0,0,2.75,0.05,5.78,0.15,8.25,0.25,9.31,0.29,9.76,0.22,10.65,0.05,11.71,-0.15,12.69,-0.29,0,0,1.42,0.05,2.98,0.16,4.26,0.28,4.83,0.33,5.14,0.27,5.68,0.15,6.3,0.01,6.88,-0.09,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-4.08,-0.1,-8.53,-0.33,-12.23,-0.55,-14,-0.66,-13.13,-0.61,-11.25,-0.49,-8.96,-0.38,-6.88,-0.33,0,0,-7.71,-0.09,-16.19,-0.29,-23.13,-0.49,-26.23,-0.58,-24.68,-0.54,-21.09,-0.44,-16.69,-0.34,-12.69,-0.29,0,0,-11.18,-0.03,-23.52,-0.11,-33.54,-0.18,-37.76,-0.22,-35.58,-0.2,-30.36,-0.16,-23.92,-0.13,-18.09,-0.11,0,0,-14.74,0,-31.03,0,-44.22,0,-49.65,0,-46.81,0,-39.91,0,-31.4,0,-23.69]},{"offset":1,"value":[-11.29,5.36,-11.29,11.28,-11.29,16.08,-11.29,18.05,-11.29,18.67,-11.37,20.17,-11.58,22.02,-11.83,23.69,-12.07,1,-7.82,4.75,-8.76,8.91,-9.86,12.28,-10.79,13.65,-11.18,14.11,-10.96,15.21,-10.43,16.55,-9.81,17.75,-9.29,2.12,-3.99,4.25,-5.9,6.63,-8.22,8.55,-10.17,9.31,-10.99,9.66,-10.43,10.37,-9.1,11.22,-7.52,11.99,-6.23,3.01,-0.89,3.56,-3.69,4.17,-7.02,4.66,-9.79,4.83,-10.96,5.01,-10.12,5.28,-8.13,5.59,-5.75,5.87,-3.75,3.38,0.39,2.38,-3.08,1.27,-6.91,0.37,-10.01,0,-11.29,-0.12,-10.35,-0.42,-8.08,-0.79,-5.27,-1.13,-2.72,3.01,-0.89,-1.92,-3.83,-7.34,-7.5,-11.83,-10.62,-14,-11.94,-13.26,-11,-11.65,-8.77,-9.68,-6.14,-7.88,-3.99,2.12,-3.99,-6.2,-6.03,-15.33,-8.65,-22.83,-10.91,-26.23,-11.87,-24.78,-11.19,-21.37,-9.59,-17.19,-7.71,-13.4,-6.23,1,-7.82,-10.47,-8.8,-23.11,-10.03,-33.39,-11.07,-37.76,-11.51,-35.63,-11.19,-30.49,-10.45,-24.15,-9.57,-18.42,-8.85,0,-11.29,-14.74,-11.29,-31.03,-11.29,-44.22,-11.29,-49.65,-11.29,-46.81,-11.29,-39.91,-11.29,-31.4,-11.29,-23.69,-11.29]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_02","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,1,-7.82,0.71,-8.77,0.4,-9.92,0.14,-10.88,0,-11.29,-0.05,-10.99,-0.13,-10.28,-0.23,-9.44,-0.33,-8.74,2.12,-3.99,1.5,-5.95,0.85,-8.37,0.3,-10.42,0,-11.29,-0.1,-10.65,-0.28,-9.15,-0.5,-7.37,-0.71,-5.94,3.01,-0.89,2.14,-3.74,1.19,-7.18,0.4,-10.07,0,-11.29,-0.13,-10.4,-0.4,-8.28,-0.71,-5.75,-1,-3.66,3.38,0.39,2.38,-3.08,1.27,-6.91,0.37,-10.01,0,-11.29,-0.12,-10.35,-0.42,-8.08,-0.79,-5.27,-1.13,-2.72,3.01,-0.89,2.14,-3.74,1.19,-7.18,0.4,-10.07,0,-11.29,-0.13,-10.4,-0.4,-8.28,-0.71,-5.75,-1,-3.66,2.12,-3.99,1.5,-5.95,0.85,-8.37,0.3,-10.42,0,-11.29,-0.1,-10.65,-0.28,-9.15,-0.5,-7.37,-0.71,-5.94,1,-7.82,0.71,-8.77,0.4,-9.92,0.14,-10.88,0,-11.29,-0.05,-10.99,-0.13,-10.28,-0.23,-9.44,-0.33,-8.74,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_03","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,1.34,21.02,1.24,21.02,1.14,21.02,1.05,21.02,1,21.02,1.82,21.02,1.86,21.02,1.23,21.02,0,21.02,2.82,21.02,2.62,21.02,2.4,21.02,2.21,21.02,2.12,21.02,3.71,21.02,3.77,21.02,2.48,21.02,0,21.02,4.02,21.02,3.73,21.02,3.41,21.02,3.15,21.02,3.01,21.02,5.45,21.02,5.58,21.02,3.68,21.02,0,21.02,4.51,21.02,4.18,21.02,3.81,21.02,3.51,21.02,3.38,21.02,6.8,21.02,7.14,21.02,4.75,21.02,0,21.02,12.61,21.84,12.61,21.76,12.62,21.71,12.62,21.68,12.57,21.67,14.52,21.63,13.59,21.53,10.41,21.44,5.57,21.43,20.17,22.18,20.6,21.98,21.08,21.8,21.46,21.66,21.58,21.6,22.3,21.58,20.34,21.55,16.57,21.55,11.85,21.6,27.52,22.33,28.41,22,29.41,21.64,30.2,21.35,30.52,21.24,30.1,21.28,27.19,21.38,22.92,21.52,18.41,21.67,34.98,22.57,36.32,22.11,37.8,21.6,39,21.19,39.49,21.02,37.89,21.1,33.99,21.31,29.18,21.56,24.82,21.8]},{"duration":60,"tweenEasing":0,"offset":18,"value":[1.34,0,1.24,0,1.14,0,1.05,0,1,0,1.82,0,1.86,0,1.23,0,0,0,2.82,0,2.62,0,2.4,0,2.21,0,2.12,0,3.71,0,3.77,0,2.48,0,0,0,4.02,0,3.73,0,3.41,0,3.15,0,3.01,0,5.45,0,5.58,0,3.68,0,0,0,4.51,0,4.18,0,3.81,0,3.51,0,3.38,0,6.8,0,7.14,0,4.75,0,0,0,12.61,0.83,12.61,0.75,12.62,0.69,12.62,0.67,12.57,0.66,14.52,0.61,13.59,0.51,10.41,0.42,5.57,0.41,20.17,1.17,20.6,0.97,21.08,0.78,21.46,0.64,21.58,0.58,22.3,0.57,20.34,0.54,16.57,0.53,11.85,0.58,27.52,1.31,28.41,0.98,29.41,0.62,30.2,0.34,30.52,0.22,30.1,0.26,27.19,0.36,22.92,0.51,18.41,0.66,34.98,1.56,36.32,1.09,37.8,0.58,39,0.17,39.49,0,37.89,0.09,33.99,0.29,29.18,0.55,24.82,0.78]},{"offset":1,"value":[-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,2.34,-7.82,1.95,-8.77,1.53,-9.92,1.19,-10.88,1,-11.29,1.77,-10.99,1.73,-10.28,0.99,-9.44,-0.33,-8.74,4.94,-3.99,4.12,-5.95,3.24,-8.36,2.51,-10.42,2.12,-11.29,3.61,-10.65,3.49,-9.14,1.98,-7.37,-0.71,-5.94,7.03,-0.89,5.87,-3.74,4.6,-7.18,3.54,-10.07,3.01,-11.29,5.32,-10.4,5.18,-8.27,2.96,-5.75,-1,-3.66,7.9,0.39,6.56,-3.08,5.08,-6.91,3.88,-10.01,3.38,-11.29,6.68,-10.35,6.72,-8.08,3.96,-5.27,-1.13,-2.72,15.62,-0.06,14.75,-2.99,13.81,-6.48,13.01,-9.41,12.57,-10.63,14.38,-9.78,13.19,-7.76,9.69,-5.33,4.57,-3.25,22.28,-2.82,22.11,-4.98,21.93,-7.59,21.76,-9.78,21.58,-10.7,22.19,-10.08,20.05,-8.61,16.06,-6.84,11.14,-5.35,28.53,-6.51,29.12,-7.79,29.8,-9.3,30.34,-10.55,30.52,-11.07,30.05,-10.73,27.06,-9.92,22.69,-8.94,18.07,-8.09,34.98,-9.73,36.32,-10.19,37.8,-10.7,39,-11.12,39.49,-11.29,37.89,-11.2,33.99,-10.99,29.18,-10.74,24.82,-10.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_04","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,6.87,21.02,5.17,21.02,3.32,21.02,1.78,21.02,1,21.02,1.82,21.02,1.86,21.02,1.23,21.02,0,21.02,14.46,21.02,10.92,21.02,7.07,21.02,3.83,21.02,2.12,21.02,3.71,21.02,3.77,21.02,2.48,21.02,0,21.02,20.6,21.02,15.52,21.02,9.99,21.02,5.37,21.02,3.01,21.02,5.45,21.02,5.58,21.02,3.68,21.02,0,21.02,23.13,21.02,17.27,21.02,10.79,21.02,5.54,21.02,3.38,21.02,6.8,21.02,7.14,21.02,4.75,21.02,0,21.02,29.19,21.84,24.4,21.76,19.2,21.71,14.84,21.68,12.57,21.67,14.52,21.63,13.59,21.53,10.41,21.44,5.57,21.43,31.8,22.18,28.9,21.99,25.76,21.8,23.08,21.66,21.58,21.6,22.3,21.58,20.34,21.55,16.57,21.55,11.85,21.6,33.05,22.33,32.34,22,31.59,21.64,30.93,21.35,30.52,21.24,30.1,21.28,27.19,21.38,22.92,21.52,18.41,21.67,34.98,22.57,36.32,22.11,37.8,21.6,39,21.19,39.49,21.02,37.89,21.1,33.99,21.31,29.18,21.56,24.82,21.8]},{"duration":60,"tweenEasing":0,"offset":18,"value":[3.85,0.35,3.03,0.25,2.13,0.14,1.38,0.04,1,0,1.82,0,1.86,0,1.23,0,0,0,8.11,0.73,6.39,0.53,4.52,0.29,2.94,0.09,2.12,0,3.71,0,3.77,0,2.48,0,0,0,11.56,1.04,9.09,0.76,6.39,0.41,4.15,0.12,3.01,0,5.45,0,5.58,0,3.68,0,0,0,12.98,1.17,10.13,0.82,6.98,0.44,4.43,0.13,3.38,0,6.8,0,7.14,0,4.75,0,0,0,20.14,1.87,17.97,1.5,15.61,1.11,13.62,0.79,12.57,0.66,14.52,0.61,13.59,0.51,10.41,0.42,5.57,0.41,25.46,1.9,24.37,1.5,23.2,1.07,22.19,0.73,21.58,0.58,22.3,0.57,20.34,0.54,16.57,0.53,11.85,0.58,30.03,1.66,30.2,1.23,30.4,0.76,30.53,0.38,30.52,0.22,30.1,0.26,27.19,0.36,22.92,0.51,18.41,0.66,34.98,1.56,36.32,1.09,37.8,0.58,39,0.17,39.49,0,37.89,0.09,33.99,0.29,29.18,0.55,24.82,0.78]},{"offset":1,"value":[-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,3.85,-7.82,3.02,-8.77,2.13,-9.92,1.39,-10.88,1,-11.29,1.77,-10.99,1.73,-10.28,0.99,-9.44,-0.33,-8.74,8.11,-3.99,6.38,-5.94,4.52,-8.36,2.95,-10.42,2.12,-11.29,3.61,-10.65,3.49,-9.14,1.98,-7.37,-0.71,-5.94,11.56,-0.89,9.09,-3.73,6.39,-7.17,4.15,-10.07,3.01,-11.29,5.32,-10.4,5.18,-8.27,2.96,-5.75,-1,-3.66,12.98,0.39,10.13,-3.08,6.98,-6.91,4.43,-10.01,3.38,-11.29,6.68,-10.35,6.72,-8.08,3.96,-5.27,-1.13,-2.72,20.14,-0.06,17.97,-2.99,15.61,-6.48,13.62,-9.4,12.57,-10.63,14.38,-9.78,13.19,-7.76,9.69,-5.33,4.57,-3.25,25.46,-2.82,24.37,-4.98,23.2,-7.58,22.2,-9.78,21.58,-10.7,22.19,-10.08,20.05,-8.61,16.06,-6.84,11.14,-5.35,30.03,-6.51,30.19,-7.79,30.4,-9.3,30.54,-10.55,30.52,-11.07,30.05,-10.73,27.06,-9.92,22.69,-8.94,18.07,-8.09,34.98,-9.73,36.32,-10.19,37.8,-10.7,39,-11.12,39.49,-11.29,37.89,-11.2,33.99,-10.99,29.18,-10.74,24.82,-10.51]}]}]}],"canvas":{"y":-690,"width":1280,"height":1380}}],"textureAtlas":[{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_00.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_00"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_01.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_01"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_02.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_02"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_03.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_03"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_04.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_04"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/body/body_ske.json b/Egret/Demos/resource/you_xin/body/body_ske.json
index d29ca340..8d6ff234 100644
--- a/Egret/Demos/resource/you_xin/body/body_ske.json
+++ b/Egret/Demos/resource/you_xin/body/body_ske.json
@@ -1 +1 @@
-{"frameRate":30,"name":"body","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"body","aabb":{"x":-929,"y":-1537.14,"width":1142.91,"height":1585.72},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"ik_foot_r","parent":"nv","transform":{"x":124.92,"y":-122.27,"skX":87.84,"skY":87.84}},{"name":"ik_foot_l","parent":"nv","transform":{"x":-58.79,"y":-68.24,"skX":100.64,"skY":100.64}},{"name":"ding","parent":"nv","transform":{"y":-50}},{"name":"pelvis","parent":"nv","transform":{"x":-92.88,"y":-910.14}},{"length":138,"name":"dress0201","parent":"pelvis","transform":{"x":1.75,"y":17.13,"skX":89.26,"skY":89.26}},{"length":169,"name":"dress0301","parent":"pelvis","transform":{"x":113.59,"y":-30.15,"skX":74.24,"skY":74.24}},{"length":93,"name":"bag0101","parent":"pelvis","transform":{"x":75.39,"y":-79.46,"skX":69.69,"skY":69.69}},{"length":407,"name":"thigh_l","parent":"pelvis","transform":{"x":-36.25,"y":30.43,"skX":88.164,"skY":88.164}},{"length":393,"name":"thigh_r","parent":"pelvis","transform":{"x":77.79,"y":26.43,"skX":93.63,"skY":93.63}},{"length":154,"name":"dress0101","parent":"pelvis","transform":{"x":-82.25,"y":-25.45,"skX":102.82,"skY":102.82}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":408,"name":"calf_l","parent":"thigh_l","transform":{"x":407.97,"y":-1.43,"skX":-2.7,"skY":-2.7}},{"length":176,"name":"dress0102","parent":"dress0101","transform":{"x":154.48,"y":1.04,"skX":-1.8,"skY":-1.8}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":161,"name":"dress0202","parent":"dress0201","transform":{"x":138.34,"y":-0.27,"skX":-1.35,"skY":-1.35}},{"length":161,"name":"dress0302","parent":"dress0301","transform":{"x":169.23,"y":-0.5,"skX":2.25,"skY":2.25}},{"length":410,"name":"calf_r","parent":"thigh_r","transform":{"x":395.5,"y":-1.18,"skX":-29.2,"skY":-29.2}},{"length":95,"name":"bag0102","parent":"bag0101","transform":{"x":93.12,"y":-0.29}},{"inheritRotation":false,"length":97,"name":"foot_r","parent":"calf_r","transform":{"x":410.23,"y":-1.14,"skX":87.83,"skY":87.83}},{"length":182,"name":"dress0203","parent":"dress0202","transform":{"x":161.4,"y":-0.1,"skX":-0.9,"skY":-0.9}},{"length":181,"name":"dress0303","parent":"dress0302","transform":{"x":162.95,"y":-0.17,"skX":-1.36,"skY":-1.36}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"inheritRotation":false,"length":108,"name":"foot_l","parent":"calf_l","transform":{"x":411.64,"y":0.23,"skX":103.24,"skY":103.24}},{"length":171,"name":"dress0103","parent":"dress0102","transform":{"x":176.75,"y":-0.35,"skX":-0.9,"skY":-0.9}},{"length":71,"name":"hand_r","parent":"spine2","transform":{"x":-153.8253,"y":279.9232,"skX":121.868,"skY":121.868}},{"length":71,"name":"neck","parent":"spine2","transform":{"x":172.12,"y":0.19,"skX":-17.89,"skY":-17.89}},{"length":195,"name":"upperarm_l","parent":"spine2","transform":{"x":93.55,"y":-65.17,"skX":-179.09,"skY":-179.09}},{"length":200,"name":"upperarm_r","parent":"spine2","transform":{"x":139.2,"y":93.66,"skX":150.94,"skY":150.94}},{"name":"xiong_l","parent":"spine2","transform":{"x":11.36,"y":-82.7}},{"name":"xiong_r","parent":"spine2","transform":{"x":35.43,"y":29.27}},{"length":200,"name":"dress0204","parent":"dress0203","transform":{"x":183.88,"y":1.16,"skX":2.25,"skY":2.25}},{"length":193,"name":"dress0104","parent":"dress0103","transform":{"x":171.1,"y":-0.63}},{"length":54,"name":"hand_l","parent":"spine2","transform":{"x":-263.6517,"y":-107.4376,"skX":-161.27,"skY":-161.27}},{"length":192,"name":"dress0304","parent":"dress0303","transform":{"x":181.23,"y":-0.11}},{"length":88,"name":"head1","parent":"neck","transform":{"x":71.14,"y":-0.04,"skX":-13.29,"skY":-13.29}},{"length":147,"name":"dress0305","parent":"dress0304","transform":{"x":192.32,"y":-0.67,"skX":0.45,"skY":0.45}},{"length":166,"name":"forearm_l","parent":"upperarm_l","transform":{"x":194.88,"y":0.53,"skX":12.43,"skY":12.43}},{"length":178,"name":"dress0105","parent":"dress0104","transform":{"x":193.05,"y":-1.28,"skX":0.9,"skY":0.9}},{"length":157,"name":"dress0205","parent":"dress0204","transform":{"x":200.46,"y":0.5}},{"length":88,"name":"head","parent":"neck","transform":{"x":71.14,"y":-0.04,"skX":-13.29,"skY":-13.29}},{"length":90,"name":"finger_l","parent":"hand_l","transform":{"x":80.65,"y":-18.79,"skX":-37.65,"skY":-37.65}},{"name":"bone_ikTarget","parent":"hand_l","transform":{"x":-0.8992,"y":-0.0558,"skX":-126.65,"skY":-126.65}},{"length":150,"name":"forearm_r","parent":"upperarm_r","transform":{"x":200.51,"y":0.29,"skX":-11.56,"skY":-11.56}},{"name":"bone_ikTarget1","parent":"hand_r","transform":{"x":-0.7403,"y":0.6485,"skX":-66.4,"skY":-66.4}},{"length":74,"name":"figner_r","parent":"hand_r","transform":{"x":74.81,"y":33.28,"skX":24.91,"skY":24.91}},{"name":"face","parent":"head","transform":{"x":28.99,"y":-29.94,"skX":-2.1,"skY":-2.1}},{"name":"face1","parent":"head1","transform":{"x":28.99,"y":-29.94,"skX":-2.1,"skY":-2.1}},{"name":"hair","parent":"head","transform":{"x":187.01,"y":-14.39}},{"length":60,"name":"hair0201","parent":"hair","transform":{"x":-18.14,"y":-16.81,"skX":-156.55,"skY":-156.55}},{"length":60,"name":"hair0301","parent":"hair","transform":{"x":-22.37,"y":20.04,"skX":170.91,"skY":170.91}},{"length":100,"name":"hair0501","parent":"hair","transform":{"x":-113.42,"y":-63.08,"skX":-162.11,"skY":-162.11}},{"length":80,"name":"hair0101","parent":"hair","transform":{"x":-41.95,"y":-73.17,"skX":-167.14,"skY":-167.14}},{"length":80,"name":"hair0401","parent":"hair","transform":{"x":-58.34,"y":59.16,"skX":-179.5,"skY":-179.5}},{"length":100,"name":"hair0601","parent":"hair","transform":{"x":-131.71,"y":66.14,"skX":-172.88,"skY":-172.88}},{"length":70,"name":"hair0202","parent":"hair0201","transform":{"x":62.78,"y":-0.2,"skX":-13.15,"skY":-13.15}},{"length":100,"name":"hair0102","parent":"hair0101","transform":{"x":83.27,"y":-0.72,"skX":-5.51,"skY":-5.51}},{"length":70,"name":"hair0302","parent":"hair0301","transform":{"x":63.79,"y":-0.2,"skX":0.51,"skY":0.51}},{"length":100,"name":"hair0402","parent":"hair0401","transform":{"x":81.06,"y":0.4,"skX":7.99,"skY":7.99}},{"length":120,"name":"hair0502","parent":"hair0501","transform":{"x":104.79,"y":-0.11,"skX":0.45,"skY":0.45}},{"length":120,"name":"hair0602","parent":"hair0601","transform":{"x":100.91,"y":0.05,"skX":2.44,"skY":2.44}},{"length":100,"name":"hair0403","parent":"hair0402","transform":{"x":99.23,"y":0.19,"skX":3.86,"skY":3.86}},{"length":140,"name":"hair0503","parent":"hair0502","transform":{"x":119.54,"y":-0.01,"skX":0.45,"skY":0.45}},{"inheritScale":false,"length":140,"name":"hair0603","parent":"hair0602","transform":{"x":119.43,"y":-0.01,"skX":0.83,"skY":0.83}},{"length":100,"name":"hair0103","parent":"hair0102","transform":{"x":99.3,"y":-0.01,"skX":-2.23,"skY":-2.23}},{"length":146,"name":"hair0504","parent":"hair0503","transform":{"x":144.09,"y":0.47,"skX":4.95,"skY":4.95}},{"length":136,"name":"hair0604","parent":"hair0603","transform":{"x":142.27,"y":-0.51,"skX":-3.46,"skY":-3.46}},{"length":159,"name":"hair0605","parent":"hair0604","transform":{"x":136.59,"y":-0.47,"skX":-2.7,"skY":-2.7}},{"length":148,"name":"hair0505","parent":"hair0504","transform":{"x":146.28,"y":1.15,"skX":0.9,"skY":0.9}}],"slot":[{"name":"logo","parent":"root"},{"name":"blank","parent":"nv"},{"name":"1061","parent":"nv"},{"name":"1059","parent":"nv"},{"name":"1060","parent":"nv"},{"name":"1088","parent":"nv"},{"name":"1087","parent":"nv"},{"name":"1084","parent":"nv"},{"name":"1073","parent":"nv"},{"name":"1058","parent":"nv"},{"name":"1057","parent":"nv"},{"name":"1065","parent":"nv"},{"name":"1074","parent":"nv"},{"name":"1055","parent":"nv"},{"name":"1056","parent":"nv"},{"name":"1066","parent":"nv"},{"name":"1064","parent":"nv"},{"name":"1079","parent":"nv"},{"name":"1039","parent":"nv"},{"name":"a_arm_L","parent":"nv"},{"name":"1054","parent":"nv"},{"name":"1070","parent":"nv"},{"name":"1040","parent":"nv"},{"name":"1042","parent":"nv"},{"name":"1041","parent":"nv"},{"name":"1038","parent":"nv"},{"name":"1072","parent":"nv"},{"name":"1082","parent":"nv"},{"name":"a_leg_L","parent":"nv"},{"name":"1023","parent":"nv"},{"name":"1053","parent":"nv"},{"name":"1078","parent":"nv"},{"name":"1037","parent":"nv"},{"name":"1035","parent":"nv"},{"name":"1033","parent":"nv"},{"name":"a_body","parent":"nv"},{"name":"1052","parent":"nv"},{"name":"1048","parent":"nv"},{"name":"1077","parent":"nv"},{"name":"1031","parent":"nv"},{"name":"a_leg_R","parent":"nv"},{"name":"1022","parent":"nv"},{"name":"1051","parent":"nv"},{"name":"1076","parent":"nv"},{"name":"1036","parent":"nv"},{"name":"1034","parent":"nv"},{"name":"1032","parent":"nv"},{"name":"1044","parent":"nv"},{"name":"1043","parent":"nv"},{"name":"1083","parent":"nv"},{"name":"1029","parent":"nv"},{"name":"1030","parent":"nv"},{"name":"1026","parent":"nv"},{"name":"1025","parent":"nv"},{"name":"1024","parent":"nv"},{"name":"1028","parent":"nv"},{"name":"1027","parent":"nv"},{"name":"1021","parent":"nv"},{"name":"1017","parent":"nv"},{"name":"1016","parent":"nv"},{"name":"1015","parent":"nv"},{"name":"1013","parent":"nv"},{"name":"1012","parent":"nv"},{"name":"1009","parent":"nv"},{"name":"1086","parent":"nv"},{"name":"a_arm_R","parent":"nv"},{"name":"1050","parent":"nv"},{"name":"1075","parent":"nv"},{"name":"1018","parent":"nv"},{"name":"1020","parent":"nv"},{"name":"1019","parent":"nv"},{"name":"1080","parent":"nv"},{"name":"1071","parent":"nv"},{"name":"1081","parent":"nv"},{"name":"1014","parent":"nv"},{"name":"1010","parent":"nv"},{"name":"1067","parent":"nv"},{"name":"1085","parent":"nv"},{"name":"1069","parent":"nv"},{"name":"a_head","parent":"nv"},{"name":"1049","parent":"nv"},{"name":"1047","parent":"nv"},{"name":"1068","parent":"nv"},{"name":"1045","parent":"nv"},{"name":"1011","parent":"nv"},{"name":"1008","parent":"nv"},{"name":"1007","parent":"nv"},{"name":"1006","parent":"nv"},{"name":"1005","parent":"nv"},{"name":"1004","parent":"nv"},{"name":"1003","parent":"nv"},{"name":"1063","parent":"nv"},{"name":"1062","parent":"nv"},{"name":"1002","parent":"nv"},{"name":"1001","parent":"nv"},{"name":"1046","parent":"face1"}],"ik":[{"bendPositive":false,"chain":1,"name":"ik_foot_l","bone":"calf_l","target":"ik_foot_l"},{"bendPositive":false,"chain":1,"name":"ik_foot_r","bone":"calf_r","target":"ik_foot_r"},{"chain":1,"name":"bone_ik","bone":"forearm_l","target":"bone_ikTarget"},{"bendPositive":false,"chain":1,"name":"bone_ik1","bone":"forearm_r","target":"bone_ikTarget1"}],"skin":[{"name":"","slot":[{"name":"1015","display":[{"name":"blank"}]},{"name":"1067","display":[{"name":"blank"}]},{"name":"1062","display":[{"name":"blank"}]},{"name":"1075","display":[{"name":"blank"}]},{"name":"1041","display":[{"name":"blank"}]},{"name":"1020","display":[{"name":"blank"}]},{"name":"1008","display":[{"name":"blank"}]},{"name":"1060","display":[{"name":"blank"}]},{"name":"1011","display":[{"name":"blank"}]},{"name":"1072","display":[{"name":"blank"}]},{"name":"a_leg_L","display":[{"type":"mesh","name":"body/a_leg_L","width":179,"height":1013,"vertices":[-86.18,-882.01,-81.91,-848.44,-92.02,-825.24,-87.85,-797.79,-70.85,-667.06,-66.92,-572.62,-62.78,-526.33,-60.54,-500.62,-57.76,-475.46,-58.7,-450.67,-59.75,-425.89,-52.79,-354.49,-41.86,-212.94,-34.51,-113.84,-31.28,-91.12,-29.71,-70.7,-29.64,-49.28,-29.37,36.9,-44.33,57.74,-102.88,57.91,-107.02,38.81,-87.22,-48.71,-84.71,-67.63,-85.25,-89.42,-87.56,-111.25,-110.32,-207.85,-139.82,-349.75,-137.48,-423.49,-135.58,-448.23,-137.5,-471.8,-144.11,-497.41,-152.24,-521.77,-164.16,-567.25,-187.65,-662.28,-209.67,-797.4,-212.04,-828.9,-212.21,-859.9,-212.36,-890,-208.28,-924.69,-196.4,-954.81,-152.96,-954.83,-109.63,-921.47,-147.97,-881.49],"uvs":[0.70479,0.072,0.72801,0.10527,0.67066,0.1282,0.69292,0.15537,0.78389,0.28452,0.80294,0.37775,0.82467,0.42345,0.83633,0.44883,0.85118,0.47366,0.84541,0.49809,0.83911,0.52254,0.87661,0.59304,0.93491,0.7328,0.97402,0.83065,0.99162,0.85309,1,0.87325,0.99998,0.8944,1,0.97947,0.91607,1,0.58892,0.99998,0.56612,0.98112,0.67824,0.89478,0.69264,0.87611,0.69,0.85458,0.67757,0.83302,0.5523,0.73759,0.39029,0.59742,0.4048,0.52464,0.4158,0.5002,0.4056,0.47691,0.3694,0.45158,0.32474,0.42748,0.25953,0.38254,0.13125,0.28863,0.0123,0.1551,0,0.12399,0,0.09339,0.00004,0.06371,0.02297,0.02968,0.08904,0,0.33172,0,0.57372,0.03294,0.35956,0.07241],"triangles":[26,25,11,11,25,12,25,24,12,12,24,13,23,22,14,20,18,17,21,20,17,14,22,15,15,22,16,22,21,16,21,17,16,13,23,14,24,23,13,20,19,18,3,33,4,10,27,11,27,26,11,4,32,5,33,32,4,28,10,9,29,28,9,29,9,8,7,29,8,5,31,6,28,27,10,6,30,7,30,29,7,34,33,3,31,30,6,32,31,5,0,42,1,41,42,0,2,34,3,35,34,2,40,42,41,38,37,42,37,36,42,42,1,36,36,2,1,36,35,2,38,39,42,40,39,42],"weights":[2,9,0.28537,5,0.71462,2,9,0.65566,5,0.34433,2,9,0.86895,5,0.13104,1,9,1,1,9,1,1,9,1,2,9,0.93466,13,0.06533,2,9,0.7492,13,0.25079,2,9,0.46584,13,0.53415,2,9,0.18125,13,0.81874,2,9,0.01669,13,0.9833,1,13,1,1,13,1,1,13,1,2,13,0.80851,24,0.19148,2,13,0.51678,24,0.4832,2,13,0.18077,24,0.81922,1,24,1,1,24,1,1,24,1,1,24,1,2,13,0.12108,24,0.87891,2,13,0.41515,24,0.58484,2,13,0.79057,24,0.20942,2,13,0.98672,24,0.01327,1,13,1,1,13,1,1,13,1,2,9,0.14873,13,0.85125,2,9,0.52426,13,0.47573,2,9,0.88471,13,0.11528,2,9,0.98959,13,0.0104,1,9,1,1,9,1,1,9,1,1,9,1,2,9,0.99624,5,0.00375,2,9,0.83943,5,0.16056,3,9,0.24652,5,0.61074,12,0.14273,3,9,0.04186,5,0.40613,12,0.55198,3,9,0.03736,5,0.34663,12,0.61599,2,5,0.60799,12,0.392,2,9,0.49599,5,0.504],"slotPose":[1,0,0,1,0,0],"bonePose":[9,0.08646,0.996255,-0.996255,0.08646,-146.29,-879.71,5,1,0,0,1,-107.18,-913,13,0.133294,0.991076,-0.991076,0.133294,-109.592168,-473.391363,24,-0.202787,0.979223,-0.979223,-0.202787,-54.950844,-65.393975,12,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04],"edges":[35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,41,41,40,40,39,39,38,38,37,37,36,36,35],"userEdges":[29,8,30,7,31,6,32,5,28,9,27,10,26,11,25,12,22,15,23,14,24,13,21,16,33,4,34,3,35,2,1,36,37,42,41,42,42,40,39,42,42,0,42,38,42,1]}]},{"name":"1036","display":[{"name":"blank"}]},{"name":"1082","display":[{"name":"blank"}]},{"name":"1087","display":[{"name":"blank"}]},{"name":"1039","display":[{"name":"blank"}]},{"name":"1019","display":[{"name":"blank"}]},{"name":"1001","display":[{"name":"blank"}]},{"name":"1085","display":[{"name":"blank"}]},{"name":"1026","display":[{"name":"blank"}]},{"name":"1002","display":[{"name":"blank"}]},{"name":"1045","display":[{"name":"blank"}]},{"name":"1046","display":[{"type":"mesh","name":"face/10202001","width":141,"height":117,"vertices":[-5.81,-1431.71,-7.25,-1413.78,-5.82,-1344.1,-49.56,-1344.32,-59.21,-1344.11,-146.81,-1344.1,-146.81,-1418.47,-146.81,-1425.05,-146.81,-1461.1,-49.28,-1460.87,-32.92,-1461.08,-5.82,-1461.09,-66.69,-1421.47,-52.04,-1398.21,-40.94,-1394.39,-28.13,-1395.35,-16.7,-1401.52,-18.08,-1441.03,-44.3,-1442.46,-57.51,-1435.54,-29.33,-1443.01,-63.7,-1412.37,-54.57,-1426.83,-41.38,-1433.91,-25.5,-1433.38,-65.47,-1434.18,-58.62,-1443.76,-45.26,-1447.53,-31.01,-1448.15,-97.42,-1409.22,-89,-1385.39,-95.65,-1376.02,-107.36,-1371.98,-120.02,-1371.41,-141.13,-1385.65,-137,-1404.25,-124.8,-1414.24,-108.71,-1414.58,-131.96,-1379.75,-130.3,-1397.19,-120.96,-1406.53,-105.61,-1406.49,-92.39,-1399.98,-103.66,-1418.13,-111.68,-1421.49,-126,-1417.88,-123.92,-1433.26,-109.34,-1432.39,-108.8,-1423.6,-130.05,-1421.25,-75.59,-1444.91,-64.41,-1455.74,-32.78,-1455.95,-45.85,-1454.16,-59.01,-1446.27,-69.07,-1440.12,-75.8,-1381.9,-82.5,-1375.53,-73.18,-1368.41,-65.65,-1374.98,-71.2,-1355.94,-69.9,-1360.8,-65.57,-1363.89,-59.27,-1363.89,-52.91,-1352.11,-57.85,-1349.72,-62.98,-1348.76,-68.81,-1351.15,-50.58,-1355.95,-53.31,-1361.76,-135.56,-1410.89,-117.9,-1423.06,-135.51,-1428.7],"uvs":[0.99999,0.25096,0.98982,0.40435,1,1,0.68976,0.99824,0.62131,0.99998,0,1,0,0.36417,0,0.30797,0,0,0.69179,0.00175,0.80783,0,1,0,0.56819,0.33841,0.67213,0.53736,0.75089,0.57015,0.84173,0.56191,0.92283,0.50922,0.91303,0.17139,0.72703,0.15914,0.63327,0.2183,0.83323,0.15447,0.58945,0.41631,0.65419,0.29276,0.74773,0.23223,0.86039,0.2367,0.57687,0.22999,0.62547,0.14802,0.72023,0.11581,0.82136,0.11052,0.35025,0.44331,0.40996,0.64693,0.36285,0.72715,0.27981,0.7617,0.18996,0.76642,0.04023,0.64466,0.06953,0.48575,0.15604,0.40043,0.27022,0.3975,0.10527,0.69524,0.11704,0.54617,0.1833,0.46638,0.29219,0.46662,0.3859,0.52224,0.30601,0.36709,0.24911,0.3384,0.14754,0.36794,0.16514,0.2348,0.26569,0.24531,0.26956,0.32022,0.1185,0.33659,0.50514,0.13819,0.58438,0.04566,0.80879,0.04393,0.71603,0.05916,0.62271,0.13519,0.5513,0.17918,0.50366,0.67691,0.4561,0.73135,0.52217,0.79225,0.57563,0.73603,0.53626,0.8988,0.54549,0.85722,0.57613,0.83087,0.62083,0.83085,0.66596,0.93157,0.63098,0.95206,0.59453,0.96026,0.55322,0.93979,0.68251,0.89878,0.6631,0.84903,0.07977,0.42905,0.20675,0.3266,0.07904,0.27109],"triangles":[8,51,9,69,68,15,52,28,17,15,68,2,68,3,2,16,15,2,1,16,2,24,1,0,17,24,0,52,17,11,10,52,11,17,0,11,24,16,1,14,69,15,23,14,15,23,15,24,28,20,17,24,15,16,20,24,17,23,22,14,22,13,14,20,23,24,28,18,20,18,23,20,52,27,28,27,18,28,59,69,14,53,27,52,53,52,10,9,53,10,67,5,4,59,63,69,22,21,13,68,64,3,13,59,14,18,19,23,19,22,23,26,19,18,26,18,27,54,26,27,54,27,53,9,54,53,56,59,13,51,54,9,64,65,3,65,4,3,12,21,22,69,64,68,21,56,13,61,60,67,8,50,51,59,62,63,55,25,26,26,25,19,66,4,65,42,56,21,51,55,54,66,67,4,54,55,26,8,47,50,32,5,67,58,62,59,50,55,51,12,42,21,29,42,12,42,30,56,55,50,12,55,12,25,58,61,62,56,58,59,60,32,67,50,43,12,43,29,12,56,57,58,58,60,61,47,43,50,58,57,60,57,31,60,31,32,60,30,57,56,8,46,47,33,5,32,30,31,57,47,48,43,41,31,42,42,31,30,41,32,31,29,41,42,40,39,32,40,32,41,39,33,32,39,38,33,48,44,43,44,37,43,37,40,41,47,71,48,36,40,37,71,44,48,46,71,47,8,72,46,38,5,33,46,49,71,49,45,71,35,39,40,72,49,46,34,38,39,45,70,36,49,70,45,8,7,72,34,5,38,35,34,39,72,6,49,6,70,49,7,6,72,6,35,70,6,34,35,6,5,34,25,19,12,19,12,22,40,35,36,70,35,36,43,29,37,37,41,29,71,44,45,44,36,37,45,36,44,65,63,64,69,63,64,63,65,62,62,66,65,67,61,66,62,61,66],"weights":[2,41,0.44,47,0.55999,2,41,0.928,47,0.07199,1,41,1,1,41,1,1,41,1,1,41,1,2,41,0.96,47,0.03999,2,41,0.96,47,0.03999,1,41,1,2,41,0.94399,47,0.056,2,41,0.96799,47,0.032,1,41,1,2,41,0.55198,47,0.448,2,41,0.856,47,0.14399,1,41,1,1,41,1,1,41,1,2,41,0.672,47,0.32799,2,41,0.60799,47,0.392,2,41,0.592,47,0.40799,2,41,0.66399,47,0.336,2,41,0.488,47,0.51199,2,41,0.456,47,0.54399,2,41,0.47999,47,0.52,2,41,0.488,47,0.51199,2,41,0.728,47,0.27199,2,41,0.78399,47,0.216,2,41,0.79199,47,0.208,2,41,0.75199,47,0.248,2,41,0.68799,47,0.312,2,41,0.91999,47,0.08,1,41,1,1,41,1,2,41,0.944,47,0.05599,2,41,0.58398,47,0.416,2,41,0.616,47,0.38399,2,41,0.6,47,0.39999,2,41,0.688,47,0.31199,2,41,0.50399,47,0.496,2,41,0.496,47,0.50399,2,41,0.43199,47,0.568,2,41,0.456,47,0.54399,2,41,0.504,47,0.49599,2,41,0.79999,47,0.2,2,41,0.8,47,0.19999,2,41,0.77599,47,0.224,2,41,0.94399,47,0.056,2,41,0.94399,47,0.056,2,41,0.936,47,0.06398,2,41,0.96,47,0.03999,2,41,0.91999,47,0.08,2,41,0.90399,47,0.096,2,41,0.95199,47,0.048,2,41,0.928,47,0.07199,2,41,0.912,47,0.08799,2,41,0.91999,47,0.08,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,2,41,0.736,47,0.26399,2,41,0.77599,47,0.224,2,41,0.95,47,0.05],"slotPose":[1,0,0,1,0,0],"bonePose":[41,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473,47,-0.264883,-0.964281,0.964281,-0.264883,-71.928507,-1385.236231],"edges":[5,4,4,3,3,2,2,1,1,0,0,11,11,10,10,9,9,8,8,7,7,6,6,5],"userEdges":[13,14,14,15,15,16,16,1,0,17,18,19,19,12,17,20,20,18,12,21,21,13,14,22,22,19,21,22,15,23,23,18,22,23,16,24,24,20,23,24,24,1,12,25,25,26,26,27,27,28,28,17,30,31,31,32,32,33,35,36,29,37,37,36,33,38,38,34,33,39,39,35,38,39,32,40,40,36,39,40,31,41,41,37,40,41,29,42,42,30,41,42,29,43,43,44,44,45,46,47,47,48,49,6,50,51,51,9,10,52,52,53,53,54,54,55,55,50,56,57,57,58,58,59,59,56,60,61,61,62,62,63,63,64,64,65,65,62,61,66,66,65,60,67,67,66,64,68,68,69,69,63,66,4,64,3,35,34,35,70,70,45,48,71,71,49,7,72,72,46]}]},{"name":"1069","display":[{"name":"blank"}]},{"name":"1013","display":[{"name":"blank"}]},{"name":"1065","display":[{"name":"blank"}]},{"name":"1052","display":[{"name":"blank"}]},{"name":"a_arm_L","display":[{"type":"mesh","name":"body/a_arm_L","width":295,"height":472,"vertices":[-81.59,-1249.92,-82.13,-1222.8,-90.29,-1199.89,-99.94,-1175.35,-140.6,-1076.14,-149.32,-1058.12,-158.96,-1040.32,-169.17,-1023.17,-180.14,-1005.15,-235.14,-935.12,-247.23,-919.56,-254.46,-903.99,-254.92,-886.98,-255.27,-874.4,-264.31,-849.75,-263.48,-823.45,-273.34,-815.62,-288.83,-832.26,-294.13,-867.14,-300.47,-826.86,-312.19,-817.57,-322.39,-849.32,-322.43,-810.31,-342.25,-809.85,-338.27,-831.67,-359.64,-809.84,-376.32,-809.83,-376.32,-823.42,-339.1,-861.24,-321.48,-894.35,-301.07,-912.31,-291.53,-924.54,-282.7,-939.75,-273.62,-956.8,-233.88,-1036.01,-222.22,-1050.63,-211.95,-1065.18,-205.35,-1080.95,-198.23,-1099.87,-164.13,-1199.93,-158.28,-1224,-152.19,-1247.26,-142.98,-1266.72,-123.15,-1281.81,-86.06,-1281.82,-121.9,-1238.14],"uvs":[0.99908,0.06759,0.99724,0.12503,0.96959,0.17358,0.93691,0.22557,0.79917,0.43578,0.76962,0.47396,0.73694,0.51167,0.70231,0.54802,0.66509,0.58622,0.4787,0.73459,0.43772,0.76756,0.41319,0.80054,0.41158,0.83658,0.4104,0.86323,0.37975,0.91548,0.38254,0.97121,0.3491,0.9878,0.29661,0.95254,0.27866,0.87862,0.25715,0.96396,0.2174,0.98364,0.18283,0.91636,0.18269,0.99902,0.11549,1,0.12898,0.95375,0.05652,1,0,1,0,0.97121,0.12618,0.8911,0.18593,0.82095,0.25514,0.78291,0.28748,0.757,0.31745,0.72477,0.34822,0.68865,0.48292,0.52085,0.52241,0.48985,0.55727,0.45903,0.57963,0.42562,0.60376,0.38554,0.7193,0.17354,0.73909,0.12253,0.75972,0.07326,0.79093,0.03199,0.85816,0,0.98391,0,0.86245,0.09251],"triangles":[45,1,0,45,2,1,38,4,3,39,38,3,39,3,2,43,42,45,42,41,45,41,40,45,38,5,4,38,37,5,37,6,5,37,36,6,36,7,6,36,35,7,35,8,7,35,34,8,34,9,8,33,9,34,33,10,9,31,11,10,32,31,10,33,32,10,18,14,13,18,13,12,30,18,12,30,12,11,31,30,11,17,16,15,17,15,14,18,17,14,30,29,18,29,21,18,28,21,29,21,20,19,24,23,22,28,24,21,27,25,24,27,24,28,27,26,25,24,22,21,21,19,18,43,44,45,44,45,0,39,40,2,45,40,2],"weights":[2,28,0.07199,23,0.928,2,28,0.24799,23,0.752,2,28,0.528,23,0.47199,2,28,0.928,23,0.07199,2,38,0.00601,28,0.99398,2,38,0.10823,28,0.89176,2,38,0.4621,28,0.53789,2,38,0.84526,28,0.15473,2,38,0.99634,28,0.00365,1,38,0.99999,2,38,0.91608,34,0.08391,2,38,0.48414,34,0.51585,2,38,0.11944,34,0.88055,2,38,0.02847,34,0.97152,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,2,38,0.14665,34,0.85334,2,38,0.52201,34,0.47798,2,38,0.89834,34,0.10165,1,38,1,1,38,1,2,38,0.89448,28,0.10551,2,38,0.53387,28,0.46612,2,38,0.14666,28,0.85333,1,28,1,1,28,1,1,28,1,1,28,1,2,28,0.90399,23,0.096,2,28,0.84,23,0.15999,2,28,0.512,23,0.48799,2,28,0.63998,23,0.36],"slotPose":[1,0,0,1,0,0],"bonePose":[34,-0.596925,0.802297,-0.802297,-0.596925,-272.622839,-911.231146,28,-0.322761,0.94648,-0.94648,-0.322761,-122.498835,-1238.098661,23,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,38,-0.518922,0.854821,-0.854821,-0.518922,-185.900195,-1053.819626],"edges":[26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,44,44,43,43,42,42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26],"userEdges":[18,21,24,21,36,6,37,5,35,7,38,4,34,8,45,43,42,45,45,41,45,1,45,0,44,45,40,2,39,3,31,11,32,10,33,9,30,12]}]},{"name":"1077","display":[{"name":"blank"}]},{"name":"1024","display":[{"name":"blank"}]},{"name":"1034","display":[{"name":"blank"}]},{"name":"1007","display":[{"name":"blank"}]},{"name":"1088","display":[{"name":"blank"}]},{"name":"a_body","display":[{"type":"mesh","name":"body/a_body","width":274,"height":555,"vertices":[3.85,-1359.46,4.35,-1323.79,4.58,-1307.26,26.65,-1293.37,56.25,-1285.3,74.66,-1271.04,74.67,-1232.65,55.69,-1196.98,37.02,-1162.12,14.62,-1122.77,-4.3,-1086.77,-13.31,-1048.89,-5.56,-1005.33,12.17,-967.78,25.17,-935.12,1.17,-890.77,-67.7,-848.67,-104.99,-839.87,-133.68,-845.76,-174.14,-896.36,-199.36,-942.97,-191.82,-980.99,-174.75,-1018.1,-166.88,-1062.7,-172.42,-1105.69,-173.89,-1141.93,-183.38,-1172.15,-182.19,-1198.85,-151.95,-1221.98,-134.76,-1251.64,-119.87,-1280.7,-88.68,-1289.24,-65.67,-1300.67,-64.3,-1312.71,-63.43,-1326.83,-61.82,-1373.68,-36.93,-1394.83,6.36,-1394.82,-136.53,-1140.84,-103.21,-1157.15,-68.29,-1129.39,-23.28,-1127.2,5.18,-1165.13,-5.44,-1212.94,-39.22,-1285.76,-101.78,-1184.64,-89.06,-1216.72,-36.07,-1228.28,-116.96,-1227.04,-50.5,-1164.02,-157.23,-1176.53,-98.12,-1104.39,-97.42,-1057.84,-97.87,-1008.49,-100.05,-964.28,-101.59,-919.15,-104.98,-875.45,-54.82,-1097.52,-54.63,-1054.45,-54.29,-1007.2,-48.8,-964.31,-41.19,-920.95,-65.81,-880.55,-135.38,-1103.51,-133.8,-1060.29,-139.59,-1011.22,-147.76,-970,-149.84,-925.12,-148.19,-887.34,26.39,-1207.83,-98.82,-1256.44,-55.68,-1256.45,38.68,-1244.3,-2.4,-1250.59],"uvs":[0.74158,0.06374,0.74339,0.12797,0.74423,0.15773,0.82473,0.18283,0.93275,0.19735,0.99999,0.22304,0.99999,0.29223,0.93075,0.3565,0.86258,0.41927,0.78081,0.49018,0.71177,0.55505,0.67888,0.62329,0.70717,0.70179,0.77189,0.76941,0.81935,0.82831,0.73178,0.90824,0.48045,0.98413,0.34427,0.99999,0.23933,0.98941,0.09205,0.89807,0,0.81411,0.02734,0.74567,0.08964,0.6788,0.11835,0.59843,0.09818,0.52096,0.0928,0.45568,0.05817,0.40118,0.0625,0.3531,0.17288,0.31143,0.23564,0.25801,0.28995,0.20566,0.40377,0.19027,0.4878,0.16964,0.49277,0.14794,0.49598,0.12251,0.50184,0.03806,0.59274,0,0.75073,0,0.22915,0.45764,0.35079,0.42824,0.47824,0.47825,0.64251,0.48221,0.7464,0.41383,0.70765,0.32773,0.58431,0.19652,0.356,0.37866,0.40239,0.32086,0.59582,0.30009,0.30057,0.30232,0.54319,0.41587,0.15362,0.39333,0.36933,0.52332,0.37192,0.6072,0.37026,0.69612,0.36232,0.77579,0.35677,0.85712,0.34438,0.93588,0.52739,0.53568,0.52808,0.61328,0.52931,0.69842,0.54939,0.7757,0.57714,0.85383,0.48734,0.92668,0.23336,0.52489,0.23908,0.60278,0.21797,0.6912,0.18817,0.76549,0.18061,0.84636,0.1867,0.91442,0.82379,0.33694,0.36681,0.24935,0.52423,0.24933,0.86865,0.27125,0.71872,0.2599],"triangles":[72,7,6,72,6,5,4,72,5,72,69,7,69,8,7,3,72,4,73,43,69,69,42,8,42,9,8,73,69,72,3,73,72,61,15,14,2,73,3,43,42,69,13,61,14,44,73,2,60,61,13,42,41,9,41,10,9,62,16,15,12,60,13,47,43,73,0,34,1,43,49,42,49,41,42,36,0,37,35,34,0,1,44,2,36,35,0,61,62,15,11,59,12,59,60,12,47,49,43,41,57,10,58,11,10,57,58,10,71,47,73,44,71,73,58,59,11,46,49,47,49,40,41,40,57,41,33,32,44,71,46,47,60,55,61,46,45,49,32,71,44,54,55,60,55,62,61,32,31,71,53,54,59,53,59,58,52,53,58,57,52,58,59,54,60,51,52,57,39,40,49,45,39,49,31,70,71,70,46,71,40,51,57,56,16,62,55,56,62,56,17,16,39,51,40,64,65,52,52,65,53,39,38,51,64,52,51,63,64,51,70,48,46,30,70,31,18,17,56,68,56,55,65,66,54,67,55,54,66,67,54,29,48,70,65,54,53,38,63,51,30,29,70,67,68,55,50,39,45,50,38,39,68,18,56,29,28,48,22,66,65,23,22,65,50,25,38,25,24,38,38,24,63,24,23,63,63,23,64,23,65,64,68,19,18,27,50,28,67,19,68,20,67,66,22,21,66,21,20,66,26,25,50,20,19,67,27,26,50,28,50,48,44,33,1,34,33,1,45,50,46,48,50,46],"weights":[1,27,1,2,23,0.04933,27,0.95066,2,23,0.37053,27,0.62945,1,23,1,1,23,1,1,23,1,1,23,1,1,23,1,3,15,0.07991,23,0.91513,27,0.00495,2,15,0.4598,23,0.54019,2,15,0.89215,23,0.10784,2,12,0.19819,15,0.8018,2,12,0.70197,15,0.29802,3,12,0.76582,15,0.09095,5,0.1432,3,12,0.43807,5,0.44192,10,0.12,2,5,0.496,10,0.50399,2,5,0.632,10,0.36799,3,5,0.83174,10,0.08025,9,0.08799,2,5,0.592,9,0.40799,2,5,0.56,9,0.43999,3,12,0.4652,5,0.40679,9,0.12799,3,12,0.8085,15,0.04201,5,0.14947,2,12,0.72622,15,0.27377,2,12,0.23723,15,0.76276,2,15,0.88129,23,0.1187,3,15,0.44155,23,0.48645,30,0.07199,3,15,0.08109,23,0.8389,30,0.07999,2,23,0.91199,30,0.088,2,23,0.92,30,0.07999,1,23,1,1,23,1,1,23,1,2,23,0.55347,27,0.44652,2,23,0.07085,27,0.92914,1,27,1,2,27,0.46399,41,0.536,1,41,1,2,27,0.49599,41,0.504,3,15,0.45138,23,0.46861,30,0.08,4,15,0.1292,23,0.70983,31,0.08096,30,0.08,4,12,0.00083,15,0.45308,23,0.46607,31,0.08,3,15,0.47376,23,0.43823,31,0.088,4,15,0.08883,23,0.82926,27,0.0019,31,0.07999,2,23,0.91199,31,0.088,2,23,0.53199,27,0.468,3,23,0.85363,31,0.08236,30,0.06398,3,23,0.8686,31,0.06739,30,0.06398,2,23,0.91199,31,0.088,2,23,0.91199,30,0.088,3,15,0.06672,23,0.70927,31,0.224,3,15,0.04243,23,0.75756,30,0.2,1,15,1,1,15,1,2,12,0.75999,15,0.24,1,12,1,1,5,1,1,5,1,2,15,0.78807,23,0.21192,2,12,0.13482,15,0.86517,2,12,0.73937,15,0.26062,3,12,0.75413,15,0.05818,5,0.18768,3,12,0.44072,5,0.45527,10,0.10399,2,5,0.84,10,0.15999,2,15,0.87634,23,0.12365,2,12,0.15863,15,0.84136,2,12,0.66761,15,0.33238,3,12,0.89196,15,0.0134,5,0.09463,2,12,0.52973,5,0.47026,2,5,0.528,9,0.47199,1,23,1,1,23,1,1,23,1,1,23,1,1,23,1],"slotPose":[1,0,0,1,0,0],"bonePose":[27,0.000524,-1,1,0.000524,-36.134534,-1292.746462,23,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,15,0.133294,-0.991076,0.991076,0.133294,-102.984795,-1028.747532,12,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04,5,1,0,0,1,-107.18,-913,10,-0.063313,0.997994,-0.997994,-0.063313,-29.39,-886.57,9,0.08646,0.996255,-0.996255,0.08646,-146.29,-879.71,30,0.307689,-0.951487,0.951487,0.307689,-164.467343,-1165.289724,41,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473,31,0.307689,-0.951487,0.951487,0.307689,-50.523269,-1153.740106],"edges":[20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20],"userEdges":[25,38,38,39,39,40,40,41,41,42,42,43,32,44,44,2,39,45,45,46,46,47,47,43,28,48,48,46,45,49,49,43,47,49,49,46,39,49,49,40,49,41,49,42,42,8,41,9,50,25,50,38,50,39,45,50,50,26,27,50,50,28,50,48,34,0,39,51,51,52,52,53,53,54,54,55,55,56,56,17,10,57,57,51,40,57,57,41,11,58,58,52,57,58,12,59,59,53,58,59,13,60,60,54,59,60,14,61,61,55,60,61,15,62,62,56,61,62,62,16,24,63,63,51,38,63,23,64,64,52,63,64,22,65,65,53,64,65,21,66,66,54,65,66,20,67,67,55,66,67,19,68,68,56,67,68,68,18,7,69,69,43,42,69,31,70,70,48,29,70,44,71,71,46,70,71,4,72,72,69,72,6,71,73,73,72,3,73,73,43,73,47,61,15,33,1,50,46]}]},{"name":"logo","display":[{"name":"logo","transform":{"x":-780,"y":-1200,"scX":2.2483,"scY":2.2353}}]},{"name":"1070","display":[{"name":"blank"}]},{"name":"1012","display":[{"name":"blank"}]},{"name":"1074","display":[{"name":"blank"}]},{"name":"1048","display":[{"name":"blank"}]},{"name":"1054","display":[{"name":"blank"}]},{"name":"1031","display":[{"name":"blank"}]},{"name":"1040","display":[{"name":"blank"}]},{"name":"1055","display":[{"name":"blank"}]},{"name":"1006","display":[{"name":"blank"}]},{"name":"1023","display":[{"name":"blank"}]},{"name":"1073","display":[{"name":"blank"}]},{"name":"1005","display":[{"name":"blank"}]},{"name":"1053","display":[{"name":"blank"}]},{"name":"a_head","display":[{"type":"mesh","name":"body/a_head","width":202,"height":238,"vertices":[16.33,-1504.74,21.98,-1463.91,35.04,-1439.42,31.89,-1407.38,16.33,-1381.63,4.4,-1379.75,-15.71,-1346.47,-47.11,-1321.84,-66.57,-1321.83,-93.58,-1330.14,-121.21,-1343.95,-131.26,-1369.08,-150.74,-1397.97,-166.33,-1434.39,-166.33,-1484.02,-149.48,-1531.75,-99.23,-1559.83,-18.21,-1559.82,8.16,-1417.43],"uvs":[0.90429,0.23145,0.93227,0.40299,0.99689,0.50591,0.98134,0.6405,0.90429,0.74871,0.84521,0.75662,0.74571,0.89649,0.59024,0.99998,0.49384,1,0.36014,0.96511,0.22333,0.90705,0.17358,0.80149,0.07718,0.68009,0,0.52702,0,0.31854,0.0834,0.11797,0.33216,0.00001,0.73327,0,0.86386,0.59828],"triangles":[18,3,2,1,18,2,18,4,3,18,5,4,14,18,1,16,14,1,0,16,1,14,13,18,17,16,0,13,12,18,11,5,18,12,11,18,11,6,5,15,14,16,8,7,6,9,8,6,11,9,6,11,10,9],"weights":[1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1,1,41,1],"slotPose":[1,0,0,1,0,0],"bonePose":[41,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473],"edges":[13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,17,17,16,16,15,15,14,14,13],"userEdges":[5,18,18,1]}]},{"name":"1080","display":[{"name":"blank"}]},{"name":"1058","display":[{"name":"blank"}]},{"name":"1042","display":[{"name":"blank"}]},{"name":"1044","display":[{"name":"blank"}]},{"name":"1028","display":[{"name":"blank"}]},{"name":"1009","display":[{"name":"blank"}]},{"name":"1032","display":[{"name":"blank"}]},{"name":"a_arm_R","display":[{"type":"mesh","name":"body/a_arm_R","width":215,"height":517,"vertices":[81.72,-1255.65,87.23,-1225.62,88.19,-1196.91,89.05,-1176.54,98.96,-1082.13,102.77,-1064.36,108.6,-1048.8,118.88,-1032.21,125.62,-1016.31,156.08,-924.91,160.78,-906.8,166.2,-892.24,194.08,-842.75,193.73,-806.16,173.98,-793.48,141.38,-788.53,126.55,-794.62,112.34,-795.36,113.95,-843.1,115.45,-877,118.69,-891.06,110.15,-906.11,61.38,-987.76,54.84,-1003.94,51.56,-1022.51,47.48,-1043.4,43.92,-1062.12,27.02,-1154.25,23.26,-1172.68,12.23,-1188.43,11.67,-1216.34,12.78,-1251.36,33.69,-1284.82,63.43,-1282.58,46.9,-1237.18],"uvs":[0.32581,0.05643,0.35147,0.11454,0.3559,0.17007,0.35986,0.20948,0.40587,0.39208,0.42359,0.42642,0.45069,0.45649,0.49852,0.4886,0.52983,0.51933,0.6716,0.69609,0.69347,0.7311,0.71873,0.75926,0.8484,0.85497,0.84682,0.92574,0.75493,0.95028,0.60335,0.95987,0.5344,0.94809,0.46827,0.94666,0.47573,0.85433,0.4827,0.78877,0.4977,0.76157,0.45795,0.73247,0.2311,0.57457,0.20065,0.54331,0.18539,0.50737,0.16637,0.46696,0.14986,0.43073,0.07133,0.25255,0.05388,0.21689,0.0026,0.18644,0,0.13246,0.0052,0.0647,0.10243,0,0.24075,0.00432,0.16387,0.09214],"triangles":[18,14,12,11,18,12,12,14,13,18,16,15,19,18,11,18,15,14,22,21,8,8,21,9,10,20,11,20,19,11,9,20,10,21,20,9,18,17,16,7,23,8,23,22,8,3,27,4,6,24,7,24,23,7,25,24,6,5,25,6,27,26,4,4,26,5,26,25,5,0,34,1,2,28,3,28,27,3,33,34,0,30,29,34,32,34,33,32,31,34,31,30,34,29,28,2,29,2,1,34,29,1],"weights":[2,29,0.57599,23,0.424,1,29,1,1,29,1,1,29,1,1,29,1,2,44,0.0888,29,0.91119,2,44,0.44505,29,0.55494,2,44,0.84135,29,0.15864,2,44,0.97337,29,0.02662,2,44,0.93063,26,0.06936,2,44,0.54329,26,0.4567,2,44,0.15151,26,0.84848,1,26,1,1,26,1,1,26,1,1,26,1,1,26,1,1,26,1,2,44,0.00405,26,0.99594,2,44,0.1612,26,0.83879,2,44,0.50837,26,0.49162,2,44,0.9084,26,0.09159,2,44,0.98867,29,0.01132,2,44,0.88838,29,0.11161,2,44,0.61378,29,0.38621,2,44,0.19782,29,0.80217,2,44,0.02531,29,0.97468,1,29,1,2,29,0.91199,23,0.088,2,29,0.472,23,0.52799,2,29,0.264,23,0.73599,2,29,0.06398,23,0.936,2,29,0.096,23,0.90399,2,29,0.168,23,0.83199,2,29,0.488,23,0.51199],"slotPose":[1,0,0,1,0,0],"bonePose":[29,0.193207,0.981158,-0.981158,0.193207,42.671847,-1232.663838,23,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,44,0.385906,0.922538,-0.922538,0.385906,81.127245,-1035.875814,26,0.400349,0.916363,-0.916363,0.400349,139.903737,-897.076346],"edges":[30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,33,33,32,32,31,31,30],"userEdges":[24,6,23,7,25,5,26,4,22,8,20,10,19,11,21,9,28,2,29,1,0,34,34,30,34,31,32,34,34,33,27,3]}]},{"name":"1004","display":[{"name":"blank"}]},{"name":"1086","display":[{"name":"blank"}]},{"name":"1049","display":[{"name":"blank"}]},{"name":"1071","display":[{"name":"blank"}]},{"name":"1057","display":[{"name":"blank"}]},{"name":"1021","display":[{"name":"blank"}]},{"name":"1043","display":[{"name":"blank"}]},{"name":"1027","display":[{"name":"blank"}]},{"name":"1025","display":[{"name":"blank"}]},{"name":"1084","display":[{"name":"blank"}]},{"name":"1056","display":[{"name":"blank"}]},{"name":"1050","display":[{"name":"blank"}]},{"name":"1083","display":[{"name":"blank"}]},{"name":"blank","display":[{"name":"blank"}]},{"name":"1066","display":[{"name":"blank"}]},{"name":"a_leg_R","display":[{"type":"mesh","name":"body/a_leg_R","width":260,"height":930,"vertices":[33.51,-905.49,35.31,-873.55,34.72,-839.5,27.52,-805.57,8.86,-681.07,-10.39,-545.17,-12.95,-522.73,-12.5,-503.27,-1.97,-486.23,11.59,-472.37,63.14,-406.33,105.47,-248.25,129.14,-168.36,140.27,-150.1,149.41,-129.59,152.14,-111.75,156.14,-70.64,155.98,-10.2,112.99,-10.32,89.3,-10.38,96.89,-96.71,96.48,-113.63,90.55,-132.93,82.9,-154.16,51.97,-228.51,-22.56,-367.87,-65.96,-434.45,-82.67,-456.6,-98.05,-481.69,-101.09,-511.7,-102.55,-540.17,-102.47,-679.22,-97.94,-803.63,-94.45,-828.9,-91.92,-852.09,-77.52,-879.17,-55.37,-916.16,-19.98,-940.82,22,-940.82,-26.32,-886.55],"uvs":[0.5225,0.03801,0.52947,0.07233,0.52727,0.10896,0.49966,0.14544,0.4282,0.27933,0.35449,0.42545,0.34469,0.44957,0.34644,0.47046,0.38707,0.48872,0.43938,0.50356,0.63841,0.57439,0.80303,0.7442,0.89499,0.83002,0.93806,0.84961,0.97346,0.87163,0.98417,0.89081,0.99999,0.935,1,1,0.83459,1,0.74351,1,0.77177,0.90716,0.77003,0.88897,0.747,0.86823,0.71733,0.84544,0.59753,0.76561,0.30928,0.61603,0.1416,0.54458,0.07702,0.52081,0.01753,0.49384,0.00569,0.46154,0,0.4309,0,0.28138,0.01711,0.1476,0.03045,0.12042,0.04011,0.09545,0.09547,0.06634,0.18062,0.02652,0.31674,0,0.47818,0,0.29239,0.05838],"triangles":[15,20,16,20,18,16,16,18,17,14,21,15,21,20,15,13,21,14,24,23,11,20,19,18,11,23,12,12,22,13,22,21,13,10,25,11,25,24,11,23,22,12,9,25,10,31,5,4,26,25,9,32,4,3,0,39,1,32,31,4,33,32,3,31,30,5,8,26,9,35,34,39,36,39,37,7,27,8,27,26,8,30,6,5,28,27,7,6,29,7,29,28,7,30,29,6,36,35,39,1,34,2,39,34,1,3,33,2,34,33,2,0,39,38,37,39,38],"weights":[2,10,0.568,5,0.432,2,10,0.928,5,0.07199,1,10,1,1,10,1,1,10,1,2,10,0.97544,18,0.02455,2,10,0.82846,18,0.17153,2,10,0.48724,18,0.51275,2,10,0.15204,18,0.84795,2,10,0.03176,18,0.96823,1,18,1,1,18,1,1,18,1,2,18,0.82076,20,0.17923,2,18,0.51153,20,0.48846,2,18,0.24923,20,0.75076,1,20,1,1,20,1,1,20,1,1,20,1,2,18,0.15793,20,0.84206,2,18,0.44792,20,0.55207,2,18,0.81762,20,0.18237,1,18,1,1,18,1,1,18,1,2,10,0.00055,18,0.99944,2,10,0.18658,18,0.81341,2,10,0.50372,18,0.49627,2,10,0.80275,18,0.19724,2,10,0.97444,18,0.02555,1,10,0.99999,1,10,1,2,10,0.904,5,0.09599,2,10,0.57599,5,0.42399,2,10,0.344,5,0.65599,3,10,0.1966,5,0.57138,12,0.23199,3,10,0.05222,5,0.35577,12,0.592,3,10,0.04409,5,0.3799,12,0.57599,2,10,0.512,5,0.48799],"slotPose":[1,0,0,1,0,0],"bonePose":[10,-0.063313,0.997994,-0.997994,-0.063313,-29.39,-886.57,5,1,0,0,1,-107.18,-913,18,0.431613,0.902059,-0.902059,0.431613,-53.252689,-491.788776,20,0.03769,0.999289,-0.999289,0.03769,124.83646,-122.229299,12,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04],"edges":[30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30],"userEdges":[28,7,29,6,30,5,31,4,27,8,26,9,25,10,24,11,21,14,22,13,23,12,20,15,32,3,34,1,33,2,0,39,39,35,36,39,39,37,39,38]}]},{"name":"1010","display":[{"name":"blank"}]},{"name":"1017","display":[{"name":"blank"}]},{"name":"1022","display":[{"name":"blank"}]},{"name":"1003","display":[{"name":"blank"}]},{"name":"1081","display":[{"name":"blank"}]},{"name":"1037","display":[{"name":"blank"}]},{"name":"1047","display":[{"name":"blank"}]},{"name":"1059","display":[{"name":"blank"}]},{"name":"1079","display":[{"name":"blank"}]},{"name":"1061","display":[{"name":"blank"}]},{"name":"1068","display":[{"name":"blank"}]},{"name":"1014","display":[{"name":"blank"}]},{"name":"1078","display":[{"name":"blank"}]},{"name":"1076","display":[{"name":"blank"}]},{"name":"1016","display":[{"name":"blank"}]},{"name":"1051","display":[{"name":"blank"}]},{"name":"1038","display":[{"name":"blank"}]},{"name":"1035","display":[{"name":"blank"}]},{"name":"1064","display":[{"name":"blank"}]},{"name":"1018","display":[{"name":"blank"}]},{"name":"1030","display":[{"name":"blank"}]},{"name":"1033","display":[{"name":"blank"}]},{"name":"1029","display":[{"name":"blank"}]},{"name":"1063","display":[{"name":"blank"}]}]}],"animation":[{"duration":70,"name":"idle","bone":[{"name":"ik_foot_r","translateFrame":[{"duration":44,"tweenEasing":0},{"duration":26,"tweenEasing":0,"x":6.5},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"curve":[0.2595,0,0.946,0.8400000000000001],"x":-3.82,"y":0.6},{"duration":26,"curve":[0.228,0.135,0.7655000000000001,0.975],"x":-4.65,"y":0.79},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"curve":[0.2595,0,0.946,0.8400000000000001],"rotate":0.17},{"duration":26,"curve":[0.228,0.135,0.7655000000000001,0.975],"rotate":0.2},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":-0.29,"y":-1.62},{"duration":26,"tweenEasing":0,"x":-0.17,"y":-0.95},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.31},{"duration":26,"tweenEasing":0,"rotate":-0.19},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":1.65,"y":0.09},{"duration":26,"tweenEasing":0,"x":1.74,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.23},{"duration":26,"tweenEasing":0,"rotate":-0.17},{"duration":0}]},{"name":"foot_r","rotateFrame":[{"duration":44,"tweenEasing":0},{"duration":26,"tweenEasing":0,"rotate":2.99},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.08,"y":-0.01},{"duration":26,"tweenEasing":0,"x":2.57,"y":-0.29},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.89},{"duration":26,"tweenEasing":0,"rotate":0.47},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.15},{"duration":26,"tweenEasing":0,"rotate":-0.33},{"duration":0}]},{"name":"upperarm_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":0.76},{"duration":26,"tweenEasing":0,"rotate":1.63},{"duration":0}]},{"name":"upperarm_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-3.28},{"duration":26,"tweenEasing":0,"rotate":-4.04},{"duration":0}]},{"name":"xiong_l","translateFrame":[{"duration":15,"tweenEasing":0,"x":-1.48,"y":-4.58},{"duration":20,"tweenEasing":0,"x":-10.09,"y":5.25},{"duration":15,"tweenEasing":0,"x":10.49,"y":10.9},{"duration":20,"tweenEasing":0,"x":27.2,"y":4.5},{"duration":0,"x":-1.48,"y":-4.58}]},{"name":"xiong_r","translateFrame":[{"duration":15,"tweenEasing":0,"x":1.99,"y":6.16},{"duration":20,"tweenEasing":0,"x":-10.63,"y":0.37},{"duration":15,"tweenEasing":0,"x":4.31,"y":-9.17},{"duration":20,"tweenEasing":0,"x":20.58,"y":-8.09},{"duration":0,"x":1.99,"y":6.16}]},{"name":"forearm_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.24},{"duration":6,"tweenEasing":0,"rotate":0.88},{"duration":20,"tweenEasing":0,"rotate":1.2},{"duration":0}]},{"name":"forearm_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":2.2},{"duration":6,"tweenEasing":0,"rotate":1.25},{"duration":20,"tweenEasing":0,"rotate":0.16},{"duration":0}]},{"name":"head","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":-1.11},{"duration":26,"tweenEasing":0,"x":-1.36},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":5.48},{"duration":22,"tweenEasing":0,"rotate":5.11},{"duration":26,"tweenEasing":0,"rotate":5.72},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":15},{"duration":29,"tweenEasing":0},{"duration":26,"tweenEasing":0,"x":0.88},{"duration":0}]},{"name":"hand_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.95},{"duration":26,"tweenEasing":0,"rotate":-0.84},{"duration":0}]},{"name":"hand_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.52},{"duration":6,"tweenEasing":0,"rotate":-0.41},{"duration":20,"tweenEasing":0,"rotate":-1.08},{"duration":0}]},{"name":"dress0101","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":2.94},{"duration":15,"tweenEasing":0,"rotate":-0.24},{"duration":20,"tweenEasing":0,"rotate":-2.57},{"duration":0}]},{"name":"dress0201","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-0.24},{"duration":13,"tweenEasing":0,"rotate":0.27},{"duration":15,"tweenEasing":0,"rotate":-1.35},{"duration":20,"tweenEasing":0,"rotate":-1.99},{"duration":0,"rotate":-0.24}],"scaleFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"x":0.99},{"duration":15,"tweenEasing":0,"x":0.98},{"duration":20,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"dress0301","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":-3.95},{"duration":15,"tweenEasing":0,"rotate":-1.11},{"duration":20,"tweenEasing":0,"rotate":1.42},{"duration":0}]},{"name":"dress0102","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":-1.33},{"duration":15,"tweenEasing":0,"rotate":1.12},{"duration":20,"tweenEasing":0,"rotate":0.58},{"duration":0}]},{"name":"dress0202","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":0.22},{"duration":13,"tweenEasing":0,"rotate":0.71},{"duration":15,"tweenEasing":0,"rotate":1.98},{"duration":20,"tweenEasing":0,"rotate":1.97},{"duration":0,"rotate":0.22}]},{"name":"dress0302","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-2.34},{"duration":13,"tweenEasing":0,"rotate":-2.61},{"duration":15,"tweenEasing":0,"rotate":-4.52},{"duration":20,"tweenEasing":0,"rotate":-3.87},{"duration":0,"rotate":-2.34}]},{"name":"dress0103","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":0.34},{"duration":15,"tweenEasing":0,"rotate":2.76},{"duration":20,"tweenEasing":0,"rotate":3.21},{"duration":0}]},{"name":"dress0203","rotateFrame":[{"duration":22,"rotate":-0.42},{"duration":13,"tweenEasing":0,"rotate":-0.42},{"duration":15,"tweenEasing":0,"rotate":0.11},{"duration":20,"tweenEasing":0,"rotate":-0.41},{"duration":0,"rotate":-0.42}]},{"name":"dress0303","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-0.24},{"duration":13,"tweenEasing":0,"rotate":0.98},{"duration":15,"tweenEasing":0,"rotate":-1.47},{"duration":20,"tweenEasing":0,"rotate":-2.69},{"duration":0,"rotate":-0.24}]},{"name":"dress0104","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":-0.34},{"duration":15,"tweenEasing":0,"rotate":1.23},{"duration":20,"tweenEasing":0,"rotate":2.69},{"duration":0}]},{"name":"dress0204","rotateFrame":[{"duration":22,"rotate":-3.52},{"duration":13,"tweenEasing":0,"rotate":-3.52},{"duration":15,"tweenEasing":0,"rotate":-3.1},{"duration":20,"tweenEasing":0,"rotate":-1.55},{"duration":0,"rotate":-3.52}]},{"name":"dress0304","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-1.06},{"duration":13,"tweenEasing":0,"rotate":2.24},{"duration":15,"tweenEasing":0,"rotate":-2.31},{"duration":20,"tweenEasing":0,"rotate":-2.85},{"duration":0,"rotate":-1.06}]},{"name":"dress0105","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":13,"tweenEasing":0,"rotate":-1.43},{"duration":15,"tweenEasing":0,"rotate":0.13},{"duration":20,"tweenEasing":0,"rotate":1.34},{"duration":0}]},{"name":"dress0205","rotateFrame":[{"duration":22,"rotate":-3.21},{"duration":13,"tweenEasing":0,"rotate":-3.21},{"duration":15,"tweenEasing":0,"rotate":0.26},{"duration":20,"tweenEasing":0,"rotate":1.24},{"duration":0,"rotate":-3.21}]},{"name":"dress0305","rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":-1.06},{"duration":13,"tweenEasing":0,"rotate":0.1},{"duration":15,"tweenEasing":0,"rotate":-1.69},{"duration":20,"tweenEasing":0,"rotate":-2.94},{"duration":0,"rotate":-1.06}]},{"name":"hair0302","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-9.49},{"duration":15,"tweenEasing":0,"rotate":-5.83},{"duration":20,"tweenEasing":0,"rotate":-3.14},{"duration":0}]},{"name":"hair0202","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-5.26},{"duration":15,"tweenEasing":0,"rotate":-3.71},{"duration":20,"tweenEasing":0,"rotate":4.87},{"duration":0}]},{"name":"hair0401","rotateFrame":[{"duration":15,"tweenEasing":0,"rotate":-1.25},{"duration":20,"tweenEasing":0,"rotate":3.1},{"duration":15,"tweenEasing":0,"rotate":3.63},{"duration":20,"tweenEasing":0,"rotate":1.4},{"duration":0,"rotate":-1.25}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.01},{"duration":15,"tweenEasing":0,"x":1.01},{"duration":20,"tweenEasing":0,"x":0.99,"y":1.03},{"duration":0}]},{"name":"hair0603","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-0.33},{"duration":15,"tweenEasing":0,"rotate":1.38},{"duration":20,"tweenEasing":0,"rotate":-0.39},{"duration":0}]},{"name":"hair0403","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-9},{"duration":15,"tweenEasing":0,"rotate":-5.55},{"duration":20,"tweenEasing":0,"rotate":1.59},{"duration":0}]},{"name":"hair0101","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":3.16},{"duration":15,"tweenEasing":0,"rotate":3.55},{"duration":20,"tweenEasing":0,"rotate":-0.57},{"duration":0}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.01,"y":1.03},{"duration":15,"tweenEasing":0,"x":1.02,"y":1.06},{"duration":20,"tweenEasing":0,"x":1.02,"y":1.09},{"duration":0}]},{"name":"hair0501","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":0.95},{"duration":15,"tweenEasing":0,"rotate":1.39},{"duration":20,"tweenEasing":0,"rotate":-2.05},{"duration":0}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.02},{"duration":15,"tweenEasing":0,"x":1.01},{"duration":20}]},{"name":"hair0102","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-3.47},{"duration":15,"tweenEasing":0,"rotate":-0.97},{"duration":20,"tweenEasing":0,"rotate":3.04},{"duration":0}]},{"name":"hair0201","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":5.64},{"duration":15,"tweenEasing":0,"rotate":2.37},{"duration":20,"tweenEasing":0,"rotate":-2.93},{"duration":0}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.01},{"duration":15,"tweenEasing":0,"x":1.01},{"duration":20,"tweenEasing":0,"x":0.99,"y":1.1},{"duration":0}]},{"name":"hair0103","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-5.36},{"duration":15,"tweenEasing":0,"rotate":-3.28},{"duration":20,"tweenEasing":0,"rotate":2.54},{"duration":0}]},{"name":"hair0602","rotateFrame":[{"duration":15,"tweenEasing":0,"rotate":-1.51},{"duration":20,"tweenEasing":0,"rotate":-0.71},{"duration":15,"tweenEasing":0,"rotate":-3.86},{"duration":20,"tweenEasing":0,"rotate":-3.17},{"duration":0,"rotate":-1.51}]},{"name":"hair0301","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":5.27},{"duration":15,"tweenEasing":0,"rotate":4.97},{"duration":20,"tweenEasing":0,"rotate":-0.41},{"duration":0}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.01},{"duration":15,"tweenEasing":0,"x":1.03},{"duration":20,"tweenEasing":0,"x":1.01,"y":1.1},{"duration":0}]},{"name":"hair0601","rotateFrame":[{"duration":15,"tweenEasing":0,"rotate":-3.34},{"duration":20,"tweenEasing":0,"rotate":-5.91},{"duration":15,"tweenEasing":0,"rotate":-5.59},{"duration":20,"tweenEasing":0,"rotate":-3.3},{"duration":0,"rotate":-3.34}],"scaleFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"x":1.02},{"duration":15,"tweenEasing":0,"x":1.01,"y":1.02},{"duration":20,"tweenEasing":0,"y":1.04},{"duration":0}]},{"name":"hair0502","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":0.42},{"duration":15,"tweenEasing":0,"rotate":-1.83},{"duration":20,"tweenEasing":0,"rotate":3.17},{"duration":0}]},{"name":"hair0503","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-2.64},{"duration":15,"tweenEasing":0,"rotate":-2.78},{"duration":20,"tweenEasing":0,"rotate":1.4},{"duration":0}]},{"name":"hair0402","rotateFrame":[{"duration":15,"tweenEasing":0,"rotate":-0.94},{"duration":20,"tweenEasing":0,"rotate":-4.85},{"duration":15,"tweenEasing":0,"rotate":-1.27},{"duration":20,"tweenEasing":0,"rotate":-3.24},{"duration":0,"rotate":-0.94}]},{"name":"bag0101","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":3.56,"y":-2.67},{"duration":26,"tweenEasing":0,"x":3.31,"y":0.72},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.34},{"duration":26,"tweenEasing":0,"rotate":-3},{"duration":0}]},{"name":"bag0102","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.59,"y":1.36},{"duration":26,"tweenEasing":0,"x":1.17,"y":-1.13},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.19},{"duration":26,"tweenEasing":0,"rotate":0.41},{"duration":0}]},{"name":"hair0504","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":-1.51},{"duration":15,"tweenEasing":0,"rotate":0.09},{"duration":20,"tweenEasing":0,"rotate":-3.69},{"duration":0}]},{"name":"hair0604","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":1.62},{"duration":15,"tweenEasing":0,"rotate":1.93},{"duration":20,"tweenEasing":0,"rotate":0.89},{"duration":0}]},{"name":"hair0505","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":2.83},{"duration":15,"tweenEasing":0,"rotate":-0.84},{"duration":20,"tweenEasing":0,"rotate":-4.33},{"duration":0}]},{"name":"hair0605","rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":2.85},{"duration":15,"tweenEasing":0,"rotate":1.24},{"duration":20,"tweenEasing":0,"rotate":-0.49},{"duration":0}]},{"name":"finger_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.72},{"duration":26,"tweenEasing":0,"rotate":0.51},{"duration":0}]},{"name":"figner_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":0.64},{"duration":26,"tweenEasing":0,"rotate":-0.88},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":60,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-2.03,-5.52,-2.98,-4.71,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":40,"name":"angry","bone":[{"name":"pelvis","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-15.8,"y":12.43},{"duration":5,"tweenEasing":0,"x":-18.91,"y":18.67},{"duration":15,"tweenEasing":0,"x":30.03,"y":-8.63},{"duration":10,"tweenEasing":0,"x":19.35,"y":0.32},{"duration":0}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-1.23},{"duration":5,"tweenEasing":0,"rotate":-3.19},{"duration":25,"tweenEasing":0,"rotate":2.16},{"duration":0}],"scaleFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.01,"y":1.01},{"duration":10}]},{"name":"spine","rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"rotate":-0.82},{"duration":15,"tweenEasing":0,"rotate":-0.82},{"duration":5,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.36},{"duration":0}]},{"name":"spine1","rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"rotate":-1.06},{"duration":5,"tweenEasing":0,"rotate":-1.06},{"duration":10,"tweenEasing":0,"rotate":0.69},{"duration":5,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":0.12},{"duration":0}]},{"name":"spine2","rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"rotate":-4.74},{"duration":5,"tweenEasing":0,"rotate":-4.74},{"duration":10,"tweenEasing":0,"rotate":-1.49},{"duration":5,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.02},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":9.53},{"duration":5,"tweenEasing":0,"rotate":7.9},{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":0.25},{"duration":10}]},{"name":"head","rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":5.48},{"duration":5,"tweenEasing":0,"rotate":7.06},{"duration":5,"tweenEasing":0,"rotate":9.75},{"duration":10,"tweenEasing":0,"rotate":0.06},{"duration":5,"rotate":3.23},{"duration":10,"tweenEasing":0,"rotate":-0.28},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":15},{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.1},{"duration":10,"x":1.1},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":5.52,"y":-0.79},{"duration":15,"tweenEasing":0,"x":0.25,"y":-7.74},{"duration":10,"tweenEasing":0,"x":0.98,"y":-0.45},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":6.95},{"duration":15,"tweenEasing":0,"rotate":3.13},{"duration":10,"tweenEasing":0,"rotate":11.35},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.47,"y":-3.41},{"duration":10,"tweenEasing":0,"x":3.23,"y":1.87},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":15,"tweenEasing":0,"rotate":-6.79},{"duration":10,"tweenEasing":0,"rotate":-6.79},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":8,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":7,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":15,"tweenEasing":0,"vertices":[-1.87,0.62,-1.98,0.28,0,0,-1.01,-0.08,-2.5,0.57,0,0,5.1,-2.2,4.88,-1.8,0,0,-1.28,0.31,-5.9,-0.75,0,0,0,0,0,0,0,0,0,0,0,0,-0.49,0.11,-0.25,-0.44,-0.82,-1.82,-1.33,0.12,0,0,-0.68,-2.71,-2.19,-0.66,-3.29,-1.44,0,0,0,0,0,0,0,0,2.73,-2.91,0,0,0,0,0,0,0,0,1.88,0.07,0,0,0,0,1.15,-2.74,1.88,0.07,0.12,1.14,0.18,-1.39,0.35,-2.78,0.91,-2.04,2.16,-1.07,0.88,-0.95,0,0,9.65,-0.88,10.24,-4.97,13.91,-3.95,2.73,-0.14,-11.78,6.19,-6.91,8.32,-3.57,-3.84,-1.38,1.31,-3.18,7.19,-3.54,8.05,0,0,0,0,0,0,0,0,-1.89,-1.06,-0.9,0,0,2.94,1.7,-0.28,-2.77,-0.52,-3.56,-1.11,-4.97,-0.67,-4.47,-1.58,-1.09,-0.06,2.34,-0.26,0,0,15.31,0.26,5.27,-1.13]},{"duration":10,"tweenEasing":0,"vertices":[-1.87,0.62,-1.98,0.28,0,0,-1.01,-0.08,-2.5,0.57,0,0,5.1,-2.2,4.88,-1.8,0,0,-1.28,0.31,-5.9,-0.75,0,0,0,0,0,0,0,0,0,0,0,0,-0.49,0.11,-0.25,-0.44,-0.82,-1.82,-1.33,0.12,0,0,-0.68,-2.71,-2.19,-0.66,-3.29,-1.44,0,0,0,0,0,0,0,0,2.73,-2.91,0,0,0,0,0,0,0,0,1.88,0.07,0,0,0,0,1.15,-2.74,1.88,0.07,0.12,1.14,0.18,-1.39,0.35,-2.78,0.91,-2.04,2.16,-1.07,0.88,-0.95,0,0,9.65,-0.88,10.24,-4.97,13.91,-3.95,2.73,-0.14,-11.78,6.19,-6.91,8.32,-3.57,-3.84,-1.38,1.31,-3.18,7.19,-3.54,8.05,0,0,0,0,0,0,0,0,-1.89,-1.06,-0.9,0,0,2.94,1.7,-0.28,-2.77,-0.52,-3.56,-1.11,-4.97,-0.67,-4.47,-1.58,-1.09,-0.06,2.34,-0.26,0,0,15.31,0.26,5.27,-1.13]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":40,"name":"badmemory","bone":[{"name":"head","rotateFrame":[{"duration":16,"tweenEasing":0,"rotate":5.48},{"duration":6,"tweenEasing":0,"rotate":6.92},{"duration":12,"tweenEasing":0,"rotate":-0.07},{"duration":6,"tweenEasing":0,"rotate":0.54},{"duration":0,"rotate":5.48}]},{"name":"spine2","translateFrame":[{"duration":6,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":2.53,"y":-0.33},{"duration":8,"tweenEasing":0,"x":4.82,"y":-0.61},{"duration":17}],"rotateFrame":[{"duration":6,"tweenEasing":0},{"duration":9,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":0.9},{"duration":11,"tweenEasing":0,"rotate":2.2},{"duration":6,"tweenEasing":0,"rotate":2.89},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":12.03,"y":-1.18},{"duration":6,"tweenEasing":0,"x":28.37,"y":-1.65},{"duration":12,"tweenEasing":0,"x":22.59,"y":-1.35},{"duration":6,"tweenEasing":0,"x":20.06,"y":-1.64},{"duration":0}],"rotateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":0.57},{"duration":6,"tweenEasing":0,"rotate":0.16},{"duration":12,"tweenEasing":0,"rotate":-0.71},{"duration":6,"tweenEasing":0,"rotate":-0.71},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":0.01,"y":-2.04},{"duration":24}],"rotateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0},{"duration":6,"tweenEasing":0,"rotate":-1.26},{"duration":12,"tweenEasing":0,"rotate":-1.4},{"duration":6,"tweenEasing":0,"rotate":-1.01},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.38,"y":-0.07},{"duration":6,"tweenEasing":0,"x":1.44,"y":-0.06},{"duration":18}],"rotateFrame":[{"duration":6,"tweenEasing":0},{"duration":10,"tweenEasing":0},{"duration":6,"tweenEasing":0,"rotate":0.33},{"duration":12,"tweenEasing":0,"rotate":1.87},{"duration":6,"tweenEasing":0,"rotate":1.54},{"duration":0}]},{"name":"face","scaleFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.05},{"duration":20,"tweenEasing":0,"x":0.96},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":16,"tweenEasing":0},{"duration":9,"tweenEasing":0,"rotate":1.02},{"duration":9,"rotate":-5.91},{"duration":6,"tweenEasing":0,"rotate":-5.91},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":10.28,"y":-32.99},{"duration":0}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-6.09},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":15.8,"y":12.4},{"duration":0}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":6.59},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":16,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":6,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.43,-0.5,0.25,3.92,2.03,6.25,0.8,5.53,-4.6,-3.81,-4.05,-5.21,-3.78,-5.56,-0.44,-3.11,-2.52,-1.5,2.35,0.75]},{"duration":12,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,0.23,-3.27,-1.91,-3.53,-3.29,-2.4,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.17,-4.3,-2.98,-4.88,-3.41,-3.21,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"cry","bone":[{"name":"pelvis","translateFrame":[{"duration":6,"tweenEasing":0},{"duration":11,"tweenEasing":0,"x":11.5,"y":-0.72},{"duration":11,"tweenEasing":0,"x":18.27,"y":-0.99},{"duration":5,"tweenEasing":0,"x":17.36,"y":-0.99},{"duration":7,"tweenEasing":0,"x":19.78,"y":-0.99},{"duration":5,"tweenEasing":0,"x":11.18,"y":-0.99},{"duration":5,"tweenEasing":0,"x":13.02,"y":-1.49},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":9,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":0.06,"y":0.73},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-0.43},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-0.43},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-0.43},{"duration":9}],"rotateFrame":[{"duration":9,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":-0.31},{"duration":24,"tweenEasing":0,"rotate":0.09},{"duration":9,"tweenEasing":0,"rotate":0.09},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":9,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.84,"y":0.11},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":9}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":4,"tweenEasing":0,"rotate":-0.47},{"duration":3,"tweenEasing":0,"rotate":-1.54},{"duration":5,"tweenEasing":0,"rotate":-0.78},{"duration":24,"tweenEasing":0,"rotate":-0.93},{"duration":9,"tweenEasing":0,"rotate":-0.93},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":2.8,"y":0.62},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":9}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":6,"tweenEasing":0,"rotate":2.33},{"duration":25,"tweenEasing":0,"rotate":1.32},{"duration":9,"tweenEasing":0,"rotate":1.32},{"duration":0}]},{"name":"head","translateFrame":[{"duration":17,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-2.72,"y":0.02},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-2.72,"y":0.02},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-2.72,"y":0.02},{"duration":9}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":5.48},{"duration":4,"tweenEasing":0,"rotate":6.42},{"duration":3,"tweenEasing":0,"rotate":4.02},{"duration":5,"tweenEasing":0,"rotate":1.91},{"duration":3,"tweenEasing":0,"rotate":3.51},{"duration":5,"tweenEasing":0,"rotate":2.55},{"duration":3,"tweenEasing":0,"rotate":3.51},{"duration":5,"tweenEasing":0,"rotate":2.55},{"duration":3,"tweenEasing":0,"rotate":3.51},{"duration":5,"tweenEasing":0,"rotate":2.55},{"duration":9,"tweenEasing":0,"rotate":3.51},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":17},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.94},{"duration":9}]},{"name":"hand_l","translateFrame":[{"duration":20,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":9.7,"y":-14.97},{"duration":0}],"rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-11.12},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":20,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.59,"y":-7.58},{"duration":20,"tweenEasing":0,"x":1.59,"y":-7.58},{"duration":0}],"rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":2.29},{"duration":20,"tweenEasing":0,"rotate":2.29},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.17,-4.3,-2.98,-4.88,-3.41,-3.21,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.41,13.36,4.11,16.79,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,0.36,1.31,1.27,2.27,0.77,2.38,1.01,1.34,-0.49,-5.68,-3.16,-5.41,-2.61,-3.66,0.47,-0.36,1.28,-1.61,1.7,-0.66,4.7,12.53,3.9,5.11,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":6,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.17,-4.3,-2.98,-4.88,-3.41,-3.21,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":10,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"laugh","bone":[{"name":"pelvis","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":11.5,"y":-0.72},{"duration":4,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":4,"tweenEasing":0,"x":21.09,"y":-1.41},{"duration":4,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":5,"tweenEasing":0,"x":21.09,"y":-1.41},{"duration":5,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":6,"tweenEasing":0,"x":21.09,"y":-1.41},{"duration":3,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":9,"tweenEasing":0,"x":13.02,"y":-0.63},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"y":-0.43},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-0.43},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"y":-0.43},{"duration":12}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":28,"tweenEasing":0,"rotate":0.09},{"duration":12,"tweenEasing":0,"rotate":0.09},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":12}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-0.47},{"duration":28,"tweenEasing":0,"rotate":-0.93},{"duration":12,"tweenEasing":0,"rotate":-0.93},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":12}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-0.85},{"duration":28,"tweenEasing":0,"rotate":1.32},{"duration":12,"tweenEasing":0,"rotate":1.32},{"duration":0}]},{"name":"head","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":-1.36,"y":0.01},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-1.36,"y":0.01},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":-1.36,"y":0.01},{"duration":12}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":5.48},{"duration":5,"tweenEasing":0,"rotate":6.42},{"duration":4,"tweenEasing":0,"rotate":19.15},{"duration":4,"tweenEasing":0,"rotate":20.93},{"duration":4,"tweenEasing":0,"rotate":19.15},{"duration":5,"tweenEasing":0,"rotate":20.93},{"duration":5,"tweenEasing":0,"rotate":19.15},{"duration":6,"tweenEasing":0,"rotate":20.93},{"duration":12,"tweenEasing":0,"rotate":19.15},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":10},{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.11},{"duration":11,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":1.11},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":5.29,"y":-10.57},{"duration":10,"tweenEasing":0,"x":5.29,"y":-10.57},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-7.22},{"duration":10,"tweenEasing":0,"rotate":-10.06},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":30,"tweenEasing":0,"y":-8.81},{"duration":10,"tweenEasing":0,"y":-8.81},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":1.46},{"duration":10,"tweenEasing":0,"rotate":3.81},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":10,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":8,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,0.44,1.7,0.44,1.7,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.96,-4.45,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.07,1.35,0.68,2.47,-0.33,2.22,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":6,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,0.44,1.7,0.44,1.7,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.52,-3.81,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,0.65,-2.55,-0.74,-1.42,-1.75,-1.68,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":6,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.66,-4.45,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":10,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,0.44,1.7,0.44,1.7,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.78,-4.46,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,0.94,-2.6,-0.45,-1.48,-1.46,-1.73,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":10,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.3,-3.2,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":55,"name":"sad","bone":[{"name":"pelvis","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":10.08,"y":-0.49},{"duration":15,"tweenEasing":0,"x":23.26,"y":-0.99},{"duration":13,"tweenEasing":0,"x":31.41,"y":-1.99},{"duration":10,"tweenEasing":0,"x":13.02},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":17,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":-0.25,"y":-2.49},{"duration":23,"tweenEasing":0,"y":0.16},{"duration":0}],"rotateFrame":[{"duration":17,"tweenEasing":0},{"duration":15,"tweenEasing":0,"rotate":-0.31},{"duration":23,"tweenEasing":0,"rotate":-0.23},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.36,"y":0.08},{"duration":23,"tweenEasing":0,"x":0.53,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0,"rotate":-0.05},{"duration":15,"tweenEasing":0,"rotate":-0.78},{"duration":23,"tweenEasing":0,"rotate":-0.08},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":2.66,"y":-0.29},{"duration":23,"tweenEasing":0,"x":7.96,"y":-0.97},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0,"rotate":2.66},{"duration":15,"tweenEasing":0,"rotate":4.62},{"duration":23,"tweenEasing":0,"rotate":2.8},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0,"rotate":-3.28},{"duration":15,"tweenEasing":0,"rotate":-4.66},{"duration":13,"tweenEasing":0,"rotate":-5.29},{"duration":10,"tweenEasing":0,"rotate":-3.28},{"duration":0}]},{"name":"head","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":-0.87,"y":0.02},{"duration":15,"tweenEasing":0,"x":-2.72,"y":0.07},{"duration":13,"tweenEasing":0,"x":-2.72,"y":0.07},{"duration":10,"tweenEasing":0,"x":-0.87,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":5.48},{"duration":7,"tweenEasing":0,"rotate":-5.66},{"duration":15,"tweenEasing":0,"rotate":-5.04},{"duration":13,"tweenEasing":0,"rotate":-2.39},{"duration":10,"tweenEasing":0,"rotate":-4.39},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":17},{"duration":15,"tweenEasing":0},{"duration":23,"tweenEasing":0,"x":0.85},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":20,"tweenEasing":0},{"duration":35,"tweenEasing":0,"x":5.12,"y":13.17},{"duration":0}],"rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":35,"tweenEasing":0,"rotate":-8.33},{"duration":0}]},{"name":"hand_r","rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":35,"tweenEasing":0,"rotate":6.75},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":17,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":15,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,0.23,-3.27,-1.91,-3.53,-3.29,-2.4,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":23,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,0.23,-3.27,-1.91,-3.53,-3.29,-2.4,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"shock","bone":[{"name":"pelvis","translateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"x":89.53,"y":-0.76},{"duration":25,"tweenEasing":0,"x":82.93,"y":-1.94},{"duration":10,"tweenEasing":0,"x":87.24,"y":-2.19},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":0.42},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.42},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"y":-0.76},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":1.82},{"duration":25,"tweenEasing":0,"rotate":2.4},{"duration":10,"tweenEasing":0,"rotate":2.01},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":0.67,"y":-0.06},{"duration":0}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":-1.75},{"duration":25,"tweenEasing":0,"rotate":-0.63},{"duration":10,"tweenEasing":0,"rotate":-0.5},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":0.66,"y":-0.1},{"duration":0}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-4.34},{"duration":10,"tweenEasing":0,"rotate":-3.56},{"duration":0}]},{"name":"head","rotateFrame":[{"duration":7,"tweenEasing":0,"rotate":5.48},{"duration":8,"tweenEasing":0,"rotate":9.23},{"duration":25,"tweenEasing":0,"rotate":10.04},{"duration":10,"tweenEasing":0,"rotate":10.04},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":7},{"duration":8,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":1.16},{"duration":10,"tweenEasing":0,"x":1.1},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":19.71,"y":-30.3},{"duration":10,"tweenEasing":0,"x":19.71,"y":-30.3},{"duration":0}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-3.83},{"duration":10,"tweenEasing":0,"rotate":-7.08},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":1.72,"y":-14.9},{"duration":10,"tweenEasing":0,"x":1.72,"y":-14.9},{"duration":0}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":9.15},{"duration":10,"tweenEasing":0,"rotate":11.6},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":7,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":33,"tweenEasing":0,"offset":12,"vertices":[-0.05,-3.42,-0.05,-3.42,0,0,-0.05,-3.42,-0.05,-3.42,0,0,-1.72,-2.68,0,0,0,0,0,0,0,0,-1.73,-2.69,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.73,-2.69,-1.73,-2.7,-1.73,-2.7,-1.73,-2.69,-1.73,-2.69,0,0,0,0,0,0,0,0,0,0,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,0,0,-1.72,-2.67,-1.72,-2.66,-1.72,-2.67,-1.72,-2.67,-1.73,-2.7,-1.73,-2.7,-1.73,-2.7,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0,0,-1.73,-2.69,-0.04,-3.4,-0.05,-3.42]},{"duration":10,"tweenEasing":0,"offset":12,"vertices":[-0.05,-3.42,-0.05,-3.42,0,0,-0.05,-3.42,-0.05,-3.42,0,0,-1.72,-2.68,0,0,0,0,0,0,0,0,-1.73,-2.69,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.73,-2.69,-1.73,-2.7,-1.73,-2.7,-1.73,-2.69,-1.73,-2.69,0,0,0,0,0,0,0,0,0,0,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,0,0,-1.72,-2.67,-1.72,-2.66,-1.72,-2.67,-1.72,-2.67,-1.73,-2.7,-1.73,-2.7,-1.73,-2.7,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0,0,-1.73,-2.69,-0.04,-3.4,-0.05,-3.42]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":60,"name":"shy","bone":[{"name":"pelvis","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":-12.43,"y":3.83},{"duration":17,"tweenEasing":0,"x":0.61,"y":-0.66},{"duration":8,"tweenEasing":0,"x":-12.43,"y":3.83},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":1.66},{"duration":17,"tweenEasing":0,"rotate":-1.18},{"duration":8,"tweenEasing":0,"rotate":1.66},{"duration":0}]},{"name":"spine","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-0.31},{"duration":17,"tweenEasing":0,"rotate":-0.19},{"duration":8,"tweenEasing":0,"rotate":-0.31},{"duration":0}]},{"name":"spine1","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-0.44},{"duration":17,"tweenEasing":0,"rotate":0.22},{"duration":8,"tweenEasing":0,"rotate":-1.24},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":2.66,"y":-0.29},{"duration":17,"tweenEasing":0,"x":3.63,"y":-0.43},{"duration":8,"tweenEasing":0,"x":2.66,"y":-0.29},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-1.47},{"duration":17,"tweenEasing":0,"rotate":0.87},{"duration":8,"tweenEasing":0,"rotate":-1.94},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-0.93},{"duration":17,"tweenEasing":0,"rotate":-0.13},{"duration":8,"tweenEasing":0,"rotate":2.05},{"duration":0}]},{"name":"head","rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":5.48},{"duration":25,"tweenEasing":0,"rotate":-2.36},{"duration":17,"tweenEasing":0,"rotate":-5.94},{"duration":8,"tweenEasing":0,"rotate":-3.97},{"duration":0,"rotate":5.48}],"scaleFrame":[{"duration":10,"tweenEasing":0},{"duration":42,"tweenEasing":0,"y":0.99},{"duration":8,"tweenEasing":0,"y":0.99},{"duration":0}]},{"name":"face","scaleFrame":[{"duration":15},{"duration":15,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.87},{"duration":8}]},{"name":"hand_l","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":1.86,"y":5.96},{"duration":10,"tweenEasing":0,"x":1.86,"y":5.96},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":40,"tweenEasing":0,"rotate":-4.94},{"duration":10,"tweenEasing":0,"rotate":-4.94},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-0.55,"y":-9.54},{"duration":10,"tweenEasing":0,"x":-0.55,"y":-9.54},{"duration":0}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":40,"tweenEasing":0,"rotate":9.14},{"duration":10,"tweenEasing":0,"rotate":9.14},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":6,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":14,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-2.03,-5.52,-2.98,-4.71,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-1.49,-2.73,-2.96,-3.31,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.41,0.44,2.42,5.41,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.81,-3.38,-3.84,-3.79,-3.46,-1.22,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-1.49,-2.73,-2.96,-3.31,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":10,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":10,"tweenEasing":0,"vertices":[0.57,3.51,0.2,0.84,0,0,-2.18,-2.55,-3.14,-3.59,0,0,0.39,1.56,0.39,1.56,0,0,0.32,0.83,0.32,0.83,0,0,4.09,7.12,0.23,0.98,0,0,0,0,0,0,2.95,7.47,4.52,14.58,4.82,12.46,3.11,12.5,4.73,6.43,5.16,12.68,5.2,15.26,3.5,12.71,2.99,9.39,4.47,12.98,5.16,12.66,4.1,12.02,2.3,7.66,0.23,1.21,0,0,0,0,0,0,0.76,2.88,4.35,8.58,4.46,11.69,3.58,10.98,0.42,1.93,4.15,10.44,5.42,13.64,4.03,11.8,1.48,6.75,3.33,9.44,2.5,11.46,3.81,11.27,0.39,1.56,0.39,1.56,0.39,1.56,0.39,1.56,0.32,0.83,0.32,0.83,0.32,0.83,0.32,0.83,0.32,0.83,0.32,0.83,0,0,0,0,0,0,0,0,-0.91,0.14,1.75,5.07,2.22,7.68,1.48,5.16,-3.87,-3.87,-4.39,-4.01,-4.07,-4.02,-3.42,-1.48,-2.12,-2.11,1.81,0.04,5.14,9.45,0.39,1.56,0.38,1.2]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":75,"name":"speak","bone":[{"name":"ik_foot_r","translateFrame":[{"duration":44,"tweenEasing":0},{"duration":31,"tweenEasing":0,"x":6.5},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"curve":[0.2595,0,0.946,0.8400000000000001],"x":-3.82,"y":0.6},{"duration":31,"curve":[0.228,0.135,0.7655000000000001,0.975],"x":-4.65,"y":0.79},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"curve":[0.2595,0,0.946,0.8400000000000001],"rotate":0.17},{"duration":31,"curve":[0.228,0.135,0.7655000000000001,0.975],"rotate":0.2},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":-0.29,"y":-1.62},{"duration":31,"tweenEasing":0,"x":-0.17,"y":-0.95},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.31},{"duration":31,"tweenEasing":0,"rotate":-0.19},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":1.65,"y":0.09},{"duration":31,"tweenEasing":0,"x":1.74,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.23},{"duration":31,"tweenEasing":0,"rotate":-0.17},{"duration":0}]},{"name":"foot_r","rotateFrame":[{"duration":44,"tweenEasing":0},{"duration":31,"tweenEasing":0,"rotate":2.99},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.08,"y":-0.01},{"duration":31,"tweenEasing":0,"x":2.57,"y":-0.29},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.89},{"duration":31,"tweenEasing":0,"rotate":0.47},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.15},{"duration":31,"tweenEasing":0,"rotate":-0.33},{"duration":0}]},{"name":"upperarm_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":0.76},{"duration":31,"tweenEasing":0,"rotate":1.63},{"duration":0}]},{"name":"upperarm_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-3.28},{"duration":31,"tweenEasing":0,"rotate":-4.04},{"duration":0}]},{"name":"xiong_l","translateFrame":[{"duration":15,"tweenEasing":0,"x":-1.48,"y":-4.58},{"duration":22,"tweenEasing":0,"x":-10.09,"y":5.25},{"duration":20,"tweenEasing":0,"x":10.49,"y":10.9},{"duration":18,"tweenEasing":0,"x":27.2,"y":4.5},{"duration":0,"x":-1.48,"y":-4.58}]},{"name":"xiong_r","translateFrame":[{"duration":15,"tweenEasing":0,"x":1.99,"y":6.16},{"duration":22,"tweenEasing":0,"x":-10.63,"y":0.37},{"duration":20,"tweenEasing":0,"x":4.31,"y":-9.17},{"duration":18,"tweenEasing":0,"x":20.58,"y":-8.09},{"duration":0,"x":1.99,"y":6.16}]},{"name":"forearm_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.24},{"duration":13,"tweenEasing":0,"rotate":0.88},{"duration":18,"tweenEasing":0,"rotate":1.2},{"duration":0}]},{"name":"forearm_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":2.2},{"duration":13,"tweenEasing":0,"rotate":1.25},{"duration":18,"tweenEasing":0,"rotate":0.16},{"duration":0}]},{"name":"head","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":-1.11},{"duration":31,"tweenEasing":0,"x":-1.36},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0,"rotate":5.48},{"duration":22,"tweenEasing":0,"rotate":5.11},{"duration":31,"tweenEasing":0,"rotate":5.72},{"duration":0,"rotate":5.48}]},{"name":"face","scaleFrame":[{"duration":15},{"duration":25,"tweenEasing":0},{"duration":35,"tweenEasing":0,"x":0.88},{"duration":0}]},{"name":"hand_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.95},{"duration":31,"tweenEasing":0,"rotate":-0.84},{"duration":0}]},{"name":"hand_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-0.52},{"duration":16,"tweenEasing":0,"rotate":-0.41},{"duration":15,"tweenEasing":0,"rotate":-1.08},{"duration":0}]},{"name":"dress0101","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":2.94},{"duration":21,"tweenEasing":0,"rotate":-0.24},{"duration":17,"tweenEasing":0,"rotate":-2.57},{"duration":0}]},{"name":"dress0201","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":-0.24},{"duration":16,"tweenEasing":0,"rotate":0.27},{"duration":21,"tweenEasing":0,"rotate":-1.35},{"duration":17,"tweenEasing":0,"rotate":-1.99},{"duration":0,"rotate":-0.24}],"scaleFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"x":0.99},{"duration":21,"tweenEasing":0,"x":0.98},{"duration":17,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"dress0301","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":-3.95},{"duration":21,"tweenEasing":0,"rotate":-1.11},{"duration":17,"tweenEasing":0,"rotate":1.42},{"duration":0}]},{"name":"dress0102","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":-1.33},{"duration":21,"tweenEasing":0,"rotate":1.12},{"duration":17,"tweenEasing":0,"rotate":0.58},{"duration":0}]},{"name":"dress0202","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":0.22},{"duration":16,"tweenEasing":0,"rotate":0.71},{"duration":21,"tweenEasing":0,"rotate":1.98},{"duration":17,"tweenEasing":0,"rotate":1.97},{"duration":0,"rotate":0.22}]},{"name":"dress0302","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":-2.34},{"duration":16,"tweenEasing":0,"rotate":-2.61},{"duration":21,"tweenEasing":0,"rotate":-4.52},{"duration":17,"tweenEasing":0,"rotate":-3.87},{"duration":0,"rotate":-2.34}]},{"name":"dress0103","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":0.34},{"duration":21,"tweenEasing":0,"rotate":2.76},{"duration":17,"tweenEasing":0,"rotate":3.21},{"duration":0}]},{"name":"dress0203","rotateFrame":[{"duration":21,"rotate":-0.42},{"duration":16,"tweenEasing":0,"rotate":-0.42},{"duration":21,"tweenEasing":0,"rotate":0.11},{"duration":17,"tweenEasing":0,"rotate":-0.41},{"duration":0,"rotate":-0.42}]},{"name":"dress0303","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":-0.24},{"duration":16,"tweenEasing":0,"rotate":0.98},{"duration":21,"tweenEasing":0,"rotate":-1.47},{"duration":17,"tweenEasing":0,"rotate":-2.69},{"duration":0,"rotate":-0.24}]},{"name":"dress0104","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":-0.34},{"duration":21,"tweenEasing":0,"rotate":1.23},{"duration":17,"tweenEasing":0,"rotate":2.69},{"duration":0}]},{"name":"dress0204","rotateFrame":[{"duration":21,"rotate":-3.52},{"duration":16,"tweenEasing":0,"rotate":-3.52},{"duration":21,"tweenEasing":0,"rotate":-3.1},{"duration":17,"tweenEasing":0,"rotate":-1.55},{"duration":0,"rotate":-3.52}]},{"name":"dress0304","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":-1.06},{"duration":16,"tweenEasing":0,"rotate":2.24},{"duration":21,"tweenEasing":0,"rotate":-2.31},{"duration":17,"tweenEasing":0,"rotate":-2.85},{"duration":0,"rotate":-1.06}]},{"name":"dress0105","rotateFrame":[{"duration":21,"tweenEasing":0},{"duration":16,"tweenEasing":0,"rotate":-1.43},{"duration":21,"tweenEasing":0,"rotate":0.13},{"duration":17,"tweenEasing":0,"rotate":1.34},{"duration":0}]},{"name":"dress0205","rotateFrame":[{"duration":21,"rotate":-3.21},{"duration":16,"tweenEasing":0,"rotate":-3.21},{"duration":21,"tweenEasing":0,"rotate":0.26},{"duration":17,"tweenEasing":0,"rotate":1.24},{"duration":0,"rotate":-3.21}]},{"name":"dress0305","rotateFrame":[{"duration":21,"tweenEasing":0,"rotate":-1.06},{"duration":16,"tweenEasing":0,"rotate":0.1},{"duration":21,"tweenEasing":0,"rotate":-1.69},{"duration":17,"tweenEasing":0,"rotate":-2.94},{"duration":0,"rotate":-1.06}]},{"name":"hair0302","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-9.49},{"duration":22,"tweenEasing":0,"rotate":-5.83},{"duration":18,"tweenEasing":0,"rotate":-3.14},{"duration":0}]},{"name":"hair0202","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-5.26},{"duration":22,"tweenEasing":0,"rotate":-3.71},{"duration":18,"tweenEasing":0,"rotate":4.87},{"duration":0}]},{"name":"hair0401","rotateFrame":[{"duration":18,"tweenEasing":0,"rotate":-1.25},{"duration":17,"tweenEasing":0,"rotate":3.1},{"duration":22,"tweenEasing":0,"rotate":3.63},{"duration":18,"tweenEasing":0,"rotate":1.4},{"duration":0,"rotate":-1.25}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.01},{"duration":22,"tweenEasing":0,"x":1.01},{"duration":18,"tweenEasing":0,"x":0.99,"y":1.03},{"duration":0}]},{"name":"hair0603","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-0.33},{"duration":22,"tweenEasing":0,"rotate":1.38},{"duration":18,"tweenEasing":0,"rotate":-0.39},{"duration":0}]},{"name":"hair0403","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-9},{"duration":22,"tweenEasing":0,"rotate":-5.55},{"duration":18,"tweenEasing":0,"rotate":1.59},{"duration":0}]},{"name":"hair0101","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":3.16},{"duration":22,"tweenEasing":0,"rotate":3.55},{"duration":18,"tweenEasing":0,"rotate":-0.57},{"duration":0}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.01,"y":1.03},{"duration":22,"tweenEasing":0,"x":1.02,"y":1.06},{"duration":18,"tweenEasing":0,"x":1.02,"y":1.09},{"duration":0}]},{"name":"hair0501","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":0.95},{"duration":22,"tweenEasing":0,"rotate":1.39},{"duration":18,"tweenEasing":0,"rotate":-2.05},{"duration":0}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.02},{"duration":22,"tweenEasing":0,"x":1.01},{"duration":18}]},{"name":"hair0102","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-3.47},{"duration":22,"tweenEasing":0,"rotate":-0.97},{"duration":18,"tweenEasing":0,"rotate":3.04},{"duration":0}]},{"name":"hair0201","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":5.64},{"duration":22,"tweenEasing":0,"rotate":2.37},{"duration":18,"tweenEasing":0,"rotate":-2.93},{"duration":0}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.01},{"duration":22,"tweenEasing":0,"x":1.01},{"duration":18,"tweenEasing":0,"x":0.99,"y":1.1},{"duration":0}]},{"name":"hair0103","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-5.36},{"duration":22,"tweenEasing":0,"rotate":-3.28},{"duration":18,"tweenEasing":0,"rotate":2.54},{"duration":0}]},{"name":"hair0602","rotateFrame":[{"duration":18,"tweenEasing":0,"rotate":-1.51},{"duration":17,"tweenEasing":0,"rotate":-0.71},{"duration":22,"tweenEasing":0,"rotate":-3.86},{"duration":18,"tweenEasing":0,"rotate":-3.17},{"duration":0,"rotate":-1.51}]},{"name":"hair0301","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":5.27},{"duration":22,"tweenEasing":0,"rotate":4.97},{"duration":18,"tweenEasing":0,"rotate":-0.41},{"duration":0}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.01},{"duration":22,"tweenEasing":0,"x":1.03},{"duration":18,"tweenEasing":0,"x":1.01,"y":1.1},{"duration":0}]},{"name":"hair0601","rotateFrame":[{"duration":18,"tweenEasing":0,"rotate":-3.34},{"duration":17,"tweenEasing":0,"rotate":-5.91},{"duration":22,"tweenEasing":0,"rotate":-5.59},{"duration":18,"tweenEasing":0,"rotate":-3.3},{"duration":0,"rotate":-3.34}],"scaleFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"x":1.02},{"duration":22,"tweenEasing":0,"x":1.01,"y":1.02},{"duration":18,"tweenEasing":0,"y":1.04},{"duration":0}]},{"name":"hair0502","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":0.42},{"duration":22,"tweenEasing":0,"rotate":-1.83},{"duration":18,"tweenEasing":0,"rotate":3.17},{"duration":0}]},{"name":"hair0503","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-2.64},{"duration":22,"tweenEasing":0,"rotate":-2.78},{"duration":18,"tweenEasing":0,"rotate":1.4},{"duration":0}]},{"name":"hair0402","rotateFrame":[{"duration":18,"tweenEasing":0,"rotate":-0.94},{"duration":17,"tweenEasing":0,"rotate":-4.85},{"duration":22,"tweenEasing":0,"rotate":-1.27},{"duration":18,"tweenEasing":0,"rotate":-3.24},{"duration":0,"rotate":-0.94}]},{"name":"bag0101","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":3.56,"y":-2.67},{"duration":31,"tweenEasing":0,"x":3.31,"y":0.72},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":-1.34},{"duration":31,"tweenEasing":0,"rotate":-3},{"duration":0}]},{"name":"bag0102","translateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.59,"y":1.36},{"duration":31,"tweenEasing":0,"x":1.17,"y":-1.13},{"duration":0}],"rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.19},{"duration":31,"tweenEasing":0,"rotate":0.41},{"duration":0}]},{"name":"hair0504","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":-1.51},{"duration":22,"tweenEasing":0,"rotate":0.09},{"duration":18,"tweenEasing":0,"rotate":-3.69},{"duration":0}]},{"name":"hair0604","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":1.62},{"duration":22,"tweenEasing":0,"rotate":1.93},{"duration":18,"tweenEasing":0,"rotate":0.89},{"duration":0}]},{"name":"hair0505","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":2.83},{"duration":22,"tweenEasing":0,"rotate":-0.84},{"duration":18,"tweenEasing":0,"rotate":-4.33},{"duration":0}]},{"name":"hair0605","rotateFrame":[{"duration":18,"tweenEasing":0},{"duration":17,"tweenEasing":0,"rotate":2.85},{"duration":22,"tweenEasing":0,"rotate":1.24},{"duration":18,"tweenEasing":0,"rotate":-0.49},{"duration":0}]},{"name":"finger_l","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":1.72},{"duration":31,"tweenEasing":0,"rotate":0.51},{"duration":0}]},{"name":"figner_r","rotateFrame":[{"duration":22,"tweenEasing":0},{"duration":22,"tweenEasing":0,"rotate":0.64},{"duration":31,"tweenEasing":0,"rotate":-0.88},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.43,-0.5,0.25,3.92,2.03,6.25,0.8,5.53,-4.6,-3.81,-4.05,-5.21,-3.78,-5.56,-0.44,-3.11,-2.52,-1.5,2.35,0.75]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[0.65,1.49,0.65,1.49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.89,-1.84,0.81,-2.39,-0.58,-2.13,-2.33,-1.59,-0.13,2.84,0.98,2.36,2.38,2.1,3.78,1.98,-1.28,2.95,-3.34,-1.37]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[0.65,1.49,0.65,1.49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.89,-1.84,0.81,-2.39,-0.58,-2.13,-2.33,-1.59,-0.13,2.84,0.98,2.36,2.38,2.1,3.78,1.98,-1.28,2.95,-3.34,-1.37]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[0.65,1.49,0.65,1.49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.89,-1.84,0.81,-2.39,-0.58,-2.13,-2.33,-1.59,-0.13,2.84,0.98,2.36,2.38,2.1,3.78,1.98,-1.28,2.95,-3.34,-1.37]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[0.65,1.49,0.65,1.49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.89,-1.84,0.81,-2.39,-0.58,-2.13,-2.33,-1.59,-0.13,2.84,0.98,2.36,2.38,2.1,3.78,1.98,-1.28,2.95,-3.34,-1.37]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":4,"tweenEasing":0},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"happy","bone":[{"name":"pelvis","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"y":12.05},{"duration":10,"tweenEasing":0,"x":21.21,"y":-2.92},{"duration":10,"tweenEasing":0,"y":-0.56},{"duration":10,"tweenEasing":0,"x":21.21,"y":15.53},{"duration":0}]},{"name":"spine2","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-2.03},{"duration":10,"tweenEasing":0,"rotate":2.08},{"duration":10,"tweenEasing":0,"rotate":-2.9},{"duration":10,"tweenEasing":0,"rotate":-0.12},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-4.56},{"duration":20,"tweenEasing":0,"rotate":14.64},{"duration":10,"tweenEasing":0,"rotate":9.38},{"duration":0}]},{"name":"head","rotateFrame":[{"duration":50,"rotate":5.48}]},{"name":"hand_l","translateFrame":[{"duration":20,"curve":[0.5,0,1,1]},{"duration":10,"tweenEasing":0,"x":32.65,"y":-66.12},{"duration":10,"tweenEasing":0,"x":18.26,"y":-17.89},{"duration":10,"tweenEasing":0,"x":31.24,"y":-46.39},{"duration":0}],"rotateFrame":[{"duration":20,"curve":[0.5,0,1,1]},{"duration":10,"tweenEasing":0,"rotate":39.48},{"duration":10,"tweenEasing":0,"rotate":34.68},{"duration":10,"tweenEasing":0,"rotate":32.83},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":20,"curve":[0.5,0,1,1]},{"duration":10,"tweenEasing":0,"x":60.5,"y":37.73},{"duration":10,"tweenEasing":0,"x":22.37,"y":11.65},{"duration":10,"tweenEasing":0,"x":42.82,"y":10.57},{"duration":0}],"rotateFrame":[{"duration":20,"curve":[0.5,0,1,1]},{"duration":10,"tweenEasing":0,"rotate":-43.89},{"duration":10,"tweenEasing":0,"rotate":-35.32},{"duration":10,"tweenEasing":0,"rotate":-32.36},{"duration":0}]}],"ffd":[{"name":"face/10202001","skin":"","slot":"1046","frame":[{"duration":10,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":30,"tweenEasing":0,"vertices":[0.41,2.51,-1.29,-4.08,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-1.67,-5.86,-3.71,-12.26,-4.11,-14.72,-4.84,-10.32,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,-1.26,-3.82,-3.22,-10.79,-3.92,-11.81,-2.73,-7.89,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":10,"tweenEasing":0,"vertices":[0.41,2.51,-1.29,-4.08,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-1.67,-5.86,-3.71,-12.26,-4.11,-14.72,-4.84,-10.32,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,-1.26,-3.82,-3.22,-10.79,-3.92,-11.81,-2.73,-7.89,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.43,-0.5,0.25,3.92,2.03,6.25,0.8,5.53,-4.6,-3.81,-4.05,-5.21,-3.78,-5.56,-0.44,-3.11,-2.52,-1.5,2.35,0.75]}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]}]}
\ No newline at end of file
+{"frameRate":30,"name":"body","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"body","aabb":{"x":-367.45,"y":-1537.14,"width":581.37,"height":1585.72},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"ik_foot_r","parent":"nv","transform":{"x":124.92,"y":-122.27,"skX":87.84,"skY":87.84}},{"name":"ik_foot_l","parent":"nv","transform":{"x":-58.79,"y":-68.24,"skX":100.64,"skY":100.64}},{"name":"ding","parent":"nv","transform":{"y":-50}},{"name":"pelvis","parent":"nv","transform":{"x":-92.88,"y":-910.14}},{"length":138,"name":"dress0201","parent":"pelvis","transform":{"x":1.75,"y":17.13,"skX":89.26,"skY":89.26}},{"length":169,"name":"dress0301","parent":"pelvis","transform":{"x":113.59,"y":-30.15,"skX":74.24,"skY":74.24}},{"length":93,"name":"bag0101","parent":"pelvis","transform":{"x":75.39,"y":-79.46,"skX":69.69,"skY":69.69}},{"length":407,"name":"thigh_l","parent":"pelvis","transform":{"x":-36.25,"y":30.43,"skX":88.164,"skY":88.164}},{"length":393,"name":"thigh_r","parent":"pelvis","transform":{"x":77.79,"y":26.43,"skX":93.63,"skY":93.63}},{"length":154,"name":"dress0101","parent":"pelvis","transform":{"x":-82.25,"y":-25.45,"skX":102.82,"skY":102.82}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":176,"name":"dress0102","parent":"dress0101","transform":{"x":154.48,"y":1.04,"skX":-1.8,"skY":-1.8}},{"length":408,"name":"calf_l","parent":"thigh_l","transform":{"x":407.97,"y":-1.43,"skX":-2.7,"skY":-2.7}},{"length":161,"name":"dress0202","parent":"dress0201","transform":{"x":138.34,"y":-0.27,"skX":-1.35,"skY":-1.35}},{"length":161,"name":"dress0302","parent":"dress0301","transform":{"x":169.23,"y":-0.5,"skX":2.25,"skY":2.25}},{"length":410,"name":"calf_r","parent":"thigh_r","transform":{"x":395.5,"y":-1.18,"skX":-29.2,"skY":-29.2}},{"length":95,"name":"bag0102","parent":"bag0101","transform":{"x":93.12,"y":-0.29}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"length":182,"name":"dress0203","parent":"dress0202","transform":{"x":161.4,"y":-0.1,"skX":-0.9,"skY":-0.9}},{"length":181,"name":"dress0303","parent":"dress0302","transform":{"x":162.95,"y":-0.17,"skX":-1.36,"skY":-1.36}},{"inheritRotation":false,"length":97,"name":"foot_r","parent":"calf_r","transform":{"x":410.23,"y":-1.14,"skX":87.83,"skY":87.83}},{"inheritRotation":false,"length":108,"name":"foot_l","parent":"calf_l","transform":{"x":411.64,"y":0.23,"skX":103.24,"skY":103.24}},{"length":171,"name":"dress0103","parent":"dress0102","transform":{"x":176.75,"y":-0.35,"skX":-0.9,"skY":-0.9}},{"length":71,"name":"hand_r","parent":"spine2","transform":{"x":-153.8253,"y":279.9232,"skX":121.868,"skY":121.868}},{"length":71,"name":"neck","parent":"spine2","transform":{"x":172.12,"y":0.19,"skX":-17.89,"skY":-17.89}},{"length":195,"name":"upperarm_l","parent":"spine2","transform":{"x":93.55,"y":-65.17,"skX":-179.09,"skY":-179.09}},{"length":200,"name":"upperarm_r","parent":"spine2","transform":{"x":139.2,"y":93.66,"skX":150.94,"skY":150.94}},{"name":"xiong_l","parent":"spine2","transform":{"x":11.36,"y":-82.7}},{"name":"xiong_r","parent":"spine2","transform":{"x":35.43,"y":29.27}},{"length":200,"name":"dress0204","parent":"dress0203","transform":{"x":183.88,"y":1.16,"skX":2.25,"skY":2.25}},{"length":193,"name":"dress0104","parent":"dress0103","transform":{"x":171.1,"y":-0.63}},{"length":54,"name":"hand_l","parent":"spine2","transform":{"x":-263.6517,"y":-107.4376,"skX":-161.27,"skY":-161.27}},{"length":192,"name":"dress0304","parent":"dress0303","transform":{"x":181.23,"y":-0.11}},{"name":"bone_ikTarget1","parent":"hand_r","transform":{"x":-0.7403,"y":0.6485,"skX":-66.4,"skY":-66.4}},{"length":166,"name":"forearm_l","parent":"upperarm_l","transform":{"x":194.88,"y":0.53,"skX":12.43,"skY":12.43}},{"length":178,"name":"dress0105","parent":"dress0104","transform":{"x":193.05,"y":-1.28,"skX":0.9,"skY":0.9}},{"length":157,"name":"dress0205","parent":"dress0204","transform":{"x":200.46,"y":0.5}},{"length":88,"name":"head","parent":"neck","transform":{"x":71.14,"y":-0.04,"skX":-13.29,"skY":-13.29}},{"length":90,"name":"finger_l","parent":"hand_l","transform":{"x":80.65,"y":-18.79,"skX":-37.65,"skY":-37.65}},{"name":"bone_ikTarget","parent":"hand_l","transform":{"x":-0.8992,"y":-0.0558,"skX":-126.65,"skY":-126.65}},{"length":150,"name":"forearm_r","parent":"upperarm_r","transform":{"x":200.51,"y":0.29,"skX":-11.56,"skY":-11.56}},{"length":147,"name":"dress0305","parent":"dress0304","transform":{"x":192.32,"y":-0.67,"skX":0.45,"skY":0.45}},{"length":74,"name":"figner_r","parent":"hand_r","transform":{"x":74.81,"y":33.28,"skX":24.91,"skY":24.91}},{"name":"face","parent":"head","transform":{"x":28.99,"y":-29.94,"skX":-2.1,"skY":-2.1}},{"name":"hair","parent":"head","transform":{"x":187.01,"y":-14.39}},{"length":60,"name":"hair0201","parent":"hair","transform":{"x":-18.14,"y":-16.81,"skX":-156.55,"skY":-156.55}},{"length":60,"name":"hair0301","parent":"hair","transform":{"x":-22.37,"y":20.04,"skX":170.91,"skY":170.91}},{"length":100,"name":"hair0501","parent":"hair","transform":{"x":-113.42,"y":-63.08,"skX":-162.11,"skY":-162.11}},{"length":80,"name":"hair0101","parent":"hair","transform":{"x":-41.95,"y":-73.17,"skX":-167.14,"skY":-167.14}},{"length":80,"name":"hair0401","parent":"hair","transform":{"x":-58.34,"y":59.16,"skX":-179.5,"skY":-179.5}},{"length":100,"name":"hair0601","parent":"hair","transform":{"x":-131.71,"y":66.14,"skX":-172.88,"skY":-172.88}},{"length":100,"name":"hair0402","parent":"hair0401","transform":{"x":81.06,"y":0.4,"skX":7.99,"skY":7.99}},{"length":100,"name":"hair0102","parent":"hair0101","transform":{"x":83.27,"y":-0.72,"skX":-5.51,"skY":-5.51}},{"length":70,"name":"hair0302","parent":"hair0301","transform":{"x":63.79,"y":-0.2,"skX":0.51,"skY":0.51}},{"length":70,"name":"hair0202","parent":"hair0201","transform":{"x":62.78,"y":-0.2,"skX":-13.15,"skY":-13.15}},{"length":120,"name":"hair0502","parent":"hair0501","transform":{"x":104.79,"y":-0.11,"skX":0.45,"skY":0.45}},{"length":120,"name":"hair0602","parent":"hair0601","transform":{"x":100.91,"y":0.05,"skX":2.44,"skY":2.44}},{"length":100,"name":"hair0403","parent":"hair0402","transform":{"x":99.23,"y":0.19,"skX":3.86,"skY":3.86}},{"length":140,"name":"hair0503","parent":"hair0502","transform":{"x":119.54,"y":-0.01,"skX":0.45,"skY":0.45}},{"inheritScale":false,"length":140,"name":"hair0603","parent":"hair0602","transform":{"x":119.43,"y":-0.01,"skX":0.83,"skY":0.83}},{"length":100,"name":"hair0103","parent":"hair0102","transform":{"x":99.3,"y":-0.01,"skX":-2.23,"skY":-2.23}},{"length":146,"name":"hair0504","parent":"hair0503","transform":{"x":144.09,"y":0.47,"skX":4.95,"skY":4.95}},{"length":136,"name":"hair0604","parent":"hair0603","transform":{"x":142.27,"y":-0.51,"skX":-3.46,"skY":-3.46}},{"length":159,"name":"hair0605","parent":"hair0604","transform":{"x":136.59,"y":-0.47,"skX":-2.7,"skY":-2.7}},{"length":148,"name":"hair0505","parent":"hair0504","transform":{"x":146.28,"y":1.15,"skX":0.9,"skY":0.9}}],"slot":[{"name":"blank","parent":"nv"},{"name":"1061","parent":"nv"},{"name":"1059","parent":"nv"},{"name":"1060","parent":"nv"},{"name":"1088","parent":"nv"},{"name":"1087","parent":"nv"},{"name":"1084","parent":"nv"},{"name":"1073","parent":"nv"},{"name":"1058","parent":"nv"},{"name":"1057","parent":"nv"},{"name":"1065","parent":"nv"},{"name":"1074","parent":"nv"},{"name":"1055","parent":"nv"},{"name":"1056","parent":"nv"},{"name":"1066","parent":"nv"},{"name":"1064","parent":"nv"},{"name":"1079","parent":"nv"},{"name":"1039","parent":"nv"},{"name":"a_arm_L","parent":"nv"},{"name":"1054","parent":"nv"},{"name":"1070","parent":"nv"},{"name":"1040","parent":"nv"},{"name":"1042","parent":"nv"},{"name":"1041","parent":"nv"},{"name":"1038","parent":"nv"},{"name":"1072","parent":"nv"},{"name":"1082","parent":"nv"},{"name":"a_leg_L","parent":"nv"},{"name":"1023","parent":"nv"},{"name":"1053","parent":"nv"},{"name":"1078","parent":"nv"},{"name":"1037","parent":"nv"},{"name":"1035","parent":"nv"},{"name":"1033","parent":"nv"},{"name":"a_body","parent":"nv"},{"name":"1052","parent":"nv"},{"name":"1048","parent":"nv"},{"name":"1077","parent":"nv"},{"name":"1031","parent":"nv"},{"name":"a_leg_R","parent":"nv"},{"name":"1022","parent":"nv"},{"name":"1051","parent":"nv"},{"name":"1076","parent":"nv"},{"name":"1036","parent":"nv"},{"name":"1034","parent":"nv"},{"name":"1032","parent":"nv"},{"name":"1044","parent":"nv"},{"name":"1043","parent":"nv"},{"name":"1083","parent":"nv"},{"name":"1029","parent":"nv"},{"name":"1030","parent":"nv"},{"name":"1026","parent":"nv"},{"name":"1025","parent":"nv"},{"name":"1024","parent":"nv"},{"name":"1028","parent":"nv"},{"name":"1027","parent":"nv"},{"name":"1021","parent":"nv"},{"name":"1017","parent":"nv"},{"name":"1016","parent":"nv"},{"name":"1015","parent":"nv"},{"name":"1013","parent":"nv"},{"name":"1012","parent":"nv"},{"name":"1009","parent":"nv"},{"name":"1086","parent":"nv"},{"name":"a_arm_R","parent":"nv"},{"name":"1050","parent":"nv"},{"name":"1075","parent":"nv"},{"name":"1018","parent":"nv"},{"name":"1020","parent":"nv"},{"name":"1019","parent":"nv"},{"name":"1080","parent":"nv"},{"name":"1071","parent":"nv"},{"name":"1081","parent":"nv"},{"name":"1014","parent":"nv"},{"name":"1010","parent":"nv"},{"name":"1067","parent":"nv"},{"name":"1085","parent":"nv"},{"name":"1069","parent":"nv"},{"name":"a_head","parent":"nv"},{"name":"1049","parent":"nv"},{"name":"1047","parent":"nv"},{"name":"1068","parent":"nv"},{"name":"1045","parent":"nv"},{"name":"1011","parent":"nv"},{"name":"1008","parent":"nv"},{"name":"1007","parent":"nv"},{"name":"1006","parent":"nv"},{"name":"1005","parent":"nv"},{"name":"1004","parent":"nv"},{"name":"1003","parent":"nv"},{"name":"1063","parent":"nv"},{"name":"1062","parent":"nv"},{"name":"1002","parent":"nv"},{"name":"1001","parent":"nv"},{"displayIndex":-1,"name":"20","parent":"face"},{"name":"1046","parent":"face"}],"ik":[{"bendPositive":false,"chain":1,"name":"ik_foot_l","bone":"calf_l","target":"ik_foot_l"},{"bendPositive":false,"chain":1,"name":"ik_foot_r","bone":"calf_r","target":"ik_foot_r"},{"chain":1,"name":"bone_ik","bone":"forearm_l","target":"bone_ikTarget"},{"bendPositive":false,"chain":1,"name":"bone_ik1","bone":"forearm_r","target":"bone_ikTarget1"}],"skin":[{"slot":[{"name":"1023","display":[{"name":"blank"}]},{"name":"1007","display":[{"name":"blank"}]},{"name":"1040","display":[{"name":"blank"}]},{"name":"1042","display":[{"name":"blank"}]},{"name":"1080","display":[{"name":"blank"}]},{"name":"1064","display":[{"name":"blank"}]},{"name":"1002","display":[{"name":"blank"}]},{"name":"1059","display":[{"name":"blank"}]},{"name":"1053","display":[{"name":"blank"}]},{"name":"a_head","display":[{"type":"mesh","name":"body/a_head","width":202,"height":238,"vertices":[16.33,-1504.74,21.98,-1463.91,35.04,-1439.42,31.89,-1407.38,16.33,-1381.63,4.4,-1379.75,-15.71,-1346.47,-47.11,-1321.84,-66.57,-1321.83,-93.58,-1330.14,-121.21,-1343.95,-131.26,-1369.08,-150.74,-1397.97,-166.33,-1434.39,-166.33,-1484.02,-149.48,-1531.75,-99.23,-1559.83,-18.21,-1559.82,8.16,-1417.43],"uvs":[0.90429,0.23145,0.93227,0.40299,0.99689,0.50591,0.98134,0.6405,0.90429,0.74871,0.84521,0.75662,0.74571,0.89649,0.59024,0.99998,0.49384,1,0.36014,0.96511,0.22333,0.90705,0.17358,0.80149,0.07718,0.68009,0,0.52702,0,0.31854,0.0834,0.11797,0.33216,0.00001,0.73327,0,0.86386,0.59828],"triangles":[18,3,2,1,18,2,18,4,3,18,5,4,14,18,1,16,14,1,0,16,1,14,13,18,17,16,0,13,12,18,11,5,18,12,11,18,11,6,5,15,14,16,8,7,6,9,8,6,11,9,6,11,10,9],"weights":[1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1],"slotPose":[1,0,0,1,0,0],"bonePose":[40,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473],"edges":[13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,17,17,16,16,15,15,14,14,13],"userEdges":[5,18,18,1]}]},{"name":"1036","display":[{"name":"blank"}]},{"name":"1058","display":[{"name":"blank"}]},{"name":"1017","display":[{"name":"blank"}]},{"name":"1073","display":[{"name":"blank"}]},{"name":"1030","display":[{"name":"blank"}]},{"name":"1049","display":[{"name":"blank"}]},{"name":"1071","display":[{"name":"blank"}]},{"name":"1081","display":[{"name":"blank"}]},{"name":"1048","display":[{"name":"blank"}]},{"name":"1001","display":[{"name":"blank"}]},{"name":"1006","display":[{"name":"blank"}]},{"name":"1026","display":[{"name":"blank"}]},{"name":"1079","display":[{"name":"blank"}]},{"name":"1050","display":[{"name":"blank"}]},{"name":"a_arm_R","display":[{"type":"mesh","name":"body/a_arm_R","width":215,"height":517,"vertices":[81.72,-1255.65,87.23,-1225.62,88.19,-1196.91,89.05,-1176.54,98.96,-1082.13,102.77,-1064.36,108.6,-1048.8,118.88,-1032.21,125.62,-1016.31,156.08,-924.91,160.78,-906.8,166.2,-892.24,194.08,-842.75,193.73,-806.16,173.98,-793.48,141.38,-788.53,126.55,-794.62,112.34,-795.36,113.95,-843.1,115.45,-877,118.69,-891.06,110.15,-906.11,61.38,-987.76,54.84,-1003.94,51.56,-1022.51,47.48,-1043.4,43.92,-1062.12,27.02,-1154.25,23.26,-1172.68,12.23,-1188.43,11.67,-1216.34,12.78,-1251.36,33.69,-1284.82,63.43,-1282.58,46.9,-1237.18],"uvs":[0.32581,0.05643,0.35147,0.11454,0.3559,0.17007,0.35986,0.20948,0.40587,0.39208,0.42359,0.42642,0.45069,0.45649,0.49852,0.4886,0.52983,0.51933,0.6716,0.69609,0.69347,0.7311,0.71873,0.75926,0.8484,0.85497,0.84682,0.92574,0.75493,0.95028,0.60335,0.95987,0.5344,0.94809,0.46827,0.94666,0.47573,0.85433,0.4827,0.78877,0.4977,0.76157,0.45795,0.73247,0.2311,0.57457,0.20065,0.54331,0.18539,0.50737,0.16637,0.46696,0.14986,0.43073,0.07133,0.25255,0.05388,0.21689,0.0026,0.18644,0,0.13246,0.0052,0.0647,0.10243,0,0.24075,0.00432,0.16387,0.09214],"triangles":[18,14,12,11,18,12,12,14,13,18,16,15,19,18,11,18,15,14,22,21,8,8,21,9,10,20,11,20,19,11,9,20,10,21,20,9,18,17,16,7,23,8,23,22,8,3,27,4,6,24,7,24,23,7,25,24,6,5,25,6,27,26,4,4,26,5,26,25,5,0,34,1,2,28,3,28,27,3,33,34,0,30,29,34,32,34,33,32,31,34,31,30,34,29,28,2,29,2,1,34,29,1],"weights":[2,29,0.57599,20,0.424,1,29,1,1,29,1,1,29,1,1,29,1,2,43,0.0888,29,0.91119,2,43,0.44505,29,0.55494,2,43,0.84135,29,0.15864,2,43,0.97337,29,0.02662,2,43,0.93063,26,0.06936,2,43,0.54329,26,0.4567,2,43,0.15151,26,0.84848,1,26,1,1,26,1,1,26,1,1,26,1,1,26,1,1,26,1,2,43,0.00405,26,0.99594,2,43,0.1612,26,0.83879,2,43,0.50837,26,0.49162,2,43,0.9084,26,0.09159,2,43,0.98867,29,0.01132,2,43,0.88838,29,0.11161,2,43,0.61378,29,0.38621,2,43,0.19782,29,0.80217,2,43,0.02531,29,0.97468,1,29,1,2,29,0.91199,20,0.088,2,29,0.472,20,0.52799,2,29,0.264,20,0.73599,2,29,0.06398,20,0.936,2,29,0.096,20,0.90399,2,29,0.168,20,0.83199,2,29,0.488,20,0.51199],"slotPose":[1,0,0,1,0,0],"bonePose":[29,0.193207,0.981158,-0.981158,0.193207,42.671847,-1232.663838,20,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,43,0.385906,0.922538,-0.922538,0.385906,81.127245,-1035.875814,26,0.400349,0.916363,-0.916363,0.400349,139.903737,-897.076346],"edges":[30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,33,33,32,32,31,31,30],"userEdges":[24,6,23,7,25,5,26,4,22,8,20,10,19,11,21,9,28,2,29,1,0,34,34,30,34,31,32,34,34,33,27,3]}]},{"name":"1016","display":[{"name":"blank"}]},{"name":"1084","display":[{"name":"blank"}]},{"name":"1041","display":[{"name":"blank"}]},{"name":"1047","display":[{"name":"blank"}]},{"name":"1034","display":[{"name":"blank"}]},{"name":"1014","display":[{"name":"blank"}]},{"name":"1057","display":[{"name":"blank"}]},{"name":"1075","display":[{"name":"blank"}]},{"name":"1015","display":[{"name":"blank"}]},{"name":"1078","display":[{"name":"blank"}]},{"name":"1025","display":[{"name":"blank"}]},{"name":"1032","display":[{"name":"blank"}]},{"name":"1031","display":[{"name":"blank"}]},{"name":"1077","display":[{"name":"blank"}]},{"name":"1037","display":[{"name":"blank"}]},{"name":"1087","display":[{"name":"blank"}]},{"name":"1038","display":[{"name":"blank"}]},{"name":"1072","display":[{"name":"blank"}]},{"name":"1039","display":[{"name":"blank"}]},{"name":"1010","display":[{"name":"blank"}]},{"name":"20","display":[{"name":"20","transform":{"x":1.44,"y":7.23,"skX":89.86,"skY":89.86}}]},{"name":"1018","display":[{"name":"blank"}]},{"name":"1004","display":[{"name":"blank"}]},{"name":"1005","display":[{"name":"blank"}]},{"name":"1024","display":[{"name":"blank"}]},{"name":"a_arm_L","display":[{"type":"mesh","name":"body/a_arm_L","width":295,"height":472,"vertices":[-81.59,-1249.92,-82.13,-1222.8,-90.29,-1199.89,-99.94,-1175.35,-140.6,-1076.14,-149.32,-1058.12,-158.96,-1040.32,-169.17,-1023.17,-180.14,-1005.15,-235.14,-935.12,-247.23,-919.56,-254.46,-903.99,-254.92,-886.98,-255.27,-874.4,-264.31,-849.75,-263.48,-823.45,-273.34,-815.62,-288.83,-832.26,-294.13,-867.14,-300.47,-826.86,-312.19,-817.57,-322.39,-849.32,-322.43,-810.31,-342.25,-809.85,-338.27,-831.67,-359.64,-809.84,-376.32,-809.83,-376.32,-823.42,-339.1,-861.24,-321.48,-894.35,-301.07,-912.31,-291.53,-924.54,-282.7,-939.75,-273.62,-956.8,-233.88,-1036.01,-222.22,-1050.63,-211.95,-1065.18,-205.35,-1080.95,-198.23,-1099.87,-164.13,-1199.93,-158.28,-1224,-152.19,-1247.26,-142.98,-1266.72,-123.15,-1281.81,-86.06,-1281.82,-121.9,-1238.14],"uvs":[0.99908,0.06759,0.99724,0.12503,0.96959,0.17358,0.93691,0.22557,0.79917,0.43578,0.76962,0.47396,0.73694,0.51167,0.70231,0.54802,0.66509,0.58622,0.4787,0.73459,0.43772,0.76756,0.41319,0.80054,0.41158,0.83658,0.4104,0.86323,0.37975,0.91548,0.38254,0.97121,0.3491,0.9878,0.29661,0.95254,0.27866,0.87862,0.25715,0.96396,0.2174,0.98364,0.18283,0.91636,0.18269,0.99902,0.11549,1,0.12898,0.95375,0.05652,1,0,1,0,0.97121,0.12618,0.8911,0.18593,0.82095,0.25514,0.78291,0.28748,0.757,0.31745,0.72477,0.34822,0.68865,0.48292,0.52085,0.52241,0.48985,0.55727,0.45903,0.57963,0.42562,0.60376,0.38554,0.7193,0.17354,0.73909,0.12253,0.75972,0.07326,0.79093,0.03199,0.85816,0,0.98391,0,0.86245,0.09251],"triangles":[45,1,0,45,2,1,38,4,3,39,38,3,39,3,2,43,42,45,42,41,45,41,40,45,38,5,4,38,37,5,37,6,5,37,36,6,36,7,6,36,35,7,35,8,7,35,34,8,34,9,8,33,9,34,33,10,9,31,11,10,32,31,10,33,32,10,18,14,13,18,13,12,30,18,12,30,12,11,31,30,11,17,16,15,17,15,14,18,17,14,30,29,18,29,21,18,28,21,29,21,20,19,24,23,22,28,24,21,27,25,24,27,24,28,27,26,25,24,22,21,21,19,18,43,44,45,44,45,0,39,40,2,45,40,2],"weights":[2,28,0.07199,20,0.928,2,28,0.24799,20,0.752,2,28,0.528,20,0.47199,2,28,0.928,20,0.07199,2,37,0.00601,28,0.99398,2,37,0.10823,28,0.89176,2,37,0.4621,28,0.53789,2,37,0.84526,28,0.15473,2,37,0.99634,28,0.00365,1,37,0.99999,2,37,0.91608,34,0.08391,2,37,0.48414,34,0.51585,2,37,0.11944,34,0.88055,2,37,0.02847,34,0.97152,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,1,34,1,2,37,0.14665,34,0.85334,2,37,0.52201,34,0.47798,2,37,0.89834,34,0.10165,1,37,1,1,37,1,2,37,0.89448,28,0.10551,2,37,0.53387,28,0.46612,2,37,0.14666,28,0.85333,1,28,1,1,28,1,1,28,1,1,28,1,2,28,0.90399,20,0.096,2,28,0.84,20,0.15999,2,28,0.512,20,0.48799,2,28,0.63998,20,0.36],"slotPose":[1,0,0,1,0,0],"bonePose":[34,-0.596925,0.802297,-0.802297,-0.596925,-272.622839,-911.231146,28,-0.322761,0.94648,-0.94648,-0.322761,-122.498835,-1238.098661,20,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,37,-0.518922,0.854821,-0.854821,-0.518922,-185.900195,-1053.819626],"edges":[26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,44,44,43,43,42,42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26],"userEdges":[18,21,24,21,36,6,37,5,35,7,38,4,34,8,45,43,42,45,45,41,45,1,45,0,44,45,40,2,39,3,31,11,32,10,33,9,30,12]}]},{"name":"1046","display":[{"type":"mesh","name":"face/10202001","width":141,"height":117,"vertices":[-5.81,-1431.71,-7.25,-1413.78,-5.82,-1344.1,-49.56,-1344.32,-59.21,-1344.11,-146.81,-1344.1,-146.81,-1418.47,-146.81,-1425.05,-146.81,-1461.1,-49.28,-1460.87,-32.92,-1461.08,-5.82,-1461.09,-66.69,-1421.47,-52.04,-1398.21,-40.94,-1394.39,-28.13,-1395.35,-16.7,-1401.52,-18.08,-1441.03,-44.3,-1442.46,-57.51,-1435.54,-29.33,-1443.01,-63.7,-1412.37,-54.57,-1426.83,-41.38,-1433.91,-25.5,-1433.38,-65.47,-1434.18,-58.62,-1443.76,-45.26,-1447.53,-31.01,-1448.15,-97.42,-1409.22,-89,-1385.39,-95.65,-1376.02,-107.36,-1371.98,-120.02,-1371.41,-141.13,-1385.65,-137,-1404.25,-124.8,-1414.24,-108.71,-1414.58,-131.96,-1379.75,-130.3,-1397.19,-120.96,-1406.53,-105.61,-1406.49,-92.39,-1399.98,-103.66,-1418.13,-113.33,-1420.99,-126,-1417.88,-123.22,-1432.21,-109.34,-1432.39,-107.4,-1423.6,-130.05,-1421.25,-75.59,-1444.91,-64.41,-1455.74,-32.78,-1455.95,-45.85,-1454.16,-59.01,-1446.27,-69.07,-1440.12,-75.8,-1381.9,-82.5,-1375.53,-73.18,-1368.41,-65.65,-1374.98,-71.2,-1355.94,-69.9,-1360.8,-65.57,-1363.89,-59.27,-1363.89,-52.91,-1352.11,-57.85,-1349.72,-62.98,-1348.76,-68.81,-1351.15,-50.58,-1355.95,-53.31,-1361.76,-135.56,-1410.89,-117.9,-1422.01,-135.51,-1428.7],"uvs":[0.99999,0.25096,0.98982,0.40435,1,1,0.68976,0.99824,0.62131,0.99998,0,1,0,0.36417,0,0.30797,0,0,0.69179,0.00175,0.80783,0,1,0,0.56819,0.33841,0.67213,0.53736,0.75089,0.57015,0.84173,0.56191,0.92283,0.50922,0.91303,0.17139,0.72703,0.15914,0.63327,0.2183,0.83323,0.15447,0.58945,0.41631,0.65419,0.29276,0.74773,0.23223,0.86039,0.2367,0.57687,0.22999,0.62547,0.14802,0.72023,0.11581,0.82136,0.11052,0.35025,0.44331,0.40996,0.64693,0.36285,0.72715,0.27981,0.7617,0.18996,0.76642,0.04023,0.64466,0.06953,0.48575,0.15604,0.40043,0.27022,0.3975,0.10527,0.69524,0.11704,0.54617,0.1833,0.46638,0.29219,0.46662,0.3859,0.52224,0.30601,0.36709,0.2374,0.3384,0.14754,0.36794,0.16514,0.24634,0.26569,0.24531,0.27948,0.32022,0.1185,0.33659,0.50514,0.13819,0.58438,0.04566,0.80879,0.04393,0.71603,0.05916,0.62271,0.13519,0.5513,0.17918,0.50366,0.67691,0.4561,0.73135,0.52217,0.79225,0.57563,0.73603,0.53626,0.8988,0.54549,0.85722,0.57613,0.83087,0.62083,0.83085,0.66596,0.93157,0.63098,0.95206,0.59453,0.96026,0.55322,0.93979,0.68251,0.89878,0.6631,0.84903,0.07977,0.42905,0.20675,0.33593,0.07904,0.27109],"triangles":[8,51,9,69,68,15,52,28,17,15,68,2,68,3,2,16,15,2,1,16,2,24,1,0,17,24,0,52,17,11,10,52,11,17,0,11,24,16,1,14,69,15,23,14,15,23,15,24,28,20,17,24,15,16,20,24,17,23,22,14,22,13,14,20,23,24,28,18,20,18,23,20,52,27,28,27,18,28,59,69,14,53,27,52,53,52,10,9,53,10,67,5,4,59,63,69,22,21,13,68,64,3,13,59,14,18,19,23,19,22,23,26,19,18,26,18,27,54,26,27,54,27,53,9,54,53,56,59,13,51,54,9,64,65,3,65,4,3,12,21,22,69,64,68,21,56,13,61,60,67,8,50,51,59,62,63,55,25,26,26,25,19,66,4,65,42,56,21,51,55,54,66,67,4,54,55,26,8,47,50,32,5,67,58,62,59,50,55,51,12,42,21,29,42,12,42,30,56,55,50,12,55,12,25,58,61,62,56,58,59,60,32,67,50,43,12,43,29,12,56,57,58,58,60,61,48,43,50,47,48,50,58,57,60,57,31,60,31,32,60,30,57,56,33,5,32,30,31,57,8,46,47,41,31,42,42,31,30,41,32,31,29,41,42,40,39,32,40,32,41,39,33,32,39,38,33,37,40,41,36,40,37,46,71,47,8,72,46,38,5,33,46,49,71,49,45,71,35,39,40,72,49,46,34,38,39,45,70,36,49,70,45,8,7,72,34,5,38,35,34,39,72,6,49,6,70,49,7,6,72,6,35,70,6,34,35,6,5,34,25,19,12,19,12,22,40,35,36,70,35,36,43,29,37,37,41,29,48,43,44,44,37,43,71,44,45,44,36,37,45,36,44,65,63,64,69,63,64,63,65,62,62,66,65,67,61,66,62,61,66,47,48,71,71,44,48],"weights":[2,40,0.44,46,0.55999,2,40,0.928,46,0.07199,1,40,1,1,40,1,1,40,1,1,40,1,2,40,0.96,46,0.03999,2,40,0.96,46,0.03999,1,40,1,2,40,0.94399,46,0.056,2,40,0.96799,46,0.032,1,40,1,2,40,0.55198,46,0.448,2,40,0.856,46,0.14399,1,40,1,1,40,1,1,40,1,2,40,0.672,46,0.32799,2,40,0.60799,46,0.392,2,40,0.592,46,0.40799,2,40,0.66399,46,0.336,2,40,0.488,46,0.51199,2,40,0.456,46,0.54399,2,40,0.47999,46,0.52,2,40,0.488,46,0.51199,2,40,0.728,46,0.27199,2,40,0.78399,46,0.216,2,40,0.79199,46,0.208,2,40,0.75199,46,0.248,2,40,0.68799,46,0.312,2,40,0.91999,46,0.08,1,40,1,1,40,1,2,40,0.944,46,0.05599,2,40,0.58398,46,0.416,2,40,0.616,46,0.38399,2,40,0.6,46,0.39999,2,40,0.688,46,0.31199,2,40,0.50399,46,0.496,2,40,0.496,46,0.50399,2,40,0.43199,46,0.568,2,40,0.456,46,0.54399,2,40,0.504,46,0.49599,2,40,0.79999,46,0.2,2,40,0.8,46,0.19999,2,40,0.77599,46,0.224,2,40,0.94399,46,0.056,2,40,0.94399,46,0.056,2,40,0.936,46,0.06398,2,40,0.96,46,0.03999,2,40,0.91999,46,0.08,2,40,0.90399,46,0.096,2,40,0.95199,46,0.048,2,40,0.928,46,0.07199,2,40,0.912,46,0.08799,2,40,0.91999,46,0.08,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,1,40,1,2,40,0.736,46,0.26399,2,40,0.77599,46,0.224,2,40,0.95,46,0.05],"slotPose":[1,0,0,1,0,0],"bonePose":[40,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473,46,-0.264883,-0.964281,0.964281,-0.264883,-71.928507,-1385.236231],"edges":[5,4,4,3,3,2,2,1,1,0,0,11,11,10,10,9,9,8,8,7,7,6,6,5],"userEdges":[13,14,14,15,15,16,16,1,0,17,18,19,19,12,17,20,20,18,12,21,21,13,14,22,22,19,21,22,15,23,23,18,22,23,16,24,24,20,23,24,24,1,12,25,25,26,26,27,27,28,28,17,30,31,31,32,32,33,35,36,29,37,37,36,33,38,38,34,33,39,39,35,38,39,32,40,40,36,39,40,31,41,41,37,40,41,29,42,42,30,41,42,29,43,43,44,44,45,46,47,47,48,49,6,50,51,51,9,10,52,52,53,53,54,54,55,55,50,56,57,57,58,58,59,59,56,60,61,61,62,62,63,63,64,64,65,65,62,61,66,66,65,60,67,67,66,64,68,68,69,69,63,66,4,64,3,35,34,35,70,70,45,48,71,71,49,7,72,72,46]}]},{"name":"1065","display":[{"name":"blank"}]},{"name":"1013","display":[{"name":"blank"}]},{"name":"1012","display":[{"name":"blank"}]},{"name":"1068","display":[{"name":"blank"}]},{"name":"1045","display":[{"name":"blank"}]},{"name":"1044","display":[{"name":"blank"}]},{"name":"1054","display":[{"name":"blank"}]},{"name":"1074","display":[{"name":"blank"}]},{"name":"1022","display":[{"name":"blank"}]},{"name":"1088","display":[{"name":"blank"}]},{"name":"1035","display":[{"name":"blank"}]},{"name":"1082","display":[{"name":"blank"}]},{"name":"1043","display":[{"name":"blank"}]},{"name":"1055","display":[{"name":"blank"}]},{"name":"a_leg_R","display":[{"type":"mesh","name":"body/a_leg_R","width":260,"height":930,"vertices":[33.51,-905.49,35.31,-873.55,34.72,-839.5,27.52,-805.57,8.86,-681.07,-10.39,-545.17,-12.95,-522.73,-12.5,-503.27,-1.97,-486.23,11.59,-472.37,63.14,-406.33,105.47,-248.25,129.14,-168.36,140.27,-150.1,149.41,-129.59,152.14,-111.75,156.14,-70.64,155.98,-10.2,112.99,-10.32,89.3,-10.38,96.89,-96.71,96.48,-113.63,90.55,-132.93,82.9,-154.16,51.97,-228.51,-22.56,-367.87,-65.96,-434.45,-82.67,-456.6,-98.05,-481.69,-101.09,-511.7,-102.55,-540.17,-102.47,-679.22,-97.94,-803.63,-94.45,-828.9,-91.92,-852.09,-77.52,-879.17,-55.37,-916.16,-19.98,-940.82,22,-940.82,-26.32,-886.55],"uvs":[0.5225,0.03801,0.52947,0.07233,0.52727,0.10896,0.49966,0.14544,0.4282,0.27933,0.35449,0.42545,0.34469,0.44957,0.34644,0.47046,0.38707,0.48872,0.43938,0.50356,0.63841,0.57439,0.80303,0.7442,0.89499,0.83002,0.93806,0.84961,0.97346,0.87163,0.98417,0.89081,0.99999,0.935,1,1,0.83459,1,0.74351,1,0.77177,0.90716,0.77003,0.88897,0.747,0.86823,0.71733,0.84544,0.59753,0.76561,0.30928,0.61603,0.1416,0.54458,0.07702,0.52081,0.01753,0.49384,0.00569,0.46154,0,0.4309,0,0.28138,0.01711,0.1476,0.03045,0.12042,0.04011,0.09545,0.09547,0.06634,0.18062,0.02652,0.31674,0,0.47818,0,0.29239,0.05838],"triangles":[15,20,16,20,18,16,16,18,17,14,21,15,21,20,15,13,21,14,24,23,11,20,19,18,11,23,12,12,22,13,22,21,13,10,25,11,25,24,11,23,22,12,9,25,10,31,5,4,26,25,9,32,4,3,0,39,1,32,31,4,33,32,3,31,30,5,8,26,9,35,34,39,36,39,37,7,27,8,27,26,8,30,6,5,28,27,7,6,29,7,29,28,7,30,29,6,36,35,39,1,34,2,39,34,1,3,33,2,34,33,2,0,39,38,37,39,38],"weights":[2,10,0.568,5,0.432,2,10,0.928,5,0.07199,1,10,1,1,10,1,1,10,1,2,10,0.97544,18,0.02455,2,10,0.82846,18,0.17153,2,10,0.48724,18,0.51275,2,10,0.15204,18,0.84795,2,10,0.03176,18,0.96823,1,18,1,1,18,1,1,18,1,2,18,0.82076,23,0.17923,2,18,0.51153,23,0.48846,2,18,0.24923,23,0.75076,1,23,1,1,23,1,1,23,1,1,23,1,2,18,0.15793,23,0.84206,2,18,0.44792,23,0.55207,2,18,0.81762,23,0.18237,1,18,1,1,18,1,1,18,1,2,10,0.00055,18,0.99944,2,10,0.18658,18,0.81341,2,10,0.50372,18,0.49627,2,10,0.80275,18,0.19724,2,10,0.97444,18,0.02555,1,10,0.99999,1,10,1,2,10,0.904,5,0.09599,2,10,0.57599,5,0.42399,2,10,0.344,5,0.65599,3,10,0.1966,5,0.57138,12,0.23199,3,10,0.05222,5,0.35577,12,0.592,3,10,0.04409,5,0.3799,12,0.57599,2,10,0.512,5,0.48799],"slotPose":[1,0,0,1,0,0],"bonePose":[10,-0.063313,0.997994,-0.997994,-0.063313,-29.39,-886.57,5,1,0,0,1,-107.18,-913,18,0.431613,0.902059,-0.902059,0.431613,-53.252689,-491.788776,23,0.03769,0.999289,-0.999289,0.03769,124.83646,-122.229299,12,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04],"edges":[30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30],"userEdges":[28,7,29,6,30,5,31,4,27,8,26,9,25,10,24,11,21,14,22,13,23,12,20,15,32,3,34,1,33,2,0,39,39,35,36,39,39,37,39,38]}]},{"name":"1033","display":[{"name":"blank"}]},{"name":"1063","display":[{"name":"blank"}]},{"name":"1028","display":[{"name":"blank"}]},{"name":"a_leg_L","display":[{"type":"mesh","name":"body/a_leg_L","width":179,"height":1013,"vertices":[-86.18,-882.01,-81.91,-848.44,-92.02,-825.24,-87.85,-797.79,-70.85,-667.06,-66.92,-572.62,-62.78,-526.33,-60.54,-500.62,-57.76,-475.46,-58.7,-450.67,-59.75,-425.89,-52.79,-354.49,-41.86,-212.94,-34.51,-113.84,-31.28,-91.12,-29.71,-70.7,-29.64,-49.28,-29.37,36.9,-44.33,57.74,-102.88,57.91,-107.02,38.81,-87.22,-48.71,-84.71,-67.63,-85.25,-89.42,-87.56,-111.25,-110.32,-207.85,-139.82,-349.75,-137.48,-423.49,-135.58,-448.23,-137.5,-471.8,-144.11,-497.41,-152.24,-521.77,-164.16,-567.25,-187.65,-662.28,-209.67,-797.4,-212.04,-828.9,-212.21,-859.9,-212.36,-890,-208.28,-924.69,-196.4,-954.81,-152.96,-954.83,-109.63,-921.47,-147.97,-881.49],"uvs":[0.70479,0.072,0.72801,0.10527,0.67066,0.1282,0.69292,0.15537,0.78389,0.28452,0.80294,0.37775,0.82467,0.42345,0.83633,0.44883,0.85118,0.47366,0.84541,0.49809,0.83911,0.52254,0.87661,0.59304,0.93491,0.7328,0.97402,0.83065,0.99162,0.85309,1,0.87325,0.99998,0.8944,1,0.97947,0.91607,1,0.58892,0.99998,0.56612,0.98112,0.67824,0.89478,0.69264,0.87611,0.69,0.85458,0.67757,0.83302,0.5523,0.73759,0.39029,0.59742,0.4048,0.52464,0.4158,0.5002,0.4056,0.47691,0.3694,0.45158,0.32474,0.42748,0.25953,0.38254,0.13125,0.28863,0.0123,0.1551,0,0.12399,0,0.09339,0.00004,0.06371,0.02297,0.02968,0.08904,0,0.33172,0,0.57372,0.03294,0.35956,0.07241],"triangles":[26,25,11,11,25,12,25,24,12,12,24,13,23,22,14,20,18,17,21,20,17,14,22,15,15,22,16,22,21,16,21,17,16,13,23,14,24,23,13,20,19,18,3,33,4,10,27,11,27,26,11,4,32,5,33,32,4,28,10,9,29,28,9,29,9,8,7,29,8,5,31,6,28,27,10,6,30,7,30,29,7,34,33,3,31,30,6,32,31,5,0,42,1,41,42,0,2,34,3,35,34,2,40,42,41,38,37,42,37,36,42,42,1,36,36,2,1,36,35,2,38,39,42,40,39,42],"weights":[2,9,0.28537,5,0.71462,2,9,0.65566,5,0.34433,2,9,0.86895,5,0.13104,1,9,1,1,9,1,1,9,1,2,9,0.93466,15,0.06533,2,9,0.7492,15,0.25079,2,9,0.46584,15,0.53415,2,9,0.18125,15,0.81874,2,9,0.01669,15,0.9833,1,15,1,1,15,1,1,15,1,2,15,0.80851,24,0.19148,2,15,0.51678,24,0.4832,2,15,0.18077,24,0.81922,1,24,1,1,24,1,1,24,1,1,24,1,2,15,0.12108,24,0.87891,2,15,0.41515,24,0.58484,2,15,0.79057,24,0.20942,2,15,0.98672,24,0.01327,1,15,1,1,15,1,1,15,1,2,9,0.14873,15,0.85125,2,9,0.52426,15,0.47573,2,9,0.88471,15,0.11528,2,9,0.98959,15,0.0104,1,9,1,1,9,1,1,9,1,1,9,1,2,9,0.99624,5,0.00375,2,9,0.83943,5,0.16056,3,9,0.24652,5,0.61074,12,0.14273,3,9,0.04186,5,0.40613,12,0.55198,3,9,0.03736,5,0.34663,12,0.61599,2,5,0.60799,12,0.392,2,9,0.49599,5,0.504],"slotPose":[1,0,0,1,0,0],"bonePose":[9,0.08646,0.996255,-0.996255,0.08646,-146.29,-879.71,5,1,0,0,1,-107.18,-913,15,0.133294,0.991076,-0.991076,0.133294,-109.592168,-473.391363,24,-0.202787,0.979223,-0.979223,-0.202787,-54.950844,-65.393975,12,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04],"edges":[35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,41,41,40,40,39,39,38,38,37,37,36,36,35],"userEdges":[29,8,30,7,31,6,32,5,28,9,27,10,26,11,25,12,22,15,23,14,24,13,21,16,33,4,34,3,35,2,1,36,37,42,41,42,42,40,39,42,42,0,42,38,42,1]}]},{"name":"1067","display":[{"name":"blank"}]},{"name":"1070","display":[{"name":"blank"}]},{"name":"1020","display":[{"name":"blank"}]},{"name":"1051","display":[{"name":"blank"}]},{"name":"a_body","display":[{"type":"mesh","name":"body/a_body","width":274,"height":555,"vertices":[3.85,-1359.46,4.35,-1323.79,4.58,-1307.26,26.65,-1293.37,56.25,-1285.3,74.66,-1271.04,74.67,-1232.65,55.69,-1196.98,37.02,-1162.12,14.62,-1122.77,-4.3,-1086.77,-13.31,-1048.89,-5.56,-1005.33,12.17,-967.78,25.17,-935.12,1.17,-890.77,-67.7,-848.67,-104.99,-839.87,-133.68,-845.76,-174.14,-896.36,-199.36,-942.97,-191.82,-980.99,-174.75,-1018.1,-166.88,-1062.7,-172.42,-1105.69,-173.89,-1141.93,-183.38,-1172.15,-182.19,-1198.85,-151.95,-1221.98,-134.76,-1251.64,-119.87,-1280.7,-88.68,-1289.24,-65.67,-1300.67,-64.3,-1312.71,-63.43,-1326.83,-61.82,-1373.68,-36.93,-1394.83,6.36,-1394.82,-136.53,-1140.84,-103.21,-1157.15,-68.29,-1129.39,-23.28,-1127.2,5.18,-1165.13,-5.44,-1212.94,-39.22,-1285.76,-101.78,-1184.64,-89.06,-1216.72,-36.07,-1228.28,-116.96,-1227.04,-50.5,-1164.02,-157.23,-1176.53,-98.12,-1104.39,-97.42,-1057.84,-97.87,-1008.49,-100.05,-964.28,-101.59,-919.15,-104.98,-875.45,-54.82,-1097.52,-54.63,-1054.45,-54.29,-1007.2,-48.8,-964.31,-41.19,-920.95,-65.81,-880.55,-135.38,-1103.51,-133.8,-1060.29,-139.59,-1011.22,-147.76,-970,-149.84,-925.12,-148.19,-887.34,26.39,-1207.83,-98.82,-1256.44,-55.68,-1256.45,38.68,-1244.3,-2.4,-1250.59],"uvs":[0.74158,0.06374,0.74339,0.12797,0.74423,0.15773,0.82473,0.18283,0.93275,0.19735,0.99999,0.22304,0.99999,0.29223,0.93075,0.3565,0.86258,0.41927,0.78081,0.49018,0.71177,0.55505,0.67888,0.62329,0.70717,0.70179,0.77189,0.76941,0.81935,0.82831,0.73178,0.90824,0.48045,0.98413,0.34427,0.99999,0.23933,0.98941,0.09205,0.89807,0,0.81411,0.02734,0.74567,0.08964,0.6788,0.11835,0.59843,0.09818,0.52096,0.0928,0.45568,0.05817,0.40118,0.0625,0.3531,0.17288,0.31143,0.23564,0.25801,0.28995,0.20566,0.40377,0.19027,0.4878,0.16964,0.49277,0.14794,0.49598,0.12251,0.50184,0.03806,0.59274,0,0.75073,0,0.22915,0.45764,0.35079,0.42824,0.47824,0.47825,0.64251,0.48221,0.7464,0.41383,0.70765,0.32773,0.58431,0.19652,0.356,0.37866,0.40239,0.32086,0.59582,0.30009,0.30057,0.30232,0.54319,0.41587,0.15362,0.39333,0.36933,0.52332,0.37192,0.6072,0.37026,0.69612,0.36232,0.77579,0.35677,0.85712,0.34438,0.93588,0.52739,0.53568,0.52808,0.61328,0.52931,0.69842,0.54939,0.7757,0.57714,0.85383,0.48734,0.92668,0.23336,0.52489,0.23908,0.60278,0.21797,0.6912,0.18817,0.76549,0.18061,0.84636,0.1867,0.91442,0.82379,0.33694,0.36681,0.24935,0.52423,0.24933,0.86865,0.27125,0.71872,0.2599],"triangles":[72,7,6,72,6,5,4,72,5,72,69,7,69,8,7,3,72,4,73,43,69,69,42,8,42,9,8,73,69,72,3,73,72,61,15,14,2,73,3,43,42,69,13,61,14,44,73,2,60,61,13,42,41,9,41,10,9,62,16,15,12,60,13,47,43,73,0,34,1,43,49,42,49,41,42,36,0,37,35,34,0,1,44,2,36,35,0,61,62,15,11,59,12,59,60,12,47,49,43,41,57,10,58,11,10,57,58,10,71,47,73,44,71,73,58,59,11,46,49,47,49,40,41,40,57,41,33,32,44,71,46,47,60,55,61,46,45,49,32,71,44,54,55,60,55,62,61,32,31,71,53,54,59,53,59,58,52,53,58,57,52,58,59,54,60,51,52,57,39,40,49,45,39,49,31,70,71,70,46,71,40,51,57,56,16,62,55,56,62,56,17,16,39,51,40,64,65,52,52,65,53,39,38,51,64,52,51,63,64,51,70,48,46,30,70,31,18,17,56,68,56,55,65,66,54,67,55,54,66,67,54,29,48,70,65,54,53,38,63,51,30,29,70,67,68,55,50,39,45,50,38,39,68,18,56,29,28,48,22,66,65,23,22,65,50,25,38,25,24,38,38,24,63,24,23,63,63,23,64,23,65,64,68,19,18,27,50,28,67,19,68,20,67,66,22,21,66,21,20,66,26,25,50,20,19,67,27,26,50,28,50,48,44,33,1,34,33,1,45,50,46,48,50,46],"weights":[1,27,1,2,20,0.04933,27,0.95066,2,20,0.37053,27,0.62945,1,20,1,1,20,1,1,20,1,1,20,1,1,20,1,3,13,0.07991,20,0.91513,27,0.00495,2,13,0.4598,20,0.54019,2,13,0.89215,20,0.10784,2,12,0.19819,13,0.8018,2,12,0.70197,13,0.29802,3,12,0.76582,13,0.09095,5,0.1432,3,12,0.43807,5,0.44192,10,0.12,2,5,0.496,10,0.50399,2,5,0.632,10,0.36799,3,5,0.83174,10,0.08025,9,0.08799,2,5,0.592,9,0.40799,2,5,0.56,9,0.43999,3,12,0.4652,5,0.40679,9,0.12799,3,12,0.8085,13,0.04201,5,0.14947,2,12,0.72622,13,0.27377,2,12,0.23723,13,0.76276,2,13,0.88129,20,0.1187,3,13,0.44155,20,0.48645,30,0.07199,3,13,0.08109,20,0.8389,30,0.07999,2,20,0.91199,30,0.088,2,20,0.92,30,0.07999,1,20,1,1,20,1,1,20,1,2,20,0.55347,27,0.44652,2,20,0.07085,27,0.92914,1,27,1,2,27,0.46399,40,0.536,1,40,1,2,27,0.49599,40,0.504,3,13,0.45138,20,0.46861,30,0.08,4,13,0.1292,20,0.70983,31,0.08096,30,0.08,4,12,0.00083,13,0.45308,20,0.46607,31,0.08,3,13,0.47376,20,0.43823,31,0.088,4,13,0.08883,20,0.82926,27,0.0019,31,0.07999,2,20,0.91199,31,0.088,2,20,0.53199,27,0.468,3,20,0.85363,31,0.08236,30,0.06398,3,20,0.8686,31,0.06739,30,0.06398,2,20,0.91199,31,0.088,2,20,0.91199,30,0.088,3,13,0.06672,20,0.70927,31,0.224,3,13,0.04243,20,0.75756,30,0.2,1,13,1,1,13,1,2,12,0.75999,13,0.24,1,12,1,1,5,1,1,5,1,2,13,0.78807,20,0.21192,2,12,0.13482,13,0.86517,2,12,0.73937,13,0.26062,3,12,0.75413,13,0.05818,5,0.18768,3,12,0.44072,5,0.45527,10,0.10399,2,5,0.84,10,0.15999,2,13,0.87634,20,0.12365,2,12,0.15863,13,0.84136,2,12,0.66761,13,0.33238,3,12,0.89196,13,0.0134,5,0.09463,2,12,0.52973,5,0.47026,2,5,0.528,9,0.47199,1,20,1,1,20,1,1,20,1,1,20,1,1,20,1],"slotPose":[1,0,0,1,0,0],"bonePose":[27,0.000524,-1,1,0.000524,-36.134534,-1292.746462,20,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,13,0.133294,-0.991076,0.991076,0.133294,-102.984795,-1028.747532,12,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04,5,1,0,0,1,-107.18,-913,10,-0.063313,0.997994,-0.997994,-0.063313,-29.39,-886.57,9,0.08646,0.996255,-0.996255,0.08646,-146.29,-879.71,30,0.307689,-0.951487,0.951487,0.307689,-164.467343,-1165.289724,40,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473,31,0.307689,-0.951487,0.951487,0.307689,-50.523269,-1153.740106],"edges":[20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20],"userEdges":[25,38,38,39,39,40,40,41,41,42,42,43,32,44,44,2,39,45,45,46,46,47,47,43,28,48,48,46,45,49,49,43,47,49,49,46,39,49,49,40,49,41,49,42,42,8,41,9,50,25,50,38,50,39,45,50,50,26,27,50,50,28,50,48,34,0,39,51,51,52,52,53,53,54,54,55,55,56,56,17,10,57,57,51,40,57,57,41,11,58,58,52,57,58,12,59,59,53,58,59,13,60,60,54,59,60,14,61,61,55,60,61,15,62,62,56,61,62,62,16,24,63,63,51,38,63,23,64,64,52,63,64,22,65,65,53,64,65,21,66,66,54,65,66,20,67,67,55,66,67,19,68,68,56,67,68,68,18,7,69,69,43,42,69,31,70,70,48,29,70,44,71,71,46,70,71,4,72,72,69,72,6,71,73,73,72,3,73,73,43,73,47,61,15,33,1,50,46]}]},{"name":"1003","display":[{"name":"blank"}]},{"name":"1011","display":[{"name":"blank"}]},{"name":"1083","display":[{"name":"blank"}]},{"name":"1019","display":[{"name":"blank"}]},{"name":"1061","display":[{"name":"blank"}]},{"name":"1009","display":[{"name":"blank"}]},{"name":"1052","display":[{"name":"blank"}]},{"name":"1027","display":[{"name":"blank"}]},{"name":"1021","display":[{"name":"blank"}]},{"name":"1085","display":[{"name":"blank"}]},{"name":"1069","display":[{"name":"blank"}]},{"name":"1056","display":[{"name":"blank"}]},{"name":"1066","display":[{"name":"blank"}]},{"name":"1062","display":[{"name":"blank"}]},{"name":"1060","display":[{"name":"blank"}]},{"name":"1008","display":[{"name":"blank"}]},{"name":"1029","display":[{"name":"blank"}]},{"name":"1076","display":[{"name":"blank"}]},{"name":"blank","display":[{"name":"blank"}]},{"name":"1086","display":[{"name":"blank"}]}]}],"animation":[{"duration":160,"name":"idle","bone":[{"name":"ik_foot_r","translateFrame":[{"duration":50,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":6.5},{"duration":50,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":6.5},{"duration":0}]},{"name":"pelvis","translateFrame":[{"duration":40,"curve":[0.25,0,0.75,1],"y":1.88},{"duration":40,"curve":[0.25,0,0.75,1],"x":15.4,"y":-1.88},{"duration":40,"curve":[0.25,0,0.75,1],"y":1.88},{"duration":40,"curve":[0.25,0,0.75,1],"x":15.4,"y":-1.88},{"duration":0,"y":1.88}]},{"name":"spine","rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1]},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-3.02},{"duration":40,"curve":[0.25,0,0.75,1]},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-3.02},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":11,"curve":[0.379,0.6,0.724,1],"x":0.84},{"duration":40,"curve":[0.25,0,0.75,1]},{"duration":29,"curve":[0.242,0,0.667,0.67],"x":3.76,"y":-0.01},{"duration":11,"curve":[0.379,0.6,0.724,1],"x":0.84},{"duration":41,"curve":[0.25,0,0.75,1]},{"duration":28,"curve":[0.242,0,0.667,0.67],"x":3.76,"y":-0.01},{"duration":0,"x":0.84}],"rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1]},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":3.45},{"duration":40,"curve":[0.25,0,0.75,1]},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":3.45},{"duration":0}]},{"name":"foot_r","rotateFrame":[{"duration":50,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":2.99},{"duration":50,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":2.99},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":23,"curve":[0.375,0.5,0.75,1],"x":2.21,"y":-0.31},{"duration":40,"curve":[0.25,0,0.75,1]},{"duration":17,"curve":[0.25,0,0.625,0.5],"x":3.72,"y":-0.53},{"duration":23,"curve":[0.375,0.5,0.75,1],"x":2.21,"y":-0.31},{"duration":40,"curve":[0.25,0,0.75,1]},{"duration":17,"curve":[0.25,0,0.625,0.5],"x":3.72,"y":-0.53},{"duration":0,"x":2.21,"y":-0.31}]},{"name":"upperarm_l","rotateFrame":[{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":0.76},{"duration":30,"tweenEasing":0,"rotate":1.63},{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":0.76},{"duration":30,"tweenEasing":0,"rotate":1.63},{"duration":0}]},{"name":"upperarm_r","rotateFrame":[{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-3.28},{"duration":30,"tweenEasing":0,"rotate":-4.04},{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-3.28},{"duration":30,"tweenEasing":0,"rotate":-4.04},{"duration":0}]},{"name":"xiong_l","translateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":40,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":10,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":30,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":40,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":10,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"xiong_r","translateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":40,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":10,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":30,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":40,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":10,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"forearm_l","rotateFrame":[{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-0.24},{"duration":7,"tweenEasing":0,"rotate":0.88},{"duration":23,"tweenEasing":0,"rotate":1.2},{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-0.24},{"duration":7,"tweenEasing":0,"rotate":0.88},{"duration":23,"tweenEasing":0,"rotate":1.2},{"duration":0}]},{"name":"forearm_r","rotateFrame":[{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":2.2},{"duration":7,"tweenEasing":0,"rotate":1.25},{"duration":23,"tweenEasing":0,"rotate":0.16},{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":2.2},{"duration":7,"tweenEasing":0,"rotate":1.25},{"duration":23,"tweenEasing":0,"rotate":0.16},{"duration":0}]},{"name":"head","rotateFrame":[{"duration":19,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":4.57},{"duration":21,"curve":[0.25,0,0.625,0.5],"rotate":8.97},{"duration":19,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":41,"curve":[0.25,0,0.75,1],"rotate":4.57},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":8.97},{"duration":0,"rotate":6.77}]},{"name":"hand_l","rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":19,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"hand_r","rotateFrame":[{"duration":19,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":4.57},{"duration":21,"curve":[0.25,0,0.625,0.5],"rotate":8.97},{"duration":19,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":41,"curve":[0.25,0,0.75,1],"rotate":4.57},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":8.97},{"duration":0,"rotate":6.77}]},{"name":"dress0101","rotateFrame":[{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":0.35},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.03},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":-2.67},{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":0.35},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.03},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":-2.67},{"duration":0,"rotate":0.35}]},{"name":"dress0201","rotateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":11,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0301","rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":19,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"dress0102","rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":19,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"dress0202","rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0302","rotateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":11,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0103","rotateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":11,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0203","rotateFrame":[{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0303","rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0104","rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0204","rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":19,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"dress0304","rotateFrame":[{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0105","rotateFrame":[{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0205","rotateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-1.08},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":-14.68},{"duration":11,"curve":[0.276,0,0.621,0.4],"rotate":1.99},{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-1.08},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-14.68},{"duration":10,"curve":[0.276,0,0.621,0.4],"rotate":1.99},{"duration":0,"rotate":-1.08}]},{"name":"dress0305","rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":19,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0302","rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0202","rotateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":11,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0401","rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0603","rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0403","rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":19,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0101","rotateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":11,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0501","rotateFrame":[{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-1.76},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-1.08},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":-4.78},{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-1.76},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-1.08},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":-4.78},{"duration":0,"rotate":-1.76}]},{"name":"hair0102","rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0201","rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":19,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0103","rotateFrame":[{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0602","rotateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":11,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0301","rotateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":11,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0601","rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":19,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0502","rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":20,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":19,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"hair0503","rotateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":11,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0402","rotateFrame":[{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"bag0101","rotateFrame":[{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":11,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":30,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"bag0102","rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0504","rotateFrame":[{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0604","rotateFrame":[{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0505","rotateFrame":[{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0605","rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":39,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":40,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"finger_l","rotateFrame":[{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":1.72},{"duration":30,"tweenEasing":0,"rotate":0.51},{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":1.72},{"duration":30,"tweenEasing":0,"rotate":0.51},{"duration":0}]},{"name":"figner_r","rotateFrame":[{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":0.64},{"duration":30,"tweenEasing":0,"rotate":-0.88},{"duration":25,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":0.64},{"duration":30,"tweenEasing":0,"rotate":-0.88},{"duration":0}]}],"ffd":[{"name":"face/10202001","slot":"1046","frame":[{"duration":40,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"offset":120,"vertices":[2.34,-0.27,1.65,1.02,0.22,1.69,-1.17,1.07,-2.82,-0.39,-0.67,-0.52,0.82,-0.69,2.34,-0.27,-3.42,0.4,-2.93,0.33]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-0.3,0.03,-0.3,0.03,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.24,0.72,-0.84,0.68,0,0,1.09,-0.66,0.79,-0.63,-0.3,0.03,-1.14,0.71,-2.03,0.8,1.82,-2.54,1.82,-2.54]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-0.51,0.95,-0.51,0.95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.24,0.72,-0.84,0.68,0,0,1.09,-0.66,0.58,0.3,-0.51,0.95,-1.35,1.64,-2.03,0.8,1.82,-2.54,1.82,-2.54]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"offset":120,"vertices":[2.34,-0.27,1.65,1.02,0.22,1.69,-1.17,1.07,-2.82,-0.39,-0.67,-0.52,0.82,-0.69,2.34,-0.27,-3.42,0.4,-2.93,0.33]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-0.3,0.03,-0.3,0.03,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.24,0.72,-0.84,0.68,0,0,1.09,-0.66,0.79,-0.63,-0.3,0.03,-1.14,0.71,-2.03,0.8,1.82,-2.54,1.82,-2.54]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-3.31,-7.44,-3.31,-7.44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.74,0.69,2.4,4.87,3.34,6.83,1.92,5.17,-3.99,-5.28,-3.67,-5.95,-2.93,-6.14,-0.44,-3.11,-1.72,-3.13,0.56,1.47]},{"duration":5,"tweenEasing":0,"offset":120,"vertices":[2.34,-0.27,1.65,1.02,0.22,1.69,-1.17,1.07,-2.82,-0.39,-0.67,-0.52,0.82,-0.69,2.34,-0.27,-3.42,0.4,-2.93,0.33]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-0.3,0.03,-0.3,0.03,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.24,0.72,-0.84,0.68,0,0,1.09,-0.66,0.79,-0.63,-0.3,0.03,-1.14,0.71,-2.03,0.8,1.82,-2.54,1.82,-2.54]},{"duration":5,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":7,"tweenEasing":0,"offset":6,"vertices":[-0.3,0.03,-0.3,0.03,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.24,0.72,-0.84,0.68,0,0,1.09,-0.66,0.79,-0.63,-0.3,0.03,-1.14,0.71,-2.03,0.8,1.82,-2.54,1.82,-2.54]},{"duration":10,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":4,"curve":[0.5,0,0.5,1],"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":6,"curve":[0.5,0,0.5,1],"vertices":[1.42,8.78,0.5,2.11,0,0,-2.03,-5.52,-2.98,-4.71,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":20,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":40,"name":"angry","bone":[{"name":"pelvis","translateFrame":[{"duration":5,"curve":[0.25,0,0.75,1],"y":1.88},{"duration":5,"tweenEasing":0,"x":-15.8,"y":12.43},{"duration":5,"tweenEasing":0,"x":-18.91,"y":18.67},{"duration":15,"tweenEasing":0,"x":30.03,"y":-8.63},{"duration":10,"tweenEasing":0,"x":19.35,"y":0.32},{"duration":0,"y":1.88}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-1.23},{"duration":5,"tweenEasing":0,"rotate":-3.19},{"duration":25,"tweenEasing":0,"rotate":2.16},{"duration":0}],"scaleFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":15,"tweenEasing":0,"x":1.01,"y":1.01},{"duration":10}]},{"name":"spine","rotateFrame":[{"duration":5,"curve":[0.25,0,0.75,1]},{"duration":5,"rotate":-0.82},{"duration":15,"tweenEasing":0,"rotate":-0.82},{"duration":5,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.36},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":40,"x":0.84}],"rotateFrame":[{"duration":5,"curve":[0.25,0,0.75,1]},{"duration":5,"rotate":-1.06},{"duration":5,"tweenEasing":0,"rotate":-1.06},{"duration":10,"tweenEasing":0,"rotate":0.69},{"duration":5,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":0.12},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":40,"x":2.21,"y":-0.31}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"rotate":-4.74},{"duration":5,"tweenEasing":0,"rotate":-4.74},{"duration":10,"tweenEasing":0,"rotate":-1.49},{"duration":5,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.02},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":9.53},{"duration":5,"tweenEasing":0,"rotate":7.9},{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":0.25},{"duration":10}]},{"name":"head","rotateFrame":[{"duration":5,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":5,"tweenEasing":0,"rotate":7.06},{"duration":5,"tweenEasing":0,"rotate":9.75},{"duration":10,"tweenEasing":0,"rotate":0.06},{"duration":15,"tweenEasing":0,"rotate":3.23},{"duration":0,"rotate":6.77}]},{"name":"face","scaleFrame":[{"duration":15},{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.1},{"duration":10,"x":1.1},{"duration":0}]},{"name":"bag0101","rotateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0101","rotateFrame":[{"duration":5,"curve":[0.379,0.6,0.724,1],"rotate":0.35},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.03},{"duration":15,"curve":[0.242,0,0.667,0.67],"rotate":-2.67},{"duration":0,"rotate":0.35}]},{"name":"dress0201","rotateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":5,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0301","rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":10,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"bag0102","rotateFrame":[{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0102","rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"dress0202","rotateFrame":[{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0302","rotateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0103","rotateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0203","rotateFrame":[{"duration":5,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":15,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0303","rotateFrame":[{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0104","rotateFrame":[{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0204","rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":10,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"dress0304","rotateFrame":[{"duration":5,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":15,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"xiong_l","translateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":20,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":5,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"xiong_r","translateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":20,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":5,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"dress0105","rotateFrame":[{"duration":5,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":15,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0205","rotateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"rotate":-1.08},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-14.68},{"duration":5,"curve":[0.276,0,0.621,0.4],"rotate":1.99},{"duration":0,"rotate":-1.08}]},{"name":"dress0305","rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":10,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hand_l","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":5.52,"y":-0.79},{"duration":15,"curve":[0.5,0,1,1],"x":21.97,"y":-69.56},{"duration":10,"tweenEasing":0,"x":0.98,"y":-0.45},{"duration":0}],"rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":5,"tweenEasing":0,"rotate":6.95},{"duration":15,"curve":[0.5,0,1,1],"rotate":3.13},{"duration":10,"tweenEasing":0,"rotate":11.35},{"duration":0,"rotate":-0.21}]},{"name":"hand_r","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":15,"curve":[0.5,0,1,1],"x":33.73,"y":40.32},{"duration":10,"tweenEasing":0,"x":3.23,"y":1.87},{"duration":0}],"rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":5,"tweenEasing":0},{"duration":15,"curve":[0.5,0,1,1],"rotate":-6.79},{"duration":10,"tweenEasing":0,"rotate":-6.79},{"duration":0,"rotate":6.77}]},{"name":"hair0301","rotateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0201","rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":10,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0501","rotateFrame":[{"duration":5,"curve":[0.379,0.6,0.724,1],"rotate":-1.76},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-1.08},{"duration":15,"curve":[0.242,0,0.667,0.67],"rotate":-4.78},{"duration":0,"rotate":-1.76}]},{"name":"hair0601","rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":10,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0101","rotateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0401","rotateFrame":[{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0502","rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":10,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"hair0402","rotateFrame":[{"duration":5,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":15,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0202","rotateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0602","rotateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0102","rotateFrame":[{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0302","rotateFrame":[{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0503","rotateFrame":[{"duration":15,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0603","rotateFrame":[{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0403","rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":10,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0103","rotateFrame":[{"duration":5,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":15,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0504","rotateFrame":[{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0604","rotateFrame":[{"duration":5,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":15,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0605","rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":10,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0505","rotateFrame":[{"duration":5,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":15,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]}],"ffd":[{"name":"face/10202001","slot":"1046","frame":[{"duration":8,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":7,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":15,"tweenEasing":0,"vertices":[-1.87,0.62,-1.98,0.28,0,0,-1.01,-0.08,-2.5,0.57,0,0,5.1,-2.2,4.88,-1.8,0,0,-1.28,0.31,-5.9,-0.75,0,0,0,0,0,0,0,0,0,0,0,0,-0.49,0.11,-0.25,-0.44,-0.82,-1.82,-1.33,0.12,0,0,-0.68,-2.71,-2.19,-0.66,-3.29,-1.44,0,0,0,0,0,0,0,0,2.73,-2.91,0,0,0,0,0,0,0,0,1.88,0.07,0,0,0,0,1.15,-2.74,1.88,0.07,0.12,1.14,0.18,-1.39,0.35,-2.78,0.91,-2.04,2.16,-1.07,0.88,-0.95,0,0,9.65,-0.88,10.24,-4.97,13.91,-3.95,2.73,-0.14,-11.78,6.19,-6.91,8.32,-3.57,-3.84,-1.38,1.31,-3.18,7.19,-3.54,8.05,0,0,0,0,0,0,0,0,-1.89,-1.06,-0.9,0,0,2.94,1.7,-0.28,-2.77,-0.52,-3.56,-1.11,-4.97,-0.67,-4.47,-1.58,-1.09,-0.06,2.34,-0.26,0,0,15.31,0.26,5.27,-1.13]},{"duration":10,"tweenEasing":0,"vertices":[-1.87,0.62,-1.98,0.28,0,0,-1.01,-0.08,-2.5,0.57,0,0,5.1,-2.2,4.88,-1.8,0,0,-1.28,0.31,-5.9,-0.75,0,0,0,0,0,0,0,0,0,0,0,0,-0.49,0.11,-0.25,-0.44,-0.82,-1.82,-1.33,0.12,0,0,-0.68,-2.71,-2.19,-0.66,-3.29,-1.44,0,0,0,0,0,0,0,0,2.73,-2.91,0,0,0,0,0,0,0,0,1.88,0.07,0,0,0,0,1.15,-2.74,1.88,0.07,0.12,1.14,0.18,-1.39,0.35,-2.78,0.91,-2.04,2.16,-1.07,0.88,-0.95,0,0,9.65,-0.88,10.24,-4.97,13.91,-3.95,2.73,-0.14,-11.78,6.19,-6.91,8.32,-3.57,-3.84,-1.38,1.31,-3.18,7.19,-3.54,8.05,0,0,0,0,0,0,0,0,-1.89,-1.06,-0.9,0,0,2.94,1.7,-0.28,-2.77,-0.52,-3.56,-1.11,-4.97,-0.67,-4.47,-1.58,-1.09,-0.06,2.34,-0.26,0,0,15.31,0.26,5.27,-1.13]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"cry","bone":[{"name":"pelvis","translateFrame":[{"duration":8,"curve":[0.25,0,0.75,1],"y":1.88},{"duration":13,"tweenEasing":0,"x":11.5,"y":-0.72},{"duration":14,"tweenEasing":0,"x":18.27,"y":-0.99},{"duration":7,"tweenEasing":0,"x":17.36,"y":-0.99},{"duration":8,"tweenEasing":0,"x":19.78,"y":-0.99},{"duration":0,"y":1.88}]},{"name":"spine","translateFrame":[{"duration":11,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.06,"y":0.73},{"duration":4,"tweenEasing":0},{"duration":7,"tweenEasing":0,"y":-0.43},{"duration":3,"tweenEasing":0},{"duration":7,"tweenEasing":0,"y":-0.43},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-0.43},{"duration":0}],"rotateFrame":[{"duration":11,"curve":[0.25,0,0.75,1]},{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-0.31},{"duration":29,"tweenEasing":0,"rotate":0.09},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":11,"curve":[0.379,0.6,0.724,1],"x":0.84},{"duration":4,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":1.84,"y":0.11},{"duration":4,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":3,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":0,"x":0.84}],"rotateFrame":[{"duration":6,"curve":[0.25,0,0.75,1]},{"duration":5,"tweenEasing":0,"rotate":-0.47},{"duration":4,"tweenEasing":0,"rotate":-1.54},{"duration":6,"tweenEasing":0,"rotate":-0.78},{"duration":29,"tweenEasing":0,"rotate":-0.93},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"x":2.21,"y":-0.31},{"duration":7,"tweenEasing":0,"x":2.8,"y":0.62},{"duration":5,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":4,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":0,"x":2.21,"y":-0.31}],"rotateFrame":[{"duration":13,"tweenEasing":0},{"duration":7,"tweenEasing":0,"rotate":2.33},{"duration":30,"tweenEasing":0,"rotate":1.32},{"duration":0}]},{"name":"head","translateFrame":[{"duration":21,"curve":[0,0,0.5,1]},{"duration":4,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":-2.72,"y":0.02},{"duration":3,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":-2.72,"y":0.02},{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-2.72,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":21,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":4,"tweenEasing":0,"rotate":3.51},{"duration":7,"tweenEasing":0,"rotate":2.55},{"duration":3,"tweenEasing":0,"rotate":3.51},{"duration":15,"tweenEasing":0,"rotate":2.55},{"duration":0,"rotate":6.77}]},{"name":"face","scaleFrame":[{"duration":20},{"duration":4,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.94},{"duration":4,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.94},{"duration":4,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.94},{"duration":0}]},{"name":"bag0101","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0101","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":0.35},{"duration":26,"curve":[0.25,0,0.75,1],"rotate":1.03},{"duration":18,"curve":[0.242,0,0.667,0.67],"rotate":-2.67},{"duration":0,"rotate":0.35}]},{"name":"dress0201","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0301","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":12,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"bag0102","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0102","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":12,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"dress0202","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0302","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0103","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0203","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":26,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":18,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0303","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0104","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0204","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":12,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"dress0304","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":26,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":18,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"xiong_l","translateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":25,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":6,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"xiong_r","translateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":25,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":6,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"dress0105","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":26,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":18,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0205","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-1.08},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-14.68},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":1.99},{"duration":0,"rotate":-1.08}]},{"name":"dress0305","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":12,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hand_l","translateFrame":[{"duration":25,"curve":[0.5,0,0.5,1]},{"duration":25,"curve":[0.5,0,0.5,1],"x":15,"y":-25.5},{"duration":0}],"rotateFrame":[{"duration":25,"curve":[0.5,0,0.5,1],"rotate":-0.21},{"duration":25,"curve":[0.5,0,0.5,1],"rotate":-11.12},{"duration":0,"rotate":-0.21}]},{"name":"hand_r","translateFrame":[{"duration":25,"curve":[0.5,0,0.5,1]},{"duration":25,"curve":[0.5,0,0.5,1],"x":23.94,"y":13.56},{"duration":0}],"rotateFrame":[{"duration":25,"curve":[0.5,0,0.5,1],"rotate":6.77},{"duration":25,"curve":[0.5,0,0.5,1],"rotate":13.42},{"duration":0,"rotate":6.77}]},{"name":"hair0301","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0201","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":12,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0501","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-1.76},{"duration":26,"curve":[0.25,0,0.75,1],"rotate":-1.08},{"duration":18,"curve":[0.242,0,0.667,0.67],"rotate":-4.78},{"duration":0,"rotate":-1.76}]},{"name":"hair0601","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":12,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0101","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0401","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0502","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":12,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"hair0402","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":26,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":18,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0202","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0602","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0102","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0302","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0503","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":6,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0603","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0403","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":12,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0103","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":26,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":18,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0504","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0604","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":26,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":18,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0605","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":12,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0505","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":26,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":18,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]}],"ffd":[{"name":"face/10202001","slot":"1046","frame":[{"duration":6,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":7,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":7,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.17,-4.3,-2.98,-4.88,-3.41,-3.21,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":8,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":7,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.41,13.36,4.11,16.79,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,0.36,1.31,1.27,2.27,0.77,2.38,1.01,1.34,-0.49,-5.68,-3.16,-5.41,-2.61,-3.66,0.47,-0.36,1.28,-1.61,1.7,-0.66,4.7,12.53,3.9,5.11,1.15,9.18]},{"duration":8,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.38,-4.81,-3.71,-6.24,-3.46,-3.61,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":7,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,-0.17,-4.3,-2.98,-4.88,-3.41,-3.21,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"happy","bone":[{"name":"pelvis","translateFrame":[{"duration":5,"curve":[0.25,0,0.75,1],"y":1.88},{"duration":5,"tweenEasing":0,"x":11.5,"y":-0.72},{"duration":4,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":4,"tweenEasing":0,"x":21.09,"y":-1.41},{"duration":4,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":5,"tweenEasing":0,"x":21.09,"y":-1.41},{"duration":5,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":6,"tweenEasing":0,"x":21.09,"y":-1.41},{"duration":3,"tweenEasing":0,"x":18.27,"y":-1.14},{"duration":9,"tweenEasing":0,"x":13.02,"y":-0.63},{"duration":0,"y":1.88}]},{"name":"spine","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"y":-0.43},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"y":-0.43},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"y":-0.43},{"duration":12}],"rotateFrame":[{"duration":10,"curve":[0.25,0,0.75,1]},{"duration":28,"tweenEasing":0,"rotate":0.09},{"duration":12,"tweenEasing":0,"rotate":0.09},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":10,"curve":[0.379,0.6,0.724,1],"x":0.84},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.69,"y":-0.03},{"duration":12},{"duration":0,"x":0.84}],"rotateFrame":[{"duration":5,"curve":[0.25,0,0.75,1]},{"duration":5,"tweenEasing":0,"rotate":-0.47},{"duration":28,"tweenEasing":0,"rotate":-0.93},{"duration":12,"tweenEasing":0,"rotate":-0.93},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"x":2.21,"y":-0.31},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":1.7,"y":-0.2},{"duration":12},{"duration":0,"x":2.21,"y":-0.31}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":5,"tweenEasing":0,"rotate":-0.85},{"duration":28,"tweenEasing":0,"rotate":1.32},{"duration":12,"tweenEasing":0,"rotate":1.32},{"duration":0}]},{"name":"head","translateFrame":[{"duration":10,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":4,"tweenEasing":0,"x":-1.36,"y":0.01},{"duration":4,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":-1.36,"y":0.01},{"duration":5,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":-1.36,"y":0.01},{"duration":12}],"rotateFrame":[{"duration":5,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":5,"tweenEasing":0,"rotate":6.42},{"duration":4,"tweenEasing":0,"rotate":19.15},{"duration":4,"tweenEasing":0,"rotate":20.93},{"duration":4,"tweenEasing":0,"rotate":19.15},{"duration":5,"tweenEasing":0,"rotate":20.93},{"duration":5,"tweenEasing":0,"rotate":19.15},{"duration":6,"tweenEasing":0,"rotate":20.93},{"duration":12,"tweenEasing":0,"rotate":19.15},{"duration":0,"rotate":6.77}]},{"name":"face","scaleFrame":[{"duration":10},{"duration":10,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":1.11},{"duration":11,"tweenEasing":0},{"duration":9,"tweenEasing":0,"x":1.11},{"duration":0}]},{"name":"bag0101","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0101","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":0.35},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.03},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":-2.67},{"duration":0,"rotate":0.35}]},{"name":"dress0201","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0301","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"bag0102","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0102","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"dress0202","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0302","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0103","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0203","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0303","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0104","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0204","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"dress0304","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"xiong_l","translateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":25,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":6,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"xiong_r","translateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":25,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":6,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"dress0105","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0205","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-1.08},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-14.68},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":1.99},{"duration":0,"rotate":-1.08}]},{"name":"dress0305","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hand_l","translateFrame":[{"duration":20,"curve":[0.25,0,0.75,1]},{"duration":30,"curve":[0.25,0,0.75,1],"x":37.73,"y":-111.38},{"duration":0}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-0.21},{"duration":30,"tweenEasing":0,"rotate":-7.22},{"duration":15,"tweenEasing":0,"rotate":42.9},{"duration":0,"rotate":-0.21}]},{"name":"hand_r","translateFrame":[{"duration":20,"curve":[0.25,0,0.75,1]},{"duration":30,"curve":[0.25,0,0.75,1],"x":33.9,"y":40.29},{"duration":0}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":6.77},{"duration":30,"tweenEasing":0,"rotate":22.79},{"duration":15,"tweenEasing":0,"rotate":-12.45},{"duration":0,"rotate":6.77}]},{"name":"hair0301","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0201","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0501","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-1.76},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-1.08},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":-4.78},{"duration":0,"rotate":-1.76}]},{"name":"hair0601","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0101","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0401","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0502","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"hair0402","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0202","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0602","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0102","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0302","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0503","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0603","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0403","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0103","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0504","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0604","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0605","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0505","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]}],"ffd":[{"name":"face/10202001","slot":"1046","frame":[{"duration":10,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":8,"tweenEasing":0,"vertices":[0.41,2.51,-1.29,-4.08,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-1.67,-5.86,-3.71,-12.26,-4.11,-14.72,-4.84,-10.32,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,-1.26,-3.82,-3.22,-10.79,-3.92,-11.81,-2.73,-7.89,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":6,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,0.44,1.7,0.44,1.7,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.52,-3.81,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,0.65,-2.55,-0.74,-1.42,-1.75,-1.68,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":6,"tweenEasing":0,"vertices":[0.41,2.51,-1.29,-4.08,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-1.67,-5.86,-3.71,-12.26,-4.11,-14.72,-4.84,-10.32,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,-1.26,-3.82,-3.22,-10.79,-3.92,-11.81,-2.73,-7.89,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":10,"tweenEasing":0,"vertices":[0.41,2.51,0.14,0.6,0,0,0.44,1.7,0.44,1.7,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-0.24,-1.17,-2.28,-7.58,-2.4,-9.12,-3.2,-4.96,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,0.17,0.86,-1.7,-5.82,-2.18,-6.12,-1.78,-4.46,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,0.94,-2.6,-0.45,-1.48,-1.46,-1.73,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":10,"tweenEasing":0,"vertices":[0.41,2.51,-1.29,-4.08,0,0,1.42,4.28,1.42,4.28,0,0,0.28,1.12,0.28,1.12,0,0,0.23,0.59,0.23,0.59,0,0,2.92,5.09,-1.67,-5.86,-3.71,-12.26,-4.11,-14.72,-4.84,-10.32,2.04,5.08,3.23,10.41,3.45,8.9,2.22,8.93,3.38,4.59,3.69,9.06,3.72,10.9,2.5,9.08,1.89,6.24,3.07,8.59,3.1,7.97,2.57,6.97,1.64,5.47,-1.26,-3.82,-3.22,-10.79,-3.92,-11.81,-2.73,-7.89,0.54,2.06,3.11,6.13,3.16,8.67,2.56,7.84,0.3,1.38,2.96,7.45,3.87,9.74,2.88,8.43,1.05,4.82,2.15,6.3,1.82,7.47,2.2,7.79,0.28,1.12,0.28,1.12,0.28,1.12,0.28,1.12,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0.23,0.59,0,0,0,0,0,0,0,0,-0.58,0.8,0.49,1.2,2.06,2.76,4.09,1.07,2.32,2.7,0.93,3.83,-0.08,3.57,-2.19,-0.1,4.47,-3.57,6.62,-0.59,2.56,5.91,0.28,1.12,0.27,0.86]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"sad","bone":[{"name":"pelvis","translateFrame":[{"duration":9,"curve":[0.25,0,0.75,1],"y":1.88},{"duration":7,"tweenEasing":0,"x":10.08,"y":-0.49},{"duration":13,"tweenEasing":0,"x":23.26,"y":-0.99},{"duration":12,"tweenEasing":0,"x":31.41,"y":-1.99},{"duration":9,"tweenEasing":0,"x":13.02},{"duration":0,"y":1.88}]},{"name":"spine","translateFrame":[{"duration":16,"tweenEasing":0},{"duration":13,"tweenEasing":0,"x":-0.25,"y":-2.49},{"duration":21,"tweenEasing":0,"y":0.16},{"duration":0}],"rotateFrame":[{"duration":16,"curve":[0.25,0,0.75,1]},{"duration":13,"tweenEasing":0,"rotate":-0.31},{"duration":21,"tweenEasing":0,"rotate":-0.23},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":9,"curve":[0.379,0.6,0.724,1],"x":0.84},{"duration":7,"tweenEasing":0},{"duration":13,"tweenEasing":0,"x":1.36,"y":0.08},{"duration":21,"tweenEasing":0,"x":0.53,"y":0.02},{"duration":0,"x":0.84}],"rotateFrame":[{"duration":9,"curve":[0.25,0,0.75,1]},{"duration":7,"tweenEasing":0,"rotate":-0.05},{"duration":13,"tweenEasing":0,"rotate":-0.78},{"duration":21,"tweenEasing":0,"rotate":-0.08},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":9,"curve":[0.375,0.5,0.75,1],"x":2.21,"y":-0.31},{"duration":7,"tweenEasing":0},{"duration":13,"tweenEasing":0,"x":2.66,"y":-0.29},{"duration":21,"tweenEasing":0,"x":7.96,"y":-0.97},{"duration":0,"x":2.21,"y":-0.31}],"rotateFrame":[{"duration":9,"tweenEasing":0},{"duration":7,"tweenEasing":0,"rotate":2.66},{"duration":13,"tweenEasing":0,"rotate":4.62},{"duration":21,"tweenEasing":0,"rotate":2.8},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":9,"tweenEasing":0},{"duration":7,"tweenEasing":0,"rotate":-3.28},{"duration":13,"tweenEasing":0,"rotate":-4.66},{"duration":12,"tweenEasing":0,"rotate":-5.29},{"duration":9,"tweenEasing":0,"rotate":-3.28},{"duration":0}]},{"name":"head","translateFrame":[{"duration":16,"tweenEasing":0},{"duration":13,"tweenEasing":0,"x":-2.72,"y":0.07},{"duration":12,"tweenEasing":0,"x":-2.72,"y":0.07},{"duration":9,"tweenEasing":0,"x":-0.87,"y":0.02},{"duration":0}],"rotateFrame":[{"duration":16,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":13,"tweenEasing":0,"rotate":-5.04},{"duration":12,"tweenEasing":0,"rotate":-2.39},{"duration":9,"tweenEasing":0,"rotate":-4.39},{"duration":0,"rotate":6.77}]},{"name":"face","scaleFrame":[{"duration":16},{"duration":13,"tweenEasing":0},{"duration":21,"tweenEasing":0,"x":0.85},{"duration":0}]},{"name":"bag0101","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0101","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":0.35},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.03},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":-2.67},{"duration":0,"rotate":0.35}]},{"name":"dress0201","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0301","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"bag0102","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0102","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"dress0202","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0302","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0103","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0203","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0303","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0104","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0204","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"dress0304","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"xiong_l","translateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":25,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":6,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"xiong_r","translateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":25,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":6,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"dress0105","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0205","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-1.08},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-14.68},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":1.99},{"duration":0,"rotate":-1.08}]},{"name":"dress0305","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hand_l","translateFrame":[{"duration":20,"curve":[0.5,0,0.5,1]},{"duration":30,"curve":[0.5,0,0.5,1],"x":-1.87,"y":58.37},{"duration":0}],"rotateFrame":[{"duration":25,"curve":[0.5,0,0.5,1],"rotate":-0.21},{"duration":25,"curve":[0.5,0,0.5,1],"rotate":-23.33},{"duration":0,"rotate":-0.21}]},{"name":"hand_r","translateFrame":[{"duration":20,"curve":[0.5,0,0.5,1]},{"duration":30,"curve":[0.5,0,0.5,1],"x":-19.32,"y":-32.69},{"duration":0}],"rotateFrame":[{"duration":25,"curve":[0.5,0,0.5,1],"rotate":6.77},{"duration":25,"curve":[0.5,0,0.5,1],"rotate":22.81},{"duration":0,"rotate":6.77}]},{"name":"hair0301","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0201","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0501","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-1.76},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-1.08},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":-4.78},{"duration":0,"rotate":-1.76}]},{"name":"hair0601","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0101","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0401","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0502","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"hair0402","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0202","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0602","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0102","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0302","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0503","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0603","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0403","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0103","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0504","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0604","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0605","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0505","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]}],"ffd":[{"name":"face/10202001","slot":"1046","frame":[{"duration":15,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":14,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,0.23,-3.27,-1.91,-3.53,-3.29,-2.4,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":21,"tweenEasing":0,"vertices":[0.71,4.39,0.25,1.05,0,0,0,0,0,0,0,0,1.55,9.68,1.47,7.83,0,0,1.78,8.07,1.52,5.18,0,0,5.11,8.91,0.29,1.23,0,0,0,0,0,0,4.02,12.46,5.73,18.82,6.03,15.58,5.03,17.55,5.92,8.04,6.45,15.85,6.51,19.07,4.37,15.89,4.13,12.73,5.66,18.21,6.27,17.52,5.75,17.07,2.87,9.57,0.29,1.51,0,0,0,0,0,0,0.94,3.6,6.3,11.57,5.42,15.48,4.6,15.12,0.53,2.41,5.19,13.05,6.78,17.05,5.04,14.75,1.84,8.43,4.71,13.32,4.14,15.38,4.38,15.38,1.92,8.18,3.41,-1.28,3.46,-0.03,1.7,9.66,-4.55,2.56,1.19,6.13,1.98,4.42,0.19,7.01,0.51,5.16,-3.31,2.01,0,0,0,0,0,0,0,0,-0.35,1.83,1.04,3.11,1.23,3.3,2.08,2.09,0.23,-3.27,-1.91,-3.53,-3.29,-2.4,-0.68,-0.4,1.58,-1.99,4.48,0.47,4.7,12.53,4.45,6.58,1.15,9.18]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":50,"name":"shock","bone":[{"name":"pelvis","translateFrame":[{"duration":7,"curve":[0.25,0,0.75,1],"y":1.88},{"duration":8,"tweenEasing":0,"x":89.53,"y":-0.76},{"duration":25,"tweenEasing":0,"x":82.93,"y":-1.94},{"duration":10,"tweenEasing":0,"x":87.24,"y":-2.19},{"duration":0,"y":1.88}],"rotateFrame":[{"duration":7,"tweenEasing":0},{"duration":8,"tweenEasing":0,"rotate":0.42},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"rotate":-0.42},{"duration":0}]},{"name":"spine","translateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"y":-0.76},{"duration":0}],"rotateFrame":[{"duration":7,"curve":[0.25,0,0.75,1]},{"duration":8,"tweenEasing":0,"rotate":1.82},{"duration":25,"tweenEasing":0,"rotate":2.4},{"duration":10,"tweenEasing":0,"rotate":2.01},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":15,"curve":[0.379,0.6,0.724,1],"x":0.84},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":0.67,"y":-0.06},{"duration":0,"x":0.84}],"rotateFrame":[{"duration":7,"curve":[0.25,0,0.75,1]},{"duration":8,"tweenEasing":0,"rotate":-1.75},{"duration":25,"tweenEasing":0,"rotate":-0.63},{"duration":10,"tweenEasing":0,"rotate":-0.5},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":15,"curve":[0.375,0.5,0.75,1],"x":2.21,"y":-0.31},{"duration":25,"tweenEasing":0},{"duration":10,"tweenEasing":0,"x":0.66,"y":-0.1},{"duration":0,"x":2.21,"y":-0.31}],"rotateFrame":[{"duration":15,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-4.34},{"duration":10,"tweenEasing":0,"rotate":-3.56},{"duration":0}]},{"name":"head","rotateFrame":[{"duration":7,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":8,"tweenEasing":0,"rotate":9.23},{"duration":25,"tweenEasing":0,"rotate":10.04},{"duration":10,"tweenEasing":0,"rotate":10.04},{"duration":0,"rotate":6.77}]},{"name":"face","scaleFrame":[{"duration":7},{"duration":8,"tweenEasing":0},{"duration":25,"tweenEasing":0,"x":1.16},{"duration":10,"tweenEasing":0,"x":1.1},{"duration":0}]},{"name":"bag0101","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0101","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":0.35},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.03},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":-2.67},{"duration":0,"rotate":0.35}]},{"name":"dress0201","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0301","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"bag0102","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0102","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"dress0202","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0302","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0103","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0203","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0303","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0104","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0204","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"dress0304","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"xiong_l","translateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":25,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":6,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"xiong_r","translateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":25,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":6,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"dress0105","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0205","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-1.08},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-14.68},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":1.99},{"duration":0,"rotate":-1.08}]},{"name":"dress0305","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hand_l","translateFrame":[{"duration":15,"curve":[0.25,0,0.75,1]},{"duration":15,"curve":[0.25,0,0.75,1],"x":20.8,"y":-78.64},{"duration":20,"curve":[0.25,0,0.75,1],"x":20.8,"y":-78.64},{"duration":0}],"rotateFrame":[{"duration":15,"curve":[0.25,0,0.75,1],"rotate":-0.21},{"duration":15,"curve":[0.25,0,0.75,1],"rotate":-12.44},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":-12.44},{"duration":0,"rotate":-0.21}]},{"name":"hand_r","translateFrame":[{"duration":15,"curve":[0.25,0,0.75,1]},{"duration":15,"curve":[0.5,0,0.5,1],"x":33.9,"y":40.29},{"duration":20,"curve":[0.25,0,0.75,1],"x":33.9,"y":40.29},{"duration":0}],"rotateFrame":[{"duration":15,"curve":[0.25,0,0.75,1],"rotate":6.77},{"duration":15,"curve":[0.5,0,0.5,1],"rotate":10.9},{"duration":20,"curve":[0.25,0,0.75,1],"rotate":10.9},{"duration":0,"rotate":6.77}]},{"name":"hair0301","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0201","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0501","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-1.76},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-1.08},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":-4.78},{"duration":0,"rotate":-1.76}]},{"name":"hair0601","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0101","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0401","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0502","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"hair0402","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0202","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0602","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0102","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0302","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0503","rotateFrame":[{"duration":19,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":7,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0603","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0403","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0103","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0504","rotateFrame":[{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0604","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0605","rotateFrame":[{"duration":13,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":24,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":13,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0505","rotateFrame":[{"duration":6,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":25,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":19,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]}],"ffd":[{"name":"face/10202001","slot":"1046","frame":[{"duration":7,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":33,"tweenEasing":0,"offset":12,"vertices":[-0.05,-3.42,-0.05,-3.42,0,0,-0.05,-3.42,-0.05,-3.42,0,0,-1.72,-2.68,0,0,0,0,0,0,0,0,-1.73,-2.69,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.73,-2.69,-1.73,-2.7,-1.73,-2.7,-1.73,-2.69,-1.73,-2.69,0,0,0,0,0,0,0,0,0,0,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,0,0,-1.72,-2.67,-1.72,-2.66,-1.72,-2.67,-1.72,-2.67,-1.73,-2.7,-1.73,-2.7,-1.73,-2.7,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0,0,-1.73,-2.69,-0.04,-3.4,-0.05,-3.42]},{"duration":10,"tweenEasing":0,"offset":12,"vertices":[-0.05,-3.42,-0.05,-3.42,0,0,-0.05,-3.42,-0.05,-3.42,0,0,-1.72,-2.68,0,0,0,0,0,0,0,0,-1.73,-2.69,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.72,-2.67,-1.73,-2.69,-1.73,-2.7,-1.73,-2.7,-1.73,-2.69,-1.73,-2.69,0,0,0,0,0,0,0,0,0,0,-1.73,-2.68,-1.73,-2.68,-1.73,-2.69,0,0,-1.72,-2.67,-1.72,-2.66,-1.72,-2.67,-1.72,-2.67,-1.73,-2.7,-1.73,-2.7,-1.73,-2.7,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,-0.05,-3.42,-0.05,-3.41,-0.05,-3.42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0.78,2.72,0,0,-1.73,-2.69,-0.04,-3.4,-0.05,-3.42]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]},{"duration":60,"name":"shy","bone":[{"name":"pelvis","translateFrame":[{"duration":10,"curve":[0.25,0,0.75,1],"y":1.88},{"duration":25,"tweenEasing":0,"x":-12.43,"y":3.83},{"duration":17,"tweenEasing":0,"x":0.61,"y":-0.66},{"duration":8,"tweenEasing":0,"x":-12.43,"y":3.83},{"duration":0,"y":1.88}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":1.66},{"duration":17,"tweenEasing":0,"rotate":-1.18},{"duration":8,"tweenEasing":0,"rotate":1.66},{"duration":0}]},{"name":"spine","rotateFrame":[{"duration":10,"curve":[0.25,0,0.75,1]},{"duration":25,"tweenEasing":0,"rotate":-0.31},{"duration":17,"tweenEasing":0,"rotate":-0.19},{"duration":8,"tweenEasing":0,"rotate":-0.31},{"duration":0}]},{"name":"spine1","translateFrame":[{"duration":60,"x":0.84}],"rotateFrame":[{"duration":10,"curve":[0.25,0,0.75,1]},{"duration":25,"tweenEasing":0,"rotate":-0.44},{"duration":17,"tweenEasing":0,"rotate":0.22},{"duration":8,"tweenEasing":0,"rotate":-1.24},{"duration":0}]},{"name":"spine2","translateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"x":2.21,"y":-0.31},{"duration":25,"tweenEasing":0,"x":2.66,"y":-0.29},{"duration":17,"tweenEasing":0,"x":3.63,"y":-0.43},{"duration":8,"tweenEasing":0,"x":2.66,"y":-0.29},{"duration":0,"x":2.21,"y":-0.31}],"rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-1.47},{"duration":17,"tweenEasing":0,"rotate":0.87},{"duration":8,"tweenEasing":0,"rotate":-1.94},{"duration":0}]},{"name":"neck","rotateFrame":[{"duration":10,"tweenEasing":0},{"duration":25,"tweenEasing":0,"rotate":-0.93},{"duration":17,"tweenEasing":0,"rotate":-0.13},{"duration":8,"tweenEasing":0,"rotate":2.05},{"duration":0}]},{"name":"head","rotateFrame":[{"duration":10,"curve":[0.375,0.5,0.75,1],"rotate":6.77},{"duration":25,"tweenEasing":0,"rotate":-2.36},{"duration":17,"tweenEasing":0,"rotate":-5.94},{"duration":8,"tweenEasing":0,"rotate":-3.97},{"duration":0,"rotate":6.77}]},{"name":"bag0101","rotateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":9,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0101","rotateFrame":[{"duration":7,"curve":[0.379,0.6,0.724,1],"rotate":0.35},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.03},{"duration":23,"curve":[0.242,0,0.667,0.67],"rotate":-2.67},{"duration":0,"rotate":0.35}]},{"name":"dress0201","rotateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":9,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0301","rotateFrame":[{"duration":16,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":16,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"bag0102","rotateFrame":[{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0102","rotateFrame":[{"duration":16,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":16,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"dress0202","rotateFrame":[{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0302","rotateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":9,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0103","rotateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":9,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"dress0203","rotateFrame":[{"duration":7,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":23,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0303","rotateFrame":[{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0104","rotateFrame":[{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"dress0204","rotateFrame":[{"duration":16,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":16,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"dress0304","rotateFrame":[{"duration":7,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":23,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"xiong_l","translateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":30,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":7,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"xiong_r","translateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"x":56.32,"y":-30.51},{"duration":30,"curve":[0.25,0,0.75,1],"x":-11.5,"y":3.72},{"duration":7,"curve":[0.276,0,0.621,0.4],"x":61.73,"y":-33.24},{"duration":0,"x":56.32,"y":-30.51}]},{"name":"dress0105","rotateFrame":[{"duration":7,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":23,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"dress0205","rotateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"rotate":-1.08},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":-14.68},{"duration":9,"curve":[0.276,0,0.621,0.4],"rotate":1.99},{"duration":0,"rotate":-1.08}]},{"name":"dress0305","rotateFrame":[{"duration":16,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":16,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hand_l","translateFrame":[{"duration":20,"curve":[0.5,0,0.5,1]},{"duration":30,"curve":[0.5,0,0.5,1],"x":-1.87,"y":58.37},{"duration":10}],"rotateFrame":[{"duration":25,"curve":[0.5,0,0.5,1],"rotate":-0.21},{"duration":25,"curve":[0.5,0,0.5,1],"rotate":-23.33},{"duration":10,"rotate":-0.21}]},{"name":"hand_r","translateFrame":[{"duration":20,"curve":[0.5,0,0.5,1]},{"duration":30,"curve":[0.5,0,0.5,1],"x":-19.32,"y":-32.69},{"duration":10}],"rotateFrame":[{"duration":25,"curve":[0.5,0,0.5,1],"rotate":6.77},{"duration":25,"curve":[0.5,0,0.5,1],"rotate":22.81},{"duration":10,"rotate":6.77}]},{"name":"hair0301","rotateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":9,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0201","rotateFrame":[{"duration":16,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":16,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0501","rotateFrame":[{"duration":7,"curve":[0.379,0.6,0.724,1],"rotate":-1.76},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-1.08},{"duration":23,"curve":[0.242,0,0.667,0.67],"rotate":-4.78},{"duration":0,"rotate":-1.76}]},{"name":"hair0601","rotateFrame":[{"duration":16,"curve":[0.375,0.5,0.75,1],"rotate":-1.43},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":0.77},{"duration":16,"curve":[0.25,0,0.625,0.5],"rotate":-3.63},{"duration":0,"rotate":-1.43}]},{"name":"hair0101","rotateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":9,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0401","rotateFrame":[{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0502","rotateFrame":[{"duration":16,"curve":[0.375,0.5,0.75,1],"rotate":-0.21},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":16,"curve":[0.25,0,0.625,0.5],"rotate":-2.41},{"duration":0,"rotate":-0.21}]},{"name":"hair0402","rotateFrame":[{"duration":7,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":23,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0202","rotateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":9,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0602","rotateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":9,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0102","rotateFrame":[{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0302","rotateFrame":[{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0503","rotateFrame":[{"duration":23,"curve":[0.333,0.33,0.758,1],"rotate":-2.39},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":9,"curve":[0.276,0,0.621,0.4],"rotate":-3.38},{"duration":0,"rotate":-2.39}]},{"name":"hair0603","rotateFrame":[{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0403","rotateFrame":[{"duration":16,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":16,"curve":[0.25,0,0.625,0.5],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0103","rotateFrame":[{"duration":7,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":23,"curve":[0.242,0,0.667,0.67],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0504","rotateFrame":[{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-4.78},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-4.78}]},{"name":"hair0604","rotateFrame":[{"duration":7,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":23,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]},{"name":"hair0605","rotateFrame":[{"duration":16,"curve":[0.375,0.5,0.75,1],"rotate":-3.75},{"duration":28,"curve":[0.25,0,0.75,1],"rotate":-9.5},{"duration":16,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-3.75}]},{"name":"hair0505","rotateFrame":[{"duration":7,"curve":[0.379,0.6,0.724,1],"rotate":-5.26},{"duration":30,"curve":[0.25,0,0.75,1],"rotate":-6.9},{"duration":23,"curve":[0.25,0,0.75,1],"rotate":1.99},{"duration":0,"rotate":-5.26}]}],"slot":[{"name":"20","displayFrame":[{"duration":20,"value":-1},{"duration":40}],"colorFrame":[{"duration":20},{"duration":22,"tweenEasing":0,"value":{"aM":0}},{"duration":8,"tweenEasing":0},{"duration":10,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]}],"ffd":[{"name":"face/10202001","slot":"1046","frame":[{"duration":6,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":14,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-2.03,-5.52,-2.98,-4.71,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":4,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-1.49,-2.73,-2.96,-3.31,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.41,0.44,2.42,5.41,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.81,-3.38,-3.84,-3.79,-3.46,-1.22,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":4,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":4,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-1.49,-2.73,-2.96,-3.31,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":6,"tweenEasing":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1.28,-0.57,0.95,4.58,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.87,-4.09,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]},{"duration":8,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-1.49,-2.73,-2.96,-3.31,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":10,"tweenEasing":0,"vertices":[1.42,8.78,0.5,2.11,0,0,-1.49,-2.73,-2.96,-3.31,0,0,0.97,3.91,0.97,3.91,0,0,0.8,2.08,0.8,2.08,0,0,10.23,17.81,0.58,2.45,0,0,0,0,0,0,7.36,18.68,11.31,36.45,12.06,31.16,7.77,31.25,11.83,16.08,12.9,31.71,13.01,38.14,8.74,31.77,7.48,23.47,11.16,32.44,12.9,31.66,10.26,30.06,5.74,19.14,0.58,3.02,0,0,0,0,0,0,1.89,7.2,10.87,21.44,11.15,29.23,8.96,27.45,1.05,4.82,10.37,26.09,13.56,34.1,10.07,29.5,3.69,16.87,8.31,23.59,6.26,28.65,9.53,28.18,0.97,3.91,0.97,3.91,0.97,3.91,0.97,3.91,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0.8,2.08,0,0,0,0,0,0,0,0,-0.34,1.21,2.94,5.81,2.27,8.22,2.43,5.36,-2.77,-3.96,-3.92,-3.79,-2.87,-3.91,-1.83,-1.32,-1.24,-2.63,1.01,0.48,12.86,23.63,0.97,3.91,0.95,3]},{"duration":0,"offset":6,"vertices":[-2.63,-2.43,-3.26,-3.78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.3,0.69,1.24,5.46,2.19,7.32,0.84,5.03,-4.6,-3.81,-4.7,-4.16,-4.86,-3.94,-4.47,-1.58,-2.7,-1.77,2.34,-0.26]}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/body/body_tex.json b/Egret/Demos/resource/you_xin/body/body_tex.json
index 98e1faa3..f54c9047 100644
--- a/Egret/Demos/resource/you_xin/body/body_tex.json
+++ b/Egret/Demos/resource/you_xin/body/body_tex.json
@@ -1 +1 @@
-{"width":2048,"imagePath":"body_tex.png","height":1024,"name":"body","SubTexture":[{"frameX":-1,"y":475,"frameY":-1,"frameWidth":298,"width":294,"frameHeight":85,"height":83,"name":"logo","x":937},{"width":10,"y":933,"height":10,"name":"blank","x":1},{"width":295,"y":1,"height":472,"name":"body/a_arm_L","x":720},{"width":179,"y":1,"height":1013,"name":"body/a_leg_L","x":263},{"width":274,"y":1,"height":555,"name":"body/a_body","x":444},{"width":260,"y":1,"height":930,"name":"body/a_leg_R","x":1},{"width":215,"y":475,"height":517,"name":"body/a_arm_R","x":720},{"width":202,"y":558,"height":238,"name":"body/a_head","x":444},{"width":141,"y":798,"height":117,"name":"face/10202001","x":444}]}
\ No newline at end of file
+{"width":1024,"SubTexture":[{"width":10,"y":994,"height":10,"name":"blank","x":604},{"width":295,"y":1,"height":472,"name":"body/a_arm_L","x":720},{"width":179,"y":1,"height":1013,"name":"body/a_leg_L","x":263},{"width":274,"y":1,"height":555,"name":"body/a_body","x":444},{"width":260,"y":1,"height":930,"name":"body/a_leg_R","x":1},{"width":215,"y":475,"height":517,"name":"body/a_arm_R","x":720},{"width":202,"y":558,"height":238,"name":"body/a_head","x":444},{"width":158,"y":917,"height":96,"name":"20","x":444},{"width":141,"y":798,"height":117,"name":"face/10202001","x":444}],"height":1024,"name":"body","imagePath":"body_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/body/body_tex.png b/Egret/Demos/resource/you_xin/body/body_tex.png
index 512d5b37..920fb46a 100644
Binary files a/Egret/Demos/resource/you_xin/body/body_tex.png and b/Egret/Demos/resource/you_xin/body/body_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit1/2010600a_ske.json b/Egret/Demos/resource/you_xin/suit1/2010600a_ske.json
new file mode 100644
index 00000000..198c5259
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/2010600a_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"2010600a","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"2010600a","aabb":{"x":-423.8,"y":-1585.42,"width":813.91,"height":984.69},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"length":71,"name":"neck","parent":"spine2","transform":{"x":172.12,"y":0.19,"skX":-17.89,"skY":-17.89}},{"length":88,"name":"head","parent":"neck","transform":{"x":71.14,"y":-0.04,"skX":-13.29,"skY":-13.29}},{"name":"hair","parent":"head","transform":{"x":187.01,"y":-14.39}},{"length":60,"name":"hair0301","parent":"hair","transform":{"x":-22.37,"y":20.04,"skX":170.91,"skY":170.91}},{"length":80,"name":"hair0101","parent":"hair","transform":{"x":-41.95,"y":-73.17,"skX":-167.14,"skY":-167.14}},{"length":100,"name":"hair0501","parent":"hair","transform":{"x":-113.42,"y":-63.08,"skX":-162.11,"skY":-162.11}},{"length":100,"name":"hair0601","parent":"hair","transform":{"x":-131.71,"y":66.14,"skX":-172.88,"skY":-172.88}},{"length":120,"name":"hair0502","parent":"hair0501","transform":{"x":104.79,"y":-0.11,"skX":0.45,"skY":0.45}},{"length":100,"name":"hair0102","parent":"hair0101","transform":{"x":83.27,"y":-0.72,"skX":-5.51,"skY":-5.51}},{"length":70,"name":"hair0302","parent":"hair0301","transform":{"x":63.79,"y":-0.2,"skX":0.51,"skY":0.51}},{"length":120,"name":"hair0602","parent":"hair0601","transform":{"x":100.91,"y":0.05,"skX":2.44,"skY":2.44}},{"length":140,"name":"hair0503","parent":"hair0502","transform":{"x":119.54,"y":-0.01,"skX":0.45,"skY":0.45}},{"inheritScale":false,"length":140,"name":"hair0603","parent":"hair0602","transform":{"x":119.43,"y":-0.01,"skX":0.83,"skY":0.83}},{"length":136,"name":"hair0604","parent":"hair0603","transform":{"x":142.27,"y":-0.51,"skX":-3.46,"skY":-3.46}},{"length":146,"name":"hair0504","parent":"hair0503","transform":{"x":144.09,"y":0.47,"skX":4.95,"skY":4.95}},{"length":159,"name":"hair0605","parent":"hair0604","transform":{"x":136.59,"y":-0.47,"skX":-2.7,"skY":-2.7}},{"length":148,"name":"hair0505","parent":"hair0504","transform":{"x":146.28,"y":1.15,"skX":0.9,"skY":0.9}}],"slot":[{"name":"1058","parent":"root"},{"name":"1004","parent":"root"}],"skin":[{"slot":[{"name":"1004","display":[{"type":"mesh","name":"hair/2010600a","width":528,"height":851,"vertices":[66.31,-1547.32,83.49,-1484.55,96.15,-1431.68,100.1,-1383.56,102.2,-1341.8,105.12,-1299.52,119.48,-1255.23,139.52,-1223.85,191.8,-1193.24,226.91,-1155.12,273.12,-1111.58,303.74,-1071.97,332.19,-1024.1,350.02,-974.85,350.01,-923.3,350,-871.55,330.35,-804.57,320.37,-805.52,336.07,-867.27,341.33,-922.8,335.83,-973.07,312.72,-1021.94,327.8,-972.75,330.84,-922.19,325.37,-869.26,310.42,-811.77,276.8,-746.05,220.97,-715.61,188.85,-715.62,197.31,-748.31,247.33,-771.49,276.46,-816.3,278.75,-868.56,275.05,-918.9,263.06,-870.8,237.7,-837.12,221.23,-837.94,246.64,-872.31,264.4,-921.64,259.18,-966.61,241.36,-1012.86,217.36,-1059.14,190.97,-1064.97,180.76,-1096.5,159.85,-1145.42,122.03,-1173.82,95.13,-1209.67,79.27,-1247.05,64.3,-1291.7,48.08,-1332.81,23.35,-1373.78,6.6,-1402.71,-0.22,-1420.35,-15.56,-1412.91,-3.31,-1394.61,20.8,-1365.49,10.45,-1350.57,-10.99,-1356.54,-26.02,-1380.68,-63.18,-1386.81,-94.89,-1398.65,-114.01,-1417.73,-132.49,-1440.85,-132.31,-1408.19,-125.08,-1376.46,-103.69,-1343.79,-135.16,-1343.34,-162.51,-1365.34,-174.06,-1402.54,-177.63,-1441.4,-177.63,-1484.92,-160.88,-1523.8,-114.27,-1564.81,-28.75,-1566.64,35.86,-1566.64,-13.17,-1477.09,-2.65,-1442.07,-31.7,-1467.86,-64.72,-1518.39,-21.56,-1525.29,-141.43,-1485.07,-59.33,-1412.92,-96.53,-1462.08,-112.9,-1496.39,-124.47,-1537.63,-39.98,-1426.19,-53.18,-1458.05,-80.94,-1508.56,-80.19,-1435.28],"uvs":[0.46203,0.02271,0.49457,0.09645,0.51855,0.15857,0.52603,0.21512,0.53001,0.26419,0.53553,0.31385,0.56274,0.36589,0.60068,0.4028,0.69971,0.43879,0.76621,0.48355,0.85373,0.53472,0.91173,0.58125,0.96563,0.63746,0.9994,0.69535,0.9994,0.75591,0.99939,0.81673,0.96222,0.89543,0.94332,0.89431,0.97301,0.82175,0.98297,0.7565,0.97254,0.69743,0.92875,0.64002,0.95733,0.69779,0.96309,0.75722,0.95276,0.81942,0.92446,0.88697,0.8608,0.96421,0.75508,0.99999,0.69425,0.99999,0.71025,0.96158,0.80498,0.93433,0.86015,0.88166,0.86446,0.82025,0.85744,0.76109,0.83475,0.81762,0.78672,0.8572,0.75553,0.85624,0.80363,0.81587,0.83725,0.75788,0.82735,0.70504,0.79359,0.65072,0.74812,0.59633,0.69815,0.5895,0.6788,0.55244,0.63918,0.49497,0.56756,0.46161,0.51663,0.41948,0.48658,0.37551,0.45822,0.32305,0.42749,0.27477,0.38068,0.2266,0.34895,0.19263,0.33601,0.17189,0.30697,0.18063,0.33017,0.20214,0.37584,0.23635,0.35622,0.25388,0.31562,0.24687,0.28715,0.21851,0.21676,0.2113,0.1567,0.19738,0.1205,0.17495,0.0855,0.14778,0.08585,0.18619,0.09955,0.22347,0.14004,0.26189,0.08045,0.2624,0.02863,0.23655,0.00677,0.19283,0,0.14716,0,0.09603,0.03171,0.05035,0.12,0.00214,0.28198,0,0.40434,0,0.31148,0.10523,0.33142,0.14637,0.2764,0.11606,0.21387,0.05668,0.2956,0.04859,0.06856,0.09583,0.22408,0.1806,0.15361,0.12286,0.12259,0.08255,0.10067,0.03409,0.26071,0.16501,0.23572,0.12758,0.18315,0.06824,0.18456,0.15434],"triangles":[20,19,14,20,14,13,12,20,13,14,19,15,18,16,15,11,21,12,32,25,24,33,32,24,22,33,23,33,24,23,39,33,22,21,39,22,32,31,25,31,26,25,30,26,31,11,40,21,40,39,21,10,41,11,41,40,11,37,34,38,38,34,33,39,38,33,30,27,26,37,35,34,9,43,10,43,41,10,29,27,30,36,35,37,43,42,41,8,44,9,44,43,9,29,28,27,45,44,8,7,45,8,46,45,7,6,46,7,5,47,6,47,46,6,3,49,4,49,48,4,4,48,5,48,47,5,2,50,3,50,49,3,51,50,2,52,51,2,1,76,2,76,52,2,0,75,1,75,76,1,79,75,0,74,79,0,73,79,74,57,56,55,54,57,55,58,57,54,75,77,76,76,53,52,53,58,54,78,77,79,79,77,75,85,58,53,86,85,77,85,81,58,81,59,58,73,78,79,78,86,77,78,87,86,72,78,73,86,88,85,88,81,85,87,82,86,82,88,86,72,84,87,72,87,78,60,59,81,88,60,81,61,60,88,82,61,88,84,83,87,83,82,87,62,61,82,83,80,82,80,62,82,64,66,65,71,84,72,68,67,63,63,67,64,67,66,64,70,69,80,69,68,63,69,63,62,80,69,62,71,70,80,12,21,20,19,18,15,17,16,18,85,77,53,77,53,76,71,84,80,84,80,83],"weights":[1,8,1,2,12,0.19999,8,0.8,3,12,0.73254,16,0.05599,8,0.21145,3,12,0.62515,16,0.296,8,0.07884,2,12,0.49599,16,0.504,2,12,0.112,16,0.88799,3,12,0.02431,16,0.58367,18,0.39199,2,16,0.272,18,0.72799,2,16,0.112,18,0.88799,3,16,0.05478,18,0.80121,19,0.14399,2,18,0.47999,19,0.52,3,18,0.30464,19,0.64735,21,0.04799,3,18,0.06911,19,0.79488,21,0.13598,2,19,0.51199,21,0.488,2,19,0.36799,21,0.632,2,19,0.28799,21,0.712,2,19,0.07999,21,0.92,2,19,0.06398,21,0.936,2,19,0.21599,21,0.784,2,19,0.384,21,0.61599,2,19,0.512,21,0.48799,3,18,0.04185,19,0.83014,21,0.12799,3,12,0.00416,19,0.51582,21,0.47999,2,19,0.35199,21,0.648,2,19,0.20799,21,0.792,2,19,0.09599,21,0.904,1,21,1,1,21,1,1,21,1,1,21,1,1,21,1,2,19,0.09599,21,0.904,2,19,0.176,21,0.82399,2,19,0.37599,21,0.624,2,19,0.21599,21,0.784,2,19,0.10399,21,0.896,2,19,0.10399,21,0.896,2,19,0.24,21,0.76,2,19,0.35199,21,0.648,2,19,0.504,21,0.49599,3,18,0.07814,19,0.80985,21,0.112,3,18,0.26879,19,0.6912,21,0.03999,2,18,0.31199,19,0.688,2,18,0.52,19,0.47999,3,16,0.04262,18,0.84537,19,0.11199,2,16,0.104,18,0.89599,2,16,0.264,18,0.73599,3,12,0.02527,16,0.60671,18,0.368,2,12,0.11999,16,0.88,2,12,0.48,16,0.52,3,12,0.66643,16,0.28799,8,0.04556,3,12,0.44626,16,0.03348,8,0.52025,3,12,0.39585,16,0.02302,8,0.58112,2,8,0.784,15,0.21599,2,8,0.688,15,0.31199,2,8,0.63199,15,0.368,2,8,0.648,15,0.35199,2,8,0.70399,15,0.296,2,8,0.78399,15,0.216,2,8,0.74399,15,0.256,3,8,0.75641,9,0.04559,15,0.19798,3,8,0.64709,9,0.13518,15,0.21771,4,8,0.71206,10,0.19222,9,0.05235,15,0.04335,3,8,0.26495,10,0.47104,14,0.264,3,8,0.28396,10,0.16851,14,0.54751,2,8,0.216,14,0.78399,2,8,0.21599,14,0.784,3,8,0.26093,10,0.16748,14,0.57158,3,8,0.2304,10,0.45183,14,0.31776,2,8,0.52,10,0.47999,2,8,0.824,10,0.176,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,2,12,0.25599,8,0.744,3,8,0.83616,9,0.07868,15,0.08515,2,8,0.904,9,0.09599,1,8,1,2,8,0.808,10,0.19199,3,8,0.77804,9,0.02602,15,0.19592,3,8,0.8087,9,0.14335,15,0.04794,2,8,0.92,9,0.08,1,8,1,3,8,0.84569,9,0.01981,15,0.13448,3,8,0.82528,9,0.08085,15,0.09386,2,8,0.912,9,0.08799,3,8,0.62585,9,0.16292,15,0.21122],"slotPose":[1,0,0,1,0,0],"bonePose":[8,-0.22937,-0.973339,0.973339,-0.22937,-93.038172,-1542.610006,12,0.106958,0.994264,-0.994264,0.106958,1.548844,-1429.582044,16,0.064532,0.997916,-0.997916,0.064532,12.292285,-1329.245565,18,0.05007,0.998746,-0.998746,0.05007,20.009358,-1210.065148,19,0.110255,0.993903,-0.993903,0.110255,27.642178,-1067.999132,21,0.156952,0.987606,-0.987606,0.156952,43.169006,-932.293691,15,0.372016,0.928226,-0.928226,0.372016,-43.959462,-1466.511058,9,0.380263,0.924878,-0.924878,0.380263,-68.401441,-1525.432987,10,0.006981,0.999976,-0.999976,0.006981,-154.635322,-1484.995402,14,0.102966,0.994685,-0.994685,0.102966,-153.33401,-1401.732457],"edges":[69,68,68,67,67,66,66,65,65,64,64,63,63,62,62,61,61,60,60,59,59,58,58,57,57,56,56,55,55,54,54,53,53,52,52,51,51,50,50,49,49,48,48,47,47,46,46,45,45,44,44,43,43,42,42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,74,74,73,73,72,72,71,71,70,70,69],"userEdges":[75,0,76,1,51,2,50,3,49,4,48,5,47,6,46,7,45,8,44,9,43,10,41,11,33,38,23,33,22,39,40,21,21,12,13,20,14,19,75,76,30,26,24,32,31,25,18,15,37,34,69,62,75,77,77,53,52,76,77,78,78,72,73,79,79,75,67,64,68,63,62,80,58,81,82,83,72,84,84,80,83,84,58,85,85,86,86,87,87,72,81,88,88,82]}]},{"name":"1058","display":[{"type":"mesh","name":"hair/2010600a_1","width":291,"height":874,"vertices":[-120.98,-1494.87,-120.99,-1454.3,-126.95,-1423.32,-130.36,-1385.9,-141.84,-1342.49,-164.74,-1303.28,-173.78,-1264.21,-180.52,-1220.58,-188.65,-1181.77,-201.71,-1154.38,-218.83,-1119.05,-253.64,-1081.78,-264.2,-1040.68,-273.76,-996.26,-282.28,-1018.87,-293.29,-995.73,-309.33,-951.97,-324.15,-905.01,-328.6,-877.3,-313.32,-826.76,-273.75,-770.7,-304.69,-789.27,-333.29,-842.76,-329.06,-787.18,-314.72,-733.75,-276.81,-701.82,-239.81,-688.96,-237.38,-654.36,-271.01,-654.35,-317.71,-681.6,-350.44,-731.69,-372,-783.06,-388.59,-843.53,-390.74,-904.16,-382.32,-957.18,-400.09,-904.15,-400.86,-844.68,-385.13,-782.81,-366.82,-731.75,-373.63,-728.52,-397.93,-781.28,-412,-844.69,-412.01,-903.73,-399.22,-959.87,-373.98,-1008.39,-347.81,-1052.4,-312.62,-1094.23,-291.5,-1129.55,-253.43,-1161.42,-230.48,-1188.09,-226.48,-1223.95,-221.01,-1267.67,-226.54,-1305.99,-228.73,-1349.72,-225.39,-1395.57,-226.48,-1442.56,-211.17,-1505.97,-170.72,-1528.33,-131.45,-1528.34],"uvs":[1,0.0383,0.99999,0.08469,0.9795,0.12013,0.96779,0.16293,0.92835,0.21263,0.84966,0.2575,0.8186,0.30218,0.79542,0.35212,0.76748,0.39653,0.7226,0.42786,0.66377,0.4683,0.54416,0.51095,0.50787,0.55798,0.47503,0.60879,0.44575,0.58296,0.40792,0.6094,0.35285,0.65949,0.30192,0.7132,0.28663,0.74489,0.3391,0.80273,0.47501,0.86686,0.36869,0.84561,0.27048,0.78441,0.28496,0.84799,0.3342,0.90913,0.46445,0.94568,0.59158,0.96041,0.59992,1,0.48431,1,0.32388,0.9688,0.21145,0.91149,0.13738,0.8527,0.08045,0.78352,0.07307,0.71417,0.10201,0.65353,0.04096,0.71417,0.03828,0.7822,0.09228,0.85299,0.15514,0.9114,0.13175,0.91511,0.0483,0.85472,0,0.78219,0,0.71466,0.04391,0.65046,0.13067,0.59495,0.22056,0.54458,0.34145,0.4967,0.41403,0.45628,0.54485,0.4198,0.62373,0.3893,0.63748,0.34824,0.65626,0.29822,0.63729,0.25439,0.62977,0.20436,0.64124,0.1519,0.63748,0.09813,0.69006,0.0256,0.82905,0,0.96404,0],"triangles":[55,2,1,56,55,1,56,1,0,57,56,0,58,57,0,54,3,2,55,54,2,54,4,3,53,5,4,54,53,4,53,52,5,51,6,5,52,51,5,51,7,6,51,50,7,50,49,8,50,8,7,49,9,8,48,10,9,49,48,9,48,47,10,47,11,10,19,21,20,14,13,12,26,28,27,25,28,26,46,12,11,47,46,11,25,29,28,18,22,19,24,29,25,45,15,14,45,44,15,44,16,15,30,29,24,23,30,24,44,34,16,34,17,16,22,31,23,31,30,23,33,18,17,34,33,17,32,31,22,32,22,18,33,32,18,37,40,39,43,34,44,37,39,38,35,42,36,42,41,36,42,35,43,36,41,40,36,40,37,35,43,34,19,22,21,14,45,12,45,46,12],"weights":[1,8,1,2,11,0.24,8,0.76,2,11,0.51,8,0.49,3,11,0.74,13,0.07,8,0.19,2,11,0.807991,13,0.191998,2,11,0.28799,13,0.712,3,11,0.09599,13,0.82444,17,0.07955,2,13,0.76,17,0.23999,2,13,0.36799,17,0.632,3,13,0.17817,17,0.74982,20,0.07199,3,13,0.05644,17,0.72755,20,0.216,2,17,0.62399,20,0.376,2,17,0.368,20,0.63199,3,17,0.17971,20,0.75628,22,0.06398,2,17,0.264,20,0.736,3,17,0.12403,20,0.78796,22,0.08799,2,20,0.832,22,0.16799,2,20,0.472,22,0.52799,2,20,0.376,22,0.62399,2,20,0.25599,22,0.744,2,20,0.07199,22,0.928,2,20,0.08799,22,0.912,2,20,0.24,22,0.75999,2,20,0.08,22,0.91999,1,22,1,1,22,1,1,22,1,1,22,1,1,22,1,1,22,1,1,22,1,2,20,0.07199,22,0.928,2,20,0.25599,22,0.744,2,20,0.43999,22,0.56,2,20,0.816,22,0.18399,2,20,0.424,22,0.57599,2,20,0.19999,22,0.8,2,20,0.07199,22,0.928,1,22,1,1,22,1,2,20,0.09599,22,0.904,2,20,0.224,22,0.77599,2,20,0.424,22,0.57599,2,20,0.83199,22,0.168,3,17,0.14348,20,0.80051,22,0.056,2,17,0.392,20,0.60799,2,17,0.63199,20,0.368,3,13,0.05414,17,0.69785,20,0.24799,3,13,0.14105,17,0.78694,20,0.07199,2,13,0.35199,17,0.648,2,13,0.71199,17,0.28799,3,11,0.08799,13,0.83174,17,0.08025,2,11,0.368,13,0.63199,2,11,0.847991,13,0.151998,3,11,0.75,13,0.06,8,0.19,2,11,0.51,8,0.49,2,11,0.24,8,0.76,1,8,1,1,8,1],"slotPose":[1,0,0,1,0,0],"bonePose":[11,-0.080721,0.996737,-0.996737,-0.080721,-128.421235,-1417.745192,13,-0.088547,0.996072,-0.996072,-0.088547,-136.770329,-1313.288269,17,-0.096367,0.995346,-0.995346,-0.096367,-147.34523,-1194.216932,20,-0.181892,0.983318,-0.983318,-0.181892,-161.698553,-1050.842838,22,-0.197315,0.98034,-0.98034,-0.197315,-189.436574,-907.212189,8,-0.22937,-0.973339,0.973339,-0.22937,-93.038172,-1542.610006],"edges":[41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,58,58,57,57,56,56,55,55,54,54,53,53,52,52,51,51,50,50,49,49,48,48,47,47,46,46,45,45,44,44,43,43,42,42,41],"userEdges":[56,1,55,2,54,3,53,4,52,5,51,6,50,7,49,8,48,9,47,10,46,11,45,12,44,15,30,24,29,25,40,37,41,36,33,17,42,35,43,34,34,16,23,31,19,22,22,32]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/2010600a_tex.json b/Egret/Demos/resource/you_xin/suit1/2010600a_tex.json
new file mode 100644
index 00000000..6c100642
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/2010600a_tex.json
@@ -0,0 +1 @@
+{"width":1024,"SubTexture":[{"width":291,"y":1,"height":874,"name":"hair/2010600a_1","x":531},{"width":528,"y":1,"height":851,"name":"hair/2010600a","x":1}],"height":1024,"name":"2010600a","imagePath":"2010600a_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/2010600a_tex.png b/Egret/Demos/resource/you_xin/suit1/2010600a_tex.png
new file mode 100644
index 00000000..354cc073
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit1/2010600a_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_ske.json b/Egret/Demos/resource/you_xin/suit1/20208003_ske.json
new file mode 100644
index 00000000..2198557c
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/20208003_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"20208003","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"20208003","aabb":{"x":-322.07,"y":-1403.52,"width":546.17,"height":1278.26},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":138,"name":"dress0201","parent":"pelvis","transform":{"x":1.75,"y":17.13,"skX":89.26,"skY":89.26}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":161,"name":"dress0202","parent":"dress0201","transform":{"x":138.34,"y":-0.27,"skX":-1.35,"skY":-1.35}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"length":182,"name":"dress0203","parent":"dress0202","transform":{"x":161.4,"y":-0.1,"skX":-0.9,"skY":-0.9}},{"length":195,"name":"upperarm_l","parent":"spine2","transform":{"x":93.55,"y":-65.17,"skX":-179.09,"skY":-179.09}},{"length":71,"name":"neck","parent":"spine2","transform":{"x":172.12,"y":0.19,"skX":-17.89,"skY":-17.89}},{"length":200,"name":"upperarm_r","parent":"spine2","transform":{"x":139.2,"y":93.66,"skX":150.94,"skY":150.94}},{"length":200,"name":"dress0204","parent":"dress0203","transform":{"x":183.88,"y":1.16,"skX":2.25,"skY":2.25}},{"name":"xiong_r","parent":"spine2","transform":{"x":35.43,"y":29.27}},{"name":"xiong_l","parent":"spine2","transform":{"x":11.36,"y":-82.7}},{"length":166,"name":"forearm_l","parent":"upperarm_l","transform":{"x":194.88,"y":0.53,"skX":12.43,"skY":12.43}},{"length":150,"name":"forearm_r","parent":"upperarm_r","transform":{"x":200.51,"y":0.29,"skX":-11.56,"skY":-11.56}},{"length":71,"name":"hand_r","parent":"forearm_r","transform":{"x":150.73,"y":-0.66,"skX":-0.9,"skY":-0.9}},{"length":54,"name":"hand_l","parent":"forearm_l","transform":{"x":166.89,"y":0.14,"skX":5.39,"skY":5.39}}],"slot":[{"name":"1055","parent":"root"},{"name":"1028","parent":"root"},{"name":"1038","parent":"root"},{"name":"1062","parent":"root"},{"name":"1080","parent":"root"}],"skin":[{"slot":[{"name":"1062","display":[{"type":"mesh","name":"cloak/20208003","width":306,"height":219,"vertices":[56.97,-1382.76,81.84,-1373.07,74.47,-1365.06,99.89,-1360.72,110.66,-1340.24,116.24,-1314.88,103.28,-1315.42,90.04,-1307.34,97.68,-1289.88,88.1,-1288.36,83.51,-1260.29,79.62,-1227.2,63.71,-1194.06,40.53,-1186,3.76,-1196.22,-18.89,-1222.85,-36.31,-1246.57,-65.62,-1241.72,-79.22,-1252.65,-84.45,-1242.47,-93.06,-1253.5,-116.8,-1243.46,-138.34,-1222.33,-165.21,-1205.51,-171.83,-1183.22,-185.56,-1183.22,-179.65,-1208.34,-170.62,-1231.81,-158.87,-1251.65,-165.16,-1265.01,-163.08,-1285.67,-189.74,-1276.05,-189.74,-1288.93,-176.78,-1306.39,-160.35,-1315.15,-159.34,-1322.27,-174.46,-1331.68,-170.03,-1338.19,-151.74,-1344.1,-160.02,-1350.55,-145.55,-1359.63,-122.52,-1352.85,-102.34,-1340.35,-87.76,-1317.3,-77.44,-1290.87,-56.3,-1291.63,-56.85,-1308.48,-47.55,-1307.68,-44.87,-1336.5,-28.64,-1362.37,-22.21,-1352.28,-5.63,-1356.77,-2.43,-1375.61,24.97,-1402.21,68.02,-1402.21,46.88,-1356.38,45.73,-1309.28,45.82,-1263.53,43.1,-1224.63,6.05,-1226.81,1.03,-1258.27,-4.49,-1308.5,-122.06,-1315.01,-122.74,-1284.59],"uvs":[0.80631,0.08873,0.88755,0.13307,0.86351,0.16966,0.94655,0.18952,0.98176,0.28294,0.99999,0.39871,0.95763,0.39622,0.91437,0.43319,0.93931,0.51287,0.90802,0.51986,0.89301,0.648,0.88031,0.79912,0.82829,0.95049,0.7525,0.98726,0.63236,0.94054,0.55835,0.81898,0.50142,0.7107,0.4056,0.7328,0.36117,0.68297,0.3441,0.72943,0.31595,0.67897,0.23836,0.72481,0.16793,0.82135,0.08015,0.89816,0.05852,1,0.01367,0.99998,0.03296,0.8853,0.06245,0.77814,0.10089,0.68747,0.08033,0.62639,0.08712,0.5321,0.00001,0.57606,0,0.51724,0.04234,0.43743,0.09606,0.39747,0.09937,0.365,0.04994,0.32203,0.06442,0.29231,0.12422,0.26533,0.09713,0.23586,0.14442,0.19439,0.21968,0.22537,0.28565,0.28244,0.33329,0.3876,0.36698,0.50837,0.43608,0.50487,0.43429,0.42794,0.46468,0.43156,0.47344,0.30005,0.52653,0.1819,0.54754,0.22799,0.60171,0.20751,0.61216,0.12145,0.70173,0,0.84242,0,0.77332,0.20928,0.76953,0.42427,0.76984,0.63318,0.76093,0.81082,0.63986,0.80085,0.62346,0.6573,0.60543,0.42784,0.22118,0.39809,0.21894,0.53704],"triangles":[4,6,5,3,2,4,7,6,4,2,7,4,2,55,7,55,56,7,7,9,8,57,10,9,56,9,7,57,11,10,56,57,9,57,58,11,58,12,11,0,2,1,0,55,2,53,0,54,58,13,12,53,55,0,14,13,58,59,14,58,51,61,56,59,58,57,60,59,57,56,61,57,61,60,57,53,52,55,52,51,55,51,56,55,51,50,61,16,15,60,15,14,59,60,15,59,50,48,61,48,47,61,49,48,50,45,17,16,18,17,45,44,18,45,46,45,47,20,18,44,43,63,44,63,20,44,20,19,18,62,63,43,42,62,43,63,21,20,41,62,42,29,28,63,41,38,62,63,28,21,28,22,21,30,29,63,34,30,63,40,38,41,34,63,62,35,34,62,38,35,62,28,27,22,27,23,22,39,38,40,33,30,34,37,35,38,27,26,23,37,36,35,26,24,23,33,32,30,32,31,30,26,25,24,45,47,16,61,47,60,47,16,60],"weights":[2,7,0.00085,10,0.99914,1,10,1,1,10,1,1,10,1,2,7,0.0672,10,0.93279,2,7,0.22406,10,0.77593,2,7,0.13361,10,0.86637,2,7,0.36938,10,0.63061,2,7,0.81446,10,0.18553,2,7,0.57906,10,0.42093,1,7,0.999986,1,7,0.999973,1,7,1,1,7,1,1,7,0.99998,1,7,0.99999,1,7,1,1,7,1,1,7,1,1,7,1,1,7,0.999989,1,7,0.999981,1,7,0.999954,1,7,0.999904,1,7,1,1,7,1,1,7,1,1,7,1,1,7,0.999986,2,7,0.951981,10,0.047994,2,7,0.504,10,0.49599,2,7,0.512,10,0.48799,2,7,0.19999,10,0.8,2,7,0.22399,10,0.776,2,7,0.128,10,0.87199,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,2,7,0.13598,10,0.864,2,7,0.53576,10,0.46423,2,7,0.74886,10,0.25113,2,7,0.36091,10,0.63908,2,7,0.30809,10,0.6919,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,2,7,0.30472,10,0.69527,1,7,0.999986,1,7,0.999977,1,7,0.999988,1,7,1,2,7,0.16627,10,0.83372,2,7,0.10399,10,0.896,2,7,0.488,10,0.51199],"slotPose":[1,0,0,1,0,0],"bonePose":[7,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,10,0.000524,-1,1,0.000524,-36.134534,-1292.746462],"edges":[32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,54,54,53,53,52,52,51,51,50,50,49,49,48,48,47,47,46,46,45,45,44,44,43,43,42,42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32],"userEdges":[47,16,44,20,28,21,2,55,55,51,0,55,7,56,55,56,10,57,56,57,11,58,57,58,58,13,15,59,59,58,14,59,16,60,60,57,59,60,47,61,61,56,61,51,61,60,62,41,34,62,62,43,21,63,63,62,30,63,63,44,27,22,26,23]}]},{"name":"1038","display":[{"type":"mesh","name":"cloak/20208003_2","width":250,"height":367,"vertices":[-59.37,-1261.08,-67.04,-1224.54,-84.79,-1194.26,-101.6,-1166.77,-118.3,-1134.14,-145.69,-1082.46,-156.91,-1064.79,-165.61,-1049.75,-175.43,-1032.03,-186.62,-1013.09,-223.02,-967.27,-258.88,-930.97,-272.14,-919.04,-302.66,-893.62,-317.9,-893.28,-315.75,-940.66,-313.05,-964.59,-294.77,-1001.8,-256.44,-1020.09,-244.69,-1042.1,-238.63,-1059.66,-232.08,-1079.25,-230.54,-1096.71,-227.16,-1119.38,-193.86,-1166.02,-198.32,-1192.39,-185.93,-1215.9,-144.65,-1246.48,-109.59,-1265,-90.82,-1266.55],"uvs":[1,0.11889,1,0.15905,0.95909,0.19421,0.88941,0.26805,0.81973,0.35595,0.70567,0.4951,0.65922,0.54257,0.62309,0.583,0.58222,0.63069,0.53576,0.68167,0.38616,0.80424,0.23953,0.90096,0.18534,0.9326,0.06098,1,0,1,0.0129,0.87107,0.0258,0.80603,0.10227,0.70579,0.25712,0.65832,0.30607,0.59904,0.33188,0.55158,0.35985,0.49862,0.36759,0.45115,0.38308,0.38962,0.52036,0.26453,0.50487,0.19245,0.55649,0.12916,0.72424,0.0483,0.86618,0,0.91987,0],"triangles":[2,1,0,27,2,0,28,27,0,29,28,0,27,3,2,27,26,3,24,4,3,26,24,3,25,24,26,24,5,4,24,23,5,23,22,5,22,6,5,21,7,6,22,21,6,20,8,7,21,20,7,19,9,8,20,19,8,18,10,9,19,18,9,18,17,10,17,11,10,17,16,11,15,12,11,16,15,11,15,13,12,15,14,13],"weights":[1,7,1,2,9,0.24,7,0.76,2,9,0.49,7,0.51,2,9,0.71,7,0.29,2,9,0.88,7,0.12,2,15,0.00513,9,0.99486,2,15,0.15231,9,0.84768,2,15,0.52915,9,0.47084,2,15,0.92217,9,0.07782,1,15,1,1,15,1,1,15,1,2,15,0.49599,18,0.50399,2,15,0.16799,18,0.83199,2,15,0.10399,18,0.896,3,15,0.63198,18,0.368,9,0.00001,2,15,0.99995,9,0.00004,2,15,0.9999,9,0.00009,1,15,1,2,15,0.96825,9,0.03173,2,15,0.81201,9,0.18798,2,15,0.4776,9,0.52239,2,15,0.21386,9,0.78613,2,15,0.05479,9,0.9452,2,15,0.00006,9,0.99993,2,9,0.89,7,0.11,2,9,0.71,7,0.29,2,9,0.51,7,0.49,2,7,0.76,9,0.24,1,7,1],"slotPose":[1,0,0,1,0,0],"bonePose":[9,-0.322761,0.94648,-0.94648,-0.322761,-122.498835,-1238.098661,15,-0.518922,0.854821,-0.854821,-0.518922,-185.900195,-1053.819626,18,-0.596925,0.802297,-0.802297,-0.596925,-272.622839,-911.231146,7,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497],"edges":[14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14],"userEdges":[21,7,22,6,23,5,20,8,19,9,15,12,11,16,27,2,26,3,24,4]}]},{"name":"1028","display":[{"type":"mesh","name":"cloak/20405006","width":210,"height":409,"vertices":[10.38,-1311.54,22.59,-1298.5,0.7,-1267.22,5.58,-1235.02,16.02,-1200.03,27.02,-1169.58,29.46,-1152.61,18.34,-1130.92,2.06,-1096.72,-9.74,-1058.86,-8.11,-1027.09,-2.86,-1004.03,-30.91,-981.53,-68.36,-951.69,-81.44,-951.3,-113.61,-987.24,-148.19,-951.3,-154.71,-951.31,-170.53,-983.58,-180.11,-1010.96,-172.78,-1026.72,-165.86,-1063.74,-171.16,-1100.79,-174.01,-1141.5,-180.12,-1168.76,-180.52,-1204.48,-144.63,-1235.86,-94.56,-1275.36,-85.28,-1304.21,-75.78,-1328.11,-52.17,-1327.7,-18.51,-1337.23,-1.29,-1360.29,7.12,-1360.28,-52.32,-1299.01,-59.98,-1268.95,-81.5,-1232.13,-97.4,-1201.35,-106.71,-1170.73,-105.5,-1138.34,-98.23,-1097.8,-98.15,-1055.4,-102.7,-1018.4,-62.63,-981.08,-54.91,-1015.84,-52.94,-1056.22,-55.41,-1094.4,-56.2,-1122.83,-52.21,-1170.39,-52.08,-1210.6,-39.48,-1237.57,-27.65,-1265.38,-10.93,-1198.72,-0.84,-1165.76,-16.27,-1129.87,-143.43,-982.89,-138.83,-1018.07,-134.83,-1055.96,-133.54,-1095.8,-142.23,-1128.2,-153.12,-1175.71,-138.83,-1216.17,-115.27,-1238.18,-19.2,-1300.32],"uvs":[0.90915,0.11916,0.96731,0.15101,0.86302,0.22756,0.88629,0.3062,0.93602,0.3918,0.98835,0.46625,0.99999,0.50774,0.94706,0.56077,0.86952,0.64438,0.8133,0.73695,0.82106,0.81459,0.84604,0.87104,0.7125,0.92604,0.5342,0.999,0.47189,1,0.31865,0.91214,0.15397,1,0.12295,0.99999,0.04756,0.92106,0.00193,0.85412,0.03683,0.81559,0.06978,0.72501,0.04458,0.63443,0.03101,0.53489,0.00193,0.46824,0,0.38085,0.17095,0.30421,0.4094,0.20766,0.45358,0.13707,0.49887,0.07866,0.6113,0.07966,0.77159,0.05638,0.85363,0,0.89364,0,0.61054,0.14975,0.57404,0.22333,0.4716,0.31333,0.39588,0.38852,0.35153,0.46339,0.35727,0.54258,0.39188,0.64177,0.39229,0.74545,0.37064,0.83593,0.56144,0.92713,0.59816,0.84213,0.60759,0.74338,0.59583,0.65006,0.59211,0.58053,0.61106,0.46424,0.6117,0.36595,0.67169,0.30004,0.72803,0.23205,0.80767,0.39497,0.85573,0.47555,0.78226,0.56326,0.17663,0.92276,0.19853,0.83672,0.21757,0.74407,0.22375,0.64666,0.18238,0.56742,0.13053,0.45123,0.19853,0.35229,0.31073,0.29851,0.76829,0.14654],"triangles":[33,31,0,4,53,5,5,53,6,53,7,6,32,31,33,52,53,4,54,8,7,0,63,1,63,2,1,3,52,4,53,54,7,31,63,0,50,52,3,2,51,3,51,50,3,63,51,2,46,9,8,54,46,8,52,48,53,48,54,53,10,44,11,44,12,11,47,46,54,50,49,52,46,45,9,9,45,10,45,44,10,31,30,63,49,48,52,34,51,63,30,34,63,48,47,54,44,43,12,43,13,12,35,50,51,34,35,51,36,49,50,35,36,50,40,41,46,40,46,47,42,43,44,41,42,44,28,35,34,29,28,34,29,34,30,36,37,49,39,47,48,38,39,48,49,37,48,37,38,48,41,44,45,46,41,45,28,27,35,39,40,47,14,13,43,42,15,43,27,36,35,15,14,43,27,62,36,62,37,36,59,58,39,57,42,41,58,57,41,58,41,40,39,58,40,62,61,37,26,62,27,57,56,42,55,16,15,56,15,42,26,61,62,56,55,15,60,23,59,18,55,56,25,60,61,20,56,57,21,20,57,59,22,58,21,57,58,22,21,58,17,16,55,19,18,56,18,17,55,20,19,56,26,25,61,23,22,59,24,23,60,25,24,60,59,60,39,38,60,39,38,60,37,61,60,37],"weights":[2,7,0.15491,10,0.84508,2,7,0.48504,10,0.51494,1,7,1,3,5,0.00113,7,0.97849,10,0.02035,2,5,0.03042,7,0.96957,2,5,0.0986,7,0.90139,2,5,0.14194,7,0.85805,3,3,0.00021,5,0.23686,7,0.76292,3,3,0.01969,5,0.50844,7,0.47185,3,3,0.15736,5,0.6842,7,0.15842,3,3,0.41175,5,0.55209,7,0.03613,3,3,0.53826,5,0.4513,7,0.01043,3,3,0.7344,5,0.26556,7,0.00003,2,3,0.98898,5,0.01101,1,3,1,1,3,1,1,3,1,1,3,1,2,3,0.92815,5,0.07184,2,3,0.78129,5,0.2187,2,3,0.65409,5,0.3459,3,3,0.22056,5,0.76325,7,0.01617,3,3,0.02433,5,0.81312,7,0.16253,3,5,0.45722,7,0.46277,14,0.07999,3,5,0.26435,7,0.64764,14,0.08799,3,5,0.14715,7,0.78883,14,0.06398,2,5,0.04432,7,0.95567,1,7,1,2,7,0.54692,10,0.45307,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,2,7,0.39774,10,0.60224,1,7,1,1,7,1,4,5,0.00386,7,0.84246,13,0.08166,14,0.07199,4,5,0.09697,7,0.75678,13,0.07423,14,0.07199,4,5,0.35108,7,0.49531,13,0.07359,14,0.07999,1,5,1,1,5,1,2,3,0.72954,5,0.27045,2,3,0.82483,5,0.17516,3,3,0.65688,5,0.33963,7,0.00347,3,3,0.14195,5,0.77117,7,0.08686,3,3,0.00518,5,0.76677,7,0.22804,3,5,0.42745,7,0.50054,13,0.07199,3,5,0.05388,7,0.72211,13,0.22399,2,7,0.92,13,0.07999,1,7,1,1,7,1,3,5,0.01021,7,0.91777,13,0.07199,3,5,0.09414,7,0.83385,13,0.07199,4,3,0.0006,5,0.25633,7,0.65504,13,0.08799,2,3,0.95685,5,0.04314,2,3,0.64932,5,0.35067,3,3,0.11891,5,0.87438,7,0.0067,3,3,0.02572,5,0.92638,7,0.04789,3,5,0.57535,7,0.34464,14,0.07999,3,5,0.1627,7,0.61329,14,0.22399,3,5,0.06313,7,0.84084,14,0.096,2,5,0.00801,7,0.99197,2,7,0.30377,10,0.69621],"slotPose":[1,0,0,1,0,0],"bonePose":[7,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,10,0.000524,-1,1,0.000524,-36.134534,-1292.746462,5,0.133294,-0.991076,0.991076,0.133294,-102.984795,-1028.747532,3,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04,14,0.307689,-0.951487,0.951487,0.307689,-164.467343,-1165.289724,13,0.307689,-0.951487,0.951487,0.307689,-50.523269,-1153.740106],"edges":[25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25],"userEdges":[28,34,30,34,27,35,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,15,12,43,43,15,13,43,10,44,44,42,43,44,9,45,45,41,44,45,8,46,46,40,45,46,47,39,46,47,48,38,47,48,49,37,49,48,3,50,50,36,49,50,2,51,51,35,50,51,4,52,52,49,3,52,5,53,53,48,52,53,7,54,54,47,53,54,54,46,18,55,55,15,16,55,20,56,56,42,55,56,21,57,57,41,56,57,22,58,58,40,23,59,59,39,58,59,57,58,24,60,60,38,59,60,25,61,61,37,60,61,26,62,62,36,61,62,60,23,60,39,60,37,25,60,37,48,48,39,48,54,48,52,0,63,63,34,51,63,63,31,27,62]}]},{"name":"1080","display":[{"type":"mesh","name":"cloak/20208003_1","width":230,"height":470,"vertices":[97.54,-1239.95,112.36,-1205.39,114.22,-1175.15,100.02,-1144.29,127.23,-1097,128.47,-1063.67,126.01,-1044.53,132.8,-1026.02,138.96,-1002.55,180.57,-960.22,187.07,-941.19,190.79,-918.59,190.17,-895.13,203.19,-851.69,203.18,-806.85,193.21,-806.86,181.48,-839.34,151.29,-878.48,133.4,-896.38,117.97,-917.37,76.01,-986.53,63.67,-1008.75,41.45,-1068,25.71,-1121.01,8.67,-1167.11,-6.76,-1199.82,-11.66,-1212.42,-6.11,-1248.21,35.86,-1250.68,66.1,-1276.9,79.03,-1276.91,56.89,-1027.25,50.1,-1045.16,47.77,-1221.76,57.25,-1179.74,73.52,-1079.38,77.49,-1051.64,82.2,-1033.6,66.83,-1134.27],"uvs":[0.54073,0.07864,0.60513,0.15217,0.61318,0.21652,0.55146,0.28218,0.66968,0.38277,0.67505,0.45368,0.66431,0.49439,0.69383,0.53378,0.72066,0.58368,0.90156,0.67371,0.92982,0.71421,0.94607,0.76227,0.94339,0.81217,0.99999,0.90461,1,1,0.95666,1,0.90567,0.93088,0.77433,0.84763,0.69651,0.80955,0.62943,0.7649,0.44696,0.61782,0.39329,0.57055,0.29669,0.44449,0.22832,0.33166,0.15432,0.23359,0.08723,0.16399,0.06591,0.1372,0.09006,0.06105,0.27253,0.05579,0.40402,0,0.46023,0,0.36377,0.53116,0.33425,0.49307,0.32433,0.11734,0.36552,0.20673,0.43615,0.42029,0.45337,0.4793,0.47387,0.51769,0.40711,0.30351],"triangles":[32,22,21,17,16,12,16,15,14,16,14,13,12,16,13,10,18,11,11,18,12,18,17,12,9,19,10,19,18,10,8,19,9,31,32,21,20,19,8,7,20,8,4,35,5,6,37,7,3,35,4,36,6,5,35,36,5,38,35,3,36,37,6,1,34,2,34,3,2,0,33,1,33,34,1,34,38,3,30,29,0,29,33,0,28,33,29,38,23,35,36,31,37,31,21,37,23,22,35,35,22,36,22,32,36,32,31,36,34,24,38,24,23,38,25,24,33,33,24,34,28,26,33,26,25,33,27,26,28,20,21,7,37,21,7],"weights":[1,11,0.99999,1,11,0.99999,1,11,0.99999,1,11,0.99999,2,11,0.98053,16,0.01946,2,11,0.79682,16,0.20317,2,11,0.48172,16,0.51827,2,11,0.15387,16,0.84612,2,11,0.01137,16,0.98862,2,16,0.95999,17,0.04,2,16,0.896,17,0.10399,2,16,0.528,17,0.47199,2,16,0.14399,17,0.856,1,17,1,1,17,1,1,17,1,1,17,1,2,16,0.176,17,0.82399,2,16,0.48,17,0.51999,2,16,0.91999,17,0.08,1,16,1,2,11,0.12354,16,0.87645,1,11,1,1,11,0.999989,1,11,0.999977,1,11,0.999958,1,11,0.999687,1,11,0.999583,1,11,0.999977,1,11,0.999984,1,11,0.999988,2,11,0.5443,16,0.45569,2,11,0.90424,16,0.09575,1,11,1,1,11,0.99999,1,11,1,1,11,1,2,11,0.5,16,0.5,1,11,1],"slotPose":[1,0,0,1,0,0],"bonePose":[11,0.193207,0.981158,-0.981158,0.193207,42.671847,-1232.663838,16,0.385906,0.922538,-0.922538,0.385906,81.127245,-1035.875814,17,0.400349,0.916363,-0.916363,0.400349,139.903737,-897.076346],"edges":[26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,30,30,29,29,28,28,27,27,26],"userEdges":[21,7,20,8,18,11,17,12,16,13,21,31,31,32,32,22,25,33,33,0,28,33,24,34,34,1,33,34,22,35,35,4,32,36,36,5,35,36,31,37,37,6,36,37,34,38,38,35,23,38,38,3,19,10]}]},{"name":"1055","display":[{"type":"mesh","name":"cloak/20208003_3","width":517,"height":1259,"vertices":[-48.32,-1294.8,22.79,-1196.01,60.42,-1175.28,61.86,-1105.92,72.09,-1039.51,110.78,-971.09,156.33,-892.32,201.96,-815.78,201.95,-711.41,201.93,-613.14,201.91,-505.83,201.9,-405.03,201.91,-311.96,201.93,-208.53,201.93,-94.59,176.31,-94.59,78.33,-202.34,45.42,-304.86,5.58,-397.46,-58.73,-504.87,-41.41,-607.37,-19.92,-714.09,-5.67,-810.73,-25.84,-877.18,-42.87,-963.4,-50.91,-1031.8,-135.45,-1036.69,-122.88,-979.45,-109.64,-923.53,-98.54,-834.52,-79.33,-746.25,-83.13,-663.51,-143.91,-563.62,-172.78,-458.19,-193.07,-364.84,-266.76,-266.56,-290.51,-260.09,-300.86,-362.23,-303.45,-457.95,-306,-565.26,-315.02,-659.24,-315.01,-738.1,-315.02,-829.9,-315.03,-913.12,-249.46,-976.92,-208.92,-1037.85,-168.44,-1113.55,-107.79,-1277.74,-155.64,-1334.89,-144.01,-1353.52,-101.34,-1353.52,-44.45,-1326.37,-89.69,-1265.07,-137.4,-1101.81,-24.74,-1101.67,23.12,-1104.02,23.03,-1036.41,37.44,-967.42,59.73,-884.3,89.34,-813.04,94.3,-712.7,84.07,-610.33,81.39,-505.39,84.09,-400.49,96.89,-307.19,-246.87,-363.53,-239.27,-458.07,-226.35,-564.46,-205.4,-661.26,-204.24,-741.93,-204.34,-832.25,-203.81,-918.75,-201.56,-977.87],"uvs":[0.51585,0.04663,0.6534,0.12511,0.72619,0.14158,0.72894,0.19666,0.7487,0.24941,0.82357,0.30374,0.91171,0.36628,0.99999,0.42708,0.99999,0.50999,0.99999,0.58804,0.99998,0.67328,0.99999,0.75339,0.99999,0.82733,1,0.90949,1,1,0.95045,1,0.76094,0.9144,0.69729,0.83296,0.62025,0.7594,0.49584,0.67408,0.5293,0.59267,0.57084,0.50791,0.59838,0.43116,0.55937,0.37838,0.52642,0.30987,0.51085,0.25554,0.34732,0.25165,0.37162,0.29713,0.39726,0.34155,0.41875,0.41225,0.45591,0.48237,0.44858,0.54808,0.33105,0.62743,0.27525,0.71117,0.236,0.78532,0.09345,0.86337,0.04751,0.86851,0.02751,0.78738,0.0225,0.71138,0.0175,0.62614,0,0.55148,0.00001,0.48884,0.00001,0.41592,0,0.3498,0.12682,0.29913,0.20522,0.25073,0.28352,0.19061,0.40083,0.06018,0.30827,0.0148,0.33078,0,0.41331,0,0.52335,0.02156,0.43582,0.07026,0.34354,0.19993,0.56147,0.20004,0.65402,0.19817,0.65382,0.25186,0.68173,0.30666,0.72487,0.37269,0.78216,0.42929,0.79176,0.50898,0.77201,0.59028,0.76688,0.67365,0.77213,0.757,0.79686,0.83111,0.13193,0.78635,0.14664,0.71128,0.17158,0.62678,0.21206,0.54988,0.21428,0.4858,0.21408,0.41405,0.21512,0.34533,0.21945,0.29838],"triangles":[16,15,13,64,16,13,6,59,7,59,60,7,64,13,12,13,15,14,64,12,11,63,64,11,62,63,11,62,11,10,61,62,10,61,10,9,60,61,9,60,9,8,7,60,8,5,58,6,58,59,6,59,22,60,63,17,64,17,16,64,4,57,5,57,58,5,62,18,63,18,17,63,20,62,61,21,61,60,22,21,60,21,20,61,56,57,4,20,19,62,58,22,59,3,56,4,19,18,62,55,56,3,2,55,3,57,23,58,23,22,58,1,55,2,1,54,55,56,24,57,24,23,57,54,56,55,52,54,1,0,52,1,54,25,56,25,24,56,52,53,54,53,25,54,46,53,52,53,26,25,50,47,0,50,0,51,47,52,0,48,47,50,47,46,52,68,32,31,69,68,31,69,31,30,29,69,30,70,69,29,71,70,28,49,48,50,28,70,29,27,71,28,53,46,26,26,72,27,72,71,27,67,33,32,68,67,32,46,45,26,45,72,26,65,35,34,66,34,33,67,66,33,66,65,34,40,67,68,71,43,70,43,42,70,41,68,69,70,42,69,42,41,69,44,71,72,45,44,72,40,39,67,41,40,68,39,66,67,44,43,71,39,38,66,37,35,65,38,37,65,38,65,66,37,36,35],"weights":[2,10,0.5,7,0.5,1,11,1,1,11,1,1,11,1,2,16,0.49,11,0.51,3,16,0.57,17,0.18,11,0.25,2,17,0.51,16,0.49,1,17,1,3,4,0.09,6,0.43,17,0.48,3,6,0.43,8,0.35,17,0.22,3,8,0.83,12,0.08,17,0.09,2,8,0.40799,12,0.592,2,8,0.05599,12,0.944,1,12,1,1,12,1,1,12,1,1,12,1,2,8,0.07199,12,0.928,2,8,0.352,12,0.64799,2,8,0.928,12,0.07199,3,6,0.45,8,0.45,17,0.1,3,4,0.13,6,0.69,17,0.18,4,4,0.64,6,0.08,17,0.19,16,0.09,3,4,0.71,16,0.2,17,0.09,2,4,0.75,16,0.25,3,4,0.46,7,0.35,11,0.19,4,4,0.19,15,0.24,9,0.27,7,0.3,3,4,0.53,15,0.32,9,0.15,3,4,0.67,15,0.21,18,0.12,3,4,0.72,6,0.07,18,0.21,3,4,0.37,6,0.44,18,0.19,4,4,0.02,6,0.77,8,0.08,18,0.13,2,6,0.39999,8,0.6,2,8,0.864,12,0.13598,2,8,0.17599,12,0.824,1,12,1,1,12,1,2,8,0.16,12,0.83999,2,8,0.89599,12,0.104,2,6,0.391989,8,0.607989,4,4,0.05,6,0.73,8,0.07,18,0.15,3,4,0.31,6,0.45,18,0.24,3,4,0.49,6,0.04,18,0.47,1,18,1,2,15,0.82,9,0.18,2,9,0.52,15,0.48,1,9,1,2,10,0.73,7,0.27,1,10,1,1,10,1,1,10,1,2,10,0.74,7,0.26,2,10,0.51,7,0.49,2,9,0.49,7,0.51,2,7,0.26,11,0.74,2,11,0.88,7,0.12,2,16,0.49,11,0.51,3,16,0.51,4,0.33,11,0.16,3,4,0.33,16,0.43,17,0.24,4,4,0.39,6,0.04,17,0.44,16,0.13,3,4,0.11,6,0.63,17,0.26,3,6,0.43,8,0.38,17,0.19,2,8,0.91999,12,0.079988,2,8,0.38399,12,0.616,2,8,0.07199,12,0.928,2,8,0.16799,12,0.832,2,8,0.88799,12,0.112,2,6,0.424,8,0.57599,4,4,0.08,6,0.72,8,0.07,18,0.13,3,4,0.34,6,0.41,18,0.25,3,4,0.54,6,0.05,18,0.41,3,4,0.35,18,0.35,15,0.3,2,15,0.77,9,0.23],"slotPose":[1,0,0,1,0,0],"bonePose":[4,0.012915,0.999917,-0.999917,0.012915,-105.43,-895.87,6,0.036469,0.999335,-0.999335,0.036469,-103.373351,-757.545025,8,0.052162,0.998639,-0.998639,0.052162,-97.387273,-596.256039,12,0.012915,0.999917,-0.999917,0.012915,-88.954208,-412.565856,7,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,10,0.000524,-1,1,0.000524,-36.134534,-1292.746462,9,-0.322761,0.94648,-0.94648,-0.322761,-122.498835,-1238.098661,15,-0.518922,0.854821,-0.854821,-0.518922,-185.900195,-1053.819626,16,0.385906,0.922538,-0.922538,0.385906,81.127245,-1035.875814,17,0.400349,0.916363,-0.916363,0.400349,139.903737,-897.076346,18,-0.596925,0.802297,-0.802297,-0.596925,-272.622839,-911.231146,11,0.193207,0.981158,-0.981158,0.193207,42.671847,-1232.663838],"edges":[40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,51,51,50,50,49,49,48,48,47,47,46,46,45,45,44,44,43,43,42,42,41,41,40],"userEdges":[52,0,47,52,47,50,53,46,1,54,54,25,26,53,45,26,16,13,3,55,55,54,1,55,4,56,56,25,55,56,5,57,57,24,56,57,6,58,58,23,57,58,7,59,59,22,58,59,8,60,60,21,59,60,9,61,61,20,60,61,10,62,62,19,61,62,11,63,63,18,62,63,12,64,64,17,63,64,64,16,34,65,65,37,35,65,33,66,66,38,65,66,32,67,67,39,66,67,31,68,68,40,67,68,30,69,69,41,68,69,29,70,70,42,69,70,28,71,71,43,70,71,27,72,72,44,71,72,72,45]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_tex.json b/Egret/Demos/resource/you_xin/suit1/20208003_tex.json
new file mode 100644
index 00000000..da99755a
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/20208003_tex.json
@@ -0,0 +1 @@
+{"width":1024,"SubTexture":[{"width":517,"y":1,"height":1259,"name":"cloak/20208003_3","x":1},{"width":210,"y":1631,"height":409,"name":"cloak/20405006","x":233},{"width":250,"y":1262,"height":367,"name":"cloak/20208003_2","x":233},{"width":306,"y":1631,"height":219,"name":"cloak/20208003","x":445},{"width":230,"y":1262,"height":470,"name":"cloak/20208003_1","x":1}],"height":2048,"name":"20208003","imagePath":"20208003_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/20208003_tex.png b/Egret/Demos/resource/you_xin/suit1/20208003_tex.png
new file mode 100644
index 00000000..ea05c536
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit1/20208003_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit1/20509005_ske.json b/Egret/Demos/resource/you_xin/suit1/20509005_ske.json
new file mode 100644
index 00000000..ad16ad48
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/20509005_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"20509005","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"20509005","aabb":{"x":-454.41,"y":-1233.09,"width":790,"height":994},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":154,"name":"dress0101","parent":"pelvis","transform":{"x":-82.25,"y":-25.45,"skX":102.82,"skY":102.82}},{"length":138,"name":"dress0201","parent":"pelvis","transform":{"x":1.75,"y":17.13,"skX":89.26,"skY":89.26}},{"length":169,"name":"dress0301","parent":"pelvis","transform":{"x":113.59,"y":-30.15,"skX":74.24,"skY":74.24}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":176,"name":"dress0102","parent":"dress0101","transform":{"x":154.48,"y":1.04,"skX":-1.8,"skY":-1.8}},{"length":161,"name":"dress0202","parent":"dress0201","transform":{"x":138.34,"y":-0.27,"skX":-1.35,"skY":-1.35}},{"length":161,"name":"dress0302","parent":"dress0301","transform":{"x":169.23,"y":-0.5,"skX":2.25,"skY":2.25}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":182,"name":"dress0203","parent":"dress0202","transform":{"x":161.4,"y":-0.1,"skX":-0.9,"skY":-0.9}},{"length":181,"name":"dress0303","parent":"dress0302","transform":{"x":162.95,"y":-0.17,"skX":-1.36,"skY":-1.36}},{"length":171,"name":"dress0103","parent":"dress0102","transform":{"x":176.75,"y":-0.35,"skX":-0.9,"skY":-0.9}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"length":193,"name":"dress0104","parent":"dress0103","transform":{"x":171.1,"y":-0.63}},{"length":200,"name":"dress0204","parent":"dress0203","transform":{"x":183.88,"y":1.16,"skX":2.25,"skY":2.25}},{"length":192,"name":"dress0304","parent":"dress0303","transform":{"x":181.23,"y":-0.11}},{"name":"xiong_l","parent":"spine2","transform":{"x":11.36,"y":-82.7}},{"name":"xiong_r","parent":"spine2","transform":{"x":35.43,"y":29.27}}],"slot":[{"name":"1029","parent":"root"}],"skin":[{"slot":[{"name":"1029","display":[{"type":"mesh","name":"dress/20509005","width":790,"height":994,"vertices":[18.78,-1123.19,-2.86,-1081.34,-8.85,-1044.44,36.06,-1039.03,68.73,-999.26,83.21,-955.75,81.51,-914.96,115.9,-883.03,159.76,-917.07,191.7,-920.33,184.33,-872.83,257.23,-823.25,304.1,-747.27,327.94,-660.45,327.96,-579.68,308.31,-491.22,294.29,-399.31,317.23,-322.73,287.5,-258.55,229.04,-223.13,135.7,-196.84,31.64,-179.07,-79.66,-179.06,-209.42,-179.09,-330.89,-179.16,-423.11,-207.17,-453.72,-295.45,-410.27,-383.89,-454.01,-477.43,-462.15,-565.89,-462.08,-638.58,-449.43,-724.45,-443.02,-808.62,-345.07,-878.73,-252.64,-876.51,-250.17,-910.08,-253.13,-950.34,-234.42,-994.34,-176.58,-1031.88,-172.83,-1081.8,-176.05,-1119.82,-176.27,-1141.66,-140.6,-1149.29,-110.18,-1173.06,-43.98,-1136.56,27.67,-1145.05,-101.68,-1124.38,-99.95,-1077.37,-102.76,-1031.6,-105.3,-987.14,-110.6,-934.88,-113.98,-887.61,-116.51,-840.95,-117.6,-776.61,-120,-700.09,-116.21,-617.22,-108.29,-528.17,-101.4,-433.92,-85.2,-340.01,-79.84,-256.97,-48.63,-1107.32,-50.63,-1078.07,-53.16,-1033.3,-46.51,-990.5,-40.41,-937.48,-35.79,-889.4,-35.63,-842.13,-26.62,-779.9,-19.18,-702.83,-9.76,-621.21,-0.82,-531.1,8.29,-441.33,18.03,-347.17,25.92,-261.46,14.58,-990.7,26.83,-946.25,36.01,-899.85,47.48,-852.91,71.21,-787.16,85.86,-707.81,96.23,-628.21,105.07,-539.53,109,-448.99,113.62,-356.84,121.49,-277.64,163.29,-799.25,189.82,-719.93,208.52,-639.95,210.36,-554.86,207.2,-464.85,201.81,-371.86,212.11,-294.18,-141.16,-1109.82,-138.75,-1078.32,-141.42,-1032.62,-162.2,-988.08,-174,-939.88,-185.58,-894.25,-197.84,-848.14,-214.02,-784.3,-222.86,-701.75,-222.85,-618.91,-215.41,-526.45,-209.52,-439.74,-207.46,-345.54,-206.34,-262.71,-304.6,-789.2,-332.4,-708.45,-337.53,-625.8,-335.48,-539.62,-327.81,-446.86,-321.47,-357.25,-330.87,-273.77],"uvs":[0.60862,0.05015,0.58123,0.09225,0.57364,0.12937,0.63049,0.13482,0.67185,0.17481,0.69018,0.2186,0.68804,0.25962,0.73158,0.29175,0.7871,0.25752,0.82753,0.25423,0.8182,0.30202,0.91049,0.3519,0.9698,0.42835,1,0.51569,1,0.59695,0.97512,0.68594,0.95736,0.77839,0.98639,0.85544,0.94874,0.91999,0.87476,0.95562,0.75662,0.98208,0.62494,0.99998,0.48411,1,0.31998,0.99999,0.16639,0.99998,0.04963,0.97184,0.01085,0.88303,0.0658,0.79405,0.01036,0.69994,0,0.61096,0.00005,0.53782,0.01603,0.45142,0.0241,0.36673,0.14807,0.29616,0.26507,0.29835,0.26817,0.26456,0.26442,0.22407,0.2881,0.1798,0.36131,0.14203,0.36606,0.09178,0.36198,0.05355,0.3617,0.03157,0.40686,0.02389,0.44537,0,0.52918,0.03669,0.61987,0.02816,0.45613,0.04895,0.45831,0.09625,0.45476,0.1423,0.45156,0.18703,0.44484,0.23961,0.44057,0.28716,0.43739,0.33412,0.43601,0.39883,0.43299,0.47582,0.43782,0.55917,0.44787,0.64876,0.45661,0.74358,0.47712,0.83807,0.48388,0.92162,0.5233,0.0661,0.52076,0.09553,0.51755,0.14059,0.52598,0.18364,0.5337,0.23699,0.53956,0.28536,0.53977,0.33292,0.55118,0.39551,0.5606,0.47304,0.57253,0.55515,0.58386,0.64581,0.5954,0.73612,0.60775,0.83087,0.61772,0.91711,0.6033,0.18342,0.61882,0.22816,0.63046,0.27485,0.64498,0.32206,0.67503,0.38821,0.69356,0.46804,0.70669,0.5481,0.71788,0.63733,0.72285,0.7284,0.72869,0.82112,0.73863,0.9008,0.79158,0.37604,0.82517,0.45584,0.84883,0.53631,0.85114,0.6219,0.84713,0.71246,0.84031,0.806,0.85333,0.88414,0.40615,0.0636,0.40919,0.09528,0.40581,0.14128,0.37952,0.18609,0.36458,0.23457,0.34994,0.28049,0.33446,0.32689,0.31399,0.39111,0.30283,0.47418,0.30288,0.55751,0.3123,0.65052,0.3198,0.73776,0.32244,0.83252,0.32387,0.91587,0.19933,0.38623,0.16418,0.46748,0.15772,0.55063,0.16037,0.63732,0.17013,0.73066,0.17822,0.82082,0.16636,0.9048],"triangles":[86,87,12,12,87,13,88,15,14,13,87,14,87,88,14,89,16,15,91,18,17,16,90,17,90,91,17,88,89,15,11,86,12,89,90,16,91,19,18,85,86,11,10,85,11,91,84,19,84,20,19,82,90,89,81,82,89,86,80,87,87,80,88,80,81,88,81,89,88,90,83,91,83,84,91,82,83,90,79,80,86,8,10,9,7,85,10,85,79,86,8,7,10,7,78,85,78,79,85,77,78,7,84,73,20,73,21,20,81,70,82,70,71,82,82,71,83,71,72,83,83,72,84,72,73,84,80,70,81,6,77,7,69,70,80,79,69,80,76,77,6,68,69,79,67,68,78,75,6,5,4,75,5,78,68,79,75,76,6,74,75,4,77,67,78,3,74,4,66,67,77,76,65,77,65,66,77,64,65,75,72,59,73,59,22,73,73,22,21,2,74,3,75,65,76,71,58,72,58,59,72,74,64,75,44,0,45,70,57,71,57,58,71,2,63,74,63,64,74,60,1,0,44,60,0,56,57,70,69,56,70,62,63,2,68,55,69,55,56,69,61,2,1,60,61,1,54,55,68,61,62,2,53,54,67,67,54,68,52,53,66,66,53,67,63,49,64,49,50,64,51,52,66,64,50,65,50,51,65,51,66,65,43,46,44,48,49,62,47,62,61,62,49,63,46,60,44,47,48,62,47,61,60,46,47,60,57,104,58,104,105,58,58,105,59,23,22,59,105,23,59,55,102,56,102,103,56,95,50,49,94,49,48,93,94,48,43,42,46,56,103,57,103,104,57,93,48,47,46,92,47,92,93,47,42,92,46,101,102,55,94,95,49,54,101,55,96,51,50,95,96,50,99,100,54,100,101,54,99,54,53,98,53,52,96,97,51,98,99,53,97,52,51,97,98,52,38,95,94,39,38,94,41,40,42,42,40,92,92,39,93,39,94,93,40,39,92,37,96,95,38,37,95,37,36,96,35,97,96,36,35,96,34,98,97,35,34,97,102,110,103,103,111,104,111,112,104,24,23,105,112,24,105,104,112,105,34,99,98,101,109,102,106,100,99,34,106,99,110,111,103,108,101,100,109,110,102,108,109,101,106,107,100,107,108,100,33,106,34,110,27,111,32,107,106,33,32,106,32,31,107,27,26,112,112,25,24,109,28,110,27,112,111,108,29,109,30,108,107,31,30,107,28,27,110,26,25,112,30,29,108,29,28,109],"weights":[2,10,0.6,14,0.39999,3,6,0.0599,10,0.87609,14,0.064,2,6,0.51999,10,0.48,2,6,0.52799,10,0.472,3,6,0.84633,10,0.08799,2,0.06566,3,5,0.168,6,0.4526,2,0.37939,6,3,0.00002,5,0.47749,9,0.02299,12,0.00123,6,0.104,2,0.39423,3,5,0.77235,9,0.20776,12,0.01987,3,5,0.67813,9,0.28886,12,0.033,3,5,0.66669,9,0.29875,12,0.03454,3,5,0.60164,9,0.34686,12,0.05149,3,5,0.34107,9,0.48889,12,0.17001,5,5,0.1823,9,0.49726,12,0.31832,17,0.00209,6,0.00001,4,5,0.07941,9,0.3965,12,0.49407,17,0.02999,4,5,0.02752,9,0.25626,12,0.61143,17,0.10477,4,5,0.00317,9,0.0986,12,0.55979,17,0.33842,3,9,0.00997,12,0.24785,17,0.74217,3,5,0.00001,12,0.05048,17,0.9495,2,12,0.01357,17,0.98642,1,17,0.99999,2,16,0.2255,17,0.77449,2,16,0.66213,17,0.33786,3,15,0.11999,16,0.78412,17,0.09587,2,15,0.48216,16,0.51783,2,15,0.97702,16,0.02297,1,15,1,1,15,1,3,7,0.01098,13,0.20588,15,0.78313,4,3,0.00179,7,0.11135,13,0.5623,15,0.32453,4,3,0.02181,7,0.29289,13,0.56316,15,0.12212,4,3,0.06466,7,0.47084,13,0.42464,15,0.03984,4,3,0.17184,7,0.59876,13,0.22473,15,0.00465,3,3,0.28515,7,0.60846,13,0.10637,3,3,0.471,7,0.49976,13,0.02923,3,3,0.83616,7,0.16165,13,0.00217,4,3,0.46559,7,0.01593,6,0.08799,2,0.43046,3,3,0.104,6,0.50892,2,0.38707,3,6,0.85376,10,0.07199,2,0.07423,2,6,0.528,10,0.47199,3,6,0.07295,10,0.83903,14,0.08799,3,10,0.5376,14,0.4224,18,0.03999,3,10,0.41951,14,0.50048,18,0.08,3,10,0.42668,14,0.47731,18,0.096,4,10,0.25882,14,0.63985,19,0.05331,18,0.04799,3,10,0.4014,14,0.49459,19,0.10399,2,10,0.472,14,0.52799,4,10,0.44197,14,0.44909,19,0.06092,18,0.048,2,6,0.05599,10,0.944,2,6,0.504,10,0.49599,2,6,0.952,10,0.04799,2,6,0.59199,2,0.408,3,3,0.07999,4,0.368,2,0.55198,3,3,0.07999,4,0.86848,5,0.05152,5,3,0.07103,7,0.112,4,0.3758,8,0.3758,5,0.06535,3,7,0.18399,8,0.74419,9,0.0718,6,7,0.18418,13,0.07999,11,0.21114,8,0.39949,9,0.04863,12,0.07654,6,7,0.0067,13,0.25353,15,0.00393,11,0.60436,8,0.04002,12,0.09142,6,13,0.11059,15,0.136,16,0.29971,11,0.29971,12,0.0756,17,0.07835,3,15,0.184,16,0.68543,17,0.13056,3,15,0.11999,16,0.74623,17,0.13376,3,10,0.55883,14,0.38515,19,0.05599,3,6,0.02918,10,0.88281,14,0.08799,2,6,0.48,10,0.51999,3,6,0.84633,10,0.08799,2,0.06566,3,5,0.064,6,0.53912,2,0.39686,4,4,0.25086,5,0.18457,6,0.07199,2,0.49255,5,4,0.50138,8,0.0367,5,0.43803,9,0.00769,6,0.01617,4,4,0.24417,8,0.25915,5,0.21759,9,0.27906,5,4,0.18717,8,0.46232,5,0.0623,9,0.2857,12,0.00248,6,11,0.13635,4,0.01605,8,0.41094,5,0.00506,9,0.35749,12,0.07408,6,16,0.0161,11,0.53943,8,0.10831,9,0.06931,12,0.25531,17,0.01151,6,16,0.17744,11,0.47545,8,0.00601,9,0.00509,12,0.2388,17,0.09718,4,16,0.59361,11,0.13777,12,0.05467,17,0.21393,2,16,0.75852,17,0.24147,3,6,0.84633,10,0.07199,2,0.08166,3,5,0.096,6,0.49177,2,0.41222,4,4,0.00614,5,0.47641,6,0.07199,2,0.44544,4,4,0.11199,5,0.80691,9,0.07852,12,0.00255,3,4,0.10399,5,0.448,9,0.448,2,8,0.112,9,0.88799,4,11,0.07199,8,0.07423,9,0.42688,12,0.42688,2,11,0.22399,12,0.776,4,16,0.08799,11,0.11673,12,0.39763,17,0.39763,4,16,0.21165,11,0.02343,12,0.09237,17,0.67253,3,16,0.29019,11,0.00094,17,0.70886,3,5,0.4006,9,0.48617,12,0.1132,4,5,0.16275,9,0.57619,12,0.26102,6,0.00001,4,5,0.05279,9,0.4271,12,0.50745,17,0.01264,4,5,0.00443,9,0.12062,12,0.75738,17,0.11754,3,9,0.01137,12,0.53447,17,0.45415,2,12,0.08992,17,0.91007,2,12,0.01256,17,0.98742,3,10,0.5376,14,0.4224,18,0.03999,3,6,0.05196,10,0.87603,14,0.07199,2,6,0.51199,10,0.488,3,6,0.80985,10,0.112,2,0.07814,3,3,0.10399,6,0.52326,2,0.37273,4,3,0.41174,4,0.112,6,0.07103,2,0.40521,2,3,0.78399,4,0.216,3,3,0.43199,7,0.43199,4,0.136,2,7,0.8,8,0.19999,4,7,0.47,13,0.23724,11,0.12771,8,0.16503,6,7,0.08128,13,0.42604,15,0.00463,16,0.00676,11,0.41048,8,0.07077,4,13,0.34189,15,0.25729,16,0.15617,11,0.24462,4,13,0.02109,15,0.53691,16,0.40442,11,0.03754,2,15,0.54267,16,0.45732,3,3,0.43596,7,0.54784,13,0.01619,4,3,0.08891,7,0.74609,13,0.16459,15,0.0004,4,3,0.03063,7,0.51762,13,0.44153,15,0.01021,4,3,0.00791,7,0.23727,13,0.68695,15,0.06785,3,7,0.00047,13,0.39343,15,0.60609,1,15,1,1,15,1],"slotPose":[1,0,0,1,0,0],"bonePose":[10,0.133294,-0.991076,0.991076,0.133294,-102.984795,-1028.747532,14,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,6,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04,2,1,0,0,1,-107.18,-913,5,0.271608,0.962408,-0.962408,0.271608,6.41,-943.15,3,-0.221889,0.975072,-0.975072,-0.221889,-189.43,-938.45,9,0.233615,0.972329,-0.972329,0.233615,52.855498,-780.417524,12,0.256627,0.966511,-0.966511,0.256627,91.08837,-622.016202,17,0.256627,0.966511,-0.966511,0.256627,137.703154,-446.883718,16,0.012915,0.999917,-0.999917,0.012915,-88.954208,-412.565856,15,-0.17571,0.984442,-0.984442,-0.17571,-287.60782,-445.945216,7,-0.191152,0.981561,-0.981561,-0.191152,-224.721468,-788.051648,13,-0.17571,0.984442,-0.984442,-0.17571,-258.163974,-614.493923,18,0.307689,-0.951487,0.951487,0.307689,-164.467343,-1165.289724,19,0.307689,-0.951487,0.951487,0.307689,-50.523269,-1153.740106,4,0.012915,0.999917,-0.999917,0.012915,-105.43,-895.87,8,0.036469,0.999335,-0.999335,0.036469,-103.373351,-757.545025,11,0.052162,0.998639,-0.998639,0.052162,-97.387273,-596.256039],"edges":[29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,45,45,44,44,43,43,42,42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29],"userEdges":[43,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,22,0,60,60,46,44,60,1,61,61,47,60,61,2,62,62,48,61,62,63,49,62,63,64,50,63,64,65,51,64,65,66,52,65,66,67,53,66,67,68,54,67,68,69,55,68,69,70,56,69,70,71,57,70,71,72,58,71,72,73,59,72,73,73,21,4,74,74,63,2,74,5,75,75,64,74,75,6,76,76,65,75,76,7,77,77,66,76,77,78,67,77,78,79,68,78,79,80,69,79,80,81,70,80,81,82,71,81,82,83,72,82,83,84,73,83,84,84,20,11,85,85,78,7,85,12,86,86,79,85,86,13,87,87,80,86,87,14,88,88,81,87,88,15,89,89,82,16,90,90,83,89,90,88,89,17,91,91,84,90,91,91,19,40,92,92,46,42,92,39,93,93,47,92,93,38,94,94,48,93,94,37,95,95,49,94,95,36,96,96,50,95,96,35,97,97,51,96,97,34,98,98,52,97,98,99,53,98,99,100,54,99,100,101,55,100,101,102,56,101,102,103,57,102,103,104,58,103,104,105,59,104,105,105,23,32,106,106,99,34,106,31,107,107,100,106,107,30,108,108,101,107,108,29,109,109,102,108,109,28,110,110,103,109,110,27,111,111,104,110,111,26,112,112,105,111,112,112,24]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/20509005_tex.json b/Egret/Demos/resource/you_xin/suit1/20509005_tex.json
new file mode 100644
index 00000000..21a55b01
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/20509005_tex.json
@@ -0,0 +1 @@
+{"width":1024,"SubTexture":[{"width":790,"y":1,"height":994,"name":"dress/20509005","x":1}],"height":1024,"name":"20509005","imagePath":"20509005_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/20509005_tex.png b/Egret/Demos/resource/you_xin/suit1/20509005_tex.png
new file mode 100644
index 00000000..8229b121
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit1/20509005_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit1/20703016_ske.json b/Egret/Demos/resource/you_xin/suit1/20703016_ske.json
new file mode 100644
index 00000000..bbaf5d63
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/20703016_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"20703016","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"20703016","aabb":{"x":-166.73,"y":-230.43,"width":348.35,"height":275.77},"bone":[{"name":"root"},{"name":"bone_ikTarget","parent":"root","transform":{"x":123.7088,"y":-121.9447}},{"name":"nv","parent":"root"},{"name":"ik_foot_l","parent":"nv","transform":{"x":-58.79,"y":-68.24,"skX":100.64,"skY":100.64}},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":407,"name":"thigh_l","parent":"pelvis","transform":{"x":-39.11,"y":33.29,"skX":85.04,"skY":85.04}},{"length":393,"name":"thigh_r","parent":"pelvis","transform":{"x":77.79,"y":26.43,"skX":93.63,"skY":93.63}},{"length":408,"name":"calf_l","parent":"thigh_l","transform":{"x":407.97,"y":-1.43,"skX":-2.7,"skY":-2.7}},{"length":410,"name":"calf_r","parent":"thigh_r","transform":{"x":395.5,"y":-1.18,"skX":-29.2,"skY":-29.2}},{"inheritRotation":false,"length":108,"name":"foot_l","parent":"calf_l","transform":{"x":411.64,"y":0.23,"skX":103.24,"skY":103.24}},{"inheritRotation":false,"length":97,"name":"foot_r","parent":"calf_r","transform":{"x":410.23,"y":-1.14,"skX":87.83,"skY":87.83}}],"slot":[{"name":"1023","parent":"root"},{"name":"1022","parent":"root"}],"ik":[{"bendPositive":false,"chain":1,"name":"ik_foot_l","bone":"calf_l","target":"ik_foot_l"},{"bendPositive":false,"chain":1,"name":"bone_ik","bone":"calf_r","target":"bone_ikTarget"}],"skin":[{"slot":[{"name":"1022","display":[{"type":"mesh","name":"shoe/20703016_1","width":151,"height":217,"vertices":[174.56,-209.33,154.67,-191.21,149.09,-153.66,154.47,-128.79,155.58,-95.47,163.34,-53.03,158.35,-3.02,85.05,-3.22,57.3,-46.66,45.95,-107.9,68.98,-108.43,68.92,-86.63,90.1,-78.69,92.57,-90.8,93.23,-112.61,82.38,-132.04,23.38,-150.41,23.43,-167.98,81.37,-200.53,131.12,-220.11,174.6,-219.97],"uvs":[1,0.04903,0.86859,0.1328,0.83247,0.30592,0.86859,0.4204,0.87661,0.57398,0.92878,0.76944,0.89668,1,0.41114,1,0.22655,0.80015,0.15031,0.51813,0.30279,0.51534,0.30279,0.61586,0.44324,0.65216,0.45929,0.59631,0.4633,0.49579,0.39107,0.40644,0,0.32267,0,0.2417,0.38305,0.09091,0.71209,0,1,0],"triangles":[19,1,0,19,0,20,4,12,5,7,6,5,12,7,5,13,12,4,3,14,4,18,2,1,14,13,4,19,18,1,2,14,3,15,14,2,18,15,2,8,7,12,18,17,15,17,16,15,11,8,12,10,9,11,9,8,11],"weights":[1,8,1,1,8,1,2,10,0.0508,8,0.94919,2,10,0.4637,8,0.53629,2,10,0.98089,8,0.01909,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,1,10,1,2,10,0.99632,8,0.00367,2,10,0.95304,8,0.04695,2,10,0.55977,8,0.44022,2,10,0.08138,8,0.91861,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1],"slotPose":[1,0,0,1,0,0],"bonePose":[8,0.431613,0.902059,-0.902059,0.431613,-53.252689,-491.788776,10,0.03769,0.999289,-0.999289,0.03769,124.83646,-122.229299],"edges":[16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,20,20,19,19,18,18,17,17,16],"userEdges":[14,3,15,2,13,4,12,5]}]},{"name":"1023","display":[{"type":"mesh","name":"shoe/20703016","width":183,"height":238,"vertices":[26.65,-157.26,5.07,-123.25,-21.47,-88.01,-22.61,-68,-23.74,-43.16,-24.4,4.92,-25.22,64.84,-125.19,65.14,-155.96,-49.84,-139.52,-63.23,-100.6,-17.9,-92.2,-44.16,-90.46,-67.17,-91.12,-84.14,-116.69,-114.34,-156.24,-125.82,-156.3,-144.61,-79.66,-172.98,26.6,-173.35],"uvs":[1,0.06761,0.88142,0.21018,0.73574,0.35784,0.72912,0.44185,0.72249,0.54623,0.71807,0.74826,0.71256,1,0.16624,1,0,0.51643,0.09008,0.46042,0.30199,0.65136,0.34834,0.54114,0.35828,0.4444,0.35497,0.37311,0.2159,0.24582,0,0.19701,0,0.11808,0.41928,0,1,0],"triangles":[17,1,18,18,1,0,10,7,6,10,6,5,4,11,5,11,10,5,12,4,3,13,3,2,12,11,4,13,12,3,16,14,17,8,7,10,9,8,10,16,15,14,14,2,1,14,13,2,14,17,1],"weights":[1,7,1,1,7,1,2,9,0.04754,7,0.95245,2,9,0.43288,7,0.56711,2,9,0.94374,7,0.05625,1,9,1,1,9,1,1,9,1,1,9,0.99999,1,9,0.99999,2,9,0.99949,7,0.0005,2,9,0.83923,7,0.16076,2,9,0.2291,7,0.77089,2,9,0.00371,7,0.99628,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1],"slotPose":[1,0,0,1,0,0],"bonePose":[7,0.133294,0.991076,-0.991076,0.133294,-109.592168,-473.391363,9,-0.202787,0.979223,-0.979223,-0.202787,-54.950844,-65.393975],"edges":[8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8],"userEdges":[12,3,13,2,11,4,14,1,10,5]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/20703016_tex.json b/Egret/Demos/resource/you_xin/suit1/20703016_tex.json
new file mode 100644
index 00000000..565f2419
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/20703016_tex.json
@@ -0,0 +1 @@
+{"width":512,"SubTexture":[{"width":183,"y":1,"height":238,"name":"shoe/20703016","x":1},{"width":151,"y":1,"height":217,"name":"shoe/20703016_1","x":186}],"height":256,"name":"20703016","imagePath":"20703016_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/20703016_tex.png b/Egret/Demos/resource/you_xin/suit1/20703016_tex.png
new file mode 100644
index 00000000..b4f68bb6
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit1/20703016_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit1/2080100e_ske.json b/Egret/Demos/resource/you_xin/suit1/2080100e_ske.json
new file mode 100644
index 00000000..a4778ede
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/2080100e_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"2080100e","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"2080100e","aabb":{"x":-230.69,"y":-1708.95,"width":319.35,"height":337.75},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"length":71,"name":"neck","parent":"spine2","transform":{"x":172.12,"y":0.19,"skX":-17.89,"skY":-17.89}},{"length":88,"name":"head","parent":"neck","transform":{"x":71.14,"y":-0.04,"skX":-13.29,"skY":-13.29}}],"slot":[{"name":"1002","parent":"root"},{"name":"1067","parent":"root"},{"name":"1003","parent":"root"},{"name":"1006","parent":"root"}],"skin":[{"slot":[{"name":"1003","display":[{"type":"mesh","name":"headwear/2080100e","width":181,"height":160,"vertices":[51.46,-1599.51,28.12,-1575.37,53.05,-1581.31,72.86,-1574.58,72.86,-1563.9,24.16,-1552.03,34.84,-1530.27,53.05,-1524.33,57.4,-1512.07,36.82,-1507.32,61.35,-1454.97,48.69,-1454.97,8.72,-1495.05,-23.32,-1494.66,-54.98,-1512.47,-108.13,-1510.09,-108.13,-1525.92,-56.96,-1541.35,-52.99,-1548.47,-70.8,-1571.82,-68.43,-1584.48,-30.84,-1568.65,-60.12,-1614.97,-41.92,-1614.96,-15.81,-1586.45,-14.22,-1614.97,-2.75,-1614.97,8.73,-1596.35,43.95,-1614.97],"uvs":[0.88178,0.09658,0.7528,0.24743,0.89053,0.21034,1,0.25238,1,0.31915,0.73094,0.39334,0.78997,0.52936,0.89053,0.56645,0.91457,0.64312,0.8009,0.67279,0.93644,1,0.86648,1,0.64569,0.74946,0.46861,0.75193,0.29372,0.64064,0,0.65548,0,0.55656,0.28279,0.46011,0.30466,0.4156,0.20628,0.26969,0.2194,0.19056,0.42708,0.28948,0.26531,0,0.36587,0,0.51015,0.17819,0.51889,0,0.58229,0,0.64569,0.11636,0.84025,0],"triangles":[2,5,4,2,4,3,1,5,2,9,12,11,7,9,8,6,9,7,28,27,0,27,1,0,6,12,9,5,12,6,13,12,5,21,13,5,24,5,1,27,24,1,24,21,5,21,18,13,18,14,13,26,24,27,17,14,18,25,24,26,23,21,24,19,18,21,20,19,21,17,16,14,16,15,14,9,11,10,23,22,21],"weights":[1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1],"slotPose":[1,0,0,1,0,0],"bonePose":[7,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473],"edges":[15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15],"userEdges":[]}]},{"name":"1067","display":[{"type":"mesh","name":"headwear/2080100e_1","width":140,"height":152,"vertices":[-149.03,-1550.96,-134.78,-1542.66,-122.52,-1545.03,-119.35,-1527.62,-91.25,-1544.63,-83.22,-1541.47,-83.22,-1526.04,-94.42,-1503.48,-131.61,-1461.15,-139.53,-1469.85,-166.44,-1444.92,-196.9,-1415.64,-206.8,-1415.64,-197.7,-1452.44,-180.68,-1476.98,-185.82,-1495.96,-168.81,-1510.61,-223.22,-1525.64,-223.21,-1534.74,-200.07,-1542.26,-179.09,-1537.12,-201.65,-1561.65,-194.93,-1567.64,-182.26,-1567.64],"uvs":[0.52992,0.1097,0.63167,0.16437,0.71928,0.14875,0.74189,0.26329,0.94256,0.15135,1,0.17218,1,0.2737,0.91995,0.42208,0.65428,0.70062,0.59775,0.64335,0.40556,0.80735,0.18794,1,0.11728,1,0.18228,0.75789,0.30381,0.59649,0.26707,0.47154,0.3886,0.37522,0,0.2763,0,0.21643,0.16533,0.16697,0.31512,0.20081,0.15402,0.03942,0.20207,0,0.29251,0],"triangles":[4,3,6,3,7,6,4,6,5,9,8,7,3,9,7,1,16,3,16,9,3,2,1,3,0,16,1,16,14,9,20,16,0,14,10,9,15,14,16,23,20,0,14,13,10,13,11,10,22,21,23,12,11,13,18,17,19,20,19,16,19,17,16,23,21,20],"weights":[1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1],"slotPose":[1,0,0,1,0,0],"bonePose":[7,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473],"edges":[17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,23,23,22,22,21,21,20,20,19,19,18,18,17],"userEdges":[]}]},{"name":"1002","display":[{"type":"mesh","name":"hat/2080100c","width":195,"height":194,"vertices":[23.95,-1514.96,-171.04,-1514.96,-171.04,-1708.95,23.95,-1708.95],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"weights":[1,7,1,1,7,1,1,7,1,1,7,1],"slotPose":[1,0,0,1,0,0],"bonePose":[7,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"1006","display":[{"type":"mesh","name":"earring/20803005","width":16,"height":26,"vertices":[18.05,-1371.21,2.05,-1371.21,2.05,-1397.19,18.06,-1397.2],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"weights":[1,7,1,1,7,1,1,7,1,1,7,1],"slotPose":[1,0,0,1,0,0],"bonePose":[7,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/2080100e_tex.json b/Egret/Demos/resource/you_xin/suit1/2080100e_tex.json
new file mode 100644
index 00000000..1c7efe19
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/2080100e_tex.json
@@ -0,0 +1 @@
+{"width":256,"SubTexture":[{"width":195,"y":1,"height":194,"name":"hat/2080100c","x":1},{"width":140,"y":359,"height":152,"name":"headwear/2080100e_1","x":1},{"width":181,"y":197,"height":160,"name":"headwear/2080100e","x":1},{"width":16,"y":359,"height":26,"name":"earring/20803005","x":143}],"height":512,"name":"2080100e","imagePath":"2080100e_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/2080100e_tex.png b/Egret/Demos/resource/you_xin/suit1/2080100e_tex.png
new file mode 100644
index 00000000..f2602b0f
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit1/2080100e_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit1/2080500b_ske.json b/Egret/Demos/resource/you_xin/suit1/2080500b_ske.json
new file mode 100644
index 00000000..9b06e3b9
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/2080500b_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"2080500b","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"2080500b","aabb":{"x":-363.61,"y":-1138.04,"width":548.41,"height":326.32},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"length":200,"name":"upperarm_r","parent":"spine2","transform":{"x":139.2,"y":93.66,"skX":150.94,"skY":150.94}},{"length":195,"name":"upperarm_l","parent":"spine2","transform":{"x":93.55,"y":-65.17,"skX":-179.09,"skY":-179.09}},{"length":150,"name":"forearm_r","parent":"upperarm_r","transform":{"x":200.51,"y":0.29,"skX":-11.56,"skY":-11.56}},{"length":166,"name":"forearm_l","parent":"upperarm_l","transform":{"x":194.88,"y":0.53,"skX":12.43,"skY":12.43}},{"length":71,"name":"hand_r","parent":"forearm_r","transform":{"x":150.73,"y":-0.66,"skX":-0.9,"skY":-0.9}},{"length":54,"name":"hand_l","parent":"forearm_l","transform":{"x":166.89,"y":0.14,"skX":5.39,"skY":5.39}}],"slot":[{"name":"1041","parent":"root"},{"name":"1019","parent":"root"}],"skin":[{"slot":[{"name":"1019","display":[{"type":"mesh","name":"glove/2080500b","width":159,"height":323,"vertices":[104.98,-1078.6,108.08,-1063.08,113.05,-1046.93,119.88,-1028.92,131.06,-1011.54,156.23,-923,161.82,-903.74,170.51,-886.36,192.02,-849.87,192.02,-789.03,108.41,-789.04,112.76,-867.11,114.62,-888.22,108.41,-906.85,59.02,-988.56,52.19,-1006.57,49.09,-1026.44,42.88,-1045.69,38.6,-1066.18,33.02,-1112.03,47.55,-1112.03,100.34,-1094.03],"uvs":[0.45257,0.1035,0.4721,0.15156,0.50335,0.20155,0.54631,0.2573,0.61661,0.31114,0.77491,0.58525,0.81006,0.64486,0.86474,0.69869,1,0.81166,1,1,0.47417,0.99998,0.50151,0.75829,0.51323,0.69292,0.47417,0.63524,0.16356,0.38227,0.12059,0.32652,0.10107,0.26499,0.06201,0.20539,0.03515,0.14195,0,0,0.09142,0,0.4234,0.05575],"triangles":[7,11,8,11,10,8,8,10,9,4,13,5,6,12,7,12,11,7,14,13,4,5,13,6,13,12,6,3,14,4,15,14,3,2,16,3,16,15,3,1,16,2,17,16,1,0,18,1,18,17,1,21,18,0,20,18,21,19,18,20],"weights":[2,8,0.42,6,0.58,2,8,0.72,6,0.28,2,8,0.95,6,0.05,2,8,0.942078,10,0.057922,2,8,0.907405,10,0.092595,2,8,0.58647,10,0.41353,2,10,0.51929,8,0.48071,2,10,0.664154,8,0.335846,2,10,0.859101,8,0.140899,2,10,0.858158,8,0.141842,2,10,0.700209,8,0.299791,2,10,0.542573,8,0.457427,2,8,0.51337,10,0.48663,2,8,0.642035,10,0.357965,2,8,0.908924,10,0.091076,2,8,0.931633,10,0.068367,2,8,0.95,6,0.05,3,8,0.49,10,0.02,6,0.49,2,8,0.09,6,0.91,1,6,1,1,6,1,2,8,0.08,6,0.92],"slotPose":[1,0,0,1,0,0],"bonePose":[6,0.193207,0.981158,-0.981158,0.193207,42.671847,-1232.663838,8,0.385906,0.922538,-0.922538,0.385906,81.127245,-1035.875814,10,0.400349,0.916363,-0.916363,0.400349,139.903737,-897.076346],"edges":[19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,21,21,20,20,19],"userEdges":[16,2,17,1,18,0,15,3,14,4,12,6,13,5,11,7]}]},{"name":"1041","display":[{"type":"mesh","name":"glove/2080500b_1","width":207,"height":240,"vertices":[-169.36,-1030.44,-169.36,-1017.43,-178.75,-1003.35,-244.85,-912.87,-252.44,-897.7,-255.13,-881.99,-267.58,-810.16,-376.33,-810.13,-376.33,-827.25,-306.59,-907.44,-296.31,-922.62,-287.64,-935.62,-235.63,-1036.94,-225.33,-1050.16],"uvs":[1,0.08216,1,0.13634,0.95463,0.19503,0.63532,0.57202,0.59868,0.63523,0.58559,0.70069,0.52539,0.99999,0,1,0,0.92869,0.33695,0.59459,0.38668,0.53138,0.42855,0.47721,0.67981,0.05507,0.72954,0],"triangles":[2,1,0,13,2,0,11,3,12,13,12,2,12,3,2,11,4,3,9,6,5,9,5,4,10,9,4,11,10,4,9,8,6,8,7,6],"weights":[1,9,1,1,9,1,1,9,1,2,9,0.91152,11,0.08847,2,9,0.43677,11,0.56322,2,9,0.08826,11,0.91173,1,11,0.99999,2,9,0.00001,11,0.99998,2,9,0.00001,11,0.99998,2,9,0.04483,11,0.95516,2,9,0.40685,11,0.59314,2,9,0.82361,11,0.17638,1,9,1,1,9,1],"slotPose":[1,0,0,1,0,0],"bonePose":[9,-0.518922,0.854821,-0.854821,-0.518922,-185.900195,-1053.819626,11,-0.596925,0.802297,-0.802297,-0.596925,-272.622839,-911.231146],"edges":[7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,13,13,12,12,11,11,10,10,9,9,8,8,7],"userEdges":[12,2,10,4,11,3,9,5]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/2080500b_tex.json b/Egret/Demos/resource/you_xin/suit1/2080500b_tex.json
new file mode 100644
index 00000000..c8854fda
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit1/2080500b_tex.json
@@ -0,0 +1 @@
+{"width":512,"SubTexture":[{"width":207,"y":1,"height":240,"name":"glove/2080500b_1","x":162},{"width":159,"y":1,"height":323,"name":"glove/2080500b","x":1}],"height":512,"name":"2080500b","imagePath":"2080500b_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit1/2080500b_tex.png b/Egret/Demos/resource/you_xin/suit1/2080500b_tex.png
new file mode 100644
index 00000000..1c844442
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit1/2080500b_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit2/20106010_ske.json b/Egret/Demos/resource/you_xin/suit2/20106010_ske.json
new file mode 100644
index 00000000..77345f33
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/20106010_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"20106010","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"20106010","aabb":{"x":-335.77,"y":-1566.85,"width":515,"height":750},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"length":71,"name":"neck","parent":"spine2","transform":{"x":172.12,"y":0.19,"skX":-17.89,"skY":-17.89}},{"length":88,"name":"head","parent":"neck","transform":{"x":71.14,"y":-0.04,"skX":-13.29,"skY":-13.29}},{"name":"hair","parent":"head","transform":{"x":187.01,"y":-14.39}},{"length":80,"name":"hair0401","parent":"hair","transform":{"x":-58.34,"y":59.16,"skX":-179.5,"skY":-179.5}},{"length":100,"name":"hair0501","parent":"hair","transform":{"x":-113.42,"y":-63.08,"skX":-162.11,"skY":-162.11}},{"length":100,"name":"hair0601","parent":"hair","transform":{"x":-131.71,"y":66.14,"skX":-172.88,"skY":-172.88}},{"length":120,"name":"hair0502","parent":"hair0501","transform":{"x":104.79,"y":-0.11,"skX":0.45,"skY":0.45}},{"length":120,"name":"hair0602","parent":"hair0601","transform":{"x":100.91,"y":0.05,"skX":2.44,"skY":2.44}},{"length":140,"name":"hair0503","parent":"hair0502","transform":{"x":119.54,"y":-0.01,"skX":0.45,"skY":0.45}},{"inheritScale":false,"length":140,"name":"hair0603","parent":"hair0602","transform":{"x":119.43,"y":-0.01,"skX":0.83,"skY":0.83}},{"length":146,"name":"hair0504","parent":"hair0503","transform":{"x":144.09,"y":0.47,"skX":4.95,"skY":4.95}},{"length":136,"name":"hair0604","parent":"hair0603","transform":{"x":142.27,"y":-0.51,"skX":-3.46,"skY":-3.46}},{"length":148,"name":"hair0505","parent":"hair0504","transform":{"x":146.28,"y":1.15,"skX":0.9,"skY":0.9}},{"length":159,"name":"hair0605","parent":"hair0604","transform":{"x":136.59,"y":-0.47,"skX":-2.7,"skY":-2.7}}],"slot":[{"name":"1058","parent":"root"},{"name":"1004","parent":"root"}],"skin":[{"slot":[{"name":"1058","display":[{"type":"mesh","name":"hair/20106010_1","width":226,"height":260,"vertices":[42.97,-1357.44,54.43,-1311.01,73.7,-1266.92,75.42,-1221.07,71.41,-1171.37,13.18,-1161.04,22.34,-1217.06,22.92,-1261.76,8.03,-1301.87,-2.29,-1341.98,-4.02,-1385.53,-80.22,-1337.98,-83.67,-1304.72,-86.53,-1267.5,-97.41,-1226.25,-103.72,-1188.43,-95.7,-1155.32,-142.56,-1155.33,-150.57,-1184.99,-149.42,-1232.54,-133.52,-1273.8,-124.35,-1311.61,-120.9,-1360.89,26.35,-1415.32,38.38,-1415.32,-101.99,-1345.44,10.88,-1392.99],"uvs":[0.8564,0.22255,0.90711,0.40106,0.99239,0.57076,0.99998,0.74706,0.98225,0.93829,0.72456,0.97796,0.76513,0.76249,0.76766,0.59059,0.70174,0.43632,0.65611,0.28205,0.6485,0.11456,0.31129,0.29748,0.29608,0.4253,0.2834,0.56855,0.23523,0.72723,0.20734,0.87268,0.24284,1,0.03549,0.99998,0.00001,0.88591,0.00507,0.70299,0.0755,0.54431,0.11607,0.39885,0.13128,0.20932,0.78288,0,0.83612,0,0.21495,0.26883,0.71442,0.08591],"triangles":[1,7,2,6,4,3,2,7,3,7,6,3,6,5,4,22,10,23,24,26,0,0,9,1,9,8,1,8,7,1,23,26,24,26,10,0,10,9,0,10,26,23,22,11,10,22,25,11,21,20,13,21,13,12,25,21,12,25,12,11,20,14,13,19,15,14,20,19,14,15,17,16,19,18,15,18,17,15,22,21,25],"weights":[2,6,0.5,11,0.5,3,6,0.19,11,0.52,13,0.29,4,6,0.13,11,0.22,15,0.16,13,0.49,2,15,0.5,13,0.5,2,15,0.77,13,0.23,2,6,0.29,15,0.71,3,6,0.33,13,0.34,15,0.33,4,6,0.12,11,0.22,15,0.18,13,0.48,3,6,0.36,11,0.37,13,0.27,2,6,0.76,11,0.24,1,7,1,1,7,1,2,6,0.75,10,0.25,2,6,0.88,12,0.12,2,6,0.74,12,0.26,3,6,0.6,12,0.23,14,0.17,2,6,0.74,14,0.26,3,6,0.32,14,0.43,12,0.25,3,6,0.2,12,0.53,14,0.27,2,6,0.5,12,0.5,3,6,0.53,10,0.19,12,0.28,2,6,0.51,10,0.49,1,7,1,1,7,1,1,7,1,1,7,1,1,7,1],"slotPose":[1,0,0,1,0,0],"bonePose":[6,0.000524,-1,1,0.000524,-36.134534,-1292.746462,7,-0.22937,-0.973339,0.973339,-0.22937,-36.137286,-1363.886473,10,-0.080721,0.996737,-0.996737,-0.080721,-128.421235,-1417.745192,12,-0.088547,0.996072,-0.996072,-0.088547,-136.770329,-1313.288269,14,-0.096367,0.995346,-0.995346,-0.096367,-147.34523,-1194.216932,11,0.106958,0.994264,-0.994264,0.106958,1.548844,-1429.582044,13,0.064532,0.997916,-0.997916,0.064532,12.292285,-1329.245565,15,0.05007,0.998746,-0.998746,0.05007,20.009358,-1210.065148],"edges":[18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,24,24,23,23,22,22,21,21,20,20,19,19,18],"userEdges":[22,25,25,11,18,15,19,14,13,20,21,12,10,26,23,26,9,0,8,1,7,2,6,3]}]},{"name":"1004","display":[{"type":"mesh","name":"hair/20106010","width":515,"height":750,"vertices":[7.86,-1562.09,33.39,-1529.21,42.9,-1499.68,61.84,-1505.72,79.42,-1488.5,86.78,-1466.06,74.78,-1445.52,66.76,-1419.33,78.35,-1398.76,74.72,-1373.92,72.3,-1350.24,63.86,-1331.8,43.08,-1318.34,42.33,-1291.55,42.33,-1247.34,33.3,-1211.27,26.06,-1176.97,26.82,-1128.83,31.49,-1078.53,37.35,-1028.05,47.18,-981.28,58.9,-939.41,73.36,-909.49,97.94,-921.06,104.96,-905.4,76.52,-892.77,102.27,-869.82,131.27,-856.42,164.23,-874.68,161.24,-832.48,126.55,-831,100.2,-834.06,72.13,-862.85,49.42,-895.48,26.25,-906.67,5.95,-936.57,-9.38,-978.14,-14.57,-1025.79,-15.01,-1074.02,-10.5,-1127.76,0.79,-1177.86,2.6,-1212.63,2.6,-1249.15,5.31,-1291.56,5.32,-1326.48,-3.57,-1346.18,-4.93,-1375.54,-3.28,-1392.49,-26.32,-1389.34,-19.99,-1416,-22.7,-1443.1,-29.92,-1469.76,-52.5,-1473.84,-81.84,-1488.3,-103.45,-1502.87,-118.52,-1475.06,-141.64,-1446.25,-136.33,-1414.84,-125.72,-1387.2,-106.53,-1360.88,-113.24,-1355.28,-103.77,-1345.33,-88.12,-1339.11,-62.95,-1330.09,-77.44,-1306.82,-101.91,-1288.75,-114.26,-1256.01,-125.99,-1216.13,-136.73,-1177.72,-151.14,-1131.44,-162.99,-1097.32,-177.64,-1063.21,-192.64,-1025.74,-222.89,-989.67,-253.79,-961.21,-278.81,-929,-273.51,-892.11,-259.07,-862.23,-226.04,-847.81,-229.13,-831.02,-252.94,-831.02,-288.43,-848.27,-305.44,-880.65,-303.41,-915.85,-325.04,-889.83,-350.72,-836.98,-350.73,-887.93,-341.77,-910.38,-316.12,-939.41,-288.6,-967.17,-270.52,-1002.91,-244.68,-1038.1,-221.31,-1071.61,-201.18,-1105.03,-183.29,-1137.14,-160.83,-1183.44,-145.73,-1222.83,-134.36,-1258.33,-125.86,-1291.26,-139.92,-1296.98,-153.32,-1318.08,-164.71,-1336.85,-165.07,-1361.42,-184.54,-1379.93,-203.54,-1409.41,-197.85,-1438.86,-178.92,-1453.65,-176.96,-1477.46,-167.64,-1512.32,-145.9,-1550.67,-113.06,-1573.11,-73.14,-1580.98,-30.62,-1580.99,-146.07,-1364.75,-122.44,-1353.8,49.72,-1366.21,33.15,-1380.28,24.85,-1411.94,28.76,-1430.34,24.32,-1446.98,18.2,-1452.23,17.31,-1437.09,16.17,-1422.55,15.35,-1394.31,22.29,-1403.06,26.56,-1381.94,31.1,-1358.98,36.24,-1339.99,48.46,-1350.67,-95.28,-1545.41,-131.3,-1511,-143.7,-1476.83,-169.14,-1416.34,-157.08,-1381.5,-120.66,-1332.61,-120.66,-1311.51,-95.2,-1314.52,-268.76,-970.68,-250.35,-1000.84,-227.95,-1034.11,-205.43,-1068.54,-184.18,-1101.6,-166.53,-1132.6,-179.35,-1100.08,-195.72,-1066.43,-213.68,-1031.66,-242.29,-998.31,8.43,-1124.27,3.27,-1074.98,2.4,-1024.97,7.63,-979.62,20.39,-942.1,49.79,-912.43,40.12,-936.83,26.34,-979.57,19.17,-1027.26,13.25,-1076.77],"uvs":[0.69629,0.0252,0.74585,0.06905,0.76433,0.10843,0.8011,0.10035,0.83524,0.12331,0.84953,0.15322,0.82624,0.18062,0.81068,0.21553,0.83317,0.24294,0.82612,0.27609,0.82142,0.30763,0.80504,0.33224,0.76467,0.35017,0.76322,0.38591,0.76322,0.44486,0.74568,0.49295,0.73165,0.5387,0.7331,0.60289,0.74218,0.66994,0.75358,0.73727,0.77268,0.79961,0.79544,0.85542,0.82354,0.89535,0.87127,0.8799,0.88492,0.90076,0.82967,0.91762,0.87969,0.94823,0.93599,0.96609,1,0.94174,0.9942,0.99801,0.92684,0.99998,0.87567,0.99591,0.82117,0.95752,0.77706,0.91401,0.73205,0.89909,0.69262,0.85925,0.66284,0.80382,0.65274,0.74028,0.65186,0.67596,0.66063,0.6043,0.68255,0.5375,0.68606,0.49114,0.68606,0.44245,0.69132,0.38591,0.69136,0.33934,0.67409,0.31305,0.67146,0.27392,0.67466,0.25129,0.62994,0.2555,0.64221,0.21998,0.63695,0.18385,0.62292,0.14829,0.57908,0.14287,0.52208,0.1236,0.48013,0.10417,0.45086,0.14124,0.40598,0.17966,0.4163,0.22153,0.43689,0.25835,0.47416,0.29348,0.46112,0.3009,0.47951,0.31422,0.5099,0.32252,0.55878,0.33455,0.53065,0.36554,0.48316,0.38966,0.45917,0.43333,0.43639,0.48648,0.41554,0.53769,0.38756,0.5994,0.36453,0.64489,0.33608,0.69037,0.30696,0.74035,0.24823,0.78845,0.18822,0.8264,0.13967,0.86932,0.14993,0.91851,0.17797,0.95837,0.2421,0.97761,0.23611,1,0.18987,1,0.12096,0.97698,0.08792,0.9338,0.09188,0.88687,0.04988,0.92156,0.00001,0.99204,0,0.92411,0.0174,0.89416,0.06721,0.85545,0.12064,0.81844,0.15575,0.77081,0.20592,0.72388,0.2513,0.6792,0.29037,0.63461,0.32512,0.59181,0.36871,0.53008,0.39803,0.47753,0.42013,0.43021,0.43664,0.38625,0.40932,0.37866,0.3833,0.35052,0.36118,0.3255,0.36048,0.29275,0.32267,0.26806,0.28578,0.22878,0.29684,0.18952,0.33358,0.1698,0.33739,0.13805,0.35549,0.09157,0.39771,0.04042,0.46148,0.01051,0.53901,0,0.62156,0,0.39738,0.28832,0.44327,0.30292,0.77759,0.28636,0.74541,0.26759,0.72928,0.22541,0.73688,0.20087,0.72825,0.17869,0.71637,0.17165,0.71464,0.19184,0.71244,0.21124,0.71083,0.24891,0.72433,0.23724,0.73261,0.26539,0.74143,0.29598,0.7514,0.32132,0.77512,0.30705,0.496,0.04743,0.42606,0.09333,0.40199,0.1389,0.35258,0.21955,0.37599,0.266,0.44673,0.33114,0.44673,0.35928,0.49617,0.35526,0.15917,0.81377,0.1949,0.77355,0.23838,0.72917,0.28212,0.68326,0.32338,0.63919,0.35767,0.59786,0.33276,0.64122,0.30097,0.68607,0.26612,0.73246,0.21055,0.77694,0.69738,0.60898,0.68737,0.67468,0.68569,0.74138,0.69587,0.80183,0.72066,0.85186,0.77778,0.89141,0.75897,0.85889,0.7322,0.80191,0.71826,0.73833,0.70674,0.6723],"triangles":[27,29,28,27,30,29,31,30,27,26,31,27,32,31,26,23,22,24,22,25,24,25,32,26,4,6,5,21,152,22,2,119,6,33,32,25,115,9,8,116,115,8,2,6,4,3,2,4,115,10,9,7,116,8,22,33,25,118,7,6,119,118,6,117,116,7,128,11,10,115,128,10,152,33,22,117,124,116,120,119,2,20,153,21,118,117,7,153,152,21,128,127,11,127,12,11,154,153,20,19,154,20,156,155,18,18,155,19,155,154,19,154,151,153,43,42,14,43,14,13,126,128,115,116,126,115,152,34,33,17,147,18,126,127,128,147,156,18,42,41,15,124,125,116,42,15,14,51,120,2,127,44,12,44,43,12,12,43,13,1,51,2,155,150,154,40,17,16,149,150,155,156,148,155,40,147,17,151,35,34,41,16,15,125,126,116,124,123,125,150,151,154,126,45,127,45,44,127,41,40,16,122,117,118,119,121,118,0,51,1,148,149,155,125,46,126,46,45,126,40,39,147,147,148,156,121,122,118,150,35,151,123,46,125,122,124,117,120,121,119,36,35,150,52,51,0,47,123,122,122,123,124,38,37,149,38,149,148,39,148,147,149,36,150,112,52,0,47,46,123,39,38,148,51,50,120,120,50,121,49,47,122,50,122,121,37,36,149,50,49,122,129,53,52,129,52,112,49,48,47,111,129,112,129,54,53,62,64,63,62,136,64,110,129,111,136,65,64,61,134,136,130,54,129,61,136,62,134,135,136,135,65,136,110,109,129,109,130,129,130,55,54,98,66,65,135,98,65,58,114,60,58,60,59,98,97,66,97,67,66,97,96,67,58,113,114,130,131,55,131,56,55,99,98,135,134,100,135,96,68,67,113,101,114,114,101,134,101,100,134,100,99,135,96,95,68,109,108,130,57,133,58,133,113,58,95,142,69,95,69,68,108,131,130,56,132,57,132,133,57,102,101,113,107,106,131,108,107,131,131,106,56,106,132,56,94,142,95,142,70,69,133,102,113,142,143,70,132,103,133,143,71,70,103,102,133,106,105,132,141,143,142,94,141,142,104,103,132,143,144,71,141,144,143,144,72,71,105,104,132,94,93,141,144,145,72,92,140,93,140,145,144,145,73,72,91,139,92,138,146,139,91,138,139,146,74,73,80,79,78,77,80,78,90,138,91,138,137,146,137,74,146,90,137,138,137,75,74,77,81,80,89,75,137,76,81,77,82,81,76,75,83,76,90,89,137,89,88,75,83,82,76,88,83,75,88,87,83,87,84,83,86,85,84,87,86,84,134,114,61,60,114,61,145,139,140,92,139,140,144,140,141,140,93,141,139,145,146,146,73,145,34,151,152,153,151,152],"weights":[1,8,1,1,8,1,1,8,1,2,11,0.06994,8,0.93005,2,11,0.15499,8,0.845,2,11,0.16729,8,0.8327,2,11,0.12838,8,0.87161,3,11,0.15974,13,0.00025,8,0.84,3,11,0.1645,13,0.00309,8,0.83239,3,11,0.40396,13,0.04098,8,0.55505,3,11,0.38,13,0.40348,8,0.2165,3,11,0.52775,13,0.34171,8,0.13053,3,11,0.38252,13,0.55346,8,0.064,2,11,0.12282,13,0.87717,2,13,0.98651,15,0.01348,2,13,0.56964,15,0.43035,2,13,0.01551,15,0.98448,1,15,1,2,15,0.63631,17,0.36368,1,17,1,2,17,0.88799,19,0.112,3,17,0.47577,19,0.46822,2,0.05599,3,17,0.22419,19,0.6798,2,0.096,3,17,0.21715,19,0.71884,2,0.064,3,17,0.12294,19,0.78105,2,0.09599,3,17,0.09945,19,0.78854,2,0.11199,3,17,0.11161,19,0.76038,2,0.128,2,19,0.816,2,0.18399,2,19,0.78399,2,0.216,2,19,0.75999,2,0.24,2,19,0.76,2,0.23999,2,19,0.83199,2,0.168,3,17,0.11641,19,0.73958,2,0.14399,3,17,0.25535,19,0.65664,2,0.08799,3,17,0.26995,19,0.64204,2,0.08799,3,17,0.55756,19,0.41043,2,0.032,2,17,0.87999,19,0.12,2,15,0.03673,17,0.96326,2,15,0.56576,17,0.43423,2,15,0.98985,17,0.01014,2,13,0.02607,15,0.97392,2,13,0.52795,15,0.47204,2,11,0.00003,13,0.99996,3,11,0.112,13,0.88789,15,0.0001,3,11,0.40551,13,0.52595,8,0.06853,3,11,0.48472,13,0.35537,8,0.15989,2,11,0.35199,8,0.648,4,11,0.13307,13,0.00004,8,0.69887,9,0.16799,4,11,0.10358,13,0.00009,8,0.61631,9,0.28,2,8,0.80799,9,0.192,2,8,0.89599,9,0.104,2,8,0.92464,9,0.07535,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,2,10,0.085,8,0.91499,3,10,0.1353,12,0.00006,8,0.86461,3,10,0.22988,12,0.01011,8,0.76,3,10,0.12766,12,0.00832,8,0.86399,1,8,1,1,8,1,1,8,1,3,10,0.14177,12,0.10828,8,0.74993,4,10,0.12191,12,0.54107,8,0.26931,2,0.0677,3,10,0.01151,12,0.90849,2,0.07999,3,12,0.87465,14,0.01334,2,0.11199,4,10,0.00002,12,0.23681,14,0.58716,2,0.17599,2,14,0.79999,2,0.19999,3,14,0.59699,16,0.107,2,0.29599,3,14,0.35884,16,0.35315,2,0.28799,3,14,0.09791,16,0.62207,2,0.28,2,16,0.664,2,0.33599,3,16,0.53503,18,0.07295,2,0.392,3,16,0.29158,18,0.24441,2,0.46399,3,16,0.08166,18,0.38233,2,0.53599,2,18,0.408,2,0.59199,2,18,0.35199,2,0.648,2,18,0.376,2,0.62399,2,18,0.4,2,0.59999,2,18,0.408,2,0.59199,3,16,0.05567,18,0.40832,2,0.53599,3,16,0.17958,18,0.3084,2,0.512,3,16,0.06201,18,0.39398,2,0.54399,3,16,0.04492,18,0.38707,2,0.568,3,16,0.0528,18,0.38719,2,0.56,3,16,0.0832,18,0.4368,2,0.47999,3,16,0.29536,18,0.22463,2,0.47999,3,16,0.52319,18,0.0768,2,0.39999,2,16,0.656,2,0.34399,3,14,0.08447,16,0.61952,2,0.296,3,14,0.42623,16,0.29376,2,0.28,3,14,0.66777,16,0.08422,2,0.24799,2,14,0.816,2,0.18399,3,12,0.2103,14,0.62969,2,0.16,3,12,0.87804,14,0.00195,2,0.11999,3,10,0.00107,12,0.91891,2,0.08,5,10,0.1595,12,0.52585,14,0.00007,8,0.26655,2,0.04799,4,10,0.15395,12,0.29401,14,0.00002,8,0.552,3,10,0.22677,12,0.18122,8,0.59199,3,10,0.17033,12,0.03766,8,0.79199,3,10,0.04226,12,0.00076,8,0.95697,3,10,0.05606,12,0.00003,8,0.94389,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,2,10,0.05801,8,0.94198,3,10,0.0826,12,0.00539,8,0.912,3,11,0.46691,13,0.06108,8,0.472,2,11,0.208,8,0.79199,1,8,1,1,8,1,1,8,1,2,8,0.92799,9,0.07199,2,8,0.85599,9,0.14399,2,8,0.82399,9,0.176,1,8,1,1,8,1,2,11,0.264,8,0.73599,3,11,0.43511,13,0.26914,8,0.29573,3,11,0.45354,13,0.43624,8,0.11021,3,11,0.54737,13,0.33138,8,0.12122,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,3,10,0.24508,12,0.1309,8,0.624,4,10,0.26554,12,0.27721,14,0.00002,8,0.45721,3,10,0.22985,12,0.17523,8,0.5949,3,16,0.54963,18,0.05836,2,0.392,2,16,0.60799,2,0.39199,3,14,0.06265,16,0.64933,2,0.28799,3,14,0.35525,16,0.37273,2,0.27199,3,14,0.69062,16,0.10137,2,0.20799,2,14,0.77599,2,0.224,3,14,0.64876,16,0.09523,2,0.25599,3,14,0.34175,16,0.37023,2,0.28799,3,14,0.08351,16,0.61248,2,0.30399,2,16,0.616,2,0.38399,1,15,1,2,15,0.69421,17,0.30578,2,15,0.0266,17,0.97339,2,17,0.832,19,0.16799,3,17,0.5808,19,0.38719,2,0.032,3,17,0.24921,19,0.69478,2,0.05599,3,17,0.46425,19,0.47174,2,0.064,2,17,0.872,19,0.12799,2,15,0.0699,17,0.93009,2,15,0.69421,17,0.30578],"slotPose":[1,0,0,1,0,0],"bonePose":[8,-0.22937,-0.973339,0.973339,-0.22937,-93.038172,-1542.610006,11,0.106958,0.994264,-0.994264,0.106958,1.548844,-1429.582044,13,0.064532,0.997916,-0.997916,0.064532,12.292285,-1329.245565,15,0.05007,0.998746,-0.998746,0.05007,20.009358,-1210.065148,17,0.110255,0.993903,-0.993903,0.110255,27.642178,-1067.999132,19,0.156952,0.987606,-0.987606,0.156952,43.169006,-932.293691,2,1,0,0,1,-107.18,-913,9,0.220868,0.975304,-0.975304,0.220868,-22.073961,-1499.39494,10,-0.080721,0.996737,-0.996737,-0.080721,-128.421235,-1417.745192,12,-0.088547,0.996072,-0.996072,-0.088547,-136.770329,-1313.288269,14,-0.096367,0.995346,-0.995346,-0.096367,-147.34523,-1194.216932,16,-0.181892,0.983318,-0.983318,-0.181892,-161.698553,-1050.842838,18,-0.197315,0.98034,-0.98034,-0.197315,-189.436574,-907.212189],"edges":[86,85,85,84,84,83,83,82,82,81,81,80,80,79,79,78,78,77,77,76,76,75,75,74,74,73,73,72,72,71,71,70,70,69,69,68,68,67,67,66,66,65,65,64,64,63,63,62,62,61,61,60,60,59,59,58,58,57,57,56,56,55,55,54,54,53,53,52,52,51,51,50,50,49,49,48,48,47,47,46,46,45,45,44,44,43,43,42,42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,112,112,111,111,110,110,109,109,108,108,107,107,106,106,105,105,104,104,103,103,102,102,101,101,100,100,99,99,98,98,97,97,96,96,95,95,94,94,93,93,92,92,91,91,90,90,89,89,88,88,87,87,86],"userEdges":[102,113,113,114,114,61,9,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,117,124,124,123,124,125,125,126,126,127,127,128,128,115,111,129,129,54,129,130,130,131,131,56,60,114,106,132,132,133,133,113,114,134,134,135,135,98,62,136,136,65,97,66,96,67,95,68,87,84,88,83,83,75,76,82,135,136,89,137,137,74,90,138,137,138,91,139,138,139,92,140,139,140,93,141,140,141,94,142,142,69,141,142,70,143,142,143,71,144,143,144,72,145,144,145,73,146,145,146,146,137,47,122,44,12,43,13,42,14,41,15,40,16,33,22,32,26,31,27,39,147,147,17,38,148,147,148,37,149,148,149,36,150,149,150,35,151,150,151,151,152,21,153,152,153,20,154,153,154,19,155,154,155,18,156,155,156,156,147]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/20106010_tex.json b/Egret/Demos/resource/you_xin/suit2/20106010_tex.json
new file mode 100644
index 00000000..fdd4f901
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/20106010_tex.json
@@ -0,0 +1 @@
+{"width":1024,"SubTexture":[{"width":226,"y":753,"height":260,"name":"hair/20106010_1","x":1},{"width":515,"y":1,"height":750,"name":"hair/20106010","x":1}],"height":1024,"name":"20106010","imagePath":"20106010_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/20106010_tex.png b/Egret/Demos/resource/you_xin/suit2/20106010_tex.png
new file mode 100644
index 00000000..b417ad4a
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit2/20106010_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_ske.json b/Egret/Demos/resource/you_xin/suit2/20208006_ske.json
new file mode 100644
index 00000000..c55c4534
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/20208006_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"20208006","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"20208006","aabb":{"x":-572.98,"y":-1447.25,"width":1032,"height":1248.68},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":154,"name":"dress0101","parent":"pelvis","transform":{"x":-82.25,"y":-25.45,"skX":102.82,"skY":102.82}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":138,"name":"dress0201","parent":"pelvis","transform":{"x":1.75,"y":17.13,"skX":89.26,"skY":89.26}},{"length":169,"name":"dress0301","parent":"pelvis","transform":{"x":113.59,"y":-30.15,"skX":74.24,"skY":74.24}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":161,"name":"dress0302","parent":"dress0301","transform":{"x":169.23,"y":-0.5,"skX":2.25,"skY":2.25}},{"length":161,"name":"dress0202","parent":"dress0201","transform":{"x":138.34,"y":-0.27,"skX":-1.35,"skY":-1.35}},{"length":176,"name":"dress0102","parent":"dress0101","transform":{"x":154.48,"y":1.04,"skX":-1.8,"skY":-1.8}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"length":171,"name":"dress0103","parent":"dress0102","transform":{"x":176.75,"y":-0.35,"skX":-0.9,"skY":-0.9}},{"length":181,"name":"dress0303","parent":"dress0302","transform":{"x":162.95,"y":-0.17,"skX":-1.36,"skY":-1.36}},{"length":182,"name":"dress0203","parent":"dress0202","transform":{"x":161.4,"y":-0.1,"skX":-0.9,"skY":-0.9}},{"length":195,"name":"upperarm_l","parent":"spine2","transform":{"x":93.55,"y":-65.17,"skX":-179.09,"skY":-179.09}},{"length":192,"name":"dress0304","parent":"dress0303","transform":{"x":181.23,"y":-0.11}},{"length":193,"name":"dress0104","parent":"dress0103","transform":{"x":171.1,"y":-0.63}},{"name":"xiong_l","parent":"spine2","transform":{"x":11.36,"y":-82.7}},{"length":200,"name":"upperarm_r","parent":"spine2","transform":{"x":139.2,"y":93.66,"skX":150.94,"skY":150.94}},{"name":"xiong_r","parent":"spine2","transform":{"x":35.43,"y":29.27}},{"length":166,"name":"forearm_l","parent":"upperarm_l","transform":{"x":194.88,"y":0.53,"skX":12.43,"skY":12.43}},{"length":150,"name":"forearm_r","parent":"upperarm_r","transform":{"x":200.51,"y":0.29,"skX":-11.56,"skY":-11.56}},{"length":71,"name":"hand_r","parent":"forearm_r","transform":{"x":150.73,"y":-0.66,"skX":-0.9,"skY":-0.9}},{"length":54,"name":"hand_l","parent":"forearm_l","transform":{"x":166.89,"y":0.14,"skX":5.39,"skY":5.39}}],"slot":[{"name":"1038","parent":"root"},{"name":"1028","parent":"root"},{"name":"1016","parent":"root"},{"name":"1080","parent":"root"},{"name":"1055","parent":"root"}],"skin":[{"slot":[{"name":"1038","display":[{"type":"mesh","name":"cloak/20208006_2","width":398,"height":782,"vertices":[-105.63,-1227.46,-118.86,-1201.18,-124.85,-1170.46,-111.7,-1123.84,-127.21,-1091.63,-137.45,-1068.93,-145.84,-1049.16,-157.95,-1028.33,-172.81,-1005.49,-208.73,-932.08,-217.27,-905.55,-225.52,-886.18,-240.65,-825.45,-258.6,-781.63,-289.92,-718.71,-314.91,-656.71,-337.37,-588.2,-368.59,-527.67,-419.7,-469.87,-449.06,-469.88,-485.93,-506.47,-501.53,-567.44,-501.53,-635.64,-490.01,-707.02,-468.98,-770.85,-458.7,-845.49,-430.41,-887.67,-386.54,-918.02,-350.05,-935.95,-330.74,-959.74,-275.76,-1023.82,-262.63,-1046.62,-249.21,-1064.74,-237.52,-1083.38,-228.12,-1102.47,-245.5,-1141.09,-207.59,-1200.25,-158.49,-1221.76,-142.54,-1251.84,-103.57,-1247.31,-287.64,-900.96,-332.31,-880.66,-345.97,-859.65,-381.48,-813.82,-351.34,-809.63,-320.88,-813.2,-291.83,-830.86,-272.81,-818.72,-173.5,-1171.45,-176.69,-1131.97,-181.73,-1096.53,-187.6,-1074.6,-193.74,-1056.27,-205.09,-1036.75,-219.57,-1012.19,-258.53,-945.62,-268.54,-917.62,-391.61,-747.61,-407.95,-682.26,-425.59,-609.32,-439.91,-544.07],"uvs":[0.99479,0.03119,0.96159,0.06479,0.94651,0.10408,0.97955,0.16369,0.93493,0.20201,0.91487,0.23392,0.89379,0.25919,0.8634,0.28585,0.82609,0.31505,0.73584,0.40894,0.71439,0.44288,0.69363,0.46764,0.65558,0.54531,0.61045,0.60135,0.53172,0.68181,0.46892,0.76109,0.41245,0.84869,0.33399,0.92609,0.20559,1,0.13182,0.99998,0.03918,0.95318,0,0.87522,0,0.78799,0.02895,0.6967,0.08181,0.61509,0.10768,0.51963,0.17879,0.46572,0.28902,0.4269,0.38073,0.40398,0.42927,0.37356,0.56737,0.29162,0.60037,0.26247,0.6341,0.23806,0.66347,0.21546,0.68709,0.19106,0.64338,0.14168,0.73862,0.06602,0.86198,0.03851,0.90205,0,0.99999,0.00582,0.53751,0.44875,0.42527,0.47469,0.39095,0.50155,0.30169,0.56015,0.37743,0.56551,0.45396,0.56096,0.52699,0.5384,0.57473,0.55392,0.82428,0.10284,0.81626,0.15331,0.80365,0.19864,0.78889,0.22667,0.77348,0.25012,0.74494,0.27507,0.70858,0.30651,0.61068,0.39164,0.58556,0.42746,0.27624,0.64483,0.23515,0.72839,0.1908,0.82166,0.15481,0.90511],"triangles":[38,0,39,37,1,0,38,37,0,2,49,3,49,4,3,48,49,2,48,2,1,37,48,1,49,50,4,50,5,4,51,6,5,50,51,5,52,7,6,51,52,6,36,48,37,53,8,7,52,53,7,35,49,48,36,35,48,53,54,8,54,9,8,34,50,49,35,34,49,34,51,50,54,55,9,33,52,51,34,33,51,32,53,52,33,32,52,31,54,53,32,31,53,55,10,9,30,55,54,56,11,10,55,56,10,46,12,11,31,30,54,40,46,11,56,40,11,46,47,12,47,13,12,30,29,55,47,45,13,29,56,55,41,46,40,46,45,47,41,42,46,44,57,14,42,45,46,57,15,14,58,59,16,42,44,45,58,16,15,57,58,15,27,42,41,43,57,44,43,44,42,59,17,16,26,43,42,27,26,42,59,60,17,26,25,43,60,18,17,24,57,43,25,24,43,23,58,57,24,23,57,60,19,18,22,59,58,23,22,58,20,19,60,21,60,59,22,21,59,21,20,60,41,27,40,28,27,40,14,44,13,45,44,13,40,28,56,28,29,56],"weights":[1,11,1,2,15,0.15,11,0.85,2,15,0.24,11,0.76,3,15,0.25,7,0.26,11,0.49,3,15,0.3,11,0.15,7,0.55,3,15,0.41,21,0.09,7,0.5,3,15,0.47,21,0.26,7,0.27,3,15,0.28,21,0.6,7,0.12,3,15,0.08543,21,0.9142,24,0.00035,2,21,0.9481,24,0.05189,2,21,0.71049,24,0.2895,2,21,0.455,24,0.54499,2,21,0.028653,24,0.971326,1,24,0.999989,1,24,0.999989,1,24,0.999988,1,24,0.999986,1,24,0.999969,1,24,0.999982,1,24,0.999984,1,24,0.999985,1,24,0.999985,1,24,0.999987,1,24,0.999989,1,24,0.999989,1,24,0.999989,1,24,1,2,21,0.01015,24,0.98984,2,21,0.15931,24,0.84068,2,21,0.47988,24,0.52011,3,15,0.00897,21,0.98797,24,0.00304,2,15,0.09471,21,0.90528,2,15,0.27151,21,0.72848,2,15,0.58,21,0.42,2,15,0.88,21,0.12,2,15,0.73,11,0.27,2,15,0.5,11,0.5,2,15,0.25,11,0.75,1,11,1,1,11,1,1,24,1,2,21,0.00149,24,0.9985,1,24,1,1,24,0.99999,1,24,0.99999,1,24,0.999989,1,24,1,2,21,0.00348,24,0.99651,2,15,0.43,11,0.57,3,15,0.57,7,0.19,11,0.24,3,15,0.57,7,0.28,11,0.15,3,15,0.63,21,0.14,7,0.23,3,15,0.41,21,0.42,7,0.17,3,15,0.19,21,0.73,7,0.08,1,21,1,1,21,1,2,21,0.5,24,0.5,1,24,0.999989,1,24,0.999988,1,24,0.999987,1,24,0.999986],"slotPose":[1,0,0,1,0,0],"bonePose":[15,-0.322761,0.94648,-0.94648,-0.322761,-122.498835,-1238.098661,21,-0.518922,0.854821,-0.854821,-0.518922,-185.900195,-1053.819626,24,-0.596925,0.802297,-0.802297,-0.596925,-272.622839,-911.231146,7,0.133294,-0.991076,0.991076,0.133294,-102.984795,-1028.747532,11,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497],"edges":[21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,39,39,38,38,37,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,37,36],"userEdges":[37,1,27,40,40,11,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,12,26,42,25,43,44,13,36,48,48,2,37,48,3,49,49,35,48,49,34,50,50,4,49,50,33,51,51,5,50,51,32,52,52,6,51,52,31,53,53,7,52,53,30,54,54,8,53,54,29,55,55,9,54,55,28,56,56,10,55,56,56,40,24,57,57,14,43,57,23,58,58,15,57,58,22,59,59,16,58,59,21,60,60,17,59,60,60,19]}]},{"name":"1016","display":[{"type":"mesh","name":"cloak/20208006","width":371,"height":1033,"vertices":[-234.12,-690.02,-221.58,-764.42,-199.82,-846.98,-192.85,-912.75,-181.97,-967.93,-174.45,-1030.82,-172.36,-1076.45,-139.09,-1095.41,-94.74,-1106.13,-40.51,-1094.91,6.26,-1072.58,-5.59,-1027.46,-11.45,-966.23,-10.62,-912.77,-5.85,-847.8,-2.52,-762.72,1.67,-685.8,15.89,-599.97,26.25,-520.43,42.13,-418.53,47.74,-323.41,36.04,-189.99,-24.51,-189.99,-18.67,-323.22,-21.15,-417.79,-28.71,-520.26,-31.87,-599.56,-40.75,-684.69,-46.96,-763.05,-54.45,-847.6,-56.1,-912.76,-56.92,-966.69,-72.04,-966.84,-82.85,-912.75,-86.19,-847.45,-60.28,-763.18,-55.86,-673.72,-127.15,-682.5,-144.7,-763.81,-127.28,-847.22,-118.29,-912,-112.81,-967.3,-140.55,-967.52,-147.29,-912.75,-157.37,-847.13,-168.25,-763.99,-182.41,-689.08,-194.2,-603.33,-201.72,-519.77,-205.11,-415.72,-203.46,-322.74,-200.11,-190.04,-247.74,-190.05,-247.72,-322.62,-247.71,-415.24,-247.68,-519.64,-247.66,-604.19,-103.63,-1029.41,-98.8,-1075.35,-46.7,-1073.89,-52.35,-1028.39,-136.83,-1030.07,-136.94,-1075.58],"uvs":[0.03643,0.40283,0.07023,0.33082,0.12882,0.25089,0.14749,0.18721,0.1768,0.13378,0.19707,0.07291,0.20241,0.0287,0.29211,0.01035,0.41191,0,0.55813,0.01081,0.68418,0.03246,0.65225,0.07615,0.63647,0.1354,0.63873,0.1872,0.6516,0.25008,0.66062,0.33243,0.67188,0.40688,0.71019,0.48998,0.7381,0.56697,0.78091,0.66562,0.79601,0.7577,0.76446,0.88686,0.60126,0.88686,0.61701,0.75789,0.61035,0.66633,0.58997,0.56714,0.58146,0.49037,0.55753,0.40795,0.54083,0.33211,0.52064,0.25028,0.51616,0.1872,0.51389,0.13497,0.47315,0.13483,0.44405,0.1872,0.43504,0.25041,0.50487,0.33201,0.51681,0.4186,0.32464,0.41011,0.27731,0.33138,0.32237,0.25059,0.34848,0.1872,0.36122,0.13438,0.28845,0.13417,0.27032,0.18721,0.24324,0.25071,0.21395,0.33121,0.17582,0.40372,0.14409,0.48676,0.12387,0.56765,0.11478,0.66838,0.11933,0.75839,0.12836,0.88686,0,0.88686,0,0.75851,0,0.66886,0,0.56778,0,0.48594,0.38796,0.07427,0.39962,0.02977,0.53943,0.03121,0.52622,0.07525,0.29847,0.07363,0.29656,0.02956],"triangles":[25,24,18,23,22,21,18,24,19,24,23,19,19,23,20,23,21,20,17,25,18,16,26,17,26,25,17,27,26,16,29,28,14,14,28,15,28,27,15,15,27,16,60,12,11,13,29,14,59,11,10,9,59,10,30,29,13,60,31,12,59,60,11,30,13,12,31,30,12,32,31,60,35,37,36,8,59,9,58,60,59,57,32,60,58,57,60,8,58,59,34,38,35,38,37,35,39,38,34,57,41,32,40,39,34,40,34,33,41,40,33,41,33,32,61,42,41,61,41,57,62,61,57,62,57,58,7,58,8,7,62,58,5,4,42,5,42,61,5,61,62,6,5,62,2,45,44,3,44,43,4,43,42,7,6,62,4,3,43,3,2,44,53,52,50,50,52,51,1,46,45,2,1,45,0,47,46,1,0,46,55,54,49,55,49,48,0,56,47,49,53,50,56,48,47,54,53,49,56,55,48],"weights":[4,3,0.06988,10,0.5844,12,0.0737,2,0.272,3,3,0.34496,10,0.53503,2,0.12,3,3,0.80256,10,0.10943,2,0.088,2,4,0.59999,3,0.4,3,7,0.07814,4,0.80985,3,0.11199,2,7,0.45599,4,0.544,3,7,0.824176,11,0.076923,4,0.098901,2,7,0.626374,11,0.373626,2,7,0.64,11,0.35999,2,7,0.647987,11,0.351988,3,7,0.802743,11,0.085243,4,0.11199,2,7,0.52,4,0.47999,3,7,0.11366,4,0.77433,6,0.11199,2,4,0.504,6,0.496,3,4,0.048,6,0.86822,8,0.08377,3,6,0.38515,8,0.43084,2,0.18399,4,6,0.06124,8,0.54842,13,0.08632,2,0.30399,3,8,0.34214,13,0.30585,2,0.352,4,8,0.07257,13,0.48335,16,0.09206,2,0.352,3,13,0.2967,16,0.31129,2,0.392,3,13,0.06758,16,0.46041,2,0.472,2,16,0.51199,2,0.488,2,16,0.49599,2,0.504,3,13,0.05823,16,0.50175,2,0.44,3,13,0.27647,16,0.29951,2,0.424,4,8,0.07168,13,0.49102,16,0.07729,2,0.36,3,8,0.32012,13,0.33587,2,0.344,4,6,0.06079,8,0.59292,13,0.10627,2,0.23999,3,6,0.43263,8,0.39936,2,0.16799,3,4,0.048,6,0.85299,8,0.099,3,7,0.00403,4,0.49996,6,0.496,3,7,0.09945,4,0.78854,6,0.11199,3,7,0.11199,4,0.66777,5,0.22022,2,4,0.51199,5,0.488,3,4,0.10399,5,0.81715,9,0.07884,2,5,0.47199,9,0.528,2,5,0.11199,9,0.888,2,5,0.14399,9,0.85599,2,5,0.5217,9,0.47828,3,4,0.10399,5,0.79564,9,0.10035,2,4,0.52,5,0.47999,3,7,0.11199,4,0.67487,5,0.21312,3,7,0.08448,4,0.79551,3,0.12,2,4,0.49599,3,0.504,3,3,0.81619,10,0.1198,2,0.06398,3,3,0.33292,10,0.48307,2,0.18399,4,3,0.06336,10,0.57783,12,0.07879,2,0.27998,3,10,0.30963,12,0.34636,2,0.344,4,10,0.06229,12,0.49386,17,0.07583,2,0.368,3,12,0.20364,17,0.38835,2,0.40799,2,17,0.6,2,0.39999,2,17,0.504,2,0.49599,2,17,0.51199,2,0.488,2,17,0.55198,2,0.448,3,12,0.22374,17,0.38425,2,0.39199,4,10,0.06528,12,0.47883,17,0.07987,2,0.376,3,10,0.29747,12,0.36652,2,0.33599,2,7,0.472,4,0.52799,2,7,0.85599,11,0.14399,3,7,0.86822,11,0.08377,4,0.048,2,7,0.472,4,0.52799,2,7,0.496,4,0.50399,3,7,0.824301,11,0.095678,4,0.079999],"slotPose":[1,0,0,1,0,0],"bonePose":[3,-0.221889,0.975072,-0.975072,-0.221889,-189.43,-938.45,10,-0.191152,0.981561,-0.981561,-0.191152,-224.721468,-788.051648,12,-0.17571,0.984442,-0.984442,-0.17571,-258.163974,-614.493923,2,1,0,0,1,-107.18,-913,4,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04,7,0.133294,-0.991076,0.991076,0.133294,-102.984795,-1028.747532,11,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,6,0.271608,0.962408,-0.962408,0.271608,6.41,-943.15,8,0.233615,0.972329,-0.972329,0.233615,52.855498,-780.417524,13,0.256627,0.966511,-0.966511,0.256627,91.08837,-622.016202,16,0.256627,0.966511,-0.966511,0.256627,137.703154,-446.883718,5,0.012915,0.999917,-0.999917,0.012915,-105.43,-895.87,9,0.036469,0.999335,-0.999335,0.036469,-103.373351,-757.545025,17,-0.17571,0.984442,-0.984442,-0.17571,-287.60782,-445.945216],"edges":[52,51,51,50,50,49,49,48,48,47,47,46,46,45,45,44,44,43,43,42,42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,9,8,8,7,6,5,5,4,4,3,3,2,2,1,1,0,0,56,56,55,55,54,54,53,53,52,10,9,7,6],"userEdges":[4,42,3,43,2,44,1,45,0,46,56,47,55,48,54,49,53,50,35,38,34,39,33,40,32,41,12,31,13,30,14,29,15,28,16,27,17,26,18,25,19,24,20,23,41,57,57,58,58,8,59,58,9,59,11,60,60,57,59,60,60,31,5,61,61,57,42,61,62,58,61,62,62,7,6,62,59,10]}]},{"name":"1055","display":[{"type":"mesh","name":"cloak/20208006_3","width":1032,"height":855,"vertices":[32.82,-1012.99,78.56,-930.95,125.21,-865.54,174.12,-791.38,224.62,-717.22,287.09,-650.28,353.37,-577.7,407.02,-509.84,470.19,-426.21,470.2,-304.02,420.95,-262.98,399.14,-413.59,343.9,-501.95,288.67,-566.64,228.7,-640.81,172.55,-712.48,118.89,-785.07,74.71,-857.66,24.91,-929.37,-16.09,-1012.98,-148.63,-1008.63,-180.2,-928.14,-233.87,-844.54,-292.27,-771.99,-355.41,-693.13,-405.94,-611.09,-454.9,-514.87,-502.29,-393.4,-500.79,-231.41,-562.11,-231.44,-562.04,-395,-524.32,-519.63,-470.63,-619.01,-421.68,-699.46,-353.8,-784.62,-293.83,-855.61,-241.72,-931.32,-199.11,-1008.62,-181.76,-1086.26,-129.68,-1086.25,-47.71,-1086.25,-9.84,-1086.24],"uvs":[0.57621,0.08567,0.62055,0.18164,0.66575,0.25812,0.71315,0.34486,0.76208,0.4316,0.8226,0.5099,0.88681,0.5948,0.9388,0.67415,1,0.77196,1,0.91488,0.95226,0.96286,0.93115,0.78673,0.87764,0.68338,0.82412,0.60772,0.76602,0.52098,0.71162,0.43713,0.65964,0.35224,0.61682,0.26735,0.56856,0.18348,0.5288,0.08567,0.40038,0.09079,0.36979,0.18491,0.31781,0.28272,0.26124,0.36762,0.20008,0.45989,0.15116,0.55585,0.10376,0.66843,0.05789,0.81053,0.05942,1,0,1,0,0.80868,0.03648,0.66289,0.08847,0.54663,0.13587,0.45251,0.20161,0.35285,0.25971,0.2698,0.31017,0.18122,0.35145,0.09079,0.36827,0,0.41872,0,0.49816,0,0.53486,0],"triangles":[7,11,8,8,11,9,11,10,9,12,11,7,6,12,7,13,12,6,5,13,6,4,14,5,5,14,13,3,15,4,4,15,14,16,15,3,2,16,3,17,16,2,1,17,2,18,17,1,0,18,1,19,18,0,41,19,0,40,19,41,40,20,19,39,20,40,37,21,20,38,20,39,38,37,20,37,36,21,36,22,21,36,35,22,35,23,22,35,34,23,34,24,23,33,25,24,33,24,34,33,32,25,32,26,25,30,29,27,27,29,28,32,31,26,31,27,26,31,30,27],"weights":[2,7,0.76,6,0.24,2,7,0.49,6,0.51,3,7,0.17,6,0.59,8,0.24,2,6,0.48,8,0.52,3,8,0.61,6,0.17,13,0.22,2,13,0.5,8,0.5,3,13,0.57,8,0.16,16,0.27,2,13,0.49,16,0.51,2,16,0.75,13,0.25,1,16,1,1,16,1,2,16,0.75,13,0.25,2,13,0.49,16,0.51,3,13,0.57,8,0.16,16,0.27,2,13,0.5,8,0.5,3,8,0.61,6,0.17,13,0.22,2,6,0.48,8,0.52,3,7,0.17,6,0.59,8,0.24,2,7,0.49,6,0.51,2,7,0.76,6,0.24,2,7,0.73,3,0.27,2,3,0.49,7,0.51,3,3,0.58,7,0.18,10,0.24,2,3,0.51,10,0.49,3,3,0.19,10,0.6,12,0.21,2,10,0.51,12,0.49,3,12,0.43,10,0.14,17,0.43,2,17,0.74,12,0.26,1,17,1,1,17,1,2,17,0.74,12,0.26,3,12,0.43,10,0.14,17,0.43,2,10,0.51,12,0.49,3,3,0.19,10,0.6,12,0.21,2,3,0.51,10,0.49,3,3,0.58,7,0.18,10,0.24,2,3,0.49,7,0.51,2,7,0.73,3,0.27,1,7,1,1,7,1,1,7,1,1,7,1],"slotPose":[1,0,0,1,0,0],"bonePose":[7,0.133294,-0.991076,0.991076,0.133294,-102.984795,-1028.747532,6,0.271608,0.962408,-0.962408,0.271608,6.41,-943.15,8,0.233615,0.972329,-0.972329,0.233615,52.855498,-780.417524,13,0.256627,0.966511,-0.966511,0.256627,91.08837,-622.016202,16,0.256627,0.966511,-0.966511,0.256627,137.703154,-446.883718,3,-0.221889,0.975072,-0.975072,-0.221889,-189.43,-938.45,10,-0.191152,0.981561,-0.981561,-0.191152,-224.721468,-788.051648,12,-0.17571,0.984442,-0.984442,-0.17571,-258.163974,-614.493923,17,-0.17571,0.984442,-0.984442,-0.17571,-287.60782,-445.945216],"edges":[29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29],"userEdges":[37,20,36,21,35,22,34,23,33,24,32,25,31,26,30,27,39,20,19,0,18,1,17,2,16,3,15,4,14,5,13,6,12,7,11,8,40,19]}]},{"name":"1028","display":[{"type":"mesh","name":"coat/2040600b","width":262,"height":936,"vertices":[78.65,-1249,57.47,-1208.89,45.9,-1162.71,29.66,-1125.44,3.88,-1079.62,4.85,-1029.66,5.92,-998.76,-41.96,-982.88,-40.05,-930.58,-42.93,-873.3,-38.15,-810.44,-33.37,-745.5,-35.29,-671.29,-38.16,-589.17,-37.21,-516.1,-98.35,-379.12,-183.36,-514.21,-183.36,-593.94,-183.35,-675.13,-183.34,-750.26,-174.75,-819.98,-169.98,-879.03,-165.15,-934.46,-156.54,-986.71,-179.51,-1014.15,-180.46,-1036.37,-176.64,-1086.3,-183.33,-1146.48,-183.33,-1186.57,-169.8,-1223.19,-146.88,-1251.87,-128.73,-1292.18,-87.67,-1300.77,-40.87,-1300.77,7.82,-1300.77,52.7,-1300.76,78.65,-1286.45,-53.22,-1262.31,-80.79,-1210.81,-95.14,-1173.15,-93.16,-1136.55,-97.18,-1080.04,-96.24,-1028.83,-103.83,-980.22,-104.93,-926.35,-104.84,-872.3,-105.02,-810.55,-107.71,-744.07,-107.55,-670.83,-106.89,-587.84,-104.16,-510.14,-100.92,-1264.88,-122.63,-1234.73,-150.85,-1178.24,-143.17,-1125.49,-135.38,-1081.14,-139.3,-1029.28,-51.33,-1027.37,-55.19,-1076.8,-49.43,-1119.4,-45.96,-1174.57,-31.29,-1226.3,-7,-1263.37,33.47,-1254.6,8.28,-1205.77,8.76,-1167.06,-7.4,-1129.93,-26.51,-1077.34],"uvs":[0.99999,0.05531,0.91918,0.09816,0.87499,0.14749,0.81302,0.18728,0.71461,0.23626,0.71825,0.28963,0.72235,0.32263,0.53965,0.33962,0.54694,0.39549,0.536,0.45671,0.55423,0.52387,0.57245,0.59325,0.56516,0.67253,0.55423,0.76028,0.55787,0.83832,0.32459,0.98469,0.00001,0.84037,0.00001,0.75517,0.00001,0.66845,0.00001,0.58815,0.0328,0.51367,0.05103,0.45059,0.06944,0.39135,0.10224,0.33554,0.01458,0.30622,0.01093,0.28248,0.02551,0.22911,0.00001,0.16483,0,0.12198,0.05166,0.08286,0.13914,0.05225,0.2084,0.00918,0.36513,0,0.54374,0,0.72964,0,0.90095,0.00001,0.99999,0.0153,0.49664,0.0411,0.39141,0.0961,0.33664,0.13629,0.34419,0.17542,0.32879,0.2358,0.33244,0.29053,0.30349,0.34246,0.2993,0.40001,0.29969,0.45778,0.29895,0.52374,0.28871,0.59479,0.2893,0.67303,0.2919,0.76169,0.30237,0.84471,0.31454,0.03835,0.2317,0.07053,0.12402,0.1309,0.15329,0.18726,0.18303,0.23463,0.16805,0.29006,0.50385,0.29209,0.48911,0.23926,0.51115,0.19375,0.52438,0.1348,0.58036,0.07954,0.67308,0.03996,0.82754,0.04931,0.73142,0.10148,0.73323,0.14284,0.67154,0.1825,0.59857,0.23868],"triangles":[35,63,36,36,63,0,63,1,0,64,65,2,34,63,35,64,2,1,63,64,1,65,3,2,65,66,3,66,4,3,34,62,63,62,64,63,50,15,14,67,5,4,66,67,4,5,57,6,61,60,64,62,61,64,64,60,65,60,66,65,33,62,34,67,57,5,57,7,6,59,67,66,60,59,66,37,61,62,33,37,62,46,47,10,49,50,14,49,14,13,48,49,13,47,48,12,48,13,12,47,12,11,10,47,11,38,60,61,59,58,67,58,57,67,45,46,9,44,9,8,9,46,10,37,38,61,40,59,60,7,43,8,44,45,9,43,44,8,32,37,33,57,43,7,42,43,57,39,40,60,58,42,57,41,58,59,38,39,60,41,42,58,51,38,37,32,51,37,40,41,59,50,16,15,54,41,40,51,52,38,54,55,41,56,43,42,41,55,42,55,56,42,31,51,32,17,49,48,18,48,47,20,46,45,49,16,50,17,16,49,18,17,48,19,47,46,20,19,46,22,44,43,44,21,45,23,22,43,19,18,47,56,23,43,21,20,45,22,21,44,30,52,51,31,30,51,30,29,52,29,53,52,53,27,54,54,26,55,25,56,55,26,25,55,24,23,56,29,28,53,25,24,56,27,26,54,28,27,53,52,38,53,53,39,38,54,53,40,39,53,40],"weights":[1,11,1,1,11,1,2,11,0.904,7,0.09599,3,11,0.54465,7,0.45437,4,0.00095,3,11,0.07955,7,0.82444,4,0.09599,2,7,0.52799,4,0.472,3,7,0.15365,4,0.84614,5,0.00019,4,7,0.12415,4,0.81734,5,0.0185,2,0.04,4,7,0.00812,4,0.68385,5,0.15602,2,0.15199,3,4,0.07253,5,0.42346,2,0.50399,3,5,0.43819,9,0.0658,2,0.496,3,5,0.18908,9,0.33891,2,0.472,4,5,0.03888,9,0.41327,14,0.04384,2,0.50399,4,5,0.00001,9,0.20445,14,0.25153,2,0.544,3,9,0.07071,14,0.44927,2,0.47999,2,14,0.592,2,0.40799,3,9,0.05923,14,0.42876,2,0.512,3,9,0.27726,14,0.25873,2,0.46399,4,5,0.04756,9,0.4169,14,0.04753,2,0.488,4,5,0.23173,9,0.2802,14,0.00004,2,0.488,4,4,0.00135,5,0.44784,9,0.07879,2,0.472,3,4,0.10569,5,0.3983,2,0.49599,3,4,0.72443,5,0.14756,2,0.12799,3,7,0.11396,4,0.76603,2,0.12,2,7,0.41163,4,0.58836,2,7,0.55999,4,0.44,3,11,0.08678,7,0.81721,4,0.09599,3,11,0.51968,7,0.40832,18,0.07199,3,11,0.85376,7,0.07423,18,0.07199,2,11,0.936,18,0.06398,1,11,1,1,11,1,1,11,1,1,11,1,1,11,1,1,11,1,1,11,1,1,11,1,3,11,0.86864,20,0.0679,18,0.06345,4,11,0.73711,7,0.124,20,0.07487,18,0.06398,4,11,0.4781,7,0.37565,20,0.06623,18,0.08,3,11,0.02227,7,0.90572,4,0.07199,2,7,0.49599,4,0.504,3,7,0.06854,4,0.88345,2,0.048,3,4,0.70534,5,0.15064,2,0.14399,3,4,0.11814,5,0.44985,2,0.43199,3,5,0.43334,9,0.05465,2,0.51199,3,5,0.12879,9,0.45521,2,0.41599,4,5,0.06996,9,0.47665,14,0.03737,2,0.416,3,9,0.32663,14,0.30535,2,0.368,3,9,0.07872,14,0.57726,2,0.344,1,11,1,2,11,0.936,18,0.06398,3,11,0.73215,7,0.09984,18,0.168,3,11,0.50598,7,0.43801,18,0.056,3,11,0.06624,7,0.85376,4,0.07999,2,7,0.54399,4,0.456,2,7,0.55999,4,0.44,3,11,0.05331,7,0.89868,4,0.04799,3,11,0.52256,7,0.39743,20,0.07999,3,11,0.74489,7,0.0791,20,0.17599,2,11,0.92799,20,0.07199,1,11,1,2,11,0.99914,7,0.00085,2,11,0.92,20,0.07999,3,11,0.80985,7,0.10214,20,0.088,3,11,0.50598,7,0.43801,20,0.05599,3,11,0.07232,7,0.83167,4,0.09599],"slotPose":[1,0,0,1,0,0],"bonePose":[11,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497,7,0.133294,-0.991076,0.991076,0.133294,-102.984795,-1028.747532,4,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04,14,0.052162,0.998639,-0.998639,0.052162,-97.387273,-596.256039,5,0.012915,0.999917,-0.999917,0.012915,-105.43,-895.87,2,1,0,0,1,-107.18,-913,9,0.036469,0.999335,-0.999335,0.036469,-103.373351,-757.545025,18,0.307689,-0.951487,0.951487,0.307689,-164.467343,-1165.289724,20,0.307689,-0.951487,0.951487,0.307689,-50.523269,-1153.740106],"edges":[28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28],"userEdges":[33,37,37,38,38,39,39,40,40,41,41,42,23,43,43,7,42,43,22,44,44,8,43,44,21,45,45,9,20,46,46,10,45,46,44,45,19,47,47,11,46,47,18,48,48,12,47,48,17,49,49,13,48,49,16,50,50,14,49,50,50,15,30,51,51,37,32,51,29,52,52,38,51,52,28,53,53,39,52,53,27,54,54,40,53,54,26,55,55,41,54,55,25,56,56,42,55,56,56,23,5,57,57,42,7,57,58,41,57,58,59,40,58,59,60,39,59,60,61,38,60,61,62,37,61,62,62,34,0,63,63,62,35,63,1,64,64,61,63,64,2,65,65,60,64,65,3,66,66,59,65,66,4,67,67,58,66,67,67,57,29,53,53,27,38,53,38,60,60,40,53,40,60,66,64,60]}]},{"name":"1080","display":[{"type":"mesh","name":"cloak/20208006_1","width":507,"height":775,"vertices":[107.62,-1230.45,116.49,-1214.06,126.74,-1183.3,114.63,-1146.02,130.48,-1113.21,140.74,-1086.18,153.8,-1060.09,165.95,-1036.89,185.53,-1020.1,229.33,-969.03,249.83,-945.71,272.19,-927.07,348.62,-914.94,374.72,-887.9,409.18,-842.22,439.9,-777.2,482.77,-712.92,490.69,-637.43,490.66,-556.26,434.66,-504.36,366.56,-471.73,284.55,-471.76,234.81,-538.68,217.11,-609.52,192.89,-684.99,167.76,-750.93,147.27,-796.62,184.55,-811.52,181.76,-844.14,151.53,-869.19,125.94,-876.54,123.48,-856.34,110.92,-849.75,91.36,-876.77,82.98,-903.8,56.9,-975.41,46.65,-998.7,35.44,-1020.94,30.77,-1047.03,29.83,-1067.52,27.96,-1086.34,10.3,-1078.78,-6.84,-1074.26,-35.9,-1089.54,31.73,-1154.29,36.33,-1186.08,47.04,-1246.8,71.27,-1246.81,64.38,-1194.19,65.52,-1158.1,69.98,-1115.96,70.82,-1087.21,76.32,-1063.83,81.51,-1036.58,90.31,-1012.93,101.46,-989.91,131.52,-922.23,141.61,-897.2,112.59,-1107.02,115.33,-1078.98,119.37,-1047.08,125.89,-1024.61,136.75,-1001.74,175.24,-940.17,195.79,-918.19,213.52,-899.26,247,-873.99,278.62,-846.97,319.34,-806.62,356.53,-739.48,388.43,-663.48,415.13,-589.82,230.49,-773.79,274.13,-709.03,304.79,-633.2,332.47,-554.11,-4.85,-1119.41],"uvs":[0.24442,0.02111,0.2619,0.04229,0.28213,0.08198,0.25823,0.13008,0.28948,0.17239,0.3097,0.20726,0.33544,0.24093,0.3594,0.27084,0.398,0.29249,0.4844,0.35838,0.52484,0.38844,0.56896,0.41249,0.7197,0.42813,0.77117,0.463,0.83919,0.52193,0.89979,0.60582,0.98435,0.68876,1,0.78617,0.99999,0.8909,0.88953,0.95788,0.75524,1,0.59348,0.99998,0.49538,0.91364,0.46045,0.82225,0.41265,0.72488,0.36308,0.63978,0.32264,0.58085,0.39617,0.56161,0.39065,0.51952,0.33102,0.48722,0.28055,0.47773,0.27569,0.50381,0.25094,0.51231,0.21234,0.47743,0.1958,0.44256,0.14432,0.35021,0.1241,0.32015,0.10198,0.29144,0.09278,0.25777,0.09095,0.23131,0.08727,0.20704,0.04426,0.21538,0,0.2229,0,0.17583,0.09473,0.11937,0.10381,0.07837,0.12494,0,0.17273,0,0.15914,0.0679,0.16138,0.11445,0.17017,0.16884,0.17179,0.20593,0.18263,0.23609,0.19286,0.27125,0.2102,0.30178,0.23222,0.33146,0.29155,0.41877,0.31146,0.45106,0.25418,0.18038,0.25959,0.21656,0.26754,0.25771,0.2804,0.2867,0.30181,0.3162,0.37775,0.39562,0.41828,0.42397,0.45328,0.44839,0.5193,0.48096,0.58168,0.51582,0.662,0.56789,0.73538,0.65452,0.79831,0.75257,0.851,0.84761,0.48679,0.61027,0.57289,0.69381,0.63337,0.79165,0.688,0.8937,0.04478,0.15083],"triangles":[71,19,18,16,70,17,70,71,17,71,18,17,15,70,16,71,75,19,14,69,15,69,70,15,75,20,19,68,69,14,70,74,71,74,75,71,13,68,14,69,74,70,73,74,69,75,21,20,12,67,13,67,68,13,68,73,69,72,73,68,74,22,75,22,21,75,23,22,74,67,72,68,73,23,74,24,23,73,65,66,11,66,27,67,27,72,67,10,65,11,72,24,73,28,27,66,25,24,72,9,64,10,64,65,10,65,28,66,63,64,9,8,63,9,27,25,72,29,28,65,64,29,65,62,63,8,26,25,27,63,57,64,57,29,64,56,57,63,7,62,8,62,56,63,55,56,62,61,62,7,6,61,7,57,30,29,60,61,6,5,59,6,59,60,6,4,58,5,58,59,5,55,34,56,61,55,62,35,34,55,54,55,61,3,58,4,32,31,30,33,32,30,49,3,2,48,49,2,1,48,2,60,54,61,53,54,60,59,52,60,50,58,3,52,53,60,58,51,59,0,48,1,49,50,3,51,52,59,50,51,58,47,48,0,54,35,55,36,35,54,53,36,54,46,48,47,37,36,53,52,38,53,38,37,53,49,44,50,51,39,52,39,38,52,46,45,48,48,45,49,50,40,51,40,39,51,45,44,49,76,41,40,76,43,41,43,42,41,76,44,40,44,40,50,30,33,57,56,34,57,34,33,57,67,66,12,11,66,12],"weights":[2,19,0.77,11,0.23,2,19,0.85,11,0.15,1,19,1,1,19,1,2,19,0.94399,22,0.056,2,19,0.808,22,0.19199,2,19,0.504,22,0.49599,2,19,0.11199,22,0.888,2,19,0.04799,22,0.952,2,22,0.89599,23,0.104,2,22,0.46399,23,0.536,2,22,0.384,23,0.61599,2,22,0.328,23,0.67199,2,22,0.239353,23,0.760637,2,22,0.067004,23,0.932974,1,23,0.999976,1,23,0.999987,1,23,0.999987,1,23,0.999985,1,23,0.999985,1,23,0.999969,1,23,0.999984,1,23,0.999969,1,23,0.999985,1,23,0.999987,1,23,0.999989,1,23,1,1,23,1,1,23,1,2,22,0.096,23,0.90399,2,22,0.18399,23,0.816,1,23,1,1,23,1,2,22,0.864,23,0.13598,2,22,0.84799,23,0.15199,2,19,0.032,22,0.968,2,19,0.136,22,0.86399,2,19,0.50399,22,0.496,3,19,0.74,22,0.13,7,0.13,3,19,0.73,22,0.03,7,0.24,3,19,0.51,7,0.32,11,0.17,3,7,0.49,19,0.24,11,0.27,2,7,0.75,11,0.25,3,19,0.38,7,0.22,11,0.4,3,19,0.56,7,0.08,11,0.36,2,19,0.51,11,0.49,2,19,0.62,11,0.38,2,19,0.76,11,0.24,3,19,0.66,7,0.14,11,0.2,3,19,0.7,7,0.17,11,0.13,3,19,0.79,22,0.04,7,0.17,3,19,0.75,22,0.12,7,0.13,2,19,0.47199,22,0.528,2,19,0.128,22,0.87199,2,19,0.07999,22,0.92,2,22,0.88799,23,0.112,2,22,0.48,23,0.51999,2,19,0.94399,22,0.056,2,19,0.816,22,0.18399,2,19,0.48,22,0.51999,2,19,0.16,22,0.83999,2,19,0.03999,22,0.96,2,22,0.896,23,0.10399,2,22,0.51199,23,0.488,2,22,0.23199,23,0.768,2,22,0.15199,23,0.84799,2,22,0.140867,23,0.859112,1,23,0.999989,1,23,0.999989,1,23,0.999987,1,23,0.999986,1,23,0.999989,1,23,0.999988,1,23,0.999987,1,23,0.999971,3,19,0.24,7,0.26,11,0.5,2,7,0.86,11,0.14],"slotPose":[1,0,0,1,0,0],"bonePose":[19,0.193207,0.981158,-0.981158,0.193207,42.671847,-1232.663838,22,0.385906,0.922538,-0.922538,0.385906,81.127245,-1035.875814,23,0.400349,0.916363,-0.916363,0.400349,139.903737,-897.076346,7,0.133294,-0.991076,0.991076,0.133294,-102.984795,-1028.747532,11,0.307689,-0.951487,0.951487,0.307689,-89.274708,-1129.03497],"edges":[43,42,42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,47,47,46,46,45,45,44,44,76,76,43],"userEdges":[44,40,45,48,48,1,46,48,44,49,49,2,48,49,40,50,50,3,49,50,39,51,50,51,38,52,51,52,37,53,52,53,36,54,53,54,35,55,54,55,34,56,55,56,33,57,56,57,57,29,4,58,58,51,3,58,5,59,59,52,58,59,6,60,60,53,59,60,7,61,61,54,60,61,8,62,62,55,61,62,9,63,63,56,62,63,10,64,64,57,63,64,11,65,65,29,64,65,28,66,66,12,65,66,27,67,67,13,66,67,68,14,67,68,69,15,68,69,70,16,69,70,17,71,70,71,71,19,25,72,72,68,27,72,24,73,73,69,72,73,23,74,74,70,73,74,22,75,75,71,74,75,75,20]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_tex.json b/Egret/Demos/resource/you_xin/suit2/20208006_tex.json
new file mode 100644
index 00000000..335ea3c4
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/20208006_tex.json
@@ -0,0 +1 @@
+{"width":2048,"SubTexture":[{"width":398,"y":778,"height":782,"name":"cloak/20208006_2","x":1035},{"width":262,"y":1036,"height":936,"name":"coat/2040600b","x":1435},{"width":371,"y":1,"height":1033,"name":"cloak/20208006","x":1544},{"width":507,"y":1,"height":775,"name":"cloak/20208006_1","x":1035},{"width":1032,"y":1,"height":855,"name":"cloak/20208006_3","x":1}],"height":2048,"name":"20208006","imagePath":"20208006_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/20208006_tex.png b/Egret/Demos/resource/you_xin/suit2/20208006_tex.png
new file mode 100644
index 00000000..9e6e7a6c
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit2/20208006_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit2/20509007_ske.json b/Egret/Demos/resource/you_xin/suit2/20509007_ske.json
new file mode 100644
index 00000000..3170472c
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/20509007_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"20509007","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"20509007","aabb":{"x":-523.67,"y":-1066.92,"width":899,"height":1009},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":154,"name":"dress0101","parent":"pelvis","transform":{"x":-82.25,"y":-25.45,"skX":102.82,"skY":102.82}},{"length":138,"name":"dress0201","parent":"pelvis","transform":{"x":1.75,"y":17.13,"skX":89.26,"skY":89.26}},{"length":169,"name":"dress0301","parent":"pelvis","transform":{"x":113.59,"y":-30.15,"skX":74.24,"skY":74.24}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":176,"name":"dress0102","parent":"dress0101","transform":{"x":154.48,"y":1.04,"skX":-1.8,"skY":-1.8}},{"length":161,"name":"dress0202","parent":"dress0201","transform":{"x":138.34,"y":-0.27,"skX":-1.35,"skY":-1.35}},{"length":161,"name":"dress0302","parent":"dress0301","transform":{"x":169.23,"y":-0.5,"skX":2.25,"skY":2.25}},{"length":181,"name":"dress0303","parent":"dress0302","transform":{"x":162.95,"y":-0.17,"skX":-1.36,"skY":-1.36}},{"length":182,"name":"dress0203","parent":"dress0202","transform":{"x":161.4,"y":-0.1,"skX":-0.9,"skY":-0.9}},{"length":171,"name":"dress0103","parent":"dress0102","transform":{"x":176.75,"y":-0.35,"skX":-0.9,"skY":-0.9}},{"length":193,"name":"dress0104","parent":"dress0103","transform":{"x":171.1,"y":-0.63}},{"length":200,"name":"dress0204","parent":"dress0203","transform":{"x":183.88,"y":1.16,"skX":2.25,"skY":2.25}},{"length":192,"name":"dress0304","parent":"dress0303","transform":{"x":181.23,"y":-0.11}},{"length":157,"name":"dress0205","parent":"dress0204","transform":{"x":200.46,"y":0.5}},{"length":147,"name":"dress0305","parent":"dress0304","transform":{"x":192.32,"y":-0.67,"skX":0.45,"skY":0.45}},{"length":178,"name":"dress0105","parent":"dress0104","transform":{"x":193.05,"y":-1.28,"skX":0.9,"skY":0.9}}],"slot":[{"name":"1029","parent":"root"}],"skin":[{"slot":[{"name":"1029","display":[{"type":"mesh","name":"dress/20509007","width":899,"height":1009,"vertices":[23.18,-986.61,56.4,-930.52,95.91,-866.75,144.08,-792.59,173.81,-713.66,212.24,-632.29,250.16,-556.42,282.96,-473.83,322.86,-381.2,358.45,-290.27,396.92,-195.58,399.32,-119.5,293.2,-71.5,106.78,-44.29,-53.99,-30.7,-232.54,-30.71,-389.35,-44.35,-499.84,-94.77,-499.87,-168.1,-481.19,-263.72,-452.2,-360.81,-423.41,-456.54,-392.63,-546.28,-362.87,-627.24,-331.55,-709.63,-300.78,-785.47,-270.56,-859.49,-244.81,-924.06,-211.76,-985.88,-183.2,-1039.69,-140.64,-1033.28,-101.41,-1033.27,-58.98,-1034.06,-6.55,-1039.64,-104.15,-970.66,-104.61,-910.71,-104.03,-849.36,-99.32,-775.04,-97.4,-693.06,-94.19,-611.12,-92.61,-528.56,-89.17,-443.04,-81.17,-345.64,-72.94,-247.65,-64.28,-138.53,-157.81,-976.27,-176.38,-917.27,-170.8,-851.89,-176.6,-776.24,-183.15,-694.03,-191,-612.73,-198.43,-528.53,-205.96,-441.03,-212.96,-345.3,-218.51,-243.74,-226.02,-137.86,-216.08,-852.35,-237.67,-777.82,-254.25,-697.45,-276.85,-616.04,-296.63,-531,-315.96,-444.75,-338.5,-349.52,-353.9,-252.6,-370.23,-150.47,-40.8,-976.24,-27.37,-918.09,-30.16,-854.26,-16.67,-777.35,0.73,-694.66,14.92,-613.76,33.28,-532.96,47.75,-447.15,61.17,-356.61,74.86,-260.25,90.46,-150.18,20.82,-857.8,58.33,-783,85.36,-700.91,112.59,-620.97,144.12,-540.31,178.02,-459.94,204.78,-368.42,232.89,-274.19,261.46,-172.98],"uvs":[0.58159,0.05253,0.61857,0.10817,0.66254,0.17138,0.71613,0.24489,0.74919,0.32311,0.79192,0.40376,0.8341,0.47893,0.87059,0.56078,0.91496,0.6526,0.95456,0.74273,0.99733,0.83658,0.99999,0.91199,0.88195,0.95956,0.67461,0.98652,0.49582,1,0.29727,1,0.1229,0.98652,0,0.93657,0,0.86391,0.02077,0.76915,0.053,0.67292,0.08502,0.57805,0.11923,0.48909,0.15229,0.40884,0.18709,0.32717,0.2213,0.252,0.25489,0.17862,0.28351,0.11462,0.32024,0.05332,0.352,0,0.39935,0.00634,0.443,0.00634,0.49019,0.00555,0.54851,0,0.43994,0.06838,0.43948,0.12781,0.44013,0.18864,0.44537,0.26226,0.44752,0.34352,0.4511,0.42472,0.45287,0.50655,0.45671,0.5913,0.46562,0.68786,0.47477,0.78495,0.48439,0.89312,0.38026,0.06283,0.35963,0.12133,0.36586,0.18612,0.3594,0.26109,0.35215,0.34258,0.34345,0.42315,0.3352,0.50661,0.32684,0.59333,0.31904,0.6882,0.31287,0.78886,0.30455,0.89381,0.31549,0.18568,0.29149,0.25954,0.27308,0.33922,0.24797,0.41991,0.22601,0.50421,0.2045,0.58967,0.17947,0.68406,0.16232,0.78011,0.14419,0.88134,0.51042,0.06283,0.52538,0.12051,0.5223,0.18377,0.5373,0.25999,0.55666,0.34192,0.57245,0.4221,0.59288,0.50217,0.60899,0.58724,0.6239,0.67697,0.63912,0.77247,0.65646,0.88156,0.57901,0.18027,0.62074,0.25438,0.65079,0.33574,0.68109,0.41496,0.71616,0.4949,0.75387,0.57454,0.78362,0.66526,0.8149,0.75865,0.84665,0.85897],"triangles":[9,84,10,10,84,11,84,12,11,8,83,9,83,84,9,7,82,8,82,83,8,81,82,7,84,13,12,75,13,84,6,81,7,80,81,6,83,75,84,74,75,83,5,80,6,82,74,83,73,74,82,4,79,5,79,80,5,81,73,82,3,78,4,78,79,4,80,72,81,72,73,81,79,71,80,71,72,80,2,77,3,77,78,3,75,14,13,78,70,79,70,71,79,44,14,75,76,77,2,43,44,74,69,70,78,74,44,75,1,76,2,77,69,78,68,69,77,42,43,73,73,43,74,41,42,72,66,76,1,76,68,77,72,42,73,0,66,1,40,41,71,71,41,72,67,68,76,65,66,0,70,40,71,69,39,70,39,40,70,66,67,76,33,65,0,38,39,69,37,38,68,32,65,33,68,38,69,67,37,68,36,37,67,35,67,66,34,35,65,35,36,67,65,35,66,31,34,32,32,34,65,43,54,44,54,55,44,55,15,44,44,15,14,42,53,43,53,54,43,41,52,42,52,53,42,38,49,39,49,50,39,39,50,40,50,51,40,40,51,41,51,52,41,47,48,36,30,34,31,36,48,37,37,48,38,48,49,38,30,45,34,47,36,35,34,45,35,45,46,35,46,47,35,29,45,30,56,48,47,46,56,47,28,46,45,29,28,45,58,50,49,57,58,49,28,27,46,27,56,46,57,49,48,56,57,48,59,51,50,58,59,50,61,53,52,60,52,51,59,60,51,62,54,53,60,61,52,63,55,54,62,63,54,26,57,56,27,26,56,61,62,53,64,15,55,63,64,55,64,16,15,25,58,57,26,25,57,25,24,58,24,59,58,23,60,59,24,23,59,22,61,60,23,22,60,22,21,61,21,62,61,20,63,62,21,20,62,19,18,64,19,64,63,20,19,63,17,16,64,18,17,64],"weights":[2,5,0.07903,12,0.920948,2,6,0.56,5,0.43999,3,6,0.00006,5,0.87309,9,0.12684,3,6,0.00001,5,0.35852,9,0.64146,3,5,0.05954,9,0.74203,10,0.19841,3,9,0.34825,10,0.62145,15,0.03029,4,9,0.07485,10,0.68029,15,0.20485,2,0.03999,5,9,0.00573,10,0.33108,15,0.51311,17,0.01406,2,0.13598,4,10,0.04449,15,0.54638,17,0.14511,2,0.264,5,10,0.00119,15,0.26773,17,0.37905,14,0.00001,2,0.35199,5,15,0.07858,17,0.49733,16,0.00003,14,0.00004,2,0.424,5,15,0.03176,17,0.50379,16,0.00036,14,0.00006,2,0.464,4,15,0.0016,17,0.39353,16,0.10886,2,0.49599,5,17,0.26582,16,0.2378,14,0.00707,18,0.00129,2,0.48799,5,17,0.08914,16,0.32381,14,0.00002,18,0.083,2,0.50399,4,17,0.00049,16,0.24727,18,0.27223,2,0.47999,3,16,0.06854,18,0.43545,2,0.49599,3,13,0.0086,18,0.46339,2,0.52799,3,13,0.06016,18,0.57182,2,0.36799,4,12,0.0003,13,0.28206,18,0.40563,2,0.31199,4,12,0.05026,13,0.58433,18,0.14138,2,0.224,4,12,0.33207,13,0.53225,18,0.00766,2,0.128,4,7,0.07817,12,0.69455,13,0.16326,2,0.064,4,7,0.41819,12,0.57744,13,0.00429,18,0.00004,4,3,0.03438,7,0.82635,12,0.13924,18,0.00001,2,3,0.34741,7,0.65258,3,3,0.82899,7,0.17083,12,0.00016,2,6,0.552,3,0.44799,2,3,0.151709,12,0.848257,1,12,0.999981,1,12,0.999981,1,12,0.999981,1,12,0.999979,1,12,0.99998,2,6,0.13599,12,0.863989,4,6,0.26572,5,0.22767,4,0.2615,3,0.24509,3,5,0.128,4,0.66969,3,0.2023,6,5,0.1008,9,0.16,8,0.26567,4,0.26567,3,0.10729,7,0.10053,3,9,0.168,8,0.6323,7,0.19967,6,9,0.11532,10,0.15199,11,0.25839,8,0.25839,7,0.11038,12,0.1055,6,9,0.00548,10,0.21388,11,0.52139,8,0.09165,12,0.13556,2,0.032,7,10,0.11831,15,0.13254,14,0.2252,11,0.2252,12,0.06141,13,0.10932,2,0.12799,4,15,0.1536,14,0.44728,13,0.16711,2,0.23199,7,15,0.07483,17,0.11136,16,0.0825,14,0.25794,13,0.05886,18,0.11048,2,0.30399,4,17,0.1198,16,0.38721,18,0.11697,2,0.37599,2,3,0.10595,12,0.894028,2,6,0.48,3,0.51999,2,4,0.46399,3,0.536,4,8,0.31433,4,0.34723,3,0.11916,7,0.21925,5,11,0.00682,8,0.46595,4,0.05856,3,0.00424,7,0.4644,4,11,0.22681,8,0.25055,7,0.33765,12,0.18496,7,14,0.00371,11,0.3721,8,0.08825,7,0.02846,12,0.42321,13,0.02177,2,0.06246,6,14,0.19345,11,0.2815,8,0.00101,12,0.23376,13,0.17025,2,0.12,6,14,0.33581,11,0.10927,12,0.04641,13,0.25922,18,0.00126,2,0.248,5,16,0.12676,14,0.25932,13,0.15711,18,0.11279,2,0.344,6,17,0.00017,16,0.25671,14,0.0343,13,0.01488,18,0.33392,2,0.35999,2,4,0.26399,3,0.736,4,8,0.12,4,0.16896,3,0.35551,7,0.35551,2,8,0.23199,7,0.768,4,11,0.09109,8,0.10922,7,0.41969,12,0.37997,3,11,0.19872,12,0.72127,2,0.08,5,14,0.09676,11,0.11048,12,0.32837,13,0.32837,2,0.13598,3,14,0.14278,13,0.63321,2,0.224,5,16,0.07154,14,0.11835,13,0.24551,18,0.25257,2,0.31199,4,16,0.09971,13,0.01373,18,0.54254,2,0.34399,2,5,0.097209,12,0.902769,2,6,0.47199,5,0.528,3,5,0.47063,8,0.01286,4,0.51649,4,5,0.2071,9,0.17988,8,0.32211,4,0.29089,6,5,0.06528,9,0.40961,10,0.02462,11,0.01837,8,0.42196,4,0.06012,5,9,0.33357,10,0.22339,14,0.00018,11,0.20875,8,0.23409,7,9,0.0625,10,0.41096,15,0.01678,14,0.03073,11,0.34768,8,0.08331,2,0.04799,6,10,0.16483,15,0.17348,14,0.23133,11,0.30892,8,0.00142,2,0.12,7,10,0.03895,15,0.33048,17,0.0131,16,0.01312,14,0.31287,11,0.05146,2,0.24,6,15,0.20412,17,0.15388,16,0.10724,14,0.20669,18,0.00004,2,0.32799,6,15,0.02469,17,0.29233,16,0.25217,14,0.03025,18,0.00053,2,0.4,2,5,0.736,4,0.26399,4,5,0.34598,9,0.34598,8,0.15199,4,0.15603,2,9,0.752,8,0.24799,4,9,0.34212,10,0.33068,11,0.16576,8,0.16142,3,10,0.72633,11,0.20966,2,0.064,6,9,0.00142,10,0.3254,15,0.31605,14,0.09235,11,0.15276,2,0.11199,5,10,0.01543,15,0.59855,17,0.01922,14,0.14278,2,0.22399,5,15,0.35228,17,0.1593,16,0.09113,14,0.10927,2,0.28799,4,15,0.0284,17,0.47578,16,0.1198,2,0.37599],"slotPose":[1,0,0,1,0,0],"bonePose":[5,0.271608,0.962408,-0.962408,0.271608,6.41,-943.15,12,-0.17571,0.984442,-0.984442,-0.17571,-258.163974,-614.493923,6,0.055124,-0.998479,0.998479,0.055124,-108.99,-931.04,9,0.233615,0.972329,-0.972329,0.233615,52.855498,-780.417524,15,0.256627,0.966511,-0.966511,0.256627,137.703154,-446.883718,14,0.012915,0.999917,-0.999917,0.012915,-88.954208,-412.565856,3,-0.221889,0.975072,-0.975072,-0.221889,-189.43,-938.45,10,0.256627,0.966511,-0.966511,0.256627,91.08837,-622.016202,2,1,0,0,1,-107.18,-913,17,0.249028,0.968496,-0.968496,0.249028,187.705176,-261.176343,16,0.012915,0.999917,-0.999917,0.012915,-86.86521,-212.116118,18,-0.191152,0.981561,-0.981561,-0.191152,-320.268622,-255.673797,13,-0.17571,0.984442,-0.984442,-0.17571,-287.60782,-445.945216,7,-0.191152,0.981561,-0.981561,-0.191152,-224.721468,-788.051648,4,0.012915,0.999917,-0.999917,0.012915,-105.43,-895.87,8,0.036469,0.999335,-0.999335,0.036469,-103.373351,-757.545025,11,0.052162,0.998639,-0.998639,0.052162,-97.387273,-596.256039],"edges":[17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17],"userEdges":[31,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,14,28,45,45,34,30,45,27,46,46,35,45,46,47,36,46,47,48,37,47,48,49,38,48,49,50,39,49,50,51,40,50,51,52,41,51,52,53,42,52,53,54,43,53,54,55,44,54,55,55,15,26,56,56,47,46,56,25,57,57,48,56,57,24,58,58,49,57,58,23,59,59,50,58,59,22,60,60,51,59,60,21,61,61,52,60,61,20,62,62,53,61,62,19,63,63,54,62,63,18,64,64,55,63,64,64,16,0,65,65,34,32,65,1,66,66,35,65,66,67,36,66,67,68,37,67,68,69,38,68,69,70,39,69,70,71,40,70,71,72,41,71,72,73,42,72,73,74,43,73,74,75,44,74,75,75,13,2,76,76,67,66,76,3,77,77,68,76,77,4,78,78,69,77,78,5,79,79,70,78,79,6,80,80,71,79,80,7,81,81,72,80,81,8,82,82,73,81,82,9,83,83,74,82,83,10,84,84,75,83,84,84,12]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/20509007_tex.json b/Egret/Demos/resource/you_xin/suit2/20509007_tex.json
new file mode 100644
index 00000000..2d9f759b
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/20509007_tex.json
@@ -0,0 +1 @@
+{"width":1024,"SubTexture":[{"width":899,"y":1,"height":1009,"name":"dress/20509007","x":1}],"height":1024,"name":"20509007","imagePath":"20509007_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/20509007_tex.png b/Egret/Demos/resource/you_xin/suit2/20509007_tex.png
new file mode 100644
index 00000000..d2e1d3d8
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit2/20509007_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit2/20703020_ske.json b/Egret/Demos/resource/you_xin/suit2/20703020_ske.json
new file mode 100644
index 00000000..5bc359bb
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/20703020_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"20703020","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"20703020","aabb":{"x":-125.5,"y":-136.87,"width":283.58,"height":203.42},"bone":[{"name":"root"},{"name":"bone_ikTarget","parent":"root","transform":{"x":123.7088,"y":-121.9447}},{"name":"nv","parent":"root"},{"name":"ik_foot_l","parent":"nv","transform":{"x":-58.79,"y":-68.24,"skX":100.64,"skY":100.64}},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":407,"name":"thigh_l","parent":"pelvis","transform":{"x":-39.11,"y":33.29,"skX":85.04,"skY":85.04}},{"length":393,"name":"thigh_r","parent":"pelvis","transform":{"x":77.79,"y":26.43,"skX":93.63,"skY":93.63}},{"length":408,"name":"calf_l","parent":"thigh_l","transform":{"x":407.97,"y":-1.43,"skX":-2.7,"skY":-2.7}},{"length":410,"name":"calf_r","parent":"thigh_r","transform":{"x":395.5,"y":-1.18,"skX":-29.2,"skY":-29.2}},{"inheritRotation":false,"length":108,"name":"foot_l","parent":"calf_l","transform":{"x":411.64,"y":0.23,"skX":103.24,"skY":103.24}},{"inheritRotation":false,"length":97,"name":"foot_r","parent":"calf_r","transform":{"x":410.23,"y":-1.14,"skX":87.83,"skY":87.83}}],"slot":[{"name":"1023","parent":"root"},{"name":"1022","parent":"root"}],"ik":[{"bendPositive":false,"chain":1,"name":"ik_foot_l","bone":"calf_l","target":"ik_foot_l"},{"bendPositive":false,"chain":1,"name":"bone_ik","bone":"calf_r","target":"bone_ikTarget"}],"skin":[{"slot":[{"name":"1022","display":[{"type":"mesh","name":"shoe/20703020_1","width":79,"height":132,"vertices":[161.99,-102.35,161.7,2.59,82.7,2.38,82.85,-47.95,92.74,-98.64,92.8,-122.73,155.24,-129.42],"uvs":[1,0.20492,1,1,0,1,0,0.61874,0.12347,0.23448,0.12337,0.05203,0.91356,0.00001],"triangles":[3,2,1,6,4,0,3,1,0,4,3,0,5,4,6],"weights":[2,10,0.936,8,0.06398,1,10,1,1,10,1,1,10,1,2,10,0.92,8,0.07999,2,10,0.512,8,0.48799,2,10,0.53599,8,0.464],"slotPose":[1,0,0,1,0,0],"bonePose":[10,0.03769,0.999289,-0.999289,0.03769,124.83646,-122.229299,8,0.431613,0.902059,-0.902059,0.431613,-53.252689,-491.788776],"edges":[2,1,1,0,0,6,6,5,5,4,4,3,3,2],"userEdges":[4,0]}]},{"name":"1023","display":[{"type":"mesh","name":"shoe/20703020","width":92,"height":138,"vertices":[-27.01,-40.69,-26.64,78.07,-118.63,78.35,-118.81,21.66,-96.29,0.4,-89.6,-38.22,-88.9,-59.73,-27.07,-59.93],"uvs":[1,0.1394,1,1,0,1,0,0.58922,0.2455,0.43562,0.31956,0.15586,0.32778,0,1,0],"triangles":[6,5,0,5,4,0,4,3,1,3,2,1,0,4,1,6,0,7],"weights":[2,7,0.104,9,0.89599,1,9,1,1,9,1,1,9,1,1,9,1,2,7,0.08,9,0.91999,2,7,0.45599,9,0.544,2,7,0.44799,9,0.552],"slotPose":[1,0,0,1,0,0],"bonePose":[7,0.133294,0.991076,-0.991076,0.133294,-109.592168,-473.391363,9,-0.202787,0.979223,-0.979223,-0.202787,-54.950844,-65.393975],"edges":[2,1,1,0,0,7,7,6,6,5,5,4,4,3,3,2],"userEdges":[5,0]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/20703020_tex.json b/Egret/Demos/resource/you_xin/suit2/20703020_tex.json
new file mode 100644
index 00000000..2212a0c0
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/20703020_tex.json
@@ -0,0 +1 @@
+{"width":256,"SubTexture":[{"width":92,"y":1,"height":138,"name":"shoe/20703020","x":1},{"width":79,"y":1,"height":132,"name":"shoe/20703020_1","x":95}],"height":256,"name":"20703020","imagePath":"20703020_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/20703020_tex.png b/Egret/Demos/resource/you_xin/suit2/20703020_tex.png
new file mode 100644
index 00000000..2599597f
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit2/20703020_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit2/20801015_ske.json b/Egret/Demos/resource/you_xin/suit2/20801015_ske.json
new file mode 100644
index 00000000..e66c1d59
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/20801015_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"20801015","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"20801015","aabb":{"x":-189.75,"y":-1559.87,"width":243,"height":251},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"length":71,"name":"neck","parent":"spine2","transform":{"x":172.12,"y":0.19,"skX":-17.89,"skY":-17.89}},{"length":88,"name":"head","parent":"neck","transform":{"x":71.14,"y":-0.04,"skX":-13.29,"skY":-13.29}},{"name":"hair","parent":"head","transform":{"x":187.01,"y":-14.39}},{"length":100,"name":"hair0501","parent":"hair","transform":{"x":-113.42,"y":-63.08,"skX":-162.11,"skY":-162.11}},{"length":100,"name":"hair0601","parent":"hair","transform":{"x":-131.71,"y":66.14,"skX":-172.88,"skY":-172.88}}],"slot":[{"name":"1003","parent":"root"}],"skin":[{"slot":[{"name":"1003","display":[{"type":"mesh","name":"headwear/20801015","width":243,"height":251,"vertices":[29.6,-1544.57,26.54,-1504.11,32.06,-1463.04,19.79,-1441.57,17.34,-1404.18,25.31,-1378.44,38.16,-1371.31,46.15,-1391.31,27.77,-1411.54,46.16,-1441.58,60.8,-1424.43,60.8,-1399.89,57.7,-1369.5,41.24,-1351.46,21.01,-1355.13,7.54,-1375.37,5.08,-1402.34,3.86,-1444.02,-13.31,-1467.95,-53.15,-1471.01,-50.08,-1506.56,-69.7,-1518.83,-99.72,-1480.82,-133.45,-1504.73,-154.29,-1493.08,-124.86,-1459.36,-143.87,-1436.07,-161.03,-1453.23,-157.35,-1409.7,-157.96,-1364.95,-155.51,-1338.6,-142.03,-1328.18,-130.38,-1341.66,-127.92,-1366.8,-113.21,-1349.64,-118.74,-1326.94,-133.46,-1316.34,-158.58,-1316.34,-170.84,-1335.53,-171.45,-1370.47,-171.45,-1401.12,-182.18,-1418.91,-182.18,-1440.37,-170.84,-1509.02,-151.22,-1521.89,-162.25,-1532.3,-151.83,-1549.47,-100.34,-1553.15,-59.89,-1552.53,-32.31,-1543.34,-15.76,-1567.33,5.09,-1567.34],"uvs":[0.87161,0.09073,0.85899,0.25191,0.8817,0.41555,0.83124,0.50102,0.82115,0.65,0.85395,0.75257,0.90682,0.78089,0.93972,0.70129,0.86404,0.62069,0.93972,0.50102,1,0.56941,0.99998,0.6671,0.98724,0.78819,0.91954,0.86003,0.83629,0.84538,0.78079,0.76478,0.7707,0.65733,0.76565,0.49125,0.69502,0.39601,0.53105,0.3838,0.54366,0.24215,0.46294,0.1933,0.33933,0.34472,0.20059,0.24947,0.11482,0.29588,0.2359,0.4302,0.1577,0.523,0.08707,0.45462,0.1022,0.62802,0.09968,0.8063,0.10977,0.91132,0.16527,0.95284,0.2132,0.89911,0.22329,0.79898,0.28383,0.86736,0.26113,0.95772,0.20059,1,0.09716,1,0.0467,0.92353,0.04418,0.78432,0.04418,0.66221,0.00001,0.59139,0,0.50591,0.0467,0.23238,0.12743,0.18109,0.08202,0.13957,0.12491,0.07119,0.33681,0.05654,0.5033,0.05898,0.61682,0.09561,0.68493,0,0.7707,0],"triangles":[7,6,12,8,7,11,7,12,11,8,11,10,9,8,10,6,13,12,6,14,13,1,18,2,5,14,6,49,1,0,17,3,2,18,17,2,17,4,3,15,14,5,4,15,5,51,49,0,16,15,4,17,16,4,20,18,1,49,20,1,50,49,51,20,19,18,21,20,49,48,21,49,47,21,48,47,23,21,23,22,21,44,23,47,46,44,47,32,35,34,33,32,34,32,31,35,31,36,35,27,26,25,24,27,25,40,29,28,31,37,36,44,24,23,40,39,29,43,24,44,46,45,44,30,37,31,42,41,28,29,38,30,38,37,30,43,27,24,43,42,27,39,38,29,41,40,28,27,42,28],"weights":[1,8,1,1,8,1,1,8,1,2,8,0.888,10,0.11199,2,8,0.68799,10,0.312,2,8,0.488,10,0.51199,2,8,0.28799,10,0.71199,2,8,0.82399,10,0.176,1,8,1,1,8,1,1,8,1,2,8,0.808,10,0.19199,2,8,0.51199,10,0.488,2,8,0.36799,10,0.632,2,8,0.27998,10,0.72,2,8,0.59999,10,0.4,2,8,0.57599,10,0.424,2,8,0.904,10,0.09599,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,2,8,0.92,9,0.07999,2,8,0.6,9,0.39999,2,8,0.4,9,0.59999,2,8,0.40799,9,0.592,2,8,0.624,9,0.37599,1,8,1,1,8,1,2,8,0.55999,9,0.44,2,8,0.368,9,0.63199,2,8,0.41599,9,0.584,2,8,0.52799,9,0.472,2,8,0.768,9,0.23199,2,8,0.856,9,0.14399,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1,1,8,1],"slotPose":[1,0,0,1,0,0],"bonePose":[8,-0.22937,-0.973339,0.973339,-0.22937,-93.038172,-1542.610006,10,0.106958,0.994264,-0.994264,0.106958,1.548844,-1429.582044,9,-0.080721,0.996737,-0.996737,-0.080721,-128.421235,-1417.745192],"edges":[42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,51,51,50,50,49,49,48,48,47,47,46,46,45,45,44,44,43,43,42],"userEdges":[18,1,40,28]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/20801015_tex.json b/Egret/Demos/resource/you_xin/suit2/20801015_tex.json
new file mode 100644
index 00000000..173a3a0c
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/20801015_tex.json
@@ -0,0 +1 @@
+{"width":256,"SubTexture":[{"width":243,"y":1,"height":251,"name":"headwear/20801015","x":1}],"height":256,"name":"20801015","imagePath":"20801015_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/20801015_tex.png b/Egret/Demos/resource/you_xin/suit2/20801015_tex.png
new file mode 100644
index 00000000..0a1f2dd2
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit2/20801015_tex.png differ
diff --git a/Egret/Demos/resource/you_xin/suit2/2080b003_ske.json b/Egret/Demos/resource/you_xin/suit2/2080b003_ske.json
new file mode 100644
index 00000000..e607b99b
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/2080b003_ske.json
@@ -0,0 +1 @@
+{"frameRate":30,"name":"2080b003","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"2080b003","aabb":{"x":-470.13,"y":-1265.77,"width":810,"height":940},"bone":[{"name":"root"},{"name":"nv","parent":"root"},{"name":"pelvis","parent":"nv","transform":{"x":-107.18,"y":-913}},{"length":154,"name":"dress0101","parent":"pelvis","transform":{"x":-82.25,"y":-25.45,"skX":102.82,"skY":102.82}},{"length":169,"name":"dress0301","parent":"pelvis","transform":{"x":113.59,"y":-30.15,"skX":74.24,"skY":74.24}},{"length":97,"name":"spine","parent":"pelvis","transform":{"x":-1.81,"y":-18.04,"skX":-86.84,"skY":-86.84}},{"length":176,"name":"dress0102","parent":"dress0101","transform":{"x":154.48,"y":1.04,"skX":-1.8,"skY":-1.8}},{"length":161,"name":"dress0302","parent":"dress0301","transform":{"x":169.23,"y":-0.5,"skX":2.25,"skY":2.25}},{"length":101,"name":"spine1","parent":"spine","transform":{"x":97.89,"y":0.61,"skX":4.5,"skY":4.5}},{"length":171,"name":"dress0103","parent":"dress0102","transform":{"x":176.75,"y":-0.35,"skX":-0.9,"skY":-0.9}},{"length":181,"name":"dress0303","parent":"dress0302","transform":{"x":162.95,"y":-0.17,"skX":-1.36,"skY":-1.36}},{"length":172,"name":"spine2","parent":"spine1","transform":{"x":101.22,"y":0.22,"skX":10.26,"skY":10.26}},{"length":193,"name":"dress0104","parent":"dress0103","transform":{"x":171.1,"y":-0.63}},{"length":192,"name":"dress0304","parent":"dress0303","transform":{"x":181.23,"y":-0.11}},{"length":195,"name":"upperarm_l","parent":"spine2","transform":{"x":93.55,"y":-65.17,"skX":-179.09,"skY":-179.09}},{"length":200,"name":"upperarm_r","parent":"spine2","transform":{"x":139.2,"y":93.66,"skX":150.94,"skY":150.94}},{"length":166,"name":"forearm_l","parent":"upperarm_l","transform":{"x":194.88,"y":0.53,"skX":12.43,"skY":12.43}},{"length":150,"name":"forearm_r","parent":"upperarm_r","transform":{"x":200.51,"y":0.29,"skX":-11.56,"skY":-11.56}}],"slot":[{"name":"1013","parent":"root"}],"skin":[{"slot":[{"name":"1013","display":[{"type":"mesh","name":"streamer/2080b003","width":810,"height":940,"vertices":[184.67,-1132.59,183.79,-1085.87,189.36,-1059.87,176.95,-1031.09,129.9,-1010.31,101.96,-944.48,97.14,-892.84,119.02,-839.18,150.17,-774.65,189.05,-713.12,231.84,-655.6,276.56,-579.74,326.03,-488.35,370.04,-394.5,370.04,-273.01,200.26,-270.9,180.39,-376.99,157.38,-460.47,132.66,-540.89,98.21,-619.15,71.17,-692.72,44.93,-757.15,19.13,-814.18,2.06,-869.57,-4.33,-927.25,2.19,-978.59,9.5,-1018.45,23.31,-1059.88,-183.8,-1059.45,-178.21,-1023.78,-181.47,-992.84,-184.54,-946.33,-193.08,-895.86,-207.56,-839.31,-233.92,-754.34,-249.07,-689.79,-266.84,-616.7,-285.01,-539.89,-297.44,-450,-304.8,-354.28,-302.86,-243.55,-440.13,-245.32,-440.1,-381.55,-432.27,-464.51,-414.9,-550.54,-392.7,-621.82,-361.19,-701.83,-327.81,-765.5,-288.98,-846.58,-266.71,-906.08,-261.16,-950.61,-288.5,-1009.24,-292.44,-1041.06,-270.36,-1076.74,-261.15,-1120.09,-248.54,-1147.23,-208.79,-1140.62,-188.06,-1099.21,36.36,-1097.65,67.91,-1137.51,114.22,-1183.48,162.12,-1183.5,-220.01,-1108.34,-223.09,-1067.31,-229.85,-1031.59,-237.59,-1001.44,113.56,-1118.49,122.43,-1071.88,127.18,-1041.08,69.84,-1103.04,78.49,-1065.25,84.92,-1031.91,94.82,-1002.79],"uvs":[0.77109,0.05416,0.77,0.10384,0.77686,0.13147,0.76153,0.16208,0.70346,0.1842,0.66899,0.25423,0.66305,0.30917,0.69008,0.36623,0.72854,0.43488,0.77656,0.50032,0.82938,0.56151,0.8846,0.6422,0.94566,0.73942,0.99999,0.83926,0.99998,0.96851,0.7904,0.97076,0.76588,0.8579,0.73747,0.76909,0.70696,0.68354,0.66442,0.60029,0.63103,0.52204,0.59863,0.45351,0.56677,0.39284,0.54568,0.33393,0.53777,0.27258,0.54581,0.21796,0.55482,0.17553,0.57186,0.13147,0.31623,0.13194,0.32315,0.1699,0.31911,0.20282,0.31533,0.25228,0.30479,0.30599,0.28692,0.36616,0.25439,0.45655,0.2357,0.52523,0.2138,0.60299,0.1914,0.68471,0.17609,0.78036,0.16703,0.88218,0.16949,1,0.00001,0.99815,0,0.85323,0.00963,0.76496,0.03104,0.67343,0.05842,0.5976,0.09729,0.51246,0.13846,0.4447,0.18638,0.35842,0.21388,0.29513,0.22072,0.24774,0.18696,0.18537,0.1821,0.15153,0.20935,0.11356,0.22072,0.06745,0.23628,0.03859,0.28536,0.04561,0.31096,0.08966,0.58798,0.09129,0.62695,0.04891,0.68414,0.00001,0.74326,0,0.27151,0.07995,0.26772,0.1236,0.25936,0.16159,0.24982,0.19367,0.68331,0.06912,0.69424,0.11871,0.7001,0.15147,0.62932,0.08556,0.64,0.12576,0.64793,0.16122,0.66015,0.1922],"triangles":[12,16,13,15,14,13,16,15,13,11,17,12,17,16,12,10,18,11,18,17,11,9,19,10,19,18,10,20,19,9,66,1,0,68,3,2,1,67,2,67,68,2,8,20,9,66,67,1,61,66,0,60,66,61,68,4,3,21,20,8,72,5,4,7,21,8,59,66,60,68,71,4,71,72,4,22,21,7,67,70,68,66,69,67,69,70,67,70,71,68,6,22,7,59,69,66,23,22,6,72,25,5,24,6,5,25,24,5,24,23,6,71,26,72,26,25,72,70,27,71,27,26,71,69,58,70,58,27,70,59,58,69,57,27,58,57,28,27,56,62,57,57,63,28,64,65,30,65,31,30,64,30,29,28,64,29,63,64,28,50,32,31,65,50,31,50,49,32,62,63,57,49,33,32,55,62,56,48,34,33,49,48,33,53,64,63,55,54,62,53,63,62,54,53,62,48,47,34,47,35,34,53,52,64,51,65,64,52,51,64,51,50,65,46,36,35,47,46,35,45,37,36,46,45,36,39,41,40,44,43,38,42,39,38,44,38,37,45,44,37,43,42,38,42,41,39],"weights":[1,15,1,2,15,0.928,17,0.07199,2,15,0.408,17,0.59199,2,15,0.19199,17,0.808,3,15,0.20428,17,0.70771,4,0.088,2,17,0.912,4,0.08799,3,17,0.78483,4,0.20146,7,0.0137,3,17,0.69599,4,0.24076,7,0.06323,3,17,0.728,4,0.09791,7,0.17407,4,17,0.63998,4,0.03801,7,0.27878,10,0.04319,3,17,0.62399,7,0.17446,10,0.20153,4,17,0.55999,7,0.04218,10,0.33445,13,0.06335,3,17,0.48799,10,0.25804,13,0.25395,3,17,0.408,10,0.08998,13,0.50201,2,17,0.36,13,0.63998,2,17,0.32799,13,0.672,3,17,0.4,10,0.10079,13,0.4992,3,17,0.512,10,0.24595,13,0.24204,4,17,0.57599,7,0.06773,10,0.28503,13,0.07123,3,17,0.64,7,0.17855,10,0.18143,4,17,0.66399,4,0.04651,7,0.23035,10,0.05913,3,17,0.704,4,0.10182,7,0.19417,3,17,0.67199,4,0.25715,7,0.07084,3,17,0.81587,4,0.16328,7,0.02084,2,17,0.904,4,0.09599,3,15,0.12898,17,0.76512,4,0.10589,3,15,0.39507,17,0.55352,4,0.05139,2,15,0.83999,17,0.16,2,14,0.48,16,0.51999,2,14,0.11199,16,0.888,1,16,1,2,16,0.92799,3,0.07199,2,16,0.75999,3,0.24,3,16,0.54617,3,0.38262,6,0.0712,3,16,0.41599,3,0.14015,6,0.44384,3,16,0.368,6,0.55615,9,0.07583,3,16,0.328,6,0.34406,9,0.32793,4,16,0.312,6,0.06067,9,0.52274,12,0.10457,3,16,0.312,9,0.33574,12,0.35225,3,16,0.32799,9,0.08062,12,0.59135,2,16,0.35199,12,0.648,2,16,0.35999,12,0.64,3,16,0.336,9,0.11686,12,0.54713,3,16,0.296,9,0.36607,12,0.33791,4,16,0.272,6,0.06723,9,0.57923,12,0.08152,3,16,0.296,6,0.37171,9,0.33228,3,16,0.35999,6,0.57856,9,0.06144,3,16,0.46399,3,0.13721,6,0.39878,3,16,0.62853,3,0.30811,6,0.06333,2,16,0.79199,3,0.208,2,16,0.864,3,0.13598,2,14,0.07199,16,0.928,2,14,0.14399,16,0.856,2,14,0.544,16,0.45599,2,14,0.88,16,0.11999,1,14,1,1,14,1,2,14,0.83999,16,0.16,2,15,0.91199,17,0.088,1,15,1,1,15,1,1,15,1,2,14,0.8,16,0.19999,2,14,0.488,16,0.51199,2,14,0.112,16,0.88799,2,14,0.05599,16,0.944,2,15,0.92799,17,0.07199,2,15,0.88,17,0.11999,2,15,0.33599,17,0.664,2,15,0.92,17,0.07999,2,15,0.816,17,0.18399,2,15,0.472,17,0.52799,3,15,0.08897,17,0.8352,4,0.07582],"slotPose":[1,0,0,1,0,0],"bonePose":[15,0.193207,0.981158,-0.981158,0.193207,42.671847,-1232.663838,17,0.385906,0.922538,-0.922538,0.385906,81.127245,-1035.875814,4,0.271608,0.962408,-0.962408,0.271608,6.41,-943.15,7,0.233615,0.972329,-0.972329,0.233615,52.855498,-780.417524,10,0.256627,0.966511,-0.966511,0.256627,91.08837,-622.016202,13,0.256627,0.966511,-0.966511,0.256627,137.703154,-446.883718,14,-0.322761,0.94648,-0.94648,-0.322761,-122.498835,-1238.098661,16,-0.518922,0.854821,-0.854821,-0.518922,-185.900195,-1053.819626,3,-0.221889,0.975072,-0.975072,-0.221889,-189.43,-938.45,6,-0.191152,0.981561,-0.981561,-0.191152,-224.721468,-788.051648,9,-0.17571,0.984442,-0.984442,-0.17571,-258.163974,-614.493923,12,-0.17571,0.984442,-0.984442,-0.17571,-287.60782,-445.945216],"edges":[42,41,41,40,40,39,39,38,38,37,37,36,36,35,35,34,34,33,33,32,32,31,31,30,30,29,29,28,28,27,27,26,26,25,25,24,24,23,23,22,22,21,21,20,20,19,19,18,18,17,17,16,16,15,15,14,14,13,13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0,61,61,60,60,59,59,58,58,57,57,56,56,55,55,54,54,53,53,52,52,51,51,50,50,49,49,48,48,47,47,46,46,45,45,44,44,43,43,42],"userEdges":[49,32,50,31,48,33,47,34,46,35,45,36,44,37,43,38,42,39,24,5,23,6,22,7,21,8,20,9,18,11,17,12,16,13,57,28,58,27,54,62,62,57,56,62,28,63,63,53,62,63,29,64,64,52,63,64,30,65,65,51,64,65,65,50,0,66,60,66,1,67,66,67,2,68,68,67,68,4,58,69,69,66,59,69,27,70,70,67,69,70,26,71,71,68,70,71,4,72,72,25,71,72,72,5,19,10]}]}]}],"animation":[{"duration":0,"playTimes":0,"name":"newAnimation"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}]}]}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/2080b003_tex.json b/Egret/Demos/resource/you_xin/suit2/2080b003_tex.json
new file mode 100644
index 00000000..7813d38f
--- /dev/null
+++ b/Egret/Demos/resource/you_xin/suit2/2080b003_tex.json
@@ -0,0 +1 @@
+{"width":1024,"SubTexture":[{"width":810,"y":1,"height":940,"name":"streamer/2080b003","x":1}],"height":1024,"name":"2080b003","imagePath":"2080b003_tex.png"}
\ No newline at end of file
diff --git a/Egret/Demos/resource/you_xin/suit2/2080b003_tex.png b/Egret/Demos/resource/you_xin/suit2/2080b003_tex.png
new file mode 100644
index 00000000..302dc341
Binary files /dev/null and b/Egret/Demos/resource/you_xin/suit2/2080b003_tex.png differ
diff --git a/Egret/Demos/src/Main.ts b/Egret/Demos/src/Main.ts
index 9a10c8b1..8e282e90 100644
--- a/Egret/Demos/src/Main.ts
+++ b/Egret/Demos/src/Main.ts
@@ -1,7 +1,7 @@
 class Main extends egret.DisplayObjectContainer {
     public constructor() {
         super();
-        
+
         this.addChild(new HelloDragonBones());
         // this.addChild(new AnimationBase());
         // this.addChild(new DragonBonesEvent());
@@ -9,10 +9,12 @@ class Main extends egret.DisplayObjectContainer {
         // this.addChild(new BoneOffset());
         // this.addChild(new InverseKinematics());
         // this.addChild(new BoundingBox());
+        // this.addChild(new MultiTextureAltas());
         // this.addChild(new ReplaceSlotDisplay());
         // this.addChild(new ReplaceSkin());
         // this.addChild(new ReplaceAnimation());
         // this.addChild(new coreElement.Game());
+        // this.addChild(new EyeTracking());
         // this.addChild(new PerformanceTest());
     }
 }
\ No newline at end of file
diff --git a/Egret/Demos/src/demo/EyeTracking.ts b/Egret/Demos/src/demo/EyeTracking.ts
new file mode 100644
index 00000000..1ac784e5
--- /dev/null
+++ b/Egret/Demos/src/demo/EyeTracking.ts
@@ -0,0 +1,132 @@
+class EyeTracking extends BaseDemo {
+    private _scale: number = 0.3;
+    private readonly _target: egret.Point = new egret.Point();
+    private readonly _animationNames: string[] = [
+        "PARAM_ANGLE_X",
+        "PARAM_ANGLE_Y",
+        "PARAM_ANGLE_Z",
+        "PARAM_EYE_BALL_X",
+        "PARAM_EYE_BALL_Y",
+        "PARAM_BODY_X",
+        "PARAM_BODY_Y",
+        "PARAM_BODY_Z",
+        "PARAM_BODY_ANGLE_X",
+        "PARAM_BODY_ANGLE_Y",
+        "PARAM_BODY_ANGLE_Z",
+        "PARAM_BREATH",
+    ];
+    private _armatureDisplay: dragonBones.EgretArmatureDisplay;
+
+    public constructor() {
+        super();
+
+        this._resources.push(
+            "resource/shizuku/shizuku_ske.json",
+            "resource/shizuku/shizuku.1024/texture_00.png",
+            "resource/shizuku/shizuku.1024/texture_01.png",
+            "resource/shizuku/shizuku.1024/texture_02.png",
+            "resource/shizuku/shizuku.1024/texture_03.png",
+        );
+    }
+
+    protected _onStart(): void {
+        const factory = dragonBones.EgretFactory.factory;
+        factory.parseDragonBonesData(RES.getRes("resource/shizuku/shizuku_ske.json"), "shizuku");
+        factory.updateTextureAtlases(
+            [
+                RES.getRes("resource/shizuku/shizuku.1024/texture_00.png"),
+                RES.getRes("resource/shizuku/shizuku.1024/texture_01.png"),
+                RES.getRes("resource/shizuku/shizuku.1024/texture_02.png"),
+                RES.getRes("resource/shizuku/shizuku.1024/texture_03.png"),
+            ],
+            "shizuku"
+        );
+
+        this._armatureDisplay = factory.buildArmatureDisplay("shizuku", "shizuku");
+        this._armatureDisplay.animation.play("idle_00");
+
+        this._armatureDisplay.x = 0.0;
+        this._armatureDisplay.y = 200.0;
+        this._armatureDisplay.scaleX = this._armatureDisplay.scaleY = this._scale;
+        this._armatureDisplay.disableBatch();
+        this.addChild(this._armatureDisplay);
+
+        const onTouchMove = egret.sys.TouchHandler.prototype.onTouchMove;
+        const setTarget = this._setTarget.bind(this);
+        egret.sys.TouchHandler.prototype.onTouchMove = function (this: any, x: number, y: number, touchPointID: number): void {
+            onTouchMove.call(this, x, y, touchPointID);
+            setTarget(x, y);
+        };
+        this.stage.addEventListener(egret.Event.ENTER_FRAME, this._enterFrameHandler, this);
+    }
+
+    private _setTarget(x: number, y: number) {
+        this._target.x += ((x - this.x - this._armatureDisplay.x) / this._scale - this._target.x) * 0.3;
+        this._target.y += ((y - this.y - this._armatureDisplay.y) / this._scale - this._target.y) * 0.3;
+    }
+
+    protected _enterFrameHandler(_event: egret.Event): void {
+        const armature = this._armatureDisplay.armature;
+        const animation = this._armatureDisplay.animation;
+        const canvas = armature.armatureData.canvas;
+
+        let p = 0.0;
+        const pX = Math.max(Math.min((this._target.x - canvas.x) / (canvas.width * 0.5), 1.0), -1.0);
+        const pY = -Math.max(Math.min((this._target.y - canvas.y) / (canvas.height * 0.5), 1.0), -1.0);
+        for (const animationName of this._animationNames) {
+            if (!animation.hasAnimation(animationName)) {
+                continue;
+            }
+
+            let animationState = animation.getState(animationName, 1);
+            if (!animationState) {
+                animationState = animation.fadeIn(animationName, 0.1, 1, 1, animationName);
+                if (animationState) {
+                    animationState.resetToPose = false;
+                    animationState.stop();
+                }
+            }
+
+            if (!animationState) {
+                continue;
+            }
+
+            switch (animationName) {
+                case "PARAM_ANGLE_X":
+                case "PARAM_EYE_BALL_X":
+                    p = (pX + 1.0) * 0.5;
+                    break;
+
+                case "PARAM_ANGLE_Y":
+                case "PARAM_EYE_BALL_Y":
+                    p = (pY + 1.0) * 0.5;
+                    break;
+
+                case "PARAM_ANGLE_Z":
+                    p = (-pX * pY + 1.0) * 0.5;
+                    break;
+
+                case "PARAM_BODY_X":
+                case "PARAM_BODY_ANGLE_X":
+                    p = (pX + 1.0) * 0.5;
+                    break;
+
+                case "PARAM_BODY_Y":
+                case "PARAM_BODY_ANGLE_Y":
+                    p = (-pX * pY + 1.0) * 0.5;
+                    break;
+
+                case "PARAM_BODY_Z":
+                case "PARAM_BODY_ANGLE_Z":
+                    p = (-pX * pY + 1.0) * 0.5;
+                    break;
+
+                case "PARAM_BREATH":
+                    p = (Math.sin(armature.clock.time) + 1.0) * 0.5;
+                    break;
+            }
+
+            animationState.currentTime = p * animationState.totalTime;
+        }
+    }
+}
\ No newline at end of file
diff --git a/Egret/Demos/src/demo/MultiTextureAltas.ts b/Egret/Demos/src/demo/MultiTextureAltas.ts
new file mode 100644
index 00000000..a45ce02c
--- /dev/null
+++ b/Egret/Demos/src/demo/MultiTextureAltas.ts
@@ -0,0 +1,69 @@
+class MultiTextureAltas extends BaseDemo {
+    private _armatureDisplayA: dragonBones.EgretArmatureDisplay;
+    private _armatureDisplayB: dragonBones.EgretArmatureDisplay;
+    private _armatureDisplayC: dragonBones.EgretArmatureDisplay;
+    private _armatureDisplayD: dragonBones.EgretArmatureDisplay;
+
+    public constructor() {
+        super();
+
+        this._resources.push(
+            "resource/effect/effect_ske.json",
+            "resource/effect/effect_tex.json",
+            "resource/effect/effect_tex.png",
+            "resource/effect/effect_sd_tex.json",
+            "resource/effect/effect_sd_tex.png"
+        );
+    }
+
+    protected _onStart(): void {
+        const factory = dragonBones.EgretFactory.factory;
+        factory.parseDragonBonesData(RES.getRes("resource/effect/effect_ske.json"), "hd", 1.0);
+        factory.parseDragonBonesData(RES.getRes("resource/effect/effect_ske.json"), "sd", 0.5);
+        factory.parseTextureAtlasData(RES.getRes("resource/effect/effect_tex.json"), RES.getRes("resource/effect/effect_tex.png"), "hd", 1.0);
+        factory.parseTextureAtlasData(RES.getRes("resource/effect/effect_sd_tex.json"), RES.getRes("resource/effect/effect_sd_tex.png"), "sd", 2.0);
+
+        this._armatureDisplayA = factory.buildArmatureDisplay("flower", "hd", null, "hd"); // HD Armature and HD TextureAtlas.
+        this._armatureDisplayB = factory.buildArmatureDisplay("flower", "hd", null, "sd"); // HD Armature and SD TextureAtlas.
+        this._armatureDisplayC = factory.buildArmatureDisplay("flower", "sd", null, "hd"); // SD Armature and HD TextureAtlas.
+        this._armatureDisplayD = factory.buildArmatureDisplay("flower", "sd", null, "sd"); // SD Armature and SD TextureAtlas.
+
+        this._armatureDisplayA.x = -250.0;
+        this._armatureDisplayA.y = 0.0;
+        this._armatureDisplayB.x = 250.0;
+        this._armatureDisplayB.y = 0.0;
+        this._armatureDisplayC.x = -250.0;
+        this._armatureDisplayC.y = 200.0;
+        this._armatureDisplayD.x = 250.0;
+        this._armatureDisplayD.y = 200.0;
+
+        this.addChild(this._armatureDisplayA);
+        this.addChild(this._armatureDisplayB);
+        this.addChild(this._armatureDisplayC);
+        this.addChild(this._armatureDisplayD);
+        //
+        this.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, (event: egret.TouchEvent) => {
+            this._changeAnimation();
+        }, this);
+        //
+        this._changeAnimation();
+    }
+
+    private _changeAnimation(): void {
+        let animationName = this._armatureDisplayA.animation.lastAnimationName;
+        if (animationName) {
+            const animationNames = this._armatureDisplayA.animation.animationNames;
+            const animationIndex = (animationNames.indexOf(animationName) + 1) % animationNames.length;
+            this._armatureDisplayA.animation.play(animationNames[animationIndex]).playTimes = 0;
+        }
+        else {
+            this._armatureDisplayA.animation.play().playTimes = 0;
+        }
+
+        animationName = this._armatureDisplayA.animation.lastAnimationName;
+
+        this._armatureDisplayB.animation.play(animationName).playTimes = 0;
+        this._armatureDisplayC.animation.play(animationName).playTimes = 0;
+        this._armatureDisplayD.animation.play(animationName).playTimes = 0;
+    }
+}
\ No newline at end of file
diff --git a/Egret/Demos/src/demo/ReplaceSkin.ts b/Egret/Demos/src/demo/ReplaceSkin.ts
index 0aaf9d51..2de352f8 100644
--- a/Egret/Demos/src/demo/ReplaceSkin.ts
+++ b/Egret/Demos/src/demo/ReplaceSkin.ts
@@ -10,37 +10,20 @@ class ReplaceSkin extends BaseDemo {
 
         this._suitConfigs.push([
             "2010600a",
-            "2010600a_1",
+            "2080100e",
+            "2080500b",
             "20208003",
-            "20208003_1",
-            "20208003_2",
-            "20208003_3",
-            "20405006",
             "20509005",
             "20703016",
-            "20703016_1",
-            "2080100c",
-            "2080100e",
-            "2080100e_1",
-            "20803005",
-            "2080500b",
-            "2080500b_1"
         ]);
 
         this._suitConfigs.push([
+            "2080b003",
             "20106010",
-            "20106010_1",
             "20208006",
-            "20208006_1",
-            "20208006_2",
-            "20208006_3",
-            "2040600b",
-            "2040600b_1",
             "20509007",
             "20703020",
-            "20703020_1",
-            "2080b003",
-            "20801015"
+            "20801015",
         ]);
 
         this._resources.push(
@@ -51,8 +34,8 @@ class ReplaceSkin extends BaseDemo {
 
         for (let i = 0, l = this._suitConfigs.length; i < l; ++i) {
             for (const partArmatureName of this._suitConfigs[i]) {
-                // resource/you_xin/suit1/2010600a/xxxxxx
-                const path = "resource/you_xin/suit" + (i + 1) + "/" + partArmatureName + "/" + partArmatureName;
+                // resource/you_xin/suit1/xxxxxx
+                const path = "resource/you_xin/suit" + (i + 1) + "/" + partArmatureName;
                 const dragonBonesJSONPath = path + "_ske.json";
                 const textureAtlasJSONPath = path + "_tex.json";
                 const textureAtlasPath = path + "_tex.png";
@@ -72,7 +55,7 @@ class ReplaceSkin extends BaseDemo {
 
         for (let i = 0, l = this._suitConfigs.length; i < l; ++i) {
             for (const partArmatureName of this._suitConfigs[i]) {
-                const path = "resource/you_xin/suit" + (i + 1) + "/" + partArmatureName + "/" + partArmatureName;
+                const path = "resource/you_xin/suit" + (i + 1) + "/" + partArmatureName;
                 const dragonBonesJSONPath = path + "_ske.json";
                 const textureAtlasJSONPath = path + "_tex.json";
                 const textureAtlasPath = path + "_tex.png";
@@ -104,11 +87,19 @@ class ReplaceSkin extends BaseDemo {
     }
 
     private _animationEventHandler(event: dragonBones.EgretEvent): void {
-        // Random animation index.
-        const animationIndex = Math.floor(Math.random() * this._armatureDisplay.animation.animationNames.length);
-        const animationName = this._armatureDisplay.animation.animationNames[animationIndex];
-        // Play animation.
-        this._armatureDisplay.animation.fadeIn(animationName, 0.3, 0);
+        if (event.eventObject.animationState.name === "idle") {
+            if (Math.random() > 0.7) {
+                return;
+            }
+            // Random animation index.
+            const animationIndex = Math.floor(Math.random() * this._armatureDisplay.animation.animationNames.length);
+            const animationName = this._armatureDisplay.animation.animationNames[animationIndex];
+            // Play animation.
+            this._armatureDisplay.animation.fadeIn(animationName, 0.3, 0);
+        }
+        else {
+            this._armatureDisplay.animation.fadeIn("idle", 0.3, 0);
+        }
     }
 
     private _randomReplaceSkin(): void {
diff --git a/Hilo/1.x/README.md b/Hilo/1.x/README.md
index 94c81d1b..837d0d73 100644
--- a/Hilo/1.x/README.md
+++ b/Hilo/1.x/README.md
@@ -1,4 +1,7 @@
 ## How to build
+* Clone or download [DragonBonesJS](https://github.com/DragonBones/DragonBonesJS/).
+* Install [Node.JS](https://nodejs.org/).
+* Open `DragonBonesJS/Hilo/1.x/` in command.
 * $ `npm install`
 * $ `npm run build`
 
diff --git a/Hilo/1.x/libs/.gitkeep b/Hilo/1.x/libs/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/Hilo/1.x/out/dragonBones.d.ts b/Hilo/1.x/out/dragonBones.d.ts
index 5359e8cd..8e573157 100644
--- a/Hilo/1.x/out/dragonBones.d.ts
+++ b/Hilo/1.x/out/dragonBones.d.ts
@@ -1,15 +1,3 @@
-declare namespace dragonBones {
-    /**
-     * @internal
-     * @private
-     */
-    const webAssemblyModule: {
-        HEAP16: Int16Array;
-        _malloc(byteSize: number): number;
-        _free(pointer: number): void;
-        setDataBinary(data: DragonBonesData, binaryPointer: number, intBytesLength: number, floatBytesLength: number, frameIntBytesLength: number, frameFloatBytesLength: number, frameBytesLength: number, timelineBytesLength: number): void;
-    };
-}
 /**
  * The MIT License (MIT)
  *
@@ -34,17 +22,17 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     const enum BinaryOffset {
         WeigthBoneCount = 0,
         WeigthFloatOffset = 1,
         WeigthBoneIndices = 2,
-        MeshVertexCount = 0,
-        MeshTriangleCount = 1,
-        MeshFloatOffset = 2,
-        MeshWeightOffset = 3,
-        MeshVertexIndices = 4,
+        GeometryVertexCount = 0,
+        GeometryTriangleCount = 1,
+        GeometryFloatOffset = 2,
+        GeometryWeightOffset = 3,
+        GeometryVertexIndices = 4,
         TimelineScale = 0,
         TimelineOffset = 1,
         TimelineKeyFrameCount = 2,
@@ -60,12 +48,9 @@ declare namespace dragonBones {
         DeformValueCount = 2,
         DeformValueOffset = 3,
         DeformFloatOffset = 4,
-        PathVertexCount = 0,
-        PathFloatOffset = 2,
-        PathWeightOffset = 3,
     }
     /**
-     * @internal
+     * @private
      */
     const enum ArmatureType {
         Armature = 0,
@@ -73,7 +58,7 @@ declare namespace dragonBones {
         Stage = 2,
     }
     /**
-     * @internal
+     * @private
      */
     const enum BoneType {
         Bone = 0,
@@ -105,7 +90,7 @@ declare namespace dragonBones {
         Polygon = 2,
     }
     /**
-     * @internal
+     * @private
      */
     const enum ActionType {
         Play = 0,
@@ -113,7 +98,7 @@ declare namespace dragonBones {
         Sound = 11,
     }
     /**
-     * @internal
+     * @private
      */
     const enum BlendMode {
         Normal = 0,
@@ -132,7 +117,7 @@ declare namespace dragonBones {
         Subtract = 13,
     }
     /**
-     * @internal
+     * @private
      */
     const enum TweenType {
         None = 0,
@@ -143,7 +128,7 @@ declare namespace dragonBones {
         QuadInOut = 5,
     }
     /**
-     * @internal
+     * @private
      */
     const enum TimelineType {
         Action = 0,
@@ -153,12 +138,16 @@ declare namespace dragonBones {
         BoneRotate = 12,
         BoneScale = 13,
         Surface = 50,
+        BoneAlpha = 60,
         SlotDisplay = 20,
         SlotColor = 21,
         SlotDeform = 22,
+        SlotZIndex = 23,
+        SlotAlpha = 24,
         IKConstraint = 30,
-        AnimationTime = 40,
+        AnimationProgress = 40,
         AnimationWeight = 41,
+        AnimationParameter = 42,
     }
     /**
      * - Offset mode.
@@ -186,15 +175,6 @@ declare namespace dragonBones {
      * @language zh_CN
      */
     const enum AnimationFadeOutMode {
-        /**
-         * - Do not fade out of any animation states.
-         * @language en_US
-         */
-        /**
-         * - 不淡出任何的动画状态。
-         * @language zh_CN
-         */
-        None = 0,
         /**
          * - Fade out the animation states of the same layer.
          * @language en_US
@@ -241,19 +221,45 @@ declare namespace dragonBones {
          */
         Single = 5,
     }
+    /**
+     * @private
+     */
+    const enum AnimationBlendType {
+        None = 0,
+        E1D = 1,
+    }
+    /**
+     * @private
+     */
+    const enum AnimationBlendMode {
+        Additive = 0,
+        Override = 1,
+    }
+    /**
+     * @private
+     */
     const enum ConstraintType {
         IK = 0,
         Path = 1,
     }
+    /**
+     * @private
+     */
     const enum PositionMode {
         Fixed = 0,
         Percent = 1,
     }
+    /**
+     * @private
+     */
     const enum SpacingMode {
         Length = 0,
         Fixed = 1,
         Percent = 2,
     }
+    /**
+     * @private
+     */
     const enum RotateMode {
         Tangent = 0,
         Chain = 1,
@@ -273,7 +279,6 @@ declare namespace dragonBones {
         static yDown: boolean;
         static debug: boolean;
         static debugDraw: boolean;
-        static webAssembly: boolean;
         private readonly _clock;
         private readonly _events;
         private readonly _objects;
@@ -287,6 +292,9 @@ declare namespace dragonBones {
     }
 }
 declare var __extends: any;
+declare var exports: any;
+declare var module: any;
+declare var define: any;
 /**
  * The MIT License (MIT)
  *
@@ -776,7 +784,7 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     class ColorTransform {
         alphaMultiplier: number;
@@ -1101,7 +1109,7 @@ declare namespace dragonBones {
         getString(index?: number): string;
     }
     /**
-     * @internal
+     * @private
      */
     class ActionData extends BaseObject {
         static toString(): string;
@@ -1246,6 +1254,10 @@ declare namespace dragonBones {
          * @internal
          */
         timelineArray: Uint16Array;
+        /**
+         * @internal
+         */
+        colorArray: Uint16Array;
         /**
          * @private
          */
@@ -1268,17 +1280,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         getArmature(armatureName: string): ArmatureData | null;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.BaseFactory#removeDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.BaseFactory#removeDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        dispose(): void;
     }
 }
 /**
@@ -1580,6 +1581,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         length: number;
+        /**
+         * @private
+         */
+        alpha: number;
         /**
          * - The bone name.
          * @version DragonBones 3.0
@@ -1619,7 +1624,7 @@ declare namespace dragonBones {
         static toString(): string;
         segmentX: number;
         segmentY: number;
-        readonly vertices: Array;
+        readonly geometry: GeometryData;
         protected _onClear(): void;
     }
     /**
@@ -1654,6 +1659,14 @@ declare namespace dragonBones {
          * @private
          */
         zOrder: number;
+        /**
+         * @private
+         */
+        zIndex: number;
+        /**
+         * @private
+         */
+        alpha: number;
         /**
          * - The slot name.
          * @version DragonBones 3.0
@@ -1711,7 +1724,7 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     abstract class ConstraintData extends BaseObject {
         order: number;
@@ -1776,7 +1789,7 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     class CanvasData extends BaseObject {
         static toString(): string;
@@ -1882,19 +1895,21 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
-    class VerticesData {
+    class GeometryData {
         isShared: boolean;
         inheritDeform: boolean;
         offset: number;
         data: DragonBonesData;
         weight: WeightData | null;
         clear(): void;
-        shareFrom(value: VerticesData): void;
+        shareFrom(value: GeometryData): void;
+        readonly vertexCount: number;
+        readonly triangleCount: number;
     }
     /**
-     * @internal
+     * @private
      */
     abstract class DisplayData extends BaseObject {
         type: DisplayType;
@@ -1905,7 +1920,7 @@ declare namespace dragonBones {
         protected _onClear(): void;
     }
     /**
-     * @internal
+     * @private
      */
     class ImageDisplayData extends DisplayData {
         static toString(): string;
@@ -1914,7 +1929,7 @@ declare namespace dragonBones {
         protected _onClear(): void;
     }
     /**
-     * @internal
+     * @private
      */
     class ArmatureDisplayData extends DisplayData {
         static toString(): string;
@@ -1928,16 +1943,16 @@ declare namespace dragonBones {
         addAction(value: ActionData): void;
     }
     /**
-     * @internal
+     * @private
      */
     class MeshDisplayData extends DisplayData {
         static toString(): string;
-        readonly vertices: VerticesData;
+        readonly geometry: GeometryData;
         texture: TextureData | null;
         protected _onClear(): void;
     }
     /**
-     * @internal
+     * @private
      */
     class BoundingBoxDisplayData extends DisplayData {
         static toString(): string;
@@ -1945,18 +1960,18 @@ declare namespace dragonBones {
         protected _onClear(): void;
     }
     /**
-     * @internal
+     * @private
      */
     class PathDisplayData extends DisplayData {
         static toString(): string;
         closed: boolean;
         constantSpeed: boolean;
-        readonly vertices: VerticesData;
+        readonly geometry: GeometryData;
         readonly curveLengths: Array;
         protected _onClear(): void;
     }
     /**
-     * @internal
+     * @private
      */
     class WeightData extends BaseObject {
         static toString(): string;
@@ -2269,6 +2284,10 @@ declare namespace dragonBones {
          * @internal
          */
         frameOffset: number;
+        /**
+         * @private
+         */
+        blendType: AnimationBlendType;
         /**
          * - The frame count of the animation.
          * @version DragonBones 3.0
@@ -2340,10 +2359,6 @@ declare namespace dragonBones {
          * @private
          */
         readonly boneTimelines: Map>;
-        /**
-         * @private
-         */
-        readonly surfaceTimelines: Map>;
         /**
          * @private
          */
@@ -2384,19 +2399,15 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        addBoneTimeline(bone: BoneData, timeline: TimelineData): void;
+        addBoneTimeline(timelineName: string, timeline: TimelineData): void;
         /**
          * @private
          */
-        addSurfaceTimeline(surface: SurfaceData, timeline: TimelineData): void;
+        addSlotTimeline(timelineName: string, timeline: TimelineData): void;
         /**
          * @private
          */
-        addSlotTimeline(slot: SlotData, timeline: TimelineData): void;
-        /**
-         * @private
-         */
-        addConstraintTimeline(constraint: ConstraintData, timeline: TimelineData): void;
+        addConstraintTimeline(timelineName: string, timeline: TimelineData): void;
         /**
          * @private
          */
@@ -2405,10 +2416,6 @@ declare namespace dragonBones {
          * @private
          */
         getBoneTimelines(timelineName: string): Array | null;
-        /**
-         * @private
-         */
-        getSurfaceTimelines(timelineName: string): Array | null;
         /**
          * @private
          */
@@ -2431,7 +2438,7 @@ declare namespace dragonBones {
         getSlotCachedFrameIndices(slotName: string): Array | null;
     }
     /**
-     * @internal
+     * @private
      */
     class TimelineData extends BaseObject {
         static toString(): string;
@@ -2440,6 +2447,15 @@ declare namespace dragonBones {
         frameIndicesOffset: number;
         protected _onClear(): void;
     }
+    /**
+     * @internal
+     */
+    class AnimationTimelineData extends TimelineData {
+        static toString(): string;
+        x: number;
+        y: number;
+        protected _onClear(): void;
+    }
 }
 /**
  * The MIT License (MIT)
@@ -2520,7 +2536,7 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        additiveBlending: boolean;
+        additive: boolean;
         /**
          * - Whether the animation state has control over the display property of the slots.
          * Sometimes blend a animation state does not want it to control the display properties of the slots,
@@ -2723,18 +2739,6 @@ declare namespace dragonBones {
          * @private
          */
         copyFrom(value: AnimationConfig): void;
-        /**
-         * @private
-         */
-        containsBoneMask(boneName: string): boolean;
-        /**
-         * @private
-         */
-        addBoneMask(armature: Armature, boneName: string, recursive?: boolean): void;
-        /**
-         * @private
-         */
-        removeBoneMask(armature: Armature, boneName: string, recursive?: boolean): void;
     }
 }
 /**
@@ -2832,7 +2836,7 @@ declare namespace dragonBones {
         getTexture(textureName: string): TextureData | null;
     }
     /**
-     * @internal
+     * @private
      */
     abstract class TextureData extends BaseObject {
         static createRectangle(): Rectangle;
@@ -3001,15 +3005,31 @@ declare namespace dragonBones {
          * @private
          */
         userData: any;
-        private _lockUpdate;
+        /**
+         * @internal
+         */
+        _lockUpdate: boolean;
         private _slotsDirty;
         private _zOrderDirty;
+        /**
+         * @internal
+         */
+        _zIndexDirty: boolean;
+        /**
+         * @internal
+         */
+        _alphaDirty: boolean;
         private _flipX;
         private _flipY;
         /**
          * @internal
          */
         _cacheFrameIndex: number;
+        private _alpha;
+        /**
+         * @internal
+         */
+        _globalAlpha: number;
         private readonly _bones;
         private readonly _slots;
         /**
@@ -3391,55 +3411,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly parent: Slot | null;
-        /**
-         * @deprecated
-         * @private
-         */
-        replaceTexture(texture: any): void;
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        hasEventListener(type: EventStringType): boolean;
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        addEventListener(type: EventStringType, listener: Function, target: any): void;
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        removeEventListener(type: EventStringType, listener: Function, target: any): void;
-        /**
-         * - Deprecated, please refer to {@link #cacheFrameRate}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #cacheFrameRate}。
-         * @deprecated
-         * @language zh_CN
-         */
-        enableAnimationCache(frameRate: number): void;
         /**
          * - Deprecated, please refer to {@link #display}.
          * @deprecated
@@ -3538,6 +3509,14 @@ declare namespace dragonBones {
          */
         userData: any;
         protected _globalDirty: boolean;
+        /**
+         * @internal
+         */
+        _alpha: number;
+        /**
+         * @internal
+         */
+        _globalAlpha: number;
         /**
          * @internal
          */
@@ -3658,10 +3637,6 @@ declare namespace dragonBones {
         _hasConstraint: boolean;
         protected _visible: boolean;
         protected _cachedFrameIndex: number;
-        /**
-         * @internal
-         */
-        readonly _blendState: BlendState;
         /**
          * @internal
          */
@@ -3676,6 +3651,10 @@ declare namespace dragonBones {
         _cachedFrameIndices: Array | null;
         protected _onClear(): void;
         protected _updateGlobalTransformMatrix(isCache: boolean): void;
+        /**
+         * @internal
+         */
+        _updateAlpha(): void;
         /**
          * @internal
          */
@@ -3775,39 +3754,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly parent: Bone | null;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getBones()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getBones()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        getBones(): Array;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getSlots()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getSlots()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        getSlots(): Array;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getSlot()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getSlot()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly slot: Slot | null;
     }
 }
 /**
@@ -3853,6 +3799,7 @@ declare namespace dragonBones {
          * - Inside [flag, a, b, c, d, tx, ty], Outside [flag, a, b, c, d, tx, ty]
          */
         private readonly _matrixCahce;
+        _bone: Bone | null;
         protected _onClear(): void;
         private _getAffineTransform(x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown);
         private _updateVertices();
@@ -3892,6 +3839,22 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
+    /**
+     * @private
+     */
+    class DisplayFrame extends BaseObject {
+        static toString(): string;
+        rawDisplayData: DisplayData | null;
+        displayData: DisplayData | null;
+        textureData: TextureData | null;
+        display: any | Armature | null;
+        readonly deformVertices: Array;
+        protected _onClear(): void;
+        updateDeformVertices(): void;
+        getGeometryData(): GeometryData | null;
+        getBoundingBox(): BoundingBoxData | null;
+        getTextureData(): TextureData | null;
+    }
     /**
      * - The slot attached to the armature, controls the display status and properties of the display object.
      * A bone can contain multiple slots.
@@ -3936,24 +3899,35 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         displayController: string | null;
+        protected _displayDataDirty: boolean;
         protected _displayDirty: boolean;
-        protected _zOrderDirty: boolean;
+        protected _geometryDirty: boolean;
+        protected _textureDirty: boolean;
         protected _visibleDirty: boolean;
         protected _blendModeDirty: boolean;
+        protected _zOrderDirty: boolean;
         /**
          * @internal
          */
         _colorDirty: boolean;
+        /**
+         * @internal
+         */
+        _verticesDirty: boolean;
         protected _transformDirty: boolean;
         protected _visible: boolean;
         protected _blendMode: BlendMode;
         protected _displayIndex: number;
         protected _animationDisplayIndex: number;
+        protected _cachedFrameIndex: number;
         /**
          * @internal
          */
         _zOrder: number;
-        protected _cachedFrameIndex: number;
+        /**
+         * @internal
+         */
+        _zIndex: number;
         /**
          * @internal
          */
@@ -3967,26 +3941,31 @@ declare namespace dragonBones {
          * @internal
          */
         readonly _colorTransform: ColorTransform;
-        protected readonly _displayDatas: Array;
-        protected readonly _displayList: Array;
+        /**
+         * @internal
+         */
+        readonly _displayFrames: Array;
+        /**
+         * @internal
+         */
+        readonly _geometryBones: Array;
         /**
          * @internal
          */
         _slotData: SlotData;
-        protected _rawDisplayDatas: Array | null;
         /**
          * @internal
          */
-        _displayData: DisplayData | null;
-        protected _boundingBoxData: BoundingBoxData | null;
-        protected _textureData: TextureData | null;
+        _displayFrame: DisplayFrame | null;
         /**
          * @internal
          */
-        _deformVertices: DeformVertices | null;
+        _geometryData: GeometryData | null;
+        protected _boundingBoxData: BoundingBoxData | null;
+        protected _textureData: TextureData | null;
         protected _rawDisplay: any;
         protected _meshDisplay: any;
-        protected _display: any;
+        protected _display: any | null;
         protected _childArmature: Armature | null;
         /**
          * @private
@@ -4012,35 +3991,32 @@ declare namespace dragonBones {
         protected abstract _updateColor(): void;
         protected abstract _updateFrame(): void;
         protected abstract _updateMesh(): void;
+        protected abstract _updateTransform(): void;
+        protected abstract _identityTransform(): void;
+        protected _hasDisplay(display: any): boolean;
         /**
          * @internal
          */
-        abstract _updateGlueMesh(): void;
-        protected abstract _updateTransform(): void;
-        protected abstract _identityTransform(): void;
+        _isBonesUpdate(): boolean;
         /**
-         * - Support default skin data.
+         * @internal
          */
-        protected _getDefaultRawDisplayData(displayIndex: number): DisplayData | null;
+        _updateAlpha(): void;
         protected _updateDisplayData(): void;
         protected _updateDisplay(): void;
         protected _updateGlobalTransformMatrix(isCache: boolean): void;
         /**
          * @internal
          */
-        _setDisplayIndex(value: number, isAnimation?: boolean): boolean;
+        _setDisplayIndex(value: number, isAnimation?: boolean): void;
         /**
          * @internal
          */
-        _setZorder(value: number): boolean;
+        _setZOrder(value: number): boolean;
         /**
          * @internal
          */
         _setColor(value: ColorTransform): boolean;
-        /**
-         * @internal
-         */
-        _setDisplayList(value: Array | null): boolean;
         /**
          * @internal
          */
@@ -4050,13 +4026,36 @@ declare namespace dragonBones {
          */
         update(cacheFrameIndex: number): void;
         /**
-         * @private
-         */
-        updateTransformAndMatrix(): void;
-        /**
-         * @private
+         * - Forces the slot to update the state of the display object in the next frame.
+         * @version DragonBones 4.5
+         * @language en_US
          */
-        replaceDisplayData(value: DisplayData | null, displayIndex?: number): void;
+        /**
+         * - 强制插槽在下一帧更新显示对象的状态。
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        invalidUpdate(): void;
+        /**
+         * @private
+         */
+        updateTransformAndMatrix(): void;
+        /**
+         * @private
+         */
+        replaceRawDisplayData(displayData: DisplayData | null, index?: number): void;
+        /**
+         * @private
+         */
+        replaceDisplayData(displayData: DisplayData | null, index?: number): void;
+        /**
+         * @private
+         */
+        replaceTextureData(textureData: TextureData | null, index?: number): void;
+        /**
+         * @private
+         */
+        replaceDisplay(value: any | Armature | null, index?: number): void;
         /**
          * - Check whether a specific point is inside a custom bounding box in the slot.
          * The coordinate system of the point is the inner coordinate system of the armature.
@@ -4117,16 +4116,9 @@ declare namespace dragonBones {
             y: number;
         } | null): number;
         /**
-         * - Forces the slot to update the state of the display object in the next frame.
-         * @version DragonBones 4.5
-         * @language en_US
-         */
-        /**
-         * - 强制插槽在下一帧更新显示对象的状态。
-         * @version DragonBones 4.5
-         * @language zh_CN
+         * @private
          */
-        invalidUpdate(): void;
+        getDisplayFrameAt(index: number): DisplayFrame;
         /**
          * - The visible of slot's display object.
          * @default true
@@ -4140,6 +4132,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         visible: boolean;
+        /**
+         * @private
+         */
+        displayFrameCount: number;
         /**
          * - The index of the display object displayed in the display list.
          * @example
@@ -4200,14 +4196,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly slotData: SlotData;
-        /**
-         * @private
-         */
-        rawDisplayDatas: Array | null;
-        /**
-         * @private
-         */
-        readonly displayData: DisplayData | null;
         /**
          * - The custom bounding box data for the slot at current time.
          * @version DragonBones 5.0
@@ -4253,9 +4241,9 @@ declare namespace dragonBones {
          * @example
          * 
          *     let slot = armature.getSlot("weapon");
-         * let prevChildArmature = slot.childArmature;
-         * if (prevChildArmature) {
-         * prevChildArmature.dispose();
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
          *     }
          *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
          * 
@@ -4268,9 +4256,9 @@ declare namespace dragonBones { * @example *
          *     let slot = armature.getSlot("weapon");
-         * let prevChildArmature = slot.childArmature;
-         * if (prevChildArmature) {
-         * prevChildArmature.dispose();
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
          *     }
          *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
          * 
@@ -4410,7 +4398,7 @@ declare namespace dragonBones { private _segments; static toString(): string; protected _onClear(): void; - protected _updatePathVertices(verticesData: VerticesData): void; + protected _updatePathVertices(verticesData: GeometryData): void; protected _computeVertices(start: number, count: number, offset: number, out: Array): void; protected _computeBezierCurve(pathDisplayDta: PathDisplayData, spaceCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): void; private addCurvePosition(t, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, offset, tangents); @@ -4419,43 +4407,6 @@ declare namespace dragonBones { invalidUpdate(): void; } } -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -declare namespace dragonBones { - /** - * @internal - */ - class DeformVertices extends BaseObject { - static toString(): string; - verticesDirty: boolean; - readonly vertices: Array; - readonly bones: Array; - verticesData: VerticesData | null; - protected _onClear(): void; - init(verticesDataValue: VerticesData | null, armature: Armature): void; - isBonesUpdate(): boolean; - } -} /** * The MIT License (MIT) * @@ -4679,17 +4630,6 @@ declare namespace dragonBones { * @inheritDoc */ clock: WorldClock | null; - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#clock}。 - * @deprecated - * @language zh_CN - */ - static readonly clock: WorldClock; } } /** @@ -4744,12 +4684,15 @@ declare namespace dragonBones { * @language zh_CN */ timeScale: number; - private _lockUpdate; + /** + * Update bones and slots cachedFrameIndices. + */ private _animationDirty; private _inheritTimeScale; private readonly _animationNames; private readonly _animationStates; private readonly _animations; + private readonly _blendStates; private _armature; private _animationConfig; private _lastAnimationState; @@ -4980,9 +4923,14 @@ declare namespace dragonBones { * @language zh_CN */ gotoAndStopByProgress(animationName: string, progress?: number): AnimationState | null; + /** + * @internal + */ + getBlendState(type: string, name: string, target: BaseObject): BlendState; /** * - Get a specific animation state. * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) * @example *
          *     armature.animation.play("walk");
@@ -4993,8 +4941,9 @@ declare namespace dragonBones {
          * @language en_US
          */
         /**
-         * - 获取指定的动画状态
+         * - 获取指定的动画状态。
          * @param animationName - 动画状态名称。
+         * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1)
          * @example
          * 
          *     armature.animation.play("walk");
@@ -5004,7 +4953,7 @@ declare namespace dragonBones {
          * @version DragonBones 3.0
          * @language zh_CN
          */
-        getState(animationName: string): AnimationState | null;
+        getState(animationName: string, layer?: number): AnimationState | null;
         /**
          * - Check whether a specific animation data is included.
          * @param animationName - The name of animation data.
@@ -5030,7 +4979,7 @@ declare namespace dragonBones {
          * @version DragonBones 5.1
          * @language zh_CN
          */
-        getStates(): Array;
+        getStates(): ReadonlyArray;
         /**
          * - Check whether there is an animation state is playing
          * @see dragonBones.AnimationState
@@ -5080,7 +5029,7 @@ declare namespace dragonBones {
          * @version DragonBones 4.5
          * @language zh_CN
          */
-        readonly animationNames: Array;
+        readonly animationNames: ReadonlyArray;
         /**
          * - All animation data.
          * @version DragonBones 4.5
@@ -5118,50 +5067,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly lastAnimationState: AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #play()} {@link #fadeIn()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #play()} {@link #fadeIn()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        gotoAndPlay(animationName: string, fadeInTime?: number, duration?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode, pauseFadeOut?: boolean, pauseFadeIn?: boolean): AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #gotoAndStopByTime()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #gotoAndStopByTime()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        gotoAndStop(animationName: string, time?: number): AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #animationNames}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #animationNames}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly animationList: Array;
-        /**
-         * - Deprecated, please refer to {@link #animationNames}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #animationNames}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly animationDataList: Array;
     }
 }
 /**
@@ -5210,7 +5115,7 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        additiveBlending: boolean;
+        additive: boolean;
         /**
          * - Whether the animation state has control over the display object properties of the slots.
          * Sometimes blend a animation state does not want it to control the display object properties of the slots,
@@ -5243,6 +5148,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         resetToPose: boolean;
+        /**
+         * @private
+         */
+        blendType: AnimationBlendType;
         /**
          * - The play times. [0: Loop play, [1~N]: Play N times]
          * @version DragonBones 3.0
@@ -5289,18 +5198,21 @@ declare namespace dragonBones {
          */
         timeScale: number;
         /**
-         * - The blend weight.
-         * @default 1.0
-         * @version DragonBones 5.0
-         * @language en_US
+         * @private
          */
+        parameterX: number;
         /**
-         * - 混合权重。
-         * @default 1.0
-         * @version DragonBones 5.0
-         * @language zh_CN
+         * @private
          */
-        weight: number;
+        parameterY: number;
+        /**
+         * @private
+         */
+        positionX: number;
+        /**
+         * @private
+         */
+        positionY: number;
         /**
          * - The auto fade out time when the animation state play completed.
          * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds)
@@ -5372,6 +5284,7 @@ declare namespace dragonBones {
          * @internal
          */
         _duration: number;
+        private _weight;
         private _fadeTime;
         private _time;
         /**
@@ -5382,32 +5295,27 @@ declare namespace dragonBones {
          * @internal
          */
         _weightResult: number;
-        /**
-         * @internal
-         */
-        readonly _blendState: BlendState;
         private readonly _boneMask;
         private readonly _boneTimelines;
-        private readonly _surfaceTimelines;
+        private readonly _boneBlendTimelines;
         private readonly _slotTimelines;
+        private readonly _slotBlendTimelines;
         private readonly _constraintTimelines;
         private readonly _animationTimelines;
         private readonly _poseTimelines;
-        private readonly _bonePoses;
-        /**
-         * @internal
-         */
-        _animationData: AnimationData;
+        private _animationData;
         private _armature;
         /**
          * @internal
          */
         _actionTimeline: ActionTimelineState;
         private _zOrderTimeline;
+        private _activeChildA;
+        private _activeChildB;
         /**
          * @internal
          */
-        _parent: AnimationState;
+        _parent: AnimationState | null;
         protected _onClear(): void;
         private _updateTimelines();
         private _updateBoneAndSlotTimelines();
@@ -5511,6 +5419,14 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         removeAllBoneMask(): void;
+        /**
+         * @private
+         */
+        addState(animationState: AnimationState, timelineDatas?: TimelineData[] | null): void;
+        /**
+         * @internal
+         */
+        activeTimeline(): void;
         /**
          * - Whether the animation state is fading in.
          * @version DragonBones 5.1
@@ -5599,12 +5515,25 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         currentTime: number;
+        /**
+         * - The blend weight.
+         * @default 1.0
+         * @version DragonBones 5.0
+         * @language en_US
+         */
+        /**
+         * - 混合权重。
+         * @default 1.0
+         * @version DragonBones 5.0
+         * @language zh_CN
+         */
         /**
          * - The animation data.
          * @see dragonBones.AnimationData
          * @version DragonBones 3.0
          * @language en_US
          */
+        weight: number;
         /**
          * - 动画数据。
          * @see dragonBones.AnimationData
@@ -5616,27 +5545,23 @@ declare namespace dragonBones {
     /**
      * @internal
      */
-    class BonePose extends BaseObject {
+    class BlendState extends BaseObject {
+        static readonly BONE_TRANSFORM: string;
+        static readonly BONE_ALPHA: string;
+        static readonly SURFACE: string;
+        static readonly SLOT_DEFORM: string;
+        static readonly SLOT_ALPHA: string;
+        static readonly SLOT_Z_INDEX: string;
         static toString(): string;
-        readonly current: Transform;
-        readonly delta: Transform;
-        readonly result: Transform;
-        protected _onClear(): void;
-    }
-    /**
-     * @internal
-     */
-    class BlendState {
-        dirty: boolean;
+        dirty: number;
         layer: number;
         leftWeight: number;
         layerWeight: number;
         blendWeight: number;
-        /**
-         * -1: First blending, 0: No blending, 1: Blending.
-         */
-        update(weight: number, p_layer: number): number;
-        clear(): void;
+        target: BaseObject;
+        protected _onClear(): void;
+        update(animationState: AnimationState): boolean;
+        reset(): void;
     }
 }
 /**
@@ -5662,45 +5587,38 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
-    /**
-     * @internal
-     */
-    const enum TweenState {
-        None = 0,
-        Once = 1,
-        Always = 2,
-    }
     /**
      * @internal
      */
     abstract class TimelineState extends BaseObject {
+        dirty: boolean;
         /**
          * -1: start, 0: play, 1: complete;
          */
         playState: number;
         currentPlayTimes: number;
         currentTime: number;
-        protected _tweenState: TweenState;
-        protected _frameRate: number;
+        target: BaseObject;
+        protected _isTween: boolean;
+        protected _valueOffset: number;
         protected _frameValueOffset: number;
-        protected _frameCount: number;
         protected _frameOffset: number;
+        protected _frameRate: number;
+        protected _frameCount: number;
         protected _frameIndex: number;
         protected _frameRateR: number;
         protected _position: number;
         protected _duration: number;
         protected _timeScale: number;
         protected _timeOffset: number;
-        protected _dragonBonesData: DragonBonesData;
         protected _animationData: AnimationData;
         protected _timelineData: TimelineData | null;
         protected _armature: Armature;
         protected _animationState: AnimationState;
         protected _actionTimeline: TimelineState;
-        protected _frameArray: Array | Int16Array;
-        protected _frameIntArray: Array | Int16Array;
-        protected _frameFloatArray: Array | Int16Array;
         protected _timelineArray: Array | Uint16Array;
+        protected _frameArray: Array | Int16Array;
+        protected _valueArray: Array | Int16Array | Float32Array;
         protected _frameIndices: Array;
         protected _onClear(): void;
         protected abstract _onArriveAtFrame(): void;
@@ -5709,6 +5627,7 @@ declare namespace dragonBones {
         init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
         fadeOut(): void;
         update(passedTime: number): void;
+        blend(_isDirty: boolean): void;
     }
     /**
      * @internal
@@ -5720,8 +5639,9 @@ declare namespace dragonBones {
         protected _curveCount: number;
         protected _framePosition: number;
         protected _frameDurationR: number;
-        protected _tweenProgress: number;
         protected _tweenEasing: number;
+        protected _tweenProgress: number;
+        protected _valueScale: number;
         protected _onClear(): void;
         protected _onArriveAtFrame(): void;
         protected _onUpdateFrame(): void;
@@ -5729,25 +5649,37 @@ declare namespace dragonBones {
     /**
      * @internal
      */
-    abstract class BoneTimelineState extends TweenTimelineState {
-        bone: Bone;
-        bonePose: BonePose;
+    abstract class SingleValueTimelineState extends TweenTimelineState {
+        protected _current: number;
+        protected _difference: number;
+        protected _result: number;
         protected _onClear(): void;
-        blend(state: number): void;
+        protected _onArriveAtFrame(): void;
+        protected _onUpdateFrame(): void;
     }
     /**
      * @internal
      */
-    abstract class SlotTimelineState extends TweenTimelineState {
-        slot: Slot;
+    abstract class DoubleValueTimelineState extends TweenTimelineState {
+        protected _currentA: number;
+        protected _currentB: number;
+        protected _differenceA: number;
+        protected _differenceB: number;
+        protected _resultA: number;
+        protected _resultB: number;
         protected _onClear(): void;
+        protected _onArriveAtFrame(): void;
+        protected _onUpdateFrame(): void;
     }
     /**
      * @internal
      */
-    abstract class ConstraintTimelineState extends TweenTimelineState {
-        constraint: Constraint;
+    abstract class MutilpleValueTimelineState extends TweenTimelineState {
+        protected _valueCount: number;
+        protected readonly _rd: Array;
         protected _onClear(): void;
+        protected _onArriveAtFrame(): void;
+        protected _onUpdateFrame(): void;
     }
 }
 /**
@@ -5795,73 +5727,77 @@ declare namespace dragonBones {
     /**
      * @internal
      */
-    class BoneAllTimelineState extends BoneTimelineState {
+    class BoneAllTimelineState extends MutilpleValueTimelineState {
         static toString(): string;
         protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
+        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
         fadeOut(): void;
+        blend(isDirty: boolean): void;
     }
     /**
      * @internal
      */
-    class BoneTranslateTimelineState extends BoneTimelineState {
+    class BoneTranslateTimelineState extends DoubleValueTimelineState {
         static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
+        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
+        blend(isDirty: boolean): void;
     }
     /**
      * @internal
      */
-    class BoneRotateTimelineState extends BoneTimelineState {
+    class BoneRotateTimelineState extends DoubleValueTimelineState {
         static toString(): string;
         protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
+        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
         fadeOut(): void;
+        blend(isDirty: boolean): void;
     }
     /**
      * @internal
      */
-    class BoneScaleTimelineState extends BoneTimelineState {
+    class BoneScaleTimelineState extends DoubleValueTimelineState {
         static toString(): string;
         protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
+        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
+        blend(isDirty: boolean): void;
     }
     /**
      * @internal
      */
-    class SurfaceTimelineState extends TweenTimelineState {
+    class SurfaceTimelineState extends MutilpleValueTimelineState {
         static toString(): string;
-        surface: Surface;
-        private _frameFloatOffset;
-        private _valueCount;
         private _deformCount;
-        private _valueOffset;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
+        private _deformOffset;
+        private _sameValueOffset;
         protected _onClear(): void;
+        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
+        blend(isDirty: boolean): void;
+    }
+    /**
+     * @internal
+     */
+    class AlphaTimelineState extends SingleValueTimelineState {
+        static toString(): string;
         protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
         init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        blend(state: number): void;
+        blend(isDirty: boolean): void;
     }
     /**
      * @internal
      */
-    class SlotDislayTimelineState extends SlotTimelineState {
+    class SlotDislayTimelineState extends TimelineState {
         static toString(): string;
         protected _onArriveAtFrame(): void;
+        protected _onUpdateFrame(): void;
     }
     /**
      * @internal
      */
-    class SlotColorTimelineState extends SlotTimelineState {
+    class SlotColorTimelineState extends TweenTimelineState {
         static toString(): string;
-        private _dirty;
         private readonly _current;
-        private readonly _delta;
+        private readonly _difference;
         private readonly _result;
-        protected _onClear(): void;
         protected _onArriveAtFrame(): void;
         protected _onUpdateFrame(): void;
         fadeOut(): void;
@@ -5870,46 +5806,57 @@ declare namespace dragonBones {
     /**
      * @internal
      */
-    class DeformTimelineState extends SlotTimelineState {
+    class SlotZIndexTimelineState extends SingleValueTimelineState {
         static toString(): string;
-        vertexOffset: number;
-        private _dirty;
-        private _frameFloatOffset;
-        private _valueCount;
+        protected _onArriveAtFrame(): void;
+        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
+        blend(isDirty: boolean): void;
+    }
+    /**
+     * @internal
+     */
+    class DeformTimelineState extends MutilpleValueTimelineState {
+        static toString(): string;
+        geometryOffset: number;
+        displayFrame: DisplayFrame;
         private _deformCount;
-        private _valueOffset;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
+        private _deformOffset;
+        private _sameValueOffset;
         protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
+        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
+        blend(isDirty: boolean): void;
+    }
+    /**
+     * @internal
+     */
+    class IKConstraintTimelineState extends DoubleValueTimelineState {
+        static toString(): string;
         protected _onUpdateFrame(): void;
         init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        fadeOut(): void;
-        update(passedTime: number): void;
     }
     /**
      * @internal
      */
-    class IKConstraintTimelineState extends ConstraintTimelineState {
+    class AnimationProgressTimelineState extends SingleValueTimelineState {
         static toString(): string;
-        private _current;
-        private _delta;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
         protected _onUpdateFrame(): void;
+        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
     }
     /**
      * @internal
      */
-    class AnimationTimelineState extends TweenTimelineState {
+    class AnimationWeightTimelineState extends SingleValueTimelineState {
+        static toString(): string;
+        protected _onUpdateFrame(): void;
+        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
+    }
+    /**
+     * @internal
+     */
+    class AnimationParametersTimelineState extends DoubleValueTimelineState {
         static toString(): string;
-        animationState: AnimationState;
-        private readonly _floats;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
         protected _onUpdateFrame(): void;
-        blend(state: number): void;
+        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
     }
 }
 /**
@@ -6264,39 +6211,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void;
-        /**
-         * - Deprecated, please refer to {@link #hasDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #hasDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        hasEvent(type: EventStringType): boolean;
-        /**
-         * - Deprecated, please refer to {@link #addDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #addDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        addEvent(type: EventStringType, listener: Function, thisObject: any): void;
-        /**
-         * - Deprecated, please refer to {@link #removeDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #removeDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        removeEvent(type: EventStringType, listener: Function, thisObject: any): void;
     }
 }
 /**
@@ -6323,7 +6237,7 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     abstract class DataParser {
         protected static readonly DATA_VERSION_2_3: string;
@@ -6332,6 +6246,7 @@ declare namespace dragonBones {
         protected static readonly DATA_VERSION_4_5: string;
         protected static readonly DATA_VERSION_5_0: string;
         protected static readonly DATA_VERSION_5_5: string;
+        protected static readonly DATA_VERSION_5_6: string;
         protected static readonly DATA_VERSION: string;
         protected static readonly DATA_VERSIONS: Array;
         protected static readonly TEXTURE_ATLAS: string;
@@ -6348,18 +6263,19 @@ declare namespace dragonBones {
         protected static readonly DRADON_BONES: string;
         protected static readonly USER_DATA: string;
         protected static readonly ARMATURE: string;
+        protected static readonly CANVAS: string;
         protected static readonly BONE: string;
         protected static readonly SURFACE: string;
         protected static readonly SLOT: string;
         protected static readonly CONSTRAINT: string;
-        protected static readonly IK: string;
-        protected static readonly PATH_CONSTRAINT: string;
         protected static readonly SKIN: string;
         protected static readonly DISPLAY: string;
+        protected static readonly FRAME: string;
+        protected static readonly IK: string;
+        protected static readonly PATH_CONSTRAINT: string;
         protected static readonly ANIMATION: string;
-        protected static readonly Z_ORDER: string;
+        protected static readonly TIMELINE: string;
         protected static readonly FFD: string;
-        protected static readonly FRAME: string;
         protected static readonly TRANSLATE_FRAME: string;
         protected static readonly ROTATE_FRAME: string;
         protected static readonly SCALE_FRAME: string;
@@ -6371,7 +6287,6 @@ declare namespace dragonBones {
         protected static readonly INTS: string;
         protected static readonly FLOATS: string;
         protected static readonly STRINGS: string;
-        protected static readonly CANVAS: string;
         protected static readonly TRANSFORM: string;
         protected static readonly PIVOT: string;
         protected static readonly AABB: string;
@@ -6389,6 +6304,8 @@ declare namespace dragonBones {
         protected static readonly PATH: string;
         protected static readonly LENGTH: string;
         protected static readonly DISPLAY_INDEX: string;
+        protected static readonly Z_ORDER: string;
+        protected static readonly Z_INDEX: string;
         protected static readonly BLEND_MODE: string;
         protected static readonly INHERIT_TRANSLATION: string;
         protected static readonly INHERIT_ROTATION: string;
@@ -6401,6 +6318,7 @@ declare namespace dragonBones {
         protected static readonly BEND_POSITIVE: string;
         protected static readonly CHAIN: string;
         protected static readonly WEIGHT: string;
+        protected static readonly BLEND_TYPE: string;
         protected static readonly FADE_IN_TIME: string;
         protected static readonly PLAY_TIMES: string;
         protected static readonly SCALE: string;
@@ -6424,6 +6342,7 @@ declare namespace dragonBones {
         protected static readonly VALUE: string;
         protected static readonly ROTATE: string;
         protected static readonly SKEW: string;
+        protected static readonly ALPHA: string;
         protected static readonly ALPHA_OFFSET: string;
         protected static readonly RED_OFFSET: string;
         protected static readonly GREEN_OFFSET: string;
@@ -6438,8 +6357,6 @@ declare namespace dragonBones {
         protected static readonly WEIGHTS: string;
         protected static readonly SLOT_POSE: string;
         protected static readonly BONE_POSE: string;
-        protected static readonly GLUE_WEIGHTS: string;
-        protected static readonly GLUE_MESHES: string;
         protected static readonly BONES: string;
         protected static readonly POSITION_MODE: string;
         protected static readonly SPACING_MODE: string;
@@ -6457,37 +6374,16 @@ declare namespace dragonBones {
         protected static readonly DEFAULT_NAME: string;
         protected static _getArmatureType(value: string): ArmatureType;
         protected static _getBoneType(value: string): BoneType;
-        protected static _getDisplayType(value: string): DisplayType;
-        protected static _getBoundingBoxType(value: string): BoundingBoxType;
-        protected static _getActionType(value: string): ActionType;
-        protected static _getBlendMode(value: string): BlendMode;
         protected static _getPositionMode(value: string): PositionMode;
         protected static _getSpacingMode(value: string): SpacingMode;
         protected static _getRotateMode(value: string): RotateMode;
+        protected static _getDisplayType(value: string): DisplayType;
+        protected static _getBoundingBoxType(value: string): BoundingBoxType;
+        protected static _getBlendMode(value: string): BlendMode;
+        protected static _getAnimationBlendType(value: string): AnimationBlendType;
+        protected static _getActionType(value: string): ActionType;
         abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null;
         abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static parseDragonBonesData(rawData: any): DragonBonesData | null;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static parseTextureAtlasData(rawData: any, scale?: number): any;
     }
 }
 /**
@@ -6514,7 +6410,15 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
+     */
+    const enum FrameValueType {
+        Step = 0,
+        Int = 1,
+        Float = 2,
+    }
+    /**
+     * @private
      */
     class ObjectDataParser extends DataParser {
         protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean;
@@ -6525,16 +6429,19 @@ declare namespace dragonBones {
         protected _data: DragonBonesData;
         protected _armature: ArmatureData;
         protected _bone: BoneData;
-        protected _surface: SurfaceData;
+        protected _geometry: GeometryData;
         protected _slot: SlotData;
         protected _skin: SkinData;
         protected _mesh: MeshDisplayData;
         protected _animation: AnimationData;
         protected _timeline: TimelineData;
         protected _rawTextureAtlases: Array | null;
+        private _frameValueType;
         private _defaultColorOffset;
         private _prevClockwise;
         private _prevRotation;
+        private _frameDefaultValue;
+        private _frameValueScale;
         private readonly _helpMatrixA;
         private readonly _helpMatrixB;
         private readonly _helpTransform;
@@ -6547,6 +6454,7 @@ declare namespace dragonBones {
         private readonly _frameFloatArray;
         private readonly _frameArray;
         private readonly _timelineArray;
+        private readonly _colorArray;
         private readonly _cacheRawMeshes;
         private readonly _cacheMeshes;
         private readonly _actionFrames;
@@ -6568,30 +6476,31 @@ declare namespace dragonBones {
         protected _parsePath(rawData: any, display: PathDisplayData): void;
         protected _parsePivot(rawData: any, display: ImageDisplayData): void;
         protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;
-        protected _parseMeshGlue(rawData: any, mesh: MeshDisplayData): void;
         protected _parseBoundingBox(rawData: any): BoundingBoxData | null;
         protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData;
         protected _parseAnimation(rawData: any): AnimationData;
-        protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, type: TimelineType, addIntOffset: boolean, addFloatOffset: boolean, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number): TimelineData | null;
+        protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, timelineType: TimelineType, frameValueType: FrameValueType, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number, timeline?: TimelineData | null): TimelineData | null;
         protected _parseBoneTimeline(rawData: any): void;
         protected _parseSlotTimeline(rawData: any): void;
         protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseSingleValueFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseDoubleValueFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number;
         protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseSurfaceFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseSlotFFDFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseSlotDeformFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseAnimationFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array;
+        protected _parseDeformFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseTransform(rawData: any, transform: Transform, scale: number): void;
         protected _parseColorTransform(rawData: any, color: ColorTransform): void;
+        protected _parseGeometry(rawData: any, geometry: GeometryData): void;
         protected _parseArray(rawData: any): void;
         protected _modifyArray(): void;
         parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;
@@ -6610,7 +6519,7 @@ declare namespace dragonBones {
         static getInstance(): ObjectDataParser;
     }
     /**
-     * @internal
+     * @private
      */
     class ActionFrame {
         frameStart: number;
@@ -6641,25 +6550,19 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     class BinaryDataParser extends ObjectDataParser {
         private _binaryOffset;
         private _binary;
         private _intArrayBuffer;
-        private _floatArrayBuffer;
-        private _frameIntArrayBuffer;
-        private _frameFloatArrayBuffer;
         private _frameArrayBuffer;
         private _timelineArrayBuffer;
         private _inRange(a, min, max);
         private _decodeUTF8(data);
-        private _getUTF16Key(value);
         private _parseBinaryTimeline(type, offset, timelineData?);
-        private _parseVertices(rawData, vertices);
-        protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;
-        protected _parsePath(rawData: any, path: PathDisplayData): void;
         protected _parseAnimation(rawData: any): AnimationData;
+        protected _parseGeometry(rawData: any, geometry: GeometryData): void;
         protected _parseArray(rawData: any): void;
         parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;
         private static _binaryDataParserInstance;
@@ -6752,8 +6655,8 @@ declare namespace dragonBones {
          */
         protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void;
         protected _buildConstraints(dataPackage: BuildArmaturePackage, armature: Armature): void;
-        protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, slot: Slot, displayData: DisplayData): Armature | null;
-        protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, rawDisplayData: DisplayData | null, slot: Slot): any;
+        protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, _slot: Slot, displayData: ArmatureDisplayData): Armature | null;
+        protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, slot: Slot): any;
         protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData;
         protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature;
         protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;
@@ -6814,9 +6717,20 @@ declare namespace dragonBones {
          */
         parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData;
         /**
-         * @private
+         * - Update texture atlases.
+         * @param textureAtlases - The texture atlas objects.
+         * @param name - The texture atlas name.
+         * @version DragonBones 5.7
+         * @language en_US
          */
-        updateTextureAtlasData(name: string, textureAtlases: Array): void;
+        /**
+         * - 更新贴图集对象。
+         * @param textureAtlases - 多个贴图集对象。
+         * @param name - 贴图集名称。
+         * @version DragonBones 5.7
+         * @language zh_CN
+         */
+        updateTextureAtlases(textureAtlases: Array, name: string): void;
         /**
          * - Get a specific DragonBonesData instance.
          * @param name - The DragonBonesData instance cache name.
@@ -7021,7 +6935,7 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        replaceDisplay(slot: Slot, displayData: DisplayData, displayIndex?: number): void;
+        replaceDisplay(slot: Slot, displayData: DisplayData | null, displayIndex?: number): void;
         /**
          * - Replaces the current display data for a particular slot with a specific display data.
          * Specify display data with "dragonBonesName/armatureName/slotName/displayName".
@@ -7162,31 +7076,9 @@ declare namespace dragonBones {
          * @private
          */
         readonly dragonBones: DragonBones;
-        /**
-         * - Deprecated, please refer to {@link #replaceSkin}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceSkin}。
-         * @deprecated
-         * @language zh_CN
-         */
-        changeSkin(armature: Armature, skin: SkinData, exclude?: Array | null): boolean;
-        /**
-         * - Deprecated, please refer to {@link #replaceAnimation}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceAnimation}。
-         * @deprecated
-         * @language zh_CN
-         */
-        copyAnimationsToArmature(toArmature: Armature, fromArmatreName: string, fromSkinName?: string, fromDragonBonesDataName?: string, replaceOriginalAnimation?: boolean): boolean;
     }
     /**
-     * @internal
+     * @private
      */
     class BuildArmaturePackage {
         dataName: string;
@@ -7395,10 +7287,6 @@ declare namespace dragonBones {
         protected _updateColor(): void;
         protected _updateFrame(): void;
         protected _updateMesh(): void;
-        /**
-         * @internal
-         */
-        _updateGlueMesh(): void;
         protected _updateTransform(): void;
         protected _identityTransform(): void;
     }
@@ -7516,16 +7404,5 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly soundEventManager: HiloArmatureDisplay;
-        /**
-         * - Deprecated, please refer to {@link #clock}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static readonly clock: WorldClock;
     }
 }
diff --git a/Hilo/1.x/out/dragonBones.js b/Hilo/1.x/out/dragonBones.js
index 2bf085d8..88931212 100644
--- a/Hilo/1.x/out/dragonBones.js
+++ b/Hilo/1.x/out/dragonBones.js
@@ -9,9 +9,6 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
-var dragonBones;
-(function (dragonBones) {
-})(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
  *
@@ -96,20 +93,15 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        DragonBones.VERSION = "5.6.300";
+        DragonBones.VERSION = "5.7.000";
         DragonBones.yDown = true;
         DragonBones.debug = false;
         DragonBones.debugDraw = false;
-        DragonBones.webAssembly = false;
         return DragonBones;
     }());
     dragonBones.DragonBones = DragonBones;
 })(dragonBones || (dragonBones = {}));
 //
-if (typeof global === "undefined") {
-    var global = window;
-}
-//
 if (!console.warn) {
     console.warn = function () { };
 }
@@ -134,6 +126,22 @@ var __extends = function (t, e) {
     }
     r.prototype = e.prototype, t.prototype = new r();
 };
+//
+if (typeof global === "undefined" && typeof window !== "undefined") {
+    var global = window;
+}
+if (typeof exports === "object" && typeof module === "object") {
+    module.exports = dragonBones;
+}
+else if (typeof define === "function" && define["amd"]) {
+    define(["dragonBones"], function () { return dragonBones; });
+}
+else if (typeof exports === "object") {
+    exports = dragonBones;
+}
+else if (typeof global !== "undefined") {
+    global.dragonBones = dragonBones;
+}
 /**
  * The MIT License (MIT)
  *
@@ -796,7 +804,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ColorTransform = /** @class */ (function () {
         function ColorTransform(alphaMultiplier, redMultiplier, greenMultiplier, blueMultiplier, alphaOffset, redOffset, greenOffset, blueOffset) {
@@ -1128,7 +1136,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.UserData = UserData;
     /**
-     * @internal
+     * @private
      */
     var ActionData = /** @class */ (function (_super) {
         __extends(ActionData, _super);
@@ -1252,6 +1260,7 @@ var dragonBones;
             this.frameFloatArray = null; //
             this.frameArray = null; //
             this.timelineArray = null; //
+            this.colorArray = null; //
             this.userData = null;
         };
         /**
@@ -1281,20 +1290,6 @@ var dragonBones;
         DragonBonesData.prototype.getArmature = function (armatureName) {
             return armatureName in this.armatures ? this.armatures[armatureName] : null;
         };
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.BaseFactory#removeDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.BaseFactory#removeDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DragonBonesData.prototype.dispose = function () {
-            console.warn("已废弃");
-            this.returnToPool();
-        };
         return DragonBonesData;
     }(dragonBones.BaseObject));
     dragonBones.DragonBonesData = DragonBonesData;
@@ -1736,6 +1731,7 @@ var dragonBones;
             this.inheritReflection = false;
             this.type = 0 /* Bone */;
             this.length = 0.0;
+            this.alpha = 1.0;
             this.name = "";
             this.transform.identity();
             this.userData = null;
@@ -1751,7 +1747,7 @@ var dragonBones;
         __extends(SurfaceData, _super);
         function SurfaceData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = [];
+            _this.geometry = new dragonBones.GeometryData();
             return _this;
         }
         SurfaceData.toString = function () {
@@ -1762,7 +1758,7 @@ var dragonBones;
             this.type = 1 /* Surface */;
             this.segmentX = 0;
             this.segmentY = 0;
-            this.vertices.length = 0;
+            this.geometry.clear();
         };
         return SurfaceData;
     }(BoneData));
@@ -1807,6 +1803,8 @@ var dragonBones;
             this.blendMode = 0 /* Normal */;
             this.displayIndex = 0;
             this.zOrder = 0;
+            this.zIndex = 0;
+            this.alpha = 1.0;
             this.name = "";
             this.color = null; //
             this.userData = null;
@@ -1845,7 +1843,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ConstraintData = /** @class */ (function (_super) {
         __extends(ConstraintData, _super);
@@ -1942,7 +1940,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var CanvasData = /** @class */ (function (_super) {
         __extends(CanvasData, _super);
@@ -2092,13 +2090,13 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
-    var VerticesData = /** @class */ (function () {
-        function VerticesData() {
+    var GeometryData = /** @class */ (function () {
+        function GeometryData() {
             this.weight = null; // Initial value.
         }
-        VerticesData.prototype.clear = function () {
+        GeometryData.prototype.clear = function () {
             if (!this.isShared && this.weight !== null) {
                 this.weight.returnToPool();
             }
@@ -2108,16 +2106,32 @@ var dragonBones;
             this.data = null;
             this.weight = null;
         };
-        VerticesData.prototype.shareFrom = function (value) {
+        GeometryData.prototype.shareFrom = function (value) {
             this.isShared = true;
             this.offset = value.offset;
             this.weight = value.weight;
         };
-        return VerticesData;
+        Object.defineProperty(GeometryData.prototype, "vertexCount", {
+            get: function () {
+                var intArray = this.data.intArray;
+                return intArray[this.offset + 0 /* GeometryVertexCount */];
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(GeometryData.prototype, "triangleCount", {
+            get: function () {
+                var intArray = this.data.intArray;
+                return intArray[this.offset + 1 /* GeometryTriangleCount */];
+            },
+            enumerable: true,
+            configurable: true
+        });
+        return GeometryData;
     }());
-    dragonBones.VerticesData = VerticesData;
+    dragonBones.GeometryData = GeometryData;
     /**
-     * @internal
+     * @private
      */
     var DisplayData = /** @class */ (function (_super) {
         __extends(DisplayData, _super);
@@ -2136,7 +2150,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.DisplayData = DisplayData;
     /**
-     * @internal
+     * @private
      */
     var ImageDisplayData = /** @class */ (function (_super) {
         __extends(ImageDisplayData, _super);
@@ -2158,7 +2172,7 @@ var dragonBones;
     }(DisplayData));
     dragonBones.ImageDisplayData = ImageDisplayData;
     /**
-     * @internal
+     * @private
      */
     var ArmatureDisplayData = /** @class */ (function (_super) {
         __extends(ArmatureDisplayData, _super);
@@ -2191,13 +2205,13 @@ var dragonBones;
     }(DisplayData));
     dragonBones.ArmatureDisplayData = ArmatureDisplayData;
     /**
-     * @internal
+     * @private
      */
     var MeshDisplayData = /** @class */ (function (_super) {
         __extends(MeshDisplayData, _super);
         function MeshDisplayData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = new VerticesData();
+            _this.geometry = new GeometryData();
             return _this;
         }
         MeshDisplayData.toString = function () {
@@ -2206,14 +2220,14 @@ var dragonBones;
         MeshDisplayData.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
             this.type = 2 /* Mesh */;
-            this.vertices.clear();
+            this.geometry.clear();
             this.texture = null;
         };
         return MeshDisplayData;
     }(DisplayData));
     dragonBones.MeshDisplayData = MeshDisplayData;
     /**
-     * @internal
+     * @private
      */
     var BoundingBoxDisplayData = /** @class */ (function (_super) {
         __extends(BoundingBoxDisplayData, _super);
@@ -2237,13 +2251,13 @@ var dragonBones;
     }(DisplayData));
     dragonBones.BoundingBoxDisplayData = BoundingBoxDisplayData;
     /**
-     * @internal
+     * @private
      */
     var PathDisplayData = /** @class */ (function (_super) {
         __extends(PathDisplayData, _super);
         function PathDisplayData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = new VerticesData();
+            _this.geometry = new GeometryData();
             _this.curveLengths = [];
             return _this;
         }
@@ -2255,14 +2269,14 @@ var dragonBones;
             this.type = 4 /* Path */;
             this.closed = false;
             this.constantSpeed = false;
-            this.vertices.clear();
+            this.geometry.clear();
             this.curveLengths.length = 0;
         };
         return PathDisplayData;
     }(DisplayData));
     dragonBones.PathDisplayData = PathDisplayData;
     /**
-     * @internal
+     * @private
      */
     var WeightData = /** @class */ (function (_super) {
         __extends(WeightData, _super);
@@ -2910,10 +2924,6 @@ var dragonBones;
              * @private
              */
             _this.boneTimelines = {};
-            /**
-             * @private
-             */
-            _this.surfaceTimelines = {};
             /**
              * @private
              */
@@ -2955,30 +2965,23 @@ var dragonBones;
                 }
                 delete this.boneTimelines[k];
             }
-            for (var k in this.surfaceTimelines) {
-                for (var _b = 0, _c = this.surfaceTimelines[k]; _b < _c.length; _b++) {
-                    var timeline = _c[_b];
-                    timeline.returnToPool();
-                }
-                delete this.surfaceTimelines[k];
-            }
             for (var k in this.slotTimelines) {
-                for (var _d = 0, _e = this.slotTimelines[k]; _d < _e.length; _d++) {
-                    var timeline = _e[_d];
+                for (var _b = 0, _c = this.slotTimelines[k]; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
                     timeline.returnToPool();
                 }
                 delete this.slotTimelines[k];
             }
             for (var k in this.constraintTimelines) {
-                for (var _f = 0, _g = this.constraintTimelines[k]; _f < _g.length; _f++) {
-                    var timeline = _g[_f];
+                for (var _d = 0, _e = this.constraintTimelines[k]; _d < _e.length; _d++) {
+                    var timeline = _e[_d];
                     timeline.returnToPool();
                 }
                 delete this.constraintTimelines[k];
             }
             for (var k in this.animationTimelines) {
-                for (var _h = 0, _j = this.animationTimelines[k]; _h < _j.length; _h++) {
-                    var timeline = _j[_h];
+                for (var _f = 0, _g = this.animationTimelines[k]; _f < _g.length; _f++) {
+                    var timeline = _g[_f];
                     timeline.returnToPool();
                 }
                 delete this.animationTimelines[k];
@@ -2998,6 +3001,7 @@ var dragonBones;
             this.frameIntOffset = 0;
             this.frameFloatOffset = 0;
             this.frameOffset = 0;
+            this.blendType = 0 /* None */;
             this.frameCount = 0;
             this.playTimes = 0;
             this.duration = 0.0;
@@ -3007,7 +3011,6 @@ var dragonBones;
             this.name = "";
             this.cachedFrames.length = 0;
             // this.boneTimelines.clear();
-            // this.surfaceTimelines.clear();
             // this.slotTimelines.clear();
             // this.constraintTimelines.clear();
             // this.animationTimelines.clear();
@@ -3050,17 +3053,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addBoneTimeline = function (bone, timeline) {
-            var timelines = bone.name in this.boneTimelines ? this.boneTimelines[bone.name] : (this.boneTimelines[bone.name] = []);
-            if (timelines.indexOf(timeline) < 0) {
-                timelines.push(timeline);
-            }
-        };
-        /**
-         * @private
-         */
-        AnimationData.prototype.addSurfaceTimeline = function (surface, timeline) {
-            var timelines = surface.name in this.surfaceTimelines ? this.surfaceTimelines[surface.name] : (this.surfaceTimelines[surface.name] = []);
+        AnimationData.prototype.addBoneTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : (this.boneTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3068,8 +3062,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addSlotTimeline = function (slot, timeline) {
-            var timelines = slot.name in this.slotTimelines ? this.slotTimelines[slot.name] : (this.slotTimelines[slot.name] = []);
+        AnimationData.prototype.addSlotTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : (this.slotTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3077,8 +3071,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addConstraintTimeline = function (constraint, timeline) {
-            var timelines = constraint.name in this.constraintTimelines ? this.constraintTimelines[constraint.name] : (this.constraintTimelines[constraint.name] = []);
+        AnimationData.prototype.addConstraintTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : (this.constraintTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3098,12 +3092,6 @@ var dragonBones;
         AnimationData.prototype.getBoneTimelines = function (timelineName) {
             return timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : null;
         };
-        /**
-         * @private
-         */
-        AnimationData.prototype.getSurfaceTimelines = function (timelineName) {
-            return timelineName in this.surfaceTimelines ? this.surfaceTimelines[timelineName] : null;
-        };
         /**
          * @private
          */
@@ -3138,7 +3126,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.AnimationData = AnimationData;
     /**
-     * @internal
+     * @private
      */
     var TimelineData = /** @class */ (function (_super) {
         __extends(TimelineData, _super);
@@ -3156,6 +3144,25 @@ var dragonBones;
         return TimelineData;
     }(dragonBones.BaseObject));
     dragonBones.TimelineData = TimelineData;
+    /**
+     * @internal
+     */
+    var AnimationTimelineData = /** @class */ (function (_super) {
+        __extends(AnimationTimelineData, _super);
+        function AnimationTimelineData() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationTimelineData.toString = function () {
+            return "[class dragonBones.AnimationTimelineData]";
+        };
+        AnimationTimelineData.prototype._onClear = function () {
+            _super.prototype._onClear.call(this);
+            this.x = 0.0;
+            this.y = 0.0;
+        };
+        return AnimationTimelineData;
+    }(TimelineData));
+    dragonBones.AnimationTimelineData = AnimationTimelineData;
 })(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
@@ -3216,7 +3223,7 @@ var dragonBones;
             this.fadeOutTweenType = 1 /* Line */;
             this.fadeOutTime = -1.0;
             this.actionEnabled = true;
-            this.additiveBlending = false;
+            this.additive = false;
             this.displayControl = true;
             this.pauseFadeIn = true;
             this.resetToPose = true;
@@ -3249,7 +3256,7 @@ var dragonBones;
             this.autoFadeOutTime = value.autoFadeOutTime;
             this.fadeOutTweenType = value.fadeOutTweenType;
             this.actionEnabled = value.actionEnabled;
-            this.additiveBlending = value.additiveBlending;
+            this.additive = value.additive;
             this.displayControl = value.displayControl;
             this.pauseFadeIn = value.pauseFadeIn;
             this.resetToPose = value.resetToPose;
@@ -3270,68 +3277,6 @@ var dragonBones;
                 this.boneMask[i] = value.boneMask[i];
             }
         };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.containsBoneMask = function (boneName) {
-            return this.boneMask.length === 0 || this.boneMask.indexOf(boneName) >= 0;
-        };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.addBoneMask = function (armature, boneName, recursive) {
-            if (recursive === void 0) { recursive = true; }
-            var currentBone = armature.getBone(boneName);
-            if (currentBone === null) {
-                return;
-            }
-            if (this.boneMask.indexOf(boneName) < 0) {
-                this.boneMask.push(boneName);
-            }
-            if (recursive) {
-                for (var _i = 0, _a = armature.getBones(); _i < _a.length; _i++) {
-                    var bone = _a[_i];
-                    if (this.boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) {
-                        this.boneMask.push(bone.name);
-                    }
-                }
-            }
-        };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.removeBoneMask = function (armature, boneName, recursive) {
-            if (recursive === void 0) { recursive = true; }
-            var index = this.boneMask.indexOf(boneName);
-            if (index >= 0) {
-                this.boneMask.splice(index, 1);
-            }
-            if (recursive) {
-                var currentBone = armature.getBone(boneName);
-                if (currentBone !== null) {
-                    if (this.boneMask.length > 0) {
-                        for (var _i = 0, _a = armature.getBones(); _i < _a.length; _i++) {
-                            var bone = _a[_i];
-                            var index_1 = this.boneMask.indexOf(bone.name);
-                            if (index_1 >= 0 && currentBone.contains(bone)) {
-                                this.boneMask.splice(index_1, 1);
-                            }
-                        }
-                    }
-                    else {
-                        for (var _b = 0, _c = armature.getBones(); _b < _c.length; _b++) {
-                            var bone = _c[_b];
-                            if (bone === currentBone) {
-                                continue;
-                            }
-                            if (!currentBone.contains(bone)) {
-                                this.boneMask.push(bone.name);
-                            }
-                        }
-                    }
-                }
-            }
-        };
         return AnimationConfig;
     }(dragonBones.BaseObject));
     dragonBones.AnimationConfig = AnimationConfig;
@@ -3435,7 +3380,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.TextureAtlasData = TextureAtlasData;
     /**
-     * @internal
+     * @private
      */
     var TextureData = /** @class */ (function (_super) {
         __extends(TextureData, _super);
@@ -3540,7 +3485,7 @@ var dragonBones;
             return "[class dragonBones.Armature]";
         };
         Armature._onSortSlots = function (a, b) {
-            return a._zOrder > b._zOrder ? 1 : -1;
+            return a._zIndex * 1000 + a._zOrder > b._zIndex * 1000 + b._zOrder ? 1 : -1;
         };
         Armature.prototype._onClear = function () {
             if (this._clock !== null) {
@@ -3576,9 +3521,13 @@ var dragonBones;
             this._lockUpdate = false;
             this._slotsDirty = true;
             this._zOrderDirty = false;
+            this._zIndexDirty = false;
+            this._alphaDirty = true;
             this._flipX = false;
             this._flipY = false;
             this._cacheFrameIndex = -1;
+            this._alpha = 1.0;
+            this._globalAlpha = 1.0;
             this._bones.length = 0;
             this._slots.length = 0;
             this._constraints.length = 0;
@@ -3608,7 +3557,7 @@ var dragonBones;
                     var slotData = slotDatas[slotIndex];
                     var slot = this.getSlot(slotData.name);
                     if (slot !== null) {
-                        slot._setZorder(i);
+                        slot._setZOrder(i);
                     }
                 }
                 this._slotsDirty = true;
@@ -3701,6 +3650,7 @@ var dragonBones;
             if (this._lockUpdate) {
                 return;
             }
+            this._lockUpdate = true;
             if (this._armatureData === null) {
                 console.warn("The armature has been disposed.");
                 return;
@@ -3713,9 +3663,28 @@ var dragonBones;
             // Update animation.
             this._animation.advanceTime(passedTime);
             // Sort slots.
-            if (this._slotsDirty) {
-                this._slotsDirty = false;
+            if (this._slotsDirty || this._zIndexDirty) {
                 this._slots.sort(Armature._onSortSlots);
+                if (this._zIndexDirty) {
+                    for (var i = 0, l = this._slots.length; i < l; ++i) {
+                        this._slots[i]._setZOrder(i); // 
+                    }
+                }
+                this._slotsDirty = false;
+                this._zIndexDirty = false;
+            }
+            // Update alpha.
+            if (this._alphaDirty) {
+                this._alphaDirty = false;
+                this._globalAlpha = this._alpha * (this._parent !== null ? this._parent._globalAlpha : 1.0);
+                for (var _i = 0, _a = this._bones; _i < _a.length; _i++) {
+                    var bone = _a[_i];
+                    bone._updateAlpha();
+                }
+                for (var _b = 0, _c = this._slots; _b < _c.length; _b++) {
+                    var slot = _c[_b];
+                    slot._updateAlpha();
+                }
             }
             // Update bones and slots.
             if (this._cacheFrameIndex < 0 || this._cacheFrameIndex !== prevCacheFrameIndex) {
@@ -3729,9 +3698,8 @@ var dragonBones;
             }
             // Do actions.
             if (this._actions.length > 0) {
-                this._lockUpdate = true;
-                for (var _i = 0, _a = this._actions; _i < _a.length; _i++) {
-                    var action = _a[_i];
+                for (var _d = 0, _e = this._actions; _d < _e.length; _d++) {
+                    var action = _e[_d];
                     var actionData = action.actionData;
                     if (actionData !== null) {
                         if (actionData.type === 0 /* Play */) {
@@ -3742,8 +3710,8 @@ var dragonBones;
                                 }
                             }
                             else if (action.bone !== null) {
-                                for (var _b = 0, _c = this.getSlots(); _b < _c.length; _b++) {
-                                    var slot = _c[_b];
+                                for (var _f = 0, _g = this.getSlots(); _f < _g.length; _f++) {
+                                    var slot = _g[_f];
                                     if (slot.parent === action.bone) {
                                         var childArmature = slot.childArmature;
                                         if (childArmature !== null) {
@@ -3760,8 +3728,8 @@ var dragonBones;
                     action.returnToPool();
                 }
                 this._actions.length = 0;
-                this._lockUpdate = false;
             }
+            this._lockUpdate = false;
             this._proxy.dbUpdate();
         };
         /**
@@ -4334,69 +4302,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * @deprecated
-         * @private
-         */
-        Armature.prototype.replaceTexture = function (texture) {
-            this.replacedTexture = texture;
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.hasEventListener = function (type) {
-            console.warn("Deprecated.");
-            return this._proxy.hasDBEventListener(type);
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.addEventListener = function (type, listener, target) {
-            console.warn("Deprecated.");
-            this._proxy.addDBEventListener(type, listener, target);
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.removeEventListener = function (type, listener, target) {
-            console.warn("Deprecated.");
-            this._proxy.removeDBEventListener(type, listener, target);
-        };
-        /**
-         * - Deprecated, please refer to {@link #cacheFrameRate}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #cacheFrameRate}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.enableAnimationCache = function (frameRate) {
-            console.warn("Deprecated.");
-            this.cacheFrameRate = frameRate;
-        };
         /**
          * - Deprecated, please refer to {@link #display}.
          * @deprecated
@@ -4502,6 +4407,8 @@ var dragonBones;
             this.origin = null;
             this.userData = null;
             this._globalDirty = false;
+            this._alpha = 1.0;
+            this._globalAlpha = 1.0;
             this._armature = null; //
         };
         /**
@@ -4608,10 +4515,6 @@ var dragonBones;
              * @internal
              */
             _this.animationPose = new dragonBones.Transform();
-            /**
-             * @internal
-             */
-            _this._blendState = new dragonBones.BlendState();
             return _this;
         }
         Bone.toString = function () {
@@ -4627,7 +4530,6 @@ var dragonBones;
             this._hasConstraint = false;
             this._visible = true;
             this._cachedFrameIndex = -1;
-            this._blendState.clear();
             this._boneData = null; //
             this._parent = null; //
             this._cachedFrameIndices = null;
@@ -4672,39 +4574,61 @@ var dragonBones;
                 global.copyFrom(offset);
             }
             if (inherit) {
-                var parentMatrix = parent._boneData.type === 0 /* Bone */ ? parent.globalTransformMatrix : parent._getGlobalTransformMatrix(global.x, global.y);
-                if (boneData.inheritScale) {
-                    if (!boneData.inheritRotation) {
-                        parent.updateGlobalTransform();
-                        if (flipX && flipY) {
-                            rotation = global.rotation - (parent.global.rotation + Math.PI);
-                        }
-                        else if (flipX) {
-                            rotation = global.rotation + parent.global.rotation + Math.PI;
-                        }
-                        else if (flipY) {
-                            rotation = global.rotation + parent.global.rotation;
+                var isSurface = parent._boneData.type === 1 /* Surface */;
+                var surfaceBone = isSurface ? parent._bone : null;
+                var parentMatrix = isSurface ? parent._getGlobalTransformMatrix(global.x, global.y) : parent.globalTransformMatrix;
+                if (boneData.inheritScale && (!isSurface || surfaceBone !== null)) {
+                    if (isSurface) {
+                        if (boneData.inheritRotation) {
+                            global.rotation += parent.global.rotation;
+                        }
+                        surfaceBone.updateGlobalTransform();
+                        global.scaleX *= surfaceBone.global.scaleX;
+                        global.scaleY *= surfaceBone.global.scaleY;
+                        parentMatrix.transformPoint(global.x, global.y, global);
+                        global.toMatrix(globalTransformMatrix);
+                        if (boneData.inheritTranslation) {
+                            global.x = globalTransformMatrix.tx;
+                            global.y = globalTransformMatrix.ty;
                         }
                         else {
-                            rotation = global.rotation - parent.global.rotation;
+                            globalTransformMatrix.tx = global.x;
+                            globalTransformMatrix.ty = global.y;
                         }
-                        global.rotation = rotation;
-                    }
-                    global.toMatrix(globalTransformMatrix);
-                    globalTransformMatrix.concat(parentMatrix);
-                    if (boneData.inheritTranslation) {
-                        global.x = globalTransformMatrix.tx;
-                        global.y = globalTransformMatrix.ty;
-                    }
-                    else {
-                        globalTransformMatrix.tx = global.x;
-                        globalTransformMatrix.ty = global.y;
-                    }
-                    if (isCache) {
-                        global.fromMatrix(globalTransformMatrix);
                     }
                     else {
-                        this._globalDirty = true;
+                        if (!boneData.inheritRotation) {
+                            parent.updateGlobalTransform();
+                            if (flipX && flipY) {
+                                rotation = global.rotation - (parent.global.rotation + Math.PI);
+                            }
+                            else if (flipX) {
+                                rotation = global.rotation + parent.global.rotation + Math.PI;
+                            }
+                            else if (flipY) {
+                                rotation = global.rotation + parent.global.rotation;
+                            }
+                            else {
+                                rotation = global.rotation - parent.global.rotation;
+                            }
+                            global.rotation = rotation;
+                        }
+                        global.toMatrix(globalTransformMatrix);
+                        globalTransformMatrix.concat(parentMatrix);
+                        if (boneData.inheritTranslation) {
+                            global.x = globalTransformMatrix.tx;
+                            global.y = globalTransformMatrix.ty;
+                        }
+                        else {
+                            globalTransformMatrix.tx = global.x;
+                            globalTransformMatrix.ty = global.y;
+                        }
+                        if (isCache) {
+                            global.fromMatrix(globalTransformMatrix);
+                        }
+                        else {
+                            this._globalDirty = true;
+                        }
                     }
                 }
                 else {
@@ -4781,6 +4705,17 @@ var dragonBones;
                 global.toMatrix(globalTransformMatrix);
             }
         };
+        /**
+         * @internal
+         */
+        Bone.prototype._updateAlpha = function () {
+            if (this._parent !== null) {
+                this._globalAlpha = this._alpha * this._parent._globalAlpha;
+            }
+            else {
+                this._globalAlpha = this._alpha * this._armature._globalAlpha;
+            }
+        };
         /**
          * @internal
          */
@@ -4790,6 +4725,7 @@ var dragonBones;
             }
             this._boneData = boneData;
             this._armature = armatureValue;
+            this._alpha = this._boneData.alpha;
             if (this._boneData.parent !== null) {
                 this._parent = this._armature.getBone(this._boneData.parent.name);
             }
@@ -4801,7 +4737,6 @@ var dragonBones;
          * @internal
          */
         Bone.prototype.update = function (cacheFrameIndex) {
-            this._blendState.dirty = false;
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
                 if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) {
@@ -5019,72 +4954,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getBones()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getBones()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Bone.prototype.getBones = function () {
-            console.warn("Deprecated.");
-            var bones = new Array();
-            for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) {
-                var bone = _a[_i];
-                if (bone.parent === this) {
-                    bones.push(bone);
-                }
-            }
-            return bones;
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getSlots()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getSlots()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Bone.prototype.getSlots = function () {
-            console.warn("Deprecated.");
-            var slots = new Array();
-            for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) {
-                var slot = _a[_i];
-                if (slot.parent === this) {
-                    slots.push(slot);
-                }
-            }
-            return slots;
-        };
-        Object.defineProperty(Bone.prototype, "slot", {
-            /**
-             * - Deprecated, please refer to {@link dragonBones.Armature#getSlot()}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link dragonBones.Armature#getSlot()}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) {
-                    var slot = _a[_i];
-                    if (slot.parent === this) {
-                        return slot;
-                    }
-                }
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         return Bone;
     }(dragonBones.TransformObject));
     dragonBones.Bone = Bone;
@@ -5146,6 +5015,7 @@ var dragonBones;
             this._deformVertices.length = 0;
             this._matrixCahce.length = 0;
             this._hullCache.length = 0;
+            this._bone = null;
         };
         Surface.prototype._getAffineTransform = function (x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown) {
             var dabX = bX - aX;
@@ -5164,35 +5034,43 @@ var dragonBones;
             transform.y = matrix.ty = aY - (matrix.b * x + matrix.d * y);
         };
         Surface.prototype._updateVertices = function () {
-            var originalVertices = this._boneData.vertices;
+            var data = this._armature.armatureData.parent;
+            var geometry = this._boneData.geometry;
+            var intArray = data.intArray;
+            var floatArray = data.floatArray;
+            var vertexCount = intArray[geometry.offset + 0 /* GeometryVertexCount */];
+            var verticesOffset = intArray[geometry.offset + 2 /* GeometryFloatOffset */];
             var vertices = this._vertices;
             var animationVertices = this._deformVertices;
             if (this._parent !== null) {
                 if (this._parent._boneData.type === 1 /* Surface */) {
-                    for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                        var x = originalVertices[i] + animationVertices[i];
-                        var y = originalVertices[i + 1] + animationVertices[i];
+                    for (var i = 0, l = vertexCount; i < l; ++i) {
+                        var iD = i * 2;
+                        var x = floatArray[verticesOffset + iD] + animationVertices[iD];
+                        var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                         var matrix = this._parent._getGlobalTransformMatrix(x, y);
                         //
-                        vertices[i] = matrix.a * x + matrix.c * y + matrix.tx;
-                        vertices[i + 1] = matrix.b * x + matrix.d * y + matrix.ty;
+                        vertices[iD] = matrix.a * x + matrix.c * y + matrix.tx;
+                        vertices[iD + 1] = matrix.b * x + matrix.d * y + matrix.ty;
                     }
                 }
                 else {
                     var parentMatrix = this._parent.globalTransformMatrix;
-                    for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                        var x = originalVertices[i] + animationVertices[i];
-                        var y = originalVertices[i + 1] + animationVertices[i + 1];
+                    for (var i = 0, l = vertexCount; i < l; ++i) {
+                        var iD = i * 2;
+                        var x = floatArray[verticesOffset + iD] + animationVertices[iD];
+                        var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                         //
-                        vertices[i] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx;
-                        vertices[i + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty;
+                        vertices[iD] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx;
+                        vertices[iD + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty;
                     }
                 }
             }
             else {
-                for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                    vertices[i] = originalVertices[i] + animationVertices[i];
-                    vertices[i + 1] = originalVertices[i + 1] + animationVertices[i + 1];
+                for (var i = 0, l = vertexCount; i < l; ++i) {
+                    var iD = i * 2;
+                    vertices[iD] = floatArray[verticesOffset + iD] + animationVertices[iD];
+                    vertices[iD + 1] = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                 }
             }
         };
@@ -5222,17 +5100,17 @@ var dragonBones;
             var bY = rbY + (rcY - rbY) * 0.5;
             var cX = rdX + (rcX - rdX) * 0.5;
             var cY = rdY + (rcY - rdY) * 0.5;
-            //
-            this._globalDirty = false;
+            // TODO interpolation
             this._getAffineTransform(0.0, 0.0, lA, lA, aX, aY, bX, bY, cX, cY, this.global, this.globalTransformMatrix, false);
+            this._globalDirty = false;
         };
         Surface.prototype._getGlobalTransformMatrix = function (x, y) {
+            var lA = 200.0;
             var lB = 1000.0;
             if (x < -lB || lB < x || y < -lB || lB < y) {
                 return this.globalTransformMatrix;
             }
             var isDown = false;
-            var lA = 200.0;
             var surfaceData = this._boneData;
             var segmentX = surfaceData.segmentX;
             var segmentY = surfaceData.segmentY;
@@ -5244,6 +5122,7 @@ var dragonBones;
             var matrixIndex = 0;
             var pX = indexX * dX - lA;
             var pY = indexY * dY - lA;
+            //
             var matrices = this._matrixCahce;
             var helpMatrix = Surface._helpMatrix;
             if (x < -lA) {
@@ -5252,8 +5131,8 @@ var dragonBones;
                 }
                 // Left.
                 isDown = y > this._kX * (x + lA) + pY;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX * 2 + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + segmentY + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5284,8 +5163,8 @@ var dragonBones;
                 }
                 // Right.
                 isDown = y > this._kX * (x - lB) + pY;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5316,8 +5195,8 @@ var dragonBones;
                 }
                 // Up.
                 isDown = y > this._kY * (x - pX - dX) - lB;
-                matrixIndex = (segmentX * (segmentY + 1) + indexX * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5348,8 +5227,8 @@ var dragonBones;
                 }
                 // Down
                 isDown = y > this._kY * (x - pX - dX) + lA;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5377,7 +5256,7 @@ var dragonBones;
             else {
                 isDown = y > this._k * (x - pX - dX) + pY;
                 matrixIndex = ((segmentX * indexY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5411,7 +5290,7 @@ var dragonBones;
             _super.prototype.init.call(this, surfaceData, armatureValue);
             var segmentX = surfaceData.segmentX;
             var segmentY = surfaceData.segmentY;
-            var vertexCount = surfaceData.vertices.length;
+            var vertexCount = this._armature.armatureData.parent.intArray[surfaceData.geometry.offset + 0 /* GeometryVertexCount */];
             var lB = 1000.0;
             var lA = 200.0;
             //
@@ -5420,19 +5299,26 @@ var dragonBones;
             this._k = -this._dY / this._dX;
             this._kX = -this._dY / (lB - lA);
             this._kY = -(lB - lA) / this._dX;
-            this._vertices.length = vertexCount;
-            this._deformVertices.length = vertexCount;
+            this._vertices.length = vertexCount * 2;
+            this._deformVertices.length = vertexCount * 2;
             this._matrixCahce.length = (segmentX * segmentY + segmentX * 2 + segmentY * 2) * 2 * 7;
             this._hullCache.length = 10;
-            for (var i = 0; i < vertexCount; ++i) {
+            for (var i = 0; i < vertexCount * 2; ++i) {
                 this._deformVertices[i] = 0.0;
             }
+            if (this._parent !== null) {
+                if (this._parent.boneData.type === 0 /* Bone */) {
+                    this._bone = this._parent;
+                }
+                else {
+                    this._bone = this._parent._bone;
+                }
+            }
         };
         /**
          * @internal
          */
         Surface.prototype.update = function (cacheFrameIndex) {
-            this._blendState.dirty = false;
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
                 if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) {
@@ -5561,6 +5447,105 @@ var dragonBones;
  */
 var dragonBones;
 (function (dragonBones) {
+    /**
+     * @private
+     */
+    var DisplayFrame = /** @class */ (function (_super) {
+        __extends(DisplayFrame, _super);
+        function DisplayFrame() {
+            var _this = _super !== null && _super.apply(this, arguments) || this;
+            _this.deformVertices = [];
+            return _this;
+        }
+        DisplayFrame.toString = function () {
+            return "[class dragonBones.DisplayFrame]";
+        };
+        DisplayFrame.prototype._onClear = function () {
+            this.rawDisplayData = null;
+            this.displayData = null;
+            this.textureData = null;
+            this.display = null;
+            this.deformVertices.length = 0;
+        };
+        DisplayFrame.prototype.updateDeformVertices = function () {
+            if (this.rawDisplayData === null || this.deformVertices.length !== 0) {
+                return;
+            }
+            var rawGeometryData;
+            if (this.rawDisplayData.type === 2 /* Mesh */) {
+                rawGeometryData = this.rawDisplayData.geometry;
+            }
+            else if (this.rawDisplayData.type === 4 /* Path */) {
+                rawGeometryData = this.rawDisplayData.geometry;
+            }
+            else {
+                return;
+            }
+            var vertexCount = 0;
+            if (rawGeometryData.weight !== null) {
+                vertexCount = rawGeometryData.weight.count * 2;
+            }
+            else {
+                vertexCount = rawGeometryData.data.intArray[rawGeometryData.offset + 0 /* GeometryVertexCount */] * 2;
+            }
+            this.deformVertices.length = vertexCount;
+            for (var i = 0, l = this.deformVertices.length; i < l; ++i) {
+                this.deformVertices[i] = 0.0;
+            }
+        };
+        DisplayFrame.prototype.getGeometryData = function () {
+            if (this.displayData !== null) {
+                if (this.displayData.type === 2 /* Mesh */) {
+                    return this.displayData.geometry;
+                }
+                if (this.displayData.type === 4 /* Path */) {
+                    return this.displayData.geometry;
+                }
+            }
+            if (this.rawDisplayData !== null) {
+                if (this.rawDisplayData.type === 2 /* Mesh */) {
+                    return this.rawDisplayData.geometry;
+                }
+                if (this.rawDisplayData.type === 4 /* Path */) {
+                    return this.rawDisplayData.geometry;
+                }
+            }
+            return null;
+        };
+        DisplayFrame.prototype.getBoundingBox = function () {
+            if (this.displayData !== null && this.displayData.type === 3 /* BoundingBox */) {
+                return this.displayData.boundingBox;
+            }
+            if (this.rawDisplayData !== null && this.rawDisplayData.type === 3 /* BoundingBox */) {
+                return this.rawDisplayData.boundingBox;
+            }
+            return null;
+        };
+        DisplayFrame.prototype.getTextureData = function () {
+            if (this.displayData !== null) {
+                if (this.displayData.type === 0 /* Image */) {
+                    return this.displayData.texture;
+                }
+                if (this.displayData.type === 2 /* Mesh */) {
+                    return this.displayData.texture;
+                }
+            }
+            if (this.textureData !== null) {
+                return this.textureData;
+            }
+            if (this.rawDisplayData !== null) {
+                if (this.rawDisplayData.type === 0 /* Image */) {
+                    return this.rawDisplayData.texture;
+                }
+                if (this.rawDisplayData.type === 2 /* Mesh */) {
+                    return this.rawDisplayData.texture;
+                }
+            }
+            return null;
+        };
+        return DisplayFrame;
+    }(dragonBones.BaseObject));
+    dragonBones.DisplayFrame = DisplayFrame;
     /**
      * - The slot attached to the armature, controls the display status and properties of the display object.
      * A bone can contain multiple slots.
@@ -5594,25 +5579,30 @@ var dragonBones;
              * @internal
              */
             _this._colorTransform = new dragonBones.ColorTransform();
-            _this._displayDatas = [];
-            _this._displayList = [];
             /**
              * @internal
              */
-            _this._deformVertices = null;
+            _this._displayFrames = [];
+            /**
+             * @internal
+             */
+            _this._geometryBones = [];
             _this._rawDisplay = null; // Initial value.
             _this._meshDisplay = null; // Initial value.
+            _this._display = null;
             return _this;
         }
         Slot.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
             var disposeDisplayList = [];
-            for (var _i = 0, _a = this._displayList; _i < _a.length; _i++) {
-                var eachDisplay = _a[_i];
-                if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                    disposeDisplayList.indexOf(eachDisplay) < 0) {
-                    disposeDisplayList.push(eachDisplay);
+            for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                var dispayFrame = _a[_i];
+                var display = dispayFrame.display;
+                if (display !== this._rawDisplay && display !== this._meshDisplay &&
+                    disposeDisplayList.indexOf(display) < 0) {
+                    disposeDisplayList.push(display);
                 }
+                dispayFrame.returnToPool();
             }
             for (var _b = 0, disposeDisplayList_1 = disposeDisplayList; _b < disposeDisplayList_1.length; _b++) {
                 var eachDisplay = disposeDisplayList_1[_b];
@@ -5623,9 +5613,6 @@ var dragonBones;
                     this._disposeDisplay(eachDisplay, true);
                 }
             }
-            if (this._deformVertices !== null) {
-                this._deformVertices.returnToPool();
-            }
             if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) {
                 this._disposeDisplay(this._meshDisplay, false);
             }
@@ -5633,29 +5620,34 @@ var dragonBones;
                 this._disposeDisplay(this._rawDisplay, false);
             }
             this.displayController = null;
+            this._displayDataDirty = false;
             this._displayDirty = false;
-            this._zOrderDirty = false;
+            this._geometryDirty = false;
+            this._textureDirty = false;
+            this._visibleDirty = false;
             this._blendModeDirty = false;
+            this._zOrderDirty = false;
             this._colorDirty = false;
+            this._verticesDirty = false;
             this._transformDirty = false;
             this._visible = true;
             this._blendMode = 0 /* Normal */;
             this._displayIndex = -1;
             this._animationDisplayIndex = -1;
             this._zOrder = 0;
+            this._zIndex = 0;
             this._cachedFrameIndex = -1;
             this._pivotX = 0.0;
             this._pivotY = 0.0;
             this._localMatrix.identity();
             this._colorTransform.identity();
-            this._displayList.length = 0;
-            this._displayDatas.length = 0;
+            this._displayFrames.length = 0;
+            this._geometryBones.length = 0;
             this._slotData = null; //
-            this._rawDisplayDatas = null;
-            this._displayData = null;
+            this._displayFrame = null;
+            this._geometryData = null;
             this._boundingBoxData = null;
             this._textureData = null;
-            this._deformVertices = null;
             this._rawDisplay = null;
             this._meshDisplay = null;
             this._display = null;
@@ -5663,73 +5655,60 @@ var dragonBones;
             this._parent = null; //
             this._cachedFrameIndices = null;
         };
+        Slot.prototype._hasDisplay = function (display) {
+            for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                var displayFrame = _a[_i];
+                if (displayFrame.display === display) {
+                    return true;
+                }
+            }
+            return false;
+        };
         /**
-         * - Support default skin data.
+         * @internal
          */
-        Slot.prototype._getDefaultRawDisplayData = function (displayIndex) {
-            var defaultSkin = this._armature._armatureData.defaultSkin;
-            if (defaultSkin !== null) {
-                var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name);
-                if (defaultRawDisplayDatas !== null) {
-                    return displayIndex < defaultRawDisplayDatas.length ? defaultRawDisplayDatas[displayIndex] : null;
+        Slot.prototype._isBonesUpdate = function () {
+            for (var _i = 0, _a = this._geometryBones; _i < _a.length; _i++) {
+                var bone = _a[_i];
+                if (bone !== null && bone._childrenTransformDirty) {
+                    return true;
                 }
             }
-            return null;
+            return false;
+        };
+        /**
+         * @internal
+         */
+        Slot.prototype._updateAlpha = function () {
+            var globalAlpha = this._alpha * this._parent._globalAlpha;
+            if (this._globalAlpha !== globalAlpha) {
+                this._globalAlpha = globalAlpha;
+                this._colorDirty = true;
+            }
         };
         Slot.prototype._updateDisplayData = function () {
-            var prevDisplayData = this._displayData;
-            var prevVerticesData = this._deformVertices !== null ? this._deformVertices.verticesData : null;
+            var prevDisplayFrame = this._displayFrame;
+            var prevGeometryData = this._geometryData;
             var prevTextureData = this._textureData;
             var rawDisplayData = null;
-            var currentVerticesData = null;
-            this._displayData = null;
+            var displayData = null;
+            this._displayFrame = null;
+            this._geometryData = null;
             this._boundingBoxData = null;
             this._textureData = null;
-            if (this._displayIndex >= 0) {
-                if (this._rawDisplayDatas !== null) {
-                    rawDisplayData = this._displayIndex < this._rawDisplayDatas.length ? this._rawDisplayDatas[this._displayIndex] : null;
-                }
-                if (rawDisplayData === null) {
-                    rawDisplayData = this._getDefaultRawDisplayData(this._displayIndex);
-                }
-                if (this._displayIndex < this._displayDatas.length) {
-                    this._displayData = this._displayDatas[this._displayIndex];
-                }
-            }
-            if (this._displayData !== null) {
-                if (this._displayData.type === 2 /* Mesh */) {
-                    currentVerticesData = this._displayData.vertices;
-                }
-                else if (this._displayData.type === 4 /* Path */) {
-                    currentVerticesData = this._displayData.vertices;
-                }
-                else if (rawDisplayData !== null) {
-                    if (rawDisplayData.type === 2 /* Mesh */) {
-                        currentVerticesData = rawDisplayData.vertices;
-                    }
-                    else if (rawDisplayData.type === 4 /* Path */) {
-                        currentVerticesData = rawDisplayData.vertices;
-                    }
-                }
-                if (this._displayData.type === 3 /* BoundingBox */) {
-                    this._boundingBoxData = this._displayData.boundingBox;
-                }
-                else if (rawDisplayData !== null) {
-                    if (rawDisplayData.type === 3 /* BoundingBox */) {
-                        this._boundingBoxData = rawDisplayData.boundingBox;
-                    }
-                }
-                if (this._displayData.type === 0 /* Image */) {
-                    this._textureData = this._displayData.texture;
-                }
-                else if (this._displayData.type === 2 /* Mesh */) {
-                    this._textureData = this._displayData.texture;
-                }
-            }
-            if (this._displayData !== prevDisplayData || currentVerticesData !== prevVerticesData || this._textureData !== prevTextureData) {
+            if (this._displayIndex >= 0 && this._displayIndex < this._displayFrames.length) {
+                this._displayFrame = this._displayFrames[this._displayIndex];
+                rawDisplayData = this._displayFrame.rawDisplayData;
+                displayData = this._displayFrame.displayData;
+                this._geometryData = this._displayFrame.getGeometryData();
+                this._boundingBoxData = this._displayFrame.getBoundingBox();
+                this._textureData = this._displayFrame.getTextureData();
+            }
+            if (this._displayFrame !== prevDisplayFrame ||
+                this._geometryData !== prevGeometryData || this._textureData !== prevTextureData) {
                 // Update pivot offset.
-                if (currentVerticesData === null && this._textureData !== null) {
-                    var imageDisplayData = this._displayData;
+                if (this._geometryData === null && this._textureData !== null) {
+                    var imageDisplayData = ((displayData !== null && displayData.type === 0 /* Image */) ? displayData : rawDisplayData); //
                     var scale = this._textureData.parent.scale * this._armature._armatureData.scale;
                     var frame = this._textureData.frame;
                     this._pivotX = imageDisplayData.pivot.x;
@@ -5748,13 +5727,13 @@ var dragonBones;
                         this._pivotY += frame.y * scale;
                     }
                     // Update replace pivot. TODO
-                    if (this._displayData !== null && rawDisplayData !== null && this._displayData !== rawDisplayData) {
+                    if (rawDisplayData !== null && imageDisplayData !== rawDisplayData) {
                         rawDisplayData.transform.toMatrix(Slot._helpMatrix);
                         Slot._helpMatrix.invert();
                         Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint);
                         this._pivotX -= Slot._helpPoint.x;
                         this._pivotY -= Slot._helpPoint.y;
-                        this._displayData.transform.toMatrix(Slot._helpMatrix);
+                        imageDisplayData.transform.toMatrix(Slot._helpMatrix);
                         Slot._helpMatrix.invert();
                         Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint);
                         this._pivotX += Slot._helpPoint.x;
@@ -5772,23 +5751,38 @@ var dragonBones;
                 if (rawDisplayData !== null) {
                     this.origin = rawDisplayData.transform;
                 }
-                else if (this._displayData !== null) {
-                    this.origin = this._displayData.transform;
+                else if (displayData !== null) {
+                    this.origin = displayData.transform;
                 }
                 else {
                     this.origin = null;
                 }
-                // Update vertices.
-                if (currentVerticesData !== prevVerticesData) {
-                    if (this._deformVertices === null) {
-                        this._deformVertices = dragonBones.BaseObject.borrowObject(dragonBones.DeformVertices);
-                    }
-                    this._deformVertices.init(currentVerticesData, this._armature);
+                // TODO remove slot offset.
+                if (this.origin !== null) {
+                    this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix);
                 }
-                else if (this._deformVertices !== null && this._textureData !== prevTextureData) {
-                    this._deformVertices.verticesDirty = true;
+                else {
+                    this.global.copyFrom(this.offset).toMatrix(this._localMatrix);
+                }
+                // Update geometry.
+                if (this._geometryData !== prevGeometryData) {
+                    this._geometryDirty = true;
+                    this._verticesDirty = true;
+                    if (this._geometryData !== null) {
+                        this._geometryBones.length = 0;
+                        if (this._geometryData.weight !== null) {
+                            for (var i = 0, l = this._geometryData.weight.bones.length; i < l; ++i) {
+                                var bone = this._armature.getBone(this._geometryData.weight.bones[i].name);
+                                this._geometryBones.push(bone);
+                            }
+                        }
+                    }
+                    else {
+                        this._geometryBones.length = 0;
+                        this._geometryData = null;
+                    }
                 }
-                this._displayDirty = true;
+                this._textureDirty = this._textureData !== prevTextureData;
                 this._transformDirty = true;
             }
         };
@@ -5796,8 +5790,8 @@ var dragonBones;
             var prevDisplay = this._display !== null ? this._display : this._rawDisplay;
             var prevChildArmature = this._childArmature;
             // Update display and child armature.
-            if (this._displayIndex >= 0 && this._displayIndex < this._displayList.length) {
-                this._display = this._displayList[this._displayIndex];
+            if (this._displayFrame !== null) {
+                this._display = this._displayFrame.display;
                 if (this._display !== null && this._display instanceof dragonBones.Armature) {
                     this._childArmature = this._display;
                     this._display = this._childArmature.display;
@@ -5813,16 +5807,14 @@ var dragonBones;
             // Update display.
             var currentDisplay = this._display !== null ? this._display : this._rawDisplay;
             if (currentDisplay !== prevDisplay) {
-                this._onUpdateDisplay();
-                this._replaceDisplay(prevDisplay);
-                this._transformDirty = true;
+                this._textureDirty = true;
                 this._visibleDirty = true;
                 this._blendModeDirty = true;
+                // this._zOrderDirty = true;
                 this._colorDirty = true;
-            }
-            // Update frame.
-            if (currentDisplay === this._rawDisplay || currentDisplay === this._meshDisplay) {
-                this._updateFrame();
+                this._transformDirty = true;
+                this._onUpdateDisplay();
+                this._replaceDisplay(prevDisplay);
             }
             // Update child armature.
             if (this._childArmature !== prevChildArmature) {
@@ -5844,31 +5836,25 @@ var dragonBones;
                             }
                         }
                         // Child armature action.
-                        var actions = null;
-                        if (this._displayData !== null && this._displayData.type === 1 /* Armature */) {
-                            actions = this._displayData.actions;
-                        }
-                        else if (this._displayIndex >= 0 && this._rawDisplayDatas !== null) {
-                            var rawDisplayData = this._displayIndex < this._rawDisplayDatas.length ? this._rawDisplayDatas[this._displayIndex] : null;
-                            if (rawDisplayData === null) {
-                                rawDisplayData = this._getDefaultRawDisplayData(this._displayIndex);
+                        if (this._displayFrame !== null) {
+                            var actions = null;
+                            var displayData = this._displayFrame.displayData !== null ? this._displayFrame.displayData : this._displayFrame.rawDisplayData;
+                            if (displayData !== null && displayData.type === 1 /* Armature */) {
+                                actions = displayData.actions;
                             }
-                            if (rawDisplayData !== null && rawDisplayData.type === 1 /* Armature */) {
-                                actions = rawDisplayData.actions;
+                            if (actions !== null && actions.length > 0) {
+                                for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
+                                    var action = actions_1[_i];
+                                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                                    dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature);
+                                    eventObject.slot = this;
+                                    this._armature._bufferAction(eventObject, false);
+                                }
                             }
-                        }
-                        if (actions !== null && actions.length > 0) {
-                            for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
-                                var action = actions_1[_i];
-                                var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                                dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature);
-                                eventObject.slot = this;
-                                this._armature._bufferAction(eventObject, false);
+                            else {
+                                this._childArmature.animation.play();
                             }
                         }
-                        else {
-                            this._childArmature.animation.play();
-                        }
                     }
                 }
             }
@@ -5891,24 +5877,23 @@ var dragonBones;
             if (isAnimation === void 0) { isAnimation = false; }
             if (isAnimation) {
                 if (this._animationDisplayIndex === value) {
-                    return false;
+                    return;
                 }
                 this._animationDisplayIndex = value;
             }
             if (this._displayIndex === value) {
-                return false;
+                return;
             }
-            this._displayIndex = value;
-            this._displayDirty = true;
-            this._updateDisplayData();
-            return this._displayDirty;
+            this._displayIndex = value < this._displayFrames.length ? value : this._displayFrames.length - 1;
+            this._displayDataDirty = true;
+            this._displayDirty = this._displayIndex < 0 || this._display !== this._displayFrames[this._displayIndex].display;
         };
         /**
          * @internal
          */
-        Slot.prototype._setZorder = function (value) {
+        Slot.prototype._setZOrder = function (value) {
             if (this._zOrder === value) {
-                //return false;
+                // return false;
             }
             this._zOrder = value;
             this._zOrderDirty = true;
@@ -5919,37 +5904,7 @@ var dragonBones;
          */
         Slot.prototype._setColor = function (value) {
             this._colorTransform.copyFrom(value);
-            this._colorDirty = true;
-            return this._colorDirty;
-        };
-        /**
-         * @internal
-         */
-        Slot.prototype._setDisplayList = function (value) {
-            if (value !== null && value.length > 0) {
-                if (this._displayList.length !== value.length) {
-                    this._displayList.length = value.length;
-                }
-                for (var i = 0, l = value.length; i < l; ++i) {
-                    var eachDisplay = value[i];
-                    if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                        !(eachDisplay instanceof dragonBones.Armature) && this._displayList.indexOf(eachDisplay) < 0) {
-                        this._initDisplay(eachDisplay, true);
-                    }
-                    this._displayList[i] = eachDisplay;
-                }
-            }
-            else if (this._displayList.length > 0) {
-                this._displayList.length = 0;
-            }
-            if (this._displayIndex >= 0 && this._displayIndex < this._displayList.length) {
-                this._displayDirty = this._display !== this._displayList[this._displayIndex];
-            }
-            else {
-                this._displayDirty = this._display !== null;
-            }
-            this._updateDisplayData();
-            return this._displayDirty;
+            return this._colorDirty = true;
         };
         /**
          * @internal
@@ -5959,18 +5914,17 @@ var dragonBones;
                 return;
             }
             this._slotData = slotData;
-            //
-            this._visibleDirty = true;
-            this._blendModeDirty = true;
-            this._colorDirty = true;
+            this._colorDirty = true; //
+            this._blendModeDirty = true; //
             this._blendMode = this._slotData.blendMode;
             this._zOrder = this._slotData.zOrder;
+            this._zIndex = this._slotData.zIndex;
+            this._alpha = this._slotData.alpha;
             this._colorTransform.copyFrom(this._slotData.color);
             this._rawDisplay = rawDisplay;
             this._meshDisplay = meshDisplay;
             //
             this._armature = armatureValue;
-            //
             var slotParent = this._armature.getBone(this._slotData.parent.name);
             if (slotParent !== null) {
                 this._parent = slotParent;
@@ -5991,22 +5945,52 @@ var dragonBones;
          * @internal
          */
         Slot.prototype.update = function (cacheFrameIndex) {
+            if (this._displayDataDirty) {
+                this._updateDisplayData();
+                this._displayDataDirty = false;
+            }
             if (this._displayDirty) {
-                this._displayDirty = false;
                 this._updateDisplay();
-                // TODO remove slot offset.
-                if (this._transformDirty) {
-                    if (this.origin !== null) {
-                        this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix);
-                    }
-                    else {
-                        this.global.copyFrom(this.offset).toMatrix(this._localMatrix);
-                    }
+                this._displayDirty = false;
+            }
+            if (this._geometryDirty || this._textureDirty) {
+                if (this._display === null || this._display === this._rawDisplay || this._display === this._meshDisplay) {
+                    this._updateFrame();
                 }
+                this._geometryDirty = false;
+                this._textureDirty = false;
+            }
+            if (this._display === null) {
+                return;
+            }
+            if (this._visibleDirty) {
+                this._updateVisible();
+                this._visibleDirty = false;
+            }
+            if (this._blendModeDirty) {
+                this._updateBlendMode();
+                this._blendModeDirty = false;
+            }
+            if (this._colorDirty) {
+                this._updateColor();
+                this._colorDirty = false;
             }
             if (this._zOrderDirty) {
-                this._zOrderDirty = false;
                 this._updateZOrder();
+                this._zOrderDirty = false;
+            }
+            if (this._geometryData !== null && this._display === this._meshDisplay) {
+                var isSkinned = this._geometryData.weight !== null;
+                var isSurface = this._parent._boneData.type !== 0 /* Bone */;
+                if (this._verticesDirty ||
+                    (isSkinned && this._isBonesUpdate()) ||
+                    (isSurface && this._parent._childrenTransformDirty)) {
+                    this._updateMesh();
+                    this._verticesDirty = false;
+                }
+                if (isSkinned || isSurface) {
+                    return;
+                }
             }
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
@@ -6035,36 +6019,7 @@ var dragonBones;
                 this._transformDirty = true;
                 this._cachedFrameIndex = -1;
             }
-            if (this._display === null) {
-                return;
-            }
-            if (this._visibleDirty) {
-                this._visibleDirty = false;
-                this._updateVisible();
-            }
-            if (this._blendModeDirty) {
-                this._blendModeDirty = false;
-                this._updateBlendMode();
-            }
-            if (this._colorDirty) {
-                this._colorDirty = false;
-                this._updateColor();
-            }
-            if (this._deformVertices !== null && this._deformVertices.verticesData !== null && this._display === this._meshDisplay) {
-                var isSkinned = this._deformVertices.verticesData.weight !== null;
-                var isSurface = this._parent._boneData.type !== 0 /* Bone */;
-                if (this._deformVertices.verticesDirty ||
-                    (isSkinned && this._deformVertices.isBonesUpdate()) ||
-                    (isSurface && this._parent._childrenTransformDirty)) {
-                    this._deformVertices.verticesDirty = false;
-                    this._updateMesh();
-                }
-                if (isSkinned || isSurface) {
-                    return;
-                }
-            }
             if (this._transformDirty) {
-                this._transformDirty = false;
                 if (this._cachedFrameIndex < 0) {
                     var isCache = cacheFrameIndex >= 0;
                     this._updateGlobalTransformMatrix(isCache);
@@ -6076,64 +6031,161 @@ var dragonBones;
                     this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex);
                 }
                 this._updateTransform();
+                this._transformDirty = false;
             }
         };
+        /**
+         * - Forces the slot to update the state of the display object in the next frame.
+         * @version DragonBones 4.5
+         * @language en_US
+         */
+        /**
+         * - 强制插槽在下一帧更新显示对象的状态。
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        Slot.prototype.invalidUpdate = function () {
+            this._displayDataDirty = true;
+            this._displayDirty = true;
+            //
+            this._transformDirty = true;
+        };
         /**
          * @private
          */
         Slot.prototype.updateTransformAndMatrix = function () {
             if (this._transformDirty) {
-                this._transformDirty = false;
                 this._updateGlobalTransformMatrix(false);
+                this._transformDirty = false;
             }
         };
         /**
          * @private
          */
-        Slot.prototype.replaceDisplayData = function (value, displayIndex) {
-            if (displayIndex === void 0) { displayIndex = -1; }
-            if (displayIndex < 0) {
-                if (this._displayIndex < 0) {
-                    displayIndex = 0;
-                }
-                else {
-                    displayIndex = this._displayIndex;
-                }
+        Slot.prototype.replaceRawDisplayData = function (displayData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
             }
-            if (this._displayDatas.length <= displayIndex) {
-                this._displayDatas.length = displayIndex + 1;
-                for (var i = 0, l = this._displayDatas.length; i < l; ++i) {
-                    if (!this._displayDatas[i]) {
-                        this._displayDatas[i] = null;
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.rawDisplayData !== displayData) {
+                displayFrame.deformVertices.length = 0;
+                displayFrame.rawDisplayData = displayData;
+                if (displayFrame.rawDisplayData === null) {
+                    var defaultSkin = this._armature._armatureData.defaultSkin;
+                    if (defaultSkin !== null) {
+                        var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name);
+                        if (defaultRawDisplayDatas !== null && index < defaultRawDisplayDatas.length) {
+                            displayFrame.rawDisplayData = defaultRawDisplayDatas[index];
+                        }
                     }
                 }
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
             }
-            this._displayDatas[displayIndex] = value;
         };
         /**
-         * - Check whether a specific point is inside a custom bounding box in the slot.
-         * The coordinate system of the point is the inner coordinate system of the armature.
-         * Custom bounding boxes need to be customized in Dragonbones Pro.
-         * @param x - The horizontal coordinate of the point.
-         * @param y - The vertical coordinate of the point.
-         * @version DragonBones 5.0
-         * @language en_US
+         * @private
          */
+        Slot.prototype.replaceDisplayData = function (displayData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.displayData !== displayData && displayFrame.rawDisplayData !== displayData) {
+                displayFrame.displayData = displayData;
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
+            }
+        };
         /**
-         * - 检查特定点是否在插槽的自定义边界框内。
-         * 点的坐标系为骨架内坐标系。
-         * 自定义边界框需要在 DragonBones Pro 中自定义。
-         * @param x - 点的水平坐标。
-         * @param y - 点的垂直坐标。
-         * @version DragonBones 5.0
-         * @language zh_CN
+         * @private
          */
-        Slot.prototype.containsPoint = function (x, y) {
-            if (this._boundingBoxData === null) {
-                return false;
+        Slot.prototype.replaceTextureData = function (textureData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
             }
-            this.updateTransformAndMatrix();
-            Slot._helpMatrix.copyFrom(this.globalTransformMatrix);
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.textureData !== textureData) {
+                displayFrame.textureData = textureData;
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
+            }
+        };
+        /**
+         * @private
+         */
+        Slot.prototype.replaceDisplay = function (value, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.display !== value) {
+                var prevDisplay = displayFrame.display;
+                displayFrame.display = value;
+                if (prevDisplay !== null &&
+                    prevDisplay !== this._rawDisplay && prevDisplay !== this._meshDisplay &&
+                    !this._hasDisplay(prevDisplay)) {
+                    if (prevDisplay instanceof dragonBones.Armature) {
+                        // (eachDisplay as Armature).dispose();
+                    }
+                    else {
+                        this._disposeDisplay(prevDisplay, true);
+                    }
+                }
+                if (value !== null &&
+                    value !== this._rawDisplay && value !== this._meshDisplay &&
+                    !this._hasDisplay(prevDisplay) &&
+                    !(value instanceof dragonBones.Armature)) {
+                    this._initDisplay(value, true);
+                }
+                if (index === this._displayIndex) {
+                    this._displayDirty = true;
+                }
+            }
+        };
+        /**
+         * - Check whether a specific point is inside a custom bounding box in the slot.
+         * The coordinate system of the point is the inner coordinate system of the armature.
+         * Custom bounding boxes need to be customized in Dragonbones Pro.
+         * @param x - The horizontal coordinate of the point.
+         * @param y - The vertical coordinate of the point.
+         * @version DragonBones 5.0
+         * @language en_US
+         */
+        /**
+         * - 检查特定点是否在插槽的自定义边界框内。
+         * 点的坐标系为骨架内坐标系。
+         * 自定义边界框需要在 DragonBones Pro 中自定义。
+         * @param x - 点的水平坐标。
+         * @param y - 点的垂直坐标。
+         * @version DragonBones 5.0
+         * @language zh_CN
+         */
+        Slot.prototype.containsPoint = function (x, y) {
+            if (this._boundingBoxData === null) {
+                return false;
+            }
+            this.updateTransformAndMatrix();
+            Slot._helpMatrix.copyFrom(this.globalTransformMatrix);
             Slot._helpMatrix.invert();
             Slot._helpMatrix.transformPoint(x, y, Slot._helpPoint);
             return this._boundingBoxData.containsPoint(Slot._helpPoint.x, Slot._helpPoint.y);
@@ -6216,18 +6268,10 @@ var dragonBones;
             return intersectionCount;
         };
         /**
-         * - Forces the slot to update the state of the display object in the next frame.
-         * @version DragonBones 4.5
-         * @language en_US
-         */
-        /**
-         * - 强制插槽在下一帧更新显示对象的状态。
-         * @version DragonBones 4.5
-         * @language zh_CN
+         * @private
          */
-        Slot.prototype.invalidUpdate = function () {
-            this._displayDirty = true;
-            this._transformDirty = true;
+        Slot.prototype.getDisplayFrameAt = function (index) {
+            return this._displayFrames[index];
         };
         Object.defineProperty(Slot.prototype, "visible", {
             /**
@@ -6255,6 +6299,32 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Slot.prototype, "displayFrameCount", {
+            /**
+             * @private
+             */
+            get: function () {
+                return this._displayFrames.length;
+            },
+            set: function (value) {
+                var prevCount = this._displayFrames.length;
+                if (prevCount < value) {
+                    this._displayFrames.length = value;
+                    for (var i = prevCount; i < value; ++i) {
+                        this._displayFrames[i] = dragonBones.BaseObject.borrowObject(DisplayFrame);
+                    }
+                }
+                else if (prevCount > value) {
+                    for (var i = prevCount - 1; i < value; --i) {
+                        this.replaceDisplay(null, i);
+                        this._displayFrames[i].returnToPool();
+                    }
+                    this._displayFrames.length = value;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(Slot.prototype, "displayIndex", {
             /**
              * - The index of the display object displayed in the display list.
@@ -6282,9 +6352,8 @@ var dragonBones;
                 return this._displayIndex;
             },
             set: function (value) {
-                if (this._setDisplayIndex(value)) {
-                    this.update(-1);
-                }
+                this._setDisplayIndex(value);
+                this.update(-1);
             },
             enumerable: true,
             configurable: true
@@ -6320,31 +6389,19 @@ var dragonBones;
              * @language zh_CN
              */
             get: function () {
-                return this._displayList.concat();
+                var displays = new Array();
+                for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                    var displayFrame = _a[_i];
+                    displays.push(displayFrame.display);
+                }
+                return displays;
             },
             set: function (value) {
-                var backupDisplayList = this._displayList.concat(); // Copy.
-                var disposeDisplayList = new Array();
-                if (this._setDisplayList(value)) {
-                    this.update(-1);
-                }
-                // Release replaced displays.
-                for (var _i = 0, backupDisplayList_1 = backupDisplayList; _i < backupDisplayList_1.length; _i++) {
-                    var eachDisplay = backupDisplayList_1[_i];
-                    if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                        this._displayList.indexOf(eachDisplay) < 0 &&
-                        disposeDisplayList.indexOf(eachDisplay) < 0) {
-                        disposeDisplayList.push(eachDisplay);
-                    }
-                }
-                for (var _a = 0, disposeDisplayList_2 = disposeDisplayList; _a < disposeDisplayList_2.length; _a++) {
-                    var eachDisplay = disposeDisplayList_2[_a];
-                    if (eachDisplay instanceof dragonBones.Armature) {
-                        // (eachDisplay as Armature).dispose();
-                    }
-                    else {
-                        this._disposeDisplay(eachDisplay, true);
-                    }
+                this.displayFrameCount = value.length;
+                var index = 0;
+                for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {
+                    var eachDisplay = value_1[_i];
+                    this.replaceDisplay(eachDisplay, index++);
                 }
             },
             enumerable: true,
@@ -6369,46 +6426,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Slot.prototype, "rawDisplayDatas", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this._rawDisplayDatas;
-            },
-            set: function (value) {
-                if (this._rawDisplayDatas === value) {
-                    return;
-                }
-                this._displayDirty = true;
-                this._rawDisplayDatas = value;
-                if (this._rawDisplayDatas !== null) {
-                    this._displayDatas.length = this._rawDisplayDatas.length;
-                    for (var i = 0, l = this._displayDatas.length; i < l; ++i) {
-                        var rawDisplayData = this._rawDisplayDatas[i];
-                        if (rawDisplayData === null) {
-                            rawDisplayData = this._getDefaultRawDisplayData(i);
-                        }
-                        this._displayDatas[i] = rawDisplayData;
-                    }
-                }
-                else {
-                    this._displayDatas.length = 0;
-                }
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Slot.prototype, "displayData", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this._displayData;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(Slot.prototype, "boundingBoxData", {
             /**
              * - The custom bounding box data for the slot at current time.
@@ -6474,21 +6491,11 @@ var dragonBones;
                 if (this._display === value) {
                     return;
                 }
-                var displayListLength = this._displayList.length;
-                if (this._displayIndex < 0 && displayListLength === 0) {
+                if (this._displayFrames.length === 0) {
+                    this.displayFrameCount = 1;
                     this._displayIndex = 0;
                 }
-                if (this._displayIndex < 0) {
-                    return;
-                }
-                else {
-                    var replaceDisplayList = this.displayList; // Copy.
-                    if (displayListLength <= this._displayIndex) {
-                        replaceDisplayList.length = this._displayIndex + 1;
-                    }
-                    replaceDisplayList[this._displayIndex] = value;
-                    this.displayList = replaceDisplayList;
-                }
+                this.replaceDisplay(value, this._displayIndex);
             },
             enumerable: true,
             configurable: true
@@ -6499,9 +6506,9 @@ var dragonBones;
              * @example
              * 
              *     let slot = armature.getSlot("weapon");
-             * let prevChildArmature = slot.childArmature;
-             * if (prevChildArmature) {
-             * prevChildArmature.dispose();
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
              *     }
              *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
              * 
@@ -6514,9 +6521,9 @@ var dragonBones; * @example *
              *     let slot = armature.getSlot("weapon");
-             * let prevChildArmature = slot.childArmature;
-             * if (prevChildArmature) {
-             * prevChildArmature.dispose();
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
              *     }
              *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
              * 
@@ -6811,8 +6818,8 @@ var dragonBones; var intArray = dragonBonesData.intArray; var floatArray = dragonBonesData.floatArray; var pathOffset = verticesData.offset; - var pathVertexCount = intArray[pathOffset + 0 /* PathVertexCount */]; - var pathVertexOffset = intArray[pathOffset + 2 /* PathFloatOffset */]; + var pathVertexCount = intArray[pathOffset + 0 /* GeometryVertexCount */]; + var pathVertexOffset = intArray[pathOffset + 2 /* GeometryFloatOffset */]; this._pathGlobalVertices.length = pathVertexCount * 2; var weightData = verticesData.weight; //没有骨骼约束我,那节点只受自己的Bone控制 @@ -6832,7 +6839,7 @@ var dragonBones; return; } //有骨骼约束我,那我的节点受骨骼权重控制 - var bones = this._pathSlot._deformVertices.bones; + var bones = this._pathSlot._geometryBones; var weightBoneCount = weightData.bones.length; var weightOffset = weightData.offset; var floatOffset = intArray[weightOffset + 1 /* WeigthFloatOffset */]; @@ -6870,7 +6877,7 @@ var dragonBones; //计算当前的骨骼在曲线上的位置 var armature = this._armature; var intArray = armature.armatureData.parent.intArray; - var vertexCount = intArray[pathDisplayDta.vertices.offset + 0 /* PathVertexCount */]; + var vertexCount = intArray[pathDisplayDta.geometry.offset + 0 /* GeometryVertexCount */]; var positions = this._positions; var spaces = this._spaces; var isClosed = pathDisplayDta.closed; @@ -7127,7 +7134,7 @@ var dragonBones; this._constraintData = constraintData; this._armature = armature; var data = constraintData; - this.pathOffset = data.pathDisplayData.vertices.offset; + this.pathOffset = data.pathDisplayData.geometry.offset; // this.position = data.position; this.spacing = data.spacing; @@ -7151,24 +7158,21 @@ var dragonBones; }; PathConstraint.prototype.update = function () { var pathSlot = this._pathSlot; - if (pathSlot._deformVertices === null || - pathSlot._deformVertices.verticesData === null || - pathSlot._deformVertices.verticesData.offset !== this.pathOffset) { + if (pathSlot._geometryData === null || + pathSlot._geometryData.offset !== this.pathOffset) { return; } var constraintData = this._constraintData; - var pathDisplayData = pathSlot._displayData; // TODO // //曲线节点数据改变:父亲bone改变,权重bones改变,变形顶点改变 var isPathVerticeDirty = false; - var deformVertices = pathSlot._deformVertices; if (this._root._childrenTransformDirty) { - this._updatePathVertices(pathDisplayData.vertices); + this._updatePathVertices(pathSlot._geometryData); isPathVerticeDirty = true; } - else if (deformVertices !== null && (deformVertices.verticesDirty || deformVertices.isBonesUpdate())) { - this._updatePathVertices(pathDisplayData.vertices); - deformVertices.verticesDirty = false; + else if (pathSlot._verticesDirty || pathSlot._isBonesUpdate()) { + this._updatePathVertices(pathSlot._geometryData); + pathSlot._verticesDirty = false; isPathVerticeDirty = true; } if (!isPathVerticeDirty && !this.dirty) { @@ -7211,7 +7215,7 @@ var dragonBones; } } // - this._computeBezierCurve(pathDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); + this._computeBezierCurve(pathSlot._displayFrame.rawDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); //根据新的节点数据重新采样 var positions = this._positions; var rotateOffset = this.rotateOffset; @@ -7313,94 +7317,6 @@ var dragonBones; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ var dragonBones; -(function (dragonBones) { - /** - * @internal - */ - var DeformVertices = /** @class */ (function (_super) { - __extends(DeformVertices, _super); - function DeformVertices() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.vertices = []; - _this.bones = []; - return _this; - } - DeformVertices.toString = function () { - return "[class dragonBones.DeformVertices]"; - }; - DeformVertices.prototype._onClear = function () { - this.verticesDirty = false; - this.vertices.length = 0; - this.bones.length = 0; - this.verticesData = null; - }; - DeformVertices.prototype.init = function (verticesDataValue, armature) { - this.verticesData = verticesDataValue; - if (this.verticesData !== null) { - var vertexCount = 0; - if (this.verticesData.weight !== null) { - vertexCount = this.verticesData.weight.count * 2; - } - else { - vertexCount = this.verticesData.data.intArray[this.verticesData.offset + 0 /* MeshVertexCount */] * 2; - } - this.verticesDirty = true; - this.vertices.length = vertexCount; - this.bones.length = 0; - // - for (var i = 0, l = this.vertices.length; i < l; ++i) { - this.vertices[i] = 0.0; - } - if (this.verticesData.weight !== null) { - for (var i = 0, l = this.verticesData.weight.bones.length; i < l; ++i) { - var bone = armature.getBone(this.verticesData.weight.bones[i].name); - this.bones.push(bone); - } - } - } - else { - this.verticesDirty = false; - this.vertices.length = 0; - this.bones.length = 0; - this.verticesData = null; - } - }; - DeformVertices.prototype.isBonesUpdate = function () { - for (var _i = 0, _a = this.bones; _i < _a.length; _i++) { - var bone = _a[_i]; - if (bone !== null && bone._childrenTransformDirty) { - return true; - } - } - return false; - }; - return DeformVertices; - }(dragonBones.BaseObject)); - dragonBones.DeformVertices = DeformVertices; -})(dragonBones || (dragonBones = {})); -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -var dragonBones; (function (dragonBones) { /** * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. @@ -7623,17 +7539,6 @@ var dragonBones; enumerable: true, configurable: true }); - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#clock}。 - * @deprecated - * @language zh_CN - */ - WorldClock.clock = new WorldClock(); return WorldClock; }()); dragonBones.WorldClock = WorldClock; @@ -7683,6 +7588,7 @@ var dragonBones; _this._animationNames = []; _this._animationStates = []; _this._animations = {}; + _this._blendStates = {}; _this._animationConfig = null; // Initial value. return _this; } @@ -7697,11 +7603,17 @@ var dragonBones; for (var k in this._animations) { delete this._animations[k]; } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].returnToPool(); + } + delete this._blendStates[k]; + } if (this._animationConfig !== null) { this._animationConfig.returnToPool(); } this.timeScale = 1.0; - this._lockUpdate = false; this._animationDirty = false; this._inheritTimeScale = 1.0; this._animationNames.length = 0; @@ -7756,8 +7668,7 @@ var dragonBones; animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); } break; - case 0 /* None */: - case 5 /* Single */: + case 5 /* Single */: // TODO default: break; } @@ -7788,6 +7699,12 @@ var dragonBones; if (this._inheritTimeScale !== 1.0) { passedTime *= this._inheritTimeScale; } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].reset(); + } + } var animationStateCount = this._animationStates.length; if (animationStateCount === 1) { var animationState = this._animationStates[0]; @@ -7797,7 +7714,7 @@ var dragonBones; this._lastAnimationState = null; } else { - var animationData = animationState._animationData; + var animationData = animationState.animationData; var cacheFrameRate = animationData.cacheFrameRate; if (this._animationDirty && cacheFrameRate > 0.0) { this._animationDirty = false; @@ -7807,14 +7724,12 @@ var dragonBones; } for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { var slot = _c[_b]; - var rawDisplayDatas = slot.rawDisplayDatas; - if (rawDisplayDatas !== null && rawDisplayDatas.length > 0) { - var rawDsplayData = rawDisplayDatas[0]; - if (rawDsplayData !== null) { - if (rawDsplayData.parent === this._armature.armatureData.defaultSkin) { - slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); - continue; - } + if (slot.displayFrameCount > 0) { + var rawDisplayData = slot.getDisplayFrameAt(0).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.parent === this._armature.armatureData.defaultSkin) { + slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); + continue; } } slot._cachedFrameIndices = null; @@ -7934,7 +7849,9 @@ var dragonBones; if (animationConfig.fadeOutMode === 5 /* Single */) { for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { var animationState_1 = _a[_i]; - if (animationState_1._animationData === animationData) { + if (animationState_1._fadeState < 1 && + animationState_1.layer === animationConfig.layer && + animationState_1.animationData === animationData) { return animationState_1; } } @@ -7951,7 +7868,7 @@ var dragonBones; if (animationConfig.timeScale <= -100.0) { animationConfig.timeScale = 1.0 / animationData.scale; } - if (animationData.frameCount > 1) { + if (animationData.frameCount > 0) { if (animationConfig.position < 0.0) { animationConfig.position %= animationData.duration; animationConfig.position = animationData.duration - animationConfig.position; @@ -7980,6 +7897,7 @@ var dragonBones; animationConfig.duration = -1.0; } this._fadeOut(animationConfig); + // var animationState = dragonBones.BaseObject.borrowObject(dragonBones.AnimationState); animationState.init(this._armature, animationData, animationConfig); this._animationDirty = true; @@ -8005,7 +7923,6 @@ var dragonBones; else { this._animationStates.push(animationState); } - // Child armature play same name animation. for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { var slot = _c[_b]; var childArmature = slot.childArmature; @@ -8015,28 +7932,28 @@ var dragonBones; childArmature.animation.fadeIn(animationName); // } } - var isLocked = false; for (var k in animationData.animationTimelines) { - if (!this._lockUpdate) { - isLocked = true; - this._lockUpdate = true; - } - var childAnimatiionState = this.fadeIn(k, animationConfig.fadeInTime, 1, animationState.layer, null, 0 /* None */); - if (childAnimatiionState !== null) { - childAnimatiionState.resetToPose = false; - childAnimatiionState._parent = animationState; - childAnimatiionState.stop(); + var childAnimationState = this.fadeIn(k, 0.0, 1, animationState.layer, "", 5 /* Single */); + if (childAnimationState === null) { + continue; } - } - if (isLocked) { - this._lockUpdate = false; - } - if (!this._lockUpdate) { - if (animationConfig.fadeInTime <= 0.0) { - this._armature.advanceTime(0.0); + var timelines = animationData.animationTimelines[k]; + childAnimationState.actionEnabled = false; + childAnimationState.resetToPose = false; + childAnimationState.stop(); + animationState.addState(childAnimationState, timelines); + // + var index = this._animationStates.indexOf(animationState); + var childIndex = this._animationStates.indexOf(childAnimationState); + if (childIndex < index) { + this._animationStates.splice(index, 1); + this._animationStates.splice(childIndex, 0, animationState); } - this._lastAnimationState = animationState; } + // if (!this._armature._lockUpdate && animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. + // this._armature.advanceTime(0.0); + // } + this._lastAnimationState = animationState; return animationState; }; /** @@ -8196,7 +8113,7 @@ var dragonBones; this._animationConfig.animation = animationName; var animationData = animationName in this._animations ? this._animations[animationName] : null; if (animationData !== null) { - this._animationConfig.position = animationData.duration * frame / animationData.frameCount; + this._animationConfig.position = animationData.frameCount > 0 ? animationData.duration * frame / animationData.frameCount : 0.0; } return this.playConfig(this._animationConfig); }; @@ -8304,9 +8221,24 @@ var dragonBones; } return animationState; }; + /** + * @internal + */ + Animation.prototype.getBlendState = function (type, name, target) { + if (!(type in this._blendStates)) { + this._blendStates[type] = {}; + } + var blendStates = this._blendStates[type]; + if (!(name in blendStates)) { + var blendState = blendStates[name] = dragonBones.BaseObject.borrowObject(dragonBones.BlendState); + blendState.target = target; + } + return blendStates[name]; + }; /** * - Get a specific animation state. * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) * @example *
          *     armature.animation.play("walk");
@@ -8317,8 +8249,9 @@ var dragonBones;
          * @language en_US
          */
         /**
-         * - 获取指定的动画状态
+         * - 获取指定的动画状态。
          * @param animationName - 动画状态名称。
+         * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1)
          * @example
          * 
          *     armature.animation.play("walk");
@@ -8328,11 +8261,12 @@ var dragonBones;
          * @version DragonBones 3.0
          * @language zh_CN
          */
-        Animation.prototype.getState = function (animationName) {
+        Animation.prototype.getState = function (animationName, layer) {
+            if (layer === void 0) { layer = -1; }
             var i = this._animationStates.length;
             while (i--) {
                 var animationState = this._animationStates[i];
-                if (animationState.name === animationName) {
+                if (animationState.name === animationName && (layer < 0 || animationState.layer === layer)) {
                     return animationState;
                 }
             }
@@ -8523,99 +8457,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link #play()} {@link #fadeIn()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #play()} {@link #fadeIn()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Animation.prototype.gotoAndPlay = function (animationName, fadeInTime, duration, playTimes, layer, group, fadeOutMode, pauseFadeOut, pauseFadeIn) {
-            if (fadeInTime === void 0) { fadeInTime = -1; }
-            if (duration === void 0) { duration = -1; }
-            if (playTimes === void 0) { playTimes = -1; }
-            if (layer === void 0) { layer = 0; }
-            if (group === void 0) { group = null; }
-            if (fadeOutMode === void 0) { fadeOutMode = 3 /* SameLayerAndGroup */; }
-            if (pauseFadeOut === void 0) { pauseFadeOut = true; }
-            if (pauseFadeIn === void 0) { pauseFadeIn = true; }
-            console.warn("Deprecated.");
-            // tslint:disable-next-line:no-unused-expression
-            pauseFadeOut;
-            // tslint:disable-next-line:no-unused-expression
-            pauseFadeIn;
-            this._animationConfig.clear();
-            this._animationConfig.resetToPose = true;
-            this._animationConfig.fadeOutMode = fadeOutMode;
-            this._animationConfig.playTimes = playTimes;
-            this._animationConfig.layer = layer;
-            this._animationConfig.fadeInTime = fadeInTime;
-            this._animationConfig.animation = animationName;
-            this._animationConfig.group = group !== null ? group : "";
-            var animationData = this._animations[animationName];
-            if (animationData && duration > 0.0) {
-                this._animationConfig.timeScale = animationData.duration / duration;
-            }
-            return this.playConfig(this._animationConfig);
-        };
-        /**
-         * - Deprecated, please refer to {@link #gotoAndStopByTime()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #gotoAndStopByTime()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Animation.prototype.gotoAndStop = function (animationName, time) {
-            if (time === void 0) { time = 0; }
-            console.warn("Deprecated.");
-            return this.gotoAndStopByTime(animationName, time);
-        };
-        Object.defineProperty(Animation.prototype, "animationList", {
-            /**
-             * - Deprecated, please refer to {@link #animationNames}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #animationNames}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                return this._animationNames;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Animation.prototype, "animationDataList", {
-            /**
-             * - Deprecated, please refer to {@link #animationNames}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #animationNames}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                var list = [];
-                for (var i = 0, l = this._animationNames.length; i < l; ++i) {
-                    list.push(this._animations[this._animationNames[i]]);
-                }
-                return list;
-            },
-            enumerable: true,
-            configurable: true
-        });
         return Animation;
     }(dragonBones.BaseObject));
     dragonBones.Animation = Animation;
@@ -8662,27 +8503,19 @@ var dragonBones;
         __extends(AnimationState, _super);
         function AnimationState() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            /**
-             * @internal
-             */
-            _this._blendState = new BlendState();
             _this._boneMask = [];
             _this._boneTimelines = [];
-            _this._surfaceTimelines = [];
+            _this._boneBlendTimelines = [];
             _this._slotTimelines = [];
+            _this._slotBlendTimelines = [];
             _this._constraintTimelines = [];
             _this._animationTimelines = [];
             _this._poseTimelines = [];
-            _this._bonePoses = {};
             /**
              * @internal
              */
             _this._actionTimeline = null; // Initial value.
             _this._zOrderTimeline = null; // Initial value.
-            /**
-             * @internal
-             */
-            _this._parent = null; // Initial value.
             return _this;
         }
         AnimationState.toString = function () {
@@ -8693,7 +8526,7 @@ var dragonBones;
                 var timeline = _a[_i];
                 timeline.returnToPool();
             }
-            for (var _b = 0, _c = this._surfaceTimelines; _b < _c.length; _b++) {
+            for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
                 var timeline = _c[_b];
                 timeline.returnToPool();
             }
@@ -8701,18 +8534,24 @@ var dragonBones;
                 var timeline = _e[_d];
                 timeline.returnToPool();
             }
-            for (var _f = 0, _g = this._constraintTimelines; _f < _g.length; _f++) {
+            for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) {
                 var timeline = _g[_f];
                 timeline.returnToPool();
             }
-            for (var _h = 0, _j = this._animationTimelines; _h < _j.length; _h++) {
+            for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) {
                 var timeline = _j[_h];
                 timeline.returnToPool();
             }
-            for (var k in this._bonePoses) {
-                this._bonePoses[k].returnToPool();
-                delete this._bonePoses[k];
-            }
+            for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) {
+                var timeline = _l[_k];
+                var animationState = timeline.target;
+                if (animationState._parent === this) {
+                    animationState._fadeState = 1;
+                    animationState._subFadeState = 1;
+                    animationState._parent = null;
+                }
+                timeline.returnToPool();
+            }
             if (this._actionTimeline !== null) {
                 this._actionTimeline.returnToPool();
             }
@@ -8720,13 +8559,18 @@ var dragonBones;
                 this._zOrderTimeline.returnToPool();
             }
             this.actionEnabled = false;
-            this.additiveBlending = false;
+            this.additive = false;
             this.displayControl = false;
             this.resetToPose = false;
+            this.blendType = 0 /* None */;
             this.playTimes = 1;
             this.layer = 0;
             this.timeScale = 1.0;
-            this.weight = 1.0;
+            this._weight = 1.0;
+            this.parameterX = 0.0;
+            this.parameterY = 0.0;
+            this.positionX = 0.0;
+            this.positionY = 0.0;
             this.autoFadeOutTime = 0.0;
             this.fadeTotalTime = 0.0;
             this.name = "";
@@ -8741,11 +8585,11 @@ var dragonBones;
             this._time = 0.0;
             this._fadeProgress = 0.0;
             this._weightResult = 0.0;
-            this._blendState.clear();
             this._boneMask.length = 0;
             this._boneTimelines.length = 0;
-            this._surfaceTimelines.length = 0;
+            this._boneBlendTimelines.length = 0;
             this._slotTimelines.length = 0;
+            this._slotBlendTimelines.length = 0;
             this._constraintTimelines.length = 0;
             this._animationTimelines.length = 0;
             this._poseTimelines.length = 0;
@@ -8754,7 +8598,9 @@ var dragonBones;
             this._armature = null; //
             this._actionTimeline = null; //
             this._zOrderTimeline = null;
-            this._parent = null; //
+            this._activeChildA = null;
+            this._activeChildB = null;
+            this._parent = null;
         };
         AnimationState.prototype._updateTimelines = function () {
             {
@@ -8767,7 +8613,7 @@ var dragonBones;
                             switch (timelineData.type) {
                                 case 30 /* IKConstraint */: {
                                     var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState);
-                                    timeline.constraint = constraint;
+                                    timeline.target = constraint;
                                     timeline.init(this._armature, this, timelineData);
                                     this._constraintTimelines.push(timeline);
                                     break;
@@ -8779,53 +8625,37 @@ var dragonBones;
                     }
                     else if (this.resetToPose) {
                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState);
-                        timeline.constraint = constraint;
+                        timeline.target = constraint;
                         timeline.init(this._armature, this, null);
                         this._constraintTimelines.push(timeline);
                         this._poseTimelines.push(timeline);
                     }
                 }
             }
-            {
-                for (var _c = 0, _d = this._armature.animation.getStates(); _c < _d.length; _c++) {
-                    var animationState = _d[_c];
-                    if (animationState._parent !== this) {
-                        continue;
-                    }
-                    var timelineDatas = this._animationData.getAnimationTimelines(animationState.name);
-                    if (timelineDatas === null) {
-                        continue;
-                    }
-                    for (var _e = 0, timelineDatas_2 = timelineDatas; _e < timelineDatas_2.length; _e++) {
-                        var timelineData = timelineDatas_2[_e];
-                        switch (timelineData.type) {
-                            case 40 /* AnimationTime */: {
-                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineState);
-                                timeline.animationState = animationState;
-                                timeline.init(this._armature, this, timelineData);
-                                this._animationTimelines.push(timeline);
-                                break;
-                            }
-                            default:
-                                break;
-                        }
-                    }
-                }
-            }
         };
         AnimationState.prototype._updateBoneAndSlotTimelines = function () {
             {
                 var boneTimelines = {};
+                // Create bone timelines map.
                 for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) {
                     var timeline = _a[_i];
-                    var timelineName = timeline.bone.name;
+                    var timelineName = timeline.target.target.name;
                     if (!(timelineName in boneTimelines)) {
                         boneTimelines[timelineName] = [];
                     }
                     boneTimelines[timelineName].push(timeline);
                 }
-                for (var _b = 0, _c = this._armature.getBones(); _b < _c.length; _b++) {
-                    var bone = _c[_b];
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
+                    var timelineName = timeline.target.target.name;
+                    if (!(timelineName in boneTimelines)) {
+                        boneTimelines[timelineName] = [];
+                    }
+                    boneTimelines[timelineName].push(timeline);
+                }
+                //
+                for (var _d = 0, _e = this._armature.getBones(); _d < _e.length; _d++) {
+                    var bone = _e[_d];
                     var timelineName = bone.name;
                     if (!this.containsBoneMask(timelineName)) {
                         continue;
@@ -8833,70 +8663,53 @@ var dragonBones;
                     if (timelineName in boneTimelines) {
                         delete boneTimelines[timelineName];
                     }
-                    else if (bone._boneData.type === 0 /* Bone */) {
+                    else {
                         var timelineDatas = this._animationData.getBoneTimelines(timelineName);
-                        var bonePose = timelineName in this._bonePoses ? this._bonePoses[timelineName] : (this._bonePoses[timelineName] = dragonBones.BaseObject.borrowObject(BonePose));
+                        var blendState = this._armature.animation.getBlendState(BlendState.BONE_TRANSFORM, bone.name, bone);
                         if (timelineDatas !== null) {
-                            for (var _d = 0, timelineDatas_3 = timelineDatas; _d < timelineDatas_3.length; _d++) {
-                                var timelineData = timelineDatas_3[_d];
+                            for (var _f = 0, timelineDatas_2 = timelineDatas; _f < timelineDatas_2.length; _f++) {
+                                var timelineData = timelineDatas_2[_f];
                                 switch (timelineData.type) {
                                     case 10 /* BoneAll */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 11 /* BoneTranslate */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneTranslateTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 12 /* BoneRotate */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneRotateTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 13 /* BoneScale */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneScaleTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
-                                    default:
+                                    case 60 /* BoneAlpha */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.BONE_ALPHA, bone.name, bone);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._boneBlendTimelines.push(timeline);
                                         break;
-                                }
-                            }
-                        }
-                        else if (this.resetToPose) {
-                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
-                            timeline.bone = bone;
-                            timeline.bonePose = bonePose;
-                            timeline.init(this._armature, this, null);
-                            this._boneTimelines.push(timeline);
-                            this._poseTimelines.push(timeline);
-                        }
-                    }
-                    else if (bone._boneData.type === 1 /* Surface */) {
-                        var timelineDatas = this._animationData.getSurfaceTimelines(timelineName);
-                        if (timelineDatas !== null) {
-                            for (var _e = 0, timelineDatas_4 = timelineDatas; _e < timelineDatas_4.length; _e++) {
-                                var timelineData = timelineDatas_4[_e];
-                                switch (timelineData.type) {
+                                    }
                                     case 50 /* Surface */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
-                                        timeline.surface = bone;
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone);
                                         timeline.init(this._armature, this, timelineData);
-                                        this._surfaceTimelines.push(timeline);
+                                        this._boneBlendTimelines.push(timeline);
                                         break;
                                     }
                                     default:
@@ -8905,41 +8718,67 @@ var dragonBones;
                             }
                         }
                         else if (this.resetToPose) {
-                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
-                            timeline.surface = bone;
-                            timeline.init(this._armature, this, null);
-                            this._surfaceTimelines.push(timeline);
-                            this._poseTimelines.push(timeline);
+                            if (bone._boneData.type === 0 /* Bone */) {
+                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
+                                timeline.target = blendState;
+                                timeline.init(this._armature, this, null);
+                                this._boneTimelines.push(timeline);
+                                this._poseTimelines.push(timeline);
+                            }
+                            else {
+                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
+                                timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone);
+                                timeline.init(this._armature, this, null);
+                                this._boneBlendTimelines.push(timeline);
+                                this._poseTimelines.push(timeline);
+                            }
                         }
                     }
                 }
                 for (var k in boneTimelines) {
-                    for (var _f = 0, _g = boneTimelines[k]; _f < _g.length; _f++) {
-                        var timeline = _g[_f];
-                        this._boneTimelines.splice(this._boneTimelines.indexOf(timeline), 1);
-                        timeline.returnToPool();
+                    for (var _g = 0, _h = boneTimelines[k]; _g < _h.length; _g++) {
+                        var timeline = _h[_g];
+                        var index = this._boneTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._boneTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
+                        index = this._boneBlendTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._boneBlendTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
                     }
                 }
             }
             {
                 var slotTimelines = {};
                 var ffdFlags = [];
-                for (var _h = 0, _j = this._slotTimelines; _h < _j.length; _h++) {
-                    var timeline = _j[_h];
-                    var timelineName = timeline.slot.name;
+                // Create slot timelines map.
+                for (var _j = 0, _k = this._slotTimelines; _j < _k.length; _j++) {
+                    var timeline = _k[_j];
+                    var timelineName = timeline.target.name;
+                    if (!(timelineName in slotTimelines)) {
+                        slotTimelines[timelineName] = [];
+                    }
+                    slotTimelines[timelineName].push(timeline);
+                }
+                for (var _l = 0, _m = this._slotBlendTimelines; _l < _m.length; _l++) {
+                    var timeline = _m[_l];
+                    var timelineName = timeline.target.target.name;
                     if (!(timelineName in slotTimelines)) {
                         slotTimelines[timelineName] = [];
                     }
                     slotTimelines[timelineName].push(timeline);
                 }
-                for (var _k = 0, _l = this._armature.getSlots(); _k < _l.length; _k++) {
-                    var slot = _l[_k];
+                //
+                for (var _o = 0, _p = this._armature.getSlots(); _o < _p.length; _o++) {
+                    var slot = _p[_o];
                     var boneName = slot.parent.name;
                     if (!this.containsBoneMask(boneName)) {
                         continue;
                     }
                     var timelineName = slot.name;
-                    var timelineDatas = this._animationData.getSlotTimelines(timelineName);
                     if (timelineName in slotTimelines) {
                         delete slotTimelines[timelineName];
                     }
@@ -8947,21 +8786,29 @@ var dragonBones;
                         var displayIndexFlag = false;
                         var colorFlag = false;
                         ffdFlags.length = 0;
+                        var timelineDatas = this._animationData.getSlotTimelines(timelineName);
                         if (timelineDatas !== null) {
-                            for (var _m = 0, timelineDatas_5 = timelineDatas; _m < timelineDatas_5.length; _m++) {
-                                var timelineData = timelineDatas_5[_m];
+                            for (var _q = 0, timelineDatas_3 = timelineDatas; _q < timelineDatas_3.length; _q++) {
+                                var timelineData = timelineDatas_3[_q];
                                 switch (timelineData.type) {
                                     case 20 /* SlotDisplay */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDislayTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = slot;
                                         timeline.init(this._armature, this, timelineData);
                                         this._slotTimelines.push(timeline);
                                         displayIndexFlag = true;
                                         break;
                                     }
+                                    case 23 /* SlotZIndex */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotZIndexTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_Z_INDEX, slot.name, slot);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._slotBlendTimelines.push(timeline);
+                                        break;
+                                    }
                                     case 21 /* SlotColor */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = slot;
                                         timeline.init(this._armature, this, timelineData);
                                         this._slotTimelines.push(timeline);
                                         colorFlag = true;
@@ -8969,10 +8816,22 @@ var dragonBones;
                                     }
                                     case 22 /* SlotDeform */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot);
                                         timeline.init(this._armature, this, timelineData);
-                                        this._slotTimelines.push(timeline);
-                                        ffdFlags.push(timeline.vertexOffset);
+                                        if (timeline.target !== null) {
+                                            this._slotBlendTimelines.push(timeline);
+                                            ffdFlags.push(timeline.geometryOffset);
+                                        }
+                                        else {
+                                            timeline.returnToPool();
+                                        }
+                                        break;
+                                    }
+                                    case 24 /* SlotAlpha */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_ALPHA, slot.name, slot);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._slotBlendTimelines.push(timeline);
                                         break;
                                     }
                                     default:
@@ -8983,42 +8842,50 @@ var dragonBones;
                         if (this.resetToPose) {
                             if (!displayIndexFlag) {
                                 var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDislayTimelineState);
-                                timeline.slot = slot;
+                                timeline.target = slot;
                                 timeline.init(this._armature, this, null);
                                 this._slotTimelines.push(timeline);
                                 this._poseTimelines.push(timeline);
                             }
                             if (!colorFlag) {
                                 var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState);
-                                timeline.slot = slot;
+                                timeline.target = slot;
                                 timeline.init(this._armature, this, null);
                                 this._slotTimelines.push(timeline);
                                 this._poseTimelines.push(timeline);
                             }
-                            if (slot.rawDisplayDatas !== null) {
-                                for (var _o = 0, _p = slot.rawDisplayDatas; _o < _p.length; _o++) {
-                                    var displayData = _p[_o];
-                                    if (displayData !== null && displayData.type === 2 /* Mesh */) {
-                                        var meshOffset = displayData.vertices.offset;
-                                        if (ffdFlags.indexOf(meshOffset) < 0) {
-                                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
-                                            timeline.vertexOffset = meshOffset; //
-                                            timeline.slot = slot;
-                                            timeline.init(this._armature, this, null);
-                                            this._slotTimelines.push(timeline);
-                                            this._poseTimelines.push(timeline);
-                                        }
-                                    }
+                            for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                                var displayFrame = slot.getDisplayFrameAt(i);
+                                if (displayFrame.deformVertices.length === 0) {
+                                    continue;
+                                }
+                                var geometryData = displayFrame.getGeometryData();
+                                if (geometryData !== null && ffdFlags.indexOf(geometryData.offset) < 0) {
+                                    var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
+                                    timeline.geometryOffset = geometryData.offset; //
+                                    timeline.displayFrame = displayFrame; //
+                                    timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot);
+                                    timeline.init(this._armature, this, null);
+                                    this._slotBlendTimelines.push(timeline);
+                                    this._poseTimelines.push(timeline);
                                 }
                             }
                         }
                     }
                 }
                 for (var k in slotTimelines) {
-                    for (var _q = 0, _r = slotTimelines[k]; _q < _r.length; _q++) {
-                        var timeline = _r[_q];
-                        this._slotTimelines.splice(this._slotTimelines.indexOf(timeline), 1);
-                        timeline.returnToPool();
+                    for (var _r = 0, _s = slotTimelines[k]; _r < _s.length; _r++) {
+                        var timeline = _s[_r];
+                        var index = this._slotTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._slotTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
+                        index = this._slotBlendTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._slotBlendTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
                     }
                 }
             }
@@ -9027,13 +8894,16 @@ var dragonBones;
             var isFadeOut = this._fadeState > 0;
             if (this._subFadeState < 0) {
                 this._subFadeState = 0;
-                var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN;
-                if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
-                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                    eventObject.type = eventType;
-                    eventObject.armature = this._armature;
-                    eventObject.animationState = this;
-                    this._armature._dragonBones.bufferEvent(eventObject);
+                var eventActive = this._parent === null && this.actionEnabled;
+                if (eventActive) {
+                    var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN;
+                    if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
+                        var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                        eventObject.type = eventType;
+                        eventObject.armature = this._armature;
+                        eventObject.animationState = this;
+                        this._armature._dragonBones.bufferEvent(eventObject);
+                    }
                 }
             }
             if (passedTime < 0.0) {
@@ -9055,13 +8925,16 @@ var dragonBones;
                     this._playheadState |= 1; // x1
                     this._fadeState = 0;
                 }
-                var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE;
-                if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
-                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                    eventObject.type = eventType;
-                    eventObject.armature = this._armature;
-                    eventObject.animationState = this;
-                    this._armature._dragonBones.bufferEvent(eventObject);
+                var eventActive = this._parent === null && this.actionEnabled;
+                if (eventActive) {
+                    var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE;
+                    if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
+                        var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                        eventObject.type = eventType;
+                        eventObject.armature = this._armature;
+                        eventObject.animationState = this;
+                        this._armature._dragonBones.bufferEvent(eventObject);
+                    }
                 }
             }
         };
@@ -9076,17 +8949,19 @@ var dragonBones;
             this._animationData = animationData;
             //
             this.resetToPose = animationConfig.resetToPose;
-            this.additiveBlending = animationConfig.additiveBlending;
+            this.additive = animationConfig.additive;
             this.displayControl = animationConfig.displayControl;
             this.actionEnabled = animationConfig.actionEnabled;
+            this.blendType = animationData.blendType;
             this.layer = animationConfig.layer;
             this.playTimes = animationConfig.playTimes;
             this.timeScale = animationConfig.timeScale;
             this.fadeTotalTime = animationConfig.fadeInTime;
             this.autoFadeOutTime = animationConfig.autoFadeOutTime;
-            this.weight = animationConfig.weight;
             this.name = animationConfig.name.length > 0 ? animationConfig.name : animationConfig.animation;
             this.group = animationConfig.group;
+            //
+            this._weight = animationConfig.weight;
             if (animationConfig.pauseFadeIn) {
                 this._playheadState = 2; // 10
             }
@@ -9140,7 +9015,6 @@ var dragonBones;
          * @internal
          */
         AnimationState.prototype.advanceTime = function (passedTime, cacheFrameRate) {
-            this._blendState.dirty = false;
             // Update fade time.
             if (this._fadeState !== 0 || this._subFadeState !== 0) {
                 this._advanceFadeTime(passedTime);
@@ -9160,19 +9034,20 @@ var dragonBones;
                 this._timelineDirty = 0;
                 this._updateBoneAndSlotTimelines();
             }
-            if (this.weight === 0.0) {
-                return;
-            }
+            var isBlendDirty = this._fadeState !== 0 || this._subFadeState === 0;
             var isCacheEnabled = this._fadeState === 0 && cacheFrameRate > 0.0;
             var isUpdateTimeline = true;
             var isUpdateBoneTimeline = true;
             var time = this._time;
-            this._weightResult = this.weight * this._fadeProgress;
+            this._weightResult = this._weight * this._fadeProgress;
             if (this._parent !== null) {
-                this._weightResult *= this._parent._weightResult / this._parent._fadeProgress;
+                this._weightResult *= this._parent._weightResult;
             }
             if (this._actionTimeline.playState <= 0) {
-                this._actionTimeline.update(time); // Update main timeline.
+                this._actionTimeline.update(time);
+            }
+            if (this._weight === 0.0) {
+                return;
             }
             if (isCacheEnabled) {
                 var internval = cacheFrameRate * 2.0;
@@ -9198,57 +9073,117 @@ var dragonBones;
                 }
             }
             if (isUpdateTimeline) {
+                var isBlend = false;
+                var prevTarget = null; //
                 if (isUpdateBoneTimeline) {
                     for (var i = 0, l = this._boneTimelines.length; i < l; ++i) {
                         var timeline = this._boneTimelines[i];
                         if (timeline.playState <= 0) {
                             timeline.update(time);
                         }
-                        if (i === l - 1 || timeline.bone !== this._boneTimelines[i + 1].bone) {
-                            var state = timeline.bone._blendState.update(this._weightResult, this.layer);
-                            if (state !== 0) {
-                                timeline.blend(state);
+                        if (timeline.target !== prevTarget) {
+                            var blendState = timeline.target;
+                            isBlend = blendState.update(this);
+                            prevTarget = blendState;
+                            if (blendState.dirty === 1) {
+                                var pose = blendState.target.animationPose;
+                                pose.x = 0.0;
+                                pose.y = 0.0;
+                                pose.rotation = 0.0;
+                                pose.skew = 0.0;
+                                pose.scaleX = 1.0;
+                                pose.scaleY = 1.0;
                             }
                         }
+                        if (isBlend) {
+                            timeline.blend(isBlendDirty);
+                        }
                     }
                 }
-                for (var i = 0, l = this._surfaceTimelines.length; i < l; ++i) {
-                    var timeline = this._surfaceTimelines[i];
-                    var state = timeline.surface._blendState.update(this._weightResult, this.layer);
+                for (var i = 0, l = this._boneBlendTimelines.length; i < l; ++i) {
+                    var timeline = this._boneBlendTimelines[i];
                     if (timeline.playState <= 0) {
                         timeline.update(time);
                     }
-                    if (state !== 0) {
-                        timeline.blend(state);
+                    if (timeline.target.update(this)) {
+                        timeline.blend(isBlendDirty);
                     }
                 }
                 if (this.displayControl) {
                     for (var i = 0, l = this._slotTimelines.length; i < l; ++i) {
                         var timeline = this._slotTimelines[i];
-                        var displayController = timeline.slot.displayController;
-                        if (displayController === null ||
-                            displayController === this.name ||
-                            displayController === this.group) {
-                            if (timeline.playState <= 0) {
+                        if (timeline.playState <= 0) {
+                            var slot = timeline.target;
+                            var displayController = slot.displayController;
+                            if (displayController === null ||
+                                displayController === this.name ||
+                                displayController === this.group) {
                                 timeline.update(time);
                             }
                         }
                     }
                 }
-                for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) {
-                    var timeline = this._constraintTimelines[i];
+                for (var i = 0, l = this._slotBlendTimelines.length; i < l; ++i) {
+                    var timeline = this._slotBlendTimelines[i];
                     if (timeline.playState <= 0) {
+                        var blendState = timeline.target;
                         timeline.update(time);
+                        if (blendState.update(this)) {
+                            timeline.blend(isBlendDirty);
+                        }
                     }
                 }
-                for (var i = 0, l = this._animationTimelines.length; i < l; ++i) {
-                    var timeline = this._animationTimelines[i];
-                    var state = timeline.animationState._blendState.update(this._weightResult, this.layer);
+                for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) {
+                    var timeline = this._constraintTimelines[i];
                     if (timeline.playState <= 0) {
                         timeline.update(time);
                     }
-                    if (state !== 0) {
-                        timeline.blend(state);
+                }
+                if (this._animationTimelines.length > 0) {
+                    var dL = 100.0;
+                    var dR = 100.0;
+                    var leftState = null;
+                    var rightState = null;
+                    for (var i = 0, l = this._animationTimelines.length; i < l; ++i) {
+                        var timeline = this._animationTimelines[i];
+                        if (timeline.playState <= 0) {
+                            timeline.update(time);
+                        }
+                        if (this.blendType === 1 /* E1D */) {
+                            var animationState = timeline.target;
+                            var d = this.parameterX - animationState.positionX;
+                            if (d >= 0.0) {
+                                if (d < dL) {
+                                    dL = d;
+                                    leftState = animationState;
+                                }
+                            }
+                            else {
+                                if (-d < dR) {
+                                    dR = -d;
+                                    rightState = animationState;
+                                }
+                            }
+                        }
+                    }
+                    if (leftState !== null) {
+                        if (this._activeChildA !== leftState) {
+                            if (this._activeChildA !== null) {
+                                this._activeChildA.weight = 0.0;
+                            }
+                            this._activeChildA = leftState;
+                            this._activeChildA.activeTimeline();
+                        }
+                        if (this._activeChildB !== rightState) {
+                            if (this._activeChildB !== null) {
+                                this._activeChildB.weight = 0.0;
+                            }
+                            this._activeChildB = rightState;
+                        }
+                        leftState.weight = dR / (dL + dR);
+                        if (rightState) {
+                            rightState.weight = 1.0 - leftState.weight;
+                        }
                     }
                 }
             }
@@ -9258,19 +9193,36 @@ var dragonBones;
                     if (this._poseTimelines.length > 0) {
                         for (var _i = 0, _a = this._poseTimelines; _i < _a.length; _i++) {
                             var timeline = _a[_i];
-                            if (timeline instanceof dragonBones.BoneTimelineState) {
-                                this._boneTimelines.splice(this._boneTimelines.indexOf(timeline), 1);
+                            var index = this._boneTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._boneTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
+                            }
+                            index = this._boneBlendTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._boneBlendTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.SurfaceTimelineState) {
-                                this._surfaceTimelines.splice(this._surfaceTimelines.indexOf(timeline), 1);
+                            index = this._slotTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._slotTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.SlotTimelineState) {
-                                this._slotTimelines.splice(this._slotTimelines.indexOf(timeline), 1);
+                            index = this._slotBlendTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._slotBlendTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.ConstraintTimelineState) {
-                                this._constraintTimelines.splice(this._constraintTimelines.indexOf(timeline), 1);
+                            index = this._constraintTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._constraintTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            timeline.returnToPool();
                         }
                         this._poseTimelines.length = 0;
                     }
@@ -9345,7 +9297,7 @@ var dragonBones;
                     var timeline = _a[_i];
                     timeline.fadeOut();
                 }
-                for (var _b = 0, _c = this._surfaceTimelines; _b < _c.length; _b++) {
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
                     var timeline = _c[_b];
                     timeline.fadeOut();
                 }
@@ -9353,15 +9305,21 @@ var dragonBones;
                     var timeline = _e[_d];
                     timeline.fadeOut();
                 }
-                for (var _f = 0, _g = this._constraintTimelines; _f < _g.length; _f++) {
+                for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) {
                     var timeline = _g[_f];
                     timeline.fadeOut();
                 }
-                for (var _h = 0, _j = this._animationTimelines; _h < _j.length; _h++) {
+                for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) {
                     var timeline = _j[_h];
-                    timeline.animationState.fadeOut(fadeOutTime, pausePlayhead);
                     timeline.fadeOut();
                 }
+                for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) {
+                    var timeline = _l[_k];
+                    timeline.fadeOut();
+                    //
+                    var animaitonState = timeline.target;
+                    animaitonState.fadeOut(999999.0, true);
+                }
             }
             this.displayControl = false; //
             this.fadeTotalTime = this._fadeProgress > 0.000001 ? fadeOutTime / this._fadeProgress : 0.0;
@@ -9442,9 +9400,9 @@ var dragonBones;
                     if (this._boneMask.length > 0) {
                         for (var _i = 0, bones_1 = bones; _i < bones_1.length; _i++) {
                             var bone = bones_1[_i];
-                            var index_2 = this._boneMask.indexOf(bone.name);
-                            if (index_2 >= 0 && currentBone.contains(bone)) {
-                                this._boneMask.splice(index_2, 1);
+                            var index_1 = this._boneMask.indexOf(bone.name);
+                            if (index_1 >= 0 && currentBone.contains(bone)) {
+                                this._boneMask.splice(index_1, 1);
                             }
                         }
                     }
@@ -9477,6 +9435,63 @@ var dragonBones;
             this._boneMask.length = 0;
             this._timelineDirty = 1;
         };
+        /**
+         * @private
+         */
+        AnimationState.prototype.addState = function (animationState, timelineDatas) {
+            if (timelineDatas === void 0) { timelineDatas = null; }
+            if (timelineDatas !== null) {
+                for (var _i = 0, timelineDatas_4 = timelineDatas; _i < timelineDatas_4.length; _i++) {
+                    var timelineData = timelineDatas_4[_i];
+                    switch (timelineData.type) {
+                        case 40 /* AnimationProgress */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationProgressTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            if (this.blendType !== 0 /* None */) {
+                                var animaitonTimelineData = timelineData;
+                                animationState.positionX = animaitonTimelineData.x;
+                                animationState.positionY = animaitonTimelineData.y;
+                                animationState.weight = 0.0;
+                            }
+                            animationState._parent = this;
+                            this.resetToPose = false;
+                            break;
+                        }
+                        case 41 /* AnimationWeight */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationWeightTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            break;
+                        }
+                        case 42 /* AnimationParameter */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationParametersTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            break;
+                        }
+                        default:
+                            break;
+                    }
+                }
+            }
+            if (animationState._parent === null) {
+                animationState._parent = this;
+            }
+        };
+        /**
+         * @internal
+         */
+        AnimationState.prototype.activeTimeline = function () {
+            for (var _i = 0, _a = this._slotTimelines; _i < _a.length; _i++) {
+                var timeline = _a[_i];
+                timeline.dirty = true;
+                timeline.currentTime = -1.0;
+            }
+        };
         Object.defineProperty(AnimationState.prototype, "isFadeIn", {
             /**
              * - Whether the animation state is fading in.
@@ -9618,8 +9633,9 @@ var dragonBones;
                         value += this._duration;
                     }
                 }
-                if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 && value === this._duration) {
-                    value = this._duration - 0.000001;
+                if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 &&
+                    value === this._duration && this._parent === null) {
+                    value = this._duration - 0.000001; // 
                 }
                 if (this._time === value) {
                     return;
@@ -9641,13 +9657,50 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(AnimationState.prototype, "animationData", {
+        Object.defineProperty(AnimationState.prototype, "weight", {
+            /**
+             * - The blend weight.
+             * @default 1.0
+             * @version DragonBones 5.0
+             * @language en_US
+             */
+            /**
+             * - 混合权重。
+             * @default 1.0
+             * @version DragonBones 5.0
+             * @language zh_CN
+             */
             /**
              * - The animation data.
              * @see dragonBones.AnimationData
              * @version DragonBones 3.0
              * @language en_US
              */
+            get: function () {
+                return this._weight;
+            },
+            set: function (value) {
+                if (this._weight === value) {
+                    return;
+                }
+                this._weight = value;
+                for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) {
+                    var timeline = _a[_i];
+                    timeline.dirty = true;
+                }
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
+                    timeline.dirty = true;
+                }
+                for (var _d = 0, _e = this._slotBlendTimelines; _d < _e.length; _d++) {
+                    var timeline = _e[_d];
+                    timeline.dirty = true;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(AnimationState.prototype, "animationData", {
             /**
              * - 动画数据。
              * @see dragonBones.AnimationData
@@ -9666,74 +9719,65 @@ var dragonBones;
     /**
      * @internal
      */
-    var BonePose = /** @class */ (function (_super) {
-        __extends(BonePose, _super);
-        function BonePose() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.current = new dragonBones.Transform();
-            _this.delta = new dragonBones.Transform();
-            _this.result = new dragonBones.Transform();
-            return _this;
+    var BlendState = /** @class */ (function (_super) {
+        __extends(BlendState, _super);
+        function BlendState() {
+            return _super !== null && _super.apply(this, arguments) || this;
         }
-        BonePose.toString = function () {
-            return "[class dragonBones.BonePose]";
+        BlendState.toString = function () {
+            return "[class dragonBones.BlendState]";
         };
-        BonePose.prototype._onClear = function () {
-            this.current.identity();
-            this.delta.identity();
-            this.result.identity();
+        BlendState.prototype._onClear = function () {
+            this.reset();
+            this.target = null;
         };
-        return BonePose;
-    }(dragonBones.BaseObject));
-    dragonBones.BonePose = BonePose;
-    /**
-     * @internal
-     */
-    var BlendState = /** @class */ (function () {
-        function BlendState() {
-        }
-        /**
-         * -1: First blending, 0: No blending, 1: Blending.
-         */
-        BlendState.prototype.update = function (weight, p_layer) {
-            if (this.dirty) {
+        BlendState.prototype.update = function (animationState) {
+            var animationLayer = animationState.layer;
+            var animationWeight = animationState._weightResult;
+            if (this.dirty > 0) {
                 if (this.leftWeight > 0.0) {
-                    if (this.layer !== p_layer) {
+                    if (this.layer !== animationLayer) {
                         if (this.layerWeight >= this.leftWeight) {
+                            this.dirty++;
+                            this.layer = animationLayer;
                             this.leftWeight = 0.0;
-                            return 0;
-                        }
-                        else {
-                            this.layer = p_layer;
-                            this.leftWeight -= this.layerWeight;
-                            this.layerWeight = 0.0;
+                            this.blendWeight = 0.0;
+                            return false;
                         }
+                        this.layer = animationLayer;
+                        this.leftWeight -= this.layerWeight;
+                        this.layerWeight = 0.0;
                     }
+                    animationWeight *= this.leftWeight;
+                    this.dirty++;
+                    this.blendWeight = animationWeight;
+                    this.layerWeight += this.blendWeight;
+                    return true;
                 }
-                else {
-                    return 0;
-                }
-                weight *= this.leftWeight;
-                this.layerWeight += weight;
-                this.blendWeight = weight;
-                return 2;
+                return false;
             }
-            this.dirty = true;
-            this.layer = p_layer;
-            this.layerWeight = weight;
+            this.dirty++;
+            this.layer = animationLayer;
             this.leftWeight = 1.0;
-            this.blendWeight = weight;
-            return 1;
+            this.blendWeight = animationWeight;
+            this.layerWeight = animationWeight;
+            return true;
         };
-        BlendState.prototype.clear = function () {
-            this.dirty = false;
+        BlendState.prototype.reset = function () {
+            this.dirty = 0;
             this.layer = 0;
             this.leftWeight = 0.0;
             this.layerWeight = 0.0;
             this.blendWeight = 0.0;
         };
+        BlendState.BONE_TRANSFORM = "boneTransform";
+        BlendState.BONE_ALPHA = "boneAlpha";
+        BlendState.SURFACE = "surface";
+        BlendState.SLOT_DEFORM = "slotDeform";
+        BlendState.SLOT_ALPHA = "slotAlpha";
+        BlendState.SLOT_Z_INDEX = "slotZIndex";
         return BlendState;
-    }());
+    }(dragonBones.BaseObject));
     dragonBones.BlendState = BlendState;
 })(dragonBones || (dragonBones = {}));
 /**
@@ -9769,29 +9813,30 @@ var dragonBones;
             return _super !== null && _super.apply(this, arguments) || this;
         }
         TimelineState.prototype._onClear = function () {
+            this.dirty = false;
             this.playState = -1;
             this.currentPlayTimes = -1;
             this.currentTime = -1.0;
-            this._tweenState = 0 /* None */;
-            this._frameRate = 0;
+            this.target = null;
+            this._isTween = false;
+            this._valueOffset = 0;
             this._frameValueOffset = 0;
-            this._frameCount = 0;
             this._frameOffset = 0;
+            this._frameRate = 0;
+            this._frameCount = 0;
             this._frameIndex = -1;
             this._frameRateR = 0.0;
             this._position = 0.0;
             this._duration = 0.0;
             this._timeScale = 1.0;
             this._timeOffset = 0.0;
-            this._dragonBonesData = null; //
             this._animationData = null; //
             this._timelineData = null; //
             this._armature = null; //
             this._animationState = null; //
             this._actionTimeline = null; //
             this._frameArray = null; //
-            this._frameIntArray = null; //
-            this._frameFloatArray = null; //
+            this._valueArray = null; //
             this._timelineArray = null; //
             this._frameIndices = null; //
         };
@@ -9862,25 +9907,27 @@ var dragonBones;
             if (this === this._actionTimeline) {
                 this._actionTimeline = null; //
             }
-            this._animationData = this._animationState._animationData;
+            this._animationData = this._animationState.animationData;
+            //
             this._frameRate = this._animationData.parent.frameRate;
             this._frameRateR = 1.0 / this._frameRate;
             this._position = this._animationState._position;
             this._duration = this._animationState._duration;
-            this._dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data.
             if (this._timelineData !== null) {
-                this._frameIntArray = this._dragonBonesData.frameIntArray;
-                this._frameFloatArray = this._dragonBonesData.frameFloatArray;
-                this._frameArray = this._dragonBonesData.frameArray;
-                this._timelineArray = this._dragonBonesData.timelineArray;
-                this._frameIndices = this._dragonBonesData.frameIndices;
+                var dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data.
+                this._frameArray = dragonBonesData.frameArray;
+                this._timelineArray = dragonBonesData.timelineArray;
+                this._frameIndices = dragonBonesData.frameIndices;
+                //
                 this._frameCount = this._timelineArray[this._timelineData.offset + 2 /* TimelineKeyFrameCount */];
                 this._frameValueOffset = this._timelineArray[this._timelineData.offset + 4 /* TimelineFrameValueOffset */];
                 this._timeScale = 100.0 / this._timelineArray[this._timelineData.offset + 0 /* TimelineScale */];
                 this._timeOffset = this._timelineArray[this._timelineData.offset + 1 /* TimelineOffset */] * 0.01;
             }
         };
-        TimelineState.prototype.fadeOut = function () { };
+        TimelineState.prototype.fadeOut = function () {
+            this.dirty = false;
+        };
         TimelineState.prototype.update = function (passedTime) {
             if (this._setCurrentTime(passedTime)) {
                 if (this._frameCount > 1) {
@@ -9899,11 +9946,13 @@ var dragonBones;
                     }
                     this._onArriveAtFrame();
                 }
-                if (this._tweenState !== 0 /* None */) {
+                if (this._isTween || this.dirty) {
                     this._onUpdateFrame();
                 }
             }
         };
+        TimelineState.prototype.blend = function (_isDirty) {
+        };
         return TimelineState;
     }(dragonBones.BaseObject));
     dragonBones.TimelineState = TimelineState;
@@ -9937,10 +9986,19 @@ var dragonBones;
             else if (progress >= 1.0) {
                 return 1.0;
             }
+            var isOmited = count > 0;
             var segmentCount = count + 1; // + 2 - 1
             var valueIndex = Math.floor(progress * segmentCount);
-            var fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1];
-            var toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex];
+            var fromValue = 0.0;
+            var toValue = 0.0;
+            if (isOmited) {
+                fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1];
+                toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex];
+            }
+            else {
+                fromValue = samples[offset + valueIndex - 1];
+                toValue = samples[offset + valueIndex];
+            }
             return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001;
         };
         TweenTimelineState.prototype._onClear = function () {
@@ -9949,21 +10007,27 @@ var dragonBones;
             this._curveCount = 0;
             this._framePosition = 0.0;
             this._frameDurationR = 0.0;
-            this._tweenProgress = 0.0;
             this._tweenEasing = 0.0;
+            this._tweenProgress = 0.0;
+            this._valueScale = 1.0;
         };
         TweenTimelineState.prototype._onArriveAtFrame = function () {
             if (this._frameCount > 1 &&
                 (this._frameIndex !== this._frameCount - 1 ||
                     this._animationState.playTimes === 0 ||
                     this._animationState.currentPlayTimes < this._animationState.playTimes - 1)) {
-                this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */]; // TODO recode ture tween type.
-                this._tweenState = this._tweenType === 0 /* None */ ? 1 /* Once */ : 2 /* Always */;
-                if (this._tweenType === 2 /* Curve */) {
-                    this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */];
+                this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */];
+                this._isTween = this._tweenType !== 0 /* None */;
+                if (this._isTween) {
+                    if (this._tweenType === 2 /* Curve */) {
+                        this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */];
+                    }
+                    else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) {
+                        this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01;
+                    }
                 }
-                else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) {
-                    this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01;
+                else {
+                    this.dirty = true;
                 }
                 this._framePosition = this._frameArray[this._frameOffset] * this._frameRateR;
                 if (this._frameIndex === this._frameCount - 1) {
@@ -9981,11 +10045,13 @@ var dragonBones;
                 }
             }
             else {
-                this._tweenState = 1 /* Once */;
+                this.dirty = true;
+                this._isTween = false;
             }
         };
         TweenTimelineState.prototype._onUpdateFrame = function () {
-            if (this._tweenState === 2 /* Always */) {
+            if (this._isTween) {
+                this.dirty = true;
                 this._tweenProgress = (this.currentTime - this._framePosition) * this._frameDurationR;
                 if (this._tweenType === 2 /* Curve */) {
                     this._tweenProgress = TweenTimelineState._getEasingCurveValue(this._tweenProgress, this._frameArray, this._curveCount, this._frameOffset + 3 /* FrameCurveSamples */);
@@ -9994,9 +10060,6 @@ var dragonBones;
                     this._tweenProgress = TweenTimelineState._getEasingValue(this._tweenType, this._tweenProgress, this._tweenEasing);
                 }
             }
-            else {
-                this._tweenProgress = 0.0;
-            }
         };
         return TweenTimelineState;
     }(TimelineState));
@@ -10004,90 +10067,205 @@ var dragonBones;
     /**
      * @internal
      */
-    var BoneTimelineState = /** @class */ (function (_super) {
-        __extends(BoneTimelineState, _super);
-        function BoneTimelineState() {
+    var SingleValueTimelineState = /** @class */ (function (_super) {
+        __extends(SingleValueTimelineState, _super);
+        function SingleValueTimelineState() {
             return _super !== null && _super.apply(this, arguments) || this;
         }
-        BoneTimelineState.prototype._onClear = function () {
+        SingleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.bone = null; //
-            this.bonePose = null; //
-        };
-        BoneTimelineState.prototype.blend = function (state) {
-            var blendWeight = this.bone._blendState.blendWeight;
-            var animationPose = this.bone.animationPose;
-            var result = this.bonePose.result;
-            if (state === 2) {
-                animationPose.x += result.x * blendWeight;
-                animationPose.y += result.y * blendWeight;
-                animationPose.rotation += result.rotation * blendWeight;
-                animationPose.skew += result.skew * blendWeight;
-                animationPose.scaleX += (result.scaleX - 1.0) * blendWeight;
-                animationPose.scaleY += (result.scaleY - 1.0) * blendWeight;
-            }
-            else if (blendWeight !== 1.0) {
-                animationPose.x = result.x * blendWeight;
-                animationPose.y = result.y * blendWeight;
-                animationPose.rotation = result.rotation * blendWeight;
-                animationPose.skew = result.skew * blendWeight;
-                animationPose.scaleX = (result.scaleX - 1.0) * blendWeight + 1.0;
-                animationPose.scaleY = (result.scaleY - 1.0) * blendWeight + 1.0;
+            this._current = 0.0;
+            this._difference = 0.0;
+            this._result = 0.0;
+        };
+        SingleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + 1;
+                    if (valueScale === 1.0) {
+                        this._current = valueArray[valueOffset];
+                        this._difference = valueArray[nextValueOffset] - this._current;
+                    }
+                    else {
+                        this._current = valueArray[valueOffset] * valueScale;
+                        this._difference = valueArray[nextValueOffset] * valueScale - this._current;
+                    }
+                }
+                else {
+                    this._result = valueArray[valueOffset] * valueScale;
+                }
             }
             else {
-                animationPose.x = result.x;
-                animationPose.y = result.y;
-                animationPose.rotation = result.rotation;
-                animationPose.skew = result.skew;
-                animationPose.scaleX = result.scaleX;
-                animationPose.scaleY = result.scaleY;
+                this._result = 0.0;
             }
-            if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                this.bone._transformDirty = true;
+        };
+        SingleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                this._result = this._current + this._difference * this._tweenProgress;
             }
         };
-        return BoneTimelineState;
+        return SingleValueTimelineState;
     }(TweenTimelineState));
-    dragonBones.BoneTimelineState = BoneTimelineState;
+    dragonBones.SingleValueTimelineState = SingleValueTimelineState;
     /**
      * @internal
      */
-    var SlotTimelineState = /** @class */ (function (_super) {
-        __extends(SlotTimelineState, _super);
-        function SlotTimelineState() {
+    var DoubleValueTimelineState = /** @class */ (function (_super) {
+        __extends(DoubleValueTimelineState, _super);
+        function DoubleValueTimelineState() {
             return _super !== null && _super.apply(this, arguments) || this;
         }
-        SlotTimelineState.prototype._onClear = function () {
+        DoubleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.slot = null; //
+            this._currentA = 0.0;
+            this._currentB = 0.0;
+            this._differenceA = 0.0;
+            this._differenceB = 0.0;
+            this._resultA = 0.0;
+            this._resultB = 0.0;
+        };
+        DoubleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * 2;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + 2;
+                    if (valueScale === 1.0) {
+                        this._currentA = valueArray[valueOffset];
+                        this._currentB = valueArray[valueOffset + 1];
+                        this._differenceA = valueArray[nextValueOffset] - this._currentA;
+                        this._differenceB = valueArray[nextValueOffset + 1] - this._currentB;
+                    }
+                    else {
+                        this._currentA = valueArray[valueOffset] * valueScale;
+                        this._currentB = valueArray[valueOffset + 1] * valueScale;
+                        this._differenceA = valueArray[nextValueOffset] * valueScale - this._currentA;
+                        this._differenceB = valueArray[nextValueOffset + 1] * valueScale - this._currentB;
+                    }
+                }
+                else {
+                    this._resultA = valueArray[valueOffset] * valueScale;
+                    this._resultB = valueArray[valueOffset + 1] * valueScale;
+                }
+            }
+            else {
+                this._resultA = 0.0;
+                this._resultB = 0.0;
+            }
+        };
+        DoubleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                this._resultA = this._currentA + this._differenceA * this._tweenProgress;
+                this._resultB = this._currentB + this._differenceB * this._tweenProgress;
+            }
         };
-        return SlotTimelineState;
+        return DoubleValueTimelineState;
     }(TweenTimelineState));
-    dragonBones.SlotTimelineState = SlotTimelineState;
+    dragonBones.DoubleValueTimelineState = DoubleValueTimelineState;
     /**
      * @internal
      */
-    var ConstraintTimelineState = /** @class */ (function (_super) {
-        __extends(ConstraintTimelineState, _super);
-        function ConstraintTimelineState() {
-            return _super !== null && _super.apply(this, arguments) || this;
+    var MutilpleValueTimelineState = /** @class */ (function (_super) {
+        __extends(MutilpleValueTimelineState, _super);
+        function MutilpleValueTimelineState() {
+            var _this = _super !== null && _super.apply(this, arguments) || this;
+            _this._rd = [];
+            return _this;
         }
-        ConstraintTimelineState.prototype._onClear = function () {
+        MutilpleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.constraint = null; //
+            this._valueCount = 0;
+            this._rd.length = 0;
         };
-        return ConstraintTimelineState;
-    }(TweenTimelineState));
-    dragonBones.ConstraintTimelineState = ConstraintTimelineState;
-})(dragonBones || (dragonBones = {}));
-/**
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2018 DragonBones team and other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
+        MutilpleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            var valueCount = this._valueCount;
+            var rd = this._rd;
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + valueCount;
+                    if (valueScale === 1.0) {
+                        for (var i = 0; i < valueCount; ++i) {
+                            rd[valueCount + i] = valueArray[nextValueOffset + i] - valueArray[valueOffset + i];
+                        }
+                    }
+                    else {
+                        for (var i = 0; i < valueCount; ++i) {
+                            rd[valueCount + i] = (valueArray[nextValueOffset + i] - valueArray[valueOffset + i]) * valueScale;
+                        }
+                    }
+                }
+                else if (valueScale === 1.0) {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i];
+                    }
+                }
+                else {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] * valueScale;
+                    }
+                }
+            }
+            else {
+                for (var i = 0; i < valueCount; ++i) {
+                    rd[i] = 0.0;
+                }
+            }
+        };
+        MutilpleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                var valueCount = this._valueCount;
+                var valueScale = this._valueScale;
+                var tweenProgress = this._tweenProgress;
+                var valueArray = this._valueArray;
+                var rd = this._rd;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount;
+                if (valueScale === 1.0) {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] + rd[valueCount + i] * tweenProgress;
+                    }
+                }
+                else {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] * valueScale + rd[valueCount + i] * tweenProgress;
+                    }
+                }
+            }
+        };
+        return MutilpleValueTimelineState;
+    }(TweenTimelineState));
+    dragonBones.MutilpleValueTimelineState = MutilpleValueTimelineState;
+})(dragonBones || (dragonBones = {}));
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  * the Software, and to permit persons to whom the Software is furnished to do so,
  * subject to the following conditions:
@@ -10153,6 +10331,7 @@ var dragonBones;
             var prevPlayTimes = this.currentPlayTimes;
             var prevTime = this.currentTime;
             if (this._setCurrentTime(passedTime)) {
+                var eventActive = this._animationState._parent === null && this._animationState.actionEnabled;
                 var eventDispatcher = this._armature.eventDispatcher;
                 if (prevState < 0) {
                     if (this.playState !== prevState) {
@@ -10160,7 +10339,7 @@ var dragonBones;
                             this._armature._sortZOrder(null, 0);
                         }
                         prevPlayTimes = this.currentPlayTimes;
-                        if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) {
+                        if (eventActive && eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) {
                             var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
                             eventObject.type = dragonBones.EventObject.START;
                             eventObject.armature = this._armature;
@@ -10175,7 +10354,7 @@ var dragonBones;
                 var isReverse = this._animationState.timeScale < 0.0;
                 var loopCompleteEvent = null;
                 var completeEvent = null;
-                if (this.currentPlayTimes !== prevPlayTimes) {
+                if (eventActive && this.currentPlayTimes !== prevPlayTimes) {
                     if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.LOOP_COMPLETE)) {
                         loopCompleteEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
                         loopCompleteEvent.type = dragonBones.EventObject.LOOP_COMPLETE;
@@ -10265,7 +10444,8 @@ var dragonBones;
                                     // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem
                                     var framePosition = this._frameArray[frameOffset] / this._frameRate;
                                     if (this._position <= framePosition &&
-                                        framePosition <= this._position + this._duration) {
+                                        framePosition <= this._position + this._duration //
+                                    ) {
                                         this._onCrossFrame(crossedFrameIndex);
                                     }
                                     if (loopCompleteEvent !== null && crossedFrameIndex === 0) {
@@ -10354,78 +10534,57 @@ var dragonBones;
         };
         BoneAllTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 6; // ...(timeline value offset)|xxxxxx|xxxxxx|(Value offset)xxxxx|(Next offset)xxxxx|xxxxxx|xxxxxx|...
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = frameFloatArray[valueOffset++] * scale;
-                current.y = frameFloatArray[valueOffset++] * scale;
-                current.rotation = frameFloatArray[valueOffset++];
-                current.skew = frameFloatArray[valueOffset++];
-                current.scaleX = frameFloatArray[valueOffset++];
-                current.scaleY = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 6
-                    }
-                    delta.x = frameFloatArray[valueOffset++] * scale - current.x;
-                    delta.y = frameFloatArray[valueOffset++] * scale - current.y;
-                    delta.rotation = frameFloatArray[valueOffset++] - current.rotation;
-                    delta.skew = frameFloatArray[valueOffset++] - current.skew;
-                    delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX;
-                    delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY;
-                }
-                else {
-                    delta.x = 0.0;
-                    delta.y = 0.0;
-                    delta.rotation = 0.0;
-                    delta.skew = 0.0;
-                    delta.scaleX = 0.0;
-                    delta.scaleY = 0.0;
-                }
+            if (this._isTween && this._frameIndex === this._frameCount - 1) {
+                this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]);
+                this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]);
             }
-            else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = 0.0;
-                current.y = 0.0;
-                current.rotation = 0.0;
-                current.skew = 0.0;
-                current.scaleX = 1.0;
-                current.scaleY = 1.0;
-                delta.x = 0.0;
-                delta.y = 0.0;
-                delta.rotation = 0.0;
-                delta.skew = 0.0;
-                delta.scaleX = 0.0;
-                delta.scaleY = 0.0;
-            }
-        };
-        BoneAllTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            result.x = current.x + delta.x * this._tweenProgress;
-            result.y = current.y + delta.y * this._tweenProgress;
-            result.rotation = current.rotation + delta.rotation * this._tweenProgress;
-            result.skew = current.skew + delta.skew * this._tweenProgress;
-            result.scaleX = current.scaleX + delta.scaleX * this._tweenProgress;
-            result.scaleY = current.scaleY + delta.scaleY * this._tweenProgress;
+            if (this._timelineData === null) {
+                this._rd[4] = 1.0;
+                this._rd[5] = 1.0;
+            }
+        };
+        BoneAllTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueCount = 6;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
         };
         BoneAllTimelineState.prototype.fadeOut = function () {
-            var result = this.bonePose.result;
-            result.rotation = dragonBones.Transform.normalizeRadian(result.rotation);
-            result.skew = dragonBones.Transform.normalizeRadian(result.skew);
+            this.dirty = false;
+            this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]);
+            this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]);
+        };
+        BoneAllTimelineState.prototype.blend = function (isDirty) {
+            var valueScale = this._armature.armatureData.scale;
+            var rd = this._rd;
+            //
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.x += rd[0] * blendWeight * valueScale;
+                result.y += rd[1] * blendWeight * valueScale;
+                result.rotation += rd[2] * blendWeight;
+                result.skew += rd[3] * blendWeight;
+                result.scaleX += (rd[4] - 1.0) * blendWeight;
+                result.scaleY += (rd[5] - 1.0) * blendWeight;
+            }
+            else {
+                result.x = rd[0] * blendWeight * valueScale;
+                result.y = rd[1] * blendWeight * valueScale;
+                result.rotation = rd[2] * blendWeight;
+                result.skew = rd[3] * blendWeight;
+                result.scaleX = (rd[4] - 1.0) * blendWeight + 1.0; // 
+                result.scaleY = (rd[5] - 1.0) * blendWeight + 1.0; //
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         };
         return BoneAllTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.MutilpleValueTimelineState));
     dragonBones.BoneAllTimelineState = BoneAllTimelineState;
     /**
      * @internal
@@ -10438,51 +10597,36 @@ var dragonBones;
         BoneTranslateTimelineState.toString = function () {
             return "[class dragonBones.BoneTranslateTimelineState]";
         };
-        BoneTranslateTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = frameFloatArray[valueOffset++] * scale;
-                current.y = frameFloatArray[valueOffset++] * scale;
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    delta.x = frameFloatArray[valueOffset++] * scale - current.x;
-                    delta.y = frameFloatArray[valueOffset++] * scale - current.y;
-                }
-                else {
-                    delta.x = 0.0;
-                    delta.y = 0.0;
-                }
+        BoneTranslateTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueScale = this._armature.armatureData.scale;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
+        };
+        BoneTranslateTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.x += this._resultA * blendWeight;
+                result.y += this._resultB * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.x = this._resultA * blendWeight;
+                result.y = this._resultB * blendWeight;
             }
             else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = 0.0;
-                current.y = 0.0;
-                delta.x = 0.0;
-                delta.y = 0.0;
+                result.x = this._resultA;
+                result.y = this._resultB;
             }
-        };
-        BoneTranslateTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
             }
-            result.x = (current.x + delta.x * this._tweenProgress);
-            result.y = (current.y + delta.y * this._tweenProgress);
         };
         return BoneTranslateTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneTranslateTimelineState = BoneTranslateTimelineState;
     /**
      * @internal
@@ -10497,56 +10641,45 @@ var dragonBones;
         };
         BoneRotateTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.rotation = frameFloatArray[valueOffset++];
-                current.skew = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                        delta.rotation = dragonBones.Transform.normalizeRadian(frameFloatArray[valueOffset++] - current.rotation);
-                    }
-                    else {
-                        delta.rotation = frameFloatArray[valueOffset++] - current.rotation;
-                    }
-                    delta.skew = frameFloatArray[valueOffset++] - current.skew;
-                }
-                else {
-                    delta.rotation = 0.0;
-                    delta.skew = 0.0;
-                }
-            }
-            else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.rotation = 0.0;
-                current.skew = 0.0;
-                delta.rotation = 0.0;
-                delta.skew = 0.0;
+            if (this._isTween && this._frameIndex === this._frameCount - 1) {
+                this._differenceA = dragonBones.Transform.normalizeRadian(this._differenceA);
+                this._differenceB = dragonBones.Transform.normalizeRadian(this._differenceB);
             }
         };
-        BoneRotateTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            result.rotation = current.rotation + delta.rotation * this._tweenProgress;
-            result.skew = current.skew + delta.skew * this._tweenProgress;
+        BoneRotateTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
         };
         BoneRotateTimelineState.prototype.fadeOut = function () {
-            var result = this.bonePose.result;
-            result.rotation = dragonBones.Transform.normalizeRadian(result.rotation);
-            result.skew = dragonBones.Transform.normalizeRadian(result.skew);
+            this.dirty = false;
+            this._resultA = dragonBones.Transform.normalizeRadian(this._resultA);
+            this._resultB = dragonBones.Transform.normalizeRadian(this._resultB);
+        };
+        BoneRotateTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.rotation += this._resultA * blendWeight;
+                result.skew += this._resultB * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.rotation = this._resultA * blendWeight;
+                result.skew = this._resultB * blendWeight;
+            }
+            else {
+                result.rotation = this._resultA;
+                result.skew = this._resultB;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         };
         return BoneRotateTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneRotateTimelineState = BoneRotateTimelineState;
     /**
      * @internal
@@ -10561,48 +10694,40 @@ var dragonBones;
         };
         BoneScaleTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.scaleX = frameFloatArray[valueOffset++];
-                current.scaleY = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX;
-                    delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY;
-                }
-                else {
-                    delta.scaleX = 0.0;
-                    delta.scaleY = 0.0;
-                }
+            if (this._timelineData === null) {
+                this._resultA = 1.0;
+                this._resultB = 1.0;
+            }
+        };
+        BoneScaleTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
+        };
+        BoneScaleTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.scaleX += (this._resultA - 1.0) * blendWeight;
+                result.scaleY += (this._resultB - 1.0) * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.scaleX = (this._resultA - 1.0) * blendWeight + 1.0;
+                result.scaleY = (this._resultB - 1.0) * blendWeight + 1.0;
             }
             else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.scaleX = 1.0;
-                current.scaleY = 1.0;
-                delta.scaleX = 0.0;
-                delta.scaleY = 0.0;
+                result.scaleX = this._resultA;
+                result.scaleY = this._resultB;
             }
-        };
-        BoneScaleTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
             }
-            result.scaleX = current.scaleX + delta.scaleX * this._tweenProgress;
-            result.scaleY = current.scaleY + delta.scaleY * this._tweenProgress;
         };
         return BoneScaleTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneScaleTimelineState = BoneScaleTimelineState;
     /**
      * @internal
@@ -10610,116 +10735,123 @@ var dragonBones;
     var SurfaceTimelineState = /** @class */ (function (_super) {
         __extends(SurfaceTimelineState, _super);
         function SurfaceTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._current = [];
-            _this._delta = [];
-            _this._result = [];
-            return _this;
+            return _super !== null && _super.apply(this, arguments) || this;
         }
         SurfaceTimelineState.toString = function () {
             return "[class dragonBones.SurfaceTimelineState]";
         };
         SurfaceTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.surface = null;
-            this._frameFloatOffset = 0;
-            this._valueCount = 0;
             this._deformCount = 0;
-            this._valueOffset = 0;
-            this._current.length = 0;
-            this._delta.length = 0;
-            this._result.length = 0;
+            this._deformOffset = 0;
+            this._sameValueOffset = 0;
         };
-        SurfaceTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
+        SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * this._valueCount;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                if (this._tweenState === 2 /* Always */) {
-                    var nextValueOffset = valueOffset + this._valueCount;
-                    if (this._frameIndex === this._frameCount - 1) {
-                        nextValueOffset = this._animationData.frameFloatOffset + this._frameValueOffset;
+                var dragonBonesData = this._animationData.parent.parent;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
+                this._valueOffset = this._animationData.frameFloatOffset;
+                this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
+                this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */];
+                this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
+                this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
+                this._valueScale = this._armature.armatureData.scale;
+                this._valueArray = dragonBonesData.frameFloatArray;
+                this._rd.length = this._valueCount * 2;
+            }
+            else {
+                this._deformCount = this.target.target._deformVertices.length;
+            }
+        };
+        SurfaceTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var surface = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = surface._deformVertices;
+            var valueArray = this._valueArray;
+            if (valueArray !== null) {
+                var valueCount = this._valueCount;
+                var deformOffset = this._deformOffset;
+                var sameValueOffset = this._sameValueOffset;
+                var rd = this._rd;
+                for (var i = 0; i < this._deformCount; ++i) {
+                    var value = 0.0;
+                    if (i < deformOffset) {
+                        value = valueArray[sameValueOffset + i];
+                    }
+                    else if (i < deformOffset + valueCount) {
+                        value = rd[i - deformOffset];
                     }
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._delta[i] = frameFloatArray[nextValueOffset + i] * scale - (this._current[i] = frameFloatArray[valueOffset + i] * scale);
+                    else {
+                        value = valueArray[sameValueOffset + i - valueCount];
                     }
-                }
-                else {
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._current[i] = frameFloatArray[valueOffset + i] * scale;
+                    if (blendState.dirty > 1) {
+                        result[i] += value * blendWeight;
+                    }
+                    else {
+                        result[i] = value * blendWeight;
                     }
                 }
             }
-            else {
-                for (var i = 0; i < this._valueCount; ++i) {
-                    this._current[i] = 0.0;
+            else if (blendState.dirty === 1) {
+                for (var i = 0; i < this._deformCount; ++i) {
+                    result[i] = 0.0;
                 }
             }
-        };
-        SurfaceTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            this.surface._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                surface._transformDirty = true;
             }
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._result[i] = this._current[i] + this._delta[i] * this._tweenProgress;
+        };
+        return SurfaceTimelineState;
+    }(dragonBones.MutilpleValueTimelineState));
+    dragonBones.SurfaceTimelineState = SurfaceTimelineState;
+    /**
+     * @internal
+     */
+    var AlphaTimelineState = /** @class */ (function (_super) {
+        __extends(AlphaTimelineState, _super);
+        function AlphaTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AlphaTimelineState.toString = function () {
+            return "[class dragonBones.AlphaTimelineState]";
+        };
+        AlphaTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData === null) {
+                this._result = 1.0;
             }
         };
-        SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) {
+        AlphaTimelineState.prototype.init = function (armature, animationState, timelineData) {
             _super.prototype.init.call(this, armature, animationState, timelineData);
-            if (this._timelineData !== null) {
-                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
-                this._deformCount = this._frameIntArray[frameIntOffset + 1 /* DeformCount */];
-                this._valueCount = this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
-                this._valueOffset = this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
-                this._frameFloatOffset = this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
-            }
-            else {
-                this._deformCount = this.surface._deformVertices.length;
-                this._valueCount = this._deformCount;
-                this._valueOffset = 0;
-                this._frameFloatOffset = 0;
-            }
-            this._current.length = this._valueCount;
-            this._delta.length = this._valueCount;
-            this._result.length = this._valueCount;
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._delta[i] = 0.0;
-            }
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.01;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
-        SurfaceTimelineState.prototype.blend = function (state) {
-            var blendWeight = this.surface._blendState.blendWeight;
-            var result = this.surface._deformVertices;
-            for (var i = 0; i < this._deformCount; ++i) {
-                var value = 0.0;
-                if (i < this._valueOffset) {
-                    value = this._frameFloatArray[this._frameFloatOffset + i];
-                }
-                else if (i < this._valueOffset + this._valueCount) {
-                    value = this._result[i - this._valueOffset];
-                }
-                else {
-                    value = this._frameFloatArray[this._frameFloatOffset + i - this._valueCount];
-                }
-                if (state === 2) {
-                    result[i] += value * blendWeight;
-                }
-                else if (blendWeight !== 1.0) {
-                    result[i] = value * blendWeight;
-                }
-                else {
-                    result[i] = value;
+        AlphaTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var alphaTarget = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            if (blendState.dirty > 1) {
+                alphaTarget._alpha += this._result * blendWeight;
+                if (alphaTarget._alpha > 1.0) {
+                    alphaTarget._alpha = 1.0;
                 }
             }
-            if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                this.surface._transformDirty = true;
+            else {
+                alphaTarget._alpha = this._result * blendWeight;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                this._armature._alphaDirty = true;
             }
         };
-        return SurfaceTimelineState;
-    }(dragonBones.TweenTimelineState));
-    dragonBones.SurfaceTimelineState = SurfaceTimelineState;
+        return AlphaTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AlphaTimelineState = AlphaTimelineState;
     /**
      * @internal
      */
@@ -10733,14 +10865,17 @@ var dragonBones;
         };
         SlotDislayTimelineState.prototype._onArriveAtFrame = function () {
             if (this.playState >= 0) {
-                var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : this.slot._slotData.displayIndex;
-                if (this.slot.displayIndex !== displayIndex) {
-                    this.slot._setDisplayIndex(displayIndex, true);
+                var slot = this.target;
+                var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : slot._slotData.displayIndex;
+                if (slot.displayIndex !== displayIndex) {
+                    slot._setDisplayIndex(displayIndex, true);
                 }
             }
         };
+        SlotDislayTimelineState.prototype._onUpdateFrame = function () {
+        };
         return SlotDislayTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.TimelineState));
     dragonBones.SlotDislayTimelineState = SlotDislayTimelineState;
     /**
      * @internal
@@ -10750,91 +10885,97 @@ var dragonBones;
         function SlotColorTimelineState() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
             _this._current = [0, 0, 0, 0, 0, 0, 0, 0];
-            _this._delta = [0, 0, 0, 0, 0, 0, 0, 0];
+            _this._difference = [0, 0, 0, 0, 0, 0, 0, 0];
             _this._result = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
             return _this;
         }
         SlotColorTimelineState.toString = function () {
             return "[class dragonBones.SlotColorTimelineState]";
         };
-        SlotColorTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this._dirty = false;
-        };
         SlotColorTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
             if (this._timelineData !== null) {
-                var intArray = this._dragonBonesData.intArray;
-                var frameIntArray = this._frameIntArray;
-                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 1; // ...(timeline value offset)|x|x|(Value offset)|(Next offset)|x|x|...
+                var dragonBonesData = this._animationData.parent.parent;
+                var colorArray = dragonBonesData.colorArray;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex;
                 var colorOffset = frameIntArray[valueOffset];
                 if (colorOffset < 0) {
-                    colorOffset += 65536; // Fixed out of bouds bug. 
-                }
-                this._current[0] = intArray[colorOffset++];
-                this._current[1] = intArray[colorOffset++];
-                this._current[2] = intArray[colorOffset++];
-                this._current[3] = intArray[colorOffset++];
-                this._current[4] = intArray[colorOffset++];
-                this._current[5] = intArray[colorOffset++];
-                this._current[6] = intArray[colorOffset++];
-                this._current[7] = intArray[colorOffset++];
-                if (this._tweenState === 2 /* Always */) {
+                    colorOffset += 65536; // Fixed out of bounds bug. 
+                }
+                if (this._isTween) {
+                    this._current[0] = colorArray[colorOffset++];
+                    this._current[1] = colorArray[colorOffset++];
+                    this._current[2] = colorArray[colorOffset++];
+                    this._current[3] = colorArray[colorOffset++];
+                    this._current[4] = colorArray[colorOffset++];
+                    this._current[5] = colorArray[colorOffset++];
+                    this._current[6] = colorArray[colorOffset++];
+                    this._current[7] = colorArray[colorOffset++];
                     if (this._frameIndex === this._frameCount - 1) {
                         colorOffset = frameIntArray[this._animationData.frameIntOffset + this._frameValueOffset];
                     }
                     else {
-                        colorOffset = frameIntArray[valueOffset + 1 * 1];
+                        colorOffset = frameIntArray[valueOffset + 1];
                     }
                     if (colorOffset < 0) {
-                        colorOffset += 65536; // Fixed out of bouds bug. 
+                        colorOffset += 65536; // Fixed out of bounds bug. 
                     }
-                    this._delta[0] = intArray[colorOffset++] - this._current[0];
-                    this._delta[1] = intArray[colorOffset++] - this._current[1];
-                    this._delta[2] = intArray[colorOffset++] - this._current[2];
-                    this._delta[3] = intArray[colorOffset++] - this._current[3];
-                    this._delta[4] = intArray[colorOffset++] - this._current[4];
-                    this._delta[5] = intArray[colorOffset++] - this._current[5];
-                    this._delta[6] = intArray[colorOffset++] - this._current[6];
-                    this._delta[7] = intArray[colorOffset++] - this._current[7];
+                    this._difference[0] = colorArray[colorOffset++] - this._current[0];
+                    this._difference[1] = colorArray[colorOffset++] - this._current[1];
+                    this._difference[2] = colorArray[colorOffset++] - this._current[2];
+                    this._difference[3] = colorArray[colorOffset++] - this._current[3];
+                    this._difference[4] = colorArray[colorOffset++] - this._current[4];
+                    this._difference[5] = colorArray[colorOffset++] - this._current[5];
+                    this._difference[6] = colorArray[colorOffset++] - this._current[6];
+                    this._difference[7] = colorArray[colorOffset++] - this._current[7];
+                }
+                else {
+                    this._result[0] = colorArray[colorOffset++] * 0.01;
+                    this._result[1] = colorArray[colorOffset++] * 0.01;
+                    this._result[2] = colorArray[colorOffset++] * 0.01;
+                    this._result[3] = colorArray[colorOffset++] * 0.01;
+                    this._result[4] = colorArray[colorOffset++];
+                    this._result[5] = colorArray[colorOffset++];
+                    this._result[6] = colorArray[colorOffset++];
+                    this._result[7] = colorArray[colorOffset++];
                 }
             }
             else {
-                var color = this.slot._slotData.color;
-                this._current[0] = color.alphaMultiplier * 100.0;
-                this._current[1] = color.redMultiplier * 100.0;
-                this._current[2] = color.greenMultiplier * 100.0;
-                this._current[3] = color.blueMultiplier * 100.0;
-                this._current[4] = color.alphaOffset;
-                this._current[5] = color.redOffset;
-                this._current[6] = color.greenOffset;
-                this._current[7] = color.blueOffset;
+                var slot = this.target;
+                var color = slot.slotData.color;
+                this._result[0] = color.alphaMultiplier;
+                this._result[1] = color.redMultiplier;
+                this._result[2] = color.greenMultiplier;
+                this._result[3] = color.blueMultiplier;
+                this._result[4] = color.alphaOffset;
+                this._result[5] = color.redOffset;
+                this._result[6] = color.greenOffset;
+                this._result[7] = color.blueOffset;
             }
         };
         SlotColorTimelineState.prototype._onUpdateFrame = function () {
             _super.prototype._onUpdateFrame.call(this);
-            this._dirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            this._result[0] = (this._current[0] + this._delta[0] * this._tweenProgress) * 0.01;
-            this._result[1] = (this._current[1] + this._delta[1] * this._tweenProgress) * 0.01;
-            this._result[2] = (this._current[2] + this._delta[2] * this._tweenProgress) * 0.01;
-            this._result[3] = (this._current[3] + this._delta[3] * this._tweenProgress) * 0.01;
-            this._result[4] = this._current[4] + this._delta[4] * this._tweenProgress;
-            this._result[5] = this._current[5] + this._delta[5] * this._tweenProgress;
-            this._result[6] = this._current[6] + this._delta[6] * this._tweenProgress;
-            this._result[7] = this._current[7] + this._delta[7] * this._tweenProgress;
+            if (this._isTween) {
+                this._result[0] = (this._current[0] + this._difference[0] * this._tweenProgress) * 0.01;
+                this._result[1] = (this._current[1] + this._difference[1] * this._tweenProgress) * 0.01;
+                this._result[2] = (this._current[2] + this._difference[2] * this._tweenProgress) * 0.01;
+                this._result[3] = (this._current[3] + this._difference[3] * this._tweenProgress) * 0.01;
+                this._result[4] = this._current[4] + this._difference[4] * this._tweenProgress;
+                this._result[5] = this._current[5] + this._difference[5] * this._tweenProgress;
+                this._result[6] = this._current[6] + this._difference[6] * this._tweenProgress;
+                this._result[7] = this._current[7] + this._difference[7] * this._tweenProgress;
+            }
         };
         SlotColorTimelineState.prototype.fadeOut = function () {
-            this._tweenState = 0 /* None */;
-            this._dirty = false;
+            this._isTween = false;
         };
         SlotColorTimelineState.prototype.update = function (passedTime) {
             _super.prototype.update.call(this, passedTime);
             // Fade animation.
-            if (this._tweenState !== 0 /* None */ || this._dirty) {
-                var result = this.slot._colorTransform;
+            if (this._isTween || this.dirty) {
+                var slot = this.target;
+                var result = slot._colorTransform;
                 if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
                     if (result.alphaMultiplier !== this._result[0] ||
                         result.redMultiplier !== this._result[1] ||
@@ -10853,11 +10994,11 @@ var dragonBones;
                         result.redOffset += (this._result[5] - result.redOffset) * fadeProgress;
                         result.greenOffset += (this._result[6] - result.greenOffset) * fadeProgress;
                         result.blueOffset += (this._result[7] - result.blueOffset) * fadeProgress;
-                        this.slot._colorDirty = true;
+                        slot._colorDirty = true;
                     }
                 }
-                else if (this._dirty) {
-                    this._dirty = false;
+                else if (this.dirty) {
+                    this.dirty = false;
                     if (result.alphaMultiplier !== this._result[0] ||
                         result.redMultiplier !== this._result[1] ||
                         result.greenMultiplier !== this._result[2] ||
@@ -10874,152 +11015,159 @@ var dragonBones;
                         result.redOffset = this._result[5];
                         result.greenOffset = this._result[6];
                         result.blueOffset = this._result[7];
-                        this.slot._colorDirty = true;
+                        slot._colorDirty = true;
                     }
                 }
             }
         };
         return SlotColorTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.TweenTimelineState));
     dragonBones.SlotColorTimelineState = SlotColorTimelineState;
+    /**
+     * @internal
+     */
+    var SlotZIndexTimelineState = /** @class */ (function (_super) {
+        __extends(SlotZIndexTimelineState, _super);
+        function SlotZIndexTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        SlotZIndexTimelineState.toString = function () {
+            return "[class dragonBones.SlotZIndexTimelineState]";
+        };
+        SlotZIndexTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData === null) {
+                var blendState = this.target;
+                var slot = blendState.target;
+                this._result = slot.slotData.zIndex;
+            }
+        };
+        SlotZIndexTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        SlotZIndexTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var slot = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            if (blendState.dirty > 1) {
+                slot._zIndex += this._result * blendWeight;
+            }
+            else {
+                slot._zIndex = this._result * blendWeight;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                this._armature._zIndexDirty = true;
+            }
+        };
+        return SlotZIndexTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.SlotZIndexTimelineState = SlotZIndexTimelineState;
     /**
      * @internal
      */
     var DeformTimelineState = /** @class */ (function (_super) {
         __extends(DeformTimelineState, _super);
         function DeformTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._current = [];
-            _this._delta = [];
-            _this._result = [];
-            return _this;
+            return _super !== null && _super.apply(this, arguments) || this;
         }
         DeformTimelineState.toString = function () {
             return "[class dragonBones.DeformTimelineState]";
         };
         DeformTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.vertexOffset = 0;
-            this._dirty = false;
-            this._frameFloatOffset = 0;
-            this._valueCount = 0;
+            this.geometryOffset = 0;
+            this.displayFrame = null;
             this._deformCount = 0;
-            this._valueOffset = 0;
-            this._current.length = 0;
-            this._delta.length = 0;
-            this._result.length = 0;
+            this._deformOffset = 0;
+            this._sameValueOffset = 0;
         };
-        DeformTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
+        DeformTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * this._valueCount;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                if (this._tweenState === 2 /* Always */) {
-                    var nextValueOffset = valueOffset + this._valueCount;
-                    if (this._frameIndex === this._frameCount - 1) {
-                        nextValueOffset = this._animationData.frameFloatOffset + this._frameValueOffset;
+                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
+                var dragonBonesData = this._animationData.parent.parent;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var slot = this.target.target;
+                this.geometryOffset = frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */];
+                if (this.geometryOffset < 0) {
+                    this.geometryOffset += 65536; // Fixed out of bounds bug. 
+                }
+                for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                    var displayFrame = slot.getDisplayFrameAt(i);
+                    var geometryData = displayFrame.getGeometryData();
+                    if (geometryData === null) {
+                        continue;
                     }
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._delta[i] = frameFloatArray[nextValueOffset + i] * scale - (this._current[i] = frameFloatArray[valueOffset + i] * scale);
+                    if (geometryData.offset === this.geometryOffset) {
+                        this.displayFrame = displayFrame;
+                        this.displayFrame.updateDeformVertices();
+                        break;
                     }
                 }
-                else {
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._current[i] = frameFloatArray[valueOffset + i] * scale;
-                    }
+                if (this.displayFrame === null) {
+                    this.returnToPool(); //
+                    return;
                 }
+                this._valueOffset = this._animationData.frameFloatOffset;
+                this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
+                this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */];
+                this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
+                this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
+                this._valueScale = this._armature.armatureData.scale;
+                this._valueArray = dragonBonesData.frameFloatArray;
+                this._rd.length = this._valueCount * 2;
             }
             else {
-                for (var i = 0; i < this._valueCount; ++i) {
-                    this._current[i] = 0.0;
+                this._deformCount = this.displayFrame.deformVertices.length;
+            }
+        };
+        DeformTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var slot = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = this.displayFrame.deformVertices;
+            var valueArray = this._valueArray;
+            if (valueArray !== null) {
+                var valueCount = this._valueCount;
+                var deformOffset = this._deformOffset;
+                var sameValueOffset = this._sameValueOffset;
+                var rd = this._rd;
+                for (var i = 0; i < this._deformCount; ++i) {
+                    var value = 0.0;
+                    if (i < deformOffset) {
+                        value = valueArray[sameValueOffset + i];
+                    }
+                    else if (i < deformOffset + valueCount) {
+                        value = rd[i - deformOffset];
+                    }
+                    else {
+                        value = valueArray[sameValueOffset + i - valueCount];
+                    }
+                    if (blendState.dirty > 1) {
+                        result[i] += value * blendWeight;
+                    }
+                    else {
+                        result[i] = value * blendWeight;
+                    }
                 }
             }
-        };
-        DeformTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            this._dirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._result[i] = this._current[i] + this._delta[i] * this._tweenProgress;
-            }
-        };
-        DeformTimelineState.prototype.init = function (armature, animationState, timelineData) {
-            _super.prototype.init.call(this, armature, animationState, timelineData);
-            if (this._timelineData !== null) {
-                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
-                this.vertexOffset = this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */];
-                if (this.vertexOffset < 0) {
-                    this.vertexOffset += 65536; // Fixed out of bouds bug. 
+            else if (blendState.dirty === 1) {
+                for (var i = 0; i < this._deformCount; ++i) {
+                    result[i] = 0.0;
                 }
-                this._deformCount = this._frameIntArray[frameIntOffset + 1 /* DeformCount */];
-                this._valueCount = this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
-                this._valueOffset = this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
-                this._frameFloatOffset = this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
             }
-            else {
-                var deformVertices = this.slot._deformVertices;
-                this._deformCount = deformVertices !== null ? deformVertices.vertices.length : 0;
-                this._valueCount = this._deformCount;
-                this._valueOffset = 0;
-                this._frameFloatOffset = 0;
-            }
-            this._current.length = this._valueCount;
-            this._delta.length = this._valueCount;
-            this._result.length = this._valueCount;
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._delta[i] = 0.0;
-            }
-        };
-        DeformTimelineState.prototype.fadeOut = function () {
-            this._tweenState = 0 /* None */;
-            this._dirty = false;
-        };
-        DeformTimelineState.prototype.update = function (passedTime) {
-            var deformVertices = this.slot._deformVertices;
-            if (deformVertices === null || deformVertices.verticesData === null || deformVertices.verticesData.offset !== this.vertexOffset) {
-                return;
-            }
-            _super.prototype.update.call(this, passedTime);
-            // Fade animation.
-            if (this._tweenState !== 0 /* None */ || this._dirty) {
-                var result = deformVertices.vertices;
-                if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                    var fadeProgress = Math.pow(this._animationState._fadeProgress, 2);
-                    for (var i = 0; i < this._deformCount; ++i) {
-                        if (i < this._valueOffset) {
-                            result[i] += (this._frameFloatArray[this._frameFloatOffset + i] - result[i]) * fadeProgress;
-                        }
-                        else if (i < this._valueOffset + this._valueCount) {
-                            result[i] += (this._result[i - this._valueOffset] - result[i]) * fadeProgress;
-                        }
-                        else {
-                            result[i] += (this._frameFloatArray[this._frameFloatOffset + i - this._valueCount] - result[i]) * fadeProgress;
-                        }
-                    }
-                    deformVertices.verticesDirty = true;
-                }
-                else if (this._dirty) {
-                    this._dirty = false;
-                    for (var i = 0; i < this._deformCount; ++i) {
-                        if (i < this._valueOffset) {
-                            result[i] = this._frameFloatArray[this._frameFloatOffset + i];
-                        }
-                        else if (i < this._valueOffset + this._valueCount) {
-                            result[i] = this._result[i - this._valueOffset];
-                        }
-                        else {
-                            result[i] = this._frameFloatArray[this._frameFloatOffset + i - this._valueCount];
-                        }
-                    }
-                    deformVertices.verticesDirty = true;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                if (slot._geometryData === this.displayFrame.getGeometryData()) {
+                    slot._verticesDirty = true;
                 }
             }
         };
         return DeformTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.MutilpleValueTimelineState));
     dragonBones.DeformTimelineState = DeformTimelineState;
     /**
      * @internal
@@ -11032,115 +11180,115 @@ var dragonBones;
         IKConstraintTimelineState.toString = function () {
             return "[class dragonBones.IKConstraintTimelineState]";
         };
-        IKConstraintTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this._current = 0.0;
-            this._delta = 0.0;
-        };
-        IKConstraintTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            var ikConstraint = this.constraint;
+        IKConstraintTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var ikConstraint = this.target;
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameIntArray = this._frameIntArray;
-                var bendPositive = frameIntArray[valueOffset++] !== 0;
-                this._current = frameIntArray[valueOffset++] * 0.01;
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameIntOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    this._delta = frameIntArray[valueOffset + 1] * 0.01 - this._current;
-                }
-                else {
-                    this._delta = 0.0;
-                }
-                ikConstraint._bendPositive = bendPositive;
+                ikConstraint._bendPositive = this._currentA > 0.0;
+                ikConstraint._weight = this._currentB;
             }
             else {
                 var ikConstraintData = ikConstraint._constraintData;
-                this._current = ikConstraintData.weight;
-                this._delta = 0.0;
                 ikConstraint._bendPositive = ikConstraintData.bendPositive;
+                ikConstraint._weight = ikConstraintData.weight;
             }
             ikConstraint.invalidUpdate();
+            this.dirty = false;
         };
-        IKConstraintTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            var ikConstraint = this.constraint;
-            ikConstraint._weight = this._current + this._delta * this._tweenProgress;
-            ikConstraint.invalidUpdate();
-            // TODO fade update.
+        IKConstraintTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.01;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
         return IKConstraintTimelineState;
-    }(dragonBones.ConstraintTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.IKConstraintTimelineState = IKConstraintTimelineState;
     /**
      * @internal
      */
-    var AnimationTimelineState = /** @class */ (function (_super) {
-        __extends(AnimationTimelineState, _super);
-        function AnimationTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._floats = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
-            return _this;
+    var AnimationProgressTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationProgressTimelineState, _super);
+        function AnimationProgressTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
         }
-        AnimationTimelineState.toString = function () {
-            return "[class dragonBones.AnimationTimelineState]";
-        };
-        AnimationTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this.animationState = null;
+        AnimationProgressTimelineState.toString = function () {
+            return "[class dragonBones.AnimationProgressTimelineState]";
         };
-        AnimationTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData === null) {
-                return;
-            }
-            var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 2;
-            var frameRateR = 1.0 / this.animationState._animationData.parent.frameRate;
-            var frameIntArray = this._frameIntArray;
-            this._floats[0] = frameIntArray[valueOffset++] * frameRateR;
-            this._floats[3] = frameIntArray[valueOffset++] * 0.01;
-            if (this._tweenState === 2 /* Always */) {
-                if (this._frameIndex === this._frameCount - 1) {
-                    valueOffset = this._animationData.frameIntOffset + this._frameValueOffset; // + 0 * 2
-                }
-                this._floats[1] = frameIntArray[valueOffset++] * frameRateR - this._floats[0];
-                this._floats[4] = frameIntArray[valueOffset++] * 0.01 - this._floats[3];
-            }
-            else {
-                this._floats[1] = 0.0;
-                this._floats[4] = 0.0;
+        AnimationProgressTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.currentTime = this._result * animationState.totalTime;
             }
+            this.dirty = false;
         };
-        AnimationTimelineState.prototype._onUpdateFrame = function () {
+        AnimationProgressTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        return AnimationProgressTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AnimationProgressTimelineState = AnimationProgressTimelineState;
+    /**
+     * @internal
+     */
+    var AnimationWeightTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationWeightTimelineState, _super);
+        function AnimationWeightTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationWeightTimelineState.toString = function () {
+            return "[class dragonBones.AnimationWeightTimelineState]";
+        };
+        AnimationWeightTimelineState.prototype._onUpdateFrame = function () {
             _super.prototype._onUpdateFrame.call(this);
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            if (this._floats[0] >= 0.0) {
-                this._floats[2] = this._floats[0] + this._floats[1] * this._tweenProgress;
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.weight = this._result;
             }
-            this._floats[5] = this._floats[3] + this._floats[4] * this._tweenProgress;
+            this.dirty = false;
         };
-        AnimationTimelineState.prototype.blend = function (state) {
-            var animationState = this.animationState;
-            var blendWeight = animationState._blendState.blendWeight;
-            if (state === 2) {
-                animationState.weight += this._floats[5] * blendWeight;
-                animationState.currentTime += this._floats[2] * blendWeight;
-            }
-            else {
-                animationState.weight = this._floats[5] * blendWeight;
-                animationState.currentTime = this._floats[2] * blendWeight;
+        AnimationWeightTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        return AnimationWeightTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AnimationWeightTimelineState = AnimationWeightTimelineState;
+    /**
+     * @internal
+     */
+    var AnimationParametersTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationParametersTimelineState, _super);
+        function AnimationParametersTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationParametersTimelineState.toString = function () {
+            return "[class dragonBones.AnimationParametersTimelineState]";
+        };
+        AnimationParametersTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.parameterX = this._resultA;
+                animationState.parameterY = this._resultB;
             }
+            this.dirty = false;
         };
-        return AnimationTimelineState;
-    }(dragonBones.TweenTimelineState));
-    dragonBones.AnimationTimelineState = AnimationTimelineState;
+        AnimationParametersTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        return AnimationParametersTimelineState;
+    }(dragonBones.DoubleValueTimelineState));
+    dragonBones.AnimationParametersTimelineState = AnimationParametersTimelineState;
 })(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
@@ -11346,7 +11494,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var DataParser = /** @class */ (function () {
         function DataParser() {
@@ -11373,6 +11521,40 @@ var dragonBones;
                     return 0 /* Bone */;
             }
         };
+        DataParser._getPositionMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "percent":
+                    return 1 /* Percent */;
+                case "fixed":
+                    return 0 /* Fixed */;
+                default:
+                    return 1 /* Percent */;
+            }
+        };
+        DataParser._getSpacingMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "length":
+                    return 0 /* Length */;
+                case "percent":
+                    return 2 /* Percent */;
+                case "fixed":
+                    return 1 /* Fixed */;
+                default:
+                    return 0 /* Length */;
+            }
+        };
+        DataParser._getRotateMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "tangent":
+                    return 0 /* Tangent */;
+                case "chain":
+                    return 1 /* Chain */;
+                case "chainscale":
+                    return 2 /* ChainScale */;
+                default:
+                    return 0 /* Tangent */;
+            }
+        };
         DataParser._getDisplayType = function (value) {
             switch (value.toLowerCase()) {
                 case "image":
@@ -11401,18 +11583,6 @@ var dragonBones;
                     return 0 /* Rectangle */;
             }
         };
-        DataParser._getActionType = function (value) {
-            switch (value.toLowerCase()) {
-                case "play":
-                    return 0 /* Play */;
-                case "frame":
-                    return 10 /* Frame */;
-                case "sound":
-                    return 11 /* Sound */;
-                default:
-                    return 0 /* Play */;
-            }
-        };
         DataParser._getBlendMode = function (value) {
             switch (value.toLowerCase()) {
                 case "normal":
@@ -11447,93 +11617,27 @@ var dragonBones;
                     return 0 /* Normal */;
             }
         };
-        DataParser._getPositionMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "percent":
-                    return 1 /* Percent */;
-                case "fixed":
-                    return 0 /* Fixed */;
-                default:
-                    return 1 /* Percent */;
-            }
-        };
-        DataParser._getSpacingMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "length":
-                    return 0 /* Length */;
-                case "percent":
-                    return 2 /* Percent */;
-                case "fixed":
-                    return 1 /* Fixed */;
+        DataParser._getAnimationBlendType = function (value) {
+            switch (value.toLowerCase()) {
+                case "none":
+                    return 0 /* None */;
+                case "1d":
+                    return 1 /* E1D */;
                 default:
-                    return 0 /* Length */;
+                    return 0 /* None */;
             }
         };
-        DataParser._getRotateMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "tangent":
-                    return 0 /* Tangent */;
-                case "chain":
-                    return 1 /* Chain */;
-                case "chainscale":
-                    return 2 /* ChainScale */;
+        DataParser._getActionType = function (value) {
+            switch (value.toLowerCase()) {
+                case "play":
+                    return 0 /* Play */;
+                case "frame":
+                    return 10 /* Frame */;
+                case "sound":
+                    return 11 /* Sound */;
                 default:
-                    return 0 /* Tangent */;
-            }
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DataParser.parseDragonBonesData = function (rawData) {
-            console.warn("Deprecated.");
-            if (rawData instanceof ArrayBuffer) {
-                return dragonBones.BinaryDataParser.getInstance().parseDragonBonesData(rawData);
-            }
-            else {
-                return dragonBones.ObjectDataParser.getInstance().parseDragonBonesData(rawData);
-            }
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DataParser.parseTextureAtlasData = function (rawData, scale) {
-            if (scale === void 0) { scale = 1; }
-            console.warn("已废弃");
-            var textureAtlasData = {};
-            var subTextureList = rawData[DataParser.SUB_TEXTURE];
-            for (var i = 0, len = subTextureList.length; i < len; i++) {
-                var subTextureObject = subTextureList[i];
-                var subTextureName = subTextureObject[DataParser.NAME];
-                var subTextureRegion = new dragonBones.Rectangle();
-                var subTextureFrame = null;
-                subTextureRegion.x = subTextureObject[DataParser.X] / scale;
-                subTextureRegion.y = subTextureObject[DataParser.Y] / scale;
-                subTextureRegion.width = subTextureObject[DataParser.WIDTH] / scale;
-                subTextureRegion.height = subTextureObject[DataParser.HEIGHT] / scale;
-                if (DataParser.FRAME_WIDTH in subTextureObject) {
-                    subTextureFrame = new dragonBones.Rectangle();
-                    subTextureFrame.x = subTextureObject[DataParser.FRAME_X] / scale;
-                    subTextureFrame.y = subTextureObject[DataParser.FRAME_Y] / scale;
-                    subTextureFrame.width = subTextureObject[DataParser.FRAME_WIDTH] / scale;
-                    subTextureFrame.height = subTextureObject[DataParser.FRAME_HEIGHT] / scale;
-                }
-                textureAtlasData[subTextureName] = { region: subTextureRegion, frame: subTextureFrame, rotated: false };
+                    return 0 /* Play */;
             }
-            return textureAtlasData;
         };
         DataParser.DATA_VERSION_2_3 = "2.3";
         DataParser.DATA_VERSION_3_0 = "3.0";
@@ -11541,12 +11645,14 @@ var dragonBones;
         DataParser.DATA_VERSION_4_5 = "4.5";
         DataParser.DATA_VERSION_5_0 = "5.0";
         DataParser.DATA_VERSION_5_5 = "5.5";
-        DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_5;
+        DataParser.DATA_VERSION_5_6 = "5.6";
+        DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_6;
         DataParser.DATA_VERSIONS = [
             DataParser.DATA_VERSION_4_0,
             DataParser.DATA_VERSION_4_5,
             DataParser.DATA_VERSION_5_0,
-            DataParser.DATA_VERSION_5_5
+            DataParser.DATA_VERSION_5_5,
+            DataParser.DATA_VERSION_5_6
         ];
         DataParser.TEXTURE_ATLAS = "textureAtlas";
         DataParser.SUB_TEXTURE = "SubTexture";
@@ -11562,18 +11668,19 @@ var dragonBones;
         DataParser.DRADON_BONES = "dragonBones";
         DataParser.USER_DATA = "userData";
         DataParser.ARMATURE = "armature";
+        DataParser.CANVAS = "canvas";
         DataParser.BONE = "bone";
         DataParser.SURFACE = "surface";
         DataParser.SLOT = "slot";
         DataParser.CONSTRAINT = "constraint";
-        DataParser.IK = "ik";
-        DataParser.PATH_CONSTRAINT = "path";
         DataParser.SKIN = "skin";
         DataParser.DISPLAY = "display";
+        DataParser.FRAME = "frame";
+        DataParser.IK = "ik";
+        DataParser.PATH_CONSTRAINT = "path";
         DataParser.ANIMATION = "animation";
-        DataParser.Z_ORDER = "zOrder";
+        DataParser.TIMELINE = "timeline";
         DataParser.FFD = "ffd";
-        DataParser.FRAME = "frame";
         DataParser.TRANSLATE_FRAME = "translateFrame";
         DataParser.ROTATE_FRAME = "rotateFrame";
         DataParser.SCALE_FRAME = "scaleFrame";
@@ -11585,7 +11692,6 @@ var dragonBones;
         DataParser.INTS = "ints";
         DataParser.FLOATS = "floats";
         DataParser.STRINGS = "strings";
-        DataParser.CANVAS = "canvas";
         DataParser.TRANSFORM = "transform";
         DataParser.PIVOT = "pivot";
         DataParser.AABB = "aabb";
@@ -11603,6 +11709,8 @@ var dragonBones;
         DataParser.PATH = "path";
         DataParser.LENGTH = "length";
         DataParser.DISPLAY_INDEX = "displayIndex";
+        DataParser.Z_ORDER = "zOrder";
+        DataParser.Z_INDEX = "zIndex";
         DataParser.BLEND_MODE = "blendMode";
         DataParser.INHERIT_TRANSLATION = "inheritTranslation";
         DataParser.INHERIT_ROTATION = "inheritRotation";
@@ -11615,6 +11723,7 @@ var dragonBones;
         DataParser.BEND_POSITIVE = "bendPositive";
         DataParser.CHAIN = "chain";
         DataParser.WEIGHT = "weight";
+        DataParser.BLEND_TYPE = "blendType";
         DataParser.FADE_IN_TIME = "fadeInTime";
         DataParser.PLAY_TIMES = "playTimes";
         DataParser.SCALE = "scale";
@@ -11638,6 +11747,7 @@ var dragonBones;
         DataParser.VALUE = "value";
         DataParser.ROTATE = "rotate";
         DataParser.SKEW = "skew";
+        DataParser.ALPHA = "alpha";
         DataParser.ALPHA_OFFSET = "aO";
         DataParser.RED_OFFSET = "rO";
         DataParser.GREEN_OFFSET = "gO";
@@ -11652,8 +11762,6 @@ var dragonBones;
         DataParser.WEIGHTS = "weights";
         DataParser.SLOT_POSE = "slotPose";
         DataParser.BONE_POSE = "bonePose";
-        DataParser.GLUE_WEIGHTS = "glueWeights";
-        DataParser.GLUE_MESHES = "glueMeshes";
         DataParser.BONES = "bones";
         DataParser.POSITION_MODE = "positionMode";
         DataParser.SPACING_MODE = "spacingMode";
@@ -11698,7 +11806,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ObjectDataParser = /** @class */ (function (_super) {
         __extends(ObjectDataParser, _super);
@@ -11709,16 +11817,19 @@ var dragonBones;
             _this._data = null; //
             _this._armature = null; //
             _this._bone = null; //
-            _this._surface = null; //
+            _this._geometry = null; //
             _this._slot = null; //
             _this._skin = null; //
             _this._mesh = null; //
             _this._animation = null; //
             _this._timeline = null; //
             _this._rawTextureAtlases = null;
+            _this._frameValueType = 0 /* Step */;
             _this._defaultColorOffset = -1;
             _this._prevClockwise = 0;
             _this._prevRotation = 0.0;
+            _this._frameDefaultValue = 0.0;
+            _this._frameValueScale = 1.0;
             _this._helpMatrixA = new dragonBones.Matrix();
             _this._helpMatrixB = new dragonBones.Matrix();
             _this._helpTransform = new dragonBones.Transform();
@@ -11731,6 +11842,7 @@ var dragonBones;
             _this._frameFloatArray = [];
             _this._frameArray = [];
             _this._timelineArray = [];
+            _this._colorArray = [];
             _this._cacheRawMeshes = [];
             _this._cacheMeshes = [];
             _this._actionFrames = [];
@@ -11781,13 +11893,6 @@ var dragonBones;
                 var value = rawData[key];
                 var type = typeof value;
                 if (type === "string") {
-                    if (dragonBones.DragonBones.webAssembly) {
-                        for (var i = 0, l = value.length; i < l; ++i) {
-                            if (value.charCodeAt(i) > 255) {
-                                return encodeURI(value);
-                            }
-                        }
-                    }
                     return value;
                 }
                 return String(value);
@@ -11807,34 +11912,68 @@ var dragonBones;
         };
         ObjectDataParser.prototype._samplingEasingCurve = function (curve, samples) {
             var curveCount = curve.length;
-            var stepIndex = -2;
-            for (var i = 0, l = samples.length; i < l; ++i) {
-                var t = (i + 1) / (l + 1); // float
-                while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) {
-                    stepIndex += 6;
-                }
-                var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount;
-                var x1 = isInCurve ? curve[stepIndex] : 0.0;
-                var y1 = isInCurve ? curve[stepIndex + 1] : 0.0;
-                var x2 = curve[stepIndex + 2];
-                var y2 = curve[stepIndex + 3];
-                var x3 = curve[stepIndex + 4];
-                var y3 = curve[stepIndex + 5];
-                var x4 = isInCurve ? curve[stepIndex + 6] : 1.0;
-                var y4 = isInCurve ? curve[stepIndex + 7] : 1.0;
-                var lower = 0.0;
-                var higher = 1.0;
-                while (higher - lower > 0.0001) {
-                    var percentage = (higher + lower) * 0.5;
-                    this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
-                    if (t - this._helpPoint.x > 0.0) {
-                        lower = percentage;
+            if (curveCount % 3 === 1) {
+                var stepIndex = -2;
+                for (var i = 0, l = samples.length; i < l; ++i) {
+                    var t = (i + 1) / (l + 1); // float
+                    while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) {
+                        stepIndex += 6;
+                    }
+                    var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount;
+                    var x1 = isInCurve ? curve[stepIndex] : 0.0;
+                    var y1 = isInCurve ? curve[stepIndex + 1] : 0.0;
+                    var x2 = curve[stepIndex + 2];
+                    var y2 = curve[stepIndex + 3];
+                    var x3 = curve[stepIndex + 4];
+                    var y3 = curve[stepIndex + 5];
+                    var x4 = isInCurve ? curve[stepIndex + 6] : 1.0;
+                    var y4 = isInCurve ? curve[stepIndex + 7] : 1.0;
+                    var lower = 0.0;
+                    var higher = 1.0;
+                    while (higher - lower > 0.0001) {
+                        var percentage = (higher + lower) * 0.5;
+                        this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
+                        if (t - this._helpPoint.x > 0.0) {
+                            lower = percentage;
+                        }
+                        else {
+                            higher = percentage;
+                        }
                     }
-                    else {
-                        higher = percentage;
+                    samples[i] = this._helpPoint.y;
+                }
+                return true;
+            }
+            else {
+                var stepIndex = 0;
+                for (var i = 0, l = samples.length; i < l; ++i) {
+                    var t = (i + 1) / (l + 1); // float
+                    while (curve[stepIndex + 6] < t) {
+                        stepIndex += 6;
+                    }
+                    var x1 = curve[stepIndex];
+                    var y1 = curve[stepIndex + 1];
+                    var x2 = curve[stepIndex + 2];
+                    var y2 = curve[stepIndex + 3];
+                    var x3 = curve[stepIndex + 4];
+                    var y3 = curve[stepIndex + 5];
+                    var x4 = curve[stepIndex + 6];
+                    var y4 = curve[stepIndex + 7];
+                    var lower = 0.0;
+                    var higher = 1.0;
+                    while (higher - lower > 0.0001) {
+                        var percentage = (higher + lower) * 0.5;
+                        this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
+                        if (t - this._helpPoint.x > 0.0) {
+                            lower = percentage;
+                        }
+                        else {
+                            higher = percentage;
+                        }
                     }
+                    samples[i] = this._helpPoint.y;
                 }
-                samples[i] = this._helpPoint.y;
+                return false;
             }
         };
         ObjectDataParser.prototype._parseActionDataInFrame = function (rawData, frameStart, bone, slot) {
@@ -11855,7 +11994,7 @@ var dragonBones;
             }
         };
         ObjectDataParser.prototype._mergeActionFrame = function (rawData, frameStart, type, bone, slot) {
-            var actionOffset = dragonBones.DragonBones.webAssembly ? this._armature.actions.size() : this._armature.actions.length;
+            var actionOffset = this._armature.actions.length;
             var actions = this._parseActionData(rawData, type, bone, slot);
             var frameIndex = 0;
             var frame = null;
@@ -11883,7 +12022,7 @@ var dragonBones;
             if (frame === null) {
                 frame = new ActionFrame();
                 frame.frameStart = frameStart;
-                this._actionFrames.splice(frameIndex + 1, 0, frame);
+                this._actionFrames.splice(frameIndex, 0, frame);
             }
             for (var i = 0; i < actions.length; ++i) {
                 frame.actions.push(actionOffset + i);
@@ -11992,13 +12131,6 @@ var dragonBones;
                     }
                 }
             }
-            for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) {
-                var rawMeshData = this._cacheRawMeshes[i];
-                if (!(dragonBones.DataParser.GLUE_WEIGHTS in rawMeshData) || !(dragonBones.DataParser.GLUE_MESHES in rawMeshData)) {
-                    continue;
-                }
-                this._parseMeshGlue(rawMeshData, this._cacheMeshes[i]);
-            }
             for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) {
                 var rawData_1 = this._cacheRawMeshes[i];
                 var shareName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SHARE, "");
@@ -12014,7 +12146,7 @@ var dragonBones;
                     continue; // Error.
                 }
                 var mesh = this._cacheMeshes[i];
-                mesh.vertices.shareFrom(shareMesh.vertices);
+                mesh.geometry.shareFrom(shareMesh.geometry);
             }
             if (dragonBones.DataParser.ANIMATION in rawData) {
                 var rawAnimations = rawData[dragonBones.DataParser.ANIMATION];
@@ -12065,7 +12197,6 @@ var dragonBones;
         };
         ObjectDataParser.prototype._parseBone = function (rawData) {
             var type = 0 /* Bone */;
-            var scale = this._armature.scale;
             if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") {
                 type = dragonBones.DataParser._getBoneType(rawData[dragonBones.DataParser.TYPE]);
             }
@@ -12073,12 +12204,14 @@ var dragonBones;
                 type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Bone */);
             }
             if (type === 0 /* Bone */) {
+                var scale = this._armature.scale;
                 var bone = dragonBones.BaseObject.borrowObject(dragonBones.BoneData);
                 bone.inheritTranslation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_TRANSLATION, true);
                 bone.inheritRotation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_ROTATION, true);
                 bone.inheritScale = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_SCALE, true);
                 bone.inheritReflection = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_REFLECTION, true);
                 bone.length = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.LENGTH, 0) * scale;
+                bone.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
                 bone.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
                 if (dragonBones.DataParser.TRANSFORM in rawData) {
                     this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], bone.transform, scale);
@@ -12086,21 +12219,11 @@ var dragonBones;
                 return bone;
             }
             var surface = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceData);
+            surface.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
             surface.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             surface.segmentX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_X, 0);
             surface.segmentY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_Y, 0);
-            surface.vertices.length = (surface.segmentX + 1) * (surface.segmentY + 1) * 2;
-            if (dragonBones.DataParser.VERTICES in rawData) {
-                var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-                for (var i = 0, l = surface.vertices.length; i < l; ++i) {
-                    if (i < rawVertices.length) {
-                        surface.vertices[i] = rawVertices[i] * scale;
-                    }
-                    else {
-                        surface.vertices[i] = 0.0;
-                    }
-                }
-            }
+            this._parseGeometry(rawData, surface.geometry);
             return surface;
         };
         ObjectDataParser.prototype._parseIKConstraint = function (rawData) {
@@ -12112,6 +12235,7 @@ var dragonBones;
             if (target === null) {
                 return null;
             }
+            var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0);
             var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintData);
             constraint.scaleEnabled = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.SCALE, false);
             constraint.bendPositive = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true);
@@ -12119,7 +12243,6 @@ var dragonBones;
             constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             constraint.type = 0 /* IK */;
             constraint.target = target;
-            var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0);
             if (chain > 0 && bone.parent !== null) {
                 constraint.root = bone.parent;
                 constraint.bone = bone;
@@ -12179,6 +12302,8 @@ var dragonBones;
             var slot = dragonBones.BaseObject.borrowObject(dragonBones.SlotData);
             slot.displayIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0);
             slot.zOrder = zOrder;
+            slot.zIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Z_INDEX, 0);
+            slot.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
             slot.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             slot.parent = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.PARENT, "")); //
             if (dragonBones.DataParser.BLEND_MODE in rawData && typeof rawData[dragonBones.DataParser.BLEND_MODE] === "string") {
@@ -12245,13 +12370,14 @@ var dragonBones;
                 type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, type);
             }
             switch (type) {
-                case 0 /* Image */:
+                case 0 /* Image */: {
                     var imageDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ImageDisplayData);
                     imageDisplay.name = name;
                     imageDisplay.path = path.length > 0 ? path : name;
                     this._parsePivot(rawData, imageDisplay);
                     break;
-                case 1 /* Armature */:
+                }
+                case 1 /* Armature */: {
                     var armatureDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureDisplayData);
                     armatureDisplay.name = name;
                     armatureDisplay.path = path.length > 0 ? path : name;
@@ -12274,25 +12400,23 @@ var dragonBones;
                         }
                     }
                     break;
-                case 2 /* Mesh */:
+                }
+                case 2 /* Mesh */: {
                     var meshDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.MeshDisplayData);
-                    meshDisplay.vertices.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true);
+                    meshDisplay.geometry.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true);
                     meshDisplay.name = name;
                     meshDisplay.path = path.length > 0 ? path : name;
-                    meshDisplay.vertices.data = this._data;
                     if (dragonBones.DataParser.SHARE in rawData) {
+                        meshDisplay.geometry.data = this._data;
                         this._cacheRawMeshes.push(rawData);
                         this._cacheMeshes.push(meshDisplay);
                     }
                     else {
                         this._parseMesh(rawData, meshDisplay);
                     }
-                    if ((dragonBones.DataParser.GLUE_WEIGHTS in rawData) && (dragonBones.DataParser.GLUE_MESHES in rawData)) {
-                        this._cacheRawMeshes.push(rawData);
-                        this._cacheMeshes.push(meshDisplay);
-                    }
                     break;
-                case 3 /* BoundingBox */:
+                }
+                case 3 /* BoundingBox */: {
                     var boundingBox = this._parseBoundingBox(rawData);
                     if (boundingBox !== null) {
                         var boundingBoxDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.BoundingBoxDisplayData);
@@ -12301,20 +12425,21 @@ var dragonBones;
                         boundingBoxDisplay.boundingBox = boundingBox;
                     }
                     break;
-                case 4 /* Path */:
+                }
+                case 4 /* Path */: {
                     var rawCurveLengths = rawData[dragonBones.DataParser.LENGTHS];
                     var pathDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.PathDisplayData);
                     pathDisplay.closed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CLOSED, false);
                     pathDisplay.constantSpeed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CONSTANT_SPEED, false);
                     pathDisplay.name = name;
                     pathDisplay.path = path.length > 0 ? path : name;
-                    pathDisplay.vertices.data = this._data;
                     pathDisplay.curveLengths.length = rawCurveLengths.length;
                     for (var i = 0, l = rawCurveLengths.length; i < l; ++i) {
                         pathDisplay.curveLengths[i] = rawCurveLengths[i];
                     }
                     this._parsePath(rawData, pathDisplay);
                     break;
+                }
             }
             if (display !== null && dragonBones.DataParser.TRANSFORM in rawData) {
                 this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], display.transform, this._armature.scale);
@@ -12322,58 +12447,7 @@ var dragonBones;
             return display;
         };
         ObjectDataParser.prototype._parsePath = function (rawData, display) {
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var vertexCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VERTEX_COUNT, 0); // uint
-            var vertexOffset = this._floatArray.length;
-            var pathOffset = this._intArray.length;
-            display.vertices.offset = pathOffset;
-            this._intArray.length += 1 + 1;
-            this._intArray[pathOffset + 0 /* PathVertexCount */] = vertexCount;
-            this._intArray[pathOffset + 2 /* PathFloatOffset */] = vertexOffset;
-            if (!(dragonBones.DataParser.WEIGHTS in rawData)) {
-                this._floatArray.length += rawVertices.length;
-                for (var i = 0, l = rawVertices.length; i < l; ++i) {
-                    this._floatArray[vertexOffset + i] = rawVertices[i];
-                }
-            }
-            else {
-                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
-                var rawBones = rawData[dragonBones.DataParser.BONES];
-                var weightBoneCount = rawBones.length;
-                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
-                var weightOffset = this._intArray.length;
-                var floatOffset = this._floatArray.length;
-                var sortedBones = this._armature.sortedBones;
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                weight.count = weightCount;
-                weight.offset = weightOffset;
-                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
-                //
-                this._intArray[weightOffset + 0 /* WeigthBoneCount */] = weightBoneCount;
-                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
-                for (var i = 0; i < weightBoneCount; i++) {
-                    var rawBoneIndex = rawBones[i];
-                    var bone = this._rawBones[rawBoneIndex];
-                    weight.addBone(bone);
-                    this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
-                }
-                this._floatArray.length += weightCount * 3;
-                for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) {
-                    var boneCount = rawWeights[iW++];
-                    this._intArray[iB++] = boneCount;
-                    for (var j = 0; j < boneCount; j++) {
-                        var boneIndex = rawWeights[iW++];
-                        var boneWeight = rawWeights[iW++];
-                        var x = rawVertices[iV++];
-                        var y = rawVertices[iV++];
-                        this._intArray[iB++] = rawBones.indexOf(boneIndex);
-                        this._floatArray[iF++] = boneWeight;
-                        this._floatArray[iF++] = x;
-                        this._floatArray[iF++] = y;
-                    }
-                }
-                display.vertices.weight = weight;
-            }
+            this._parseGeometry(rawData, display.geometry);
         };
         ObjectDataParser.prototype._parsePivot = function (rawData, display) {
             if (dragonBones.DataParser.PIVOT in rawData) {
@@ -12387,93 +12461,15 @@ var dragonBones;
             }
         };
         ObjectDataParser.prototype._parseMesh = function (rawData, mesh) {
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var rawUVs = rawData[dragonBones.DataParser.UVS];
-            var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES];
-            var vertexCount = Math.floor(rawVertices.length / 2); // uint
-            var triangleCount = Math.floor(rawTriangles.length / 3); // uint
-            var vertexOffset = this._floatArray.length;
-            var uvOffset = vertexOffset + vertexCount * 2;
-            var meshOffset = this._intArray.length;
-            var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; // Cache pose data.
-            mesh.vertices.offset = meshOffset;
-            this._intArray.length += 1 + 1 + 1 + 1 + triangleCount * 3;
-            this._intArray[meshOffset + 0 /* MeshVertexCount */] = vertexCount;
-            this._intArray[meshOffset + 1 /* MeshTriangleCount */] = triangleCount;
-            this._intArray[meshOffset + 2 /* MeshFloatOffset */] = vertexOffset;
-            for (var i = 0, l = triangleCount * 3; i < l; ++i) {
-                this._intArray[meshOffset + 4 /* MeshVertexIndices */ + i] = rawTriangles[i];
-            }
-            this._floatArray.length += vertexCount * 2 + vertexCount * 2;
-            for (var i = 0, l = vertexCount * 2; i < l; ++i) {
-                this._floatArray[vertexOffset + i] = rawVertices[i];
-                this._floatArray[uvOffset + i] = rawUVs[i];
-            }
+            this._parseGeometry(rawData, mesh.geometry);
             if (dragonBones.DataParser.WEIGHTS in rawData) {
-                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
                 var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE];
                 var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE];
-                var sortedBones = this._armature.sortedBones;
-                var weightBoneIndices = new Array();
-                var weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint
-                var floatOffset = this._floatArray.length;
-                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
-                var weightOffset = this._intArray.length;
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                weight.count = weightCount;
-                weight.offset = weightOffset;
-                weightBoneIndices.length = weightBoneCount;
-                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
-                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
-                for (var i = 0; i < weightBoneCount; ++i) {
-                    var rawBoneIndex = rawBonePoses[i * 7]; // uint
-                    var bone = this._rawBones[rawBoneIndex];
-                    weight.addBone(bone);
-                    weightBoneIndices[i] = rawBoneIndex;
-                    this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
-                }
-                this._floatArray.length += weightCount * 3;
-                this._helpMatrixA.copyFromArray(rawSlotPose, 0);
-                for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) {
-                    var iD = i * 2;
-                    var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint
-                    var x = this._floatArray[vertexOffset + iD];
-                    var y = this._floatArray[vertexOffset + iD + 1];
-                    this._helpMatrixA.transformPoint(x, y, this._helpPoint);
-                    x = this._helpPoint.x;
-                    y = this._helpPoint.y;
-                    for (var j = 0; j < vertexBoneCount; ++j) {
-                        var rawBoneIndex = rawWeights[iW++]; // uint
-                        var boneIndex = weightBoneIndices.indexOf(rawBoneIndex);
-                        this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1);
-                        this._helpMatrixB.invert();
-                        this._helpMatrixB.transformPoint(x, y, this._helpPoint);
-                        this._intArray[iB++] = boneIndex;
-                        this._floatArray[iV++] = rawWeights[iW++];
-                        this._floatArray[iV++] = this._helpPoint.x;
-                        this._floatArray[iV++] = this._helpPoint.y;
-                    }
-                }
-                mesh.vertices.weight = weight;
+                var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name;
                 this._weightSlotPose[meshName] = rawSlotPose;
                 this._weightBonePoses[meshName] = rawBonePoses;
             }
         };
-        ObjectDataParser.prototype._parseMeshGlue = function (rawData, mesh) {
-            rawData;
-            mesh;
-            // const rawWeights = rawData[DataParser.GLUE_WEIGHTS] as Array;
-            // const rawMeshes = rawData[DataParser.GLUE_MESHES] as Array;
-            // mesh.glue = BaseObject.borrowObject(GlueData);
-            // mesh.glue.weights.length = rawWeights.length;
-            // for (let i = 0, l = rawWeights.length; i < l; ++i) {
-            //     mesh.glue.weights[i] = rawWeights[i];
-            // }
-            // for (let i = 0, l = rawMeshes.length; i < l; i += 3) {
-            //     const glueMesh = this._armature.getMesh(rawMeshes[i], rawMeshes[i + 1], rawMeshes[i + 2]);
-            //     mesh.glue.addMesh(glueMesh);
-            // }
-        };
         ObjectDataParser.prototype._parseBoundingBox = function (rawData) {
             var boundingBox = null;
             var type = 0 /* Rectangle */;
@@ -12509,23 +12505,12 @@ var dragonBones;
                 var scale = this._armature.scale;
                 var rawVertices = rawData[dragonBones.DataParser.VERTICES];
                 var vertices = polygonBoundingBox.vertices;
-                if (dragonBones.DragonBones.webAssembly) {
-                    vertices.resize(rawVertices.length, 0.0);
-                }
-                else {
-                    vertices.length = rawVertices.length;
-                }
+                vertices.length = rawVertices.length;
                 for (var i = 0, l = rawVertices.length; i < l; i += 2) {
                     var x = rawVertices[i] * scale;
                     var y = rawVertices[i + 1] * scale;
-                    if (dragonBones.DragonBones.webAssembly) {
-                        vertices.set(i, x);
-                        vertices.set(i + 1, y);
-                    }
-                    else {
-                        vertices[i] = x;
-                        vertices[i + 1] = y;
-                    }
+                    vertices[i] = x;
+                    vertices[i + 1] = y;
                     // AABB.
                     if (i === 0) {
                         polygonBoundingBox.x = x;
@@ -12558,7 +12543,8 @@ var dragonBones;
         };
         ObjectDataParser.prototype._parseAnimation = function (rawData) {
             var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData);
-            animation.frameCount = Math.max(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 1), 1);
+            animation.blendType = dragonBones.DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, ""));
+            animation.frameCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0);
             animation.playTimes = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1);
             animation.duration = animation.frameCount / this._armature.frameRate; // float
             animation.fadeInTime = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0);
@@ -12583,7 +12569,7 @@ var dragonBones;
                 }
             }
             if (dragonBones.DataParser.Z_ORDER in rawData) {
-                this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, false, false, 0, this._parseZOrderFrame);
+                this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, 0 /* Step */, 0, this._parseZOrderFrame);
             }
             if (dragonBones.DataParser.BONE in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.BONE];
@@ -12592,33 +12578,17 @@ var dragonBones;
                     this._parseBoneTimeline(rawTimeline);
                 }
             }
-            if (dragonBones.DataParser.SURFACE in rawData) {
-                var rawTimelines = rawData[dragonBones.DataParser.SURFACE];
-                for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) {
-                    var rawTimeline = rawTimelines_2[_a];
-                    var surfaceName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
-                    this._surface = this._armature.getBone(surfaceName);
-                    if (this._surface === null) {
-                        continue;
-                    }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 50 /* Surface */, false, true, 0, this._parseSurfaceFrame);
-                    if (timeline !== null) {
-                        this._animation.addSurfaceTimeline(this._surface, timeline);
-                    }
-                    this._surface = null; //
-                }
-            }
             if (dragonBones.DataParser.SLOT in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.SLOT];
-                for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) {
-                    var rawTimeline = rawTimelines_3[_b];
+                for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) {
+                    var rawTimeline = rawTimelines_2[_a];
                     this._parseSlotTimeline(rawTimeline);
                 }
             }
             if (dragonBones.DataParser.FFD in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.FFD];
-                for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) {
-                    var rawTimeline = rawTimelines_4[_c];
+                for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) {
+                    var rawTimeline = rawTimelines_3[_b];
                     var skinName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME);
                     var slotName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SLOT, "");
                     var displayName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
@@ -12630,9 +12600,9 @@ var dragonBones;
                     if (this._slot === null || this._mesh === null) {
                         continue;
                     }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, false, true, 0, this._parseSlotFFDFrame);
+                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, 2 /* Float */, 0, this._parseSlotDeformFrame);
                     if (timeline !== null) {
-                        this._animation.addSlotTimeline(this._slot, timeline);
+                        this._animation.addSlotTimeline(slotName, timeline);
                     }
                     this._slot = null; //
                     this._mesh = null; //
@@ -12640,38 +12610,184 @@ var dragonBones;
             }
             if (dragonBones.DataParser.IK in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.IK];
-                for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) {
-                    var rawTimeline = rawTimelines_5[_d];
+                for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) {
+                    var rawTimeline = rawTimelines_4[_c];
                     var constraintName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
                     var constraint = this._armature.getConstraint(constraintName);
                     if (constraint === null) {
                         continue;
                     }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, true, false, 2, this._parseIKConstraintFrame);
+                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, 1 /* Int */, 2, this._parseIKConstraintFrame);
                     if (timeline !== null) {
-                        this._animation.addConstraintTimeline(constraint, timeline);
+                        this._animation.addConstraintTimeline(constraintName, timeline);
                     }
                 }
             }
-            if (dragonBones.DataParser.ANIMATION in rawData) {
-                var rawTimelines = rawData[dragonBones.DataParser.ANIMATION];
-                for (var _e = 0, rawTimelines_6 = rawTimelines; _e < rawTimelines_6.length; _e++) {
-                    var rawTimeline = rawTimelines_6[_e];
-                    var animationName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 40 /* AnimationTime */, true, false, 2, this._parseAnimationFrame);
+            if (this._actionFrames.length > 0) {
+                this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, 0 /* Step */, 0, this._parseActionFrame);
+                this._actionFrames.length = 0;
+            }
+            if (dragonBones.DataParser.TIMELINE in rawData) {
+                var rawTimelines = rawData[dragonBones.DataParser.TIMELINE];
+                for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) {
+                    var rawTimeline = rawTimelines_5[_d];
+                    var timelineType = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */);
+                    var timelineName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
+                    var timeline = null;
+                    switch (timelineType) {
+                        case 0 /* Action */:
+                            // TODO
+                            break;
+                        case 20 /* SlotDisplay */: // TODO
+                        case 23 /* SlotZIndex */:
+                        case 60 /* BoneAlpha */:
+                        case 24 /* SlotAlpha */:
+                        case 40 /* AnimationProgress */:
+                        case 41 /* AnimationWeight */:
+                            if (timelineType === 20 /* SlotDisplay */) {
+                                this._frameValueType = 0 /* Step */;
+                                this._frameValueScale = 1.0;
+                            }
+                            else {
+                                this._frameValueType = 1 /* Int */;
+                                if (timelineType === 23 /* SlotZIndex */) {
+                                    this._frameValueScale = 1.0;
+                                }
+                                else if (timelineType === 40 /* AnimationProgress */ ||
+                                    timelineType === 41 /* AnimationWeight */) {
+                                    this._frameValueScale = 10000.0;
+                                }
+                                else {
+                                    this._frameValueScale = 100.0;
+                                }
+                            }
+                            if (timelineType === 60 /* BoneAlpha */ ||
+                                timelineType === 24 /* SlotAlpha */ ||
+                                timelineType === 41 /* AnimationWeight */) {
+                                this._frameDefaultValue = 1.0;
+                            }
+                            else {
+                                this._frameDefaultValue = 0.0;
+                            }
+                            if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) {
+                                timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData);
+                                var animaitonTimeline = timeline;
+                                animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0);
+                                animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0);
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 1, this._parseSingleValueFrame, timeline);
+                            break;
+                        case 11 /* BoneTranslate */:
+                        case 12 /* BoneRotate */:
+                        case 13 /* BoneScale */:
+                        case 30 /* IKConstraint */:
+                        case 42 /* AnimationParameter */:
+                            if (timelineType === 30 /* IKConstraint */ ||
+                                timelineType === 42 /* AnimationParameter */) {
+                                this._frameValueType = 1 /* Int */;
+                                if (timelineType === 42 /* AnimationParameter */) {
+                                    this._frameValueScale = 10000.0;
+                                }
+                                else {
+                                    this._frameValueScale = 100.0;
+                                }
+                            }
+                            else {
+                                if (timelineType === 12 /* BoneRotate */) {
+                                    this._frameValueScale = dragonBones.Transform.DEG_RAD;
+                                }
+                                else {
+                                    this._frameValueScale = 1.0;
+                                }
+                                this._frameValueType = 2 /* Float */;
+                            }
+                            if (timelineType === 13 /* BoneScale */ ||
+                                timelineType === 30 /* IKConstraint */) {
+                                this._frameDefaultValue = 1.0;
+                            }
+                            else {
+                                this._frameDefaultValue = 0.0;
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 2, this._parseDoubleValueFrame);
+                            break;
+                        case 1 /* ZOrder */:
+                            // TODO
+                            break;
+                        case 50 /* Surface */: {
+                            var surface = this._armature.getBone(timelineName);
+                            if (surface === null) {
+                                continue;
+                            }
+                            this._geometry = surface.geometry;
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame);
+                            this._geometry = null; //
+                            break;
+                        }
+                        case 22 /* SlotDeform */: {
+                            this._geometry = null; //
+                            for (var skinName in this._armature.skins) {
+                                var skin = this._armature.skins[skinName];
+                                for (var slontName in skin.displays) {
+                                    var displays = skin.displays[slontName];
+                                    for (var _e = 0, displays_1 = displays; _e < displays_1.length; _e++) {
+                                        var display = displays_1[_e];
+                                        if (display !== null && display.name === timelineName) {
+                                            this._geometry = display.geometry;
+                                            break;
+                                        }
+                                    }
+                                }
+                            }
+                            if (this._geometry === null) {
+                                continue;
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame);
+                            this._geometry = null; //
+                            break;
+                        }
+                        case 21 /* SlotColor */:
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 1 /* Int */, 1, this._parseSlotColorFrame);
+                            break;
+                    }
                     if (timeline !== null) {
-                        this._animation.addAnimationTimeline(animationName, timeline);
+                        switch (timelineType) {
+                            case 0 /* Action */:
+                                // TODO
+                                break;
+                            case 1 /* ZOrder */:
+                                // TODO
+                                break;
+                            case 11 /* BoneTranslate */:
+                            case 12 /* BoneRotate */:
+                            case 13 /* BoneScale */:
+                            case 50 /* Surface */:
+                            case 60 /* BoneAlpha */:
+                                this._animation.addBoneTimeline(timelineName, timeline);
+                                break;
+                            case 20 /* SlotDisplay */:
+                            case 21 /* SlotColor */:
+                            case 22 /* SlotDeform */:
+                            case 23 /* SlotZIndex */:
+                            case 24 /* SlotAlpha */:
+                                this._animation.addSlotTimeline(timelineName, timeline);
+                                break;
+                            case 30 /* IKConstraint */:
+                                this._animation.addConstraintTimeline(timelineName, timeline);
+                                break;
+                            case 40 /* AnimationProgress */:
+                            case 41 /* AnimationWeight */:
+                            case 42 /* AnimationParameter */:
+                                this._animation.addAnimationTimeline(timelineName, timeline);
+                                break;
+                        }
                     }
                 }
             }
-            if (this._actionFrames.length > 0) {
-                this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, false, false, 0, this._parseActionFrame);
-                this._actionFrames.length = 0;
-            }
             this._animation = null; //
             return animation;
         };
-        ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, type, addIntOffset, addFloatOffset, frameValueCount, frameParser) {
+        ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, timelineType, frameValueType, frameValueCount, frameParser, timeline) {
+            if (timeline === void 0) { timeline = null; }
             if (rawData !== null && framesKey.length > 0 && framesKey in rawData) {
                 rawFrames = rawData[framesKey];
             }
@@ -12684,8 +12800,14 @@ var dragonBones;
             }
             var frameIntArrayLength = this._frameIntArray.length;
             var frameFloatArrayLength = this._frameFloatArray.length;
-            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
             var timelineOffset = this._timelineArray.length;
+            if (timeline === null) {
+                timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
+            }
+            timeline.type = timelineType;
+            timeline.offset = timelineOffset;
+            this._frameValueType = frameValueType;
+            this._timeline = timeline;
             this._timelineArray.length += 1 + 1 + 1 + 1 + 1 + keyFrameCount;
             if (rawData !== null) {
                 this._timelineArray[timelineOffset + 0 /* TimelineScale */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0) * 100);
@@ -12697,18 +12819,17 @@ var dragonBones;
             }
             this._timelineArray[timelineOffset + 2 /* TimelineKeyFrameCount */] = keyFrameCount;
             this._timelineArray[timelineOffset + 3 /* TimelineFrameValueCount */] = frameValueCount;
-            if (addIntOffset) {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset;
-            }
-            else if (addFloatOffset) {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset;
-            }
-            else {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0;
+            switch (this._frameValueType) {
+                case 0 /* Step */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0;
+                    break;
+                case 1 /* Int */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset;
+                    break;
+                case 2 /* Float */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset;
+                    break;
             }
-            this._timeline = timeline;
-            timeline.type = type;
-            timeline.offset = timelineOffset;
             if (keyFrameCount === 1) {
                 timeline.frameIndicesOffset = -1;
                 this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + 0] = frameParser.call(this, rawFrames[0], 0, 0) - this._animation.frameOffset;
@@ -12716,15 +12837,8 @@ var dragonBones;
             else {
                 var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation.
                 var frameIndices = this._data.frameIndices;
-                var frameIndicesOffset = 0;
-                if (dragonBones.DragonBones.webAssembly) {
-                    frameIndicesOffset = frameIndices.size();
-                    frameIndices.resize(frameIndicesOffset + totalFrameCount, 0);
-                }
-                else {
-                    frameIndicesOffset = frameIndices.length;
-                    frameIndices.length += totalFrameCount;
-                }
+                var frameIndicesOffset = frameIndices.length;
+                frameIndices.length += totalFrameCount;
                 timeline.frameIndicesOffset = frameIndicesOffset;
                 for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) {
                     if (frameStart + frameCount <= i && iK < keyFrameCount) {
@@ -12744,12 +12858,7 @@ var dragonBones;
                         this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + iK] = frameParser.call(this, rawFrame, frameStart, frameCount) - this._animation.frameOffset;
                         iK++;
                     }
-                    if (dragonBones.DragonBones.webAssembly) {
-                        frameIndices.set(frameIndicesOffset + i, iK - 1);
-                    }
-                    else {
-                        frameIndices[frameIndicesOffset + i] = iK - 1;
-                    }
+                    frameIndices[frameIndicesOffset + i] = iK - 1;
                 }
             }
             this._timeline = null; //
@@ -12763,27 +12872,33 @@ var dragonBones;
             this._bone = bone;
             this._slot = this._armature.getSlot(this._bone.name);
             if (dragonBones.DataParser.TRANSLATE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, false, true, 2, this._parseBoneTranslateFrame);
+                this._frameDefaultValue = 0.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, 2 /* Float */, 2, this._parseDoubleValueFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.ROTATE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, false, true, 2, this._parseBoneRotateFrame);
+                this._frameDefaultValue = 0.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, 2 /* Float */, 2, this._parseBoneRotateFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.SCALE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, false, true, 2, this._parseBoneScaleFrame);
+                this._frameDefaultValue = 1.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, 2 /* Float */, 2, this._parseBoneScaleFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, false, true, 6, this._parseBoneAllFrame);
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, 2 /* Float */, 6, this._parseBoneAllFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             this._bone = null; //
@@ -12794,27 +12909,26 @@ var dragonBones;
             if (slot === null) {
                 return;
             }
-            this._slot = slot;
-            // Display timeline.
             var displayTimeline = null;
+            var colorTimeline = null;
+            this._slot = slot;
             if (dragonBones.DataParser.DISPLAY_FRAME in rawData) {
-                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, false, false, 0, this._parseSlotDisplayFrame);
+                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame);
             }
             else {
-                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, false, false, 0, this._parseSlotDisplayFrame);
+                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame);
             }
-            if (displayTimeline !== null) {
-                this._animation.addSlotTimeline(slot, displayTimeline);
-            }
-            var colorTimeline = null;
             if (dragonBones.DataParser.COLOR_FRAME in rawData) {
-                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, true, false, 1, this._parseSlotColorFrame);
+                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame);
             }
             else {
-                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, true, false, 1, this._parseSlotColorFrame);
+                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame);
+            }
+            if (displayTimeline !== null) {
+                this._animation.addSlotTimeline(slot.name, displayTimeline);
             }
             if (colorTimeline !== null) {
-                this._animation.addSlotTimeline(slot, colorTimeline);
+                this._animation.addSlotTimeline(slot.name, colorTimeline);
             }
             this._slot = null; //
         };
@@ -12834,10 +12948,10 @@ var dragonBones;
                 if (dragonBones.DataParser.CURVE in rawData) {
                     var sampleCount = frameCount + 1;
                     this._helpArray.length = sampleCount;
-                    this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray);
+                    var isOmited = this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray);
                     this._frameArray.length += 1 + 1 + this._helpArray.length;
                     this._frameArray[frameOffset + 1 /* FrameTweenType */] = 2 /* Curve */;
-                    this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = sampleCount;
+                    this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = isOmited ? sampleCount : -sampleCount;
                     for (var i = 0; i < sampleCount; ++i) {
                         this._frameArray[frameOffset + 3 /* FrameCurveSamples */ + i] = Math.round(this._helpArray[i] * 10000.0);
                     }
@@ -12879,6 +12993,61 @@ var dragonBones;
             }
             return frameOffset;
         };
+        ObjectDataParser.prototype._parseSingleValueFrame = function (rawData, frameStart, frameCount) {
+            var frameOffset = 0;
+            switch (this._frameValueType) {
+                case 0: {
+                    frameOffset = this._parseFrame(rawData, frameStart, frameCount);
+                    this._frameArray.length += 1;
+                    this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue);
+                    break;
+                }
+                case 1: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameIntArray.length;
+                    this._frameIntArray.length += 1;
+                    this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale);
+                    break;
+                }
+                case 2: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameFloatArray.length;
+                    this._frameFloatArray.length += 1;
+                    this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale;
+                    break;
+                }
+            }
+            return frameOffset;
+        };
+        ObjectDataParser.prototype._parseDoubleValueFrame = function (rawData, frameStart, frameCount) {
+            var frameOffset = 0;
+            switch (this._frameValueType) {
+                case 0: {
+                    frameOffset = this._parseFrame(rawData, frameStart, frameCount);
+                    this._frameArray.length += 2;
+                    this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue);
+                    this._frameArray[frameOffset + 2] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue);
+                    break;
+                }
+                case 1: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameIntArray.length;
+                    this._frameIntArray.length += 2;
+                    this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale);
+                    this._frameIntArray[frameValueOffset + 1] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale);
+                    break;
+                }
+                case 2: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameFloatArray.length;
+                    this._frameFloatArray.length += 2;
+                    this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale;
+                    this._frameFloatArray[frameValueOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale;
+                    break;
+                }
+            }
+            return frameOffset;
+        };
         ObjectDataParser.prototype._parseActionFrame = function (frame, frameStart, frameCount) {
             // tslint:disable-next-line:no-unused-expression
             frameCount;
@@ -12995,57 +13164,20 @@ var dragonBones;
             }
             this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CLOCK_WISE, 0);
             this._prevRotation = rotation;
-            //
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var frameFloatOffset = this._frameFloatArray.length;
-            this._frameFloatArray.length += 2;
-            this._frameFloatArray[frameFloatOffset++] = rotation;
-            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD;
-            return frameOffset;
-        };
-        ObjectDataParser.prototype._parseBoneScaleFrame = function (rawData, frameStart, frameCount) {
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var frameFloatOffset = this._frameFloatArray.length;
-            this._frameFloatArray.length += 2;
-            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 1.0);
-            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0);
-            return frameOffset;
-        };
-        ObjectDataParser.prototype._parseSurfaceFrame = function (rawData, frameStart, frameCount) {
-            var frameFloatOffset = this._frameFloatArray.length;
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
-            var vertexCount = this._surface.vertices.length / 2; // uint
-            var x = 0.0;
-            var y = 0.0;
-            this._frameFloatArray.length += vertexCount * 2;
-            for (var i = 0; i < vertexCount * 2; i += 2) {
-                if (i < offset || i - offset >= rawVertices.length) {
-                    x = 0.0;
-                }
-                else {
-                    x = rawVertices[i - offset];
-                }
-                if (i + 1 < offset || i + 1 - offset >= rawVertices.length) {
-                    y = 0.0;
-                }
-                else {
-                    y = rawVertices[i + 1 - offset];
-                }
-                this._frameFloatArray[frameFloatOffset + i] = x;
-                this._frameFloatArray[frameFloatOffset + i + 1] = y;
-            }
-            if (frameStart === 0) {
-                var frameIntOffset = this._frameIntArray.length;
-                this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
-                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = 0; // 
-                this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
-                this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
-                this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
-                this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset;
-                this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset;
-            }
+            //
+            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+            var frameFloatOffset = this._frameFloatArray.length;
+            this._frameFloatArray.length += 2;
+            this._frameFloatArray[frameFloatOffset++] = rotation;
+            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD;
+            return frameOffset;
+        };
+        ObjectDataParser.prototype._parseBoneScaleFrame = function (rawData, frameStart, frameCount) {
+            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+            var frameFloatOffset = this._frameFloatArray.length;
+            this._frameFloatArray.length += 2;
+            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 1.0);
+            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0);
             return frameOffset;
         };
         ObjectDataParser.prototype._parseSlotDisplayFrame = function (rawData, frameStart, frameCount) {
@@ -13069,32 +13201,32 @@ var dragonBones;
                     // tslint:disable-next-line:no-unused-expression
                     k;
                     this._parseColorTransform(rawColor, this._helpColorTransform);
-                    colorOffset = this._intArray.length;
-                    this._intArray.length += 8;
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset);
+                    colorOffset = this._colorArray.length;
+                    this._colorArray.length += 8;
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset);
                     colorOffset -= 8;
                     break;
                 }
             }
             if (colorOffset < 0) {
                 if (this._defaultColorOffset < 0) {
-                    this._defaultColorOffset = colorOffset = this._intArray.length;
-                    this._intArray.length += 8;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
+                    this._defaultColorOffset = colorOffset = this._colorArray.length;
+                    this._colorArray.length += 8;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
                 }
                 colorOffset = this._defaultColorOffset;
             }
@@ -13103,14 +13235,14 @@ var dragonBones;
             this._frameIntArray[frameIntOffset] = colorOffset;
             return frameOffset;
         };
-        ObjectDataParser.prototype._parseSlotFFDFrame = function (rawData, frameStart, frameCount) {
+        ObjectDataParser.prototype._parseSlotDeformFrame = function (rawData, frameStart, frameCount) {
             var frameFloatOffset = this._frameFloatArray.length;
             var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
             var rawVertices = dragonBones.DataParser.VERTICES in rawData ? rawData[dragonBones.DataParser.VERTICES] : null;
             var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
-            var vertexCount = this._intArray[this._mesh.vertices.offset + 0 /* MeshVertexCount */];
+            var vertexCount = this._intArray[this._mesh.geometry.offset + 0 /* GeometryVertexCount */];
             var meshName = this._mesh.parent.name + "_" + this._slot.name + "_" + this._mesh.name;
-            var weight = this._mesh.vertices.weight;
+            var weight = this._mesh.geometry.weight;
             var x = 0.0;
             var y = 0.0;
             var iB = 0;
@@ -13166,7 +13298,7 @@ var dragonBones;
             if (frameStart === 0) {
                 var frameIntOffset = this._frameIntArray.length;
                 this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
-                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.vertices.offset;
+                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.geometry.offset;
                 this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
                 this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
                 this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
@@ -13183,14 +13315,6 @@ var dragonBones;
             this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0);
             return frameOffset;
         };
-        ObjectDataParser.prototype._parseAnimationFrame = function (rawData, frameStart, frameCount) {
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var frameIntOffset = this._frameIntArray.length;
-            this._frameIntArray.length += 2;
-            this._frameIntArray[frameIntOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, 0);
-            this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0);
-            return frameOffset;
-        };
         ObjectDataParser.prototype._parseActionData = function (rawData, type, bone, slot) {
             var actions = new Array();
             if (typeof rawData === "string") {
@@ -13269,6 +13393,57 @@ var dragonBones;
             }
             return actions;
         };
+        ObjectDataParser.prototype._parseDeformFrame = function (rawData, frameStart, frameCount) {
+            var frameFloatOffset = this._frameFloatArray.length;
+            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+            var rawVertices = dragonBones.DataParser.VERTICES in rawData ?
+                rawData[dragonBones.DataParser.VERTICES] :
+                (dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : null);
+            var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
+            var vertexCount = this._intArray[this._geometry.offset + 0 /* GeometryVertexCount */];
+            var weight = this._geometry.weight;
+            var x = 0.0;
+            var y = 0.0;
+            if (weight !== null) {
+                // TODO
+            }
+            else {
+                this._frameFloatArray.length += vertexCount * 2;
+                for (var i = 0; i < vertexCount * 2; i += 2) {
+                    if (rawVertices !== null) {
+                        if (i < offset || i - offset >= rawVertices.length) {
+                            x = 0.0;
+                        }
+                        else {
+                            x = rawVertices[i - offset];
+                        }
+                        if (i + 1 < offset || i + 1 - offset >= rawVertices.length) {
+                            y = 0.0;
+                        }
+                        else {
+                            y = rawVertices[i + 1 - offset];
+                        }
+                    }
+                    else {
+                        x = 0.0;
+                        y = 0.0;
+                    }
+                    this._frameFloatArray[frameFloatOffset + i] = x;
+                    this._frameFloatArray[frameFloatOffset + i + 1] = y;
+                }
+            }
+            if (frameStart === 0) {
+                var frameIntOffset = this._frameIntArray.length;
+                this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
+                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._geometry.offset;
+                this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
+                this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
+                this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
+                this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset;
+                this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset;
+            }
+            return frameOffset;
+        };
         ObjectDataParser.prototype._parseTransform = function (rawData, transform, scale) {
             transform.x = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0) * scale;
             transform.y = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0) * scale;
@@ -13293,6 +13468,120 @@ var dragonBones;
             color.greenOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_OFFSET, 0);
             color.blueOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_OFFSET, 0);
         };
+        ObjectDataParser.prototype._parseGeometry = function (rawData, geometry) {
+            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
+            var vertexCount = Math.floor(rawVertices.length / 2); // uint
+            var triangleCount = 0;
+            var geometryOffset = this._intArray.length;
+            var verticesOffset = this._floatArray.length;
+            //
+            geometry.offset = geometryOffset;
+            geometry.data = this._data;
+            //
+            this._intArray.length += 1 + 1 + 1 + 1;
+            this._intArray[geometryOffset + 0 /* GeometryVertexCount */] = vertexCount;
+            this._intArray[geometryOffset + 2 /* GeometryFloatOffset */] = verticesOffset;
+            this._intArray[geometryOffset + 3 /* GeometryWeightOffset */] = -1; //
+            // 
+            this._floatArray.length += vertexCount * 2;
+            for (var i = 0, l = vertexCount * 2; i < l; ++i) {
+                this._floatArray[verticesOffset + i] = rawVertices[i];
+            }
+            if (dragonBones.DataParser.TRIANGLES in rawData) {
+                var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES];
+                triangleCount = Math.floor(rawTriangles.length / 3); // uint
+                //
+                this._intArray.length += triangleCount * 3;
+                for (var i = 0, l = triangleCount * 3; i < l; ++i) {
+                    this._intArray[geometryOffset + 4 /* GeometryVertexIndices */ + i] = rawTriangles[i];
+                }
+            }
+            // Fill triangle count.
+            this._intArray[geometryOffset + 1 /* GeometryTriangleCount */] = triangleCount;
+            if (dragonBones.DataParser.UVS in rawData) {
+                var rawUVs = rawData[dragonBones.DataParser.UVS];
+                var uvOffset = verticesOffset + vertexCount * 2;
+                this._floatArray.length += vertexCount * 2;
+                for (var i = 0, l = vertexCount * 2; i < l; ++i) {
+                    this._floatArray[uvOffset + i] = rawUVs[i];
+                }
+            }
+            if (dragonBones.DataParser.WEIGHTS in rawData) {
+                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
+                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
+                var weightOffset = this._intArray.length;
+                var floatOffset = this._floatArray.length;
+                var weightBoneCount = 0;
+                var sortedBones = this._armature.sortedBones;
+                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
+                weight.count = weightCount;
+                weight.offset = weightOffset;
+                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
+                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
+                if (dragonBones.DataParser.BONE_POSE in rawData) {
+                    var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE];
+                    var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE];
+                    var weightBoneIndices = new Array();
+                    weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint
+                    weightBoneIndices.length = weightBoneCount;
+                    for (var i = 0; i < weightBoneCount; ++i) {
+                        var rawBoneIndex = rawBonePoses[i * 7]; // uint
+                        var bone = this._rawBones[rawBoneIndex];
+                        weight.addBone(bone);
+                        weightBoneIndices[i] = rawBoneIndex;
+                        this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
+                    }
+                    this._floatArray.length += weightCount * 3;
+                    this._helpMatrixA.copyFromArray(rawSlotPose, 0);
+                    for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) {
+                        var iD = i * 2;
+                        var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint
+                        var x = this._floatArray[verticesOffset + iD];
+                        var y = this._floatArray[verticesOffset + iD + 1];
+                        this._helpMatrixA.transformPoint(x, y, this._helpPoint);
+                        x = this._helpPoint.x;
+                        y = this._helpPoint.y;
+                        for (var j = 0; j < vertexBoneCount; ++j) {
+                            var rawBoneIndex = rawWeights[iW++]; // uint
+                            var boneIndex = weightBoneIndices.indexOf(rawBoneIndex);
+                            this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1);
+                            this._helpMatrixB.invert();
+                            this._helpMatrixB.transformPoint(x, y, this._helpPoint);
+                            this._intArray[iB++] = boneIndex;
+                            this._floatArray[iV++] = rawWeights[iW++];
+                            this._floatArray[iV++] = this._helpPoint.x;
+                            this._floatArray[iV++] = this._helpPoint.y;
+                        }
+                    }
+                }
+                else {
+                    var rawBones = rawData[dragonBones.DataParser.BONES];
+                    weightBoneCount = rawBones.length;
+                    for (var i = 0; i < weightBoneCount; i++) {
+                        var rawBoneIndex = rawBones[i];
+                        var bone = this._rawBones[rawBoneIndex];
+                        weight.addBone(bone);
+                        this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
+                    }
+                    this._floatArray.length += weightCount * 3;
+                    for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) {
+                        var vertexBoneCount = rawWeights[iW++];
+                        this._intArray[iB++] = vertexBoneCount;
+                        for (var j = 0; j < vertexBoneCount; j++) {
+                            var boneIndex = rawWeights[iW++];
+                            var boneWeight = rawWeights[iW++];
+                            var x = rawVertices[iV++];
+                            var y = rawVertices[iV++];
+                            this._intArray[iB++] = rawBones.indexOf(boneIndex);
+                            this._floatArray[iF++] = boneWeight;
+                            this._floatArray[iF++] = x;
+                            this._floatArray[iF++] = y;
+                        }
+                    }
+                }
+                geometry.weight = weight;
+            }
+        };
         ObjectDataParser.prototype._parseArray = function (rawData) {
             // tslint:disable-next-line:no-unused-expression
             rawData;
@@ -13302,6 +13591,7 @@ var dragonBones;
             this._frameFloatArray.length = 0;
             this._frameArray.length = 0;
             this._timelineArray.length = 0;
+            this._colorArray.length = 0;
         };
         ObjectDataParser.prototype._modifyArray = function () {
             // Align.
@@ -13317,76 +13607,55 @@ var dragonBones;
             if ((this._timelineArray.length % Uint16Array.BYTES_PER_ELEMENT) !== 0) {
                 this._timelineArray.push(0);
             }
+            if ((this._timelineArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) {
+                this._colorArray.push(0);
+            }
             var l1 = this._intArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l2 = this._floatArray.length * Float32Array.BYTES_PER_ELEMENT;
             var l3 = this._frameIntArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l4 = this._frameFloatArray.length * Float32Array.BYTES_PER_ELEMENT;
             var l5 = this._frameArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l6 = this._timelineArray.length * Uint16Array.BYTES_PER_ELEMENT;
-            var lTotal = l1 + l2 + l3 + l4 + l5 + l6;
-            if (dragonBones.DragonBones.webAssembly) {
-                var shareBuffer = dragonBones.webAssemblyModule.HEAP16.buffer;
-                var bufferPointer = dragonBones.webAssemblyModule._malloc(lTotal);
-                var intArray = new Int16Array(shareBuffer, bufferPointer, this._intArray.length);
-                var floatArray = new Float32Array(shareBuffer, bufferPointer + l1, this._floatArray.length);
-                var frameIntArray = new Int16Array(shareBuffer, bufferPointer + l1 + l2, this._frameIntArray.length);
-                var frameFloatArray = new Float32Array(shareBuffer, bufferPointer + l1 + l2 + l3, this._frameFloatArray.length);
-                var frameArray = new Int16Array(shareBuffer, bufferPointer + l1 + l2 + l3 + l4, this._frameArray.length);
-                var timelineArray = new Uint16Array(shareBuffer, bufferPointer + l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
-                for (var i = 0, l = this._intArray.length; i < l; ++i) {
-                    intArray[i] = this._intArray[i];
-                }
-                for (var i = 0, l = this._floatArray.length; i < l; ++i) {
-                    floatArray[i] = this._floatArray[i];
-                }
-                for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
-                    frameIntArray[i] = this._frameIntArray[i];
-                }
-                for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
-                    frameFloatArray[i] = this._frameFloatArray[i];
-                }
-                for (var i = 0, l = this._frameArray.length; i < l; ++i) {
-                    frameArray[i] = this._frameArray[i];
-                }
-                for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
-                    timelineArray[i] = this._timelineArray[i];
-                }
-                dragonBones.webAssemblyModule.setDataBinary(this._data, bufferPointer, l1, l2, l3, l4, l5, l6);
-            }
-            else {
-                var binary = new ArrayBuffer(lTotal);
-                var intArray = new Int16Array(binary, 0, this._intArray.length);
-                var floatArray = new Float32Array(binary, l1, this._floatArray.length);
-                var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length);
-                var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length);
-                var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length);
-                var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
-                for (var i = 0, l = this._intArray.length; i < l; ++i) {
-                    intArray[i] = this._intArray[i];
-                }
-                for (var i = 0, l = this._floatArray.length; i < l; ++i) {
-                    floatArray[i] = this._floatArray[i];
-                }
-                for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
-                    frameIntArray[i] = this._frameIntArray[i];
-                }
-                for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
-                    frameFloatArray[i] = this._frameFloatArray[i];
-                }
-                for (var i = 0, l = this._frameArray.length; i < l; ++i) {
-                    frameArray[i] = this._frameArray[i];
-                }
-                for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
-                    timelineArray[i] = this._timelineArray[i];
-                }
-                this._data.binary = binary;
-                this._data.intArray = intArray;
-                this._data.floatArray = floatArray;
-                this._data.frameIntArray = frameIntArray;
-                this._data.frameFloatArray = frameFloatArray;
-                this._data.frameArray = frameArray;
-                this._data.timelineArray = timelineArray;
-            }
+            var l7 = this._colorArray.length * Int16Array.BYTES_PER_ELEMENT;
+            var lTotal = l1 + l2 + l3 + l4 + l5 + l6 + l7;
+            //
+            var binary = new ArrayBuffer(lTotal);
+            var intArray = new Int16Array(binary, 0, this._intArray.length);
+            var floatArray = new Float32Array(binary, l1, this._floatArray.length);
+            var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length);
+            var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length);
+            var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length);
+            var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
+            var colorArray = new Int16Array(binary, l1 + l2 + l3 + l4 + l5 + l6, this._colorArray.length);
+            for (var i = 0, l = this._intArray.length; i < l; ++i) {
+                intArray[i] = this._intArray[i];
+            }
+            for (var i = 0, l = this._floatArray.length; i < l; ++i) {
+                floatArray[i] = this._floatArray[i];
+            }
+            for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
+                frameIntArray[i] = this._frameIntArray[i];
+            }
+            for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
+                frameFloatArray[i] = this._frameFloatArray[i];
+            }
+            for (var i = 0, l = this._frameArray.length; i < l; ++i) {
+                frameArray[i] = this._frameArray[i];
+            }
+            for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
+                timelineArray[i] = this._timelineArray[i];
+            }
+            for (var i = 0, l = this._colorArray.length; i < l; ++i) {
+                colorArray[i] = this._colorArray[i];
+            }
+            this._data.binary = binary;
+            this._data.intArray = intArray;
+            this._data.floatArray = floatArray;
+            this._data.frameIntArray = frameIntArray;
+            this._data.frameFloatArray = frameFloatArray;
+            this._data.frameArray = frameArray;
+            this._data.timelineArray = timelineArray;
+            this._data.colorArray = colorArray;
             this._defaultColorOffset = -1;
         };
         ObjectDataParser.prototype.parseDragonBonesData = function (rawData, scale) {
@@ -13459,6 +13728,8 @@ var dragonBones;
                 var rawTextures = rawData[dragonBones.DataParser.SUB_TEXTURE];
                 for (var i = 0, l = rawTextures.length; i < l; ++i) {
                     var rawTexture = rawTextures[i];
+                    var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0);
+                    var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0);
                     var textureData = textureAtlasData.createTexture();
                     textureData.rotated = ObjectDataParser._getBoolean(rawTexture, dragonBones.DataParser.ROTATED, false);
                     textureData.name = ObjectDataParser._getString(rawTexture, dragonBones.DataParser.NAME, "");
@@ -13466,8 +13737,6 @@ var dragonBones;
                     textureData.region.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.Y, 0.0);
                     textureData.region.width = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.WIDTH, 0.0);
                     textureData.region.height = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.HEIGHT, 0.0);
-                    var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0);
-                    var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0);
                     if (frameWidth > 0.0 && frameHeight > 0.0) {
                         textureData.frame = dragonBones.TextureData.createRectangle();
                         textureData.frame.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_X, 0.0);
@@ -13501,7 +13770,7 @@ var dragonBones;
     }(dragonBones.DataParser));
     dragonBones.ObjectDataParser = ObjectDataParser;
     /**
-     * @internal
+     * @private
      */
     var ActionFrame = /** @class */ (function () {
         function ActionFrame() {
@@ -13537,7 +13806,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var BinaryDataParser = /** @class */ (function (_super) {
         __extends(BinaryDataParser, _super);
@@ -13640,14 +13909,6 @@ var dragonBones;
             }
             return result;
         };
-        BinaryDataParser.prototype._getUTF16Key = function (value) {
-            for (var i = 0, l = value.length; i < l; ++i) {
-                if (value.charCodeAt(i) > 255) {
-                    return encodeURI(value);
-                }
-            }
-            return value;
-        };
         BinaryDataParser.prototype._parseBinaryTimeline = function (type, offset, timelineData) {
             if (timelineData === void 0) { timelineData = null; }
             var timeline = timelineData !== null ? timelineData : dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
@@ -13662,14 +13923,8 @@ var dragonBones;
                 var frameIndicesOffset = 0;
                 var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation.
                 var frameIndices = this._data.frameIndices;
-                if (dragonBones.DragonBones.webAssembly) {
-                    frameIndicesOffset = frameIndices.size();
-                    frameIndices.resize(frameIndicesOffset + totalFrameCount, 0);
-                }
-                else {
-                    frameIndicesOffset = frameIndices.length;
-                    frameIndices.length += totalFrameCount;
-                }
+                frameIndicesOffset = frameIndices.length;
+                frameIndices.length += totalFrameCount;
                 timeline.frameIndicesOffset = frameIndicesOffset;
                 for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) {
                     if (frameStart + frameCount <= i && iK < keyFrameCount) {
@@ -13682,49 +13937,16 @@ var dragonBones;
                         }
                         iK++;
                     }
-                    if (dragonBones.DragonBones.webAssembly) {
-                        frameIndices.set(frameIndicesOffset + i, iK - 1);
-                    }
-                    else {
-                        frameIndices[frameIndicesOffset + i] = iK - 1;
-                    }
+                    frameIndices[frameIndicesOffset + i] = iK - 1;
                 }
             }
             this._timeline = null; //
             return timeline;
         };
-        BinaryDataParser.prototype._parseVertices = function (rawData, vertices) {
-            vertices.offset = rawData[dragonBones.DataParser.OFFSET];
-            var weightOffset = this._intArrayBuffer[vertices.offset + 3 /* MeshWeightOffset */];
-            if (weightOffset >= 0) {
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                var vertexCount = this._intArrayBuffer[vertices.offset + 0 /* MeshVertexCount */];
-                var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */];
-                weight.offset = weightOffset;
-                for (var i = 0; i < boneCount; ++i) {
-                    var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i];
-                    weight.addBone(this._rawBones[boneIndex]);
-                }
-                var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount;
-                var weightCount = 0;
-                for (var i = 0, l = vertexCount; i < l; ++i) {
-                    var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++];
-                    weightCount += vertexBoneCount;
-                    boneIndicesOffset += vertexBoneCount;
-                }
-                weight.count = weightCount;
-                vertices.weight = weight;
-            }
-        };
-        BinaryDataParser.prototype._parseMesh = function (rawData, mesh) {
-            this._parseVertices(rawData, mesh.vertices);
-        };
-        BinaryDataParser.prototype._parsePath = function (rawData, path) {
-            this._parseVertices(rawData, path.vertices);
-        };
         BinaryDataParser.prototype._parseAnimation = function (rawData) {
             var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData);
-            animation.frameCount = Math.max(dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 1), 1);
+            animation.blendType = dragonBones.DataParser._getAnimationBlendType(dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, ""));
+            animation.frameCount = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0);
             animation.playTimes = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1);
             animation.duration = animation.frameCount / this._armature.frameRate; // float
             animation.fadeInTime = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0);
@@ -13749,9 +13971,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.BONE];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var bone = this._armature.getBone(k);
                     if (bone === null) {
                         continue;
@@ -13760,26 +13979,7 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addBoneTimeline(bone, timeline);
-                    }
-                }
-            }
-            if (dragonBones.DataParser.SURFACE in rawData) {
-                var rawTimeliness = rawData[dragonBones.DataParser.SURFACE];
-                for (var k in rawTimeliness) {
-                    var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
-                    var surface = this._armature.getBone(k);
-                    if (surface === null) {
-                        continue;
-                    }
-                    for (var i = 0, l = rawTimelines.length; i < l; i += 2) {
-                        var timelineType = rawTimelines[i];
-                        var timelineOffset = rawTimelines[i + 1];
-                        var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addSurfaceTimeline(surface, timeline);
+                        this._animation.addBoneTimeline(bone.name, timeline);
                     }
                 }
             }
@@ -13787,9 +13987,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.SLOT];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var slot = this._armature.getSlot(k);
                     if (slot === null) {
                         continue;
@@ -13798,7 +13995,7 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addSlotTimeline(slot, timeline);
+                        this._animation.addSlotTimeline(slot.name, timeline);
                     }
                 }
             }
@@ -13806,9 +14003,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.CONSTRAINT];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var constraint = this._armature.getConstraint(k);
                     if (constraint === null) {
                         continue;
@@ -13817,28 +14011,86 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addConstraintTimeline(constraint, timeline);
-                    }
-                }
-            }
-            if (dragonBones.DataParser.ANIMATION in rawData) {
-                var rawTimeliness = rawData[dragonBones.DataParser.ANIMATION];
-                for (var k in rawTimeliness) {
-                    var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
-                    for (var i = 0, l = rawTimelines.length; i < l; i += 2) {
-                        var timelineType = rawTimelines[i];
-                        var timelineOffset = rawTimelines[i + 1];
-                        var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addAnimationTimeline(k, timeline);
+                        this._animation.addConstraintTimeline(constraint.name, timeline);
+                    }
+                }
+            }
+            if (dragonBones.DataParser.TIMELINE in rawData) {
+                var rawTimelines = rawData[dragonBones.DataParser.TIMELINE];
+                for (var _i = 0, rawTimelines_6 = rawTimelines; _i < rawTimelines_6.length; _i++) {
+                    var rawTimeline = rawTimelines_6[_i];
+                    var timelineOffset = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.OFFSET, 0);
+                    if (timelineOffset >= 0) {
+                        var timelineType = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */);
+                        var timelineName = dragonBones.ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
+                        var timeline = null;
+                        if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) {
+                            timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData);
+                            var animaitonTimeline = timeline;
+                            animaitonTimeline.x = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0);
+                            animaitonTimeline.y = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0);
+                        }
+                        timeline = this._parseBinaryTimeline(timelineType, timelineOffset, timeline);
+                        switch (timelineType) {
+                            case 0 /* Action */:
+                                // TODO
+                                break;
+                            case 1 /* ZOrder */:
+                                // TODO
+                                break;
+                            case 11 /* BoneTranslate */:
+                            case 12 /* BoneRotate */:
+                            case 13 /* BoneScale */:
+                            case 50 /* Surface */:
+                            case 60 /* BoneAlpha */:
+                                this._animation.addBoneTimeline(timelineName, timeline);
+                                break;
+                            case 20 /* SlotDisplay */:
+                            case 21 /* SlotColor */:
+                            case 22 /* SlotDeform */:
+                            case 23 /* SlotZIndex */:
+                            case 24 /* SlotAlpha */:
+                                this._animation.addSlotTimeline(timelineName, timeline);
+                                break;
+                            case 30 /* IKConstraint */:
+                                this._animation.addConstraintTimeline(timelineName, timeline);
+                                break;
+                            case 40 /* AnimationProgress */:
+                            case 41 /* AnimationWeight */:
+                            case 42 /* AnimationParameter */:
+                                this._animation.addAnimationTimeline(timelineName, timeline);
+                                break;
+                        }
                     }
                 }
             }
             this._animation = null;
             return animation;
         };
+        BinaryDataParser.prototype._parseGeometry = function (rawData, geometry) {
+            geometry.offset = rawData[dragonBones.DataParser.OFFSET];
+            geometry.data = this._data;
+            var weightOffset = this._intArrayBuffer[geometry.offset + 3 /* GeometryWeightOffset */];
+            if (weightOffset >= 0) {
+                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
+                var vertexCount = this._intArrayBuffer[geometry.offset + 0 /* GeometryVertexCount */];
+                var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */];
+                weight.offset = weightOffset;
+                for (var i = 0; i < boneCount; ++i) {
+                    var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i];
+                    weight.addBone(this._rawBones[boneIndex]);
+                }
+                var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount;
+                var weightCount = 0;
+                for (var i = 0, l = vertexCount; i < l; ++i) {
+                    var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++];
+                    weightCount += vertexBoneCount;
+                    boneIndicesOffset += vertexBoneCount;
+                }
+                weight.count = weightCount;
+                geometry.weight = weight;
+            }
+        };
         BinaryDataParser.prototype._parseArray = function (rawData) {
             var offsets = rawData[dragonBones.DataParser.OFFSET];
             var l1 = offsets[1];
@@ -13847,37 +14099,22 @@ var dragonBones;
             var l4 = offsets[7];
             var l5 = offsets[9];
             var l6 = offsets[11];
+            var l7 = offsets.length > 12 ? offsets[13] : 0; // Color.
             var intArray = new Int16Array(this._binary, this._binaryOffset + offsets[0], l1 / Int16Array.BYTES_PER_ELEMENT);
             var floatArray = new Float32Array(this._binary, this._binaryOffset + offsets[2], l2 / Float32Array.BYTES_PER_ELEMENT);
             var frameIntArray = new Int16Array(this._binary, this._binaryOffset + offsets[4], l3 / Int16Array.BYTES_PER_ELEMENT);
             var frameFloatArray = new Float32Array(this._binary, this._binaryOffset + offsets[6], l4 / Float32Array.BYTES_PER_ELEMENT);
             var frameArray = new Int16Array(this._binary, this._binaryOffset + offsets[8], l5 / Int16Array.BYTES_PER_ELEMENT);
             var timelineArray = new Uint16Array(this._binary, this._binaryOffset + offsets[10], l6 / Uint16Array.BYTES_PER_ELEMENT);
-            if (dragonBones.DragonBones.webAssembly) {
-                var lTotal = l1 + l2 + l3 + l4 + l5 + l6;
-                var bufferPointer = dragonBones.webAssemblyModule._malloc(lTotal);
-                var rawArray = new Uint8Array(this._binary, this._binaryOffset, lTotal / Uint8Array.BYTES_PER_ELEMENT);
-                var copyArray = new Uint8Array(dragonBones.webAssemblyModule.HEAP16.buffer, bufferPointer, rawArray.length);
-                for (var i = 0, l = rawArray.length; i < l; ++i) {
-                    copyArray[i] = rawArray[i];
-                }
-                dragonBones.webAssemblyModule.setDataBinary(this._data, bufferPointer, l1, l2, l3, l4, l5, l6);
-                this._intArrayBuffer = intArray;
-                this._floatArrayBuffer = floatArray;
-                this._frameIntArrayBuffer = frameIntArray;
-                this._frameFloatArrayBuffer = frameFloatArray;
-                this._frameArrayBuffer = frameArray;
-                this._timelineArrayBuffer = timelineArray;
-            }
-            else {
-                this._data.binary = this._binary;
-                this._data.intArray = this._intArrayBuffer = intArray;
-                this._data.floatArray = this._floatArrayBuffer = floatArray;
-                this._data.frameIntArray = this._frameIntArrayBuffer = frameIntArray;
-                this._data.frameFloatArray = this._frameFloatArrayBuffer = frameFloatArray;
-                this._data.frameArray = this._frameArrayBuffer = frameArray;
-                this._data.timelineArray = this._timelineArrayBuffer = timelineArray;
-            }
+            var colorArray = l7 > 0 ? new Int16Array(this._binary, this._binaryOffset + offsets[12], l7 / Int16Array.BYTES_PER_ELEMENT) : intArray; // Color.
+            this._data.binary = this._binary;
+            this._data.intArray = this._intArrayBuffer = intArray;
+            this._data.floatArray = floatArray;
+            this._data.frameIntArray = frameIntArray;
+            this._data.frameFloatArray = frameFloatArray;
+            this._data.frameArray = this._frameArrayBuffer = frameArray;
+            this._data.timelineArray = this._timelineArrayBuffer = timelineArray;
+            this._data.colorArray = colorArray;
         };
         BinaryDataParser.prototype.parseDragonBonesData = function (rawData, scale) {
             if (scale === void 0) { scale = 1; }
@@ -14101,20 +14338,23 @@ var dragonBones;
                 var slotData = _a[_i];
                 var displayDatas = slotData.name in skinSlots ? skinSlots[slotData.name] : null;
                 var slot = this._buildSlot(dataPackage, slotData, armature);
-                slot.rawDisplayDatas = displayDatas;
                 if (displayDatas !== null) {
-                    var displayList = new Array();
-                    // for (const displayData of displays) 
-                    for (var i = 0, l = dragonBones.DragonBones.webAssembly ? displayDatas.size() : displayDatas.length; i < l; ++i) {
-                        var displayData = dragonBones.DragonBones.webAssembly ? displayDatas.get(i) : displayDatas[i];
+                    slot.displayFrameCount = displayDatas.length;
+                    for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                        var displayData = displayDatas[i];
+                        slot.replaceRawDisplayData(displayData, i);
                         if (displayData !== null) {
-                            displayList.push(this._getSlotDisplay(dataPackage, displayData, null, slot));
+                            if (dataPackage.textureAtlasName.length > 0) {
+                                var textureData = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
+                                slot.replaceTextureData(textureData, i);
+                            }
+                            var display = this._getSlotDisplay(dataPackage, displayData, slot);
+                            slot.replaceDisplay(display, i);
                         }
                         else {
-                            displayList.push(null);
+                            slot.replaceDisplay(null);
                         }
                     }
-                    slot._setDisplayList(displayList);
                 }
                 slot._setDisplayIndex(slotData.displayIndex, true);
             }
@@ -14143,12 +14383,10 @@ var dragonBones;
                 }
             }
         };
-        BaseFactory.prototype._buildChildArmature = function (dataPackage, slot, displayData) {
-            // tslint:disable-next-line:no-unused-expression
-            slot;
+        BaseFactory.prototype._buildChildArmature = function (dataPackage, _slot, displayData) {
             return this.buildArmature(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage !== null ? dataPackage.textureAtlasName : "");
         };
-        BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, rawDisplayData, slot) {
+        BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, slot) {
             var dataName = dataPackage !== null ? dataPackage.dataName : displayData.parent.parent.parent.name;
             var display = null;
             switch (displayData.type) {
@@ -14157,15 +14395,7 @@ var dragonBones;
                     if (imageDisplayData.texture === null) {
                         imageDisplayData.texture = this._getTextureData(dataName, displayData.path);
                     }
-                    else if (dataPackage !== null && dataPackage.textureAtlasName.length > 0) {
-                        imageDisplayData.texture = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
-                    }
-                    if (rawDisplayData !== null && rawDisplayData.type === 2 /* Mesh */ && this._isSupportMesh()) {
-                        display = slot.meshDisplay;
-                    }
-                    else {
-                        display = slot.rawDisplay;
-                    }
+                    display = slot.rawDisplay;
                     break;
                 }
                 case 2 /* Mesh */: {
@@ -14173,9 +14403,6 @@ var dragonBones;
                     if (meshDisplayData.texture === null) {
                         meshDisplayData.texture = this._getTextureData(dataName, meshDisplayData.path);
                     }
-                    else if (dataPackage !== null && dataPackage.textureAtlasName.length > 0) {
-                        meshDisplayData.texture = this._getTextureData(dataPackage.textureAtlasName, meshDisplayData.path);
-                    }
                     if (this._isSupportMesh()) {
                         display = slot.meshDisplay;
                     }
@@ -14186,7 +14413,7 @@ var dragonBones;
                 }
                 case 1 /* Armature */: {
                     var armatureDisplayData = displayData;
-                    var childArmature = this._buildChildArmature(dataPackage, slot, displayData);
+                    var childArmature = this._buildChildArmature(dataPackage, slot, armatureDisplayData);
                     if (childArmature !== null) {
                         childArmature.inheritAnimation = armatureDisplayData.inheritAnimation;
                         if (!childArmature.inheritAnimation) {
@@ -14300,9 +14527,20 @@ var dragonBones;
             return textureAtlasData;
         };
         /**
-         * @private
+         * - Update texture atlases.
+         * @param textureAtlases - The texture atlas objects.
+         * @param name - The texture atlas name.
+         * @version DragonBones 5.7
+         * @language en_US
+         */
+        /**
+         * - 更新贴图集对象。
+         * @param textureAtlases - 多个贴图集对象。
+         * @param name - 贴图集名称。
+         * @version DragonBones 5.7
+         * @language zh_CN
          */
-        BaseFactory.prototype.updateTextureAtlasData = function (name, textureAtlases) {
+        BaseFactory.prototype.updateTextureAtlases = function (textureAtlases, name) {
             var textureAtlasDatas = this.getTextureAtlasData(name);
             if (textureAtlasDatas !== null) {
                 for (var i = 0, l = textureAtlasDatas.length; i < l; ++i) {
@@ -14608,36 +14846,20 @@ var dragonBones;
                 displayIndex = 0;
             }
             slot.replaceDisplayData(displayData, displayIndex);
-            var displayList = slot.displayList; // Copy.
-            if (displayList.length <= displayIndex) {
-                displayList.length = displayIndex + 1;
-                for (var i = 0, l = displayList.length; i < l; ++i) {
-                    if (!displayList[i]) {
-                        displayList[i] = null;
-                    }
-                }
-            }
             if (displayData !== null) {
-                var rawDisplayDatas = slot.rawDisplayDatas;
-                var rawDisplayData = null;
-                if (rawDisplayDatas) {
-                    if (dragonBones.DragonBones.webAssembly) {
-                        if (displayIndex < rawDisplayDatas.size()) {
-                            rawDisplayData = rawDisplayDatas.get(displayIndex);
-                        }
-                    }
-                    else {
-                        if (displayIndex < rawDisplayDatas.length) {
-                            rawDisplayData = rawDisplayDatas[displayIndex];
-                        }
+                var display = this._getSlotDisplay(null, displayData, slot);
+                if (displayData.type === 0 /* Image */) {
+                    var rawDisplayData = slot.getDisplayFrameAt(displayIndex).rawDisplayData;
+                    if (rawDisplayData !== null &&
+                        rawDisplayData.type === 2 /* Mesh */) {
+                        display = slot.meshDisplay;
                     }
                 }
-                displayList[displayIndex] = this._getSlotDisplay(null, displayData, rawDisplayData, slot);
+                slot.replaceDisplay(display, displayIndex);
             }
             else {
-                displayList[displayIndex] = null;
+                slot.replaceDisplay(null, displayIndex);
             }
-            slot.displayList = displayList;
         };
         /**
          * - Replaces the current display data for a particular slot with a specific display data.
@@ -14676,13 +14898,10 @@ var dragonBones;
         BaseFactory.prototype.replaceSlotDisplay = function (dragonBonesName, armatureName, slotName, displayName, slot, displayIndex) {
             if (displayIndex === void 0) { displayIndex = -1; }
             var armatureData = this.getArmatureData(armatureName, dragonBonesName || "");
-            if (!armatureData || !armatureData.defaultSkin) {
+            if (armatureData === null || armatureData.defaultSkin === null) {
                 return false;
             }
             var displayData = armatureData.defaultSkin.getDisplay(slotName, displayName);
-            if (!displayData) {
-                return false;
-            }
             this.replaceDisplay(slot, displayData, displayIndex);
             return true;
         };
@@ -14694,15 +14913,14 @@ var dragonBones;
             if (!armatureData || !armatureData.defaultSkin) {
                 return false;
             }
-            var displays = armatureData.defaultSkin.getDisplays(slotName);
-            if (!displays) {
+            var displayDatas = armatureData.defaultSkin.getDisplays(slotName);
+            if (!displayDatas) {
                 return false;
             }
-            var displayIndex = 0;
-            // for (const displayData of displays) 
-            for (var i = 0, l = dragonBones.DragonBones.webAssembly ? displays.size() : displays.length; i < l; ++i) {
-                var displayData = dragonBones.DragonBones.webAssembly ? displays.get(i) : displays[i];
-                this.replaceDisplay(slot, displayData, displayIndex++);
+            slot.displayFrameCount = displayDatas.length;
+            for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                var displayData = displayDatas[i];
+                this.replaceDisplay(slot, displayData, i);
             }
             return true;
         };
@@ -14754,34 +14972,30 @@ var dragonBones;
                 if (exclude !== null && exclude.indexOf(slot.name) >= 0) {
                     continue;
                 }
-                var displays = skin.getDisplays(slot.name);
-                if (!displays) {
+                var displayDatas = skin.getDisplays(slot.name);
+                if (displayDatas === null) {
                     if (defaultSkin !== null && skin !== defaultSkin) {
-                        displays = defaultSkin.getDisplays(slot.name);
+                        displayDatas = defaultSkin.getDisplays(slot.name);
                     }
-                    if (!displays) {
+                    if (displayDatas === null) {
                         if (isOverride) {
-                            slot.rawDisplayDatas = null;
-                            slot.displayList = []; //
+                            slot.displayFrameCount = 0;
                         }
                         continue;
                     }
                 }
-                var displayCount = dragonBones.DragonBones.webAssembly ? displays.size() : displays.length;
-                var displayList = slot.displayList; // Copy.
-                displayList.length = displayCount; // Modify displayList length.
-                for (var i = 0, l = displayCount; i < l; ++i) {
-                    var displayData = dragonBones.DragonBones.webAssembly ? displays.get(i) : displays[i];
+                slot.displayFrameCount = displayDatas.length;
+                for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                    var displayData = displayDatas[i];
+                    slot.replaceRawDisplayData(displayData, i);
                     if (displayData !== null) {
-                        displayList[i] = this._getSlotDisplay(null, displayData, null, slot);
+                        slot.replaceDisplay(this._getSlotDisplay(null, displayData, slot), i);
                     }
                     else {
-                        displayList[i] = null;
+                        slot.replaceDisplay(null, i);
                     }
                 }
                 success = true;
-                slot.rawDisplayDatas = displays;
-                slot.displayList = displayList;
             }
             return success;
         };
@@ -14850,8 +15064,8 @@ var dragonBones;
                     var display = _c[_b];
                     if (display instanceof dragonBones.Armature) {
                         var displayDatas = skinData.getDisplays(slot.name);
-                        if (displayDatas !== null && index < (dragonBones.DragonBones.webAssembly ? displayDatas.size() : displayDatas.length)) {
-                            var displayData = dragonBones.DragonBones.webAssembly ? displayDatas.get(index) : displayDatas[index];
+                        if (displayDatas !== null && index < displayDatas.length) {
+                            var displayData = displayDatas[index];
                             if (displayData !== null && displayData.type === 1 /* Armature */) {
                                 var childArmatureData = this.getArmatureData(displayData.path, displayData.parent.parent.parent.name);
                                 if (childArmatureData) {
@@ -14904,49 +15118,13 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link #replaceSkin}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceSkin}。
-         * @deprecated
-         * @language zh_CN
-         */
-        BaseFactory.prototype.changeSkin = function (armature, skin, exclude) {
-            if (exclude === void 0) { exclude = null; }
-            return this.replaceSkin(armature, skin, false, exclude);
-        };
-        /**
-         * - Deprecated, please refer to {@link #replaceAnimation}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceAnimation}。
-         * @deprecated
-         * @language zh_CN
-         */
-        BaseFactory.prototype.copyAnimationsToArmature = function (toArmature, fromArmatreName, fromSkinName, fromDragonBonesDataName, replaceOriginalAnimation) {
-            if (fromSkinName === void 0) { fromSkinName = ""; }
-            if (fromDragonBonesDataName === void 0) { fromDragonBonesDataName = ""; }
-            if (replaceOriginalAnimation === void 0) { replaceOriginalAnimation = true; }
-            // tslint:disable-next-line:no-unused-expression
-            fromSkinName;
-            var armatureData = this.getArmatureData(fromArmatreName, fromDragonBonesDataName);
-            if (!armatureData) {
-                return false;
-            }
-            return this.replaceAnimation(toArmature, armatureData, replaceOriginalAnimation);
-        };
         BaseFactory._objectParser = null;
         BaseFactory._binaryParser = null;
         return BaseFactory;
     }());
     dragonBones.BaseFactory = BaseFactory;
     /**
-     * @internal
+     * @private
      */
     var BuildArmaturePackage = /** @class */ (function () {
         function BuildArmaturePackage() {
@@ -15294,16 +15472,16 @@ var dragonBones;
             // TODO
         };
         HiloSlot.prototype._updateColor = function () {
+            var alpha = this._colorTransform.alphaMultiplier * this._globalAlpha;
             var color = (Math.round(this._colorTransform.redMultiplier * 0xFF) << 16) + (Math.round(this._colorTransform.greenMultiplier * 0xFF) << 8) + Math.round(this._colorTransform.blueMultiplier * 0xFF);
-            this._renderDisplay.alpha = this._colorTransform.alphaMultiplier;
+            this._renderDisplay.alpha = alpha;
             this._renderDisplay.tint = color;
         };
         HiloSlot.prototype._updateFrame = function () {
-            var currentVerticesData = (this._deformVertices !== null && this._display === this._meshDisplay) ? this._deformVertices.verticesData : null;
             var currentTextureData = this._textureData;
             if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) {
                 var currentTextureAtlasData = currentTextureData.parent;
-                if (this._armature.replacedTexture !== null && this._rawDisplayDatas !== null && this._rawDisplayDatas.indexOf(this._displayData) >= 0) {
+                if (this._armature.replacedTexture !== null) {
                     if (this._armature._replaceTextureAtlasData === null) {
                         currentTextureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.HiloTextureAtlasData);
                         currentTextureAtlasData.copyFrom(currentTextureData.parent);
@@ -15317,7 +15495,7 @@ var dragonBones;
                 }
                 var renderTexture = currentTextureAtlasData.renderTexture;
                 if (renderTexture !== null) {
-                    if (currentVerticesData !== null) {
+                    if (this._geometryData !== null) {
                         // TODO
                     }
                     else {
@@ -15329,7 +15507,7 @@ var dragonBones;
                     return;
                 }
             }
-            if (currentVerticesData !== null) {
+            if (this._geometryData !== null) {
                 // TODO
             }
             else {
@@ -15343,12 +15521,6 @@ var dragonBones;
         HiloSlot.prototype._updateMesh = function () {
             // TODO
         };
-        /**
-         * @internal
-         */
-        HiloSlot.prototype._updateGlueMesh = function () {
-            // TODO
-        };
         HiloSlot.prototype._updateTransform = function () {
             this.updateGlobalTransform(); // Update transform.
             var transform = this.global;
@@ -15573,23 +15745,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(HiloFactory, "clock", {
-            /**
-             * - Deprecated, please refer to {@link #clock}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #clock}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                return HiloFactory.factory.clock;
-            },
-            enumerable: true,
-            configurable: true
-        });
         HiloFactory._dragonBonesInstance = null;
         HiloFactory._factory = null;
         return HiloFactory;
diff --git a/Hilo/1.x/out/dragonBones.min.js b/Hilo/1.x/out/dragonBones.min.js
index 009c0fd8..897fea03 100644
--- a/Hilo/1.x/out/dragonBones.min.js
+++ b/Hilo/1.x/out/dragonBones.min.js
@@ -1 +1 @@
-"use strict";var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(e,a){t(e,a);function r(){this.constructor=e}e.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}();var dragonBones;(function(t){})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(a){this._clock=new t.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=a;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var a=0,r=this._objects;a0){for(var n=0;na){i.length=a}t._maxCountMap[r]=a}else{t._defaultMaxCount=a;for(var r in t._poolsMap){var i=t._poolsMap[r];if(i.length>a){i.length=a}if(r in t._maxCountMap){t._maxCountMap[r]=a}}}};t.clearPool=function(e){if(e===void 0){e=null}if(e!==null){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){r.length=0}}else{for(var i in t._poolsMap){var r=t._poolsMap[i];r.length=0}}};t.borrowObject=function(e){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){var i=r.pop();i._isInPool=false;return i}var n=new e;n._onClear();return n};t.prototype.returnToPool=function(){this._onClear();t._returnObject(this)};t._hashCode=0;t._defaultMaxCount=3e3;t._maxCountMap={};t._poolsMap={};return t}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var f=l+t.width;var u=h+t.height;var _=a*l+i*h+s;var c=r*l+n*h+o;var m=a*f+i*h+s;var p=r*f+n*h+o;var d=a*f+i*u+s;var v=r*f+n*u+o;var y=a*l+i*u+s;var g=r*l+n*u+o;var D=0;if(_>m){D=_;_=m;m=D}if(d>y){D=d;d=y;y=D}t.x=Math.floor(_y?m:y)-t.x);if(c>p){D=c;c=p;p=D}if(v>g){D=v;v=g;g=D}t.y=Math.floor(cg?p:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}t.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};t.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};t.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};t.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};t.prototype.fromMatrix=function(e){var a=this.scaleX,r=this.scaleY;var i=t.PI_Q;this.x=e.tx;this.y=e.ty;this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);this.scaleX=this.rotation>-i&&this.rotation-i&&n=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(r>=0&&this.scaleY<0){this.scaleY=-this.scaleY;n=n-Math.PI}this.skew=n-this.rotation;return this};t.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};t.PI=Math.PI;t.PI_D=Math.PI*2;t.PI_H=Math.PI/2;t.PI_Q=Math.PI/4;t.RAD_DEG=180/Math.PI;t.DEG_RAD=Math.PI/180;return t}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.ints=[];e.floats=[];e.strings=[];return e}e.toString=function(){return"[class dragonBones.UserData]"};e.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};e.prototype.addInt=function(t){this.ints.push(t)};e.prototype.addFloat=function(t){this.floats.push(t)};e.prototype.addString=function(t){this.strings.push(t)};e.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};a.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};a.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};a.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};a.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};a.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};a.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};a.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};a.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};a.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return a}(t.BaseObject);t.ArmatureData=e;var a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.transform=new t.Transform;a.userData=null;return a}a.toString=function(){return"[class dragonBones.BoneData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.name="";this.transform.identity();this.userData=null;this.parent=null};return a}(t.BaseObject);t.BoneData=a;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.SurfaceData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.vertices.length=0};return e}(a);t.SurfaceData=r;var i=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}a.createColor=function(){return new t.ColorTransform};a.toString=function(){return"[class dragonBones.SlotData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.name="";this.color=null;this.userData=null;this.parent=null};a.DEFAULT_COLOR=new t.ColorTransform;return a}(t.BaseObject);t.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.order=0;this.name="";this.type=0;this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.scaleEnabled=false;this.bendPositive=false;this.weight=1};return e}(e);t.IKConstraintData=a;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.bones=[];return e}e.toString=function(){return"[class dragonBones.PathConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.pathSlot=null;this.pathDisplayData=null;this.bones.length=0;this.positionMode=0;this.spacingMode=1;this.rotateMode=1;this.position=0;this.spacing=0;this.rotateOffset=0;this.rotateMix=0;this.translateMix=0};e.prototype.AddBone=function(t){this.bones.push(t)};return e}(e);t.PathConstraintData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.displays={};return e}e.toString=function(){return"[class dragonBones.SkinData]"};e.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};e.rectangleIntersectsSegment=function(t,a,r,i,n,s,o,l,h,f,u){if(h===void 0){h=null}if(f===void 0){f=null}if(u===void 0){u=null}var _=t>n&&ts&&an&&rs&&i=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=this.width*.5;var h=this.height*.5;var f=e.rectangleIntersectsSegment(t,a,r,i,-l,-h,l,h,n,s,o);return f};return e}(e);t.RectangleBoundingBoxData=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.EllipseData]"};e.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,f){if(l===void 0){l=null}if(h===void 0){h=null}if(f===void 0){f=null}var u=s/o;var _=u*u;e*=u;r*=u;var c=a-t;var m=r-e;var p=Math.sqrt(c*c+m*m);var d=c/p;var v=m/p;var y=(i-t)*d+(n-e)*v;var g=y*y;var D=t*t+e*e;var b=s*s;var T=b-D+g;var A=0;if(T>=0){var P=Math.sqrt(T);var S=y-P;var O=y+P;var x=S<0?-1:S<=p?0:1;var B=O<0?-1:O<=p?0:1;var M=x*B;if(M<0){return-1}else if(M===0){if(x===-1){A=2;a=t+O*d;r=(e+O*v)/u;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(f!==null){f.x=Math.atan2(r/b*_,a/b);f.y=f.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*v)/u;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(f!==null){f.x=Math.atan2(e/b*_,t/b);f.y=f.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*v)/u;if(f!==null){f.x=Math.atan2(l.y/b*_,l.x/b)}}if(h!==null){h.x=t+O*d;h.y=(e+O*v)/u;if(f!==null){f.y=Math.atan2(h.y/b*_,h.x/b)}}}}}return A};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};e.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=e.ellipseIntersectsSegment(t,a,r,i,0,0,this.width*.5,this.height*.5,n,s,o);return l};return e}(e);t.EllipseBoundingBoxData=r;var i=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};e.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var f=e-r;var u=t*r-e*a;var _=0;var c=i[l-2];var m=i[l-1];var p=0;var d=0;var v=0;var y=0;var g=0;var D=0;for(var b=0;b=c&&B<=T||B>=T&&B<=c)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var M=(u*S-f*O)/x;if((M>=m&&M<=A||M>=A&&M<=m)&&(f===0||M>=e&&M<=r||M>=r&&M<=e)){if(s!==null){var E=B-t;if(E<0){E=-E}if(_===0){p=E;d=E;v=B;y=M;g=B;D=M;if(o!==null){o.x=Math.atan2(A-m,T-c)-Math.PI*.5;o.y=o.x}}else{if(Ed){d=E;g=B;D=M;if(o!==null){o.y=Math.atan2(A-m,T-c)-Math.PI*.5}}}_++}else{v=B;y=M;g=B;D=M;_++;if(o!==null){o.x=Math.atan2(A-m,T-c)-Math.PI*.5;o.y=o.x}break}}}c=T;m=A}if(_===1){if(n!==null){n.x=v;n.y=y}if(s!==null){s.x=v;s.y=y}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=v;n.y=y}if(s!==null){s.x=g;s.y=D}}return _};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};e.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;a=0};e.prototype.addBoneMask=function(t,e,a){if(a===void 0){a=true}var r=t.getBone(e);if(r===null){return}if(this.boneMask.indexOf(e)<0){this.boneMask.push(e)}if(a){for(var i=0,n=t.getBones();i=0){this.boneMask.splice(r,1)}if(a){var i=t.getBone(e);if(i!==null){if(this.boneMask.length>0){for(var n=0,s=t.getBones();n=0&&i.contains(o)){this.boneMask.splice(l,1)}}}else{for(var h=0,f=t.getBones();he._zOrder?1:-1};a.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZorder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};a.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};a.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};a.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};a.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};a.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};a.prototype.init=function(e,a,r,i){if(this._armatureData!==null){return}this._armatureData=e;this._animation=t.BaseObject.borrowObject(t.Animation);this._proxy=a;this._display=r;this._dragonBones=i;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};a.prototype.advanceTime=function(t){if(this._lockUpdate){return}if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty){this._slotsDirty=false;this._slots.sort(a._onSortSlots)}if(this._cacheFrameIndex<0||this._cacheFrameIndex!==e){var r=0,i=0;for(r=0,i=this._bones.length;r0){this._lockUpdate=true;for(var n=0,s=this._actions;n0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var T=o?i.y-e:i.x-t;if(T<0){T=-T}if(d===null||Th){h=T;_=n.x;c=n.y;v=D;if(s!==null){p=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=f;i.y=u;if(s!==null){s.x=m}}if(v!==null&&n!==null){n.x=_;n.y=c;if(s!==null){s.y=p}}return d};a.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};a.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};a.prototype.invalidUpdate=function(){this._transformDirty=true};a.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(a.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=n){return this.globalTransformMatrix}i=a>this._kX*(t+n)+d;m=((o*(l+1)+o*2+l+c)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=c*(h+2);var D=this._hullCache[4];var b=this._hullCache[5];var T=this._hullCache[2]-(l-c)*D;var A=this._hullCache[3]-(l-c)*b;var P=this._vertices;if(i){this._getAffineTransform(-n,d+u,r-n,u,P[g+h+2],P[g+h+3],T+D,A+b,P[g],P[g+1],e._helpTransform,y,true)}else{this._getAffineTransform(-r,d,r-n,u,T,A,P[g],P[g+1],T+D,A+b,e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else if(t>=n){if(a<-n||a>=n){return this.globalTransformMatrix}i=a>this._kX*(t-r)+d;m=((o*(l+1)+o+c)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=(c+1)*(h+2)-2;var D=this._hullCache[4];var b=this._hullCache[5];var T=this._hullCache[0]+c*D;var A=this._hullCache[1]+c*b;var P=this._vertices;if(i){this._getAffineTransform(r,d+u,r-n,u,T+D,A+b,P[g+h+2],P[g+h+3],T,A,e._helpTransform,y,true)}else{this._getAffineTransform(n,d,r-n,u,P[g],P[g+1],T,A,P[g+h+2],P[g+h+3],e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else if(a<-n){if(t<-n||t>=n){return this.globalTransformMatrix}i=a>this._kY*(t-p-f)-r;m=(o*(l+1)+_*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=_*2;var D=this._hullCache[10];var b=this._hullCache[11];var T=this._hullCache[8]+_*D;var A=this._hullCache[9]+_*b;var P=this._vertices;if(i){this._getAffineTransform(p+f,-n,f,r-n,P[g+2],P[g+3],P[g],P[g+1],T+D,A+b,e._helpTransform,y,true)}else{this._getAffineTransform(p,-r,f,r-n,T,A,T+D,A+b,P[g],P[g+1],e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else if(a>=n){if(t<-n||t>=n){return this.globalTransformMatrix}i=a>this._kY*(t-p-f)+n;m=((o*(l+1)+o+l+c)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=l*(h+2)+_*2;var D=this._hullCache[10];var b=this._hullCache[11];var T=this._hullCache[6]-(o-_)*D;var A=this._hullCache[7]-(o-_)*b;var P=this._vertices;if(i){this._getAffineTransform(p+f,r,f,r-n,T+D,A+b,T,A,P[g+2],P[g+3],e._helpTransform,y,true)}else{this._getAffineTransform(p,n,f,r-n,P[g],P[g+1],P[g+2],P[g+3],T,A,e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else{i=a>this._k*(t-p-f)+d;m=((o*c+_)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=_*2+c*(h+2);var P=this._vertices;if(i){this._getAffineTransform(p+f,d+u,f,u,P[g+h+4],P[g+h+5],P[g+h+2],P[g+h+3],P[g+2],P[g+3],e._helpTransform,y,true)}else{this._getAffineTransform(p,d,f,u,P[g],P[g+1],P[g+2],P[g+3],P[g+h+2],P[g+h+3],e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}return y};e.prototype.init=function(e,a){if(this._boneData!==null){return}t.prototype.init.call(this,e,a);var r=e.segmentX;var i=e.segmentY;var n=e.vertices.length;var s=1e3;var o=200;this._dX=o*2/r;this._dY=o*2/i;this._k=-this._dY/this._dX;this._kX=-this._dY/(s-o);this._kY=-(s-o)/this._dX;this._vertices.length=n;this._deformVertices.length=n;this._matrixCahce.length=(r*i+r*2+i*2)*2*7;this._hullCache.length=10;for(var l=0;l=0&&this._cachedFrameIndices!==null){var a=this._cachedFrameIndices[t];if(a>=0&&this._cachedFrameIndex===a){this._transformDirty=false}else if(a>=0){this._transformDirty=true;this._cachedFrameIndex=a}else{if(this._hasConstraint){for(var r=0,i=this._armature._constraints;r=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var s=0,o=this._armature._constraints;s=0;if(this._localDirty){this._updateGlobalTransformMatrix(f)}if(f&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var u=1e3;var _=200;var c=2*this.global.x;var m=2*this.global.y;var p=e._helpPoint;this.globalTransformMatrix.transformPoint(u,-_,p);this._hullCache[0]=p.x;this._hullCache[1]=p.y;this._hullCache[2]=c-p.x;this._hullCache[3]=m-p.y;this.globalTransformMatrix.transformPoint(0,this._dY,p,true);this._hullCache[4]=p.x;this._hullCache[5]=p.y;this.globalTransformMatrix.transformPoint(_,u,p);this._hullCache[6]=p.x;this._hullCache[7]=p.y;this._hullCache[8]=c-p.x;this._hullCache[9]=m-p.y;this.globalTransformMatrix.transformPoint(this._dX,0,p,true);this._hullCache[10]=p.x;this._hullCache[11]=p.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return e}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a._localMatrix=new t.Matrix;a._colorTransform=new t.ColorTransform;a._displayDatas=[];a._displayList=[];a._deformVertices=null;a._rawDisplay=null;a._meshDisplay=null;return a}a.prototype._onClear=function(){e.prototype._onClear.call(this);var a=[];for(var r=0,i=this._displayList;r=0){if(this._rawDisplayDatas!==null){n=this._displayIndex=0&&this._displayIndex=0&&this._rawDisplayDatas!==null){var s=this._displayIndex0){for(var o=0,l=n;o0){if(this._displayList.length!==e.length){this._displayList.length=e.length}for(var a=0,r=e.length;a0){this._displayList.length=0}if(this._displayIndex>=0&&this._displayIndex=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._display===null){return}if(this._visibleDirty){this._visibleDirty=false;this._updateVisible()}if(this._blendModeDirty){this._blendModeDirty=false;this._updateBlendMode()}if(this._colorDirty){this._colorDirty=false;this._updateColor()}if(this._deformVertices!==null&&this._deformVertices.verticesData!==null&&this._display===this._meshDisplay){var a=this._deformVertices.verticesData.weight!==null;var r=this._parent._boneData.type!==0;if(this._deformVertices.verticesDirty||a&&this._deformVertices.isBonesUpdate()||r&&this._parent._childrenTransformDirty){this._deformVertices.verticesDirty=false;this._updateMesh()}if(a||r){return}}if(this._transformDirty){this._transformDirty=false;if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform()}};a.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._transformDirty=false;this._updateGlobalTransformMatrix(false)}};a.prototype.replaceDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){if(this._displayIndex<0){e=0}else{e=this._displayIndex}}if(this._displayDatas.length<=e){this._displayDatas.length=e+1;for(var a=0,r=this._displayDatas.length;a0){if(l===1||l===2){if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n);if(s!==null){s.x=n.x;s.y=n.y}}else if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}else{if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}if(o!==null){this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),a._helpPoint,true);o.x=Math.atan2(a._helpPoint.y,a._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),a._helpPoint,true);o.y=Math.atan2(a._helpPoint.y,a._helpPoint.x)}}return l};a.prototype.invalidUpdate=function(){this._displayDirty=true;this._transformDirty=true};Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"displayIndex",{get:function(){return this._displayIndex},set:function(t){if(this._setDisplayIndex(t)){this.update(-1)}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"name",{get:function(){return this._slotData.name},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"displayList",{get:function(){return this._displayList.concat()},set:function(e){var a=this._displayList.concat();var r=new Array;if(this._setDisplayList(e)){this.update(-1)}for(var i=0,n=a;id){continue}var T=0;for(;;D++){var A=v[D];if(p>A){continue}if(D===0){T=p/A}else{var P=v[D-1];T=(p-P)/(A-P)}break}if(D!==m){m=D;if(f&&D===c){this._computeVertices(_-4,4,0,u);this._computeVertices(0,4,4,u)}else{this._computeVertices(D*6+2,8,0,u)}}this.addCurvePosition(T,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],l,g,a)}return}if(f){_+=2;u.length=o;this._computeVertices(2,_-4,0,u);this._computeVertices(0,2,_-4,u);u[_-2]=u[0];u[_-1]=u[1]}else{c--;_-=4;u.length=_;this._computeVertices(2,_,0,u)}var S=new Array(c);d=0;var O=u[0],x=u[1],B=0,M=0,E=0,I=0,w=0,C=0;var F,R,N,k,j,L,U,Y;for(var y=0,V=2;yd){continue}for(;;D++){var z=S[D];if(W>z)continue;if(D===0)W/=z;else{var K=S[D-1];W=(W-K)/(z-K)}break}if(D!==m){m=D;var Z=D*6;O=u[Z];x=u[Z+1];B=u[Z+2];M=u[Z+3];E=u[Z+4];I=u[Z+5];w=u[Z+6];C=u[Z+7];F=(O-B*2+E)*.03;R=(x-M*2+I)*.03;N=((B-E)*3-O+w)*.006;k=((M-I)*3-x+C)*.006;j=F*2+N;L=R*2+k;U=(B-O)*.3+F+N*.16666667;Y=(M-x)*.3+R+k*.16666667;G=Math.sqrt(U*U+Y*Y);X[0]=G;for(Z=1;Z<8;Z++){U+=j;Y+=L;j+=N;L+=k;G+=Math.sqrt(U*U+Y*Y);X[Z]=G}U+=j;Y+=L;G+=Math.sqrt(U*U+Y*Y);X[8]=G;U+=j+N;Y+=L+k;G+=Math.sqrt(U*U+Y*Y);X[9]=G;H=0}W*=G;for(;;H++){var q=X[H];if(W>q)continue;if(H===0)W/=q;else{var K=X[H-1];W=H+(W-K)/(q-K)}break}this.addCurvePosition(W*.1,O,x,B,M,E,I,w,C,l,g,a)}};a.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,f,u){if(t===0){h[f]=e;h[f+1]=a;h[f+2]=0;return}if(t===1){h[f]=o;h[f+1]=l;h[f+2]=0;return}var _=1-t;var c=_*_;var m=t*t;var p=c*_;var d=c*t*3;var v=_*m*3;var y=t*m;var g=p*e+d*r+v*n+y*o;var D=p*a+d*i+v*s+y*l;h[f]=g;h[f+1]=D;if(u){h[f+2]=Math.atan2(D-(p*a+d*i+v*s),g-(p*e+d*r+v*n))}else{h[f+2]=0}};a.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.vertices.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD}}var E=this.rotateMix;var I=this.translateMix;for(var v=0,w=3;v0){var k=b.a,j=b.b,L=b.c,U=b.d,Y=void 0,V=void 0,X=void 0;if(_){Y=S[w-1]}else{Y=Math.atan2(F,C)}Y-=Math.atan2(j,k);if(M){V=Math.cos(Y);X=Math.sin(Y);var G=g._boneData.length;x+=(G*(V*k-X*j)-C)*E;B+=(G*(X*k+V*j)-F)*E}else{Y+=O}if(Y>t.Transform.PI){Y-=t.Transform.PI_D}else if(Y<-t.Transform.PI){Y+=t.Transform.PI_D}Y*=E;V=Math.cos(Y);X=Math.sin(Y);b.a=V*k-X*j;b.b=X*k+V*j;b.c=V*L-X*U;b.d=X*L+V*U}g.global.fromMatrix(b)}this.dirty=false};a.prototype.invalidUpdate=function(){};return a}(e);t.PathConstraint=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];e.bones=[];return e}e.toString=function(){return"[class dragonBones.DeformVertices]"};e.prototype._onClear=function(){this.verticesDirty=false;this.vertices.length=0;this.bones.length=0;this.verticesData=null};e.prototype.init=function(t,e){this.verticesData=t;if(this.verticesData!==null){var a=0;if(this.verticesData.weight!==null){a=this.verticesData.weight.count*2}else{a=this.verticesData.data.intArray[this.verticesData.offset+0]*2}this.verticesDirty=true;this.vertices.length=a;this.bones.length=0;for(var r=0,i=this.vertices.length;r0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&a._subFadeState>0){this._armature._dragonBones.bufferObject(a);this._animationStates.length=0;this._lastAnimationState=null}else{var r=a._animationData;var i=r.cacheFrameRate;if(this._animationDirty&&i>0){this._animationDirty=false;for(var n=0,s=this._armature.getBones();n0){var _=u[0];if(_!==null){if(_.parent===this._armature.armatureData.defaultSkin){f._cachedFrameIndices=r.getSlotCachedFrameIndices(f.name);continue}}}f._cachedFrameIndices=null}}a.advanceTime(t,i)}}else if(e>1){for(var c=0,m=0;c0&&a._subFadeState>0){m++;this._armature._dragonBones.bufferObject(a);this._animationDirty=true;if(this._lastAnimationState===a){this._lastAnimationState=null}}else{if(m>0){this._animationStates[c-m]=a}a.advanceTime(t,0)}if(c===e-1&&m>0){this._animationStates.length-=m;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};a.prototype.reset=function(){for(var t=0,e=this._animationStates;t1){if(e.position<0){e.position%=r.duration;e.position=r.duration-e.position}else if(e.position===r.duration){e.position-=1e-6}else if(e.position>r.duration){e.position%=r.duration}if(e.duration>0&&e.position+e.duration>r.duration){e.duration=r.duration-e.position}if(e.playTimes<0){e.playTimes=r.playTimes}}else{e.playTimes=1;e.position=0;if(e.duration>0){e.duration=0}}if(e.duration===0){e.duration=-1}this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);o.init(this._armature,r,e);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var l=false;for(var h=0,f=this._animationStates.length;hthis._animationStates[h].layer){l=true;this._animationStates.splice(h,0,o);break}else if(h!==f-1&&o.layer>this._animationStates[h+1].layer){l=true;this._animationStates.splice(h+1,0,o);break}}if(!l){this._animationStates.push(o)}}else{this._animationStates.push(o)}for(var u=0,_=this._armature.getSlots();u<_.length;u++){var c=_[u];var m=c.childArmature;if(m!==null&&m.inheritAnimation&&m.animation.hasAnimation(a)&&m.animation.getState(a)===null){m.animation.fadeIn(a)}}var p=false;for(var d in r.animationTimelines){if(!this._lockUpdate){p=true;this._lockUpdate=true}var v=this.fadeIn(d,e.fadeInTime,1,o.layer,null,0);if(v!==null){v.resetToPose=false;v._parent=o;v.stop()}}if(p){this._lockUpdate=false}if(!this._lockUpdate){if(e.fadeInTime<=0){this._armature.advanceTime(0)}this._lastAnimationState=o}return o};a.prototype.play=function(t,e){if(t===void 0){t=null}if(e===void 0){e=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t!==null?t:"";if(t!==null&&t.length>0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};a.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*e/r.frameCount}return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};a.prototype.getState=function(t){var e=this._animationStates.length;while(e--){var a=this._animationStates[e];if(a.name===t){return a}}return null};a.prototype.hasAnimation=function(t){return t in this._animations};a.prototype.getStates=function(){return this._animationStates};Object.defineProperty(a.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});a.prototype.gotoAndPlay=function(t,e,a,r,i,n,s,o,l){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=-1}if(i===void 0){i=0}if(n===void 0){n=null}if(s===void 0){s=3}if(o===void 0){o=true}if(l===void 0){l=true}console.warn("Deprecated.");o;l;this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.fadeOutMode=s;this._animationConfig.playTimes=r;this._animationConfig.layer=i;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=n!==null?n:"";var h=this._animations[t];if(h&&a>0){this._animationConfig.timeScale=h.duration/a}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStop=function(t,e){if(e===void 0){e=0}console.warn("Deprecated.");return this.gotoAndStopByTime(t,e)};Object.defineProperty(a.prototype,"animationList",{get:function(){console.warn("Deprecated.");return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationDataList",{get:function(){console.warn("Deprecated.");var t=[];for(var e=0,a=this._animationNames.length;e0;if(this._subFadeState<0){this._subFadeState=0;var r=a?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=t.BaseObject.borrowObject(t.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}if(e<0){e=-e}this._fadeTime+=e;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=a?0:1}else if(this._fadeTime>0){this._fadeProgress=a?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=a?1:0}if(this._subFadeState>0){if(!a){this._playheadState|=1;this._fadeState=0}var r=a?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=t.BaseObject.borrowObject(t.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}};i.prototype.init=function(e,a,r){if(this._armature!==null){return}this._armature=e;this._animationData=a;this.resetToPose=r.resetToPose;this.additiveBlending=r.additiveBlending;this.displayControl=r.displayControl;this.actionEnabled=r.actionEnabled;this.layer=r.layer;this.playTimes=r.playTimes;this.timeScale=r.timeScale;this.fadeTotalTime=r.fadeInTime;this.autoFadeOutTime=r.autoFadeOutTime;this.weight=r.weight;this.name=r.name.length>0?r.name:r.animation;this.group=r.group;if(r.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(r.duration<0){this._position=0;this._duration=this._animationData.duration;if(r.position!==0){if(this.timeScale>=0){this._time=r.position}else{this._time=r.position-this._duration}}else{this._time=0}}else{this._position=r.position;this._duration=r.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(r.boneMask.length>0){this._boneMask.length=r.boneMask.length;for(var i=0,n=this._boneMask.length;i0;var i=true;var n=true;var s=this._time;this._weightResult=this.weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult/this._parent._fadeProgress}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(r){var o=a*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*a);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){if(n){for(var h=0,f=this._boneTimelines.length;h0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var m=0,p=this._poseTimelines;m0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};i.prototype.play=function(){this._playheadState=3};i.prototype.stop=function(){this._playheadState&=1};i.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};i.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};i.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,f=i;h0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.leftWeight=0;return 0}else{this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}}}else{return 0}t*=this.leftWeight;this.layerWeight+=t;this.blendWeight=t;return 2}this.dirty=true;this.layer=e;this.layerWeight=t;this.leftWeight=1;this.blendWeight=t;return 1};t.prototype.clear=function(){this.dirty=false;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};return t}();t.BlendState=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.playState=-1;this.currentPlayTimes=-1;this.currentTime=-1;this._tweenState=0;this._frameRate=0;this._frameValueOffset=0;this._frameCount=0;this._frameOffset=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._dragonBonesData=null;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._frameIntArray=null;this._frameFloatArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this._duration+1e-6}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState._animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;this._dragonBonesData=this._animationData.parent.parent;if(this._timelineData!==null){this._frameIntArray=this._dragonBonesData.frameIntArray;this._frameFloatArray=this._dragonBonesData.frameFloatArray;this._frameArray=this._dragonBonesData.frameArray;this._timelineArray=this._dragonBonesData.timelineArray;this._frameIndices=this._dragonBonesData.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._tweenState!==0){this._onUpdateFrame()}}};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a+1;var n=Math.floor(t*i);var s=n===0?0:e[r+n-1];var o=n===i-1?1e4:e[r+n];return(s+(o-s)*(t*i-n))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenProgress=0;this._tweenEasing=0};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this._tweenState=1}};e.prototype._onUpdateFrame=function(){if(this._tweenState===2){this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}else{this._tweenProgress=0}};return e}(e);t.TweenTimelineState=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.bone=null;this.bonePose=null};e.prototype.blend=function(t){var e=this.bone._blendState.blendWeight;var a=this.bone.animationPose;var r=this.bonePose.result;if(t===2){a.x+=r.x*e;a.y+=r.y*e;a.rotation+=r.rotation*e;a.skew+=r.skew*e;a.scaleX+=(r.scaleX-1)*e;a.scaleY+=(r.scaleY-1)*e}else if(e!==1){a.x=r.x*e;a.y=r.y*e;a.rotation=r.rotation*e;a.skew=r.skew*e;a.scaleX=(r.scaleX-1)*e+1;a.scaleY=(r.scaleY-1)*e+1}else{a.x=r.x;a.y=r.y;a.rotation=r.rotation;a.skew=r.skew;a.scaleX=r.scaleX;a.scaleY=r.scaleY}if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){this.bone._transformDirty=true}};return e}(a);t.BoneTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.slot=null};return e}(a);t.SlotTimelineState=i;var n=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.constraint=null};return e}(a);t.ConstraintTimelineState=n})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.ActionTimelineState]"};a.prototype._onCrossFrame=function(e){var a=this._armature.eventDispatcher;if(this._animationState.actionEnabled){var r=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+e];var i=this._frameArray[r+1];var n=this._animationData.parent.actions;for(var s=0;s0){if(n.hasDBEventListener(t.EventObject.COMPLETE)){h=t.BaseObject.borrowObject(t.EventObject);h.type=t.EventObject.COMPLETE;h.armature=this._armature;h.animationState=this._animationState}}}if(this._frameCount>1){var f=this._timelineData;var u=Math.floor(this.currentTime*this._frameRate);var _=this._frameIndices[f.frameIndicesOffset+u];if(this._frameIndex!==_){var c=this._frameIndex;this._frameIndex=_;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[f.offset+5+this._frameIndex];if(o){if(c<0){var m=Math.floor(i*this._frameRate);c=this._frameIndices[f.frameIndicesOffset+m];if(this.currentPlayTimes===r){if(c===_){c=-1}}}while(c>=0){var p=this._animationData.frameOffset+this._timelineArray[f.offset+5+c];var d=this._frameArray[p]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(c)}if(l!==null&&c===0){this._armature._dragonBones.bufferEvent(l);l=null}if(c>0){c--}else{c=this._frameCount-1}if(c===_){break}}}else{if(c<0){var m=Math.floor(i*this._frameRate);c=this._frameIndices[f.frameIndicesOffset+m];var p=this._animationData.frameOffset+this._timelineArray[f.offset+5+c];var d=this._frameArray[p]/this._frameRate;if(this.currentPlayTimes===r){if(i<=d){if(c>0){c--}else{c=this._frameCount-1}}else if(c===_){c=-1}}}while(c>=0){if(c=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.ZOrderTimelineState=a;var r=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*6;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.x=r[t++]*a;i.y=r[t++]*a;i.rotation=r[t++];i.skew=r[t++];i.scaleX=r[t++];i.scaleY=r[t++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){t=this._animationData.frameFloatOffset+this._frameValueOffset}n.x=r[t++]*a-i.x;n.y=r[t++]*a-i.y;n.rotation=r[t++]-i.rotation;n.skew=r[t++]-i.skew;n.scaleX=r[t++]-i.scaleX;n.scaleY=r[t++]-i.scaleY}else{n.x=0;n.y=0;n.rotation=0;n.skew=0;n.scaleX=0;n.scaleY=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.x=0;i.y=0;i.rotation=0;i.skew=0;i.scaleX=1;i.scaleY=1;n.x=0;n.y=0;n.rotation=0;n.skew=0;n.scaleX=0;n.scaleY=0}};a.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.x=t.x+a.x*this._tweenProgress;r.y=t.y+a.y*this._tweenProgress;r.rotation=t.rotation+a.rotation*this._tweenProgress;r.skew=t.skew+a.skew*this._tweenProgress;r.scaleX=t.scaleX+a.scaleX*this._tweenProgress;r.scaleY=t.scaleY+a.scaleY*this._tweenProgress};a.prototype.fadeOut=function(){var e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation);e.skew=t.Transform.normalizeRadian(e.skew)};return a}(t.BoneTimelineState);t.BoneAllTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.x=r[e++]*a;i.y=r[e++]*a;if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){e=this._animationData.frameFloatOffset+this._frameValueOffset}n.x=r[e++]*a-i.x;n.y=r[e++]*a-i.y}else{n.x=0;n.y=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.x=0;i.y=0;n.x=0;n.y=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.x=e.x+a.x*this._tweenProgress;r.y=e.y+a.y*this._tweenProgress};return e}(t.BoneTimelineState);t.BoneTranslateTimelineState=i;var n=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var a=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.rotation=r[a++];i.skew=r[a++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){a=this._animationData.frameFloatOffset+this._frameValueOffset;n.rotation=t.Transform.normalizeRadian(r[a++]-i.rotation)}else{n.rotation=r[a++]-i.rotation}n.skew=r[a++]-i.skew}else{n.rotation=0;n.skew=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.rotation=0;i.skew=0;n.rotation=0;n.skew=0}};a.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.rotation=t.rotation+a.rotation*this._tweenProgress;r.skew=t.skew+a.skew*this._tweenProgress};a.prototype.fadeOut=function(){var e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation);e.skew=t.Transform.normalizeRadian(e.skew)};return a}(t.BoneTimelineState);t.BoneRotateTimelineState=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var a=this._frameFloatArray;var r=this.bonePose.current;var i=this.bonePose.delta;r.scaleX=a[e++];r.scaleY=a[e++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){e=this._animationData.frameFloatOffset+this._frameValueOffset}i.scaleX=a[e++]-r.scaleX;i.scaleY=a[e++]-r.scaleY}else{i.scaleX=0;i.scaleY=0}}else{var r=this.bonePose.current;var i=this.bonePose.delta;r.scaleX=1;r.scaleY=1;i.scaleX=0;i.scaleY=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.scaleX=e.scaleX+a.scaleX*this._tweenProgress;r.scaleY=e.scaleY+a.scaleY*this._tweenProgress};return e}(t.BoneTimelineState);t.BoneScaleTimelineState=s;var o=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[];e._delta=[];e._result=[];return e}e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.surface=null;this._frameFloatOffset=0;this._valueCount=0;this._deformCount=0;this._valueOffset=0;this._current.length=0;this._delta.length=0;this._result.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;if(this._tweenState===2){var i=e+this._valueCount;if(this._frameIndex===this._frameCount-1){i=this._animationData.frameFloatOffset+this._frameValueOffset}for(var n=0;n=0){var t=this._timelineData!==null?this._frameArray[this._frameOffset+1]:this.slot._slotData.displayIndex;if(this.slot.displayIndex!==t){this.slot._setDisplayIndex(t,true)}}};return e}(t.SlotTimelineState);t.SlotDislayTimelineState=l;var h=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[0,0,0,0,0,0,0,0];e._delta=[0,0,0,0,0,0,0,0];e._result=[0,0,0,0,0,0,0,0];return e}e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._dirty=false};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._dragonBonesData.intArray;var a=this._frameIntArray;var r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex*1;var i=a[r];if(i<0){i+=65536}this._current[0]=e[i++];this._current[1]=e[i++];this._current[2]=e[i++];this._current[3]=e[i++];this._current[4]=e[i++];this._current[5]=e[i++];this._current[6]=e[i++];this._current[7]=e[i++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){i=a[this._animationData.frameIntOffset+this._frameValueOffset]}else{i=a[r+1*1]}if(i<0){i+=65536}this._delta[0]=e[i++]-this._current[0];this._delta[1]=e[i++]-this._current[1];this._delta[2]=e[i++]-this._current[2];this._delta[3]=e[i++]-this._current[3];this._delta[4]=e[i++]-this._current[4];this._delta[5]=e[i++]-this._current[5];this._delta[6]=e[i++]-this._current[6];this._delta[7]=e[i++]-this._current[7]}}else{var n=this.slot._slotData.color;this._current[0]=n.alphaMultiplier*100;this._current[1]=n.redMultiplier*100;this._current[2]=n.greenMultiplier*100;this._current[3]=n.blueMultiplier*100;this._current[4]=n.alphaOffset;this._current[5]=n.redOffset;this._current[6]=n.greenOffset;this._current[7]=n.blueOffset}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);this._dirty=true;if(this._tweenState!==2){this._tweenState=0}this._result[0]=(this._current[0]+this._delta[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._delta[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._delta[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._delta[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._delta[4]*this._tweenProgress;this._result[5]=this._current[5]+this._delta[5]*this._tweenProgress;this._result[6]=this._current[6]+this._delta[6]*this._tweenProgress;this._result[7]=this._current[7]+this._delta[7]*this._tweenProgress};e.prototype.fadeOut=function(){this._tweenState=0;this._dirty=false};e.prototype.update=function(e){t.prototype.update.call(this,e);if(this._tweenState!==0||this._dirty){var a=this.slot._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);a.alphaMultiplier+=(this._result[0]-a.alphaMultiplier)*r;a.redMultiplier+=(this._result[1]-a.redMultiplier)*r;a.greenMultiplier+=(this._result[2]-a.greenMultiplier)*r;a.blueMultiplier+=(this._result[3]-a.blueMultiplier)*r;a.alphaOffset+=(this._result[4]-a.alphaOffset)*r;a.redOffset+=(this._result[5]-a.redOffset)*r;a.greenOffset+=(this._result[6]-a.greenOffset)*r;a.blueOffset+=(this._result[7]-a.blueOffset)*r;this.slot._colorDirty=true}}else if(this._dirty){this._dirty=false;if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){a.alphaMultiplier=this._result[0];a.redMultiplier=this._result[1];a.greenMultiplier=this._result[2];a.blueMultiplier=this._result[3];a.alphaOffset=this._result[4];a.redOffset=this._result[5];a.greenOffset=this._result[6];a.blueOffset=this._result[7];this.slot._colorDirty=true}}}};return e}(t.SlotTimelineState);t.SlotColorTimelineState=h;var f=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[];e._delta=[];e._result=[];return e}e.toString=function(){return"[class dragonBones.DeformTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.vertexOffset=0;this._dirty=false;this._frameFloatOffset=0;this._valueCount=0;this._deformCount=0;this._valueOffset=0;this._current.length=0;this._delta.length=0;this._result.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;if(this._tweenState===2){var i=e+this._valueCount;if(this._frameIndex===this._frameCount-1){i=this._animationData.frameFloatOffset+this._frameValueOffset}for(var n=0;n=0){this._floats[2]=this._floats[0]+this._floats[1]*this._tweenProgress}this._floats[5]=this._floats[3]+this._floats[4]*this._tweenProgress};e.prototype.blend=function(t){var e=this.animationState;var a=e._blendState.blendWeight;if(t===2){e.weight+=this._floats[5]*a;e.currentTime+=this._floats[2]*a}else{e.weight=this._floats[5]*a;e.currentTime=this._floats[2]*a}};return e}(t.TweenTimelineState);t.AnimationTimelineState=_})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.actionDataToInstance=function(t,a,r){if(t.type===0){a.type=e.FRAME_EVENT}else{a.type=t.type===10?e.FRAME_EVENT:e.SOUND_EVENT}a.name=t.name;a.armature=r;a.actionData=t;a.data=t.data;if(t.bone!==null){a.bone=r.getBone(t.bone.name)}if(t.slot!==null){a.slot=r.getSlot(t.slot.name)}};e.toString=function(){return"[class dragonBones.EventObject]"};e.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};e.START="start";e.LOOP_COMPLETE="loopComplete";e.COMPLETE="complete";e.FADE_IN="fadeIn";e.FADE_IN_COMPLETE="fadeInComplete";e.FADE_OUT="fadeOut";e.FADE_OUT_COMPLETE="fadeOutComplete";e.FRAME_EVENT="frameEvent";e.SOUND_EVENT="soundEvent";return e}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(){}e._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};e._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};e._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};e._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};e._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};e._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};e._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};e._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};e._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};e.parseDragonBonesData=function(e){console.warn("Deprecated.");if(e instanceof ArrayBuffer){return t.BinaryDataParser.getInstance().parseDragonBonesData(e)}else{return t.ObjectDataParser.getInstance().parseDragonBonesData(e)}};e.parseTextureAtlasData=function(a,r){if(r===void 0){r=1}console.warn("已废弃");var i={};var n=a[e.SUB_TEXTURE];for(var s=0,o=n.length;s255){return encodeURI(i)}}}return i}return String(i)}return r};r.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var f=1-l;var u=f*f;var _=l*l;var c=f*u;var m=3*l*u;var p=3*f*_;var d=l*_;h.x=c*t+m*a+p*i+d*s;h.y=c*e+m*r+p*n+d*o};r.prototype._samplingEasingCurve=function(t,e){var a=t.length;var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var y=(v+d)*.5;this._getCurvePoint(l,h,f,u,_,c,m,p,y,this._helpPoint);if(s-this._helpPoint.x>0){d=y}else{v=y}}e[i]=this._helpPoint.y}};r.prototype._parseActionDataInFrame=function(e,a,r,i){if(t.DataParser.EVENT in e){this._mergeActionFrame(e[t.DataParser.EVENT],a,10,r,i)}if(t.DataParser.SOUND in e){this._mergeActionFrame(e[t.DataParser.SOUND],a,11,r,i)}if(t.DataParser.ACTION in e){this._mergeActionFrame(e[t.DataParser.ACTION],a,0,r,i)}if(t.DataParser.EVENTS in e){this._mergeActionFrame(e[t.DataParser.EVENTS],a,10,r,i)}if(t.DataParser.ACTIONS in e){this._mergeActionFrame(e[t.DataParser.ACTIONS],a,0,r,i)}};r.prototype._mergeActionFrame=function(e,r,i,n,s){var o=t.DragonBones.webAssembly?this._armature.actions.size():this._armature.actions.length;var l=this._parseActionData(e,i,n,s);var h=0;var f=null;for(var u=0,_=l;u<_.length;u++){var c=_[u];this._armature.addAction(c,false)}if(this._actionFrames.length===0){f=new a;f.frameStart=0;this._actionFrames.push(f);f=null}for(var m=0,p=this._actionFrames;mr){break}h++}if(f===null){f=new a;f.frameStart=r;this._actionFrames.splice(h+1,0,f)}for(var v=0;v0){var m=i.getBone(_);if(m!==null){c.parent=m}else{if(!(_ in this._cacheBones)){this._cacheBones[_]=[]}this._cacheBones[_].push(c)}}if(c.name in this._cacheBones){for(var p=0,d=this._cacheBones[c.name];p0&&a.parent!==null){n.root=a.parent;n.bone=a}else{n.root=a;n.bone=null}return n};r.prototype._parsePathConstraint=function(e){var a=this._armature.getSlot(r._getString(e,t.DataParser.TARGET,""));if(a===null){return null}var i=this._armature.defaultSkin;if(i===null){return null}var n=i.getDisplay(a.name,r._getString(e,t.DataParser.TARGET_DISPLAY,a.name));if(n===null||!(n instanceof t.PathDisplayData)){return null}var s=e[t.DataParser.BONES];if(s===null||s.length===0){return null}var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=r._getString(e,t.DataParser.NAME,"");o.type=1;o.pathSlot=a;o.pathDisplayData=n;o.target=a.parent;o.positionMode=t.DataParser._getPositionMode(r._getString(e,t.DataParser.POSITION_MODE,""));o.spacingMode=t.DataParser._getSpacingMode(r._getString(e,t.DataParser.SPACING_MODE,""));o.rotateMode=t.DataParser._getRotateMode(r._getString(e,t.DataParser.ROTATE_MODE,""));o.position=r._getNumber(e,t.DataParser.POSITION,0);o.spacing=r._getNumber(e,t.DataParser.SPACING,0);o.rotateOffset=r._getNumber(e,t.DataParser.ROTATE_OFFSET,0);o.rotateMix=r._getNumber(e,t.DataParser.ROTATE_MIX,1);o.translateMix=r._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var l=0,h=s;l0?i:a;this._parsePivot(e,o);break;case 1:var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);l.name=a;l.path=i.length>0?i:a;l.inheritAnimation=true;if(t.DataParser.ACTIONS in e){var h=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);for(var f=0,u=h;f0?i:a;d.vertices.data=this._data;if(t.DataParser.SHARE in e){this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}else{this._parseMesh(e,d)}if(t.DataParser.GLUE_WEIGHTS in e&&t.DataParser.GLUE_MESHES in e){this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}break;case 3:var v=this._parseBoundingBox(e);if(v!==null){var y=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);y.name=a;y.path=i.length>0?i:a;y.boundingBox=v}break;case 4:var g=e[t.DataParser.LENGTHS];var D=s=t.BaseObject.borrowObject(t.PathDisplayData);D.closed=r._getBoolean(e,t.DataParser.CLOSED,false);D.constantSpeed=r._getBoolean(e,t.DataParser.CONSTANT_SPEED,false);D.name=a;D.path=i.length>0?i:a;D.vertices.data=this._data;D.curveLengths.length=g.length;for(var b=0,T=g.length;ba.width){a.width=l}if(ha.height){a.height=h}}}a.width-=a.x;a.height-=a.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return a};r.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);a.frameCount=Math.max(r._getNumber(e,t.DataParser.DURATION,1),1);a.playTimes=r._getNumber(e,t.DataParser.PLAY_TIMES,1);a.duration=a.frameCount/this._armature.frameRate;a.fadeInTime=r._getNumber(e,t.DataParser.FADE_IN_TIME,0);a.scale=r._getNumber(e,t.DataParser.SCALE,1);a.name=r._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME);if(a.name.length===0){a.name=t.DataParser.DEFAULT_NAME}a.frameIntOffset=this._frameIntArray.length;a.frameFloatOffset=this._frameFloatArray.length;a.frameOffset=this._frameArray.length;this._animation=a;if(t.DataParser.FRAME in e){var i=e[t.DataParser.FRAME];var n=i.length;if(n>0){for(var s=0,o=0;s0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,false,false,0,this._parseActionFrame);this._actionFrames.length=0}this._animation=null;return a};r.prototype._parseTimeline=function(e,i,n,s,o,l,h,f){if(e!==null&&n.length>0&&n in e){i=e[n]}if(i===null){return null}var u=i.length;if(u===0){return null}var _=this._frameIntArray.length;var c=this._frameFloatArray.length;var m=t.BaseObject.borrowObject(t.TimelineData);var p=this._timelineArray.length;this._timelineArray.length+=1+1+1+1+1+u;if(e!==null){this._timelineArray[p+0]=Math.round(r._getNumber(e,t.DataParser.SCALE,1)*100);this._timelineArray[p+1]=Math.round(r._getNumber(e,t.DataParser.OFFSET,0)*100)}else{this._timelineArray[p+0]=100;this._timelineArray[p+1]=0}this._timelineArray[p+2]=u;this._timelineArray[p+3]=h;if(o){this._timelineArray[p+4]=_-this._animation.frameIntOffset}else if(l){this._timelineArray[p+4]=c-this._animation.frameFloatOffset}else{this._timelineArray[p+4]=0}this._timeline=m;m.type=s;m.offset=p;if(u===1){m.frameIndicesOffset=-1;this._timelineArray[p+5+0]=f.call(this,i[0],0,0)-this._animation.frameOffset}else{var d=this._animation.frameCount+1;var v=this._data.frameIndices;var y=0;if(t.DragonBones.webAssembly){y=v.size();v.resize(y+d,0)}else{y=v.length;v.length+=d}m.frameIndicesOffset=y;for(var g=0,D=0,b=0,T=0;g0){if(t.DataParser.CURVE in e){var s=i+1;this._helpArray.length=s;this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[n+1]=2;this._frameArray[n+2]=s;for(var o=0;o0){var s=this._armature.sortedSlots.length;var o=new Array(s-n.length/2);var l=new Array(s);for(var h=0;h0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.TWEEN_ROTATE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[o++]=this._helpTransform.x;this._frameFloatArray[o++]=this._helpTransform.y;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=this._helpTransform.skew;this._frameFloatArray[o++]=this._helpTransform.scaleX;this._frameFloatArray[o++]=this._helpTransform.scaleY;this._parseActionDataInFrame(e,a,this._bone,this._slot);return s};r.prototype._parseBoneTranslateFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,0);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,0);return n};r.prototype._parseBoneRotateFrame=function(e,a,i){var n=r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;if(a!==0){if(this._prevClockwise===0){n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation)}else{if(this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.CLOCK_WISE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD;return s};r.prototype._parseBoneScaleFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,1);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,1);return n};r.prototype._parseSurfaceFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=e[t.DataParser.VERTICES];var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._surface.vertices.length/2;var f=0;var u=0;this._frameFloatArray.length+=h*2;for(var _=0;_=o.length){f=0}else{f=o[_-l]}if(_+1=o.length){u=0}else{u=o[_+1-l]}this._frameFloatArray[n+_]=f;this._frameFloatArray[n+_+1]=u}if(a===0){var c=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[c+0]=0;this._frameIntArray[c+1]=this._frameFloatArray.length-n;this._frameIntArray[c+2]=this._frameFloatArray.length-n;this._frameIntArray[c+3]=0;this._frameIntArray[c+4]=n-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=c-this._animation.frameIntOffset}return s};r.prototype._parseSlotDisplayFrame=function(e,a,i){var n=this._parseFrame(e,a,i);this._frameArray.length+=1;if(t.DataParser.VALUE in e){this._frameArray[n+1]=r._getNumber(e,t.DataParser.VALUE,0)}else{this._frameArray[n+1]=r._getNumber(e,t.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(e,a,this._slot.parent,this._slot);return n};r.prototype._parseSlotColorFrame=function(e,a,r){var i=this._parseTweenFrame(e,a,r);var n=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){o;this._parseColorTransform(s,this._helpColorTransform);n=this._intArray.length;this._intArray.length+=8;this._intArray[n++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.redMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.alphaOffset);this._intArray[n++]=Math.round(this._helpColorTransform.redOffset);this._intArray[n++]=Math.round(this._helpColorTransform.greenOffset);this._intArray[n++]=Math.round(this._helpColorTransform.blueOffset);n-=8;break}}if(n<0){if(this._defaultColorOffset<0){this._defaultColorOffset=n=this._intArray.length;this._intArray.length+=8;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=0;this._intArray[n++]=0;this._intArray[n++]=0;this._intArray[n++]=0}n=this._defaultColorOffset}var l=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[l]=n;return i};r.prototype._parseSlotFFDFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null;var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._intArray[this._mesh.vertices.offset+0];var f=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var u=this._mesh.vertices.weight;var _=0;var c=0;var m=0;var p=0;if(u!==null){var d=this._weightSlotPose[f];this._helpMatrixA.copyFromArray(d,0);this._frameFloatArray.length+=u.count*2;m=u.offset+2+u.bones.length}else{this._frameFloatArray.length+=h*2}for(var v=0;v=o.length){_=0}else{_=o[v-l]}if(v+1=o.length){c=0}else{c=o[v+1-l]}}if(u!==null){var y=this._weightBonePoses[f];var g=this._intArray[m++];this._helpMatrixA.transformPoint(_,c,this._helpPoint,true);_=this._helpPoint.x;c=this._helpPoint.y;for(var D=0;D=0||t.DataParser.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);s.version=i;s.name=r._getString(e,t.DataParser.NAME,"");s.frameRate=r._getNumber(e,t.DataParser.FRAME_RATE,24);if(s.frameRate===0){s.frameRate=24}if(t.DataParser.ARMATURE in e){this._data=s;this._parseArray(e);var o=e[t.DataParser.ARMATURE];for(var l=0,h=o;l0){s.stage=s.getArmature(s.armatureNames[0])}this._data=null}if(t.DataParser.TEXTURE_ATLAS in e){this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]}return s}else{console.assert(false,"Nonsupport data version: "+i+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};r.prototype.parseTextureAtlasData=function(e,a,i){if(i===void 0){i=1}console.assert(e!==undefined);if(e===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(n,a,i);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}a.width=r._getNumber(e,t.DataParser.WIDTH,0);a.height=r._getNumber(e,t.DataParser.HEIGHT,0);a.scale=i===1?1/r._getNumber(e,t.DataParser.SCALE,1):i;a.name=r._getString(e,t.DataParser.NAME,"");a.imagePath=r._getString(e,t.DataParser.IMAGE_PATH,"");if(t.DataParser.SUB_TEXTURE in e){var s=e[t.DataParser.SUB_TEXTURE];for(var o=0,l=s.length;o0&&_>0){f.frame=t.TextureData.createRectangle();f.frame.x=r._getNumber(h,t.DataParser.FRAME_X,0);f.frame.y=r._getNumber(h,t.DataParser.FRAME_Y,0);f.frame.width=u;f.frame.height=_}a.addTexture(f)}}return true};r.getInstance=function(){if(r._objectDataParserInstance===null){r._objectDataParserInstance=new r}return r._objectDataParserInstance};r._objectDataParserInstance=null;return r}(t.DataParser);t.ObjectDataParser=e;var a=function(){function t(){this.frameStart=0;this.actions=[]}return t}();t.ActionFrame=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.prototype._inRange=function(t,e,a){return e<=t&&t<=a};a.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var f=0;while(t.length>i){var u=t[i++];if(u===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(u,0,127)){s=u}else{if(this._inRange(u,194,223)){l=1;f=128;o=u-192}else if(this._inRange(u,224,239)){l=2;f=2048;o=u-224}else if(this._inRange(u,240,244)){l=3;f=65536;o=u-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(u,128,191)){o=0;l=0;h=0;f=0;i--;s=u}else{h+=1;o=o+(u-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var c=f;o=0;l=0;h=0;f=0;if(this._inRange(_,c,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=u}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};a.prototype._getUTF16Key=function(t){for(var e=0,a=t.length;e255){return encodeURI(t)}}return t};a.prototype._parseBinaryTimeline=function(e,a,r){if(r===void 0){r=null}var i=r!==null?r:t.BaseObject.borrowObject(t.TimelineData);i.type=e;i.offset=a;this._timeline=i;var n=this._timelineArrayBuffer[i.offset+2];if(n===1){i.frameIndicesOffset=-1}else{var s=0;var o=this._animation.frameCount+1;var l=this._data.frameIndices;if(t.DragonBones.webAssembly){s=l.size();l.resize(s+o,0)}else{s=l.length;l.length+=o}i.frameIndicesOffset=s;for(var h=0,f=0,u=0,_=0;h=0){var i=t.BaseObject.borrowObject(t.WeightData);var n=this._intArrayBuffer[a.offset+0];var s=this._intArrayBuffer[r+0];i.offset=r;for(var o=0;o0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};e.prototype._buildBones=function(e,a){for(var r=0,i=e.armature.sortedBones;r0){o.texture=this._getTextureData(e.textureAtlasName,a.path)}if(r!==null&&r.type===2&&this._isSupportMesh()){s=i.meshDisplay}else{s=i.rawDisplay}break}case 2:{var l=a;if(l.texture===null){l.texture=this._getTextureData(n,l.path)}else if(e!==null&&e.textureAtlasName.length>0){l.texture=this._getTextureData(e.textureAtlasName,l.path)}if(this._isSupportMesh()){s=i.meshDisplay}else{s=i.rawDisplay}break}case 1:{var h=a;var f=this._buildChildArmature(e,i,a);if(f!==null){f.inheritAnimation=h.inheritAnimation;if(!f.inheritAnimation){var u=h.actions.length>0?h.actions:f.armatureData.defaultActions;if(u.length>0){for(var _=0,c=u;_=0){continue}var f=a.getDisplays(h.name);if(!f){if(s!==null&&a!==s){f=s.getDisplays(h.name)}if(!f){if(r){h.rawDisplayDatas=null;h.displayList=[]}continue}}var u=t.DragonBones.webAssembly?f.size():f.length;var _=h.displayList;_.length=u;for(var c=0,m=u;c=0&&this._display!==null&&a!==null){var r=a.parent;if(this._armature.replacedTexture!==null&&this._rawDisplayDatas!==null&&this._rawDisplayDatas.indexOf(this._displayData)>=0){if(this._armature._replaceTextureAtlasData===null){r=t.BaseObject.borrowObject(t.HiloTextureAtlasData);r.copyFrom(a.parent);r.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=r}else{r=this._armature._replaceTextureAtlasData}a=r.getTexture(a.name)}var i=r.renderTexture;if(i!==null){if(e!==null){}else{this._textureScale=a.parent.scale*this._armature._armatureData.scale;var n=this._renderDisplay;n.setImage(i,[a.region.x,a.region.y,a.region.width,a.region.height])}this._visibleDirty=true;return}}if(e!==null){}else{var n=this._renderDisplay;n.x=0;n.y=0;n.visible=false}};a.prototype._updateMesh=function(){};a.prototype._updateGlueMesh=function(){};a.prototype._updateTransform=function(){this.updateGlobalTransform();var e=this.global;if(this._renderDisplay===this._rawDisplay||this._renderDisplay===this._meshDisplay){var a=e.x-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY);var r=e.y-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY);this._renderDisplay.x=a;this._renderDisplay.y=r;this._renderDisplay.rotation=e.rotation*t.Transform.RAD_DEG;this._renderDisplay.skew=e.skew;this._renderDisplay.scaleX=e.scaleX*this._textureScale;this._renderDisplay.scaleY=e.scaleY*this._textureScale}else{this._renderDisplay.x=e.x;this._renderDisplay.y=e.y;this._renderDisplay.rotation=e.rotation*t.Transform.RAD_DEG;this._renderDisplay.skew=e.skew;this._renderDisplay.scaleX=e.scaleX*this._textureScale;this._renderDisplay.scaleY=e.scaleY*this._textureScale}};a.prototype._identityTransform=function(){this._renderDisplay.x=0;this._renderDisplay.y=0;this._renderDisplay.rotation=0;this._renderDisplay.skew=0;this._renderDisplay.scaleX=1;this._renderDisplay.scaleY=1};return a}(t.Slot);t.HiloSlot=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(t){if(t===void 0){t=null}var r=e.call(this,t)||this;if(a._dragonBonesInstance===null){a._dragonBonesInstance=a._createDragonBones()}r._dragonBones=a._dragonBonesInstance;return r}a._createDragonBones=function(){var e=new t.HiloArmatureDisplay(null);var r=new t.DragonBones(e);r.tick=function(t){a._dragonBonesInstance.advanceTime(t*.001)};return r};Object.defineProperty(a,"factory",{get:function(){if(a._factory===null){a._factory=new a}return a._factory},enumerable:true,configurable:true});a.prototype._isSupportMesh=function(){console.warn("Hilo can not support mesh.");return false};a.prototype._buildTextureAtlasData=function(e,a){if(e){e.renderTexture=a}else{e=t.BaseObject.borrowObject(t.HiloTextureAtlasData)}return e};a.prototype._buildArmature=function(e){var a=t.BaseObject.borrowObject(t.Armature);var r=new t.HiloArmatureDisplay(null);a.init(e.armature,r,r,this._dragonBones);return a};a.prototype._buildSlot=function(e,a,r){e;r;var i=t.BaseObject.borrowObject(t.HiloSlot);var n=new Hilo.Bitmap(null);i.init(a,r,n,n);return i};a.prototype.buildArmatureDisplay=function(t,e,a,r){if(e===void 0){e=""}if(a===void 0){a=""}if(r===void 0){r=""}var i=this.buildArmature(t,e||"",a||"",r||"");if(i!==null){this._dragonBones.clock.add(i);return i.display}return null};a.prototype.getTextureDisplay=function(t,e){if(e===void 0){e=null}var a=this._getTextureData(e!==null?e:"",t);if(a!==null){var r=a.parent.renderTexture;if(r){var i=new Hilo.Bitmap(null);i.setImage(r,a.region);return i}}return null};Object.defineProperty(a.prototype,"soundEventManager",{get:function(){return this._dragonBones.eventManager},enumerable:true,configurable:true});Object.defineProperty(a,"clock",{get:function(){return a.factory.clock},enumerable:true,configurable:true});a._dragonBonesInstance=null;a._factory=null;return a}(t.BaseFactory);t.HiloFactory=e})(dragonBones||(dragonBones={}));
\ No newline at end of file
+"use strict";var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(e,a){t(e,a);function r(){this.constructor=e}e.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}();var dragonBones;(function(t){var e=function(){function e(a){this._clock=new t.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=a;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var a=0,r=this._objects;a0){for(var n=0;na){i.length=a}t._maxCountMap[r]=a}else{t._defaultMaxCount=a;for(var r in t._poolsMap){var i=t._poolsMap[r];if(i.length>a){i.length=a}if(r in t._maxCountMap){t._maxCountMap[r]=a}}}};t.clearPool=function(e){if(e===void 0){e=null}if(e!==null){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){r.length=0}}else{for(var i in t._poolsMap){var r=t._poolsMap[i];r.length=0}}};t.borrowObject=function(e){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){var i=r.pop();i._isInPool=false;return i}var n=new e;n._onClear();return n};t.prototype.returnToPool=function(){this._onClear();t._returnObject(this)};t._hashCode=0;t._defaultMaxCount=3e3;t._maxCountMap={};t._poolsMap={};return t}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var u=l+t.width;var f=h+t.height;var _=a*l+i*h+s;var m=r*l+n*h+o;var p=a*u+i*h+s;var c=r*u+n*h+o;var d=a*u+i*f+s;var y=r*u+n*f+o;var v=a*l+i*f+s;var g=r*l+n*f+o;var D=0;if(_>p){D=_;_=p;p=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_v?p:v)-t.x);if(m>c){D=m;m=c;c=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(mg?c:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}t.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};t.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};t.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};t.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};t.prototype.fromMatrix=function(e){var a=this.scaleX,r=this.scaleY;var i=t.PI_Q;this.x=e.tx;this.y=e.ty;this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);this.scaleX=this.rotation>-i&&this.rotation-i&&n=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(r>=0&&this.scaleY<0){this.scaleY=-this.scaleY;n=n-Math.PI}this.skew=n-this.rotation;return this};t.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};t.PI=Math.PI;t.PI_D=Math.PI*2;t.PI_H=Math.PI/2;t.PI_Q=Math.PI/4;t.RAD_DEG=180/Math.PI;t.DEG_RAD=Math.PI/180;return t}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.ints=[];e.floats=[];e.strings=[];return e}e.toString=function(){return"[class dragonBones.UserData]"};e.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};e.prototype.addInt=function(t){this.ints.push(t)};e.prototype.addFloat=function(t){this.floats.push(t)};e.prototype.addString=function(t){this.strings.push(t)};e.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};a.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};a.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};a.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};a.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};a.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};a.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};a.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};a.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};a.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return a}(t.BaseObject);t.ArmatureData=e;var a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.transform=new t.Transform;a.userData=null;return a}a.toString=function(){return"[class dragonBones.BoneData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return a}(t.BaseObject);t.BoneData=a;var r=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.geometry=new t.GeometryData;return a}a.toString=function(){return"[class dragonBones.SurfaceData]"};a.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return a}(a);t.SurfaceData=r;var i=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}a.createColor=function(){return new t.ColorTransform};a.toString=function(){return"[class dragonBones.SlotData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.zIndex=0;this.alpha=1;this.name="";this.color=null;this.userData=null;this.parent=null};a.DEFAULT_COLOR=new t.ColorTransform;return a}(t.BaseObject);t.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.order=0;this.name="";this.type=0;this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.scaleEnabled=false;this.bendPositive=false;this.weight=1};return e}(e);t.IKConstraintData=a;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.bones=[];return e}e.toString=function(){return"[class dragonBones.PathConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.pathSlot=null;this.pathDisplayData=null;this.bones.length=0;this.positionMode=0;this.spacingMode=1;this.rotateMode=1;this.position=0;this.spacing=0;this.rotateOffset=0;this.rotateMix=0;this.translateMix=0};e.prototype.AddBone=function(t){this.bones.push(t)};return e}(e);t.PathConstraintData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.displays={};return e}e.toString=function(){return"[class dragonBones.SkinData]"};e.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};e.rectangleIntersectsSegment=function(t,a,r,i,n,s,o,l,h,u,f){if(h===void 0){h=null}if(u===void 0){u=null}if(f===void 0){f=null}var _=t>n&&ts&&an&&rs&&i=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=this.width*.5;var h=this.height*.5;var u=e.rectangleIntersectsSegment(t,a,r,i,-l,-h,l,h,n,s,o);return u};return e}(e);t.RectangleBoundingBoxData=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.EllipseData]"};e.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=s/o;var _=f*f;e*=f;r*=f;var m=a-t;var p=r-e;var c=Math.sqrt(m*m+p*p);var d=m/c;var y=p/c;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var T=s*s;var b=T-D+g;var A=0;if(b>=0){var P=Math.sqrt(b);var S=v-P;var O=v+P;var x=S<0?-1:S<=c?0:1;var B=O<0?-1:O<=c?0:1;var E=x*B;if(E<0){return-1}else if(E===0){if(x===-1){A=2;a=t+O*d;r=(e+O*y)/f;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,a/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*y)/f;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.x=Math.atan2(e/T*_,t/T);u.y=u.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+O*d;h.y=(e+O*y)/f;if(u!==null){u.y=Math.atan2(h.y/T*_,h.x/T)}}}}}return A};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};e.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=e.ellipseIntersectsSegment(t,a,r,i,0,0,this.width*.5,this.height*.5,n,s,o);return l};return e}(e);t.EllipseBoundingBoxData=r;var i=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};e.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var u=e-r;var f=t*r-e*a;var _=0;var m=i[l-2];var p=i[l-1];var c=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var T=0;T=m&&B<=b||B>=b&&B<=m)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var E=(f*S-u*O)/x;if((E>=p&&E<=A||E>=A&&E<=p)&&(u===0||E>=e&&E<=r||E>=r&&E<=e)){if(s!==null){var M=B-t;if(M<0){M=-M}if(_===0){c=M;d=M;y=B;v=E;g=B;D=E;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}}else{if(Md){d=M;g=B;D=E;if(o!==null){o.y=Math.atan2(A-p,b-m)-Math.PI*.5}}}_++}else{y=B;v=E;g=B;D=E;_++;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}break}}}m=b;p=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};e.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;ae._zIndex*1e3+e._zOrder?1:-1};a.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};a.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};a.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};a.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};a.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};a.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};a.prototype.init=function(e,a,r,i){if(this._armatureData!==null){return}this._armatureData=e;this._animation=t.BaseObject.borrowObject(t.Animation);this._proxy=a;this._display=r;this._dragonBones=i;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};a.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty||this._zIndexDirty){this._slots.sort(a._onSortSlots);if(this._zIndexDirty){for(var r=0,i=this._slots.length;r0){for(var f=0,_=this._actions;f<_.length;f++){var m=_[f];var p=m.actionData;if(p!==null){if(p.type===0){if(m.slot!==null){var c=m.slot.childArmature;if(c!==null){c.animation.fadeIn(p.name)}}else if(m.bone!==null){for(var d=0,y=this.getSlots();d0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var b=o?i.y-e:i.x-t;if(b<0){b=-b}if(d===null||bh){h=b;_=n.x;m=n.y;y=D;if(s!==null){c=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=u;i.y=f;if(s!==null){s.x=p}}if(y!==null&&n!==null){n.x=_;n.y=m;if(s!==null){s.y=c}}return d};a.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};a.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};a.prototype.invalidUpdate=function(){this._transformDirty=true};a.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(a.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=r){return this.globalTransformMatrix}n=a>this._kX*(t+r)+d;p=((o*l+o+l+l+m)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=m*(h+2);var D=this._hullCache[4];var T=this._hullCache[5];var b=this._hullCache[2]-(l-m)*D;var A=this._hullCache[3]-(l-m)*T;var P=this._vertices;if(n){this._getAffineTransform(-r,d+f,i-r,f,P[g+h+2],P[g+h+3],b+D,A+T,P[g],P[g+1],e._helpTransform,v,true)}else{this._getAffineTransform(-i,d,i-r,f,b,A,P[g],P[g+1],b+D,A+T,e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(t>=r){if(a<-r||a>=r){return this.globalTransformMatrix}n=a>this._kX*(t-i)+d;p=((o*l+o+m)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=(m+1)*(h+2)-2;var D=this._hullCache[4];var T=this._hullCache[5];var b=this._hullCache[0]+m*D;var A=this._hullCache[1]+m*T;var P=this._vertices;if(n){this._getAffineTransform(i,d+f,i-r,f,b+D,A+T,P[g+h+2],P[g+h+3],b,A,e._helpTransform,v,true)}else{this._getAffineTransform(r,d,i-r,f,P[g],P[g+1],b,A,P[g+h+2],P[g+h+3],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(a<-r){if(t<-r||t>=r){return this.globalTransformMatrix}n=a>this._kY*(t-c-u)-i;p=((o*l+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=_*2;var D=this._hullCache[10];var T=this._hullCache[11];var b=this._hullCache[8]+_*D;var A=this._hullCache[9]+_*T;var P=this._vertices;if(n){this._getAffineTransform(c+u,-r,u,i-r,P[g+2],P[g+3],P[g],P[g+1],b+D,A+T,e._helpTransform,v,true)}else{this._getAffineTransform(c,-i,u,i-r,b,A,b+D,A+T,P[g],P[g+1],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(a>=r){if(t<-r||t>=r){return this.globalTransformMatrix}n=a>this._kY*(t-c-u)+r;p=((o*l+o+l+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=l*(h+2)+_*2;var D=this._hullCache[10];var T=this._hullCache[11];var b=this._hullCache[6]-(o-_)*D;var A=this._hullCache[7]-(o-_)*T;var P=this._vertices;if(n){this._getAffineTransform(c+u,i,u,i-r,b+D,A+T,b,A,P[g+2],P[g+3],e._helpTransform,v,true)}else{this._getAffineTransform(c,r,u,i-r,P[g],P[g+1],P[g+2],P[g+3],b,A,e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else{n=a>this._k*(t-c-u)+d;p=((o*m+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=_*2+m*(h+2);var P=this._vertices;if(n){this._getAffineTransform(c+u,d+f,u,f,P[g+h+4],P[g+h+5],P[g+h+2],P[g+h+3],P[g+2],P[g+3],e._helpTransform,v,true)}else{this._getAffineTransform(c,d,u,f,P[g],P[g+1],P[g+2],P[g+3],P[g+h+2],P[g+h+3],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}return v};e.prototype.init=function(e,a){if(this._boneData!==null){return}t.prototype.init.call(this,e,a);var r=e.segmentX;var i=e.segmentY;var n=this._armature.armatureData.parent.intArray[e.geometry.offset+0];var s=1e3;var o=200;this._dX=o*2/r;this._dY=o*2/i;this._k=-this._dY/this._dX;this._kX=-this._dY/(s-o);this._kY=-(s-o)/this._dX;this._vertices.length=n*2;this._deformVertices.length=n*2;this._matrixCahce.length=(r*i+r*2+i*2)*2*7;this._hullCache.length=10;for(var l=0;l=0&&this._cachedFrameIndices!==null){var a=this._cachedFrameIndices[t];if(a>=0&&this._cachedFrameIndex===a){this._transformDirty=false}else if(a>=0){this._transformDirty=true;this._cachedFrameIndex=a}else{if(this._hasConstraint){for(var r=0,i=this._armature._constraints;r=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var s=0,o=this._armature._constraints;s=0;if(this._localDirty){this._updateGlobalTransformMatrix(u)}if(u&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var f=1e3;var _=200;var m=2*this.global.x;var p=2*this.global.y;var c=e._helpPoint;this.globalTransformMatrix.transformPoint(f,-_,c);this._hullCache[0]=c.x;this._hullCache[1]=c.y;this._hullCache[2]=m-c.x;this._hullCache[3]=p-c.y;this.globalTransformMatrix.transformPoint(0,this._dY,c,true);this._hullCache[4]=c.x;this._hullCache[5]=c.y;this.globalTransformMatrix.transformPoint(_,f,c);this._hullCache[6]=c.x;this._hullCache[7]=c.y;this._hullCache[8]=m-c.x;this._hullCache[9]=p-c.y;this.globalTransformMatrix.transformPoint(this._dX,0,c,true);this._hullCache[10]=c.x;this._hullCache[11]=c.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return e}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.deformVertices=[];return e}e.toString=function(){return"[class dragonBones.DisplayFrame]"};e.prototype._onClear=function(){this.rawDisplayData=null;this.displayData=null;this.textureData=null;this.display=null;this.deformVertices.length=0};e.prototype.updateDeformVertices=function(){if(this.rawDisplayData===null||this.deformVertices.length!==0){return}var t;if(this.rawDisplayData.type===2){t=this.rawDisplayData.geometry}else if(this.rawDisplayData.type===4){t=this.rawDisplayData.geometry}else{return}var e=0;if(t.weight!==null){e=t.weight.count*2}else{e=t.data.intArray[t.offset+0]*2}this.deformVertices.length=e;for(var a=0,r=this.deformVertices.length;a=0&&this._displayIndex0){for(var o=0,l=n;o=0&&this._cachedFrameIndices!==null){var r=this._cachedFrameIndices[t];if(r>=0&&this._cachedFrameIndex===r){this._transformDirty=false}else if(r>=0){this._transformDirty=true;this._cachedFrameIndex=r}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._transformDirty){if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform();this._transformDirty=false}};r.prototype.invalidUpdate=function(){this._displayDataDirty=true;this._displayDirty=true;this._transformDirty=true};r.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._updateGlobalTransformMatrix(false);this._transformDirty=false}};r.prototype.replaceRawDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.rawDisplayData!==t){a.deformVertices.length=0;a.rawDisplayData=t;if(a.rawDisplayData===null){var r=this._armature._armatureData.defaultSkin;if(r!==null){var i=r.getDisplays(this._slotData.name);if(i!==null&&e=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.displayData!==t&&a.rawDisplayData!==t){a.displayData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};r.prototype.replaceTextureData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.textureData!==t){a.textureData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};r.prototype.replaceDisplay=function(e,a){if(a===void 0){a=-1}if(a<0){a=this._displayIndex<0?0:this._displayIndex}else if(a>=this._displayFrames.length){return}var r=this._displayFrames[a];if(r.display!==e){var i=r.display;r.display=e;if(i!==null&&i!==this._rawDisplay&&i!==this._meshDisplay&&!this._hasDisplay(i)){if(i instanceof t.Armature){}else{this._disposeDisplay(i,true)}}if(e!==null&&e!==this._rawDisplay&&e!==this._meshDisplay&&!this._hasDisplay(i)&&!(e instanceof t.Armature)){this._initDisplay(e,true)}if(a===this._displayIndex){this._displayDirty=true}}};r.prototype.containsPoint=function(t,e){if(this._boundingBoxData===null){return false}this.updateTransformAndMatrix();r._helpMatrix.copyFrom(this.globalTransformMatrix);r._helpMatrix.invert();r._helpMatrix.transformPoint(t,e,r._helpPoint);return this._boundingBoxData.containsPoint(r._helpPoint.x,r._helpPoint.y)};r.prototype.intersectsSegment=function(t,e,a,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(this._boundingBoxData===null){return 0}this.updateTransformAndMatrix();r._helpMatrix.copyFrom(this.globalTransformMatrix);r._helpMatrix.invert();r._helpMatrix.transformPoint(t,e,r._helpPoint);t=r._helpPoint.x;e=r._helpPoint.y;r._helpMatrix.transformPoint(a,i,r._helpPoint);a=r._helpPoint.x;i=r._helpPoint.y;var l=this._boundingBoxData.intersectsSegment(t,e,a,i,n,s,o);if(l>0){if(l===1||l===2){if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n);if(s!==null){s.x=n.x;s.y=n.y}}else if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}else{if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}if(o!==null){this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),r._helpPoint,true);o.x=Math.atan2(r._helpPoint.y,r._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),r._helpPoint,true);o.y=Math.atan2(r._helpPoint.y,r._helpPoint.x)}}return l};r.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]};Object.defineProperty(r.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(a){var r=this._displayFrames.length;if(ra){for(var i=r-1;id){continue}var b=0;for(;;D++){var A=y[D];if(c>A){continue}if(D===0){b=c/A}else{var P=y[D-1];b=(c-P)/(A-P)}break}if(D!==p){p=D;if(u&&D===m){this._computeVertices(_-4,4,0,f);this._computeVertices(0,4,4,f)}else{this._computeVertices(D*6+2,8,0,f)}}this.addCurvePosition(b,f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],l,g,a)}return}if(u){_+=2;f.length=o;this._computeVertices(2,_-4,0,f);this._computeVertices(0,2,_-4,f);f[_-2]=f[0];f[_-1]=f[1]}else{m--;_-=4;f.length=_;this._computeVertices(2,_,0,f)}var S=new Array(m);d=0;var O=f[0],x=f[1],B=0,E=0,M=0,I=0,F=0,C=0;var w,N,R,j,k,L,V,Y;for(var v=0,U=2;vd){continue}for(;;D++){var W=S[D];if(z>W)continue;if(D===0)z/=W;else{var K=S[D-1];z=(z-K)/(W-K)}break}if(D!==p){p=D;var Z=D*6;O=f[Z];x=f[Z+1];B=f[Z+2];E=f[Z+3];M=f[Z+4];I=f[Z+5];F=f[Z+6];C=f[Z+7];w=(O-B*2+M)*.03;N=(x-E*2+I)*.03;R=((B-M)*3-O+F)*.006;j=((E-I)*3-x+C)*.006;k=w*2+R;L=N*2+j;V=(B-O)*.3+w+R*.16666667;Y=(E-x)*.3+N+j*.16666667;G=Math.sqrt(V*V+Y*Y);X[0]=G;for(Z=1;Z<8;Z++){V+=k;Y+=L;k+=R;L+=j;G+=Math.sqrt(V*V+Y*Y);X[Z]=G}V+=k;Y+=L;G+=Math.sqrt(V*V+Y*Y);X[8]=G;V+=k+R;Y+=L+j;G+=Math.sqrt(V*V+Y*Y);X[9]=G;H=0}z*=G;for(;;H++){var q=X[H];if(z>q)continue;if(H===0)z/=q;else{var K=X[H-1];z=H+(z-K)/(q-K)}break}this.addCurvePosition(z*.1,O,x,B,E,M,I,F,C,l,g,a)}};a.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,u,f){if(t===0){h[u]=e;h[u+1]=a;h[u+2]=0;return}if(t===1){h[u]=o;h[u+1]=l;h[u+2]=0;return}var _=1-t;var m=_*_;var p=t*t;var c=m*_;var d=m*t*3;var y=_*p*3;var v=t*p;var g=c*e+d*r+y*n+v*o;var D=c*a+d*i+y*s+v*l;h[u]=g;h[u+1]=D;if(f){h[u+2]=Math.atan2(D-(c*a+d*i+y*s),g-(c*e+d*r+y*n))}else{h[u+2]=0}};a.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD}}var B=this.rotateMix;var E=this.translateMix;for(var c=0,M=3;c0){var N=g.a,R=g.b,j=g.c,k=g.d,L=void 0,V=void 0,Y=void 0;if(u){L=A[M-1]}else{L=Math.atan2(F,I)}L-=Math.atan2(R,N);if(x){V=Math.cos(L);Y=Math.sin(L);var U=y._boneData.length;S+=(U*(V*N-Y*R)-I)*B;O+=(U*(Y*N+V*R)-F)*B}else{L+=P}if(L>t.Transform.PI){L-=t.Transform.PI_D}else if(L<-t.Transform.PI){L+=t.Transform.PI_D}L*=B;V=Math.cos(L);Y=Math.sin(L);g.a=V*N-Y*R;g.b=Y*N+V*R;g.c=V*j-Y*k;g.d=Y*j+V*k}y.global.fromMatrix(g)}this.dirty=false};a.prototype.invalidUpdate=function(){};return a}(e);t.PathConstraint=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=0}this.time=0;this.timeScale=1;this._systemTime=0;this._animatebles=[];this._clock=null;this.time=t;this._systemTime=(new Date).getTime()*.001}t.prototype.advanceTime=function(t){if(t!==t){t=0}var e=Date.now()*.001;if(t<0){t=e-this._systemTime}this._systemTime=e;if(this.timeScale!==1){t*=this.timeScale}if(t===0){return}if(t<0){this.time-=t}else{this.time+=t}var a=0,r=0,i=this._animatebles.length;for(;a0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&n._subFadeState>0){this._armature._dragonBones.bufferObject(n);this._animationStates.length=0;this._lastAnimationState=null}else{var s=n.animationData;var o=s.cacheFrameRate;if(this._animationDirty&&o>0){this._animationDirty=false;for(var l=0,h=this._armature.getBones();l0){var p=m.getDisplayFrameAt(0).rawDisplayData;if(p!==null&&p.parent===this._armature.armatureData.defaultSkin){m._cachedFrameIndices=s.getSlotCachedFrameIndices(m.name);continue}}m._cachedFrameIndices=null}}n.advanceTime(t,o)}}else if(i>1){for(var c=0,d=0;c0&&n._subFadeState>0){d++;this._armature._dragonBones.bufferObject(n);this._animationDirty=true;if(this._lastAnimationState===n){this._lastAnimationState=null}}else{if(d>0){this._animationStates[c-d]=n}n.advanceTime(t,0)}if(c===i-1&&d>0){this._animationStates.length-=d;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};a.prototype.reset=function(){for(var t=0,e=this._animationStates;t0){if(e.position<0){e.position%=r.duration;e.position=r.duration-e.position}else if(e.position===r.duration){e.position-=1e-6}else if(e.position>r.duration){e.position%=r.duration}if(e.duration>0&&e.position+e.duration>r.duration){e.duration=r.duration-e.position}if(e.playTimes<0){e.playTimes=r.playTimes}}else{e.playTimes=1;e.position=0;if(e.duration>0){e.duration=0}}if(e.duration===0){e.duration=-1}this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);o.init(this._armature,r,e);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var l=false;for(var h=0,u=this._animationStates.length;hthis._animationStates[h].layer){l=true;this._animationStates.splice(h,0,o);break}else if(h!==u-1&&o.layer>this._animationStates[h+1].layer){l=true;this._animationStates.splice(h+1,0,o);break}}if(!l){this._animationStates.push(o)}}else{this._animationStates.push(o)}for(var f=0,_=this._armature.getSlots();f<_.length;f++){var m=_[f];var p=m.childArmature;if(p!==null&&p.inheritAnimation&&p.animation.hasAnimation(a)&&p.animation.getState(a)===null){p.animation.fadeIn(a)}}for(var c in r.animationTimelines){var d=this.fadeIn(c,0,1,o.layer,"",5);if(d===null){continue}var y=r.animationTimelines[c];d.actionEnabled=false;d.resetToPose=false;d.stop();o.addState(d,y);var v=this._animationStates.indexOf(o);var g=this._animationStates.indexOf(d);if(g0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};a.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.frameCount>0?r.duration*e/r.frameCount:0}return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};a.prototype.getBlendState=function(e,a,r){if(!(e in this._blendStates)){this._blendStates[e]={}}var i=this._blendStates[e];if(!(a in i)){var n=i[a]=t.BaseObject.borrowObject(t.BlendState);n.target=r}return i[a]};a.prototype.getState=function(t,e){if(e===void 0){e=-1}var a=this._animationStates.length;while(a--){var r=this._animationStates[a];if(r.name===t&&(e<0||r.layer===e)){return r}}return null};a.prototype.hasAnimation=function(t){return t in this._animations};a.prototype.getStates=function(){return this._animationStates};Object.defineProperty(a.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});return a}(t.BaseObject);t.Animation=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var t=e!==null&&e.apply(this,arguments)||this;t._boneMask=[];t._boneTimelines=[];t._boneBlendTimelines=[];t._slotTimelines=[];t._slotBlendTimelines=[];t._constraintTimelines=[];t._animationTimelines=[];t._poseTimelines=[];t._actionTimeline=null;t._zOrderTimeline=null;return t}r.toString=function(){return"[class dragonBones.AnimationState]"};r.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0){this._boneTimelines.splice(D,1);n.returnToPool()}D=this._boneBlendTimelines.indexOf(n);if(D>=0){this._boneBlendTimelines.splice(D,1);n.returnToPool()}}}}{var T={};var b=[];for(var A=0,P=this._slotTimelines;A=0){this._slotTimelines.splice(D,1);n.returnToPool()}D=this._slotBlendTimelines.indexOf(n);if(D>=0){this._slotBlendTimelines.splice(D,1);n.returnToPool()}}}}};r.prototype._advanceFadeTime=function(e){var a=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var r=this._parent===null&&this.actionEnabled;if(r){var i=a?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(i)){var n=t.BaseObject.borrowObject(t.EventObject);n.type=i;n.armature=this._armature;n.animationState=this;this._armature._dragonBones.bufferEvent(n)}}}if(e<0){e=-e}this._fadeTime+=e;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=a?0:1}else if(this._fadeTime>0){this._fadeProgress=a?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=a?1:0}if(this._subFadeState>0){if(!a){this._playheadState|=1;this._fadeState=0}var r=this._parent===null&&this.actionEnabled;if(r){var i=a?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(i)){var n=t.BaseObject.borrowObject(t.EventObject);n.type=i;n.armature=this._armature;n.animationState=this;this._armature._dragonBones.bufferEvent(n)}}}};r.prototype.init=function(e,a,r){if(this._armature!==null){return}this._armature=e;this._animationData=a;this.resetToPose=r.resetToPose;this.additive=r.additive;this.displayControl=r.displayControl;this.actionEnabled=r.actionEnabled;this.blendType=a.blendType;this.layer=r.layer;this.playTimes=r.playTimes;this.timeScale=r.timeScale;this.fadeTotalTime=r.fadeInTime;this.autoFadeOutTime=r.autoFadeOutTime;this.name=r.name.length>0?r.name:r.animation;this.group=r.group;this._weight=r.weight;if(r.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(r.duration<0){this._position=0;this._duration=this._animationData.duration;if(r.position!==0){if(this.timeScale>=0){this._time=r.position}else{this._time=r.position-this._duration}}else{this._time=0}}else{this._position=r.position;this._duration=r.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(r.boneMask.length>0){this._boneMask.length=r.boneMask.length;for(var i=0,n=this._boneMask.length;i0;var i=true;var n=true;var s=this._time;this._weightResult=this._weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(this._weight===0){return}if(r){var o=e*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*e);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){var h=false;var u=null;if(n){for(var f=0,_=this._boneTimelines.length;f<_;++f){var m=this._boneTimelines[f];if(m.playState<=0){m.update(s)}if(m.target!==u){var p=m.target;h=p.update(this);u=p;if(p.dirty===1){var c=p.target.animationPose;c.x=0;c.y=0;c.rotation=0;c.skew=0;c.scaleX=1;c.scaleY=1}}if(h){m.blend(a)}}}for(var f=0,_=this._boneBlendTimelines.length;f<_;++f){var m=this._boneBlendTimelines[f];if(m.playState<=0){m.update(s)}if(m.target.update(this)){m.blend(a)}}if(this.displayControl){for(var f=0,_=this._slotTimelines.length;f<_;++f){var m=this._slotTimelines[f];if(m.playState<=0){var d=m.target;var y=d.displayController;if(y===null||y===this.name||y===this.group){m.update(s)}}}}for(var f=0,_=this._slotBlendTimelines.length;f<_;++f){var m=this._slotBlendTimelines[f];if(m.playState<=0){var p=m.target;m.update(s);if(p.update(this)){m.blend(a)}}}for(var f=0,_=this._constraintTimelines.length;f<_;++f){var m=this._constraintTimelines[f];if(m.playState<=0){m.update(s)}}if(this._animationTimelines.length>0){var v=100;var g=100;var D=null;var T=null;for(var f=0,_=this._animationTimelines.length;f<_;++f){var m=this._animationTimelines[f];if(m.playState<=0){m.update(s)}if(this.blendType===1){var b=m.target;var A=this.parameterX-b.positionX;if(A>=0){if(A0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var P=0,S=this._poseTimelines;P=0){this._boneTimelines.splice(O,1);m.returnToPool();continue}O=this._boneBlendTimelines.indexOf(m);if(O>=0){this._boneBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._slotTimelines.indexOf(m);if(O>=0){this._slotTimelines.splice(O,1);m.returnToPool();continue}O=this._slotBlendTimelines.indexOf(m);if(O>=0){this._slotBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._constraintTimelines.indexOf(m);if(O>=0){this._constraintTimelines.splice(O,1);m.returnToPool();continue}}this._poseTimelines.length=0}}if(this._actionTimeline.playState>0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};r.prototype.play=function(){this._playheadState=3};r.prototype.stop=function(){this._playheadState&=1};r.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};r.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};r.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,u=i;h0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&this._parent===null){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.dirty++;this.layer=e;this.leftWeight=0;this.blendWeight=0;return false}this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}a*=this.leftWeight;this.dirty++;this.blendWeight=a;this.layerWeight+=this.blendWeight;return true}return false}this.dirty++;this.layer=e;this.leftWeight=1;this.blendWeight=a;this.layerWeight=a;return true};e.prototype.reset=function(){this.dirty=0;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};e.BONE_TRANSFORM="boneTransform";e.BONE_ALPHA="boneAlpha";e.SURFACE="surface";e.SLOT_DEFORM="slotDeform";e.SLOT_ALPHA="slotAlpha";e.SLOT_Z_INDEX="slotZIndex";return e}(t.BaseObject);t.BlendState=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.dirty=false;this.playState=-1;this.currentPlayTimes=-1;this.currentTime=-1;this.target=null;this._isTween=false;this._valueOffset=0;this._frameValueOffset=0;this._frameOffset=0;this._frameRate=0;this._frameCount=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._valueArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this._duration+1e-6}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState.animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;if(this._timelineData!==null){var r=this._animationData.parent.parent;this._frameArray=r.frameArray;this._timelineArray=r.timelineArray;this._frameIndices=r.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){this.dirty=false};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._isTween||this.dirty){this._onUpdateFrame()}}};e.prototype.blend=function(t){};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a>0;var n=a+1;var s=Math.floor(t*n);var o=0;var l=0;if(i){o=s===0?0:e[r+s-1];l=s===n-1?1e4:e[r+s]}else{o=e[r+s-1];l=e[r+s]}return(o+(l-o)*(t*n-s))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenEasing=0;this._tweenProgress=0;this._valueScale=1};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this.dirty=true;this._isTween=false}};e.prototype._onUpdateFrame=function(){if(this._isTween){this.dirty=true;this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}};return e}(e);t.TweenTimelineState=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._current=0;this._difference=0;this._result=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._valueScale;var a=this._valueArray;var r=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var i=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:r+1;if(e===1){this._current=a[r];this._difference=a[i]-this._current}else{this._current=a[r]*e;this._difference=a[i]*e-this._current}}else{this._result=a[r]*e}}else{this._result=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._result=this._current+this._difference*this._tweenProgress}};return e}(a);t.SingleValueTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._currentA=0;this._currentB=0;this._differenceA=0;this._differenceB=0;this._resultA=0;this._resultB=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._valueScale;var a=this._valueArray;var r=this._valueOffset+this._frameValueOffset+this._frameIndex*2;if(this._isTween){var i=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:r+2;if(e===1){this._currentA=a[r];this._currentB=a[r+1];this._differenceA=a[i]-this._currentA;this._differenceB=a[i+1]-this._currentB}else{this._currentA=a[r]*e;this._currentB=a[r+1]*e;this._differenceA=a[i]*e-this._currentA;this._differenceB=a[i+1]*e-this._currentB}}else{this._resultA=a[r]*e;this._resultB=a[r+1]*e}}else{this._resultA=0;this._resultB=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._resultA=this._currentA+this._differenceA*this._tweenProgress;this._resultB=this._currentB+this._differenceB*this._tweenProgress}};return e}(a);t.DoubleValueTimelineState=i;var n=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._rd=[];return e}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._valueCount=0;this._rd.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);var e=this._valueCount;var a=this._rd;if(this._timelineData!==null){var r=this._valueScale;var i=this._valueArray;var n=this._valueOffset+this._frameValueOffset+this._frameIndex*e;if(this._isTween){var s=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:n+e;if(r===1){for(var o=0;o0){if(s.hasDBEventListener(t.EventObject.COMPLETE)){u=t.BaseObject.borrowObject(t.EventObject);u.type=t.EventObject.COMPLETE;u.armature=this._armature;u.animationState=this._animationState}}}if(this._frameCount>1){var f=this._timelineData;var _=Math.floor(this.currentTime*this._frameRate);var m=this._frameIndices[f.frameIndicesOffset+_];if(this._frameIndex!==m){var p=this._frameIndex;this._frameIndex=m;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[f.offset+5+this._frameIndex];if(l){if(p<0){var c=Math.floor(i*this._frameRate);p=this._frameIndices[f.frameIndicesOffset+c];if(this.currentPlayTimes===r){if(p===m){p=-1}}}while(p>=0){var d=this._animationData.frameOffset+this._timelineArray[f.offset+5+p];var y=this._frameArray[d]/this._frameRate;if(this._position<=y&&y<=this._position+this._duration){this._onCrossFrame(p)}if(h!==null&&p===0){this._armature._dragonBones.bufferEvent(h);h=null}if(p>0){p--}else{p=this._frameCount-1}if(p===m){break}}}else{if(p<0){var c=Math.floor(i*this._frameRate);p=this._frameIndices[f.frameIndicesOffset+c];var d=this._animationData.frameOffset+this._timelineArray[f.offset+5+p];var y=this._frameArray[d]/this._frameRate;if(this.currentPlayTimes===r){if(i<=y){if(p>0){p--}else{p=this._frameCount-1}}else if(p===m){p=-1}}}while(p>=0){if(p=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.ZOrderTimelineState=a;var r=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._rd[2]=t.Transform.normalizeRadian(this._rd[2]);this._rd[3]=t.Transform.normalizeRadian(this._rd[3])}if(this._timelineData===null){this._rd[4]=1;this._rd[5]=1}};a.prototype.init=function(t,a,r){e.prototype.init.call(this,t,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=6;this._valueArray=this._animationData.parent.parent.frameFloatArray};a.prototype.fadeOut=function(){this.dirty=false;this._rd[2]=t.Transform.normalizeRadian(this._rd[2]);this._rd[3]=t.Transform.normalizeRadian(this._rd[3])};a.prototype.blend=function(t){var e=this._armature.armatureData.scale;var a=this._rd;var r=this.target;var i=r.target;var n=r.blendWeight;var s=i.animationPose;if(r.dirty>1){s.x+=a[0]*n*e;s.y+=a[1]*n*e;s.rotation+=a[2]*n;s.skew+=a[3]*n;s.scaleX+=(a[4]-1)*n;s.scaleY+=(a[5]-1)*n}else{s.x=a[0]*n*e;s.y=a[1]*n*e;s.rotation=a[2]*n;s.skew=a[3]*n;s.scaleX=(a[4]-1)*n+1;s.scaleY=(a[5]-1)*n+1}if(t||this.dirty){this.dirty=false;i._transformDirty=true}};return a}(t.MutilpleValueTimelineState);t.BoneAllTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=this._animationData.parent.parent.frameFloatArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.x+=this._resultA*r;i.y+=this._resultB*r}else if(r!==1){i.x=this._resultA*r;i.y=this._resultB*r}else{i.x=this._resultA;i.y=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return e}(t.DoubleValueTimelineState);t.BoneTranslateTimelineState=i;var n=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._differenceA=t.Transform.normalizeRadian(this._differenceA);this._differenceB=t.Transform.normalizeRadian(this._differenceB)}};a.prototype.init=function(t,a,r){e.prototype.init.call(this,t,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};a.prototype.fadeOut=function(){this.dirty=false;this._resultA=t.Transform.normalizeRadian(this._resultA);this._resultB=t.Transform.normalizeRadian(this._resultB)};a.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.rotation+=this._resultA*r;i.skew+=this._resultB*r}else if(r!==1){i.rotation=this._resultA*r;i.skew=this._resultB*r}else{i.rotation=this._resultA;i.skew=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return a}(t.DoubleValueTimelineState);t.BoneRotateTimelineState=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){this._resultA=1;this._resultB=1}};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.scaleX+=(this._resultA-1)*r;i.scaleY+=(this._resultB-1)*r}else if(r!==1){i.scaleX=(this._resultA-1)*r+1;i.scaleY=(this._resultB-1)*r+1}else{i.scaleX=this._resultA;i.scaleY=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return e}(t.DoubleValueTimelineState);t.BoneScaleTimelineState=s;var o=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);if(this._timelineData!==null){var i=this._animationData.parent.parent;var n=i.frameIntArray;var s=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=n[s+2];this._deformCount=n[s+1];this._deformOffset=n[s+3];this._sameValueOffset=n[s+4]+this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=i.frameFloatArray;this._rd.length=this._valueCount*2}else{this._deformCount=this.target.target._deformVertices.length}};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a._deformVertices;var n=this._valueArray;if(n!==null){var s=this._valueCount;var o=this._deformOffset;var l=this._sameValueOffset;var h=this._rd;for(var u=0;u1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u1){a._alpha+=this._result*r;if(a._alpha>1){a._alpha=1}}else{a._alpha=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._alphaDirty=true}};return e}(t.SingleValueTimelineState);t.AlphaTimelineState=l;var h=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotDislayTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target;var e=this._timelineData!==null?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;if(t.displayIndex!==e){t._setDisplayIndex(e,true)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.SlotDislayTimelineState=h;var u=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[0,0,0,0,0,0,0,0];e._difference=[0,0,0,0,0,0,0,0];e._result=[0,0,0,0,0,0,0,0];return e}e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.parent.parent;var a=e.colorArray;var r=e.frameIntArray;var i=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex;var n=r[i];if(n<0){n+=65536}if(this._isTween){this._current[0]=a[n++];this._current[1]=a[n++];this._current[2]=a[n++];this._current[3]=a[n++];this._current[4]=a[n++];this._current[5]=a[n++];this._current[6]=a[n++];this._current[7]=a[n++];if(this._frameIndex===this._frameCount-1){n=r[this._animationData.frameIntOffset+this._frameValueOffset]}else{n=r[i+1]}if(n<0){n+=65536}this._difference[0]=a[n++]-this._current[0];this._difference[1]=a[n++]-this._current[1];this._difference[2]=a[n++]-this._current[2];this._difference[3]=a[n++]-this._current[3];this._difference[4]=a[n++]-this._current[4];this._difference[5]=a[n++]-this._current[5];this._difference[6]=a[n++]-this._current[6];this._difference[7]=a[n++]-this._current[7]}else{this._result[0]=a[n++]*.01;this._result[1]=a[n++]*.01;this._result[2]=a[n++]*.01;this._result[3]=a[n++]*.01;this._result[4]=a[n++];this._result[5]=a[n++];this._result[6]=a[n++];this._result[7]=a[n++]}}else{var s=this.target;var o=s.slotData.color;this._result[0]=o.alphaMultiplier;this._result[1]=o.redMultiplier;this._result[2]=o.greenMultiplier;this._result[3]=o.blueMultiplier;this._result[4]=o.alphaOffset;this._result[5]=o.redOffset;this._result[6]=o.greenOffset;this._result[7]=o.blueOffset}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._result[0]=(this._current[0]+this._difference[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._difference[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._difference[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._difference[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress;this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress;this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress;this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress}};e.prototype.fadeOut=function(){this._isTween=false};e.prototype.update=function(e){t.prototype.update.call(this,e);if(this._isTween||this.dirty){var a=this.target;var r=a._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(r.alphaMultiplier!==this._result[0]||r.redMultiplier!==this._result[1]||r.greenMultiplier!==this._result[2]||r.blueMultiplier!==this._result[3]||r.alphaOffset!==this._result[4]||r.redOffset!==this._result[5]||r.greenOffset!==this._result[6]||r.blueOffset!==this._result[7]){var i=Math.pow(this._animationState._fadeProgress,4);r.alphaMultiplier+=(this._result[0]-r.alphaMultiplier)*i;r.redMultiplier+=(this._result[1]-r.redMultiplier)*i;r.greenMultiplier+=(this._result[2]-r.greenMultiplier)*i;r.blueMultiplier+=(this._result[3]-r.blueMultiplier)*i;r.alphaOffset+=(this._result[4]-r.alphaOffset)*i;r.redOffset+=(this._result[5]-r.redOffset)*i;r.greenOffset+=(this._result[6]-r.greenOffset)*i;r.blueOffset+=(this._result[7]-r.blueOffset)*i;a._colorDirty=true}}else if(this.dirty){this.dirty=false;if(r.alphaMultiplier!==this._result[0]||r.redMultiplier!==this._result[1]||r.greenMultiplier!==this._result[2]||r.blueMultiplier!==this._result[3]||r.alphaOffset!==this._result[4]||r.redOffset!==this._result[5]||r.greenOffset!==this._result[6]||r.blueOffset!==this._result[7]){r.alphaMultiplier=this._result[0];r.redMultiplier=this._result[1];r.greenMultiplier=this._result[2];r.blueMultiplier=this._result[3];r.alphaOffset=this._result[4];r.redOffset=this._result[5];r.greenOffset=this._result[6];r.blueOffset=this._result[7];a._colorDirty=true}}}};return e}(t.TweenTimelineState);t.SlotColorTimelineState=u;var f=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){var e=this.target;var a=e.target;this._result=a.slotData.zIndex}};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueArray=this._animationData.parent.parent.frameIntArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;if(e.dirty>1){a._zIndex+=this._result*r}else{a._zIndex=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._zIndexDirty=true}};return e}(t.SingleValueTimelineState);t.SlotZIndexTimelineState=f;var _=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.DeformTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.geometryOffset=0;this.displayFrame=null;this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);if(this._timelineData!==null){var i=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];var n=this._animationData.parent.parent;var s=n.frameIntArray;var o=this.target.target;this.geometryOffset=s[i+0];if(this.geometryOffset<0){this.geometryOffset+=65536}for(var l=0,h=o.displayFrameCount;l1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u0;e._weight=this._currentB}else{var a=e._constraintData;e._bendPositive=a.bendPositive;e._weight=a.weight}e.invalidUpdate();this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=.01;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.DoubleValueTimelineState);t.IKConstraintTimelineState=m;var p=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.currentTime=this._result*e.totalTime}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.SingleValueTimelineState);t.AnimationProgressTimelineState=p;var c=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.weight=this._result}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.SingleValueTimelineState);t.AnimationWeightTimelineState=c;var d=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.parameterX=this._resultA;e.parameterY=this._resultB}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.DoubleValueTimelineState);t.AnimationParametersTimelineState=d})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.actionDataToInstance=function(t,a,r){if(t.type===0){a.type=e.FRAME_EVENT}else{a.type=t.type===10?e.FRAME_EVENT:e.SOUND_EVENT}a.name=t.name;a.armature=r;a.actionData=t;a.data=t.data;if(t.bone!==null){a.bone=r.getBone(t.bone.name)}if(t.slot!==null){a.slot=r.getSlot(t.slot.name)}};e.toString=function(){return"[class dragonBones.EventObject]"};e.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};e.START="start";e.LOOP_COMPLETE="loopComplete";e.COMPLETE="complete";e.FADE_IN="fadeIn";e.FADE_IN_COMPLETE="fadeInComplete";e.FADE_OUT="fadeOut";e.FADE_OUT_COMPLETE="fadeOutComplete";e.FRAME_EVENT="frameEvent";e.SOUND_EVENT="soundEvent";return e}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(){}t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}};t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};t.DATA_VERSION_2_3="2.3";t.DATA_VERSION_3_0="3.0";t.DATA_VERSION_4_0="4.0";t.DATA_VERSION_4_5="4.5";t.DATA_VERSION_5_0="5.0";t.DATA_VERSION_5_5="5.5";t.DATA_VERSION_5_6="5.6";t.DATA_VERSION=t.DATA_VERSION_5_6;t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6];t.TEXTURE_ATLAS="textureAtlas";t.SUB_TEXTURE="SubTexture";t.FORMAT="format";t.IMAGE_PATH="imagePath";t.WIDTH="width";t.HEIGHT="height";t.ROTATED="rotated";t.FRAME_X="frameX";t.FRAME_Y="frameY";t.FRAME_WIDTH="frameWidth";t.FRAME_HEIGHT="frameHeight";t.DRADON_BONES="dragonBones";t.USER_DATA="userData";t.ARMATURE="armature";t.CANVAS="canvas";t.BONE="bone";t.SURFACE="surface";t.SLOT="slot";t.CONSTRAINT="constraint";t.SKIN="skin";t.DISPLAY="display";t.FRAME="frame";t.IK="ik";t.PATH_CONSTRAINT="path";t.ANIMATION="animation";t.TIMELINE="timeline";t.FFD="ffd";t.TRANSLATE_FRAME="translateFrame";t.ROTATE_FRAME="rotateFrame";t.SCALE_FRAME="scaleFrame";t.DISPLAY_FRAME="displayFrame";t.COLOR_FRAME="colorFrame";t.DEFAULT_ACTIONS="defaultActions";t.ACTIONS="actions";t.EVENTS="events";t.INTS="ints";t.FLOATS="floats";t.STRINGS="strings";t.TRANSFORM="transform";t.PIVOT="pivot";t.AABB="aabb";t.COLOR="color";t.VERSION="version";t.COMPATIBLE_VERSION="compatibleVersion";t.FRAME_RATE="frameRate";t.TYPE="type";t.SUB_TYPE="subType";t.NAME="name";t.PARENT="parent";t.TARGET="target";t.STAGE="stage";t.SHARE="share";t.PATH="path";t.LENGTH="length";t.DISPLAY_INDEX="displayIndex";t.Z_ORDER="zOrder";t.Z_INDEX="zIndex";t.BLEND_MODE="blendMode";t.INHERIT_TRANSLATION="inheritTranslation";t.INHERIT_ROTATION="inheritRotation";t.INHERIT_SCALE="inheritScale";t.INHERIT_REFLECTION="inheritReflection";t.INHERIT_ANIMATION="inheritAnimation";t.INHERIT_DEFORM="inheritDeform";t.SEGMENT_X="segmentX";t.SEGMENT_Y="segmentY";t.BEND_POSITIVE="bendPositive";t.CHAIN="chain";t.WEIGHT="weight";t.BLEND_TYPE="blendType";t.FADE_IN_TIME="fadeInTime";t.PLAY_TIMES="playTimes";t.SCALE="scale";t.OFFSET="offset";t.POSITION="position";t.DURATION="duration";t.TWEEN_EASING="tweenEasing";t.TWEEN_ROTATE="tweenRotate";t.TWEEN_SCALE="tweenScale";t.CLOCK_WISE="clockwise";t.CURVE="curve";t.SOUND="sound";t.EVENT="event";t.ACTION="action";t.X="x";t.Y="y";t.SKEW_X="skX";t.SKEW_Y="skY";t.SCALE_X="scX";t.SCALE_Y="scY";t.VALUE="value";t.ROTATE="rotate";t.SKEW="skew";t.ALPHA="alpha";t.ALPHA_OFFSET="aO";t.RED_OFFSET="rO";t.GREEN_OFFSET="gO";t.BLUE_OFFSET="bO";t.ALPHA_MULTIPLIER="aM";t.RED_MULTIPLIER="rM";t.GREEN_MULTIPLIER="gM";t.BLUE_MULTIPLIER="bM";t.UVS="uvs";t.VERTICES="vertices";t.TRIANGLES="triangles";t.WEIGHTS="weights";t.SLOT_POSE="slotPose";t.BONE_POSE="bonePose";t.BONES="bones";t.POSITION_MODE="positionMode";t.SPACING_MODE="spacingMode";t.ROTATE_MODE="rotateMode";t.SPACING="spacing";t.ROTATE_OFFSET="rotateOffset";t.ROTATE_MIX="rotateMix";t.TRANSLATE_MIX="translateMix";t.TARGET_DISPLAY="targetDisplay";t.CLOSED="closed";t.CONSTANT_SPEED="constantSpeed";t.VERTEX_COUNT="vertexCount";t.LENGTHS="lengths";t.GOTO_AND_PLAY="gotoAndPlay";t.DEFAULT_NAME="default";return t}();t.DataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var a=e!==null&&e.apply(this,arguments)||this;a._rawTextureAtlasIndex=0;a._rawBones=[];a._data=null;a._armature=null;a._bone=null;a._geometry=null;a._slot=null;a._skin=null;a._mesh=null;a._animation=null;a._timeline=null;a._rawTextureAtlases=null;a._frameValueType=0;a._defaultColorOffset=-1;a._prevClockwise=0;a._prevRotation=0;a._frameDefaultValue=0;a._frameValueScale=1;a._helpMatrixA=new t.Matrix;a._helpMatrixB=new t.Matrix;a._helpTransform=new t.Transform;a._helpColorTransform=new t.ColorTransform;a._helpPoint=new t.Point;a._helpArray=[];a._intArray=[];a._floatArray=[];a._frameIntArray=[];a._frameFloatArray=[];a._frameArray=[];a._timelineArray=[];a._colorArray=[];a._cacheRawMeshes=[];a._cacheMeshes=[];a._actionFrames=[];a._weightSlotPose={};a._weightBonePoses={};a._cacheBones={};a._slotChildActions={};return a}r._getBoolean=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="boolean"){return r}else if(i==="string"){switch(r){case"0":case"NaN":case"":case"false":case"null":case"undefined":return false;default:return true}}else{return!!r}}return a};r._getNumber=function(t,e,a){if(e in t){var r=t[e];if(r===null||r==="NaN"){return a}return+r||0}return a};r._getString=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="string"){return r}return String(r)}return a};r.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var u=1-l;var f=u*u;var _=l*l;var m=u*f;var p=3*l*f;var c=3*u*_;var d=l*_;h.x=m*t+p*a+c*i+d*s;h.y=m*e+p*r+c*n+d*o};r.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3===1){var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return true}else{var r=0;for(var i=0,n=e.length;i1e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return false}};r.prototype._parseActionDataInFrame=function(e,a,r,i){if(t.DataParser.EVENT in e){this._mergeActionFrame(e[t.DataParser.EVENT],a,10,r,i)}if(t.DataParser.SOUND in e){this._mergeActionFrame(e[t.DataParser.SOUND],a,11,r,i)}if(t.DataParser.ACTION in e){this._mergeActionFrame(e[t.DataParser.ACTION],a,0,r,i)}if(t.DataParser.EVENTS in e){this._mergeActionFrame(e[t.DataParser.EVENTS],a,10,r,i)}if(t.DataParser.ACTIONS in e){this._mergeActionFrame(e[t.DataParser.ACTIONS],a,0,r,i)}};r.prototype._mergeActionFrame=function(t,e,r,i,n){var s=this._armature.actions.length;var o=this._parseActionData(t,r,i,n);var l=0;var h=null;for(var u=0,f=o;ue){break}l++}if(h===null){h=new a;h.frameStart=e;this._actionFrames.splice(l,0,h)}for(var d=0;d0){var p=i.getBone(_);if(p!==null){m.parent=p}else{if(!(_ in this._cacheBones)){this._cacheBones[_]=[]}this._cacheBones[_].push(m)}}if(m.name in this._cacheBones){for(var c=0,d=this._cacheBones[m.name];c0&&a.parent!==null){s.root=a.parent;s.bone=a}else{s.root=a;s.bone=null}return s};r.prototype._parsePathConstraint=function(e){var a=this._armature.getSlot(r._getString(e,t.DataParser.TARGET,""));if(a===null){return null}var i=this._armature.defaultSkin;if(i===null){return null}var n=i.getDisplay(a.name,r._getString(e,t.DataParser.TARGET_DISPLAY,a.name));if(n===null||!(n instanceof t.PathDisplayData)){return null}var s=e[t.DataParser.BONES];if(s===null||s.length===0){return null}var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=r._getString(e,t.DataParser.NAME,"");o.type=1;o.pathSlot=a;o.pathDisplayData=n;o.target=a.parent;o.positionMode=t.DataParser._getPositionMode(r._getString(e,t.DataParser.POSITION_MODE,""));o.spacingMode=t.DataParser._getSpacingMode(r._getString(e,t.DataParser.SPACING_MODE,""));o.rotateMode=t.DataParser._getRotateMode(r._getString(e,t.DataParser.ROTATE_MODE,""));o.position=r._getNumber(e,t.DataParser.POSITION,0);o.spacing=r._getNumber(e,t.DataParser.SPACING,0);o.rotateOffset=r._getNumber(e,t.DataParser.ROTATE_OFFSET,0);o.rotateMix=r._getNumber(e,t.DataParser.ROTATE_MIX,1);o.translateMix=r._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var l=0,h=s;l0?i:a;this._parsePivot(e,o);break}case 1:{var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);l.name=a;l.path=i.length>0?i:a;l.inheritAnimation=true;if(t.DataParser.ACTIONS in e){var h=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);for(var u=0,f=h;u0?i:a;if(t.DataParser.SHARE in e){d.geometry.data=this._data;this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}else{this._parseMesh(e,d)}break}case 3:{var y=this._parseBoundingBox(e);if(y!==null){var v=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);v.name=a;v.path=i.length>0?i:a;v.boundingBox=y}break}case 4:{var g=e[t.DataParser.LENGTHS];var D=s=t.BaseObject.borrowObject(t.PathDisplayData);D.closed=r._getBoolean(e,t.DataParser.CLOSED,false);D.constantSpeed=r._getBoolean(e,t.DataParser.CONSTANT_SPEED,false);D.name=a;D.path=i.length>0?i:a;D.curveLengths.length=g.length;for(var T=0,b=g.length;Ta.width){a.width=l}if(ha.height){a.height=h}}}a.width-=a.x;a.height-=a.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return a};r.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);a.blendType=t.DataParser._getAnimationBlendType(r._getString(e,t.DataParser.BLEND_TYPE,""));a.frameCount=r._getNumber(e,t.DataParser.DURATION,0);a.playTimes=r._getNumber(e,t.DataParser.PLAY_TIMES,1);a.duration=a.frameCount/this._armature.frameRate;a.fadeInTime=r._getNumber(e,t.DataParser.FADE_IN_TIME,0);a.scale=r._getNumber(e,t.DataParser.SCALE,1);a.name=r._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME);if(a.name.length===0){a.name=t.DataParser.DEFAULT_NAME}a.frameIntOffset=this._frameIntArray.length;a.frameFloatOffset=this._frameFloatArray.length;a.frameOffset=this._frameArray.length;this._animation=a;if(t.DataParser.FRAME in e){var i=e[t.DataParser.FRAME];var n=i.length;if(n>0){for(var s=0,o=0;s0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame);this._actionFrames.length=0}if(t.DataParser.TIMELINE in e){var h=e[t.DataParser.TIMELINE];for(var S=0,O=h;S0&&n in e){i=e[n]}if(i===null){return null}var f=i.length;if(f===0){return null}var _=this._frameIntArray.length;var m=this._frameFloatArray.length;var p=this._timelineArray.length;if(u===null){u=t.BaseObject.borrowObject(t.TimelineData)}u.type=s;u.offset=p;this._frameValueType=o;this._timeline=u;this._timelineArray.length+=1+1+1+1+1+f;if(e!==null){this._timelineArray[p+0]=Math.round(r._getNumber(e,t.DataParser.SCALE,1)*100);this._timelineArray[p+1]=Math.round(r._getNumber(e,t.DataParser.OFFSET,0)*100)}else{this._timelineArray[p+0]=100;this._timelineArray[p+1]=0}this._timelineArray[p+2]=f;this._timelineArray[p+3]=l;switch(this._frameValueType){case 0:this._timelineArray[p+4]=0;break;case 1:this._timelineArray[p+4]=_-this._animation.frameIntOffset;break;case 2:this._timelineArray[p+4]=m-this._animation.frameFloatOffset;break}if(f===1){u.frameIndicesOffset=-1;this._timelineArray[p+5+0]=h.call(this,i[0],0,0)-this._animation.frameOffset}else{var c=this._animation.frameCount+1;var d=this._data.frameIndices;var y=d.length;d.length+=c;u.frameIndicesOffset=y;for(var v=0,g=0,D=0,T=0;v0){if(t.DataParser.CURVE in e){var s=i+1;this._helpArray.length=s;var o=this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[n+1]=2;this._frameArray[n+2]=o?s:-s;for(var l=0;l0){var s=this._armature.sortedSlots.length;var o=new Array(s-n.length/2);var l=new Array(s);for(var h=0;h0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.TWEEN_ROTATE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[o++]=this._helpTransform.x;this._frameFloatArray[o++]=this._helpTransform.y;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=this._helpTransform.skew;this._frameFloatArray[o++]=this._helpTransform.scaleX;this._frameFloatArray[o++]=this._helpTransform.scaleY;this._parseActionDataInFrame(e,a,this._bone,this._slot);return s};r.prototype._parseBoneTranslateFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,0);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,0);return n};r.prototype._parseBoneRotateFrame=function(e,a,i){var n=r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;if(a!==0){if(this._prevClockwise===0){n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation)}else{if(this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.CLOCK_WISE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD;return s};r.prototype._parseBoneScaleFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,1);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,1);return n};r.prototype._parseSlotDisplayFrame=function(e,a,i){var n=this._parseFrame(e,a,i);this._frameArray.length+=1;if(t.DataParser.VALUE in e){this._frameArray[n+1]=r._getNumber(e,t.DataParser.VALUE,0)}else{this._frameArray[n+1]=r._getNumber(e,t.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(e,a,this._slot.parent,this._slot);return n};r.prototype._parseSlotColorFrame=function(e,a,r){var i=this._parseTweenFrame(e,a,r);var n=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){o;this._parseColorTransform(s,this._helpColorTransform);n=this._colorArray.length;this._colorArray.length+=8;this._colorArray[n++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.redMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.alphaOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.redOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.greenOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.blueOffset);n-=8;break}}if(n<0){if(this._defaultColorOffset<0){this._defaultColorOffset=n=this._colorArray.length;this._colorArray.length+=8;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=0;this._colorArray[n++]=0;this._colorArray[n++]=0;this._colorArray[n++]=0}n=this._defaultColorOffset}var l=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[l]=n;return i};r.prototype._parseSlotDeformFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null;var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._intArray[this._mesh.geometry.offset+0];var u=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var f=this._mesh.geometry.weight;var _=0;var m=0;var p=0;var c=0;if(f!==null){var d=this._weightSlotPose[u];this._helpMatrixA.copyFromArray(d,0);this._frameFloatArray.length+=f.count*2;p=f.offset+2+f.bones.length}else{this._frameFloatArray.length+=h*2}for(var y=0;y=o.length){_=0}else{_=o[y-l]}if(y+1=o.length){m=0}else{m=o[y+1-l]}}if(f!==null){var v=this._weightBonePoses[u];var g=this._intArray[p++];this._helpMatrixA.transformPoint(_,m,this._helpPoint,true);_=this._helpPoint.x;m=this._helpPoint.y;for(var D=0;D=o.length){f=0}else{f=o[m-l]}if(m+1=o.length){_=0}else{_=o[m+1-l]}}else{f=0;_=0}this._frameFloatArray[n+m]=f;this._frameFloatArray[n+m+1]=_}}if(a===0){var p=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[p+0]=this._geometry.offset;this._frameIntArray[p+1]=this._frameFloatArray.length-n;this._frameIntArray[p+2]=this._frameFloatArray.length-n;this._frameIntArray[p+3]=0;this._frameIntArray[p+4]=n-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=p-this._animation.frameIntOffset}return s};r.prototype._parseTransform=function(e,a,i){a.x=r._getNumber(e,t.DataParser.X,0)*i;a.y=r._getNumber(e,t.DataParser.Y,0)*i;if(t.DataParser.ROTATE in e||t.DataParser.SKEW in e){a.rotation=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD);a.skew=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD)}else if(t.DataParser.SKEW_X in e||t.DataParser.SKEW_Y in e){a.rotation=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW_Y,0)*t.Transform.DEG_RAD);a.skew=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW_X,0)*t.Transform.DEG_RAD)-a.rotation}a.scaleX=r._getNumber(e,t.DataParser.SCALE_X,1);a.scaleY=r._getNumber(e,t.DataParser.SCALE_Y,1)};r.prototype._parseColorTransform=function(e,a){a.alphaMultiplier=r._getNumber(e,t.DataParser.ALPHA_MULTIPLIER,100)*.01;a.redMultiplier=r._getNumber(e,t.DataParser.RED_MULTIPLIER,100)*.01;a.greenMultiplier=r._getNumber(e,t.DataParser.GREEN_MULTIPLIER,100)*.01;a.blueMultiplier=r._getNumber(e,t.DataParser.BLUE_MULTIPLIER,100)*.01;a.alphaOffset=r._getNumber(e,t.DataParser.ALPHA_OFFSET,0);a.redOffset=r._getNumber(e,t.DataParser.RED_OFFSET,0);a.greenOffset=r._getNumber(e,t.DataParser.GREEN_OFFSET,0);a.blueOffset=r._getNumber(e,t.DataParser.BLUE_OFFSET,0)};r.prototype._parseGeometry=function(e,a){var r=e[t.DataParser.VERTICES];var i=Math.floor(r.length/2);var n=0;var s=this._intArray.length;var o=this._floatArray.length;a.offset=s;a.data=this._data;this._intArray.length+=1+1+1+1;this._intArray[s+0]=i;this._intArray[s+2]=o;this._intArray[s+3]=-1;this._floatArray.length+=i*2;for(var l=0,h=i*2;l=0||t.DataParser.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);s.version=i;s.name=r._getString(e,t.DataParser.NAME,"");s.frameRate=r._getNumber(e,t.DataParser.FRAME_RATE,24);if(s.frameRate===0){s.frameRate=24}if(t.DataParser.ARMATURE in e){this._data=s;this._parseArray(e);var o=e[t.DataParser.ARMATURE];for(var l=0,h=o;l0){s.stage=s.getArmature(s.armatureNames[0])}this._data=null}if(t.DataParser.TEXTURE_ATLAS in e){this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]}return s}else{console.assert(false,"Nonsupport data version: "+i+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};r.prototype.parseTextureAtlasData=function(e,a,i){if(i===void 0){i=1}console.assert(e!==undefined);if(e===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(n,a,i);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}a.width=r._getNumber(e,t.DataParser.WIDTH,0);a.height=r._getNumber(e,t.DataParser.HEIGHT,0);a.scale=i===1?1/r._getNumber(e,t.DataParser.SCALE,1):i;a.name=r._getString(e,t.DataParser.NAME,"");a.imagePath=r._getString(e,t.DataParser.IMAGE_PATH,"");if(t.DataParser.SUB_TEXTURE in e){var s=e[t.DataParser.SUB_TEXTURE];for(var o=0,l=s.length;o0&&f>0){_.frame=t.TextureData.createRectangle();_.frame.x=r._getNumber(h,t.DataParser.FRAME_X,0);_.frame.y=r._getNumber(h,t.DataParser.FRAME_Y,0);_.frame.width=u;_.frame.height=f}a.addTexture(_)}}return true};r.getInstance=function(){if(r._objectDataParserInstance===null){r._objectDataParserInstance=new r}return r._objectDataParserInstance};r._objectDataParserInstance=null;return r}(t.DataParser);t.ObjectDataParser=e;var a=function(){function t(){this.frameStart=0;this.actions=[]}return t}();t.ActionFrame=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.prototype._inRange=function(t,e,a){return e<=t&&t<=a};a.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var u=0;while(t.length>i){var f=t[i++];if(f===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(f,0,127)){s=f}else{if(this._inRange(f,194,223)){l=1;u=128;o=f-192}else if(this._inRange(f,224,239)){l=2;u=2048;o=f-224}else if(this._inRange(f,240,244)){l=3;u=65536;o=f-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(f,128,191)){o=0;l=0;h=0;u=0;i--;s=f}else{h+=1;o=o+(f-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var m=u;o=0;l=0;h=0;u=0;if(this._inRange(_,m,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=f}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};a.prototype._parseBinaryTimeline=function(e,a,r){if(r===void 0){r=null}var i=r!==null?r:t.BaseObject.borrowObject(t.TimelineData);i.type=e;i.offset=a;this._timeline=i;var n=this._timelineArrayBuffer[i.offset+2];if(n===1){i.frameIndicesOffset=-1}else{var s=0;var o=this._animation.frameCount+1;var l=this._data.frameIndices;s=l.length;l.length+=o;i.frameIndicesOffset=s;for(var h=0,u=0,f=0,_=0;h=0){var u=t.ObjectDataParser._getNumber(y,t.DataParser.TYPE,0);var v=t.ObjectDataParser._getString(y,t.DataParser.NAME,"");var _=null;if(u===40&&a.blendType!==0){_=t.BaseObject.borrowObject(t.AnimationTimelineData);var g=_;g.x=t.ObjectDataParser._getNumber(y,t.DataParser.X,0);g.y=t.ObjectDataParser._getNumber(y,t.DataParser.Y,0)}_=this._parseBinaryTimeline(u,f,_);switch(u){case 0:break;case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(v,_);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(v,_);break;case 30:this._animation.addConstraintTimeline(v,_);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(v,_);break}}}}this._animation=null;return a};a.prototype._parseGeometry=function(e,a){a.offset=e[t.DataParser.OFFSET];a.data=this._data;var r=this._intArrayBuffer[a.offset+3];if(r>=0){var i=t.BaseObject.borrowObject(t.WeightData);var n=this._intArrayBuffer[a.offset+0];var s=this._intArrayBuffer[r+0];i.offset=r;for(var o=0;o12?a[13]:0;var u=new Int16Array(this._binary,this._binaryOffset+a[0],r/Int16Array.BYTES_PER_ELEMENT);var f=new Float32Array(this._binary,this._binaryOffset+a[2],i/Float32Array.BYTES_PER_ELEMENT);var _=new Int16Array(this._binary,this._binaryOffset+a[4],n/Int16Array.BYTES_PER_ELEMENT);var m=new Float32Array(this._binary,this._binaryOffset+a[6],s/Float32Array.BYTES_PER_ELEMENT);var p=new Int16Array(this._binary,this._binaryOffset+a[8],o/Int16Array.BYTES_PER_ELEMENT);var c=new Uint16Array(this._binary,this._binaryOffset+a[10],l/Uint16Array.BYTES_PER_ELEMENT);var d=h>0?new Int16Array(this._binary,this._binaryOffset+a[12],h/Int16Array.BYTES_PER_ELEMENT):u;this._data.binary=this._binary;this._data.intArray=this._intArrayBuffer=u;this._data.floatArray=f;this._data.frameIntArray=_;this._data.frameFloatArray=m;this._data.frameArray=this._frameArrayBuffer=p;this._data.timelineArray=this._timelineArrayBuffer=c;this._data.colorArray=d};a.prototype.parseDragonBonesData=function(t,a){if(a===void 0){a=1}console.assert(t!==null&&t!==undefined&&t instanceof ArrayBuffer,"Data error.");var r=new Uint8Array(t,0,8);if(r[0]!=="D".charCodeAt(0)||r[1]!=="B".charCodeAt(0)||r[2]!=="D".charCodeAt(0)||r[3]!=="T".charCodeAt(0)){console.assert(false,"Nonsupport data.");return null}var i=new Uint32Array(t,8,1)[0];var n=new Uint8Array(t,8+4,i);var s=this._decodeUTF8(n);var o=JSON.parse(s);this._binaryOffset=8+4+i;this._binary=t;return e.prototype.parseDragonBonesData.call(this,o,a)};a.getInstance=function(){if(a._binaryDataParserInstance===null){a._binaryDataParserInstance=new a}return a._binaryDataParserInstance};a._binaryDataParserInstance=null;return a}(t.ObjectDataParser);t.BinaryDataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(a){if(a===void 0){a=null}this.autoSearch=false;this._dragonBonesDataMap={};this._textureAtlasDataMap={};this._dragonBones=null;this._dataParser=null;if(e._objectParser===null){e._objectParser=new t.ObjectDataParser}if(e._binaryParser===null){e._binaryParser=new t.BinaryDataParser}this._dataParser=a!==null?a:e._objectParser}e.prototype._isSupportMesh=function(){return true};e.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap){for(var a=0,r=this._textureAtlasDataMap[t];a0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};e.prototype._buildBones=function(e,a){for(var r=0,i=e.armature.sortedBones;r0){var c=this._getTextureData(t.textureAtlasName,p.path);f.replaceTextureData(c,_)}var d=this._getSlotDisplay(t,p,f);f.replaceDisplay(d,_)}else{f.replaceDisplay(null)}}}f._setDisplayIndex(h.displayIndex,true)}};e.prototype._buildConstraints=function(e,a){var r=e.armature.constraints;for(var i in r){var n=r[i];switch(n.type){case 0:var s=t.BaseObject.borrowObject(t.IKConstraint);s.init(n,a);a._addConstraint(s);break;case 1:var o=t.BaseObject.borrowObject(t.PathConstraint);o.init(n,a);a._addConstraint(o);break;default:var l=t.BaseObject.borrowObject(t.IKConstraint);l.init(n,a);a._addConstraint(l);break}}};e.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,t!==null?t.dataName:"","",t!==null?t.textureAtlasName:"")};e.prototype._getSlotDisplay=function(e,a,r){var i=e!==null?e.dataName:a.parent.parent.parent.name;var n=null;switch(a.type){case 0:{var s=a;if(s.texture===null){s.texture=this._getTextureData(i,a.path)}n=r.rawDisplay;break}case 2:{var o=a;if(o.texture===null){o.texture=this._getTextureData(i,o.path)}if(this._isSupportMesh()){n=r.meshDisplay}else{n=r.rawDisplay}break}case 1:{var l=a;var h=this._buildChildArmature(e,r,l);if(h!==null){h.inheritAnimation=l.inheritAnimation;if(!h.inheritAnimation){var u=l.actions.length>0?l.actions:h.armatureData.defaultActions;if(u.length>0){for(var f=0,_=u;f<_.length;f++){var m=_[f];var p=t.BaseObject.borrowObject(t.EventObject);t.EventObject.actionDataToInstance(m,p,r.armature);p.slot=r;r.armature._bufferAction(p,false)}}else{h.animation.play()}}l.armature=h.armatureData}n=h;break}case 3:break;default:break}return n};e.prototype.parseDragonBonesData=function(t,a,r){if(a===void 0){a=null}if(r===void 0){r=1}var i=t instanceof ArrayBuffer?e._binaryParser:this._dataParser;var n=i.parseDragonBonesData(t,r);while(true){var s=this._buildTextureAtlasData(null,null);if(i.parseTextureAtlasData(null,s,r)){this.addTextureAtlasData(s,a)}else{s.returnToPool();break}}if(n!==null){this.addDragonBonesData(n,a)}return n};e.prototype.parseTextureAtlasData=function(t,e,a,r){if(a===void 0){a=null}if(r===void 0){r=1}var i=this._buildTextureAtlasData(null,null);this._dataParser.parseTextureAtlasData(t,i,r);this._buildTextureAtlasData(i,e||null);this.addTextureAtlasData(i,a);return i};e.prototype.updateTextureAtlases=function(t,e){var a=this.getTextureAtlasData(e);if(a!==null){for(var r=0,i=a.length;r=0){continue}var h=e.getDisplays(l.name);if(h===null){if(n!==null&&e!==n){h=n.getDisplays(l.name)}if(h===null){if(a){l.displayFrameCount=0}continue}}l.displayFrameCount=h.length;for(var u=0,f=l.displayFrameCount;u=0&&this._display!==null&&e!==null){var a=e.parent;if(this._armature.replacedTexture!==null){if(this._armature._replaceTextureAtlasData===null){a=t.BaseObject.borrowObject(t.HiloTextureAtlasData);a.copyFrom(e.parent);a.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=a}else{a=this._armature._replaceTextureAtlasData}e=a.getTexture(e.name)}var r=a.renderTexture;if(r!==null){if(this._geometryData!==null){}else{this._textureScale=e.parent.scale*this._armature._armatureData.scale;var i=this._renderDisplay;i.setImage(r,[e.region.x,e.region.y,e.region.width,e.region.height])}this._visibleDirty=true;return}}if(this._geometryData!==null){}else{var i=this._renderDisplay;i.x=0;i.y=0;i.visible=false}};a.prototype._updateMesh=function(){};a.prototype._updateTransform=function(){this.updateGlobalTransform();var e=this.global;if(this._renderDisplay===this._rawDisplay||this._renderDisplay===this._meshDisplay){var a=e.x-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY);var r=e.y-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY);this._renderDisplay.x=a;this._renderDisplay.y=r;this._renderDisplay.rotation=e.rotation*t.Transform.RAD_DEG;this._renderDisplay.skew=e.skew;this._renderDisplay.scaleX=e.scaleX*this._textureScale;this._renderDisplay.scaleY=e.scaleY*this._textureScale}else{this._renderDisplay.x=e.x;this._renderDisplay.y=e.y;this._renderDisplay.rotation=e.rotation*t.Transform.RAD_DEG;this._renderDisplay.skew=e.skew;this._renderDisplay.scaleX=e.scaleX*this._textureScale;this._renderDisplay.scaleY=e.scaleY*this._textureScale}};a.prototype._identityTransform=function(){this._renderDisplay.x=0;this._renderDisplay.y=0;this._renderDisplay.rotation=0;this._renderDisplay.skew=0;this._renderDisplay.scaleX=1;this._renderDisplay.scaleY=1};return a}(t.Slot);t.HiloSlot=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(t){if(t===void 0){t=null}var r=e.call(this,t)||this;if(a._dragonBonesInstance===null){a._dragonBonesInstance=a._createDragonBones()}r._dragonBones=a._dragonBonesInstance;return r}a._createDragonBones=function(){var e=new t.HiloArmatureDisplay(null);var r=new t.DragonBones(e);r.tick=function(t){a._dragonBonesInstance.advanceTime(t*.001)};return r};Object.defineProperty(a,"factory",{get:function(){if(a._factory===null){a._factory=new a}return a._factory},enumerable:true,configurable:true});a.prototype._isSupportMesh=function(){console.warn("Hilo can not support mesh.");return false};a.prototype._buildTextureAtlasData=function(e,a){if(e){e.renderTexture=a}else{e=t.BaseObject.borrowObject(t.HiloTextureAtlasData)}return e};a.prototype._buildArmature=function(e){var a=t.BaseObject.borrowObject(t.Armature);var r=new t.HiloArmatureDisplay(null);a.init(e.armature,r,r,this._dragonBones);return a};a.prototype._buildSlot=function(e,a,r){e;r;var i=t.BaseObject.borrowObject(t.HiloSlot);var n=new Hilo.Bitmap(null);i.init(a,r,n,n);return i};a.prototype.buildArmatureDisplay=function(t,e,a,r){if(e===void 0){e=""}if(a===void 0){a=""}if(r===void 0){r=""}var i=this.buildArmature(t,e||"",a||"",r||"");if(i!==null){this._dragonBones.clock.add(i);return i.display}return null};a.prototype.getTextureDisplay=function(t,e){if(e===void 0){e=null}var a=this._getTextureData(e!==null?e:"",t);if(a!==null){var r=a.parent.renderTexture;if(r){var i=new Hilo.Bitmap(null);i.setImage(r,a.region);return i}}return null};Object.defineProperty(a.prototype,"soundEventManager",{get:function(){return this._dragonBones.eventManager},enumerable:true,configurable:true});a._dragonBonesInstance=null;a._factory=null;return a}(t.BaseFactory);t.HiloFactory=e})(dragonBones||(dragonBones={}));
\ No newline at end of file
diff --git a/Hilo/1.x/src/dragonBones/hilo/HiloFactory.ts b/Hilo/1.x/src/dragonBones/hilo/HiloFactory.ts
index bfed0a41..42400151 100644
--- a/Hilo/1.x/src/dragonBones/hilo/HiloFactory.ts
+++ b/Hilo/1.x/src/dragonBones/hilo/HiloFactory.ts
@@ -201,19 +201,5 @@ namespace dragonBones {
         public get soundEventManager(): HiloArmatureDisplay {
             return this._dragonBones.eventManager as HiloArmatureDisplay;
         }
-
-        /**
-         * - Deprecated, please refer to {@link #clock}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static get clock(): WorldClock {
-            return HiloFactory.factory.clock;
-        }
     }
 }
\ No newline at end of file
diff --git a/Hilo/1.x/src/dragonBones/hilo/HiloSlot.ts b/Hilo/1.x/src/dragonBones/hilo/HiloSlot.ts
index 0ce10664..6536d015 100644
--- a/Hilo/1.x/src/dragonBones/hilo/HiloSlot.ts
+++ b/Hilo/1.x/src/dragonBones/hilo/HiloSlot.ts
@@ -104,19 +104,19 @@ namespace dragonBones {
         }
 
         protected _updateColor(): void {
+            const alpha = this._colorTransform.alphaMultiplier * this._globalAlpha;
             const color = (Math.round(this._colorTransform.redMultiplier * 0xFF) << 16) + (Math.round(this._colorTransform.greenMultiplier * 0xFF) << 8) + Math.round(this._colorTransform.blueMultiplier * 0xFF);
-
-            this._renderDisplay.alpha = this._colorTransform.alphaMultiplier;
+            this._renderDisplay.alpha = alpha;
             this._renderDisplay.tint = color;
         }
 
         protected _updateFrame(): void {
-            const currentVerticesData = (this._deformVertices !== null && this._display === this._meshDisplay) ? this._deformVertices.verticesData : null;
             let currentTextureData = this._textureData as (HiloTextureData | null);
 
             if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) {
                 let currentTextureAtlasData = currentTextureData.parent as HiloTextureAtlasData;
-                if (this._armature.replacedTexture !== null && this._rawDisplayDatas !== null && this._rawDisplayDatas.indexOf(this._displayData) >= 0) { // Update replaced texture atlas.
+                
+                if (this._armature.replacedTexture !== null) { // Update replaced texture atlas.
                     if (this._armature._replaceTextureAtlasData === null) {
                         currentTextureAtlasData = BaseObject.borrowObject(HiloTextureAtlasData);
                         currentTextureAtlasData.copyFrom(currentTextureData.parent);
@@ -132,7 +132,7 @@ namespace dragonBones {
 
                 const renderTexture = currentTextureAtlasData.renderTexture;
                 if (renderTexture !== null) {
-                    if (currentVerticesData !== null) { // Mesh.
+                    if (this._geometryData !== null) { // Mesh.
                         // TODO
                     }
                     else { // Normal texture.
@@ -146,7 +146,7 @@ namespace dragonBones {
                 }
             }
 
-            if (currentVerticesData !== null) {
+            if (this._geometryData !== null) {
                 // TODO
             }
             else {
@@ -161,12 +161,6 @@ namespace dragonBones {
         protected _updateMesh(): void {
             // TODO
         }
-        /**
-         * @internal
-         */
-        public _updateGlueMesh(): void {
-            // TODO
-        }
 
         protected _updateTransform(): void {
             this.updateGlobalTransform(); // Update transform.
diff --git a/Hilo/1.x/tsconfig.json b/Hilo/1.x/tsconfig.json
index 3cd848b7..65a86c9d 100644
--- a/Hilo/1.x/tsconfig.json
+++ b/Hilo/1.x/tsconfig.json
@@ -25,7 +25,6 @@
 	],
 	"files": [
 		"./libs/hilo.d.ts",
-		"../../DragonBones/src/dragonBones/modules.ts",
 
 		"../../DragonBones/src/dragonBones/core/DragonBones.ts",
 		"../../DragonBones/src/dragonBones/core/BaseObject.ts",
@@ -55,7 +54,6 @@
 		"../../DragonBones/src/dragonBones/armature/Surface.ts",
 		"../../DragonBones/src/dragonBones/armature/Slot.ts",
 		"../../DragonBones/src/dragonBones/armature/Constraint.ts",
-		"../../DragonBones/src/dragonBones/armature/DeformVertices.ts",
 
 		"../../DragonBones/src/dragonBones/animation/IAnimatable.ts",
 		"../../DragonBones/src/dragonBones/animation/WorldClock.ts",
diff --git a/Hilo/Demos/libs/dragonBones/.gitkeep b/Hilo/Demos/libs/dragonBones/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/Hilo/Demos/libs/hilo/.gitkeep b/Hilo/Demos/libs/hilo/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/Phaser/2.x/README.md b/Phaser/2.x/README.md
index 33207500..2bc4079b 100644
--- a/Phaser/2.x/README.md
+++ b/Phaser/2.x/README.md
@@ -1,4 +1,7 @@
 ## How to build
+* Clone or download [DragonBonesJS](https://github.com/DragonBones/DragonBonesJS/).
+* Install [Node.JS](https://nodejs.org/).
+* Open `DragonBonesJS/Phaser/2.x/` in command.
 * $ `npm install`
 * $ `npm run build`
 
diff --git a/Phaser/2.x/libs/.gitkeep b/Phaser/2.x/libs/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/Phaser/2.x/out/dragonBones.d.ts b/Phaser/2.x/out/dragonBones.d.ts
index 611268ba..761ff427 100644
--- a/Phaser/2.x/out/dragonBones.d.ts
+++ b/Phaser/2.x/out/dragonBones.d.ts
@@ -1,15 +1,3 @@
-declare namespace dragonBones {
-    /**
-     * @internal
-     * @private
-     */
-    const webAssemblyModule: {
-        HEAP16: Int16Array;
-        _malloc(byteSize: number): number;
-        _free(pointer: number): void;
-        setDataBinary(data: DragonBonesData, binaryPointer: number, intBytesLength: number, floatBytesLength: number, frameIntBytesLength: number, frameFloatBytesLength: number, frameBytesLength: number, timelineBytesLength: number): void;
-    };
-}
 /**
  * The MIT License (MIT)
  *
@@ -34,17 +22,17 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     const enum BinaryOffset {
         WeigthBoneCount = 0,
         WeigthFloatOffset = 1,
         WeigthBoneIndices = 2,
-        MeshVertexCount = 0,
-        MeshTriangleCount = 1,
-        MeshFloatOffset = 2,
-        MeshWeightOffset = 3,
-        MeshVertexIndices = 4,
+        GeometryVertexCount = 0,
+        GeometryTriangleCount = 1,
+        GeometryFloatOffset = 2,
+        GeometryWeightOffset = 3,
+        GeometryVertexIndices = 4,
         TimelineScale = 0,
         TimelineOffset = 1,
         TimelineKeyFrameCount = 2,
@@ -60,12 +48,9 @@ declare namespace dragonBones {
         DeformValueCount = 2,
         DeformValueOffset = 3,
         DeformFloatOffset = 4,
-        PathVertexCount = 0,
-        PathFloatOffset = 2,
-        PathWeightOffset = 3,
     }
     /**
-     * @internal
+     * @private
      */
     const enum ArmatureType {
         Armature = 0,
@@ -73,7 +58,7 @@ declare namespace dragonBones {
         Stage = 2,
     }
     /**
-     * @internal
+     * @private
      */
     const enum BoneType {
         Bone = 0,
@@ -105,7 +90,7 @@ declare namespace dragonBones {
         Polygon = 2,
     }
     /**
-     * @internal
+     * @private
      */
     const enum ActionType {
         Play = 0,
@@ -113,7 +98,7 @@ declare namespace dragonBones {
         Sound = 11,
     }
     /**
-     * @internal
+     * @private
      */
     const enum BlendMode {
         Normal = 0,
@@ -132,7 +117,7 @@ declare namespace dragonBones {
         Subtract = 13,
     }
     /**
-     * @internal
+     * @private
      */
     const enum TweenType {
         None = 0,
@@ -143,7 +128,7 @@ declare namespace dragonBones {
         QuadInOut = 5,
     }
     /**
-     * @internal
+     * @private
      */
     const enum TimelineType {
         Action = 0,
@@ -153,12 +138,16 @@ declare namespace dragonBones {
         BoneRotate = 12,
         BoneScale = 13,
         Surface = 50,
+        BoneAlpha = 60,
         SlotDisplay = 20,
         SlotColor = 21,
         SlotDeform = 22,
+        SlotZIndex = 23,
+        SlotAlpha = 24,
         IKConstraint = 30,
-        AnimationTime = 40,
+        AnimationProgress = 40,
         AnimationWeight = 41,
+        AnimationParameter = 42,
     }
     /**
      * - Offset mode.
@@ -186,15 +175,6 @@ declare namespace dragonBones {
      * @language zh_CN
      */
     const enum AnimationFadeOutMode {
-        /**
-         * - Do not fade out of any animation states.
-         * @language en_US
-         */
-        /**
-         * - 不淡出任何的动画状态。
-         * @language zh_CN
-         */
-        None = 0,
         /**
          * - Fade out the animation states of the same layer.
          * @language en_US
@@ -241,19 +221,45 @@ declare namespace dragonBones {
          */
         Single = 5,
     }
+    /**
+     * @private
+     */
+    const enum AnimationBlendType {
+        None = 0,
+        E1D = 1,
+    }
+    /**
+     * @private
+     */
+    const enum AnimationBlendMode {
+        Additive = 0,
+        Override = 1,
+    }
+    /**
+     * @private
+     */
     const enum ConstraintType {
         IK = 0,
         Path = 1,
     }
+    /**
+     * @private
+     */
     const enum PositionMode {
         Fixed = 0,
         Percent = 1,
     }
+    /**
+     * @private
+     */
     const enum SpacingMode {
         Length = 0,
         Fixed = 1,
         Percent = 2,
     }
+    /**
+     * @private
+     */
     const enum RotateMode {
         Tangent = 0,
         Chain = 1,
@@ -273,7 +279,6 @@ declare namespace dragonBones {
         static yDown: boolean;
         static debug: boolean;
         static debugDraw: boolean;
-        static webAssembly: boolean;
         private readonly _clock;
         private readonly _events;
         private readonly _objects;
@@ -287,6 +292,9 @@ declare namespace dragonBones {
     }
 }
 declare var __extends: any;
+declare var exports: any;
+declare var module: any;
+declare var define: any;
 /**
  * The MIT License (MIT)
  *
@@ -776,7 +784,7 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     class ColorTransform {
         alphaMultiplier: number;
@@ -1054,18 +1062,6 @@ declare namespace dragonBones {
          */
         readonly strings: Array;
         protected _onClear(): void;
-        /**
-         * @internal
-         */
-        addInt(value: number): void;
-        /**
-         * @internal
-         */
-        addFloat(value: number): void;
-        /**
-         * @internal
-         */
-        addString(value: string): void;
         /**
          * - Get the custom int number.
          * @version DragonBones 5.0
@@ -1101,7 +1097,7 @@ declare namespace dragonBones {
         getString(index?: number): string;
     }
     /**
-     * @internal
+     * @private
      */
     class ActionData extends BaseObject {
         static toString(): string;
@@ -1195,14 +1191,6 @@ declare namespace dragonBones {
          * @private
          */
         stage: ArmatureData | null;
-        /**
-         * @internal
-         */
-        readonly frameIndices: Array;
-        /**
-         * @internal
-         */
-        readonly cachedFrames: Array;
         /**
          * - All armature data names.
          * @version DragonBones 3.0
@@ -1218,43 +1206,11 @@ declare namespace dragonBones {
          * @private
          */
         readonly armatures: Map;
-        /**
-         * @internal
-         */
-        binary: ArrayBuffer;
-        /**
-         * @internal
-         */
-        intArray: Int16Array;
-        /**
-         * @internal
-         */
-        floatArray: Float32Array;
-        /**
-         * @internal
-         */
-        frameIntArray: Int16Array;
-        /**
-         * @internal
-         */
-        frameFloatArray: Float32Array;
-        /**
-         * @internal
-         */
-        frameArray: Int16Array;
-        /**
-         * @internal
-         */
-        timelineArray: Uint16Array;
         /**
          * @private
          */
         userData: UserData | null;
         protected _onClear(): void;
-        /**
-         * @internal
-         */
-        addArmature(value: ArmatureData): void;
         /**
          * - Get a specific armature data.
          * @param armatureName - The armature data name.
@@ -1268,17 +1224,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         getArmature(armatureName: string): ArmatureData | null;
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.BaseFactory#removeDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.BaseFactory#removeDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        dispose(): void;
     }
 }
 /**
@@ -1436,46 +1381,6 @@ declare namespace dragonBones {
          */
         parent: DragonBonesData;
         protected _onClear(): void;
-        /**
-         * @internal
-         */
-        sortBones(): void;
-        /**
-         * @internal
-         */
-        cacheFrames(frameRate: number): void;
-        /**
-         * @internal
-         */
-        setCacheFrame(globalTransformMatrix: Matrix, transform: Transform): number;
-        /**
-         * @internal
-         */
-        getCacheFrame(globalTransformMatrix: Matrix, transform: Transform, arrayOffset: number): void;
-        /**
-         * @internal
-         */
-        addBone(value: BoneData): void;
-        /**
-         * @internal
-         */
-        addSlot(value: SlotData): void;
-        /**
-         * @internal
-         */
-        addConstraint(value: ConstraintData): void;
-        /**
-         * @internal
-         */
-        addSkin(value: SkinData): void;
-        /**
-         * @internal
-         */
-        addAnimation(value: AnimationData): void;
-        /**
-         * @internal
-         */
-        addAction(value: ActionData, isDefault: boolean): void;
         /**
          * - Get a specific done data.
          * @param boneName - The bone name.
@@ -1580,6 +1485,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         length: number;
+        /**
+         * @private
+         */
+        alpha: number;
         /**
          * - The bone name.
          * @version DragonBones 3.0
@@ -1612,16 +1521,6 @@ declare namespace dragonBones {
         parent: BoneData | null;
         protected _onClear(): void;
     }
-    /**
-     * @internal
-     */
-    class SurfaceData extends BoneData {
-        static toString(): string;
-        segmentX: number;
-        segmentY: number;
-        readonly vertices: Array;
-        protected _onClear(): void;
-    }
     /**
      * - The slot data.
      * @version DragonBones 3.0
@@ -1633,14 +1532,6 @@ declare namespace dragonBones {
      * @language zh_CN
      */
     class SlotData extends BaseObject {
-        /**
-         * @internal
-         */
-        static readonly DEFAULT_COLOR: ColorTransform;
-        /**
-         * @internal
-         */
-        static createColor(): ColorTransform;
         static toString(): string;
         /**
          * @private
@@ -1654,6 +1545,14 @@ declare namespace dragonBones {
          * @private
          */
         zOrder: number;
+        /**
+         * @private
+         */
+        zIndex: number;
+        /**
+         * @private
+         */
+        alpha: number;
         /**
          * - The slot name.
          * @version DragonBones 3.0
@@ -1711,7 +1610,7 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     class CanvasData extends BaseObject {
         static toString(): string;
@@ -1779,10 +1678,6 @@ declare namespace dragonBones {
          */
         parent: ArmatureData;
         protected _onClear(): void;
-        /**
-         * @internal
-         */
-        addDisplay(slotName: string, value: DisplayData | null): void;
         /**
          * @private
          */
@@ -1817,7 +1712,7 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     abstract class ConstraintData extends BaseObject {
         order: number;
@@ -1828,35 +1723,6 @@ declare namespace dragonBones {
         bone: BoneData | null;
         protected _onClear(): void;
     }
-    /**
-     * @internal
-     */
-    class IKConstraintData extends ConstraintData {
-        static toString(): string;
-        scaleEnabled: boolean;
-        bendPositive: boolean;
-        weight: number;
-        protected _onClear(): void;
-    }
-    /**
-     * @internal
-     */
-    class PathConstraintData extends ConstraintData {
-        static toString(): string;
-        pathSlot: SlotData;
-        pathDisplayData: PathDisplayData;
-        bones: Array;
-        positionMode: PositionMode;
-        spacingMode: SpacingMode;
-        rotateMode: RotateMode;
-        position: number;
-        spacing: number;
-        rotateOffset: number;
-        rotateMix: number;
-        translateMix: number;
-        protected _onClear(): void;
-        AddBone(value: BoneData): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -1882,19 +1748,21 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
-    class VerticesData {
+    class GeometryData {
         isShared: boolean;
         inheritDeform: boolean;
         offset: number;
         data: DragonBonesData;
         weight: WeightData | null;
         clear(): void;
-        shareFrom(value: VerticesData): void;
+        shareFrom(value: GeometryData): void;
+        readonly vertexCount: number;
+        readonly triangleCount: number;
     }
     /**
-     * @internal
+     * @private
      */
     abstract class DisplayData extends BaseObject {
         type: DisplayType;
@@ -1905,7 +1773,7 @@ declare namespace dragonBones {
         protected _onClear(): void;
     }
     /**
-     * @internal
+     * @private
      */
     class ImageDisplayData extends DisplayData {
         static toString(): string;
@@ -1914,7 +1782,7 @@ declare namespace dragonBones {
         protected _onClear(): void;
     }
     /**
-     * @internal
+     * @private
      */
     class ArmatureDisplayData extends DisplayData {
         static toString(): string;
@@ -1928,16 +1796,16 @@ declare namespace dragonBones {
         addAction(value: ActionData): void;
     }
     /**
-     * @internal
+     * @private
      */
     class MeshDisplayData extends DisplayData {
         static toString(): string;
-        readonly vertices: VerticesData;
+        readonly geometry: GeometryData;
         texture: TextureData | null;
         protected _onClear(): void;
     }
     /**
-     * @internal
+     * @private
      */
     class BoundingBoxDisplayData extends DisplayData {
         static toString(): string;
@@ -1945,18 +1813,18 @@ declare namespace dragonBones {
         protected _onClear(): void;
     }
     /**
-     * @internal
+     * @private
      */
     class PathDisplayData extends DisplayData {
         static toString(): string;
         closed: boolean;
         constantSpeed: boolean;
-        readonly vertices: VerticesData;
+        readonly geometry: GeometryData;
         readonly curveLengths: Array;
         protected _onClear(): void;
     }
     /**
-     * @internal
+     * @private
      */
     class WeightData extends BaseObject {
         static toString(): string;
@@ -2255,20 +2123,9 @@ declare namespace dragonBones {
     class AnimationData extends BaseObject {
         static toString(): string;
         /**
-         * - FrameIntArray.
-         * @internal
-         */
-        frameIntOffset: number;
-        /**
-         * - FrameFloatArray.
-         * @internal
-         */
-        frameFloatOffset: number;
-        /**
-         * - FrameArray.
-         * @internal
+         * @private
          */
-        frameOffset: number;
+        blendType: AnimationBlendType;
         /**
          * - The frame count of the animation.
          * @version DragonBones 3.0
@@ -2340,10 +2197,6 @@ declare namespace dragonBones {
          * @private
          */
         readonly boneTimelines: Map>;
-        /**
-         * @private
-         */
-        readonly surfaceTimelines: Map>;
         /**
          * @private
          */
@@ -2377,26 +2230,18 @@ declare namespace dragonBones {
          */
         parent: ArmatureData;
         protected _onClear(): void;
-        /**
-         * @internal
-         */
-        cacheFrames(frameRate: number): void;
-        /**
-         * @private
-         */
-        addBoneTimeline(bone: BoneData, timeline: TimelineData): void;
         /**
          * @private
          */
-        addSurfaceTimeline(surface: SurfaceData, timeline: TimelineData): void;
+        addBoneTimeline(timelineName: string, timeline: TimelineData): void;
         /**
          * @private
          */
-        addSlotTimeline(slot: SlotData, timeline: TimelineData): void;
+        addSlotTimeline(timelineName: string, timeline: TimelineData): void;
         /**
          * @private
          */
-        addConstraintTimeline(constraint: ConstraintData, timeline: TimelineData): void;
+        addConstraintTimeline(timelineName: string, timeline: TimelineData): void;
         /**
          * @private
          */
@@ -2405,10 +2250,6 @@ declare namespace dragonBones {
          * @private
          */
         getBoneTimelines(timelineName: string): Array | null;
-        /**
-         * @private
-         */
-        getSurfaceTimelines(timelineName: string): Array | null;
         /**
          * @private
          */
@@ -2431,7 +2272,7 @@ declare namespace dragonBones {
         getSlotCachedFrameIndices(slotName: string): Array | null;
     }
     /**
-     * @internal
+     * @private
      */
     class TimelineData extends BaseObject {
         static toString(): string;
@@ -2520,7 +2361,7 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        additiveBlending: boolean;
+        additive: boolean;
         /**
          * - Whether the animation state has control over the display property of the slots.
          * Sometimes blend a animation state does not want it to control the display properties of the slots,
@@ -2723,18 +2564,6 @@ declare namespace dragonBones {
          * @private
          */
         copyFrom(value: AnimationConfig): void;
-        /**
-         * @private
-         */
-        containsBoneMask(boneName: string): boolean;
-        /**
-         * @private
-         */
-        addBoneMask(armature: Armature, boneName: string, recursive?: boolean): void;
-        /**
-         * @private
-         */
-        removeBoneMask(armature: Armature, boneName: string, recursive?: boolean): void;
     }
 }
 /**
@@ -2818,21 +2647,13 @@ declare namespace dragonBones {
          * @private
          */
         copyFrom(value: TextureAtlasData): void;
-        /**
-         * @internal
-         */
-        abstract createTexture(): TextureData;
-        /**
-         * @internal
-         */
-        addTexture(value: TextureData): void;
         /**
          * @private
          */
         getTexture(textureName: string): TextureData | null;
     }
     /**
-     * @internal
+     * @private
      */
     abstract class TextureData extends BaseObject {
         static createRectangle(): Rectangle;
@@ -2881,18 +2702,6 @@ declare namespace dragonBones {
      * @language zh_CN
      */
     interface IArmatureProxy extends IEventDispatcher {
-        /**
-         * @internal
-         */
-        dbInit(armature: Armature): void;
-        /**
-         * @internal
-         */
-        dbClear(): void;
-        /**
-         * @internal
-         */
-        dbUpdate(): void;
         /**
          * - Dispose the instance and the Armature instance. (The Armature instance will return to the object pool)
          * @example
@@ -3001,64 +2810,20 @@ declare namespace dragonBones {
          * @private
          */
         userData: any;
-        private _lockUpdate;
         private _slotsDirty;
         private _zOrderDirty;
         private _flipX;
         private _flipY;
-        /**
-         * @internal
-         */
-        _cacheFrameIndex: number;
+        private _alpha;
         private readonly _bones;
         private readonly _slots;
-        /**
-         * @internal
-         */
-        readonly _constraints: Array;
         private readonly _actions;
-        /**
-         * @internal
-         */
-        _armatureData: ArmatureData;
         private _animation;
         private _proxy;
         private _display;
-        /**
-         * @internal
-         */
-        _replaceTextureAtlasData: TextureAtlasData | null;
         private _replacedTexture;
-        /**
-         * @internal
-         */
-        _dragonBones: DragonBones;
         private _clock;
-        /**
-         * @internal
-         */
-        _parent: Slot | null;
         protected _onClear(): void;
-        /**
-         * @internal
-         */
-        _sortZOrder(slotIndices: Array | Int16Array | null, offset: number): void;
-        /**
-         * @internal
-         */
-        _addBone(value: Bone): void;
-        /**
-         * @internal
-         */
-        _addSlot(value: Slot): void;
-        /**
-         * @internal
-         */
-        _addConstraint(value: Constraint): void;
-        /**
-         * @internal
-         */
-        _bufferAction(action: EventObject, append: boolean): void;
         /**
          * - Dispose the armature. (Return to the object pool)
          * @example
@@ -3080,10 +2845,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         dispose(): void;
-        /**
-         * @internal
-         */
-        init(armatureData: ArmatureData, proxy: IArmatureProxy, display: any, dragonBones: DragonBones): void;
         /**
          * @inheritDoc
          */
@@ -3391,55 +3152,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly parent: Slot | null;
-        /**
-         * @deprecated
-         * @private
-         */
-        replaceTexture(texture: any): void;
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        hasEventListener(type: EventStringType): boolean;
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        addEventListener(type: EventStringType, listener: Function, target: any): void;
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        removeEventListener(type: EventStringType, listener: Function, target: any): void;
-        /**
-         * - Deprecated, please refer to {@link #cacheFrameRate}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #cacheFrameRate}。
-         * @deprecated
-         * @language zh_CN
-         */
-        enableAnimationCache(frameRate: number): void;
         /**
          * - Deprecated, please refer to {@link #display}.
          * @deprecated
@@ -3538,10 +3250,6 @@ declare namespace dragonBones {
          */
         userData: any;
         protected _globalDirty: boolean;
-        /**
-         * @internal
-         */
-        _armature: Armature;
         /**
          */
         protected _onClear(): void;
@@ -3639,55 +3347,15 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         offsetMode: OffsetMode;
-        /**
-         * @internal
-         */
-        readonly animationPose: Transform;
-        /**
-         * @internal
-         */
-        _transformDirty: boolean;
-        /**
-         * @internal
-         */
-        _childrenTransformDirty: boolean;
         protected _localDirty: boolean;
-        /**
-         * @internal
-         */
-        _hasConstraint: boolean;
         protected _visible: boolean;
         protected _cachedFrameIndex: number;
-        /**
-         * @internal
-         */
-        readonly _blendState: BlendState;
-        /**
-         * @internal
-         */
-        _boneData: BoneData;
         /**
          * @private
          */
         protected _parent: Bone | null;
-        /**
-         * @internal
-         */
-        _cachedFrameIndices: Array | null;
         protected _onClear(): void;
         protected _updateGlobalTransformMatrix(isCache: boolean): void;
-        /**
-         * @internal
-         */
-        init(boneData: BoneData, armatureValue: Armature): void;
-        /**
-         * @internal
-         */
-        update(cacheFrameIndex: number): void;
-        /**
-         * @internal
-         */
-        updateByConstraint(): void;
         /**
          * - Forces the bone to update the transform in the next frame.
          * When the bone is not animated or its animation state is finished, the bone will not continue to update,
@@ -3775,39 +3443,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly parent: Bone | null;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getBones()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getBones()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        getBones(): Array;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getSlots()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getSlots()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        getSlots(): Array;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getSlot()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getSlot()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly slot: Slot | null;
     }
 }
 /**
@@ -3833,41 +3468,6 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
-    /**
-     * @internal
-     */
-    class Surface extends Bone {
-        static toString(): string;
-        private _dX;
-        private _dY;
-        private _k;
-        private _kX;
-        private _kY;
-        readonly _vertices: Array;
-        readonly _deformVertices: Array;
-        /**
-         * - x1, y1, x2, y2, x3, y3, x4, y4, d1X, d1Y, d2X, d2Y
-         */
-        private readonly _hullCache;
-        /**
-         * - Inside [flag, a, b, c, d, tx, ty], Outside [flag, a, b, c, d, tx, ty]
-         */
-        private readonly _matrixCahce;
-        protected _onClear(): void;
-        private _getAffineTransform(x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown);
-        private _updateVertices();
-        protected _updateGlobalTransformMatrix(isCache: boolean): void;
-        _getGlobalTransformMatrix(x: number, y: number): Matrix;
-        /**
-         * @internal
-         * @private
-         */
-        init(surfaceData: SurfaceData, armatureValue: Armature): void;
-        /**
-         * @internal
-         */
-        update(cacheFrameIndex: number): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -3892,6 +3492,22 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
+    /**
+     * @private
+     */
+    class DisplayFrame extends BaseObject {
+        static toString(): string;
+        rawDisplayData: DisplayData | null;
+        displayData: DisplayData | null;
+        textureData: TextureData | null;
+        display: any | Armature | null;
+        readonly deformVertices: Array;
+        protected _onClear(): void;
+        updateDeformVertices(): void;
+        getGeometryData(): GeometryData | null;
+        getBoundingBox(): BoundingBoxData | null;
+        getTextureData(): TextureData | null;
+    }
     /**
      * - The slot attached to the armature, controls the display status and properties of the display object.
      * A bone can contain multiple slots.
@@ -3936,66 +3552,30 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         displayController: string | null;
+        protected _displayDataDirty: boolean;
         protected _displayDirty: boolean;
-        protected _zOrderDirty: boolean;
+        protected _geometryDirty: boolean;
+        protected _textureDirty: boolean;
         protected _visibleDirty: boolean;
         protected _blendModeDirty: boolean;
-        /**
-         * @internal
-         */
-        _colorDirty: boolean;
+        protected _zOrderDirty: boolean;
         protected _transformDirty: boolean;
         protected _visible: boolean;
         protected _blendMode: BlendMode;
         protected _displayIndex: number;
         protected _animationDisplayIndex: number;
-        /**
-         * @internal
-         */
-        _zOrder: number;
         protected _cachedFrameIndex: number;
-        /**
-         * @internal
-         */
-        _pivotX: number;
-        /**
-         * @internal
-         */
-        _pivotY: number;
         protected readonly _localMatrix: Matrix;
-        /**
-         * @internal
-         */
-        readonly _colorTransform: ColorTransform;
-        protected readonly _displayDatas: Array;
-        protected readonly _displayList: Array;
-        /**
-         * @internal
-         */
-        _slotData: SlotData;
-        protected _rawDisplayDatas: Array | null;
-        /**
-         * @internal
-         */
-        _displayData: DisplayData | null;
         protected _boundingBoxData: BoundingBoxData | null;
         protected _textureData: TextureData | null;
-        /**
-         * @internal
-         */
-        _deformVertices: DeformVertices | null;
         protected _rawDisplay: any;
         protected _meshDisplay: any;
-        protected _display: any;
+        protected _display: any | null;
         protected _childArmature: Armature | null;
         /**
          * @private
          */
         protected _parent: Bone;
-        /**
-         * @internal
-         */
-        _cachedFrameIndices: Array | null;
         protected _onClear(): void;
         protected abstract _initDisplay(value: any, isRetain: boolean): void;
         protected abstract _disposeDisplay(value: any, isRelease: boolean): void;
@@ -4004,59 +3584,47 @@ declare namespace dragonBones {
         protected abstract _replaceDisplay(value: any): void;
         protected abstract _removeDisplay(): void;
         protected abstract _updateZOrder(): void;
-        /**
-         * @internal
-         */
-        abstract _updateVisible(): void;
         protected abstract _updateBlendMode(): void;
         protected abstract _updateColor(): void;
         protected abstract _updateFrame(): void;
         protected abstract _updateMesh(): void;
-        /**
-         * @internal
-         */
-        abstract _updateGlueMesh(): void;
         protected abstract _updateTransform(): void;
         protected abstract _identityTransform(): void;
-        /**
-         * - Support default skin data.
-         */
-        protected _getDefaultRawDisplayData(displayIndex: number): DisplayData | null;
+        protected _hasDisplay(display: any): boolean;
         protected _updateDisplayData(): void;
         protected _updateDisplay(): void;
         protected _updateGlobalTransformMatrix(isCache: boolean): void;
         /**
-         * @internal
-         */
-        _setDisplayIndex(value: number, isAnimation?: boolean): boolean;
-        /**
-         * @internal
+         * - Forces the slot to update the state of the display object in the next frame.
+         * @version DragonBones 4.5
+         * @language en_US
          */
-        _setZorder(value: number): boolean;
         /**
-         * @internal
+         * - 强制插槽在下一帧更新显示对象的状态。
+         * @version DragonBones 4.5
+         * @language zh_CN
          */
-        _setColor(value: ColorTransform): boolean;
+        invalidUpdate(): void;
         /**
-         * @internal
+         * @private
          */
-        _setDisplayList(value: Array | null): boolean;
+        updateTransformAndMatrix(): void;
         /**
-         * @internal
+         * @private
          */
-        init(slotData: SlotData, armatureValue: Armature, rawDisplay: any, meshDisplay: any): void;
+        replaceRawDisplayData(displayData: DisplayData | null, index?: number): void;
         /**
-         * @internal
+         * @private
          */
-        update(cacheFrameIndex: number): void;
+        replaceDisplayData(displayData: DisplayData | null, index?: number): void;
         /**
          * @private
          */
-        updateTransformAndMatrix(): void;
+        replaceTextureData(textureData: TextureData | null, index?: number): void;
         /**
          * @private
          */
-        replaceDisplayData(value: DisplayData | null, displayIndex?: number): void;
+        replaceDisplay(value: any | Armature | null, index?: number): void;
         /**
          * - Check whether a specific point is inside a custom bounding box in the slot.
          * The coordinate system of the point is the inner coordinate system of the armature.
@@ -4117,16 +3685,9 @@ declare namespace dragonBones {
             y: number;
         } | null): number;
         /**
-         * - Forces the slot to update the state of the display object in the next frame.
-         * @version DragonBones 4.5
-         * @language en_US
-         */
-        /**
-         * - 强制插槽在下一帧更新显示对象的状态。
-         * @version DragonBones 4.5
-         * @language zh_CN
+         * @private
          */
-        invalidUpdate(): void;
+        getDisplayFrameAt(index: number): DisplayFrame;
         /**
          * - The visible of slot's display object.
          * @default true
@@ -4140,6 +3701,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         visible: boolean;
+        /**
+         * @private
+         */
+        displayFrameCount: number;
         /**
          * - The index of the display object displayed in the display list.
          * @example
@@ -4200,14 +3765,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly slotData: SlotData;
-        /**
-         * @private
-         */
-        rawDisplayDatas: Array | null;
-        /**
-         * @private
-         */
-        readonly displayData: DisplayData | null;
         /**
          * - The custom bounding box data for the slot at current time.
          * @version DragonBones 5.0
@@ -4253,9 +3810,9 @@ declare namespace dragonBones {
          * @example
          * 
          *     let slot = armature.getSlot("weapon");
-         * let prevChildArmature = slot.childArmature;
-         * if (prevChildArmature) {
-         * prevChildArmature.dispose();
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
          *     }
          *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
          * 
@@ -4268,9 +3825,9 @@ declare namespace dragonBones { * @example *
          *     let slot = armature.getSlot("weapon");
-         * let prevChildArmature = slot.childArmature;
-         * if (prevChildArmature) {
-         * prevChildArmature.dispose();
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
          *     }
          *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
          * 
@@ -4336,125 +3893,6 @@ declare namespace dragonBones { * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ declare namespace dragonBones { - /** - * @internal - */ - abstract class Constraint extends BaseObject { - protected static readonly _helpMatrix: Matrix; - protected static readonly _helpTransform: Transform; - protected static readonly _helpPoint: Point; - /** - * - For timeline state. - * @internal - */ - _constraintData: ConstraintData; - protected _armature: Armature; - /** - * - For sort bones. - * @internal - */ - _target: Bone; - /** - * - For sort bones. - * @internal - */ - _root: Bone; - protected _bone: Bone | null; - protected _onClear(): void; - abstract init(constraintData: ConstraintData, armature: Armature): void; - abstract update(): void; - abstract invalidUpdate(): void; - readonly name: string; - } - /** - * @internal - */ - class IKConstraint extends Constraint { - static toString(): string; - private _scaleEnabled; - /** - * - For timeline state. - * @internal - */ - _bendPositive: boolean; - /** - * - For timeline state. - * @internal - */ - _weight: number; - protected _onClear(): void; - private _computeA(); - private _computeB(); - init(constraintData: ConstraintData, armature: Armature): void; - update(): void; - invalidUpdate(): void; - } - /** - * @internal - */ - class PathConstraint extends Constraint { - dirty: boolean; - pathOffset: number; - position: number; - spacing: number; - rotateOffset: number; - rotateMix: number; - translateMix: number; - private _pathSlot; - private _bones; - private _spaces; - private _positions; - private _curves; - private _boneLengths; - private _pathGlobalVertices; - private _segments; - static toString(): string; - protected _onClear(): void; - protected _updatePathVertices(verticesData: VerticesData): void; - protected _computeVertices(start: number, count: number, offset: number, out: Array): void; - protected _computeBezierCurve(pathDisplayDta: PathDisplayData, spaceCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): void; - private addCurvePosition(t, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, offset, tangents); - init(constraintData: ConstraintData, armature: Armature): void; - update(): void; - invalidUpdate(): void; - } -} -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -declare namespace dragonBones { - /** - * @internal - */ - class DeformVertices extends BaseObject { - static toString(): string; - verticesDirty: boolean; - readonly vertices: Array; - readonly bones: Array; - verticesData: VerticesData | null; - protected _onClear(): void; - init(verticesDataValue: VerticesData | null, armature: Armature): void; - isBonesUpdate(): boolean; - } } /** * The MIT License (MIT) @@ -4679,17 +4117,6 @@ declare namespace dragonBones { * @inheritDoc */ clock: WorldClock | null; - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#clock}。 - * @deprecated - * @language zh_CN - */ - static readonly clock: WorldClock; } } /** @@ -4744,25 +4171,20 @@ declare namespace dragonBones { * @language zh_CN */ timeScale: number; - private _lockUpdate; + /** + * Update bones and slots cachedFrameIndices. + */ private _animationDirty; private _inheritTimeScale; private readonly _animationNames; private readonly _animationStates; private readonly _animations; + private readonly _blendStates; private _armature; private _animationConfig; private _lastAnimationState; protected _onClear(): void; private _fadeOut(animationConfig); - /** - * @internal - */ - init(armature: Armature): void; - /** - * @internal - */ - advanceTime(passedTime: number): void; /** * - Clear all animations states. * @see dragonBones.AnimationState @@ -4983,6 +4405,7 @@ declare namespace dragonBones { /** * - Get a specific animation state. * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) * @example *
          *     armature.animation.play("walk");
@@ -4993,8 +4416,9 @@ declare namespace dragonBones {
          * @language en_US
          */
         /**
-         * - 获取指定的动画状态
+         * - 获取指定的动画状态。
          * @param animationName - 动画状态名称。
+         * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1)
          * @example
          * 
          *     armature.animation.play("walk");
@@ -5004,7 +4428,7 @@ declare namespace dragonBones {
          * @version DragonBones 3.0
          * @language zh_CN
          */
-        getState(animationName: string): AnimationState | null;
+        getState(animationName: string, layer?: number): AnimationState | null;
         /**
          * - Check whether a specific animation data is included.
          * @param animationName - The name of animation data.
@@ -5030,7 +4454,7 @@ declare namespace dragonBones {
          * @version DragonBones 5.1
          * @language zh_CN
          */
-        getStates(): Array;
+        getStates(): ReadonlyArray;
         /**
          * - Check whether there is an animation state is playing
          * @see dragonBones.AnimationState
@@ -5080,7 +4504,7 @@ declare namespace dragonBones {
          * @version DragonBones 4.5
          * @language zh_CN
          */
-        readonly animationNames: Array;
+        readonly animationNames: ReadonlyArray;
         /**
          * - All animation data.
          * @version DragonBones 4.5
@@ -5118,50 +4542,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly lastAnimationState: AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #play()} {@link #fadeIn()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #play()} {@link #fadeIn()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        gotoAndPlay(animationName: string, fadeInTime?: number, duration?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode, pauseFadeOut?: boolean, pauseFadeIn?: boolean): AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #gotoAndStopByTime()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #gotoAndStopByTime()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        gotoAndStop(animationName: string, time?: number): AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #animationNames}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #animationNames}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly animationList: Array;
-        /**
-         * - Deprecated, please refer to {@link #animationNames}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #animationNames}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly animationDataList: Array;
     }
 }
 /**
@@ -5210,7 +4590,7 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        additiveBlending: boolean;
+        additive: boolean;
         /**
          * - Whether the animation state has control over the display object properties of the slots.
          * Sometimes blend a animation state does not want it to control the display object properties of the slots,
@@ -5243,6 +4623,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         resetToPose: boolean;
+        /**
+         * @private
+         */
+        blendType: AnimationBlendType;
         /**
          * - The play times. [0: Loop play, [1~N]: Play N times]
          * @version DragonBones 3.0
@@ -5289,18 +4673,21 @@ declare namespace dragonBones {
          */
         timeScale: number;
         /**
-         * - The blend weight.
-         * @default 1.0
-         * @version DragonBones 5.0
-         * @language en_US
+         * @private
          */
+        parameterX: number;
         /**
-         * - 混合权重。
-         * @default 1.0
-         * @version DragonBones 5.0
-         * @language zh_CN
+         * @private
          */
-        weight: number;
+        parameterY: number;
+        /**
+         * @private
+         */
+        positionX: number;
+        /**
+         * @private
+         */
+        positionY: number;
         /**
          * - The auto fade out time when the animation state play completed.
          * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds)
@@ -5349,77 +4736,26 @@ declare namespace dragonBones {
          */
         group: string;
         private _timelineDirty;
-        /**
-         * - xx: Play Enabled, Fade Play Enabled
-         * @internal
-         */
-        _playheadState: number;
-        /**
-         * -1: Fade in, 0: Fade complete, 1: Fade out;
-         * @internal
-         */
-        _fadeState: number;
-        /**
-         * -1: Fade start, 0: Fading, 1: Fade complete;
-         * @internal
-         */
-        _subFadeState: number;
-        /**
-         * @internal
-         */
-        _position: number;
-        /**
-         * @internal
-         */
-        _duration: number;
+        private _weight;
         private _fadeTime;
         private _time;
-        /**
-         * @internal
-         */
-        _fadeProgress: number;
-        /**
-         * @internal
-         */
-        _weightResult: number;
-        /**
-         * @internal
-         */
-        readonly _blendState: BlendState;
         private readonly _boneMask;
         private readonly _boneTimelines;
-        private readonly _surfaceTimelines;
+        private readonly _boneBlendTimelines;
         private readonly _slotTimelines;
+        private readonly _slotBlendTimelines;
         private readonly _constraintTimelines;
         private readonly _animationTimelines;
         private readonly _poseTimelines;
-        private readonly _bonePoses;
-        /**
-         * @internal
-         */
-        _animationData: AnimationData;
+        private _animationData;
         private _armature;
-        /**
-         * @internal
-         */
-        _actionTimeline: ActionTimelineState;
         private _zOrderTimeline;
-        /**
-         * @internal
-         */
-        _parent: AnimationState;
+        private _activeChildA;
+        private _activeChildB;
         protected _onClear(): void;
         private _updateTimelines();
         private _updateBoneAndSlotTimelines();
         private _advanceFadeTime(passedTime);
-        /**
-         * @internal
-         */
-        init(armature: Armature, animationData: AnimationData, animationConfig: AnimationConfig): void;
-        /**
-         * @internal
-         */
-        advanceTime(passedTime: number, cacheFrameRate: number): void;
         /**
          * - Continue play.
          * @version DragonBones 3.0
@@ -5511,6 +4847,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         removeAllBoneMask(): void;
+        /**
+         * @private
+         */
+        addState(animationState: AnimationState, timelineDatas?: TimelineData[] | null): void;
         /**
          * - Whether the animation state is fading in.
          * @version DragonBones 5.1
@@ -5599,12 +4939,25 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         currentTime: number;
+        /**
+         * - The blend weight.
+         * @default 1.0
+         * @version DragonBones 5.0
+         * @language en_US
+         */
+        /**
+         * - 混合权重。
+         * @default 1.0
+         * @version DragonBones 5.0
+         * @language zh_CN
+         */
         /**
          * - The animation data.
          * @see dragonBones.AnimationData
          * @version DragonBones 3.0
          * @language en_US
          */
+        weight: number;
         /**
          * - 动画数据。
          * @see dragonBones.AnimationData
@@ -5613,31 +4966,6 @@ declare namespace dragonBones {
          */
         readonly animationData: AnimationData;
     }
-    /**
-     * @internal
-     */
-    class BonePose extends BaseObject {
-        static toString(): string;
-        readonly current: Transform;
-        readonly delta: Transform;
-        readonly result: Transform;
-        protected _onClear(): void;
-    }
-    /**
-     * @internal
-     */
-    class BlendState {
-        dirty: boolean;
-        layer: number;
-        leftWeight: number;
-        layerWeight: number;
-        blendWeight: number;
-        /**
-         * -1: First blending, 0: No blending, 1: Blending.
-         */
-        update(weight: number, p_layer: number): number;
-        clear(): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -5662,93 +4990,6 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
-    /**
-     * @internal
-     */
-    const enum TweenState {
-        None = 0,
-        Once = 1,
-        Always = 2,
-    }
-    /**
-     * @internal
-     */
-    abstract class TimelineState extends BaseObject {
-        /**
-         * -1: start, 0: play, 1: complete;
-         */
-        playState: number;
-        currentPlayTimes: number;
-        currentTime: number;
-        protected _tweenState: TweenState;
-        protected _frameRate: number;
-        protected _frameValueOffset: number;
-        protected _frameCount: number;
-        protected _frameOffset: number;
-        protected _frameIndex: number;
-        protected _frameRateR: number;
-        protected _position: number;
-        protected _duration: number;
-        protected _timeScale: number;
-        protected _timeOffset: number;
-        protected _dragonBonesData: DragonBonesData;
-        protected _animationData: AnimationData;
-        protected _timelineData: TimelineData | null;
-        protected _armature: Armature;
-        protected _animationState: AnimationState;
-        protected _actionTimeline: TimelineState;
-        protected _frameArray: Array | Int16Array;
-        protected _frameIntArray: Array | Int16Array;
-        protected _frameFloatArray: Array | Int16Array;
-        protected _timelineArray: Array | Uint16Array;
-        protected _frameIndices: Array;
-        protected _onClear(): void;
-        protected abstract _onArriveAtFrame(): void;
-        protected abstract _onUpdateFrame(): void;
-        protected _setCurrentTime(passedTime: number): boolean;
-        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        fadeOut(): void;
-        update(passedTime: number): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class TweenTimelineState extends TimelineState {
-        private static _getEasingValue(tweenType, progress, easing);
-        private static _getEasingCurveValue(progress, samples, count, offset);
-        protected _tweenType: TweenType;
-        protected _curveCount: number;
-        protected _framePosition: number;
-        protected _frameDurationR: number;
-        protected _tweenProgress: number;
-        protected _tweenEasing: number;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class BoneTimelineState extends TweenTimelineState {
-        bone: Bone;
-        bonePose: BonePose;
-        protected _onClear(): void;
-        blend(state: number): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class SlotTimelineState extends TweenTimelineState {
-        slot: Slot;
-        protected _onClear(): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class ConstraintTimelineState extends TweenTimelineState {
-        constraint: Constraint;
-        protected _onClear(): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -5773,144 +5014,6 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
-    /**
-     * @internal
-     */
-    class ActionTimelineState extends TimelineState {
-        static toString(): string;
-        private _onCrossFrame(frameIndex);
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        update(passedTime: number): void;
-        setCurrentTime(value: number): void;
-    }
-    /**
-     * @internal
-     */
-    class ZOrderTimelineState extends TimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneAllTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        fadeOut(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneTranslateTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneRotateTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        fadeOut(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneScaleTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class SurfaceTimelineState extends TweenTimelineState {
-        static toString(): string;
-        surface: Surface;
-        private _frameFloatOffset;
-        private _valueCount;
-        private _deformCount;
-        private _valueOffset;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        blend(state: number): void;
-    }
-    /**
-     * @internal
-     */
-    class SlotDislayTimelineState extends SlotTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class SlotColorTimelineState extends SlotTimelineState {
-        static toString(): string;
-        private _dirty;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        fadeOut(): void;
-        update(passedTime: number): void;
-    }
-    /**
-     * @internal
-     */
-    class DeformTimelineState extends SlotTimelineState {
-        static toString(): string;
-        vertexOffset: number;
-        private _dirty;
-        private _frameFloatOffset;
-        private _valueCount;
-        private _deformCount;
-        private _valueOffset;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        fadeOut(): void;
-        update(passedTime: number): void;
-    }
-    /**
-     * @internal
-     */
-    class IKConstraintTimelineState extends ConstraintTimelineState {
-        static toString(): string;
-        private _current;
-        private _delta;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class AnimationTimelineState extends TweenTimelineState {
-        static toString(): string;
-        animationState: AnimationState;
-        private readonly _floats;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        blend(state: number): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -6046,11 +5149,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         static readonly SOUND_EVENT: string;
-        /**
-         * @internal
-         * @private
-         */
-        static actionDataToInstance(data: ActionData, instance: EventObject, armature: Armature): void;
         static toString(): string;
         /**
          * - If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds)
@@ -6264,39 +5362,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void;
-        /**
-         * - Deprecated, please refer to {@link #hasDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #hasDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        hasEvent(type: EventStringType): boolean;
-        /**
-         * - Deprecated, please refer to {@link #addDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #addDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        addEvent(type: EventStringType, listener: Function, thisObject: any): void;
-        /**
-         * - Deprecated, please refer to {@link #removeDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #removeDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        removeEvent(type: EventStringType, listener: Function, thisObject: any): void;
     }
 }
 /**
@@ -6323,7 +5388,7 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     abstract class DataParser {
         protected static readonly DATA_VERSION_2_3: string;
@@ -6332,6 +5397,7 @@ declare namespace dragonBones {
         protected static readonly DATA_VERSION_4_5: string;
         protected static readonly DATA_VERSION_5_0: string;
         protected static readonly DATA_VERSION_5_5: string;
+        protected static readonly DATA_VERSION_5_6: string;
         protected static readonly DATA_VERSION: string;
         protected static readonly DATA_VERSIONS: Array;
         protected static readonly TEXTURE_ATLAS: string;
@@ -6348,18 +5414,19 @@ declare namespace dragonBones {
         protected static readonly DRADON_BONES: string;
         protected static readonly USER_DATA: string;
         protected static readonly ARMATURE: string;
+        protected static readonly CANVAS: string;
         protected static readonly BONE: string;
         protected static readonly SURFACE: string;
         protected static readonly SLOT: string;
         protected static readonly CONSTRAINT: string;
-        protected static readonly IK: string;
-        protected static readonly PATH_CONSTRAINT: string;
         protected static readonly SKIN: string;
         protected static readonly DISPLAY: string;
+        protected static readonly FRAME: string;
+        protected static readonly IK: string;
+        protected static readonly PATH_CONSTRAINT: string;
         protected static readonly ANIMATION: string;
-        protected static readonly Z_ORDER: string;
+        protected static readonly TIMELINE: string;
         protected static readonly FFD: string;
-        protected static readonly FRAME: string;
         protected static readonly TRANSLATE_FRAME: string;
         protected static readonly ROTATE_FRAME: string;
         protected static readonly SCALE_FRAME: string;
@@ -6371,7 +5438,6 @@ declare namespace dragonBones {
         protected static readonly INTS: string;
         protected static readonly FLOATS: string;
         protected static readonly STRINGS: string;
-        protected static readonly CANVAS: string;
         protected static readonly TRANSFORM: string;
         protected static readonly PIVOT: string;
         protected static readonly AABB: string;
@@ -6389,6 +5455,8 @@ declare namespace dragonBones {
         protected static readonly PATH: string;
         protected static readonly LENGTH: string;
         protected static readonly DISPLAY_INDEX: string;
+        protected static readonly Z_ORDER: string;
+        protected static readonly Z_INDEX: string;
         protected static readonly BLEND_MODE: string;
         protected static readonly INHERIT_TRANSLATION: string;
         protected static readonly INHERIT_ROTATION: string;
@@ -6401,6 +5469,7 @@ declare namespace dragonBones {
         protected static readonly BEND_POSITIVE: string;
         protected static readonly CHAIN: string;
         protected static readonly WEIGHT: string;
+        protected static readonly BLEND_TYPE: string;
         protected static readonly FADE_IN_TIME: string;
         protected static readonly PLAY_TIMES: string;
         protected static readonly SCALE: string;
@@ -6424,6 +5493,7 @@ declare namespace dragonBones {
         protected static readonly VALUE: string;
         protected static readonly ROTATE: string;
         protected static readonly SKEW: string;
+        protected static readonly ALPHA: string;
         protected static readonly ALPHA_OFFSET: string;
         protected static readonly RED_OFFSET: string;
         protected static readonly GREEN_OFFSET: string;
@@ -6438,8 +5508,6 @@ declare namespace dragonBones {
         protected static readonly WEIGHTS: string;
         protected static readonly SLOT_POSE: string;
         protected static readonly BONE_POSE: string;
-        protected static readonly GLUE_WEIGHTS: string;
-        protected static readonly GLUE_MESHES: string;
         protected static readonly BONES: string;
         protected static readonly POSITION_MODE: string;
         protected static readonly SPACING_MODE: string;
@@ -6457,37 +5525,16 @@ declare namespace dragonBones {
         protected static readonly DEFAULT_NAME: string;
         protected static _getArmatureType(value: string): ArmatureType;
         protected static _getBoneType(value: string): BoneType;
-        protected static _getDisplayType(value: string): DisplayType;
-        protected static _getBoundingBoxType(value: string): BoundingBoxType;
-        protected static _getActionType(value: string): ActionType;
-        protected static _getBlendMode(value: string): BlendMode;
         protected static _getPositionMode(value: string): PositionMode;
         protected static _getSpacingMode(value: string): SpacingMode;
         protected static _getRotateMode(value: string): RotateMode;
+        protected static _getDisplayType(value: string): DisplayType;
+        protected static _getBoundingBoxType(value: string): BoundingBoxType;
+        protected static _getBlendMode(value: string): BlendMode;
+        protected static _getAnimationBlendType(value: string): AnimationBlendType;
+        protected static _getActionType(value: string): ActionType;
         abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null;
         abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static parseDragonBonesData(rawData: any): DragonBonesData | null;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static parseTextureAtlasData(rawData: any, scale?: number): any;
     }
 }
 /**
@@ -6514,7 +5561,15 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
+     */
+    const enum FrameValueType {
+        Step = 0,
+        Int = 1,
+        Float = 2,
+    }
+    /**
+     * @private
      */
     class ObjectDataParser extends DataParser {
         protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean;
@@ -6525,16 +5580,19 @@ declare namespace dragonBones {
         protected _data: DragonBonesData;
         protected _armature: ArmatureData;
         protected _bone: BoneData;
-        protected _surface: SurfaceData;
+        protected _geometry: GeometryData;
         protected _slot: SlotData;
         protected _skin: SkinData;
         protected _mesh: MeshDisplayData;
         protected _animation: AnimationData;
         protected _timeline: TimelineData;
         protected _rawTextureAtlases: Array | null;
+        private _frameValueType;
         private _defaultColorOffset;
         private _prevClockwise;
         private _prevRotation;
+        private _frameDefaultValue;
+        private _frameValueScale;
         private readonly _helpMatrixA;
         private readonly _helpMatrixB;
         private readonly _helpTransform;
@@ -6547,6 +5605,7 @@ declare namespace dragonBones {
         private readonly _frameFloatArray;
         private readonly _frameArray;
         private readonly _timelineArray;
+        private readonly _colorArray;
         private readonly _cacheRawMeshes;
         private readonly _cacheMeshes;
         private readonly _actionFrames;
@@ -6568,30 +5627,31 @@ declare namespace dragonBones {
         protected _parsePath(rawData: any, display: PathDisplayData): void;
         protected _parsePivot(rawData: any, display: ImageDisplayData): void;
         protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;
-        protected _parseMeshGlue(rawData: any, mesh: MeshDisplayData): void;
         protected _parseBoundingBox(rawData: any): BoundingBoxData | null;
         protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData;
         protected _parseAnimation(rawData: any): AnimationData;
-        protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, type: TimelineType, addIntOffset: boolean, addFloatOffset: boolean, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number): TimelineData | null;
+        protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, timelineType: TimelineType, frameValueType: FrameValueType, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number, timeline?: TimelineData | null): TimelineData | null;
         protected _parseBoneTimeline(rawData: any): void;
         protected _parseSlotTimeline(rawData: any): void;
         protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseSingleValueFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseDoubleValueFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number;
         protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseSurfaceFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseSlotFFDFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseSlotDeformFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseAnimationFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array;
+        protected _parseDeformFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseTransform(rawData: any, transform: Transform, scale: number): void;
         protected _parseColorTransform(rawData: any, color: ColorTransform): void;
+        protected _parseGeometry(rawData: any, geometry: GeometryData): void;
         protected _parseArray(rawData: any): void;
         protected _modifyArray(): void;
         parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;
@@ -6610,7 +5670,7 @@ declare namespace dragonBones {
         static getInstance(): ObjectDataParser;
     }
     /**
-     * @internal
+     * @private
      */
     class ActionFrame {
         frameStart: number;
@@ -6641,25 +5701,19 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     class BinaryDataParser extends ObjectDataParser {
         private _binaryOffset;
         private _binary;
         private _intArrayBuffer;
-        private _floatArrayBuffer;
-        private _frameIntArrayBuffer;
-        private _frameFloatArrayBuffer;
         private _frameArrayBuffer;
         private _timelineArrayBuffer;
         private _inRange(a, min, max);
         private _decodeUTF8(data);
-        private _getUTF16Key(value);
         private _parseBinaryTimeline(type, offset, timelineData?);
-        private _parseVertices(rawData, vertices);
-        protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;
-        protected _parsePath(rawData: any, path: PathDisplayData): void;
         protected _parseAnimation(rawData: any): AnimationData;
+        protected _parseGeometry(rawData: any, geometry: GeometryData): void;
         protected _parseArray(rawData: any): void;
         parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;
         private static _binaryDataParserInstance;
@@ -6752,8 +5806,8 @@ declare namespace dragonBones {
          */
         protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void;
         protected _buildConstraints(dataPackage: BuildArmaturePackage, armature: Armature): void;
-        protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, slot: Slot, displayData: DisplayData): Armature | null;
-        protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, rawDisplayData: DisplayData | null, slot: Slot): any;
+        protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, _slot: Slot, displayData: ArmatureDisplayData): Armature | null;
+        protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, slot: Slot): any;
         protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData;
         protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature;
         protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;
@@ -6814,9 +5868,20 @@ declare namespace dragonBones {
          */
         parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData;
         /**
-         * @private
+         * - Update texture atlases.
+         * @param textureAtlases - The texture atlas objects.
+         * @param name - The texture atlas name.
+         * @version DragonBones 5.7
+         * @language en_US
+         */
+        /**
+         * - 更新贴图集对象。
+         * @param textureAtlases - 多个贴图集对象。
+         * @param name - 贴图集名称。
+         * @version DragonBones 5.7
+         * @language zh_CN
          */
-        updateTextureAtlasData(name: string, textureAtlases: Array): void;
+        updateTextureAtlases(textureAtlases: Array, name: string): void;
         /**
          * - Get a specific DragonBonesData instance.
          * @param name - The DragonBonesData instance cache name.
@@ -7021,7 +6086,7 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        replaceDisplay(slot: Slot, displayData: DisplayData, displayIndex?: number): void;
+        replaceDisplay(slot: Slot, displayData: DisplayData | null, displayIndex?: number): void;
         /**
          * - Replaces the current display data for a particular slot with a specific display data.
          * Specify display data with "dragonBonesName/armatureName/slotName/displayName".
@@ -7162,31 +6227,9 @@ declare namespace dragonBones {
          * @private
          */
         readonly dragonBones: DragonBones;
-        /**
-         * - Deprecated, please refer to {@link #replaceSkin}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceSkin}。
-         * @deprecated
-         * @language zh_CN
-         */
-        changeSkin(armature: Armature, skin: SkinData, exclude?: Array | null): boolean;
-        /**
-         * - Deprecated, please refer to {@link #replaceAnimation}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceAnimation}。
-         * @deprecated
-         * @language zh_CN
-         */
-        copyAnimationsToArmature(toArmature: Armature, fromArmatreName: string, fromSkinName?: string, fromDragonBonesDataName?: string, replaceOriginalAnimation?: boolean): boolean;
     }
     /**
-     * @internal
+     * @private
      */
     class BuildArmaturePackage {
         dataName: string;
@@ -7249,14 +6292,6 @@ declare namespace dragonBones {
          */
         renderTexture: PIXI.BaseTexture | null;
     }
-    /**
-     * @internal
-     */
-    class PhaserTextureData extends TextureData {
-        static toString(): string;
-        renderTexture: PIXI.Texture | null;
-        protected _onClear(): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -7401,18 +6436,10 @@ declare namespace dragonBones {
         protected _replaceDisplay(value: any): void;
         protected _removeDisplay(): void;
         protected _updateZOrder(): void;
-        /**
-         * @internal
-         */
-        _updateVisible(): void;
         protected _updateBlendMode(): void;
         protected _updateColor(): void;
         protected _updateFrame(): void;
         protected _updateMesh(): void;
-        /**
-         * @internal
-         */
-        _updateGlueMesh(): void;
         protected _updateTransform(): void;
         protected _identityTransform(): void;
     }
@@ -7494,10 +6521,6 @@ declare namespace dragonBones {
      * @language zh_CN
      */
     class PhaserFactory extends BaseFactory {
-        /**
-         * @internal
-         */
-        static _game: Phaser.Game;
         private static _dragonBonesInstance;
         private static _factory;
         static init(game: Phaser.Game): void;
diff --git a/Phaser/2.x/out/dragonBones.js b/Phaser/2.x/out/dragonBones.js
index ef58dfa4..5ee8efcf 100644
--- a/Phaser/2.x/out/dragonBones.js
+++ b/Phaser/2.x/out/dragonBones.js
@@ -9,9 +9,6 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
-var dragonBones;
-(function (dragonBones) {
-})(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
  *
@@ -96,20 +93,15 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        DragonBones.VERSION = "5.6.300";
+        DragonBones.VERSION = "5.7.000";
         DragonBones.yDown = true;
         DragonBones.debug = false;
         DragonBones.debugDraw = false;
-        DragonBones.webAssembly = false;
         return DragonBones;
     }());
     dragonBones.DragonBones = DragonBones;
 })(dragonBones || (dragonBones = {}));
 //
-if (typeof global === "undefined") {
-    var global = window;
-}
-//
 if (!console.warn) {
     console.warn = function () { };
 }
@@ -134,6 +126,22 @@ var __extends = function (t, e) {
     }
     r.prototype = e.prototype, t.prototype = new r();
 };
+//
+if (typeof global === "undefined" && typeof window !== "undefined") {
+    var global = window;
+}
+if (typeof exports === "object" && typeof module === "object") {
+    module.exports = dragonBones;
+}
+else if (typeof define === "function" && define["amd"]) {
+    define(["dragonBones"], function () { return dragonBones; });
+}
+else if (typeof exports === "object") {
+    exports = dragonBones;
+}
+else if (typeof global !== "undefined") {
+    global.dragonBones = dragonBones;
+}
 /**
  * The MIT License (MIT)
  *
@@ -796,7 +804,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ColorTransform = /** @class */ (function () {
         function ColorTransform(alphaMultiplier, redMultiplier, greenMultiplier, blueMultiplier, alphaOffset, redOffset, greenOffset, blueOffset) {
@@ -1128,7 +1136,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.UserData = UserData;
     /**
-     * @internal
+     * @private
      */
     var ActionData = /** @class */ (function (_super) {
         __extends(ActionData, _super);
@@ -1252,6 +1260,7 @@ var dragonBones;
             this.frameFloatArray = null; //
             this.frameArray = null; //
             this.timelineArray = null; //
+            this.colorArray = null; //
             this.userData = null;
         };
         /**
@@ -1281,20 +1290,6 @@ var dragonBones;
         DragonBonesData.prototype.getArmature = function (armatureName) {
             return armatureName in this.armatures ? this.armatures[armatureName] : null;
         };
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.BaseFactory#removeDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.BaseFactory#removeDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DragonBonesData.prototype.dispose = function () {
-            console.warn("已废弃");
-            this.returnToPool();
-        };
         return DragonBonesData;
     }(dragonBones.BaseObject));
     dragonBones.DragonBonesData = DragonBonesData;
@@ -1736,6 +1731,7 @@ var dragonBones;
             this.inheritReflection = false;
             this.type = 0 /* Bone */;
             this.length = 0.0;
+            this.alpha = 1.0;
             this.name = "";
             this.transform.identity();
             this.userData = null;
@@ -1751,7 +1747,7 @@ var dragonBones;
         __extends(SurfaceData, _super);
         function SurfaceData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = [];
+            _this.geometry = new dragonBones.GeometryData();
             return _this;
         }
         SurfaceData.toString = function () {
@@ -1762,7 +1758,7 @@ var dragonBones;
             this.type = 1 /* Surface */;
             this.segmentX = 0;
             this.segmentY = 0;
-            this.vertices.length = 0;
+            this.geometry.clear();
         };
         return SurfaceData;
     }(BoneData));
@@ -1807,6 +1803,8 @@ var dragonBones;
             this.blendMode = 0 /* Normal */;
             this.displayIndex = 0;
             this.zOrder = 0;
+            this.zIndex = 0;
+            this.alpha = 1.0;
             this.name = "";
             this.color = null; //
             this.userData = null;
@@ -1845,7 +1843,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var CanvasData = /** @class */ (function (_super) {
         __extends(CanvasData, _super);
@@ -1995,7 +1993,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ConstraintData = /** @class */ (function (_super) {
         __extends(ConstraintData, _super);
@@ -2092,13 +2090,13 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
-    var VerticesData = /** @class */ (function () {
-        function VerticesData() {
+    var GeometryData = /** @class */ (function () {
+        function GeometryData() {
             this.weight = null; // Initial value.
         }
-        VerticesData.prototype.clear = function () {
+        GeometryData.prototype.clear = function () {
             if (!this.isShared && this.weight !== null) {
                 this.weight.returnToPool();
             }
@@ -2108,16 +2106,32 @@ var dragonBones;
             this.data = null;
             this.weight = null;
         };
-        VerticesData.prototype.shareFrom = function (value) {
+        GeometryData.prototype.shareFrom = function (value) {
             this.isShared = true;
             this.offset = value.offset;
             this.weight = value.weight;
         };
-        return VerticesData;
+        Object.defineProperty(GeometryData.prototype, "vertexCount", {
+            get: function () {
+                var intArray = this.data.intArray;
+                return intArray[this.offset + 0 /* GeometryVertexCount */];
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(GeometryData.prototype, "triangleCount", {
+            get: function () {
+                var intArray = this.data.intArray;
+                return intArray[this.offset + 1 /* GeometryTriangleCount */];
+            },
+            enumerable: true,
+            configurable: true
+        });
+        return GeometryData;
     }());
-    dragonBones.VerticesData = VerticesData;
+    dragonBones.GeometryData = GeometryData;
     /**
-     * @internal
+     * @private
      */
     var DisplayData = /** @class */ (function (_super) {
         __extends(DisplayData, _super);
@@ -2136,7 +2150,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.DisplayData = DisplayData;
     /**
-     * @internal
+     * @private
      */
     var ImageDisplayData = /** @class */ (function (_super) {
         __extends(ImageDisplayData, _super);
@@ -2158,7 +2172,7 @@ var dragonBones;
     }(DisplayData));
     dragonBones.ImageDisplayData = ImageDisplayData;
     /**
-     * @internal
+     * @private
      */
     var ArmatureDisplayData = /** @class */ (function (_super) {
         __extends(ArmatureDisplayData, _super);
@@ -2191,13 +2205,13 @@ var dragonBones;
     }(DisplayData));
     dragonBones.ArmatureDisplayData = ArmatureDisplayData;
     /**
-     * @internal
+     * @private
      */
     var MeshDisplayData = /** @class */ (function (_super) {
         __extends(MeshDisplayData, _super);
         function MeshDisplayData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = new VerticesData();
+            _this.geometry = new GeometryData();
             return _this;
         }
         MeshDisplayData.toString = function () {
@@ -2206,14 +2220,14 @@ var dragonBones;
         MeshDisplayData.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
             this.type = 2 /* Mesh */;
-            this.vertices.clear();
+            this.geometry.clear();
             this.texture = null;
         };
         return MeshDisplayData;
     }(DisplayData));
     dragonBones.MeshDisplayData = MeshDisplayData;
     /**
-     * @internal
+     * @private
      */
     var BoundingBoxDisplayData = /** @class */ (function (_super) {
         __extends(BoundingBoxDisplayData, _super);
@@ -2237,13 +2251,13 @@ var dragonBones;
     }(DisplayData));
     dragonBones.BoundingBoxDisplayData = BoundingBoxDisplayData;
     /**
-     * @internal
+     * @private
      */
     var PathDisplayData = /** @class */ (function (_super) {
         __extends(PathDisplayData, _super);
         function PathDisplayData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = new VerticesData();
+            _this.geometry = new GeometryData();
             _this.curveLengths = [];
             return _this;
         }
@@ -2255,14 +2269,14 @@ var dragonBones;
             this.type = 4 /* Path */;
             this.closed = false;
             this.constantSpeed = false;
-            this.vertices.clear();
+            this.geometry.clear();
             this.curveLengths.length = 0;
         };
         return PathDisplayData;
     }(DisplayData));
     dragonBones.PathDisplayData = PathDisplayData;
     /**
-     * @internal
+     * @private
      */
     var WeightData = /** @class */ (function (_super) {
         __extends(WeightData, _super);
@@ -2910,10 +2924,6 @@ var dragonBones;
              * @private
              */
             _this.boneTimelines = {};
-            /**
-             * @private
-             */
-            _this.surfaceTimelines = {};
             /**
              * @private
              */
@@ -2955,30 +2965,23 @@ var dragonBones;
                 }
                 delete this.boneTimelines[k];
             }
-            for (var k in this.surfaceTimelines) {
-                for (var _b = 0, _c = this.surfaceTimelines[k]; _b < _c.length; _b++) {
-                    var timeline = _c[_b];
-                    timeline.returnToPool();
-                }
-                delete this.surfaceTimelines[k];
-            }
             for (var k in this.slotTimelines) {
-                for (var _d = 0, _e = this.slotTimelines[k]; _d < _e.length; _d++) {
-                    var timeline = _e[_d];
+                for (var _b = 0, _c = this.slotTimelines[k]; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
                     timeline.returnToPool();
                 }
                 delete this.slotTimelines[k];
             }
             for (var k in this.constraintTimelines) {
-                for (var _f = 0, _g = this.constraintTimelines[k]; _f < _g.length; _f++) {
-                    var timeline = _g[_f];
+                for (var _d = 0, _e = this.constraintTimelines[k]; _d < _e.length; _d++) {
+                    var timeline = _e[_d];
                     timeline.returnToPool();
                 }
                 delete this.constraintTimelines[k];
             }
             for (var k in this.animationTimelines) {
-                for (var _h = 0, _j = this.animationTimelines[k]; _h < _j.length; _h++) {
-                    var timeline = _j[_h];
+                for (var _f = 0, _g = this.animationTimelines[k]; _f < _g.length; _f++) {
+                    var timeline = _g[_f];
                     timeline.returnToPool();
                 }
                 delete this.animationTimelines[k];
@@ -2998,6 +3001,7 @@ var dragonBones;
             this.frameIntOffset = 0;
             this.frameFloatOffset = 0;
             this.frameOffset = 0;
+            this.blendType = 0 /* None */;
             this.frameCount = 0;
             this.playTimes = 0;
             this.duration = 0.0;
@@ -3007,7 +3011,6 @@ var dragonBones;
             this.name = "";
             this.cachedFrames.length = 0;
             // this.boneTimelines.clear();
-            // this.surfaceTimelines.clear();
             // this.slotTimelines.clear();
             // this.constraintTimelines.clear();
             // this.animationTimelines.clear();
@@ -3050,17 +3053,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addBoneTimeline = function (bone, timeline) {
-            var timelines = bone.name in this.boneTimelines ? this.boneTimelines[bone.name] : (this.boneTimelines[bone.name] = []);
-            if (timelines.indexOf(timeline) < 0) {
-                timelines.push(timeline);
-            }
-        };
-        /**
-         * @private
-         */
-        AnimationData.prototype.addSurfaceTimeline = function (surface, timeline) {
-            var timelines = surface.name in this.surfaceTimelines ? this.surfaceTimelines[surface.name] : (this.surfaceTimelines[surface.name] = []);
+        AnimationData.prototype.addBoneTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : (this.boneTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3068,8 +3062,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addSlotTimeline = function (slot, timeline) {
-            var timelines = slot.name in this.slotTimelines ? this.slotTimelines[slot.name] : (this.slotTimelines[slot.name] = []);
+        AnimationData.prototype.addSlotTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : (this.slotTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3077,8 +3071,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addConstraintTimeline = function (constraint, timeline) {
-            var timelines = constraint.name in this.constraintTimelines ? this.constraintTimelines[constraint.name] : (this.constraintTimelines[constraint.name] = []);
+        AnimationData.prototype.addConstraintTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : (this.constraintTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3098,12 +3092,6 @@ var dragonBones;
         AnimationData.prototype.getBoneTimelines = function (timelineName) {
             return timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : null;
         };
-        /**
-         * @private
-         */
-        AnimationData.prototype.getSurfaceTimelines = function (timelineName) {
-            return timelineName in this.surfaceTimelines ? this.surfaceTimelines[timelineName] : null;
-        };
         /**
          * @private
          */
@@ -3138,7 +3126,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.AnimationData = AnimationData;
     /**
-     * @internal
+     * @private
      */
     var TimelineData = /** @class */ (function (_super) {
         __extends(TimelineData, _super);
@@ -3156,6 +3144,25 @@ var dragonBones;
         return TimelineData;
     }(dragonBones.BaseObject));
     dragonBones.TimelineData = TimelineData;
+    /**
+     * @internal
+     */
+    var AnimationTimelineData = /** @class */ (function (_super) {
+        __extends(AnimationTimelineData, _super);
+        function AnimationTimelineData() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationTimelineData.toString = function () {
+            return "[class dragonBones.AnimationTimelineData]";
+        };
+        AnimationTimelineData.prototype._onClear = function () {
+            _super.prototype._onClear.call(this);
+            this.x = 0.0;
+            this.y = 0.0;
+        };
+        return AnimationTimelineData;
+    }(TimelineData));
+    dragonBones.AnimationTimelineData = AnimationTimelineData;
 })(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
@@ -3216,7 +3223,7 @@ var dragonBones;
             this.fadeOutTweenType = 1 /* Line */;
             this.fadeOutTime = -1.0;
             this.actionEnabled = true;
-            this.additiveBlending = false;
+            this.additive = false;
             this.displayControl = true;
             this.pauseFadeIn = true;
             this.resetToPose = true;
@@ -3249,7 +3256,7 @@ var dragonBones;
             this.autoFadeOutTime = value.autoFadeOutTime;
             this.fadeOutTweenType = value.fadeOutTweenType;
             this.actionEnabled = value.actionEnabled;
-            this.additiveBlending = value.additiveBlending;
+            this.additive = value.additive;
             this.displayControl = value.displayControl;
             this.pauseFadeIn = value.pauseFadeIn;
             this.resetToPose = value.resetToPose;
@@ -3270,68 +3277,6 @@ var dragonBones;
                 this.boneMask[i] = value.boneMask[i];
             }
         };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.containsBoneMask = function (boneName) {
-            return this.boneMask.length === 0 || this.boneMask.indexOf(boneName) >= 0;
-        };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.addBoneMask = function (armature, boneName, recursive) {
-            if (recursive === void 0) { recursive = true; }
-            var currentBone = armature.getBone(boneName);
-            if (currentBone === null) {
-                return;
-            }
-            if (this.boneMask.indexOf(boneName) < 0) {
-                this.boneMask.push(boneName);
-            }
-            if (recursive) {
-                for (var _i = 0, _a = armature.getBones(); _i < _a.length; _i++) {
-                    var bone = _a[_i];
-                    if (this.boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) {
-                        this.boneMask.push(bone.name);
-                    }
-                }
-            }
-        };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.removeBoneMask = function (armature, boneName, recursive) {
-            if (recursive === void 0) { recursive = true; }
-            var index = this.boneMask.indexOf(boneName);
-            if (index >= 0) {
-                this.boneMask.splice(index, 1);
-            }
-            if (recursive) {
-                var currentBone = armature.getBone(boneName);
-                if (currentBone !== null) {
-                    if (this.boneMask.length > 0) {
-                        for (var _i = 0, _a = armature.getBones(); _i < _a.length; _i++) {
-                            var bone = _a[_i];
-                            var index_1 = this.boneMask.indexOf(bone.name);
-                            if (index_1 >= 0 && currentBone.contains(bone)) {
-                                this.boneMask.splice(index_1, 1);
-                            }
-                        }
-                    }
-                    else {
-                        for (var _b = 0, _c = armature.getBones(); _b < _c.length; _b++) {
-                            var bone = _c[_b];
-                            if (bone === currentBone) {
-                                continue;
-                            }
-                            if (!currentBone.contains(bone)) {
-                                this.boneMask.push(bone.name);
-                            }
-                        }
-                    }
-                }
-            }
-        };
         return AnimationConfig;
     }(dragonBones.BaseObject));
     dragonBones.AnimationConfig = AnimationConfig;
@@ -3435,7 +3380,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.TextureAtlasData = TextureAtlasData;
     /**
-     * @internal
+     * @private
      */
     var TextureData = /** @class */ (function (_super) {
         __extends(TextureData, _super);
@@ -3540,7 +3485,7 @@ var dragonBones;
             return "[class dragonBones.Armature]";
         };
         Armature._onSortSlots = function (a, b) {
-            return a._zOrder > b._zOrder ? 1 : -1;
+            return a._zIndex * 1000 + a._zOrder > b._zIndex * 1000 + b._zOrder ? 1 : -1;
         };
         Armature.prototype._onClear = function () {
             if (this._clock !== null) {
@@ -3576,9 +3521,13 @@ var dragonBones;
             this._lockUpdate = false;
             this._slotsDirty = true;
             this._zOrderDirty = false;
+            this._zIndexDirty = false;
+            this._alphaDirty = true;
             this._flipX = false;
             this._flipY = false;
             this._cacheFrameIndex = -1;
+            this._alpha = 1.0;
+            this._globalAlpha = 1.0;
             this._bones.length = 0;
             this._slots.length = 0;
             this._constraints.length = 0;
@@ -3608,7 +3557,7 @@ var dragonBones;
                     var slotData = slotDatas[slotIndex];
                     var slot = this.getSlot(slotData.name);
                     if (slot !== null) {
-                        slot._setZorder(i);
+                        slot._setZOrder(i);
                     }
                 }
                 this._slotsDirty = true;
@@ -3701,6 +3650,7 @@ var dragonBones;
             if (this._lockUpdate) {
                 return;
             }
+            this._lockUpdate = true;
             if (this._armatureData === null) {
                 console.warn("The armature has been disposed.");
                 return;
@@ -3713,9 +3663,28 @@ var dragonBones;
             // Update animation.
             this._animation.advanceTime(passedTime);
             // Sort slots.
-            if (this._slotsDirty) {
-                this._slotsDirty = false;
+            if (this._slotsDirty || this._zIndexDirty) {
                 this._slots.sort(Armature._onSortSlots);
+                if (this._zIndexDirty) {
+                    for (var i = 0, l = this._slots.length; i < l; ++i) {
+                        this._slots[i]._setZOrder(i); // 
+                    }
+                }
+                this._slotsDirty = false;
+                this._zIndexDirty = false;
+            }
+            // Update alpha.
+            if (this._alphaDirty) {
+                this._alphaDirty = false;
+                this._globalAlpha = this._alpha * (this._parent !== null ? this._parent._globalAlpha : 1.0);
+                for (var _i = 0, _a = this._bones; _i < _a.length; _i++) {
+                    var bone = _a[_i];
+                    bone._updateAlpha();
+                }
+                for (var _b = 0, _c = this._slots; _b < _c.length; _b++) {
+                    var slot = _c[_b];
+                    slot._updateAlpha();
+                }
             }
             // Update bones and slots.
             if (this._cacheFrameIndex < 0 || this._cacheFrameIndex !== prevCacheFrameIndex) {
@@ -3729,9 +3698,8 @@ var dragonBones;
             }
             // Do actions.
             if (this._actions.length > 0) {
-                this._lockUpdate = true;
-                for (var _i = 0, _a = this._actions; _i < _a.length; _i++) {
-                    var action = _a[_i];
+                for (var _d = 0, _e = this._actions; _d < _e.length; _d++) {
+                    var action = _e[_d];
                     var actionData = action.actionData;
                     if (actionData !== null) {
                         if (actionData.type === 0 /* Play */) {
@@ -3742,8 +3710,8 @@ var dragonBones;
                                 }
                             }
                             else if (action.bone !== null) {
-                                for (var _b = 0, _c = this.getSlots(); _b < _c.length; _b++) {
-                                    var slot = _c[_b];
+                                for (var _f = 0, _g = this.getSlots(); _f < _g.length; _f++) {
+                                    var slot = _g[_f];
                                     if (slot.parent === action.bone) {
                                         var childArmature = slot.childArmature;
                                         if (childArmature !== null) {
@@ -3760,8 +3728,8 @@ var dragonBones;
                     action.returnToPool();
                 }
                 this._actions.length = 0;
-                this._lockUpdate = false;
             }
+            this._lockUpdate = false;
             this._proxy.dbUpdate();
         };
         /**
@@ -4334,69 +4302,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * @deprecated
-         * @private
-         */
-        Armature.prototype.replaceTexture = function (texture) {
-            this.replacedTexture = texture;
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.hasEventListener = function (type) {
-            console.warn("Deprecated.");
-            return this._proxy.hasDBEventListener(type);
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.addEventListener = function (type, listener, target) {
-            console.warn("Deprecated.");
-            this._proxy.addDBEventListener(type, listener, target);
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.removeEventListener = function (type, listener, target) {
-            console.warn("Deprecated.");
-            this._proxy.removeDBEventListener(type, listener, target);
-        };
-        /**
-         * - Deprecated, please refer to {@link #cacheFrameRate}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #cacheFrameRate}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.enableAnimationCache = function (frameRate) {
-            console.warn("Deprecated.");
-            this.cacheFrameRate = frameRate;
-        };
         /**
          * - Deprecated, please refer to {@link #display}.
          * @deprecated
@@ -4502,6 +4407,8 @@ var dragonBones;
             this.origin = null;
             this.userData = null;
             this._globalDirty = false;
+            this._alpha = 1.0;
+            this._globalAlpha = 1.0;
             this._armature = null; //
         };
         /**
@@ -4608,10 +4515,6 @@ var dragonBones;
              * @internal
              */
             _this.animationPose = new dragonBones.Transform();
-            /**
-             * @internal
-             */
-            _this._blendState = new dragonBones.BlendState();
             return _this;
         }
         Bone.toString = function () {
@@ -4627,7 +4530,6 @@ var dragonBones;
             this._hasConstraint = false;
             this._visible = true;
             this._cachedFrameIndex = -1;
-            this._blendState.clear();
             this._boneData = null; //
             this._parent = null; //
             this._cachedFrameIndices = null;
@@ -4672,39 +4574,61 @@ var dragonBones;
                 global.copyFrom(offset);
             }
             if (inherit) {
-                var parentMatrix = parent._boneData.type === 0 /* Bone */ ? parent.globalTransformMatrix : parent._getGlobalTransformMatrix(global.x, global.y);
-                if (boneData.inheritScale) {
-                    if (!boneData.inheritRotation) {
-                        parent.updateGlobalTransform();
-                        if (flipX && flipY) {
-                            rotation = global.rotation - (parent.global.rotation + Math.PI);
-                        }
-                        else if (flipX) {
-                            rotation = global.rotation + parent.global.rotation + Math.PI;
-                        }
-                        else if (flipY) {
-                            rotation = global.rotation + parent.global.rotation;
+                var isSurface = parent._boneData.type === 1 /* Surface */;
+                var surfaceBone = isSurface ? parent._bone : null;
+                var parentMatrix = isSurface ? parent._getGlobalTransformMatrix(global.x, global.y) : parent.globalTransformMatrix;
+                if (boneData.inheritScale && (!isSurface || surfaceBone !== null)) {
+                    if (isSurface) {
+                        if (boneData.inheritRotation) {
+                            global.rotation += parent.global.rotation;
+                        }
+                        surfaceBone.updateGlobalTransform();
+                        global.scaleX *= surfaceBone.global.scaleX;
+                        global.scaleY *= surfaceBone.global.scaleY;
+                        parentMatrix.transformPoint(global.x, global.y, global);
+                        global.toMatrix(globalTransformMatrix);
+                        if (boneData.inheritTranslation) {
+                            global.x = globalTransformMatrix.tx;
+                            global.y = globalTransformMatrix.ty;
                         }
                         else {
-                            rotation = global.rotation - parent.global.rotation;
+                            globalTransformMatrix.tx = global.x;
+                            globalTransformMatrix.ty = global.y;
                         }
-                        global.rotation = rotation;
-                    }
-                    global.toMatrix(globalTransformMatrix);
-                    globalTransformMatrix.concat(parentMatrix);
-                    if (boneData.inheritTranslation) {
-                        global.x = globalTransformMatrix.tx;
-                        global.y = globalTransformMatrix.ty;
-                    }
-                    else {
-                        globalTransformMatrix.tx = global.x;
-                        globalTransformMatrix.ty = global.y;
-                    }
-                    if (isCache) {
-                        global.fromMatrix(globalTransformMatrix);
                     }
                     else {
-                        this._globalDirty = true;
+                        if (!boneData.inheritRotation) {
+                            parent.updateGlobalTransform();
+                            if (flipX && flipY) {
+                                rotation = global.rotation - (parent.global.rotation + Math.PI);
+                            }
+                            else if (flipX) {
+                                rotation = global.rotation + parent.global.rotation + Math.PI;
+                            }
+                            else if (flipY) {
+                                rotation = global.rotation + parent.global.rotation;
+                            }
+                            else {
+                                rotation = global.rotation - parent.global.rotation;
+                            }
+                            global.rotation = rotation;
+                        }
+                        global.toMatrix(globalTransformMatrix);
+                        globalTransformMatrix.concat(parentMatrix);
+                        if (boneData.inheritTranslation) {
+                            global.x = globalTransformMatrix.tx;
+                            global.y = globalTransformMatrix.ty;
+                        }
+                        else {
+                            globalTransformMatrix.tx = global.x;
+                            globalTransformMatrix.ty = global.y;
+                        }
+                        if (isCache) {
+                            global.fromMatrix(globalTransformMatrix);
+                        }
+                        else {
+                            this._globalDirty = true;
+                        }
                     }
                 }
                 else {
@@ -4781,6 +4705,17 @@ var dragonBones;
                 global.toMatrix(globalTransformMatrix);
             }
         };
+        /**
+         * @internal
+         */
+        Bone.prototype._updateAlpha = function () {
+            if (this._parent !== null) {
+                this._globalAlpha = this._alpha * this._parent._globalAlpha;
+            }
+            else {
+                this._globalAlpha = this._alpha * this._armature._globalAlpha;
+            }
+        };
         /**
          * @internal
          */
@@ -4790,6 +4725,7 @@ var dragonBones;
             }
             this._boneData = boneData;
             this._armature = armatureValue;
+            this._alpha = this._boneData.alpha;
             if (this._boneData.parent !== null) {
                 this._parent = this._armature.getBone(this._boneData.parent.name);
             }
@@ -4801,7 +4737,6 @@ var dragonBones;
          * @internal
          */
         Bone.prototype.update = function (cacheFrameIndex) {
-            this._blendState.dirty = false;
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
                 if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) {
@@ -5019,72 +4954,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getBones()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getBones()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Bone.prototype.getBones = function () {
-            console.warn("Deprecated.");
-            var bones = new Array();
-            for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) {
-                var bone = _a[_i];
-                if (bone.parent === this) {
-                    bones.push(bone);
-                }
-            }
-            return bones;
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getSlots()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getSlots()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Bone.prototype.getSlots = function () {
-            console.warn("Deprecated.");
-            var slots = new Array();
-            for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) {
-                var slot = _a[_i];
-                if (slot.parent === this) {
-                    slots.push(slot);
-                }
-            }
-            return slots;
-        };
-        Object.defineProperty(Bone.prototype, "slot", {
-            /**
-             * - Deprecated, please refer to {@link dragonBones.Armature#getSlot()}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link dragonBones.Armature#getSlot()}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) {
-                    var slot = _a[_i];
-                    if (slot.parent === this) {
-                        return slot;
-                    }
-                }
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         return Bone;
     }(dragonBones.TransformObject));
     dragonBones.Bone = Bone;
@@ -5146,6 +5015,7 @@ var dragonBones;
             this._deformVertices.length = 0;
             this._matrixCahce.length = 0;
             this._hullCache.length = 0;
+            this._bone = null;
         };
         Surface.prototype._getAffineTransform = function (x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown) {
             var dabX = bX - aX;
@@ -5164,35 +5034,43 @@ var dragonBones;
             transform.y = matrix.ty = aY - (matrix.b * x + matrix.d * y);
         };
         Surface.prototype._updateVertices = function () {
-            var originalVertices = this._boneData.vertices;
+            var data = this._armature.armatureData.parent;
+            var geometry = this._boneData.geometry;
+            var intArray = data.intArray;
+            var floatArray = data.floatArray;
+            var vertexCount = intArray[geometry.offset + 0 /* GeometryVertexCount */];
+            var verticesOffset = intArray[geometry.offset + 2 /* GeometryFloatOffset */];
             var vertices = this._vertices;
             var animationVertices = this._deformVertices;
             if (this._parent !== null) {
                 if (this._parent._boneData.type === 1 /* Surface */) {
-                    for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                        var x = originalVertices[i] + animationVertices[i];
-                        var y = originalVertices[i + 1] + animationVertices[i];
+                    for (var i = 0, l = vertexCount; i < l; ++i) {
+                        var iD = i * 2;
+                        var x = floatArray[verticesOffset + iD] + animationVertices[iD];
+                        var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                         var matrix = this._parent._getGlobalTransformMatrix(x, y);
                         //
-                        vertices[i] = matrix.a * x + matrix.c * y + matrix.tx;
-                        vertices[i + 1] = matrix.b * x + matrix.d * y + matrix.ty;
+                        vertices[iD] = matrix.a * x + matrix.c * y + matrix.tx;
+                        vertices[iD + 1] = matrix.b * x + matrix.d * y + matrix.ty;
                     }
                 }
                 else {
                     var parentMatrix = this._parent.globalTransformMatrix;
-                    for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                        var x = originalVertices[i] + animationVertices[i];
-                        var y = originalVertices[i + 1] + animationVertices[i + 1];
+                    for (var i = 0, l = vertexCount; i < l; ++i) {
+                        var iD = i * 2;
+                        var x = floatArray[verticesOffset + iD] + animationVertices[iD];
+                        var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                         //
-                        vertices[i] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx;
-                        vertices[i + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty;
+                        vertices[iD] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx;
+                        vertices[iD + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty;
                     }
                 }
             }
             else {
-                for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                    vertices[i] = originalVertices[i] + animationVertices[i];
-                    vertices[i + 1] = originalVertices[i + 1] + animationVertices[i + 1];
+                for (var i = 0, l = vertexCount; i < l; ++i) {
+                    var iD = i * 2;
+                    vertices[iD] = floatArray[verticesOffset + iD] + animationVertices[iD];
+                    vertices[iD + 1] = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                 }
             }
         };
@@ -5222,17 +5100,17 @@ var dragonBones;
             var bY = rbY + (rcY - rbY) * 0.5;
             var cX = rdX + (rcX - rdX) * 0.5;
             var cY = rdY + (rcY - rdY) * 0.5;
-            //
-            this._globalDirty = false;
+            // TODO interpolation
             this._getAffineTransform(0.0, 0.0, lA, lA, aX, aY, bX, bY, cX, cY, this.global, this.globalTransformMatrix, false);
+            this._globalDirty = false;
         };
         Surface.prototype._getGlobalTransformMatrix = function (x, y) {
+            var lA = 200.0;
             var lB = 1000.0;
             if (x < -lB || lB < x || y < -lB || lB < y) {
                 return this.globalTransformMatrix;
             }
             var isDown = false;
-            var lA = 200.0;
             var surfaceData = this._boneData;
             var segmentX = surfaceData.segmentX;
             var segmentY = surfaceData.segmentY;
@@ -5244,6 +5122,7 @@ var dragonBones;
             var matrixIndex = 0;
             var pX = indexX * dX - lA;
             var pY = indexY * dY - lA;
+            //
             var matrices = this._matrixCahce;
             var helpMatrix = Surface._helpMatrix;
             if (x < -lA) {
@@ -5252,8 +5131,8 @@ var dragonBones;
                 }
                 // Left.
                 isDown = y > this._kX * (x + lA) + pY;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX * 2 + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + segmentY + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5284,8 +5163,8 @@ var dragonBones;
                 }
                 // Right.
                 isDown = y > this._kX * (x - lB) + pY;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5316,8 +5195,8 @@ var dragonBones;
                 }
                 // Up.
                 isDown = y > this._kY * (x - pX - dX) - lB;
-                matrixIndex = (segmentX * (segmentY + 1) + indexX * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5348,8 +5227,8 @@ var dragonBones;
                 }
                 // Down
                 isDown = y > this._kY * (x - pX - dX) + lA;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5377,7 +5256,7 @@ var dragonBones;
             else {
                 isDown = y > this._k * (x - pX - dX) + pY;
                 matrixIndex = ((segmentX * indexY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5411,7 +5290,7 @@ var dragonBones;
             _super.prototype.init.call(this, surfaceData, armatureValue);
             var segmentX = surfaceData.segmentX;
             var segmentY = surfaceData.segmentY;
-            var vertexCount = surfaceData.vertices.length;
+            var vertexCount = this._armature.armatureData.parent.intArray[surfaceData.geometry.offset + 0 /* GeometryVertexCount */];
             var lB = 1000.0;
             var lA = 200.0;
             //
@@ -5420,19 +5299,26 @@ var dragonBones;
             this._k = -this._dY / this._dX;
             this._kX = -this._dY / (lB - lA);
             this._kY = -(lB - lA) / this._dX;
-            this._vertices.length = vertexCount;
-            this._deformVertices.length = vertexCount;
+            this._vertices.length = vertexCount * 2;
+            this._deformVertices.length = vertexCount * 2;
             this._matrixCahce.length = (segmentX * segmentY + segmentX * 2 + segmentY * 2) * 2 * 7;
             this._hullCache.length = 10;
-            for (var i = 0; i < vertexCount; ++i) {
+            for (var i = 0; i < vertexCount * 2; ++i) {
                 this._deformVertices[i] = 0.0;
             }
+            if (this._parent !== null) {
+                if (this._parent.boneData.type === 0 /* Bone */) {
+                    this._bone = this._parent;
+                }
+                else {
+                    this._bone = this._parent._bone;
+                }
+            }
         };
         /**
          * @internal
          */
         Surface.prototype.update = function (cacheFrameIndex) {
-            this._blendState.dirty = false;
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
                 if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) {
@@ -5561,6 +5447,105 @@ var dragonBones;
  */
 var dragonBones;
 (function (dragonBones) {
+    /**
+     * @private
+     */
+    var DisplayFrame = /** @class */ (function (_super) {
+        __extends(DisplayFrame, _super);
+        function DisplayFrame() {
+            var _this = _super !== null && _super.apply(this, arguments) || this;
+            _this.deformVertices = [];
+            return _this;
+        }
+        DisplayFrame.toString = function () {
+            return "[class dragonBones.DisplayFrame]";
+        };
+        DisplayFrame.prototype._onClear = function () {
+            this.rawDisplayData = null;
+            this.displayData = null;
+            this.textureData = null;
+            this.display = null;
+            this.deformVertices.length = 0;
+        };
+        DisplayFrame.prototype.updateDeformVertices = function () {
+            if (this.rawDisplayData === null || this.deformVertices.length !== 0) {
+                return;
+            }
+            var rawGeometryData;
+            if (this.rawDisplayData.type === 2 /* Mesh */) {
+                rawGeometryData = this.rawDisplayData.geometry;
+            }
+            else if (this.rawDisplayData.type === 4 /* Path */) {
+                rawGeometryData = this.rawDisplayData.geometry;
+            }
+            else {
+                return;
+            }
+            var vertexCount = 0;
+            if (rawGeometryData.weight !== null) {
+                vertexCount = rawGeometryData.weight.count * 2;
+            }
+            else {
+                vertexCount = rawGeometryData.data.intArray[rawGeometryData.offset + 0 /* GeometryVertexCount */] * 2;
+            }
+            this.deformVertices.length = vertexCount;
+            for (var i = 0, l = this.deformVertices.length; i < l; ++i) {
+                this.deformVertices[i] = 0.0;
+            }
+        };
+        DisplayFrame.prototype.getGeometryData = function () {
+            if (this.displayData !== null) {
+                if (this.displayData.type === 2 /* Mesh */) {
+                    return this.displayData.geometry;
+                }
+                if (this.displayData.type === 4 /* Path */) {
+                    return this.displayData.geometry;
+                }
+            }
+            if (this.rawDisplayData !== null) {
+                if (this.rawDisplayData.type === 2 /* Mesh */) {
+                    return this.rawDisplayData.geometry;
+                }
+                if (this.rawDisplayData.type === 4 /* Path */) {
+                    return this.rawDisplayData.geometry;
+                }
+            }
+            return null;
+        };
+        DisplayFrame.prototype.getBoundingBox = function () {
+            if (this.displayData !== null && this.displayData.type === 3 /* BoundingBox */) {
+                return this.displayData.boundingBox;
+            }
+            if (this.rawDisplayData !== null && this.rawDisplayData.type === 3 /* BoundingBox */) {
+                return this.rawDisplayData.boundingBox;
+            }
+            return null;
+        };
+        DisplayFrame.prototype.getTextureData = function () {
+            if (this.displayData !== null) {
+                if (this.displayData.type === 0 /* Image */) {
+                    return this.displayData.texture;
+                }
+                if (this.displayData.type === 2 /* Mesh */) {
+                    return this.displayData.texture;
+                }
+            }
+            if (this.textureData !== null) {
+                return this.textureData;
+            }
+            if (this.rawDisplayData !== null) {
+                if (this.rawDisplayData.type === 0 /* Image */) {
+                    return this.rawDisplayData.texture;
+                }
+                if (this.rawDisplayData.type === 2 /* Mesh */) {
+                    return this.rawDisplayData.texture;
+                }
+            }
+            return null;
+        };
+        return DisplayFrame;
+    }(dragonBones.BaseObject));
+    dragonBones.DisplayFrame = DisplayFrame;
     /**
      * - The slot attached to the armature, controls the display status and properties of the display object.
      * A bone can contain multiple slots.
@@ -5594,25 +5579,30 @@ var dragonBones;
              * @internal
              */
             _this._colorTransform = new dragonBones.ColorTransform();
-            _this._displayDatas = [];
-            _this._displayList = [];
             /**
              * @internal
              */
-            _this._deformVertices = null;
+            _this._displayFrames = [];
+            /**
+             * @internal
+             */
+            _this._geometryBones = [];
             _this._rawDisplay = null; // Initial value.
             _this._meshDisplay = null; // Initial value.
+            _this._display = null;
             return _this;
         }
         Slot.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
             var disposeDisplayList = [];
-            for (var _i = 0, _a = this._displayList; _i < _a.length; _i++) {
-                var eachDisplay = _a[_i];
-                if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                    disposeDisplayList.indexOf(eachDisplay) < 0) {
-                    disposeDisplayList.push(eachDisplay);
+            for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                var dispayFrame = _a[_i];
+                var display = dispayFrame.display;
+                if (display !== this._rawDisplay && display !== this._meshDisplay &&
+                    disposeDisplayList.indexOf(display) < 0) {
+                    disposeDisplayList.push(display);
                 }
+                dispayFrame.returnToPool();
             }
             for (var _b = 0, disposeDisplayList_1 = disposeDisplayList; _b < disposeDisplayList_1.length; _b++) {
                 var eachDisplay = disposeDisplayList_1[_b];
@@ -5623,9 +5613,6 @@ var dragonBones;
                     this._disposeDisplay(eachDisplay, true);
                 }
             }
-            if (this._deformVertices !== null) {
-                this._deformVertices.returnToPool();
-            }
             if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) {
                 this._disposeDisplay(this._meshDisplay, false);
             }
@@ -5633,29 +5620,34 @@ var dragonBones;
                 this._disposeDisplay(this._rawDisplay, false);
             }
             this.displayController = null;
+            this._displayDataDirty = false;
             this._displayDirty = false;
-            this._zOrderDirty = false;
+            this._geometryDirty = false;
+            this._textureDirty = false;
+            this._visibleDirty = false;
             this._blendModeDirty = false;
+            this._zOrderDirty = false;
             this._colorDirty = false;
+            this._verticesDirty = false;
             this._transformDirty = false;
             this._visible = true;
             this._blendMode = 0 /* Normal */;
             this._displayIndex = -1;
             this._animationDisplayIndex = -1;
             this._zOrder = 0;
+            this._zIndex = 0;
             this._cachedFrameIndex = -1;
             this._pivotX = 0.0;
             this._pivotY = 0.0;
             this._localMatrix.identity();
             this._colorTransform.identity();
-            this._displayList.length = 0;
-            this._displayDatas.length = 0;
+            this._displayFrames.length = 0;
+            this._geometryBones.length = 0;
             this._slotData = null; //
-            this._rawDisplayDatas = null;
-            this._displayData = null;
+            this._displayFrame = null;
+            this._geometryData = null;
             this._boundingBoxData = null;
             this._textureData = null;
-            this._deformVertices = null;
             this._rawDisplay = null;
             this._meshDisplay = null;
             this._display = null;
@@ -5663,73 +5655,60 @@ var dragonBones;
             this._parent = null; //
             this._cachedFrameIndices = null;
         };
+        Slot.prototype._hasDisplay = function (display) {
+            for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                var displayFrame = _a[_i];
+                if (displayFrame.display === display) {
+                    return true;
+                }
+            }
+            return false;
+        };
         /**
-         * - Support default skin data.
+         * @internal
          */
-        Slot.prototype._getDefaultRawDisplayData = function (displayIndex) {
-            var defaultSkin = this._armature._armatureData.defaultSkin;
-            if (defaultSkin !== null) {
-                var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name);
-                if (defaultRawDisplayDatas !== null) {
-                    return displayIndex < defaultRawDisplayDatas.length ? defaultRawDisplayDatas[displayIndex] : null;
+        Slot.prototype._isBonesUpdate = function () {
+            for (var _i = 0, _a = this._geometryBones; _i < _a.length; _i++) {
+                var bone = _a[_i];
+                if (bone !== null && bone._childrenTransformDirty) {
+                    return true;
                 }
             }
-            return null;
+            return false;
+        };
+        /**
+         * @internal
+         */
+        Slot.prototype._updateAlpha = function () {
+            var globalAlpha = this._alpha * this._parent._globalAlpha;
+            if (this._globalAlpha !== globalAlpha) {
+                this._globalAlpha = globalAlpha;
+                this._colorDirty = true;
+            }
         };
         Slot.prototype._updateDisplayData = function () {
-            var prevDisplayData = this._displayData;
-            var prevVerticesData = this._deformVertices !== null ? this._deformVertices.verticesData : null;
+            var prevDisplayFrame = this._displayFrame;
+            var prevGeometryData = this._geometryData;
             var prevTextureData = this._textureData;
             var rawDisplayData = null;
-            var currentVerticesData = null;
-            this._displayData = null;
+            var displayData = null;
+            this._displayFrame = null;
+            this._geometryData = null;
             this._boundingBoxData = null;
             this._textureData = null;
-            if (this._displayIndex >= 0) {
-                if (this._rawDisplayDatas !== null) {
-                    rawDisplayData = this._displayIndex < this._rawDisplayDatas.length ? this._rawDisplayDatas[this._displayIndex] : null;
-                }
-                if (rawDisplayData === null) {
-                    rawDisplayData = this._getDefaultRawDisplayData(this._displayIndex);
-                }
-                if (this._displayIndex < this._displayDatas.length) {
-                    this._displayData = this._displayDatas[this._displayIndex];
-                }
-            }
-            if (this._displayData !== null) {
-                if (this._displayData.type === 2 /* Mesh */) {
-                    currentVerticesData = this._displayData.vertices;
-                }
-                else if (this._displayData.type === 4 /* Path */) {
-                    currentVerticesData = this._displayData.vertices;
-                }
-                else if (rawDisplayData !== null) {
-                    if (rawDisplayData.type === 2 /* Mesh */) {
-                        currentVerticesData = rawDisplayData.vertices;
-                    }
-                    else if (rawDisplayData.type === 4 /* Path */) {
-                        currentVerticesData = rawDisplayData.vertices;
-                    }
-                }
-                if (this._displayData.type === 3 /* BoundingBox */) {
-                    this._boundingBoxData = this._displayData.boundingBox;
-                }
-                else if (rawDisplayData !== null) {
-                    if (rawDisplayData.type === 3 /* BoundingBox */) {
-                        this._boundingBoxData = rawDisplayData.boundingBox;
-                    }
-                }
-                if (this._displayData.type === 0 /* Image */) {
-                    this._textureData = this._displayData.texture;
-                }
-                else if (this._displayData.type === 2 /* Mesh */) {
-                    this._textureData = this._displayData.texture;
-                }
-            }
-            if (this._displayData !== prevDisplayData || currentVerticesData !== prevVerticesData || this._textureData !== prevTextureData) {
+            if (this._displayIndex >= 0 && this._displayIndex < this._displayFrames.length) {
+                this._displayFrame = this._displayFrames[this._displayIndex];
+                rawDisplayData = this._displayFrame.rawDisplayData;
+                displayData = this._displayFrame.displayData;
+                this._geometryData = this._displayFrame.getGeometryData();
+                this._boundingBoxData = this._displayFrame.getBoundingBox();
+                this._textureData = this._displayFrame.getTextureData();
+            }
+            if (this._displayFrame !== prevDisplayFrame ||
+                this._geometryData !== prevGeometryData || this._textureData !== prevTextureData) {
                 // Update pivot offset.
-                if (currentVerticesData === null && this._textureData !== null) {
-                    var imageDisplayData = this._displayData;
+                if (this._geometryData === null && this._textureData !== null) {
+                    var imageDisplayData = ((displayData !== null && displayData.type === 0 /* Image */) ? displayData : rawDisplayData); //
                     var scale = this._textureData.parent.scale * this._armature._armatureData.scale;
                     var frame = this._textureData.frame;
                     this._pivotX = imageDisplayData.pivot.x;
@@ -5748,13 +5727,13 @@ var dragonBones;
                         this._pivotY += frame.y * scale;
                     }
                     // Update replace pivot. TODO
-                    if (this._displayData !== null && rawDisplayData !== null && this._displayData !== rawDisplayData) {
+                    if (rawDisplayData !== null && imageDisplayData !== rawDisplayData) {
                         rawDisplayData.transform.toMatrix(Slot._helpMatrix);
                         Slot._helpMatrix.invert();
                         Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint);
                         this._pivotX -= Slot._helpPoint.x;
                         this._pivotY -= Slot._helpPoint.y;
-                        this._displayData.transform.toMatrix(Slot._helpMatrix);
+                        imageDisplayData.transform.toMatrix(Slot._helpMatrix);
                         Slot._helpMatrix.invert();
                         Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint);
                         this._pivotX += Slot._helpPoint.x;
@@ -5772,23 +5751,38 @@ var dragonBones;
                 if (rawDisplayData !== null) {
                     this.origin = rawDisplayData.transform;
                 }
-                else if (this._displayData !== null) {
-                    this.origin = this._displayData.transform;
+                else if (displayData !== null) {
+                    this.origin = displayData.transform;
                 }
                 else {
                     this.origin = null;
                 }
-                // Update vertices.
-                if (currentVerticesData !== prevVerticesData) {
-                    if (this._deformVertices === null) {
-                        this._deformVertices = dragonBones.BaseObject.borrowObject(dragonBones.DeformVertices);
-                    }
-                    this._deformVertices.init(currentVerticesData, this._armature);
+                // TODO remove slot offset.
+                if (this.origin !== null) {
+                    this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix);
                 }
-                else if (this._deformVertices !== null && this._textureData !== prevTextureData) {
-                    this._deformVertices.verticesDirty = true;
+                else {
+                    this.global.copyFrom(this.offset).toMatrix(this._localMatrix);
+                }
+                // Update geometry.
+                if (this._geometryData !== prevGeometryData) {
+                    this._geometryDirty = true;
+                    this._verticesDirty = true;
+                    if (this._geometryData !== null) {
+                        this._geometryBones.length = 0;
+                        if (this._geometryData.weight !== null) {
+                            for (var i = 0, l = this._geometryData.weight.bones.length; i < l; ++i) {
+                                var bone = this._armature.getBone(this._geometryData.weight.bones[i].name);
+                                this._geometryBones.push(bone);
+                            }
+                        }
+                    }
+                    else {
+                        this._geometryBones.length = 0;
+                        this._geometryData = null;
+                    }
                 }
-                this._displayDirty = true;
+                this._textureDirty = this._textureData !== prevTextureData;
                 this._transformDirty = true;
             }
         };
@@ -5796,8 +5790,8 @@ var dragonBones;
             var prevDisplay = this._display !== null ? this._display : this._rawDisplay;
             var prevChildArmature = this._childArmature;
             // Update display and child armature.
-            if (this._displayIndex >= 0 && this._displayIndex < this._displayList.length) {
-                this._display = this._displayList[this._displayIndex];
+            if (this._displayFrame !== null) {
+                this._display = this._displayFrame.display;
                 if (this._display !== null && this._display instanceof dragonBones.Armature) {
                     this._childArmature = this._display;
                     this._display = this._childArmature.display;
@@ -5813,16 +5807,14 @@ var dragonBones;
             // Update display.
             var currentDisplay = this._display !== null ? this._display : this._rawDisplay;
             if (currentDisplay !== prevDisplay) {
-                this._onUpdateDisplay();
-                this._replaceDisplay(prevDisplay);
-                this._transformDirty = true;
+                this._textureDirty = true;
                 this._visibleDirty = true;
                 this._blendModeDirty = true;
+                // this._zOrderDirty = true;
                 this._colorDirty = true;
-            }
-            // Update frame.
-            if (currentDisplay === this._rawDisplay || currentDisplay === this._meshDisplay) {
-                this._updateFrame();
+                this._transformDirty = true;
+                this._onUpdateDisplay();
+                this._replaceDisplay(prevDisplay);
             }
             // Update child armature.
             if (this._childArmature !== prevChildArmature) {
@@ -5844,31 +5836,25 @@ var dragonBones;
                             }
                         }
                         // Child armature action.
-                        var actions = null;
-                        if (this._displayData !== null && this._displayData.type === 1 /* Armature */) {
-                            actions = this._displayData.actions;
-                        }
-                        else if (this._displayIndex >= 0 && this._rawDisplayDatas !== null) {
-                            var rawDisplayData = this._displayIndex < this._rawDisplayDatas.length ? this._rawDisplayDatas[this._displayIndex] : null;
-                            if (rawDisplayData === null) {
-                                rawDisplayData = this._getDefaultRawDisplayData(this._displayIndex);
+                        if (this._displayFrame !== null) {
+                            var actions = null;
+                            var displayData = this._displayFrame.displayData !== null ? this._displayFrame.displayData : this._displayFrame.rawDisplayData;
+                            if (displayData !== null && displayData.type === 1 /* Armature */) {
+                                actions = displayData.actions;
                             }
-                            if (rawDisplayData !== null && rawDisplayData.type === 1 /* Armature */) {
-                                actions = rawDisplayData.actions;
+                            if (actions !== null && actions.length > 0) {
+                                for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
+                                    var action = actions_1[_i];
+                                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                                    dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature);
+                                    eventObject.slot = this;
+                                    this._armature._bufferAction(eventObject, false);
+                                }
                             }
-                        }
-                        if (actions !== null && actions.length > 0) {
-                            for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
-                                var action = actions_1[_i];
-                                var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                                dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature);
-                                eventObject.slot = this;
-                                this._armature._bufferAction(eventObject, false);
+                            else {
+                                this._childArmature.animation.play();
                             }
                         }
-                        else {
-                            this._childArmature.animation.play();
-                        }
                     }
                 }
             }
@@ -5891,24 +5877,23 @@ var dragonBones;
             if (isAnimation === void 0) { isAnimation = false; }
             if (isAnimation) {
                 if (this._animationDisplayIndex === value) {
-                    return false;
+                    return;
                 }
                 this._animationDisplayIndex = value;
             }
             if (this._displayIndex === value) {
-                return false;
+                return;
             }
-            this._displayIndex = value;
-            this._displayDirty = true;
-            this._updateDisplayData();
-            return this._displayDirty;
+            this._displayIndex = value < this._displayFrames.length ? value : this._displayFrames.length - 1;
+            this._displayDataDirty = true;
+            this._displayDirty = this._displayIndex < 0 || this._display !== this._displayFrames[this._displayIndex].display;
         };
         /**
          * @internal
          */
-        Slot.prototype._setZorder = function (value) {
+        Slot.prototype._setZOrder = function (value) {
             if (this._zOrder === value) {
-                //return false;
+                // return false;
             }
             this._zOrder = value;
             this._zOrderDirty = true;
@@ -5919,37 +5904,7 @@ var dragonBones;
          */
         Slot.prototype._setColor = function (value) {
             this._colorTransform.copyFrom(value);
-            this._colorDirty = true;
-            return this._colorDirty;
-        };
-        /**
-         * @internal
-         */
-        Slot.prototype._setDisplayList = function (value) {
-            if (value !== null && value.length > 0) {
-                if (this._displayList.length !== value.length) {
-                    this._displayList.length = value.length;
-                }
-                for (var i = 0, l = value.length; i < l; ++i) {
-                    var eachDisplay = value[i];
-                    if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                        !(eachDisplay instanceof dragonBones.Armature) && this._displayList.indexOf(eachDisplay) < 0) {
-                        this._initDisplay(eachDisplay, true);
-                    }
-                    this._displayList[i] = eachDisplay;
-                }
-            }
-            else if (this._displayList.length > 0) {
-                this._displayList.length = 0;
-            }
-            if (this._displayIndex >= 0 && this._displayIndex < this._displayList.length) {
-                this._displayDirty = this._display !== this._displayList[this._displayIndex];
-            }
-            else {
-                this._displayDirty = this._display !== null;
-            }
-            this._updateDisplayData();
-            return this._displayDirty;
+            return this._colorDirty = true;
         };
         /**
          * @internal
@@ -5959,18 +5914,17 @@ var dragonBones;
                 return;
             }
             this._slotData = slotData;
-            //
-            this._visibleDirty = true;
-            this._blendModeDirty = true;
-            this._colorDirty = true;
+            this._colorDirty = true; //
+            this._blendModeDirty = true; //
             this._blendMode = this._slotData.blendMode;
             this._zOrder = this._slotData.zOrder;
+            this._zIndex = this._slotData.zIndex;
+            this._alpha = this._slotData.alpha;
             this._colorTransform.copyFrom(this._slotData.color);
             this._rawDisplay = rawDisplay;
             this._meshDisplay = meshDisplay;
             //
             this._armature = armatureValue;
-            //
             var slotParent = this._armature.getBone(this._slotData.parent.name);
             if (slotParent !== null) {
                 this._parent = slotParent;
@@ -5991,22 +5945,52 @@ var dragonBones;
          * @internal
          */
         Slot.prototype.update = function (cacheFrameIndex) {
+            if (this._displayDataDirty) {
+                this._updateDisplayData();
+                this._displayDataDirty = false;
+            }
             if (this._displayDirty) {
-                this._displayDirty = false;
                 this._updateDisplay();
-                // TODO remove slot offset.
-                if (this._transformDirty) {
-                    if (this.origin !== null) {
-                        this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix);
-                    }
-                    else {
-                        this.global.copyFrom(this.offset).toMatrix(this._localMatrix);
-                    }
+                this._displayDirty = false;
+            }
+            if (this._geometryDirty || this._textureDirty) {
+                if (this._display === null || this._display === this._rawDisplay || this._display === this._meshDisplay) {
+                    this._updateFrame();
                 }
+                this._geometryDirty = false;
+                this._textureDirty = false;
+            }
+            if (this._display === null) {
+                return;
+            }
+            if (this._visibleDirty) {
+                this._updateVisible();
+                this._visibleDirty = false;
+            }
+            if (this._blendModeDirty) {
+                this._updateBlendMode();
+                this._blendModeDirty = false;
+            }
+            if (this._colorDirty) {
+                this._updateColor();
+                this._colorDirty = false;
             }
             if (this._zOrderDirty) {
-                this._zOrderDirty = false;
                 this._updateZOrder();
+                this._zOrderDirty = false;
+            }
+            if (this._geometryData !== null && this._display === this._meshDisplay) {
+                var isSkinned = this._geometryData.weight !== null;
+                var isSurface = this._parent._boneData.type !== 0 /* Bone */;
+                if (this._verticesDirty ||
+                    (isSkinned && this._isBonesUpdate()) ||
+                    (isSurface && this._parent._childrenTransformDirty)) {
+                    this._updateMesh();
+                    this._verticesDirty = false;
+                }
+                if (isSkinned || isSurface) {
+                    return;
+                }
             }
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
@@ -6035,36 +6019,7 @@ var dragonBones;
                 this._transformDirty = true;
                 this._cachedFrameIndex = -1;
             }
-            if (this._display === null) {
-                return;
-            }
-            if (this._visibleDirty) {
-                this._visibleDirty = false;
-                this._updateVisible();
-            }
-            if (this._blendModeDirty) {
-                this._blendModeDirty = false;
-                this._updateBlendMode();
-            }
-            if (this._colorDirty) {
-                this._colorDirty = false;
-                this._updateColor();
-            }
-            if (this._deformVertices !== null && this._deformVertices.verticesData !== null && this._display === this._meshDisplay) {
-                var isSkinned = this._deformVertices.verticesData.weight !== null;
-                var isSurface = this._parent._boneData.type !== 0 /* Bone */;
-                if (this._deformVertices.verticesDirty ||
-                    (isSkinned && this._deformVertices.isBonesUpdate()) ||
-                    (isSurface && this._parent._childrenTransformDirty)) {
-                    this._deformVertices.verticesDirty = false;
-                    this._updateMesh();
-                }
-                if (isSkinned || isSurface) {
-                    return;
-                }
-            }
             if (this._transformDirty) {
-                this._transformDirty = false;
                 if (this._cachedFrameIndex < 0) {
                     var isCache = cacheFrameIndex >= 0;
                     this._updateGlobalTransformMatrix(isCache);
@@ -6076,64 +6031,161 @@ var dragonBones;
                     this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex);
                 }
                 this._updateTransform();
+                this._transformDirty = false;
             }
         };
+        /**
+         * - Forces the slot to update the state of the display object in the next frame.
+         * @version DragonBones 4.5
+         * @language en_US
+         */
+        /**
+         * - 强制插槽在下一帧更新显示对象的状态。
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        Slot.prototype.invalidUpdate = function () {
+            this._displayDataDirty = true;
+            this._displayDirty = true;
+            //
+            this._transformDirty = true;
+        };
         /**
          * @private
          */
         Slot.prototype.updateTransformAndMatrix = function () {
             if (this._transformDirty) {
-                this._transformDirty = false;
                 this._updateGlobalTransformMatrix(false);
+                this._transformDirty = false;
             }
         };
         /**
          * @private
          */
-        Slot.prototype.replaceDisplayData = function (value, displayIndex) {
-            if (displayIndex === void 0) { displayIndex = -1; }
-            if (displayIndex < 0) {
-                if (this._displayIndex < 0) {
-                    displayIndex = 0;
-                }
-                else {
-                    displayIndex = this._displayIndex;
-                }
+        Slot.prototype.replaceRawDisplayData = function (displayData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
             }
-            if (this._displayDatas.length <= displayIndex) {
-                this._displayDatas.length = displayIndex + 1;
-                for (var i = 0, l = this._displayDatas.length; i < l; ++i) {
-                    if (!this._displayDatas[i]) {
-                        this._displayDatas[i] = null;
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.rawDisplayData !== displayData) {
+                displayFrame.deformVertices.length = 0;
+                displayFrame.rawDisplayData = displayData;
+                if (displayFrame.rawDisplayData === null) {
+                    var defaultSkin = this._armature._armatureData.defaultSkin;
+                    if (defaultSkin !== null) {
+                        var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name);
+                        if (defaultRawDisplayDatas !== null && index < defaultRawDisplayDatas.length) {
+                            displayFrame.rawDisplayData = defaultRawDisplayDatas[index];
+                        }
                     }
                 }
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
             }
-            this._displayDatas[displayIndex] = value;
         };
         /**
-         * - Check whether a specific point is inside a custom bounding box in the slot.
-         * The coordinate system of the point is the inner coordinate system of the armature.
-         * Custom bounding boxes need to be customized in Dragonbones Pro.
-         * @param x - The horizontal coordinate of the point.
-         * @param y - The vertical coordinate of the point.
-         * @version DragonBones 5.0
-         * @language en_US
+         * @private
          */
+        Slot.prototype.replaceDisplayData = function (displayData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.displayData !== displayData && displayFrame.rawDisplayData !== displayData) {
+                displayFrame.displayData = displayData;
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
+            }
+        };
         /**
-         * - 检查特定点是否在插槽的自定义边界框内。
-         * 点的坐标系为骨架内坐标系。
-         * 自定义边界框需要在 DragonBones Pro 中自定义。
-         * @param x - 点的水平坐标。
-         * @param y - 点的垂直坐标。
-         * @version DragonBones 5.0
-         * @language zh_CN
+         * @private
          */
-        Slot.prototype.containsPoint = function (x, y) {
-            if (this._boundingBoxData === null) {
-                return false;
+        Slot.prototype.replaceTextureData = function (textureData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
             }
-            this.updateTransformAndMatrix();
-            Slot._helpMatrix.copyFrom(this.globalTransformMatrix);
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.textureData !== textureData) {
+                displayFrame.textureData = textureData;
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
+            }
+        };
+        /**
+         * @private
+         */
+        Slot.prototype.replaceDisplay = function (value, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.display !== value) {
+                var prevDisplay = displayFrame.display;
+                displayFrame.display = value;
+                if (prevDisplay !== null &&
+                    prevDisplay !== this._rawDisplay && prevDisplay !== this._meshDisplay &&
+                    !this._hasDisplay(prevDisplay)) {
+                    if (prevDisplay instanceof dragonBones.Armature) {
+                        // (eachDisplay as Armature).dispose();
+                    }
+                    else {
+                        this._disposeDisplay(prevDisplay, true);
+                    }
+                }
+                if (value !== null &&
+                    value !== this._rawDisplay && value !== this._meshDisplay &&
+                    !this._hasDisplay(prevDisplay) &&
+                    !(value instanceof dragonBones.Armature)) {
+                    this._initDisplay(value, true);
+                }
+                if (index === this._displayIndex) {
+                    this._displayDirty = true;
+                }
+            }
+        };
+        /**
+         * - Check whether a specific point is inside a custom bounding box in the slot.
+         * The coordinate system of the point is the inner coordinate system of the armature.
+         * Custom bounding boxes need to be customized in Dragonbones Pro.
+         * @param x - The horizontal coordinate of the point.
+         * @param y - The vertical coordinate of the point.
+         * @version DragonBones 5.0
+         * @language en_US
+         */
+        /**
+         * - 检查特定点是否在插槽的自定义边界框内。
+         * 点的坐标系为骨架内坐标系。
+         * 自定义边界框需要在 DragonBones Pro 中自定义。
+         * @param x - 点的水平坐标。
+         * @param y - 点的垂直坐标。
+         * @version DragonBones 5.0
+         * @language zh_CN
+         */
+        Slot.prototype.containsPoint = function (x, y) {
+            if (this._boundingBoxData === null) {
+                return false;
+            }
+            this.updateTransformAndMatrix();
+            Slot._helpMatrix.copyFrom(this.globalTransformMatrix);
             Slot._helpMatrix.invert();
             Slot._helpMatrix.transformPoint(x, y, Slot._helpPoint);
             return this._boundingBoxData.containsPoint(Slot._helpPoint.x, Slot._helpPoint.y);
@@ -6216,18 +6268,10 @@ var dragonBones;
             return intersectionCount;
         };
         /**
-         * - Forces the slot to update the state of the display object in the next frame.
-         * @version DragonBones 4.5
-         * @language en_US
-         */
-        /**
-         * - 强制插槽在下一帧更新显示对象的状态。
-         * @version DragonBones 4.5
-         * @language zh_CN
+         * @private
          */
-        Slot.prototype.invalidUpdate = function () {
-            this._displayDirty = true;
-            this._transformDirty = true;
+        Slot.prototype.getDisplayFrameAt = function (index) {
+            return this._displayFrames[index];
         };
         Object.defineProperty(Slot.prototype, "visible", {
             /**
@@ -6255,6 +6299,32 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Slot.prototype, "displayFrameCount", {
+            /**
+             * @private
+             */
+            get: function () {
+                return this._displayFrames.length;
+            },
+            set: function (value) {
+                var prevCount = this._displayFrames.length;
+                if (prevCount < value) {
+                    this._displayFrames.length = value;
+                    for (var i = prevCount; i < value; ++i) {
+                        this._displayFrames[i] = dragonBones.BaseObject.borrowObject(DisplayFrame);
+                    }
+                }
+                else if (prevCount > value) {
+                    for (var i = prevCount - 1; i < value; --i) {
+                        this.replaceDisplay(null, i);
+                        this._displayFrames[i].returnToPool();
+                    }
+                    this._displayFrames.length = value;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(Slot.prototype, "displayIndex", {
             /**
              * - The index of the display object displayed in the display list.
@@ -6282,9 +6352,8 @@ var dragonBones;
                 return this._displayIndex;
             },
             set: function (value) {
-                if (this._setDisplayIndex(value)) {
-                    this.update(-1);
-                }
+                this._setDisplayIndex(value);
+                this.update(-1);
             },
             enumerable: true,
             configurable: true
@@ -6320,31 +6389,19 @@ var dragonBones;
              * @language zh_CN
              */
             get: function () {
-                return this._displayList.concat();
+                var displays = new Array();
+                for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                    var displayFrame = _a[_i];
+                    displays.push(displayFrame.display);
+                }
+                return displays;
             },
             set: function (value) {
-                var backupDisplayList = this._displayList.concat(); // Copy.
-                var disposeDisplayList = new Array();
-                if (this._setDisplayList(value)) {
-                    this.update(-1);
-                }
-                // Release replaced displays.
-                for (var _i = 0, backupDisplayList_1 = backupDisplayList; _i < backupDisplayList_1.length; _i++) {
-                    var eachDisplay = backupDisplayList_1[_i];
-                    if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                        this._displayList.indexOf(eachDisplay) < 0 &&
-                        disposeDisplayList.indexOf(eachDisplay) < 0) {
-                        disposeDisplayList.push(eachDisplay);
-                    }
-                }
-                for (var _a = 0, disposeDisplayList_2 = disposeDisplayList; _a < disposeDisplayList_2.length; _a++) {
-                    var eachDisplay = disposeDisplayList_2[_a];
-                    if (eachDisplay instanceof dragonBones.Armature) {
-                        // (eachDisplay as Armature).dispose();
-                    }
-                    else {
-                        this._disposeDisplay(eachDisplay, true);
-                    }
+                this.displayFrameCount = value.length;
+                var index = 0;
+                for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {
+                    var eachDisplay = value_1[_i];
+                    this.replaceDisplay(eachDisplay, index++);
                 }
             },
             enumerable: true,
@@ -6369,46 +6426,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Slot.prototype, "rawDisplayDatas", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this._rawDisplayDatas;
-            },
-            set: function (value) {
-                if (this._rawDisplayDatas === value) {
-                    return;
-                }
-                this._displayDirty = true;
-                this._rawDisplayDatas = value;
-                if (this._rawDisplayDatas !== null) {
-                    this._displayDatas.length = this._rawDisplayDatas.length;
-                    for (var i = 0, l = this._displayDatas.length; i < l; ++i) {
-                        var rawDisplayData = this._rawDisplayDatas[i];
-                        if (rawDisplayData === null) {
-                            rawDisplayData = this._getDefaultRawDisplayData(i);
-                        }
-                        this._displayDatas[i] = rawDisplayData;
-                    }
-                }
-                else {
-                    this._displayDatas.length = 0;
-                }
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Slot.prototype, "displayData", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this._displayData;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(Slot.prototype, "boundingBoxData", {
             /**
              * - The custom bounding box data for the slot at current time.
@@ -6474,21 +6491,11 @@ var dragonBones;
                 if (this._display === value) {
                     return;
                 }
-                var displayListLength = this._displayList.length;
-                if (this._displayIndex < 0 && displayListLength === 0) {
+                if (this._displayFrames.length === 0) {
+                    this.displayFrameCount = 1;
                     this._displayIndex = 0;
                 }
-                if (this._displayIndex < 0) {
-                    return;
-                }
-                else {
-                    var replaceDisplayList = this.displayList; // Copy.
-                    if (displayListLength <= this._displayIndex) {
-                        replaceDisplayList.length = this._displayIndex + 1;
-                    }
-                    replaceDisplayList[this._displayIndex] = value;
-                    this.displayList = replaceDisplayList;
-                }
+                this.replaceDisplay(value, this._displayIndex);
             },
             enumerable: true,
             configurable: true
@@ -6499,9 +6506,9 @@ var dragonBones;
              * @example
              * 
              *     let slot = armature.getSlot("weapon");
-             * let prevChildArmature = slot.childArmature;
-             * if (prevChildArmature) {
-             * prevChildArmature.dispose();
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
              *     }
              *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
              * 
@@ -6514,9 +6521,9 @@ var dragonBones; * @example *
              *     let slot = armature.getSlot("weapon");
-             * let prevChildArmature = slot.childArmature;
-             * if (prevChildArmature) {
-             * prevChildArmature.dispose();
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
              *     }
              *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
              * 
@@ -6811,8 +6818,8 @@ var dragonBones; var intArray = dragonBonesData.intArray; var floatArray = dragonBonesData.floatArray; var pathOffset = verticesData.offset; - var pathVertexCount = intArray[pathOffset + 0 /* PathVertexCount */]; - var pathVertexOffset = intArray[pathOffset + 2 /* PathFloatOffset */]; + var pathVertexCount = intArray[pathOffset + 0 /* GeometryVertexCount */]; + var pathVertexOffset = intArray[pathOffset + 2 /* GeometryFloatOffset */]; this._pathGlobalVertices.length = pathVertexCount * 2; var weightData = verticesData.weight; //没有骨骼约束我,那节点只受自己的Bone控制 @@ -6832,7 +6839,7 @@ var dragonBones; return; } //有骨骼约束我,那我的节点受骨骼权重控制 - var bones = this._pathSlot._deformVertices.bones; + var bones = this._pathSlot._geometryBones; var weightBoneCount = weightData.bones.length; var weightOffset = weightData.offset; var floatOffset = intArray[weightOffset + 1 /* WeigthFloatOffset */]; @@ -6870,7 +6877,7 @@ var dragonBones; //计算当前的骨骼在曲线上的位置 var armature = this._armature; var intArray = armature.armatureData.parent.intArray; - var vertexCount = intArray[pathDisplayDta.vertices.offset + 0 /* PathVertexCount */]; + var vertexCount = intArray[pathDisplayDta.geometry.offset + 0 /* GeometryVertexCount */]; var positions = this._positions; var spaces = this._spaces; var isClosed = pathDisplayDta.closed; @@ -7127,7 +7134,7 @@ var dragonBones; this._constraintData = constraintData; this._armature = armature; var data = constraintData; - this.pathOffset = data.pathDisplayData.vertices.offset; + this.pathOffset = data.pathDisplayData.geometry.offset; // this.position = data.position; this.spacing = data.spacing; @@ -7151,24 +7158,21 @@ var dragonBones; }; PathConstraint.prototype.update = function () { var pathSlot = this._pathSlot; - if (pathSlot._deformVertices === null || - pathSlot._deformVertices.verticesData === null || - pathSlot._deformVertices.verticesData.offset !== this.pathOffset) { + if (pathSlot._geometryData === null || + pathSlot._geometryData.offset !== this.pathOffset) { return; } var constraintData = this._constraintData; - var pathDisplayData = pathSlot._displayData; // TODO // //曲线节点数据改变:父亲bone改变,权重bones改变,变形顶点改变 var isPathVerticeDirty = false; - var deformVertices = pathSlot._deformVertices; if (this._root._childrenTransformDirty) { - this._updatePathVertices(pathDisplayData.vertices); + this._updatePathVertices(pathSlot._geometryData); isPathVerticeDirty = true; } - else if (deformVertices !== null && (deformVertices.verticesDirty || deformVertices.isBonesUpdate())) { - this._updatePathVertices(pathDisplayData.vertices); - deformVertices.verticesDirty = false; + else if (pathSlot._verticesDirty || pathSlot._isBonesUpdate()) { + this._updatePathVertices(pathSlot._geometryData); + pathSlot._verticesDirty = false; isPathVerticeDirty = true; } if (!isPathVerticeDirty && !this.dirty) { @@ -7211,7 +7215,7 @@ var dragonBones; } } // - this._computeBezierCurve(pathDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); + this._computeBezierCurve(pathSlot._displayFrame.rawDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); //根据新的节点数据重新采样 var positions = this._positions; var rotateOffset = this.rotateOffset; @@ -7313,94 +7317,6 @@ var dragonBones; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ var dragonBones; -(function (dragonBones) { - /** - * @internal - */ - var DeformVertices = /** @class */ (function (_super) { - __extends(DeformVertices, _super); - function DeformVertices() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.vertices = []; - _this.bones = []; - return _this; - } - DeformVertices.toString = function () { - return "[class dragonBones.DeformVertices]"; - }; - DeformVertices.prototype._onClear = function () { - this.verticesDirty = false; - this.vertices.length = 0; - this.bones.length = 0; - this.verticesData = null; - }; - DeformVertices.prototype.init = function (verticesDataValue, armature) { - this.verticesData = verticesDataValue; - if (this.verticesData !== null) { - var vertexCount = 0; - if (this.verticesData.weight !== null) { - vertexCount = this.verticesData.weight.count * 2; - } - else { - vertexCount = this.verticesData.data.intArray[this.verticesData.offset + 0 /* MeshVertexCount */] * 2; - } - this.verticesDirty = true; - this.vertices.length = vertexCount; - this.bones.length = 0; - // - for (var i = 0, l = this.vertices.length; i < l; ++i) { - this.vertices[i] = 0.0; - } - if (this.verticesData.weight !== null) { - for (var i = 0, l = this.verticesData.weight.bones.length; i < l; ++i) { - var bone = armature.getBone(this.verticesData.weight.bones[i].name); - this.bones.push(bone); - } - } - } - else { - this.verticesDirty = false; - this.vertices.length = 0; - this.bones.length = 0; - this.verticesData = null; - } - }; - DeformVertices.prototype.isBonesUpdate = function () { - for (var _i = 0, _a = this.bones; _i < _a.length; _i++) { - var bone = _a[_i]; - if (bone !== null && bone._childrenTransformDirty) { - return true; - } - } - return false; - }; - return DeformVertices; - }(dragonBones.BaseObject)); - dragonBones.DeformVertices = DeformVertices; -})(dragonBones || (dragonBones = {})); -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -var dragonBones; (function (dragonBones) { /** * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. @@ -7623,17 +7539,6 @@ var dragonBones; enumerable: true, configurable: true }); - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#clock}。 - * @deprecated - * @language zh_CN - */ - WorldClock.clock = new WorldClock(); return WorldClock; }()); dragonBones.WorldClock = WorldClock; @@ -7683,6 +7588,7 @@ var dragonBones; _this._animationNames = []; _this._animationStates = []; _this._animations = {}; + _this._blendStates = {}; _this._animationConfig = null; // Initial value. return _this; } @@ -7697,11 +7603,17 @@ var dragonBones; for (var k in this._animations) { delete this._animations[k]; } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].returnToPool(); + } + delete this._blendStates[k]; + } if (this._animationConfig !== null) { this._animationConfig.returnToPool(); } this.timeScale = 1.0; - this._lockUpdate = false; this._animationDirty = false; this._inheritTimeScale = 1.0; this._animationNames.length = 0; @@ -7756,8 +7668,7 @@ var dragonBones; animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); } break; - case 0 /* None */: - case 5 /* Single */: + case 5 /* Single */: // TODO default: break; } @@ -7788,6 +7699,12 @@ var dragonBones; if (this._inheritTimeScale !== 1.0) { passedTime *= this._inheritTimeScale; } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].reset(); + } + } var animationStateCount = this._animationStates.length; if (animationStateCount === 1) { var animationState = this._animationStates[0]; @@ -7797,7 +7714,7 @@ var dragonBones; this._lastAnimationState = null; } else { - var animationData = animationState._animationData; + var animationData = animationState.animationData; var cacheFrameRate = animationData.cacheFrameRate; if (this._animationDirty && cacheFrameRate > 0.0) { this._animationDirty = false; @@ -7807,14 +7724,12 @@ var dragonBones; } for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { var slot = _c[_b]; - var rawDisplayDatas = slot.rawDisplayDatas; - if (rawDisplayDatas !== null && rawDisplayDatas.length > 0) { - var rawDsplayData = rawDisplayDatas[0]; - if (rawDsplayData !== null) { - if (rawDsplayData.parent === this._armature.armatureData.defaultSkin) { - slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); - continue; - } + if (slot.displayFrameCount > 0) { + var rawDisplayData = slot.getDisplayFrameAt(0).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.parent === this._armature.armatureData.defaultSkin) { + slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); + continue; } } slot._cachedFrameIndices = null; @@ -7934,7 +7849,9 @@ var dragonBones; if (animationConfig.fadeOutMode === 5 /* Single */) { for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { var animationState_1 = _a[_i]; - if (animationState_1._animationData === animationData) { + if (animationState_1._fadeState < 1 && + animationState_1.layer === animationConfig.layer && + animationState_1.animationData === animationData) { return animationState_1; } } @@ -7951,7 +7868,7 @@ var dragonBones; if (animationConfig.timeScale <= -100.0) { animationConfig.timeScale = 1.0 / animationData.scale; } - if (animationData.frameCount > 1) { + if (animationData.frameCount > 0) { if (animationConfig.position < 0.0) { animationConfig.position %= animationData.duration; animationConfig.position = animationData.duration - animationConfig.position; @@ -7980,6 +7897,7 @@ var dragonBones; animationConfig.duration = -1.0; } this._fadeOut(animationConfig); + // var animationState = dragonBones.BaseObject.borrowObject(dragonBones.AnimationState); animationState.init(this._armature, animationData, animationConfig); this._animationDirty = true; @@ -8005,7 +7923,6 @@ var dragonBones; else { this._animationStates.push(animationState); } - // Child armature play same name animation. for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { var slot = _c[_b]; var childArmature = slot.childArmature; @@ -8015,28 +7932,28 @@ var dragonBones; childArmature.animation.fadeIn(animationName); // } } - var isLocked = false; for (var k in animationData.animationTimelines) { - if (!this._lockUpdate) { - isLocked = true; - this._lockUpdate = true; - } - var childAnimatiionState = this.fadeIn(k, animationConfig.fadeInTime, 1, animationState.layer, null, 0 /* None */); - if (childAnimatiionState !== null) { - childAnimatiionState.resetToPose = false; - childAnimatiionState._parent = animationState; - childAnimatiionState.stop(); + var childAnimationState = this.fadeIn(k, 0.0, 1, animationState.layer, "", 5 /* Single */); + if (childAnimationState === null) { + continue; } - } - if (isLocked) { - this._lockUpdate = false; - } - if (!this._lockUpdate) { - if (animationConfig.fadeInTime <= 0.0) { - this._armature.advanceTime(0.0); + var timelines = animationData.animationTimelines[k]; + childAnimationState.actionEnabled = false; + childAnimationState.resetToPose = false; + childAnimationState.stop(); + animationState.addState(childAnimationState, timelines); + // + var index = this._animationStates.indexOf(animationState); + var childIndex = this._animationStates.indexOf(childAnimationState); + if (childIndex < index) { + this._animationStates.splice(index, 1); + this._animationStates.splice(childIndex, 0, animationState); } - this._lastAnimationState = animationState; } + // if (!this._armature._lockUpdate && animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. + // this._armature.advanceTime(0.0); + // } + this._lastAnimationState = animationState; return animationState; }; /** @@ -8196,7 +8113,7 @@ var dragonBones; this._animationConfig.animation = animationName; var animationData = animationName in this._animations ? this._animations[animationName] : null; if (animationData !== null) { - this._animationConfig.position = animationData.duration * frame / animationData.frameCount; + this._animationConfig.position = animationData.frameCount > 0 ? animationData.duration * frame / animationData.frameCount : 0.0; } return this.playConfig(this._animationConfig); }; @@ -8304,9 +8221,24 @@ var dragonBones; } return animationState; }; + /** + * @internal + */ + Animation.prototype.getBlendState = function (type, name, target) { + if (!(type in this._blendStates)) { + this._blendStates[type] = {}; + } + var blendStates = this._blendStates[type]; + if (!(name in blendStates)) { + var blendState = blendStates[name] = dragonBones.BaseObject.borrowObject(dragonBones.BlendState); + blendState.target = target; + } + return blendStates[name]; + }; /** * - Get a specific animation state. * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) * @example *
          *     armature.animation.play("walk");
@@ -8317,8 +8249,9 @@ var dragonBones;
          * @language en_US
          */
         /**
-         * - 获取指定的动画状态
+         * - 获取指定的动画状态。
          * @param animationName - 动画状态名称。
+         * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1)
          * @example
          * 
          *     armature.animation.play("walk");
@@ -8328,11 +8261,12 @@ var dragonBones;
          * @version DragonBones 3.0
          * @language zh_CN
          */
-        Animation.prototype.getState = function (animationName) {
+        Animation.prototype.getState = function (animationName, layer) {
+            if (layer === void 0) { layer = -1; }
             var i = this._animationStates.length;
             while (i--) {
                 var animationState = this._animationStates[i];
-                if (animationState.name === animationName) {
+                if (animationState.name === animationName && (layer < 0 || animationState.layer === layer)) {
                     return animationState;
                 }
             }
@@ -8523,99 +8457,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link #play()} {@link #fadeIn()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #play()} {@link #fadeIn()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Animation.prototype.gotoAndPlay = function (animationName, fadeInTime, duration, playTimes, layer, group, fadeOutMode, pauseFadeOut, pauseFadeIn) {
-            if (fadeInTime === void 0) { fadeInTime = -1; }
-            if (duration === void 0) { duration = -1; }
-            if (playTimes === void 0) { playTimes = -1; }
-            if (layer === void 0) { layer = 0; }
-            if (group === void 0) { group = null; }
-            if (fadeOutMode === void 0) { fadeOutMode = 3 /* SameLayerAndGroup */; }
-            if (pauseFadeOut === void 0) { pauseFadeOut = true; }
-            if (pauseFadeIn === void 0) { pauseFadeIn = true; }
-            console.warn("Deprecated.");
-            // tslint:disable-next-line:no-unused-expression
-            pauseFadeOut;
-            // tslint:disable-next-line:no-unused-expression
-            pauseFadeIn;
-            this._animationConfig.clear();
-            this._animationConfig.resetToPose = true;
-            this._animationConfig.fadeOutMode = fadeOutMode;
-            this._animationConfig.playTimes = playTimes;
-            this._animationConfig.layer = layer;
-            this._animationConfig.fadeInTime = fadeInTime;
-            this._animationConfig.animation = animationName;
-            this._animationConfig.group = group !== null ? group : "";
-            var animationData = this._animations[animationName];
-            if (animationData && duration > 0.0) {
-                this._animationConfig.timeScale = animationData.duration / duration;
-            }
-            return this.playConfig(this._animationConfig);
-        };
-        /**
-         * - Deprecated, please refer to {@link #gotoAndStopByTime()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #gotoAndStopByTime()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Animation.prototype.gotoAndStop = function (animationName, time) {
-            if (time === void 0) { time = 0; }
-            console.warn("Deprecated.");
-            return this.gotoAndStopByTime(animationName, time);
-        };
-        Object.defineProperty(Animation.prototype, "animationList", {
-            /**
-             * - Deprecated, please refer to {@link #animationNames}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #animationNames}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                return this._animationNames;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Animation.prototype, "animationDataList", {
-            /**
-             * - Deprecated, please refer to {@link #animationNames}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #animationNames}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                var list = [];
-                for (var i = 0, l = this._animationNames.length; i < l; ++i) {
-                    list.push(this._animations[this._animationNames[i]]);
-                }
-                return list;
-            },
-            enumerable: true,
-            configurable: true
-        });
         return Animation;
     }(dragonBones.BaseObject));
     dragonBones.Animation = Animation;
@@ -8662,27 +8503,19 @@ var dragonBones;
         __extends(AnimationState, _super);
         function AnimationState() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            /**
-             * @internal
-             */
-            _this._blendState = new BlendState();
             _this._boneMask = [];
             _this._boneTimelines = [];
-            _this._surfaceTimelines = [];
+            _this._boneBlendTimelines = [];
             _this._slotTimelines = [];
+            _this._slotBlendTimelines = [];
             _this._constraintTimelines = [];
             _this._animationTimelines = [];
             _this._poseTimelines = [];
-            _this._bonePoses = {};
             /**
              * @internal
              */
             _this._actionTimeline = null; // Initial value.
             _this._zOrderTimeline = null; // Initial value.
-            /**
-             * @internal
-             */
-            _this._parent = null; // Initial value.
             return _this;
         }
         AnimationState.toString = function () {
@@ -8693,7 +8526,7 @@ var dragonBones;
                 var timeline = _a[_i];
                 timeline.returnToPool();
             }
-            for (var _b = 0, _c = this._surfaceTimelines; _b < _c.length; _b++) {
+            for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
                 var timeline = _c[_b];
                 timeline.returnToPool();
             }
@@ -8701,18 +8534,24 @@ var dragonBones;
                 var timeline = _e[_d];
                 timeline.returnToPool();
             }
-            for (var _f = 0, _g = this._constraintTimelines; _f < _g.length; _f++) {
+            for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) {
                 var timeline = _g[_f];
                 timeline.returnToPool();
             }
-            for (var _h = 0, _j = this._animationTimelines; _h < _j.length; _h++) {
+            for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) {
                 var timeline = _j[_h];
                 timeline.returnToPool();
             }
-            for (var k in this._bonePoses) {
-                this._bonePoses[k].returnToPool();
-                delete this._bonePoses[k];
-            }
+            for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) {
+                var timeline = _l[_k];
+                var animationState = timeline.target;
+                if (animationState._parent === this) {
+                    animationState._fadeState = 1;
+                    animationState._subFadeState = 1;
+                    animationState._parent = null;
+                }
+                timeline.returnToPool();
+            }
             if (this._actionTimeline !== null) {
                 this._actionTimeline.returnToPool();
             }
@@ -8720,13 +8559,18 @@ var dragonBones;
                 this._zOrderTimeline.returnToPool();
             }
             this.actionEnabled = false;
-            this.additiveBlending = false;
+            this.additive = false;
             this.displayControl = false;
             this.resetToPose = false;
+            this.blendType = 0 /* None */;
             this.playTimes = 1;
             this.layer = 0;
             this.timeScale = 1.0;
-            this.weight = 1.0;
+            this._weight = 1.0;
+            this.parameterX = 0.0;
+            this.parameterY = 0.0;
+            this.positionX = 0.0;
+            this.positionY = 0.0;
             this.autoFadeOutTime = 0.0;
             this.fadeTotalTime = 0.0;
             this.name = "";
@@ -8741,11 +8585,11 @@ var dragonBones;
             this._time = 0.0;
             this._fadeProgress = 0.0;
             this._weightResult = 0.0;
-            this._blendState.clear();
             this._boneMask.length = 0;
             this._boneTimelines.length = 0;
-            this._surfaceTimelines.length = 0;
+            this._boneBlendTimelines.length = 0;
             this._slotTimelines.length = 0;
+            this._slotBlendTimelines.length = 0;
             this._constraintTimelines.length = 0;
             this._animationTimelines.length = 0;
             this._poseTimelines.length = 0;
@@ -8754,7 +8598,9 @@ var dragonBones;
             this._armature = null; //
             this._actionTimeline = null; //
             this._zOrderTimeline = null;
-            this._parent = null; //
+            this._activeChildA = null;
+            this._activeChildB = null;
+            this._parent = null;
         };
         AnimationState.prototype._updateTimelines = function () {
             {
@@ -8767,7 +8613,7 @@ var dragonBones;
                             switch (timelineData.type) {
                                 case 30 /* IKConstraint */: {
                                     var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState);
-                                    timeline.constraint = constraint;
+                                    timeline.target = constraint;
                                     timeline.init(this._armature, this, timelineData);
                                     this._constraintTimelines.push(timeline);
                                     break;
@@ -8779,53 +8625,37 @@ var dragonBones;
                     }
                     else if (this.resetToPose) {
                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState);
-                        timeline.constraint = constraint;
+                        timeline.target = constraint;
                         timeline.init(this._armature, this, null);
                         this._constraintTimelines.push(timeline);
                         this._poseTimelines.push(timeline);
                     }
                 }
             }
-            {
-                for (var _c = 0, _d = this._armature.animation.getStates(); _c < _d.length; _c++) {
-                    var animationState = _d[_c];
-                    if (animationState._parent !== this) {
-                        continue;
-                    }
-                    var timelineDatas = this._animationData.getAnimationTimelines(animationState.name);
-                    if (timelineDatas === null) {
-                        continue;
-                    }
-                    for (var _e = 0, timelineDatas_2 = timelineDatas; _e < timelineDatas_2.length; _e++) {
-                        var timelineData = timelineDatas_2[_e];
-                        switch (timelineData.type) {
-                            case 40 /* AnimationTime */: {
-                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineState);
-                                timeline.animationState = animationState;
-                                timeline.init(this._armature, this, timelineData);
-                                this._animationTimelines.push(timeline);
-                                break;
-                            }
-                            default:
-                                break;
-                        }
-                    }
-                }
-            }
         };
         AnimationState.prototype._updateBoneAndSlotTimelines = function () {
             {
                 var boneTimelines = {};
+                // Create bone timelines map.
                 for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) {
                     var timeline = _a[_i];
-                    var timelineName = timeline.bone.name;
+                    var timelineName = timeline.target.target.name;
                     if (!(timelineName in boneTimelines)) {
                         boneTimelines[timelineName] = [];
                     }
                     boneTimelines[timelineName].push(timeline);
                 }
-                for (var _b = 0, _c = this._armature.getBones(); _b < _c.length; _b++) {
-                    var bone = _c[_b];
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
+                    var timelineName = timeline.target.target.name;
+                    if (!(timelineName in boneTimelines)) {
+                        boneTimelines[timelineName] = [];
+                    }
+                    boneTimelines[timelineName].push(timeline);
+                }
+                //
+                for (var _d = 0, _e = this._armature.getBones(); _d < _e.length; _d++) {
+                    var bone = _e[_d];
                     var timelineName = bone.name;
                     if (!this.containsBoneMask(timelineName)) {
                         continue;
@@ -8833,70 +8663,53 @@ var dragonBones;
                     if (timelineName in boneTimelines) {
                         delete boneTimelines[timelineName];
                     }
-                    else if (bone._boneData.type === 0 /* Bone */) {
+                    else {
                         var timelineDatas = this._animationData.getBoneTimelines(timelineName);
-                        var bonePose = timelineName in this._bonePoses ? this._bonePoses[timelineName] : (this._bonePoses[timelineName] = dragonBones.BaseObject.borrowObject(BonePose));
+                        var blendState = this._armature.animation.getBlendState(BlendState.BONE_TRANSFORM, bone.name, bone);
                         if (timelineDatas !== null) {
-                            for (var _d = 0, timelineDatas_3 = timelineDatas; _d < timelineDatas_3.length; _d++) {
-                                var timelineData = timelineDatas_3[_d];
+                            for (var _f = 0, timelineDatas_2 = timelineDatas; _f < timelineDatas_2.length; _f++) {
+                                var timelineData = timelineDatas_2[_f];
                                 switch (timelineData.type) {
                                     case 10 /* BoneAll */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 11 /* BoneTranslate */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneTranslateTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 12 /* BoneRotate */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneRotateTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 13 /* BoneScale */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneScaleTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
-                                    default:
+                                    case 60 /* BoneAlpha */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.BONE_ALPHA, bone.name, bone);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._boneBlendTimelines.push(timeline);
                                         break;
-                                }
-                            }
-                        }
-                        else if (this.resetToPose) {
-                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
-                            timeline.bone = bone;
-                            timeline.bonePose = bonePose;
-                            timeline.init(this._armature, this, null);
-                            this._boneTimelines.push(timeline);
-                            this._poseTimelines.push(timeline);
-                        }
-                    }
-                    else if (bone._boneData.type === 1 /* Surface */) {
-                        var timelineDatas = this._animationData.getSurfaceTimelines(timelineName);
-                        if (timelineDatas !== null) {
-                            for (var _e = 0, timelineDatas_4 = timelineDatas; _e < timelineDatas_4.length; _e++) {
-                                var timelineData = timelineDatas_4[_e];
-                                switch (timelineData.type) {
+                                    }
                                     case 50 /* Surface */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
-                                        timeline.surface = bone;
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone);
                                         timeline.init(this._armature, this, timelineData);
-                                        this._surfaceTimelines.push(timeline);
+                                        this._boneBlendTimelines.push(timeline);
                                         break;
                                     }
                                     default:
@@ -8905,41 +8718,67 @@ var dragonBones;
                             }
                         }
                         else if (this.resetToPose) {
-                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
-                            timeline.surface = bone;
-                            timeline.init(this._armature, this, null);
-                            this._surfaceTimelines.push(timeline);
-                            this._poseTimelines.push(timeline);
+                            if (bone._boneData.type === 0 /* Bone */) {
+                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
+                                timeline.target = blendState;
+                                timeline.init(this._armature, this, null);
+                                this._boneTimelines.push(timeline);
+                                this._poseTimelines.push(timeline);
+                            }
+                            else {
+                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
+                                timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone);
+                                timeline.init(this._armature, this, null);
+                                this._boneBlendTimelines.push(timeline);
+                                this._poseTimelines.push(timeline);
+                            }
                         }
                     }
                 }
                 for (var k in boneTimelines) {
-                    for (var _f = 0, _g = boneTimelines[k]; _f < _g.length; _f++) {
-                        var timeline = _g[_f];
-                        this._boneTimelines.splice(this._boneTimelines.indexOf(timeline), 1);
-                        timeline.returnToPool();
+                    for (var _g = 0, _h = boneTimelines[k]; _g < _h.length; _g++) {
+                        var timeline = _h[_g];
+                        var index = this._boneTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._boneTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
+                        index = this._boneBlendTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._boneBlendTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
                     }
                 }
             }
             {
                 var slotTimelines = {};
                 var ffdFlags = [];
-                for (var _h = 0, _j = this._slotTimelines; _h < _j.length; _h++) {
-                    var timeline = _j[_h];
-                    var timelineName = timeline.slot.name;
+                // Create slot timelines map.
+                for (var _j = 0, _k = this._slotTimelines; _j < _k.length; _j++) {
+                    var timeline = _k[_j];
+                    var timelineName = timeline.target.name;
+                    if (!(timelineName in slotTimelines)) {
+                        slotTimelines[timelineName] = [];
+                    }
+                    slotTimelines[timelineName].push(timeline);
+                }
+                for (var _l = 0, _m = this._slotBlendTimelines; _l < _m.length; _l++) {
+                    var timeline = _m[_l];
+                    var timelineName = timeline.target.target.name;
                     if (!(timelineName in slotTimelines)) {
                         slotTimelines[timelineName] = [];
                     }
                     slotTimelines[timelineName].push(timeline);
                 }
-                for (var _k = 0, _l = this._armature.getSlots(); _k < _l.length; _k++) {
-                    var slot = _l[_k];
+                //
+                for (var _o = 0, _p = this._armature.getSlots(); _o < _p.length; _o++) {
+                    var slot = _p[_o];
                     var boneName = slot.parent.name;
                     if (!this.containsBoneMask(boneName)) {
                         continue;
                     }
                     var timelineName = slot.name;
-                    var timelineDatas = this._animationData.getSlotTimelines(timelineName);
                     if (timelineName in slotTimelines) {
                         delete slotTimelines[timelineName];
                     }
@@ -8947,21 +8786,29 @@ var dragonBones;
                         var displayIndexFlag = false;
                         var colorFlag = false;
                         ffdFlags.length = 0;
+                        var timelineDatas = this._animationData.getSlotTimelines(timelineName);
                         if (timelineDatas !== null) {
-                            for (var _m = 0, timelineDatas_5 = timelineDatas; _m < timelineDatas_5.length; _m++) {
-                                var timelineData = timelineDatas_5[_m];
+                            for (var _q = 0, timelineDatas_3 = timelineDatas; _q < timelineDatas_3.length; _q++) {
+                                var timelineData = timelineDatas_3[_q];
                                 switch (timelineData.type) {
                                     case 20 /* SlotDisplay */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDislayTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = slot;
                                         timeline.init(this._armature, this, timelineData);
                                         this._slotTimelines.push(timeline);
                                         displayIndexFlag = true;
                                         break;
                                     }
+                                    case 23 /* SlotZIndex */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotZIndexTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_Z_INDEX, slot.name, slot);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._slotBlendTimelines.push(timeline);
+                                        break;
+                                    }
                                     case 21 /* SlotColor */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = slot;
                                         timeline.init(this._armature, this, timelineData);
                                         this._slotTimelines.push(timeline);
                                         colorFlag = true;
@@ -8969,10 +8816,22 @@ var dragonBones;
                                     }
                                     case 22 /* SlotDeform */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot);
                                         timeline.init(this._armature, this, timelineData);
-                                        this._slotTimelines.push(timeline);
-                                        ffdFlags.push(timeline.vertexOffset);
+                                        if (timeline.target !== null) {
+                                            this._slotBlendTimelines.push(timeline);
+                                            ffdFlags.push(timeline.geometryOffset);
+                                        }
+                                        else {
+                                            timeline.returnToPool();
+                                        }
+                                        break;
+                                    }
+                                    case 24 /* SlotAlpha */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_ALPHA, slot.name, slot);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._slotBlendTimelines.push(timeline);
                                         break;
                                     }
                                     default:
@@ -8983,42 +8842,50 @@ var dragonBones;
                         if (this.resetToPose) {
                             if (!displayIndexFlag) {
                                 var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDislayTimelineState);
-                                timeline.slot = slot;
+                                timeline.target = slot;
                                 timeline.init(this._armature, this, null);
                                 this._slotTimelines.push(timeline);
                                 this._poseTimelines.push(timeline);
                             }
                             if (!colorFlag) {
                                 var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState);
-                                timeline.slot = slot;
+                                timeline.target = slot;
                                 timeline.init(this._armature, this, null);
                                 this._slotTimelines.push(timeline);
                                 this._poseTimelines.push(timeline);
                             }
-                            if (slot.rawDisplayDatas !== null) {
-                                for (var _o = 0, _p = slot.rawDisplayDatas; _o < _p.length; _o++) {
-                                    var displayData = _p[_o];
-                                    if (displayData !== null && displayData.type === 2 /* Mesh */) {
-                                        var meshOffset = displayData.vertices.offset;
-                                        if (ffdFlags.indexOf(meshOffset) < 0) {
-                                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
-                                            timeline.vertexOffset = meshOffset; //
-                                            timeline.slot = slot;
-                                            timeline.init(this._armature, this, null);
-                                            this._slotTimelines.push(timeline);
-                                            this._poseTimelines.push(timeline);
-                                        }
-                                    }
+                            for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                                var displayFrame = slot.getDisplayFrameAt(i);
+                                if (displayFrame.deformVertices.length === 0) {
+                                    continue;
+                                }
+                                var geometryData = displayFrame.getGeometryData();
+                                if (geometryData !== null && ffdFlags.indexOf(geometryData.offset) < 0) {
+                                    var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
+                                    timeline.geometryOffset = geometryData.offset; //
+                                    timeline.displayFrame = displayFrame; //
+                                    timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot);
+                                    timeline.init(this._armature, this, null);
+                                    this._slotBlendTimelines.push(timeline);
+                                    this._poseTimelines.push(timeline);
                                 }
                             }
                         }
                     }
                 }
                 for (var k in slotTimelines) {
-                    for (var _q = 0, _r = slotTimelines[k]; _q < _r.length; _q++) {
-                        var timeline = _r[_q];
-                        this._slotTimelines.splice(this._slotTimelines.indexOf(timeline), 1);
-                        timeline.returnToPool();
+                    for (var _r = 0, _s = slotTimelines[k]; _r < _s.length; _r++) {
+                        var timeline = _s[_r];
+                        var index = this._slotTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._slotTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
+                        index = this._slotBlendTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._slotBlendTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
                     }
                 }
             }
@@ -9027,13 +8894,16 @@ var dragonBones;
             var isFadeOut = this._fadeState > 0;
             if (this._subFadeState < 0) {
                 this._subFadeState = 0;
-                var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN;
-                if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
-                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                    eventObject.type = eventType;
-                    eventObject.armature = this._armature;
-                    eventObject.animationState = this;
-                    this._armature._dragonBones.bufferEvent(eventObject);
+                var eventActive = this._parent === null && this.actionEnabled;
+                if (eventActive) {
+                    var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN;
+                    if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
+                        var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                        eventObject.type = eventType;
+                        eventObject.armature = this._armature;
+                        eventObject.animationState = this;
+                        this._armature._dragonBones.bufferEvent(eventObject);
+                    }
                 }
             }
             if (passedTime < 0.0) {
@@ -9055,13 +8925,16 @@ var dragonBones;
                     this._playheadState |= 1; // x1
                     this._fadeState = 0;
                 }
-                var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE;
-                if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
-                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                    eventObject.type = eventType;
-                    eventObject.armature = this._armature;
-                    eventObject.animationState = this;
-                    this._armature._dragonBones.bufferEvent(eventObject);
+                var eventActive = this._parent === null && this.actionEnabled;
+                if (eventActive) {
+                    var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE;
+                    if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
+                        var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                        eventObject.type = eventType;
+                        eventObject.armature = this._armature;
+                        eventObject.animationState = this;
+                        this._armature._dragonBones.bufferEvent(eventObject);
+                    }
                 }
             }
         };
@@ -9076,17 +8949,19 @@ var dragonBones;
             this._animationData = animationData;
             //
             this.resetToPose = animationConfig.resetToPose;
-            this.additiveBlending = animationConfig.additiveBlending;
+            this.additive = animationConfig.additive;
             this.displayControl = animationConfig.displayControl;
             this.actionEnabled = animationConfig.actionEnabled;
+            this.blendType = animationData.blendType;
             this.layer = animationConfig.layer;
             this.playTimes = animationConfig.playTimes;
             this.timeScale = animationConfig.timeScale;
             this.fadeTotalTime = animationConfig.fadeInTime;
             this.autoFadeOutTime = animationConfig.autoFadeOutTime;
-            this.weight = animationConfig.weight;
             this.name = animationConfig.name.length > 0 ? animationConfig.name : animationConfig.animation;
             this.group = animationConfig.group;
+            //
+            this._weight = animationConfig.weight;
             if (animationConfig.pauseFadeIn) {
                 this._playheadState = 2; // 10
             }
@@ -9140,7 +9015,6 @@ var dragonBones;
          * @internal
          */
         AnimationState.prototype.advanceTime = function (passedTime, cacheFrameRate) {
-            this._blendState.dirty = false;
             // Update fade time.
             if (this._fadeState !== 0 || this._subFadeState !== 0) {
                 this._advanceFadeTime(passedTime);
@@ -9160,19 +9034,20 @@ var dragonBones;
                 this._timelineDirty = 0;
                 this._updateBoneAndSlotTimelines();
             }
-            if (this.weight === 0.0) {
-                return;
-            }
+            var isBlendDirty = this._fadeState !== 0 || this._subFadeState === 0;
             var isCacheEnabled = this._fadeState === 0 && cacheFrameRate > 0.0;
             var isUpdateTimeline = true;
             var isUpdateBoneTimeline = true;
             var time = this._time;
-            this._weightResult = this.weight * this._fadeProgress;
+            this._weightResult = this._weight * this._fadeProgress;
             if (this._parent !== null) {
-                this._weightResult *= this._parent._weightResult / this._parent._fadeProgress;
+                this._weightResult *= this._parent._weightResult;
             }
             if (this._actionTimeline.playState <= 0) {
-                this._actionTimeline.update(time); // Update main timeline.
+                this._actionTimeline.update(time);
+            }
+            if (this._weight === 0.0) {
+                return;
             }
             if (isCacheEnabled) {
                 var internval = cacheFrameRate * 2.0;
@@ -9198,57 +9073,117 @@ var dragonBones;
                 }
             }
             if (isUpdateTimeline) {
+                var isBlend = false;
+                var prevTarget = null; //
                 if (isUpdateBoneTimeline) {
                     for (var i = 0, l = this._boneTimelines.length; i < l; ++i) {
                         var timeline = this._boneTimelines[i];
                         if (timeline.playState <= 0) {
                             timeline.update(time);
                         }
-                        if (i === l - 1 || timeline.bone !== this._boneTimelines[i + 1].bone) {
-                            var state = timeline.bone._blendState.update(this._weightResult, this.layer);
-                            if (state !== 0) {
-                                timeline.blend(state);
+                        if (timeline.target !== prevTarget) {
+                            var blendState = timeline.target;
+                            isBlend = blendState.update(this);
+                            prevTarget = blendState;
+                            if (blendState.dirty === 1) {
+                                var pose = blendState.target.animationPose;
+                                pose.x = 0.0;
+                                pose.y = 0.0;
+                                pose.rotation = 0.0;
+                                pose.skew = 0.0;
+                                pose.scaleX = 1.0;
+                                pose.scaleY = 1.0;
                             }
                         }
+                        if (isBlend) {
+                            timeline.blend(isBlendDirty);
+                        }
                     }
                 }
-                for (var i = 0, l = this._surfaceTimelines.length; i < l; ++i) {
-                    var timeline = this._surfaceTimelines[i];
-                    var state = timeline.surface._blendState.update(this._weightResult, this.layer);
+                for (var i = 0, l = this._boneBlendTimelines.length; i < l; ++i) {
+                    var timeline = this._boneBlendTimelines[i];
                     if (timeline.playState <= 0) {
                         timeline.update(time);
                     }
-                    if (state !== 0) {
-                        timeline.blend(state);
+                    if (timeline.target.update(this)) {
+                        timeline.blend(isBlendDirty);
                     }
                 }
                 if (this.displayControl) {
                     for (var i = 0, l = this._slotTimelines.length; i < l; ++i) {
                         var timeline = this._slotTimelines[i];
-                        var displayController = timeline.slot.displayController;
-                        if (displayController === null ||
-                            displayController === this.name ||
-                            displayController === this.group) {
-                            if (timeline.playState <= 0) {
+                        if (timeline.playState <= 0) {
+                            var slot = timeline.target;
+                            var displayController = slot.displayController;
+                            if (displayController === null ||
+                                displayController === this.name ||
+                                displayController === this.group) {
                                 timeline.update(time);
                             }
                         }
                     }
                 }
-                for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) {
-                    var timeline = this._constraintTimelines[i];
+                for (var i = 0, l = this._slotBlendTimelines.length; i < l; ++i) {
+                    var timeline = this._slotBlendTimelines[i];
                     if (timeline.playState <= 0) {
+                        var blendState = timeline.target;
                         timeline.update(time);
+                        if (blendState.update(this)) {
+                            timeline.blend(isBlendDirty);
+                        }
                     }
                 }
-                for (var i = 0, l = this._animationTimelines.length; i < l; ++i) {
-                    var timeline = this._animationTimelines[i];
-                    var state = timeline.animationState._blendState.update(this._weightResult, this.layer);
+                for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) {
+                    var timeline = this._constraintTimelines[i];
                     if (timeline.playState <= 0) {
                         timeline.update(time);
                     }
-                    if (state !== 0) {
-                        timeline.blend(state);
+                }
+                if (this._animationTimelines.length > 0) {
+                    var dL = 100.0;
+                    var dR = 100.0;
+                    var leftState = null;
+                    var rightState = null;
+                    for (var i = 0, l = this._animationTimelines.length; i < l; ++i) {
+                        var timeline = this._animationTimelines[i];
+                        if (timeline.playState <= 0) {
+                            timeline.update(time);
+                        }
+                        if (this.blendType === 1 /* E1D */) {
+                            var animationState = timeline.target;
+                            var d = this.parameterX - animationState.positionX;
+                            if (d >= 0.0) {
+                                if (d < dL) {
+                                    dL = d;
+                                    leftState = animationState;
+                                }
+                            }
+                            else {
+                                if (-d < dR) {
+                                    dR = -d;
+                                    rightState = animationState;
+                                }
+                            }
+                        }
+                    }
+                    if (leftState !== null) {
+                        if (this._activeChildA !== leftState) {
+                            if (this._activeChildA !== null) {
+                                this._activeChildA.weight = 0.0;
+                            }
+                            this._activeChildA = leftState;
+                            this._activeChildA.activeTimeline();
+                        }
+                        if (this._activeChildB !== rightState) {
+                            if (this._activeChildB !== null) {
+                                this._activeChildB.weight = 0.0;
+                            }
+                            this._activeChildB = rightState;
+                        }
+                        leftState.weight = dR / (dL + dR);
+                        if (rightState) {
+                            rightState.weight = 1.0 - leftState.weight;
+                        }
                     }
                 }
             }
@@ -9258,19 +9193,36 @@ var dragonBones;
                     if (this._poseTimelines.length > 0) {
                         for (var _i = 0, _a = this._poseTimelines; _i < _a.length; _i++) {
                             var timeline = _a[_i];
-                            if (timeline instanceof dragonBones.BoneTimelineState) {
-                                this._boneTimelines.splice(this._boneTimelines.indexOf(timeline), 1);
+                            var index = this._boneTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._boneTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.SurfaceTimelineState) {
-                                this._surfaceTimelines.splice(this._surfaceTimelines.indexOf(timeline), 1);
+                            index = this._boneBlendTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._boneBlendTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.SlotTimelineState) {
-                                this._slotTimelines.splice(this._slotTimelines.indexOf(timeline), 1);
+                            index = this._slotTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._slotTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.ConstraintTimelineState) {
-                                this._constraintTimelines.splice(this._constraintTimelines.indexOf(timeline), 1);
+                            index = this._slotBlendTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._slotBlendTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
+                            }
+                            index = this._constraintTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._constraintTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            timeline.returnToPool();
                         }
                         this._poseTimelines.length = 0;
                     }
@@ -9345,7 +9297,7 @@ var dragonBones;
                     var timeline = _a[_i];
                     timeline.fadeOut();
                 }
-                for (var _b = 0, _c = this._surfaceTimelines; _b < _c.length; _b++) {
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
                     var timeline = _c[_b];
                     timeline.fadeOut();
                 }
@@ -9353,15 +9305,21 @@ var dragonBones;
                     var timeline = _e[_d];
                     timeline.fadeOut();
                 }
-                for (var _f = 0, _g = this._constraintTimelines; _f < _g.length; _f++) {
+                for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) {
                     var timeline = _g[_f];
                     timeline.fadeOut();
                 }
-                for (var _h = 0, _j = this._animationTimelines; _h < _j.length; _h++) {
+                for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) {
                     var timeline = _j[_h];
-                    timeline.animationState.fadeOut(fadeOutTime, pausePlayhead);
                     timeline.fadeOut();
                 }
+                for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) {
+                    var timeline = _l[_k];
+                    timeline.fadeOut();
+                    //
+                    var animaitonState = timeline.target;
+                    animaitonState.fadeOut(999999.0, true);
+                }
             }
             this.displayControl = false; //
             this.fadeTotalTime = this._fadeProgress > 0.000001 ? fadeOutTime / this._fadeProgress : 0.0;
@@ -9442,9 +9400,9 @@ var dragonBones;
                     if (this._boneMask.length > 0) {
                         for (var _i = 0, bones_1 = bones; _i < bones_1.length; _i++) {
                             var bone = bones_1[_i];
-                            var index_2 = this._boneMask.indexOf(bone.name);
-                            if (index_2 >= 0 && currentBone.contains(bone)) {
-                                this._boneMask.splice(index_2, 1);
+                            var index_1 = this._boneMask.indexOf(bone.name);
+                            if (index_1 >= 0 && currentBone.contains(bone)) {
+                                this._boneMask.splice(index_1, 1);
                             }
                         }
                     }
@@ -9477,6 +9435,63 @@ var dragonBones;
             this._boneMask.length = 0;
             this._timelineDirty = 1;
         };
+        /**
+         * @private
+         */
+        AnimationState.prototype.addState = function (animationState, timelineDatas) {
+            if (timelineDatas === void 0) { timelineDatas = null; }
+            if (timelineDatas !== null) {
+                for (var _i = 0, timelineDatas_4 = timelineDatas; _i < timelineDatas_4.length; _i++) {
+                    var timelineData = timelineDatas_4[_i];
+                    switch (timelineData.type) {
+                        case 40 /* AnimationProgress */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationProgressTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            if (this.blendType !== 0 /* None */) {
+                                var animaitonTimelineData = timelineData;
+                                animationState.positionX = animaitonTimelineData.x;
+                                animationState.positionY = animaitonTimelineData.y;
+                                animationState.weight = 0.0;
+                            }
+                            animationState._parent = this;
+                            this.resetToPose = false;
+                            break;
+                        }
+                        case 41 /* AnimationWeight */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationWeightTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            break;
+                        }
+                        case 42 /* AnimationParameter */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationParametersTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            break;
+                        }
+                        default:
+                            break;
+                    }
+                }
+            }
+            if (animationState._parent === null) {
+                animationState._parent = this;
+            }
+        };
+        /**
+         * @internal
+         */
+        AnimationState.prototype.activeTimeline = function () {
+            for (var _i = 0, _a = this._slotTimelines; _i < _a.length; _i++) {
+                var timeline = _a[_i];
+                timeline.dirty = true;
+                timeline.currentTime = -1.0;
+            }
+        };
         Object.defineProperty(AnimationState.prototype, "isFadeIn", {
             /**
              * - Whether the animation state is fading in.
@@ -9618,8 +9633,9 @@ var dragonBones;
                         value += this._duration;
                     }
                 }
-                if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 && value === this._duration) {
-                    value = this._duration - 0.000001;
+                if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 &&
+                    value === this._duration && this._parent === null) {
+                    value = this._duration - 0.000001; // 
                 }
                 if (this._time === value) {
                     return;
@@ -9641,13 +9657,50 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(AnimationState.prototype, "animationData", {
+        Object.defineProperty(AnimationState.prototype, "weight", {
+            /**
+             * - The blend weight.
+             * @default 1.0
+             * @version DragonBones 5.0
+             * @language en_US
+             */
+            /**
+             * - 混合权重。
+             * @default 1.0
+             * @version DragonBones 5.0
+             * @language zh_CN
+             */
             /**
              * - The animation data.
              * @see dragonBones.AnimationData
              * @version DragonBones 3.0
              * @language en_US
              */
+            get: function () {
+                return this._weight;
+            },
+            set: function (value) {
+                if (this._weight === value) {
+                    return;
+                }
+                this._weight = value;
+                for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) {
+                    var timeline = _a[_i];
+                    timeline.dirty = true;
+                }
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
+                    timeline.dirty = true;
+                }
+                for (var _d = 0, _e = this._slotBlendTimelines; _d < _e.length; _d++) {
+                    var timeline = _e[_d];
+                    timeline.dirty = true;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(AnimationState.prototype, "animationData", {
             /**
              * - 动画数据。
              * @see dragonBones.AnimationData
@@ -9666,74 +9719,65 @@ var dragonBones;
     /**
      * @internal
      */
-    var BonePose = /** @class */ (function (_super) {
-        __extends(BonePose, _super);
-        function BonePose() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.current = new dragonBones.Transform();
-            _this.delta = new dragonBones.Transform();
-            _this.result = new dragonBones.Transform();
-            return _this;
+    var BlendState = /** @class */ (function (_super) {
+        __extends(BlendState, _super);
+        function BlendState() {
+            return _super !== null && _super.apply(this, arguments) || this;
         }
-        BonePose.toString = function () {
-            return "[class dragonBones.BonePose]";
+        BlendState.toString = function () {
+            return "[class dragonBones.BlendState]";
         };
-        BonePose.prototype._onClear = function () {
-            this.current.identity();
-            this.delta.identity();
-            this.result.identity();
+        BlendState.prototype._onClear = function () {
+            this.reset();
+            this.target = null;
         };
-        return BonePose;
-    }(dragonBones.BaseObject));
-    dragonBones.BonePose = BonePose;
-    /**
-     * @internal
-     */
-    var BlendState = /** @class */ (function () {
-        function BlendState() {
-        }
-        /**
-         * -1: First blending, 0: No blending, 1: Blending.
-         */
-        BlendState.prototype.update = function (weight, p_layer) {
-            if (this.dirty) {
+        BlendState.prototype.update = function (animationState) {
+            var animationLayer = animationState.layer;
+            var animationWeight = animationState._weightResult;
+            if (this.dirty > 0) {
                 if (this.leftWeight > 0.0) {
-                    if (this.layer !== p_layer) {
+                    if (this.layer !== animationLayer) {
                         if (this.layerWeight >= this.leftWeight) {
+                            this.dirty++;
+                            this.layer = animationLayer;
                             this.leftWeight = 0.0;
-                            return 0;
-                        }
-                        else {
-                            this.layer = p_layer;
-                            this.leftWeight -= this.layerWeight;
-                            this.layerWeight = 0.0;
+                            this.blendWeight = 0.0;
+                            return false;
                         }
+                        this.layer = animationLayer;
+                        this.leftWeight -= this.layerWeight;
+                        this.layerWeight = 0.0;
                     }
+                    animationWeight *= this.leftWeight;
+                    this.dirty++;
+                    this.blendWeight = animationWeight;
+                    this.layerWeight += this.blendWeight;
+                    return true;
                 }
-                else {
-                    return 0;
-                }
-                weight *= this.leftWeight;
-                this.layerWeight += weight;
-                this.blendWeight = weight;
-                return 2;
+                return false;
             }
-            this.dirty = true;
-            this.layer = p_layer;
-            this.layerWeight = weight;
+            this.dirty++;
+            this.layer = animationLayer;
             this.leftWeight = 1.0;
-            this.blendWeight = weight;
-            return 1;
+            this.blendWeight = animationWeight;
+            this.layerWeight = animationWeight;
+            return true;
         };
-        BlendState.prototype.clear = function () {
-            this.dirty = false;
+        BlendState.prototype.reset = function () {
+            this.dirty = 0;
             this.layer = 0;
             this.leftWeight = 0.0;
             this.layerWeight = 0.0;
             this.blendWeight = 0.0;
         };
+        BlendState.BONE_TRANSFORM = "boneTransform";
+        BlendState.BONE_ALPHA = "boneAlpha";
+        BlendState.SURFACE = "surface";
+        BlendState.SLOT_DEFORM = "slotDeform";
+        BlendState.SLOT_ALPHA = "slotAlpha";
+        BlendState.SLOT_Z_INDEX = "slotZIndex";
         return BlendState;
-    }());
+    }(dragonBones.BaseObject));
     dragonBones.BlendState = BlendState;
 })(dragonBones || (dragonBones = {}));
 /**
@@ -9769,29 +9813,30 @@ var dragonBones;
             return _super !== null && _super.apply(this, arguments) || this;
         }
         TimelineState.prototype._onClear = function () {
+            this.dirty = false;
             this.playState = -1;
             this.currentPlayTimes = -1;
             this.currentTime = -1.0;
-            this._tweenState = 0 /* None */;
-            this._frameRate = 0;
+            this.target = null;
+            this._isTween = false;
+            this._valueOffset = 0;
             this._frameValueOffset = 0;
-            this._frameCount = 0;
             this._frameOffset = 0;
+            this._frameRate = 0;
+            this._frameCount = 0;
             this._frameIndex = -1;
             this._frameRateR = 0.0;
             this._position = 0.0;
             this._duration = 0.0;
             this._timeScale = 1.0;
             this._timeOffset = 0.0;
-            this._dragonBonesData = null; //
             this._animationData = null; //
             this._timelineData = null; //
             this._armature = null; //
             this._animationState = null; //
             this._actionTimeline = null; //
             this._frameArray = null; //
-            this._frameIntArray = null; //
-            this._frameFloatArray = null; //
+            this._valueArray = null; //
             this._timelineArray = null; //
             this._frameIndices = null; //
         };
@@ -9862,25 +9907,27 @@ var dragonBones;
             if (this === this._actionTimeline) {
                 this._actionTimeline = null; //
             }
-            this._animationData = this._animationState._animationData;
+            this._animationData = this._animationState.animationData;
+            //
             this._frameRate = this._animationData.parent.frameRate;
             this._frameRateR = 1.0 / this._frameRate;
             this._position = this._animationState._position;
             this._duration = this._animationState._duration;
-            this._dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data.
             if (this._timelineData !== null) {
-                this._frameIntArray = this._dragonBonesData.frameIntArray;
-                this._frameFloatArray = this._dragonBonesData.frameFloatArray;
-                this._frameArray = this._dragonBonesData.frameArray;
-                this._timelineArray = this._dragonBonesData.timelineArray;
-                this._frameIndices = this._dragonBonesData.frameIndices;
+                var dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data.
+                this._frameArray = dragonBonesData.frameArray;
+                this._timelineArray = dragonBonesData.timelineArray;
+                this._frameIndices = dragonBonesData.frameIndices;
+                //
                 this._frameCount = this._timelineArray[this._timelineData.offset + 2 /* TimelineKeyFrameCount */];
                 this._frameValueOffset = this._timelineArray[this._timelineData.offset + 4 /* TimelineFrameValueOffset */];
                 this._timeScale = 100.0 / this._timelineArray[this._timelineData.offset + 0 /* TimelineScale */];
                 this._timeOffset = this._timelineArray[this._timelineData.offset + 1 /* TimelineOffset */] * 0.01;
             }
         };
-        TimelineState.prototype.fadeOut = function () { };
+        TimelineState.prototype.fadeOut = function () {
+            this.dirty = false;
+        };
         TimelineState.prototype.update = function (passedTime) {
             if (this._setCurrentTime(passedTime)) {
                 if (this._frameCount > 1) {
@@ -9899,11 +9946,13 @@ var dragonBones;
                     }
                     this._onArriveAtFrame();
                 }
-                if (this._tweenState !== 0 /* None */) {
+                if (this._isTween || this.dirty) {
                     this._onUpdateFrame();
                 }
             }
         };
+        TimelineState.prototype.blend = function (_isDirty) {
+        };
         return TimelineState;
     }(dragonBones.BaseObject));
     dragonBones.TimelineState = TimelineState;
@@ -9937,10 +9986,19 @@ var dragonBones;
             else if (progress >= 1.0) {
                 return 1.0;
             }
+            var isOmited = count > 0;
             var segmentCount = count + 1; // + 2 - 1
             var valueIndex = Math.floor(progress * segmentCount);
-            var fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1];
-            var toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex];
+            var fromValue = 0.0;
+            var toValue = 0.0;
+            if (isOmited) {
+                fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1];
+                toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex];
+            }
+            else {
+                fromValue = samples[offset + valueIndex - 1];
+                toValue = samples[offset + valueIndex];
+            }
             return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001;
         };
         TweenTimelineState.prototype._onClear = function () {
@@ -9949,21 +10007,27 @@ var dragonBones;
             this._curveCount = 0;
             this._framePosition = 0.0;
             this._frameDurationR = 0.0;
-            this._tweenProgress = 0.0;
             this._tweenEasing = 0.0;
+            this._tweenProgress = 0.0;
+            this._valueScale = 1.0;
         };
         TweenTimelineState.prototype._onArriveAtFrame = function () {
             if (this._frameCount > 1 &&
                 (this._frameIndex !== this._frameCount - 1 ||
                     this._animationState.playTimes === 0 ||
                     this._animationState.currentPlayTimes < this._animationState.playTimes - 1)) {
-                this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */]; // TODO recode ture tween type.
-                this._tweenState = this._tweenType === 0 /* None */ ? 1 /* Once */ : 2 /* Always */;
-                if (this._tweenType === 2 /* Curve */) {
-                    this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */];
+                this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */];
+                this._isTween = this._tweenType !== 0 /* None */;
+                if (this._isTween) {
+                    if (this._tweenType === 2 /* Curve */) {
+                        this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */];
+                    }
+                    else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) {
+                        this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01;
+                    }
                 }
-                else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) {
-                    this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01;
+                else {
+                    this.dirty = true;
                 }
                 this._framePosition = this._frameArray[this._frameOffset] * this._frameRateR;
                 if (this._frameIndex === this._frameCount - 1) {
@@ -9981,11 +10045,13 @@ var dragonBones;
                 }
             }
             else {
-                this._tweenState = 1 /* Once */;
+                this.dirty = true;
+                this._isTween = false;
             }
         };
         TweenTimelineState.prototype._onUpdateFrame = function () {
-            if (this._tweenState === 2 /* Always */) {
+            if (this._isTween) {
+                this.dirty = true;
                 this._tweenProgress = (this.currentTime - this._framePosition) * this._frameDurationR;
                 if (this._tweenType === 2 /* Curve */) {
                     this._tweenProgress = TweenTimelineState._getEasingCurveValue(this._tweenProgress, this._frameArray, this._curveCount, this._frameOffset + 3 /* FrameCurveSamples */);
@@ -9994,9 +10060,6 @@ var dragonBones;
                     this._tweenProgress = TweenTimelineState._getEasingValue(this._tweenType, this._tweenProgress, this._tweenEasing);
                 }
             }
-            else {
-                this._tweenProgress = 0.0;
-            }
         };
         return TweenTimelineState;
     }(TimelineState));
@@ -10004,89 +10067,204 @@ var dragonBones;
     /**
      * @internal
      */
-    var BoneTimelineState = /** @class */ (function (_super) {
-        __extends(BoneTimelineState, _super);
-        function BoneTimelineState() {
+    var SingleValueTimelineState = /** @class */ (function (_super) {
+        __extends(SingleValueTimelineState, _super);
+        function SingleValueTimelineState() {
             return _super !== null && _super.apply(this, arguments) || this;
         }
-        BoneTimelineState.prototype._onClear = function () {
+        SingleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.bone = null; //
-            this.bonePose = null; //
-        };
-        BoneTimelineState.prototype.blend = function (state) {
-            var blendWeight = this.bone._blendState.blendWeight;
-            var animationPose = this.bone.animationPose;
-            var result = this.bonePose.result;
-            if (state === 2) {
-                animationPose.x += result.x * blendWeight;
-                animationPose.y += result.y * blendWeight;
-                animationPose.rotation += result.rotation * blendWeight;
-                animationPose.skew += result.skew * blendWeight;
-                animationPose.scaleX += (result.scaleX - 1.0) * blendWeight;
-                animationPose.scaleY += (result.scaleY - 1.0) * blendWeight;
-            }
-            else if (blendWeight !== 1.0) {
-                animationPose.x = result.x * blendWeight;
-                animationPose.y = result.y * blendWeight;
-                animationPose.rotation = result.rotation * blendWeight;
-                animationPose.skew = result.skew * blendWeight;
-                animationPose.scaleX = (result.scaleX - 1.0) * blendWeight + 1.0;
-                animationPose.scaleY = (result.scaleY - 1.0) * blendWeight + 1.0;
+            this._current = 0.0;
+            this._difference = 0.0;
+            this._result = 0.0;
+        };
+        SingleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + 1;
+                    if (valueScale === 1.0) {
+                        this._current = valueArray[valueOffset];
+                        this._difference = valueArray[nextValueOffset] - this._current;
+                    }
+                    else {
+                        this._current = valueArray[valueOffset] * valueScale;
+                        this._difference = valueArray[nextValueOffset] * valueScale - this._current;
+                    }
+                }
+                else {
+                    this._result = valueArray[valueOffset] * valueScale;
+                }
             }
             else {
-                animationPose.x = result.x;
-                animationPose.y = result.y;
-                animationPose.rotation = result.rotation;
-                animationPose.skew = result.skew;
-                animationPose.scaleX = result.scaleX;
-                animationPose.scaleY = result.scaleY;
+                this._result = 0.0;
             }
-            if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                this.bone._transformDirty = true;
+        };
+        SingleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                this._result = this._current + this._difference * this._tweenProgress;
             }
         };
-        return BoneTimelineState;
+        return SingleValueTimelineState;
     }(TweenTimelineState));
-    dragonBones.BoneTimelineState = BoneTimelineState;
+    dragonBones.SingleValueTimelineState = SingleValueTimelineState;
     /**
      * @internal
      */
-    var SlotTimelineState = /** @class */ (function (_super) {
-        __extends(SlotTimelineState, _super);
-        function SlotTimelineState() {
+    var DoubleValueTimelineState = /** @class */ (function (_super) {
+        __extends(DoubleValueTimelineState, _super);
+        function DoubleValueTimelineState() {
             return _super !== null && _super.apply(this, arguments) || this;
         }
-        SlotTimelineState.prototype._onClear = function () {
+        DoubleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.slot = null; //
+            this._currentA = 0.0;
+            this._currentB = 0.0;
+            this._differenceA = 0.0;
+            this._differenceB = 0.0;
+            this._resultA = 0.0;
+            this._resultB = 0.0;
+        };
+        DoubleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * 2;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + 2;
+                    if (valueScale === 1.0) {
+                        this._currentA = valueArray[valueOffset];
+                        this._currentB = valueArray[valueOffset + 1];
+                        this._differenceA = valueArray[nextValueOffset] - this._currentA;
+                        this._differenceB = valueArray[nextValueOffset + 1] - this._currentB;
+                    }
+                    else {
+                        this._currentA = valueArray[valueOffset] * valueScale;
+                        this._currentB = valueArray[valueOffset + 1] * valueScale;
+                        this._differenceA = valueArray[nextValueOffset] * valueScale - this._currentA;
+                        this._differenceB = valueArray[nextValueOffset + 1] * valueScale - this._currentB;
+                    }
+                }
+                else {
+                    this._resultA = valueArray[valueOffset] * valueScale;
+                    this._resultB = valueArray[valueOffset + 1] * valueScale;
+                }
+            }
+            else {
+                this._resultA = 0.0;
+                this._resultB = 0.0;
+            }
         };
-        return SlotTimelineState;
+        DoubleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                this._resultA = this._currentA + this._differenceA * this._tweenProgress;
+                this._resultB = this._currentB + this._differenceB * this._tweenProgress;
+            }
+        };
+        return DoubleValueTimelineState;
     }(TweenTimelineState));
-    dragonBones.SlotTimelineState = SlotTimelineState;
+    dragonBones.DoubleValueTimelineState = DoubleValueTimelineState;
     /**
      * @internal
      */
-    var ConstraintTimelineState = /** @class */ (function (_super) {
-        __extends(ConstraintTimelineState, _super);
-        function ConstraintTimelineState() {
-            return _super !== null && _super.apply(this, arguments) || this;
+    var MutilpleValueTimelineState = /** @class */ (function (_super) {
+        __extends(MutilpleValueTimelineState, _super);
+        function MutilpleValueTimelineState() {
+            var _this = _super !== null && _super.apply(this, arguments) || this;
+            _this._rd = [];
+            return _this;
         }
-        ConstraintTimelineState.prototype._onClear = function () {
+        MutilpleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.constraint = null; //
+            this._valueCount = 0;
+            this._rd.length = 0;
         };
-        return ConstraintTimelineState;
-    }(TweenTimelineState));
-    dragonBones.ConstraintTimelineState = ConstraintTimelineState;
-})(dragonBones || (dragonBones = {}));
-/**
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2018 DragonBones team and other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
+        MutilpleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            var valueCount = this._valueCount;
+            var rd = this._rd;
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + valueCount;
+                    if (valueScale === 1.0) {
+                        for (var i = 0; i < valueCount; ++i) {
+                            rd[valueCount + i] = valueArray[nextValueOffset + i] - valueArray[valueOffset + i];
+                        }
+                    }
+                    else {
+                        for (var i = 0; i < valueCount; ++i) {
+                            rd[valueCount + i] = (valueArray[nextValueOffset + i] - valueArray[valueOffset + i]) * valueScale;
+                        }
+                    }
+                }
+                else if (valueScale === 1.0) {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i];
+                    }
+                }
+                else {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] * valueScale;
+                    }
+                }
+            }
+            else {
+                for (var i = 0; i < valueCount; ++i) {
+                    rd[i] = 0.0;
+                }
+            }
+        };
+        MutilpleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                var valueCount = this._valueCount;
+                var valueScale = this._valueScale;
+                var tweenProgress = this._tweenProgress;
+                var valueArray = this._valueArray;
+                var rd = this._rd;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount;
+                if (valueScale === 1.0) {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] + rd[valueCount + i] * tweenProgress;
+                    }
+                }
+                else {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] * valueScale + rd[valueCount + i] * tweenProgress;
+                    }
+                }
+            }
+        };
+        return MutilpleValueTimelineState;
+    }(TweenTimelineState));
+    dragonBones.MutilpleValueTimelineState = MutilpleValueTimelineState;
+})(dragonBones || (dragonBones = {}));
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
  * the Software without restriction, including without limitation the rights to
  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  * the Software, and to permit persons to whom the Software is furnished to do so,
@@ -10153,6 +10331,7 @@ var dragonBones;
             var prevPlayTimes = this.currentPlayTimes;
             var prevTime = this.currentTime;
             if (this._setCurrentTime(passedTime)) {
+                var eventActive = this._animationState._parent === null && this._animationState.actionEnabled;
                 var eventDispatcher = this._armature.eventDispatcher;
                 if (prevState < 0) {
                     if (this.playState !== prevState) {
@@ -10160,7 +10339,7 @@ var dragonBones;
                             this._armature._sortZOrder(null, 0);
                         }
                         prevPlayTimes = this.currentPlayTimes;
-                        if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) {
+                        if (eventActive && eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) {
                             var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
                             eventObject.type = dragonBones.EventObject.START;
                             eventObject.armature = this._armature;
@@ -10175,7 +10354,7 @@ var dragonBones;
                 var isReverse = this._animationState.timeScale < 0.0;
                 var loopCompleteEvent = null;
                 var completeEvent = null;
-                if (this.currentPlayTimes !== prevPlayTimes) {
+                if (eventActive && this.currentPlayTimes !== prevPlayTimes) {
                     if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.LOOP_COMPLETE)) {
                         loopCompleteEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
                         loopCompleteEvent.type = dragonBones.EventObject.LOOP_COMPLETE;
@@ -10265,7 +10444,8 @@ var dragonBones;
                                     // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem
                                     var framePosition = this._frameArray[frameOffset] / this._frameRate;
                                     if (this._position <= framePosition &&
-                                        framePosition <= this._position + this._duration) {
+                                        framePosition <= this._position + this._duration //
+                                    ) {
                                         this._onCrossFrame(crossedFrameIndex);
                                     }
                                     if (loopCompleteEvent !== null && crossedFrameIndex === 0) {
@@ -10354,78 +10534,57 @@ var dragonBones;
         };
         BoneAllTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 6; // ...(timeline value offset)|xxxxxx|xxxxxx|(Value offset)xxxxx|(Next offset)xxxxx|xxxxxx|xxxxxx|...
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = frameFloatArray[valueOffset++] * scale;
-                current.y = frameFloatArray[valueOffset++] * scale;
-                current.rotation = frameFloatArray[valueOffset++];
-                current.skew = frameFloatArray[valueOffset++];
-                current.scaleX = frameFloatArray[valueOffset++];
-                current.scaleY = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 6
-                    }
-                    delta.x = frameFloatArray[valueOffset++] * scale - current.x;
-                    delta.y = frameFloatArray[valueOffset++] * scale - current.y;
-                    delta.rotation = frameFloatArray[valueOffset++] - current.rotation;
-                    delta.skew = frameFloatArray[valueOffset++] - current.skew;
-                    delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX;
-                    delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY;
-                }
-                else {
-                    delta.x = 0.0;
-                    delta.y = 0.0;
-                    delta.rotation = 0.0;
-                    delta.skew = 0.0;
-                    delta.scaleX = 0.0;
-                    delta.scaleY = 0.0;
-                }
+            if (this._isTween && this._frameIndex === this._frameCount - 1) {
+                this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]);
+                this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]);
             }
-            else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = 0.0;
-                current.y = 0.0;
-                current.rotation = 0.0;
-                current.skew = 0.0;
-                current.scaleX = 1.0;
-                current.scaleY = 1.0;
-                delta.x = 0.0;
-                delta.y = 0.0;
-                delta.rotation = 0.0;
-                delta.skew = 0.0;
-                delta.scaleX = 0.0;
-                delta.scaleY = 0.0;
-            }
-        };
-        BoneAllTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            result.x = current.x + delta.x * this._tweenProgress;
-            result.y = current.y + delta.y * this._tweenProgress;
-            result.rotation = current.rotation + delta.rotation * this._tweenProgress;
-            result.skew = current.skew + delta.skew * this._tweenProgress;
-            result.scaleX = current.scaleX + delta.scaleX * this._tweenProgress;
-            result.scaleY = current.scaleY + delta.scaleY * this._tweenProgress;
+            if (this._timelineData === null) {
+                this._rd[4] = 1.0;
+                this._rd[5] = 1.0;
+            }
+        };
+        BoneAllTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueCount = 6;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
         };
         BoneAllTimelineState.prototype.fadeOut = function () {
-            var result = this.bonePose.result;
-            result.rotation = dragonBones.Transform.normalizeRadian(result.rotation);
-            result.skew = dragonBones.Transform.normalizeRadian(result.skew);
+            this.dirty = false;
+            this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]);
+            this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]);
+        };
+        BoneAllTimelineState.prototype.blend = function (isDirty) {
+            var valueScale = this._armature.armatureData.scale;
+            var rd = this._rd;
+            //
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.x += rd[0] * blendWeight * valueScale;
+                result.y += rd[1] * blendWeight * valueScale;
+                result.rotation += rd[2] * blendWeight;
+                result.skew += rd[3] * blendWeight;
+                result.scaleX += (rd[4] - 1.0) * blendWeight;
+                result.scaleY += (rd[5] - 1.0) * blendWeight;
+            }
+            else {
+                result.x = rd[0] * blendWeight * valueScale;
+                result.y = rd[1] * blendWeight * valueScale;
+                result.rotation = rd[2] * blendWeight;
+                result.skew = rd[3] * blendWeight;
+                result.scaleX = (rd[4] - 1.0) * blendWeight + 1.0; // 
+                result.scaleY = (rd[5] - 1.0) * blendWeight + 1.0; //
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         };
         return BoneAllTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.MutilpleValueTimelineState));
     dragonBones.BoneAllTimelineState = BoneAllTimelineState;
     /**
      * @internal
@@ -10438,51 +10597,36 @@ var dragonBones;
         BoneTranslateTimelineState.toString = function () {
             return "[class dragonBones.BoneTranslateTimelineState]";
         };
-        BoneTranslateTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = frameFloatArray[valueOffset++] * scale;
-                current.y = frameFloatArray[valueOffset++] * scale;
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    delta.x = frameFloatArray[valueOffset++] * scale - current.x;
-                    delta.y = frameFloatArray[valueOffset++] * scale - current.y;
-                }
-                else {
-                    delta.x = 0.0;
-                    delta.y = 0.0;
-                }
+        BoneTranslateTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueScale = this._armature.armatureData.scale;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
+        };
+        BoneTranslateTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.x += this._resultA * blendWeight;
+                result.y += this._resultB * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.x = this._resultA * blendWeight;
+                result.y = this._resultB * blendWeight;
             }
             else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = 0.0;
-                current.y = 0.0;
-                delta.x = 0.0;
-                delta.y = 0.0;
+                result.x = this._resultA;
+                result.y = this._resultB;
             }
-        };
-        BoneTranslateTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
             }
-            result.x = (current.x + delta.x * this._tweenProgress);
-            result.y = (current.y + delta.y * this._tweenProgress);
         };
         return BoneTranslateTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneTranslateTimelineState = BoneTranslateTimelineState;
     /**
      * @internal
@@ -10497,56 +10641,45 @@ var dragonBones;
         };
         BoneRotateTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.rotation = frameFloatArray[valueOffset++];
-                current.skew = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                        delta.rotation = dragonBones.Transform.normalizeRadian(frameFloatArray[valueOffset++] - current.rotation);
-                    }
-                    else {
-                        delta.rotation = frameFloatArray[valueOffset++] - current.rotation;
-                    }
-                    delta.skew = frameFloatArray[valueOffset++] - current.skew;
-                }
-                else {
-                    delta.rotation = 0.0;
-                    delta.skew = 0.0;
-                }
-            }
-            else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.rotation = 0.0;
-                current.skew = 0.0;
-                delta.rotation = 0.0;
-                delta.skew = 0.0;
+            if (this._isTween && this._frameIndex === this._frameCount - 1) {
+                this._differenceA = dragonBones.Transform.normalizeRadian(this._differenceA);
+                this._differenceB = dragonBones.Transform.normalizeRadian(this._differenceB);
             }
         };
-        BoneRotateTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            result.rotation = current.rotation + delta.rotation * this._tweenProgress;
-            result.skew = current.skew + delta.skew * this._tweenProgress;
+        BoneRotateTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
         };
         BoneRotateTimelineState.prototype.fadeOut = function () {
-            var result = this.bonePose.result;
-            result.rotation = dragonBones.Transform.normalizeRadian(result.rotation);
-            result.skew = dragonBones.Transform.normalizeRadian(result.skew);
+            this.dirty = false;
+            this._resultA = dragonBones.Transform.normalizeRadian(this._resultA);
+            this._resultB = dragonBones.Transform.normalizeRadian(this._resultB);
+        };
+        BoneRotateTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.rotation += this._resultA * blendWeight;
+                result.skew += this._resultB * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.rotation = this._resultA * blendWeight;
+                result.skew = this._resultB * blendWeight;
+            }
+            else {
+                result.rotation = this._resultA;
+                result.skew = this._resultB;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         };
         return BoneRotateTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneRotateTimelineState = BoneRotateTimelineState;
     /**
      * @internal
@@ -10561,48 +10694,40 @@ var dragonBones;
         };
         BoneScaleTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.scaleX = frameFloatArray[valueOffset++];
-                current.scaleY = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX;
-                    delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY;
-                }
-                else {
-                    delta.scaleX = 0.0;
-                    delta.scaleY = 0.0;
-                }
+            if (this._timelineData === null) {
+                this._resultA = 1.0;
+                this._resultB = 1.0;
+            }
+        };
+        BoneScaleTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
+        };
+        BoneScaleTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.scaleX += (this._resultA - 1.0) * blendWeight;
+                result.scaleY += (this._resultB - 1.0) * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.scaleX = (this._resultA - 1.0) * blendWeight + 1.0;
+                result.scaleY = (this._resultB - 1.0) * blendWeight + 1.0;
             }
             else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.scaleX = 1.0;
-                current.scaleY = 1.0;
-                delta.scaleX = 0.0;
-                delta.scaleY = 0.0;
+                result.scaleX = this._resultA;
+                result.scaleY = this._resultB;
             }
-        };
-        BoneScaleTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
             }
-            result.scaleX = current.scaleX + delta.scaleX * this._tweenProgress;
-            result.scaleY = current.scaleY + delta.scaleY * this._tweenProgress;
         };
         return BoneScaleTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneScaleTimelineState = BoneScaleTimelineState;
     /**
      * @internal
@@ -10610,116 +10735,123 @@ var dragonBones;
     var SurfaceTimelineState = /** @class */ (function (_super) {
         __extends(SurfaceTimelineState, _super);
         function SurfaceTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._current = [];
-            _this._delta = [];
-            _this._result = [];
-            return _this;
+            return _super !== null && _super.apply(this, arguments) || this;
         }
         SurfaceTimelineState.toString = function () {
             return "[class dragonBones.SurfaceTimelineState]";
         };
         SurfaceTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.surface = null;
-            this._frameFloatOffset = 0;
-            this._valueCount = 0;
             this._deformCount = 0;
-            this._valueOffset = 0;
-            this._current.length = 0;
-            this._delta.length = 0;
-            this._result.length = 0;
+            this._deformOffset = 0;
+            this._sameValueOffset = 0;
         };
-        SurfaceTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
+        SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * this._valueCount;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                if (this._tweenState === 2 /* Always */) {
-                    var nextValueOffset = valueOffset + this._valueCount;
-                    if (this._frameIndex === this._frameCount - 1) {
-                        nextValueOffset = this._animationData.frameFloatOffset + this._frameValueOffset;
+                var dragonBonesData = this._animationData.parent.parent;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
+                this._valueOffset = this._animationData.frameFloatOffset;
+                this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
+                this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */];
+                this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
+                this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
+                this._valueScale = this._armature.armatureData.scale;
+                this._valueArray = dragonBonesData.frameFloatArray;
+                this._rd.length = this._valueCount * 2;
+            }
+            else {
+                this._deformCount = this.target.target._deformVertices.length;
+            }
+        };
+        SurfaceTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var surface = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = surface._deformVertices;
+            var valueArray = this._valueArray;
+            if (valueArray !== null) {
+                var valueCount = this._valueCount;
+                var deformOffset = this._deformOffset;
+                var sameValueOffset = this._sameValueOffset;
+                var rd = this._rd;
+                for (var i = 0; i < this._deformCount; ++i) {
+                    var value = 0.0;
+                    if (i < deformOffset) {
+                        value = valueArray[sameValueOffset + i];
+                    }
+                    else if (i < deformOffset + valueCount) {
+                        value = rd[i - deformOffset];
+                    }
+                    else {
+                        value = valueArray[sameValueOffset + i - valueCount];
                     }
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._delta[i] = frameFloatArray[nextValueOffset + i] * scale - (this._current[i] = frameFloatArray[valueOffset + i] * scale);
+                    if (blendState.dirty > 1) {
+                        result[i] += value * blendWeight;
                     }
-                }
-                else {
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._current[i] = frameFloatArray[valueOffset + i] * scale;
+                    else {
+                        result[i] = value * blendWeight;
                     }
                 }
             }
-            else {
-                for (var i = 0; i < this._valueCount; ++i) {
-                    this._current[i] = 0.0;
+            else if (blendState.dirty === 1) {
+                for (var i = 0; i < this._deformCount; ++i) {
+                    result[i] = 0.0;
                 }
             }
-        };
-        SurfaceTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            this.surface._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                surface._transformDirty = true;
             }
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._result[i] = this._current[i] + this._delta[i] * this._tweenProgress;
+        };
+        return SurfaceTimelineState;
+    }(dragonBones.MutilpleValueTimelineState));
+    dragonBones.SurfaceTimelineState = SurfaceTimelineState;
+    /**
+     * @internal
+     */
+    var AlphaTimelineState = /** @class */ (function (_super) {
+        __extends(AlphaTimelineState, _super);
+        function AlphaTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AlphaTimelineState.toString = function () {
+            return "[class dragonBones.AlphaTimelineState]";
+        };
+        AlphaTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData === null) {
+                this._result = 1.0;
             }
         };
-        SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) {
+        AlphaTimelineState.prototype.init = function (armature, animationState, timelineData) {
             _super.prototype.init.call(this, armature, animationState, timelineData);
-            if (this._timelineData !== null) {
-                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
-                this._deformCount = this._frameIntArray[frameIntOffset + 1 /* DeformCount */];
-                this._valueCount = this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
-                this._valueOffset = this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
-                this._frameFloatOffset = this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
-            }
-            else {
-                this._deformCount = this.surface._deformVertices.length;
-                this._valueCount = this._deformCount;
-                this._valueOffset = 0;
-                this._frameFloatOffset = 0;
-            }
-            this._current.length = this._valueCount;
-            this._delta.length = this._valueCount;
-            this._result.length = this._valueCount;
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._delta[i] = 0.0;
-            }
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.01;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
-        SurfaceTimelineState.prototype.blend = function (state) {
-            var blendWeight = this.surface._blendState.blendWeight;
-            var result = this.surface._deformVertices;
-            for (var i = 0; i < this._deformCount; ++i) {
-                var value = 0.0;
-                if (i < this._valueOffset) {
-                    value = this._frameFloatArray[this._frameFloatOffset + i];
-                }
-                else if (i < this._valueOffset + this._valueCount) {
-                    value = this._result[i - this._valueOffset];
-                }
-                else {
-                    value = this._frameFloatArray[this._frameFloatOffset + i - this._valueCount];
-                }
-                if (state === 2) {
-                    result[i] += value * blendWeight;
-                }
-                else if (blendWeight !== 1.0) {
-                    result[i] = value * blendWeight;
-                }
-                else {
-                    result[i] = value;
+        AlphaTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var alphaTarget = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            if (blendState.dirty > 1) {
+                alphaTarget._alpha += this._result * blendWeight;
+                if (alphaTarget._alpha > 1.0) {
+                    alphaTarget._alpha = 1.0;
                 }
             }
-            if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                this.surface._transformDirty = true;
+            else {
+                alphaTarget._alpha = this._result * blendWeight;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                this._armature._alphaDirty = true;
             }
         };
-        return SurfaceTimelineState;
-    }(dragonBones.TweenTimelineState));
-    dragonBones.SurfaceTimelineState = SurfaceTimelineState;
+        return AlphaTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AlphaTimelineState = AlphaTimelineState;
     /**
      * @internal
      */
@@ -10733,14 +10865,17 @@ var dragonBones;
         };
         SlotDislayTimelineState.prototype._onArriveAtFrame = function () {
             if (this.playState >= 0) {
-                var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : this.slot._slotData.displayIndex;
-                if (this.slot.displayIndex !== displayIndex) {
-                    this.slot._setDisplayIndex(displayIndex, true);
+                var slot = this.target;
+                var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : slot._slotData.displayIndex;
+                if (slot.displayIndex !== displayIndex) {
+                    slot._setDisplayIndex(displayIndex, true);
                 }
             }
         };
+        SlotDislayTimelineState.prototype._onUpdateFrame = function () {
+        };
         return SlotDislayTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.TimelineState));
     dragonBones.SlotDislayTimelineState = SlotDislayTimelineState;
     /**
      * @internal
@@ -10750,91 +10885,97 @@ var dragonBones;
         function SlotColorTimelineState() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
             _this._current = [0, 0, 0, 0, 0, 0, 0, 0];
-            _this._delta = [0, 0, 0, 0, 0, 0, 0, 0];
+            _this._difference = [0, 0, 0, 0, 0, 0, 0, 0];
             _this._result = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
             return _this;
         }
         SlotColorTimelineState.toString = function () {
             return "[class dragonBones.SlotColorTimelineState]";
         };
-        SlotColorTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this._dirty = false;
-        };
         SlotColorTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
             if (this._timelineData !== null) {
-                var intArray = this._dragonBonesData.intArray;
-                var frameIntArray = this._frameIntArray;
-                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 1; // ...(timeline value offset)|x|x|(Value offset)|(Next offset)|x|x|...
+                var dragonBonesData = this._animationData.parent.parent;
+                var colorArray = dragonBonesData.colorArray;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex;
                 var colorOffset = frameIntArray[valueOffset];
                 if (colorOffset < 0) {
-                    colorOffset += 65536; // Fixed out of bouds bug. 
-                }
-                this._current[0] = intArray[colorOffset++];
-                this._current[1] = intArray[colorOffset++];
-                this._current[2] = intArray[colorOffset++];
-                this._current[3] = intArray[colorOffset++];
-                this._current[4] = intArray[colorOffset++];
-                this._current[5] = intArray[colorOffset++];
-                this._current[6] = intArray[colorOffset++];
-                this._current[7] = intArray[colorOffset++];
-                if (this._tweenState === 2 /* Always */) {
+                    colorOffset += 65536; // Fixed out of bounds bug. 
+                }
+                if (this._isTween) {
+                    this._current[0] = colorArray[colorOffset++];
+                    this._current[1] = colorArray[colorOffset++];
+                    this._current[2] = colorArray[colorOffset++];
+                    this._current[3] = colorArray[colorOffset++];
+                    this._current[4] = colorArray[colorOffset++];
+                    this._current[5] = colorArray[colorOffset++];
+                    this._current[6] = colorArray[colorOffset++];
+                    this._current[7] = colorArray[colorOffset++];
                     if (this._frameIndex === this._frameCount - 1) {
                         colorOffset = frameIntArray[this._animationData.frameIntOffset + this._frameValueOffset];
                     }
                     else {
-                        colorOffset = frameIntArray[valueOffset + 1 * 1];
+                        colorOffset = frameIntArray[valueOffset + 1];
                     }
                     if (colorOffset < 0) {
-                        colorOffset += 65536; // Fixed out of bouds bug. 
+                        colorOffset += 65536; // Fixed out of bounds bug. 
                     }
-                    this._delta[0] = intArray[colorOffset++] - this._current[0];
-                    this._delta[1] = intArray[colorOffset++] - this._current[1];
-                    this._delta[2] = intArray[colorOffset++] - this._current[2];
-                    this._delta[3] = intArray[colorOffset++] - this._current[3];
-                    this._delta[4] = intArray[colorOffset++] - this._current[4];
-                    this._delta[5] = intArray[colorOffset++] - this._current[5];
-                    this._delta[6] = intArray[colorOffset++] - this._current[6];
-                    this._delta[7] = intArray[colorOffset++] - this._current[7];
+                    this._difference[0] = colorArray[colorOffset++] - this._current[0];
+                    this._difference[1] = colorArray[colorOffset++] - this._current[1];
+                    this._difference[2] = colorArray[colorOffset++] - this._current[2];
+                    this._difference[3] = colorArray[colorOffset++] - this._current[3];
+                    this._difference[4] = colorArray[colorOffset++] - this._current[4];
+                    this._difference[5] = colorArray[colorOffset++] - this._current[5];
+                    this._difference[6] = colorArray[colorOffset++] - this._current[6];
+                    this._difference[7] = colorArray[colorOffset++] - this._current[7];
+                }
+                else {
+                    this._result[0] = colorArray[colorOffset++] * 0.01;
+                    this._result[1] = colorArray[colorOffset++] * 0.01;
+                    this._result[2] = colorArray[colorOffset++] * 0.01;
+                    this._result[3] = colorArray[colorOffset++] * 0.01;
+                    this._result[4] = colorArray[colorOffset++];
+                    this._result[5] = colorArray[colorOffset++];
+                    this._result[6] = colorArray[colorOffset++];
+                    this._result[7] = colorArray[colorOffset++];
                 }
             }
             else {
-                var color = this.slot._slotData.color;
-                this._current[0] = color.alphaMultiplier * 100.0;
-                this._current[1] = color.redMultiplier * 100.0;
-                this._current[2] = color.greenMultiplier * 100.0;
-                this._current[3] = color.blueMultiplier * 100.0;
-                this._current[4] = color.alphaOffset;
-                this._current[5] = color.redOffset;
-                this._current[6] = color.greenOffset;
-                this._current[7] = color.blueOffset;
+                var slot = this.target;
+                var color = slot.slotData.color;
+                this._result[0] = color.alphaMultiplier;
+                this._result[1] = color.redMultiplier;
+                this._result[2] = color.greenMultiplier;
+                this._result[3] = color.blueMultiplier;
+                this._result[4] = color.alphaOffset;
+                this._result[5] = color.redOffset;
+                this._result[6] = color.greenOffset;
+                this._result[7] = color.blueOffset;
             }
         };
         SlotColorTimelineState.prototype._onUpdateFrame = function () {
             _super.prototype._onUpdateFrame.call(this);
-            this._dirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            this._result[0] = (this._current[0] + this._delta[0] * this._tweenProgress) * 0.01;
-            this._result[1] = (this._current[1] + this._delta[1] * this._tweenProgress) * 0.01;
-            this._result[2] = (this._current[2] + this._delta[2] * this._tweenProgress) * 0.01;
-            this._result[3] = (this._current[3] + this._delta[3] * this._tweenProgress) * 0.01;
-            this._result[4] = this._current[4] + this._delta[4] * this._tweenProgress;
-            this._result[5] = this._current[5] + this._delta[5] * this._tweenProgress;
-            this._result[6] = this._current[6] + this._delta[6] * this._tweenProgress;
-            this._result[7] = this._current[7] + this._delta[7] * this._tweenProgress;
+            if (this._isTween) {
+                this._result[0] = (this._current[0] + this._difference[0] * this._tweenProgress) * 0.01;
+                this._result[1] = (this._current[1] + this._difference[1] * this._tweenProgress) * 0.01;
+                this._result[2] = (this._current[2] + this._difference[2] * this._tweenProgress) * 0.01;
+                this._result[3] = (this._current[3] + this._difference[3] * this._tweenProgress) * 0.01;
+                this._result[4] = this._current[4] + this._difference[4] * this._tweenProgress;
+                this._result[5] = this._current[5] + this._difference[5] * this._tweenProgress;
+                this._result[6] = this._current[6] + this._difference[6] * this._tweenProgress;
+                this._result[7] = this._current[7] + this._difference[7] * this._tweenProgress;
+            }
         };
         SlotColorTimelineState.prototype.fadeOut = function () {
-            this._tweenState = 0 /* None */;
-            this._dirty = false;
+            this._isTween = false;
         };
         SlotColorTimelineState.prototype.update = function (passedTime) {
             _super.prototype.update.call(this, passedTime);
             // Fade animation.
-            if (this._tweenState !== 0 /* None */ || this._dirty) {
-                var result = this.slot._colorTransform;
+            if (this._isTween || this.dirty) {
+                var slot = this.target;
+                var result = slot._colorTransform;
                 if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
                     if (result.alphaMultiplier !== this._result[0] ||
                         result.redMultiplier !== this._result[1] ||
@@ -10853,11 +10994,11 @@ var dragonBones;
                         result.redOffset += (this._result[5] - result.redOffset) * fadeProgress;
                         result.greenOffset += (this._result[6] - result.greenOffset) * fadeProgress;
                         result.blueOffset += (this._result[7] - result.blueOffset) * fadeProgress;
-                        this.slot._colorDirty = true;
+                        slot._colorDirty = true;
                     }
                 }
-                else if (this._dirty) {
-                    this._dirty = false;
+                else if (this.dirty) {
+                    this.dirty = false;
                     if (result.alphaMultiplier !== this._result[0] ||
                         result.redMultiplier !== this._result[1] ||
                         result.greenMultiplier !== this._result[2] ||
@@ -10874,152 +11015,159 @@ var dragonBones;
                         result.redOffset = this._result[5];
                         result.greenOffset = this._result[6];
                         result.blueOffset = this._result[7];
-                        this.slot._colorDirty = true;
+                        slot._colorDirty = true;
                     }
                 }
             }
         };
         return SlotColorTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.TweenTimelineState));
     dragonBones.SlotColorTimelineState = SlotColorTimelineState;
+    /**
+     * @internal
+     */
+    var SlotZIndexTimelineState = /** @class */ (function (_super) {
+        __extends(SlotZIndexTimelineState, _super);
+        function SlotZIndexTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        SlotZIndexTimelineState.toString = function () {
+            return "[class dragonBones.SlotZIndexTimelineState]";
+        };
+        SlotZIndexTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData === null) {
+                var blendState = this.target;
+                var slot = blendState.target;
+                this._result = slot.slotData.zIndex;
+            }
+        };
+        SlotZIndexTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        SlotZIndexTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var slot = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            if (blendState.dirty > 1) {
+                slot._zIndex += this._result * blendWeight;
+            }
+            else {
+                slot._zIndex = this._result * blendWeight;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                this._armature._zIndexDirty = true;
+            }
+        };
+        return SlotZIndexTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.SlotZIndexTimelineState = SlotZIndexTimelineState;
     /**
      * @internal
      */
     var DeformTimelineState = /** @class */ (function (_super) {
         __extends(DeformTimelineState, _super);
         function DeformTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._current = [];
-            _this._delta = [];
-            _this._result = [];
-            return _this;
+            return _super !== null && _super.apply(this, arguments) || this;
         }
         DeformTimelineState.toString = function () {
             return "[class dragonBones.DeformTimelineState]";
         };
         DeformTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.vertexOffset = 0;
-            this._dirty = false;
-            this._frameFloatOffset = 0;
-            this._valueCount = 0;
+            this.geometryOffset = 0;
+            this.displayFrame = null;
             this._deformCount = 0;
-            this._valueOffset = 0;
-            this._current.length = 0;
-            this._delta.length = 0;
-            this._result.length = 0;
+            this._deformOffset = 0;
+            this._sameValueOffset = 0;
         };
-        DeformTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
+        DeformTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * this._valueCount;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                if (this._tweenState === 2 /* Always */) {
-                    var nextValueOffset = valueOffset + this._valueCount;
-                    if (this._frameIndex === this._frameCount - 1) {
-                        nextValueOffset = this._animationData.frameFloatOffset + this._frameValueOffset;
+                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
+                var dragonBonesData = this._animationData.parent.parent;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var slot = this.target.target;
+                this.geometryOffset = frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */];
+                if (this.geometryOffset < 0) {
+                    this.geometryOffset += 65536; // Fixed out of bounds bug. 
+                }
+                for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                    var displayFrame = slot.getDisplayFrameAt(i);
+                    var geometryData = displayFrame.getGeometryData();
+                    if (geometryData === null) {
+                        continue;
                     }
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._delta[i] = frameFloatArray[nextValueOffset + i] * scale - (this._current[i] = frameFloatArray[valueOffset + i] * scale);
+                    if (geometryData.offset === this.geometryOffset) {
+                        this.displayFrame = displayFrame;
+                        this.displayFrame.updateDeformVertices();
+                        break;
                     }
                 }
-                else {
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._current[i] = frameFloatArray[valueOffset + i] * scale;
-                    }
+                if (this.displayFrame === null) {
+                    this.returnToPool(); //
+                    return;
                 }
+                this._valueOffset = this._animationData.frameFloatOffset;
+                this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
+                this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */];
+                this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
+                this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
+                this._valueScale = this._armature.armatureData.scale;
+                this._valueArray = dragonBonesData.frameFloatArray;
+                this._rd.length = this._valueCount * 2;
             }
             else {
-                for (var i = 0; i < this._valueCount; ++i) {
-                    this._current[i] = 0.0;
+                this._deformCount = this.displayFrame.deformVertices.length;
+            }
+        };
+        DeformTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var slot = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = this.displayFrame.deformVertices;
+            var valueArray = this._valueArray;
+            if (valueArray !== null) {
+                var valueCount = this._valueCount;
+                var deformOffset = this._deformOffset;
+                var sameValueOffset = this._sameValueOffset;
+                var rd = this._rd;
+                for (var i = 0; i < this._deformCount; ++i) {
+                    var value = 0.0;
+                    if (i < deformOffset) {
+                        value = valueArray[sameValueOffset + i];
+                    }
+                    else if (i < deformOffset + valueCount) {
+                        value = rd[i - deformOffset];
+                    }
+                    else {
+                        value = valueArray[sameValueOffset + i - valueCount];
+                    }
+                    if (blendState.dirty > 1) {
+                        result[i] += value * blendWeight;
+                    }
+                    else {
+                        result[i] = value * blendWeight;
+                    }
                 }
             }
-        };
-        DeformTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            this._dirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._result[i] = this._current[i] + this._delta[i] * this._tweenProgress;
-            }
-        };
-        DeformTimelineState.prototype.init = function (armature, animationState, timelineData) {
-            _super.prototype.init.call(this, armature, animationState, timelineData);
-            if (this._timelineData !== null) {
-                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
-                this.vertexOffset = this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */];
-                if (this.vertexOffset < 0) {
-                    this.vertexOffset += 65536; // Fixed out of bouds bug. 
+            else if (blendState.dirty === 1) {
+                for (var i = 0; i < this._deformCount; ++i) {
+                    result[i] = 0.0;
                 }
-                this._deformCount = this._frameIntArray[frameIntOffset + 1 /* DeformCount */];
-                this._valueCount = this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
-                this._valueOffset = this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
-                this._frameFloatOffset = this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
-            }
-            else {
-                var deformVertices = this.slot._deformVertices;
-                this._deformCount = deformVertices !== null ? deformVertices.vertices.length : 0;
-                this._valueCount = this._deformCount;
-                this._valueOffset = 0;
-                this._frameFloatOffset = 0;
-            }
-            this._current.length = this._valueCount;
-            this._delta.length = this._valueCount;
-            this._result.length = this._valueCount;
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._delta[i] = 0.0;
-            }
-        };
-        DeformTimelineState.prototype.fadeOut = function () {
-            this._tweenState = 0 /* None */;
-            this._dirty = false;
-        };
-        DeformTimelineState.prototype.update = function (passedTime) {
-            var deformVertices = this.slot._deformVertices;
-            if (deformVertices === null || deformVertices.verticesData === null || deformVertices.verticesData.offset !== this.vertexOffset) {
-                return;
             }
-            _super.prototype.update.call(this, passedTime);
-            // Fade animation.
-            if (this._tweenState !== 0 /* None */ || this._dirty) {
-                var result = deformVertices.vertices;
-                if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                    var fadeProgress = Math.pow(this._animationState._fadeProgress, 2);
-                    for (var i = 0; i < this._deformCount; ++i) {
-                        if (i < this._valueOffset) {
-                            result[i] += (this._frameFloatArray[this._frameFloatOffset + i] - result[i]) * fadeProgress;
-                        }
-                        else if (i < this._valueOffset + this._valueCount) {
-                            result[i] += (this._result[i - this._valueOffset] - result[i]) * fadeProgress;
-                        }
-                        else {
-                            result[i] += (this._frameFloatArray[this._frameFloatOffset + i - this._valueCount] - result[i]) * fadeProgress;
-                        }
-                    }
-                    deformVertices.verticesDirty = true;
-                }
-                else if (this._dirty) {
-                    this._dirty = false;
-                    for (var i = 0; i < this._deformCount; ++i) {
-                        if (i < this._valueOffset) {
-                            result[i] = this._frameFloatArray[this._frameFloatOffset + i];
-                        }
-                        else if (i < this._valueOffset + this._valueCount) {
-                            result[i] = this._result[i - this._valueOffset];
-                        }
-                        else {
-                            result[i] = this._frameFloatArray[this._frameFloatOffset + i - this._valueCount];
-                        }
-                    }
-                    deformVertices.verticesDirty = true;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                if (slot._geometryData === this.displayFrame.getGeometryData()) {
+                    slot._verticesDirty = true;
                 }
             }
         };
         return DeformTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.MutilpleValueTimelineState));
     dragonBones.DeformTimelineState = DeformTimelineState;
     /**
      * @internal
@@ -11032,115 +11180,115 @@ var dragonBones;
         IKConstraintTimelineState.toString = function () {
             return "[class dragonBones.IKConstraintTimelineState]";
         };
-        IKConstraintTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this._current = 0.0;
-            this._delta = 0.0;
-        };
-        IKConstraintTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            var ikConstraint = this.constraint;
+        IKConstraintTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var ikConstraint = this.target;
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameIntArray = this._frameIntArray;
-                var bendPositive = frameIntArray[valueOffset++] !== 0;
-                this._current = frameIntArray[valueOffset++] * 0.01;
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameIntOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    this._delta = frameIntArray[valueOffset + 1] * 0.01 - this._current;
-                }
-                else {
-                    this._delta = 0.0;
-                }
-                ikConstraint._bendPositive = bendPositive;
+                ikConstraint._bendPositive = this._currentA > 0.0;
+                ikConstraint._weight = this._currentB;
             }
             else {
                 var ikConstraintData = ikConstraint._constraintData;
-                this._current = ikConstraintData.weight;
-                this._delta = 0.0;
                 ikConstraint._bendPositive = ikConstraintData.bendPositive;
+                ikConstraint._weight = ikConstraintData.weight;
             }
             ikConstraint.invalidUpdate();
+            this.dirty = false;
         };
-        IKConstraintTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            var ikConstraint = this.constraint;
-            ikConstraint._weight = this._current + this._delta * this._tweenProgress;
-            ikConstraint.invalidUpdate();
-            // TODO fade update.
+        IKConstraintTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.01;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
         return IKConstraintTimelineState;
-    }(dragonBones.ConstraintTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.IKConstraintTimelineState = IKConstraintTimelineState;
     /**
      * @internal
      */
-    var AnimationTimelineState = /** @class */ (function (_super) {
-        __extends(AnimationTimelineState, _super);
-        function AnimationTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._floats = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
-            return _this;
+    var AnimationProgressTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationProgressTimelineState, _super);
+        function AnimationProgressTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
         }
-        AnimationTimelineState.toString = function () {
-            return "[class dragonBones.AnimationTimelineState]";
-        };
-        AnimationTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this.animationState = null;
+        AnimationProgressTimelineState.toString = function () {
+            return "[class dragonBones.AnimationProgressTimelineState]";
         };
-        AnimationTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData === null) {
-                return;
-            }
-            var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 2;
-            var frameRateR = 1.0 / this.animationState._animationData.parent.frameRate;
-            var frameIntArray = this._frameIntArray;
-            this._floats[0] = frameIntArray[valueOffset++] * frameRateR;
-            this._floats[3] = frameIntArray[valueOffset++] * 0.01;
-            if (this._tweenState === 2 /* Always */) {
-                if (this._frameIndex === this._frameCount - 1) {
-                    valueOffset = this._animationData.frameIntOffset + this._frameValueOffset; // + 0 * 2
-                }
-                this._floats[1] = frameIntArray[valueOffset++] * frameRateR - this._floats[0];
-                this._floats[4] = frameIntArray[valueOffset++] * 0.01 - this._floats[3];
-            }
-            else {
-                this._floats[1] = 0.0;
-                this._floats[4] = 0.0;
+        AnimationProgressTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.currentTime = this._result * animationState.totalTime;
             }
+            this.dirty = false;
+        };
+        AnimationProgressTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
-        AnimationTimelineState.prototype._onUpdateFrame = function () {
+        return AnimationProgressTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AnimationProgressTimelineState = AnimationProgressTimelineState;
+    /**
+     * @internal
+     */
+    var AnimationWeightTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationWeightTimelineState, _super);
+        function AnimationWeightTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationWeightTimelineState.toString = function () {
+            return "[class dragonBones.AnimationWeightTimelineState]";
+        };
+        AnimationWeightTimelineState.prototype._onUpdateFrame = function () {
             _super.prototype._onUpdateFrame.call(this);
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            if (this._floats[0] >= 0.0) {
-                this._floats[2] = this._floats[0] + this._floats[1] * this._tweenProgress;
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.weight = this._result;
             }
-            this._floats[5] = this._floats[3] + this._floats[4] * this._tweenProgress;
+            this.dirty = false;
         };
-        AnimationTimelineState.prototype.blend = function (state) {
-            var animationState = this.animationState;
-            var blendWeight = animationState._blendState.blendWeight;
-            if (state === 2) {
-                animationState.weight += this._floats[5] * blendWeight;
-                animationState.currentTime += this._floats[2] * blendWeight;
-            }
-            else {
-                animationState.weight = this._floats[5] * blendWeight;
-                animationState.currentTime = this._floats[2] * blendWeight;
+        AnimationWeightTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        return AnimationWeightTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AnimationWeightTimelineState = AnimationWeightTimelineState;
+    /**
+     * @internal
+     */
+    var AnimationParametersTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationParametersTimelineState, _super);
+        function AnimationParametersTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationParametersTimelineState.toString = function () {
+            return "[class dragonBones.AnimationParametersTimelineState]";
+        };
+        AnimationParametersTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.parameterX = this._resultA;
+                animationState.parameterY = this._resultB;
             }
+            this.dirty = false;
         };
-        return AnimationTimelineState;
-    }(dragonBones.TweenTimelineState));
-    dragonBones.AnimationTimelineState = AnimationTimelineState;
+        AnimationParametersTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        return AnimationParametersTimelineState;
+    }(dragonBones.DoubleValueTimelineState));
+    dragonBones.AnimationParametersTimelineState = AnimationParametersTimelineState;
 })(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
@@ -11346,7 +11494,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var DataParser = /** @class */ (function () {
         function DataParser() {
@@ -11373,6 +11521,40 @@ var dragonBones;
                     return 0 /* Bone */;
             }
         };
+        DataParser._getPositionMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "percent":
+                    return 1 /* Percent */;
+                case "fixed":
+                    return 0 /* Fixed */;
+                default:
+                    return 1 /* Percent */;
+            }
+        };
+        DataParser._getSpacingMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "length":
+                    return 0 /* Length */;
+                case "percent":
+                    return 2 /* Percent */;
+                case "fixed":
+                    return 1 /* Fixed */;
+                default:
+                    return 0 /* Length */;
+            }
+        };
+        DataParser._getRotateMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "tangent":
+                    return 0 /* Tangent */;
+                case "chain":
+                    return 1 /* Chain */;
+                case "chainscale":
+                    return 2 /* ChainScale */;
+                default:
+                    return 0 /* Tangent */;
+            }
+        };
         DataParser._getDisplayType = function (value) {
             switch (value.toLowerCase()) {
                 case "image":
@@ -11401,18 +11583,6 @@ var dragonBones;
                     return 0 /* Rectangle */;
             }
         };
-        DataParser._getActionType = function (value) {
-            switch (value.toLowerCase()) {
-                case "play":
-                    return 0 /* Play */;
-                case "frame":
-                    return 10 /* Frame */;
-                case "sound":
-                    return 11 /* Sound */;
-                default:
-                    return 0 /* Play */;
-            }
-        };
         DataParser._getBlendMode = function (value) {
             switch (value.toLowerCase()) {
                 case "normal":
@@ -11447,93 +11617,27 @@ var dragonBones;
                     return 0 /* Normal */;
             }
         };
-        DataParser._getPositionMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "percent":
-                    return 1 /* Percent */;
-                case "fixed":
-                    return 0 /* Fixed */;
-                default:
-                    return 1 /* Percent */;
-            }
-        };
-        DataParser._getSpacingMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "length":
-                    return 0 /* Length */;
-                case "percent":
-                    return 2 /* Percent */;
-                case "fixed":
-                    return 1 /* Fixed */;
+        DataParser._getAnimationBlendType = function (value) {
+            switch (value.toLowerCase()) {
+                case "none":
+                    return 0 /* None */;
+                case "1d":
+                    return 1 /* E1D */;
                 default:
-                    return 0 /* Length */;
+                    return 0 /* None */;
             }
         };
-        DataParser._getRotateMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "tangent":
-                    return 0 /* Tangent */;
-                case "chain":
-                    return 1 /* Chain */;
-                case "chainscale":
-                    return 2 /* ChainScale */;
+        DataParser._getActionType = function (value) {
+            switch (value.toLowerCase()) {
+                case "play":
+                    return 0 /* Play */;
+                case "frame":
+                    return 10 /* Frame */;
+                case "sound":
+                    return 11 /* Sound */;
                 default:
-                    return 0 /* Tangent */;
-            }
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DataParser.parseDragonBonesData = function (rawData) {
-            console.warn("Deprecated.");
-            if (rawData instanceof ArrayBuffer) {
-                return dragonBones.BinaryDataParser.getInstance().parseDragonBonesData(rawData);
-            }
-            else {
-                return dragonBones.ObjectDataParser.getInstance().parseDragonBonesData(rawData);
-            }
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DataParser.parseTextureAtlasData = function (rawData, scale) {
-            if (scale === void 0) { scale = 1; }
-            console.warn("已废弃");
-            var textureAtlasData = {};
-            var subTextureList = rawData[DataParser.SUB_TEXTURE];
-            for (var i = 0, len = subTextureList.length; i < len; i++) {
-                var subTextureObject = subTextureList[i];
-                var subTextureName = subTextureObject[DataParser.NAME];
-                var subTextureRegion = new dragonBones.Rectangle();
-                var subTextureFrame = null;
-                subTextureRegion.x = subTextureObject[DataParser.X] / scale;
-                subTextureRegion.y = subTextureObject[DataParser.Y] / scale;
-                subTextureRegion.width = subTextureObject[DataParser.WIDTH] / scale;
-                subTextureRegion.height = subTextureObject[DataParser.HEIGHT] / scale;
-                if (DataParser.FRAME_WIDTH in subTextureObject) {
-                    subTextureFrame = new dragonBones.Rectangle();
-                    subTextureFrame.x = subTextureObject[DataParser.FRAME_X] / scale;
-                    subTextureFrame.y = subTextureObject[DataParser.FRAME_Y] / scale;
-                    subTextureFrame.width = subTextureObject[DataParser.FRAME_WIDTH] / scale;
-                    subTextureFrame.height = subTextureObject[DataParser.FRAME_HEIGHT] / scale;
-                }
-                textureAtlasData[subTextureName] = { region: subTextureRegion, frame: subTextureFrame, rotated: false };
+                    return 0 /* Play */;
             }
-            return textureAtlasData;
         };
         DataParser.DATA_VERSION_2_3 = "2.3";
         DataParser.DATA_VERSION_3_0 = "3.0";
@@ -11541,12 +11645,14 @@ var dragonBones;
         DataParser.DATA_VERSION_4_5 = "4.5";
         DataParser.DATA_VERSION_5_0 = "5.0";
         DataParser.DATA_VERSION_5_5 = "5.5";
-        DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_5;
+        DataParser.DATA_VERSION_5_6 = "5.6";
+        DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_6;
         DataParser.DATA_VERSIONS = [
             DataParser.DATA_VERSION_4_0,
             DataParser.DATA_VERSION_4_5,
             DataParser.DATA_VERSION_5_0,
-            DataParser.DATA_VERSION_5_5
+            DataParser.DATA_VERSION_5_5,
+            DataParser.DATA_VERSION_5_6
         ];
         DataParser.TEXTURE_ATLAS = "textureAtlas";
         DataParser.SUB_TEXTURE = "SubTexture";
@@ -11562,18 +11668,19 @@ var dragonBones;
         DataParser.DRADON_BONES = "dragonBones";
         DataParser.USER_DATA = "userData";
         DataParser.ARMATURE = "armature";
+        DataParser.CANVAS = "canvas";
         DataParser.BONE = "bone";
         DataParser.SURFACE = "surface";
         DataParser.SLOT = "slot";
-        DataParser.CONSTRAINT = "constraint";
-        DataParser.IK = "ik";
-        DataParser.PATH_CONSTRAINT = "path";
+        DataParser.CONSTRAINT = "constraint";
         DataParser.SKIN = "skin";
         DataParser.DISPLAY = "display";
+        DataParser.FRAME = "frame";
+        DataParser.IK = "ik";
+        DataParser.PATH_CONSTRAINT = "path";
         DataParser.ANIMATION = "animation";
-        DataParser.Z_ORDER = "zOrder";
+        DataParser.TIMELINE = "timeline";
         DataParser.FFD = "ffd";
-        DataParser.FRAME = "frame";
         DataParser.TRANSLATE_FRAME = "translateFrame";
         DataParser.ROTATE_FRAME = "rotateFrame";
         DataParser.SCALE_FRAME = "scaleFrame";
@@ -11585,7 +11692,6 @@ var dragonBones;
         DataParser.INTS = "ints";
         DataParser.FLOATS = "floats";
         DataParser.STRINGS = "strings";
-        DataParser.CANVAS = "canvas";
         DataParser.TRANSFORM = "transform";
         DataParser.PIVOT = "pivot";
         DataParser.AABB = "aabb";
@@ -11603,6 +11709,8 @@ var dragonBones;
         DataParser.PATH = "path";
         DataParser.LENGTH = "length";
         DataParser.DISPLAY_INDEX = "displayIndex";
+        DataParser.Z_ORDER = "zOrder";
+        DataParser.Z_INDEX = "zIndex";
         DataParser.BLEND_MODE = "blendMode";
         DataParser.INHERIT_TRANSLATION = "inheritTranslation";
         DataParser.INHERIT_ROTATION = "inheritRotation";
@@ -11615,6 +11723,7 @@ var dragonBones;
         DataParser.BEND_POSITIVE = "bendPositive";
         DataParser.CHAIN = "chain";
         DataParser.WEIGHT = "weight";
+        DataParser.BLEND_TYPE = "blendType";
         DataParser.FADE_IN_TIME = "fadeInTime";
         DataParser.PLAY_TIMES = "playTimes";
         DataParser.SCALE = "scale";
@@ -11638,6 +11747,7 @@ var dragonBones;
         DataParser.VALUE = "value";
         DataParser.ROTATE = "rotate";
         DataParser.SKEW = "skew";
+        DataParser.ALPHA = "alpha";
         DataParser.ALPHA_OFFSET = "aO";
         DataParser.RED_OFFSET = "rO";
         DataParser.GREEN_OFFSET = "gO";
@@ -11652,8 +11762,6 @@ var dragonBones;
         DataParser.WEIGHTS = "weights";
         DataParser.SLOT_POSE = "slotPose";
         DataParser.BONE_POSE = "bonePose";
-        DataParser.GLUE_WEIGHTS = "glueWeights";
-        DataParser.GLUE_MESHES = "glueMeshes";
         DataParser.BONES = "bones";
         DataParser.POSITION_MODE = "positionMode";
         DataParser.SPACING_MODE = "spacingMode";
@@ -11698,7 +11806,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ObjectDataParser = /** @class */ (function (_super) {
         __extends(ObjectDataParser, _super);
@@ -11709,16 +11817,19 @@ var dragonBones;
             _this._data = null; //
             _this._armature = null; //
             _this._bone = null; //
-            _this._surface = null; //
+            _this._geometry = null; //
             _this._slot = null; //
             _this._skin = null; //
             _this._mesh = null; //
             _this._animation = null; //
             _this._timeline = null; //
             _this._rawTextureAtlases = null;
+            _this._frameValueType = 0 /* Step */;
             _this._defaultColorOffset = -1;
             _this._prevClockwise = 0;
             _this._prevRotation = 0.0;
+            _this._frameDefaultValue = 0.0;
+            _this._frameValueScale = 1.0;
             _this._helpMatrixA = new dragonBones.Matrix();
             _this._helpMatrixB = new dragonBones.Matrix();
             _this._helpTransform = new dragonBones.Transform();
@@ -11731,6 +11842,7 @@ var dragonBones;
             _this._frameFloatArray = [];
             _this._frameArray = [];
             _this._timelineArray = [];
+            _this._colorArray = [];
             _this._cacheRawMeshes = [];
             _this._cacheMeshes = [];
             _this._actionFrames = [];
@@ -11781,13 +11893,6 @@ var dragonBones;
                 var value = rawData[key];
                 var type = typeof value;
                 if (type === "string") {
-                    if (dragonBones.DragonBones.webAssembly) {
-                        for (var i = 0, l = value.length; i < l; ++i) {
-                            if (value.charCodeAt(i) > 255) {
-                                return encodeURI(value);
-                            }
-                        }
-                    }
                     return value;
                 }
                 return String(value);
@@ -11807,34 +11912,68 @@ var dragonBones;
         };
         ObjectDataParser.prototype._samplingEasingCurve = function (curve, samples) {
             var curveCount = curve.length;
-            var stepIndex = -2;
-            for (var i = 0, l = samples.length; i < l; ++i) {
-                var t = (i + 1) / (l + 1); // float
-                while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) {
-                    stepIndex += 6;
-                }
-                var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount;
-                var x1 = isInCurve ? curve[stepIndex] : 0.0;
-                var y1 = isInCurve ? curve[stepIndex + 1] : 0.0;
-                var x2 = curve[stepIndex + 2];
-                var y2 = curve[stepIndex + 3];
-                var x3 = curve[stepIndex + 4];
-                var y3 = curve[stepIndex + 5];
-                var x4 = isInCurve ? curve[stepIndex + 6] : 1.0;
-                var y4 = isInCurve ? curve[stepIndex + 7] : 1.0;
-                var lower = 0.0;
-                var higher = 1.0;
-                while (higher - lower > 0.0001) {
-                    var percentage = (higher + lower) * 0.5;
-                    this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
-                    if (t - this._helpPoint.x > 0.0) {
-                        lower = percentage;
+            if (curveCount % 3 === 1) {
+                var stepIndex = -2;
+                for (var i = 0, l = samples.length; i < l; ++i) {
+                    var t = (i + 1) / (l + 1); // float
+                    while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) {
+                        stepIndex += 6;
+                    }
+                    var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount;
+                    var x1 = isInCurve ? curve[stepIndex] : 0.0;
+                    var y1 = isInCurve ? curve[stepIndex + 1] : 0.0;
+                    var x2 = curve[stepIndex + 2];
+                    var y2 = curve[stepIndex + 3];
+                    var x3 = curve[stepIndex + 4];
+                    var y3 = curve[stepIndex + 5];
+                    var x4 = isInCurve ? curve[stepIndex + 6] : 1.0;
+                    var y4 = isInCurve ? curve[stepIndex + 7] : 1.0;
+                    var lower = 0.0;
+                    var higher = 1.0;
+                    while (higher - lower > 0.0001) {
+                        var percentage = (higher + lower) * 0.5;
+                        this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
+                        if (t - this._helpPoint.x > 0.0) {
+                            lower = percentage;
+                        }
+                        else {
+                            higher = percentage;
+                        }
                     }
-                    else {
-                        higher = percentage;
+                    samples[i] = this._helpPoint.y;
+                }
+                return true;
+            }
+            else {
+                var stepIndex = 0;
+                for (var i = 0, l = samples.length; i < l; ++i) {
+                    var t = (i + 1) / (l + 1); // float
+                    while (curve[stepIndex + 6] < t) {
+                        stepIndex += 6;
+                    }
+                    var x1 = curve[stepIndex];
+                    var y1 = curve[stepIndex + 1];
+                    var x2 = curve[stepIndex + 2];
+                    var y2 = curve[stepIndex + 3];
+                    var x3 = curve[stepIndex + 4];
+                    var y3 = curve[stepIndex + 5];
+                    var x4 = curve[stepIndex + 6];
+                    var y4 = curve[stepIndex + 7];
+                    var lower = 0.0;
+                    var higher = 1.0;
+                    while (higher - lower > 0.0001) {
+                        var percentage = (higher + lower) * 0.5;
+                        this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
+                        if (t - this._helpPoint.x > 0.0) {
+                            lower = percentage;
+                        }
+                        else {
+                            higher = percentage;
+                        }
                     }
+                    samples[i] = this._helpPoint.y;
                 }
-                samples[i] = this._helpPoint.y;
+                return false;
             }
         };
         ObjectDataParser.prototype._parseActionDataInFrame = function (rawData, frameStart, bone, slot) {
@@ -11855,7 +11994,7 @@ var dragonBones;
             }
         };
         ObjectDataParser.prototype._mergeActionFrame = function (rawData, frameStart, type, bone, slot) {
-            var actionOffset = dragonBones.DragonBones.webAssembly ? this._armature.actions.size() : this._armature.actions.length;
+            var actionOffset = this._armature.actions.length;
             var actions = this._parseActionData(rawData, type, bone, slot);
             var frameIndex = 0;
             var frame = null;
@@ -11883,7 +12022,7 @@ var dragonBones;
             if (frame === null) {
                 frame = new ActionFrame();
                 frame.frameStart = frameStart;
-                this._actionFrames.splice(frameIndex + 1, 0, frame);
+                this._actionFrames.splice(frameIndex, 0, frame);
             }
             for (var i = 0; i < actions.length; ++i) {
                 frame.actions.push(actionOffset + i);
@@ -11992,13 +12131,6 @@ var dragonBones;
                     }
                 }
             }
-            for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) {
-                var rawMeshData = this._cacheRawMeshes[i];
-                if (!(dragonBones.DataParser.GLUE_WEIGHTS in rawMeshData) || !(dragonBones.DataParser.GLUE_MESHES in rawMeshData)) {
-                    continue;
-                }
-                this._parseMeshGlue(rawMeshData, this._cacheMeshes[i]);
-            }
             for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) {
                 var rawData_1 = this._cacheRawMeshes[i];
                 var shareName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SHARE, "");
@@ -12014,7 +12146,7 @@ var dragonBones;
                     continue; // Error.
                 }
                 var mesh = this._cacheMeshes[i];
-                mesh.vertices.shareFrom(shareMesh.vertices);
+                mesh.geometry.shareFrom(shareMesh.geometry);
             }
             if (dragonBones.DataParser.ANIMATION in rawData) {
                 var rawAnimations = rawData[dragonBones.DataParser.ANIMATION];
@@ -12065,7 +12197,6 @@ var dragonBones;
         };
         ObjectDataParser.prototype._parseBone = function (rawData) {
             var type = 0 /* Bone */;
-            var scale = this._armature.scale;
             if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") {
                 type = dragonBones.DataParser._getBoneType(rawData[dragonBones.DataParser.TYPE]);
             }
@@ -12073,12 +12204,14 @@ var dragonBones;
                 type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Bone */);
             }
             if (type === 0 /* Bone */) {
+                var scale = this._armature.scale;
                 var bone = dragonBones.BaseObject.borrowObject(dragonBones.BoneData);
                 bone.inheritTranslation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_TRANSLATION, true);
                 bone.inheritRotation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_ROTATION, true);
                 bone.inheritScale = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_SCALE, true);
                 bone.inheritReflection = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_REFLECTION, true);
                 bone.length = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.LENGTH, 0) * scale;
+                bone.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
                 bone.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
                 if (dragonBones.DataParser.TRANSFORM in rawData) {
                     this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], bone.transform, scale);
@@ -12086,21 +12219,11 @@ var dragonBones;
                 return bone;
             }
             var surface = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceData);
+            surface.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
             surface.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             surface.segmentX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_X, 0);
             surface.segmentY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_Y, 0);
-            surface.vertices.length = (surface.segmentX + 1) * (surface.segmentY + 1) * 2;
-            if (dragonBones.DataParser.VERTICES in rawData) {
-                var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-                for (var i = 0, l = surface.vertices.length; i < l; ++i) {
-                    if (i < rawVertices.length) {
-                        surface.vertices[i] = rawVertices[i] * scale;
-                    }
-                    else {
-                        surface.vertices[i] = 0.0;
-                    }
-                }
-            }
+            this._parseGeometry(rawData, surface.geometry);
             return surface;
         };
         ObjectDataParser.prototype._parseIKConstraint = function (rawData) {
@@ -12112,6 +12235,7 @@ var dragonBones;
             if (target === null) {
                 return null;
             }
+            var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0);
             var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintData);
             constraint.scaleEnabled = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.SCALE, false);
             constraint.bendPositive = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true);
@@ -12119,7 +12243,6 @@ var dragonBones;
             constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             constraint.type = 0 /* IK */;
             constraint.target = target;
-            var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0);
             if (chain > 0 && bone.parent !== null) {
                 constraint.root = bone.parent;
                 constraint.bone = bone;
@@ -12179,6 +12302,8 @@ var dragonBones;
             var slot = dragonBones.BaseObject.borrowObject(dragonBones.SlotData);
             slot.displayIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0);
             slot.zOrder = zOrder;
+            slot.zIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Z_INDEX, 0);
+            slot.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
             slot.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             slot.parent = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.PARENT, "")); //
             if (dragonBones.DataParser.BLEND_MODE in rawData && typeof rawData[dragonBones.DataParser.BLEND_MODE] === "string") {
@@ -12245,13 +12370,14 @@ var dragonBones;
                 type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, type);
             }
             switch (type) {
-                case 0 /* Image */:
+                case 0 /* Image */: {
                     var imageDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ImageDisplayData);
                     imageDisplay.name = name;
                     imageDisplay.path = path.length > 0 ? path : name;
                     this._parsePivot(rawData, imageDisplay);
                     break;
-                case 1 /* Armature */:
+                }
+                case 1 /* Armature */: {
                     var armatureDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureDisplayData);
                     armatureDisplay.name = name;
                     armatureDisplay.path = path.length > 0 ? path : name;
@@ -12274,25 +12400,23 @@ var dragonBones;
                         }
                     }
                     break;
-                case 2 /* Mesh */:
+                }
+                case 2 /* Mesh */: {
                     var meshDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.MeshDisplayData);
-                    meshDisplay.vertices.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true);
+                    meshDisplay.geometry.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true);
                     meshDisplay.name = name;
                     meshDisplay.path = path.length > 0 ? path : name;
-                    meshDisplay.vertices.data = this._data;
                     if (dragonBones.DataParser.SHARE in rawData) {
+                        meshDisplay.geometry.data = this._data;
                         this._cacheRawMeshes.push(rawData);
                         this._cacheMeshes.push(meshDisplay);
                     }
                     else {
                         this._parseMesh(rawData, meshDisplay);
                     }
-                    if ((dragonBones.DataParser.GLUE_WEIGHTS in rawData) && (dragonBones.DataParser.GLUE_MESHES in rawData)) {
-                        this._cacheRawMeshes.push(rawData);
-                        this._cacheMeshes.push(meshDisplay);
-                    }
                     break;
-                case 3 /* BoundingBox */:
+                }
+                case 3 /* BoundingBox */: {
                     var boundingBox = this._parseBoundingBox(rawData);
                     if (boundingBox !== null) {
                         var boundingBoxDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.BoundingBoxDisplayData);
@@ -12301,20 +12425,21 @@ var dragonBones;
                         boundingBoxDisplay.boundingBox = boundingBox;
                     }
                     break;
-                case 4 /* Path */:
+                }
+                case 4 /* Path */: {
                     var rawCurveLengths = rawData[dragonBones.DataParser.LENGTHS];
                     var pathDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.PathDisplayData);
                     pathDisplay.closed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CLOSED, false);
                     pathDisplay.constantSpeed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CONSTANT_SPEED, false);
                     pathDisplay.name = name;
                     pathDisplay.path = path.length > 0 ? path : name;
-                    pathDisplay.vertices.data = this._data;
                     pathDisplay.curveLengths.length = rawCurveLengths.length;
                     for (var i = 0, l = rawCurveLengths.length; i < l; ++i) {
                         pathDisplay.curveLengths[i] = rawCurveLengths[i];
                     }
                     this._parsePath(rawData, pathDisplay);
                     break;
+                }
             }
             if (display !== null && dragonBones.DataParser.TRANSFORM in rawData) {
                 this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], display.transform, this._armature.scale);
@@ -12322,58 +12447,7 @@ var dragonBones;
             return display;
         };
         ObjectDataParser.prototype._parsePath = function (rawData, display) {
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var vertexCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VERTEX_COUNT, 0); // uint
-            var vertexOffset = this._floatArray.length;
-            var pathOffset = this._intArray.length;
-            display.vertices.offset = pathOffset;
-            this._intArray.length += 1 + 1;
-            this._intArray[pathOffset + 0 /* PathVertexCount */] = vertexCount;
-            this._intArray[pathOffset + 2 /* PathFloatOffset */] = vertexOffset;
-            if (!(dragonBones.DataParser.WEIGHTS in rawData)) {
-                this._floatArray.length += rawVertices.length;
-                for (var i = 0, l = rawVertices.length; i < l; ++i) {
-                    this._floatArray[vertexOffset + i] = rawVertices[i];
-                }
-            }
-            else {
-                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
-                var rawBones = rawData[dragonBones.DataParser.BONES];
-                var weightBoneCount = rawBones.length;
-                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
-                var weightOffset = this._intArray.length;
-                var floatOffset = this._floatArray.length;
-                var sortedBones = this._armature.sortedBones;
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                weight.count = weightCount;
-                weight.offset = weightOffset;
-                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
-                //
-                this._intArray[weightOffset + 0 /* WeigthBoneCount */] = weightBoneCount;
-                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
-                for (var i = 0; i < weightBoneCount; i++) {
-                    var rawBoneIndex = rawBones[i];
-                    var bone = this._rawBones[rawBoneIndex];
-                    weight.addBone(bone);
-                    this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
-                }
-                this._floatArray.length += weightCount * 3;
-                for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) {
-                    var boneCount = rawWeights[iW++];
-                    this._intArray[iB++] = boneCount;
-                    for (var j = 0; j < boneCount; j++) {
-                        var boneIndex = rawWeights[iW++];
-                        var boneWeight = rawWeights[iW++];
-                        var x = rawVertices[iV++];
-                        var y = rawVertices[iV++];
-                        this._intArray[iB++] = rawBones.indexOf(boneIndex);
-                        this._floatArray[iF++] = boneWeight;
-                        this._floatArray[iF++] = x;
-                        this._floatArray[iF++] = y;
-                    }
-                }
-                display.vertices.weight = weight;
-            }
+            this._parseGeometry(rawData, display.geometry);
         };
         ObjectDataParser.prototype._parsePivot = function (rawData, display) {
             if (dragonBones.DataParser.PIVOT in rawData) {
@@ -12387,93 +12461,15 @@ var dragonBones;
             }
         };
         ObjectDataParser.prototype._parseMesh = function (rawData, mesh) {
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var rawUVs = rawData[dragonBones.DataParser.UVS];
-            var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES];
-            var vertexCount = Math.floor(rawVertices.length / 2); // uint
-            var triangleCount = Math.floor(rawTriangles.length / 3); // uint
-            var vertexOffset = this._floatArray.length;
-            var uvOffset = vertexOffset + vertexCount * 2;
-            var meshOffset = this._intArray.length;
-            var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; // Cache pose data.
-            mesh.vertices.offset = meshOffset;
-            this._intArray.length += 1 + 1 + 1 + 1 + triangleCount * 3;
-            this._intArray[meshOffset + 0 /* MeshVertexCount */] = vertexCount;
-            this._intArray[meshOffset + 1 /* MeshTriangleCount */] = triangleCount;
-            this._intArray[meshOffset + 2 /* MeshFloatOffset */] = vertexOffset;
-            for (var i = 0, l = triangleCount * 3; i < l; ++i) {
-                this._intArray[meshOffset + 4 /* MeshVertexIndices */ + i] = rawTriangles[i];
-            }
-            this._floatArray.length += vertexCount * 2 + vertexCount * 2;
-            for (var i = 0, l = vertexCount * 2; i < l; ++i) {
-                this._floatArray[vertexOffset + i] = rawVertices[i];
-                this._floatArray[uvOffset + i] = rawUVs[i];
-            }
+            this._parseGeometry(rawData, mesh.geometry);
             if (dragonBones.DataParser.WEIGHTS in rawData) {
-                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
                 var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE];
                 var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE];
-                var sortedBones = this._armature.sortedBones;
-                var weightBoneIndices = new Array();
-                var weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint
-                var floatOffset = this._floatArray.length;
-                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
-                var weightOffset = this._intArray.length;
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                weight.count = weightCount;
-                weight.offset = weightOffset;
-                weightBoneIndices.length = weightBoneCount;
-                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
-                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
-                for (var i = 0; i < weightBoneCount; ++i) {
-                    var rawBoneIndex = rawBonePoses[i * 7]; // uint
-                    var bone = this._rawBones[rawBoneIndex];
-                    weight.addBone(bone);
-                    weightBoneIndices[i] = rawBoneIndex;
-                    this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
-                }
-                this._floatArray.length += weightCount * 3;
-                this._helpMatrixA.copyFromArray(rawSlotPose, 0);
-                for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) {
-                    var iD = i * 2;
-                    var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint
-                    var x = this._floatArray[vertexOffset + iD];
-                    var y = this._floatArray[vertexOffset + iD + 1];
-                    this._helpMatrixA.transformPoint(x, y, this._helpPoint);
-                    x = this._helpPoint.x;
-                    y = this._helpPoint.y;
-                    for (var j = 0; j < vertexBoneCount; ++j) {
-                        var rawBoneIndex = rawWeights[iW++]; // uint
-                        var boneIndex = weightBoneIndices.indexOf(rawBoneIndex);
-                        this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1);
-                        this._helpMatrixB.invert();
-                        this._helpMatrixB.transformPoint(x, y, this._helpPoint);
-                        this._intArray[iB++] = boneIndex;
-                        this._floatArray[iV++] = rawWeights[iW++];
-                        this._floatArray[iV++] = this._helpPoint.x;
-                        this._floatArray[iV++] = this._helpPoint.y;
-                    }
-                }
-                mesh.vertices.weight = weight;
+                var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name;
                 this._weightSlotPose[meshName] = rawSlotPose;
                 this._weightBonePoses[meshName] = rawBonePoses;
             }
         };
-        ObjectDataParser.prototype._parseMeshGlue = function (rawData, mesh) {
-            rawData;
-            mesh;
-            // const rawWeights = rawData[DataParser.GLUE_WEIGHTS] as Array;
-            // const rawMeshes = rawData[DataParser.GLUE_MESHES] as Array;
-            // mesh.glue = BaseObject.borrowObject(GlueData);
-            // mesh.glue.weights.length = rawWeights.length;
-            // for (let i = 0, l = rawWeights.length; i < l; ++i) {
-            //     mesh.glue.weights[i] = rawWeights[i];
-            // }
-            // for (let i = 0, l = rawMeshes.length; i < l; i += 3) {
-            //     const glueMesh = this._armature.getMesh(rawMeshes[i], rawMeshes[i + 1], rawMeshes[i + 2]);
-            //     mesh.glue.addMesh(glueMesh);
-            // }
-        };
         ObjectDataParser.prototype._parseBoundingBox = function (rawData) {
             var boundingBox = null;
             var type = 0 /* Rectangle */;
@@ -12509,23 +12505,12 @@ var dragonBones;
                 var scale = this._armature.scale;
                 var rawVertices = rawData[dragonBones.DataParser.VERTICES];
                 var vertices = polygonBoundingBox.vertices;
-                if (dragonBones.DragonBones.webAssembly) {
-                    vertices.resize(rawVertices.length, 0.0);
-                }
-                else {
-                    vertices.length = rawVertices.length;
-                }
+                vertices.length = rawVertices.length;
                 for (var i = 0, l = rawVertices.length; i < l; i += 2) {
                     var x = rawVertices[i] * scale;
                     var y = rawVertices[i + 1] * scale;
-                    if (dragonBones.DragonBones.webAssembly) {
-                        vertices.set(i, x);
-                        vertices.set(i + 1, y);
-                    }
-                    else {
-                        vertices[i] = x;
-                        vertices[i + 1] = y;
-                    }
+                    vertices[i] = x;
+                    vertices[i + 1] = y;
                     // AABB.
                     if (i === 0) {
                         polygonBoundingBox.x = x;
@@ -12558,7 +12543,8 @@ var dragonBones;
         };
         ObjectDataParser.prototype._parseAnimation = function (rawData) {
             var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData);
-            animation.frameCount = Math.max(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 1), 1);
+            animation.blendType = dragonBones.DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, ""));
+            animation.frameCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0);
             animation.playTimes = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1);
             animation.duration = animation.frameCount / this._armature.frameRate; // float
             animation.fadeInTime = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0);
@@ -12583,7 +12569,7 @@ var dragonBones;
                 }
             }
             if (dragonBones.DataParser.Z_ORDER in rawData) {
-                this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, false, false, 0, this._parseZOrderFrame);
+                this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, 0 /* Step */, 0, this._parseZOrderFrame);
             }
             if (dragonBones.DataParser.BONE in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.BONE];
@@ -12592,33 +12578,17 @@ var dragonBones;
                     this._parseBoneTimeline(rawTimeline);
                 }
             }
-            if (dragonBones.DataParser.SURFACE in rawData) {
-                var rawTimelines = rawData[dragonBones.DataParser.SURFACE];
-                for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) {
-                    var rawTimeline = rawTimelines_2[_a];
-                    var surfaceName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
-                    this._surface = this._armature.getBone(surfaceName);
-                    if (this._surface === null) {
-                        continue;
-                    }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 50 /* Surface */, false, true, 0, this._parseSurfaceFrame);
-                    if (timeline !== null) {
-                        this._animation.addSurfaceTimeline(this._surface, timeline);
-                    }
-                    this._surface = null; //
-                }
-            }
             if (dragonBones.DataParser.SLOT in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.SLOT];
-                for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) {
-                    var rawTimeline = rawTimelines_3[_b];
+                for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) {
+                    var rawTimeline = rawTimelines_2[_a];
                     this._parseSlotTimeline(rawTimeline);
                 }
             }
             if (dragonBones.DataParser.FFD in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.FFD];
-                for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) {
-                    var rawTimeline = rawTimelines_4[_c];
+                for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) {
+                    var rawTimeline = rawTimelines_3[_b];
                     var skinName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME);
                     var slotName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SLOT, "");
                     var displayName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
@@ -12630,9 +12600,9 @@ var dragonBones;
                     if (this._slot === null || this._mesh === null) {
                         continue;
                     }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, false, true, 0, this._parseSlotFFDFrame);
+                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, 2 /* Float */, 0, this._parseSlotDeformFrame);
                     if (timeline !== null) {
-                        this._animation.addSlotTimeline(this._slot, timeline);
+                        this._animation.addSlotTimeline(slotName, timeline);
                     }
                     this._slot = null; //
                     this._mesh = null; //
@@ -12640,38 +12610,184 @@ var dragonBones;
             }
             if (dragonBones.DataParser.IK in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.IK];
-                for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) {
-                    var rawTimeline = rawTimelines_5[_d];
+                for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) {
+                    var rawTimeline = rawTimelines_4[_c];
                     var constraintName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
                     var constraint = this._armature.getConstraint(constraintName);
                     if (constraint === null) {
                         continue;
                     }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, true, false, 2, this._parseIKConstraintFrame);
+                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, 1 /* Int */, 2, this._parseIKConstraintFrame);
                     if (timeline !== null) {
-                        this._animation.addConstraintTimeline(constraint, timeline);
+                        this._animation.addConstraintTimeline(constraintName, timeline);
                     }
                 }
             }
-            if (dragonBones.DataParser.ANIMATION in rawData) {
-                var rawTimelines = rawData[dragonBones.DataParser.ANIMATION];
-                for (var _e = 0, rawTimelines_6 = rawTimelines; _e < rawTimelines_6.length; _e++) {
-                    var rawTimeline = rawTimelines_6[_e];
-                    var animationName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 40 /* AnimationTime */, true, false, 2, this._parseAnimationFrame);
+            if (this._actionFrames.length > 0) {
+                this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, 0 /* Step */, 0, this._parseActionFrame);
+                this._actionFrames.length = 0;
+            }
+            if (dragonBones.DataParser.TIMELINE in rawData) {
+                var rawTimelines = rawData[dragonBones.DataParser.TIMELINE];
+                for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) {
+                    var rawTimeline = rawTimelines_5[_d];
+                    var timelineType = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */);
+                    var timelineName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
+                    var timeline = null;
+                    switch (timelineType) {
+                        case 0 /* Action */:
+                            // TODO
+                            break;
+                        case 20 /* SlotDisplay */: // TODO
+                        case 23 /* SlotZIndex */:
+                        case 60 /* BoneAlpha */:
+                        case 24 /* SlotAlpha */:
+                        case 40 /* AnimationProgress */:
+                        case 41 /* AnimationWeight */:
+                            if (timelineType === 20 /* SlotDisplay */) {
+                                this._frameValueType = 0 /* Step */;
+                                this._frameValueScale = 1.0;
+                            }
+                            else {
+                                this._frameValueType = 1 /* Int */;
+                                if (timelineType === 23 /* SlotZIndex */) {
+                                    this._frameValueScale = 1.0;
+                                }
+                                else if (timelineType === 40 /* AnimationProgress */ ||
+                                    timelineType === 41 /* AnimationWeight */) {
+                                    this._frameValueScale = 10000.0;
+                                }
+                                else {
+                                    this._frameValueScale = 100.0;
+                                }
+                            }
+                            if (timelineType === 60 /* BoneAlpha */ ||
+                                timelineType === 24 /* SlotAlpha */ ||
+                                timelineType === 41 /* AnimationWeight */) {
+                                this._frameDefaultValue = 1.0;
+                            }
+                            else {
+                                this._frameDefaultValue = 0.0;
+                            }
+                            if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) {
+                                timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData);
+                                var animaitonTimeline = timeline;
+                                animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0);
+                                animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0);
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 1, this._parseSingleValueFrame, timeline);
+                            break;
+                        case 11 /* BoneTranslate */:
+                        case 12 /* BoneRotate */:
+                        case 13 /* BoneScale */:
+                        case 30 /* IKConstraint */:
+                        case 42 /* AnimationParameter */:
+                            if (timelineType === 30 /* IKConstraint */ ||
+                                timelineType === 42 /* AnimationParameter */) {
+                                this._frameValueType = 1 /* Int */;
+                                if (timelineType === 42 /* AnimationParameter */) {
+                                    this._frameValueScale = 10000.0;
+                                }
+                                else {
+                                    this._frameValueScale = 100.0;
+                                }
+                            }
+                            else {
+                                if (timelineType === 12 /* BoneRotate */) {
+                                    this._frameValueScale = dragonBones.Transform.DEG_RAD;
+                                }
+                                else {
+                                    this._frameValueScale = 1.0;
+                                }
+                                this._frameValueType = 2 /* Float */;
+                            }
+                            if (timelineType === 13 /* BoneScale */ ||
+                                timelineType === 30 /* IKConstraint */) {
+                                this._frameDefaultValue = 1.0;
+                            }
+                            else {
+                                this._frameDefaultValue = 0.0;
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 2, this._parseDoubleValueFrame);
+                            break;
+                        case 1 /* ZOrder */:
+                            // TODO
+                            break;
+                        case 50 /* Surface */: {
+                            var surface = this._armature.getBone(timelineName);
+                            if (surface === null) {
+                                continue;
+                            }
+                            this._geometry = surface.geometry;
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame);
+                            this._geometry = null; //
+                            break;
+                        }
+                        case 22 /* SlotDeform */: {
+                            this._geometry = null; //
+                            for (var skinName in this._armature.skins) {
+                                var skin = this._armature.skins[skinName];
+                                for (var slontName in skin.displays) {
+                                    var displays = skin.displays[slontName];
+                                    for (var _e = 0, displays_1 = displays; _e < displays_1.length; _e++) {
+                                        var display = displays_1[_e];
+                                        if (display !== null && display.name === timelineName) {
+                                            this._geometry = display.geometry;
+                                            break;
+                                        }
+                                    }
+                                }
+                            }
+                            if (this._geometry === null) {
+                                continue;
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame);
+                            this._geometry = null; //
+                            break;
+                        }
+                        case 21 /* SlotColor */:
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 1 /* Int */, 1, this._parseSlotColorFrame);
+                            break;
+                    }
                     if (timeline !== null) {
-                        this._animation.addAnimationTimeline(animationName, timeline);
+                        switch (timelineType) {
+                            case 0 /* Action */:
+                                // TODO
+                                break;
+                            case 1 /* ZOrder */:
+                                // TODO
+                                break;
+                            case 11 /* BoneTranslate */:
+                            case 12 /* BoneRotate */:
+                            case 13 /* BoneScale */:
+                            case 50 /* Surface */:
+                            case 60 /* BoneAlpha */:
+                                this._animation.addBoneTimeline(timelineName, timeline);
+                                break;
+                            case 20 /* SlotDisplay */:
+                            case 21 /* SlotColor */:
+                            case 22 /* SlotDeform */:
+                            case 23 /* SlotZIndex */:
+                            case 24 /* SlotAlpha */:
+                                this._animation.addSlotTimeline(timelineName, timeline);
+                                break;
+                            case 30 /* IKConstraint */:
+                                this._animation.addConstraintTimeline(timelineName, timeline);
+                                break;
+                            case 40 /* AnimationProgress */:
+                            case 41 /* AnimationWeight */:
+                            case 42 /* AnimationParameter */:
+                                this._animation.addAnimationTimeline(timelineName, timeline);
+                                break;
+                        }
                     }
                 }
             }
-            if (this._actionFrames.length > 0) {
-                this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, false, false, 0, this._parseActionFrame);
-                this._actionFrames.length = 0;
-            }
             this._animation = null; //
             return animation;
         };
-        ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, type, addIntOffset, addFloatOffset, frameValueCount, frameParser) {
+        ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, timelineType, frameValueType, frameValueCount, frameParser, timeline) {
+            if (timeline === void 0) { timeline = null; }
             if (rawData !== null && framesKey.length > 0 && framesKey in rawData) {
                 rawFrames = rawData[framesKey];
             }
@@ -12684,8 +12800,14 @@ var dragonBones;
             }
             var frameIntArrayLength = this._frameIntArray.length;
             var frameFloatArrayLength = this._frameFloatArray.length;
-            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
             var timelineOffset = this._timelineArray.length;
+            if (timeline === null) {
+                timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
+            }
+            timeline.type = timelineType;
+            timeline.offset = timelineOffset;
+            this._frameValueType = frameValueType;
+            this._timeline = timeline;
             this._timelineArray.length += 1 + 1 + 1 + 1 + 1 + keyFrameCount;
             if (rawData !== null) {
                 this._timelineArray[timelineOffset + 0 /* TimelineScale */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0) * 100);
@@ -12697,18 +12819,17 @@ var dragonBones;
             }
             this._timelineArray[timelineOffset + 2 /* TimelineKeyFrameCount */] = keyFrameCount;
             this._timelineArray[timelineOffset + 3 /* TimelineFrameValueCount */] = frameValueCount;
-            if (addIntOffset) {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset;
-            }
-            else if (addFloatOffset) {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset;
-            }
-            else {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0;
+            switch (this._frameValueType) {
+                case 0 /* Step */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0;
+                    break;
+                case 1 /* Int */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset;
+                    break;
+                case 2 /* Float */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset;
+                    break;
             }
-            this._timeline = timeline;
-            timeline.type = type;
-            timeline.offset = timelineOffset;
             if (keyFrameCount === 1) {
                 timeline.frameIndicesOffset = -1;
                 this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + 0] = frameParser.call(this, rawFrames[0], 0, 0) - this._animation.frameOffset;
@@ -12716,15 +12837,8 @@ var dragonBones;
             else {
                 var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation.
                 var frameIndices = this._data.frameIndices;
-                var frameIndicesOffset = 0;
-                if (dragonBones.DragonBones.webAssembly) {
-                    frameIndicesOffset = frameIndices.size();
-                    frameIndices.resize(frameIndicesOffset + totalFrameCount, 0);
-                }
-                else {
-                    frameIndicesOffset = frameIndices.length;
-                    frameIndices.length += totalFrameCount;
-                }
+                var frameIndicesOffset = frameIndices.length;
+                frameIndices.length += totalFrameCount;
                 timeline.frameIndicesOffset = frameIndicesOffset;
                 for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) {
                     if (frameStart + frameCount <= i && iK < keyFrameCount) {
@@ -12744,12 +12858,7 @@ var dragonBones;
                         this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + iK] = frameParser.call(this, rawFrame, frameStart, frameCount) - this._animation.frameOffset;
                         iK++;
                     }
-                    if (dragonBones.DragonBones.webAssembly) {
-                        frameIndices.set(frameIndicesOffset + i, iK - 1);
-                    }
-                    else {
-                        frameIndices[frameIndicesOffset + i] = iK - 1;
-                    }
+                    frameIndices[frameIndicesOffset + i] = iK - 1;
                 }
             }
             this._timeline = null; //
@@ -12763,27 +12872,33 @@ var dragonBones;
             this._bone = bone;
             this._slot = this._armature.getSlot(this._bone.name);
             if (dragonBones.DataParser.TRANSLATE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, false, true, 2, this._parseBoneTranslateFrame);
+                this._frameDefaultValue = 0.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, 2 /* Float */, 2, this._parseDoubleValueFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.ROTATE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, false, true, 2, this._parseBoneRotateFrame);
+                this._frameDefaultValue = 0.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, 2 /* Float */, 2, this._parseBoneRotateFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.SCALE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, false, true, 2, this._parseBoneScaleFrame);
+                this._frameDefaultValue = 1.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, 2 /* Float */, 2, this._parseBoneScaleFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, false, true, 6, this._parseBoneAllFrame);
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, 2 /* Float */, 6, this._parseBoneAllFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             this._bone = null; //
@@ -12794,27 +12909,26 @@ var dragonBones;
             if (slot === null) {
                 return;
             }
-            this._slot = slot;
-            // Display timeline.
             var displayTimeline = null;
+            var colorTimeline = null;
+            this._slot = slot;
             if (dragonBones.DataParser.DISPLAY_FRAME in rawData) {
-                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, false, false, 0, this._parseSlotDisplayFrame);
+                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame);
             }
             else {
-                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, false, false, 0, this._parseSlotDisplayFrame);
-            }
-            if (displayTimeline !== null) {
-                this._animation.addSlotTimeline(slot, displayTimeline);
+                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame);
             }
-            var colorTimeline = null;
             if (dragonBones.DataParser.COLOR_FRAME in rawData) {
-                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, true, false, 1, this._parseSlotColorFrame);
+                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame);
             }
             else {
-                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, true, false, 1, this._parseSlotColorFrame);
+                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame);
+            }
+            if (displayTimeline !== null) {
+                this._animation.addSlotTimeline(slot.name, displayTimeline);
             }
             if (colorTimeline !== null) {
-                this._animation.addSlotTimeline(slot, colorTimeline);
+                this._animation.addSlotTimeline(slot.name, colorTimeline);
             }
             this._slot = null; //
         };
@@ -12834,10 +12948,10 @@ var dragonBones;
                 if (dragonBones.DataParser.CURVE in rawData) {
                     var sampleCount = frameCount + 1;
                     this._helpArray.length = sampleCount;
-                    this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray);
+                    var isOmited = this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray);
                     this._frameArray.length += 1 + 1 + this._helpArray.length;
                     this._frameArray[frameOffset + 1 /* FrameTweenType */] = 2 /* Curve */;
-                    this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = sampleCount;
+                    this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = isOmited ? sampleCount : -sampleCount;
                     for (var i = 0; i < sampleCount; ++i) {
                         this._frameArray[frameOffset + 3 /* FrameCurveSamples */ + i] = Math.round(this._helpArray[i] * 10000.0);
                     }
@@ -12879,6 +12993,61 @@ var dragonBones;
             }
             return frameOffset;
         };
+        ObjectDataParser.prototype._parseSingleValueFrame = function (rawData, frameStart, frameCount) {
+            var frameOffset = 0;
+            switch (this._frameValueType) {
+                case 0: {
+                    frameOffset = this._parseFrame(rawData, frameStart, frameCount);
+                    this._frameArray.length += 1;
+                    this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue);
+                    break;
+                }
+                case 1: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameIntArray.length;
+                    this._frameIntArray.length += 1;
+                    this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale);
+                    break;
+                }
+                case 2: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameFloatArray.length;
+                    this._frameFloatArray.length += 1;
+                    this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale;
+                    break;
+                }
+            }
+            return frameOffset;
+        };
+        ObjectDataParser.prototype._parseDoubleValueFrame = function (rawData, frameStart, frameCount) {
+            var frameOffset = 0;
+            switch (this._frameValueType) {
+                case 0: {
+                    frameOffset = this._parseFrame(rawData, frameStart, frameCount);
+                    this._frameArray.length += 2;
+                    this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue);
+                    this._frameArray[frameOffset + 2] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue);
+                    break;
+                }
+                case 1: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameIntArray.length;
+                    this._frameIntArray.length += 2;
+                    this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale);
+                    this._frameIntArray[frameValueOffset + 1] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale);
+                    break;
+                }
+                case 2: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameFloatArray.length;
+                    this._frameFloatArray.length += 2;
+                    this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale;
+                    this._frameFloatArray[frameValueOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale;
+                    break;
+                }
+            }
+            return frameOffset;
+        };
         ObjectDataParser.prototype._parseActionFrame = function (frame, frameStart, frameCount) {
             // tslint:disable-next-line:no-unused-expression
             frameCount;
@@ -12993,59 +13162,22 @@ var dragonBones;
                     rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise;
                 }
             }
-            this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CLOCK_WISE, 0);
-            this._prevRotation = rotation;
-            //
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var frameFloatOffset = this._frameFloatArray.length;
-            this._frameFloatArray.length += 2;
-            this._frameFloatArray[frameFloatOffset++] = rotation;
-            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD;
-            return frameOffset;
-        };
-        ObjectDataParser.prototype._parseBoneScaleFrame = function (rawData, frameStart, frameCount) {
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var frameFloatOffset = this._frameFloatArray.length;
-            this._frameFloatArray.length += 2;
-            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 1.0);
-            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0);
-            return frameOffset;
-        };
-        ObjectDataParser.prototype._parseSurfaceFrame = function (rawData, frameStart, frameCount) {
-            var frameFloatOffset = this._frameFloatArray.length;
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
-            var vertexCount = this._surface.vertices.length / 2; // uint
-            var x = 0.0;
-            var y = 0.0;
-            this._frameFloatArray.length += vertexCount * 2;
-            for (var i = 0; i < vertexCount * 2; i += 2) {
-                if (i < offset || i - offset >= rawVertices.length) {
-                    x = 0.0;
-                }
-                else {
-                    x = rawVertices[i - offset];
-                }
-                if (i + 1 < offset || i + 1 - offset >= rawVertices.length) {
-                    y = 0.0;
-                }
-                else {
-                    y = rawVertices[i + 1 - offset];
-                }
-                this._frameFloatArray[frameFloatOffset + i] = x;
-                this._frameFloatArray[frameFloatOffset + i + 1] = y;
-            }
-            if (frameStart === 0) {
-                var frameIntOffset = this._frameIntArray.length;
-                this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
-                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = 0; // 
-                this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
-                this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
-                this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
-                this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset;
-                this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset;
-            }
+            this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CLOCK_WISE, 0);
+            this._prevRotation = rotation;
+            //
+            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+            var frameFloatOffset = this._frameFloatArray.length;
+            this._frameFloatArray.length += 2;
+            this._frameFloatArray[frameFloatOffset++] = rotation;
+            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD;
+            return frameOffset;
+        };
+        ObjectDataParser.prototype._parseBoneScaleFrame = function (rawData, frameStart, frameCount) {
+            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+            var frameFloatOffset = this._frameFloatArray.length;
+            this._frameFloatArray.length += 2;
+            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 1.0);
+            this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0);
             return frameOffset;
         };
         ObjectDataParser.prototype._parseSlotDisplayFrame = function (rawData, frameStart, frameCount) {
@@ -13069,32 +13201,32 @@ var dragonBones;
                     // tslint:disable-next-line:no-unused-expression
                     k;
                     this._parseColorTransform(rawColor, this._helpColorTransform);
-                    colorOffset = this._intArray.length;
-                    this._intArray.length += 8;
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset);
+                    colorOffset = this._colorArray.length;
+                    this._colorArray.length += 8;
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset);
                     colorOffset -= 8;
                     break;
                 }
             }
             if (colorOffset < 0) {
                 if (this._defaultColorOffset < 0) {
-                    this._defaultColorOffset = colorOffset = this._intArray.length;
-                    this._intArray.length += 8;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
+                    this._defaultColorOffset = colorOffset = this._colorArray.length;
+                    this._colorArray.length += 8;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
                 }
                 colorOffset = this._defaultColorOffset;
             }
@@ -13103,14 +13235,14 @@ var dragonBones;
             this._frameIntArray[frameIntOffset] = colorOffset;
             return frameOffset;
         };
-        ObjectDataParser.prototype._parseSlotFFDFrame = function (rawData, frameStart, frameCount) {
+        ObjectDataParser.prototype._parseSlotDeformFrame = function (rawData, frameStart, frameCount) {
             var frameFloatOffset = this._frameFloatArray.length;
             var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
             var rawVertices = dragonBones.DataParser.VERTICES in rawData ? rawData[dragonBones.DataParser.VERTICES] : null;
             var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
-            var vertexCount = this._intArray[this._mesh.vertices.offset + 0 /* MeshVertexCount */];
+            var vertexCount = this._intArray[this._mesh.geometry.offset + 0 /* GeometryVertexCount */];
             var meshName = this._mesh.parent.name + "_" + this._slot.name + "_" + this._mesh.name;
-            var weight = this._mesh.vertices.weight;
+            var weight = this._mesh.geometry.weight;
             var x = 0.0;
             var y = 0.0;
             var iB = 0;
@@ -13166,7 +13298,7 @@ var dragonBones;
             if (frameStart === 0) {
                 var frameIntOffset = this._frameIntArray.length;
                 this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
-                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.vertices.offset;
+                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.geometry.offset;
                 this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
                 this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
                 this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
@@ -13183,14 +13315,6 @@ var dragonBones;
             this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0);
             return frameOffset;
         };
-        ObjectDataParser.prototype._parseAnimationFrame = function (rawData, frameStart, frameCount) {
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var frameIntOffset = this._frameIntArray.length;
-            this._frameIntArray.length += 2;
-            this._frameIntArray[frameIntOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, 0);
-            this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0);
-            return frameOffset;
-        };
         ObjectDataParser.prototype._parseActionData = function (rawData, type, bone, slot) {
             var actions = new Array();
             if (typeof rawData === "string") {
@@ -13269,6 +13393,57 @@ var dragonBones;
             }
             return actions;
         };
+        ObjectDataParser.prototype._parseDeformFrame = function (rawData, frameStart, frameCount) {
+            var frameFloatOffset = this._frameFloatArray.length;
+            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+            var rawVertices = dragonBones.DataParser.VERTICES in rawData ?
+                rawData[dragonBones.DataParser.VERTICES] :
+                (dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : null);
+            var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
+            var vertexCount = this._intArray[this._geometry.offset + 0 /* GeometryVertexCount */];
+            var weight = this._geometry.weight;
+            var x = 0.0;
+            var y = 0.0;
+            if (weight !== null) {
+                // TODO
+            }
+            else {
+                this._frameFloatArray.length += vertexCount * 2;
+                for (var i = 0; i < vertexCount * 2; i += 2) {
+                    if (rawVertices !== null) {
+                        if (i < offset || i - offset >= rawVertices.length) {
+                            x = 0.0;
+                        }
+                        else {
+                            x = rawVertices[i - offset];
+                        }
+                        if (i + 1 < offset || i + 1 - offset >= rawVertices.length) {
+                            y = 0.0;
+                        }
+                        else {
+                            y = rawVertices[i + 1 - offset];
+                        }
+                    }
+                    else {
+                        x = 0.0;
+                        y = 0.0;
+                    }
+                    this._frameFloatArray[frameFloatOffset + i] = x;
+                    this._frameFloatArray[frameFloatOffset + i + 1] = y;
+                }
+            }
+            if (frameStart === 0) {
+                var frameIntOffset = this._frameIntArray.length;
+                this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
+                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._geometry.offset;
+                this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
+                this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
+                this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
+                this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset;
+                this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset;
+            }
+            return frameOffset;
+        };
         ObjectDataParser.prototype._parseTransform = function (rawData, transform, scale) {
             transform.x = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0) * scale;
             transform.y = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0) * scale;
@@ -13293,6 +13468,120 @@ var dragonBones;
             color.greenOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_OFFSET, 0);
             color.blueOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_OFFSET, 0);
         };
+        ObjectDataParser.prototype._parseGeometry = function (rawData, geometry) {
+            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
+            var vertexCount = Math.floor(rawVertices.length / 2); // uint
+            var triangleCount = 0;
+            var geometryOffset = this._intArray.length;
+            var verticesOffset = this._floatArray.length;
+            //
+            geometry.offset = geometryOffset;
+            geometry.data = this._data;
+            //
+            this._intArray.length += 1 + 1 + 1 + 1;
+            this._intArray[geometryOffset + 0 /* GeometryVertexCount */] = vertexCount;
+            this._intArray[geometryOffset + 2 /* GeometryFloatOffset */] = verticesOffset;
+            this._intArray[geometryOffset + 3 /* GeometryWeightOffset */] = -1; //
+            // 
+            this._floatArray.length += vertexCount * 2;
+            for (var i = 0, l = vertexCount * 2; i < l; ++i) {
+                this._floatArray[verticesOffset + i] = rawVertices[i];
+            }
+            if (dragonBones.DataParser.TRIANGLES in rawData) {
+                var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES];
+                triangleCount = Math.floor(rawTriangles.length / 3); // uint
+                //
+                this._intArray.length += triangleCount * 3;
+                for (var i = 0, l = triangleCount * 3; i < l; ++i) {
+                    this._intArray[geometryOffset + 4 /* GeometryVertexIndices */ + i] = rawTriangles[i];
+                }
+            }
+            // Fill triangle count.
+            this._intArray[geometryOffset + 1 /* GeometryTriangleCount */] = triangleCount;
+            if (dragonBones.DataParser.UVS in rawData) {
+                var rawUVs = rawData[dragonBones.DataParser.UVS];
+                var uvOffset = verticesOffset + vertexCount * 2;
+                this._floatArray.length += vertexCount * 2;
+                for (var i = 0, l = vertexCount * 2; i < l; ++i) {
+                    this._floatArray[uvOffset + i] = rawUVs[i];
+                }
+            }
+            if (dragonBones.DataParser.WEIGHTS in rawData) {
+                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
+                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
+                var weightOffset = this._intArray.length;
+                var floatOffset = this._floatArray.length;
+                var weightBoneCount = 0;
+                var sortedBones = this._armature.sortedBones;
+                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
+                weight.count = weightCount;
+                weight.offset = weightOffset;
+                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
+                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
+                if (dragonBones.DataParser.BONE_POSE in rawData) {
+                    var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE];
+                    var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE];
+                    var weightBoneIndices = new Array();
+                    weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint
+                    weightBoneIndices.length = weightBoneCount;
+                    for (var i = 0; i < weightBoneCount; ++i) {
+                        var rawBoneIndex = rawBonePoses[i * 7]; // uint
+                        var bone = this._rawBones[rawBoneIndex];
+                        weight.addBone(bone);
+                        weightBoneIndices[i] = rawBoneIndex;
+                        this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
+                    }
+                    this._floatArray.length += weightCount * 3;
+                    this._helpMatrixA.copyFromArray(rawSlotPose, 0);
+                    for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) {
+                        var iD = i * 2;
+                        var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint
+                        var x = this._floatArray[verticesOffset + iD];
+                        var y = this._floatArray[verticesOffset + iD + 1];
+                        this._helpMatrixA.transformPoint(x, y, this._helpPoint);
+                        x = this._helpPoint.x;
+                        y = this._helpPoint.y;
+                        for (var j = 0; j < vertexBoneCount; ++j) {
+                            var rawBoneIndex = rawWeights[iW++]; // uint
+                            var boneIndex = weightBoneIndices.indexOf(rawBoneIndex);
+                            this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1);
+                            this._helpMatrixB.invert();
+                            this._helpMatrixB.transformPoint(x, y, this._helpPoint);
+                            this._intArray[iB++] = boneIndex;
+                            this._floatArray[iV++] = rawWeights[iW++];
+                            this._floatArray[iV++] = this._helpPoint.x;
+                            this._floatArray[iV++] = this._helpPoint.y;
+                        }
+                    }
+                }
+                else {
+                    var rawBones = rawData[dragonBones.DataParser.BONES];
+                    weightBoneCount = rawBones.length;
+                    for (var i = 0; i < weightBoneCount; i++) {
+                        var rawBoneIndex = rawBones[i];
+                        var bone = this._rawBones[rawBoneIndex];
+                        weight.addBone(bone);
+                        this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
+                    }
+                    this._floatArray.length += weightCount * 3;
+                    for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) {
+                        var vertexBoneCount = rawWeights[iW++];
+                        this._intArray[iB++] = vertexBoneCount;
+                        for (var j = 0; j < vertexBoneCount; j++) {
+                            var boneIndex = rawWeights[iW++];
+                            var boneWeight = rawWeights[iW++];
+                            var x = rawVertices[iV++];
+                            var y = rawVertices[iV++];
+                            this._intArray[iB++] = rawBones.indexOf(boneIndex);
+                            this._floatArray[iF++] = boneWeight;
+                            this._floatArray[iF++] = x;
+                            this._floatArray[iF++] = y;
+                        }
+                    }
+                }
+                geometry.weight = weight;
+            }
+        };
         ObjectDataParser.prototype._parseArray = function (rawData) {
             // tslint:disable-next-line:no-unused-expression
             rawData;
@@ -13302,6 +13591,7 @@ var dragonBones;
             this._frameFloatArray.length = 0;
             this._frameArray.length = 0;
             this._timelineArray.length = 0;
+            this._colorArray.length = 0;
         };
         ObjectDataParser.prototype._modifyArray = function () {
             // Align.
@@ -13317,76 +13607,55 @@ var dragonBones;
             if ((this._timelineArray.length % Uint16Array.BYTES_PER_ELEMENT) !== 0) {
                 this._timelineArray.push(0);
             }
+            if ((this._timelineArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) {
+                this._colorArray.push(0);
+            }
             var l1 = this._intArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l2 = this._floatArray.length * Float32Array.BYTES_PER_ELEMENT;
             var l3 = this._frameIntArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l4 = this._frameFloatArray.length * Float32Array.BYTES_PER_ELEMENT;
             var l5 = this._frameArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l6 = this._timelineArray.length * Uint16Array.BYTES_PER_ELEMENT;
-            var lTotal = l1 + l2 + l3 + l4 + l5 + l6;
-            if (dragonBones.DragonBones.webAssembly) {
-                var shareBuffer = dragonBones.webAssemblyModule.HEAP16.buffer;
-                var bufferPointer = dragonBones.webAssemblyModule._malloc(lTotal);
-                var intArray = new Int16Array(shareBuffer, bufferPointer, this._intArray.length);
-                var floatArray = new Float32Array(shareBuffer, bufferPointer + l1, this._floatArray.length);
-                var frameIntArray = new Int16Array(shareBuffer, bufferPointer + l1 + l2, this._frameIntArray.length);
-                var frameFloatArray = new Float32Array(shareBuffer, bufferPointer + l1 + l2 + l3, this._frameFloatArray.length);
-                var frameArray = new Int16Array(shareBuffer, bufferPointer + l1 + l2 + l3 + l4, this._frameArray.length);
-                var timelineArray = new Uint16Array(shareBuffer, bufferPointer + l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
-                for (var i = 0, l = this._intArray.length; i < l; ++i) {
-                    intArray[i] = this._intArray[i];
-                }
-                for (var i = 0, l = this._floatArray.length; i < l; ++i) {
-                    floatArray[i] = this._floatArray[i];
-                }
-                for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
-                    frameIntArray[i] = this._frameIntArray[i];
-                }
-                for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
-                    frameFloatArray[i] = this._frameFloatArray[i];
-                }
-                for (var i = 0, l = this._frameArray.length; i < l; ++i) {
-                    frameArray[i] = this._frameArray[i];
-                }
-                for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
-                    timelineArray[i] = this._timelineArray[i];
-                }
-                dragonBones.webAssemblyModule.setDataBinary(this._data, bufferPointer, l1, l2, l3, l4, l5, l6);
-            }
-            else {
-                var binary = new ArrayBuffer(lTotal);
-                var intArray = new Int16Array(binary, 0, this._intArray.length);
-                var floatArray = new Float32Array(binary, l1, this._floatArray.length);
-                var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length);
-                var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length);
-                var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length);
-                var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
-                for (var i = 0, l = this._intArray.length; i < l; ++i) {
-                    intArray[i] = this._intArray[i];
-                }
-                for (var i = 0, l = this._floatArray.length; i < l; ++i) {
-                    floatArray[i] = this._floatArray[i];
-                }
-                for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
-                    frameIntArray[i] = this._frameIntArray[i];
-                }
-                for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
-                    frameFloatArray[i] = this._frameFloatArray[i];
-                }
-                for (var i = 0, l = this._frameArray.length; i < l; ++i) {
-                    frameArray[i] = this._frameArray[i];
-                }
-                for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
-                    timelineArray[i] = this._timelineArray[i];
-                }
-                this._data.binary = binary;
-                this._data.intArray = intArray;
-                this._data.floatArray = floatArray;
-                this._data.frameIntArray = frameIntArray;
-                this._data.frameFloatArray = frameFloatArray;
-                this._data.frameArray = frameArray;
-                this._data.timelineArray = timelineArray;
-            }
+            var l7 = this._colorArray.length * Int16Array.BYTES_PER_ELEMENT;
+            var lTotal = l1 + l2 + l3 + l4 + l5 + l6 + l7;
+            //
+            var binary = new ArrayBuffer(lTotal);
+            var intArray = new Int16Array(binary, 0, this._intArray.length);
+            var floatArray = new Float32Array(binary, l1, this._floatArray.length);
+            var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length);
+            var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length);
+            var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length);
+            var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
+            var colorArray = new Int16Array(binary, l1 + l2 + l3 + l4 + l5 + l6, this._colorArray.length);
+            for (var i = 0, l = this._intArray.length; i < l; ++i) {
+                intArray[i] = this._intArray[i];
+            }
+            for (var i = 0, l = this._floatArray.length; i < l; ++i) {
+                floatArray[i] = this._floatArray[i];
+            }
+            for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
+                frameIntArray[i] = this._frameIntArray[i];
+            }
+            for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
+                frameFloatArray[i] = this._frameFloatArray[i];
+            }
+            for (var i = 0, l = this._frameArray.length; i < l; ++i) {
+                frameArray[i] = this._frameArray[i];
+            }
+            for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
+                timelineArray[i] = this._timelineArray[i];
+            }
+            for (var i = 0, l = this._colorArray.length; i < l; ++i) {
+                colorArray[i] = this._colorArray[i];
+            }
+            this._data.binary = binary;
+            this._data.intArray = intArray;
+            this._data.floatArray = floatArray;
+            this._data.frameIntArray = frameIntArray;
+            this._data.frameFloatArray = frameFloatArray;
+            this._data.frameArray = frameArray;
+            this._data.timelineArray = timelineArray;
+            this._data.colorArray = colorArray;
             this._defaultColorOffset = -1;
         };
         ObjectDataParser.prototype.parseDragonBonesData = function (rawData, scale) {
@@ -13459,6 +13728,8 @@ var dragonBones;
                 var rawTextures = rawData[dragonBones.DataParser.SUB_TEXTURE];
                 for (var i = 0, l = rawTextures.length; i < l; ++i) {
                     var rawTexture = rawTextures[i];
+                    var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0);
+                    var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0);
                     var textureData = textureAtlasData.createTexture();
                     textureData.rotated = ObjectDataParser._getBoolean(rawTexture, dragonBones.DataParser.ROTATED, false);
                     textureData.name = ObjectDataParser._getString(rawTexture, dragonBones.DataParser.NAME, "");
@@ -13466,8 +13737,6 @@ var dragonBones;
                     textureData.region.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.Y, 0.0);
                     textureData.region.width = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.WIDTH, 0.0);
                     textureData.region.height = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.HEIGHT, 0.0);
-                    var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0);
-                    var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0);
                     if (frameWidth > 0.0 && frameHeight > 0.0) {
                         textureData.frame = dragonBones.TextureData.createRectangle();
                         textureData.frame.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_X, 0.0);
@@ -13501,7 +13770,7 @@ var dragonBones;
     }(dragonBones.DataParser));
     dragonBones.ObjectDataParser = ObjectDataParser;
     /**
-     * @internal
+     * @private
      */
     var ActionFrame = /** @class */ (function () {
         function ActionFrame() {
@@ -13537,7 +13806,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var BinaryDataParser = /** @class */ (function (_super) {
         __extends(BinaryDataParser, _super);
@@ -13640,14 +13909,6 @@ var dragonBones;
             }
             return result;
         };
-        BinaryDataParser.prototype._getUTF16Key = function (value) {
-            for (var i = 0, l = value.length; i < l; ++i) {
-                if (value.charCodeAt(i) > 255) {
-                    return encodeURI(value);
-                }
-            }
-            return value;
-        };
         BinaryDataParser.prototype._parseBinaryTimeline = function (type, offset, timelineData) {
             if (timelineData === void 0) { timelineData = null; }
             var timeline = timelineData !== null ? timelineData : dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
@@ -13662,14 +13923,8 @@ var dragonBones;
                 var frameIndicesOffset = 0;
                 var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation.
                 var frameIndices = this._data.frameIndices;
-                if (dragonBones.DragonBones.webAssembly) {
-                    frameIndicesOffset = frameIndices.size();
-                    frameIndices.resize(frameIndicesOffset + totalFrameCount, 0);
-                }
-                else {
-                    frameIndicesOffset = frameIndices.length;
-                    frameIndices.length += totalFrameCount;
-                }
+                frameIndicesOffset = frameIndices.length;
+                frameIndices.length += totalFrameCount;
                 timeline.frameIndicesOffset = frameIndicesOffset;
                 for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) {
                     if (frameStart + frameCount <= i && iK < keyFrameCount) {
@@ -13682,49 +13937,16 @@ var dragonBones;
                         }
                         iK++;
                     }
-                    if (dragonBones.DragonBones.webAssembly) {
-                        frameIndices.set(frameIndicesOffset + i, iK - 1);
-                    }
-                    else {
-                        frameIndices[frameIndicesOffset + i] = iK - 1;
-                    }
+                    frameIndices[frameIndicesOffset + i] = iK - 1;
                 }
             }
             this._timeline = null; //
             return timeline;
         };
-        BinaryDataParser.prototype._parseVertices = function (rawData, vertices) {
-            vertices.offset = rawData[dragonBones.DataParser.OFFSET];
-            var weightOffset = this._intArrayBuffer[vertices.offset + 3 /* MeshWeightOffset */];
-            if (weightOffset >= 0) {
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                var vertexCount = this._intArrayBuffer[vertices.offset + 0 /* MeshVertexCount */];
-                var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */];
-                weight.offset = weightOffset;
-                for (var i = 0; i < boneCount; ++i) {
-                    var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i];
-                    weight.addBone(this._rawBones[boneIndex]);
-                }
-                var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount;
-                var weightCount = 0;
-                for (var i = 0, l = vertexCount; i < l; ++i) {
-                    var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++];
-                    weightCount += vertexBoneCount;
-                    boneIndicesOffset += vertexBoneCount;
-                }
-                weight.count = weightCount;
-                vertices.weight = weight;
-            }
-        };
-        BinaryDataParser.prototype._parseMesh = function (rawData, mesh) {
-            this._parseVertices(rawData, mesh.vertices);
-        };
-        BinaryDataParser.prototype._parsePath = function (rawData, path) {
-            this._parseVertices(rawData, path.vertices);
-        };
         BinaryDataParser.prototype._parseAnimation = function (rawData) {
             var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData);
-            animation.frameCount = Math.max(dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 1), 1);
+            animation.blendType = dragonBones.DataParser._getAnimationBlendType(dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, ""));
+            animation.frameCount = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0);
             animation.playTimes = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1);
             animation.duration = animation.frameCount / this._armature.frameRate; // float
             animation.fadeInTime = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0);
@@ -13749,9 +13971,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.BONE];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var bone = this._armature.getBone(k);
                     if (bone === null) {
                         continue;
@@ -13760,26 +13979,7 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addBoneTimeline(bone, timeline);
-                    }
-                }
-            }
-            if (dragonBones.DataParser.SURFACE in rawData) {
-                var rawTimeliness = rawData[dragonBones.DataParser.SURFACE];
-                for (var k in rawTimeliness) {
-                    var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
-                    var surface = this._armature.getBone(k);
-                    if (surface === null) {
-                        continue;
-                    }
-                    for (var i = 0, l = rawTimelines.length; i < l; i += 2) {
-                        var timelineType = rawTimelines[i];
-                        var timelineOffset = rawTimelines[i + 1];
-                        var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addSurfaceTimeline(surface, timeline);
+                        this._animation.addBoneTimeline(bone.name, timeline);
                     }
                 }
             }
@@ -13787,9 +13987,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.SLOT];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var slot = this._armature.getSlot(k);
                     if (slot === null) {
                         continue;
@@ -13798,7 +13995,7 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addSlotTimeline(slot, timeline);
+                        this._animation.addSlotTimeline(slot.name, timeline);
                     }
                 }
             }
@@ -13806,9 +14003,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.CONSTRAINT];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var constraint = this._armature.getConstraint(k);
                     if (constraint === null) {
                         continue;
@@ -13817,28 +14011,86 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addConstraintTimeline(constraint, timeline);
-                    }
-                }
-            }
-            if (dragonBones.DataParser.ANIMATION in rawData) {
-                var rawTimeliness = rawData[dragonBones.DataParser.ANIMATION];
-                for (var k in rawTimeliness) {
-                    var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
-                    for (var i = 0, l = rawTimelines.length; i < l; i += 2) {
-                        var timelineType = rawTimelines[i];
-                        var timelineOffset = rawTimelines[i + 1];
-                        var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addAnimationTimeline(k, timeline);
+                        this._animation.addConstraintTimeline(constraint.name, timeline);
+                    }
+                }
+            }
+            if (dragonBones.DataParser.TIMELINE in rawData) {
+                var rawTimelines = rawData[dragonBones.DataParser.TIMELINE];
+                for (var _i = 0, rawTimelines_6 = rawTimelines; _i < rawTimelines_6.length; _i++) {
+                    var rawTimeline = rawTimelines_6[_i];
+                    var timelineOffset = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.OFFSET, 0);
+                    if (timelineOffset >= 0) {
+                        var timelineType = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */);
+                        var timelineName = dragonBones.ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
+                        var timeline = null;
+                        if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) {
+                            timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData);
+                            var animaitonTimeline = timeline;
+                            animaitonTimeline.x = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0);
+                            animaitonTimeline.y = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0);
+                        }
+                        timeline = this._parseBinaryTimeline(timelineType, timelineOffset, timeline);
+                        switch (timelineType) {
+                            case 0 /* Action */:
+                                // TODO
+                                break;
+                            case 1 /* ZOrder */:
+                                // TODO
+                                break;
+                            case 11 /* BoneTranslate */:
+                            case 12 /* BoneRotate */:
+                            case 13 /* BoneScale */:
+                            case 50 /* Surface */:
+                            case 60 /* BoneAlpha */:
+                                this._animation.addBoneTimeline(timelineName, timeline);
+                                break;
+                            case 20 /* SlotDisplay */:
+                            case 21 /* SlotColor */:
+                            case 22 /* SlotDeform */:
+                            case 23 /* SlotZIndex */:
+                            case 24 /* SlotAlpha */:
+                                this._animation.addSlotTimeline(timelineName, timeline);
+                                break;
+                            case 30 /* IKConstraint */:
+                                this._animation.addConstraintTimeline(timelineName, timeline);
+                                break;
+                            case 40 /* AnimationProgress */:
+                            case 41 /* AnimationWeight */:
+                            case 42 /* AnimationParameter */:
+                                this._animation.addAnimationTimeline(timelineName, timeline);
+                                break;
+                        }
                     }
                 }
             }
             this._animation = null;
             return animation;
         };
+        BinaryDataParser.prototype._parseGeometry = function (rawData, geometry) {
+            geometry.offset = rawData[dragonBones.DataParser.OFFSET];
+            geometry.data = this._data;
+            var weightOffset = this._intArrayBuffer[geometry.offset + 3 /* GeometryWeightOffset */];
+            if (weightOffset >= 0) {
+                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
+                var vertexCount = this._intArrayBuffer[geometry.offset + 0 /* GeometryVertexCount */];
+                var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */];
+                weight.offset = weightOffset;
+                for (var i = 0; i < boneCount; ++i) {
+                    var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i];
+                    weight.addBone(this._rawBones[boneIndex]);
+                }
+                var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount;
+                var weightCount = 0;
+                for (var i = 0, l = vertexCount; i < l; ++i) {
+                    var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++];
+                    weightCount += vertexBoneCount;
+                    boneIndicesOffset += vertexBoneCount;
+                }
+                weight.count = weightCount;
+                geometry.weight = weight;
+            }
+        };
         BinaryDataParser.prototype._parseArray = function (rawData) {
             var offsets = rawData[dragonBones.DataParser.OFFSET];
             var l1 = offsets[1];
@@ -13847,37 +14099,22 @@ var dragonBones;
             var l4 = offsets[7];
             var l5 = offsets[9];
             var l6 = offsets[11];
+            var l7 = offsets.length > 12 ? offsets[13] : 0; // Color.
             var intArray = new Int16Array(this._binary, this._binaryOffset + offsets[0], l1 / Int16Array.BYTES_PER_ELEMENT);
             var floatArray = new Float32Array(this._binary, this._binaryOffset + offsets[2], l2 / Float32Array.BYTES_PER_ELEMENT);
             var frameIntArray = new Int16Array(this._binary, this._binaryOffset + offsets[4], l3 / Int16Array.BYTES_PER_ELEMENT);
             var frameFloatArray = new Float32Array(this._binary, this._binaryOffset + offsets[6], l4 / Float32Array.BYTES_PER_ELEMENT);
             var frameArray = new Int16Array(this._binary, this._binaryOffset + offsets[8], l5 / Int16Array.BYTES_PER_ELEMENT);
             var timelineArray = new Uint16Array(this._binary, this._binaryOffset + offsets[10], l6 / Uint16Array.BYTES_PER_ELEMENT);
-            if (dragonBones.DragonBones.webAssembly) {
-                var lTotal = l1 + l2 + l3 + l4 + l5 + l6;
-                var bufferPointer = dragonBones.webAssemblyModule._malloc(lTotal);
-                var rawArray = new Uint8Array(this._binary, this._binaryOffset, lTotal / Uint8Array.BYTES_PER_ELEMENT);
-                var copyArray = new Uint8Array(dragonBones.webAssemblyModule.HEAP16.buffer, bufferPointer, rawArray.length);
-                for (var i = 0, l = rawArray.length; i < l; ++i) {
-                    copyArray[i] = rawArray[i];
-                }
-                dragonBones.webAssemblyModule.setDataBinary(this._data, bufferPointer, l1, l2, l3, l4, l5, l6);
-                this._intArrayBuffer = intArray;
-                this._floatArrayBuffer = floatArray;
-                this._frameIntArrayBuffer = frameIntArray;
-                this._frameFloatArrayBuffer = frameFloatArray;
-                this._frameArrayBuffer = frameArray;
-                this._timelineArrayBuffer = timelineArray;
-            }
-            else {
-                this._data.binary = this._binary;
-                this._data.intArray = this._intArrayBuffer = intArray;
-                this._data.floatArray = this._floatArrayBuffer = floatArray;
-                this._data.frameIntArray = this._frameIntArrayBuffer = frameIntArray;
-                this._data.frameFloatArray = this._frameFloatArrayBuffer = frameFloatArray;
-                this._data.frameArray = this._frameArrayBuffer = frameArray;
-                this._data.timelineArray = this._timelineArrayBuffer = timelineArray;
-            }
+            var colorArray = l7 > 0 ? new Int16Array(this._binary, this._binaryOffset + offsets[12], l7 / Int16Array.BYTES_PER_ELEMENT) : intArray; // Color.
+            this._data.binary = this._binary;
+            this._data.intArray = this._intArrayBuffer = intArray;
+            this._data.floatArray = floatArray;
+            this._data.frameIntArray = frameIntArray;
+            this._data.frameFloatArray = frameFloatArray;
+            this._data.frameArray = this._frameArrayBuffer = frameArray;
+            this._data.timelineArray = this._timelineArrayBuffer = timelineArray;
+            this._data.colorArray = colorArray;
         };
         BinaryDataParser.prototype.parseDragonBonesData = function (rawData, scale) {
             if (scale === void 0) { scale = 1; }
@@ -14101,20 +14338,23 @@ var dragonBones;
                 var slotData = _a[_i];
                 var displayDatas = slotData.name in skinSlots ? skinSlots[slotData.name] : null;
                 var slot = this._buildSlot(dataPackage, slotData, armature);
-                slot.rawDisplayDatas = displayDatas;
                 if (displayDatas !== null) {
-                    var displayList = new Array();
-                    // for (const displayData of displays) 
-                    for (var i = 0, l = dragonBones.DragonBones.webAssembly ? displayDatas.size() : displayDatas.length; i < l; ++i) {
-                        var displayData = dragonBones.DragonBones.webAssembly ? displayDatas.get(i) : displayDatas[i];
+                    slot.displayFrameCount = displayDatas.length;
+                    for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                        var displayData = displayDatas[i];
+                        slot.replaceRawDisplayData(displayData, i);
                         if (displayData !== null) {
-                            displayList.push(this._getSlotDisplay(dataPackage, displayData, null, slot));
+                            if (dataPackage.textureAtlasName.length > 0) {
+                                var textureData = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
+                                slot.replaceTextureData(textureData, i);
+                            }
+                            var display = this._getSlotDisplay(dataPackage, displayData, slot);
+                            slot.replaceDisplay(display, i);
                         }
                         else {
-                            displayList.push(null);
+                            slot.replaceDisplay(null);
                         }
                     }
-                    slot._setDisplayList(displayList);
                 }
                 slot._setDisplayIndex(slotData.displayIndex, true);
             }
@@ -14143,12 +14383,10 @@ var dragonBones;
                 }
             }
         };
-        BaseFactory.prototype._buildChildArmature = function (dataPackage, slot, displayData) {
-            // tslint:disable-next-line:no-unused-expression
-            slot;
+        BaseFactory.prototype._buildChildArmature = function (dataPackage, _slot, displayData) {
             return this.buildArmature(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage !== null ? dataPackage.textureAtlasName : "");
         };
-        BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, rawDisplayData, slot) {
+        BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, slot) {
             var dataName = dataPackage !== null ? dataPackage.dataName : displayData.parent.parent.parent.name;
             var display = null;
             switch (displayData.type) {
@@ -14157,15 +14395,7 @@ var dragonBones;
                     if (imageDisplayData.texture === null) {
                         imageDisplayData.texture = this._getTextureData(dataName, displayData.path);
                     }
-                    else if (dataPackage !== null && dataPackage.textureAtlasName.length > 0) {
-                        imageDisplayData.texture = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
-                    }
-                    if (rawDisplayData !== null && rawDisplayData.type === 2 /* Mesh */ && this._isSupportMesh()) {
-                        display = slot.meshDisplay;
-                    }
-                    else {
-                        display = slot.rawDisplay;
-                    }
+                    display = slot.rawDisplay;
                     break;
                 }
                 case 2 /* Mesh */: {
@@ -14173,9 +14403,6 @@ var dragonBones;
                     if (meshDisplayData.texture === null) {
                         meshDisplayData.texture = this._getTextureData(dataName, meshDisplayData.path);
                     }
-                    else if (dataPackage !== null && dataPackage.textureAtlasName.length > 0) {
-                        meshDisplayData.texture = this._getTextureData(dataPackage.textureAtlasName, meshDisplayData.path);
-                    }
                     if (this._isSupportMesh()) {
                         display = slot.meshDisplay;
                     }
@@ -14186,7 +14413,7 @@ var dragonBones;
                 }
                 case 1 /* Armature */: {
                     var armatureDisplayData = displayData;
-                    var childArmature = this._buildChildArmature(dataPackage, slot, displayData);
+                    var childArmature = this._buildChildArmature(dataPackage, slot, armatureDisplayData);
                     if (childArmature !== null) {
                         childArmature.inheritAnimation = armatureDisplayData.inheritAnimation;
                         if (!childArmature.inheritAnimation) {
@@ -14300,9 +14527,20 @@ var dragonBones;
             return textureAtlasData;
         };
         /**
-         * @private
+         * - Update texture atlases.
+         * @param textureAtlases - The texture atlas objects.
+         * @param name - The texture atlas name.
+         * @version DragonBones 5.7
+         * @language en_US
+         */
+        /**
+         * - 更新贴图集对象。
+         * @param textureAtlases - 多个贴图集对象。
+         * @param name - 贴图集名称。
+         * @version DragonBones 5.7
+         * @language zh_CN
          */
-        BaseFactory.prototype.updateTextureAtlasData = function (name, textureAtlases) {
+        BaseFactory.prototype.updateTextureAtlases = function (textureAtlases, name) {
             var textureAtlasDatas = this.getTextureAtlasData(name);
             if (textureAtlasDatas !== null) {
                 for (var i = 0, l = textureAtlasDatas.length; i < l; ++i) {
@@ -14608,36 +14846,20 @@ var dragonBones;
                 displayIndex = 0;
             }
             slot.replaceDisplayData(displayData, displayIndex);
-            var displayList = slot.displayList; // Copy.
-            if (displayList.length <= displayIndex) {
-                displayList.length = displayIndex + 1;
-                for (var i = 0, l = displayList.length; i < l; ++i) {
-                    if (!displayList[i]) {
-                        displayList[i] = null;
-                    }
-                }
-            }
             if (displayData !== null) {
-                var rawDisplayDatas = slot.rawDisplayDatas;
-                var rawDisplayData = null;
-                if (rawDisplayDatas) {
-                    if (dragonBones.DragonBones.webAssembly) {
-                        if (displayIndex < rawDisplayDatas.size()) {
-                            rawDisplayData = rawDisplayDatas.get(displayIndex);
-                        }
-                    }
-                    else {
-                        if (displayIndex < rawDisplayDatas.length) {
-                            rawDisplayData = rawDisplayDatas[displayIndex];
-                        }
+                var display = this._getSlotDisplay(null, displayData, slot);
+                if (displayData.type === 0 /* Image */) {
+                    var rawDisplayData = slot.getDisplayFrameAt(displayIndex).rawDisplayData;
+                    if (rawDisplayData !== null &&
+                        rawDisplayData.type === 2 /* Mesh */) {
+                        display = slot.meshDisplay;
                     }
                 }
-                displayList[displayIndex] = this._getSlotDisplay(null, displayData, rawDisplayData, slot);
+                slot.replaceDisplay(display, displayIndex);
             }
             else {
-                displayList[displayIndex] = null;
+                slot.replaceDisplay(null, displayIndex);
             }
-            slot.displayList = displayList;
         };
         /**
          * - Replaces the current display data for a particular slot with a specific display data.
@@ -14676,13 +14898,10 @@ var dragonBones;
         BaseFactory.prototype.replaceSlotDisplay = function (dragonBonesName, armatureName, slotName, displayName, slot, displayIndex) {
             if (displayIndex === void 0) { displayIndex = -1; }
             var armatureData = this.getArmatureData(armatureName, dragonBonesName || "");
-            if (!armatureData || !armatureData.defaultSkin) {
+            if (armatureData === null || armatureData.defaultSkin === null) {
                 return false;
             }
             var displayData = armatureData.defaultSkin.getDisplay(slotName, displayName);
-            if (!displayData) {
-                return false;
-            }
             this.replaceDisplay(slot, displayData, displayIndex);
             return true;
         };
@@ -14694,15 +14913,14 @@ var dragonBones;
             if (!armatureData || !armatureData.defaultSkin) {
                 return false;
             }
-            var displays = armatureData.defaultSkin.getDisplays(slotName);
-            if (!displays) {
+            var displayDatas = armatureData.defaultSkin.getDisplays(slotName);
+            if (!displayDatas) {
                 return false;
             }
-            var displayIndex = 0;
-            // for (const displayData of displays) 
-            for (var i = 0, l = dragonBones.DragonBones.webAssembly ? displays.size() : displays.length; i < l; ++i) {
-                var displayData = dragonBones.DragonBones.webAssembly ? displays.get(i) : displays[i];
-                this.replaceDisplay(slot, displayData, displayIndex++);
+            slot.displayFrameCount = displayDatas.length;
+            for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                var displayData = displayDatas[i];
+                this.replaceDisplay(slot, displayData, i);
             }
             return true;
         };
@@ -14754,34 +14972,30 @@ var dragonBones;
                 if (exclude !== null && exclude.indexOf(slot.name) >= 0) {
                     continue;
                 }
-                var displays = skin.getDisplays(slot.name);
-                if (!displays) {
+                var displayDatas = skin.getDisplays(slot.name);
+                if (displayDatas === null) {
                     if (defaultSkin !== null && skin !== defaultSkin) {
-                        displays = defaultSkin.getDisplays(slot.name);
+                        displayDatas = defaultSkin.getDisplays(slot.name);
                     }
-                    if (!displays) {
+                    if (displayDatas === null) {
                         if (isOverride) {
-                            slot.rawDisplayDatas = null;
-                            slot.displayList = []; //
+                            slot.displayFrameCount = 0;
                         }
                         continue;
                     }
                 }
-                var displayCount = dragonBones.DragonBones.webAssembly ? displays.size() : displays.length;
-                var displayList = slot.displayList; // Copy.
-                displayList.length = displayCount; // Modify displayList length.
-                for (var i = 0, l = displayCount; i < l; ++i) {
-                    var displayData = dragonBones.DragonBones.webAssembly ? displays.get(i) : displays[i];
+                slot.displayFrameCount = displayDatas.length;
+                for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                    var displayData = displayDatas[i];
+                    slot.replaceRawDisplayData(displayData, i);
                     if (displayData !== null) {
-                        displayList[i] = this._getSlotDisplay(null, displayData, null, slot);
+                        slot.replaceDisplay(this._getSlotDisplay(null, displayData, slot), i);
                     }
                     else {
-                        displayList[i] = null;
+                        slot.replaceDisplay(null, i);
                     }
                 }
                 success = true;
-                slot.rawDisplayDatas = displays;
-                slot.displayList = displayList;
             }
             return success;
         };
@@ -14850,8 +15064,8 @@ var dragonBones;
                     var display = _c[_b];
                     if (display instanceof dragonBones.Armature) {
                         var displayDatas = skinData.getDisplays(slot.name);
-                        if (displayDatas !== null && index < (dragonBones.DragonBones.webAssembly ? displayDatas.size() : displayDatas.length)) {
-                            var displayData = dragonBones.DragonBones.webAssembly ? displayDatas.get(index) : displayDatas[index];
+                        if (displayDatas !== null && index < displayDatas.length) {
+                            var displayData = displayDatas[index];
                             if (displayData !== null && displayData.type === 1 /* Armature */) {
                                 var childArmatureData = this.getArmatureData(displayData.path, displayData.parent.parent.parent.name);
                                 if (childArmatureData) {
@@ -14904,49 +15118,13 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link #replaceSkin}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceSkin}。
-         * @deprecated
-         * @language zh_CN
-         */
-        BaseFactory.prototype.changeSkin = function (armature, skin, exclude) {
-            if (exclude === void 0) { exclude = null; }
-            return this.replaceSkin(armature, skin, false, exclude);
-        };
-        /**
-         * - Deprecated, please refer to {@link #replaceAnimation}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceAnimation}。
-         * @deprecated
-         * @language zh_CN
-         */
-        BaseFactory.prototype.copyAnimationsToArmature = function (toArmature, fromArmatreName, fromSkinName, fromDragonBonesDataName, replaceOriginalAnimation) {
-            if (fromSkinName === void 0) { fromSkinName = ""; }
-            if (fromDragonBonesDataName === void 0) { fromDragonBonesDataName = ""; }
-            if (replaceOriginalAnimation === void 0) { replaceOriginalAnimation = true; }
-            // tslint:disable-next-line:no-unused-expression
-            fromSkinName;
-            var armatureData = this.getArmatureData(fromArmatreName, fromDragonBonesDataName);
-            if (!armatureData) {
-                return false;
-            }
-            return this.replaceAnimation(toArmature, armatureData, replaceOriginalAnimation);
-        };
         BaseFactory._objectParser = null;
         BaseFactory._binaryParser = null;
         return BaseFactory;
     }());
     dragonBones.BaseFactory = BaseFactory;
     /**
-     * @internal
+     * @private
      */
     var BuildArmaturePackage = /** @class */ (function () {
         function BuildArmaturePackage() {
@@ -15473,7 +15651,8 @@ var dragonBones;
             // TODO child armature.
         };
         PhaserSlot.prototype._updateColor = function () {
-            this._renderDisplay.alpha = this._colorTransform.alphaMultiplier;
+            var alpha = this._colorTransform.alphaMultiplier * this._globalAlpha;
+            this._renderDisplay.alpha = alpha;
             if (this._renderDisplay instanceof PIXI.Sprite) {
                 var color = (Math.round(this._colorTransform.redMultiplier * 0xFF) << 16) + (Math.round(this._colorTransform.greenMultiplier * 0xFF) << 8) + Math.round(this._colorTransform.blueMultiplier * 0xFF);
                 this._renderDisplay.tint = color;
@@ -15481,11 +15660,10 @@ var dragonBones;
             // TODO child armature.
         };
         PhaserSlot.prototype._updateFrame = function () {
-            var currentVerticesData = (this._deformVertices !== null && this._display === this._meshDisplay) ? this._deformVertices.verticesData : null;
             var currentTextureData = this._textureData;
             if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) {
                 var currentTextureAtlasData = currentTextureData.parent;
-                if (this._armature.replacedTexture !== null && this._rawDisplayDatas !== null && this._rawDisplayDatas.indexOf(this._displayData) >= 0) {
+                if (this._armature.replacedTexture !== null) {
                     if (this._armature._replaceTextureAtlasData === null) {
                         currentTextureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.PhaserTextureAtlasData);
                         currentTextureAtlasData.copyFrom(currentTextureData.parent);
@@ -15499,7 +15677,7 @@ var dragonBones;
                 }
                 var renderTexture = currentTextureData.renderTexture;
                 if (renderTexture !== null) {
-                    if (currentVerticesData !== null) {
+                    if (this._geometryData !== null) {
                         // TODO
                     }
                     else {
@@ -15511,7 +15689,7 @@ var dragonBones;
                     return;
                 }
             }
-            if (currentVerticesData !== null) {
+            if (this._geometryData !== null) {
                 // TODO
             }
             else {
@@ -15525,12 +15703,6 @@ var dragonBones;
         PhaserSlot.prototype._updateMesh = function () {
             // TODO
         };
-        /**
-         * @internal
-         */
-        PhaserSlot.prototype._updateGlueMesh = function () {
-            // TODO
-        };
         PhaserSlot.prototype._updateTransform = function () {
             this.updateGlobalTransform(); // Update transform.
             var transform = this.global;
diff --git a/Phaser/2.x/out/dragonBones.min.js b/Phaser/2.x/out/dragonBones.min.js
index f1cc06ee..9b106248 100644
--- a/Phaser/2.x/out/dragonBones.min.js
+++ b/Phaser/2.x/out/dragonBones.min.js
@@ -1 +1 @@
-"use strict";var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(e,a){t(e,a);function r(){this.constructor=e}e.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}();var dragonBones;(function(t){})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(a){this._clock=new t.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=a;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var a=0,r=this._objects;a0){for(var n=0;na){i.length=a}t._maxCountMap[r]=a}else{t._defaultMaxCount=a;for(var r in t._poolsMap){var i=t._poolsMap[r];if(i.length>a){i.length=a}if(r in t._maxCountMap){t._maxCountMap[r]=a}}}};t.clearPool=function(e){if(e===void 0){e=null}if(e!==null){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){r.length=0}}else{for(var i in t._poolsMap){var r=t._poolsMap[i];r.length=0}}};t.borrowObject=function(e){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){var i=r.pop();i._isInPool=false;return i}var n=new e;n._onClear();return n};t.prototype.returnToPool=function(){this._onClear();t._returnObject(this)};t._hashCode=0;t._defaultMaxCount=3e3;t._maxCountMap={};t._poolsMap={};return t}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var f=l+t.width;var u=h+t.height;var _=a*l+i*h+s;var c=r*l+n*h+o;var m=a*f+i*h+s;var p=r*f+n*h+o;var d=a*f+i*u+s;var v=r*f+n*u+o;var y=a*l+i*u+s;var g=r*l+n*u+o;var D=0;if(_>m){D=_;_=m;m=D}if(d>y){D=d;d=y;y=D}t.x=Math.floor(_y?m:y)-t.x);if(c>p){D=c;c=p;p=D}if(v>g){D=v;v=g;g=D}t.y=Math.floor(cg?p:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}t.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};t.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};t.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};t.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};t.prototype.fromMatrix=function(e){var a=this.scaleX,r=this.scaleY;var i=t.PI_Q;this.x=e.tx;this.y=e.ty;this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);this.scaleX=this.rotation>-i&&this.rotation-i&&n=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(r>=0&&this.scaleY<0){this.scaleY=-this.scaleY;n=n-Math.PI}this.skew=n-this.rotation;return this};t.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};t.PI=Math.PI;t.PI_D=Math.PI*2;t.PI_H=Math.PI/2;t.PI_Q=Math.PI/4;t.RAD_DEG=180/Math.PI;t.DEG_RAD=Math.PI/180;return t}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.ints=[];e.floats=[];e.strings=[];return e}e.toString=function(){return"[class dragonBones.UserData]"};e.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};e.prototype.addInt=function(t){this.ints.push(t)};e.prototype.addFloat=function(t){this.floats.push(t)};e.prototype.addString=function(t){this.strings.push(t)};e.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};a.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};a.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};a.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};a.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};a.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};a.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};a.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};a.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};a.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return a}(t.BaseObject);t.ArmatureData=e;var a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.transform=new t.Transform;a.userData=null;return a}a.toString=function(){return"[class dragonBones.BoneData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.name="";this.transform.identity();this.userData=null;this.parent=null};return a}(t.BaseObject);t.BoneData=a;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.SurfaceData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.vertices.length=0};return e}(a);t.SurfaceData=r;var i=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}a.createColor=function(){return new t.ColorTransform};a.toString=function(){return"[class dragonBones.SlotData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.name="";this.color=null;this.userData=null;this.parent=null};a.DEFAULT_COLOR=new t.ColorTransform;return a}(t.BaseObject);t.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.displays={};return e}e.toString=function(){return"[class dragonBones.SkinData]"};e.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};e.rectangleIntersectsSegment=function(t,a,r,i,n,s,o,l,h,f,u){if(h===void 0){h=null}if(f===void 0){f=null}if(u===void 0){u=null}var _=t>n&&ts&&an&&rs&&i=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=this.width*.5;var h=this.height*.5;var f=e.rectangleIntersectsSegment(t,a,r,i,-l,-h,l,h,n,s,o);return f};return e}(e);t.RectangleBoundingBoxData=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.EllipseData]"};e.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,f){if(l===void 0){l=null}if(h===void 0){h=null}if(f===void 0){f=null}var u=s/o;var _=u*u;e*=u;r*=u;var c=a-t;var m=r-e;var p=Math.sqrt(c*c+m*m);var d=c/p;var v=m/p;var y=(i-t)*d+(n-e)*v;var g=y*y;var D=t*t+e*e;var b=s*s;var T=b-D+g;var A=0;if(T>=0){var P=Math.sqrt(T);var S=y-P;var O=y+P;var x=S<0?-1:S<=p?0:1;var B=O<0?-1:O<=p?0:1;var M=x*B;if(M<0){return-1}else if(M===0){if(x===-1){A=2;a=t+O*d;r=(e+O*v)/u;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(f!==null){f.x=Math.atan2(r/b*_,a/b);f.y=f.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*v)/u;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(f!==null){f.x=Math.atan2(e/b*_,t/b);f.y=f.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*v)/u;if(f!==null){f.x=Math.atan2(l.y/b*_,l.x/b)}}if(h!==null){h.x=t+O*d;h.y=(e+O*v)/u;if(f!==null){f.y=Math.atan2(h.y/b*_,h.x/b)}}}}}return A};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};e.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=e.ellipseIntersectsSegment(t,a,r,i,0,0,this.width*.5,this.height*.5,n,s,o);return l};return e}(e);t.EllipseBoundingBoxData=r;var i=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};e.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var f=e-r;var u=t*r-e*a;var _=0;var c=i[l-2];var m=i[l-1];var p=0;var d=0;var v=0;var y=0;var g=0;var D=0;for(var b=0;b=c&&B<=T||B>=T&&B<=c)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var M=(u*S-f*O)/x;if((M>=m&&M<=A||M>=A&&M<=m)&&(f===0||M>=e&&M<=r||M>=r&&M<=e)){if(s!==null){var E=B-t;if(E<0){E=-E}if(_===0){p=E;d=E;v=B;y=M;g=B;D=M;if(o!==null){o.x=Math.atan2(A-m,T-c)-Math.PI*.5;o.y=o.x}}else{if(Ed){d=E;g=B;D=M;if(o!==null){o.y=Math.atan2(A-m,T-c)-Math.PI*.5}}}_++}else{v=B;y=M;g=B;D=M;_++;if(o!==null){o.x=Math.atan2(A-m,T-c)-Math.PI*.5;o.y=o.x}break}}}c=T;m=A}if(_===1){if(n!==null){n.x=v;n.y=y}if(s!==null){s.x=v;s.y=y}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=v;n.y=y}if(s!==null){s.x=g;s.y=D}}return _};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};e.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;a=0};e.prototype.addBoneMask=function(t,e,a){if(a===void 0){a=true}var r=t.getBone(e);if(r===null){return}if(this.boneMask.indexOf(e)<0){this.boneMask.push(e)}if(a){for(var i=0,n=t.getBones();i=0){this.boneMask.splice(r,1)}if(a){var i=t.getBone(e);if(i!==null){if(this.boneMask.length>0){for(var n=0,s=t.getBones();n=0&&i.contains(o)){this.boneMask.splice(l,1)}}}else{for(var h=0,f=t.getBones();he._zOrder?1:-1};a.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZorder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};a.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};a.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};a.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};a.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};a.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};a.prototype.init=function(e,a,r,i){if(this._armatureData!==null){return}this._armatureData=e;this._animation=t.BaseObject.borrowObject(t.Animation);this._proxy=a;this._display=r;this._dragonBones=i;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};a.prototype.advanceTime=function(t){if(this._lockUpdate){return}if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty){this._slotsDirty=false;this._slots.sort(a._onSortSlots)}if(this._cacheFrameIndex<0||this._cacheFrameIndex!==e){var r=0,i=0;for(r=0,i=this._bones.length;r0){this._lockUpdate=true;for(var n=0,s=this._actions;n0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var T=o?i.y-e:i.x-t;if(T<0){T=-T}if(d===null||Th){h=T;_=n.x;c=n.y;v=D;if(s!==null){p=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=f;i.y=u;if(s!==null){s.x=m}}if(v!==null&&n!==null){n.x=_;n.y=c;if(s!==null){s.y=p}}return d};a.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};a.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};a.prototype.invalidUpdate=function(){this._transformDirty=true};a.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(a.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=n){return this.globalTransformMatrix}i=a>this._kX*(t+n)+d;m=((o*(l+1)+o*2+l+c)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=c*(h+2);var D=this._hullCache[4];var b=this._hullCache[5];var T=this._hullCache[2]-(l-c)*D;var A=this._hullCache[3]-(l-c)*b;var P=this._vertices;if(i){this._getAffineTransform(-n,d+u,r-n,u,P[g+h+2],P[g+h+3],T+D,A+b,P[g],P[g+1],e._helpTransform,y,true)}else{this._getAffineTransform(-r,d,r-n,u,T,A,P[g],P[g+1],T+D,A+b,e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else if(t>=n){if(a<-n||a>=n){return this.globalTransformMatrix}i=a>this._kX*(t-r)+d;m=((o*(l+1)+o+c)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=(c+1)*(h+2)-2;var D=this._hullCache[4];var b=this._hullCache[5];var T=this._hullCache[0]+c*D;var A=this._hullCache[1]+c*b;var P=this._vertices;if(i){this._getAffineTransform(r,d+u,r-n,u,T+D,A+b,P[g+h+2],P[g+h+3],T,A,e._helpTransform,y,true)}else{this._getAffineTransform(n,d,r-n,u,P[g],P[g+1],T,A,P[g+h+2],P[g+h+3],e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else if(a<-n){if(t<-n||t>=n){return this.globalTransformMatrix}i=a>this._kY*(t-p-f)-r;m=(o*(l+1)+_*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=_*2;var D=this._hullCache[10];var b=this._hullCache[11];var T=this._hullCache[8]+_*D;var A=this._hullCache[9]+_*b;var P=this._vertices;if(i){this._getAffineTransform(p+f,-n,f,r-n,P[g+2],P[g+3],P[g],P[g+1],T+D,A+b,e._helpTransform,y,true)}else{this._getAffineTransform(p,-r,f,r-n,T,A,T+D,A+b,P[g],P[g+1],e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else if(a>=n){if(t<-n||t>=n){return this.globalTransformMatrix}i=a>this._kY*(t-p-f)+n;m=((o*(l+1)+o+l+c)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=l*(h+2)+_*2;var D=this._hullCache[10];var b=this._hullCache[11];var T=this._hullCache[6]-(o-_)*D;var A=this._hullCache[7]-(o-_)*b;var P=this._vertices;if(i){this._getAffineTransform(p+f,r,f,r-n,T+D,A+b,T,A,P[g+2],P[g+3],e._helpTransform,y,true)}else{this._getAffineTransform(p,n,f,r-n,P[g],P[g+1],P[g+2],P[g+3],T,A,e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else{i=a>this._k*(t-p-f)+d;m=((o*c+_)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=_*2+c*(h+2);var P=this._vertices;if(i){this._getAffineTransform(p+f,d+u,f,u,P[g+h+4],P[g+h+5],P[g+h+2],P[g+h+3],P[g+2],P[g+3],e._helpTransform,y,true)}else{this._getAffineTransform(p,d,f,u,P[g],P[g+1],P[g+2],P[g+3],P[g+h+2],P[g+h+3],e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}return y};e.prototype.init=function(e,a){if(this._boneData!==null){return}t.prototype.init.call(this,e,a);var r=e.segmentX;var i=e.segmentY;var n=e.vertices.length;var s=1e3;var o=200;this._dX=o*2/r;this._dY=o*2/i;this._k=-this._dY/this._dX;this._kX=-this._dY/(s-o);this._kY=-(s-o)/this._dX;this._vertices.length=n;this._deformVertices.length=n;this._matrixCahce.length=(r*i+r*2+i*2)*2*7;this._hullCache.length=10;for(var l=0;l=0&&this._cachedFrameIndices!==null){var a=this._cachedFrameIndices[t];if(a>=0&&this._cachedFrameIndex===a){this._transformDirty=false}else if(a>=0){this._transformDirty=true;this._cachedFrameIndex=a}else{if(this._hasConstraint){for(var r=0,i=this._armature._constraints;r=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var s=0,o=this._armature._constraints;s=0;if(this._localDirty){this._updateGlobalTransformMatrix(f)}if(f&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var u=1e3;var _=200;var c=2*this.global.x;var m=2*this.global.y;var p=e._helpPoint;this.globalTransformMatrix.transformPoint(u,-_,p);this._hullCache[0]=p.x;this._hullCache[1]=p.y;this._hullCache[2]=c-p.x;this._hullCache[3]=m-p.y;this.globalTransformMatrix.transformPoint(0,this._dY,p,true);this._hullCache[4]=p.x;this._hullCache[5]=p.y;this.globalTransformMatrix.transformPoint(_,u,p);this._hullCache[6]=p.x;this._hullCache[7]=p.y;this._hullCache[8]=c-p.x;this._hullCache[9]=m-p.y;this.globalTransformMatrix.transformPoint(this._dX,0,p,true);this._hullCache[10]=p.x;this._hullCache[11]=p.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return e}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a._localMatrix=new t.Matrix;a._colorTransform=new t.ColorTransform;a._displayDatas=[];a._displayList=[];a._deformVertices=null;a._rawDisplay=null;a._meshDisplay=null;return a}a.prototype._onClear=function(){e.prototype._onClear.call(this);var a=[];for(var r=0,i=this._displayList;r=0){if(this._rawDisplayDatas!==null){n=this._displayIndex=0&&this._displayIndex=0&&this._rawDisplayDatas!==null){var s=this._displayIndex0){for(var o=0,l=n;o0){if(this._displayList.length!==e.length){this._displayList.length=e.length}for(var a=0,r=e.length;a0){this._displayList.length=0}if(this._displayIndex>=0&&this._displayIndex=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._display===null){return}if(this._visibleDirty){this._visibleDirty=false;this._updateVisible()}if(this._blendModeDirty){this._blendModeDirty=false;this._updateBlendMode()}if(this._colorDirty){this._colorDirty=false;this._updateColor()}if(this._deformVertices!==null&&this._deformVertices.verticesData!==null&&this._display===this._meshDisplay){var a=this._deformVertices.verticesData.weight!==null;var r=this._parent._boneData.type!==0;if(this._deformVertices.verticesDirty||a&&this._deformVertices.isBonesUpdate()||r&&this._parent._childrenTransformDirty){this._deformVertices.verticesDirty=false;this._updateMesh()}if(a||r){return}}if(this._transformDirty){this._transformDirty=false;if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform()}};a.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._transformDirty=false;this._updateGlobalTransformMatrix(false)}};a.prototype.replaceDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){if(this._displayIndex<0){e=0}else{e=this._displayIndex}}if(this._displayDatas.length<=e){this._displayDatas.length=e+1;for(var a=0,r=this._displayDatas.length;a0){if(l===1||l===2){if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n);if(s!==null){s.x=n.x;s.y=n.y}}else if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}else{if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}if(o!==null){this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),a._helpPoint,true);o.x=Math.atan2(a._helpPoint.y,a._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),a._helpPoint,true);o.y=Math.atan2(a._helpPoint.y,a._helpPoint.x)}}return l};a.prototype.invalidUpdate=function(){this._displayDirty=true;this._transformDirty=true};Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"displayIndex",{get:function(){return this._displayIndex},set:function(t){if(this._setDisplayIndex(t)){this.update(-1)}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"name",{get:function(){return this._slotData.name},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"displayList",{get:function(){return this._displayList.concat()},set:function(e){var a=this._displayList.concat();var r=new Array;if(this._setDisplayList(e)){this.update(-1)}for(var i=0,n=a;id){continue}var T=0;for(;;D++){var A=v[D];if(p>A){continue}if(D===0){T=p/A}else{var P=v[D-1];T=(p-P)/(A-P)}break}if(D!==m){m=D;if(f&&D===c){this._computeVertices(_-4,4,0,u);this._computeVertices(0,4,4,u)}else{this._computeVertices(D*6+2,8,0,u)}}this.addCurvePosition(T,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],l,g,a)}return}if(f){_+=2;u.length=o;this._computeVertices(2,_-4,0,u);this._computeVertices(0,2,_-4,u);u[_-2]=u[0];u[_-1]=u[1]}else{c--;_-=4;u.length=_;this._computeVertices(2,_,0,u)}var S=new Array(c);d=0;var O=u[0],x=u[1],B=0,M=0,E=0,I=0,w=0,C=0;var F,R,N,k,j,L,U,Y;for(var y=0,V=2;yd){continue}for(;;D++){var z=S[D];if(W>z)continue;if(D===0)W/=z;else{var K=S[D-1];W=(W-K)/(z-K)}break}if(D!==m){m=D;var q=D*6;O=u[q];x=u[q+1];B=u[q+2];M=u[q+3];E=u[q+4];I=u[q+5];w=u[q+6];C=u[q+7];F=(O-B*2+E)*.03;R=(x-M*2+I)*.03;N=((B-E)*3-O+w)*.006;k=((M-I)*3-x+C)*.006;j=F*2+N;L=R*2+k;U=(B-O)*.3+F+N*.16666667;Y=(M-x)*.3+R+k*.16666667;G=Math.sqrt(U*U+Y*Y);X[0]=G;for(q=1;q<8;q++){U+=j;Y+=L;j+=N;L+=k;G+=Math.sqrt(U*U+Y*Y);X[q]=G}U+=j;Y+=L;G+=Math.sqrt(U*U+Y*Y);X[8]=G;U+=j+N;Y+=L+k;G+=Math.sqrt(U*U+Y*Y);X[9]=G;H=0}W*=G;for(;;H++){var Z=X[H];if(W>Z)continue;if(H===0)W/=Z;else{var K=X[H-1];W=H+(W-K)/(Z-K)}break}this.addCurvePosition(W*.1,O,x,B,M,E,I,w,C,l,g,a)}};a.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,f,u){if(t===0){h[f]=e;h[f+1]=a;h[f+2]=0;return}if(t===1){h[f]=o;h[f+1]=l;h[f+2]=0;return}var _=1-t;var c=_*_;var m=t*t;var p=c*_;var d=c*t*3;var v=_*m*3;var y=t*m;var g=p*e+d*r+v*n+y*o;var D=p*a+d*i+v*s+y*l;h[f]=g;h[f+1]=D;if(u){h[f+2]=Math.atan2(D-(p*a+d*i+v*s),g-(p*e+d*r+v*n))}else{h[f+2]=0}};a.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.vertices.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD}}var E=this.rotateMix;var I=this.translateMix;for(var v=0,w=3;v0){var k=b.a,j=b.b,L=b.c,U=b.d,Y=void 0,V=void 0,X=void 0;if(_){Y=S[w-1]}else{Y=Math.atan2(F,C)}Y-=Math.atan2(j,k);if(M){V=Math.cos(Y);X=Math.sin(Y);var G=g._boneData.length;x+=(G*(V*k-X*j)-C)*E;B+=(G*(X*k+V*j)-F)*E}else{Y+=O}if(Y>t.Transform.PI){Y-=t.Transform.PI_D}else if(Y<-t.Transform.PI){Y+=t.Transform.PI_D}Y*=E;V=Math.cos(Y);X=Math.sin(Y);b.a=V*k-X*j;b.b=X*k+V*j;b.c=V*L-X*U;b.d=X*L+V*U}g.global.fromMatrix(b)}this.dirty=false};a.prototype.invalidUpdate=function(){};return a}(e);t.PathConstraint=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];e.bones=[];return e}e.toString=function(){return"[class dragonBones.DeformVertices]"};e.prototype._onClear=function(){this.verticesDirty=false;this.vertices.length=0;this.bones.length=0;this.verticesData=null};e.prototype.init=function(t,e){this.verticesData=t;if(this.verticesData!==null){var a=0;if(this.verticesData.weight!==null){a=this.verticesData.weight.count*2}else{a=this.verticesData.data.intArray[this.verticesData.offset+0]*2}this.verticesDirty=true;this.vertices.length=a;this.bones.length=0;for(var r=0,i=this.vertices.length;r0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&a._subFadeState>0){this._armature._dragonBones.bufferObject(a);this._animationStates.length=0;this._lastAnimationState=null}else{var r=a._animationData;var i=r.cacheFrameRate;if(this._animationDirty&&i>0){this._animationDirty=false;for(var n=0,s=this._armature.getBones();n0){var _=u[0];if(_!==null){if(_.parent===this._armature.armatureData.defaultSkin){f._cachedFrameIndices=r.getSlotCachedFrameIndices(f.name);continue}}}f._cachedFrameIndices=null}}a.advanceTime(t,i)}}else if(e>1){for(var c=0,m=0;c0&&a._subFadeState>0){m++;this._armature._dragonBones.bufferObject(a);this._animationDirty=true;if(this._lastAnimationState===a){this._lastAnimationState=null}}else{if(m>0){this._animationStates[c-m]=a}a.advanceTime(t,0)}if(c===e-1&&m>0){this._animationStates.length-=m;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};a.prototype.reset=function(){for(var t=0,e=this._animationStates;t1){if(e.position<0){e.position%=r.duration;e.position=r.duration-e.position}else if(e.position===r.duration){e.position-=1e-6}else if(e.position>r.duration){e.position%=r.duration}if(e.duration>0&&e.position+e.duration>r.duration){e.duration=r.duration-e.position}if(e.playTimes<0){e.playTimes=r.playTimes}}else{e.playTimes=1;e.position=0;if(e.duration>0){e.duration=0}}if(e.duration===0){e.duration=-1}this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);o.init(this._armature,r,e);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var l=false;for(var h=0,f=this._animationStates.length;hthis._animationStates[h].layer){l=true;this._animationStates.splice(h,0,o);break}else if(h!==f-1&&o.layer>this._animationStates[h+1].layer){l=true;this._animationStates.splice(h+1,0,o);break}}if(!l){this._animationStates.push(o)}}else{this._animationStates.push(o)}for(var u=0,_=this._armature.getSlots();u<_.length;u++){var c=_[u];var m=c.childArmature;if(m!==null&&m.inheritAnimation&&m.animation.hasAnimation(a)&&m.animation.getState(a)===null){m.animation.fadeIn(a)}}var p=false;for(var d in r.animationTimelines){if(!this._lockUpdate){p=true;this._lockUpdate=true}var v=this.fadeIn(d,e.fadeInTime,1,o.layer,null,0);if(v!==null){v.resetToPose=false;v._parent=o;v.stop()}}if(p){this._lockUpdate=false}if(!this._lockUpdate){if(e.fadeInTime<=0){this._armature.advanceTime(0)}this._lastAnimationState=o}return o};a.prototype.play=function(t,e){if(t===void 0){t=null}if(e===void 0){e=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t!==null?t:"";if(t!==null&&t.length>0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};a.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*e/r.frameCount}return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};a.prototype.getState=function(t){var e=this._animationStates.length;while(e--){var a=this._animationStates[e];if(a.name===t){return a}}return null};a.prototype.hasAnimation=function(t){return t in this._animations};a.prototype.getStates=function(){return this._animationStates};Object.defineProperty(a.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});a.prototype.gotoAndPlay=function(t,e,a,r,i,n,s,o,l){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=-1}if(i===void 0){i=0}if(n===void 0){n=null}if(s===void 0){s=3}if(o===void 0){o=true}if(l===void 0){l=true}console.warn("Deprecated.");o;l;this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.fadeOutMode=s;this._animationConfig.playTimes=r;this._animationConfig.layer=i;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=n!==null?n:"";var h=this._animations[t];if(h&&a>0){this._animationConfig.timeScale=h.duration/a}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStop=function(t,e){if(e===void 0){e=0}console.warn("Deprecated.");return this.gotoAndStopByTime(t,e)};Object.defineProperty(a.prototype,"animationList",{get:function(){console.warn("Deprecated.");return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationDataList",{get:function(){console.warn("Deprecated.");var t=[];for(var e=0,a=this._animationNames.length;e0;if(this._subFadeState<0){this._subFadeState=0;var r=a?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=t.BaseObject.borrowObject(t.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}if(e<0){e=-e}this._fadeTime+=e;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=a?0:1}else if(this._fadeTime>0){this._fadeProgress=a?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=a?1:0}if(this._subFadeState>0){if(!a){this._playheadState|=1;this._fadeState=0}var r=a?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=t.BaseObject.borrowObject(t.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}};i.prototype.init=function(e,a,r){if(this._armature!==null){return}this._armature=e;this._animationData=a;this.resetToPose=r.resetToPose;this.additiveBlending=r.additiveBlending;this.displayControl=r.displayControl;this.actionEnabled=r.actionEnabled;this.layer=r.layer;this.playTimes=r.playTimes;this.timeScale=r.timeScale;this.fadeTotalTime=r.fadeInTime;this.autoFadeOutTime=r.autoFadeOutTime;this.weight=r.weight;this.name=r.name.length>0?r.name:r.animation;this.group=r.group;if(r.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(r.duration<0){this._position=0;this._duration=this._animationData.duration;if(r.position!==0){if(this.timeScale>=0){this._time=r.position}else{this._time=r.position-this._duration}}else{this._time=0}}else{this._position=r.position;this._duration=r.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(r.boneMask.length>0){this._boneMask.length=r.boneMask.length;for(var i=0,n=this._boneMask.length;i0;var i=true;var n=true;var s=this._time;this._weightResult=this.weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult/this._parent._fadeProgress}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(r){var o=a*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*a);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){if(n){for(var h=0,f=this._boneTimelines.length;h0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var m=0,p=this._poseTimelines;m0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};i.prototype.play=function(){this._playheadState=3};i.prototype.stop=function(){this._playheadState&=1};i.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};i.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};i.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,f=i;h0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.leftWeight=0;return 0}else{this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}}}else{return 0}t*=this.leftWeight;this.layerWeight+=t;this.blendWeight=t;return 2}this.dirty=true;this.layer=e;this.layerWeight=t;this.leftWeight=1;this.blendWeight=t;return 1};t.prototype.clear=function(){this.dirty=false;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};return t}();t.BlendState=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.playState=-1;this.currentPlayTimes=-1;this.currentTime=-1;this._tweenState=0;this._frameRate=0;this._frameValueOffset=0;this._frameCount=0;this._frameOffset=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._dragonBonesData=null;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._frameIntArray=null;this._frameFloatArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this._duration+1e-6}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState._animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;this._dragonBonesData=this._animationData.parent.parent;if(this._timelineData!==null){this._frameIntArray=this._dragonBonesData.frameIntArray;this._frameFloatArray=this._dragonBonesData.frameFloatArray;this._frameArray=this._dragonBonesData.frameArray;this._timelineArray=this._dragonBonesData.timelineArray;this._frameIndices=this._dragonBonesData.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._tweenState!==0){this._onUpdateFrame()}}};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a+1;var n=Math.floor(t*i);var s=n===0?0:e[r+n-1];var o=n===i-1?1e4:e[r+n];return(s+(o-s)*(t*i-n))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenProgress=0;this._tweenEasing=0};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this._tweenState=1}};e.prototype._onUpdateFrame=function(){if(this._tweenState===2){this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}else{this._tweenProgress=0}};return e}(e);t.TweenTimelineState=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.bone=null;this.bonePose=null};e.prototype.blend=function(t){var e=this.bone._blendState.blendWeight;var a=this.bone.animationPose;var r=this.bonePose.result;if(t===2){a.x+=r.x*e;a.y+=r.y*e;a.rotation+=r.rotation*e;a.skew+=r.skew*e;a.scaleX+=(r.scaleX-1)*e;a.scaleY+=(r.scaleY-1)*e}else if(e!==1){a.x=r.x*e;a.y=r.y*e;a.rotation=r.rotation*e;a.skew=r.skew*e;a.scaleX=(r.scaleX-1)*e+1;a.scaleY=(r.scaleY-1)*e+1}else{a.x=r.x;a.y=r.y;a.rotation=r.rotation;a.skew=r.skew;a.scaleX=r.scaleX;a.scaleY=r.scaleY}if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){this.bone._transformDirty=true}};return e}(a);t.BoneTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.slot=null};return e}(a);t.SlotTimelineState=i;var n=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.constraint=null};return e}(a);t.ConstraintTimelineState=n})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.ActionTimelineState]"};a.prototype._onCrossFrame=function(e){var a=this._armature.eventDispatcher;if(this._animationState.actionEnabled){var r=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+e];var i=this._frameArray[r+1];var n=this._animationData.parent.actions;for(var s=0;s0){if(n.hasDBEventListener(t.EventObject.COMPLETE)){h=t.BaseObject.borrowObject(t.EventObject);h.type=t.EventObject.COMPLETE;h.armature=this._armature;h.animationState=this._animationState}}}if(this._frameCount>1){var f=this._timelineData;var u=Math.floor(this.currentTime*this._frameRate);var _=this._frameIndices[f.frameIndicesOffset+u];if(this._frameIndex!==_){var c=this._frameIndex;this._frameIndex=_;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[f.offset+5+this._frameIndex];if(o){if(c<0){var m=Math.floor(i*this._frameRate);c=this._frameIndices[f.frameIndicesOffset+m];if(this.currentPlayTimes===r){if(c===_){c=-1}}}while(c>=0){var p=this._animationData.frameOffset+this._timelineArray[f.offset+5+c];var d=this._frameArray[p]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(c)}if(l!==null&&c===0){this._armature._dragonBones.bufferEvent(l);l=null}if(c>0){c--}else{c=this._frameCount-1}if(c===_){break}}}else{if(c<0){var m=Math.floor(i*this._frameRate);c=this._frameIndices[f.frameIndicesOffset+m];var p=this._animationData.frameOffset+this._timelineArray[f.offset+5+c];var d=this._frameArray[p]/this._frameRate;if(this.currentPlayTimes===r){if(i<=d){if(c>0){c--}else{c=this._frameCount-1}}else if(c===_){c=-1}}}while(c>=0){if(c=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.ZOrderTimelineState=a;var r=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*6;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.x=r[t++]*a;i.y=r[t++]*a;i.rotation=r[t++];i.skew=r[t++];i.scaleX=r[t++];i.scaleY=r[t++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){t=this._animationData.frameFloatOffset+this._frameValueOffset}n.x=r[t++]*a-i.x;n.y=r[t++]*a-i.y;n.rotation=r[t++]-i.rotation;n.skew=r[t++]-i.skew;n.scaleX=r[t++]-i.scaleX;n.scaleY=r[t++]-i.scaleY}else{n.x=0;n.y=0;n.rotation=0;n.skew=0;n.scaleX=0;n.scaleY=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.x=0;i.y=0;i.rotation=0;i.skew=0;i.scaleX=1;i.scaleY=1;n.x=0;n.y=0;n.rotation=0;n.skew=0;n.scaleX=0;n.scaleY=0}};a.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.x=t.x+a.x*this._tweenProgress;r.y=t.y+a.y*this._tweenProgress;r.rotation=t.rotation+a.rotation*this._tweenProgress;r.skew=t.skew+a.skew*this._tweenProgress;r.scaleX=t.scaleX+a.scaleX*this._tweenProgress;r.scaleY=t.scaleY+a.scaleY*this._tweenProgress};a.prototype.fadeOut=function(){var e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation);e.skew=t.Transform.normalizeRadian(e.skew)};return a}(t.BoneTimelineState);t.BoneAllTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.x=r[e++]*a;i.y=r[e++]*a;if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){e=this._animationData.frameFloatOffset+this._frameValueOffset}n.x=r[e++]*a-i.x;n.y=r[e++]*a-i.y}else{n.x=0;n.y=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.x=0;i.y=0;n.x=0;n.y=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.x=e.x+a.x*this._tweenProgress;r.y=e.y+a.y*this._tweenProgress};return e}(t.BoneTimelineState);t.BoneTranslateTimelineState=i;var n=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var a=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.rotation=r[a++];i.skew=r[a++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){a=this._animationData.frameFloatOffset+this._frameValueOffset;n.rotation=t.Transform.normalizeRadian(r[a++]-i.rotation)}else{n.rotation=r[a++]-i.rotation}n.skew=r[a++]-i.skew}else{n.rotation=0;n.skew=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.rotation=0;i.skew=0;n.rotation=0;n.skew=0}};a.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.rotation=t.rotation+a.rotation*this._tweenProgress;r.skew=t.skew+a.skew*this._tweenProgress};a.prototype.fadeOut=function(){var e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation);e.skew=t.Transform.normalizeRadian(e.skew)};return a}(t.BoneTimelineState);t.BoneRotateTimelineState=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var a=this._frameFloatArray;var r=this.bonePose.current;var i=this.bonePose.delta;r.scaleX=a[e++];r.scaleY=a[e++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){e=this._animationData.frameFloatOffset+this._frameValueOffset}i.scaleX=a[e++]-r.scaleX;i.scaleY=a[e++]-r.scaleY}else{i.scaleX=0;i.scaleY=0}}else{var r=this.bonePose.current;var i=this.bonePose.delta;r.scaleX=1;r.scaleY=1;i.scaleX=0;i.scaleY=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.scaleX=e.scaleX+a.scaleX*this._tweenProgress;r.scaleY=e.scaleY+a.scaleY*this._tweenProgress};return e}(t.BoneTimelineState);t.BoneScaleTimelineState=s;var o=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[];e._delta=[];e._result=[];return e}e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.surface=null;this._frameFloatOffset=0;this._valueCount=0;this._deformCount=0;this._valueOffset=0;this._current.length=0;this._delta.length=0;this._result.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;if(this._tweenState===2){var i=e+this._valueCount;if(this._frameIndex===this._frameCount-1){i=this._animationData.frameFloatOffset+this._frameValueOffset}for(var n=0;n=0){var t=this._timelineData!==null?this._frameArray[this._frameOffset+1]:this.slot._slotData.displayIndex;if(this.slot.displayIndex!==t){this.slot._setDisplayIndex(t,true)}}};return e}(t.SlotTimelineState);t.SlotDislayTimelineState=l;var h=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[0,0,0,0,0,0,0,0];e._delta=[0,0,0,0,0,0,0,0];e._result=[0,0,0,0,0,0,0,0];return e}e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._dirty=false};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._dragonBonesData.intArray;var a=this._frameIntArray;var r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex*1;var i=a[r];if(i<0){i+=65536}this._current[0]=e[i++];this._current[1]=e[i++];this._current[2]=e[i++];this._current[3]=e[i++];this._current[4]=e[i++];this._current[5]=e[i++];this._current[6]=e[i++];this._current[7]=e[i++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){i=a[this._animationData.frameIntOffset+this._frameValueOffset]}else{i=a[r+1*1]}if(i<0){i+=65536}this._delta[0]=e[i++]-this._current[0];this._delta[1]=e[i++]-this._current[1];this._delta[2]=e[i++]-this._current[2];this._delta[3]=e[i++]-this._current[3];this._delta[4]=e[i++]-this._current[4];this._delta[5]=e[i++]-this._current[5];this._delta[6]=e[i++]-this._current[6];this._delta[7]=e[i++]-this._current[7]}}else{var n=this.slot._slotData.color;this._current[0]=n.alphaMultiplier*100;this._current[1]=n.redMultiplier*100;this._current[2]=n.greenMultiplier*100;this._current[3]=n.blueMultiplier*100;this._current[4]=n.alphaOffset;this._current[5]=n.redOffset;this._current[6]=n.greenOffset;this._current[7]=n.blueOffset}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);this._dirty=true;if(this._tweenState!==2){this._tweenState=0}this._result[0]=(this._current[0]+this._delta[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._delta[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._delta[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._delta[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._delta[4]*this._tweenProgress;this._result[5]=this._current[5]+this._delta[5]*this._tweenProgress;this._result[6]=this._current[6]+this._delta[6]*this._tweenProgress;this._result[7]=this._current[7]+this._delta[7]*this._tweenProgress};e.prototype.fadeOut=function(){this._tweenState=0;this._dirty=false};e.prototype.update=function(e){t.prototype.update.call(this,e);if(this._tweenState!==0||this._dirty){var a=this.slot._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);a.alphaMultiplier+=(this._result[0]-a.alphaMultiplier)*r;a.redMultiplier+=(this._result[1]-a.redMultiplier)*r;a.greenMultiplier+=(this._result[2]-a.greenMultiplier)*r;a.blueMultiplier+=(this._result[3]-a.blueMultiplier)*r;a.alphaOffset+=(this._result[4]-a.alphaOffset)*r;a.redOffset+=(this._result[5]-a.redOffset)*r;a.greenOffset+=(this._result[6]-a.greenOffset)*r;a.blueOffset+=(this._result[7]-a.blueOffset)*r;this.slot._colorDirty=true}}else if(this._dirty){this._dirty=false;if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){a.alphaMultiplier=this._result[0];a.redMultiplier=this._result[1];a.greenMultiplier=this._result[2];a.blueMultiplier=this._result[3];a.alphaOffset=this._result[4];a.redOffset=this._result[5];a.greenOffset=this._result[6];a.blueOffset=this._result[7];this.slot._colorDirty=true}}}};return e}(t.SlotTimelineState);t.SlotColorTimelineState=h;var f=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[];e._delta=[];e._result=[];return e}e.toString=function(){return"[class dragonBones.DeformTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.vertexOffset=0;this._dirty=false;this._frameFloatOffset=0;this._valueCount=0;this._deformCount=0;this._valueOffset=0;this._current.length=0;this._delta.length=0;this._result.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;if(this._tweenState===2){var i=e+this._valueCount;if(this._frameIndex===this._frameCount-1){i=this._animationData.frameFloatOffset+this._frameValueOffset}for(var n=0;n=0){this._floats[2]=this._floats[0]+this._floats[1]*this._tweenProgress}this._floats[5]=this._floats[3]+this._floats[4]*this._tweenProgress};e.prototype.blend=function(t){var e=this.animationState;var a=e._blendState.blendWeight;if(t===2){e.weight+=this._floats[5]*a;e.currentTime+=this._floats[2]*a}else{e.weight=this._floats[5]*a;e.currentTime=this._floats[2]*a}};return e}(t.TweenTimelineState);t.AnimationTimelineState=_})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.actionDataToInstance=function(t,a,r){if(t.type===0){a.type=e.FRAME_EVENT}else{a.type=t.type===10?e.FRAME_EVENT:e.SOUND_EVENT}a.name=t.name;a.armature=r;a.actionData=t;a.data=t.data;if(t.bone!==null){a.bone=r.getBone(t.bone.name)}if(t.slot!==null){a.slot=r.getSlot(t.slot.name)}};e.toString=function(){return"[class dragonBones.EventObject]"};e.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};e.START="start";e.LOOP_COMPLETE="loopComplete";e.COMPLETE="complete";e.FADE_IN="fadeIn";e.FADE_IN_COMPLETE="fadeInComplete";e.FADE_OUT="fadeOut";e.FADE_OUT_COMPLETE="fadeOutComplete";e.FRAME_EVENT="frameEvent";e.SOUND_EVENT="soundEvent";return e}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(){}e._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};e._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};e._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};e._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};e._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};e._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};e._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};e._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};e._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};e.parseDragonBonesData=function(e){console.warn("Deprecated.");if(e instanceof ArrayBuffer){return t.BinaryDataParser.getInstance().parseDragonBonesData(e)}else{return t.ObjectDataParser.getInstance().parseDragonBonesData(e)}};e.parseTextureAtlasData=function(a,r){if(r===void 0){r=1}console.warn("已废弃");var i={};var n=a[e.SUB_TEXTURE];for(var s=0,o=n.length;s255){return encodeURI(i)}}}return i}return String(i)}return r};r.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var f=1-l;var u=f*f;var _=l*l;var c=f*u;var m=3*l*u;var p=3*f*_;var d=l*_;h.x=c*t+m*a+p*i+d*s;h.y=c*e+m*r+p*n+d*o};r.prototype._samplingEasingCurve=function(t,e){var a=t.length;var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var y=(v+d)*.5;this._getCurvePoint(l,h,f,u,_,c,m,p,y,this._helpPoint);if(s-this._helpPoint.x>0){d=y}else{v=y}}e[i]=this._helpPoint.y}};r.prototype._parseActionDataInFrame=function(e,a,r,i){if(t.DataParser.EVENT in e){this._mergeActionFrame(e[t.DataParser.EVENT],a,10,r,i)}if(t.DataParser.SOUND in e){this._mergeActionFrame(e[t.DataParser.SOUND],a,11,r,i)}if(t.DataParser.ACTION in e){this._mergeActionFrame(e[t.DataParser.ACTION],a,0,r,i)}if(t.DataParser.EVENTS in e){this._mergeActionFrame(e[t.DataParser.EVENTS],a,10,r,i)}if(t.DataParser.ACTIONS in e){this._mergeActionFrame(e[t.DataParser.ACTIONS],a,0,r,i)}};r.prototype._mergeActionFrame=function(e,r,i,n,s){var o=t.DragonBones.webAssembly?this._armature.actions.size():this._armature.actions.length;var l=this._parseActionData(e,i,n,s);var h=0;var f=null;for(var u=0,_=l;u<_.length;u++){var c=_[u];this._armature.addAction(c,false)}if(this._actionFrames.length===0){f=new a;f.frameStart=0;this._actionFrames.push(f);f=null}for(var m=0,p=this._actionFrames;mr){break}h++}if(f===null){f=new a;f.frameStart=r;this._actionFrames.splice(h+1,0,f)}for(var v=0;v0){var m=i.getBone(_);if(m!==null){c.parent=m}else{if(!(_ in this._cacheBones)){this._cacheBones[_]=[]}this._cacheBones[_].push(c)}}if(c.name in this._cacheBones){for(var p=0,d=this._cacheBones[c.name];p0&&a.parent!==null){n.root=a.parent;n.bone=a}else{n.root=a;n.bone=null}return n};r.prototype._parsePathConstraint=function(e){var a=this._armature.getSlot(r._getString(e,t.DataParser.TARGET,""));if(a===null){return null}var i=this._armature.defaultSkin;if(i===null){return null}var n=i.getDisplay(a.name,r._getString(e,t.DataParser.TARGET_DISPLAY,a.name));if(n===null||!(n instanceof t.PathDisplayData)){return null}var s=e[t.DataParser.BONES];if(s===null||s.length===0){return null}var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=r._getString(e,t.DataParser.NAME,"");o.type=1;o.pathSlot=a;o.pathDisplayData=n;o.target=a.parent;o.positionMode=t.DataParser._getPositionMode(r._getString(e,t.DataParser.POSITION_MODE,""));o.spacingMode=t.DataParser._getSpacingMode(r._getString(e,t.DataParser.SPACING_MODE,""));o.rotateMode=t.DataParser._getRotateMode(r._getString(e,t.DataParser.ROTATE_MODE,""));o.position=r._getNumber(e,t.DataParser.POSITION,0);o.spacing=r._getNumber(e,t.DataParser.SPACING,0);o.rotateOffset=r._getNumber(e,t.DataParser.ROTATE_OFFSET,0);o.rotateMix=r._getNumber(e,t.DataParser.ROTATE_MIX,1);o.translateMix=r._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var l=0,h=s;l0?i:a;this._parsePivot(e,o);break;case 1:var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);l.name=a;l.path=i.length>0?i:a;l.inheritAnimation=true;if(t.DataParser.ACTIONS in e){var h=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);for(var f=0,u=h;f0?i:a;d.vertices.data=this._data;if(t.DataParser.SHARE in e){this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}else{this._parseMesh(e,d)}if(t.DataParser.GLUE_WEIGHTS in e&&t.DataParser.GLUE_MESHES in e){this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}break;case 3:var v=this._parseBoundingBox(e);if(v!==null){var y=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);y.name=a;y.path=i.length>0?i:a;y.boundingBox=v}break;case 4:var g=e[t.DataParser.LENGTHS];var D=s=t.BaseObject.borrowObject(t.PathDisplayData);D.closed=r._getBoolean(e,t.DataParser.CLOSED,false);D.constantSpeed=r._getBoolean(e,t.DataParser.CONSTANT_SPEED,false);D.name=a;D.path=i.length>0?i:a;D.vertices.data=this._data;D.curveLengths.length=g.length;for(var b=0,T=g.length;ba.width){a.width=l}if(ha.height){a.height=h}}}a.width-=a.x;a.height-=a.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return a};r.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);a.frameCount=Math.max(r._getNumber(e,t.DataParser.DURATION,1),1);a.playTimes=r._getNumber(e,t.DataParser.PLAY_TIMES,1);a.duration=a.frameCount/this._armature.frameRate;a.fadeInTime=r._getNumber(e,t.DataParser.FADE_IN_TIME,0);a.scale=r._getNumber(e,t.DataParser.SCALE,1);a.name=r._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME);if(a.name.length===0){a.name=t.DataParser.DEFAULT_NAME}a.frameIntOffset=this._frameIntArray.length;a.frameFloatOffset=this._frameFloatArray.length;a.frameOffset=this._frameArray.length;this._animation=a;if(t.DataParser.FRAME in e){var i=e[t.DataParser.FRAME];var n=i.length;if(n>0){for(var s=0,o=0;s0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,false,false,0,this._parseActionFrame);this._actionFrames.length=0}this._animation=null;return a};r.prototype._parseTimeline=function(e,i,n,s,o,l,h,f){if(e!==null&&n.length>0&&n in e){i=e[n]}if(i===null){return null}var u=i.length;if(u===0){return null}var _=this._frameIntArray.length;var c=this._frameFloatArray.length;var m=t.BaseObject.borrowObject(t.TimelineData);var p=this._timelineArray.length;this._timelineArray.length+=1+1+1+1+1+u;if(e!==null){this._timelineArray[p+0]=Math.round(r._getNumber(e,t.DataParser.SCALE,1)*100);this._timelineArray[p+1]=Math.round(r._getNumber(e,t.DataParser.OFFSET,0)*100)}else{this._timelineArray[p+0]=100;this._timelineArray[p+1]=0}this._timelineArray[p+2]=u;this._timelineArray[p+3]=h;if(o){this._timelineArray[p+4]=_-this._animation.frameIntOffset}else if(l){this._timelineArray[p+4]=c-this._animation.frameFloatOffset}else{this._timelineArray[p+4]=0}this._timeline=m;m.type=s;m.offset=p;if(u===1){m.frameIndicesOffset=-1;this._timelineArray[p+5+0]=f.call(this,i[0],0,0)-this._animation.frameOffset}else{var d=this._animation.frameCount+1;var v=this._data.frameIndices;var y=0;if(t.DragonBones.webAssembly){y=v.size();v.resize(y+d,0)}else{y=v.length;v.length+=d}m.frameIndicesOffset=y;for(var g=0,D=0,b=0,T=0;g0){if(t.DataParser.CURVE in e){var s=i+1;this._helpArray.length=s;this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[n+1]=2;this._frameArray[n+2]=s;for(var o=0;o0){var s=this._armature.sortedSlots.length;var o=new Array(s-n.length/2);var l=new Array(s);for(var h=0;h0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.TWEEN_ROTATE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[o++]=this._helpTransform.x;this._frameFloatArray[o++]=this._helpTransform.y;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=this._helpTransform.skew;this._frameFloatArray[o++]=this._helpTransform.scaleX;this._frameFloatArray[o++]=this._helpTransform.scaleY;this._parseActionDataInFrame(e,a,this._bone,this._slot);return s};r.prototype._parseBoneTranslateFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,0);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,0);return n};r.prototype._parseBoneRotateFrame=function(e,a,i){var n=r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;if(a!==0){if(this._prevClockwise===0){n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation)}else{if(this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.CLOCK_WISE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD;return s};r.prototype._parseBoneScaleFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,1);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,1);return n};r.prototype._parseSurfaceFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=e[t.DataParser.VERTICES];var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._surface.vertices.length/2;var f=0;var u=0;this._frameFloatArray.length+=h*2;for(var _=0;_=o.length){f=0}else{f=o[_-l]}if(_+1=o.length){u=0}else{u=o[_+1-l]}this._frameFloatArray[n+_]=f;this._frameFloatArray[n+_+1]=u}if(a===0){var c=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[c+0]=0;this._frameIntArray[c+1]=this._frameFloatArray.length-n;this._frameIntArray[c+2]=this._frameFloatArray.length-n;this._frameIntArray[c+3]=0;this._frameIntArray[c+4]=n-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=c-this._animation.frameIntOffset}return s};r.prototype._parseSlotDisplayFrame=function(e,a,i){var n=this._parseFrame(e,a,i);this._frameArray.length+=1;if(t.DataParser.VALUE in e){this._frameArray[n+1]=r._getNumber(e,t.DataParser.VALUE,0)}else{this._frameArray[n+1]=r._getNumber(e,t.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(e,a,this._slot.parent,this._slot);return n};r.prototype._parseSlotColorFrame=function(e,a,r){var i=this._parseTweenFrame(e,a,r);var n=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){o;this._parseColorTransform(s,this._helpColorTransform);n=this._intArray.length;this._intArray.length+=8;this._intArray[n++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.redMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.alphaOffset);this._intArray[n++]=Math.round(this._helpColorTransform.redOffset);this._intArray[n++]=Math.round(this._helpColorTransform.greenOffset);this._intArray[n++]=Math.round(this._helpColorTransform.blueOffset);n-=8;break}}if(n<0){if(this._defaultColorOffset<0){this._defaultColorOffset=n=this._intArray.length;this._intArray.length+=8;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=0;this._intArray[n++]=0;this._intArray[n++]=0;this._intArray[n++]=0}n=this._defaultColorOffset}var l=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[l]=n;return i};r.prototype._parseSlotFFDFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null;var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._intArray[this._mesh.vertices.offset+0];var f=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var u=this._mesh.vertices.weight;var _=0;var c=0;var m=0;var p=0;if(u!==null){var d=this._weightSlotPose[f];this._helpMatrixA.copyFromArray(d,0);this._frameFloatArray.length+=u.count*2;m=u.offset+2+u.bones.length}else{this._frameFloatArray.length+=h*2}for(var v=0;v=o.length){_=0}else{_=o[v-l]}if(v+1=o.length){c=0}else{c=o[v+1-l]}}if(u!==null){var y=this._weightBonePoses[f];var g=this._intArray[m++];this._helpMatrixA.transformPoint(_,c,this._helpPoint,true);_=this._helpPoint.x;c=this._helpPoint.y;for(var D=0;D=0||t.DataParser.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);s.version=i;s.name=r._getString(e,t.DataParser.NAME,"");s.frameRate=r._getNumber(e,t.DataParser.FRAME_RATE,24);if(s.frameRate===0){s.frameRate=24}if(t.DataParser.ARMATURE in e){this._data=s;this._parseArray(e);var o=e[t.DataParser.ARMATURE];for(var l=0,h=o;l0){s.stage=s.getArmature(s.armatureNames[0])}this._data=null}if(t.DataParser.TEXTURE_ATLAS in e){this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]}return s}else{console.assert(false,"Nonsupport data version: "+i+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};r.prototype.parseTextureAtlasData=function(e,a,i){if(i===void 0){i=1}console.assert(e!==undefined);if(e===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(n,a,i);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}a.width=r._getNumber(e,t.DataParser.WIDTH,0);a.height=r._getNumber(e,t.DataParser.HEIGHT,0);a.scale=i===1?1/r._getNumber(e,t.DataParser.SCALE,1):i;a.name=r._getString(e,t.DataParser.NAME,"");a.imagePath=r._getString(e,t.DataParser.IMAGE_PATH,"");if(t.DataParser.SUB_TEXTURE in e){var s=e[t.DataParser.SUB_TEXTURE];for(var o=0,l=s.length;o0&&_>0){f.frame=t.TextureData.createRectangle();f.frame.x=r._getNumber(h,t.DataParser.FRAME_X,0);f.frame.y=r._getNumber(h,t.DataParser.FRAME_Y,0);f.frame.width=u;f.frame.height=_}a.addTexture(f)}}return true};r.getInstance=function(){if(r._objectDataParserInstance===null){r._objectDataParserInstance=new r}return r._objectDataParserInstance};r._objectDataParserInstance=null;return r}(t.DataParser);t.ObjectDataParser=e;var a=function(){function t(){this.frameStart=0;this.actions=[]}return t}();t.ActionFrame=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.prototype._inRange=function(t,e,a){return e<=t&&t<=a};a.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var f=0;while(t.length>i){var u=t[i++];if(u===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(u,0,127)){s=u}else{if(this._inRange(u,194,223)){l=1;f=128;o=u-192}else if(this._inRange(u,224,239)){l=2;f=2048;o=u-224}else if(this._inRange(u,240,244)){l=3;f=65536;o=u-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(u,128,191)){o=0;l=0;h=0;f=0;i--;s=u}else{h+=1;o=o+(u-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var c=f;o=0;l=0;h=0;f=0;if(this._inRange(_,c,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=u}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};a.prototype._getUTF16Key=function(t){for(var e=0,a=t.length;e255){return encodeURI(t)}}return t};a.prototype._parseBinaryTimeline=function(e,a,r){if(r===void 0){r=null}var i=r!==null?r:t.BaseObject.borrowObject(t.TimelineData);i.type=e;i.offset=a;this._timeline=i;var n=this._timelineArrayBuffer[i.offset+2];if(n===1){i.frameIndicesOffset=-1}else{var s=0;var o=this._animation.frameCount+1;var l=this._data.frameIndices;if(t.DragonBones.webAssembly){s=l.size();l.resize(s+o,0)}else{s=l.length;l.length+=o}i.frameIndicesOffset=s;for(var h=0,f=0,u=0,_=0;h=0){var i=t.BaseObject.borrowObject(t.WeightData);var n=this._intArrayBuffer[a.offset+0];var s=this._intArrayBuffer[r+0];i.offset=r;for(var o=0;o0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};e.prototype._buildBones=function(e,a){for(var r=0,i=e.armature.sortedBones;r0){o.texture=this._getTextureData(e.textureAtlasName,a.path)}if(r!==null&&r.type===2&&this._isSupportMesh()){s=i.meshDisplay}else{s=i.rawDisplay}break}case 2:{var l=a;if(l.texture===null){l.texture=this._getTextureData(n,l.path)}else if(e!==null&&e.textureAtlasName.length>0){l.texture=this._getTextureData(e.textureAtlasName,l.path)}if(this._isSupportMesh()){s=i.meshDisplay}else{s=i.rawDisplay}break}case 1:{var h=a;var f=this._buildChildArmature(e,i,a);if(f!==null){f.inheritAnimation=h.inheritAnimation;if(!f.inheritAnimation){var u=h.actions.length>0?h.actions:f.armatureData.defaultActions;if(u.length>0){for(var _=0,c=u;_=0){continue}var f=a.getDisplays(h.name);if(!f){if(s!==null&&a!==s){f=s.getDisplays(h.name)}if(!f){if(r){h.rawDisplayDatas=null;h.displayList=[]}continue}}var u=t.DragonBones.webAssembly?f.size():f.length;var _=h.displayList;_.length=u;for(var c=0,m=u;c0};a.prototype.addDBEventListener=function(t,e,a){if(!(t in this._signals)){this._signals[t]=new Phaser.Signal}var r=this._signals[t];r.add(e,a)};a.prototype.removeDBEventListener=function(t,e,a){if(t in this._signals){var r=this._signals[t];r.remove(e,a)}};Object.defineProperty(a.prototype,"armature",{get:function(){return this._armature},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animation",{get:function(){return this._armature.animation},enumerable:true,configurable:true});a.prototype.hasEvent=function(t){return this.hasDBEventListener(t)};a.prototype.addEvent=function(t,e,a){this.addDBEventListener(t,e,a)};a.prototype.removeEvent=function(t,e,a){this.removeDBEventListener(t,e,a)};return a}(Phaser.Sprite);t.PhaserArmatureDisplay=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.PhaserSlot]"};a.prototype._onClear=function(){e.prototype._onClear.call(this);this._textureScale=1;this._renderDisplay=null};a.prototype._initDisplay=function(t,e){t;e};a.prototype._disposeDisplay=function(t,e){t;if(!e){t.destroy(true)}};a.prototype._onUpdateDisplay=function(){this._renderDisplay=this._display?this._display:this._rawDisplay};a.prototype._addDisplay=function(){var t=this._armature.display;t.addChild(this._renderDisplay)};a.prototype._replaceDisplay=function(t){var e=this._armature.display;var a=t;e.addChild(this._renderDisplay);e.swapChildren(this._renderDisplay,a);e.removeChild(a);this._textureScale=1};a.prototype._removeDisplay=function(){this._renderDisplay.parent.removeChild(this._renderDisplay)};a.prototype._updateZOrder=function(){var t=this._armature.display;var e=t.getChildIndex(this._renderDisplay);if(e===this._zOrder){return}t.addChildAt(this._renderDisplay,this._zOrder)};a.prototype._updateVisible=function(){this._renderDisplay.visible=this._parent.visible&&this._visible};a.prototype._updateBlendMode=function(){if(this._renderDisplay instanceof PIXI.Sprite){switch(this._blendMode){case 0:this._renderDisplay.blendMode=PIXI.blendModes.NORMAL;break;case 1:this._renderDisplay.blendMode=PIXI.blendModes.ADD;break;case 3:this._renderDisplay.blendMode=PIXI.blendModes.DARKEN;break;case 4:this._renderDisplay.blendMode=PIXI.blendModes.DIFFERENCE;break;case 6:this._renderDisplay.blendMode=PIXI.blendModes.HARD_LIGHT;break;case 9:this._renderDisplay.blendMode=PIXI.blendModes.LIGHTEN;break;case 10:this._renderDisplay.blendMode=PIXI.blendModes.MULTIPLY;break;case 11:this._renderDisplay.blendMode=PIXI.blendModes.OVERLAY;break;case 12:this._renderDisplay.blendMode=PIXI.blendModes.SCREEN;break;default:break}}};a.prototype._updateColor=function(){this._renderDisplay.alpha=this._colorTransform.alphaMultiplier;if(this._renderDisplay instanceof PIXI.Sprite){var t=(Math.round(this._colorTransform.redMultiplier*255)<<16)+(Math.round(this._colorTransform.greenMultiplier*255)<<8)+Math.round(this._colorTransform.blueMultiplier*255);this._renderDisplay.tint=t}};a.prototype._updateFrame=function(){var e=this._deformVertices!==null&&this._display===this._meshDisplay?this._deformVertices.verticesData:null;var a=this._textureData;if(this._displayIndex>=0&&this._display!==null&&a!==null){var r=a.parent;if(this._armature.replacedTexture!==null&&this._rawDisplayDatas!==null&&this._rawDisplayDatas.indexOf(this._displayData)>=0){if(this._armature._replaceTextureAtlasData===null){r=t.BaseObject.borrowObject(t.PhaserTextureAtlasData);r.copyFrom(a.parent);r.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=r}else{r=this._armature._replaceTextureAtlasData}a=r.getTexture(a.name)}var i=a.renderTexture;if(i!==null){if(e!==null){}else{this._textureScale=a.parent.scale*this._armature._armatureData.scale;var n=this._renderDisplay;n.setTexture(i)}this._visibleDirty=true;return}}if(e!==null){}else{var n=this._renderDisplay;n.x=0;n.y=0;n.visible=false}};a.prototype._updateMesh=function(){};a.prototype._updateGlueMesh=function(){};a.prototype._updateTransform=function(){this.updateGlobalTransform();var t=this.global;if(this._renderDisplay===this._rawDisplay||this._renderDisplay===this._meshDisplay){var e=t.x-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY);var a=t.y-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY);this._renderDisplay.x=e;this._renderDisplay.y=a}else{this._renderDisplay.x=t.x;this._renderDisplay.y=t.y}this._renderDisplay.rotation=t.rotation;this._renderDisplay.skew=t.skew;this._renderDisplay.scale.x=t.scaleX*this._textureScale;this._renderDisplay.scale.y=t.scaleY*this._textureScale};a.prototype._identityTransform=function(){this._renderDisplay.x=0;this._renderDisplay.y=0;this._renderDisplay.rotation=0;this._renderDisplay.skew=0;this._renderDisplay.scale.x=1;this._renderDisplay.scale.y=1};return a}(t.Slot);t.PhaserSlot=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.prototype.updateTransform=function(e){if(!e&&!this.parent&&!this.game){return this}var a=this.parent;if(e){a=e}else if(!this.parent){a=this.game.world}var r=a.worldTransform;var i=this.worldTransform;var n,s,o,l,h,f;if(this.rotation%Phaser.Math.PI2){if(this.rotation!==this.rotationCache){this.rotationCache=this.rotation;this._sr=Math.sin(this.rotation);this._cr=Math.cos(this.rotation)}var u=this.skew%t.Transform.PI_D;if(u>.01||u<-.01){n=this._cr*this.scale.x;s=this._sr*this.scale.x;o=-Math.sin(u+this.rotation)*this.scale.y;l=Math.cos(u+this.rotation)*this.scale.y;h=this.position.x;f=this.position.y}else{n=this._cr*this.scale.x;s=this._sr*this.scale.x;o=-this._sr*this.scale.y;l=this._cr*this.scale.y;h=this.position.x;f=this.position.y}if(this.pivot.x||this.pivot.y){h-=this.pivot.x*n+this.pivot.y*o;f-=this.pivot.x*s+this.pivot.y*l}i.a=n*r.a+s*r.c;i.b=n*r.b+s*r.d;i.c=o*r.a+l*r.c;i.d=o*r.b+l*r.d;i.tx=h*r.a+f*r.c+r.tx;i.ty=h*r.b+f*r.d+r.ty}else{n=this.scale.x;s=0;o=0;l=this.scale.y;h=this.position.x-this.pivot.x*n;f=this.position.y-this.pivot.y*l;i.a=n*r.a;i.b=n*r.b;i.c=l*r.c;i.d=l*r.d;i.tx=h*r.a+f*r.c+r.tx;i.ty=h*r.b+f*r.d+r.ty}n=i.a;s=i.b;o=i.c;l=i.d;var _=n*l-s*o;if(n||s){var c=Math.sqrt(n*n+s*s);this.worldRotation=s>0?Math.acos(n/c):-Math.acos(n/c);this.worldScale.x=c;this.worldScale.y=_/c}else if(o||l){var m=Math.sqrt(o*o+l*l);this.worldRotation=Phaser.Math.HALF_PI-(l>0?Math.acos(-o/m):-Math.acos(o/m));this.worldScale.x=_/m;this.worldScale.y=m}else{this.worldScale.x=0;this.worldScale.y=0}this.worldAlpha=this.alpha*a.worldAlpha;this.worldPosition.x=i.tx;this.worldPosition.y=i.ty;this._currentBounds=null;if(this.transformCallback){this.transformCallback.call(this.transformCallbackContext,i,r)}return this};return a}(Phaser.Image);t.PhaserSlotDisplay=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(t){if(t===void 0){t=null}var r=e.call(this,t)||this;r._dragonBones=a._dragonBonesInstance;return r}a.init=function(e){if(a._game!==null){return}a._game=e;var r=new t.PhaserArmatureDisplay;a._dragonBonesInstance=new t.DragonBones(r)};Object.defineProperty(a,"factory",{get:function(){if(a._factory===null){a._factory=new a}return a._factory},enumerable:true,configurable:true});a.prototype._isSupportMesh=function(){console.warn("Phaser-ce can not support mesh.");return false};a.prototype._buildTextureAtlasData=function(e,a){if(e){e.renderTexture=a}else{e=t.BaseObject.borrowObject(t.PhaserTextureAtlasData)}return e};a.prototype._buildArmature=function(e){var a=t.BaseObject.borrowObject(t.Armature);var r=new t.PhaserArmatureDisplay;a.init(e.armature,r,r,this._dragonBones);return a};a.prototype._buildSlot=function(e,r,i){e;i;var n=t.BaseObject.borrowObject(t.PhaserSlot);var s=new t.PhaserSlotDisplay(a._game,0,0,Phaser.Cache.DEFAULT);n.init(r,i,s,s);return n};a.prototype.buildArmatureDisplay=function(t,e,a,r){if(e===void 0){e=""}if(a===void 0){a=""}if(r===void 0){r=""}var i=this.buildArmature(t,e||"",a||"",r||"");if(i!==null){this._dragonBones.clock.add(i);return i.display}return null};a.prototype.getTextureDisplay=function(t,e){if(e===void 0){e=null}var r=this._getTextureData(e!==null?e:"",t);if(r!==null&&r.renderTexture!==null){return new Phaser.Sprite(a._game,0,0)}return null};Object.defineProperty(a.prototype,"soundEventManager",{get:function(){return this._dragonBones.eventManager},enumerable:true,configurable:true});a._game=null;a._dragonBonesInstance=null;a._factory=null;return a}(t.BaseFactory);t.PhaserFactory=e})(dragonBones||(dragonBones={}));
\ No newline at end of file
+"use strict";var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(e,a){t(e,a);function r(){this.constructor=e}e.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}();var dragonBones;(function(t){var e=function(){function e(a){this._clock=new t.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=a;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var a=0,r=this._objects;a0){for(var n=0;na){i.length=a}t._maxCountMap[r]=a}else{t._defaultMaxCount=a;for(var r in t._poolsMap){var i=t._poolsMap[r];if(i.length>a){i.length=a}if(r in t._maxCountMap){t._maxCountMap[r]=a}}}};t.clearPool=function(e){if(e===void 0){e=null}if(e!==null){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){r.length=0}}else{for(var i in t._poolsMap){var r=t._poolsMap[i];r.length=0}}};t.borrowObject=function(e){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){var i=r.pop();i._isInPool=false;return i}var n=new e;n._onClear();return n};t.prototype.returnToPool=function(){this._onClear();t._returnObject(this)};t._hashCode=0;t._defaultMaxCount=3e3;t._maxCountMap={};t._poolsMap={};return t}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var u=l+t.width;var f=h+t.height;var _=a*l+i*h+s;var m=r*l+n*h+o;var p=a*u+i*h+s;var c=r*u+n*h+o;var d=a*u+i*f+s;var y=r*u+n*f+o;var v=a*l+i*f+s;var g=r*l+n*f+o;var D=0;if(_>p){D=_;_=p;p=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_v?p:v)-t.x);if(m>c){D=m;m=c;c=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(mg?c:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}t.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};t.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};t.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};t.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};t.prototype.fromMatrix=function(e){var a=this.scaleX,r=this.scaleY;var i=t.PI_Q;this.x=e.tx;this.y=e.ty;this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);this.scaleX=this.rotation>-i&&this.rotation-i&&n=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(r>=0&&this.scaleY<0){this.scaleY=-this.scaleY;n=n-Math.PI}this.skew=n-this.rotation;return this};t.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};t.PI=Math.PI;t.PI_D=Math.PI*2;t.PI_H=Math.PI/2;t.PI_Q=Math.PI/4;t.RAD_DEG=180/Math.PI;t.DEG_RAD=Math.PI/180;return t}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.ints=[];e.floats=[];e.strings=[];return e}e.toString=function(){return"[class dragonBones.UserData]"};e.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};e.prototype.addInt=function(t){this.ints.push(t)};e.prototype.addFloat=function(t){this.floats.push(t)};e.prototype.addString=function(t){this.strings.push(t)};e.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};a.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};a.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};a.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};a.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};a.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};a.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};a.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};a.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};a.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return a}(t.BaseObject);t.ArmatureData=e;var a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.transform=new t.Transform;a.userData=null;return a}a.toString=function(){return"[class dragonBones.BoneData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return a}(t.BaseObject);t.BoneData=a;var r=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.geometry=new t.GeometryData;return a}a.toString=function(){return"[class dragonBones.SurfaceData]"};a.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return a}(a);t.SurfaceData=r;var i=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}a.createColor=function(){return new t.ColorTransform};a.toString=function(){return"[class dragonBones.SlotData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.zIndex=0;this.alpha=1;this.name="";this.color=null;this.userData=null;this.parent=null};a.DEFAULT_COLOR=new t.ColorTransform;return a}(t.BaseObject);t.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.displays={};return e}e.toString=function(){return"[class dragonBones.SkinData]"};e.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};e.rectangleIntersectsSegment=function(t,a,r,i,n,s,o,l,h,u,f){if(h===void 0){h=null}if(u===void 0){u=null}if(f===void 0){f=null}var _=t>n&&ts&&an&&rs&&i=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=this.width*.5;var h=this.height*.5;var u=e.rectangleIntersectsSegment(t,a,r,i,-l,-h,l,h,n,s,o);return u};return e}(e);t.RectangleBoundingBoxData=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.EllipseData]"};e.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=s/o;var _=f*f;e*=f;r*=f;var m=a-t;var p=r-e;var c=Math.sqrt(m*m+p*p);var d=m/c;var y=p/c;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var T=s*s;var b=T-D+g;var A=0;if(b>=0){var P=Math.sqrt(b);var S=v-P;var O=v+P;var x=S<0?-1:S<=c?0:1;var B=O<0?-1:O<=c?0:1;var E=x*B;if(E<0){return-1}else if(E===0){if(x===-1){A=2;a=t+O*d;r=(e+O*y)/f;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,a/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*y)/f;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.x=Math.atan2(e/T*_,t/T);u.y=u.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+O*d;h.y=(e+O*y)/f;if(u!==null){u.y=Math.atan2(h.y/T*_,h.x/T)}}}}}return A};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};e.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=e.ellipseIntersectsSegment(t,a,r,i,0,0,this.width*.5,this.height*.5,n,s,o);return l};return e}(e);t.EllipseBoundingBoxData=r;var i=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};e.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var u=e-r;var f=t*r-e*a;var _=0;var m=i[l-2];var p=i[l-1];var c=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var T=0;T=m&&B<=b||B>=b&&B<=m)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var E=(f*S-u*O)/x;if((E>=p&&E<=A||E>=A&&E<=p)&&(u===0||E>=e&&E<=r||E>=r&&E<=e)){if(s!==null){var M=B-t;if(M<0){M=-M}if(_===0){c=M;d=M;y=B;v=E;g=B;D=E;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}}else{if(Md){d=M;g=B;D=E;if(o!==null){o.y=Math.atan2(A-p,b-m)-Math.PI*.5}}}_++}else{y=B;v=E;g=B;D=E;_++;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}break}}}m=b;p=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};e.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;ae._zIndex*1e3+e._zOrder?1:-1};a.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};a.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};a.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};a.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};a.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};a.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};a.prototype.init=function(e,a,r,i){if(this._armatureData!==null){return}this._armatureData=e;this._animation=t.BaseObject.borrowObject(t.Animation);this._proxy=a;this._display=r;this._dragonBones=i;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};a.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty||this._zIndexDirty){this._slots.sort(a._onSortSlots);if(this._zIndexDirty){for(var r=0,i=this._slots.length;r0){for(var f=0,_=this._actions;f<_.length;f++){var m=_[f];var p=m.actionData;if(p!==null){if(p.type===0){if(m.slot!==null){var c=m.slot.childArmature;if(c!==null){c.animation.fadeIn(p.name)}}else if(m.bone!==null){for(var d=0,y=this.getSlots();d0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var b=o?i.y-e:i.x-t;if(b<0){b=-b}if(d===null||bh){h=b;_=n.x;m=n.y;y=D;if(s!==null){c=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=u;i.y=f;if(s!==null){s.x=p}}if(y!==null&&n!==null){n.x=_;n.y=m;if(s!==null){s.y=c}}return d};a.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};a.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};a.prototype.invalidUpdate=function(){this._transformDirty=true};a.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(a.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=r){return this.globalTransformMatrix}n=a>this._kX*(t+r)+d;p=((o*l+o+l+l+m)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=m*(h+2);var D=this._hullCache[4];var T=this._hullCache[5];var b=this._hullCache[2]-(l-m)*D;var A=this._hullCache[3]-(l-m)*T;var P=this._vertices;if(n){this._getAffineTransform(-r,d+f,i-r,f,P[g+h+2],P[g+h+3],b+D,A+T,P[g],P[g+1],e._helpTransform,v,true)}else{this._getAffineTransform(-i,d,i-r,f,b,A,P[g],P[g+1],b+D,A+T,e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(t>=r){if(a<-r||a>=r){return this.globalTransformMatrix}n=a>this._kX*(t-i)+d;p=((o*l+o+m)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=(m+1)*(h+2)-2;var D=this._hullCache[4];var T=this._hullCache[5];var b=this._hullCache[0]+m*D;var A=this._hullCache[1]+m*T;var P=this._vertices;if(n){this._getAffineTransform(i,d+f,i-r,f,b+D,A+T,P[g+h+2],P[g+h+3],b,A,e._helpTransform,v,true)}else{this._getAffineTransform(r,d,i-r,f,P[g],P[g+1],b,A,P[g+h+2],P[g+h+3],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(a<-r){if(t<-r||t>=r){return this.globalTransformMatrix}n=a>this._kY*(t-c-u)-i;p=((o*l+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=_*2;var D=this._hullCache[10];var T=this._hullCache[11];var b=this._hullCache[8]+_*D;var A=this._hullCache[9]+_*T;var P=this._vertices;if(n){this._getAffineTransform(c+u,-r,u,i-r,P[g+2],P[g+3],P[g],P[g+1],b+D,A+T,e._helpTransform,v,true)}else{this._getAffineTransform(c,-i,u,i-r,b,A,b+D,A+T,P[g],P[g+1],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(a>=r){if(t<-r||t>=r){return this.globalTransformMatrix}n=a>this._kY*(t-c-u)+r;p=((o*l+o+l+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=l*(h+2)+_*2;var D=this._hullCache[10];var T=this._hullCache[11];var b=this._hullCache[6]-(o-_)*D;var A=this._hullCache[7]-(o-_)*T;var P=this._vertices;if(n){this._getAffineTransform(c+u,i,u,i-r,b+D,A+T,b,A,P[g+2],P[g+3],e._helpTransform,v,true)}else{this._getAffineTransform(c,r,u,i-r,P[g],P[g+1],P[g+2],P[g+3],b,A,e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else{n=a>this._k*(t-c-u)+d;p=((o*m+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=_*2+m*(h+2);var P=this._vertices;if(n){this._getAffineTransform(c+u,d+f,u,f,P[g+h+4],P[g+h+5],P[g+h+2],P[g+h+3],P[g+2],P[g+3],e._helpTransform,v,true)}else{this._getAffineTransform(c,d,u,f,P[g],P[g+1],P[g+2],P[g+3],P[g+h+2],P[g+h+3],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}return v};e.prototype.init=function(e,a){if(this._boneData!==null){return}t.prototype.init.call(this,e,a);var r=e.segmentX;var i=e.segmentY;var n=this._armature.armatureData.parent.intArray[e.geometry.offset+0];var s=1e3;var o=200;this._dX=o*2/r;this._dY=o*2/i;this._k=-this._dY/this._dX;this._kX=-this._dY/(s-o);this._kY=-(s-o)/this._dX;this._vertices.length=n*2;this._deformVertices.length=n*2;this._matrixCahce.length=(r*i+r*2+i*2)*2*7;this._hullCache.length=10;for(var l=0;l=0&&this._cachedFrameIndices!==null){var a=this._cachedFrameIndices[t];if(a>=0&&this._cachedFrameIndex===a){this._transformDirty=false}else if(a>=0){this._transformDirty=true;this._cachedFrameIndex=a}else{if(this._hasConstraint){for(var r=0,i=this._armature._constraints;r=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var s=0,o=this._armature._constraints;s=0;if(this._localDirty){this._updateGlobalTransformMatrix(u)}if(u&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var f=1e3;var _=200;var m=2*this.global.x;var p=2*this.global.y;var c=e._helpPoint;this.globalTransformMatrix.transformPoint(f,-_,c);this._hullCache[0]=c.x;this._hullCache[1]=c.y;this._hullCache[2]=m-c.x;this._hullCache[3]=p-c.y;this.globalTransformMatrix.transformPoint(0,this._dY,c,true);this._hullCache[4]=c.x;this._hullCache[5]=c.y;this.globalTransformMatrix.transformPoint(_,f,c);this._hullCache[6]=c.x;this._hullCache[7]=c.y;this._hullCache[8]=m-c.x;this._hullCache[9]=p-c.y;this.globalTransformMatrix.transformPoint(this._dX,0,c,true);this._hullCache[10]=c.x;this._hullCache[11]=c.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return e}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.deformVertices=[];return e}e.toString=function(){return"[class dragonBones.DisplayFrame]"};e.prototype._onClear=function(){this.rawDisplayData=null;this.displayData=null;this.textureData=null;this.display=null;this.deformVertices.length=0};e.prototype.updateDeformVertices=function(){if(this.rawDisplayData===null||this.deformVertices.length!==0){return}var t;if(this.rawDisplayData.type===2){t=this.rawDisplayData.geometry}else if(this.rawDisplayData.type===4){t=this.rawDisplayData.geometry}else{return}var e=0;if(t.weight!==null){e=t.weight.count*2}else{e=t.data.intArray[t.offset+0]*2}this.deformVertices.length=e;for(var a=0,r=this.deformVertices.length;a=0&&this._displayIndex0){for(var o=0,l=n;o=0&&this._cachedFrameIndices!==null){var r=this._cachedFrameIndices[t];if(r>=0&&this._cachedFrameIndex===r){this._transformDirty=false}else if(r>=0){this._transformDirty=true;this._cachedFrameIndex=r}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._transformDirty){if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform();this._transformDirty=false}};r.prototype.invalidUpdate=function(){this._displayDataDirty=true;this._displayDirty=true;this._transformDirty=true};r.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._updateGlobalTransformMatrix(false);this._transformDirty=false}};r.prototype.replaceRawDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.rawDisplayData!==t){a.deformVertices.length=0;a.rawDisplayData=t;if(a.rawDisplayData===null){var r=this._armature._armatureData.defaultSkin;if(r!==null){var i=r.getDisplays(this._slotData.name);if(i!==null&&e=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.displayData!==t&&a.rawDisplayData!==t){a.displayData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};r.prototype.replaceTextureData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.textureData!==t){a.textureData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};r.prototype.replaceDisplay=function(e,a){if(a===void 0){a=-1}if(a<0){a=this._displayIndex<0?0:this._displayIndex}else if(a>=this._displayFrames.length){return}var r=this._displayFrames[a];if(r.display!==e){var i=r.display;r.display=e;if(i!==null&&i!==this._rawDisplay&&i!==this._meshDisplay&&!this._hasDisplay(i)){if(i instanceof t.Armature){}else{this._disposeDisplay(i,true)}}if(e!==null&&e!==this._rawDisplay&&e!==this._meshDisplay&&!this._hasDisplay(i)&&!(e instanceof t.Armature)){this._initDisplay(e,true)}if(a===this._displayIndex){this._displayDirty=true}}};r.prototype.containsPoint=function(t,e){if(this._boundingBoxData===null){return false}this.updateTransformAndMatrix();r._helpMatrix.copyFrom(this.globalTransformMatrix);r._helpMatrix.invert();r._helpMatrix.transformPoint(t,e,r._helpPoint);return this._boundingBoxData.containsPoint(r._helpPoint.x,r._helpPoint.y)};r.prototype.intersectsSegment=function(t,e,a,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(this._boundingBoxData===null){return 0}this.updateTransformAndMatrix();r._helpMatrix.copyFrom(this.globalTransformMatrix);r._helpMatrix.invert();r._helpMatrix.transformPoint(t,e,r._helpPoint);t=r._helpPoint.x;e=r._helpPoint.y;r._helpMatrix.transformPoint(a,i,r._helpPoint);a=r._helpPoint.x;i=r._helpPoint.y;var l=this._boundingBoxData.intersectsSegment(t,e,a,i,n,s,o);if(l>0){if(l===1||l===2){if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n);if(s!==null){s.x=n.x;s.y=n.y}}else if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}else{if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}if(o!==null){this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),r._helpPoint,true);o.x=Math.atan2(r._helpPoint.y,r._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),r._helpPoint,true);o.y=Math.atan2(r._helpPoint.y,r._helpPoint.x)}}return l};r.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]};Object.defineProperty(r.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(a){var r=this._displayFrames.length;if(ra){for(var i=r-1;id){continue}var b=0;for(;;D++){var A=y[D];if(c>A){continue}if(D===0){b=c/A}else{var P=y[D-1];b=(c-P)/(A-P)}break}if(D!==p){p=D;if(u&&D===m){this._computeVertices(_-4,4,0,f);this._computeVertices(0,4,4,f)}else{this._computeVertices(D*6+2,8,0,f)}}this.addCurvePosition(b,f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],l,g,a)}return}if(u){_+=2;f.length=o;this._computeVertices(2,_-4,0,f);this._computeVertices(0,2,_-4,f);f[_-2]=f[0];f[_-1]=f[1]}else{m--;_-=4;f.length=_;this._computeVertices(2,_,0,f)}var S=new Array(m);d=0;var O=f[0],x=f[1],B=0,E=0,M=0,I=0,F=0,C=0;var w,N,R,k,j,L,V,Y;for(var v=0,U=2;vd){continue}for(;;D++){var W=S[D];if(z>W)continue;if(D===0)z/=W;else{var K=S[D-1];z=(z-K)/(W-K)}break}if(D!==p){p=D;var Z=D*6;O=f[Z];x=f[Z+1];B=f[Z+2];E=f[Z+3];M=f[Z+4];I=f[Z+5];F=f[Z+6];C=f[Z+7];w=(O-B*2+M)*.03;N=(x-E*2+I)*.03;R=((B-M)*3-O+F)*.006;k=((E-I)*3-x+C)*.006;j=w*2+R;L=N*2+k;V=(B-O)*.3+w+R*.16666667;Y=(E-x)*.3+N+k*.16666667;G=Math.sqrt(V*V+Y*Y);X[0]=G;for(Z=1;Z<8;Z++){V+=j;Y+=L;j+=R;L+=k;G+=Math.sqrt(V*V+Y*Y);X[Z]=G}V+=j;Y+=L;G+=Math.sqrt(V*V+Y*Y);X[8]=G;V+=j+R;Y+=L+k;G+=Math.sqrt(V*V+Y*Y);X[9]=G;H=0}z*=G;for(;;H++){var q=X[H];if(z>q)continue;if(H===0)z/=q;else{var K=X[H-1];z=H+(z-K)/(q-K)}break}this.addCurvePosition(z*.1,O,x,B,E,M,I,F,C,l,g,a)}};a.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,u,f){if(t===0){h[u]=e;h[u+1]=a;h[u+2]=0;return}if(t===1){h[u]=o;h[u+1]=l;h[u+2]=0;return}var _=1-t;var m=_*_;var p=t*t;var c=m*_;var d=m*t*3;var y=_*p*3;var v=t*p;var g=c*e+d*r+y*n+v*o;var D=c*a+d*i+y*s+v*l;h[u]=g;h[u+1]=D;if(f){h[u+2]=Math.atan2(D-(c*a+d*i+y*s),g-(c*e+d*r+y*n))}else{h[u+2]=0}};a.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD}}var B=this.rotateMix;var E=this.translateMix;for(var c=0,M=3;c0){var N=g.a,R=g.b,k=g.c,j=g.d,L=void 0,V=void 0,Y=void 0;if(u){L=A[M-1]}else{L=Math.atan2(F,I)}L-=Math.atan2(R,N);if(x){V=Math.cos(L);Y=Math.sin(L);var U=y._boneData.length;S+=(U*(V*N-Y*R)-I)*B;O+=(U*(Y*N+V*R)-F)*B}else{L+=P}if(L>t.Transform.PI){L-=t.Transform.PI_D}else if(L<-t.Transform.PI){L+=t.Transform.PI_D}L*=B;V=Math.cos(L);Y=Math.sin(L);g.a=V*N-Y*R;g.b=Y*N+V*R;g.c=V*k-Y*j;g.d=Y*k+V*j}y.global.fromMatrix(g)}this.dirty=false};a.prototype.invalidUpdate=function(){};return a}(e);t.PathConstraint=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=0}this.time=0;this.timeScale=1;this._systemTime=0;this._animatebles=[];this._clock=null;this.time=t;this._systemTime=(new Date).getTime()*.001}t.prototype.advanceTime=function(t){if(t!==t){t=0}var e=Date.now()*.001;if(t<0){t=e-this._systemTime}this._systemTime=e;if(this.timeScale!==1){t*=this.timeScale}if(t===0){return}if(t<0){this.time-=t}else{this.time+=t}var a=0,r=0,i=this._animatebles.length;for(;a0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&n._subFadeState>0){this._armature._dragonBones.bufferObject(n);this._animationStates.length=0;this._lastAnimationState=null}else{var s=n.animationData;var o=s.cacheFrameRate;if(this._animationDirty&&o>0){this._animationDirty=false;for(var l=0,h=this._armature.getBones();l0){var p=m.getDisplayFrameAt(0).rawDisplayData;if(p!==null&&p.parent===this._armature.armatureData.defaultSkin){m._cachedFrameIndices=s.getSlotCachedFrameIndices(m.name);continue}}m._cachedFrameIndices=null}}n.advanceTime(t,o)}}else if(i>1){for(var c=0,d=0;c0&&n._subFadeState>0){d++;this._armature._dragonBones.bufferObject(n);this._animationDirty=true;if(this._lastAnimationState===n){this._lastAnimationState=null}}else{if(d>0){this._animationStates[c-d]=n}n.advanceTime(t,0)}if(c===i-1&&d>0){this._animationStates.length-=d;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};a.prototype.reset=function(){for(var t=0,e=this._animationStates;t0){if(e.position<0){e.position%=r.duration;e.position=r.duration-e.position}else if(e.position===r.duration){e.position-=1e-6}else if(e.position>r.duration){e.position%=r.duration}if(e.duration>0&&e.position+e.duration>r.duration){e.duration=r.duration-e.position}if(e.playTimes<0){e.playTimes=r.playTimes}}else{e.playTimes=1;e.position=0;if(e.duration>0){e.duration=0}}if(e.duration===0){e.duration=-1}this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);o.init(this._armature,r,e);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var l=false;for(var h=0,u=this._animationStates.length;hthis._animationStates[h].layer){l=true;this._animationStates.splice(h,0,o);break}else if(h!==u-1&&o.layer>this._animationStates[h+1].layer){l=true;this._animationStates.splice(h+1,0,o);break}}if(!l){this._animationStates.push(o)}}else{this._animationStates.push(o)}for(var f=0,_=this._armature.getSlots();f<_.length;f++){var m=_[f];var p=m.childArmature;if(p!==null&&p.inheritAnimation&&p.animation.hasAnimation(a)&&p.animation.getState(a)===null){p.animation.fadeIn(a)}}for(var c in r.animationTimelines){var d=this.fadeIn(c,0,1,o.layer,"",5);if(d===null){continue}var y=r.animationTimelines[c];d.actionEnabled=false;d.resetToPose=false;d.stop();o.addState(d,y);var v=this._animationStates.indexOf(o);var g=this._animationStates.indexOf(d);if(g0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};a.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.frameCount>0?r.duration*e/r.frameCount:0}return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};a.prototype.getBlendState=function(e,a,r){if(!(e in this._blendStates)){this._blendStates[e]={}}var i=this._blendStates[e];if(!(a in i)){var n=i[a]=t.BaseObject.borrowObject(t.BlendState);n.target=r}return i[a]};a.prototype.getState=function(t,e){if(e===void 0){e=-1}var a=this._animationStates.length;while(a--){var r=this._animationStates[a];if(r.name===t&&(e<0||r.layer===e)){return r}}return null};a.prototype.hasAnimation=function(t){return t in this._animations};a.prototype.getStates=function(){return this._animationStates};Object.defineProperty(a.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});return a}(t.BaseObject);t.Animation=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var t=e!==null&&e.apply(this,arguments)||this;t._boneMask=[];t._boneTimelines=[];t._boneBlendTimelines=[];t._slotTimelines=[];t._slotBlendTimelines=[];t._constraintTimelines=[];t._animationTimelines=[];t._poseTimelines=[];t._actionTimeline=null;t._zOrderTimeline=null;return t}r.toString=function(){return"[class dragonBones.AnimationState]"};r.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0){this._boneTimelines.splice(D,1);n.returnToPool()}D=this._boneBlendTimelines.indexOf(n);if(D>=0){this._boneBlendTimelines.splice(D,1);n.returnToPool()}}}}{var T={};var b=[];for(var A=0,P=this._slotTimelines;A=0){this._slotTimelines.splice(D,1);n.returnToPool()}D=this._slotBlendTimelines.indexOf(n);if(D>=0){this._slotBlendTimelines.splice(D,1);n.returnToPool()}}}}};r.prototype._advanceFadeTime=function(e){var a=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var r=this._parent===null&&this.actionEnabled;if(r){var i=a?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(i)){var n=t.BaseObject.borrowObject(t.EventObject);n.type=i;n.armature=this._armature;n.animationState=this;this._armature._dragonBones.bufferEvent(n)}}}if(e<0){e=-e}this._fadeTime+=e;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=a?0:1}else if(this._fadeTime>0){this._fadeProgress=a?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=a?1:0}if(this._subFadeState>0){if(!a){this._playheadState|=1;this._fadeState=0}var r=this._parent===null&&this.actionEnabled;if(r){var i=a?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(i)){var n=t.BaseObject.borrowObject(t.EventObject);n.type=i;n.armature=this._armature;n.animationState=this;this._armature._dragonBones.bufferEvent(n)}}}};r.prototype.init=function(e,a,r){if(this._armature!==null){return}this._armature=e;this._animationData=a;this.resetToPose=r.resetToPose;this.additive=r.additive;this.displayControl=r.displayControl;this.actionEnabled=r.actionEnabled;this.blendType=a.blendType;this.layer=r.layer;this.playTimes=r.playTimes;this.timeScale=r.timeScale;this.fadeTotalTime=r.fadeInTime;this.autoFadeOutTime=r.autoFadeOutTime;this.name=r.name.length>0?r.name:r.animation;this.group=r.group;this._weight=r.weight;if(r.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(r.duration<0){this._position=0;this._duration=this._animationData.duration;if(r.position!==0){if(this.timeScale>=0){this._time=r.position}else{this._time=r.position-this._duration}}else{this._time=0}}else{this._position=r.position;this._duration=r.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(r.boneMask.length>0){this._boneMask.length=r.boneMask.length;for(var i=0,n=this._boneMask.length;i0;var i=true;var n=true;var s=this._time;this._weightResult=this._weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(this._weight===0){return}if(r){var o=e*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*e);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){var h=false;var u=null;if(n){for(var f=0,_=this._boneTimelines.length;f<_;++f){var m=this._boneTimelines[f];if(m.playState<=0){m.update(s)}if(m.target!==u){var p=m.target;h=p.update(this);u=p;if(p.dirty===1){var c=p.target.animationPose;c.x=0;c.y=0;c.rotation=0;c.skew=0;c.scaleX=1;c.scaleY=1}}if(h){m.blend(a)}}}for(var f=0,_=this._boneBlendTimelines.length;f<_;++f){var m=this._boneBlendTimelines[f];if(m.playState<=0){m.update(s)}if(m.target.update(this)){m.blend(a)}}if(this.displayControl){for(var f=0,_=this._slotTimelines.length;f<_;++f){var m=this._slotTimelines[f];if(m.playState<=0){var d=m.target;var y=d.displayController;if(y===null||y===this.name||y===this.group){m.update(s)}}}}for(var f=0,_=this._slotBlendTimelines.length;f<_;++f){var m=this._slotBlendTimelines[f];if(m.playState<=0){var p=m.target;m.update(s);if(p.update(this)){m.blend(a)}}}for(var f=0,_=this._constraintTimelines.length;f<_;++f){var m=this._constraintTimelines[f];if(m.playState<=0){m.update(s)}}if(this._animationTimelines.length>0){var v=100;var g=100;var D=null;var T=null;for(var f=0,_=this._animationTimelines.length;f<_;++f){var m=this._animationTimelines[f];if(m.playState<=0){m.update(s)}if(this.blendType===1){var b=m.target;var A=this.parameterX-b.positionX;if(A>=0){if(A0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var P=0,S=this._poseTimelines;P=0){this._boneTimelines.splice(O,1);m.returnToPool();continue}O=this._boneBlendTimelines.indexOf(m);if(O>=0){this._boneBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._slotTimelines.indexOf(m);if(O>=0){this._slotTimelines.splice(O,1);m.returnToPool();continue}O=this._slotBlendTimelines.indexOf(m);if(O>=0){this._slotBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._constraintTimelines.indexOf(m);if(O>=0){this._constraintTimelines.splice(O,1);m.returnToPool();continue}}this._poseTimelines.length=0}}if(this._actionTimeline.playState>0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};r.prototype.play=function(){this._playheadState=3};r.prototype.stop=function(){this._playheadState&=1};r.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};r.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};r.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,u=i;h0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&this._parent===null){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.dirty++;this.layer=e;this.leftWeight=0;this.blendWeight=0;return false}this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}a*=this.leftWeight;this.dirty++;this.blendWeight=a;this.layerWeight+=this.blendWeight;return true}return false}this.dirty++;this.layer=e;this.leftWeight=1;this.blendWeight=a;this.layerWeight=a;return true};e.prototype.reset=function(){this.dirty=0;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};e.BONE_TRANSFORM="boneTransform";e.BONE_ALPHA="boneAlpha";e.SURFACE="surface";e.SLOT_DEFORM="slotDeform";e.SLOT_ALPHA="slotAlpha";e.SLOT_Z_INDEX="slotZIndex";return e}(t.BaseObject);t.BlendState=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.dirty=false;this.playState=-1;this.currentPlayTimes=-1;this.currentTime=-1;this.target=null;this._isTween=false;this._valueOffset=0;this._frameValueOffset=0;this._frameOffset=0;this._frameRate=0;this._frameCount=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._valueArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this._duration+1e-6}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState.animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;if(this._timelineData!==null){var r=this._animationData.parent.parent;this._frameArray=r.frameArray;this._timelineArray=r.timelineArray;this._frameIndices=r.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){this.dirty=false};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._isTween||this.dirty){this._onUpdateFrame()}}};e.prototype.blend=function(t){};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a>0;var n=a+1;var s=Math.floor(t*n);var o=0;var l=0;if(i){o=s===0?0:e[r+s-1];l=s===n-1?1e4:e[r+s]}else{o=e[r+s-1];l=e[r+s]}return(o+(l-o)*(t*n-s))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenEasing=0;this._tweenProgress=0;this._valueScale=1};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this.dirty=true;this._isTween=false}};e.prototype._onUpdateFrame=function(){if(this._isTween){this.dirty=true;this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}};return e}(e);t.TweenTimelineState=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._current=0;this._difference=0;this._result=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._valueScale;var a=this._valueArray;var r=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var i=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:r+1;if(e===1){this._current=a[r];this._difference=a[i]-this._current}else{this._current=a[r]*e;this._difference=a[i]*e-this._current}}else{this._result=a[r]*e}}else{this._result=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._result=this._current+this._difference*this._tweenProgress}};return e}(a);t.SingleValueTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._currentA=0;this._currentB=0;this._differenceA=0;this._differenceB=0;this._resultA=0;this._resultB=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._valueScale;var a=this._valueArray;var r=this._valueOffset+this._frameValueOffset+this._frameIndex*2;if(this._isTween){var i=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:r+2;if(e===1){this._currentA=a[r];this._currentB=a[r+1];this._differenceA=a[i]-this._currentA;this._differenceB=a[i+1]-this._currentB}else{this._currentA=a[r]*e;this._currentB=a[r+1]*e;this._differenceA=a[i]*e-this._currentA;this._differenceB=a[i+1]*e-this._currentB}}else{this._resultA=a[r]*e;this._resultB=a[r+1]*e}}else{this._resultA=0;this._resultB=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._resultA=this._currentA+this._differenceA*this._tweenProgress;this._resultB=this._currentB+this._differenceB*this._tweenProgress}};return e}(a);t.DoubleValueTimelineState=i;var n=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._rd=[];return e}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._valueCount=0;this._rd.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);var e=this._valueCount;var a=this._rd;if(this._timelineData!==null){var r=this._valueScale;var i=this._valueArray;var n=this._valueOffset+this._frameValueOffset+this._frameIndex*e;if(this._isTween){var s=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:n+e;if(r===1){for(var o=0;o0){if(s.hasDBEventListener(t.EventObject.COMPLETE)){u=t.BaseObject.borrowObject(t.EventObject);u.type=t.EventObject.COMPLETE;u.armature=this._armature;u.animationState=this._animationState}}}if(this._frameCount>1){var f=this._timelineData;var _=Math.floor(this.currentTime*this._frameRate);var m=this._frameIndices[f.frameIndicesOffset+_];if(this._frameIndex!==m){var p=this._frameIndex;this._frameIndex=m;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[f.offset+5+this._frameIndex];if(l){if(p<0){var c=Math.floor(i*this._frameRate);p=this._frameIndices[f.frameIndicesOffset+c];if(this.currentPlayTimes===r){if(p===m){p=-1}}}while(p>=0){var d=this._animationData.frameOffset+this._timelineArray[f.offset+5+p];var y=this._frameArray[d]/this._frameRate;if(this._position<=y&&y<=this._position+this._duration){this._onCrossFrame(p)}if(h!==null&&p===0){this._armature._dragonBones.bufferEvent(h);h=null}if(p>0){p--}else{p=this._frameCount-1}if(p===m){break}}}else{if(p<0){var c=Math.floor(i*this._frameRate);p=this._frameIndices[f.frameIndicesOffset+c];var d=this._animationData.frameOffset+this._timelineArray[f.offset+5+p];var y=this._frameArray[d]/this._frameRate;if(this.currentPlayTimes===r){if(i<=y){if(p>0){p--}else{p=this._frameCount-1}}else if(p===m){p=-1}}}while(p>=0){if(p=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.ZOrderTimelineState=a;var r=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._rd[2]=t.Transform.normalizeRadian(this._rd[2]);this._rd[3]=t.Transform.normalizeRadian(this._rd[3])}if(this._timelineData===null){this._rd[4]=1;this._rd[5]=1}};a.prototype.init=function(t,a,r){e.prototype.init.call(this,t,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=6;this._valueArray=this._animationData.parent.parent.frameFloatArray};a.prototype.fadeOut=function(){this.dirty=false;this._rd[2]=t.Transform.normalizeRadian(this._rd[2]);this._rd[3]=t.Transform.normalizeRadian(this._rd[3])};a.prototype.blend=function(t){var e=this._armature.armatureData.scale;var a=this._rd;var r=this.target;var i=r.target;var n=r.blendWeight;var s=i.animationPose;if(r.dirty>1){s.x+=a[0]*n*e;s.y+=a[1]*n*e;s.rotation+=a[2]*n;s.skew+=a[3]*n;s.scaleX+=(a[4]-1)*n;s.scaleY+=(a[5]-1)*n}else{s.x=a[0]*n*e;s.y=a[1]*n*e;s.rotation=a[2]*n;s.skew=a[3]*n;s.scaleX=(a[4]-1)*n+1;s.scaleY=(a[5]-1)*n+1}if(t||this.dirty){this.dirty=false;i._transformDirty=true}};return a}(t.MutilpleValueTimelineState);t.BoneAllTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=this._animationData.parent.parent.frameFloatArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.x+=this._resultA*r;i.y+=this._resultB*r}else if(r!==1){i.x=this._resultA*r;i.y=this._resultB*r}else{i.x=this._resultA;i.y=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return e}(t.DoubleValueTimelineState);t.BoneTranslateTimelineState=i;var n=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._differenceA=t.Transform.normalizeRadian(this._differenceA);this._differenceB=t.Transform.normalizeRadian(this._differenceB)}};a.prototype.init=function(t,a,r){e.prototype.init.call(this,t,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};a.prototype.fadeOut=function(){this.dirty=false;this._resultA=t.Transform.normalizeRadian(this._resultA);this._resultB=t.Transform.normalizeRadian(this._resultB)};a.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.rotation+=this._resultA*r;i.skew+=this._resultB*r}else if(r!==1){i.rotation=this._resultA*r;i.skew=this._resultB*r}else{i.rotation=this._resultA;i.skew=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return a}(t.DoubleValueTimelineState);t.BoneRotateTimelineState=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){this._resultA=1;this._resultB=1}};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.scaleX+=(this._resultA-1)*r;i.scaleY+=(this._resultB-1)*r}else if(r!==1){i.scaleX=(this._resultA-1)*r+1;i.scaleY=(this._resultB-1)*r+1}else{i.scaleX=this._resultA;i.scaleY=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return e}(t.DoubleValueTimelineState);t.BoneScaleTimelineState=s;var o=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);if(this._timelineData!==null){var i=this._animationData.parent.parent;var n=i.frameIntArray;var s=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=n[s+2];this._deformCount=n[s+1];this._deformOffset=n[s+3];this._sameValueOffset=n[s+4]+this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=i.frameFloatArray;this._rd.length=this._valueCount*2}else{this._deformCount=this.target.target._deformVertices.length}};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a._deformVertices;var n=this._valueArray;if(n!==null){var s=this._valueCount;var o=this._deformOffset;var l=this._sameValueOffset;var h=this._rd;for(var u=0;u1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u1){a._alpha+=this._result*r;if(a._alpha>1){a._alpha=1}}else{a._alpha=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._alphaDirty=true}};return e}(t.SingleValueTimelineState);t.AlphaTimelineState=l;var h=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotDislayTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target;var e=this._timelineData!==null?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;if(t.displayIndex!==e){t._setDisplayIndex(e,true)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.SlotDislayTimelineState=h;var u=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[0,0,0,0,0,0,0,0];e._difference=[0,0,0,0,0,0,0,0];e._result=[0,0,0,0,0,0,0,0];return e}e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.parent.parent;var a=e.colorArray;var r=e.frameIntArray;var i=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex;var n=r[i];if(n<0){n+=65536}if(this._isTween){this._current[0]=a[n++];this._current[1]=a[n++];this._current[2]=a[n++];this._current[3]=a[n++];this._current[4]=a[n++];this._current[5]=a[n++];this._current[6]=a[n++];this._current[7]=a[n++];if(this._frameIndex===this._frameCount-1){n=r[this._animationData.frameIntOffset+this._frameValueOffset]}else{n=r[i+1]}if(n<0){n+=65536}this._difference[0]=a[n++]-this._current[0];this._difference[1]=a[n++]-this._current[1];this._difference[2]=a[n++]-this._current[2];this._difference[3]=a[n++]-this._current[3];this._difference[4]=a[n++]-this._current[4];this._difference[5]=a[n++]-this._current[5];this._difference[6]=a[n++]-this._current[6];this._difference[7]=a[n++]-this._current[7]}else{this._result[0]=a[n++]*.01;this._result[1]=a[n++]*.01;this._result[2]=a[n++]*.01;this._result[3]=a[n++]*.01;this._result[4]=a[n++];this._result[5]=a[n++];this._result[6]=a[n++];this._result[7]=a[n++]}}else{var s=this.target;var o=s.slotData.color;this._result[0]=o.alphaMultiplier;this._result[1]=o.redMultiplier;this._result[2]=o.greenMultiplier;this._result[3]=o.blueMultiplier;this._result[4]=o.alphaOffset;this._result[5]=o.redOffset;this._result[6]=o.greenOffset;this._result[7]=o.blueOffset}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._result[0]=(this._current[0]+this._difference[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._difference[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._difference[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._difference[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress;this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress;this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress;this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress}};e.prototype.fadeOut=function(){this._isTween=false};e.prototype.update=function(e){t.prototype.update.call(this,e);if(this._isTween||this.dirty){var a=this.target;var r=a._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(r.alphaMultiplier!==this._result[0]||r.redMultiplier!==this._result[1]||r.greenMultiplier!==this._result[2]||r.blueMultiplier!==this._result[3]||r.alphaOffset!==this._result[4]||r.redOffset!==this._result[5]||r.greenOffset!==this._result[6]||r.blueOffset!==this._result[7]){var i=Math.pow(this._animationState._fadeProgress,4);r.alphaMultiplier+=(this._result[0]-r.alphaMultiplier)*i;r.redMultiplier+=(this._result[1]-r.redMultiplier)*i;r.greenMultiplier+=(this._result[2]-r.greenMultiplier)*i;r.blueMultiplier+=(this._result[3]-r.blueMultiplier)*i;r.alphaOffset+=(this._result[4]-r.alphaOffset)*i;r.redOffset+=(this._result[5]-r.redOffset)*i;r.greenOffset+=(this._result[6]-r.greenOffset)*i;r.blueOffset+=(this._result[7]-r.blueOffset)*i;a._colorDirty=true}}else if(this.dirty){this.dirty=false;if(r.alphaMultiplier!==this._result[0]||r.redMultiplier!==this._result[1]||r.greenMultiplier!==this._result[2]||r.blueMultiplier!==this._result[3]||r.alphaOffset!==this._result[4]||r.redOffset!==this._result[5]||r.greenOffset!==this._result[6]||r.blueOffset!==this._result[7]){r.alphaMultiplier=this._result[0];r.redMultiplier=this._result[1];r.greenMultiplier=this._result[2];r.blueMultiplier=this._result[3];r.alphaOffset=this._result[4];r.redOffset=this._result[5];r.greenOffset=this._result[6];r.blueOffset=this._result[7];a._colorDirty=true}}}};return e}(t.TweenTimelineState);t.SlotColorTimelineState=u;var f=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){var e=this.target;var a=e.target;this._result=a.slotData.zIndex}};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueArray=this._animationData.parent.parent.frameIntArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;if(e.dirty>1){a._zIndex+=this._result*r}else{a._zIndex=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._zIndexDirty=true}};return e}(t.SingleValueTimelineState);t.SlotZIndexTimelineState=f;var _=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.DeformTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.geometryOffset=0;this.displayFrame=null;this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);if(this._timelineData!==null){var i=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];var n=this._animationData.parent.parent;var s=n.frameIntArray;var o=this.target.target;this.geometryOffset=s[i+0];if(this.geometryOffset<0){this.geometryOffset+=65536}for(var l=0,h=o.displayFrameCount;l1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u0;e._weight=this._currentB}else{var a=e._constraintData;e._bendPositive=a.bendPositive;e._weight=a.weight}e.invalidUpdate();this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=.01;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.DoubleValueTimelineState);t.IKConstraintTimelineState=m;var p=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.currentTime=this._result*e.totalTime}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.SingleValueTimelineState);t.AnimationProgressTimelineState=p;var c=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.weight=this._result}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.SingleValueTimelineState);t.AnimationWeightTimelineState=c;var d=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.parameterX=this._resultA;e.parameterY=this._resultB}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.DoubleValueTimelineState);t.AnimationParametersTimelineState=d})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.actionDataToInstance=function(t,a,r){if(t.type===0){a.type=e.FRAME_EVENT}else{a.type=t.type===10?e.FRAME_EVENT:e.SOUND_EVENT}a.name=t.name;a.armature=r;a.actionData=t;a.data=t.data;if(t.bone!==null){a.bone=r.getBone(t.bone.name)}if(t.slot!==null){a.slot=r.getSlot(t.slot.name)}};e.toString=function(){return"[class dragonBones.EventObject]"};e.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};e.START="start";e.LOOP_COMPLETE="loopComplete";e.COMPLETE="complete";e.FADE_IN="fadeIn";e.FADE_IN_COMPLETE="fadeInComplete";e.FADE_OUT="fadeOut";e.FADE_OUT_COMPLETE="fadeOutComplete";e.FRAME_EVENT="frameEvent";e.SOUND_EVENT="soundEvent";return e}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(){}t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}};t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};t.DATA_VERSION_2_3="2.3";t.DATA_VERSION_3_0="3.0";t.DATA_VERSION_4_0="4.0";t.DATA_VERSION_4_5="4.5";t.DATA_VERSION_5_0="5.0";t.DATA_VERSION_5_5="5.5";t.DATA_VERSION_5_6="5.6";t.DATA_VERSION=t.DATA_VERSION_5_6;t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6];t.TEXTURE_ATLAS="textureAtlas";t.SUB_TEXTURE="SubTexture";t.FORMAT="format";t.IMAGE_PATH="imagePath";t.WIDTH="width";t.HEIGHT="height";t.ROTATED="rotated";t.FRAME_X="frameX";t.FRAME_Y="frameY";t.FRAME_WIDTH="frameWidth";t.FRAME_HEIGHT="frameHeight";t.DRADON_BONES="dragonBones";t.USER_DATA="userData";t.ARMATURE="armature";t.CANVAS="canvas";t.BONE="bone";t.SURFACE="surface";t.SLOT="slot";t.CONSTRAINT="constraint";t.SKIN="skin";t.DISPLAY="display";t.FRAME="frame";t.IK="ik";t.PATH_CONSTRAINT="path";t.ANIMATION="animation";t.TIMELINE="timeline";t.FFD="ffd";t.TRANSLATE_FRAME="translateFrame";t.ROTATE_FRAME="rotateFrame";t.SCALE_FRAME="scaleFrame";t.DISPLAY_FRAME="displayFrame";t.COLOR_FRAME="colorFrame";t.DEFAULT_ACTIONS="defaultActions";t.ACTIONS="actions";t.EVENTS="events";t.INTS="ints";t.FLOATS="floats";t.STRINGS="strings";t.TRANSFORM="transform";t.PIVOT="pivot";t.AABB="aabb";t.COLOR="color";t.VERSION="version";t.COMPATIBLE_VERSION="compatibleVersion";t.FRAME_RATE="frameRate";t.TYPE="type";t.SUB_TYPE="subType";t.NAME="name";t.PARENT="parent";t.TARGET="target";t.STAGE="stage";t.SHARE="share";t.PATH="path";t.LENGTH="length";t.DISPLAY_INDEX="displayIndex";t.Z_ORDER="zOrder";t.Z_INDEX="zIndex";t.BLEND_MODE="blendMode";t.INHERIT_TRANSLATION="inheritTranslation";t.INHERIT_ROTATION="inheritRotation";t.INHERIT_SCALE="inheritScale";t.INHERIT_REFLECTION="inheritReflection";t.INHERIT_ANIMATION="inheritAnimation";t.INHERIT_DEFORM="inheritDeform";t.SEGMENT_X="segmentX";t.SEGMENT_Y="segmentY";t.BEND_POSITIVE="bendPositive";t.CHAIN="chain";t.WEIGHT="weight";t.BLEND_TYPE="blendType";t.FADE_IN_TIME="fadeInTime";t.PLAY_TIMES="playTimes";t.SCALE="scale";t.OFFSET="offset";t.POSITION="position";t.DURATION="duration";t.TWEEN_EASING="tweenEasing";t.TWEEN_ROTATE="tweenRotate";t.TWEEN_SCALE="tweenScale";t.CLOCK_WISE="clockwise";t.CURVE="curve";t.SOUND="sound";t.EVENT="event";t.ACTION="action";t.X="x";t.Y="y";t.SKEW_X="skX";t.SKEW_Y="skY";t.SCALE_X="scX";t.SCALE_Y="scY";t.VALUE="value";t.ROTATE="rotate";t.SKEW="skew";t.ALPHA="alpha";t.ALPHA_OFFSET="aO";t.RED_OFFSET="rO";t.GREEN_OFFSET="gO";t.BLUE_OFFSET="bO";t.ALPHA_MULTIPLIER="aM";t.RED_MULTIPLIER="rM";t.GREEN_MULTIPLIER="gM";t.BLUE_MULTIPLIER="bM";t.UVS="uvs";t.VERTICES="vertices";t.TRIANGLES="triangles";t.WEIGHTS="weights";t.SLOT_POSE="slotPose";t.BONE_POSE="bonePose";t.BONES="bones";t.POSITION_MODE="positionMode";t.SPACING_MODE="spacingMode";t.ROTATE_MODE="rotateMode";t.SPACING="spacing";t.ROTATE_OFFSET="rotateOffset";t.ROTATE_MIX="rotateMix";t.TRANSLATE_MIX="translateMix";t.TARGET_DISPLAY="targetDisplay";t.CLOSED="closed";t.CONSTANT_SPEED="constantSpeed";t.VERTEX_COUNT="vertexCount";t.LENGTHS="lengths";t.GOTO_AND_PLAY="gotoAndPlay";t.DEFAULT_NAME="default";return t}();t.DataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var a=e!==null&&e.apply(this,arguments)||this;a._rawTextureAtlasIndex=0;a._rawBones=[];a._data=null;a._armature=null;a._bone=null;a._geometry=null;a._slot=null;a._skin=null;a._mesh=null;a._animation=null;a._timeline=null;a._rawTextureAtlases=null;a._frameValueType=0;a._defaultColorOffset=-1;a._prevClockwise=0;a._prevRotation=0;a._frameDefaultValue=0;a._frameValueScale=1;a._helpMatrixA=new t.Matrix;a._helpMatrixB=new t.Matrix;a._helpTransform=new t.Transform;a._helpColorTransform=new t.ColorTransform;a._helpPoint=new t.Point;a._helpArray=[];a._intArray=[];a._floatArray=[];a._frameIntArray=[];a._frameFloatArray=[];a._frameArray=[];a._timelineArray=[];a._colorArray=[];a._cacheRawMeshes=[];a._cacheMeshes=[];a._actionFrames=[];a._weightSlotPose={};a._weightBonePoses={};a._cacheBones={};a._slotChildActions={};return a}r._getBoolean=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="boolean"){return r}else if(i==="string"){switch(r){case"0":case"NaN":case"":case"false":case"null":case"undefined":return false;default:return true}}else{return!!r}}return a};r._getNumber=function(t,e,a){if(e in t){var r=t[e];if(r===null||r==="NaN"){return a}return+r||0}return a};r._getString=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="string"){return r}return String(r)}return a};r.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var u=1-l;var f=u*u;var _=l*l;var m=u*f;var p=3*l*f;var c=3*u*_;var d=l*_;h.x=m*t+p*a+c*i+d*s;h.y=m*e+p*r+c*n+d*o};r.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3===1){var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return true}else{var r=0;for(var i=0,n=e.length;i1e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return false}};r.prototype._parseActionDataInFrame=function(e,a,r,i){if(t.DataParser.EVENT in e){this._mergeActionFrame(e[t.DataParser.EVENT],a,10,r,i)}if(t.DataParser.SOUND in e){this._mergeActionFrame(e[t.DataParser.SOUND],a,11,r,i)}if(t.DataParser.ACTION in e){this._mergeActionFrame(e[t.DataParser.ACTION],a,0,r,i)}if(t.DataParser.EVENTS in e){this._mergeActionFrame(e[t.DataParser.EVENTS],a,10,r,i)}if(t.DataParser.ACTIONS in e){this._mergeActionFrame(e[t.DataParser.ACTIONS],a,0,r,i)}};r.prototype._mergeActionFrame=function(t,e,r,i,n){var s=this._armature.actions.length;var o=this._parseActionData(t,r,i,n);var l=0;var h=null;for(var u=0,f=o;ue){break}l++}if(h===null){h=new a;h.frameStart=e;this._actionFrames.splice(l,0,h)}for(var d=0;d0){var p=i.getBone(_);if(p!==null){m.parent=p}else{if(!(_ in this._cacheBones)){this._cacheBones[_]=[]}this._cacheBones[_].push(m)}}if(m.name in this._cacheBones){for(var c=0,d=this._cacheBones[m.name];c0&&a.parent!==null){s.root=a.parent;s.bone=a}else{s.root=a;s.bone=null}return s};r.prototype._parsePathConstraint=function(e){var a=this._armature.getSlot(r._getString(e,t.DataParser.TARGET,""));if(a===null){return null}var i=this._armature.defaultSkin;if(i===null){return null}var n=i.getDisplay(a.name,r._getString(e,t.DataParser.TARGET_DISPLAY,a.name));if(n===null||!(n instanceof t.PathDisplayData)){return null}var s=e[t.DataParser.BONES];if(s===null||s.length===0){return null}var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=r._getString(e,t.DataParser.NAME,"");o.type=1;o.pathSlot=a;o.pathDisplayData=n;o.target=a.parent;o.positionMode=t.DataParser._getPositionMode(r._getString(e,t.DataParser.POSITION_MODE,""));o.spacingMode=t.DataParser._getSpacingMode(r._getString(e,t.DataParser.SPACING_MODE,""));o.rotateMode=t.DataParser._getRotateMode(r._getString(e,t.DataParser.ROTATE_MODE,""));o.position=r._getNumber(e,t.DataParser.POSITION,0);o.spacing=r._getNumber(e,t.DataParser.SPACING,0);o.rotateOffset=r._getNumber(e,t.DataParser.ROTATE_OFFSET,0);o.rotateMix=r._getNumber(e,t.DataParser.ROTATE_MIX,1);o.translateMix=r._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var l=0,h=s;l0?i:a;this._parsePivot(e,o);break}case 1:{var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);l.name=a;l.path=i.length>0?i:a;l.inheritAnimation=true;if(t.DataParser.ACTIONS in e){var h=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);for(var u=0,f=h;u0?i:a;if(t.DataParser.SHARE in e){d.geometry.data=this._data;this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}else{this._parseMesh(e,d)}break}case 3:{var y=this._parseBoundingBox(e);if(y!==null){var v=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);v.name=a;v.path=i.length>0?i:a;v.boundingBox=y}break}case 4:{var g=e[t.DataParser.LENGTHS];var D=s=t.BaseObject.borrowObject(t.PathDisplayData);D.closed=r._getBoolean(e,t.DataParser.CLOSED,false);D.constantSpeed=r._getBoolean(e,t.DataParser.CONSTANT_SPEED,false);D.name=a;D.path=i.length>0?i:a;D.curveLengths.length=g.length;for(var T=0,b=g.length;Ta.width){a.width=l}if(ha.height){a.height=h}}}a.width-=a.x;a.height-=a.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return a};r.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);a.blendType=t.DataParser._getAnimationBlendType(r._getString(e,t.DataParser.BLEND_TYPE,""));a.frameCount=r._getNumber(e,t.DataParser.DURATION,0);a.playTimes=r._getNumber(e,t.DataParser.PLAY_TIMES,1);a.duration=a.frameCount/this._armature.frameRate;a.fadeInTime=r._getNumber(e,t.DataParser.FADE_IN_TIME,0);a.scale=r._getNumber(e,t.DataParser.SCALE,1);a.name=r._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME);if(a.name.length===0){a.name=t.DataParser.DEFAULT_NAME}a.frameIntOffset=this._frameIntArray.length;a.frameFloatOffset=this._frameFloatArray.length;a.frameOffset=this._frameArray.length;this._animation=a;if(t.DataParser.FRAME in e){var i=e[t.DataParser.FRAME];var n=i.length;if(n>0){for(var s=0,o=0;s0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame);this._actionFrames.length=0}if(t.DataParser.TIMELINE in e){var h=e[t.DataParser.TIMELINE];for(var S=0,O=h;S0&&n in e){i=e[n]}if(i===null){return null}var f=i.length;if(f===0){return null}var _=this._frameIntArray.length;var m=this._frameFloatArray.length;var p=this._timelineArray.length;if(u===null){u=t.BaseObject.borrowObject(t.TimelineData)}u.type=s;u.offset=p;this._frameValueType=o;this._timeline=u;this._timelineArray.length+=1+1+1+1+1+f;if(e!==null){this._timelineArray[p+0]=Math.round(r._getNumber(e,t.DataParser.SCALE,1)*100);this._timelineArray[p+1]=Math.round(r._getNumber(e,t.DataParser.OFFSET,0)*100)}else{this._timelineArray[p+0]=100;this._timelineArray[p+1]=0}this._timelineArray[p+2]=f;this._timelineArray[p+3]=l;switch(this._frameValueType){case 0:this._timelineArray[p+4]=0;break;case 1:this._timelineArray[p+4]=_-this._animation.frameIntOffset;break;case 2:this._timelineArray[p+4]=m-this._animation.frameFloatOffset;break}if(f===1){u.frameIndicesOffset=-1;this._timelineArray[p+5+0]=h.call(this,i[0],0,0)-this._animation.frameOffset}else{var c=this._animation.frameCount+1;var d=this._data.frameIndices;var y=d.length;d.length+=c;u.frameIndicesOffset=y;for(var v=0,g=0,D=0,T=0;v0){if(t.DataParser.CURVE in e){var s=i+1;this._helpArray.length=s;var o=this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[n+1]=2;this._frameArray[n+2]=o?s:-s;for(var l=0;l0){var s=this._armature.sortedSlots.length;var o=new Array(s-n.length/2);var l=new Array(s);for(var h=0;h0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.TWEEN_ROTATE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[o++]=this._helpTransform.x;this._frameFloatArray[o++]=this._helpTransform.y;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=this._helpTransform.skew;this._frameFloatArray[o++]=this._helpTransform.scaleX;this._frameFloatArray[o++]=this._helpTransform.scaleY;this._parseActionDataInFrame(e,a,this._bone,this._slot);return s};r.prototype._parseBoneTranslateFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,0);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,0);return n};r.prototype._parseBoneRotateFrame=function(e,a,i){var n=r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;if(a!==0){if(this._prevClockwise===0){n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation)}else{if(this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.CLOCK_WISE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD;return s};r.prototype._parseBoneScaleFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,1);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,1);return n};r.prototype._parseSlotDisplayFrame=function(e,a,i){var n=this._parseFrame(e,a,i);this._frameArray.length+=1;if(t.DataParser.VALUE in e){this._frameArray[n+1]=r._getNumber(e,t.DataParser.VALUE,0)}else{this._frameArray[n+1]=r._getNumber(e,t.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(e,a,this._slot.parent,this._slot);return n};r.prototype._parseSlotColorFrame=function(e,a,r){var i=this._parseTweenFrame(e,a,r);var n=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){o;this._parseColorTransform(s,this._helpColorTransform);n=this._colorArray.length;this._colorArray.length+=8;this._colorArray[n++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.redMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.alphaOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.redOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.greenOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.blueOffset);n-=8;break}}if(n<0){if(this._defaultColorOffset<0){this._defaultColorOffset=n=this._colorArray.length;this._colorArray.length+=8;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=0;this._colorArray[n++]=0;this._colorArray[n++]=0;this._colorArray[n++]=0}n=this._defaultColorOffset}var l=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[l]=n;return i};r.prototype._parseSlotDeformFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null;var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._intArray[this._mesh.geometry.offset+0];var u=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var f=this._mesh.geometry.weight;var _=0;var m=0;var p=0;var c=0;if(f!==null){var d=this._weightSlotPose[u];this._helpMatrixA.copyFromArray(d,0);this._frameFloatArray.length+=f.count*2;p=f.offset+2+f.bones.length}else{this._frameFloatArray.length+=h*2}for(var y=0;y=o.length){_=0}else{_=o[y-l]}if(y+1=o.length){m=0}else{m=o[y+1-l]}}if(f!==null){var v=this._weightBonePoses[u];var g=this._intArray[p++];this._helpMatrixA.transformPoint(_,m,this._helpPoint,true);_=this._helpPoint.x;m=this._helpPoint.y;for(var D=0;D=o.length){f=0}else{f=o[m-l]}if(m+1=o.length){_=0}else{_=o[m+1-l]}}else{f=0;_=0}this._frameFloatArray[n+m]=f;this._frameFloatArray[n+m+1]=_}}if(a===0){var p=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[p+0]=this._geometry.offset;this._frameIntArray[p+1]=this._frameFloatArray.length-n;this._frameIntArray[p+2]=this._frameFloatArray.length-n;this._frameIntArray[p+3]=0;this._frameIntArray[p+4]=n-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=p-this._animation.frameIntOffset}return s};r.prototype._parseTransform=function(e,a,i){a.x=r._getNumber(e,t.DataParser.X,0)*i;a.y=r._getNumber(e,t.DataParser.Y,0)*i;if(t.DataParser.ROTATE in e||t.DataParser.SKEW in e){a.rotation=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD);a.skew=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD)}else if(t.DataParser.SKEW_X in e||t.DataParser.SKEW_Y in e){a.rotation=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW_Y,0)*t.Transform.DEG_RAD);a.skew=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW_X,0)*t.Transform.DEG_RAD)-a.rotation}a.scaleX=r._getNumber(e,t.DataParser.SCALE_X,1);a.scaleY=r._getNumber(e,t.DataParser.SCALE_Y,1)};r.prototype._parseColorTransform=function(e,a){a.alphaMultiplier=r._getNumber(e,t.DataParser.ALPHA_MULTIPLIER,100)*.01;a.redMultiplier=r._getNumber(e,t.DataParser.RED_MULTIPLIER,100)*.01;a.greenMultiplier=r._getNumber(e,t.DataParser.GREEN_MULTIPLIER,100)*.01;a.blueMultiplier=r._getNumber(e,t.DataParser.BLUE_MULTIPLIER,100)*.01;a.alphaOffset=r._getNumber(e,t.DataParser.ALPHA_OFFSET,0);a.redOffset=r._getNumber(e,t.DataParser.RED_OFFSET,0);a.greenOffset=r._getNumber(e,t.DataParser.GREEN_OFFSET,0);a.blueOffset=r._getNumber(e,t.DataParser.BLUE_OFFSET,0)};r.prototype._parseGeometry=function(e,a){var r=e[t.DataParser.VERTICES];var i=Math.floor(r.length/2);var n=0;var s=this._intArray.length;var o=this._floatArray.length;a.offset=s;a.data=this._data;this._intArray.length+=1+1+1+1;this._intArray[s+0]=i;this._intArray[s+2]=o;this._intArray[s+3]=-1;this._floatArray.length+=i*2;for(var l=0,h=i*2;l=0||t.DataParser.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);s.version=i;s.name=r._getString(e,t.DataParser.NAME,"");s.frameRate=r._getNumber(e,t.DataParser.FRAME_RATE,24);if(s.frameRate===0){s.frameRate=24}if(t.DataParser.ARMATURE in e){this._data=s;this._parseArray(e);var o=e[t.DataParser.ARMATURE];for(var l=0,h=o;l0){s.stage=s.getArmature(s.armatureNames[0])}this._data=null}if(t.DataParser.TEXTURE_ATLAS in e){this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]}return s}else{console.assert(false,"Nonsupport data version: "+i+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};r.prototype.parseTextureAtlasData=function(e,a,i){if(i===void 0){i=1}console.assert(e!==undefined);if(e===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(n,a,i);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}a.width=r._getNumber(e,t.DataParser.WIDTH,0);a.height=r._getNumber(e,t.DataParser.HEIGHT,0);a.scale=i===1?1/r._getNumber(e,t.DataParser.SCALE,1):i;a.name=r._getString(e,t.DataParser.NAME,"");a.imagePath=r._getString(e,t.DataParser.IMAGE_PATH,"");if(t.DataParser.SUB_TEXTURE in e){var s=e[t.DataParser.SUB_TEXTURE];for(var o=0,l=s.length;o0&&f>0){_.frame=t.TextureData.createRectangle();_.frame.x=r._getNumber(h,t.DataParser.FRAME_X,0);_.frame.y=r._getNumber(h,t.DataParser.FRAME_Y,0);_.frame.width=u;_.frame.height=f}a.addTexture(_)}}return true};r.getInstance=function(){if(r._objectDataParserInstance===null){r._objectDataParserInstance=new r}return r._objectDataParserInstance};r._objectDataParserInstance=null;return r}(t.DataParser);t.ObjectDataParser=e;var a=function(){function t(){this.frameStart=0;this.actions=[]}return t}();t.ActionFrame=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.prototype._inRange=function(t,e,a){return e<=t&&t<=a};a.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var u=0;while(t.length>i){var f=t[i++];if(f===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(f,0,127)){s=f}else{if(this._inRange(f,194,223)){l=1;u=128;o=f-192}else if(this._inRange(f,224,239)){l=2;u=2048;o=f-224}else if(this._inRange(f,240,244)){l=3;u=65536;o=f-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(f,128,191)){o=0;l=0;h=0;u=0;i--;s=f}else{h+=1;o=o+(f-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var m=u;o=0;l=0;h=0;u=0;if(this._inRange(_,m,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=f}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};a.prototype._parseBinaryTimeline=function(e,a,r){if(r===void 0){r=null}var i=r!==null?r:t.BaseObject.borrowObject(t.TimelineData);i.type=e;i.offset=a;this._timeline=i;var n=this._timelineArrayBuffer[i.offset+2];if(n===1){i.frameIndicesOffset=-1}else{var s=0;var o=this._animation.frameCount+1;var l=this._data.frameIndices;s=l.length;l.length+=o;i.frameIndicesOffset=s;for(var h=0,u=0,f=0,_=0;h=0){var u=t.ObjectDataParser._getNumber(y,t.DataParser.TYPE,0);var v=t.ObjectDataParser._getString(y,t.DataParser.NAME,"");var _=null;if(u===40&&a.blendType!==0){_=t.BaseObject.borrowObject(t.AnimationTimelineData);var g=_;g.x=t.ObjectDataParser._getNumber(y,t.DataParser.X,0);g.y=t.ObjectDataParser._getNumber(y,t.DataParser.Y,0)}_=this._parseBinaryTimeline(u,f,_);switch(u){case 0:break;case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(v,_);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(v,_);break;case 30:this._animation.addConstraintTimeline(v,_);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(v,_);break}}}}this._animation=null;return a};a.prototype._parseGeometry=function(e,a){a.offset=e[t.DataParser.OFFSET];a.data=this._data;var r=this._intArrayBuffer[a.offset+3];if(r>=0){var i=t.BaseObject.borrowObject(t.WeightData);var n=this._intArrayBuffer[a.offset+0];var s=this._intArrayBuffer[r+0];i.offset=r;for(var o=0;o12?a[13]:0;var u=new Int16Array(this._binary,this._binaryOffset+a[0],r/Int16Array.BYTES_PER_ELEMENT);var f=new Float32Array(this._binary,this._binaryOffset+a[2],i/Float32Array.BYTES_PER_ELEMENT);var _=new Int16Array(this._binary,this._binaryOffset+a[4],n/Int16Array.BYTES_PER_ELEMENT);var m=new Float32Array(this._binary,this._binaryOffset+a[6],s/Float32Array.BYTES_PER_ELEMENT);var p=new Int16Array(this._binary,this._binaryOffset+a[8],o/Int16Array.BYTES_PER_ELEMENT);var c=new Uint16Array(this._binary,this._binaryOffset+a[10],l/Uint16Array.BYTES_PER_ELEMENT);var d=h>0?new Int16Array(this._binary,this._binaryOffset+a[12],h/Int16Array.BYTES_PER_ELEMENT):u;this._data.binary=this._binary;this._data.intArray=this._intArrayBuffer=u;this._data.floatArray=f;this._data.frameIntArray=_;this._data.frameFloatArray=m;this._data.frameArray=this._frameArrayBuffer=p;this._data.timelineArray=this._timelineArrayBuffer=c;this._data.colorArray=d};a.prototype.parseDragonBonesData=function(t,a){if(a===void 0){a=1}console.assert(t!==null&&t!==undefined&&t instanceof ArrayBuffer,"Data error.");var r=new Uint8Array(t,0,8);if(r[0]!=="D".charCodeAt(0)||r[1]!=="B".charCodeAt(0)||r[2]!=="D".charCodeAt(0)||r[3]!=="T".charCodeAt(0)){console.assert(false,"Nonsupport data.");return null}var i=new Uint32Array(t,8,1)[0];var n=new Uint8Array(t,8+4,i);var s=this._decodeUTF8(n);var o=JSON.parse(s);this._binaryOffset=8+4+i;this._binary=t;return e.prototype.parseDragonBonesData.call(this,o,a)};a.getInstance=function(){if(a._binaryDataParserInstance===null){a._binaryDataParserInstance=new a}return a._binaryDataParserInstance};a._binaryDataParserInstance=null;return a}(t.ObjectDataParser);t.BinaryDataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(a){if(a===void 0){a=null}this.autoSearch=false;this._dragonBonesDataMap={};this._textureAtlasDataMap={};this._dragonBones=null;this._dataParser=null;if(e._objectParser===null){e._objectParser=new t.ObjectDataParser}if(e._binaryParser===null){e._binaryParser=new t.BinaryDataParser}this._dataParser=a!==null?a:e._objectParser}e.prototype._isSupportMesh=function(){return true};e.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap){for(var a=0,r=this._textureAtlasDataMap[t];a0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};e.prototype._buildBones=function(e,a){for(var r=0,i=e.armature.sortedBones;r0){var c=this._getTextureData(t.textureAtlasName,p.path);f.replaceTextureData(c,_)}var d=this._getSlotDisplay(t,p,f);f.replaceDisplay(d,_)}else{f.replaceDisplay(null)}}}f._setDisplayIndex(h.displayIndex,true)}};e.prototype._buildConstraints=function(e,a){var r=e.armature.constraints;for(var i in r){var n=r[i];switch(n.type){case 0:var s=t.BaseObject.borrowObject(t.IKConstraint);s.init(n,a);a._addConstraint(s);break;case 1:var o=t.BaseObject.borrowObject(t.PathConstraint);o.init(n,a);a._addConstraint(o);break;default:var l=t.BaseObject.borrowObject(t.IKConstraint);l.init(n,a);a._addConstraint(l);break}}};e.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,t!==null?t.dataName:"","",t!==null?t.textureAtlasName:"")};e.prototype._getSlotDisplay=function(e,a,r){var i=e!==null?e.dataName:a.parent.parent.parent.name;var n=null;switch(a.type){case 0:{var s=a;if(s.texture===null){s.texture=this._getTextureData(i,a.path)}n=r.rawDisplay;break}case 2:{var o=a;if(o.texture===null){o.texture=this._getTextureData(i,o.path)}if(this._isSupportMesh()){n=r.meshDisplay}else{n=r.rawDisplay}break}case 1:{var l=a;var h=this._buildChildArmature(e,r,l);if(h!==null){h.inheritAnimation=l.inheritAnimation;if(!h.inheritAnimation){var u=l.actions.length>0?l.actions:h.armatureData.defaultActions;if(u.length>0){for(var f=0,_=u;f<_.length;f++){var m=_[f];var p=t.BaseObject.borrowObject(t.EventObject);t.EventObject.actionDataToInstance(m,p,r.armature);p.slot=r;r.armature._bufferAction(p,false)}}else{h.animation.play()}}l.armature=h.armatureData}n=h;break}case 3:break;default:break}return n};e.prototype.parseDragonBonesData=function(t,a,r){if(a===void 0){a=null}if(r===void 0){r=1}var i=t instanceof ArrayBuffer?e._binaryParser:this._dataParser;var n=i.parseDragonBonesData(t,r);while(true){var s=this._buildTextureAtlasData(null,null);if(i.parseTextureAtlasData(null,s,r)){this.addTextureAtlasData(s,a)}else{s.returnToPool();break}}if(n!==null){this.addDragonBonesData(n,a)}return n};e.prototype.parseTextureAtlasData=function(t,e,a,r){if(a===void 0){a=null}if(r===void 0){r=1}var i=this._buildTextureAtlasData(null,null);this._dataParser.parseTextureAtlasData(t,i,r);this._buildTextureAtlasData(i,e||null);this.addTextureAtlasData(i,a);return i};e.prototype.updateTextureAtlases=function(t,e){var a=this.getTextureAtlasData(e);if(a!==null){for(var r=0,i=a.length;r=0){continue}var h=e.getDisplays(l.name);if(h===null){if(n!==null&&e!==n){h=n.getDisplays(l.name)}if(h===null){if(a){l.displayFrameCount=0}continue}}l.displayFrameCount=h.length;for(var u=0,f=l.displayFrameCount;u0};a.prototype.addDBEventListener=function(t,e,a){if(!(t in this._signals)){this._signals[t]=new Phaser.Signal}var r=this._signals[t];r.add(e,a)};a.prototype.removeDBEventListener=function(t,e,a){if(t in this._signals){var r=this._signals[t];r.remove(e,a)}};Object.defineProperty(a.prototype,"armature",{get:function(){return this._armature},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animation",{get:function(){return this._armature.animation},enumerable:true,configurable:true});a.prototype.hasEvent=function(t){return this.hasDBEventListener(t)};a.prototype.addEvent=function(t,e,a){this.addDBEventListener(t,e,a)};a.prototype.removeEvent=function(t,e,a){this.removeDBEventListener(t,e,a)};return a}(Phaser.Sprite);t.PhaserArmatureDisplay=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.PhaserSlot]"};a.prototype._onClear=function(){e.prototype._onClear.call(this);this._textureScale=1;this._renderDisplay=null};a.prototype._initDisplay=function(t,e){t;e};a.prototype._disposeDisplay=function(t,e){t;if(!e){t.destroy(true)}};a.prototype._onUpdateDisplay=function(){this._renderDisplay=this._display?this._display:this._rawDisplay};a.prototype._addDisplay=function(){var t=this._armature.display;t.addChild(this._renderDisplay)};a.prototype._replaceDisplay=function(t){var e=this._armature.display;var a=t;e.addChild(this._renderDisplay);e.swapChildren(this._renderDisplay,a);e.removeChild(a);this._textureScale=1};a.prototype._removeDisplay=function(){this._renderDisplay.parent.removeChild(this._renderDisplay)};a.prototype._updateZOrder=function(){var t=this._armature.display;var e=t.getChildIndex(this._renderDisplay);if(e===this._zOrder){return}t.addChildAt(this._renderDisplay,this._zOrder)};a.prototype._updateVisible=function(){this._renderDisplay.visible=this._parent.visible&&this._visible};a.prototype._updateBlendMode=function(){if(this._renderDisplay instanceof PIXI.Sprite){switch(this._blendMode){case 0:this._renderDisplay.blendMode=PIXI.blendModes.NORMAL;break;case 1:this._renderDisplay.blendMode=PIXI.blendModes.ADD;break;case 3:this._renderDisplay.blendMode=PIXI.blendModes.DARKEN;break;case 4:this._renderDisplay.blendMode=PIXI.blendModes.DIFFERENCE;break;case 6:this._renderDisplay.blendMode=PIXI.blendModes.HARD_LIGHT;break;case 9:this._renderDisplay.blendMode=PIXI.blendModes.LIGHTEN;break;case 10:this._renderDisplay.blendMode=PIXI.blendModes.MULTIPLY;break;case 11:this._renderDisplay.blendMode=PIXI.blendModes.OVERLAY;break;case 12:this._renderDisplay.blendMode=PIXI.blendModes.SCREEN;break;default:break}}};a.prototype._updateColor=function(){var t=this._colorTransform.alphaMultiplier*this._globalAlpha;this._renderDisplay.alpha=t;if(this._renderDisplay instanceof PIXI.Sprite){var e=(Math.round(this._colorTransform.redMultiplier*255)<<16)+(Math.round(this._colorTransform.greenMultiplier*255)<<8)+Math.round(this._colorTransform.blueMultiplier*255);this._renderDisplay.tint=e}};a.prototype._updateFrame=function(){var e=this._textureData;if(this._displayIndex>=0&&this._display!==null&&e!==null){var a=e.parent;if(this._armature.replacedTexture!==null){if(this._armature._replaceTextureAtlasData===null){a=t.BaseObject.borrowObject(t.PhaserTextureAtlasData);a.copyFrom(e.parent);a.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=a}else{a=this._armature._replaceTextureAtlasData}e=a.getTexture(e.name)}var r=e.renderTexture;if(r!==null){if(this._geometryData!==null){}else{this._textureScale=e.parent.scale*this._armature._armatureData.scale;var i=this._renderDisplay;i.setTexture(r)}this._visibleDirty=true;return}}if(this._geometryData!==null){}else{var i=this._renderDisplay;i.x=0;i.y=0;i.visible=false}};a.prototype._updateMesh=function(){};a.prototype._updateTransform=function(){this.updateGlobalTransform();var t=this.global;if(this._renderDisplay===this._rawDisplay||this._renderDisplay===this._meshDisplay){var e=t.x-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY);var a=t.y-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY);this._renderDisplay.x=e;this._renderDisplay.y=a}else{this._renderDisplay.x=t.x;this._renderDisplay.y=t.y}this._renderDisplay.rotation=t.rotation;this._renderDisplay.skew=t.skew;this._renderDisplay.scale.x=t.scaleX*this._textureScale;this._renderDisplay.scale.y=t.scaleY*this._textureScale};a.prototype._identityTransform=function(){this._renderDisplay.x=0;this._renderDisplay.y=0;this._renderDisplay.rotation=0;this._renderDisplay.skew=0;this._renderDisplay.scale.x=1;this._renderDisplay.scale.y=1};return a}(t.Slot);t.PhaserSlot=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.prototype.updateTransform=function(e){if(!e&&!this.parent&&!this.game){return this}var a=this.parent;if(e){a=e}else if(!this.parent){a=this.game.world}var r=a.worldTransform;var i=this.worldTransform;var n,s,o,l,h,u;if(this.rotation%Phaser.Math.PI2){if(this.rotation!==this.rotationCache){this.rotationCache=this.rotation;this._sr=Math.sin(this.rotation);this._cr=Math.cos(this.rotation)}var f=this.skew%t.Transform.PI_D;if(f>.01||f<-.01){n=this._cr*this.scale.x;s=this._sr*this.scale.x;o=-Math.sin(f+this.rotation)*this.scale.y;l=Math.cos(f+this.rotation)*this.scale.y;h=this.position.x;u=this.position.y}else{n=this._cr*this.scale.x;s=this._sr*this.scale.x;o=-this._sr*this.scale.y;l=this._cr*this.scale.y;h=this.position.x;u=this.position.y}if(this.pivot.x||this.pivot.y){h-=this.pivot.x*n+this.pivot.y*o;u-=this.pivot.x*s+this.pivot.y*l}i.a=n*r.a+s*r.c;i.b=n*r.b+s*r.d;i.c=o*r.a+l*r.c;i.d=o*r.b+l*r.d;i.tx=h*r.a+u*r.c+r.tx;i.ty=h*r.b+u*r.d+r.ty}else{n=this.scale.x;s=0;o=0;l=this.scale.y;h=this.position.x-this.pivot.x*n;u=this.position.y-this.pivot.y*l;i.a=n*r.a;i.b=n*r.b;i.c=l*r.c;i.d=l*r.d;i.tx=h*r.a+u*r.c+r.tx;i.ty=h*r.b+u*r.d+r.ty}n=i.a;s=i.b;o=i.c;l=i.d;var _=n*l-s*o;if(n||s){var m=Math.sqrt(n*n+s*s);this.worldRotation=s>0?Math.acos(n/m):-Math.acos(n/m);this.worldScale.x=m;this.worldScale.y=_/m}else if(o||l){var p=Math.sqrt(o*o+l*l);this.worldRotation=Phaser.Math.HALF_PI-(l>0?Math.acos(-o/p):-Math.acos(o/p));this.worldScale.x=_/p;this.worldScale.y=p}else{this.worldScale.x=0;this.worldScale.y=0}this.worldAlpha=this.alpha*a.worldAlpha;this.worldPosition.x=i.tx;this.worldPosition.y=i.ty;this._currentBounds=null;if(this.transformCallback){this.transformCallback.call(this.transformCallbackContext,i,r)}return this};return a}(Phaser.Image);t.PhaserSlotDisplay=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(t){if(t===void 0){t=null}var r=e.call(this,t)||this;r._dragonBones=a._dragonBonesInstance;return r}a.init=function(e){if(a._game!==null){return}a._game=e;var r=new t.PhaserArmatureDisplay;a._dragonBonesInstance=new t.DragonBones(r)};Object.defineProperty(a,"factory",{get:function(){if(a._factory===null){a._factory=new a}return a._factory},enumerable:true,configurable:true});a.prototype._isSupportMesh=function(){console.warn("Phaser-ce can not support mesh.");return false};a.prototype._buildTextureAtlasData=function(e,a){if(e){e.renderTexture=a}else{e=t.BaseObject.borrowObject(t.PhaserTextureAtlasData)}return e};a.prototype._buildArmature=function(e){var a=t.BaseObject.borrowObject(t.Armature);var r=new t.PhaserArmatureDisplay;a.init(e.armature,r,r,this._dragonBones);return a};a.prototype._buildSlot=function(e,r,i){e;i;var n=t.BaseObject.borrowObject(t.PhaserSlot);var s=new t.PhaserSlotDisplay(a._game,0,0,Phaser.Cache.DEFAULT);n.init(r,i,s,s);return n};a.prototype.buildArmatureDisplay=function(t,e,a,r){if(e===void 0){e=""}if(a===void 0){a=""}if(r===void 0){r=""}var i=this.buildArmature(t,e||"",a||"",r||"");if(i!==null){this._dragonBones.clock.add(i);return i.display}return null};a.prototype.getTextureDisplay=function(t,e){if(e===void 0){e=null}var r=this._getTextureData(e!==null?e:"",t);if(r!==null&&r.renderTexture!==null){return new Phaser.Sprite(a._game,0,0)}return null};Object.defineProperty(a.prototype,"soundEventManager",{get:function(){return this._dragonBones.eventManager},enumerable:true,configurable:true});a._game=null;a._dragonBonesInstance=null;a._factory=null;return a}(t.BaseFactory);t.PhaserFactory=e})(dragonBones||(dragonBones={}));
\ No newline at end of file
diff --git a/Phaser/2.x/src/dragonBones/phaser/PhaserSlot.ts b/Phaser/2.x/src/dragonBones/phaser/PhaserSlot.ts
index 8822c9a0..d9a0d6ce 100644
--- a/Phaser/2.x/src/dragonBones/phaser/PhaserSlot.ts
+++ b/Phaser/2.x/src/dragonBones/phaser/PhaserSlot.ts
@@ -147,7 +147,9 @@ namespace dragonBones {
         }
 
         protected _updateColor(): void {
-            this._renderDisplay.alpha = this._colorTransform.alphaMultiplier;
+            const alpha = this._colorTransform.alphaMultiplier * this._globalAlpha;
+            this._renderDisplay.alpha = alpha;
+
             if (this._renderDisplay instanceof PIXI.Sprite) { // || this._renderDisplay instanceof PIXI.mesh.Mesh
                 const color = (Math.round(this._colorTransform.redMultiplier * 0xFF) << 16) + (Math.round(this._colorTransform.greenMultiplier * 0xFF) << 8) + Math.round(this._colorTransform.blueMultiplier * 0xFF);
                 this._renderDisplay.tint = color;
@@ -156,12 +158,12 @@ namespace dragonBones {
         }
 
         protected _updateFrame(): void {
-            const currentVerticesData = (this._deformVertices !== null && this._display === this._meshDisplay) ? this._deformVertices.verticesData : null;
             let currentTextureData = this._textureData as (PhaserTextureData | null);
 
             if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) {
                 let currentTextureAtlasData = currentTextureData.parent as PhaserTextureAtlasData;
-                if (this._armature.replacedTexture !== null && this._rawDisplayDatas !== null && this._rawDisplayDatas.indexOf(this._displayData) >= 0) { // Update replaced texture atlas.
+                
+                if (this._armature.replacedTexture !== null) { // Update replaced texture atlas.
                     if (this._armature._replaceTextureAtlasData === null) {
                         currentTextureAtlasData = BaseObject.borrowObject(PhaserTextureAtlasData);
                         currentTextureAtlasData.copyFrom(currentTextureData.parent);
@@ -177,7 +179,7 @@ namespace dragonBones {
 
                 const renderTexture = currentTextureData.renderTexture;
                 if (renderTexture !== null) {
-                    if (currentVerticesData !== null) { // Mesh.
+                    if (this._geometryData !== null) { // Mesh.
                         // TODO
                     }
                     else { // Normal texture.
@@ -191,7 +193,7 @@ namespace dragonBones {
                 }
             }
 
-            if (currentVerticesData !== null) {
+            if (this._geometryData !== null) {
                 // TODO
             }
             else {
@@ -206,12 +208,6 @@ namespace dragonBones {
         protected _updateMesh(): void {
             // TODO
         }
-        /**
-         * @internal
-         */
-        public _updateGlueMesh(): void {
-            // TODO
-        }
 
         protected _updateTransform(): void {
             this.updateGlobalTransform(); // Update transform.
diff --git a/Phaser/2.x/tsconfig.json b/Phaser/2.x/tsconfig.json
index f4f35fca..10f8e679 100644
--- a/Phaser/2.x/tsconfig.json
+++ b/Phaser/2.x/tsconfig.json
@@ -3,6 +3,7 @@
 		"watch": false,
 		"sourceMap": false,
 		"declaration": true,
+        "stripInternal": true,
 		"alwaysStrict": true,
 		"noImplicitAny": true,
 		"noImplicitThis": true,
@@ -25,7 +26,6 @@
 	],
 	"files": [
 		"./libs/phaser.d.ts",
-		"../../DragonBones/src/dragonBones/modules.ts",
 
 		"../../DragonBones/src/dragonBones/core/DragonBones.ts",
 		"../../DragonBones/src/dragonBones/core/BaseObject.ts",
@@ -55,7 +55,6 @@
 		"../../DragonBones/src/dragonBones/armature/Surface.ts",
 		"../../DragonBones/src/dragonBones/armature/Slot.ts",
 		"../../DragonBones/src/dragonBones/armature/Constraint.ts",
-		"../../DragonBones/src/dragonBones/armature/DeformVertices.ts",
 
 		"../../DragonBones/src/dragonBones/animation/IAnimatable.ts",
 		"../../DragonBones/src/dragonBones/animation/WorldClock.ts",
diff --git a/Phaser/3.x/README.md b/Phaser/3.x/README.md
new file mode 100644
index 00000000..85af3124
--- /dev/null
+++ b/Phaser/3.x/README.md
@@ -0,0 +1,20 @@
+## How to build
+* Clone or download [DragonBonesJS](https://github.com/DragonBones/DragonBonesJS/).
+* Install [Node.JS](https://nodejs.org/).
+* Open `DragonBonesJS/Phaser/3.x/` in command.
+* $ `npm install`
+* $ `npm run build`
+
+## Make sure project structure like this:
+```
+Your project
+    |-- types
+        |-- phaser.d.ts
+    |-- node_modules
+        |-- ...
+    |-- out
+        |-- ...
+    |-- src
+        |-- ...
+    |-- ...
+```
diff --git a/Phaser/3.x/out/dragonBones.d.ts b/Phaser/3.x/out/dragonBones.d.ts
new file mode 100644
index 00000000..9c09bcde
--- /dev/null
+++ b/Phaser/3.x/out/dragonBones.d.ts
@@ -0,0 +1,6408 @@
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+declare namespace dragonBones {
+    /**
+     * @private
+     */
+    const enum BinaryOffset {
+        WeigthBoneCount = 0,
+        WeigthFloatOffset = 1,
+        WeigthBoneIndices = 2,
+        GeometryVertexCount = 0,
+        GeometryTriangleCount = 1,
+        GeometryFloatOffset = 2,
+        GeometryWeightOffset = 3,
+        GeometryVertexIndices = 4,
+        TimelineScale = 0,
+        TimelineOffset = 1,
+        TimelineKeyFrameCount = 2,
+        TimelineFrameValueCount = 3,
+        TimelineFrameValueOffset = 4,
+        TimelineFrameOffset = 5,
+        FramePosition = 0,
+        FrameTweenType = 1,
+        FrameTweenEasingOrCurveSampleCount = 2,
+        FrameCurveSamples = 3,
+        DeformVertexOffset = 0,
+        DeformCount = 1,
+        DeformValueCount = 2,
+        DeformValueOffset = 3,
+        DeformFloatOffset = 4
+    }
+    /**
+     * @private
+     */
+    const enum ArmatureType {
+        Armature = 0,
+        MovieClip = 1,
+        Stage = 2
+    }
+    /**
+     * @private
+     */
+    const enum BoneType {
+        Bone = 0,
+        Surface = 1
+    }
+    /**
+     * @private
+     */
+    const enum DisplayType {
+        Image = 0,
+        Armature = 1,
+        Mesh = 2,
+        BoundingBox = 3,
+        Path = 4
+    }
+    /**
+     * - Bounding box type.
+     * @version DragonBones 5.0
+     * @language en_US
+     */
+    /**
+     * - 边界框类型。
+     * @version DragonBones 5.0
+     * @language zh_CN
+     */
+    const enum BoundingBoxType {
+        Rectangle = 0,
+        Ellipse = 1,
+        Polygon = 2
+    }
+    /**
+     * @private
+     */
+    const enum ActionType {
+        Play = 0,
+        Frame = 10,
+        Sound = 11
+    }
+    /**
+     * @private
+     */
+    const enum BlendMode {
+        Normal = 0,
+        Add = 1,
+        Alpha = 2,
+        Darken = 3,
+        Difference = 4,
+        Erase = 5,
+        HardLight = 6,
+        Invert = 7,
+        Layer = 8,
+        Lighten = 9,
+        Multiply = 10,
+        Overlay = 11,
+        Screen = 12,
+        Subtract = 13
+    }
+    /**
+     * @private
+     */
+    const enum TweenType {
+        None = 0,
+        Line = 1,
+        Curve = 2,
+        QuadIn = 3,
+        QuadOut = 4,
+        QuadInOut = 5
+    }
+    /**
+     * @private
+     */
+    const enum TimelineType {
+        Action = 0,
+        ZOrder = 1,
+        BoneAll = 10,
+        BoneTranslate = 11,
+        BoneRotate = 12,
+        BoneScale = 13,
+        Surface = 50,
+        BoneAlpha = 60,
+        SlotDisplay = 20,
+        SlotColor = 21,
+        SlotDeform = 22,
+        SlotZIndex = 23,
+        SlotAlpha = 24,
+        IKConstraint = 30,
+        AnimationProgress = 40,
+        AnimationWeight = 41,
+        AnimationParameter = 42
+    }
+    /**
+     * - Offset mode.
+     * @version DragonBones 5.5
+     * @language en_US
+     */
+    /**
+     * - 偏移模式。
+     * @version DragonBones 5.5
+     * @language zh_CN
+     */
+    const enum OffsetMode {
+        None = 0,
+        Additive = 1,
+        Override = 2
+    }
+    /**
+     * - Animation fade out mode.
+     * @version DragonBones 4.5
+     * @language en_US
+     */
+    /**
+     * - 动画淡出模式。
+     * @version DragonBones 4.5
+     * @language zh_CN
+     */
+    const enum AnimationFadeOutMode {
+        /**
+         * - Fade out the animation states of the same layer.
+         * @language en_US
+         */
+        /**
+         * - 淡出同层的动画状态。
+         * @language zh_CN
+         */
+        SameLayer = 1,
+        /**
+         * - Fade out the animation states of the same group.
+         * @language en_US
+         */
+        /**
+         * - 淡出同组的动画状态。
+         * @language zh_CN
+         */
+        SameGroup = 2,
+        /**
+         * - Fade out the animation states of the same layer and group.
+         * @language en_US
+         */
+        /**
+         * - 淡出同层并且同组的动画状态。
+         * @language zh_CN
+         */
+        SameLayerAndGroup = 3,
+        /**
+         * - Fade out of all animation states.
+         * @language en_US
+         */
+        /**
+         * - 淡出所有的动画状态。
+         * @language zh_CN
+         */
+        All = 4,
+        /**
+         * - Does not replace the animation state with the same name.
+         * @language en_US
+         */
+        /**
+         * - 不替换同名的动画状态。
+         * @language zh_CN
+         */
+        Single = 5
+    }
+    /**
+     * @private
+     */
+    const enum AnimationBlendType {
+        None = 0,
+        E1D = 1
+    }
+    /**
+     * @private
+     */
+    const enum AnimationBlendMode {
+        Additive = 0,
+        Override = 1
+    }
+    /**
+     * @private
+     */
+    const enum ConstraintType {
+        IK = 0,
+        Path = 1
+    }
+    /**
+     * @private
+     */
+    const enum PositionMode {
+        Fixed = 0,
+        Percent = 1
+    }
+    /**
+     * @private
+     */
+    const enum SpacingMode {
+        Length = 0,
+        Fixed = 1,
+        Percent = 2
+    }
+    /**
+     * @private
+     */
+    const enum RotateMode {
+        Tangent = 0,
+        Chain = 1,
+        ChainScale = 2
+    }
+    /**
+     * @private
+     */
+    interface Map {
+        [key: string]: T;
+    }
+    /**
+     * @private
+     */
+    class DragonBones {
+        static readonly VERSION: string;
+        static yDown: boolean;
+        static debug: boolean;
+        static debugDraw: boolean;
+        private readonly _clock;
+        private readonly _events;
+        private readonly _objects;
+        private _eventManager;
+        constructor(eventManager: IEventDispatcher);
+        advanceTime(passedTime: number): void;
+        bufferEvent(value: EventObject): void;
+        bufferObject(object: BaseObject): void;
+        readonly clock: WorldClock;
+        readonly eventManager: IEventDispatcher;
+    }
+}
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+declare namespace dragonBones {
+    /**
+     * - The BaseObject is the base class for all objects in the DragonBones framework.
+     * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery.
+     * @version DragonBones 4.5
+     * @language en_US
+     */
+    /**
+     * - 基础对象,通常 DragonBones 的对象都继承自该类。
+     * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。
+     * @version DragonBones 4.5
+     * @language zh_CN
+     */
+    abstract class BaseObject {
+        private static _hashCode;
+        private static _defaultMaxCount;
+        private static readonly _maxCountMap;
+        private static readonly _poolsMap;
+        private static _returnObject;
+        static toString(): string;
+        /**
+         * - Set the maximum cache count of the specify object pool.
+         * @param objectConstructor - The specify class. (Set all object pools max cache count if not set)
+         * @param maxCount - Max count.
+         * @version DragonBones 4.5
+         * @language en_US
+         */
+        /**
+         * - 设置特定对象池的最大缓存数量。
+         * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量)
+         * @param maxCount - 最大缓存数量。
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        static setMaxCount(objectConstructor: (typeof BaseObject) | null, maxCount: number): void;
+        /**
+         * - Clear the cached instances of a specify object pool.
+         * @param objectConstructor - Specify class. (Clear all cached instances if not set)
+         * @version DragonBones 4.5
+         * @language en_US
+         */
+        /**
+         * - 清除特定对象池的缓存实例。
+         * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例)
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        static clearPool(objectConstructor?: (typeof BaseObject) | null): void;
+        /**
+         * - Get an instance of the specify class from object pool.
+         * @param objectConstructor - The specify class.
+         * @version DragonBones 4.5
+         * @language en_US
+         */
+        /**
+         * - 从对象池中获取特定类的实例。
+         * @param objectConstructor - 特定的类。
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        static borrowObject(objectConstructor: {
+            new (): T;
+        }): T;
+        /**
+         * - A unique identification number assigned to the object.
+         * @version DragonBones 4.5
+         * @language en_US
+         */
+        /**
+         * - 分配给此实例的唯一标识号。
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        readonly hashCode: number;
+        private _isInPool;
+        protected abstract _onClear(): void;
+        /**
+         * - Clear the object and return it back to object pool。
+         * @version DragonBones 4.5
+         * @language en_US
+         */
+        /**
+         * - 清除该实例的所有数据并将其返还对象池。
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        returnToPool(): void;
+    }
+}
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+declare namespace dragonBones {
+    /**
+     * - 2D Transform matrix.
+     * @version DragonBones 3.0
+     * @language en_US
+     */
+    /**
+     * - 2D 转换矩阵。
+     * @version DragonBones 3.0
+     * @language zh_CN
+     */
+    class Matrix {
+        /**
+         * - The value that affects the positioning of pixels along the x axis when scaling or rotating an image.
+         * @default 1.0
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 缩放或旋转图像时影响像素沿 x 轴定位的值。
+         * @default 1.0
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        a: number;
+        /**
+         * - The value that affects the positioning of pixels along the y axis when rotating or skewing an image.
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 旋转或倾斜图像时影响像素沿 y 轴定位的值。
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        b: number;
+        /**
+         * - The value that affects the positioning of pixels along the x axis when rotating or skewing an image.
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 旋转或倾斜图像时影响像素沿 x 轴定位的值。
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        c: number;
+        /**
+         * - The value that affects the positioning of pixels along the y axis when scaling or rotating an image.
+         * @default 1.0
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 缩放或旋转图像时影响像素沿 y 轴定位的值。
+         * @default 1.0
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        d: number;
+        /**
+         * - The distance by which to translate each point along the x axis.
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 沿 x 轴平移每个点的距离。
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        tx: number;
+        /**
+         * - The distance by which to translate each point along the y axis.
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 沿 y 轴平移每个点的距离。
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        ty: number;
+        /**
+         * @private
+         */
+        constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
+        toString(): string;
+        /**
+         * @private
+         */
+        copyFrom(value: Matrix): Matrix;
+        /**
+         * @private
+         */
+        copyFromArray(value: Array, offset?: number): Matrix;
+        /**
+         * - Convert to unit matrix.
+         * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0.
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 转换为单位矩阵。
+         * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        identity(): Matrix;
+        /**
+         * - Multiplies the current matrix with another matrix.
+         * @param value - The matrix that needs to be multiplied.
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 将当前矩阵与另一个矩阵相乘。
+         * @param value - 需要相乘的矩阵。
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        concat(value: Matrix): Matrix;
+        /**
+         * - Convert to inverse matrix.
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 转换为逆矩阵。
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        invert(): Matrix;
+        /**
+         * - Apply a matrix transformation to a specific point.
+         * @param x - X coordinate.
+         * @param y - Y coordinate.
+         * @param result - The point after the transformation is applied.
+         * @param delta - Whether to ignore tx, ty's conversion to point.
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 将矩阵转换应用于特定点。
+         * @param x - 横坐标。
+         * @param y - 纵坐标。
+         * @param result - 应用转换之后的点。
+         * @param delta - 是否忽略 tx,ty 对点的转换。
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        transformPoint(x: number, y: number, result: {
+            x: number;
+            y: number;
+        }, delta?: boolean): void;
+        /**
+         * @private
+         */
+        transformRectangle(rectangle: {
+            x: number;
+            y: number;
+            width: number;
+            height: number;
+        }, delta?: boolean): void;
+    }
+}
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+declare namespace dragonBones {
+    /**
+     * - 2D Transform.
+     * @version DragonBones 3.0
+     * @language en_US
+     */
+    /**
+     * - 2D 变换。
+     * @version DragonBones 3.0
+     * @language zh_CN
+     */
+    class Transform {
+        /**
+         * @private
+         */
+        static readonly PI: number;
+        /**
+         * @private
+         */
+        static readonly PI_D: number;
+        /**
+         * @private
+         */
+        static readonly PI_H: number;
+        /**
+         * @private
+         */
+        static readonly PI_Q: number;
+        /**
+         * @private
+         */
+        static readonly RAD_DEG: number;
+        /**
+         * @private
+         */
+        static readonly DEG_RAD: number;
+        /**
+         * @private
+         */
+        static normalizeRadian(value: number): number;
+        /**
+         * - Horizontal translate.
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 水平位移。
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        x: number;
+        /**
+         * - Vertical translate.
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 垂直位移。
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        y: number;
+        /**
+         * - Skew. (In radians)
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 倾斜。 (以弧度为单位)
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        skew: number;
+        /**
+         * - rotation. (In radians)
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 旋转。 (以弧度为单位)
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        rotation: number;
+        /**
+         * - Horizontal Scaling.
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 水平缩放。
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        scaleX: number;
+        /**
+         * - Vertical scaling.
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 垂直缩放。
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        scaleY: number;
+        /**
+         * @private
+         */
+        constructor(x?: number, y?: number, skew?: number, rotation?: number, scaleX?: number, scaleY?: number);
+        toString(): string;
+        /**
+         * @private
+         */
+        copyFrom(value: Transform): Transform;
+        /**
+         * @private
+         */
+        identity(): Transform;
+        /**
+         * @private
+         */
+        add(value: Transform): Transform;
+        /**
+         * @private
+         */
+        minus(value: Transform): Transform;
+        /**
+         * @private
+         */
+        fromMatrix(matrix: Matrix): Transform;
+        /**
+         * @private
+         */
+        toMatrix(matrix: Matrix): Transform;
+    }
+}
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+declare namespace dragonBones {
+    /**
+     * @private
+     */
+    class ColorTransform {
+        alphaMultiplier: number;
+        redMultiplier: number;
+        greenMultiplier: number;
+        blueMultiplier: number;
+        alphaOffset: number;
+        redOffset: number;
+        greenOffset: number;
+        blueOffset: number;
+        constructor(alphaMultiplier?: number, redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaOffset?: number, redOffset?: number, greenOffset?: number, blueOffset?: number);
+        copyFrom(value: ColorTransform): void;
+        identity(): void;
+    }
+}
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+declare namespace dragonBones {
+    /**
+     * - The Point object represents a location in a two-dimensional coordinate system.
+     * @version DragonBones 3.0
+     * @language en_US
+     */
+    /**
+     * - Point 对象表示二维坐标系统中的某个位置。
+     * @version DragonBones 3.0
+     * @language zh_CN
+     */
+    class Point {
+        /**
+         * - The horizontal coordinate.
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 该点的水平坐标。
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        x: number;
+        /**
+         * - The vertical coordinate.
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 该点的垂直坐标。
+         * @default 0.0
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        y: number;
+        /**
+         * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0).
+         * @param x - The horizontal coordinate.
+         * @param y - The vertical coordinate.
+         * @version DragonBones 3.0
+         * @language en_US
+         */
+        /**
+         * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。
+         * @param x - 该对象的x属性值,默认为 0.0。
+         * @param y - 该对象的y属性值,默认为 0.0。
+         * @version DragonBones 3.0
+         * @language zh_CN
+         */
+        constructor(x?: number, y?: number);
+        /**
+         * @private
+         */
+        copyFrom(value: Point): void;
+        /**
+         * @private
+         */
+        clear(): void;
+    }
+}
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+declare namespace dragonBones {
+    /**
+     * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its
+     * width and its height.
+ * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of + * one property has no effect on the others. However, the right and bottom properties are integrally related to those + * four properties. For example, if you change the value of the right property, the value of the width property changes; + * if you change the bottom property, the value of the height property changes. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
+ * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 + * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width + * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Rectangle { + /** + * - The x coordinate of the top-left corner of the rectangle. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形左上角的 x 坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - The y coordinate of the top-left corner of the rectangle. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形左上角的 y 坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - The width of the rectangle, in pixels. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形的宽度(以像素为单位)。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + width: number; + /** + * - 矩形的高度(以像素为单位)。 + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - The height of the rectangle, in pixels. + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + height: number; + /** + * @private + */ + constructor(x?: number, y?: number, width?: number, height?: number); + /** + * @private + */ + copyFrom(value: Rectangle): void; + /** + * @private + */ + clear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The user custom data. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 用户自定义数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + class UserData extends BaseObject { + static toString(): string; + /** + * - The custom int numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly ints: Array; + /** + * - The custom float numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly floats: Array; + /** + * - The custom strings. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly strings: Array; + protected _onClear(): void; + /** + * - Get the custom int number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getInt(index?: number): number; + /** + * - Get the custom float number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getFloat(index?: number): number; + /** + * - Get the custom string. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getString(index?: number): string; + } + /** + * @private + */ + class ActionData extends BaseObject { + static toString(): string; + type: ActionType; + name: string; + bone: BoneData | null; + slot: SlotData | null; + data: UserData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The DragonBones data. + * A DragonBones data contains multiple armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据。 + * 一个龙骨数据包含多个骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + class DragonBonesData extends BaseObject { + static toString(): string; + /** + * @private + */ + autoSearch: boolean; + /** + * - The animation frame rate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画帧频。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameRate: number; + /** + * - The data version. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 数据版本。 + * @version DragonBones 3.0 + * @language zh_CN + */ + version: string; + /** + * - The DragonBones data name. + * The name is consistent with the DragonBones project name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据名称。 + * 该名称与龙骨项目名保持一致。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + stage: ArmatureData | null; + /** + * - All armature data names. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly armatureNames: Array; + /** + * @private + */ + readonly armatures: Map; + /** + * @private + */ + userData: UserData | null; + protected _onClear(): void; + /** + * - Get a specific armature data. + * @param armatureName - The armature data name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param armatureName - 骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getArmature(armatureName: string): ArmatureData | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The armature data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class ArmatureData extends BaseObject { + static toString(): string; + /** + * @private + */ + type: ArmatureType; + /** + * - The animation frame rate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画帧率。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameRate: number; + /** + * @private + */ + cacheFrameRate: number; + /** + * @private + */ + scale: number; + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly aabb: Rectangle; + /** + * - The names of all the animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的动画数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animationNames: Array; + /** + * @private + */ + readonly sortedBones: Array; + /** + * @private + */ + readonly sortedSlots: Array; + /** + * @private + */ + readonly defaultActions: Array; + /** + * @private + */ + readonly actions: Array; + /** + * @private + */ + readonly bones: Map; + /** + * @private + */ + readonly slots: Map; + /** + * @private + */ + readonly constraints: Map; + /** + * @private + */ + readonly skins: Map; + /** + * @private + */ + readonly animations: Map; + /** + * - The default skin data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 默认插槽数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + defaultSkin: SkinData | null; + /** + * - The default animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 默认动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + defaultAnimation: AnimationData | null; + /** + * @private + */ + canvas: CanvasData | null; + /** + * @private + */ + userData: UserData | null; + /** + * @private + */ + parent: DragonBonesData; + protected _onClear(): void; + /** + * - Get a specific done data. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼数据。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getBone(boneName: string): BoneData | null; + /** + * - Get a specific slot data. + * @param slotName - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽数据。 + * @param slotName - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlot(slotName: string): SlotData | null; + /** + * @private + */ + getConstraint(constraintName: string): ConstraintData | null; + /** + * - Get a specific skin data. + * @param skinName - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定皮肤数据。 + * @param skinName - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getSkin(skinName: string): SkinData | null; + /** + * @private + */ + getMesh(skinName: string, slotName: string, meshName: string): MeshDisplayData | null; + /** + * - Get a specific animation data. + * @param animationName - The animation animationName. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的动画数据。 + * @param animationName - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getAnimation(animationName: string): AnimationData | null; + } + /** + * - The bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class BoneData extends BaseObject { + static toString(): string; + /** + * @private + */ + inheritTranslation: boolean; + /** + * @private + */ + inheritRotation: boolean; + /** + * @private + */ + inheritScale: boolean; + /** + * @private + */ + inheritReflection: boolean; + /** + * @private + */ + type: BoneType; + /** + * - The bone length. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼长度。 + * @version DragonBones 3.0 + * @language zh_CN + */ + length: number; + /** + * @private + */ + alpha: number; + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly transform: Transform; + /** + * @private + */ + userData: UserData | null; + /** + * - The parent bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 父骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + parent: BoneData | null; + protected _onClear(): void; + } + /** + * - The slot data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class SlotData extends BaseObject { + static toString(): string; + /** + * @private + */ + blendMode: BlendMode; + /** + * @private + */ + displayIndex: number; + /** + * @private + */ + zOrder: number; + /** + * @private + */ + zIndex: number; + /** + * @private + */ + alpha: number; + /** + * - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + color: ColorTransform; + /** + * @private + */ + userData: UserData | null; + /** + * - The parent bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 父骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + parent: BoneData; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + abstract class ConstraintData extends BaseObject { + order: number; + name: string; + type: ConstraintType; + target: BoneData; + root: BoneData; + bone: BoneData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class CanvasData extends BaseObject { + static toString(): string; + hasBackground: boolean; + color: number; + x: number; + y: number; + width: number; + height: number; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The skin data, typically a armature data instance contains at least one skinData. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class SkinData extends BaseObject { + static toString(): string; + /** + * - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly displays: Map>; + /** + * @private + */ + parent: ArmatureData; + protected _onClear(): void; + /** + * @private + */ + getDisplay(slotName: string, displayName: string): DisplayData | null; + /** + * @private + */ + getDisplays(slotName: string): Array | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class GeometryData { + isShared: boolean; + inheritDeform: boolean; + offset: number; + data: DragonBonesData; + weight: WeightData | null; + clear(): void; + shareFrom(value: GeometryData): void; + readonly vertexCount: number; + readonly triangleCount: number; + } + /** + * @private + */ + abstract class DisplayData extends BaseObject { + type: DisplayType; + name: string; + path: string; + readonly transform: Transform; + parent: SkinData; + protected _onClear(): void; + } + /** + * @private + */ + class ImageDisplayData extends DisplayData { + static toString(): string; + readonly pivot: Point; + texture: TextureData | null; + protected _onClear(): void; + } + /** + * @private + */ + class ArmatureDisplayData extends DisplayData { + static toString(): string; + inheritAnimation: boolean; + readonly actions: Array; + armature: ArmatureData | null; + protected _onClear(): void; + /** + * @private + */ + addAction(value: ActionData): void; + } + /** + * @private + */ + class MeshDisplayData extends DisplayData { + static toString(): string; + readonly geometry: GeometryData; + texture: TextureData | null; + protected _onClear(): void; + } + /** + * @private + */ + class BoundingBoxDisplayData extends DisplayData { + static toString(): string; + boundingBox: BoundingBoxData | null; + protected _onClear(): void; + } + /** + * @private + */ + class PathDisplayData extends DisplayData { + static toString(): string; + closed: boolean; + constantSpeed: boolean; + readonly geometry: GeometryData; + readonly curveLengths: Array; + protected _onClear(): void; + } + /** + * @private + */ + class WeightData extends BaseObject { + static toString(): string; + count: number; + offset: number; + readonly bones: Array; + protected _onClear(): void; + addBone(value: BoneData): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The base class of bounding box data. + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框数据基类。 + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract class BoundingBoxData extends BaseObject { + /** + * - The bounding box type. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框类型。 + * @version DragonBones 5.0 + * @language zh_CN + */ + type: BoundingBoxType; + /** + * @private + */ + color: number; + /** + * @private + */ + width: number; + /** + * @private + */ + height: number; + protected _onClear(): void; + /** + * - Check whether the bounding box contains a specific point. (Local coordinate system) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查边界框是否包含特定点。(本地坐标系) + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract containsPoint(pX: number, pY: number): boolean; + /** + * - Check whether the bounding box intersects a specific segment. (Local coordinate system) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查边界框是否与特定线段相交。(本地坐标系) + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA: { + x: number; + y: number; + } | null, intersectionPointB: { + x: number; + y: number; + } | null, normalRadians: { + x: number; + y: number; + } | null): number; + } + /** + * - The rectangle bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 矩形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class RectangleBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * - Compute the bit code for a point (x, y) using the clip rectangle + */ + private static _computeOutCode; + /** + * @private + */ + static rectangleIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xMin: number, yMin: number, xMax: number, yMax: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } + /** + * - The ellipse bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 椭圆边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class EllipseBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * @private + */ + static ellipseIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xC: number, yC: number, widthH: number, heightH: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } + /** + * - The polygon bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class PolygonBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * @private + */ + static polygonIntersectsSegment(xA: number, yA: number, xB: number, yB: number, vertices: Array, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + /** + * @private + */ + x: number; + /** + * @private + */ + y: number; + /** + * - The polygon vertices. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形顶点。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly vertices: Array; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class AnimationData extends BaseObject { + static toString(): string; + /** + * @private + */ + blendType: AnimationBlendType; + /** + * - The frame count of the animation. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的帧数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameCount: number; + /** + * - The play times of the animation. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The duration of the animation. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的持续时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + duration: number; + /** + * @private + */ + scale: number; + /** + * - The fade in time of the animation. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的淡入时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + fadeInTime: number; + /** + * @private + */ + cacheFrameRate: number; + /** + * - The animation name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly cachedFrames: Array; + /** + * @private + */ + readonly boneTimelines: Map>; + /** + * @private + */ + readonly slotTimelines: Map>; + /** + * @private + */ + readonly constraintTimelines: Map>; + /** + * @private + */ + readonly animationTimelines: Map>; + /** + * @private + */ + readonly boneCachedFrameIndices: Map>; + /** + * @private + */ + readonly slotCachedFrameIndices: Map>; + /** + * @private + */ + actionTimeline: TimelineData | null; + /** + * @private + */ + zOrderTimeline: TimelineData | null; + /** + * @private + */ + parent: ArmatureData; + protected _onClear(): void; + /** + * @private + */ + addBoneTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addSlotTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addConstraintTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addAnimationTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + getBoneTimelines(timelineName: string): Array | null; + /** + * @private + */ + getSlotTimelines(timelineName: string): Array | null; + /** + * @private + */ + getConstraintTimelines(timelineName: string): Array | null; + /** + * @private + */ + getAnimationTimelines(timelineName: string): Array | null; + /** + * @private + */ + getBoneCachedFrameIndices(boneName: string): Array | null; + /** + * @private + */ + getSlotCachedFrameIndices(slotName: string): Array | null; + } + /** + * @private + */ + class TimelineData extends BaseObject { + static toString(): string; + type: TimelineType; + offset: number; + frameIndicesOffset: number; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation config is used to describe all the information needed to play an animation state. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画配置用来描述播放一个动画状态所需要的全部信息。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + class AnimationConfig extends BaseObject { + static toString(): string; + /** + * @private + */ + pauseFadeOut: boolean; + /** + * - Fade out the pattern of other animation states when the animation state is fade in. + * This property is typically used to specify the substitution of multiple animation states blend. + * @default dragonBones.AnimationFadeOutMode.All + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 淡入动画状态时淡出其他动画状态的模式。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @default dragonBones.AnimationFadeOutMode.All + * @version DragonBones 5.0 + * @language zh_CN + */ + fadeOutMode: AnimationFadeOutMode; + /** + * @private + */ + fadeOutTweenType: TweenType; + /** + * @private + */ + fadeOutTime: number; + /** + * @private + */ + pauseFadeIn: boolean; + /** + * @private + */ + actionEnabled: boolean; + /** + * @private + */ + additive: boolean; + /** + * - Whether the animation state has control over the display property of the slots. + * Sometimes blend a animation state does not want it to control the display properties of the slots, + * especially if other animation state are controlling the display properties of the slots. + * @default true + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态是否对插槽的显示对象属性有控制权。 + * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, + * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 + * @default true + * @version DragonBones 5.0 + * @language zh_CN + */ + displayControl: boolean; + /** + * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. + * This property should usually be set to false when blend multiple animation states. + * @default true + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 + * 通常在混合多个动画状态时应该将该属性设置为 false。 + * @default true + * @version DragonBones 5.1 + * @language zh_CN + */ + resetToPose: boolean; + /** + * @private + */ + fadeInTweenType: TweenType; + /** + * - The play times. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The blend layer. + * High layer animation state will get the blend weight first. + * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合图层。 + * 图层高的动画状态会优先获取混合权重。 + * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + layer: number; + /** + * - The start time of play. (In seconds) + * @default 0.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 播放的开始时间。 (以秒为单位) + * @default 0.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + position: number; + /** + * - The duration of play. + * [-1: Use the default value of the animation data, 0: Stop play, (0~N]: The duration] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 播放的持续时间。 + * [-1: 使用动画数据默认值, 0: 动画停止, (0~N]: 持续时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + duration: number; + /** + * - The play speed. + * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. + * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度。 + * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 + * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + weight: number; + /** + * - The fade in time. + * [-1: Use the default value of the animation data, [0~N]: The fade in time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 淡入时间。 + * [-1: 使用动画数据默认值, [0~N]: 淡入时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + fadeInTime: number; + /** + * - The auto fade out time when the animation state play completed. + * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态播放完成后的自动淡出时间。 + * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + autoFadeOutTime: number; + /** + * - The name of the animation state. (Can be different from the name of the animation data) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态名称。 (可以不同于动画数据) + * @version DragonBones 5.0 + * @language zh_CN + */ + name: string; + /** + * - The animation data name. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画数据名称。 + * @version DragonBones 5.0 + * @language zh_CN + */ + animation: string; + /** + * - The blend group name of the animation state. + * This property is typically used to specify the substitution of multiple animation states blend. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合组名称。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + group: string; + /** + * @private + */ + readonly boneMask: Array; + protected _onClear(): void; + /** + * @private + */ + clear(): void; + /** + * @private + */ + copyFrom(value: AnimationConfig): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class TextureAtlasData extends BaseObject { + /** + * @private + */ + autoSearch: boolean; + /** + * @private + */ + width: number; + /** + * @private + */ + height: number; + /** + * @private + */ + scale: number; + /** + * - The texture atlas name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * - The image path of the texture atlas. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集图片路径。 + * @version DragonBones 3.0 + * @language zh_CN + */ + imagePath: string; + /** + * @private + */ + readonly textures: Map; + protected _onClear(): void; + /** + * @private + */ + copyFrom(value: TextureAtlasData): void; + /** + * @private + */ + getTexture(textureName: string): TextureData | null; + } + /** + * @private + */ + abstract class TextureData extends BaseObject { + static createRectangle(): Rectangle; + rotated: boolean; + name: string; + readonly region: Rectangle; + parent: TextureAtlasData; + frame: Rectangle | null; + protected _onClear(): void; + copyFrom(value: TextureData): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The armature proxy interface, the docking engine needs to implement it concretely. + * @see dragonBones.Armature + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 骨架代理接口,对接的引擎需要对其进行具体实现。 + * @see dragonBones.Armature + * @version DragonBones 5.0 + * @language zh_CN + */ + interface IArmatureProxy extends IEventDispatcher { + /** + * - Dispose the instance and the Armature instance. (The Armature instance will return to the object pool) + * @example + *
+         *     removeChild(armatureDisplay);
+         *     armatureDisplay.dispose();
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 释放该实例和骨架。 (骨架会回收到对象池) + * @example + *
+         *     removeChild(armatureDisplay);
+         *     armatureDisplay.dispose();
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + dispose(disposeProxy: boolean): void; + /** + * - The armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly armature: Armature; + /** + * - The animation player. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animation: Animation; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Armature is the core of the skeleton animation system. + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架是骨骼动画系统的核心。 + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + class Armature extends BaseObject implements IAnimatable { + static toString(): string; + private static _onSortSlots; + /** + * - Whether to inherit the animation control of the parent armature. + * True to try to have the child armature play an animation with the same name when the parent armature play the animation. + * @default true + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 是否继承父骨架的动画控制。 + * 如果该值为 true,当父骨架播放动画时,会尝试让子骨架播放同名动画。 + * @default true + * @version DragonBones 4.5 + * @language zh_CN + */ + inheritAnimation: boolean; + /** + * @private + */ + userData: any; + private _slotsDirty; + private _zOrderDirty; + private _flipX; + private _flipY; + private _alpha; + private readonly _bones; + private readonly _slots; + private readonly _actions; + private _animation; + private _proxy; + private _display; + private _replacedTexture; + private _clock; + protected _onClear(): void; + /** + * - Dispose the armature. (Return to the object pool) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 释放骨架。 (回收到对象池) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + dispose(): void; + /** + * @inheritDoc + */ + advanceTime(passedTime: number): void; + /** + * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. + * @param boneName - The bone name. (If not set, all bones will be update) + * @param updateSlot - Whether to update the bone's slots. (Default: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 + * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) + * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + invalidUpdate(boneName?: string | null, updateSlot?: boolean): void; + /** + * - Check whether a specific point is inside a custom bounding box in a slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在某个插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + containsPoint(x: number, y: number): Slot | null; + /** + * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 + * @version DragonBones 5.0 + * @language zh_CN + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): Slot | null; + /** + * - Get a specific bone. + * @param name - The bone name. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼。 + * @param name - 骨骼名称。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBone(name: string): Bone | null; + /** + * - Get a specific bone by the display. + * @param display - The display object. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的骨骼。 + * @param display - 显示对象。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBoneByDisplay(display: any): Bone | null; + /** + * - Get a specific slot. + * @param name - The slot name. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽。 + * @param name - 插槽名称。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlot(name: string): Slot | null; + /** + * - Get a specific slot by the display. + * @param display - The display object. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的插槽。 + * @param display - 显示对象。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlotByDisplay(display: any): Slot | null; + /** + * - Get all bones. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBones(): Array; + /** + * - Get all slots. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的插槽。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlots(): Array; + /** + * - Whether to flip the armature horizontally. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架水平翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + flipX: boolean; + /** + * - Whether to flip the armature vertically. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架垂直翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + flipY: boolean; + /** + * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. + * There is a certain amount of memory overhead to improve performance by caching animation data in memory. + * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. + * When the animation cache is turned on, some features will fail, such as the offset property of bone. + * @example + *
+         *     armature.cacheFrameRate = 24;
+         * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 + * @example + *
+         *     armature.cacheFrameRate = 24;
+         * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language zh_CN + */ + cacheFrameRate: number; + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - The armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly armatureData: ArmatureData; + /** + * - The animation player. + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animation: Animation; + /** + * @pivate + */ + readonly proxy: IArmatureProxy; + /** + * - The EventDispatcher instance of the armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架的 EventDispatcher 实例。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly eventDispatcher: IEventDispatcher; + /** + * - The display container. + * The display of the slot is displayed as the parent. + * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 显示容器实例。 + * 插槽的显示对象都会以此显示容器为父级。 + * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly display: any; + /** + * @private + */ + replacedTexture: any; + /** + * @inheritDoc + */ + clock: WorldClock | null; + /** + * - Get the parent slot which the armature belongs to. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架所属的父插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly parent: Slot | null; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + getDisplay(): any; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The base class of the transform object. + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 变换对象的基类。 + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language zh_CN + */ + abstract class TransformObject extends BaseObject { + protected static readonly _helpMatrix: Matrix; + protected static readonly _helpTransform: Transform; + protected static readonly _helpPoint: Point; + /** + * - A matrix relative to the armature coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly globalTransformMatrix: Matrix; + /** + * - A transform relative to the armature coordinate system. + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的变换。 + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly global: Transform; + /** + * - The offset transform relative to the armature or the parent bone coordinate system. + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架或父骨骼坐标系的偏移变换。 + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly offset: Transform; + /** + * @private + */ + origin: Transform | null; + /** + * @private + */ + userData: any; + protected _globalDirty: boolean; + /** + */ + protected _onClear(): void; + /** + * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, + * some engines do not rely on these attributes to update rendering, such as Egret. + * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 + * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + updateGlobalTransform(): void; + /** + * - The armature to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的骨架。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly armature: Armature; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Bone is one of the most important logical units in the armature animation system, + * and is responsible for the realization of translate, rotation, scaling in the animations. + * A armature can contain multiple bones. + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 + * 一个骨架中可以包含多个骨骼。 + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + class Bone extends TransformObject { + static toString(): string; + /** + * - The offset mode. + * @see #offset + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 偏移模式。 + * @see #offset + * @version DragonBones 5.5 + * @language zh_CN + */ + offsetMode: OffsetMode; + protected _localDirty: boolean; + protected _visible: boolean; + protected _cachedFrameIndex: number; + /** + * @private + */ + protected _parent: Bone | null; + protected _onClear(): void; + protected _updateGlobalTransformMatrix(isCache: boolean): void; + /** + * - Forces the bone to update the transform in the next frame. + * When the bone is not animated or its animation state is finished, the bone will not continue to update, + * and when the skeleton must be updated for some reason, the method needs to be called explicitly. + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制骨骼在下一帧更新变换。 + * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + invalidUpdate(): void; + /** + * - Check whether the bone contains a specific bone. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查该骨骼是否包含特定的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + contains(value: Bone): boolean; + /** + * - The bone data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly boneData: BoneData; + /** + * - The visible of all slots in the bone. + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 此骨骼所有插槽的可见。 + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language zh_CN + */ + visible: boolean; + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly parent: Bone | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class DisplayFrame extends BaseObject { + static toString(): string; + rawDisplayData: DisplayData | null; + displayData: DisplayData | null; + textureData: TextureData | null; + display: any | Armature | null; + readonly deformVertices: Array; + protected _onClear(): void; + updateDeformVertices(): void; + getGeometryData(): GeometryData | null; + getBoundingBox(): BoundingBoxData | null; + getTextureData(): TextureData | null; + } + /** + * - The slot attached to the armature, controls the display status and properties of the display object. + * A bone can contain multiple slots. + * A slot can contain multiple display objects, displaying only one of the display objects at a time, + * but you can toggle the display object into frame animation while the animation is playing. + * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, + * and a custom other display object. + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class Slot extends TransformObject { + /** + * - Displays the animated state or mixed group name controlled by the object, set to null to be controlled by all animation states. + * @default null + * @see dragonBones.AnimationState#displayControl + * @see dragonBones.AnimationState#name + * @see dragonBones.AnimationState#group + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 显示对象受到控制的动画状态或混合组名称,设置为 null 则表示受所有的动画状态控制。 + * @default null + * @see dragonBones.AnimationState#displayControl + * @see dragonBones.AnimationState#name + * @see dragonBones.AnimationState#group + * @version DragonBones 4.5 + * @language zh_CN + */ + displayController: string | null; + protected _displayDataDirty: boolean; + protected _displayDirty: boolean; + protected _geometryDirty: boolean; + protected _textureDirty: boolean; + protected _visibleDirty: boolean; + protected _blendModeDirty: boolean; + protected _zOrderDirty: boolean; + protected _transformDirty: boolean; + protected _visible: boolean; + protected _blendMode: BlendMode; + protected _displayIndex: number; + protected _animationDisplayIndex: number; + protected _cachedFrameIndex: number; + protected readonly _localMatrix: Matrix; + protected _boundingBoxData: BoundingBoxData | null; + protected _textureData: TextureData | null; + protected _rawDisplay: any; + protected _meshDisplay: any; + protected _display: any | null; + protected _childArmature: Armature | null; + /** + * @private + */ + protected _parent: Bone; + protected _onClear(): void; + protected abstract _initDisplay(value: any, isRetain: boolean): void; + protected abstract _disposeDisplay(value: any, isRelease: boolean): void; + protected abstract _onUpdateDisplay(): void; + protected abstract _addDisplay(): void; + protected abstract _replaceDisplay(value: any): void; + protected abstract _removeDisplay(): void; + protected abstract _updateZOrder(): void; + protected abstract _updateBlendMode(): void; + protected abstract _updateColor(): void; + protected abstract _updateFrame(): void; + protected abstract _updateMesh(): void; + protected abstract _updateTransform(): void; + protected abstract _identityTransform(): void; + protected _hasDisplay(display: any): boolean; + protected _updateDisplayData(): void; + protected _updateDisplay(): void; + protected _updateGlobalTransformMatrix(isCache: boolean): void; + /** + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + invalidUpdate(): void; + /** + * @private + */ + updateTransformAndMatrix(): void; + /** + * @private + */ + replaceRawDisplayData(displayData: DisplayData | null, index?: number): void; + /** + * @private + */ + replaceDisplayData(displayData: DisplayData | null, index?: number): void; + /** + * @private + */ + replaceTextureData(textureData: TextureData | null, index?: number): void; + /** + * @private + */ + replaceDisplay(value: any | Armature | null, index?: number): void; + /** + * - Check whether a specific point is inside a custom bounding box in the slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + containsPoint(x: number, y: number): boolean; + /** + * - Check whether a specific segment intersects a custom bounding box for the slot. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] + * @version DragonBones 5.0 + * @language zh_CN + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + /** + * @private + */ + getDisplayFrameAt(index: number): DisplayFrame; + /** + * - The visible of slot's display object. + * @default true + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 插槽的显示对象的可见。 + * @default true + * @version DragonBones 5.6 + * @language zh_CN + */ + visible: boolean; + /** + * @private + */ + displayFrameCount: number; + /** + * - The index of the display object displayed in the display list. + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     slot.displayIndex = 3;
+         *     slot.displayController = "none";
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 此时显示的显示对象在显示列表中的索引。 + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     slot.displayIndex = 3;
+         *     slot.displayController = "none";
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + displayIndex: number; + /** + * - The slot name. + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - Contains a display list of display objects or child armatures. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + * @language zh_CN + */ + displayList: Array; + /** + * - The slot data. + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 插槽数据。 + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly slotData: SlotData; + /** + * - The custom bounding box data for the slot at current time. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 插槽此时的自定义包围盒数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly boundingBoxData: BoundingBoxData | null; + /** + * @private + */ + readonly rawDisplay: any; + /** + * @private + */ + readonly meshDisplay: any; + /** + * - The display object that the slot displays at this time. + * @example + *
+         *     let slot = armature.getSlot("text");
+         *     slot.display = new yourEngine.TextField();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的显示对象。 + * @example + *
+         *     let slot = armature.getSlot("text");
+         *     slot.display = new yourEngine.TextField();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + display: any; + /** + * - The child armature that the slot displayed at current time. + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
+         *     }
+         *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的子骨架。 + * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
+         *     }
+         *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + childArmature: Armature | null; + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly parent: Bone; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + getDisplay(): any; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + setDisplay(value: any): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Play animation interface. (Both Armature and Wordclock implement the interface) + * Any instance that implements the interface can be added to the Worldclock instance and advance time by Worldclock instance uniformly. + * @see dragonBones.WorldClock + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放动画接口。 (Armature 和 WordClock 都实现了该接口) + * 任何实现了此接口的实例都可以添加到 WorldClock 实例中,由 WorldClock 实例统一更新时间。 + * @see dragonBones.WorldClock + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + interface IAnimatable { + /** + * - Advance time. + * @param passedTime - Passed time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 更新时间。 + * @param passedTime - 前进的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + advanceTime(passedTime: number): void; + /** + * - The Wordclock instance to which the current belongs. + * @example + *
+         *     armature.clock = factory.clock; // Add armature to clock.
+         *     armature.clock = null; // Remove armature from clock.
+         * 
+ * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 当前所属的 WordClock 实例。 + * @example + *
+         *     armature.clock = factory.clock; // 将骨架添加到时钟。
+         *     armature.clock = null; // 将骨架从时钟移除。
+         * 
+ * @version DragonBones 5.0 + * @language zh_CN + */ + clock: WorldClock | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + class WorldClock implements IAnimatable { + /** + * - Current time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + time: number; + /** + * - The play speed, used to control animation speed-shift play. + * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度,用于控制动画变速播放。 + * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + private _systemTime; + private readonly _animatebles; + private _clock; + /** + * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. + * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 + * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(time?: number); + /** + * - Advance time for all IAnimatable instances. + * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 为所有的 IAnimatable 实例更新时间。 + * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + advanceTime(passedTime: number): void; + /** + * - Check whether contains a specific instance of IAnimatable. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + contains(value: IAnimatable): boolean; + /** + * - Add IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + add(value: IAnimatable): void; + /** + * - Removes a specified IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + remove(value: IAnimatable): void; + /** + * - Clear all IAnimatable instances. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + clear(): void; + /** + * @inheritDoc + */ + clock: WorldClock | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation player is used to play the animation data and manage the animation states. + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器用来播放动画数据和管理动画状态。 + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + class Animation extends BaseObject { + static toString(): string; + /** + * - The play speed of all animations. [0: Stop, (0~1): Slow, 1: Normal, (1~N): Fast] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有动画的播放速度。 [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * Update bones and slots cachedFrameIndices. + */ + private _animationDirty; + private _inheritTimeScale; + private readonly _animationNames; + private readonly _animationStates; + private readonly _animations; + private readonly _blendStates; + private _armature; + private _animationConfig; + private _lastAnimationState; + protected _onClear(): void; + private _fadeOut; + /** + * - Clear all animations states. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除所有的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + reset(): void; + /** + * - Pause a specific animation state. + * @param animationName - The name of animation state. (If not set, it will pause all animations) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停指定动画状态的播放。 + * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + stop(animationName?: string | null): void; + /** + * - Play animation with a specific animation config. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @param animationConfig - The animation config. + * @returns The playing animation state. + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 通过指定的动画配置来播放动画。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @param animationConfig - 动画配置。 + * @returns 播放的动画状态。 + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + playConfig(animationConfig: AnimationConfig): AnimationState | null; + /** + * - Play a specific animation. + * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) + * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放指定动画。 + * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + play(animationName?: string | null, playTimes?: number): AnimationState | null; + /** + * - Fade in a specific animation. + * @param animationName - The name of animation data. + * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) + * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) + * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) + * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 淡入播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) + * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) + * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + fadeIn(animationName: string, fadeInTime?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode): AnimationState | null; + /** + * - Play a specific animation from the specific time. + * @param animationName - The name of animation data. + * @param time - The start time point of playing. (In seconds) + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定时间开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param time - 播放开始的时间。 (以秒为单位) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByTime(animationName: string, time?: number, playTimes?: number): AnimationState | null; + /** + * - Play a specific animation from the specific frame. + * @param animationName - The name of animation data. + * @param frame - The start frame of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定帧开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param frame - 播放开始的帧数。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByFrame(animationName: string, frame?: number, playTimes?: number): AnimationState | null; + /** + * - Play a specific animation from the specific progress. + * @param animationName - The name of animation data. + * @param progress - The start progress value of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定进度开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param progress - 开始播放的进度。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByProgress(animationName: string, progress?: number, playTimes?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific time. + * @param animationName - The name of animation data. + * @param time - The stop time. (In seconds) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定时间停止指定动画播放 + * @param animationName - 动画数据名称。 + * @param time - 停止的时间。 (以秒为单位) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByTime(animationName: string, time?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific frame. + * @param animationName - The name of animation data. + * @param frame - The stop frame. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定帧停止指定动画的播放 + * @param animationName - 动画数据名称。 + * @param frame - 停止的帧数。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByFrame(animationName: string, frame?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific progress. + * @param animationName - The name of animation data. + * @param progress - The stop progress value. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定的进度停止指定的动画播放。 + * @param animationName - 动画数据名称。 + * @param progress - 停止进度。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByProgress(animationName: string, progress?: number): AnimationState | null; + /** + * - Get a specific animation state. + * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取指定的动画状态。 + * @param animationName - 动画状态名称。 + * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + getState(animationName: string, layer?: number): AnimationState | null; + /** + * - Check whether a specific animation data is included. + * @param animationName - The name of animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含指定的动画数据 + * @param animationName - 动画数据名称。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + hasAnimation(animationName: string): boolean; + /** + * - Get all the animation states. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取所有的动画状态 + * @version DragonBones 5.1 + * @language zh_CN + */ + getStates(): ReadonlyArray; + /** + * - Check whether there is an animation state is playing + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否有动画状态正在播放 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isPlaying: boolean; + /** + * - Check whether all the animation states' playing were finished. + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否所有的动画状态均已播放完毕。 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isCompleted: boolean; + /** + * - The name of the last playing animation state. + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态名称 + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly lastAnimationName: string; + /** + * - The name of all animation data + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有动画数据的名称 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly animationNames: ReadonlyArray; + /** + * - All animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有的动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + animations: Map; + /** + * - An AnimationConfig instance that can be used quickly. + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 一个可以快速使用的动画配置实例。 + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly animationConfig: AnimationConfig; + /** + * - The last playing animation state + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly lastAnimationState: AnimationState | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation state is generated when the animation data is played. + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画状态由播放动画数据时产生。 + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + class AnimationState extends BaseObject { + static toString(): string; + /** + * @private + */ + actionEnabled: boolean; + /** + * @private + */ + additive: boolean; + /** + * - Whether the animation state has control over the display object properties of the slots. + * Sometimes blend a animation state does not want it to control the display object properties of the slots, + * especially if other animation state are controlling the display object properties of the slots. + * @default true + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态是否对插槽的显示对象属性有控制权。 + * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, + * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 + * @default true + * @version DragonBones 5.0 + * @language zh_CN + */ + displayControl: boolean; + /** + * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. + * This property should usually be set to false when blend multiple animation states. + * @default true + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 + * 通常在混合多个动画状态时应该将该属性设置为 false。 + * @default true + * @version DragonBones 5.1 + * @language zh_CN + */ + resetToPose: boolean; + /** + * @private + */ + blendType: AnimationBlendType; + /** + * - The play times. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The blend layer. + * High layer animation state will get the blend weight first. + * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合图层。 + * 图层高的动画状态会优先获取混合权重。 + * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + layer: number; + /** + * - The play speed. + * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. + * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度。 + * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 + * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * @private + */ + parameterX: number; + /** + * @private + */ + parameterY: number; + /** + * @private + */ + positionX: number; + /** + * @private + */ + positionY: number; + /** + * - The auto fade out time when the animation state play completed. + * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态播放完成后的自动淡出时间。 + * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + autoFadeOutTime: number; + /** + * @private + */ + fadeTotalTime: number; + /** + * - The name of the animation state. (Can be different from the name of the animation data) + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态名称。 (可以不同于动画数据) + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + name: string; + /** + * - The blend group name of the animation state. + * This property is typically used to specify the substitution of multiple animation states blend. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合组名称。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + group: string; + private _timelineDirty; + private _weight; + private _fadeTime; + private _time; + private readonly _boneMask; + private readonly _boneTimelines; + private readonly _boneBlendTimelines; + private readonly _slotTimelines; + private readonly _slotBlendTimelines; + private readonly _constraintTimelines; + private readonly _animationTimelines; + private readonly _poseTimelines; + private _animationData; + private _armature; + private _zOrderTimeline; + private _activeChildA; + private _activeChildB; + protected _onClear(): void; + private _updateTimelines; + private _updateBoneAndSlotTimelines; + private _advanceFadeTime; + /** + * - Continue play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 继续播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + play(): void; + /** + * - Stop play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + stop(): void; + /** + * - Fade out the animation state. + * @param fadeOutTime - The fade out time. (In seconds) + * @param pausePlayhead - Whether to pause the animation playing when fade out. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 淡出动画状态。 + * @param fadeOutTime - 淡出时间。 (以秒为单位) + * @param pausePlayhead - 淡出时是否暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + fadeOut(fadeOutTime: number, pausePlayhead?: boolean): void; + /** + * - Check if a specific bone mask is included. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + containsBoneMask(boneName: string): boolean; + /** + * - Add a specific bone mask. + * @param boneName - The bone name. + * @param recursive - Whether or not to add a mask to the bone's sub-bone. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加特定的骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + addBoneMask(boneName: string, recursive?: boolean): void; + /** + * - Remove the mask of a specific bone. + * @param boneName - The bone name. + * @param recursive - Whether to remove the bone's sub-bone mask. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除特定骨骼的遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + removeBoneMask(boneName: string, recursive?: boolean): void; + /** + * - Remove all bone masks. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + removeAllBoneMask(): void; + /** + * @private + */ + addState(animationState: AnimationState, timelineDatas?: TimelineData[] | null): void; + /** + * - Whether the animation state is fading in. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡入。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeIn: boolean; + /** + * - Whether the animation state is fading out. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡出。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeOut: boolean; + /** + * - Whether the animation state is fade completed. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否淡入或淡出完毕。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeComplete: boolean; + /** + * - Whether the animation state is playing. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否正在播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isPlaying: boolean; + /** + * - Whether the animation state is play completed. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否播放完毕。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isCompleted: boolean; + /** + * - The times has been played. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 已经循环播放的次数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly currentPlayTimes: number; + /** + * - The total time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 总播放时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly totalTime: number; + /** + * - The time is currently playing. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前播放的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + currentTime: number; + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + /** + * - The animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + weight: number; + /** + * - 动画数据。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animationData: AnimationData; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The properties of the object carry basic information about an event, + * which are passed as parameter or parameter's parameter to event listeners when an event occurs. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 + * @version DragonBones 4.5 + * @language zh_CN + */ + class EventObject extends BaseObject { + /** + * - Animation start play. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画开始播放。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly START: string; + /** + * - Animation loop play complete once. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画循环播放完成一次。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly LOOP_COMPLETE: string; + /** + * - Animation play complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画播放完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly COMPLETE: string; + /** + * - Animation fade in start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_IN: string; + /** + * - Animation fade in complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_IN_COMPLETE: string; + /** + * - Animation fade out start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_OUT: string; + /** + * - Animation fade out complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_OUT_COMPLETE: string; + /** + * - Animation frame event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FRAME_EVENT: string; + /** + * - Animation frame sound event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧声音事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly SOUND_EVENT: string; + static toString(): string; + /** + * - If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 如果是帧事件,此值用来描述该事件在动画时间轴中所处的时间。(以秒为单位) + * @version DragonBones 4.5 + * @language zh_CN + */ + time: number; + /** + * - The event type。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件类型。 + * @version DragonBones 4.5 + * @language zh_CN + */ + type: EventStringType; + /** + * - The event name. (The frame event name or the frame sound name) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件名称。 (帧事件的名称或帧声音的名称) + * @version DragonBones 4.5 + * @language zh_CN + */ + name: string; + /** + * - The armature that dispatch the event. + * @see dragonBones.Armature + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的骨架。 + * @see dragonBones.Armature + * @version DragonBones 4.5 + * @language zh_CN + */ + armature: Armature; + /** + * - The bone that dispatch the event. + * @see dragonBones.Bone + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 4.5 + * @language zh_CN + */ + bone: Bone | null; + /** + * - The slot that dispatch the event. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + slot: Slot | null; + /** + * - The animation state that dispatch the event. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + animationState: AnimationState; + /** + * @private + */ + actionData: ActionData | null; + /** + * @private + */ + /** + * - The custom data. + * @see dragonBones.CustomData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义数据。 + * @see dragonBones.CustomData + * @version DragonBones 5.0 + * @language zh_CN + */ + data: UserData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + type EventStringType = string | "start" | "loopComplete" | "complete" | "fadeIn" | "fadeInComplete" | "fadeOut" | "fadeOutComplete" | "frameEvent" | "soundEvent"; + /** + * - The event dispatcher interface. + * Dragonbones event dispatch usually relies on docking engine to implement, which defines the event method to be implemented when docking the engine. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件派发接口。 + * DragonBones 的事件派发通常依赖于对接的引擎来实现,该接口定义了对接引擎时需要实现的事件方法。 + * @version DragonBones 4.5 + * @language zh_CN + */ + interface IEventDispatcher { + /** + * - Checks whether the object has any listeners registered for a specific type of event。 + * @param type - Event type. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 检查是否为特定的事件类型注册了任何侦听器。 + * @param type - 事件类型。 + * @version DragonBones 4.5 + * @language zh_CN + */ + hasDBEventListener(type: EventStringType): boolean; + /** + * - Dispatches an event into the event flow. + * @param type - Event type. + * @param eventObject - Event object. + * @see dragonBones.EventObject + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分派特定的事件到事件流中。 + * @param type - 事件类型。 + * @param eventObject - 事件数据。 + * @see dragonBones.EventObject + * @version DragonBones 4.5 + * @language zh_CN + */ + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + /** + * - Add an event listener object so that the listener receives notification of an event. + * @param type - Event type. + * @param listener - Event listener. + * @param thisObject - The listener function's "this". + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 添加特定事件类型的事件侦听器,以使侦听器能够接收事件通知。 + * @param type - 事件类型。 + * @param listener - 事件侦听器。 + * @param thisObject - 侦听函数绑定的 this 对象。 + * @version DragonBones 4.5 + * @language zh_CN + */ + addDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; + /** + * - Removes a listener from the object. + * @param type - Event type. + * @param listener - Event listener. + * @param thisObject - The listener function's "this". + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 删除特定事件类型的侦听器。 + * @param type - 事件类型。 + * @param listener - 事件侦听器。 + * @param thisObject - 侦听函数绑定的 this 对象。 + * @version DragonBones 4.5 + * @language zh_CN + */ + removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + abstract class DataParser { + protected static readonly DATA_VERSION_2_3: string; + protected static readonly DATA_VERSION_3_0: string; + protected static readonly DATA_VERSION_4_0: string; + protected static readonly DATA_VERSION_4_5: string; + protected static readonly DATA_VERSION_5_0: string; + protected static readonly DATA_VERSION_5_5: string; + protected static readonly DATA_VERSION_5_6: string; + protected static readonly DATA_VERSION: string; + protected static readonly DATA_VERSIONS: Array; + protected static readonly TEXTURE_ATLAS: string; + protected static readonly SUB_TEXTURE: string; + protected static readonly FORMAT: string; + protected static readonly IMAGE_PATH: string; + protected static readonly WIDTH: string; + protected static readonly HEIGHT: string; + protected static readonly ROTATED: string; + protected static readonly FRAME_X: string; + protected static readonly FRAME_Y: string; + protected static readonly FRAME_WIDTH: string; + protected static readonly FRAME_HEIGHT: string; + protected static readonly DRADON_BONES: string; + protected static readonly USER_DATA: string; + protected static readonly ARMATURE: string; + protected static readonly CANVAS: string; + protected static readonly BONE: string; + protected static readonly SURFACE: string; + protected static readonly SLOT: string; + protected static readonly CONSTRAINT: string; + protected static readonly SKIN: string; + protected static readonly DISPLAY: string; + protected static readonly FRAME: string; + protected static readonly IK: string; + protected static readonly PATH_CONSTRAINT: string; + protected static readonly ANIMATION: string; + protected static readonly TIMELINE: string; + protected static readonly FFD: string; + protected static readonly TRANSLATE_FRAME: string; + protected static readonly ROTATE_FRAME: string; + protected static readonly SCALE_FRAME: string; + protected static readonly DISPLAY_FRAME: string; + protected static readonly COLOR_FRAME: string; + protected static readonly DEFAULT_ACTIONS: string; + protected static readonly ACTIONS: string; + protected static readonly EVENTS: string; + protected static readonly INTS: string; + protected static readonly FLOATS: string; + protected static readonly STRINGS: string; + protected static readonly TRANSFORM: string; + protected static readonly PIVOT: string; + protected static readonly AABB: string; + protected static readonly COLOR: string; + protected static readonly VERSION: string; + protected static readonly COMPATIBLE_VERSION: string; + protected static readonly FRAME_RATE: string; + protected static readonly TYPE: string; + protected static readonly SUB_TYPE: string; + protected static readonly NAME: string; + protected static readonly PARENT: string; + protected static readonly TARGET: string; + protected static readonly STAGE: string; + protected static readonly SHARE: string; + protected static readonly PATH: string; + protected static readonly LENGTH: string; + protected static readonly DISPLAY_INDEX: string; + protected static readonly Z_ORDER: string; + protected static readonly Z_INDEX: string; + protected static readonly BLEND_MODE: string; + protected static readonly INHERIT_TRANSLATION: string; + protected static readonly INHERIT_ROTATION: string; + protected static readonly INHERIT_SCALE: string; + protected static readonly INHERIT_REFLECTION: string; + protected static readonly INHERIT_ANIMATION: string; + protected static readonly INHERIT_DEFORM: string; + protected static readonly SEGMENT_X: string; + protected static readonly SEGMENT_Y: string; + protected static readonly BEND_POSITIVE: string; + protected static readonly CHAIN: string; + protected static readonly WEIGHT: string; + protected static readonly BLEND_TYPE: string; + protected static readonly FADE_IN_TIME: string; + protected static readonly PLAY_TIMES: string; + protected static readonly SCALE: string; + protected static readonly OFFSET: string; + protected static readonly POSITION: string; + protected static readonly DURATION: string; + protected static readonly TWEEN_EASING: string; + protected static readonly TWEEN_ROTATE: string; + protected static readonly TWEEN_SCALE: string; + protected static readonly CLOCK_WISE: string; + protected static readonly CURVE: string; + protected static readonly SOUND: string; + protected static readonly EVENT: string; + protected static readonly ACTION: string; + protected static readonly X: string; + protected static readonly Y: string; + protected static readonly SKEW_X: string; + protected static readonly SKEW_Y: string; + protected static readonly SCALE_X: string; + protected static readonly SCALE_Y: string; + protected static readonly VALUE: string; + protected static readonly ROTATE: string; + protected static readonly SKEW: string; + protected static readonly ALPHA: string; + protected static readonly ALPHA_OFFSET: string; + protected static readonly RED_OFFSET: string; + protected static readonly GREEN_OFFSET: string; + protected static readonly BLUE_OFFSET: string; + protected static readonly ALPHA_MULTIPLIER: string; + protected static readonly RED_MULTIPLIER: string; + protected static readonly GREEN_MULTIPLIER: string; + protected static readonly BLUE_MULTIPLIER: string; + protected static readonly UVS: string; + protected static readonly VERTICES: string; + protected static readonly TRIANGLES: string; + protected static readonly WEIGHTS: string; + protected static readonly SLOT_POSE: string; + protected static readonly BONE_POSE: string; + protected static readonly BONES: string; + protected static readonly POSITION_MODE: string; + protected static readonly SPACING_MODE: string; + protected static readonly ROTATE_MODE: string; + protected static readonly SPACING: string; + protected static readonly ROTATE_OFFSET: string; + protected static readonly ROTATE_MIX: string; + protected static readonly TRANSLATE_MIX: string; + protected static readonly TARGET_DISPLAY: string; + protected static readonly CLOSED: string; + protected static readonly CONSTANT_SPEED: string; + protected static readonly VERTEX_COUNT: string; + protected static readonly LENGTHS: string; + protected static readonly GOTO_AND_PLAY: string; + protected static readonly DEFAULT_NAME: string; + protected static _getArmatureType(value: string): ArmatureType; + protected static _getBoneType(value: string): BoneType; + protected static _getPositionMode(value: string): PositionMode; + protected static _getSpacingMode(value: string): SpacingMode; + protected static _getRotateMode(value: string): RotateMode; + protected static _getDisplayType(value: string): DisplayType; + protected static _getBoundingBoxType(value: string): BoundingBoxType; + protected static _getBlendMode(value: string): BlendMode; + protected static _getAnimationBlendType(value: string): AnimationBlendType; + protected static _getActionType(value: string): ActionType; + abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null; + abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + const enum FrameValueType { + Step = 0, + Int = 1, + Float = 2 + } + /** + * @private + */ + class ObjectDataParser extends DataParser { + protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean; + protected static _getNumber(rawData: any, key: string, defaultValue: number): number; + protected static _getString(rawData: any, key: string, defaultValue: string): string; + protected _rawTextureAtlasIndex: number; + protected readonly _rawBones: Array; + protected _data: DragonBonesData; + protected _armature: ArmatureData; + protected _bone: BoneData; + protected _geometry: GeometryData; + protected _slot: SlotData; + protected _skin: SkinData; + protected _mesh: MeshDisplayData; + protected _animation: AnimationData; + protected _timeline: TimelineData; + protected _rawTextureAtlases: Array | null; + private _frameValueType; + private _defaultColorOffset; + private _prevClockwise; + private _prevRotation; + private _frameDefaultValue; + private _frameValueScale; + private readonly _helpMatrixA; + private readonly _helpMatrixB; + private readonly _helpTransform; + private readonly _helpColorTransform; + private readonly _helpPoint; + private readonly _helpArray; + private readonly _intArray; + private readonly _floatArray; + private readonly _frameIntArray; + private readonly _frameFloatArray; + private readonly _frameArray; + private readonly _timelineArray; + private readonly _colorArray; + private readonly _cacheRawMeshes; + private readonly _cacheMeshes; + private readonly _actionFrames; + private readonly _weightSlotPose; + private readonly _weightBonePoses; + private readonly _cacheBones; + private readonly _slotChildActions; + private _getCurvePoint; + private _samplingEasingCurve; + private _parseActionDataInFrame; + private _mergeActionFrame; + protected _parseArmature(rawData: any, scale: number): ArmatureData; + protected _parseBone(rawData: any): BoneData; + protected _parseIKConstraint(rawData: any): ConstraintData | null; + protected _parsePathConstraint(rawData: any): ConstraintData | null; + protected _parseSlot(rawData: any, zOrder: number): SlotData; + protected _parseSkin(rawData: any): SkinData; + protected _parseDisplay(rawData: any): DisplayData | null; + protected _parsePath(rawData: any, display: PathDisplayData): void; + protected _parsePivot(rawData: any, display: ImageDisplayData): void; + protected _parseMesh(rawData: any, mesh: MeshDisplayData): void; + protected _parseBoundingBox(rawData: any): BoundingBoxData | null; + protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData; + protected _parseAnimation(rawData: any): AnimationData; + protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, timelineType: TimelineType, frameValueType: FrameValueType, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number, timeline?: TimelineData | null): TimelineData | null; + protected _parseBoneTimeline(rawData: any): void; + protected _parseSlotTimeline(rawData: any): void; + protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSingleValueFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseDoubleValueFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number; + protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotDeformFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array; + protected _parseDeformFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseTransform(rawData: any, transform: Transform, scale: number): void; + protected _parseColorTransform(rawData: any, color: ColorTransform): void; + protected _parseGeometry(rawData: any, geometry: GeometryData): void; + protected _parseArray(rawData: any): void; + protected _modifyArray(): void; + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null; + parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale?: number): boolean; + private static _objectDataParserInstance; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + static getInstance(): ObjectDataParser; + } + /** + * @private + */ + class ActionFrame { + frameStart: number; + readonly actions: Array; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class BinaryDataParser extends ObjectDataParser { + private _binaryOffset; + private _binary; + private _intArrayBuffer; + private _frameArrayBuffer; + private _timelineArrayBuffer; + private _inRange; + private _decodeUTF8; + private _parseBinaryTimeline; + protected _parseAnimation(rawData: any): AnimationData; + protected _parseGeometry(rawData: any, geometry: GeometryData): void; + protected _parseArray(rawData: any): void; + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null; + private static _binaryDataParserInstance; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + static getInstance(): BinaryDataParser; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) + * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. + * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) + * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 + * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class BaseFactory { + protected static _objectParser: ObjectDataParser; + protected static _binaryParser: BinaryDataParser; + /** + * @private + */ + autoSearch: boolean; + protected readonly _dragonBonesDataMap: Map; + protected readonly _textureAtlasDataMap: Map>; + protected _dragonBones: DragonBones; + protected _dataParser: DataParser; + /** + * - Create a factory instance. (typically only one global factory instance is required) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(dataParser?: DataParser | null); + protected _isSupportMesh(): boolean; + protected _getTextureData(textureAtlasName: string, textureName: string): TextureData | null; + protected _fillBuildArmaturePackage(dataPackage: BuildArmaturePackage, dragonBonesName: string, armatureName: string, skinName: string, textureAtlasName: string): boolean; + protected _buildBones(dataPackage: BuildArmaturePackage, armature: Armature): void; + /** + * @private + */ + protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void; + protected _buildConstraints(dataPackage: BuildArmaturePackage, armature: Armature): void; + protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, _slot: Slot, displayData: ArmatureDisplayData): Armature | null; + protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, slot: Slot): any; + protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData; + protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature; + protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot; + /** + * - Parse the raw data to a DragonBonesData instance and cache it to the factory. + * @param rawData - The raw data. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for all armatures. (Default: 1.0) + * @returns DragonBonesData instance + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 + * @param rawData - 原始数据。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) + * @returns DragonBonesData 实例 + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language zh_CN + */ + parseDragonBonesData(rawData: any, name?: string | null, scale?: number): DragonBonesData | null; + /** + * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. + * @param rawData - The raw texture atlas data. + * @param textureAtlas - The texture atlas object. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for the map set. (Default: 1.0) + * @returns TextureAtlasData instance + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 + * @param rawData - 原始贴图集数据。 + * @param textureAtlas - 贴图集对象。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) + * @returns TextureAtlasData 实例 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language zh_CN + */ + parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData; + /** + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN + */ + updateTextureAtlases(textureAtlases: Array, name: string): void; + /** + * - Get a specific DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @returns DragonBonesData instance + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 DragonBonesData 实例。 + * @param name - DragonBonesData 实例的缓存名称。 + * @returns DragonBonesData 实例 + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + getDragonBonesData(name: string): DragonBonesData | null; + /** + * - Cache a DragonBonesData instance to the factory. + * @param data - The DragonBonesData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 DragonBonesData 实例缓存到工厂中。 + * @param data - DragonBonesData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + addDragonBonesData(data: DragonBonesData, name?: string | null): void; + /** + * - Remove a DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @param disposeData - Whether to dispose data. (Default: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 DragonBonesData 实例。 + * @param name - DragonBonesData 实例缓存名称。 + * @param disposeData - 是否释放数据。 (默认: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + removeDragonBonesData(name: string, disposeData?: boolean): void; + /** + * - Get a list of specific TextureAtlasData instances. + * @param name - The TextureAtlasData cahce name. + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 TextureAtlasData 实例列表。 + * @param name - TextureAtlasData 实例缓存名称。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + getTextureAtlasData(name: string): Array | null; + /** + * - Cache a TextureAtlasData instance to the factory. + * @param data - The TextureAtlasData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 TextureAtlasData 实例缓存到工厂中。 + * @param data - TextureAtlasData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + addTextureAtlasData(data: TextureAtlasData, name?: string | null): void; + /** + * - Remove a TextureAtlasData instance. + * @param name - The TextureAtlasData instance cache name. + * @param disposeData - Whether to dispose data. + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 TextureAtlasData 实例。 + * @param name - TextureAtlasData 实例的缓存名称。 + * @param disposeData - 是否释放数据。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + removeTextureAtlasData(name: string, disposeData?: boolean): void; + /** + * - Get a specific armature data. + * @param name - The armature data name. + * @param dragonBonesName - The cached name for DragonbonesData instance. + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param name - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language zh_CN + */ + getArmatureData(name: string, dragonBonesName?: string): ArmatureData | null; + /** + * - Clear all cached DragonBonesData instances and TextureAtlasData instances. + * @param disposeData - Whether to dispose data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 + * @param disposeData - 是否释放数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + clear(disposeData?: boolean): void; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. + * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature. + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 + * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架。 + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + buildArmature(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): Armature | null; + /** + * @private + */ + replaceDisplay(slot: Slot, displayData: DisplayData | null, displayIndex?: number): void; + /** + * - Replaces the current display data for a particular slot with a specific display data. + * Specify display data with "dragonBonesName/armatureName/slotName/displayName". + * @param dragonBonesName - The DragonBonesData instance cache name. + * @param armatureName - The armature data name. + * @param slotName - The slot data name. + * @param displayName - The display data name. + * @param slot - The slot. + * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 + * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @param armatureName - 骨架数据名称。 + * @param slotName - 插槽数据名称。 + * @param displayName - 显示对象数据名称。 + * @param slot - 插槽。 + * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + replaceSlotDisplay(dragonBonesName: string, armatureName: string, slotName: string, displayName: string, slot: Slot, displayIndex?: number): boolean; + /** + * @private + */ + replaceSlotDisplayList(dragonBonesName: string | null, armatureName: string, slotName: string, slot: Slot): boolean; + /** + * - Share specific skin data with specific armature. + * @param armature - The armature. + * @param skin - The skin data. + * @param isOverride - Whether it completely override the original skin. (Default: false) + * @param exclude - A list of slot names that do not need to be replace. + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 将特定的皮肤数据共享给特定的骨架使用。 + * @param armature - 骨架。 + * @param skin - 皮肤数据。 + * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) + * @param exclude - 不需要被替换的插槽名称列表。 + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language zh_CN + */ + replaceSkin(armature: Armature, skin: SkinData, isOverride?: boolean, exclude?: Array | null): boolean; + /** + * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. + * This enables you to make a armature template so that other armature without animations can share it's animations. + * @param armature - The armtaure. + * @param armatureData - The armature data. + * @param isOverride - Whether to completely overwrite the original animation. (Default: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 + * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 + * @param armature - 骨架。 + * @param armatureData - 骨架数据。 + * @param isOverride - 是否完全覆盖原来的动画。(默认: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language zh_CN + */ + replaceAnimation(armature: Armature, armatureData: ArmatureData, isOverride?: boolean): boolean; + /** + * @private + */ + getAllDragonBonesData(): Map; + /** + * @private + */ + getAllTextureAtlasData(): Map>; + /** + * - An Worldclock instance updated by engine. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 由引擎驱动的 WorldClock 实例。 + * @version DragonBones 5.7 + * @language zh_CN + */ + readonly clock: WorldClock; + /** + * @private + */ + readonly dragonBones: DragonBones; + } + /** + * @private + */ + class BuildArmaturePackage { + dataName: string; + textureAtlasName: string; + data: DragonBonesData; + armature: ArmatureData; + skin: SkinData | null; + } +} +declare namespace dragonBones.phaser.util { + class EventDispatcher extends Phaser.Events.EventEmitter implements IEventDispatcher { + hasDBEventListener(type: EventStringType): boolean; + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + addDBEventListener(type: EventStringType, listener: (e: EventObject) => void, thisObject?: any): void; + removeDBEventListener(type: EventStringType, listener: (e: EventObject) => void, thisObject?: any): void; + } +} +declare namespace dragonBones.phaser.util { + const Skew: { + getSkewX(): number; + setSkewX(v: number): void; + getSkewY(): number; + setSkewY(v: number): void; + setSkew(sx: number, sy?: number): void; + }; + const extendSkew: (clazz: any) => void; +} +declare namespace dragonBones.phaser.util { + class TransformMatrix extends Phaser.GameObjects.Components.TransformMatrix { + constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number); + decomposeMatrix(): any; + applyITRSC(x: number, y: number, rotation: number, scaleX: number, scaleY: number, skewX: number, skewY: number): this; + readonly skewX: number; + readonly skewY: number; + } +} +declare namespace dragonBones.phaser.display { + class DisplayContainer extends Phaser.GameObjects.Container { + private _skewX; + private _skewY; + private tempTransformMatrix; + constructor(scene: Phaser.Scene, x?: number, y?: number, children?: Phaser.GameObjects.GameObject[]); + pointToContainer(source: Phaser.Math.Vector2 | Phaser.Geom.Point | { + x?: number; + y?: number; + }, output?: Phaser.Math.Vector2 | Phaser.Geom.Point | { + x?: number; + y?: number; + }): Phaser.Math.Vector2 | Phaser.Geom.Point | { + x?: number; + y?: number; + }; + skewX: number; + skewY: number; + setSkew(sx: number, sy?: number): this; + } +} +declare namespace dragonBones.phaser.display { + class ArmatureDisplay extends DisplayContainer implements IArmatureProxy { + debugDraw: boolean; + private _armature; + constructor(scene: Phaser.Scene); + dbInit(armature: Armature): void; + dbClear(): void; + dbUpdate(): void; + dispose(disposeProxy: boolean): void; + destroy(): void; + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + hasDBEventListener(type: EventStringType): boolean; + addDBEventListener(type: EventStringType, listener: (event: EventObject) => void, scope?: any): void; + removeDBEventListener(type: EventStringType, listener: (event: EventObject) => void, scope?: any): void; + readonly armature: Armature; + readonly animation: Animation; + } +} +declare namespace dragonBones.phaser.display { + class SlotImage extends Phaser.GameObjects.Image { + constructor(scene: Phaser.Scene, x: number, y: number, texture?: string, frame?: string | number); + } +} +declare namespace dragonBones.phaser.display { + class SlotSprite extends Phaser.GameObjects.Sprite { + constructor(scene: Phaser.Scene, x: number, y: number, texture?: string, frame?: string | number); + } +} +declare namespace dragonBones.phaser.display { + class Slot extends dragonBones.Slot { + static toString(): string; + private _textureScale; + private _renderDisplay; + protected _onClear(): void; + protected _initDisplay(rawDisplay: any, isRetain: boolean): void; + protected _disposeDisplay(prevDisplay: any, isRelease: boolean): void; + protected _onUpdateDisplay(): void; + protected _addDisplay(): void; + protected _replaceDisplay(prevDisplay: any): void; + protected _removeDisplay(): void; + protected _updateZOrder(): void; + _updateVisible(): void; + protected _updateBlendMode(): void; + protected _updateColor(): void; + protected _updateFrame(): void; + protected _updateMesh(): void; + protected _updateTransform(): void; + protected _identityTransform(): void; + } +} +declare namespace dragonBones.phaser.display { + class TextureAtlasData extends dragonBones.TextureAtlasData { + static toString(): string; + private _renderTexture; + protected _onClear(): void; + createTexture(): TextureData; + renderTexture: Phaser.Textures.Texture; + } + class TextureData extends dragonBones.TextureData { + static toString(): string; + renderTexture: Phaser.Textures.Frame; + protected _onClear(): void; + } +} +declare namespace dragonBones.phaser.pipeline { + class TextureTintPipeline extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline { + private _tempMatrix1; + private _tempMatrix2; + private _tempMatrix3; + constructor(config: any); + batchSprite(sprite: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + } +} +declare namespace dragonBones.phaser.plugin { + interface FileTypeClass { + new (...args: any[]): Phaser.Loader.File; + } + const FileTypes: { + IMAGE: string; + JSON: string; + BINARY: string; + map: { + imageFile: typeof Phaser.Loader.FileTypes.ImageFile; + jsonFile: typeof Phaser.Loader.FileTypes.JSONFile; + binaryFile: typeof Phaser.Loader.FileTypes.BinaryFile; + }; + setType: (type: string, clazz: FileTypeClass) => void; + getType: (type: string) => FileTypeClass; + }; +} +declare namespace dragonBones.phaser.plugin { + class DragonBonesFile extends Phaser.Loader.MultiFile { + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | object, textureURL?: string, atlasURL?: string, boneURL?: string, textureXhrSettings?: XHRSettingsObject, atlasXhrSettings?: XHRSettingsObject, boneXhrSettings?: XHRSettingsObject); + addToCache(): void; + } +} +declare namespace dragonBones.phaser.plugin { + class DragonBonesScenePlugin extends Phaser.Plugins.ScenePlugin { + protected _dbInst: dragonBones.DragonBones; + protected _factory: Factory; + constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager); + createArmature(armature: string, dragonBones?: string, skinName?: string, atlasTextureName?: string, textureScale?: number): display.ArmatureDisplay; + readonly factory: Factory; + createSlotDisplayPlaceholder(): display.SlotImage | display.SlotSprite; + boot(): void; + start(): void; + private update; + shutdown(): void; + destroy(): void; + } +} +declare namespace dragonBones.phaser { + class Factory extends BaseFactory { + protected _scene: Phaser.Scene; + protected _dragonBones: DragonBones; + constructor(dragonBones: DragonBones, scene: Phaser.Scene, dataParser?: DataParser); + protected _isSupportMesh(): boolean; + protected _buildTextureAtlasData(textureAtlasData: display.TextureAtlasData, textureAtlas: Phaser.Textures.Texture): TextureAtlasData; + protected _buildArmature(dataPackage: BuildArmaturePackage): Armature; + protected _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot; + buildArmatureDisplay(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string, textureScale?: number): display.ArmatureDisplay; + } +} diff --git a/Phaser/3.x/out/dragonBones.js b/Phaser/3.x/out/dragonBones.js new file mode 100644 index 00000000..73c3a699 --- /dev/null +++ b/Phaser/3.x/out/dragonBones.js @@ -0,0 +1,16088 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DragonBones = /** @class */ (function () { + function DragonBones(eventManager) { + this._clock = new dragonBones.WorldClock(); + this._events = []; + this._objects = []; + this._eventManager = null; + this._eventManager = eventManager; + console.info("DragonBones: " + DragonBones.VERSION + "\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/"); + } + DragonBones.prototype.advanceTime = function (passedTime) { + if (this._objects.length > 0) { + for (var _i = 0, _a = this._objects; _i < _a.length; _i++) { + var object = _a[_i]; + object.returnToPool(); + } + this._objects.length = 0; + } + this._clock.advanceTime(passedTime); + if (this._events.length > 0) { + for (var i = 0; i < this._events.length; ++i) { + var eventObject = this._events[i]; + var armature = eventObject.armature; + if (armature._armatureData !== null) { // May be armature disposed before advanceTime. + armature.eventDispatcher.dispatchDBEvent(eventObject.type, eventObject); + if (eventObject.type === dragonBones.EventObject.SOUND_EVENT) { + this._eventManager.dispatchDBEvent(eventObject.type, eventObject); + } + } + this.bufferObject(eventObject); + } + this._events.length = 0; + } + }; + DragonBones.prototype.bufferEvent = function (value) { + if (this._events.indexOf(value) < 0) { + this._events.push(value); + } + }; + DragonBones.prototype.bufferObject = function (object) { + if (this._objects.indexOf(object) < 0) { + this._objects.push(object); + } + }; + Object.defineProperty(DragonBones.prototype, "clock", { + get: function () { + return this._clock; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragonBones.prototype, "eventManager", { + get: function () { + return this._eventManager; + }, + enumerable: true, + configurable: true + }); + DragonBones.VERSION = "5.7.000"; + DragonBones.yDown = true; + DragonBones.debug = false; + DragonBones.debugDraw = false; + return DragonBones; + }()); + dragonBones.DragonBones = DragonBones; +})(dragonBones || (dragonBones = {})); +// +if (!console.warn) { + console.warn = function () { }; +} +if (!console.assert) { + console.assert = function () { }; +} +// +if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; +} +// Weixin can not support typescript extends. +var __extends = function (t, e) { + function r() { + this.constructor = t; + } + for (var i in e) { + if (e.hasOwnProperty(i)) { + t[i] = e[i]; + } + } + r.prototype = e.prototype, t.prototype = new r(); +}; +// +if (typeof global === "undefined" && typeof window !== "undefined") { + var global = window; +} +if (typeof exports === "object" && typeof module === "object") { + module.exports = dragonBones; +} +else if (typeof define === "function" && define["amd"]) { + define(["dragonBones"], function () { return dragonBones; }); +} +else if (typeof exports === "object") { + exports = dragonBones; +} +else if (typeof global !== "undefined") { + global.dragonBones = dragonBones; +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The BaseObject is the base class for all objects in the DragonBones framework. + * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 基础对象,通常 DragonBones 的对象都继承自该类。 + * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。 + * @version DragonBones 4.5 + * @language zh_CN + */ + var BaseObject = /** @class */ (function () { + function BaseObject() { + /** + * - A unique identification number assigned to the object. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分配给此实例的唯一标识号。 + * @version DragonBones 4.5 + * @language zh_CN + */ + this.hashCode = BaseObject._hashCode++; + this._isInPool = false; + } + BaseObject._returnObject = function (object) { + var classType = String(object.constructor); + var maxCount = classType in BaseObject._maxCountMap ? BaseObject._maxCountMap[classType] : BaseObject._defaultMaxCount; + var pool = BaseObject._poolsMap[classType] = BaseObject._poolsMap[classType] || []; + if (pool.length < maxCount) { + if (!object._isInPool) { + object._isInPool = true; + pool.push(object); + } + else { + console.warn("The object is already in the pool."); + } + } + else { + } + }; + BaseObject.toString = function () { + throw new Error(); + }; + /** + * - Set the maximum cache count of the specify object pool. + * @param objectConstructor - The specify class. (Set all object pools max cache count if not set) + * @param maxCount - Max count. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 设置特定对象池的最大缓存数量。 + * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量) + * @param maxCount - 最大缓存数量。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.setMaxCount = function (objectConstructor, maxCount) { + if (maxCount < 0 || maxCount !== maxCount) { // isNaN + maxCount = 0; + } + if (objectConstructor !== null) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > maxCount) { + pool.length = maxCount; + } + BaseObject._maxCountMap[classType] = maxCount; + } + else { + BaseObject._defaultMaxCount = maxCount; + for (var classType in BaseObject._poolsMap) { + var pool = BaseObject._poolsMap[classType]; + if (pool.length > maxCount) { + pool.length = maxCount; + } + if (classType in BaseObject._maxCountMap) { + BaseObject._maxCountMap[classType] = maxCount; + } + } + } + }; + /** + * - Clear the cached instances of a specify object pool. + * @param objectConstructor - Specify class. (Clear all cached instances if not set) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除特定对象池的缓存实例。 + * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例) + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.clearPool = function (objectConstructor) { + if (objectConstructor === void 0) { objectConstructor = null; } + if (objectConstructor !== null) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > 0) { + pool.length = 0; + } + } + else { + for (var k in BaseObject._poolsMap) { + var pool = BaseObject._poolsMap[k]; + pool.length = 0; + } + } + }; + /** + * - Get an instance of the specify class from object pool. + * @param objectConstructor - The specify class. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从对象池中获取特定类的实例。 + * @param objectConstructor - 特定的类。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.borrowObject = function (objectConstructor) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > 0) { + var object_1 = pool.pop(); + object_1._isInPool = false; + return object_1; + } + var object = new objectConstructor(); + object._onClear(); + return object; + }; + /** + * - Clear the object and return it back to object pool。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除该实例的所有数据并将其返还对象池。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.prototype.returnToPool = function () { + this._onClear(); + BaseObject._returnObject(this); + }; + BaseObject._hashCode = 0; + BaseObject._defaultMaxCount = 3000; + BaseObject._maxCountMap = {}; + BaseObject._poolsMap = {}; + return BaseObject; + }()); + dragonBones.BaseObject = BaseObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - 2D Transform matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 转换矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Matrix = /** @class */ (function () { + /** + * @private + */ + function Matrix(a, b, c, d, tx, ty) { + if (a === void 0) { a = 1.0; } + if (b === void 0) { b = 0.0; } + if (c === void 0) { c = 0.0; } + if (d === void 0) { d = 1.0; } + if (tx === void 0) { tx = 0.0; } + if (ty === void 0) { ty = 0.0; } + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.tx = tx; + this.ty = ty; + } + Matrix.prototype.toString = function () { + return "[object dragonBones.Matrix] a:" + this.a + " b:" + this.b + " c:" + this.c + " d:" + this.d + " tx:" + this.tx + " ty:" + this.ty; + }; + /** + * @private + */ + Matrix.prototype.copyFrom = function (value) { + this.a = value.a; + this.b = value.b; + this.c = value.c; + this.d = value.d; + this.tx = value.tx; + this.ty = value.ty; + return this; + }; + /** + * @private + */ + Matrix.prototype.copyFromArray = function (value, offset) { + if (offset === void 0) { offset = 0; } + this.a = value[offset]; + this.b = value[offset + 1]; + this.c = value[offset + 2]; + this.d = value[offset + 3]; + this.tx = value[offset + 4]; + this.ty = value[offset + 5]; + return this; + }; + /** + * - Convert to unit matrix. + * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为单位矩阵。 + * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.identity = function () { + this.a = this.d = 1.0; + this.b = this.c = 0.0; + this.tx = this.ty = 0.0; + return this; + }; + /** + * - Multiplies the current matrix with another matrix. + * @param value - The matrix that needs to be multiplied. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将当前矩阵与另一个矩阵相乘。 + * @param value - 需要相乘的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.concat = function (value) { + var aA = this.a * value.a; + var bA = 0.0; + var cA = 0.0; + var dA = this.d * value.d; + var txA = this.tx * value.a + value.tx; + var tyA = this.ty * value.d + value.ty; + if (this.b !== 0.0 || this.c !== 0.0) { + aA += this.b * value.c; + bA += this.b * value.d; + cA += this.c * value.a; + dA += this.c * value.b; + } + if (value.b !== 0.0 || value.c !== 0.0) { + bA += this.a * value.b; + cA += this.d * value.c; + txA += this.ty * value.c; + tyA += this.tx * value.b; + } + this.a = aA; + this.b = bA; + this.c = cA; + this.d = dA; + this.tx = txA; + this.ty = tyA; + return this; + }; + /** + * - Convert to inverse matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为逆矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.invert = function () { + var aA = this.a; + var bA = this.b; + var cA = this.c; + var dA = this.d; + var txA = this.tx; + var tyA = this.ty; + if (bA === 0.0 && cA === 0.0) { + this.b = this.c = 0.0; + if (aA === 0.0 || dA === 0.0) { + this.a = this.b = this.tx = this.ty = 0.0; + } + else { + aA = this.a = 1.0 / aA; + dA = this.d = 1.0 / dA; + this.tx = -aA * txA; + this.ty = -dA * tyA; + } + return this; + } + var determinant = aA * dA - bA * cA; + if (determinant === 0.0) { + this.a = this.d = 1.0; + this.b = this.c = 0.0; + this.tx = this.ty = 0.0; + return this; + } + determinant = 1.0 / determinant; + var k = this.a = dA * determinant; + bA = this.b = -bA * determinant; + cA = this.c = -cA * determinant; + dA = this.d = aA * determinant; + this.tx = -(k * txA + cA * tyA); + this.ty = -(bA * txA + dA * tyA); + return this; + }; + /** + * - Apply a matrix transformation to a specific point. + * @param x - X coordinate. + * @param y - Y coordinate. + * @param result - The point after the transformation is applied. + * @param delta - Whether to ignore tx, ty's conversion to point. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将矩阵转换应用于特定点。 + * @param x - 横坐标。 + * @param y - 纵坐标。 + * @param result - 应用转换之后的点。 + * @param delta - 是否忽略 tx,ty 对点的转换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.transformPoint = function (x, y, result, delta) { + if (delta === void 0) { delta = false; } + result.x = this.a * x + this.c * y; + result.y = this.b * x + this.d * y; + if (!delta) { + result.x += this.tx; + result.y += this.ty; + } + }; + /** + * @private + */ + Matrix.prototype.transformRectangle = function (rectangle, delta) { + if (delta === void 0) { delta = false; } + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + var tx = delta ? 0.0 : this.tx; + var ty = delta ? 0.0 : this.ty; + var x = rectangle.x; + var y = rectangle.y; + var xMax = x + rectangle.width; + var yMax = y + rectangle.height; + var x0 = a * x + c * y + tx; + var y0 = b * x + d * y + ty; + var x1 = a * xMax + c * y + tx; + var y1 = b * xMax + d * y + ty; + var x2 = a * xMax + c * yMax + tx; + var y2 = b * xMax + d * yMax + ty; + var x3 = a * x + c * yMax + tx; + var y3 = b * x + d * yMax + ty; + var tmp = 0.0; + if (x0 > x1) { + tmp = x0; + x0 = x1; + x1 = tmp; + } + if (x2 > x3) { + tmp = x2; + x2 = x3; + x3 = tmp; + } + rectangle.x = Math.floor(x0 < x2 ? x0 : x2); + rectangle.width = Math.ceil((x1 > x3 ? x1 : x3) - rectangle.x); + if (y0 > y1) { + tmp = y0; + y0 = y1; + y1 = tmp; + } + if (y2 > y3) { + tmp = y2; + y2 = y3; + y3 = tmp; + } + rectangle.y = Math.floor(y0 < y2 ? y0 : y2); + rectangle.height = Math.ceil((y1 > y3 ? y1 : y3) - rectangle.y); + }; + return Matrix; + }()); + dragonBones.Matrix = Matrix; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - 2D Transform. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 变换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Transform = /** @class */ (function () { + /** + * @private + */ + function Transform(x, y, skew, rotation, scaleX, scaleY) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (skew === void 0) { skew = 0.0; } + if (rotation === void 0) { rotation = 0.0; } + if (scaleX === void 0) { scaleX = 1.0; } + if (scaleY === void 0) { scaleY = 1.0; } + this.x = x; + this.y = y; + this.skew = skew; + this.rotation = rotation; + this.scaleX = scaleX; + this.scaleY = scaleY; + } + /** + * @private + */ + Transform.normalizeRadian = function (value) { + value = (value + Math.PI) % (Math.PI * 2.0); + value += value > 0.0 ? -Math.PI : Math.PI; + return value; + }; + Transform.prototype.toString = function () { + return "[object dragonBones.Transform] x:" + this.x + " y:" + this.y + " skewX:" + this.skew * 180.0 / Math.PI + " skewY:" + this.rotation * 180.0 / Math.PI + " scaleX:" + this.scaleX + " scaleY:" + this.scaleY; + }; + /** + * @private + */ + Transform.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + this.skew = value.skew; + this.rotation = value.rotation; + this.scaleX = value.scaleX; + this.scaleY = value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.identity = function () { + this.x = this.y = 0.0; + this.skew = this.rotation = 0.0; + this.scaleX = this.scaleY = 1.0; + return this; + }; + /** + * @private + */ + Transform.prototype.add = function (value) { + this.x += value.x; + this.y += value.y; + this.skew += value.skew; + this.rotation += value.rotation; + this.scaleX *= value.scaleX; + this.scaleY *= value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.minus = function (value) { + this.x -= value.x; + this.y -= value.y; + this.skew -= value.skew; + this.rotation -= value.rotation; + this.scaleX /= value.scaleX; + this.scaleY /= value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.fromMatrix = function (matrix) { + var backupScaleX = this.scaleX, backupScaleY = this.scaleY; + var PI_Q = Transform.PI_Q; + this.x = matrix.tx; + this.y = matrix.ty; + this.rotation = Math.atan(matrix.b / matrix.a); + var skewX = Math.atan(-matrix.c / matrix.d); + this.scaleX = (this.rotation > -PI_Q && this.rotation < PI_Q) ? matrix.a / Math.cos(this.rotation) : matrix.b / Math.sin(this.rotation); + this.scaleY = (skewX > -PI_Q && skewX < PI_Q) ? matrix.d / Math.cos(skewX) : -matrix.c / Math.sin(skewX); + if (backupScaleX >= 0.0 && this.scaleX < 0.0) { + this.scaleX = -this.scaleX; + this.rotation = this.rotation - Math.PI; + } + if (backupScaleY >= 0.0 && this.scaleY < 0.0) { + this.scaleY = -this.scaleY; + skewX = skewX - Math.PI; + } + this.skew = skewX - this.rotation; + return this; + }; + /** + * @private + */ + Transform.prototype.toMatrix = function (matrix) { + if (this.rotation === 0.0) { + matrix.a = 1.0; + matrix.b = 0.0; + } + else { + matrix.a = Math.cos(this.rotation); + matrix.b = Math.sin(this.rotation); + } + if (this.skew === 0.0) { + matrix.c = -matrix.b; + matrix.d = matrix.a; + } + else { + matrix.c = -Math.sin(this.skew + this.rotation); + matrix.d = Math.cos(this.skew + this.rotation); + } + if (this.scaleX !== 1.0) { + matrix.a *= this.scaleX; + matrix.b *= this.scaleX; + } + if (this.scaleY !== 1.0) { + matrix.c *= this.scaleY; + matrix.d *= this.scaleY; + } + matrix.tx = this.x; + matrix.ty = this.y; + return this; + }; + /** + * @private + */ + Transform.PI = Math.PI; + /** + * @private + */ + Transform.PI_D = Math.PI * 2.0; + /** + * @private + */ + Transform.PI_H = Math.PI / 2.0; + /** + * @private + */ + Transform.PI_Q = Math.PI / 4.0; + /** + * @private + */ + Transform.RAD_DEG = 180.0 / Math.PI; + /** + * @private + */ + Transform.DEG_RAD = Math.PI / 180.0; + return Transform; + }()); + dragonBones.Transform = Transform; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ColorTransform = /** @class */ (function () { + function ColorTransform(alphaMultiplier, redMultiplier, greenMultiplier, blueMultiplier, alphaOffset, redOffset, greenOffset, blueOffset) { + if (alphaMultiplier === void 0) { alphaMultiplier = 1.0; } + if (redMultiplier === void 0) { redMultiplier = 1.0; } + if (greenMultiplier === void 0) { greenMultiplier = 1.0; } + if (blueMultiplier === void 0) { blueMultiplier = 1.0; } + if (alphaOffset === void 0) { alphaOffset = 0; } + if (redOffset === void 0) { redOffset = 0; } + if (greenOffset === void 0) { greenOffset = 0; } + if (blueOffset === void 0) { blueOffset = 0; } + this.alphaMultiplier = alphaMultiplier; + this.redMultiplier = redMultiplier; + this.greenMultiplier = greenMultiplier; + this.blueMultiplier = blueMultiplier; + this.alphaOffset = alphaOffset; + this.redOffset = redOffset; + this.greenOffset = greenOffset; + this.blueOffset = blueOffset; + } + ColorTransform.prototype.copyFrom = function (value) { + this.alphaMultiplier = value.alphaMultiplier; + this.redMultiplier = value.redMultiplier; + this.greenMultiplier = value.greenMultiplier; + this.blueMultiplier = value.blueMultiplier; + this.alphaOffset = value.alphaOffset; + this.redOffset = value.redOffset; + this.greenOffset = value.greenOffset; + this.blueOffset = value.blueOffset; + }; + ColorTransform.prototype.identity = function () { + this.alphaMultiplier = this.redMultiplier = this.greenMultiplier = this.blueMultiplier = 1.0; + this.alphaOffset = this.redOffset = this.greenOffset = this.blueOffset = 0; + }; + return ColorTransform; + }()); + dragonBones.ColorTransform = ColorTransform; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The Point object represents a location in a two-dimensional coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Point 对象表示二维坐标系统中的某个位置。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Point = /** @class */ (function () { + /** + * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @param x - The horizontal coordinate. + * @param y - The vertical coordinate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。 + * @param x - 该对象的x属性值,默认为 0.0。 + * @param y - 该对象的y属性值,默认为 0.0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + function Point(x, y) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + this.x = x; + this.y = y; + } + /** + * @private + */ + Point.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + }; + /** + * @private + */ + Point.prototype.clear = function () { + this.x = this.y = 0.0; + }; + return Point; + }()); + dragonBones.Point = Point; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its + * width and its height.
+ * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of + * one property has no effect on the others. However, the right and bottom properties are integrally related to those + * four properties. For example, if you change the value of the right property, the value of the width property changes; + * if you change the bottom property, the value of the height property changes. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
+ * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 + * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width + * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Rectangle = /** @class */ (function () { + /** + * @private + */ + function Rectangle(x, y, width, height) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (width === void 0) { width = 0.0; } + if (height === void 0) { height = 0.0; } + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + /** + * @private + */ + Rectangle.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + this.width = value.width; + this.height = value.height; + }; + /** + * @private + */ + Rectangle.prototype.clear = function () { + this.x = this.y = 0.0; + this.width = this.height = 0.0; + }; + return Rectangle; + }()); + dragonBones.Rectangle = Rectangle; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The user custom data. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 用户自定义数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + var UserData = /** @class */ (function (_super) { + __extends(UserData, _super); + function UserData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - The custom int numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.ints = []; + /** + * - The custom float numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.floats = []; + /** + * - The custom strings. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.strings = []; + return _this; + } + UserData.toString = function () { + return "[class dragonBones.UserData]"; + }; + UserData.prototype._onClear = function () { + this.ints.length = 0; + this.floats.length = 0; + this.strings.length = 0; + }; + /** + * @internal + */ + UserData.prototype.addInt = function (value) { + this.ints.push(value); + }; + /** + * @internal + */ + UserData.prototype.addFloat = function (value) { + this.floats.push(value); + }; + /** + * @internal + */ + UserData.prototype.addString = function (value) { + this.strings.push(value); + }; + /** + * - Get the custom int number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getInt = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.ints.length ? this.ints[index] : 0; + }; + /** + * - Get the custom float number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getFloat = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.floats.length ? this.floats[index] : 0.0; + }; + /** + * - Get the custom string. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getString = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.strings.length ? this.strings[index] : ""; + }; + return UserData; + }(dragonBones.BaseObject)); + dragonBones.UserData = UserData; + /** + * @private + */ + var ActionData = /** @class */ (function (_super) { + __extends(ActionData, _super); + function ActionData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.data = null; // + return _this; + } + ActionData.toString = function () { + return "[class dragonBones.ActionData]"; + }; + ActionData.prototype._onClear = function () { + if (this.data !== null) { + this.data.returnToPool(); + } + this.type = 0 /* Play */; + this.name = ""; + this.bone = null; + this.slot = null; + this.data = null; + }; + return ActionData; + }(dragonBones.BaseObject)); + dragonBones.ActionData = ActionData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The DragonBones data. + * A DragonBones data contains multiple armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据。 + * 一个龙骨数据包含多个骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + var DragonBonesData = /** @class */ (function (_super) { + __extends(DragonBonesData, _super); + function DragonBonesData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @internal + */ + _this.frameIndices = []; + /** + * @internal + */ + _this.cachedFrames = []; + /** + * - All armature data names. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.armatureNames = []; + /** + * @private + */ + _this.armatures = {}; + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + DragonBonesData.toString = function () { + return "[class dragonBones.DragonBonesData]"; + }; + DragonBonesData.prototype._onClear = function () { + for (var k in this.armatures) { + this.armatures[k].returnToPool(); + delete this.armatures[k]; + } + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.autoSearch = false; + this.frameRate = 0; + this.version = ""; + this.name = ""; + this.stage = null; + this.frameIndices.length = 0; + this.cachedFrames.length = 0; + this.armatureNames.length = 0; + //this.armatures.clear(); + this.binary = null; // + this.intArray = null; // + this.floatArray = null; // + this.frameIntArray = null; // + this.frameFloatArray = null; // + this.frameArray = null; // + this.timelineArray = null; // + this.colorArray = null; // + this.userData = null; + }; + /** + * @internal + */ + DragonBonesData.prototype.addArmature = function (value) { + if (value.name in this.armatures) { + console.warn("Same armature: " + value.name); + return; + } + value.parent = this; + this.armatures[value.name] = value; + this.armatureNames.push(value.name); + }; + /** + * - Get a specific armature data. + * @param armatureName - The armature data name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param armatureName - 骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + DragonBonesData.prototype.getArmature = function (armatureName) { + return armatureName in this.armatures ? this.armatures[armatureName] : null; + }; + return DragonBonesData; + }(dragonBones.BaseObject)); + dragonBones.DragonBonesData = DragonBonesData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The armature data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var ArmatureData = /** @class */ (function (_super) { + __extends(ArmatureData, _super); + function ArmatureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.aabb = new dragonBones.Rectangle(); + /** + * - The names of all the animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的动画数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.animationNames = []; + /** + * @private + */ + _this.sortedBones = []; + /** + * @private + */ + _this.sortedSlots = []; + /** + * @private + */ + _this.defaultActions = []; + /** + * @private + */ + _this.actions = []; + /** + * @private + */ + _this.bones = {}; + /** + * @private + */ + _this.slots = {}; + /** + * @private + */ + _this.constraints = {}; + /** + * @private + */ + _this.skins = {}; + /** + * @private + */ + _this.animations = {}; + /** + * @private + */ + _this.canvas = null; // Initial value. + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + ArmatureData.toString = function () { + return "[class dragonBones.ArmatureData]"; + }; + ArmatureData.prototype._onClear = function () { + for (var _i = 0, _a = this.defaultActions; _i < _a.length; _i++) { + var action = _a[_i]; + action.returnToPool(); + } + for (var _b = 0, _c = this.actions; _b < _c.length; _b++) { + var action = _c[_b]; + action.returnToPool(); + } + for (var k in this.bones) { + this.bones[k].returnToPool(); + delete this.bones[k]; + } + for (var k in this.slots) { + this.slots[k].returnToPool(); + delete this.slots[k]; + } + for (var k in this.constraints) { + this.constraints[k].returnToPool(); + delete this.constraints[k]; + } + for (var k in this.skins) { + this.skins[k].returnToPool(); + delete this.skins[k]; + } + for (var k in this.animations) { + this.animations[k].returnToPool(); + delete this.animations[k]; + } + if (this.canvas !== null) { + this.canvas.returnToPool(); + } + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.type = 0 /* Armature */; + this.frameRate = 0; + this.cacheFrameRate = 0; + this.scale = 1.0; + this.name = ""; + this.aabb.clear(); + this.animationNames.length = 0; + this.sortedBones.length = 0; + this.sortedSlots.length = 0; + this.defaultActions.length = 0; + this.actions.length = 0; + // this.bones.clear(); + // this.slots.clear(); + // this.constraints.clear(); + // this.skins.clear(); + // this.animations.clear(); + this.defaultSkin = null; + this.defaultAnimation = null; + this.canvas = null; + this.userData = null; + this.parent = null; // + }; + /** + * @internal + */ + ArmatureData.prototype.sortBones = function () { + var total = this.sortedBones.length; + if (total <= 0) { + return; + } + var sortHelper = this.sortedBones.concat(); + var index = 0; + var count = 0; + this.sortedBones.length = 0; + while (count < total) { + var bone = sortHelper[index++]; + if (index >= total) { + index = 0; + } + if (this.sortedBones.indexOf(bone) >= 0) { + continue; + } + var flag = false; + for (var k in this.constraints) { // Wait constraint. + var constraint = this.constraints[k]; + if (constraint.root === bone && this.sortedBones.indexOf(constraint.target) < 0) { + flag = true; + break; + } + } + if (flag) { + continue; + } + if (bone.parent !== null && this.sortedBones.indexOf(bone.parent) < 0) { // Wait parent. + continue; + } + this.sortedBones.push(bone); + count++; + } + }; + /** + * @internal + */ + ArmatureData.prototype.cacheFrames = function (frameRate) { + if (this.cacheFrameRate > 0) { // TODO clear cache. + return; + } + this.cacheFrameRate = frameRate; + for (var k in this.animations) { + this.animations[k].cacheFrames(this.cacheFrameRate); + } + }; + /** + * @internal + */ + ArmatureData.prototype.setCacheFrame = function (globalTransformMatrix, transform) { + var dataArray = this.parent.cachedFrames; + var arrayOffset = dataArray.length; + dataArray.length += 10; + dataArray[arrayOffset] = globalTransformMatrix.a; + dataArray[arrayOffset + 1] = globalTransformMatrix.b; + dataArray[arrayOffset + 2] = globalTransformMatrix.c; + dataArray[arrayOffset + 3] = globalTransformMatrix.d; + dataArray[arrayOffset + 4] = globalTransformMatrix.tx; + dataArray[arrayOffset + 5] = globalTransformMatrix.ty; + dataArray[arrayOffset + 6] = transform.rotation; + dataArray[arrayOffset + 7] = transform.skew; + dataArray[arrayOffset + 8] = transform.scaleX; + dataArray[arrayOffset + 9] = transform.scaleY; + return arrayOffset; + }; + /** + * @internal + */ + ArmatureData.prototype.getCacheFrame = function (globalTransformMatrix, transform, arrayOffset) { + var dataArray = this.parent.cachedFrames; + globalTransformMatrix.a = dataArray[arrayOffset]; + globalTransformMatrix.b = dataArray[arrayOffset + 1]; + globalTransformMatrix.c = dataArray[arrayOffset + 2]; + globalTransformMatrix.d = dataArray[arrayOffset + 3]; + globalTransformMatrix.tx = dataArray[arrayOffset + 4]; + globalTransformMatrix.ty = dataArray[arrayOffset + 5]; + transform.rotation = dataArray[arrayOffset + 6]; + transform.skew = dataArray[arrayOffset + 7]; + transform.scaleX = dataArray[arrayOffset + 8]; + transform.scaleY = dataArray[arrayOffset + 9]; + transform.x = globalTransformMatrix.tx; + transform.y = globalTransformMatrix.ty; + }; + /** + * @internal + */ + ArmatureData.prototype.addBone = function (value) { + if (value.name in this.bones) { + console.warn("Same bone: " + value.name); + return; + } + this.bones[value.name] = value; + this.sortedBones.push(value); + }; + /** + * @internal + */ + ArmatureData.prototype.addSlot = function (value) { + if (value.name in this.slots) { + console.warn("Same slot: " + value.name); + return; + } + this.slots[value.name] = value; + this.sortedSlots.push(value); + }; + /** + * @internal + */ + ArmatureData.prototype.addConstraint = function (value) { + if (value.name in this.constraints) { + console.warn("Same constraint: " + value.name); + return; + } + this.constraints[value.name] = value; + }; + /** + * @internal + */ + ArmatureData.prototype.addSkin = function (value) { + if (value.name in this.skins) { + console.warn("Same skin: " + value.name); + return; + } + value.parent = this; + this.skins[value.name] = value; + if (this.defaultSkin === null) { + this.defaultSkin = value; + } + if (value.name === "default") { + this.defaultSkin = value; + } + }; + /** + * @internal + */ + ArmatureData.prototype.addAnimation = function (value) { + if (value.name in this.animations) { + console.warn("Same animation: " + value.name); + return; + } + value.parent = this; + this.animations[value.name] = value; + this.animationNames.push(value.name); + if (this.defaultAnimation === null) { + this.defaultAnimation = value; + } + }; + /** + * @internal + */ + ArmatureData.prototype.addAction = function (value, isDefault) { + if (isDefault) { + this.defaultActions.push(value); + } + else { + this.actions.push(value); + } + }; + /** + * - Get a specific done data. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼数据。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getBone = function (boneName) { + return boneName in this.bones ? this.bones[boneName] : null; + }; + /** + * - Get a specific slot data. + * @param slotName - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽数据。 + * @param slotName - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getSlot = function (slotName) { + return slotName in this.slots ? this.slots[slotName] : null; + }; + /** + * @private + */ + ArmatureData.prototype.getConstraint = function (constraintName) { + return constraintName in this.constraints ? this.constraints[constraintName] : null; + }; + /** + * - Get a specific skin data. + * @param skinName - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定皮肤数据。 + * @param skinName - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getSkin = function (skinName) { + return skinName in this.skins ? this.skins[skinName] : null; + }; + /** + * @private + */ + ArmatureData.prototype.getMesh = function (skinName, slotName, meshName) { + var skin = this.getSkin(skinName); + if (skin === null) { + return null; + } + return skin.getDisplay(slotName, meshName); + }; + /** + * - Get a specific animation data. + * @param animationName - The animation animationName. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的动画数据。 + * @param animationName - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getAnimation = function (animationName) { + return animationName in this.animations ? this.animations[animationName] : null; + }; + return ArmatureData; + }(dragonBones.BaseObject)); + dragonBones.ArmatureData = ArmatureData; + /** + * - The bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var BoneData = /** @class */ (function (_super) { + __extends(BoneData, _super); + function BoneData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.transform = new dragonBones.Transform(); + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + BoneData.toString = function () { + return "[class dragonBones.BoneData]"; + }; + BoneData.prototype._onClear = function () { + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.inheritTranslation = false; + this.inheritRotation = false; + this.inheritScale = false; + this.inheritReflection = false; + this.type = 0 /* Bone */; + this.length = 0.0; + this.alpha = 1.0; + this.name = ""; + this.transform.identity(); + this.userData = null; + this.parent = null; + }; + return BoneData; + }(dragonBones.BaseObject)); + dragonBones.BoneData = BoneData; + /** + * @internal + */ + var SurfaceData = /** @class */ (function (_super) { + __extends(SurfaceData, _super); + function SurfaceData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new dragonBones.GeometryData(); + return _this; + } + SurfaceData.toString = function () { + return "[class dragonBones.SurfaceData]"; + }; + SurfaceData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 1 /* Surface */; + this.segmentX = 0; + this.segmentY = 0; + this.geometry.clear(); + }; + return SurfaceData; + }(BoneData)); + dragonBones.SurfaceData = SurfaceData; + /** + * - The slot data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var SlotData = /** @class */ (function (_super) { + __extends(SlotData, _super); + function SlotData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.color = null; // Initial value. + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + /** + * @internal + */ + SlotData.createColor = function () { + return new dragonBones.ColorTransform(); + }; + SlotData.toString = function () { + return "[class dragonBones.SlotData]"; + }; + SlotData.prototype._onClear = function () { + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.blendMode = 0 /* Normal */; + this.displayIndex = 0; + this.zOrder = 0; + this.zIndex = 0; + this.alpha = 1.0; + this.name = ""; + this.color = null; // + this.userData = null; + this.parent = null; // + }; + /** + * @internal + */ + SlotData.DEFAULT_COLOR = new dragonBones.ColorTransform(); + return SlotData; + }(dragonBones.BaseObject)); + dragonBones.SlotData = SlotData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ConstraintData = /** @class */ (function (_super) { + __extends(ConstraintData, _super); + function ConstraintData() { + return _super !== null && _super.apply(this, arguments) || this; + } + ConstraintData.prototype._onClear = function () { + this.order = 0; + this.name = ""; + this.type = 0 /* IK */; + this.target = null; // + this.root = null; // + this.bone = null; + }; + return ConstraintData; + }(dragonBones.BaseObject)); + dragonBones.ConstraintData = ConstraintData; + /** + * @internal + */ + var IKConstraintData = /** @class */ (function (_super) { + __extends(IKConstraintData, _super); + function IKConstraintData() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraintData.toString = function () { + return "[class dragonBones.IKConstraintData]"; + }; + IKConstraintData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.scaleEnabled = false; + this.bendPositive = false; + this.weight = 1.0; + }; + return IKConstraintData; + }(ConstraintData)); + dragonBones.IKConstraintData = IKConstraintData; + /** + * @internal + */ + var PathConstraintData = /** @class */ (function (_super) { + __extends(PathConstraintData, _super); + function PathConstraintData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.bones = []; + return _this; + } + PathConstraintData.toString = function () { + return "[class dragonBones.PathConstraintData]"; + }; + PathConstraintData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.pathSlot = null; + this.pathDisplayData = null; + this.bones.length = 0; + this.positionMode = 0 /* Fixed */; + this.spacingMode = 1 /* Fixed */; + this.rotateMode = 1 /* Chain */; + this.position = 0.0; + this.spacing = 0.0; + this.rotateOffset = 0.0; + this.rotateMix = 0.0; + this.translateMix = 0.0; + }; + PathConstraintData.prototype.AddBone = function (value) { + this.bones.push(value); + }; + return PathConstraintData; + }(ConstraintData)); + dragonBones.PathConstraintData = PathConstraintData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var CanvasData = /** @class */ (function (_super) { + __extends(CanvasData, _super); + function CanvasData() { + return _super !== null && _super.apply(this, arguments) || this; + } + CanvasData.toString = function () { + return "[class dragonBones.CanvasData]"; + }; + CanvasData.prototype._onClear = function () { + this.hasBackground = false; + this.color = 0x000000; + this.x = 0; + this.y = 0; + this.width = 0; + this.height = 0; + }; + return CanvasData; + }(dragonBones.BaseObject)); + dragonBones.CanvasData = CanvasData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The skin data, typically a armature data instance contains at least one skinData. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var SkinData = /** @class */ (function (_super) { + __extends(SkinData, _super); + function SkinData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.displays = {}; + return _this; + } + SkinData.toString = function () { + return "[class dragonBones.SkinData]"; + }; + SkinData.prototype._onClear = function () { + for (var k in this.displays) { + var slotDisplays = this.displays[k]; + for (var _i = 0, slotDisplays_1 = slotDisplays; _i < slotDisplays_1.length; _i++) { + var display = slotDisplays_1[_i]; + if (display !== null) { + display.returnToPool(); + } + } + delete this.displays[k]; + } + this.name = ""; + // this.displays.clear(); + this.parent = null; // + }; + /** + * @internal + */ + SkinData.prototype.addDisplay = function (slotName, value) { + if (!(slotName in this.displays)) { + this.displays[slotName] = []; + } + if (value !== null) { + value.parent = this; + } + var slotDisplays = this.displays[slotName]; // TODO clear prev + slotDisplays.push(value); + }; + /** + * @private + */ + SkinData.prototype.getDisplay = function (slotName, displayName) { + var slotDisplays = this.getDisplays(slotName); + if (slotDisplays !== null) { + for (var _i = 0, slotDisplays_2 = slotDisplays; _i < slotDisplays_2.length; _i++) { + var display = slotDisplays_2[_i]; + if (display !== null && display.name === displayName) { + return display; + } + } + } + return null; + }; + /** + * @private + */ + SkinData.prototype.getDisplays = function (slotName) { + if (!(slotName in this.displays)) { + return null; + } + return this.displays[slotName]; + }; + return SkinData; + }(dragonBones.BaseObject)); + dragonBones.SkinData = SkinData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var GeometryData = /** @class */ (function () { + function GeometryData() { + this.weight = null; // Initial value. + } + GeometryData.prototype.clear = function () { + if (!this.isShared && this.weight !== null) { + this.weight.returnToPool(); + } + this.isShared = false; + this.inheritDeform = false; + this.offset = 0; + this.data = null; + this.weight = null; + }; + GeometryData.prototype.shareFrom = function (value) { + this.isShared = true; + this.offset = value.offset; + this.weight = value.weight; + }; + Object.defineProperty(GeometryData.prototype, "vertexCount", { + get: function () { + var intArray = this.data.intArray; + return intArray[this.offset + 0 /* GeometryVertexCount */]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GeometryData.prototype, "triangleCount", { + get: function () { + var intArray = this.data.intArray; + return intArray[this.offset + 1 /* GeometryTriangleCount */]; + }, + enumerable: true, + configurable: true + }); + return GeometryData; + }()); + dragonBones.GeometryData = GeometryData; + /** + * @private + */ + var DisplayData = /** @class */ (function (_super) { + __extends(DisplayData, _super); + function DisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.transform = new dragonBones.Transform(); + return _this; + } + DisplayData.prototype._onClear = function () { + this.name = ""; + this.path = ""; + this.transform.identity(); + this.parent = null; // + }; + return DisplayData; + }(dragonBones.BaseObject)); + dragonBones.DisplayData = DisplayData; + /** + * @private + */ + var ImageDisplayData = /** @class */ (function (_super) { + __extends(ImageDisplayData, _super); + function ImageDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.pivot = new dragonBones.Point(); + return _this; + } + ImageDisplayData.toString = function () { + return "[class dragonBones.ImageDisplayData]"; + }; + ImageDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 0 /* Image */; + this.pivot.clear(); + this.texture = null; + }; + return ImageDisplayData; + }(DisplayData)); + dragonBones.ImageDisplayData = ImageDisplayData; + /** + * @private + */ + var ArmatureDisplayData = /** @class */ (function (_super) { + __extends(ArmatureDisplayData, _super); + function ArmatureDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.actions = []; + return _this; + } + ArmatureDisplayData.toString = function () { + return "[class dragonBones.ArmatureDisplayData]"; + }; + ArmatureDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + for (var _i = 0, _a = this.actions; _i < _a.length; _i++) { + var action = _a[_i]; + action.returnToPool(); + } + this.type = 1 /* Armature */; + this.inheritAnimation = false; + this.actions.length = 0; + this.armature = null; + }; + /** + * @private + */ + ArmatureDisplayData.prototype.addAction = function (value) { + this.actions.push(value); + }; + return ArmatureDisplayData; + }(DisplayData)); + dragonBones.ArmatureDisplayData = ArmatureDisplayData; + /** + * @private + */ + var MeshDisplayData = /** @class */ (function (_super) { + __extends(MeshDisplayData, _super); + function MeshDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new GeometryData(); + return _this; + } + MeshDisplayData.toString = function () { + return "[class dragonBones.MeshDisplayData]"; + }; + MeshDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 2 /* Mesh */; + this.geometry.clear(); + this.texture = null; + }; + return MeshDisplayData; + }(DisplayData)); + dragonBones.MeshDisplayData = MeshDisplayData; + /** + * @private + */ + var BoundingBoxDisplayData = /** @class */ (function (_super) { + __extends(BoundingBoxDisplayData, _super); + function BoundingBoxDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.boundingBox = null; // Initial value. + return _this; + } + BoundingBoxDisplayData.toString = function () { + return "[class dragonBones.BoundingBoxDisplayData]"; + }; + BoundingBoxDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this.boundingBox !== null) { + this.boundingBox.returnToPool(); + } + this.type = 3 /* BoundingBox */; + this.boundingBox = null; + }; + return BoundingBoxDisplayData; + }(DisplayData)); + dragonBones.BoundingBoxDisplayData = BoundingBoxDisplayData; + /** + * @private + */ + var PathDisplayData = /** @class */ (function (_super) { + __extends(PathDisplayData, _super); + function PathDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new GeometryData(); + _this.curveLengths = []; + return _this; + } + PathDisplayData.toString = function () { + return "[class dragonBones.PathDisplayData]"; + }; + PathDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 4 /* Path */; + this.closed = false; + this.constantSpeed = false; + this.geometry.clear(); + this.curveLengths.length = 0; + }; + return PathDisplayData; + }(DisplayData)); + dragonBones.PathDisplayData = PathDisplayData; + /** + * @private + */ + var WeightData = /** @class */ (function (_super) { + __extends(WeightData, _super); + function WeightData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.bones = []; + return _this; + } + WeightData.toString = function () { + return "[class dragonBones.WeightData]"; + }; + WeightData.prototype._onClear = function () { + this.count = 0; + this.offset = 0; + this.bones.length = 0; + }; + WeightData.prototype.addBone = function (value) { + this.bones.push(value); + }; + return WeightData; + }(dragonBones.BaseObject)); + dragonBones.WeightData = WeightData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The base class of bounding box data. + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框数据基类。 + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language zh_CN + */ + var BoundingBoxData = /** @class */ (function (_super) { + __extends(BoundingBoxData, _super); + function BoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoundingBoxData.prototype._onClear = function () { + this.color = 0x000000; + this.width = 0.0; + this.height = 0.0; + }; + return BoundingBoxData; + }(dragonBones.BaseObject)); + dragonBones.BoundingBoxData = BoundingBoxData; + /** + * - The rectangle bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 矩形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var RectangleBoundingBoxData = /** @class */ (function (_super) { + __extends(RectangleBoundingBoxData, _super); + function RectangleBoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + RectangleBoundingBoxData.toString = function () { + return "[class dragonBones.RectangleBoundingBoxData]"; + }; + /** + * - Compute the bit code for a point (x, y) using the clip rectangle + */ + RectangleBoundingBoxData._computeOutCode = function (x, y, xMin, yMin, xMax, yMax) { + var code = 0 /* InSide */; // initialised as being inside of [[clip window]] + if (x < xMin) { // to the left of clip window + code |= 1 /* Left */; + } + else if (x > xMax) { // to the right of clip window + code |= 2 /* Right */; + } + if (y < yMin) { // below the clip window + code |= 4 /* Top */; + } + else if (y > yMax) { // above the clip window + code |= 8 /* Bottom */; + } + return code; + }; + /** + * @private + */ + RectangleBoundingBoxData.rectangleIntersectsSegment = function (xA, yA, xB, yB, xMin, yMin, xMax, yMax, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var inSideA = xA > xMin && xA < xMax && yA > yMin && yA < yMax; + var inSideB = xB > xMin && xB < xMax && yB > yMin && yB < yMax; + if (inSideA && inSideB) { + return -1; + } + var intersectionCount = 0; + var outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax); + var outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax); + while (true) { + if ((outcode0 | outcode1) === 0) { // Bitwise OR is 0. Trivially accept and get out of loop + intersectionCount = 2; + break; + } + else if ((outcode0 & outcode1) !== 0) { // Bitwise AND is not 0. Trivially reject and get out of loop + break; + } + // failed both tests, so calculate the line segment to clip + // from an outside point to an intersection with clip edge + var x = 0.0; + var y = 0.0; + var normalRadian = 0.0; + // At least one endpoint is outside the clip rectangle; pick it. + var outcodeOut = outcode0 !== 0 ? outcode0 : outcode1; + // Now find the intersection point; + if ((outcodeOut & 4 /* Top */) !== 0) { // point is above the clip rectangle + x = xA + (xB - xA) * (yMin - yA) / (yB - yA); + y = yMin; + if (normalRadians !== null) { + normalRadian = -Math.PI * 0.5; + } + } + else if ((outcodeOut & 8 /* Bottom */) !== 0) { // point is below the clip rectangle + x = xA + (xB - xA) * (yMax - yA) / (yB - yA); + y = yMax; + if (normalRadians !== null) { + normalRadian = Math.PI * 0.5; + } + } + else if ((outcodeOut & 2 /* Right */) !== 0) { // point is to the right of clip rectangle + y = yA + (yB - yA) * (xMax - xA) / (xB - xA); + x = xMax; + if (normalRadians !== null) { + normalRadian = 0; + } + } + else if ((outcodeOut & 1 /* Left */) !== 0) { // point is to the left of clip rectangle + y = yA + (yB - yA) * (xMin - xA) / (xB - xA); + x = xMin; + if (normalRadians !== null) { + normalRadian = Math.PI; + } + } + // Now we move outside point to intersection point to clip + // and get ready for next pass. + if (outcodeOut === outcode0) { + xA = x; + yA = y; + outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax); + if (normalRadians !== null) { + normalRadians.x = normalRadian; + } + } + else { + xB = x; + yB = y; + outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax); + if (normalRadians !== null) { + normalRadians.y = normalRadian; + } + } + } + if (intersectionCount) { + if (inSideA) { + intersectionCount = 2; // 10 + if (intersectionPointA !== null) { + intersectionPointA.x = xB; + intersectionPointA.y = yB; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = xB; + } + if (normalRadians !== null) { + normalRadians.x = normalRadians.y + Math.PI; + } + } + else if (inSideB) { + intersectionCount = 1; // 01 + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA; + intersectionPointB.y = yA; + } + if (normalRadians !== null) { + normalRadians.y = normalRadians.x + Math.PI; + } + } + else { + intersectionCount = 3; // 11 + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = yB; + } + } + } + return intersectionCount; + }; + RectangleBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 0 /* Rectangle */; + }; + /** + * @inheritDoc + */ + RectangleBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var widthH = this.width * 0.5; + if (pX >= -widthH && pX <= widthH) { + var heightH = this.height * 0.5; + if (pY >= -heightH && pY <= heightH) { + return true; + } + } + return false; + }; + /** + * @inheritDoc + */ + RectangleBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var widthH = this.width * 0.5; + var heightH = this.height * 0.5; + var intersectionCount = RectangleBoundingBoxData.rectangleIntersectsSegment(xA, yA, xB, yB, -widthH, -heightH, widthH, heightH, intersectionPointA, intersectionPointB, normalRadians); + return intersectionCount; + }; + return RectangleBoundingBoxData; + }(BoundingBoxData)); + dragonBones.RectangleBoundingBoxData = RectangleBoundingBoxData; + /** + * - The ellipse bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 椭圆边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var EllipseBoundingBoxData = /** @class */ (function (_super) { + __extends(EllipseBoundingBoxData, _super); + function EllipseBoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + EllipseBoundingBoxData.toString = function () { + return "[class dragonBones.EllipseData]"; + }; + /** + * @private + */ + EllipseBoundingBoxData.ellipseIntersectsSegment = function (xA, yA, xB, yB, xC, yC, widthH, heightH, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var d = widthH / heightH; + var dd = d * d; + yA *= d; + yB *= d; + var dX = xB - xA; + var dY = yB - yA; + var lAB = Math.sqrt(dX * dX + dY * dY); + var xD = dX / lAB; + var yD = dY / lAB; + var a = (xC - xA) * xD + (yC - yA) * yD; + var aa = a * a; + var ee = xA * xA + yA * yA; + var rr = widthH * widthH; + var dR = rr - ee + aa; + var intersectionCount = 0; + if (dR >= 0.0) { + var dT = Math.sqrt(dR); + var sA = a - dT; + var sB = a + dT; + var inSideA = sA < 0.0 ? -1 : (sA <= lAB ? 0 : 1); + var inSideB = sB < 0.0 ? -1 : (sB <= lAB ? 0 : 1); + var sideAB = inSideA * inSideB; + if (sideAB < 0) { + return -1; + } + else if (sideAB === 0) { + if (inSideA === -1) { + intersectionCount = 2; // 10 + xB = xA + sB * xD; + yB = (yA + sB * yD) / d; + if (intersectionPointA !== null) { + intersectionPointA.x = xB; + intersectionPointA.y = yB; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = yB; + } + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yB / rr * dd, xB / rr); + normalRadians.y = normalRadians.x + Math.PI; + } + } + else if (inSideB === 1) { + intersectionCount = 1; // 01 + xA = xA + sA * xD; + yA = (yA + sA * yD) / d; + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA; + intersectionPointB.y = yA; + } + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yA / rr * dd, xA / rr); + normalRadians.y = normalRadians.x + Math.PI; + } + } + else { + intersectionCount = 3; // 11 + if (intersectionPointA !== null) { + intersectionPointA.x = xA + sA * xD; + intersectionPointA.y = (yA + sA * yD) / d; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(intersectionPointA.y / rr * dd, intersectionPointA.x / rr); + } + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA + sB * xD; + intersectionPointB.y = (yA + sB * yD) / d; + if (normalRadians !== null) { + normalRadians.y = Math.atan2(intersectionPointB.y / rr * dd, intersectionPointB.x / rr); + } + } + } + } + } + return intersectionCount; + }; + EllipseBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 1 /* Ellipse */; + }; + /** + * @inheritDoc + */ + EllipseBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var widthH = this.width * 0.5; + if (pX >= -widthH && pX <= widthH) { + var heightH = this.height * 0.5; + if (pY >= -heightH && pY <= heightH) { + pY *= widthH / heightH; + return Math.sqrt(pX * pX + pY * pY) <= widthH; + } + } + return false; + }; + /** + * @inheritDoc + */ + EllipseBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var intersectionCount = EllipseBoundingBoxData.ellipseIntersectsSegment(xA, yA, xB, yB, 0.0, 0.0, this.width * 0.5, this.height * 0.5, intersectionPointA, intersectionPointB, normalRadians); + return intersectionCount; + }; + return EllipseBoundingBoxData; + }(BoundingBoxData)); + dragonBones.EllipseBoundingBoxData = EllipseBoundingBoxData; + /** + * - The polygon bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var PolygonBoundingBoxData = /** @class */ (function (_super) { + __extends(PolygonBoundingBoxData, _super); + function PolygonBoundingBoxData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - The polygon vertices. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形顶点。 + * @version DragonBones 5.1 + * @language zh_CN + */ + _this.vertices = []; + return _this; + } + PolygonBoundingBoxData.toString = function () { + return "[class dragonBones.PolygonBoundingBoxData]"; + }; + /** + * @private + */ + PolygonBoundingBoxData.polygonIntersectsSegment = function (xA, yA, xB, yB, vertices, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + if (xA === xB) { + xA = xB + 0.000001; + } + if (yA === yB) { + yA = yB + 0.000001; + } + var count = vertices.length; + var dXAB = xA - xB; + var dYAB = yA - yB; + var llAB = xA * yB - yA * xB; + var intersectionCount = 0; + var xC = vertices[count - 2]; + var yC = vertices[count - 1]; + var dMin = 0.0; + var dMax = 0.0; + var xMin = 0.0; + var yMin = 0.0; + var xMax = 0.0; + var yMax = 0.0; + for (var i = 0; i < count; i += 2) { + var xD = vertices[i]; + var yD = vertices[i + 1]; + if (xC === xD) { + xC = xD + 0.0001; + } + if (yC === yD) { + yC = yD + 0.0001; + } + var dXCD = xC - xD; + var dYCD = yC - yD; + var llCD = xC * yD - yC * xD; + var ll = dXAB * dYCD - dYAB * dXCD; + var x = (llAB * dXCD - dXAB * llCD) / ll; + if (((x >= xC && x <= xD) || (x >= xD && x <= xC)) && (dXAB === 0.0 || (x >= xA && x <= xB) || (x >= xB && x <= xA))) { + var y = (llAB * dYCD - dYAB * llCD) / ll; + if (((y >= yC && y <= yD) || (y >= yD && y <= yC)) && (dYAB === 0.0 || (y >= yA && y <= yB) || (y >= yB && y <= yA))) { + if (intersectionPointB !== null) { + var d = x - xA; + if (d < 0.0) { + d = -d; + } + if (intersectionCount === 0) { + dMin = d; + dMax = d; + xMin = x; + yMin = y; + xMax = x; + yMax = y; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + normalRadians.y = normalRadians.x; + } + } + else { + if (d < dMin) { + dMin = d; + xMin = x; + yMin = y; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + } + } + if (d > dMax) { + dMax = d; + xMax = x; + yMax = y; + if (normalRadians !== null) { + normalRadians.y = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + } + } + } + intersectionCount++; + } + else { + xMin = x; + yMin = y; + xMax = x; + yMax = y; + intersectionCount++; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + normalRadians.y = normalRadians.x; + } + break; + } + } + } + xC = xD; + yC = yD; + } + if (intersectionCount === 1) { + if (intersectionPointA !== null) { + intersectionPointA.x = xMin; + intersectionPointA.y = yMin; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xMin; + intersectionPointB.y = yMin; + } + if (normalRadians !== null) { + normalRadians.y = normalRadians.x + Math.PI; + } + } + else if (intersectionCount > 1) { + intersectionCount++; + if (intersectionPointA !== null) { + intersectionPointA.x = xMin; + intersectionPointA.y = yMin; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xMax; + intersectionPointB.y = yMax; + } + } + return intersectionCount; + }; + PolygonBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 2 /* Polygon */; + this.x = 0.0; + this.y = 0.0; + this.vertices.length = 0; + }; + /** + * @inheritDoc + */ + PolygonBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var isInSide = false; + if (pX >= this.x && pX <= this.width && pY >= this.y && pY <= this.height) { + for (var i = 0, l = this.vertices.length, iP = l - 2; i < l; i += 2) { + var yA = this.vertices[iP + 1]; + var yB = this.vertices[i + 1]; + if ((yB < pY && yA >= pY) || (yA < pY && yB >= pY)) { + var xA = this.vertices[iP]; + var xB = this.vertices[i]; + if ((pY - yB) * (xA - xB) / (yA - yB) + xB < pX) { + isInSide = !isInSide; + } + } + iP = i; + } + } + return isInSide; + }; + /** + * @inheritDoc + */ + PolygonBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var intersectionCount = 0; + if (RectangleBoundingBoxData.rectangleIntersectsSegment(xA, yA, xB, yB, this.x, this.y, this.x + this.width, this.y + this.height, null, null, null) !== 0) { + intersectionCount = PolygonBoundingBoxData.polygonIntersectsSegment(xA, yA, xB, yB, this.vertices, intersectionPointA, intersectionPointB, normalRadians); + } + return intersectionCount; + }; + return PolygonBoundingBoxData; + }(BoundingBoxData)); + dragonBones.PolygonBoundingBoxData = PolygonBoundingBoxData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var AnimationData = /** @class */ (function (_super) { + __extends(AnimationData, _super); + function AnimationData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.cachedFrames = []; + /** + * @private + */ + _this.boneTimelines = {}; + /** + * @private + */ + _this.slotTimelines = {}; + /** + * @private + */ + _this.constraintTimelines = {}; + /** + * @private + */ + _this.animationTimelines = {}; + /** + * @private + */ + _this.boneCachedFrameIndices = {}; + /** + * @private + */ + _this.slotCachedFrameIndices = {}; + /** + * @private + */ + _this.actionTimeline = null; // Initial value. + /** + * @private + */ + _this.zOrderTimeline = null; // Initial value. + return _this; + } + AnimationData.toString = function () { + return "[class dragonBones.AnimationData]"; + }; + AnimationData.prototype._onClear = function () { + for (var k in this.boneTimelines) { + for (var _i = 0, _a = this.boneTimelines[k]; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.returnToPool(); + } + delete this.boneTimelines[k]; + } + for (var k in this.slotTimelines) { + for (var _b = 0, _c = this.slotTimelines[k]; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.returnToPool(); + } + delete this.slotTimelines[k]; + } + for (var k in this.constraintTimelines) { + for (var _d = 0, _e = this.constraintTimelines[k]; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.returnToPool(); + } + delete this.constraintTimelines[k]; + } + for (var k in this.animationTimelines) { + for (var _f = 0, _g = this.animationTimelines[k]; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.returnToPool(); + } + delete this.animationTimelines[k]; + } + for (var k in this.boneCachedFrameIndices) { + delete this.boneCachedFrameIndices[k]; + } + for (var k in this.slotCachedFrameIndices) { + delete this.slotCachedFrameIndices[k]; + } + if (this.actionTimeline !== null) { + this.actionTimeline.returnToPool(); + } + if (this.zOrderTimeline !== null) { + this.zOrderTimeline.returnToPool(); + } + this.frameIntOffset = 0; + this.frameFloatOffset = 0; + this.frameOffset = 0; + this.blendType = 0 /* None */; + this.frameCount = 0; + this.playTimes = 0; + this.duration = 0.0; + this.scale = 1.0; + this.fadeInTime = 0.0; + this.cacheFrameRate = 0.0; + this.name = ""; + this.cachedFrames.length = 0; + // this.boneTimelines.clear(); + // this.slotTimelines.clear(); + // this.constraintTimelines.clear(); + // this.animationTimelines.clear(); + // this.boneCachedFrameIndices.clear(); + // this.slotCachedFrameIndices.clear(); + this.actionTimeline = null; + this.zOrderTimeline = null; + this.parent = null; // + }; + /** + * @internal + */ + AnimationData.prototype.cacheFrames = function (frameRate) { + if (this.cacheFrameRate > 0.0) { // TODO clear cache. + return; + } + this.cacheFrameRate = Math.max(Math.ceil(frameRate * this.scale), 1.0); + var cacheFrameCount = Math.ceil(this.cacheFrameRate * this.duration) + 1; // Cache one more frame. + this.cachedFrames.length = cacheFrameCount; + for (var i = 0, l = this.cacheFrames.length; i < l; ++i) { + this.cachedFrames[i] = false; + } + for (var _i = 0, _a = this.parent.sortedBones; _i < _a.length; _i++) { + var bone = _a[_i]; + var indices = new Array(cacheFrameCount); + for (var i = 0, l = indices.length; i < l; ++i) { + indices[i] = -1; + } + this.boneCachedFrameIndices[bone.name] = indices; + } + for (var _b = 0, _c = this.parent.sortedSlots; _b < _c.length; _b++) { + var slot = _c[_b]; + var indices = new Array(cacheFrameCount); + for (var i = 0, l = indices.length; i < l; ++i) { + indices[i] = -1; + } + this.slotCachedFrameIndices[slot.name] = indices; + } + }; + /** + * @private + */ + AnimationData.prototype.addBoneTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : (this.boneTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addSlotTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : (this.slotTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addConstraintTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : (this.constraintTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addAnimationTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.animationTimelines ? this.animationTimelines[timelineName] : (this.animationTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.getBoneTimelines = function (timelineName) { + return timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getSlotTimelines = function (timelineName) { + return timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getConstraintTimelines = function (timelineName) { + return timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getAnimationTimelines = function (timelineName) { + return timelineName in this.animationTimelines ? this.animationTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getBoneCachedFrameIndices = function (boneName) { + return boneName in this.boneCachedFrameIndices ? this.boneCachedFrameIndices[boneName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getSlotCachedFrameIndices = function (slotName) { + return slotName in this.slotCachedFrameIndices ? this.slotCachedFrameIndices[slotName] : null; + }; + return AnimationData; + }(dragonBones.BaseObject)); + dragonBones.AnimationData = AnimationData; + /** + * @private + */ + var TimelineData = /** @class */ (function (_super) { + __extends(TimelineData, _super); + function TimelineData() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimelineData.toString = function () { + return "[class dragonBones.TimelineData]"; + }; + TimelineData.prototype._onClear = function () { + this.type = 10 /* BoneAll */; + this.offset = 0; + this.frameIndicesOffset = -1; + }; + return TimelineData; + }(dragonBones.BaseObject)); + dragonBones.TimelineData = TimelineData; + /** + * @internal + */ + var AnimationTimelineData = /** @class */ (function (_super) { + __extends(AnimationTimelineData, _super); + function AnimationTimelineData() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationTimelineData.toString = function () { + return "[class dragonBones.AnimationTimelineData]"; + }; + AnimationTimelineData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.x = 0.0; + this.y = 0.0; + }; + return AnimationTimelineData; + }(TimelineData)); + dragonBones.AnimationTimelineData = AnimationTimelineData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation config is used to describe all the information needed to play an animation state. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画配置用来描述播放一个动画状态所需要的全部信息。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + var AnimationConfig = /** @class */ (function (_super) { + __extends(AnimationConfig, _super); + function AnimationConfig() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.boneMask = []; + return _this; + } + AnimationConfig.toString = function () { + return "[class dragonBones.AnimationConfig]"; + }; + AnimationConfig.prototype._onClear = function () { + this.pauseFadeOut = true; + this.fadeOutMode = 4 /* All */; + this.fadeOutTweenType = 1 /* Line */; + this.fadeOutTime = -1.0; + this.actionEnabled = true; + this.additive = false; + this.displayControl = true; + this.pauseFadeIn = true; + this.resetToPose = true; + this.fadeInTweenType = 1 /* Line */; + this.playTimes = -1; + this.layer = 0; + this.position = 0.0; + this.duration = -1.0; + this.timeScale = -100.0; + this.weight = 1.0; + this.fadeInTime = -1.0; + this.autoFadeOutTime = -1.0; + this.name = ""; + this.animation = ""; + this.group = ""; + this.boneMask.length = 0; + }; + /** + * @private + */ + AnimationConfig.prototype.clear = function () { + this._onClear(); + }; + /** + * @private + */ + AnimationConfig.prototype.copyFrom = function (value) { + this.pauseFadeOut = value.pauseFadeOut; + this.fadeOutMode = value.fadeOutMode; + this.autoFadeOutTime = value.autoFadeOutTime; + this.fadeOutTweenType = value.fadeOutTweenType; + this.actionEnabled = value.actionEnabled; + this.additive = value.additive; + this.displayControl = value.displayControl; + this.pauseFadeIn = value.pauseFadeIn; + this.resetToPose = value.resetToPose; + this.playTimes = value.playTimes; + this.layer = value.layer; + this.position = value.position; + this.duration = value.duration; + this.timeScale = value.timeScale; + this.fadeInTime = value.fadeInTime; + this.fadeOutTime = value.fadeOutTime; + this.fadeInTweenType = value.fadeInTweenType; + this.weight = value.weight; + this.name = value.name; + this.animation = value.animation; + this.group = value.group; + this.boneMask.length = value.boneMask.length; + for (var i = 0, l = this.boneMask.length; i < l; ++i) { + this.boneMask[i] = value.boneMask[i]; + } + }; + return AnimationConfig; + }(dragonBones.BaseObject)); + dragonBones.AnimationConfig = AnimationConfig; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var TextureAtlasData = /** @class */ (function (_super) { + __extends(TextureAtlasData, _super); + function TextureAtlasData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.textures = {}; + return _this; + } + TextureAtlasData.prototype._onClear = function () { + for (var k in this.textures) { + this.textures[k].returnToPool(); + delete this.textures[k]; + } + this.autoSearch = false; + this.width = 0; + this.height = 0; + this.scale = 1.0; + // this.textures.clear(); + this.name = ""; + this.imagePath = ""; + }; + /** + * @private + */ + TextureAtlasData.prototype.copyFrom = function (value) { + this.autoSearch = value.autoSearch; + this.scale = value.scale; + this.width = value.width; + this.height = value.height; + this.name = value.name; + this.imagePath = value.imagePath; + for (var k in this.textures) { + this.textures[k].returnToPool(); + delete this.textures[k]; + } + // this.textures.clear(); + for (var k in value.textures) { + var texture = this.createTexture(); + texture.copyFrom(value.textures[k]); + this.textures[k] = texture; + } + }; + /** + * @internal + */ + TextureAtlasData.prototype.addTexture = function (value) { + if (value.name in this.textures) { + console.warn("Same texture: " + value.name); + return; + } + value.parent = this; + this.textures[value.name] = value; + }; + /** + * @private + */ + TextureAtlasData.prototype.getTexture = function (textureName) { + return textureName in this.textures ? this.textures[textureName] : null; + }; + return TextureAtlasData; + }(dragonBones.BaseObject)); + dragonBones.TextureAtlasData = TextureAtlasData; + /** + * @private + */ + var TextureData = /** @class */ (function (_super) { + __extends(TextureData, _super); + function TextureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.region = new dragonBones.Rectangle(); + _this.frame = null; // Initial value. + return _this; + } + TextureData.createRectangle = function () { + return new dragonBones.Rectangle(); + }; + TextureData.prototype._onClear = function () { + this.rotated = false; + this.name = ""; + this.region.clear(); + this.parent = null; // + this.frame = null; + }; + TextureData.prototype.copyFrom = function (value) { + this.rotated = value.rotated; + this.name = value.name; + this.region.copyFrom(value.region); + this.parent = value.parent; + if (this.frame === null && value.frame !== null) { + this.frame = TextureData.createRectangle(); + } + else if (this.frame !== null && value.frame === null) { + this.frame = null; + } + if (this.frame !== null && value.frame !== null) { + this.frame.copyFrom(value.frame); + } + }; + return TextureData; + }(dragonBones.BaseObject)); + dragonBones.TextureData = TextureData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones_1) { + /** + * - Armature is the core of the skeleton animation system. + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架是骨骼动画系统的核心。 + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + var Armature = /** @class */ (function (_super) { + __extends(Armature, _super); + function Armature() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._bones = []; + _this._slots = []; + /** + * @internal + */ + _this._constraints = []; + _this._actions = []; + _this._animation = null; // Initial value. + _this._proxy = null; // Initial value. + /** + * @internal + */ + _this._replaceTextureAtlasData = null; // Initial value. + _this._clock = null; // Initial value. + return _this; + } + Armature.toString = function () { + return "[class dragonBones.Armature]"; + }; + Armature._onSortSlots = function (a, b) { + return a._zIndex * 1000 + a._zOrder > b._zIndex * 1000 + b._zOrder ? 1 : -1; + }; + Armature.prototype._onClear = function () { + if (this._clock !== null) { // Remove clock first. + this._clock.remove(this); + } + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + bone.returnToPool(); + } + for (var _b = 0, _c = this._slots; _b < _c.length; _b++) { + var slot = _c[_b]; + slot.returnToPool(); + } + for (var _d = 0, _e = this._constraints; _d < _e.length; _d++) { + var constraint = _e[_d]; + constraint.returnToPool(); + } + for (var _f = 0, _g = this._actions; _f < _g.length; _f++) { + var action = _g[_f]; + action.returnToPool(); + } + if (this._animation !== null) { + this._animation.returnToPool(); + } + if (this._proxy !== null) { + this._proxy.dbClear(); + } + if (this._replaceTextureAtlasData !== null) { + this._replaceTextureAtlasData.returnToPool(); + } + this.inheritAnimation = true; + this.userData = null; + this._lockUpdate = false; + this._slotsDirty = true; + this._zOrderDirty = false; + this._zIndexDirty = false; + this._alphaDirty = true; + this._flipX = false; + this._flipY = false; + this._cacheFrameIndex = -1; + this._alpha = 1.0; + this._globalAlpha = 1.0; + this._bones.length = 0; + this._slots.length = 0; + this._constraints.length = 0; + this._actions.length = 0; + this._armatureData = null; // + this._animation = null; // + this._proxy = null; // + this._display = null; + this._replaceTextureAtlasData = null; + this._replacedTexture = null; + this._dragonBones = null; // + this._clock = null; + this._parent = null; + }; + /** + * @internal + */ + Armature.prototype._sortZOrder = function (slotIndices, offset) { + var slotDatas = this._armatureData.sortedSlots; + var isOriginal = slotIndices === null; + if (this._zOrderDirty || !isOriginal) { + for (var i = 0, l = slotDatas.length; i < l; ++i) { + var slotIndex = isOriginal ? i : slotIndices[offset + i]; + if (slotIndex < 0 || slotIndex >= l) { + continue; + } + var slotData = slotDatas[slotIndex]; + var slot = this.getSlot(slotData.name); + if (slot !== null) { + slot._setZOrder(i); + } + } + this._slotsDirty = true; + this._zOrderDirty = !isOriginal; + } + }; + /** + * @internal + */ + Armature.prototype._addBone = function (value) { + if (this._bones.indexOf(value) < 0) { + this._bones.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._addSlot = function (value) { + if (this._slots.indexOf(value) < 0) { + this._slots.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._addConstraint = function (value) { + if (this._constraints.indexOf(value) < 0) { + this._constraints.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._bufferAction = function (action, append) { + if (this._actions.indexOf(action) < 0) { + if (append) { + this._actions.push(action); + } + else { + this._actions.unshift(action); + } + } + }; + /** + * - Dispose the armature. (Return to the object pool) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 释放骨架。 (回收到对象池) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.dispose = function () { + if (this._armatureData !== null) { + this._lockUpdate = true; + this._dragonBones.bufferObject(this); + } + }; + /** + * @internal + */ + Armature.prototype.init = function (armatureData, proxy, display, dragonBones) { + if (this._armatureData !== null) { + return; + } + this._armatureData = armatureData; + this._animation = dragonBones_1.BaseObject.borrowObject(dragonBones_1.Animation); + this._proxy = proxy; + this._display = display; + this._dragonBones = dragonBones; + this._proxy.dbInit(this); + this._animation.init(this); + this._animation.animations = this._armatureData.animations; + }; + /** + * @inheritDoc + */ + Armature.prototype.advanceTime = function (passedTime) { + if (this._lockUpdate) { + return; + } + this._lockUpdate = true; + if (this._armatureData === null) { + console.warn("The armature has been disposed."); + return; + } + else if (this._armatureData.parent === null) { + console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear()."); + return; + } + var prevCacheFrameIndex = this._cacheFrameIndex; + // Update animation. + this._animation.advanceTime(passedTime); + // Sort slots. + if (this._slotsDirty || this._zIndexDirty) { + this._slots.sort(Armature._onSortSlots); + if (this._zIndexDirty) { + for (var i = 0, l = this._slots.length; i < l; ++i) { + this._slots[i]._setZOrder(i); // + } + } + this._slotsDirty = false; + this._zIndexDirty = false; + } + // Update alpha. + if (this._alphaDirty) { + this._alphaDirty = false; + this._globalAlpha = this._alpha * (this._parent !== null ? this._parent._globalAlpha : 1.0); + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + bone._updateAlpha(); + } + for (var _b = 0, _c = this._slots; _b < _c.length; _b++) { + var slot = _c[_b]; + slot._updateAlpha(); + } + } + // Update bones and slots. + if (this._cacheFrameIndex < 0 || this._cacheFrameIndex !== prevCacheFrameIndex) { + var i = 0, l = 0; + for (i = 0, l = this._bones.length; i < l; ++i) { + this._bones[i].update(this._cacheFrameIndex); + } + for (i = 0, l = this._slots.length; i < l; ++i) { + this._slots[i].update(this._cacheFrameIndex); + } + } + // Do actions. + if (this._actions.length > 0) { + for (var _d = 0, _e = this._actions; _d < _e.length; _d++) { + var action = _e[_d]; + var actionData = action.actionData; + if (actionData !== null) { + if (actionData.type === 0 /* Play */) { + if (action.slot !== null) { + var childArmature = action.slot.childArmature; + if (childArmature !== null) { + childArmature.animation.fadeIn(actionData.name); + } + } + else if (action.bone !== null) { + for (var _f = 0, _g = this.getSlots(); _f < _g.length; _f++) { + var slot = _g[_f]; + if (slot.parent === action.bone) { + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.animation.fadeIn(actionData.name); + } + } + } + } + else { + this._animation.fadeIn(actionData.name); + } + } + } + action.returnToPool(); + } + this._actions.length = 0; + } + this._lockUpdate = false; + this._proxy.dbUpdate(); + }; + /** + * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. + * @param boneName - The bone name. (If not set, all bones will be update) + * @param updateSlot - Whether to update the bone's slots. (Default: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 + * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) + * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.invalidUpdate = function (boneName, updateSlot) { + if (boneName === void 0) { boneName = null; } + if (updateSlot === void 0) { updateSlot = false; } + if (boneName !== null && boneName.length > 0) { + var bone = this.getBone(boneName); + if (bone !== null) { + bone.invalidUpdate(); + if (updateSlot) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.parent === bone) { + slot.invalidUpdate(); + } + } + } + } + } + else { + for (var _b = 0, _c = this._bones; _b < _c.length; _b++) { + var bone = _c[_b]; + bone.invalidUpdate(); + } + if (updateSlot) { + for (var _d = 0, _e = this._slots; _d < _e.length; _d++) { + var slot = _e[_d]; + slot.invalidUpdate(); + } + } + } + }; + /** + * - Check whether a specific point is inside a custom bounding box in a slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在某个插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Armature.prototype.containsPoint = function (x, y) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.containsPoint(x, y)) { + return slot; + } + } + return null; + }; + /** + * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Armature.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var isV = xA === xB; + var dMin = 0.0; + var dMax = 0.0; + var intXA = 0.0; + var intYA = 0.0; + var intXB = 0.0; + var intYB = 0.0; + var intAN = 0.0; + var intBN = 0.0; + var intSlotA = null; + var intSlotB = null; + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var intersectionCount = slot.intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); + if (intersectionCount > 0) { + if (intersectionPointA !== null || intersectionPointB !== null) { + if (intersectionPointA !== null) { + var d = isV ? intersectionPointA.y - yA : intersectionPointA.x - xA; + if (d < 0.0) { + d = -d; + } + if (intSlotA === null || d < dMin) { + dMin = d; + intXA = intersectionPointA.x; + intYA = intersectionPointA.y; + intSlotA = slot; + if (normalRadians) { + intAN = normalRadians.x; + } + } + } + if (intersectionPointB !== null) { + var d = intersectionPointB.x - xA; + if (d < 0.0) { + d = -d; + } + if (intSlotB === null || d > dMax) { + dMax = d; + intXB = intersectionPointB.x; + intYB = intersectionPointB.y; + intSlotB = slot; + if (normalRadians !== null) { + intBN = normalRadians.y; + } + } + } + } + else { + intSlotA = slot; + break; + } + } + } + if (intSlotA !== null && intersectionPointA !== null) { + intersectionPointA.x = intXA; + intersectionPointA.y = intYA; + if (normalRadians !== null) { + normalRadians.x = intAN; + } + } + if (intSlotB !== null && intersectionPointB !== null) { + intersectionPointB.x = intXB; + intersectionPointB.y = intYB; + if (normalRadians !== null) { + normalRadians.y = intBN; + } + } + return intSlotA; + }; + /** + * - Get a specific bone. + * @param name - The bone name. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼。 + * @param name - 骨骼名称。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBone = function (name) { + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + if (bone.name === name) { + return bone; + } + } + return null; + }; + /** + * - Get a specific bone by the display. + * @param display - The display object. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的骨骼。 + * @param display - 显示对象。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBoneByDisplay = function (display) { + var slot = this.getSlotByDisplay(display); + return slot !== null ? slot.parent : null; + }; + /** + * - Get a specific slot. + * @param name - The slot name. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽。 + * @param name - 插槽名称。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlot = function (name) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.name === name) { + return slot; + } + } + return null; + }; + /** + * - Get a specific slot by the display. + * @param display - The display object. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的插槽。 + * @param display - 显示对象。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlotByDisplay = function (display) { + if (display !== null) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.display === display) { + return slot; + } + } + } + return null; + }; + /** + * - Get all bones. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBones = function () { + return this._bones; + }; + /** + * - Get all slots. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的插槽。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlots = function () { + return this._slots; + }; + Object.defineProperty(Armature.prototype, "flipX", { + /** + * - Whether to flip the armature horizontally. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架水平翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + get: function () { + return this._flipX; + }, + set: function (value) { + if (this._flipX === value) { + return; + } + this._flipX = value; + this.invalidUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "flipY", { + /** + * - Whether to flip the armature vertically. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架垂直翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + get: function () { + return this._flipY; + }, + set: function (value) { + if (this._flipY === value) { + return; + } + this._flipY = value; + this.invalidUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "cacheFrameRate", { + /** + * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. + * There is a certain amount of memory overhead to improve performance by caching animation data in memory. + * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. + * When the animation cache is turned on, some features will fail, such as the offset property of bone. + * @example + *
+             *     armature.cacheFrameRate = 24;
+             * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 + * @example + *
+             *     armature.cacheFrameRate = 24;
+             * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._armatureData.cacheFrameRate; + }, + set: function (value) { + if (this._armatureData.cacheFrameRate !== value) { + this._armatureData.cacheFrames(value); + // Set child armature frameRate. + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.cacheFrameRate = value; + } + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "name", { + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._armatureData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "armatureData", { + /** + * - The armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._armatureData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "animation", { + /** + * - The animation player. + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._animation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "proxy", { + /** + * @pivate + */ + get: function () { + return this._proxy; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "eventDispatcher", { + /** + * - The EventDispatcher instance of the armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架的 EventDispatcher 实例。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._proxy; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "display", { + /** + * - The display container. + * The display of the slot is displayed as the parent. + * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 显示容器实例。 + * 插槽的显示对象都会以此显示容器为父级。 + * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._display; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "replacedTexture", { + /** + * @private + */ + get: function () { + return this._replacedTexture; + }, + set: function (value) { + if (this._replacedTexture === value) { + return; + } + if (this._replaceTextureAtlasData !== null) { + this._replaceTextureAtlasData.returnToPool(); + this._replaceTextureAtlasData = null; + } + this._replacedTexture = value; + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + slot.invalidUpdate(); + slot.update(-1); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "clock", { + /** + * @inheritDoc + */ + get: function () { + return this._clock; + }, + set: function (value) { + if (this._clock === value) { + return; + } + if (this._clock !== null) { + this._clock.remove(this); + } + this._clock = value; + if (this._clock) { + this._clock.add(this); + } + // Update childArmature clock. + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.clock = this._clock; + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "parent", { + /** + * - Get the parent slot which the armature belongs to. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架所属的父插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Armature.prototype.getDisplay = function () { + return this._display; + }; + return Armature; + }(dragonBones_1.BaseObject)); + dragonBones_1.Armature = Armature; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The base class of the transform object. + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 变换对象的基类。 + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language zh_CN + */ + var TransformObject = /** @class */ (function (_super) { + __extends(TransformObject, _super); + function TransformObject() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - A matrix relative to the armature coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.globalTransformMatrix = new dragonBones.Matrix(); + /** + * - A transform relative to the armature coordinate system. + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的变换。 + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.global = new dragonBones.Transform(); + /** + * - The offset transform relative to the armature or the parent bone coordinate system. + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架或父骨骼坐标系的偏移变换。 + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.offset = new dragonBones.Transform(); + return _this; + } + /** + */ + TransformObject.prototype._onClear = function () { + this.globalTransformMatrix.identity(); + this.global.identity(); + this.offset.identity(); + this.origin = null; + this.userData = null; + this._globalDirty = false; + this._alpha = 1.0; + this._globalAlpha = 1.0; + this._armature = null; // + }; + /** + * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, + * some engines do not rely on these attributes to update rendering, such as Egret. + * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 + * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + TransformObject.prototype.updateGlobalTransform = function () { + if (this._globalDirty) { + this._globalDirty = false; + this.global.fromMatrix(this.globalTransformMatrix); + } + }; + Object.defineProperty(TransformObject.prototype, "armature", { + /** + * - The armature to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的骨架。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._armature; + }, + enumerable: true, + configurable: true + }); + TransformObject._helpMatrix = new dragonBones.Matrix(); + TransformObject._helpTransform = new dragonBones.Transform(); + TransformObject._helpPoint = new dragonBones.Point(); + return TransformObject; + }(dragonBones.BaseObject)); + dragonBones.TransformObject = TransformObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Bone is one of the most important logical units in the armature animation system, + * and is responsible for the realization of translate, rotation, scaling in the animations. + * A armature can contain multiple bones. + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 + * 一个骨架中可以包含多个骨骼。 + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + var Bone = /** @class */ (function (_super) { + __extends(Bone, _super); + function Bone() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @internal + */ + _this.animationPose = new dragonBones.Transform(); + return _this; + } + Bone.toString = function () { + return "[class dragonBones.Bone]"; + }; + Bone.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.offsetMode = 1 /* Additive */; + this.animationPose.identity(); + this._transformDirty = false; + this._childrenTransformDirty = false; + this._localDirty = true; + this._hasConstraint = false; + this._visible = true; + this._cachedFrameIndex = -1; + this._boneData = null; // + this._parent = null; // + this._cachedFrameIndices = null; + }; + Bone.prototype._updateGlobalTransformMatrix = function (isCache) { + // For typescript. + var boneData = this._boneData; + var global = this.global; + var globalTransformMatrix = this.globalTransformMatrix; + var origin = this.origin; + var offset = this.offset; + var animationPose = this.animationPose; + var parent = this._parent; // + var flipX = this._armature.flipX; + var flipY = this._armature.flipY === dragonBones.DragonBones.yDown; + var inherit = parent !== null; + var rotation = 0.0; + if (this.offsetMode === 1 /* Additive */) { + if (origin !== null) { + // global.copyFrom(this.origin).add(this.offset).add(this.animationPose); + global.x = origin.x + offset.x + animationPose.x; + global.scaleX = origin.scaleX * offset.scaleX * animationPose.scaleX; + global.scaleY = origin.scaleY * offset.scaleY * animationPose.scaleY; + if (dragonBones.DragonBones.yDown) { + global.y = origin.y + offset.y + animationPose.y; + global.skew = origin.skew + offset.skew + animationPose.skew; + global.rotation = origin.rotation + offset.rotation + animationPose.rotation; + } + else { + global.y = origin.y - offset.y + animationPose.y; + global.skew = origin.skew - offset.skew + animationPose.skew; + global.rotation = origin.rotation - offset.rotation + animationPose.rotation; + } + } + else { + global.copyFrom(offset); + if (!dragonBones.DragonBones.yDown) { + global.y = -global.y; + global.skew = -global.skew; + global.rotation = -global.rotation; + } + global.add(animationPose); + } + } + else if (this.offsetMode === 0 /* None */) { + if (origin !== null) { + global.copyFrom(origin).add(animationPose); + } + else { + global.copyFrom(animationPose); + } + } + else { + inherit = false; + global.copyFrom(offset); + if (!dragonBones.DragonBones.yDown) { + global.y = -global.y; + global.skew = -global.skew; + global.rotation = -global.rotation; + } + } + if (inherit) { + var isSurface = parent._boneData.type === 1 /* Surface */; + var surfaceBone = isSurface ? parent._bone : null; + var parentMatrix = isSurface ? parent._getGlobalTransformMatrix(global.x, global.y) : parent.globalTransformMatrix; + if (boneData.inheritScale && (!isSurface || surfaceBone !== null)) { + if (isSurface) { + if (boneData.inheritRotation) { + global.rotation += parent.global.rotation; + } + surfaceBone.updateGlobalTransform(); + global.scaleX *= surfaceBone.global.scaleX; + global.scaleY *= surfaceBone.global.scaleY; + parentMatrix.transformPoint(global.x, global.y, global); + global.toMatrix(globalTransformMatrix); + if (boneData.inheritTranslation) { + global.x = globalTransformMatrix.tx; + global.y = globalTransformMatrix.ty; + } + else { + globalTransformMatrix.tx = global.x; + globalTransformMatrix.ty = global.y; + } + } + else { + if (!boneData.inheritRotation) { + parent.updateGlobalTransform(); + if (flipX && flipY) { + rotation = global.rotation - (parent.global.rotation + Math.PI); + } + else if (flipX) { + rotation = global.rotation + parent.global.rotation + Math.PI; + } + else if (flipY) { + rotation = global.rotation + parent.global.rotation; + } + else { + rotation = global.rotation - parent.global.rotation; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + globalTransformMatrix.concat(parentMatrix); + if (boneData.inheritTranslation) { + global.x = globalTransformMatrix.tx; + global.y = globalTransformMatrix.ty; + } + else { + globalTransformMatrix.tx = global.x; + globalTransformMatrix.ty = global.y; + } + if (isCache) { + global.fromMatrix(globalTransformMatrix); + } + else { + this._globalDirty = true; + } + } + } + else { + if (boneData.inheritTranslation) { + var x = global.x; + var y = global.y; + global.x = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + global.y = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + } + else { + if (flipX) { + global.x = -global.x; + } + if (flipY) { + global.y = -global.y; + } + } + if (boneData.inheritRotation) { + parent.updateGlobalTransform(); + if (parent.global.scaleX < 0.0) { + rotation = global.rotation + parent.global.rotation + Math.PI; + } + else { + rotation = global.rotation + parent.global.rotation; + } + if (parentMatrix.a * parentMatrix.d - parentMatrix.b * parentMatrix.c < 0.0) { + rotation -= global.rotation * 2.0; + if (flipX !== flipY || boneData.inheritReflection) { + global.skew += Math.PI; + } + if (!dragonBones.DragonBones.yDown) { + global.skew = -global.skew; + } + } + global.rotation = rotation; + } + else if (flipX || flipY) { + if (flipX && flipY) { + rotation = global.rotation + Math.PI; + } + else { + if (flipX) { + rotation = Math.PI - global.rotation; + } + else { + rotation = -global.rotation; + } + global.skew += Math.PI; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + } + } + else { + if (flipX || flipY) { + if (flipX) { + global.x = -global.x; + } + if (flipY) { + global.y = -global.y; + } + if (flipX && flipY) { + rotation = global.rotation + Math.PI; + } + else { + if (flipX) { + rotation = Math.PI - global.rotation; + } + else { + rotation = -global.rotation; + } + global.skew += Math.PI; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + } + }; + /** + * @internal + */ + Bone.prototype._updateAlpha = function () { + if (this._parent !== null) { + this._globalAlpha = this._alpha * this._parent._globalAlpha; + } + else { + this._globalAlpha = this._alpha * this._armature._globalAlpha; + } + }; + /** + * @internal + */ + Bone.prototype.init = function (boneData, armatureValue) { + if (this._boneData !== null) { + return; + } + this._boneData = boneData; + this._armature = armatureValue; + this._alpha = this._boneData.alpha; + if (this._boneData.parent !== null) { + this._parent = this._armature.getBone(this._boneData.parent.name); + } + this._armature._addBone(this); + // + this.origin = this._boneData.transform; + }; + /** + * @internal + */ + Bone.prototype.update = function (cacheFrameIndex) { + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache. + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { // Has been Cached. + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || + (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet. + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) { + var constraint = _c[_b]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + if (this._transformDirty) { + this._transformDirty = false; + this._childrenTransformDirty = true; + // + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + if (this._localDirty) { + this._updateGlobalTransformMatrix(isCache); + } + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + // + } + else if (this._childrenTransformDirty) { + this._childrenTransformDirty = false; + } + this._localDirty = true; + }; + /** + * @internal + */ + Bone.prototype.updateByConstraint = function () { + if (this._localDirty) { + this._localDirty = false; + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { + this._updateGlobalTransformMatrix(true); + } + this._transformDirty = true; + } + }; + /** + * - Forces the bone to update the transform in the next frame. + * When the bone is not animated or its animation state is finished, the bone will not continue to update, + * and when the skeleton must be updated for some reason, the method needs to be called explicitly. + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制骨骼在下一帧更新变换。 + * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Bone.prototype.invalidUpdate = function () { + this._transformDirty = true; + }; + /** + * - Check whether the bone contains a specific bone. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查该骨骼是否包含特定的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Bone.prototype.contains = function (value) { + if (value === this) { + return false; + } + var ancestor = value; + while (ancestor !== this && ancestor !== null) { + ancestor = ancestor.parent; + } + return ancestor === this; + }; + Object.defineProperty(Bone.prototype, "boneData", { + /** + * - The bone data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._boneData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "visible", { + /** + * - The visible of all slots in the bone. + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 此骨骼所有插槽的可见。 + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._visible; + }, + set: function (value) { + if (this._visible === value) { + return; + } + this._visible = value; + for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.parent === this) { + slot._updateVisible(); + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "name", { + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._boneData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "parent", { + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return Bone; + }(dragonBones.TransformObject)); + dragonBones.Bone = Bone; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var Surface = /** @class */ (function (_super) { + __extends(Surface, _super); + function Surface() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._vertices = []; + _this._deformVertices = []; + /** + * - x1, y1, x2, y2, x3, y3, x4, y4, d1X, d1Y, d2X, d2Y + */ + _this._hullCache = []; + /** + * - Inside [flag, a, b, c, d, tx, ty], Outside [flag, a, b, c, d, tx, ty] + */ + _this._matrixCahce = []; + return _this; + } + Surface.toString = function () { + return "[class dragonBones.Surface]"; + }; + Surface.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._dX = 0.0; + this._dY = 0.0; + this._k = 0.0; + this._kX = 0.0; + this._kY = 0.0; + this._vertices.length = 0; + this._deformVertices.length = 0; + this._matrixCahce.length = 0; + this._hullCache.length = 0; + this._bone = null; + }; + Surface.prototype._getAffineTransform = function (x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown) { + var dabX = bX - aX; + var dabY = bY - aY; + var dacX = cX - aX; + var dacY = cY - aY; + transform.rotation = Math.atan2(dabY, dabX); + transform.skew = Math.atan2(dacY, dacX) - Math.PI * 0.5 - transform.rotation; + if (isDown) { + transform.rotation += Math.PI; + } + transform.scaleX = Math.sqrt(dabX * dabX + dabY * dabY) / lX; + transform.scaleY = Math.sqrt(dacX * dacX + dacY * dacY) / lY; + transform.toMatrix(matrix); + transform.x = matrix.tx = aX - (matrix.a * x + matrix.c * y); + transform.y = matrix.ty = aY - (matrix.b * x + matrix.d * y); + }; + Surface.prototype._updateVertices = function () { + var data = this._armature.armatureData.parent; + var geometry = this._boneData.geometry; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometry.offset + 0 /* GeometryVertexCount */]; + var verticesOffset = intArray[geometry.offset + 2 /* GeometryFloatOffset */]; + var vertices = this._vertices; + var animationVertices = this._deformVertices; + if (this._parent !== null) { + if (this._parent._boneData.type === 1 /* Surface */) { + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + var x = floatArray[verticesOffset + iD] + animationVertices[iD]; + var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + var matrix = this._parent._getGlobalTransformMatrix(x, y); + // + vertices[iD] = matrix.a * x + matrix.c * y + matrix.tx; + vertices[iD + 1] = matrix.b * x + matrix.d * y + matrix.ty; + } + } + else { + var parentMatrix = this._parent.globalTransformMatrix; + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + var x = floatArray[verticesOffset + iD] + animationVertices[iD]; + var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + // + vertices[iD] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + vertices[iD + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + } + } + } + else { + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + vertices[iD] = floatArray[verticesOffset + iD] + animationVertices[iD]; + vertices[iD + 1] = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + } + } + }; + Surface.prototype._updateGlobalTransformMatrix = function (isCache) { + // tslint:disable-next-line:no-unused-expression + isCache; + var segmentXD = this._boneData.segmentX * 2; + var lastIndex = this._vertices.length - 2; + var lA = 200.0; + // + var raX = this._vertices[0]; + var raY = this._vertices[1]; + var rbX = this._vertices[segmentXD]; + var rbY = this._vertices[segmentXD + 1]; + var rcX = this._vertices[lastIndex]; + var rcY = this._vertices[lastIndex + 1]; + var rdX = this._vertices[lastIndex - segmentXD]; + var rdY = this._vertices[lastIndex - segmentXD + 1]; + // + var dacX = raX + (rcX - raX) * 0.5; + var dacY = raY + (rcY - raY) * 0.5; + var dbdX = rbX + (rdX - rbX) * 0.5; + var dbdY = rbY + (rdY - rbY) * 0.5; + var aX = dacX + (dbdX - dacX) * 0.5; + var aY = dacY + (dbdY - dacY) * 0.5; + var bX = rbX + (rcX - rbX) * 0.5; + var bY = rbY + (rcY - rbY) * 0.5; + var cX = rdX + (rcX - rdX) * 0.5; + var cY = rdY + (rcY - rdY) * 0.5; + // TODO interpolation + this._getAffineTransform(0.0, 0.0, lA, lA, aX, aY, bX, bY, cX, cY, this.global, this.globalTransformMatrix, false); + this._globalDirty = false; + }; + Surface.prototype._getGlobalTransformMatrix = function (x, y) { + var lA = 200.0; + var lB = 1000.0; + if (x < -lB || lB < x || y < -lB || lB < y) { + return this.globalTransformMatrix; + } + var isDown = false; + var surfaceData = this._boneData; + var segmentX = surfaceData.segmentX; + var segmentY = surfaceData.segmentY; + var segmentXD = surfaceData.segmentX * 2; + var dX = this._dX; + var dY = this._dY; + var indexX = Math.floor((x + lA) / dX); // -1 ~ segmentX - 1 + var indexY = Math.floor((y + lA) / dY); // -1 ~ segmentY - 1 + var matrixIndex = 0; + var pX = indexX * dX - lA; + var pY = indexY * dY - lA; + // + var matrices = this._matrixCahce; + var helpMatrix = Surface._helpMatrix; + if (x < -lA) { + if (y < -lA || y >= lA) { // Out. + return this.globalTransformMatrix; + } + // Left. + isDown = y > this._kX * (x + lA) + pY; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexY * (segmentXD + 2); + var ddX = this._hullCache[4]; + var ddY = this._hullCache[5]; + var sX = this._hullCache[2] - (segmentY - indexY) * ddX; + var sY = this._hullCache[3] - (segmentY - indexY) * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(-lA, pY + dY, lB - lA, dY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], sX + ddX, sY + ddY, vertices[vertexIndex], vertices[vertexIndex + 1], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(-lB, pY, lB - lA, dY, sX, sY, vertices[vertexIndex], vertices[vertexIndex + 1], sX + ddX, sY + ddY, Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (x >= lA) { + if (y < -lA || y >= lA) { // Out. + return this.globalTransformMatrix; + } + // Right. + isDown = y > this._kX * (x - lB) + pY; + matrixIndex = ((segmentX * segmentY + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = (indexY + 1) * (segmentXD + 2) - 2; + var ddX = this._hullCache[4]; + var ddY = this._hullCache[5]; + var sX = this._hullCache[0] + indexY * ddX; + var sY = this._hullCache[1] + indexY * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(lB, pY + dY, lB - lA, dY, sX + ddX, sY + ddY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], sX, sY, Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(lA, pY, lB - lA, dY, vertices[vertexIndex], vertices[vertexIndex + 1], sX, sY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (y < -lA) { + if (x < -lA || x >= lA) { // Out. + return this.globalTransformMatrix; + } + // Up. + isDown = y > this._kY * (x - pX - dX) - lB; + matrixIndex = ((segmentX * segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexX * 2; + var ddX = this._hullCache[10]; + var ddY = this._hullCache[11]; + var sX = this._hullCache[8] + indexX * ddX; + var sY = this._hullCache[9] + indexX * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, -lA, dX, lB - lA, vertices[vertexIndex + 2], vertices[vertexIndex + 3], vertices[vertexIndex], vertices[vertexIndex + 1], sX + ddX, sY + ddY, Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, -lB, dX, lB - lA, sX, sY, sX + ddX, sY + ddY, vertices[vertexIndex], vertices[vertexIndex + 1], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (y >= lA) { + if (x < -lA || x >= lA) { // Out. + return this.globalTransformMatrix; + } + // Down + isDown = y > this._kY * (x - pX - dX) + lA; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = segmentY * (segmentXD + 2) + indexX * 2; + var ddX = this._hullCache[10]; + var ddY = this._hullCache[11]; + var sX = this._hullCache[6] - (segmentX - indexX) * ddX; + var sY = this._hullCache[7] - (segmentX - indexX) * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, lB, dX, lB - lA, sX + ddX, sY + ddY, sX, sY, vertices[vertexIndex + 2], vertices[vertexIndex + 3], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, lA, dX, lB - lA, vertices[vertexIndex], vertices[vertexIndex + 1], vertices[vertexIndex + 2], vertices[vertexIndex + 3], sX, sY, Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else { // Center. + isDown = y > this._k * (x - pX - dX) + pY; + matrixIndex = ((segmentX * indexY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexX * 2 + indexY * (segmentXD + 2); + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, pY + dY, dX, dY, vertices[vertexIndex + segmentXD + 4], vertices[vertexIndex + segmentXD + 5], vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], vertices[vertexIndex + 2], vertices[vertexIndex + 3], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, pY, dX, dY, vertices[vertexIndex], vertices[vertexIndex + 1], vertices[vertexIndex + 2], vertices[vertexIndex + 3], vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + return helpMatrix; + }; + /** + * @internal + * @private + */ + Surface.prototype.init = function (surfaceData, armatureValue) { + if (this._boneData !== null) { + return; + } + _super.prototype.init.call(this, surfaceData, armatureValue); + var segmentX = surfaceData.segmentX; + var segmentY = surfaceData.segmentY; + var vertexCount = this._armature.armatureData.parent.intArray[surfaceData.geometry.offset + 0 /* GeometryVertexCount */]; + var lB = 1000.0; + var lA = 200.0; + // + this._dX = lA * 2.0 / segmentX; + this._dY = lA * 2.0 / segmentY; + this._k = -this._dY / this._dX; + this._kX = -this._dY / (lB - lA); + this._kY = -(lB - lA) / this._dX; + this._vertices.length = vertexCount * 2; + this._deformVertices.length = vertexCount * 2; + this._matrixCahce.length = (segmentX * segmentY + segmentX * 2 + segmentY * 2) * 2 * 7; + this._hullCache.length = 10; + for (var i = 0; i < vertexCount * 2; ++i) { + this._deformVertices[i] = 0.0; + } + if (this._parent !== null) { + if (this._parent.boneData.type === 0 /* Bone */) { + this._bone = this._parent; + } + else { + this._bone = this._parent._bone; + } + } + }; + /** + * @internal + */ + Surface.prototype.update = function (cacheFrameIndex) { + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache. + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { // Has been Cached. + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || + (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet. + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) { + var constraint = _c[_b]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + if (this._transformDirty) { + this._transformDirty = false; + this._childrenTransformDirty = true; + // + for (var i = 0, l = this._matrixCahce.length; i < l; i += 7) { + this._matrixCahce[i] = -1.0; + } + // + this._updateVertices(); + // + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + if (this._localDirty) { + this._updateGlobalTransformMatrix(isCache); + } + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + // Update hull vertices. + var lB = 1000.0; + var lA = 200.0; + var ddX = 2 * this.global.x; + var ddY = 2 * this.global.y; + // + var helpPoint = Surface._helpPoint; + this.globalTransformMatrix.transformPoint(lB, -lA, helpPoint); + this._hullCache[0] = helpPoint.x; + this._hullCache[1] = helpPoint.y; + this._hullCache[2] = ddX - helpPoint.x; + this._hullCache[3] = ddY - helpPoint.y; + this.globalTransformMatrix.transformPoint(0.0, this._dY, helpPoint, true); + this._hullCache[4] = helpPoint.x; + this._hullCache[5] = helpPoint.y; + // + this.globalTransformMatrix.transformPoint(lA, lB, helpPoint); + this._hullCache[6] = helpPoint.x; + this._hullCache[7] = helpPoint.y; + this._hullCache[8] = ddX - helpPoint.x; + this._hullCache[9] = ddY - helpPoint.y; + this.globalTransformMatrix.transformPoint(this._dX, 0.0, helpPoint, true); + this._hullCache[10] = helpPoint.x; + this._hullCache[11] = helpPoint.y; + } + else if (this._childrenTransformDirty) { + this._childrenTransformDirty = false; + } + this._localDirty = true; + }; + return Surface; + }(dragonBones.Bone)); + dragonBones.Surface = Surface; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DisplayFrame = /** @class */ (function (_super) { + __extends(DisplayFrame, _super); + function DisplayFrame() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.deformVertices = []; + return _this; + } + DisplayFrame.toString = function () { + return "[class dragonBones.DisplayFrame]"; + }; + DisplayFrame.prototype._onClear = function () { + this.rawDisplayData = null; + this.displayData = null; + this.textureData = null; + this.display = null; + this.deformVertices.length = 0; + }; + DisplayFrame.prototype.updateDeformVertices = function () { + if (this.rawDisplayData === null || this.deformVertices.length !== 0) { + return; + } + var rawGeometryData; + if (this.rawDisplayData.type === 2 /* Mesh */) { + rawGeometryData = this.rawDisplayData.geometry; + } + else if (this.rawDisplayData.type === 4 /* Path */) { + rawGeometryData = this.rawDisplayData.geometry; + } + else { + return; + } + var vertexCount = 0; + if (rawGeometryData.weight !== null) { + vertexCount = rawGeometryData.weight.count * 2; + } + else { + vertexCount = rawGeometryData.data.intArray[rawGeometryData.offset + 0 /* GeometryVertexCount */] * 2; + } + this.deformVertices.length = vertexCount; + for (var i = 0, l = this.deformVertices.length; i < l; ++i) { + this.deformVertices[i] = 0.0; + } + }; + DisplayFrame.prototype.getGeometryData = function () { + if (this.displayData !== null) { + if (this.displayData.type === 2 /* Mesh */) { + return this.displayData.geometry; + } + if (this.displayData.type === 4 /* Path */) { + return this.displayData.geometry; + } + } + if (this.rawDisplayData !== null) { + if (this.rawDisplayData.type === 2 /* Mesh */) { + return this.rawDisplayData.geometry; + } + if (this.rawDisplayData.type === 4 /* Path */) { + return this.rawDisplayData.geometry; + } + } + return null; + }; + DisplayFrame.prototype.getBoundingBox = function () { + if (this.displayData !== null && this.displayData.type === 3 /* BoundingBox */) { + return this.displayData.boundingBox; + } + if (this.rawDisplayData !== null && this.rawDisplayData.type === 3 /* BoundingBox */) { + return this.rawDisplayData.boundingBox; + } + return null; + }; + DisplayFrame.prototype.getTextureData = function () { + if (this.displayData !== null) { + if (this.displayData.type === 0 /* Image */) { + return this.displayData.texture; + } + if (this.displayData.type === 2 /* Mesh */) { + return this.displayData.texture; + } + } + if (this.textureData !== null) { + return this.textureData; + } + if (this.rawDisplayData !== null) { + if (this.rawDisplayData.type === 0 /* Image */) { + return this.rawDisplayData.texture; + } + if (this.rawDisplayData.type === 2 /* Mesh */) { + return this.rawDisplayData.texture; + } + } + return null; + }; + return DisplayFrame; + }(dragonBones.BaseObject)); + dragonBones.DisplayFrame = DisplayFrame; + /** + * - The slot attached to the armature, controls the display status and properties of the display object. + * A bone can contain multiple slots. + * A slot can contain multiple display objects, displaying only one of the display objects at a time, + * but you can toggle the display object into frame animation while the animation is playing. + * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, + * and a custom other display object. + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language zh_CN + */ + var Slot = /** @class */ (function (_super) { + __extends(Slot, _super); + function Slot() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._localMatrix = new dragonBones.Matrix(); + /** + * @internal + */ + _this._colorTransform = new dragonBones.ColorTransform(); + /** + * @internal + */ + _this._displayFrames = []; + /** + * @internal + */ + _this._geometryBones = []; + _this._rawDisplay = null; // Initial value. + _this._meshDisplay = null; // Initial value. + _this._display = null; + return _this; + } + Slot.prototype._onClear = function () { + _super.prototype._onClear.call(this); + var disposeDisplayList = []; + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var dispayFrame = _a[_i]; + var display = dispayFrame.display; + if (display !== this._rawDisplay && display !== this._meshDisplay && + disposeDisplayList.indexOf(display) < 0) { + disposeDisplayList.push(display); + } + dispayFrame.returnToPool(); + } + for (var _b = 0, disposeDisplayList_1 = disposeDisplayList; _b < disposeDisplayList_1.length; _b++) { + var eachDisplay = disposeDisplayList_1[_b]; + if (eachDisplay instanceof dragonBones.Armature) { + eachDisplay.dispose(); + } + else { + this._disposeDisplay(eachDisplay, true); + } + } + if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) { // May be _meshDisplay and _rawDisplay is the same one. + this._disposeDisplay(this._meshDisplay, false); + } + if (this._rawDisplay !== null) { + this._disposeDisplay(this._rawDisplay, false); + } + this.displayController = null; + this._displayDataDirty = false; + this._displayDirty = false; + this._geometryDirty = false; + this._textureDirty = false; + this._visibleDirty = false; + this._blendModeDirty = false; + this._zOrderDirty = false; + this._colorDirty = false; + this._verticesDirty = false; + this._transformDirty = false; + this._visible = true; + this._blendMode = 0 /* Normal */; + this._displayIndex = -1; + this._animationDisplayIndex = -1; + this._zOrder = 0; + this._zIndex = 0; + this._cachedFrameIndex = -1; + this._pivotX = 0.0; + this._pivotY = 0.0; + this._localMatrix.identity(); + this._colorTransform.identity(); + this._displayFrames.length = 0; + this._geometryBones.length = 0; + this._slotData = null; // + this._displayFrame = null; + this._geometryData = null; + this._boundingBoxData = null; + this._textureData = null; + this._rawDisplay = null; + this._meshDisplay = null; + this._display = null; + this._childArmature = null; + this._parent = null; // + this._cachedFrameIndices = null; + }; + Slot.prototype._hasDisplay = function (display) { + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var displayFrame = _a[_i]; + if (displayFrame.display === display) { + return true; + } + } + return false; + }; + /** + * @internal + */ + Slot.prototype._isBonesUpdate = function () { + for (var _i = 0, _a = this._geometryBones; _i < _a.length; _i++) { + var bone = _a[_i]; + if (bone !== null && bone._childrenTransformDirty) { + return true; + } + } + return false; + }; + /** + * @internal + */ + Slot.prototype._updateAlpha = function () { + var globalAlpha = this._alpha * this._parent._globalAlpha; + if (this._globalAlpha !== globalAlpha) { + this._globalAlpha = globalAlpha; + this._colorDirty = true; + } + }; + Slot.prototype._updateDisplayData = function () { + var prevDisplayFrame = this._displayFrame; + var prevGeometryData = this._geometryData; + var prevTextureData = this._textureData; + var rawDisplayData = null; + var displayData = null; + this._displayFrame = null; + this._geometryData = null; + this._boundingBoxData = null; + this._textureData = null; + if (this._displayIndex >= 0 && this._displayIndex < this._displayFrames.length) { + this._displayFrame = this._displayFrames[this._displayIndex]; + rawDisplayData = this._displayFrame.rawDisplayData; + displayData = this._displayFrame.displayData; + this._geometryData = this._displayFrame.getGeometryData(); + this._boundingBoxData = this._displayFrame.getBoundingBox(); + this._textureData = this._displayFrame.getTextureData(); + } + if (this._displayFrame !== prevDisplayFrame || + this._geometryData !== prevGeometryData || this._textureData !== prevTextureData) { + // Update pivot offset. + if (this._geometryData === null && this._textureData !== null) { + var imageDisplayData = ((displayData !== null && displayData.type === 0 /* Image */) ? displayData : rawDisplayData); // + var scale = this._textureData.parent.scale * this._armature._armatureData.scale; + var frame = this._textureData.frame; + this._pivotX = imageDisplayData.pivot.x; + this._pivotY = imageDisplayData.pivot.y; + var rect = frame !== null ? frame : this._textureData.region; + var width = rect.width; + var height = rect.height; + if (this._textureData.rotated && frame === null) { + width = rect.height; + height = rect.width; + } + this._pivotX *= width * scale; + this._pivotY *= height * scale; + if (frame !== null) { + this._pivotX += frame.x * scale; + this._pivotY += frame.y * scale; + } + // Update replace pivot. TODO + if (rawDisplayData !== null && imageDisplayData !== rawDisplayData) { + rawDisplayData.transform.toMatrix(Slot._helpMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint); + this._pivotX -= Slot._helpPoint.x; + this._pivotY -= Slot._helpPoint.y; + imageDisplayData.transform.toMatrix(Slot._helpMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint); + this._pivotX += Slot._helpPoint.x; + this._pivotY += Slot._helpPoint.y; + } + if (!dragonBones.DragonBones.yDown) { + this._pivotY = (this._textureData.rotated ? this._textureData.region.width : this._textureData.region.height) * scale - this._pivotY; + } + } + else { + this._pivotX = 0.0; + this._pivotY = 0.0; + } + // Update original transform. + if (rawDisplayData !== null) { // Compatible. + this.origin = rawDisplayData.transform; + } + else if (displayData !== null) { // Compatible. + this.origin = displayData.transform; + } + else { + this.origin = null; + } + // TODO remove slot offset. + if (this.origin !== null) { + this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix); + } + else { + this.global.copyFrom(this.offset).toMatrix(this._localMatrix); + } + // Update geometry. + if (this._geometryData !== prevGeometryData) { + this._geometryDirty = true; + this._verticesDirty = true; + if (this._geometryData !== null) { + this._geometryBones.length = 0; + if (this._geometryData.weight !== null) { + for (var i = 0, l = this._geometryData.weight.bones.length; i < l; ++i) { + var bone = this._armature.getBone(this._geometryData.weight.bones[i].name); + this._geometryBones.push(bone); + } + } + } + else { + this._geometryBones.length = 0; + this._geometryData = null; + } + } + this._textureDirty = this._textureData !== prevTextureData; + this._transformDirty = true; + } + }; + Slot.prototype._updateDisplay = function () { + var prevDisplay = this._display !== null ? this._display : this._rawDisplay; + var prevChildArmature = this._childArmature; + // Update display and child armature. + if (this._displayFrame !== null) { + this._display = this._displayFrame.display; + if (this._display !== null && this._display instanceof dragonBones.Armature) { + this._childArmature = this._display; + this._display = this._childArmature.display; + } + else { + this._childArmature = null; + } + } + else { + this._display = null; + this._childArmature = null; + } + // Update display. + var currentDisplay = this._display !== null ? this._display : this._rawDisplay; + if (currentDisplay !== prevDisplay) { + this._textureDirty = true; + this._visibleDirty = true; + this._blendModeDirty = true; + // this._zOrderDirty = true; + this._colorDirty = true; + this._transformDirty = true; + this._onUpdateDisplay(); + this._replaceDisplay(prevDisplay); + } + // Update child armature. + if (this._childArmature !== prevChildArmature) { + if (prevChildArmature !== null) { + prevChildArmature._parent = null; // Update child armature parent. + prevChildArmature.clock = null; + if (prevChildArmature.inheritAnimation) { + prevChildArmature.animation.reset(); + } + } + if (this._childArmature !== null) { + this._childArmature._parent = this; // Update child armature parent. + this._childArmature.clock = this._armature.clock; + if (this._childArmature.inheritAnimation) { // Set child armature cache frameRate. + if (this._childArmature.cacheFrameRate === 0) { + var cacheFrameRate = this._armature.cacheFrameRate; + if (cacheFrameRate !== 0) { + this._childArmature.cacheFrameRate = cacheFrameRate; + } + } + // Child armature action. + if (this._displayFrame !== null) { + var actions = null; + var displayData = this._displayFrame.displayData !== null ? this._displayFrame.displayData : this._displayFrame.rawDisplayData; + if (displayData !== null && displayData.type === 1 /* Armature */) { + actions = displayData.actions; + } + if (actions !== null && actions.length > 0) { + for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) { + var action = actions_1[_i]; + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + eventObject.slot = this; + this._armature._bufferAction(eventObject, false); + } + } + else { + this._childArmature.animation.play(); + } + } + } + } + } + }; + Slot.prototype._updateGlobalTransformMatrix = function (isCache) { + var parentMatrix = this._parent._boneData.type === 0 /* Bone */ ? this._parent.globalTransformMatrix : this._parent._getGlobalTransformMatrix(this.global.x, this.global.y); + this.globalTransformMatrix.copyFrom(this._localMatrix); + this.globalTransformMatrix.concat(parentMatrix); + if (isCache) { + this.global.fromMatrix(this.globalTransformMatrix); + } + else { + this._globalDirty = true; + } + }; + /** + * @internal + */ + Slot.prototype._setDisplayIndex = function (value, isAnimation) { + if (isAnimation === void 0) { isAnimation = false; } + if (isAnimation) { + if (this._animationDisplayIndex === value) { + return; + } + this._animationDisplayIndex = value; + } + if (this._displayIndex === value) { + return; + } + this._displayIndex = value < this._displayFrames.length ? value : this._displayFrames.length - 1; + this._displayDataDirty = true; + this._displayDirty = this._displayIndex < 0 || this._display !== this._displayFrames[this._displayIndex].display; + }; + /** + * @internal + */ + Slot.prototype._setZOrder = function (value) { + if (this._zOrder === value) { + // return false; + } + this._zOrder = value; + this._zOrderDirty = true; + return this._zOrderDirty; + }; + /** + * @internal + */ + Slot.prototype._setColor = function (value) { + this._colorTransform.copyFrom(value); + return this._colorDirty = true; + }; + /** + * @internal + */ + Slot.prototype.init = function (slotData, armatureValue, rawDisplay, meshDisplay) { + if (this._slotData !== null) { + return; + } + this._slotData = slotData; + this._colorDirty = true; // + this._blendModeDirty = true; // + this._blendMode = this._slotData.blendMode; + this._zOrder = this._slotData.zOrder; + this._zIndex = this._slotData.zIndex; + this._alpha = this._slotData.alpha; + this._colorTransform.copyFrom(this._slotData.color); + this._rawDisplay = rawDisplay; + this._meshDisplay = meshDisplay; + // + this._armature = armatureValue; + var slotParent = this._armature.getBone(this._slotData.parent.name); + if (slotParent !== null) { + this._parent = slotParent; + } + else { + // Never; + } + this._armature._addSlot(this); + // + this._initDisplay(this._rawDisplay, false); + if (this._rawDisplay !== this._meshDisplay) { + this._initDisplay(this._meshDisplay, false); + } + this._onUpdateDisplay(); + this._addDisplay(); + }; + /** + * @internal + */ + Slot.prototype.update = function (cacheFrameIndex) { + if (this._displayDataDirty) { + this._updateDisplayData(); + this._displayDataDirty = false; + } + if (this._displayDirty) { + this._updateDisplay(); + this._displayDirty = false; + } + if (this._geometryDirty || this._textureDirty) { + if (this._display === null || this._display === this._rawDisplay || this._display === this._meshDisplay) { + this._updateFrame(); + } + this._geometryDirty = false; + this._textureDirty = false; + } + if (this._display === null) { + return; + } + if (this._visibleDirty) { + this._updateVisible(); + this._visibleDirty = false; + } + if (this._blendModeDirty) { + this._updateBlendMode(); + this._blendModeDirty = false; + } + if (this._colorDirty) { + this._updateColor(); + this._colorDirty = false; + } + if (this._zOrderDirty) { + this._updateZOrder(); + this._zOrderDirty = false; + } + if (this._geometryData !== null && this._display === this._meshDisplay) { + var isSkinned = this._geometryData.weight !== null; + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + if (this._verticesDirty || + (isSkinned && this._isBonesUpdate()) || + (isSurface && this._parent._childrenTransformDirty)) { + this._verticesDirty = false; // Allow update mesh to reset the dirty value. + this._updateMesh(); + } + if (isSkinned || isSurface) { // Compatible. + return; + } + } + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache. + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { // Has been Cached. + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else if (this._transformDirty || this._parent._childrenTransformDirty) { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet. + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + else if (this._transformDirty || this._parent._childrenTransformDirty) { // Dirty. + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + if (this._transformDirty) { + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + this._updateGlobalTransformMatrix(isCache); + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + this._updateTransform(); + this._transformDirty = false; + } + }; + /** + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Slot.prototype.invalidUpdate = function () { + this._displayDataDirty = true; + this._displayDirty = true; + // + this._transformDirty = true; + }; + /** + * @private + */ + Slot.prototype.updateTransformAndMatrix = function () { + if (this._transformDirty) { + this._updateGlobalTransformMatrix(false); + this._transformDirty = false; + } + }; + /** + * @private + */ + Slot.prototype.replaceRawDisplayData = function (displayData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.rawDisplayData !== displayData) { + displayFrame.deformVertices.length = 0; + displayFrame.rawDisplayData = displayData; + if (displayFrame.rawDisplayData === null) { + var defaultSkin = this._armature._armatureData.defaultSkin; + if (defaultSkin !== null) { + var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name); + if (defaultRawDisplayDatas !== null && index < defaultRawDisplayDatas.length) { + displayFrame.rawDisplayData = defaultRawDisplayDatas[index]; + } + } + } + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceDisplayData = function (displayData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.displayData !== displayData && displayFrame.rawDisplayData !== displayData) { + displayFrame.displayData = displayData; + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceTextureData = function (textureData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.textureData !== textureData) { + displayFrame.textureData = textureData; + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceDisplay = function (value, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.display !== value) { + var prevDisplay = displayFrame.display; + displayFrame.display = value; + if (prevDisplay !== null && + prevDisplay !== this._rawDisplay && prevDisplay !== this._meshDisplay && + !this._hasDisplay(prevDisplay)) { + if (prevDisplay instanceof dragonBones.Armature) { + // (eachDisplay as Armature).dispose(); + } + else { + this._disposeDisplay(prevDisplay, true); + } + } + if (value !== null && + value !== this._rawDisplay && value !== this._meshDisplay && + !this._hasDisplay(prevDisplay) && + !(value instanceof dragonBones.Armature)) { + this._initDisplay(value, true); + } + if (index === this._displayIndex) { + this._displayDirty = true; + } + } + }; + /** + * - Check whether a specific point is inside a custom bounding box in the slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Slot.prototype.containsPoint = function (x, y) { + if (this._boundingBoxData === null) { + return false; + } + this.updateTransformAndMatrix(); + Slot._helpMatrix.copyFrom(this.globalTransformMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(x, y, Slot._helpPoint); + return this._boundingBoxData.containsPoint(Slot._helpPoint.x, Slot._helpPoint.y); + }; + /** + * - Check whether a specific segment intersects a custom bounding box for the slot. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] + * @version DragonBones 5.0 + * @language zh_CN + */ + Slot.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + if (this._boundingBoxData === null) { + return 0; + } + this.updateTransformAndMatrix(); + Slot._helpMatrix.copyFrom(this.globalTransformMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(xA, yA, Slot._helpPoint); + xA = Slot._helpPoint.x; + yA = Slot._helpPoint.y; + Slot._helpMatrix.transformPoint(xB, yB, Slot._helpPoint); + xB = Slot._helpPoint.x; + yB = Slot._helpPoint.y; + var intersectionCount = this._boundingBoxData.intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); + if (intersectionCount > 0) { + if (intersectionCount === 1 || intersectionCount === 2) { + if (intersectionPointA !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointA.x, intersectionPointA.y, intersectionPointA); + if (intersectionPointB !== null) { + intersectionPointB.x = intersectionPointA.x; + intersectionPointB.y = intersectionPointA.y; + } + } + else if (intersectionPointB !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointB.x, intersectionPointB.y, intersectionPointB); + } + } + else { + if (intersectionPointA !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointA.x, intersectionPointA.y, intersectionPointA); + } + if (intersectionPointB !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointB.x, intersectionPointB.y, intersectionPointB); + } + } + if (normalRadians !== null) { + this.globalTransformMatrix.transformPoint(Math.cos(normalRadians.x), Math.sin(normalRadians.x), Slot._helpPoint, true); + normalRadians.x = Math.atan2(Slot._helpPoint.y, Slot._helpPoint.x); + this.globalTransformMatrix.transformPoint(Math.cos(normalRadians.y), Math.sin(normalRadians.y), Slot._helpPoint, true); + normalRadians.y = Math.atan2(Slot._helpPoint.y, Slot._helpPoint.x); + } + } + return intersectionCount; + }; + /** + * @private + */ + Slot.prototype.getDisplayFrameAt = function (index) { + return this._displayFrames[index]; + }; + Object.defineProperty(Slot.prototype, "visible", { + /** + * - The visible of slot's display object. + * @default true + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 插槽的显示对象的可见。 + * @default true + * @version DragonBones 5.6 + * @language zh_CN + */ + get: function () { + return this._visible; + }, + set: function (value) { + if (this._visible === value) { + return; + } + this._visible = value; + this._updateVisible(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayFrameCount", { + /** + * @private + */ + get: function () { + return this._displayFrames.length; + }, + set: function (value) { + var prevCount = this._displayFrames.length; + if (prevCount < value) { + this._displayFrames.length = value; + for (var i = prevCount; i < value; ++i) { + this._displayFrames[i] = dragonBones.BaseObject.borrowObject(DisplayFrame); + } + } + else if (prevCount > value) { + for (var i = prevCount - 1; i < value; --i) { + this.replaceDisplay(null, i); + this._displayFrames[i].returnToPool(); + } + this._displayFrames.length = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayIndex", { + /** + * - The index of the display object displayed in the display list. + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     slot.displayIndex = 3;
+             *     slot.displayController = "none";
+             * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 此时显示的显示对象在显示列表中的索引。 + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     slot.displayIndex = 3;
+             *     slot.displayController = "none";
+             * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._displayIndex; + }, + set: function (value) { + this._setDisplayIndex(value); + this.update(-1); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "name", { + /** + * - The slot name. + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._slotData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayList", { + /** + * - Contains a display list of display objects or child armatures. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + var displays = new Array(); + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var displayFrame = _a[_i]; + displays.push(displayFrame.display); + } + return displays; + }, + set: function (value) { + this.displayFrameCount = value.length; + var index = 0; + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var eachDisplay = value_1[_i]; + this.replaceDisplay(eachDisplay, index++); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "slotData", { + /** + * - The slot data. + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 插槽数据。 + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._slotData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "boundingBoxData", { + /** + * - The custom bounding box data for the slot at current time. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 插槽此时的自定义包围盒数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + get: function () { + return this._boundingBoxData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "rawDisplay", { + /** + * @private + */ + get: function () { + return this._rawDisplay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "meshDisplay", { + /** + * @private + */ + get: function () { + return this._meshDisplay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "display", { + /** + * - The display object that the slot displays at this time. + * @example + *
+             *     let slot = armature.getSlot("text");
+             *     slot.display = new yourEngine.TextField();
+             * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的显示对象。 + * @example + *
+             *     let slot = armature.getSlot("text");
+             *     slot.display = new yourEngine.TextField();
+             * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._display; + }, + set: function (value) { + if (this._display === value) { + return; + } + if (this._displayFrames.length === 0) { + this.displayFrameCount = 1; + this._displayIndex = 0; + } + this.replaceDisplay(value, this._displayIndex); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "childArmature", { + /** + * - The child armature that the slot displayed at current time. + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
+             *     }
+             *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+             * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的子骨架。 + * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
+             *     }
+             *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+             * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._childArmature; + }, + set: function (value) { + if (this._childArmature === value) { + return; + } + this.display = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "parent", { + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Slot.prototype.getDisplay = function () { + return this._display; + }; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Slot.prototype.setDisplay = function (value) { + this.display = value; + }; + return Slot; + }(dragonBones.TransformObject)); + dragonBones.Slot = Slot; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var Constraint = /** @class */ (function (_super) { + __extends(Constraint, _super); + function Constraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + Constraint.prototype._onClear = function () { + this._armature = null; // + this._target = null; // + this._root = null; // + this._bone = null; + }; + Object.defineProperty(Constraint.prototype, "name", { + get: function () { + return this._constraintData.name; + }, + enumerable: true, + configurable: true + }); + Constraint._helpMatrix = new dragonBones.Matrix(); + Constraint._helpTransform = new dragonBones.Transform(); + Constraint._helpPoint = new dragonBones.Point(); + return Constraint; + }(dragonBones.BaseObject)); + dragonBones.Constraint = Constraint; + /** + * @internal + */ + var IKConstraint = /** @class */ (function (_super) { + __extends(IKConstraint, _super); + function IKConstraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraint.toString = function () { + return "[class dragonBones.IKConstraint]"; + }; + IKConstraint.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._scaleEnabled = false; + this._bendPositive = false; + this._weight = 1.0; + this._constraintData = null; + }; + IKConstraint.prototype._computeA = function () { + var ikGlobal = this._target.global; + var global = this._root.global; + var globalTransformMatrix = this._root.globalTransformMatrix; + var radian = Math.atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); + if (global.scaleX < 0.0) { + radian += Math.PI; + } + global.rotation += dragonBones.Transform.normalizeRadian(radian - global.rotation) * this._weight; + global.toMatrix(globalTransformMatrix); + }; + IKConstraint.prototype._computeB = function () { + var boneLength = this._bone._boneData.length; + var parent = this._root; + var ikGlobal = this._target.global; + var parentGlobal = parent.global; + var global = this._bone.global; + var globalTransformMatrix = this._bone.globalTransformMatrix; + var x = globalTransformMatrix.a * boneLength; + var y = globalTransformMatrix.b * boneLength; + var lLL = x * x + y * y; + var lL = Math.sqrt(lLL); + var dX = global.x - parentGlobal.x; + var dY = global.y - parentGlobal.y; + var lPP = dX * dX + dY * dY; + var lP = Math.sqrt(lPP); + var rawRadian = global.rotation; + var rawParentRadian = parentGlobal.rotation; + var rawRadianA = Math.atan2(dY, dX); + dX = ikGlobal.x - parentGlobal.x; + dY = ikGlobal.y - parentGlobal.y; + var lTT = dX * dX + dY * dY; + var lT = Math.sqrt(lTT); + var radianA = 0.0; + if (lL + lP <= lT || lT + lL <= lP || lT + lP <= lL) { + radianA = Math.atan2(ikGlobal.y - parentGlobal.y, ikGlobal.x - parentGlobal.x); + if (lL + lP <= lT) { + } + else if (lP < lL) { + radianA += Math.PI; + } + } + else { + var h = (lPP - lLL + lTT) / (2.0 * lTT); + var r = Math.sqrt(lPP - h * h * lTT) / lT; + var hX = parentGlobal.x + (dX * h); + var hY = parentGlobal.y + (dY * h); + var rX = -dY * r; + var rY = dX * r; + var isPPR = false; + var parentParent = parent.parent; + if (parentParent !== null) { + var parentParentMatrix = parentParent.globalTransformMatrix; + isPPR = parentParentMatrix.a * parentParentMatrix.d - parentParentMatrix.b * parentParentMatrix.c < 0.0; + } + if (isPPR !== this._bendPositive) { + global.x = hX - rX; + global.y = hY - rY; + } + else { + global.x = hX + rX; + global.y = hY + rY; + } + radianA = Math.atan2(global.y - parentGlobal.y, global.x - parentGlobal.x); + } + var dR = dragonBones.Transform.normalizeRadian(radianA - rawRadianA); + parentGlobal.rotation = rawParentRadian + dR * this._weight; + parentGlobal.toMatrix(parent.globalTransformMatrix); + // + var currentRadianA = rawRadianA + dR * this._weight; + global.x = parentGlobal.x + Math.cos(currentRadianA) * lP; + global.y = parentGlobal.y + Math.sin(currentRadianA) * lP; + // + var radianB = Math.atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); + if (global.scaleX < 0.0) { + radianB += Math.PI; + } + global.rotation = parentGlobal.rotation + rawRadian - rawParentRadian + dragonBones.Transform.normalizeRadian(radianB - dR - rawRadian) * this._weight; + global.toMatrix(globalTransformMatrix); + }; + IKConstraint.prototype.init = function (constraintData, armature) { + if (this._constraintData !== null) { + return; + } + this._constraintData = constraintData; + this._armature = armature; + this._target = this._armature.getBone(this._constraintData.target.name); + this._root = this._armature.getBone(this._constraintData.root.name); + this._bone = this._constraintData.bone !== null ? this._armature.getBone(this._constraintData.bone.name) : null; + { + var ikConstraintData = this._constraintData; + this._scaleEnabled = ikConstraintData.scaleEnabled; + this._bendPositive = ikConstraintData.bendPositive; + this._weight = ikConstraintData.weight; + } + this._root._hasConstraint = true; + }; + IKConstraint.prototype.update = function () { + this._root.updateByConstraint(); + if (this._bone !== null) { + this._bone.updateByConstraint(); + this._computeB(); + } + else { + this._computeA(); + } + }; + IKConstraint.prototype.invalidUpdate = function () { + this._root.invalidUpdate(); + if (this._bone !== null) { + this._bone.invalidUpdate(); + } + }; + return IKConstraint; + }(Constraint)); + dragonBones.IKConstraint = IKConstraint; + /** + * @internal + */ + var PathConstraint = /** @class */ (function (_super) { + __extends(PathConstraint, _super); + function PathConstraint() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._bones = []; + _this._spaces = []; + _this._positions = []; + _this._curves = []; + _this._boneLengths = []; + _this._pathGlobalVertices = []; + _this._segments = [10]; + return _this; + } + PathConstraint.toString = function () { + return "[class dragonBones.PathConstraint]"; + }; + PathConstraint.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.dirty = false; + this.pathOffset = 0; + this.position = 0.0; + this.spacing = 0.0; + this.rotateOffset = 0.0; + this.rotateMix = 1.0; + this.translateMix = 1.0; + this._pathSlot = null; + this._bones.length = 0; + this._spaces.length = 0; + this._positions.length = 0; + this._curves.length = 0; + this._boneLengths.length = 0; + this._pathGlobalVertices.length = 0; + }; + PathConstraint.prototype._updatePathVertices = function (verticesData) { + //计算曲线的节点数据 + var armature = this._armature; + var dragonBonesData = armature.armatureData.parent; + var scale = armature.armatureData.scale; + var intArray = dragonBonesData.intArray; + var floatArray = dragonBonesData.floatArray; + var pathOffset = verticesData.offset; + var pathVertexCount = intArray[pathOffset + 0 /* GeometryVertexCount */]; + var pathVertexOffset = intArray[pathOffset + 2 /* GeometryFloatOffset */]; + this._pathGlobalVertices.length = pathVertexCount * 2; + var weightData = verticesData.weight; + //没有骨骼约束我,那节点只受自己的Bone控制 + if (weightData === null) { + var parentBone = this._pathSlot.parent; + parentBone.updateByConstraint(); + var matrix = parentBone.globalTransformMatrix; + for (var i = 0, iV_1 = pathVertexOffset; i < pathVertexCount; i += 2) { + var vx = floatArray[iV_1++] * scale; + var vy = floatArray[iV_1++] * scale; + var x = matrix.a * vx + matrix.c * vy + matrix.tx; + var y = matrix.b * vx + matrix.d * vy + matrix.ty; + // + this._pathGlobalVertices[i] = x; + this._pathGlobalVertices[i + 1] = y; + } + return; + } + //有骨骼约束我,那我的节点受骨骼权重控制 + var bones = this._pathSlot._geometryBones; + var weightBoneCount = weightData.bones.length; + var weightOffset = weightData.offset; + var floatOffset = intArray[weightOffset + 1 /* WeigthFloatOffset */]; + var iV = floatOffset; + var iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount; + for (var i = 0, iW = 0; i < pathVertexCount; i++) { + var vertexBoneCount = intArray[iB++]; // + var xG = 0.0, yG = 0.0; + for (var ii = 0, ll = vertexBoneCount; ii < ll; ii++) { + var boneIndex = intArray[iB++]; + var bone = bones[boneIndex]; + if (bone === null) { + continue; + } + bone.updateByConstraint(); + var matrix = bone.globalTransformMatrix; + var weight = floatArray[iV++]; + var vx = floatArray[iV++] * scale; + var vy = floatArray[iV++] * scale; + xG += (matrix.a * vx + matrix.c * vy + matrix.tx) * weight; + yG += (matrix.b * vx + matrix.d * vy + matrix.ty) * weight; + } + this._pathGlobalVertices[iW++] = xG; + this._pathGlobalVertices[iW++] = yG; + } + }; + PathConstraint.prototype._computeVertices = function (start, count, offset, out) { + //TODO优化 + for (var i = offset, iW = start; i < count; i += 2) { + out[i] = this._pathGlobalVertices[iW++]; + out[i + 1] = this._pathGlobalVertices[iW++]; + } + }; + PathConstraint.prototype._computeBezierCurve = function (pathDisplayDta, spaceCount, tangents, percentPosition, percentSpacing) { + //计算当前的骨骼在曲线上的位置 + var armature = this._armature; + var intArray = armature.armatureData.parent.intArray; + var vertexCount = intArray[pathDisplayDta.geometry.offset + 0 /* GeometryVertexCount */]; + var positions = this._positions; + var spaces = this._spaces; + var isClosed = pathDisplayDta.closed; + var curveVertices = Array(); + var verticesLength = vertexCount * 2; + var curveCount = verticesLength / 6; + var preCurve = -1; + var position = this.position; + positions.length = spaceCount * 3 + 2; + var pathLength = 0.0; + //不需要匀速运动,效率高些 + if (!pathDisplayDta.constantSpeed) { + var lenghts = pathDisplayDta.curveLengths; + curveCount -= isClosed ? 1 : 2; + pathLength = lenghts[curveCount]; + if (percentPosition) { + position *= pathLength; + } + if (percentSpacing) { + for (var i = 0; i < spaceCount; i++) { + spaces[i] *= pathLength; + } + } + curveVertices.length = 8; + for (var i = 0, o = 0, curve = 0; i < spaceCount; i++, o += 3) { + var space = spaces[i]; + position += space; + if (isClosed) { + position %= pathLength; + if (position < 0) { + position += pathLength; + } + curve = 0; + } + else if (position < 0) { + //TODO + continue; + } + else if (position > pathLength) { + //TODO + continue; + } + var percent = 0.0; + for (;; curve++) { + var len = lenghts[curve]; + if (position > len) { + continue; + } + if (curve === 0) { + percent = position / len; + } + else { + var preLen = lenghts[curve - 1]; + percent = (position - preLen) / (len - preLen); + } + break; + } + if (curve !== preCurve) { + preCurve = curve; + if (isClosed && curve === curveCount) { + //计算曲线 + this._computeVertices(verticesLength - 4, 4, 0, curveVertices); + this._computeVertices(0, 4, 4, curveVertices); + } + else { + this._computeVertices(curve * 6 + 2, 8, 0, curveVertices); + } + } + // + this.addCurvePosition(percent, curveVertices[0], curveVertices[1], curveVertices[2], curveVertices[3], curveVertices[4], curveVertices[5], curveVertices[6], curveVertices[7], positions, o, tangents); + } + return; + } + //匀速的 + if (isClosed) { + verticesLength += 2; + curveVertices.length = vertexCount; + this._computeVertices(2, verticesLength - 4, 0, curveVertices); + this._computeVertices(0, 2, verticesLength - 4, curveVertices); + curveVertices[verticesLength - 2] = curveVertices[0]; + curveVertices[verticesLength - 1] = curveVertices[1]; + } + else { + curveCount--; + verticesLength -= 4; + curveVertices.length = verticesLength; + this._computeVertices(2, verticesLength, 0, curveVertices); + } + // + var curves = new Array(curveCount); + pathLength = 0; + var x1 = curveVertices[0], y1 = curveVertices[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = curveVertices[w]; + cy1 = curveVertices[w + 1]; + cx2 = curveVertices[w + 2]; + cy2 = curveVertices[w + 3]; + x2 = curveVertices[w + 4]; + y2 = curveVertices[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) { + position *= pathLength; + } + if (percentSpacing) { + for (var i = 0; i < spaceCount; i++) { + spaces[i] *= pathLength; + } + } + var segments = this._segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spaceCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (isClosed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + continue; + } + else if (p > pathLength) { + continue; + } + // Determine curve containing position. + for (;; curve++) { + var length_1 = curves[curve]; + if (p > length_1) + continue; + if (curve === 0) + p /= length_1; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_1 - prev); + } + break; + } + if (curve !== preCurve) { + preCurve = curve; + var ii = curve * 6; + x1 = curveVertices[ii]; + y1 = curveVertices[ii + 1]; + cx1 = curveVertices[ii + 2]; + cy1 = curveVertices[ii + 3]; + cx2 = curveVertices[ii + 4]; + cy2 = curveVertices[ii + 5]; + x2 = curveVertices[ii + 6]; + y2 = curveVertices[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + // Weight by segment length. + p *= curveLength; + for (;; segment++) { + var length_2 = segments[segment]; + if (p > length_2) + continue; + if (segment === 0) + p /= length_2; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_2 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, positions, o, tangents); + } + }; + //Calculates a point on the curve, for a given t value between 0 and 1. + PathConstraint.prototype.addCurvePosition = function (t, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, offset, tangents) { + if (t === 0) { + out[offset] = x1; + out[offset + 1] = y1; + out[offset + 2] = 0; + return; + } + if (t === 1) { + out[offset] = x2; + out[offset + 1] = y2; + out[offset + 2] = 0; + return; + } + var mt = 1 - t; + var mt2 = mt * mt; + var t2 = t * t; + var a = mt2 * mt; + var b = mt2 * t * 3; + var c = mt * t2 * 3; + var d = t * t2; + var x = a * x1 + b * cx1 + c * cx2 + d * x2; + var y = a * y1 + b * cy1 + c * cy2 + d * y2; + out[offset] = x; + out[offset + 1] = y; + if (tangents) { + //Calculates the curve tangent at the specified t value + out[offset + 2] = Math.atan2(y - (a * y1 + b * cy1 + c * cy2), x - (a * x1 + b * cx1 + c * cx2)); + } + else { + out[offset + 2] = 0; + } + }; + PathConstraint.prototype.init = function (constraintData, armature) { + this._constraintData = constraintData; + this._armature = armature; + var data = constraintData; + this.pathOffset = data.pathDisplayData.geometry.offset; + // + this.position = data.position; + this.spacing = data.spacing; + this.rotateOffset = data.rotateOffset; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + // + this._root = this._armature.getBone(data.root.name); + this._target = this._armature.getBone(data.target.name); + this._pathSlot = this._armature.getSlot(data.pathSlot.name); + for (var i = 0, l = data.bones.length; i < l; i++) { + var bone = this._armature.getBone(data.bones[i].name); + if (bone !== null) { + this._bones.push(bone); + } + } + if (data.rotateMode === 2 /* ChainScale */) { + this._boneLengths.length = this._bones.length; + } + this._root._hasConstraint = true; + }; + PathConstraint.prototype.update = function () { + var pathSlot = this._pathSlot; + if (pathSlot._geometryData === null || + pathSlot._geometryData.offset !== this.pathOffset) { + return; + } + var constraintData = this._constraintData; + // + //曲线节点数据改变:父亲bone改变,权重bones改变,变形顶点改变 + var isPathVerticeDirty = false; + if (this._root._childrenTransformDirty) { + this._updatePathVertices(pathSlot._geometryData); + isPathVerticeDirty = true; + } + else if (pathSlot._verticesDirty || pathSlot._isBonesUpdate()) { + this._updatePathVertices(pathSlot._geometryData); + pathSlot._verticesDirty = false; + isPathVerticeDirty = true; + } + if (!isPathVerticeDirty && !this.dirty) { + return; + } + // + var positionMode = constraintData.positionMode; + var spacingMode = constraintData.spacingMode; + var rotateMode = constraintData.rotateMode; + var bones = this._bones; + var isLengthMode = spacingMode === 0 /* Length */; + var isChainScaleMode = rotateMode === 2 /* ChainScale */; + var isTangentMode = rotateMode === 0 /* Tangent */; + var boneCount = bones.length; + var spacesCount = isTangentMode ? boneCount : boneCount + 1; + var spacing = this.spacing; + var spaces = this._spaces; + spaces.length = spacesCount; + //计曲线间隔和长度 + if (isChainScaleMode || isLengthMode) { + //Bone改变和spacing改变触发 + spaces[0] = 0; + for (var i = 0, l = spacesCount - 1; i < l; i++) { + var bone = bones[i]; + bone.updateByConstraint(); + var boneLength = bone._boneData.length; + var matrix = bone.globalTransformMatrix; + var x = boneLength * matrix.a; + var y = boneLength * matrix.b; + var len = Math.sqrt(x * x + y * y); + if (isChainScaleMode) { + this._boneLengths[i] = len; + } + spaces[i + 1] = (boneLength + spacing) * len / boneLength; + } + } + else { + for (var i = 0; i < spacesCount; i++) { + spaces[i] = spacing; + } + } + // + this._computeBezierCurve(pathSlot._displayFrame.rawDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); + //根据新的节点数据重新采样 + var positions = this._positions; + var rotateOffset = this.rotateOffset; + var boneX = positions[0], boneY = positions[1]; + var tip; + if (rotateOffset === 0) { + tip = rotateMode === 1 /* Chain */; + } + else { + tip = false; + var bone = pathSlot.parent; + if (bone !== null) { + var matrix = bone.globalTransformMatrix; + rotateOffset *= matrix.a * matrix.d - matrix.b * matrix.c > 0 ? dragonBones.Transform.DEG_RAD : -dragonBones.Transform.DEG_RAD; + } + } + // + var rotateMix = this.rotateMix; + var translateMix = this.translateMix; + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.updateByConstraint(); + var matrix = bone.globalTransformMatrix; + matrix.tx += (boneX - matrix.tx) * translateMix; + matrix.ty += (boneY - matrix.ty) * translateMix; + var x = positions[p], y = positions[p + 1]; + var dx = x - boneX, dy = y - boneY; + if (isChainScaleMode) { + var lenght = this._boneLengths[i]; + var s = (Math.sqrt(dx * dx + dy * dy) / lenght - 1) * rotateMix + 1; + matrix.a *= s; + matrix.b *= s; + } + boneX = x; + boneY = y; + if (rotateMix > 0) { + var a = matrix.a, b = matrix.b, c = matrix.c, d = matrix.d, r = void 0, cos = void 0, sin = void 0; + if (isTangentMode) { + r = positions[p - 1]; + } + else { + r = Math.atan2(dy, dx); + } + r -= Math.atan2(b, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_3 = bone._boneData.length; + boneX += (length_3 * (cos * a - sin * b) - dx) * rotateMix; + boneY += (length_3 * (sin * a + cos * b) - dy) * rotateMix; + } + else { + r += rotateOffset; + } + if (r > dragonBones.Transform.PI) { + r -= dragonBones.Transform.PI_D; + } + else if (r < -dragonBones.Transform.PI) { + r += dragonBones.Transform.PI_D; + } + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + matrix.a = cos * a - sin * b; + matrix.b = sin * a + cos * b; + matrix.c = cos * c - sin * d; + matrix.d = sin * c + cos * d; + } + bone.global.fromMatrix(matrix); + } + this.dirty = false; + }; + PathConstraint.prototype.invalidUpdate = function () { + }; + return PathConstraint; + }(Constraint)); + dragonBones.PathConstraint = PathConstraint; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + var WorldClock = /** @class */ (function () { + /** + * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. + * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 + * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 + * @version DragonBones 3.0 + * @language zh_CN + */ + function WorldClock(time) { + if (time === void 0) { time = 0.0; } + /** + * - Current time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + this.time = 0.0; + /** + * - The play speed, used to control animation speed-shift play. + * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度,用于控制动画变速播放。 + * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + this.timeScale = 1.0; + this._systemTime = 0.0; + this._animatebles = []; + this._clock = null; + this.time = time; + this._systemTime = new Date().getTime() * 0.001; + } + /** + * - Advance time for all IAnimatable instances. + * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 为所有的 IAnimatable 实例更新时间。 + * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.advanceTime = function (passedTime) { + if (passedTime !== passedTime) { + passedTime = 0.0; + } + var currentTime = Date.now() * 0.001; + if (passedTime < 0.0) { + passedTime = currentTime - this._systemTime; + } + this._systemTime = currentTime; + if (this.timeScale !== 1.0) { + passedTime *= this.timeScale; + } + if (passedTime === 0.0) { + return; + } + if (passedTime < 0.0) { + this.time -= passedTime; + } + else { + this.time += passedTime; + } + var i = 0, r = 0, l = this._animatebles.length; + for (; i < l; ++i) { + var animatable = this._animatebles[i]; + if (animatable !== null) { + if (r > 0) { + this._animatebles[i - r] = animatable; + this._animatebles[i] = null; + } + animatable.advanceTime(passedTime); + } + else { + r++; + } + } + if (r > 0) { + l = this._animatebles.length; + for (; i < l; ++i) { + var animateble = this._animatebles[i]; + if (animateble !== null) { + this._animatebles[i - r] = animateble; + } + else { + r++; + } + } + this._animatebles.length -= r; + } + }; + /** + * - Check whether contains a specific instance of IAnimatable. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.contains = function (value) { + if (value === this) { + return false; + } + var ancestor = value; + while (ancestor !== this && ancestor !== null) { + ancestor = ancestor.clock; + } + return ancestor === this; + }; + /** + * - Add IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.add = function (value) { + if (this._animatebles.indexOf(value) < 0) { + this._animatebles.push(value); + value.clock = this; + } + }; + /** + * - Removes a specified IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.remove = function (value) { + var index = this._animatebles.indexOf(value); + if (index >= 0) { + this._animatebles[index] = null; + value.clock = null; + } + }; + /** + * - Clear all IAnimatable instances. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.clear = function () { + for (var _i = 0, _a = this._animatebles; _i < _a.length; _i++) { + var animatable = _a[_i]; + if (animatable !== null) { + animatable.clock = null; + } + } + }; + Object.defineProperty(WorldClock.prototype, "clock", { + /** + * @inheritDoc + */ + get: function () { + return this._clock; + }, + set: function (value) { + if (this._clock === value) { + return; + } + if (this._clock !== null) { + this._clock.remove(this); + } + this._clock = value; + if (this._clock !== null) { + this._clock.add(this); + } + }, + enumerable: true, + configurable: true + }); + return WorldClock; + }()); + dragonBones.WorldClock = WorldClock; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation player is used to play the animation data and manage the animation states. + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器用来播放动画数据和管理动画状态。 + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + var Animation = /** @class */ (function (_super) { + __extends(Animation, _super); + function Animation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._animationNames = []; + _this._animationStates = []; + _this._animations = {}; + _this._blendStates = {}; + _this._animationConfig = null; // Initial value. + return _this; + } + Animation.toString = function () { + return "[class dragonBones.Animation]"; + }; + Animation.prototype._onClear = function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.returnToPool(); + } + for (var k in this._animations) { + delete this._animations[k]; + } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].returnToPool(); + } + delete this._blendStates[k]; + } + if (this._animationConfig !== null) { + this._animationConfig.returnToPool(); + } + this.timeScale = 1.0; + this._animationDirty = false; + this._inheritTimeScale = 1.0; + this._animationNames.length = 0; + this._animationStates.length = 0; + //this._animations.clear(); + this._armature = null; // + this._animationConfig = null; // + this._lastAnimationState = null; + }; + Animation.prototype._fadeOut = function (animationConfig) { + switch (animationConfig.fadeOutMode) { + case 1 /* SameLayer */: + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (animationState._parent !== null) { + continue; + } + if (animationState.layer === animationConfig.layer) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 2 /* SameGroup */: + for (var _b = 0, _c = this._animationStates; _b < _c.length; _b++) { + var animationState = _c[_b]; + if (animationState._parent !== null) { + continue; + } + if (animationState.group === animationConfig.group) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 3 /* SameLayerAndGroup */: + for (var _d = 0, _e = this._animationStates; _d < _e.length; _d++) { + var animationState = _e[_d]; + if (animationState._parent !== null) { + continue; + } + if (animationState.layer === animationConfig.layer && + animationState.group === animationConfig.group) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 4 /* All */: + for (var _f = 0, _g = this._animationStates; _f < _g.length; _f++) { + var animationState = _g[_f]; + if (animationState._parent !== null) { + continue; + } + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + break; + case 5 /* Single */: // TODO + default: + break; + } + }; + /** + * @internal + */ + Animation.prototype.init = function (armature) { + if (this._armature !== null) { + return; + } + this._armature = armature; + this._animationConfig = dragonBones.BaseObject.borrowObject(dragonBones.AnimationConfig); + }; + /** + * @internal + */ + Animation.prototype.advanceTime = function (passedTime) { + if (passedTime < 0.0) { // Only animationState can reverse play. + passedTime = -passedTime; + } + if (this._armature.inheritAnimation && this._armature._parent !== null) { // Inherit parent animation timeScale. + this._inheritTimeScale = this._armature._parent._armature.animation._inheritTimeScale * this.timeScale; + } + else { + this._inheritTimeScale = this.timeScale; + } + if (this._inheritTimeScale !== 1.0) { + passedTime *= this._inheritTimeScale; + } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].reset(); + } + } + var animationStateCount = this._animationStates.length; + if (animationStateCount === 1) { + var animationState = this._animationStates[0]; + if (animationState._fadeState > 0 && animationState._subFadeState > 0) { + this._armature._dragonBones.bufferObject(animationState); + this._animationStates.length = 0; + this._lastAnimationState = null; + } + else { + var animationData = animationState.animationData; + var cacheFrameRate = animationData.cacheFrameRate; + if (this._animationDirty && cacheFrameRate > 0.0) { // Update cachedFrameIndices. + this._animationDirty = false; + for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { + var bone = _a[_i]; + bone._cachedFrameIndices = animationData.getBoneCachedFrameIndices(bone.name); + } + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { + var slot = _c[_b]; + if (slot.displayFrameCount > 0) { + var rawDisplayData = slot.getDisplayFrameAt(0).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.parent === this._armature.armatureData.defaultSkin) { + slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); + continue; + } + } + slot._cachedFrameIndices = null; + } + } + animationState.advanceTime(passedTime, cacheFrameRate); + } + } + else if (animationStateCount > 1) { + for (var i = 0, r = 0; i < animationStateCount; ++i) { + var animationState = this._animationStates[i]; + if (animationState._fadeState > 0 && animationState._subFadeState > 0) { + r++; + this._armature._dragonBones.bufferObject(animationState); + this._animationDirty = true; + if (this._lastAnimationState === animationState) { // Update last animation state. + this._lastAnimationState = null; + } + } + else { + if (r > 0) { + this._animationStates[i - r] = animationState; + } + animationState.advanceTime(passedTime, 0.0); + } + if (i === animationStateCount - 1 && r > 0) { // Modify animation states size. + this._animationStates.length -= r; + if (this._lastAnimationState === null && this._animationStates.length > 0) { + this._lastAnimationState = this._animationStates[this._animationStates.length - 1]; + } + } + } + this._armature._cacheFrameIndex = -1; + } + else { + this._armature._cacheFrameIndex = -1; + } + }; + /** + * - Clear all animations states. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除所有的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.reset = function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.returnToPool(); + } + this._animationDirty = false; + this._animationConfig.clear(); + this._animationStates.length = 0; + this._lastAnimationState = null; + }; + /** + * - Pause a specific animation state. + * @param animationName - The name of animation state. (If not set, it will pause all animations) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停指定动画状态的播放。 + * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.stop = function (animationName) { + if (animationName === void 0) { animationName = null; } + if (animationName !== null) { + var animationState = this.getState(animationName); + if (animationState !== null) { + animationState.stop(); + } + } + else { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.stop(); + } + } + }; + /** + * - Play animation with a specific animation config. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @param animationConfig - The animation config. + * @returns The playing animation state. + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 通过指定的动画配置来播放动画。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @param animationConfig - 动画配置。 + * @returns 播放的动画状态。 + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + Animation.prototype.playConfig = function (animationConfig) { + var animationName = animationConfig.animation; + if (!(animationName in this._animations)) { + console.warn("Non-existent animation.\n", "DragonBones name: " + this._armature.armatureData.parent.name, "Armature name: " + this._armature.name, "Animation name: " + animationName); + return null; + } + var animationData = this._animations[animationName]; + if (animationConfig.fadeOutMode === 5 /* Single */) { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState_1 = _a[_i]; + if (animationState_1._fadeState < 1 && + animationState_1.layer === animationConfig.layer && + animationState_1.animationData === animationData) { + return animationState_1; + } + } + } + if (this._animationStates.length === 0) { + animationConfig.fadeInTime = 0.0; + } + else if (animationConfig.fadeInTime < 0.0) { + animationConfig.fadeInTime = animationData.fadeInTime; + } + if (animationConfig.fadeOutTime < 0.0) { + animationConfig.fadeOutTime = animationConfig.fadeInTime; + } + if (animationConfig.timeScale <= -100.0) { + animationConfig.timeScale = 1.0 / animationData.scale; + } + if (animationData.frameCount > 0) { + if (animationConfig.position < 0.0) { + animationConfig.position %= animationData.duration; + animationConfig.position = animationData.duration - animationConfig.position; + } + else if (animationConfig.position === animationData.duration) { + animationConfig.position -= 0.000001; // Play a little time before end. + } + else if (animationConfig.position > animationData.duration) { + animationConfig.position %= animationData.duration; + } + if (animationConfig.duration > 0.0 && animationConfig.position + animationConfig.duration > animationData.duration) { + animationConfig.duration = animationData.duration - animationConfig.position; + } + if (animationConfig.playTimes < 0) { + animationConfig.playTimes = animationData.playTimes; + } + } + else { + animationConfig.playTimes = 1; + animationConfig.position = 0.0; + if (animationConfig.duration > 0.0) { + animationConfig.duration = 0.0; + } + } + if (animationConfig.duration === 0.0) { + animationConfig.duration = -1.0; + } + this._fadeOut(animationConfig); + // + var animationState = dragonBones.BaseObject.borrowObject(dragonBones.AnimationState); + animationState.init(this._armature, animationData, animationConfig); + this._animationDirty = true; + this._armature._cacheFrameIndex = -1; + if (this._animationStates.length > 0) { // Sort animation state. + var added = false; + for (var i = 0, l = this._animationStates.length; i < l; ++i) { + if (animationState.layer > this._animationStates[i].layer) { + added = true; + this._animationStates.splice(i, 0, animationState); + break; + } + else if (i !== l - 1 && animationState.layer > this._animationStates[i + 1].layer) { + added = true; + this._animationStates.splice(i + 1, 0, animationState); + break; + } + } + if (!added) { + this._animationStates.push(animationState); + } + } + else { + this._animationStates.push(animationState); + } + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { // Child armature play same name animation. + var slot = _c[_b]; + var childArmature = slot.childArmature; + if (childArmature !== null && childArmature.inheritAnimation && + childArmature.animation.hasAnimation(animationName) && + childArmature.animation.getState(animationName) === null) { + childArmature.animation.fadeIn(animationName); // + } + } + for (var k in animationData.animationTimelines) { // Blend animation node. + var childAnimationState = this.fadeIn(k, 0.0, 1, animationState.layer, "", 5 /* Single */); + if (childAnimationState === null) { + continue; + } + var timelines = animationData.animationTimelines[k]; + childAnimationState.actionEnabled = false; + childAnimationState.resetToPose = false; + childAnimationState.stop(); + animationState.addState(childAnimationState, timelines); + // + var index = this._animationStates.indexOf(animationState); + var childIndex = this._animationStates.indexOf(childAnimationState); + if (childIndex < index) { + this._animationStates.splice(index, 1); + this._animationStates.splice(childIndex, 0, animationState); + } + } + // if (!this._armature._lockUpdate && animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. + // this._armature.advanceTime(0.0); + // } + this._lastAnimationState = animationState; + return animationState; + }; + /** + * - Play a specific animation. + * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) + * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放指定动画。 + * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.play = function (animationName, playTimes) { + if (animationName === void 0) { animationName = null; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName !== null ? animationName : ""; + if (animationName !== null && animationName.length > 0) { + this.playConfig(this._animationConfig); + } + else if (this._lastAnimationState === null) { + var defaultAnimation = this._armature.armatureData.defaultAnimation; + if (defaultAnimation !== null) { + this._animationConfig.animation = defaultAnimation.name; + this.playConfig(this._animationConfig); + } + } + else if (!this._lastAnimationState.isPlaying && !this._lastAnimationState.isCompleted) { + this._lastAnimationState.play(); + } + else { + this._animationConfig.animation = this._lastAnimationState.name; + this.playConfig(this._animationConfig); + } + return this._lastAnimationState; + }; + /** + * - Fade in a specific animation. + * @param animationName - The name of animation data. + * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) + * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) + * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) + * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 淡入播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) + * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) + * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.fadeIn = function (animationName, fadeInTime, playTimes, layer, group, fadeOutMode) { + if (fadeInTime === void 0) { fadeInTime = -1.0; } + if (playTimes === void 0) { playTimes = -1; } + if (layer === void 0) { layer = 0; } + if (group === void 0) { group = null; } + if (fadeOutMode === void 0) { fadeOutMode = 3 /* SameLayerAndGroup */; } + this._animationConfig.clear(); + this._animationConfig.fadeOutMode = fadeOutMode; + this._animationConfig.playTimes = playTimes; + this._animationConfig.layer = layer; + this._animationConfig.fadeInTime = fadeInTime; + this._animationConfig.animation = animationName; + this._animationConfig.group = group !== null ? group : ""; + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific time. + * @param animationName - The name of animation data. + * @param time - The start time point of playing. (In seconds) + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定时间开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param time - 播放开始的时间。 (以秒为单位) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByTime = function (animationName, time, playTimes) { + if (time === void 0) { time = 0.0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.position = time; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific frame. + * @param animationName - The name of animation data. + * @param frame - The start frame of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定帧开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param frame - 播放开始的帧数。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByFrame = function (animationName, frame, playTimes) { + if (frame === void 0) { frame = 0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + var animationData = animationName in this._animations ? this._animations[animationName] : null; + if (animationData !== null) { + this._animationConfig.position = animationData.frameCount > 0 ? animationData.duration * frame / animationData.frameCount : 0.0; + } + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific progress. + * @param animationName - The name of animation data. + * @param progress - The start progress value of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定进度开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param progress - 开始播放的进度。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByProgress = function (animationName, progress, playTimes) { + if (progress === void 0) { progress = 0.0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + var animationData = animationName in this._animations ? this._animations[animationName] : null; + if (animationData !== null) { + this._animationConfig.position = animationData.duration * (progress > 0.0 ? progress : 0.0); + } + return this.playConfig(this._animationConfig); + }; + /** + * - Stop a specific animation at the specific time. + * @param animationName - The name of animation data. + * @param time - The stop time. (In seconds) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定时间停止指定动画播放 + * @param animationName - 动画数据名称。 + * @param time - 停止的时间。 (以秒为单位) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByTime = function (animationName, time) { + if (time === void 0) { time = 0.0; } + var animationState = this.gotoAndPlayByTime(animationName, time, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * - Stop a specific animation at the specific frame. + * @param animationName - The name of animation data. + * @param frame - The stop frame. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定帧停止指定动画的播放 + * @param animationName - 动画数据名称。 + * @param frame - 停止的帧数。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByFrame = function (animationName, frame) { + if (frame === void 0) { frame = 0; } + var animationState = this.gotoAndPlayByFrame(animationName, frame, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * - Stop a specific animation at the specific progress. + * @param animationName - The name of animation data. + * @param progress - The stop progress value. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定的进度停止指定的动画播放。 + * @param animationName - 动画数据名称。 + * @param progress - 停止进度。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByProgress = function (animationName, progress) { + if (progress === void 0) { progress = 0.0; } + var animationState = this.gotoAndPlayByProgress(animationName, progress, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * @internal + */ + Animation.prototype.getBlendState = function (type, name, target) { + if (!(type in this._blendStates)) { + this._blendStates[type] = {}; + } + var blendStates = this._blendStates[type]; + if (!(name in blendStates)) { + var blendState = blendStates[name] = dragonBones.BaseObject.borrowObject(dragonBones.BlendState); + blendState.target = target; + } + return blendStates[name]; + }; + /** + * - Get a specific animation state. + * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取指定的动画状态。 + * @param animationName - 动画状态名称。 + * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.getState = function (animationName, layer) { + if (layer === void 0) { layer = -1; } + var i = this._animationStates.length; + while (i--) { + var animationState = this._animationStates[i]; + if (animationState.name === animationName && (layer < 0 || animationState.layer === layer)) { + return animationState; + } + } + return null; + }; + /** + * - Check whether a specific animation data is included. + * @param animationName - The name of animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含指定的动画数据 + * @param animationName - 动画数据名称。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.hasAnimation = function (animationName) { + return animationName in this._animations; + }; + /** + * - Get all the animation states. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取所有的动画状态 + * @version DragonBones 5.1 + * @language zh_CN + */ + Animation.prototype.getStates = function () { + return this._animationStates; + }; + Object.defineProperty(Animation.prototype, "isPlaying", { + /** + * - Check whether there is an animation state is playing + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否有动画状态正在播放 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (animationState.isPlaying) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "isCompleted", { + /** + * - Check whether all the animation states' playing were finished. + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否所有的动画状态均已播放完毕。 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (!animationState.isCompleted) { + return false; + } + } + return this._animationStates.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "lastAnimationName", { + /** + * - The name of the last playing animation state. + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态名称 + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._lastAnimationState !== null ? this._lastAnimationState.name : ""; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animationNames", { + /** + * - The name of all animation data + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有动画数据的名称 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._animationNames; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animations", { + /** + * - All animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有的动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._animations; + }, + set: function (value) { + if (this._animations === value) { + return; + } + this._animationNames.length = 0; + for (var k in this._animations) { + delete this._animations[k]; + } + for (var k in value) { + this._animationNames.push(k); + this._animations[k] = value[k]; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animationConfig", { + /** + * - An AnimationConfig instance that can be used quickly. + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 一个可以快速使用的动画配置实例。 + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language zh_CN + */ + get: function () { + this._animationConfig.clear(); + return this._animationConfig; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "lastAnimationState", { + /** + * - The last playing animation state + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._lastAnimationState; + }, + enumerable: true, + configurable: true + }); + return Animation; + }(dragonBones.BaseObject)); + dragonBones.Animation = Animation; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation state is generated when the animation data is played. + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画状态由播放动画数据时产生。 + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + var AnimationState = /** @class */ (function (_super) { + __extends(AnimationState, _super); + function AnimationState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._boneMask = []; + _this._boneTimelines = []; + _this._boneBlendTimelines = []; + _this._slotTimelines = []; + _this._slotBlendTimelines = []; + _this._constraintTimelines = []; + _this._animationTimelines = []; + _this._poseTimelines = []; + /** + * @internal + */ + _this._actionTimeline = null; // Initial value. + _this._zOrderTimeline = null; // Initial value. + return _this; + } + AnimationState.toString = function () { + return "[class dragonBones.AnimationState]"; + }; + AnimationState.prototype._onClear = function () { + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.returnToPool(); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.returnToPool(); + } + for (var _d = 0, _e = this._slotTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.returnToPool(); + } + for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.returnToPool(); + } + for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) { + var timeline = _j[_h]; + timeline.returnToPool(); + } + for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) { + var timeline = _l[_k]; + var animationState = timeline.target; + if (animationState._parent === this) { + animationState._fadeState = 1; + animationState._subFadeState = 1; + animationState._parent = null; + } + timeline.returnToPool(); + } + if (this._actionTimeline !== null) { + this._actionTimeline.returnToPool(); + } + if (this._zOrderTimeline !== null) { + this._zOrderTimeline.returnToPool(); + } + this.actionEnabled = false; + this.additive = false; + this.displayControl = false; + this.resetToPose = false; + this.blendType = 0 /* None */; + this.playTimes = 1; + this.layer = 0; + this.timeScale = 1.0; + this._weight = 1.0; + this.parameterX = 0.0; + this.parameterY = 0.0; + this.positionX = 0.0; + this.positionY = 0.0; + this.autoFadeOutTime = 0.0; + this.fadeTotalTime = 0.0; + this.name = ""; + this.group = ""; + this._timelineDirty = 2; + this._playheadState = 0; + this._fadeState = -1; + this._subFadeState = -1; + this._position = 0.0; + this._duration = 0.0; + this._fadeTime = 0.0; + this._time = 0.0; + this._fadeProgress = 0.0; + this._weightResult = 0.0; + this._boneMask.length = 0; + this._boneTimelines.length = 0; + this._boneBlendTimelines.length = 0; + this._slotTimelines.length = 0; + this._slotBlendTimelines.length = 0; + this._constraintTimelines.length = 0; + this._animationTimelines.length = 0; + this._poseTimelines.length = 0; + // this._bonePoses.clear(); + this._animationData = null; // + this._armature = null; // + this._actionTimeline = null; // + this._zOrderTimeline = null; + this._activeChildA = null; + this._activeChildB = null; + this._parent = null; + }; + AnimationState.prototype._updateTimelines = function () { + { // Update constraint timelines. + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + var timelineDatas = this._animationData.getConstraintTimelines(constraint.name); + if (timelineDatas !== null) { + for (var _b = 0, timelineDatas_1 = timelineDatas; _b < timelineDatas_1.length; _b++) { + var timelineData = timelineDatas_1[_b]; + switch (timelineData.type) { + case 30 /* IKConstraint */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState); + timeline.target = constraint; + timeline.init(this._armature, this, timelineData); + this._constraintTimelines.push(timeline); + break; + } + default: + break; + } + } + } + else if (this.resetToPose) { // Pose timeline. + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState); + timeline.target = constraint; + timeline.init(this._armature, this, null); + this._constraintTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + }; + AnimationState.prototype._updateBoneAndSlotTimelines = function () { + { // Update bone and surface timelines. + var boneTimelines = {}; + // Create bone timelines map. + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + var timelineName = timeline.target.target.name; + if (!(timelineName in boneTimelines)) { + boneTimelines[timelineName] = []; + } + boneTimelines[timelineName].push(timeline); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + var timelineName = timeline.target.target.name; + if (!(timelineName in boneTimelines)) { + boneTimelines[timelineName] = []; + } + boneTimelines[timelineName].push(timeline); + } + // + for (var _d = 0, _e = this._armature.getBones(); _d < _e.length; _d++) { + var bone = _e[_d]; + var timelineName = bone.name; + if (!this.containsBoneMask(timelineName)) { + continue; + } + if (timelineName in boneTimelines) { // Remove bone timeline from map. + delete boneTimelines[timelineName]; + } + else { // Create new bone timeline. + var timelineDatas = this._animationData.getBoneTimelines(timelineName); + var blendState = this._armature.animation.getBlendState(BlendState.BONE_TRANSFORM, bone.name, bone); + if (timelineDatas !== null) { + for (var _f = 0, timelineDatas_2 = timelineDatas; _f < timelineDatas_2.length; _f++) { + var timelineData = timelineDatas_2[_f]; + switch (timelineData.type) { + case 10 /* BoneAll */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 11 /* BoneTranslate */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneTranslateTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 12 /* BoneRotate */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneRotateTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 13 /* BoneScale */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneScaleTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 60 /* BoneAlpha */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.BONE_ALPHA, bone.name, bone); + timeline.init(this._armature, this, timelineData); + this._boneBlendTimelines.push(timeline); + break; + } + case 50 /* Surface */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone); + timeline.init(this._armature, this, timelineData); + this._boneBlendTimelines.push(timeline); + break; + } + default: + break; + } + } + } + else if (this.resetToPose) { // Pose timeline. + if (bone._boneData.type === 0 /* Bone */) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, null); + this._boneTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + else { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone); + timeline.init(this._armature, this, null); + this._boneBlendTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + } + for (var k in boneTimelines) { // Remove bone timelines. + for (var _g = 0, _h = boneTimelines[k]; _g < _h.length; _g++) { + var timeline = _h[_g]; + var index = this._boneTimelines.indexOf(timeline); + if (index >= 0) { + this._boneTimelines.splice(index, 1); + timeline.returnToPool(); + } + index = this._boneBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._boneBlendTimelines.splice(index, 1); + timeline.returnToPool(); + } + } + } + } + { // Update slot timelines. + var slotTimelines = {}; + var ffdFlags = []; + // Create slot timelines map. + for (var _j = 0, _k = this._slotTimelines; _j < _k.length; _j++) { + var timeline = _k[_j]; + var timelineName = timeline.target.name; + if (!(timelineName in slotTimelines)) { + slotTimelines[timelineName] = []; + } + slotTimelines[timelineName].push(timeline); + } + for (var _l = 0, _m = this._slotBlendTimelines; _l < _m.length; _l++) { + var timeline = _m[_l]; + var timelineName = timeline.target.target.name; + if (!(timelineName in slotTimelines)) { + slotTimelines[timelineName] = []; + } + slotTimelines[timelineName].push(timeline); + } + // + for (var _o = 0, _p = this._armature.getSlots(); _o < _p.length; _o++) { + var slot = _p[_o]; + var boneName = slot.parent.name; + if (!this.containsBoneMask(boneName)) { + continue; + } + var timelineName = slot.name; + if (timelineName in slotTimelines) { // Remove slot timeline from map. + delete slotTimelines[timelineName]; + } + else { // Create new slot timeline. + var displayIndexFlag = false; + var colorFlag = false; + ffdFlags.length = 0; + var timelineDatas = this._animationData.getSlotTimelines(timelineName); + if (timelineDatas !== null) { + for (var _q = 0, timelineDatas_3 = timelineDatas; _q < timelineDatas_3.length; _q++) { + var timelineData = timelineDatas_3[_q]; + switch (timelineData.type) { + case 20 /* SlotDisplay */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, timelineData); + this._slotTimelines.push(timeline); + displayIndexFlag = true; + break; + } + case 23 /* SlotZIndex */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotZIndexTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_Z_INDEX, slot.name, slot); + timeline.init(this._armature, this, timelineData); + this._slotBlendTimelines.push(timeline); + break; + } + case 21 /* SlotColor */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, timelineData); + this._slotTimelines.push(timeline); + colorFlag = true; + break; + } + case 22 /* SlotDeform */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot); + timeline.init(this._armature, this, timelineData); + if (timeline.target !== null) { + this._slotBlendTimelines.push(timeline); + ffdFlags.push(timeline.geometryOffset); + } + else { + timeline.returnToPool(); + } + break; + } + case 24 /* SlotAlpha */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_ALPHA, slot.name, slot); + timeline.init(this._armature, this, timelineData); + this._slotBlendTimelines.push(timeline); + break; + } + default: + break; + } + } + } + if (this.resetToPose) { // Pose timeline. + if (!displayIndexFlag) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, null); + this._slotTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + if (!colorFlag) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, null); + this._slotTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayFrame = slot.getDisplayFrameAt(i); + if (displayFrame.deformVertices.length === 0) { + continue; + } + var geometryData = displayFrame.getGeometryData(); + if (geometryData !== null && ffdFlags.indexOf(geometryData.offset) < 0) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState); + timeline.geometryOffset = geometryData.offset; // + timeline.displayFrame = displayFrame; // + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot); + timeline.init(this._armature, this, null); + this._slotBlendTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + } + } + for (var k in slotTimelines) { // Remove slot timelines. + for (var _r = 0, _s = slotTimelines[k]; _r < _s.length; _r++) { + var timeline = _s[_r]; + var index = this._slotTimelines.indexOf(timeline); + if (index >= 0) { + this._slotTimelines.splice(index, 1); + timeline.returnToPool(); + } + index = this._slotBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._slotBlendTimelines.splice(index, 1); + timeline.returnToPool(); + } + } + } + } + }; + AnimationState.prototype._advanceFadeTime = function (passedTime) { + var isFadeOut = this._fadeState > 0; + if (this._subFadeState < 0) { // Fade start event. + this._subFadeState = 0; + var eventActive = this._parent === null && this.actionEnabled; + if (eventActive) { + var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN; + if (this._armature.eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = eventType; + eventObject.armature = this._armature; + eventObject.animationState = this; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + if (passedTime < 0.0) { + passedTime = -passedTime; + } + this._fadeTime += passedTime; + if (this._fadeTime >= this.fadeTotalTime) { // Fade complete. + this._subFadeState = 1; + this._fadeProgress = isFadeOut ? 0.0 : 1.0; + } + else if (this._fadeTime > 0.0) { // Fading. + this._fadeProgress = isFadeOut ? (1.0 - this._fadeTime / this.fadeTotalTime) : (this._fadeTime / this.fadeTotalTime); + } + else { // Before fade. + this._fadeProgress = isFadeOut ? 1.0 : 0.0; + } + if (this._subFadeState > 0) { // Fade complete event. + if (!isFadeOut) { + this._playheadState |= 1; // x1 + this._fadeState = 0; + } + var eventActive = this._parent === null && this.actionEnabled; + if (eventActive) { + var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE; + if (this._armature.eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = eventType; + eventObject.armature = this._armature; + eventObject.animationState = this; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + }; + /** + * @internal + */ + AnimationState.prototype.init = function (armature, animationData, animationConfig) { + if (this._armature !== null) { + return; + } + this._armature = armature; + this._animationData = animationData; + // + this.resetToPose = animationConfig.resetToPose; + this.additive = animationConfig.additive; + this.displayControl = animationConfig.displayControl; + this.actionEnabled = animationConfig.actionEnabled; + this.blendType = animationData.blendType; + this.layer = animationConfig.layer; + this.playTimes = animationConfig.playTimes; + this.timeScale = animationConfig.timeScale; + this.fadeTotalTime = animationConfig.fadeInTime; + this.autoFadeOutTime = animationConfig.autoFadeOutTime; + this.name = animationConfig.name.length > 0 ? animationConfig.name : animationConfig.animation; + this.group = animationConfig.group; + // + this._weight = animationConfig.weight; + if (animationConfig.pauseFadeIn) { + this._playheadState = 2; // 10 + } + else { + this._playheadState = 3; // 11 + } + if (animationConfig.duration < 0.0) { + this._position = 0.0; + this._duration = this._animationData.duration; + if (animationConfig.position !== 0.0) { + if (this.timeScale >= 0.0) { + this._time = animationConfig.position; + } + else { + this._time = animationConfig.position - this._duration; + } + } + else { + this._time = 0.0; + } + } + else { + this._position = animationConfig.position; + this._duration = animationConfig.duration; + this._time = 0.0; + } + if (this.timeScale < 0.0 && this._time === 0.0) { + this._time = -0.000001; // Turn to end. + } + if (this.fadeTotalTime <= 0.0) { + this._fadeProgress = 0.999999; // Make different. + } + if (animationConfig.boneMask.length > 0) { + this._boneMask.length = animationConfig.boneMask.length; + for (var i = 0, l = this._boneMask.length; i < l; ++i) { + this._boneMask[i] = animationConfig.boneMask[i]; + } + } + this._actionTimeline = dragonBones.BaseObject.borrowObject(dragonBones.ActionTimelineState); + this._actionTimeline.init(this._armature, this, this._animationData.actionTimeline); + this._actionTimeline.currentTime = this._time; + if (this._actionTimeline.currentTime < 0.0) { + this._actionTimeline.currentTime = this._duration - this._actionTimeline.currentTime; + } + if (this._animationData.zOrderTimeline !== null) { + this._zOrderTimeline = dragonBones.BaseObject.borrowObject(dragonBones.ZOrderTimelineState); + this._zOrderTimeline.init(this._armature, this, this._animationData.zOrderTimeline); + } + }; + /** + * @internal + */ + AnimationState.prototype.advanceTime = function (passedTime, cacheFrameRate) { + // Update fade time. + if (this._fadeState !== 0 || this._subFadeState !== 0) { + this._advanceFadeTime(passedTime); + } + // Update time. + if (this._playheadState === 3) { // 11 + if (this.timeScale !== 1.0) { + passedTime *= this.timeScale; + } + this._time += passedTime; + } + // Update timeline. + if (this._timelineDirty !== 0) { + if (this._timelineDirty === 2) { + this._updateTimelines(); + } + this._timelineDirty = 0; + this._updateBoneAndSlotTimelines(); + } + var isBlendDirty = this._fadeState !== 0 || this._subFadeState === 0; + var isCacheEnabled = this._fadeState === 0 && cacheFrameRate > 0.0; + var isUpdateTimeline = true; + var isUpdateBoneTimeline = true; + var time = this._time; + this._weightResult = this._weight * this._fadeProgress; + if (this._parent !== null) { + this._weightResult *= this._parent._weightResult; + } + if (this._actionTimeline.playState <= 0) { // Update main timeline. + this._actionTimeline.update(time); + } + if (this._weight === 0.0) { + return; + } + if (isCacheEnabled) { // Cache time internval. + var internval = cacheFrameRate * 2.0; + this._actionTimeline.currentTime = Math.floor(this._actionTimeline.currentTime * internval) / internval; + } + if (this._zOrderTimeline !== null && this._zOrderTimeline.playState <= 0) { // Update zOrder timeline. + this._zOrderTimeline.update(time); + } + if (isCacheEnabled) { // Update cache. + var cacheFrameIndex = Math.floor(this._actionTimeline.currentTime * cacheFrameRate); // uint + if (this._armature._cacheFrameIndex === cacheFrameIndex) { // Same cache. + isUpdateTimeline = false; + isUpdateBoneTimeline = false; + } + else { + this._armature._cacheFrameIndex = cacheFrameIndex; + if (this._animationData.cachedFrames[cacheFrameIndex]) { // Cached. + isUpdateBoneTimeline = false; + } + else { // Cache. + this._animationData.cachedFrames[cacheFrameIndex] = true; + } + } + } + if (isUpdateTimeline) { + var isBlend = false; + var prevTarget = null; // + if (isUpdateBoneTimeline) { + for (var i = 0, l = this._boneTimelines.length; i < l; ++i) { + var timeline = this._boneTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (timeline.target !== prevTarget) { + var blendState = timeline.target; + isBlend = blendState.update(this); + prevTarget = blendState; + if (blendState.dirty === 1) { + var pose = blendState.target.animationPose; + pose.x = 0.0; + pose.y = 0.0; + pose.rotation = 0.0; + pose.skew = 0.0; + pose.scaleX = 1.0; + pose.scaleY = 1.0; + } + } + if (isBlend) { + timeline.blend(isBlendDirty); + } + } + } + for (var i = 0, l = this._boneBlendTimelines.length; i < l; ++i) { + var timeline = this._boneBlendTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (timeline.target.update(this)) { + timeline.blend(isBlendDirty); + } + } + if (this.displayControl) { + for (var i = 0, l = this._slotTimelines.length; i < l; ++i) { + var timeline = this._slotTimelines[i]; + if (timeline.playState <= 0) { + var slot = timeline.target; + var displayController = slot.displayController; + if (displayController === null || + displayController === this.name || + displayController === this.group) { + timeline.update(time); + } + } + } + } + for (var i = 0, l = this._slotBlendTimelines.length; i < l; ++i) { + var timeline = this._slotBlendTimelines[i]; + if (timeline.playState <= 0) { + var blendState = timeline.target; + timeline.update(time); + if (blendState.update(this)) { + timeline.blend(isBlendDirty); + } + } + } + for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) { + var timeline = this._constraintTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + } + if (this._animationTimelines.length > 0) { + var dL = 100.0; + var dR = 100.0; + var leftState = null; + var rightState = null; + for (var i = 0, l = this._animationTimelines.length; i < l; ++i) { + var timeline = this._animationTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (this.blendType === 1 /* E1D */) { // TODO + var animationState = timeline.target; + var d = this.parameterX - animationState.positionX; + if (d >= 0.0) { + if (d < dL) { + dL = d; + leftState = animationState; + } + } + else { + if (-d < dR) { + dR = -d; + rightState = animationState; + } + } + } + } + if (leftState !== null) { + if (this._activeChildA !== leftState) { + if (this._activeChildA !== null) { + this._activeChildA.weight = 0.0; + } + this._activeChildA = leftState; + this._activeChildA.activeTimeline(); + } + if (this._activeChildB !== rightState) { + if (this._activeChildB !== null) { + this._activeChildB.weight = 0.0; + } + this._activeChildB = rightState; + } + leftState.weight = dR / (dL + dR); + if (rightState) { + rightState.weight = 1.0 - leftState.weight; + } + } + } + } + if (this._fadeState === 0) { + if (this._subFadeState > 0) { + this._subFadeState = 0; + if (this._poseTimelines.length > 0) { // Remove pose timelines. + for (var _i = 0, _a = this._poseTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + var index = this._boneTimelines.indexOf(timeline); + if (index >= 0) { + this._boneTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._boneBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._boneBlendTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._slotTimelines.indexOf(timeline); + if (index >= 0) { + this._slotTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._slotBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._slotBlendTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._constraintTimelines.indexOf(timeline); + if (index >= 0) { + this._constraintTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + } + this._poseTimelines.length = 0; + } + } + if (this._actionTimeline.playState > 0) { + if (this.autoFadeOutTime >= 0.0) { // Auto fade out. + this.fadeOut(this.autoFadeOutTime); + } + } + } + }; + /** + * - Continue play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 继续播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.play = function () { + this._playheadState = 3; // 11 + }; + /** + * - Stop play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.stop = function () { + this._playheadState &= 1; // 0x + }; + /** + * - Fade out the animation state. + * @param fadeOutTime - The fade out time. (In seconds) + * @param pausePlayhead - Whether to pause the animation playing when fade out. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 淡出动画状态。 + * @param fadeOutTime - 淡出时间。 (以秒为单位) + * @param pausePlayhead - 淡出时是否暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.fadeOut = function (fadeOutTime, pausePlayhead) { + if (pausePlayhead === void 0) { pausePlayhead = true; } + if (fadeOutTime < 0.0) { + fadeOutTime = 0.0; + } + if (pausePlayhead) { + this._playheadState &= 2; // x0 + } + if (this._fadeState > 0) { + if (fadeOutTime > this.fadeTotalTime - this._fadeTime) { // If the animation is already in fade out, the new fade out will be ignored. + return; + } + } + else { + this._fadeState = 1; + this._subFadeState = -1; + if (fadeOutTime <= 0.0 || this._fadeProgress <= 0.0) { + this._fadeProgress = 0.000001; // Modify fade progress to different value. + } + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.fadeOut(); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.fadeOut(); + } + for (var _d = 0, _e = this._slotTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.fadeOut(); + } + for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.fadeOut(); + } + for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) { + var timeline = _j[_h]; + timeline.fadeOut(); + } + for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) { + var timeline = _l[_k]; + timeline.fadeOut(); + // + var animaitonState = timeline.target; + animaitonState.fadeOut(999999.0, true); + } + } + this.displayControl = false; // + this.fadeTotalTime = this._fadeProgress > 0.000001 ? fadeOutTime / this._fadeProgress : 0.0; + this._fadeTime = this.fadeTotalTime * (1.0 - this._fadeProgress); + }; + /** + * - Check if a specific bone mask is included. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.containsBoneMask = function (boneName) { + return this._boneMask.length === 0 || this._boneMask.indexOf(boneName) >= 0; + }; + /** + * - Add a specific bone mask. + * @param boneName - The bone name. + * @param recursive - Whether or not to add a mask to the bone's sub-bone. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加特定的骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.addBoneMask = function (boneName, recursive) { + if (recursive === void 0) { recursive = true; } + var currentBone = this._armature.getBone(boneName); + if (currentBone === null) { + return; + } + if (this._boneMask.indexOf(boneName) < 0) { // Add mixing + this._boneMask.push(boneName); + } + if (recursive) { // Add recursive mixing. + for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { + var bone = _a[_i]; + if (this._boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) { + this._boneMask.push(bone.name); + } + } + } + this._timelineDirty = 1; + }; + /** + * - Remove the mask of a specific bone. + * @param boneName - The bone name. + * @param recursive - Whether to remove the bone's sub-bone mask. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除特定骨骼的遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.removeBoneMask = function (boneName, recursive) { + if (recursive === void 0) { recursive = true; } + var index = this._boneMask.indexOf(boneName); + if (index >= 0) { // Remove mixing. + this._boneMask.splice(index, 1); + } + if (recursive) { + var currentBone = this._armature.getBone(boneName); + if (currentBone !== null) { + var bones = this._armature.getBones(); + if (this._boneMask.length > 0) { // Remove recursive mixing. + for (var _i = 0, bones_1 = bones; _i < bones_1.length; _i++) { + var bone = bones_1[_i]; + var index_1 = this._boneMask.indexOf(bone.name); + if (index_1 >= 0 && currentBone.contains(bone)) { + this._boneMask.splice(index_1, 1); + } + } + } + else { // Add unrecursive mixing. + for (var _a = 0, bones_2 = bones; _a < bones_2.length; _a++) { + var bone = bones_2[_a]; + if (bone === currentBone) { + continue; + } + if (!currentBone.contains(bone)) { + this._boneMask.push(bone.name); + } + } + } + } + } + this._timelineDirty = 1; + }; + /** + * - Remove all bone masks. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.removeAllBoneMask = function () { + this._boneMask.length = 0; + this._timelineDirty = 1; + }; + /** + * @private + */ + AnimationState.prototype.addState = function (animationState, timelineDatas) { + if (timelineDatas === void 0) { timelineDatas = null; } + if (timelineDatas !== null) { + for (var _i = 0, timelineDatas_4 = timelineDatas; _i < timelineDatas_4.length; _i++) { + var timelineData = timelineDatas_4[_i]; + switch (timelineData.type) { + case 40 /* AnimationProgress */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationProgressTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + if (this.blendType !== 0 /* None */) { + var animaitonTimelineData = timelineData; + animationState.positionX = animaitonTimelineData.x; + animationState.positionY = animaitonTimelineData.y; + animationState.weight = 0.0; + } + animationState._parent = this; + this.resetToPose = false; + break; + } + case 41 /* AnimationWeight */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationWeightTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + break; + } + case 42 /* AnimationParameter */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationParametersTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + break; + } + default: + break; + } + } + } + if (animationState._parent === null) { + animationState._parent = this; + } + }; + /** + * @internal + */ + AnimationState.prototype.activeTimeline = function () { + for (var _i = 0, _a = this._slotTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.dirty = true; + timeline.currentTime = -1.0; + } + }; + Object.defineProperty(AnimationState.prototype, "isFadeIn", { + /** + * - Whether the animation state is fading in. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡入。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState < 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isFadeOut", { + /** + * - Whether the animation state is fading out. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡出。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isFadeComplete", { + /** + * - Whether the animation state is fade completed. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否淡入或淡出完毕。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState === 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isPlaying", { + /** + * - Whether the animation state is playing. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否正在播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return (this._playheadState & 2) !== 0 && this._actionTimeline.playState <= 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isCompleted", { + /** + * - Whether the animation state is play completed. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否播放完毕。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.playState > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "currentPlayTimes", { + /** + * - The times has been played. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 已经循环播放的次数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.currentPlayTimes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "totalTime", { + /** + * - The total time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 总播放时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._duration; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "currentTime", { + /** + * - The time is currently playing. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前播放的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.currentTime; + }, + set: function (value) { + var currentPlayTimes = this._actionTimeline.currentPlayTimes - (this._actionTimeline.playState > 0 ? 1 : 0); + if (value < 0 || this._duration < value) { + value = (value % this._duration) + currentPlayTimes * this._duration; + if (value < 0) { + value += this._duration; + } + } + if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 && + value === this._duration && this._parent === null) { + value = this._duration - 0.000001; // + } + if (this._time === value) { + return; + } + this._time = value; + this._actionTimeline.setCurrentTime(this._time); + if (this._zOrderTimeline !== null) { + this._zOrderTimeline.playState = -1; + } + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.playState = -1; + } + for (var _b = 0, _c = this._slotTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.playState = -1; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "weight", { + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + /** + * - The animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + get: function () { + return this._weight; + }, + set: function (value) { + if (this._weight === value) { + return; + } + this._weight = value; + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.dirty = true; + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.dirty = true; + } + for (var _d = 0, _e = this._slotBlendTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.dirty = true; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "animationData", { + /** + * - 动画数据。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._animationData; + }, + enumerable: true, + configurable: true + }); + return AnimationState; + }(dragonBones.BaseObject)); + dragonBones.AnimationState = AnimationState; + /** + * @internal + */ + var BlendState = /** @class */ (function (_super) { + __extends(BlendState, _super); + function BlendState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlendState.toString = function () { + return "[class dragonBones.BlendState]"; + }; + BlendState.prototype._onClear = function () { + this.reset(); + this.target = null; + }; + BlendState.prototype.update = function (animationState) { + var animationLayer = animationState.layer; + var animationWeight = animationState._weightResult; + if (this.dirty > 0) { + if (this.leftWeight > 0.0) { + if (this.layer !== animationLayer) { + if (this.layerWeight >= this.leftWeight) { + this.dirty++; + this.layer = animationLayer; + this.leftWeight = 0.0; + this.blendWeight = 0.0; + return false; + } + this.layer = animationLayer; + this.leftWeight -= this.layerWeight; + this.layerWeight = 0.0; + } + animationWeight *= this.leftWeight; + this.dirty++; + this.blendWeight = animationWeight; + this.layerWeight += this.blendWeight; + return true; + } + return false; + } + this.dirty++; + this.layer = animationLayer; + this.leftWeight = 1.0; + this.blendWeight = animationWeight; + this.layerWeight = animationWeight; + return true; + }; + BlendState.prototype.reset = function () { + this.dirty = 0; + this.layer = 0; + this.leftWeight = 0.0; + this.layerWeight = 0.0; + this.blendWeight = 0.0; + }; + BlendState.BONE_TRANSFORM = "boneTransform"; + BlendState.BONE_ALPHA = "boneAlpha"; + BlendState.SURFACE = "surface"; + BlendState.SLOT_DEFORM = "slotDeform"; + BlendState.SLOT_ALPHA = "slotAlpha"; + BlendState.SLOT_Z_INDEX = "slotZIndex"; + return BlendState; + }(dragonBones.BaseObject)); + dragonBones.BlendState = BlendState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var TimelineState = /** @class */ (function (_super) { + __extends(TimelineState, _super); + function TimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimelineState.prototype._onClear = function () { + this.dirty = false; + this.playState = -1; + this.currentPlayTimes = 0; + this.currentTime = -1.0; + this.target = null; + this._isTween = false; + this._valueOffset = 0; + this._frameValueOffset = 0; + this._frameOffset = 0; + this._frameRate = 0; + this._frameCount = 0; + this._frameIndex = -1; + this._frameRateR = 0.0; + this._position = 0.0; + this._duration = 0.0; + this._timeScale = 1.0; + this._timeOffset = 0.0; + this._animationData = null; // + this._timelineData = null; // + this._armature = null; // + this._animationState = null; // + this._actionTimeline = null; // + this._frameArray = null; // + this._valueArray = null; // + this._timelineArray = null; // + this._frameIndices = null; // + }; + TimelineState.prototype._setCurrentTime = function (passedTime) { + var prevState = this.playState; + var prevPlayTimes = this.currentPlayTimes; + var prevTime = this.currentTime; + if (this._actionTimeline !== null && this._frameCount <= 1) { // No frame or only one frame. + this.playState = this._actionTimeline.playState >= 0 ? 1 : -1; + this.currentPlayTimes = 1; + this.currentTime = this._actionTimeline.currentTime; + } + else if (this._actionTimeline === null || this._timeScale !== 1.0 || this._timeOffset !== 0.0) { // Action timeline or has scale and offset. + var playTimes = this._animationState.playTimes; + var totalTime = playTimes * this._duration; + passedTime *= this._timeScale; + if (this._timeOffset !== 0.0) { + passedTime += this._timeOffset * this._animationData.duration; + } + if (playTimes > 0 && (passedTime >= totalTime || passedTime <= -totalTime)) { + if (this.playState <= 0 && this._animationState._playheadState === 3) { + this.playState = 1; + } + this.currentPlayTimes = playTimes; + if (passedTime < 0.0) { + this.currentTime = 0.0; + } + else { + this.currentTime = this.playState === 1 ? this._duration + 0.000001 : this._duration; // Precision problem + } + } + else { + if (this.playState !== 0 && this._animationState._playheadState === 3) { + this.playState = 0; + } + if (passedTime < 0.0) { + passedTime = -passedTime; + this.currentPlayTimes = Math.floor(passedTime / this._duration); + this.currentTime = this._duration - (passedTime % this._duration); + } + else { + this.currentPlayTimes = Math.floor(passedTime / this._duration); + this.currentTime = passedTime % this._duration; + } + } + this.currentTime += this._position; + } + else { // Multi frames. + this.playState = this._actionTimeline.playState; + this.currentPlayTimes = this._actionTimeline.currentPlayTimes; + this.currentTime = this._actionTimeline.currentTime; + } + if (this.currentPlayTimes === prevPlayTimes && this.currentTime === prevTime) { + return false; + } + // Clear frame flag when timeline start or loopComplete. + if ((prevState < 0 && this.playState !== prevState) || + (this.playState <= 0 && this.currentPlayTimes !== prevPlayTimes)) { + this._frameIndex = -1; + } + return true; + }; + TimelineState.prototype.init = function (armature, animationState, timelineData) { + this._armature = armature; + this._animationState = animationState; + this._timelineData = timelineData; + this._actionTimeline = this._animationState._actionTimeline; + if (this === this._actionTimeline) { + this._actionTimeline = null; // + } + this._animationData = this._animationState.animationData; + // + this._frameRate = this._animationData.parent.frameRate; + this._frameRateR = 1.0 / this._frameRate; + this._position = this._animationState._position; + this._duration = this._animationState._duration; + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data. + this._frameArray = dragonBonesData.frameArray; + this._timelineArray = dragonBonesData.timelineArray; + this._frameIndices = dragonBonesData.frameIndices; + // + this._frameCount = this._timelineArray[this._timelineData.offset + 2 /* TimelineKeyFrameCount */]; + this._frameValueOffset = this._timelineArray[this._timelineData.offset + 4 /* TimelineFrameValueOffset */]; + this._timeScale = 100.0 / this._timelineArray[this._timelineData.offset + 0 /* TimelineScale */]; + this._timeOffset = this._timelineArray[this._timelineData.offset + 1 /* TimelineOffset */] * 0.01; + } + }; + TimelineState.prototype.fadeOut = function () { + this.dirty = false; + }; + TimelineState.prototype.update = function (passedTime) { + if (this._setCurrentTime(passedTime)) { + if (this._frameCount > 1) { + var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint + var frameIndex = this._frameIndices[this._timelineData.frameIndicesOffset + timelineFrameIndex]; + if (this._frameIndex !== frameIndex) { + this._frameIndex = frameIndex; + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex]; + this._onArriveAtFrame(); + } + } + else if (this._frameIndex < 0) { + this._frameIndex = 0; + if (this._timelineData !== null) { // May be pose timeline. + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */]; + } + this._onArriveAtFrame(); + } + if (this._isTween || this.dirty) { + this._onUpdateFrame(); + } + } + }; + TimelineState.prototype.blend = function (_isDirty) { + }; + return TimelineState; + }(dragonBones.BaseObject)); + dragonBones.TimelineState = TimelineState; + /** + * @internal + */ + var TweenTimelineState = /** @class */ (function (_super) { + __extends(TweenTimelineState, _super); + function TweenTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + TweenTimelineState._getEasingValue = function (tweenType, progress, easing) { + var value = progress; + switch (tweenType) { + case 3 /* QuadIn */: + value = Math.pow(progress, 2.0); + break; + case 4 /* QuadOut */: + value = 1.0 - Math.pow(1.0 - progress, 2.0); + break; + case 5 /* QuadInOut */: + value = 0.5 * (1.0 - Math.cos(progress * Math.PI)); + break; + } + return (value - progress) * easing + progress; + }; + TweenTimelineState._getEasingCurveValue = function (progress, samples, count, offset) { + if (progress <= 0.0) { + return 0.0; + } + else if (progress >= 1.0) { + return 1.0; + } + var isOmited = count > 0; + var segmentCount = count + 1; // + 2 - 1 + var valueIndex = Math.floor(progress * segmentCount); + var fromValue = 0.0; + var toValue = 0.0; + if (isOmited) { + fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1]; + toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex]; + } + else { + fromValue = samples[offset + valueIndex - 1]; + toValue = samples[offset + valueIndex]; + } + return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001; + }; + TweenTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._tweenType = 0 /* None */; + this._curveCount = 0; + this._framePosition = 0.0; + this._frameDurationR = 0.0; + this._tweenEasing = 0.0; + this._tweenProgress = 0.0; + this._valueScale = 1.0; + }; + TweenTimelineState.prototype._onArriveAtFrame = function () { + if (this._frameCount > 1 && + (this._frameIndex !== this._frameCount - 1 || + this._animationState.playTimes === 0 || + this._animationState.currentPlayTimes < this._animationState.playTimes - 1)) { + this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */]; + this._isTween = this._tweenType !== 0 /* None */; + if (this._isTween) { + if (this._tweenType === 2 /* Curve */) { + this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */]; + } + else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) { + this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01; + } + } + else { + this.dirty = true; + } + this._framePosition = this._frameArray[this._frameOffset] * this._frameRateR; + if (this._frameIndex === this._frameCount - 1) { + this._frameDurationR = 1.0 / (this._animationData.duration - this._framePosition); + } + else { + var nextFrameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex + 1]; + var frameDuration = this._frameArray[nextFrameOffset] * this._frameRateR - this._framePosition; + if (frameDuration > 0) { + this._frameDurationR = 1.0 / frameDuration; + } + else { + this._frameDurationR = 0.0; + } + } + } + else { + this.dirty = true; + this._isTween = false; + } + }; + TweenTimelineState.prototype._onUpdateFrame = function () { + if (this._isTween) { + this.dirty = true; + this._tweenProgress = (this.currentTime - this._framePosition) * this._frameDurationR; + if (this._tweenType === 2 /* Curve */) { + this._tweenProgress = TweenTimelineState._getEasingCurveValue(this._tweenProgress, this._frameArray, this._curveCount, this._frameOffset + 3 /* FrameCurveSamples */); + } + else if (this._tweenType !== 1 /* Line */) { + this._tweenProgress = TweenTimelineState._getEasingValue(this._tweenType, this._tweenProgress, this._tweenEasing); + } + } + }; + return TweenTimelineState; + }(TimelineState)); + dragonBones.TweenTimelineState = TweenTimelineState; + /** + * @internal + */ + var SingleValueTimelineState = /** @class */ (function (_super) { + __extends(SingleValueTimelineState, _super); + function SingleValueTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SingleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._current = 0.0; + this._difference = 0.0; + this._result = 0.0; + }; + SingleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + 1; + if (valueScale === 1.0) { + this._current = valueArray[valueOffset]; + this._difference = valueArray[nextValueOffset] - this._current; + } + else { + this._current = valueArray[valueOffset] * valueScale; + this._difference = valueArray[nextValueOffset] * valueScale - this._current; + } + } + else { + this._result = valueArray[valueOffset] * valueScale; + } + } + else { + this._result = 0.0; + } + }; + SingleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._result = this._current + this._difference * this._tweenProgress; + } + }; + return SingleValueTimelineState; + }(TweenTimelineState)); + dragonBones.SingleValueTimelineState = SingleValueTimelineState; + /** + * @internal + */ + var DoubleValueTimelineState = /** @class */ (function (_super) { + __extends(DoubleValueTimelineState, _super); + function DoubleValueTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + DoubleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._currentA = 0.0; + this._currentB = 0.0; + this._differenceA = 0.0; + this._differenceB = 0.0; + this._resultA = 0.0; + this._resultB = 0.0; + }; + DoubleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * 2; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + 2; + if (valueScale === 1.0) { + this._currentA = valueArray[valueOffset]; + this._currentB = valueArray[valueOffset + 1]; + this._differenceA = valueArray[nextValueOffset] - this._currentA; + this._differenceB = valueArray[nextValueOffset + 1] - this._currentB; + } + else { + this._currentA = valueArray[valueOffset] * valueScale; + this._currentB = valueArray[valueOffset + 1] * valueScale; + this._differenceA = valueArray[nextValueOffset] * valueScale - this._currentA; + this._differenceB = valueArray[nextValueOffset + 1] * valueScale - this._currentB; + } + } + else { + this._resultA = valueArray[valueOffset] * valueScale; + this._resultB = valueArray[valueOffset + 1] * valueScale; + } + } + else { + this._resultA = 0.0; + this._resultB = 0.0; + } + }; + DoubleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._resultA = this._currentA + this._differenceA * this._tweenProgress; + this._resultB = this._currentB + this._differenceB * this._tweenProgress; + } + }; + return DoubleValueTimelineState; + }(TweenTimelineState)); + dragonBones.DoubleValueTimelineState = DoubleValueTimelineState; + /** + * @internal + */ + var MutilpleValueTimelineState = /** @class */ (function (_super) { + __extends(MutilpleValueTimelineState, _super); + function MutilpleValueTimelineState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._rd = []; + return _this; + } + MutilpleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._valueCount = 0; + this._rd.length = 0; + }; + MutilpleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + var valueCount = this._valueCount; + var rd = this._rd; + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + valueCount; + if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[valueCount + i] = valueArray[nextValueOffset + i] - valueArray[valueOffset + i]; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[valueCount + i] = (valueArray[nextValueOffset + i] - valueArray[valueOffset + i]) * valueScale; + } + } + } + else if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i]; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] * valueScale; + } + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = 0.0; + } + } + }; + MutilpleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + var valueCount = this._valueCount; + var valueScale = this._valueScale; + var tweenProgress = this._tweenProgress; + var valueArray = this._valueArray; + var rd = this._rd; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount; + if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] + rd[valueCount + i] * tweenProgress; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] * valueScale + rd[valueCount + i] * tweenProgress; + } + } + } + }; + return MutilpleValueTimelineState; + }(TweenTimelineState)); + dragonBones.MutilpleValueTimelineState = MutilpleValueTimelineState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var ActionTimelineState = /** @class */ (function (_super) { + __extends(ActionTimelineState, _super); + function ActionTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + ActionTimelineState.toString = function () { + return "[class dragonBones.ActionTimelineState]"; + }; + ActionTimelineState.prototype._onCrossFrame = function (frameIndex) { + var eventDispatcher = this._armature.eventDispatcher; + if (this._animationState.actionEnabled) { + var frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + frameIndex]; + var actionCount = this._frameArray[frameOffset + 1]; + var actions = this._animationData.parent.actions; // May be the animaton data not belong to this armature data. + for (var i = 0; i < actionCount; ++i) { + var actionIndex = this._frameArray[frameOffset + 2 + i]; + var action = actions[actionIndex]; + if (action.type === 0 /* Play */) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + // eventObject.time = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + eventObject.time = this._frameArray[frameOffset] / this._frameRate; + eventObject.animationState = this._animationState; + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + this._armature._bufferAction(eventObject, true); + } + else { + var eventType = action.type === 10 /* Frame */ ? dragonBones.EventObject.FRAME_EVENT : dragonBones.EventObject.SOUND_EVENT; + if (action.type === 11 /* Sound */ || eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + // eventObject.time = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + eventObject.time = this._frameArray[frameOffset] / this._frameRate; + eventObject.animationState = this._animationState; + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + } + }; + ActionTimelineState.prototype._onArriveAtFrame = function () { }; + ActionTimelineState.prototype._onUpdateFrame = function () { }; + ActionTimelineState.prototype.update = function (passedTime) { + var prevState = this.playState; + var prevPlayTimes = this.currentPlayTimes; + var prevTime = this.currentTime; + if (this._setCurrentTime(passedTime)) { + var eventActive = this._animationState._parent === null && this._animationState.actionEnabled; + var eventDispatcher = this._armature.eventDispatcher; + if (prevState < 0) { + if (this.playState !== prevState) { + if (this._animationState.displayControl && this._animationState.resetToPose) { // Reset zorder to pose. + this._armature._sortZOrder(null, 0); + } + // prevPlayTimes = this.currentPlayTimes; // TODO + if (eventActive && eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = dragonBones.EventObject.START; + eventObject.armature = this._armature; + eventObject.animationState = this._animationState; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + else { + return; + } + } + var isReverse = this._animationState.timeScale < 0.0; + var loopCompleteEvent = null; + var completeEvent = null; + if (eventActive && this.currentPlayTimes !== prevPlayTimes) { + if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.LOOP_COMPLETE)) { + loopCompleteEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + loopCompleteEvent.type = dragonBones.EventObject.LOOP_COMPLETE; + loopCompleteEvent.armature = this._armature; + loopCompleteEvent.animationState = this._animationState; + } + if (this.playState > 0) { + if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.COMPLETE)) { + completeEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + completeEvent.type = dragonBones.EventObject.COMPLETE; + completeEvent.armature = this._armature; + completeEvent.animationState = this._animationState; + } + } + } + if (this._frameCount > 1) { + var timelineData = this._timelineData; + var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint + var frameIndex = this._frameIndices[timelineData.frameIndicesOffset + timelineFrameIndex]; + if (this._frameIndex !== frameIndex) { // Arrive at frame. + var crossedFrameIndex = this._frameIndex; + this._frameIndex = frameIndex; + if (this._timelineArray !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex]; + if (isReverse) { + if (crossedFrameIndex < 0) { + var prevFrameIndex = Math.floor(prevTime * this._frameRate); + crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex]; + if (this.currentPlayTimes === prevPlayTimes) { // Start. + if (crossedFrameIndex === frameIndex) { // Uncrossed. + crossedFrameIndex = -1; + } + } + } + while (crossedFrameIndex >= 0) { + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this._position <= framePosition && + framePosition <= this._position + this._duration) { // Support interval play. + this._onCrossFrame(crossedFrameIndex); + } + if (loopCompleteEvent !== null && crossedFrameIndex === 0) { // Add loop complete event after first frame. + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + if (crossedFrameIndex > 0) { + crossedFrameIndex--; + } + else { + crossedFrameIndex = this._frameCount - 1; + } + if (crossedFrameIndex === frameIndex) { + break; + } + } + } + else { + if (crossedFrameIndex < 0) { + var prevFrameIndex = Math.floor(prevTime * this._frameRate); + crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex]; + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this.currentPlayTimes === prevPlayTimes) { // Start. + if (prevTime <= framePosition) { // Crossed. + if (crossedFrameIndex > 0) { + crossedFrameIndex--; + } + else { + crossedFrameIndex = this._frameCount - 1; + } + } + else if (crossedFrameIndex === frameIndex) { // Uncrossed. + crossedFrameIndex = -1; + } + } + } + while (crossedFrameIndex >= 0) { + if (crossedFrameIndex < this._frameCount - 1) { + crossedFrameIndex++; + } + else { + crossedFrameIndex = 0; + } + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this._position <= framePosition && + framePosition <= this._position + this._duration // + ) { // Support interval play. + this._onCrossFrame(crossedFrameIndex); + } + if (loopCompleteEvent !== null && crossedFrameIndex === 0) { // Add loop complete event before first frame. + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + if (crossedFrameIndex === frameIndex) { + break; + } + } + } + } + } + } + else if (this._frameIndex < 0) { + this._frameIndex = 0; + if (this._timelineData !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */]; + // Arrive at frame. + var framePosition = this._frameArray[this._frameOffset] / this._frameRate; + if (this.currentPlayTimes === prevPlayTimes) { // Start. + if (prevTime <= framePosition) { + this._onCrossFrame(this._frameIndex); + } + } + else if (this._position <= framePosition) { // Loop complete. + if (!isReverse && loopCompleteEvent !== null) { // Add loop complete event before first frame. + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + this._onCrossFrame(this._frameIndex); + } + } + } + if (loopCompleteEvent !== null) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + } + if (completeEvent !== null) { + this._armature._dragonBones.bufferEvent(completeEvent); + } + } + }; + ActionTimelineState.prototype.setCurrentTime = function (value) { + this._setCurrentTime(value); + this._frameIndex = -1; + }; + return ActionTimelineState; + }(dragonBones.TimelineState)); + dragonBones.ActionTimelineState = ActionTimelineState; + /** + * @internal + */ + var ZOrderTimelineState = /** @class */ (function (_super) { + __extends(ZOrderTimelineState, _super); + function ZOrderTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + ZOrderTimelineState.toString = function () { + return "[class dragonBones.ZOrderTimelineState]"; + }; + ZOrderTimelineState.prototype._onArriveAtFrame = function () { + if (this.playState >= 0) { + var count = this._frameArray[this._frameOffset + 1]; + if (count > 0) { + this._armature._sortZOrder(this._frameArray, this._frameOffset + 2); + } + else { + this._armature._sortZOrder(null, 0); + } + } + }; + ZOrderTimelineState.prototype._onUpdateFrame = function () { }; + return ZOrderTimelineState; + }(dragonBones.TimelineState)); + dragonBones.ZOrderTimelineState = ZOrderTimelineState; + /** + * @internal + */ + var BoneAllTimelineState = /** @class */ (function (_super) { + __extends(BoneAllTimelineState, _super); + function BoneAllTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneAllTimelineState.toString = function () { + return "[class dragonBones.BoneAllTimelineState]"; + }; + BoneAllTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._isTween && this._frameIndex === this._frameCount - 1) { + this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]); + this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]); + } + if (this._timelineData === null) { // Pose. + this._rd[4] = 1.0; + this._rd[5] = 1.0; + } + }; + BoneAllTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = 6; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneAllTimelineState.prototype.fadeOut = function () { + this.dirty = false; + this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]); + this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]); + }; + BoneAllTimelineState.prototype.blend = function (isDirty) { + var valueScale = this._armature.armatureData.scale; + var rd = this._rd; + // + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.x += rd[0] * blendWeight * valueScale; + result.y += rd[1] * blendWeight * valueScale; + result.rotation += rd[2] * blendWeight; + result.skew += rd[3] * blendWeight; + result.scaleX += (rd[4] - 1.0) * blendWeight; + result.scaleY += (rd[5] - 1.0) * blendWeight; + } + else { + result.x = rd[0] * blendWeight * valueScale; + result.y = rd[1] * blendWeight * valueScale; + result.rotation = rd[2] * blendWeight; + result.skew = rd[3] * blendWeight; + result.scaleX = (rd[4] - 1.0) * blendWeight + 1.0; // + result.scaleY = (rd[5] - 1.0) * blendWeight + 1.0; // + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneAllTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.BoneAllTimelineState = BoneAllTimelineState; + /** + * @internal + */ + var BoneTranslateTimelineState = /** @class */ (function (_super) { + __extends(BoneTranslateTimelineState, _super); + function BoneTranslateTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneTranslateTimelineState.toString = function () { + return "[class dragonBones.BoneTranslateTimelineState]"; + }; + BoneTranslateTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneTranslateTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.x += this._resultA * blendWeight; + result.y += this._resultB * blendWeight; + } + else if (blendWeight !== 1.0) { + result.x = this._resultA * blendWeight; + result.y = this._resultB * blendWeight; + } + else { + result.x = this._resultA; + result.y = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneTranslateTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneTranslateTimelineState = BoneTranslateTimelineState; + /** + * @internal + */ + var BoneRotateTimelineState = /** @class */ (function (_super) { + __extends(BoneRotateTimelineState, _super); + function BoneRotateTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneRotateTimelineState.toString = function () { + return "[class dragonBones.BoneRotateTimelineState]"; + }; + BoneRotateTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._isTween && this._frameIndex === this._frameCount - 1) { + this._differenceA = dragonBones.Transform.normalizeRadian(this._differenceA); + this._differenceB = dragonBones.Transform.normalizeRadian(this._differenceB); + } + }; + BoneRotateTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneRotateTimelineState.prototype.fadeOut = function () { + this.dirty = false; + this._resultA = dragonBones.Transform.normalizeRadian(this._resultA); + this._resultB = dragonBones.Transform.normalizeRadian(this._resultB); + }; + BoneRotateTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.rotation += this._resultA * blendWeight; + result.skew += this._resultB * blendWeight; + } + else if (blendWeight !== 1.0) { + result.rotation = this._resultA * blendWeight; + result.skew = this._resultB * blendWeight; + } + else { + result.rotation = this._resultA; + result.skew = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneRotateTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneRotateTimelineState = BoneRotateTimelineState; + /** + * @internal + */ + var BoneScaleTimelineState = /** @class */ (function (_super) { + __extends(BoneScaleTimelineState, _super); + function BoneScaleTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneScaleTimelineState.toString = function () { + return "[class dragonBones.BoneScaleTimelineState]"; + }; + BoneScaleTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { // Pose. + this._resultA = 1.0; + this._resultB = 1.0; + } + }; + BoneScaleTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneScaleTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.scaleX += (this._resultA - 1.0) * blendWeight; + result.scaleY += (this._resultB - 1.0) * blendWeight; + } + else if (blendWeight !== 1.0) { + result.scaleX = (this._resultA - 1.0) * blendWeight + 1.0; + result.scaleY = (this._resultB - 1.0) * blendWeight + 1.0; + } + else { + result.scaleX = this._resultA; + result.scaleY = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneScaleTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneScaleTimelineState = BoneScaleTimelineState; + /** + * @internal + */ + var SurfaceTimelineState = /** @class */ (function (_super) { + __extends(SurfaceTimelineState, _super); + function SurfaceTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SurfaceTimelineState.toString = function () { + return "[class dragonBones.SurfaceTimelineState]"; + }; + SurfaceTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._deformCount = 0; + this._deformOffset = 0; + this._sameValueOffset = 0; + }; + SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; + var frameIntArray = dragonBonesData.frameIntArray; + var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */]; + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */]; + this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */]; + this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */]; + this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = dragonBonesData.frameFloatArray; + this._rd.length = this._valueCount * 2; + } + else { + this._deformCount = this.target.target._deformVertices.length; + } + }; + SurfaceTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var surface = blendState.target; + var blendWeight = blendState.blendWeight; + var result = surface._deformVertices; + var valueArray = this._valueArray; + if (valueArray !== null) { + var valueCount = this._valueCount; + var deformOffset = this._deformOffset; + var sameValueOffset = this._sameValueOffset; + var rd = this._rd; + for (var i = 0; i < this._deformCount; ++i) { + var value = 0.0; + if (i < deformOffset) { + value = valueArray[sameValueOffset + i]; + } + else if (i < deformOffset + valueCount) { + value = rd[i - deformOffset]; + } + else { + value = valueArray[sameValueOffset + i - valueCount]; + } + if (blendState.dirty > 1) { + result[i] += value * blendWeight; + } + else { + result[i] = value * blendWeight; + } + } + } + else if (blendState.dirty === 1) { + for (var i = 0; i < this._deformCount; ++i) { + result[i] = 0.0; + } + } + if (isDirty || this.dirty) { + this.dirty = false; + surface._transformDirty = true; + } + }; + return SurfaceTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.SurfaceTimelineState = SurfaceTimelineState; + /** + * @internal + */ + var AlphaTimelineState = /** @class */ (function (_super) { + __extends(AlphaTimelineState, _super); + function AlphaTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AlphaTimelineState.toString = function () { + return "[class dragonBones.AlphaTimelineState]"; + }; + AlphaTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { // Pose. + this._result = 1.0; + } + }; + AlphaTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.01; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + AlphaTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var alphaTarget = blendState.target; + var blendWeight = blendState.blendWeight; + if (blendState.dirty > 1) { + alphaTarget._alpha += this._result * blendWeight; + if (alphaTarget._alpha > 1.0) { + alphaTarget._alpha = 1.0; + } + } + else { + alphaTarget._alpha = this._result * blendWeight; + } + if (isDirty || this.dirty) { + this.dirty = false; + this._armature._alphaDirty = true; + } + }; + return AlphaTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AlphaTimelineState = AlphaTimelineState; + /** + * @internal + */ + var SlotDisplayTimelineState = /** @class */ (function (_super) { + __extends(SlotDisplayTimelineState, _super); + function SlotDisplayTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SlotDisplayTimelineState.toString = function () { + return "[class dragonBones.SlotDisplayTimelineState]"; + }; + SlotDisplayTimelineState.prototype._onArriveAtFrame = function () { + if (this.playState >= 0) { + var slot = this.target; + var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : slot._slotData.displayIndex; + if (slot.displayIndex !== displayIndex) { + slot._setDisplayIndex(displayIndex, true); + } + } + }; + SlotDisplayTimelineState.prototype._onUpdateFrame = function () { + }; + return SlotDisplayTimelineState; + }(dragonBones.TimelineState)); + dragonBones.SlotDisplayTimelineState = SlotDisplayTimelineState; + /** + * @internal + */ + var SlotColorTimelineState = /** @class */ (function (_super) { + __extends(SlotColorTimelineState, _super); + function SlotColorTimelineState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._current = [0, 0, 0, 0, 0, 0, 0, 0]; + _this._difference = [0, 0, 0, 0, 0, 0, 0, 0]; + _this._result = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]; + return _this; + } + SlotColorTimelineState.toString = function () { + return "[class dragonBones.SlotColorTimelineState]"; + }; + SlotColorTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; + var colorArray = dragonBonesData.colorArray; + var frameIntArray = dragonBonesData.frameIntArray; + var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex; + var colorOffset = frameIntArray[valueOffset]; + if (colorOffset < 0) { + colorOffset += 65536; // Fixed out of bounds bug. + } + if (this._isTween) { + this._current[0] = colorArray[colorOffset++]; + this._current[1] = colorArray[colorOffset++]; + this._current[2] = colorArray[colorOffset++]; + this._current[3] = colorArray[colorOffset++]; + this._current[4] = colorArray[colorOffset++]; + this._current[5] = colorArray[colorOffset++]; + this._current[6] = colorArray[colorOffset++]; + this._current[7] = colorArray[colorOffset++]; + if (this._frameIndex === this._frameCount - 1) { + colorOffset = frameIntArray[this._animationData.frameIntOffset + this._frameValueOffset]; + } + else { + colorOffset = frameIntArray[valueOffset + 1]; + } + if (colorOffset < 0) { + colorOffset += 65536; // Fixed out of bounds bug. + } + this._difference[0] = colorArray[colorOffset++] - this._current[0]; + this._difference[1] = colorArray[colorOffset++] - this._current[1]; + this._difference[2] = colorArray[colorOffset++] - this._current[2]; + this._difference[3] = colorArray[colorOffset++] - this._current[3]; + this._difference[4] = colorArray[colorOffset++] - this._current[4]; + this._difference[5] = colorArray[colorOffset++] - this._current[5]; + this._difference[6] = colorArray[colorOffset++] - this._current[6]; + this._difference[7] = colorArray[colorOffset++] - this._current[7]; + } + else { + this._result[0] = colorArray[colorOffset++] * 0.01; + this._result[1] = colorArray[colorOffset++] * 0.01; + this._result[2] = colorArray[colorOffset++] * 0.01; + this._result[3] = colorArray[colorOffset++] * 0.01; + this._result[4] = colorArray[colorOffset++]; + this._result[5] = colorArray[colorOffset++]; + this._result[6] = colorArray[colorOffset++]; + this._result[7] = colorArray[colorOffset++]; + } + } + else { // Pose. + var slot = this.target; + var color = slot.slotData.color; + this._result[0] = color.alphaMultiplier; + this._result[1] = color.redMultiplier; + this._result[2] = color.greenMultiplier; + this._result[3] = color.blueMultiplier; + this._result[4] = color.alphaOffset; + this._result[5] = color.redOffset; + this._result[6] = color.greenOffset; + this._result[7] = color.blueOffset; + } + }; + SlotColorTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._result[0] = (this._current[0] + this._difference[0] * this._tweenProgress) * 0.01; + this._result[1] = (this._current[1] + this._difference[1] * this._tweenProgress) * 0.01; + this._result[2] = (this._current[2] + this._difference[2] * this._tweenProgress) * 0.01; + this._result[3] = (this._current[3] + this._difference[3] * this._tweenProgress) * 0.01; + this._result[4] = this._current[4] + this._difference[4] * this._tweenProgress; + this._result[5] = this._current[5] + this._difference[5] * this._tweenProgress; + this._result[6] = this._current[6] + this._difference[6] * this._tweenProgress; + this._result[7] = this._current[7] + this._difference[7] * this._tweenProgress; + } + }; + SlotColorTimelineState.prototype.fadeOut = function () { + this._isTween = false; + }; + SlotColorTimelineState.prototype.update = function (passedTime) { + _super.prototype.update.call(this, passedTime); + // Fade animation. + if (this._isTween || this.dirty) { + var slot = this.target; + var result = slot._colorTransform; + if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) { + if (result.alphaMultiplier !== this._result[0] || + result.redMultiplier !== this._result[1] || + result.greenMultiplier !== this._result[2] || + result.blueMultiplier !== this._result[3] || + result.alphaOffset !== this._result[4] || + result.redOffset !== this._result[5] || + result.greenOffset !== this._result[6] || + result.blueOffset !== this._result[7]) { + var fadeProgress = Math.pow(this._animationState._fadeProgress, 4); + result.alphaMultiplier += (this._result[0] - result.alphaMultiplier) * fadeProgress; + result.redMultiplier += (this._result[1] - result.redMultiplier) * fadeProgress; + result.greenMultiplier += (this._result[2] - result.greenMultiplier) * fadeProgress; + result.blueMultiplier += (this._result[3] - result.blueMultiplier) * fadeProgress; + result.alphaOffset += (this._result[4] - result.alphaOffset) * fadeProgress; + result.redOffset += (this._result[5] - result.redOffset) * fadeProgress; + result.greenOffset += (this._result[6] - result.greenOffset) * fadeProgress; + result.blueOffset += (this._result[7] - result.blueOffset) * fadeProgress; + slot._colorDirty = true; + } + } + else if (this.dirty) { + this.dirty = false; + if (result.alphaMultiplier !== this._result[0] || + result.redMultiplier !== this._result[1] || + result.greenMultiplier !== this._result[2] || + result.blueMultiplier !== this._result[3] || + result.alphaOffset !== this._result[4] || + result.redOffset !== this._result[5] || + result.greenOffset !== this._result[6] || + result.blueOffset !== this._result[7]) { + result.alphaMultiplier = this._result[0]; + result.redMultiplier = this._result[1]; + result.greenMultiplier = this._result[2]; + result.blueMultiplier = this._result[3]; + result.alphaOffset = this._result[4]; + result.redOffset = this._result[5]; + result.greenOffset = this._result[6]; + result.blueOffset = this._result[7]; + slot._colorDirty = true; + } + } + } + }; + return SlotColorTimelineState; + }(dragonBones.TweenTimelineState)); + dragonBones.SlotColorTimelineState = SlotColorTimelineState; + /** + * @internal + */ + var SlotZIndexTimelineState = /** @class */ (function (_super) { + __extends(SlotZIndexTimelineState, _super); + function SlotZIndexTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SlotZIndexTimelineState.toString = function () { + return "[class dragonBones.SlotZIndexTimelineState]"; + }; + SlotZIndexTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { // Pose. + var blendState = this.target; + var slot = blendState.target; + this._result = slot.slotData.zIndex; + } + }; + SlotZIndexTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + SlotZIndexTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var slot = blendState.target; + var blendWeight = blendState.blendWeight; + if (blendState.dirty > 1) { + slot._zIndex += this._result * blendWeight; + } + else { + slot._zIndex = this._result * blendWeight; + } + if (isDirty || this.dirty) { + this.dirty = false; + this._armature._zIndexDirty = true; + } + }; + return SlotZIndexTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.SlotZIndexTimelineState = SlotZIndexTimelineState; + /** + * @internal + */ + var DeformTimelineState = /** @class */ (function (_super) { + __extends(DeformTimelineState, _super); + function DeformTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + DeformTimelineState.toString = function () { + return "[class dragonBones.DeformTimelineState]"; + }; + DeformTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.geometryOffset = 0; + this.displayFrame = null; + this._deformCount = 0; + this._deformOffset = 0; + this._sameValueOffset = 0; + }; + DeformTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + if (this._timelineData !== null) { + var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */]; + var dragonBonesData = this._animationData.parent.parent; + var frameIntArray = dragonBonesData.frameIntArray; + var slot = this.target.target; + this.geometryOffset = frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */]; + if (this.geometryOffset < 0) { + this.geometryOffset += 65536; // Fixed out of bounds bug. + } + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayFrame = slot.getDisplayFrameAt(i); + var geometryData = displayFrame.getGeometryData(); + if (geometryData === null) { + continue; + } + if (geometryData.offset === this.geometryOffset) { + this.displayFrame = displayFrame; + this.displayFrame.updateDeformVertices(); + break; + } + } + if (this.displayFrame === null) { + this.returnToPool(); // + return; + } + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */]; + this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */]; + this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */]; + this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = dragonBonesData.frameFloatArray; + this._rd.length = this._valueCount * 2; + } + else { + this._deformCount = this.displayFrame.deformVertices.length; + } + }; + DeformTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var slot = blendState.target; + var blendWeight = blendState.blendWeight; + var result = this.displayFrame.deformVertices; + var valueArray = this._valueArray; + if (valueArray !== null) { + var valueCount = this._valueCount; + var deformOffset = this._deformOffset; + var sameValueOffset = this._sameValueOffset; + var rd = this._rd; + for (var i = 0; i < this._deformCount; ++i) { + var value = 0.0; + if (i < deformOffset) { + value = valueArray[sameValueOffset + i]; + } + else if (i < deformOffset + valueCount) { + value = rd[i - deformOffset]; + } + else { + value = valueArray[sameValueOffset + i - valueCount]; + } + if (blendState.dirty > 1) { + result[i] += value * blendWeight; + } + else { + result[i] = value * blendWeight; + } + } + } + else if (blendState.dirty === 1) { + for (var i = 0; i < this._deformCount; ++i) { + result[i] = 0.0; + } + } + if (isDirty || this.dirty) { + this.dirty = false; + if (slot._geometryData === this.displayFrame.getGeometryData()) { + slot._verticesDirty = true; + } + } + }; + return DeformTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.DeformTimelineState = DeformTimelineState; + /** + * @internal + */ + var IKConstraintTimelineState = /** @class */ (function (_super) { + __extends(IKConstraintTimelineState, _super); + function IKConstraintTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraintTimelineState.toString = function () { + return "[class dragonBones.IKConstraintTimelineState]"; + }; + IKConstraintTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var ikConstraint = this.target; + if (this._timelineData !== null) { + ikConstraint._bendPositive = this._currentA > 0.0; + ikConstraint._weight = this._currentB; + } + else { + var ikConstraintData = ikConstraint._constraintData; + ikConstraint._bendPositive = ikConstraintData.bendPositive; + ikConstraint._weight = ikConstraintData.weight; + } + ikConstraint.invalidUpdate(); + this.dirty = false; + }; + IKConstraintTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.01; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return IKConstraintTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.IKConstraintTimelineState = IKConstraintTimelineState; + /** + * @internal + */ + var AnimationProgressTimelineState = /** @class */ (function (_super) { + __extends(AnimationProgressTimelineState, _super); + function AnimationProgressTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationProgressTimelineState.toString = function () { + return "[class dragonBones.AnimationProgressTimelineState]"; + }; + AnimationProgressTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.currentTime = this._result * animationState.totalTime; + } + this.dirty = false; + }; + AnimationProgressTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationProgressTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AnimationProgressTimelineState = AnimationProgressTimelineState; + /** + * @internal + */ + var AnimationWeightTimelineState = /** @class */ (function (_super) { + __extends(AnimationWeightTimelineState, _super); + function AnimationWeightTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationWeightTimelineState.toString = function () { + return "[class dragonBones.AnimationWeightTimelineState]"; + }; + AnimationWeightTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.weight = this._result; + } + this.dirty = false; + }; + AnimationWeightTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationWeightTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AnimationWeightTimelineState = AnimationWeightTimelineState; + /** + * @internal + */ + var AnimationParametersTimelineState = /** @class */ (function (_super) { + __extends(AnimationParametersTimelineState, _super); + function AnimationParametersTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationParametersTimelineState.toString = function () { + return "[class dragonBones.AnimationParametersTimelineState]"; + }; + AnimationParametersTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.parameterX = this._resultA; + animationState.parameterY = this._resultB; + } + this.dirty = false; + }; + AnimationParametersTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationParametersTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.AnimationParametersTimelineState = AnimationParametersTimelineState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The properties of the object carry basic information about an event, + * which are passed as parameter or parameter's parameter to event listeners when an event occurs. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 + * @version DragonBones 4.5 + * @language zh_CN + */ + var EventObject = /** @class */ (function (_super) { + __extends(EventObject, _super); + function EventObject() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @internal + * @private + */ + EventObject.actionDataToInstance = function (data, instance, armature) { + if (data.type === 0 /* Play */) { + instance.type = EventObject.FRAME_EVENT; + } + else { + instance.type = data.type === 10 /* Frame */ ? EventObject.FRAME_EVENT : EventObject.SOUND_EVENT; + } + instance.name = data.name; + instance.armature = armature; + instance.actionData = data; + instance.data = data.data; + if (data.bone !== null) { + instance.bone = armature.getBone(data.bone.name); + } + if (data.slot !== null) { + instance.slot = armature.getSlot(data.slot.name); + } + }; + EventObject.toString = function () { + return "[class dragonBones.EventObject]"; + }; + EventObject.prototype._onClear = function () { + this.time = 0.0; + this.type = ""; + this.name = ""; + this.armature = null; + this.bone = null; + this.slot = null; + this.animationState = null; + this.actionData = null; + this.data = null; + }; + /** + * - Animation start play. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画开始播放。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.START = "start"; + /** + * - Animation loop play complete once. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画循环播放完成一次。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.LOOP_COMPLETE = "loopComplete"; + /** + * - Animation play complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画播放完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.COMPLETE = "complete"; + /** + * - Animation fade in start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_IN = "fadeIn"; + /** + * - Animation fade in complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_IN_COMPLETE = "fadeInComplete"; + /** + * - Animation fade out start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_OUT = "fadeOut"; + /** + * - Animation fade out complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_OUT_COMPLETE = "fadeOutComplete"; + /** + * - Animation frame event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FRAME_EVENT = "frameEvent"; + /** + * - Animation frame sound event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧声音事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.SOUND_EVENT = "soundEvent"; + return EventObject; + }(dragonBones.BaseObject)); + dragonBones.EventObject = EventObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DataParser = /** @class */ (function () { + function DataParser() { + } + DataParser._getArmatureType = function (value) { + switch (value.toLowerCase()) { + case "stage": + return 2 /* Stage */; + case "armature": + return 0 /* Armature */; + case "movieclip": + return 1 /* MovieClip */; + default: + return 0 /* Armature */; + } + }; + DataParser._getBoneType = function (value) { + switch (value.toLowerCase()) { + case "bone": + return 0 /* Bone */; + case "surface": + return 1 /* Surface */; + default: + return 0 /* Bone */; + } + }; + DataParser._getPositionMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "percent": + return 1 /* Percent */; + case "fixed": + return 0 /* Fixed */; + default: + return 1 /* Percent */; + } + }; + DataParser._getSpacingMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "length": + return 0 /* Length */; + case "percent": + return 2 /* Percent */; + case "fixed": + return 1 /* Fixed */; + default: + return 0 /* Length */; + } + }; + DataParser._getRotateMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "tangent": + return 0 /* Tangent */; + case "chain": + return 1 /* Chain */; + case "chainscale": + return 2 /* ChainScale */; + default: + return 0 /* Tangent */; + } + }; + DataParser._getDisplayType = function (value) { + switch (value.toLowerCase()) { + case "image": + return 0 /* Image */; + case "mesh": + return 2 /* Mesh */; + case "armature": + return 1 /* Armature */; + case "boundingbox": + return 3 /* BoundingBox */; + case "path": + return 4 /* Path */; + default: + return 0 /* Image */; + } + }; + DataParser._getBoundingBoxType = function (value) { + switch (value.toLowerCase()) { + case "rectangle": + return 0 /* Rectangle */; + case "ellipse": + return 1 /* Ellipse */; + case "polygon": + return 2 /* Polygon */; + default: + return 0 /* Rectangle */; + } + }; + DataParser._getBlendMode = function (value) { + switch (value.toLowerCase()) { + case "normal": + return 0 /* Normal */; + case "add": + return 1 /* Add */; + case "alpha": + return 2 /* Alpha */; + case "darken": + return 3 /* Darken */; + case "difference": + return 4 /* Difference */; + case "erase": + return 5 /* Erase */; + case "hardlight": + return 6 /* HardLight */; + case "invert": + return 7 /* Invert */; + case "layer": + return 8 /* Layer */; + case "lighten": + return 9 /* Lighten */; + case "multiply": + return 10 /* Multiply */; + case "overlay": + return 11 /* Overlay */; + case "screen": + return 12 /* Screen */; + case "subtract": + return 13 /* Subtract */; + default: + return 0 /* Normal */; + } + }; + DataParser._getAnimationBlendType = function (value) { + switch (value.toLowerCase()) { + case "none": + return 0 /* None */; + case "1d": + return 1 /* E1D */; + default: + return 0 /* None */; + } + }; + DataParser._getActionType = function (value) { + switch (value.toLowerCase()) { + case "play": + return 0 /* Play */; + case "frame": + return 10 /* Frame */; + case "sound": + return 11 /* Sound */; + default: + return 0 /* Play */; + } + }; + DataParser.DATA_VERSION_2_3 = "2.3"; + DataParser.DATA_VERSION_3_0 = "3.0"; + DataParser.DATA_VERSION_4_0 = "4.0"; + DataParser.DATA_VERSION_4_5 = "4.5"; + DataParser.DATA_VERSION_5_0 = "5.0"; + DataParser.DATA_VERSION_5_5 = "5.5"; + DataParser.DATA_VERSION_5_6 = "5.6"; + DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_6; + DataParser.DATA_VERSIONS = [ + DataParser.DATA_VERSION_4_0, + DataParser.DATA_VERSION_4_5, + DataParser.DATA_VERSION_5_0, + DataParser.DATA_VERSION_5_5, + DataParser.DATA_VERSION_5_6 + ]; + DataParser.TEXTURE_ATLAS = "textureAtlas"; + DataParser.SUB_TEXTURE = "SubTexture"; + DataParser.FORMAT = "format"; + DataParser.IMAGE_PATH = "imagePath"; + DataParser.WIDTH = "width"; + DataParser.HEIGHT = "height"; + DataParser.ROTATED = "rotated"; + DataParser.FRAME_X = "frameX"; + DataParser.FRAME_Y = "frameY"; + DataParser.FRAME_WIDTH = "frameWidth"; + DataParser.FRAME_HEIGHT = "frameHeight"; + DataParser.DRADON_BONES = "dragonBones"; + DataParser.USER_DATA = "userData"; + DataParser.ARMATURE = "armature"; + DataParser.CANVAS = "canvas"; + DataParser.BONE = "bone"; + DataParser.SURFACE = "surface"; + DataParser.SLOT = "slot"; + DataParser.CONSTRAINT = "constraint"; + DataParser.SKIN = "skin"; + DataParser.DISPLAY = "display"; + DataParser.FRAME = "frame"; + DataParser.IK = "ik"; + DataParser.PATH_CONSTRAINT = "path"; + DataParser.ANIMATION = "animation"; + DataParser.TIMELINE = "timeline"; + DataParser.FFD = "ffd"; + DataParser.TRANSLATE_FRAME = "translateFrame"; + DataParser.ROTATE_FRAME = "rotateFrame"; + DataParser.SCALE_FRAME = "scaleFrame"; + DataParser.DISPLAY_FRAME = "displayFrame"; + DataParser.COLOR_FRAME = "colorFrame"; + DataParser.DEFAULT_ACTIONS = "defaultActions"; + DataParser.ACTIONS = "actions"; + DataParser.EVENTS = "events"; + DataParser.INTS = "ints"; + DataParser.FLOATS = "floats"; + DataParser.STRINGS = "strings"; + DataParser.TRANSFORM = "transform"; + DataParser.PIVOT = "pivot"; + DataParser.AABB = "aabb"; + DataParser.COLOR = "color"; + DataParser.VERSION = "version"; + DataParser.COMPATIBLE_VERSION = "compatibleVersion"; + DataParser.FRAME_RATE = "frameRate"; + DataParser.TYPE = "type"; + DataParser.SUB_TYPE = "subType"; + DataParser.NAME = "name"; + DataParser.PARENT = "parent"; + DataParser.TARGET = "target"; + DataParser.STAGE = "stage"; + DataParser.SHARE = "share"; + DataParser.PATH = "path"; + DataParser.LENGTH = "length"; + DataParser.DISPLAY_INDEX = "displayIndex"; + DataParser.Z_ORDER = "zOrder"; + DataParser.Z_INDEX = "zIndex"; + DataParser.BLEND_MODE = "blendMode"; + DataParser.INHERIT_TRANSLATION = "inheritTranslation"; + DataParser.INHERIT_ROTATION = "inheritRotation"; + DataParser.INHERIT_SCALE = "inheritScale"; + DataParser.INHERIT_REFLECTION = "inheritReflection"; + DataParser.INHERIT_ANIMATION = "inheritAnimation"; + DataParser.INHERIT_DEFORM = "inheritDeform"; + DataParser.SEGMENT_X = "segmentX"; + DataParser.SEGMENT_Y = "segmentY"; + DataParser.BEND_POSITIVE = "bendPositive"; + DataParser.CHAIN = "chain"; + DataParser.WEIGHT = "weight"; + DataParser.BLEND_TYPE = "blendType"; + DataParser.FADE_IN_TIME = "fadeInTime"; + DataParser.PLAY_TIMES = "playTimes"; + DataParser.SCALE = "scale"; + DataParser.OFFSET = "offset"; + DataParser.POSITION = "position"; + DataParser.DURATION = "duration"; + DataParser.TWEEN_EASING = "tweenEasing"; + DataParser.TWEEN_ROTATE = "tweenRotate"; + DataParser.TWEEN_SCALE = "tweenScale"; + DataParser.CLOCK_WISE = "clockwise"; + DataParser.CURVE = "curve"; + DataParser.SOUND = "sound"; + DataParser.EVENT = "event"; + DataParser.ACTION = "action"; + DataParser.X = "x"; + DataParser.Y = "y"; + DataParser.SKEW_X = "skX"; + DataParser.SKEW_Y = "skY"; + DataParser.SCALE_X = "scX"; + DataParser.SCALE_Y = "scY"; + DataParser.VALUE = "value"; + DataParser.ROTATE = "rotate"; + DataParser.SKEW = "skew"; + DataParser.ALPHA = "alpha"; + DataParser.ALPHA_OFFSET = "aO"; + DataParser.RED_OFFSET = "rO"; + DataParser.GREEN_OFFSET = "gO"; + DataParser.BLUE_OFFSET = "bO"; + DataParser.ALPHA_MULTIPLIER = "aM"; + DataParser.RED_MULTIPLIER = "rM"; + DataParser.GREEN_MULTIPLIER = "gM"; + DataParser.BLUE_MULTIPLIER = "bM"; + DataParser.UVS = "uvs"; + DataParser.VERTICES = "vertices"; + DataParser.TRIANGLES = "triangles"; + DataParser.WEIGHTS = "weights"; + DataParser.SLOT_POSE = "slotPose"; + DataParser.BONE_POSE = "bonePose"; + DataParser.BONES = "bones"; + DataParser.POSITION_MODE = "positionMode"; + DataParser.SPACING_MODE = "spacingMode"; + DataParser.ROTATE_MODE = "rotateMode"; + DataParser.SPACING = "spacing"; + DataParser.ROTATE_OFFSET = "rotateOffset"; + DataParser.ROTATE_MIX = "rotateMix"; + DataParser.TRANSLATE_MIX = "translateMix"; + DataParser.TARGET_DISPLAY = "targetDisplay"; + DataParser.CLOSED = "closed"; + DataParser.CONSTANT_SPEED = "constantSpeed"; + DataParser.VERTEX_COUNT = "vertexCount"; + DataParser.LENGTHS = "lengths"; + DataParser.GOTO_AND_PLAY = "gotoAndPlay"; + DataParser.DEFAULT_NAME = "default"; + return DataParser; + }()); + dragonBones.DataParser = DataParser; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ObjectDataParser = /** @class */ (function (_super) { + __extends(ObjectDataParser, _super); + function ObjectDataParser() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._rawTextureAtlasIndex = 0; + _this._rawBones = []; + _this._data = null; // + _this._armature = null; // + _this._bone = null; // + _this._geometry = null; // + _this._slot = null; // + _this._skin = null; // + _this._mesh = null; // + _this._animation = null; // + _this._timeline = null; // + _this._rawTextureAtlases = null; + _this._frameValueType = 0 /* Step */; + _this._defaultColorOffset = -1; + _this._prevClockwise = 0; + _this._prevRotation = 0.0; + _this._frameDefaultValue = 0.0; + _this._frameValueScale = 1.0; + _this._helpMatrixA = new dragonBones.Matrix(); + _this._helpMatrixB = new dragonBones.Matrix(); + _this._helpTransform = new dragonBones.Transform(); + _this._helpColorTransform = new dragonBones.ColorTransform(); + _this._helpPoint = new dragonBones.Point(); + _this._helpArray = []; + _this._intArray = []; + _this._floatArray = []; + _this._frameIntArray = []; + _this._frameFloatArray = []; + _this._frameArray = []; + _this._timelineArray = []; + _this._colorArray = []; + _this._cacheRawMeshes = []; + _this._cacheMeshes = []; + _this._actionFrames = []; + _this._weightSlotPose = {}; + _this._weightBonePoses = {}; + _this._cacheBones = {}; + _this._slotChildActions = {}; + return _this; + } + ObjectDataParser._getBoolean = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + var type = typeof value; + if (type === "boolean") { + return value; + } + else if (type === "string") { + switch (value) { + case "0": + case "NaN": + case "": + case "false": + case "null": + case "undefined": + return false; + default: + return true; + } + } + else { + return !!value; + } + } + return defaultValue; + }; + ObjectDataParser._getNumber = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + if (value === null || value === "NaN") { + return defaultValue; + } + return +value || 0; + } + return defaultValue; + }; + ObjectDataParser._getString = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + var type = typeof value; + if (type === "string") { + return value; + } + return String(value); + } + return defaultValue; + }; + ObjectDataParser.prototype._getCurvePoint = function (x1, y1, x2, y2, x3, y3, x4, y4, t, result) { + var l_t = 1.0 - t; + var powA = l_t * l_t; + var powB = t * t; + var kA = l_t * powA; + var kB = 3.0 * t * powA; + var kC = 3.0 * l_t * powB; + var kD = t * powB; + result.x = kA * x1 + kB * x2 + kC * x3 + kD * x4; + result.y = kA * y1 + kB * y2 + kC * y3 + kD * y4; + }; + ObjectDataParser.prototype._samplingEasingCurve = function (curve, samples) { + var curveCount = curve.length; + if (curveCount % 3 === 1) { + var stepIndex = -2; + for (var i = 0, l = samples.length; i < l; ++i) { + var t = (i + 1) / (l + 1); // float + while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) { // stepIndex + 3 * 2 + stepIndex += 6; + } + var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount; + var x1 = isInCurve ? curve[stepIndex] : 0.0; + var y1 = isInCurve ? curve[stepIndex + 1] : 0.0; + var x2 = curve[stepIndex + 2]; + var y2 = curve[stepIndex + 3]; + var x3 = curve[stepIndex + 4]; + var y3 = curve[stepIndex + 5]; + var x4 = isInCurve ? curve[stepIndex + 6] : 1.0; + var y4 = isInCurve ? curve[stepIndex + 7] : 1.0; + var lower = 0.0; + var higher = 1.0; + while (higher - lower > 0.0001) { + var percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } + } + samples[i] = this._helpPoint.y; + } + return true; + } + else { + var stepIndex = 0; + for (var i = 0, l = samples.length; i < l; ++i) { + var t = (i + 1) / (l + 1); // float + while (curve[stepIndex + 6] < t) { // stepIndex + 3 * 2 + stepIndex += 6; + } + var x1 = curve[stepIndex]; + var y1 = curve[stepIndex + 1]; + var x2 = curve[stepIndex + 2]; + var y2 = curve[stepIndex + 3]; + var x3 = curve[stepIndex + 4]; + var y3 = curve[stepIndex + 5]; + var x4 = curve[stepIndex + 6]; + var y4 = curve[stepIndex + 7]; + var lower = 0.0; + var higher = 1.0; + while (higher - lower > 0.0001) { + var percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } + } + samples[i] = this._helpPoint.y; + } + return false; + } + }; + ObjectDataParser.prototype._parseActionDataInFrame = function (rawData, frameStart, bone, slot) { + if (dragonBones.DataParser.EVENT in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.EVENT], frameStart, 10 /* Frame */, bone, slot); + } + if (dragonBones.DataParser.SOUND in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.SOUND], frameStart, 11 /* Sound */, bone, slot); + } + if (dragonBones.DataParser.ACTION in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.ACTION], frameStart, 0 /* Play */, bone, slot); + } + if (dragonBones.DataParser.EVENTS in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.EVENTS], frameStart, 10 /* Frame */, bone, slot); + } + if (dragonBones.DataParser.ACTIONS in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.ACTIONS], frameStart, 0 /* Play */, bone, slot); + } + }; + ObjectDataParser.prototype._mergeActionFrame = function (rawData, frameStart, type, bone, slot) { + var actionOffset = this._armature.actions.length; + var actions = this._parseActionData(rawData, type, bone, slot); + var frameIndex = 0; + var frame = null; + for (var _i = 0, actions_2 = actions; _i < actions_2.length; _i++) { + var action = actions_2[_i]; + this._armature.addAction(action, false); + } + if (this._actionFrames.length === 0) { // First frame. + frame = new ActionFrame(); + frame.frameStart = 0; + this._actionFrames.push(frame); + frame = null; + } + for (var _a = 0, _b = this._actionFrames; _a < _b.length; _a++) { // Get same frame. + var eachFrame = _b[_a]; + if (eachFrame.frameStart === frameStart) { + frame = eachFrame; + break; + } + else if (eachFrame.frameStart > frameStart) { + break; + } + frameIndex++; + } + if (frame === null) { // Create and cache frame. + frame = new ActionFrame(); + frame.frameStart = frameStart; + this._actionFrames.splice(frameIndex, 0, frame); + } + for (var i = 0; i < actions.length; ++i) { // Cache action offsets. + frame.actions.push(actionOffset + i); + } + }; + ObjectDataParser.prototype._parseArmature = function (rawData, scale) { + var armature = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureData); + armature.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + armature.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, this._data.frameRate); + armature.scale = scale; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + armature.type = dragonBones.DataParser._getArmatureType(rawData[dragonBones.DataParser.TYPE]); + } + else { + armature.type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Armature */); + } + if (armature.frameRate === 0) { // Data error. + armature.frameRate = 24; + } + this._armature = armature; + if (dragonBones.DataParser.CANVAS in rawData) { + var rawCanvas = rawData[dragonBones.DataParser.CANVAS]; + var canvas = dragonBones.BaseObject.borrowObject(dragonBones.CanvasData); + if (dragonBones.DataParser.COLOR in rawCanvas) { + canvas.hasBackground = true; + } + else { + canvas.hasBackground = false; + } + canvas.color = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.COLOR, 0); + canvas.x = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.X, 0) * armature.scale; + canvas.y = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.Y, 0) * armature.scale; + canvas.width = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.WIDTH, 0) * armature.scale; + canvas.height = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.HEIGHT, 0) * armature.scale; + armature.canvas = canvas; + } + if (dragonBones.DataParser.AABB in rawData) { + var rawAABB = rawData[dragonBones.DataParser.AABB]; + armature.aabb.x = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.X, 0.0) * armature.scale; + armature.aabb.y = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.Y, 0.0) * armature.scale; + armature.aabb.width = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.WIDTH, 0.0) * armature.scale; + armature.aabb.height = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.HEIGHT, 0.0) * armature.scale; + } + if (dragonBones.DataParser.BONE in rawData) { + var rawBones = rawData[dragonBones.DataParser.BONE]; + for (var _i = 0, rawBones_1 = rawBones; _i < rawBones_1.length; _i++) { + var rawBone = rawBones_1[_i]; + var parentName = ObjectDataParser._getString(rawBone, dragonBones.DataParser.PARENT, ""); + var bone = this._parseBone(rawBone); + if (parentName.length > 0) { // Get bone parent. + var parent_1 = armature.getBone(parentName); + if (parent_1 !== null) { + bone.parent = parent_1; + } + else { // Cache. + if (!(parentName in this._cacheBones)) { + this._cacheBones[parentName] = []; + } + this._cacheBones[parentName].push(bone); + } + } + if (bone.name in this._cacheBones) { + for (var _a = 0, _b = this._cacheBones[bone.name]; _a < _b.length; _a++) { + var child = _b[_a]; + child.parent = bone; + } + delete this._cacheBones[bone.name]; + } + armature.addBone(bone); + this._rawBones.push(bone); // Cache raw bones sort. + } + } + if (dragonBones.DataParser.IK in rawData) { + var rawIKS = rawData[dragonBones.DataParser.IK]; + for (var _c = 0, rawIKS_1 = rawIKS; _c < rawIKS_1.length; _c++) { + var rawIK = rawIKS_1[_c]; + var constraint = this._parseIKConstraint(rawIK); + if (constraint) { + armature.addConstraint(constraint); + } + } + } + armature.sortBones(); + if (dragonBones.DataParser.SLOT in rawData) { + var zOrder = 0; + var rawSlots = rawData[dragonBones.DataParser.SLOT]; + for (var _d = 0, rawSlots_1 = rawSlots; _d < rawSlots_1.length; _d++) { + var rawSlot = rawSlots_1[_d]; + armature.addSlot(this._parseSlot(rawSlot, zOrder++)); + } + } + if (dragonBones.DataParser.SKIN in rawData) { + var rawSkins = rawData[dragonBones.DataParser.SKIN]; + for (var _e = 0, rawSkins_1 = rawSkins; _e < rawSkins_1.length; _e++) { + var rawSkin = rawSkins_1[_e]; + armature.addSkin(this._parseSkin(rawSkin)); + } + } + if (dragonBones.DataParser.PATH_CONSTRAINT in rawData) { + var rawPaths = rawData[dragonBones.DataParser.PATH_CONSTRAINT]; + for (var _f = 0, rawPaths_1 = rawPaths; _f < rawPaths_1.length; _f++) { + var rawPath = rawPaths_1[_f]; + var constraint = this._parsePathConstraint(rawPath); + if (constraint) { + armature.addConstraint(constraint); + } + } + } + for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) { // Link mesh. + var rawData_1 = this._cacheRawMeshes[i]; + var shareName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SHARE, ""); + if (shareName.length === 0) { + continue; + } + var skinName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME); + if (skinName.length === 0) { // + skinName = dragonBones.DataParser.DEFAULT_NAME; + } + var shareMesh = armature.getMesh(skinName, "", shareName); // TODO slot; + if (shareMesh === null) { + continue; // Error. + } + var mesh = this._cacheMeshes[i]; + mesh.geometry.shareFrom(shareMesh.geometry); + } + if (dragonBones.DataParser.ANIMATION in rawData) { + var rawAnimations = rawData[dragonBones.DataParser.ANIMATION]; + for (var _g = 0, rawAnimations_1 = rawAnimations; _g < rawAnimations_1.length; _g++) { + var rawAnimation = rawAnimations_1[_g]; + var animation = this._parseAnimation(rawAnimation); + armature.addAnimation(animation); + } + } + if (dragonBones.DataParser.DEFAULT_ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.DEFAULT_ACTIONS], 0 /* Play */, null, null); + for (var _h = 0, actions_3 = actions; _h < actions_3.length; _h++) { + var action = actions_3[_h]; + armature.addAction(action, true); + if (action.type === 0 /* Play */) { // Set default animation from default action. + var animation = armature.getAnimation(action.name); + if (animation !== null) { + armature.defaultAnimation = animation; + } + } + } + } + if (dragonBones.DataParser.ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + for (var _j = 0, actions_4 = actions; _j < actions_4.length; _j++) { + var action = actions_4[_j]; + armature.addAction(action, false); + } + } + // Clear helper. + this._rawBones.length = 0; + this._cacheRawMeshes.length = 0; + this._cacheMeshes.length = 0; + this._armature = null; + for (var k in this._weightSlotPose) { + delete this._weightSlotPose[k]; + } + for (var k in this._weightBonePoses) { + delete this._weightBonePoses[k]; + } + for (var k in this._cacheBones) { + delete this._cacheBones[k]; + } + for (var k in this._slotChildActions) { + delete this._slotChildActions[k]; + } + return armature; + }; + ObjectDataParser.prototype._parseBone = function (rawData) { + var type = 0 /* Bone */; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + type = dragonBones.DataParser._getBoneType(rawData[dragonBones.DataParser.TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Bone */); + } + if (type === 0 /* Bone */) { + var scale = this._armature.scale; + var bone = dragonBones.BaseObject.borrowObject(dragonBones.BoneData); + bone.inheritTranslation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_TRANSLATION, true); + bone.inheritRotation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_ROTATION, true); + bone.inheritScale = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_SCALE, true); + bone.inheritReflection = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_REFLECTION, true); + bone.length = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.LENGTH, 0) * scale; + bone.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + bone.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + if (dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], bone.transform, scale); + } + return bone; + } + var surface = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceData); + surface.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + surface.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + surface.segmentX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_X, 0); + surface.segmentY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_Y, 0); + this._parseGeometry(rawData, surface.geometry); + return surface; + }; + ObjectDataParser.prototype._parseIKConstraint = function (rawData) { + var bone = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.BONE, "")); + if (bone === null) { + return null; + } + var target = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET, "")); + if (target === null) { + return null; + } + var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0); + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintData); + constraint.scaleEnabled = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.SCALE, false); + constraint.bendPositive = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true); + constraint.weight = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0); + constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + constraint.type = 0 /* IK */; + constraint.target = target; + if (chain > 0 && bone.parent !== null) { + constraint.root = bone.parent; + constraint.bone = bone; + } + else { + constraint.root = bone; + constraint.bone = null; + } + return constraint; + }; + ObjectDataParser.prototype._parsePathConstraint = function (rawData) { + var target = this._armature.getSlot(ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET, "")); + if (target === null) { + return null; + } + var defaultSkin = this._armature.defaultSkin; + if (defaultSkin === null) { + return null; + } + //TODO + var targetDisplay = defaultSkin.getDisplay(target.name, ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET_DISPLAY, target.name)); + if (targetDisplay === null || !(targetDisplay instanceof dragonBones.PathDisplayData)) { + return null; + } + var bones = rawData[dragonBones.DataParser.BONES]; + if (bones === null || bones.length === 0) { + return null; + } + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.PathConstraintData); + constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + constraint.type = 1 /* Path */; + constraint.pathSlot = target; + constraint.pathDisplayData = targetDisplay; + constraint.target = target.parent; + constraint.positionMode = dragonBones.DataParser._getPositionMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.POSITION_MODE, "")); + constraint.spacingMode = dragonBones.DataParser._getSpacingMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.SPACING_MODE, "")); + constraint.rotateMode = dragonBones.DataParser._getRotateMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.ROTATE_MODE, "")); + constraint.position = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.POSITION, 0); + constraint.spacing = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SPACING, 0); + constraint.rotateOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE_OFFSET, 0); + constraint.rotateMix = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE_MIX, 1); + constraint.translateMix = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TRANSLATE_MIX, 1); + // + for (var _i = 0, bones_3 = bones; _i < bones_3.length; _i++) { + var boneName = bones_3[_i]; + var bone = this._armature.getBone(boneName); + if (bone !== null) { + constraint.AddBone(bone); + if (constraint.root === null) { + constraint.root = bone; + } + } + } + return constraint; + }; + ObjectDataParser.prototype._parseSlot = function (rawData, zOrder) { + var slot = dragonBones.BaseObject.borrowObject(dragonBones.SlotData); + slot.displayIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0); + slot.zOrder = zOrder; + slot.zIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Z_INDEX, 0); + slot.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + slot.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + slot.parent = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.PARENT, "")); // + if (dragonBones.DataParser.BLEND_MODE in rawData && typeof rawData[dragonBones.DataParser.BLEND_MODE] === "string") { + slot.blendMode = dragonBones.DataParser._getBlendMode(rawData[dragonBones.DataParser.BLEND_MODE]); + } + else { + slot.blendMode = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLEND_MODE, 0 /* Normal */); + } + if (dragonBones.DataParser.COLOR in rawData) { + slot.color = dragonBones.SlotData.createColor(); + this._parseColorTransform(rawData[dragonBones.DataParser.COLOR], slot.color); + } + else { + slot.color = dragonBones.SlotData.DEFAULT_COLOR; + } + if (dragonBones.DataParser.ACTIONS in rawData) { + this._slotChildActions[slot.name] = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + } + return slot; + }; + ObjectDataParser.prototype._parseSkin = function (rawData) { + var skin = dragonBones.BaseObject.borrowObject(dragonBones.SkinData); + skin.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (skin.name.length === 0) { + skin.name = dragonBones.DataParser.DEFAULT_NAME; + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawSlots = rawData[dragonBones.DataParser.SLOT]; + this._skin = skin; + for (var _i = 0, rawSlots_2 = rawSlots; _i < rawSlots_2.length; _i++) { + var rawSlot = rawSlots_2[_i]; + var slotName = ObjectDataParser._getString(rawSlot, dragonBones.DataParser.NAME, ""); + var slot = this._armature.getSlot(slotName); + if (slot !== null) { + this._slot = slot; + if (dragonBones.DataParser.DISPLAY in rawSlot) { + var rawDisplays = rawSlot[dragonBones.DataParser.DISPLAY]; + for (var _a = 0, rawDisplays_1 = rawDisplays; _a < rawDisplays_1.length; _a++) { + var rawDisplay = rawDisplays_1[_a]; + if (rawDisplay) { + skin.addDisplay(slotName, this._parseDisplay(rawDisplay)); + } + else { + skin.addDisplay(slotName, null); + } + } + } + this._slot = null; // + } + } + this._skin = null; // + } + return skin; + }; + ObjectDataParser.prototype._parseDisplay = function (rawData) { + var name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + var path = ObjectDataParser._getString(rawData, dragonBones.DataParser.PATH, ""); + var type = 0 /* Image */; + var display = null; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + type = dragonBones.DataParser._getDisplayType(rawData[dragonBones.DataParser.TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, type); + } + switch (type) { + case 0 /* Image */: { + var imageDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ImageDisplayData); + imageDisplay.name = name; + imageDisplay.path = path.length > 0 ? path : name; + this._parsePivot(rawData, imageDisplay); + break; + } + case 1 /* Armature */: { + var armatureDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureDisplayData); + armatureDisplay.name = name; + armatureDisplay.path = path.length > 0 ? path : name; + armatureDisplay.inheritAnimation = true; + if (dragonBones.DataParser.ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + for (var _i = 0, actions_5 = actions; _i < actions_5.length; _i++) { + var action = actions_5[_i]; + armatureDisplay.addAction(action); + } + } + else if (this._slot.name in this._slotChildActions) { + var displays = this._skin.getDisplays(this._slot.name); + if (displays === null ? this._slot.displayIndex === 0 : this._slot.displayIndex === displays.length) { + for (var _a = 0, _b = this._slotChildActions[this._slot.name]; _a < _b.length; _a++) { + var action = _b[_a]; + armatureDisplay.addAction(action); + } + delete this._slotChildActions[this._slot.name]; + } + } + break; + } + case 2 /* Mesh */: { + var meshDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.MeshDisplayData); + meshDisplay.geometry.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true); + meshDisplay.name = name; + meshDisplay.path = path.length > 0 ? path : name; + if (dragonBones.DataParser.SHARE in rawData) { + meshDisplay.geometry.data = this._data; + this._cacheRawMeshes.push(rawData); + this._cacheMeshes.push(meshDisplay); + } + else { + this._parseMesh(rawData, meshDisplay); + } + break; + } + case 3 /* BoundingBox */: { + var boundingBox = this._parseBoundingBox(rawData); + if (boundingBox !== null) { + var boundingBoxDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.BoundingBoxDisplayData); + boundingBoxDisplay.name = name; + boundingBoxDisplay.path = path.length > 0 ? path : name; + boundingBoxDisplay.boundingBox = boundingBox; + } + break; + } + case 4 /* Path */: { + var rawCurveLengths = rawData[dragonBones.DataParser.LENGTHS]; + var pathDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.PathDisplayData); + pathDisplay.closed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CLOSED, false); + pathDisplay.constantSpeed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CONSTANT_SPEED, false); + pathDisplay.name = name; + pathDisplay.path = path.length > 0 ? path : name; + pathDisplay.curveLengths.length = rawCurveLengths.length; + for (var i = 0, l = rawCurveLengths.length; i < l; ++i) { + pathDisplay.curveLengths[i] = rawCurveLengths[i]; + } + this._parsePath(rawData, pathDisplay); + break; + } + } + if (display !== null && dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], display.transform, this._armature.scale); + } + return display; + }; + ObjectDataParser.prototype._parsePath = function (rawData, display) { + this._parseGeometry(rawData, display.geometry); + }; + ObjectDataParser.prototype._parsePivot = function (rawData, display) { + if (dragonBones.DataParser.PIVOT in rawData) { + var rawPivot = rawData[dragonBones.DataParser.PIVOT]; + display.pivot.x = ObjectDataParser._getNumber(rawPivot, dragonBones.DataParser.X, 0.0); + display.pivot.y = ObjectDataParser._getNumber(rawPivot, dragonBones.DataParser.Y, 0.0); + } + else { + display.pivot.x = 0.5; + display.pivot.y = 0.5; + } + }; + ObjectDataParser.prototype._parseMesh = function (rawData, mesh) { + this._parseGeometry(rawData, mesh.geometry); + if (dragonBones.DataParser.WEIGHTS in rawData) { // Cache pose data. + var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE]; + var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE]; + var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; + this._weightSlotPose[meshName] = rawSlotPose; + this._weightBonePoses[meshName] = rawBonePoses; + } + }; + ObjectDataParser.prototype._parseBoundingBox = function (rawData) { + var boundingBox = null; + var type = 0 /* Rectangle */; + if (dragonBones.DataParser.SUB_TYPE in rawData && typeof rawData[dragonBones.DataParser.SUB_TYPE] === "string") { + type = dragonBones.DataParser._getBoundingBoxType(rawData[dragonBones.DataParser.SUB_TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SUB_TYPE, type); + } + switch (type) { + case 0 /* Rectangle */: + boundingBox = dragonBones.BaseObject.borrowObject(dragonBones.RectangleBoundingBoxData); + break; + case 1 /* Ellipse */: + boundingBox = dragonBones.BaseObject.borrowObject(dragonBones.EllipseBoundingBoxData); + break; + case 2 /* Polygon */: + boundingBox = this._parsePolygonBoundingBox(rawData); + break; + } + if (boundingBox !== null) { + boundingBox.color = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.COLOR, 0x000000); + if (boundingBox.type === 0 /* Rectangle */ || boundingBox.type === 1 /* Ellipse */) { + boundingBox.width = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WIDTH, 0.0); + boundingBox.height = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.HEIGHT, 0.0); + } + } + return boundingBox; + }; + ObjectDataParser.prototype._parsePolygonBoundingBox = function (rawData) { + var polygonBoundingBox = dragonBones.BaseObject.borrowObject(dragonBones.PolygonBoundingBoxData); + if (dragonBones.DataParser.VERTICES in rawData) { + var scale = this._armature.scale; + var rawVertices = rawData[dragonBones.DataParser.VERTICES]; + var vertices = polygonBoundingBox.vertices; + vertices.length = rawVertices.length; + for (var i = 0, l = rawVertices.length; i < l; i += 2) { + var x = rawVertices[i] * scale; + var y = rawVertices[i + 1] * scale; + vertices[i] = x; + vertices[i + 1] = y; + // AABB. + if (i === 0) { + polygonBoundingBox.x = x; + polygonBoundingBox.y = y; + polygonBoundingBox.width = x; + polygonBoundingBox.height = y; + } + else { + if (x < polygonBoundingBox.x) { + polygonBoundingBox.x = x; + } + else if (x > polygonBoundingBox.width) { + polygonBoundingBox.width = x; + } + if (y < polygonBoundingBox.y) { + polygonBoundingBox.y = y; + } + else if (y > polygonBoundingBox.height) { + polygonBoundingBox.height = y; + } + } + } + polygonBoundingBox.width -= polygonBoundingBox.x; + polygonBoundingBox.height -= polygonBoundingBox.y; + } + else { + console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug."); + } + return polygonBoundingBox; + }; + ObjectDataParser.prototype._parseAnimation = function (rawData) { + var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData); + animation.blendType = dragonBones.DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, "")); + animation.frameCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0); + animation.playTimes = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1); + animation.duration = animation.frameCount / this._armature.frameRate; // float + animation.fadeInTime = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0); + animation.scale = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0); + animation.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (animation.name.length === 0) { + animation.name = dragonBones.DataParser.DEFAULT_NAME; + } + animation.frameIntOffset = this._frameIntArray.length; + animation.frameFloatOffset = this._frameFloatArray.length; + animation.frameOffset = this._frameArray.length; + this._animation = animation; + if (dragonBones.DataParser.FRAME in rawData) { + var rawFrames = rawData[dragonBones.DataParser.FRAME]; + var keyFrameCount = rawFrames.length; + if (keyFrameCount > 0) { + for (var i = 0, frameStart = 0; i < keyFrameCount; ++i) { + var rawFrame = rawFrames[i]; + this._parseActionDataInFrame(rawFrame, frameStart, null, null); + frameStart += ObjectDataParser._getNumber(rawFrame, dragonBones.DataParser.DURATION, 1); + } + } + } + if (dragonBones.DataParser.Z_ORDER in rawData) { + this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, 0 /* Step */, 0, this._parseZOrderFrame); + } + if (dragonBones.DataParser.BONE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.BONE]; + for (var _i = 0, rawTimelines_1 = rawTimelines; _i < rawTimelines_1.length; _i++) { + var rawTimeline = rawTimelines_1[_i]; + this._parseBoneTimeline(rawTimeline); + } + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.SLOT]; + for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) { + var rawTimeline = rawTimelines_2[_a]; + this._parseSlotTimeline(rawTimeline); + } + } + if (dragonBones.DataParser.FFD in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.FFD]; + for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) { + var rawTimeline = rawTimelines_3[_b]; + var skinName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME); + var slotName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SLOT, ""); + var displayName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + if (skinName.length === 0) { // + skinName = dragonBones.DataParser.DEFAULT_NAME; + } + this._slot = this._armature.getSlot(slotName); + this._mesh = this._armature.getMesh(skinName, slotName, displayName); + if (this._slot === null || this._mesh === null) { + continue; + } + var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, 2 /* Float */, 0, this._parseSlotDeformFrame); + if (timeline !== null) { + this._animation.addSlotTimeline(slotName, timeline); + } + this._slot = null; // + this._mesh = null; // + } + } + if (dragonBones.DataParser.IK in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.IK]; + for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) { + var rawTimeline = rawTimelines_4[_c]; + var constraintName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var constraint = this._armature.getConstraint(constraintName); + if (constraint === null) { + continue; + } + var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, 1 /* Int */, 2, this._parseIKConstraintFrame); + if (timeline !== null) { + this._animation.addConstraintTimeline(constraintName, timeline); + } + } + } + if (this._actionFrames.length > 0) { + this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, 0 /* Step */, 0, this._parseActionFrame); + this._actionFrames.length = 0; + } + if (dragonBones.DataParser.TIMELINE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.TIMELINE]; + for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) { + var rawTimeline = rawTimelines_5[_d]; + var timelineType = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */); + var timelineName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var timeline = null; + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 20 /* SlotDisplay */: // TODO + case 23 /* SlotZIndex */: + case 60 /* BoneAlpha */: + case 24 /* SlotAlpha */: + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + if (timelineType === 20 /* SlotDisplay */) { + this._frameValueType = 0 /* Step */; + this._frameValueScale = 1.0; + } + else { + this._frameValueType = 1 /* Int */; + if (timelineType === 23 /* SlotZIndex */) { + this._frameValueScale = 1.0; + } + else if (timelineType === 40 /* AnimationProgress */ || + timelineType === 41 /* AnimationWeight */) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + if (timelineType === 60 /* BoneAlpha */ || + timelineType === 24 /* SlotAlpha */ || + timelineType === 41 /* AnimationWeight */) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData); + var animaitonTimeline = timeline; + animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0); + animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0); + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 1, this._parseSingleValueFrame, timeline); + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 30 /* IKConstraint */: + case 42 /* AnimationParameter */: + if (timelineType === 30 /* IKConstraint */ || + timelineType === 42 /* AnimationParameter */) { + this._frameValueType = 1 /* Int */; + if (timelineType === 42 /* AnimationParameter */) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + else { + if (timelineType === 12 /* BoneRotate */) { + this._frameValueScale = dragonBones.Transform.DEG_RAD; + } + else { + this._frameValueScale = 1.0; + } + this._frameValueType = 2 /* Float */; + } + if (timelineType === 13 /* BoneScale */ || + timelineType === 30 /* IKConstraint */) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 2, this._parseDoubleValueFrame); + break; + case 1 /* ZOrder */: + // TODO + break; + case 50 /* Surface */: { + var surface = this._armature.getBone(timelineName); + if (surface === null) { + continue; + } + this._geometry = surface.geometry; + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame); + this._geometry = null; // + break; + } + case 22 /* SlotDeform */: { + this._geometry = null; // + for (var skinName in this._armature.skins) { + var skin = this._armature.skins[skinName]; + for (var slontName in skin.displays) { + var displays = skin.displays[slontName]; + for (var _e = 0, displays_1 = displays; _e < displays_1.length; _e++) { + var display = displays_1[_e]; + if (display !== null && display.name === timelineName) { + this._geometry = display.geometry; + break; + } + } + } + } + if (this._geometry === null) { + continue; + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame); + this._geometry = null; // + break; + } + case 21 /* SlotColor */: + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 1 /* Int */, 1, this._parseSlotColorFrame); + break; + } + if (timeline !== null) { + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 1 /* ZOrder */: + // TODO + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 50 /* Surface */: + case 60 /* BoneAlpha */: + this._animation.addBoneTimeline(timelineName, timeline); + break; + case 20 /* SlotDisplay */: + case 21 /* SlotColor */: + case 22 /* SlotDeform */: + case 23 /* SlotZIndex */: + case 24 /* SlotAlpha */: + this._animation.addSlotTimeline(timelineName, timeline); + break; + case 30 /* IKConstraint */: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + case 42 /* AnimationParameter */: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null; // + return animation; + }; + ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, timelineType, frameValueType, frameValueCount, frameParser, timeline) { + if (timeline === void 0) { timeline = null; } + if (rawData !== null && framesKey.length > 0 && framesKey in rawData) { + rawFrames = rawData[framesKey]; + } + if (rawFrames === null) { + return null; + } + var keyFrameCount = rawFrames.length; + if (keyFrameCount === 0) { + return null; + } + var frameIntArrayLength = this._frameIntArray.length; + var frameFloatArrayLength = this._frameFloatArray.length; + var timelineOffset = this._timelineArray.length; + if (timeline === null) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData); + } + timeline.type = timelineType; + timeline.offset = timelineOffset; + this._frameValueType = frameValueType; + this._timeline = timeline; + this._timelineArray.length += 1 + 1 + 1 + 1 + 1 + keyFrameCount; + if (rawData !== null) { + this._timelineArray[timelineOffset + 0 /* TimelineScale */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0) * 100); + this._timelineArray[timelineOffset + 1 /* TimelineOffset */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0.0) * 100); + } + else { + this._timelineArray[timelineOffset + 0 /* TimelineScale */] = 100; + this._timelineArray[timelineOffset + 1 /* TimelineOffset */] = 0; + } + this._timelineArray[timelineOffset + 2 /* TimelineKeyFrameCount */] = keyFrameCount; + this._timelineArray[timelineOffset + 3 /* TimelineFrameValueCount */] = frameValueCount; + switch (this._frameValueType) { + case 0 /* Step */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0; + break; + case 1 /* Int */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset; + break; + case 2 /* Float */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset; + break; + } + if (keyFrameCount === 1) { // Only one frame. + timeline.frameIndicesOffset = -1; + this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + 0] = frameParser.call(this, rawFrames[0], 0, 0) - this._animation.frameOffset; + } + else { + var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. + var frameIndices = this._data.frameIndices; + var frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; + timeline.frameIndicesOffset = frameIndicesOffset; + for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) { + if (frameStart + frameCount <= i && iK < keyFrameCount) { + var rawFrame = rawFrames[iK]; + frameStart = i; // frame.frameStart; + if (iK === keyFrameCount - 1) { + frameCount = this._animation.frameCount - frameStart; + } + else { + if (rawFrame instanceof ActionFrame) { + frameCount = this._actionFrames[iK + 1].frameStart - frameStart; + } + else { + frameCount = ObjectDataParser._getNumber(rawFrame, dragonBones.DataParser.DURATION, 1); + } + } + this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + iK] = frameParser.call(this, rawFrame, frameStart, frameCount) - this._animation.frameOffset; + iK++; + } + frameIndices[frameIndicesOffset + i] = iK - 1; + } + } + this._timeline = null; // + return timeline; + }; + ObjectDataParser.prototype._parseBoneTimeline = function (rawData) { + var bone = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "")); + if (bone === null) { + return; + } + this._bone = bone; + this._slot = this._armature.getSlot(this._bone.name); + if (dragonBones.DataParser.TRANSLATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, 2 /* Float */, 2, this._parseDoubleValueFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.ROTATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, 2 /* Float */, 2, this._parseBoneRotateFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.SCALE_FRAME in rawData) { + this._frameDefaultValue = 1.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, 2 /* Float */, 2, this._parseBoneScaleFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.FRAME in rawData) { + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, 2 /* Float */, 6, this._parseBoneAllFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + this._bone = null; // + this._slot = null; // + }; + ObjectDataParser.prototype._parseSlotTimeline = function (rawData) { + var slot = this._armature.getSlot(ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "")); + if (slot === null) { + return; + } + var displayTimeline = null; + var colorTimeline = null; + this._slot = slot; + if (dragonBones.DataParser.DISPLAY_FRAME in rawData) { + displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame); + } + else { + displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame); + } + if (dragonBones.DataParser.COLOR_FRAME in rawData) { + colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame); + } + else { + colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame); + } + if (displayTimeline !== null) { + this._animation.addSlotTimeline(slot.name, displayTimeline); + } + if (colorTimeline !== null) { + this._animation.addSlotTimeline(slot.name, colorTimeline); + } + this._slot = null; // + }; + ObjectDataParser.prototype._parseFrame = function (rawData, frameStart, frameCount) { + // tslint:disable-next-line:no-unused-expression + rawData; + // tslint:disable-next-line:no-unused-expression + frameCount; + var frameOffset = this._frameArray.length; + this._frameArray.length += 1; + this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart; + return frameOffset; + }; + ObjectDataParser.prototype._parseTweenFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + if (frameCount > 0) { + if (dragonBones.DataParser.CURVE in rawData) { + var sampleCount = frameCount + 1; + this._helpArray.length = sampleCount; + var isOmited = this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray); + this._frameArray.length += 1 + 1 + this._helpArray.length; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 2 /* Curve */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = isOmited ? sampleCount : -sampleCount; + for (var i = 0; i < sampleCount; ++i) { + this._frameArray[frameOffset + 3 /* FrameCurveSamples */ + i] = Math.round(this._helpArray[i] * 10000.0); + } + } + else { + var noTween = -2.0; + var tweenEasing = noTween; + if (dragonBones.DataParser.TWEEN_EASING in rawData) { + tweenEasing = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TWEEN_EASING, noTween); + } + if (tweenEasing === noTween) { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 0 /* None */; + } + else if (tweenEasing === 0.0) { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 1 /* Line */; + } + else if (tweenEasing < 0.0) { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 3 /* QuadIn */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(-tweenEasing * 100.0); + } + else if (tweenEasing <= 1.0) { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 4 /* QuadOut */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(tweenEasing * 100.0); + } + else { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 5 /* QuadInOut */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(tweenEasing * 100.0 - 100.0); + } + } + } + else { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 0 /* None */; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseSingleValueFrame = function (rawData, frameStart, frameCount) { + var frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue); + break; + } + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale); + break; + } + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 1; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + return frameOffset; + }; + ObjectDataParser.prototype._parseDoubleValueFrame = function (rawData, frameStart, frameCount) { + var frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 2; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue); + this._frameArray[frameOffset + 2] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue); + break; + } + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale); + this._frameIntArray[frameValueOffset + 1] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale); + break; + } + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale; + this._frameFloatArray[frameValueOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + return frameOffset; + }; + ObjectDataParser.prototype._parseActionFrame = function (frame, frameStart, frameCount) { + // tslint:disable-next-line:no-unused-expression + frameCount; + var frameOffset = this._frameArray.length; + var actionCount = frame.actions.length; + this._frameArray.length += 1 + 1 + actionCount; + this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart; + this._frameArray[frameOffset + 0 /* FramePosition */ + 1] = actionCount; // Action count. + for (var i = 0; i < actionCount; ++i) { // Action offsets. + this._frameArray[frameOffset + 0 /* FramePosition */ + 2 + i] = frame.actions[i]; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseZOrderFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + if (dragonBones.DataParser.Z_ORDER in rawData) { + var rawZOrder = rawData[dragonBones.DataParser.Z_ORDER]; + if (rawZOrder.length > 0) { + var slotCount = this._armature.sortedSlots.length; + var unchanged = new Array(slotCount - rawZOrder.length / 2); + var zOrders = new Array(slotCount); + for (var i_1 = 0; i_1 < unchanged.length; ++i_1) { + unchanged[i_1] = 0; + } + for (var i_2 = 0; i_2 < slotCount; ++i_2) { + zOrders[i_2] = -1; + } + var originalIndex = 0; + var unchangedIndex = 0; + for (var i_3 = 0, l = rawZOrder.length; i_3 < l; i_3 += 2) { + var slotIndex = rawZOrder[i_3]; + var zOrderOffset = rawZOrder[i_3 + 1]; + while (originalIndex !== slotIndex) { + unchanged[unchangedIndex++] = originalIndex++; + } + var index = originalIndex + zOrderOffset; + zOrders[index] = originalIndex++; + } + while (originalIndex < slotCount) { + unchanged[unchangedIndex++] = originalIndex++; + } + this._frameArray.length += 1 + slotCount; + this._frameArray[frameOffset + 1] = slotCount; + var i = slotCount; + while (i--) { + if (zOrders[i] === -1) { + this._frameArray[frameOffset + 2 + i] = unchanged[--unchangedIndex] || 0; + } + else { + this._frameArray[frameOffset + 2 + i] = zOrders[i] || 0; + } + } + return frameOffset; + } + } + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = 0; + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneAllFrame = function (rawData, frameStart, frameCount) { + this._helpTransform.identity(); + if (dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], this._helpTransform, 1.0); + } + // Modify rotation. + var rotation = this._helpTransform.rotation; + if (frameStart !== 0) { + if (this._prevClockwise === 0) { + rotation = this._prevRotation + dragonBones.Transform.normalizeRadian(rotation - this._prevRotation); + } + else { + if (this._prevClockwise > 0 ? rotation >= this._prevRotation : rotation <= this._prevRotation) { + this._prevClockwise = this._prevClockwise > 0 ? this._prevClockwise - 1 : this._prevClockwise + 1; + } + rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise; + } + } + this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TWEEN_ROTATE, 0.0); + this._prevRotation = rotation; + // + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 6; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.x; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.y; + this._frameFloatArray[frameFloatOffset++] = rotation; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.skew; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleX; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleY; + this._parseActionDataInFrame(rawData, frameStart, this._bone, this._slot); + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneTranslateFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0); + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneRotateFrame = function (rawData, frameStart, frameCount) { + // Modify rotation. + var rotation = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE, 0.0) * dragonBones.Transform.DEG_RAD; + if (frameStart !== 0) { + if (this._prevClockwise === 0) { + rotation = this._prevRotation + dragonBones.Transform.normalizeRadian(rotation - this._prevRotation); + } + else { + if (this._prevClockwise > 0 ? rotation >= this._prevRotation : rotation <= this._prevRotation) { + this._prevClockwise = this._prevClockwise > 0 ? this._prevClockwise - 1 : this._prevClockwise + 1; + } + rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise; + } + } + this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CLOCK_WISE, 0); + this._prevRotation = rotation; + // + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = rotation; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD; + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneScaleFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 1.0); + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotDisplayFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + if (dragonBones.DataParser.VALUE in rawData) { + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, 0); + } + else { + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0); + } + this._parseActionDataInFrame(rawData, frameStart, this._slot.parent, this._slot); + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotColorFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var colorOffset = -1; + if (dragonBones.DataParser.VALUE in rawData || dragonBones.DataParser.COLOR in rawData) { + var rawColor = dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : rawData[dragonBones.DataParser.COLOR]; + for (var k in rawColor) { // Detects the presence of color. + // tslint:disable-next-line:no-unused-expression + k; + this._parseColorTransform(rawColor, this._helpColorTransform); + colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset); + colorOffset -= 8; + break; + } + } + if (colorOffset < 0) { + if (this._defaultColorOffset < 0) { + this._defaultColorOffset = colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + } + colorOffset = this._defaultColorOffset; + } + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameIntOffset] = colorOffset; + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotDeformFrame = function (rawData, frameStart, frameCount) { + var frameFloatOffset = this._frameFloatArray.length; + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var rawVertices = dragonBones.DataParser.VERTICES in rawData ? rawData[dragonBones.DataParser.VERTICES] : null; + var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint + var vertexCount = this._intArray[this._mesh.geometry.offset + 0 /* GeometryVertexCount */]; + var meshName = this._mesh.parent.name + "_" + this._slot.name + "_" + this._mesh.name; + var weight = this._mesh.geometry.weight; + var x = 0.0; + var y = 0.0; + var iB = 0; + var iV = 0; + if (weight !== null) { + var rawSlotPose = this._weightSlotPose[meshName]; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + this._frameFloatArray.length += weight.count * 2; + iB = weight.offset + 2 /* WeigthBoneIndices */ + weight.bones.length; + } + else { + this._frameFloatArray.length += vertexCount * 2; + } + for (var i = 0; i < vertexCount * 2; i += 2) { + if (rawVertices === null) { // Fill 0. + x = 0.0; + y = 0.0; + } + else { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + if (weight !== null) { // If mesh is skinned, transform point by bone bind pose. + var rawBonePoses = this._weightBonePoses[meshName]; + var vertexBoneCount = this._intArray[iB++]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint, true); + x = this._helpPoint.x; + y = this._helpPoint.y; + for (var j = 0; j < vertexBoneCount; ++j) { + var boneIndex = this._intArray[iB++]; + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint, true); + this._frameFloatArray[frameFloatOffset + iV++] = this._helpPoint.x; + this._frameFloatArray[frameFloatOffset + iV++] = this._helpPoint.y; + } + } + else { + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + if (frameStart === 0) { + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.geometry.offset; + this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0; + this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseIKConstraintFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameIntOffset++] = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true) ? 1 : 0; + this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseActionData = function (rawData, type, bone, slot) { + var actions = new Array(); + if (typeof rawData === "string") { + var action = dragonBones.BaseObject.borrowObject(dragonBones.ActionData); + action.type = type; + action.name = rawData; + action.bone = bone; + action.slot = slot; + actions.push(action); + } + else if (rawData instanceof Array) { + for (var _i = 0, rawData_2 = rawData; _i < rawData_2.length; _i++) { + var rawAction = rawData_2[_i]; + var action = dragonBones.BaseObject.borrowObject(dragonBones.ActionData); + if (dragonBones.DataParser.GOTO_AND_PLAY in rawAction) { + action.type = 0 /* Play */; + action.name = ObjectDataParser._getString(rawAction, dragonBones.DataParser.GOTO_AND_PLAY, ""); + } + else { + if (dragonBones.DataParser.TYPE in rawAction && typeof rawAction[dragonBones.DataParser.TYPE] === "string") { + action.type = dragonBones.DataParser._getActionType(rawAction[dragonBones.DataParser.TYPE]); + } + else { + action.type = ObjectDataParser._getNumber(rawAction, dragonBones.DataParser.TYPE, type); + } + action.name = ObjectDataParser._getString(rawAction, dragonBones.DataParser.NAME, ""); + } + if (dragonBones.DataParser.BONE in rawAction) { + var boneName = ObjectDataParser._getString(rawAction, dragonBones.DataParser.BONE, ""); + action.bone = this._armature.getBone(boneName); + } + else { + action.bone = bone; + } + if (dragonBones.DataParser.SLOT in rawAction) { + var slotName = ObjectDataParser._getString(rawAction, dragonBones.DataParser.SLOT, ""); + action.slot = this._armature.getSlot(slotName); + } + else { + action.slot = slot; + } + var userData = null; + if (dragonBones.DataParser.INTS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawInts = rawAction[dragonBones.DataParser.INTS]; + for (var _a = 0, rawInts_1 = rawInts; _a < rawInts_1.length; _a++) { + var rawValue = rawInts_1[_a]; + userData.addInt(rawValue); + } + } + if (dragonBones.DataParser.FLOATS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawFloats = rawAction[dragonBones.DataParser.FLOATS]; + for (var _b = 0, rawFloats_1 = rawFloats; _b < rawFloats_1.length; _b++) { + var rawValue = rawFloats_1[_b]; + userData.addFloat(rawValue); + } + } + if (dragonBones.DataParser.STRINGS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawStrings = rawAction[dragonBones.DataParser.STRINGS]; + for (var _c = 0, rawStrings_1 = rawStrings; _c < rawStrings_1.length; _c++) { + var rawValue = rawStrings_1[_c]; + userData.addString(rawValue); + } + } + action.data = userData; + actions.push(action); + } + } + return actions; + }; + ObjectDataParser.prototype._parseDeformFrame = function (rawData, frameStart, frameCount) { + var frameFloatOffset = this._frameFloatArray.length; + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var rawVertices = dragonBones.DataParser.VERTICES in rawData ? + rawData[dragonBones.DataParser.VERTICES] : + (dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : null); + var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint + var vertexCount = this._intArray[this._geometry.offset + 0 /* GeometryVertexCount */]; + var weight = this._geometry.weight; + var x = 0.0; + var y = 0.0; + if (weight !== null) { + // TODO + } + else { + this._frameFloatArray.length += vertexCount * 2; + for (var i = 0; i < vertexCount * 2; i += 2) { + if (rawVertices !== null) { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + else { + x = 0.0; + y = 0.0; + } + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + if (frameStart === 0) { + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._geometry.offset; + this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0; + this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseTransform = function (rawData, transform, scale) { + transform.x = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0) * scale; + transform.y = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0) * scale; + if (dragonBones.DataParser.ROTATE in rawData || dragonBones.DataParser.SKEW in rawData) { + transform.rotation = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE, 0.0) * dragonBones.Transform.DEG_RAD); + transform.skew = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD); + } + else if (dragonBones.DataParser.SKEW_X in rawData || dragonBones.DataParser.SKEW_Y in rawData) { + transform.rotation = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW_Y, 0.0) * dragonBones.Transform.DEG_RAD); + transform.skew = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW_X, 0.0) * dragonBones.Transform.DEG_RAD) - transform.rotation; + } + transform.scaleX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE_X, 1.0); + transform.scaleY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE_Y, 1.0); + }; + ObjectDataParser.prototype._parseColorTransform = function (rawData, color) { + color.alphaMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA_MULTIPLIER, 100) * 0.01; + color.redMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.RED_MULTIPLIER, 100) * 0.01; + color.greenMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_MULTIPLIER, 100) * 0.01; + color.blueMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_MULTIPLIER, 100) * 0.01; + color.alphaOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA_OFFSET, 0); + color.redOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.RED_OFFSET, 0); + color.greenOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_OFFSET, 0); + color.blueOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_OFFSET, 0); + }; + ObjectDataParser.prototype._parseGeometry = function (rawData, geometry) { + var rawVertices = rawData[dragonBones.DataParser.VERTICES]; + var vertexCount = Math.floor(rawVertices.length / 2); // uint + var triangleCount = 0; + var geometryOffset = this._intArray.length; + var verticesOffset = this._floatArray.length; + // + geometry.offset = geometryOffset; + geometry.data = this._data; + // + this._intArray.length += 1 + 1 + 1 + 1; + this._intArray[geometryOffset + 0 /* GeometryVertexCount */] = vertexCount; + this._intArray[geometryOffset + 2 /* GeometryFloatOffset */] = verticesOffset; + this._intArray[geometryOffset + 3 /* GeometryWeightOffset */] = -1; // + // + this._floatArray.length += vertexCount * 2; + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[verticesOffset + i] = rawVertices[i]; + } + if (dragonBones.DataParser.TRIANGLES in rawData) { + var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES]; + triangleCount = Math.floor(rawTriangles.length / 3); // uint + // + this._intArray.length += triangleCount * 3; + for (var i = 0, l = triangleCount * 3; i < l; ++i) { + this._intArray[geometryOffset + 4 /* GeometryVertexIndices */ + i] = rawTriangles[i]; + } + } + // Fill triangle count. + this._intArray[geometryOffset + 1 /* GeometryTriangleCount */] = triangleCount; + if (dragonBones.DataParser.UVS in rawData) { + var rawUVs = rawData[dragonBones.DataParser.UVS]; + var uvOffset = verticesOffset + vertexCount * 2; + this._floatArray.length += vertexCount * 2; + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[uvOffset + i] = rawUVs[i]; + } + } + if (dragonBones.DataParser.WEIGHTS in rawData) { + var rawWeights = rawData[dragonBones.DataParser.WEIGHTS]; + var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint + var weightOffset = this._intArray.length; + var floatOffset = this._floatArray.length; + var weightBoneCount = 0; + var sortedBones = this._armature.sortedBones; + var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData); + weight.count = weightCount; + weight.offset = weightOffset; + this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount; + this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset; + if (dragonBones.DataParser.BONE_POSE in rawData) { + var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE]; + var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE]; + var weightBoneIndices = new Array(); + weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint + weightBoneIndices.length = weightBoneCount; + for (var i = 0; i < weightBoneCount; ++i) { + var rawBoneIndex = rawBonePoses[i * 7]; // uint + var bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + weightBoneIndices[i] = rawBoneIndex; + this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone); + } + this._floatArray.length += weightCount * 3; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) { + var iD = i * 2; + var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint + var x = this._floatArray[verticesOffset + iD]; + var y = this._floatArray[verticesOffset + iD + 1]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint); + x = this._helpPoint.x; + y = this._helpPoint.y; + for (var j = 0; j < vertexBoneCount; ++j) { + var rawBoneIndex = rawWeights[iW++]; // uint + var boneIndex = weightBoneIndices.indexOf(rawBoneIndex); + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint); + this._intArray[iB++] = boneIndex; + this._floatArray[iV++] = rawWeights[iW++]; + this._floatArray[iV++] = this._helpPoint.x; + this._floatArray[iV++] = this._helpPoint.y; + } + } + } + else { + var rawBones = rawData[dragonBones.DataParser.BONES]; + weightBoneCount = rawBones.length; + for (var i = 0; i < weightBoneCount; i++) { + var rawBoneIndex = rawBones[i]; + var bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone); + } + this._floatArray.length += weightCount * 3; + for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) { + var vertexBoneCount = rawWeights[iW++]; + this._intArray[iB++] = vertexBoneCount; + for (var j = 0; j < vertexBoneCount; j++) { + var boneIndex = rawWeights[iW++]; + var boneWeight = rawWeights[iW++]; + var x = rawVertices[iV++]; + var y = rawVertices[iV++]; + this._intArray[iB++] = rawBones.indexOf(boneIndex); + this._floatArray[iF++] = boneWeight; + this._floatArray[iF++] = x; + this._floatArray[iF++] = y; + } + } + } + geometry.weight = weight; + } + }; + ObjectDataParser.prototype._parseArray = function (rawData) { + // tslint:disable-next-line:no-unused-expression + rawData; + this._intArray.length = 0; + this._floatArray.length = 0; + this._frameIntArray.length = 0; + this._frameFloatArray.length = 0; + this._frameArray.length = 0; + this._timelineArray.length = 0; + this._colorArray.length = 0; + }; + ObjectDataParser.prototype._modifyArray = function () { + // Align. + if ((this._intArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._intArray.push(0); + } + if ((this._frameIntArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._frameIntArray.push(0); + } + if ((this._frameArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._frameArray.push(0); + } + if ((this._timelineArray.length % Uint16Array.BYTES_PER_ELEMENT) !== 0) { + this._timelineArray.push(0); + } + if ((this._timelineArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._colorArray.push(0); + } + var l1 = this._intArray.length * Int16Array.BYTES_PER_ELEMENT; + var l2 = this._floatArray.length * Float32Array.BYTES_PER_ELEMENT; + var l3 = this._frameIntArray.length * Int16Array.BYTES_PER_ELEMENT; + var l4 = this._frameFloatArray.length * Float32Array.BYTES_PER_ELEMENT; + var l5 = this._frameArray.length * Int16Array.BYTES_PER_ELEMENT; + var l6 = this._timelineArray.length * Uint16Array.BYTES_PER_ELEMENT; + var l7 = this._colorArray.length * Int16Array.BYTES_PER_ELEMENT; + var lTotal = l1 + l2 + l3 + l4 + l5 + l6 + l7; + // + var binary = new ArrayBuffer(lTotal); + var intArray = new Uint16Array(binary, 0, this._intArray.length); + var floatArray = new Float32Array(binary, l1, this._floatArray.length); + var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length); + var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length); + var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length); + var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length); + var colorArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5 + l6, this._colorArray.length); + for (var i = 0, l = this._intArray.length; i < l; ++i) { + intArray[i] = this._intArray[i]; + } + for (var i = 0, l = this._floatArray.length; i < l; ++i) { + floatArray[i] = this._floatArray[i]; + } + for (var i = 0, l = this._frameIntArray.length; i < l; ++i) { + frameIntArray[i] = this._frameIntArray[i]; + } + for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) { + frameFloatArray[i] = this._frameFloatArray[i]; + } + for (var i = 0, l = this._frameArray.length; i < l; ++i) { + frameArray[i] = this._frameArray[i]; + } + for (var i = 0, l = this._timelineArray.length; i < l; ++i) { + timelineArray[i] = this._timelineArray[i]; + } + for (var i = 0, l = this._colorArray.length; i < l; ++i) { + colorArray[i] = this._colorArray[i]; + } + this._data.binary = binary; + this._data.intArray = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = frameArray; + this._data.timelineArray = timelineArray; + this._data.colorArray = colorArray; + this._defaultColorOffset = -1; + }; + ObjectDataParser.prototype.parseDragonBonesData = function (rawData, scale) { + if (scale === void 0) { scale = 1; } + console.assert(rawData !== null && rawData !== undefined, "Data error."); + var version = ObjectDataParser._getString(rawData, dragonBones.DataParser.VERSION, ""); + var compatibleVersion = ObjectDataParser._getString(rawData, dragonBones.DataParser.COMPATIBLE_VERSION, ""); + if (dragonBones.DataParser.DATA_VERSIONS.indexOf(version) >= 0 || + dragonBones.DataParser.DATA_VERSIONS.indexOf(compatibleVersion) >= 0) { + var data = dragonBones.BaseObject.borrowObject(dragonBones.DragonBonesData); + data.version = version; + data.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + data.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, 24); + if (data.frameRate === 0) { // Data error. + data.frameRate = 24; + } + if (dragonBones.DataParser.ARMATURE in rawData) { + this._data = data; + this._parseArray(rawData); + var rawArmatures = rawData[dragonBones.DataParser.ARMATURE]; + for (var _i = 0, rawArmatures_1 = rawArmatures; _i < rawArmatures_1.length; _i++) { + var rawArmature = rawArmatures_1[_i]; + data.addArmature(this._parseArmature(rawArmature, scale)); + } + if (!this._data.binary) { // DragonBones.webAssembly ? 0 : null; + this._modifyArray(); + } + if (dragonBones.DataParser.STAGE in rawData) { + data.stage = data.getArmature(ObjectDataParser._getString(rawData, dragonBones.DataParser.STAGE, "")); + } + else if (data.armatureNames.length > 0) { + data.stage = data.getArmature(data.armatureNames[0]); + } + this._data = null; + } + if (dragonBones.DataParser.TEXTURE_ATLAS in rawData) { + this._rawTextureAtlases = rawData[dragonBones.DataParser.TEXTURE_ATLAS]; + } + return data; + } + else { + console.assert(false, "Nonsupport data version: " + version + "\n" + + "Please convert DragonBones data to support version.\n" + + "Read more: https://github.com/DragonBones/Tools/"); + } + return null; + }; + ObjectDataParser.prototype.parseTextureAtlasData = function (rawData, textureAtlasData, scale) { + if (scale === void 0) { scale = 1.0; } + console.assert(rawData !== undefined); + if (rawData === null) { + if (this._rawTextureAtlases === null || this._rawTextureAtlases.length === 0) { + return false; + } + var rawTextureAtlas = this._rawTextureAtlases[this._rawTextureAtlasIndex++]; + this.parseTextureAtlasData(rawTextureAtlas, textureAtlasData, scale); + if (this._rawTextureAtlasIndex >= this._rawTextureAtlases.length) { + this._rawTextureAtlasIndex = 0; + this._rawTextureAtlases = null; + } + return true; + } + // Texture format. + textureAtlasData.width = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WIDTH, 0); + textureAtlasData.height = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.HEIGHT, 0); + textureAtlasData.scale = scale === 1.0 ? (1.0 / ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0)) : scale; + textureAtlasData.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + textureAtlasData.imagePath = ObjectDataParser._getString(rawData, dragonBones.DataParser.IMAGE_PATH, ""); + if (dragonBones.DataParser.SUB_TEXTURE in rawData) { + var rawTextures = rawData[dragonBones.DataParser.SUB_TEXTURE]; + for (var i = 0, l = rawTextures.length; i < l; ++i) { + var rawTexture = rawTextures[i]; + var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0); + var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0); + var textureData = textureAtlasData.createTexture(); + textureData.rotated = ObjectDataParser._getBoolean(rawTexture, dragonBones.DataParser.ROTATED, false); + textureData.name = ObjectDataParser._getString(rawTexture, dragonBones.DataParser.NAME, ""); + textureData.region.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.X, 0.0); + textureData.region.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.Y, 0.0); + textureData.region.width = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.WIDTH, 0.0); + textureData.region.height = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.HEIGHT, 0.0); + if (frameWidth > 0.0 && frameHeight > 0.0) { + textureData.frame = dragonBones.TextureData.createRectangle(); + textureData.frame.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_X, 0.0); + textureData.frame.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_Y, 0.0); + textureData.frame.width = frameWidth; + textureData.frame.height = frameHeight; + } + textureAtlasData.addTexture(textureData); + } + } + return true; + }; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + ObjectDataParser.getInstance = function () { + if (ObjectDataParser._objectDataParserInstance === null) { + ObjectDataParser._objectDataParserInstance = new ObjectDataParser(); + } + return ObjectDataParser._objectDataParserInstance; + }; + ObjectDataParser._objectDataParserInstance = null; + return ObjectDataParser; + }(dragonBones.DataParser)); + dragonBones.ObjectDataParser = ObjectDataParser; + /** + * @private + */ + var ActionFrame = /** @class */ (function () { + function ActionFrame() { + this.frameStart = 0; + this.actions = []; + } + return ActionFrame; + }()); + dragonBones.ActionFrame = ActionFrame; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var BinaryDataParser = /** @class */ (function (_super) { + __extends(BinaryDataParser, _super); + function BinaryDataParser() { + return _super !== null && _super.apply(this, arguments) || this; + } + BinaryDataParser.prototype._inRange = function (a, min, max) { + return min <= a && a <= max; + }; + BinaryDataParser.prototype._decodeUTF8 = function (data) { + var EOF_byte = -1; + var EOF_code_point = -1; + var FATAL_POINT = 0xFFFD; + var pos = 0; + var result = ""; + var code_point; + var utf8_code_point = 0; + var utf8_bytes_needed = 0; + var utf8_bytes_seen = 0; + var utf8_lower_boundary = 0; + while (data.length > pos) { + var _byte = data[pos++]; + if (_byte === EOF_byte) { + if (utf8_bytes_needed !== 0) { + code_point = FATAL_POINT; + } + else { + code_point = EOF_code_point; + } + } + else { + if (utf8_bytes_needed === 0) { + if (this._inRange(_byte, 0x00, 0x7F)) { + code_point = _byte; + } + else { + if (this._inRange(_byte, 0xC2, 0xDF)) { + utf8_bytes_needed = 1; + utf8_lower_boundary = 0x80; + utf8_code_point = _byte - 0xC0; + } + else if (this._inRange(_byte, 0xE0, 0xEF)) { + utf8_bytes_needed = 2; + utf8_lower_boundary = 0x800; + utf8_code_point = _byte - 0xE0; + } + else if (this._inRange(_byte, 0xF0, 0xF4)) { + utf8_bytes_needed = 3; + utf8_lower_boundary = 0x10000; + utf8_code_point = _byte - 0xF0; + } + else { + } + utf8_code_point = utf8_code_point * Math.pow(64, utf8_bytes_needed); + code_point = null; + } + } + else if (!this._inRange(_byte, 0x80, 0xBF)) { + utf8_code_point = 0; + utf8_bytes_needed = 0; + utf8_bytes_seen = 0; + utf8_lower_boundary = 0; + pos--; + code_point = _byte; + } + else { + utf8_bytes_seen += 1; + utf8_code_point = utf8_code_point + (_byte - 0x80) * Math.pow(64, utf8_bytes_needed - utf8_bytes_seen); + if (utf8_bytes_seen !== utf8_bytes_needed) { + code_point = null; + } + else { + var cp = utf8_code_point; + var lower_boundary = utf8_lower_boundary; + utf8_code_point = 0; + utf8_bytes_needed = 0; + utf8_bytes_seen = 0; + utf8_lower_boundary = 0; + if (this._inRange(cp, lower_boundary, 0x10FFFF) && !this._inRange(cp, 0xD800, 0xDFFF)) { + code_point = cp; + } + else { + code_point = _byte; + } + } + } + } + //Decode string + if (code_point !== null && code_point !== EOF_code_point) { + if (code_point <= 0xFFFF) { + if (code_point > 0) + result += String.fromCharCode(code_point); + } + else { + code_point -= 0x10000; + result += String.fromCharCode(0xD800 + ((code_point >> 10) & 0x3ff)); + result += String.fromCharCode(0xDC00 + (code_point & 0x3ff)); + } + } + } + return result; + }; + BinaryDataParser.prototype._parseBinaryTimeline = function (type, offset, timelineData) { + if (timelineData === void 0) { timelineData = null; } + var timeline = timelineData !== null ? timelineData : dragonBones.BaseObject.borrowObject(dragonBones.TimelineData); + timeline.type = type; + timeline.offset = offset; + this._timeline = timeline; + var keyFrameCount = this._timelineArrayBuffer[timeline.offset + 2 /* TimelineKeyFrameCount */]; + if (keyFrameCount === 1) { + timeline.frameIndicesOffset = -1; + } + else { + var frameIndicesOffset = 0; + var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. + var frameIndices = this._data.frameIndices; + frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; + timeline.frameIndicesOffset = frameIndicesOffset; + for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) { + if (frameStart + frameCount <= i && iK < keyFrameCount) { + frameStart = this._frameArrayBuffer[this._animation.frameOffset + this._timelineArrayBuffer[timeline.offset + 5 /* TimelineFrameOffset */ + iK]]; + if (iK === keyFrameCount - 1) { + frameCount = this._animation.frameCount - frameStart; + } + else { + frameCount = this._frameArrayBuffer[this._animation.frameOffset + this._timelineArrayBuffer[timeline.offset + 5 /* TimelineFrameOffset */ + iK + 1]] - frameStart; + } + iK++; + } + frameIndices[frameIndicesOffset + i] = iK - 1; + } + } + this._timeline = null; // + return timeline; + }; + BinaryDataParser.prototype._parseAnimation = function (rawData) { + var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData); + animation.blendType = dragonBones.DataParser._getAnimationBlendType(dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, "")); + animation.frameCount = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0); + animation.playTimes = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1); + animation.duration = animation.frameCount / this._armature.frameRate; // float + animation.fadeInTime = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0); + animation.scale = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0); + animation.name = dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (animation.name.length === 0) { + animation.name = dragonBones.DataParser.DEFAULT_NAME; + } + // Offsets. + var offsets = rawData[dragonBones.DataParser.OFFSET]; + animation.frameIntOffset = offsets[0]; + animation.frameFloatOffset = offsets[1]; + animation.frameOffset = offsets[2]; + this._animation = animation; + if (dragonBones.DataParser.ACTION in rawData) { + animation.actionTimeline = this._parseBinaryTimeline(0 /* Action */, rawData[dragonBones.DataParser.ACTION]); + } + if (dragonBones.DataParser.Z_ORDER in rawData) { + animation.zOrderTimeline = this._parseBinaryTimeline(1 /* ZOrder */, rawData[dragonBones.DataParser.Z_ORDER]); + } + if (dragonBones.DataParser.BONE in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.BONE]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var bone = this._armature.getBone(k); + if (bone === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addBoneTimeline(bone.name, timeline); + } + } + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.SLOT]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var slot = this._armature.getSlot(k); + if (slot === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addSlotTimeline(slot.name, timeline); + } + } + } + if (dragonBones.DataParser.CONSTRAINT in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.CONSTRAINT]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var constraint = this._armature.getConstraint(k); + if (constraint === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addConstraintTimeline(constraint.name, timeline); + } + } + } + if (dragonBones.DataParser.TIMELINE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.TIMELINE]; + for (var _i = 0, rawTimelines_6 = rawTimelines; _i < rawTimelines_6.length; _i++) { + var rawTimeline = rawTimelines_6[_i]; + var timelineOffset = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.OFFSET, 0); + if (timelineOffset >= 0) { + var timelineType = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */); + var timelineName = dragonBones.ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var timeline = null; + if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData); + var animaitonTimeline = timeline; + animaitonTimeline.x = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0); + animaitonTimeline.y = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0); + } + timeline = this._parseBinaryTimeline(timelineType, timelineOffset, timeline); + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 1 /* ZOrder */: + // TODO + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 50 /* Surface */: + case 60 /* BoneAlpha */: + this._animation.addBoneTimeline(timelineName, timeline); + break; + case 20 /* SlotDisplay */: + case 21 /* SlotColor */: + case 22 /* SlotDeform */: + case 23 /* SlotZIndex */: + case 24 /* SlotAlpha */: + this._animation.addSlotTimeline(timelineName, timeline); + break; + case 30 /* IKConstraint */: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + case 42 /* AnimationParameter */: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null; + return animation; + }; + BinaryDataParser.prototype._parseGeometry = function (rawData, geometry) { + geometry.offset = rawData[dragonBones.DataParser.OFFSET]; + geometry.data = this._data; + var weightOffset = this._intArrayBuffer[geometry.offset + 3 /* GeometryWeightOffset */]; + if (weightOffset >= 0) { + var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData); + var vertexCount = this._intArrayBuffer[geometry.offset + 0 /* GeometryVertexCount */]; + var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */]; + weight.offset = weightOffset; + for (var i = 0; i < boneCount; ++i) { + var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i]; + weight.addBone(this._rawBones[boneIndex]); + } + var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount; + var weightCount = 0; + for (var i = 0, l = vertexCount; i < l; ++i) { + var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++]; + weightCount += vertexBoneCount; + boneIndicesOffset += vertexBoneCount; + } + weight.count = weightCount; + geometry.weight = weight; + } + }; + BinaryDataParser.prototype._parseArray = function (rawData) { + var offsets = rawData[dragonBones.DataParser.OFFSET]; + var l1 = offsets[1]; + var l2 = offsets[3]; + var l3 = offsets[5]; + var l4 = offsets[7]; + var l5 = offsets[9]; + var l6 = offsets[11]; + var l7 = offsets.length > 12 ? offsets[13] : 0; // Color. + var intArray = new Uint16Array(this._binary, this._binaryOffset + offsets[0], l1 / Uint16Array.BYTES_PER_ELEMENT); + var floatArray = new Float32Array(this._binary, this._binaryOffset + offsets[2], l2 / Float32Array.BYTES_PER_ELEMENT); + var frameIntArray = new Int16Array(this._binary, this._binaryOffset + offsets[4], l3 / Int16Array.BYTES_PER_ELEMENT); + var frameFloatArray = new Float32Array(this._binary, this._binaryOffset + offsets[6], l4 / Float32Array.BYTES_PER_ELEMENT); + var frameArray = new Int16Array(this._binary, this._binaryOffset + offsets[8], l5 / Int16Array.BYTES_PER_ELEMENT); + var timelineArray = new Uint16Array(this._binary, this._binaryOffset + offsets[10], l6 / Uint16Array.BYTES_PER_ELEMENT); + var colorArray = l7 > 0 ? new Uint16Array(this._binary, this._binaryOffset + offsets[12], l7 / Uint16Array.BYTES_PER_ELEMENT) : intArray; // Color. + this._data.binary = this._binary; + this._data.intArray = this._intArrayBuffer = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = this._frameArrayBuffer = frameArray; + this._data.timelineArray = this._timelineArrayBuffer = timelineArray; + this._data.colorArray = colorArray; + }; + BinaryDataParser.prototype.parseDragonBonesData = function (rawData, scale) { + if (scale === void 0) { scale = 1; } + console.assert(rawData !== null && rawData !== undefined && rawData instanceof ArrayBuffer, "Data error."); + var tag = new Uint8Array(rawData, 0, 8); + if (tag[0] !== "D".charCodeAt(0) || + tag[1] !== "B".charCodeAt(0) || + tag[2] !== "D".charCodeAt(0) || + tag[3] !== "T".charCodeAt(0)) { + console.assert(false, "Nonsupport data."); + return null; + } + var headerLength = new Uint32Array(rawData, 8, 1)[0]; + var headerBytes = new Uint8Array(rawData, 8 + 4, headerLength); + var headerString = this._decodeUTF8(headerBytes); + var header = JSON.parse(headerString); + // + this._binaryOffset = 8 + 4 + headerLength; + this._binary = rawData; + return _super.prototype.parseDragonBonesData.call(this, header, scale); + }; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + BinaryDataParser.getInstance = function () { + if (BinaryDataParser._binaryDataParserInstance === null) { + BinaryDataParser._binaryDataParserInstance = new BinaryDataParser(); + } + return BinaryDataParser._binaryDataParserInstance; + }; + BinaryDataParser._binaryDataParserInstance = null; + return BinaryDataParser; + }(dragonBones.ObjectDataParser)); + dragonBones.BinaryDataParser = BinaryDataParser; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) + * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. + * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) + * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 + * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + var BaseFactory = /** @class */ (function () { + /** + * - Create a factory instance. (typically only one global factory instance is required) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) + * @version DragonBones 3.0 + * @language zh_CN + */ + function BaseFactory(dataParser) { + if (dataParser === void 0) { dataParser = null; } + /** + * @private + */ + this.autoSearch = false; + this._dragonBonesDataMap = {}; + this._textureAtlasDataMap = {}; + this._dragonBones = null; + this._dataParser = null; + if (BaseFactory._objectParser === null) { + BaseFactory._objectParser = new dragonBones.ObjectDataParser(); + } + if (BaseFactory._binaryParser === null) { + BaseFactory._binaryParser = new dragonBones.BinaryDataParser(); + } + this._dataParser = dataParser !== null ? dataParser : BaseFactory._objectParser; + } + BaseFactory.prototype._isSupportMesh = function () { + return true; + }; + BaseFactory.prototype._getTextureData = function (textureAtlasName, textureName) { + if (textureAtlasName in this._textureAtlasDataMap) { + for (var _i = 0, _a = this._textureAtlasDataMap[textureAtlasName]; _i < _a.length; _i++) { + var textureAtlasData = _a[_i]; + var textureData = textureAtlasData.getTexture(textureName); + if (textureData !== null) { + return textureData; + } + } + } + if (this.autoSearch) { // Will be search all data, if the autoSearch is true. + for (var k in this._textureAtlasDataMap) { + for (var _b = 0, _c = this._textureAtlasDataMap[k]; _b < _c.length; _b++) { + var textureAtlasData = _c[_b]; + if (textureAtlasData.autoSearch) { + var textureData = textureAtlasData.getTexture(textureName); + if (textureData !== null) { + return textureData; + } + } + } + } + } + return null; + }; + BaseFactory.prototype._fillBuildArmaturePackage = function (dataPackage, dragonBonesName, armatureName, skinName, textureAtlasName) { + var dragonBonesData = null; + var armatureData = null; + if (dragonBonesName.length > 0) { + if (dragonBonesName in this._dragonBonesDataMap) { + dragonBonesData = this._dragonBonesDataMap[dragonBonesName]; + armatureData = dragonBonesData.getArmature(armatureName); + } + } + if (armatureData === null && (dragonBonesName.length === 0 || this.autoSearch)) { // Will be search all data, if do not give a data name or the autoSearch is true. + for (var k in this._dragonBonesDataMap) { + dragonBonesData = this._dragonBonesDataMap[k]; + if (dragonBonesName.length === 0 || dragonBonesData.autoSearch) { + armatureData = dragonBonesData.getArmature(armatureName); + if (armatureData !== null) { + dragonBonesName = k; + break; + } + } + } + } + if (armatureData !== null) { + dataPackage.dataName = dragonBonesName; + dataPackage.textureAtlasName = textureAtlasName; + dataPackage.data = dragonBonesData; + dataPackage.armature = armatureData; + dataPackage.skin = null; + if (skinName.length > 0) { + dataPackage.skin = armatureData.getSkin(skinName); + if (dataPackage.skin === null && this.autoSearch) { + for (var k in this._dragonBonesDataMap) { + var skinDragonBonesData = this._dragonBonesDataMap[k]; + var skinArmatureData = skinDragonBonesData.getArmature(skinName); + if (skinArmatureData !== null) { + dataPackage.skin = skinArmatureData.defaultSkin; + break; + } + } + } + } + if (dataPackage.skin === null) { + dataPackage.skin = armatureData.defaultSkin; + } + return true; + } + return false; + }; + BaseFactory.prototype._buildBones = function (dataPackage, armature) { + for (var _i = 0, _a = dataPackage.armature.sortedBones; _i < _a.length; _i++) { + var boneData = _a[_i]; + var bone = dragonBones.BaseObject.borrowObject(boneData.type === 0 /* Bone */ ? dragonBones.Bone : dragonBones.Surface); + bone.init(boneData, armature); + } + }; + /** + * @private + */ + BaseFactory.prototype._buildSlots = function (dataPackage, armature) { + var currentSkin = dataPackage.skin; + var defaultSkin = dataPackage.armature.defaultSkin; + if (currentSkin === null || defaultSkin === null) { + return; + } + var skinSlots = {}; + for (var k in defaultSkin.displays) { + var displays = defaultSkin.getDisplays(k); + skinSlots[k] = displays; + } + if (currentSkin !== defaultSkin) { + for (var k in currentSkin.displays) { + var displays = currentSkin.getDisplays(k); + skinSlots[k] = displays; + } + } + for (var _i = 0, _a = dataPackage.armature.sortedSlots; _i < _a.length; _i++) { + var slotData = _a[_i]; + var displayDatas = slotData.name in skinSlots ? skinSlots[slotData.name] : null; + var slot = this._buildSlot(dataPackage, slotData, armature); + if (displayDatas !== null) { + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); + if (displayData !== null) { + if (dataPackage.textureAtlasName.length > 0) { + var textureData = this._getTextureData(dataPackage.textureAtlasName, displayData.path); + slot.replaceTextureData(textureData, i); + } + var display = this._getSlotDisplay(dataPackage, displayData, slot); + slot.replaceDisplay(display, i); + } + else { + slot.replaceDisplay(null); + } + } + } + slot._setDisplayIndex(slotData.displayIndex, true); + } + }; + BaseFactory.prototype._buildConstraints = function (dataPackage, armature) { + var constraints = dataPackage.armature.constraints; + for (var k in constraints) { + var constraintData = constraints[k]; + // TODO more constraint type. + switch (constraintData.type) { + case 0 /* IK */: + var ikConstraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraint); + ikConstraint.init(constraintData, armature); + armature._addConstraint(ikConstraint); + break; + case 1 /* Path */: + var pathConstraint = dragonBones.BaseObject.borrowObject(dragonBones.PathConstraint); + pathConstraint.init(constraintData, armature); + armature._addConstraint(pathConstraint); + break; + default: + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraint); + constraint.init(constraintData, armature); + armature._addConstraint(constraint); + break; + } + } + }; + BaseFactory.prototype._buildChildArmature = function (dataPackage, _slot, displayData) { + return this.buildArmature(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage !== null ? dataPackage.textureAtlasName : ""); + }; + BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, slot) { + var dataName = dataPackage !== null ? dataPackage.dataName : displayData.parent.parent.parent.name; + var display = null; + switch (displayData.type) { + case 0 /* Image */: { + var imageDisplayData = displayData; + if (imageDisplayData.texture === null) { + imageDisplayData.texture = this._getTextureData(dataName, displayData.path); + } + display = slot.rawDisplay; + break; + } + case 2 /* Mesh */: { + var meshDisplayData = displayData; + if (meshDisplayData.texture === null) { + meshDisplayData.texture = this._getTextureData(dataName, meshDisplayData.path); + } + if (this._isSupportMesh()) { + display = slot.meshDisplay; + } + else { + display = slot.rawDisplay; + } + break; + } + case 1 /* Armature */: { + var armatureDisplayData = displayData; + var childArmature = this._buildChildArmature(dataPackage, slot, armatureDisplayData); + if (childArmature !== null) { + childArmature.inheritAnimation = armatureDisplayData.inheritAnimation; + if (!childArmature.inheritAnimation) { + var actions = armatureDisplayData.actions.length > 0 ? armatureDisplayData.actions : childArmature.armatureData.defaultActions; + if (actions.length > 0) { + for (var _i = 0, actions_6 = actions; _i < actions_6.length; _i++) { + var action = actions_6[_i]; + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + dragonBones.EventObject.actionDataToInstance(action, eventObject, slot.armature); + eventObject.slot = slot; + slot.armature._bufferAction(eventObject, false); + } + } + else { + childArmature.animation.play(); + } + } + armatureDisplayData.armature = childArmature.armatureData; // + } + display = childArmature; + break; + } + case 3 /* BoundingBox */: + break; + default: + break; + } + return display; + }; + /** + * - Parse the raw data to a DragonBonesData instance and cache it to the factory. + * @param rawData - The raw data. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for all armatures. (Default: 1.0) + * @returns DragonBonesData instance + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 + * @param rawData - 原始数据。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) + * @returns DragonBonesData 实例 + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.parseDragonBonesData = function (rawData, name, scale) { + if (name === void 0) { name = null; } + if (scale === void 0) { scale = 1.0; } + var dataParser = rawData instanceof ArrayBuffer ? BaseFactory._binaryParser : this._dataParser; + var dragonBonesData = dataParser.parseDragonBonesData(rawData, scale); + while (true) { + var textureAtlasData = this._buildTextureAtlasData(null, null); + if (dataParser.parseTextureAtlasData(null, textureAtlasData, scale)) { + this.addTextureAtlasData(textureAtlasData, name); + } + else { + textureAtlasData.returnToPool(); + break; + } + } + if (dragonBonesData !== null) { + this.addDragonBonesData(dragonBonesData, name); + } + return dragonBonesData; + }; + /** + * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. + * @param rawData - The raw texture atlas data. + * @param textureAtlas - The texture atlas object. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for the map set. (Default: 1.0) + * @returns TextureAtlasData instance + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 + * @param rawData - 原始贴图集数据。 + * @param textureAtlas - 贴图集对象。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) + * @returns TextureAtlasData 实例 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.parseTextureAtlasData = function (rawData, textureAtlas, name, scale) { + if (name === void 0) { name = null; } + if (scale === void 0) { scale = 1.0; } + var textureAtlasData = this._buildTextureAtlasData(null, null); + this._dataParser.parseTextureAtlasData(rawData, textureAtlasData, scale); + this._buildTextureAtlasData(textureAtlasData, textureAtlas || null); + this.addTextureAtlasData(textureAtlasData, name); + return textureAtlasData; + }; + /** + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN + */ + BaseFactory.prototype.updateTextureAtlases = function (textureAtlases, name) { + var textureAtlasDatas = this.getTextureAtlasData(name); + if (textureAtlasDatas !== null) { + for (var i = 0, l = textureAtlasDatas.length; i < l; ++i) { + if (i < textureAtlases.length) { + this._buildTextureAtlasData(textureAtlasDatas[i], textureAtlases[i]); + } + } + } + }; + /** + * - Get a specific DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @returns DragonBonesData instance + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 DragonBonesData 实例。 + * @param name - DragonBonesData 实例的缓存名称。 + * @returns DragonBonesData 实例 + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.getDragonBonesData = function (name) { + return (name in this._dragonBonesDataMap) ? this._dragonBonesDataMap[name] : null; + }; + /** + * - Cache a DragonBonesData instance to the factory. + * @param data - The DragonBonesData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 DragonBonesData 实例缓存到工厂中。 + * @param data - DragonBonesData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.addDragonBonesData = function (data, name) { + if (name === void 0) { name = null; } + name = name !== null ? name : data.name; + if (name in this._dragonBonesDataMap) { + if (this._dragonBonesDataMap[name] === data) { + return; + } + console.warn("Can not add same name data: " + name); + return; + } + this._dragonBonesDataMap[name] = data; + }; + /** + * - Remove a DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @param disposeData - Whether to dispose data. (Default: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 DragonBonesData 实例。 + * @param name - DragonBonesData 实例缓存名称。 + * @param disposeData - 是否释放数据。 (默认: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.removeDragonBonesData = function (name, disposeData) { + if (disposeData === void 0) { disposeData = true; } + if (name in this._dragonBonesDataMap) { + if (disposeData) { + this._dragonBones.bufferObject(this._dragonBonesDataMap[name]); + } + delete this._dragonBonesDataMap[name]; + } + }; + /** + * - Get a list of specific TextureAtlasData instances. + * @param name - The TextureAtlasData cahce name. + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 TextureAtlasData 实例列表。 + * @param name - TextureAtlasData 实例缓存名称。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.getTextureAtlasData = function (name) { + return (name in this._textureAtlasDataMap) ? this._textureAtlasDataMap[name] : null; + }; + /** + * - Cache a TextureAtlasData instance to the factory. + * @param data - The TextureAtlasData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 TextureAtlasData 实例缓存到工厂中。 + * @param data - TextureAtlasData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.addTextureAtlasData = function (data, name) { + if (name === void 0) { name = null; } + name = name !== null ? name : data.name; + var textureAtlasList = (name in this._textureAtlasDataMap) ? this._textureAtlasDataMap[name] : (this._textureAtlasDataMap[name] = []); + if (textureAtlasList.indexOf(data) < 0) { + textureAtlasList.push(data); + } + }; + /** + * - Remove a TextureAtlasData instance. + * @param name - The TextureAtlasData instance cache name. + * @param disposeData - Whether to dispose data. + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 TextureAtlasData 实例。 + * @param name - TextureAtlasData 实例的缓存名称。 + * @param disposeData - 是否释放数据。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.removeTextureAtlasData = function (name, disposeData) { + if (disposeData === void 0) { disposeData = true; } + if (name in this._textureAtlasDataMap) { + var textureAtlasDataList = this._textureAtlasDataMap[name]; + if (disposeData) { + for (var _i = 0, textureAtlasDataList_1 = textureAtlasDataList; _i < textureAtlasDataList_1.length; _i++) { + var textureAtlasData = textureAtlasDataList_1[_i]; + this._dragonBones.bufferObject(textureAtlasData); + } + } + delete this._textureAtlasDataMap[name]; + } + }; + /** + * - Get a specific armature data. + * @param name - The armature data name. + * @param dragonBonesName - The cached name for DragonbonesData instance. + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param name - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language zh_CN + */ + BaseFactory.prototype.getArmatureData = function (name, dragonBonesName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + var dataPackage = new BuildArmaturePackage(); + if (!this._fillBuildArmaturePackage(dataPackage, dragonBonesName, name, "", "")) { + return null; + } + return dataPackage.armature; + }; + /** + * - Clear all cached DragonBonesData instances and TextureAtlasData instances. + * @param disposeData - Whether to dispose data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 + * @param disposeData - 是否释放数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.clear = function (disposeData) { + if (disposeData === void 0) { disposeData = true; } + for (var k in this._dragonBonesDataMap) { + if (disposeData) { + this._dragonBones.bufferObject(this._dragonBonesDataMap[k]); + } + delete this._dragonBonesDataMap[k]; + } + for (var k in this._textureAtlasDataMap) { + if (disposeData) { + var textureAtlasDataList = this._textureAtlasDataMap[k]; + for (var _i = 0, textureAtlasDataList_2 = textureAtlasDataList; _i < textureAtlasDataList_2.length; _i++) { + var textureAtlasData = textureAtlasDataList_2[_i]; + this._dragonBones.bufferObject(textureAtlasData); + } + } + delete this._textureAtlasDataMap[k]; + } + }; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. + * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature. + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 + * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架。 + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.buildArmature = function (armatureName, dragonBonesName, skinName, textureAtlasName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + if (skinName === void 0) { skinName = ""; } + if (textureAtlasName === void 0) { textureAtlasName = ""; } + var dataPackage = new BuildArmaturePackage(); + if (!this._fillBuildArmaturePackage(dataPackage, dragonBonesName || "", armatureName, skinName || "", textureAtlasName || "")) { + console.warn("No armature data: " + armatureName + ", " + (dragonBonesName !== null ? dragonBonesName : "")); + return null; + } + var armature = this._buildArmature(dataPackage); + this._buildBones(dataPackage, armature); + this._buildSlots(dataPackage, armature); + this._buildConstraints(dataPackage, armature); + armature.invalidUpdate(null, true); + armature.advanceTime(0.0); // Update armature pose. + return armature; + }; + /** + * @private + */ + BaseFactory.prototype.replaceDisplay = function (slot, displayData, displayIndex) { + if (displayIndex === void 0) { displayIndex = -1; } + if (displayIndex < 0) { + displayIndex = slot.displayIndex; + } + if (displayIndex < 0) { + displayIndex = 0; + } + slot.replaceDisplayData(displayData, displayIndex); + if (displayData !== null) { + var display = this._getSlotDisplay(null, displayData, slot); + if (displayData.type === 0 /* Image */) { + var rawDisplayData = slot.getDisplayFrameAt(displayIndex).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.type === 2 /* Mesh */) { + display = slot.meshDisplay; + } + } + slot.replaceDisplay(display, displayIndex); + } + else { + slot.replaceDisplay(null, displayIndex); + } + }; + /** + * - Replaces the current display data for a particular slot with a specific display data. + * Specify display data with "dragonBonesName/armatureName/slotName/displayName". + * @param dragonBonesName - The DragonBonesData instance cache name. + * @param armatureName - The armature data name. + * @param slotName - The slot data name. + * @param displayName - The display data name. + * @param slot - The slot. + * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 + * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @param armatureName - 骨架数据名称。 + * @param slotName - 插槽数据名称。 + * @param displayName - 显示对象数据名称。 + * @param slot - 插槽。 + * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.replaceSlotDisplay = function (dragonBonesName, armatureName, slotName, displayName, slot, displayIndex) { + if (displayIndex === void 0) { displayIndex = -1; } + var armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); + if (armatureData === null || armatureData.defaultSkin === null) { + return false; + } + var displayData = armatureData.defaultSkin.getDisplay(slotName, displayName); + this.replaceDisplay(slot, displayData, displayIndex); + return true; + }; + /** + * @private + */ + BaseFactory.prototype.replaceSlotDisplayList = function (dragonBonesName, armatureName, slotName, slot) { + var armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); + if (!armatureData || !armatureData.defaultSkin) { + return false; + } + var displayDatas = armatureData.defaultSkin.getDisplays(slotName); + if (!displayDatas) { + return false; + } + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + this.replaceDisplay(slot, displayData, i); + } + return true; + }; + /** + * - Share specific skin data with specific armature. + * @param armature - The armature. + * @param skin - The skin data. + * @param isOverride - Whether it completely override the original skin. (Default: false) + * @param exclude - A list of slot names that do not need to be replace. + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 将特定的皮肤数据共享给特定的骨架使用。 + * @param armature - 骨架。 + * @param skin - 皮肤数据。 + * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) + * @param exclude - 不需要被替换的插槽名称列表。 + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language zh_CN + */ + BaseFactory.prototype.replaceSkin = function (armature, skin, isOverride, exclude) { + if (isOverride === void 0) { isOverride = false; } + if (exclude === void 0) { exclude = null; } + var success = false; + var defaultSkin = skin.parent.defaultSkin; + for (var _i = 0, _a = armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + if (exclude !== null && exclude.indexOf(slot.name) >= 0) { + continue; + } + var displayDatas = skin.getDisplays(slot.name); + if (displayDatas === null) { + if (defaultSkin !== null && skin !== defaultSkin) { + displayDatas = defaultSkin.getDisplays(slot.name); + } + if (displayDatas === null) { + if (isOverride) { + slot.displayFrameCount = 0; + } + continue; + } + } + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); + if (displayData !== null) { + slot.replaceDisplay(this._getSlotDisplay(null, displayData, slot), i); + } + else { + slot.replaceDisplay(null, i); + } + } + success = true; + } + return success; + }; + /** + * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. + * This enables you to make a armature template so that other armature without animations can share it's animations. + * @param armature - The armtaure. + * @param armatureData - The armature data. + * @param isOverride - Whether to completely overwrite the original animation. (Default: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 + * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 + * @param armature - 骨架。 + * @param armatureData - 骨架数据。 + * @param isOverride - 是否完全覆盖原来的动画。(默认: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language zh_CN + */ + BaseFactory.prototype.replaceAnimation = function (armature, armatureData, isOverride) { + if (isOverride === void 0) { isOverride = true; } + var skinData = armatureData.defaultSkin; + if (skinData === null) { + return false; + } + if (isOverride) { + armature.animation.animations = armatureData.animations; + } + else { + var rawAnimations = armature.animation.animations; + var animations = {}; + for (var k in rawAnimations) { + animations[k] = rawAnimations[k]; + } + for (var k in armatureData.animations) { + animations[k] = armatureData.animations[k]; + } + armature.animation.animations = animations; + } + for (var _i = 0, _a = armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + var index = 0; + for (var _b = 0, _c = slot.displayList; _b < _c.length; _b++) { + var display = _c[_b]; + if (display instanceof dragonBones.Armature) { + var displayDatas = skinData.getDisplays(slot.name); + if (displayDatas !== null && index < displayDatas.length) { + var displayData = displayDatas[index]; + if (displayData !== null && displayData.type === 1 /* Armature */) { + var childArmatureData = this.getArmatureData(displayData.path, displayData.parent.parent.parent.name); + if (childArmatureData) { + this.replaceAnimation(display, childArmatureData, isOverride); + } + } + } + } + index++; + } + } + return true; + }; + /** + * @private + */ + BaseFactory.prototype.getAllDragonBonesData = function () { + return this._dragonBonesDataMap; + }; + /** + * @private + */ + BaseFactory.prototype.getAllTextureAtlasData = function () { + return this._textureAtlasDataMap; + }; + Object.defineProperty(BaseFactory.prototype, "clock", { + /** + * - An Worldclock instance updated by engine. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 由引擎驱动的 WorldClock 实例。 + * @version DragonBones 5.7 + * @language zh_CN + */ + get: function () { + return this._dragonBones.clock; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseFactory.prototype, "dragonBones", { + /** + * @private + */ + get: function () { + return this._dragonBones; + }, + enumerable: true, + configurable: true + }); + BaseFactory._objectParser = null; + BaseFactory._binaryParser = null; + return BaseFactory; + }()); + dragonBones.BaseFactory = BaseFactory; + /** + * @private + */ + var BuildArmaturePackage = /** @class */ (function () { + function BuildArmaturePackage() { + this.dataName = ""; + this.textureAtlasName = ""; + this.skin = null; + } + return BuildArmaturePackage; + }()); + dragonBones.BuildArmaturePackage = BuildArmaturePackage; +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var util; + (function (util) { + var EventDispatcher = /** @class */ (function (_super) { + __extends(EventDispatcher, _super); + function EventDispatcher() { + return _super !== null && _super.apply(this, arguments) || this; + } + EventDispatcher.prototype.hasDBEventListener = function (type) { + return this.listenerCount(type) > 0; + }; + EventDispatcher.prototype.dispatchDBEvent = function (type, eventObject) { + this.emit(type, eventObject); + }; + EventDispatcher.prototype.addDBEventListener = function (type, listener, thisObject) { + this.on(type, listener, thisObject); + }; + EventDispatcher.prototype.removeDBEventListener = function (type, listener, thisObject) { + this.off(type, listener, thisObject); + }; + return EventDispatcher; + }(Phaser.Events.EventEmitter)); + util.EventDispatcher = EventDispatcher; + })(util = phaser.util || (phaser.util = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var util; + (function (util) { + util.Skew = { + getSkewX: function () { + return this._skewX || 0; + }, + setSkewX: function (v) { + this._skewX = v; + }, + getSkewY: function () { + return this._skewY || 0; + }, + setSkewY: function (v) { + this._skewY = v; + }, + setSkew: function (sx, sy) { + sy = sy === void 0 ? sx : sy; + this._skewX = sx; + this._skewY = sy; + } + }; + util.extendSkew = function (clazz) { + Object.defineProperty(clazz.prototype, "skewX", { + get: util.Skew.getSkewX, + set: util.Skew.setSkewX, + enumerable: true, + configurable: true + }); + Object.defineProperty(clazz.prototype, "skewY", { + get: util.Skew.getSkewY, + set: util.Skew.setSkewY, + enumerable: true, + configurable: true + }); + clazz.prototype.setSkew = util.Skew.setSkew; + }; + })(util = phaser.util || (phaser.util = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var util; + (function (util) { + var TransformMatrix = /** @class */ (function (_super) { + __extends(TransformMatrix, _super); + function TransformMatrix(a, b, c, d, tx, ty) { + var _this = _super.call(this, a, b, c, d, tx, ty) || this; + _this.decomposedMatrix.skewX = 0; + _this.decomposedMatrix.skewY = 0; + return _this; + } + TransformMatrix.prototype.decomposeMatrix = function () { + // sort out rotation / skew.. + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + var skewX = -Math.atan2(-c, d); + var skewY = Math.atan2(b, a); + var delta = Math.abs(skewX + skewY); + if (delta < 0.00001 || Math.abs(Phaser.Math.PI2 - delta) < 0.00001) { + this.decomposedMatrix.rotation = skewY; + if (a < 0 && d >= 0) + this.decomposedMatrix.rotation += (this.decomposedMatrix.rotation <= 0) ? Math.PI : -Math.PI; + this.decomposedMatrix.skewX = this.decomposedMatrix.skewY = 0; + } + else { + this.decomposedMatrix.rotation = 0; + this.decomposedMatrix.skewX = skewX; + this.decomposedMatrix.skewY = skewY; + } + // next set scale + this.decomposedMatrix.scaleX = Math.sqrt((a * a) + (b * b)); + this.decomposedMatrix.scaleY = Math.sqrt((c * c) + (d * d)); + // next set position + this.decomposedMatrix.translateX = this.tx; + this.decomposedMatrix.translateY = this.ty; + return this.decomposedMatrix; + }; + TransformMatrix.prototype.applyITRSC = function (x, y, rotation, scaleX, scaleY, skewX, skewY) { + this.a = Math.cos(rotation - skewY) * scaleX; + this.b = Math.sin(rotation - skewY) * scaleX; + this.c = -Math.sin(rotation + skewX) * scaleY; + this.d = Math.cos(rotation + skewX) * scaleY; + this.tx = x; + this.ty = y; + return this; + }; + Object.defineProperty(TransformMatrix.prototype, "skewX", { + get: function () { + return -Math.atan2(-this.c, this.d); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransformMatrix.prototype, "skewY", { + get: function () { + return Math.atan2(this.b, this.a); + }, + enumerable: true, + configurable: true + }); + return TransformMatrix; + }(Phaser.GameObjects.Components.TransformMatrix)); + util.TransformMatrix = TransformMatrix; + })(util = phaser.util || (phaser.util = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + // this class will be refactored due to official Container will be removed soon. + var DisplayContainer = /** @class */ (function (_super) { + __extends(DisplayContainer, _super); + function DisplayContainer(scene, x, y, children) { + var _this = _super.call(this, scene, x, y, children) || this; + _this._skewX = 0; + _this._skewY = 0; + _this.tempTransformMatrix = new phaser.util.TransformMatrix(); + return _this; + } + DisplayContainer.prototype.pointToContainer = function (source, output) { + if (output === undefined) + output = new Phaser.Math.Vector2(); + if (this.parentContainer) + return this.parentContainer.pointToContainer(source, output); + var tempMatrix = this.tempTransformMatrix; + // No need to loadIdentity because applyITRSC overwrites every value anyway + tempMatrix.applyITRSC(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this._skewX, this._skewY); + tempMatrix.invert(); + tempMatrix.transformPoint(source.x, source.y, output); + return output; + }; + Object.defineProperty(DisplayContainer.prototype, "skewX", { + get: function () { + return this._skewX; + }, + set: function (v) { + this._skewX = v; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DisplayContainer.prototype, "skewY", { + get: function () { + return this._skewY; + }, + set: function (v) { + this._skewY = v; + }, + enumerable: true, + configurable: true + }); + DisplayContainer.prototype.setSkew = function (sx, sy) { + sy = sy === void 0 ? sx : sy; + this.skewX = sx; + this.skewY = sy; + return this; + }; + return DisplayContainer; + }(Phaser.GameObjects.Container)); + display.DisplayContainer = DisplayContainer; + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + var ArmatureDisplay = /** @class */ (function (_super) { + __extends(ArmatureDisplay, _super); + function ArmatureDisplay(scene) { + var _this = _super.call(this, scene) || this; + _this.debugDraw = false; + return _this; + } + ArmatureDisplay.prototype.dbInit = function (armature) { + this._armature = armature; + }; + ArmatureDisplay.prototype.dbClear = function () { + this.removeAllListeners(); + if (this._armature) + this._armature.dispose(); + this._armature = null; + }; + ArmatureDisplay.prototype.dbUpdate = function () { + // TODO: draw debug graphics + if (this.debugDraw) { + } + }; + ArmatureDisplay.prototype.dispose = function (disposeProxy) { + this.dbClear(); + if (disposeProxy === true) + _super.prototype.destroy.call(this); + }; + ArmatureDisplay.prototype.destroy = function () { + this.dispose(true); + }; + ArmatureDisplay.prototype.dispatchDBEvent = function (type, eventObject) { + this.emit(type, eventObject); + }; + ArmatureDisplay.prototype.hasDBEventListener = function (type) { + return this.listenerCount(type) > 0; + }; + ArmatureDisplay.prototype.addDBEventListener = function (type, listener, scope) { + this.on(type, listener, scope); + }; + ArmatureDisplay.prototype.removeDBEventListener = function (type, listener, scope) { + this.off(type, listener, scope); + }; + Object.defineProperty(ArmatureDisplay.prototype, "armature", { + get: function () { + return this._armature; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArmatureDisplay.prototype, "animation", { + get: function () { + return this._armature.animation; + }, + enumerable: true, + configurable: true + }); + return ArmatureDisplay; + }(display.DisplayContainer)); + display.ArmatureDisplay = ArmatureDisplay; + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + var SlotImage = /** @class */ (function (_super) { + __extends(SlotImage, _super); + function SlotImage(scene, x, y, texture, frame) { + var _this = _super.call(this, scene, x, y, texture, frame) || this; + _this.setPipeline("PhaserTextureTintPipeline"); // use customized pipeline + return _this; + } + return SlotImage; + }(Phaser.GameObjects.Image)); + display.SlotImage = SlotImage; + phaser.util.extendSkew(SlotImage); // skew mixin + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + var SlotSprite = /** @class */ (function (_super) { + __extends(SlotSprite, _super); + function SlotSprite(scene, x, y, texture, frame) { + var _this = _super.call(this, scene, x, y, texture, frame) || this; + _this.setPipeline("PhaserTextureTintPipeline"); // use customized pipeline + return _this; + } + return SlotSprite; + }(Phaser.GameObjects.Sprite)); + display.SlotSprite = SlotSprite; + phaser.util.extendSkew(SlotSprite); // skew mixin + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + var Slot = /** @class */ (function (_super) { + __extends(Slot, _super); + function Slot() { + return _super !== null && _super.apply(this, arguments) || this; + } + Slot.toString = function () { + return "[class dragonBones.PhaserSlot]"; + }; + Slot.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._textureScale = 1.0; + if (this._renderDisplay) { + this._renderDisplay.destroy(); + this._renderDisplay = null; + } + }; + Slot.prototype._initDisplay = function (rawDisplay, isRetain) { + }; + Slot.prototype._disposeDisplay = function (prevDisplay, isRelease) { + // do nothing here, prevDisplay normally is an user customized GameObject set for this slot, so user need to destroy it manually. + }; + Slot.prototype._onUpdateDisplay = function () { + this._renderDisplay = this._display || this._rawDisplay; + }; + // Phaser will soone remove the functionality of nested container, so here we need to look for an alternative solution for display.add(childArmatureDisplay) + Slot.prototype._addDisplay = function () { + this.armature.display.add(this._renderDisplay); + }; + Slot.prototype._replaceDisplay = function (prevDisplay) { + if (!this._renderDisplay["setSkew"]) { + console.warn("please call dragonBones.phaser.util.extendSkew to mix skew component into your display object,\n and set its pipeline to 'PhaserTextureTintPipeline' by calling 'setPiepline' method, more detail please refer to the 'ReplaceSlotDisplay.ts' example"); + return; + } + this.armature.display.replace(prevDisplay, this._renderDisplay); + this._renderDisplay.parentContainer = this.armature.display; + }; + Slot.prototype._removeDisplay = function () { + // can't use this._armature.display.remove here, perphaps this._renderDisplay is a child of armature. + this._renderDisplay.parentContainer.remove(this._renderDisplay); + }; + Slot.prototype._updateZOrder = function () { + if (this._renderDisplay.depth === this._zOrder) + return; + this._renderDisplay.setDepth(this._zOrder); + }; + Slot.prototype._updateVisible = function () { + this._renderDisplay.setVisible(this._parent.visible && this._visible); + }; + Slot.prototype._updateBlendMode = function () { + var mode = Phaser.BlendModes.NORMAL; + switch (this._blendMode) { + case 0 /* Normal */: + mode = Phaser.BlendModes.NORMAL; + break; + case 1 /* Add */: + mode = Phaser.BlendModes.ADD; + break; + case 3 /* Darken */: + mode = Phaser.BlendModes.DARKEN; + break; + case 4 /* Difference */: + mode = Phaser.BlendModes.DIFFERENCE; + break; + case 6 /* HardLight */: + mode = Phaser.BlendModes.HARD_LIGHT; + break; + case 9 /* Lighten */: + mode = Phaser.BlendModes.LIGHTEN; + break; + case 10 /* Multiply */: + mode = Phaser.BlendModes.MULTIPLY; + break; + case 11 /* Overlay */: + mode = Phaser.BlendModes.OVERLAY; + break; + case 12 /* Screen */: + mode = Phaser.BlendModes.SCREEN; + break; + default: + break; + } + this._renderDisplay.setBlendMode(mode); + }; + Slot.prototype._updateColor = function () { + var c = this._colorTransform; + var a = this._globalAlpha * c.alphaMultiplier + c.alphaOffset; + this._renderDisplay.setAlpha(a); + if (this._renderDisplay instanceof display.DisplayContainer) + return; + var r = 0xff * c.redMultiplier + c.redOffset; + var g = 0xff * c.greenMultiplier + c.greenOffset; + var b = 0xff * c.blueMultiplier + c.blueOffset; + var rgb = (r << 16) | (g << 8) | b; + this._renderDisplay.setTint(rgb); + }; + Slot.prototype._updateFrame = function () { + if (this._renderDisplay instanceof display.DisplayContainer) + return; + var currentTextureData = this._textureData; + if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) { + var currentTextureAtlasData = currentTextureData.parent; + if (this.armature.replacedTexture !== null) { // Update replaced texture atlas. + if (this.armature._replaceTextureAtlasData === null) { + currentTextureAtlasData = dragonBones.BaseObject.borrowObject(display.TextureAtlasData); + currentTextureAtlasData.copyFrom(currentTextureData.parent); + currentTextureAtlasData.renderTexture = this.armature.replacedTexture; + this.armature._replaceTextureAtlasData = currentTextureAtlasData; + } + else + currentTextureAtlasData = this.armature._replaceTextureAtlasData; + currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name); + } + var frame = currentTextureData.renderTexture; + if (frame !== null) { + if (this._geometryData !== null) { // Mesh. + // ignored, Phaser currently does not support mesh.indices + } + else { // normal texture. + this._renderDisplay.texture = frame.texture; + this._renderDisplay.frame = frame; + this._renderDisplay.setDisplayOrigin(this._pivotX, this._pivotY); + this._textureScale = currentTextureData.parent.scale * this.armature.armatureData.scale; + this._renderDisplay.setScale(this._textureScale); + } + this._visibleDirty = true; + return; + } + } + else { + this._renderDisplay.x = 0.0; + this._renderDisplay.y = 0.0; + this._renderDisplay.setTexture(undefined); + } + }; + Slot.prototype._updateMesh = function () { + // ignored, Phaser currently does not support mesh.indices + }; + Slot.prototype._updateTransform = function () { + this.updateGlobalTransform(); + var transform = this.global; + this._renderDisplay.x = transform.x; // No need to calcuate pivot offset manually here as Phaser.GameObjects.GameObject takes that into account already. + this._renderDisplay.y = transform.y; + this._renderDisplay.rotation = transform.rotation; + this._renderDisplay["setSkew"](transform.skew, 0); + this._renderDisplay.setScale(transform.scaleX * this._textureScale, transform.scaleY * this._textureScale); + }; + Slot.prototype._identityTransform = function () { + this._renderDisplay.setPosition(); + this._renderDisplay.setRotation(); + this._textureScale = 1.0; + this._renderDisplay.setScale(this._textureScale); + this._renderDisplay["setSkew"](0); + }; + return Slot; + }(dragonBones.Slot)); + display.Slot = Slot; + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + var TextureAtlasData = /** @class */ (function (_super) { + __extends(TextureAtlasData, _super); + function TextureAtlasData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._renderTexture = null; + return _this; + } + TextureAtlasData.toString = function () { + return "[class dragonBones.PhaserTextureAtlasData]"; + }; + TextureAtlasData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this._renderTexture !== null) + this._renderTexture.destroy(); + this._renderTexture = null; + }; + TextureAtlasData.prototype.createTexture = function () { + return dragonBones.BaseObject.borrowObject(TextureData); + }; + Object.defineProperty(TextureAtlasData.prototype, "renderTexture", { + get: function () { + return this._renderTexture; + }, + // TODO: test set value runtime + set: function (value) { + if (!value || this._renderTexture === value) + return; + if (this._renderTexture) + this._renderTexture.destroy(); + this._renderTexture = value; + for (var k in this.textures) { + var data = this.textures[k]; + var frame = this._renderTexture.add(k, 0, // all textures were added through `textures.addImage`, so their sourceIndex are all 0 + data.region.x, data.region.y, data.region.width, data.region.height); + if (data.rotated) { + frame.rotated = true; + frame.updateUVsInverted(); + } + data.renderTexture = frame; + } + }, + enumerable: true, + configurable: true + }); + return TextureAtlasData; + }(dragonBones.TextureAtlasData)); + display.TextureAtlasData = TextureAtlasData; + var TextureData = /** @class */ (function (_super) { + __extends(TextureData, _super); + function TextureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.renderTexture = null; // Initial value. + return _this; + } + TextureData.toString = function () { + return "[class dragonBones.PhaserTextureData]"; + }; + TextureData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this.renderTexture !== null) + this.renderTexture.destroy(); + this.renderTexture = null; + }; + return TextureData; + }(dragonBones.TextureData)); + display.TextureData = TextureData; + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var pipeline; + (function (pipeline) { + var TextureTintPipeline = /** @class */ (function (_super) { + __extends(TextureTintPipeline, _super); + function TextureTintPipeline(config) { + var _this = _super.call(this, config) || this; + _this._tempMatrix1 = new phaser.util.TransformMatrix(); + _this._tempMatrix2 = new phaser.util.TransformMatrix(); + _this._tempMatrix3 = new phaser.util.TransformMatrix(); + return _this; + } + TextureTintPipeline.prototype.batchSprite = function (sprite, camera, parentTransformMatrix) { + this.renderer.setPipeline(this); + var camMatrix = this._tempMatrix1; + var spriteMatrix = this._tempMatrix2; + var calcMatrix = this._tempMatrix3; + var frame = sprite.frame; + var texture = frame.glTexture; + var u0 = frame.u0; + var v0 = frame.v0; + var u1 = frame.u1; + var v1 = frame.v1; + var frameX = frame.x; + var frameY = frame.y; + var frameWidth = frame.width; + var frameHeight = frame.height; + var x = -sprite.displayOriginX + frameX; + var y = -sprite.displayOriginY + frameY; + if (sprite.isCropped) { + var crop = sprite["_crop"]; + if (crop.flipX !== sprite.flipX || crop.flipY !== sprite.flipY) + frame.updateCropUVs(crop, sprite.flipX, sprite.flipY); + u0 = crop.u0; + v0 = crop.v0; + u1 = crop.u1; + v1 = crop.v1; + frameWidth = crop.width; + frameHeight = crop.height; + frameX = crop.x; + frameY = crop.y; + x = -sprite.displayOriginX + frameX; + y = -sprite.displayOriginY + frameY; + } + if (sprite.flipX) { + x += frameWidth; + frameWidth *= -1; + } + if (sprite.flipY) { + y += frameHeight; + frameHeight *= -1; + } + var xw = x + frameWidth; + var yh = y + frameHeight; + spriteMatrix.applyITRSC(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY, sprite["skewX"] || 0, sprite["skewY"] || 0); + camMatrix.copyFrom(camera["matrix"]); + if (parentTransformMatrix) { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * sprite.scrollFactorX, -camera.scrollY * sprite.scrollFactorY); + // Undo the camera scroll + spriteMatrix.e = sprite.x; + spriteMatrix.f = sprite.y; + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else { + spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX; + spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY; + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + var tintTL = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintTL"], camera.alpha * sprite["_alphaTL"]); + var tintTR = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintTR"], camera.alpha * sprite["_alphaTR"]); + var tintBL = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintBL"], camera.alpha * sprite["_alphaBL"]); + var tintBR = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintBR"], camera.alpha * sprite["_alphaBR"]); + if (camera.roundPixels) { + tx0 |= 0; + ty0 |= 0; + tx1 |= 0; + ty1 |= 0; + tx2 |= 0; + ty2 |= 0; + tx3 |= 0; + ty3 |= 0; + } + this.setTexture2D(texture, 0); + var tintEffect = (sprite["_isTinted"] && sprite.tintFill); + this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); + }; + return TextureTintPipeline; + }(Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline)); + pipeline.TextureTintPipeline = TextureTintPipeline; + })(pipeline = phaser.pipeline || (phaser.pipeline = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var plugin; + (function (plugin) { + plugin.FileTypes = { + IMAGE: "imageFile", + JSON: "jsonFile", + BINARY: "binaryFile", + map: { + imageFile: Phaser.Loader.FileTypes.ImageFile, + jsonFile: Phaser.Loader.FileTypes.JSONFile, + binaryFile: Phaser.Loader.FileTypes.BinaryFile + }, + setType: function (type, clazz) { + plugin.FileTypes.map[type] = clazz; + }, + getType: function (type) { + return plugin.FileTypes.map[type]; + } + }; + })(plugin = phaser.plugin || (phaser.plugin = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var plugin; + (function (plugin) { + var DragonBonesFile = /** @class */ (function (_super) { + __extends(DragonBonesFile, _super); + function DragonBonesFile(loader, key, textureURL, atlasURL, boneURL, textureXhrSettings, atlasXhrSettings, boneXhrSettings) { + var _this = this; + var image; + var data; + var boneData; + var keyName; + var binFileType = plugin.FileTypes.getType(plugin.FileTypes.BINARY); + var jsonFileType = plugin.FileTypes.getType(plugin.FileTypes.JSON); + var imageFileType = plugin.FileTypes.getType(plugin.FileTypes.IMAGE); + var createBoneFileByType = function (loader, key, boneURL, boneXhrSettings) { + var type = "json"; + if (boneXhrSettings && boneXhrSettings.responseType) { + switch (boneXhrSettings.responseType) { + case "arraybuffer": + case "blob": + type = "bin"; + break; + case "json": + case "text": + type = "json"; + break; + } + } + return type === "bin" ? + new binFileType(loader, key, boneURL, boneXhrSettings) : + new jsonFileType(loader, key, boneURL, boneXhrSettings); + }; + if (Phaser.Utils.Objects.IsPlainObject(key)) { + // key is actually a config object + var config = key; + keyName = Phaser.Utils.Objects.GetFastValue(config, 'key'); + image = new imageFileType(loader, { + key: keyName, + url: Phaser.Utils.Objects.GetFastValue(config, 'textureURL'), + extension: Phaser.Utils.Objects.GetFastValue(config, 'textureExtension', 'png'), + xhrSettings: Phaser.Utils.Objects.GetFastValue(config, 'textureXhrSettings') + }); + data = new jsonFileType(loader, { + key: keyName + "_atlasjson", + url: Phaser.Utils.Objects.GetFastValue(config, 'atlasURL'), + extension: Phaser.Utils.Objects.GetFastValue(config, 'atlasExtension', 'json'), + xhrSettings: Phaser.Utils.Objects.GetFastValue(config, 'atlasXhrSettings') + }); + boneData = createBoneFileByType(loader, keyName, Phaser.Utils.Objects.GetFastValue(config, 'boneURL'), Phaser.Utils.Objects.GetFastValue(config, 'boneXhrSettings')); + } + else { + keyName = key; + image = new imageFileType(loader, keyName, textureURL, textureXhrSettings); + data = new jsonFileType(loader, keyName + "_atlasjson", atlasURL, atlasXhrSettings); + boneData = createBoneFileByType(loader, keyName, boneURL, boneXhrSettings); + } + boneData.cache = loader["cacheManager"].custom.dragonbone; + _this = _super.call(this, loader, 'dragonbone', keyName, [image, data, boneData]) || this; + return _this; + } + DragonBonesFile.prototype.addToCache = function () { + if (this.isReadyToProcess()) { + var image = this.files[0]; + var json = this.files[1]; + var bone = this.files[2]; + json.addToCache(); + bone.addToCache(); + image.addToCache(); + this.complete = true; + } + }; + return DragonBonesFile; + }(Phaser.Loader.MultiFile)); + plugin.DragonBonesFile = DragonBonesFile; + })(plugin = phaser.plugin || (phaser.plugin = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones_2) { + var phaser; + (function (phaser) { + var plugin; + (function (plugin) { + var DragonBonesScenePlugin = /** @class */ (function (_super) { + __extends(DragonBonesScenePlugin, _super); + function DragonBonesScenePlugin(scene, pluginManager) { + var _this = _super.call(this, scene, pluginManager) || this; + var game = _this.game; + // bone data store + game.cache.addCustom("dragonbone"); + if (_this.game.config.renderType === Phaser.WEBGL) { + var renderer = _this.game.renderer; + if (!renderer.hasPipeline('PhaserTextureTintPipeline')) + renderer.addPipeline('PhaserTextureTintPipeline', new phaser.pipeline.TextureTintPipeline({ game: game, renderer: renderer })); + } + // Add dragonBones only + pluginManager.registerGameObject("dragonBones", CreateDragonBonesRegisterHandler); + // Add armature, this will add dragonBones when not exist + pluginManager.registerGameObject("armature", CreateArmatureRegisterHandler); + pluginManager.registerFileType("dragonbone", DragonBoneFileRegisterHandler, scene); + return _this; + } + DragonBonesScenePlugin.prototype.createArmature = function (armature, dragonBones, skinName, atlasTextureName, textureScale) { + if (textureScale === void 0) { textureScale = 1.0; } + var display = this.factory.buildArmatureDisplay(armature, dragonBones, skinName, atlasTextureName, textureScale); + this.systems.displayList.add(display); + // use db.clock instead, if here we just use this.systems.updateList.add(display), that will cause the db event is dispatched with 1 or more frames delay + this._dbInst.clock.add(display.armature); + return display; + }; + DragonBonesScenePlugin.prototype.createDragonBones = function (dragonBonesName, textureScale) { + if (textureScale === void 0) { textureScale = 1.0; } + return this.factory.buildDragonBonesData(dragonBonesName, textureScale); + }; + Object.defineProperty(DragonBonesScenePlugin.prototype, "factory", { + get: function () { + if (!this._factory) { + this._dbInst = new dragonBones.DragonBones(new phaser.util.EventDispatcher()); + this._factory = new phaser.Factory(this._dbInst, this.scene); + } + return this._factory; + }, + enumerable: true, + configurable: true + }); + /* + * Slot has a default display, usually it is a transparent image, here you could create a display whatever you want as the default one which - + * has both skewX / skewY attributes and use "PhaserTextureTintPipeline" to render itself, or simply just use SlotImage or SlotSprite. + */ + DragonBonesScenePlugin.prototype.createSlotDisplayPlaceholder = function () { + return new phaser.display.SlotImage(this.scene, 0, 0); + }; + DragonBonesScenePlugin.prototype.boot = function () { + this.systems.events.once('destroy', this.destroy, this); + this.start(); + }; + DragonBonesScenePlugin.prototype.start = function () { + var ee = this.systems.events; + ee.on('update', this.update, this); + ee.once('shutdown', this.shutdown, this); + }; + DragonBonesScenePlugin.prototype.update = function (time, delta) { + this._dbInst && this._dbInst.advanceTime(delta * 0.001); + }; + DragonBonesScenePlugin.prototype.shutdown = function () { + var ee = this.systems.events; + ee.off('update', this.update, this); + ee.off('shutdown', this.shutdown, this); + }; + DragonBonesScenePlugin.prototype.destroy = function () { + this.shutdown(); + this._factory = + this._dbInst = null; + this.pluginManager = + this.game = + this.scene = + this.systems = null; + }; + return DragonBonesScenePlugin; + }(Phaser.Plugins.ScenePlugin)); + plugin.DragonBonesScenePlugin = DragonBonesScenePlugin; + var CreateDragonBonesRegisterHandler = function (dragonBonesName, textureScale) { + if (textureScale === void 0) { textureScale = 1.0; } + return this.scene.dragonbone.createDragonBones(dragonBonesName, textureScale); + }; + var CreateArmatureRegisterHandler = function (armature, dragonBones, skinName, atlasTextureName) { + return this.scene.dragonbone.createArmature(armature, dragonBones, skinName, atlasTextureName); + }; + var DragonBoneFileRegisterHandler = function (dragonbonesName, textureURL, atlasURL, boneURL, textureXhrSettings, atlasXhrSettings, boneXhrSettings) { + var multifile = new plugin.DragonBonesFile(this, dragonbonesName, textureURL, atlasURL, boneURL, textureXhrSettings, atlasXhrSettings, boneXhrSettings); + this.addFile(multifile.files); + return this; + }; + })(plugin = phaser.plugin || (phaser.plugin = {})); + })(phaser = dragonBones_2.phaser || (dragonBones_2.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones_3) { + var phaser; + (function (phaser) { + var Factory = /** @class */ (function (_super) { + __extends(Factory, _super); + function Factory(dragonBones, scene, dataParser) { + var _this = _super.call(this, dataParser) || this; + _this._scene = scene; + _this._dragonBones = dragonBones; + return _this; + } + Factory.prototype._isSupportMesh = function () { + console.warn("Mesh is not supported yet"); + return false; + }; + Factory.prototype._buildTextureAtlasData = function (textureAtlasData, textureAtlas) { + if (textureAtlasData) { + textureAtlasData.renderTexture = textureAtlas; + } + else + textureAtlasData = dragonBones_3.BaseObject.borrowObject(phaser.display.TextureAtlasData); + return textureAtlasData; + }; + Factory.prototype._buildArmature = function (dataPackage) { + var armature = dragonBones_3.BaseObject.borrowObject(dragonBones_3.Armature); + var armatureDisplay = new phaser.display.ArmatureDisplay(this._scene); + armature.init(dataPackage.armature, armatureDisplay, armatureDisplay, this._dragonBones); + return armature; + }; + Factory.prototype._buildSlot = function (dataPackage, slotData, armature) { + var slot = dragonBones_3.BaseObject.borrowObject(phaser.display.Slot); + var rawDisplay = this._scene.dragonbone.createSlotDisplayPlaceholder(); + var meshDisplay = rawDisplay; // TODO: meshDisplay is not supported yet + slot.init(slotData, armature, rawDisplay, meshDisplay); + return slot; + }; + // dragonBonesName must be assigned, or can't find in cache inside + Factory.prototype.buildArmatureDisplay = function (armatureName, dragonBonesName, skinName, textureAtlasName, textureScale) { + if (skinName === void 0) { skinName = ""; } + if (textureAtlasName === void 0) { textureAtlasName = ""; } + if (textureScale === void 0) { textureScale = 1.0; } + var armature; + if (this.buildDragonBonesData(dragonBonesName, textureScale)) { + armature = this.buildArmature(armatureName, dragonBonesName, skinName, textureAtlasName); + } + return armature.display; + }; + Factory.prototype.buildDragonBonesData = function (dragonBonesName, textureScale) { + if (textureScale === void 0) { textureScale = 1.0; } + var data = this._dragonBonesDataMap[dragonBonesName]; + if (!data) { + var cache = this._scene.cache; + var boneRawData = cache.custom.dragonbone.get(dragonBonesName); + if (boneRawData) { + // parse raw data and add to cache map + data = this.parseDragonBonesData(boneRawData, dragonBonesName, textureScale); + var texture = this._scene.textures.get(dragonBonesName); + var json = cache.json.get(dragonBonesName + "_atlasjson"); + this.parseTextureAtlasData(json, texture, texture.key, textureScale); + } + } + return data; + }; + return Factory; + }(dragonBones_3.BaseFactory)); + phaser.Factory = Factory; + })(phaser = dragonBones_3.phaser || (dragonBones_3.phaser = {})); +})(dragonBones || (dragonBones = {})); diff --git a/Phaser/3.x/out/dragonBones.min.js b/Phaser/3.x/out/dragonBones.min.js new file mode 100644 index 00000000..0949ed4e --- /dev/null +++ b/Phaser/3.x/out/dragonBones.min.js @@ -0,0 +1 @@ +"use strict";var __extends=this&&this.__extends||function(){var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(t,e){r(t,e);function a(){this.constructor=t}t.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}();var dragonBones;(function(o){var t=function(){function e(t){this._clock=new o.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=t;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(t){if(this._objects.length>0){for(var e=0,a=this._objects;e0){for(var i=0;ie){r.length=e}n._maxCountMap[a]=e}else{n._defaultMaxCount=e;for(var a in n._poolsMap){var r=n._poolsMap[a];if(r.length>e){r.length=e}if(a in n._maxCountMap){n._maxCountMap[a]=e}}}};n.clearPool=function(t){if(t===void 0){t=null}if(t!==null){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){a.length=0}}else{for(var r in n._poolsMap){var a=n._poolsMap[r];a.length=0}}};n.borrowObject=function(t){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){var r=a.pop();r._isInPool=false;return r}var i=new t;i._onClear();return i};n.prototype.returnToPool=function(){this._onClear();n._returnObject(this)};n._hashCode=0;n._defaultMaxCount=3e3;n._maxCountMap={};n._poolsMap={};return n}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var u=l+t.width;var f=h+t.height;var _=a*l+i*h+s;var p=r*l+n*h+o;var c=a*u+i*h+s;var m=r*u+n*h+o;var d=a*u+i*f+s;var y=r*u+n*f+o;var v=a*l+i*f+s;var g=r*l+n*f+o;var D=0;if(_>c){D=_;_=c;c=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_v?c:v)-t.x);if(p>m){D=p;p=m;m=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(pg?m:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function n(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}n.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};n.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};n.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};n.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};n.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};n.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};n.prototype.fromMatrix=function(t){var e=this.scaleX,a=this.scaleY;var r=n.PI_Q;this.x=t.tx;this.y=t.ty;this.rotation=Math.atan(t.b/t.a);var i=Math.atan(-t.c/t.d);this.scaleX=this.rotation>-r&&this.rotation-r&&i=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(a>=0&&this.scaleY<0){this.scaleY=-this.scaleY;i=i-Math.PI}this.skew=i-this.rotation;return this};n.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};n.PI=Math.PI;n.PI_D=Math.PI*2;n.PI_H=Math.PI/2;n.PI_Q=Math.PI/4;n.RAD_DEG=180/Math.PI;n.DEG_RAD=Math.PI/180;return n}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.ints=[];t.floats=[];t.strings=[];return t}t.toString=function(){return"[class dragonBones.UserData]"};t.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};t.prototype.addInt=function(t){this.ints.push(t)};t.prototype.addFloat=function(t){this.floats.push(t)};t.prototype.addString=function(t){this.strings.push(t)};t.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};t.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};t.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};t.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};t.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};t.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};t.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};t.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};t.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};t.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};t.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};t.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};t.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};t.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};t.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};t.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return t}(a.BaseObject);a.ArmatureData=t;var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.transform=new a.Transform;t.userData=null;return t}t.toString=function(){return"[class dragonBones.BoneData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return t}(a.BaseObject);a.BoneData=e;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.geometry=new a.GeometryData;return t}t.toString=function(){return"[class dragonBones.SurfaceData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return t}(e);a.SurfaceData=r;var i=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}t.createColor=function(){return new a.ColorTransform};t.toString=function(){return"[class dragonBones.SlotData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.zIndex=0;this.alpha=1;this.name="";this.color=null;this.userData=null;this.parent=null};t.DEFAULT_COLOR=new a.ColorTransform;return t}(a.BaseObject);a.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.order=0;this.name="";this.type=0;this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.scaleEnabled=false;this.bendPositive=false;this.weight=1};return e}(e);t.IKConstraintData=a;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.bones=[];return t}t.toString=function(){return"[class dragonBones.PathConstraintData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.pathSlot=null;this.pathDisplayData=null;this.bones.length=0;this.positionMode=0;this.spacingMode=1;this.rotateMode=1;this.position=0;this.spacing=0;this.rotateOffset=0;this.rotateMix=0;this.translateMix=0};t.prototype.AddBone=function(t){this.bones.push(t)};return t}(e);t.PathConstraintData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.displays={};return t}t.toString=function(){return"[class dragonBones.SkinData]"};t.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};D.rectangleIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=t>i&&tn&&ei&&an&&r=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};D.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=this.width*.5;var l=this.height*.5;var h=D.rectangleIntersectsSegment(t,e,a,r,-o,-l,o,l,i,n,s);return h};return D}(e);t.RectangleBoundingBoxData=h;var a=function(t){__extends(l,t);function l(){return t!==null&&t.apply(this,arguments)||this}l.toString=function(){return"[class dragonBones.EllipseData]"};l.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=s/o;var _=f*f;e*=f;r*=f;var p=a-t;var c=r-e;var m=Math.sqrt(p*p+c*c);var d=p/m;var y=c/m;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var T=s*s;var b=T-D+g;var A=0;if(b>=0){var P=Math.sqrt(b);var S=v-P;var O=v+P;var x=S<0?-1:S<=m?0:1;var B=O<0?-1:O<=m?0:1;var M=x*B;if(M<0){return-1}else if(M===0){if(x===-1){A=2;a=t+O*d;r=(e+O*y)/f;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,a/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*y)/f;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.x=Math.atan2(e/T*_,t/T);u.y=u.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+O*d;h.y=(e+O*y)/f;if(u!==null){u.y=Math.atan2(h.y/T*_,h.x/T)}}}}}return A};l.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};l.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};l.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=l.ellipseIntersectsSegment(t,e,a,r,0,0,this.width*.5,this.height*.5,i,n,s);return o};return l}(e);t.EllipseBoundingBoxData=a;var r=function(e){__extends(l,e);function l(){var t=e!==null&&e.apply(this,arguments)||this;t.vertices=[];return t}l.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};l.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var u=e-r;var f=t*r-e*a;var _=0;var p=i[l-2];var c=i[l-1];var m=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var T=0;T=p&&B<=b||B>=b&&B<=p)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var M=(f*S-u*O)/x;if((M>=c&&M<=A||M>=A&&M<=c)&&(u===0||M>=e&&M<=r||M>=r&&M<=e)){if(s!==null){var E=B-t;if(E<0){E=-E}if(_===0){m=E;d=E;y=B;v=M;g=B;D=M;if(o!==null){o.x=Math.atan2(A-c,b-p)-Math.PI*.5;o.y=o.x}}else{if(Ed){d=E;g=B;D=M;if(o!==null){o.y=Math.atan2(A-c,b-p)-Math.PI*.5}}}_++}else{y=B;v=M;g=B;D=M;_++;if(o!==null){o.x=Math.atan2(A-c,b-p)-Math.PI*.5;o.y=o.x}break}}}p=b;c=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};l.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};l.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;ae._zIndex*1e3+e._zOrder?1:-1};y.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};y.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};y.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};y.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};y.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};y.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};y.prototype.init=function(t,e,a,r){if(this._armatureData!==null){return}this._armatureData=t;this._animation=i.BaseObject.borrowObject(i.Animation);this._proxy=e;this._display=a;this._dragonBones=r;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};y.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty||this._zIndexDirty){this._slots.sort(y._onSortSlots);if(this._zIndexDirty){for(var a=0,r=this._slots.length;a0){for(var u=0,f=this._actions;u0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var b=o?i.y-e:i.x-t;if(b<0){b=-b}if(d===null||bh){h=b;_=n.x;p=n.y;y=D;if(s!==null){m=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=u;i.y=f;if(s!==null){s.x=c}}if(y!==null&&n!==null){n.x=_;n.y=p;if(s!==null){s.y=m}}return d};y.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};t.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};t.prototype.invalidUpdate=function(){this._transformDirty=true};t.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(t.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=a){return this.globalTransformMatrix}i=e>this._kX*(t+a)+m;p=((s*o+s+o+o+_)*2+(i?1:0))*7;if(d[p]>0){y.copyFromArray(d,p+1)}else{var v=_*(l+2);var g=this._hullCache[4];var D=this._hullCache[5];var T=this._hullCache[2]-(o-_)*g;var b=this._hullCache[3]-(o-_)*D;var A=this._vertices;if(i){this._getAffineTransform(-a,m+u,r-a,u,A[v+l+2],A[v+l+3],T+g,b+D,A[v],A[v+1],P._helpTransform,y,true)}else{this._getAffineTransform(-r,m,r-a,u,T,b,A[v],A[v+1],T+g,b+D,P._helpTransform,y,false)}d[p]=1;d[p+1]=y.a;d[p+2]=y.b;d[p+3]=y.c;d[p+4]=y.d;d[p+5]=y.tx;d[p+6]=y.ty}}else if(t>=a){if(e<-a||e>=a){return this.globalTransformMatrix}i=e>this._kX*(t-r)+m;p=((s*o+s+_)*2+(i?1:0))*7;if(d[p]>0){y.copyFromArray(d,p+1)}else{var v=(_+1)*(l+2)-2;var g=this._hullCache[4];var D=this._hullCache[5];var T=this._hullCache[0]+_*g;var b=this._hullCache[1]+_*D;var A=this._vertices;if(i){this._getAffineTransform(r,m+u,r-a,u,T+g,b+D,A[v+l+2],A[v+l+3],T,b,P._helpTransform,y,true)}else{this._getAffineTransform(a,m,r-a,u,A[v],A[v+1],T,b,A[v+l+2],A[v+l+3],P._helpTransform,y,false)}d[p]=1;d[p+1]=y.a;d[p+2]=y.b;d[p+3]=y.c;d[p+4]=y.d;d[p+5]=y.tx;d[p+6]=y.ty}}else if(e<-a){if(t<-a||t>=a){return this.globalTransformMatrix}i=e>this._kY*(t-c-h)-r;p=((s*o+f)*2+(i?1:0))*7;if(d[p]>0){y.copyFromArray(d,p+1)}else{var v=f*2;var g=this._hullCache[10];var D=this._hullCache[11];var T=this._hullCache[8]+f*g;var b=this._hullCache[9]+f*D;var A=this._vertices;if(i){this._getAffineTransform(c+h,-a,h,r-a,A[v+2],A[v+3],A[v],A[v+1],T+g,b+D,P._helpTransform,y,true)}else{this._getAffineTransform(c,-r,h,r-a,T,b,T+g,b+D,A[v],A[v+1],P._helpTransform,y,false)}d[p]=1;d[p+1]=y.a;d[p+2]=y.b;d[p+3]=y.c;d[p+4]=y.d;d[p+5]=y.tx;d[p+6]=y.ty}}else if(e>=a){if(t<-a||t>=a){return this.globalTransformMatrix}i=e>this._kY*(t-c-h)+a;p=((s*o+s+o+f)*2+(i?1:0))*7;if(d[p]>0){y.copyFromArray(d,p+1)}else{var v=o*(l+2)+f*2;var g=this._hullCache[10];var D=this._hullCache[11];var T=this._hullCache[6]-(s-f)*g;var b=this._hullCache[7]-(s-f)*D;var A=this._vertices;if(i){this._getAffineTransform(c+h,r,h,r-a,T+g,b+D,T,b,A[v+2],A[v+3],P._helpTransform,y,true)}else{this._getAffineTransform(c,a,h,r-a,A[v],A[v+1],A[v+2],A[v+3],T,b,P._helpTransform,y,false)}d[p]=1;d[p+1]=y.a;d[p+2]=y.b;d[p+3]=y.c;d[p+4]=y.d;d[p+5]=y.tx;d[p+6]=y.ty}}else{i=e>this._k*(t-c-h)+m;p=((s*_+f)*2+(i?1:0))*7;if(d[p]>0){y.copyFromArray(d,p+1)}else{var v=f*2+_*(l+2);var A=this._vertices;if(i){this._getAffineTransform(c+h,m+u,h,u,A[v+l+4],A[v+l+5],A[v+l+2],A[v+l+3],A[v+2],A[v+3],P._helpTransform,y,true)}else{this._getAffineTransform(c,m,h,u,A[v],A[v+1],A[v+2],A[v+3],A[v+l+2],A[v+l+3],P._helpTransform,y,false)}d[p]=1;d[p+1]=y.a;d[p+2]=y.b;d[p+3]=y.c;d[p+4]=y.d;d[p+5]=y.tx;d[p+6]=y.ty}}return y};P.prototype.init=function(t,e){if(this._boneData!==null){return}l.prototype.init.call(this,t,e);var a=t.segmentX;var r=t.segmentY;var i=this._armature.armatureData.parent.intArray[t.geometry.offset+0];var n=1e3;var s=200;this._dX=s*2/a;this._dY=s*2/r;this._k=-this._dY/this._dX;this._kX=-this._dY/(n-s);this._kY=-(n-s)/this._dX;this._vertices.length=i*2;this._deformVertices.length=i*2;this._matrixCahce.length=(a*r+a*2+r*2)*2*7;this._hullCache.length=10;for(var o=0;o=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(h)}if(h&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var u=1e3;var f=200;var _=2*this.global.x;var p=2*this.global.y;var c=P._helpPoint;this.globalTransformMatrix.transformPoint(u,-f,c);this._hullCache[0]=c.x;this._hullCache[1]=c.y;this._hullCache[2]=_-c.x;this._hullCache[3]=p-c.y;this.globalTransformMatrix.transformPoint(0,this._dY,c,true);this._hullCache[4]=c.x;this._hullCache[5]=c.y;this.globalTransformMatrix.transformPoint(f,u,c);this._hullCache[6]=c.x;this._hullCache[7]=c.y;this._hullCache[8]=_-c.x;this._hullCache[9]=p-c.y;this.globalTransformMatrix.transformPoint(this._dX,0,c,true);this._hullCache[10]=c.x;this._hullCache[11]=c.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return P}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(m){var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.deformVertices=[];return t}t.toString=function(){return"[class dragonBones.DisplayFrame]"};t.prototype._onClear=function(){this.rawDisplayData=null;this.displayData=null;this.textureData=null;this.display=null;this.deformVertices.length=0};t.prototype.updateDeformVertices=function(){if(this.rawDisplayData===null||this.deformVertices.length!==0){return}var t;if(this.rawDisplayData.type===2){t=this.rawDisplayData.geometry}else if(this.rawDisplayData.type===4){t=this.rawDisplayData.geometry}else{return}var e=0;if(t.weight!==null){e=t.weight.count*2}else{e=t.data.intArray[t.offset+0]*2}this.deformVertices.length=e;for(var a=0,r=this.deformVertices.length;a=0&&this._displayIndex0){for(var s=0,o=i;s=0&&this._cachedFrameIndices!==null){var r=this._cachedFrameIndices[t];if(r>=0&&this._cachedFrameIndex===r){this._transformDirty=false}else if(r>=0){this._transformDirty=true;this._cachedFrameIndex=r}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._transformDirty){if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform();this._transformDirty=false}};c.prototype.invalidUpdate=function(){this._displayDataDirty=true;this._displayDirty=true;this._transformDirty=true};c.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._updateGlobalTransformMatrix(false);this._transformDirty=false}};c.prototype.replaceRawDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.rawDisplayData!==t){a.deformVertices.length=0;a.rawDisplayData=t;if(a.rawDisplayData===null){var r=this._armature._armatureData.defaultSkin;if(r!==null){var i=r.getDisplays(this._slotData.name);if(i!==null&&e=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.displayData!==t&&a.rawDisplayData!==t){a.displayData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};c.prototype.replaceTextureData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.textureData!==t){a.textureData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};c.prototype.replaceDisplay=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.display!==t){var r=a.display;a.display=t;if(r!==null&&r!==this._rawDisplay&&r!==this._meshDisplay&&!this._hasDisplay(r)){if(r instanceof m.Armature){}else{this._disposeDisplay(r,true)}}if(t!==null&&t!==this._rawDisplay&&t!==this._meshDisplay&&!this._hasDisplay(r)&&!(t instanceof m.Armature)){this._initDisplay(t,true)}if(e===this._displayIndex){this._displayDirty=true}}};c.prototype.containsPoint=function(t,e){if(this._boundingBoxData===null){return false}this.updateTransformAndMatrix();c._helpMatrix.copyFrom(this.globalTransformMatrix);c._helpMatrix.invert();c._helpMatrix.transformPoint(t,e,c._helpPoint);return this._boundingBoxData.containsPoint(c._helpPoint.x,c._helpPoint.y)};c.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}if(this._boundingBoxData===null){return 0}this.updateTransformAndMatrix();c._helpMatrix.copyFrom(this.globalTransformMatrix);c._helpMatrix.invert();c._helpMatrix.transformPoint(t,e,c._helpPoint);t=c._helpPoint.x;e=c._helpPoint.y;c._helpMatrix.transformPoint(a,r,c._helpPoint);a=c._helpPoint.x;r=c._helpPoint.y;var o=this._boundingBoxData.intersectsSegment(t,e,a,r,i,n,s);if(o>0){if(o===1||o===2){if(i!==null){this.globalTransformMatrix.transformPoint(i.x,i.y,i);if(n!==null){n.x=i.x;n.y=i.y}}else if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}}else{if(i!==null){this.globalTransformMatrix.transformPoint(i.x,i.y,i)}if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}}if(s!==null){this.globalTransformMatrix.transformPoint(Math.cos(s.x),Math.sin(s.x),c._helpPoint,true);s.x=Math.atan2(c._helpPoint.y,c._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(s.y),Math.sin(s.y),c._helpPoint,true);s.y=Math.atan2(c._helpPoint.y,c._helpPoint.x)}}return o};c.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]};Object.defineProperty(c.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(c.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(t){var e=this._displayFrames.length;if(et){for(var a=e-1;ad){continue}var b=0;for(;;D++){var A=y[D];if(m>A){continue}if(D===0){b=m/A}else{var P=y[D-1];b=(m-P)/(A-P)}break}if(D!==c){c=D;if(u&&D===p){this._computeVertices(_-4,4,0,f);this._computeVertices(0,4,4,f)}else{this._computeVertices(D*6+2,8,0,f)}}this.addCurvePosition(b,f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],l,g,a)}return}if(u){_+=2;f.length=o;this._computeVertices(2,_-4,0,f);this._computeVertices(0,2,_-4,f);f[_-2]=f[0];f[_-1]=f[1]}else{p--;_-=4;f.length=_;this._computeVertices(2,_,0,f)}var S=new Array(p);d=0;var O=f[0],x=f[1],B=0,M=0,E=0,I=0,F=0,w=0;var C,N,R,k,j,L,V,Y;for(var v=0,U=2;vd){continue}for(;;D++){var H=S[D];if(z>H)continue;if(D===0)z/=H;else{var K=S[D-1];z=(z-K)/(H-K)}break}if(D!==c){c=D;var Z=D*6;O=f[Z];x=f[Z+1];B=f[Z+2];M=f[Z+3];E=f[Z+4];I=f[Z+5];F=f[Z+6];w=f[Z+7];C=(O-B*2+E)*.03;N=(x-M*2+I)*.03;R=((B-E)*3-O+F)*.006;k=((M-I)*3-x+w)*.006;j=C*2+R;L=N*2+k;V=(B-O)*.3+C+R*.16666667;Y=(M-x)*.3+N+k*.16666667;G=Math.sqrt(V*V+Y*Y);X[0]=G;for(Z=1;Z<8;Z++){V+=j;Y+=L;j+=R;L+=k;G+=Math.sqrt(V*V+Y*Y);X[Z]=G}V+=j;Y+=L;G+=Math.sqrt(V*V+Y*Y);X[8]=G;V+=j+R;Y+=L+k;G+=Math.sqrt(V*V+Y*Y);X[9]=G;W=0}z*=G;for(;;W++){var q=X[W];if(z>q)continue;if(W===0)z/=q;else{var K=X[W-1];z=W+(z-K)/(q-K)}break}this.addCurvePosition(z*.1,O,x,B,M,E,I,F,w,l,g,a)}};t.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,u,f){if(t===0){h[u]=e;h[u+1]=a;h[u+2]=0;return}if(t===1){h[u]=o;h[u+1]=l;h[u+2]=0;return}var _=1-t;var p=_*_;var c=t*t;var m=p*_;var d=p*t*3;var y=_*c*3;var v=t*c;var g=m*e+d*r+y*n+v*o;var D=m*a+d*i+y*s+v*l;h[u]=g;h[u+1]=D;if(f){h[u+2]=Math.atan2(D-(m*a+d*i+y*s),g-(m*e+d*r+y*n))}else{h[u+2]=0}};t.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?U.Transform.DEG_RAD:-U.Transform.DEG_RAD}}var x=this.rotateMix;var B=this.translateMix;for(var c=0,M=3;c0){var C=v.a,N=v.b,R=v.c,k=v.d,j=void 0,L=void 0,V=void 0;if(h){j=b[M-1]}else{j=Math.atan2(I,E)}j-=Math.atan2(N,C);if(O){L=Math.cos(j);V=Math.sin(j);var Y=d._boneData.length;P+=(Y*(L*C-V*N)-E)*x;S+=(Y*(V*C+L*N)-I)*x}else{j+=A}if(j>U.Transform.PI){j-=U.Transform.PI_D}else if(j<-U.Transform.PI){j+=U.Transform.PI_D}j*=x;L=Math.cos(j);V=Math.sin(j);v.a=L*C-V*N;v.b=V*C+L*N;v.c=L*R-V*k;v.d=V*R+L*k}d.global.fromMatrix(v)}this.dirty=false};t.prototype.invalidUpdate=function(){};return t}(t);U.PathConstraint=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=0}this.time=0;this.timeScale=1;this._systemTime=0;this._animatebles=[];this._clock=null;this.time=t;this._systemTime=(new Date).getTime()*.001}t.prototype.advanceTime=function(t){if(t!==t){t=0}var e=Date.now()*.001;if(t<0){t=e-this._systemTime}this._systemTime=e;if(this.timeScale!==1){t*=this.timeScale}if(t===0){return}if(t<0){this.time-=t}else{this.time+=t}var a=0,r=0,i=this._animatebles.length;for(;a0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&n._subFadeState>0){this._armature._dragonBones.bufferObject(n);this._animationStates.length=0;this._lastAnimationState=null}else{var s=n.animationData;var o=s.cacheFrameRate;if(this._animationDirty&&o>0){this._animationDirty=false;for(var l=0,h=this._armature.getBones();l0){var c=p.getDisplayFrameAt(0).rawDisplayData;if(c!==null&&c.parent===this._armature.armatureData.defaultSkin){p._cachedFrameIndices=s.getSlotCachedFrameIndices(p.name);continue}}p._cachedFrameIndices=null}}n.advanceTime(t,o)}}else if(i>1){for(var m=0,d=0;m0&&n._subFadeState>0){d++;this._armature._dragonBones.bufferObject(n);this._animationDirty=true;if(this._lastAnimationState===n){this._lastAnimationState=null}}else{if(d>0){this._animationStates[m-d]=n}n.advanceTime(t,0)}if(m===i-1&&d>0){this._animationStates.length-=d;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};t.prototype.reset=function(){for(var t=0,e=this._animationStates;t0){if(t.position<0){t.position%=a.duration;t.position=a.duration-t.position}else if(t.position===a.duration){t.position-=1e-6}else if(t.position>a.duration){t.position%=a.duration}if(t.duration>0&&t.position+t.duration>a.duration){t.duration=a.duration-t.position}if(t.playTimes<0){t.playTimes=a.playTimes}}else{t.playTimes=1;t.position=0;if(t.duration>0){t.duration=0}}if(t.duration===0){t.duration=-1}this._fadeOut(t);var s=g.BaseObject.borrowObject(g.AnimationState);s.init(this._armature,a,t);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var o=false;for(var l=0,h=this._animationStates.length;lthis._animationStates[l].layer){o=true;this._animationStates.splice(l,0,s);break}else if(l!==h-1&&s.layer>this._animationStates[l+1].layer){o=true;this._animationStates.splice(l+1,0,s);break}}if(!o){this._animationStates.push(s)}}else{this._animationStates.push(s)}for(var u=0,f=this._armature.getSlots();u0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};t.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.frameCount>0?r.duration*e/r.frameCount:0}return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};t.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};t.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};t.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};t.prototype.getBlendState=function(t,e,a){if(!(t in this._blendStates)){this._blendStates[t]={}}var r=this._blendStates[t];if(!(e in r)){var i=r[e]=g.BaseObject.borrowObject(g.BlendState);i.target=a}return r[e]};t.prototype.getState=function(t,e){if(e===void 0){e=-1}var a=this._animationStates.length;while(a--){var r=this._animationStates[a];if(r.name===t&&(e<0||r.layer===e)){return r}}return null};t.prototype.hasAnimation=function(t){return t in this._animations};t.prototype.getStates=function(){return this._animationStates};Object.defineProperty(t.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});return t}(g.BaseObject);g.Animation=t})(dragonBones||(dragonBones={}));var dragonBones;(function(L){var t=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t._boneMask=[];t._boneTimelines=[];t._boneBlendTimelines=[];t._slotTimelines=[];t._slotBlendTimelines=[];t._constraintTimelines=[];t._animationTimelines=[];t._poseTimelines=[];t._actionTimeline=null;t._zOrderTimeline=null;return t}t.toString=function(){return"[class dragonBones.AnimationState]"};t.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0){this._boneTimelines.splice(v,1);r.returnToPool()}v=this._boneBlendTimelines.indexOf(r);if(v>=0){this._boneBlendTimelines.splice(v,1);r.returnToPool()}}}}{var g={};var D=[];for(var T=0,b=this._slotTimelines;T=0){this._slotTimelines.splice(v,1);r.returnToPool()}v=this._slotBlendTimelines.indexOf(r);if(v>=0){this._slotBlendTimelines.splice(v,1);r.returnToPool()}}}}};t.prototype._advanceFadeTime=function(t){var e=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var a=this._parent===null&&this.actionEnabled;if(a){var r=e?L.EventObject.FADE_OUT:L.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=L.BaseObject.borrowObject(L.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}}if(t<0){t=-t}this._fadeTime+=t;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=e?0:1}else if(this._fadeTime>0){this._fadeProgress=e?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=e?1:0}if(this._subFadeState>0){if(!e){this._playheadState|=1;this._fadeState=0}var a=this._parent===null&&this.actionEnabled;if(a){var r=e?L.EventObject.FADE_OUT_COMPLETE:L.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=L.BaseObject.borrowObject(L.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}}};t.prototype.init=function(t,e,a){if(this._armature!==null){return}this._armature=t;this._animationData=e;this.resetToPose=a.resetToPose;this.additive=a.additive;this.displayControl=a.displayControl;this.actionEnabled=a.actionEnabled;this.blendType=e.blendType;this.layer=a.layer;this.playTimes=a.playTimes;this.timeScale=a.timeScale;this.fadeTotalTime=a.fadeInTime;this.autoFadeOutTime=a.autoFadeOutTime;this.name=a.name.length>0?a.name:a.animation;this.group=a.group;this._weight=a.weight;if(a.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(a.duration<0){this._position=0;this._duration=this._animationData.duration;if(a.position!==0){if(this.timeScale>=0){this._time=a.position}else{this._time=a.position-this._duration}}else{this._time=0}}else{this._position=a.position;this._duration=a.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(a.boneMask.length>0){this._boneMask.length=a.boneMask.length;for(var r=0,i=this._boneMask.length;r0;var i=true;var n=true;var s=this._time;this._weightResult=this._weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(this._weight===0){return}if(r){var o=e*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*e);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){var h=false;var u=null;if(n){for(var f=0,_=this._boneTimelines.length;f<_;++f){var p=this._boneTimelines[f];if(p.playState<=0){p.update(s)}if(p.target!==u){var c=p.target;h=c.update(this);u=c;if(c.dirty===1){var m=c.target.animationPose;m.x=0;m.y=0;m.rotation=0;m.skew=0;m.scaleX=1;m.scaleY=1}}if(h){p.blend(a)}}}for(var f=0,_=this._boneBlendTimelines.length;f<_;++f){var p=this._boneBlendTimelines[f];if(p.playState<=0){p.update(s)}if(p.target.update(this)){p.blend(a)}}if(this.displayControl){for(var f=0,_=this._slotTimelines.length;f<_;++f){var p=this._slotTimelines[f];if(p.playState<=0){var d=p.target;var y=d.displayController;if(y===null||y===this.name||y===this.group){p.update(s)}}}}for(var f=0,_=this._slotBlendTimelines.length;f<_;++f){var p=this._slotBlendTimelines[f];if(p.playState<=0){var c=p.target;p.update(s);if(c.update(this)){p.blend(a)}}}for(var f=0,_=this._constraintTimelines.length;f<_;++f){var p=this._constraintTimelines[f];if(p.playState<=0){p.update(s)}}if(this._animationTimelines.length>0){var v=100;var g=100;var D=null;var T=null;for(var f=0,_=this._animationTimelines.length;f<_;++f){var p=this._animationTimelines[f];if(p.playState<=0){p.update(s)}if(this.blendType===1){var b=p.target;var A=this.parameterX-b.positionX;if(A>=0){if(A0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var P=0,S=this._poseTimelines;P=0){this._boneTimelines.splice(O,1);p.returnToPool();continue}O=this._boneBlendTimelines.indexOf(p);if(O>=0){this._boneBlendTimelines.splice(O,1);p.returnToPool();continue}O=this._slotTimelines.indexOf(p);if(O>=0){this._slotTimelines.splice(O,1);p.returnToPool();continue}O=this._slotBlendTimelines.indexOf(p);if(O>=0){this._slotBlendTimelines.splice(O,1);p.returnToPool();continue}O=this._constraintTimelines.indexOf(p);if(O>=0){this._constraintTimelines.splice(O,1);p.returnToPool();continue}}this._poseTimelines.length=0}}if(this._actionTimeline.playState>0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};t.prototype.play=function(){this._playheadState=3};t.prototype.stop=function(){this._playheadState&=1};t.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};t.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};t.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,u=i;h0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&this._parent===null){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.dirty++;this.layer=e;this.leftWeight=0;this.blendWeight=0;return false}this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}a*=this.leftWeight;this.dirty++;this.blendWeight=a;this.layerWeight+=this.blendWeight;return true}return false}this.dirty++;this.layer=e;this.leftWeight=1;this.blendWeight=a;this.layerWeight=a;return true};e.prototype.reset=function(){this.dirty=0;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};e.BONE_TRANSFORM="boneTransform";e.BONE_ALPHA="boneAlpha";e.SURFACE="surface";e.SLOT_DEFORM="slotDeform";e.SLOT_ALPHA="slotAlpha";e.SLOT_Z_INDEX="slotZIndex";return e}(L.BaseObject);L.BlendState=V})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.dirty=false;this.playState=-1;this.currentPlayTimes=0;this.currentTime=-1;this.target=null;this._isTween=false;this._valueOffset=0;this._frameValueOffset=0;this._frameOffset=0;this._frameRate=0;this._frameCount=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._valueArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this.playState===1?this._duration+1e-6:this._duration}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState.animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;if(this._timelineData!==null){var r=this._animationData.parent.parent;this._frameArray=r.frameArray;this._timelineArray=r.timelineArray;this._frameIndices=r.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){this.dirty=false};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._isTween||this.dirty){this._onUpdateFrame()}}};e.prototype.blend=function(t){};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a>0;var n=a+1;var s=Math.floor(t*n);var o=0;var l=0;if(i){o=s===0?0:e[r+s-1];l=s===n-1?1e4:e[r+s]}else{o=e[r+s-1];l=e[r+s]}return(o+(l-o)*(t*n-s))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenEasing=0;this._tweenProgress=0;this._valueScale=1};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this.dirty=true;this._isTween=false}};e.prototype._onUpdateFrame=function(){if(this._isTween){this.dirty=true;this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}};return e}(e);t.TweenTimelineState=a;var r=function(i){__extends(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}t.prototype._onClear=function(){i.prototype._onClear.call(this);this._current=0;this._difference=0;this._result=0};t.prototype._onArriveAtFrame=function(){i.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._valueScale;var e=this._valueArray;var a=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:a+1;if(t===1){this._current=e[a];this._difference=e[r]-this._current}else{this._current=e[a]*t;this._difference=e[r]*t-this._current}}else{this._result=e[a]*t}}else{this._result=0}};t.prototype._onUpdateFrame=function(){i.prototype._onUpdateFrame.call(this);if(this._isTween){this._result=this._current+this._difference*this._tweenProgress}};return t}(a);t.SingleValueTimelineState=r;var i=function(i){__extends(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}t.prototype._onClear=function(){i.prototype._onClear.call(this);this._currentA=0;this._currentB=0;this._differenceA=0;this._differenceB=0;this._resultA=0;this._resultB=0};t.prototype._onArriveAtFrame=function(){i.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._valueScale;var e=this._valueArray;var a=this._valueOffset+this._frameValueOffset+this._frameIndex*2;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:a+2;if(t===1){this._currentA=e[a];this._currentB=e[a+1];this._differenceA=e[r]-this._currentA;this._differenceB=e[r+1]-this._currentB}else{this._currentA=e[a]*t;this._currentB=e[a+1]*t;this._differenceA=e[r]*t-this._currentA;this._differenceB=e[r+1]*t-this._currentB}}else{this._resultA=e[a]*t;this._resultB=e[a+1]*t}}else{this._resultA=0;this._resultB=0}};t.prototype._onUpdateFrame=function(){i.prototype._onUpdateFrame.call(this);if(this._isTween){this._resultA=this._currentA+this._differenceA*this._tweenProgress;this._resultB=this._currentB+this._differenceB*this._tweenProgress}};return t}(a);t.DoubleValueTimelineState=i;var n=function(o){__extends(t,o);function t(){var t=o!==null&&o.apply(this,arguments)||this;t._rd=[];return t}t.prototype._onClear=function(){o.prototype._onClear.call(this);this._valueCount=0;this._rd.length=0};t.prototype._onArriveAtFrame=function(){o.prototype._onArriveAtFrame.call(this);var t=this._valueCount;var e=this._rd;if(this._timelineData!==null){var a=this._valueScale;var r=this._valueArray;var i=this._valueOffset+this._frameValueOffset+this._frameIndex*t;if(this._isTween){var n=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:i+t;if(a===1){for(var s=0;s0){if(n.hasDBEventListener(y.EventObject.COMPLETE)){h=y.BaseObject.borrowObject(y.EventObject);h.type=y.EventObject.COMPLETE;h.armature=this._armature;h.animationState=this._animationState}}}if(this._frameCount>1){var u=this._timelineData;var f=Math.floor(this.currentTime*this._frameRate);var _=this._frameIndices[u.frameIndicesOffset+f];if(this._frameIndex!==_){var p=this._frameIndex;this._frameIndex=_;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[u.offset+5+this._frameIndex];if(o){if(p<0){var c=Math.floor(r*this._frameRate);p=this._frameIndices[u.frameIndicesOffset+c];if(this.currentPlayTimes===a){if(p===_){p=-1}}}while(p>=0){var m=this._animationData.frameOffset+this._timelineArray[u.offset+5+p];var d=this._frameArray[m]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(p)}if(l!==null&&p===0){this._armature._dragonBones.bufferEvent(l);l=null}if(p>0){p--}else{p=this._frameCount-1}if(p===_){break}}}else{if(p<0){var c=Math.floor(r*this._frameRate);p=this._frameIndices[u.frameIndicesOffset+c];var m=this._animationData.frameOffset+this._timelineArray[u.offset+5+p];var d=this._frameArray[m]/this._frameRate;if(this.currentPlayTimes===a){if(r<=d){if(p>0){p--}else{p=this._frameCount-1}}else if(p===_){p=-1}}}while(p>=0){if(p=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(y.TimelineState);y.ZOrderTimelineState=e;var a=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._rd[2]=y.Transform.normalizeRadian(this._rd[2]);this._rd[3]=y.Transform.normalizeRadian(this._rd[3])}if(this._timelineData===null){this._rd[4]=1;this._rd[5]=1}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=6;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.fadeOut=function(){this.dirty=false;this._rd[2]=y.Transform.normalizeRadian(this._rd[2]);this._rd[3]=y.Transform.normalizeRadian(this._rd[3])};t.prototype.blend=function(t){var e=this._armature.armatureData.scale;var a=this._rd;var r=this.target;var i=r.target;var n=r.blendWeight;var s=i.animationPose;if(r.dirty>1){s.x+=a[0]*n*e;s.y+=a[1]*n*e;s.rotation+=a[2]*n;s.skew+=a[3]*n;s.scaleX+=(a[4]-1)*n;s.scaleY+=(a[5]-1)*n}else{s.x=a[0]*n*e;s.y=a[1]*n*e;s.rotation=a[2]*n;s.skew=a[3]*n;s.scaleX=(a[4]-1)*n+1;s.scaleY=(a[5]-1)*n+1}if(t||this.dirty){this.dirty=false;i._transformDirty=true}};return t}(y.MutilpleValueTimelineState);y.BoneAllTimelineState=a;var r=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.x+=this._resultA*r;i.y+=this._resultB*r}else if(r!==1){i.x=this._resultA*r;i.y=this._resultB*r}else{i.x=this._resultA;i.y=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneTranslateTimelineState=r;var i=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._differenceA=y.Transform.normalizeRadian(this._differenceA);this._differenceB=y.Transform.normalizeRadian(this._differenceB)}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.fadeOut=function(){this.dirty=false;this._resultA=y.Transform.normalizeRadian(this._resultA);this._resultB=y.Transform.normalizeRadian(this._resultB)};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.rotation+=this._resultA*r;i.skew+=this._resultB*r}else if(r!==1){i.rotation=this._resultA*r;i.skew=this._resultB*r}else{i.rotation=this._resultA;i.skew=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneRotateTimelineState=i;var n=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){this._resultA=1;this._resultB=1}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.scaleX+=(this._resultA-1)*r;i.scaleY+=(this._resultB-1)*r}else if(r!==1){i.scaleX=(this._resultA-1)*r+1;i.scaleY=(this._resultB-1)*r+1}else{i.scaleX=this._resultA;i.scaleY=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneScaleTimelineState=n;var s=function(s){__extends(t,s);function t(){return s!==null&&s.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};t.prototype._onClear=function(){s.prototype._onClear.call(this);this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};t.prototype.init=function(t,e,a){s.prototype.init.call(this,t,e,a);if(this._timelineData!==null){var r=this._animationData.parent.parent;var i=r.frameIntArray;var n=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=i[n+2];this._deformCount=i[n+1];this._deformOffset=i[n+3];this._sameValueOffset=i[n+4]+this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=r.frameFloatArray;this._rd.length=this._valueCount*2}else{this._deformCount=this.target.target._deformVertices.length}};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a._deformVertices;var n=this._valueArray;if(n!==null){var s=this._valueCount;var o=this._deformOffset;var l=this._sameValueOffset;var h=this._rd;for(var u=0;u1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u1){a._alpha+=this._result*r;if(a._alpha>1){a._alpha=1}}else{a._alpha=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._alphaDirty=true}};return t}(y.SingleValueTimelineState);y.AlphaTimelineState=o;var l=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotDisplayTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target;var e=this._timelineData!==null?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;if(t.displayIndex!==e){t._setDisplayIndex(e,true)}}};e.prototype._onUpdateFrame=function(){};return e}(y.TimelineState);y.SlotDisplayTimelineState=l;var h=function(o){__extends(t,o);function t(){var t=o!==null&&o.apply(this,arguments)||this;t._current=[0,0,0,0,0,0,0,0];t._difference=[0,0,0,0,0,0,0,0];t._result=[0,0,0,0,0,0,0,0];return t}t.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};t.prototype._onArriveAtFrame=function(){o.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.parent.parent;var e=t.colorArray;var a=t.frameIntArray;var r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex;var i=a[r];if(i<0){i+=65536}if(this._isTween){this._current[0]=e[i++];this._current[1]=e[i++];this._current[2]=e[i++];this._current[3]=e[i++];this._current[4]=e[i++];this._current[5]=e[i++];this._current[6]=e[i++];this._current[7]=e[i++];if(this._frameIndex===this._frameCount-1){i=a[this._animationData.frameIntOffset+this._frameValueOffset]}else{i=a[r+1]}if(i<0){i+=65536}this._difference[0]=e[i++]-this._current[0];this._difference[1]=e[i++]-this._current[1];this._difference[2]=e[i++]-this._current[2];this._difference[3]=e[i++]-this._current[3];this._difference[4]=e[i++]-this._current[4];this._difference[5]=e[i++]-this._current[5];this._difference[6]=e[i++]-this._current[6];this._difference[7]=e[i++]-this._current[7]}else{this._result[0]=e[i++]*.01;this._result[1]=e[i++]*.01;this._result[2]=e[i++]*.01;this._result[3]=e[i++]*.01;this._result[4]=e[i++];this._result[5]=e[i++];this._result[6]=e[i++];this._result[7]=e[i++]}}else{var n=this.target;var s=n.slotData.color;this._result[0]=s.alphaMultiplier;this._result[1]=s.redMultiplier;this._result[2]=s.greenMultiplier;this._result[3]=s.blueMultiplier;this._result[4]=s.alphaOffset;this._result[5]=s.redOffset;this._result[6]=s.greenOffset;this._result[7]=s.blueOffset}};t.prototype._onUpdateFrame=function(){o.prototype._onUpdateFrame.call(this);if(this._isTween){this._result[0]=(this._current[0]+this._difference[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._difference[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._difference[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._difference[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress;this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress;this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress;this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress}};t.prototype.fadeOut=function(){this._isTween=false};t.prototype.update=function(t){o.prototype.update.call(this,t);if(this._isTween||this.dirty){var e=this.target;var a=e._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);a.alphaMultiplier+=(this._result[0]-a.alphaMultiplier)*r;a.redMultiplier+=(this._result[1]-a.redMultiplier)*r;a.greenMultiplier+=(this._result[2]-a.greenMultiplier)*r;a.blueMultiplier+=(this._result[3]-a.blueMultiplier)*r;a.alphaOffset+=(this._result[4]-a.alphaOffset)*r;a.redOffset+=(this._result[5]-a.redOffset)*r;a.greenOffset+=(this._result[6]-a.greenOffset)*r;a.blueOffset+=(this._result[7]-a.blueOffset)*r;e._colorDirty=true}}else if(this.dirty){this.dirty=false;if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){a.alphaMultiplier=this._result[0];a.redMultiplier=this._result[1];a.greenMultiplier=this._result[2];a.blueMultiplier=this._result[3];a.alphaOffset=this._result[4];a.redOffset=this._result[5];a.greenOffset=this._result[6];a.blueOffset=this._result[7];e._colorDirty=true}}}};return t}(y.TweenTimelineState);y.SlotColorTimelineState=h;var u=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){var t=this.target;var e=t.target;this._result=e.slotData.zIndex}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueArray=this._animationData.parent.parent.frameIntArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;if(e.dirty>1){a._zIndex+=this._result*r}else{a._zIndex=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._zIndexDirty=true}};return t}(y.SingleValueTimelineState);y.SlotZIndexTimelineState=u;var f=function(f){__extends(t,f);function t(){return f!==null&&f.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.DeformTimelineState]"};t.prototype._onClear=function(){f.prototype._onClear.call(this);this.geometryOffset=0;this.displayFrame=null;this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};t.prototype.init=function(t,e,a){f.prototype.init.call(this,t,e,a);if(this._timelineData!==null){var r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];var i=this._animationData.parent.parent;var n=i.frameIntArray;var s=this.target.target;this.geometryOffset=n[r+0];if(this.geometryOffset<0){this.geometryOffset+=65536}for(var o=0,l=s.displayFrameCount;o1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u0;t._weight=this._currentB}else{var e=t._constraintData;t._bendPositive=e.bendPositive;t._weight=e.weight}t.invalidUpdate();this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=.01;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.DoubleValueTimelineState);y.IKConstraintTimelineState=_;var p=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.currentTime=this._result*t.totalTime}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.SingleValueTimelineState);y.AnimationProgressTimelineState=p;var c=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.weight=this._result}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.SingleValueTimelineState);y.AnimationWeightTimelineState=c;var m=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.parameterX=this._resultA;t.parameterY=this._resultB}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.DoubleValueTimelineState);y.AnimationParametersTimelineState=m})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.actionDataToInstance=function(t,e,a){if(t.type===0){e.type=r.FRAME_EVENT}else{e.type=t.type===10?r.FRAME_EVENT:r.SOUND_EVENT}e.name=t.name;e.armature=a;e.actionData=t;e.data=t.data;if(t.bone!==null){e.bone=a.getBone(t.bone.name)}if(t.slot!==null){e.slot=a.getSlot(t.slot.name)}};r.toString=function(){return"[class dragonBones.EventObject]"};r.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};r.START="start";r.LOOP_COMPLETE="loopComplete";r.COMPLETE="complete";r.FADE_IN="fadeIn";r.FADE_IN_COMPLETE="fadeInComplete";r.FADE_OUT="fadeOut";r.FADE_OUT_COMPLETE="fadeOutComplete";r.FRAME_EVENT="frameEvent";r.SOUND_EVENT="soundEvent";return r}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(){}t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}};t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};t.DATA_VERSION_2_3="2.3";t.DATA_VERSION_3_0="3.0";t.DATA_VERSION_4_0="4.0";t.DATA_VERSION_4_5="4.5";t.DATA_VERSION_5_0="5.0";t.DATA_VERSION_5_5="5.5";t.DATA_VERSION_5_6="5.6";t.DATA_VERSION=t.DATA_VERSION_5_6;t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6];t.TEXTURE_ATLAS="textureAtlas";t.SUB_TEXTURE="SubTexture";t.FORMAT="format";t.IMAGE_PATH="imagePath";t.WIDTH="width";t.HEIGHT="height";t.ROTATED="rotated";t.FRAME_X="frameX";t.FRAME_Y="frameY";t.FRAME_WIDTH="frameWidth";t.FRAME_HEIGHT="frameHeight";t.DRADON_BONES="dragonBones";t.USER_DATA="userData";t.ARMATURE="armature";t.CANVAS="canvas";t.BONE="bone";t.SURFACE="surface";t.SLOT="slot";t.CONSTRAINT="constraint";t.SKIN="skin";t.DISPLAY="display";t.FRAME="frame";t.IK="ik";t.PATH_CONSTRAINT="path";t.ANIMATION="animation";t.TIMELINE="timeline";t.FFD="ffd";t.TRANSLATE_FRAME="translateFrame";t.ROTATE_FRAME="rotateFrame";t.SCALE_FRAME="scaleFrame";t.DISPLAY_FRAME="displayFrame";t.COLOR_FRAME="colorFrame";t.DEFAULT_ACTIONS="defaultActions";t.ACTIONS="actions";t.EVENTS="events";t.INTS="ints";t.FLOATS="floats";t.STRINGS="strings";t.TRANSFORM="transform";t.PIVOT="pivot";t.AABB="aabb";t.COLOR="color";t.VERSION="version";t.COMPATIBLE_VERSION="compatibleVersion";t.FRAME_RATE="frameRate";t.TYPE="type";t.SUB_TYPE="subType";t.NAME="name";t.PARENT="parent";t.TARGET="target";t.STAGE="stage";t.SHARE="share";t.PATH="path";t.LENGTH="length";t.DISPLAY_INDEX="displayIndex";t.Z_ORDER="zOrder";t.Z_INDEX="zIndex";t.BLEND_MODE="blendMode";t.INHERIT_TRANSLATION="inheritTranslation";t.INHERIT_ROTATION="inheritRotation";t.INHERIT_SCALE="inheritScale";t.INHERIT_REFLECTION="inheritReflection";t.INHERIT_ANIMATION="inheritAnimation";t.INHERIT_DEFORM="inheritDeform";t.SEGMENT_X="segmentX";t.SEGMENT_Y="segmentY";t.BEND_POSITIVE="bendPositive";t.CHAIN="chain";t.WEIGHT="weight";t.BLEND_TYPE="blendType";t.FADE_IN_TIME="fadeInTime";t.PLAY_TIMES="playTimes";t.SCALE="scale";t.OFFSET="offset";t.POSITION="position";t.DURATION="duration";t.TWEEN_EASING="tweenEasing";t.TWEEN_ROTATE="tweenRotate";t.TWEEN_SCALE="tweenScale";t.CLOCK_WISE="clockwise";t.CURVE="curve";t.SOUND="sound";t.EVENT="event";t.ACTION="action";t.X="x";t.Y="y";t.SKEW_X="skX";t.SKEW_Y="skY";t.SCALE_X="scX";t.SCALE_Y="scY";t.VALUE="value";t.ROTATE="rotate";t.SKEW="skew";t.ALPHA="alpha";t.ALPHA_OFFSET="aO";t.RED_OFFSET="rO";t.GREEN_OFFSET="gO";t.BLUE_OFFSET="bO";t.ALPHA_MULTIPLIER="aM";t.RED_MULTIPLIER="rM";t.GREEN_MULTIPLIER="gM";t.BLUE_MULTIPLIER="bM";t.UVS="uvs";t.VERTICES="vertices";t.TRIANGLES="triangles";t.WEIGHTS="weights";t.SLOT_POSE="slotPose";t.BONE_POSE="bonePose";t.BONES="bones";t.POSITION_MODE="positionMode";t.SPACING_MODE="spacingMode";t.ROTATE_MODE="rotateMode";t.SPACING="spacing";t.ROTATE_OFFSET="rotateOffset";t.ROTATE_MIX="rotateMix";t.TRANSLATE_MIX="translateMix";t.TARGET_DISPLAY="targetDisplay";t.CLOSED="closed";t.CONSTANT_SPEED="constantSpeed";t.VERTEX_COUNT="vertexCount";t.LENGTHS="lengths";t.GOTO_AND_PLAY="gotoAndPlay";t.DEFAULT_NAME="default";return t}();t.DataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(tt){var t=function(e){__extends($,e);function $(){var t=e!==null&&e.apply(this,arguments)||this;t._rawTextureAtlasIndex=0;t._rawBones=[];t._data=null;t._armature=null;t._bone=null;t._geometry=null;t._slot=null;t._skin=null;t._mesh=null;t._animation=null;t._timeline=null;t._rawTextureAtlases=null;t._frameValueType=0;t._defaultColorOffset=-1;t._prevClockwise=0;t._prevRotation=0;t._frameDefaultValue=0;t._frameValueScale=1;t._helpMatrixA=new tt.Matrix;t._helpMatrixB=new tt.Matrix;t._helpTransform=new tt.Transform;t._helpColorTransform=new tt.ColorTransform;t._helpPoint=new tt.Point;t._helpArray=[];t._intArray=[];t._floatArray=[];t._frameIntArray=[];t._frameFloatArray=[];t._frameArray=[];t._timelineArray=[];t._colorArray=[];t._cacheRawMeshes=[];t._cacheMeshes=[];t._actionFrames=[];t._weightSlotPose={};t._weightBonePoses={};t._cacheBones={};t._slotChildActions={};return t}$._getBoolean=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="boolean"){return r}else if(i==="string"){switch(r){case"0":case"NaN":case"":case"false":case"null":case"undefined":return false;default:return true}}else{return!!r}}return a};$._getNumber=function(t,e,a){if(e in t){var r=t[e];if(r===null||r==="NaN"){return a}return+r||0}return a};$._getString=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="string"){return r}return String(r)}return a};$.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var u=1-l;var f=u*u;var _=l*l;var p=u*f;var c=3*l*f;var m=3*u*_;var d=l*_;h.x=p*t+c*a+m*i+d*s;h.y=p*e+c*r+m*n+d*o};$.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3===1){var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,p,c,m,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return true}else{var r=0;for(var i=0,n=e.length;i1e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,p,c,m,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return false}};$.prototype._parseActionDataInFrame=function(t,e,a,r){if(tt.DataParser.EVENT in t){this._mergeActionFrame(t[tt.DataParser.EVENT],e,10,a,r)}if(tt.DataParser.SOUND in t){this._mergeActionFrame(t[tt.DataParser.SOUND],e,11,a,r)}if(tt.DataParser.ACTION in t){this._mergeActionFrame(t[tt.DataParser.ACTION],e,0,a,r)}if(tt.DataParser.EVENTS in t){this._mergeActionFrame(t[tt.DataParser.EVENTS],e,10,a,r)}if(tt.DataParser.ACTIONS in t){this._mergeActionFrame(t[tt.DataParser.ACTIONS],e,0,a,r)}};$.prototype._mergeActionFrame=function(t,e,a,r,i){var n=this._armature.actions.length;var s=this._parseActionData(t,a,r,i);var o=0;var l=null;for(var h=0,u=s;he){break}o++}if(l===null){l=new D;l.frameStart=e;this._actionFrames.splice(o,0,l)}for(var m=0;m0){var _=a.getBone(u);if(_!==null){f.parent=_}else{if(!(u in this._cacheBones)){this._cacheBones[u]=[]}this._cacheBones[u].push(f)}}if(f.name in this._cacheBones){for(var p=0,c=this._cacheBones[f.name];p0&&e.parent!==null){i.root=e.parent;i.bone=e}else{i.root=e;i.bone=null}return i};$.prototype._parsePathConstraint=function(t){var e=this._armature.getSlot($._getString(t,tt.DataParser.TARGET,""));if(e===null){return null}var a=this._armature.defaultSkin;if(a===null){return null}var r=a.getDisplay(e.name,$._getString(t,tt.DataParser.TARGET_DISPLAY,e.name));if(r===null||!(r instanceof tt.PathDisplayData)){return null}var i=t[tt.DataParser.BONES];if(i===null||i.length===0){return null}var n=tt.BaseObject.borrowObject(tt.PathConstraintData);n.name=$._getString(t,tt.DataParser.NAME,"");n.type=1;n.pathSlot=e;n.pathDisplayData=r;n.target=e.parent;n.positionMode=tt.DataParser._getPositionMode($._getString(t,tt.DataParser.POSITION_MODE,""));n.spacingMode=tt.DataParser._getSpacingMode($._getString(t,tt.DataParser.SPACING_MODE,""));n.rotateMode=tt.DataParser._getRotateMode($._getString(t,tt.DataParser.ROTATE_MODE,""));n.position=$._getNumber(t,tt.DataParser.POSITION,0);n.spacing=$._getNumber(t,tt.DataParser.SPACING,0);n.rotateOffset=$._getNumber(t,tt.DataParser.ROTATE_OFFSET,0);n.rotateMix=$._getNumber(t,tt.DataParser.ROTATE_MIX,1);n.translateMix=$._getNumber(t,tt.DataParser.TRANSLATE_MIX,1);for(var s=0,o=i;s0?a:e;this._parsePivot(t,n);break}case 1:{var s=i=tt.BaseObject.borrowObject(tt.ArmatureDisplayData);s.name=e;s.path=a.length>0?a:e;s.inheritAnimation=true;if(tt.DataParser.ACTIONS in t){var o=this._parseActionData(t[tt.DataParser.ACTIONS],0,null,null);for(var l=0,h=o;l0?a:e;if(tt.DataParser.SHARE in t){c.geometry.data=this._data;this._cacheRawMeshes.push(t);this._cacheMeshes.push(c)}else{this._parseMesh(t,c)}break}case 3:{var m=this._parseBoundingBox(t);if(m!==null){var d=i=tt.BaseObject.borrowObject(tt.BoundingBoxDisplayData);d.name=e;d.path=a.length>0?a:e;d.boundingBox=m}break}case 4:{var y=t[tt.DataParser.LENGTHS];var v=i=tt.BaseObject.borrowObject(tt.PathDisplayData);v.closed=$._getBoolean(t,tt.DataParser.CLOSED,false);v.constantSpeed=$._getBoolean(t,tt.DataParser.CONSTANT_SPEED,false);v.name=e;v.path=a.length>0?a:e;v.curveLengths.length=y.length;for(var g=0,D=y.length;ge.width){e.width=o}if(le.height){e.height=l}}}e.width-=e.x;e.height-=e.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return e};$.prototype._parseAnimation=function(t){var e=tt.BaseObject.borrowObject(tt.AnimationData);e.blendType=tt.DataParser._getAnimationBlendType($._getString(t,tt.DataParser.BLEND_TYPE,""));e.frameCount=$._getNumber(t,tt.DataParser.DURATION,0);e.playTimes=$._getNumber(t,tt.DataParser.PLAY_TIMES,1);e.duration=e.frameCount/this._armature.frameRate;e.fadeInTime=$._getNumber(t,tt.DataParser.FADE_IN_TIME,0);e.scale=$._getNumber(t,tt.DataParser.SCALE,1);e.name=$._getString(t,tt.DataParser.NAME,tt.DataParser.DEFAULT_NAME);if(e.name.length===0){e.name=tt.DataParser.DEFAULT_NAME}e.frameIntOffset=this._frameIntArray.length;e.frameFloatOffset=this._frameFloatArray.length;e.frameOffset=this._frameArray.length;this._animation=e;if(tt.DataParser.FRAME in t){var a=t[tt.DataParser.FRAME];var r=a.length;if(r>0){for(var i=0,n=0;i0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame);this._actionFrames.length=0}if(tt.DataParser.TIMELINE in t){var o=t[tt.DataParser.TIMELINE];for(var A=0,P=o;A0&&a in t){e=t[a]}if(e===null){return null}var l=e.length;if(l===0){return null}var h=this._frameIntArray.length;var u=this._frameFloatArray.length;var f=this._timelineArray.length;if(o===null){o=tt.BaseObject.borrowObject(tt.TimelineData)}o.type=r;o.offset=f;this._frameValueType=i;this._timeline=o;this._timelineArray.length+=1+1+1+1+1+l;if(t!==null){this._timelineArray[f+0]=Math.round($._getNumber(t,tt.DataParser.SCALE,1)*100);this._timelineArray[f+1]=Math.round($._getNumber(t,tt.DataParser.OFFSET,0)*100)}else{this._timelineArray[f+0]=100;this._timelineArray[f+1]=0}this._timelineArray[f+2]=l;this._timelineArray[f+3]=n;switch(this._frameValueType){case 0:this._timelineArray[f+4]=0;break;case 1:this._timelineArray[f+4]=h-this._animation.frameIntOffset;break;case 2:this._timelineArray[f+4]=u-this._animation.frameFloatOffset;break}if(l===1){o.frameIndicesOffset=-1;this._timelineArray[f+5+0]=s.call(this,e[0],0,0)-this._animation.frameOffset}else{var _=this._animation.frameCount+1;var p=this._data.frameIndices;var c=p.length;p.length+=_;o.frameIndicesOffset=c;for(var m=0,d=0,y=0,v=0;m<_;++m){if(y+v<=m&&d0){if(tt.DataParser.CURVE in t){var i=a+1;this._helpArray.length=i;var n=this._samplingEasingCurve(t[tt.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[r+1]=2;this._frameArray[r+2]=n?i:-i;for(var s=0;s0){var n=this._armature.sortedSlots.length;var s=new Array(n-i.length/2);var o=new Array(n);for(var l=0;l0?r>=this._prevRotation:r<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}r=this._prevRotation+r-this._prevRotation+tt.Transform.PI_D*this._prevClockwise}}this._prevClockwise=$._getNumber(t,tt.DataParser.TWEEN_ROTATE,0);this._prevRotation=r;var i=this._parseTweenFrame(t,e,a);var n=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[n++]=this._helpTransform.x;this._frameFloatArray[n++]=this._helpTransform.y;this._frameFloatArray[n++]=r;this._frameFloatArray[n++]=this._helpTransform.skew;this._frameFloatArray[n++]=this._helpTransform.scaleX;this._frameFloatArray[n++]=this._helpTransform.scaleY;this._parseActionDataInFrame(t,e,this._bone,this._slot);return i};$.prototype._parseBoneTranslateFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.X,0);this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.Y,0);return r};$.prototype._parseBoneRotateFrame=function(t,e,a){var r=$._getNumber(t,tt.DataParser.ROTATE,0)*tt.Transform.DEG_RAD;if(e!==0){if(this._prevClockwise===0){r=this._prevRotation+tt.Transform.normalizeRadian(r-this._prevRotation)}else{if(this._prevClockwise>0?r>=this._prevRotation:r<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}r=this._prevRotation+r-this._prevRotation+tt.Transform.PI_D*this._prevClockwise}}this._prevClockwise=$._getNumber(t,tt.DataParser.CLOCK_WISE,0);this._prevRotation=r;var i=this._parseTweenFrame(t,e,a);var n=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[n++]=r;this._frameFloatArray[n++]=$._getNumber(t,tt.DataParser.SKEW,0)*tt.Transform.DEG_RAD;return i};$.prototype._parseBoneScaleFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.X,1);this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.Y,1);return r};$.prototype._parseSlotDisplayFrame=function(t,e,a){var r=this._parseFrame(t,e,a);this._frameArray.length+=1;if(tt.DataParser.VALUE in t){this._frameArray[r+1]=$._getNumber(t,tt.DataParser.VALUE,0)}else{this._frameArray[r+1]=$._getNumber(t,tt.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(t,e,this._slot.parent,this._slot);return r};$.prototype._parseSlotColorFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=-1;if(tt.DataParser.VALUE in t||tt.DataParser.COLOR in t){var n=tt.DataParser.VALUE in t?t[tt.DataParser.VALUE]:t[tt.DataParser.COLOR];for(var s in n){s;this._parseColorTransform(n,this._helpColorTransform);i=this._colorArray.length;this._colorArray.length+=8;this._colorArray[i++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.redMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.alphaOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.redOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.greenOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.blueOffset);i-=8;break}}if(i<0){if(this._defaultColorOffset<0){this._defaultColorOffset=i=this._colorArray.length;this._colorArray.length+=8;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=0;this._colorArray[i++]=0;this._colorArray[i++]=0;this._colorArray[i++]=0}i=this._defaultColorOffset}var o=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[o]=i;return r};$.prototype._parseSlotDeformFrame=function(t,e,a){var r=this._frameFloatArray.length;var i=this._parseTweenFrame(t,e,a);var n=tt.DataParser.VERTICES in t?t[tt.DataParser.VERTICES]:null;var s=$._getNumber(t,tt.DataParser.OFFSET,0);var o=this._intArray[this._mesh.geometry.offset+0];var l=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var h=this._mesh.geometry.weight;var u=0;var f=0;var _=0;var p=0;if(h!==null){var c=this._weightSlotPose[l];this._helpMatrixA.copyFromArray(c,0);this._frameFloatArray.length+=h.count*2;_=h.offset+2+h.bones.length}else{this._frameFloatArray.length+=o*2}for(var m=0;m=n.length){u=0}else{u=n[m-s]}if(m+1=n.length){f=0}else{f=n[m+1-s]}}if(h!==null){var d=this._weightBonePoses[l];var y=this._intArray[_++];this._helpMatrixA.transformPoint(u,f,this._helpPoint,true);u=this._helpPoint.x;f=this._helpPoint.y;for(var v=0;v=n.length){h=0}else{h=n[f-s]}if(f+1=n.length){u=0}else{u=n[f+1-s]}}else{h=0;u=0}this._frameFloatArray[r+f]=h;this._frameFloatArray[r+f+1]=u}}if(e===0){var _=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[_+0]=this._geometry.offset;this._frameIntArray[_+1]=this._frameFloatArray.length-r;this._frameIntArray[_+2]=this._frameFloatArray.length-r;this._frameIntArray[_+3]=0;this._frameIntArray[_+4]=r-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=_-this._animation.frameIntOffset}return i};$.prototype._parseTransform=function(t,e,a){e.x=$._getNumber(t,tt.DataParser.X,0)*a;e.y=$._getNumber(t,tt.DataParser.Y,0)*a;if(tt.DataParser.ROTATE in t||tt.DataParser.SKEW in t){e.rotation=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.ROTATE,0)*tt.Transform.DEG_RAD);e.skew=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW,0)*tt.Transform.DEG_RAD)}else if(tt.DataParser.SKEW_X in t||tt.DataParser.SKEW_Y in t){e.rotation=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW_Y,0)*tt.Transform.DEG_RAD);e.skew=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW_X,0)*tt.Transform.DEG_RAD)-e.rotation}e.scaleX=$._getNumber(t,tt.DataParser.SCALE_X,1);e.scaleY=$._getNumber(t,tt.DataParser.SCALE_Y,1)};$.prototype._parseColorTransform=function(t,e){e.alphaMultiplier=$._getNumber(t,tt.DataParser.ALPHA_MULTIPLIER,100)*.01;e.redMultiplier=$._getNumber(t,tt.DataParser.RED_MULTIPLIER,100)*.01;e.greenMultiplier=$._getNumber(t,tt.DataParser.GREEN_MULTIPLIER,100)*.01;e.blueMultiplier=$._getNumber(t,tt.DataParser.BLUE_MULTIPLIER,100)*.01;e.alphaOffset=$._getNumber(t,tt.DataParser.ALPHA_OFFSET,0);e.redOffset=$._getNumber(t,tt.DataParser.RED_OFFSET,0);e.greenOffset=$._getNumber(t,tt.DataParser.GREEN_OFFSET,0);e.blueOffset=$._getNumber(t,tt.DataParser.BLUE_OFFSET,0)};$.prototype._parseGeometry=function(t,e){var a=t[tt.DataParser.VERTICES];var r=Math.floor(a.length/2);var i=0;var n=this._intArray.length;var s=this._floatArray.length;e.offset=n;e.data=this._data;this._intArray.length+=1+1+1+1;this._intArray[n+0]=r;this._intArray[n+2]=s;this._intArray[n+3]=-1;this._floatArray.length+=r*2;for(var o=0,l=r*2;o=0||tt.DataParser.DATA_VERSIONS.indexOf(r)>=0){var i=tt.BaseObject.borrowObject(tt.DragonBonesData);i.version=a;i.name=$._getString(t,tt.DataParser.NAME,"");i.frameRate=$._getNumber(t,tt.DataParser.FRAME_RATE,24);if(i.frameRate===0){i.frameRate=24}if(tt.DataParser.ARMATURE in t){this._data=i;this._parseArray(t);var n=t[tt.DataParser.ARMATURE];for(var s=0,o=n;s0){i.stage=i.getArmature(i.armatureNames[0])}this._data=null}if(tt.DataParser.TEXTURE_ATLAS in t){this._rawTextureAtlases=t[tt.DataParser.TEXTURE_ATLAS]}return i}else{console.assert(false,"Nonsupport data version: "+a+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};$.prototype.parseTextureAtlasData=function(t,e,a){if(a===void 0){a=1}console.assert(t!==undefined);if(t===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var r=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(r,e,a);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}e.width=$._getNumber(t,tt.DataParser.WIDTH,0);e.height=$._getNumber(t,tt.DataParser.HEIGHT,0);e.scale=a===1?1/$._getNumber(t,tt.DataParser.SCALE,1):a;e.name=$._getString(t,tt.DataParser.NAME,"");e.imagePath=$._getString(t,tt.DataParser.IMAGE_PATH,"");if(tt.DataParser.SUB_TEXTURE in t){var i=t[tt.DataParser.SUB_TEXTURE];for(var n=0,s=i.length;n0&&h>0){u.frame=tt.TextureData.createRectangle();u.frame.x=$._getNumber(o,tt.DataParser.FRAME_X,0);u.frame.y=$._getNumber(o,tt.DataParser.FRAME_Y,0);u.frame.width=l;u.frame.height=h}e.addTexture(u)}}return true};$.getInstance=function(){if($._objectDataParserInstance===null){$._objectDataParserInstance=new $}return $._objectDataParserInstance};$._objectDataParserInstance=null;return $}(tt.DataParser);tt.ObjectDataParser=t;var D=function(){function t(){this.frameStart=0;this.actions=[]}return t}();tt.ActionFrame=D})(dragonBones||(dragonBones={}));var dragonBones;(function(g){var t=function(o){__extends(t,o);function t(){return o!==null&&o.apply(this,arguments)||this}t.prototype._inRange=function(t,e,a){return e<=t&&t<=a};t.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var u=0;while(t.length>i){var f=t[i++];if(f===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(f,0,127)){s=f}else{if(this._inRange(f,194,223)){l=1;u=128;o=f-192}else if(this._inRange(f,224,239)){l=2;u=2048;o=f-224}else if(this._inRange(f,240,244)){l=3;u=65536;o=f-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(f,128,191)){o=0;l=0;h=0;u=0;i--;s=f}else{h+=1;o=o+(f-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var p=u;o=0;l=0;h=0;u=0;if(this._inRange(_,p,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=f}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};t.prototype._parseBinaryTimeline=function(t,e,a){if(a===void 0){a=null}var r=a!==null?a:g.BaseObject.borrowObject(g.TimelineData);r.type=t;r.offset=e;this._timeline=r;var i=this._timelineArrayBuffer[r.offset+2];if(i===1){r.frameIndicesOffset=-1}else{var n=0;var s=this._animation.frameCount+1;var o=this._data.frameIndices;n=o.length;o.length+=s;r.frameIndicesOffset=n;for(var l=0,h=0,u=0,f=0;l=0){var h=g.ObjectDataParser._getNumber(d,g.DataParser.TYPE,0);var y=g.ObjectDataParser._getString(d,g.DataParser.NAME,"");var f=null;if(h===40&&e.blendType!==0){f=g.BaseObject.borrowObject(g.AnimationTimelineData);var v=f;v.x=g.ObjectDataParser._getNumber(d,g.DataParser.X,0);v.y=g.ObjectDataParser._getNumber(d,g.DataParser.Y,0)}f=this._parseBinaryTimeline(h,u,f);switch(h){case 0:break;case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(y,f);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(y,f);break;case 30:this._animation.addConstraintTimeline(y,f);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(y,f);break}}}}this._animation=null;return e};t.prototype._parseGeometry=function(t,e){e.offset=t[g.DataParser.OFFSET];e.data=this._data;var a=this._intArrayBuffer[e.offset+3];if(a>=0){var r=g.BaseObject.borrowObject(g.WeightData);var i=this._intArrayBuffer[e.offset+0];var n=this._intArrayBuffer[a+0];r.offset=a;for(var s=0;s12?e[13]:0;var h=new Uint16Array(this._binary,this._binaryOffset+e[0],a/Uint16Array.BYTES_PER_ELEMENT);var u=new Float32Array(this._binary,this._binaryOffset+e[2],r/Float32Array.BYTES_PER_ELEMENT);var f=new Int16Array(this._binary,this._binaryOffset+e[4],i/Int16Array.BYTES_PER_ELEMENT);var _=new Float32Array(this._binary,this._binaryOffset+e[6],n/Float32Array.BYTES_PER_ELEMENT);var p=new Int16Array(this._binary,this._binaryOffset+e[8],s/Int16Array.BYTES_PER_ELEMENT);var c=new Uint16Array(this._binary,this._binaryOffset+e[10],o/Uint16Array.BYTES_PER_ELEMENT);var m=l>0?new Uint16Array(this._binary,this._binaryOffset+e[12],l/Uint16Array.BYTES_PER_ELEMENT):h;this._data.binary=this._binary;this._data.intArray=this._intArrayBuffer=h;this._data.floatArray=u;this._data.frameIntArray=f;this._data.frameFloatArray=_;this._data.frameArray=this._frameArrayBuffer=p;this._data.timelineArray=this._timelineArrayBuffer=c;this._data.colorArray=m};t.prototype.parseDragonBonesData=function(t,e){if(e===void 0){e=1}console.assert(t!==null&&t!==undefined&&t instanceof ArrayBuffer,"Data error.");var a=new Uint8Array(t,0,8);if(a[0]!=="D".charCodeAt(0)||a[1]!=="B".charCodeAt(0)||a[2]!=="D".charCodeAt(0)||a[3]!=="T".charCodeAt(0)){console.assert(false,"Nonsupport data.");return null}var r=new Uint32Array(t,8,1)[0];var i=new Uint8Array(t,8+4,r);var n=this._decodeUTF8(i);var s=JSON.parse(n);this._binaryOffset=8+4+r;this._binary=t;return o.prototype.parseDragonBonesData.call(this,s,e)};t.getInstance=function(){if(t._binaryDataParserInstance===null){t._binaryDataParserInstance=new t}return t._binaryDataParserInstance};t._binaryDataParserInstance=null;return t}(g.ObjectDataParser);g.BinaryDataParser=t})(dragonBones||(dragonBones={}));var dragonBones;(function(y){var t=function(){function s(t){if(t===void 0){t=null}this.autoSearch=false;this._dragonBonesDataMap={};this._textureAtlasDataMap={};this._dragonBones=null;this._dataParser=null;if(s._objectParser===null){s._objectParser=new y.ObjectDataParser}if(s._binaryParser===null){s._binaryParser=new y.BinaryDataParser}this._dataParser=t!==null?t:s._objectParser}s.prototype._isSupportMesh=function(){return true};s.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap){for(var a=0,r=this._textureAtlasDataMap[t];a0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};s.prototype._buildBones=function(t,e){for(var a=0,r=t.armature.sortedBones;a0){var m=this._getTextureData(t.textureAtlasName,c.path);f.replaceTextureData(m,_)}var d=this._getSlotDisplay(t,c,f);f.replaceDisplay(d,_)}else{f.replaceDisplay(null)}}}f._setDisplayIndex(h.displayIndex,true)}};s.prototype._buildConstraints=function(t,e){var a=t.armature.constraints;for(var r in a){var i=a[r];switch(i.type){case 0:var n=y.BaseObject.borrowObject(y.IKConstraint);n.init(i,e);e._addConstraint(n);break;case 1:var s=y.BaseObject.borrowObject(y.PathConstraint);s.init(i,e);e._addConstraint(s);break;default:var o=y.BaseObject.borrowObject(y.IKConstraint);o.init(i,e);e._addConstraint(o);break}}};s.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,t!==null?t.dataName:"","",t!==null?t.textureAtlasName:"")};s.prototype._getSlotDisplay=function(t,e,a){var r=t!==null?t.dataName:e.parent.parent.parent.name;var i=null;switch(e.type){case 0:{var n=e;if(n.texture===null){n.texture=this._getTextureData(r,e.path)}i=a.rawDisplay;break}case 2:{var s=e;if(s.texture===null){s.texture=this._getTextureData(r,s.path)}if(this._isSupportMesh()){i=a.meshDisplay}else{i=a.rawDisplay}break}case 1:{var o=e;var l=this._buildChildArmature(t,a,o);if(l!==null){l.inheritAnimation=o.inheritAnimation;if(!l.inheritAnimation){var h=o.actions.length>0?o.actions:l.armatureData.defaultActions;if(h.length>0){for(var u=0,f=h;u=0){continue}var h=e.getDisplays(l.name);if(h===null){if(n!==null&&e!==n){h=n.getDisplays(l.name)}if(h===null){if(a){l.displayFrameCount=0}continue}}l.displayFrameCount=h.length;for(var u=0,f=l.displayFrameCount;u0};e.prototype.dispatchDBEvent=function(t,e){this.emit(t,e)};e.prototype.addDBEventListener=function(t,e,a){this.on(t,e,a)};e.prototype.removeDBEventListener=function(t,e,a){this.off(t,e,a)};return e}(Phaser.Events.EventEmitter);t.EventDispatcher=e})(e=t.util||(t.util={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(t){var e;(function(e){e.Skew={getSkewX:function(){return this._skewX||0},setSkewX:function(t){this._skewX=t},getSkewY:function(){return this._skewY||0},setSkewY:function(t){this._skewY=t},setSkew:function(t,e){e=e===void 0?t:e;this._skewX=t;this._skewY=e}};e.extendSkew=function(t){Object.defineProperty(t.prototype,"skewX",{get:e.Skew.getSkewX,set:e.Skew.setSkewX,enumerable:true,configurable:true});Object.defineProperty(t.prototype,"skewY",{get:e.Skew.getSkewY,set:e.Skew.setSkewY,enumerable:true,configurable:true});t.prototype.setSkew=e.Skew.setSkew}})(e=t.util||(t.util={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(t){var e;(function(t){var e=function(o){__extends(t,o);function t(t,e,a,r,i,n){var s=o.call(this,t,e,a,r,i,n)||this;s.decomposedMatrix.skewX=0;s.decomposedMatrix.skewY=0;return s}t.prototype.decomposeMatrix=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=-Math.atan2(-a,r);var n=Math.atan2(e,t);var s=Math.abs(i+n);if(s<1e-5||Math.abs(Phaser.Math.PI2-s)<1e-5){this.decomposedMatrix.rotation=n;if(t<0&&r>=0)this.decomposedMatrix.rotation+=this.decomposedMatrix.rotation<=0?Math.PI:-Math.PI;this.decomposedMatrix.skewX=this.decomposedMatrix.skewY=0}else{this.decomposedMatrix.rotation=0;this.decomposedMatrix.skewX=i;this.decomposedMatrix.skewY=n}this.decomposedMatrix.scaleX=Math.sqrt(t*t+e*e);this.decomposedMatrix.scaleY=Math.sqrt(a*a+r*r);this.decomposedMatrix.translateX=this.tx;this.decomposedMatrix.translateY=this.ty;return this.decomposedMatrix};t.prototype.applyITRSC=function(t,e,a,r,i,n,s){this.a=Math.cos(a-s)*r;this.b=Math.sin(a-s)*r;this.c=-Math.sin(a+n)*i;this.d=Math.cos(a+n)*i;this.tx=t;this.ty=e;return this};Object.defineProperty(t.prototype,"skewX",{get:function(){return-Math.atan2(-this.c,this.d)},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"skewY",{get:function(){return Math.atan2(this.b,this.a)},enumerable:true,configurable:true});return t}(Phaser.GameObjects.Components.TransformMatrix);t.TransformMatrix=e})(e=t.util||(t.util={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(s){var t;(function(t){var e=function(n){__extends(t,n);function t(t,e,a,r){var i=n.call(this,t,e,a,r)||this;i._skewX=0;i._skewY=0;i.tempTransformMatrix=new s.util.TransformMatrix;return i}t.prototype.pointToContainer=function(t,e){if(e===undefined)e=new Phaser.Math.Vector2;if(this.parentContainer)return this.parentContainer.pointToContainer(t,e);var a=this.tempTransformMatrix;a.applyITRSC(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this._skewX,this._skewY);a.invert();a.transformPoint(t.x,t.y,e);return e};Object.defineProperty(t.prototype,"skewX",{get:function(){return this._skewX},set:function(t){this._skewX=t},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"skewY",{get:function(){return this._skewY},set:function(t){this._skewY=t},enumerable:true,configurable:true});t.prototype.setSkew=function(t,e){e=e===void 0?t:e;this.skewX=t;this.skewY=e;return this};return t}(Phaser.GameObjects.Container);t.DisplayContainer=e})(t=s.display||(s.display={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(t){var e;(function(t){var e=function(a){__extends(t,a);function t(t){var e=a.call(this,t)||this;e.debugDraw=false;return e}t.prototype.dbInit=function(t){this._armature=t};t.prototype.dbClear=function(){this.removeAllListeners();if(this._armature)this._armature.dispose();this._armature=null};t.prototype.dbUpdate=function(){if(this.debugDraw){}};t.prototype.dispose=function(t){this.dbClear();if(t===true)a.prototype.destroy.call(this)};t.prototype.destroy=function(){this.dispose(true)};t.prototype.dispatchDBEvent=function(t,e){this.emit(t,e)};t.prototype.hasDBEventListener=function(t){return this.listenerCount(t)>0};t.prototype.addDBEventListener=function(t,e,a){this.on(t,e,a)};t.prototype.removeDBEventListener=function(t,e,a){this.off(t,e,a)};Object.defineProperty(t.prototype,"armature",{get:function(){return this._armature},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animation",{get:function(){return this._armature.animation},enumerable:true,configurable:true});return t}(t.DisplayContainer);t.ArmatureDisplay=e})(e=t.display||(t.display={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(a){var t;(function(t){var e=function(s){__extends(t,s);function t(t,e,a,r,i){var n=s.call(this,t,e,a,r,i)||this;n.setPipeline("PhaserTextureTintPipeline");return n}return t}(Phaser.GameObjects.Image);t.SlotImage=e;a.util.extendSkew(e)})(t=a.display||(a.display={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(a){var t;(function(t){var e=function(s){__extends(t,s);function t(t,e,a,r,i){var n=s.call(this,t,e,a,r,i)||this;n.setPipeline("PhaserTextureTintPipeline");return n}return t}(Phaser.GameObjects.Sprite);t.SlotSprite=e;a.util.extendSkew(e)})(t=a.display||(a.display={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(r){var t;(function(t){var e;(function(s){var t=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.PhaserSlot]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._textureScale=1;if(this._renderDisplay){this._renderDisplay.destroy();this._renderDisplay=null}};e.prototype._initDisplay=function(t,e){};e.prototype._disposeDisplay=function(t,e){};e.prototype._onUpdateDisplay=function(){this._renderDisplay=this._display||this._rawDisplay};e.prototype._addDisplay=function(){this.armature.display.add(this._renderDisplay)};e.prototype._replaceDisplay=function(t){if(!this._renderDisplay["setSkew"]){console.warn("please call dragonBones.phaser.util.extendSkew to mix skew component into your display object,\n and set its pipeline to 'PhaserTextureTintPipeline' by calling 'setPiepline' method, more detail please refer to the 'ReplaceSlotDisplay.ts' example");return}this.armature.display.replace(t,this._renderDisplay);this._renderDisplay.parentContainer=this.armature.display};e.prototype._removeDisplay=function(){this._renderDisplay.parentContainer.remove(this._renderDisplay)};e.prototype._updateZOrder=function(){if(this._renderDisplay.depth===this._zOrder)return;this._renderDisplay.setDepth(this._zOrder)};e.prototype._updateVisible=function(){this._renderDisplay.setVisible(this._parent.visible&&this._visible)};e.prototype._updateBlendMode=function(){var t=Phaser.BlendModes.NORMAL;switch(this._blendMode){case 0:t=Phaser.BlendModes.NORMAL;break;case 1:t=Phaser.BlendModes.ADD;break;case 3:t=Phaser.BlendModes.DARKEN;break;case 4:t=Phaser.BlendModes.DIFFERENCE;break;case 6:t=Phaser.BlendModes.HARD_LIGHT;break;case 9:t=Phaser.BlendModes.LIGHTEN;break;case 10:t=Phaser.BlendModes.MULTIPLY;break;case 11:t=Phaser.BlendModes.OVERLAY;break;case 12:t=Phaser.BlendModes.SCREEN;break;default:break}this._renderDisplay.setBlendMode(t)};e.prototype._updateColor=function(){var t=this._colorTransform;var e=this._globalAlpha*t.alphaMultiplier+t.alphaOffset;this._renderDisplay.setAlpha(e);if(this._renderDisplay instanceof s.DisplayContainer)return;var a=255*t.redMultiplier+t.redOffset;var r=255*t.greenMultiplier+t.greenOffset;var i=255*t.blueMultiplier+t.blueOffset;var n=a<<16|r<<8|i;this._renderDisplay.setTint(n)};e.prototype._updateFrame=function(){if(this._renderDisplay instanceof s.DisplayContainer)return;var t=this._textureData;if(this._displayIndex>=0&&this._display!==null&&t!==null){var e=t.parent;if(this.armature.replacedTexture!==null){if(this.armature._replaceTextureAtlasData===null){e=r.BaseObject.borrowObject(s.TextureAtlasData);e.copyFrom(t.parent);e.renderTexture=this.armature.replacedTexture;this.armature._replaceTextureAtlasData=e}else e=this.armature._replaceTextureAtlasData;t=e.getTexture(t.name)}var a=t.renderTexture;if(a!==null){if(this._geometryData!==null){}else{this._renderDisplay.texture=a.texture;this._renderDisplay.frame=a;this._renderDisplay.setDisplayOrigin(this._pivotX,this._pivotY);this._textureScale=t.parent.scale*this.armature.armatureData.scale;this._renderDisplay.setScale(this._textureScale)}this._visibleDirty=true;return}}else{this._renderDisplay.x=0;this._renderDisplay.y=0;this._renderDisplay.setTexture(undefined)}};e.prototype._updateMesh=function(){};e.prototype._updateTransform=function(){this.updateGlobalTransform();var t=this.global;this._renderDisplay.x=t.x;this._renderDisplay.y=t.y;this._renderDisplay.rotation=t.rotation;this._renderDisplay["setSkew"](t.skew,0);this._renderDisplay.setScale(t.scaleX*this._textureScale,t.scaleY*this._textureScale)};e.prototype._identityTransform=function(){this._renderDisplay.setPosition();this._renderDisplay.setRotation();this._textureScale=1;this._renderDisplay.setScale(this._textureScale);this._renderDisplay["setSkew"](0)};return e}(r.Slot);s.Slot=t})(e=t.display||(t.display={}))})(t=r.phaser||(r.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(r){var t;(function(t){var e;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t._renderTexture=null;return t}t.toString=function(){return"[class dragonBones.PhaserTextureAtlasData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);if(this._renderTexture!==null)this._renderTexture.destroy();this._renderTexture=null};t.prototype.createTexture=function(){return r.BaseObject.borrowObject(a)};Object.defineProperty(t.prototype,"renderTexture",{get:function(){return this._renderTexture},set:function(t){if(!t||this._renderTexture===t)return;if(this._renderTexture)this._renderTexture.destroy();this._renderTexture=t;for(var e in this.textures){var a=this.textures[e];var r=this._renderTexture.add(e,0,a.region.x,a.region.y,a.region.width,a.region.height);if(a.rotated){r.rotated=true;r.updateUVsInverted()}a.renderTexture=r}},enumerable:true,configurable:true});return t}(r.TextureAtlasData);t.TextureAtlasData=e;var a=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.renderTexture=null;return t}t.toString=function(){return"[class dragonBones.PhaserTextureData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);if(this.renderTexture!==null)this.renderTexture.destroy();this.renderTexture=null};return t}(r.TextureData);t.TextureData=a})(e=t.display||(t.display={}))})(t=r.phaser||(r.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(r){var t;(function(t){var e=function(a){__extends(t,a);function t(t){var e=a.call(this,t)||this;e._tempMatrix1=new r.util.TransformMatrix;e._tempMatrix2=new r.util.TransformMatrix;e._tempMatrix3=new r.util.TransformMatrix;return e}t.prototype.batchSprite=function(t,e,a){this.renderer.setPipeline(this);var r=this._tempMatrix1;var i=this._tempMatrix2;var n=this._tempMatrix3;var s=t.frame;var o=s.glTexture;var l=s.u0;var h=s.v0;var u=s.u1;var f=s.v1;var _=s.x;var p=s.y;var c=s.width;var m=s.height;var d=-t.displayOriginX+_;var y=-t.displayOriginY+p;if(t.isCropped){var v=t["_crop"];if(v.flipX!==t.flipX||v.flipY!==t.flipY)s.updateCropUVs(v,t.flipX,t.flipY);l=v.u0;h=v.v0;u=v.u1;f=v.v1;c=v.width;m=v.height;_=v.x;p=v.y;d=-t.displayOriginX+_;y=-t.displayOriginY+p}if(t.flipX){d+=c;c*=-1}if(t.flipY){y+=m;m*=-1}var g=d+c;var D=y+m;i.applyITRSC(t.x,t.y,t.rotation,t.scaleX,t.scaleY,t["skewX"]||0,t["skewY"]||0);r.copyFrom(e["matrix"]);if(a){r.multiplyWithOffset(a,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY);i.e=t.x;i.f=t.y;r.multiply(i,n)}else{i.e-=e.scrollX*t.scrollFactorX;i.f-=e.scrollY*t.scrollFactorY;r.multiply(i,n)}var T=n.getX(d,y);var b=n.getY(d,y);var A=n.getX(d,D);var P=n.getY(d,D);var S=n.getX(g,D);var O=n.getY(g,D);var x=n.getX(g,y);var B=n.getY(g,y);var M=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(t["_tintTL"],e.alpha*t["_alphaTL"]);var E=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(t["_tintTR"],e.alpha*t["_alphaTR"]);var I=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(t["_tintBL"],e.alpha*t["_alphaBL"]);var F=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(t["_tintBR"],e.alpha*t["_alphaBR"]);if(e.roundPixels){T|=0;b|=0;A|=0;P|=0;S|=0;O|=0;x|=0;B|=0}this.setTexture2D(o,0);var w=t["_isTinted"]&&t.tintFill;this.batchQuad(T,b,A,P,S,O,x,B,l,h,u,f,M,E,I,F,w)};return t}(Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline);t.TextureTintPipeline=e})(t=r.pipeline||(r.pipeline={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(t){var e;(function(a){a.FileTypes={IMAGE:"imageFile",JSON:"jsonFile",BINARY:"binaryFile",map:{imageFile:Phaser.Loader.FileTypes.ImageFile,jsonFile:Phaser.Loader.FileTypes.JSONFile,binaryFile:Phaser.Loader.FileTypes.BinaryFile},setType:function(t,e){a.FileTypes.map[t]=e},getType:function(t){return a.FileTypes.map[t]}}})(e=t.plugin||(t.plugin={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(t){var e;(function(g){var t=function(v){__extends(t,v);function t(t,e,a,r,i,n,s,o){var l=this;var h;var u;var f;var _;var p=g.FileTypes.getType(g.FileTypes.BINARY);var c=g.FileTypes.getType(g.FileTypes.JSON);var m=g.FileTypes.getType(g.FileTypes.IMAGE);var d=function(t,e,a,r){var i="json";if(r&&r.responseType){switch(r.responseType){case"arraybuffer":case"blob":i="bin";break;case"json":case"text":i="json";break}}return i==="bin"?new p(t,e,a,r):new c(t,e,a,r)};if(Phaser.Utils.Objects.IsPlainObject(e)){var y=e;_=Phaser.Utils.Objects.GetFastValue(y,"key");h=new m(t,{key:_,url:Phaser.Utils.Objects.GetFastValue(y,"textureURL"),extension:Phaser.Utils.Objects.GetFastValue(y,"textureExtension","png"),xhrSettings:Phaser.Utils.Objects.GetFastValue(y,"textureXhrSettings")});u=new c(t,{key:_+"_atlasjson",url:Phaser.Utils.Objects.GetFastValue(y,"atlasURL"),extension:Phaser.Utils.Objects.GetFastValue(y,"atlasExtension","json"),xhrSettings:Phaser.Utils.Objects.GetFastValue(y,"atlasXhrSettings")});f=d(t,_,Phaser.Utils.Objects.GetFastValue(y,"boneURL"),Phaser.Utils.Objects.GetFastValue(y,"boneXhrSettings"))}else{_=e;h=new m(t,_,a,n);u=new c(t,_+"_atlasjson",r,s);f=d(t,_,i,o)}f.cache=t["cacheManager"].custom.dragonbone;l=v.call(this,t,"dragonbone",_,[h,u,f])||this;return l}t.prototype.addToCache=function(){if(this.isReadyToProcess()){var t=this.files[0];var e=this.files[1];var a=this.files[2];e.addToCache();a.addToCache();t.addToCache();this.complete=true}};return t}(Phaser.Loader.MultiFile);g.DragonBonesFile=t})(e=t.plugin||(t.plugin={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(u){var t;(function(l){var t=function(n){__extends(t,n);function t(t,e){var a=n.call(this,t,e)||this;var r=a.game;r.cache.addCustom("dragonbone");if(a.game.config.renderType===Phaser.WEBGL){var i=a.game.renderer;if(!i.hasPipeline("PhaserTextureTintPipeline"))i.addPipeline("PhaserTextureTintPipeline",new u.pipeline.TextureTintPipeline({game:r,renderer:i}))}e.registerGameObject("dragonBones",s);e.registerGameObject("armature",o);e.registerFileType("dragonbone",h,t);return a}t.prototype.createArmature=function(t,e,a,r,i){if(i===void 0){i=1}var n=this.factory.buildArmatureDisplay(t,e,a,r,i);this.systems.displayList.add(n);this._dbInst.clock.add(n.armature);return n};t.prototype.createDragonBones=function(t,e){if(e===void 0){e=1}return this.factory.buildDragonBonesData(t,e)};Object.defineProperty(t.prototype,"factory",{get:function(){if(!this._factory){this._dbInst=new dragonBones.DragonBones(new u.util.EventDispatcher);this._factory=new u.Factory(this._dbInst,this.scene)}return this._factory},enumerable:true,configurable:true});t.prototype.createSlotDisplayPlaceholder=function(){return new u.display.SlotImage(this.scene,0,0)};t.prototype.boot=function(){this.systems.events.once("destroy",this.destroy,this);this.start()};t.prototype.start=function(){var t=this.systems.events;t.on("update",this.update,this);t.once("shutdown",this.shutdown,this)};t.prototype.update=function(t,e){this._dbInst&&this._dbInst.advanceTime(e*.001)};t.prototype.shutdown=function(){var t=this.systems.events;t.off("update",this.update,this);t.off("shutdown",this.shutdown,this)};t.prototype.destroy=function(){this.shutdown();this._factory=this._dbInst=null;this.pluginManager=this.game=this.scene=this.systems=null};return t}(Phaser.Plugins.ScenePlugin);l.DragonBonesScenePlugin=t;var s=function(t,e){if(e===void 0){e=1}return this.scene.dragonbone.createDragonBones(t,e)};var o=function(t,e,a,r){return this.scene.dragonbone.createArmature(t,e,a,r)};var h=function(t,e,a,r,i,n,s){var o=new l.DragonBonesFile(this,t,e,a,r,i,n,s);this.addFile(o.files);return this}})(t=u.plugin||(u.plugin={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(o){var t;(function(s){var t=function(i){__extends(t,i);function t(t,e,a){var r=i.call(this,a)||this;r._scene=e;r._dragonBones=t;return r}t.prototype._isSupportMesh=function(){console.warn("Mesh is not supported yet");return false};t.prototype._buildTextureAtlasData=function(t,e){if(t){t.renderTexture=e}else t=o.BaseObject.borrowObject(s.display.TextureAtlasData);return t};t.prototype._buildArmature=function(t){var e=o.BaseObject.borrowObject(o.Armature);var a=new s.display.ArmatureDisplay(this._scene);e.init(t.armature,a,a,this._dragonBones);return e};t.prototype._buildSlot=function(t,e,a){var r=o.BaseObject.borrowObject(s.display.Slot);var i=this._scene.dragonbone.createSlotDisplayPlaceholder();var n=i;r.init(e,a,i,n);return r};t.prototype.buildArmatureDisplay=function(t,e,a,r,i){if(a===void 0){a=""}if(r===void 0){r=""}if(i===void 0){i=1}var n;if(this.buildDragonBonesData(e,i)){n=this.buildArmature(t,e,a,r)}return n.display};t.prototype.buildDragonBonesData=function(t,e){if(e===void 0){e=1}var a=this._dragonBonesDataMap[t];if(!a){var r=this._scene.cache;var i=r.custom.dragonbone.get(t);if(i){a=this.parseDragonBonesData(i,t,e);var n=this._scene.textures.get(t);var s=r.json.get(t+"_atlasjson");this.parseTextureAtlasData(s,n,n.key,e)}}return a};return t}(o.BaseFactory);s.Factory=t})(t=o.phaser||(o.phaser={}))})(dragonBones||(dragonBones={})); \ No newline at end of file diff --git a/Phaser/3.x/package-lock.json b/Phaser/3.x/package-lock.json new file mode 100644 index 00000000..0ab0dfda --- /dev/null +++ b/Phaser/3.x/package-lock.json @@ -0,0 +1,401 @@ +{ + "name": "dragonbones-phaser", + "version": "5.6.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@types/parsimmon": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@types/parsimmon/-/parsimmon-1.10.0.tgz", + "integrity": "sha512-bsTIJFVQv7jnvNiC42ld2pQW2KRI+pAG243L+iATvqzy3X6+NH1obz2itRKDZZ8VVhN3wjwYax/VBGCcXzgTqQ==" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "definitelytyped-header-parser": { + "version": "github:Microsoft/definitelytyped-header-parser#d957ad0bb2f4ecb60ac04f734e0b38fbc8e70b8a", + "from": "github:Microsoft/definitelytyped-header-parser#production", + "requires": { + "@types/parsimmon": "^1.3.0", + "parsimmon": "^1.2.0" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" + }, + "dtslint": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/dtslint/-/dtslint-0.3.0.tgz", + "integrity": "sha512-3oWL8MD+2nKaxmNzrt8EAissP63hNSJ4OLr/itvNnPdAAl+7vxnjQ8p2Zdk0MNgdenqwk7GcaUDz7fQHaPgCyA==", + "requires": { + "definitelytyped-header-parser": "github:Microsoft/definitelytyped-header-parser#production", + "fs-promise": "^2.0.0", + "strip-json-comments": "^2.0.1", + "tslint": "^5.9.1", + "typescript": "^3.6.0-dev.20190720" + }, + "dependencies": { + "typescript": { + "version": "3.6.0-dev.20190720", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.0-dev.20190720.tgz", + "integrity": "sha512-TRcmAodvIOzyFE+pSKOMtaGc/pUOcTMd1zJ2SFViEb/cL53fs+IQlA2DKSNrNnt7DVGySlAIR+Xfeg1NlSD/6Q==" + } + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + }, + "fs-extra": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", + "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0" + } + }, + "fs-promise": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/fs-promise/-/fs-promise-2.0.3.tgz", + "integrity": "sha1-9k5PhUvPaJqovdy6JokW2z20aFQ=", + "requires": { + "any-promise": "^1.3.0", + "fs-extra": "^2.0.0", + "mz": "^2.6.0", + "thenify-all": "^1.6.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", + "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "parsimmon": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.12.1.tgz", + "integrity": "sha512-70VLg2g5CV8iBDYwxvREdR8qq56Y06K34+Dw8ENGvJWIsmOfs9ijB4IMPbYFVzOEhm2jRE/qTquq7GJ7tPnL7w==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "resolve": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", + "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "thenify": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", + "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, + "tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" + }, + "tslint": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", + "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", + "requires": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "requires": { + "tslib": "^1.8.1" + } + }, + "typescript": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", + "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", + "dev": true + }, + "uglify-js": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", + "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", + "dev": true, + "requires": { + "commander": "~2.20.0", + "source-map": "~0.6.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + } + } +} diff --git a/Phaser/3.x/package.json b/Phaser/3.x/package.json new file mode 100644 index 00000000..28634de1 --- /dev/null +++ b/Phaser/3.x/package.json @@ -0,0 +1,15 @@ +{ + "name": "dragonbones-phaser", + "version": "5.6.2", + "main": "", + "scripts": { + "build": "tsc && uglifyjs ./out/dragonBones.js -o ./out/dragonBones.min.js -m" + }, + "devDependencies": { + "typescript": "^2.4.2", + "uglify-js": "^3.0.26" + }, + "dependencies": { + "dtslint": "^0.3.0" + } +} diff --git a/Phaser/3.x/src/dragonBones/phaser/Factory.ts b/Phaser/3.x/src/dragonBones/phaser/Factory.ts new file mode 100644 index 00000000..d996708f --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/Factory.ts @@ -0,0 +1,85 @@ +namespace dragonBones.phaser { + export class Factory extends BaseFactory { + protected _scene: Phaser.Scene; + protected _dragonBones: DragonBones; + + constructor(dragonBones: DragonBones, scene: Phaser.Scene, dataParser?: DataParser) { + super(dataParser); + this._scene = scene; + this._dragonBones = dragonBones; + } + + protected _isSupportMesh(): boolean { + return true; + } + + protected _buildTextureAtlasData(textureAtlasData: display.TextureAtlasData, textureAtlas: Phaser.Textures.Texture): TextureAtlasData { + if (textureAtlasData) { + textureAtlasData.renderTexture = textureAtlas; + } else + textureAtlasData = BaseObject.borrowObject(display.TextureAtlasData); + + return textureAtlasData; + } + + protected _buildArmature(dataPackage: BuildArmaturePackage): Armature { + const armature = BaseObject.borrowObject(Armature); + const armatureDisplay = new display.ArmatureDisplay(this._scene); + + armature.init( + dataPackage.armature, + armatureDisplay, armatureDisplay, this._dragonBones + ); + + return armature; + } + + protected _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot { + const slot = BaseObject.borrowObject(display.Slot); + const rawDisplay = this._scene.dragonbone.createSlotDisplayPlaceholder(); + const meshDisplay = this._scene.dragonbone.createMeshDisplayPlaceholder(); + slot.init(slotData, armature, rawDisplay, meshDisplay); + + return slot; + } + + // dragonBonesName must be assigned, or can't find in cache inside + buildArmatureDisplay(armatureName: string, dragonBonesName: string, skinName: string = "", textureAtlasName: string = "", textureScale = 1.0): display.ArmatureDisplay { + let armature: dragonBones.Armature; + + if (this.buildDragonBonesData(dragonBonesName, textureScale)) { + armature = this.buildArmature(armatureName, dragonBonesName, skinName, textureAtlasName); + } + + return armature.display as display.ArmatureDisplay; + } + + buildDragonBonesData(dragonBonesName: string, textureScale = 1.0): DragonBonesData { + let data = this._dragonBonesDataMap[dragonBonesName]; + if (!data) { + const cache = this._scene.cache; + const boneRawData: any = cache.custom.dragonbone.get(dragonBonesName); + if (boneRawData) { + // parse raw data and add to cache map + data = this.parseDragonBonesData(boneRawData, dragonBonesName, textureScale); + + const texture = this._scene.textures.get(dragonBonesName); + const json = cache.json.get(`${dragonBonesName}_atlasjson`); + + this.parseTextureAtlasData(json, texture, texture.key, textureScale); + } + } + return data; + } + + /** + * - A global sound event manager. + * Sound events can be listened to uniformly from the manager. + * @version DragonBones 4.5 + * @language en_US + */ + public get soundEventManager(): display.ArmatureDisplay { + return this._dragonBones.eventManager as display.ArmatureDisplay; + } + } +} diff --git a/Phaser/3.x/src/dragonBones/phaser/display/ArmatureDisplay.ts b/Phaser/3.x/src/dragonBones/phaser/display/ArmatureDisplay.ts new file mode 100644 index 00000000..1a54e258 --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/display/ArmatureDisplay.ts @@ -0,0 +1,131 @@ +namespace dragonBones.phaser.display { + export class ArmatureDisplay extends DisplayContainer implements IArmatureProxy { + debugDraw = false; + private _armature: Armature; + + constructor(scene: Phaser.Scene) { + super(scene); + } + + dbInit(armature: Armature): void { + this._armature = armature; + } + + dbClear(): void { + this.removeAllListeners(); + if (this._armature) + this._armature.dispose(); + this._armature = null; + } + + dbUpdate(): void { + // TODO: draw debug graphics + if (this.debugDraw) { + } + } + + dispose(disposeProxy: boolean): void { + this.dbClear(); + if (disposeProxy === true) + super.destroy(); + } + + destroy(): void { + this.dispose(true); + } + + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void { + this.emit(type, eventObject); + } + + hasDBEventListener(type: EventStringType): boolean { + return this.listenerCount(type) > 0; + } + + addDBEventListener(type: EventStringType, listener: (event: EventObject) => void, scope?: any): void { + this.on(type, listener, scope); + } + + removeDBEventListener(type: EventStringType, listener: (event: EventObject) => void, scope?: any): void { + this.off(type, listener, scope); + } + + get armature(): Armature { + return this._armature; + } + + get animation(): Animation { + return this._armature.animation; + } + + getBounds(output?: Phaser.Geom.Rectangle):Phaser.Geom.Rectangle { + if (output === undefined) { output = new Phaser.Geom.Rectangle(); } + + const helpRectangle = new Phaser.Geom.Rectangle(); + const matrix = this.getBoundsTransformMatrix(); + + let isFirst = true; + + for (const slot of this._armature.getSlots()) { + const display = slot.display; + if (!display) { + continue; + } + + if (display === slot.meshDisplay) { + const vertices = (display as SlotMesh).fakeVertices; + + if (vertices && vertices.length > 0) { + helpRectangle.setTo(999999.0, 999999.0, -999999.0, -999999.0); + + for (let i = 0, l = vertices.length; i < l; i += 2) { + const x = vertices[i]; + const y = vertices[i + 1]; + if (helpRectangle.x > x) helpRectangle.x = x; + if (helpRectangle.width < x) helpRectangle.width = x; + if (helpRectangle.y > y) helpRectangle.y = y; + if (helpRectangle.height < y) helpRectangle.height = y; + } + helpRectangle.width -= helpRectangle.x; + helpRectangle.height -= helpRectangle.y; + } + else { + continue; + } + } + else if (slot._displayFrame) { + const textureData = slot._displayFrame.getTextureData(); + if (textureData) { + const scale = textureData.parent.scale; + helpRectangle.width = textureData.region.width * scale; + helpRectangle.height = textureData.region.height * scale; + + helpRectangle.x = -helpRectangle.width / 2; + helpRectangle.y = -helpRectangle.height / 2; + } + else { + continue; + } + } + + helpRectangle.width *= this.scaleX; + helpRectangle.height *= this.scaleY; + + matrix.transformPoint(helpRectangle.x, helpRectangle.y, helpRectangle); + + if(isFirst){ + output.x = helpRectangle.x; + output.y = helpRectangle.y; + output.width = helpRectangle.width; + output.height = helpRectangle.height; + isFirst = false; + }else{ + Phaser.Geom.Rectangle.Union(helpRectangle, output, output); + } + } + + + return output; + } + } +} diff --git a/Phaser/3.x/src/dragonBones/phaser/display/DisplayContainer.ts b/Phaser/3.x/src/dragonBones/phaser/display/DisplayContainer.ts new file mode 100644 index 00000000..9e31a8dd --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/display/DisplayContainer.ts @@ -0,0 +1,57 @@ +namespace dragonBones.phaser.display { + // this class will be refactored due to official Container will be removed soon. + export class DisplayContainer extends Phaser.GameObjects.Container { + private _skewX = 0; + private _skewY = 0; + private tempTransformMatrix: util.TransformMatrix; + + constructor(scene: Phaser.Scene, x?: number, y?: number, children?: Phaser.GameObjects.GameObject[]) { + super(scene, x, y, children); + this.tempTransformMatrix = new util.TransformMatrix(); + } + + pointToContainer(source: Phaser.Math.Vector2 | Phaser.Geom.Point | { x?: number, y?: number}, + output?: Phaser.Math.Vector2 | Phaser.Geom.Point | { x?: number, y?: number}): Phaser.Math.Vector2 | Phaser.Geom.Point | { x?: number, y?: number} { + if (output === undefined) + output = new Phaser.Math.Vector2(); + + if (this.parentContainer) + return this.parentContainer.pointToContainer(source, output); + + const tempMatrix = this.tempTransformMatrix; + + // No need to loadIdentity because applyITRSC overwrites every value anyway + tempMatrix.applyITRSC(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this._skewX, this._skewY); + + tempMatrix.invert(); + + tempMatrix.transformPoint(source.x, source.y, output); + + return output; + } + + get skewX(): number { + return this._skewX; + } + + set skewX(v: number) { + this._skewX = v; + } + + get skewY(): number { + return this._skewY; + } + + set skewY(v: number) { + this._skewY = v; + } + + setSkew(sx: number, sy?: number): this { + sy = sy === void 0 ? sx : sy; + this.skewX = sx; + this.skewY = sy; + + return this; + } + } +} diff --git a/Phaser/3.x/src/dragonBones/phaser/display/Slot.ts b/Phaser/3.x/src/dragonBones/phaser/display/Slot.ts new file mode 100644 index 00000000..91a76217 --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/display/Slot.ts @@ -0,0 +1,322 @@ +namespace dragonBones.phaser.display { + export class Slot extends dragonBones.Slot { + static toString(): string { + return "[class dragonBones.PhaserSlot]"; + } + + private _textureScale: number; + private _renderDisplay: SlotImage | SlotSprite | SlotMesh | DisplayContainer; + + protected _onClear(): void { + super._onClear(); + + this._textureScale = 1.0; + if (this._renderDisplay) { + this._renderDisplay.destroy(); + this._renderDisplay = null; + } + } + + protected _initDisplay(rawDisplay: any, isRetain: boolean): void { + } + + protected _disposeDisplay(prevDisplay: any, isRelease: boolean): void { + // do nothing here, prevDisplay normally is an user customized GameObject set for this slot, so user need to destroy it manually. + } + + protected _onUpdateDisplay(): void { + this._renderDisplay = this._display || this._rawDisplay; + } + + // Phaser will soone remove the functionality of nested container, so here we need to look for an alternative solution for display.add(childArmatureDisplay) + protected _addDisplay(): void { + this.armature.display.add(this._renderDisplay); + } + + protected _replaceDisplay(prevDisplay: any): void { + if (!this._renderDisplay["setSkew"]) { + console.warn(`please call dragonBones.phaser.util.extendSkew to mix skew component into your display object, + and set its pipeline to 'PhaserTextureTintPipeline' by calling 'setPiepline' method, more detail please refer to the 'ReplaceSlotDisplay.ts' example`); + return; + } + + this.armature.display.replace(prevDisplay, this._renderDisplay); + this._renderDisplay.parentContainer = this.armature.display; + } + + protected _removeDisplay(): void { + // can't use this._armature.display.remove here, perphaps this._renderDisplay is a child of armature. + this._renderDisplay.parentContainer.remove(this._renderDisplay); + } + + protected _updateDisplayData(): void { + super._updateDisplayData(); + + if (this.armature.replacedTexture !== null) { + this._textureDirty = true; + } + } + + protected _updateZOrder(): void { + if (this._renderDisplay.depth === this._zOrder) return; + this._renderDisplay.setDepth(this._zOrder); + } + + _updateVisible(): void { + this._renderDisplay.setVisible(this._parent.visible && this._visible); + } + + protected _updateBlendMode(): void { + let mode = Phaser.BlendModes.NORMAL; + switch (this._blendMode) { + case BlendMode.Normal: + mode = Phaser.BlendModes.NORMAL; + break; + case BlendMode.Add: + mode = Phaser.BlendModes.ADD; + break; + case BlendMode.Darken: + mode = Phaser.BlendModes.DARKEN; + break; + case BlendMode.Difference: + mode = Phaser.BlendModes.DIFFERENCE; + break; + case BlendMode.HardLight: + mode = Phaser.BlendModes.HARD_LIGHT; + break; + case BlendMode.Lighten: + mode = Phaser.BlendModes.LIGHTEN; + break; + case BlendMode.Multiply: + mode = Phaser.BlendModes.MULTIPLY; + break; + case BlendMode.Overlay: + mode = Phaser.BlendModes.OVERLAY; + break; + case BlendMode.Screen: + mode = Phaser.BlendModes.SCREEN; + break; + default: + break; + } + + this._renderDisplay.setBlendMode(mode); + } + + protected _updateColor(): void { + const c = this._colorTransform; + + const a = this._globalAlpha * c.alphaMultiplier + c.alphaOffset; + this._renderDisplay.setAlpha(a); + + if (this._renderDisplay instanceof DisplayContainer) return; + + const r = 0xff * c.redMultiplier + c.redOffset; + const g = 0xff * c.greenMultiplier + c.greenOffset; + const b = 0xff * c.blueMultiplier + c.blueOffset; + const rgb = (r << 16) | (g << 8) | b; + this._renderDisplay.setTint(rgb); + } + + protected _updateFrame(): void { + if (this._renderDisplay instanceof DisplayContainer) return; + + let currentTextureData = this._textureData as TextureData; + + if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) { + let currentTextureAtlasData = currentTextureData.parent as TextureAtlasData; + if (this.armature.replacedTexture !== null) { // Update replaced texture atlas. + if (this.armature._replaceTextureAtlasData === null) { + currentTextureAtlasData = BaseObject.borrowObject(TextureAtlasData); + currentTextureAtlasData.copyFrom(currentTextureData.parent); + currentTextureAtlasData.renderTexture = this.armature.replacedTexture; + this.armature._replaceTextureAtlasData = currentTextureAtlasData; + } else + currentTextureAtlasData = this.armature._replaceTextureAtlasData as TextureAtlasData; + + currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name) as TextureData; + } + + const frame = currentTextureData.renderTexture; + if (frame !== null) { + if (this._geometryData !== null) { // Mesh. + const data = this._geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexCount]; + const triangleCount = intArray[this._geometryData.offset + BinaryOffset.GeometryTriangleCount]; + let vertexOffset = intArray[this._geometryData.offset + BinaryOffset.GeometryFloatOffset]; + + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + + const uvOffset = vertexOffset + vertexCount * 2; + const scale = this._armature._armatureData.scale; + + const meshDisplay = this._renderDisplay as SlotMesh; + const region = currentTextureData.region; + + meshDisplay.fakeVertices = new Float32Array(vertexCount * 2) as any; + meshDisplay.fakeUvs = new Float32Array(vertexCount * 2) as any; + meshDisplay.fakeIndices = new Uint16Array(triangleCount * 3); + + for (let i = 0, l = vertexCount * 2; i < l; ++i) { + meshDisplay.fakeVertices[i] = floatArray[vertexOffset + i] * scale; + } + + for (let i = 0; i < triangleCount * 3; ++i) { + meshDisplay.fakeIndices[i] = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexIndices + i]; + } + + for (let i = 0, l = vertexCount * 2; i < l; i += 2) { + const u = floatArray[uvOffset + i]; + const v = floatArray[uvOffset + i + 1]; + + if (currentTextureData.rotated) { + meshDisplay.fakeUvs[i] = (region.x + (1.0 - v) * region.width) / currentTextureAtlasData.width; + meshDisplay.fakeUvs[i + 1] = (region.y + u * region.height) / currentTextureAtlasData.height; + } + else { + meshDisplay.fakeUvs[i] = (region.x + u * region.width) / currentTextureAtlasData.width; + meshDisplay.fakeUvs[i + 1] = (region.y + v * region.height) / currentTextureAtlasData.height; + } + } + + this._textureScale = 1.0; + meshDisplay.texture = frame.texture; + meshDisplay.frame = frame; + + meshDisplay.updateVertices(); + + const isSkinned = this._geometryData.weight !== null; + const isSurface = this._parent._boneData.type !== BoneType.Bone; + if (isSkinned || isSurface) { + this._identityTransform(); + } + } else { // normal texture. + this._renderDisplay.texture = frame.texture; + this._renderDisplay.frame = frame; + this._renderDisplay.setDisplayOrigin(this._pivotX, this._pivotY); + this._textureScale = currentTextureData.parent.scale * this.armature.armatureData.scale; + this._renderDisplay.setScale(this._textureScale); + } + + this._visibleDirty = true; + return; + } + } else { + this._renderDisplay.x = 0.0; + this._renderDisplay.y = 0.0; + this._renderDisplay.setTexture(undefined); + } + } + + protected _updateMesh(): void { + const scale = this._armature._armatureData.scale; + const deformVertices = (this._displayFrame as DisplayFrame).deformVertices; + const bones = this._geometryBones; + const geometryData = this._geometryData as GeometryData; + const weightData = geometryData.weight; + + const hasDeform = deformVertices.length > 0 && geometryData.inheritDeform; + const meshDisplay = this._renderDisplay as SlotMesh; + + if (weightData !== null) { + const data = geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount]; + let weightFloatOffset = intArray[weightData.offset + BinaryOffset.WeigthFloatOffset]; + + if (weightFloatOffset < 0) { + weightFloatOffset += 65536; // Fixed out of bouds bug. + } + + for ( + let i = 0, iD = 0, iB = weightData.offset + BinaryOffset.WeigthBoneIndices + bones.length, iV = weightFloatOffset, iF = 0; + i < vertexCount; + ++i + ) { + const boneCount = intArray[iB++]; + let xG = 0.0, yG = 0.0; + + for (let j = 0; j < boneCount; ++j) { + const boneIndex = intArray[iB++]; + const bone = bones[boneIndex]; + + if (bone !== null) { + const matrix = bone.globalTransformMatrix; + const weight = floatArray[iV++]; + let xL = floatArray[iV++] * scale; + let yL = floatArray[iV++] * scale; + + if (hasDeform) { + xL += deformVertices[iF++]; + yL += deformVertices[iF++]; + } + + xG += (matrix.a * xL + matrix.c * yL + matrix.tx) * weight; + yG += (matrix.b * xL + matrix.d * yL + matrix.ty) * weight; + } + } + + meshDisplay.fakeVertices[iD++] = xG; + meshDisplay.fakeVertices[iD++] = yG; + } + } + else { + const isSurface = this._parent._boneData.type !== BoneType.Bone; + const data = geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount]; + let vertexOffset = intArray[geometryData.offset + BinaryOffset.GeometryFloatOffset]; + + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + + for (let i = 0, l = vertexCount * 2; i < l; i += 2) { + let x = floatArray[vertexOffset + i] * scale; + let y = floatArray[vertexOffset + i + 1] * scale; + + if (hasDeform) { + x += deformVertices[i]; + y += deformVertices[i + 1]; + } + + if (isSurface) { + const matrix = (this._parent as Surface)._getGlobalTransformMatrix(x, y); + meshDisplay.fakeVertices[i] = matrix.a * x + matrix.c * y + matrix.tx; + meshDisplay.fakeVertices[i + 1] = matrix.b * x + matrix.d * y + matrix.ty; + } + else { + meshDisplay.fakeVertices[i] = x; + meshDisplay.fakeVertices[i + 1] = y; + } + } + } + meshDisplay.updateVertices(); + } + + protected _updateTransform(): void { + this.updateGlobalTransform(); + + const transform = this.global; + this._renderDisplay.x = transform.x; // No need to calcuate pivot offset manually here as Phaser.GameObjects.GameObject takes that into account already. + this._renderDisplay.y = transform.y; + this._renderDisplay.rotation = transform.rotation; + this._renderDisplay["setSkew"](transform.skew, 0); + this._renderDisplay.setScale(transform.scaleX * this._textureScale, transform.scaleY * this._textureScale); + } + + protected _identityTransform(): void { + this._renderDisplay.setPosition(); + this._renderDisplay.setRotation(); + this._textureScale = 1.0; + this._renderDisplay.setScale(this._textureScale); + this._renderDisplay["setSkew"](0); + } + } +} diff --git a/Phaser/3.x/src/dragonBones/phaser/display/SlotImage.ts b/Phaser/3.x/src/dragonBones/phaser/display/SlotImage.ts new file mode 100644 index 00000000..45c3d055 --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/display/SlotImage.ts @@ -0,0 +1,10 @@ +namespace dragonBones.phaser.display { + export class SlotImage extends Phaser.GameObjects.Image { + constructor(scene: Phaser.Scene, x: number, y: number, texture?: string, frame?: string | number) { + super(scene, x, y, texture, frame); + this.setPipeline("PhaserTextureTintPipeline"); // use customized pipeline + } + } + + util.extendSkew(SlotImage); // skew mixin +} diff --git a/Phaser/3.x/src/dragonBones/phaser/display/SlotMesh.ts b/Phaser/3.x/src/dragonBones/phaser/display/SlotMesh.ts new file mode 100644 index 00000000..845ea3bb --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/display/SlotMesh.ts @@ -0,0 +1,47 @@ +namespace dragonBones.phaser.display { + export class SlotMesh extends Phaser.GameObjects.Mesh { + fakeIndices: Uint16Array; + fakeVertices: Uint16Array; + fakeUvs: Uint16Array; + + constructor(scene: Phaser.Scene, x: number, y: number, vertices: number[], uv: number[], colors: number[], alphas: number[], texture: string, frame?: string | integer) { + super(scene, x, y, vertices, uv, colors, alphas, texture, frame); + this.setPipeline("PhaserTextureTintPipeline"); // use customized pipeline + } + + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer){ + // NOTHING + } + + updateVertices() { + const fakeIndices = this.fakeIndices; + const fakeVertices = this.fakeVertices; + const fakeUvs = this.fakeUvs; + + this.vertices = new Float32Array(fakeIndices.length * 2) as any; + this.uv = new Float32Array(fakeIndices.length * 2) as any; + this.alphas = new Uint32Array(fakeIndices.length) as any; + this.colors = new Uint32Array(fakeIndices.length) as any; + + for (let i = 0; i < fakeIndices.length; i++) { + this.vertices[i * 2] = fakeVertices[fakeIndices[i] * 2]; + this.vertices[i * 2 + 1] = fakeVertices[fakeIndices[i] * 2 + 1]; + + this.uv[i * 2] = fakeUvs[fakeIndices[i] * 2]; + this.uv[i * 2 + 1] = fakeUvs[fakeIndices[i] * 2 + 1]; + + this.alphas[i] = 1.0; + this.colors[i] = 0xFFFFFF; + } + + // this.tintFill = true; + // for (let i = 0; i < fakeIndices.length / 3; i++) { + // this.colors[i * 3] = 0xFF0000; + // this.colors[i * 3 + 1] = 0x00FF00; + // this.colors[i * 3 + 2] = 0x0000FF; + // } + } + } + + util.extendSkew(SlotMesh); // skew mixin +} diff --git a/Phaser/3.x/src/dragonBones/phaser/display/SlotSprite.ts b/Phaser/3.x/src/dragonBones/phaser/display/SlotSprite.ts new file mode 100644 index 00000000..e5e38440 --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/display/SlotSprite.ts @@ -0,0 +1,10 @@ +namespace dragonBones.phaser.display { + export class SlotSprite extends Phaser.GameObjects.Sprite { + constructor(scene: Phaser.Scene, x: number, y: number, texture?: string, frame?: string | number) { + super(scene, x, y, texture, frame); + this.setPipeline("PhaserTextureTintPipeline"); // use customized pipeline + } + } + + util.extendSkew(SlotSprite); // skew mixin +} diff --git a/Phaser/3.x/src/dragonBones/phaser/display/TextureAtlasData.ts b/Phaser/3.x/src/dragonBones/phaser/display/TextureAtlasData.ts new file mode 100644 index 00000000..6cb68018 --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/display/TextureAtlasData.ts @@ -0,0 +1,69 @@ +namespace dragonBones.phaser.display { + export class TextureAtlasData extends dragonBones.TextureAtlasData { + static toString(): string { + return "[class dragonBones.PhaserTextureAtlasData]"; + } + + private _renderTexture: Phaser.Textures.Texture = null; + + protected _onClear(): void { + super._onClear(); + + if (this._renderTexture !== null) + this._renderTexture.destroy(); + + this._renderTexture = null; + } + + createTexture(): TextureData { + return BaseObject.borrowObject(TextureData); + } + + get renderTexture(): Phaser.Textures.Texture { + return this._renderTexture; + } + + // TODO: test set value runtime + set renderTexture(value: Phaser.Textures.Texture) { + if (!value || this._renderTexture === value) + return; + + if (this._renderTexture) + this._renderTexture.destroy(); + + this._renderTexture = value; + + for (const k in this.textures) { + const data = this.textures[k] as TextureData; + const frame = this._renderTexture.add( + k, + 0, // all textures were added through `textures.addImage`, so their sourceIndex are all 0 + data.region.x, data.region.y, + data.region.width, data.region.height + ); + if (data.rotated) { + frame.rotated = true; + frame.updateUVsInverted(); + } + data.renderTexture = frame; + } + } + } + + export class TextureData extends dragonBones.TextureData { + static toString(): string { + return "[class dragonBones.PhaserTextureData]"; + } + + renderTexture: Phaser.Textures.Frame = null; // Initial value. + + protected _onClear(): void { + super._onClear(); + + if (this.renderTexture !== null) + this.renderTexture.destroy(); + + this.renderTexture = null; + } + } +} diff --git a/Phaser/3.x/src/dragonBones/phaser/pipeline/TextureTintPipeline.ts b/Phaser/3.x/src/dragonBones/phaser/pipeline/TextureTintPipeline.ts new file mode 100644 index 00000000..71d93ea4 --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/pipeline/TextureTintPipeline.ts @@ -0,0 +1,130 @@ +namespace dragonBones.phaser.pipeline { + export class TextureTintPipeline extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline { + private _tempMatrix1: util.TransformMatrix; + private _tempMatrix2: util.TransformMatrix; + private _tempMatrix3: util.TransformMatrix; + + constructor(config: any) { + super(config); + this._tempMatrix1 = new util.TransformMatrix(); + this._tempMatrix2 = new util.TransformMatrix(); + this._tempMatrix3 = new util.TransformMatrix(); + } + + batchSprite(sprite: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix): void { + this.renderer.setPipeline(this); + + const camMatrix = this._tempMatrix1; + const spriteMatrix = this._tempMatrix2; + const calcMatrix = this._tempMatrix3; + + const frame = sprite.frame; + const texture = frame.glTexture; + + let u0 = frame.u0; + let v0 = frame.v0; + let u1 = frame.u1; + let v1 = frame.v1; + let frameX = frame.x; + let frameY = frame.y; + let frameWidth = frame.width; + let frameHeight = frame.height; + + let x = -sprite.displayOriginX + frameX; + let y = -sprite.displayOriginY + frameY; + + if (sprite.isCropped) { + const crop = sprite["_crop"]; + + if (crop.flipX !== sprite.flipX || crop.flipY !== sprite.flipY) + frame.updateCropUVs(crop, sprite.flipX, sprite.flipY); + + u0 = crop.u0; + v0 = crop.v0; + u1 = crop.u1; + v1 = crop.v1; + + frameWidth = crop.width; + frameHeight = crop.height; + + frameX = crop.x; + frameY = crop.y; + + x = -sprite.displayOriginX + frameX; + y = -sprite.displayOriginY + frameY; + } + + if (sprite.flipX) { + x += frameWidth; + frameWidth *= -1; + } + + if (sprite.flipY) { + y += frameHeight; + frameHeight *= -1; + } + + const xw = x + frameWidth; + const yh = y + frameHeight; + + spriteMatrix.applyITRSC(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY, sprite["skewX"] || 0, sprite["skewY"] || 0); + + camMatrix.copyFrom(camera["matrix"]); + + if (parentTransformMatrix) { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * sprite.scrollFactorX, -camera.scrollY * sprite.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = sprite.x; + spriteMatrix.f = sprite.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } else { + spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX; + spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + let tx0 = calcMatrix.getX(x, y); + let ty0 = calcMatrix.getY(x, y); + + let tx1 = calcMatrix.getX(x, yh); + let ty1 = calcMatrix.getY(x, yh); + + let tx2 = calcMatrix.getX(xw, yh); + let ty2 = calcMatrix.getY(xw, yh); + + let tx3 = calcMatrix.getX(xw, y); + let ty3 = calcMatrix.getY(xw, y); + + const tintTL = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintTL"], camera.alpha * sprite["_alphaTL"]); + const tintTR = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintTR"], camera.alpha * sprite["_alphaTR"]); + const tintBL = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintBL"], camera.alpha * sprite["_alphaBL"]); + const tintBR = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintBR"], camera.alpha * sprite["_alphaBR"]); + + if (camera.roundPixels) { + tx0 |= 0; + ty0 |= 0; + + tx1 |= 0; + ty1 |= 0; + + tx2 |= 0; + ty2 |= 0; + + tx3 |= 0; + ty3 |= 0; + } + + this.setTexture2D(texture, 0); + + const tintEffect = (sprite["_isTinted"] && sprite.tintFill); + + this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); + } + } +} diff --git a/Phaser/3.x/src/dragonBones/phaser/plugin/DragonBonesFile.ts b/Phaser/3.x/src/dragonBones/phaser/plugin/DragonBonesFile.ts new file mode 100644 index 00000000..2398dbf2 --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/plugin/DragonBonesFile.ts @@ -0,0 +1,91 @@ +namespace dragonBones.phaser.plugin { + export class DragonBonesFile extends Phaser.Loader.MultiFile { + constructor(loader: Phaser.Loader.LoaderPlugin, + key: string | object, + textureURL?: string, + atlasURL?: string, + boneURL?: string, + textureXhrSettings?: XHRSettingsObject, + atlasXhrSettings?: XHRSettingsObject, + boneXhrSettings?: XHRSettingsObject) { + let image: Phaser.Loader.FileTypes.ImageFile; + let data: Phaser.Loader.FileTypes.JSONFile; + let boneData: Phaser.Loader.File; + + let keyName: string; + + const binFileType = FileTypes.getType(FileTypes.BINARY); + const jsonFileType = FileTypes.getType(FileTypes.JSON); + const imageFileType = FileTypes.getType(FileTypes.IMAGE); + + const createBoneFileByType = (loader: Phaser.Loader.LoaderPlugin, key: string, boneURL: string, boneXhrSettings?: XHRSettingsObject): Phaser.Loader.File => { + let type = "json"; + if (boneXhrSettings && boneXhrSettings.responseType) { + switch (boneXhrSettings.responseType) { + case "arraybuffer": + case "blob": + type = "bin"; + break; + case "json": + case "text": + type = "json"; + break; + } + } + + return type === "bin" ? + new binFileType(loader, key, boneURL, boneXhrSettings) : + new jsonFileType(loader, key, boneURL, boneXhrSettings); + }; + + if (Phaser.Utils.Objects.IsPlainObject(key as object)) { + // key is actually a config object + const config = key as object; + keyName = Phaser.Utils.Objects.GetFastValue(config, 'key'); + + image = new imageFileType(loader, { + key: keyName, + url: Phaser.Utils.Objects.GetFastValue(config, 'textureURL'), + extension: Phaser.Utils.Objects.GetFastValue(config, 'textureExtension', 'png'), + xhrSettings: Phaser.Utils.Objects.GetFastValue(config, 'textureXhrSettings') + }); + + data = new jsonFileType(loader, { + key: keyName + "_atlasjson", + url: Phaser.Utils.Objects.GetFastValue(config, 'atlasURL'), + extension: Phaser.Utils.Objects.GetFastValue(config, 'atlasExtension', 'json'), + xhrSettings: Phaser.Utils.Objects.GetFastValue(config, 'atlasXhrSettings') + }); + + boneData = createBoneFileByType(loader, keyName, + Phaser.Utils.Objects.GetFastValue(config, 'boneURL'), + Phaser.Utils.Objects.GetFastValue(config, 'boneXhrSettings') + ); + } else { + keyName = key as string; + + image = new imageFileType(loader, keyName, textureURL, textureXhrSettings); + data = new jsonFileType(loader, keyName + "_atlasjson", atlasURL, atlasXhrSettings); + boneData = createBoneFileByType(loader, keyName, boneURL, boneXhrSettings); + } + + boneData.cache = loader["cacheManager"].custom.dragonbone; + + super(loader, 'dragonbone', keyName, [ image, data, boneData ]); + } + + addToCache(): void { + if (this.isReadyToProcess()) { + const image = this.files[0]; + const json = this.files[1]; + const bone = this.files[2]; + + json.addToCache(); + bone.addToCache(); + image.addToCache(); + + this.complete = true; + } + } + } +} diff --git a/Phaser/3.x/src/dragonBones/phaser/plugin/DragonBonesPlugin.ts b/Phaser/3.x/src/dragonBones/phaser/plugin/DragonBonesPlugin.ts new file mode 100644 index 00000000..87456775 --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/plugin/DragonBonesPlugin.ts @@ -0,0 +1,117 @@ +namespace dragonBones.phaser.plugin { + export class DragonBonesScenePlugin extends Phaser.Plugins.ScenePlugin { + protected _dbInst: dragonBones.DragonBones; + protected _factory: Factory; + + constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager) { + super(scene, pluginManager); + + const game = this.game; + + // bone data store + game.cache.addCustom("dragonbone"); + + if (this.game.config.renderType === Phaser.WEBGL) { + const renderer = this.game.renderer as Phaser.Renderer.WebGL.WebGLRenderer; + if (!renderer.hasPipeline('PhaserTextureTintPipeline')) + renderer.addPipeline('PhaserTextureTintPipeline', new pipeline.TextureTintPipeline({ game, renderer })); + } + + // Add dragonBones only + pluginManager.registerGameObject("dragonBones", CreateDragonBonesRegisterHandler); + // Add armature, this will add dragonBones when not exist + pluginManager.registerGameObject("armature", CreateArmatureRegisterHandler); + pluginManager.registerFileType("dragonbone", DragonBoneFileRegisterHandler, scene); + } + + createArmature(armature: string, dragonBones?: string, skinName?: string, atlasTextureName?: string, textureScale = 1.0): display.ArmatureDisplay { + const display = this.factory.buildArmatureDisplay(armature, dragonBones, skinName, atlasTextureName, textureScale); + this.systems.displayList.add(display); + // use db.clock instead, if here we just use this.systems.updateList.add(display), that will cause the db event is dispatched with 1 or more frames delay + this._dbInst.clock.add(display.armature); + + return display; + } + + createDragonBones(dragonBonesName: string, textureScale = 1.0): DragonBonesData { + return this.factory.buildDragonBonesData(dragonBonesName, textureScale); + } + + get factory(): Factory { // lazy instancing + if (!this._factory) { + this._dbInst = new dragonBones.DragonBones(new util.EventDispatcher()); + this._factory = new Factory(this._dbInst, this.scene); + } + + return this._factory; + } + + /* + * Slot has a default display, usually it is a transparent image, here you could create a display whatever you want as the default one which - + * has both skewX / skewY attributes and use "PhaserTextureTintPipeline" to render itself, or simply just use SlotImage or SlotSprite. + */ + createSlotDisplayPlaceholder(): display.SlotImage | display.SlotSprite { + return new display.SlotImage(this.scene, 0, 0); + } + + boot(): void { + this.systems.events.once('destroy', this.destroy, this); + this.start(); + } + + start(): void { + const ee = this.systems.events; + + ee.on('update', this.update, this); + ee.once('shutdown', this.shutdown, this); + } + + private update(time: number, delta: number): void { + this._dbInst && this._dbInst.advanceTime(delta * 0.001); + } + + shutdown(): void { + const ee = this.systems.events; + + ee.off('update', this.update, this); + ee.off('shutdown', this.shutdown, this); + } + + destroy(): void { + this.shutdown(); + + this._factory = + this._dbInst = null; + + this.pluginManager = + this.game = + this.scene = + this.systems = null; + } + + createMeshDisplayPlaceholder(): Phaser.GameObjects.Mesh { + return new display.SlotMesh(this.scene, 0, 0, [], [], [], [], null, null); + } + } + + const CreateDragonBonesRegisterHandler = function(dragonBonesName: string, textureScale = 1.0): DragonBonesData { + return this.scene.dragonbone.createDragonBones(dragonBonesName, textureScale); + }; + + const CreateArmatureRegisterHandler = function(armature: string, dragonBones?: string, skinName?: string, atlasTextureName?: string): display.ArmatureDisplay { + return this.scene.dragonbone.createArmature(armature, dragonBones, skinName, atlasTextureName); + }; + + const DragonBoneFileRegisterHandler = function(dragonbonesName: string | object, + textureURL?: string, + atlasURL?: string, + boneURL?: string, + textureXhrSettings?: XHRSettingsObject, + atlasXhrSettings?: XHRSettingsObject, + boneXhrSettings?: XHRSettingsObject) { + const multifile = new DragonBonesFile(this, dragonbonesName, textureURL, atlasURL, boneURL, textureXhrSettings, atlasXhrSettings, boneXhrSettings); + this.addFile(multifile.files); + + return this; + }; +} diff --git a/Phaser/3.x/src/dragonBones/phaser/plugin/FileTypes.ts b/Phaser/3.x/src/dragonBones/phaser/plugin/FileTypes.ts new file mode 100644 index 00000000..5db2a5ce --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/plugin/FileTypes.ts @@ -0,0 +1,25 @@ +namespace dragonBones.phaser.plugin { + interface FileTypeClass { + new (... args: any[]): Phaser.Loader.File; + } + + export const FileTypes = { + IMAGE: "imageFile", + JSON: "jsonFile", + BINARY: "binaryFile", + + map: { + imageFile: Phaser.Loader.FileTypes.ImageFile, + jsonFile: Phaser.Loader.FileTypes.JSONFile, + binaryFile: Phaser.Loader.FileTypes.BinaryFile + }, + + setType: (type: string, clazz: FileTypeClass): void => { + FileTypes.map[type] = clazz; + }, + + getType: (type: string): FileTypeClass => { + return FileTypes.map[type]; + } + }; +} diff --git a/Phaser/3.x/src/dragonBones/phaser/util/EventDispatcher.ts b/Phaser/3.x/src/dragonBones/phaser/util/EventDispatcher.ts new file mode 100644 index 00000000..ba68cfdd --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/util/EventDispatcher.ts @@ -0,0 +1,19 @@ +namespace dragonBones.phaser.util { + export class EventDispatcher extends Phaser.Events.EventEmitter implements IEventDispatcher { + hasDBEventListener(type: EventStringType): boolean { + return this.listenerCount(type) > 0; + } + + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void { + this.emit(type, eventObject); + } + + addDBEventListener(type: EventStringType, listener: (e: EventObject) => void, thisObject?: any): void { + this.on(type, listener, thisObject); + } + + removeDBEventListener(type: EventStringType, listener: (e: EventObject) => void, thisObject?: any): void { + this.off(type, listener, thisObject); + } + } +} diff --git a/Phaser/3.x/src/dragonBones/phaser/util/SkewComponent.ts b/Phaser/3.x/src/dragonBones/phaser/util/SkewComponent.ts new file mode 100644 index 00000000..4419e6f9 --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/util/SkewComponent.ts @@ -0,0 +1,37 @@ +namespace dragonBones.phaser.util { + export const Skew = { + getSkewX(): number { + return this._skewX || 0; + }, + setSkewX(v: number) { + this._skewX = v; + }, + getSkewY(): number { + return this._skewY || 0; + }, + setSkewY(v: number) { + this._skewY = v; + }, + setSkew(sx: number, sy?: number): void { + sy = sy === void 0 ? sx : sy; + this._skewX = sx; + this._skewY = sy; + } + }; + + export const extendSkew = function(clazz: any): void { + Object.defineProperty(clazz.prototype, "skewX", { + get: Skew.getSkewX, + set: Skew.setSkewX, + enumerable: true, + configurable: true + }); + Object.defineProperty(clazz.prototype, "skewY", { + get: Skew.getSkewY, + set: Skew.setSkewY, + enumerable: true, + configurable: true + }); + clazz.prototype.setSkew = Skew.setSkew; + }; +} diff --git a/Phaser/3.x/src/dragonBones/phaser/util/TransformMatrix.ts b/Phaser/3.x/src/dragonBones/phaser/util/TransformMatrix.ts new file mode 100644 index 00000000..042f330f --- /dev/null +++ b/Phaser/3.x/src/dragonBones/phaser/util/TransformMatrix.ts @@ -0,0 +1,64 @@ +namespace dragonBones.phaser.util { + export class TransformMatrix extends Phaser.GameObjects.Components.TransformMatrix { + constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number) { + super(a, b, c, d, tx, ty); + this.decomposedMatrix.skewX = 0; + this.decomposedMatrix.skewY = 0; + } + + decomposeMatrix(): any { + // sort out rotation / skew.. + const a = this.a; + const b = this.b; + const c = this.c; + const d = this.d; + + const skewX = -Math.atan2(-c, d); + const skewY = Math.atan2(b, a); + + const delta = Math.abs(skewX + skewY); + + if (delta < 0.00001 || Math.abs(Phaser.Math.PI2 - delta) < 0.00001) { + this.decomposedMatrix.rotation = skewY; + if (a < 0 && d >= 0) + this.decomposedMatrix.rotation += (this.decomposedMatrix.rotation <= 0) ? Math.PI : -Math.PI; + + this.decomposedMatrix.skewX = this.decomposedMatrix.skewY = 0; + } else { + this.decomposedMatrix.rotation = 0; + this.decomposedMatrix.skewX = skewX; + this.decomposedMatrix.skewY = skewY; + } + + // next set scale + this.decomposedMatrix.scaleX = Math.sqrt((a * a) + (b * b)); + this.decomposedMatrix.scaleY = Math.sqrt((c * c) + (d * d)); + + // next set position + this.decomposedMatrix.translateX = this.tx; + this.decomposedMatrix.translateY = this.ty; + + return this.decomposedMatrix; + } + + applyITRSC(x: number, y: number, rotation: number, scaleX: number, scaleY: number, skewX: number, skewY: number): this { + this.a = Math.cos(rotation - skewY) * scaleX; + this.b = Math.sin(rotation - skewY) * scaleX; + this.c = -Math.sin(rotation + skewX) * scaleY; + this.d = Math.cos(rotation + skewX) * scaleY; + + this.tx = x; + this.ty = y; + + return this; + } + + get skewX(): number { + return -Math.atan2(-this.c, this.d); + } + + get skewY(): number { + return Math.atan2(this.b, this.a); + } + } +} diff --git a/Phaser/3.x/tsconfig.json b/Phaser/3.x/tsconfig.json new file mode 100644 index 00000000..467f59fb --- /dev/null +++ b/Phaser/3.x/tsconfig.json @@ -0,0 +1,87 @@ +{ + "compilerOptions": { + "watch": false, + "sourceMap": false, + "declaration": true, + "stripInternal": true, + "alwaysStrict": true, + "noUnusedLocals": false, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "es5", + "outFile": "out/dragonBones.js", + "lib": [ + "es5", + "dom", + "es2015.promise" + ] + }, + "exclude": [ + "node_modules", + "out" + ], + "files": [ + "./types/phaser.d.ts", + + "../../DragonBones/src/dragonBones/core/DragonBones.ts", + "../../DragonBones/src/dragonBones/core/BaseObject.ts", + + "../../DragonBones/src/dragonBones/geom/Matrix.ts", + "../../DragonBones/src/dragonBones/geom/Transform.ts", + "../../DragonBones/src/dragonBones/geom/ColorTransform.ts", + "../../DragonBones/src/dragonBones/geom/Point.ts", + "../../DragonBones/src/dragonBones/geom/Rectangle.ts", + + "../../DragonBones/src/dragonBones/model/UserData.ts", + "../../DragonBones/src/dragonBones/model/DragonBonesData.ts", + "../../DragonBones/src/dragonBones/model/ArmatureData.ts", + "../../DragonBones/src/dragonBones/model/ConstraintData.ts", + "../../DragonBones/src/dragonBones/model/CanvasData.ts", + "../../DragonBones/src/dragonBones/model/SkinData.ts", + "../../DragonBones/src/dragonBones/model/DisplayData.ts", + "../../DragonBones/src/dragonBones/model/BoundingBoxData.ts", + "../../DragonBones/src/dragonBones/model/AnimationData.ts", + "../../DragonBones/src/dragonBones/model/AnimationConfig.ts", + "../../DragonBones/src/dragonBones/model/TextureAtlasData.ts", + + "../../DragonBones/src/dragonBones/armature/IArmatureProxy.ts", + "../../DragonBones/src/dragonBones/armature/Armature.ts", + "../../DragonBones/src/dragonBones/armature/TransformObject.ts", + "../../DragonBones/src/dragonBones/armature/Bone.ts", + "../../DragonBones/src/dragonBones/armature/Surface.ts", + "../../DragonBones/src/dragonBones/armature/Slot.ts", + "../../DragonBones/src/dragonBones/armature/Constraint.ts", + + "../../DragonBones/src/dragonBones/animation/IAnimatable.ts", + "../../DragonBones/src/dragonBones/animation/WorldClock.ts", + "../../DragonBones/src/dragonBones/animation/Animation.ts", + "../../DragonBones/src/dragonBones/animation/AnimationState.ts", + "../../DragonBones/src/dragonBones/animation/BaseTimelineState.ts", + "../../DragonBones/src/dragonBones/animation/TimelineState.ts", + + "../../DragonBones/src/dragonBones/event/EventObject.ts", + "../../DragonBones/src/dragonBones/event/IEventDispatcher.ts", + + "../../DragonBones/src/dragonBones/parser/DataParser.ts", + "../../DragonBones/src/dragonBones/parser/ObjectDataParser.ts", + "../../DragonBones/src/dragonBones/parser/BinaryDataParser.ts", + + "../../DragonBones/src/dragonBones/factory/BaseFactory.ts", + + "./src/dragonBones/phaser/util/EventDispatcher.ts", + "./src/dragonBones/phaser/util/SkewComponent.ts", + "./src/dragonBones/phaser/util/TransformMatrix.ts", + "./src/dragonBones/phaser/display/DisplayContainer.ts", + "./src/dragonBones/phaser/display/ArmatureDisplay.ts", + "./src/dragonBones/phaser/display/SlotImage.ts", + "./src/dragonBones/phaser/display/SlotSprite.ts", + "./src/dragonBones/phaser/display/SlotMesh.ts", + "./src/dragonBones/phaser/display/Slot.ts", + "./src/dragonBones/phaser/display/TextureAtlasData.ts", + "./src/dragonBones/phaser/pipeline/TextureTintPipeline.ts", + "./src/dragonBones/phaser/plugin/FileTypes.ts", + "./src/dragonBones/phaser/plugin/DragonBonesFile.ts", + "./src/dragonBones/phaser/plugin/DragonBonesPlugin.ts", + "./src/dragonBones/phaser/Factory.ts" + ] +} diff --git a/Phaser/3.x/tslint.json b/Phaser/3.x/tslint.json new file mode 100644 index 00000000..bc15889a --- /dev/null +++ b/Phaser/3.x/tslint.json @@ -0,0 +1,9 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-namespace": false, + "file-name-casing": false, + "only-arrow-functions": false, + "interface-name": false + } +} diff --git a/Phaser/3.x/types/phaser-plugin.d.ts b/Phaser/3.x/types/phaser-plugin.d.ts new file mode 100644 index 00000000..40229bc5 --- /dev/null +++ b/Phaser/3.x/types/phaser-plugin.d.ts @@ -0,0 +1,23 @@ +// Extends phaser declaration + +declare namespace Phaser { + namespace Loader { + interface LoaderPlugin { + dragonbone: (dragonbonesName: string | object, + textureURL?: string, + atlasURL?: string, + boneURL?: string, + textureXhrSettings?: XHRSettingsObject, + atlasXhrSettings?: XHRSettingsObject, + boneXhrSettings?: XHRSettingsObject) => Phaser.Loader.LoaderPlugin; + } + } + + namespace GameObjects { + interface GameObjectFactory { + armature: (armature: string, dragonBones?: string, skinName?: string, atlasTextureName?: string) + => dragonBones.phaser.display.ArmatureDisplay; + dragonBones: (dragonBonesName: string, textureScale?: number) => dragonBones.DragonBonesData; + } + } +} diff --git a/Phaser/3.x/types/phaser.d.ts b/Phaser/3.x/types/phaser.d.ts new file mode 100644 index 00000000..8eb1194f --- /dev/null +++ b/Phaser/3.x/types/phaser.d.ts @@ -0,0 +1,83455 @@ +declare type DataEachCallback = (parent: any, key: string, value: any, ...args: any[])=>void; + +declare type ContentLoadedCallback = ()=>void; + +declare type CreateCallback = (bob: Phaser.GameObjects.Bob, index: integer)=>void; + +declare type EachContainerCallback = (item: any, ...args: any[])=>void; + +declare type LightForEach = (light: Phaser.GameObjects.Light)=>void; + +/** + * A custom function that will be responsible for wrapping the text. + */ +declare type TextStyleWordWrapCallback = (text: string, textObject: Phaser.GameObjects.Text)=>void; + +declare type CenterFunction = (triangle: Phaser.Geom.Triangle)=>void; + +declare namespace Phaser { + namespace Actions { + /** + * Takes an array of Game Objects, or any objects that have a public `angle` property, + * and then adds the given value to each of their `angle` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `Angle(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `angle` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function Angle(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of objects and passes each of them to the given callback. + * @param items The array of items to be updated by this action. + * @param callback The callback to be invoked. It will be passed just one argument: the item from the array. + * @param context The scope in which the callback will be invoked. + */ + function Call(items: G, callback: Phaser.Types.Actions.CallCallback, context: any): G; + + /** + * Takes an array of objects and returns the first element in the array that has properties which match + * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` + * then it would return the first item which had the property `scaleX` set to 0.5 and `alpha` set to 1. + * + * To use this with a Group: `GetFirst(group.getChildren(), compare, index)` + * @param items The array of items to be searched by this action. + * @param compare The comparison object. Each property in this object will be checked against the items of the array. + * @param index An optional offset to start searching from within the items array. Default 0. + */ + function GetFirst(items: G, compare: object, index?: integer): object | Phaser.GameObjects.GameObject; + + /** + * Takes an array of objects and returns the last element in the array that has properties which match + * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` + * then it would return the last item which had the property `scaleX` set to 0.5 and `alpha` set to 1. + * + * To use this with a Group: `GetLast(group.getChildren(), compare, index)` + * @param items The array of items to be searched by this action. + * @param compare The comparison object. Each property in this object will be checked against the items of the array. + * @param index An optional offset to start searching from within the items array. Default 0. + */ + function GetLast(items: G, compare: object, index?: integer): object | Phaser.GameObjects.GameObject; + + /** + * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, + * and then aligns them based on the grid configuration given to this action. + * @param items The array of items to be updated by this action. + * @param options The GridAlign Configuration object. + */ + function GridAlign(items: G, options: Phaser.Types.Actions.GridAlignConfig): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `alpha` property, + * and then adds the given value to each of their `alpha` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncAlpha(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `alpha` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function IncAlpha(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `x` property, + * and then adds the given value to each of their `x` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncX(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `x` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function IncX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, + * and then adds the given value to each of them. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncXY(group.getChildren(), x, y, stepX, stepY)` + * @param items The array of items to be updated by this action. + * @param x The amount to be added to the `x` property. + * @param y The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value. Default x. + * @param stepX This is added to the `x` amount, multiplied by the iteration counter. Default 0. + * @param stepY This is added to the `y` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function IncXY(items: G, x: number, y?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `y` property, + * and then adds the given value to each of their `y` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncY(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `y` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function IncY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param circle The Circle to position the Game Objects on. + * @param startAngle Optional angle to start position from, in radians. Default 0. + * @param endAngle Optional angle to stop position at, in radians. Default 6.28. + */ + function PlaceOnCircle(items: G, circle: Phaser.Geom.Circle, startAngle?: number, endAngle?: number): G; + + /** + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of an Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param ellipse The Ellipse to position the Game Objects on. + * @param startAngle Optional angle to start position from, in radians. Default 0. + * @param endAngle Optional angle to stop position at, in radians. Default 6.28. + */ + function PlaceOnEllipse(items: G, ellipse: Phaser.Geom.Ellipse, startAngle?: number, endAngle?: number): G; + + /** + * Positions an array of Game Objects on evenly spaced points of a Line. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param line The Line to position the Game Objects on. + */ + function PlaceOnLine(items: G, line: Phaser.Geom.Line): G; + + /** + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. + * + * Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction. + * If the `shift` parameter is given you can offset where placement begins. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param rect The Rectangle to position the Game Objects on. + * @param shift An optional positional offset. Default 1. + */ + function PlaceOnRectangle(items: G, rect: Phaser.Geom.Rectangle, shift?: integer): G; + + /** + * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param triangle The Triangle to position the Game Objects on. + * @param stepRate An optional step rate, to increase or decrease the packing of the Game Objects on the lines. Default 1. + */ + function PlaceOnTriangle(items: G, triangle: Phaser.Geom.Triangle, stepRate?: number): G; + + /** + * Play an animation with the given key, starting at the given startFrame on all Game Objects in items. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param key The name of the animation to play. + * @param startFrame The starting frame of the animation with the given key. + */ + function PlayAnimation(items: G, key: string, startFrame?: string | integer): G; + + /** + * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, + * and then adds the given value to it. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `PropertyValueInc(group.getChildren(), key, value, step)` + * @param items The array of items to be updated by this action. + * @param key The property to be updated. + * @param value The amount to be added to the property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function PropertyValueInc(items: G, key: string, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` + * @param items The array of items to be updated by this action. + * @param key The property to be updated. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function PropertyValueSet(items: G, key: string, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects and positions them at random locations within the Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param circle The Circle to position the Game Objects within. + */ + function RandomCircle(items: G, circle: Phaser.Geom.Circle): G; + + /** + * Takes an array of Game Objects and positions them at random locations within the Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param ellipse The Ellipse to position the Game Objects within. + */ + function RandomEllipse(items: G, ellipse: Phaser.Geom.Ellipse): G; + + /** + * Takes an array of Game Objects and positions them at random locations on the Line. + * + * If you wish to pass a `Phaser.GameObjects.Line` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param line The Line to position the Game Objects randomly on. + */ + function RandomLine(items: G, line: Phaser.Geom.Line): G; + + /** + * Takes an array of Game Objects and positions them at random locations within the Rectangle. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param rect The Rectangle to position the Game Objects within. + */ + function RandomRectangle(items: G, rect: Phaser.Geom.Rectangle): G; + + /** + * Takes an array of Game Objects and positions them at random locations within the Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param triangle The Triangle to position the Game Objects within. + */ + function RandomTriangle(items: G, triangle: Phaser.Geom.Triangle): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `rotation` property, + * and then adds the given value to each of their `rotation` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `Rotate(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `rotation` property (in radians). + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function Rotate(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Rotates each item around the given point by the given angle. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param point Any object with public `x` and `y` properties. + * @param angle The angle to rotate by, in radians. + */ + function RotateAround(items: G, point: object, angle: number): G; + + /** + * Rotates an array of Game Objects around a point by the given angle and distance. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param point Any object with public `x` and `y` properties. + * @param angle The angle to rotate by, in radians. + * @param distance The distance from the point of rotation in pixels. + */ + function RotateAroundDistance(items: G, point: object, angle: number, distance: number): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `scaleX` property, + * and then adds the given value to each of their `scaleX` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `ScaleX(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `scaleX` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function ScaleX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties, + * and then adds the given value to each of them. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `ScaleXY(group.getChildren(), scaleX, scaleY, stepX, stepY)` + * @param items The array of items to be updated by this action. + * @param scaleX The amount to be added to the `scaleX` property. + * @param scaleY The amount to be added to the `scaleY` property. If `undefined` or `null` it uses the `scaleX` value. + * @param stepX This is added to the `scaleX` amount, multiplied by the iteration counter. Default 0. + * @param stepY This is added to the `y` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function ScaleXY(items: G, scaleX: number, scaleY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `scaleY` property, + * and then adds the given value to each of their `scaleY` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `ScaleY(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `scaleY` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function ScaleY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `alpha` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetAlpha(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetAlpha(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `blendMode` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetBlendMode(group.getChildren(), value)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetBlendMode(items: G, value: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `depth` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetDepth(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetDepth(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param hitAreaCallback A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. + */ + function SetHitArea(items: G, hitArea: any, hitAreaCallback: Phaser.Types.Input.HitAreaCallback): G; + + /** + * Takes an array of Game Objects, or any objects that have the public properties `originX` and `originY` + * and then sets them to the given values. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetOrigin(group.getChildren(), originX, originY, stepX, stepY)` + * @param items The array of items to be updated by this action. + * @param originX The amount to set the `originX` property to. + * @param originY The amount to set the `originY` property to. If `undefined` or `null` it uses the `originX` value. + * @param stepX This is added to the `originX` amount, multiplied by the iteration counter. Default 0. + * @param stepY This is added to the `originY` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetOrigin(items: G, originX: number, originY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `rotation` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetRotation(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetRotation(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public properties `scaleX` and `scaleY` + * and then sets them to the given values. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetScale(group.getChildren(), scaleX, scaleY, stepX, stepY)` + * @param items The array of items to be updated by this action. + * @param scaleX The amount to set the `scaleX` property to. + * @param scaleY The amount to set the `scaleY` property to. If `undefined` or `null` it uses the `scaleX` value. + * @param stepX This is added to the `scaleX` amount, multiplied by the iteration counter. Default 0. + * @param stepY This is added to the `scaleY` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetScale(items: G, scaleX: number, scaleY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `scaleX` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetScaleX(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetScaleX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `scaleY` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetScaleY(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetScaleY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public method setTint() and then updates it to the given value(s). You can specify tint color per corner or provide only one color value for `topLeft` parameter, in which case whole item will be tinted with that color. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param topLeft The tint being applied to top-left corner of item. If other parameters are given no value, this tint will be applied to whole item. + * @param topRight The tint to be applied to top-right corner of item. + * @param bottomLeft The tint to be applied to the bottom-left corner of item. + * @param bottomRight The tint to be applied to the bottom-right corner of item. + */ + function SetTint(items: G, topLeft: number, topRight?: number, bottomLeft?: number, bottomRight?: number): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `visible` + * and then sets it to the given value. + * + * To use this with a Group: `SetVisible(group.getChildren(), value)` + * @param items The array of items to be updated by this action. + * @param value The value to set the property to. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetVisible(items: G, value: boolean, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `x` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetX(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public properties `x` and `y` + * and then sets them to the given values. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetXY(group.getChildren(), x, y, stepX, stepY)` + * @param items The array of items to be updated by this action. + * @param x The amount to set the `x` property to. + * @param y The amount to set the `y` property to. If `undefined` or `null` it uses the `x` value. Default x. + * @param stepX This is added to the `x` amount, multiplied by the iteration counter. Default 0. + * @param stepY This is added to the `y` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetXY(items: G, x: number, y?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `y` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetY(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Iterate through the items array changing the position of each element to be that of the element that came before + * it in the array (or after it if direction = 1) + * + * The first items position is set to x/y. + * + * The final x/y coords are returned + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param x The x coordinate to place the first item in the array at. + * @param y The y coordinate to place the first item in the array at. + * @param direction The iteration direction. 0 = first to last and 1 = last to first. Default 0. + * @param output An optional objec to store the final objects position in. + */ + function ShiftPosition(items: G, x: number, y: number, direction?: integer, output?: O): O; + + /** + * Shuffles the array in place. The shuffled array is both modified and returned. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + */ + function Shuffle(items: G): G; + + /** + * Smootherstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param property The property of the Game Object to interpolate. + * @param min The minimum interpolation value. + * @param max The maximum interpolation value. + * @param inc Should the values be incremented? `true` or set (`false`) Default false. + */ + function SmootherStep(items: G, property: string, min: number, max: number, inc?: boolean): G; + + /** + * Smoothstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param property The property of the Game Object to interpolate. + * @param min The minimum interpolation value. + * @param max The maximum interpolation value. + * @param inc Should the values be incremented? `true` or set (`false`) Default false. + */ + function SmoothStep(items: G, property: string, min: number, max: number, inc?: boolean): G; + + /** + * Takes an array of Game Objects and then modifies their `property` so the value equals, or is incremented, by the + * calculated spread value. + * + * The spread value is derived from the given `min` and `max` values and the total number of items in the array. + * + * For example, to cause an array of Sprites to change in alpha from 0 to 1 you could call: + * + * ```javascript + * Phaser.Actions.Spread(itemsArray, 'alpha', 0, 1); + * ``` + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param property The property of the Game Object to spread. + * @param min The minimum value. + * @param max The maximum value. + * @param inc Should the values be incremented? `true` or set (`false`) Default false. + */ + function Spread(items: G, property: string, min: number, max: number, inc?: boolean): G; + + /** + * Takes an array of Game Objects and toggles the visibility of each one. + * Those previously `visible = false` will become `visible = true`, and vice versa. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + */ + function ToggleVisible(items: G): G; + + /** + * Wrap each item's coordinates within a rectangle's area. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param rect The rectangle. + * @param padding An amount added to each side of the rectangle during the operation. Default 0. + */ + function WrapInRectangle(items: G, rect: Phaser.Geom.Rectangle, padding?: number): G; + + } + + namespace Animations { + /** + * A Frame based Animation. + * + * This consists of a key, some default values (like the frame rate) and a bunch of Frame objects. + * + * The Animation Manager creates these. Game Objects don't own an instance of these directly. + * Game Objects have the Animation Component, which are like playheads to global Animations (these objects) + * So multiple Game Objects can have playheads all pointing to this one Animation instance. + */ + class Animation extends Phaser.Events.EventEmitter { + /** + * + * @param manager A reference to the global Animation Manager + * @param key The unique identifying string for this animation. + * @param config The Animation configuration. + */ + constructor(manager: Phaser.Animations.AnimationManager, key: string, config: Phaser.Types.Animations.Animation); + + /** + * A reference to the global Animation Manager. + */ + manager: Phaser.Animations.AnimationManager; + + /** + * The unique identifying string for this animation. + */ + key: string; + + /** + * A frame based animation (as opposed to a bone based animation) + */ + type: string; + + /** + * Extract all the frame data into the frames array. + */ + frames: Phaser.Animations.AnimationFrame[]; + + /** + * The frame rate of playback in frames per second (default 24 if duration is null) + */ + frameRate: integer; + + /** + * How long the animation should play for, in milliseconds. + * If the `frameRate` property has been set then it overrides this value, + * otherwise the `frameRate` is derived from `duration`. + */ + duration: integer; + + /** + * How many ms per frame, not including frame specific modifiers. + */ + msPerFrame: integer; + + /** + * Skip frames if the time lags, or always advanced anyway? + */ + skipMissedFrames: boolean; + + /** + * The delay in ms before the playback will begin. + */ + delay: integer; + + /** + * Number of times to repeat the animation. Set to -1 to repeat forever. + */ + repeat: integer; + + /** + * The delay in ms before the a repeat play starts. + */ + repeatDelay: integer; + + /** + * Should the animation yoyo (reverse back down to the start) before repeating? + */ + yoyo: boolean; + + /** + * Should the GameObject's `visible` property be set to `true` when the animation starts to play? + */ + showOnStart: boolean; + + /** + * Should the GameObject's `visible` property be set to `false` when the animation finishes? + */ + hideOnComplete: boolean; + + /** + * Global pause. All Game Objects using this Animation instance are impacted by this property. + */ + paused: boolean; + + /** + * Add frames to the end of the animation. + * @param config [description] + */ + addFrame(config: string | Phaser.Types.Animations.AnimationFrame[]): Phaser.Animations.Animation; + + /** + * Add frame/s into the animation. + * @param index The index to insert the frame at within the animation. + * @param config [description] + */ + addFrameAt(index: integer, config: string | Phaser.Types.Animations.AnimationFrame[]): Phaser.Animations.Animation; + + /** + * Check if the given frame index is valid. + * @param index The index to be checked. + */ + checkFrame(index: integer): boolean; + + /** + * [description] + * @param component [description] + */ + protected completeAnimation(component: Phaser.GameObjects.Components.Animation): void; + + /** + * [description] + * @param component [description] + * @param includeDelay [description] Default true. + */ + protected getFirstTick(component: Phaser.GameObjects.Components.Animation, includeDelay?: boolean): void; + + /** + * Returns the AnimationFrame at the provided index + * @param index The index in the AnimationFrame array + */ + protected getFrameAt(index: integer): Phaser.Animations.AnimationFrame; + + /** + * [description] + * @param textureManager [description] + * @param frames [description] + * @param defaultTextureKey [description] + */ + getFrames(textureManager: Phaser.Textures.TextureManager, frames: string | Phaser.Types.Animations.AnimationFrame[], defaultTextureKey?: string): Phaser.Animations.AnimationFrame[]; + + /** + * [description] + * @param component [description] + */ + getNextTick(component: Phaser.GameObjects.Components.Animation): void; + + /** + * Returns the frame closest to the given progress value between 0 and 1. + * @param value A value between 0 and 1. + */ + getFrameByProgress(value: number): Phaser.Animations.AnimationFrame; + + /** + * Advance the animation frame. + * @param component The Animation Component to advance. + */ + nextFrame(component: Phaser.GameObjects.Components.Animation): void; + + /** + * Returns the animation last frame. + */ + getLastFrame(): Phaser.Animations.AnimationFrame; + + /** + * [description] + * @param component [description] + */ + previousFrame(component: Phaser.GameObjects.Components.Animation): void; + + /** + * [description] + * @param frame [description] + */ + removeFrame(frame: Phaser.Animations.AnimationFrame): Phaser.Animations.Animation; + + /** + * Removes a frame from the AnimationFrame array at the provided index + * and updates the animation accordingly. + * @param index The index in the AnimationFrame array + */ + removeFrameAt(index: integer): Phaser.Animations.Animation; + + /** + * [description] + * @param component [description] + */ + repeatAnimation(component: Phaser.GameObjects.Components.Animation): void; + + /** + * Sets the texture frame the animation uses for rendering. + * @param component [description] + */ + setFrame(component: Phaser.GameObjects.Components.Animation): void; + + /** + * Converts the animation data to JSON. + */ + toJSON(): Phaser.Types.Animations.JSONAnimation; + + /** + * [description] + */ + updateFrameSequence(): Phaser.Animations.Animation; + + /** + * [description] + */ + pause(): Phaser.Animations.Animation; + + /** + * [description] + */ + resume(): Phaser.Animations.Animation; + + /** + * [description] + */ + destroy(): void; + + } + + /** + * A single frame in an Animation sequence. + * + * An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other + * frames in the animation, and index data. It also has the ability to modify the animation timing. + * + * AnimationFrames are generated automatically by the Animation class. + */ + class AnimationFrame { + /** + * + * @param textureKey The key of the Texture this AnimationFrame uses. + * @param textureFrame The key of the Frame within the Texture that this AnimationFrame uses. + * @param index The index of this AnimationFrame within the Animation sequence. + * @param frame A reference to the Texture Frame this AnimationFrame uses for rendering. + */ + constructor(textureKey: string, textureFrame: string | integer, index: integer, frame: Phaser.Textures.Frame); + + /** + * The key of the Texture this AnimationFrame uses. + */ + textureKey: string; + + /** + * The key of the Frame within the Texture that this AnimationFrame uses. + */ + textureFrame: string | integer; + + /** + * The index of this AnimationFrame within the Animation sequence. + */ + index: integer; + + /** + * A reference to the Texture Frame this AnimationFrame uses for rendering. + */ + frame: Phaser.Textures.Frame; + + /** + * Is this the first frame in an animation sequence? + */ + readonly isFirst: boolean; + + /** + * Is this the last frame in an animation sequence? + */ + readonly isLast: boolean; + + /** + * A reference to the AnimationFrame that comes before this one in the animation, if any. + */ + readonly prevFrame: Phaser.Animations.AnimationFrame; + + /** + * A reference to the AnimationFrame that comes after this one in the animation, if any. + */ + readonly nextFrame: Phaser.Animations.AnimationFrame; + + /** + * Additional time (in ms) that this frame should appear for during playback. + * The value is added onto the msPerFrame set by the animation. + */ + duration: number; + + /** + * What % through the animation does this frame come? + * This value is generated when the animation is created and cached here. + */ + readonly progress: number; + + /** + * Generates a JavaScript object suitable for converting to JSON. + */ + toJSON(): Phaser.Types.Animations.JSONAnimationFrame; + + /** + * Destroys this object by removing references to external resources and callbacks. + */ + destroy(): void; + + } + + /** + * The Animation Manager. + * + * Animations are managed by the global Animation Manager. This is a singleton class that is + * responsible for creating and delivering animations and their corresponding data to all Game Objects. + * Unlike plugins it is owned by the Game instance, not the Scene. + * + * Sprites and other Game Objects get the data they need from the AnimationManager. + */ + class AnimationManager extends Phaser.Events.EventEmitter { + /** + * + * @param game A reference to the Phaser.Game instance. + */ + constructor(game: Phaser.Game); + + /** + * A reference to the Phaser.Game instance. + */ + protected game: Phaser.Game; + + /** + * A reference to the Texture Manager. + */ + protected textureManager: Phaser.Textures.TextureManager; + + /** + * The global time scale of the Animation Manager. + * + * This scales the time delta between two frames, thus influencing the speed of time for the Animation Manager. + */ + globalTimeScale: number; + + /** + * The Animations registered in the Animation Manager. + * + * This map should be modified with the {@link #add} and {@link #create} methods of the Animation Manager. + */ + protected anims: Phaser.Structs.Map; + + /** + * Whether the Animation Manager is paused along with all of its Animations. + */ + paused: boolean; + + /** + * The name of this Animation Manager. + */ + name: string; + + /** + * Registers event listeners after the Game boots. + */ + boot(): void; + + /** + * Adds an existing Animation to the Animation Manager. + * @param key The key under which the Animation should be added. The Animation will be updated with it. Must be unique. + * @param animation The Animation which should be added to the Animation Manager. + */ + add(key: string, animation: Phaser.Animations.Animation): Phaser.Animations.AnimationManager; + + /** + * Checks to see if the given key is already in use within the Animation Manager or not. + * + * Animations are global. Keys created in one scene can be used from any other Scene in your game. They are not Scene specific. + * @param key The key of the Animation to check. + */ + exists(key: string): boolean; + + /** + * Creates a new Animation and adds it to the Animation Manager. + * + * Animations are global. Once created, you can use them in any Scene in your game. They are not Scene specific. + * + * If an invalid key is given this method will return `false`. + * + * If you pass the key of an animation that already exists in the Animation Manager, that animation will be returned. + * + * A brand new animation is only created if the key is valid and not already in use. + * + * If you wish to re-use an existing key, call `AnimationManager.remove` first, then this method. + * @param config The configuration settings for the Animation. + */ + create(config: Phaser.Types.Animations.Animation): Phaser.Animations.Animation | false; + + /** + * Loads this Animation Manager's Animations and settings from a JSON object. + * @param data The JSON object to parse. + * @param clearCurrentAnimations If set to `true`, the current animations will be removed (`anims.clear()`). If set to `false` (default), the animations in `data` will be added. Default false. + */ + fromJSON(data: string | Phaser.Types.Animations.JSONAnimations | Phaser.Types.Animations.JSONAnimation, clearCurrentAnimations?: boolean): Phaser.Animations.Animation[]; + + /** + * [description] + * @param key The key for the texture containing the animation frames. + * @param config The configuration object for the animation frame names. + */ + generateFrameNames(key: string, config?: Phaser.Types.Animations.GenerateFrameNames): Phaser.Types.Animations.AnimationFrame[]; + + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. + * @param key The key for the texture containing the animation frames. + * @param config The configuration object for the animation frames. + */ + generateFrameNumbers(key: string, config: Phaser.Types.Animations.GenerateFrameNumbers): Phaser.Types.Animations.AnimationFrame[]; + + /** + * Get an Animation. + * @param key The key of the Animation to retrieve. + */ + get(key: string): Phaser.Animations.Animation; + + /** + * Load an Animation into a Game Object's Animation Component. + * @param child The Game Object to load the animation into. + * @param key The key of the animation to load. + * @param startFrame The name of a start frame to set on the loaded animation. + */ + load(child: Phaser.GameObjects.GameObject, key: string, startFrame?: string | integer): Phaser.GameObjects.GameObject; + + /** + * Pause all animations. + */ + pauseAll(): Phaser.Animations.AnimationManager; + + /** + * Play an animation on the given Game Objects that have an Animation Component. + * @param key The key of the animation to play on the Game Object. + * @param child The Game Objects to play the animation on. + */ + play(key: string, child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.Animations.AnimationManager; + + /** + * Remove an animation. + * @param key The key of the animation to remove. + */ + remove(key: string): Phaser.Animations.Animation; + + /** + * Resume all paused animations. + */ + resumeAll(): Phaser.Animations.AnimationManager; + + /** + * Takes an array of Game Objects that have an Animation Component and then + * starts the given animation playing on them, each one offset by the + * `stagger` amount given to this method. + * @param key The key of the animation to play on the Game Objects. + * @param children An array of Game Objects to play the animation on. They must have an Animation Component. + * @param stagger The amount of time, in milliseconds, to offset each play time by. Default 0. + */ + staggerPlay(key: string, children: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], stagger?: number): G; + + /** + * Get the animation data as javascript object by giving key, or get the data of all animations as array of objects, if key wasn't provided. + * @param key [description] + */ + toJSON(key: string): Phaser.Types.Animations.JSONAnimations; + + /** + * Destroy this Animation Manager and clean up animation definitions and references to other objects. + * This method should not be called directly. It will be called automatically as a response to a `destroy` event from the Phaser.Game instance. + */ + destroy(): void; + + } + + namespace Events { + /** + * The Add Animation Event. + * + * This event is dispatched when a new animation is added to the global Animation Manager. + * + * This can happen either as a result of an animation instance being added to the Animation Manager, + * or the Animation Manager creating a new animation directly. + */ + const ADD_ANIMATION: any; + + /** + * The Animation Complete Event. + * + * This event is dispatched by an Animation instance when it completes, i.e. finishes playing or is manually stopped. + * + * Be careful with the volume of events this could generate. If a group of Sprites all complete the same + * animation at the same time, this event will invoke its handler for each one of them. + */ + const ANIMATION_COMPLETE: any; + + /** + * The Animation Repeat Event. + * + * This event is dispatched when a currently playing animation repeats. + * + * The event is dispatched directly from the Animation object itself. Which means that listeners + * bound to this event will be invoked every time the Animation repeats, for every Game Object that may have it. + */ + const ANIMATION_REPEAT: any; + + /** + * The Animation Restart Event. + * + * This event is dispatched by an Animation instance when it restarts. + * + * Be careful with the volume of events this could generate. If a group of Sprites all restart the same + * animation at the same time, this event will invoke its handler for each one of them. + */ + const ANIMATION_RESTART: any; + + /** + * The Animation Start Event. + * + * This event is dispatched by an Animation instance when it starts playing. + * + * Be careful with the volume of events this could generate. If a group of Sprites all play the same + * animation at the same time, this event will invoke its handler for each one of them. + */ + const ANIMATION_START: any; + + /** + * The Pause All Animations Event. + * + * This event is dispatched when the global Animation Manager is told to pause. + * + * When this happens all current animations will stop updating, although it doesn't necessarily mean + * that the game has paused as well. + */ + const PAUSE_ALL: any; + + /** + * The Remove Animation Event. + * + * This event is dispatched when an animation is removed from the global Animation Manager. + */ + const REMOVE_ANIMATION: any; + + /** + * The Resume All Animations Event. + * + * This event is dispatched when the global Animation Manager resumes, having been previously paused. + * + * When this happens all current animations will continue updating again. + */ + const RESUME_ALL: any; + + /** + * The Sprite Animation Complete Event. + * + * This event is dispatched by a Sprite when an animation finishes playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_COMPLETE` event. + */ + const SPRITE_ANIMATION_COMPLETE: any; + + /** + * The Sprite Animation Key Complete Event. + * + * This event is dispatched by a Sprite when a specific animation finishes playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationcomplete-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationcomplete-explode`. + */ + const SPRITE_ANIMATION_KEY_COMPLETE: any; + + /** + * The Sprite Animation Key Repeat Event. + * + * This event is dispatched by a Sprite when a specific animation repeats playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrepeat-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrepeat-explode`. + */ + const SPRITE_ANIMATION_KEY_REPEAT: any; + + /** + * The Sprite Animation Key Restart Event. + * + * This event is dispatched by a Sprite when a specific animation restarts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrestart-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrestart-explode`. + */ + const SPRITE_ANIMATION_KEY_RESTART: any; + + /** + * The Sprite Animation Key Start Event. + * + * This event is dispatched by a Sprite when a specific animation starts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationstart-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationstart-explode`. + */ + const SPRITE_ANIMATION_KEY_START: any; + + /** + * The Sprite Animation Key Update Event. + * + * This event is dispatched by a Sprite when a specific animation playing on it updates. This happens when the animation changes frame, + * based on the animation frame rate and other factors like `timeScale` and `delay`. + * + * Listen for it on the Sprite using `sprite.on('animationupdate-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationupdate-explode`. + */ + const SPRITE_ANIMATION_KEY_UPDATE: any; + + /** + * The Sprite Animation Repeat Event. + * + * This event is dispatched by a Sprite when an animation repeats playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_REPEAT` event. + */ + const SPRITE_ANIMATION_REPEAT: any; + + /** + * The Sprite Animation Restart Event. + * + * This event is dispatched by a Sprite when an animation restarts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_RESTART` event. + */ + const SPRITE_ANIMATION_RESTART: any; + + /** + * The Sprite Animation Start Event. + * + * This event is dispatched by a Sprite when an animation starts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationstart', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_START` event. + */ + const SPRITE_ANIMATION_START: any; + + /** + * The Sprite Animation Update Event. + * + * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame, + * based on the animation frame rate and other factors like `timeScale` and `delay`. + * + * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_UPDATE` event. + */ + const SPRITE_ANIMATION_UPDATE: any; + + } + + } + + namespace Cache { + /** + * The BaseCache is a base Cache class that can be used for storing references to any kind of data. + * + * Data can be added, retrieved and removed based on the given keys. + * + * Keys are string-based. + */ + class BaseCache { + /** + * The Map in which the cache objects are stored. + * + * You can query the Map directly or use the BaseCache methods. + */ + entries: Phaser.Structs.Map; + + /** + * An instance of EventEmitter used by the cache to emit related events. + */ + events: Phaser.Events.EventEmitter; + + /** + * Adds an item to this cache. The item is referenced by a unique string, which you are responsible + * for setting and keeping track of. The item can only be retrieved by using this string. + * @param key The unique key by which the data added to the cache will be referenced. + * @param data The data to be stored in the cache. + */ + add(key: string, data: any): Phaser.Cache.BaseCache; + + /** + * Checks if this cache contains an item matching the given key. + * This performs the same action as `BaseCache.exists`. + * @param key The unique key of the item to be checked in this cache. + */ + has(key: string): boolean; + + /** + * Checks if this cache contains an item matching the given key. + * This performs the same action as `BaseCache.has` and is called directly by the Loader. + * @param key The unique key of the item to be checked in this cache. + */ + exists(key: string): boolean; + + /** + * Gets an item from this cache based on the given key. + * @param key The unique key of the item to be retrieved from this cache. + */ + get(key: string): any; + + /** + * Removes and item from this cache based on the given key. + * + * If an entry matching the key is found it is removed from the cache and a `remove` event emitted. + * No additional checks are done on the item removed. If other systems or parts of your game code + * are relying on this item, it is up to you to sever those relationships prior to removing the item. + * @param key The unique key of the item to remove from the cache. + */ + remove(key: string): Phaser.Cache.BaseCache; + + /** + * Returns all keys in use in this cache. + */ + getKeys(): string[]; + + /** + * Destroys this cache and all items within it. + */ + destroy(): void; + + } + + /** + * The Cache Manager is the global cache owned and maintained by the Game instance. + * + * Various systems, such as the file Loader, rely on this cache in order to store the files + * it has loaded. The manager itself doesn't store any files, but instead owns multiple BaseCache + * instances, one per type of file. You can also add your own custom caches. + */ + class CacheManager { + /** + * + * @param game A reference to the Phaser.Game instance that owns this CacheManager. + */ + constructor(game: Phaser.Game); + + /** + * A reference to the Phaser.Game instance that owns this CacheManager. + */ + protected game: Phaser.Game; + + /** + * A Cache storing all binary files, typically added via the Loader. + */ + binary: Phaser.Cache.BaseCache; + + /** + * A Cache storing all bitmap font data files, typically added via the Loader. + * Only the font data is stored in this cache, the textures are part of the Texture Manager. + */ + bitmapFont: Phaser.Cache.BaseCache; + + /** + * A Cache storing all JSON data files, typically added via the Loader. + */ + json: Phaser.Cache.BaseCache; + + /** + * A Cache storing all physics data files, typically added via the Loader. + */ + physics: Phaser.Cache.BaseCache; + + /** + * A Cache storing all shader source files, typically added via the Loader. + */ + shader: Phaser.Cache.BaseCache; + + /** + * A Cache storing all non-streaming audio files, typically added via the Loader. + */ + audio: Phaser.Cache.BaseCache; + + /** + * A Cache storing all text files, typically added via the Loader. + */ + text: Phaser.Cache.BaseCache; + + /** + * A Cache storing all html files, typically added via the Loader. + */ + html: Phaser.Cache.BaseCache; + + /** + * A Cache storing all WaveFront OBJ files, typically added via the Loader. + */ + obj: Phaser.Cache.BaseCache; + + /** + * A Cache storing all tilemap data files, typically added via the Loader. + * Only the data is stored in this cache, the textures are part of the Texture Manager. + */ + tilemap: Phaser.Cache.BaseCache; + + /** + * A Cache storing all xml data files, typically added via the Loader. + */ + xml: Phaser.Cache.BaseCache; + + /** + * An object that contains your own custom BaseCache entries. + * Add to this via the `addCustom` method. + */ + custom: {[key: string]: Phaser.Cache.BaseCache}; + + /** + * Add your own custom Cache for storing your own files. + * The cache will be available under `Cache.custom.key`. + * The cache will only be created if the key is not already in use. + * @param key The unique key of your custom cache. + */ + addCustom(key: string): Phaser.Cache.BaseCache; + + /** + * Removes all entries from all BaseCaches and destroys all custom caches. + */ + destroy(): void; + + } + + namespace Events { + /** + * The Cache Add Event. + * + * This event is dispatched by any Cache that extends the BaseCache each time a new object is added to it. + */ + const ADD: any; + + /** + * The Cache Remove Event. + * + * This event is dispatched by any Cache that extends the BaseCache each time an object is removed from it. + */ + const REMOVE: any; + + } + + } + + namespace Cameras { + namespace Scene2D { + /** + * A Base Camera class. + * + * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world, + * and can be positioned, rotated, zoomed and scrolled accordingly. + * + * A Camera consists of two elements: The viewport and the scroll values. + * + * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are + * created the same size as your game, but their position and size can be set to anything. This means if you + * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, + * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). + * + * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this + * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the + * viewport, and changing the viewport has no impact on the scrolling. + * + * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, + * allowing you to filter Game Objects out on a per-Camera basis. + * + * The Base Camera is extended by the Camera class, which adds in special effects including Fade, + * Flash and Camera Shake, as well as the ability to follow Game Objects. + * + * The Base Camera was introduced in Phaser 3.12. It was split off from the Camera class, to allow + * you to isolate special effects as needed. Therefore the 'since' values for properties of this class relate + * to when they were added to the Camera class. + */ + class BaseCamera extends Phaser.Events.EventEmitter implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.Visible { + /** + * + * @param x The x position of the Camera, relative to the top-left of the game canvas. + * @param y The y position of the Camera, relative to the top-left of the game canvas. + * @param width The width of the Camera, in pixels. + * @param height The height of the Camera, in pixels. + */ + constructor(x: number, y: number, width: number, height: number); + + /** + * A reference to the Scene this camera belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Game Scene Manager. + */ + sceneManager: Phaser.Scenes.SceneManager; + + /** + * A reference to the Game Scale Manager. + */ + scaleManager: Phaser.Scale.ScaleManager; + + /** + * A reference to the Scene's Camera Manager to which this Camera belongs. + */ + cameraManager: Phaser.Cameras.Scene2D.CameraManager; + + /** + * The Camera ID. Assigned by the Camera Manager and used to handle camera exclusion. + * This value is a bitmask. + */ + readonly id: integer; + + /** + * The name of the Camera. This is left empty for your own use. + */ + name: string; + + /** + * This property is un-used in v3.16. + * + * The resolution of the Game, used in most Camera calculations. + */ + readonly resolution: number; + + /** + * Should this camera round its pixel values to integers? + */ + roundPixels: boolean; + + /** + * Is this Camera visible or not? + * + * A visible camera will render and perform input tests. + * An invisible camera will not render anything and will skip input tests. + */ + visible: boolean; + + /** + * Is this Camera using a bounds to restrict scrolling movement? + * + * Set this property along with the bounds via `Camera.setBounds`. + */ + useBounds: boolean; + + /** + * The World View is a Rectangle that defines the area of the 'world' the Camera is currently looking at. + * This factors in the Camera viewport size, zoom and scroll position and is updated in the Camera preRender step. + * If you have enabled Camera bounds the worldview will be clamped to those bounds accordingly. + * You can use it for culling or intersection checks. + */ + readonly worldView: Phaser.Geom.Rectangle; + + /** + * Is this Camera dirty? + * + * A dirty Camera has had either its viewport size, bounds, scroll, rotation or zoom levels changed since the last frame. + * + * This flag is cleared during the `postRenderCamera` method of the renderer. + */ + dirty: boolean; + + /** + * Does this Camera have a transparent background? + */ + transparent: boolean; + + /** + * The background color of this Camera. Only used if `transparent` is `false`. + */ + backgroundColor: Phaser.Display.Color; + + /** + * The Camera alpha value. Setting this property impacts every single object that this Camera + * renders. You can either set the property directly, i.e. via a Tween, to fade a Camera in or out, + * or via the chainable `setAlpha` method instead. + */ + alpha: number; + + /** + * Should the camera cull Game Objects before checking them for input hit tests? + * In some special cases it may be beneficial to disable this. + */ + disableCull: boolean; + + /** + * The mid-point of the Camera in 'world' coordinates. + * + * Use it to obtain exactly where in the world the center of the camera is currently looking. + * + * This value is updated in the preRender method, after the scroll values and follower + * have been processed. + */ + readonly midPoint: Phaser.Math.Vector2; + + /** + * The horizontal origin of rotation for this Camera. + * + * By default the camera rotates around the center of the viewport. + * + * Changing the origin allows you to adjust the point in the viewport from which rotation happens. + * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. + * + * See `setOrigin` to set both origins in a single, chainable call. + */ + originX: number; + + /** + * The vertical origin of rotation for this Camera. + * + * By default the camera rotates around the center of the viewport. + * + * Changing the origin allows you to adjust the point in the viewport from which rotation happens. + * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. + * + * See `setOrigin` to set both origins in a single, chainable call. + */ + originY: number; + + /** + * The Mask this Camera is using during render. + * Set the mask using the `setMask` method. Remove the mask using the `clearMask` method. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Set the Alpha level of this Camera. The alpha controls the opacity of the Camera as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * @param value The Camera alpha value. Default 1. + */ + setAlpha(value?: number): this; + + /** + * Sets the rotation origin of this Camera. + * + * The values are given in the range 0 to 1 and are only used when calculating Camera rotation. + * + * By default the camera rotates around the center of the viewport. + * + * Changing the origin allows you to adjust the point in the viewport from which rotation happens. + * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Calculates what the Camera.scrollX and scrollY values would need to be in order to move + * the Camera so it is centered on the given x and y coordinates, without actually moving + * the Camera there. The results are clamped based on the Camera bounds, if set. + * @param x The horizontal coordinate to center on. + * @param y The vertical coordinate to center on. + * @param out A Vec2 to store the values in. If not given a new Vec2 is created. + */ + getScroll(x: number, y: number, out?: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Moves the Camera horizontally so that it is centered on the given x coordinate, bounds allowing. + * Calling this does not change the scrollY value. + * @param x The horizontal coordinate to center on. + */ + centerOnX(x: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Moves the Camera vertically so that it is centered on the given y coordinate, bounds allowing. + * Calling this does not change the scrollX value. + * @param y The vertical coordinate to center on. + */ + centerOnY(y: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Moves the Camera so that it is centered on the given coordinates, bounds allowing. + * @param x The horizontal coordinate to center on. + * @param y The vertical coordinate to center on. + */ + centerOn(x: number, y: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Moves the Camera so that it is looking at the center of the Camera Bounds, if enabled. + */ + centerToBounds(): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Moves the Camera so that it is re-centered based on its viewport size. + */ + centerToSize(): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Takes an array of Game Objects and returns a new array featuring only those objects + * visible by this camera. + * @param renderableObjects An array of Game Objects to cull. + */ + cull(renderableObjects: G): G; + + /** + * Converts the given `x` and `y` coordinates into World space, based on this Cameras transform. + * You can optionally provide a Vector2, or similar object, to store the results in. + * @param x The x position to convert to world space. + * @param y The y position to convert to world space. + * @param output An optional object to store the results in. If not provided a new Vector2 will be created. + */ + getWorldPoint(x: number, y: number, output?: O): O; + + /** + * Given a Game Object, or an array of Game Objects, it will update all of their camera filter settings + * so that they are ignored by this Camera. This means they will not be rendered by this Camera. + * @param entries The Game Object, or array of Game Objects, to be ignored by this Camera. + */ + ignore(entries: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Internal preRender step. + * @param resolution The game resolution, as set in the Scale Manager. + */ + protected preRender(resolution: number): void; + + /** + * Takes an x value and checks it's within the range of the Camera bounds, adjusting if required. + * Do not call this method if you are not using camera bounds. + * @param x The value to horizontally scroll clamp. + */ + clampX(x: number): number; + + /** + * Takes a y value and checks it's within the range of the Camera bounds, adjusting if required. + * Do not call this method if you are not using camera bounds. + * @param y The value to vertically scroll clamp. + */ + clampY(y: number): number; + + /** + * If this Camera has previously had movement bounds set on it, this will remove them. + */ + removeBounds(): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the rotation of this Camera. This causes everything it renders to appear rotated. + * + * Rotating a camera does not rotate the viewport itself, it is applied during rendering. + * @param value The cameras angle of rotation, given in degrees. Default 0. + */ + setAngle(value?: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Sets the background color for this Camera. + * + * By default a Camera has a transparent background but it can be given a solid color, with any level + * of transparency, via this method. + * + * The color value can be specified using CSS color notation, hex or numbers. + * @param color The color value. In CSS, hex or numeric color notation. Default 'rgba(0,0,0,0)'. + */ + setBackgroundColor(color?: string | number | Phaser.Types.Display.InputColorObject): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the bounds of the Camera. The bounds are an axis-aligned rectangle. + * + * The Camera bounds controls where the Camera can scroll to, stopping it from scrolling off the + * edges and into blank space. It does not limit the placement of Game Objects, or where + * the Camera viewport can be positioned. + * + * Temporarily disable the bounds by changing the boolean `Camera.useBounds`. + * + * Clear the bounds entirely by calling `Camera.removeBounds`. + * + * If you set bounds that are smaller than the viewport it will stop the Camera from being + * able to scroll. The bounds can be positioned where-ever you wish. By default they are from + * 0x0 to the canvas width x height. This means that the coordinate 0x0 is the top left of + * the Camera bounds. However, you can position them anywhere. So if you wanted a game world + * that was 2048x2048 in size, with 0x0 being the center of it, you can set the bounds x/y + * to be -1024, -1024, with a width and height of 2048. Depending on your game you may find + * it easier for 0x0 to be the top-left of the bounds, or you may wish 0x0 to be the middle. + * @param x The top-left x coordinate of the bounds. + * @param y The top-left y coordinate of the bounds. + * @param width The width of the bounds, in pixels. + * @param height The height of the bounds, in pixels. + * @param centerOn If `true` the Camera will automatically be centered on the new bounds. Default false. + */ + setBounds(x: integer, y: integer, width: integer, height: integer, centerOn?: boolean): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Returns a rectangle containing the bounds of the Camera. + * + * If the Camera does not have any bounds the rectangle will be empty. + * + * The rectangle is a copy of the bounds, so is safe to modify. + * @param out An optional Rectangle to store the bounds in. If not given, a new Rectangle will be created. + */ + getBounds(out?: Phaser.Geom.Rectangle): Phaser.Geom.Rectangle; + + /** + * Sets the name of this Camera. + * This value is for your own use and isn't used internally. + * @param value The name of the Camera. Default ''. + */ + setName(value?: string): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the position of the Camera viewport within the game. + * + * This does not change where the camera is 'looking'. See `setScroll` to control that. + * @param x The top-left x coordinate of the Camera viewport. + * @param y The top-left y coordinate of the Camera viewport. Default x. + */ + setPosition(x: number, y?: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the rotation of this Camera. This causes everything it renders to appear rotated. + * + * Rotating a camera does not rotate the viewport itself, it is applied during rendering. + * @param value The rotation of the Camera, in radians. Default 0. + */ + setRotation(value?: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Should the Camera round pixel values to whole integers when rendering Game Objects? + * + * In some types of game, especially with pixel art, this is required to prevent sub-pixel aliasing. + * @param value `true` to round Camera pixels, `false` to not. + */ + setRoundPixels(value: boolean): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Sets the Scene the Camera is bound to. + * + * Also populates the `resolution` property and updates the internal size values. + * @param scene The Scene the camera is bound to. + */ + setScene(scene: Phaser.Scene): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the position of where the Camera is looking within the game. + * You can also modify the properties `Camera.scrollX` and `Camera.scrollY` directly. + * Use this method, or the scroll properties, to move your camera around the game world. + * + * This does not change where the camera viewport is placed. See `setPosition` to control that. + * @param x The x coordinate of the Camera in the game world. + * @param y The y coordinate of the Camera in the game world. Default x. + */ + setScroll(x: number, y?: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the size of the Camera viewport. + * + * By default a Camera is the same size as the game, but can be made smaller via this method, + * allowing you to create mini-cam style effects by creating and positioning a smaller Camera + * viewport within your game. + * @param width The width of the Camera viewport. + * @param height The height of the Camera viewport. Default width. + */ + setSize(width: integer, height?: integer): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * This method sets the position and size of the Camera viewport in a single call. + * + * If you're trying to change where the Camera is looking at in your game, then see + * the method `Camera.setScroll` instead. This method is for changing the viewport + * itself, not what the camera can see. + * + * By default a Camera is the same size as the game, but can be made smaller via this method, + * allowing you to create mini-cam style effects by creating and positioning a smaller Camera + * viewport within your game. + * @param x The top-left x coordinate of the Camera viewport. + * @param y The top-left y coordinate of the Camera viewport. + * @param width The width of the Camera viewport. + * @param height The height of the Camera viewport. Default width. + */ + setViewport(x: number, y: number, width: integer, height?: integer): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the zoom value of the Camera. + * + * Changing to a smaller value, such as 0.5, will cause the camera to 'zoom out'. + * Changing to a larger value, such as 2, will cause the camera to 'zoom in'. + * + * A value of 1 means 'no zoom' and is the default. + * + * Changing the zoom does not impact the Camera viewport in any way, it is only applied during rendering. + * @param value The zoom value of the Camera. The minimum it can be is 0.001. Default 1. + */ + setZoom(value?: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Sets the mask to be applied to this Camera during rendering. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * + * Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Camera it will be immediately replaced. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * + * Note: You cannot mask a Camera that has `renderToTexture` set. + * @param mask The mask this Camera will use when rendering. + * @param fixedPosition Should the mask translate along with the Camera, or be fixed in place and not impacted by the Cameras transform? Default true. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask, fixedPosition?: boolean): this; + + /** + * Clears the mask that this Camera was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Sets the visibility of this Camera. + * + * An invisible Camera will skip rendering and input tests of everything it can see. + * @param value The visible state of the Camera. + */ + setVisible(value: boolean): this; + + /** + * Returns an Object suitable for JSON storage containing all of the Camera viewport and rendering properties. + */ + toJSON(): Phaser.Types.Cameras.Scene2D.JSONCamera; + + /** + * Internal method called automatically by the Camera Manager. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected update(time: integer, delta: number): void; + + /** + * Destroys this Camera instance and its internal properties and references. + * Once destroyed you cannot use this Camera again, even if re-added to a Camera Manager. + * + * This method is called automatically by `CameraManager.remove` if that methods `runDestroy` argument is `true`, which is the default. + * + * Unless you have a specific reason otherwise, always use `CameraManager.remove` and allow it to handle the camera destruction, + * rather than calling this method directly. + */ + destroy(): void; + + /** + * The x position of the Camera viewport, relative to the top-left of the game canvas. + * The viewport is the area into which the camera renders. + * To adjust the position the camera is looking at in the game world, see the `scrollX` value. + */ + x: number; + + /** + * The y position of the Camera viewport, relative to the top-left of the game canvas. + * The viewport is the area into which the camera renders. + * To adjust the position the camera is looking at in the game world, see the `scrollY` value. + */ + y: number; + + /** + * The width of the Camera viewport, in pixels. + * + * The viewport is the area into which the Camera renders. Setting the viewport does + * not restrict where the Camera can scroll to. + */ + width: number; + + /** + * The height of the Camera viewport, in pixels. + * + * The viewport is the area into which the Camera renders. Setting the viewport does + * not restrict where the Camera can scroll to. + */ + height: number; + + /** + * The horizontal scroll position of this Camera. + * + * Change this value to cause the Camera to scroll around your Scene. + * + * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, + * will automatically adjust the Camera scroll values accordingly. + * + * You can set the bounds within which the Camera can scroll via the `setBounds` method. + */ + scrollX: number; + + /** + * The vertical scroll position of this Camera. + * + * Change this value to cause the Camera to scroll around your Scene. + * + * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, + * will automatically adjust the Camera scroll values accordingly. + * + * You can set the bounds within which the Camera can scroll via the `setBounds` method. + */ + scrollY: number; + + /** + * The Camera zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + */ + zoom: number; + + /** + * The horizontal position of the center of the Camera's viewport, relative to the left of the game canvas. + */ + readonly centerX: number; + + /** + * The vertical position of the center of the Camera's viewport, relative to the top of the game canvas. + */ + readonly centerY: number; + + /** + * The displayed width of the camera viewport, factoring in the camera zoom level. + * + * If a camera has a viewport width of 800 and a zoom of 0.5 then its display width + * would be 1600, as it's displaying twice as many pixels as zoom level 1. + * + * Equally, a camera with a width of 800 and zoom of 2 would have a display width + * of 400 pixels. + */ + readonly displayWidth: number; + + /** + * The displayed height of the camera viewport, factoring in the camera zoom level. + * + * If a camera has a viewport height of 600 and a zoom of 0.5 then its display height + * would be 1200, as it's displaying twice as many pixels as zoom level 1. + * + * Equally, a camera with a height of 600 and zoom of 2 would have a display height + * of 300 pixels. + */ + readonly displayHeight: number; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + } + + /** + * A Camera. + * + * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world, + * and can be positioned, rotated, zoomed and scrolled accordingly. + * + * A Camera consists of two elements: The viewport and the scroll values. + * + * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are + * created the same size as your game, but their position and size can be set to anything. This means if you + * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, + * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). + * + * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this + * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the + * viewport, and changing the viewport has no impact on the scrolling. + * + * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, + * allowing you to filter Game Objects out on a per-Camera basis. + * + * A Camera also has built-in special effects including Fade, Flash and Camera Shake. + */ + class Camera extends Phaser.Cameras.Scene2D.BaseCamera implements Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Tint { + /** + * + * @param x The x position of the Camera, relative to the top-left of the game canvas. + * @param y The y position of the Camera, relative to the top-left of the game canvas. + * @param width The width of the Camera, in pixels. + * @param height The height of the Camera, in pixels. + */ + constructor(x: number, y: number, width: number, height: number); + + /** + * Does this Camera allow the Game Objects it renders to receive input events? + */ + inputEnabled: boolean; + + /** + * The Camera Fade effect handler. + * To fade this camera see the `Camera.fade` methods. + */ + fadeEffect: Phaser.Cameras.Scene2D.Effects.Fade; + + /** + * The Camera Flash effect handler. + * To flash this camera see the `Camera.flash` method. + */ + flashEffect: Phaser.Cameras.Scene2D.Effects.Flash; + + /** + * The Camera Shake effect handler. + * To shake this camera see the `Camera.shake` method. + */ + shakeEffect: Phaser.Cameras.Scene2D.Effects.Shake; + + /** + * The Camera Pan effect handler. + * To pan this camera see the `Camera.pan` method. + */ + panEffect: Phaser.Cameras.Scene2D.Effects.Pan; + + /** + * The Camera Zoom effect handler. + * To zoom this camera see the `Camera.zoom` method. + */ + zoomEffect: Phaser.Cameras.Scene2D.Effects.Zoom; + + /** + * The linear interpolation value to use when following a target. + * + * Can also be set via `setLerp` or as part of the `startFollow` call. + * + * The default values of 1 means the camera will instantly snap to the target coordinates. + * A lower value, such as 0.1 means the camera will more slowly track the target, giving + * a smooth transition. You can set the horizontal and vertical values independently, and also + * adjust this value in real-time during your game. + * + * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis. + */ + lerp: Phaser.Math.Vector2; + + /** + * The values stored in this property are subtracted from the Camera targets position, allowing you to + * offset the camera from the actual target x/y coordinates by this amount. + * Can also be set via `setFollowOffset` or as part of the `startFollow` call. + */ + followOffset: Phaser.Math.Vector2; + + /** + * The Camera dead zone. + * + * The deadzone is only used when the camera is following a target. + * + * It defines a rectangular region within which if the target is present, the camera will not scroll. + * If the target moves outside of this area, the camera will begin scrolling in order to follow it. + * + * The `lerp` values that you can set for a follower target also apply when using a deadzone. + * + * You can directly set this property to be an instance of a Rectangle. Or, you can use the + * `setDeadzone` method for a chainable approach. + * + * The rectangle you provide can have its dimensions adjusted dynamically, however, please + * note that its position is updated every frame, as it is constantly re-centered on the cameras mid point. + * + * Calling `setDeadzone` with no arguments will reset an active deadzone, as will setting this property + * to `null`. + */ + deadzone: Phaser.Geom.Rectangle; + + /** + * Is this Camera rendering directly to the canvas or to a texture? + * + * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough) + * + * Once enabled you can toggle it by switching this property. + * + * To properly remove a render texture you should call the `clearRenderToTexture()` method. + */ + renderToTexture: boolean; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the HTML Canvas Element that the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only populated if Phaser is running with the Canvas Renderer. + */ + canvas: HTMLCanvasElement; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the Rendering Context belonging to the Canvas element the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only populated if Phaser is running with the Canvas Renderer. + */ + context: CanvasRenderingContext2D; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the GL Texture belonging the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only set if Phaser is running with the WebGL Renderer. + */ + glTexture: WebGLTexture; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the GL Frame Buffer belonging the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only set if Phaser is running with the WebGL Renderer. + */ + framebuffer: WebGLFramebuffer; + + /** + * If this Camera has been set to render to a texture and to use a custom pipeline, + * then this holds a reference to the pipeline the Camera is drawing with. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only set if Phaser is running with the WebGL Renderer. + */ + pipeline: any; + + /** + * Sets the Camera to render to a texture instead of to the main canvas. + * + * The Camera will redirect all Game Objects it's asked to render to this texture. + * + * During the render sequence, the texture itself will then be rendered to the main canvas. + * + * Doing this gives you the ability to modify the texture before this happens, + * allowing for special effects such as Camera specific shaders, or post-processing + * on the texture. + * + * If running under Canvas the Camera will render to its `canvas` property. + * + * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties. + * + * If you set a camera to render to a texture then it will emit 2 events during the render loop: + * + * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. + * + * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the + * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before + * it appears in-game. + * + * You should not enable this unless you plan on actually using the texture it creates + * somehow, otherwise you're just doubling the work required to render your game. + * + * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean. + * + * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method, + * which will delete the respective textures and free-up resources. + * @param pipeline An optional WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. + */ + setRenderToTexture(pipeline?: string | Phaser.Renderer.WebGL.WebGLPipeline): Phaser.Cameras.Scene2D.Camera; + + /** + * Sets the WebGL pipeline this Camera is using when rendering to a texture. + * + * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself. + * + * Call this method with no arguments to clear any previously set pipeline. + * @param pipeline The WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. Or if left empty it will clear the pipeline. + */ + setPipeline(pipeline?: string | Phaser.Renderer.WebGL.WebGLPipeline): Phaser.Cameras.Scene2D.Camera; + + /** + * If this Camera was set to render to a texture, this will clear the resources it was using and + * redirect it to render back to the primary Canvas again. + * + * If you only wish to temporarily disable rendering to a texture then you can toggle the + * property `renderToTexture` instead. + */ + clearRenderToTexture(): Phaser.Cameras.Scene2D.Camera; + + /** + * Sets the Camera dead zone. + * + * The deadzone is only used when the camera is following a target. + * + * It defines a rectangular region within which if the target is present, the camera will not scroll. + * If the target moves outside of this area, the camera will begin scrolling in order to follow it. + * + * The deadzone rectangle is re-positioned every frame so that it is centered on the mid-point + * of the camera. This allows you to use the object for additional game related checks, such as + * testing if an object is within it or not via a Rectangle.contains call. + * + * The `lerp` values that you can set for a follower target also apply when using a deadzone. + * + * Calling this method with no arguments will reset an active deadzone. + * @param width The width of the deadzone rectangle in pixels. If not specified the deadzone is removed. + * @param height The height of the deadzone rectangle in pixels. + */ + setDeadzone(width?: number, height?: number): Phaser.Cameras.Scene2D.Camera; + + /** + * Fades the Camera in from the given color over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 0. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 0. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 0. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + fadeIn(duration?: integer, red?: integer, green?: integer, blue?: integer, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Fades the Camera out to the given color over the duration specified. + * This is an alias for Camera.fade that forces the fade to start, regardless of existing fades. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 0. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 0. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 0. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + fadeOut(duration?: integer, red?: integer, green?: integer, blue?: integer, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Fades the Camera from the given color to transparent over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 0. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 0. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 0. + * @param force Force the effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + fadeFrom(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Fades the Camera from transparent to the given color over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 0. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 0. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 0. + * @param force Force the effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + fade(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Flashes the Camera by setting it to the given color immediately and then fading it away again quickly over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 250. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 255. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 255. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 255. + * @param force Force the effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + flash(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Shakes the Camera by the given intensity over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 100. + * @param intensity The intensity of the shake. Default 0.05. + * @param force Force the shake effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + shake(duration?: integer, intensity?: number, force?: boolean, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, + * over the duration and with the ease specified. + * @param x The destination x coordinate to scroll the center of the Camera viewport to. + * @param y The destination y coordinate to scroll the center of the Camera viewport to. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param ease The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. Default 'Linear'. + * @param force Force the pan effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * the current camera scroll x coordinate and the current camera scroll y coordinate. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + pan(x: number, y: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * This effect will zoom the Camera to the given scale, over the duration and with the ease specified. + * @param zoom The target Camera zoom value. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param ease The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. Default 'Linear'. + * @param force Force the pan effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * the current camera scroll x coordinate and the current camera scroll y coordinate. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + zoomTo(zoom: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Internal preRender step. + * @param resolution The game resolution, as set in the Scale Manager. + */ + protected preRender(resolution: number): void; + + /** + * Sets the linear interpolation value to use when following a target. + * + * The default values of 1 means the camera will instantly snap to the target coordinates. + * A lower value, such as 0.1 means the camera will more slowly track the target, giving + * a smooth transition. You can set the horizontal and vertical values independently, and also + * adjust this value in real-time during your game. + * + * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis. + * @param x The amount added to the horizontal linear interpolation of the follow target. Default 1. + * @param y The amount added to the vertical linear interpolation of the follow target. Default 1. + */ + setLerp(x?: number, y?: number): this; + + /** + * Sets the horizontal and vertical offset of the camera from its follow target. + * The values are subtracted from the targets position during the Cameras update step. + * @param x The horizontal offset from the camera follow target.x position. Default 0. + * @param y The vertical offset from the camera follow target.y position. Default 0. + */ + setFollowOffset(x?: number, y?: number): this; + + /** + * Sets the Camera to follow a Game Object. + * + * When enabled the Camera will automatically adjust its scroll position to keep the target Game Object + * in its center. + * + * You can set the linear interpolation value used in the follow code. + * Use low lerp values (such as 0.1) to automatically smooth the camera motion. + * + * If you find you're getting a slight "jitter" effect when following an object it's probably to do with sub-pixel + * rendering of the targets position. This can be rounded by setting the `roundPixels` argument to `true` to + * force full pixel rounding rendering. Note that this can still be broken if you have specified a non-integer zoom + * value on the camera. So be sure to keep the camera zoom to integers. + * @param target The target for the Camera to follow. + * @param roundPixels Round the camera position to whole integers to avoid sub-pixel rendering? Default false. + * @param lerpX A value between 0 and 1. This value specifies the amount of linear interpolation to use when horizontally tracking the target. The closer the value to 1, the faster the camera will track. Default 1. + * @param lerpY A value between 0 and 1. This value specifies the amount of linear interpolation to use when vertically tracking the target. The closer the value to 1, the faster the camera will track. Default 1. + * @param offsetX The horizontal offset from the camera follow target.x position. Default 0. + * @param offsetY The vertical offset from the camera follow target.y position. Default 0. + */ + startFollow(target: Phaser.GameObjects.GameObject | object, roundPixels?: boolean, lerpX?: number, lerpY?: number, offsetX?: number, offsetY?: number): this; + + /** + * Stops a Camera from following a Game Object, if previously set via `Camera.startFollow`. + */ + stopFollow(): Phaser.Cameras.Scene2D.Camera; + + /** + * Resets any active FX, such as a fade, flash or shake. Useful to call after a fade in order to + * remove the fade. + */ + resetFX(): Phaser.Cameras.Scene2D.Camera; + + /** + * Internal method called automatically by the Camera Manager. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected update(time: integer, delta: number): void; + + /** + * Destroys this Camera instance. You rarely need to call this directly. + * + * Called by the Camera Manager. If you wish to destroy a Camera please use `CameraManager.remove` as + * cameras are stored in a pool, ready for recycling later, and calling this directly will prevent that. + */ + destroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + } + + /** + * The Camera Manager is a plugin that belongs to a Scene and is responsible for managing all of the Scene Cameras. + * + * By default you can access the Camera Manager from within a Scene using `this.cameras`, although this can be changed + * in your game config. + * + * Create new Cameras using the `add` method. Or extend the Camera class with your own addition code and then add + * the new Camera in using the `addExisting` method. + * + * Cameras provide a view into your game world, and can be positioned, rotated, zoomed and scrolled accordingly. + * + * A Camera consists of two elements: The viewport and the scroll values. + * + * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are + * created the same size as your game, but their position and size can be set to anything. This means if you + * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, + * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). + * + * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this + * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the + * viewport, and changing the viewport has no impact on the scrolling. + * + * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, + * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique + * 'Game Object ignore capable' Cameras. Any Cameras beyond 31 that you create will all be given a Camera ID of + * zero, meaning that they cannot be used for Game Object exclusion. This means if you need your Camera to ignore + * Game Objects, make sure it's one of the first 31 created. + * + * A Camera also has built-in special effects including Fade, Flash, Camera Shake, Pan and Zoom. + */ + class CameraManager { + /** + * + * @param scene The Scene that owns the Camera Manager plugin. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene that owns the Camera Manager plugin. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems handler for the Scene that owns the Camera Manager. + */ + systems: Phaser.Scenes.Systems; + + /** + * All Cameras created by, or added to, this Camera Manager, will have their `roundPixels` + * property set to match this value. By default it is set to match the value set in the + * game configuration, but can be changed at any point. Equally, individual cameras can + * also be changed as needed. + */ + roundPixels: boolean; + + /** + * An Array of the Camera objects being managed by this Camera Manager. + * The Cameras are updated and rendered in the same order in which they appear in this array. + * Do not directly add or remove entries to this array. However, you can move the contents + * around the array should you wish to adjust the display order. + */ + cameras: Phaser.Cameras.Scene2D.Camera[]; + + /** + * A handy reference to the 'main' camera. By default this is the first Camera the + * Camera Manager creates. You can also set it directly, or use the `makeMain` argument + * in the `add` and `addExisting` methods. It allows you to access it from your game: + * + * ```javascript + * var cam = this.cameras.main; + * ``` + * + * Also see the properties `camera1`, `camera2` and so on. + */ + main: Phaser.Cameras.Scene2D.Camera; + + /** + * A default un-transformed Camera that doesn't exist on the camera list and doesn't + * count towards the total number of cameras being managed. It exists for other + * systems, as well as your own code, should they require a basic un-transformed + * camera instance from which to calculate a view matrix. + */ + default: Phaser.Cameras.Scene2D.Camera; + + /** + * Adds a new Camera into the Camera Manager. The Camera Manager can support up to 31 different Cameras. + * + * Each Camera has its own viewport, which controls the size of the Camera and its position within the canvas. + * + * Use the `Camera.scrollX` and `Camera.scrollY` properties to change where the Camera is looking, or the + * Camera methods such as `centerOn`. Cameras also have built in special effects, such as fade, flash, shake, + * pan and zoom. + * + * By default Cameras are transparent and will render anything that they can see based on their `scrollX` + * and `scrollY` values. Game Objects can be set to be ignored by a Camera by using the `Camera.ignore` method. + * + * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change + * it after creation if required. + * + * See the Camera class documentation for more details. + * @param x The horizontal position of the Camera viewport. Default 0. + * @param y The vertical position of the Camera viewport. Default 0. + * @param width The width of the Camera viewport. If not given it'll be the game config size. + * @param height The height of the Camera viewport. If not given it'll be the game config size. + * @param makeMain Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. Default false. + * @param name The name of the Camera. Default ''. + */ + add(x?: integer, y?: integer, width?: integer, height?: integer, makeMain?: boolean, name?: string): Phaser.Cameras.Scene2D.Camera; + + /** + * Adds an existing Camera into the Camera Manager. + * + * The Camera should either be a `Phaser.Cameras.Scene2D.Camera` instance, or a class that extends from it. + * + * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change + * it after addition if required. + * + * The Camera will be assigned an ID, which is used for Game Object exclusion and then added to the + * manager. As long as it doesn't already exist in the manager it will be added then returned. + * + * If this method returns `null` then the Camera already exists in this Camera Manager. + * @param camera The Camera to be added to the Camera Manager. + * @param makeMain Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. Default false. + */ + addExisting(camera: Phaser.Cameras.Scene2D.Camera, makeMain?: boolean): Phaser.Cameras.Scene2D.Camera; + + /** + * Gets the total number of Cameras in this Camera Manager. + * + * If the optional `isVisible` argument is set it will only count Cameras that are currently visible. + * @param isVisible Set the `true` to only include visible Cameras in the total. Default false. + */ + getTotal(isVisible?: boolean): integer; + + /** + * Populates this Camera Manager based on the given configuration object, or an array of config objects. + * + * See the `Phaser.Types.Cameras.Scene2D.CameraConfig` documentation for details of the object structure. + * @param config A Camera configuration object, or an array of them, to be added to this Camera Manager. + */ + fromJSON(config: Phaser.Types.Cameras.Scene2D.CameraConfig | Phaser.Types.Cameras.Scene2D.CameraConfig[]): Phaser.Cameras.Scene2D.CameraManager; + + /** + * Gets a Camera based on its name. + * + * Camera names are optional and don't have to be set, so this method is only of any use if you + * have given your Cameras unique names. + * @param name The name of the Camera. + */ + getCamera(name: string): Phaser.Cameras.Scene2D.Camera; + + /** + * Returns an array of all cameras below the given Pointer. + * + * The first camera in the array is the top-most camera in the camera list. + * @param pointer The Pointer to check against. + */ + getCamerasBelowPointer(pointer: Phaser.Input.Pointer): Phaser.Cameras.Scene2D.Camera[]; + + /** + * Removes the given Camera, or an array of Cameras, from this Camera Manager. + * + * If found in the Camera Manager it will be immediately removed from the local cameras array. + * If also currently the 'main' camera, 'main' will be reset to be camera 0. + * + * The removed Cameras are automatically destroyed if the `runDestroy` argument is `true`, which is the default. + * If you wish to re-use the cameras then set this to `false`, but know that they will retain their references + * and internal data until destroyed or re-added to a Camera Manager. + * @param camera The Camera, or an array of Cameras, to be removed from this Camera Manager. + * @param runDestroy Automatically call `Camera.destroy` on each Camera removed from this Camera Manager. Default true. + */ + remove(camera: Phaser.Cameras.Scene2D.Camera | Phaser.Cameras.Scene2D.Camera[], runDestroy?: boolean): integer; + + /** + * The internal render method. This is called automatically by the Scene and should not be invoked directly. + * + * It will iterate through all local cameras and render them in turn, as long as they're visible and have + * an alpha level > 0. + * @param renderer The Renderer that will render the children to this camera. + * @param children An array of renderable Game Objects. + * @param interpolation Interpolation value. Reserved for future use. + */ + protected render(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer, children: Phaser.GameObjects.GameObject[], interpolation: number): void; + + /** + * Resets this Camera Manager. + * + * This will iterate through all current Cameras, destroying them all, then it will reset the + * cameras array, reset the ID counter and create 1 new single camera using the default values. + */ + resetAll(): Phaser.Cameras.Scene2D.Camera; + + /** + * The main update loop. Called automatically when the Scene steps. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected update(time: integer, delta: number): void; + + /** + * The event handler that manages the `resize` event dispatched by the Scale Manager. + * @param gameSize The default Game Size object. This is the un-modified game dimensions. + * @param baseSize The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + */ + onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size): void; + + /** + * Resizes all cameras to the given dimensions. + * @param width The new width of the camera. + * @param height The new height of the camera. + */ + resize(width: number, height: number): void; + + } + + namespace Effects { + /** + * A Camera Fade effect. + * + * This effect will fade the camera viewport to the given color, over the duration specified. + * + * Only the camera viewport is faded. None of the objects it is displaying are impacted, i.e. their colors do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect, if required. + */ + class Fade { + /** + * + * @param camera The camera this effect is acting upon. + */ + constructor(camera: Phaser.Cameras.Scene2D.Camera); + + /** + * The Camera this effect belongs to. + */ + readonly camera: Phaser.Cameras.Scene2D.Camera; + + /** + * Is this effect actively running? + */ + readonly isRunning: boolean; + + /** + * Has this effect finished running? + * + * This is different from `isRunning` because it remains set to `true` when the effect is over, + * until the effect is either reset or started again. + */ + readonly isComplete: boolean; + + /** + * The direction of the fade. + * `true` = fade out (transparent to color), `false` = fade in (color to transparent) + */ + readonly direction: boolean; + + /** + * The duration of the effect, in milliseconds. + */ + readonly duration: integer; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + */ + progress: number; + + /** + * Fades the Camera to or from the given color over the duration specified. + * @param direction The direction of the fade. `true` = fade out (transparent to color), `false` = fade in (color to transparent) Default true. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 0. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 0. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 0. + * @param force Force the effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + start(direction?: boolean, duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraFadeCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * The main update loop for this effect. Called automatically by the Camera. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: integer, delta: number): void; + + /** + * Called internally by the Canvas Renderer. + * @param ctx The Canvas context to render to. + */ + postRenderCanvas(ctx: CanvasRenderingContext2D): boolean; + + /** + * Called internally by the WebGL Renderer. + * @param pipeline The WebGL Pipeline to render to. + * @param getTintFunction A function that will return the gl safe tint colors. + */ + postRenderWebGL(pipeline: Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline, getTintFunction: Function): boolean; + + /** + * Called internally when the effect completes. + */ + effectComplete(): void; + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + */ + reset(): void; + + /** + * Destroys this effect, releasing it from the Camera. + */ + destroy(): void; + + } + + /** + * A Camera Flash effect. + * + * This effect will flash the camera viewport to the given color, over the duration specified. + * + * Only the camera viewport is flashed. None of the objects it is displaying are impacted, i.e. their colors do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect, if required. + */ + class Flash { + /** + * + * @param camera The camera this effect is acting upon. + */ + constructor(camera: Phaser.Cameras.Scene2D.Camera); + + /** + * The Camera this effect belongs to. + */ + readonly camera: Phaser.Cameras.Scene2D.Camera; + + /** + * Is this effect actively running? + */ + readonly isRunning: boolean; + + /** + * The duration of the effect, in milliseconds. + */ + readonly duration: integer; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + */ + progress: number; + + /** + * Flashes the Camera to or from the given color over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 250. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 255. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 255. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 255. + * @param force Force the effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + start(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraFlashCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * The main update loop for this effect. Called automatically by the Camera. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: integer, delta: number): void; + + /** + * Called internally by the Canvas Renderer. + * @param ctx The Canvas context to render to. + */ + postRenderCanvas(ctx: CanvasRenderingContext2D): boolean; + + /** + * Called internally by the WebGL Renderer. + * @param pipeline The WebGL Pipeline to render to. + * @param getTintFunction A function that will return the gl safe tint colors. + */ + postRenderWebGL(pipeline: Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline, getTintFunction: Function): boolean; + + /** + * Called internally when the effect completes. + */ + effectComplete(): void; + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + */ + reset(): void; + + /** + * Destroys this effect, releasing it from the Camera. + */ + destroy(): void; + + } + + /** + * A Camera Pan effect. + * + * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, + * over the duration and with the ease specified. + * + * Only the camera scroll is moved. None of the objects it is displaying are impacted, i.e. their positions do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect if required. + */ + class Pan { + /** + * + * @param camera The camera this effect is acting upon. + */ + constructor(camera: Phaser.Cameras.Scene2D.Camera); + + /** + * The Camera this effect belongs to. + */ + readonly camera: Phaser.Cameras.Scene2D.Camera; + + /** + * Is this effect actively running? + */ + readonly isRunning: boolean; + + /** + * The duration of the effect, in milliseconds. + */ + readonly duration: integer; + + /** + * The starting scroll coordinates to pan the camera from. + */ + source: Phaser.Math.Vector2; + + /** + * The constantly updated value based on zoom. + */ + current: Phaser.Math.Vector2; + + /** + * The destination scroll coordinates to pan the camera to. + */ + destination: Phaser.Math.Vector2; + + /** + * The ease function to use during the pan. + */ + ease: Function; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + */ + progress: number; + + /** + * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, + * over the duration and with the ease specified. + * @param x The destination x coordinate to scroll the center of the Camera viewport to. + * @param y The destination y coordinate to scroll the center of the Camera viewport to. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param ease The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. Default 'Linear'. + * @param force Force the pan effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * the current camera scroll x coordinate and the current camera scroll y coordinate. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + start(x: number, y: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * The main update loop for this effect. Called automatically by the Camera. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: integer, delta: number): void; + + /** + * Called internally when the effect completes. + */ + effectComplete(): void; + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + */ + reset(): void; + + /** + * Destroys this effect, releasing it from the Camera. + */ + destroy(): void; + + } + + /** + * A Camera Shake effect. + * + * This effect will shake the camera viewport by a random amount, bounded by the specified intensity, each frame. + * + * Only the camera viewport is moved. None of the objects it is displaying are impacted, i.e. their positions do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect if required. + */ + class Shake { + /** + * + * @param camera The camera this effect is acting upon. + */ + constructor(camera: Phaser.Cameras.Scene2D.Camera); + + /** + * The Camera this effect belongs to. + */ + readonly camera: Phaser.Cameras.Scene2D.Camera; + + /** + * Is this effect actively running? + */ + readonly isRunning: boolean; + + /** + * The duration of the effect, in milliseconds. + */ + readonly duration: integer; + + /** + * The intensity of the effect. Use small float values. The default when the effect starts is 0.05. + * This is a Vector2 object, allowing you to control the shake intensity independently across x and y. + * You can modify this value while the effect is active to create more varied shake effects. + */ + intensity: Phaser.Math.Vector2; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + */ + progress: number; + + /** + * Shakes the Camera by the given intensity over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 100. + * @param intensity The intensity of the shake. Default 0.05. + * @param force Force the shake effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + start(duration?: integer, intensity?: number, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraShakeCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * The pre-render step for this effect. Called automatically by the Camera. + */ + preRender(): void; + + /** + * The main update loop for this effect. Called automatically by the Camera. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: integer, delta: number): void; + + /** + * Called internally when the effect completes. + */ + effectComplete(): void; + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + */ + reset(): void; + + /** + * Destroys this effect, releasing it from the Camera. + */ + destroy(): void; + + } + + /** + * A Camera Zoom effect. + * + * This effect will zoom the Camera to the given scale, over the duration and with the ease specified. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect if required. + */ + class Zoom { + /** + * + * @param camera The camera this effect is acting upon. + */ + constructor(camera: Phaser.Cameras.Scene2D.Camera); + + /** + * The Camera this effect belongs to. + */ + readonly camera: Phaser.Cameras.Scene2D.Camera; + + /** + * Is this effect actively running? + */ + readonly isRunning: boolean; + + /** + * The duration of the effect, in milliseconds. + */ + readonly duration: integer; + + /** + * The starting zoom value; + */ + source: number; + + /** + * The destination zoom value. + */ + destination: number; + + /** + * The ease function to use during the zoom. + */ + ease: Function; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + */ + progress: number; + + /** + * This effect will zoom the Camera to the given scale, over the duration and with the ease specified. + * @param zoom The target Camera zoom value. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param ease The ease to use for the Zoom. Can be any of the Phaser Easing constants or a custom function. Default 'Linear'. + * @param force Force the zoom effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent three arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * and the current camera zoom value. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + start(zoom: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraZoomCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * The main update loop for this effect. Called automatically by the Camera. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: integer, delta: number): void; + + /** + * Called internally when the effect completes. + */ + effectComplete(): void; + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + */ + reset(): void; + + /** + * Destroys this effect, releasing it from the Camera. + */ + destroy(): void; + + } + + } + + namespace Events { + /** + * The Destroy Camera Event. + * + * This event is dispatched by a Camera instance when it is destroyed by the Camera Manager. + */ + const DESTROY: any; + + /** + * The Camera Fade In Complete Event. + * + * This event is dispatched by a Camera instance when the Fade In Effect completes. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeincomplete', listener)`. + */ + const FADE_IN_COMPLETE: any; + + /** + * The Camera Fade In Start Event. + * + * This event is dispatched by a Camera instance when the Fade In Effect starts. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeinstart', listener)`. + */ + const FADE_IN_START: any; + + /** + * The Camera Fade Out Complete Event. + * + * This event is dispatched by a Camera instance when the Fade Out Effect completes. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeoutcomplete', listener)`. + */ + const FADE_OUT_COMPLETE: any; + + /** + * The Camera Fade Out Start Event. + * + * This event is dispatched by a Camera instance when the Fade Out Effect starts. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeoutstart', listener)`. + */ + const FADE_OUT_START: any; + + /** + * The Camera Flash Complete Event. + * + * This event is dispatched by a Camera instance when the Flash Effect completes. + */ + const FLASH_COMPLETE: any; + + /** + * The Camera Flash Start Event. + * + * This event is dispatched by a Camera instance when the Flash Effect starts. + */ + const FLASH_START: any; + + /** + * The Camera Pan Complete Event. + * + * This event is dispatched by a Camera instance when the Pan Effect completes. + */ + const PAN_COMPLETE: any; + + /** + * The Camera Pan Start Event. + * + * This event is dispatched by a Camera instance when the Pan Effect starts. + */ + const PAN_START: any; + + /** + * The Camera Post-Render Event. + * + * This event is dispatched by a Camera instance after is has finished rendering. + * It is only dispatched if the Camera is rendering to a texture. + * + * Listen to it from a Camera instance using: `camera.on('postrender', listener)`. + */ + const POST_RENDER: any; + + /** + * The Camera Pre-Render Event. + * + * This event is dispatched by a Camera instance when it is about to render. + * It is only dispatched if the Camera is rendering to a texture. + * + * Listen to it from a Camera instance using: `camera.on('prerender', listener)`. + */ + const PRE_RENDER: any; + + /** + * The Camera Shake Complete Event. + * + * This event is dispatched by a Camera instance when the Shake Effect completes. + */ + const SHAKE_COMPLETE: any; + + /** + * The Camera Shake Start Event. + * + * This event is dispatched by a Camera instance when the Shake Effect starts. + */ + const SHAKE_START: any; + + /** + * The Camera Zoom Complete Event. + * + * This event is dispatched by a Camera instance when the Zoom Effect completes. + */ + const ZOOM_COMPLETE: any; + + /** + * The Camera Zoom Start Event. + * + * This event is dispatched by a Camera instance when the Zoom Effect starts. + */ + const ZOOM_START: any; + + } + + } + + namespace Controls { + /** + * A Fixed Key Camera Control. + * + * This allows you to control the movement and zoom of a camera using the defined keys. + * + * ```javascript + * var camControl = new FixedKeyControl({ + * camera: this.cameras.main, + * left: cursors.left, + * right: cursors.right, + * speed: float OR { x: 0, y: 0 } + * }); + * ``` + * + * Movement is precise and has no 'smoothing' applied to it. + * + * You must call the `update` method of this controller every frame. + */ + class FixedKeyControl { + /** + * + * @param config The Fixed Key Control configuration object. + */ + constructor(config: Phaser.Types.Cameras.Controls.FixedKeyControlConfig); + + /** + * The Camera that this Control will update. + */ + camera: Phaser.Cameras.Scene2D.Camera; + + /** + * The Key to be pressed that will move the Camera left. + */ + left: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera right. + */ + right: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera up. + */ + up: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera down. + */ + down: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will zoom the Camera in. + */ + zoomIn: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will zoom the Camera out. + */ + zoomOut: Phaser.Input.Keyboard.Key; + + /** + * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. + */ + zoomSpeed: number; + + /** + * The horizontal speed the camera will move. + */ + speedX: number; + + /** + * The vertical speed the camera will move. + */ + speedY: number; + + /** + * A flag controlling if the Controls will update the Camera or not. + */ + active: boolean; + + /** + * Starts the Key Control running, providing it has been linked to a camera. + */ + start(): Phaser.Cameras.Controls.FixedKeyControl; + + /** + * Stops this Key Control from running. Call `start` to start it again. + */ + stop(): Phaser.Cameras.Controls.FixedKeyControl; + + /** + * Binds this Key Control to a camera. + * @param camera The camera to bind this Key Control to. + */ + setCamera(camera: Phaser.Cameras.Scene2D.Camera): Phaser.Cameras.Controls.FixedKeyControl; + + /** + * Applies the results of pressing the control keys to the Camera. + * + * You must call this every step, it is not called automatically. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(delta: number): void; + + /** + * Destroys this Key Control. + */ + destroy(): void; + + } + + /** + * A Smoothed Key Camera Control. + * + * This allows you to control the movement and zoom of a camera using the defined keys. + * Unlike the Fixed Camera Control you can also provide physics values for acceleration, drag and maxSpeed for smoothing effects. + * + * ```javascript + * var controlConfig = { + * camera: this.cameras.main, + * left: cursors.left, + * right: cursors.right, + * up: cursors.up, + * down: cursors.down, + * zoomIn: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.Q), + * zoomOut: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.E), + * zoomSpeed: 0.02, + * acceleration: 0.06, + * drag: 0.0005, + * maxSpeed: 1.0 + * }; + * ``` + * + * You must call the `update` method of this controller every frame. + */ + class SmoothedKeyControl { + /** + * + * @param config The Smoothed Key Control configuration object. + */ + constructor(config: Phaser.Types.Cameras.Controls.SmoothedKeyControlConfig); + + /** + * The Camera that this Control will update. + */ + camera: Phaser.Cameras.Scene2D.Camera; + + /** + * The Key to be pressed that will move the Camera left. + */ + left: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera right. + */ + right: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera up. + */ + up: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera down. + */ + down: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will zoom the Camera in. + */ + zoomIn: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will zoom the Camera out. + */ + zoomOut: Phaser.Input.Keyboard.Key; + + /** + * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. + */ + zoomSpeed: number; + + /** + * The horizontal acceleration the camera will move. + */ + accelX: number; + + /** + * The vertical acceleration the camera will move. + */ + accelY: number; + + /** + * The horizontal drag applied to the camera when it is moving. + */ + dragX: number; + + /** + * The vertical drag applied to the camera when it is moving. + */ + dragY: number; + + /** + * The maximum horizontal speed the camera will move. + */ + maxSpeedX: number; + + /** + * The maximum vertical speed the camera will move. + */ + maxSpeedY: number; + + /** + * A flag controlling if the Controls will update the Camera or not. + */ + active: boolean; + + /** + * Starts the Key Control running, providing it has been linked to a camera. + */ + start(): Phaser.Cameras.Controls.SmoothedKeyControl; + + /** + * Stops this Key Control from running. Call `start` to start it again. + */ + stop(): Phaser.Cameras.Controls.SmoothedKeyControl; + + /** + * Binds this Key Control to a camera. + * @param camera The camera to bind this Key Control to. + */ + setCamera(camera: Phaser.Cameras.Scene2D.Camera): Phaser.Cameras.Controls.SmoothedKeyControl; + + /** + * Applies the results of pressing the control keys to the Camera. + * + * You must call this every step, it is not called automatically. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(delta: number): void; + + /** + * Destroys this Key Control. + */ + destroy(): void; + + } + + } + + } + + /** + * Phaser Release Version + */ + const VERSION: string; + + /** + * AUTO Detect Renderer. + */ + const AUTO: integer; + + /** + * Canvas Renderer. + */ + const CANVAS: integer; + + /** + * WebGL Renderer. + */ + const WEBGL: integer; + + /** + * Headless Renderer. + */ + const HEADLESS: integer; + + /** + * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead + * to help you remember what the value is doing in your code. + */ + const FOREVER: integer; + + /** + * Direction constant. + */ + const NONE: integer; + + /** + * Direction constant. + */ + const UP: integer; + + /** + * Direction constant. + */ + const DOWN: integer; + + /** + * Direction constant. + */ + const LEFT: integer; + + /** + * Direction constant. + */ + const RIGHT: integer; + + /** + * The Phaser.Game instance is the main controller for the entire Phaser game. It is responsible + * for handling the boot process, parsing the configuration values, creating the renderer, + * and setting-up all of the global Phaser systems, such as sound and input. + * Once that is complete it will start the Scene Manager and then begin the main game loop. + * + * You should generally avoid accessing any of the systems created by Game, and instead use those + * made available to you via the Phaser.Scene Systems class instead. + */ + class Game { + /** + * + * @param GameConfig The configuration object for your Phaser Game instance. + */ + constructor(GameConfig?: Phaser.Types.Core.GameConfig); + + /** + * The parsed Game Configuration object. + * + * The values stored within this object are read-only and should not be changed at run-time. + */ + readonly config: Phaser.Core.Config; + + /** + * A reference to either the Canvas or WebGL Renderer that this Game is using. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * A reference to an HTML Div Element used as the DOM Element Container. + * + * Only set if `createDOMContainer` is `true` in the game config (by default it is `false`) and + * if you provide a parent element to insert the Phaser Game inside. + * + * See the DOM Element Game Object for more details. + */ + domContainer: HTMLDivElement; + + /** + * A reference to the HTML Canvas Element that Phaser uses to render the game. + * This is created automatically by Phaser unless you provide a `canvas` property + * in your Game Config. + */ + canvas: HTMLCanvasElement; + + /** + * A reference to the Rendering Context belonging to the Canvas Element this game is rendering to. + * If the game is running under Canvas it will be a 2d Canvas Rendering Context. + * If the game is running under WebGL it will be a WebGL Rendering Context. + * This context is created automatically by Phaser unless you provide a `context` property + * in your Game Config. + */ + context: CanvasRenderingContext2D | WebGLRenderingContext; + + /** + * A flag indicating when this Game instance has finished its boot process. + */ + readonly isBooted: boolean; + + /** + * A flag indicating if this Game is currently running its game step or not. + */ + readonly isRunning: boolean; + + /** + * An Event Emitter which is used to broadcast game-level events from the global systems. + */ + events: Phaser.Events.EventEmitter; + + /** + * An instance of the Animation Manager. + * + * The Animation Manager is a global system responsible for managing all animations used within your game. + */ + anims: Phaser.Animations.AnimationManager; + + /** + * An instance of the Texture Manager. + * + * The Texture Manager is a global system responsible for managing all textures being used by your game. + */ + textures: Phaser.Textures.TextureManager; + + /** + * An instance of the Cache Manager. + * + * The Cache Manager is a global system responsible for caching, accessing and releasing external game assets. + */ + cache: Phaser.Cache.CacheManager; + + /** + * An instance of the Data Manager + */ + registry: Phaser.Data.DataManager; + + /** + * An instance of the Input Manager. + * + * The Input Manager is a global system responsible for the capture of browser-level input events. + */ + input: Phaser.Input.InputManager; + + /** + * An instance of the Scene Manager. + * + * The Scene Manager is a global system responsible for creating, modifying and updating the Scenes in your game. + */ + scene: Phaser.Scenes.SceneManager; + + /** + * A reference to the Device inspector. + * + * Contains information about the device running this game, such as OS, browser vendor and feature support. + * Used by various systems to determine capabilities and code paths. + */ + device: Phaser.DeviceConf; + + /** + * An instance of the Scale Manager. + * + * The Scale Manager is a global system responsible for handling scaling of the game canvas. + */ + scale: Phaser.Scale.ScaleManager; + + /** + * An instance of the base Sound Manager. + * + * The Sound Manager is a global system responsible for the playback and updating of all audio in your game. + * + * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag. + */ + sound: Phaser.Sound.BaseSoundManager; + + /** + * An instance of the Time Step. + * + * The Time Step is a global system responsible for setting-up and responding to the browser frame events, processing + * them and calculating delta values. It then automatically calls the game step. + */ + loop: Phaser.Core.TimeStep; + + /** + * An instance of the Plugin Manager. + * + * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install + * those plugins into Scenes as required. + */ + plugins: Phaser.Plugins.PluginManager; + + /** + * An instance of the Facebook Instant Games Plugin. + * + * This will only be available if the plugin has been built into Phaser, + * or you're using the special Facebook Instant Games custom build. + */ + facebook: Phaser.FacebookInstantGamesPlugin; + + /** + * Does the window the game is running in currently have focus or not? + * This is modified by the VisibilityHandler. + */ + readonly hasFocus: boolean; + + /** + * This method is called automatically when the DOM is ready. It is responsible for creating the renderer, + * displaying the Debug Header, adding the game canvas to the DOM and emitting the 'boot' event. + * It listens for a 'ready' event from the base systems and once received it will call `Game.start`. + */ + protected boot(): void; + + /** + * Called automatically by Game.boot once all of the global systems have finished setting themselves up. + * By this point the Game is now ready to start the main loop running. + * It will also enable the Visibility Handler. + */ + protected start(): void; + + /** + * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of + * Request Animation Frame, or Set Timeout on very old browsers.) + * + * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager. + * + * It will then render each Scene in turn, via the Renderer. This process emits `prerender` and `postrender` events. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + step(time: number, delta: number): void; + + /** + * A special version of the Game Step for the HEADLESS renderer only. + * + * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of + * Request Animation Frame, or Set Timeout on very old browsers.) + * + * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager. + * + * This process emits `prerender` and `postrender` events, even though nothing actually displays. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + headlessStep(time: number, delta: number): void; + + /** + * Called automatically by the Visibility Handler. + * This will pause the main loop and then emit a pause event. + */ + protected onHidden(): void; + + /** + * Called automatically by the Visibility Handler. + * This will resume the main loop and then emit a resume event. + */ + protected onVisible(): void; + + /** + * Called automatically by the Visibility Handler. + * This will set the main loop into a 'blurred' state, which pauses it. + */ + protected onBlur(): void; + + /** + * Called automatically by the Visibility Handler. + * This will set the main loop into a 'focused' state, which resumes it. + */ + protected onFocus(): void; + + /** + * Returns the current game frame. + * + * When the game starts running, the frame is incremented every time Request Animation Frame, or Set Timeout, fires. + */ + getFrame(): number; + + /** + * Returns the time that the current game step started at, as based on `performance.now`. + */ + getTime(): number; + + /** + * Flags this Game instance as needing to be destroyed on the _next frame_, making this an asynchronous operation. + * + * It will wait until the current frame has completed and then call `runDestroy` internally. + * + * If you need to react to the games eventual destruction, listen for the `DESTROY` event. + * + * If you **do not** need to run Phaser again on the same web page you can set the `noReturn` argument to `true` and it will free-up + * memory being held by the core Phaser plugins. If you do need to create another game instance on the same page, leave this as `false`. + * @param removeCanvas Set to `true` if you would like the parent canvas element removed from the DOM, or `false` to leave it in place. + * @param noReturn If `true` all the core Phaser plugins are destroyed. You cannot create another instance of Phaser on the same web page if you do this. Default false. + */ + destroy(removeCanvas: boolean, noReturn?: boolean): void; + + } + + namespace Core { + /** + * The active game configuration settings, parsed from a {@link Phaser.Types.Core.GameConfig} object. + */ + class Config { + /** + * + * @param GameConfig The configuration object for your Phaser Game instance. + */ + constructor(GameConfig?: Phaser.Types.Core.GameConfig); + + /** + * The width of the underlying canvas, in pixels. + */ + readonly width: integer | string; + + /** + * The height of the underlying canvas, in pixels. + */ + readonly height: integer | string; + + /** + * The zoom factor, as used by the Scale Manager. + */ + readonly zoom: Phaser.Scale.ZoomType | integer; + + /** + * The canvas device pixel resolution. Currently un-used. + */ + readonly resolution: number; + + /** + * A parent DOM element into which the canvas created by the renderer will be injected. + */ + readonly parent: any; + + /** + * The scale mode as used by the Scale Manager. The default is zero, which is no scaling. + */ + readonly scaleMode: Phaser.Scale.ScaleModeType; + + /** + * Is the Scale Manager allowed to adjust the CSS height property of the parent to be 100%? + */ + readonly expandParent: boolean; + + /** + * Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. + */ + readonly autoRound: integer; + + /** + * Automatically center the canvas within the parent? + */ + readonly autoCenter: Phaser.Scale.CenterType; + + /** + * How many ms should elapse before checking if the browser size has changed? + */ + readonly resizeInterval: integer; + + /** + * The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. + */ + readonly fullscreenTarget: HTMLElement | string; + + /** + * The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. + */ + readonly minWidth: integer; + + /** + * The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. + */ + readonly maxWidth: integer; + + /** + * The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. + */ + readonly minHeight: integer; + + /** + * The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. + */ + readonly maxHeight: integer; + + /** + * Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default) + */ + readonly renderType: number; + + /** + * Force Phaser to use your own Canvas element instead of creating one. + */ + readonly canvas: HTMLCanvasElement; + + /** + * Force Phaser to use your own Canvas context instead of creating one. + */ + readonly context: CanvasRenderingContext2D | WebGLRenderingContext; + + /** + * Optional CSS attributes to be set on the canvas object created by the renderer. + */ + readonly canvasStyle: string; + + /** + * Is Phaser running under a custom (non-native web) environment? If so, set this to `true` to skip internal Feature detection. If `true` the `renderType` cannot be left as `AUTO`. + */ + readonly customEnvironment: boolean; + + /** + * The default Scene configuration object. + */ + readonly sceneConfig: object; + + /** + * A seed which the Random Data Generator will use. If not given, a dynamic seed based on the time is used. + */ + readonly seed: string[]; + + /** + * The title of the game. + */ + readonly gameTitle: string; + + /** + * The URL of the game. + */ + readonly gameURL: string; + + /** + * The version of the game. + */ + readonly gameVersion: string; + + /** + * If `true` the window will automatically be given focus immediately and on any future mousedown event. + */ + readonly autoFocus: boolean; + + /** + * Should the game create a div element to act as a DOM Container? Only enable if you're using DOM Element objects. You must provide a parent object if you use this feature. + */ + readonly domCreateContainer: boolean; + + /** + * Should the DOM Container that is created (if `dom.createContainer` is true) be positioned behind (true) or over the top (false, the default) of the game canvas? + */ + readonly domBehindCanvas: boolean; + + /** + * Enable the Keyboard Plugin. This can be disabled in games that don't need keyboard input. + */ + readonly inputKeyboard: boolean; + + /** + * The DOM Target to listen for keyboard events on. Defaults to `window` if not specified. + */ + readonly inputKeyboardEventTarget: any; + + /** + * `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty. + */ + readonly inputKeyboardCapture: integer[]; + + /** + * Enable the Mouse Plugin. This can be disabled in games that don't need mouse input. + */ + readonly inputMouse: boolean | object; + + /** + * The DOM Target to listen for mouse events on. Defaults to the game canvas if not specified. + */ + readonly inputMouseEventTarget: any; + + /** + * Should mouse events be captured? I.e. have prevent default called on them. + */ + readonly inputMouseCapture: boolean; + + /** + * Enable the Touch Plugin. This can be disabled in games that don't need touch input. + */ + readonly inputTouch: boolean; + + /** + * The DOM Target to listen for touch events on. Defaults to the game canvas if not specified. + */ + readonly inputTouchEventTarget: any; + + /** + * Should touch events be captured? I.e. have prevent default called on them. + */ + readonly inputTouchCapture: boolean; + + /** + * The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1. + */ + readonly inputActivePointers: integer; + + /** + * The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. + */ + readonly inputSmoothFactor: integer; + + /** + * Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire. + */ + readonly inputWindowEvents: boolean; + + /** + * Enable the Gamepad Plugin. This can be disabled in games that don't need gamepad input. + */ + readonly inputGamepad: boolean; + + /** + * The DOM Target to listen for gamepad events on. Defaults to `window` if not specified. + */ + readonly inputGamepadEventTarget: any; + + /** + * Set to `true` to disable the right-click context menu. + */ + readonly disableContextMenu: boolean; + + /** + * The Audio Configuration object. + */ + readonly audio: Phaser.Types.Core.AudioConfig; + + /** + * Don't write the banner line to the console.log. + */ + readonly hideBanner: boolean; + + /** + * Omit Phaser's name and version from the banner. + */ + readonly hidePhaser: boolean; + + /** + * The color of the banner text. + */ + readonly bannerTextColor: string; + + /** + * The background colors of the banner. + */ + readonly bannerBackgroundColor: string[]; + + /** + * The Frame Rate Configuration object, as parsed by the Timestep class. + */ + readonly fps: Phaser.Types.Core.FPSConfig; + + /** + * When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. + */ + readonly antialias: boolean; + + /** + * When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details. + */ + readonly desynchronized: boolean; + + /** + * Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. + */ + readonly roundPixels: boolean; + + /** + * Prevent pixel art from becoming blurred when scaled. It will remain crisp (tells the WebGL renderer to automatically create textures using a linear filter mode). + */ + readonly pixelArt: boolean; + + /** + * Whether the game canvas will have a transparent background. + */ + readonly transparent: boolean; + + /** + * Whether the game canvas will be cleared between each rendering frame. You can disable this if you have a full-screen background image or game object. + */ + readonly clearBeforeRender: boolean; + + /** + * In WebGL mode, sets the drawing buffer to contain colors with pre-multiplied alpha. + */ + readonly premultipliedAlpha: boolean; + + /** + * Let the browser abort creating a WebGL context if it judges performance would be unacceptable. + */ + readonly failIfMajorPerformanceCaveat: boolean; + + /** + * "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. + */ + readonly powerPreference: string; + + /** + * The default WebGL Batch size. + */ + readonly batchSize: integer; + + /** + * The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. + */ + readonly maxLights: integer; + + /** + * The background color of the game canvas. The default is black. This value is ignored if `transparent` is set to `true`. + */ + readonly backgroundColor: Phaser.Display.Color; + + /** + * Called before Phaser boots. Useful for initializing anything not related to Phaser that Phaser may require while booting. + */ + readonly preBoot: Phaser.Types.Core.BootCallback; + + /** + * A function to run at the end of the boot sequence. At this point, all the game systems have started and plugins have been loaded. + */ + readonly postBoot: Phaser.Types.Core.BootCallback; + + /** + * The Physics Configuration object. + */ + readonly physics: Phaser.Types.Core.PhysicsConfig; + + /** + * The default physics system. It will be started for each scene. Either 'arcade', 'impact' or 'matter'. + */ + readonly defaultPhysicsSystem: boolean | string; + + /** + * A URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'. + */ + readonly loaderBaseURL: string; + + /** + * A URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'. + */ + readonly loaderPath: string; + + /** + * Maximum parallel downloads allowed for resources (Default to 32). + */ + readonly loaderMaxParallelDownloads: integer; + + /** + * 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. + */ + readonly loaderCrossOrigin: string | undefined; + + /** + * The response type of the XHR request, e.g. `blob`, `text`, etc. + */ + readonly loaderResponseType: string; + + /** + * Should the XHR request use async or not? + */ + readonly loaderAsync: boolean; + + /** + * Optional username for all XHR requests. + */ + readonly loaderUser: string; + + /** + * Optional password for all XHR requests. + */ + readonly loaderPassword: string; + + /** + * Optional XHR timeout value, in ms. + */ + readonly loaderTimeout: integer; + + /** + * An array of global plugins to be installed. + */ + readonly installGlobalPlugins: any; + + /** + * An array of Scene level plugins to be installed. + */ + readonly installScenePlugins: any; + + /** + * The plugins installed into every Scene (in addition to CoreScene and Global). + */ + readonly defaultPlugins: any; + + /** + * A base64 encoded PNG that will be used as the default blank texture. + */ + readonly defaultImage: string; + + /** + * A base64 encoded PNG that will be used as the default texture when a texture is assigned that is missing or not loaded. + */ + readonly missingImage: string; + + } + + /** + * Called automatically by Phaser.Game and responsible for creating the renderer it will use. + * + * Relies upon two webpack global flags to be defined: `WEBGL_RENDERER` and `CANVAS_RENDERER` during build time, but not at run-time. + * @param game The Phaser.Game instance on which the renderer will be set. + */ + function CreateRenderer(game: Phaser.Game): void; + + /** + * Called automatically by Phaser.Game and responsible for creating the console.log debug header. + * + * You can customize or disable the header via the Game Config object. + * @param game The Phaser.Game instance which will output this debug header. + */ + function DebugHeader(game: Phaser.Game): void; + + namespace Events { + /** + * The Game Blur Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps + * tab, or if they simply remove focus from the browser to another app. + */ + const BLUR: any; + + /** + * The Game Boot Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. + * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. + */ + const BOOT: any; + + /** + * The Game Destroy Event. + * + * This event is dispatched when the game instance has been told to destroy itself. + * Lots of internal systems listen to this event in order to clear themselves out. + * Custom plugins and game code should also do the same. + */ + const DESTROY: any; + + /** + * The Game Focus Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. + */ + const FOCUS: any; + + /** + * The Game Hidden Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. + * + * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which + * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something + * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) + */ + const HIDDEN: any; + + /** + * The Game Pause Event. + * + * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. + */ + const PAUSE: any; + + /** + * The Game Post-Render Event. + * + * This event is dispatched right at the end of the render process. + * + * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. + * Use it for any last minute post-processing before the next game step begins. + */ + const POST_RENDER: any; + + /** + * The Game Post-Step Event. + * + * This event is dispatched after the Scene Manager has updated. + * Hook into it from plugins or systems that need to do things before the render starts. + */ + const POST_STEP: any; + + /** + * The Game Pre-Render Event. + * + * This event is dispatched immediately before any of the Scenes have started to render. + * + * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. + */ + const PRE_RENDER: any; + + /** + * The Game Pre-Step Event. + * + * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. + * Hook into it from plugins or systems that need to update before the Scene Manager does. + */ + const PRE_STEP: any; + + /** + * The Game Ready Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, + * and all local systems are now able to start. + */ + const READY: any; + + /** + * The Game Resume Event. + * + * This event is dispatched when the game loop leaves a paused state and resumes running. + */ + const RESUME: any; + + /** + * The Game Step Event. + * + * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. + * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. + */ + const STEP: any; + + /** + * The Game Visible Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a visible state, previously having been hidden. + * + * Only browsers that support the Visibility API will cause this event to be emitted. + */ + const VISIBLE: any; + + } + + /** + * [description] + */ + class TimeStep { + /** + * + * @param game A reference to the Phaser.Game instance that owns this Time Step. + */ + constructor(game: Phaser.Game, config: Phaser.Types.Core.FPSConfig); + + /** + * A reference to the Phaser.Game instance. + */ + readonly game: Phaser.Game; + + /** + * [description] + */ + readonly raf: Phaser.DOM.RequestAnimationFrame; + + /** + * A flag that is set once the TimeStep has started running and toggled when it stops. + */ + readonly started: boolean; + + /** + * A flag that is set once the TimeStep has started running and toggled when it stops. + * The difference between this value and `started` is that `running` is toggled when + * the TimeStep is sent to sleep, where-as `started` remains `true`, only changing if + * the TimeStep is actually stopped, not just paused. + */ + readonly running: boolean; + + /** + * The minimum fps rate you want the Time Step to run at. + */ + minFps: integer; + + /** + * The target fps rate for the Time Step to run at. + * + * Setting this value will not actually change the speed at which the browser runs, that is beyond + * the control of Phaser. Instead, it allows you to determine performance issues and if the Time Step + * is spiraling out of control. + */ + targetFps: integer; + + /** + * An exponential moving average of the frames per second. + */ + readonly actualFps: integer; + + /** + * [description] + */ + readonly nextFpsUpdate: integer; + + /** + * The number of frames processed this second. + */ + readonly framesThisSecond: integer; + + /** + * A callback to be invoked each time the Time Step steps. + */ + callback: Phaser.Types.Core.TimeStepCallback; + + /** + * You can force the Time Step to use Set Timeout instead of Request Animation Frame by setting + * the `forceSetTimeOut` property to `true` in the Game Configuration object. It cannot be changed at run-time. + */ + readonly forceSetTimeOut: boolean; + + /** + * The time, calculated at the start of the current step, as smoothed by the delta value. + */ + time: number; + + /** + * The time at which the game started running. This value is adjusted if the game is then + * paused and resumes. + */ + startTime: number; + + /** + * The time, as returned by `performance.now` of the previous step. + */ + lastTime: number; + + /** + * The current frame the game is on. This counter is incremented once every game step, regardless of how much + * time has passed and is unaffected by delta smoothing. + */ + readonly frame: integer; + + /** + * Is the browser currently considered in focus by the Page Visibility API? + * This value is set in the `blur` method, which is called automatically by the Game instance. + */ + readonly inFocus: boolean; + + /** + * The delta time, in ms, since the last game step. This is a clamped and smoothed average value. + */ + delta: integer; + + /** + * Internal index of the delta history position. + */ + deltaIndex: integer; + + /** + * Internal array holding the previous delta values, used for delta smoothing. + */ + deltaHistory: integer[]; + + /** + * The maximum number of delta values that are retained in order to calculate a smoothed moving average. + * + * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. + */ + deltaSmoothingMax: integer; + + /** + * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually + * as a result of switching tabs and regaining focus. + * + * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. + */ + panicMax: integer; + + /** + * The actual elapsed time in ms between one update and the next. + * + * Unlike with `delta`, no smoothing, capping, or averaging is applied to this value. + * So please be careful when using this value in math calculations. + */ + rawDelta: number; + + /** + * The time, as returned by `performance.now` at the very start of the current step. + * This can differ from the `time` value in that it isn't calculated based on the delta value. + */ + now: number; + + /** + * Called by the Game instance when the DOM window.onBlur event triggers. + */ + blur(): void; + + /** + * Called by the Game instance when the DOM window.onFocus event triggers. + */ + focus(): void; + + /** + * Called when the visibility API says the game is 'hidden' (tab switch out of view, etc) + */ + pause(): void; + + /** + * Called when the visibility API says the game is 'visible' again (tab switch back into view, etc) + */ + resume(): void; + + /** + * Resets the time, lastTime, fps averages and delta history. + * Called automatically when a browser sleeps them resumes. + */ + resetDelta(): void; + + /** + * Starts the Time Step running, if it is not already doing so. + * Called automatically by the Game Boot process. + * @param callback The callback to be invoked each time the Time Step steps. + */ + start(callback: Phaser.Types.Core.TimeStepCallback): void; + + /** + * The main step method. This is called each time the browser updates, either by Request Animation Frame, + * or by Set Timeout. It is responsible for calculating the delta values, frame totals, cool down history and more. + * You generally should never call this method directly. + */ + step(): void; + + /** + * Manually calls `TimeStep.step`. + */ + tick(): void; + + /** + * Sends the TimeStep to sleep, stopping Request Animation Frame (or SetTimeout) and toggling the `running` flag to false. + */ + sleep(): void; + + /** + * Wakes-up the TimeStep, restarting Request Animation Frame (or SetTimeout) and toggling the `running` flag to true. + * The `seamless` argument controls if the wake-up should adjust the start time or not. + * @param seamless Adjust the startTime based on the lastTime values. Default false. + */ + wake(seamless?: boolean): void; + + /** + * Gets the duration which the game has been running, in seconds. + */ + getDuration(): number; + + /** + * Gets the duration which the game has been running, in ms. + */ + getDurationMS(): number; + + /** + * Stops the TimeStep running. + */ + stop(): Phaser.Core.TimeStep; + + /** + * Destroys the TimeStep. This will stop Request Animation Frame, stop the step, clear the callbacks and null + * any objects. + */ + destroy(): void; + + } + + /** + * The Visibility Handler is responsible for listening out for document level visibility change events. + * This includes `visibilitychange` if the browser supports it, and blur and focus events. It then uses + * the provided Event Emitter and fires the related events. + * @param game The Game instance this Visibility Handler is working on. + */ + function VisibilityHandler(game: Phaser.Game): void; + + } + + namespace Create { + /** + * [description] + * @param config [description] + */ + function GenerateTexture(config: Phaser.Types.Create.GenerateTextureConfig): HTMLCanvasElement; + + namespace Palettes { + /** + * A 16 color palette by [Arne](http://androidarts.com/palette/16pal.htm) + */ + var ARNE16: Phaser.Types.Create.Palette; + + /** + * A 16 color palette inspired by the Commodore 64. + */ + var C64: Phaser.Types.Create.Palette; + + /** + * A 16 color CGA inspired palette by [Arne](http://androidarts.com/palette/16pal.htm) + */ + var CGA: Phaser.Types.Create.Palette; + + /** + * A 16 color JMP palette by [Arne](http://androidarts.com/palette/16pal.htm) + */ + var JMP: Phaser.Types.Create.Palette; + + /** + * A 16 color palette inspired by Japanese computers like the MSX. + */ + var MSX: Phaser.Types.Create.Palette; + + } + + } + + namespace Curves { + /** + * A higher-order Bézier curve constructed of four points. + */ + class CubicBezier extends Phaser.Curves.Curve { + /** + * + * @param p0 Start point, or an array of point pairs. + * @param p1 Control Point 1. + * @param p2 Control Point 2. + * @param p3 End Point. + */ + constructor(p0: Phaser.Math.Vector2 | Phaser.Math.Vector2[], p1: Phaser.Math.Vector2, p2: Phaser.Math.Vector2, p3: Phaser.Math.Vector2); + + /** + * The start point of this curve. + */ + p0: Phaser.Math.Vector2; + + /** + * The first control point of this curve. + */ + p1: Phaser.Math.Vector2; + + /** + * The second control point of this curve. + */ + p2: Phaser.Math.Vector2; + + /** + * The end point of this curve. + */ + p3: Phaser.Math.Vector2; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * Returns the resolution of this curve. + * @param divisions The amount of divisions used by this curve. + */ + getResolution(divisions: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * Draws this curve to the specified graphics object. + * @param graphics The graphics object this curve should be drawn to. + * @param pointsTotal The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. Default 32. + */ + draw(graphics: G, pointsTotal?: integer): G; + + /** + * Returns a JSON object that describes this curve. + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + /** + * Generates a curve from a JSON object. + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.CubicBezier; + + } + + /** + * A Base Curve class, which all other curve types extend. + * + * Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) + */ + class Curve { + /** + * + * @param type [description] + */ + constructor(type: string); + + /** + * String based identifier for the type of curve. + */ + type: string; + + /** + * The default number of divisions within the curve. + */ + defaultDivisions: integer; + + /** + * The quantity of arc length divisions within the curve. + */ + arcLengthDivisions: integer; + + /** + * An array of cached arc length values. + */ + cacheArcLengths: number[]; + + /** + * Does the data of this curve need updating? + */ + needsUpdate: boolean; + + /** + * [description] + */ + active: boolean; + + /** + * Draws this curve on the given Graphics object. + * + * The curve is drawn using `Graphics.strokePoints` so will be drawn at whatever the present Graphics stroke color is. + * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. + * @param graphics The Graphics instance onto which this curve will be drawn. + * @param pointsTotal The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance. Default 32. + */ + draw(graphics: G, pointsTotal?: integer): G; + + /** + * Returns a Rectangle where the position and dimensions match the bounds of this Curve. + * + * You can control the accuracy of the bounds. The value given is used to work out how many points + * to plot across the curve. Higher values are more accurate at the cost of calculation speed. + * @param out The Rectangle to store the bounds in. If falsey a new object will be created. + * @param accuracy The accuracy of the bounds calculations. Default 16. + */ + getBounds(out?: Phaser.Geom.Rectangle, accuracy?: integer): Phaser.Geom.Rectangle; + + /** + * Returns an array of points, spaced out X distance pixels apart. + * The smaller the distance, the larger the array will be. + * @param distance The distance, in pixels, between each point along the curve. + */ + getDistancePoints(distance: integer): Phaser.Geom.Point[]; + + /** + * [description] + * @param out Optional Vector object to store the result in. + */ + getEndPoint(out?: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * [description] + */ + getLength(): number; + + /** + * [description] + * @param divisions [description] + */ + getLengths(divisions?: integer): number[]; + + /** + * [description] + * @param u [description] + * @param out [description] + */ + getPointAt(u: number, out?: O): O; + + /** + * [description] + * @param divisions [description] + */ + getPoints(divisions?: integer): Phaser.Math.Vector2[]; + + /** + * [description] + * @param out [description] + */ + getRandomPoint(out?: O): O; + + /** + * [description] + * @param divisions [description] + */ + getSpacedPoints(divisions?: integer): Phaser.Math.Vector2[]; + + /** + * [description] + * @param out [description] + */ + getStartPoint(out?: O): O; + + /** + * [description] + * @param t [description] + * @param out [description] + */ + getTangent(t: number, out?: O): O; + + /** + * [description] + * @param u [description] + * @param out [description] + */ + getTangentAt(u: number, out?: O): O; + + /** + * [description] + * @param distance [description] + * @param divisions [description] + */ + getTFromDistance(distance: integer, divisions?: integer): number; + + /** + * [description] + * @param u [description] + * @param distance [description] + * @param divisions [description] + */ + getUtoTmapping(u: number, distance: integer, divisions?: integer): number; + + /** + * [description] + */ + updateArcLengths(): void; + + } + + /** + * An Elliptical Curve derived from the Base Curve class. + * + * See https://en.wikipedia.org/wiki/Elliptic_curve for more details. + */ + class Ellipse extends Phaser.Curves.Curve { + /** + * + * @param x The x coordinate of the ellipse, or an Ellipse Curve configuration object. Default 0. + * @param y The y coordinate of the ellipse. Default 0. + * @param xRadius The horizontal radius of ellipse. Default 0. + * @param yRadius The vertical radius of ellipse. Default 0. + * @param startAngle The start angle of the ellipse, in degrees. Default 0. + * @param endAngle The end angle of the ellipse, in degrees. Default 360. + * @param clockwise Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) Default false. + * @param rotation The rotation of the ellipse, in degrees. Default 0. + */ + constructor(x?: number | Phaser.Types.Curves.EllipseCurveConfig, y?: number, xRadius?: number, yRadius?: number, startAngle?: integer, endAngle?: integer, clockwise?: boolean, rotation?: integer); + + /** + * The center point of the ellipse. Used for calculating rotation. + */ + p0: Phaser.Math.Vector2; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * [description] + * @param divisions [description] + */ + getResolution(divisions: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * Sets the horizontal radius of this curve. + * @param value The horizontal radius of this curve. + */ + setXRadius(value: number): Phaser.Curves.Ellipse; + + /** + * Sets the vertical radius of this curve. + * @param value The vertical radius of this curve. + */ + setYRadius(value: number): Phaser.Curves.Ellipse; + + /** + * Sets the width of this curve. + * @param value The width of this curve. + */ + setWidth(value: number): Phaser.Curves.Ellipse; + + /** + * Sets the height of this curve. + * @param value The height of this curve. + */ + setHeight(value: number): Phaser.Curves.Ellipse; + + /** + * Sets the start angle of this curve. + * @param value The start angle of this curve, in radians. + */ + setStartAngle(value: number): Phaser.Curves.Ellipse; + + /** + * Sets the end angle of this curve. + * @param value The end angle of this curve, in radians. + */ + setEndAngle(value: number): Phaser.Curves.Ellipse; + + /** + * Sets if this curve extends clockwise or anti-clockwise. + * @param value The clockwise state of this curve. + */ + setClockwise(value: boolean): Phaser.Curves.Ellipse; + + /** + * Sets the rotation of this curve. + * @param value The rotation of this curve, in radians. + */ + setRotation(value: number): Phaser.Curves.Ellipse; + + /** + * The x coordinate of the center of the ellipse. + */ + x: number; + + /** + * The y coordinate of the center of the ellipse. + */ + y: number; + + /** + * The horizontal radius of the ellipse. + */ + xRadius: number; + + /** + * The vertical radius of the ellipse. + */ + yRadius: number; + + /** + * The start angle of the ellipse in degrees. + */ + startAngle: number; + + /** + * The end angle of the ellipse in degrees. + */ + endAngle: number; + + /** + * `true` if the ellipse rotation is clockwise or `false` if anti-clockwise. + */ + clockwise: boolean; + + /** + * The rotation of the ellipse, relative to the center, in degrees. + */ + angle: number; + + /** + * The rotation of the ellipse, relative to the center, in radians. + */ + rotation: number; + + /** + * JSON serialization of the curve. + */ + toJSON(): Phaser.Types.Curves.JSONEllipseCurve; + + /** + * Creates a curve from the provided Ellipse Curve Configuration object. + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONEllipseCurve): Phaser.Curves.Ellipse; + + } + + /** + * A LineCurve is a "curve" comprising exactly two points (a line segment). + */ + class Line extends Phaser.Curves.Curve { + /** + * + * @param p0 The first endpoint. + * @param p1 The second endpoint. + */ + constructor(p0: Phaser.Math.Vector2 | number[], p1?: Phaser.Math.Vector2); + + /** + * The first endpoint. + */ + p0: Phaser.Math.Vector2; + + /** + * The second endpoint. + */ + p1: Phaser.Math.Vector2; + + /** + * Returns a Rectangle where the position and dimensions match the bounds of this Curve. + * @param out A Rectangle object to store the bounds in. If not given a new Rectangle will be created. + */ + getBounds(out?: O): O; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * Gets the resolution of the line. + * @param divisions The number of divisions to consider. Default 1. + */ + getResolution(divisions?: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * Gets a point at a given position on the line. + * @param u The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPointAt(u: number, out?: O): O; + + /** + * Gets the slope of the line as a unit vector. + */ + getTangent(): O; + + /** + * Draws this curve on the given Graphics object. + * + * The curve is drawn using `Graphics.lineBetween` so will be drawn at whatever the present Graphics line color is. + * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. + * @param graphics The Graphics instance onto which this curve will be drawn. + */ + draw(graphics: G): G; + + /** + * Gets a JSON representation of the line. + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + /** + * Configures this line from a JSON representation. + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.Line; + + } + + /** + * A MoveTo Curve is a very simple curve consisting of only a single point. Its intended use is to move the ending point in a Path. + */ + class MoveTo { + /** + * + * @param x `x` pixel coordinate. + * @param y `y` pixel coordinate. + */ + constructor(x?: number, y?: number); + + /** + * Denotes that this Curve does not influence the bounds, points, and drawing of its parent Path. Must be `false` or some methods in the parent Path will throw errors. + */ + active: boolean; + + /** + * The lone point which this curve consists of. + */ + p0: Phaser.Math.Vector2; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * Retrieves the point at given position in the curve. This will always return this curve's only point. + * @param u The position in the path to retrieve, between 0 and 1. Not used. + * @param out An optional vector in which to store the point. + */ + getPointAt(u: number, out?: O): O; + + /** + * Gets the resolution of this curve. + */ + getResolution(): number; + + /** + * Gets the length of this curve. + */ + getLength(): number; + + /** + * Converts this curve into a JSON-serializable object. + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + } + + /** + * A Path combines multiple Curves into one continuous compound curve. + * It does not matter how many Curves are in the Path or what type they are. + * + * A Curve in a Path does not have to start where the previous Curve ends - that is to say, a Path does not + * have to be an uninterrupted curve. Only the order of the Curves influences the actual points on the Path. + */ + class Path { + /** + * + * @param x The X coordinate of the Path's starting point or a {@link Phaser.Types.Curves.JSONPath}. Default 0. + * @param y The Y coordinate of the Path's starting point. Default 0. + */ + constructor(x?: number, y?: number); + + /** + * The name of this Path. + * Empty by default and never populated by Phaser, this is left for developers to use. + */ + name: string; + + /** + * The list of Curves which make up this Path. + */ + curves: Phaser.Curves.Curve[]; + + /** + * The cached length of each Curve in the Path. + * + * Used internally by {@link #getCurveLengths}. + */ + cacheLengths: number[]; + + /** + * Automatically closes the path. + */ + autoClose: boolean; + + /** + * The starting point of the Path. + * + * This is not necessarily equivalent to the starting point of the first Curve in the Path. In an empty Path, it's also treated as the ending point. + */ + startPoint: Phaser.Math.Vector2; + + /** + * Appends a Curve to the end of the Path. + * + * The Curve does not have to start where the Path ends or, for an empty Path, at its defined starting point. + * @param curve The Curve to append. + */ + add(curve: Phaser.Curves.Curve): Phaser.Curves.Path; + + /** + * Creates a circular Ellipse Curve positioned at the end of the Path. + * @param radius The radius of the circle. + * @param clockwise `true` to create a clockwise circle as opposed to a counter-clockwise circle. Default false. + * @param rotation The rotation of the circle in degrees. Default 0. + */ + circleTo(radius: number, clockwise?: boolean, rotation?: number): Phaser.Curves.Path; + + /** + * Ensures that the Path is closed. + * + * A closed Path starts and ends at the same point. If the Path is not closed, a straight Line Curve will be created from the ending point directly to the starting point. During the check, the actual starting point of the Path, i.e. the starting point of the first Curve, will be used as opposed to the Path's defined {@link startPoint}, which could differ. + * + * Calling this method on an empty Path will result in an error. + */ + closePath(): Phaser.Curves.Path; + + /** + * Creates a cubic bezier curve starting at the previous end point and ending at p3, using p1 and p2 as control points. + * @param x The x coordinate of the end point. Or, if a Vec2, the p1 value. + * @param y The y coordinate of the end point. Or, if a Vec2, the p2 value. + * @param control1X The x coordinate of the first control point. Or, if a Vec2, the p3 value. + * @param control1Y The y coordinate of the first control point. Not used if vec2s are provided as the first 3 arguments. + * @param control2X The x coordinate of the second control point. Not used if vec2s are provided as the first 3 arguments. + * @param control2Y The y coordinate of the second control point. Not used if vec2s are provided as the first 3 arguments. + */ + cubicBezierTo(x: number | Phaser.Math.Vector2, y: number | Phaser.Math.Vector2, control1X: number | Phaser.Math.Vector2, control1Y?: number, control2X?: number, control2Y?: number): Phaser.Curves.Path; + + /** + * Creates a Quadratic Bezier Curve starting at the ending point of the Path. + * @param x The X coordinate of the second control point or, if it's a `Vector2`, the first control point. + * @param y The Y coordinate of the second control point or, if `x` is a `Vector2`, the second control point. + * @param controlX If `x` is not a `Vector2`, the X coordinate of the first control point. + * @param controlY If `x` is not a `Vector2`, the Y coordinate of the first control point. + */ + quadraticBezierTo(x: number | Phaser.Math.Vector2[], y?: number, controlX?: number, controlY?: number): Phaser.Curves.Path; + + /** + * Draws all Curves in the Path to a Graphics Game Object. + * @param graphics The Graphics Game Object to draw to. + * @param pointsTotal The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing. Default 32. + */ + draw(graphics: Phaser.GameObjects.Graphics, pointsTotal?: integer): G; + + /** + * Creates an ellipse curve positioned at the previous end point, using the given parameters. + * @param xRadius The horizontal radius of the ellipse. + * @param yRadius The vertical radius of the ellipse. + * @param startAngle The start angle of the ellipse, in degrees. + * @param endAngle The end angle of the ellipse, in degrees. + * @param clockwise Whether the ellipse should be rotated clockwise (`true`) or counter-clockwise (`false`). + * @param rotation The rotation of the ellipse, in degrees. + */ + ellipseTo(xRadius: number, yRadius: number, startAngle: number, endAngle: number, clockwise: boolean, rotation: number): Phaser.Curves.Path; + + /** + * Creates a Path from a Path Configuration object. + * + * The provided object should be a {@link Phaser.Types.Curves.JSONPath}, as returned by {@link #toJSON}. Providing a malformed object may cause errors. + * @param data The JSON object containing the Path data. + */ + fromJSON(data: Phaser.Types.Curves.JSONPath): Phaser.Curves.Path; + + /** + * Returns a Rectangle with a position and size matching the bounds of this Path. + * @param out The Rectangle to store the bounds in. + * @param accuracy The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed. Default 16. + */ + getBounds(out?: O, accuracy?: integer): O; + + /** + * Returns an array containing the length of the Path at the end of each Curve. + * + * The result of this method will be cached to avoid recalculating it in subsequent calls. The cache is only invalidated when the {@link #curves} array changes in length, leading to potential inaccuracies if a Curve in the Path is changed, or if a Curve is removed and another is added in its place. + */ + getCurveLengths(): number[]; + + /** + * Returns the ending point of the Path. + * + * A Path's ending point is equivalent to the ending point of the last Curve in the Path. For an empty Path, the ending point is at the Path's defined {@link #startPoint}. + * @param out The object to store the point in. + */ + getEndPoint(out?: O): O; + + /** + * Returns the total length of the Path. + */ + getLength(): number; + + /** + * Calculates the coordinates of the point at the given normalized location (between 0 and 1) on the Path. + * + * The location is relative to the entire Path, not to an individual Curve. A location of 0.5 is always in the middle of the Path and is thus an equal distance away from both its starting and ending points. In a Path with one Curve, it would be in the middle of the Curve; in a Path with two Curves, it could be anywhere on either one of them depending on their lengths. + * @param t The location of the point to return, between 0 and 1. + * @param out The object in which to store the calculated point. + */ + getPoint(t: number, out?: O): O; + + /** + * Returns the defined starting point of the Path. + * + * This is not necessarily equal to the starting point of the first Curve if it differs from {@link startPoint}. + * @param divisions The number of points to divide the path in to. Default 12. + */ + getPoints(divisions?: integer): Phaser.Math.Vector2[]; + + /** + * [description] + * @param out `Vector2` instance that should be used for storing the result. If `undefined` a new `Vector2` will be created. + */ + getRandomPoint(out?: O): O; + + /** + * Creates a straight Line Curve from the ending point of the Path to the given coordinates. + * @param divisions The X coordinate of the line's ending point, or the line's ending point as a `Vector2`. Default 40. + */ + getSpacedPoints(divisions?: integer): Phaser.Math.Vector2[]; + + /** + * [description] + * @param out [description] + */ + getStartPoint(out?: O): O; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + lineTo(x: number | Phaser.Math.Vector2, y?: number): Phaser.Curves.Path; + + /** + * [description] + * @param points [description] + */ + splineTo(points: Phaser.Math.Vector2[]): Phaser.Curves.Path; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + moveTo(x: number, y: number): Phaser.Curves.Path; + + /** + * [description] + */ + toJSON(): Phaser.Types.Curves.JSONPath; + + /** + * [description] + */ + updateArcLengths(): void; + + /** + * [description] + */ + destroy(): void; + + } + + /** + * [description] + */ + class QuadraticBezier extends Phaser.Curves.Curve { + /** + * + * @param p0 Start point, or an array of point pairs. + * @param p1 Control Point 1. + * @param p2 Control Point 2. + */ + constructor(p0: Phaser.Math.Vector2 | number[], p1: Phaser.Math.Vector2, p2: Phaser.Math.Vector2); + + /** + * [description] + */ + p0: Phaser.Math.Vector2; + + /** + * [description] + */ + p1: Phaser.Math.Vector2; + + /** + * [description] + */ + p2: Phaser.Math.Vector2; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * [description] + * @param divisions [description] + */ + getResolution(divisions: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * [description] + * @param graphics `Graphics` object to draw onto. + * @param pointsTotal Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. Default 32. + */ + draw(graphics: G, pointsTotal?: integer): G; + + /** + * Converts the curve into a JSON compatible object. + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + /** + * Creates a curve from a JSON object, e. g. created by `toJSON`. + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.QuadraticBezier; + + } + + /** + * [description] + */ + class Spline extends Phaser.Curves.Curve { + /** + * + * @param points [description] + */ + constructor(points?: Phaser.Math.Vector2[]); + + /** + * [description] + */ + points: Phaser.Math.Vector2[]; + + /** + * [description] + * @param points [description] + */ + addPoints(points: Phaser.Math.Vector2[] | number[] | number[][]): Phaser.Curves.Spline; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + addPoint(x: number, y: number): Phaser.Math.Vector2; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * [description] + * @param divisions [description] + */ + getResolution(divisions: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * [description] + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + /** + * [description] + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.Spline; + + } + + } + + namespace Data { + /** + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + */ + class DataManager { + /** + * + * @param parent The object that this DataManager belongs to. + * @param eventEmitter The DataManager's event emitter. + */ + constructor(parent: object, eventEmitter: Phaser.Events.EventEmitter); + + /** + * The object that this DataManager belongs to. + */ + parent: any; + + /** + * The DataManager's event emitter. + */ + events: Phaser.Events.EventEmitter; + + /** + * The data list. + */ + list: {[key: string]: any}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + */ + values: {[key: string]: any}; + + /** + * Retrieves the value for the given key, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * @param key The key of the value to retrieve, or an array of keys. + */ + get(key: string | string[]): any; + + /** + * Retrieves all data values in a new object. + */ + getAll(): {[key: string]: any}; + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * @param search A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + */ + query(search: RegExp): {[key: string]: any}; + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * @param key The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. + * @param data The value to set for the given key. If an object is provided as the key this argument is ignored. + */ + set(key: string | object, data: any): Phaser.Data.DataManager; + + /** + * Passes all data entries to the given callback. + * @param callback The function to call. + * @param context Value to use as `this` when executing callback. + * @param args Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + each(callback: DataEachCallback, context?: any, ...args: any[]): Phaser.Data.DataManager; + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * @param data The data to merge. + * @param overwrite Whether to overwrite existing data. Defaults to true. Default true. + */ + merge(data: {[key: string]: any}, overwrite?: boolean): Phaser.Data.DataManager; + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * @param key The key to remove, or an array of keys to remove. + */ + remove(key: string | string[]): Phaser.Data.DataManager; + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * @param key The key of the value to retrieve and delete. + */ + pop(key: string): any; + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * @param key The key to check. + */ + has(key: string): boolean; + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * @param value Whether to freeze or unfreeze the Data Manager. + */ + setFreeze(value: boolean): Phaser.Data.DataManager; + + /** + * Delete all data in this Data Manager and unfreeze it. + */ + reset(): Phaser.Data.DataManager; + + /** + * Destroy this data manager. + */ + destroy(): void; + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + */ + freeze: boolean; + + /** + * Return the total number of entries in this Data Manager. + */ + count: integer; + + } + + /** + * The Data Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + */ + class DataManagerPlugin extends Phaser.Data.DataManager { + /** + * + * @param scene A reference to the Scene that this DataManager belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * A reference to the Scene that this DataManager belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene's Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + */ + destroy(): void; + + } + + namespace Events { + /** + * The Change Data Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`. + * + * This event is dispatched for all items that change in the Data Manager. + * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. + */ + const CHANGE_DATA: any; + + /** + * The Change Data Key Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`, + * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` + * then you can listen for `sprite.data.on('changedata-gold')`. + */ + const CHANGE_DATA_KEY: any; + + /** + * The Remove Data Event. + * + * This event is dispatched by a Data Manager when an item is removed from it. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`. + */ + const REMOVE_DATA: any; + + /** + * The Set Data Event. + * + * This event is dispatched by a Data Manager when a new item is added to the data store. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`. + */ + const SET_DATA: any; + + } + + } + + namespace Device { + /** + * Determines the audio playback capabilities of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.audio` from within any Scene. + */ + type Audio = { + /** + * Can this device play HTML Audio tags? + */ + audioData: boolean; + /** + * Can this device play EC-3 Dolby Digital Plus files? + */ + dolby: boolean; + /** + * Can this device can play m4a files. + */ + m4a: boolean; + /** + * Can this device play mp3 files? + */ + mp3: boolean; + /** + * Can this device play ogg files? + */ + ogg: boolean; + /** + * Can this device play opus files? + */ + opus: boolean; + /** + * Can this device play wav files? + */ + wav: boolean; + /** + * Does this device have the Web Audio API? + */ + webAudio: boolean; + /** + * Can this device play webm files? + */ + webm: boolean; + }; + + /** + * Determines the browser type and version running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.browser` from within any Scene. + */ + type Browser = { + /** + * Set to true if running in Chrome. + */ + chrome: boolean; + /** + * Set to true if running in Microsoft Edge browser. + */ + edge: boolean; + /** + * Set to true if running in Firefox. + */ + firefox: boolean; + /** + * Set to true if running in Internet Explorer 11 or less (not Edge). + */ + ie: boolean; + /** + * Set to true if running in Mobile Safari. + */ + mobileSafari: boolean; + /** + * Set to true if running in Opera. + */ + opera: boolean; + /** + * Set to true if running in Safari. + */ + safari: boolean; + /** + * Set to true if running in the Silk browser (as used on the Amazon Kindle) + */ + silk: boolean; + /** + * Set to true if running a Trident version of Internet Explorer (IE11+) + */ + trident: boolean; + /** + * If running in Chrome this will contain the major version number. + */ + chromeVersion: number; + /** + * If running in Firefox this will contain the major version number. + */ + firefoxVersion: number; + /** + * If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion. + */ + ieVersion: number; + /** + * If running in Safari this will contain the major version number. + */ + safariVersion: number; + /** + * If running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx} + */ + tridentVersion: number; + }; + + /** + * Determines the canvas features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.canvasFeatures` from within any Scene. + */ + type CanvasFeatures = { + /** + * Set to true if the browser supports inversed alpha. + */ + supportInverseAlpha: boolean; + /** + * Set to true if the browser supports new canvas blend modes. + */ + supportNewBlendModes: boolean; + }; + + /** + * Determines the features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.features` from within any Scene. + */ + type Features = { + /** + * True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap. + */ + canvasBitBltShift: boolean; + /** + * Is canvas available? + */ + canvas: boolean; + /** + * Is file available? + */ + file: boolean; + /** + * Is fileSystem available? + */ + fileSystem: boolean; + /** + * Does the device support the getUserMedia API? + */ + getUserMedia: boolean; + /** + * Is the device big or little endian? (only detected if the browser supports TypedArrays) + */ + littleEndian: boolean; + /** + * Is localStorage available? + */ + localStorage: boolean; + /** + * Is Pointer Lock available? + */ + pointerLock: boolean; + /** + * Does the device context support 32bit pixel manipulation using array buffer views? + */ + support32bit: boolean; + /** + * Does the device support the Vibration API? + */ + vibration: boolean; + /** + * Is webGL available? + */ + webGL: boolean; + /** + * Is worker available? + */ + worker: boolean; + }; + + /** + * Determines the full screen support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.fullscreen` from within any Scene. + */ + type Fullscreen = { + /** + * Does the browser support the Full Screen API? + */ + available: boolean; + /** + * Does the browser support access to the Keyboard during Full Screen mode? + */ + keyboard: boolean; + /** + * If the browser supports the Full Screen API this holds the call you need to use to cancel it. + */ + cancel: string; + /** + * If the browser supports the Full Screen API this holds the call you need to use to activate it. + */ + request: string; + }; + + /** + * Determines the input support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.input` from within any Scene. + */ + type Input = { + /** + * The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll' + */ + wheelType: string; + /** + * Is navigator.getGamepads available? + */ + gamepads: boolean; + /** + * Is mspointer available? + */ + mspointer: boolean; + /** + * Is touch available? + */ + touch: boolean; + }; + + /** + * Determines the operating system of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.os` from within any Scene. + */ + type OS = { + /** + * Is running on android? + */ + android: boolean; + /** + * Is running on chromeOS? + */ + chromeOS: boolean; + /** + * Is the game running under Apache Cordova? + */ + cordova: boolean; + /** + * Is the game running under the Intel Crosswalk XDK? + */ + crosswalk: boolean; + /** + * Is running on a desktop? + */ + desktop: boolean; + /** + * Is the game running under Ejecta? + */ + ejecta: boolean; + /** + * Is the game running under GitHub Electron? + */ + electron: boolean; + /** + * Is running on iOS? + */ + iOS: boolean; + /** + * Is running on iPad? + */ + iPad: boolean; + /** + * Is running on iPhone? + */ + iPhone: boolean; + /** + * Is running on an Amazon Kindle? + */ + kindle: boolean; + /** + * Is running on linux? + */ + linux: boolean; + /** + * Is running on macOS? + */ + macOS: boolean; + /** + * Is the game running under Node.js? + */ + node: boolean; + /** + * Is the game running under Node-Webkit? + */ + nodeWebkit: boolean; + /** + * Set to true if running as a WebApp, i.e. within a WebView + */ + webApp: boolean; + /** + * Is running on windows? + */ + windows: boolean; + /** + * Is running on a Windows Phone? + */ + windowsPhone: boolean; + /** + * If running in iOS this will contain the major version number. + */ + iOSVersion: number; + /** + * PixelRatio of the host device? + */ + pixelRatio: number; + }; + + /** + * Determines the video support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.video` from within any Scene. + */ + type Video = { + /** + * Can this device play h264 mp4 video files? + */ + h264Video: boolean; + /** + * Can this device play hls video files? + */ + hlsVideo: boolean; + /** + * Can this device play h264 mp4 video files? + */ + mp4Video: boolean; + /** + * Can this device play ogg video files? + */ + oggVideo: boolean; + /** + * Can this device play vp9 video files? + */ + vp9Video: boolean; + /** + * Can this device play webm video files? + */ + webmVideo: boolean; + }; + + } + + type DeviceConf = { + /** + * The OS Device functions. + */ + os: Phaser.Device.OS; + /** + * The Browser Device functions. + */ + browser: Phaser.Device.Browser; + /** + * The Features Device functions. + */ + features: Phaser.Device.Features; + /** + * The Input Device functions. + */ + input: Phaser.Device.Input; + /** + * The Audio Device functions. + */ + audio: Phaser.Device.Audio; + /** + * The Video Device functions. + */ + video: Phaser.Device.Video; + /** + * The Fullscreen Device functions. + */ + fullscreen: Phaser.Device.Fullscreen; + /** + * The Canvas Device functions. + */ + canvasFeatures: Phaser.Device.CanvasFeatures; + }; + + namespace Display { + namespace Align { + /** + * A constant representing a top-left alignment or position. + */ + const TOP_LEFT: integer; + + /** + * A constant representing a top-center alignment or position. + */ + const TOP_CENTER: integer; + + /** + * A constant representing a top-right alignment or position. + */ + const TOP_RIGHT: integer; + + /** + * A constant representing a left-top alignment or position. + */ + const LEFT_TOP: integer; + + /** + * A constant representing a left-center alignment or position. + */ + const LEFT_CENTER: integer; + + /** + * A constant representing a left-bottom alignment or position. + */ + const LEFT_BOTTOM: integer; + + /** + * A constant representing a center alignment or position. + */ + const CENTER: integer; + + /** + * A constant representing a right-top alignment or position. + */ + const RIGHT_TOP: integer; + + /** + * A constant representing a right-center alignment or position. + */ + const RIGHT_CENTER: integer; + + /** + * A constant representing a right-bottom alignment or position. + */ + const RIGHT_BOTTOM: integer; + + /** + * A constant representing a bottom-left alignment or position. + */ + const BOTTOM_LEFT: integer; + + /** + * A constant representing a bottom-center alignment or position. + */ + const BOTTOM_CENTER: integer; + + /** + * A constant representing a bottom-right alignment or position. + */ + const BOTTOM_RIGHT: integer; + + namespace In { + /** + * Takes given Game Object and aligns it so that it is positioned in the bottom center of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomCenter(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the bottom left of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomLeft(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the bottom right of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomRight(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the center of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function Center(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the left center of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function LeftCenter(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned relative to the other. + * The alignment used is based on the `position` argument, which is an `ALIGN_CONST` value, such as `LEFT_CENTER` or `TOP_RIGHT`. + * @param child The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param position The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function QuickSet(child: G, alignIn: Phaser.GameObjects.GameObject, position: integer, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the right center of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function RightCenter(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the top center of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopCenter(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the top left of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopLeft(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the top right of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopRight(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + } + + namespace To { + /** + * Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomCenter(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomLeft(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomRight(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function LeftBottom(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the left center position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function LeftCenter(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the left top position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function LeftTop(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function RightBottom(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the right center position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function RightCenter(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the right top position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function RightTop(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the top center position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopCenter(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the top left position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopLeft(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the top right position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopRight(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + } + + } + + namespace Bounds { + /** + * Positions the Game Object so that it is centered on the given coordinates. + * @param gameObject The Game Object that will be re-positioned. + * @param x The horizontal coordinate to position the Game Object on. + * @param y The vertical coordinate to position the Game Object on. + */ + function CenterOn(gameObject: G, x: number, y: number): G; + + /** + * Returns the bottom coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetBottom(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the center x coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetCenterX(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the center y coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetCenterY(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the left coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetLeft(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the amount the Game Object is visually offset from its x coordinate. + * This is the same as `width * origin.x`. + * This value will only be > 0 if `origin.x` is not equal to zero. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetOffsetX(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the amount the Game Object is visually offset from its y coordinate. + * This is the same as `width * origin.y`. + * This value will only be > 0 if `origin.y` is not equal to zero. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetOffsetY(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the right coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetRight(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the top coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetTop(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Positions the Game Object so that the bottom of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param value The coordinate to position the Game Object bounds on. + */ + function SetBottom(gameObject: G, value: number): G; + + /** + * Positions the Game Object so that the center top of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param x The coordinate to position the Game Object bounds on. + */ + function SetCenterX(gameObject: G, x: number): G; + + /** + * Positions the Game Object so that the center top of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param y The coordinate to position the Game Object bounds on. + */ + function SetCenterY(gameObject: G, y: number): G; + + /** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param value The coordinate to position the Game Object bounds on. + */ + function SetLeft(gameObject: G, value: number): G; + + /** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param value The coordinate to position the Game Object bounds on. + */ + function SetRight(gameObject: G, value: number): G; + + /** + * Positions the Game Object so that the top of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param value The coordinate to position the Game Object bounds on. + */ + function SetTop(gameObject: G, value: number): G; + + } + + namespace Canvas { + namespace CanvasInterpolation { + /** + * Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit). + * @param canvas The canvas object to have the style set on. + */ + function setCrisp(canvas: HTMLCanvasElement): HTMLCanvasElement; + + /** + * Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto'). + * @param canvas The canvas object to have the style set on. + */ + function setBicubic(canvas: HTMLCanvasElement): HTMLCanvasElement; + + } + + /** + * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * which is useless for some of the Phaser pipelines / renderer. + * + * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. + * Which means all instances of Phaser Games on the same page can share the one single pool. + */ + namespace CanvasPool { + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * @param parent The parent of the Canvas object. + * @param width The width of the Canvas. Default 1. + * @param height The height of the Canvas. Default 1. + * @param canvasType The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. Default Phaser.CANVAS. + * @param selfParent Use the generated Canvas element as the parent? Default false. + */ + function create(parent: any, width?: integer, height?: integer, canvasType?: integer, selfParent?: boolean): HTMLCanvasElement; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * @param parent The parent of the Canvas object. + * @param width The width of the Canvas. Default 1. + * @param height The height of the Canvas. Default 1. + */ + function create2D(parent: any, width?: integer, height?: integer): HTMLCanvasElement; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * @param parent The parent of the Canvas object. + * @param width The width of the Canvas. Default 1. + * @param height The height of the Canvas. Default 1. + */ + function createWebGL(parent: any, width?: integer, height?: integer): HTMLCanvasElement; + + /** + * Gets the first free canvas index from the pool. + * @param canvasType The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. Default Phaser.CANVAS. + */ + function first(canvasType?: integer): HTMLCanvasElement; + + /** + * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. + * The canvas has its width and height set to 1, and its parent attribute nulled. + * @param parent The canvas or the parent of the canvas to free. + */ + function remove(parent: any): void; + + /** + * Gets the total number of used canvas elements in the pool. + */ + function total(): integer; + + /** + * Gets the total number of free canvas elements in the pool. + */ + function free(): integer; + + /** + * Disable context smoothing on any new Canvas element created. + */ + function disableSmoothing(): void; + + /** + * Enable context smoothing on any new Canvas element created. + */ + function enableSmoothing(): void; + + } + + namespace Smoothing { + /** + * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. + * @param context The canvas context to check. + */ + function getPrefix(context: CanvasRenderingContext2D | WebGLRenderingContext): string; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * @param context The context on which to enable smoothing. + */ + function enable(context: CanvasRenderingContext2D | WebGLRenderingContext): CanvasRenderingContext2D | WebGLRenderingContext; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * @param context The context on which to disable smoothing. + */ + function disable(context: CanvasRenderingContext2D | WebGLRenderingContext): CanvasRenderingContext2D | WebGLRenderingContext; + + /** + * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. + * Returns null if no smoothing prefix is available. + * @param context The context to check. + */ + function isEnabled(context: CanvasRenderingContext2D | WebGLRenderingContext): boolean; + + } + + /** + * Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions. + * @param canvas The canvas element to have the style applied to. + * @param value The touch action value to set on the canvas. Set to `none` to disable touch actions. Default 'none'. + */ + function TouchAction(canvas: HTMLCanvasElement, value?: string): HTMLCanvasElement; + + /** + * Sets the user-select property on the canvas style. Can be used to disable default browser selection actions. + * @param canvas The canvas element to have the style applied to. + * @param value The touch callout value to set on the canvas. Set to `none` to disable touch callouts. Default 'none'. + */ + function UserSelect(canvas: HTMLCanvasElement, value?: string): HTMLCanvasElement; + + } + + namespace Color { + namespace Interpolate { + /** + * Interpolates between the two given color ranges over the length supplied. + * @param r1 Red value. + * @param g1 Blue value. + * @param b1 Green value. + * @param r2 Red value. + * @param g2 Blue value. + * @param b2 Green value. + * @param length Distance to interpolate over. Default 100. + * @param index Index to start from. Default 0. + */ + function RGBWithRGB(r1: number, g1: number, b1: number, r2: number, g2: number, b2: number, length?: number, index?: number): Phaser.Types.Display.ColorObject; + + /** + * Interpolates between the two given color objects over the length supplied. + * @param color1 The first Color object. + * @param color2 The second Color object. + * @param length Distance to interpolate over. Default 100. + * @param index Index to start from. Default 0. + */ + function ColorWithColor(color1: Phaser.Display.Color, color2: Phaser.Display.Color, length?: number, index?: number): Phaser.Types.Display.ColorObject; + + /** + * Interpolates between the Color object and color values over the length supplied. + * @param color1 The first Color object. + * @param r Red value. + * @param g Blue value. + * @param b Green value. + * @param length Distance to interpolate over. Default 100. + * @param index Index to start from. Default 0. + */ + function ColorWithRGB(color1: Phaser.Display.Color, r: number, g: number, b: number, length?: number, index?: number): Phaser.Types.Display.ColorObject; + + } + + } + + /** + * The Color class holds a single color value and allows for easy modification and reading of it. + */ + class Color { + /** + * + * @param red The red color value. A number between 0 and 255. Default 0. + * @param green The green color value. A number between 0 and 255. Default 0. + * @param blue The blue color value. A number between 0 and 255. Default 0. + * @param alpha The alpha value. A number between 0 and 255. Default 255. + */ + constructor(red?: integer, green?: integer, blue?: integer, alpha?: integer); + + /** + * An array containing the calculated color values for WebGL use. + */ + gl: number[]; + + /** + * Sets this color to be transparent. Sets all values to zero. + */ + transparent(): Phaser.Display.Color; + + /** + * Sets the color of this Color component. + * @param red The red color value. A number between 0 and 255. + * @param green The green color value. A number between 0 and 255. + * @param blue The blue color value. A number between 0 and 255. + * @param alpha The alpha value. A number between 0 and 255. Default 255. + * @param updateHSV Update the HSV values after setting the RGB values? Default true. + */ + setTo(red: integer, green: integer, blue: integer, alpha?: integer, updateHSV?: boolean): Phaser.Display.Color; + + /** + * Sets the red, green, blue and alpha GL values of this Color component. + * @param red The red color value. A number between 0 and 1. + * @param green The green color value. A number between 0 and 1. + * @param blue The blue color value. A number between 0 and 1. + * @param alpha The alpha value. A number between 0 and 1. Default 1. + */ + setGLTo(red: number, green: number, blue: number, alpha?: number): Phaser.Display.Color; + + /** + * Sets the color based on the color object given. + * @param color An object containing `r`, `g`, `b` and optionally `a` values in the range 0 to 255. + */ + setFromRGB(color: Phaser.Types.Display.InputColorObject): Phaser.Display.Color; + + /** + * Sets the color based on the hue, saturation and lightness values given. + * @param h The hue, in the range 0 - 1. This is the base color. + * @param s The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. + * @param v The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black. + */ + setFromHSV(h: number, s: number, v: number): Phaser.Display.Color; + + /** + * Returns a new Color component using the values from this one. + */ + clone(): Phaser.Display.Color; + + /** + * Sets this Color object to be grayscaled based on the shade value given. + * @param shade A value between 0 and 255. + */ + gray(shade: integer): Phaser.Display.Color; + + /** + * Sets this Color object to be a random color between the `min` and `max` values given. + * @param min The minimum random color value. Between 0 and 255. Default 0. + * @param max The maximum random color value. Between 0 and 255. Default 255. + */ + random(min?: integer, max?: integer): Phaser.Display.Color; + + /** + * Sets this Color object to be a random grayscale color between the `min` and `max` values given. + * @param min The minimum random color value. Between 0 and 255. Default 0. + * @param max The maximum random color value. Between 0 and 255. Default 255. + */ + randomGray(min?: integer, max?: integer): Phaser.Display.Color; + + /** + * Increase the saturation of this Color by the percentage amount given. + * The saturation is the amount of the base color in the hue. + * @param amount The percentage amount to change this color by. A value between 0 and 100. + */ + saturate(amount: integer): Phaser.Display.Color; + + /** + * Decrease the saturation of this Color by the percentage amount given. + * The saturation is the amount of the base color in the hue. + * @param amount The percentage amount to change this color by. A value between 0 and 100. + */ + desaturate(amount: integer): Phaser.Display.Color; + + /** + * Increase the lightness of this Color by the percentage amount given. + * @param amount The percentage amount to change this color by. A value between 0 and 100. + */ + lighten(amount: integer): Phaser.Display.Color; + + /** + * Decrease the lightness of this Color by the percentage amount given. + * @param amount The percentage amount to change this color by. A value between 0 and 100. + */ + darken(amount: integer): Phaser.Display.Color; + + /** + * Brighten this Color by the percentage amount given. + * @param amount The percentage amount to change this color by. A value between 0 and 100. + */ + brighten(amount: integer): Phaser.Display.Color; + + /** + * The color of this Color component, not including the alpha channel. + */ + readonly color: number; + + /** + * The color of this Color component, including the alpha channel. + */ + readonly color32: number; + + /** + * The color of this Color component as a string which can be used in CSS color values. + */ + readonly rgba: string; + + /** + * The red color value, normalized to the range 0 to 1. + */ + redGL: number; + + /** + * The green color value, normalized to the range 0 to 1. + */ + greenGL: number; + + /** + * The blue color value, normalized to the range 0 to 1. + */ + blueGL: number; + + /** + * The alpha color value, normalized to the range 0 to 1. + */ + alphaGL: number; + + /** + * The red color value, normalized to the range 0 to 255. + */ + red: number; + + /** + * The green color value, normalized to the range 0 to 255. + */ + green: number; + + /** + * The blue color value, normalized to the range 0 to 255. + */ + blue: number; + + /** + * The alpha color value, normalized to the range 0 to 255. + */ + alpha: number; + + /** + * The hue color value. A number between 0 and 1. + * This is the base color. + */ + h: number; + + /** + * The saturation color value. A number between 0 and 1. + * This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. + */ + s: number; + + /** + * The lightness color value. A number between 0 and 1. + * This controls how dark the color is. Where 1 is as bright as possible and 0 is black. + */ + v: number; + + /** + * Converts the given color value into an Object containing r,g,b and a properties. + * @param color A color value, optionally including the alpha value. + */ + static ColorToRGBA(color: number): Phaser.Types.Display.ColorObject; + + /** + * Returns a string containing a hex representation of the given color component. + * @param color The color channel to get the hex value for, must be a value between 0 and 255. + */ + static ComponentToHex(color: integer): string; + + /** + * Given 3 separate color values this will return an integer representation of it. + * @param red The red color value. A number between 0 and 255. + * @param green The green color value. A number between 0 and 255. + * @param blue The blue color value. A number between 0 and 255. + */ + static GetColor(red: integer, green: integer, blue: integer): number; + + /** + * Given an alpha and 3 color values this will return an integer representation of it. + * @param red The red color value. A number between 0 and 255. + * @param green The green color value. A number between 0 and 255. + * @param blue The blue color value. A number between 0 and 255. + * @param alpha The alpha color value. A number between 0 and 255. + */ + static GetColor32(red: integer, green: integer, blue: integer, alpha: integer): number; + + /** + * Converts a hex string into a Phaser Color object. + * + * The hex string can supplied as `'#0033ff'` or the short-hand format of `'#03f'`; it can begin with an optional "#" or "0x", or be unprefixed. + * + * An alpha channel is _not_ supported. + * @param hex The hex color value to convert, such as `#0033ff` or the short-hand format: `#03f`. + */ + static HexStringToColor(hex: string): Phaser.Display.Color; + + /** + * Converts HSL (hue, saturation and lightness) values to a Phaser Color object. + * @param h The hue value in the range 0 to 1. + * @param s The saturation value in the range 0 to 1. + * @param l The lightness value in the range 0 to 1. + */ + static HSLToColor(h: number, s: number, l: number): Phaser.Display.Color; + + /** + * Get HSV color wheel values in an array which will be 360 elements in size. + * @param s The saturation, in the range 0 - 1. Default 1. + * @param v The value, in the range 0 - 1. Default 1. + */ + static HSVColorWheel(s?: number, v?: number): Phaser.Types.Display.ColorObject[]; + + /** + * Converts an HSV (hue, saturation and value) color value to RGB. + * Conversion formula from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes HSV values are contained in the set [0, 1]. + * Based on code by Michael Jackson (https://github.com/mjijackson) + * @param h The hue, in the range 0 - 1. This is the base color. + * @param s The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. + * @param v The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black. + * @param out A Color object to store the results in. If not given a new ColorObject will be created. + */ + static HSVToRGB(h: number, s: number, v: number, out?: Phaser.Types.Display.ColorObject | Phaser.Display.Color): Phaser.Types.Display.ColorObject | Phaser.Display.Color; + + /** + * Converts a hue to an RGB color. + * Based on code by Michael Jackson (https://github.com/mjijackson) + */ + static HueToComponent(p: number, q: number, t: number): number; + + /** + * Converts the given color value into an instance of a Color object. + * @param input The color value to convert into a Color object. + */ + static IntegerToColor(input: integer): Phaser.Display.Color; + + /** + * Return the component parts of a color as an Object with the properties alpha, red, green, blue. + * + * Alpha will only be set if it exists in the given color (0xAARRGGBB) + * @param input The color value to convert into a Color object. + */ + static IntegerToRGB(input: integer): Phaser.Types.Display.ColorObject; + + /** + * Converts an object containing `r`, `g`, `b` and `a` properties into a Color class instance. + * @param input An object containing `r`, `g`, `b` and `a` properties in the range 0 to 255. + */ + static ObjectToColor(input: Phaser.Types.Display.InputColorObject): Phaser.Display.Color; + + /** + * Creates a new Color object where the r, g, and b values have been set to random values + * based on the given min max values. + * @param min The minimum value to set the random range from (between 0 and 255) Default 0. + * @param max The maximum value to set the random range from (between 0 and 255) Default 255. + */ + static RandomRGB(min?: integer, max?: integer): Phaser.Display.Color; + + /** + * Converts a CSS 'web' string into a Phaser Color object. + * + * The web string can be in the format `'rgb(r,g,b)'` or `'rgba(r,g,b,a)'` where r/g/b are in the range [0..255] and a is in the range [0..1]. + * @param rgb The CSS format color string, using the `rgb` or `rgba` format. + */ + static RGBStringToColor(rgb: string): Phaser.Display.Color; + + /** + * Converts an RGB color value to HSV (hue, saturation and value). + * Conversion forumla from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes RGB values are contained in the set [0, 255] and returns h, s and v in the set [0, 1]. + * Based on code by Michael Jackson (https://github.com/mjijackson) + * @param r The red color value. A number between 0 and 255. + * @param g The green color value. A number between 0 and 255. + * @param b The blue color value. A number between 0 and 255. + * @param out An object to store the color values in. If not given an HSV Color Object will be created. + */ + static RGBToHSV(r: integer, g: integer, b: integer, out?: Phaser.Types.Display.HSVColorObject | Phaser.Display.Color): Phaser.Types.Display.HSVColorObject | Phaser.Display.Color; + + /** + * Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`. + * @param r The red color value. A number between 0 and 255. + * @param g The green color value. A number between 0 and 255. + * @param b The blue color value. A number between 0 and 255. + * @param a The alpha value. A number between 0 and 255. Default 255. + * @param prefix The prefix of the string. Either `#` or `0x`. Default #. + */ + static RGBToString(r: integer, g: integer, b: integer, a?: integer, prefix?: string): string; + + /** + * Converts the given source color value into an instance of a Color class. + * The value can be either a string, prefixed with `rgb` or a hex string, a number or an Object. + * @param input The source color value to convert. + */ + static ValueToColor(input: string | number | Phaser.Types.Display.InputColorObject): Phaser.Display.Color; + + } + + namespace Masks { + /** + * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. + * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, + * not a clipping path. It is only available when using the WebGL Renderer. + * + * A Bitmap Mask can use any Game Object to determine the alpha of each pixel of the masked Game Object(s). + * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha + * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the + * Bitmap Mask doesn't matter. + * + * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an + * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * corresponding pixel in the mask. + * + * The Bitmap Mask's location matches the location of its Game Object, not the location of the + * masked objects. Moving or transforming the underlying Game Object will change the mask + * (and affect the visibility of any masked objects), whereas moving or transforming a masked object + * will not affect the mask. + * + * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a + * Scene's display list, it will only be used for the mask and its full texture will not be directly + * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will + * render as a normal Game Object and will also serve as a mask. + */ + class BitmapMask { + /** + * + * @param scene The Scene which this Bitmap Mask will be used in. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + constructor(scene: Phaser.Scene, renderable: Phaser.GameObjects.GameObject); + + /** + * A reference to either the Canvas or WebGL Renderer that this Mask is using. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * A renderable Game Object that uses a texture, such as a Sprite. + */ + bitmapMask: Phaser.GameObjects.GameObject; + + /** + * The texture used for the mask's framebuffer. + */ + maskTexture: WebGLTexture; + + /** + * The texture used for the main framebuffer. + */ + mainTexture: WebGLTexture; + + /** + * Whether the Bitmap Mask is dirty and needs to be updated. + */ + dirty: boolean; + + /** + * The framebuffer to which a masked Game Object is rendered. + */ + mainFramebuffer: WebGLFramebuffer; + + /** + * The framebuffer to which the Bitmap Mask's masking Game Object is rendered. + */ + maskFramebuffer: WebGLFramebuffer; + + /** + * The previous framebuffer set in the renderer before this one was enabled. + */ + prevFramebuffer: WebGLFramebuffer; + + /** + * Whether to invert the masks alpha. + * + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + */ + invertAlpha: boolean; + + /** + * Is this mask a stencil mask? + */ + readonly isStencil: boolean; + + /** + * Sets a new masking Game Object for the Bitmap Mask. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + setBitmap(renderable: Phaser.GameObjects.GameObject): void; + + /** + * Prepares the WebGL Renderer to render a Game Object with this mask applied. + * + * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame. + * @param renderer The WebGL Renderer to prepare. + * @param maskedObject The masked Game Object which will be drawn. + * @param camera The Camera to render to. + */ + preRenderWebGL(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer, maskedObject: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Finalizes rendering of a masked Game Object. + * + * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect. + * @param renderer The WebGL Renderer to clean up. + */ + postRenderWebGL(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer): void; + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * @param renderer The Canvas Renderer which would be rendered to. + * @param mask The masked Game Object which would be rendered. + * @param camera The Camera to render to. + */ + preRenderCanvas(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer, mask: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * @param renderer The Canvas Renderer which would be rendered to. + */ + postRenderCanvas(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer): void; + + /** + * Destroys this BitmapMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + */ + destroy(): void; + + } + + /** + * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect + * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only + * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * + * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) + * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed + * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and + * alpha of the pixel from the Geometry Mask do not matter. + * + * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. + * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility + * of any masked objects), whereas moving or transforming a masked object will not affect the mask. + * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed + * in front of all masked objects which has its own visual properties and, naturally, respects the camera's + * visual properties, but isn't affected by and doesn't follow the masked objects by itself. + */ + class GeometryMask { + /** + * + * @param scene This parameter is not used. + * @param graphicsGeometry The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. + */ + constructor(scene: Phaser.Scene, graphicsGeometry: Phaser.GameObjects.Graphics); + + /** + * The Graphics object which describes the Geometry Mask. + */ + geometryMask: Phaser.GameObjects.Graphics; + + /** + * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels + * drawn to the Geometry Mask. + */ + invertAlpha: boolean; + + /** + * Is this mask a stencil mask? + */ + readonly isStencil: boolean; + + /** + * Sets a new Graphics object for the Geometry Mask. + * @param graphicsGeometry The Graphics object which will be used for the Geometry Mask. + */ + setShape(graphicsGeometry: Phaser.GameObjects.Graphics): this; + + /** + * Sets the `invertAlpha` property of this Geometry Mask. + * Inverting the alpha essentially flips the way the mask works. + * @param value Invert the alpha of this mask? Default true. + */ + setInvertAlpha(value?: boolean): this; + + /** + * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. + * @param renderer The WebGL Renderer instance to draw to. + * @param child The Game Object being rendered. + * @param camera The camera the Game Object is being rendered through. + */ + preRenderWebGL(renderer: Phaser.Renderer.WebGL.WebGLRenderer, child: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Applies the current stencil mask to the renderer. + * @param renderer The WebGL Renderer instance to draw to. + * @param camera The camera the Game Object is being rendered through. + * @param inc Is this an INCR stencil or a DECR stencil? + */ + applyStencil(renderer: Phaser.Renderer.WebGL.WebGLRenderer, camera: Phaser.Cameras.Scene2D.Camera, inc: boolean): void; + + /** + * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. + * @param renderer The WebGL Renderer instance to draw flush. + */ + postRenderWebGL(renderer: Phaser.Renderer.WebGL.WebGLRenderer): void; + + /** + * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. + * @param renderer The Canvas Renderer instance to set the clipping path on. + * @param mask The Game Object being rendered. + * @param camera The camera the Game Object is being rendered through. + */ + preRenderCanvas(renderer: Phaser.Renderer.Canvas.CanvasRenderer, mask: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Restore the canvas context's previous clipping path, thus turning off the mask for it. + * @param renderer The Canvas Renderer instance being restored. + */ + postRenderCanvas(renderer: Phaser.Renderer.Canvas.CanvasRenderer): void; + + /** + * Destroys this GeometryMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + */ + destroy(): void; + + } + + } + + /** + * A BaseShader is a small resource class that contains the data required for a WebGL Shader to be created. + * + * It contains the raw source code to the fragment and vertex shader, as well as an object that defines + * the uniforms the shader requires, if any. + * + * BaseShaders are stored in the Shader Cache, available in a Scene via `this.cache.shaders` and are referenced + * by a unique key-based string. Retrieve them via `this.cache.shaders.get(key)`. + * + * BaseShaders are created automatically by the GLSL File Loader when loading an external shader resource. + * They can also be created at runtime, allowing you to use dynamically generated shader source code. + * + * Default fragment and vertex source is used if not provided in the constructor, setting-up a basic shader, + * suitable for debug rendering. + */ + class BaseShader { + /** + * + * @param key The key of this shader. Must be unique within the shader cache. + * @param fragmentSrc The fragment source for the shader. + * @param vertexSrc The vertex source for the shader. + * @param uniforms Optional object defining the uniforms the shader uses. + */ + constructor(key: string, fragmentSrc?: string, vertexSrc?: string, uniforms?: any); + + /** + * The key of this shader, unique within the shader cache of this Phaser game instance. + */ + key: string; + + /** + * The source code, as a string, of the fragment shader being used. + */ + fragmentSrc: string; + + /** + * The source code, as a string, of the vertex shader being used. + */ + vertexSrc: string; + + /** + * The default uniforms for this shader. + */ + uniforms: any; + + } + + } + + namespace DOM { + /** + * Adds the given element to the DOM. If a parent is provided the element is added as a child of the parent, providing it was able to access it. + * If no parent was given it falls back to using `document.body`. + * @param element The element to be added to the DOM. Usually a Canvas object. + * @param parent The parent in which to add the element. Can be a string which is passed to `getElementById` or an actual DOM object. + */ + function AddToDOM(element: HTMLElement, parent?: string | HTMLElement): HTMLElement; + + /** + * Inspects the readyState of the document. If the document is already complete then it invokes the given callback. + * If not complete it sets up several event listeners such as `deviceready`, and once those fire, it invokes the callback. + * Called automatically by the Phaser.Game instance. Should not usually be accessed directly. + * @param callback The callback to be invoked when the device is ready and the DOM content is loaded. + */ + function DOMContentLoaded(callback: ContentLoadedCallback): void; + + /** + * Attempts to determine the document inner height across iOS and standard devices. + * Based on code by @tylerjpeterson + * @param iOS Is this running on iOS? + */ + function GetInnerHeight(iOS: boolean): number; + + /** + * Attempts to determine the screen orientation using the Orientation API. + * @param width The width of the viewport. + * @param height The height of the viewport. + */ + function GetScreenOrientation(width: number, height: number): string; + + /** + * Attempts to get the target DOM element based on the given value, which can be either + * a string, in which case it will be looked-up by ID, or an element node. If nothing + * can be found it will return a reference to the document.body. + * @param element The DOM element to look-up. + */ + function GetTarget(element: HTMLElement): void; + + /** + * Takes the given data string and parses it as XML. + * First tries to use the window.DOMParser and reverts to the Microsoft.XMLDOM if that fails. + * The parsed XML object is returned, or `null` if there was an error while parsing the data. + * @param data The XML source stored in a string. + */ + function ParseXML(data: string): DOMParser | ActiveXObject; + + /** + * Attempts to remove the element from its parentNode in the DOM. + * @param element The DOM element to remove from its parent node. + */ + function RemoveFromDOM(element: HTMLElement): void; + + /** + * Abstracts away the use of RAF or setTimeOut for the core game update loop. + * This is invoked automatically by the Phaser.Game instance. + */ + class RequestAnimationFrame { + /** + * True if RequestAnimationFrame is running, otherwise false. + */ + isRunning: boolean; + + /** + * The callback to be invoked each step. + */ + callback: FrameRequestCallback; + + /** + * The most recent timestamp. Either a DOMHighResTimeStamp under RAF or `Date.now` under SetTimeout. + */ + tick: number; + + /** + * True if the step is using setTimeout instead of RAF. + */ + isSetTimeOut: boolean; + + /** + * The setTimeout or RAF callback ID used when canceling them. + */ + timeOutID: number; + + /** + * The previous time the step was called. + */ + lastTime: number; + + /** + * The RAF step function. + * Updates the local tick value, invokes the callback and schedules another call to requestAnimationFrame. + */ + step: FrameRequestCallback; + + /** + * The SetTimeout step function. + * Updates the local tick value, invokes the callback and schedules another call to setTimeout. + */ + stepTimeout: Function; + + /** + * Starts the requestAnimationFrame or setTimeout process running. + * @param callback The callback to invoke each step. + * @param forceSetTimeOut Should it use SetTimeout, even if RAF is available? + */ + start(callback: FrameRequestCallback, forceSetTimeOut: boolean): void; + + /** + * Stops the requestAnimationFrame or setTimeout from running. + */ + stop(): void; + + /** + * Stops the step from running and clears the callback reference. + */ + destroy(): void; + + } + + } + + namespace Events { + /** + * EventEmitter is a Scene Systems plugin compatible version of eventemitter3. + */ + class EventEmitter { + /** + * Removes all listeners. + */ + shutdown(): void; + + /** + * Removes all listeners. + */ + destroy(): void; + + /** + * Return an array listing the events for which the emitter has registered listeners. + */ + eventNames(): any[]; + + /** + * Return the listeners registered for a given event. + * @param event The event name. + */ + listeners(event: string | symbol): any[]; + + /** + * Return the number of listeners listening to a given event. + * @param event The event name. + */ + listenerCount(event: string | symbol): number; + + /** + * Calls each of the listeners registered for a given event. + * @param event The event name. + * @param args Additional arguments that will be passed to the event handler. + */ + emit(event: string | symbol, ...args: any[]): boolean; + + /** + * Add a listener for a given event. + * @param event The event name. + * @param fn The listener function. + * @param context The context to invoke the listener with. Default this. + */ + on(event: string | symbol, fn: Function, context?: any): Phaser.Events.EventEmitter; + + /** + * Add a listener for a given event. + * @param event The event name. + * @param fn The listener function. + * @param context The context to invoke the listener with. Default this. + */ + addListener(event: string | symbol, fn: Function, context?: any): Phaser.Events.EventEmitter; + + /** + * Add a one-time listener for a given event. + * @param event The event name. + * @param fn The listener function. + * @param context The context to invoke the listener with. Default this. + */ + once(event: string | symbol, fn: Function, context?: any): Phaser.Events.EventEmitter; + + /** + * Remove the listeners of a given event. + * @param event The event name. + * @param fn Only remove the listeners that match this function. + * @param context Only remove the listeners that have this context. + * @param once Only remove one-time listeners. + */ + removeListener(event: string | symbol, fn?: Function, context?: any, once?: boolean): Phaser.Events.EventEmitter; + + /** + * Remove the listeners of a given event. + * @param event The event name. + * @param fn Only remove the listeners that match this function. + * @param context Only remove the listeners that have this context. + * @param once Only remove one-time listeners. + */ + off(event: string | symbol, fn?: Function, context?: any, once?: boolean): Phaser.Events.EventEmitter; + + /** + * Remove all listeners, or those of the specified event. + * @param event The event name. + */ + removeAllListeners(event?: string | symbol): Phaser.Events.EventEmitter; + + } + + } + + /** + * Phaser Blend Modes to CSS Blend Modes Map. + */ + enum CSSBlendModes { + } + + namespace GameObjects { + /** + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * Dynamic Bitmap Text objects are different from Static Bitmap Text in that they invoke a callback for each + * letter being rendered during the render pass. This callback allows you to manipulate the properties of + * each letter being rendered, such as its position, scale or tint, allowing you to create interesting effects + * like jiggling text, which can't be done with Static text. This means that Dynamic Text takes more processing + * time, so only use them if you require the callback ability they have. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + */ + class DynamicBitmapText extends Phaser.GameObjects.BitmapText { + /** + * + * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. + * @param x The x coordinate of this Game Object in world space. + * @param y The y coordinate of this Game Object in world space. + * @param font The key of the font to use from the Bitmap Font cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size of this Bitmap Text. + * @param align The alignment of the text in a multi-line BitmapText object. Default 0. + */ + constructor(scene: Phaser.Scene, x: number, y: number, font: string, text?: string | string[], size?: number, align?: integer); + + /** + * The horizontal scroll position of the Bitmap Text. + */ + scrollX: number; + + /** + * The vertical scroll position of the Bitmap Text. + */ + scrollY: number; + + /** + * The crop width of the Bitmap Text. + */ + cropWidth: number; + + /** + * The crop height of the Bitmap Text. + */ + cropHeight: number; + + /** + * A callback that alters how each character of the Bitmap Text is rendered. + */ + displayCallback: Phaser.Types.GameObjects.BitmapText.DisplayCallback; + + /** + * The data object that is populated during rendering, then passed to the displayCallback. + * You should modify this object then return it back from the callback. It's updated values + * will be used to render the specific glyph. + * + * Please note that if you need a reference to this object locally in your game code then you + * should shallow copy it, as it's updated and re-used for every glyph in the text. + */ + callbackData: Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig; + + /** + * Set the crop size of this Bitmap Text. + * @param width The width of the crop. + * @param height The height of the crop. + */ + setSize(width: number, height: number): Phaser.GameObjects.DynamicBitmapText; + + /** + * Set a callback that alters how each character of the Bitmap Text is rendered. + * + * The callback receives a {@link Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig} object that contains information about the character that's + * about to be rendered. + * + * It should return an object with `x`, `y`, `scale` and `rotation` properties that will be used instead of the + * usual values when rendering. + * @param callback The display callback to set. + */ + setDisplayCallback(callback: Phaser.Types.GameObjects.BitmapText.DisplayCallback): Phaser.GameObjects.DynamicBitmapText; + + /** + * Set the horizontal scroll position of this Bitmap Text. + * @param value The horizontal scroll position to set. + */ + setScrollX(value: number): Phaser.GameObjects.DynamicBitmapText; + + /** + * Set the vertical scroll position of this Bitmap Text. + * @param value The vertical scroll position to set. + */ + setScrollY(value: number): Phaser.GameObjects.DynamicBitmapText; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + namespace RetroFont { + /** + * Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ + */ + var TEXT_SET1: string; + + /** + * Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ + */ + var TEXT_SET2: string; + + /** + * Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 + */ + var TEXT_SET3: string; + + /** + * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 + */ + var TEXT_SET4: string; + + /** + * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 + */ + var TEXT_SET5: string; + + /** + * Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.' + */ + var TEXT_SET6: string; + + /** + * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39 + */ + var TEXT_SET7: string; + + /** + * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ + */ + var TEXT_SET8: string; + + /** + * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?! + */ + var TEXT_SET9: string; + + /** + * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ + */ + var TEXT_SET10: string; + + /** + * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789 + */ + var TEXT_SET11: string; + + /** + * Parses a Retro Font configuration object so you can pass it to the BitmapText constructor + * and create a BitmapText object using a fixed-width retro font. + * @param scene A reference to the Phaser Scene. + * @param config The font configuration object. + */ + function Parse(scene: Phaser.Scene, config: Phaser.Types.GameObjects.BitmapText.RetroFontConfig): object; + + } + + /** + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} + * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} + * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} + */ + class BitmapText extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. + * @param x The x coordinate of this Game Object in world space. + * @param y The y coordinate of this Game Object in world space. + * @param font The key of the font to use from the Bitmap Font cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size of this Bitmap Text. + * @param align The alignment of the text in a multi-line BitmapText object. Default 0. + */ + constructor(scene: Phaser.Scene, x: number, y: number, font: string, text?: string | string[], size?: number, align?: integer); + + /** + * The key of the Bitmap Font used by this Bitmap Text. + * To change the font after creation please use `setFont`. + */ + readonly font: string; + + /** + * The data of the Bitmap Font used by this Bitmap Text. + */ + readonly fontData: Phaser.Types.GameObjects.BitmapText.BitmapFontData; + + /** + * Set the lines of text in this BitmapText to be left-aligned. + * This only has any effect if this BitmapText contains more than one line of text. + */ + setLeftAlign(): this; + + /** + * Set the lines of text in this BitmapText to be center-aligned. + * This only has any effect if this BitmapText contains more than one line of text. + */ + setCenterAlign(): this; + + /** + * Set the lines of text in this BitmapText to be right-aligned. + * This only has any effect if this BitmapText contains more than one line of text. + */ + setRightAlign(): this; + + /** + * Set the font size of this Bitmap Text. + * @param size The font size to set. + */ + setFontSize(size: number): this; + + /** + * Sets the letter spacing between each character of this Bitmap Text. + * Can be a positive value to increase the space, or negative to reduce it. + * Spacing is applied after the kerning values have been set. + * @param spacing The amount of horizontal space to add between each character. Default 0. + */ + setLetterSpacing(spacing?: number): this; + + /** + * Set the textual content of this BitmapText. + * + * An array of strings will be converted into multi-line text. Use the align methods to change multi-line alignment. + * @param value The string, or array of strings, to be set as the content of this BitmapText. + */ + setText(value: string | string[]): this; + + /** + * Calculate the bounds of this Bitmap Text. + * + * An object is returned that contains the position, width and height of the Bitmap Text in local and global + * contexts. + * + * Local size is based on just the font size and a [0, 0] position. + * + * Global size takes into account the Game Object's scale, world position and display origin. + * + * Also in the object is data regarding the length of each line, should this be a multi-line BitmapText. + * @param round Whether to round the results to the nearest integer. + */ + getTextBounds(round?: boolean): Phaser.Types.GameObjects.BitmapText.BitmapTextSize; + + /** + * Changes the font this BitmapText is using to render. + * + * The new texture is loaded and applied to the BitmapText. The existing test, size and alignment are preserved, + * unless overridden via the arguments. + * @param font The key of the font to use from the Bitmap Font cache. + * @param size The font size of this Bitmap Text. If not specified the current size will be used. + * @param align The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used. Default 0. + */ + setFont(font: string, size?: number, align?: integer): this; + + /** + * Controls the alignment of each line of text in this BitmapText object. + * + * Only has any effect when this BitmapText contains multiple lines of text, split with carriage-returns. + * Has no effect with single-lines of text. + * + * See the methods `setLeftAlign`, `setCenterAlign` and `setRightAlign`. + * + * 0 = Left aligned (default) + * 1 = Middle aligned + * 2 = Right aligned + * + * The alignment position is based on the longest line of text. + */ + align: integer; + + /** + * The text that this Bitmap Text object displays. + * + * You can also use the method `setText` if you want a chainable way to change the text content. + */ + text: string; + + /** + * The font size of this Bitmap Text. + * + * You can also use the method `setFontSize` if you want a chainable way to change the font size. + */ + fontSize: number; + + /** + * Adds / Removes spacing between characters. + * + * Can be a negative or positive number. + * + * You can also use the method `setLetterSpacing` if you want a chainable way to change the letter spacing. + */ + letterSpacing: number; + + /** + * The width of this Bitmap Text. + */ + readonly width: number; + + /** + * The height of this bitmap text. + */ + readonly height: number; + + /** + * Build a JSON representation of this Bitmap Text. + */ + toJSON(): Phaser.Types.GameObjects.BitmapText.JSONBitmapText; + + /** + * Left align the text characters in a multi-line BitmapText object. + */ + static ALIGN_LEFT: integer; + + /** + * Center align the text characters in a multi-line BitmapText object. + */ + static ALIGN_CENTER: integer; + + /** + * Right align the text characters in a multi-line BitmapText object. + */ + static ALIGN_RIGHT: integer; + + /** + * Parse an XML Bitmap Font from an Atlas. + * + * Adds the parsed Bitmap Font data to the cache with the `fontName` key. + */ + static ParseFromAtlas: Function; + + /** + * Parse an XML font to Bitmap Font data for the Bitmap Font cache. + */ + static ParseXMLBitmapFont: Function; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Blitter Game Object. + * + * The Blitter Game Object is a special kind of container that creates, updates and manages Bob objects. + * Bobs are designed for rendering speed rather than flexibility. They consist of a texture, or frame from a texture, + * a position and an alpha value. You cannot scale or rotate them. They use a batched drawing method for speed + * during rendering. + * + * A Blitter Game Object has one texture bound to it. Bobs created by the Blitter can use any Frame from this + * Texture to render with, but they cannot use any other Texture. It is this single texture-bind that allows + * them their speed. + * + * If you have a need to blast a large volume of frames around the screen then Blitter objects are well worth + * investigating. They are especially useful for using as a base for your own special effects systems. + */ + class Blitter extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. + * @param x The x coordinate of this Game Object in world space. Default 0. + * @param y The y coordinate of this Game Object in world space. Default 0. + * @param texture The key of the texture this Game Object will use for rendering. The Texture must already exist in the Texture Manager. Default '__DEFAULT'. + * @param frame The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. Default 0. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, texture?: string, frame?: string | integer); + + /** + * The children of this Blitter. + * This List contains all of the Bob objects created by the Blitter. + */ + children: Phaser.Structs.List; + + /** + * Is the Blitter considered dirty? + * A 'dirty' Blitter has had its child count changed since the last frame. + */ + dirty: boolean; + + /** + * Creates a new Bob in this Blitter. + * + * The Bob is created at the given coordinates, relative to the Blitter and uses the given frame. + * A Bob can use any frame belonging to the texture bound to the Blitter. + * @param x The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param y The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param frame The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * @param visible Should the created Bob render or not? Default true. + * @param index The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. + */ + create(x: number, y: number, frame?: string | integer | Phaser.Textures.Frame, visible?: boolean, index?: integer): Phaser.GameObjects.Bob; + + /** + * Creates multiple Bob objects within this Blitter and then passes each of them to the specified callback. + * @param callback The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob. + * @param quantity The quantity of Bob objects to create. + * @param frame The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param visible Should the created Bob render or not? Default true. + */ + createFromCallback(callback: CreateCallback, quantity: integer, frame?: string | integer | Phaser.Textures.Frame | string[] | integer[] | Phaser.Textures.Frame[], visible?: boolean): Phaser.GameObjects.Bob[]; + + /** + * Creates multiple Bobs in one call. + * + * The amount created is controlled by a combination of the `quantity` argument and the number of frames provided. + * + * If the quantity is set to 10 and you provide 2 frames, then 20 Bobs will be created. 10 with the first + * frame and 10 with the second. + * @param quantity The quantity of Bob objects to create. + * @param frame The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param visible Should the created Bob render or not? Default true. + */ + createMultiple(quantity: integer, frame?: string | integer | Phaser.Textures.Frame | string[] | integer[] | Phaser.Textures.Frame[], visible?: boolean): Phaser.GameObjects.Bob[]; + + /** + * Checks if the given child can render or not, by checking its `visible` and `alpha` values. + * @param child The Bob to check for rendering. + */ + childCanRender(child: Phaser.GameObjects.Bob): boolean; + + /** + * Returns an array of Bobs to be rendered. + * If the Blitter is dirty then a new list is generated and stored in `renderList`. + */ + getRenderList(): Phaser.GameObjects.Bob[]; + + /** + * Removes all Bobs from the children List and clears the dirty flag. + */ + clear(): void; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Bob Game Object. + * + * A Bob belongs to a Blitter Game Object. The Blitter is responsible for managing and rendering this object. + * + * A Bob has a position, alpha value and a frame from a texture that it uses to render with. You can also toggle + * the flipped and visible state of the Bob. The Frame the Bob uses to render can be changed dynamically, but it + * must be a Frame within the Texture used by the parent Blitter. + * + * Bob positions are relative to the Blitter parent. So if you move the Blitter parent, all Bob children will + * have their positions impacted by this change as well. + * + * You can manipulate Bob objects directly from your game code, but the creation and destruction of them should be + * handled via the Blitter parent. + */ + class Bob { + /** + * + * @param blitter The parent Blitter object is responsible for updating this Bob. + * @param x The horizontal position of this Game Object in the world, relative to the parent Blitter position. + * @param y The vertical position of this Game Object in the world, relative to the parent Blitter position. + * @param frame The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. + * @param visible Should the Bob render visible or not to start with? + */ + constructor(blitter: Phaser.GameObjects.Blitter, x: number, y: number, frame: string | integer, visible: boolean); + + /** + * The Blitter object that this Bob belongs to. + */ + parent: Phaser.GameObjects.Blitter; + + /** + * The x position of this Bob, relative to the x position of the Blitter. + */ + x: number; + + /** + * The y position of this Bob, relative to the y position of the Blitter. + */ + y: number; + + /** + * The frame that the Bob uses to render with. + * To change the frame use the `Bob.setFrame` method. + */ + protected frame: Phaser.Textures.Frame; + + /** + * A blank object which can be used to store data related to this Bob in. + */ + data: object; + + /** + * The horizontally flipped state of the Bob. + * A Bob that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Bob. + * A Bob that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture. + */ + flipY: boolean; + + /** + * Changes the Texture Frame being used by this Bob. + * The frame must be part of the Texture the parent Blitter is using. + * If no value is given it will use the default frame of the Blitter parent. + * @param frame The frame to be used during rendering. + */ + setFrame(frame?: string | integer | Phaser.Textures.Frame): Phaser.GameObjects.Bob; + + /** + * Resets the horizontal and vertical flipped state of this Bob back to their default un-flipped state. + */ + resetFlip(): Phaser.GameObjects.Bob; + + /** + * Resets this Bob. + * + * Changes the position to the values given, and optionally changes the frame. + * + * Also resets the flipX and flipY values, sets alpha back to 1 and visible to true. + * @param x The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param y The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param frame The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + */ + reset(x: number, y: number, frame?: string | integer | Phaser.Textures.Frame): Phaser.GameObjects.Bob; + + /** + * Sets the horizontal flipped state of this Bob. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): Phaser.GameObjects.Bob; + + /** + * Sets the vertical flipped state of this Bob. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): Phaser.GameObjects.Bob; + + /** + * Sets the horizontal and vertical flipped state of this Bob. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): Phaser.GameObjects.Bob; + + /** + * Sets the visibility of this Bob. + * + * An invisible Bob will skip rendering. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): Phaser.GameObjects.Bob; + + /** + * Set the Alpha level of this Bob. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * A Bob with alpha 0 will skip rendering. + * @param value The alpha value used for this Bob. Between 0 and 1. + */ + setAlpha(value: number): Phaser.GameObjects.Bob; + + /** + * Destroys this Bob instance. + * Removes itself from the Blitter and clears the parent, frame and data properties. + */ + destroy(): void; + + /** + * The visible state of the Bob. + * + * An invisible Bob will skip rendering. + */ + visible: boolean; + + /** + * The alpha value of the Bob, between 0 and 1. + * + * A Bob with alpha 0 will skip rendering. + */ + alpha: number; + + } + + /** + * Builds a Game Object using the provided configuration object. + * @param scene A reference to the Scene. + * @param gameObject The initial GameObject. + * @param config The config to build the GameObject with. + */ + function BuildGameObject(scene: Phaser.Scene, gameObject: Phaser.GameObjects.GameObject, config: Phaser.Types.GameObjects.GameObjectConfig): Phaser.GameObjects.GameObject; + + /** + * Adds an Animation component to a Sprite and populates it based on the given config. + * @param sprite The sprite to add an Animation component to. + * @param config The animation config. + */ + function BuildGameObjectAnimation(sprite: Phaser.GameObjects.Sprite, config: object): Phaser.GameObjects.Sprite; + + namespace Components { + /** + * Provides methods used for setting the alpha properties of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Alpha { + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + } + + interface Animation { + /** + * The Game Object to which this animation controller belongs. + */ + parent: Phaser.GameObjects.GameObject; + /** + * A reference to the global Animation Manager. + */ + animationManager: Phaser.Animations.AnimationManager; + /** + * Is an animation currently playing or not? + */ + isPlaying: boolean; + /** + * The current Animation loaded into this Animation Controller. + */ + currentAnim: Phaser.Animations.Animation; + /** + * The current AnimationFrame being displayed by this Animation Controller. + */ + currentFrame: Phaser.Animations.AnimationFrame; + /** + * The key of the next Animation to be loaded into this Animation Controller when the current animation completes. + */ + nextAnim: string; + /** + * The frame rate of playback in frames per second. + * The default is 24 if the `duration` property is `null`. + */ + frameRate: number; + /** + * How long the animation should play for, in milliseconds. + * If the `frameRate` property has been set then it overrides this value, + * otherwise the `frameRate` is derived from `duration`. + */ + duration: number; + /** + * ms per frame, not including frame specific modifiers that may be present in the Animation data. + */ + msPerFrame: number; + /** + * Skip frames if the time lags, or always advanced anyway? + */ + skipMissedFrames: boolean; + /** + * Will the playhead move forwards (`true`) or in reverse (`false`). + */ + forward: boolean; + /** + * Internal time overflow accumulator. + */ + accumulator: number; + /** + * The time point at which the next animation frame will change. + */ + nextTick: number; + /** + * An internal counter keeping track of how many repeats are left to play. + */ + repeatCounter: number; + /** + * An internal flag keeping track of pending repeats. + */ + pendingRepeat: boolean; + /** + * Sets an animation to be played immediately after the current one completes. + * + * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, or have the `stop` method called directly on it. + * + * An animation set to repeat forever will never enter a completed state. + * + * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` callback). + * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. + * + * Call this method with no arguments to reset the chained animation. + * @param key The string-based key of the animation to play next, as defined previously in the Animation Manager. Or an Animation instance. + */ + chain(key?: string | Phaser.Animations.Animation): Phaser.GameObjects.GameObject; + /** + * Sets the amount of time, in milliseconds, that the animation will be delayed before starting playback. + * @param value The amount of time, in milliseconds, to wait before starting playback. Default 0. + */ + setDelay(value?: integer): Phaser.GameObjects.GameObject; + /** + * Gets the amount of time, in milliseconds that the animation will be delayed before starting playback. + */ + getDelay(): integer; + /** + * Waits for the specified delay, in milliseconds, then starts playback of the requested animation. + * @param delay The delay, in milliseconds, to wait before starting the animation playing. + * @param key The key of the animation to play. + * @param startFrame The frame of the animation to start from. Default 0. + */ + delayedPlay(delay: integer, key: string, startFrame?: integer): Phaser.GameObjects.GameObject; + /** + * Returns the key of the animation currently loaded into this component. + */ + getCurrentKey(): string; + /** + * Internal method used to load an animation into this component. + * @param key The key of the animation to load. + * @param startFrame The start frame of the animation to load. Default 0. + */ + load(key: string, startFrame?: integer): Phaser.GameObjects.GameObject; + /** + * Pause the current animation and set the `isPlaying` property to `false`. + * You can optionally pause it at a specific frame. + * @param atFrame An optional frame to set after pausing the animation. + */ + pause(atFrame?: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + /** + * Resumes playback of a paused animation and sets the `isPlaying` property to `true`. + * You can optionally tell it to start playback from a specific frame. + * @param fromFrame An optional frame to set before restarting playback. + */ + resume(fromFrame?: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + /** + * `true` if the current animation is paused, otherwise `false`. + */ + readonly isPaused: boolean; + /** + * Plays an Animation on a Game Object that has the Animation component, such as a Sprite. + * + * Animations are stored in the global Animation Manager and are referenced by a unique string-based key. + * @param key The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. + * @param ignoreIfPlaying If this animation is already playing then ignore this call. Default false. + * @param startFrame Optionally start the animation playing from this frame index. Default 0. + */ + play(key: string | Phaser.Animations.Animation, ignoreIfPlaying?: boolean, startFrame?: integer): Phaser.GameObjects.GameObject; + /** + * Plays an Animation (in reverse mode) on the Game Object that owns this Animation Component. + * @param key The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. + * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. + * @param startFrame Optionally start the animation playing from this frame index. Default 0. + */ + playReverse(key: string | Phaser.Animations.Animation, ignoreIfPlaying?: boolean, startFrame?: integer): Phaser.GameObjects.GameObject; + /** + * Load an Animation and fires 'onStartEvent' event, extracted from 'play' method. + * @param key The string-based key of the animation to play, as defined previously in the Animation Manager. + * @param startFrame Optionally start the animation playing from this frame index. Default 0. + */ + _startAnimation(key: string, startFrame?: integer): Phaser.GameObjects.GameObject; + /** + * Reverse the Animation that is already playing on the Game Object. + */ + reverse(): Phaser.GameObjects.GameObject; + /** + * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. + * If the animation has a non-zero repeat defined, `getProgress` and `getTotalProgress` will be different + * because `getProgress` doesn't include any repeats or repeat delays, whereas `getTotalProgress` does. + */ + getProgress(): number; + /** + * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. + * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. + * @param value The progress value, between 0 and 1. Default 0. + */ + setProgress(value?: number): Phaser.GameObjects.GameObject; + /** + * Handle the removal of an animation from the Animation Manager. + * @param key The key of the removed Animation. + * @param animation The removed Animation. + */ + remove(key?: string, animation?: Phaser.Animations.Animation): void; + /** + * Gets the number of times that the animation will repeat + * after its first iteration. For example, if returns 1, the animation will + * play a total of twice (the initial play plus 1 repeat). + * A value of -1 means the animation will repeat indefinitely. + */ + getRepeat(): integer; + /** + * Sets the number of times that the animation should repeat + * after its first iteration. For example, if repeat is 1, the animation will + * play a total of twice (the initial play plus 1 repeat). + * To repeat indefinitely, use -1. repeat should always be an integer. + * @param value The number of times that the animation should repeat. + */ + setRepeat(value: integer): Phaser.GameObjects.GameObject; + /** + * Gets the amount of delay between repeats, if any. + */ + getRepeatDelay(): number; + /** + * Sets the amount of time in seconds between repeats. + * For example, if `repeat` is 2 and `repeatDelay` is 10, the animation will play initially, + * then wait for 10 seconds before repeating, then play again, then wait another 10 seconds + * before doing its final repeat. + * @param value The delay to wait between repeats, in seconds. + */ + setRepeatDelay(value: number): Phaser.GameObjects.GameObject; + /** + * Restarts the current animation from its beginning, optionally including its delay value. + * @param includeDelay Whether to include the delay value of the animation when restarting. Default false. + */ + restart(includeDelay?: boolean): Phaser.GameObjects.GameObject; + /** + * Immediately stops the current animation from playing and dispatches the `animationcomplete` event. + * + * If no animation is set, no event will be dispatched. + * + * If there is another animation queued (via the `chain` method) then it will start playing immediately. + */ + stop(): Phaser.GameObjects.GameObject; + /** + * Stops the current animation from playing after the specified time delay, given in milliseconds. + * @param delay The number of milliseconds to wait before stopping this animation. + */ + stopAfterDelay(delay: integer): Phaser.GameObjects.GameObject; + /** + * Stops the current animation from playing when it next repeats. + */ + stopOnRepeat(): Phaser.GameObjects.GameObject; + /** + * Stops the current animation from playing when it next sets the given frame. + * If this frame doesn't exist within the animation it will not stop it from playing. + * @param frame The frame to check before stopping this animation. + */ + stopOnFrame(frame: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + /** + * Sets the Time Scale factor, allowing you to make the animation go go faster or slower than default. + * Where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. + * @param value The time scale factor, where 1 is no change, 0.5 is half speed, etc. Default 1. + */ + setTimeScale(value?: number): Phaser.GameObjects.GameObject; + /** + * Gets the Time Scale factor. + */ + getTimeScale(): number; + /** + * Returns the total number of frames in this animation. + */ + getTotalFrames(): integer; + /** + * The internal update loop for the Animation Component. + * @param time The current timestamp. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: number, delta: number): void; + /** + * Sets the given Animation Frame as being the current frame + * and applies it to the parent Game Object, adjusting its size and origin as needed. + * @param animationFrame The Animation Frame to set as being current. + */ + setCurrentFrame(animationFrame: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + /** + * Advances the animation to the next frame, regardless of the time or animation state. + * If the animation is set to repeat, or yoyo, this will still take effect. + * + * Calling this does not change the direction of the animation. I.e. if it was currently + * playing in reverse, calling this method doesn't then change the direction to forwards. + */ + nextFrame(): Phaser.GameObjects.GameObject; + /** + * Advances the animation to the previous frame, regardless of the time or animation state. + * If the animation is set to repeat, or yoyo, this will still take effect. + * + * Calling this does not change the direction of the animation. I.e. if it was currently + * playing in forwards, calling this method doesn't then change the direction to backwards. + */ + previousFrame(): Phaser.GameObjects.GameObject; + /** + * Sets if the current Animation will yoyo when it reaches the end. + * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. + * @param value `true` if the animation should yoyo, `false` to not. Default false. + */ + setYoyo(value?: boolean): Phaser.GameObjects.GameObject; + /** + * Gets if the current Animation will yoyo when it reaches the end. + * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. + */ + getYoyo(): boolean; + /** + * Destroy this Animation component. + * + * Unregisters event listeners and cleans up its references. + */ + destroy(): void; + } + + /** + * Provides methods used for setting the blend mode of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface BlendMode { + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + } + + /** + * Provides methods used for calculating and setting the size of a non-Frame based Game Object. + * Should be applied as a mixin and not used directly. + */ + interface ComputedSize { + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + } + + /** + * Provides methods used for getting and setting the texture of a Game Object. + */ + interface Crop { + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + } + + /** + * Provides methods used for setting the depth of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Depth { + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + } + + /** + * Provides methods used for visually flipping a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Flip { + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + } + + /** + * Provides methods used for obtaining the bounds of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface GetBounds { + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + } + + /** + * Provides methods used for getting and setting the mask of a Game Object. + */ + interface Mask { + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + } + + /** + * Provides methods used for getting and setting the origin of a Game Object. + * Values are normalized, given in the range 0 to 1. + * Display values contain the calculated pixel values. + * Should be applied as a mixin and not used directly. + */ + interface Origin { + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + } + + /** + * Provides methods used for managing a Game Object following a Path. + * Should be applied as a mixin and not used directly. + */ + interface PathFollower { + /** + * The Path this PathFollower is following. It can only follow one Path at a time. + */ + path: Phaser.Curves.Path; + /** + * Should the PathFollower automatically rotate to point in the direction of the Path? + */ + rotateToPath: boolean; + /** + * Set the Path that this PathFollower should follow. + * + * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. + * @param path The Path this PathFollower is following. It can only follow one Path at a time. + * @param config Settings for the PathFollower. + */ + setPath(path: Phaser.Curves.Path, config?: number | Phaser.Types.GameObjects.PathFollower.PathConfig | Phaser.Types.Tweens.NumberTweenBuilderConfig): Phaser.GameObjects.PathFollower; + /** + * Set whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param value Whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param offset Rotation offset in degrees. Default 0. + */ + setRotateToPath(value: boolean, offset?: number): Phaser.GameObjects.PathFollower; + /** + * Is this PathFollower actively following a Path or not? + * + * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. + */ + isFollowing(): boolean; + /** + * Starts this PathFollower following its given Path. + * @param config The duration of the follow, or a PathFollower config object. Default {}. + * @param startAt Optional start position of the follow, between 0 and 1. Default 0. + */ + startFollow(config?: number | Phaser.Types.GameObjects.PathFollower.PathConfig | Phaser.Types.Tweens.NumberTweenBuilderConfig, startAt?: number): Phaser.GameObjects.PathFollower; + /** + * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the + * point on the Path at which you paused it. + */ + pauseFollow(): Phaser.GameObjects.PathFollower; + /** + * Resumes a previously paused PathFollower. + * + * If the PathFollower was not paused this has no effect. + */ + resumeFollow(): Phaser.GameObjects.PathFollower; + /** + * Stops this PathFollower from following the path any longer. + * + * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. + */ + stopFollow(): Phaser.GameObjects.PathFollower; + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + */ + pathUpdate(): void; + } + + /** + * Provides methods used for setting the WebGL rendering pipeline of a Game Object. + */ + interface Pipeline { + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + } + + /** + * Provides methods used for getting and setting the Scroll Factor of a Game Object. + */ + interface ScrollFactor { + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + } + + /** + * Provides methods used for getting and setting the size of a Game Object. + */ + interface Size { + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + } + + /** + * Provides methods used for getting and setting the texture of a Game Object. + */ + interface Texture { + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + } + + /** + * Provides methods used for getting and setting the texture of a Game Object. + */ + interface TextureCrop { + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + } + + /** + * Provides methods used for setting the tint of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Tint { + /** + * Fill or additive? + */ + tintFill: boolean; + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + } + + /** + * Build a JSON representation of the given Game Object. + * + * This is typically extended further by Game Object specific implementations. + */ + interface ToJSON { + } + + /** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + */ + interface Transform { + /** + * The x position of this Game Object. + */ + x: number; + /** + * The y position of this Game Object. + */ + y: number; + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + /** + * The w position of this Game Object. + */ + w: number; + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + } + + /** + * A Matrix used for display transformations for rendering. + * + * It is represented like so: + * + * ``` + * | a | c | tx | + * | b | d | ty | + * | 0 | 0 | 1 | + * ``` + */ + class TransformMatrix { + /** + * + * @param a The Scale X value. Default 1. + * @param b The Shear Y value. Default 0. + * @param c The Shear X value. Default 0. + * @param d The Scale Y value. Default 1. + * @param tx The Translate X value. Default 0. + * @param ty The Translate Y value. Default 0. + */ + constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number); + + /** + * The matrix values. + */ + matrix: Float32Array; + + /** + * The decomposed matrix. + */ + decomposedMatrix: object; + + /** + * The Scale X value. + */ + a: number; + + /** + * The Shear Y value. + */ + b: number; + + /** + * The Shear X value. + */ + c: number; + + /** + * The Scale Y value. + */ + d: number; + + /** + * The Translate X value. + */ + e: number; + + /** + * The Translate Y value. + */ + f: number; + + /** + * The Translate X value. + */ + tx: number; + + /** + * The Translate Y value. + */ + ty: number; + + /** + * The rotation of the Matrix. + */ + readonly rotation: number; + + /** + * The horizontal scale of the Matrix. + */ + readonly scaleX: number; + + /** + * The vertical scale of the Matrix. + */ + readonly scaleY: number; + + /** + * Reset the Matrix to an identity matrix. + */ + loadIdentity(): this; + + /** + * Translate the Matrix. + * @param x The horizontal translation value. + * @param y The vertical translation value. + */ + translate(x: number, y: number): this; + + /** + * Scale the Matrix. + * @param x The horizontal scale value. + * @param y The vertical scale value. + */ + scale(x: number, y: number): this; + + /** + * Rotate the Matrix. + * @param angle The angle of rotation in radians. + */ + rotate(angle: number): this; + + /** + * Multiply this Matrix by the given Matrix. + * + * If an `out` Matrix is given then the results will be stored in it. + * If it is not given, this matrix will be updated in place instead. + * Use an `out` Matrix if you do not wish to mutate this matrix. + * @param rhs The Matrix to multiply by. + * @param out An optional Matrix to store the results in. + */ + multiply(rhs: Phaser.GameObjects.Components.TransformMatrix, out?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Multiply this Matrix by the matrix given, including the offset. + * + * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. + * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. + * @param src The source Matrix to copy from. + * @param offsetX Horizontal offset to factor in to the multiplication. + * @param offsetY Vertical offset to factor in to the multiplication. + */ + multiplyWithOffset(src: Phaser.GameObjects.Components.TransformMatrix, offsetX: number, offsetY: number): this; + + /** + * Transform the Matrix. + * @param a The Scale X value. + * @param b The Shear Y value. + * @param c The Shear X value. + * @param d The Scale Y value. + * @param tx The Translate X value. + * @param ty The Translate Y value. + */ + transform(a: number, b: number, c: number, d: number, tx: number, ty: number): this; + + /** + * Transform a point using this Matrix. + * @param x The x coordinate of the point to transform. + * @param y The y coordinate of the point to transform. + * @param point The Point object to store the transformed coordinates. + */ + transformPoint(x: number, y: number, point: Phaser.Geom.Point | Phaser.Math.Vector2 | object): Phaser.Geom.Point | Phaser.Math.Vector2 | object; + + /** + * Invert the Matrix. + */ + invert(): this; + + /** + * Set the values of this Matrix to copy those of the matrix given. + * @param src The source Matrix to copy from. + */ + copyFrom(src: Phaser.GameObjects.Components.TransformMatrix): this; + + /** + * Set the values of this Matrix to copy those of the array given. + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * @param src The array of values to set into this matrix. + */ + copyFromArray(src: any[]): this; + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.transform method. + * @param ctx The Canvas Rendering Context to copy the matrix values to. + */ + copyToContext(ctx: CanvasRenderingContext2D): CanvasRenderingContext2D; + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.setTransform method. + * @param ctx The Canvas Rendering Context to copy the matrix values to. + */ + setToContext(ctx: CanvasRenderingContext2D): CanvasRenderingContext2D; + + /** + * Copy the values in this Matrix to the array given. + * + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * @param out The array to copy the matrix values in to. + */ + copyToArray(out?: any[]): any[]; + + /** + * Set the values of this Matrix. + * @param a The Scale X value. + * @param b The Shear Y value. + * @param c The Shear X value. + * @param d The Scale Y value. + * @param tx The Translate X value. + * @param ty The Translate Y value. + */ + setTransform(a: number, b: number, c: number, d: number, tx: number, ty: number): this; + + /** + * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. + * + * The result must be applied in the following order to reproduce the current matrix: + * + * translate -> rotate -> scale + */ + decomposeMatrix(): object; + + /** + * Apply the identity, translate, rotate and scale operations on the Matrix. + * @param x The horizontal translation. + * @param y The vertical translation. + * @param rotation The angle of rotation in radians. + * @param scaleX The horizontal scale. + * @param scaleY The vertical scale. + */ + applyITRS(x: number, y: number, rotation: number, scaleX: number, scaleY: number): this; + + /** + * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of + * the current matrix with its transformation applied. + * + * Can be used to translate points from world to local space. + * @param x The x position to translate. + * @param y The y position to translate. + * @param output A Vector2, or point-like object, to store the results in. + */ + applyInverse(x: number, y: number, output?: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Returns the X component of this matrix multiplied by the given values. + * This is the same as `x * a + y * c + e`. + * @param x The x value. + * @param y The y value. + */ + getX(x: number, y: number): number; + + /** + * Returns the Y component of this matrix multiplied by the given values. + * This is the same as `x * b + y * d + f`. + * @param x The x value. + * @param y The y value. + */ + getY(x: number, y: number): number; + + /** + * Returns a string that can be used in a CSS Transform call as a `matrix` property. + */ + getCSSMatrix(): string; + + /** + * Destroys this Transform Matrix. + */ + destroy(): void; + + } + + /** + * Provides methods used for setting the visibility of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Visible { + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + } + + } + + /** + * A Container Game Object. + * + * A Container, as the name implies, can 'contain' other types of Game Object. + * When a Game Object is added to a Container, the Container becomes responsible for the rendering of it. + * By default it will be removed from the Display List and instead added to the Containers own internal list. + * + * The position of the Game Object automatically becomes relative to the position of the Container. + * + * When the Container is rendered, all of its children are rendered as well, in the order in which they exist + * within the Container. Container children can be repositioned using methods such as `MoveUp`, `MoveDown` and `SendToBack`. + * + * If you modify a transform property of the Container, such as `Container.x` or `Container.rotation` then it will + * automatically influence all children as well. + * + * Containers can include other Containers for deeply nested transforms. + * + * Containers can have masks set on them and can be used as a mask too. However, Container children cannot be masked. + * The masks do not 'stack up'. Only a Container on the root of the display list will use its mask. + * + * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them + * to use as their hit area. Container children can also be enabled for input, independent of the Container. + * + * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, + * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, + * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children + * with physics do not factor in the Container due to the excessive extra calculations needed. Please structure + * your game to work around this. + * + * It's important to understand the impact of using Containers. They add additional processing overhead into + * every one of their children. The deeper you nest them, the more the cost escalates. This is especially true + * for input events. You also loose the ability to set the display depth of Container children in the same + * flexible manner as those not within them. In short, don't use them for the sake of it. You pay a small cost + * every time you create one, try to structure your game around avoiding that where possible. + */ + class Container extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param children An optional array of Game Objects to add to this Container. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, children?: Phaser.GameObjects.GameObject[]); + + /** + * An array holding the children of this Container. + */ + list: Phaser.GameObjects.GameObject[]; + + /** + * Does this Container exclusively manage its children? + * + * The default is `true` which means a child added to this Container cannot + * belong in another Container, which includes the Scene display list. + * + * If you disable this then this Container will no longer exclusively manage its children. + * This allows you to create all kinds of interesting graphical effects, such as replicating + * Game Objects without reparenting them all over the Scene. + * However, doing so will prevent children from receiving any kind of input event or have + * their physics bodies work by default, as they're no longer a single entity on the + * display list, but are being replicated where-ever this Container is. + */ + exclusive: boolean; + + /** + * Containers can have an optional maximum size. If set to anything above 0 it + * will constrict the addition of new Game Objects into the Container, capping off + * the maximum limit the Container can grow in size to. + */ + maxSize: integer; + + /** + * The cursor position. + */ + position: integer; + + /** + * Internal Transform Matrix used for local space conversion. + */ + localTransform: Phaser.GameObjects.Components.TransformMatrix; + + /** + * The horizontal scroll factor of this Container. + * + * The scroll factor controls the influence of the movement of a Camera upon this Container. + * + * When a camera scrolls it will change the location at which this Container is rendered on-screen. + * It does not change the Containers actual position values. + * + * For a Container, setting this value will only update the Container itself, not its children. + * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Container. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Container. + * + * The scroll factor controls the influence of the movement of a Camera upon this Container. + * + * When a camera scrolls it will change the location at which this Container is rendered on-screen. + * It does not change the Containers actual position values. + * + * For a Container, setting this value will only update the Container itself, not its children. + * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Container. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + */ + readonly originX: number; + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + */ + readonly originY: number; + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + */ + readonly displayOriginX: number; + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + */ + readonly displayOriginY: number; + + /** + * Does this Container exclusively manage its children? + * + * The default is `true` which means a child added to this Container cannot + * belong in another Container, which includes the Scene display list. + * + * If you disable this then this Container will no longer exclusively manage its children. + * This allows you to create all kinds of interesting graphical effects, such as replicating + * Game Objects without reparenting them all over the Scene. + * However, doing so will prevent children from receiving any kind of input event or have + * their physics bodies work by default, as they're no longer a single entity on the + * display list, but are being replicated where-ever this Container is. + * @param value The exclusive state of this Container. Default true. + */ + setExclusive(value?: boolean): Phaser.GameObjects.Container; + + /** + * Gets the bounds of this Container. It works by iterating all children of the Container, + * getting their respective bounds, and then working out a min-max rectangle from that. + * It does not factor in if the children render or not, all are included. + * + * Some children are unable to return their bounds, such as Graphics objects, in which case + * they are skipped. + * + * Depending on the quantity of children in this Container it could be a really expensive call, + * so cache it and only poll it as needed. + * + * The values are stored and returned in a Rectangle object. + * @param output A Geom.Rectangle object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: Phaser.Geom.Rectangle): Phaser.Geom.Rectangle; + + /** + * Takes a Point-like object, such as a Vector2, Geom.Point or object with public x and y properties, + * and transforms it into the space of this Container, then returns it in the output object. + * @param source The Source Point to be transformed. + * @param output A destination object to store the transformed point in. If none given a Vector2 will be created and returned. + */ + pointToContainer(source: object | Phaser.Geom.Point | Phaser.Math.Vector2, output?: object | Phaser.Geom.Point | Phaser.Math.Vector2): object | Phaser.Geom.Point | Phaser.Math.Vector2; + + /** + * Returns the world transform matrix as used for Bounds checks. + * + * The returned matrix is temporal and shouldn't be stored. + */ + getBoundsTransformMatrix(): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Adds the given Game Object, or array of Game Objects, to this Container. + * + * Each Game Object must be unique within the Container. + * @param child The Game Object, or array of Game Objects, to add to the Container. + */ + add(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.GameObjects.Container; + + /** + * Adds the given Game Object, or array of Game Objects, to this Container at the specified position. + * + * Existing Game Objects in the Container are shifted up. + * + * Each Game Object must be unique within the Container. + * @param child The Game Object, or array of Game Objects, to add to the Container. + * @param index The position to insert the Game Object/s at. Default 0. + */ + addAt(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], index?: integer): Phaser.GameObjects.Container; + + /** + * Returns the Game Object at the given position in this Container. + * @param index The position to get the Game Object from. + */ + getAt(index: integer): Phaser.GameObjects.GameObject; + + /** + * Returns the index of the given Game Object in this Container. + * @param child The Game Object to search for in this Container. + */ + getIndex(child: Phaser.GameObjects.GameObject): integer; + + /** + * Sort the contents of this Container so the items are in order based on the given property. + * For example: `sort('alpha')` would sort the elements based on the value of their `alpha` property. + * @param property The property to lexically sort by. + * @param handler Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean. + */ + sort(property: string, handler?: Function): Phaser.GameObjects.Container; + + /** + * Searches for the first instance of a child with its `name` property matching the given argument. + * Should more than one child have the same name only the first is returned. + * @param name The name to search for. + */ + getByName(name: string): Phaser.GameObjects.GameObject; + + /** + * Returns a random Game Object from this Container. + * @param startIndex An optional start index. Default 0. + * @param length An optional length, the total number of elements (from the startIndex) to choose from. + */ + getRandom(startIndex?: integer, length?: integer): Phaser.GameObjects.GameObject; + + /** + * Gets the first Game Object in this Container. + * + * You can also specify a property and value to search for, in which case it will return the first + * Game Object in this Container with a matching property and / or value. + * + * For example: `getFirst('visible', true)` would return the first Game Object that had its `visible` property set. + * + * You can limit the search to the `startIndex` - `endIndex` range. + * @param property The property to test on each Game Object in the Container. + * @param value The value to test the property against. Must pass a strict (`===`) comparison check. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default Container.length. + */ + getFirst(property: string, value: any, startIndex?: integer, endIndex?: integer): Phaser.GameObjects.GameObject; + + /** + * Returns all Game Objects in this Container. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('body')` would return only Game Objects that have a body property. + * + * You can also specify a value to compare the property to: + * + * `getAll('visible', true)` would return only Game Objects that have their visible property set to `true`. + * + * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 Game Objects. + * @param property The property to test on each Game Object in the Container. + * @param value If property is set then the `property` must strictly equal this value to be included in the results. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default Container.length. + */ + getAll(property?: string, value?: any, startIndex?: integer, endIndex?: integer): Phaser.GameObjects.GameObject[]; + + /** + * Returns the total number of Game Objects in this Container that have a property + * matching the given value. + * + * For example: `count('visible', true)` would count all the elements that have their visible property set. + * + * You can optionally limit the operation to the `startIndex` - `endIndex` range. + * @param property The property to check. + * @param value The value to check. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default Container.length. + */ + count(property: string, value: any, startIndex?: integer, endIndex?: integer): integer; + + /** + * Swaps the position of two Game Objects in this Container. + * Both Game Objects must belong to this Container. + * @param child1 The first Game Object to swap. + * @param child2 The second Game Object to swap. + */ + swap(child1: Phaser.GameObjects.GameObject, child2: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container; + + /** + * Moves a Game Object to a new position within this Container. + * + * The Game Object must already be a child of this Container. + * + * The Game Object is removed from its old position and inserted into the new one. + * Therefore the Container size does not change. Other children will change position accordingly. + * @param child The Game Object to move. + * @param index The new position of the Game Object in this Container. + */ + moveTo(child: Phaser.GameObjects.GameObject, index: integer): Phaser.GameObjects.Container; + + /** + * Removes the given Game Object, or array of Game Objects, from this Container. + * + * The Game Objects must already be children of this Container. + * + * You can also optionally call `destroy` on each Game Object that is removed from the Container. + * @param child The Game Object, or array of Game Objects, to be removed from the Container. + * @param destroyChild Optionally call `destroy` on each child successfully removed from this Container. Default false. + */ + remove(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], destroyChild?: boolean): Phaser.GameObjects.Container; + + /** + * Removes the Game Object at the given position in this Container. + * + * You can also optionally call `destroy` on the Game Object, if one is found. + * @param index The index of the Game Object to be removed. + * @param destroyChild Optionally call `destroy` on the Game Object if successfully removed from this Container. Default false. + */ + removeAt(index: integer, destroyChild?: boolean): Phaser.GameObjects.Container; + + /** + * Removes the Game Objects between the given positions in this Container. + * + * You can also optionally call `destroy` on each Game Object that is removed from the Container. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default Container.length. + * @param destroyChild Optionally call `destroy` on each Game Object successfully removed from this Container. Default false. + */ + removeBetween(startIndex?: integer, endIndex?: integer, destroyChild?: boolean): Phaser.GameObjects.Container; + + /** + * Removes all Game Objects from this Container. + * + * You can also optionally call `destroy` on each Game Object that is removed from the Container. + * @param destroyChild Optionally call `destroy` on each Game Object successfully removed from this Container. Default false. + */ + removeAll(destroyChild?: boolean): Phaser.GameObjects.Container; + + /** + * Brings the given Game Object to the top of this Container. + * This will cause it to render on-top of any other objects in the Container. + * @param child The Game Object to bring to the top of the Container. + */ + bringToTop(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container; + + /** + * Sends the given Game Object to the bottom of this Container. + * This will cause it to render below any other objects in the Container. + * @param child The Game Object to send to the bottom of the Container. + */ + sendToBack(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container; + + /** + * Moves the given Game Object up one place in this Container, unless it's already at the top. + * @param child The Game Object to be moved in the Container. + */ + moveUp(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container; + + /** + * Moves the given Game Object down one place in this Container, unless it's already at the bottom. + * @param child The Game Object to be moved in the Container. + */ + moveDown(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container; + + /** + * Reverses the order of all Game Objects in this Container. + */ + reverse(): Phaser.GameObjects.Container; + + /** + * Shuffles the all Game Objects in this Container using the Fisher-Yates implementation. + */ + shuffle(): Phaser.GameObjects.Container; + + /** + * Replaces a Game Object in this Container with the new Game Object. + * The new Game Object cannot already be a child of this Container. + * @param oldChild The Game Object in this Container that will be replaced. + * @param newChild The Game Object to be added to this Container. + * @param destroyChild Optionally call `destroy` on the Game Object if successfully removed from this Container. Default false. + */ + replace(oldChild: Phaser.GameObjects.GameObject, newChild: Phaser.GameObjects.GameObject, destroyChild?: boolean): Phaser.GameObjects.Container; + + /** + * Returns `true` if the given Game Object is a direct child of this Container. + * + * This check does not scan nested Containers. + * @param child The Game Object to check for within this Container. + */ + exists(child: Phaser.GameObjects.GameObject): boolean; + + /** + * Sets the property to the given value on all Game Objects in this Container. + * + * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 Game Objects. + * @param property The property that must exist on the Game Object. + * @param value The value to get the property to. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default Container.length. + */ + setAll(property: string, value: any, startIndex?: integer, endIndex?: integer): Phaser.GameObjects.Container; + + /** + * Passes all Game Objects in this Container to the given callback. + * + * A copy of the Container is made before passing each entry to your callback. + * This protects against the callback itself modifying the Container. + * + * If you know for sure that the callback will not change the size of this Container + * then you can use the more performant `Container.iterate` method instead. + * @param callback The function to call. + * @param context Value to use as `this` when executing callback. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + each(callback: Function, context?: object, ...args: any[]): Phaser.GameObjects.Container; + + /** + * Passes all Game Objects in this Container to the given callback. + * + * Only use this method when you absolutely know that the Container will not be modified during + * the iteration, i.e. by removing or adding to its contents. + * @param callback The function to call. + * @param context Value to use as `this` when executing callback. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + iterate(callback: Function, context?: object, ...args: any[]): Phaser.GameObjects.Container; + + /** + * Sets the scroll factor of this Container and optionally all of its children. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + * @param updateChildren Apply this scrollFactor to all Container children as well? Default false. + */ + setScrollFactor(x: number, y?: number, updateChildren?: boolean): this; + + /** + * The number of Game Objects inside this Container. + */ + readonly length: integer; + + /** + * Returns the first Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + */ + readonly first: Phaser.GameObjects.GameObject; + + /** + * Returns the last Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + */ + readonly last: Phaser.GameObjects.GameObject; + + /** + * Returns the next Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + */ + readonly next: Phaser.GameObjects.GameObject; + + /** + * Returns the previous Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + */ + readonly previous: Phaser.GameObjects.GameObject; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Display List plugin. + * + * Display Lists belong to a Scene and maintain the list of Game Objects to render every frame. + * + * Some of these Game Objects may also be part of the Scene's [Update List]{@link Phaser.GameObjects.UpdateList}, for updating. + */ + class DisplayList extends Phaser.Structs.List { + /** + * + * @param scene The Scene that this Display List belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. + */ + sortChildrenFlag: boolean; + + /** + * The Scene that this Display List belongs to. + */ + scene: Phaser.Scene; + + /** + * The Scene's Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * Force a sort of the display list on the next call to depthSort. + */ + queueDepthSort(): void; + + /** + * Immediately sorts the display list if the flag is set. + */ + depthSort(): void; + + /** + * Compare the depth of two Game Objects. + * @param childA The first Game Object. + * @param childB The second Game Object. + */ + sortByDepth(childA: Phaser.GameObjects.GameObject, childB: Phaser.GameObjects.GameObject): integer; + + /** + * Returns an array which contains all objects currently on the Display List. + * This is a reference to the main list array, not a copy of it, so be careful not to modify it. + */ + getChildren(): Phaser.GameObjects.GameObject[]; + + } + + /** + * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. + * + * In order for DOM Elements to display you have to enable them by adding the following to your game + * configuration object: + * + * ```javascript + * dom { + * createContainer: true + * } + * ``` + * + * When this is added, Phaser will automatically create a DOM Container div that is positioned over the top + * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of + * settings within the Scale Manager, the dom container is resized accordingly. + * + * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing + * Element that you wish to be placed under the control of Phaser. For example: + * + * ```javascript + * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in + * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case, + * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font. + * + * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control + * alignment and positioning of the elements next to regular game content. + * + * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the + * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other + * methods available in this class to help construct your elements. + * + * Once the element has been created you can then control it like you would any other Game Object. You can set its + * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped + * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that + * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have + * a DOM Element, then a Sprite, then another DOM Element behind it. + * + * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event + * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas + * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you + * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly. + * + * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in. + * + * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert + * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table. + * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and + * UI. The choice is up to you, just remember that you're dealing with standard HTML and CSS floating over the top + * of your game, and should treat it accordingly. + */ + class DOMElement extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this DOM Element in the world. Default 0. + * @param y The vertical position of this DOM Element in the world. Default 0. + * @param element An existing DOM element, or a string. If a string starting with a # it will do a `getElementById` look-up on the string (minus the hash). Without a hash, it represents the type of element to create, i.e. 'div'. + * @param style If a string, will be set directly as the elements `style` property value. If a plain object, will be iterated and the values transferred. In both cases the values replacing whatever CSS styles may have been previously set. + * @param innerText If given, will be set directly as the elements `innerText` property value, replacing whatever was there before. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, element?: Element | string, style?: string | any, innerText?: string); + + /** + * A reference to the parent DOM Container that the Game instance created when it started. + */ + parent: Element; + + /** + * A reference to the HTML Cache. + */ + cache: Phaser.Cache.BaseCache; + + /** + * The actual DOM Element that this Game Object is bound to. For example, if you've created a `
` + * then this property is a direct reference to that element within the dom. + */ + node: Element; + + /** + * By default a DOM Element will have its transform, display, opacity, zIndex and blend mode properties + * updated when its rendered. If, for some reason, you don't want any of these changed other than the + * CSS transform, then set this flag to `true`. When `true` only the CSS Transform is applied and it's + * up to you to keep track of and set the other properties as required. + * + * This can be handy if, for example, you've a nested DOM Element and you don't want the opacity to be + * picked-up by any of its children. + */ + transformOnly: boolean; + + /** + * The angle, in radians, by which to skew the DOM Element on the horizontal axis. + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform + */ + skewX: number; + + /** + * The angle, in radians, by which to skew the DOM Element on the vertical axis. + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform + */ + skewY: number; + + /** + * A Vector4 that contains the 3D rotation of this DOM Element around a fixed axis in 3D space. + * + * All values in the Vector4 are treated as degrees, unless the `rotate3dAngle` property is changed. + * + * For more details see the following MDN page: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d + */ + rotate3d: Phaser.Math.Vector4; + + /** + * The unit that represents the 3D rotation values. By default this is `deg` for degrees, but can + * be changed to any supported unit. See this page for further details: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d + */ + rotate3dAngle: string; + + /** + * The native (un-scaled) width of this Game Object. + * + * For a DOM Element this property is read-only. + * + * The property `displayWidth` holds the computed bounds of this DOM Element, factoring in scaling. + */ + readonly width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * For a DOM Element this property is read-only. + * + * The property `displayHeight` holds the computed bounds of this DOM Element, factoring in scaling. + */ + readonly height: number; + + /** + * The computed display width of this Game Object, based on the `getBoundingClientRect` DOM call. + * + * The property `width` holds the un-scaled width of this DOM Element. + */ + readonly displayWidth: number; + + /** + * The computed display height of this Game Object, based on the `getBoundingClientRect` DOM call. + * + * The property `height` holds the un-scaled height of this DOM Element. + */ + readonly displayHeight: number; + + /** + * Sets the horizontal and vertical skew values of this DOM Element. + * + * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/transform + * @param x The angle, in radians, by which to skew the DOM Element on the horizontal axis. Default 0. + * @param y The angle, in radians, by which to skew the DOM Element on the vertical axis. Default x. + */ + setSkew(x?: number, y?: number): this; + + /** + * Sets the perspective CSS property of the _parent DOM Container_. This determines the distance between the z=0 + * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with + * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined + * by the value of this property. + * + * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective + * + * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.** + * @param value The perspective value, in pixels, that determines the distance between the z plane and the user. + */ + setPerspective(value: number): this; + + /** + * The perspective CSS property value of the _parent DOM Container_. This determines the distance between the z=0 + * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with + * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined + * by the value of this property. + * + * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective + * + * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.** + */ + perspective: number; + + /** + * Adds one or more native DOM event listeners onto the underlying Element of this Game Object. + * The event is then dispatched via this Game Objects standard event emitter. + * + * For example: + * + * ```javascript + * var div = this.add.dom(x, y, element); + * + * div.addListener('click'); + * + * div.on('click', handler); + * ``` + * @param events The DOM event/s to listen for. You can specify multiple events by separating them with spaces. + */ + addListener(events: string): this; + + /** + * Removes one or more native DOM event listeners from the underlying Element of this Game Object. + * @param events The DOM event/s to stop listening for. You can specify multiple events by separating them with spaces. + */ + removeListener(events: string): this; + + /** + * Creates a native DOM Element, adds it to the parent DOM Container and then binds it to this Game Object, + * so you can control it. The `tagName` should be a string and is passed to `document.createElement`: + * + * ```javascript + * this.add.dom().createElement('div'); + * ``` + * + * For more details on acceptable tag names see: https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement + * + * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText` + * value as well. Here is an example of a DOMString: + * + * ```javascript + * this.add.dom().createElement('div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * And using a style object: + * + * ```javascript + * var style = { + * 'background-color': 'lime'; + * 'width': '200px'; + * 'height': '100px'; + * 'font': '48px Arial'; + * }; + * + * this.add.dom().createElement('div', style, 'Phaser'); + * ``` + * + * If this Game Object already has an Element, it is removed from the DOM entirely first. + * Any event listeners you may have previously created will need to be re-created after this call. + * @param tagName A string that specifies the type of element to be created. The nodeName of the created element is initialized with the value of tagName. Don't use qualified names (like "html:a") with this method. + * @param style Either a DOMString that holds the CSS styles to be applied to the created element, or an object the styles will be ready from. + * @param innerText A DOMString that holds the text that will be set as the innerText of the created element. + */ + createElement(tagName: string, style?: string | any, innerText?: string): this; + + /** + * Binds a new DOM Element to this Game Object. If this Game Object already has an Element it is removed from the DOM + * entirely first. Any event listeners you may have previously created will need to be re-created on the new element. + * + * The `element` argument you pass to this method can be either a string tagName: + * + * ```javascript + *

Phaser

+ * + * this.add.dom().setElement('heading'); + * ``` + * + * Or a reference to an Element instance: + * + * ```javascript + *

Phaser

+ * + * var h1 = document.getElementById('heading'); + * + * this.add.dom().setElement(h1); + * ``` + * + * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText` + * value as well. Here is an example of a DOMString: + * + * ```javascript + * this.add.dom().setElement(h1, 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * And using a style object: + * + * ```javascript + * var style = { + * 'background-color': 'lime'; + * 'width': '200px'; + * 'height': '100px'; + * 'font': '48px Arial'; + * }; + * + * this.add.dom().setElement(h1, style, 'Phaser'); + * ``` + * @param element If a string it is passed to `getElementById()`, or it should be a reference to an existing Element. + * @param style Either a DOMString that holds the CSS styles to be applied to the created element, or an object the styles will be ready from. + * @param innerText A DOMString that holds the text that will be set as the innerText of the created element. + */ + setElement(element: string | Element, style?: string | any, innerText?: string): this; + + /** + * Takes a block of html from the HTML Cache, that has previously been preloaded into the game, and then + * creates a DOM Element from it. The loaded HTML is set as the `innerHTML` property of the created + * element. + * + * Assume the following html is stored in a file called `loginform.html`: + * + * ```html + * + * + * ``` + * + * Which is loaded into your game using the cache key 'login': + * + * ```javascript + * this.load.html('login', 'assets/loginform.html'); + * ``` + * + * You can create a DOM Element from it using the cache key: + * + * ```javascript + * this.add.dom().createFromCache('login'); + * ``` + * + * The optional `elementType` argument controls the container that is created, into which the loaded html is inserted. + * The default is a plain `div` object, but any valid tagName can be given. + * + * If this Game Object already has an Element, it is removed from the DOM entirely first. + * Any event listeners you may have previously created will need to be re-created after this call. + * @param The key of the html cache entry to use for this DOM Element. + * @param tagName The tag name of the element into which all of the loaded html will be inserted. Defaults to a plain div tag. Default 'div'. + */ + createFromCache(The: string, tagName?: string): this; + + /** + * Takes a string of html and then creates a DOM Element from it. The HTML is set as the `innerHTML` + * property of the created element. + * + * ```javascript + * let form = ` + * + * + * `; + * ``` + * + * You can create a DOM Element from it using the string: + * + * ```javascript + * this.add.dom().createFromHTML(form); + * ``` + * + * The optional `elementType` argument controls the type of container that is created, into which the html is inserted. + * The default is a plain `div` object, but any valid tagName can be given. + * + * If this Game Object already has an Element, it is removed from the DOM entirely first. + * Any event listeners you may have previously created will need to be re-created after this call. + * @param A string of html to be set as the `innerHTML` property of the created element. + * @param tagName The tag name of the element into which all of the html will be inserted. Defaults to a plain div tag. Default 'div'. + */ + createFromHTML(A: string, tagName?: string): this; + + /** + * Removes the current DOM Element bound to this Game Object from the DOM entirely and resets the + * `node` property of this Game Object to be `null`. + */ + removeElement(): this; + + /** + * Internal method that calls `getBoundingClientRect` on the `node` and then sets the bounds width + * and height into the `displayWidth` and `displayHeight` properties, and the `clientWidth` and `clientHeight` + * values into the `width` and `height` properties respectively. + * + * This is called automatically whenever a new element is created or set. + */ + updateSize(): this; + + /** + * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through + * them, looking for the first one that has a property matching the given key and value. It then returns this child + * if found, or `null` if not. + * @param property The property to search the children for. + * @param value The value the property must strictly equal. + */ + getChildByProperty(property: string, value: string): Element; + + /** + * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through + * them, looking for the first one that has a matching id. It then returns this child if found, or `null` if not. + * + * Be aware that class and id names are case-sensitive. + * @param id The id to search the children for. + */ + getChildByID(id: string): Element; + + /** + * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through + * them, looking for the first one that has a matching name. It then returns this child if found, or `null` if not. + * + * Be aware that class and id names are case-sensitive. + * @param name The name to search the children for. + */ + getChildByName(name: string): Element; + + /** + * Sets the `className` property of the DOM Element node and updates the internal sizes. + * @param className A string representing the class or space-separated classes of the element. + */ + setClassName(className: string): this; + + /** + * Sets the `innerText` property of the DOM Element node and updates the internal sizes. + * + * Note that only certain types of Elements can have `innerText` set on them. + * @param text A DOMString representing the rendered text content of the element. + */ + setText(text: string): this; + + /** + * Sets the `innerHTML` property of the DOM Element node and updates the internal sizes. + * @param html A DOMString of html to be set as the `innerHTML` property of the element. + */ + setHTML(html: string): this; + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * + * DOMElements always return `true` as they need to still set values during the render pass, even if not visible. + */ + willRender(): boolean; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + namespace Events { + /** + * The Game Object Destroy Event. + * + * This event is dispatched when a Game Object instance is being destroyed. + * + * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. + */ + const DESTROY: any; + + } + + /** + * An Extern Game Object is a special type of Game Object that allows you to pass + * rendering off to a 3rd party. + * + * When you create an Extern and place it in the display list of a Scene, the renderer will + * process the list as usual. When it finds an Extern it will flush the current batch, + * clear down the pipeline and prepare a transform matrix which your render function can + * take advantage of, if required. + * + * The WebGL context is then left is a 'clean' state, ready for you to bind your own shaders, + * or draw to it, whatever you wish to do. Once you've finished, you should free-up any + * of your resources. The Extern will then rebind the Phaser pipeline and carry on + * rendering the display list. + * + * Although this object has lots of properties such as Alpha, Blend Mode and Tint, none of + * them are used during rendering unless you take advantage of them in your own render code. + */ + class Extern extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + */ + constructor(scene: Phaser.Scene); + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The base class that all Game Objects extend. + * You don't create GameObjects directly and they cannot be added to the display list. + * Instead, use them as the base for your own custom classes. + */ + class GameObject extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param type A textual representation of the type of Game Object, i.e. `sprite`. + */ + constructor(scene: Phaser.Scene, type: string); + + /** + * The Scene to which this Game Object belongs. + * Game Objects can only belong to one Scene. + */ + protected scene: Phaser.Scene; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + */ + type: string; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could move from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + */ + state: integer | string; + + /** + * The parent Container of this Game Object, if it has one. + */ + parentContainer: Phaser.GameObjects.Container; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + */ + name: string; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + */ + active: boolean; + + /** + * The Tab Index of the Game Object. + * Reserved for future use by plugins and the Input Manager. + */ + tabIndex: integer; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + */ + data: Phaser.Data.DataManager; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + */ + renderFlags: integer; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + */ + cameraFilter: number; + + /** + * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. + * Not usually set directly. Instead call `GameObject.setInteractive()`. + */ + input: Phaser.Types.Input.InteractiveObject; + + /** + * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body. + */ + body: object | Phaser.Physics.Arcade.Body | Phaser.Physics.Impact.Body; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + */ + ignoreDestroy: boolean; + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * @param value True if this Game Object should be set as active, false if not. + */ + setActive(value: boolean): this; + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * @param value The name to be given to this Game Object. + */ + setName(value: string): this; + + /** + * Sets the current state of this Game Object. + * + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * @param value The state of the Game Object. + */ + setState(value: integer | string): this; + + /** + * Adds a Data Manager component to this Game Object. + */ + setDataEnabled(): this; + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * @param key The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. + * @param data The value to set for the given key. If an object is provided as the key this argument is ignored. + */ + setData(key: string | object, data: any): this; + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * @param key The key of the value to retrieve, or an array of keys. + */ + getData(key: string | string[]): any; + + /** + * Pass this Game Object to the Input Manager to enable it for Input. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * @param shape Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param callback A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. + * @param dropZone Should this Game Object be treated as a drop zone target? Default false. + */ + setInteractive(shape?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; + + /** + * If this Game Object has previously been enabled for input, this will disable it. + * + * An object that is disabled for input stops processing or being considered for + * input events, but can be turned back on again at any time by simply calling + * `setInteractive()` with no arguments provided. + * + * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. + */ + disableInteractive(): this; + + /** + * If this Game Object has previously been enabled for input, this will queue it + * for removal, causing it to no longer be interactive. The removal happens on + * the next game step, it is not immediate. + * + * The Interactive Object that was assigned to this Game Object will be destroyed, + * removed from the Input Manager and cleared from this Game Object. + * + * If you wish to re-enable this Game Object at a later date you will need to + * re-create its InteractiveObject by calling `setInteractive` again. + * + * If you wish to only temporarily stop an object from receiving input then use + * `disableInteractive` instead, as that toggles the interactive state, where-as + * this erases it completely. + * + * If you wish to resize a hit area, don't remove and then set it as being + * interactive. Instead, access the hitarea object directly and resize the shape + * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the + * shape is a Rectangle, which it is by default.) + */ + removeInteractive(): this; + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * @param args args + */ + update(...args: any[]): void; + + /** + * Returns a JSON representation of the Game Object. + */ + toJSON(): Phaser.Types.GameObjects.JSONGameObject; + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * @param camera The Camera to check against this Game Object. + */ + willRender(camera: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Returns an array containing the display list index of either this Game Object, or if it has one, + * its parent Container. It then iterates up through all of the parent containers until it hits the + * root of the display list (which is index 0 in the returned array). + * + * Used internally by the InputPlugin but also useful if you wish to find out the display depth of + * this Game Object and all of its ancestors. + */ + getIndexList(): integer[]; + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Also removes itself from the Input Manager and Physics Manager if previously enabled. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. + * @param fromScene Is this Game Object being destroyed as the result of a Scene shutdown? Default false. + */ + destroy(fromScene?: boolean): void; + + /** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + */ + static readonly RENDER_MASK: integer; + + } + + /** + * The Game Object Creator is a Scene plugin that allows you to quickly create many common + * types of Game Objects and return them. Unlike the Game Object Factory, they are not automatically + * added to the Scene. + * + * Game Objects directly register themselves with the Creator and inject their own creation + * methods into the class. + */ + class GameObjectCreator { + /** + * + * @param scene The Scene to which this Game Object Factory belongs. + */ + constructor(scene: Phaser.Scene); + + /** + * Creates a new Dynamic Bitmap Text Game Object and returns it. + * + * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + dynamicBitmapText(config: Phaser.Types.GameObjects.BitmapText.BitmapTextConfig, addToScene?: boolean): Phaser.GameObjects.DynamicBitmapText; + + /** + * Creates a new Bitmap Text Game Object and returns it. + * + * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + bitmapText(config: Phaser.Types.GameObjects.BitmapText.BitmapTextConfig, addToScene?: boolean): Phaser.GameObjects.BitmapText; + + /** + * Creates a new Blitter Game Object and returns it. + * + * Note: This method will only be available if the Blitter Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + blitter(config: object, addToScene?: boolean): Phaser.GameObjects.Blitter; + + /** + * Creates a new Container Game Object and returns it. + * + * Note: This method will only be available if the Container Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + container(config: object, addToScene?: boolean): Phaser.GameObjects.Container; + + /** + * The Scene to which this Game Object Creator belongs. + */ + protected scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems. + */ + protected systems: Phaser.Scenes.Systems; + + /** + * A reference to the Scene Display List. + */ + protected displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene Update List. + */ + protected "updateList;": Phaser.GameObjects.UpdateList; + + /** + * Creates a new Graphics Game Object and returns it. + * + * Note: This method will only be available if the Graphics Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + graphics(config: object, addToScene?: boolean): Phaser.GameObjects.Graphics; + + /** + * Creates a new Group Game Object and returns it. + * + * Note: This method will only be available if the Group Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + */ + group(config: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.GameObjects.Group; + + /** + * Creates a new Image Game Object and returns it. + * + * Note: This method will only be available if the Image Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + image(config: object, addToScene?: boolean): Phaser.GameObjects.Image; + + /** + * Creates a new Mesh Game Object and returns it. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + mesh(config: object, addToScene?: boolean): Phaser.GameObjects.Mesh; + + /** + * Creates a new Particle Emitter Manager Game Object and returns it. + * + * Note: This method will only be available if the Particles Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + particles(config: object, addToScene?: boolean): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Creates a new Quad Game Object and returns it. + * + * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + quad(config: object, addToScene?: boolean): Phaser.GameObjects.Quad; + + /** + * Creates a new Render Texture Game Object and returns it. + * + * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + renderTexture(config: Phaser.Types.GameObjects.RenderTexture.RenderTextureConfig, addToScene?: boolean): Phaser.GameObjects.RenderTexture; + + /** + * Creates a new Shader Game Object and returns it. + * + * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + shader(config: object, addToScene?: boolean): Phaser.GameObjects.Shader; + + /** + * Creates a new Sprite Game Object and returns it. + * + * Note: This method will only be available if the Sprite Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + sprite(config: Phaser.Types.GameObjects.Sprite.SpriteConfig, addToScene?: boolean): Phaser.GameObjects.Sprite; + + /** + * Creates a new Text Game Object and returns it. + * + * Note: This method will only be available if the Text Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + text(config: object, addToScene?: boolean): Phaser.GameObjects.Text; + + /** + * Creates a new TileSprite Game Object and returns it. + * + * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + tileSprite(config: Phaser.Types.GameObjects.TileSprite.TileSpriteConfig, addToScene?: boolean): Phaser.GameObjects.TileSprite; + + /** + * Creates a new Zone Game Object and returns it. + * + * Note: This method will only be available if the Zone Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + */ + zone(config: object): Phaser.GameObjects.Zone; + + /** + * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. + * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing + * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map + * data. For an empty map, you should specify tileWidth, tileHeight, width & height. + * @param config The config options for the Tilemap. + */ + tilemap(config?: Phaser.Types.Tilemaps.TilemapConfig): Phaser.Tilemaps.Tilemap; + + /** + * Creates a new Tween object and returns it. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * @param config The Tween configuration. + */ + tween(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; + + } + + /** + * The Game Object Factory is a Scene plugin that allows you to quickly create many common + * types of Game Objects and have them automatically registered with the Scene. + * + * Game Objects directly register themselves with the Factory and inject their own creation + * methods into the class. + */ + class GameObjectFactory { + /** + * + * @param scene The Scene to which this Game Object Factory belongs. + */ + constructor(scene: Phaser.Scene); + + /** + * Creates a new Path Object. + * @param x The horizontal position of this Path. + * @param y The vertical position of this Path. + */ + path(x: number, y: number): Phaser.Curves.Path; + + /** + * Creates a new Dynamic Bitmap Text Game Object and adds it to the Scene. + * + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * Dynamic Bitmap Text objects are different from Static Bitmap Text in that they invoke a callback for each + * letter being rendered during the render pass. This callback allows you to manipulate the properties of + * each letter being rendered, such as its position, scale or tint, allowing you to create interesting effects + * like jiggling text, which can't be done with Static text. This means that Dynamic Text takes more processing + * time, so only use them if you require the callback ability they have. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + * + * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser. + * @param x The x position of the Game Object. + * @param y The y position of the Game Object. + * @param font The key of the font to use from the BitmapFont cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size to set. + */ + dynamicBitmapText(x: number, y: number, font: string, text?: string | string[], size?: number): Phaser.GameObjects.DynamicBitmapText; + + /** + * Creates a new Bitmap Text Game Object and adds it to the Scene. + * + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + * + * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser. + * @param x The x position of the Game Object. + * @param y The y position of the Game Object. + * @param font The key of the font to use from the BitmapFont cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size to set. + * @param align The alignment of the text in a multi-line BitmapText object. Default 0. + */ + bitmapText(x: number, y: number, font: string, text?: string | string[], size?: number, align?: integer): Phaser.GameObjects.BitmapText; + + /** + * Creates a new Blitter Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Blitter Game Object has been built into Phaser. + * @param x The x position of the Game Object. + * @param y The y position of the Game Object. + * @param key The key of the Texture the Blitter object will use. + * @param frame The default Frame children of the Blitter will use. + */ + blitter(x: number, y: number, key: string, frame?: string | integer): Phaser.GameObjects.Blitter; + + /** + * Creates a new Container Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Container Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param children An optional array of Game Objects to add to this Container. + */ + container(x: number, y: number, children?: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.GameObjects.Container; + + /** + * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. + * + * In order for DOM Elements to display you have to enable them by adding the following to your game + * configuration object: + * + * ```javascript + * dom { + * createContainer: true + * } + * ``` + * + * When this is added, Phaser will automatically create a DOM Container div that is positioned over the top + * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of + * settings within the Scale Manager, the dom container is resized accordingly. + * + * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing + * Element that you wish to be placed under the control of Phaser. For example: + * + * ```javascript + * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in + * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case, + * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font. + * + * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control + * alignment and positioning of the elements next to regular game content. + * + * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the + * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other + * methods available in this class to help construct your elements. + * + * Once the element has been created you can then control it like you would any other Game Object. You can set its + * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped + * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that + * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have + * a DOM Element, then a Sprite, then another DOM Element behind it. + * + * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event + * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas + * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you + * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly. + * + * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in. + * + * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert + * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table. + * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and + * UI. The choice is up to you, just remember that you're dealing with standard HTML and CSS floating over the top + * of your game, and should treat it accordingly. + * + * Note: This method will only be available if the DOM Element Game Object has been built into Phaser. + * @param x The horizontal position of this DOM Element in the world. + * @param y The vertical position of this DOM Element in the world. + * @param element An existing DOM element, or a string. If a string starting with a # it will do a `getElementById` look-up on the string (minus the hash). Without a hash, it represents the type of element to create, i.e. 'div'. + * @param style If a string, will be set directly as the elements `style` property value. If a plain object, will be iterated and the values transferred. In both cases the values replacing whatever CSS styles may have been previously set. + * @param innerText If given, will be set directly as the elements `innerText` property value, replacing whatever was there before. + */ + dom(x: number, y: number, element?: HTMLElement | string, style?: string | any, innerText?: string): Phaser.GameObjects.DOMElement; + + /** + * Creates a new Extern Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Extern Game Object has been built into Phaser. + */ + extern(): Phaser.GameObjects.Extern; + + /** + * The Scene to which this Game Object Factory belongs. + */ + protected scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems. + */ + protected systems: Phaser.Scenes.Systems; + + /** + * A reference to the Scene Display List. + */ + protected displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene Update List. + */ + protected "updateList;": Phaser.GameObjects.UpdateList; + + /** + * Adds an existing Game Object to this Scene. + * + * If the Game Object renders, it will be added to the Display List. + * If it has a `preUpdate` method, it will be added to the Update List. + * @param child The child to be added to this Scene. + */ + existing(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.GameObject; + + /** + * Creates a new Graphics Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Graphics Game Object has been built into Phaser. + * @param config The Graphics configuration. + */ + graphics(config?: Phaser.Types.GameObjects.Graphics.Options): Phaser.GameObjects.Graphics; + + /** + * Creates a new Group Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Group Game Object has been built into Phaser. + * @param children Game Objects to add to this Group; or the `config` argument. + * @param config A Group Configuration object. + */ + group(children?: Phaser.GameObjects.GameObject[] | Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupConfig[], config?: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.GameObjects.Group; + + /** + * Creates a new Image Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Image Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + image(x: number, y: number, texture: string, frame?: string | integer): Phaser.GameObjects.Image; + + /** + * Creates a new Mesh Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param vertices An array containing the vertices data for this Mesh. + * @param uv An array containing the uv data for this Mesh. + * @param colors An array containing the color data for this Mesh. + * @param alphas An array containing the alpha data for this Mesh. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + mesh(x: number, y: number, vertices: number[], uv: number[], colors: number[], alphas: number[], texture: string, frame?: string | integer): Phaser.GameObjects.Mesh; + + /** + * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Particles Game Object has been built into Phaser. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param emitters Configuration settings for one or more emitters to create. + */ + particles(texture: string, frame?: string | integer | object, emitters?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Creates a new PathFollower Game Object and adds it to the Scene. + * + * Note: This method will only be available if the PathFollower Game Object has been built into Phaser. + * @param path The Path this PathFollower is connected to. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + follower(path: Phaser.Curves.Path, x: number, y: number, texture: string, frame?: string | integer): Phaser.GameObjects.PathFollower; + + /** + * Creates a new Quad Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + quad(x: number, y: number, texture: string, frame?: string | integer): Phaser.GameObjects.Quad; + + /** + * Creates a new Render Texture Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. + * + * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and + * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic + * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Render Texture. Default 32. + * @param height The height of the Render Texture. Default 32. + */ + renderTexture(x: number, y: number, width?: integer, height?: integer): Phaser.GameObjects.RenderTexture; + + /** + * Creates a new Shader Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser. + * @param key The key of the shader to use from the shader cache, or a BaseShader instance. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the Game Object. Default 128. + * @param height The height of the Game Object. Default 128. + * @param textures Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. + */ + shader(key: string | Phaser.Display.BaseShader, x?: number, y?: number, width?: number, height?: number, textures?: string[]): Phaser.GameObjects.Shader; + + /** + * Creates a new Arc Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Arc Game Object has been built into Phaser. + * + * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an arc shape. You can control the start and end angles of the arc, + * as well as if the angles are winding clockwise or anti-clockwise. With the default settings + * it renders as a complete circle. By changing the angles you can create other arc shapes, + * such as half-circles. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param radius The radius of the arc. Default 128. + * @param startAngle The start angle of the arc, in degrees. Default 0. + * @param endAngle The end angle of the arc, in degrees. Default 360. + * @param anticlockwise The winding order of the start and end angles. Default false. + * @param fillColor The color the arc will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + arc(x?: number, y?: number, radius?: number, startAngle?: integer, endAngle?: integer, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; + + /** + * Creates a new Circle Shape Game Object and adds it to the Scene. + * + * A Circle is an Arc with no defined start and end angle, making it render as a complete circle. + * + * Note: This method will only be available if the Arc Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param radius The radius of the circle. Default 128. + * @param fillColor The color the circle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the circle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + circle(x?: number, y?: number, radius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; + + /** + * Creates a new Curve Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Curve Game Object has been built into Phaser. + * + * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to + * the Curve Shape in the constructor. + * + * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param curve The Curve object to use to create the Shape. + * @param fillColor The color the curve will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the curve will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + curve(x?: number, y?: number, curve?: Phaser.Curves.Curve, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Curve; + + /** + * Creates a new Ellipse Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Ellipse Game Object has been built into Phaser. + * + * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. + * If the width and height match it will render as a circle. If the width is less than the height, + * it will look more like an egg shape. + * + * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. + * @param height The height of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. + * @param fillColor The color the ellipse will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + ellipse(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Ellipse; + + /** + * Creates a new Grid Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Grid Game Object has been built into Phaser. + * + * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * A Grid Shape allows you to display a grid in your game, where you can control the size of the + * grid as well as the width and height of the grid cells. You can set a fill color for each grid + * cell as well as an alternate fill color. When the alternate fill color is set then the grid + * cells will alternate the fill colors as they render, creating a chess-board effect. You can + * also optionally have an outline fill color. If set, this draws lines between the grid cells + * in the given color. If you specify an outline color with an alpha of zero, then it will draw + * the cells spaced out, but without the lines between them. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the grid. Default 128. + * @param height The height of the grid. Default 128. + * @param cellWidth The width of one cell in the grid. Default 32. + * @param cellHeight The height of one cell in the grid. Default 32. + * @param fillColor The color the grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * @param outlineFillColor The color of the lines between the grid cells. + * @param outlineFillAlpha The alpha of the lines between the grid cells. + */ + grid(x?: number, y?: number, width?: number, height?: number, cellWidth?: number, cellHeight?: number, fillColor?: number, fillAlpha?: number, outlineFillColor?: number, outlineFillAlpha?: number): Phaser.GameObjects.Grid; + + /** + * Creates a new IsoBox Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the IsoBox Game Object has been built into Phaser. + * + * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set + * the color of the top, left and right faces of the rectangle respectively. You can also choose + * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting + * the `projection` property. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param size The width of the iso box in pixels. The left and right faces will be exactly half this value. Default 48. + * @param height The height of the iso box. The left and right faces will be this tall. The overall height of the isobox will be this value plus half the `size` value. Default 32. + * @param fillTop The fill color of the top face of the iso box. Default 0xeeeeee. + * @param fillLeft The fill color of the left face of the iso box. Default 0x999999. + * @param fillRight The fill color of the right face of the iso box. Default 0xcccccc. + */ + isobox(x?: number, y?: number, size?: number, height?: number, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoBox; + + /** + * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the IsoTriangle Game Object has been built into Phaser. + * + * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different + * fill color. You can set the color of the top, left and right faces of the triangle respectively + * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting + * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside + * down or not. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param size The width of the iso triangle in pixels. The left and right faces will be exactly half this value. Default 48. + * @param height The height of the iso triangle. The left and right faces will be this tall. The overall height of the iso triangle will be this value plus half the `size` value. Default 32. + * @param reversed Is the iso triangle upside down? Default false. + * @param fillTop The fill color of the top face of the iso triangle. Default 0xeeeeee. + * @param fillLeft The fill color of the left face of the iso triangle. Default 0x999999. + * @param fillRight The fill color of the right face of the iso triangle. Default 0xcccccc. + */ + isotriangle(x?: number, y?: number, size?: number, height?: number, reversed?: boolean, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoTriangle; + + /** + * Creates a new Line Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Line Game Object has been built into Phaser. + * + * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only stroke colors and cannot be filled. + * + * A Line Shape allows you to draw a line between two points in your game. You can control the + * stroke color and thickness of the line. In WebGL only you can also specify a different + * thickness for the start and end of the line, allowing you to render lines that taper-off. + * + * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the start of the line. Default 0. + * @param y1 The vertical position of the start of the line. Default 0. + * @param x2 The horizontal position of the end of the line. Default 128. + * @param y2 The vertical position of the end of the line. Default 0. + * @param strokeColor The color the line will be drawn in, i.e. 0xff0000 for red. + * @param strokeAlpha The alpha the line will be drawn in. You can also set the alpha of the overall Shape using its `alpha` property. + */ + line(x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, strokeColor?: number, strokeAlpha?: number): Phaser.GameObjects.Line; + + /** + * Creates a new Polygon Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Polygon Game Object has been built into Phaser. + * + * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Polygon Shape is created by providing a list of points, which are then used to create an + * internal Polygon geometry object. The points can be set from a variety of formats: + * + * - An array of Point or Vector2 objects: `[new Phaser.Math.Vec2(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending + * on the coordinates of the points provided, the final shape may be rendered offset from its origin. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The points that make up the polygon. + * @param fillColor The color the polygon will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the polygon will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + polygon(x?: number, y?: number, points?: any, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Polygon; + + /** + * Creates a new Rectangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Rectangle Game Object has been built into Phaser. + * + * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * You can change the size of the rectangle by changing the `width` and `height` properties. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the rectangle. Default 128. + * @param height The height of the rectangle. Default 128. + * @param fillColor The color the rectangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the rectangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + rectangle(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Rectangle; + + /** + * Creates a new Star Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Star Game Object has been built into Phaser. + * + * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * As the name implies, the Star shape will display a star in your game. You can control several + * aspects of it including the number of points that constitute the star. The default is 5. If + * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky + * star shape. + * + * You can also control the inner and outer radius, which is how 'long' each point of the star is. + * Modify these values to create more interesting shapes. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The number of points on the star. Default 5. + * @param innerRadius The inner radius of the star. Default 32. + * @param outerRadius The outer radius of the star. Default 64. + * @param fillColor The color the star will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + star(x?: number, y?: number, points?: number, innerRadius?: number, outerRadius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Star; + + /** + * Creates a new Triangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Triangle Game Object has been built into Phaser. + * + * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the + * position of each point of these lines. The triangle is always closed and cannot have an open + * face. If you require that, consider using a Polygon instead. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the first point in the triangle. Default 0. + * @param y1 The vertical position of the first point in the triangle. Default 128. + * @param x2 The horizontal position of the second point in the triangle. Default 64. + * @param y2 The vertical position of the second point in the triangle. Default 0. + * @param x3 The horizontal position of the third point in the triangle. Default 128. + * @param y3 The vertical position of the third point in the triangle. Default 128. + * @param fillColor The color the triangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + triangle(x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Triangle; + + /** + * Creates a new Sprite Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Sprite Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + sprite(x: number, y: number, texture: string, frame?: string | integer): Phaser.GameObjects.Sprite; + + /** + * Creates a new Text Game Object and adds it to the Scene. + * + * A Text Game Object. + * + * Text objects work by creating their own internal hidden Canvas and then renders text to it using + * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered + * to your game during the render pass. + * + * Because it uses the Canvas API you can take advantage of all the features this offers, such as + * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts + * loaded externally, such as Google or TypeKit Web fonts. + * + * You can only display fonts that are currently loaded and available to the browser: therefore fonts must + * be pre-loaded. Phaser does not do ths for you, so you will require the use of a 3rd party font loader, + * or have the fonts ready available in the CSS on the page in which your Phaser game resides. + * + * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts + * across mobile browsers. + * + * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being + * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the + * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of + * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text + * instead, as it benefits from batching and avoids expensive Canvas API calls. + * + * Note: This method will only be available if the Text Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param text The text this Text object will display. + * @param style The Text style configuration object. + */ + text(x: number, y: number, text: string | string[], style?: object): Phaser.GameObjects.Text; + + /** + * Creates a new TileSprite Game Object and adds it to the Scene. + * + * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. If zero it will use the size of the texture frame. + * @param height The height of the Game Object. If zero it will use the size of the texture frame. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + tileSprite(x: number, y: number, width: integer, height: integer, texture: string, frame?: string | integer): Phaser.GameObjects.TileSprite; + + /** + * Creates a new Zone Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Zone Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. + * @param height The height of the Game Object. + */ + zone(x: number, y: number, width: number, height: number): Phaser.GameObjects.Zone; + + /** + * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. + * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing + * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map + * data. For an empty map, you should specify tileWidth, tileHeight, width & height. + * @param key The key in the Phaser cache that corresponds to the loaded tilemap data. + * @param tileWidth The width of a tile in pixels. Pass in `null` to leave as the + * default. Default 32. + * @param tileHeight The height of a tile in pixels. Pass in `null` to leave as the + * default. Default 32. + * @param width The width of the map in tiles. Pass in `null` to leave as the + * default. Default 10. + * @param height The height of the map in tiles. Pass in `null` to leave as the + * default. Default 10. + * @param data Instead of loading from the cache, you can also load directly from + * a 2D array of tile indexes. Pass in `null` for no data. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the + * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. Default false. + */ + tilemap(key?: string, tileWidth?: integer, tileHeight?: integer, width?: integer, height?: integer, data?: integer[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; + + /** + * Creates a new Tween object. + * + * Note: This method will only be available Tweens have been built into Phaser. + * @param config The Tween configuration. + */ + tween(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; + + } + + /** + * A Graphics object is a way to draw primitive shapes to your game. Primitives include forms of geometry, such as + * Rectangles, Circles, and Polygons. They also include lines, arcs and curves. When you initially create a Graphics + * object it will be empty. + * + * To draw to it you must first specify a line style or fill style (or both), draw shapes using paths, and finally + * fill or stroke them. For example: + * + * ```javascript + * graphics.lineStyle(5, 0xFF00FF, 1.0); + * graphics.beginPath(); + * graphics.moveTo(100, 100); + * graphics.lineTo(200, 200); + * graphics.closePath(); + * graphics.strokePath(); + * ``` + * + * There are also many helpful methods that draw and fill/stroke common shapes for you. + * + * ```javascript + * graphics.lineStyle(5, 0xFF00FF, 1.0); + * graphics.fillStyle(0xFFFFFF, 1.0); + * graphics.fillRect(50, 50, 400, 200); + * graphics.strokeRect(50, 50, 400, 200); + * ``` + * + * When a Graphics object is rendered it will render differently based on if the game is running under Canvas or WebGL. + * Under Canvas it will use the HTML Canvas context drawing operations to draw the path. + * Under WebGL the graphics data is decomposed into polygons. Both of these are expensive processes, especially with + * complex shapes. + * + * If your Graphics object doesn't change much (or at all) once you've drawn your shape to it, then you will help + * performance by calling {@link Phaser.GameObjects.Graphics#generateTexture}. This will 'bake' the Graphics object into + * a Texture, and return it. You can then use this Texture for Sprites or other display objects. If your Graphics object + * updates frequently then you should avoid doing this, as it will constantly generate new textures, which will consume + * memory. + * + * As you can tell, Graphics objects are a bit of a trade-off. While they are extremely useful, you need to be careful + * in their complexity and quantity of them in your game. + */ + class Graphics extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { + /** + * + * @param scene The Scene to which this Graphics object belongs. + * @param options Options that set the position and default style of this Graphics object. + */ + constructor(scene: Phaser.Scene, options?: Phaser.Types.GameObjects.Graphics.Options); + + /** + * The horizontal display origin of the Graphics. + */ + displayOriginX: number; + + /** + * The vertical display origin of the Graphics. + */ + displayOriginY: number; + + /** + * The array of commands used to render the Graphics. + */ + commandBuffer: any[]; + + /** + * The default fill color for shapes rendered by this Graphics object. + */ + defaultFillColor: number; + + /** + * The default fill alpha for shapes rendered by this Graphics object. + */ + defaultFillAlpha: number; + + /** + * The default stroke width for shapes rendered by this Graphics object. + */ + defaultStrokeWidth: number; + + /** + * The default stroke color for shapes rendered by this Graphics object. + */ + defaultStrokeColor: number; + + /** + * The default stroke alpha for shapes rendered by this Graphics object. + */ + defaultStrokeAlpha: number; + + /** + * Set the default style settings for this Graphics object. + * @param options The styles to set as defaults. + */ + setDefaultStyles(options: Phaser.Types.GameObjects.Graphics.Styles): Phaser.GameObjects.Graphics; + + /** + * Set the current line style. + * @param lineWidth The stroke width. + * @param color The stroke color. + * @param alpha The stroke alpha. Default 1. + */ + lineStyle(lineWidth: number, color: number, alpha?: number): Phaser.GameObjects.Graphics; + + /** + * Set the current fill style. + * @param color The fill color. + * @param alpha The fill alpha. Default 1. + */ + fillStyle(color: number, alpha?: number): Phaser.GameObjects.Graphics; + + /** + * Sets a gradient fill style. This is a WebGL only feature. + * + * The gradient color values represent the 4 corners of an untransformed rectangle. + * The gradient is used to color all filled shapes and paths drawn after calling this method. + * If you wish to turn a gradient off, call `fillStyle` and provide a new single fill color. + * + * When filling a triangle only the first 3 color values provided are used for the 3 points of a triangle. + * + * This feature is best used only on rectangles and triangles. All other shapes will give strange results. + * + * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used + * will be filled with a gradient on its own. There is no ability to gradient fill a shape or path as a single + * entity at this time. + * @param topLeft The tint being applied to the top-left of the Game Object. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + * @param alpha The fill alpha. Default 1. + */ + fillGradientStyle(topLeft: integer, topRight: integer, bottomLeft: integer, bottomRight: integer, alpha?: number): Phaser.GameObjects.Graphics; + + /** + * Sets a gradient line style. This is a WebGL only feature. + * + * The gradient color values represent the 4 corners of an untransformed rectangle. + * The gradient is used to color all stroked shapes and paths drawn after calling this method. + * If you wish to turn a gradient off, call `lineStyle` and provide a new single line color. + * + * This feature is best used only on single lines. All other shapes will give strange results. + * + * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used + * will be filled with a gradient on its own. There is no ability to gradient stroke a shape or path as a single + * entity at this time. + * @param lineWidth The stroke width. + * @param topLeft The tint being applied to the top-left of the Game Object. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + * @param alpha The fill alpha. Default 1. + */ + lineGradientStyle(lineWidth: number, topLeft: integer, topRight: integer, bottomLeft: integer, bottomRight: integer, alpha?: number): Phaser.GameObjects.Graphics; + + /** + * Sets the texture frame this Graphics Object will use when drawing all shapes defined after calling this. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * Once set, all shapes will use this texture. Call this method with no arguments to clear it. + * + * The textures are not tiled. They are stretched to the dimensions of the shapes being rendered. For this reason, + * it works best with seamless / tileable textures. + * + * The mode argument controls how the textures are combined with the fill colors. The default value (0) will + * multiply the texture by the fill color. A value of 1 will use just the fill color, but the alpha data from the texture, + * and a value of 2 will use just the texture and no fill color at all. + * @param key The key of the texture to be used, as stored in the Texture Manager. Leave blank to clear a previously set texture. + * @param frame The name or index of the frame within the Texture. + * @param mode The texture tint mode. 0 is multiply, 1 is alpha only and 2 is texture only. Default 0. + */ + setTexture(key?: string, frame?: string | integer, mode?: number): this; + + /** + * Start a new shape path. + */ + beginPath(): Phaser.GameObjects.Graphics; + + /** + * Close the current path. + */ + closePath(): Phaser.GameObjects.Graphics; + + /** + * Fill the current path. + */ + fillPath(): Phaser.GameObjects.Graphics; + + /** + * Fill the current path. + * + * This is an alias for `Graphics.fillPath` and does the same thing. + * It was added to match the CanvasRenderingContext 2D API. + */ + fill(): Phaser.GameObjects.Graphics; + + /** + * Stroke the current path. + */ + strokePath(): Phaser.GameObjects.Graphics; + + /** + * Stroke the current path. + * + * This is an alias for `Graphics.strokePath` and does the same thing. + * It was added to match the CanvasRenderingContext 2D API. + */ + stroke(): Phaser.GameObjects.Graphics; + + /** + * Fill the given circle. + * @param circle The circle to fill. + */ + fillCircleShape(circle: Phaser.Geom.Circle): Phaser.GameObjects.Graphics; + + /** + * Stroke the given circle. + * @param circle The circle to stroke. + */ + strokeCircleShape(circle: Phaser.Geom.Circle): Phaser.GameObjects.Graphics; + + /** + * Fill a circle with the given position and radius. + * @param x The x coordinate of the center of the circle. + * @param y The y coordinate of the center of the circle. + * @param radius The radius of the circle. + */ + fillCircle(x: number, y: number, radius: number): Phaser.GameObjects.Graphics; + + /** + * Stroke a circle with the given position and radius. + * @param x The x coordinate of the center of the circle. + * @param y The y coordinate of the center of the circle. + * @param radius The radius of the circle. + */ + strokeCircle(x: number, y: number, radius: number): Phaser.GameObjects.Graphics; + + /** + * Fill the given rectangle. + * @param rect The rectangle to fill. + */ + fillRectShape(rect: Phaser.Geom.Rectangle): Phaser.GameObjects.Graphics; + + /** + * Stroke the given rectangle. + * @param rect The rectangle to stroke. + */ + strokeRectShape(rect: Phaser.Geom.Rectangle): Phaser.GameObjects.Graphics; + + /** + * Fill a rectangle with the given position and size. + * @param x The x coordinate of the top-left of the rectangle. + * @param y The y coordinate of the top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + */ + fillRect(x: number, y: number, width: number, height: number): Phaser.GameObjects.Graphics; + + /** + * Stroke a rectangle with the given position and size. + * @param x The x coordinate of the top-left of the rectangle. + * @param y The y coordinate of the top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + */ + strokeRect(x: number, y: number, width: number, height: number): Phaser.GameObjects.Graphics; + + /** + * Fill a rounded rectangle with the given position, size and radius. + * @param x The x coordinate of the top-left of the rectangle. + * @param y The y coordinate of the top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param radius The corner radius; It can also be an object to specify different radii for corners. Default 20. + */ + fillRoundedRect(x: number, y: number, width: number, height: number, radius?: Phaser.Types.GameObjects.Graphics.RoundedRectRadius | number): Phaser.GameObjects.Graphics; + + /** + * Stroke a rounded rectangle with the given position, size and radius. + * @param x The x coordinate of the top-left of the rectangle. + * @param y The y coordinate of the top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param radius The corner radius; It can also be an object to specify different radii for corners. Default 20. + */ + strokeRoundedRect(x: number, y: number, width: number, height: number, radius?: Phaser.Types.GameObjects.Graphics.RoundedRectRadius | number): Phaser.GameObjects.Graphics; + + /** + * Fill the given point. + * + * Draws a square at the given position, 1 pixel in size by default. + * @param point The point to fill. + * @param size The size of the square to draw. Default 1. + */ + fillPointShape(point: Phaser.Geom.Point | Phaser.Math.Vector2 | object, size?: number): Phaser.GameObjects.Graphics; + + /** + * Fill a point at the given position. + * + * Draws a square at the given position, 1 pixel in size by default. + * @param x The x coordinate of the point. + * @param y The y coordinate of the point. + * @param size The size of the square to draw. Default 1. + */ + fillPoint(x: number, y: number, size?: number): Phaser.GameObjects.Graphics; + + /** + * Fill the given triangle. + * @param triangle The triangle to fill. + */ + fillTriangleShape(triangle: Phaser.Geom.Triangle): Phaser.GameObjects.Graphics; + + /** + * Stroke the given triangle. + * @param triangle The triangle to stroke. + */ + strokeTriangleShape(triangle: Phaser.Geom.Triangle): Phaser.GameObjects.Graphics; + + /** + * Fill a triangle with the given points. + * @param x0 The x coordinate of the first point. + * @param y0 The y coordinate of the first point. + * @param x1 The x coordinate of the second point. + * @param y1 The y coordinate of the second point. + * @param x2 The x coordinate of the third point. + * @param y2 The y coordinate of the third point. + */ + fillTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number): Phaser.GameObjects.Graphics; + + /** + * Stroke a triangle with the given points. + * @param x0 The x coordinate of the first point. + * @param y0 The y coordinate of the first point. + * @param x1 The x coordinate of the second point. + * @param y1 The y coordinate of the second point. + * @param x2 The x coordinate of the third point. + * @param y2 The y coordinate of the third point. + */ + strokeTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number): Phaser.GameObjects.Graphics; + + /** + * Draw the given line. + * @param line The line to stroke. + */ + strokeLineShape(line: Phaser.Geom.Line): Phaser.GameObjects.Graphics; + + /** + * Draw a line between the given points. + * @param x1 The x coordinate of the start point of the line. + * @param y1 The y coordinate of the start point of the line. + * @param x2 The x coordinate of the end point of the line. + * @param y2 The y coordinate of the end point of the line. + */ + lineBetween(x1: number, y1: number, x2: number, y2: number): Phaser.GameObjects.Graphics; + + /** + * Draw a line from the current drawing position to the given position. + * + * Moves the current drawing position to the given position. + * @param x The x coordinate to draw the line to. + * @param y The y coordinate to draw the line to. + */ + lineTo(x: number, y: number): Phaser.GameObjects.Graphics; + + /** + * Move the current drawing position to the given position. + * @param x The x coordinate to move to. + * @param y The y coordinate to move to. + */ + moveTo(x: number, y: number): Phaser.GameObjects.Graphics; + + /** + * Stroke the shape represented by the given array of points. + * + * Pass `closeShape` to automatically close the shape by joining the last to the first point. + * + * Pass `closePath` to automatically close the path before it is stroked. + * @param points The points to stroke. + * @param closeShape When `true`, the shape is closed by joining the last point to the first point. Default false. + * @param closePath When `true`, the path is closed before being stroked. Default false. + * @param endIndex The index of `points` to stop drawing at. Defaults to `points.length`. + */ + strokePoints(points: any[] | Phaser.Geom.Point[], closeShape?: boolean, closePath?: boolean, endIndex?: integer): Phaser.GameObjects.Graphics; + + /** + * Fill the shape represented by the given array of points. + * + * Pass `closeShape` to automatically close the shape by joining the last to the first point. + * + * Pass `closePath` to automatically close the path before it is filled. + * @param points The points to fill. + * @param closeShape When `true`, the shape is closed by joining the last point to the first point. Default false. + * @param closePath When `true`, the path is closed before being stroked. Default false. + * @param endIndex The index of `points` to stop at. Defaults to `points.length`. + */ + fillPoints(points: any[] | Phaser.Geom.Point[], closeShape?: boolean, closePath?: boolean, endIndex?: integer): Phaser.GameObjects.Graphics; + + /** + * Stroke the given ellipse. + * @param ellipse The ellipse to stroke. + * @param smoothness The number of points to draw the ellipse with. Default 32. + */ + strokeEllipseShape(ellipse: Phaser.Geom.Ellipse, smoothness?: integer): Phaser.GameObjects.Graphics; + + /** + * Stroke an ellipse with the given position and size. + * @param x The x coordinate of the center of the ellipse. + * @param y The y coordinate of the center of the ellipse. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + * @param smoothness The number of points to draw the ellipse with. Default 32. + */ + strokeEllipse(x: number, y: number, width: number, height: number, smoothness?: integer): Phaser.GameObjects.Graphics; + + /** + * Fill the given ellipse. + * @param ellipse The ellipse to fill. + * @param smoothness The number of points to draw the ellipse with. Default 32. + */ + fillEllipseShape(ellipse: Phaser.Geom.Ellipse, smoothness?: integer): Phaser.GameObjects.Graphics; + + /** + * Fill an ellipse with the given position and size. + * @param x The x coordinate of the center of the ellipse. + * @param y The y coordinate of the center of the ellipse. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + * @param smoothness The number of points to draw the ellipse with. Default 32. + */ + fillEllipse(x: number, y: number, width: number, height: number, smoothness?: integer): Phaser.GameObjects.Graphics; + + /** + * Draw an arc. + * + * This method can be used to create circles, or parts of circles. + * + * Make sure you call `beginPath` before starting the arc unless you wish for the arc to automatically + * close when filled or stroked. + * + * Use the optional `overshoot` argument increase the number of iterations that take place when + * the arc is rendered in WebGL. This is useful if you're drawing an arc with an especially thick line, + * as it will allow the arc to fully join-up. Try small values at first, i.e. 0.01. + * + * Call {@link Phaser.GameObjects.Graphics#fillPath} or {@link Phaser.GameObjects.Graphics#strokePath} after calling + * this method to draw the arc. + * @param x The x coordinate of the center of the circle. + * @param y The y coordinate of the center of the circle. + * @param radius The radius of the circle. + * @param startAngle The starting angle, in radians. + * @param endAngle The ending angle, in radians. + * @param anticlockwise Whether the drawing should be anticlockwise or clockwise. Default false. + * @param overshoot This value allows you to increase the segment iterations in WebGL rendering. Useful if the arc has a thick stroke and needs to overshoot to join-up cleanly. Use small numbers such as 0.01 to start with and increase as needed. Default 0. + */ + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean, overshoot?: number): Phaser.GameObjects.Graphics; + + /** + * Creates a pie-chart slice shape centered at `x`, `y` with the given radius. + * You must define the start and end angle of the slice. + * + * Setting the `anticlockwise` argument to `true` creates a shape similar to Pacman. + * Setting it to `false` creates a shape like a slice of pie. + * + * This method will begin a new path and close the path at the end of it. + * To display the actual slice you need to call either `strokePath` or `fillPath` after it. + * @param x The horizontal center of the slice. + * @param y The vertical center of the slice. + * @param radius The radius of the slice. + * @param startAngle The start angle of the slice, given in radians. + * @param endAngle The end angle of the slice, given in radians. + * @param anticlockwise Whether the drawing should be anticlockwise or clockwise. Default false. + * @param overshoot This value allows you to overshoot the endAngle by this amount. Useful if the arc has a thick stroke and needs to overshoot to join-up cleanly. Default 0. + */ + slice(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean, overshoot?: number): Phaser.GameObjects.Graphics; + + /** + * Saves the state of the Graphics by pushing the current state onto a stack. + * + * The most recently saved state can then be restored with {@link Phaser.GameObjects.Graphics#restore}. + */ + save(): Phaser.GameObjects.Graphics; + + /** + * Restores the most recently saved state of the Graphics by popping from the state stack. + * + * Use {@link Phaser.GameObjects.Graphics#save} to save the current state, and call this afterwards to restore that state. + * + * If there is no saved state, this command does nothing. + */ + restore(): Phaser.GameObjects.Graphics; + + /** + * Inserts a translation command into this Graphics objects command buffer. + * + * All objects drawn _after_ calling this method will be translated + * by the given amount. + * + * This does not change the position of the Graphics object itself, + * only of the objects drawn by it after calling this method. + * @param x The horizontal translation to apply. + * @param y The vertical translation to apply. + */ + translateCanvas(x: number, y: number): Phaser.GameObjects.Graphics; + + /** + * Inserts a scale command into this Graphics objects command buffer. + * + * All objects drawn _after_ calling this method will be scaled + * by the given amount. + * + * This does not change the scale of the Graphics object itself, + * only of the objects drawn by it after calling this method. + * @param x The horizontal scale to apply. + * @param y The vertical scale to apply. + */ + scaleCanvas(x: number, y: number): Phaser.GameObjects.Graphics; + + /** + * Inserts a rotation command into this Graphics objects command buffer. + * + * All objects drawn _after_ calling this method will be rotated + * by the given amount. + * + * This does not change the rotation of the Graphics object itself, + * only of the objects drawn by it after calling this method. + * @param radians The rotation angle, in radians. + */ + rotateCanvas(radians: number): Phaser.GameObjects.Graphics; + + /** + * Clear the command buffer and reset the fill style and line style to their defaults. + */ + clear(): Phaser.GameObjects.Graphics; + + /** + * Generate a texture from this Graphics object. + * + * If `key` is a string it'll generate a new texture using it and add it into the + * Texture Manager (assuming no key conflict happens). + * + * If `key` is a Canvas it will draw the texture to that canvas context. Note that it will NOT + * automatically upload it to the GPU in WebGL mode. + * @param key The key to store the texture with in the Texture Manager, or a Canvas to draw to. + * @param width The width of the graphics to generate. + * @param height The height of the graphics to generate. + */ + generateTexture(key: string | HTMLCanvasElement, width?: integer, height?: integer): Phaser.GameObjects.Graphics; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * A Camera used specifically by the Graphics system for rendering to textures. + */ + static TargetCamera: Phaser.Cameras.Scene2D.Camera; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + } + + /** + * A Group is a way for you to create, manipulate, or recycle similar Game Objects. + * + * Group membership is non-exclusive. A Game Object can belong to several groups, one group, or none. + * + * Groups themselves aren't displayable, and can't be positioned, rotated, scaled, or hidden. + */ + class Group { + /** + * + * @param scene The scene this group belongs to. + * @param children Game Objects to add to this group; or the `config` argument. + * @param config Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings. + */ + constructor(scene: Phaser.Scene, children?: Phaser.GameObjects.GameObject[] | Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig); + + /** + * This scene this group belongs to. + */ + scene: Phaser.Scene; + + /** + * Members of this group. + */ + children: Phaser.Structs.Set; + + /** + * A flag identifying this object as a group. + */ + isParent: boolean; + + /** + * The class to create new group members from. + */ + classType: Function; + + /** + * The name of this group. + * Empty by default and never populated by Phaser, this is left for developers to use. + */ + name: string; + + /** + * Whether this group runs its {@link Phaser.GameObjects.Group#preUpdate} method + * (which may update any members). + */ + active: boolean; + + /** + * The maximum size of this group, if used as a pool. -1 is no limit. + */ + maxSize: integer; + + /** + * A default texture key to use when creating new group members. + * + * This is used in {@link Phaser.GameObjects.Group#create} + * but not in {@link Phaser.GameObjects.Group#createMultiple}. + */ + defaultKey: string; + + /** + * A default texture frame to use when creating new group members. + */ + defaultFrame: string | integer; + + /** + * Whether to call the update method of any members. + */ + runChildUpdate: boolean; + + /** + * A function to be called when adding or creating group members. + */ + createCallback: Phaser.Types.GameObjects.Group.GroupCallback; + + /** + * A function to be called when removing group members. + */ + removeCallback: Phaser.Types.GameObjects.Group.GroupCallback; + + /** + * A function to be called when creating several group members at once. + */ + createMultipleCallback: Phaser.Types.GameObjects.Group.GroupMultipleCreateCallback; + + /** + * Creates a new Game Object and adds it to this group, unless the group {@link Phaser.GameObjects.Group#isFull is full}. + * + * Calls {@link Phaser.GameObjects.Group#createCallback}. + * @param x The horizontal position of the new Game Object in the world. Default 0. + * @param y The vertical position of the new Game Object in the world. Default 0. + * @param key The texture key of the new Game Object. Default defaultKey. + * @param frame The texture frame of the new Game Object. Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of the new Game Object. Default true. + * @param active The {@link Phaser.GameObjects.GameObject#active} state of the new Game Object. Default true. + */ + create(x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean, active?: boolean): any; + + /** + * Creates several Game Objects and adds them to this group. + * + * If the group becomes {@link Phaser.GameObjects.Group#isFull}, no further Game Objects are created. + * + * Calls {@link Phaser.GameObjects.Group#createMultipleCallback} and {@link Phaser.GameObjects.Group#createCallback}. + * @param config Creation settings. This can be a single configuration object or an array of such objects, which will be applied in turn. + */ + createMultiple(config: Phaser.Types.GameObjects.Group.GroupCreateConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig[]): any[]; + + /** + * A helper for {@link Phaser.GameObjects.Group#createMultiple}. + * @param options Creation settings. + */ + createFromConfig(options: Phaser.Types.GameObjects.Group.GroupCreateConfig): any[]; + + /** + * Updates any group members, if {@link Phaser.GameObjects.Group#runChildUpdate} is enabled. + * @param time The current timestamp. + * @param delta The delta time elapsed since the last frame. + */ + preUpdate(time: number, delta: number): void; + + /** + * Adds a Game Object to this group. + * + * Calls {@link Phaser.GameObjects.Group#createCallback}. + * @param child The Game Object to add. + * @param addToScene Also add the Game Object to the scene. Default false. + */ + add(child: Phaser.GameObjects.GameObject, addToScene?: boolean): Phaser.GameObjects.Group; + + /** + * Adds several Game Objects to this group. + * + * Calls {@link Phaser.GameObjects.Group#createCallback}. + * @param children The Game Objects to add. + * @param addToScene Also add the Game Objects to the scene. Default false. + */ + addMultiple(children: Phaser.GameObjects.GameObject[], addToScene?: boolean): Phaser.GameObjects.Group; + + /** + * Removes a member of this Group and optionally removes it from the Scene and / or destroys it. + * + * Calls {@link Phaser.GameObjects.Group#removeCallback}. + * @param child The Game Object to remove. + * @param removeFromScene Optionally remove the Group member from the Scene it belongs to. Default false. + * @param destroyChild Optionally call destroy on the removed Group member. Default false. + */ + remove(child: Phaser.GameObjects.GameObject, removeFromScene?: boolean, destroyChild?: boolean): Phaser.GameObjects.Group; + + /** + * Removes all members of this Group and optionally removes them from the Scene and / or destroys them. + * + * Does not call {@link Phaser.GameObjects.Group#removeCallback}. + * @param removeFromScene Optionally remove each Group member from the Scene. Default false. + * @param destroyChild Optionally call destroy on the removed Group members. Default false. + */ + clear(removeFromScene?: boolean, destroyChild?: boolean): Phaser.GameObjects.Group; + + /** + * Tests if a Game Object is a member of this group. + * @param child A Game Object. + */ + contains(child: Phaser.GameObjects.GameObject): boolean; + + /** + * All members of the group. + */ + getChildren(): Phaser.GameObjects.GameObject[]; + + /** + * The number of members of the group. + */ + getLength(): integer; + + /** + * Scans the Group, from top to bottom, for the first member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getFirst(state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the Group, from top to bottom, for the nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param nth The nth matching Group member to search for. + * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getFirstNth(nth: integer, state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the Group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getLast(state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the Group for the last nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param nth The nth matching Group member to search for. + * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getLastNth(nth: integer, state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, + * assigns `x` and `y`, and returns the member. + * + * If no inactive member is found and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * The new Game Object will have its active state set to `true`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + get(x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `true`, + * assigns `x` and `y`, and returns the member. + * + * If no active member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getFirstAlive(createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, + * assigns `x` and `y`, and returns the member. + * + * If no inactive member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`. + * The new Game Object will have an active state set to `true`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getFirstDead(createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * {@link Phaser.GameObjects.Components.Animation#play Plays} an animation for all members of this group. + * @param key The string-based key of the animation to play. + * @param startFrame Optionally start the animation playing from this frame index. Default 0. + */ + playAnimation(key: string, startFrame?: string): Phaser.GameObjects.Group; + + /** + * Whether this group's size at its {@link Phaser.GameObjects.Group#maxSize maximum}. + */ + isFull(): boolean; + + /** + * Counts the number of active (or inactive) group members. + * @param value Count active (true) or inactive (false) group members. Default true. + */ + countActive(value?: boolean): integer; + + /** + * Counts the number of in-use (active) group members. + */ + getTotalUsed(): integer; + + /** + * The difference of {@link Phaser.GameObjects.Group#maxSize} and the number of active group members. + * + * This represents the number of group members that could be created or reactivated before reaching the size limit. + */ + getTotalFree(): integer; + + /** + * Sets the depth of each group member. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. + */ + setDepth(value: number, step: number): Phaser.GameObjects.Group; + + /** + * Deactivates a member of this group. + * @param gameObject A member of this group. + */ + kill(gameObject: Phaser.GameObjects.GameObject): void; + + /** + * Deactivates and hides a member of this group. + * @param gameObject A member of this group. + */ + killAndHide(gameObject: Phaser.GameObjects.GameObject): void; + + /** + * Toggles (flips) the visible state of each member of this group. + */ + toggleVisible(): Phaser.GameObjects.Group; + + /** + * Empties this group and removes it from the Scene. + * + * Does not call {@link Phaser.GameObjects.Group#removeCallback}. + * @param destroyChildren Also {@link Phaser.GameObjects.GameObject#destroy} each group member. Default false. + */ + destroy(destroyChildren?: boolean): void; + + } + + /** + * An Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + */ + class Image extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer); + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A 2D point light. + * + * These are typically created by a {@link Phaser.GameObjects.LightsManager}, available from within a scene via `this.lights`. + * + * Any Game Objects using the Light2D pipeline will then be affected by these Lights. + * + * They can also simply be used to represent a point light for your own purposes. + */ + class Light { + /** + * + * @param x The horizontal position of the light. + * @param y The vertical position of the light. + * @param radius The radius of the light. + * @param r The red color of the light. A value between 0 and 1. + * @param g The green color of the light. A value between 0 and 1. + * @param b The blue color of the light. A value between 0 and 1. + * @param intensity The intensity of the light. + */ + constructor(x: number, y: number, radius: number, r: number, g: number, b: number, intensity: number); + + /** + * The horizontal position of the light. + */ + x: number; + + /** + * The vertical position of the light. + */ + y: number; + + /** + * The radius of the light. + */ + radius: number; + + /** + * The red color of the light. A value between 0 and 1. + */ + r: number; + + /** + * The green color of the light. A value between 0 and 1. + */ + g: number; + + /** + * The blue color of the light. A value between 0 and 1. + */ + b: number; + + /** + * The intensity of the light. + */ + intensity: number; + + /** + * The horizontal scroll factor of the light. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of the light. + */ + scrollFactorY: number; + + /** + * Set the properties of the light. + * + * Sets both horizontal and vertical scroll factor to 1. Use {@link Phaser.GameObjects.Light#setScrollFactor} to set + * the scroll factor. + * @param x The horizontal position of the light. + * @param y The vertical position of the light. + * @param radius The radius of the light. + * @param r The red color. A value between 0 and 1. + * @param g The green color. A value between 0 and 1. + * @param b The blue color. A value between 0 and 1. + * @param intensity The intensity of the light. + */ + set(x: number, y: number, radius: number, r: number, g: number, b: number, intensity: number): Phaser.GameObjects.Light; + + /** + * Set the scroll factor of the light. + * @param x The horizontal scroll factor of the light. + * @param y The vertical scroll factor of the light. + */ + setScrollFactor(x: number, y: number): Phaser.GameObjects.Light; + + /** + * Set the color of the light from a single integer RGB value. + * @param rgb The integer RGB color of the light. + */ + setColor(rgb: number): Phaser.GameObjects.Light; + + /** + * Set the intensity of the light. + * @param intensity The intensity of the light. + */ + setIntensity(intensity: number): Phaser.GameObjects.Light; + + /** + * Set the position of the light. + * @param x The horizontal position of the light. + * @param y The vertical position of the light. + */ + setPosition(x: number, y: number): Phaser.GameObjects.Light; + + /** + * Set the radius of the light. + * @param radius The radius of the light. + */ + setRadius(radius: number): Phaser.GameObjects.Light; + + } + + /** + * Manages Lights for a Scene. + * + * Affects the rendering of Game Objects using the `Light2D` pipeline. + */ + class LightsManager { + /** + * The pool of Lights. + * + * Used to recycle removed Lights for a more efficient use of memory. + */ + lightPool: Phaser.GameObjects.Light[]; + + /** + * The Lights in the Scene. + */ + lights: Phaser.GameObjects.Light[]; + + /** + * Lights that have been culled from a Camera's viewport. + * + * Lights in this list will not be rendered. + */ + culledLights: Phaser.GameObjects.Light[]; + + /** + * The ambient color. + */ + ambientColor: Object; + + /** + * Whether the Lights Manager is enabled. + */ + active: boolean; + + /** + * The maximum number of lights that a single Camera and the lights shader can process. + * Change this via the `maxLights` property in your game config, as it cannot be changed at runtime. + */ + readonly maxLights: integer; + + /** + * Enable the Lights Manager. + */ + enable(): Phaser.GameObjects.LightsManager; + + /** + * Disable the Lights Manager. + */ + disable(): Phaser.GameObjects.LightsManager; + + /** + * Cull any Lights that aren't visible to the given Camera. + * + * Culling Lights improves performance by ensuring that only Lights within a Camera's viewport are rendered. + * @param camera The Camera to cull Lights for. + */ + cull(camera: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Light[]; + + /** + * Iterate over each Light with a callback. + * @param callback The callback that is called with each Light. + */ + forEachLight(callback: LightForEach): Phaser.GameObjects.LightsManager; + + /** + * Set the ambient light color. + * @param rgb The integer RGB color of the ambient light. + */ + setAmbientColor(rgb: number): Phaser.GameObjects.LightsManager; + + /** + * Returns the maximum number of Lights allowed to appear at once. + */ + getMaxVisibleLights(): integer; + + /** + * Get the number of Lights managed by this Lights Manager. + */ + getLightCount(): integer; + + /** + * Add a Light. + * @param x The horizontal position of the Light. Default 0. + * @param y The vertical position of the Light. Default 0. + * @param radius The radius of the Light. Default 100. + * @param rgb The integer RGB color of the light. Default 0xffffff. + * @param intensity The intensity of the Light. Default 1. + */ + addLight(x?: number, y?: number, radius?: number, rgb?: number, intensity?: number): Phaser.GameObjects.Light; + + /** + * Remove a Light. + * @param light The Light to remove. + */ + removeLight(light: Phaser.GameObjects.Light): Phaser.GameObjects.LightsManager; + + /** + * Shut down the Lights Manager. + * + * Recycles all active Lights into the Light pool, resets ambient light color and clears the lists of Lights and + * culled Lights. + */ + shutdown(): void; + + /** + * Destroy the Lights Manager. + * + * Cleans up all references by calling {@link Phaser.GameObjects.LightsManager#shutdown}. + */ + destroy(): void; + + } + + /** + * A Scene plugin that provides a {@link Phaser.GameObjects.LightsManager} for the Light2D pipeline. + * + * Available from within a Scene via `this.lights`. + * + * Add Lights using the {@link Phaser.GameObjects.LightsManager#addLight} method: + * + * ```javascript + * // Enable the Lights Manager because it is disabled by default + * this.lights.enable(); + * + * // Create a Light at [400, 300] with a radius of 200 + * this.lights.addLight(400, 300, 200); + * ``` + * + * For Game Objects to be affected by the Lights when rendered, you will need to set them to use the `Light2D` pipeline like so: + * + * ```javascript + * sprite.setPipeline('Light2D'); + * ``` + */ + class LightsPlugin extends Phaser.GameObjects.LightsManager { + /** + * + * @param scene The Scene that this Lights Plugin belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * A reference to the Scene that this Lights Plugin belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene's systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * Boot the Lights Plugin. + */ + boot(): void; + + /** + * Destroy the Lights Plugin. + * + * Cleans up all references. + */ + destroy(): void; + + } + + /** + * A Mesh Game Object. + */ + class Mesh extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param vertices An array containing the vertices data for this Mesh. + * @param uv An array containing the uv data for this Mesh. + * @param colors An array containing the color data for this Mesh. + * @param alphas An array containing the alpha data for this Mesh. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, vertices: number[], uv: number[], colors: number[], alphas: number[], texture: string, frame?: string | integer); + + /** + * An array containing the vertices data for this Mesh. + */ + vertices: Float32Array; + + /** + * An array containing the uv data for this Mesh. + */ + uv: Float32Array; + + /** + * An array containing the color data for this Mesh. + */ + colors: Uint32Array; + + /** + * An array containing the alpha data for this Mesh. + */ + alphas: Float32Array; + + /** + * Fill or additive mode used when blending the color values? + */ + tintFill: boolean; + + /** + * This method is left intentionally empty and does not do anything. + * It is retained to allow a Mesh or Quad to be added to a Container. + */ + setAlpha(): void; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + } + + namespace Particles { + /** + * A Particle Emitter property. + * + * Facilitates changing Particle properties as they are emitted and throughout their lifetime. + */ + class EmitterOp { + /** + * + * @param config Settings for the Particle Emitter that owns this property. + * @param key The name of the property. + * @param defaultValue The default value of the property. + * @param emitOnly Whether the property can only be modified when a Particle is emitted. Default false. + */ + constructor(config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig, key: string, defaultValue: number, emitOnly?: boolean); + + /** + * The name of this property. + */ + propertyKey: string; + + /** + * The value of this property. + */ + propertyValue: number; + + /** + * The default value of this property. + */ + defaultValue: number; + + /** + * The number of steps for stepped easing between {@link Phaser.GameObjects.Particles.EmitterOp#start} and + * {@link Phaser.GameObjects.Particles.EmitterOp#end} values, per emit. + */ + steps: number; + + /** + * The step counter for stepped easing, per emit. + */ + counter: number; + + /** + * The start value for this property to ease between. + */ + start: number; + + /** + * The end value for this property to ease between. + */ + end: number; + + /** + * The easing function to use for updating this property. + */ + ease: Function; + + /** + * Whether this property can only be modified when a Particle is emitted. + * + * Set to `true` to allow only {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} callbacks to be set and + * affect this property. + * + * Set to `false` to allow both {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} and + * {@link Phaser.GameObjects.Particles.EmitterOp#onUpdate} callbacks to be set and affect this property. + */ + emitOnly: boolean; + + /** + * The callback to run for Particles when they are emitted from the Particle Emitter. + */ + onEmit: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback; + + /** + * The callback to run for Particles when they are updated. + */ + onUpdate: Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback; + + /** + * Load the property from a Particle Emitter configuration object. + * + * Optionally accepts a new property key to use, replacing the current one. + * @param config Settings for the Particle Emitter that owns this property. + * @param newKey The new key to use for this property, if any. + */ + loadConfig(config?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig, newKey?: string): void; + + /** + * Build a JSON representation of this Particle Emitter property. + */ + toJSON(): object; + + /** + * Change the current value of the property and update its callback methods. + * @param value The value of the property. + */ + onChange(value: number): Phaser.GameObjects.Particles.EmitterOp; + + /** + * Update the {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} and + * {@link Phaser.GameObjects.Particles.EmitterOp#onUpdate} callbacks based on the type of the current + * {@link Phaser.GameObjects.Particles.EmitterOp#propertyValue}. + */ + setMethods(): Phaser.GameObjects.Particles.EmitterOp; + + /** + * Check whether an object has the given property. + * @param object The object to check. + * @param key The key of the property to look for in the object. + */ + has(object: object, key: string): boolean; + + /** + * Check whether an object has both of the given properties. + * @param object The object to check. + * @param key1 The key of the first property to check the object for. + * @param key2 The key of the second property to check the object for. + */ + hasBoth(object: object, key1: string, key2: string): boolean; + + /** + * Check whether an object has at least one of the given properties. + * @param object The object to check. + * @param key1 The key of the first property to check the object for. + * @param key2 The key of the second property to check the object for. + */ + hasEither(object: object, key1: string, key2: string): boolean; + + /** + * The returned value sets what the property will be at the START of the particles life, on emit. + * @param particle The particle. + * @param key The name of the property. + * @param value The current value of the property. + */ + defaultEmit(particle: Phaser.GameObjects.Particles.Particle, key: string, value?: number): number; + + /** + * The returned value updates the property for the duration of the particles life. + * @param particle The particle. + * @param key The name of the property. + * @param t The T value (between 0 and 1) + * @param value The current value of the property. + */ + defaultUpdate(particle: Phaser.GameObjects.Particles.Particle, key: string, t: number, value: number): number; + + /** + * An `onEmit` callback that returns the current value of the property. + */ + staticValueEmit(): number; + + /** + * An `onUpdate` callback that returns the current value of the property. + */ + staticValueUpdate(): number; + + /** + * An `onEmit` callback that returns a random value from the current value array. + */ + randomStaticValueEmit(): number; + + /** + * An `onEmit` callback that returns a value between the {@link Phaser.GameObjects.Particles.EmitterOp#start} and + * {@link Phaser.GameObjects.Particles.EmitterOp#end} range. + * @param particle The particle. + * @param key The key of the property. + */ + randomRangedValueEmit(particle: Phaser.GameObjects.Particles.Particle, key: string): number; + + /** + * An `onEmit` callback that returns a stepped value between the + * {@link Phaser.GameObjects.Particles.EmitterOp#start} and {@link Phaser.GameObjects.Particles.EmitterOp#end} + * range. + */ + steppedEmit(): number; + + /** + * An `onEmit` callback for an eased property. + * + * It prepares the particle for easing by {@link Phaser.GameObjects.Particles.EmitterOp#easeValueUpdate}. + * @param particle The particle. + * @param key The name of the property. + */ + easedValueEmit(particle: Phaser.GameObjects.Particles.Particle, key: string): number; + + /** + * An `onUpdate` callback that returns an eased value between the + * {@link Phaser.GameObjects.Particles.EmitterOp#start} and {@link Phaser.GameObjects.Particles.EmitterOp#end} + * range. + * @param particle The particle. + * @param key The name of the property. + * @param t The T value (between 0 and 1) + */ + easeValueUpdate(particle: Phaser.GameObjects.Particles.Particle, key: string, t: number): number; + + } + + /** + * The GravityWell action applies a force on the particle to draw it towards, or repel it from, a single point. + * + * The force applied is inversely proportional to the square of the distance from the particle to the point, in accordance with Newton's law of gravity. + * + * This simulates the effect of gravity over large distances (as between planets, for example). + */ + class GravityWell { + /** + * + * @param x The x coordinate of the Gravity Well, in world space. Default 0. + * @param y The y coordinate of the Gravity Well, in world space. Default 0. + * @param power The strength of the gravity force - larger numbers produce a stronger force. Default 0. + * @param epsilon The minimum distance for which the gravity force is calculated. Default 100. + * @param gravity The gravitational force of this Gravity Well. Default 50. + */ + constructor(x?: number | Phaser.Types.GameObjects.Particles.GravityWellConfig, y?: number, power?: number, epsilon?: number, gravity?: number); + + /** + * The x coordinate of the Gravity Well, in world space. + */ + x: number; + + /** + * The y coordinate of the Gravity Well, in world space. + */ + y: number; + + /** + * The active state of the Gravity Well. An inactive Gravity Well will not influence any particles. + */ + active: boolean; + + /** + * The strength of the gravity force - larger numbers produce a stronger force. + */ + power: number; + + /** + * The minimum distance for which the gravity force is calculated. + */ + epsilon: number; + + /** + * Takes a Particle and updates it based on the properties of this Gravity Well. + * @param particle The Particle to update. + * @param delta The delta time in ms. + * @param step The delta value divided by 1000. + */ + update(particle: Phaser.GameObjects.Particles.Particle, delta: number, step: number): void; + + } + + /** + * A Particle is a simple Game Object controlled by a Particle Emitter and Manager, and rendered by the Manager. + * It uses its own lightweight physics system, and can interact only with its Emitter's bounds and zones. + */ + class Particle { + /** + * + * @param emitter The Emitter to which this Particle belongs. + */ + constructor(emitter: Phaser.GameObjects.Particles.ParticleEmitter); + + /** + * The Emitter to which this Particle belongs. + * + * A Particle can only belong to a single Emitter and is created, updated and destroyed via it. + */ + emitter: Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * The texture frame used to render this Particle. + */ + frame: Phaser.Textures.Frame; + + /** + * The x coordinate of this Particle. + */ + x: number; + + /** + * The y coordinate of this Particle. + */ + y: number; + + /** + * The x velocity of this Particle. + */ + velocityX: number; + + /** + * The y velocity of this Particle. + */ + velocityY: number; + + /** + * The x acceleration of this Particle. + */ + accelerationX: number; + + /** + * The y acceleration of this Particle. + */ + accelerationY: number; + + /** + * The maximum horizontal velocity this Particle can travel at. + */ + maxVelocityX: number; + + /** + * The maximum vertical velocity this Particle can travel at. + */ + maxVelocityY: number; + + /** + * The bounciness, or restitution, of this Particle. + */ + bounce: number; + + /** + * The horizontal scale of this Particle. + */ + scaleX: number; + + /** + * The vertical scale of this Particle. + */ + scaleY: number; + + /** + * The alpha value of this Particle. + */ + alpha: number; + + /** + * The angle of this Particle in degrees. + */ + angle: number; + + /** + * The angle of this Particle in radians. + */ + rotation: number; + + /** + * The tint applied to this Particle. + */ + tint: integer; + + /** + * The lifespan of this Particle in ms. + */ + life: number; + + /** + * The current life of this Particle in ms. + */ + lifeCurrent: number; + + /** + * The delay applied to this Particle upon emission, in ms. + */ + delayCurrent: number; + + /** + * The normalized lifespan T value, where 0 is the start and 1 is the end. + */ + lifeT: number; + + /** + * The data used by the ease equation. + */ + data: object; + + /** + * Checks to see if this Particle is alive and updating. + */ + isAlive(): boolean; + + /** + * Resets the position of this particle back to zero. + */ + resetPosition(): void; + + /** + * Starts this Particle from the given coordinates. + * @param x The x coordinate to launch this Particle from. + * @param y The y coordinate to launch this Particle from. + */ + fire(x: number, y: number): void; + + /** + * An internal method that calculates the velocity of the Particle. + * @param emitter The Emitter that is updating this Particle. + * @param delta The delta time in ms. + * @param step The delta value divided by 1000. + * @param processors Particle processors (gravity wells). + */ + computeVelocity(emitter: Phaser.GameObjects.Particles.ParticleEmitter, delta: number, step: number, processors: any[]): void; + + /** + * Checks if this Particle is still within the bounds defined by the given Emitter. + * + * If not, and depending on the Emitter collision flags, the Particle may either stop or rebound. + * @param emitter The Emitter to check the bounds against. + */ + checkBounds(emitter: Phaser.GameObjects.Particles.ParticleEmitter): void; + + /** + * The main update method for this Particle. + * + * Updates its life values, computes the velocity and repositions the Particle. + * @param delta The delta time in ms. + * @param step The delta value divided by 1000. + * @param processors An optional array of update processors. + */ + update(delta: number, step: number, processors: any[]): boolean; + + } + + /** + * A particle emitter represents a single particle stream. + * It controls a pool of {@link Phaser.GameObjects.Particles.Particle Particles} and is controlled by a {@link Phaser.GameObjects.Particles.ParticleEmitterManager Particle Emitter Manager}. + */ + class ParticleEmitter implements Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { + /** + * + * @param manager The Emitter Manager this Emitter belongs to. + * @param config Settings for this emitter. + */ + constructor(manager: Phaser.GameObjects.Particles.ParticleEmitterManager, config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig); + + /** + * The Emitter Manager this Emitter belongs to. + */ + manager: Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * The texture assigned to particles. + */ + texture: Phaser.Textures.Texture; + + /** + * The texture frames assigned to particles. + */ + frames: Phaser.Textures.Frame[]; + + /** + * The default texture frame assigned to particles. + */ + defaultFrame: Phaser.Textures.Frame; + + /** + * Names of simple configuration properties. + */ + configFastMap: object; + + /** + * Names of complex configuration properties. + */ + configOpMap: object; + + /** + * The name of this Particle Emitter. + * + * Empty by default and never populated by Phaser, this is left for developers to use. + */ + name: string; + + /** + * The Particle Class which will be emitted by this Emitter. + */ + particleClass: Phaser.GameObjects.Particles.Particle; + + /** + * The x-coordinate of the particle origin (where particles will be emitted). + */ + x: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The y-coordinate of the particle origin (where particles will be emitted). + */ + y: Phaser.GameObjects.Particles.EmitterOp; + + /** + * A radial emitter will emit particles in all directions between angle min and max, + * using {@link Phaser.GameObjects.Particles.ParticleEmitter#speed} as the value. If set to false then this acts as a point Emitter. + * A point emitter will emit particles only in the direction derived from the speedX and speedY values. + */ + radial: boolean; + + /** + * Horizontal acceleration applied to emitted particles, in pixels per second squared. + */ + gravityX: number; + + /** + * Vertical acceleration applied to emitted particles, in pixels per second squared. + */ + gravityY: number; + + /** + * Whether accelerationX and accelerationY are non-zero. Set automatically during configuration. + */ + acceleration: boolean; + + /** + * Horizontal acceleration applied to emitted particles, in pixels per second squared. + */ + accelerationX: Phaser.GameObjects.Particles.EmitterOp; + + /** + * Vertical acceleration applied to emitted particles, in pixels per second squared. + */ + accelerationY: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The maximum horizontal velocity of emitted particles, in pixels per second squared. + */ + maxVelocityX: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The maximum vertical velocity of emitted particles, in pixels per second squared. + */ + maxVelocityY: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The initial horizontal speed of emitted particles, in pixels per second. + */ + speedX: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The initial vertical speed of emitted particles, in pixels per second. + */ + speedY: Phaser.GameObjects.Particles.EmitterOp; + + /** + * Whether moveToX and moveToY are nonzero. Set automatically during configuration. + */ + moveTo: boolean; + + /** + * The x-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. + */ + moveToX: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The y-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. + */ + moveToY: Phaser.GameObjects.Particles.EmitterOp; + + /** + * Whether particles will rebound when they meet the emitter bounds. + */ + bounce: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The horizontal scale of emitted particles. + */ + scaleX: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The vertical scale of emitted particles. + */ + scaleY: Phaser.GameObjects.Particles.EmitterOp; + + /** + * Color tint applied to emitted particles. Any alpha component (0xAA000000) is ignored. + */ + tint: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The alpha (transparency) of emitted particles. + */ + alpha: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The lifespan of emitted particles, in ms. + */ + lifespan: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The angle of the initial velocity of emitted particles, in degrees. + */ + angle: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The rotation of emitted particles, in degrees. + */ + rotate: Phaser.GameObjects.Particles.EmitterOp; + + /** + * A function to call when a particle is emitted. + */ + emitCallback: Phaser.Types.GameObjects.Particles.ParticleEmitterCallback; + + /** + * The calling context for {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallback}. + */ + emitCallbackScope: any; + + /** + * A function to call when a particle dies. + */ + deathCallback: Phaser.Types.GameObjects.Particles.ParticleDeathCallback; + + /** + * The calling context for {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallback}. + */ + deathCallbackScope: any; + + /** + * Set to hard limit the amount of particle objects this emitter is allowed to create. + * 0 means unlimited. + */ + maxParticles: integer; + + /** + * How many particles are emitted each time particles are emitted (one explosion or one flow cycle). + */ + quantity: Phaser.GameObjects.Particles.EmitterOp; + + /** + * How many ms to wait after emission before the particles start updating. + */ + delay: Phaser.GameObjects.Particles.EmitterOp; + + /** + * For a flow emitter, the time interval (>= 0) between particle flow cycles in ms. + * A value of 0 means there is one particle flow cycle for each logic update (the maximum flow frequency). This is the default setting. + * For an exploding emitter, this value will be -1. + * Calling {@link Phaser.GameObjects.Particles.ParticleEmitter#flow} also puts the emitter in flow mode (frequency >= 0). + * Calling {@link Phaser.GameObjects.Particles.ParticleEmitter#explode} also puts the emitter in explode mode (frequency = -1). + */ + frequency: number; + + /** + * Controls if the emitter is currently emitting a particle flow (when frequency >= 0). + * Already alive particles will continue to update until they expire. + * Controlled by {@link Phaser.GameObjects.Particles.ParticleEmitter#start} and {@link Phaser.GameObjects.Particles.ParticleEmitter#stop}. + */ + on: boolean; + + /** + * Newly emitted particles are added to the top of the particle list, i.e. rendered above those already alive. + * Set to false to send them to the back. + */ + particleBringToTop: boolean; + + /** + * The time rate applied to active particles, affecting lifespan, movement, and tweens. Values larger than 1 are faster than normal. + */ + timeScale: number; + + /** + * An object describing a shape to emit particles from. + */ + emitZone: Phaser.GameObjects.Particles.Zones.EdgeZone | Phaser.GameObjects.Particles.Zones.RandomZone; + + /** + * An object describing a shape that deactivates particles when they interact with it. + */ + deathZone: Phaser.GameObjects.Particles.Zones.DeathZone; + + /** + * A rectangular boundary constraining particle movement. + */ + bounds: Phaser.Geom.Rectangle; + + /** + * Whether particles interact with the left edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + */ + collideLeft: boolean; + + /** + * Whether particles interact with the right edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + */ + collideRight: boolean; + + /** + * Whether particles interact with the top edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + */ + collideTop: boolean; + + /** + * Whether particles interact with the bottom edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + */ + collideBottom: boolean; + + /** + * Whether this emitter updates itself and its particles. + * + * Controlled by {@link Phaser.GameObjects.Particles.ParticleEmitter#pause} + * and {@link Phaser.GameObjects.Particles.ParticleEmitter#resume}. + */ + active: boolean; + + /** + * Set this to false to hide any active particles. + */ + visible: boolean; + + /** + * The blend mode of this emitter's particles. + */ + blendMode: integer; + + /** + * A Game Object whose position is used as the particle origin. + */ + follow: Phaser.GameObjects.GameObject; + + /** + * The offset of the particle origin from the {@link Phaser.GameObjects.Particles.ParticleEmitter#follow} target. + */ + followOffset: Phaser.Math.Vector2; + + /** + * Whether the emitter's {@link Phaser.GameObjects.Particles.ParticleEmitter#visible} state will track + * the {@link Phaser.GameObjects.Particles.ParticleEmitter#follow} target's visibility state. + */ + trackVisible: boolean; + + /** + * The current texture frame, as an index of {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. + */ + currentFrame: integer; + + /** + * Whether texture {@link Phaser.GameObjects.Particles.ParticleEmitter#frames} are selected at random. + */ + randomFrame: boolean; + + /** + * The number of consecutive particles that receive a single texture frame (per frame cycle). + */ + frameQuantity: integer; + + /** + * Merges configuration settings into the emitter's current settings. + * @param config Settings for this emitter. + */ + fromJSON(config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Creates a description of this emitter suitable for JSON serialization. + * @param output An object to copy output into. + */ + toJSON(output?: object): object; + + /** + * Continuously moves the particle origin to follow a Game Object's position. + * @param target The Game Object to follow. + * @param offsetX Horizontal offset of the particle origin from the Game Object. Default 0. + * @param offsetY Vertical offset of the particle origin from the Game Object. Default 0. + * @param trackVisible Whether the emitter's visible state will track the target's visible state. Default false. + */ + startFollow(target: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number, trackVisible?: boolean): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Stops following a Game Object. + */ + stopFollow(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Chooses a texture frame from {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. + */ + getFrame(): Phaser.Textures.Frame; + + /** + * Sets a pattern for assigning texture frames to emitted particles. + * @param frames One or more texture frames, or a configuration object. + * @param pickRandom Whether frames should be assigned at random from `frames`. Default true. + * @param quantity The number of consecutive particles that will receive each frame. Default 1. + */ + setFrame(frames: any[] | string | integer | Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig, pickRandom?: boolean, quantity?: integer): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle movement on or off. + * @param value Radial mode (true) or point mode (true). Default true. + */ + setRadial(value?: boolean): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the position of the emitter's particle origin. + * New particles will be emitted here. + * @param x The x-coordinate of the particle origin. + * @param y The y-coordinate of the particle origin. + */ + setPosition(x: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType, y: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets or modifies a rectangular boundary constraining the particles. + * + * To remove the boundary, set {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds} to null. + * @param x The x-coordinate of the left edge of the boundary, or an object representing a rectangle. + * @param y The y-coordinate of the top edge of the boundary. + * @param width The width of the boundary. + * @param height The height of the boundary. + */ + setBounds(x: number | Phaser.Types.GameObjects.Particles.ParticleEmitterBounds | Phaser.Types.GameObjects.Particles.ParticleEmitterBoundsAlt, y: number, width: number, height: number): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the initial horizontal speed of emitted particles. + * Changes the emitter to point mode. + * @param value The speed, in pixels per second. + */ + setSpeedX(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the initial vertical speed of emitted particles. + * Changes the emitter to point mode. + * @param value The speed, in pixels per second. + */ + setSpeedY(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the initial radial speed of emitted particles. + * Changes the emitter to radial mode. + * @param value The speed, in pixels per second. + */ + setSpeed(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the horizontal scale of emitted particles. + * @param value The scale, relative to 1. + */ + setScaleX(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the vertical scale of emitted particles. + * @param value The scale, relative to 1. + */ + setScaleY(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the scale of emitted particles. + * @param value The scale, relative to 1. + */ + setScale(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the horizontal gravity applied to emitted particles. + * @param value Acceleration due to gravity, in pixels per second squared. + */ + setGravityX(value: number): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the vertical gravity applied to emitted particles. + * @param value Acceleration due to gravity, in pixels per second squared. + */ + setGravityY(value: number): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the gravity applied to emitted particles. + * @param x Horizontal acceleration due to gravity, in pixels per second squared. + * @param y Vertical acceleration due to gravity, in pixels per second squared. + */ + setGravity(x: number, y: number): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the opacity of emitted particles. + * @param value A value between 0 (transparent) and 1 (opaque). + */ + setAlpha(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the angle of a {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle stream. + * @param value The angle of the initial velocity of emitted particles. + */ + setEmitterAngle(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the angle of a {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle stream. + * @param value The angle of the initial velocity of emitted particles. + */ + setAngle(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the lifespan of newly emitted particles. + * @param value The particle lifespan, in ms. + */ + setLifespan(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the number of particles released at each flow cycle or explosion. + * @param quantity The number of particles to release at each flow cycle or explosion. + */ + setQuantity(quantity: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the emitter's {@link Phaser.GameObjects.Particles.ParticleEmitter#frequency} + * and {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param frequency The time interval (>= 0) of each flow cycle, in ms; or -1 to put the emitter in explosion mode. + * @param quantity The number of particles to release at each flow cycle or explosion. + */ + setFrequency(frequency: number, quantity?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets or removes the {@link Phaser.GameObjects.Particles.ParticleEmitter#emitZone}. + * + * An {@link Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig EdgeZone} places particles on its edges. Its {@link Phaser.Types.GameObjects.Particles.EdgeZoneSource source} can be a Curve, Path, Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback getPoints} method. + * + * A {@link Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig RandomZone} places randomly within its interior. Its {@link RandomZoneSource source} can be a Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback getRandomPoint} method. + * @param zoneConfig An object describing the zone, or `undefined` to remove any current emit zone. + */ + setEmitZone(zoneConfig?: Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets or removes the {@link Phaser.GameObjects.Particles.ParticleEmitter#deathZone}. + * @param zoneConfig An object describing the zone, or `undefined` to remove any current death zone. + */ + setDeathZone(zoneConfig?: Phaser.Types.GameObjects.Particles.ParticleEmitterDeathZoneConfig): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Creates inactive particles and adds them to this emitter's pool. + * @param particleCount The number of particles to create. + */ + reserve(particleCount: integer): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Gets the number of active (in-use) particles in this emitter. + */ + getAliveParticleCount(): integer; + + /** + * Gets the number of inactive (available) particles in this emitter. + */ + getDeadParticleCount(): integer; + + /** + * Gets the total number of particles in this emitter. + */ + getParticleCount(): integer; + + /** + * Whether this emitter is at its limit (if set). + */ + atLimit(): boolean; + + /** + * Sets a function to call for each newly emitted particle. + * @param callback The function. + * @param context The calling context. + */ + onParticleEmit(callback: Phaser.Types.GameObjects.Particles.ParticleEmitterCallback, context?: any): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets a function to call for each particle death. + * @param callback The function. + * @param context The function's calling context. + */ + onParticleDeath(callback: Phaser.Types.GameObjects.Particles.ParticleDeathCallback, context?: any): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Deactivates every particle in this emitter. + */ + killAll(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Calls a function for each active particle in this emitter. + * @param callback The function. + * @param context The function's calling context. + */ + forEachAlive(callback: Phaser.Types.GameObjects.Particles.ParticleEmitterCallback, context: any): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Calls a function for each inactive particle in this emitter. + * @param callback The function. + * @param context The function's calling context. + */ + forEachDead(callback: Phaser.Types.GameObjects.Particles.ParticleEmitterCallback, context: any): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#on} the emitter and resets the flow counter. + * + * If this emitter is in flow mode (frequency >= 0; the default), the particle flow will start (or restart). + * + * If this emitter is in explode mode (frequency = -1), nothing will happen. + * Use {@link Phaser.GameObjects.Particles.ParticleEmitter#explode} or {@link Phaser.GameObjects.Particles.ParticleEmitter#flow} instead. + */ + start(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#on off} the emitter. + */ + stop(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * {@link Phaser.GameObjects.Particles.ParticleEmitter#active Deactivates} the emitter. + */ + pause(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * {@link Phaser.GameObjects.Particles.ParticleEmitter#active Activates} the emitter. + */ + resume(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sorts active particles with {@link Phaser.GameObjects.Particles.ParticleEmitter#depthSortCallback}. + */ + depthSort(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Puts the emitter in flow mode (frequency >= 0) and starts (or restarts) a particle flow. + * + * To resume a flow at the current frequency and quantity, use {@link Phaser.GameObjects.Particles.ParticleEmitter#start} instead. + * @param frequency The time interval (>= 0) of each flow cycle, in ms. + * @param count The number of particles to emit at each flow cycle. Default 1. + */ + flow(frequency: number, count?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Puts the emitter in explode mode (frequency = -1), stopping any current particle flow, and emits several particles all at once. + * @param count The amount of Particles to emit. + * @param x The x coordinate to emit the Particles from. + * @param y The y coordinate to emit the Particles from. + */ + explode(count: integer, x: number, y: number): Phaser.GameObjects.Particles.Particle; + + /** + * Emits particles at a given position (or the emitter's current position). + * @param x The x coordinate to emit the Particles from. Default this.x. + * @param y The y coordinate to emit the Particles from. Default this.x. + * @param count The number of Particles to emit. Default this.quantity. + */ + emitParticleAt(x?: number, y?: number, count?: integer): Phaser.GameObjects.Particles.Particle; + + /** + * Emits particles at a given position (or the emitter's current position). + * @param count The number of Particles to emit. Default this.quantity. + * @param x The x coordinate to emit the Particles from. Default this.x. + * @param y The y coordinate to emit the Particles from. Default this.x. + */ + emitParticle(count?: integer, x?: number, y?: number): Phaser.GameObjects.Particles.Particle; + + /** + * Updates this emitter and its particles. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + preUpdate(time: integer, delta: number): void; + + /** + * Calculates the difference of two particles, for sorting them by depth. + * @param a The first particle. + * @param b The second particle. + */ + depthSortCallback(a: object, b: object): integer; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Particle Emitter Manager creates and controls {@link Phaser.GameObjects.Particles.ParticleEmitter Particle Emitters} and {@link Phaser.GameObjects.Particles.GravityWell Gravity Wells}. + */ + class ParticleEmitterManager extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Emitter Manager belongs. + * @param texture The key of the Texture this Emitter Manager will use to render particles, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Emitter Manager will use to render particles. + * @param emitters Configuration settings for one or more emitters to create. + */ + constructor(scene: Phaser.Scene, texture: string, frame?: string | integer, emitters?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]); + + /** + * The time scale applied to all emitters and particles, affecting flow rate, lifespan, and movement. + * Values larger than 1 are faster than normal. + * This is multiplied with any timeScale set on each individual emitter. + */ + timeScale: number; + + /** + * The texture used to render this Emitter Manager's particles. + */ + texture: Phaser.Textures.Texture; + + /** + * The texture frame used to render this Emitter Manager's particles. + */ + frame: Phaser.Textures.Frame; + + /** + * Names of this Emitter Manager's texture frames. + */ + frameNames: string[]; + + /** + * A list of Emitters being managed by this Emitter Manager. + */ + emitters: Phaser.Structs.List; + + /** + * A list of Gravity Wells being managed by this Emitter Manager. + */ + wells: Phaser.Structs.List; + + /** + * Sets the texture and frame this Emitter Manager will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Sets the frame this Emitter Manager will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * @param frame The name or index of the frame within the Texture. + */ + setFrame(frame?: string | integer): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Assigns texture frames to an emitter. + * @param frames The texture frames. + * @param emitter The particle emitter to modify. + */ + setEmitterFrames(frames: Phaser.Textures.Frame | Phaser.Textures.Frame[], emitter: Phaser.GameObjects.Particles.ParticleEmitter): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Adds an existing Particle Emitter to this Emitter Manager. + * @param emitter The Particle Emitter to add to this Emitter Manager. + */ + addEmitter(emitter: Phaser.GameObjects.Particles.ParticleEmitter): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Creates a new Particle Emitter object, adds it to this Emitter Manager and returns a reference to it. + * @param config Configuration settings for the Particle Emitter to create. + */ + createEmitter(config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Adds an existing Gravity Well object to this Emitter Manager. + * @param well The Gravity Well to add to this Emitter Manager. + */ + addGravityWell(well: Phaser.GameObjects.Particles.GravityWell): Phaser.GameObjects.Particles.GravityWell; + + /** + * Creates a new Gravity Well, adds it to this Emitter Manager and returns a reference to it. + * @param config Configuration settings for the Gravity Well to create. + */ + createGravityWell(config: Phaser.Types.GameObjects.Particles.GravityWellConfig): Phaser.GameObjects.Particles.GravityWell; + + /** + * Emits particles from each active emitter. + * @param count The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param x The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. + * @param y The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. + */ + emitParticle(count?: integer, x?: number, y?: number): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Emits particles from each active emitter. + * @param x The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. + * @param y The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. + * @param count The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + */ + emitParticleAt(x?: number, y?: number, count?: integer): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Pauses this Emitter Manager. + * + * This has the effect of pausing all emitters, and all particles of those emitters, currently under its control. + * + * The particles will still render, but they will not have any of their logic updated. + */ + pause(): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Resumes this Emitter Manager, should it have been previously paused. + */ + resume(): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Gets all active particle processors (gravity wells). + */ + getProcessors(): Phaser.GameObjects.Particles.GravityWell[]; + + /** + * Updates all active emitters. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + preUpdate(time: integer, delta: number): void; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + namespace Zones { + /** + * A Death Zone. + * + * A Death Zone is a special type of zone that will kill a Particle as soon as it either enters, or leaves, the zone. + * + * The zone consists of a `source` which could be a Geometric shape, such as a Rectangle or Ellipse, or your own + * object as long as it includes a `contains` method for which the Particles can be tested against. + */ + class DeathZone { + /** + * + * @param source An object instance that has a `contains` method that returns a boolean when given `x` and `y` arguments. + * @param killOnEnter Should the Particle be killed when it enters the zone? `true` or leaves it? `false` + */ + constructor(source: Phaser.Types.GameObjects.Particles.DeathZoneSource, killOnEnter: boolean); + + /** + * An object instance that has a `contains` method that returns a boolean when given `x` and `y` arguments. + * This could be a Geometry shape, such as `Phaser.Geom.Circle`, or your own custom object. + */ + source: Phaser.Types.GameObjects.Particles.DeathZoneSource; + + /** + * Set to `true` if the Particle should be killed if it enters this zone. + * Set to `false` to kill the Particle if it leaves this zone. + */ + killOnEnter: boolean; + + /** + * Checks if the given Particle will be killed or not by this zone. + * @param particle The Particle to be checked against this zone. + */ + willKill(particle: Phaser.GameObjects.Particles.Particle): boolean; + + } + + /** + * A zone that places particles on a shape's edges. + */ + class EdgeZone { + /** + * + * @param source An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. + * @param quantity The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + * @param stepRate The distance between each particle. When set, `quantity` is implied and should be set to 0. + * @param yoyo Whether particles are placed from start to end and then end to start. Default false. + * @param seamless Whether one endpoint will be removed if it's identical to the other. Default true. + */ + constructor(source: Phaser.Types.GameObjects.Particles.EdgeZoneSource, quantity: integer, stepRate: number, yoyo?: boolean, seamless?: boolean); + + /** + * An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. + */ + source: Phaser.Types.GameObjects.Particles.EdgeZoneSource | Phaser.Types.GameObjects.Particles.RandomZoneSource; + + /** + * The points placed on the source edge. + */ + points: Phaser.Geom.Point[]; + + /** + * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + */ + quantity: integer; + + /** + * The distance between each particle. When set, `quantity` is implied and should be set to 0. + */ + stepRate: number; + + /** + * Whether particles are placed from start to end and then end to start. + */ + yoyo: boolean; + + /** + * The counter used for iterating the EdgeZone's points. + */ + counter: number; + + /** + * Whether one endpoint will be removed if it's identical to the other. + */ + seamless: boolean; + + /** + * Update the {@link Phaser.GameObjects.Particles.Zones.EdgeZone#points} from the EdgeZone's + * {@link Phaser.GameObjects.Particles.Zones.EdgeZone#source}. + * + * Also updates internal properties. + */ + updateSource(): Phaser.GameObjects.Particles.Zones.EdgeZone; + + /** + * Change the source of the EdgeZone. + * @param source An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. + */ + changeSource(source: Phaser.Types.GameObjects.Particles.EdgeZoneSource): Phaser.GameObjects.Particles.Zones.EdgeZone; + + /** + * Get the next point in the Zone and set its coordinates on the given Particle. + * @param particle The Particle. + */ + getPoint(particle: Phaser.GameObjects.Particles.Particle): void; + + } + + /** + * A zone that places particles randomly within a shape's area. + */ + class RandomZone { + /** + * + * @param source An object instance with a `getRandomPoint(point)` method. + */ + constructor(source: Phaser.Types.GameObjects.Particles.RandomZoneSource); + + /** + * An object instance with a `getRandomPoint(point)` method. + */ + source: Phaser.Types.GameObjects.Particles.RandomZoneSource; + + /** + * Get the next point in the Zone and set its coordinates on the given Particle. + * @param particle The Particle. + */ + getPoint(particle: Phaser.GameObjects.Particles.Particle): void; + + } + + } + + } + + /** + * A PathFollower Game Object. + * + * A PathFollower is a Sprite Game Object with some extra helpers to allow it to follow a Path automatically. + * + * Anything you can do with a standard Sprite can be done with this PathFollower, such as animate it, tint it, + * scale it and so on. + * + * PathFollowers are bound to a single Path at any one time and can traverse the length of the Path, from start + * to finish, forwards or backwards, or from any given point on the Path to its end. They can optionally rotate + * to face the direction of the path, be offset from the path coordinates or rotate independently of the Path. + */ + class PathFollower extends Phaser.GameObjects.Sprite implements Phaser.GameObjects.Components.PathFollower { + /** + * + * @param scene The Scene to which this PathFollower belongs. + * @param path The Path this PathFollower is following. It can only follow one Path at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, path: Phaser.Curves.Path, x: number, y: number, texture: string, frame?: string | integer); + + /** + * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath) + * this value is added to the rotation value. This allows you to rotate objects to a path but control + * the angle of the rotation as well. + */ + pathRotationOffset: number; + + /** + * An additional vector to add to the PathFollowers position, allowing you to offset it from the + * Path coordinates. + */ + pathOffset: Phaser.Math.Vector2; + + /** + * A Vector2 that stores the current point of the path the follower is on. + */ + pathVector: Phaser.Math.Vector2; + + /** + * The Tween used for following the Path. + */ + pathTween: Phaser.Tweens.Tween; + + /** + * Settings for the PathFollower. + */ + pathConfig: Phaser.Types.GameObjects.PathFollower.PathConfig; + + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected preUpdate(time: integer, delta: number): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * The Path this PathFollower is following. It can only follow one Path at a time. + */ + path: Phaser.Curves.Path; + + /** + * Should the PathFollower automatically rotate to point in the direction of the Path? + */ + rotateToPath: boolean; + + /** + * Set the Path that this PathFollower should follow. + * + * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. + * @param path The Path this PathFollower is following. It can only follow one Path at a time. + * @param config Settings for the PathFollower. + */ + setPath(path: Phaser.Curves.Path, config?: number | Phaser.Types.GameObjects.PathFollower.PathConfig | Phaser.Types.Tweens.NumberTweenBuilderConfig): Phaser.GameObjects.PathFollower; + + /** + * Set whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param value Whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param offset Rotation offset in degrees. Default 0. + */ + setRotateToPath(value: boolean, offset?: number): Phaser.GameObjects.PathFollower; + + /** + * Is this PathFollower actively following a Path or not? + * + * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. + */ + isFollowing(): boolean; + + /** + * Starts this PathFollower following its given Path. + * @param config The duration of the follow, or a PathFollower config object. Default {}. + * @param startAt Optional start position of the follow, between 0 and 1. Default 0. + */ + startFollow(config?: number | Phaser.Types.GameObjects.PathFollower.PathConfig | Phaser.Types.Tweens.NumberTweenBuilderConfig, startAt?: number): Phaser.GameObjects.PathFollower; + + /** + * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the + * point on the Path at which you paused it. + */ + pauseFollow(): Phaser.GameObjects.PathFollower; + + /** + * Resumes a previously paused PathFollower. + * + * If the PathFollower was not paused this has no effect. + */ + resumeFollow(): Phaser.GameObjects.PathFollower; + + /** + * Stops this PathFollower from following the path any longer. + * + * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. + */ + stopFollow(): Phaser.GameObjects.PathFollower; + + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + */ + pathUpdate(): void; + + } + + /** + * A Quad Game Object. + * + * A Quad is a Mesh Game Object pre-configured with two triangles arranged into a rectangle, with a single + * texture spread across them. + * + * You can manipulate the corner points of the quad via the getters and setters such as `topLeftX`, and also + * change their alpha and color values. The quad itself can be moved by adjusting the `x` and `y` properties. + */ + class Quad extends Phaser.GameObjects.Mesh { + /** + * + * @param scene The Scene to which this Quad belongs. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer); + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + */ + setFrame(frame: string | integer): this; + + /** + * The top-left x vertex of this Quad. + */ + topLeftX: number; + + /** + * The top-left y vertex of this Quad. + */ + topLeftY: number; + + /** + * The top-right x vertex of this Quad. + */ + topRightX: number; + + /** + * The top-right y vertex of this Quad. + */ + topRightY: number; + + /** + * The bottom-left x vertex of this Quad. + */ + bottomLeftX: number; + + /** + * The bottom-left y vertex of this Quad. + */ + bottomLeftY: number; + + /** + * The bottom-right x vertex of this Quad. + */ + bottomRightX: number; + + /** + * The bottom-right y vertex of this Quad. + */ + bottomRightY: number; + + /** + * The top-left alpha value of this Quad. + */ + topLeftAlpha: number; + + /** + * The top-right alpha value of this Quad. + */ + topRightAlpha: number; + + /** + * The bottom-left alpha value of this Quad. + */ + bottomLeftAlpha: number; + + /** + * The bottom-right alpha value of this Quad. + */ + bottomRightAlpha: number; + + /** + * The top-left color value of this Quad. + */ + topLeftColor: number; + + /** + * The top-right color value of this Quad. + */ + topRightColor: number; + + /** + * The bottom-left color value of this Quad. + */ + bottomLeftColor: number; + + /** + * The bottom-right color value of this Quad. + */ + bottomRightColor: number; + + /** + * Sets the top-left vertex position of this Quad. + * @param x The horizontal coordinate of the vertex. + * @param y The vertical coordinate of the vertex. + */ + setTopLeft(x: number, y: number): Phaser.GameObjects.Quad; + + /** + * Sets the top-right vertex position of this Quad. + * @param x The horizontal coordinate of the vertex. + * @param y The vertical coordinate of the vertex. + */ + setTopRight(x: number, y: number): Phaser.GameObjects.Quad; + + /** + * Sets the bottom-left vertex position of this Quad. + * @param x The horizontal coordinate of the vertex. + * @param y The vertical coordinate of the vertex. + */ + setBottomLeft(x: number, y: number): Phaser.GameObjects.Quad; + + /** + * Sets the bottom-right vertex position of this Quad. + * @param x The horizontal coordinate of the vertex. + * @param y The vertical coordinate of the vertex. + */ + setBottomRight(x: number, y: number): Phaser.GameObjects.Quad; + + /** + * Resets the positions of the four corner vertices of this Quad. + */ + resetPosition(): Phaser.GameObjects.Quad; + + /** + * Resets the alpha values used by this Quad back to 1. + */ + resetAlpha(): Phaser.GameObjects.Quad; + + /** + * Resets the color values used by this Quad back to 0xffffff. + */ + resetColors(): Phaser.GameObjects.Quad; + + /** + * Resets the position, alpha and color values used by this Quad. + */ + reset(): Phaser.GameObjects.Quad; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + } + + /** + * A Render Texture. + * + * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and + * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic + * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. + * + * Note that under WebGL a FrameBuffer, which is what the Render Texture uses internally, cannot be anti-aliased. This means + * that when drawing objects such as Shapes to a Render Texture they will appear to be drawn with no aliasing, however this + * is a technical limitation of WebGL. To get around it, create your shape as a texture in an art package, then draw that + * to the Render Texture. + */ + class RenderTexture extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the Render Texture. Default 32. + * @param height The height of the Render Texture. Default 32. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, width?: integer, height?: integer); + + /** + * A reference to either the Canvas or WebGL Renderer that the Game instance is using. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * A reference to the Texture Manager. + */ + textureManager: Phaser.Textures.TextureManager; + + /** + * The tint of the Render Texture when rendered. + */ + globalTint: number; + + /** + * The alpha of the Render Texture when rendered. + */ + globalAlpha: number; + + /** + * The HTML Canvas Element that the Render Texture is drawing to when using the Canvas Renderer. + */ + canvas: HTMLCanvasElement; + + /** + * A reference to the GL Frame Buffer this Render Texture is drawing to. + * This is only set if Phaser is running with the WebGL Renderer. + */ + framebuffer: WebGLFramebuffer; + + /** + * Is this Render Texture dirty or not? If not it won't spend time clearing or filling itself. + */ + dirty: boolean; + + /** + * The Texture corresponding to this Render Texture. + */ + texture: Phaser.Textures.Texture; + + /** + * The Frame corresponding to this Render Texture. + */ + frame: Phaser.Textures.Frame; + + /** + * A reference to the Rendering Context belonging to the Canvas Element this Render Texture is drawing to. + */ + context: CanvasRenderingContext2D; + + /** + * An internal Camera that can be used to move around the Render Texture. + * Control it just like you would any Scene Camera. The difference is that it only impacts the placement of what + * is drawn to the Render Texture. You can scroll, zoom and rotate this Camera. + */ + camera: Phaser.Cameras.Scene2D.BaseCamera; + + /** + * A reference to the WebGL Rendering Context. + */ + gl: WebGLRenderingContext; + + /** + * Sets the size of this Game Object. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Resizes the Render Texture to the new dimensions given. + * + * If Render Texture was created from specific frame, only the size of the frame will be changed. The size of the source + * texture will not change. + * + * If Render Texture was not created from specific frame, the following will happen: + * In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture. + * In Canvas it will resize the underlying canvas element. + * Both approaches will erase everything currently drawn to the Render Texture. + * + * If the dimensions given are the same as those already being used, calling this method will do nothing. + * @param width The new width of the Render Texture. + * @param height The new height of the Render Texture. If not specified, will be set the same as the `width`. Default width. + */ + resize(width: number, height?: number): this; + + /** + * Set the tint to use when rendering this Render Texture. + * @param tint The tint value. + */ + setGlobalTint(tint: integer): this; + + /** + * Set the alpha to use when rendering this Render Texture. + * @param alpha The alpha value. + */ + setGlobalAlpha(alpha: number): this; + + /** + * Stores a copy of this Render Texture in the Texture Manager using the given key. + * + * After doing this, any texture based Game Object, such as a Sprite, can use the contents of this + * Render Texture by using the texture key: + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 128, 128); + * + * // Draw something to the Render Texture + * + * rt.saveTexture('doodle'); + * + * this.add.image(400, 300, 'doodle'); + * ``` + * + * Updating the contents of this Render Texture will automatically update _any_ Game Object + * that is using it as a texture. Calling `saveTexture` again will not save another copy + * of the same texture, it will just rename the key of the existing copy. + * + * By default it will create a single base texture. You can add frames to the texture + * by using the `Texture.add` method. After doing this, you can then allow Game Objects + * to use a specific frame from a Render Texture. + * @param key The unique key to store the texture as within the global Texture Manager. + */ + saveTexture(key: string): Phaser.Textures.Texture; + + /** + * Fills the Render Texture with the given color. + * @param rgb The color to fill the Render Texture with. + * @param alpha The alpha value used by the fill. Default 1. + * @param x The left coordinate of the fill rectangle. Default 0. + * @param y The top coordinate of the fill rectangle. Default 0. + * @param width The width of the fill rectangle. Default this.frame.cutWidth. + * @param height The height of the fill rectangle. Default this.frame.cutHeight. + */ + fill(rgb: number, alpha?: number, x?: number, y?: number, width?: number, height?: number): this; + + /** + * Clears the Render Texture. + */ + clear(): this; + + /** + * Draws the given object, or an array of objects, to this Render Texture using a blend mode of ERASE. + * This has the effect of erasing any filled pixels in the objects from this Render Texture. + * + * It can accept any of the following: + * + * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. + * * Dynamic and Static Tilemap Layers. + * * A Group. The contents of which will be iterated and drawn in turn. + * * A Container. The contents of which will be iterated fully, and drawn in turn. + * * A Scene's Display List. Pass in `Scene.children` to draw the whole list. + * * Another Render Texture. + * * A Texture Frame instance. + * * A string. This is used to look-up a texture from the Texture Manager. + * + * Note: You cannot erase a Render Texture from itself. + * + * If passing in a Group or Container it will only draw children that return `true` + * when their `willRender()` method is called. I.e. a Container with 10 children, + * 5 of which have `visible=false` will only draw the 5 visible ones. + * + * If passing in an array of Game Objects it will draw them all, regardless if + * they pass a `willRender` check or not. + * + * You can pass in a string in which case it will look for a texture in the Texture + * Manager matching that string, and draw the base frame. + * + * You can pass in the `x` and `y` coordinates to draw the objects at. The use of + * the coordinates differ based on what objects are being drawn. If the object is + * a Group, Container or Display List, the coordinates are _added_ to the positions + * of the children. For all other types of object, the coordinates are exact. + * + * Calling this method causes the WebGL batch to flush, so it can write the texture + * data to the framebuffer being used internally. The batch is flushed at the end, + * after the entries have been iterated. So if you've a bunch of objects to draw, + * try and pass them in an array in one single call, rather than making lots of + * separate calls. + * @param entries Any renderable Game Object, or Group, Container, Display List, other Render Texture, Texture Frame or an array of any of these. + * @param x The x position to draw the Frame at, or the offset applied to the object. + * @param y The y position to draw the Frame at, or the offset applied to the object. + */ + erase(entries: any, x?: number, y?: number): this; + + /** + * Draws the given object, or an array of objects, to this Render Texture. + * + * It can accept any of the following: + * + * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. + * * Dynamic and Static Tilemap Layers. + * * A Group. The contents of which will be iterated and drawn in turn. + * * A Container. The contents of which will be iterated fully, and drawn in turn. + * * A Scene's Display List. Pass in `Scene.children` to draw the whole list. + * * Another Render Texture. + * * A Texture Frame instance. + * * A string. This is used to look-up a texture from the Texture Manager. + * + * Note: You cannot draw a Render Texture to itself. + * + * If passing in a Group or Container it will only draw children that return `true` + * when their `willRender()` method is called. I.e. a Container with 10 children, + * 5 of which have `visible=false` will only draw the 5 visible ones. + * + * If passing in an array of Game Objects it will draw them all, regardless if + * they pass a `willRender` check or not. + * + * You can pass in a string in which case it will look for a texture in the Texture + * Manager matching that string, and draw the base frame. If you need to specify + * exactly which frame to draw then use the method `drawFrame` instead. + * + * You can pass in the `x` and `y` coordinates to draw the objects at. The use of + * the coordinates differ based on what objects are being drawn. If the object is + * a Group, Container or Display List, the coordinates are _added_ to the positions + * of the children. For all other types of object, the coordinates are exact. + * + * The `alpha` and `tint` values are only used by Texture Frames. + * Game Objects use their own alpha and tint values when being drawn. + * + * Calling this method causes the WebGL batch to flush, so it can write the texture + * data to the framebuffer being used internally. The batch is flushed at the end, + * after the entries have been iterated. So if you've a bunch of objects to draw, + * try and pass them in an array in one single call, rather than making lots of + * separate calls. + * @param entries Any renderable Game Object, or Group, Container, Display List, other Render Texture, Texture Frame or an array of any of these. + * @param x The x position to draw the Frame at, or the offset applied to the object. + * @param y The y position to draw the Frame at, or the offset applied to the object. + * @param alpha The alpha value. Only used for Texture Frames and if not specified defaults to the `globalAlpha` property. Game Objects use their own current alpha value. + * @param tint WebGL only. The tint color value. Only used for Texture Frames and if not specified defaults to the `globalTint` property. Game Objects use their own current tint value. + */ + draw(entries: any, x?: number, y?: number, alpha?: number, tint?: number): this; + + /** + * Draws the Texture Frame to the Render Texture at the given position. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 800, 600); + * rt.drawFrame(key, frame); + * ``` + * + * You can optionally provide a position, alpha and tint value to apply to the frame + * before it is drawn. + * + * Calling this method will cause a batch flush, so if you've got a stack of things to draw + * in a tight loop, try using the `draw` method instead. + * + * If you need to draw a Sprite to this Render Texture, use the `draw` method instead. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + * @param x The x position to draw the frame at. Default 0. + * @param y The y position to draw the frame at. Default 0. + * @param alpha The alpha to use. If not specified it uses the `globalAlpha` property. + * @param tint WebGL only. The tint color to use. If not specified it uses the `globalTint` property. + */ + drawFrame(key: string, frame?: string | integer, x?: number, y?: number, alpha?: number, tint?: number): this; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Shader Game Object. + * + * This Game Object allows you to easily add a quad with its own shader into the display list, and manipulate it + * as you would any other Game Object, including scaling, rotating, positioning and adding to Containers. Shaders + * can be masked with either Bitmap or Geometry masks and can also be used as a Bitmap Mask for a Camera or other + * Game Object. They can also be made interactive and used for input events. + * + * It works by taking a reference to a `Phaser.Display.BaseShader` instance, as found in the Shader Cache. These can + * be created dynamically at runtime, or loaded in via the GLSL File Loader: + * + * ```javascript + * function preload () + * { + * this.load.glsl('fire', 'shaders/fire.glsl.js'); + * } + * + * function create () + * { + * this.add.shader('fire', 400, 300, 512, 512); + * } + * ``` + * + * Please see the Phaser 3 Examples GitHub repo for examples of loading and creating shaders dynamically. + * + * Due to the way in which they work, you cannot directly change the alpha or blend mode of a Shader. This should + * be handled via exposed uniforms in the shader code itself. + * + * By default a Shader will be created with a standard set of uniforms. These were added to match those + * found on sites such as ShaderToy or GLSLSandbox, and provide common functionality a shader may need, + * such as the timestamp, resolution or pointer position. You can replace them by specifying your own uniforms + * in the Base Shader. + * + * These Shaders work by halting the current pipeline during rendering, creating a viewport matched to the + * size of this Game Object and then renders a quad using the bound shader. At the end, the pipeline is restored. + * + * Because it blocks the pipeline it means it will interrupt any batching that is currently going on, so you should + * use these Game Objects sparingly. If you need to have a fully batched custom shader, then please look at using + * a custom pipeline instead. However, for background or special masking effects, they are extremely effective. + */ + class Shader extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param key The key of the shader to use from the shader cache, or a BaseShader instance. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the Game Object. Default 128. + * @param height The height of the Game Object. Default 128. + * @param textures Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. + */ + constructor(scene: Phaser.Scene, key: string | Phaser.Display.BaseShader, x?: number, y?: number, width?: number, height?: number, textures?: string[]); + + /** + * The underlying shader object being used. + * Empty by default and set during a call to the `setShader` method. + */ + shader: Phaser.Display.BaseShader; + + /** + * A reference to the current renderer. + * Shaders only work with the WebGL Renderer. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The WebGL context belonging to the renderer. + */ + gl: WebGLRenderingContext; + + /** + * Raw byte buffer of vertices this Shader uses. + */ + vertexData: ArrayBuffer; + + /** + * The WebGL vertex buffer object this shader uses. + */ + vertexBuffer: WebGLBuffer; + + /** + * The WebGL shader program this shader uses. + */ + program: WebGLProgram; + + /** + * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources to the GPU. + */ + bytes: Uint8Array; + + /** + * Float32 view of the array buffer containing the shaders vertices. + */ + vertexViewF32: Float32Array; + + /** + * The view matrix the shader uses during rendering. + */ + readonly viewMatrix: Float32Array; + + /** + * The projection matrix the shader uses during rendering. + */ + readonly projectionMatrix: Float32Array; + + /** + * The default uniform mappings. These can be added to (or replaced) by specifying your own uniforms when + * creating this shader game object. The uniforms are updated automatically during the render step. + * + * The defaults are: + * + * `resolution` (2f) - Set to the size of this shader. + * `time` (1f) - The elapsed game time, in seconds. + * `mouse` (2f) - If a pointer has been bound (with `setPointer`), this uniform contains its position each frame. + * `date` (4fv) - A vec4 containing the year, month, day and time in seconds. + * `sampleRate` (1f) - Sound sample rate. 44100 by default. + * `iChannel0...3` (sampler2D) - Input channels 0 to 3. `null` by default. + */ + uniforms: any; + + /** + * The pointer bound to this shader, if any. + * Set via the chainable `setPointer` method, or by modifying this property directly. + */ + pointer: Phaser.Input.Pointer; + + /** + * Sets the fragment and, optionally, the vertex shader source code that this Shader will use. + * This will immediately delete the active shader program, if set, and then create a new one + * with the given source. Finally, the shader uniforms are initialized. + * @param key The key of the shader to use from the shader cache, or a BaseShader instance. + * @param textures Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. + */ + setShader(key: string | Phaser.Display.BaseShader, textures?: string[]): this; + + /** + * Binds a Phaser Pointer object to this Shader. + * + * The screen position of the pointer will be set in to the shaders `mouse` uniform + * automatically every frame. Call this method with no arguments to unbind the pointer. + * @param pointer The Pointer to bind to this shader. + */ + setPointer(pointer?: Phaser.Input.Pointer): this; + + /** + * Sets this shader to use an orthographic projection matrix. + * This matrix is stored locally in the `projectionMatrix` property, + * as well as being bound to the `uProjectionMatrix` uniform. + * @param left The left value. + * @param right The right value. + * @param bottom The bottom value. + * @param top The top value. + */ + projOrtho(left: number, right: number, bottom: number, top: number): void; + + /** + * Sets a sampler2D uniform on this shader. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * @param uniformKey The key of the sampler2D uniform to be updated, i.e. `iChannel0`. + * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param textureIndex The texture index. Default 0. + * @param textureData Additional texture data. + */ + setSampler2D(uniformKey: string, textureKey: string, textureIndex?: integer, textureData?: any): this; + + /** + * Sets a property of a uniform already present on this shader. + * + * To modify the value of a uniform such as a 1f or 1i use the `value` property directly: + * + * ```javascript + * shader.setUniform('size.value', 16); + * ``` + * + * You can use dot notation to access deeper values, for example: + * + * ```javascript + * shader.setUniform('resolution.value.x', 512); + * ``` + * + * The change to the uniform will take effect the next time the shader is rendered. + * @param key The key of the uniform to modify. Use dots for deep properties, i.e. `resolution.value.x`. + * @param value The value to set into the uniform. + */ + setUniform(key: string, value: any): this; + + /** + * Returns the uniform object for the given key, or `null` if the uniform couldn't be found. + * @param key The key of the uniform to return the value for. + */ + getUniform(key: string): this; + + /** + * A short-cut method that will directly set the texture being used by the `iChannel0` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param textureData Additional texture data. + */ + setChannel0(textureKey: string, textureData?: any): this; + + /** + * A short-cut method that will directly set the texture being used by the `iChannel1` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param textureData Additional texture data. + */ + setChannel1(textureKey: string, textureData?: any): this; + + /** + * A short-cut method that will directly set the texture being used by the `iChannel2` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param textureData Additional texture data. + */ + setChannel2(textureKey: string, textureData?: any): this; + + /** + * A short-cut method that will directly set the texture being used by the `iChannel3` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param textureData Additional texture data. + */ + setChannel3(textureKey: string, textureData?: any): this; + + /** + * Called automatically during render. + * + * This method performs matrix ITRS and then stores the resulting value in the `uViewMatrix` uniform. + * It then sets up the vertex buffer and shader, updates and syncs the uniforms ready + * for flush to be called. + * @param matrix2D The transform matrix to use during rendering. + */ + load(matrix2D: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Called automatically during render. + * + * Sets the active shader, loads the vertex buffer and then draws. + */ + flush(): void; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an arc shape. You can control the start and end angles of the arc, + * as well as if the angles are winding clockwise or anti-clockwise. With the default settings + * it renders as a complete circle. By changing the angles you can create other arc shapes, + * such as half-circles. + * + * Arcs also have an `iterations` property and corresponding `setIterations` method. This allows + * you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. + */ + class Arc extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param radius The radius of the arc. Default 128. + * @param startAngle The start angle of the arc, in degrees. Default 0. + * @param endAngle The end angle of the arc, in degrees. Default 360. + * @param anticlockwise The winding order of the start and end angles. Default false. + * @param fillColor The color the arc will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, radius?: number, startAngle?: integer, endAngle?: integer, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number); + + /** + * The number of iterations used when drawing the arc. + * Increase this value for smoother arcs, at the cost of more polygons being rendered. + * Modify this value by small amounts, such as 0.01. + */ + iterations: number; + + /** + * The radius of the arc. + */ + radius: number; + + /** + * The start angle of the arc, in degrees. + */ + startAngle: integer; + + /** + * The end angle of the arc, in degrees. + */ + endAngle: integer; + + /** + * The winding order of the start and end angles. + */ + anticlockwise: boolean; + + /** + * Sets the radius of the arc. + * This call can be chained. + * @param value The value to set the radius to. + */ + setRadius(value: number): this; + + /** + * Sets the number of iterations used when drawing the arc. + * Increase this value for smoother arcs, at the cost of more polygons being rendered. + * Modify this value by small amounts, such as 0.01. + * This call can be chained. + * @param value The value to set the iterations to. + */ + setIterations(value: number): this; + + /** + * Sets the starting angle of the arc, in degrees. + * This call can be chained. + * @param value The value to set the starting angle to. + */ + setStartAngle(value: integer): this; + + /** + * Sets the ending angle of the arc, in degrees. + * This call can be chained. + * @param value The value to set the ending angle to. + */ + setEndAngle(value: integer): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to + * the Curve Shape in the constructor. + * + * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + */ + class Curve extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param curve The Curve object to use to create the Shape. + * @param fillColor The color the curve will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the curve will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, curve?: Phaser.Curves.Curve, fillColor?: number, fillAlpha?: number); + + /** + * The smoothness of the curve. The number of points used when rendering it. + * Increase this value for smoother curves, at the cost of more polygons being rendered. + */ + smoothness: integer; + + /** + * Sets the smoothness of the curve. The number of points used when rendering it. + * Increase this value for smoother curves, at the cost of more polygons being rendered. + * This call can be chained. + * @param value The value to set the smoothness to. + */ + setSmoothness(value: integer): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. + * If the width and height match it will render as a circle. If the width is less than the height, + * it will look more like an egg shape. + * + * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + */ + class Ellipse extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. + * @param height The height of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. + * @param fillColor The color the ellipse will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number); + + /** + * The smoothness of the ellipse. The number of points used when rendering it. + * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. + */ + smoothness: integer; + + /** + * Sets the size of the ellipse by changing the underlying geometry data, rather than scaling the object. + * This call can be chained. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + */ + setSize(width: number, height: number): this; + + /** + * Sets the smoothness of the ellipse. The number of points used when rendering it. + * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. + * This call can be chained. + * @param value The value to set the smoothness to. + */ + setSmoothness(value: integer): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * A Grid Shape allows you to display a grid in your game, where you can control the size of the + * grid as well as the width and height of the grid cells. You can set a fill color for each grid + * cell as well as an alternate fill color. When the alternate fill color is set then the grid + * cells will alternate the fill colors as they render, creating a chess-board effect. You can + * also optionally have an outline fill color. If set, this draws lines between the grid cells + * in the given color. If you specify an outline color with an alpha of zero, then it will draw + * the cells spaced out, but without the lines between them. + */ + class Grid extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the grid. Default 128. + * @param height The height of the grid. Default 128. + * @param cellWidth The width of one cell in the grid. Default 32. + * @param cellHeight The height of one cell in the grid. Default 32. + * @param fillColor The color the grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * @param outlineFillColor The color of the lines between the grid cells. See the `setOutline` method. + * @param outlineFillAlpha The alpha of the lines between the grid cells. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, width?: number, height?: number, cellWidth?: number, cellHeight?: number, fillColor?: number, fillAlpha?: number, outlineFillColor?: number, outlineFillAlpha?: number); + + /** + * The width of each grid cell. + * Must be a positive value. + */ + cellWidth: number; + + /** + * The height of each grid cell. + * Must be a positive value. + */ + cellHeight: number; + + /** + * Will the grid render its cells in the `fillColor`? + */ + showCells: boolean; + + /** + * The color of the lines between each grid cell. + */ + outlineFillColor: number; + + /** + * The alpha value for the color of the lines between each grid cell. + */ + outlineFillAlpha: number; + + /** + * Will the grid display the lines between each cell when it renders? + */ + showOutline: boolean; + + /** + * Will the grid render the alternating cells in the `altFillColor`? + */ + showAltCells: boolean; + + /** + * The color the alternating grid cells will be filled with, i.e. 0xff0000 for red. + */ + altFillColor: number; + + /** + * The alpha the alternating grid cells will be filled with. + * You can also set the alpha of the overall Shape using its `alpha` property. + */ + altFillAlpha: number; + + /** + * Sets the fill color and alpha level the grid cells will use when rendering. + * + * If this method is called with no values then the grid cells will not be rendered, + * however the grid lines and alternating cells may still be. + * + * Also see the `setOutlineStyle` and `setAltFillStyle` methods. + * + * This call can be chained. + * @param fillColor The color the grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. Default 1. + */ + setFillStyle(fillColor?: number, fillAlpha?: number): this; + + /** + * Sets the fill color and alpha level that the alternating grid cells will use. + * + * If this method is called with no values then alternating grid cells will not be rendered in a different color. + * + * Also see the `setOutlineStyle` and `setFillStyle` methods. + * + * This call can be chained. + * @param fillColor The color the alternating grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the alternating grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. Default 1. + */ + setAltFillStyle(fillColor?: number, fillAlpha?: number): this; + + /** + * Sets the fill color and alpha level that the lines between each grid cell will use. + * + * If this method is called with no values then the grid lines will not be rendered at all, however + * the cells themselves may still be if they have colors set. + * + * Also see the `setFillStyle` and `setAltFillStyle` methods. + * + * This call can be chained. + * @param fillColor The color the lines between the grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the lines between the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. Default 1. + */ + setOutlineStyle(fillColor?: number, fillAlpha?: number): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set + * the color of the top, left and right faces of the rectangle respectively. You can also choose + * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting + * the `projection` property. + */ + class IsoBox extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param size The width of the iso box in pixels. The left and right faces will be exactly half this value. Default 48. + * @param height The height of the iso box. The left and right faces will be this tall. The overall height of the isobox will be this value plus half the `size` value. Default 32. + * @param fillTop The fill color of the top face of the iso box. Default 0xeeeeee. + * @param fillLeft The fill color of the left face of the iso box. Default 0x999999. + * @param fillRight The fill color of the right face of the iso box. Default 0xcccccc. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, size?: number, height?: number, fillTop?: number, fillLeft?: number, fillRight?: number); + + /** + * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. + */ + projection: integer; + + /** + * The color used to fill in the top of the iso box. + */ + fillTop: number; + + /** + * The color used to fill in the left-facing side of the iso box. + */ + fillLeft: number; + + /** + * The color used to fill in the right-facing side of the iso box. + */ + fillRight: number; + + /** + * Controls if the top-face of the iso box be rendered. + */ + showTop: boolean; + + /** + * Controls if the left-face of the iso box be rendered. + */ + showLeft: boolean; + + /** + * Controls if the right-face of the iso box be rendered. + */ + showRight: boolean; + + /** + * Sets the projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. + * This call can be chained. + * @param value The value to set the projection to. + */ + setProjection(value: integer): this; + + /** + * Sets which faces of the iso box will be rendered. + * This call can be chained. + * @param showTop Show the top-face of the iso box. Default true. + * @param showLeft Show the left-face of the iso box. Default true. + * @param showRight Show the right-face of the iso box. Default true. + */ + setFaces(showTop?: boolean, showLeft?: boolean, showRight?: boolean): this; + + /** + * Sets the fill colors for each face of the iso box. + * This call can be chained. + * @param fillTop The color used to fill the top of the iso box. + * @param fillLeft The color used to fill in the left-facing side of the iso box. + * @param fillRight The color used to fill in the right-facing side of the iso box. + */ + setFillStyle(fillTop?: number, fillLeft?: number, fillRight?: number): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different + * fill color. You can set the color of the top, left and right faces of the triangle respectively + * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting + * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside + * down or not. + */ + class IsoTriangle extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param size The width of the iso triangle in pixels. The left and right faces will be exactly half this value. Default 48. + * @param height The height of the iso triangle. The left and right faces will be this tall. The overall height of the iso triangle will be this value plus half the `size` value. Default 32. + * @param reversed Is the iso triangle upside down? Default false. + * @param fillTop The fill color of the top face of the iso triangle. Default 0xeeeeee. + * @param fillLeft The fill color of the left face of the iso triangle. Default 0x999999. + * @param fillRight The fill color of the right face of the iso triangle. Default 0xcccccc. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, size?: number, height?: number, reversed?: boolean, fillTop?: number, fillLeft?: number, fillRight?: number); + + /** + * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. + */ + projection: integer; + + /** + * The color used to fill in the top of the iso triangle. This is only used if the triangle is reversed. + */ + fillTop: number; + + /** + * The color used to fill in the left-facing side of the iso triangle. + */ + fillLeft: number; + + /** + * The color used to fill in the right-facing side of the iso triangle. + */ + fillRight: number; + + /** + * Controls if the top-face of the iso triangle be rendered. + */ + showTop: boolean; + + /** + * Controls if the left-face of the iso triangle be rendered. + */ + showLeft: boolean; + + /** + * Controls if the right-face of the iso triangle be rendered. + */ + showRight: boolean; + + /** + * Sets if the iso triangle will be rendered upside down or not. + */ + isReversed: boolean; + + /** + * Sets the projection level of the iso triangle. Change this to change the 'angle' at which you are looking at the pyramid. + * This call can be chained. + * @param value The value to set the projection to. + */ + setProjection(value: integer): this; + + /** + * Sets if the iso triangle will be rendered upside down or not. + * This call can be chained. + * @param reversed Sets if the iso triangle will be rendered upside down or not. + */ + setReversed(reversed: boolean): this; + + /** + * Sets which faces of the iso triangle will be rendered. + * This call can be chained. + * @param showTop Show the top-face of the iso triangle (only if `reversed` is true) Default true. + * @param showLeft Show the left-face of the iso triangle. Default true. + * @param showRight Show the right-face of the iso triangle. Default true. + */ + setFaces(showTop?: boolean, showLeft?: boolean, showRight?: boolean): this; + + /** + * Sets the fill colors for each face of the iso triangle. + * This call can be chained. + * @param fillTop The color used to fill the top of the iso triangle. + * @param fillLeft The color used to fill in the left-facing side of the iso triangle. + * @param fillRight The color used to fill in the right-facing side of the iso triangle. + */ + setFillStyle(fillTop?: number, fillLeft?: number, fillRight?: number): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only stroke colors and cannot be filled. + * + * A Line Shape allows you to draw a line between two points in your game. You can control the + * stroke color and thickness of the line. In WebGL only you can also specify a different + * thickness for the start and end of the line, allowing you to render lines that taper-off. + * + * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. + * + * Be aware that as with all Game Objects the default origin is 0.5. If you need to draw a Line + * between two points and want the x1/y1 values to match the x/y values, then set the origin to 0. + */ + class Line extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the start of the line. Default 0. + * @param y1 The vertical position of the start of the line. Default 0. + * @param x2 The horizontal position of the end of the line. Default 128. + * @param y2 The vertical position of the end of the line. Default 0. + * @param strokeColor The color the line will be drawn in, i.e. 0xff0000 for red. + * @param strokeAlpha The alpha the line will be drawn in. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, strokeColor?: number, strokeAlpha?: number); + + /** + * The width (or thickness) of the line. + * See the setLineWidth method for extra details on changing this on WebGL. + */ + lineWidth: number; + + /** + * Sets the width of the line. + * + * When using the WebGL renderer you can have different start and end widths. + * When using the Canvas renderer only the `startWidth` value is used. The `endWidth` is ignored. + * + * This call can be chained. + * @param startWidth The start width of the line. + * @param endWidth The end width of the line. Only used in WebGL. + */ + setLineWidth(startWidth: number, endWidth?: number): this; + + /** + * Sets the start and end coordinates of this Line. + * @param x1 The horizontal position of the start of the line. Default 0. + * @param y1 The vertical position of the start of the line. Default 0. + * @param x2 The horizontal position of the end of the line. Default 0. + * @param y2 The vertical position of the end of the line. Default 0. + */ + setTo(x1?: number, y1?: number, x2?: number, y2?: number): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Polygon Shape is created by providing a list of points, which are then used to create an + * internal Polygon geometry object. The points can be set from a variety of formats: + * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point or Vector2 objects: `[new Phaser.Math.Vec2(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending + * on the coordinates of the points provided, the final shape may be rendered offset from its origin. + */ + class Polygon extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The points that make up the polygon. + * @param fillColor The color the polygon will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the polygon will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, points?: any, fillColor?: number, fillAlpha?: number); + + /** + * Smooths the polygon over the number of iterations specified. + * The base polygon data will be updated and replaced with the smoothed values. + * This call can be chained. + * @param iterations The number of times to apply the polygon smoothing. Default 1. + */ + smooth(iterations?: integer): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * You can change the size of the rectangle by changing the `width` and `height` properties. + */ + class Rectangle extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the rectangle. Default 128. + * @param height The height of the rectangle. Default 128. + * @param fillColor The color the rectangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the rectangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x: number, y: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number); + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. + * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. + */ + class Shape extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param type The internal type of the Shape. + * @param data The data of the source shape geometry, if any. + */ + constructor(scene: Phaser.Scene, type?: string, data?: any); + + /** + * The source Shape data. Typically a geometry object. + * You should not manipulate this directly. + */ + readonly data: any; + + /** + * Holds the polygon path data for filled rendering. + */ + readonly pathData: number[]; + + /** + * Holds the earcut polygon path index data for filled rendering. + */ + readonly pathIndexes: integer[]; + + /** + * The fill color used by this Shape. + */ + fillColor: number; + + /** + * The fill alpha value used by this Shape. + */ + fillAlpha: number; + + /** + * The stroke color used by this Shape. + */ + strokeColor: number; + + /** + * The stroke alpha value used by this Shape. + */ + strokeAlpha: number; + + /** + * The stroke line width used by this Shape. + */ + lineWidth: number; + + /** + * Controls if this Shape is filled or not. + * Note that some Shapes do not support being filled (such as Line shapes) + */ + isFilled: boolean; + + /** + * Controls if this Shape is stroked or not. + * Note that some Shapes do not support being stroked (such as Iso Box shapes) + */ + isStroked: boolean; + + /** + * Controls if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + */ + closePath: boolean; + + /** + * Sets the fill color and alpha for this Shape. + * + * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. + * + * Note that some Shapes do not support fill colors, such as the Line shape. + * + * This call can be chained. + * @param color The color used to fill this shape. If not provided the Shape will not be filled. + * @param alpha The alpha value used when filling this shape, if a fill color is given. Default 1. + */ + setFillStyle(color?: number, alpha?: number): this; + + /** + * Sets the stroke color and alpha for this Shape. + * + * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. + * + * Note that some Shapes do not support being stroked, such as the Iso Box shape. + * + * This call can be chained. + * @param lineWidth The width of line to stroke with. If not provided or undefined the Shape will not be stroked. + * @param color The color used to stroke this shape. If not provided the Shape will not be stroked. + * @param alpha The alpha value used when stroking this shape, if a stroke color is given. Default 1. + */ + setStrokeStyle(lineWidth?: number, color?: number, alpha?: number): this; + + /** + * Sets if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * This call can be chained. + * @param value Set to `true` if the Shape should be closed when stroked, otherwise `false`. + */ + setClosePath(value: boolean): this; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * As the name implies, the Star shape will display a star in your game. You can control several + * aspects of it including the number of points that constitute the star. The default is 5. If + * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky + * star shape. + * + * You can also control the inner and outer radius, which is how 'long' each point of the star is. + * Modify these values to create more interesting shapes. + */ + class Star extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The number of points on the star. Default 5. + * @param innerRadius The inner radius of the star. Default 32. + * @param outerRadius The outer radius of the star. Default 64. + * @param fillColor The color the star will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, points?: number, innerRadius?: number, outerRadius?: number, fillColor?: number, fillAlpha?: number); + + /** + * Sets the number of points that make up the Star shape. + * This call can be chained. + * @param value The amount of points the Star will have. + */ + setPoints(value: integer): this; + + /** + * Sets the inner radius of the Star shape. + * This call can be chained. + * @param value The amount to set the inner radius to. + */ + setInnerRadius(value: number): this; + + /** + * Sets the outer radius of the Star shape. + * This call can be chained. + * @param value The amount to set the outer radius to. + */ + setOuterRadius(value: number): this; + + /** + * The number of points that make up the Star shape. + */ + points: integer; + + /** + * The inner radius of the Star shape. + */ + innerRadius: number; + + /** + * The outer radius of the Star shape. + */ + outerRadius: number; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the + * position of each point of these lines. The triangle is always closed and cannot have an open + * face. If you require that, consider using a Polygon instead. + */ + class Triangle extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the first point in the triangle. Default 0. + * @param y1 The vertical position of the first point in the triangle. Default 128. + * @param x2 The horizontal position of the second point in the triangle. Default 64. + * @param y2 The vertical position of the second point in the triangle. Default 0. + * @param x3 The horizontal position of the third point in the triangle. Default 128. + * @param y3 The vertical position of the third point in the triangle. Default 128. + * @param fillColor The color the triangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number, fillColor?: number, fillAlpha?: number); + + /** + * Sets the data for the lines that make up this Triangle shape. + * @param x1 The horizontal position of the first point in the triangle. Default 0. + * @param y1 The vertical position of the first point in the triangle. Default 0. + * @param x2 The horizontal position of the second point in the triangle. Default 0. + * @param y2 The vertical position of the second point in the triangle. Default 0. + * @param x3 The horizontal position of the third point in the triangle. Default 0. + * @param y3 The vertical position of the third point in the triangle. Default 0. + */ + setTo(x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Sprite Game Object. + * + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + */ + class Sprite extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer); + + /** + * The Animation Controller of this Sprite. + */ + anims: Phaser.GameObjects.Components.Animation; + + /** + * Update this Sprite's animations. + * @param time The current timestamp. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected preUpdate(time: number, delta: number): void; + + /** + * Start playing the given animation. + * @param key The string-based key of the animation to play. + * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. + * @param startFrame Optionally start the animation playing from this frame index. Default 0. + */ + play(key: string, ignoreIfPlaying?: boolean, startFrame?: integer): Phaser.GameObjects.Sprite; + + /** + * Build a JSON representation of this Sprite. + */ + toJSON(): Phaser.Types.GameObjects.JSONGameObject; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Text Game Object. + * + * Text objects work by creating their own internal hidden Canvas and then renders text to it using + * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered + * to your game during the render pass. + * + * Because it uses the Canvas API you can take advantage of all the features this offers, such as + * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts + * loaded externally, such as Google or TypeKit Web fonts. + * + * **Important:** If the font you wish to use has a space or digit in its name, such as + * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes, either + * when creating the Text object, or when setting the font via `setFont` or `setFontFamily`. I.e.: + * + * ```javascript + * this.add.text(0, 0, 'Hello World', { fontFamily: '"Roboto Condensed"' }); + * ``` + * + * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all + * quoted properly, too: + * + * ```javascript + * this.add.text(0, 0, 'Hello World', { fontFamily: 'Verdana, "Times New Roman", Tahoma, serif' }); + * ``` + * + * You can only display fonts that are currently loaded and available to the browser: therefore fonts must + * be pre-loaded. Phaser does not do ths for you, so you will require the use of a 3rd party font loader, + * or have the fonts ready available in the CSS on the page in which your Phaser game resides. + * + * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts + * across mobile browsers. + * + * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being + * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the + * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of + * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text + * instead, as it benefits from batching and avoids expensive Canvas API calls. + */ + class Text extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Crop, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param text The text this Text object will display. + * @param style The text style configuration object. + */ + constructor(scene: Phaser.Scene, x: number, y: number, text: string | string[], style: Phaser.Types.GameObjects.Text.TextSyle); + + /** + * Returns an object containing dimensions of the Text object. + * @param text The Text object to calculate the size from. + * @param size The Text metrics to use when calculating the size. + * @param lines The lines of text to calculate the size from. + */ + static GetTextSize(text: Phaser.GameObjects.Text, size: Phaser.Types.GameObjects.Text.TextMetrics, lines: any[]): object; + + /** + * Calculates the ascent, descent and fontSize of a given font style. + * @param textStyle The TextStyle object to measure. + */ + static MeasureText(textStyle: Phaser.GameObjects.TextStyle): Phaser.Types.GameObjects.Text.TextMetrics; + + /** + * The renderer in use by this Text object. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The canvas element that the text is rendered to. + */ + canvas: HTMLCanvasElement; + + /** + * The context of the canvas element that the text is rendered to. + */ + context: CanvasRenderingContext2D; + + /** + * The Text Style object. + * + * Manages the style of this Text object. + */ + style: Phaser.GameObjects.TextStyle; + + /** + * Whether to automatically round line positions. + */ + autoRound: boolean; + + /** + * The Regular Expression that is used to split the text up into lines, in + * multi-line text. By default this is `/(?:\r\n|\r|\n)/`. + * You can change this RegExp to be anything else that you may need. + */ + splitRegExp: object; + + /** + * Specify a padding value which is added to the line width and height when calculating the Text size. + * Allows you to add extra spacing if the browser is unable to accurately determine the true font dimensions. + */ + padding: Object; + + /** + * The width of this Text object. + */ + width: number; + + /** + * The height of this Text object. + */ + height: number; + + /** + * The line spacing value. + * This value is added to the font height to calculate the overall line height. + * Only has an effect if this Text object contains multiple lines of text. + * + * If you update this property directly, instead of using the `setLineSpacing` method, then + * be sure to call `updateText` after, or you won't see the change reflected in the Text object. + */ + lineSpacing: number; + + /** + * Whether the text or its settings have changed and need updating. + */ + dirty: boolean; + + /** + * Initialize right to left text. + */ + initRTL(): void; + + /** + * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal + * bounds. + * @param text The text to perform word wrap detection against. + */ + runWordWrap(text: string): string; + + /** + * Advanced wrapping algorithm that will wrap words as the line grows longer than its horizontal + * bounds. Consecutive spaces will be collapsed and replaced with a single space. Lines will be + * trimmed of white space before processing. Throws an error if wordWrapWidth is less than a + * single character. + * @param text The text to perform word wrap detection against. + * @param context The Canvas Rendering Context. + * @param wordWrapWidth The word wrap width. + */ + advancedWordWrap(text: string, context: CanvasRenderingContext2D, wordWrapWidth: number): string; + + /** + * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal + * bounds. Spaces are not collapsed and whitespace is not trimmed. + * @param text The text to perform word wrap detection against. + * @param context The Canvas Rendering Context. + * @param wordWrapWidth The word wrap width. + */ + basicWordWrap(text: string, context: CanvasRenderingContext2D, wordWrapWidth: number): string; + + /** + * Runs the given text through this Text objects word wrapping and returns the results as an + * array, where each element of the array corresponds to a wrapped line of text. + * @param text The text for which the wrapping will be calculated. If unspecified, the Text objects current text will be used. + */ + getWrappedText(text: string): string[]; + + /** + * Set the text to display. + * + * An array of strings will be joined with `\n` line breaks. + * @param value The string, or array of strings, to be set as the content of this Text object. + */ + setText(value: string | string[]): Phaser.GameObjects.Text; + + /** + * Set the text style. + * @param style The style settings to set. + */ + setStyle(style: object): Phaser.GameObjects.Text; + + /** + * Set the font. + * + * If a string is given, the font family is set. + * + * If an object is given, the `fontFamily`, `fontSize` and `fontStyle` + * properties of that object are set. + * + * **Important:** If the font you wish to use has a space or digit in its name, such as + * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes: + * + * ```javascript + * Text.setFont('"Roboto Condensed"'); + * ``` + * + * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all + * quoted properly, too: + * + * ```javascript + * Text.setFont('Verdana, "Times New Roman", Tahoma, serif'); + * ``` + * @param font The font family or font settings to set. + */ + setFont(font: string): Phaser.GameObjects.Text; + + /** + * Set the font family. + * + * **Important:** If the font you wish to use has a space or digit in its name, such as + * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes: + * + * ```javascript + * Text.setFont('"Roboto Condensed"'); + * ``` + * + * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all + * quoted properly, too: + * + * ```javascript + * Text.setFont('Verdana, "Times New Roman", Tahoma, serif'); + * ``` + * @param family The font family. + */ + setFontFamily(family: string): Phaser.GameObjects.Text; + + /** + * Set the font size. + * @param size The font size. + */ + setFontSize(size: number): Phaser.GameObjects.Text; + + /** + * Set the font style. + * @param style The font style. + */ + setFontStyle(style: string): Phaser.GameObjects.Text; + + /** + * Set a fixed width and height for the text. + * + * Pass in `0` for either of these parameters to disable fixed width or height respectively. + * @param width The fixed width to set. `0` disables fixed width. + * @param height The fixed height to set. `0` disables fixed height. + */ + setFixedSize(width: number, height: number): Phaser.GameObjects.Text; + + /** + * Set the background color. + * @param color The background color. + */ + setBackgroundColor(color: string): Phaser.GameObjects.Text; + + /** + * Set the fill style to be used by the Text object. + * + * This can be any valid CanvasRenderingContext2D fillStyle value, such as + * a color (in hex, rgb, rgba, hsl or named values), a gradient or a pattern. + * + * See the [MDN fillStyle docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle) for more details. + * @param color The text fill style. Can be any valid CanvasRenderingContext `fillStyle` value. + */ + setFill(color: string | any): Phaser.GameObjects.Text; + + /** + * Set the text fill color. + * @param color The text fill color. + */ + setColor(color: string): Phaser.GameObjects.Text; + + /** + * Set the stroke settings. + * @param color The stroke color. + * @param thickness The stroke thickness. + */ + setStroke(color: string, thickness: number): Phaser.GameObjects.Text; + + /** + * Set the shadow settings. + * @param x The horizontal shadow offset. Default 0. + * @param y The vertical shadow offset. Default 0. + * @param color The shadow color. Default '#000'. + * @param blur The shadow blur radius. Default 0. + * @param shadowStroke Whether to stroke the shadow. Default false. + * @param shadowFill Whether to fill the shadow. Default true. + */ + setShadow(x?: number, y?: number, color?: string, blur?: number, shadowStroke?: boolean, shadowFill?: boolean): Phaser.GameObjects.Text; + + /** + * Set the shadow offset. + * @param x The horizontal shadow offset. + * @param y The vertical shadow offset. + */ + setShadowOffset(x: number, y: number): Phaser.GameObjects.Text; + + /** + * Set the shadow color. + * @param color The shadow color. + */ + setShadowColor(color: string): Phaser.GameObjects.Text; + + /** + * Set the shadow blur radius. + * @param blur The shadow blur radius. + */ + setShadowBlur(blur: number): Phaser.GameObjects.Text; + + /** + * Enable or disable shadow stroke. + * @param enabled Whether shadow stroke is enabled or not. + */ + setShadowStroke(enabled: boolean): Phaser.GameObjects.Text; + + /** + * Enable or disable shadow fill. + * @param enabled Whether shadow fill is enabled or not. + */ + setShadowFill(enabled: boolean): Phaser.GameObjects.Text; + + /** + * Set the width (in pixels) to use for wrapping lines. Pass in null to remove wrapping by width. + * @param width The maximum width of a line in pixels. Set to null to remove wrapping. + * @param useAdvancedWrap Whether or not to use the advanced wrapping + * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false, + * spaces and whitespace are left as is. Default false. + */ + setWordWrapWidth(width: number, useAdvancedWrap?: boolean): Phaser.GameObjects.Text; + + /** + * Set a custom callback for wrapping lines. Pass in null to remove wrapping by callback. + * @param callback A custom function that will be responsible for wrapping the + * text. It will receive two arguments: text (the string to wrap), textObject (this Text + * instance). It should return the wrapped lines either as an array of lines or as a string with + * newline characters in place to indicate where breaks should happen. + * @param scope The scope that will be applied when the callback is invoked. Default null. + */ + setWordWrapCallback(callback: TextStyleWordWrapCallback, scope?: object): Phaser.GameObjects.Text; + + /** + * Set the alignment of the text in this Text object. + * + * The argument can be one of: `left`, `right`, `center` or `justify`. + * + * Alignment only works if the Text object has more than one line of text. + * @param align The text alignment for multi-line text. Default 'left'. + */ + setAlign(align?: string): Phaser.GameObjects.Text; + + /** + * Set the resolution used by this Text object. + * + * By default it will be set to match the resolution set in the Game Config, + * but you can override it via this method, or by specifying it in the Text style configuration object. + * + * It allows for much clearer text on High DPI devices, at the cost of memory because it uses larger + * internal Canvas textures for the Text. + * + * Therefore, please use with caution, as the more high res Text you have, the more memory it uses. + * @param value The resolution for this Text object to use. + */ + setResolution(value: number): Phaser.GameObjects.Text; + + /** + * Sets the line spacing value. + * + * This value is _added_ to the height of the font when calculating the overall line height. + * This only has an effect if this Text object consists of multiple lines of text. + * @param value The amount to add to the font height to achieve the overall line height. + */ + setLineSpacing(value: number): Phaser.GameObjects.Text; + + /** + * Set the text padding. + * + * 'left' can be an object. + * + * If only 'left' and 'top' are given they are treated as 'x' and 'y'. + * @param left The left padding value, or a padding config object. + * @param top The top padding value. + * @param right The right padding value. + * @param bottom The bottom padding value. + */ + setPadding(left: number | Phaser.Types.GameObjects.Text.TextPadding, top: number, right: number, bottom: number): Phaser.GameObjects.Text; + + /** + * Set the maximum number of lines to draw. + * @param max The maximum number of lines to draw. Default 0. + */ + setMaxLines(max?: integer): Phaser.GameObjects.Text; + + /** + * Update the displayed text. + */ + updateText(): Phaser.GameObjects.Text; + + /** + * Get the current text metrics. + */ + getTextMetrics(): object; + + /** + * The text string being rendered by this Text Game Object. + */ + text: string; + + /** + * Build a JSON representation of the Text object. + */ + toJSON(): Phaser.Types.GameObjects.JSONGameObject; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A TextStyle class manages all of the style settings for a Text object. + * + * Text Game Objects create a TextStyle instance automatically, which is + * accessed via the `Text.style` property. You do not normally need to + * instantiate one yourself. + */ + class TextStyle { + /** + * + * @param text The Text object that this TextStyle is styling. + * @param style The style settings to set. + */ + constructor(text: Phaser.GameObjects.Text, style: Phaser.Types.GameObjects.Text.TextSyle); + + /** + * The Text object that this TextStyle is styling. + */ + parent: Phaser.GameObjects.Text; + + /** + * The font family. + */ + fontFamily: string; + + /** + * The font size. + */ + fontSize: string; + + /** + * The font style. + */ + fontStyle: string; + + /** + * The background color. + */ + backgroundColor: string; + + /** + * The text fill color. + */ + color: string; + + /** + * The text stroke color. + */ + stroke: string; + + /** + * The text stroke thickness. + */ + strokeThickness: number; + + /** + * The horizontal shadow offset. + */ + shadowOffsetX: number; + + /** + * The vertical shadow offset. + */ + shadowOffsetY: number; + + /** + * The shadow color. + */ + shadowColor: string; + + /** + * The shadow blur radius. + */ + shadowBlur: number; + + /** + * Whether shadow stroke is enabled or not. + */ + shadowStroke: boolean; + + /** + * Whether shadow fill is enabled or not. + */ + shadowFill: boolean; + + /** + * The text alignment. + */ + align: string; + + /** + * The maximum number of lines to draw. + */ + maxLines: integer; + + /** + * The fixed width of the text. + * + * `0` means no fixed with. + */ + fixedWidth: number; + + /** + * The fixed height of the text. + * + * `0` means no fixed height. + */ + fixedHeight: number; + + /** + * The resolution the text is rendered to its internal canvas at. + * The default is 0, which means it will use the resolution set in the Game Config. + */ + resolution: number; + + /** + * Whether the text should render right to left. + */ + rtl: boolean; + + /** + * The test string to use when measuring the font. + */ + testString: string; + + /** + * The amount of horizontal padding added to the width of the text when calculating the font metrics. + */ + baselineX: number; + + /** + * The amount of vertical padding added to the height of the text when calculating the font metrics. + */ + baselineY: number; + + /** + * Set the text style. + * @param style The style settings to set. + * @param updateText Whether to update the text immediately. Default true. + * @param setDefaults Use the default values is not set, or the local values. Default false. + */ + setStyle(style: Phaser.Types.GameObjects.Text.TextSyle, updateText?: boolean, setDefaults?: boolean): Phaser.GameObjects.Text; + + /** + * Synchronize the font settings to the given Canvas Rendering Context. + * @param canvas The Canvas Element. + * @param context The Canvas Rendering Context. + */ + syncFont(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D): void; + + /** + * Synchronize the text style settings to the given Canvas Rendering Context. + * @param canvas The Canvas Element. + * @param context The Canvas Rendering Context. + */ + syncStyle(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D): void; + + /** + * Synchronize the shadow settings to the given Canvas Rendering Context. + * @param context The Canvas Rendering Context. + * @param enabled Whether shadows are enabled or not. + */ + syncShadow(context: CanvasRenderingContext2D, enabled: boolean): void; + + /** + * Update the style settings for the parent Text object. + * @param recalculateMetrics Whether to recalculate font and text metrics. + */ + update(recalculateMetrics: boolean): Phaser.GameObjects.Text; + + /** + * Set the font. + * + * If a string is given, the font family is set. + * + * If an object is given, the `fontFamily`, `fontSize` and `fontStyle` + * properties of that object are set. + * @param font The font family or font settings to set. + * @param updateText Whether to update the text immediately. Default true. + */ + setFont(font: string | object, updateText?: boolean): Phaser.GameObjects.Text; + + /** + * Set the font family. + * @param family The font family. + */ + setFontFamily(family: string): Phaser.GameObjects.Text; + + /** + * Set the font style. + * @param style The font style. + */ + setFontStyle(style: string): Phaser.GameObjects.Text; + + /** + * Set the font size. + * @param size The font size. + */ + setFontSize(size: number | string): Phaser.GameObjects.Text; + + /** + * Set the test string to use when measuring the font. + * @param string The test string to use when measuring the font. + */ + setTestString(string: string): Phaser.GameObjects.Text; + + /** + * Set a fixed width and height for the text. + * + * Pass in `0` for either of these parameters to disable fixed width or height respectively. + * @param width The fixed width to set. + * @param height The fixed height to set. + */ + setFixedSize(width: number, height: number): Phaser.GameObjects.Text; + + /** + * Set the background color. + * @param color The background color. + */ + setBackgroundColor(color: string): Phaser.GameObjects.Text; + + /** + * Set the text fill color. + * @param color The text fill color. + */ + setFill(color: string): Phaser.GameObjects.Text; + + /** + * Set the text fill color. + * @param color The text fill color. + */ + setColor(color: string): Phaser.GameObjects.Text; + + /** + * Set the resolution used by the Text object. + * + * By default it will be set to match the resolution set in the Game Config, + * but you can override it via this method. It allows for much clearer text on High DPI devices, + * at the cost of memory because it uses larger internal Canvas textures for the Text. + * + * Please use with caution, as the more high res Text you have, the more memory it uses up. + * @param value The resolution for this Text object to use. + */ + setResolution(value: number): Phaser.GameObjects.Text; + + /** + * Set the stroke settings. + * @param color The stroke color. + * @param thickness The stroke thickness. + */ + setStroke(color: string, thickness: number): Phaser.GameObjects.Text; + + /** + * Set the shadow settings. + * + * Calling this method always re-measures the parent Text object, + * so only call it when you actually change the shadow settings. + * @param x The horizontal shadow offset. Default 0. + * @param y The vertical shadow offset. Default 0. + * @param color The shadow color. Default '#000'. + * @param blur The shadow blur radius. Default 0. + * @param shadowStroke Whether to stroke the shadow. Default false. + * @param shadowFill Whether to fill the shadow. Default true. + */ + setShadow(x?: number, y?: number, color?: string, blur?: number, shadowStroke?: boolean, shadowFill?: boolean): Phaser.GameObjects.Text; + + /** + * Set the shadow offset. + * @param x The horizontal shadow offset. Default 0. + * @param y The vertical shadow offset. Default 0. + */ + setShadowOffset(x?: number, y?: number): Phaser.GameObjects.Text; + + /** + * Set the shadow color. + * @param color The shadow color. Default '#000'. + */ + setShadowColor(color?: string): Phaser.GameObjects.Text; + + /** + * Set the shadow blur radius. + * @param blur The shadow blur radius. Default 0. + */ + setShadowBlur(blur?: number): Phaser.GameObjects.Text; + + /** + * Enable or disable shadow stroke. + * @param enabled Whether shadow stroke is enabled or not. + */ + setShadowStroke(enabled: boolean): Phaser.GameObjects.Text; + + /** + * Enable or disable shadow fill. + * @param enabled Whether shadow fill is enabled or not. + */ + setShadowFill(enabled: boolean): Phaser.GameObjects.Text; + + /** + * Set the width (in pixels) to use for wrapping lines. + * + * Pass in null to remove wrapping by width. + * @param width The maximum width of a line in pixels. Set to null to remove wrapping. + * @param useAdvancedWrap Whether or not to use the advanced wrapping + * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false, + * spaces and whitespace are left as is. Default false. + */ + setWordWrapWidth(width: number, useAdvancedWrap?: boolean): Phaser.GameObjects.Text; + + /** + * Set a custom callback for wrapping lines. + * + * Pass in null to remove wrapping by callback. + * @param callback A custom function that will be responsible for wrapping the + * text. It will receive two arguments: text (the string to wrap), textObject (this Text + * instance). It should return the wrapped lines either as an array of lines or as a string with + * newline characters in place to indicate where breaks should happen. + * @param scope The scope that will be applied when the callback is invoked. Default null. + */ + setWordWrapCallback(callback: TextStyleWordWrapCallback, scope?: object): Phaser.GameObjects.Text; + + /** + * Set the alignment of the text in this Text object. + * + * The argument can be one of: `left`, `right`, `center` or `justify`. + * + * Alignment only works if the Text object has more than one line of text. + * @param align The text alignment for multi-line text. Default 'left'. + */ + setAlign(align?: string): Phaser.GameObjects.Text; + + /** + * Set the maximum number of lines to draw. + * @param max The maximum number of lines to draw. Default 0. + */ + setMaxLines(max?: integer): Phaser.GameObjects.Text; + + /** + * Get the current text metrics. + */ + getTextMetrics(): Phaser.Types.GameObjects.Text.TextMetrics; + + /** + * Build a JSON representation of this Text Style. + */ + toJSON(): object; + + /** + * Destroy this Text Style. + */ + destroy(): void; + + } + + /** + * A TileSprite is a Sprite that has a repeating texture. + * + * The texture can be scrolled and scaled independently of the TileSprite itself. Textures will automatically wrap and + * are designed so that you can create game backdrops using seamless textures as a source. + * + * You shouldn't ever create a TileSprite any larger than your actual canvas size. If you want to create a large repeating background + * that scrolls across the whole map of your game, then you create a TileSprite that fits the canvas size and then use the `tilePosition` + * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will + * consume huge amounts of memory and cause performance issues. Remember: use `tilePosition` to scroll your texture and `tileScale` to + * adjust the scale of the texture - don't resize the sprite itself or make it larger than it needs. + * + * An important note about Tile Sprites and NPOT textures: Internally, TileSprite textures use GL_REPEAT to provide + * seamless repeating of the textures. This, combined with the way in which the textures are handled in WebGL, means + * they need to be POT (power-of-two) sizes in order to wrap. If you provide a NPOT (non power-of-two) texture to a + * TileSprite it will generate a POT sized canvas and draw your texture to it, scaled up to the POT size. It's then + * scaled back down again during rendering to the original dimensions. While this works, in that it allows you to use + * any size texture for a Tile Sprite, it does mean that NPOT textures are going to appear anti-aliased when rendered, + * due to the interpolation that took place when it was resized into a POT texture. This is especially visible in + * pixel art graphics. If you notice it and it becomes an issue, the only way to avoid it is to ensure that you + * provide POT textures for Tile Sprites. + */ + class TileSprite extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Crop, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. If zero it will use the size of the texture frame. + * @param height The height of the Game Object. If zero it will use the size of the texture frame. + * @param textureKey The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frameKey An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, width: integer, height: integer, textureKey: string, frameKey?: string | integer); + + /** + * Whether the Tile Sprite has changed in some way, requiring an re-render of its tile texture. + * + * Such changes include the texture frame and scroll position of the Tile Sprite. + */ + dirty: boolean; + + /** + * The renderer in use by this Tile Sprite. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The Canvas element that the TileSprite renders its fill pattern in to. + * Only used in Canvas mode. + */ + canvas: HTMLCanvasElement; + + /** + * The Context of the Canvas element that the TileSprite renders its fill pattern in to. + * Only used in Canvas mode. + */ + context: CanvasRenderingContext2D; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * The next power of two value from the width of the Fill Pattern frame. + */ + potWidth: integer; + + /** + * The next power of two value from the height of the Fill Pattern frame. + */ + potHeight: integer; + + /** + * The Canvas that the TileSprites texture is rendered to. + * This is used to create a WebGL texture from. + */ + fillCanvas: HTMLCanvasElement; + + /** + * The Canvas Context used to render the TileSprites texture. + */ + fillContext: CanvasRenderingContext2D; + + /** + * The texture that the Tile Sprite is rendered to, which is then rendered to a Scene. + * In WebGL this is a WebGLTexture. In Canvas it's a Canvas Fill Pattern. + */ + fillPattern: WebGLTexture | CanvasPattern; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * @param frame The name or index of the frame within the Texture. + */ + setFrame(frame: string | integer): this; + + /** + * Sets {@link Phaser.GameObjects.TileSprite#tilePositionX} and {@link Phaser.GameObjects.TileSprite#tilePositionY}. + * @param x The x position of this sprite's tiling texture. + * @param y The y position of this sprite's tiling texture. + */ + setTilePosition(x?: number, y?: number): this; + + /** + * Sets {@link Phaser.GameObjects.TileSprite#tileScaleX} and {@link Phaser.GameObjects.TileSprite#tileScaleY}. + * @param x The horizontal scale of the tiling texture. If not given it will use the current `tileScaleX` value. + * @param y The vertical scale of the tiling texture. If not given it will use the `x` value. Default x. + */ + setTileScale(x?: number, y?: number): this; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * The horizontal scroll position of the Tile Sprite. + */ + tilePositionX: number; + + /** + * The vertical scroll position of the Tile Sprite. + */ + tilePositionY: number; + + /** + * The horizontal scale of the Tile Sprite texture. + */ + tileScaleX: number; + + /** + * The vertical scale of the Tile Sprite texture. + */ + tileScaleY: number; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Update List plugin. + * + * Update Lists belong to a Scene and maintain the list Game Objects to be updated every frame. + * + * Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering. + */ + class UpdateList { + /** + * + * @param scene The Scene that the Update List belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene that the Update List belongs to. + */ + scene: Phaser.Scene; + + /** + * The Scene's Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * Add a Game Object to the Update List. + * @param child The Game Object to add. + */ + add(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.GameObject; + + /** + * The pre-update step. + * + * Handles Game Objects that are pending insertion to and removal from the list. + */ + preUpdate(): void; + + /** + * The update step. + * + * Pre-updates every active Game Object in the list. + * @param time The current timestamp. + * @param delta The delta time elapsed since the last frame. + */ + update(time: number, delta: number): void; + + /** + * Remove a Game Object from the list. + * @param child The Game Object to remove from the list. + */ + remove(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.GameObject; + + /** + * Remove all Game Objects from the list. + */ + removeAll(): Phaser.GameObjects.UpdateList; + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + */ + shutdown(): void; + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + */ + destroy(): void; + + /** + * The length of the list. + */ + readonly length: integer; + + } + + /** + * A Zone Game Object. + * + * A Zone is a non-rendering rectangular Game Object that has a position and size. + * It has no texture and never displays, but does live on the display list and + * can be moved, scaled and rotated like any other Game Object. + * + * Its primary use is for creating Drop Zones and Input Hit Areas and it has a couple of helper methods + * specifically for this. It is also useful for object overlap checks, or as a base for your own + * non-displaying Game Objects. + * The default origin is 0.5, the center of the Zone, the same as with Game Objects. + */ + class Zone extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. Default 1. + * @param height The height of the Game Object. Default 1. + */ + constructor(scene: Phaser.Scene, x: number, y: number, width?: number, height?: number); + + /** + * The native (un-scaled) width of this Game Object. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + */ + height: number; + + /** + * The Blend Mode of the Game Object. + * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into + * display lists without causing a batch flush. + */ + blendMode: integer; + + /** + * The displayed width of this Game Object. + * This value takes into account the scale factor. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * This value takes into account the scale factor. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + * @param resizeInput If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. Default true. + */ + setSize(width: number, height: number, resizeInput?: boolean): Phaser.GameObjects.Zone; + + /** + * Sets the display size of this Game Object. + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): Phaser.GameObjects.Zone; + + /** + * Sets this Zone to be a Circular Drop Zone. + * The circle is centered on this Zones `x` and `y` coordinates. + * @param radius The radius of the Circle that will form the Drop Zone. + */ + setCircleDropZone(radius: number): Phaser.GameObjects.Zone; + + /** + * Sets this Zone to be a Rectangle Drop Zone. + * The rectangle is centered on this Zones `x` and `y` coordinates. + * @param width The width of the rectangle drop zone. + * @param height The height of the rectangle drop zone. + */ + setRectangleDropZone(width: number, height: number): Phaser.GameObjects.Zone; + + /** + * Allows you to define your own Geometry shape to be used as a Drop Zone. + * @param shape A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. + * @param callback A function that will return `true` if the given x/y coords it is sent are within the shape. + */ + setDropZone(shape: object, callback: Phaser.Types.Input.HitAreaCallback): Phaser.GameObjects.Zone; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + } + + namespace Geom { + /** + * A Circle object. + * + * This is a geometry object, containing numerical values and related methods to inspect and modify them. + * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. + * To render a Circle you should look at the capabilities of the Graphics class. + */ + class Circle { + /** + * + * @param x The x position of the center of the circle. Default 0. + * @param y The y position of the center of the circle. Default 0. + * @param radius The radius of the circle. Default 0. + */ + constructor(x?: number, y?: number, radius?: number); + + /** + * Calculates the area of the circle. + * @param circle The Circle to get the area of. + */ + static Area(circle: Phaser.Geom.Circle): number; + + /** + * The x position of the center of the circle. + */ + x: number; + + /** + * The y position of the center of the circle. + */ + y: number; + + /** + * Check to see if the Circle contains the given x / y coordinates. + * @param x The x coordinate to check within the circle. + * @param y The y coordinate to check within the circle. + */ + contains(x: number, y: number): boolean; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Circle + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * @param position A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle. + * @param out An object to store the return values in. If not given a Point object will be created. + */ + getPoint(position: number, out?: O): O; + + /** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle, + * based on the given quantity or stepRate values. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. + * @param output An array to insert the points in to. If not provided a new array will be created. + */ + getPoints(quantity: integer, stepRate?: number, output?: O): O; + + /** + * Returns a uniformly distributed random point from anywhere within the Circle. + * @param point A Point or point-like object to set the random `x` and `y` values in. + */ + getRandomPoint(point?: O): O; + + /** + * Sets the x, y and radius of this circle. + * @param x The x position of the center of the circle. Default 0. + * @param y The y position of the center of the circle. Default 0. + * @param radius The radius of the circle. Default 0. + */ + setTo(x?: number, y?: number, radius?: number): Phaser.Geom.Circle; + + /** + * Sets this Circle to be empty with a radius of zero. + * Does not change its position. + */ + setEmpty(): Phaser.Geom.Circle; + + /** + * Sets the position of this Circle. + * @param x The x position of the center of the circle. Default 0. + * @param y The y position of the center of the circle. Default 0. + */ + setPosition(x?: number, y?: number): Phaser.Geom.Circle; + + /** + * Checks to see if the Circle is empty: has a radius of zero. + */ + isEmpty(): boolean; + + /** + * The radius of the Circle. + */ + radius: number; + + /** + * The diameter of the Circle. + */ + diameter: number; + + /** + * The left position of the Circle. + */ + left: number; + + /** + * The right position of the Circle. + */ + right: number; + + /** + * The top position of the Circle. + */ + top: number; + + /** + * The bottom position of the Circle. + */ + bottom: number; + + /** + * Returns the circumference of the given Circle. + * @param circle The Circle to get the circumference of. + */ + static Circumference(circle: Phaser.Geom.Circle): number; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle. + * @param circle The Circle to get the circumference point on. + * @param angle The angle from the center of the Circle to the circumference to return the point from. Given in radians. + * @param out A Point, or point-like object, to store the results in. If not given a Point will be created. + */ + static CircumferencePoint(circle: Phaser.Geom.Circle, angle: number, out?: O): O; + + /** + * Creates a new Circle instance based on the values contained in the given source. + * @param source The Circle to be cloned. Can be an instance of a Circle or a circle-like object, with x, y and radius properties. + */ + static Clone(source: Phaser.Geom.Circle | object): Phaser.Geom.Circle; + + /** + * Check to see if the Circle contains the given x / y coordinates. + * @param circle The Circle to check. + * @param x The x coordinate to check within the circle. + * @param y The y coordinate to check within the circle. + */ + static Contains(circle: Phaser.Geom.Circle, x: number, y: number): boolean; + + /** + * Check to see if the Circle contains the given Point object. + * @param circle The Circle to check. + * @param point The Point object to check if it's within the Circle or not. + */ + static ContainsPoint(circle: Phaser.Geom.Circle, point: Phaser.Geom.Point | object): boolean; + + /** + * Check to see if the Circle contains all four points of the given Rectangle object. + * @param circle The Circle to check. + * @param rect The Rectangle object to check if it's within the Circle or not. + */ + static ContainsRect(circle: Phaser.Geom.Circle, rect: Phaser.Geom.Rectangle | object): boolean; + + /** + * Copies the `x`, `y` and `radius` properties from the `source` Circle + * into the given `dest` Circle, then returns the `dest` Circle. + * @param source The source Circle to copy the values from. + * @param dest The destination Circle to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Circle, dest: O): O; + + /** + * Compares the `x`, `y` and `radius` properties of the two given Circles. + * Returns `true` if they all match, otherwise returns `false`. + * @param circle The first Circle to compare. + * @param toCompare The second Circle to compare. + */ + static Equals(circle: Phaser.Geom.Circle, toCompare: Phaser.Geom.Circle): boolean; + + /** + * Returns the bounds of the Circle object. + * @param circle The Circle to get the bounds from. + * @param out A Rectangle, or rectangle-like object, to store the circle bounds in. If not given a new Rectangle will be created. + */ + static GetBounds(circle: Phaser.Geom.Circle, out?: O): O; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Circle + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * @param circle The Circle to get the circumference point on. + * @param position A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle. + * @param out An object to store the return values in. If not given a Point object will be created. + */ + static GetPoint(circle: Phaser.Geom.Circle, position: number, out?: O): O; + + /** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle, + * based on the given quantity or stepRate values. + * @param circle The Circle to get the points from. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. + * @param output An array to insert the points in to. If not provided a new array will be created. + */ + static GetPoints(circle: Phaser.Geom.Circle, quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + + /** + * Offsets the Circle by the values given. + * @param circle The Circle to be offset (translated.) + * @param x The amount to horizontally offset the Circle by. + * @param y The amount to vertically offset the Circle by. + */ + static Offset(circle: O, x: number, y: number): O; + + /** + * Offsets the Circle by the values given in the `x` and `y` properties of the Point object. + * @param circle The Circle to be offset (translated.) + * @param point The Point object containing the values to offset the Circle by. + */ + static OffsetPoint(circle: O, point: Phaser.Geom.Point | object): O; + + /** + * Returns a uniformly distributed random point from anywhere within the given Circle. + * @param circle The Circle to get a random point from. + * @param out A Point or point-like object to set the random `x` and `y` values in. + */ + static Random(circle: Phaser.Geom.Circle, out?: O): O; + + } + + /** + * An Ellipse object. + * + * This is a geometry object, containing numerical values and related methods to inspect and modify them. + * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. + * To render an Ellipse you should look at the capabilities of the Graphics class. + */ + class Ellipse { + /** + * + * @param x The x position of the center of the ellipse. Default 0. + * @param y The y position of the center of the ellipse. Default 0. + * @param width The width of the ellipse. Default 0. + * @param height The height of the ellipse. Default 0. + */ + constructor(x?: number, y?: number, width?: number, height?: number); + + /** + * Calculates the area of the Ellipse. + * @param ellipse The Ellipse to get the area of. + */ + static Area(ellipse: Phaser.Geom.Ellipse): number; + + /** + * Returns the circumference of the given Ellipse. + * @param ellipse The Ellipse to get the circumference of. + */ + static Circumference(ellipse: Phaser.Geom.Ellipse): number; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse based on the given angle. + * @param ellipse The Ellipse to get the circumference point on. + * @param angle The angle from the center of the Ellipse to the circumference to return the point from. Given in radians. + * @param out A Point, or point-like object, to store the results in. If not given a Point will be created. + */ + static CircumferencePoint(ellipse: Phaser.Geom.Ellipse, angle: number, out?: O): O; + + /** + * Creates a new Ellipse instance based on the values contained in the given source. + * @param source The Ellipse to be cloned. Can be an instance of an Ellipse or a ellipse-like object, with x, y, width and height properties. + */ + static Clone(source: Phaser.Geom.Ellipse): Phaser.Geom.Ellipse; + + /** + * Check to see if the Ellipse contains the given x / y coordinates. + * @param ellipse The Ellipse to check. + * @param x The x coordinate to check within the ellipse. + * @param y The y coordinate to check within the ellipse. + */ + static Contains(ellipse: Phaser.Geom.Ellipse, x: number, y: number): boolean; + + /** + * Check to see if the Ellipse contains the given Point object. + * @param ellipse The Ellipse to check. + * @param point The Point object to check if it's within the Circle or not. + */ + static ContainsPoint(ellipse: Phaser.Geom.Ellipse, point: Phaser.Geom.Point | object): boolean; + + /** + * Check to see if the Ellipse contains all four points of the given Rectangle object. + * @param ellipse The Ellipse to check. + * @param rect The Rectangle object to check if it's within the Ellipse or not. + */ + static ContainsRect(ellipse: Phaser.Geom.Ellipse, rect: Phaser.Geom.Rectangle | object): boolean; + + /** + * Copies the `x`, `y`, `width` and `height` properties from the `source` Ellipse + * into the given `dest` Ellipse, then returns the `dest` Ellipse. + * @param source The source Ellipse to copy the values from. + * @param dest The destination Ellipse to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Ellipse, dest: O): O; + + /** + * The x position of the center of the ellipse. + */ + x: number; + + /** + * The y position of the center of the ellipse. + */ + y: number; + + /** + * The width of the ellipse. + */ + width: number; + + /** + * The height of the ellipse. + */ + height: number; + + /** + * Check to see if the Ellipse contains the given x / y coordinates. + * @param x The x coordinate to check within the ellipse. + * @param y The y coordinate to check within the ellipse. + */ + contains(x: number, y: number): boolean; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * @param position A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse. + * @param out An object to store the return values in. If not given a Point object will be created. + */ + getPoint(position: number, out?: O): O; + + /** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse, + * based on the given quantity or stepRate values. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. + * @param output An array to insert the points in to. If not provided a new array will be created. + */ + getPoints(quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + + /** + * Returns a uniformly distributed random point from anywhere within the given Ellipse. + * @param point A Point or point-like object to set the random `x` and `y` values in. + */ + getRandomPoint(point?: O): O; + + /** + * Sets the x, y, width and height of this ellipse. + * @param x The x position of the center of the ellipse. + * @param y The y position of the center of the ellipse. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + */ + setTo(x: number, y: number, width: number, height: number): Phaser.Geom.Ellipse; + + /** + * Sets this Ellipse to be empty with a width and height of zero. + * Does not change its position. + */ + setEmpty(): Phaser.Geom.Ellipse; + + /** + * Sets the position of this Ellipse. + * @param x The x position of the center of the ellipse. + * @param y The y position of the center of the ellipse. + */ + setPosition(x: number, y: number): Phaser.Geom.Ellipse; + + /** + * Sets the size of this Ellipse. + * Does not change its position. + * @param width The width of the ellipse. + * @param height The height of the ellipse. Default width. + */ + setSize(width: number, height?: number): Phaser.Geom.Ellipse; + + /** + * Checks to see if the Ellipse is empty: has a width or height equal to zero. + */ + isEmpty(): boolean; + + /** + * Returns the minor radius of the ellipse. Also known as the Semi Minor Axis. + */ + getMinorRadius(): number; + + /** + * Returns the major radius of the ellipse. Also known as the Semi Major Axis. + */ + getMajorRadius(): number; + + /** + * The left position of the Ellipse. + */ + left: number; + + /** + * The right position of the Ellipse. + */ + right: number; + + /** + * The top position of the Ellipse. + */ + top: number; + + /** + * The bottom position of the Ellipse. + */ + bottom: number; + + /** + * Compares the `x`, `y`, `width` and `height` properties of the two given Ellipses. + * Returns `true` if they all match, otherwise returns `false`. + * @param ellipse The first Ellipse to compare. + * @param toCompare The second Ellipse to compare. + */ + static Equals(ellipse: Phaser.Geom.Ellipse, toCompare: Phaser.Geom.Ellipse): boolean; + + /** + * Returns the bounds of the Ellipse object. + * @param ellipse The Ellipse to get the bounds from. + * @param out A Rectangle, or rectangle-like object, to store the ellipse bounds in. If not given a new Rectangle will be created. + */ + static GetBounds(ellipse: Phaser.Geom.Ellipse, out?: O): O; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * @param ellipse The Ellipse to get the circumference point on. + * @param position A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse. + * @param out An object to store the return values in. If not given a Point object will be created. + */ + static GetPoint(ellipse: Phaser.Geom.Ellipse, position: number, out?: O): O; + + /** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse, + * based on the given quantity or stepRate values. + * @param ellipse The Ellipse to get the points from. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. + * @param out An array to insert the points in to. If not provided a new array will be created. + */ + static GetPoints(ellipse: Phaser.Geom.Ellipse, quantity: integer, stepRate?: number, out?: O): O; + + /** + * Offsets the Ellipse by the values given. + * @param ellipse The Ellipse to be offset (translated.) + * @param x The amount to horizontally offset the Ellipse by. + * @param y The amount to vertically offset the Ellipse by. + */ + static Offset(ellipse: O, x: number, y: number): O; + + /** + * Offsets the Ellipse by the values given in the `x` and `y` properties of the Point object. + * @param ellipse The Ellipse to be offset (translated.) + * @param point The Point object containing the values to offset the Ellipse by. + */ + static OffsetPoint(ellipse: O, point: Phaser.Geom.Point | object): O; + + /** + * Returns a uniformly distributed random point from anywhere within the given Ellipse. + * @param ellipse The Ellipse to get a random point from. + * @param out A Point or point-like object to set the random `x` and `y` values in. + */ + static Random(ellipse: Phaser.Geom.Ellipse, out?: O): O; + + } + + namespace Intersects { + /** + * Checks if two Circles intersect. + * @param circleA The first Circle to check for intersection. + * @param circleB The second Circle to check for intersection. + */ + function CircleToCircle(circleA: Phaser.Geom.Circle, circleB: Phaser.Geom.Circle): boolean; + + /** + * Checks for intersection between a circle and a rectangle. + * @param circle The circle to be checked. + * @param rect The rectangle to be checked. + */ + function CircleToRectangle(circle: Phaser.Geom.Circle, rect: Phaser.Geom.Rectangle): boolean; + + /** + * Checks if two Circles intersect and returns the intersection points as a Point object array. + * @param circleA The first Circle to check for intersection. + * @param circleB The second Circle to check for intersection. + * @param out An optional array in which to store the points of intersection. + */ + function GetCircleToCircle(circleA: Phaser.Geom.Circle, circleB: Phaser.Geom.Circle, out?: any[]): any[]; + + /** + * Checks for intersection between a circle and a rectangle, + * and returns the intersection points as a Point object array. + * @param circle The circle to be checked. + * @param rect The rectangle to be checked. + * @param out An optional array in which to store the points of intersection. + */ + function GetCircleToRectangle(circle: Phaser.Geom.Circle, rect: Phaser.Geom.Rectangle, out?: any[]): any[]; + + /** + * Checks for intersection between the line segment and circle, + * and returns the intersection points as a Point object array. + * @param line The line segment to check. + * @param circle The circle to check against the line. + * @param out An optional array in which to store the points of intersection. + */ + function GetLineToCircle(line: Phaser.Geom.Line, circle: Phaser.Geom.Circle, out?: any[]): any[]; + + /** + * Checks for intersection between the Line and a Rectangle shape, + * and returns the intersection points as a Point object array. + * @param line The Line to check for intersection. + * @param rect The Rectangle to check for intersection. + * @param out An optional array in which to store the points of intersection. + */ + function GetLineToRectangle(line: Phaser.Geom.Line, rect: Phaser.Geom.Rectangle | object, out?: any[]): any[]; + + /** + * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. + * + * If optional `output` parameter is omitted, new Rectangle object is created and returned. If there is intersection, it will contain intersection area. If there is no intersection, it wil be empty Rectangle (all values set to zero). + * + * If Rectangle object is passed as `output` and there is intersection, then intersection area data will be loaded into it and it will be returned. If there is no intersetion, it will be returned without any change. + * @param rectA The first Rectangle object. + * @param rectB The second Rectangle object. + * @param output Optional Rectangle object. If given, the intersection data will be loaded into it (in case of no intersection, it will be left unchanged). Otherwise, new Rectangle object will be created and returned with either intersection data or empty (all values set to zero), if there is no intersection. + */ + function GetRectangleIntersection(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, output?: O): O; + + /** + * Checks if two Rectangles intersect and returns the intersection points as a Point object array. + * + * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle. + * @param rectA The first Rectangle to check for intersection. + * @param rectB The second Rectangle to check for intersection. + * @param out An optional array in which to store the points of intersection. + */ + function GetRectangleToRectangle(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: any[]): any[]; + + /** + * Checks for intersection between Rectangle shape and Triangle shape, + * and returns the intersection points as a Point object array. + * @param rect Rectangle object to test. + * @param triangle Triangle object to test. + * @param out An optional array in which to store the points of intersection. + */ + function GetRectangleToTriangle(rect: Phaser.Geom.Rectangle, triangle: Phaser.Geom.Triangle, out?: any[]): any[]; + + /** + * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array. + * + * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection. + * @param triangle The Triangle to check for intersection. + * @param circle The Circle to check for intersection. + * @param out An optional array in which to store the points of intersection. + */ + function GetTriangleToCircle(triangle: Phaser.Geom.Triangle, circle: Phaser.Geom.Circle, out?: any[]): any[]; + + /** + * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array. + * + * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". + * @param triangle The Triangle to check with. + * @param line The Line to check with. + * @param out An optional array in which to store the points of intersection. + */ + function GetTriangleToLine(triangle: Phaser.Geom.Triangle, line: Phaser.Geom.Line, out?: any[]): any[]; + + /** + * Checks if two Triangles intersect, and returns the intersection points as a Point object array. + * + * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid". + * @param triangleA The first Triangle to check for intersection. + * @param triangleB The second Triangle to check for intersection. + * @param out An optional array in which to store the points of intersection. + */ + function GetTriangleToTriangle(triangleA: Phaser.Geom.Triangle, triangleB: Phaser.Geom.Triangle, out?: any[]): any[]; + + /** + * Checks for intersection between the line segment and circle. + * + * Based on code by [Matt DesLauriers](https://github.com/mattdesl/line-circle-collision/blob/master/LICENSE.md). + * @param line The line segment to check. + * @param circle The circle to check against the line. + * @param nearest An optional Point-like object. If given the closest point on the Line where the circle intersects will be stored in this object. + */ + function LineToCircle(line: Phaser.Geom.Line, circle: Phaser.Geom.Circle, nearest?: Phaser.Geom.Point | any): boolean; + + /** + * Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting. + * @param line1 The first Line to check. + * @param line2 The second Line to check. + * @param out A Point in which to optionally store the point of intersection. + */ + function LineToLine(line1: Phaser.Geom.Line, line2: Phaser.Geom.Line, out?: Phaser.Geom.Point): boolean; + + /** + * Checks for intersection between the Line and a Rectangle shape, or a rectangle-like + * object, with public `x`, `y`, `right` and `bottom` properties, such as a Sprite or Body. + * + * An intersection is considered valid if: + * + * The line starts within, or ends within, the Rectangle. + * The line segment intersects one of the 4 rectangle edges. + * + * The for the purposes of this function rectangles are considered 'solid'. + * @param line The Line to check for intersection. + * @param rect The Rectangle to check for intersection. + */ + function LineToRectangle(line: Phaser.Geom.Line, rect: Phaser.Geom.Rectangle | object): boolean; + + /** + * Checks if the a Point falls between the two end-points of a Line, based on the given line thickness. + * + * Assumes that the line end points are circular, not square. + * @param point The point, or point-like object to check. + * @param line The line segment to test for intersection on. + * @param lineThickness The line thickness. Assumes that the line end points are circular. Default 1. + */ + function PointToLine(point: Phaser.Geom.Point | any, line: Phaser.Geom.Line, lineThickness?: number): boolean; + + /** + * Checks if a Point is located on the given line segment. + * @param point The Point to check for intersection. + * @param line The line segment to check for intersection. + */ + function PointToLineSegment(point: Phaser.Geom.Point, line: Phaser.Geom.Line): boolean; + + /** + * Checks if two Rectangles intersect. + * + * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle. + * @param rectA The first Rectangle to check for intersection. + * @param rectB The second Rectangle to check for intersection. + */ + function RectangleToRectangle(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle): boolean; + + /** + * Checks for intersection between Rectangle shape and Triangle shape. + * @param rect Rectangle object to test. + * @param triangle Triangle object to test. + */ + function RectangleToTriangle(rect: Phaser.Geom.Rectangle, triangle: Phaser.Geom.Triangle): boolean; + + /** + * Check if rectangle intersects with values. + * @param rect The rectangle object + * @param left The x coordinate of the left of the Rectangle. + * @param right The x coordinate of the right of the Rectangle. + * @param top The y coordinate of the top of the Rectangle. + * @param bottom The y coordinate of the bottom of the Rectangle. + * @param tolerance Tolerance allowed in the calculation, expressed in pixels. Default 0. + */ + function RectangleToValues(rect: Phaser.Geom.Rectangle, left: number, right: number, top: number, bottom: number, tolerance?: number): boolean; + + /** + * Checks if a Triangle and a Circle intersect. + * + * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection. + * @param triangle The Triangle to check for intersection. + * @param circle The Circle to check for intersection. + */ + function TriangleToCircle(triangle: Phaser.Geom.Triangle, circle: Phaser.Geom.Circle): boolean; + + /** + * Checks if a Triangle and a Line intersect. + * + * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". + * @param triangle The Triangle to check with. + * @param line The Line to check with. + */ + function TriangleToLine(triangle: Phaser.Geom.Triangle, line: Phaser.Geom.Line): boolean; + + /** + * Checks if two Triangles intersect. + * + * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid". + * @param triangleA The first Triangle to check for intersection. + * @param triangleB The second Triangle to check for intersection. + */ + function TriangleToTriangle(triangleA: Phaser.Geom.Triangle, triangleB: Phaser.Geom.Triangle): boolean; + + } + + /** + * Defines a Line segment, a part of a line between two endpoints. + */ + class Line { + /** + * + * @param x1 The x coordinate of the lines starting point. Default 0. + * @param y1 The y coordinate of the lines starting point. Default 0. + * @param x2 The x coordinate of the lines ending point. Default 0. + * @param y2 The y coordinate of the lines ending point. Default 0. + */ + constructor(x1?: number, y1?: number, x2?: number, y2?: number); + + /** + * Calculate the angle of the line in radians. + * @param line The line to calculate the angle of. + */ + static Angle(line: Phaser.Geom.Line): number; + + /** + * Using Bresenham's line algorithm this will return an array of all coordinates on this line. + * + * The `start` and `end` points are rounded before this runs as the algorithm works on integers. + * @param line The line. + * @param stepRate The optional step rate for the points on the line. Default 1. + * @param results An optional array to push the resulting coordinates into. + */ + static BresenhamPoints(line: Phaser.Geom.Line, stepRate?: integer, results?: any[]): object[]; + + /** + * Center a line on the given coordinates. + * @param line The line to center. + * @param x The horizontal coordinate to center the line on. + * @param y The vertical coordinate to center the line on. + */ + static CenterOn(line: Phaser.Geom.Line, x: number, y: number): Phaser.Geom.Line; + + /** + * Clone the given line. + * @param source The source line to clone. + */ + static Clone(source: Phaser.Geom.Line): Phaser.Geom.Line; + + /** + * Copy the values of one line to a destination line. + * @param source The source line to copy the values from. + * @param dest The destination line to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Line, dest: O): O; + + /** + * Compare two lines for strict equality. + * @param line The first line to compare. + * @param toCompare The second line to compare. + */ + static Equals(line: Phaser.Geom.Line, toCompare: Phaser.Geom.Line): boolean; + + /** + * Extends the start and end points of a Line by the given amounts. + * + * The amounts can be positive or negative. Positive points will increase the length of the line, + * while negative ones will decrease it. + * + * If no `right` value is provided it will extend the length of the line equally in both directions. + * + * Pass a value of zero to leave the start or end point unchanged. + * @param line The line instance to extend. + * @param left The amount to extend the start of the line by. + * @param right The amount to extend the end of the line by. If not given it will be set to the `left` value. + */ + static Extend(line: Phaser.Geom.Line, left: number, right?: number): Phaser.Geom.Line; + + /** + * Get the midpoint of the given line. + * @param line The line to get the midpoint of. + * @param out An optional point object to store the midpoint in. + */ + static GetMidPoint(line: Phaser.Geom.Line, out?: O): O; + + /** + * Get the nearest point on a line perpendicular to the given point. + * @param line The line to get the nearest point on. + * @param point The point to get the nearest point to. + * @param out An optional point, or point-like object, to store the coordinates of the nearest point on the line. + */ + static GetNearestPoint(line: Phaser.Geom.Line, point: Phaser.Geom.Point | object, out?: O): O; + + /** + * Calculate the normal of the given line. + * + * The normal of a line is a vector that points perpendicular from it. + * @param line The line to calculate the normal of. + * @param out An optional point object to store the normal in. + */ + static GetNormal(line: Phaser.Geom.Line, out?: O): O; + + /** + * Get a point on a line that's a given percentage along its length. + * @param line The line. + * @param position A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. + * @param out An optional point, or point-like object, to store the coordinates of the point on the line. + */ + static GetPoint(line: Phaser.Geom.Line, position: number, out?: O): O; + + /** + * Get a number of points along a line's length. + * + * Provide a `quantity` to get an exact number of points along the line. + * + * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when + * providing a `stepRate`. + * @param line The line. + * @param quantity The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param stepRate The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param out An optional array of Points, or point-like objects, to store the coordinates of the points on the line. + */ + static GetPoints(line: Phaser.Geom.Line, quantity: integer, stepRate?: number, out?: O): O; + + /** + * Get the shortest distance from a Line to the given Point. + * @param line The line to get the distance from. + * @param point The point to get the shortest distance to. + */ + static GetShortestDistance(line: Phaser.Geom.Line, point: Phaser.Geom.Point | object): O; + + /** + * Calculate the height of the given line. + * @param line The line to calculate the height of. + */ + static Height(line: Phaser.Geom.Line): number; + + /** + * Calculate the length of the given line. + * @param line The line to calculate the length of. + */ + static Length(line: Phaser.Geom.Line): number; + + /** + * The x coordinate of the lines starting point. + */ + x1: number; + + /** + * The y coordinate of the lines starting point. + */ + y1: number; + + /** + * The x coordinate of the lines ending point. + */ + x2: number; + + /** + * The y coordinate of the lines ending point. + */ + y2: number; + + /** + * Get a point on a line that's a given percentage along its length. + * @param position A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. + * @param output An optional point, or point-like object, to store the coordinates of the point on the line. + */ + getPoint(position: number, output?: O): O; + + /** + * Get a number of points along a line's length. + * + * Provide a `quantity` to get an exact number of points along the line. + * + * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when + * providing a `stepRate`. + * @param quantity The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param stepRate The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param output An optional array of Points, or point-like objects, to store the coordinates of the points on the line. + */ + getPoints(quantity: integer, stepRate?: integer, output?: O): O; + + /** + * Get a random Point on the Line. + * @param point An instance of a Point to be modified. + */ + getRandomPoint(point?: O): O; + + /** + * Set new coordinates for the line endpoints. + * @param x1 The x coordinate of the lines starting point. Default 0. + * @param y1 The y coordinate of the lines starting point. Default 0. + * @param x2 The x coordinate of the lines ending point. Default 0. + * @param y2 The y coordinate of the lines ending point. Default 0. + */ + setTo(x1?: number, y1?: number, x2?: number, y2?: number): Phaser.Geom.Line; + + /** + * Returns a Vector2 object that corresponds to the start of this Line. + * @param vec2 A Vector2 object to set the results in. If `undefined` a new Vector2 will be created. + */ + getPointA(vec2?: O): O; + + /** + * Returns a Vector2 object that corresponds to the end of this Line. + * @param vec2 A Vector2 object to set the results in. If `undefined` a new Vector2 will be created. + */ + getPointB(vec2?: O): O; + + /** + * The left position of the Line. + */ + left: number; + + /** + * The right position of the Line. + */ + right: number; + + /** + * The top position of the Line. + */ + top: number; + + /** + * The bottom position of the Line. + */ + bottom: number; + + /** + * Get the angle of the normal of the given line in radians. + * @param line The line to calculate the angle of the normal of. + */ + static NormalAngle(line: Phaser.Geom.Line): number; + + /** + * [description] + * @param line The Line object to get the normal value from. + */ + static NormalX(line: Phaser.Geom.Line): number; + + /** + * The Y value of the normal of the given line. + * The normal of a line is a vector that points perpendicular from it. + * @param line The line to calculate the normal of. + */ + static NormalY(line: Phaser.Geom.Line): number; + + /** + * Offset a line by the given amount. + * @param line The line to offset. + * @param x The horizontal offset to add to the line. + * @param y The vertical offset to add to the line. + */ + static Offset(line: O, x: number, y: number): O; + + /** + * Calculate the perpendicular slope of the given line. + * @param line The line to calculate the perpendicular slope of. + */ + static PerpSlope(line: Phaser.Geom.Line): number; + + /** + * Returns a random point on a given Line. + * @param line The Line to calculate the random Point on. + * @param out An instance of a Point to be modified. + */ + static Random(line: Phaser.Geom.Line, out?: O): O; + + /** + * Calculate the reflected angle between two lines. + * + * This is the outgoing angle based on the angle of Line 1 and the normalAngle of Line 2. + * @param lineA The first line. + * @param lineB The second line. + */ + static ReflectAngle(lineA: Phaser.Geom.Line, lineB: Phaser.Geom.Line): number; + + /** + * Rotate a line around its midpoint by the given angle in radians. + * @param line The line to rotate. + * @param angle The angle of rotation in radians. + */ + static Rotate(line: O, angle: number): O; + + /** + * Rotate a line around a point by the given angle in radians. + * @param line The line to rotate. + * @param point The point to rotate the line around. + * @param angle The angle of rotation in radians. + */ + static RotateAroundPoint(line: O, point: Phaser.Geom.Point | object, angle: number): O; + + /** + * Rotate a line around the given coordinates by the given angle in radians. + * @param line The line to rotate. + * @param x The horizontal coordinate to rotate the line around. + * @param y The vertical coordinate to rotate the line around. + * @param angle The angle of rotation in radians. + */ + static RotateAroundXY(line: O, x: number, y: number, angle: number): O; + + /** + * Set a line to a given position, angle and length. + * @param line The line to set. + * @param x The horizontal start position of the line. + * @param y The vertical start position of the line. + * @param angle The angle of the line in radians. + * @param length The length of the line. + */ + static SetToAngle(line: O, x: number, y: number, angle: number, length: number): O; + + /** + * Calculate the slope of the given line. + * @param line The line to calculate the slope of. + */ + static Slope(line: Phaser.Geom.Line): number; + + /** + * Calculate the width of the given line. + * @param line The line to calculate the width of. + */ + static Width(line: Phaser.Geom.Line): number; + + } + + /** + * Defines a Point in 2D space, with an x and y component. + */ + class Point { + /** + * + * @param x The x coordinate of this Point. Default 0. + * @param y The y coordinate of this Point. Default x. + */ + constructor(x?: number, y?: number); + + /** + * Apply `Math.ceil()` to each coordinate of the given Point. + * @param point The Point to ceil. + */ + static Ceil(point: O): O; + + /** + * Clone the given Point. + * @param source The source Point to clone. + */ + static Clone(source: Phaser.Geom.Point): Phaser.Geom.Point; + + /** + * Copy the values of one Point to a destination Point. + * @param source The source Point to copy the values from. + * @param dest The destination Point to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Point, dest: O): O; + + /** + * A comparison of two `Point` objects to see if they are equal. + * @param point The original `Point` to compare against. + * @param toCompare The second `Point` to compare. + */ + static Equals(point: Phaser.Geom.Point, toCompare: Phaser.Geom.Point): boolean; + + /** + * Apply `Math.ceil()` to each coordinate of the given Point. + * @param point The Point to floor. + */ + static Floor(point: O): O; + + /** + * Get the centroid or geometric center of a plane figure (the arithmetic mean position of all the points in the figure). + * Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin. + * @param points [description] + * @param out [description] + */ + static GetCentroid(points: Phaser.Geom.Point[], out?: O): O; + + /** + * Calculate the magnitude of the point, which equivalent to the length of the line from the origin to this point. + * @param point The point to calculate the magnitude for + */ + static GetMagnitude(point: Phaser.Geom.Point): number; + + /** + * Calculates the square of magnitude of given point.(Can be used for fast magnitude calculation of point) + * @param point Returns square of the magnitude/length of given point. + */ + static GetMagnitudeSq(point: Phaser.Geom.Point): number; + + /** + * Calculates the Axis Aligned Bounding Box (or aabb) from an array of points. + * @param points [description] + * @param out [description] + */ + static GetRectangleFromPoints(points: Phaser.Geom.Point[], out?: O): O; + + /** + * [description] + * @param pointA The starting `Point` for the interpolation. + * @param pointB The target `Point` for the interpolation. + * @param t The amount to interpolate between the two points. Generally, a value between 0 (returns the starting `Point`) and 1 (returns the target `Point`). If omitted, 0 is used. Default 0. + * @param out An optional `Point` object whose `x` and `y` values will be set to the result of the interpolation (can also be any object with `x` and `y` properties). If omitted, a new `Point` created and returned. + */ + static Interpolate(pointA: Phaser.Geom.Point, pointB: Phaser.Geom.Point, t?: number, out?: O): O; + + /** + * Swaps the X and the Y coordinate of a point. + * @param point The Point to modify. + */ + static Invert(point: O): O; + + /** + * Inverts a Point's coordinates. + * @param point The Point to invert. + * @param out The Point to return the inverted coordinates in. + */ + static Negative(point: Phaser.Geom.Point, out?: O): O; + + /** + * The x coordinate of this Point. + */ + x: number; + + /** + * The y coordinate of this Point. + */ + y: number; + + /** + * Set the x and y coordinates of the point to the given values. + * @param x The x coordinate of this Point. Default 0. + * @param y The y coordinate of this Point. Default x. + */ + setTo(x?: number, y?: number): Phaser.Geom.Point; + + /** + * [description] + * @param pointA [description] + * @param pointB [description] + * @param out [description] + */ + static Project(pointA: Phaser.Geom.Point, pointB: Phaser.Geom.Point, out?: O): O; + + /** + * [description] + * @param pointA [description] + * @param pointB [description] + * @param out [description] + */ + static ProjectUnit(pointA: Phaser.Geom.Point, pointB: Phaser.Geom.Point, out?: O): O; + + /** + * Changes the magnitude (length) of a two-dimensional vector without changing its direction. + * @param point The Point to treat as the end point of the vector. + * @param magnitude The new magnitude of the vector. + */ + static SetMagnitude(point: O, magnitude: number): O; + + } + + /** + * A Polygon object + * + * The polygon is a closed shape consists of a series of connected straight lines defined by list of ordered points. + * Several formats are supported to define the list of points, check the setTo method for details. + * This is a geometry object allowing you to define and inspect the shape. + * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. + * To render a Polygon you should look at the capabilities of the Graphics class. + */ + class Polygon { + /** + * + * @param points List of points defining the perimeter of this Polygon. Several formats are supported: + * - A string containing paired x y values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` + * - An array of objects with public x y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + */ + constructor(points?: Phaser.Geom.Point[]); + + /** + * Create a new polygon which is a copy of the specified polygon + * @param polygon The polygon to create a clone of + */ + static Clone(polygon: Phaser.Geom.Polygon): Phaser.Geom.Polygon; + + /** + * Checks if a point is within the bounds of a Polygon. + * @param polygon The Polygon to check against. + * @param x The X coordinate of the point to check. + * @param y The Y coordinate of the point to check. + */ + static Contains(polygon: Phaser.Geom.Polygon, x: number, y: number): boolean; + + /** + * [description] + * @param polygon [description] + * @param point [description] + */ + static ContainsPoint(polygon: Phaser.Geom.Polygon, point: Phaser.Geom.Point): boolean; + + /** + * Calculates the bounding AABB rectangle of a polygon. + * @param polygon The polygon that should be calculated. + * @param out The rectangle or object that has x, y, width, and height properties to store the result. Optional. + */ + static GetAABB(polygon: Phaser.Geom.Polygon, out?: O): O; + + /** + * Stores all of the points of a Polygon into a flat array of numbers following the sequence [ x,y, x,y, x,y ], + * i.e. each point of the Polygon, in the order it's defined, corresponds to two elements of the resultant + * array for the point's X and Y coordinate. + * @param polygon The Polygon whose points to export. + * @param output An array to which the points' coordinates should be appended. + */ + static GetNumberArray(polygon: Phaser.Geom.Polygon, output?: O): O; + + /** + * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, + * based on the given quantity or stepRate values. + * @param polygon The Polygon to get the points from. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. + * @param output An array to insert the points in to. If not provided a new array will be created. + */ + static GetPoints(polygon: Phaser.Geom.Polygon, quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + + /** + * Returns the perimeter of the given Polygon. + * @param polygon The Polygon to get the perimeter of. + */ + static Perimeter(polygon: Phaser.Geom.Polygon): number; + + /** + * The area of this Polygon. + */ + area: number; + + /** + * An array of number pair objects that make up this polygon. I.e. [ {x,y}, {x,y}, {x,y} ] + */ + points: Phaser.Geom.Point[]; + + /** + * Check to see if the Polygon contains the given x / y coordinates. + * @param x The x coordinate to check within the polygon. + * @param y The y coordinate to check within the polygon. + */ + contains(x: number, y: number): boolean; + + /** + * Sets this Polygon to the given points. + * + * The points can be set from a variety of formats: + * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * `setTo` may also be called without any arguments to remove all points. + * @param points Points defining the perimeter of this polygon. Please check function description above for the different supported formats. + */ + setTo(points: any[]): Phaser.Geom.Polygon; + + /** + * Calculates the area of the Polygon. This is available in the property Polygon.area + */ + calculateArea(): number; + + /** + * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, + * based on the given quantity or stepRate values. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. + * @param output An array to insert the points in to. If not provided a new array will be created. + */ + getPoints(quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + + /** + * Reverses the order of the points of a Polygon. + * @param polygon The Polygon to modify. + */ + static Reverse(polygon: O): O; + + /** + * Takes a Polygon object and applies Chaikin's smoothing algorithm on its points. + * @param polygon The polygon to be smoothed. The polygon will be modified in-place and returned. + */ + static Smooth(polygon: O): O; + + } + + /** + * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) + */ + class Rectangle { + /** + * + * @param x The X coordinate of the top left corner of the Rectangle. Default 0. + * @param y The Y coordinate of the top left corner of the Rectangle. Default 0. + * @param width The width of the Rectangle. Default 0. + * @param height The height of the Rectangle. Default 0. + */ + constructor(x?: number, y?: number, width?: number, height?: number); + + /** + * Calculates the area of the given Rectangle object. + * @param rect The rectangle to calculate the area of. + */ + static Area(rect: Phaser.Geom.Rectangle): number; + + /** + * Rounds a Rectangle's position up to the smallest integer greater than or equal to each current coordinate. + * @param rect The Rectangle to adjust. + */ + static Ceil(rect: O): O; + + /** + * Rounds a Rectangle's position and size up to the smallest integer greater than or equal to each respective value. + * @param rect The Rectangle to modify. + */ + static CeilAll(rect: O): O; + + /** + * Moves the top-left corner of a Rectangle so that its center is at the given coordinates. + * @param rect The Rectangle to be centered. + * @param x The X coordinate of the Rectangle's center. + * @param y The Y coordinate of the Rectangle's center. + */ + static CenterOn(rect: O, x: number, y: number): O; + + /** + * Creates a new Rectangle which is identical to the given one. + * @param source The Rectangle to clone. + */ + static Clone(source: Phaser.Geom.Rectangle): Phaser.Geom.Rectangle; + + /** + * Checks if a given point is inside a Rectangle's bounds. + * @param rect The Rectangle to check. + * @param x The X coordinate of the point to check. + * @param y The Y coordinate of the point to check. + */ + static Contains(rect: Phaser.Geom.Rectangle, x: number, y: number): boolean; + + /** + * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. + * @param rect The Rectangle object. + * @param point The point object to be checked. Can be a Phaser Point object or any object with x and y values. + */ + static ContainsPoint(rect: Phaser.Geom.Rectangle, point: Phaser.Geom.Point): boolean; + + /** + * Tests if one rectangle fully contains another. + * @param rectA The first rectangle. + * @param rectB The second rectangle. + */ + static ContainsRect(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle): boolean; + + /** + * Copy the values of one Rectangle to a destination Rectangle. + * @param source The source Rectangle to copy the values from. + * @param dest The destination Rectangle to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Rectangle, dest: O): O; + + /** + * Create an array of points for each corner of a Rectangle + * If an array is specified, each point object will be added to the end of the array, otherwise a new array will be created. + * @param rect The Rectangle object to be decomposed. + * @param out If provided, each point will be added to this array. + */ + static Decompose(rect: Phaser.Geom.Rectangle, out?: any[]): any[]; + + /** + * Compares the `x`, `y`, `width` and `height` properties of two rectangles. + * @param rect Rectangle A + * @param toCompare Rectangle B + */ + static Equals(rect: Phaser.Geom.Rectangle, toCompare: Phaser.Geom.Rectangle): boolean; + + /** + * Adjusts the target rectangle, changing its width, height and position, + * so that it fits inside the area of the source rectangle, while maintaining its original + * aspect ratio. + * + * Unlike the `FitOutside` function, there may be some space inside the source area not covered. + * @param target The target rectangle to adjust. + * @param source The source rectangle to envlope the target in. + */ + static FitInside(target: O, source: Phaser.Geom.Rectangle): O; + + /** + * Adjusts the target rectangle, changing its width, height and position, + * so that it fully covers the area of the source rectangle, while maintaining its original + * aspect ratio. + * + * Unlike the `FitInside` function, the target rectangle may extend further out than the source. + * @param target The target rectangle to adjust. + * @param source The source rectangle to envlope the target in. + */ + static FitOutside(target: O, source: Phaser.Geom.Rectangle): O; + + /** + * Rounds down (floors) the top left X and Y co-ordinates of the given Rectangle to the largest integer less than or equal to them + * @param rect The rectangle to floor the top left X and Y co-ordinates of + */ + static Floor(rect: O): O; + + /** + * Rounds a Rectangle's position and size down to the largest integer less than or equal to each current coordinate or dimension. + * @param rect The Rectangle to adjust. + */ + static FloorAll(rect: O): O; + + /** + * Constructs new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds. + * @param points An array of points (either arrays with two elements corresponding to the X and Y coordinate or an object with public `x` and `y` properties) which should be surrounded by the Rectangle. + * @param out Optional Rectangle to adjust. + */ + static FromPoints(points: any[], out?: O): O; + + /** + * Calculates the width/height ratio of a rectangle. + * @param rect The rectangle. + */ + static GetAspectRatio(rect: Phaser.Geom.Rectangle): number; + + /** + * Returns the center of a Rectangle as a Point. + * @param rect The Rectangle to get the center of. + * @param out Optional point-like object to update with the center coordinates. + */ + static GetCenter(rect: Phaser.Geom.Rectangle, out?: O): O; + + /** + * Position is a value between 0 and 1 where 0 = the top-left of the rectangle and 0.5 = the bottom right. + * @param rectangle [description] + * @param position [description] + * @param out [description] + */ + static GetPoint(rectangle: Phaser.Geom.Rectangle, position: number, out?: O): O; + + /** + * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. + * @param rectangle The Rectangle object to get the points from. + * @param step Step between points. Used to calculate the number of points to return when quantity is falsy. Ignored if quantity is positive. + * @param quantity The number of evenly spaced points from the rectangles perimeter to return. If falsy, step param will be used to calculate the number of points. + * @param out An optional array to store the points in. + */ + static GetPoints(rectangle: Phaser.Geom.Rectangle, step: number, quantity: integer, out?: O): O; + + /** + * [description] + * @param rect [description] + * @param out [description] + */ + static GetSize(rect: Phaser.Geom.Rectangle, out?: O): O; + + /** + * Increases the size of a Rectangle by a specified amount. + * + * The center of the Rectangle stays the same. The amounts are added to each side, so the actual increase in width or height is two times bigger than the respective argument. + * @param rect The Rectangle to inflate. + * @param x How many pixels the left and the right side should be moved by horizontally. + * @param y How many pixels the top and the bottom side should be moved by vertically. + */ + static Inflate(rect: O, x: number, y: number): O; + + /** + * Takes two Rectangles and first checks to see if they intersect. + * If they intersect it will return the area of intersection in the `out` Rectangle. + * If they do not intersect, the `out` Rectangle will have a width and height of zero. + * @param rectA The first Rectangle to get the intersection from. + * @param rectB The second Rectangle to get the intersection from. + * @param out A Rectangle to store the intersection results in. + */ + static Intersection(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: Phaser.Geom.Rectangle): O; + + /** + * [description] + * @param rect [description] + * @param step [description] + * @param quantity [description] + * @param out [description] + */ + static MarchingAnts(rect: Phaser.Geom.Rectangle, step: number, quantity: integer, out?: O): O; + + /** + * Merges a Rectangle with a list of points by repositioning and/or resizing it such that all points are located on or within its bounds. + * @param target The Rectangle which should be merged. + * @param points An array of Points (or any object with public `x` and `y` properties) which should be merged with the Rectangle. + */ + static MergePoints(target: O, points: Phaser.Geom.Point[]): O; + + /** + * Merges the source rectangle into the target rectangle and returns the target. + * Neither rectangle should have a negative width or height. + * @param target Target rectangle. Will be modified to include source rectangle. + * @param source Rectangle that will be merged into target rectangle. + */ + static MergeRect(target: O, source: Phaser.Geom.Rectangle): O; + + /** + * Merges a Rectangle with a point by repositioning and/or resizing it so that the point is on or within its bounds. + * @param target The Rectangle which should be merged and modified. + * @param x The X coordinate of the point which should be merged. + * @param y The Y coordinate of the point which should be merged. + */ + static MergeXY(target: O, x: number, y: number): O; + + /** + * Nudges (translates) the top left corner of a Rectangle by a given offset. + * @param rect The Rectangle to adjust. + * @param x The distance to move the Rectangle horizontally. + * @param y The distance to move the Rectangle vertically. + */ + static Offset(rect: O, x: number, y: number): O; + + /** + * Nudges (translates) the top-left corner of a Rectangle by the coordinates of a point (translation vector). + * @param rect The Rectangle to adjust. + * @param point The point whose coordinates should be used as an offset. + */ + static OffsetPoint(rect: O, point: Phaser.Geom.Point | Phaser.Math.Vector2): O; + + /** + * Checks if two Rectangles overlap. If a Rectangle is within another Rectangle, the two will be considered overlapping. Thus, the Rectangles are treated as "solid". + * @param rectA The first Rectangle to check. + * @param rectB The second Rectangle to check. + */ + static Overlaps(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle): boolean; + + /** + * Calculates the perimeter of a Rectangle. + * @param rect The Rectangle to use. + */ + static Perimeter(rect: Phaser.Geom.Rectangle): number; + + /** + * [description] + * @param rectangle [description] + * @param angle [description] + * @param out [description] + */ + static PerimeterPoint(rectangle: Phaser.Geom.Rectangle, angle: integer, out?: O): O; + + /** + * Returns a random point within a Rectangle. + * @param rect The Rectangle to return a point from. + * @param out The object to update with the point's coordinates. + */ + static Random(rect: Phaser.Geom.Rectangle, out: O): O; + + /** + * Calculates a random point that lies within the `outer` Rectangle, but outside of the `inner` Rectangle. + * The inner Rectangle must be fully contained within the outer rectangle. + * @param outer The outer Rectangle to get the random point within. + * @param inner The inner Rectangle to exclude from the returned point. + * @param out A Point, or Point-like object to store the result in. If not specified, a new Point will be created. + */ + static RandomOutside(outer: Phaser.Geom.Rectangle, inner: Phaser.Geom.Rectangle, out?: O): O; + + /** + * The X coordinate of the top left corner of the Rectangle. + */ + x: number; + + /** + * The Y coordinate of the top left corner of the Rectangle. + */ + y: number; + + /** + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. + */ + width: number; + + /** + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. + */ + height: number; + + /** + * Checks if the given point is inside the Rectangle's bounds. + * @param x The X coordinate of the point to check. + * @param y The Y coordinate of the point to check. + */ + contains(x: number, y: number): boolean; + + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * @param position The normalized distance into the Rectangle's perimeter to return. + * @param output An object to update with the `x` and `y` coordinates of the point. + */ + getPoint(position: number, output?: O): O; + + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. + * @param quantity The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param stepRate If `quantity` is 0, determines the normalized distance between each returned point. + * @param output An array to which to append the points. + */ + getPoints(quantity: integer, stepRate?: number, output?: O): O; + + /** + * Returns a random point within the Rectangle's bounds. + * @param point The object in which to store the `x` and `y` coordinates of the point. + */ + getRandomPoint(point?: O): O; + + /** + * Sets the position, width, and height of the Rectangle. + * @param x The X coordinate of the top left corner of the Rectangle. + * @param y The Y coordinate of the top left corner of the Rectangle. + * @param width The width of the Rectangle. + * @param height The height of the Rectangle. + */ + setTo(x: number, y: number, width: number, height: number): Phaser.Geom.Rectangle; + + /** + * Resets the position, width, and height of the Rectangle to 0. + */ + setEmpty(): Phaser.Geom.Rectangle; + + /** + * Sets the position of the Rectangle. + * @param x The X coordinate of the top left corner of the Rectangle. + * @param y The Y coordinate of the top left corner of the Rectangle. Default x. + */ + setPosition(x: number, y?: number): Phaser.Geom.Rectangle; + + /** + * Sets the width and height of the Rectangle. + * @param width The width to set the Rectangle to. + * @param height The height to set the Rectangle to. Default width. + */ + setSize(width: number, height?: number): Phaser.Geom.Rectangle; + + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + */ + isEmpty(): boolean; + + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineA(line?: O): O; + + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineB(line?: O): O; + + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineC(line?: O): O; + + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineD(line?: O): O; + + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. + */ + left: number; + + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. + */ + right: number; + + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. + */ + top: number; + + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + */ + bottom: number; + + /** + * The x coordinate of the center of the Rectangle. + */ + centerX: number; + + /** + * The y coordinate of the center of the Rectangle. + */ + centerY: number; + + /** + * Determines if the two objects (either Rectangles or Rectangle-like) have the same width and height values under strict equality. + * @param rect The first Rectangle object. + * @param toCompare The second Rectangle object. + */ + static SameDimensions(rect: Phaser.Geom.Rectangle, toCompare: Phaser.Geom.Rectangle): boolean; + + /** + * Scales the width and height of this Rectangle by the given amounts. + * @param rect The `Rectangle` object that will be scaled by the specified amount(s). + * @param x The factor by which to scale the rectangle horizontally. + * @param y The amount by which to scale the rectangle vertically. If this is not specified, the rectangle will be scaled by the factor `x` in both directions. + */ + static Scale(rect: O, x: number, y: number): O; + + /** + * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. + * @param rectA The first Rectangle to use. + * @param rectB The second Rectangle to use. + * @param out The Rectangle to store the union in. + */ + static Union(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: O): O; + + } + + /** + * A triangle is a plane created by connecting three points. + * The first two arguments specify the first point, the middle two arguments + * specify the second point, and the last two arguments specify the third point. + */ + class Triangle { + /** + * + * @param x1 `x` coordinate of the first point. Default 0. + * @param y1 `y` coordinate of the first point. Default 0. + * @param x2 `x` coordinate of the second point. Default 0. + * @param y2 `y` coordinate of the second point. Default 0. + * @param x3 `x` coordinate of the third point. Default 0. + * @param y3 `y` coordinate of the third point. Default 0. + */ + constructor(x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number); + + /** + * Returns the area of a Triangle. + * @param triangle The Triangle to use. + */ + static Area(triangle: Phaser.Geom.Triangle): number; + + /** + * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). + * The x/y specifies the top-middle of the triangle (x1/y1) and length is the length of each side. + * @param x x coordinate of the top point of the triangle. + * @param y y coordinate of the top point of the triangle. + * @param length Length of each side of the triangle. + */ + static BuildEquilateral(x: number, y: number, length: number): Phaser.Geom.Triangle; + + /** + * [description] + * @param data A flat array of vertice coordinates like [x0,y0, x1,y1, x2,y2, ...] + * @param holes An array of hole indices if any (e.g. [5, 8] for a 12-vertice input would mean one hole with vertices 5–7 and another with 8–11). Default null. + * @param scaleX [description] Default 1. + * @param scaleY [description] Default 1. + * @param out [description] + */ + static BuildFromPolygon(data: any[], holes?: any[], scaleX?: number, scaleY?: number, out?: O): O; + + /** + * Builds a right triangle, i.e. one which has a 90-degree angle and two acute angles. + * @param x The X coordinate of the right angle, which will also be the first X coordinate of the constructed Triangle. + * @param y The Y coordinate of the right angle, which will also be the first Y coordinate of the constructed Triangle. + * @param width The length of the side which is to the left or to the right of the right angle. + * @param height The length of the side which is above or below the right angle. + */ + static BuildRight(x: number, y: number, width: number, height: number): Phaser.Geom.Triangle; + + /** + * Positions the Triangle so that it is centered on the given coordinates. + * @param triangle The triangle to be positioned. + * @param x The horizontal coordinate to center on. + * @param y The vertical coordinate to center on. + * @param centerFunc The function used to center the triangle. Defaults to Centroid centering. + */ + static CenterOn(triangle: O, x: number, y: number, centerFunc?: CenterFunction): O; + + /** + * Calculates the position of a Triangle's centroid, which is also its center of mass (center of gravity). + * + * The centroid is the point in a Triangle at which its three medians (the lines drawn from the vertices to the bisectors of the opposite sides) meet. It divides each one in a 2:1 ratio. + * @param triangle The Triangle to use. + * @param out An object to store the coordinates in. + */ + static Centroid(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Computes the circumcentre of a triangle. The circumcentre is the centre of + * the circumcircle, the smallest circle which encloses the triangle. It is also + * the common intersection point of the perpendicular bisectors of the sides of + * the triangle, and is the only point which has equal distance to all three + * vertices of the triangle. + * @param triangle [description] + * @param out [description] + */ + static CircumCenter(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Finds the circumscribed circle (circumcircle) of a Triangle object. The circumcircle is the circle which touches all of the triangle's vertices. + * @param triangle The Triangle to use as input. + * @param out An optional Circle to store the result in. + */ + static CircumCircle(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Clones a Triangle object. + * @param source The Triangle to clone. + */ + static Clone(source: Phaser.Geom.Triangle): Phaser.Geom.Triangle; + + /** + * Checks if a point (as a pair of coordinates) is inside a Triangle's bounds. + * @param triangle The Triangle to check. + * @param x The X coordinate of the point to check. + * @param y The Y coordinate of the point to check. + */ + static Contains(triangle: Phaser.Geom.Triangle, x: number, y: number): boolean; + + /** + * Filters an array of point-like objects to only those contained within a triangle. + * If `returnFirst` is true, will return an array containing only the first point in the provided array that is within the triangle (or an empty array if there are no such points). + * @param triangle The triangle that the points are being checked in. + * @param points An array of point-like objects (objects that have an `x` and `y` property) + * @param returnFirst If `true`, return an array containing only the first point found that is within the triangle. Default false. + * @param out If provided, the points that are within the triangle will be appended to this array instead of being added to a new array. If `returnFirst` is true, only the first point found within the triangle will be appended. This array will also be returned by this function. + */ + static ContainsArray(triangle: Phaser.Geom.Triangle, points: Phaser.Geom.Point[], returnFirst?: boolean, out?: any[]): Phaser.Geom.Point[]; + + /** + * Tests if a triangle contains a point. + * @param triangle The triangle. + * @param point The point to test, or any point-like object with public `x` and `y` properties. + */ + static ContainsPoint(triangle: Phaser.Geom.Triangle, point: Phaser.Geom.Point | Phaser.Math.Vector2 | any): boolean; + + /** + * Copy the values of one Triangle to a destination Triangle. + * @param source The source Triangle to copy the values from. + * @param dest The destination Triangle to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Triangle, dest: O): O; + + /** + * Decomposes a Triangle into an array of its points. + * @param triangle The Triangle to decompose. + * @param out An array to store the points into. + */ + static Decompose(triangle: Phaser.Geom.Triangle, out?: any[]): any[]; + + /** + * Returns true if two triangles have the same coordinates. + * @param triangle The first triangle to check. + * @param toCompare The second triangle to check. + */ + static Equals(triangle: Phaser.Geom.Triangle, toCompare: Phaser.Geom.Triangle): boolean; + + /** + * Returns a Point from around the perimeter of a Triangle. + * @param triangle The Triangle to get the point on its perimeter from. + * @param position The position along the perimeter of the triangle. A value between 0 and 1. + * @param out An option Point, or Point-like object to store the value in. If not given a new Point will be created. + */ + static GetPoint(triangle: Phaser.Geom.Triangle, position: number, out?: O): O; + + /** + * Returns an array of evenly spaced points on the perimeter of a Triangle. + * @param triangle The Triangle to get the points from. + * @param quantity The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. + * @param stepRate If `quantity` is 0, the distance between each returned point. + * @param out An array to which the points should be appended. + */ + static GetPoints(triangle: Phaser.Geom.Triangle, quantity: integer, stepRate: number, out?: O): O; + + /** + * Calculates the position of the incenter of a Triangle object. This is the point where its three angle bisectors meet and it's also the center of the incircle, which is the circle inscribed in the triangle. + * @param triangle The Triangle to find the incenter of. + * @param out An optional Point in which to store the coordinates. + */ + static InCenter(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Moves each point (vertex) of a Triangle by a given offset, thus moving the entire Triangle by that offset. + * @param triangle The Triangle to move. + * @param x The horizontal offset (distance) by which to move each point. Can be positive or negative. + * @param y The vertical offset (distance) by which to move each point. Can be positive or negative. + */ + static Offset(triangle: O, x: number, y: number): O; + + /** + * Gets the length of the perimeter of the given triangle. + * @param triangle [description] + */ + static Perimeter(triangle: Phaser.Geom.Triangle): number; + + /** + * [description] + * @param triangle [description] + * @param out [description] + */ + static Random(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet. + * @param triangle The Triangle to rotate. + * @param angle The angle by which to rotate the Triangle, in radians. + */ + static Rotate(triangle: O, angle: number): O; + + /** + * Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties. + * @param triangle The Triangle to rotate. + * @param point The Point to rotate the Triangle about. + * @param angle The angle by which to rotate the Triangle, in radians. + */ + static RotateAroundPoint(triangle: O, point: Phaser.Geom.Point, angle: number): O; + + /** + * Rotates an entire Triangle at a given angle about a specific point. + * @param triangle The Triangle to rotate. + * @param x The X coordinate of the point to rotate the Triangle about. + * @param y The Y coordinate of the point to rotate the Triangle about. + * @param angle The angle by which to rotate the Triangle, in radians. + */ + static RotateAroundXY(triangle: O, x: number, y: number, angle: number): O; + + /** + * `x` coordinate of the first point. + */ + x1: number; + + /** + * `y` coordinate of the first point. + */ + y1: number; + + /** + * `x` coordinate of the second point. + */ + x2: number; + + /** + * `y` coordinate of the second point. + */ + y2: number; + + /** + * `x` coordinate of the third point. + */ + x3: number; + + /** + * `y` coordinate of the third point. + */ + y3: number; + + /** + * Checks whether a given points lies within the triangle. + * @param x The x coordinate of the point to check. + * @param y The y coordinate of the point to check. + */ + contains(x: number, y: number): boolean; + + /** + * Returns a specific point on the triangle. + * @param position Position as float within `0` and `1`. `0` equals the first point. + * @param output Optional Point, or point-like object, that the calculated point will be written to. + */ + getPoint(position: number, output?: O): O; + + /** + * Calculates a list of evenly distributed points on the triangle. It is either possible to pass an amount of points to be generated (`quantity`) or the distance between two points (`stepRate`). + * @param quantity Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. + * @param stepRate Distance between two points. Will only be used when `quantity` is falsey. + * @param output Optional Array for writing the calculated points into. Otherwise a new array will be created. + */ + getPoints(quantity: integer, stepRate?: number, output?: O): O; + + /** + * Returns a random point along the triangle. + * @param point Optional `Point` that should be modified. Otherwise a new one will be created. + */ + getRandomPoint(point?: O): O; + + /** + * Sets all three points of the triangle. Leaving out any coordinate sets it to be `0`. + * @param x1 `x` coordinate of the first point. Default 0. + * @param y1 `y` coordinate of the first point. Default 0. + * @param x2 `x` coordinate of the second point. Default 0. + * @param y2 `y` coordinate of the second point. Default 0. + * @param x3 `x` coordinate of the third point. Default 0. + * @param y3 `y` coordinate of the third point. Default 0. + */ + setTo(x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number): Phaser.Geom.Triangle; + + /** + * Returns a Line object that corresponds to Line A of this Triangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineA(line?: O): O; + + /** + * Returns a Line object that corresponds to Line B of this Triangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineB(line?: O): O; + + /** + * Returns a Line object that corresponds to Line C of this Triangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineC(line?: O): O; + + /** + * Left most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. + */ + left: number; + + /** + * Right most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. + */ + right: number; + + /** + * Top most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. + */ + top: number; + + /** + * Bottom most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. + */ + bottom: number; + + } + + } + + namespace Input { + /** + * The mouse pointer is being held down. + */ + var MOUSE_DOWN: integer; + + /** + * The mouse pointer is being moved. + */ + var MOUSE_MOVE: integer; + + /** + * The mouse pointer is released. + */ + var MOUSE_UP: integer; + + /** + * A touch pointer has been started. + */ + var TOUCH_START: integer; + + /** + * A touch pointer has been started. + */ + var TOUCH_MOVE: integer; + + /** + * A touch pointer has been started. + */ + var TOUCH_END: integer; + + /** + * The pointer lock has changed. + */ + var POINTER_LOCK_CHANGE: integer; + + /** + * A touch pointer has been been cancelled by the browser. + */ + var TOUCH_CANCEL: integer; + + /** + * The mouse wheel changes. + */ + var MOUSE_WHEEL: integer; + + /** + * Creates a new Interactive Object. + * + * This is called automatically by the Input Manager when you enable a Game Object for input. + * + * The resulting Interactive Object is mapped to the Game Object's `input` property. + * @param gameObject The Game Object to which this Interactive Object is bound. + * @param hitArea The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle. + * @param hitAreaCallback The 'contains' check callback that the hit area shape will use for all hit tests. + */ + function CreateInteractiveObject(gameObject: Phaser.GameObjects.GameObject, hitArea: any, hitAreaCallback: Phaser.Types.Input.HitAreaCallback): Phaser.Types.Input.InteractiveObject; + + /** + * Creates a new Pixel Perfect Handler function. + * + * Access via `InputPlugin.makePixelPerfect` rather than calling it directly. + * @param textureManager A reference to the Texture Manager. + * @param alphaTolerance The alpha level that the pixel should be above to be included as a successful interaction. + */ + function CreatePixelPerfectHandler(textureManager: Phaser.Textures.TextureManager, alphaTolerance: integer): Function; + + namespace Events { + /** + * The Input Plugin Boot Event. + * + * This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves. + */ + const BOOT: any; + + /** + * The Input Plugin Destroy Event. + * + * This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves. + */ + const DESTROY: any; + + /** + * The Pointer Drag End Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer stops dragging a Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('dragend', listener)`. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_END]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_END} event instead. + */ + const DRAG_END: any; + + /** + * The Pointer Drag Enter Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object into a Drag Target. + * + * Listen to this event from within a Scene using: `this.input.on('dragenter', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_ENTER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_ENTER} event instead. + */ + const DRAG_ENTER: any; + + /** + * The Pointer Drag Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves while dragging a Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('drag', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG} event instead. + */ + const DRAG: any; + + /** + * The Pointer Drag Leave Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object out of a Drag Target. + * + * Listen to this event from within a Scene using: `this.input.on('dragleave', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_LEAVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_LEAVE} event instead. + */ + const DRAG_LEAVE: any; + + /** + * The Pointer Drag Over Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object over a Drag Target. + * + * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within + * the drag target, it will emit this event instead. + * + * Listen to this event from within a Scene using: `this.input.on('dragover', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_OVER} event instead. + */ + const DRAG_OVER: any; + + /** + * The Pointer Drag Start Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer starts to drag any Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('dragstart', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_START]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_START} event instead. + */ + const DRAG_START: any; + + /** + * The Pointer Drop Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drops a Game Object on a Drag Target. + * + * Listen to this event from within a Scene using: `this.input.on('drop', listener)`. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DROP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DROP} event instead. + */ + const DROP: any; + + /** + * The Game Object Down Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down on _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectdown', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_DOWN: any; + + /** + * The Game Object Drag End Event. + * + * This event is dispatched by an interactive Game Object if a pointer stops dragging it. + * + * Listen to this event from a Game Object using: `gameObject.on('dragend', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive](Phaser.GameObjects.GameObject#setInteractive) for more details. + */ + const GAMEOBJECT_DRAG_END: any; + + /** + * The Game Object Drag Enter Event. + * + * This event is dispatched by an interactive Game Object if a pointer drags it into a drag target. + * + * Listen to this event from a Game Object using: `gameObject.on('dragenter', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + */ + const GAMEOBJECT_DRAG_ENTER: any; + + /** + * The Game Object Drag Event. + * + * This event is dispatched by an interactive Game Object if a pointer moves while dragging it. + * + * Listen to this event from a Game Object using: `gameObject.on('drag', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + */ + const GAMEOBJECT_DRAG: any; + + /** + * The Game Object Drag Leave Event. + * + * This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target. + * + * Listen to this event from a Game Object using: `gameObject.on('dragleave', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + */ + const GAMEOBJECT_DRAG_LEAVE: any; + + /** + * The Game Object Drag Over Event. + * + * This event is dispatched by an interactive Game Object if a pointer drags it over a drag target. + * + * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within + * the drag target, it will emit this event instead. + * + * Listen to this event from a Game Object using: `gameObject.on('dragover', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + */ + const GAMEOBJECT_DRAG_OVER: any; + + /** + * The Game Object Drag Start Event. + * + * This event is dispatched by an interactive Game Object if a pointer starts to drag it. + * + * Listen to this event from a Game Object using: `gameObject.on('dragstart', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * There are lots of useful drag related properties that are set within the Game Object when dragging occurs. + * For example, `gameObject.input.dragStartX`, `dragStartY` and so on. + */ + const GAMEOBJECT_DRAG_START: any; + + /** + * The Game Object Drop Event. + * + * This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target. + * + * Listen to this event from a Game Object using: `gameObject.on('drop', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + */ + const GAMEOBJECT_DROP: any; + + /** + * The Game Object Move Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved across _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectmove', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} + * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} + * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_MOVE: any; + + /** + * The Game Object Out Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectout', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} + * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} + * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_OUT: any; + + /** + * The Game Object Over Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectover', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} + * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} + * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_OVER: any; + + /** + * The Game Object Pointer Down Event. + * + * This event is dispatched by an interactive Game Object if a pointer is pressed down on it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerdown', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_DOWN: any; + + /** + * The Game Object Pointer Move Event. + * + * This event is dispatched by an interactive Game Object if a pointer is moved while over it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointermove', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} + * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} + * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_MOVE: any; + + /** + * The Game Object Pointer Out Event. + * + * This event is dispatched by an interactive Game Object if a pointer moves out of it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerout', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} + * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} + * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_OUT: any; + + /** + * The Game Object Pointer Over Event. + * + * This event is dispatched by an interactive Game Object if a pointer moves over it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerover', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} + * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} + * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_OVER: any; + + /** + * The Game Object Pointer Up Event. + * + * This event is dispatched by an interactive Game Object if a pointer is released while over it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerup', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_UP: any; + + /** + * The Game Object Pointer Wheel Event. + * + * This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it. + * + * Listen to this event from a Game Object using: `gameObject.on('wheel', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} + * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} + * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_WHEEL: any; + + /** + * The Game Object Up Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released while over _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectup', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_UP: any; + + /** + * The Game Object Wheel Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel moved while over _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectwheel', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} + * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} + * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_WHEEL: any; + + /** + * The Input Plugin Game Out Event. + * + * This event is dispatched by the Input Plugin if the active pointer leaves the game canvas and is now + * outside of it, elsewhere on the web page. + * + * Listen to this event from within a Scene using: `this.input.on('gameout', listener)`. + */ + const GAME_OUT: any; + + /** + * The Input Plugin Game Over Event. + * + * This event is dispatched by the Input Plugin if the active pointer enters the game canvas and is now + * over of it, having previously been elsewhere on the web page. + * + * Listen to this event from within a Scene using: `this.input.on('gameover', listener)`. + */ + const GAME_OVER: any; + + /** + * The Input Manager Boot Event. + * + * This internal event is dispatched by the Input Manager when it boots. + */ + const MANAGER_BOOT: any; + + /** + * The Input Manager Process Event. + * + * This internal event is dispatched by the Input Manager when not using the legacy queue system, + * and it wants the Input Plugins to update themselves. + */ + const MANAGER_PROCESS: any; + + /** + * The Input Manager Update Event. + * + * This internal event is dispatched by the Input Manager as part of its update step. + */ + const MANAGER_UPDATE: any; + + /** + * The Input Manager Pointer Lock Change Event. + * + * This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event. + */ + const POINTERLOCK_CHANGE: any; + + /** + * The Pointer Down Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere. + * + * Listen to this event from within a Scene using: `this.input.on('pointerdown', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_DOWN: any; + + /** + * The Pointer Down Outside Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere outside of the game canvas. + * + * Listen to this event from within a Scene using: `this.input.on('pointerdownoutside', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_DOWN_OUTSIDE: any; + + /** + * The Pointer Move Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved anywhere. + * + * Listen to this event from within a Scene using: `this.input.on('pointermove', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} + * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} + * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_MOVE: any; + + /** + * The Pointer Out Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} + * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} + * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_OUT: any; + + /** + * The Pointer Over Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('pointerover', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} + * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} + * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_OVER: any; + + /** + * The Pointer Up Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere. + * + * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_UP: any; + + /** + * The Pointer Up Outside Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere outside of the game canvas. + * + * Listen to this event from within a Scene using: `this.input.on('pointerupoutside', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_UP_OUTSIDE: any; + + /** + * The Pointer Wheel Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel updated. + * + * Listen to this event from within a Scene using: `this.input.on('wheel', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} + * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} + * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_WHEEL: any; + + /** + * The Input Plugin Pre-Update Event. + * + * This internal event is dispatched by the Input Plugin at the start of its `preUpdate` method. + * This hook is designed specifically for input plugins, but can also be listened to from user-land code. + */ + const PRE_UPDATE: any; + + /** + * The Input Plugin Shutdown Event. + * + * This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down. + */ + const SHUTDOWN: any; + + /** + * The Input Plugin Start Event. + * + * This internal event is dispatched by the Input Plugin when it has finished setting-up, + * signalling to all of its internal systems to start. + */ + const START: any; + + /** + * The Input Plugin Update Event. + * + * This internal event is dispatched by the Input Plugin at the start of its `update` method. + * This hook is designed specifically for input plugins, but can also be listened to from user-land code. + */ + const UPDATE: any; + + } + + namespace Gamepad { + /** + * Contains information about a specific Gamepad Axis. + * Axis objects are created automatically by the Gamepad as they are needed. + */ + class Axis { + /** + * + * @param pad A reference to the Gamepad that this Axis belongs to. + * @param index The index of this Axis. + */ + constructor(pad: Phaser.Input.Gamepad.Gamepad, index: integer); + + /** + * A reference to the Gamepad that this Axis belongs to. + */ + pad: Phaser.Input.Gamepad.Gamepad; + + /** + * An event emitter to use to emit the axis events. + */ + events: Phaser.Events.EventEmitter; + + /** + * The index of this Axis. + */ + index: integer; + + /** + * The raw axis value, between -1 and 1 with 0 being dead center. + * Use the method `getValue` to get a normalized value with the threshold applied. + */ + value: number; + + /** + * Movement tolerance threshold below which axis values are ignored in `getValue`. + */ + threshold: number; + + /** + * Applies the `threshold` value to the axis and returns it. + */ + getValue(): number; + + /** + * Destroys this Axis instance and releases external references it holds. + */ + destroy(): void; + + } + + /** + * Contains information about a specific button on a Gamepad. + * Button objects are created automatically by the Gamepad as they are needed. + */ + class Button { + /** + * + * @param pad A reference to the Gamepad that this Button belongs to. + * @param index The index of this Button. + */ + constructor(pad: Phaser.Input.Gamepad.Gamepad, index: integer); + + /** + * A reference to the Gamepad that this Button belongs to. + */ + pad: Phaser.Input.Gamepad.Gamepad; + + /** + * An event emitter to use to emit the button events. + */ + events: Phaser.Events.EventEmitter; + + /** + * The index of this Button. + */ + index: integer; + + /** + * Between 0 and 1. + */ + value: number; + + /** + * Can be set for analogue buttons to enable a 'pressure' threshold, + * before a button is considered as being 'pressed'. + */ + threshold: number; + + /** + * Is the Button being pressed down or not? + */ + pressed: boolean; + + /** + * Destroys this Button instance and releases external references it holds. + */ + destroy(): void; + + } + + namespace Configs { + /** + * Tatar SNES USB Controller Gamepad Configuration. + * USB Gamepad (STANDARD GAMEPAD Vendor: 0079 Product: 0011) + */ + var SNES_USB: object; + + /** + * PlayStation DualShock 4 Gamepad Configuration. + * Sony PlayStation DualShock 4 (v2) wireless controller + */ + var DUALSHOCK_4: object; + + /** + * XBox 360 Gamepad Configuration. + */ + var XBOX_360: object; + + } + + namespace Events { + /** + * The Gamepad Button Down Event. + * + * This event is dispatched by the Gamepad Plugin when a button has been pressed on any active Gamepad. + * + * Listen to this event from within a Scene using: `this.input.gamepad.on('down', listener)`. + * + * You can also listen for a DOWN event from a Gamepad instance. See the [GAMEPAD_BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_DOWN} event for details. + */ + const BUTTON_DOWN: any; + + /** + * The Gamepad Button Up Event. + * + * This event is dispatched by the Gamepad Plugin when a button has been released on any active Gamepad. + * + * Listen to this event from within a Scene using: `this.input.gamepad.on('up', listener)`. + * + * You can also listen for an UP event from a Gamepad instance. See the [GAMEPAD_BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_UP} event for details. + */ + const BUTTON_UP: any; + + /** + * The Gamepad Connected Event. + * + * This event is dispatched by the Gamepad Plugin when a Gamepad has been connected. + * + * Listen to this event from within a Scene using: `this.input.gamepad.once('connected', listener)`. + * + * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, + * this is for security reasons. However, it may also trust the page already, in which case you won't get the + * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads + * already connected. + */ + const CONNECTED: any; + + /** + * The Gamepad Disconnected Event. + * + * This event is dispatched by the Gamepad Plugin when a Gamepad has been disconnected. + * + * Listen to this event from within a Scene using: `this.input.gamepad.once('disconnected', listener)`. + */ + const DISCONNECTED: any; + + /** + * The Gamepad Button Down Event. + * + * This event is dispatched by a Gamepad instance when a button has been pressed on it. + * + * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: + * `this.input.gamepad.pad1.on('down', listener)`. + * + * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. + * + * You can also listen for a DOWN event from the Gamepad Plugin. See the [BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_DOWN} event for details. + */ + const GAMEPAD_BUTTON_DOWN: any; + + /** + * The Gamepad Button Up Event. + * + * This event is dispatched by a Gamepad instance when a button has been released on it. + * + * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: + * `this.input.gamepad.pad1.on('up', listener)`. + * + * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. + * + * You can also listen for an UP event from the Gamepad Plugin. See the [BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_UP} event for details. + */ + const GAMEPAD_BUTTON_UP: any; + + } + + /** + * A single Gamepad. + * + * These are created, updated and managed by the Gamepad Plugin. + */ + class Gamepad extends Phaser.Events.EventEmitter { + /** + * + * @param manager A reference to the Gamepad Plugin. + * @param pad The Gamepad object, as extracted from GamepadEvent. + */ + constructor(manager: Phaser.Input.Gamepad.GamepadPlugin, pad: Phaser.Types.Input.Gamepad.Pad); + + /** + * A reference to the Gamepad Plugin. + */ + manager: Phaser.Input.Gamepad.GamepadPlugin; + + /** + * A reference to the native Gamepad object that is connected to the browser. + */ + pad: any; + + /** + * A string containing some information about the controller. + * + * This is not strictly specified, but in Firefox it will contain three pieces of information + * separated by dashes (-): two 4-digit hexadecimal strings containing the USB vendor and + * product id of the controller, and the name of the controller as provided by the driver. + * In Chrome it will contain the name of the controller as provided by the driver, + * followed by vendor and product 4-digit hexadecimal strings. + */ + id: string; + + /** + * An integer that is unique for each Gamepad currently connected to the system. + * This can be used to distinguish multiple controllers. + * Note that disconnecting a device and then connecting a new device may reuse the previous index. + */ + index: number; + + /** + * An array of Gamepad Button objects, corresponding to the different buttons available on the Gamepad. + */ + buttons: Phaser.Input.Gamepad.Button[]; + + /** + * An array of Gamepad Axis objects, corresponding to the different axes available on the Gamepad, if any. + */ + axes: Phaser.Input.Gamepad.Axis[]; + + /** + * The Gamepad's Haptic Actuator (Vibration / Rumble support). + * This is highly experimental and only set if both present on the device, + * and exposed by both the hardware and browser. + */ + vibration: GamepadHapticActuator; + + /** + * A Vector2 containing the most recent values from the Gamepad's left axis stick. + * This is updated automatically as part of the Gamepad.update cycle. + * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. + * The values are based on the Axis thresholds. + * If the Gamepad does not have a left axis stick, the values will always be zero. + */ + leftStick: Phaser.Math.Vector2; + + /** + * A Vector2 containing the most recent values from the Gamepad's right axis stick. + * This is updated automatically as part of the Gamepad.update cycle. + * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. + * The values are based on the Axis thresholds. + * If the Gamepad does not have a right axis stick, the values will always be zero. + */ + rightStick: Phaser.Math.Vector2; + + /** + * Gets the total number of axis this Gamepad claims to support. + */ + getAxisTotal(): integer; + + /** + * Gets the value of an axis based on the given index. + * The index must be valid within the range of axes supported by this Gamepad. + * The return value will be a float between 0 and 1. + * @param index The index of the axes to get the value for. + */ + getAxisValue(index: integer): number; + + /** + * Sets the threshold value of all axis on this Gamepad. + * The value is a float between 0 and 1 and is the amount below which the axis is considered as not having been moved. + * @param value A value between 0 and 1. + */ + setAxisThreshold(value: number): void; + + /** + * Gets the total number of buttons this Gamepad claims to have. + */ + getButtonTotal(): integer; + + /** + * Gets the value of a button based on the given index. + * The index must be valid within the range of buttons supported by this Gamepad. + * + * The return value will be either 0 or 1 for an analogue button, or a float between 0 and 1 + * for a pressure-sensitive digital button, such as the shoulder buttons on a Dual Shock. + * @param index The index of the button to get the value for. + */ + getButtonValue(index: integer): number; + + /** + * Returns if the button is pressed down or not. + * The index must be valid within the range of buttons supported by this Gamepad. + * @param index The index of the button to get the value for. + */ + isButtonDown(index: integer): boolean; + + /** + * Destroys this Gamepad instance, its buttons and axes, and releases external references it holds. + */ + destroy(): void; + + /** + * Is this Gamepad currently connected or not? + */ + connected: boolean; + + /** + * A timestamp containing the most recent time this Gamepad was updated. + */ + timestamp: number; + + /** + * Is the Gamepad's Left button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad left button under standard Gamepad mapping. + */ + left: boolean; + + /** + * Is the Gamepad's Right button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad right button under standard Gamepad mapping. + */ + right: boolean; + + /** + * Is the Gamepad's Up button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad up button under standard Gamepad mapping. + */ + up: boolean; + + /** + * Is the Gamepad's Down button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad down button under standard Gamepad mapping. + */ + down: boolean; + + /** + * Is the Gamepad's bottom button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the X button. + * On an XBox controller it's the A button. + */ + A: boolean; + + /** + * Is the Gamepad's top button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Triangle button. + * On an XBox controller it's the Y button. + */ + Y: boolean; + + /** + * Is the Gamepad's left button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Square button. + * On an XBox controller it's the X button. + */ + X: boolean; + + /** + * Is the Gamepad's right button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Circle button. + * On an XBox controller it's the B button. + */ + B: boolean; + + /** + * Returns the value of the Gamepad's top left shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the L1 button. + * On an XBox controller it's the LB button. + */ + L1: number; + + /** + * Returns the value of the Gamepad's bottom left shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the L2 button. + * On an XBox controller it's the LT button. + */ + L2: number; + + /** + * Returns the value of the Gamepad's top right shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the R1 button. + * On an XBox controller it's the RB button. + */ + R1: number; + + /** + * Returns the value of the Gamepad's bottom right shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the R2 button. + * On an XBox controller it's the RT button. + */ + R2: number; + + } + + /** + * The Gamepad Plugin is an input plugin that belongs to the Scene-owned Input system. + * + * Its role is to listen for native DOM Gamepad Events and then process them. + * + * You do not need to create this class directly, the Input system will create an instance of it automatically. + * + * You can access it from within a Scene using `this.input.gamepad`. + * + * To listen for a gamepad being connected: + * + * ```javascript + * this.input.gamepad.once('connected', function (pad) { + * // 'pad' is a reference to the gamepad that was just connected + * }); + * ``` + * + * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, + * this is for security reasons. However, it may also trust the page already, in which case you won't get the + * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads + * already connected. + * + * Once you have received the connected event, or polled the gamepads and found them enabled, you can access + * them via the built-in properties `GamepadPlugin.pad1` to `pad4`, for up to 4 game pads. With a reference + * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on + * the `Gamepad` class for more details. + * + * For more information about Gamepad support in browsers see the following resources: + * + * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API + * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API + * https://www.smashingmagazine.com/2015/11/gamepad-api-in-web-games/ + * http://html5gamepad.com/ + */ + class GamepadPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param sceneInputPlugin A reference to the Scene Input Plugin that the KeyboardPlugin belongs to. + */ + constructor(sceneInputPlugin: Phaser.Input.InputPlugin); + + /** + * A reference to the Scene that this Input Plugin is responsible for. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems Settings. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * A reference to the Scene Input Plugin that created this Keyboard Plugin. + */ + sceneInputPlugin: Phaser.Input.InputPlugin; + + /** + * A boolean that controls if the Gamepad Manager is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * The Gamepad Event target, as defined in the Game Config. + * Typically the browser window, but can be any interactive DOM element. + */ + target: any; + + /** + * An array of the connected Gamepads. + */ + gamepads: Phaser.Input.Gamepad.Gamepad[]; + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + */ + isActive(): boolean; + + /** + * Disconnects all current Gamepads. + */ + disconnectAll(): void; + + /** + * Returns an array of all currently connected Gamepads. + */ + getAll(): Phaser.Input.Gamepad.Gamepad[]; + + /** + * Looks-up a single Gamepad based on the given index value. + * @param index The index of the Gamepad to get. + */ + getPad(index: number): Phaser.Input.Gamepad.Gamepad; + + /** + * The total number of connected game pads. + */ + total: integer; + + /** + * A reference to the first connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad1: Phaser.Input.Gamepad.Gamepad; + + /** + * A reference to the second connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad2: Phaser.Input.Gamepad.Gamepad; + + /** + * A reference to the third connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad3: Phaser.Input.Gamepad.Gamepad; + + /** + * A reference to the fourth connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad4: Phaser.Input.Gamepad.Gamepad; + + } + + } + + /** + * The Input Manager is responsible for handling the pointer related systems in a single Phaser Game instance. + * + * Based on the Game Config it will create handlers for mouse and touch support. + * + * Keyboard and Gamepad are plugins, handled directly by the InputPlugin class. + * + * It then manages the events, pointer creation and general hit test related operations. + * + * You rarely need to interact with the Input Manager directly, and as such, all of its properties and methods + * should be considered private. Instead, you should use the Input Plugin, which is a Scene level system, responsible + * for dealing with all input events for a Scene. + */ + class InputManager { + /** + * + * @param game The Game instance that owns the Input Manager. + * @param config The Input Configuration object, as set in the Game Config. + */ + constructor(game: Phaser.Game, config: object); + + /** + * The Game instance that owns the Input Manager. + * A Game only maintains on instance of the Input Manager at any time. + */ + readonly game: Phaser.Game; + + /** + * A reference to the global Game Scale Manager. + * Used for all bounds checks and pointer scaling. + */ + scaleManager: Phaser.Scale.ScaleManager; + + /** + * The Canvas that is used for all DOM event input listeners. + */ + canvas: HTMLCanvasElement; + + /** + * The Game Configuration object, as set during the game boot. + */ + config: Phaser.Core.Config; + + /** + * If set, the Input Manager will run its update loop every frame. + */ + enabled: boolean; + + /** + * The Event Emitter instance that the Input Manager uses to emit events from. + */ + events: Phaser.Events.EventEmitter; + + /** + * Are any mouse or touch pointers currently over the game canvas? + * This is updated automatically by the canvas over and out handlers. + */ + readonly isOver: boolean; + + /** + * The default CSS cursor to be used when interacting with your game. + * + * See the `setDefaultCursor` method for more details. + */ + defaultCursor: string; + + /** + * A reference to the Keyboard Manager class, if enabled via the `input.keyboard` Game Config property. + */ + keyboard: Phaser.Input.Keyboard.KeyboardManager; + + /** + * A reference to the Mouse Manager class, if enabled via the `input.mouse` Game Config property. + */ + mouse: Phaser.Input.Mouse.MouseManager; + + /** + * A reference to the Touch Manager class, if enabled via the `input.touch` Game Config property. + */ + touch: Phaser.Input.Touch.TouchManager; + + /** + * An array of Pointers that have been added to the game. + * The first entry is reserved for the Mouse Pointer, the rest are Touch Pointers. + * + * By default there is 1 touch pointer enabled. If you need more use the `addPointer` method to start them, + * or set the `input.activePointers` property in the Game Config. + */ + pointers: Phaser.Input.Pointer[]; + + /** + * The number of touch objects activated and being processed each update. + * + * You can change this by either calling `addPointer` at run-time, or by + * setting the `input.activePointers` property in the Game Config. + */ + readonly pointersTotal: integer; + + /** + * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. + * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer` + * which will always map to the most recently interacted pointer. + */ + mousePointer: Phaser.Input.Pointer; + + /** + * The most recently active Pointer object. + * + * If you've only 1 Pointer in your game then this will accurately be either the first finger touched, or the mouse. + * + * If your game doesn't need to support multi-touch then you can safely use this property in all of your game + * code and it will adapt to be either the mouse or the touch, based on device. + */ + activePointer: Phaser.Input.Pointer; + + /** + * If the top-most Scene in the Scene List receives an input it will stop input from + * propagating any lower down the scene list, i.e. if you have a UI Scene at the top + * and click something on it, that click will not then be passed down to any other + * Scene below. Disable this to have input events passed through all Scenes, all the time. + */ + globalTopOnly: boolean; + + /** + * The time this Input Manager was last updated. + * This value is populated by the Game Step each frame. + */ + readonly time: number; + + /** + * The Boot handler is called by Phaser.Game when it first starts up. + * The renderer is available by now. + */ + protected boot(): void; + + /** + * Tells the Input system to set a custom cursor. + * + * This cursor will be the default cursor used when interacting with the game canvas. + * + * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. + * + * Any valid CSS cursor value is allowed, including paths to image files, i.e.: + * + * ```javascript + * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); + * ``` + * + * Please read about the differences between browsers when it comes to the file formats and sizes they support: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property + * + * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support. + * @param cursor The CSS to be used when setting the default cursor. + */ + setDefaultCursor(cursor: string): void; + + /** + * Adds new Pointer objects to the Input Manager. + * + * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`. + * + * You can create more either by calling this method, or by setting the `input.activePointers` property + * in the Game Config, up to a maximum of 10 pointers. + * + * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added + * via this method. + * @param quantity The number of new Pointers to create. A maximum of 10 is allowed in total. Default 1. + */ + addPointer(quantity?: integer): Phaser.Input.Pointer[]; + + /** + * Internal method that gets a list of all the active Input Plugins in the game + * and updates each of them in turn, in reverse order (top to bottom), to allow + * for DOM top-level event handling simulation. + * @param type The type of event to process. + * @param pointers An array of Pointers on which the event occurred. + */ + updateInputPlugins(type: integer, pointers: Phaser.Input.Pointer[]): void; + + /** + * Performs a hit test using the given Pointer and camera, against an array of interactive Game Objects. + * + * The Game Objects are culled against the camera, and then the coordinates are translated into the local camera space + * and used to determine if they fall within the remaining Game Objects hit areas or not. + * + * If nothing is matched an empty array is returned. + * + * This method is called automatically by InputPlugin.hitTestPointer and doesn't usually need to be invoked directly. + * @param pointer The Pointer to test against. + * @param gameObjects An array of interactive Game Objects to check. + * @param camera The Camera which is being tested against. + * @param output An array to store the results in. If not given, a new empty array is created. + */ + hitTest(pointer: Phaser.Input.Pointer, gameObjects: any[], camera: Phaser.Cameras.Scene2D.Camera, output?: any[]): any[]; + + /** + * Checks if the given x and y coordinate are within the hit area of the Game Object. + * + * This method assumes that the coordinate values have already been translated into the space of the Game Object. + * + * If the coordinates are within the hit area they are set into the Game Objects Input `localX` and `localY` properties. + * @param gameObject The interactive Game Object to check against. + * @param x The translated x coordinate for the hit test. + * @param y The translated y coordinate for the hit test. + */ + pointWithinHitArea(gameObject: Phaser.GameObjects.GameObject, x: number, y: number): boolean; + + /** + * Checks if the given x and y coordinate are within the hit area of the Interactive Object. + * + * This method assumes that the coordinate values have already been translated into the space of the Interactive Object. + * + * If the coordinates are within the hit area they are set into the Interactive Objects Input `localX` and `localY` properties. + * @param object The Interactive Object to check against. + * @param x The translated x coordinate for the hit test. + * @param y The translated y coordinate for the hit test. + */ + pointWithinInteractiveObject(object: Phaser.Types.Input.InteractiveObject, x: number, y: number): boolean; + + /** + * Transforms the pageX and pageY values of a Pointer into the scaled coordinate space of the Input Manager. + * @param pointer The Pointer to transform the values for. + * @param pageX The Page X value. + * @param pageY The Page Y value. + * @param wasMove Are we transforming the Pointer from a move event, or an up / down event? + */ + transformPointer(pointer: Phaser.Input.Pointer, pageX: number, pageY: number, wasMove: boolean): void; + + /** + * Destroys the Input Manager and all of its systems. + * + * There is no way to recover from doing this. + */ + destroy(): void; + + } + + /** + * The Input Plugin belongs to a Scene and handles all input related events and operations for it. + * + * You can access it from within a Scene using `this.input`. + * + * It emits events directly. For example, you can do: + * + * ```javascript + * this.input.on('pointerdown', callback, context); + * ``` + * + * To listen for a pointer down event anywhere on the game canvas. + * + * Game Objects can be enabled for input by calling their `setInteractive` method. After which they + * will directly emit input events: + * + * ```javascript + * var sprite = this.add.sprite(x, y, texture); + * sprite.setInteractive(); + * sprite.on('pointerdown', callback, context); + * ``` + * + * There are lots of game configuration options available relating to input. + * See the [Input Config object]{@linkcode Phaser.Types.Core.InputConfig} for more details, including how to deal with Phaser + * listening for input events outside of the canvas, how to set a default number of pointers, input + * capture settings and more. + * + * Please also see the Input examples and tutorials for further information. + */ + class InputPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param scene A reference to the Scene that this Input Plugin is responsible for. + */ + constructor(scene: Phaser.Scene); + + /** + * An instance of the Gamepad Plugin class, if enabled via the `input.gamepad` Scene or Game Config property. + * Use this to create access Gamepads connected to the browser and respond to gamepad buttons. + */ + gamepad: Phaser.Input.Gamepad.GamepadPlugin; + + /** + * A reference to the Scene that this Input Plugin is responsible for. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems class. + */ + systems: Phaser.Scenes.Systems; + + /** + * A reference to the Scene Systems Settings. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * A reference to the Game Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * If `true` this Input Plugin will process DOM input events. + */ + enabled: boolean; + + /** + * A reference to the Scene Display List. This property is set during the `boot` method. + */ + displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene Cameras Manager. This property is set during the `boot` method. + */ + cameras: Phaser.Cameras.Scene2D.CameraManager; + + /** + * A reference to the Mouse Manager. + * + * This property is only set if Mouse support has been enabled in your Game Configuration file. + * + * If you just wish to get access to the mouse pointer, use the `mousePointer` property instead. + */ + mouse: Phaser.Input.Mouse.MouseManager; + + /** + * When set to `true` (the default) the Input Plugin will emulate DOM behavior by only emitting events from + * the top-most Game Objects in the Display List. + * + * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one. + */ + topOnly: boolean; + + /** + * How often should the Pointers be checked? + * + * The value is a time, given in ms, and is the time that must have elapsed between game steps before + * the Pointers will be polled again. When a pointer is polled it runs a hit test to see which Game + * Objects are currently below it, or being interacted with it. + * + * Pointers will *always* be checked if they have been moved by the user, or press or released. + * + * This property only controls how often they will be polled if they have not been updated. + * You should set this if you want to have Game Objects constantly check against the pointers, even + * if the pointer didn't itself move. + * + * Set to 0 to poll constantly. Set to -1 to only poll on user movement. + */ + pollRate: integer; + + /** + * The distance, in pixels, a pointer has to move while being held down, before it thinks it is being dragged. + */ + dragDistanceThreshold: number; + + /** + * The amount of time, in ms, a pointer has to be held down before it thinks it is dragging. + */ + dragTimeThreshold: number; + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + */ + isActive(): boolean; + + /** + * This is called automatically by the Input Manager. + * It emits events for plugins to listen to and also handles polling updates, if enabled. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updatePoll(time: number, delta: number): boolean; + + /** + * Clears a Game Object so it no longer has an Interactive Object associated with it. + * The Game Object is then queued for removal from the Input Plugin on the next update. + * @param gameObject The Game Object that will have its Interactive Object removed. + * @param skipQueue Skip adding this Game Object into the removal queue? Default false. + */ + clear(gameObject: Phaser.GameObjects.GameObject, skipQueue?: boolean): Phaser.GameObjects.GameObject; + + /** + * Disables Input on a single Game Object. + * + * An input disabled Game Object still retains its Interactive Object component and can be re-enabled + * at any time, by passing it to `InputPlugin.enable`. + * @param gameObject The Game Object to have its input system disabled. + */ + disable(gameObject: Phaser.GameObjects.GameObject): void; + + /** + * Enable a Game Object for interaction. + * + * If the Game Object already has an Interactive Object component, it is enabled and returned. + * + * Otherwise, a new Interactive Object component is created and assigned to the Game Object's `input` property. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * @param gameObject The Game Object to be enabled for input. + * @param shape Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param callback The 'contains' function to invoke to check if the pointer is within the hit area. + * @param dropZone Is this Game Object a drop zone or not? Default false. + */ + enable(gameObject: Phaser.GameObjects.GameObject, shape?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): Phaser.Input.InputPlugin; + + /** + * Takes the given Pointer and performs a hit test against it, to see which interactive Game Objects + * it is currently above. + * + * The hit test is performed against which-ever Camera the Pointer is over. If it is over multiple + * cameras, it starts checking the camera at the top of the camera list, and if nothing is found, iterates down the list. + * @param pointer The Pointer to check against the Game Objects. + */ + hitTestPointer(pointer: Phaser.Input.Pointer): Phaser.GameObjects.GameObject[]; + + /** + * Returns the drag state of the given Pointer for this Input Plugin. + * + * The state will be one of the following: + * + * 0 = Not dragging anything + * 1 = Primary button down and objects below, so collect a draglist + * 2 = Pointer being checked if meets drag criteria + * 3 = Pointer meets criteria, notify the draglist + * 4 = Pointer actively dragging the draglist and has moved + * 5 = Pointer actively dragging but has been released, notify draglist + * @param pointer The Pointer to get the drag state for. + */ + getDragState(pointer: Phaser.Input.Pointer): integer; + + /** + * Sets the drag state of the given Pointer for this Input Plugin. + * + * The state must be one of the following values: + * + * 0 = Not dragging anything + * 1 = Primary button down and objects below, so collect a draglist + * 2 = Pointer being checked if meets drag criteria + * 3 = Pointer meets criteria, notify the draglist + * 4 = Pointer actively dragging the draglist and has moved + * 5 = Pointer actively dragging but has been released, notify draglist + * @param pointer The Pointer to set the drag state for. + * @param state The drag state value. An integer between 0 and 5. + */ + setDragState(pointer: Phaser.Input.Pointer, state: integer): void; + + /** + * Sets the draggable state of the given array of Game Objects. + * + * They can either be set to be draggable, or can have their draggable state removed by passing `false`. + * + * A Game Object will not fire drag events unless it has been specifically enabled for drag. + * @param gameObjects An array of Game Objects to change the draggable state on. + * @param value Set to `true` if the Game Objects should be made draggable, `false` if they should be unset. Default true. + */ + setDraggable(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], value?: boolean): Phaser.Input.InputPlugin; + + /** + * Creates a function that can be passed to `setInteractive`, `enable` or `setHitArea` that will handle + * pixel-perfect input detection on an Image or Sprite based Game Object, or any custom class that extends them. + * + * The following will create a sprite that is clickable on any pixel that has an alpha value >= 1. + * + * ```javascript + * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect()); + * ``` + * + * The following will create a sprite that is clickable on any pixel that has an alpha value >= 150. + * + * ```javascript + * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect(150)); + * ``` + * + * Once you have made an Interactive Object pixel perfect it impacts all input related events for it: down, up, + * dragstart, drag, etc. + * + * As a pointer interacts with the Game Object it will constantly poll the texture, extracting a single pixel from + * the given coordinates and checking its color values. This is an expensive process, so should only be enabled on + * Game Objects that really need it. + * + * You cannot make non-texture based Game Objects pixel perfect. So this will not work on Graphics, BitmapText, + * Render Textures, Text, Tilemaps, Containers or Particles. + * @param alphaTolerance The alpha level that the pixel should be above to be included as a successful interaction. Default 1. + */ + makePixelPerfect(alphaTolerance?: integer): Function; + + /** + * Sets the hit area for the given array of Game Objects. + * + * A hit area is typically one of the geometric shapes Phaser provides, such as a `Phaser.Geom.Rectangle` + * or `Phaser.Geom.Circle`. However, it can be any object as long as it works with the provided callback. + * + * If no hit area is provided a Rectangle is created based on the size of the Game Object, if possible + * to calculate. + * + * The hit area callback is the function that takes an `x` and `y` coordinate and returns a boolean if + * those values fall within the area of the shape or not. All of the Phaser geometry objects provide this, + * such as `Phaser.Geom.Rectangle.Contains`. + * @param gameObjects An array of Game Objects to set the hit area on. + * @param shape Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param callback The 'contains' function to invoke to check if the pointer is within the hit area. + */ + setHitArea(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], shape?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Circle` shape, using + * the given coordinates and radius to control its position and size. + * @param gameObjects An array of Game Objects to set as having a circle hit area. + * @param x The center of the circle. + * @param y The center of the circle. + * @param radius The radius of the circle. + * @param callback The hit area callback. If undefined it uses Circle.Contains. + */ + setHitAreaCircle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, radius: number, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Ellipse` shape, using + * the given coordinates and dimensions to control its position and size. + * @param gameObjects An array of Game Objects to set as having an ellipse hit area. + * @param x The center of the ellipse. + * @param y The center of the ellipse. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + * @param callback The hit area callback. If undefined it uses Ellipse.Contains. + */ + setHitAreaEllipse(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, width: number, height: number, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using + * the Game Objects texture frame to define the position and size of the hit area. + * @param gameObjects An array of Game Objects to set as having an ellipse hit area. + * @param callback The hit area callback. If undefined it uses Rectangle.Contains. + */ + setHitAreaFromTexture(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using + * the given coordinates and dimensions to control its position and size. + * @param gameObjects An array of Game Objects to set as having a rectangular hit area. + * @param x The top-left of the rectangle. + * @param y The top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param callback The hit area callback. If undefined it uses Rectangle.Contains. + */ + setHitAreaRectangle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, width: number, height: number, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Triangle` shape, using + * the given coordinates to control the position of its points. + * @param gameObjects An array of Game Objects to set as having a triangular hit area. + * @param x1 The x coordinate of the first point of the triangle. + * @param y1 The y coordinate of the first point of the triangle. + * @param x2 The x coordinate of the second point of the triangle. + * @param y2 The y coordinate of the second point of the triangle. + * @param x3 The x coordinate of the third point of the triangle. + * @param y3 The y coordinate of the third point of the triangle. + * @param callback The hit area callback. If undefined it uses Triangle.Contains. + */ + setHitAreaTriangle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the Pointers to always poll. + * + * When a pointer is polled it runs a hit test to see which Game Objects are currently below it, + * or being interacted with it, regardless if the Pointer has actually moved or not. + * + * You should enable this if you want objects in your game to fire over / out events, and the objects + * are constantly moving, but the pointer may not have. Polling every frame has additional computation + * costs, especially if there are a large number of interactive objects in your game. + */ + setPollAlways(): Phaser.Input.InputPlugin; + + /** + * Sets the Pointers to only poll when they are moved or updated. + * + * When a pointer is polled it runs a hit test to see which Game Objects are currently below it, + * or being interacted with it. + */ + setPollOnMove(): Phaser.Input.InputPlugin; + + /** + * Sets the poll rate value. This is the amount of time that should have elapsed before a pointer + * will be polled again. See the `setPollAlways` and `setPollOnMove` methods. + * @param value The amount of time, in ms, that should elapsed before re-polling the pointers. + */ + setPollRate(value: number): Phaser.Input.InputPlugin; + + /** + * When set to `true` the global Input Manager will emulate DOM behavior by only emitting events from + * the top-most Scene in the Scene List. By default, if a Scene receives an input event it will then stop the event + * from flowing down to any Scenes below it in the Scene list. To disable this behavior call this method with `false`. + * @param value Set to `true` to stop processing input events on the Scene that receives it, or `false` to let the event continue down the Scene list. + */ + setGlobalTopOnly(value: boolean): Phaser.Input.InputPlugin; + + /** + * When set to `true` this Input Plugin will emulate DOM behavior by only emitting events from + * the top-most Game Objects in the Display List. + * + * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one. + * @param value `true` to only include the top-most Game Object, or `false` to include all Game Objects in a hit test. + */ + setTopOnly(value: boolean): Phaser.Input.InputPlugin; + + /** + * Given an array of Game Objects, sort the array and return it, so that the objects are in depth index order + * with the lowest at the bottom. + * @param gameObjects An array of Game Objects to be sorted. + */ + sortGameObjects(gameObjects: Phaser.GameObjects.GameObject[]): Phaser.GameObjects.GameObject[]; + + /** + * This method should be called from within an input event handler, such as `pointerdown`. + * + * When called, it stops the Input Manager from allowing _this specific event_ to be processed by any other Scene + * not yet handled in the scene list. + */ + stopPropagation(): Phaser.Input.InputPlugin; + + /** + * Adds new Pointer objects to the Input Manager. + * + * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`. + * + * You can create more either by calling this method, or by setting the `input.activePointers` property + * in the Game Config, up to a maximum of 10 pointers. + * + * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added + * via this method. + * @param quantity The number of new Pointers to create. A maximum of 10 is allowed in total. Default 1. + */ + addPointer(quantity?: integer): Phaser.Input.Pointer[]; + + /** + * Tells the Input system to set a custom cursor. + * + * This cursor will be the default cursor used when interacting with the game canvas. + * + * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. + * + * Any valid CSS cursor value is allowed, including paths to image files, i.e.: + * + * ```javascript + * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); + * ``` + * + * Please read about the differences between browsers when it comes to the file formats and sizes they support: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property + * + * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support. + * @param cursor The CSS to be used when setting the default cursor. + */ + setDefaultCursor(cursor: string): Phaser.Input.InputPlugin; + + /** + * The x coordinates of the ActivePointer based on the first camera in the camera list. + * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch. + */ + readonly x: number; + + /** + * The y coordinates of the ActivePointer based on the first camera in the camera list. + * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch. + */ + readonly y: number; + + /** + * Are any mouse or touch pointers currently over the game canvas? + */ + readonly isOver: boolean; + + /** + * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. + * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer` + * which will always map to the most recently interacted pointer. + */ + readonly mousePointer: Phaser.Input.Pointer; + + /** + * The current active input Pointer. + */ + readonly activePointer: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer1: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer2: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer3: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer4: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer5: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer6: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer7: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer8: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer9: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer10: Phaser.Input.Pointer; + + /** + * An instance of the Keyboard Plugin class, if enabled via the `input.keyboard` Scene or Game Config property. + * Use this to create Key objects and listen for keyboard specific events. + */ + keyboard: Phaser.Input.Keyboard.KeyboardPlugin; + + } + + namespace InputPluginCache { + /** + * Static method called directly by the Core internal Plugins. + * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) + * Plugin is the object to instantiate to create the plugin + * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) + */ + var register: Function; + + /** + * Returns the input plugin object from the cache based on the given key. + */ + var getCore: Function; + + /** + * Installs all of the registered Input Plugins into the given target. + */ + var install: Function; + + /** + * Removes an input plugin based on the given key. + */ + var remove: Function; + + } + + namespace Keyboard { + /** + * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them + * it will emit a `keycombomatch` event from the Keyboard Manager. + * + * The keys to be listened for can be defined as: + * + * A string (i.e. 'ATARI') + * An array of either integers (key codes) or strings, or a mixture of both + * An array of objects (such as Key objects) with a public 'keyCode' property + * + * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter) + * you could pass the following array of key codes: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + * + * Or, to listen for the user entering the word PHASER: + * + * ```javascript + * this.input.keyboard.createCombo('PHASER'); + * ``` + */ + class KeyCombo { + /** + * + * @param keyboardPlugin A reference to the Keyboard Plugin. + * @param keys The keys that comprise this combo. + * @param config A Key Combo configuration object. + */ + constructor(keyboardPlugin: Phaser.Input.Keyboard.KeyboardPlugin, keys: string | integer[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig); + + /** + * A reference to the Keyboard Manager + */ + manager: Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * A flag that controls if this Key Combo is actively processing keys or not. + */ + enabled: boolean; + + /** + * An array of the keycodes that comprise this combo. + */ + keyCodes: any[]; + + /** + * The current keyCode the combo is waiting for. + */ + current: integer; + + /** + * The current index of the key being waited for in the 'keys' string. + */ + index: integer; + + /** + * The length of this combo (in keycodes) + */ + size: number; + + /** + * The time the previous key in the combo was matched. + */ + timeLastMatched: number; + + /** + * Has this Key Combo been matched yet? + */ + matched: boolean; + + /** + * The time the entire combo was matched. + */ + timeMatched: number; + + /** + * If they press the wrong key do we reset the combo? + */ + resetOnWrongKey: boolean; + + /** + * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. + */ + maxKeyDelay: integer; + + /** + * If previously matched and they press the first key of the combo again, will it reset? + */ + resetOnMatch: boolean; + + /** + * If the combo matches, will it delete itself? + */ + deleteOnMatch: boolean; + + /** + * How far complete is this combo? A value between 0 and 1. + */ + readonly progress: number; + + /** + * Destroys this Key Combo and all of its references. + */ + destroy(): void; + + } + + namespace Events { + /** + * The Global Key Down Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. + * + * Listen to this event from within a Scene using: `this.input.keyboard.on('keydown', listener)`. + * + * You can also listen for a specific key being pressed. See [Keyboard.Events.KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_DOWN} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. + * + * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. + * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * There are others. So, please check your extensions if you find you have specific keys that don't work. + */ + const ANY_KEY_DOWN: any; + + /** + * The Global Key Up Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. + * + * Listen to this event from within a Scene using: `this.input.keyboard.on('keyup', listener)`. + * + * You can also listen for a specific key being released. See [Keyboard.Events.KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_UP} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. + */ + const ANY_KEY_UP: any; + + /** + * The Key Combo Match Event. + * + * This event is dispatched by the Keyboard Plugin when a [Key Combo]{@link Phaser.Input.Keyboard.KeyCombo} is matched. + * + * Listen for this event from the Key Plugin after a combo has been created: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + */ + const COMBO_MATCH: any; + + /** + * The Key Down Event. + * + * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is pressed. + * + * Listen for this event from the Key object instance directly: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * + * spaceBar.on('down', listener) + * ``` + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. + */ + const DOWN: any; + + /** + * The Key Down Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. + * + * Unlike the `ANY_KEY_DOWN` event, this one has a special dynamic event name. For example, to listen for the `A` key being pressed + * use the following from within a Scene: `this.input.keyboard.on('keydown-A', listener)`. You can replace the `-A` part of the event + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * `this.input.keyboard.on('keydown-SPACE', listener)`. + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. + * + * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. + * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * There are others. So, please check your extensions if you find you have specific keys that don't work. + */ + const KEY_DOWN: any; + + /** + * The Key Up Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. + * + * Unlike the `ANY_KEY_UP` event, this one has a special dynamic event name. For example, to listen for the `A` key being released + * use the following from within a Scene: `this.input.keyboard.on('keyup-A', listener)`. You can replace the `-A` part of the event + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * `this.input.keyboard.on('keyup-SPACE', listener)`. + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. + */ + const KEY_UP: any; + + /** + * The Key Up Event. + * + * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is released. + * + * Listen for this event from the Key object instance directly: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * + * spaceBar.on('up', listener) + * ``` + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. + */ + const UP: any; + + } + + /** + * The Keyboard Manager is a helper class that belongs to the global Input Manager. + * + * Its role is to listen for native DOM Keyboard Events and then store them for further processing by the Keyboard Plugin. + * + * You do not need to create this class directly, the Input Manager will create an instance of it automatically if keyboard + * input has been enabled in the Game Config. + */ + class KeyboardManager { + /** + * + * @param inputManager A reference to the Input Manager. + */ + constructor(inputManager: Phaser.Input.InputManager); + + /** + * A reference to the Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * A flag that controls if the non-modified keys, matching those stored in the `captures` array, + * have `preventDefault` called on them or not. + * + * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are + * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows). + * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier. + * However, if the user presses just the r key on its own, it will have its event prevented. + * + * If you wish to stop capturing the keys, for example switching out to a DOM based element, then + * you can toggle this property at run-time. + */ + preventDefault: boolean; + + /** + * An array of Key Code values that will automatically have `preventDefault` called on them, + * as long as the `KeyboardManager.preventDefault` boolean is set to `true`. + * + * By default the array is empty. + * + * The key must be non-modified when pressed in order to be captured. + * + * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are + * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows). + * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier. + * However, if the user presses just the r key on its own, it will have its event prevented. + * + * If you wish to stop capturing the keys, for example switching out to a DOM based element, then + * you can toggle the `KeyboardManager.preventDefault` boolean at run-time. + * + * If you need more specific control, you can create Key objects and set the flag on each of those instead. + * + * This array can be populated via the Game Config by setting the `input.keyboard.capture` array, or you + * can call the `addCapture` method. See also `removeCapture` and `clearCaptures`. + */ + captures: integer[]; + + /** + * A boolean that controls if the Keyboard Manager is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * The Keyboard Event target, as defined in the Game Config. + * Typically the window in which the game is rendering, but can be any interactive DOM element. + */ + target: any; + + /** + * The Key Down Event handler. + * This function is sent the native DOM KeyEvent. + * Initially empty and bound in the `startListeners` method. + */ + onKeyDown: Function; + + /** + * The Key Up Event handler. + * This function is sent the native DOM KeyEvent. + * Initially empty and bound in the `startListeners` method. + */ + onKeyUp: Function; + + /** + * Starts the Keyboard Event listeners running. + * This is called automatically and does not need to be manually invoked. + */ + startListeners(): void; + + /** + * Stops the Key Event listeners. + * This is called automatically and does not need to be manually invoked. + */ + stopListeners(): void; + + /** + * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. + * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. + * + * This `addCapture` method enables consuming keyboard event for specific keys so it doesn't bubble up to the the browser + * and cause the default browser behavior. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent + * the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one. + * + * You can pass in a single key code value, or an array of key codes, or a string: + * + * ```javascript + * this.input.keyboard.addCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.addCapture([ 62, 63, 64 ]); + * ``` + * + * Or a string: + * + * ```javascript + * this.input.keyboard.addCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * + * If there are active captures after calling this method, the `preventDefault` property is set to `true`. + * @param keycode The Key Codes to enable capture for, preventing them reaching the browser. + */ + addCapture(keycode: string | integer | integer[] | any[]): void; + + /** + * Removes an existing key capture. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to remove + * the capture of a key, then it will remove it for any Scene in your game, not just the calling one. + * + * You can pass in a single key code value, or an array of key codes, or a string: + * + * ```javascript + * this.input.keyboard.removeCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.removeCapture([ 62, 63, 64 ]); + * ``` + * + * Or a string: + * + * ```javascript + * this.input.keyboard.removeCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * + * If there are no captures left after calling this method, the `preventDefault` property is set to `false`. + * @param keycode The Key Codes to disable capture for, allowing them reaching the browser again. + */ + removeCapture(keycode: string | integer | integer[] | any[]): void; + + /** + * Removes all keyboard captures and sets the `preventDefault` property to `false`. + */ + clearCaptures(): void; + + /** + * Destroys this Keyboard Manager instance. + */ + destroy(): void; + + } + + /** + * The Keyboard Plugin is an input plugin that belongs to the Scene-owned Input system. + * + * Its role is to listen for native DOM Keyboard Events and then process them. + * + * You do not need to create this class directly, the Input system will create an instance of it automatically. + * + * You can access it from within a Scene using `this.input.keyboard`. For example, you can do: + * + * ```javascript + * this.input.keyboard.on('keydown', callback, context); + * ``` + * + * Or, to listen for a specific key: + * + * ```javascript + * this.input.keyboard.on('keydown-A', callback, context); + * ``` + * + * You can also create Key objects, which you can then poll in your game loop: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * ``` + * + * If you have multiple parallel Scenes, each trying to get keyboard input, be sure to disable capture on them to stop them from + * stealing input from another Scene in the list. You can do this with `this.input.keyboard.enabled = false` within the + * Scene to stop all input, or `this.input.keyboard.preventDefault = false` to stop a Scene halting input on another Scene. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details. + * + * Also please be aware that certain browser extensions can disable or override Phaser keyboard handling. + * For example the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * And there are others. So, please check your extensions before opening Phaser issues about keys that don't work. + */ + class KeyboardPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param sceneInputPlugin A reference to the Scene Input Plugin that the KeyboardPlugin belongs to. + */ + constructor(sceneInputPlugin: Phaser.Input.InputPlugin); + + /** + * A reference to the core game, so we can listen for visibility events. + */ + game: Phaser.Game; + + /** + * A reference to the Scene that this Input Plugin is responsible for. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems Settings. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * A reference to the Scene Input Plugin that created this Keyboard Plugin. + */ + sceneInputPlugin: Phaser.Input.InputPlugin; + + /** + * A reference to the global Keyboard Manager. + */ + manager: Phaser.Input.InputPlugin; + + /** + * A boolean that controls if this Keyboard Plugin is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * An array of Key objects to process. + */ + keys: Phaser.Input.Keyboard.Key[]; + + /** + * An array of KeyCombo objects to process. + */ + combos: Phaser.Input.Keyboard.KeyCombo[]; + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + */ + isActive(): boolean; + + /** + * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. + * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. + * + * This `addCapture` method enables consuming keyboard events for specific keys, so they don't bubble up the browser + * and cause the default behaviors. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent + * the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one. + * + * You can pass a single key code value: + * + * ```javascript + * this.input.keyboard.addCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.addCapture([ 62, 63, 64 ]); + * ``` + * + * Or, a comma-delimited string: + * + * ```javascript + * this.input.keyboard.addCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * @param keycode The Key Codes to enable event capture for. + */ + addCapture(keycode: string | integer | integer[] | any[]): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Removes an existing key capture. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to remove + * the capture of a key, then it will remove it for any Scene in your game, not just the calling one. + * + * You can pass a single key code value: + * + * ```javascript + * this.input.keyboard.removeCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.removeCapture([ 62, 63, 64 ]); + * ``` + * + * Or, a comma-delimited string: + * + * ```javascript + * this.input.keyboard.removeCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * @param keycode The Key Codes to disable event capture for. + */ + removeCapture(keycode: string | integer | integer[] | any[]): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Returns an array that contains all of the keyboard captures currently enabled. + */ + getCaptures(): integer[]; + + /** + * Allows Phaser to prevent any key captures you may have defined from bubbling up the browser. + * You can use this to re-enable event capturing if you had paused it via `disableGlobalCapture`. + */ + enableGlobalCapture(): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Disables Phaser from preventing any key captures you may have defined, without actually removing them. + * You can use this to temporarily disable event capturing if, for example, you swap to a DOM element. + */ + disableGlobalCapture(): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Removes all keyboard captures. + * + * Note that this is a global change. It will clear all event captures across your game, not just for this specific Scene. + */ + clearCaptures(): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Creates and returns an object containing 4 hotkeys for Up, Down, Left and Right, and also Space Bar and shift. + */ + createCursorKeys(): Phaser.Types.Input.Keyboard.CursorKeys; + + /** + * A practical way to create an object containing user selected hotkeys. + * + * For example: + * + * ```javascript + * this.input.keyboard.addKeys({ 'up': Phaser.Input.Keyboard.KeyCodes.W, 'down': Phaser.Input.Keyboard.KeyCodes.S }); + * ``` + * + * would return an object containing the properties (`up` and `down`) mapped to W and S {@link Phaser.Input.Keyboard.Key} objects. + * + * You can also pass in a comma-separated string: + * + * ```javascript + * this.input.keyboard.addKeys('W,S,A,D'); + * ``` + * + * Which will return an object with the properties W, S, A and D mapped to the relevant Key objects. + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * @param keys An object containing Key Codes, or a comma-separated string. + * @param enableCapture Automatically call `preventDefault` on the native DOM browser event for the key codes being added. Default true. + * @param emitOnRepeat Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). Default false. + */ + addKeys(keys: object | string, enableCapture?: boolean, emitOnRepeat?: boolean): object; + + /** + * Adds a Key object to this Keyboard Plugin. + * + * The given argument can be either an existing Key object, a string, such as `A` or `SPACE`, or a key code value. + * + * If a Key object is given, and one already exists matching the same key code, the existing one is replaced with the new one. + * @param key Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param enableCapture Automatically call `preventDefault` on the native DOM browser event for the key codes being added. Default true. + * @param emitOnRepeat Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). Default false. + */ + addKey(key: Phaser.Input.Keyboard.Key | string | integer, enableCapture?: boolean, emitOnRepeat?: boolean): Phaser.Input.Keyboard.Key; + + /** + * Removes a Key object from this Keyboard Plugin. + * + * The given argument can be either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param key Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param destroy Call `Key.destroy` on the removed Key object? Default false. + */ + removeKey(key: Phaser.Input.Keyboard.Key | string | integer, destroy?: boolean): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Creates a new KeyCombo. + * + * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them + * it will emit a `keycombomatch` event from this Keyboard Plugin. + * + * The keys to be listened for can be defined as: + * + * A string (i.e. 'ATARI') + * An array of either integers (key codes) or strings, or a mixture of both + * An array of objects (such as Key objects) with a public 'keyCode' property + * + * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter) + * you could pass the following array of key codes: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + * + * Or, to listen for the user entering the word PHASER: + * + * ```javascript + * this.input.keyboard.createCombo('PHASER'); + * ``` + * @param keys The keys that comprise this combo. + * @param config A Key Combo configuration object. + */ + createCombo(keys: string | integer[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig): Phaser.Input.Keyboard.KeyCombo; + + /** + * Checks if the given Key object is currently being held down. + * + * The difference between this method and checking the `Key.isDown` property directly is that you can provide + * a duration to this method. For example, if you wanted a key press to fire a bullet, but you only wanted + * it to be able to fire every 100ms, then you can call this method with a `duration` of 100 and it + * will only return `true` every 100ms. + * + * If the Keyboard Plugin has been disabled, this method will always return `false`. + * @param key A Key object. + * @param duration The duration which must have elapsed before this Key is considered as being down. Default 0. + */ + checkDown(key: Phaser.Input.Keyboard.Key, duration?: number): boolean; + + /** + * Resets all Key objects created by _this_ Keyboard Plugin back to their default un-pressed states. + * This can only reset keys created via the `addKey`, `addKeys` or `createCursorKeys` methods. + * If you have created a Key object directly you'll need to reset it yourself. + * + * This method is called automatically when the Keyboard Plugin shuts down, but can be + * invoked directly at any time you require. + */ + resetKeys(): Phaser.Input.Keyboard.KeyboardPlugin; + + } + + /** + * Returns `true` if the Key was pressed down within the `duration` value given, based on the current + * game clock time. Or `false` if it either isn't down, or was pressed down longer ago than the given duration. + * @param key The Key object to test. + * @param duration The duration, in ms, within which the key must have been pressed down. Default 50. + */ + function DownDuration(key: Phaser.Input.Keyboard.Key, duration?: integer): boolean; + + /** + * The justDown value allows you to test if this Key has just been pressed down or not. + * + * When you check this value it will return `true` if the Key is down, otherwise `false`. + * + * You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. + * This allows you to use it in situations where you want to check if this key is down without using an event, such as in a core game loop. + * @param key The Key to check to see if it's just down or not. + */ + function JustDown(key: Phaser.Input.Keyboard.Key): boolean; + + /** + * The justUp value allows you to test if this Key has just been released or not. + * + * When you check this value it will return `true` if the Key is up, otherwise `false`. + * + * You can only call JustUp once per key release. It will only return `true` once, until the Key is pressed down and released again. + * This allows you to use it in situations where you want to check if this key is up without using an event, such as in a core game loop. + * @param key The Key to check to see if it's just up or not. + */ + function JustUp(key: Phaser.Input.Keyboard.Key): boolean; + + /** + * A generic Key object which can be passed to the Process functions (and so on) + * keycode must be an integer + */ + class Key extends Phaser.Events.EventEmitter { + /** + * + * @param plugin The Keyboard Plugin instance that owns this Key object. + * @param keyCode The keycode of this key. + */ + constructor(plugin: Phaser.Input.Keyboard.KeyboardPlugin, keyCode: integer); + + /** + * The Keyboard Plugin instance that owns this Key object. + */ + plugin: Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * The keycode of this key. + */ + keyCode: integer; + + /** + * The original DOM event. + */ + originalEvent: KeyboardEvent; + + /** + * Can this Key be processed? + */ + enabled: boolean; + + /** + * The "down" state of the key. This will remain `true` for as long as the keyboard thinks this key is held down. + */ + isDown: boolean; + + /** + * The "up" state of the key. This will remain `true` for as long as the keyboard thinks this key is up. + */ + isUp: boolean; + + /** + * The down state of the ALT key, if pressed at the same time as this key. + */ + altKey: boolean; + + /** + * The down state of the CTRL key, if pressed at the same time as this key. + */ + ctrlKey: boolean; + + /** + * The down state of the SHIFT key, if pressed at the same time as this key. + */ + shiftKey: boolean; + + /** + * The down state of the Meta key, if pressed at the same time as this key. + * On a Mac the Meta Key is the Command key. On Windows keyboards, it's the Windows key. + */ + metaKey: boolean; + + /** + * The location of the modifier key. 0 for standard (or unknown), 1 for left, 2 for right, 3 for numpad. + */ + location: number; + + /** + * The timestamp when the key was last pressed down. + */ + timeDown: number; + + /** + * The number of milliseconds this key was held down for in the previous down - up sequence. + * This value isn't updated every game step, only when the Key changes state. + * To get the current duration use the `getDuration` method. + */ + duration: number; + + /** + * The timestamp when the key was last released. + */ + timeUp: number; + + /** + * When a key is held down should it continuously fire the `down` event each time it repeats? + * + * By default it will emit the `down` event just once, but if you wish to receive the event + * for each repeat as well, enable this property. + */ + emitOnRepeat: boolean; + + /** + * If a key is held down this holds down the number of times the key has 'repeated'. + */ + repeats: number; + + /** + * Controls if this Key will continuously emit a `down` event while being held down (true), + * or emit the event just once, on first press, and then skip future events (false). + * @param value Emit `down` events on repeated key down actions, or just once? + */ + setEmitOnRepeat(value: boolean): Phaser.Input.Keyboard.Key; + + /** + * Processes the Key Down action for this Key. + * Called automatically by the Keyboard Plugin. + * @param event The native DOM Keyboard event. + */ + onDown(event: KeyboardEvent): void; + + /** + * Processes the Key Up action for this Key. + * Called automatically by the Keyboard Plugin. + * @param event The native DOM Keyboard event. + */ + onUp(event: KeyboardEvent): void; + + /** + * Resets this Key object back to its default un-pressed state. + */ + reset(): Phaser.Input.Keyboard.Key; + + /** + * Returns the duration, in ms, that the Key has been held down for. + * + * If the key is not currently down it will return zero. + * + * The get the duration the Key was held down for in the previous up-down cycle, + * use the `Key.duration` property value instead. + */ + getDuration(): number; + + /** + * Removes any bound event handlers and removes local references. + */ + destroy(): void; + + } + + /** + * Keyboard Codes. + */ + namespace KeyCodes { + /** + * The BACKSPACE key. + */ + var BACKSPACE: integer; + + /** + * The TAB key. + */ + var TAB: integer; + + /** + * The ENTER key. + */ + var ENTER: integer; + + /** + * The SHIFT key. + */ + var SHIFT: integer; + + /** + * The CTRL key. + */ + var CTRL: integer; + + /** + * The ALT key. + */ + var ALT: integer; + + /** + * The PAUSE key. + */ + var PAUSE: integer; + + /** + * The CAPS_LOCK key. + */ + var CAPS_LOCK: integer; + + /** + * The ESC key. + */ + var ESC: integer; + + /** + * The SPACE key. + */ + var SPACE: integer; + + /** + * The PAGE_UP key. + */ + var PAGE_UP: integer; + + /** + * The PAGE_DOWN key. + */ + var PAGE_DOWN: integer; + + /** + * The END key. + */ + var END: integer; + + /** + * The HOME key. + */ + var HOME: integer; + + /** + * The LEFT key. + */ + var LEFT: integer; + + /** + * The UP key. + */ + var UP: integer; + + /** + * The RIGHT key. + */ + var RIGHT: integer; + + /** + * The DOWN key. + */ + var DOWN: integer; + + /** + * The PRINT_SCREEN key. + */ + var PRINT_SCREEN: integer; + + /** + * The INSERT key. + */ + var INSERT: integer; + + /** + * The DELETE key. + */ + var DELETE: integer; + + /** + * The ZERO key. + */ + var ZERO: integer; + + /** + * The ONE key. + */ + var ONE: integer; + + /** + * The TWO key. + */ + var TWO: integer; + + /** + * The THREE key. + */ + var THREE: integer; + + /** + * The FOUR key. + */ + var FOUR: integer; + + /** + * The FIVE key. + */ + var FIVE: integer; + + /** + * The SIX key. + */ + var SIX: integer; + + /** + * The SEVEN key. + */ + var SEVEN: integer; + + /** + * The EIGHT key. + */ + var EIGHT: integer; + + /** + * The NINE key. + */ + var NINE: integer; + + /** + * The NUMPAD_ZERO key. + */ + var NUMPAD_ZERO: integer; + + /** + * The NUMPAD_ONE key. + */ + var NUMPAD_ONE: integer; + + /** + * The NUMPAD_TWO key. + */ + var NUMPAD_TWO: integer; + + /** + * The NUMPAD_THREE key. + */ + var NUMPAD_THREE: integer; + + /** + * The NUMPAD_FOUR key. + */ + var NUMPAD_FOUR: integer; + + /** + * The NUMPAD_FIVE key. + */ + var NUMPAD_FIVE: integer; + + /** + * The NUMPAD_SIX key. + */ + var NUMPAD_SIX: integer; + + /** + * The NUMPAD_SEVEN key. + */ + var NUMPAD_SEVEN: integer; + + /** + * The NUMPAD_EIGHT key. + */ + var NUMPAD_EIGHT: integer; + + /** + * The NUMPAD_NINE key. + */ + var NUMPAD_NINE: integer; + + /** + * The A key. + */ + var A: integer; + + /** + * The B key. + */ + var B: integer; + + /** + * The C key. + */ + var C: integer; + + /** + * The D key. + */ + var D: integer; + + /** + * The E key. + */ + var E: integer; + + /** + * The F key. + */ + var F: integer; + + /** + * The G key. + */ + var G: integer; + + /** + * The H key. + */ + var H: integer; + + /** + * The I key. + */ + var I: integer; + + /** + * The J key. + */ + var J: integer; + + /** + * The K key. + */ + var K: integer; + + /** + * The L key. + */ + var L: integer; + + /** + * The M key. + */ + var M: integer; + + /** + * The N key. + */ + var N: integer; + + /** + * The O key. + */ + var O: integer; + + /** + * The P key. + */ + var P: integer; + + /** + * The Q key. + */ + var Q: integer; + + /** + * The R key. + */ + var R: integer; + + /** + * The S key. + */ + var S: integer; + + /** + * The T key. + */ + var T: integer; + + /** + * The U key. + */ + var U: integer; + + /** + * The V key. + */ + var V: integer; + + /** + * The W key. + */ + var W: integer; + + /** + * The X key. + */ + var X: integer; + + /** + * The Y key. + */ + var Y: integer; + + /** + * The Z key. + */ + var Z: integer; + + /** + * The F1 key. + */ + var F1: integer; + + /** + * The F2 key. + */ + var F2: integer; + + /** + * The F3 key. + */ + var F3: integer; + + /** + * The F4 key. + */ + var F4: integer; + + /** + * The F5 key. + */ + var F5: integer; + + /** + * The F6 key. + */ + var F6: integer; + + /** + * The F7 key. + */ + var F7: integer; + + /** + * The F8 key. + */ + var F8: integer; + + /** + * The F9 key. + */ + var F9: integer; + + /** + * The F10 key. + */ + var F10: integer; + + /** + * The F11 key. + */ + var F11: integer; + + /** + * The F12 key. + */ + var F12: integer; + + /** + * The SEMICOLON key. + */ + var SEMICOLON: integer; + + /** + * The PLUS key. + */ + var PLUS: integer; + + /** + * The COMMA key. + */ + var COMMA: integer; + + /** + * The MINUS key. + */ + var MINUS: integer; + + /** + * The PERIOD key. + */ + var PERIOD: integer; + + /** + * The FORWARD_SLASH key. + */ + var FORWARD_SLASH: integer; + + /** + * The BACK_SLASH key. + */ + var BACK_SLASH: integer; + + /** + * The QUOTES key. + */ + var QUOTES: integer; + + /** + * The BACKTICK key. + */ + var BACKTICK: integer; + + /** + * The OPEN_BRACKET key. + */ + var OPEN_BRACKET: integer; + + /** + * The CLOSED_BRACKET key. + */ + var CLOSED_BRACKET: integer; + + /** + * The SEMICOLON_FIREFOX key. + */ + var SEMICOLON_FIREFOX: integer; + + /** + * The COLON key. + */ + var COLON: integer; + + /** + * The COMMA_FIREFOX_WINDOWS key. + */ + var COMMA_FIREFOX_WINDOWS: integer; + + /** + * The COMMA_FIREFOX key. + */ + var COMMA_FIREFOX: integer; + + /** + * The BRACKET_RIGHT_FIREFOX key. + */ + var BRACKET_RIGHT_FIREFOX: integer; + + /** + * The BRACKET_LEFT_FIREFOX key. + */ + var BRACKET_LEFT_FIREFOX: integer; + + } + + /** + * Returns `true` if the Key was released within the `duration` value given, based on the current + * game clock time. Or returns `false` if it either isn't up, or was released longer ago than the given duration. + * @param key The Key object to test. + * @param duration The duration, in ms, within which the key must have been released. Default 50. + */ + function UpDuration(key: Phaser.Input.Keyboard.Key, duration?: integer): boolean; + + } + + namespace Mouse { + /** + * The Mouse Manager is a helper class that belongs to the Input Manager. + * + * Its role is to listen for native DOM Mouse Events and then pass them onto the Input Manager for further processing. + * + * You do not need to create this class directly, the Input Manager will create an instance of it automatically. + */ + class MouseManager { + /** + * + * @param inputManager A reference to the Input Manager. + */ + constructor(inputManager: Phaser.Input.InputManager); + + /** + * A reference to the Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * If true the DOM mouse events will have event.preventDefault applied to them, if false they will propagate fully. + */ + capture: boolean; + + /** + * A boolean that controls if the Mouse Manager is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * The Touch Event target, as defined in the Game Config. + * Typically the canvas to which the game is rendering, but can be any interactive DOM element. + */ + target: any; + + /** + * If the mouse has been pointer locked successfully this will be set to true. + */ + locked: boolean; + + /** + * The Mouse Move Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseMove: Function; + + /** + * The Mouse Down Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseDown: Function; + + /** + * The Mouse Up Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseUp: Function; + + /** + * The Mouse Down Event handler specifically for events on the Window. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseDownWindow: Function; + + /** + * The Mouse Up Event handler specifically for events on the Window. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseUpWindow: Function; + + /** + * The Mouse Over Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseOver: Function; + + /** + * The Mouse Out Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseOut: Function; + + /** + * The Mouse Wheel Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseWheel: Function; + + /** + * Internal pointerLockChange handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + pointerLockChange: Function; + + /** + * Attempts to disable the context menu from appearing if you right-click on the browser. + * + * Works by listening for the `contextmenu` event and prevent defaulting it. + * + * Use this if you need to enable right-button mouse support in your game, and the browser + * menu keeps getting in the way. + */ + disableContextMenu(): Phaser.Input.Mouse.MouseManager; + + /** + * If the browser supports it, you can request that the pointer be locked to the browser window. + * + * This is classically known as 'FPS controls', where the pointer can't leave the browser until + * the user presses an exit key. + * + * If the browser successfully enters a locked state, a `POINTER_LOCK_CHANGE_EVENT` will be dispatched, + * from the games Input Manager, with an `isPointerLocked` property. + * + * It is important to note that pointer lock can only be enabled after an 'engagement gesture', + * see: https://w3c.github.io/pointerlock/#dfn-engagement-gesture. + */ + requestPointerLock(): void; + + /** + * If the browser supports pointer lock, this will request that the pointer lock is released. If + * the browser successfully enters a locked state, a 'POINTER_LOCK_CHANGE_EVENT' will be + * dispatched - from the game's input manager - with an `isPointerLocked` property. + */ + releasePointerLock(): void; + + /** + * Starts the Mouse Event listeners running. + * This is called automatically and does not need to be manually invoked. + */ + startListeners(): void; + + /** + * Stops the Mouse Event listeners. + * This is called automatically and does not need to be manually invoked. + */ + stopListeners(): void; + + /** + * Destroys this Mouse Manager instance. + */ + destroy(): void; + + } + + } + + /** + * A Pointer object encapsulates both mouse and touch input within Phaser. + * + * By default, Phaser will create 2 pointers for your game to use. If you require more, i.e. for a multi-touch + * game, then use the `InputPlugin.addPointer` method to do so, rather than instantiating this class directly, + * otherwise it won't be managed by the input system. + * + * You can reference the current active pointer via `InputPlugin.activePointer`. You can also use the properties + * `InputPlugin.pointer1` through to `pointer10`, for each pointer you have enabled in your game. + * + * The properties of this object are set by the Input Plugin during processing. This object is then sent in all + * input related events that the Input Plugin emits, so you can reference properties from it directly in your + * callbacks. + */ + class Pointer { + /** + * + * @param manager A reference to the Input Manager. + * @param id The internal ID of this Pointer. + */ + constructor(manager: Phaser.Input.InputManager, id: integer); + + /** + * A reference to the Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * The internal ID of this Pointer. + */ + readonly id: integer; + + /** + * The most recent native DOM Event this Pointer has processed. + */ + event: TouchEvent | MouseEvent; + + /** + * The DOM element the Pointer was pressed down on, taken from the DOM event. + * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element. + */ + readonly downElement: any; + + /** + * The DOM element the Pointer was released on, taken from the DOM event. + * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element. + */ + readonly upElement: any; + + /** + * The camera the Pointer interacted with during its last update. + * + * A Pointer can only ever interact with one camera at once, which will be the top-most camera + * in the list should multiple cameras be positioned on-top of each other. + */ + camera: Phaser.Cameras.Scene2D.Camera; + + /** + * A read-only property that indicates which button was pressed, or released, on the pointer + * during the most recent event. It is only set during `up` and `down` events. + * + * On Touch devices the value is always 0. + * + * Users may change the configuration of buttons on their pointing device so that if an event's button property + * is zero, it may not have been caused by the button that is physically left–most on the pointing device; + * however, it should behave as if the left button was clicked in the standard button layout. + */ + readonly button: integer; + + /** + * 0: No button or un-initialized + * 1: Left button + * 2: Right button + * 4: Wheel button or middle button + * 8: 4th button (typically the "Browser Back" button) + * 16: 5th button (typically the "Browser Forward" button) + * + * For a mouse configured for left-handed use, the button actions are reversed. + * In this case, the values are read from right to left. + */ + buttons: integer; + + /** + * The position of the Pointer in screen space. + */ + readonly position: Phaser.Math.Vector2; + + /** + * The previous position of the Pointer in screen space. + * + * The old x and y values are stored in here during the InputManager.transformPointer call. + * + * Use the properties `velocity`, `angle` and `distance` to create your own gesture recognition. + */ + readonly prevPosition: Phaser.Math.Vector2; + + /** + * The current velocity of the Pointer, based on its current and previous positions. + * + * This value is smoothed out each frame, according to the `motionFactor` property. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + */ + readonly velocity: Phaser.Math.Vector2; + + /** + * The current angle the Pointer is moving, in radians, based on its previous and current position. + * + * The angle is based on the old position facing to the current position. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + */ + readonly angle: number; + + /** + * The distance the Pointer has moved, based on its previous and current position. + * + * This value is smoothed out each frame, according to the `motionFactor` property. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + * + * If you need the total distance travelled since the primary buttons was pressed down, + * then use the `Pointer.getDistance` method. + */ + readonly distance: number; + + /** + * The smoothing factor to apply to the Pointer position. + * + * Due to their nature, pointer positions are inherently noisy. While this is fine for lots of games, if you need cleaner positions + * then you can set this value to apply an automatic smoothing to the positions as they are recorded. + * + * The default value of zero means 'no smoothing'. + * Set to a small value, such as 0.2, to apply an average level of smoothing between positions. You can do this by changing this + * value directly, or by setting the `input.smoothFactor` property in the Game Config. + * + * Positions are only smoothed when the pointer moves. If the primary button on this Pointer enters an Up or Down state, then the position + * is always precise, and not smoothed. + */ + smoothFactor: number; + + /** + * The factor applied to the motion smoothing each frame. + * + * This value is passed to the Smooth Step Interpolation that is used to calculate the velocity, + * angle and distance of the Pointer. It's applied every frame, until the midPoint reaches the current + * position of the Pointer. 0.2 provides a good average but can be increased if you need a + * quicker update and are working in a high performance environment. Never set this value to + * zero. + */ + motionFactor: number; + + /** + * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + */ + worldX: number; + + /** + * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + */ + worldY: number; + + /** + * Time when this Pointer was most recently moved (regardless of the state of its buttons, if any) + */ + moveTime: number; + + /** + * X coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects. + */ + downX: number; + + /** + * Y coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects. + */ + downY: number; + + /** + * Time when Button 1 (left button), or Touch, was pressed, used for dragging objects. + */ + downTime: number; + + /** + * X coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects. + */ + upX: number; + + /** + * Y coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects. + */ + upY: number; + + /** + * Time when Button 1 (left button), or Touch, was released, used for dragging objects. + */ + upTime: number; + + /** + * Is the primary button down? (usually button 0, the left mouse button) + */ + primaryDown: boolean; + + /** + * Is _any_ button on this pointer considered as being down? + */ + isDown: boolean; + + /** + * Did the previous input event come from a Touch input (true) or Mouse? (false) + */ + wasTouch: boolean; + + /** + * Did this Pointer get canceled by a touchcancel event? + * + * Note: "canceled" is the American-English spelling of "cancelled". Please don't submit PRs correcting it! + */ + wasCanceled: boolean; + + /** + * If the mouse is locked, the horizontal relative movement of the Pointer in pixels since last frame. + */ + movementX: number; + + /** + * If the mouse is locked, the vertical relative movement of the Pointer in pixels since last frame. + */ + movementY: number; + + /** + * The identifier property of the Pointer as set by the DOM event when this Pointer is started. + */ + identifier: number; + + /** + * The pointerId property of the Pointer as set by the DOM event when this Pointer is started. + * The browser can and will recycle this value. + */ + pointerId: number; + + /** + * An active Pointer is one that is currently pressed down on the display. + * A Mouse is always considered as active. + */ + active: boolean; + + /** + * Time when this Pointer was most recently updated by a DOM Event. + */ + time: number; + + /** + * The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. + */ + deltaX: number; + + /** + * The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. + */ + deltaY: number; + + /** + * The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device. + */ + deltaZ: number; + + /** + * Takes a Camera and returns a Vector2 containing the translated position of this Pointer + * within that Camera. This can be used to convert this Pointers position into camera space. + * @param camera The Camera to use for the translation. + * @param output A Vector2-like object in which to store the translated position. + */ + positionToCamera(camera: Phaser.Cameras.Scene2D.Camera, output?: Phaser.Math.Vector2 | object): Phaser.Math.Vector2 | object; + + /** + * Checks to see if any buttons are being held down on this Pointer. + */ + noButtonDown(): boolean; + + /** + * Checks to see if the left button is being held down on this Pointer. + */ + leftButtonDown(): boolean; + + /** + * Checks to see if the right button is being held down on this Pointer. + */ + rightButtonDown(): boolean; + + /** + * Checks to see if the middle button is being held down on this Pointer. + */ + middleButtonDown(): boolean; + + /** + * Checks to see if the back button is being held down on this Pointer. + */ + backButtonDown(): boolean; + + /** + * Checks to see if the forward button is being held down on this Pointer. + */ + forwardButtonDown(): boolean; + + /** + * Checks to see if the left button was just released on this Pointer. + */ + leftButtonReleased(): boolean; + + /** + * Checks to see if the right button was just released on this Pointer. + */ + rightButtonReleased(): boolean; + + /** + * Checks to see if the middle button was just released on this Pointer. + */ + middleButtonReleased(): boolean; + + /** + * Checks to see if the back button was just released on this Pointer. + */ + backButtonReleased(): boolean; + + /** + * Checks to see if the forward button was just released on this Pointer. + */ + forwardButtonReleased(): boolean; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded distance, based on where + * the Pointer was when the button was released. + * + * If you wish to get the distance being travelled currently, based on the velocity of the Pointer, + * then see the `Pointer.distance` property. + */ + getDistance(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * horizontal distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded horizontal distance, based on where + * the Pointer was when the button was released. + */ + getDistanceX(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * vertical distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded vertical distance, based on where + * the Pointer was when the button was released. + */ + getDistanceY(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * duration since the button was pressed down. + * + * If no button is held down, it will return the last recorded duration, based on the time + * the Pointer button was released. + */ + getDuration(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * angle between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded angle, based on where + * the Pointer was when the button was released. + * + * The angle is based on the old position facing to the current position. + * + * If you wish to get the current angle, based on the velocity of the Pointer, then + * see the `Pointer.angle` property. + */ + getAngle(): number; + + /** + * Takes the previous and current Pointer positions and then generates an array of interpolated values between + * the two. The array will be populated up to the size of the `steps` argument. + * + * ```javaScript + * var points = pointer.getInterpolatedPosition(4); + * + * // points[0] = { x: 0, y: 0 } + * // points[1] = { x: 2, y: 1 } + * // points[2] = { x: 3, y: 2 } + * // points[3] = { x: 6, y: 3 } + * ``` + * + * Use this if you need to get smoothed values between the previous and current pointer positions. DOM pointer + * events can often fire faster than the main browser loop, and this will help you avoid janky movement + * especially if you have an object following a Pointer. + * + * Note that if you provide an output array it will only be populated up to the number of steps provided. + * It will not clear any previous data that may have existed beyond the range of the steps count. + * + * Internally it uses the Smooth Step interpolation calculation. + * @param steps The number of interpolation steps to use. Default 10. + * @param out An array to store the results in. If not provided a new one will be created. + */ + getInterpolatedPosition(steps?: integer, out?: any[]): any[]; + + /** + * Destroys this Pointer instance and resets its external references. + */ + destroy(): void; + + /** + * The x position of this Pointer. + * The value is in screen space. + * See `worldX` to get a camera converted position. + */ + x: number; + + /** + * The y position of this Pointer. + * The value is in screen space. + * See `worldY` to get a camera converted position. + */ + y: number; + + } + + namespace Touch { + /** + * The Touch Manager is a helper class that belongs to the Input Manager. + * + * Its role is to listen for native DOM Touch Events and then pass them onto the Input Manager for further processing. + * + * You do not need to create this class directly, the Input Manager will create an instance of it automatically. + */ + class TouchManager { + /** + * + * @param inputManager A reference to the Input Manager. + */ + constructor(inputManager: Phaser.Input.InputManager); + + /** + * A reference to the Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * If true the DOM events will have event.preventDefault applied to them, if false they will propagate fully. + */ + capture: boolean; + + /** + * A boolean that controls if the Touch Manager is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * The Touch Event target, as defined in the Game Config. + * Typically the canvas to which the game is rendering, but can be any interactive DOM element. + */ + target: any; + + /** + * The Touch Start event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchStart: Function; + + /** + * The Touch Start event handler function specifically for events on the Window. + * Initially empty and bound in the `startListeners` method. + */ + onTouchStartWindow: Function; + + /** + * The Touch Move event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchMove: Function; + + /** + * The Touch End event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchEnd: Function; + + /** + * The Touch End event handler function specifically for events on the Window. + * Initially empty and bound in the `startListeners` method. + */ + onTouchEndWindow: Function; + + /** + * The Touch Cancel event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchCancel: Function; + + /** + * The Touch Cancel event handler function specifically for events on the Window. + * Initially empty and bound in the `startListeners` method. + */ + onTouchCancelWindow: Function; + + /** + * The Touch Over event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchOver: Function; + + /** + * The Touch Out event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchOut: Function; + + /** + * Starts the Touch Event listeners running as long as an input target is set. + * + * This method is called automatically if Touch Input is enabled in the game config, + * which it is by default. However, you can call it manually should you need to + * delay input capturing until later in the game. + */ + startListeners(): void; + + /** + * Stops the Touch Event listeners. + * This is called automatically and does not need to be manually invoked. + */ + stopListeners(): void; + + /** + * Destroys this Touch Manager instance. + */ + destroy(): void; + + } + + } + + } + + namespace Loader { + /** + * The Loader is idle. + */ + var LOADER_IDLE: integer; + + /** + * The Loader is actively loading. + */ + var LOADER_LOADING: integer; + + /** + * The Loader is processing files is has loaded. + */ + var LOADER_PROCESSING: integer; + + /** + * The Loader has completed loading and processing. + */ + var LOADER_COMPLETE: integer; + + /** + * The Loader is shutting down. + */ + var LOADER_SHUTDOWN: integer; + + /** + * The Loader has been destroyed. + */ + var LOADER_DESTROYED: integer; + + /** + * File is in the load queue but not yet started + */ + var FILE_PENDING: integer; + + /** + * File has been started to load by the loader (onLoad called) + */ + var FILE_LOADING: integer; + + /** + * File has loaded successfully, awaiting processing + */ + var FILE_LOADED: integer; + + /** + * File failed to load + */ + var FILE_FAILED: integer; + + /** + * File is being processed (onProcess callback) + */ + var FILE_PROCESSING: integer; + + /** + * The File has errored somehow during processing. + */ + var FILE_ERRORED: integer; + + /** + * File has finished processing. + */ + var FILE_COMPLETE: integer; + + /** + * File has been destroyed + */ + var FILE_DESTROYED: integer; + + /** + * File was populated from local data and doesn't need an HTTP request + */ + var FILE_POPULATED: integer; + + namespace Events { + /** + * The Loader Plugin Add File Event. + * + * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. + * + * Listen to it from a Scene using: `this.load.on('addfile', listener)`. + * + * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. + */ + const ADD: any; + + /** + * The Loader Plugin Complete Event. + * + * This event is dispatched when the Loader has fully processed everything in the load queue. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Listen to it from a Scene using: `this.load.on('complete', listener)`. + */ + const COMPLETE: any; + + /** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. + * + * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. + * + * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. + */ + const FILE_COMPLETE: any; + + /** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. + * + * It uses a special dynamic event name constructed from the key and type of the file. + * + * For example, if you have loaded an `image` with a key of `monster`, you can listen for it + * using the following: + * + * ```javascript + * this.load.on('filecomplete-image-monster', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a texture `atlas` with a key of `Level1`: + * + * ```javascript + * this.load.on('filecomplete-atlas-Level1', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: + * + * ```javascript + * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. + */ + const FILE_KEY_COMPLETE: any; + + /** + * The File Load Error Event. + * + * This event is dispatched by the Loader Plugin when a file fails to load. + * + * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. + */ + const FILE_LOAD_ERROR: any; + + /** + * The File Load Event. + * + * This event is dispatched by the Loader Plugin when a file finishes loading, + * but _before_ it is processed and added to the internal Phaser caches. + * + * Listen to it from a Scene using: `this.load.on('load', listener)`. + */ + const FILE_LOAD: any; + + /** + * The File Load Progress Event. + * + * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and + * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. + * + * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. + */ + const FILE_PROGRESS: any; + + /** + * The Loader Plugin Post Process Event. + * + * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. + * It is dispatched before the internal lists are cleared and each File is destroyed. + * + * Use this hook to perform any last minute processing of files that can only happen once the + * Loader has completed, but prior to it emitting the `complete` event. + * + * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. + */ + const POST_PROCESS: any; + + /** + * The Loader Plugin Progress Event. + * + * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. + * + * Listen to it from a Scene using: `this.load.on('progress', listener)`. + */ + const PROGRESS: any; + + /** + * The Loader Plugin Start Event. + * + * This event is dispatched when the Loader starts running. At this point load progress is zero. + * + * This event is dispatched even if there aren't any files in the load queue. + * + * Listen to it from a Scene using: `this.load.on('start', listener)`. + */ + const START: any; + + } + + /** + * The base File class used by all File Types that the Loader can support. + * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods. + */ + class File { + /** + * + * @param loader The Loader that is going to load this File. + * @param fileConfig The file configuration object, as created by the file type. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, fileConfig: Phaser.Types.Loader.FileConfig); + + /** + * A reference to the Loader that is going to load this file. + */ + loader: Phaser.Loader.LoaderPlugin; + + /** + * A reference to the Cache, or Texture Manager, that is going to store this file if it loads. + */ + cache: Phaser.Cache.BaseCache | Phaser.Textures.TextureManager; + + /** + * The file type string (image, json, etc) for sorting within the Loader. + */ + type: string; + + /** + * Unique cache key (unique within its file type) + */ + key: string; + + /** + * The URL of the file, not including baseURL. + * Automatically has Loader.path prepended to it. + */ + url: string; + + /** + * The final URL this file will load from, including baseURL and path. + * Set automatically when the Loader calls 'load' on this file. + */ + src: string; + + /** + * The merged XHRSettings for this file. + */ + xhrSettings: Phaser.Types.Loader.XHRSettingsObject; + + /** + * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File. + */ + xhrLoader: XMLHttpRequest; + + /** + * The current state of the file. One of the FILE_CONST values. + */ + state: integer; + + /** + * The total size of this file. + * Set by onProgress and only if loading via XHR. + */ + bytesTotal: number; + + /** + * Updated as the file loads. + * Only set if loading via XHR. + */ + bytesLoaded: number; + + /** + * A percentage value between 0 and 1 indicating how much of this file has loaded. + * Only set if loading via XHR. + */ + percentComplete: number; + + /** + * For CORs based loading. + * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set) + */ + crossOrigin: string | undefined; + + /** + * The processed file data, stored here after the file has loaded. + */ + data: any; + + /** + * A config object that can be used by file types to store transitional data. + */ + config: any; + + /** + * If this is a multipart file, i.e. an atlas and its json together, then this is a reference + * to the parent MultiFile. Set and used internally by the Loader or specific file types. + */ + multiFile: Phaser.Loader.MultiFile; + + /** + * Does this file have an associated linked file? Such as an image and a normal map. + * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't + * actually bound by data, where-as a linkFile is. + */ + linkFile: Phaser.Loader.File; + + /** + * Links this File with another, so they depend upon each other for loading and processing. + * @param fileB The file to link to this one. + */ + setLink(fileB: Phaser.Loader.File): void; + + /** + * Resets the XHRLoader instance this file is using. + */ + resetXHR(): void; + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + */ + load(): void; + + /** + * Called when the file finishes loading, is sent a DOM ProgressEvent. + * @param xhr The XMLHttpRequest that caused this onload event. + * @param event The DOM ProgressEvent that resulted from this load. + */ + onLoad(xhr: XMLHttpRequest, event: ProgressEvent): void; + + /** + * Called if the file errors while loading, is sent a DOM ProgressEvent. + * @param xhr The XMLHttpRequest that caused this onload event. + * @param event The DOM ProgressEvent that resulted from this error. + */ + onError(xhr: XMLHttpRequest, event: ProgressEvent): void; + + /** + * Called during the file load progress. Is sent a DOM ProgressEvent. + * @param event The DOM ProgressEvent. + */ + onProgress(event: ProgressEvent): void; + + /** + * Usually overridden by the FileTypes and is called by Loader.nextFile. + * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage. + */ + onProcess(): void; + + /** + * Called when the File has completed processing. + * Checks on the state of its multifile, if set. + */ + onProcessComplete(): void; + + /** + * Called when the File has completed processing but it generated an error. + * Checks on the state of its multifile, if set. + */ + onProcessError(): void; + + /** + * Checks if a key matching the one used by this file exists in the target Cache or not. + * This is called automatically by the LoaderPlugin to decide if the file can be safely + * loaded or will conflict. + */ + hasCacheConflict(): boolean; + + /** + * Adds this file to its target cache upon successful loading and processing. + * This method is often overridden by specific file types. + */ + addToCache(): void; + + /** + * Called once the file has been added to its cache and is now ready for deletion from the Loader. + * It will emit a `filecomplete` event from the LoaderPlugin. + */ + pendingDestroy(): void; + + /** + * Destroy this File and any references it holds. + */ + destroy(): void; + + /** + * Static method for creating object URL using URL API and setting it as image 'src' attribute. + * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader. + * @param image Image object which 'src' attribute should be set to object URL. + * @param blob A Blob object to create an object URL for. + * @param defaultType Default mime type used if blob type is not available. + */ + static createObjectURL(image: HTMLImageElement, blob: Blob, defaultType: string): void; + + /** + * Static method for releasing an existing object URL which was previously created + * by calling {@link File#createObjectURL} method. + * @param image Image object which 'src' attribute should be revoked. + */ + static revokeObjectURL(image: HTMLImageElement): void; + + } + + namespace FileTypes { + /** + * A single Animation JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#animation method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#animation. + */ + class AnimationJSONFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Called at the end of the load process, after the Loader has finished all files in its queue. + */ + onLoadComplete(): void; + + } + + /** + * A single JSON based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. + * + * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm + */ + class AtlasJSONFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig, textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single XML based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlasXML method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlasXML. + */ + class AtlasXMLFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas xml file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig, textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Audio File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. + */ + class AudioFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param urlConfig The absolute or relative URL to load this file from in a config object. + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param audioContext The AudioContext this file will use to process itself. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioFileConfig, urlConfig?: any, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, audioContext?: AudioContext); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * An Audio Sprite File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audioSprite method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audioSprite. + */ + class AudioSpriteFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param jsonURL The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead. + * @param audioURL The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file. + * @param audioConfig The audio configuration options. + * @param audioXhrSettings An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings. + * @param jsonXhrSettings An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig, jsonURL: string, audioURL?: Object, audioConfig?: any, audioXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, jsonXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called by each File when it finishes loading. + * @param file The File that has completed processing. + */ + onFileComplete(file: Phaser.Loader.File): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Binary File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#binary method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#binary. + */ + class BinaryFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.bin`, i.e. if `key` was "alien" then the URL will be "alien.bin". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataType Optional type to cast the binary file to once loaded. For example, `Uint8Array`. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.BinaryFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataType?: any); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Bitmap Font based File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#bitmapFont method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#bitmapFont. + */ + class BitmapFontFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the font image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param fontDataURL The absolute or relative URL to load the font xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param textureXhrSettings An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings. + * @param fontDataXhrSettings An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.BitmapFontFileConfig, textureURL?: string | string[], fontDataURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, fontDataXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single CSS File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#css method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#css. + */ + class CSSFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.CSSFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single GLSL File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#glsl method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#glsl. + */ + class GLSLFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param shaderType The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle. Default 'fragment'. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.GLSLFileConfig, url?: string, shaderType?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + /** + * Returns the name of the shader from the header block. + * @param headerSource The header data. + */ + getShaderName(headerSource: string[]): string; + + /** + * Returns the type of the shader from the header block. + * @param headerSource The header data. + */ + getShaderType(headerSource: string[]): string; + + /** + * Returns the shader uniforms from the header block. + * @param headerSource The header data. + */ + getShaderUniforms(headerSource: string[]): any; + + } + + /** + * A single Audio File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. + */ + class HTML5AudioFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param urlConfig The absolute or relative URL to load this file from. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioFileConfig, urlConfig?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called when the file finishes loading. + */ + onLoad(): void; + + /** + * Called if the file errors while loading. + */ + onError(): void; + + /** + * Called during the file load progress. Is sent a DOM ProgressEvent. + */ + onProgress(): void; + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + */ + load(): void; + + } + + /** + * A single HTML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#html method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#html. + */ + class HTMLFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single HTML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#htmlTexture method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#htmlTexture. + */ + class HTMLTextureFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param width The width of the texture the HTML will be rendered to. + * @param height The height of the texture the HTML will be rendered to. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig, url?: string, width?: integer, height?: integer, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. + */ + class ImageFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param frameConfig The frame configuration object. Only provided for, and used by, Sprite Sheets. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ImageFileConfig, url?: string | string[], xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + */ + class JSONFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Multi Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#multiatlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#multiatlas. + */ + class MultiAtlasFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key of the file. Must be unique within both the Loader and the Texture Manager. + * @param atlasURL The absolute or relative URL to load the multi atlas json file from. + * @param path Optional path to use when loading the textures defined in the atlas data. + * @param baseURL Optional Base URL to use when loading the textures defined in the atlas data. + * @param atlasXhrSettings Extra XHR Settings specifically for the atlas json file. + * @param textureXhrSettings Extra XHR Settings specifically for the texture files. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string, atlasURL?: string, path?: string, baseURL?: string, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called by each File when it finishes loading. + * @param file The File that has completed processing. + */ + onFileComplete(file: Phaser.Loader.File): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A Multi Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#scripts method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scripts. + */ + class MultiScriptFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array. + * @param xhrSettings An XHR Settings configuration object for the script files. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.MultiScriptFileConfig, url?: string[], xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single JSON Pack File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#pack method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#pack. + */ + class PackFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.PackFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Plugin Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#plugin method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#plugin. + */ + class PluginFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param start Automatically start the plugin after loading? Default false. + * @param mapping If this plugin is to be injected into the Scene, this is the property key used. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.PluginFileConfig, url?: string, start?: boolean, mapping?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * An external Scene JavaScript File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#sceneFile method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#sceneFile. + */ + class SceneFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SceneFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Scene Plugin Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#scenePlugin method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scenePlugin. + */ + class ScenePluginFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param systemKey If this plugin is to be added to Scene.Systems, this is the property key for it. + * @param sceneKey If this plugin is to be added to the Scene, this is the property key for it. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ScenePluginFileConfig, url?: string, systemKey?: string, sceneKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#script method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#script. + */ + class ScriptFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ScriptFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Sprite Sheet Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#spritesheet method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spritesheet. + */ + class SpriteSheetFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param frameConfig The frame configuration object. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig, url?: string | string[], frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single SVG File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#svg method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#svg. + */ + class SVGFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was "alien" then the URL will be "alien.svg". + * @param svgConfig The svg size configuration object. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SVGFileConfig, url?: string, svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Text File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. + */ + class TextFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TextFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Tilemap CSV File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapCSV method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapCSV. + */ + class TilemapCSVFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.csv`, i.e. if `key` was "alien" then the URL will be "alien.csv". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Impact.js Tilemap JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapImpact method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapImpact. + */ + class TilemapImpactFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Tiled Tilemap JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapTiledJSON method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapTiledJSON. + */ + class TilemapJSONFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single text file based Unity Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#unityAtlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#unityAtlas. + */ + class UnityAtlasFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig, textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single XML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#xml method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#xml. + */ + class XMLFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.XMLFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + } + + namespace FileTypesManager { + /** + * Static method called when a LoaderPlugin is created. + * + * Loops through the local types object and injects all of them as + * properties into the LoaderPlugin instance. + * @param loader The LoaderPlugin to install the types into. + */ + function install(loader: Phaser.Loader.LoaderPlugin): void; + + /** + * Static method called directly by the File Types. + * + * The key is a reference to the function used to load the files via the Loader, i.e. `image`. + * @param key The key that will be used as the method name in the LoaderPlugin. + * @param factoryFunction The function that will be called when LoaderPlugin.key is invoked. + */ + function register(key: string, factoryFunction: Function): void; + + /** + * Removed all associated file types. + */ + function destroy(): void; + + } + + /** + * Given a File and a baseURL value this returns the URL the File will use to download from. + * @param file The File object. + * @param baseURL A default base URL. + */ + function GetURL(file: Phaser.Loader.File, baseURL: string): string; + + /** + * The Loader handles loading all external content such as Images, Sounds, Texture Atlases and data files. + * You typically interact with it via `this.load` in your Scene. Scenes can have a `preload` method, which is always + * called before the Scenes `create` method, allowing you to preload assets that the Scene may need. + * + * If you call any `this.load` methods from outside of `Scene.preload` then you need to start the Loader going + * yourself by calling `Loader.start()`. It's only automatically started during the Scene preload. + * + * The Loader uses a combination of tag loading (eg. Audio elements) and XHR and provides progress and completion events. + * Files are loaded in parallel by default. The amount of concurrent connections can be controlled in your Game Configuration. + * + * Once the Loader has started loading you are still able to add files to it. These can be injected as a result of a loader + * event, the type of file being loaded (such as a pack file) or other external events. As long as the Loader hasn't finished + * simply adding a new file to it, while running, will ensure it's added into the current queue. + * + * Every Scene has its own instance of the Loader and they are bound to the Scene in which they are created. However, + * assets loaded by the Loader are placed into global game-level caches. For example, loading an XML file will place that + * file inside `Game.cache.xml`, which is accessible from every Scene in your game, no matter who was responsible + * for loading it. The same is true of Textures. A texture loaded in one Scene is instantly available to all other Scenes + * in your game. + * + * The Loader works by using custom File Types. These are stored in the FileTypesManager, which injects them into the Loader + * when it's instantiated. You can create your own custom file types by extending either the File or MultiFile classes. + * See those files for more details. + */ + class LoaderPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene which owns this Loader instance. + */ + constructor(scene: Phaser.Scene); + + /** + * Adds an Animation JSON Data file, or array of Animation JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.animation('baddieAnims', 'files/BaddieAnims.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.animation({ + * key: 'baddieAnims', + * url: 'files/BaddieAnims.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading it will automatically be passed to the global Animation Managers `fromJSON` method. + * This will parse all of the JSON data and create animation data from it. This process happens at the very end + * of the Loader, once every other file in the load queue has finished. The reason for this is to allow you to load + * both animation data and the images it relies upon in the same load call. + * + * Once the animation data has been parsed you will be able to play animations using that data. + * Please see the Animation Manager `fromJSON` method for more details about the format and playback. + * + * You can also access the raw animation data from its Cache using its key: + * + * ```javascript + * this.load.animation('baddieAnims', 'files/BaddieAnims.json'); + * // and later in your game ... + * var data = this.cache.json.get('baddieAnims'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And if you only wanted to create animations from the `boss` data, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param dataKey When the Animation JSON file loads only this property will be stored in the Cache and used to create animation data. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + animation(key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig | Phaser.Types.Loader.FileTypes.JSONFileConfig[], url?: string, dataKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a JSON based Texture Atlas, or array of atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in a JSON file, using either the JSON Hash or JSON Array format. + * These files are created by software such as Texture Packer, Shoebox and Adobe Flash / Animate. + * If you are using Texture Packer and have enabled multi-atlas support, then please use the Phaser Multi Atlas loader + * instead of this one. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.atlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * atlasURL: 'images/MainMenu.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig` for more details. + * + * Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); + * // and later in your game ... + * this.add.image(x, y, 'mainmenu', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.atlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.json'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.atlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * normalMap: 'images/MainMenu-n.png', + * atlasURL: 'images/MainMenu.json' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Atlas JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ + atlas(key: string | Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig | Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig[], textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an XML based Texture Atlas, or array of atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.atlasXML('mainmenu', 'images/MainMenu.png', 'images/MainMenu.xml'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in an XML file format. + * These files are created by software such as Shoebox and Adobe Flash / Animate. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.atlasXML({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * atlasURL: 'images/MainMenu.xml' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig` for more details. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.atlasXML('mainmenu', 'images/MainMenu.png', 'images/MainMenu.xml'); + * // and later in your game ... + * this.add.image(x, y, 'mainmenu', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.atlasXML('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.xml'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.atlasXML({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * normalMap: 'images/MainMenu-n.png', + * atlasURL: 'images/MainMenu.xml' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Atlas XML File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas xml file. Used in replacement of the Loaders default XHR Settings. + */ + atlasXML(key: string | Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig | Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig[], textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an Audio or HTML5Audio file, or array of audio files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.audio('title', [ 'music/Title.ogg', 'music/Title.mp3', 'music/Title.m4a' ]); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Audio Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Audio Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Audio Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.audio({ + * key: 'title', + * url: [ 'music/Title.ogg', 'music/Title.mp3', 'music/Title.m4a' ] + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AudioFileConfig` for more details. + * + * The URLs can be relative or absolute. If the URLs are relative the `Loader.baseURL` and `Loader.path` values will be prepended to them. + * + * Due to different browsers supporting different audio file types you should usually provide your audio files in a variety of formats. + * ogg, mp3 and m4a are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on + * browser support. + * + * If audio has been disabled in your game, either via the game config, or lack of support from the device, then no audio will be loaded. + * + * Note: The ability to load this type of file will only be available if the Audio File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param urls The absolute or relative URL to load the audio files from. + * @param config An object containing an `instances` property for HTML5Audio. Defaults to 1. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + audio(key: string | Phaser.Types.Loader.FileTypes.AudioFileConfig | Phaser.Types.Loader.FileTypes.AudioFileConfig[], urls?: string | string[], config?: any, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a JSON based Audio Sprite, or array of audio sprites, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.audioSprite('kyobi', 'kyobi.json', [ + * 'kyobi.ogg', + * 'kyobi.mp3', + * 'kyobi.m4a' + * ]); + * } + * ``` + * + * Audio Sprites are a combination of audio files and a JSON configuration. + * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite + * + * If the JSON file includes a 'resource' object then you can let Phaser parse it and load the audio + * files automatically based on its content. To do this exclude the audio URLs from the load: + * + * ```javascript + * function preload () + * { + * this.load.audioSprite('kyobi', 'kyobi.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * The key must be a unique String. It is used to add the file to the global Audio Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Audio Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Audio Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.audioSprite({ + * key: 'kyobi', + * jsonURL: 'audio/Kyobi.json', + * audioURL: [ + * 'audio/Kyobi.ogg', + * 'audio/Kyobi.mp3', + * 'audio/Kyobi.m4a' + * ] + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig` for more details. + * + * Instead of passing a URL for the audio JSON data you can also pass in a well formed JSON object instead. + * + * Once the audio has finished loading you can use it create an Audio Sprite by referencing its key: + * + * ```javascript + * this.load.audioSprite('kyobi', 'kyobi.json'); + * // and later in your game ... + * var music = this.sound.addAudioSprite('kyobi'); + * music.play('title'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * Due to different browsers supporting different audio file types you should usually provide your audio files in a variety of formats. + * ogg, mp3 and m4a are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on + * browser support. + * + * If audio has been disabled in your game, either via the game config, or lack of support from the device, then no audio will be loaded. + * + * Note: The ability to load this type of file will only be available if the Audio Sprite File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or an array of objects. + * @param jsonURL The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead. + * @param audioURL The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file. + * @param audioConfig The audio configuration options. + * @param audioXhrSettings An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings. + * @param jsonXhrSettings An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + */ + audioSprite(key: string | Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig | Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig[], jsonURL: string, audioURL?: string | string[], audioConfig?: any, audioXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, jsonXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Binary file, or array of Binary files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.binary('doom', 'files/Doom.wad'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Binary Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Binary Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Binary Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.binary({ + * key: 'doom', + * url: 'files/Doom.wad', + * dataType: Uint8Array + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.BinaryFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.binary('doom', 'files/Doom.wad'); + * // and later in your game ... + * var data = this.cache.binary.get('doom'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Data` the final key will be `LEVEL1.Data` and + * this is what you would use to retrieve the text from the Binary Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "doom" + * and no URL is given then the Loader will set the URL to be "doom.bin". It will always add `.bin` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Binary File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.bin`, i.e. if `key` was "alien" then the URL will be "alien.bin". + * @param dataType Optional type to cast the binary file to once loaded. For example, `Uint8Array`. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + binary(key: string | Phaser.Types.Loader.FileTypes.BinaryFileConfig | Phaser.Types.Loader.FileTypes.BinaryFileConfig[], url?: string, dataType?: any, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an XML based Bitmap Font, or array of fonts, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * ```javascript + * function preload () + * { + * this.load.bitmapFont('goldenFont', 'images/GoldFont.png', 'images/GoldFont.xml'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the font data to be provided in an XML file format. + * These files are created by software such as the [Angelcode Bitmap Font Generator](http://www.angelcode.com/products/bmfont/), + * [Littera](http://kvazars.com/littera/) or [Glyph Designer](https://71squared.com/glyphdesigner) + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.bitmapFont({ + * key: 'goldenFont', + * textureURL: 'images/GoldFont.png', + * fontDataURL: 'images/GoldFont.xml' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.BitmapFontFileConfig` for more details. + * + * Once the atlas has finished loading you can use key of it when creating a Bitmap Text Game Object: + * + * ```javascript + * this.load.bitmapFont('goldenFont', 'images/GoldFont.png', 'images/GoldFont.xml'); + * // and later in your game ... + * this.add.bitmapText(x, y, 'goldenFont', 'Hello World'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use when creating a Bitmap Text object. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.bitmapFont('goldenFont', [ 'images/GoldFont.png', 'images/GoldFont-n.png' ], 'images/GoldFont.xml'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.bitmapFont({ + * key: 'goldenFont', + * textureURL: 'images/GoldFont.png', + * normalMap: 'images/GoldFont-n.png', + * fontDataURL: 'images/GoldFont.xml' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Bitmap Font File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param textureURL The absolute or relative URL to load the font image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param fontDataURL The absolute or relative URL to load the font xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param textureXhrSettings An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings. + * @param fontDataXhrSettings An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings. + */ + bitmapFont(key: string | Phaser.Types.Loader.FileTypes.BitmapFontFileConfig | Phaser.Types.Loader.FileTypes.BitmapFontFileConfig[], textureURL?: string | string[], fontDataURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, fontDataXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a CSS file, or array of CSS files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.css('headers', 'styles/headers.css'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.css({ + * key: 'headers', + * url: 'styles/headers.css' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.CSSFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a style DOM element + * via `document.createElement('style')`. It will have its `defer` property set to false and then the + * resulting element will be appended to `document.head`. The CSS styles are then applied to the current document. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.css". It will always add `.css` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the CSS File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.css`, i.e. if `key` was "alien" then the URL will be "alien.css". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + css(key: string | Phaser.Types.Loader.FileTypes.CSSFileConfig | Phaser.Types.Loader.FileTypes.CSSFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a GLSL file, or array of GLSL files, to the current load queue. + * In Phaser 3 GLSL files are just plain Text files at the current moment in time. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.glsl('plasma', 'shaders/Plasma.glsl'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Shader Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Shader Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Shader Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.glsl({ + * key: 'plasma', + * shaderType: 'fragment', + * url: 'shaders/Plasma.glsl' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.GLSLFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.glsl('plasma', 'shaders/Plasma.glsl'); + * // and later in your game ... + * var data = this.cache.shader.get('plasma'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `FX.` and the key was `Plasma` the final key will be `FX.Plasma` and + * this is what you would use to retrieve the text from the Shader Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "plasma" + * and no URL is given then the Loader will set the URL to be "plasma.glsl". It will always add `.glsl` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the GLSL File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.glsl`, i.e. if `key` was "alien" then the URL will be "alien.glsl". + * @param shaderType The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle. Default 'fragment'. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + glsl(key: string | Phaser.Types.Loader.FileTypes.GLSLFileConfig | Phaser.Types.Loader.FileTypes.GLSLFileConfig[], url?: string, shaderType?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an HTML file, or array of HTML files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.html('story', 'files/LoginForm.html'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global HTML Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the HTML Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the HTML Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.html({ + * key: 'login', + * url: 'files/LoginForm.html' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.HTMLFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.html('login', 'files/LoginForm.html'); + * // and later in your game ... + * var data = this.cache.html.get('login'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the html from the HTML Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.html". It will always add `.html` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the HTML File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + html(key: string | Phaser.Types.Loader.FileTypes.HTMLFileConfig | Phaser.Types.Loader.FileTypes.HTMLFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an HTML File, or array of HTML Files, to the current load queue. When the files are loaded they + * will be rendered to textures and stored in the Texture Manager. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.htmlTexture('instructions', 'content/intro.html', 256, 512); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.htmlTexture({ + * key: 'instructions', + * url: 'content/intro.html', + * width: 256, + * height: 512 + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.htmlTexture('instructions', 'content/intro.html', 256, 512); + * // and later in your game ... + * this.add.image(x, y, 'instructions'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.html". It will always add `.html` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * The width and height are the size of the texture to which the HTML will be rendered. It's not possible to determine these + * automatically, so you will need to provide them, either as arguments or in the file config object. + * When the HTML file has loaded a new SVG element is created with a size and viewbox set to the width and height given. + * The SVG file has a body tag added to it, with the HTML file contents included. It then calls `window.Blob` on the SVG, + * and if successful is added to the Texture Manager, otherwise it fails processing. The overall quality of the rendered + * HTML depends on your browser, and some of them may not even support the svg / blob process used. Be aware that there are + * limitations on what HTML can be inside an SVG. You can find out more details in this + * [Mozilla MDN entry](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas). + * + * Note: The ability to load this type of file will only be available if the HTMLTextureFile File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param width The width of the texture the HTML will be rendered to. Default 512. + * @param height The height of the texture the HTML will be rendered to. Default 512. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + htmlTexture(key: string | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig[], url?: string, width?: integer, height?: integer, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an Image, or array of Images, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.image('logo', 'images/phaserLogo.png'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.image('logo', 'images/AtariLogo.png'); + * // and later in your game ... + * this.add.image(x, y, 'logo'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + image(key: string | Phaser.Types.Loader.FileTypes.ImageFileConfig | Phaser.Types.Loader.FileTypes.ImageFileConfig[], url?: string | string[], xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + json(key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig | Phaser.Types.Loader.FileTypes.JSONFileConfig[], url?: string, dataKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Multi Texture Atlas, or array of multi atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.multiatlas('level1', 'images/Level1.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in a JSON file as exported from the application Texture Packer, + * version 4.6.3 or above, where you have made sure to use the Phaser 3 Export option. + * + * The way it works internally is that you provide a URL to the JSON file. Phaser then loads this JSON, parses it and + * extracts which texture files it also needs to load to complete the process. If the JSON also defines normal maps, + * Phaser will load those as well. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.multiatlas({ + * key: 'level1', + * atlasURL: 'images/Level1.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig` for more details. + * + * Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.multiatlas('level1', 'images/Level1.json'); + * // and later in your game ... + * this.add.image(x, y, 'level1', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Multi Atlas File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param path Optional path to use when loading the textures defined in the atlas data. + * @param baseURL Optional Base URL to use when loading the textures defined in the atlas data. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ + multiatlas(key: string | Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig | Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig[], atlasURL?: string, path?: string, baseURL?: string, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an array of Script files to the current load queue. + * + * The difference between this and the `ScriptFile` file type is that you give an array of scripts to this method, + * and the scripts are then processed _exactly_ in that order. This allows you to load a bunch of scripts that + * may have dependancies on each other without worrying about the async nature of traditional script loading. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.scripts('PostProcess', [ + * 'libs/shaders/CopyShader.js', + * 'libs/postprocessing/EffectComposer.js', + * 'libs/postprocessing/RenderPass.js', + * 'libs/postprocessing/MaskPass.js', + * 'libs/postprocessing/ShaderPass.js', + * 'libs/postprocessing/AfterimagePass.js' + * ]); + * } + * ``` + * + * In the code above the script files will all be loaded in parallel but only processed (i.e. invoked) in the exact + * order given in the array. + * + * The files are **not** loaded right away. They are added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the files are queued + * it means you cannot use the files immediately after calling this method, but must wait for the files to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.scripts({ + * key: 'PostProcess', + * url: [ + * 'libs/shaders/CopyShader.js', + * 'libs/postprocessing/EffectComposer.js', + * 'libs/postprocessing/RenderPass.js', + * 'libs/postprocessing/MaskPass.js', + * 'libs/postprocessing/ShaderPass.js', + * 'libs/postprocessing/AfterimagePass.js' + * ] + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.MultiScriptFileConfig` for more details. + * + * Once all the files have finished loading they will automatically be converted into a script element + * via `document.createElement('script')`. They will have their language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. This is done in the exact order the files are specified in the url array. + * + * The URLs can be relative or absolute. If the URLs are relative the `Loader.baseURL` and `Loader.path` values will be prepended to them. + * + * Note: The ability to load this type of file will only be available if the MultiScript File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array. + * @param extension The default file extension to use if no url is provided. Default 'js'. + * @param xhrSettings Extra XHR Settings specifically for these files. + */ + scripts(key: string | Phaser.Types.Loader.FileTypes.MultiScriptFileConfig | Phaser.Types.Loader.FileTypes.MultiScriptFileConfig[], url?: string[], extension?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a JSON File Pack, or array of packs, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.pack('level1', 'data/Level1Files.json'); + * } + * ``` + * + * A File Pack is a JSON file (or object) that contains details about other files that should be added into the Loader. + * Here is a small example: + * + * ```json + * { + * "test1": { + * "files": [ + * { + * "type": "image", + * "key": "taikodrummaster", + * "url": "assets/pics/taikodrummaster.jpg" + * }, + * { + * "type": "image", + * "key": "sukasuka-chtholly", + * "url": "assets/pics/sukasuka-chtholly.png" + * } + * ] + * }, + * "meta": { + * "generated": "1401380327373", + * "app": "Phaser 3 Asset Packer", + * "url": "https://phaser.io", + * "version": "1.0", + * "copyright": "Photon Storm Ltd. 2018" + * } + * } + * ``` + * + * The pack can be split into sections. In the example above you'll see a section called `test1. You can tell + * the `load.pack` method to parse only a particular section of a pack. The pack is stored in the JSON Cache, + * so you can pass it to the Loader to process additional sections as needed in your game, or you can just load + * them all at once without specifying anything. + * + * The pack file can contain an entry for any type of file that Phaser can load. The object structures exactly + * match that of the file type configs, and all properties available within the file type configs can be used + * in the pack file too. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.pack({ + * key: 'level1', + * url: 'data/Level1Files.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.PackFileConfig` for more details. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the Pack File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + pack(key: string | Phaser.Types.Loader.FileTypes.PackFileConfig | Phaser.Types.Loader.FileTypes.PackFileConfig[], url?: string, dataKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Plugin Script file, or array of plugin files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.plugin('modplayer', 'plugins/ModPlayer.js'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.plugin({ + * key: 'modplayer', + * url: 'plugins/ModPlayer.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.PluginFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a script element + * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. It will then be passed to the Phaser PluginCache.register method. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Plugin File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". Or, a plugin function. + * @param start Automatically start the plugin after loading? + * @param mapping If this plugin is to be injected into the Scene, this is the property key used. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + plugin(key: string | Phaser.Types.Loader.FileTypes.PluginFileConfig | Phaser.Types.Loader.FileTypes.PluginFileConfig[], url?: string | Function, start?: boolean, mapping?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an external Scene file, or array of Scene files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.sceneFile('Level1', 'src/Level1.js'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Scene Manager upon a successful load. + * + * For a Scene File it's vitally important that the key matches the class name in the JavaScript file. + * + * For example here is the source file: + * + * ```javascript + * class ExternalScene extends Phaser.Scene { + * + * constructor () + * { + * super('myScene'); + * } + * + * } + * ``` + * + * Because the class is called `ExternalScene` that is the exact same key you must use when loading it: + * + * ```javascript + * function preload () + * { + * this.load.sceneFile('ExternalScene', 'src/yourScene.js'); + * } + * ``` + * + * The key that is used within the Scene Manager can either be set to the same, or you can override it in the Scene + * constructor, as we've done in the example above, where the Scene key was changed to `myScene`. + * + * The key should be unique both in terms of files being loaded and Scenes already present in the Scene Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Scene Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.sceneFile({ + * key: 'Level1', + * url: 'src/Level1.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SceneFileConfig` for more details. + * + * Once the file has finished loading it will be added to the Scene Manager. + * + * ```javascript + * this.load.sceneFile('Level1', 'src/Level1.js'); + * // and later in your game ... + * this.scene.start('Level1'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `WORLD1.` and the key was `Story` the final key will be `WORLD1.Story` and + * this is what you would use to retrieve the text from the Scene Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Scene File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + sceneFile(key: string | Phaser.Types.Loader.FileTypes.SceneFileConfig | Phaser.Types.Loader.FileTypes.SceneFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Scene Plugin Script file, or array of plugin files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.scenePlugin('ModPlayer', 'plugins/ModPlayer.js', 'modPlayer', 'mods'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.scenePlugin({ + * key: 'modplayer', + * url: 'plugins/ModPlayer.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ScenePluginFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a script element + * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. It will then be passed to the Phaser PluginCache.register method. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Script File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". Or, set to a plugin function. + * @param systemKey If this plugin is to be added to Scene.Systems, this is the property key for it. + * @param sceneKey If this plugin is to be added to the Scene, this is the property key for it. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + scenePlugin(key: string | Phaser.Types.Loader.FileTypes.ScenePluginFileConfig | Phaser.Types.Loader.FileTypes.ScenePluginFileConfig[], url?: string | Function, systemKey?: string, sceneKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Script file, or array of Script files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.script('aliens', 'lib/aliens.js'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.script({ + * key: 'aliens', + * url: 'lib/aliens.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ScriptFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a script element + * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Script File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + script(key: string | Phaser.Types.Loader.FileTypes.ScriptFileConfig | Phaser.Types.Loader.FileTypes.ScriptFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Sprite Sheet Image, or array of Sprite Sheet Images, to the current load queue. + * + * The term 'Sprite Sheet' in Phaser means a fixed-size sheet. Where every frame in the sheet is the exact same size, + * and you reference those frames using numbers, not frame names. This is not the same thing as a Texture Atlas, where + * the frames are packed in a way where they take up the least amount of space, and are referenced by their names, + * not numbers. Some articles and software use the term 'Sprite Sheet' to mean Texture Atlas, so please be aware of + * what sort of file you're actually trying to load. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 }); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.spritesheet({ + * key: 'bot', + * url: 'images/robot.png', + * frameConfig: { + * frameWidth: 32, + * frameHeight: 38, + * startFrame: 0, + * endFrame: 8 + * } + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 }); + * // and later in your game ... + * this.add.image(x, y, 'bot', 0); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `PLAYER.` and the key was `Running` the final key will be `PLAYER.Running` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.spritesheet('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ], { frameWidth: 256, frameHeight: 80 }); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.spritesheet({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png', + * frameConfig: { + * frameWidth: 256, + * frameHeight: 80 + * } + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Sprite Sheet File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param frameConfig The frame configuration object. At a minimum it should have a `frameWidth` property. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + spritesheet(key: string | Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig | Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig[], url?: string, frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an SVG File, or array of SVG Files, to the current load queue. When the files are loaded they + * will be rendered to bitmap textures and stored in the Texture Manager. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SVGFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.svg('morty', 'images/Morty.svg'); + * // and later in your game ... + * this.add.image(x, y, 'morty'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.html". It will always add `.html` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can optionally pass an SVG Resize Configuration object when you load an SVG file. By default the SVG will be rendered to a texture + * at the same size defined in the SVG file attributes. However, this isn't always desirable. You may wish to resize the SVG (either down + * or up) to improve texture clarity, or reduce texture memory consumption. You can either specify an exact width and height to resize + * the SVG to: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg', { width: 300, height: 600 }); + * } + * ``` + * + * Or when using a configuration object: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg', + * svgConfig: { + * width: 300, + * height: 600 + * } + * }); + * ``` + * + * Alternatively, you can just provide a scale factor instead: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg', { scale: 2.5 }); + * } + * ``` + * + * Or when using a configuration object: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg', + * svgConfig: { + * scale: 2.5 + * } + * }); + * ``` + * + * If scale, width and height values are all given, the scale has priority and the width and height values are ignored. + * + * Note: The ability to load this type of file will only be available if the SVG File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was "alien" then the URL will be "alien.svg". + * @param svgConfig The svg size configuration object. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + svg(key: string | Phaser.Types.Loader.FileTypes.SVGFileConfig | Phaser.Types.Loader.FileTypes.SVGFileConfig[], url?: string, svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Text file, or array of Text files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.text('story', 'files/IntroStory.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Text Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.text({ + * key: 'story', + * url: 'files/IntroStory.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.text('story', 'files/IntroStory.txt'); + * // and later in your game ... + * var data = this.cache.text.get('story'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Text Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + text(key: string | Phaser.Types.Loader.FileTypes.TextFileConfig | Phaser.Types.Loader.FileTypes.TextFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a CSV Tilemap file, or array of CSV files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.tilemapCSV('level1', 'maps/Level1.csv'); + * } + * ``` + * + * Tilemap CSV data can be created in a text editor, or a 3rd party app that exports as CSV. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.tilemapCSV({ + * key: 'level1', + * url: 'maps/Level1.csv' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.tilemapCSV('level1', 'maps/Level1.csv'); + * // and later in your game ... + * var map = this.make.tilemap({ key: 'level1' }); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Tilemap Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "level" + * and no URL is given then the Loader will set the URL to be "level.csv". It will always add `.csv` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Tilemap CSV File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.csv`, i.e. if `key` was "alien" then the URL will be "alien.csv". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + tilemapCSV(key: string | Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig | Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an Impact.js Tilemap file, or array of map files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.tilemapImpact('level1', 'maps/Level1.json'); + * } + * ``` + * + * Impact Tilemap data is created the Impact.js Map Editor called Weltmeister. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.tilemapImpact({ + * key: 'level1', + * url: 'maps/Level1.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.tilemapImpact('level1', 'maps/Level1.json'); + * // and later in your game ... + * var map = this.make.tilemap({ key: 'level1' }); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Tilemap Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "level" + * and no URL is given then the Loader will set the URL to be "level.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Tilemap Impact File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + tilemapImpact(key: string | Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig | Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Tiled JSON Tilemap file, or array of map files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.tilemapTiledJSON('level1', 'maps/Level1.json'); + * } + * ``` + * + * The Tilemap data is created using the Tiled Map Editor and selecting JSON as the export format. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.tilemapTiledJSON({ + * key: 'level1', + * url: 'maps/Level1.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.tilemapTiledJSON('level1', 'maps/Level1.json'); + * // and later in your game ... + * var map = this.make.tilemap({ key: 'level1' }); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Tilemap Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "level" + * and no URL is given then the Loader will set the URL to be "level.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Tilemap JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + tilemapTiledJSON(key: string | Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig | Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Unity YAML based Texture Atlas, or array of atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in a YAML formatted text file as exported from Unity. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.unityAtlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * atlasURL: 'images/MainMenu.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig` for more details. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); + * // and later in your game ... + * this.add.image(x, y, 'mainmenu', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.unityAtlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.txt'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.unityAtlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * normalMap: 'images/MainMenu-n.png', + * atlasURL: 'images/MainMenu.txt' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Unity Atlas File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + */ + unityAtlas(key: string | Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig | Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig[], textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an XML file, or array of XML files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.xml('wavedata', 'files/AlienWaveData.xml'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global XML Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the XML Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the XML Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.xml({ + * key: 'wavedata', + * url: 'files/AlienWaveData.xml' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.XMLFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.xml('wavedata', 'files/AlienWaveData.xml'); + * // and later in your game ... + * var data = this.cache.xml.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the XML Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.xml". It will always add `.xml` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the XML File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + xml(key: string | Phaser.Types.Loader.FileTypes.XMLFileConfig | Phaser.Types.Loader.FileTypes.XMLFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * The Scene which owns this Loader instance. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * A reference to the global Cache Manager. + */ + cacheManager: Phaser.Cache.CacheManager; + + /** + * A reference to the global Texture Manager. + */ + textureManager: Phaser.Textures.TextureManager; + + /** + * A reference to the global Scene Manager. + */ + protected sceneManager: Phaser.Scenes.SceneManager; + + /** + * An optional prefix that is automatically prepended to the start of every file key. + * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`. + * You can set this directly, or call `Loader.setPrefix()`. It will then affect every file added to the Loader + * from that point on. It does _not_ change any file already in the load queue. + */ + prefix: string; + + /** + * The value of `path`, if set, is placed before any _relative_ file path given. For example: + * + * ```javascript + * this.load.path = "images/sprites/"; + * this.load.image("ball", "ball.png"); + * this.load.image("tree", "level1/oaktree.png"); + * this.load.image("boom", "http://server.com/explode.png"); + * ``` + * + * Would load the `ball` file from `images/sprites/ball.png` and the tree from + * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL + * given as it's an absolute URL. + * + * Please note that the path is added before the filename but *after* the baseURL (if set.) + * + * If you set this property directly then it _must_ end with a "/". Alternatively, call `setPath()` and it'll do it for you. + */ + path: string; + + /** + * If you want to append a URL before the path of any asset you can set this here. + * + * Useful if allowing the asset base url to be configured outside of the game code. + * + * If you set this property directly then it _must_ end with a "/". Alternatively, call `setBaseURL()` and it'll do it for you. + */ + baseURL: string; + + /** + * The number of concurrent / parallel resources to try and fetch at once. + * + * Old browsers limit 6 requests per domain; modern ones, especially those with HTTP/2 don't limit it at all. + * + * The default is 32 but you can change this in your Game Config, or by changing this property before the Loader starts. + */ + maxParallelDownloads: integer; + + /** + * xhr specific global settings (can be overridden on a per-file basis) + */ + xhr: Phaser.Types.Loader.XHRSettingsObject; + + /** + * The crossOrigin value applied to loaded images. Very often this needs to be set to 'anonymous'. + */ + crossOrigin: string; + + /** + * The total number of files to load. It may not always be accurate because you may add to the Loader during the process + * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. + */ + totalToLoad: integer; + + /** + * The progress of the current load queue, as a float value between 0 and 1. + * This is updated automatically as files complete loading. + * Note that it is possible for this value to go down again if you add content to the current load queue during a load. + */ + progress: number; + + /** + * Files are placed in this Set when they're added to the Loader via `addFile`. + * + * They are moved to the `inflight` Set when they start loading, and assuming a successful + * load, to the `queue` Set for further processing. + * + * By the end of the load process this Set will be empty. + */ + list: Phaser.Structs.Set; + + /** + * Files are stored in this Set while they're in the process of being loaded. + * + * Upon a successful load they are moved to the `queue` Set. + * + * By the end of the load process this Set will be empty. + */ + inflight: Phaser.Structs.Set; + + /** + * Files are stored in this Set while they're being processed. + * + * If the process is successful they are moved to their final destination, which could be + * a Cache or the Texture Manager. + * + * At the end of the load process this Set will be empty. + */ + queue: Phaser.Structs.Set; + + /** + * The total number of files that failed to load during the most recent load. + * This value is reset when you call `Loader.start`. + */ + totalFailed: integer; + + /** + * The total number of files that successfully loaded during the most recent load. + * This value is reset when you call `Loader.start`. + */ + totalComplete: integer; + + /** + * The current state of the Loader. + */ + readonly state: integer; + + /** + * If you want to append a URL before the path of any asset you can set this here. + * + * Useful if allowing the asset base url to be configured outside of the game code. + * + * Once a base URL is set it will affect every file loaded by the Loader from that point on. It does _not_ change any + * file _already_ being loaded. To reset it, call this method with no arguments. + * @param url The URL to use. Leave empty to reset. + */ + setBaseURL(url?: string): Phaser.Loader.LoaderPlugin; + + /** + * The value of `path`, if set, is placed before any _relative_ file path given. For example: + * + * ```javascript + * this.load.setPath("images/sprites/"); + * this.load.image("ball", "ball.png"); + * this.load.image("tree", "level1/oaktree.png"); + * this.load.image("boom", "http://server.com/explode.png"); + * ``` + * + * Would load the `ball` file from `images/sprites/ball.png` and the tree from + * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL + * given as it's an absolute URL. + * + * Please note that the path is added before the filename but *after* the baseURL (if set.) + * + * Once a path is set it will then affect every file added to the Loader from that point on. It does _not_ change any + * file _already_ in the load queue. To reset it, call this method with no arguments. + * @param path The path to use. Leave empty to reset. + */ + setPath(path?: string): Phaser.Loader.LoaderPlugin; + + /** + * An optional prefix that is automatically prepended to the start of every file key. + * + * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`. + * + * Once a prefix is set it will then affect every file added to the Loader from that point on. It does _not_ change any + * file _already_ in the load queue. To reset it, call this method with no arguments. + * @param prefix The prefix to use. Leave empty to reset. + */ + setPrefix(prefix?: string): Phaser.Loader.LoaderPlugin; + + /** + * Sets the Cross Origin Resource Sharing value used when loading files. + * + * Files can override this value on a per-file basis by specifying an alternative `crossOrigin` value in their file config. + * + * Once CORs is set it will then affect every file loaded by the Loader from that point on, as long as they don't have + * their own CORs setting. To reset it, call this method with no arguments. + * + * For more details about CORs see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS + * @param crossOrigin The value to use for the `crossOrigin` property in the load request. + */ + setCORS(crossOrigin?: string): Phaser.Loader.LoaderPlugin; + + /** + * Adds a file, or array of files, into the load queue. + * + * The file must be an instance of `Phaser.Loader.File`, or a class that extends it. The Loader will check that the key + * used by the file won't conflict with any other key either in the loader, the inflight queue or the target cache. + * If allowed it will then add the file into the pending list, read for the load to start. Or, if the load has already + * started, ready for the next batch of files to be pulled from the list to the inflight queue. + * + * You should not normally call this method directly, but rather use one of the Loader methods like `image` or `atlas`, + * however you can call this as long as the file given to it is well formed. + * @param file The file, or array of files, to be added to the load queue. + */ + addFile(file: Phaser.Loader.File | Phaser.Loader.File[]): void; + + /** + * Checks the key and type of the given file to see if it will conflict with anything already + * in a Cache, the Texture Manager, or the list or inflight queues. + * @param file The file to check the key of. + */ + keyExists(file: Phaser.Loader.File): boolean; + + /** + * Takes a well formed, fully parsed pack file object and adds its entries into the load queue. Usually you do not call + * this method directly, but instead use `Loader.pack` and supply a path to a JSON file that holds the + * pack data. However, if you've got the data prepared you can pass it to this method. + * + * You can also provide an optional key. If you do then it will only add the entries from that part of the pack into + * to the load queue. If not specified it will add all entries it finds. For more details about the pack file format + * see the `LoaderPlugin.pack` method. + * @param data The Pack File data to be parsed and each entry of it to added to the load queue. + * @param packKey An optional key to use from the pack file data. + */ + addPack(data: any, packKey?: string): boolean; + + /** + * Is the Loader actively loading, or processing loaded files? + */ + isLoading(): boolean; + + /** + * Is the Loader ready to start a new load? + */ + isReady(): boolean; + + /** + * Starts the Loader running. This will reset the progress and totals and then emit a `start` event. + * If there is nothing in the queue the Loader will immediately complete, otherwise it will start + * loading the first batch of files. + * + * The Loader is started automatically if the queue is populated within your Scenes `preload` method. + * + * However, outside of this, you need to call this method to start it. + * + * If the Loader is already running this method will simply return. + */ + start(): void; + + /** + * Called automatically during the load process. + * It updates the `progress` value and then emits a progress event, which you can use to + * display a loading bar in your game. + */ + updateProgress(): void; + + /** + * Called automatically during the load process. + */ + update(): void; + + /** + * An internal method called automatically by the XHRLoader belong to a File. + * + * This method will remove the given file from the inflight Set and update the load progress. + * If the file was successful its `onProcess` method is called, otherwise it is added to the delete queue. + * @param file The File that just finished loading, or errored during load. + * @param success `true` if the file loaded successfully, otherwise `false`. + */ + nextFile(file: Phaser.Loader.File, success: boolean): void; + + /** + * An internal method that is called automatically by the File when it has finished processing. + * + * If the process was successful, and the File isn't part of a MultiFile, its `addToCache` method is called. + * + * It this then removed from the queue. If there are no more files to load `loadComplete` is called. + * @param file The file that has finished processing. + */ + fileProcessComplete(file: Phaser.Loader.File): void; + + /** + * Called at the end when the load queue is exhausted and all files have either loaded or errored. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Also clears down the Sets, puts progress to 1 and clears the deletion queue. + */ + loadComplete(): void; + + /** + * Adds a File into the pending-deletion queue. + * @param file The File to be queued for deletion when the Loader completes. + */ + flagForRemoval(file: Phaser.Loader.File): void; + + /** + * Converts the given JSON data into a file that the browser then prompts you to download so you can save it locally. + * + * The data must be well formed JSON and ready-parsed, not a JavaScript object. + * @param data The JSON data, ready parsed. + * @param filename The name to save the JSON file as. Default file.json. + */ + saveJSON(data: any, filename?: string): Phaser.Loader.LoaderPlugin; + + /** + * Causes the browser to save the given data as a file to its default Downloads folder. + * + * Creates a DOM level anchor link, assigns it as being a `download` anchor, sets the href + * to be an ObjectURL based on the given data, and then invokes a click event. + * @param data The data to be saved. Will be passed through URL.createObjectURL. + * @param filename The filename to save the file as. Default file.json. + * @param filetype The file type to use when saving the file. Defaults to JSON. Default application/json. + */ + save(data: any, filename?: string, filetype?: string): Phaser.Loader.LoaderPlugin; + + /** + * Resets the Loader. + * + * This will clear all lists and reset the base URL, path and prefix. + * + * Warning: If the Loader is currently downloading files, or has files in its queue, they will be aborted. + */ + reset(): void; + + } + + /** + * Takes two XHRSettings Objects and creates a new XHRSettings object from them. + * + * The new object is seeded by the values given in the global settings, but any setting in + * the local object overrides the global ones. + * @param global The global XHRSettings object. + * @param local The local XHRSettings object. + */ + function MergeXHRSettings(global: Phaser.Types.Loader.XHRSettingsObject, local: Phaser.Types.Loader.XHRSettingsObject): Phaser.Types.Loader.XHRSettingsObject; + + /** + * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after + * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. + * + * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. + */ + class MultiFile { + /** + * + * @param loader The Loader that is going to load this File. + * @param type The file type string for sorting within the Loader. + * @param key The key of the file within the loader. + * @param files An array of Files that make-up this MultiFile. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, type: string, key: string, files: Phaser.Loader.File[]); + + /** + * A reference to the Loader that is going to load this file. + */ + loader: Phaser.Loader.LoaderPlugin; + + /** + * The file type string for sorting within the Loader. + */ + type: string; + + /** + * Unique cache key (unique within its file type) + */ + key: string; + + /** + * Array of files that make up this MultiFile. + */ + files: Phaser.Loader.File[]; + + /** + * The completion status of this MultiFile. + */ + complete: boolean; + + /** + * The number of files to load. + */ + pending: integer; + + /** + * The number of files that failed to load. + */ + failed: integer; + + /** + * A storage container for transient data that the loading files need. + */ + config: any; + + /** + * Checks if this MultiFile is ready to process its children or not. + */ + isReadyToProcess(): boolean; + + /** + * Adds another child to this MultiFile, increases the pending count and resets the completion status. + * @param files The File to add to this MultiFile. + */ + addToMultiFile(files: Phaser.Loader.File): Phaser.Loader.MultiFile; + + /** + * Called by each File when it finishes loading. + * @param file The File that has completed processing. + */ + onFileComplete(file: Phaser.Loader.File): void; + + /** + * Called by each File that fails to load. + * @param file The File that has failed to load. + */ + onFileFailed(file: Phaser.Loader.File): void; + + } + + /** + * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings + * and starts the download of it. It uses the Files own XHRSettings and merges them + * with the global XHRSettings object to set the xhr values before download. + * @param file The File to download. + * @param globalXHRSettings The global XHRSettings object. + */ + function XHRLoader(file: Phaser.Loader.File, globalXHRSettings: Phaser.Types.Loader.XHRSettingsObject): XMLHttpRequest; + + /** + * Creates an XHRSettings Object with default values. + * @param responseType The responseType, such as 'text'. Default ''. + * @param async Should the XHR request use async or not? Default true. + * @param user Optional username for the XHR request. Default ''. + * @param password Optional password for the XHR request. Default ''. + * @param timeout Optional XHR timeout value. Default 0. + */ + function XHRSettings(responseType?: XMLHttpRequestResponseType, async?: boolean, user?: string, password?: string, timeout?: integer): Phaser.Types.Loader.XHRSettingsObject; + + } + + namespace Math { + namespace Angle { + /** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Between(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * Calculates the angle of the vector from the first point to the second point. + * @param point1 The first point. + * @param point2 The second point. + */ + function BetweenPoints(point1: Phaser.Geom.Point | object, point2: Phaser.Geom.Point | object): number; + + /** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate + * travels down the screen. + * @param point1 The first point. + * @param point2 The second point. + */ + function BetweenPointsY(point1: Phaser.Geom.Point | object, point2: Phaser.Geom.Point | object): number; + + /** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate + * travels down the screen. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function BetweenY(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Takes an angle in Phasers default clockwise format and converts it so that + * 0 is North, 90 is West, 180 is South and 270 is East, + * therefore running counter-clockwise instead of clockwise. + * + * You can pass in the angle from a Game Object using: + * + * ```javascript + * var converted = CounterClockwise(gameobject.rotation); + * ``` + * + * All values for this function are in radians. + * @param angle The angle to convert, in radians. + */ + function CounterClockwise(angle: number): number; + + /** + * Normalize an angle to the [0, 2pi] range. + * @param angle The angle to normalize, in radians. + */ + function Normalize(angle: number): number; + + /** + * Reverse the given angle. + * @param angle The angle to reverse, in radians. + */ + function Reverse(angle: number): number; + + /** + * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. + * @param currentAngle The current angle, in radians. + * @param targetAngle The target angle to rotate to, in radians. + * @param lerp The lerp value to add to the current angle. Default 0.05. + */ + function RotateTo(currentAngle: number, targetAngle: number, lerp?: number): number; + + /** + * Gets the shortest angle between `angle1` and `angle2`. + * + * Both angles must be in the range -180 to 180, which is the same clamped + * range that `sprite.angle` uses, so you can pass in two sprite angles to + * this method and get the shortest angle back between the two of them. + * + * The angle returned will be in the same range. If the returned angle is + * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's + * a clockwise rotation. + * + * TODO: Wrap the angles in this function? + * @param angle1 The first angle in the range -180 to 180. + * @param angle2 The second angle in the range -180 to 180. + */ + function ShortestBetween(angle1: number, angle2: number): number; + + /** + * Wrap an angle. + * + * Wraps the angle to a value in the range of -PI to PI. + * @param angle The angle to wrap, in radians. + */ + function Wrap(angle: number): number; + + /** + * Wrap an angle in degrees. + * + * Wraps the angle to a value in the range of -180 to 180. + * @param angle The angle to wrap, in degrees. + */ + function WrapDegrees(angle: number): number; + + } + + /** + * Calculate the mean average of the given values. + * @param values The values to average. + */ + function Average(values: number[]): number; + + /** + * [description] + * @param n [description] + * @param i [description] + */ + function Bernstein(n: number, i: number): number; + + /** + * Compute a random integer between the `min` and `max` values, inclusive. + * @param min The minimum value. + * @param max The maximum value. + */ + function Between(min: integer, max: integer): integer; + + /** + * Calculates a Catmull-Rom value. + * @param t [description] + * @param p0 [description] + * @param p1 [description] + * @param p2 [description] + * @param p3 [description] + */ + function CatmullRom(t: number, p0: number, p1: number, p2: number, p3: number): number; + + /** + * Ceils to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * @param value The value to round. + * @param place The place to round to. Default 0. + * @param base The base to round in. Default is 10 for decimal. Default 10. + */ + function CeilTo(value: number, place?: number, base?: integer): number; + + /** + * Force a value within the boundaries by clamping it to the range `min`, `max`. + * @param value The value to be clamped. + * @param min The minimum bounds. + * @param max The maximum bounds. + */ + function Clamp(value: number, min: number, max: number): number; + + /** + * The value of PI * 2. + */ + var PI2: number; + + /** + * The value of PI * 0.5. + */ + var TAU: number; + + /** + * An epsilon value (1.0e-6) + */ + var EPSILON: number; + + /** + * For converting degrees to radians (PI / 180) + */ + var DEG_TO_RAD: number; + + /** + * For converting radians to degrees (180 / PI) + */ + var RAD_TO_DEG: number; + + /** + * An instance of the Random Number Generator. + * This is not set until the Game boots. + */ + var RND: Phaser.Math.RandomDataGenerator; + + /** + * Convert the given angle from degrees, to the equivalent angle in radians. + * @param degrees The angle (in degrees) to convert to radians. + */ + function DegToRad(degrees: integer): number; + + /** + * Calculates the positive difference of two given numbers. + * @param a The first number in the calculation. + * @param b The second number in the calculation. + */ + function Difference(a: number, b: number): number; + + namespace Distance { + /** + * Calculate the distance between two sets of coordinates (points). + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Between(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Calculate the distance between two sets of coordinates (points) to the power of `pow`. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + * @param pow The exponent. + */ + function Power(x1: number, y1: number, x2: number, y2: number, pow: number): number; + + /** + * Calculate the distance between two sets of coordinates (points), squared. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Squared(x1: number, y1: number, x2: number, y2: number): number; + + } + + namespace Easing { + namespace Back { + /** + * Back ease-in. + * @param v The value to be tweened. + * @param overshoot The overshoot amount. Default 1.70158. + */ + function In(v: number, overshoot?: number): number; + + /** + * Back ease-in/out. + * @param v The value to be tweened. + * @param overshoot The overshoot amount. Default 1.70158. + */ + function InOut(v: number, overshoot?: number): number; + + /** + * Back ease-out. + * @param v The value to be tweened. + * @param overshoot The overshoot amount. Default 1.70158. + */ + function Out(v: number, overshoot?: number): number; + + } + + namespace Bounce { + /** + * Bounce ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Bounce ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Bounce ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Circular { + /** + * Circular ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Circular ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Circular ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Cubic { + /** + * Cubic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Cubic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Cubic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Elastic { + /** + * Elastic ease-in. + * @param v The value to be tweened. + * @param amplitude The amplitude of the elastic ease. Default 0.1. + * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. + */ + function In(v: number, amplitude?: number, period?: number): number; + + /** + * Elastic ease-in/out. + * @param v The value to be tweened. + * @param amplitude The amplitude of the elastic ease. Default 0.1. + * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. + */ + function InOut(v: number, amplitude?: number, period?: number): number; + + /** + * Elastic ease-out. + * @param v The value to be tweened. + * @param amplitude The amplitude of the elastic ease. Default 0.1. + * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. + */ + function Out(v: number, amplitude?: number, period?: number): number; + + } + + namespace Expo { + /** + * Exponential ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Exponential ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Exponential ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Linear { + /** + * Linear easing (no variation). + * @param v The value to be tweened. + */ + function Linear(v: number): number; + + } + + namespace Quadratic { + /** + * Quadratic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Quadratic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Quadratic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Quartic { + /** + * Quartic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Quartic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Quartic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Quintic { + /** + * Quintic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Quintic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Quintic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Sine { + /** + * Sinusoidal ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Sinusoidal ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Sinusoidal ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Stepped { + /** + * Stepped easing. + * @param v The value to be tweened. + * @param steps The number of steps in the ease. Default 1. + */ + function Stepped(v: number, steps?: number): number; + + } + + } + + /** + * Calculates the factorial of a given number for integer values greater than 0. + * @param value A positive integer to calculate the factorial of. + */ + function Factorial(value: number): number; + + /** + * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive. + * @param min The lower bound for the float, inclusive. + * @param max The upper bound for the float exclusive. + */ + function FloatBetween(min: number, max: number): number; + + /** + * Floors to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * @param value The value to round. + * @param place The place to round to. Default 0. + * @param base The base to round in. Default is 10 for decimal. Default 10. + */ + function FloorTo(value: number, place?: integer, base?: integer): number; + + /** + * Return a value based on the range between `min` and `max` and the percentage given. + * @param percent A value between 0 and 1 representing the percentage. + * @param min The minimum value. + * @param max The maximum value. + */ + function FromPercent(percent: number, min: number, max?: number): number; + + namespace Fuzzy { + /** + * Calculate the fuzzy ceiling of the given value. + * @param value The value. + * @param epsilon The epsilon. Default 0.0001. + */ + function Ceil(value: number, epsilon?: number): number; + + /** + * Check whether the given values are fuzzily equal. + * + * Two numbers are fuzzily equal if their difference is less than `epsilon`. + * @param a The first value. + * @param b The second value. + * @param epsilon The epsilon. Default 0.0001. + */ + function Equal(a: number, b: number, epsilon?: number): boolean; + + /** + * Calculate the fuzzy floor of the given value. + * @param value The value. + * @param epsilon The epsilon. Default 0.0001. + */ + function Floor(value: number, epsilon?: number): number; + + /** + * Check whether `a` is fuzzily greater than `b`. + * + * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. + * @param a The first value. + * @param b The second value. + * @param epsilon The epsilon. Default 0.0001. + */ + function GreaterThan(a: number, b: number, epsilon?: number): boolean; + + /** + * Check whether `a` is fuzzily less than `b`. + * + * `a` is fuzzily less than `b` if it is less than `b + epsilon`. + * @param a The first value. + * @param b The second value. + * @param epsilon The epsilon. Default 0.0001. + */ + function LessThan(a: number, b: number, epsilon?: number): boolean; + + } + + /** + * Calculate the speed required to cover a distance in the time given. + * @param distance The distance to travel in pixels. + * @param time The time, in ms, to cover the distance in. + */ + function GetSpeed(distance: number, time: integer): number; + + namespace Interpolation { + /** + * A bezier interpolation method. + * @param v The input array of values to interpolate between. + * @param k The percentage of interpolation, between 0 and 1. + */ + function Bezier(v: number[], k: number): number; + + /** + * A Catmull-Rom interpolation method. + * @param v The input array of values to interpolate between. + * @param k The percentage of interpolation, between 0 and 1. + */ + function CatmullRom(v: number[], k: number): number; + + /** + * A cubic bezier interpolation method. + * + * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a + * @param t The percentage of interpolation, between 0 and 1. + * @param p0 The start point. + * @param p1 The first control point. + * @param p2 The second control point. + * @param p3 The end point. + */ + function CubicBezier(t: number, p0: number, p1: number, p2: number, p3: number): number; + + /** + * A linear interpolation method. + * @param v The input array of values to interpolate between. + * @param k The percentage of interpolation, between 0 and 1. + */ + function Linear(v: number[], k: number): number; + + /** + * A quadratic bezier interpolation method. + * @param t The percentage of interpolation, between 0 and 1. + * @param p0 The start point. + * @param p1 The control point. + * @param p2 The end point. + */ + function QuadraticBezier(t: number, p0: number, p1: number, p2: number): number; + + /** + * A Smoother Step interpolation method. + * @param t The percentage of interpolation, between 0 and 1. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmootherStep(t: number, min: number, max: number): number; + + /** + * A Smooth Step interpolation method. + * @param t The percentage of interpolation, between 0 and 1. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmoothStep(t: number, min: number, max: number): number; + + } + + /** + * Check if a given value is an even number. + * @param value The number to perform the check with. + */ + function IsEven(value: number): boolean; + + /** + * Check if a given value is an even number using a strict type check. + * @param value The number to perform the check with. + */ + function IsEvenStrict(value: number): boolean; + + /** + * Calculates a linear (interpolation) value over t. + * @param p0 The first point. + * @param p1 The second point. + * @param t The percentage between p0 and p1 to return, represented as a number between 0 and 1. + */ + function Linear(p0: number, p1: number, t: number): number; + + /** + * A three-dimensional matrix. + * + * Defaults to the identity matrix when instantiated. + */ + class Matrix3 { + /** + * + * @param m Optional Matrix3 to copy values from. + */ + constructor(m?: Phaser.Math.Matrix3); + + /** + * The matrix values. + */ + val: Float32Array; + + /** + * Make a clone of this Matrix3. + */ + clone(): Phaser.Math.Matrix3; + + /** + * This method is an alias for `Matrix3.copy`. + * @param src The Matrix to set the values of this Matrix's from. + */ + set(src: Phaser.Math.Matrix3): Phaser.Math.Matrix3; + + /** + * Copy the values of a given Matrix into this Matrix. + * @param src The Matrix to copy the values from. + */ + copy(src: Phaser.Math.Matrix3): Phaser.Math.Matrix3; + + /** + * Copy the values of a given Matrix4 into this Matrix3. + * @param m The Matrix4 to copy the values from. + */ + fromMat4(m: Phaser.Math.Matrix4): Phaser.Math.Matrix3; + + /** + * Set the values of this Matrix from the given array. + * @param a The array to copy the values from. + */ + fromArray(a: any[]): Phaser.Math.Matrix3; + + /** + * Reset this Matrix to an identity (default) matrix. + */ + identity(): Phaser.Math.Matrix3; + + /** + * Transpose this Matrix. + */ + transpose(): Phaser.Math.Matrix3; + + /** + * Invert this Matrix. + */ + invert(): Phaser.Math.Matrix3; + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + */ + adjoint(): Phaser.Math.Matrix3; + + /** + * Calculate the determinant of this Matrix. + */ + determinant(): number; + + /** + * Multiply this Matrix by the given Matrix. + * @param src The Matrix to multiply this Matrix by. + */ + multiply(src: Phaser.Math.Matrix3): Phaser.Math.Matrix3; + + /** + * Translate this Matrix using the given Vector. + * @param v The Vector to translate this Matrix with. + */ + translate(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Matrix3; + + /** + * Apply a rotation transformation to this Matrix. + * @param rad The angle in radians to rotate by. + */ + rotate(rad: number): Phaser.Math.Matrix3; + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x` and `y` components of the given Vector to scale the Matrix. + * @param v The Vector to scale this Matrix with. + */ + scale(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Matrix3; + + /** + * Set the values of this Matrix from the given Quaternion. + * @param q The Quaternion to set the values of this Matrix from. + */ + fromQuat(q: Phaser.Math.Quaternion): Phaser.Math.Matrix3; + + /** + * [description] + * @param m [description] + */ + normalFromMat4(m: Phaser.Math.Matrix4): Phaser.Math.Matrix3; + + } + + /** + * A four-dimensional matrix. + */ + class Matrix4 { + /** + * + * @param m Optional Matrix4 to copy values from. + */ + constructor(m?: Phaser.Math.Matrix4); + + /** + * The matrix values. + */ + val: Float32Array; + + /** + * Make a clone of this Matrix4. + */ + clone(): Phaser.Math.Matrix4; + + /** + * This method is an alias for `Matrix4.copy`. + * @param src The Matrix to set the values of this Matrix's from. + */ + set(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + /** + * Copy the values of a given Matrix into this Matrix. + * @param src The Matrix to copy the values from. + */ + copy(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + /** + * Set the values of this Matrix from the given array. + * @param a The array to copy the values from. + */ + fromArray(a: any[]): Phaser.Math.Matrix4; + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + */ + zero(): Phaser.Math.Matrix4; + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * @param x The x value. + * @param y The y value. + * @param z The z value. + */ + xyz(x: number, y: number, z: number): Phaser.Math.Matrix4; + + /** + * Set the scaling values of this Matrix. + * @param x The x scaling value. + * @param y The y scaling value. + * @param z The z scaling value. + */ + scaling(x: number, y: number, z: number): Phaser.Math.Matrix4; + + /** + * Reset this Matrix to an identity (default) matrix. + */ + identity(): Phaser.Math.Matrix4; + + /** + * Transpose this Matrix. + */ + transpose(): Phaser.Math.Matrix4; + + /** + * Invert this Matrix. + */ + invert(): Phaser.Math.Matrix4; + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + */ + adjoint(): Phaser.Math.Matrix4; + + /** + * Calculate the determinant of this Matrix. + */ + determinant(): number; + + /** + * Multiply this Matrix by the given Matrix. + * @param src The Matrix to multiply this Matrix by. + */ + multiply(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + /** + * [description] + * @param src [description] + */ + multiplyLocal(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + /** + * Translate this Matrix using the given Vector. + * @param v The Vector to translate this Matrix with. + */ + translate(v: Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Matrix4; + + /** + * Translate this Matrix using the given values. + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + translateXYZ(x: number, y: number, z: number): Phaser.Math.Matrix4; + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * @param v The Vector to scale this Matrix with. + */ + scale(v: Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Matrix4; + + /** + * Apply a scale transformation to this Matrix. + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + scaleXYZ(x: number, y: number, z: number): Phaser.Math.Matrix4; + + /** + * Derive a rotation matrix around the given axis. + * @param axis The rotation axis. + * @param angle The rotation angle in radians. + */ + makeRotationAxis(axis: Phaser.Math.Vector3 | Phaser.Math.Vector4, angle: number): Phaser.Math.Matrix4; + + /** + * Apply a rotation transformation to this Matrix. + * @param rad The angle in radians to rotate by. + * @param axis The axis to rotate upon. + */ + rotate(rad: number, axis: Phaser.Math.Vector3): Phaser.Math.Matrix4; + + /** + * Rotate this matrix on its X axis. + * @param rad The angle in radians to rotate by. + */ + rotateX(rad: number): Phaser.Math.Matrix4; + + /** + * Rotate this matrix on its Y axis. + * @param rad The angle to rotate by, in radians. + */ + rotateY(rad: number): Phaser.Math.Matrix4; + + /** + * Rotate this matrix on its Z axis. + * @param rad The angle to rotate by, in radians. + */ + rotateZ(rad: number): Phaser.Math.Matrix4; + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * @param q The Quaternion to set rotation from. + * @param v The Vector to set translation from. + */ + fromRotationTranslation(q: Phaser.Math.Quaternion, v: Phaser.Math.Vector3): Phaser.Math.Matrix4; + + /** + * Set the values of this Matrix from the given Quaternion. + * @param q The Quaternion to set the values of this Matrix from. + */ + fromQuat(q: Phaser.Math.Quaternion): Phaser.Math.Matrix4; + + /** + * Generate a frustum matrix with the given bounds. + * @param left The left bound of the frustum. + * @param right The right bound of the frustum. + * @param bottom The bottom bound of the frustum. + * @param top The top bound of the frustum. + * @param near The near bound of the frustum. + * @param far The far bound of the frustum. + */ + frustum(left: number, right: number, bottom: number, top: number, near: number, far: number): Phaser.Math.Matrix4; + + /** + * Generate a perspective projection matrix with the given bounds. + * @param fovy Vertical field of view in radians + * @param aspect Aspect ratio. Typically viewport width /height. + * @param near Near bound of the frustum. + * @param far Far bound of the frustum. + */ + perspective(fovy: number, aspect: number, near: number, far: number): Phaser.Math.Matrix4; + + /** + * Generate a perspective projection matrix with the given bounds. + * @param width The width of the frustum. + * @param height The height of the frustum. + * @param near Near bound of the frustum. + * @param far Far bound of the frustum. + */ + perspectiveLH(width: number, height: number, near: number, far: number): Phaser.Math.Matrix4; + + /** + * Generate an orthogonal projection matrix with the given bounds. + * @param left The left bound of the frustum. + * @param right The right bound of the frustum. + * @param bottom The bottom bound of the frustum. + * @param top The top bound of the frustum. + * @param near The near bound of the frustum. + * @param far The far bound of the frustum. + */ + ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): Phaser.Math.Matrix4; + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * @param eye Position of the viewer + * @param center Point the viewer is looking at + * @param up vec3 pointing up. + */ + lookAt(eye: Phaser.Math.Vector3, center: Phaser.Math.Vector3, up: Phaser.Math.Vector3): Phaser.Math.Matrix4; + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * @param yaw [description] + * @param pitch [description] + * @param roll [description] + */ + yawPitchRoll(yaw: number, pitch: number, roll: number): Phaser.Math.Matrix4; + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * @param rotation The rotation of the world matrix. + * @param position The position of the world matrix. + * @param scale The scale of the world matrix. + * @param viewMatrix The view matrix. + * @param projectionMatrix The projection matrix. + */ + setWorldMatrix(rotation: Phaser.Math.Vector3, position: Phaser.Math.Vector3, scale: Phaser.Math.Vector3, viewMatrix?: Phaser.Math.Matrix4, projectionMatrix?: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + } + + /** + * Add an `amount` to a `value`, limiting the maximum result to `max`. + * @param value The value to add to. + * @param amount The amount to add. + * @param max The maximum value to return. + */ + function MaxAdd(value: number, amount: number, max: number): number; + + /** + * Subtract an `amount` from `value`, limiting the minimum result to `min`. + * @param value The value to subtract from. + * @param amount The amount to subtract. + * @param min The minimum value to return. + */ + function MinSub(value: number, amount: number, min: number): number; + + /** + * Work out what percentage `value` is of the range between `min` and `max`. + * If `max` isn't given then it will return the percentage of `value` to `min`. + * + * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again. + * @param value The value to determine the percentage of. + * @param min The minimum value. + * @param max The maximum value. + * @param upperMax The mid-way point in the range that represents 100%. + */ + function Percent(value: number, min: number, max?: number, upperMax?: number): number; + + namespace Pow2 { + /** + * Returns the nearest power of 2 to the given `value`. + * @param value The value. + */ + function GetPowerOfTwo(value: number): integer; + + /** + * Checks if the given `width` and `height` are a power of two. + * Useful for checking texture dimensions. + * @param width The width. + * @param height The height. + */ + function IsSizePowerOfTwo(width: number, height: number): boolean; + + /** + * Tests the value and returns `true` if it is a power of two. + * @param value The value to check if it's a power of two. + */ + function IsValuePowerOfTwo(value: number): boolean; + + } + + /** + * A quaternion. + */ + class Quaternion { + /** + * + * @param x The x component. + * @param y The y component. + * @param z The z component. + * @param w The w component. + */ + constructor(x?: number, y?: number, z?: number, w?: number); + + /** + * The x component of this Quaternion. + */ + x: number; + + /** + * The y component of this Quaternion. + */ + y: number; + + /** + * The z component of this Quaternion. + */ + z: number; + + /** + * The w component of this Quaternion. + */ + w: number; + + /** + * Copy the components of a given Quaternion or Vector into this Quaternion. + * @param src The Quaternion or Vector to copy the components from. + */ + copy(src: Phaser.Math.Quaternion | Phaser.Math.Vector4): Phaser.Math.Quaternion; + + /** + * Set the components of this Quaternion. + * @param x The x component, or an object containing x, y, z, and w components. Default 0. + * @param y The y component. Default 0. + * @param z The z component. Default 0. + * @param w The w component. Default 0. + */ + set(x?: number | object, y?: number, z?: number, w?: number): Phaser.Math.Quaternion; + + /** + * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. + * @param v The Quaternion or Vector to add to this Quaternion. + */ + add(v: Phaser.Math.Quaternion | Phaser.Math.Vector4): Phaser.Math.Quaternion; + + /** + * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. + * @param v The Quaternion or Vector to subtract from this Quaternion. + */ + subtract(v: Phaser.Math.Quaternion | Phaser.Math.Vector4): Phaser.Math.Quaternion; + + /** + * Scale this Quaternion by the given value. + * @param scale The value to scale this Quaternion by. + */ + scale(scale: number): Phaser.Math.Quaternion; + + /** + * Calculate the length of this Quaternion. + */ + length(): number; + + /** + * Calculate the length of this Quaternion squared. + */ + lengthSq(): number; + + /** + * Normalize this Quaternion. + */ + normalize(): Phaser.Math.Quaternion; + + /** + * Calculate the dot product of this Quaternion and the given Quaternion or Vector. + * @param v The Quaternion or Vector to dot product with this Quaternion. + */ + dot(v: Phaser.Math.Quaternion | Phaser.Math.Vector4): number; + + /** + * Linearly interpolate this Quaternion towards the given Quaternion or Vector. + * @param v The Quaternion or Vector to interpolate towards. + * @param t The percentage of interpolation. Default 0. + */ + lerp(v: Phaser.Math.Quaternion | Phaser.Math.Vector4, t?: number): Phaser.Math.Quaternion; + + /** + * [description] + * @param a [description] + * @param b [description] + */ + rotationTo(a: Phaser.Math.Vector3, b: Phaser.Math.Vector3): Phaser.Math.Quaternion; + + /** + * Set the axes of this Quaternion. + * @param view The view axis. + * @param right The right axis. + * @param up The upwards axis. + */ + setAxes(view: Phaser.Math.Vector3, right: Phaser.Math.Vector3, up: Phaser.Math.Vector3): Phaser.Math.Quaternion; + + /** + * Reset this Matrix to an identity (default) Quaternion. + */ + identity(): Phaser.Math.Quaternion; + + /** + * Set the axis angle of this Quaternion. + * @param axis The axis. + * @param rad The angle in radians. + */ + setAxisAngle(axis: Phaser.Math.Vector3, rad: number): Phaser.Math.Quaternion; + + /** + * Multiply this Quaternion by the given Quaternion or Vector. + * @param b The Quaternion or Vector to multiply this Quaternion by. + */ + multiply(b: Phaser.Math.Quaternion | Phaser.Math.Vector4): Phaser.Math.Quaternion; + + /** + * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. + * @param b The Quaternion or Vector to interpolate towards. + * @param t The percentage of interpolation. + */ + slerp(b: Phaser.Math.Quaternion | Phaser.Math.Vector4, t: number): Phaser.Math.Quaternion; + + /** + * Invert this Quaternion. + */ + invert(): Phaser.Math.Quaternion; + + /** + * Convert this Quaternion into its conjugate. + * + * Sets the x, y and z components. + */ + conjugate(): Phaser.Math.Quaternion; + + /** + * Rotate this Quaternion on the X axis. + * @param rad The rotation angle in radians. + */ + rotateX(rad: number): Phaser.Math.Quaternion; + + /** + * Rotate this Quaternion on the Y axis. + * @param rad The rotation angle in radians. + */ + rotateY(rad: number): Phaser.Math.Quaternion; + + /** + * Rotate this Quaternion on the Z axis. + * @param rad The rotation angle in radians. + */ + rotateZ(rad: number): Phaser.Math.Quaternion; + + /** + * Create a unit (or rotation) Quaternion from its x, y, and z components. + * + * Sets the w component. + */ + calculateW(): Phaser.Math.Quaternion; + + /** + * Convert the given Matrix into this Quaternion. + * @param mat The Matrix to convert from. + */ + fromMat3(mat: Phaser.Math.Matrix3): Phaser.Math.Quaternion; + + } + + /** + * Convert the given angle in radians, to the equivalent angle in degrees. + * @param radians The angle in radians to convert ot degrees. + */ + function RadToDeg(radians: number): integer; + + /** + * A seeded Random Data Generator. + * + * Access via `Phaser.Math.RND` which is an instance of this class pre-defined + * by Phaser. Or, create your own instance to use as you require. + * + * The `Math.RND` generator is seeded by the Game Config property value `seed`. + * If no such config property exists, a random number is used. + * + * If you create your own instance of this class you should provide a seed for it. + * If no seed is given it will use a 'random' one based on Date.now. + */ + class RandomDataGenerator { + /** + * + * @param seeds The seeds to use for the random number generator. + */ + constructor(seeds?: string | string[]); + + /** + * Signs to choose from. + */ + signs: number[]; + + /** + * Initialize the state of the random data generator. + * @param seeds The seeds to initialize the random data generator with. + */ + init(seeds: string | string[]): void; + + /** + * Reset the seed of the random data generator. + * + * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. + * @param seeds The array of seeds: the `toString()` of each value is used. + */ + sow(seeds: string[]): void; + + /** + * Returns a random integer between 0 and 2^32. + */ + integer(): number; + + /** + * Returns a random real number between 0 and 1. + */ + frac(): number; + + /** + * Returns a random real number between 0 and 2^32. + */ + real(): number; + + /** + * Returns a random integer between and including min and max. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + integerInRange(min: number, max: number): number; + + /** + * Returns a random integer between and including min and max. + * This method is an alias for RandomDataGenerator.integerInRange. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + between(min: number, max: number): number; + + /** + * Returns a random real number between min and max. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + realInRange(min: number, max: number): number; + + /** + * Returns a random real number between -1 and 1. + */ + normal(): number; + + /** + * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 + */ + uuid(): string; + + /** + * Returns a random element from within the given array. + * @param array The array to pick a random element from. + */ + pick(array: any[]): any; + + /** + * Returns a sign to be used with multiplication operator. + */ + sign(): number; + + /** + * Returns a random element from within the given array, favoring the earlier entries. + * @param array The array to pick a random element from. + */ + weightedPick(array: any[]): any; + + /** + * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + timestamp(min: number, max: number): number; + + /** + * Returns a random angle between -180 and 180. + */ + angle(): number; + + /** + * Returns a random rotation in radians, between -3.141 and 3.141 + */ + rotation(): number; + + /** + * Gets or Sets the state of the generator. This allows you to retain the values + * that the generator is using between games, i.e. in a game save file. + * + * To seed this generator with a previously saved state you can pass it as the + * `seed` value in your game config, or call this method directly after Phaser has booted. + * + * Call this method with no parameters to return the current state. + * + * If providing a state it should match the same format that this method + * returns, which is a string with a header `!rnd` followed by the `c`, + * `s0`, `s1` and `s2` values respectively, each comma-delimited. + * @param state Generator state to be set. + */ + state(state?: string): string; + + /** + * Shuffles the given array, using the current seed. + * @param array The array to be shuffled. + */ + shuffle(array?: any[]): any[]; + + } + + /** + * Compute a random unit vector. + * + * Computes random values for the given vector between -1 and 1 that can be used to represent a direction. + * + * Optionally accepts a scale value to scale the resulting vector by. + * @param vector The Vector to compute random values for. + * @param scale The scale of the random values. Default 1. + */ + function RandomXY(vector: Phaser.Math.Vector2, scale?: number): Phaser.Math.Vector2; + + /** + * Compute a random position vector in a spherical area, optionally defined by the given radius. + * @param vec3 The Vector to compute random values for. + * @param radius The radius. Default 1. + */ + function RandomXYZ(vec3: Phaser.Math.Vector3, radius?: number): Phaser.Math.Vector3; + + /** + * Compute a random four-dimensional vector. + * @param vec4 The Vector to compute random values for. + * @param scale The scale of the random values. Default 1. + */ + function RandomXYZW(vec4: Phaser.Math.Vector4, scale?: number): Phaser.Math.Vector4; + + /** + * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction. + * @param point The point to be rotated. + * @param angle The angle to be rotated by in an anticlockwise direction. + */ + function Rotate(point: Phaser.Geom.Point | object, angle: number): Phaser.Geom.Point; + + /** + * Rotate a `point` around `x` and `y` by the given `angle`. + * @param point The point to be rotated. + * @param x The horizontal coordinate to rotate around. + * @param y The vertical coordinate to rotate around. + * @param angle The angle of rotation in radians. + */ + function RotateAround(point: Phaser.Geom.Point | object, x: number, y: number, angle: number): Phaser.Geom.Point; + + /** + * Rotate a `point` around `x` and `y` by the given `angle` and `distance`. + * @param point The point to be rotated. + * @param x The horizontal coordinate to rotate around. + * @param y The vertical coordinate to rotate around. + * @param angle The angle of rotation in radians. + * @param distance The distance from (x, y) to place the point at. + */ + function RotateAroundDistance(point: Phaser.Geom.Point | object, x: number, y: number, angle: number, distance: number): Phaser.Geom.Point; + + /** + * Rotates a vector in place by axis angle. + * + * This is the same as transforming a point by an + * axis-angle quaternion, but it has higher precision. + * @param vec The vector to be rotated. + * @param axis The axis to rotate around. + * @param radians The angle of rotation in radians. + */ + function RotateVec3(vec: Phaser.Math.Vector3, axis: Phaser.Math.Vector3, radians: number): Phaser.Math.Vector3; + + /** + * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. + * @param value The number to round. + */ + function RoundAwayFromZero(value: number): number; + + /** + * Round a value to the given precision. + * + * For example: + * + * ```javascript + * RoundTo(123.456, 0) = 123 + * RoundTo(123.456, 1) = 120 + * RoundTo(123.456, 2) = 100 + * ``` + * + * To round the decimal, i.e. to round to precision, pass in a negative `place`: + * + * ```javascript + * RoundTo(123.456789, 0) = 123 + * RoundTo(123.456789, -1) = 123.5 + * RoundTo(123.456789, -2) = 123.46 + * RoundTo(123.456789, -3) = 123.457 + * ``` + * @param value The value to round. + * @param place The place to round to. Positive to round the units, negative to round the decimal. Default 0. + * @param base The base to round in. Default is 10 for decimal. Default 10. + */ + function RoundTo(value: number, place?: integer, base?: integer): number; + + /** + * Generate a series of sine and cosine values. + * @param length The number of values to generate. + * @param sinAmp The sine value amplitude. Default 1. + * @param cosAmp The cosine value amplitude. Default 1. + * @param frequency The frequency of the values. Default 1. + */ + function SinCosTableGenerator(length: number, sinAmp?: number, cosAmp?: number, frequency?: number): Phaser.Types.Math.SinCosTable; + + /** + * Calculate a smoother interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. + * @param x The input value. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmootherStep(x: number, min: number, max: number): number; + + /** + * Calculate a smooth interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * @param x The input value. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmoothStep(x: number, min: number, max: number): number; + + namespace Snap { + /** + * Snap a value to nearest grid slice, using ceil. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. + * As will `14` snap to `15`... but `16` will snap to `20`. + * @param value The value to snap. + * @param gap The interval gap of the grid. + * @param start Optional starting offset for gap. Default 0. + * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. + */ + function Ceil(value: number, gap: number, start?: number, divide?: boolean): number; + + /** + * Snap a value to nearest grid slice, using floor. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. + * As will `14` snap to `10`... but `16` will snap to `15`. + * @param value The value to snap. + * @param gap The interval gap of the grid. + * @param start Optional starting offset for gap. Default 0. + * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. + */ + function Floor(value: number, gap: number, start?: number, divide?: boolean): number; + + /** + * Snap a value to nearest grid slice, using rounding. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. + * @param value The value to snap. + * @param gap The interval gap of the grid. + * @param start Optional starting offset for gap. Default 0. + * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. + */ + function To(value: number, gap: number, start?: number, divide?: boolean): number; + + } + + /** + * Takes the `x` and `y` coordinates and transforms them into the same space as + * defined by the position, rotation and scale values. + * @param x The x coordinate to be transformed. + * @param y The y coordinate to be transformed. + * @param positionX Horizontal position of the transform point. + * @param positionY Vertical position of the transform point. + * @param rotation Rotation of the transform point, in radians. + * @param scaleX Horizontal scale of the transform point. + * @param scaleY Vertical scale of the transform point. + * @param output The output vector, point or object for the translated coordinates. + */ + function TransformXY(x: number, y: number, positionX: number, positionY: number, rotation: number, scaleX: number, scaleY: number, output?: Phaser.Math.Vector2 | Phaser.Geom.Point | object): Phaser.Math.Vector2 | Phaser.Geom.Point | object; + + /** + * A representation of a vector in 2D space. + * + * A two-component vector. + */ + class Vector2 { + /** + * + * @param x The x component, or an object with `x` and `y` properties. + * @param y The y component. + */ + constructor(x?: number | Phaser.Types.Math.Vector2Like, y?: number); + + /** + * The x component of this Vector. + */ + x: number; + + /** + * The y component of this Vector. + */ + y: number; + + /** + * Make a clone of this Vector2. + */ + clone(): Phaser.Math.Vector2; + + /** + * Copy the components of a given Vector into this Vector. + * @param src The Vector to copy the components from. + */ + copy(src: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Set the component values of this Vector from a given Vector2Like object. + * @param obj The object containing the component values to set for this Vector. + */ + setFromObject(obj: Phaser.Types.Math.Vector2Like): Phaser.Math.Vector2; + + /** + * Set the `x` and `y` components of the this Vector to the given `x` and `y` values. + * @param x The x value to set for this Vector. + * @param y The y value to set for this Vector. Default x. + */ + set(x: number, y?: number): Phaser.Math.Vector2; + + /** + * This method is an alias for `Vector2.set`. + * @param x The x value to set for this Vector. + * @param y The y value to set for this Vector. Default x. + */ + setTo(x: number, y?: number): Phaser.Math.Vector2; + + /** + * Sets the `x` and `y` values of this object from a given polar coordinate. + * @param azimuth The angular coordinate, in radians. + * @param radius The radial coordinate (length). Default 1. + */ + setToPolar(azimuth: number, radius?: number): Phaser.Math.Vector2; + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * @param v The vector to compare with this Vector. + */ + equals(v: Phaser.Math.Vector2): boolean; + + /** + * Calculate the angle between this Vector and the positive x-axis, in radians. + */ + angle(): number; + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * @param src The Vector to add to this Vector. + */ + add(src: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * @param src The Vector to subtract from this Vector. + */ + subtract(src: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * @param src The Vector to multiply this Vector by. + */ + multiply(src: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Scale this Vector by the given value. + * @param value The value to scale this Vector by. + */ + scale(value: number): Phaser.Math.Vector2; + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * @param src The Vector to divide this Vector by. + */ + divide(src: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Negate the `x` and `y` components of this Vector. + */ + negate(): Phaser.Math.Vector2; + + /** + * Calculate the distance between this Vector and the given Vector. + * @param src The Vector to calculate the distance to. + */ + distance(src: Phaser.Math.Vector2): number; + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * @param src The Vector to calculate the distance to. + */ + distanceSq(src: Phaser.Math.Vector2): number; + + /** + * Calculate the length (or magnitude) of this Vector. + */ + length(): number; + + /** + * Calculate the length of this Vector squared. + */ + lengthSq(): number; + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + */ + normalize(): Phaser.Math.Vector2; + + /** + * Right-hand normalize (make unit length) this Vector. + */ + normalizeRightHand(): Phaser.Math.Vector2; + + /** + * Calculate the dot product of this Vector and the given Vector. + * @param src The Vector2 to dot product with this Vector2. + */ + dot(src: Phaser.Math.Vector2): number; + + /** + * Calculate the cross product of this Vector and the given Vector. + * @param src The Vector2 to cross with this Vector2. + */ + cross(src: Phaser.Math.Vector2): number; + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * @param src The Vector2 to interpolate towards. + * @param t The interpolation percentage, between 0 and 1. Default 0. + */ + lerp(src: Phaser.Math.Vector2, t?: number): Phaser.Math.Vector2; + + /** + * Transform this Vector with the given Matrix. + * @param mat The Matrix3 to transform this Vector2 with. + */ + transformMat3(mat: Phaser.Math.Matrix3): Phaser.Math.Vector2; + + /** + * Transform this Vector with the given Matrix. + * @param mat The Matrix4 to transform this Vector2 with. + */ + transformMat4(mat: Phaser.Math.Matrix4): Phaser.Math.Vector2; + + /** + * Make this Vector the zero vector (0, 0). + */ + reset(): Phaser.Math.Vector2; + + /** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly ZERO: Phaser.Math.Vector2; + + /** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly RIGHT: Phaser.Math.Vector2; + + /** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly LEFT: Phaser.Math.Vector2; + + /** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly UP: Phaser.Math.Vector2; + + /** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly DOWN: Phaser.Math.Vector2; + + /** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly ONE: Phaser.Math.Vector2; + + } + + /** + * A representation of a vector in 3D space. + * + * A three-component vector. + */ + class Vector3 { + /** + * + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + constructor(x?: number, y?: number, z?: number); + + /** + * The x component of this Vector. + */ + x: number; + + /** + * The y component of this Vector. + */ + y: number; + + /** + * The z component of this Vector. + */ + z: number; + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + */ + up(): Phaser.Math.Vector3; + + /** + * Make a clone of this Vector3. + */ + clone(): Phaser.Math.Vector3; + + /** + * Calculate the cross (vector) product of two given Vectors. + * @param a The first Vector to multiply. + * @param b The second Vector to multiply. + */ + crossVectors(a: Phaser.Math.Vector3, b: Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * @param v The Vector3 to compare against. + */ + equals(v: Phaser.Math.Vector3): boolean; + + /** + * Copy the components of a given Vector into this Vector. + * @param src The Vector to copy the components from. + */ + copy(src: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * @param x The x value to set for this Vector, or an object containing x, y and z components. + * @param y The y value to set for this Vector. + * @param z The z value to set for this Vector. + */ + set(x: number | object, y?: number, z?: number): Phaser.Math.Vector3; + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * @param v The Vector to add to this Vector. + */ + add(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * @param v The Vector to subtract from this Vector. + */ + subtract(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * @param v The Vector to multiply this Vector by. + */ + multiply(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Scale this Vector by the given value. + * @param scale The value to scale this Vector by. + */ + scale(scale: number): Phaser.Math.Vector3; + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * @param v The Vector to divide this Vector by. + */ + divide(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Negate the `x`, `y` and `z` components of this Vector. + */ + negate(): Phaser.Math.Vector3; + + /** + * Calculate the distance between this Vector and the given Vector. + * @param v The Vector to calculate the distance to. + */ + distance(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): number; + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * @param v The Vector to calculate the distance to. + */ + distanceSq(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): number; + + /** + * Calculate the length (or magnitude) of this Vector. + */ + length(): number; + + /** + * Calculate the length of this Vector squared. + */ + lengthSq(): number; + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + */ + normalize(): Phaser.Math.Vector3; + + /** + * Calculate the dot product of this Vector and the given Vector. + * @param v The Vector3 to dot product with this Vector3. + */ + dot(v: Phaser.Math.Vector3): number; + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * @param v The Vector to cross product with. + */ + cross(v: Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * @param v The Vector3 to interpolate towards. + * @param t The interpolation percentage, between 0 and 1. Default 0. + */ + lerp(v: Phaser.Math.Vector3, t?: number): Phaser.Math.Vector3; + + /** + * Transform this Vector with the given Matrix. + * @param mat The Matrix3 to transform this Vector3 with. + */ + transformMat3(mat: Phaser.Math.Matrix3): Phaser.Math.Vector3; + + /** + * Transform this Vector with the given Matrix. + * @param mat The Matrix4 to transform this Vector3 with. + */ + transformMat4(mat: Phaser.Math.Matrix4): Phaser.Math.Vector3; + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * @param mat The Matrix4 to transform this Vector3 with. + */ + transformCoordinates(mat: Phaser.Math.Matrix4): Phaser.Math.Vector3; + + /** + * Transform this Vector with the given Quaternion. + * @param q The Quaternion to transform this Vector with. + */ + transformQuat(q: Phaser.Math.Quaternion): Phaser.Math.Vector3; + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * @param mat The Matrix4 to multiply this Vector3 with. + */ + project(mat: Phaser.Math.Matrix4): Phaser.Math.Vector3; + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * @param viewport Screen x, y, width and height in pixels. + * @param invProjectionView Combined projection and view matrix. + */ + unproject(viewport: Phaser.Math.Vector4, invProjectionView: Phaser.Math.Matrix4): Phaser.Math.Vector3; + + /** + * Make this Vector the zero vector (0, 0, 0). + */ + reset(): Phaser.Math.Vector3; + + /** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly ZERO: Phaser.Math.Vector3; + + /** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly RIGHT: Phaser.Math.Vector3; + + /** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly LEFT: Phaser.Math.Vector3; + + /** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly UP: Phaser.Math.Vector3; + + /** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly DOWN: Phaser.Math.Vector3; + + /** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly FORWARD: Phaser.Math.Vector3; + + /** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly BACK: Phaser.Math.Vector3; + + /** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly ONE: Phaser.Math.Vector3; + + } + + /** + * A representation of a vector in 4D space. + * + * A four-component vector. + */ + class Vector4 { + /** + * + * @param x The x component. + * @param y The y component. + * @param z The z component. + * @param w The w component. + */ + constructor(x?: number, y?: number, z?: number, w?: number); + + /** + * The x component of this Vector. + */ + x: number; + + /** + * The y component of this Vector. + */ + y: number; + + /** + * The z component of this Vector. + */ + z: number; + + /** + * The w component of this Vector. + */ + w: number; + + /** + * Make a clone of this Vector4. + */ + clone(): Phaser.Math.Vector4; + + /** + * Copy the components of a given Vector into this Vector. + * @param src The Vector to copy the components from. + */ + copy(src: Phaser.Math.Vector4): Phaser.Math.Vector4; + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict quality check against each Vector's components. + * @param v The vector to check equality with. + */ + equals(v: Phaser.Math.Vector4): boolean; + + /** + * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values. + * @param x The x value to set for this Vector, or an object containing x, y, z and w components. + * @param y The y value to set for this Vector. + * @param z The z value to set for this Vector. + * @param w The z value to set for this Vector. + */ + set(x: number | object, y: number, z: number, w: number): Phaser.Math.Vector4; + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * @param v The Vector to add to this Vector. + */ + add(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Vector4; + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * @param v The Vector to subtract from this Vector. + */ + subtract(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Vector4; + + /** + * Scale this Vector by the given value. + * @param scale The value to scale this Vector by. + */ + scale(scale: number): Phaser.Math.Vector4; + + /** + * Calculate the length (or magnitude) of this Vector. + */ + length(): number; + + /** + * Calculate the length of this Vector squared. + */ + lengthSq(): number; + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + */ + normalize(): Phaser.Math.Vector4; + + /** + * Calculate the dot product of this Vector and the given Vector. + * @param v The Vector4 to dot product with this Vector4. + */ + dot(v: Phaser.Math.Vector4): number; + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * @param v The Vector4 to interpolate towards. + * @param t The interpolation percentage, between 0 and 1. Default 0. + */ + lerp(v: Phaser.Math.Vector4, t?: number): Phaser.Math.Vector4; + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * @param v The Vector to multiply this Vector by. + */ + multiply(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Vector4; + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * @param v The Vector to divide this Vector by. + */ + divide(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Vector4; + + /** + * Calculate the distance between this Vector and the given Vector. + * @param v The Vector to calculate the distance to. + */ + distance(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): number; + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * @param v The Vector to calculate the distance to. + */ + distanceSq(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): number; + + /** + * Negate the `x`, `y`, `z` and `w` components of this Vector. + */ + negate(): Phaser.Math.Vector4; + + /** + * Transform this Vector with the given Matrix. + * @param mat The Matrix4 to transform this Vector4 with. + */ + transformMat4(mat: Phaser.Math.Matrix4): Phaser.Math.Vector4; + + /** + * Transform this Vector with the given Quaternion. + * @param q The Quaternion to transform this Vector with. + */ + transformQuat(q: Phaser.Math.Quaternion): Phaser.Math.Vector4; + + /** + * Make this Vector the zero vector (0, 0, 0, 0). + */ + reset(): Phaser.Math.Vector4; + + } + + /** + * Checks if the two values are within the given `tolerance` of each other. + * @param a The first value to use in the calculation. + * @param b The second value to use in the calculation. + * @param tolerance The tolerance. Anything equal to or less than this value is considered as being within range. + */ + function Within(a: number, b: number, tolerance: number): boolean; + + /** + * Wrap the given `value` between `min` and `max. + * @param value The value to wrap. + * @param min The minimum value. + * @param max The maximum value. + */ + function Wrap(value: number, min: number, max: number): number; + + } + + /** + * The root types namespace. + */ + namespace Types { + namespace Actions { + type CallCallback = (item: Phaser.GameObjects.GameObject)=>void; + + type GridAlignConfig = { + /** + * The width of the grid in items (not pixels). -1 means lay all items out horizontally, regardless of quantity. + * If both this value and height are set to -1 then this value overrides it and the `height` value is ignored. + */ + width?: integer; + /** + * The height of the grid in items (not pixels). -1 means lay all items out vertically, regardless of quantity. + * If both this value and `width` are set to -1 then `width` overrides it and this value is ignored. + */ + height?: integer; + /** + * The width of the cell, in pixels, in which the item is positioned. + */ + cellWidth?: integer; + /** + * The height of the cell, in pixels, in which the item is positioned. + */ + cellHeight?: integer; + /** + * The alignment position. One of the Phaser.Display.Align consts such as `TOP_LEFT` or `RIGHT_CENTER`. + */ + position?: integer; + /** + * Optionally place the top-left of the final grid at this coordinate. + */ + x?: number; + /** + * Optionally place the top-left of the final grid at this coordinate. + */ + y?: number; + }; + + } + + namespace Animations { + type Animation = { + /** + * The key that the animation will be associated with. i.e. sprite.animations.play(key) + */ + key?: string; + /** + * An object containing data used to generate the frames for the animation + */ + frames?: Phaser.Types.Animations.AnimationFrame[]; + /** + * The key of the texture all frames of the animation will use. Can be overridden on a per frame basis. + */ + defaultTextureKey?: string; + /** + * The frame rate of playback in frames per second (default 24 if duration is null) + */ + frameRate?: integer; + /** + * How long the animation should play for in milliseconds. If not given its derived from frameRate. + */ + duration?: integer; + /** + * Skip frames if the time lags, or always advanced anyway? + */ + skipMissedFrames?: boolean; + /** + * Delay before starting playback. Value given in milliseconds. + */ + delay?: integer; + /** + * Number of times to repeat the animation (-1 for infinity) + */ + repeat?: integer; + /** + * Delay before the animation repeats. Value given in milliseconds. + */ + repeatDelay?: integer; + /** + * Should the animation yoyo? (reverse back down to the start) before repeating? + */ + yoyo?: boolean; + /** + * Should sprite.visible = true when the animation starts to play? + */ + showOnStart?: boolean; + /** + * Should sprite.visible = false when the animation finishes? + */ + hideOnComplete?: boolean; + }; + + type AnimationFrame = { + /** + * The key that the animation will be associated with. i.e. sprite.animations.play(key) + */ + key: string; + /** + * [description] + */ + frame: string | number; + /** + * [description] + */ + duration?: number; + /** + * [description] + */ + visible?: boolean; + }; + + type GenerateFrameNames = { + /** + * The string to append to every resulting frame name if using a range or an array of `frames`. + */ + prefix?: string; + /** + * If `frames` is not provided, the number of the first frame to return. + */ + start?: integer; + /** + * If `frames` is not provided, the number of the last frame to return. + */ + end?: integer; + /** + * The string to append to every resulting frame name if using a range or an array of `frames`. + */ + suffix?: string; + /** + * The minimum expected lengths of each resulting frame's number. Numbers will be left-padded with zeroes until they are this long, then prepended and appended to create the resulting frame name. + */ + zeroPad?: integer; + /** + * The array to append the created configuration objects to. + */ + outputArray?: Phaser.Types.Animations.AnimationFrame[]; + /** + * If provided as an array, the range defined by `start` and `end` will be ignored and these frame numbers will be used. + */ + frames?: boolean; + }; + + type GenerateFrameNumbers = { + /** + * The starting frame of the animation. + */ + start?: integer; + /** + * The ending frame of the animation. + */ + end?: integer; + /** + * A frame to put at the beginning of the animation, before `start` or `outputArray` or `frames`. + */ + first?: boolean | integer; + /** + * An array to concatenate the output onto. + */ + outputArray?: Phaser.Types.Animations.AnimationFrame[]; + /** + * A custom sequence of frames. + */ + frames?: boolean | integer[]; + }; + + type JSONAnimation = { + /** + * The key that the animation will be associated with. i.e. sprite.animations.play(key) + */ + key: string; + /** + * A frame based animation (as opposed to a bone based animation) + */ + type: string; + /** + * [description] + */ + frames: Phaser.Types.Animations.JSONAnimationFrame[]; + /** + * The frame rate of playback in frames per second (default 24 if duration is null) + */ + frameRate: integer; + /** + * How long the animation should play for in milliseconds. If not given its derived from frameRate. + */ + duration: integer; + /** + * Skip frames if the time lags, or always advanced anyway? + */ + skipMissedFrames: boolean; + /** + * Delay before starting playback. Value given in milliseconds. + */ + delay: integer; + /** + * Number of times to repeat the animation (-1 for infinity) + */ + repeat: integer; + /** + * Delay before the animation repeats. Value given in milliseconds. + */ + repeatDelay: integer; + /** + * Should the animation yoyo? (reverse back down to the start) before repeating? + */ + yoyo: boolean; + /** + * Should sprite.visible = true when the animation starts to play? + */ + showOnStart: boolean; + /** + * Should sprite.visible = false when the animation finishes? + */ + hideOnComplete: boolean; + }; + + type JSONAnimationFrame = { + /** + * The key of the Texture this AnimationFrame uses. + */ + key: string; + /** + * The key of the Frame within the Texture that this AnimationFrame uses. + */ + frame: string | integer; + /** + * Additional time (in ms) that this frame should appear for during playback. + */ + duration: number; + }; + + type JSONAnimations = { + /** + * An array of all Animations added to the Animation Manager. + */ + anims: Phaser.Types.Animations.JSONAnimation[]; + /** + * The global time scale of the Animation Manager. + */ + globalTimeScale: number; + }; + + } + + namespace Cameras { + namespace Scene2D { + type CameraConfig = { + /** + * The name of the Camera. + */ + name?: string; + /** + * The horizontal position of the Camera viewport. + */ + x?: integer; + /** + * The vertical position of the Camera viewport. + */ + y?: integer; + /** + * The width of the Camera viewport. + */ + width?: integer; + /** + * The height of the Camera viewport. + */ + height?: integer; + /** + * The default zoom level of the Camera. + */ + zoom?: number; + /** + * The rotation of the Camera, in radians. + */ + rotation?: number; + /** + * Should the Camera round pixels before rendering? + */ + roundPixels?: boolean; + /** + * The horizontal scroll position of the Camera. + */ + scrollX?: number; + /** + * The vertical scroll position of the Camera. + */ + scrollY?: number; + /** + * A CSS color string controlling the Camera background color. + */ + backgroundColor?: false | string; + /** + * Defines the Camera bounds. + */ + bounds?: object; + /** + * The top-left extent of the Camera bounds. + */ + "bounds.x"?: number; + /** + * The top-left extent of the Camera bounds. + */ + "bounds.y"?: number; + /** + * The width of the Camera bounds. + */ + "bounds.width"?: number; + /** + * The height of the Camera bounds. + */ + "bounds.height"?: number; + }; + + type CameraFadeCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number)=>void; + + type CameraFlashCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number)=>void; + + type CameraPanCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number, x: number, y: number)=>void; + + type CameraShakeCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number)=>void; + + type CameraZoomCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number, zoom: number)=>void; + + type JSONCamera = { + /** + * The name of the camera + */ + name: string; + /** + * The horizontal position of camera + */ + x: number; + /** + * The vertical position of camera + */ + y: number; + /** + * The width size of camera + */ + width: number; + /** + * The height size of camera + */ + height: number; + /** + * The zoom of camera + */ + zoom: number; + /** + * The rotation of camera + */ + rotation: number; + /** + * The round pixels st status of camera + */ + roundPixels: boolean; + /** + * The horizontal scroll of camera + */ + scrollX: number; + /** + * The vertical scroll of camera + */ + scrollY: number; + /** + * The background color of camera + */ + backgroundColor: string; + /** + * The bounds of camera + */ + bounds?: Phaser.Types.Cameras.Scene2D.JSONCameraBounds | undefined; + }; + + type JSONCameraBounds = { + /** + * The horizontal position of camera + */ + x: number; + /** + * The vertical position of camera + */ + y: number; + /** + * The width size of camera + */ + width: number; + /** + * The height size of camera + */ + height: number; + }; + + } + + namespace Controls { + type FixedKeyControlConfig = { + /** + * The Camera that this Control will update. + */ + camera?: Phaser.Cameras.Scene2D.Camera; + /** + * The Key to be pressed that will move the Camera left. + */ + left?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will move the Camera right. + */ + right?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will move the Camera up. + */ + up?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will move the Camera down. + */ + down?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will zoom the Camera in. + */ + zoomIn?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will zoom the Camera out. + */ + zoomOut?: Phaser.Input.Keyboard.Key; + /** + * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. + */ + zoomSpeed?: number; + /** + * The horizontal and vertical speed the camera will move. + */ + speed?: number | Object; + }; + + type SmoothedKeyControlConfig = { + /** + * The Camera that this Control will update. + */ + camera?: Phaser.Cameras.Scene2D.Camera; + /** + * The Key to be pressed that will move the Camera left. + */ + left?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will move the Camera right. + */ + right?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will move the Camera up. + */ + up?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will zoom the Camera in. + */ + zoomIn?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will zoom the Camera out. + */ + zoomOut?: Phaser.Input.Keyboard.Key; + /** + * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. + */ + zoomSpeed?: number; + /** + * The horizontal and vertical acceleration the camera will move. + */ + acceleration?: number | Object; + /** + * The horizontal and vertical drag applied to the camera when it is moving. + */ + drag?: number | Object; + /** + * The maximum horizontal and vertical speed the camera will move. + */ + maxSpeed?: number | Object; + }; + + } + + } + + namespace Core { + /** + * Config object containing various sound settings. + */ + type AudioConfig = { + /** + * Use HTML5 Audio instead of Web Audio. + */ + disableWebAudio?: boolean; + /** + * An existing Web Audio context. + */ + context?: AudioContext; + /** + * Disable all audio output. + */ + noAudio?: boolean; + }; + + type BannerConfig = { + /** + * Omit Phaser's name and version from the banner. + */ + hidePhaser?: boolean; + /** + * The color of the banner text. + */ + text?: string; + /** + * The background colors of the banner. + */ + background?: string[]; + }; + + type BootCallback = (game: Phaser.Game)=>void; + + type CallbacksConfig = { + /** + * A function to run at the start of the boot sequence. + */ + preBoot?: Phaser.Types.Core.BootCallback; + /** + * A function to run at the end of the boot sequence. At this point, all the game systems have started and plugins have been loaded. + */ + postBoot?: Phaser.Types.Core.BootCallback; + }; + + type DOMContainerConfig = { + /** + * Should the game create a div element to act as a DOM Container? Only enable if you're using DOM Element objects. You must provide a parent object if you use this feature. + */ + createContainer?: boolean; + /** + * Should the DOM Container that is created (if `dom.createContainer` is true) be positioned behind (true) or over the top (false, the default) of the game canvas? + */ + behindCanvas?: boolean; + }; + + type FPSConfig = { + /** + * The minimum acceptable rendering rate, in frames per second. + */ + min?: integer; + /** + * The optimum rendering rate, in frames per second. + */ + target?: integer; + /** + * Use setTimeout instead of requestAnimationFrame to run the game loop. + */ + forceSetTimeOut?: boolean; + /** + * Calculate the average frame delta from this many consecutive frame intervals. + */ + deltaHistory?: integer; + /** + * The amount of frames the time step counts before we trust the delta values again. + */ + panicMax?: integer; + }; + + type GameConfig = { + /** + * The width of the game, in game pixels. + */ + width?: integer | string; + /** + * The height of the game, in game pixels. + */ + height?: integer | string; + /** + * Simple scale applied to the game canvas. 2 is double size, 0.5 is half size, etc. + */ + zoom?: number; + /** + * The size of each game pixel, in canvas pixels. Values larger than 1 are "high" resolution. + */ + resolution?: number; + /** + * Which renderer to use. Phaser.AUTO, Phaser.CANVAS, Phaser.HEADLESS, or Phaser.WEBGL. AUTO picks WEBGL if available, otherwise CANVAS. + */ + type?: number; + /** + * The DOM element that will contain the game canvas, or its `id`. If undefined or if the named element doesn't exist, the game canvas is inserted directly into the document body. If `null` no parent will be used and you are responsible for adding the canvas to your environment. + */ + parent?: HTMLElement | string; + /** + * Provide your own Canvas element for Phaser to use instead of creating one. + */ + canvas?: HTMLCanvasElement; + /** + * CSS styles to apply to the game canvas instead of Phasers default styles. + */ + canvasStyle?: string; + /** + * Provide your own Canvas Context for Phaser to use, instead of creating one. + */ + context?: CanvasRenderingContext2D; + /** + * A scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have `{ active: true }`. See the `sceneConfig` argument in `Phaser.Scenes.SceneManager#add`. + */ + scene?: Phaser.Scene | Phaser.Scene[] | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.SettingsConfig[] | Phaser.Types.Scenes.CreateSceneFromObjectConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig[] | Function | Function[]; + /** + * Seed for the random number generator. + */ + seed?: string[]; + /** + * The title of the game. Shown in the browser console. + */ + title?: string; + /** + * The URL of the game. Shown in the browser console. + */ + url?: string; + /** + * The version of the game. Shown in the browser console. + */ + version?: string; + /** + * Automatically call window.focus() when the game boots. Usually necessary to capture input events if the game is in a separate frame. + */ + autoFocus?: boolean; + /** + * Input configuration, or `false` to disable all game input. + */ + input?: boolean | Phaser.Types.Core.InputConfig; + /** + * Disable the browser's default 'contextmenu' event (usually triggered by a right-button mouse click). + */ + disableContextMenu?: boolean; + /** + * Whether the game canvas will have a transparent background. + */ + transparent?: boolean; + /** + * Configuration for the banner printed in the browser console when the game starts. + */ + banner?: boolean | Phaser.Types.Core.BannerConfig; + /** + * The DOM Container configuration object. + */ + dom?: Phaser.Types.Core.DOMContainerConfig; + /** + * Game loop configuration. + */ + fps?: Phaser.Types.Core.FPSConfig; + /** + * Game renderer configuration. + */ + render?: Phaser.Types.Core.RenderConfig; + /** + * The background color of the game canvas. The default is black. + */ + backgroundColor?: string | number; + /** + * Optional callbacks to run before or after game boot. + */ + callbacks?: Phaser.Types.Core.CallbacksConfig; + /** + * Loader configuration. + */ + loader?: Phaser.Types.Core.LoaderConfig; + /** + * Images configuration. + */ + images?: Phaser.Types.Core.ImagesConfig; + /** + * Physics configuration. + */ + physics?: Phaser.Types.Core.PhysicsConfig; + /** + * Plugins to install. + */ + plugins?: Phaser.Types.Core.PluginObject | Phaser.Types.Core.PluginObjectItem[]; + /** + * The Scale Manager configuration. + */ + scale?: Phaser.Types.Core.ScaleConfig; + /** + * The Audio Configuration object. + */ + audio?: Phaser.Types.Core.AudioConfig; + }; + + type GamepadInputConfig = { + /** + * Where the Gamepad Manager listens for gamepad input events. + */ + target?: any; + }; + + type ImagesConfig = { + /** + * URL to use for the 'default' texture. + */ + default?: string; + /** + * URL to use for the 'missing' texture. + */ + missing?: string; + }; + + type InputConfig = { + /** + * Keyboard input configuration. `true` uses the default configuration and `false` disables keyboard input. + */ + keyboard?: boolean | Phaser.Types.Core.KeyboardInputConfig; + /** + * Mouse input configuration. `true` uses the default configuration and `false` disables mouse input. + */ + mouse?: boolean | Phaser.Types.Core.MouseInputConfig; + /** + * Touch input configuration. `true` uses the default configuration and `false` disables touch input. + */ + touch?: boolean | Phaser.Types.Core.TouchInputConfig; + /** + * Gamepad input configuration. `true` enables gamepad input. + */ + gamepad?: boolean | Phaser.Types.Core.GamepadInputConfig; + /** + * The maximum number of touch pointers. See {@link Phaser.Input.InputManager#pointers}. + */ + activePointers?: integer; + /** + * The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. + */ + smoothFactor?: number; + /** + * Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire. + */ + windowEvents?: boolean; + }; + + type KeyboardInputConfig = { + /** + * Where the Keyboard Manager listens for keyboard input events. + */ + target?: any; + /** + * `preventDefault` will be called on every non-modified key which has a key code in this array. By default it is empty. + */ + capture?: integer[]; + }; + + type LoaderConfig = { + /** + * A URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'. + */ + baseURL?: string; + /** + * A URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'. + */ + path?: string; + /** + * The maximum number of resources the loader will start loading at once. + */ + maxParallelDownloads?: integer; + /** + * 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. + */ + crossOrigin?: string | undefined; + /** + * The response type of the XHR request, e.g. `blob`, `text`, etc. + */ + responseType?: string; + /** + * Should the XHR request use async or not? + */ + async?: boolean; + /** + * Optional username for all XHR requests. + */ + user?: string; + /** + * Optional password for all XHR requests. + */ + password?: string; + /** + * Optional XHR timeout value, in ms. + */ + timeout?: integer; + }; + + type MouseInputConfig = { + /** + * Where the Mouse Manager listens for mouse input events. The default is the game canvas. + */ + target?: any; + /** + * Whether mouse input events have `preventDefault` called on them. + */ + capture?: boolean; + }; + + /** + * This callback type is completely empty, a no-operation. + */ + type NOOP = ()=>void; + + type PhysicsConfig = { + /** + * The default physics system. It will be started for each scene. Phaser provides 'arcade', 'impact', and 'matter'. + */ + default?: string; + /** + * Arcade Physics configuration. + */ + arcade?: Phaser.Types.Physics.Arcade.ArcadeWorldConfig; + /** + * Impact Physics configuration. + */ + impact?: Phaser.Types.Physics.Impact.WorldConfig; + /** + * Matter Physics configuration. + */ + matter?: Phaser.Types.Physics.Matter.MatterWorldConfig; + }; + + type PluginObject = { + /** + * Global plugins to install. + */ + global?: Phaser.Types.Core.PluginObjectItem[]; + /** + * Scene plugins to install. + */ + scene?: Phaser.Types.Core.PluginObjectItem[]; + /** + * The default set of scene plugins (names). + */ + default?: string[]; + /** + * Plugins to *add* to the default set of scene plugins. + */ + defaultMerge?: string[]; + }; + + type PluginObjectItem = { + /** + * A key to identify the plugin in the Plugin Manager. + */ + key?: string; + /** + * The plugin itself. Usually a class/constructor. + */ + plugin?: any; + /** + * Whether the plugin should be started automatically. + */ + start?: boolean; + /** + * For a scene plugin, add the plugin to the scene's systems object under this key (`this.sys.KEY`, from the scene). + */ + systemKey?: string; + /** + * For a scene plugin, add the plugin to the scene object under this key (`this.KEY`, from the scene). + */ + sceneKey?: string; + /** + * If this plugin is to be injected into the Scene Systems, this is the property key map used. + */ + mapping?: string; + /** + * Arbitrary data passed to the plugin's init() method. + */ + data?: any; + }; + + type RenderConfig = { + /** + * When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. + */ + antialias?: boolean; + /** + * When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details. + */ + desynchronized?: boolean; + /** + * Sets `antialias` and `roundPixels` to true. This is the best setting for pixel-art games. + */ + pixelArt?: boolean; + /** + * Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. + */ + roundPixels?: boolean; + /** + * Whether the game canvas will be transparent. Boolean that indicates if the canvas contains an alpha channel. If set to false, the browser now knows that the backdrop is always opaque, which can speed up drawing of transparent content and images. + */ + transparent?: boolean; + /** + * Whether the game canvas will be cleared between each rendering frame. + */ + clearBeforeRender?: boolean; + /** + * In WebGL mode, the drawing buffer contains colors with pre-multiplied alpha. + */ + premultipliedAlpha?: boolean; + /** + * Let the browser abort creating a WebGL context if it judges performance would be unacceptable. + */ + failIfMajorPerformanceCaveat?: boolean; + /** + * "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. + */ + powerPreference?: string; + /** + * The default WebGL batch size. + */ + batchSize?: integer; + /** + * The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. + */ + maxLights?: integer; + }; + + type ScaleConfig = { + /** + * The base width of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size. + */ + width?: integer | string; + /** + * The base height of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size. + */ + height?: integer | string; + /** + * The zoom value of the game canvas. + */ + zoom?: Phaser.Scale.ZoomType | integer; + /** + * The rendering resolution of the canvas. This is reserved for future use and is currently ignored. + */ + resolution?: number; + /** + * The DOM element that will contain the game canvas, or its `id`. If undefined, or if the named element doesn't exist, the game canvas is inserted directly into the document body. If `null` no parent will be used and you are responsible for adding the canvas to your environment. + */ + parent?: HTMLElement | string; + /** + * Is the Scale Manager allowed to adjust the CSS height property of the parent and/or document body to be 100%? + */ + expandParent?: boolean; + /** + * The scale mode. + */ + mode?: Phaser.Scale.ScaleModeType; + /** + * The minimum width and height the canvas can be scaled down to. + */ + min?: WidthHeight; + /** + * The maximum width the canvas can be scaled up to. + */ + max?: WidthHeight; + /** + * Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. + */ + autoRound?: boolean; + /** + * Automatically center the canvas within the parent? + */ + autoCenter?: Phaser.Scale.CenterType; + /** + * How many ms should elapse before checking if the browser size has changed? + */ + resizeInterval?: integer; + /** + * The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. + */ + fullscreenTarget?: HTMLElement | string; + }; + + type TimeStepCallback = (time: number, average: number, interpolation: number)=>void; + + type TouchInputConfig = { + /** + * Where the Touch Manager listens for touch input events. The default is the game canvas. + */ + target?: any; + /** + * Whether touch input events have preventDefault() called on them. + */ + capture?: boolean; + }; + + type WidthHeight = { + /** + * The width. + */ + width?: integer; + /** + * The height. + */ + height?: integer; + }; + + } + + namespace Create { + type GenerateTextureCallback = (canvas: HTMLCanvasElement, context: CanvasRenderingContext2D)=>void; + + type GenerateTextureConfig = { + /** + * [description] + */ + data?: any[]; + /** + * [description] + */ + canvas?: HTMLCanvasElement; + /** + * [description] + */ + palette?: Phaser.Types.Create.Palette; + /** + * The width of each 'pixel' in the generated texture. + */ + pixelWidth?: number; + /** + * The height of each 'pixel' in the generated texture. + */ + pixelHeight?: number; + /** + * [description] + */ + resizeCanvas?: boolean; + /** + * [description] + */ + clearCanvas?: boolean; + /** + * [description] + */ + preRender?: Phaser.Types.Create.GenerateTextureCallback; + /** + * [description] + */ + postRender?: Phaser.Types.Create.GenerateTextureCallback; + }; + + type Palette = { + /** + * Color value 1. + */ + "0": string; + /** + * Color value 2. + */ + "1": string; + /** + * Color value 3. + */ + "2": string; + /** + * Color value 4. + */ + "3": string; + /** + * Color value 5. + */ + "4": string; + /** + * Color value 6. + */ + "5": string; + /** + * Color value 7. + */ + "6": string; + /** + * Color value 8. + */ + "7": string; + /** + * Color value 9. + */ + "8": string; + /** + * Color value 10. + */ + "9": string; + /** + * Color value 11. + */ + A: string; + /** + * Color value 12. + */ + B: string; + /** + * Color value 13. + */ + C: string; + /** + * Color value 14. + */ + D: string; + /** + * Color value 15. + */ + E: string; + /** + * Color value 16. + */ + F: string; + }; + + } + + namespace Curves { + type EllipseCurveConfig = { + /** + * The x coordinate of the ellipse. + */ + x?: number; + /** + * The y coordinate of the ellipse. + */ + y?: number; + /** + * The horizontal radius of the ellipse. + */ + xRadius?: number; + /** + * The vertical radius of the ellipse. + */ + yRadius?: number; + /** + * The start angle of the ellipse, in degrees. + */ + startAngle?: integer; + /** + * The end angle of the ellipse, in degrees. + */ + endAngle?: integer; + /** + * Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + */ + clockwise?: boolean; + /** + * The rotation of the ellipse, in degrees. + */ + rotation?: integer; + }; + + type JSONCurve = { + /** + * The of the curve + */ + type: string; + /** + * The arrays of points like `[x1, y1, x2, y2]` + */ + points: number[]; + }; + + type JSONEllipseCurve = { + /** + * The of the curve. + */ + type: string; + /** + * The x coordinate of the ellipse. + */ + x: number; + /** + * The y coordinate of the ellipse. + */ + y: number; + /** + * The horizontal radius of ellipse. + */ + xRadius: number; + /** + * The vertical radius of ellipse. + */ + yRadius: number; + /** + * The start angle of the ellipse, in degrees. + */ + startAngle: integer; + /** + * The end angle of the ellipse, in degrees. + */ + endAngle: integer; + /** + * Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + */ + clockwise: boolean; + /** + * The rotation of ellipse, in degrees. + */ + rotation: integer; + }; + + type JSONPath = { + /** + * The of the curve. + */ + type: string; + /** + * The X coordinate of the curve's starting point. + */ + x: number; + /** + * The Y coordinate of the path's starting point. + */ + y: number; + /** + * The path is auto closed. + */ + autoClose: boolean; + /** + * The list of the curves + */ + curves: Phaser.Types.Curves.JSONCurve[]; + }; + + } + + namespace Display { + type ColorObject = { + /** + * The red color value in the range 0 to 255. + */ + r: number; + /** + * The green color value in the range 0 to 255. + */ + g: number; + /** + * The blue color value in the range 0 to 255. + */ + b: number; + /** + * The alpha color value in the range 0 to 255. + */ + a: number; + }; + + type HSVColorObject = { + /** + * The hue color value. A number between 0 and 1 + */ + h: number; + /** + * The saturation color value. A number between 0 and 1 + */ + s: number; + /** + * The lightness color value. A number between 0 and 1 + */ + v: number; + }; + + type InputColorObject = { + /** + * The red color value in the range 0 to 255. + */ + r?: number; + /** + * The green color value in the range 0 to 255. + */ + g?: number; + /** + * The blue color value in the range 0 to 255. + */ + b?: number; + /** + * The alpha color value in the range 0 to 255. + */ + a?: number; + }; + + } + + namespace GameObjects { + namespace BitmapText { + /** + * The font data for an individual character of a Bitmap Font. + * + * Describes the character's position, size, offset and kerning. + */ + type BitmapFontCharacterData = { + /** + * The x position of the character. + */ + x: number; + /** + * The y position of the character. + */ + y: number; + /** + * The width of the character. + */ + width: number; + /** + * The height of the character. + */ + height: number; + /** + * The center x position of the character. + */ + centerX: number; + /** + * The center y position of the character. + */ + centerY: number; + /** + * The x offset of the character. + */ + xOffset: number; + /** + * The y offset of the character. + */ + yOffset: number; + /** + * Extra data for the character. + */ + data: object; + /** + * Kerning values, keyed by character code. + */ + kerning: {[key: string]: number}; + }; + + /** + * Bitmap Font data that can be used by a BitmapText Game Object. + */ + type BitmapFontData = { + /** + * The name of the font. + */ + font: string; + /** + * The size of the font. + */ + size: number; + /** + * The line height of the font. + */ + lineHeight: number; + /** + * Whether this font is a retro font (monospace). + */ + retroFont: boolean; + /** + * The character data of the font, keyed by character code. Each character datum includes a position, size, offset and more. + */ + chars: {[key: number]: Phaser.Types.GameObjects.BitmapText.BitmapFontCharacterData}; + }; + + type BitmapTextConfig = Phaser.Types.GameObjects.GameObjectConfig & { + /** + * The key of the font to use from the BitmapFont cache. + */ + font?: string; + /** + * The string, or array of strings, to be set as the content of this Bitmap Text. + */ + text?: string; + /** + * The font size to set. + */ + size?: number | false; + }; + + type BitmapTextSize = { + /** + * The position and size of the BitmapText, taking into account the position and scale of the Game Object. + */ + global: Phaser.Types.GameObjects.BitmapText.GlobalBitmapTextSize; + /** + * The position and size of the BitmapText, taking just the font size into account. + */ + local: Phaser.Types.GameObjects.BitmapText.LocalBitmapTextSize; + }; + + type DisplayCallbackConfig = { + /** + * The Dynamic Bitmap Text object that owns this character being rendered. + */ + parent: Phaser.GameObjects.DynamicBitmapText; + /** + * The tint of the character being rendered. Always zero in Canvas. + */ + tint: Phaser.Types.GameObjects.BitmapText.TintConfig; + /** + * The index of the character being rendered. + */ + index: number; + /** + * The character code of the character being rendered. + */ + charCode: number; + /** + * The x position of the character being rendered. + */ + x: number; + /** + * The y position of the character being rendered. + */ + y: number; + /** + * The scale of the character being rendered. + */ + scale: number; + /** + * The rotation of the character being rendered. + */ + rotation: number; + /** + * Custom data stored with the character being rendered. + */ + data: any; + }; + + type DisplayCallback = (display: Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig)=>void; + + /** + * The position and size of the Bitmap Text in global space, taking into account the Game Object's scale and world position. + */ + type GlobalBitmapTextSize = { + /** + * The x position of the BitmapText, taking into account the x position and scale of the Game Object. + */ + x: number; + /** + * The y position of the BitmapText, taking into account the y position and scale of the Game Object. + */ + y: number; + /** + * The width of the BitmapText, taking into account the x scale of the Game Object. + */ + width: number; + /** + * The height of the BitmapText, taking into account the y scale of the Game Object. + */ + height: number; + }; + + type JSONBitmapText = Phaser.Types.GameObjects.JSONGameObject & { + /** + * The name of the font. + */ + font: string; + /** + * The text that this Bitmap Text displays. + */ + text: string; + /** + * The size of the font. + */ + fontSize: number; + /** + * Adds / Removes spacing between characters. + */ + letterSpacing: number; + /** + * The alignment of the text in a multi-line BitmapText object. + */ + align: integer; + }; + + /** + * The position and size of the Bitmap Text in local space, taking just the font size into account. + */ + type LocalBitmapTextSize = { + /** + * The x position of the BitmapText. + */ + x: number; + /** + * The y position of the BitmapText. + */ + y: number; + /** + * The width of the BitmapText. + */ + width: number; + /** + * The height of the BitmapText. + */ + height: number; + }; + + type RetroFontConfig = { + /** + * The key of the image containing the font. + */ + image: string; + /** + * If the font set doesn't start at the top left of the given image, specify the X coordinate offset here. + */ + "offset.x": number; + /** + * If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here. + */ + "offset.y": number; + /** + * The width of each character in the font set. + */ + width: number; + /** + * The height of each character in the font set. + */ + height: number; + /** + * The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements. + */ + chars: string; + /** + * The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth. + */ + charsPerRow: number; + /** + * If the characters in the font set have horizontal spacing between them set the required amount here. + */ + "spacing.x": number; + /** + * If the characters in the font set have vertical spacing between them set the required amount here. + */ + "spacing.y": number; + /** + * The amount of vertical space to add to the line height of the font. + */ + lineSpacing: number; + }; + + type TintConfig = { + /** + * The top left tint value. Always zero in canvas. + */ + topLeft: number; + /** + * The top right tint value. Always zero in canvas. + */ + topRight: number; + /** + * The bottom left tint value. Always zero in canvas. + */ + bottomLeft: number; + /** + * The bottom right tint value. Always zero in canvas. + */ + bottomRight: number; + }; + + } + + namespace Graphics { + /** + * Graphics fill style settings. + */ + type FillStyle = { + /** + * The fill color. + */ + color?: number; + /** + * The fill alpha. + */ + alpha?: number; + }; + + /** + * Graphics line style (or stroke style) settings. + */ + type LineStyle = { + /** + * The stroke width. + */ + width?: number; + /** + * The stroke color. + */ + color?: number; + /** + * The stroke alpha. + */ + alpha?: number; + }; + + /** + * Options for the Graphics game Object. + */ + type Options = Phaser.Types.GameObjects.Graphics.Styles & { + /** + * The x coordinate of the Graphics. + */ + x?: number; + /** + * The y coordinate of the Graphics. + */ + y?: number; + }; + + type RoundedRectRadius = { + /** + * Top left + */ + tl?: number; + /** + * Top right + */ + tr?: number; + /** + * Bottom right + */ + br?: number; + /** + * Bottom left + */ + bl?: number; + }; + + /** + * Graphics style settings. + */ + type Styles = { + /** + * The style applied to shape outlines. + */ + lineStyle?: Phaser.Types.GameObjects.Graphics.LineStyle; + /** + * The style applied to shape areas. + */ + fillStyle?: Phaser.Types.GameObjects.Graphics.FillStyle; + }; + + } + + namespace Group { + type GroupCallback = (item: Phaser.GameObjects.GameObject)=>void; + + type GroupConfig = { + /** + * Sets {@link Phaser.GameObjects.Group#classType}. + */ + classType?: Function; + /** + * Sets {@link Phaser.GameObjects.Group#name}. + */ + name?: string; + /** + * Sets {@link Phaser.GameObjects.Group#active}. + */ + active?: boolean; + /** + * Sets {@link Phaser.GameObjects.Group#maxSize}. + */ + maxSize?: number; + /** + * Sets {@link Phaser.GameObjects.Group#defaultKey}. + */ + defaultKey?: string; + /** + * Sets {@link Phaser.GameObjects.Group#defaultFrame}. + */ + defaultFrame?: string | integer; + /** + * Sets {@link Phaser.GameObjects.Group#runChildUpdate}. + */ + runChildUpdate?: boolean; + /** + * Sets {@link Phaser.GameObjects.Group#createCallback}. + */ + createCallback?: Phaser.Types.GameObjects.Group.GroupCallback; + /** + * Sets {@link Phaser.GameObjects.Group#removeCallback}. + */ + removeCallback?: Phaser.Types.GameObjects.Group.GroupCallback; + /** + * Sets {@link Phaser.GameObjects.Group#createMultipleCallback}. + */ + createMultipleCallback?: Phaser.Types.GameObjects.Group.GroupMultipleCreateCallback; + }; + + /** + * The total number of objects created will be + * + * key.length * frame.length * frameQuantity * (yoyo ? 2 : 1) * (1 + repeat) + * + * If `max` is nonzero, then the total created will not exceed `max`. + * + * `key` is required. {@link Phaser.GameObjects.Group#defaultKey} is not used. + */ + type GroupCreateConfig = { + /** + * The class of each new Game Object. + */ + classType?: Function; + /** + * The texture key of each new Game Object. + */ + key?: string | string[]; + /** + * The texture frame of each new Game Object. + */ + frame?: string | string[] | integer | integer[]; + /** + * The visible state of each new Game Object. + */ + visible?: boolean; + /** + * The active state of each new Game Object. + */ + active?: boolean; + /** + * The number of times each `key` × `frame` combination will be *repeated* (after the first combination). + */ + repeat?: number; + /** + * Select a `key` at random. + */ + randomKey?: boolean; + /** + * Select a `frame` at random. + */ + randomFrame?: boolean; + /** + * Select keys and frames by moving forward then backward through `key` and `frame`. + */ + yoyo?: boolean; + /** + * The number of times each `frame` should be combined with one `key`. + */ + frameQuantity?: number; + /** + * The maximum number of new Game Objects to create. 0 is no maximum. + */ + max?: number; + setXY?: object; + /** + * The horizontal position of each new Game Object. + */ + "setXY.x"?: number; + /** + * The vertical position of each new Game Object. + */ + "setXY.y"?: number; + /** + * Increment each Game Object's horizontal position from the previous by this amount, starting from `setXY.x`. + */ + "setXY.stepX"?: number; + /** + * Increment each Game Object's vertical position from the previous by this amount, starting from `setXY.y`. + */ + "setXY.stepY"?: number; + setRotation?: object; + /** + * Rotation of each new Game Object. + */ + "setRotation.value"?: number; + /** + * Increment each Game Object's rotation from the previous by this amount, starting at `setRotation.value`. + */ + "setRotation.step"?: number; + setScale?: object; + /** + * The horizontal scale of each new Game Object. + */ + "setScale.x"?: number; + /** + * The vertical scale of each new Game Object. + */ + "setScale.y"?: number; + /** + * Increment each Game Object's horizontal scale from the previous by this amount, starting from `setScale.x`. + */ + "setScale.stepX"?: number; + /** + * Increment each Game object's vertical scale from the previous by this amount, starting from `setScale.y`. + */ + "setScale.stepY"?: number; + setAlpha?: object; + /** + * The alpha value of each new Game Object. + */ + "setAlpha.value"?: number; + /** + * Increment each Game Object's alpha from the previous by this amount, starting from `setAlpha.value`. + */ + "setAlpha.step"?: number; + /** + * A geometric shape that defines the hit area for the Game Object. + */ + hitArea?: any; + /** + * A callback to be invoked when the Game Object is interacted with. + */ + hitAreaCallback?: Phaser.Types.Input.HitAreaCallback; + /** + * Align the new Game Objects in a grid using these settings. + */ + gridAlign?: false | Phaser.Types.Actions.GridAlignConfig; + }; + + type GroupMultipleCreateCallback = (items: Phaser.GameObjects.GameObject[])=>void; + + } + + namespace Particles { + type DeathZoneSource = { + contains: Phaser.Types.GameObjects.Particles.DeathZoneSourceCallback; + }; + + type DeathZoneSourceCallback = (x: number, y: number)=>void; + + type EdgeZoneSource = { + /** + * A function placing points on the sources edge or edges. + */ + getPoints: Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback; + }; + + type EdgeZoneSourceCallback = (quantity: integer, stepRate?: number)=>void; + + type EmitterOpCustomEmitConfig = { + /** + * A callback that is invoked each time the emitter emits a particle. + */ + onEmit: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback; + }; + + type EmitterOpCustomUpdateConfig = { + /** + * A callback that is invoked each time the emitter emits a particle. + */ + onEmit?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback; + /** + * A callback that is invoked each time the emitter updates. + */ + onUpdate: Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback; + }; + + /** + * Defines an operation yielding a value incremented continuously across a range. + */ + type EmitterOpEaseConfig = { + /** + * The starting value. + */ + start: number; + /** + * The ending value. + */ + end: number; + /** + * The name of the easing function. + */ + ease?: string; + }; + + /** + * The returned value sets what the property will be at the START of the particle's life, on emit. + */ + type EmitterOpOnEmitCallback = (particle: Phaser.GameObjects.Particles.Particle, key: string, value: number)=>void; + + type EmitterOpOnEmitType = number | number[] | Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback | Phaser.Types.GameObjects.Particles.EmitterOpRandomConfig | Phaser.Types.GameObjects.Particles.EmitterOpRandomMinMaxConfig | Phaser.Types.GameObjects.Particles.EmitterOpRandomStartEndConfig | Phaser.Types.GameObjects.Particles.EmitterOpSteppedConfig | Phaser.Types.GameObjects.Particles.EmitterOpCustomEmitConfig; + + /** + * The returned value updates the property for the duration of the particle's life. + */ + type EmitterOpOnUpdateCallback = (particle: Phaser.GameObjects.Particles.Particle, key: string, t: number, value: number)=>void; + + type EmitterOpOnUpdateType = Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback | Phaser.Types.GameObjects.Particles.EmitterOpEaseConfig | Phaser.Types.GameObjects.Particles.EmitterOpCustomUpdateConfig; + + /** + * Defines an operation yielding a random value within a range. + */ + type EmitterOpRandomConfig = { + /** + * The minimum and maximum values, as [min, max]. + */ + random: number[]; + }; + + /** + * Defines an operation yielding a random value within a range. + */ + type EmitterOpRandomMinMaxConfig = { + /** + * The minimum value. + */ + min: number; + /** + * The maximum value. + */ + max: number; + }; + + /** + * Defines an operation yielding a random value within a range. + */ + type EmitterOpRandomStartEndConfig = { + /** + * The starting value. + */ + start: number; + /** + * The ending value. + */ + end: number; + /** + * If false, this becomes {@link EmitterOpEaseConfig}. + */ + random: boolean; + }; + + /** + * Defines an operation yielding a value incremented by steps across a range. + */ + type EmitterOpSteppedConfig = { + /** + * The starting value. + */ + start: number; + /** + * The ending value. + */ + end: number; + /** + * The number of steps between start and end. + */ + steps: number; + }; + + type GravityWellConfig = { + /** + * The x coordinate of the Gravity Well, in world space. + */ + x?: number; + /** + * The y coordinate of the Gravity Well, in world space. + */ + y?: number; + /** + * The strength of the gravity force - larger numbers produce a stronger force. + */ + power?: number; + /** + * The minimum distance for which the gravity force is calculated. + */ + epsilon?: number; + /** + * The gravitational force of this Gravity Well. + */ + gravity?: number; + }; + + type ParticleDeathCallback = (particle: Phaser.GameObjects.Particles.Particle)=>void; + + type ParticleEmitterBounds = { + /** + * The left edge of the rectangle. + */ + x: number; + /** + * The top edge of the rectangle. + */ + y: number; + /** + * The width of the rectangle. + */ + width: number; + /** + * The height of the rectangle. + */ + height: number; + }; + + type ParticleEmitterBoundsAlt = { + /** + * The left edge of the rectangle. + */ + x: number; + /** + * The top edge of the rectangle. + */ + y: number; + /** + * The width of the rectangle. + */ + w: number; + /** + * The height of the rectangle. + */ + h: number; + }; + + type ParticleEmitterCallback = (particle: Phaser.GameObjects.Particles.Particle, emitter: Phaser.GameObjects.Particles.ParticleEmitter)=>void; + + type ParticleEmitterConfig = { + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#active}. + */ + active?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#blendMode}. + */ + blendMode?: Phaser.BlendModes | string; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallbackScope} and {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallbackScope}. + */ + callbackScope?: any; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideBottom}. + */ + collideBottom?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideLeft}. + */ + collideLeft?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideRight}. + */ + collideRight?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideTop}. + */ + collideTop?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallback}. + */ + deathCallback?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallbackScope}. + */ + deathCallbackScope?: any; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallback}. + */ + emitCallback?: Function; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallbackScope}. + */ + emitCallbackScope?: any; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#follow}. + */ + follow?: Phaser.GameObjects.GameObject; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#frequency}. + */ + frequency?: number; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#gravityX}. + */ + gravityX?: number; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#gravityY}. + */ + gravityY?: number; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxParticles}. + */ + maxParticles?: integer; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#name}. + */ + name?: string; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#on}. + */ + on?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#particleBringToTop}. + */ + particleBringToTop?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#particleClass}. + */ + particleClass?: Phaser.GameObjects.Particles.Particle; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#radial}. + */ + radial?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#timeScale}. + */ + timeScale?: number; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#trackVisible}. + */ + trackVisible?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#visible}. + */ + visible?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#accelerationX} (emit only). + */ + accelerationX?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#accelerationY} (emit only). + */ + accelerationY?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#alpha}. + */ + alpha?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#angle} (emit only). + */ + angle?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#bounce} (emit only). + */ + bounce?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#delay} (emit only). + */ + delay?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#lifespan} (emit only). + */ + lifespan?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityX} (emit only). + */ + maxVelocityX?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityY} (emit only). + */ + maxVelocityY?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#moveToX} (emit only). + */ + moveToX?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#moveToY} (emit only). + */ + moveToY?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity} (emit only). + */ + quantity?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#rotate}. + */ + rotate?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setScale}. + */ + scale?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#scaleX}. + */ + scaleX?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#scaleY}. + */ + scaleY?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setSpeed} (emit only). + */ + speed?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#speedX} (emit only). + */ + speedX?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#speedY} (emit only). + */ + speedY?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#tint}. + */ + tint?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#x} (emit only). + */ + x?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#y} (emit only). + */ + y?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone}. + */ + emitZone?: object; + /** + * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setBounds}. + */ + bounds?: Phaser.Types.GameObjects.Particles.ParticleEmitterBounds | Phaser.Types.GameObjects.Particles.ParticleEmitterBoundsAlt; + /** + * Assigns to {@link Phaser.GameObjects.Particles.ParticleEmitter#followOffset}. + */ + followOffset?: object; + /** + * x-coordinate of the offset. + */ + "followOffset.x"?: number; + /** + * y-coordinate of the offset. + */ + "followOffset.y"?: number; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. + */ + frame?: number | number[] | string | string[] | Phaser.Textures.Frame | Phaser.Textures.Frame[] | Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig; + }; + + type ParticleEmitterDeathZoneConfig = { + /** + * A shape representing the zone. See {@link Phaser.GameObjects.Particles.Zones.DeathZone#source}. + */ + source: Phaser.Types.GameObjects.Particles.DeathZoneSource; + /** + * 'onEnter' or 'onLeave'. + */ + type?: string; + }; + + type ParticleEmitterEdgeZoneConfig = { + /** + * A shape representing the zone. See {@link Phaser.GameObjects.Particles.Zones.EdgeZone#source}. + */ + source: Phaser.Types.GameObjects.Particles.EdgeZoneSource; + /** + * 'edge'. + */ + type: string; + /** + * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + */ + quantity: integer; + /** + * The distance between each particle. When set, `quantity` is implied and should be set to 0. + */ + stepRate?: number; + /** + * Whether particles are placed from start to end and then end to start. + */ + yoyo?: boolean; + /** + * Whether one endpoint will be removed if it's identical to the other. + */ + seamless?: boolean; + }; + + type ParticleEmitterFrameConfig = { + /** + * One or more texture frames. + */ + frames?: number | number[] | string | string[] | Phaser.Textures.Frame | Phaser.Textures.Frame[]; + /** + * Whether texture frames will be assigned consecutively (true) or at random (false). + */ + cycle?: boolean; + /** + * The number of consecutive particles receiving each texture frame, when `cycle` is true. + */ + quantity?: integer; + }; + + type ParticleEmitterRandomZoneConfig = { + /** + * A shape representing the zone. See {@link Phaser.GameObjects.Particles.Zones.RandomZone#source}. + */ + source: Phaser.Types.GameObjects.Particles.RandomZoneSource; + /** + * 'random'. + */ + type?: string; + }; + + type RandomZoneSource = { + /** + * A function modifying its point argument. + */ + getRandomPoint: Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback; + }; + + type RandomZoneSourceCallback = (point: Phaser.Math.Vector2)=>void; + + } + + namespace PathFollower { + /** + * Settings for a PathFollower. + */ + type PathConfig = { + /** + * The duration of the path follow in ms. Must be `> 0`. + */ + duration?: number; + /** + * The start position of the path follow, between 0 and 1. Must be less than `to`. + */ + from?: number; + /** + * The end position of the path follow, between 0 and 1. Must be more than `from`. + */ + to?: number; + /** + * Whether to position the PathFollower on the Path using its path offset. + */ + positionOnPath?: boolean; + /** + * Should the PathFollower automatically rotate to point in the direction of the Path? + */ + rotateToPath?: boolean; + /** + * If the PathFollower is rotating to match the Path, this value is added to the rotation value. This allows you to rotate objects to a path but control the angle of the rotation as well. + */ + rotationOffset?: number; + /** + * Current start position of the path follow, must be between `from` and `to`. + */ + startAt?: number; + }; + + } + + namespace RenderTexture { + type RenderTextureConfig = { + /** + * The x coordinate of the RenderTextures position. + */ + x?: number; + /** + * The y coordinate of the RenderTextures position. + */ + y?: number; + /** + * The width of the RenderTexture. + */ + width?: number; + /** + * The height of the RenderTexture. + */ + height?: number; + /** + * The texture key to make the RenderTexture from. + */ + key?: string; + /** + * the frame to make the RenderTexture from. + */ + frame?: string; + }; + + } + + namespace Sprite { + type SpriteConfig = Phaser.Types.GameObjects.GameObjectConfig & { + /** + * The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + */ + key?: string; + /** + * An optional frame from the Texture this Game Object is rendering with. + */ + frame?: number | string; + }; + + } + + namespace Text { + /** + * Font metrics for a Text Style object. + */ + type TextMetrics = { + /** + * The ascent of the font. + */ + ascent: number; + /** + * The descent of the font. + */ + descent: number; + /** + * The size of the font. + */ + fontSize: number; + }; + + /** + * A Text Padding configuration object as used by the Text Style. + */ + type TextPadding = { + /** + * If set this value is used for both the left and right padding. + */ + x?: number; + /** + * If set this value is used for both the top and bottom padding. + */ + y?: number; + /** + * The amount of padding added to the left of the Text object. + */ + left?: number; + /** + * The amount of padding added to the right of the Text object. + */ + right?: number; + /** + * The amount of padding added to the top of the Text object. + */ + top?: number; + /** + * The amount of padding added to the bottom of the Text object. + */ + bottom?: number; + }; + + /** + * A Text Shadow configuration object as used by the Text Style. + */ + type TextShadow = { + /** + * The horizontal offset of the shadow. + */ + offsetX?: number; + /** + * The vertical offset of the shadow. + */ + offsetY?: number; + /** + * The color of the shadow, given as a CSS string value. + */ + color?: string; + /** + * The amount of blur applied to the shadow. Leave as zero for a hard shadow. + */ + blur?: number; + /** + * Apply the shadow to the stroke effect on the Text object? + */ + stroke?: boolean; + /** + * Apply the shadow to the fill effect on the Text object? + */ + fill?: boolean; + }; + + /** + * A Text Style configuration object as used by the Text Game Object. + */ + type TextSyle = { + /** + * The font the Text object will render with. This is a Canvas style font string. + */ + fontFamily?: string; + /** + * The font size, as a CSS size string. + */ + fontSize?: string; + /** + * Any addition font styles, such as 'strong'. + */ + fontStyle?: string; + /** + * A solid fill color that is rendered behind the Text object. Given as a CSS string color such as `#ff0`. + */ + backgroundColor?: string; + /** + * The color the Text is drawn in. Given as a CSS string color such as `#fff` or `rgb()`. + */ + color?: string; + /** + * The color used to stroke the Text if the `strokeThickness` property is greater than zero. + */ + stroke?: string; + /** + * The thickness of the stroke around the Text. Set to zero for no stroke. + */ + strokeThickness?: number; + /** + * The Text shadow configuration object. + */ + shadow?: Phaser.Types.GameObjects.Text.TextShadow; + /** + * A Text Padding object. + */ + padding?: Phaser.Types.GameObjects.Text.TextPadding; + /** + * The alignment of the Text. This only impacts multi-line text. Either `left`, `right`, `center` or `justify`. + */ + align?: string; + /** + * The maximum number of lines to display within the Text object. + */ + maxLines?: integer; + /** + * Force the Text object to have the exact width specified in this property. Leave as zero for it to change accordingly to content. + */ + fixedWidth?: number; + /** + * Force the Text object to have the exact height specified in this property. Leave as zero for it to change accordingly to content. + */ + fixedHeight?: number; + /** + * Sets the resolution (DPI setting) of the Text object. Leave at zero for it to use the game resolution. + */ + resolution?: number; + /** + * Set to `true` if this Text object should render from right-to-left. + */ + rtl?: boolean; + /** + * This is the string used to aid Canvas in calculating the height of the font. + */ + testString?: string; + /** + * The amount of horizontal padding added to the width of the text when calculating the font metrics. + */ + baselineX?: number; + /** + * The amount of vertical padding added to the height of the text when calculating the font metrics. + */ + baselineY?: number; + /** + * The Text Word wrap configuration object. + */ + wordWrap?: Phaser.Types.GameObjects.Text.TextWordWrap; + /** + * A Text Metrics object. Use this to avoid expensive font size calculations in text heavy games. + */ + metrics?: Phaser.Types.GameObjects.Text.TextMetrics; + }; + + /** + * A Text Word Wrap configuration object as used by the Text Style configuration. + */ + type TextWordWrap = { + /** + * The width at which text should be considered for word-wrapping. + */ + width?: number; + /** + * Provide a custom callback when word wrapping is enabled. + */ + callback?: TextStyleWordWrapCallback; + /** + * The context in which the word wrap callback is invoked. + */ + callbackScope?: any; + /** + * Use basic or advanced word wrapping? + */ + useAdvancedWrap?: boolean; + }; + + } + + namespace TileSprite { + type TileSpriteConfig = Phaser.Types.GameObjects.GameObjectConfig & { + /** + * The x coordinate of the Tile Sprite. + */ + x?: number; + /** + * The y coordinate of the Tile Sprite. + */ + y?: number; + /** + * The width of the Tile Sprite. If zero it will use the size of the texture frame. + */ + width?: integer; + /** + * The height of the Tile Sprite. If zero it will use the size of the texture frame. + */ + height?: integer; + /** + * The key of the Texture this Tile Sprite will use to render with, as stored in the Texture Manager. + */ + key?: string; + /** + * An optional frame from the Texture this Tile Sprite is rendering with. + */ + frame?: string; + }; + + } + + type GameObjectConfig = { + /** + * The x position of the Game Object. + */ + x?: number; + /** + * The y position of the Game Object. + */ + y?: number; + /** + * The depth of the GameObject. + */ + depth?: number; + /** + * The horizontally flipped state of the Game Object. + */ + flipX?: boolean; + /** + * The vertically flipped state of the Game Object. + */ + flipY?: boolean; + /** + * The scale of the GameObject. + */ + scale?: number | object; + /** + * The scroll factor of the GameObject. + */ + scrollFactor?: number | object; + /** + * The rotation angle of the Game Object, in radians. + */ + rotation?: number; + /** + * The rotation angle of the Game Object, in degrees. + */ + angle?: number; + /** + * The alpha (opacity) of the Game Object. + */ + alpha?: number; + /** + * The origin of the Game Object. + */ + origin?: number | object; + /** + * The scale mode of the GameObject. + */ + scaleMode?: number; + /** + * The blend mode of the GameObject. + */ + blendMode?: number; + /** + * The visible state of the Game Object. + */ + visible?: boolean; + /** + * Add the GameObject to the scene. + */ + add?: boolean; + }; + + type JSONGameObject = { + /** + * The name of this Game Object. + */ + name: string; + /** + * A textual representation of this Game Object, i.e. `sprite`. + */ + type: string; + /** + * The x position of this Game Object. + */ + x: number; + /** + * The y position of this Game Object. + */ + y: number; + /** + * The scale of this Game Object + */ + scale: object; + /** + * The horizontal scale of this Game Object. + */ + "scale.x": number; + /** + * The vertical scale of this Game Object. + */ + "scale.y": number; + /** + * The origin of this Game Object. + */ + origin: object; + /** + * The horizontal origin of this Game Object. + */ + "origin.x": number; + /** + * The vertical origin of this Game Object. + */ + "origin.y": number; + /** + * The horizontally flipped state of the Game Object. + */ + flipX: boolean; + /** + * The vertically flipped state of the Game Object. + */ + flipY: boolean; + /** + * The angle of this Game Object in radians. + */ + rotation: number; + /** + * The alpha value of the Game Object. + */ + alpha: number; + /** + * The visible state of the Game Object. + */ + visible: boolean; + /** + * The Scale Mode being used by this Game Object. + */ + scaleMode: integer; + /** + * Sets the Blend Mode being used by this Game Object. + */ + blendMode: integer | string; + /** + * The texture key of this Game Object. + */ + textureKey: string; + /** + * The frame key of this Game Object. + */ + frameKey: string; + /** + * The data of this Game Object. + */ + data: object; + }; + + } + + namespace Input { + namespace Gamepad { + /** + * The Gamepad object, as extracted from GamepadEvent. + */ + type Pad = { + /** + * The ID of the Gamepad. + */ + id: string; + /** + * The index of the Gamepad. + */ + index: integer; + }; + + } + + namespace Keyboard { + type CursorKeys = { + /** + * A Key object mapping to the UP arrow key. + */ + up?: Phaser.Input.Keyboard.Key; + /** + * A Key object mapping to the DOWN arrow key. + */ + down?: Phaser.Input.Keyboard.Key; + /** + * A Key object mapping to the LEFT arrow key. + */ + left?: Phaser.Input.Keyboard.Key; + /** + * A Key object mapping to the RIGHT arrow key. + */ + right?: Phaser.Input.Keyboard.Key; + /** + * A Key object mapping to the SPACE BAR key. + */ + space?: Phaser.Input.Keyboard.Key; + /** + * A Key object mapping to the SHIFT key. + */ + shift?: Phaser.Input.Keyboard.Key; + }; + + type KeyboardKeydownCallback = (event: KeyboardEvent)=>void; + + type KeyComboConfig = { + /** + * If they press the wrong key do we reset the combo? + */ + resetOnWrongKey?: boolean; + /** + * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. + */ + maxKeyDelay?: number; + /** + * If previously matched and they press the first key of the combo again, will it reset? + */ + resetOnMatch?: boolean; + /** + * If the combo matches, will it delete itself? + */ + deleteOnMatch?: boolean; + }; + + } + + /** + * A Phaser Input Event Data object. + * + * This object is passed to the registered event listeners and allows you to stop any further propagation. + */ + type EventData = { + /** + * The cancelled state of this Event. + */ + cancelled?: boolean; + /** + * Call this method to stop this event from passing any further down the event chain. + */ + stopPropagation: Function; + }; + + type HitAreaCallback = (hitArea: any, x: number, y: number, gameObject: Phaser.GameObjects.GameObject)=>void; + + type InputConfiguration = { + /** + * The object / shape to use as the Hit Area. If not given it will try to create a Rectangle based on the texture frame. + */ + hitArea?: any; + /** + * The callback that determines if the pointer is within the Hit Area shape or not. + */ + hitAreaCallback?: Function; + /** + * If `true` the Interactive Object will be set to be draggable and emit drag events. + */ + draggable?: boolean; + /** + * If `true` the Interactive Object will be set to be a drop zone for draggable objects. + */ + dropZone?: boolean; + /** + * If `true` the Interactive Object will set the `pointer` hand cursor when a pointer is over it. This is a short-cut for setting `cursor: 'pointer'`. + */ + useHandCursor?: boolean; + /** + * The CSS string to be used when the cursor is over this Interactive Object. + */ + cursor?: string; + /** + * If `true` the a pixel perfect function will be set for the hit area callback. Only works with texture based Game Objects. + */ + pixelPerfect?: boolean; + /** + * If `pixelPerfect` is set, this is the alpha tolerance threshold value used in the callback. + */ + alphaTolerance?: integer; + }; + + type InputPluginContainer = { + /** + * The unique name of this plugin in the input plugin cache. + */ + key: string; + /** + * The plugin to be stored. Should be the source object, not instantiated. + */ + plugin: Function; + /** + * If this plugin is to be injected into the Input Plugin, this is the property key map used. + */ + mapping?: string; + }; + + type InteractiveObject = { + /** + * The Game Object to which this Interactive Object is bound. + */ + gameObject: Phaser.GameObjects.GameObject; + /** + * Is this Interactive Object currently enabled for input events? + */ + enabled: boolean; + /** + * Is this Interactive Object draggable? Enable with `InputPlugin.setDraggable`. + */ + draggable: boolean; + /** + * Is this Interactive Object a drag-targets drop zone? Set when the object is created. + */ + dropZone: boolean; + /** + * Should this Interactive Object change the cursor (via css) when over? (desktop only) + */ + cursor: boolean | string; + /** + * An optional drop target for a draggable Interactive Object. + */ + target: Phaser.GameObjects.GameObject; + /** + * The most recent Camera to be tested against this Interactive Object. + */ + camera: Phaser.Cameras.Scene2D.Camera; + /** + * The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle. + */ + hitArea: any; + /** + * The 'contains' check callback that the hit area shape will use for all hit tests. + */ + hitAreaCallback: Phaser.Types.Input.HitAreaCallback; + /** + * Was the hitArea for this Interactive Object created based on texture size (false), or a custom shape? (true) + */ + customHitArea: boolean; + /** + * The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + */ + localX: number; + /** + * The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + */ + localY: number; + /** + * The current drag state of this Interactive Object. 0 = Not being dragged, 1 = being checked for drag, or 2 = being actively dragged. + */ + dragState: 0 | 1 | 2; + /** + * The x coordinate of the Game Object that owns this Interactive Object when the drag started. + */ + dragStartX: number; + /** + * The y coordinate of the Game Object that owns this Interactive Object when the drag started. + */ + dragStartY: number; + /** + * The x coordinate that the Pointer started dragging this Interactive Object from. + */ + dragStartXGlobal: number; + /** + * The y coordinate that the Pointer started dragging this Interactive Object from. + */ + dragStartYGlobal: number; + /** + * The x coordinate that this Interactive Object is currently being dragged to. + */ + dragX: number; + /** + * The y coordinate that this Interactive Object is currently being dragged to. + */ + dragY: number; + }; + + } + + namespace Loader { + namespace FileTypes { + type AtlasJSONFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the texture image file from. + */ + textureURL?: string; + /** + * The default file extension to use for the image texture if no url is provided. + */ + textureExtension?: string; + /** + * Extra XHR Settings specifically for the texture image file. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The filename of an associated normal map. It uses the same path and url to load as the texture image. + */ + normalMap?: string; + /** + * The absolute or relative URL to load the atlas json file from. Or a well formed JSON object to use instead. + */ + atlasURL?: string; + /** + * The default file extension to use for the atlas json if no url is provided. + */ + atlasExtension?: string; + /** + * Extra XHR Settings specifically for the atlas json file. + */ + atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type AtlasXMLFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the texture image file from. + */ + textureURL?: string; + /** + * The default file extension to use for the image texture if no url is provided. + */ + textureExtension?: string; + /** + * Extra XHR Settings specifically for the texture image file. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The filename of an associated normal map. It uses the same path and url to load as the texture image. + */ + normalMap?: string; + /** + * The absolute or relative URL to load the atlas xml file from. + */ + atlasURL?: string; + /** + * The default file extension to use for the atlas xml if no url is provided. + */ + atlasExtension?: string; + /** + * Extra XHR Settings specifically for the atlas xml file. + */ + atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type AudioFileConfig = { + /** + * The key of the file. Must be unique within the Loader and Audio Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + urlConfig?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The AudioContext this file will use to process itself. + */ + audioContext?: AudioContext; + }; + + type AudioSpriteFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Audio Cache. + */ + key: string; + /** + * The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead. + */ + jsonURL: string; + /** + * Extra XHR Settings specifically for the json file. + */ + jsonXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The absolute or relative URL to load the audio file from. + */ + audioURL?: Object; + /** + * The audio configuration options. + */ + audioConfig?: any; + /** + * Extra XHR Settings specifically for the audio file. + */ + audioXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type BinaryFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Binary Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * Optional type to cast the binary file to once loaded. For example, `Uint8Array`. + */ + dataType?: any; + }; + + type BitmapFontFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the texture image file from. + */ + textureURL?: string; + /** + * The default file extension to use for the image texture if no url is provided. + */ + textureExtension?: string; + /** + * Extra XHR Settings specifically for the texture image file. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The filename of an associated normal map. It uses the same path and url to load as the texture image. + */ + normalMap?: string; + /** + * The absolute or relative URL to load the font data xml file from. + */ + fontDataURL?: string; + /** + * The default file extension to use for the font data xml if no url is provided. + */ + fontDataExtension?: string; + /** + * Extra XHR Settings specifically for the font data xml file. + */ + fontDataXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type CSSFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type GLSLFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Text Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle. + */ + shaderType?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type HTMLFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Text Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type HTMLTextureFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The width of the texture the HTML will be rendered to. + */ + width?: integer; + /** + * The height of the texture the HTML will be rendered to. + */ + height?: integer; + }; + + type ImageFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * The filename of an associated normal map. It uses the same path and url to load as the image. + */ + normalMap?: string; + /** + * The frame configuration object. Only provided for, and used by, Sprite Sheets. + */ + frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type ImageFrameConfig = { + /** + * The width of the frame in pixels. + */ + frameWidth: integer; + /** + * The height of the frame in pixels. Uses the `frameWidth` value if not provided. + */ + frameHeight?: integer; + /** + * The first frame to start parsing from. + */ + startFrame?: integer; + /** + * The frame to stop parsing at. If not provided it will calculate the value based on the image and frame dimensions. + */ + endFrame?: integer; + /** + * The margin in the image. This is the space around the edge of the frames. + */ + margin?: integer; + /** + * The spacing between each frame in the image. + */ + spacing?: integer; + }; + + type JSONFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the JSON Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. Or can be a ready formed JSON object, in which case it will be directly added to the Cache. + */ + url?: string | any; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * If specified instead of the whole JSON file being parsed and added to the Cache, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it. + */ + dataKey?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type MultiAtlasFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the multi atlas json file from. Or, a well formed JSON object. + */ + atlasURL?: string; + /** + * The default file extension to use for the atlas json if no url is provided. + */ + atlasExtension?: string; + /** + * Extra XHR Settings specifically for the atlas json file. + */ + atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * Optional path to use when loading the textures defined in the atlas data. + */ + path?: string; + /** + * Optional Base URL to use when loading the textures defined in the atlas data. + */ + baseURL?: string; + /** + * Extra XHR Settings specifically for the texture files. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type MultiScriptFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array. + */ + url?: string[]; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for these files. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type PackFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the JSON Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. Or can be a ready formed JSON object, in which case it will be directly processed. + */ + url?: string | any; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * If specified instead of the whole JSON file being parsed, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it. + */ + dataKey?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type PluginFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Automatically start the plugin after loading? + */ + start?: boolean; + /** + * If this plugin is to be injected into the Scene, this is the property key used. + */ + mapping?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type SceneFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Text Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type ScenePluginFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * The absolute or relative URL to load the file from. Or, a Scene Plugin. + */ + url?: string | Function; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * If this plugin is to be added to Scene.Systems, this is the property key for it. + */ + systemKey?: string; + /** + * If this plugin is to be added to the Scene, this is the property key for it. + */ + sceneKey?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type ScriptFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type SpriteSheetFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * The filename of an associated normal map. It uses the same path and url to load as the image. + */ + normalMap?: string; + /** + * The frame configuration object. + */ + frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type SVGFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The svg size configuration object. + */ + svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig; + }; + + type SVGSizeConfig = { + /** + * An optional width. The SVG will be resized to this size before being rendered to a texture. + */ + width?: integer; + /** + * An optional height. The SVG will be resized to this size before being rendered to a texture. + */ + height?: integer; + /** + * An optional scale. If given it overrides the width / height properties. The SVG is scaled by the scale factor before being rendered to a texture. + */ + scale?: number; + }; + + type TextFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Text Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type TilemapCSVFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Tilemap Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type TilemapImpactFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Tilemap Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type TilemapJSONFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Tilemap Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type UnityAtlasFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the texture image file from. + */ + textureURL?: string; + /** + * The default file extension to use for the image texture if no url is provided. + */ + textureExtension?: string; + /** + * Extra XHR Settings specifically for the texture image file. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The filename of an associated normal map. It uses the same path and url to load as the texture image. + */ + normalMap?: string; + /** + * The absolute or relative URL to load the atlas data file from. + */ + atlasURL?: string; + /** + * The default file extension to use for the atlas data if no url is provided. + */ + atlasExtension?: string; + /** + * Extra XHR Settings specifically for the atlas data file. + */ + atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type XMLFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Text Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + } + + type FileConfig = { + /** + * The file type string (image, json, etc) for sorting within the Loader. + */ + type: string; + /** + * Unique cache key (unique within its file type) + */ + key: string; + /** + * The URL of the file, not including baseURL. + */ + url?: string; + /** + * The path of the file, not including the baseURL. + */ + path?: string; + /** + * The default extension this file uses. + */ + extension?: string; + /** + * The responseType to be used by the XHR request. + */ + responseType?: XMLHttpRequestResponseType; + /** + * Custom XHR Settings specific to this file and merged with the Loader defaults. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject | false; + /** + * A config object that can be used by file types to store transitional data. + */ + config?: any; + }; + + type XHRSettingsObject = { + /** + * The response type of the XHR request, i.e. `blob`, `text`, etc. + */ + responseType: XMLHttpRequestResponseType; + /** + * Should the XHR request use async or not? + */ + async?: boolean; + /** + * Optional username for the XHR request. + */ + user?: string; + /** + * Optional password for the XHR request. + */ + password?: string; + /** + * Optional XHR timeout value. + */ + timeout?: integer; + /** + * This value is used to populate the XHR `setRequestHeader` and is undefined by default. + */ + header?: string | undefined; + /** + * This value is used to populate the XHR `setRequestHeader` and is undefined by default. + */ + headerValue?: string | undefined; + /** + * This value is used to populate the XHR `setRequestHeader` and is undefined by default. + */ + requestedWith?: string | undefined; + /** + * Provide a custom mime-type to use instead of the default. + */ + overrideMimeType?: string | undefined; + }; + + } + + namespace Math { + type SinCosTable = { + /** + * The sine value. + */ + sin: number; + /** + * The cosine value. + */ + cos: number; + /** + * The length. + */ + length: number; + }; + + type Vector2Like = { + /** + * The x component. + */ + x?: number; + /** + * The y component. + */ + y?: number; + }; + + } + + namespace Physics { + namespace Arcade { + type ArcadeBodyBounds = { + /** + * The left edge. + */ + x: number; + /** + * The upper edge. + */ + y: number; + /** + * The right edge. + */ + right: number; + /** + * The lower edge. + */ + bottom: number; + }; + + type ArcadeBodyCollision = { + /** + * True if the Body is not colliding. + */ + none: boolean; + /** + * True if the Body is colliding on its upper edge. + */ + up: boolean; + /** + * True if the Body is colliding on its lower edge. + */ + down: boolean; + /** + * True if the Body is colliding on its left edge. + */ + left: boolean; + /** + * True if the Body is colliding on its right edge. + */ + right: boolean; + }; + + /** + * An Arcade Physics Collider Type. + */ + type ArcadeColliderType = Phaser.GameObjects.GameObject | Phaser.GameObjects.Group | Phaser.Physics.Arcade.Sprite | Phaser.Physics.Arcade.Image | Phaser.Physics.Arcade.StaticGroup | Phaser.Physics.Arcade.Group | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer | Phaser.GameObjects.GameObject[] | Phaser.Physics.Arcade.Sprite[] | Phaser.Physics.Arcade.Image[] | Phaser.Physics.Arcade.StaticGroup[] | Phaser.Physics.Arcade.Group[] | Phaser.Tilemaps.DynamicTilemapLayer[] | Phaser.Tilemaps.StaticTilemapLayer[]; + + type ArcadeWorldConfig = { + /** + * Sets {@link Phaser.Physics.Arcade.World#fps}. + */ + fps?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#timeScale}. + */ + timeScale?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#gravity}. + */ + gravity?: Phaser.Types.Math.Vector2Like; + /** + * Sets {@link Phaser.Physics.Arcade.World#bounds bounds.x}. + */ + x?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#bounds bounds.y}. + */ + y?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#bounds bounds.width}. + */ + width?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#bounds bounds.height}. + */ + height?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#checkCollision}. + */ + checkCollision?: Phaser.Types.Physics.Arcade.CheckCollisionObject; + /** + * Sets {@link Phaser.Physics.Arcade.World#OVERLAP_BIAS}. + */ + overlapBias?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#TILE_BIAS}. + */ + tileBias?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#forceX}. + */ + forceX?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#isPaused}. + */ + isPaused?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#debug}. + */ + debug?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugShowBody}. + */ + debugShowBody?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugShowStaticBody}. + */ + debugShowStaticBody?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugShowStaticBody}. + */ + debugShowVelocity?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugBodyColor}. + */ + debugBodyColor?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugStaticBodyColor}. + */ + debugStaticBodyColor?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugVelocityColor}. + */ + debugVelocityColor?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#maxEntries}. + */ + maxEntries?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#useTree}. + */ + useTree?: boolean; + }; + + type ArcadeWorldDefaults = { + /** + * Set to `true` to render dynamic body outlines to the debug display. + */ + debugShowBody: boolean; + /** + * Set to `true` to render static body outlines to the debug display. + */ + debugShowStaticBody: boolean; + /** + * Set to `true` to render body velocity markers to the debug display. + */ + debugShowVelocity: boolean; + /** + * The color of dynamic body outlines when rendered to the debug display. + */ + bodyDebugColor: number; + /** + * The color of static body outlines when rendered to the debug display. + */ + staticBodyDebugColor: number; + /** + * The color of the velocity markers when rendered to the debug display. + */ + velocityDebugColor: number; + }; + + type ArcadeWorldTreeMinMax = { + /** + * The minimum x value used in RTree searches. + */ + minX: number; + /** + * The minimum y value used in RTree searches. + */ + minY: number; + /** + * The maximum x value used in RTree searches. + */ + maxX: number; + /** + * The maximum y value used in RTree searches. + */ + maxY: number; + }; + + type CheckCollisionObject = { + /** + * Will bodies collide with the top side of the world bounds? + */ + up: boolean; + /** + * Will bodies collide with the bottom side of the world bounds? + */ + down: boolean; + /** + * Will bodies collide with the left side of the world bounds? + */ + left: boolean; + /** + * Will bodies collide with the right side of the world bounds? + */ + right: boolean; + }; + + type PhysicsGroupConfig = Phaser.Types.GameObjects.Group.GroupConfig & { + /** + * Sets {@link Phaser.Physics.Arcade.Body#collideWorldBounds}. + */ + collideWorldBounds?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.Body#acceleration acceleration.x}. + */ + accelerationX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#acceleration acceleration.y}. + */ + accelerationY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#allowDrag}. + */ + allowDrag?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.Body#allowGravity}. + */ + allowGravity?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.Body#allowRotation}. + */ + allowRotation?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.Body#bounce bounce.x}. + */ + bounceX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#bounce bounce.y}. + */ + bounceY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#drag drag.x}. + */ + dragX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#drag drag.y}. + */ + dragY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#enable enable}. + */ + enable?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.Body#gravity gravity.x}. + */ + gravityX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#gravity gravity.y}. + */ + gravityY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#friction friction.x}. + */ + frictionX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#friction friction.y}. + */ + frictionY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#velocity velocity.x}. + */ + velocityX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#velocity velocity.y}. + */ + velocityY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#angularVelocity}. + */ + angularVelocity?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#angularAcceleration}. + */ + angularAcceleration?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#angularDrag}. + */ + angularDrag?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#mass}. + */ + mass?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#immovable}. + */ + immovable?: boolean; + }; + + type PhysicsGroupDefaults = { + /** + * As {@link Phaser.Physics.Arcade.Body#setCollideWorldBounds}. + */ + setCollideWorldBounds: boolean; + /** + * As {@link Phaser.Physics.Arcade.Body#setAccelerationX}. + */ + setAccelerationX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setAccelerationY}. + */ + setAccelerationY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setAllowDrag}. + */ + setAllowDrag: boolean; + /** + * As {@link Phaser.Physics.Arcade.Body#setAllowGravity}. + */ + setAllowGravity: boolean; + /** + * As {@link Phaser.Physics.Arcade.Body#setAllowRotation}. + */ + setAllowRotation: boolean; + /** + * As {@link Phaser.Physics.Arcade.Body#setBounceX}. + */ + setBounceX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setBounceY}. + */ + setBounceY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setDragX}. + */ + setDragX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setDragY}. + */ + setDragY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setEnable}. + */ + setEnable: boolean; + /** + * As {@link Phaser.Physics.Arcade.Body#setGravityX}. + */ + setGravityX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setGravityY}. + */ + setGravityY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setFrictionX}. + */ + setFrictionX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setFrictionY}. + */ + setFrictionY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setVelocityX}. + */ + setVelocityX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setVelocityY}. + */ + setVelocityY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setAngularVelocity}. + */ + setAngularVelocity: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setAngularAcceleration}. + */ + setAngularAcceleration: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setAngularDrag}. + */ + setAngularDrag: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setMass}. + */ + setMass: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setImmovable}. + */ + setImmovable: boolean; + }; + + } + + namespace Impact { + type BodyUpdateCallback = (body: Phaser.Physics.Impact.Body)=>void; + + type CollisionOptions = { + /** + * Slope IDs can be stored on tiles directly + * using Impacts tileset editor. If a tile has a property with the given slopeTileProperty string + * name, the value of that property for the tile will be used for its slope mapping. E.g. a 45 + * degree slope upward could be given a "slope" property with a value of 2. + */ + slopeTileProperty?: string; + /** + * A tile index to slope definition map. + */ + slopeMap?: object; + /** + * If specified, the default slope ID to + * assign to a colliding tile. If not specified, the tile's index is used. + */ + defaultCollidingSlope?: integer; + /** + * The default slope ID to assign to a + * non-colliding tile. + */ + defaultNonCollidingSlope?: integer; + }; + + type JSONImpactBody = { + /** + * [description] + */ + name: string; + /** + * [description] + */ + size: Phaser.Types.Math.Vector2Like; + /** + * The entity's position in the game world. + */ + pos: Phaser.Types.Math.Vector2Like; + /** + * Current velocity in pixels per second. + */ + vel: Phaser.Types.Math.Vector2Like; + /** + * Current acceleration to be added to the entity's velocity per second. E.g. an entity with a `vel.x` of 0 and `accel.x` of 10 will have a `vel.x` of 100 ten seconds later. + */ + accel: Phaser.Types.Math.Vector2Like; + /** + * Deceleration to be subtracted from the entity's velocity per second. Only applies if `accel` is 0. + */ + friction: Phaser.Types.Math.Vector2Like; + /** + * The maximum velocity a body can move. + */ + maxVel: Phaser.Types.Math.Vector2Like; + /** + * [description] + */ + gravityFactor: number; + /** + * [description] + */ + bounciness: number; + /** + * [description] + */ + minBounceVelocity: number; + /** + * [description] + */ + type: Phaser.Physics.Impact.TYPE; + /** + * [description] + */ + checkAgainst: Phaser.Physics.Impact.TYPE; + /** + * [description] + */ + collides: Phaser.Physics.Impact.COLLIDES; + }; + + type WorldConfig = { + /** + * Sets {@link Phaser.Physics.Impact.World#gravity} + */ + gravity?: number; + /** + * The size of the cells used for the broadphase pass. Increase this value if you have lots of large objects in the world. + */ + cellSize?: number; + /** + * A number that allows per-body time scaling, e.g. a force-field where bodies inside are in slow-motion, while others are at full speed. + */ + timeScale?: number; + /** + * [description] + */ + maxStep?: number; + /** + * Sets {@link Phaser.Physics.Impact.World#debug}. + */ + debug?: boolean; + /** + * The maximum velocity a body can move. + */ + maxVelocity?: number; + /** + * Whether the Body's boundary is drawn to the debug display. + */ + debugShowBody?: boolean; + /** + * Whether the Body's velocity is drawn to the debug display. + */ + debugShowVelocity?: boolean; + /** + * The color of this Body on the debug display. + */ + debugBodyColor?: number; + /** + * The color of the Body's velocity on the debug display. + */ + debugVelocityColor?: number; + /** + * Maximum X velocity objects can move. + */ + maxVelocityX?: number; + /** + * Maximum Y velocity objects can move. + */ + maxVelocityY?: number; + /** + * The minimum velocity an object can be moving at to be considered for bounce. + */ + minBounceVelocity?: number; + /** + * Gravity multiplier. Set to 0 for no gravity. + */ + gravityFactor?: number; + /** + * The default bounce, or restitution, of bodies in the world. + */ + bounciness?: number; + /** + * Should the world have bounds enabled by default? + */ + setBounds?: object | boolean; + /** + * The x coordinate of the world bounds. + */ + "setBounds.x"?: number; + /** + * The y coordinate of the world bounds. + */ + "setBounds.y"?: number; + /** + * The width of the world bounds. + */ + "setBounds.width"?: number; + /** + * The height of the world bounds. + */ + "setBounds.height"?: number; + /** + * The thickness of the walls of the world bounds. + */ + "setBounds.thickness"?: number; + /** + * Should the left-side world bounds wall be created? + */ + "setBounds.left"?: boolean; + /** + * Should the right-side world bounds wall be created? + */ + "setBounds.right"?: boolean; + /** + * Should the top world bounds wall be created? + */ + "setBounds.top"?: boolean; + /** + * Should the bottom world bounds wall be created? + */ + "setBounds.bottom"?: boolean; + }; + + /** + * An object containing the 4 wall bodies that bound the physics world. + */ + type WorldDefaults = { + /** + * Whether the Body's boundary is drawn to the debug display. + */ + debugShowBody: boolean; + /** + * Whether the Body's velocity is drawn to the debug display. + */ + debugShowVelocity: boolean; + /** + * The color of this Body on the debug display. + */ + bodyDebugColor: number; + /** + * The color of the Body's velocity on the debug display. + */ + velocityDebugColor: number; + /** + * Maximum X velocity objects can move. + */ + maxVelocityX: number; + /** + * Maximum Y velocity objects can move. + */ + maxVelocityY: number; + /** + * The minimum velocity an object can be moving at to be considered for bounce. + */ + minBounceVelocity: number; + /** + * Gravity multiplier. Set to 0 for no gravity. + */ + gravityFactor: number; + /** + * The default bounce, or restitution, of bodies in the world. + */ + bounciness: number; + }; + + type WorldWalls = { + /** + * The left-side wall of the world bounds. + */ + left: Phaser.Physics.Impact.Body; + /** + * The right-side wall of the world bounds. + */ + right: Phaser.Physics.Impact.Body; + /** + * The top wall of the world bounds. + */ + top: Phaser.Physics.Impact.Body; + /** + * The bottom wall of the world bounds. + */ + bottom: Phaser.Physics.Impact.Body; + }; + + } + + namespace Matter { + type MatterBodyTileOptions = { + /** + * Whether or not the newly created body should be made static. This defaults to true since typically tiles should not be moved. + */ + isStatic?: boolean; + /** + * Whether or not to add the newly created body (or existing body if options.body is used) to the Matter world. + */ + addToWorld?: boolean; + }; + + type MatterTileOptions = { + /** + * An existing Matter body to be used instead of creating a new one. + */ + body?: MatterJS.Body; + /** + * Whether or not the newly created body should be made static. This defaults to true since typically tiles should not be moved. + */ + isStatic?: boolean; + /** + * Whether or not to add the newly created body (or existing body if options.body is used) to the Matter world. + */ + addToWorld?: boolean; + }; + + type MatterWorldConfig = { + /** + * Sets {@link Phaser.Physics.Matter.World#gravity}. + */ + gravity?: Phaser.Types.Math.Vector2Like; + /** + * Should the world have bounds enabled by default? + */ + setBounds?: object | boolean; + /** + * The x coordinate of the world bounds. + */ + "setBounds.x"?: number; + /** + * The y coordinate of the world bounds. + */ + "setBounds.y"?: number; + /** + * The width of the world bounds. + */ + "setBounds.width"?: number; + /** + * The height of the world bounds. + */ + "setBounds.height"?: number; + /** + * The thickness of the walls of the world bounds. + */ + "setBounds.thickness"?: number; + /** + * Should the left-side world bounds wall be created? + */ + "setBounds.left"?: boolean; + /** + * Should the right-side world bounds wall be created? + */ + "setBounds.right"?: boolean; + /** + * Should the top world bounds wall be created? + */ + "setBounds.top"?: boolean; + /** + * Should the bottom world bounds wall be created? + */ + "setBounds.bottom"?: boolean; + /** + * The number of position iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance. + */ + positionIterations?: number; + /** + * The number of velocity iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance. + */ + velocityIterations?: number; + /** + * The number of constraint iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance. + */ + constraintIterations?: number; + /** + * A flag that specifies whether the engine should allow sleeping via the `Matter.Sleeping` module. Sleeping can improve stability and performance, but often at the expense of accuracy. + */ + enableSleeping?: boolean; + /** + * A `Number` that specifies the current simulation-time in milliseconds starting from `0`. It is incremented on every `Engine.update` by the given `delta` argument. + */ + "timing.timestamp"?: number; + /** + * A `Number` that specifies the global scaling factor of time for all bodies. A value of `0` freezes the simulation. A value of `0.1` gives a slow-motion effect. A value of `1.2` gives a speed-up effect. + */ + "timing.timeScale"?: number; + /** + * Toggles if the world is enabled or not. + */ + enabled?: boolean; + /** + * An optional Number that specifies the time correction factor to apply to the update. + */ + correction?: number; + /** + * This function is called every time the core game loop steps, which is bound to the Request Animation Frame frequency unless otherwise modified. + */ + getDelta?: Function; + /** + * Automatically call Engine.update every time the game steps. + */ + autoUpdate?: boolean; + /** + * Sets if Matter will render to the debug Graphic overlay. Do not enable this in production. + */ + debug?: boolean; + /** + * Should dynamic bodies be drawn to the debug graphic? + */ + debugShowBody?: boolean; + /** + * Should static bodies be drawn to the debug graphic? + */ + debugShowStaticBody?: boolean; + /** + * Should the velocity vector be drawn to the debug graphic? + */ + debugShowVelocity?: boolean; + /** + * The color that dynamic body debug outlines are drawn in. + */ + debugBodyColor?: number; + /** + * The color that dynamic body debug fills are drawn in. + */ + debugBodyFillColor?: number; + /** + * The color that static body debug outlines are drawn in. + */ + debugStaticBodyColor?: number; + /** + * The color that the debug velocity vector lines are drawn in. + */ + debugVelocityColor?: number; + /** + * Render joints to the debug graphic. + */ + debugShowJoint?: boolean; + /** + * The color that the debug joints are drawn in. + */ + debugJointColor?: number; + /** + * Render the debug output as wireframes. + */ + debugWireframes?: boolean; + /** + * Render internal edges to the debug. + */ + debugShowInternalEdges?: boolean; + /** + * Render convex hulls to the debug. + */ + debugShowConvexHulls?: boolean; + /** + * The color that the debug convex hulls are drawn in, if enabled. + */ + debugConvexHullColor?: number; + /** + * Render sleeping bodies the debug. + */ + debugShowSleeping?: boolean; + }; + + } + + } + + namespace Plugins { + type CorePluginContainer = { + /** + * The unique name of this plugin in the core plugin cache. + */ + key: string; + /** + * The plugin to be stored. Should be the source object, not instantiated. + */ + plugin: Function; + /** + * If this plugin is to be injected into the Scene Systems, this is the property key map used. + */ + mapping?: string; + /** + * Core Scene plugin or a Custom Scene plugin? + */ + custom?: boolean; + }; + + type CustomPluginContainer = { + /** + * The unique name of this plugin in the custom plugin cache. + */ + key: string; + /** + * The plugin to be stored. Should be the source object, not instantiated. + */ + plugin: Function; + }; + + type GlobalPlugin = { + /** + * The unique name of this plugin within the plugin cache. + */ + key: string; + /** + * An instance of the plugin. + */ + plugin: Function; + /** + * Is the plugin active or not? + */ + active?: boolean; + /** + * If this plugin is to be injected into the Scene Systems, this is the property key map used. + */ + mapping?: string; + }; + + } + + namespace Renderer { + namespace Snapshot { + type SnapshotCallback = (snapshot: Phaser.Display.Color | HTMLImageElement)=>void; + + type SnapshotState = { + /** + * The function to call after the snapshot is taken. + */ + callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback; + /** + * The format of the image to create, usually `image/png` or `image/jpeg`. + */ + type?: string; + /** + * The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + */ + encoderOptions?: number; + /** + * The x coordinate to start the snapshot from. + */ + x?: integer; + /** + * The y coordinate to start the snapshot from. + */ + y?: integer; + /** + * The width of the snapshot. + */ + width?: integer; + /** + * The height of the snapshot. + */ + height?: integer; + /** + * Is this a snapshot to get a single pixel, or an area? + */ + getPixel?: boolean; + }; + + } + + } + + namespace Scenes { + type CreateSceneFromObjectConfig = { + /** + * See {@link Phaser.Scene#init}. + */ + init?: Function; + /** + * See See {@link Phaser.Scene#preload}. + */ + preload?: Function; + /** + * See {@link Phaser.Scene#create}. + */ + create?: Function; + /** + * See {@link Phaser.Scene#update}. + */ + update?: Function; + /** + * Any additional properties, which will be copied to the Scene after it's created (except `data` or `sys`). + */ + extend?: any; + /** + * Any values, which will be merged into the Scene's Data Manager store. + */ + "extend.data"?: any; + }; + + type SceneTransitionConfig = { + /** + * The Scene key to transition to. + */ + target: string; + /** + * The duration, in ms, for the transition to last. + */ + duration?: integer; + /** + * Will the Scene responsible for the transition be sent to sleep on completion (`true`), or stopped? (`false`) + */ + sleep?: boolean; + /** + * Will the Scenes Input system be able to process events while it is transitioning in or out? + */ + allowInput?: boolean; + /** + * Move the target Scene to be above this one before the transition starts. + */ + moveAbove?: boolean; + /** + * Move the target Scene to be below this one before the transition starts. + */ + moveBelow?: boolean; + /** + * This callback is invoked every frame for the duration of the transition. + */ + onUpdate?: Function; + /** + * The context in which the callback is invoked. + */ + onUpdateScope?: any; + /** + * An object containing any data you wish to be passed to the target Scenes init / create methods. + */ + data?: any; + }; + + type SettingsConfig = { + /** + * The unique key of this Scene. Must be unique within the entire Game instance. + */ + key?: string; + /** + * Does the Scene start as active or not? An active Scene updates each step. + */ + active?: boolean; + /** + * Does the Scene start as visible or not? A visible Scene renders each step. + */ + visible?: boolean; + /** + * An optional Loader Packfile to be loaded before the Scene begins. + */ + pack?: false | Phaser.Types.Loader.FileTypes.PackFileConfig; + /** + * An optional Camera configuration object. + */ + cameras?: Phaser.Types.Cameras.Scene2D.JSONCamera | Phaser.Types.Cameras.Scene2D.JSONCamera[]; + /** + * Overwrites the default injection map for a scene. + */ + map?: {[key: string]: string}; + /** + * Extends the injection map for a scene. + */ + mapAdd?: {[key: string]: string}; + /** + * The physics configuration object for the Scene. + */ + physics?: Phaser.Types.Core.PhysicsConfig; + /** + * The loader configuration object for the Scene. + */ + loader?: Phaser.Types.Core.LoaderConfig; + /** + * The plugin configuration object for the Scene. + */ + plugins?: false | any; + }; + + type SettingsObject = { + /** + * The current status of the Scene. Maps to the Scene constants. + */ + status: number; + /** + * The unique key of this Scene. Unique within the entire Game instance. + */ + key: string; + /** + * The active state of this Scene. An active Scene updates each step. + */ + active: boolean; + /** + * The visible state of this Scene. A visible Scene renders each step. + */ + visible: boolean; + /** + * Has the Scene finished booting? + */ + isBooted: boolean; + /** + * Is the Scene in a state of transition? + */ + isTransition: boolean; + /** + * The Scene this Scene is transitioning from, if set. + */ + transitionFrom: Phaser.Scene; + /** + * The duration of the transition, if set. + */ + transitionDuration: integer; + /** + * Is this Scene allowed to receive input during transitions? + */ + transitionAllowInput: boolean; + /** + * a data bundle passed to this Scene from the Scene Manager. + */ + data: object; + /** + * The Loader Packfile to be loaded before the Scene begins. + */ + pack: false | Phaser.Types.Loader.FileTypes.PackFileConfig; + /** + * The Camera configuration object. + */ + cameras: Phaser.Types.Cameras.Scene2D.JSONCamera | Phaser.Types.Cameras.Scene2D.JSONCamera[]; + /** + * The Scene's Injection Map. + */ + map: {[key: string]: string}; + /** + * The physics configuration object for the Scene. + */ + physics: Phaser.Types.Core.PhysicsConfig; + /** + * The loader configuration object for the Scene. + */ + loader: Phaser.Types.Core.LoaderConfig; + /** + * The plugin configuration object for the Scene. + */ + plugins: false | any; + }; + + } + + namespace Sound { + /** + * Audio sprite sound type. + */ + type AudioSpriteSound = { + /** + * Local reference to 'spritemap' object form json file generated by audiosprite tool. + */ + spritemap: object; + }; + + /** + * A Audio Data object. + * + * You can pass an array of these objects to the WebAudioSoundManager `decodeAudio` method to have it decode + * them all at once. + */ + type DecodeAudioConfig = { + /** + * The string-based key to be used to reference the decoded audio in the audio cache. + */ + key: string; + /** + * The audio data, either a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. + */ + data: ArrayBuffer | string; + }; + + type EachActiveSoundCallback = (manager: Phaser.Sound.BaseSoundManager, sound: Phaser.Sound.BaseSound, index: number, sounds: Phaser.Sound.BaseSound[])=>void; + + /** + * Config object containing various sound settings. + */ + type SoundConfig = { + /** + * Boolean indicating whether the sound should be muted or not. + */ + mute?: boolean; + /** + * A value between 0 (silence) and 1 (full volume). + */ + volume?: number; + /** + * Defines the speed at which the sound should be played. + */ + rate?: number; + /** + * Represents detuning of sound in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + */ + detune?: number; + /** + * Position of playback for this sound, in seconds. + */ + seek?: number; + /** + * Whether or not the sound or current sound marker should loop. + */ + loop?: boolean; + /** + * Time, in seconds, that should elapse before the sound actually starts its playback. + */ + delay?: number; + }; + + /** + * Marked section of a sound represented by name, and optionally start time, duration, and config object. + */ + type SoundMarker = { + /** + * Unique identifier of a sound marker. + */ + name: string; + /** + * Sound position offset at witch playback should start. + */ + start?: number; + /** + * Playback duration of this marker. + */ + duration?: number; + /** + * An optional config object containing default marker settings. + */ + config?: Phaser.Types.Sound.SoundConfig; + }; + + } + + namespace Textures { + /** + * An object containing the position and color data for a single pixel in a CanvasTexture. + */ + type PixelConfig = { + /** + * The x-coordinate of the pixel. + */ + x: integer; + /** + * The y-coordinate of the pixel. + */ + y: integer; + /** + * The color of the pixel, not including the alpha channel. + */ + color: integer; + /** + * The alpha of the pixel, between 0 and 1. + */ + alpha: number; + }; + + type SpriteSheetConfig = { + /** + * The fixed width of each frame. + */ + frameWidth: integer; + /** + * The fixed height of each frame. If not set it will use the frameWidth as the height. + */ + frameHeight?: integer; + /** + * Skip a number of frames. Useful when there are multiple sprite sheets in one Texture. + */ + startFrame?: integer; + /** + * The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames". + */ + endFrame?: integer; + /** + * If the frames have been drawn with a margin, specify the amount here. + */ + margin?: integer; + /** + * If the frames have been drawn with spacing between them, specify the amount here. + */ + spacing?: integer; + }; + + type SpriteSheetFromAtlasConfig = { + /** + * The key of the Texture Atlas in which this Sprite Sheet can be found. + */ + atlas: string; + /** + * The key of the Texture Atlas Frame in which this Sprite Sheet can be found. + */ + frame: string; + /** + * The fixed width of each frame. + */ + frameWidth: integer; + /** + * The fixed height of each frame. If not set it will use the frameWidth as the height. + */ + frameHeight?: integer; + /** + * Skip a number of frames. Useful when there are multiple sprite sheets in one Texture. + */ + startFrame?: integer; + /** + * The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames". + */ + endFrame?: integer; + /** + * If the frames have been drawn with a margin, specify the amount here. + */ + margin?: integer; + /** + * If the frames have been drawn with spacing between them, specify the amount here. + */ + spacing?: integer; + }; + + } + + namespace Tilemaps { + type FilteringOptions = { + /** + * If true, only return tiles that don't have -1 for an index. + */ + isNotEmpty?: boolean; + /** + * If true, only return tiles that collide on at least one side. + */ + isColliding?: boolean; + /** + * If true, only return tiles that have at least one interesting face. + */ + hasInterestingFace?: boolean; + }; + + type GetTilesWithinFilteringOptions = { + /** + * If true, only return tiles that don't have -1 for an index. + */ + isNotEmpty?: boolean; + /** + * If true, only return tiles that collide on at least one side. + */ + isColliding?: boolean; + /** + * If true, only return tiles that have at least one interesting face. + */ + hasInterestingFace?: boolean; + }; + + type MapDataConfig = { + /** + * The key in the Phaser cache that corresponds to the loaded tilemap data. + */ + name?: string; + /** + * The width of the entire tilemap. + */ + width?: number; + /** + * The height of the entire tilemap. + */ + height?: number; + /** + * The width of the tiles. + */ + tileWidth?: number; + /** + * The height of the tiles. + */ + tileHeight?: number; + /** + * The width in pixels of the entire tilemap. + */ + widthInPixels?: number; + /** + * The height in pixels of the entire tilemap. + */ + heightInPixels?: number; + /** + * The format of the Tilemap, as defined in Tiled. + */ + format?: integer; + /** + * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. + */ + orientation?: string; + /** + * Determines the draw order of tilemap. Default is right-down. + */ + renderOrder?: string; + /** + * The version of Tiled the map uses. + */ + version?: number; + /** + * Map specific properties (can be specified in Tiled). + */ + properties?: number; + /** + * The layers of the tilemap. + */ + layers?: Phaser.Tilemaps.LayerData[]; + /** + * An array with all the layers configured to the MapData. + */ + images?: any[]; + /** + * An array of Tiled Image Layers. + */ + objects?: object; + /** + * An object of Tiled Object Layers. + */ + collision?: object; + /** + * The tilesets the map uses. + */ + tilesets?: Phaser.Tilemaps.Tileset[]; + /** + * The collection of images the map uses(specified in Tiled). + */ + imageCollections?: any[]; + /** + * [description] + */ + tiles?: any[]; + }; + + type ObjectLayerConfig = { + /** + * The name of the Object Layer. + */ + name?: string; + /** + * The opacity of the layer, between 0 and 1. + */ + opacity?: number; + /** + * The custom properties defined on the Object Layer, keyed by their name. + */ + properties?: any; + /** + * The type of each custom property defined on the Object Layer, keyed by its name. + */ + propertytypes?: any; + /** + * The type of the layer, which should be `objectgroup`. + */ + type?: string; + /** + * Whether the layer is shown (`true`) or hidden (`false`). + */ + visible?: boolean; + /** + * An array of all objects on this Object Layer. + */ + objects?: any[]; + }; + + type StyleConfig = { + /** + * Color to use for drawing a filled rectangle at non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. + */ + tileColor?: Phaser.Display.Color | number | null; + /** + * Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. + */ + collidingTileColor?: Phaser.Display.Color | number | null; + /** + * Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn. + */ + faceColor?: Phaser.Display.Color | number | null; + }; + + type TiledObject = { + /** + * The unique object ID. + */ + id: integer; + /** + * The name this object was assigned in Tiled. + */ + name: string; + /** + * The type, as assigned in Tiled. + */ + type: string; + /** + * The visible state of this object. + */ + visible?: boolean; + /** + * The horizontal position of this object, in pixels, relative to the tilemap. + */ + x?: number; + /** + * The vertical position of this object, in pixels, relative to the tilemap. + */ + y?: number; + /** + * The width of this object, in pixels. + */ + width?: number; + /** + * The height of this object, in pixels. + */ + height?: number; + /** + * The rotation of the object in clockwise degrees. + */ + rotation?: number; + /** + * Custom properties object. + */ + properties?: any; + /** + * Only set if of type 'tile'. + */ + gid?: integer; + /** + * Only set if a tile object. The horizontal flip value. + */ + flippedHorizontal?: boolean; + /** + * Only set if a tile object. The vertical flip value. + */ + flippedVertical?: boolean; + /** + * Only set if a tile object. The diagonal flip value. + */ + flippedAntiDiagonal?: boolean; + /** + * Only set if a polyline object. An array of objects corresponding to points, where each point has an `x` property and a `y` property. + */ + polyline?: Phaser.Types.Math.Vector2Like[]; + /** + * Only set if a polygon object. An array of objects corresponding to points, where each point has an `x` property and a `y` property. + */ + polygon?: Phaser.Types.Math.Vector2Like[]; + /** + * Only set if a text object. Contains the text objects properties. + */ + text?: any; + /** + * Only set, and set to `true`, if a rectangle object. + */ + rectangle?: boolean; + /** + * Only set, and set to `true`, if a ellipse object. + */ + ellipse?: boolean; + }; + + type TilemapConfig = { + /** + * The key in the Phaser cache that corresponds to the loaded tilemap data. + */ + key?: string; + /** + * Instead of loading from the cache, you can also load directly from a 2D array of tile indexes. + */ + data?: integer[][]; + /** + * The width of a tile in pixels. + */ + tileWidth?: integer; + /** + * The height of a tile in pixels. + */ + tileHeight?: integer; + /** + * The width of the map in tiles. + */ + width?: integer; + /** + * The height of the map in tiles. + */ + height?: integer; + /** + * Controls how empty tiles, tiles with an index of -1, + * in the map data are handled. If `true`, empty locations will get a value of `null`. If `false`, + * empty location will get a Tile object with an index of -1. If you've a large sparsely populated + * map and the tile data doesn't need to change then setting this value to `true` will help with + * memory consumption. However if your map is small or you need to update the tiles dynamically, + * then leave the default value set. + */ + insertNull?: boolean; + }; + + } + + namespace Time { + type TimerEventConfig = { + /** + * The delay after which the Timer Event should fire, in milliseconds. + */ + delay?: number; + /** + * The total number of times the Timer Event will repeat before finishing. + */ + repeat?: number; + /** + * `true` if the Timer Event should repeat indefinitely. + */ + loop?: boolean; + /** + * The callback which will be called when the Timer Event fires. + */ + callback?: Function; + /** + * The scope (`this` object) with which to invoke the `callback`. + */ + callbackScope?: any; + /** + * Additional arguments to be passed to the `callback`. + */ + args?: any[]; + /** + * The scale of the elapsed time. + */ + timeScale?: number; + /** + * The initial elapsed time in milliseconds. Useful if you want a long duration with repeat, but for the first loop to fire quickly. + */ + startAt?: number; + /** + * `true` if the Timer Event should be paused. + */ + paused?: boolean; + }; + + } + + namespace Tweens { + type TweenConfigDefaults = { + /** + * The object, or an array of objects, to run the tween on. + */ + targets: object | object[]; + /** + * The number of milliseconds to delay before the tween will start. + */ + delay?: number; + /** + * The duration of the tween in milliseconds. + */ + duration?: number; + /** + * The easing equation to use for the tween. + */ + ease?: string; + /** + * Optional easing parameters. + */ + easeParams?: any[]; + /** + * The number of milliseconds to hold the tween for before yoyo'ing. + */ + hold?: number; + /** + * The number of times to repeat the tween. + */ + repeat?: number; + /** + * The number of milliseconds to pause before a tween will repeat. + */ + repeatDelay?: number; + /** + * Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. + */ + yoyo?: boolean; + /** + * Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. + */ + flipX?: boolean; + /** + * Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. + */ + flipY?: boolean; + }; + + type GetEndCallback = (target: any, key: string, value: number)=>void; + + type GetStartCallback = (target: any, key: string, value: number)=>void; + + type NumberTweenBuilderConfig = { + /** + * The start number. + */ + from?: number; + /** + * The end number. + */ + to?: number; + /** + * The number of milliseconds to delay before the tween will start. + */ + delay?: number; + /** + * The duration of the tween in milliseconds. + */ + duration?: number; + /** + * The easing equation to use for the tween. + */ + ease?: string | Function; + /** + * Optional easing parameters. + */ + easeParams?: any[]; + /** + * The number of milliseconds to hold the tween for before yoyo'ing. + */ + hold?: number; + /** + * The number of times to repeat the tween. + */ + repeat?: number; + /** + * The number of milliseconds to pause before a tween will repeat. + */ + repeatDelay?: number; + /** + * Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. + */ + yoyo?: boolean; + /** + * Used when the Tween is part of a Timeline. + */ + offset?: number | Function | object | any[]; + /** + * The time the tween will wait before the onComplete event is dispatched once it has completed, in ms. + */ + completeDelay?: number | Function | object | any[]; + /** + * The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property tween has completed once. + */ + loop?: number | Function | object | any[]; + /** + * The time the tween will pause before starting either a yoyo or returning to the start for a repeat. + */ + loopDelay?: number | Function | object | any[]; + /** + * Does the tween start in a paused state (true) or playing (false)? + */ + paused?: boolean; + /** + * Use frames or milliseconds? + */ + useFrames?: boolean; + /** + * Scope (this) for the callbacks. The default scope is the tween. + */ + callbackScope?: any; + /** + * A function to call when the tween completes. + */ + onComplete?: Phaser.Types.Tweens.TweenOnCompleteCallback; + /** + * Additional parameters to pass to `onComplete`. + */ + onCompleteParams?: any[]; + /** + * Scope (this) for `onComplete`. + */ + onCompleteScope?: any; + /** + * A function to call each time the tween loops. + */ + onLoop?: Phaser.Types.Tweens.TweenOnLoopCallback; + /** + * Additional parameters to pass to `onLoop`. + */ + onLoopParams?: any[]; + /** + * Scope (this) for `onLoop`. + */ + onLoopScope?: any; + /** + * A function to call each time the tween repeats. Called once per property per target. + */ + onRepeat?: Phaser.Types.Tweens.TweenOnRepeatCallback; + /** + * Additional parameters to pass to `onRepeat`. + */ + onRepeatParams?: any[]; + /** + * Scope (this) for `onRepeat`. + */ + onRepeatScope?: any; + /** + * A function to call when the tween starts. + */ + onStart?: Phaser.Types.Tweens.TweenOnStartCallback; + /** + * Additional parameters to pass to `onStart`. + */ + onStartParams?: any[]; + /** + * Scope (this) for `onStart`. + */ + onStartScope?: any; + /** + * A function to call each time the tween steps. Called once per property per target. + */ + onUpdate?: Phaser.Types.Tweens.TweenOnUpdateCallback; + /** + * Additional parameters to pass to `onUpdate`. + */ + onUpdateParams?: any[]; + /** + * Scope (this) for `onUpdate`. + */ + onUpdateScope?: any; + /** + * A function to call each time the tween yoyos. Called once per property per target. + */ + onYoyo?: Phaser.Types.Tweens.TweenOnYoyoCallback; + /** + * Additional parameters to pass to `onYoyo`. + */ + onYoyoParams?: any[]; + /** + * Scope (this) for `onYoyo`. + */ + onYoyoScope?: any; + }; + + type TimelineBuilderConfig = { + /** + * An array of tween configuration objects to create and add into the new Timeline. If this doesn't exist or is empty, the Timeline will start off paused and none of the other configuration settings will be read. If it's a function, it will be called and its return value will be used as the array. + */ + tweens?: Phaser.Types.Tweens.TweenBuilderConfig[] | object[] | Function; + /** + * An array (or function which returns one) of default targets to which to apply the Timeline. Each individual Tween configuration can override this value. + */ + targets?: any; + /** + * If specified, each Tween in the Timeline will get an equal portion of this duration, usually in milliseconds, by default. Each individual Tween configuration can override the Tween's duration. + */ + totalDuration?: number; + /** + * If `totalDuration` is not specified, the default duration, usually in milliseconds, of each Tween which will be created. Each individual Tween configuration can override the Tween's duration. + */ + duration?: number; + /** + * The number of milliseconds to delay before the tween will start. Each individual Tween configuration can override this value. + */ + delay?: number; + /** + * Optional easing parameters. Each individual Tween configuration can override this value. + */ + easeParams?: any[]; + /** + * The easing equation to use for each tween. Each individual Tween configuration can override this value. + */ + ease?: string | Function; + /** + * The number of milliseconds to hold each tween before yoyoing. Each individual Tween configuration can override this value. + */ + hold?: number; + /** + * The number of times to repeat each tween. Each individual Tween configuration can override this value. + */ + repeat?: integer; + /** + * The number of milliseconds to pause before each tween will repeat. Each individual Tween configuration can override this value. + */ + repeatDelay?: number; + /** + * Should each tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. Each individual Tween configuration can override this value. + */ + yoyo?: boolean; + /** + * Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. Each individual Tween configuration can override this value. + */ + flipX?: boolean; + /** + * Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. Each individual Tween configuration can override this value. + */ + flipY?: boolean; + /** + * If specified, the time to wait, usually in milliseconds, before the Timeline completes. + */ + completeDelay?: number | Function | object | any[]; + /** + * How many times the Timeline should loop, or -1 to loop indefinitely. + */ + loop?: number | Function | object | any[]; + /** + * The time, usually in milliseconds, between each loop. + */ + loopDelay?: number | Function | object | any[]; + /** + * If `true`, the Timeline will start paused. + */ + paused?: boolean; + /** + * If `true`, all duration in the Timeline will be in frames instead of milliseconds. + */ + useFrames?: boolean; + /** + * The default scope (`this` value) to use for each callback registered by the Timeline Builder. If not specified, the Timeline itself will be used. + */ + callbackScope?: any; + /** + * If specified, the `onStart` callback for the Timeline, called every time it starts playing. + */ + onStart?: Phaser.Types.Tweens.TimelineOnStartCallback; + /** + * The scope (`this` value) to use for the `onStart` callback. If not specified, the `callbackScope` will be used. + */ + onStartScope?: any; + /** + * Additional arguments to pass to the `onStart` callback. The Timeline will always be the first argument. + */ + onStartParams?: any[]; + /** + * If specified, the `onUpdate` callback for the Timeline, called every frame it's active, regardless of its Tweens. + */ + onUpdate?: Phaser.Types.Tweens.TimelineOnUpdateCallback; + /** + * The scope (`this` value) to use for the `onUpdate` callback. If not specified, the `callbackScope` will be used. + */ + onUpdateScope?: any; + /** + * Additional arguments to pass to the `onUpdate` callback. The Timeline will always be the first argument. + */ + onUpdateParams?: any[]; + /** + * If specified, the `onLoop` callback for the Timeline, called every time it loops. + */ + onLoop?: Phaser.Types.Tweens.TimelineOnLoopCallback; + /** + * The scope (`this` value) to use for the `onLoop` callback. If not specified, the `callbackScope` will be used. + */ + onLoopScope?: any; + /** + * Additional arguments to pass to the `onLoop` callback. The Timeline will always be the first argument. + */ + onLoopParams?: any[]; + /** + * If specified, the `onYoyo` callback for the Timeline, called every time it yoyos. + */ + onYoyo?: Phaser.Types.Tweens.TimelineOnYoyoCallback; + /** + * The scope (`this` value) to use for the `onYoyo` callback. If not specified, the `callbackScope` will be used. + */ + onYoyoScope?: any; + /** + * Additional arguments to pass to the `onYoyo` callback. The first argument will always be `null`, while the Timeline will always be the second argument. + */ + onYoyoParams?: any[]; + /** + * If specified, the `onComplete` callback for the Timeline, called after it completes. + */ + onComplete?: Phaser.Types.Tweens.TimelineOnCompleteCallback; + /** + * The scope (`this` value) to use for the `onComplete` callback. If not specified, the `callbackScope` will be used. + */ + onCompleteScope?: any; + /** + * Additional arguments to pass to the `onComplete` callback. The Timeline will always be the first argument. + */ + onCompleteParams?: any[]; + }; + + type TimelineOnCompleteCallback = (timeline: Phaser.Tweens.Timeline, ...param: any[])=>void; + + type TimelineOnLoopCallback = (timeline: Phaser.Tweens.Timeline, ...param: any[])=>void; + + type TimelineOnStartCallback = (timeline: Phaser.Tweens.Timeline, ...param: any[])=>void; + + type TimelineOnUpdateCallback = (timeline: Phaser.Tweens.Timeline, ...param: any[])=>void; + + type TimelineOnYoyoCallback = (timeline: Phaser.Tweens.Timeline, ...param: any[])=>void; + + type TweenBuilderConfig = { + /** + * The object, or an array of objects, to run the tween on. + */ + targets: any; + /** + * The number of milliseconds to delay before the tween will start. + */ + delay?: number; + /** + * The duration of the tween in milliseconds. + */ + duration?: number; + /** + * The easing equation to use for the tween. + */ + ease?: string | Function; + /** + * Optional easing parameters. + */ + easeParams?: any[]; + /** + * The number of milliseconds to hold the tween for before yoyo'ing. + */ + hold?: number; + /** + * The number of times each property tween repeats. + */ + repeat?: number; + /** + * The number of milliseconds to pause before a repeat. + */ + repeatDelay?: number; + /** + * Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. + */ + yoyo?: boolean; + /** + * Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. + */ + flipX?: boolean; + /** + * Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. + */ + flipY?: boolean; + /** + * Used when the Tween is part of a Timeline. + */ + offset?: number | Function | object | any[]; + /** + * The time the tween will wait before the onComplete event is dispatched once it has completed, in ms. + */ + completeDelay?: number | Function | object | any[]; + /** + * The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property tween has completed once. + */ + loop?: number | Function | object | any[]; + /** + * The time the tween will pause before starting either a yoyo or returning to the start for a repeat. + */ + loopDelay?: number | Function | object | any[]; + /** + * Does the tween start in a paused state (true) or playing (false)? + */ + paused?: boolean; + /** + * The properties to tween. + */ + props?: {[key: string]: (number|string|Phaser.Types.Tweens.GetEndCallback|Phaser.Types.Tweens.TweenPropConfig)}; + /** + * Use frames or milliseconds? + */ + useFrames?: boolean; + /** + * Scope (this) for the callbacks. The default scope is the tween. + */ + callbackScope?: any; + /** + * A function to call when the tween completes. + */ + onComplete?: Phaser.Types.Tweens.TweenOnCompleteCallback; + /** + * Additional parameters to pass to `onComplete`. + */ + onCompleteParams?: any[]; + /** + * Scope (this) for `onComplete`. + */ + onCompleteScope?: any; + /** + * A function to call each time the tween loops. + */ + onLoop?: Phaser.Types.Tweens.TweenOnLoopCallback; + /** + * Additional parameters to pass to `onLoop`. + */ + onLoopParams?: any[]; + /** + * Scope (this) for `onLoop`. + */ + onLoopScope?: any; + /** + * A function to call each time the tween repeats. Called once per property per target. + */ + onRepeat?: Phaser.Types.Tweens.TweenOnRepeatCallback; + /** + * Additional parameters to pass to `onRepeat`. + */ + onRepeatParams?: any[]; + /** + * Scope (this) for `onRepeat`. + */ + onRepeatScope?: any; + /** + * A function to call when the tween starts. + */ + onStart?: Phaser.Types.Tweens.TweenOnStartCallback; + /** + * Additional parameters to pass to `onStart`. + */ + onStartParams?: any[]; + /** + * Scope (this) for `onStart`. + */ + onStartScope?: any; + /** + * A function to call each time the tween steps. Called once per property per target. + */ + onUpdate?: Phaser.Types.Tweens.TweenOnUpdateCallback; + /** + * Additional parameters to pass to `onUpdate`. + */ + onUpdateParams?: any[]; + /** + * Scope (this) for `onUpdate`. + */ + onUpdateScope?: any; + /** + * A function to call each time the tween yoyos. Called once per property per target. + */ + onYoyo?: Phaser.Types.Tweens.TweenOnYoyoCallback; + /** + * Additional parameters to pass to `onYoyo`. + */ + onYoyoParams?: any[]; + /** + * Scope (this) for `onYoyo`. + */ + onYoyoScope?: any; + }; + + type TweenDataConfig = { + /** + * The target to tween. + */ + target: any; + /** + * The property of the target being tweened. + */ + key: string; + /** + * The returned value sets what the property will be at the END of the Tween. + */ + getEndValue: Function; + /** + * The returned value sets what the property will be at the START of the Tween. + */ + getStartValue: Function; + /** + * The ease function this tween uses. + */ + ease: Function; + /** + * Duration of the tween in ms/frames, excludes time for yoyo or repeats. + */ + duration?: number; + /** + * The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo) + */ + totalDuration?: number; + /** + * Time in ms/frames before tween will start. + */ + delay?: number; + /** + * Cause the tween to return back to its start value after hold has expired. + */ + yoyo?: boolean; + /** + * Time in ms/frames the tween will pause before running the yoyo or starting a repeat. + */ + hold?: number; + /** + * Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + */ + repeat?: integer; + /** + * Time in ms/frames before the repeat will start. + */ + repeatDelay?: number; + /** + * Automatically call toggleFlipX when the TweenData yoyos or repeats + */ + flipX?: boolean; + /** + * Automatically call toggleFlipY when the TweenData yoyos or repeats + */ + flipY?: boolean; + /** + * Between 0 and 1 showing completion of this TweenData. + */ + progress?: number; + /** + * Delta counter + */ + elapsed?: number; + /** + * How many repeats are left to run? + */ + repeatCounter?: integer; + /** + * Ease value data. + */ + start?: number; + /** + * Ease value data. + */ + current?: number; + /** + * Ease value data. + */ + end?: number; + /** + * Time duration 1. + */ + t1?: number; + /** + * Time duration 2. + */ + t2?: number; + /** + * LoadValue generation functions. + */ + gen?: Phaser.Types.Tweens.TweenDataGenConfig; + /** + * TWEEN_CONST.CREATED + */ + state?: integer; + }; + + type TweenDataGenConfig = { + /** + * Time in ms/frames before tween will start. + */ + delay: Function; + /** + * Duration of the tween in ms/frames, excludes time for yoyo or repeats. + */ + duration: Function; + /** + * Time in ms/frames the tween will pause before running the yoyo or starting a repeat. + */ + hold: Function; + /** + * Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + */ + repeat: Function; + /** + * Time in ms/frames before the repeat will start. + */ + repeatDelay: Function; + }; + + type TweenOnCompleteCallback = (tween: Phaser.Tweens.Tween, targets: any[], ...param: any[])=>void; + + type TweenOnLoopCallback = (tween: Phaser.Tweens.Tween, targets: any[], ...param: any[])=>void; + + type TweenOnRepeatCallback = (tween: Phaser.Tweens.Tween, target: any, ...param: any[])=>void; + + type TweenOnStartCallback = (tween: Phaser.Tweens.Tween, targets: any[], ...param: any[])=>void; + + type TweenOnUpdateCallback = (tween: Phaser.Tweens.Tween, target: any, ...param: any[])=>void; + + type TweenOnYoyoCallback = (tween: Phaser.Tweens.Tween, target: any, ...param: any[])=>void; + + type TweenPropConfig = { + /** + * What the property will be at the END of the Tween. + */ + value?: number | string | Phaser.Types.Tweens.GetEndCallback | Phaser.Types.Tweens.TweenPropConfig; + /** + * What the property will be at the END of the Tween. + */ + getEnd?: Phaser.Types.Tweens.GetEndCallback; + /** + * What the property will be at the START of the Tween. + */ + getStart?: Phaser.Types.Tweens.GetStartCallback; + /** + * The ease function this tween uses. + */ + ease?: string | Function; + /** + * Time in ms/frames before tween will start. + */ + delay?: number; + /** + * Duration of the tween in ms/frames. + */ + duration?: number; + /** + * Determines whether the tween should return back to its start value after hold has expired. + */ + yoyo?: boolean; + /** + * Time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + */ + hold?: number; + /** + * Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + */ + repeat?: number; + /** + * Time in ms/frames before the repeat will start. + */ + repeatDelay?: number; + /** + * Should toggleFlipX be called when yoyo or repeat happens? + */ + flipX?: boolean; + /** + * Should toggleFlipY be called when yoyo or repeat happens? + */ + flipY?: boolean; + }; + + } + + } + + namespace Physics { + namespace Arcade { + /** + * An Arcade Physics Image is an Image with an Arcade Physics body and related components. + * The body can be dynamic or static. + * + * The main difference between an Arcade Image and an Arcade Sprite is that you cannot animate an Arcade Image. + */ + class Image extends Phaser.GameObjects.Image implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer); + + /** + * This Game Object's Physics Body. + */ + body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. + * @param x The horizontal acceleration + * @param y The vertical acceleration Default x. + */ + setAcceleration(x: number, y?: number): this; + + /** + * Sets the body's horizontal acceleration. + * @param value The horizontal acceleration + */ + setAccelerationX(value: number): this; + + /** + * Sets the body's vertical acceleration. + * @param value The vertical acceleration + */ + setAccelerationY(value: number): this; + + /** + * Sets the angular velocity of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular velocity. + */ + setAngularVelocity(value: number): this; + + /** + * Sets the angular acceleration of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular acceleration. + */ + setAngularAcceleration(value: number): this; + + /** + * Sets the angular drag of the body. Drag is applied to the current velocity, providing a form of deceleration. + * @param value The amount of drag. + */ + setAngularDrag(value: number): this; + + /** + * Sets the bounce values of this body. + * + * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. + * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. + * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + * @param y The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. Default x. + */ + setBounce(x: number, y?: number): this; + + /** + * Sets the horizontal bounce value for this body. + * @param value The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceX(value: number): this; + + /** + * Sets the vertical bounce value for this body. + * @param value The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceY(value: number): this; + + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Vec2 first. + * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. + * @param bounceX If given this will be replace the `worldBounce.x` value. + * @param bounceY If given this will be replace the `worldBounce.y` value. + */ + setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number): this; + + /** + * Sets the debug values of this body. + * + * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. + * Note that there is a performance cost in drawing debug displays. It should never be used in production. + * @param showBody Set to `true` to have this body render its outline to the debug display. + * @param showVelocity Set to `true` to have this body render a velocity marker to the debug display. + * @param bodyColor The color of the body outline when rendered to the debug display. + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): this; + + /** + * Sets the color of the body outline when it renders to the debug display. + * @param value The color of the body outline when rendered to the debug display. + */ + setDebugBodyColor(value: number): this; + + /** + * Set to `true` to have this body render its outline to the debug display. + */ + debugShowBody: boolean; + + /** + * Set to `true` to have this body render a velocity marker to the debug display. + */ + debugShowVelocity: boolean; + + /** + * The color of the body outline when it renders to the debug display. + */ + debugBodyColor: number; + + /** + * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param x The amount of horizontal drag to apply. + * @param y The amount of vertical drag to apply. Default x. + */ + setDrag(x: number, y?: number): this; + + /** + * Sets the body's horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of horizontal drag to apply. + */ + setDragX(value: number): this; + + /** + * Sets the body's vertical drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of vertical drag to apply. + */ + setDragY(value: number): this; + + /** + * If this Body is using `drag` for deceleration this function controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * @param value `true` to use damping for deceleration, or `false` to use linear deceleration. + */ + setDamping(value: boolean): this; + + /** + * Enables this Game Object's Body. + * @param reset Also reset the Body and place it at (x, y). + * @param x The horizontal position to place the Game Object and Body. + * @param y The horizontal position to place the Game Object and Body. + * @param enableGameObject Also activate this Game Object. + * @param showGameObject Also show this Game Object. + */ + enableBody(reset: boolean, x: number, y: number, enableGameObject: boolean, showGameObject: boolean): this; + + /** + * Stops and disables this Game Object's Body. + * @param disableGameObject Also deactivate this Game Object. Default false. + * @param hideGameObject Also hide this Game Object. Default false. + */ + disableBody(disableGameObject?: boolean, hideGameObject?: boolean): this; + + /** + * Syncs the Body's position and size with its parent Game Object. + * You don't need to call this for Dynamic Bodies, as it happens automatically. + * But for Static bodies it's a useful way of modifying the position of a Static Body + * in the Physics World, based on its Game Object. + */ + refreshBody(): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of horizontal friction to apply. + * @param y The amount of vertical friction to apply. Default x. + */ + setFriction(x: number, y?: number): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionX(x: number): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionY(x: number): this; + + /** + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. + * @param x The gravitational force to be applied to the X-axis. + * @param y The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. Default x. + */ + setGravity(x: number, y?: number): this; + + /** + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param x The gravitational force to be applied to the X-axis. + */ + setGravityX(x: number): this; + + /** + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param y The gravitational force to be applied to the Y-axis. + */ + setGravityY(y: number): this; + + /** + * Sets Whether this Body can be moved by collisions with another Body. + * @param value Sets if this body can be moved by collisions with another Body. Default true. + */ + setImmovable(value?: boolean): this; + + /** + * Sets the mass of the physics body + * @param value New value for the mass of the body. + */ + setMass(value: number): this; + + /** + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. + * @param x The amount to offset the body from the parent Game Object along the x-axis. + * @param y The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. Default x. + */ + setOffset(x: number, y?: number): this; + + /** + * Sets this physics body to use a circle for collision instead of a rectangle. + * @param radius The radius of the physics body, in pixels. + * @param offsetX The amount to offset the body from the parent Game Object along the x-axis. + * @param offsetY The amount to offset the body from the parent Game Object along the y-axis. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): this; + + /** + * Sets the velocity of the Body. + * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. + * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. + */ + setVelocity(x: number, y?: number): this; + + /** + * Sets the horizontal component of the body's velocity. + * + * Positive values move the body to the right, while negative values move it to the left. + * @param x The new horizontal velocity. + */ + setVelocityX(x: number): this; + + /** + * Sets the vertical component of the body's velocity. + * + * Positive values move the body down, while negative values move it up. + * @param y The new vertical velocity of the body. + */ + setVelocityY(y: number): this; + + /** + * Sets the maximum velocity of the body. + * @param x The new maximum horizontal velocity. + * @param y The new maximum vertical velocity. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + + } + + /** + * The Arcade Physics Plugin belongs to a Scene and sets up and manages the Scene's physics simulation. + * It also holds some useful methods for moving and rotating Arcade Physics Bodies. + * + * You can access it from within a Scene using `this.physics`. + * + * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable + * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. + * The separation that stops two objects penetrating may create a new penetration against a different object. If you + * require a high level of stability please consider using an alternative physics system, such as Matter.js. + */ + class ArcadePhysics { + /** + * + * @param scene The Scene that this Plugin belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene that this Plugin belongs to. + */ + scene: Phaser.Scene; + + /** + * The Scene's Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * A configuration object. Union of the `physics.arcade.*` properties of the GameConfig and SceneConfig objects. + */ + config: object; + + /** + * The physics simulation. + */ + world: Phaser.Physics.Arcade.World; + + /** + * An object holding the Arcade Physics factory methods. + */ + add: Phaser.Physics.Arcade.Factory; + + /** + * Creates the physics configuration for the current Scene. + */ + getConfig(): object; + + /** + * Tests if Game Objects overlap. See {@link Phaser.Physics.Arcade.World#overlap} + * @param object1 The first object or array of objects to check. + * @param object2 The second object or array of objects to check, or `undefined`. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + overlap(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2?: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * Performs a collision check and separation between the two physics enabled objects given, which can be single + * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. + * + * If you don't require separation then use {@link #overlap} instead. + * + * If two Groups or arrays are passed, each member of one will be tested against each member of the other. + * + * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members. + * + * If **only** one Array is passed, the array is iterated and every element in it is tested against the others. + * + * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding + * objects are passed to it. + * + * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable + * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. + * The separation that stops two objects penetrating may create a new penetration against a different object. If you + * require a high level of stability please consider using an alternative physics system, such as Matter.js. + * @param object1 The first object or array of objects to check. + * @param object2 The second object or array of objects to check, or `undefined`. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + collide(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2?: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects. + * + * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for collision with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions + * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * + * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have + * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the + * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on + * dynamic maps, this method can prove very useful. + * @param sprite The first object to check for collision. + * @param tiles An array of Tiles to check for collision against. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + collideTiles(sprite: Phaser.GameObjects.GameObject, tiles: Phaser.Tilemaps.Tile[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects. + * + * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap + * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * @param sprite The first object to check for collision. + * @param tiles An array of Tiles to check for collision against. + * @param collideCallback An optional callback function that is called if the objects overlap. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + overlapTiles(sprite: Phaser.GameObjects.GameObject, tiles: Phaser.Tilemaps.Tile[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * Pauses the simulation. + */ + pause(): Phaser.Physics.Arcade.World; + + /** + * Resumes the simulation (if paused). + */ + resume(): Phaser.Physics.Arcade.World; + + /** + * Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared) + * + * You must give a maximum speed value, beyond which the game object won't go any faster. + * + * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course. + * Note: The game object doesn't stop moving once it reaches the destination coordinates. + * @param gameObject Any Game Object with an Arcade Physics body. + * @param x The x coordinate to accelerate towards. + * @param y The y coordinate to accelerate towards. + * @param speed The acceleration (change in speed) in pixels per second squared. Default 60. + * @param xSpeedMax The maximum x velocity the game object can reach. Default 500. + * @param ySpeedMax The maximum y velocity the game object can reach. Default 500. + */ + accelerateTo(gameObject: Phaser.GameObjects.GameObject, x: number, y: number, speed?: number, xSpeedMax?: number, ySpeedMax?: number): number; + + /** + * Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared) + * + * You must give a maximum speed value, beyond which the game object won't go any faster. + * + * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course. + * Note: The game object doesn't stop moving once it reaches the destination coordinates. + * @param gameObject Any Game Object with an Arcade Physics body. + * @param destination The Game Object to move towards. Can be any object but must have visible x/y properties. + * @param speed The acceleration (change in speed) in pixels per second squared. Default 60. + * @param xSpeedMax The maximum x velocity the game object can reach. Default 500. + * @param ySpeedMax The maximum y velocity the game object can reach. Default 500. + */ + accelerateToObject(gameObject: Phaser.GameObjects.GameObject, destination: Phaser.GameObjects.GameObject, speed?: number, xSpeedMax?: number, ySpeedMax?: number): number; + + /** + * Finds the Dynamic Body closest to a source point or object. + * + * If two or more bodies are the exact same distance from the source point, only the first body + * is returned. + * @param source Any object with public `x` and `y` properties, such as a Game Object or Geometry object. + */ + closest(source: any): Phaser.Physics.Arcade.Body; + + /** + * Finds the Dynamic Body farthest from a source point or object. + * + * If two or more bodies are the exact same distance from the source point, only the first body + * is returned. + * @param source Any object with public `x` and `y` properties, such as a Game Object or Geometry object. + */ + furthest(source: any): Phaser.Physics.Arcade.Body; + + /** + * Move the given display object towards the x/y coordinates at a steady velocity. + * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds. + * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. + * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. + * Note: The display object doesn't stop moving once it reaches the destination coordinates. + * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) + * @param gameObject Any Game Object with an Arcade Physics body. + * @param x The x coordinate to move towards. + * @param y The y coordinate to move towards. + * @param speed The speed it will move, in pixels per second (default is 60 pixels/sec) Default 60. + * @param maxTime Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms. Default 0. + */ + moveTo(gameObject: Phaser.GameObjects.GameObject, x: number, y: number, speed?: number, maxTime?: number): number; + + /** + * Move the given display object towards the destination object at a steady velocity. + * If you specify a maxTime then it will adjust the speed (overwriting what you set) so it arrives at the destination in that number of seconds. + * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. + * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. + * Note: The display object doesn't stop moving once it reaches the destination coordinates. + * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) + * @param gameObject Any Game Object with an Arcade Physics body. + * @param destination Any object with public `x` and `y` properties, such as a Game Object or Geometry object. + * @param speed The speed it will move, in pixels per second (default is 60 pixels/sec) Default 60. + * @param maxTime Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms. Default 0. + */ + moveToObject(gameObject: Phaser.GameObjects.GameObject, destination: object, speed?: number, maxTime?: number): number; + + /** + * Given the angle (in degrees) and speed calculate the velocity and return it as a vector, or set it to the given vector object. + * One way to use this is: velocityFromAngle(angle, 200, sprite.body.velocity) which will set the values directly to the sprite's velocity and not create a new vector object. + * @param angle The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) + * @param speed The speed it will move, in pixels per second squared. Default 60. + * @param vec2 The Vector2 in which the x and y properties will be set to the calculated velocity. + */ + velocityFromAngle(angle: number, speed?: number, vec2?: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Given the rotation (in radians) and speed calculate the velocity and return it as a vector, or set it to the given vector object. + * One way to use this is: velocityFromRotation(rotation, 200, sprite.body.velocity) which will set the values directly to the sprite's velocity and not create a new vector object. + * @param rotation The angle in radians. + * @param speed The speed it will move, in pixels per second squared Default 60. + * @param vec2 The Vector2 in which the x and y properties will be set to the calculated velocity. + */ + velocityFromRotation(rotation: number, speed?: number, vec2?: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * This method will search the given rectangular area and return an array of all physics bodies that + * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. + * + * A body only has to intersect with the search area to be considered, it doesn't have to be fully + * contained within it. + * + * If Arcade Physics is set to use the RTree (which it is by default) then the search for is extremely fast, + * otherwise the search is O(N) for Dynamic Bodies. + * @param x The top-left x coordinate of the area to search within. + * @param y The top-left y coordinate of the area to search within. + * @param width The width of the area to search within. + * @param height The height of the area to search within. + * @param includeDynamic Should the search include Dynamic Bodies? Default true. + * @param includeStatic Should the search include Static Bodies? Default false. + */ + overlapRect(x: number, y: number, width: number, height: number, includeDynamic?: boolean, includeStatic?: boolean): Phaser.Physics.Arcade.Body[] | Phaser.Physics.Arcade.StaticBody[]; + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + */ + shutdown(): void; + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + */ + destroy(): void; + + } + + /** + * An Arcade Physics Sprite is a Sprite with an Arcade Physics body and related components. + * The body can be dynamic or static. + * + * The main difference between an Arcade Sprite and an Arcade Image is that you cannot animate an Arcade Image. + * If you do not require animation then you can safely use Arcade Images instead of Arcade Sprites. + */ + class Sprite extends Phaser.GameObjects.Sprite implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer); + + /** + * This Game Object's Physics Body. + */ + body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. + * @param x The horizontal acceleration + * @param y The vertical acceleration Default x. + */ + setAcceleration(x: number, y?: number): this; + + /** + * Sets the body's horizontal acceleration. + * @param value The horizontal acceleration + */ + setAccelerationX(value: number): this; + + /** + * Sets the body's vertical acceleration. + * @param value The vertical acceleration + */ + setAccelerationY(value: number): this; + + /** + * Sets the angular velocity of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular velocity. + */ + setAngularVelocity(value: number): this; + + /** + * Sets the angular acceleration of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular acceleration. + */ + setAngularAcceleration(value: number): this; + + /** + * Sets the angular drag of the body. Drag is applied to the current velocity, providing a form of deceleration. + * @param value The amount of drag. + */ + setAngularDrag(value: number): this; + + /** + * Sets the bounce values of this body. + * + * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. + * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. + * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + * @param y The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. Default x. + */ + setBounce(x: number, y?: number): this; + + /** + * Sets the horizontal bounce value for this body. + * @param value The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceX(value: number): this; + + /** + * Sets the vertical bounce value for this body. + * @param value The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceY(value: number): this; + + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Vec2 first. + * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. + * @param bounceX If given this will be replace the `worldBounce.x` value. + * @param bounceY If given this will be replace the `worldBounce.y` value. + */ + setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number): this; + + /** + * Sets the debug values of this body. + * + * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. + * Note that there is a performance cost in drawing debug displays. It should never be used in production. + * @param showBody Set to `true` to have this body render its outline to the debug display. + * @param showVelocity Set to `true` to have this body render a velocity marker to the debug display. + * @param bodyColor The color of the body outline when rendered to the debug display. + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): this; + + /** + * Sets the color of the body outline when it renders to the debug display. + * @param value The color of the body outline when rendered to the debug display. + */ + setDebugBodyColor(value: number): this; + + /** + * Set to `true` to have this body render its outline to the debug display. + */ + debugShowBody: boolean; + + /** + * Set to `true` to have this body render a velocity marker to the debug display. + */ + debugShowVelocity: boolean; + + /** + * The color of the body outline when it renders to the debug display. + */ + debugBodyColor: number; + + /** + * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param x The amount of horizontal drag to apply. + * @param y The amount of vertical drag to apply. Default x. + */ + setDrag(x: number, y?: number): this; + + /** + * Sets the body's horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of horizontal drag to apply. + */ + setDragX(value: number): this; + + /** + * Sets the body's vertical drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of vertical drag to apply. + */ + setDragY(value: number): this; + + /** + * If this Body is using `drag` for deceleration this function controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * @param value `true` to use damping for deceleration, or `false` to use linear deceleration. + */ + setDamping(value: boolean): this; + + /** + * Enables this Game Object's Body. + * @param reset Also reset the Body and place it at (x, y). + * @param x The horizontal position to place the Game Object and Body. + * @param y The horizontal position to place the Game Object and Body. + * @param enableGameObject Also activate this Game Object. + * @param showGameObject Also show this Game Object. + */ + enableBody(reset: boolean, x: number, y: number, enableGameObject: boolean, showGameObject: boolean): this; + + /** + * Stops and disables this Game Object's Body. + * @param disableGameObject Also deactivate this Game Object. Default false. + * @param hideGameObject Also hide this Game Object. Default false. + */ + disableBody(disableGameObject?: boolean, hideGameObject?: boolean): this; + + /** + * Syncs the Body's position and size with its parent Game Object. + * You don't need to call this for Dynamic Bodies, as it happens automatically. + * But for Static bodies it's a useful way of modifying the position of a Static Body + * in the Physics World, based on its Game Object. + */ + refreshBody(): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of horizontal friction to apply. + * @param y The amount of vertical friction to apply. Default x. + */ + setFriction(x: number, y?: number): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionX(x: number): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionY(x: number): this; + + /** + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. + * @param x The gravitational force to be applied to the X-axis. + * @param y The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. Default x. + */ + setGravity(x: number, y?: number): this; + + /** + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param x The gravitational force to be applied to the X-axis. + */ + setGravityX(x: number): this; + + /** + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param y The gravitational force to be applied to the Y-axis. + */ + setGravityY(y: number): this; + + /** + * Sets Whether this Body can be moved by collisions with another Body. + * @param value Sets if this body can be moved by collisions with another Body. Default true. + */ + setImmovable(value?: boolean): this; + + /** + * Sets the mass of the physics body + * @param value New value for the mass of the body. + */ + setMass(value: number): this; + + /** + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. + * @param x The amount to offset the body from the parent Game Object along the x-axis. + * @param y The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. Default x. + */ + setOffset(x: number, y?: number): this; + + /** + * Sets this physics body to use a circle for collision instead of a rectangle. + * @param radius The radius of the physics body, in pixels. + * @param offsetX The amount to offset the body from the parent Game Object along the x-axis. + * @param offsetY The amount to offset the body from the parent Game Object along the y-axis. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): this; + + /** + * Sets the velocity of the Body. + * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. + * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. + */ + setVelocity(x: number, y?: number): this; + + /** + * Sets the horizontal component of the body's velocity. + * + * Positive values move the body to the right, while negative values move it to the left. + * @param x The new horizontal velocity. + */ + setVelocityX(x: number): this; + + /** + * Sets the vertical component of the body's velocity. + * + * Positive values move the body down, while negative values move it up. + * @param y The new vertical velocity of the body. + */ + setVelocityY(y: number): this; + + /** + * Sets the maximum velocity of the body. + * @param x The new maximum horizontal velocity. + * @param y The new maximum vertical velocity. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + + } + + /** + * A Dynamic Arcade Body. + * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticBody}. + */ + class Body { + /** + * + * @param world The Arcade Physics simulation this Body belongs to. + * @param gameObject The Game Object this Body belongs to. + */ + constructor(world: Phaser.Physics.Arcade.World, gameObject: Phaser.GameObjects.GameObject); + + /** + * The Arcade Physics simulation this Body belongs to. + */ + world: Phaser.Physics.Arcade.World; + + /** + * The Game Object this Body belongs to. + */ + gameObject: Phaser.GameObjects.GameObject; + + /** + * Transformations applied to this Body. + */ + transform: object; + + /** + * Whether the Body's boundary is drawn to the debug display. + */ + debugShowBody: boolean; + + /** + * Whether the Body's velocity is drawn to the debug display. + */ + debugShowVelocity: boolean; + + /** + * The color of this Body on the debug display. + */ + debugBodyColor: integer; + + /** + * Whether this Body is updated by the physics simulation. + */ + enable: boolean; + + /** + * Whether this Body's boundary is circular (true) or rectangular (false). + */ + isCircle: boolean; + + /** + * If this Body is circular, this is the unscaled radius of the Body's boundary, as set by setCircle(), in source pixels. + * The true radius is equal to `halfWidth`. + */ + radius: number; + + /** + * The offset of this Body's position from its Game Object's position, in source pixels. + */ + offset: Phaser.Math.Vector2; + + /** + * The position of this Body within the simulation. + */ + position: Phaser.Math.Vector2; + + /** + * The position of this Body during the previous step. + */ + prev: Phaser.Math.Vector2; + + /** + * Whether this Body's `rotation` is affected by its angular acceleration and angular velocity. + */ + allowRotation: boolean; + + /** + * This body's rotation, in degrees, based on its angular acceleration and angular velocity. + * The Body's rotation controls the `angle` of its Game Object. + * It doesn't rotate the Body's boundary, which is always an axis-aligned rectangle or a circle. + */ + rotation: number; + + /** + * The Body's rotation, in degrees, during the previous step. + */ + preRotation: number; + + /** + * The width of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. + */ + width: number; + + /** + * The height of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. + */ + height: number; + + /** + * The unscaled width of the Body, in source pixels, as set by setSize(). + * The default is the width of the Body's Game Object's texture frame. + */ + sourceWidth: number; + + /** + * The unscaled height of the Body, in source pixels, as set by setSize(). + * The default is the height of the Body's Game Object's texture frame. + */ + sourceHeight: number; + + /** + * Half the Body's width, in pixels. + */ + halfWidth: number; + + /** + * Half the Body's height, in pixels. + */ + halfHeight: number; + + /** + * The center of the Body's boundary. + * The midpoint of its `position` (top-left corner) and its bottom-right corner. + */ + center: Phaser.Math.Vector2; + + /** + * The Body's velocity, in pixels per second. + */ + velocity: Phaser.Math.Vector2; + + /** + * The Body's calculated velocity, in pixels per second, at the last step. + */ + readonly newVelocity: Phaser.Math.Vector2; + + /** + * The Body's absolute maximum change in position, in pixels per step. + */ + deltaMax: Phaser.Math.Vector2; + + /** + * The Body's change in velocity, in pixels per second squared. + */ + acceleration: Phaser.Math.Vector2; + + /** + * Whether this Body's velocity is affected by its `drag`. + */ + allowDrag: boolean; + + /** + * Absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + */ + drag: Phaser.Math.Vector2 | number; + + /** + * Whether this Body's position is affected by gravity (local or world). + */ + allowGravity: boolean; + + /** + * Acceleration due to gravity (specific to this Body), in pixels per second squared. + * Total gravity is the sum of this vector and the simulation's `gravity`. + */ + gravity: Phaser.Math.Vector2; + + /** + * Rebound following a collision, relative to 1. + */ + bounce: Phaser.Math.Vector2; + + /** + * Rebound following a collision with the world boundary, relative to 1. + * If null, `bounce` is used instead. + */ + worldBounce: Phaser.Math.Vector2; + + /** + * Whether the simulation emits a `worldbounds` event when this Body collides with the world boundary (and `collideWorldBounds` is also true). + */ + onWorldBounds: boolean; + + /** + * Whether the simulation emits a `collide` event when this Body collides with another. + */ + onCollide: boolean; + + /** + * Whether the simulation emits an `overlap` event when this Body overlaps with another. + */ + onOverlap: boolean; + + /** + * The Body's absolute maximum velocity, in pixels per second. + * The horizontal and vertical components are applied separately. + */ + maxVelocity: Phaser.Math.Vector2; + + /** + * The maximum speed this Body is allowed to reach. + * + * If not negative it limits the scalar value of speed. + * + * Any negative value means no maximum is being applied. + */ + maxSpeed: number; + + /** + * If this Body is `immovable` and in motion, `friction` is the proportion of this Body's motion received by the riding Body on each axis, relative to 1. + * The default value (1, 0) moves the riding Body horizontally in equal proportion to this Body and vertically not at all. + * The horizontal component (x) is applied only when two colliding Bodies are separated vertically. + * The vertical component (y) is applied only when two colliding Bodies are separated horizontally. + */ + friction: Phaser.Math.Vector2; + + /** + * If this Body is using `drag` for deceleration this property controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + */ + useDamping: boolean; + + /** + * The rate of change of this Body's `rotation`, in degrees per second. + */ + angularVelocity: number; + + /** + * The Body's angular acceleration (change in angular velocity), in degrees per second squared. + */ + angularAcceleration: number; + + /** + * Loss of angular velocity due to angular movement, in degrees per second. + * + * Angular drag is applied only when angular acceleration is zero. + */ + angularDrag: number; + + /** + * The Body's maximum angular velocity, in degrees per second. + */ + maxAngular: number; + + /** + * The Body's inertia, relative to a default unit (1). + * With `bounce`, this affects the exchange of momentum (velocities) during collisions. + */ + mass: number; + + /** + * The calculated angle of this Body's velocity vector, in radians, during the last step. + */ + angle: number; + + /** + * The calculated magnitude of the Body's velocity, in pixels per second, during the last step. + */ + speed: number; + + /** + * The direction of the Body's velocity, as calculated during the last step. + * If the Body is moving on both axes (diagonally), this describes motion on the vertical axis only. + */ + facing: integer; + + /** + * Whether this Body can be moved by collisions with another Body. + */ + immovable: boolean; + + /** + * Whether the Body's position and rotation are affected by its velocity, acceleration, drag, and gravity. + */ + moves: boolean; + + /** + * A flag disabling the default horizontal separation of colliding bodies. + * Pass your own `collideCallback` to the collider. + */ + customSeparateX: boolean; + + /** + * A flag disabling the default vertical separation of colliding bodies. + * Pass your own `collideCallback` to the collider. + */ + customSeparateY: boolean; + + /** + * The amount of horizontal overlap (before separation), if this Body is colliding with another. + */ + overlapX: number; + + /** + * The amount of vertical overlap (before separation), if this Body is colliding with another. + */ + overlapY: number; + + /** + * The amount of overlap (before separation), if this Body is circular and colliding with another circular body. + */ + overlapR: number; + + /** + * Whether this Body is overlapped with another and both are not moving. + */ + embedded: boolean; + + /** + * Whether this Body interacts with the world boundary. + */ + collideWorldBounds: boolean; + + /** + * Whether this Body is checked for collisions and for which directions. + * You can set `checkCollision.none = true` to disable collision checks. + */ + checkCollision: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this Body is colliding with another and in which direction. + */ + touching: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this Body was colliding with another during the last step, and in which direction. + */ + wasTouching: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this Body is colliding with a tile or the world boundary. + */ + blocked: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether to automatically synchronize this Body's dimensions to the dimensions of its Game Object's visual bounds. + */ + syncBounds: boolean; + + /** + * The Body's physics type (dynamic or static). + */ + readonly physicsType: integer; + + /** + * Updates the Body's `transform`, `width`, `height`, and `center` from its Game Object. + * The Body's `position` isn't changed. + */ + updateBounds(): void; + + /** + * Updates the Body's `center` from its `position`, `width`, and `height`. + */ + updateCenter(): void; + + /** + * Prepares the Body for a physics step by resetting the `wasTouching`, `touching` and `blocked` states. + * + * This method is only called if the physics world is going to run a step this frame. + */ + resetFlags(): void; + + /** + * Syncs the position body position with the parent Game Object. + * + * This method is called every game frame, regardless if the world steps or not. + * @param willStep Will this Body run an update as well? + * @param delta The delta time, in seconds, elapsed since the last frame. + */ + preUpdate(willStep: boolean, delta: number): void; + + /** + * Performs a single physics step and updates the body velocity, angle, speed and other properties. + * + * This method can be called multiple times per game frame, depending on the physics step rate. + * + * The results are synced back to the Game Object in `postUpdate`. + * @param delta The delta time, in seconds, elapsed since the last frame. + */ + update(delta: number): void; + + /** + * Feeds the Body results back into the parent Game Object. + * + * This method is called every game frame, regardless if the world steps or not. + */ + postUpdate(): void; + + /** + * Checks for collisions between this Body and the world boundary and separates them. + */ + checkWorldBounds(): boolean; + + /** + * Sets the offset of the Body's position from its Game Object's position. + * @param x The horizontal offset, in source pixels. + * @param y The vertical offset, in source pixels. Default x. + */ + setOffset(x: number, y?: number): Phaser.Physics.Arcade.Body; + + /** + * Sizes and positions this Body's boundary, as a rectangle. + * Modifies the Body `offset` if `center` is true (the default). + * Resets the width and height to match current frame, if no width and height provided and a frame is found. + * @param width The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param height The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param center Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. Default true. + */ + setSize(width?: integer, height?: integer, center?: boolean): Phaser.Physics.Arcade.Body; + + /** + * Sizes and positions this Body's boundary, as a circle. + * @param radius The radius of the Body, in source pixels. + * @param offsetX The horizontal offset of the Body from its Game Object, in source pixels. + * @param offsetY The vertical offset of the Body from its Game Object, in source pixels. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): Phaser.Physics.Arcade.Body; + + /** + * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates. + * If the Body had any velocity or acceleration it is lost as a result of calling this. + * @param x The horizontal position to place the Game Object and Body. + * @param y The vertical position to place the Game Object and Body. + */ + reset(x: number, y: number): void; + + /** + * Sets acceleration, velocity, and speed to zero. + */ + stop(): Phaser.Physics.Arcade.Body; + + /** + * Copies the coordinates of this Body's edges into an object. + * @param obj An object to copy the values into. + */ + getBounds(obj: Phaser.Types.Physics.Arcade.ArcadeBodyBounds): Phaser.Types.Physics.Arcade.ArcadeBodyBounds; + + /** + * Tests if the coordinates are within this Body's boundary. + * @param x The horizontal coordinate. + * @param y The vertical coordinate. + */ + hitTest(x: number, y: number): boolean; + + /** + * Whether this Body is touching a tile or the world boundary while moving down. + */ + onFloor(): boolean; + + /** + * Whether this Body is touching a tile or the world boundary while moving up. + */ + onCeiling(): boolean; + + /** + * Whether this Body is touching a tile or the world boundary while moving left or right. + */ + onWall(): boolean; + + /** + * The absolute (non-negative) change in this Body's horizontal position from the previous step. + */ + deltaAbsX(): number; + + /** + * The absolute (non-negative) change in this Body's vertical position from the previous step. + */ + deltaAbsY(): number; + + /** + * The change in this Body's horizontal position from the previous step. + * This value is set during the Body's update phase. + */ + deltaX(): number; + + /** + * The change in this Body's vertical position from the previous step. + * This value is set during the Body's update phase. + */ + deltaY(): number; + + /** + * The change in this Body's rotation from the previous step, in degrees. + */ + deltaZ(): number; + + /** + * Disables this Body and marks it for deletion by the simulation. + */ + destroy(): void; + + /** + * Draws this Body's boundary and velocity, if enabled. + * @param graphic The Graphics object to draw on. + */ + drawDebug(graphic: Phaser.GameObjects.Graphics): void; + + /** + * Whether this Body will be drawn to the debug display. + */ + willDrawDebug(): boolean; + + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Vec2 first. + * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. + * @param bounceX If given this will be replace the `worldBounce.x` value. + * @param bounceY If given this will be replace the `worldBounce.y` value. + */ + setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's velocity. + * @param x The horizontal velocity, in pixels per second. + * @param y The vertical velocity, in pixels per second. Default x. + */ + setVelocity(x: number, y?: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal velocity. + * @param value The velocity, in pixels per second. + */ + setVelocityX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical velocity. + * @param value The velocity, in pixels per second. + */ + setVelocityY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's maximum velocity. + * @param x The horizontal velocity, in pixels per second. + * @param y The vertical velocity, in pixels per second. Default x. + */ + setMaxVelocity(x: number, y?: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the maximum speed the Body can move. + * @param value The maximum speed value, in pixels per second. Set to a negative value to disable. + */ + setMaxSpeed(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's bounce. + * @param x The horizontal bounce, relative to 1. + * @param y The vertical bounce, relative to 1. + */ + setBounce(x: number, y: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal bounce. + * @param value The bounce, relative to 1. + */ + setBounceX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical bounce. + * @param value The bounce, relative to 1. + */ + setBounceY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's acceleration. + * @param x The horizontal component, in pixels per second squared. + * @param y The vertical component, in pixels per second squared. + */ + setAcceleration(x: number, y: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal acceleration. + * @param value The acceleration, in pixels per second squared. + */ + setAccelerationX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical acceleration. + * @param value The acceleration, in pixels per second squared. + */ + setAccelerationY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Enables or disables drag. + * @param value `true` to allow drag on this body, or `false` to disable it. Default true. + */ + setAllowDrag(value?: boolean): Phaser.Physics.Arcade.Body; + + /** + * Enables or disables gravity's effect on this Body. + * @param value `true` to allow gravity on this body, or `false` to disable it. Default true. + */ + setAllowGravity(value?: boolean): Phaser.Physics.Arcade.Body; + + /** + * Enables or disables rotation. + * @param value `true` to allow rotation on this body, or `false` to disable it. Default true. + */ + setAllowRotation(value?: boolean): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's drag. + * @param x The horizontal component, in pixels per second squared. + * @param y The vertical component, in pixels per second squared. + */ + setDrag(x: number, y: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal drag. + * @param value The drag, in pixels per second squared. + */ + setDragX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical drag. + * @param value The drag, in pixels per second squared. + */ + setDragY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's gravity. + * @param x The horizontal component, in pixels per second squared. + * @param y The vertical component, in pixels per second squared. + */ + setGravity(x: number, y: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal gravity. + * @param value The gravity, in pixels per second squared. + */ + setGravityX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical gravity. + * @param value The gravity, in pixels per second squared. + */ + setGravityY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's friction. + * @param x The horizontal component, relative to 1. + * @param y The vertical component, relative to 1. + */ + setFriction(x: number, y: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal friction. + * @param value The friction value, relative to 1. + */ + setFrictionX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical friction. + * @param value The friction value, relative to 1. + */ + setFrictionY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's angular velocity. + * @param value The velocity, in degrees per second. + */ + setAngularVelocity(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's angular acceleration. + * @param value The acceleration, in degrees per second squared. + */ + setAngularAcceleration(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's angular drag. + * @param value The drag, in degrees per second squared. + */ + setAngularDrag(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's mass. + * @param value The mass value, relative to 1. + */ + setMass(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's `immovable` property. + * @param value The value to assign to `immovable`. Default true. + */ + setImmovable(value?: boolean): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's `enable` property. + * @param value The value to assign to `enable`. Default true. + */ + setEnable(value?: boolean): Phaser.Physics.Arcade.Body; + + /** + * The Body's horizontal position (left edge). + */ + x: number; + + /** + * The Body's vertical position (top edge). + */ + y: number; + + /** + * The left edge of the Body's boundary. Identical to x. + */ + readonly left: number; + + /** + * The right edge of the Body's boundary. + */ + readonly right: number; + + /** + * The top edge of the Body's boundary. Identical to y. + */ + readonly top: number; + + /** + * The bottom edge of this Body's boundary. + */ + readonly bottom: number; + + } + + /** + * An Arcade Physics Collider will automatically check for collision, or overlaps, between two objects + * every step. If a collision, or overlap, occurs it will invoke the given callbacks. + */ + class Collider { + /** + * + * @param world The Arcade physics World that will manage the collisions. + * @param overlapOnly Whether to check for collisions or overlap. + * @param object1 The first object to check for collision. + * @param object2 The second object to check for collision. + * @param collideCallback The callback to invoke when the two objects collide. + * @param processCallback The callback to invoke when the two objects collide. Must return a boolean. + * @param callbackContext The scope in which to call the callbacks. + */ + constructor(world: Phaser.Physics.Arcade.World, overlapOnly: boolean, object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback: ArcadePhysicsCallback, processCallback: ArcadePhysicsCallback, callbackContext: any); + + /** + * The world in which the bodies will collide. + */ + world: Phaser.Physics.Arcade.World; + + /** + * The name of the collider (unused by Phaser). + */ + name: string; + + /** + * Whether the collider is active. + */ + active: boolean; + + /** + * Whether to check for collisions or overlaps. + */ + overlapOnly: boolean; + + /** + * The first object to check for collision. + */ + object1: Phaser.Types.Physics.Arcade.ArcadeColliderType; + + /** + * The second object to check for collision. + */ + object2: Phaser.Types.Physics.Arcade.ArcadeColliderType; + + /** + * The callback to invoke when the two objects collide. + */ + collideCallback: ArcadePhysicsCallback; + + /** + * If a processCallback exists it must return true or collision checking will be skipped. + */ + processCallback: ArcadePhysicsCallback; + + /** + * The context the collideCallback and processCallback will run in. + */ + callbackContext: object; + + /** + * A name for the Collider. + * + * Phaser does not use this value, it's for your own reference. + * @param name The name to assign to the Collider. + */ + setName(name: string): Phaser.Physics.Arcade.Collider; + + /** + * Called by World as part of its step processing, initial operation of collision checking. + */ + update(): void; + + /** + * Removes Collider from World and disposes of its resources. + */ + destroy(): void; + + } + + namespace Components { + /** + * Provides methods used for setting the acceleration properties of an Arcade Physics Body. + */ + interface Acceleration { + /** + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. + * @param x The horizontal acceleration + * @param y The vertical acceleration Default x. + */ + setAcceleration(x: number, y?: number): this; + /** + * Sets the body's horizontal acceleration. + * @param value The horizontal acceleration + */ + setAccelerationX(value: number): this; + /** + * Sets the body's vertical acceleration. + * @param value The vertical acceleration + */ + setAccelerationY(value: number): this; + } + + /** + * Provides methods used for setting the angular acceleration properties of an Arcade Physics Body. + */ + interface Angular { + /** + * Sets the angular velocity of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular velocity. + */ + setAngularVelocity(value: number): this; + /** + * Sets the angular acceleration of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular acceleration. + */ + setAngularAcceleration(value: number): this; + /** + * Sets the angular drag of the body. Drag is applied to the current velocity, providing a form of deceleration. + * @param value The amount of drag. + */ + setAngularDrag(value: number): this; + } + + /** + * Provides methods used for setting the bounce properties of an Arcade Physics Body. + */ + interface Bounce { + /** + * Sets the bounce values of this body. + * + * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. + * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. + * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + * @param y The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. Default x. + */ + setBounce(x: number, y?: number): this; + /** + * Sets the horizontal bounce value for this body. + * @param value The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceX(value: number): this; + /** + * Sets the vertical bounce value for this body. + * @param value The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceY(value: number): this; + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Vec2 first. + * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. + * @param bounceX If given this will be replace the `worldBounce.x` value. + * @param bounceY If given this will be replace the `worldBounce.y` value. + */ + setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number): this; + } + + /** + * Provides methods used for setting the debug properties of an Arcade Physics Body. + */ + interface Debug { + /** + * Sets the debug values of this body. + * + * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. + * Note that there is a performance cost in drawing debug displays. It should never be used in production. + * @param showBody Set to `true` to have this body render its outline to the debug display. + * @param showVelocity Set to `true` to have this body render a velocity marker to the debug display. + * @param bodyColor The color of the body outline when rendered to the debug display. + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): this; + /** + * Sets the color of the body outline when it renders to the debug display. + * @param value The color of the body outline when rendered to the debug display. + */ + setDebugBodyColor(value: number): this; + /** + * Set to `true` to have this body render its outline to the debug display. + */ + debugShowBody: boolean; + /** + * Set to `true` to have this body render a velocity marker to the debug display. + */ + debugShowVelocity: boolean; + /** + * The color of the body outline when it renders to the debug display. + */ + debugBodyColor: number; + } + + /** + * Provides methods used for setting the drag properties of an Arcade Physics Body. + */ + interface Drag { + /** + * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param x The amount of horizontal drag to apply. + * @param y The amount of vertical drag to apply. Default x. + */ + setDrag(x: number, y?: number): this; + /** + * Sets the body's horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of horizontal drag to apply. + */ + setDragX(value: number): this; + /** + * Sets the body's vertical drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of vertical drag to apply. + */ + setDragY(value: number): this; + /** + * If this Body is using `drag` for deceleration this function controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * @param value `true` to use damping for deceleration, or `false` to use linear deceleration. + */ + setDamping(value: boolean): this; + } + + /** + * Provides methods used for setting the enable properties of an Arcade Physics Body. + */ + interface Enable { + /** + * Enables this Game Object's Body. + * @param reset Also reset the Body and place it at (x, y). + * @param x The horizontal position to place the Game Object and Body. + * @param y The horizontal position to place the Game Object and Body. + * @param enableGameObject Also activate this Game Object. + * @param showGameObject Also show this Game Object. + */ + enableBody(reset: boolean, x: number, y: number, enableGameObject: boolean, showGameObject: boolean): this; + /** + * Stops and disables this Game Object's Body. + * @param disableGameObject Also deactivate this Game Object. Default false. + * @param hideGameObject Also hide this Game Object. Default false. + */ + disableBody(disableGameObject?: boolean, hideGameObject?: boolean): this; + /** + * Syncs the Body's position and size with its parent Game Object. + * You don't need to call this for Dynamic Bodies, as it happens automatically. + * But for Static bodies it's a useful way of modifying the position of a Static Body + * in the Physics World, based on its Game Object. + */ + refreshBody(): this; + } + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. The higher than friction, the faster the body will slow down once force stops being applied to it. + */ + interface Friction { + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of horizontal friction to apply. + * @param y The amount of vertical friction to apply. Default x. + */ + setFriction(x: number, y?: number): this; + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionX(x: number): this; + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionY(x: number): this; + } + + /** + * Provides methods for setting the gravity properties of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Gravity { + /** + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. + * @param x The gravitational force to be applied to the X-axis. + * @param y The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. Default x. + */ + setGravity(x: number, y?: number): this; + /** + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param x The gravitational force to be applied to the X-axis. + */ + setGravityX(x: number): this; + /** + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param y The gravitational force to be applied to the Y-axis. + */ + setGravityY(y: number): this; + } + + /** + * Provides methods used for setting the immovable properties of an Arcade Physics Body. + */ + interface Immovable { + /** + * Sets Whether this Body can be moved by collisions with another Body. + * @param value Sets if this body can be moved by collisions with another Body. Default true. + */ + setImmovable(value?: boolean): this; + } + + /** + * Provides methods used for setting the mass properties of an Arcade Physics Body. + */ + interface Mass { + /** + * Sets the mass of the physics body + * @param value New value for the mass of the body. + */ + setMass(value: number): this; + } + + /** + * This method will search the given rectangular area and return an array of all physics bodies that + * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. + * + * A body only has to intersect with the search area to be considered, it doesn't have to be fully + * contained within it. + * + * If Arcade Physics is set to use the RTree (which it is by default) then the search for is extremely fast, + * otherwise the search is O(N) for Dynamic Bodies. + */ + interface OverlapRect { + } + + /** + * Provides methods for setting the size of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Size { + /** + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. + * @param x The amount to offset the body from the parent Game Object along the x-axis. + * @param y The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. Default x. + */ + setOffset(x: number, y?: number): this; + /** + * Sets the size of this physics body. Setting the size does not adjust the dimensions + * of the parent Game Object. + * @param width The new width of the physics body, in pixels. + * @param height The new height of the physics body, in pixels. + * @param center Should the body be re-positioned so its center aligns with the parent Game Object? Default true. + */ + setSize(width: number, height: number, center?: boolean): this; + /** + * Sets this physics body to use a circle for collision instead of a rectangle. + * @param radius The radius of the physics body, in pixels. + * @param offsetX The amount to offset the body from the parent Game Object along the x-axis. + * @param offsetY The amount to offset the body from the parent Game Object along the y-axis. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): this; + } + + /** + * Provides methods for modifying the velocity of an Arcade Physics body. + * + * Should be applied as a mixin and not used directly. + */ + interface Velocity { + /** + * Sets the velocity of the Body. + * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. + * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. + */ + setVelocity(x: number, y?: number): this; + /** + * Sets the horizontal component of the body's velocity. + * + * Positive values move the body to the right, while negative values move it to the left. + * @param x The new horizontal velocity. + */ + setVelocityX(x: number): this; + /** + * Sets the vertical component of the body's velocity. + * + * Positive values move the body down, while negative values move it up. + * @param y The new vertical velocity of the body. + */ + setVelocityY(y: number): this; + /** + * Sets the maximum velocity of the body. + * @param x The new maximum horizontal velocity. + * @param y The new maximum vertical velocity. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + } + + } + + /** + * Dynamic Body. + */ + var DYNAMIC_BODY: number; + + /** + * Static Body. + */ + var STATIC_BODY: number; + + /** + * Arcade Physics Group containing Dynamic Bodies. + */ + var GROUP: number; + + /** + * A Tilemap Layer. + */ + var TILEMAPLAYER: number; + + /** + * Facing no direction (initial value). + */ + var FACING_NONE: number; + + /** + * Facing up. + */ + var FACING_UP: number; + + /** + * Facing down. + */ + var FACING_DOWN: number; + + /** + * Facing left. + */ + var FACING_LEFT: number; + + /** + * Facing right. + */ + var FACING_RIGHT: number; + + namespace Events { + /** + * The Arcade Physics World Collide Event. + * + * This event is dispatched by an Arcade Physics World instance if two bodies collide _and_ at least + * one of them has their [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('collide', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const COLLIDE: any; + + /** + * The Arcade Physics World Overlap Event. + * + * This event is dispatched by an Arcade Physics World instance if two bodies overlap _and_ at least + * one of them has their [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. + * + * It provides an alternative means to handling overlap events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('overlap', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const OVERLAP: any; + + /** + * The Arcade Physics World Pause Event. + * + * This event is dispatched by an Arcade Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`. + */ + const PAUSE: any; + + /** + * The Arcade Physics World Resume Event. + * + * This event is dispatched by an Arcade Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`. + */ + const RESUME: any; + + /** + * The Arcade Physics Tile Collide Event. + * + * This event is dispatched by an Arcade Physics World instance if a body collides with a Tile _and_ + * has its [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('tilecollide', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const TILE_COLLIDE: any; + + /** + * The Arcade Physics Tile Overlap Event. + * + * This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile _and_ + * has its [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. + * + * It provides an alternative means to handling overlap events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('tileoverlap', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const TILE_OVERLAP: any; + + /** + * The Arcade Physics World Bounds Event. + * + * This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds _and_ + * it has its [onWorldBounds]{@link Phaser.Physics.Arcade.Body#onWorldBounds} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`. + */ + const WORLD_BOUNDS: any; + + /** + * The Arcade Physics World Step Event. + * + * This event is dispatched by an Arcade Physics World instance whenever a physics step is run. + * It is emitted _after_ the bodies and colliders have been updated. + * + * In high framerate settings this can be multiple times per game frame. + * + * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. + */ + const WORLD_STEP: any; + + } + + /** + * The Arcade Physics Factory allows you to easily create Arcade Physics enabled Game Objects. + * Objects that are created by this Factory are automatically added to the physics world. + */ + class Factory { + /** + * + * @param world The Arcade Physics World instance. + */ + constructor(world: Phaser.Physics.Arcade.World); + + /** + * A reference to the Arcade Physics World. + */ + world: Phaser.Physics.Arcade.World; + + /** + * A reference to the Scene this Arcade Physics instance belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems this Arcade Physics instance belongs to. + */ + sys: Phaser.Scenes.Systems; + + /** + * Creates a new Arcade Physics Collider object. + * @param object1 The first object to check for collision. + * @param object2 The second object to check for collision. + * @param collideCallback The callback to invoke when the two objects collide. + * @param processCallback The callback to invoke when the two objects collide. Must return a boolean. + * @param callbackContext The scope in which to call the callbacks. + */ + collider(object1: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], object2: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): Phaser.Physics.Arcade.Collider; + + /** + * Creates a new Arcade Physics Collider Overlap object. + * @param object1 The first object to check for overlap. + * @param object2 The second object to check for overlap. + * @param collideCallback The callback to invoke when the two objects collide. + * @param processCallback The callback to invoke when the two objects collide. Must return a boolean. + * @param callbackContext The scope in which to call the callbacks. + */ + overlap(object1: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], object2: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): Phaser.Physics.Arcade.Collider; + + /** + * Adds an Arcade Physics Body to the given Game Object. + * @param gameObject A Game Object. + * @param isStatic Create a Static body (true) or Dynamic body (false). Default false. + */ + existing(gameObject: Phaser.GameObjects.GameObject, isStatic?: boolean): Phaser.GameObjects.GameObject; + + /** + * Creates a new Arcade Image object with a Static body. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + staticImage(x: number, y: number, texture: string, frame?: string | integer): Phaser.Physics.Arcade.Image; + + /** + * Creates a new Arcade Image object with a Dynamic body. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + image(x: number, y: number, texture: string, frame?: string | integer): Phaser.Physics.Arcade.Image; + + /** + * Creates a new Arcade Sprite object with a Static body. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + staticSprite(x: number, y: number, texture: string, frame?: string | integer): Phaser.Physics.Arcade.Sprite; + + /** + * Creates a new Arcade Sprite object with a Dynamic body. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + sprite(x: number, y: number, key: string, frame?: string | integer): Phaser.Physics.Arcade.Sprite; + + /** + * Creates a Static Physics Group object. + * All Game Objects created by this Group will automatically be static Arcade Physics objects. + * @param children Game Objects to add to this group; or the `config` argument. + * @param config Settings for this group. + */ + staticGroup(children?: Phaser.GameObjects.GameObject[] | Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.Physics.Arcade.StaticGroup; + + /** + * Creates a Physics Group object. + * All Game Objects created by this Group will automatically be dynamic Arcade Physics objects. + * @param children Game Objects to add to this group; or the `config` argument. + * @param config Settings for this group. + */ + group(children?: Phaser.GameObjects.GameObject[] | Phaser.Types.Physics.Arcade.PhysicsGroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.Physics.Arcade.PhysicsGroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.Physics.Arcade.Group; + + /** + * Destroys this Factory. + */ + destroy(): void; + + } + + /** + * Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties + * accordingly, including: `touching.left`, `touching.right`, `touching.none` and `overlapX'. + * @param body1 The first Body to separate. + * @param body2 The second Body to separate. + * @param overlapOnly Is this an overlap only check, or part of separation? + * @param bias A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding). + */ + function GetOverlapX(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly: boolean, bias: number): number; + + /** + * Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties + * accordingly, including: `touching.up`, `touching.down`, `touching.none` and `overlapY'. + * @param body1 The first Body to separate. + * @param body2 The second Body to separate. + * @param overlapOnly Is this an overlap only check, or part of separation? + * @param bias A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding). + */ + function GetOverlapY(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly: boolean, bias: number): number; + + /** + * An Arcade Physics Group object. + * + * All Game Objects created by this Group will automatically be given dynamic Arcade Physics bodies. + * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticGroup}. + */ + class Group extends Phaser.GameObjects.Group { + /** + * + * @param world The physics simulation. + * @param scene The scene this group belongs to. + * @param children Game Objects to add to this group; or the `config` argument. + * @param config Settings for this group. + */ + constructor(world: Phaser.Physics.Arcade.World, scene: Phaser.Scene, children?: Phaser.GameObjects.GameObject[] | Phaser.Types.Physics.Arcade.PhysicsGroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.Physics.Arcade.PhysicsGroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig); + + /** + * The physics simulation. + */ + world: Phaser.Physics.Arcade.World; + + /** + * The class to create new Group members from. + * + * This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those. + */ + classType: Function; + + /** + * The physics type of the Group's members. + */ + physicsType: integer; + + /** + * Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument. + */ + defaults: Phaser.Types.Physics.Arcade.PhysicsGroupDefaults; + + /** + * Enables a Game Object's Body and assigns `defaults`. Called when a Group member is added or created. + * @param child The Game Object being added. + */ + createCallbackHandler(child: Phaser.GameObjects.GameObject): void; + + /** + * Disables a Game Object's Body. Called when a Group member is removed. + * @param child The Game Object being removed. + */ + removeCallbackHandler(child: Phaser.GameObjects.GameObject): void; + + /** + * Sets the velocity of each Group member. + * @param x The horizontal velocity. + * @param y The vertical velocity. + * @param step The velocity increment. When set, the first member receives velocity (x, y), the second (x + step, y + step), and so on. Default 0. + */ + setVelocity(x: number, y: number, step?: number): Phaser.Physics.Arcade.Group; + + /** + * Sets the horizontal velocity of each Group member. + * @param value The velocity value. + * @param step The velocity increment. When set, the first member receives velocity (x), the second (x + step), and so on. Default 0. + */ + setVelocityX(value: number, step?: number): Phaser.Physics.Arcade.Group; + + /** + * Sets the vertical velocity of each Group member. + * @param value The velocity value. + * @param step The velocity increment. When set, the first member receives velocity (y), the second (y + step), and so on. Default 0. + */ + setVelocityY(value: number, step?: number): Phaser.Physics.Arcade.Group; + + } + + /** + * Separates two overlapping bodies on the X-axis (horizontally). + * + * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection. + * + * The bodies won't be separated if there is no horizontal overlap between them, if they are static, or if either one uses custom logic for its separation. + * @param body1 The first Body to separate. + * @param body2 The second Body to separate. + * @param overlapOnly If `true`, the bodies will only have their overlap data set and no separation will take place. + * @param bias A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. + */ + function SeparateX(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly: boolean, bias: number): boolean; + + /** + * Separates two overlapping bodies on the Y-axis (vertically). + * + * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection. + * + * The bodies won't be separated if there is no vertical overlap between them, if they are static, or if either one uses custom logic for its separation. + * @param body1 The first Body to separate. + * @param body2 The second Body to separate. + * @param overlapOnly If `true`, the bodies will only have their overlap data set and no separation will take place. + * @param bias A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. + */ + function SeparateY(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly: boolean, bias: number): boolean; + + /** + * A Static Arcade Physics Body. + * + * A Static Body never moves, and isn't automatically synchronized with its parent Game Object. + * That means if you make any change to the parent's origin, position, or scale after creating or adding the body, you'll need to update the Body manually. + * + * A Static Body can collide with other Bodies, but is never moved by collisions. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Body}. + */ + class StaticBody { + /** + * + * @param world The Arcade Physics simulation this Static Body belongs to. + * @param gameObject The Game Object this Static Body belongs to. + */ + constructor(world: Phaser.Physics.Arcade.World, gameObject: Phaser.GameObjects.GameObject); + + /** + * The Arcade Physics simulation this Static Body belongs to. + */ + world: Phaser.Physics.Arcade.World; + + /** + * The Game Object this Static Body belongs to. + */ + gameObject: Phaser.GameObjects.GameObject; + + /** + * Whether the Static Body's boundary is drawn to the debug display. + */ + debugShowBody: boolean; + + /** + * The color of this Static Body on the debug display. + */ + debugBodyColor: integer; + + /** + * Whether this Static Body is updated by the physics simulation. + */ + enable: boolean; + + /** + * Whether this Static Body's boundary is circular (`true`) or rectangular (`false`). + */ + isCircle: boolean; + + /** + * If this Static Body is circular, this is the unscaled radius of the Static Body's boundary, as set by {@link #setCircle}, in source pixels. + * The true radius is equal to `halfWidth`. + */ + radius: number; + + /** + * The offset of this Static Body's actual position from any updated position. + * + * Unlike a dynamic Body, a Static Body does not follow its Game Object. As such, this offset is only applied when resizing the Static Body. + */ + offset: Phaser.Math.Vector2; + + /** + * The position of this Static Body within the simulation. + */ + position: Phaser.Math.Vector2; + + /** + * The width of the Static Body's boundary, in pixels. + * If the Static Body is circular, this is also the Static Body's diameter. + */ + width: number; + + /** + * The height of the Static Body's boundary, in pixels. + * If the Static Body is circular, this is also the Static Body's diameter. + */ + height: number; + + /** + * Half the Static Body's width, in pixels. + * If the Static Body is circular, this is also the Static Body's radius. + */ + halfWidth: number; + + /** + * Half the Static Body's height, in pixels. + * If the Static Body is circular, this is also the Static Body's radius. + */ + halfHeight: number; + + /** + * The center of the Static Body's boundary. + * This is the midpoint of its `position` (top-left corner) and its bottom-right corner. + */ + center: Phaser.Math.Vector2; + + /** + * A constant zero velocity used by the Arcade Physics simulation for calculations. + */ + readonly velocity: Phaser.Math.Vector2; + + /** + * A constant `false` value expected by the Arcade Physics simulation. + */ + readonly allowGravity: boolean; + + /** + * Gravitational force applied specifically to this Body. Values are in pixels per second squared. Always zero for a Static Body. + */ + readonly gravity: Phaser.Math.Vector2; + + /** + * Rebound, or restitution, following a collision, relative to 1. Always zero for a Static Body. + */ + readonly bounce: Phaser.Math.Vector2; + + /** + * Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary. + * Always false for a Static Body. (Static Bodies never collide with the world boundary and never trigger a `worldbounds` event.) + */ + readonly onWorldBounds: boolean; + + /** + * Whether the simulation emits a `collide` event when this StaticBody collides with another. + */ + onCollide: boolean; + + /** + * Whether the simulation emits an `overlap` event when this StaticBody overlaps with another. + */ + onOverlap: boolean; + + /** + * The StaticBody's inertia, relative to a default unit (1). With `bounce`, this affects the exchange of momentum (velocities) during collisions. + */ + mass: number; + + /** + * Whether this object can be moved by collisions with another body. + */ + immovable: boolean; + + /** + * A flag disabling the default horizontal separation of colliding bodies. Pass your own `collideHandler` to the collider. + */ + customSeparateX: boolean; + + /** + * A flag disabling the default vertical separation of colliding bodies. Pass your own `collideHandler` to the collider. + */ + customSeparateY: boolean; + + /** + * The amount of horizontal overlap (before separation), if this Body is colliding with another. + */ + overlapX: number; + + /** + * The amount of vertical overlap (before separation), if this Body is colliding with another. + */ + overlapY: number; + + /** + * The amount of overlap (before separation), if this StaticBody is circular and colliding with another circular body. + */ + overlapR: number; + + /** + * Whether this StaticBody has ever overlapped with another while both were not moving. + */ + embedded: boolean; + + /** + * Whether this StaticBody interacts with the world boundary. + * Always false for a Static Body. (Static Bodies never collide with the world boundary.) + */ + readonly collideWorldBounds: boolean; + + /** + * Whether this StaticBody is checked for collisions and for which directions. You can set `checkCollision.none = false` to disable collision checks. + */ + checkCollision: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this StaticBody has ever collided with another body and in which direction. + */ + touching: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this StaticBody was colliding with another body during the last step or any previous step, and in which direction. + */ + wasTouching: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this StaticBody has ever collided with a tile or the world boundary. + */ + blocked: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * The StaticBody's physics type (static by default). + */ + physicsType: integer; + + /** + * Changes the Game Object this Body is bound to. + * First it removes its reference from the old Game Object, then sets the new one. + * You can optionally update the position and dimensions of this Body to reflect that of the new Game Object. + * @param gameObject The new Game Object that will own this Body. + * @param update Reposition and resize this Body to match the new Game Object? Default true. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, update?: boolean): Phaser.Physics.Arcade.StaticBody; + + /** + * Updates this Static Body so that its position and dimensions are updated + * based on the current Game Object it is bound to. + */ + updateFromGameObject(): Phaser.Physics.Arcade.StaticBody; + + /** + * Sets the offset of the body. + * @param x The horizontal offset of the Body from the Game Object's center. + * @param y The vertical offset of the Body from the Game Object's center. + */ + setOffset(x: number, y: number): Phaser.Physics.Arcade.StaticBody; + + /** + * Sets the size of the body. + * Resets the width and height to match current frame, if no width and height provided and a frame is found. + * @param width The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param height The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param center Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. Default true. + */ + setSize(width?: integer, height?: integer, center?: boolean): Phaser.Physics.Arcade.StaticBody; + + /** + * Sets this Static Body to have a circular body and sets its sizes and position. + * @param radius The radius of the StaticBody, in pixels. + * @param offsetX The horizontal offset of the StaticBody from its Game Object, in pixels. + * @param offsetY The vertical offset of the StaticBody from its Game Object, in pixels. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): Phaser.Physics.Arcade.StaticBody; + + /** + * Updates the StaticBody's `center` from its `position` and dimensions. + */ + updateCenter(): void; + + /** + * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates. + * Similar to `updateFromGameObject`, but doesn't modify the Body's dimensions. + * @param x The x coordinate to reset the body to. If not given will use the parent Game Object's coordinate. + * @param y The y coordinate to reset the body to. If not given will use the parent Game Object's coordinate. + */ + reset(x?: number, y?: number): void; + + /** + * NOOP function. A Static Body cannot be stopped. + */ + stop(): Phaser.Physics.Arcade.StaticBody; + + /** + * Returns the x and y coordinates of the top left and bottom right points of the StaticBody. + * @param obj The object which will hold the coordinates of the bounds. + */ + getBounds(obj: Phaser.Types.Physics.Arcade.ArcadeBodyBounds): Phaser.Types.Physics.Arcade.ArcadeBodyBounds; + + /** + * Checks to see if a given x,y coordinate is colliding with this Static Body. + * @param x The x coordinate to check against this body. + * @param y The y coordinate to check against this body. + */ + hitTest(x: number, y: number): boolean; + + /** + * NOOP + */ + postUpdate(): void; + + /** + * The absolute (non-negative) change in this StaticBody's horizontal position from the previous step. Always zero. + */ + deltaAbsX(): number; + + /** + * The absolute (non-negative) change in this StaticBody's vertical position from the previous step. Always zero. + */ + deltaAbsY(): number; + + /** + * The change in this StaticBody's horizontal position from the previous step. Always zero. + */ + deltaX(): number; + + /** + * The change in this StaticBody's vertical position from the previous step. Always zero. + */ + deltaY(): number; + + /** + * The change in this StaticBody's rotation from the previous step. Always zero. + */ + deltaZ(): number; + + /** + * Disables this Body and marks it for destruction during the next step. + */ + destroy(): void; + + /** + * Draws a graphical representation of the StaticBody for visual debugging purposes. + * @param graphic The Graphics object to use for the debug drawing of the StaticBody. + */ + drawDebug(graphic: Phaser.GameObjects.Graphics): void; + + /** + * Indicates whether the StaticBody is going to be showing a debug visualization during postUpdate. + */ + willDrawDebug(): boolean; + + /** + * Sets the Mass of the StaticBody. Will set the Mass to 0.1 if the value passed is less than or equal to zero. + * @param value The value to set the Mass to. Values of zero or less are changed to 0.1. + */ + setMass(value: number): Phaser.Physics.Arcade.StaticBody; + + /** + * The x coordinate of the StaticBody. + */ + x: number; + + /** + * The y coordinate of the StaticBody. + */ + y: number; + + /** + * Returns the left-most x coordinate of the area of the StaticBody. + */ + readonly left: number; + + /** + * The right-most x coordinate of the area of the StaticBody. + */ + readonly right: number; + + /** + * The highest y coordinate of the area of the StaticBody. + */ + readonly top: number; + + /** + * The lowest y coordinate of the area of the StaticBody. (y + height) + */ + readonly bottom: number; + + } + + /** + * An Arcade Physics Static Group object. + * + * All Game Objects created by this Group will automatically be given static Arcade Physics bodies. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Group}. + */ + class StaticGroup extends Phaser.GameObjects.Group { + /** + * + * @param world The physics simulation. + * @param scene The scene this group belongs to. + * @param children Game Objects to add to this group; or the `config` argument. + * @param config Settings for this group. + */ + constructor(world: Phaser.Physics.Arcade.World, scene: Phaser.Scene, children?: Phaser.GameObjects.GameObject[] | Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig); + + /** + * The physics simulation. + */ + world: Phaser.Physics.Arcade.World; + + /** + * The scene this group belongs to. + */ + physicsType: integer; + + /** + * Adds a static physics body to the new group member (if it lacks one) and adds it to the simulation. + * @param child The new group member. + */ + createCallbackHandler(child: Phaser.GameObjects.GameObject): void; + + /** + * Disables the group member's physics body, removing it from the simulation. + * @param child The group member being removed. + */ + removeCallbackHandler(child: Phaser.GameObjects.GameObject): void; + + /** + * Refreshes the group. + * @param entries The newly created group members. + */ + createMultipleCallbackHandler(entries: Phaser.GameObjects.GameObject[]): void; + + /** + * Resets each Body to the position of its parent Game Object. + * Body sizes aren't changed (use {@link Phaser.Physics.Arcade.Components.Enable#refreshBody} for that). + */ + refresh(): Phaser.Physics.Arcade.StaticGroup; + + } + + namespace Tilemap { + /** + * A function to process the collision callbacks between a single tile and an Arcade Physics enabled Game Object. + * @param tile The Tile to process. + * @param sprite The Game Object to process with the Tile. + */ + function ProcessTileCallbacks(tile: Phaser.Tilemaps.Tile, sprite: Phaser.GameObjects.Sprite): boolean; + + /** + * Internal function to process the separation of a physics body from a tile. + * @param body The Body object to separate. + * @param x The x separation amount. + */ + function ProcessTileSeparationX(body: Phaser.Physics.Arcade.Body, x: number): void; + + /** + * Internal function to process the separation of a physics body from a tile. + * @param body The Body object to separate. + * @param y The y separation amount. + */ + function ProcessTileSeparationY(body: Phaser.Physics.Arcade.Body, y: number): void; + + /** + * The core separation function to separate a physics body and a tile. + * @param i The index of the tile within the map data. + * @param body The Body object to separate. + * @param tile The tile to collide against. + * @param tileWorldRect A rectangle-like object defining the dimensions of the tile. + * @param tilemapLayer The tilemapLayer to collide against. + * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? + */ + function SeparateTile(i: number, body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileWorldRect: Phaser.Geom.Rectangle, tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, tileBias: number, isLayer: boolean): boolean; + + /** + * Check the body against the given tile on the X axis. + * Used internally by the SeparateTile function. + * @param body The Body object to separate. + * @param tile The tile to check. + * @param tileLeft The left position of the tile within the tile world. + * @param tileRight The right position of the tile within the tile world. + * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? + */ + function TileCheckX(body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileLeft: number, tileRight: number, tileBias: number, isLayer: boolean): number; + + /** + * Check the body against the given tile on the Y axis. + * Used internally by the SeparateTile function. + * @param body The Body object to separate. + * @param tile The tile to check. + * @param tileTop The top position of the tile within the tile world. + * @param tileBottom The bottom position of the tile within the tile world. + * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? + */ + function TileCheckY(body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileTop: number, tileBottom: number, tileBias: number, isLayer: boolean): number; + + /** + * Checks for intersection between the given tile rectangle-like object and an Arcade Physics body. + * @param tileWorldRect A rectangle object that defines the tile placement in the world. + * @param body The body to check for intersection against. + */ + function TileIntersectsBody(tileWorldRect: Object, body: Phaser.Physics.Arcade.Body): boolean; + + } + + /** + * The Arcade Physics World. + * + * The World is responsible for creating, managing, colliding and updating all of the bodies within it. + * + * An instance of the World belongs to a Phaser.Scene and is accessed via the property `physics.world`. + */ + class World extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene to which this World instance belongs. + * @param config An Arcade Physics Configuration object. + */ + constructor(scene: Phaser.Scene, config: Phaser.Types.Physics.Arcade.ArcadeWorldConfig); + + /** + * The Scene this simulation belongs to. + */ + scene: Phaser.Scene; + + /** + * Dynamic Bodies in this simulation. + */ + bodies: Phaser.Structs.Set; + + /** + * Static Bodies in this simulation. + */ + staticBodies: Phaser.Structs.Set; + + /** + * Static Bodies marked for deletion. + */ + pendingDestroy: Phaser.Structs.Set<(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)>; + + /** + * This simulation's collision processors. + */ + colliders: Phaser.Structs.ProcessQueue; + + /** + * Acceleration of Bodies due to gravity, in pixels per second. + */ + gravity: Phaser.Math.Vector2; + + /** + * A boundary constraining Bodies. + */ + bounds: Phaser.Geom.Rectangle; + + /** + * The boundary edges that Bodies can collide with. + */ + checkCollision: Phaser.Types.Physics.Arcade.CheckCollisionObject; + + /** + * The number of physics steps to be taken per second. + * + * This property is read-only. Use the `setFPS` method to modify it at run-time. + */ + readonly fps: number; + + /** + * The number of steps that took place in the last frame. + */ + readonly stepsLastFrame: number; + + /** + * Scaling factor applied to the frame rate. + * + * - 1.0 = normal speed + * - 2.0 = half speed + * - 0.5 = double speed + */ + timeScale: number; + + /** + * The maximum absolute difference of a Body's per-step velocity and its overlap with another Body that will result in separation on *each axis*. + * Larger values favor separation. + * Smaller values favor no separation. + */ + OVERLAP_BIAS: number; + + /** + * The maximum absolute value of a Body's overlap with a tile that will result in separation on *each axis*. + * Larger values favor separation. + * Smaller values favor no separation. + * The optimum value may be similar to the tile size. + */ + TILE_BIAS: number; + + /** + * Always separate overlapping Bodies horizontally before vertically. + * False (the default) means Bodies are first separated on the axis of greater gravity, or the vertical axis if neither is greater. + */ + forceX: boolean; + + /** + * Whether the simulation advances with the game loop. + */ + isPaused: boolean; + + /** + * Enables the debug display. + */ + drawDebug: boolean; + + /** + * The graphics object drawing the debug display. + */ + debugGraphic: Phaser.GameObjects.Graphics; + + /** + * Default debug display settings for new Bodies. + */ + defaults: Phaser.Types.Physics.Arcade.ArcadeWorldDefaults; + + /** + * The maximum number of items per node on the RTree. + * + * This is ignored if `useTree` is `false`. If you have a large number of bodies in + * your world then you may find search performance improves by increasing this value, + * to allow more items per node and less node division. + */ + maxEntries: integer; + + /** + * Should this Arcade Physics World use an RTree for Dynamic and Static Physics bodies? + * + * An RTree is a fast way of spatially sorting of all the bodies in the world. + * However, at certain limits, the cost of clearing and inserting the bodies into the + * tree every frame becomes more expensive than the search speed gains it provides. + * + * If you have a large number of dynamic bodies in your world then it may be best to + * disable the use of the RTree by setting this property to `false` in the physics config. + * + * The number it can cope with depends on browser and device, but a conservative estimate + * of around 5,000 bodies should be considered the max before disabling it. + * + * This only applies to dynamic bodies. Static bodies are always kept in an RTree, + * because they don't have to be cleared every frame, so you benefit from the + * massive search speeds all the time. + */ + useTree: boolean; + + /** + * The spatial index of Dynamic Bodies. + */ + tree: Phaser.Structs.RTree; + + /** + * The spatial index of Static Bodies. + */ + staticTree: Phaser.Structs.RTree; + + /** + * Recycled input for tree searches. + */ + treeMinMax: Phaser.Types.Physics.Arcade.ArcadeWorldTreeMinMax; + + /** + * Adds an Arcade Physics Body to a Game Object, an array of Game Objects, or the children of a Group. + * + * The difference between this and the `enableBody` method is that you can pass arrays or Groups + * to this method. + * + * You can specify if the bodies are to be Dynamic or Static. A dynamic body can move via velocity and + * acceleration. A static body remains fixed in place and as such is able to use an optimized search + * tree, making it ideal for static elements such as level objects. You can still collide and overlap + * with static bodies. + * + * Normally, rather than calling this method directly, you'd use the helper methods available in the + * Arcade Physics Factory, such as: + * + * ```javascript + * this.physics.add.image(x, y, textureKey); + * this.physics.add.sprite(x, y, textureKey); + * ``` + * + * Calling factory methods encapsulates the creation of a Game Object and the creation of its + * body at the same time. If you are creating custom classes then you can pass them to this + * method to have their bodies created. + * @param object The object, or objects, on which to create the bodies. + * @param bodyType The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + */ + enable(object: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], bodyType?: integer): void; + + /** + * Creates an Arcade Physics Body on a single Game Object. + * + * If the Game Object already has a body, this method will simply add it back into the simulation. + * + * You can specify if the body is Dynamic or Static. A dynamic body can move via velocity and + * acceleration. A static body remains fixed in place and as such is able to use an optimized search + * tree, making it ideal for static elements such as level objects. You can still collide and overlap + * with static bodies. + * + * Normally, rather than calling this method directly, you'd use the helper methods available in the + * Arcade Physics Factory, such as: + * + * ```javascript + * this.physics.add.image(x, y, textureKey); + * this.physics.add.sprite(x, y, textureKey); + * ``` + * + * Calling factory methods encapsulates the creation of a Game Object and the creation of its + * body at the same time. If you are creating custom classes then you can pass them to this + * method to have their bodies created. + * @param object The Game Object on which to create the body. + * @param bodyType The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + */ + enableBody(object: Phaser.GameObjects.GameObject, bodyType?: integer): Phaser.GameObjects.GameObject; + + /** + * Adds an existing Arcade Physics Body or StaticBody to the simulation. + * + * The body is enabled and added to the local search trees. + * @param body The Body to be added to the simulation. + */ + add(body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody): Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody; + + /** + * Disables the Arcade Physics Body of a Game Object, an array of Game Objects, or the children of a Group. + * + * The difference between this and the `disableBody` method is that you can pass arrays or Groups + * to this method. + * + * The body itself is not deleted, it just has its `enable` property set to false, which + * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`. + * @param object The object, or objects, on which to disable the bodies. + */ + disable(object: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[]): void; + + /** + * Disables an existing Arcade Physics Body or StaticBody and removes it from the simulation. + * + * The body is disabled and removed from the local search trees. + * + * The body itself is not deleted, it just has its `enable` property set to false, which + * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`. + * @param body The Body to be disabled. + */ + disableBody(body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody): void; + + /** + * Removes an existing Arcade Physics Body or StaticBody from the simulation. + * + * The body is disabled and removed from the local search trees. + * + * The body itself is not deleted, it just has its `enabled` property set to false, which + * means you can re-enable it again at any point by passing it to enable `enable` or `add`. + * @param body The body to be removed from the simulation. + */ + remove(body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody): void; + + /** + * Creates a Graphics Game Object that the world will use to render the debug display to. + * + * This is called automatically when the World is instantiated if the `debug` config property + * was set to `true`. However, you can call it at any point should you need to display the + * debug Graphic from a fixed point. + * + * You can control which objects are drawn to the Graphics object, and the colors they use, + * by setting the debug properties in the physics config. + * + * You should not typically use this in a production game. Use it to aid during debugging. + */ + createDebugGraphic(): Phaser.GameObjects.Graphics; + + /** + * Sets the position, size and properties of the World boundary. + * + * The World boundary is an invisible rectangle that defines the edges of the World. + * If a Body is set to collide with the world bounds then it will automatically stop + * when it reaches any of the edges. You can optionally set which edges of the boundary + * should be checked against. + * @param x The top-left x coordinate of the boundary. + * @param y The top-left y coordinate of the boundary. + * @param width The width of the boundary. + * @param height The height of the boundary. + * @param checkLeft Should bodies check against the left edge of the boundary? + * @param checkRight Should bodies check against the right edge of the boundary? + * @param checkUp Should bodies check against the top edge of the boundary? + * @param checkDown Should bodies check against the bottom edge of the boundary? + */ + setBounds(x: number, y: number, width: number, height: number, checkLeft?: boolean, checkRight?: boolean, checkUp?: boolean, checkDown?: boolean): Phaser.Physics.Arcade.World; + + /** + * Enables or disables collisions on each edge of the World boundary. + * @param left Should bodies check against the left edge of the boundary? Default true. + * @param right Should bodies check against the right edge of the boundary? Default true. + * @param up Should bodies check against the top edge of the boundary? Default true. + * @param down Should bodies check against the bottom edge of the boundary? Default true. + */ + setBoundsCollision(left?: boolean, right?: boolean, up?: boolean, down?: boolean): Phaser.Physics.Arcade.World; + + /** + * Pauses the simulation. + * + * A paused simulation does not update any existing bodies, or run any Colliders. + * + * However, you can still enable and disable bodies within it, or manually run collide or overlap + * checks. + */ + pause(): Phaser.Physics.Arcade.World; + + /** + * Resumes the simulation, if paused. + */ + resume(): Phaser.Physics.Arcade.World; + + /** + * Creates a new Collider object and adds it to the simulation. + * + * A Collider is a way to automatically perform collision checks between two objects, + * calling the collide and process callbacks if they occur. + * + * Colliders are run as part of the World update, after all of the Bodies have updated. + * + * By creating a Collider you don't need then call `World.collide` in your `update` loop, + * as it will be handled for you automatically. + * @param object1 The first object to check for collision. + * @param object2 The second object to check for collision. + * @param collideCallback The callback to invoke when the two objects collide. + * @param processCallback The callback to invoke when the two objects collide. Must return a boolean. + * @param callbackContext The scope in which to call the callbacks. + */ + addCollider(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): Phaser.Physics.Arcade.Collider; + + /** + * Creates a new Overlap Collider object and adds it to the simulation. + * + * A Collider is a way to automatically perform overlap checks between two objects, + * calling the collide and process callbacks if they occur. + * + * Colliders are run as part of the World update, after all of the Bodies have updated. + * + * By creating a Collider you don't need then call `World.overlap` in your `update` loop, + * as it will be handled for you automatically. + * @param object1 The first object to check for overlap. + * @param object2 The second object to check for overlap. + * @param collideCallback The callback to invoke when the two objects overlap. + * @param processCallback The callback to invoke when the two objects overlap. Must return a boolean. + * @param callbackContext The scope in which to call the callbacks. + */ + addOverlap(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): Phaser.Physics.Arcade.Collider; + + /** + * Removes a Collider from the simulation so it is no longer processed. + * + * This method does not destroy the Collider. If you wish to add it back at a later stage you can call + * `World.colliders.add(Collider)`. + * + * If you no longer need the Collider you can call the `Collider.destroy` method instead, which will + * automatically clear all of its references and then remove it from the World. If you call destroy on + * a Collider you _don't_ need to pass it to this method too. + * @param collider The Collider to remove from the simulation. + */ + removeCollider(collider: Phaser.Physics.Arcade.Collider): Phaser.Physics.Arcade.World; + + /** + * Sets the frame rate to run the simulation at. + * + * The frame rate value is used to simulate a fixed update time step. This fixed + * time step allows for a straightforward implementation of a deterministic game state. + * + * This frame rate is independent of the frequency at which the game is rendering. The + * higher you set the fps, the more physics simulation steps will occur per game step. + * Conversely, the lower you set it, the less will take place. + * + * You can optionally advance the simulation directly yourself by calling the `step` method. + * @param framerate The frame rate to advance the simulation at. + */ + setFPS(framerate: integer): this; + + /** + * Advances the simulation based on the elapsed time and fps rate. + * + * This is called automatically by your Scene and does not need to be invoked directly. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected update(time: number, delta: number): void; + + /** + * Advances the simulation by a time increment. + * @param delta The delta time amount, in seconds, by which to advance the simulation. + */ + step(delta: number): void; + + /** + * Updates bodies, draws the debug display, and handles pending queue operations. + */ + postUpdate(): void; + + /** + * Calculates a Body's velocity and updates its position. + * @param body The Body to be updated. + * @param delta The delta value to be used in the motion calculations, in seconds. + */ + updateMotion(body: Phaser.Physics.Arcade.Body, delta: number): void; + + /** + * Calculates a Body's angular velocity. + * @param body The Body to compute the velocity for. + * @param delta The delta value to be used in the calculation, in seconds. + */ + computeAngularVelocity(body: Phaser.Physics.Arcade.Body, delta: number): void; + + /** + * Calculates a Body's per-axis velocity. + * @param body The Body to compute the velocity for. + * @param delta The delta value to be used in the calculation, in seconds. + */ + computeVelocity(body: Phaser.Physics.Arcade.Body, delta: number): void; + + /** + * Separates two Bodies. + * @param body1 The first Body to be separated. + * @param body2 The second Body to be separated. + * @param processCallback The process callback. + * @param callbackContext The context in which to invoke the callback. + * @param overlapOnly If this a collide or overlap check? + */ + separate(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, processCallback?: ArcadePhysicsCallback, callbackContext?: any, overlapOnly?: boolean): boolean; + + /** + * Separates two Bodies, when both are circular. + * @param body1 The first Body to be separated. + * @param body2 The second Body to be separated. + * @param overlapOnly If this a collide or overlap check? + * @param bias A small value added to the calculations. + */ + separateCircle(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly?: boolean, bias?: number): boolean; + + /** + * Checks to see if two Bodies intersect at all. + * @param body1 The first body to check. + * @param body2 The second body to check. + */ + intersects(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body): boolean; + + /** + * Tests if a circular Body intersects with another Body. + * @param circle The circular body to test. + * @param body The rectangular body to test. + */ + circleBodyIntersects(circle: Phaser.Physics.Arcade.Body, body: Phaser.Physics.Arcade.Body): boolean; + + /** + * Tests if Game Objects overlap. + * @param object1 The first object or array of objects to check. + * @param object2 The second object or array of objects to check, or `undefined`. + * @param overlapCallback An optional callback function that is called if the objects overlap. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + overlap(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2?: Phaser.Types.Physics.Arcade.ArcadeColliderType, overlapCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * Performs a collision check and separation between the two physics enabled objects given, which can be single + * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. + * + * If you don't require separation then use {@link #overlap} instead. + * + * If two Groups or arrays are passed, each member of one will be tested against each member of the other. + * + * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members. + * + * If **only** one Array is passed, the array is iterated and every element in it is tested against the others. + * + * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding + * objects are passed to it. + * + * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable + * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. + * The separation that stops two objects penetrating may create a new penetration against a different object. If you + * require a high level of stability please consider using an alternative physics system, such as Matter.js. + * @param object1 The first object or array of objects to check. + * @param object2 The second object or array of objects to check, or `undefined`. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + collide(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2?: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects. + * + * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for collision with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions + * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * + * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have + * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the + * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on + * dynamic maps, this method can prove very useful. + * @param sprite The first object to check for collision. + * @param tiles An array of Tiles to check for collision against. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + collideTiles(sprite: Phaser.GameObjects.GameObject, tiles: Phaser.Tilemaps.Tile[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects. + * + * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap + * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * @param sprite The first object to check for collision. + * @param tiles An array of Tiles to check for collision against. + * @param collideCallback An optional callback function that is called if the objects overlap. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + overlapTiles(sprite: Phaser.GameObjects.GameObject, tiles: Phaser.Tilemaps.Tile[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * Internal handler for Sprite vs. Tilemap collisions. + * Please use Phaser.Physics.Arcade.World#collide instead. + * @param sprite The first object to check for collision. + * @param tilemapLayer The second object to check for collision. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + * @param overlapOnly Whether this is a collision or overlap check. + */ + collideSpriteVsTilemapLayer(sprite: Phaser.GameObjects.GameObject, tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any, overlapOnly?: boolean): boolean; + + /** + * Wrap an object's coordinates (or several objects' coordinates) within {@link Phaser.Physics.Arcade.World#bounds}. + * + * If the object is outside any boundary edge (left, top, right, bottom), it will be moved to the same offset from the opposite edge (the interior). + * @param object A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. + * @param padding An amount added to each boundary edge during the operation. Default 0. + */ + wrap(object: any, padding?: number): void; + + /** + * Wrap each object's coordinates within {@link Phaser.Physics.Arcade.World#bounds}. + * @param objects An array of objects to be wrapped. + * @param padding An amount added to the boundary. Default 0. + */ + wrapArray(objects: any[], padding?: number): void; + + /** + * Wrap an object's coordinates within {@link Phaser.Physics.Arcade.World#bounds}. + * @param object A Game Object, a Physics Body, or any object with `x` and `y` coordinates + * @param padding An amount added to the boundary. Default 0. + */ + wrapObject(object: any, padding?: number): void; + + /** + * Shuts down the simulation, clearing physics data and removing listeners. + */ + shutdown(): void; + + /** + * Shuts down the simulation and disconnects it from the current scene. + */ + destroy(): void; + + } + + } + + /** + * An Impact.js compatible physics world, body and solver, for those who are used + * to the Impact way of defining and controlling physics bodies. Also works with + * the new Loader support for Weltmeister map data. + * + * World updated to run off the Phaser main loop. + * Body extended to support additional setter functions. + * + * To create the map data you'll need Weltmeister, which comes with Impact + * and can be purchased from http://impactjs.com + * + * My thanks to Dominic Szablewski for his permission to support Impact in Phaser. + */ + namespace Impact { + /** + * An Impact.js compatible physics body. + * This re-creates the properties you'd get on an Entity and the math needed to update them. + */ + class Body { + /** + * + * @param world [description] + * @param x [description] + * @param y [description] + * @param sx [description] Default 16. + * @param sy [description] Default 16. + */ + constructor(world: Phaser.Physics.Impact.World, x: number, y: number, sx?: number, sy?: number); + + /** + * [description] + */ + world: Phaser.Physics.Impact.World; + + /** + * [description] + */ + gameObject: Phaser.GameObjects.GameObject; + + /** + * [description] + */ + enabled: boolean; + + /** + * The ImpactBody, ImpactSprite or ImpactImage object that owns this Body, if any. + */ + parent: Phaser.Physics.Impact.ImpactBody | Phaser.Physics.Impact.ImpactImage | Phaser.Physics.Impact.ImpactSprite; + + /** + * [description] + */ + id: integer; + + /** + * [description] + */ + name: string; + + /** + * [description] + */ + size: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + offset: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + pos: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + last: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + vel: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + accel: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + friction: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + maxVel: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + standing: boolean; + + /** + * [description] + */ + gravityFactor: number; + + /** + * [description] + */ + bounciness: number; + + /** + * [description] + */ + minBounceVelocity: number; + + /** + * [description] + */ + accelGround: number; + + /** + * [description] + */ + accelAir: number; + + /** + * [description] + */ + jumpSpeed: number; + + /** + * [description] + */ + type: Phaser.Physics.Impact.TYPE; + + /** + * [description] + */ + checkAgainst: Phaser.Physics.Impact.TYPE; + + /** + * [description] + */ + collides: Phaser.Physics.Impact.COLLIDES; + + /** + * [description] + */ + debugShowBody: boolean; + + /** + * [description] + */ + debugShowVelocity: boolean; + + /** + * [description] + */ + debugBodyColor: integer; + + /** + * [description] + */ + updateCallback: Phaser.Types.Physics.Impact.BodyUpdateCallback; + + /** + * min 44 deg, max 136 deg + */ + slopeStanding: Object; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + reset(x: number, y: number): void; + + /** + * [description] + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(delta: number): void; + + /** + * [description] + * @param graphic [description] + */ + drawDebug(graphic: Phaser.GameObjects.Graphics): void; + + /** + * [description] + */ + willDrawDebug(): boolean; + + /** + * [description] + */ + skipHash(): boolean; + + /** + * Determines whether the body collides with the `other` one or not. + * @param other [description] + */ + touches(other: Phaser.Physics.Impact.Body): boolean; + + /** + * Reset the size and position of the physics body. + * @param x The x coordinate to position the body. + * @param y The y coordinate to position the body. + * @param width The width of the body. + * @param height The height of the body. + */ + resetSize(x: number, y: number, width: number, height: number): Phaser.Physics.Impact.Body; + + /** + * Export this body object to JSON. + */ + toJSON(): Phaser.Types.Physics.Impact.JSONImpactBody; + + /** + * [description] + * @param config [description] + */ + fromJSON(config: object): void; + + /** + * Can be overridden by user code + * @param other [description] + */ + check(other: Phaser.Physics.Impact.Body): void; + + /** + * Can be overridden by user code + * @param other [description] + * @param axis [description] + */ + collideWith(other: Phaser.Physics.Impact.Body, axis: string): void; + + /** + * Can be overridden by user code but must return a boolean. + * @param res [description] + */ + handleMovementTrace(res: number): boolean; + + /** + * [description] + */ + destroy(): void; + + } + + /** + * Collision Types - Determine if and how entities collide with each other. + * + * In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves, + * while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE + * collisions, both entities are moved. LITE or PASSIVE entities don't collide + * with other LITE or PASSIVE entities at all. The behavior for FIXED vs. + * FIXED collisions is undefined. + */ + enum COLLIDES { + /** + * Never collides. + */ + NEVER, + /** + * Lite collision. + */ + LITE, + /** + * Passive collision. + */ + PASSIVE, + /** + * Active collision. + */ + ACTIVE, + /** + * Fixed collision. + */ + FIXED, + } + + /** + * [description] + */ + class CollisionMap { + /** + * + * @param tilesize [description] Default 32. + * @param data [description] + */ + constructor(tilesize?: integer, data?: any[]); + + /** + * [description] + */ + tilesize: integer; + + /** + * [description] + */ + data: any[]; + + /** + * [description] + */ + width: number; + + /** + * [description] + */ + height: number; + + /** + * [description] + */ + lastSlope: integer; + + /** + * [description] + */ + tiledef: object; + + /** + * [description] + * @param x [description] + * @param y [description] + * @param vx [description] + * @param vy [description] + * @param objectWidth [description] + * @param objectHeight [description] + */ + trace(x: number, y: number, vx: number, vy: number, objectWidth: number, objectHeight: number): boolean; + + /** + * [description] + * @param res [description] + * @param x [description] + * @param y [description] + * @param vx [description] + * @param vy [description] + * @param width [description] + * @param height [description] + * @param rvx [description] + * @param rvy [description] + * @param step [description] + */ + step(res: object, x: number, y: number, vx: number, vy: number, width: number, height: number, rvx: number, rvy: number, step: number): void; + + /** + * [description] + * @param res [description] + * @param t [description] + * @param x [description] + * @param y [description] + * @param vx [description] + * @param vy [description] + * @param width [description] + * @param height [description] + * @param tileX [description] + * @param tileY [description] + */ + checkDef(res: object, t: number, x: number, y: number, vx: number, vy: number, width: number, height: number, tileX: number, tileY: number): boolean; + + } + + namespace Components { + /** + * The Impact Acceleration component. + * Should be applied as a mixin. + */ + interface Acceleration { + /** + * Sets the horizontal acceleration of this body. + * @param x The amount of acceleration to apply. + */ + setAccelerationX(x: number): this; + /** + * Sets the vertical acceleration of this body. + * @param y The amount of acceleration to apply. + */ + setAccelerationY(y: number): this; + /** + * Sets the horizontal and vertical acceleration of this body. + * @param x The amount of horizontal acceleration to apply. + * @param y The amount of vertical acceleration to apply. + */ + setAcceleration(x: number, y: number): this; + } + + /** + * The Impact Body Scale component. + * Should be applied as a mixin. + */ + interface BodyScale { + /** + * Sets the size of the physics body. + * @param width The width of the body in pixels. + * @param height The height of the body in pixels. Default width. + */ + setBodySize(width: number, height?: number): this; + /** + * Sets the scale of the physics body. + * @param scaleX The horizontal scale of the body. + * @param scaleY The vertical scale of the body. If not given, will use the horizontal scale value. + */ + setBodyScale(scaleX: number, scaleY?: number): this; + } + + /** + * The Impact Body Type component. + * Should be applied as a mixin. + */ + interface BodyType { + /** + * [description] + */ + getBodyType(): number; + /** + * [description] + */ + setTypeNone(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setTypeA(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setTypeB(): Phaser.GameObjects.GameObject; + } + + /** + * The Impact Bounce component. + * Should be applied as a mixin. + */ + interface Bounce { + /** + * Sets the impact physics bounce, or restitution, value. + * @param value A value between 0 (no rebound) and 1 (full rebound) + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. + * @param value The minimum allowed velocity. + */ + setMinBounceVelocity(value: number): Phaser.GameObjects.GameObject; + /** + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) + */ + bounce: number; + } + + /** + * The Impact Check Against component. + * Should be applied as a mixin. + */ + interface CheckAgainst { + /** + * [description] + */ + setAvsB(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setBvsA(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setCheckAgainstNone(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setCheckAgainstA(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setCheckAgainstB(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + checkAgainst: number; + } + + /** + * The Impact Collides component. + * Should be applied as a mixin. + */ + interface Collides { + /** + * [description] + * @param callback [description] + * @param scope [description] + */ + setCollideCallback(callback: CollideCallback, scope: any): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setCollidesNever(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setLiteCollision(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setPassiveCollision(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setActiveCollision(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setFixedCollision(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + collides: number; + } + + /** + * The Impact Debug component. + * Should be applied as a mixin. + */ + interface Debug { + /** + * [description] + * @param showBody [description] + * @param showVelocity [description] + * @param bodyColor [description] + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): Phaser.GameObjects.GameObject; + /** + * [description] + * @param value [description] + */ + setDebugBodyColor(value: number): Phaser.GameObjects.GameObject; + /** + * [description] + */ + debugShowBody: boolean; + /** + * [description] + */ + debugShowVelocity: boolean; + /** + * [description] + */ + debugBodyColor: number; + } + + /** + * The Impact Friction component. + * Should be applied as a mixin. + */ + interface Friction { + /** + * [description] + * @param x [description] + */ + setFrictionX(x: number): Phaser.GameObjects.GameObject; + /** + * [description] + * @param y [description] + */ + setFrictionY(y: number): Phaser.GameObjects.GameObject; + /** + * [description] + * @param x [description] + * @param y [description] + */ + setFriction(x: number, y: number): Phaser.GameObjects.GameObject; + } + + /** + * The Impact Gravity component. + * Should be applied as a mixin. + */ + interface Gravity { + /** + * [description] + * @param value [description] + */ + setGravity(value: number): Phaser.GameObjects.GameObject; + /** + * [description] + */ + gravity: number; + } + + /** + * The Impact Offset component. + * Should be applied as a mixin. + */ + interface Offset { + /** + * [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + setOffset(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.GameObject; + } + + /** + * The Impact Set Game Object component. + * Should be applied as a mixin. + */ + interface SetGameObject { + /** + * [description] + * @param gameObject [description] + * @param sync [description] Default true. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, sync?: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + */ + syncGameObject(): Phaser.GameObjects.GameObject; + } + + /** + * The Impact Velocity component. + * Should be applied as a mixin. + */ + interface Velocity { + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): this; + /** + * Sets the vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): this; + /** + * Sets the horizontal and vertical velocities of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value. If not given, defaults to the horizontal value. Default x. + */ + setVelocity(x: number, y?: number): this; + /** + * Sets the maximum velocity this body can travel at. + * @param x The maximum allowed horizontal velocity. + * @param y The maximum allowed vertical velocity. If not given, defaults to the horizontal value. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + } + + } + + namespace Events { + /** + * The Impact Physics World Collide Event. + * + * This event is dispatched by an Impact Physics World instance if two bodies collide. + * + * Listen to it from a Scene using: `this.impact.world.on('collide', listener)`. + */ + const COLLIDE: any; + + /** + * The Impact Physics World Pause Event. + * + * This event is dispatched by an Impact Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.impact.world.on('pause', listener)`. + */ + const PAUSE: any; + + /** + * The Impact Physics World Resume Event. + * + * This event is dispatched by an Impact Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.impact.world.on('resume', listener)`. + */ + const RESUME: any; + + } + + /** + * The Impact Physics Factory allows you to easily create Impact Physics enabled Game Objects. + * Objects that are created by this Factory are automatically added to the physics world. + */ + class Factory { + /** + * + * @param world A reference to the Impact Physics world. + */ + constructor(world: Phaser.Physics.Impact.World); + + /** + * A reference to the Impact Physics world. + */ + world: Phaser.Physics.Impact.World; + + /** + * A reference to the Scene.Systems this Impact Physics instance belongs to. + */ + sys: Phaser.Scenes.Systems; + + /** + * Creates a new ImpactBody object and adds it to the physics simulation. + * @param x The horizontal position of the body in the physics world. + * @param y The vertical position of the body in the physics world. + * @param width The width of the body. + * @param height The height of the body. + */ + body(x: number, y: number, width: number, height: number): Phaser.Physics.Impact.ImpactBody; + + /** + * Adds an Impact Physics Body to the given Game Object. + * @param gameObject The Game Object to receive the physics body. + */ + existing(gameObject: Phaser.GameObjects.GameObject): Phaser.GameObjects.GameObject; + + /** + * Creates a new ImpactImage object and adds it to the physics world. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + image(x: number, y: number, key: string, frame?: string | integer): Phaser.Physics.Impact.ImpactImage; + + /** + * Creates a new ImpactSprite object and adds it to the physics world. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + sprite(x: number, y: number, key: string, frame?: string | integer): Phaser.Physics.Impact.ImpactSprite; + + /** + * Destroys this Factory. + */ + destroy(): void; + + } + + /** + * [description] + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + * @param vel [description] + * @param accel [description] + * @param friction [description] + * @param max [description] + */ + function GetVelocity(delta: number, vel: number, accel: number, friction: number, max: number): number; + + /** + * [description] + */ + class ImpactBody implements Phaser.Physics.Impact.Components.Acceleration, Phaser.Physics.Impact.Components.BodyScale, Phaser.Physics.Impact.Components.BodyType, Phaser.Physics.Impact.Components.Bounce, Phaser.Physics.Impact.Components.CheckAgainst, Phaser.Physics.Impact.Components.Collides, Phaser.Physics.Impact.Components.Debug, Phaser.Physics.Impact.Components.Friction, Phaser.Physics.Impact.Components.Gravity, Phaser.Physics.Impact.Components.Offset, Phaser.Physics.Impact.Components.SetGameObject, Phaser.Physics.Impact.Components.Velocity { + /** + * + * @param world [description] + * @param x x - The horizontal position of this physics body in the world. + * @param y y - The vertical position of this physics body in the world. + * @param width The width of the physics body in the world. + * @param height [description] + */ + constructor(world: Phaser.Physics.Impact.World, x: number, y: number, width: number, height: number); + + /** + * [description] + */ + body: Phaser.Physics.Impact.Body; + + /** + * [description] + */ + size: Object; + + /** + * [description] + */ + offset: Object; + + /** + * [description] + */ + vel: Object; + + /** + * [description] + */ + accel: Object; + + /** + * [description] + */ + friction: Object; + + /** + * [description] + */ + maxVel: Object; + + /** + * Sets the horizontal acceleration of this body. + * @param x The amount of acceleration to apply. + */ + setAccelerationX(x: number): this; + + /** + * Sets the vertical acceleration of this body. + * @param y The amount of acceleration to apply. + */ + setAccelerationY(y: number): this; + + /** + * Sets the horizontal and vertical acceleration of this body. + * @param x The amount of horizontal acceleration to apply. + * @param y The amount of vertical acceleration to apply. + */ + setAcceleration(x: number, y: number): this; + + /** + * Sets the size of the physics body. + * @param width The width of the body in pixels. + * @param height The height of the body in pixels. Default width. + */ + setBodySize(width: number, height?: number): this; + + /** + * Sets the scale of the physics body. + * @param scaleX The horizontal scale of the body. + * @param scaleY The vertical scale of the body. If not given, will use the horizontal scale value. + */ + setBodyScale(scaleX: number, scaleY?: number): this; + + /** + * [description] + */ + getBodyType(): number; + + /** + * [description] + */ + setTypeNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeB(): Phaser.GameObjects.GameObject; + + /** + * Sets the impact physics bounce, or restitution, value. + * @param value A value between 0 (no rebound) and 1 (full rebound) + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. + * @param value The minimum allowed velocity. + */ + setMinBounceVelocity(value: number): Phaser.GameObjects.GameObject; + + /** + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) + */ + bounce: number; + + /** + * [description] + */ + setAvsB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setBvsA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + checkAgainst: number; + + /** + * [description] + * @param callback [description] + * @param scope [description] + */ + setCollideCallback(callback: CollideCallback, scope: any): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCollidesNever(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setLiteCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setPassiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setActiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setFixedCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + collides: number; + + /** + * [description] + * @param showBody [description] + * @param showVelocity [description] + * @param bodyColor [description] + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setDebugBodyColor(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + debugShowBody: boolean; + + /** + * [description] + */ + debugShowVelocity: boolean; + + /** + * [description] + */ + debugBodyColor: number; + + /** + * [description] + * @param x [description] + */ + setFrictionX(x: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param y [description] + */ + setFrictionY(y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + setFriction(x: number, y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setGravity(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + gravity: number; + + /** + * [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + setOffset(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param gameObject [description] + * @param sync [description] Default true. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, sync?: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + syncGameObject(): Phaser.GameObjects.GameObject; + + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): this; + + /** + * Sets the vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): this; + + /** + * Sets the horizontal and vertical velocities of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value. If not given, defaults to the horizontal value. Default x. + */ + setVelocity(x: number, y?: number): this; + + /** + * Sets the maximum velocity this body can travel at. + * @param x The maximum allowed horizontal velocity. + * @param y The maximum allowed vertical velocity. If not given, defaults to the horizontal value. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + + } + + /** + * An Impact Physics Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + */ + class ImpactImage extends Phaser.GameObjects.Image implements Phaser.Physics.Impact.Components.Acceleration, Phaser.Physics.Impact.Components.BodyScale, Phaser.Physics.Impact.Components.BodyType, Phaser.Physics.Impact.Components.Bounce, Phaser.Physics.Impact.Components.CheckAgainst, Phaser.Physics.Impact.Components.Collides, Phaser.Physics.Impact.Components.Debug, Phaser.Physics.Impact.Components.Friction, Phaser.Physics.Impact.Components.Gravity, Phaser.Physics.Impact.Components.Offset, Phaser.Physics.Impact.Components.SetGameObject, Phaser.Physics.Impact.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param world The physics world of the Impact physics system. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(world: Phaser.Physics.Impact.World, x: number, y: number, texture: string, frame?: string | integer); + + /** + * The Physics Body linked to an ImpactImage. + */ + body: Phaser.Physics.Impact.Body; + + /** + * The size of the physics Body. + */ + size: Object; + + /** + * The X and Y offset of the Body from the left and top of the Image. + */ + offset: Object; + + /** + * The velocity, or rate of change the Body's position. Measured in pixels per second. + */ + vel: Object; + + /** + * The acceleration is the rate of change of the velocity. Measured in pixels per second squared. + */ + accel: Object; + + /** + * Friction between colliding bodies. + */ + friction: Object; + + /** + * The maximum velocity of the body. + */ + maxVel: Object; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the horizontal acceleration of this body. + * @param x The amount of acceleration to apply. + */ + setAccelerationX(x: number): this; + + /** + * Sets the vertical acceleration of this body. + * @param y The amount of acceleration to apply. + */ + setAccelerationY(y: number): this; + + /** + * Sets the horizontal and vertical acceleration of this body. + * @param x The amount of horizontal acceleration to apply. + * @param y The amount of vertical acceleration to apply. + */ + setAcceleration(x: number, y: number): this; + + /** + * Sets the size of the physics body. + * @param width The width of the body in pixels. + * @param height The height of the body in pixels. Default width. + */ + setBodySize(width: number, height?: number): this; + + /** + * Sets the scale of the physics body. + * @param scaleX The horizontal scale of the body. + * @param scaleY The vertical scale of the body. If not given, will use the horizontal scale value. + */ + setBodyScale(scaleX: number, scaleY?: number): this; + + /** + * [description] + */ + getBodyType(): number; + + /** + * [description] + */ + setTypeNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeB(): Phaser.GameObjects.GameObject; + + /** + * Sets the impact physics bounce, or restitution, value. + * @param value A value between 0 (no rebound) and 1 (full rebound) + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. + * @param value The minimum allowed velocity. + */ + setMinBounceVelocity(value: number): Phaser.GameObjects.GameObject; + + /** + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) + */ + bounce: number; + + /** + * [description] + */ + setAvsB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setBvsA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + checkAgainst: number; + + /** + * [description] + * @param callback [description] + * @param scope [description] + */ + setCollideCallback(callback: CollideCallback, scope: any): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCollidesNever(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setLiteCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setPassiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setActiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setFixedCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + collides: number; + + /** + * [description] + * @param showBody [description] + * @param showVelocity [description] + * @param bodyColor [description] + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setDebugBodyColor(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + debugShowBody: boolean; + + /** + * [description] + */ + debugShowVelocity: boolean; + + /** + * [description] + */ + debugBodyColor: number; + + /** + * [description] + * @param x [description] + */ + setFrictionX(x: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param y [description] + */ + setFrictionY(y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + setFriction(x: number, y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setGravity(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + gravity: number; + + /** + * [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + setOffset(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param gameObject [description] + * @param sync [description] Default true. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, sync?: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + syncGameObject(): Phaser.GameObjects.GameObject; + + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): this; + + /** + * Sets the vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): this; + + /** + * Sets the horizontal and vertical velocities of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value. If not given, defaults to the horizontal value. Default x. + */ + setVelocity(x: number, y?: number): this; + + /** + * Sets the maximum velocity this body can travel at. + * @param x The maximum allowed horizontal velocity. + * @param y The maximum allowed vertical velocity. If not given, defaults to the horizontal value. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + + } + + /** + * [description] + */ + class ImpactPhysics { + /** + * + * @param scene [description] + */ + constructor(scene: Phaser.Scene); + + /** + * [description] + */ + scene: Phaser.Scene; + + /** + * [description] + */ + systems: Phaser.Scenes.Systems; + + /** + * [description] + */ + config: object; + + /** + * [description] + */ + world: Phaser.Physics.Impact.World; + + /** + * [description] + */ + add: Phaser.Physics.Impact.Factory; + + /** + * [description] + */ + getConfig(): object; + + /** + * [description] + */ + pause(): Phaser.Physics.Impact.World; + + /** + * [description] + */ + resume(): Phaser.Physics.Impact.World; + + } + + /** + * An Impact Physics Sprite Game Object. + * + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + */ + class ImpactSprite extends Phaser.GameObjects.Sprite implements Phaser.Physics.Impact.Components.Acceleration, Phaser.Physics.Impact.Components.BodyScale, Phaser.Physics.Impact.Components.BodyType, Phaser.Physics.Impact.Components.Bounce, Phaser.Physics.Impact.Components.CheckAgainst, Phaser.Physics.Impact.Components.Collides, Phaser.Physics.Impact.Components.Debug, Phaser.Physics.Impact.Components.Friction, Phaser.Physics.Impact.Components.Gravity, Phaser.Physics.Impact.Components.Offset, Phaser.Physics.Impact.Components.SetGameObject, Phaser.Physics.Impact.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param world [description] + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(world: Phaser.Physics.Impact.World, x: number, y: number, texture: string, frame?: string | integer); + + /** + * [description] + */ + body: Phaser.Physics.Impact.Body; + + /** + * [description] + */ + size: Object; + + /** + * [description] + */ + offset: Object; + + /** + * [description] + */ + vel: Object; + + /** + * [description] + */ + accel: Object; + + /** + * [description] + */ + friction: Object; + + /** + * [description] + */ + maxVel: Object; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the horizontal acceleration of this body. + * @param x The amount of acceleration to apply. + */ + setAccelerationX(x: number): this; + + /** + * Sets the vertical acceleration of this body. + * @param y The amount of acceleration to apply. + */ + setAccelerationY(y: number): this; + + /** + * Sets the horizontal and vertical acceleration of this body. + * @param x The amount of horizontal acceleration to apply. + * @param y The amount of vertical acceleration to apply. + */ + setAcceleration(x: number, y: number): this; + + /** + * Sets the size of the physics body. + * @param width The width of the body in pixels. + * @param height The height of the body in pixels. Default width. + */ + setBodySize(width: number, height?: number): this; + + /** + * Sets the scale of the physics body. + * @param scaleX The horizontal scale of the body. + * @param scaleY The vertical scale of the body. If not given, will use the horizontal scale value. + */ + setBodyScale(scaleX: number, scaleY?: number): this; + + /** + * [description] + */ + getBodyType(): number; + + /** + * [description] + */ + setTypeNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeB(): Phaser.GameObjects.GameObject; + + /** + * Sets the impact physics bounce, or restitution, value. + * @param value A value between 0 (no rebound) and 1 (full rebound) + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. + * @param value The minimum allowed velocity. + */ + setMinBounceVelocity(value: number): Phaser.GameObjects.GameObject; + + /** + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) + */ + bounce: number; + + /** + * [description] + */ + setAvsB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setBvsA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + checkAgainst: number; + + /** + * [description] + * @param callback [description] + * @param scope [description] + */ + setCollideCallback(callback: CollideCallback, scope: any): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCollidesNever(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setLiteCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setPassiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setActiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setFixedCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + collides: number; + + /** + * [description] + * @param showBody [description] + * @param showVelocity [description] + * @param bodyColor [description] + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setDebugBodyColor(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + debugShowBody: boolean; + + /** + * [description] + */ + debugShowVelocity: boolean; + + /** + * [description] + */ + debugBodyColor: number; + + /** + * [description] + * @param x [description] + */ + setFrictionX(x: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param y [description] + */ + setFrictionY(y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + setFriction(x: number, y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setGravity(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + gravity: number; + + /** + * [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + setOffset(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param gameObject [description] + * @param sync [description] Default true. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, sync?: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + syncGameObject(): Phaser.GameObjects.GameObject; + + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): this; + + /** + * Sets the vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): this; + + /** + * Sets the horizontal and vertical velocities of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value. If not given, defaults to the horizontal value. Default x. + */ + setVelocity(x: number, y?: number): this; + + /** + * Sets the maximum velocity this body can travel at. + * @param x The maximum allowed horizontal velocity. + * @param y The maximum allowed vertical velocity. If not given, defaults to the horizontal value. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + + } + + /** + * [description] + * @param world [description] + * @param left [description] + * @param right [description] + * @param weak [description] + */ + function SeparateX(world: Phaser.Physics.Impact.World, left: Phaser.Physics.Impact.Body, right: Phaser.Physics.Impact.Body, weak?: Phaser.Physics.Impact.Body): void; + + /** + * [description] + * @param world [description] + * @param top [description] + * @param bottom [description] + * @param weak [description] + */ + function SeparateY(world: Phaser.Physics.Impact.World, top: Phaser.Physics.Impact.Body, bottom: Phaser.Physics.Impact.Body, weak?: Phaser.Physics.Impact.Body): void; + + /** + * Impact Physics Solver + * @param world The Impact simulation to run the solver in. + * @param bodyA The first body in the collision. + * @param bodyB The second body in the collision. + */ + function Solver(world: Phaser.Physics.Impact.World, bodyA: Phaser.Physics.Impact.Body, bodyB: Phaser.Physics.Impact.Body): void; + + /** + * Collision Types - Determine if and how entities collide with each other. + * + * In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves, + * while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE + * collisions, both entities are moved. LITE or PASSIVE entities don't collide + * with other LITE or PASSIVE entities at all. The behavior for FIXED vs. + * FIXED collisions is undefined. + */ + enum TYPE { + /** + * Collides with nothing. + */ + NONE, + /** + * Type A. Collides with Type B. + */ + A, + /** + * Type B. Collides with Type A. + */ + B, + /** + * Collides with both types A and B. + */ + BOTH, + } + + /** + * Set up the trace-result + * var res = { + * collision: {x: false, y: false, slope: false}, + * pos: {x: x, y: y}, + * tile: {x: 0, y: 0} + * }; + * @param body [description] + * @param res [description] + */ + function UpdateMotion(body: Phaser.Physics.Impact.Body, res: object): void; + + /** + * [description] + */ + class World extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene to which this Impact World instance belongs. + * @param config [description] + */ + constructor(scene: Phaser.Scene, config: Phaser.Types.Physics.Impact.WorldConfig); + + /** + * [description] + */ + scene: Phaser.Scene; + + /** + * [description] + */ + bodies: Phaser.Structs.Set; + + /** + * [description] + */ + gravity: number; + + /** + * Spatial hash cell dimensions + */ + cellSize: integer; + + /** + * [description] + */ + collisionMap: Phaser.Physics.Impact.CollisionMap; + + /** + * [description] + */ + timeScale: number; + + /** + * Impacts maximum time step is 20 fps. + */ + maxStep: number; + + /** + * [description] + */ + enabled: boolean; + + /** + * [description] + */ + drawDebug: boolean; + + /** + * [description] + */ + debugGraphic: Phaser.GameObjects.Graphics; + + /** + * [description] + */ + defaults: Phaser.Types.Physics.Impact.WorldDefaults; + + /** + * An object containing the 4 wall bodies that bound the physics world. + */ + walls: Phaser.Types.Physics.Impact.WorldWalls; + + /** + * [description] + */ + delta: number; + + /** + * Sets the collision map for the world either from a Weltmeister JSON level in the cache or from + * a 2D array. If loading from a Weltmeister level, the map must have a layer called "collision". + * @param key Either a string key that corresponds to a Weltmeister level + * in the cache, or a 2D array of collision IDs. + * @param tileSize The size of a tile. This is optional if loading from a Weltmeister + * level in the cache. + */ + setCollisionMap(key: string | integer[][], tileSize: integer): Phaser.Physics.Impact.CollisionMap; + + /** + * Sets the collision map for the world from a tilemap layer. Only tiles that are marked as + * colliding will be used. You can specify the mapping from tiles to slope IDs in a couple of + * ways. The easiest is to use Tiled and the slopeTileProperty option. Alternatively, you can + * manually create a slopeMap that stores the mapping between tile indices and slope IDs. + * @param tilemapLayer The tilemap layer to use. + * @param options Options for controlling the mapping from tiles to slope IDs. + */ + setCollisionMapFromTilemapLayer(tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, options?: Phaser.Types.Physics.Impact.CollisionOptions): Phaser.Physics.Impact.CollisionMap; + + /** + * Sets the bounds of the Physics world to match the given world pixel dimensions. + * You can optionally set which 'walls' to create: left, right, top or bottom. + * If none of the walls are given it will default to use the walls settings it had previously. + * I.e. if you previously told it to not have the left or right walls, and you then adjust the world size + * the newly created bounds will also not have the left and right walls. + * Explicitly state them in the parameters to override this. + * @param x The x coordinate of the top-left corner of the bounds. + * @param y The y coordinate of the top-left corner of the bounds. + * @param width The width of the bounds. + * @param height The height of the bounds. + * @param thickness [description] Default 64. + * @param left If true will create the left bounds wall. Default true. + * @param right If true will create the right bounds wall. Default true. + * @param top If true will create the top bounds wall. Default true. + * @param bottom If true will create the bottom bounds wall. Default true. + */ + setBounds(x?: number, y?: number, width?: number, height?: number, thickness?: number, left?: boolean, right?: boolean, top?: boolean, bottom?: boolean): Phaser.Physics.Impact.World; + + /** + * position = 'left', 'right', 'top' or 'bottom' + * @param add [description] + * @param position [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + updateWall(add: boolean, position: string, x: number, y: number, width: number, height: number): void; + + /** + * Creates a Graphics Game Object used for debug display and enables the world for debug drawing. + */ + createDebugGraphic(): Phaser.GameObjects.Graphics; + + /** + * [description] + */ + getNextID(): integer; + + /** + * [description] + * @param x [description] + * @param y [description] + * @param sizeX [description] + * @param sizeY [description] + */ + create(x: number, y: number, sizeX: number, sizeY: number): Phaser.Physics.Impact.Body; + + /** + * [description] + * @param object The Body to remove from this World. + */ + remove(object: Phaser.Physics.Impact.Body): void; + + /** + * [description] + */ + pause(): Phaser.Physics.Impact.World; + + /** + * [description] + */ + resume(): Phaser.Physics.Impact.World; + + /** + * [description] + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(time: number, delta: number): void; + + /** + * Check the body against the spatial hash. + * @param body [description] + * @param hash [description] + * @param size [description] + */ + checkHash(body: Phaser.Physics.Impact.Body, hash: object, size: number): void; + + /** + * [description] + * @param bodyA [description] + * @param bodyB [description] + */ + checkBodies(bodyA: Phaser.Physics.Impact.Body, bodyB: Phaser.Physics.Impact.Body): void; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the collides value on. + */ + setCollidesNever(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the collides value on. + */ + setLite(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the collides value on. + */ + setPassive(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the collides value on. + */ + setActive(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the collides value on. + */ + setFixed(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setTypeNone(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setTypeA(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setTypeB(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setAvsB(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setBvsA(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setCheckAgainstNone(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setCheckAgainstA(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setCheckAgainstB(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + */ + shutdown(): void; + + /** + * [description] + */ + destroy(): void; + + } + + } + + namespace Matter { + namespace Components { + /** + * A component to set restitution on objects. + */ + interface Bounce { + /** + * Sets the restitution on the physics object. + * @param value A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + } + + /** + * Contains methods for changing the collision filter of a Matter Body. Should be used as a mixin and not called directly. + */ + interface Collision { + /** + * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision categories are included in their collision masks (see {@link #setCollidesWith}). + * @param value Unique category bitfield. + */ + setCollisionCategory(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, they will never collide. + * @param value Unique group index. + */ + setCollisionGroup(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` are both true. + * @param categories A unique category bitfield, or an array of them. + */ + setCollidesWith(categories: number | number[]): Phaser.GameObjects.GameObject; + } + + /** + * A component to apply force to Matter.js bodies. + */ + interface Force { + /** + * Applies a force to a body. + * @param force A Vector that specifies the force to apply. + */ + applyForce(force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + /** + * Applies a force to a body from a given position. + * @param position The position in which the force comes from. + * @param force A Vector that specifies the force to apply. + */ + applyForceFrom(position: Phaser.Math.Vector2, force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the forward position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrust(speed: number): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the left position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustLeft(speed: number): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the right position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustRight(speed: number): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the back position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustBack(speed: number): Phaser.GameObjects.GameObject; + } + + /** + * Contains methods for changing the friction of a Game Object's Matter Body. Should be used a mixin, not called directly. + */ + interface Friction { + /** + * Sets new friction values for this Game Object's Matter Body. + * @param value The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. + * @param air If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. + * @param fstatic If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. + */ + setFriction(value: number, air?: number, fstatic?: number): Phaser.GameObjects.GameObject; + /** + * Sets a new air resistance for this Game Object's Matter Body. A value of 0 means the Body will never slow as it moves through space. The higher the value, the faster a Body slows when moving through space. + * @param value The new air resistance for the Body. + */ + setFrictionAir(value: number): Phaser.GameObjects.GameObject; + /** + * Sets a new static friction for this Game Object's Matter Body. A value of 0 means the Body will never "stick" when it is nearly stationary. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. + * @param value The new static friction for the Body. + */ + setFrictionStatic(value: number): Phaser.GameObjects.GameObject; + } + + /** + * A component to manipulate world gravity for Matter.js bodies. + */ + interface Gravity { + /** + * A togglable function for ignoring world gravity in real-time on the current body. + * @param value Set to true to ignore the effect of world gravity, or false to not ignore it. + */ + setIgnoreGravity(value: boolean): Phaser.GameObjects.GameObject; + } + + /** + * Allows accessing the mass, density, and center of mass of a Matter-enabled Game Object. Should be used as a mixin and not directly. + */ + interface Mass { + /** + * Sets the mass of the Game Object's Matter Body. + * @param value The new mass of the body. + */ + setMass(value: number): Phaser.GameObjects.GameObject; + /** + * Sets density of the body. + * @param value The new density of the body. + */ + setDensity(value: number): Phaser.GameObjects.GameObject; + /** + * The body's center of mass. + */ + readonly centerOfMass: Phaser.Math.Vector2; + } + + /** + * [description] + */ + interface Sensor { + /** + * [description] + * @param value [description] + */ + setSensor(value: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + */ + isSensor(): boolean; + } + + /** + * [description] + */ + interface SetBody { + /** + * Set the body on a Game Object to a rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param options [description] + */ + setRectangle(width: number, height: number, options: object): Phaser.GameObjects.GameObject; + /** + * [description] + * @param radius [description] + * @param options [description] + */ + setCircle(radius: number, options: object): Phaser.GameObjects.GameObject; + /** + * Set the body on the Game Object to a polygon shape. + * @param radius The radius of the polygon. + * @param sides The amount of sides creating the polygon. + * @param options A matterjs config object. + */ + setPolygon(radius: number, sides: number, options: object): Phaser.GameObjects.GameObject; + /** + * Creates a new matterjs trapezoid body. + * @param width The width of the trapezoid. + * @param height The height of the trapezoid. + * @param slope The angle of slope for the trapezoid. + * @param options A matterjs config object for the body. + */ + setTrapezoid(width: number, height: number, slope: number, options: object): Phaser.GameObjects.GameObject; + /** + * [description] + * @param body [description] + * @param addToWorld [description] Default true. + */ + setExistingBody(body: MatterJS.Body, addToWorld?: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + * @param config [description] + * @param options [description] + */ + setBody(config: object, options: object): Phaser.GameObjects.GameObject; + } + + /** + * [description] + */ + interface Sleep { + /** + * [description] + * @param value [description] Default 60. + */ + setSleepThreshold(value?: number): Phaser.GameObjects.GameObject; + /** + * [description] + * @param start [description] + * @param end [description] + */ + setSleepEvents(start: boolean, end: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + * @param value [description] + */ + setSleepStartEvent(value: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + * @param value [description] + */ + setSleepEndEvent(value: boolean): Phaser.GameObjects.GameObject; + } + + /** + * [description] + */ + interface Static { + /** + * [description] + * @param value [description] + */ + setStatic(value: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + */ + isStatic(): boolean; + } + + /** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + */ + interface Transform { + /** + * The x position of this Game Object. + */ + x: number; + /** + * The y position of this Game Object. + */ + y: number; + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + /** + * Use `angle` to set or get rotation of the physics body associated to this GameObject. Unlike rotation, when using set the value can be in degrees, which will be converted to radians internally. + */ + angle: number; + /** + * Use `rotation` to set or get the rotation of the physics body associated with this GameObject. The value when set must be in radians. + */ + rotation: number; + /** + * Sets the position of the physics body along x and y axes. Both the parameters to this function are optional and if not passed any they default to 0. + * @param x The horizontal position of the body. Default 0. + * @param y The vertical position of the body. Default x. + */ + setPosition(x?: number, y?: number): this; + /** + * [description] + * @param radians [description] Default 0. + */ + setRotation(radians?: number): this; + /** + * [description] + */ + setFixedRotation(): this; + /** + * [description] + * @param degrees [description] Default 0. + */ + setAngle(degrees?: number): this; + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. Default 1. + * @param y The vertical scale of this Game Object. If not set it will use the x value. Default x. + * @param point The point (Vector2) from which scaling will occur. + */ + setScale(x?: number, y?: number, point?: Phaser.Math.Vector2): this; + } + + /** + * [description] + */ + interface Velocity { + /** + * [description] + * @param value [description] + */ + setAngularVelocity(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): Phaser.GameObjects.GameObject; + /** + * Sets vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): Phaser.GameObjects.GameObject; + /** + * Sets both the horizontal and vertical velocity of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the `x` value. Default x. + */ + setVelocity(x: number, y?: number): Phaser.GameObjects.GameObject; + } + + } + + namespace Events { + type AfterUpdateEvent = { + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics After Update Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved. + * + * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`. + */ + const AFTER_UPDATE: any; + + type BeforeUpdateEvent = { + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Before Update Event. + * + * This event is dispatched by a Matter Physics World instance right before all the collision processing takes place. + * + * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`. + */ + const BEFORE_UPDATE: any; + + type CollisionActiveEvent = { + /** + * A list of all affected pairs in the collision. + */ + pairs: any[]; + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Collision Active Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that are colliding in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`. + */ + const COLLISION_ACTIVE: any; + + type CollisionEndEvent = { + /** + * A list of all affected pairs in the collision. + */ + pairs: any[]; + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Collision End Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that have finished colliding in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`. + */ + const COLLISION_END: any; + + type CollisionStartEvent = { + /** + * A list of all affected pairs in the collision. + */ + pairs: any[]; + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Collision Start Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that have started to collide in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`. + */ + const COLLISION_START: any; + + /** + * The Matter Physics Drag End Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * stops dragging a body. + * + * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`. + */ + const DRAG_END: any; + + /** + * The Matter Physics Drag Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * is actively dragging a body. It is emitted each time the pointer moves. + * + * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`. + */ + const DRAG: any; + + /** + * The Matter Physics Drag Start Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * starts dragging a body. + * + * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. + */ + const DRAG_START: any; + + /** + * The Matter Physics World Pause Event. + * + * This event is dispatched by an Matter Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`. + */ + const PAUSE: any; + + /** + * The Matter Physics World Resume Event. + * + * This event is dispatched by an Matter Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`. + */ + const RESUME: any; + + type SleepEndEvent = { + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Sleep End Event. + * + * This event is dispatched by a Matter Physics World instance when a Body stop sleeping. + * + * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`. + */ + const SLEEP_END: any; + + type SleepStartEvent = { + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Sleep Start Event. + * + * This event is dispatched by a Matter Physics World instance when a Body goes to sleep. + * + * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`. + */ + const SLEEP_START: any; + + } + + /** + * The Matter Factory can create different types of bodies and them to a physics world. + */ + class Factory { + /** + * + * @param world The Matter World which this Factory adds to. + */ + constructor(world: Phaser.Physics.Matter.World); + + /** + * The Matter World which this Factory adds to. + */ + world: Phaser.Physics.Matter.World; + + /** + * The Scene which this Factory's Matter World belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems this Matter Physics instance belongs to. + */ + sys: Phaser.Scenes.Systems; + + /** + * Creates a new rigid rectangular Body and adds it to the World. + * @param x The X coordinate of the center of the Body. + * @param y The Y coordinate of the center of the Body. + * @param width The width of the Body. + * @param height The height of the Body. + * @param options An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + */ + rectangle(x: number, y: number, width: number, height: number, options: object): MatterJS.Body; + + /** + * Creates a new rigid trapezoidal Body and adds it to the World. + * @param x The X coordinate of the center of the Body. + * @param y The Y coordinate of the center of the Body. + * @param width The width of the trapezoid of the Body. + * @param height The height of the trapezoid of the Body. + * @param slope The slope of the trapezoid. 0 creates a rectangle, while 1 creates a triangle. Positive values make the top side shorter, while negative values make the bottom side shorter. + * @param options An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + */ + trapezoid(x: number, y: number, width: number, height: number, slope: number, options: object): MatterJS.Body; + + /** + * Creates a new rigid circular Body and adds it to the World. + * @param x The X coordinate of the center of the Body. + * @param y The Y coordinate of the center of the Body. + * @param radius The radius of the circle. + * @param options An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + * @param maxSides The maximum amount of sides to use for the polygon which will approximate this circle. + */ + circle(x: number, y: number, radius: number, options?: object, maxSides?: number): MatterJS.Body; + + /** + * Creates a new rigid polygonal Body and adds it to the World. + * @param x The X coordinate of the center of the Body. + * @param y The Y coordinate of the center of the Body. + * @param sides The number of sides the polygon will have. + * @param radius The "radius" of the polygon, i.e. the distance from its center to any vertex. This is also the radius of its circumcircle. + * @param options An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + */ + polygon(x: number, y: number, sides: number, radius: number, options: object): MatterJS.Body; + + /** + * Creates a body using the supplied vertices (or an array containing multiple sets of vertices) and adds it to the World. + * If the vertices are convex, they will pass through as supplied. Otherwise, if the vertices are concave, they will be decomposed. Note that this process is not guaranteed to support complex sets of vertices, e.g. ones with holes. + * @param x The X coordinate of the center of the Body. + * @param y The Y coordinate of the center of the Body. + * @param vertexSets [description] + * @param options [description] + * @param flagInternal Flag internal edges (coincident part edges) Default false. + * @param removeCollinear Whether Matter.js will discard collinear edges (to improve performance). Default 0.01. + * @param minimumArea During decomposition discard parts that have an area less than this. Default 10. + */ + fromVertices(x: number, y: number, vertexSets: string | any[], options?: object, flagInternal?: boolean, removeCollinear?: number, minimumArea?: number): MatterJS.Body; + + /** + * Create a new composite containing Matter Image objects created in a grid arrangement. + * This function uses the body bounds to prevent overlaps. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param x The horizontal position of this composite in the world. + * @param y The vertical position of this composite in the world. + * @param columns The number of columns in the grid. + * @param rows The number of rows in the grid. + * @param columnGap The distance between each column. Default 0. + * @param rowGap The distance between each row. Default 0. + * @param options [description] + */ + imageStack(key: string, frame: string | integer, x: number, y: number, columns: number, rows: number, columnGap?: number, rowGap?: number, options?: object): MatterJS.Composite; + + /** + * Create a new composite containing bodies created in the callback in a grid arrangement. + * This function uses the body bounds to prevent overlaps. + * @param x The horizontal position of this composite in the world. + * @param y The vertical position of this composite in the world. + * @param columns The number of columns in the grid. + * @param rows The number of rows in the grid. + * @param columnGap The distance between each column. + * @param rowGap The distance between each row. + * @param callback The callback that creates the stack. + */ + stack(x: number, y: number, columns: number, rows: number, columnGap: number, rowGap: number, callback: Function): MatterJS.Composite; + + /** + * Create a new composite containing bodies created in the callback in a pyramid arrangement. + * This function uses the body bounds to prevent overlaps. + * @param x The horizontal position of this composite in the world. + * @param y The vertical position of this composite in the world. + * @param columns The number of columns in the pyramid. + * @param rows The number of rows in the pyramid. + * @param columnGap The distance between each column. + * @param rowGap The distance between each row. + * @param callback The callback function to be invoked. + */ + pyramid(x: number, y: number, columns: number, rows: number, columnGap: number, rowGap: number, callback: Function): MatterJS.Composite; + + /** + * Chains all bodies in the given composite together using constraints. + * @param composite [description] + * @param xOffsetA [description] + * @param yOffsetA [description] + * @param xOffsetB [description] + * @param yOffsetB [description] + * @param options [description] + */ + chain(composite: MatterJS.Composite, xOffsetA: number, yOffsetA: number, xOffsetB: number, yOffsetB: number, options: object): MatterJS.Composite; + + /** + * Connects bodies in the composite with constraints in a grid pattern, with optional cross braces. + * @param composite [description] + * @param columns [description] + * @param rows [description] + * @param crossBrace [description] + * @param options [description] + */ + mesh(composite: MatterJS.Composite, columns: number, rows: number, crossBrace: boolean, options: object): MatterJS.Composite; + + /** + * Creates a composite with a Newton's Cradle setup of bodies and constraints. + * @param x [description] + * @param y [description] + * @param number [description] + * @param size [description] + * @param length [description] + */ + newtonsCradle(x: number, y: number, number: number, size: number, length: number): MatterJS.Composite; + + /** + * Creates a composite with simple car setup of bodies and constraints. + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + * @param wheelSize [description] + */ + car(x: number, y: number, width: number, height: number, wheelSize: number): MatterJS.Composite; + + /** + * Creates a simple soft body like object. + * @param x The horizontal position of this composite in the world. + * @param y The vertical position of this composite in the world. + * @param columns The number of columns in the Composite. + * @param rows The number of rows in the Composite. + * @param columnGap The distance between each column. + * @param rowGap The distance between each row. + * @param crossBrace [description] + * @param particleRadius The radius of this circlular composite. + * @param particleOptions [description] + * @param constraintOptions [description] + */ + softBody(x: number, y: number, columns: number, rows: number, columnGap: number, rowGap: number, crossBrace: boolean, particleRadius: number, particleOptions: object, constraintOptions: object): MatterJS.Composite; + + /** + * [description] + * @param bodyA [description] + * @param bodyB [description] + * @param length [description] + * @param stiffness [description] Default 1. + * @param options [description] Default {}. + */ + joint(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length: number, stiffness?: number, options?: object): MatterJS.Constraint; + + /** + * [description] + * @param bodyA The first possible `Body` that this constraint is attached to. + * @param bodyB The second possible `Body` that this constraint is attached to. + * @param length A Number that specifies the target resting length of the constraint. It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB` + * @param stiffness A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. Default 1. + * @param options [description] Default {}. + */ + spring(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length: number, stiffness?: number, options?: object): MatterJS.Constraint; + + /** + * [description] + * @param bodyA [description] + * @param bodyB [description] + * @param length [description] + * @param stiffness [description] Default 1. + * @param options [description] Default {}. + */ + constraint(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length?: number, stiffness?: number, options?: object): MatterJS.Constraint; + + /** + * [description] + * @param bodyB [description] + * @param length [description] + * @param stiffness [description] Default 1. + * @param options [description] Default {}. + */ + worldConstraint(bodyB: MatterJS.Body, length: number, stiffness?: number, options?: object): MatterJS.Constraint; + + /** + * [description] + * @param options [description] + */ + mouseSpring(options: object): MatterJS.Constraint; + + /** + * [description] + * @param options [description] + */ + pointerConstraint(options: object): MatterJS.Constraint; + + /** + * [description] + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param options [description] Default {}. + */ + image(x: number, y: number, key: string, frame?: string | integer, options?: object): Phaser.Physics.Matter.Image; + + /** + * [description] + * @param tile [description] + * @param options [description] + */ + tileBody(tile: Phaser.Tilemaps.Tile, options: object): Phaser.Physics.Matter.TileBody; + + /** + * [description] + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param options [description] Default {}. + */ + sprite(x: number, y: number, key: string, frame?: string | integer, options?: object): Phaser.Physics.Matter.Sprite; + + /** + * [description] + * @param gameObject The Game Object to inject the Matter Body in to. + * @param options A Matter Body configuration object, or an instance of a Matter Body. + */ + gameObject(gameObject: Phaser.GameObjects.GameObject, options: object | MatterJS.Body): Phaser.GameObjects.GameObject; + + /** + * Instantly sets the linear velocity of the given body. Position, angle, force etc. are unchanged. + * + * See also `force`. + * @param body The Matter Body to set the velocity on. + * @param velocity The velocity to set. An object with public `x` and `y` components. + */ + velocity(body: MatterJS.Body, velocity: Phaser.Types.Math.Vector2Like): MatterJS.Body; + + /** + * Instantly sets the angular velocity of the given body. Position, angle, force etc. are unchanged. + * + * See also `force`. + * @param body The Matter Body to set the velocity on. + * @param velocity The angular velocity to set. + */ + angularVelocity(body: MatterJS.Body, velocity: number): MatterJS.Body; + + /** + * Applies a force to a body from a given world-space position, including resulting torque. + * @param body The Matter Body to set the force on. + * @param position The world position to apply the force from. An object with public `x` and `y` components. + * @param force The force to set. An object with public `x` and `y` components. + */ + force(body: MatterJS.Body, position: Phaser.Types.Math.Vector2Like, force: Phaser.Types.Math.Vector2Like): MatterJS.Body; + + /** + * Destroys this Factory. + */ + destroy(): void; + + } + + /** + * [description] + * @param world The Matter world to add the body to. + * @param gameObject The Game Object that will have the Matter body applied to it. + * @param options A Matter Body configuration object, or an instance of a Matter Body. + */ + function MatterGameObject(world: Phaser.Physics.Matter.World, gameObject: Phaser.GameObjects.GameObject, options: object | MatterJS.Body): Phaser.GameObjects.GameObject; + + /** + * A Matter Physics Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + */ + class Image extends Phaser.GameObjects.Image implements Phaser.Physics.Matter.Components.Bounce, Phaser.Physics.Matter.Components.Collision, Phaser.Physics.Matter.Components.Force, Phaser.Physics.Matter.Components.Friction, Phaser.Physics.Matter.Components.Gravity, Phaser.Physics.Matter.Components.Mass, Phaser.Physics.Matter.Components.Sensor, Phaser.Physics.Matter.Components.SetBody, Phaser.Physics.Matter.Components.Sleep, Phaser.Physics.Matter.Components.Static, Phaser.Physics.Matter.Components.Transform, Phaser.Physics.Matter.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param world [description] + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param options Matter.js configuration object. Default {}. + */ + constructor(world: Phaser.Physics.Matter.World, x: number, y: number, texture: string, frame?: string | integer, options?: object); + + /** + * [description] + */ + world: Phaser.Physics.Matter.World; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the restitution on the physics object. + * @param value A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision categories are included in their collision masks (see {@link #setCollidesWith}). + * @param value Unique category bitfield. + */ + setCollisionCategory(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, they will never collide. + * @param value Unique group index. + */ + setCollisionGroup(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` are both true. + * @param categories A unique category bitfield, or an array of them. + */ + setCollidesWith(categories: number | number[]): Phaser.GameObjects.GameObject; + + /** + * Applies a force to a body. + * @param force A Vector that specifies the force to apply. + */ + applyForce(force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + + /** + * Applies a force to a body from a given position. + * @param position The position in which the force comes from. + * @param force A Vector that specifies the force to apply. + */ + applyForceFrom(position: Phaser.Math.Vector2, force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the forward position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrust(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the left position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustLeft(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the right position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustRight(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the back position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustBack(speed: number): Phaser.GameObjects.GameObject; + + /** + * Sets new friction values for this Game Object's Matter Body. + * @param value The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. + * @param air If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. + * @param fstatic If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. + */ + setFriction(value: number, air?: number, fstatic?: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new air resistance for this Game Object's Matter Body. A value of 0 means the Body will never slow as it moves through space. The higher the value, the faster a Body slows when moving through space. + * @param value The new air resistance for the Body. + */ + setFrictionAir(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new static friction for this Game Object's Matter Body. A value of 0 means the Body will never "stick" when it is nearly stationary. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. + * @param value The new static friction for the Body. + */ + setFrictionStatic(value: number): Phaser.GameObjects.GameObject; + + /** + * A togglable function for ignoring world gravity in real-time on the current body. + * @param value Set to true to ignore the effect of world gravity, or false to not ignore it. + */ + setIgnoreGravity(value: boolean): Phaser.GameObjects.GameObject; + + /** + * Sets the mass of the Game Object's Matter Body. + * @param value The new mass of the body. + */ + setMass(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets density of the body. + * @param value The new density of the body. + */ + setDensity(value: number): Phaser.GameObjects.GameObject; + + /** + * The body's center of mass. + */ + readonly centerOfMass: Phaser.Math.Vector2; + + /** + * [description] + * @param value [description] + */ + setSensor(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isSensor(): boolean; + + /** + * Set the body on a Game Object to a rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param options [description] + */ + setRectangle(width: number, height: number, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param radius [description] + * @param options [description] + */ + setCircle(radius: number, options: object): Phaser.GameObjects.GameObject; + + /** + * Set the body on the Game Object to a polygon shape. + * @param radius The radius of the polygon. + * @param sides The amount of sides creating the polygon. + * @param options A matterjs config object. + */ + setPolygon(radius: number, sides: number, options: object): Phaser.GameObjects.GameObject; + + /** + * Creates a new matterjs trapezoid body. + * @param width The width of the trapezoid. + * @param height The height of the trapezoid. + * @param slope The angle of slope for the trapezoid. + * @param options A matterjs config object for the body. + */ + setTrapezoid(width: number, height: number, slope: number, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param body [description] + * @param addToWorld [description] Default true. + */ + setExistingBody(body: MatterJS.Body, addToWorld?: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param config [description] + * @param options [description] + */ + setBody(config: object, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] Default 60. + */ + setSleepThreshold(value?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param start [description] + * @param end [description] + */ + setSleepEvents(start: boolean, end: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepStartEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepEndEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setStatic(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isStatic(): boolean; + + /** + * [description] + */ + setFixedRotation(): this; + + /** + * [description] + * @param value [description] + */ + setAngularVelocity(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): Phaser.GameObjects.GameObject; + + /** + * Sets vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): Phaser.GameObjects.GameObject; + + /** + * Sets both the horizontal and vertical velocity of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the `x` value. Default x. + */ + setVelocity(x: number, y?: number): Phaser.GameObjects.GameObject; + + } + + /** + * [description] + */ + class MatterPhysics { + /** + * + * @param scene [description] + */ + constructor(scene: Phaser.Scene); + + /** + * [description] + */ + scene: Phaser.Scene; + + /** + * [description] + */ + systems: Phaser.Scenes.Systems; + + /** + * [description] + */ + config: object; + + /** + * [description] + */ + world: Phaser.Physics.Matter.World; + + /** + * [description] + */ + add: Phaser.Physics.Matter.Factory; + + /** + * A reference to the `Matter.Vertices` module which contains methods for creating and manipulating sets of vertices. + * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. + * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). + */ + verts: MatterJS.Vertices; + + /** + * A reference to the `Matter.Body` module which contains methods for creating and manipulating body models. + */ + body: MatterJS.Body; + + /** + * A reference to the `Matter.Bodies` module which contains methods for creating bodies. + */ + bodies: MatterJS.Bodies; + + /** + * [description] + */ + getConfig(): object; + + /** + * [description] + */ + enableAttractorPlugin(): Phaser.Physics.Matter.MatterPhysics; + + /** + * [description] + */ + enableWrapPlugin(): Phaser.Physics.Matter.MatterPhysics; + + /** + * [description] + */ + pause(): Phaser.Physics.Matter.World; + + /** + * [description] + */ + resume(): Phaser.Physics.Matter.World; + + /** + * Sets the Matter Engine to run at fixed timestep of 60Hz and enables `autoUpdate`. + * If you have set a custom `getDelta` function then this will override it. + */ + set60Hz(): Phaser.Physics.Matter.MatterPhysics; + + /** + * Sets the Matter Engine to run at fixed timestep of 30Hz and enables `autoUpdate`. + * If you have set a custom `getDelta` function then this will override it. + */ + set30Hz(): Phaser.Physics.Matter.MatterPhysics; + + /** + * Manually advances the physics simulation by one iteration. + * + * You can optionally pass in the `delta` and `correction` values to be used by Engine.update. + * If undefined they use the Matter defaults of 60Hz and no correction. + * + * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`. + * + * It also ignores any custom `getDelta` functions, as you should be passing the delta + * value in to this call. + * + * You can adjust the number of iterations that Engine.update performs internally. + * Use the Scene Matter Physics config object to set the following properties: + * + * positionIterations (defaults to 6) + * velocityIterations (defaults to 4) + * constraintIterations (defaults to 2) + * + * Adjusting these values can help performance in certain situations, depending on the physics requirements + * of your game. + * @param delta [description] Default 16.666. + * @param correction [description] Default 1. + */ + step(delta?: number, correction?: number): void; + + } + + /** + * A Matter Physics Sprite Game Object. + * + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + */ + class Sprite extends Phaser.GameObjects.Sprite implements Phaser.Physics.Matter.Components.Bounce, Phaser.Physics.Matter.Components.Collision, Phaser.Physics.Matter.Components.Force, Phaser.Physics.Matter.Components.Friction, Phaser.Physics.Matter.Components.Gravity, Phaser.Physics.Matter.Components.Mass, Phaser.Physics.Matter.Components.Sensor, Phaser.Physics.Matter.Components.SetBody, Phaser.Physics.Matter.Components.Sleep, Phaser.Physics.Matter.Components.Static, Phaser.Physics.Matter.Components.Transform, Phaser.Physics.Matter.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param world [description] + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param options Matter.js configuration object. Default {}. + */ + constructor(world: Phaser.Physics.Matter.World, x: number, y: number, texture: string, frame?: string | integer, options?: object); + + /** + * [description] + */ + world: Phaser.Physics.Matter.World; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the restitution on the physics object. + * @param value A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision categories are included in their collision masks (see {@link #setCollidesWith}). + * @param value Unique category bitfield. + */ + setCollisionCategory(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, they will never collide. + * @param value Unique group index. + */ + setCollisionGroup(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` are both true. + * @param categories A unique category bitfield, or an array of them. + */ + setCollidesWith(categories: number | number[]): Phaser.GameObjects.GameObject; + + /** + * Applies a force to a body. + * @param force A Vector that specifies the force to apply. + */ + applyForce(force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + + /** + * Applies a force to a body from a given position. + * @param position The position in which the force comes from. + * @param force A Vector that specifies the force to apply. + */ + applyForceFrom(position: Phaser.Math.Vector2, force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the forward position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrust(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the left position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustLeft(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the right position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustRight(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the back position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustBack(speed: number): Phaser.GameObjects.GameObject; + + /** + * Sets new friction values for this Game Object's Matter Body. + * @param value The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. + * @param air If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. + * @param fstatic If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. + */ + setFriction(value: number, air?: number, fstatic?: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new air resistance for this Game Object's Matter Body. A value of 0 means the Body will never slow as it moves through space. The higher the value, the faster a Body slows when moving through space. + * @param value The new air resistance for the Body. + */ + setFrictionAir(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new static friction for this Game Object's Matter Body. A value of 0 means the Body will never "stick" when it is nearly stationary. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. + * @param value The new static friction for the Body. + */ + setFrictionStatic(value: number): Phaser.GameObjects.GameObject; + + /** + * A togglable function for ignoring world gravity in real-time on the current body. + * @param value Set to true to ignore the effect of world gravity, or false to not ignore it. + */ + setIgnoreGravity(value: boolean): Phaser.GameObjects.GameObject; + + /** + * Sets the mass of the Game Object's Matter Body. + * @param value The new mass of the body. + */ + setMass(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets density of the body. + * @param value The new density of the body. + */ + setDensity(value: number): Phaser.GameObjects.GameObject; + + /** + * The body's center of mass. + */ + readonly centerOfMass: Phaser.Math.Vector2; + + /** + * [description] + * @param value [description] + */ + setSensor(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isSensor(): boolean; + + /** + * Set the body on a Game Object to a rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param options [description] + */ + setRectangle(width: number, height: number, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param radius [description] + * @param options [description] + */ + setCircle(radius: number, options: object): Phaser.GameObjects.GameObject; + + /** + * Set the body on the Game Object to a polygon shape. + * @param radius The radius of the polygon. + * @param sides The amount of sides creating the polygon. + * @param options A matterjs config object. + */ + setPolygon(radius: number, sides: number, options: object): Phaser.GameObjects.GameObject; + + /** + * Creates a new matterjs trapezoid body. + * @param width The width of the trapezoid. + * @param height The height of the trapezoid. + * @param slope The angle of slope for the trapezoid. + * @param options A matterjs config object for the body. + */ + setTrapezoid(width: number, height: number, slope: number, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param body [description] + * @param addToWorld [description] Default true. + */ + setExistingBody(body: MatterJS.Body, addToWorld?: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param config [description] + * @param options [description] + */ + setBody(config: object, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] Default 60. + */ + setSleepThreshold(value?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param start [description] + * @param end [description] + */ + setSleepEvents(start: boolean, end: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepStartEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepEndEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setStatic(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isStatic(): boolean; + + /** + * [description] + */ + setFixedRotation(): this; + + /** + * [description] + * @param value [description] + */ + setAngularVelocity(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): Phaser.GameObjects.GameObject; + + /** + * Sets vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): Phaser.GameObjects.GameObject; + + /** + * Sets both the horizontal and vertical velocity of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the `x` value. Default x. + */ + setVelocity(x: number, y?: number): Phaser.GameObjects.GameObject; + + } + + /** + * A wrapper around a Tile that provides access to a corresponding Matter body. A tile can only + * have one Matter body associated with it. You can either pass in an existing Matter body for + * the tile or allow the constructor to create the corresponding body for you. If the Tile has a + * collision group (defined in Tiled), those shapes will be used to create the body. If not, the + * tile's rectangle bounding box will be used. + * + * The corresponding body will be accessible on the Tile itself via Tile.physics.matterBody. + * + * Note: not all Tiled collision shapes are supported. See + * Phaser.Physics.Matter.TileBody#setFromTileCollision for more information. + */ + class TileBody implements Phaser.Physics.Matter.Components.Bounce, Phaser.Physics.Matter.Components.Collision, Phaser.Physics.Matter.Components.Friction, Phaser.Physics.Matter.Components.Gravity, Phaser.Physics.Matter.Components.Mass, Phaser.Physics.Matter.Components.Sensor, Phaser.Physics.Matter.Components.Sleep, Phaser.Physics.Matter.Components.Static { + /** + * + * @param world [description] + * @param tile The target tile that should have a Matter body. + * @param options Options to be used when creating the Matter body. + */ + constructor(world: Phaser.Physics.Matter.World, tile: Phaser.Tilemaps.Tile, options?: Phaser.Types.Physics.Matter.MatterTileOptions); + + /** + * The tile object the body is associated with. + */ + tile: Phaser.Tilemaps.Tile; + + /** + * The Matter world the body exists within. + */ + world: Phaser.Physics.Matter.World; + + /** + * Sets the current body to a rectangle that matches the bounds of the tile. + * @param options Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. + */ + setFromTileRectangle(options?: Phaser.Types.Physics.Matter.MatterBodyTileOptions): Phaser.Physics.Matter.TileBody; + + /** + * Sets the current body from the collision group associated with the Tile. This is typically + * set up in Tiled's collision editor. + * + * Note: Matter doesn't support all shapes from Tiled. Rectangles and polygons are directly + * supported. Ellipses are converted into circle bodies. Polylines are treated as if they are + * closed polygons. If a tile has multiple shapes, a multi-part body will be created. Concave + * shapes are supported if poly-decomp library is included. Decomposition is not guaranteed to + * work for complex shapes (e.g. holes), so it's often best to manually decompose a concave + * polygon into multiple convex polygons yourself. + * @param options Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. + */ + setFromTileCollision(options?: Phaser.Types.Physics.Matter.MatterBodyTileOptions): Phaser.Physics.Matter.TileBody; + + /** + * Sets the current body to the given body. This will remove the previous body, if one already + * exists. + * @param body The new Matter body to use. + * @param addToWorld Whether or not to add the body to the Matter world. Default true. + */ + setBody(body: MatterJS.Body, addToWorld?: boolean): Phaser.Physics.Matter.TileBody; + + /** + * Removes the current body from the TileBody and from the Matter world + */ + removeBody(): Phaser.Physics.Matter.TileBody; + + /** + * Removes the current body from the tile and the world. + */ + destroy(): Phaser.Physics.Matter.TileBody; + + /** + * Sets the restitution on the physics object. + * @param value A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision categories are included in their collision masks (see {@link #setCollidesWith}). + * @param value Unique category bitfield. + */ + setCollisionCategory(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, they will never collide. + * @param value Unique group index. + */ + setCollisionGroup(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` are both true. + * @param categories A unique category bitfield, or an array of them. + */ + setCollidesWith(categories: number | number[]): Phaser.GameObjects.GameObject; + + /** + * Sets new friction values for this Game Object's Matter Body. + * @param value The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. + * @param air If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. + * @param fstatic If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. + */ + setFriction(value: number, air?: number, fstatic?: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new air resistance for this Game Object's Matter Body. A value of 0 means the Body will never slow as it moves through space. The higher the value, the faster a Body slows when moving through space. + * @param value The new air resistance for the Body. + */ + setFrictionAir(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new static friction for this Game Object's Matter Body. A value of 0 means the Body will never "stick" when it is nearly stationary. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. + * @param value The new static friction for the Body. + */ + setFrictionStatic(value: number): Phaser.GameObjects.GameObject; + + /** + * A togglable function for ignoring world gravity in real-time on the current body. + * @param value Set to true to ignore the effect of world gravity, or false to not ignore it. + */ + setIgnoreGravity(value: boolean): Phaser.GameObjects.GameObject; + + /** + * Sets the mass of the Game Object's Matter Body. + * @param value The new mass of the body. + */ + setMass(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets density of the body. + * @param value The new density of the body. + */ + setDensity(value: number): Phaser.GameObjects.GameObject; + + /** + * The body's center of mass. + */ + readonly centerOfMass: Phaser.Math.Vector2; + + /** + * [description] + * @param value [description] + */ + setSensor(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isSensor(): boolean; + + /** + * [description] + * @param value [description] Default 60. + */ + setSleepThreshold(value?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param start [description] + * @param end [description] + */ + setSleepEvents(start: boolean, end: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepStartEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepEndEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setStatic(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isStatic(): boolean; + + } + + /** + * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file + * created and exported with PhysicsEditor (https://www.codeandweb.com/physicseditor). + */ + namespace PhysicsEditorParser { + /** + * Parses a body element exported by PhysicsEditor. + * @param x x position. + * @param y y position. + * @param w width. + * @param h height. + * @param config body configuration and fixture (child body) definitions. + */ + function parseBody(x: number, y: number, w: number, h: number, config: object): object; + + /** + * Parses an element of the "fixtures" list exported by PhysicsEditor + * @param fixtureConfig the fixture object to parse + */ + function parseFixture(fixtureConfig: object): object[]; + + /** + * Parses the "vertices" lists exported by PhysicsEditor. + * @param vertexSets The vertex lists to parse. + * @param options Matter body options. + */ + function parseVertices(vertexSets: object, options: object): object[]; + + } + + /** + * A Pointer Constraint is a special type of constraint that allows you to click + * and drag bodies in a Matter World. It monitors the active Pointers in a Scene, + * and when one is pressed down it checks to see if that hit any part of any active + * body in the world. If it did, and the body has input enabled, it will begin to + * drag it until either released, or you stop it via the `stopDrag` method. + * + * You can adjust the stiffness, length and other properties of the constraint via + * the `options` object on creation. + */ + class PointerConstraint { + /** + * + * @param scene A reference to the Scene to which this Pointer Constraint belongs. + * @param world A reference to the Matter World instance to which this Constraint belongs. + * @param options A Constraint configuration object. + */ + constructor(scene: Phaser.Scene, world: Phaser.Physics.Matter.World, options?: object); + + /** + * A reference to the Scene to which this Pointer Constraint belongs. + * This is the same Scene as the Matter World instance. + */ + scene: Phaser.Scene; + + /** + * A reference to the Matter World instance to which this Constraint belongs. + */ + world: Phaser.Physics.Matter.World; + + /** + * The Camera the Pointer was interacting with when the input + * down event was processed. + */ + camera: Phaser.Cameras.Scene2D.Camera; + + /** + * A reference to the Input Pointer that activated this Constraint. + * This is set in the `onDown` handler. + */ + pointer: Phaser.Input.Pointer; + + /** + * Is this Constraint active or not? + * + * An active constraint will be processed each update. An inactive one will be skipped. + * Use this to toggle a Pointer Constraint on and off. + */ + active: boolean; + + /** + * The internal transformed position. + */ + position: Phaser.Math.Vector2; + + /** + * The body that is currently being dragged, if any. + */ + body: MatterJS.Body; + + /** + * The part of the body that was clicked on to start the drag. + */ + part: MatterJS.Body; + + /** + * The native Matter Constraint that is used to attach to bodies. + */ + constraint: object; + + /** + * A Pointer has been pressed down onto the Scene. + * + * If this Constraint doesn't have an active Pointer then a hit test is + * run against all active bodies in the world. If one is found it is bound + * to this constraint and the drag begins. + * @param pointer A reference to the Pointer that was pressed. + */ + onDown(pointer: Phaser.Input.Pointer): void; + + /** + * Scans all active bodies in the current Matter World to see if any of them + * are hit by the Pointer. The _first one_ found to hit is set as the active contraint + * body. + */ + getBody(): boolean; + + /** + * Scans the current body to determine if a part of it was clicked on. + * If a part is found the body is set as the `constraint.bodyB` property, + * as well as the `body` property of this class. The part is also set. + * @param body The Matter Body to check. + * @param position A translated hit test position. + */ + hitTestBody(body: MatterJS.Body, position: Phaser.Math.Vector2): boolean; + + /** + * Internal update handler. Called in the Matter BEFORE_UPDATE step. + */ + update(): void; + + /** + * Stops the Pointer Constraint from dragging the body any further. + * + * This is called automatically if the Pointer is released while actively + * dragging a body. Or, you can call it manually to release a body from a + * constraint without having to first release the pointer. + */ + stopDrag(): void; + + /** + * Destroys this Pointer Constraint instance and all of its references. + */ + destroy(): void; + + } + + /** + * [description] + */ + class World extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene to which this Matter World instance belongs. + * @param config The Matter World configuration object. + */ + constructor(scene: Phaser.Scene, config: Phaser.Types.Physics.Matter.MatterWorldConfig); + + /** + * The Scene to which this Matter World instance belongs. + */ + scene: Phaser.Scene; + + /** + * An instance of the MatterJS Engine. + */ + engine: MatterJS.Engine; + + /** + * A `World` composite object that will contain all simulated bodies and constraints. + */ + localWorld: MatterJS.World; + + /** + * An object containing the 4 wall bodies that bound the physics world. + */ + walls: object; + + /** + * A flag that toggles if the world is enabled or not. + */ + enabled: boolean; + + /** + * The correction argument is an optional Number that specifies the time correction factor to apply to the update. + * This can help improve the accuracy of the simulation in cases where delta is changing between updates. + * The value of correction is defined as delta / lastDelta, i.e. the percentage change of delta over the last step. + * Therefore the value is always 1 (no correction) when delta constant (or when no correction is desired, which is the default). + * See the paper on Time Corrected Verlet for more information. + */ + correction: number; + + /** + * This function is called every time the core game loop steps, which is bound to the + * Request Animation Frame frequency unless otherwise modified. + * + * The function is passed two values: `time` and `delta`, both of which come from the game step values. + * + * It must return a number. This number is used as the delta value passed to Matter.Engine.update. + * + * You can override this function with your own to define your own timestep. + * + * If you need to update the Engine multiple times in a single game step then call + * `World.update` as many times as required. Each call will trigger the `getDelta` function. + * If you wish to have full control over when the Engine updates then see the property `autoUpdate`. + * + * You can also adjust the number of iterations that Engine.update performs. + * Use the Scene Matter Physics config object to set the following properties: + * + * positionIterations (defaults to 6) + * velocityIterations (defaults to 4) + * constraintIterations (defaults to 2) + * + * Adjusting these values can help performance in certain situations, depending on the physics requirements + * of your game. + */ + getDelta: Function; + + /** + * Automatically call Engine.update every time the game steps. + * If you disable this then you are responsible for calling `World.step` directly from your game. + * If you call `set60Hz` or `set30Hz` then `autoUpdate` is reset to `true`. + */ + autoUpdate: boolean; + + /** + * A flag that controls if the debug graphics will be drawn to or not. + */ + drawDebug: boolean; + + /** + * An instance of the Graphics object the debug bodies are drawn to, if enabled. + */ + debugGraphic: Phaser.GameObjects.Graphics; + + /** + * The default configuration values. + */ + defaults: object; + + /** + * [description] + */ + setEventsProxy(): void; + + /** + * Sets the bounds of the Physics world to match the given world pixel dimensions. + * You can optionally set which 'walls' to create: left, right, top or bottom. + * If none of the walls are given it will default to use the walls settings it had previously. + * I.e. if you previously told it to not have the left or right walls, and you then adjust the world size + * the newly created bounds will also not have the left and right walls. + * Explicitly state them in the parameters to override this. + * @param x The x coordinate of the top-left corner of the bounds. Default 0. + * @param y The y coordinate of the top-left corner of the bounds. Default 0. + * @param width The width of the bounds. + * @param height The height of the bounds. + * @param thickness The thickness of each wall, in pixels. Default 128. + * @param left If true will create the left bounds wall. Default true. + * @param right If true will create the right bounds wall. Default true. + * @param top If true will create the top bounds wall. Default true. + * @param bottom If true will create the bottom bounds wall. Default true. + */ + setBounds(x?: number, y?: number, width?: number, height?: number, thickness?: number, left?: boolean, right?: boolean, top?: boolean, bottom?: boolean): Phaser.Physics.Matter.World; + + /** + * [description] + * @param add [description] + * @param position [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + updateWall(add: boolean, position: string, x: number, y: number, width: number, height: number): void; + + /** + * [description] + */ + createDebugGraphic(): Phaser.GameObjects.Graphics; + + /** + * Sets the world's gravity and gravity scale to 0. + */ + disableGravity(): Phaser.Physics.Matter.World; + + /** + * Sets the world's gravity + * @param x The world gravity x component. Default 0. + * @param y The world gravity y component. Default 1. + * @param scale [description] + */ + setGravity(x?: number, y?: number, scale?: number): Phaser.Physics.Matter.World; + + /** + * Creates a rectangle Matter body and adds it to the world. + * @param x The horizontal position of the body in the world. + * @param y The vertical position of the body in the world. + * @param width The width of the body. + * @param height The height of the body. + * @param options Optional Matter configuration object. + */ + create(x: number, y: number, width: number, height: number, options: object): MatterJS.Body; + + /** + * Adds an object to the world. + * @param object Can be single or an array, and can be a body, composite or constraint + */ + add(object: object | object[]): Phaser.Physics.Matter.World; + + /** + * [description] + * @param object The object to be removed from the world. + * @param deep [description] + */ + remove(object: object, deep: boolean): Phaser.Physics.Matter.World; + + /** + * [description] + * @param constraint [description] + * @param deep [description] + */ + removeConstraint(constraint: MatterJS.Constraint, deep: boolean): Phaser.Physics.Matter.World; + + /** + * Adds MatterTileBody instances for all the colliding tiles within the given tilemap layer. Set + * the appropriate tiles in your layer to collide before calling this method! + * @param tilemapLayer An array of tiles. + * @param options Options to be passed to the MatterTileBody constructor. {@ee Phaser.Physics.Matter.TileBody} + */ + convertTilemapLayer(tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, options?: object): Phaser.Physics.Matter.World; + + /** + * Adds MatterTileBody instances for the given tiles. This adds bodies regardless of whether the + * tiles are set to collide or not. + * @param tiles An array of tiles. + * @param options Options to be passed to the MatterTileBody constructor. {@see Phaser.Physics.Matter.TileBody} + */ + convertTiles(tiles: Phaser.Tilemaps.Tile[], options?: object): Phaser.Physics.Matter.World; + + /** + * [description] + * @param isNonColliding [description] + */ + nextGroup(isNonColliding: boolean): number; + + /** + * [description] + */ + nextCategory(): number; + + /** + * [description] + */ + pause(): Phaser.Physics.Matter.World; + + /** + * [description] + */ + resume(): Phaser.Physics.Matter.World; + + /** + * [description] + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(time: number, delta: number): void; + + /** + * Manually advances the physics simulation by one iteration. + * + * You can optionally pass in the `delta` and `correction` values to be used by Engine.update. + * If undefined they use the Matter defaults of 60Hz and no correction. + * + * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`. + * + * It also ignores any custom `getDelta` functions, as you should be passing the delta + * value in to this call. + * + * You can adjust the number of iterations that Engine.update performs internally. + * Use the Scene Matter Physics config object to set the following properties: + * + * positionIterations (defaults to 6) + * velocityIterations (defaults to 4) + * constraintIterations (defaults to 2) + * + * Adjusting these values can help performance in certain situations, depending on the physics requirements + * of your game. + * @param delta [description] Default 16.666. + * @param correction [description] Default 1. + */ + step(delta?: number, correction?: number): void; + + /** + * Runs the Matter Engine.update at a fixed timestep of 60Hz. + */ + update60Hz(): number; + + /** + * Runs the Matter Engine.update at a fixed timestep of 30Hz. + */ + update30Hz(): number; + + /** + * [description] + * @param path [description] + * @param points [description] + */ + fromPath(path: string, points: any[]): any[]; + + /** + * Resets the internal collision IDs that Matter.JS uses for Body collision groups. + * + * You should call this before destroying your game if you need to restart the game + * again on the same page, without first reloading the page. Or, if you wish to + * consistently destroy a Scene that contains Matter.js and then run it again + * later in the same game. + */ + resetCollisionIDs(): void; + + /** + * Will remove all Matter physics event listeners and clear the matter physics world, + * engine and any debug graphics, if any. + */ + shutdown(): void; + + /** + * Will remove all Matter physics event listeners and clear the matter physics world, + * engine and any debug graphics, if any. + * + * After destroying the world it cannot be re-used again. + */ + destroy(): void; + + } + + } + + } + + namespace Plugins { + /** + * A Global Plugin is installed just once into the Game owned Plugin Manager. + * It can listen for Game events and respond to them. + */ + class BasePlugin { + /** + * + * @param pluginManager A reference to the Plugin Manager. + */ + constructor(pluginManager: Phaser.Plugins.PluginManager); + + /** + * A handy reference to the Plugin Manager that is responsible for this plugin. + * Can be used as a route to gain access to game systems and events. + */ + protected pluginManager: Phaser.Plugins.PluginManager; + + /** + * A reference to the Game instance this plugin is running under. + */ + protected game: Phaser.Game; + + /** + * A reference to the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You cannot use it during the `init` method, but you can during the `boot` method. + */ + protected scene: Phaser.Scene; + + /** + * A reference to the Scene Systems of the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You cannot use it during the `init` method, but you can during the `boot` method. + */ + protected systems: Phaser.Scenes.Systems; + + /** + * Called by the PluginManager when this plugin is first instantiated. + * It will never be called again on this instance. + * In here you can set-up whatever you need for this plugin to run. + * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this. + * @param data A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually). + */ + init(data?: any): void; + + /** + * Called by the PluginManager when this plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + */ + start(): void; + + /** + * Called by the PluginManager when this plugin is stopped. + * The game code has requested that your plugin stop doing whatever it does. + * It is now considered as 'inactive' by the PluginManager. + * Handle that process here (i.e. stop listening for events, etc) + * If the plugin is started again then `BasePlugin.start` will be called again. + */ + stop(): void; + + /** + * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. + * By this point the plugin properties `scene` and `systems` will have already been set. + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + */ + boot(): void; + + /** + * Game instance has been destroyed. + * You must release everything in here, all references, all objects, free it all up. + */ + destroy(): void; + + } + + type DefaultPlugins = { + /** + * These are the Global Managers that are created by the Phaser.Game instance. + */ + Global: any[]; + /** + * These are the core plugins that are installed into every Scene.Systems instance, no matter what. + */ + CoreScene: any[]; + /** + * These plugins are created in Scene.Systems in addition to the CoreScenePlugins. + */ + DefaultScene: any[]; + }; + + /** + * These are the Global Managers that are created by the Phaser.Game instance. + * They are referenced from Scene.Systems so that plugins can use them. + */ + var Global: any[]; + + /** + * These are the core plugins that are installed into every Scene.Systems instance, no matter what. + * They are optionally exposed in the Scene as well (see the InjectionMap for details) + * + * They are created in the order in which they appear in this array and EventEmitter is always first. + */ + var CoreScene: any[]; + + /** + * These plugins are created in Scene.Systems in addition to the CoreScenePlugins. + * + * You can elect not to have these plugins by either creating a DefaultPlugins object as part + * of the Game Config, by creating a Plugins object as part of a Scene Config, or by modifying this array + * and building your own bundle. + * + * They are optionally exposed in the Scene as well (see the InjectionMap for details) + * + * They are always created in the order in which they appear in the array. + */ + var DefaultScene: any[]; + + namespace PluginCache { + /** + * Static method called directly by the Core internal Plugins. + * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) + * Plugin is the object to instantiate to create the plugin + * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) + * @param key A reference used to get this plugin from the plugin cache. + * @param plugin The plugin to be stored. Should be the core object, not instantiated. + * @param mapping If this plugin is to be injected into the Scene Systems, this is the property key map used. + * @param custom Core Scene plugin or a Custom Scene plugin? Default false. + */ + function register(key: string, plugin: Function, mapping: string, custom?: boolean): void; + + /** + * Stores a custom plugin in the global plugin cache. + * The key must be unique, within the scope of the cache. + * @param key A reference used to get this plugin from the plugin cache. + * @param plugin The plugin to be stored. Should be the core object, not instantiated. + * @param mapping If this plugin is to be injected into the Scene Systems, this is the property key map used. + * @param data A value to be passed to the plugin's `init` method. + */ + function registerCustom(key: string, plugin: Function, mapping: string, data: any): void; + + /** + * Checks if the given key is already being used in the core plugin cache. + * @param key The key to check for. + */ + function hasCore(key: string): boolean; + + /** + * Checks if the given key is already being used in the custom plugin cache. + * @param key The key to check for. + */ + function hasCustom(key: string): boolean; + + /** + * Returns the core plugin object from the cache based on the given key. + * @param key The key of the core plugin to get. + */ + function getCore(key: string): Phaser.Types.Plugins.CorePluginContainer; + + /** + * Returns the custom plugin object from the cache based on the given key. + * @param key The key of the custom plugin to get. + */ + function getCustom(key: string): Phaser.Types.Plugins.CustomPluginContainer; + + /** + * Returns an object from the custom cache based on the given key that can be instantiated. + * @param key The key of the custom plugin to get. + */ + function getCustomClass(key: string): Function; + + /** + * Removes a core plugin based on the given key. + * @param key The key of the core plugin to remove. + */ + function remove(key: string): void; + + /** + * Removes a custom plugin based on the given key. + * @param key The key of the custom plugin to remove. + */ + function removeCustom(key: string): void; + + /** + * Removes all Core Plugins. + * + * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. + * So be sure you only call this if you do not wish to run Phaser again. + */ + function destroyCorePlugins(): void; + + /** + * Removes all Custom Plugins. + */ + function destroyCustomPlugins(): void; + + } + + /** + * The PluginManager is responsible for installing and adding plugins to Phaser. + * + * It is a global system and therefore belongs to the Game instance, not a specific Scene. + * + * It works in conjunction with the PluginCache. Core internal plugins automatically register themselves + * with the Cache, but it's the Plugin Manager that is responsible for injecting them into the Scenes. + * + * There are two types of plugin: + * + * 1. A Global Plugin + * 2. A Scene Plugin + * + * A Global Plugin is a plugin that lives within the Plugin Manager rather than a Scene. You can get + * access to it by calling `PluginManager.get` and providing a key. Any Scene that requests a plugin in + * this way will all get access to the same plugin instance, allowing you to use a single plugin across + * multiple Scenes. + * + * A Scene Plugin is a plugin dedicated to running within a Scene. These are different to Global Plugins + * in that their instances do not live within the Plugin Manager, but within the Scene Systems class instead. + * And that every Scene created is given its own unique instance of a Scene Plugin. Examples of core Scene + * Plugins include the Input Plugin, the Tween Plugin and the physics Plugins. + * + * You can add a plugin to Phaser in three different ways: + * + * 1. Preload it + * 2. Include it in your source code and install it via the Game Config + * 3. Include it in your source code and install it within a Scene + * + * For examples of all of these approaches please see the Phaser 3 Examples Repo `plugins` folder. + * + * For information on creating your own plugin please see the Phaser 3 Plugin Template. + */ + class PluginManager { + /** + * + * @param game The game instance that owns this Plugin Manager. + */ + constructor(game: Phaser.Game); + + /** + * The game instance that owns this Plugin Manager. + */ + game: Phaser.Game; + + /** + * The global plugins currently running and managed by this Plugin Manager. + * A plugin must have been started at least once in order to appear in this list. + */ + plugins: Phaser.Types.Plugins.GlobalPlugin[]; + + /** + * A list of plugin keys that should be installed into Scenes as well as the Core Plugins. + */ + scenePlugins: string[]; + + /** + * Run once the game has booted and installs all of the plugins configured in the Game Config. + */ + protected boot(): void; + + /** + * Called by the Scene Systems class. Tells the plugin manager to install all Scene plugins into it. + * + * First it will install global references, i.e. references from the Game systems into the Scene Systems (and Scene if mapped.) + * Then it will install Core Scene Plugins followed by Scene Plugins registered with the PluginManager. + * Finally it will install any references to Global Plugins that have a Scene mapping property into the Scene itself. + * @param sys The Scene Systems class to install all the plugins in to. + * @param globalPlugins An array of global plugins to install. + * @param scenePlugins An array of scene plugins to install. + */ + protected addToScene(sys: Phaser.Scenes.Systems, globalPlugins: any[], scenePlugins: any[]): void; + + /** + * Called by the Scene Systems class. Returns a list of plugins to be installed. + */ + protected getDefaultScenePlugins(): string[]; + + /** + * Installs a new Scene Plugin into the Plugin Manager and optionally adds it + * to the given Scene as well. A Scene Plugin added to the manager in this way + * will be automatically installed into all new Scenes using the key and mapping given. + * + * The `key` property is what the plugin is injected into Scene.Systems as. + * The `mapping` property is optional, and if specified is what the plugin is installed into + * the Scene as. For example: + * + * ```javascript + * this.plugins.installScenePlugin('powerupsPlugin', pluginCode, 'powerups'); + * + * // and from within the scene: + * this.sys.powerupsPlugin; // key value + * this.powerups; // mapping value + * ``` + * + * This method is called automatically by Phaser if you install your plugins using either the + * Game Configuration object, or by preloading them via the Loader. + * @param key The property key that will be used to add this plugin to Scene.Systems. + * @param plugin The plugin code. This should be the non-instantiated version. + * @param mapping If this plugin is injected into the Phaser.Scene class, this is the property key to use. + * @param addToScene Optionally automatically add this plugin to the given Scene. + * @param fromLoader Is this being called by the Loader? Default false. + */ + installScenePlugin(key: string, plugin: Function, mapping?: string, addToScene?: Phaser.Scene, fromLoader?: boolean): void; + + /** + * Installs a new Global Plugin into the Plugin Manager and optionally starts it running. + * A global plugin belongs to the Plugin Manager, rather than a specific Scene, and can be accessed + * and used by all Scenes in your game. + * + * The `key` property is what you use to access this plugin from the Plugin Manager. + * + * ```javascript + * this.plugins.install('powerupsPlugin', pluginCode); + * + * // and from within the scene: + * this.plugins.get('powerupsPlugin'); + * ``` + * + * This method is called automatically by Phaser if you install your plugins using either the + * Game Configuration object, or by preloading them via the Loader. + * + * The same plugin can be installed multiple times into the Plugin Manager by simply giving each + * instance its own unique key. + * @param key The unique handle given to this plugin within the Plugin Manager. + * @param plugin The plugin code. This should be the non-instantiated version. + * @param start Automatically start the plugin running? This is always `true` if you provide a mapping value. Default false. + * @param mapping If this plugin is injected into the Phaser.Scene class, this is the property key to use. + * @param data A value passed to the plugin's `init` method. + */ + install(key: string, plugin: Function, start?: boolean, mapping?: string, data?: any): Phaser.Plugins.BasePlugin; + + /** + * Gets an index of a global plugin based on the given key. + * @param key The unique plugin key. + */ + protected getIndex(key: string): integer; + + /** + * Gets a global plugin based on the given key. + * @param key The unique plugin key. + */ + protected getEntry(key: string): Phaser.Types.Plugins.GlobalPlugin; + + /** + * Checks if the given global plugin, based on its key, is active or not. + * @param key The unique plugin key. + */ + isActive(key: string): boolean; + + /** + * Starts a global plugin running. + * + * If the plugin was previously active then calling `start` will reset it to an active state and then + * call its `start` method. + * + * If the plugin has never been run before a new instance of it will be created within the Plugin Manager, + * its active state set and then both of its `init` and `start` methods called, in that order. + * + * If the plugin is already running under the given key then nothing happens. + * @param key The key of the plugin to start. + * @param runAs Run the plugin under a new key. This allows you to run one plugin multiple times. + */ + start(key: string, runAs?: string): Phaser.Plugins.BasePlugin; + + /** + * Stops a global plugin from running. + * + * If the plugin is active then its active state will be set to false and the plugins `stop` method + * will be called. + * + * If the plugin is not already running, nothing will happen. + * @param key The key of the plugin to stop. + */ + stop(key: string): Phaser.Plugins.PluginManager; + + /** + * Gets a global plugin from the Plugin Manager based on the given key and returns it. + * + * If it cannot find an active plugin based on the key, but there is one in the Plugin Cache with the same key, + * then it will create a new instance of the cached plugin and return that. + * @param key The key of the plugin to get. + * @param autoStart Automatically start a new instance of the plugin if found in the cache, but not actively running. Default true. + */ + get(key: string, autoStart?: boolean): Phaser.Plugins.BasePlugin | Function; + + /** + * Returns the plugin class from the cache. + * Used internally by the Plugin Manager. + * @param key The key of the plugin to get. + */ + getClass(key: string): Phaser.Plugins.BasePlugin; + + /** + * Removes a global plugin from the Plugin Manager and Plugin Cache. + * + * It is up to you to remove all references to this plugin that you may hold within your game code. + * @param key The key of the plugin to remove. + */ + removeGlobalPlugin(key: string): void; + + /** + * Removes a scene plugin from the Plugin Manager and Plugin Cache. + * + * This will not remove the plugin from any active Scenes that are already using it. + * + * It is up to you to remove all references to this plugin that you may hold within your game code. + * @param key The key of the plugin to remove. + */ + removeScenePlugin(key: string): void; + + /** + * Registers a new type of Game Object with the global Game Object Factory and / or Creator. + * This is usually called from within your Plugin code and is a helpful short-cut for creating + * new Game Objects. + * + * The key is the property that will be injected into the factories and used to create the + * Game Object. For example: + * + * ```javascript + * this.plugins.registerGameObject('clown', clownFactoryCallback, clownCreatorCallback); + * // later in your game code: + * this.add.clown(); + * this.make.clown(); + * ``` + * + * The callbacks are what are called when the factories try to create a Game Object + * matching the given key. It's important to understand that the callbacks are invoked within + * the context of the GameObjectFactory. In this context there are several properties available + * to use: + * + * this.scene - A reference to the Scene that owns the GameObjectFactory. + * this.displayList - A reference to the Display List the Scene owns. + * this.updateList - A reference to the Update List the Scene owns. + * + * See the GameObjectFactory and GameObjectCreator classes for more details. + * Any public property or method listed is available from your callbacks under `this`. + * @param key The key of the Game Object that the given callbacks will create, i.e. `image`, `sprite`. + * @param factoryCallback The callback to invoke when the Game Object Factory is called. + * @param creatorCallback The callback to invoke when the Game Object Creator is called. + */ + registerGameObject(key: string, factoryCallback?: Function, creatorCallback?: Function): void; + + /** + * Registers a new file type with the global File Types Manager, making it available to all Loader + * Plugins created after this. + * + * This is usually called from within your Plugin code and is a helpful short-cut for creating + * new loader file types. + * + * The key is the property that will be injected into the Loader Plugin and used to load the + * files. For example: + * + * ```javascript + * this.plugins.registerFileType('wad', doomWadLoaderCallback); + * // later in your preload code: + * this.load.wad(); + * ``` + * + * The callback is what is called when the loader tries to load a file matching the given key. + * It's important to understand that the callback is invoked within + * the context of the LoaderPlugin. In this context there are several properties / methods available + * to use: + * + * this.addFile - A method to add the new file to the load queue. + * this.scene - The Scene that owns the Loader Plugin instance. + * + * See the LoaderPlugin class for more details. Any public property or method listed is available from + * your callback under `this`. + * @param key The key of the Game Object that the given callbacks will create, i.e. `image`, `sprite`. + * @param callback The callback to invoke when the Game Object Factory is called. + * @param addToScene Optionally add this file type into the Loader Plugin owned by the given Scene. + */ + registerFileType(key: string, callback: Function, addToScene?: Phaser.Scene): void; + + /** + * Destroys this Plugin Manager and all associated plugins. + * It will iterate all plugins found and call their `destroy` methods. + * + * The PluginCache will remove all custom plugins. + */ + destroy(): void; + + } + + /** + * A Scene Level Plugin is installed into every Scene and belongs to that Scene. + * It can listen for Scene events and respond to them. + * It can map itself to a Scene property, or into the Scene Systems, or both. + */ + class ScenePlugin extends Phaser.Plugins.BasePlugin { + /** + * + * @param scene A reference to the Scene that has installed this plugin. + * @param pluginManager A reference to the Plugin Manager. + */ + constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager); + + /** + * This method is called when the Scene boots. It is only ever called once. + * + * By this point the plugin properties `scene` and `systems` will have already been set. + * + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + * Here are the Scene events you can listen to: + * + * start + * ready + * preupdate + * update + * postupdate + * resize + * pause + * resume + * sleep + * wake + * transitioninit + * transitionstart + * transitioncomplete + * transitionout + * shutdown + * destroy + * + * At the very least you should offer a destroy handler for when the Scene closes down, i.e: + * + * ```javascript + * var eventEmitter = this.systems.events; + * eventEmitter.once('destroy', this.sceneDestroy, this); + * ``` + */ + boot(): void; + + } + + } + + /** + * Phaser Blend Modes. + */ + enum BlendModes { + /** + * Skips the Blend Mode check in the renderer. + */ + SKIP_CHECK, + /** + * Normal blend mode. For Canvas and WebGL. + * This is the default setting and draws new shapes on top of the existing canvas content. + */ + NORMAL, + /** + * Add blend mode. For Canvas and WebGL. + * Where both shapes overlap the color is determined by adding color values. + */ + ADD, + /** + * Multiply blend mode. For Canvas and WebGL. + * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. + */ + MULTIPLY, + /** + * Screen blend mode. For Canvas and WebGL. + * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) + */ + SCREEN, + /** + * Overlay blend mode. For Canvas only. + * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. + */ + OVERLAY, + /** + * Darken blend mode. For Canvas only. + * Retains the darkest pixels of both layers. + */ + DARKEN, + /** + * Lighten blend mode. For Canvas only. + * Retains the lightest pixels of both layers. + */ + LIGHTEN, + /** + * Color Dodge blend mode. For Canvas only. + * Divides the bottom layer by the inverted top layer. + */ + COLOR_DODGE, + /** + * Color Burn blend mode. For Canvas only. + * Divides the inverted bottom layer by the top layer, and then inverts the result. + */ + COLOR_BURN, + /** + * Hard Light blend mode. For Canvas only. + * A combination of multiply and screen like overlay, but with top and bottom layer swapped. + */ + HARD_LIGHT, + /** + * Soft Light blend mode. For Canvas only. + * A softer version of hard-light. Pure black or white does not result in pure black or white. + */ + SOFT_LIGHT, + /** + * Difference blend mode. For Canvas only. + * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. + */ + DIFFERENCE, + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + */ + EXCLUSION, + /** + * Hue blend mode. For Canvas only. + * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. + */ + HUE, + /** + * Saturation blend mode. For Canvas only. + * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. + */ + SATURATION, + /** + * Color blend mode. For Canvas only. + * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. + */ + COLOR, + /** + * Luminosity blend mode. For Canvas only. + * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. + */ + LUMINOSITY, + /** + * Alpha erase blend mode. For Canvas and WebGL. + */ + ERASE, + /** + * Source-in blend mode. For Canvas only. + * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. + */ + SOURCE_IN, + /** + * Source-out blend mode. For Canvas only. + * The new shape is drawn where it doesn't overlap the existing canvas content. + */ + SOURCE_OUT, + /** + * Source-out blend mode. For Canvas only. + * The new shape is only drawn where it overlaps the existing canvas content. + */ + SOURCE_ATOP, + /** + * Destination-over blend mode. For Canvas only. + * New shapes are drawn behind the existing canvas content. + */ + DESTINATION_OVER, + /** + * Destination-in blend mode. For Canvas only. + * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. + */ + DESTINATION_IN, + /** + * Destination-out blend mode. For Canvas only. + * The existing content is kept where it doesn't overlap the new shape. + */ + DESTINATION_OUT, + /** + * Destination-out blend mode. For Canvas only. + * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. + */ + DESTINATION_ATOP, + /** + * Lighten blend mode. For Canvas only. + * Where both shapes overlap the color is determined by adding color values. + */ + LIGHTER, + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + */ + COPY, + /** + * Xor blend mode. For Canvas only. + * Shapes are made transparent where both overlap and drawn normal everywhere else. + */ + XOR, + } + + namespace Renderer { + namespace Canvas { + /** + * The Canvas Renderer is responsible for managing 2D canvas rendering contexts, including the one used by the Game's canvas. It tracks the internal state of a given context and can renderer textured Game Objects to it, taking into account alpha, blending, and scaling. + */ + class CanvasRenderer { + /** + * + * @param game The Phaser Game instance that owns this renderer. + */ + constructor(game: Phaser.Game); + + /** + * The Phaser Game instance that owns this renderer. + */ + game: Phaser.Game; + + /** + * A constant which allows the renderer to be easily identified as a Canvas Renderer. + */ + type: integer; + + /** + * The total number of Game Objects which were rendered in a frame. + */ + drawCount: number; + + /** + * The width of the canvas being rendered to. + */ + width: integer; + + /** + * The height of the canvas being rendered to. + */ + height: integer; + + /** + * The local configuration settings of the CanvasRenderer. + */ + config: object; + + /** + * The scale mode which should be used by the CanvasRenderer. + */ + scaleMode: integer; + + /** + * The canvas element which the Game uses. + */ + gameCanvas: HTMLCanvasElement; + + /** + * The canvas context used to render all Cameras in all Scenes during the game loop. + */ + gameContext: CanvasRenderingContext2D; + + /** + * The canvas context currently used by the CanvasRenderer for all rendering operations. + */ + currentContext: CanvasRenderingContext2D; + + /** + * The blend modes supported by the Canvas Renderer. + * + * This object maps the {@link Phaser.BlendModes} to canvas compositing operations. + */ + blendModes: any[]; + + /** + * The scale mode currently in use by the Canvas Renderer. + */ + currentScaleMode: number; + + /** + * Details about the currently scheduled snapshot. + * + * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. + */ + snapshotState: Phaser.Types.Renderer.Snapshot.SnapshotState; + + /** + * Prepares the game canvas for rendering. + */ + init(): void; + + /** + * The event handler that manages the `resize` event dispatched by the Scale Manager. + * @param gameSize The default Game Size object. This is the un-modified game dimensions. + * @param baseSize The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + * @param displaySize The display Size object. The size of the canvas style width / height attributes. + * @param resolution The Scale Manager resolution setting. + */ + onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size, displaySize: Phaser.Structs.Size, resolution?: number): void; + + /** + * Resize the main game canvas. + * @param width The new width of the renderer. + * @param height The new height of the renderer. + */ + resize(width?: number, height?: number): void; + + /** + * A NOOP method for handling lost context. Intentionally empty. + * @param callback Ignored parameter. + */ + onContextLost(callback: Function): void; + + /** + * A NOOP method for handling restored context. Intentionally empty. + * @param callback Ignored parameter. + */ + onContextRestored(callback: Function): void; + + /** + * Resets the transformation matrix of the current context to the identity matrix, thus resetting any transformation. + */ + resetTransform(): void; + + /** + * Sets the blend mode (compositing operation) of the current context. + * @param blendMode The new blend mode which should be used. + */ + setBlendMode(blendMode: string): this; + + /** + * Changes the Canvas Rendering Context that all draw operations are performed against. + * @param ctx The new Canvas Rendering Context to draw everything to. Leave empty to reset to the Game Canvas. + */ + setContext(ctx?: CanvasRenderingContext2D): this; + + /** + * Sets the global alpha of the current context. + * @param alpha The new alpha to use, where 0 is fully transparent and 1 is fully opaque. + */ + setAlpha(alpha: number): this; + + /** + * Called at the start of the render loop. + */ + preRender(): void; + + /** + * Renders the Scene to the given Camera. + * @param scene The Scene to render. + * @param children The Game Objects within the Scene to be rendered. + * @param interpolationPercentage The interpolation percentage to apply. Currently unused. + * @param camera The Scene Camera to render with. + */ + render(scene: Phaser.Scene, children: Phaser.GameObjects.DisplayList, interpolationPercentage: number, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Restores the game context's global settings and takes a snapshot if one is scheduled. + * + * The post-render step happens after all Cameras in all Scenes have been rendered. + */ + postRender(): void; + + /** + * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. + * + * To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets + * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param callback The Function to invoke after the snapshot image is created. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshot(callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + + /** + * Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets + * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param x The x coordinate to grab from. + * @param y The y coordinate to grab from. + * @param width The width of the area to grab. + * @param height The height of the area to grab. + * @param callback The Function to invoke after the snapshot image is created. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshotArea(x: integer, y: integer, width: integer, height: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + + /** + * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then + * calling this method will override it. + * + * Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for + * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, + * using less memory. + * @param x The x coordinate of the pixel to get. + * @param y The y coordinate of the pixel to get. + * @param callback The Function to invoke after the snapshot pixel data is extracted. + */ + snapshotPixel(x: integer, y: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; + + /** + * Takes a Sprite Game Object, or any object that extends it, and draws it to the current context. + * @param sprite The texture based Game Object to draw. + * @param frame The frame to draw, doesn't have to be that owned by the Game Object. + * @param camera The Camera to use for the rendering transform. + * @param parentTransformMatrix The transform matrix of the parent container, if set. + */ + batchSprite(sprite: Phaser.GameObjects.GameObject, frame: Phaser.Textures.Frame, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Destroys all object references in the Canvas Renderer. + */ + destroy(): void; + + } + + /** + * Returns an array which maps the default blend modes to supported Canvas blend modes. + * + * If the browser doesn't support a blend mode, it will default to the normal `source-over` blend mode. + */ + function GetBlendModes(): any[]; + + /** + * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix + * and then performs the following steps: + * + * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. + * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. + * 3. Sets the blend mode of the context to be that used by the Game Object. + * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. + * 5. Saves the context state. + * 6. Sets the final matrix values into the context via setTransform. + * + * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. + * @param renderer A reference to the current active Canvas renderer. + * @param ctx The canvas context to set the transform on. + * @param src The Game Object being rendered. Can be any type that extends the base class. + * @param camera The Camera that is rendering the Game Object. + * @param parentMatrix A parent transform matrix to apply to the Game Object before rendering. + */ + function SetTransform(renderer: Phaser.Renderer.Canvas.CanvasRenderer, ctx: CanvasRenderingContext2D, src: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): boolean; + + } + + namespace Snapshot { + /** + * Takes a snapshot of an area from the current frame displayed by a canvas. + * + * This is then copied to an Image object. When this loads, the results are sent + * to the callback provided in the Snapshot Configuration object. + * @param sourceCanvas The canvas to take a snapshot of. + * @param config The snapshot configuration object. + */ + function Canvas(sourceCanvas: HTMLCanvasElement, config: Phaser.Types.Renderer.Snapshot.SnapshotState): void; + + /** + * Takes a snapshot of an area from the current frame displayed by a WebGL canvas. + * + * This is then copied to an Image object. When this loads, the results are sent + * to the callback provided in the Snapshot Configuration object. + * @param sourceCanvas The canvas to take a snapshot of. + * @param config The snapshot configuration object. + */ + function WebGL(sourceCanvas: HTMLCanvasElement, config: Phaser.Types.Renderer.Snapshot.SnapshotState): void; + + } + + namespace WebGL { + namespace Pipelines { + /** + * BitmapMaskPipeline handles all bitmap masking rendering in WebGL. It works by using + * sampling two texture on the fragment shader and using the fragment's alpha to clip the region. + * The config properties are: + * - game: Current game instance. + * - renderer: Current WebGL renderer. + * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. + * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). + * - vertShader: Source for vertex shader as a string. + * - fragShader: Source for fragment shader as a string. + * - vertexCapacity: The amount of vertices that shall be allocated + * - vertexSize: The size of a single vertex in bytes. + */ + class BitmapMaskPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config Used for overriding shader an pipeline properties if extending this pipeline. + */ + constructor(config: object); + + /** + * Float32 view of the array buffer containing the pipeline's vertices. + */ + vertexViewF32: Float32Array; + + /** + * Size of the batch. + */ + maxQuads: number; + + /** + * Dirty flag to check if resolution properties need to be updated on the + * masking shader. + */ + resolutionDirty: boolean; + + /** + * Called every time the pipeline needs to be used. + * It binds all necessary resources. + */ + onBind(): this; + + /** + * [description] + * @param width [description] + * @param height [description] + * @param resolution [description] + */ + resize(width: number, height: number, resolution: number): this; + + /** + * Binds necessary resources and renders the mask to a separated framebuffer. + * The framebuffer for the masked object is also bound for further use. + * @param mask GameObject used as mask. + * @param maskedObject GameObject masked by the mask GameObject. + * @param camera [description] + */ + beginMask(mask: Phaser.GameObjects.GameObject, maskedObject: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * The masked game objects framebuffer is unbound and its texture + * is bound together with the mask texture and the mask shader and + * a draw call with a single quad is processed. Here is where the + * masking effect is applied. + * @param mask GameObject used as a mask. + */ + endMask(mask: Phaser.GameObjects.GameObject): void; + + } + + /** + * Implements a model view projection matrices. + * Pipelines can implement this for doing 2D and 3D rendering. + */ + interface ModelViewProjection { + /** + * Dirty flag for checking if model matrix needs to be updated on GPU. + */ + modelMatrixDirty: boolean; + /** + * Dirty flag for checking if view matrix needs to be updated on GPU. + */ + viewMatrixDirty: boolean; + /** + * Dirty flag for checking if projection matrix needs to be updated on GPU. + */ + projectionMatrixDirty: boolean; + /** + * Model matrix + */ + modelMatrix: Float32Array; + /** + * View matrix + */ + viewMatrix: Float32Array; + /** + * Projection matrix + */ + projectionMatrix: Float32Array; + /** + * Initializes MVP matrices with an identity matrix + */ + mvpInit(): void; + /** + * If dirty flags are set then the matrices are uploaded to the GPU. + */ + mvpUpdate(): void; + /** + * Loads an identity matrix to the model matrix + */ + modelIdentity(): void; + /** + * Scale model matrix + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + modelScale(x: number, y: number, z: number): this; + /** + * Translate model matrix + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + modelTranslate(x: number, y: number, z: number): this; + /** + * Rotates the model matrix in the X axis. + * @param radians The amount to rotate by. + */ + modelRotateX(radians: number): this; + /** + * Rotates the model matrix in the Y axis. + * @param radians The amount to rotate by. + */ + modelRotateY(radians: number): this; + /** + * Rotates the model matrix in the Z axis. + * @param radians The amount to rotate by. + */ + modelRotateZ(radians: number): this; + /** + * Loads identity matrix into the view matrix + */ + viewIdentity(): this; + /** + * Scales view matrix + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + viewScale(x: number, y: number, z: number): this; + /** + * Translates view matrix + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + viewTranslate(x: number, y: number, z: number): this; + /** + * Rotates view matrix in the X axis. + * @param radians The amount to rotate by. + */ + viewRotateX(radians: number): this; + /** + * Rotates view matrix in the Y axis. + * @param radians The amount to rotate by. + */ + viewRotateY(radians: number): this; + /** + * Rotates view matrix in the Z axis. + * @param radians The amount to rotate by. + */ + viewRotateZ(radians: number): this; + /** + * Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix + * @param matrix2D The Matrix2D. + */ + viewLoad2D(matrix2D: Float32Array): this; + /** + * Copies a 4x4 matrix into the view matrix + * @param matrix The Matrix2D. + */ + viewLoad(matrix: Float32Array): this; + /** + * Loads identity matrix into the projection matrix. + */ + projIdentity(): this; + /** + * Sets up an orthographic projection matrix + * @param left The left value. + * @param right The right value. + * @param bottom The bottom value. + * @param top The top value. + * @param near The near value. + * @param far The far value. + */ + projOrtho(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + /** + * Sets up a perspective projection matrix + * @param fovY The fov value. + * @param aspectRatio The aspectRatio value. + * @param near The near value. + * @param far The far value. + */ + projPersp(fovY: number, aspectRatio: number, near: number, far: number): this; + } + + /** + * ForwardDiffuseLightPipeline implements a forward rendering approach for 2D lights. + * This pipeline extends TextureTintPipeline so it implements all it's rendering functions + * and batching system. + */ + class ForwardDiffuseLightPipeline extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline { + /** + * + * @param config The configuration of the pipeline, same as the {@link Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline}. The fragment shader will be replaced with the lighting shader. + */ + constructor(config: object); + + /** + * This function sets all the needed resources for each camera pass. + * @param scene The Scene being rendered. + * @param camera The Scene Camera being rendered with. + */ + onRender(scene: Phaser.Scene, camera: Phaser.Cameras.Scene2D.Camera): this; + + /** + * Generic function for batching a textured quad + * @param gameObject Source GameObject + * @param texture Raw WebGLTexture associated with the quad + * @param textureWidth Real texture width + * @param textureHeight Real texture height + * @param srcX X coordinate of the quad + * @param srcY Y coordinate of the quad + * @param srcWidth Width of the quad + * @param srcHeight Height of the quad + * @param scaleX X component of scale + * @param scaleY Y component of scale + * @param rotation Rotation of the quad + * @param flipX Indicates if the quad is horizontally flipped + * @param flipY Indicates if the quad is vertically flipped + * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll + * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll + * @param displayOriginX Horizontal origin in pixels + * @param displayOriginY Vertical origin in pixels + * @param frameX X coordinate of the texture frame + * @param frameY Y coordinate of the texture frame + * @param frameWidth Width of the texture frame + * @param frameHeight Height of the texture frame + * @param tintTL Tint for top left + * @param tintTR Tint for top right + * @param tintBL Tint for bottom left + * @param tintBR Tint for bottom right + * @param tintEffect The tint effect (0 for additive, 1 for replacement) + * @param uOffset Horizontal offset on texture coordinate + * @param vOffset Vertical offset on texture coordinate + * @param camera Current used camera + * @param parentTransformMatrix Parent container + */ + batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: integer, textureHeight: integer, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: integer, tintTR: integer, tintBL: integer, tintBR: integer, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Sets the Game Objects normal map as the active texture. + * @param gameObject The Game Object to update. + */ + setNormalMap(gameObject: Phaser.GameObjects.GameObject): void; + + /** + * Rotates the normal map vectors inversely by the given angle. + * Only works in 2D space. + * @param rotation The angle of rotation in radians. + */ + setNormalMapRotation(rotation: number): void; + + /** + * Takes a Sprite Game Object, or any object that extends it, which has a normal texture and adds it to the batch. + * @param sprite The texture-based Game Object to add to the batch. + * @param camera The Camera to use for the rendering transform. + * @param parentTransformMatrix The transform matrix of the parent container, if set. + */ + batchSprite(sprite: Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + } + + /** + * TextureTintPipeline implements the rendering infrastructure + * for displaying textured objects + * The config properties are: + * - game: Current game instance. + * - renderer: Current WebGL renderer. + * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. + * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). + * - vertShader: Source for vertex shader as a string. + * - fragShader: Source for fragment shader as a string. + * - vertexCapacity: The amount of vertices that shall be allocated + * - vertexSize: The size of a single vertex in bytes. + */ + class TextureTintPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config The configuration options for this Texture Tint Pipeline, as described above. + */ + constructor(config: object); + + /** + * Float32 view of the array buffer containing the pipeline's vertices. + */ + vertexViewF32: Float32Array; + + /** + * Uint32 view of the array buffer containing the pipeline's vertices. + */ + vertexViewU32: Uint32Array; + + /** + * Size of the batch. + */ + maxQuads: integer; + + /** + * Collection of batch information + */ + batches: any[]; + + /** + * Called every time the pipeline needs to be used. + * It binds all necessary resources. + */ + onBind(): this; + + /** + * Resizes this pipeline and updates the projection. + * @param width The new width. + * @param height The new height. + * @param resolution The resolution. + */ + resize(width: number, height: number, resolution: number): this; + + /** + * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. + * @param texture WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. + * @param unit Texture unit to which the texture needs to be bound. Default 0. + */ + setTexture2D(texture?: WebGLTexture, unit?: integer): Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline; + + /** + * Checks if the current batch has the same texture and texture unit, or if we need to create a new batch. + * @param texture WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. + * @param unit Texture unit to which the texture needs to be bound. + */ + requireTextureBatch(texture: WebGLTexture, unit: integer): boolean; + + /** + * Creates a new batch object and pushes it to a batch array. + * The batch object contains information relevant to the current + * vertex batch like the offset in the vertex buffer, vertex count and + * the textures used by that batch. + * @param texture Optional WebGLTexture that will be assigned to the created batch. + * @param unit Texture unit to which the texture needs to be bound. + */ + pushBatch(texture: WebGLTexture, unit: integer): void; + + /** + * Uploads the vertex data and emits a draw call for the current batch of vertices. + */ + flush(): this; + + /** + * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. + * @param sprite The texture based Game Object to add to the batch. + * @param camera The Camera to use for the rendering transform. + * @param parentTransformMatrix The transform matrix of the parent container, if set. + */ + batchSprite(sprite: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 + * @param x0 The top-left x position. + * @param y0 The top-left y position. + * @param x1 The bottom-left x position. + * @param y1 The bottom-left y position. + * @param x2 The bottom-right x position. + * @param y2 The bottom-right y position. + * @param x3 The top-right x position. + * @param y3 The top-right y position. + * @param u0 UV u0 value. + * @param v0 UV v0 value. + * @param u1 UV u1 value. + * @param v1 UV v1 value. + * @param tintTL The top-left tint color value. + * @param tintTR The top-right tint color value. + * @param tintBL The bottom-left tint color value. + * @param tintBR The bottom-right tint color value. + * @param tintEffect The tint effect for the shader to use. + * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param unit Texture unit to which the texture needs to be bound. Default 0. + */ + batchQuad(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, u0: number, v0: number, u1: number, v1: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number | boolean, texture?: WebGLTexture, unit?: integer): boolean; + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 3 vertices in the following arrangement: + * + * ``` + * 0 + * |\ + * | \ + * | \ + * | \ + * | \ + * 1-----2 + * ``` + * @param x1 The bottom-left x position. + * @param y1 The bottom-left y position. + * @param x2 The bottom-right x position. + * @param y2 The bottom-right y position. + * @param x3 The top-right x position. + * @param y3 The top-right y position. + * @param u0 UV u0 value. + * @param v0 UV v0 value. + * @param u1 UV u1 value. + * @param v1 UV v1 value. + * @param tintTL The top-left tint color value. + * @param tintTR The top-right tint color value. + * @param tintBL The bottom-left tint color value. + * @param tintEffect The tint effect for the shader to use. + * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param unit Texture unit to which the texture needs to be bound. Default 0. + */ + batchTri(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, u0: number, v0: number, u1: number, v1: number, tintTL: number, tintTR: number, tintBL: number, tintEffect: number | boolean, texture?: WebGLTexture, unit?: integer): boolean; + + /** + * Generic function for batching a textured quad using argument values instead of a Game Object. + * @param gameObject Source GameObject. + * @param texture Raw WebGLTexture associated with the quad. + * @param textureWidth Real texture width. + * @param textureHeight Real texture height. + * @param srcX X coordinate of the quad. + * @param srcY Y coordinate of the quad. + * @param srcWidth Width of the quad. + * @param srcHeight Height of the quad. + * @param scaleX X component of scale. + * @param scaleY Y component of scale. + * @param rotation Rotation of the quad. + * @param flipX Indicates if the quad is horizontally flipped. + * @param flipY Indicates if the quad is vertically flipped. + * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll. + * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll. + * @param displayOriginX Horizontal origin in pixels. + * @param displayOriginY Vertical origin in pixels. + * @param frameX X coordinate of the texture frame. + * @param frameY Y coordinate of the texture frame. + * @param frameWidth Width of the texture frame. + * @param frameHeight Height of the texture frame. + * @param tintTL Tint for top left. + * @param tintTR Tint for top right. + * @param tintBL Tint for bottom left. + * @param tintBR Tint for bottom right. + * @param tintEffect The tint effect. + * @param uOffset Horizontal offset on texture coordinate. + * @param vOffset Vertical offset on texture coordinate. + * @param camera Current used camera. + * @param parentTransformMatrix Parent container. + * @param skipFlip Skip the renderTexture check. Default false. + */ + batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: integer, textureHeight: integer, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: integer, tintTR: integer, tintBL: integer, tintBR: integer, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean): void; + + /** + * Adds a Texture Frame into the batch for rendering. + * @param frame The Texture Frame to be rendered. + * @param x The horizontal position to render the texture at. + * @param y The vertical position to render the texture at. + * @param tint The tint color. + * @param alpha The alpha value. + * @param transformMatrix The Transform Matrix to use for the texture. + * @param parentTransformMatrix A parent Transform Matrix. + */ + batchTextureFrame(frame: Phaser.Textures.Frame, x: number, y: number, tint: number, alpha: number, transformMatrix: Phaser.GameObjects.Components.TransformMatrix, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Pushes a filled rectangle into the vertex batch. + * Rectangle has no transform values and isn't transformed into the local space. + * Used for directly batching untransformed rectangles, such as Camera background colors. + * @param x Horizontal top left coordinate of the rectangle. + * @param y Vertical top left coordinate of the rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param color Color of the rectangle to draw. + * @param alpha Alpha value of the rectangle to draw. + */ + drawFillRect(x: number, y: number, width: number, height: number, color: number, alpha: number): void; + + /** + * Pushes a filled rectangle into the vertex batch. + * Rectangle factors in the given transform matrices before adding to the batch. + * @param x Horizontal top left coordinate of the rectangle. + * @param y Vertical top left coordinate of the rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchFillRect(x: number, y: number, width: number, height: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Pushes a filled triangle into the vertex batch. + * Triangle factors in the given transform matrices before adding to the batch. + * @param x0 Point 0 x coordinate. + * @param y0 Point 0 y coordinate. + * @param x1 Point 1 x coordinate. + * @param y1 Point 1 y coordinate. + * @param x2 Point 2 x coordinate. + * @param y2 Point 2 y coordinate. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchFillTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Pushes a stroked triangle into the vertex batch. + * Triangle factors in the given transform matrices before adding to the batch. + * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. + * @param x0 Point 0 x coordinate. + * @param y0 Point 0 y coordinate. + * @param x1 Point 1 x coordinate. + * @param y1 Point 1 y coordinate. + * @param x2 Point 2 x coordinate. + * @param y2 Point 2 y coordinate. + * @param lineWidth The width of the line in pixels. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchStrokeTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, lineWidth: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and then passing it through Earcut, which + * creates a list of polygons. Each polygon is then added to the batch. + * + * The path is always automatically closed because it's filled. + * @param path Collection of points that represent the path. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchFillPath(path: any[], currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and calling `batchLine` for each section + * of the path. + * + * The path is optionally closed at the end. + * @param path Collection of points that represent the path. + * @param lineWidth The width of the line segments in pixels. + * @param pathOpen Indicates if the path should be closed or left open. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchStrokePath(path: any[], lineWidth: number, pathOpen: boolean, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Creates a quad and adds it to the vertex batch based on the given line values. + * @param ax X coordinate to the start of the line + * @param ay Y coordinate to the start of the line + * @param bx X coordinate to the end of the line + * @param by Y coordinate to the end of the line + * @param aLineWidth Width of the start of the line + * @param bLineWidth Width of the end of the line + * @param currentMatrix Parent matrix, generally used by containers + */ + batchLine(ax: number, ay: number, bx: number, by: number, aLineWidth: number, bLineWidth: number, currentMatrix: Float32Array): void; + + } + + } + + namespace Utils { + /** + * Packs four floats on a range from 0.0 to 1.0 into a single Uint32 + * @param r Red component in a range from 0.0 to 1.0 + * @param g Green component in a range from 0.0 to 1.0 + * @param b Blue component in a range from 0.0 to 1.0 + * @param a Alpha component in a range from 0.0 to 1.0 + */ + function getTintFromFloats(r: number, g: number, b: number, a: number): number; + + /** + * Packs a Uint24, representing RGB components, with a Float32, representing + * the alpha component, with a range between 0.0 and 1.0 and return a Uint32 + * @param rgb Uint24 representing RGB components + * @param a Float32 representing Alpha component + */ + function getTintAppendFloatAlpha(rgb: number, a: number): number; + + /** + * Packs a Uint24, representing RGB components, with a Float32, representing + * the alpha component, with a range between 0.0 and 1.0 and return a + * swizzled Uint32 + * @param rgb Uint24 representing RGB components + * @param a Float32 representing Alpha component + */ + function getTintAppendFloatAlphaAndSwap(rgb: number, a: number): number; + + /** + * Unpacks a Uint24 RGB into an array of floats of ranges of 0.0 and 1.0 + * @param rgb RGB packed as a Uint24 + */ + function getFloatsFromUintRGB(rgb: number): any[]; + + /** + * Counts how many attributes of 32 bits a vertex has + * @param attributes Array of attributes + * @param glContext WebGLContext used for check types + */ + function getComponentCount(attributes: any[], glContext: WebGLRenderingContext): number; + + } + + /** + * WebGLPipeline is a class that describes the way elements will be rendererd + * in WebGL, specially focused on batching vertices (batching is not provided). + * Pipelines are mostly used for describing 2D rendering passes but it's + * flexible enough to be used for any type of rendering including 3D. + * Internally WebGLPipeline will handle things like compiling shaders, + * creating vertex buffers, assigning primitive topology and binding + * vertex attributes. + * + * The config properties are: + * - game: Current game instance. + * - renderer: Current WebGL renderer. + * - gl: Current WebGL context. + * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. + * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). + * - vertShader: Source for vertex shader as a string. + * - fragShader: Source for fragment shader as a string. + * - vertexCapacity: The amount of vertices that shall be allocated + * - vertexSize: The size of a single vertex in bytes. + * - vertices: An optional buffer of vertices + * - attributes: An array describing the vertex attributes + * + * The vertex attributes properties are: + * - name : String - Name of the attribute in the vertex shader + * - size : integer - How many components describe the attribute. For ex: vec3 = size of 3, float = size of 1 + * - type : GLenum - WebGL type (gl.BYTE, gl.SHORT, gl.UNSIGNED_BYTE, gl.UNSIGNED_SHORT, gl.FLOAT) + * - normalized : boolean - Is the attribute normalized + * - offset : integer - The offset in bytes to the current attribute in the vertex. Equivalent to offsetof(vertex, attrib) in C + * Here you can find more information of how to describe an attribute: + * - https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer + */ + class WebGLPipeline { + /** + * + * @param config The configuration object for this WebGL Pipeline, as described above. + */ + constructor(config: object); + + /** + * Name of the Pipeline. Used for identifying + */ + name: string; + + /** + * The Game which owns this WebGL Pipeline. + */ + game: Phaser.Game; + + /** + * The canvas which this WebGL Pipeline renders to. + */ + view: HTMLCanvasElement; + + /** + * Used to store the current game resolution + */ + resolution: number; + + /** + * Width of the current viewport + */ + width: number; + + /** + * Height of the current viewport + */ + height: number; + + /** + * The WebGL context this WebGL Pipeline uses. + */ + gl: WebGLRenderingContext; + + /** + * How many vertices have been fed to the current pipeline. + */ + vertexCount: number; + + /** + * The limit of vertices that the pipeline can hold + */ + vertexCapacity: integer; + + /** + * The WebGL Renderer which owns this WebGL Pipeline. + */ + renderer: Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * Raw byte buffer of vertices. + */ + vertexData: ArrayBuffer; + + /** + * The handle to a WebGL vertex buffer object. + */ + vertexBuffer: WebGLBuffer; + + /** + * The handle to a WebGL program + */ + program: WebGLProgram; + + /** + * Array of objects that describe the vertex attributes + */ + attributes: object; + + /** + * The size in bytes of the vertex + */ + vertexSize: integer; + + /** + * The primitive topology which the pipeline will use to submit draw calls + */ + topology: integer; + + /** + * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources + * to the GPU. + */ + bytes: Uint8Array; + + /** + * This will store the amount of components of 32 bit length + */ + vertexComponentCount: integer; + + /** + * Indicates if the current pipeline is flushing the contents to the GPU. + * When the variable is set the flush function will be locked. + */ + flushLocked: boolean; + + /** + * Indicates if the current pipeline is active or not for this frame only. + * Reset in the onRender method. + */ + active: boolean; + + /** + * Called when the Game has fully booted and the Renderer has finished setting up. + * + * By this stage all Game level systems are now in place and you can perform any final + * tasks that the pipeline may need that relied on game systems such as the Texture Manager. + */ + boot(): void; + + /** + * Adds a description of vertex attribute to the pipeline + * @param name Name of the vertex attribute + * @param size Vertex component size + * @param type Type of the attribute + * @param normalized Is the value normalized to a range + * @param offset Byte offset to the beginning of the first element in the vertex + */ + addAttribute(name: string, size: integer, type: integer, normalized: boolean, offset: integer): this; + + /** + * Check if the current batch of vertices is full. + */ + shouldFlush(): boolean; + + /** + * Resizes the properties used to describe the viewport + * @param width The new width of this WebGL Pipeline. + * @param height The new height of this WebGL Pipeline. + * @param resolution The resolution this WebGL Pipeline should be resized to. + */ + resize(width: number, height: number, resolution: number): this; + + /** + * Binds the pipeline resources, including programs, vertex buffers and binds attributes + */ + bind(): this; + + /** + * Set whenever this WebGL Pipeline is bound to a WebGL Renderer. + * + * This method is called every time the WebGL Pipeline is attempted to be bound, even if it already is the current pipeline. + */ + onBind(): this; + + /** + * Called before each frame is rendered, but after the canvas has been cleared. + */ + onPreRender(): this; + + /** + * Called before a Scene's Camera is rendered. + * @param scene The Scene being rendered. + * @param camera The Scene Camera being rendered with. + */ + onRender(scene: Phaser.Scene, camera: Phaser.Cameras.Scene2D.Camera): this; + + /** + * Called after each frame has been completely rendered and snapshots have been taken. + */ + onPostRender(): this; + + /** + * Uploads the vertex data and emits a draw call + * for the current batch of vertices. + */ + flush(): this; + + /** + * Removes all object references in this WebGL Pipeline and removes its program from the WebGL context. + */ + destroy(): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new value of the `float` uniform. + */ + setFloat1(name: string, x: number): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component of the `vec2` uniform. + * @param y The new Y component of the `vec2` uniform. + */ + setFloat2(name: string, x: number, y: number): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component of the `vec3` uniform. + * @param y The new Y component of the `vec3` uniform. + * @param z The new Z component of the `vec3` uniform. + */ + setFloat3(name: string, x: number, y: number, z: number): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x X component of the uniform + * @param y Y component of the uniform + * @param z Z component of the uniform + * @param w W component of the uniform + */ + setFloat4(name: string, x: number, y: number, z: number, w: number): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat1v(name: string, arr: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat2v(name: string, arr: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat3v(name: string, arr: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat4v(name: string, arr: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new value of the `int` uniform. + */ + setInt1(name: string, x: integer): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component of the `ivec2` uniform. + * @param y The new Y component of the `ivec2` uniform. + */ + setInt2(name: string, x: integer, y: integer): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component of the `ivec3` uniform. + * @param y The new Y component of the `ivec3` uniform. + * @param z The new Z component of the `ivec3` uniform. + */ + setInt3(name: string, x: integer, y: integer, z: integer): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x X component of the uniform + * @param y Y component of the uniform + * @param z Z component of the uniform + * @param w W component of the uniform + */ + setInt4(name: string, x: integer, y: integer, z: integer, w: integer): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param transpose Whether to transpose the matrix. Should be `false`. + * @param matrix The new values for the `mat2` uniform. + */ + setMatrix2(name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param transpose Whether to transpose the matrix. Should be `false`. + * @param matrix The new values for the `mat3` uniform. + */ + setMatrix3(name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param transpose Should the matrix be transpose + * @param matrix Matrix data + */ + setMatrix4(name: string, transpose: boolean, matrix: Float32Array): this; + + } + + /** + * WebGLRenderer is a class that contains the needed functionality to keep the + * WebGLRenderingContext state clean. The main idea of the WebGLRenderer is to keep track of + * any context change that happens for WebGL rendering inside of Phaser. This means + * if raw webgl functions are called outside the WebGLRenderer of the Phaser WebGL + * rendering ecosystem they might pollute the current WebGLRenderingContext state producing + * unexpected behavior. It's recommended that WebGL interaction is done through + * WebGLRenderer and/or WebGLPipeline. + */ + class WebGLRenderer { + /** + * + * @param game The Game instance which owns this WebGL Renderer. + */ + constructor(game: Phaser.Game); + + /** + * The local configuration settings of this WebGL Renderer. + */ + config: object; + + /** + * The Game instance which owns this WebGL Renderer. + */ + game: Phaser.Game; + + /** + * A constant which allows the renderer to be easily identified as a WebGL Renderer. + */ + type: integer; + + /** + * The width of the canvas being rendered to. + * This is populated in the onResize event handler. + */ + width: integer; + + /** + * The height of the canvas being rendered to. + * This is populated in the onResize event handler. + */ + height: integer; + + /** + * The canvas which this WebGL Renderer draws to. + */ + canvas: HTMLCanvasElement; + + /** + * An array of functions to invoke if the WebGL context is lost. + */ + lostContextCallbacks: WebGLContextCallback[]; + + /** + * An array of functions to invoke if the WebGL context is restored. + */ + restoredContextCallbacks: WebGLContextCallback[]; + + /** + * An array of blend modes supported by the WebGL Renderer. + * + * This array includes the default blend modes as well as any custom blend modes added through {@link #addBlendMode}. + */ + blendModes: any[]; + + /** + * Keeps track of any WebGLTexture created with the current WebGLRenderingContext + */ + nativeTextures: any[]; + + /** + * Set to `true` if the WebGL context of the renderer is lost. + */ + contextLost: boolean; + + /** + * This object will store all pipelines created through addPipeline + */ + pipelines: object; + + /** + * Details about the currently scheduled snapshot. + * + * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. + */ + snapshotState: Phaser.Types.Renderer.Snapshot.SnapshotState; + + /** + * Cached value for the last texture unit that was used + */ + currentActiveTextureUnit: integer; + + /** + * An array of the last texture handles that were bound to the WebGLRenderingContext + */ + currentTextures: any[]; + + /** + * Current framebuffer in use + */ + currentFramebuffer: WebGLFramebuffer; + + /** + * Current WebGLPipeline in use + */ + currentPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Current WebGLProgram in use + */ + currentProgram: WebGLProgram; + + /** + * Current WebGLBuffer (Vertex buffer) in use + */ + currentVertexBuffer: WebGLBuffer; + + /** + * Current WebGLBuffer (Index buffer) in use + */ + currentIndexBuffer: WebGLBuffer; + + /** + * Current blend mode in use + */ + currentBlendMode: integer; + + /** + * Indicates if the the scissor state is enabled in WebGLRenderingContext + */ + currentScissorEnabled: boolean; + + /** + * Stores the current scissor data + */ + currentScissor: Uint32Array; + + /** + * Stack of scissor data + */ + scissorStack: Uint32Array; + + /** + * The underlying WebGL context of the renderer. + */ + gl: WebGLRenderingContext; + + /** + * Array of strings that indicate which WebGL extensions are supported by the browser + */ + supportedExtensions: object; + + /** + * Extensions loaded into the current context + */ + extensions: object; + + /** + * Stores the current WebGL component formats for further use + */ + glFormats: any[]; + + /** + * Stores the supported WebGL texture compression formats. + */ + compression: any[]; + + /** + * Cached drawing buffer height to reduce gl calls. + */ + readonly drawingBufferHeight: number; + + /** + * A blank 32x32 transparent texture, as used by the Graphics system where needed. + * This is set in the `boot` method. + */ + readonly blankTexture: WebGLTexture; + + /** + * A default Camera used in calls when no other camera has been provided. + */ + defaultCamera: Phaser.Cameras.Scene2D.BaseCamera; + + /** + * The total number of masks currently stacked. + */ + maskCount: integer; + + /** + * The mask stack. + */ + maskStack: Phaser.Display.Masks.GeometryMask[]; + + /** + * Internal property that tracks the currently set mask. + */ + currentMask: any; + + /** + * Internal property that tracks the currently set camera mask. + */ + currentCameraMask: any; + + /** + * Internal gl function mapping for uniform look-up. + * https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform + */ + glFuncMap: any; + + /** + * Creates a new WebGLRenderingContext and initializes all internal state. + * @param config The configuration object for the renderer. + */ + init(config: object): this; + + /** + * The event handler that manages the `resize` event dispatched by the Scale Manager. + * @param gameSize The default Game Size object. This is the un-modified game dimensions. + * @param baseSize The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + * @param displaySize The display Size object. The size of the canvas style width / height attributes. + * @param resolution The Scale Manager resolution setting. + */ + onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size, displaySize: Phaser.Structs.Size, resolution?: number): void; + + /** + * Resizes the drawing buffer to match that required by the Scale Manager. + * @param width The new width of the renderer. + * @param height The new height of the renderer. + * @param resolution The new resolution of the renderer. + */ + resize(width?: number, height?: number, resolution?: number): this; + + /** + * Adds a callback to be invoked when the WebGL context has been restored by the browser. + * @param callback The callback to be invoked on context restoration. + * @param target The context of the callback. + */ + onContextRestored(callback: WebGLContextCallback, target: object): this; + + /** + * Adds a callback to be invoked when the WebGL context has been lost by the browser. + * @param callback The callback to be invoked on context loss. + * @param target The context of the callback. + */ + onContextLost(callback: WebGLContextCallback, target: object): this; + + /** + * Checks if a WebGL extension is supported + * @param extensionName Name of the WebGL extension + */ + hasExtension(extensionName: string): boolean; + + /** + * Loads a WebGL extension + * @param extensionName The name of the extension to load. + */ + getExtension(extensionName: string): object; + + /** + * Flushes the current pipeline if the pipeline is bound + */ + flush(): void; + + /** + * Checks if a pipeline is present in the current WebGLRenderer + * @param pipelineName The name of the pipeline. + */ + hasPipeline(pipelineName: string): boolean; + + /** + * Returns the pipeline by name if the pipeline exists + * @param pipelineName The name of the pipeline. + */ + getPipeline(pipelineName: string): Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Removes a pipeline by name. + * @param pipelineName The name of the pipeline to be removed. + */ + removePipeline(pipelineName: string): this; + + /** + * Adds a pipeline instance into the collection of pipelines + * @param pipelineName A unique string-based key for the pipeline. + * @param pipelineInstance A pipeline instance which must extend WebGLPipeline. + */ + addPipeline(pipelineName: string, pipelineInstance: Phaser.Renderer.WebGL.WebGLPipeline): Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Pushes a new scissor state. This is used to set nested scissor states. + * @param x The x position of the scissor. + * @param y The y position of the scissor. + * @param width The width of the scissor. + * @param height The height of the scissor. + * @param drawingBufferHeight Optional drawingBufferHeight override value. + */ + pushScissor(x: integer, y: integer, width: integer, height: integer, drawingBufferHeight?: integer): integer[]; + + /** + * Sets the current scissor state. + * @param x The x position of the scissor. + * @param y The y position of the scissor. + * @param width The width of the scissor. + * @param height The height of the scissor. + * @param drawingBufferHeight Optional drawingBufferHeight override value. + */ + setScissor(x: integer, y: integer, width: integer, height: integer, drawingBufferHeight?: integer): void; + + /** + * Pops the last scissor state and sets it. + */ + popScissor(): void; + + /** + * Binds a WebGLPipeline and sets it as the current pipeline to be used. + * @param pipelineInstance The pipeline instance to be activated. + * @param gameObject The Game Object that invoked this pipeline, if any. + */ + setPipeline(pipelineInstance: Phaser.Renderer.WebGL.WebGLPipeline, gameObject?: Phaser.GameObjects.GameObject): Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Is there an active stencil mask? + */ + hasActiveStencilMask(): boolean; + + /** + * Use this to reset the gl context to the state that Phaser requires to continue rendering. + * Calling this will: + * + * * Disable `DEPTH_TEST`, `CULL_FACE` and `STENCIL_TEST`. + * * Clear the depth buffer and stencil buffers. + * * Reset the viewport size. + * * Reset the blend mode. + * * Bind a blank texture as the active texture on texture unit zero. + * * Rebinds the given pipeline instance. + * + * You should call this having previously called `clearPipeline` and then wishing to return + * control to Phaser again. + * @param pipelineInstance The pipeline instance to be activated. + */ + rebindPipeline(pipelineInstance: Phaser.Renderer.WebGL.WebGLPipeline): void; + + /** + * Flushes the current WebGLPipeline being used and then clears it, along with the + * the current shader program and vertex buffer. Then resets the blend mode to NORMAL. + * Call this before jumping to your own gl context handler, and then call `rebindPipeline` when + * you wish to return control to Phaser again. + */ + clearPipeline(): void; + + /** + * Sets the blend mode to the value given. + * + * If the current blend mode is different from the one given, the pipeline is flushed and the new + * blend mode is enabled. + * @param blendModeId The blend mode to be set. Can be a `BlendModes` const or an integer value. + * @param force Force the blend mode to be set, regardless of the currently set blend mode. Default false. + */ + setBlendMode(blendModeId: integer, force?: boolean): boolean; + + /** + * Creates a new custom blend mode for the renderer. + * @param func An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. + * @param equation The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. + */ + addBlendMode(func: Function, equation: Function): integer; + + /** + * Updates the function bound to a given custom blend mode. + * @param index The index of the custom blend mode. + * @param func The function to use for the blend mode. + * @param equation The equation to use for the blend mode. + */ + updateBlendMode(index: integer, func: Function, equation: Function): this; + + /** + * Removes a custom blend mode from the renderer. + * Any Game Objects still using this blend mode will error, so be sure to clear them first. + * @param index The index of the custom blend mode to be removed. + */ + removeBlendMode(index: integer): this; + + /** + * Binds a texture at a texture unit. If a texture is already + * bound to that unit it will force a flush on the current pipeline. + * @param texture The WebGL texture that needs to be bound. + * @param textureUnit The texture unit to which the texture will be bound. + * @param flush Will the current pipeline be flushed if this is a new texture, or not? Default true. + */ + setTexture2D(texture: WebGLTexture, textureUnit: integer, flush?: boolean): this; + + /** + * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush. + * @param framebuffer The framebuffer that needs to be bound. + * @param updateScissor If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. Default false. + */ + setFramebuffer(framebuffer: WebGLFramebuffer, updateScissor?: boolean): this; + + /** + * Binds a program. If there was another program already bound it will force a pipeline flush. + * @param program The program that needs to be bound. + */ + setProgram(program: WebGLProgram): this; + + /** + * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush. + * @param vertexBuffer The buffer that needs to be bound. + */ + setVertexBuffer(vertexBuffer: WebGLBuffer): this; + + /** + * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush. + * @param indexBuffer The buffer the needs to be bound. + */ + setIndexBuffer(indexBuffer: WebGLBuffer): this; + + /** + * Creates a texture from an image source. If the source is not valid it creates an empty texture. + * @param source The source of the texture. + * @param width The width of the texture. + * @param height The height of the texture. + * @param scaleMode The scale mode to be used by the texture. + */ + createTextureFromSource(source: object, width: integer, height: integer, scaleMode: integer): WebGLTexture; + + /** + * A wrapper for creating a WebGLTexture. If no pixel data is passed it will create an empty texture. + * @param mipLevel Mip level of the texture. + * @param minFilter Filtering of the texture. + * @param magFilter Filtering of the texture. + * @param wrapT Wrapping mode of the texture. + * @param wrapS Wrapping mode of the texture. + * @param format Which format does the texture use. + * @param pixels pixel data. + * @param width Width of the texture in pixels. + * @param height Height of the texture in pixels. + * @param pma Does the texture have premultiplied alpha? + */ + createTexture2D(mipLevel: integer, minFilter: integer, magFilter: integer, wrapT: integer, wrapS: integer, format: integer, pixels: object, width: integer, height: integer, pma: boolean): WebGLTexture; + + /** + * Wrapper for creating WebGLFramebuffer. + * @param width Width in pixels of the framebuffer + * @param height Height in pixels of the framebuffer + * @param renderTexture The color texture to where the color pixels are written + * @param addDepthStencilBuffer Indicates if the current framebuffer support depth and stencil buffers + */ + createFramebuffer(width: integer, height: integer, renderTexture: WebGLTexture, addDepthStencilBuffer: boolean): WebGLFramebuffer; + + /** + * Wrapper for creating a WebGLProgram + * @param vertexShader Source to the vertex shader + * @param fragmentShader Source to the fragment shader + */ + createProgram(vertexShader: string, fragmentShader: string): WebGLProgram; + + /** + * Wrapper for creating a vertex buffer. + * @param initialDataOrSize It's either ArrayBuffer or an integer indicating the size of the vbo + * @param bufferUsage How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW + */ + createVertexBuffer(initialDataOrSize: ArrayBuffer, bufferUsage: integer): WebGLBuffer; + + /** + * Wrapper for creating a vertex buffer. + * @param initialDataOrSize Either ArrayBuffer or an integer indicating the size of the vbo. + * @param bufferUsage How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. + */ + createIndexBuffer(initialDataOrSize: ArrayBuffer, bufferUsage: integer): WebGLBuffer; + + /** + * Removes the given texture from the nativeTextures array and then deletes it from the GPU. + * @param texture The WebGL Texture to be deleted. + */ + deleteTexture(texture: WebGLTexture): this; + + /** + * Deletes a WebGLFramebuffer from the GL instance. + * @param framebuffer The Framebuffer to be deleted. + */ + deleteFramebuffer(framebuffer: WebGLFramebuffer): this; + + /** + * Deletes a WebGLProgram from the GL instance. + * @param program The shader program to be deleted. + */ + deleteProgram(program: WebGLProgram): this; + + /** + * Deletes a WebGLBuffer from the GL instance. + * @param vertexBuffer The WebGLBuffer to be deleted. + */ + deleteBuffer(vertexBuffer: WebGLBuffer): this; + + /** + * Controls the pre-render operations for the given camera. + * Handles any clipping needed by the camera and renders the background color if a color is visible. + * @param camera The Camera to pre-render. + */ + preRenderCamera(camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Controls the post-render operations for the given camera. + * Renders the foreground camera effects like flash and fading. It resets the current scissor state. + * @param camera The Camera to post-render. + */ + postRenderCamera(camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Clears the current vertex buffer and updates pipelines. + */ + preRender(): void; + + /** + * The core render step for a Scene Camera. + * + * Iterates through the given Game Object's array and renders them with the given Camera. + * + * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked + * by the Scene Systems.render method. + * + * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. + * @param scene The Scene to render. + * @param children The Game Object's within the Scene to be rendered. + * @param interpolationPercentage The interpolation percentage to apply. Currently un-used. + * @param camera The Scene Camera to render with. + */ + render(scene: Phaser.Scene, children: Phaser.GameObjects.GameObject, interpolationPercentage: number, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * The post-render step happens after all Cameras in all Scenes have been rendered. + */ + postRender(): void; + + /** + * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. + * + * To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param callback The Function to invoke after the snapshot image is created. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshot(callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + + /** + * Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param x The x coordinate to grab from. + * @param y The y coordinate to grab from. + * @param width The width of the area to grab. + * @param height The height of the area to grab. + * @param callback The Function to invoke after the snapshot image is created. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshotArea(x: integer, y: integer, width: integer, height: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + + /** + * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then + * calling this method will override it. + * + * Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for + * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, + * using less memory. + * @param x The x coordinate of the pixel to get. + * @param y The y coordinate of the pixel to get. + * @param callback The Function to invoke after the snapshot pixel data is extracted. + */ + snapshotPixel(x: integer, y: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; + + /** + * Creates a WebGL Texture based on the given canvas element. + * @param srcCanvas The Canvas element that will be used to populate the texture. + * @param dstTexture Is this going to replace an existing texture? If so, pass it here. + * @param noRepeat Should this canvas never be allowed to set REPEAT? (such as for Text objects) Default false. + */ + canvasToTexture(srcCanvas: HTMLCanvasElement, dstTexture?: WebGLTexture, noRepeat?: boolean): WebGLTexture; + + /** + * Sets the minification and magnification filter for a texture. + * @param texture The texture to set the filter for. + * @param filter The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. + */ + setTextureFilter(texture: integer, filter: integer): this; + + /** + * [description] + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x [description] + */ + setFloat1(program: WebGLProgram, name: string, x: number): this; + + /** + * [description] + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x [description] + * @param y [description] + */ + setFloat2(program: WebGLProgram, name: string, x: number, y: number): this; + + /** + * [description] + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x [description] + * @param y [description] + * @param z [description] + */ + setFloat3(program: WebGLProgram, name: string, x: number, y: number, z: number): this; + + /** + * Sets uniform of a WebGLProgram + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + */ + setFloat4(program: WebGLProgram, name: string, x: number, y: number, z: number, w: number): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat1v(program: WebGLProgram, name: string, arr: Float32Array): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat2v(program: WebGLProgram, name: string, arr: Float32Array): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat3v(program: WebGLProgram, name: string, arr: Float32Array): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat4v(program: WebGLProgram, name: string, arr: Float32Array): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x [description] + */ + setInt1(program: WebGLProgram, name: string, x: integer): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component + * @param y The new Y component + */ + setInt2(program: WebGLProgram, name: string, x: integer, y: integer): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component + * @param y The new Y component + * @param z The new Z component + */ + setInt3(program: WebGLProgram, name: string, x: integer, y: integer, z: integer): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + */ + setInt4(program: WebGLProgram, name: string, x: integer, y: integer, z: integer, w: integer): this; + + /** + * Sets the value of a 2x2 matrix uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param transpose The value indicating whether to transpose the matrix. Must be false. + * @param matrix The new matrix value. + */ + setMatrix2(program: WebGLProgram, name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * [description] + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param transpose [description] + * @param matrix [description] + */ + setMatrix3(program: WebGLProgram, name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * Sets uniform of a WebGLProgram + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param transpose Is the matrix transposed + * @param matrix Matrix data + */ + setMatrix4(program: WebGLProgram, name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * Returns the maximum number of texture units that can be used in a fragment shader. + */ + getMaxTextures(): integer; + + /** + * Returns the largest texture size (either width or height) that can be created. + * Note that VRAM may not allow a texture of any given size, it just expresses + * hardware / driver support for a given size. + */ + getMaxTextureSize(): integer; + + /** + * Destroy this WebGLRenderer, cleaning up all related resources such as pipelines, native textures, etc. + */ + destroy(): void; + + } + + } + + } + + /** + * Phaser Scale Modes. + */ + enum ScaleModes { + /** + * Default Scale Mode (Linear). + */ + DEFAULT, + /** + * Linear Scale Mode. + */ + LINEAR, + /** + * Nearest Scale Mode. + */ + NEAREST, + } + + namespace Scale { + /** + * Phaser Scale Manager constants for centering the game canvas. + */ + enum Center { + /** + * The game canvas is not centered within the parent by Phaser. + * You can still center it yourself via CSS. + */ + NO_CENTER, + /** + * The game canvas is centered both horizontally and vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + CENTER_BOTH, + /** + * The game canvas is centered horizontally within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + CENTER_HORIZONTALLY, + /** + * The game canvas is centered both vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + CENTER_VERTICALLY, + } + + /** + * Phaser Scale Manager constants for centering the game canvas. + * + * To find out what each mode does please see [Phaser.Scale.Center]{@link Phaser.Scale.Center}. + */ + type CenterType = Phaser.Scale.Center; + + /** + * Phaser Scale Manager constants for orientation. + */ + enum Orientation { + /** + * A landscape orientation. + */ + LANDSCAPE, + /** + * A portrait orientation. + */ + PORTRAIT, + } + + /** + * Phaser Scale Manager constants for orientation. + * + * To find out what each mode does please see [Phaser.Scale.Orientation]{@link Phaser.Scale.Orientation}. + */ + type OrientationType = Phaser.Scale.Orientation; + + /** + * Phaser Scale Manager constants for the different scale modes available. + */ + enum ScaleModes { + /** + * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it + * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need + * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. + */ + NONE, + /** + * The height is automatically adjusted based on the width. + */ + WIDTH_CONTROLS_HEIGHT, + /** + * The width is automatically adjusted based on the height. + */ + HEIGHT_CONTROLS_WIDTH, + /** + * The width and height are automatically adjusted to fit inside the given target area, + * while keeping the aspect ratio. Depending on the aspect ratio there may be some space + * inside the area which is not covered. + */ + FIT, + /** + * The width and height are automatically adjusted to make the size cover the entire target + * area while keeping the aspect ratio. This may extend further out than the target size. + */ + ENVELOP, + /** + * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. + */ + RESIZE, + } + + /** + * Phaser Scale Manager constants for the different scale modes available. + * + * To find out what each mode does please see [Phaser.Scale.ScaleModes]{@link Phaser.Scale.ScaleModes}. + */ + type ScaleModeType = Phaser.Scale.ScaleModes; + + /** + * Phaser Scale Manager constants for zoom modes. + */ + enum Zoom { + /** + * The game canvas will not be zoomed by Phaser. + */ + NO_ZOOM, + /** + * The game canvas will be 2x zoomed by Phaser. + */ + ZOOM_2X, + /** + * The game canvas will be 4x zoomed by Phaser. + */ + ZOOM_4X, + /** + * Calculate the zoom value based on the maximum multiplied game size that will + * fit into the parent, or browser window if no parent is set. + */ + MAX_ZOOM, + } + + /** + * Phaser Scale Manager constants for zoom modes. + * + * To find out what each mode does please see [Phaser.Scale.Zoom]{@link Phaser.Scale.Zoom}. + */ + type ZoomType = Phaser.Scale.Zoom; + + namespace Events { + /** + * The Scale Manager has successfully entered fullscreen mode. + */ + const ENTER_FULLSCREEN: any; + + /** + * The Scale Manager tried to enter fullscreen mode but failed. + */ + const FULLSCREEN_FAILED: any; + + /** + * The Scale Manager tried to enter fullscreen mode, but it is unsupported by the browser. + */ + const FULLSCREEN_UNSUPPORTED: any; + + /** + * The Scale Manager was in fullscreen mode, but has since left, either directly via game code, + * or via a user gestured, such as pressing the ESC key. + */ + const LEAVE_FULLSCREEN: any; + + /** + * The Scale Manager Orientation Change Event. + */ + const ORIENTATION_CHANGE: any; + + /** + * The Scale Manager Resize Event. + * + * This event is dispatched whenever the Scale Manager detects a resize event from the browser. + * It sends three parameters to the callback, each of them being Size components. You can read + * the `width`, `height`, `aspectRatio` and other properties of these components to help with + * scaling your own game content. + */ + const RESIZE: any; + + } + + /** + * The Scale Manager handles the scaling, resizing and alignment of the game canvas. + * + * The way scaling is handled is by setting the game canvas to a fixed size, which is defined in the + * game configuration. You also define the parent container in the game config. If no parent is given, + * it will default to using the document body. The Scale Manager will then look at the available space + * within the _parent_ and scale the canvas accordingly. Scaling is handled by setting the canvas CSS + * width and height properties, leaving the width and height of the canvas element itself untouched. + * Scaling is therefore achieved by keeping the core canvas the same size and 'stretching' + * it via its CSS properties. This gives the same result and speed as using the `transform-scale` CSS + * property, without the need for browser prefix handling. + * + * The calculations for the scale are heavily influenced by the bounding parent size, which is the computed + * dimensions of the canvas's parent. The CSS rules of the parent element play an important role in the + * operation of the Scale Manager. For example, if the parent has no defined width or height, then actions + * like auto-centering will fail to achieve the required result. The Scale Manager works in tandem with the + * CSS you set-up on the page hosting your game, rather than taking control of it. + * + * #### Parent and Display canvas containment guidelines: + * + * - Style the Parent element (of the game canvas) to control the Parent size and thus the games size and layout. + * + * - The Parent element's CSS styles should _effectively_ apply maximum (and minimum) bounding behavior. + * + * - The Parent element should _not_ apply a padding as this is not accounted for. + * If a padding is required apply it to the Parent's parent or apply a margin to the Parent. + * If you need to add a border, margin or any other CSS around your game container, then use a parent element and + * apply the CSS to this instead, otherwise you'll be constantly resizing the shape of the game container. + * + * - The Display canvas layout CSS styles (i.e. margins, size) should not be altered / specified as + * they may be updated by the Scale Manager. + * + * #### Scale Modes + * + * The way the scaling is handled is determined by the `scaleMode` property. The default is `NO_SCALE`, + * which prevents Phaser from scaling or touching the canvas, or its parent, at all. In this mode, you are + * responsible for all scaling. The other scaling modes afford you automatic scaling. + * + * If you wish to scale your game so that it always fits into the available space within the parent, you + * should use the scale mode `FIT`. Look at the documentation for other scale modes to see what options are + * available. Here is a basic config showing how to set this scale mode: + * + * ```javascript + * scale: { + * parent: 'yourgamediv', + * mode: Phaser.Scale.FIT, + * width: 800, + * height: 600 + * } + * ``` + * + * Place the `scale` config object within your game config. + * + * If you wish for the canvas to be resized directly, so that the canvas itself fills the available space + * (i.e. it isn't scaled, it's resized) then use the `RESIZE` scale mode. This will give you a 1:1 mapping + * of canvas pixels to game size. In this mode CSS isn't used to scale the canvas, it's literally adjusted + * to fill all available space within the parent. You should be extremely careful about the size of the + * canvas you're creating when doing this, as the larger the area, the more work the GPU has to do and it's + * very easy to hit fill-rate limits quickly. + * + * For complex, custom-scaling requirements, you should probably consider using the `RESIZE` scale mode, + * with your own limitations in place re: canvas dimensions and managing the scaling with the game scenes + * yourself. For the vast majority of games, however, the `FIT` mode is likely to be the most used. + * + * Please appreciate that the Scale Manager cannot perform miracles. All it does is scale your game canvas + * as best it can, based on what it can infer from its surrounding area. There are all kinds of environments + * where it's up to you to guide and help the canvas position itself, especially when built into rendering + * frameworks like React and Vue. If your page requires meta tags to prevent user scaling gestures, or such + * like, then it's up to you to ensure they are present in the html. + * + * #### Centering + * + * You can also have the game canvas automatically centered. Again, this relies heavily on the parent being + * properly configured and styled, as the centering offsets are based entirely on the available space + * within the parent element. Centering is disabled by default, or can be applied horizontally, vertically, + * or both. Here's an example: + * + * ```javascript + * scale: { + * parent: 'yourgamediv', + * autoCenter: Phaser.Scale.CENTER_BOTH, + * width: 800, + * height: 600 + * } + * ``` + * + * #### Fullscreen API + * + * If the browser supports it, you can send your game into fullscreen mode. In this mode, the game will fill + * the entire display, removing all browser UI and anything else present on the screen. It will remain in this + * mode until your game either disables it, or until the user tabs out or presses ESCape if on desktop. It's a + * great way to achieve a desktop-game like experience from the browser, but it does require a modern browser + * to handle it. Some mobile browsers also support this. + */ + class ScaleManager extends Phaser.Events.EventEmitter { + /** + * + * @param game A reference to the Phaser.Game instance. + */ + constructor(game: Phaser.Game); + + /** + * A reference to the Phaser.Game instance. + */ + readonly game: Phaser.Game; + + /** + * A reference to the HTML Canvas Element that Phaser uses to render the game. + */ + canvas: HTMLCanvasElement; + + /** + * The DOM bounds of the canvas element. + */ + canvasBounds: Phaser.Geom.Rectangle; + + /** + * The parent object of the Canvas. Often a div, or the browser window, or nothing in non-browser environments. + * + * This is set in the Game Config as the `parent` property. If undefined (or just not present), it will default + * to use the document body. If specifically set to `null` Phaser will ignore all parent operations. + */ + parent: any; + + /** + * Is the parent element the browser window? + */ + parentIsWindow: boolean; + + /** + * The Parent Size component. + */ + parentSize: Phaser.Structs.Size; + + /** + * The Game Size component. + * + * The un-modified game size, as requested in the game config (the raw width / height), + * as used for world bounds, cameras, etc + */ + gameSize: Phaser.Structs.Size; + + /** + * The Base Size component. + * + * The modified game size, which is the gameSize * resolution, used to set the canvas width and height + * (but not the CSS style) + */ + baseSize: Phaser.Structs.Size; + + /** + * The Display Size component. + * + * The size used for the canvas style, factoring in the scale mode, parent and other values. + */ + displaySize: Phaser.Structs.Size; + + /** + * The game scale mode. + */ + scaleMode: Phaser.Scale.ScaleModeType; + + /** + * The canvas resolution. + * + * This is hard-coded to a value of 1 in the 3.16 release of Phaser and will be enabled at a later date. + */ + resolution: number; + + /** + * The game zoom factor. + * + * This value allows you to multiply your games base size by the given zoom factor. + * This is then used when calculating the display size, even in `NO_SCALE` situations. + * If you don't want Phaser to touch the canvas style at all, this value should be 1. + * + * Can also be set to `MAX_ZOOM` in which case the zoom value will be derived based + * on the game size and available space within the parent. + */ + zoom: number; + + /** + * The scale factor between the baseSize and the canvasBounds. + */ + displayScale: Phaser.Math.Vector2; + + /** + * If set, the canvas sizes will be automatically passed through Math.floor. + * This results in rounded pixel display values, which is important for performance on legacy + * and low powered devices, but at the cost of not achieving a 'perfect' fit in some browser windows. + */ + autoRound: boolean; + + /** + * Automatically center the canvas within the parent? The different centering modes are: + * + * 1. No centering. + * 2. Center both horizontally and vertically. + * 3. Center horizontally. + * 4. Center vertically. + * + * Please be aware that in order to center the game canvas, you must have specified a parent + * that has a size set, or the canvas parent is the document.body. + */ + autoCenter: Phaser.Scale.CenterType; + + /** + * The current device orientation. + * + * Orientation events are dispatched via the Device Orientation API, typically only on mobile browsers. + */ + orientation: Phaser.Scale.OrientationType; + + /** + * A reference to the Device.Fullscreen object. + */ + fullscreen: Phaser.Device.Fullscreen; + + /** + * The DOM Element which is sent into fullscreen mode. + */ + fullscreenTarget: any; + + /** + * The dirty state of the Scale Manager. + * Set if there is a change between the parent size and the current size. + */ + dirty: boolean; + + /** + * How many milliseconds should elapse before checking if the browser size has changed? + * + * Most modern browsers dispatch a 'resize' event, which the Scale Manager will listen for. + * However, older browsers fail to do this, or do it consistently, so we fall back to a + * more traditional 'size check' based on a time interval. You can control how often it is + * checked here. + */ + resizeInterval: integer; + + /** + * Called _before_ the canvas object is created and added to the DOM. + */ + protected preBoot(): void; + + /** + * The Boot handler is called by Phaser.Game when it first starts up. + * The renderer is available by now and the canvas has been added to the DOM. + */ + protected boot(): void; + + /** + * Parses the game configuration to set-up the scale defaults. + * @param config The Game configuration object. + */ + protected parseConfig(config: Phaser.Types.Core.GameConfig): void; + + /** + * Determines the parent element of the game canvas, if any, based on the game configuration. + * @param config The Game configuration object. + */ + getParent(config: Phaser.Types.Core.GameConfig): void; + + /** + * Calculates the size of the parent bounds and updates the `parentSize` component, if the canvas has a dom parent. + */ + getParentBounds(): boolean; + + /** + * Attempts to lock the orientation of the web browser using the Screen Orientation API. + * + * This API is only available on modern mobile browsers. + * See https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation for details. + * @param orientation The orientation you'd like to lock the browser in. Should be an API string such as 'landscape', 'landscape-primary', 'portrait', etc. + */ + lockOrientation(orientation: string): boolean; + + /** + * This method will set the size of the Parent Size component, which is used in scaling + * and centering calculations. You only need to call this method if you have explicitly + * disabled the use of a parent in your game config, but still wish to take advantage of + * other Scale Manager features. + * @param width The new width of the parent. + * @param height The new height of the parent. + */ + setParentSize(width: number, height: number): this; + + /** + * This method will set a new size for your game. + * + * It should only be used if you're looking to change the base size of your game and are using + * one of the Scale Manager scaling modes, i.e. `FIT`. If you're using `NO_SCALE` and wish to + * change the game and canvas size directly, then please use the `resize` method instead. + * @param width The new width of the game. + * @param height The new height of the game. + */ + setGameSize(width: number, height: number): this; + + /** + * Call this to modify the size of the Phaser canvas element directly. + * You should only use this if you are using the `NO_SCALE` scale mode, + * it will update all internal components completely. + * + * If all you want to do is change the size of the parent, see the `setParentSize` method. + * + * If all you want is to change the base size of the game, but still have the Scale Manager + * manage all the scaling (i.e. you're **not** using `NO_SCALE`), then see the `setGameSize` method. + * + * This method will set the `gameSize`, `baseSize` and `displaySize` components to the given + * dimensions. It will then resize the canvas width and height to the values given, by + * directly setting the properties. Finally, if you have set the Scale Manager zoom value + * to anything other than 1 (the default), it will set the canvas CSS width and height to + * be the given size multiplied by the zoom factor (the canvas pixel size remains untouched). + * + * If you have enabled `autoCenter`, it is then passed to the `updateCenter` method and + * the margins are set, allowing the canvas to be centered based on its parent element + * alone. Finally, the `displayScale` is adjusted and the RESIZE event dispatched. + * @param width The new width of the game. + * @param height The new height of the game. + */ + resize(width: number, height: number): this; + + /** + * Sets the zoom value of the Scale Manager. + * @param value The new zoom value of the game. + */ + setZoom(value: integer): this; + + /** + * Sets the zoom to be the maximum possible based on the _current_ parent size. + */ + setMaxZoom(): this; + + /** + * Refreshes the internal scale values, bounds sizes and orientation checks. + * + * Once finished, dispatches the resize event. + * + * This is called automatically by the Scale Manager when the browser window size changes, + * as long as it is using a Scale Mode other than 'NONE'. + * @param previousWidth The previous width of the game. Only set if the gameSize has changed. + * @param previousHeight The previous height of the game. Only set if the gameSize has changed. + */ + refresh(previousWidth?: number, previousHeight?: number): this; + + /** + * Internal method that checks the current screen orientation, only if the internal check flag is set. + * + * If the orientation has changed it updates the orientation property and then dispatches the orientation change event. + */ + updateOrientation(): void; + + /** + * Internal method that manages updating the size components based on the scale mode. + */ + updateScale(): void; + + /** + * Calculates and returns the largest possible zoom factor, based on the current + * parent and game sizes. If the parent has no dimensions (i.e. an unstyled div), + * or is smaller than the un-zoomed game, then this will return a value of 1 (no zoom) + */ + getMaxZoom(): integer; + + /** + * Calculates and updates the canvas CSS style in order to center it within the + * bounds of its parent. If you have explicitly set parent to be `null` in your + * game config then this method will likely give incorrect results unless you have called the + * `setParentSize` method first. + * + * It works by modifying the canvas CSS `marginLeft` and `marginTop` properties. + * + * If they have already been set by your own style sheet, or code, this will overwrite them. + * + * To prevent the Scale Manager from centering the canvas, either do not set the + * `autoCenter` property in your game config, or make sure it is set to `NO_CENTER`. + */ + updateCenter(): void; + + /** + * Updates the `canvasBounds` rectangle to match the bounding client rectangle of the + * canvas element being used to track input events. + */ + updateBounds(): void; + + /** + * Transforms the pageX value into the scaled coordinate space of the Scale Manager. + * @param pageX The DOM pageX value. + */ + transformX(pageX: number): number; + + /** + * Transforms the pageY value into the scaled coordinate space of the Scale Manager. + * @param pageY The DOM pageY value. + */ + transformY(pageY: number): number; + + /** + * Sends a request to the browser to ask it to go in to full screen mode, using the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API Fullscreen API}. + * + * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. + * + * This method _must_ be called from a user-input gesture, such as `pointerup`. You cannot launch + * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked + * from fullscreen unless the iframe has the `allowfullscreen` attribute. + * + * On touch devices, such as Android and iOS Safari, you should always use `pointerup` and NOT `pointerdown`, + * otherwise the request will fail unless the document in which your game is embedded has already received + * some form of touch input, which you cannot guarantee. Activating fullscreen via `pointerup` circumvents + * this issue. + * + * Performing an action that navigates to another page, or opens another tab, will automatically cancel + * fullscreen mode, as will the user pressing the ESC key. To cancel fullscreen mode directly from your game, + * i.e. by clicking an icon, call the `stopFullscreen` method. + * + * A browser can only send one DOM element into fullscreen. You can control which element this is by + * setting the `fullscreenTarget` property in your game config, or changing the property in the Scale Manager. + * Note that the game canvas _must_ be a child of the target. If you do not give a target, Phaser will + * automatically create a blank `
` element and move the canvas into it, before going fullscreen. + * When it leaves fullscreen, the div will be removed. + * @param fullscreenOptions The FullscreenOptions dictionary is used to provide configuration options when entering full screen. + */ + startFullscreen(fullscreenOptions?: object): void; + + /** + * An internal method that gets the target element that is used when entering fullscreen mode. + */ + getFullscreenTarget(): object; + + /** + * Removes the fullscreen target that was added to the DOM. + */ + removeFullscreenTarget(): void; + + /** + * Calling this method will cancel fullscreen mode, if the browser has entered it. + */ + stopFullscreen(): void; + + /** + * Toggles the fullscreen mode. If already in fullscreen, calling this will cancel it. + * If not in fullscreen, this will request the browser to enter fullscreen mode. + * + * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. + * + * This method _must_ be called from a user-input gesture, such as `pointerdown`. You cannot launch + * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked + * from fullscreen unless the iframe has the `allowfullscreen` attribute. + * @param fullscreenOptions The FullscreenOptions dictionary is used to provide configuration options when entering full screen. + */ + toggleFullscreen(fullscreenOptions?: object): void; + + /** + * An internal method that starts the different DOM event listeners running. + */ + startListeners(): void; + + /** + * Triggered when a fullscreenchange event is dispatched by the DOM. + */ + onFullScreenChange(): void; + + /** + * Triggered when a fullscreenerror event is dispatched by the DOM. + */ + onFullScreenError(): void; + + /** + * Internal method, called automatically by the game step. + * Monitors the elapsed time and resize interval to see if a parent bounds check needs to take place. + * @param time The time value from the most recent Game step. Typically a high-resolution timer value, or Date.now(). + * @param delta The delta value since the last frame. This is smoothed to avoid delta spikes by the TimeStep class. + */ + step(time: number, delta: number): void; + + /** + * Stops all DOM event listeners. + */ + stopListeners(): void; + + /** + * Destroys this Scale Manager, releasing all references to external resources. + * Once destroyed, the Scale Manager cannot be used again. + */ + destroy(): void; + + /** + * Is the browser currently in fullscreen mode or not? + */ + readonly isFullscreen: boolean; + + /** + * The game width. + * + * This is typically the size given in the game configuration. + */ + readonly width: number; + + /** + * The game height. + * + * This is typically the size given in the game configuration. + */ + readonly height: number; + + /** + * Is the device in a portrait orientation as reported by the Orientation API? + * This value is usually only available on mobile devices. + */ + readonly isPortrait: boolean; + + /** + * Is the device in a landscape orientation as reported by the Orientation API? + * This value is usually only available on mobile devices. + */ + readonly isLandscape: boolean; + + /** + * Are the game dimensions portrait? (i.e. taller than they are wide) + * + * This is different to the device itself being in a portrait orientation. + */ + readonly isGamePortrait: boolean; + + /** + * Are the game dimensions landscape? (i.e. wider than they are tall) + * + * This is different to the device itself being in a landscape orientation. + */ + readonly isGameLandscape: boolean; + + } + + /** + * The game canvas is not centered within the parent by Phaser. + * You can still center it yourself via CSS. + */ + const NO_CENTER: integer; + + /** + * The game canvas is centered both horizontally and vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + const CENTER_BOTH: integer; + + /** + * The game canvas is centered horizontally within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + const CENTER_HORIZONTALLY: integer; + + /** + * The game canvas is centered both vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + const CENTER_VERTICALLY: integer; + + /** + * A landscape orientation. + */ + const LANDSCAPE: string; + + /** + * A portrait orientation. + */ + const PORTRAIT: string; + + /** + * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it + * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need + * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. + */ + const NONE: integer; + + /** + * The height is automatically adjusted based on the width. + */ + const WIDTH_CONTROLS_HEIGHT: integer; + + /** + * The width is automatically adjusted based on the height. + */ + const HEIGHT_CONTROLS_WIDTH: integer; + + /** + * The width and height are automatically adjusted to fit inside the given target area, + * while keeping the aspect ratio. Depending on the aspect ratio there may be some space + * inside the area which is not covered. + */ + const FIT: integer; + + /** + * The width and height are automatically adjusted to make the size cover the entire target + * area while keeping the aspect ratio. This may extend further out than the target size. + */ + const ENVELOP: integer; + + /** + * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. + */ + const RESIZE: integer; + + /** + * The game canvas will not be zoomed by Phaser. + */ + const NO_ZOOM: integer; + + /** + * The game canvas will be 2x zoomed by Phaser. + */ + const ZOOM_2X: integer; + + /** + * The game canvas will be 4x zoomed by Phaser. + */ + const ZOOM_4X: integer; + + /** + * Calculate the zoom value based on the maximum multiplied game size that will + * fit into the parent, or browser window if no parent is set. + */ + const MAX_ZOOM: integer; + + } + + namespace Scenes { + /** + * Scene state. + */ + var PENDING: integer; + + /** + * Scene state. + */ + var INIT: integer; + + /** + * Scene state. + */ + var START: integer; + + /** + * Scene state. + */ + var LOADING: integer; + + /** + * Scene state. + */ + var CREATING: integer; + + /** + * Scene state. + */ + var RUNNING: integer; + + /** + * Scene state. + */ + var PAUSED: integer; + + /** + * Scene state. + */ + var SLEEPING: integer; + + /** + * Scene state. + */ + var SHUTDOWN: integer; + + /** + * Scene state. + */ + var DESTROYED: integer; + + namespace Events { + /** + * The Scene Systems Boot Event. + * + * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.scene.events.on('boot', listener)`. + */ + const BOOT: any; + + /** + * The Scene Create Event. + * + * This event is dispatched by a Scene after it has been created by the Scene Manager. + * + * If a Scene has a `create` method then this event is emitted _after_ that has run. + * + * If there is a transition, this event will be fired after the `TRANSITION_START` event. + * + * Listen to it from a Scene using `this.scene.events.on('create', listener)`. + */ + const CREATE: any; + + /** + * The Scene Systems Destroy Event. + * + * This event is dispatched by a Scene during the Scene Systems destroy process. + * + * Listen to it from a Scene using `this.scene.events.on('destroy', listener)`. + * + * You should destroy any resources that may be in use by your Scene in this event handler. + */ + const DESTROY: any; + + /** + * The Scene Systems Pause Event. + * + * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an + * action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('pause', listener)`. + */ + const PAUSE: any; + + /** + * The Scene Systems Post Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + */ + const POST_UPDATE: any; + + /** + * The Scene Systems Pre Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + */ + const PRE_UPDATE: any; + + /** + * The Scene Systems Ready Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. + * By this point in the process the Scene is now fully active and rendering. + * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. + * + * Listen to it from a Scene using `this.scene.events.on('ready', listener)`. + */ + const READY: any; + + /** + * The Scene Systems Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('render', listener)`. + * + * A Scene will only render if it is visible and active. + * By the time this event is dispatched, the Scene will have already been rendered. + */ + const RENDER: any; + + /** + * The Scene Systems Resume Event. + * + * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('resume', listener)`. + */ + const RESUME: any; + + /** + * The Scene Systems Shutdown Event. + * + * This event is dispatched by a Scene during the Scene Systems shutdown process. + * + * Listen to it from a Scene using `this.scene.events.on('shutdown', listener)`. + * + * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding + * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not + * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. + */ + const SHUTDOWN: any; + + /** + * The Scene Systems Sleep Event. + * + * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('sleep', listener)`. + */ + const SLEEP: any; + + /** + * The Scene Systems Start Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.scene.events.on('start', listener)`. + */ + const START: any; + + /** + * The Scene Transition Complete Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration + * of the transition. + * + * Listen to it from a Scene using `this.scene.events.on('transitioncomplete', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_COMPLETE: any; + + /** + * The Scene Transition Init Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, + * this event is not dispatched. + * + * Listen to it from a Scene using `this.scene.events.on('transitioninit', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_INIT: any; + + /** + * The Scene Transition Out Event. + * + * This event is dispatched by a Scene when it initiates a transition to another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('transitionout', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_OUT: any; + + /** + * The Scene Transition Start Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. + * + * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, + * this event is dispatched anyway. + * + * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is + * dispatched instead of this event. + * + * Listen to it from a Scene using `this.scene.events.on('transitionstart', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_START: any; + + /** + * The Scene Transition Wake Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before + * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. + * + * Listen to it from a Scene using `this.scene.events.on('transitionwake', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_WAKE: any; + + /** + * The Scene Systems Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + */ + const UPDATE: any; + + /** + * The Scene Systems Wake Event. + * + * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('wake', listener)`. + */ + const WAKE: any; + + } + + /** + * Builds an array of which physics plugins should be activated for the given Scene. + * @param sys The scene system to get the physics systems of. + */ + function GetPhysicsPlugins(sys: Phaser.Scenes.Systems): any[]; + + /** + * Builds an array of which plugins (not including physics plugins) should be activated for the given Scene. + * @param sys The Scene Systems object to check for plugins. + */ + function GetScenePlugins(sys: Phaser.Scenes.Systems): any[]; + + /** + * The Scene Manager. + * + * The Scene Manager is a Game level system, responsible for creating, processing and updating all of the + * Scenes in a Game instance. + */ + class SceneManager { + /** + * + * @param game The Phaser.Game instance this Scene Manager belongs to. + * @param sceneConfig Scene specific configuration settings. + */ + constructor(game: Phaser.Game, sceneConfig: object); + + /** + * The Game that this SceneManager belongs to. + */ + game: Phaser.Game; + + /** + * An object that maps the keys to the scene so we can quickly get a scene from a key without iteration. + */ + keys: object; + + /** + * The array in which all of the scenes are kept. + */ + scenes: any[]; + + /** + * Is the Scene Manager actively processing the Scenes list? + */ + readonly isProcessing: boolean; + + /** + * Has the Scene Manager properly started? + */ + readonly isBooted: boolean; + + /** + * Do any of the Cameras in any of the Scenes require a custom viewport? + * If not we can skip scissor tests. + */ + customViewports: number; + + /** + * Process the Scene operations queue. + */ + processQueue(): void; + + /** + * Adds a new Scene into the SceneManager. + * You must give each Scene a unique key by which you'll identify it. + * + * The `sceneConfig` can be: + * + * * A `Phaser.Scene` object, or an object that extends it. + * * A plain JavaScript object + * * A JavaScript ES6 Class that extends `Phaser.Scene` + * * A JavaScript ES5 prototype based Class + * * A JavaScript function + * + * If a function is given then a new Scene will be created by calling it. + * @param key A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`. + * @param sceneConfig The config for the Scene + * @param autoStart If `true` the Scene will be started immediately after being added. Default false. + * @param data Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`. + */ + add(key: string, sceneConfig: Phaser.Scene | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig | Function, autoStart?: boolean, data?: object): Phaser.Scene; + + /** + * Removes a Scene from the SceneManager. + * + * The Scene is removed from the local scenes array, it's key is cleared from the keys + * cache and Scene.Systems.destroy is then called on it. + * + * If the SceneManager is processing the Scenes when this method is called it will + * queue the operation for the next update sequence. + * @param scene The Scene to be removed. + */ + remove(scene: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Updates the Scenes. + * @param time Time elapsed. + * @param delta Delta time from the last update. + */ + update(time: number, delta: number): void; + + /** + * Renders the Scenes. + * @param renderer The renderer to use. + */ + render(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer): void; + + /** + * Returns an array of all the current Scenes being managed by this Scene Manager. + * + * You can filter the output by the active state of the Scene and choose to have + * the array returned in normal or reversed order. + * @param isActive Only include Scene's that are currently active? Default true. + * @param inReverse Return the array of Scenes in reverse? Default false. + */ + getScenes(isActive?: boolean, inReverse?: boolean): Phaser.Scene[]; + + /** + * Retrieves a Scene. + * @param key The Scene to retrieve. + */ + getScene(key: string | Phaser.Scene): Phaser.Scene; + + /** + * Determines whether a Scene is running. + * @param key The Scene to check. + */ + isActive(key: string): boolean; + + /** + * Determines whether a Scene is paused. + * @param key The Scene to check. + */ + isPaused(key: string): boolean; + + /** + * Determines whether a Scene is visible. + * @param key The Scene to check. + */ + isVisible(key: string): boolean; + + /** + * Determines whether a Scene is sleeping. + * @param key The Scene to check. + */ + isSleeping(key: string): boolean; + + /** + * Pauses the given Scene. + * @param key The Scene to pause. + * @param data An optional data object that will be passed to the Scene and emitted by its pause event. + */ + pause(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Resumes the given Scene. + * @param key The Scene to resume. + * @param data An optional data object that will be passed to the Scene and emitted by its resume event. + */ + resume(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Puts the given Scene to sleep. + * @param key The Scene to put to sleep. + * @param data An optional data object that will be passed to the Scene and emitted by its sleep event. + */ + sleep(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Awakens the given Scene. + * @param key The Scene to wake up. + * @param data An optional data object that will be passed to the Scene and emitted by its wake event. + */ + wake(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Runs the given Scene, but does not change the state of this Scene. + * + * If the given Scene is paused, it will resume it. If sleeping, it will wake it. + * If not running at all, it will be started. + * + * Use this if you wish to open a modal Scene by calling `pause` on the current + * Scene, then `run` on the modal Scene. + * @param key The Scene to run. + * @param data A data object that will be passed to the Scene on start, wake, or resume. + */ + run(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Starts the given Scene. + * @param key The Scene to start. + * @param data Optional data object to pass to Scene.Settings and Scene.init. + */ + start(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Stops the given Scene. + * @param key The Scene to stop. + */ + stop(key: string): Phaser.Scenes.SceneManager; + + /** + * Sleeps one one Scene and starts the other. + * @param from The Scene to sleep. + * @param to The Scene to start. + */ + switch(from: string, to: string): Phaser.Scenes.SceneManager; + + /** + * Retrieves a Scene by numeric index. + * @param index The index of the Scene to retrieve. + */ + getAt(index: integer): Phaser.Scene | undefined; + + /** + * Retrieves the numeric index of a Scene. + * @param key The key of the Scene. + */ + getIndex(key: string | Phaser.Scene): integer; + + /** + * Brings a Scene to the top of the Scenes list. + * + * This means it will render above all other Scenes. + * @param key The Scene to move. + */ + bringToTop(key: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Sends a Scene to the back of the Scenes list. + * + * This means it will render below all other Scenes. + * @param key The Scene to move. + */ + sendToBack(key: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Moves a Scene down one position in the Scenes list. + * @param key The Scene to move. + */ + moveDown(key: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Moves a Scene up one position in the Scenes list. + * @param key The Scene to move. + */ + moveUp(key: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Moves a Scene so it is immediately above another Scene in the Scenes list. + * + * This means it will render over the top of the other Scene. + * @param keyA The Scene that Scene B will be moved above. + * @param keyB The Scene to be moved. + */ + moveAbove(keyA: string | Phaser.Scene, keyB: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Moves a Scene so it is immediately below another Scene in the Scenes list. + * + * This means it will render behind the other Scene. + * @param keyA The Scene that Scene B will be moved above. + * @param keyB The Scene to be moved. + */ + moveBelow(keyA: string | Phaser.Scene, keyB: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Swaps the positions of two Scenes in the Scenes list. + * @param keyA The first Scene to swap. + * @param keyB The second Scene to swap. + */ + swapPosition(keyA: string | Phaser.Scene, keyB: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Dumps debug information about each Scene to the developer console. + */ + dump(): void; + + /** + * Destroy the SceneManager and all of its Scene's systems. + */ + destroy(): void; + + } + + /** + * A proxy class to the Global Scene Manager. + */ + class ScenePlugin { + /** + * + * @param scene The Scene that this ScenePlugin belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene that this ScenePlugin belongs to. + */ + scene: Phaser.Scene; + + /** + * The Scene Systems instance of the Scene that this ScenePlugin belongs to. + */ + systems: Phaser.Scenes.Systems; + + /** + * The settings of the Scene this ScenePlugin belongs to. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * The key of the Scene this ScenePlugin belongs to. + */ + key: string; + + /** + * The Game's SceneManager. + */ + manager: Phaser.Scenes.SceneManager; + + /** + * If this Scene is currently transitioning to another, this holds + * the current percentage of the transition progress, between 0 and 1. + */ + transitionProgress: number; + + /** + * Shutdown this Scene and run the given one. + * @param key The Scene to start. + * @param data The Scene data. + */ + start(key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Restarts this Scene. + * @param data The Scene data. + */ + restart(data?: object): Phaser.Scenes.ScenePlugin; + + /** + * This will start a transition from the current Scene to the target Scene given. + * + * The transition will last for the duration specified in milliseconds. + * + * You can have the target Scene moved above or below this one in the display list. + * + * You can specify an update callback. This callback will be invoked _every frame_ for the duration + * of the transition. + * + * This Scene can either be sent to sleep at the end of the transition, or stopped. The default is to stop. + * + * There are also 5 transition related events: This scene will emit the event `transitionout` when + * the transition begins, which is typically the frame after calling this method. + * + * The target Scene will emit the event `transitioninit` when that Scene's `init` method is called. + * It will then emit the event `transitionstart` when its `create` method is called. + * If the Scene was sleeping and has been woken up, it will emit the event `transitionwake` instead of these two, + * as the Scenes `init` and `create` methods are not invoked when a Scene wakes up. + * + * When the duration of the transition has elapsed it will emit the event `transitioncomplete`. + * These events are cleared of all listeners when the Scene shuts down, but not if it is sent to sleep. + * + * It's important to understand that the duration of the transition begins the moment you call this method. + * If the Scene you are transitioning to includes delayed processes, such as waiting for files to load, the + * time still counts down even while that is happening. If the game itself pauses, or something else causes + * this Scenes update loop to stop, then the transition will also pause for that duration. There are + * checks in place to prevent you accidentally stopping a transitioning Scene but if you've got code to + * override this understand that until the target Scene completes it might never be unlocked for input events. + * @param config The transition configuration object. + */ + transition(config: Phaser.Types.Scenes.SceneTransitionConfig): boolean; + + /** + * Add the Scene into the Scene Manager and start it if 'autoStart' is true or the Scene config 'active' property is set. + * @param key The Scene key. + * @param sceneConfig The config for the Scene. + * @param autoStart Whether to start the Scene after it's added. + * @param data Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`. + */ + add(key: string, sceneConfig: Phaser.Scene | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig | Function, autoStart: boolean, data?: object): Phaser.Scene; + + /** + * Launch the given Scene and run it in parallel with this one. + * @param key The Scene to launch. + * @param data The Scene data. + */ + launch(key: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Runs the given Scene, but does not change the state of this Scene. + * + * If the given Scene is paused, it will resume it. If sleeping, it will wake it. + * If not running at all, it will be started. + * + * Use this if you wish to open a modal Scene by calling `pause` on the current + * Scene, then `run` on the modal Scene. + * @param key The Scene to run. + * @param data A data object that will be passed to the Scene and emitted in its ready, wake, or resume events. + */ + run(key: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Pause the Scene - this stops the update step from happening but it still renders. + * @param key The Scene to pause. + * @param data An optional data object that will be passed to the Scene and emitted in its pause event. + */ + pause(key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Resume the Scene - starts the update loop again. + * @param key The Scene to resume. + * @param data An optional data object that will be passed to the Scene and emitted in its resume event. + */ + resume(key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Makes the Scene sleep (no update, no render) but doesn't shutdown. + * @param key The Scene to put to sleep. + * @param data An optional data object that will be passed to the Scene and emitted in its sleep event. + */ + sleep(key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Makes the Scene wake-up (starts update and render) + * @param key The Scene to wake up. + * @param data An optional data object that will be passed to the Scene and emitted in its wake event. + */ + wake(key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Makes this Scene sleep then starts the Scene given. + * + * No checks are made to see if an instance of the given Scene is already running. + * Because Scenes in Phaser are non-exclusive, you are allowed to run multiple + * instances of them _at the same time_. This means, calling this function + * may launch another instance of the requested Scene if it's already running. + * @param key The Scene to start. + */ + switch(key: string): Phaser.Scenes.ScenePlugin; + + /** + * Shutdown the Scene, clearing display list, timers, etc. + * @param key The Scene to stop. + */ + stop(key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Sets the active state of the given Scene. + * @param value If `true` the Scene will be resumed. If `false` it will be paused. + * @param key The Scene to set the active state of. + * @param data An optional data object that will be passed to the Scene and emitted with its events. + */ + setActive(value: boolean, key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Sets the visible state of the given Scene. + * @param value The visible value. + * @param key The Scene to set the visible state for. + */ + setVisible(value: boolean, key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Checks if the given Scene is sleeping or not? + * @param key The Scene to check. + */ + isSleeping(key?: string): boolean; + + /** + * Checks if the given Scene is running or not? + * @param key The Scene to check. + */ + isActive(key?: string): boolean; + + /** + * Checks if the given Scene is paused or not? + * @param key The Scene to check. + */ + isPaused(key?: string): boolean; + + /** + * Checks if the given Scene is visible or not? + * @param key The Scene to check. + */ + isVisible(key?: string): boolean; + + /** + * Swaps the position of two scenes in the Scenes list. + * + * This controls the order in which they are rendered and updated. + * @param keyA The first Scene to swap. + * @param keyB The second Scene to swap. If none is given it defaults to this Scene. + */ + swapPosition(keyA: string, keyB?: string): Phaser.Scenes.ScenePlugin; + + /** + * Swaps the position of two scenes in the Scenes list, so that Scene B is directly above Scene A. + * + * This controls the order in which they are rendered and updated. + * @param keyA The Scene that Scene B will be moved to be above. + * @param keyB The Scene to be moved. If none is given it defaults to this Scene. + */ + moveAbove(keyA: string, keyB?: string): Phaser.Scenes.ScenePlugin; + + /** + * Swaps the position of two scenes in the Scenes list, so that Scene B is directly below Scene A. + * + * This controls the order in which they are rendered and updated. + * @param keyA The Scene that Scene B will be moved to be below. + * @param keyB The Scene to be moved. If none is given it defaults to this Scene. + */ + moveBelow(keyA: string, keyB?: string): Phaser.Scenes.ScenePlugin; + + /** + * Removes a Scene from the SceneManager. + * + * The Scene is removed from the local scenes array, it's key is cleared from the keys + * cache and Scene.Systems.destroy is then called on it. + * + * If the SceneManager is processing the Scenes when this method is called it wil + * queue the operation for the next update sequence. + * @param key The Scene to be removed. + */ + remove(key?: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Moves a Scene up one position in the Scenes list. + * @param key The Scene to move. + */ + moveUp(key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Moves a Scene down one position in the Scenes list. + * @param key The Scene to move. + */ + moveDown(key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Brings a Scene to the top of the Scenes list. + * + * This means it will render above all other Scenes. + * @param key The Scene to move. + */ + bringToTop(key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Sends a Scene to the back of the Scenes list. + * + * This means it will render below all other Scenes. + * @param key The Scene to move. + */ + sendToBack(key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Retrieve a Scene. + * @param key The Scene to retrieve. + */ + get(key: string): Phaser.Scene; + + /** + * Retrieves the numeric index of a Scene in the Scenes list. + * @param key The Scene to get the index of. + */ + getIndex(key?: string | Phaser.Scene): integer; + + } + + namespace Settings { + /** + * Takes a Scene configuration object and returns a fully formed System Settings object. + * @param config The Scene configuration object used to create this Scene Settings. + */ + function create(config: string | Phaser.Types.Scenes.SettingsConfig): Phaser.Types.Scenes.SettingsObject; + + } + + /** + * The Scene Systems class. + * + * This class is available from within a Scene under the property `sys`. + * It is responsible for managing all of the plugins a Scene has running, including the display list, and + * handling the update step and renderer. It also contains references to global systems belonging to Game. + */ + class Systems { + /** + * + * @param scene The Scene that owns this Systems instance. + * @param config Scene specific configuration settings. + */ + constructor(scene: Phaser.Scene, config: string | Phaser.Types.Scenes.SettingsConfig); + + /** + * A reference to the Scene that these Systems belong to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Phaser Game instance. + */ + game: Phaser.Game; + + /** + * A reference to either the Canvas or WebGL Renderer that this Game is using. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The Facebook Instant Games Plugin. + */ + facebook: Phaser.FacebookInstantGamesPlugin; + + /** + * The Scene Configuration object, as passed in when creating the Scene. + */ + config: string | Phaser.Types.Scenes.SettingsConfig; + + /** + * The Scene Settings. This is the parsed output based on the Scene configuration. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * A handy reference to the Scene canvas / context. + */ + canvas: HTMLCanvasElement; + + /** + * A reference to the Canvas Rendering Context being used by the renderer. + */ + context: CanvasRenderingContext2D; + + /** + * A reference to the global Animations Manager. + * + * In the default set-up you can access this from within a Scene via the `this.anims` property. + */ + anims: Phaser.Animations.AnimationManager; + + /** + * A reference to the global Cache. The Cache stores all files bought in to Phaser via + * the Loader, with the exception of images. Images are stored in the Texture Manager. + * + * In the default set-up you can access this from within a Scene via the `this.cache` property. + */ + cache: Phaser.Cache.CacheManager; + + /** + * A reference to the global Plugins Manager. + * + * In the default set-up you can access this from within a Scene via the `this.plugins` property. + */ + plugins: Phaser.Plugins.PluginManager; + + /** + * A reference to the global registry. This is a game-wide instance of the Data Manager, allowing + * you to exchange data between Scenes via a universal and shared point. + * + * In the default set-up you can access this from within a Scene via the `this.registry` property. + */ + registry: Phaser.Data.DataManager; + + /** + * A reference to the global Scale Manager. + * + * In the default set-up you can access this from within a Scene via the `this.scale` property. + */ + scale: Phaser.Scale.ScaleManager; + + /** + * A reference to the global Sound Manager. + * + * In the default set-up you can access this from within a Scene via the `this.sound` property. + */ + sound: Phaser.Sound.BaseSoundManager; + + /** + * A reference to the global Texture Manager. + * + * In the default set-up you can access this from within a Scene via the `this.textures` property. + */ + textures: Phaser.Textures.TextureManager; + + /** + * A reference to the Scene's Game Object Factory. + * + * Use this to quickly and easily create new Game Object's. + * + * In the default set-up you can access this from within a Scene via the `this.add` property. + */ + add: Phaser.GameObjects.GameObjectFactory; + + /** + * A reference to the Scene's Camera Manager. + * + * Use this to manipulate and create Cameras for this specific Scene. + * + * In the default set-up you can access this from within a Scene via the `this.cameras` property. + */ + cameras: Phaser.Cameras.Scene2D.CameraManager; + + /** + * A reference to the Scene's Display List. + * + * Use this to organize the children contained in the display list. + * + * In the default set-up you can access this from within a Scene via the `this.children` property. + */ + displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene's Event Manager. + * + * Use this to listen for Scene specific events, such as `pause` and `shutdown`. + * + * In the default set-up you can access this from within a Scene via the `this.events` property. + */ + events: Phaser.Events.EventEmitter; + + /** + * A reference to the Scene's Game Object Creator. + * + * Use this to quickly and easily create new Game Object's. The difference between this and the + * Game Object Factory, is that the Creator just creates and returns Game Object instances, it + * doesn't then add them to the Display List or Update List. + * + * In the default set-up you can access this from within a Scene via the `this.make` property. + */ + make: Phaser.GameObjects.GameObjectCreator; + + /** + * A reference to the Scene Manager Plugin. + * + * Use this to manipulate both this and other Scene's in your game, for example to launch a parallel Scene, + * or pause or resume a Scene, or switch from this Scene to another. + * + * In the default set-up you can access this from within a Scene via the `this.scene` property. + */ + scenePlugin: Phaser.Scenes.ScenePlugin; + + /** + * A reference to the Scene's Update List. + * + * Use this to organize the children contained in the update list. + * + * The Update List is responsible for managing children that need their `preUpdate` methods called, + * in order to process so internal components, such as Sprites with Animations. + * + * In the default set-up there is no reference to this from within the Scene itself. + */ + updateList: Phaser.GameObjects.UpdateList; + + /** + * This method is called only once by the Scene Manager when the Scene is instantiated. + * It is responsible for setting up all of the Scene plugins and references. + * It should never be called directly. + * @param game A reference to the Phaser Game instance. + */ + protected init(game: Phaser.Game): void; + + /** + * A single game step. Called automatically by the Scene Manager as a result of a Request Animation + * Frame or Set Timeout call to the main Game instance. + * @param time The time value from the most recent Game step. Typically a high-resolution timer value, or Date.now(). + * @param delta The delta value since the last frame. This is smoothed to avoid delta spikes by the TimeStep class. + */ + step(time: number, delta: number): void; + + /** + * Called automatically by the Scene Manager. + * Instructs the Scene to render itself via its Camera Manager to the renderer given. + * @param renderer The renderer that invoked the render call. + */ + render(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer): void; + + /** + * Force a sort of the display list on the next render. + */ + queueDepthSort(): void; + + /** + * Immediately sorts the display list if the flag is set. + */ + depthSort(): void; + + /** + * Pause this Scene. + * A paused Scene still renders, it just doesn't run ANY of its update handlers or systems. + * @param data A data object that will be passed in the 'pause' event. + */ + pause(data?: object): Phaser.Scenes.Systems; + + /** + * Resume this Scene from a paused state. + * @param data A data object that will be passed in the 'resume' event. + */ + resume(data?: object): Phaser.Scenes.Systems; + + /** + * Send this Scene to sleep. + * + * A sleeping Scene doesn't run it's update step or render anything, but it also isn't shut down + * or have any of its systems or children removed, meaning it can be re-activated at any point and + * will carry on from where it left off. It also keeps everything in memory and events and callbacks + * from other Scenes may still invoke changes within it, so be careful what is left active. + * @param data A data object that will be passed in the 'sleep' event. + */ + sleep(data?: object): Phaser.Scenes.Systems; + + /** + * Wake-up this Scene if it was previously asleep. + * @param data A data object that will be passed in the 'wake' event. + */ + wake(data?: object): Phaser.Scenes.Systems; + + /** + * Is this Scene sleeping? + */ + isSleeping(): boolean; + + /** + * Is this Scene running? + */ + isActive(): boolean; + + /** + * Is this Scene paused? + */ + isPaused(): boolean; + + /** + * Is this Scene currently transitioning out to, or in from another Scene? + */ + isTransitioning(): boolean; + + /** + * Is this Scene currently transitioning out from itself to another Scene? + */ + isTransitionOut(): boolean; + + /** + * Is this Scene currently transitioning in from another Scene? + */ + isTransitionIn(): boolean; + + /** + * Is this Scene visible and rendering? + */ + isVisible(): boolean; + + /** + * Sets the visible state of this Scene. + * An invisible Scene will not render, but will still process updates. + * @param value `true` to render this Scene, otherwise `false`. + */ + setVisible(value: boolean): Phaser.Scenes.Systems; + + /** + * Set the active state of this Scene. + * + * An active Scene will run its core update loop. + * @param value If `true` the Scene will be resumed, if previously paused. If `false` it will be paused. + * @param data A data object that will be passed in the 'resume' or 'pause' events. + */ + setActive(value: boolean, data?: object): Phaser.Scenes.Systems; + + /** + * Start this Scene running and rendering. + * Called automatically by the SceneManager. + * @param data Optional data object that may have been passed to this Scene from another. + */ + start(data: object): void; + + /** + * Shutdown this Scene and send a shutdown event to all of its systems. + * A Scene that has been shutdown will not run its update loop or render, but it does + * not destroy any of its plugins or references. It is put into hibernation for later use. + * If you don't ever plan to use this Scene again, then it should be destroyed instead + * to free-up resources. + * @param data A data object that will be passed in the 'shutdown' event. + */ + shutdown(data?: object): void; + + } + + } + + /** + * A base Phaser.Scene class which can be extended for your own use. + */ + class Scene { + /** + * + * @param config Scene specific configuration settings. + */ + constructor(config: string | Phaser.Types.Scenes.SettingsConfig); + + /** + * The Scene Systems. You must never overwrite this property, or all hell will break lose. + */ + sys: Phaser.Scenes.Systems; + + /** + * A reference to the Phaser.Game instance. + * This property will only be available if defined in the Scene Injection Map. + */ + game: Phaser.Game; + + /** + * A reference to the global Animation Manager. + * This property will only be available if defined in the Scene Injection Map. + */ + anims: Phaser.Animations.AnimationManager; + + /** + * A reference to the global Cache. + * This property will only be available if defined in the Scene Injection Map. + */ + cache: Phaser.Cache.CacheManager; + + /** + * A reference to the game level Data Manager. + * This property will only be available if defined in the Scene Injection Map. + */ + registry: Phaser.Data.DataManager; + + /** + * A reference to the Sound Manager. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + sound: Phaser.Sound.BaseSoundManager; + + /** + * A reference to the Texture Manager. + * This property will only be available if defined in the Scene Injection Map. + */ + textures: Phaser.Textures.TextureManager; + + /** + * A scene level Event Emitter. + * This property will only be available if defined in the Scene Injection Map. + */ + events: Phaser.Events.EventEmitter; + + /** + * A scene level Camera System. + * This property will only be available if defined in the Scene Injection Map. + */ + cameras: Phaser.Cameras.Scene2D.CameraManager; + + /** + * A scene level Game Object Factory. + * This property will only be available if defined in the Scene Injection Map. + */ + add: Phaser.GameObjects.GameObjectFactory; + + /** + * A scene level Game Object Creator. + * This property will only be available if defined in the Scene Injection Map. + */ + make: Phaser.GameObjects.GameObjectCreator; + + /** + * A reference to the Scene Manager Plugin. + * This property will only be available if defined in the Scene Injection Map. + */ + scene: Phaser.Scenes.ScenePlugin; + + /** + * A scene level Game Object Display List. + * This property will only be available if defined in the Scene Injection Map. + */ + children: Phaser.GameObjects.DisplayList; + + /** + * A scene level Lights Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + lights: Phaser.GameObjects.LightsManager; + + /** + * A scene level Data Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + data: Phaser.Data.DataManager; + + /** + * A scene level Input Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + input: Phaser.Input.InputPlugin; + + /** + * A scene level Loader Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + load: Phaser.Loader.LoaderPlugin; + + /** + * A scene level Time and Clock Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + time: Phaser.Time.Clock; + + /** + * A scene level Tween Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + tweens: Phaser.Tweens.TweenManager; + + /** + * A scene level Arcade Physics Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + physics: Phaser.Physics.Arcade.ArcadePhysics; + + /** + * A scene level Impact Physics Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + impact: Phaser.Physics.Impact.ImpactPhysics; + + /** + * A scene level Matter Physics Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + matter: Phaser.Physics.Matter.MatterPhysics; + + /** + * A scene level Facebook Instant Games Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + facebook: Phaser.FacebookInstantGamesPlugin; + + /** + * A reference to the global Scale Manager. + * This property will only be available if defined in the Scene Injection Map. + */ + scale: Phaser.Scale.ScaleManager; + + /** + * A reference to the Plugin Manager. + * + * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install + * those plugins into Scenes as required. + */ + plugins: Phaser.Plugins.PluginManager; + + /** + * Should be overridden by your own Scenes. + * This method is called once per game step while the scene is running. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(time: number, delta: number): void; + + } + + namespace Sound { + /** + * Class containing all the shared state and behavior of a sound object, independent of the implementation. + */ + class BaseSound extends Phaser.Events.EventEmitter { + /** + * + * @param manager Reference to the current sound manager instance. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. + */ + constructor(manager: Phaser.Sound.BaseSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + + /** + * Asset key for the sound. + */ + readonly key: string; + + /** + * Flag indicating if sound is currently playing. + */ + readonly isPlaying: boolean; + + /** + * Flag indicating if sound is currently paused. + */ + readonly isPaused: boolean; + + /** + * A property that holds the value of sound's actual playback rate, + * after its rate and detune values has been combined with global + * rate and detune values. + */ + readonly totalRate: number; + + /** + * A value representing the duration, in seconds. + * It could be total sound duration or a marker duration. + */ + readonly duration: number; + + /** + * The total duration of the sound in seconds. + */ + readonly totalDuration: number; + + /** + * Object containing markers definitions. + */ + readonly markers: {[key: string]: Phaser.Types.Sound.SoundMarker}; + + /** + * Currently playing marker. + * 'null' if whole sound is playing. + */ + readonly currentMarker: Phaser.Types.Sound.SoundMarker; + + /** + * Adds a marker into the current sound. A marker is represented by name, start time, duration, and optionally config object. + * This allows you to bundle multiple sounds together into a single audio file and use markers to jump between them for playback. + * @param marker Marker object. + */ + addMarker(marker: Phaser.Types.Sound.SoundMarker): boolean; + + /** + * Updates previously added marker. + * @param marker Marker object with updated values. + */ + updateMarker(marker: Phaser.Types.Sound.SoundMarker): boolean; + + /** + * Removes a marker from the sound. + * @param markerName The name of the marker to remove. + */ + removeMarker(markerName: string): Phaser.Types.Sound.SoundMarker; + + /** + * Play this sound, or a marked section of it. + * It always plays the sound from the start. If you want to start playback from a specific time + * you can set 'seek' setting of the config object, provided to this call, to that value. + * @param markerName If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound. Default ''. + * @param config Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound. + */ + play(markerName?: string, config?: Phaser.Types.Sound.SoundConfig): boolean; + + /** + * Pauses the sound. + */ + pause(): boolean; + + /** + * Resumes the sound. + */ + resume(): boolean; + + /** + * Stop playing this sound. + */ + stop(): boolean; + + /** + * Method used internally for applying config values to some of the sound properties. + */ + protected applyConfig(): void; + + /** + * Method used internally for resetting values of some of the config properties. + */ + protected resetConfig(): void; + + /** + * Update method called automatically by sound manager on every game step. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time elapsed since the last frame. + */ + protected update(time: number, delta: number): void; + + /** + * Method used internally to calculate total playback rate of the sound. + */ + protected calculateRate(): void; + + /** + * Destroys this sound and all associated events and marks it for removal from the sound manager. + */ + destroy(): void; + + } + + /** + * The sound manager is responsible for playing back audio via Web Audio API or HTML Audio tag as fallback. + * The audio file type and the encoding of those files are extremely important. + * + * Not all browsers can play all audio formats. + * + * There is a good guide to what's supported [here](https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Cross-browser_audio_basics#Audio_Codec_Support). + */ + class BaseSoundManager extends Phaser.Events.EventEmitter { + /** + * + * @param game Reference to the current game instance. + */ + constructor(game: Phaser.Game); + + /** + * Local reference to game. + */ + readonly game: Phaser.Game; + + /** + * Local reference to the JSON Cache, as used by Audio Sprites. + */ + readonly jsonCache: Phaser.Cache.BaseCache; + + /** + * Global mute setting. + */ + mute: boolean; + + /** + * Global volume setting. + */ + volume: number; + + /** + * Flag indicating if sounds should be paused when game looses focus, + * for instance when user switches to another tab/program/app. + */ + pauseOnBlur: boolean; + + /** + * Mobile devices require sounds to be triggered from an explicit user action, + * such as a tap, before any sound can be loaded/played on a web page. + * Set to true if the audio system is currently locked awaiting user interaction. + */ + readonly locked: boolean; + + /** + * Adds a new sound into the sound manager. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. + */ + add(key: string, config?: Phaser.Types.Sound.SoundConfig): Phaser.Sound.BaseSound; + + /** + * Adds a new audio sprite sound into the sound manager. + * Audio Sprites are a combination of audio files and a JSON configuration. + * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. + */ + addAudioSprite(key: string, config?: Phaser.Types.Sound.SoundConfig): Phaser.Types.Sound.AudioSpriteSound; + + /** + * Enables playing sound on the fly without the need to keep a reference to it. + * Sound will auto destroy once its playback ends. + * @param key Asset key for the sound. + * @param extra An optional additional object containing settings to be applied to the sound. It could be either config or marker object. + */ + play(key: string, extra?: Phaser.Types.Sound.SoundConfig | Phaser.Types.Sound.SoundMarker): boolean; + + /** + * Enables playing audio sprite sound on the fly without the need to keep a reference to it. + * Sound will auto destroy once its playback ends. + * @param key Asset key for the sound. + * @param spriteName The name of the sound sprite to play. + * @param config An optional config object containing default sound settings. + */ + playAudioSprite(key: string, spriteName: string, config?: Phaser.Types.Sound.SoundConfig): boolean; + + /** + * Removes a sound from the sound manager. + * The removed sound is destroyed before removal. + * @param sound The sound object to remove. + */ + remove(sound: Phaser.Sound.BaseSound): boolean; + + /** + * Removes all sounds from the sound manager that have an asset key matching the given value. + * The removed sounds are destroyed before removal. + * @param key The key to match when removing sound objects. + */ + removeByKey(key: string): number; + + /** + * Pauses all the sounds in the game. + */ + pauseAll(): void; + + /** + * Resumes all the sounds in the game. + */ + resumeAll(): void; + + /** + * Stops all the sounds in the game. + */ + stopAll(): void; + + /** + * Method used internally for unlocking audio playback on devices that + * require user interaction before any sound can be played on a web page. + * + * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09). + */ + protected unlock(): void; + + /** + * Method used internally for pausing sound manager if + * Phaser.Sound.BaseSoundManager#pauseOnBlur is set to true. + */ + protected onBlur(): void; + + /** + * Method used internally for resuming sound manager if + * Phaser.Sound.BaseSoundManager#pauseOnBlur is set to true. + */ + protected onFocus(): void; + + /** + * Update method called on every game step. + * Removes destroyed sounds and updates every active sound in the game. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time elapsed since the last frame. + */ + protected update(time: number, delta: number): void; + + /** + * Destroys all the sounds in the game and all associated events. + */ + destroy(): void; + + /** + * Sets the global playback rate at which all the sounds will be played. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * @param value Global playback rate at which all the sounds will be played. + */ + setRate(value: number): Phaser.Sound.BaseSoundManager; + + /** + * Global playback rate at which all the sounds will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audio's playback speed. + */ + rate: number; + + /** + * Sets the global detuning of all sounds in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * @param value The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + setDetune(value: number): Phaser.Sound.BaseSoundManager; + + /** + * Global detuning of all sounds in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + detune: number; + + } + + namespace Events { + /** + * The Sound Complete Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they complete playback. + * + * Listen to it from a Sound instance using `Sound.on('complete', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('complete', listener); + * music.play(); + * ``` + */ + const COMPLETE: any; + + /** + * The Audio Data Decoded All Event. + * + * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method, + * once all files passed to the method have been decoded (or errored). + * + * Use `Phaser.Sound.Events#DECODED` to listen for single sounds being decoded, and `DECODED_ALL` to + * listen for them all completing. + * + * Listen to it from the Sound Manager in a Scene using `this.sound.on('decodedall', listener)`, i.e.: + * + * ```javascript + * this.sound.once('decodedall', handler); + * this.sound.decodeAudio([ audioFiles ]); + * ``` + */ + const DECODED_ALL: any; + + /** + * The Audio Data Decoded Event. + * + * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method. + * + * Listen to it from the Sound Manager in a Scene using `this.sound.on('decoded', listener)`, i.e.: + * + * ```javascript + * this.sound.on('decoded', handler); + * this.sound.decodeAudio(key, audioData); + * ``` + */ + const DECODED: any; + + /** + * The Sound Destroy Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are destroyed, either + * directly or via a Sound Manager. + * + * Listen to it from a Sound instance using `Sound.on('destroy', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('destroy', listener); + * music.destroy(); + * ``` + */ + const DESTROY: any; + + /** + * The Sound Detune Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their detune value changes. + * + * Listen to it from a Sound instance using `Sound.on('detune', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('detune', listener); + * music.play(); + * music.setDetune(200); + * ``` + */ + const DETUNE: any; + + /** + * The Sound Manager Global Detune Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `detune` property of the Sound Manager is changed, which globally + * adjusts the detuning of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('rate', listener)`. + */ + const GLOBAL_DETUNE: any; + + /** + * The Sound Manager Global Mute Event. + * + * This event is dispatched by the Sound Manager when its `mute` property is changed, either directly + * or via the `setMute` method. This changes the mute state of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('mute', listener)`. + */ + const GLOBAL_MUTE: any; + + /** + * The Sound Manager Global Rate Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `rate` property of the Sound Manager is changed, which globally + * adjusts the playback rate of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('rate', listener)`. + */ + const GLOBAL_RATE: any; + + /** + * The Sound Manager Global Volume Event. + * + * This event is dispatched by the Sound Manager when its `volume` property is changed, either directly + * or via the `setVolume` method. This changes the volume of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('volume', listener)`. + */ + const GLOBAL_VOLUME: any; + + /** + * The Sound Looped Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they loop during playback. + * + * Listen to it from a Sound instance using `Sound.on('looped', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('looped', listener); + * music.setLoop(true); + * music.play(); + * ``` + * + * This is not to be confused with the [LOOP]{@linkcode Phaser.Sound.Events#event:LOOP} event, which only emits when the loop state of a Sound is changed. + */ + const LOOPED: any; + + /** + * The Sound Loop Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed. + * + * Listen to it from a Sound instance using `Sound.on('loop', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('loop', listener); + * music.setLoop(true); + * ``` + * + * This is not to be confused with the [LOOPED]{@linkcode Phaser.Sound.Events#event:LOOPED} event, which emits each time a Sound loops during playback. + */ + const LOOP: any; + + /** + * The Sound Mute Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their mute state changes. + * + * Listen to it from a Sound instance using `Sound.on('mute', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('mute', listener); + * music.play(); + * music.setMute(true); + * ``` + */ + const MUTE: any; + + /** + * The Pause All Sounds Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `pauseAll` method is invoked and after all current Sounds + * have been paused. + * + * Listen to it from a Scene using: `this.sound.on('pauseall', listener)`. + */ + const PAUSE_ALL: any; + + /** + * The Sound Pause Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are paused. + * + * Listen to it from a Sound instance using `Sound.on('pause', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('pause', listener); + * music.play(); + * music.pause(); + * ``` + */ + const PAUSE: any; + + /** + * The Sound Play Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are played. + * + * Listen to it from a Sound instance using `Sound.on('play', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('play', listener); + * music.play(); + * ``` + */ + const PLAY: any; + + /** + * The Sound Rate Change Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their rate changes. + * + * Listen to it from a Sound instance using `Sound.on('rate', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('rate', listener); + * music.play(); + * music.setRate(0.5); + * ``` + */ + const RATE: any; + + /** + * The Resume All Sounds Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `resumeAll` method is invoked and after all current Sounds + * have been resumed. + * + * Listen to it from a Scene using: `this.sound.on('resumeall', listener)`. + */ + const RESUME_ALL: any; + + /** + * The Sound Resume Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are resumed from a paused state. + * + * Listen to it from a Sound instance using `Sound.on('resume', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('resume', listener); + * music.play(); + * music.pause(); + * music.resume(); + * ``` + */ + const RESUME: any; + + /** + * The Sound Seek Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are seeked to a new position. + * + * Listen to it from a Sound instance using `Sound.on('seek', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('seek', listener); + * music.play(); + * music.setSeek(5000); + * ``` + */ + const SEEK: any; + + /** + * The Stop All Sounds Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `stopAll` method is invoked and after all current Sounds + * have been stopped. + * + * Listen to it from a Scene using: `this.sound.on('stopall', listener)`. + */ + const STOP_ALL: any; + + /** + * The Sound Stop Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are stopped. + * + * Listen to it from a Sound instance using `Sound.on('stop', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('stop', listener); + * music.play(); + * music.stop(); + * ``` + */ + const STOP: any; + + /** + * The Sound Manager Unlocked Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched during the update loop when the Sound Manager becomes unlocked. For + * Web Audio this is on the first user gesture on the page. + * + * Listen to it from a Scene using: `this.sound.on('unlocked', listener)`. + */ + const UNLOCKED: any; + + /** + * The Sound Volume Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes. + * + * Listen to it from a Sound instance using `Sound.on('volume', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('volume', listener); + * music.play(); + * music.setVolume(0.5); + * ``` + */ + const VOLUME: any; + + } + + /** + * HTML5 Audio implementation of the sound. + */ + class HTML5AudioSound extends Phaser.Sound.BaseSound { + /** + * + * @param manager Reference to the current sound manager instance. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. Default {}. + */ + constructor(manager: Phaser.Sound.HTML5AudioSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + + /** + * Play this sound, or a marked section of it. + * It always plays the sound from the start. If you want to start playback from a specific time + * you can set 'seek' setting of the config object, provided to this call, to that value. + * @param markerName If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound. Default ''. + * @param config Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound. + */ + play(markerName?: string, config?: Phaser.Types.Sound.SoundConfig): boolean; + + /** + * Pauses the sound. + */ + pause(): boolean; + + /** + * Resumes the sound. + */ + resume(): boolean; + + /** + * Stop playing this sound. + */ + stop(): boolean; + + /** + * Update method called automatically by sound manager on every game step. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time elapsed since the last frame. + */ + protected update(time: number, delta: number): void; + + /** + * Calls Phaser.Sound.BaseSound#destroy method + * and cleans up all HTML5 Audio related stuff. + */ + destroy(): void; + + /** + * Method used internally to calculate total playback rate of the sound. + */ + protected calculateRate(): void; + + /** + * Boolean indicating whether the sound is muted or not. + * Gets or sets the muted state of this sound. + */ + mute: boolean; + + /** + * Sets the muted state of this Sound. + * @param value `true` to mute this sound, `false` to unmute it. + */ + setMute(value: boolean): Phaser.Sound.HTML5AudioSound; + + /** + * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume). + */ + volume: number; + + /** + * Sets the volume of this Sound. + * @param value The volume of the sound. + */ + setVolume(value: number): Phaser.Sound.HTML5AudioSound; + + /** + * Rate at which this Sound will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + */ + rate: number; + + /** + * Sets the playback rate of this Sound. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * @param value The playback rate at of this Sound. + */ + setRate(value: number): Phaser.Sound.HTML5AudioSound; + + /** + * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + detune: number; + + /** + * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * @param value The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + setDetune(value: number): Phaser.Sound.HTML5AudioSound; + + /** + * Property representing the position of playback for this sound, in seconds. + * Setting it to a specific value moves current playback to that position. + * The value given is clamped to the range 0 to current marker duration. + * Setting seek of a stopped sound has no effect. + */ + seek: number; + + /** + * Seeks to a specific point in this sound. + * @param value The point in the sound to seek to. + */ + setSeek(value: number): Phaser.Sound.HTML5AudioSound; + + /** + * Flag indicating whether or not the sound or current sound marker will loop. + */ + loop: boolean; + + /** + * Sets the loop state of this Sound. + * @param value `true` to loop this sound, `false` to not loop it. + */ + setLoop(value: boolean): Phaser.Sound.HTML5AudioSound; + + } + + /** + * HTML5AudioSoundManager + */ + class HTML5AudioSoundManager extends Phaser.Sound.BaseSoundManager { + /** + * + * @param game Reference to the current game instance. + */ + constructor(game: Phaser.Game); + + /** + * Flag indicating whether if there are no idle instances of HTML5 Audio tag, + * for any particular sound, if one of the used tags should be hijacked and used + * for succeeding playback or if succeeding Phaser.Sound.HTML5AudioSound#play + * call should be ignored. + */ + override: boolean; + + /** + * Value representing time difference, in seconds, between calling + * play method on an audio tag and when it actually starts playing. + * It is used to achieve more accurate delayed sound playback. + * + * You might need to tweak this value to get the desired results + * since audio play delay varies depending on the browser/platform. + */ + audioPlayDelay: number; + + /** + * A value by which we should offset the loop end marker of the + * looping sound to compensate for lag, caused by changing audio + * tag playback position, in order to achieve gapless looping. + * + * You might need to tweak this value to get the desired results + * since loop lag varies depending on the browser/platform. + */ + loopEndOffset: number; + + /** + * Adds a new sound into the sound manager. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. + */ + add(key: string, config?: Phaser.Types.Sound.SoundConfig): Phaser.Sound.HTML5AudioSound; + + /** + * Unlocks HTML5 Audio loading and playback on mobile + * devices on the initial explicit user interaction. + */ + unlock(): void; + + /** + * Method used internally for pausing sound manager if + * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. + */ + protected onBlur(): void; + + /** + * Method used internally for resuming sound manager if + * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. + */ + protected onFocus(): void; + + /** + * Calls Phaser.Sound.BaseSoundManager#destroy method + * and cleans up all HTML5 Audio related stuff. + */ + destroy(): void; + + /** + * Method used internally by Phaser.Sound.HTML5AudioSound class methods and property setters + * to check if sound manager is locked and then either perform action immediately or queue it + * to be performed once the sound manager gets unlocked. + * @param sound Sound object on which to perform queued action. + * @param prop Name of the method to be called or property to be assigned a value to. + * @param value An optional parameter that either holds an array of arguments to be passed to the method call or value to be set to the property. + */ + protected isLocked(sound: Phaser.Sound.HTML5AudioSound, prop: string, value?: any): boolean; + + /** + * Sets the muted state of all this Sound Manager. + * @param value `true` to mute all sounds, `false` to unmute them. + */ + setMute(value: boolean): Phaser.Sound.HTML5AudioSoundManager; + + mute: boolean; + + /** + * Sets the volume of this Sound Manager. + * @param value The global volume of this Sound Manager. + */ + setVolume(value: number): Phaser.Sound.HTML5AudioSoundManager; + + volume: number; + + } + + /** + * No audio implementation of the sound. It is used if audio has been + * disabled in the game config or the device doesn't support any audio. + * + * It represents a graceful degradation of sound logic that provides + * minimal functionality and prevents Phaser projects that use audio from + * breaking on devices that don't support any audio playback technologies. + */ + class NoAudioSound extends Phaser.Sound.BaseSound { + /** + * + * @param manager Reference to the current sound manager instance. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. Default {}. + */ + constructor(manager: Phaser.Sound.NoAudioSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + + } + + /** + * No audio implementation of the sound manager. It is used if audio has been + * disabled in the game config or the device doesn't support any audio. + * + * It represents a graceful degradation of sound manager logic that provides + * minimal functionality and prevents Phaser projects that use audio from + * breaking on devices that don't support any audio playback technologies. + */ + class NoAudioSoundManager extends Phaser.Sound.BaseSoundManager { + /** + * + * @param game Reference to the current game instance. + */ + constructor(game: Phaser.Game); + + } + + /** + * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings. + * + * Be aware of https://developers.google.com/web/updates/2017/09/autoplay-policy-changes + * @param game Reference to the current game instance. + */ + function SoundManagerCreator(game: Phaser.Game): void; + + /** + * Web Audio API implementation of the sound. + */ + class WebAudioSound extends Phaser.Sound.BaseSound { + /** + * + * @param manager Reference to the current sound manager instance. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. Default {}. + */ + constructor(manager: Phaser.Sound.WebAudioSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + + /** + * Play this sound, or a marked section of it. + * + * It always plays the sound from the start. If you want to start playback from a specific time + * you can set 'seek' setting of the config object, provided to this call, to that value. + * @param markerName If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound. Default ''. + * @param config Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound. + */ + play(markerName?: string, config?: Phaser.Types.Sound.SoundConfig): boolean; + + /** + * Pauses the sound. + */ + pause(): boolean; + + /** + * Resumes the sound. + */ + resume(): boolean; + + /** + * Stop playing this sound. + */ + stop(): boolean; + + /** + * Method used internally for applying config values to some of the sound properties. + */ + protected applyConfig(): void; + + /** + * Update method called automatically by sound manager on every game step. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time elapsed since the last frame. + */ + protected update(time: number, delta: number): void; + + /** + * Calls Phaser.Sound.BaseSound#destroy method + * and cleans up all Web Audio API related stuff. + */ + destroy(): void; + + /** + * Method used internally to calculate total playback rate of the sound. + */ + protected calculateRate(): void; + + /** + * Rate at which this Sound will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + */ + rate: number; + + /** + * Sets the playback rate of this Sound. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * @param value The playback rate at of this Sound. + */ + setRate(value: number): Phaser.Sound.WebAudioSound; + + /** + * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + detune: number; + + /** + * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * @param value The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + setDetune(value: number): Phaser.Sound.WebAudioSound; + + /** + * Boolean indicating whether the sound is muted or not. + * Gets or sets the muted state of this sound. + */ + mute: boolean; + + /** + * Sets the muted state of this Sound. + * @param value `true` to mute this sound, `false` to unmute it. + */ + setMute(value: boolean): Phaser.Sound.WebAudioSound; + + /** + * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume). + */ + volume: number; + + /** + * Sets the volume of this Sound. + * @param value The volume of the sound. + */ + setVolume(value: number): Phaser.Sound.WebAudioSound; + + /** + * Property representing the position of playback for this sound, in seconds. + * Setting it to a specific value moves current playback to that position. + * The value given is clamped to the range 0 to current marker duration. + * Setting seek of a stopped sound has no effect. + */ + seek: number; + + /** + * Seeks to a specific point in this sound. + * @param value The point in the sound to seek to. + */ + setSeek(value: number): Phaser.Sound.WebAudioSound; + + /** + * Flag indicating whether or not the sound or current sound marker will loop. + */ + loop: boolean; + + /** + * Sets the loop state of this Sound. + * @param value `true` to loop this sound, `false` to not loop it. + */ + setLoop(value: boolean): Phaser.Sound.WebAudioSound; + + } + + /** + * Web Audio API implementation of the sound manager. + */ + class WebAudioSoundManager extends Phaser.Sound.BaseSoundManager { + /** + * + * @param game Reference to the current game instance. + */ + constructor(game: Phaser.Game); + + /** + * Adds a new sound into the sound manager. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. + */ + add(key: string, config?: Phaser.Types.Sound.SoundConfig): Phaser.Sound.WebAudioSound; + + /** + * Decode audio data into a format ready for playback via Web Audio. + * + * The audio data can be a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. + * + * The `audioKey` is the key that will be used to save the decoded audio to the audio cache. + * + * Instead of passing a single entry you can instead pass an array of `Phaser.Types.Sound.DecodeAudioConfig` + * objects as the first and only argument. + * + * Decoding is an async process, so be sure to listen for the events to know when decoding has completed. + * + * Once the audio has decoded it can be added to the Sound Manager or played via its key. + * @param audioKey The string-based key to be used to reference the decoded audio in the audio cache, or an array of audio config objects. + * @param audioData The audio data, either a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. + */ + decodeAudio(audioKey?: Phaser.Types.Sound.DecodeAudioConfig[] | string, audioData?: ArrayBuffer | string): void; + + /** + * Unlocks Web Audio API on the initial input event. + * + * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09). + */ + unlock(): void; + + /** + * Method used internally for pausing sound manager if + * Phaser.Sound.WebAudioSoundManager#pauseOnBlur is set to true. + */ + protected onBlur(): void; + + /** + * Method used internally for resuming sound manager if + * Phaser.Sound.WebAudioSoundManager#pauseOnBlur is set to true. + */ + protected onFocus(): void; + + /** + * Calls Phaser.Sound.BaseSoundManager#destroy method + * and cleans up all Web Audio API related stuff. + */ + destroy(): void; + + /** + * Sets the muted state of all this Sound Manager. + * @param value `true` to mute all sounds, `false` to unmute them. + */ + setMute(value: boolean): Phaser.Sound.WebAudioSoundManager; + + mute: boolean; + + /** + * Sets the volume of this Sound Manager. + * @param value The global volume of this Sound Manager. + */ + setVolume(value: number): Phaser.Sound.WebAudioSoundManager; + + volume: number; + + } + + } + + namespace Structs { + /** + * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. + */ + class List { + /** + * + * @param parent The parent of this list. + */ + constructor(parent: any); + + /** + * The parent of this list. + */ + parent: any; + + /** + * The objects that belong to this collection. + */ + list: T[]; + + /** + * The index of the current element. + * + * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. + */ + position: integer; + + /** + * A callback that is invoked every time a child is added to this list. + */ + addCallback: Function; + + /** + * A callback that is invoked every time a child is removed from this list. + */ + removeCallback: Function; + + /** + * The property key to sort by. + */ + _sortKey: string; + + /** + * Adds the given item to the end of the list. Each item must be unique. + * @param child The item, or array of items, to add to the list. + * @param skipCallback Skip calling the List.addCallback if this child is added successfully. Default false. + */ + add(child: T, skipCallback?: boolean): T; + + /** + * Adds an item to list, starting at a specified index. Each item must be unique within the list. + * @param child The item, or array of items, to add to the list. + * @param index The index in the list at which the element(s) will be inserted. Default 0. + * @param skipCallback Skip calling the List.addCallback if this child is added successfully. Default false. + */ + addAt(child: T, index?: integer, skipCallback?: boolean): T; + + /** + * Retrieves the item at a given position inside the List. + * @param index The index of the item. + */ + getAt(index: integer): T; + + /** + * Locates an item within the List and returns its index. + * @param child The item to locate. + */ + getIndex(child: T): integer; + + /** + * Sort the contents of this List so the items are in order based on the given property. + * For example, `sort('alpha')` would sort the List contents based on the value of their `alpha` property. + * @param property The property to lexically sort by. + * @param handler Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean. + */ + sort(property: string, handler?: Function): T[]; + + /** + * Searches for the first instance of a child with its `name` + * property matching the given argument. Should more than one child have + * the same name only the first is returned. + * @param name The name to search for. + */ + getByName(name: string): T | null; + + /** + * Returns a random child from the group. + * @param startIndex Offset from the front of the group (lowest child). Default 0. + * @param length Restriction on the number of values you want to randomly select from. Default (to top). + */ + getRandom(startIndex?: integer, length?: integer): T | null; + + /** + * Returns the first element in a given part of the List which matches a specific criterion. + * @param property The name of the property to test or a falsey value to have no criterion. + * @param value The value to test the `property` against, or `undefined` to allow any value and only check for existence. + * @param startIndex The position in the List to start the search at. Default 0. + * @param endIndex The position in the List to optionally stop the search at. It won't be checked. + */ + getFirst(property: string, value: any, startIndex?: number, endIndex?: number): T | null; + + /** + * Returns all children in this List. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('parent')` would return only children that have a property called `parent`. + * + * You can also specify a value to compare the property to: + * + * `getAll('visible', true)` would return only children that have their visible property set to `true`. + * + * Optionally you can specify a start and end index. For example if this List had 100 children, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 children in the List. + * @param property An optional property to test against the value argument. + * @param value If property is set then Child.property must strictly equal this value to be included in the results. + * @param startIndex The first child index to start the search from. + * @param endIndex The last child index to search up until. + */ + getAll(property?: string, value?: T, startIndex?: integer, endIndex?: integer): T[]; + + /** + * Returns the total number of items in the List which have a property matching the given value. + * @param property The property to test on each item. + * @param value The value to test the property against. + */ + count(property: string, value: T): integer; + + /** + * Swaps the positions of two items in the list. + * @param child1 The first item to swap. + * @param child2 The second item to swap. + */ + swap(child1: T, child2: T): void; + + /** + * Moves an item in the List to a new position. + * @param child The item to move. + * @param index Moves an item in the List to a new position. + */ + moveTo(child: T, index: integer): T; + + /** + * Removes one or many items from the List. + * @param child The item, or array of items, to remove. + * @param skipCallback Skip calling the List.removeCallback. Default false. + */ + remove(child: T, skipCallback?: boolean): T; + + /** + * Removes the item at the given position in the List. + * @param index The position to remove the item from. + * @param skipCallback Skip calling the List.removeCallback. Default false. + */ + removeAt(index: integer, skipCallback?: boolean): T; + + /** + * Removes the items within the given range in the List. + * @param startIndex The index to start removing from. Default 0. + * @param endIndex The position to stop removing at. The item at this position won't be removed. + * @param skipCallback Skip calling the List.removeCallback. Default false. + */ + removeBetween(startIndex?: integer, endIndex?: integer, skipCallback?: boolean): T[]; + + /** + * Removes all the items. + * @param skipCallback Skip calling the List.removeCallback. Default false. + */ + removeAll(skipCallback?: boolean): Phaser.Structs.List; + + /** + * Brings the given child to the top of this List. + * @param child The item to bring to the top of the List. + */ + bringToTop(child: T): T; + + /** + * Sends the given child to the bottom of this List. + * @param child The item to send to the back of the list. + */ + sendToBack(child: T): T; + + /** + * Moves the given child up one place in this group unless it's already at the top. + * @param child The item to move up. + */ + moveUp(child: T): T; + + /** + * Moves the given child down one place in this group unless it's already at the bottom. + * @param child The item to move down. + */ + moveDown(child: T): T; + + /** + * Reverses the order of all children in this List. + */ + reverse(): Phaser.Structs.List; + + /** + * Shuffles the items in the list. + */ + shuffle(): Phaser.Structs.List; + + /** + * Replaces a child of this List with the given newChild. The newChild cannot be a member of this List. + * @param oldChild The child in this List that will be replaced. + * @param newChild The child to be inserted into this List. + */ + replace(oldChild: T, newChild: T): T; + + /** + * Checks if an item exists within the List. + * @param child The item to check for the existence of. + */ + exists(child: T): boolean; + + /** + * Sets the property `key` to the given value on all members of this List. + * @param property The name of the property to set. + * @param value The value to set the property to. + * @param startIndex The first child index to start the search from. + * @param endIndex The last child index to search up until. + */ + setAll(property: string, value: T, startIndex?: integer, endIndex?: integer): void; + + /** + * Passes all children to the given callback. + * @param callback The function to call. + * @param context Value to use as `this` when executing callback. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + each(callback: EachListCallback, context?: any, ...args: any[]): void; + + /** + * Clears the List and recreates its internal array. + */ + shutdown(): void; + + /** + * Destroys this List. + */ + destroy(): void; + + /** + * The number of items inside the List. + */ + readonly length: integer; + + /** + * The first item in the List or `null` for an empty List. + */ + readonly first: T; + + /** + * The last item in the List, or `null` for an empty List. + */ + readonly last: T; + + /** + * The next item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. + */ + readonly next: T; + + /** + * The previous item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. + */ + readonly previous: T; + + } + + /** + * The keys of a Map can be arbitrary values. + * + * ```javascript + * var map = new Map([ + * [ 1, 'one' ], + * [ 2, 'two' ], + * [ 3, 'three' ] + * ]); + * ``` + */ + class Map { + /** + * + * @param elements An optional array of key-value pairs to populate this Map with. + */ + constructor(elements: V[]); + + /** + * The entries in this Map. + */ + entries: {[key: string]: V}; + + /** + * The number of key / value pairs in this Map. + */ + size: number; + + /** + * Adds an element with a specified `key` and `value` to this Map. + * If the `key` already exists, the value will be replaced. + * @param key The key of the element to be added to this Map. + * @param value The value of the element to be added to this Map. + */ + set(key: K, value: V): Phaser.Structs.Map; + + /** + * Returns the value associated to the `key`, or `undefined` if there is none. + * @param key The key of the element to return from the `Map` object. + */ + get(key: K): V; + + /** + * Returns an `Array` of all the values stored in this Map. + */ + getArray(): V[]; + + /** + * Returns a boolean indicating whether an element with the specified key exists or not. + * @param key The key of the element to test for presence of in this Map. + */ + has(key: K): boolean; + + /** + * Delete the specified element from this Map. + * @param key The key of the element to delete from this Map. + */ + delete(key: K): Phaser.Structs.Map; + + /** + * Delete all entries from this Map. + */ + clear(): Phaser.Structs.Map; + + /** + * Returns all entries keys in this Map. + */ + keys(): K[]; + + /** + * Returns an `Array` of all entries. + */ + values(): V[]; + + /** + * Dumps the contents of this Map to the console via `console.group`. + */ + dump(): void; + + /** + * Passes all entries in this Map to the given callback. + * @param callback The callback which will receive the keys and entries held in this Map. + */ + each(callback: EachMapCallback): Phaser.Structs.Map; + + /** + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. + * @param value The value to search for. + */ + contains(value: V): boolean; + + /** + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. + * @param map The Map to merge in to this Map. + * @param override Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. Default false. + */ + merge(map: Phaser.Structs.Map, override?: boolean): Phaser.Structs.Map; + + } + + /** + * A Process Queue maintains three internal lists. + * + * The `pending` list is a selection of items which are due to be made 'active' in the next update. + * The `active` list is a selection of items which are considered active and should be updated. + * The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update. + * + * When new items are added to a Process Queue they are put in the pending list, rather than being added + * immediately the active list. Equally, items that are removed are put into the destroy list, rather than + * being destroyed immediately. This allows the Process Queue to carefully process each item at a specific, fixed + * time, rather than at the time of the request from the API. + */ + class ProcessQueue { + /** + * Adds a new item to the Process Queue. + * The item is added to the pending list and made active in the next update. + * @param item The item to add to the queue. + */ + add(item: T): Phaser.Structs.ProcessQueue; + + /** + * Removes an item from the Process Queue. + * The item is added to the pending destroy and fully removed in the next update. + * @param item The item to be removed from the queue. + */ + remove(item: T): Phaser.Structs.ProcessQueue; + + /** + * Update this queue. First it will process any items awaiting destruction, and remove them. + * + * Then it will check to see if there are any items pending insertion, and move them to an + * active state. Finally, it will return a list of active items for further processing. + */ + update(): T[]; + + /** + * Returns the current list of active items. + */ + getActive(): T[]; + + /** + * Immediately destroys this process queue, clearing all of its internal arrays and resetting the process totals. + */ + destroy(): void; + + } + + /** + * RBush is a high-performance JavaScript library for 2D spatial indexing of points and rectangles. + * It's based on an optimized R-tree data structure with bulk insertion support. + * + * Spatial index is a special data structure for points and rectangles that allows you to perform queries like + * "all items within this bounding box" very efficiently (e.g. hundreds of times faster than looping over all items). + * + * This version of RBush uses a fixed min/max accessor structure of `[ '.left', '.top', '.right', '.bottom' ]`. + * This is to avoid the eval like function creation that the original library used, which caused CSP policy violations. + * + * rbush is forked from https://github.com/mourner/rbush by Vladimir Agafonkin + */ + class RTree { + } + + /** + * A Set is a collection of unique elements. + */ + class Set { + /** + * + * @param elements An optional array of elements to insert into this Set. + */ + constructor(elements?: T[]); + + /** + * The entries of this Set. Stored internally as an array. + */ + entries: T[]; + + /** + * Inserts the provided value into this Set. If the value is already contained in this Set this method will have no effect. + * @param value The value to insert into this Set. + */ + set(value: T): Phaser.Structs.Set; + + /** + * Get an element of this Set which has a property of the specified name, if that property is equal to the specified value. + * If no elements of this Set satisfy the condition then this method will return `null`. + * @param property The property name to check on the elements of this Set. + * @param value The value to check for. + */ + get(property: string, value: T): T; + + /** + * Returns an array containing all the values in this Set. + */ + getArray(): T[]; + + /** + * Removes the given value from this Set if this Set contains that value. + * @param value The value to remove from the Set. + */ + delete(value: T): Phaser.Structs.Set; + + /** + * Dumps the contents of this Set to the console via `console.group`. + */ + dump(): void; + + /** + * Passes each value in this Set to the given callback. + * Use this function when you know this Set will be modified during the iteration, otherwise use `iterate`. + * @param callback The callback to be invoked and passed each value this Set contains. + * @param callbackScope The scope of the callback. + */ + each(callback: EachSetCallback, callbackScope?: any): Phaser.Structs.Set; + + /** + * Passes each value in this Set to the given callback. + * For when you absolutely know this Set won't be modified during the iteration. + * @param callback The callback to be invoked and passed each value this Set contains. + * @param callbackScope The scope of the callback. + */ + iterate(callback: EachSetCallback, callbackScope?: any): Phaser.Structs.Set; + + /** + * Goes through each entry in this Set and invokes the given function on them, passing in the arguments. + * @param callbackKey The key of the function to be invoked on each Set entry. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + iterateLocal(callbackKey: string, ...args: any[]): Phaser.Structs.Set; + + /** + * Clears this Set so that it no longer contains any values. + */ + clear(): Phaser.Structs.Set; + + /** + * Returns `true` if this Set contains the given value, otherwise returns `false`. + * @param value The value to check for in this Set. + */ + contains(value: T): boolean; + + /** + * Returns a new Set containing all values that are either in this Set or in the Set provided as an argument. + * @param set The Set to perform the union with. + */ + union(set: Phaser.Structs.Set): Phaser.Structs.Set; + + /** + * Returns a new Set that contains only the values which are in this Set and that are also in the given Set. + * @param set The Set to intersect this set with. + */ + intersect(set: Phaser.Structs.Set): Phaser.Structs.Set; + + /** + * Returns a new Set containing all the values in this Set which are *not* also in the given Set. + * @param set The Set to perform the difference with. + */ + difference(set: Phaser.Structs.Set): Phaser.Structs.Set; + + /** + * The size of this Set. This is the number of entries within it. + * Changing the size will truncate the Set if the given value is smaller than the current size. + * Increasing the size larger than the current size has no effect. + */ + size: integer; + + } + + /** + * The Size component allows you to set `width` and `height` properties and define the relationship between them. + * + * The component can automatically maintain the aspect ratios between the two values, and clamp them + * to a defined min-max range. You can also control the dominant axis. When dimensions are given to the Size component + * that would cause it to exceed its min-max range, the dimensions are adjusted based on the dominant axis. + */ + class Size { + /** + * + * @param width The width of the Size component. Default 0. + * @param height The height of the Size component. If not given, it will use the `width`. Default width. + * @param aspectMode The aspect mode of the Size component. Defaults to 0, no mode. Default 0. + * @param parent The parent of this Size component. Can be any object with public `width` and `height` properties. Dimensions are clamped to keep them within the parent bounds where possible. Default null. + */ + constructor(width?: number, height?: number, aspectMode?: integer, parent?: any); + + /** + * The aspect mode this Size component will use when calculating its dimensions. + * This property is read-only. To change it use the `setAspectMode` method. + */ + readonly aspectMode: integer; + + /** + * The proportional relationship between the width and height. + * + * This property is read-only and is updated automatically when either the `width` or `height` properties are changed, + * depending on the aspect mode. + */ + readonly aspectRatio: number; + + /** + * The minimum allowed width. + * Cannot be less than zero. + * This value is read-only. To change it see the `setMin` method. + */ + readonly minWidth: number; + + /** + * The minimum allowed height. + * Cannot be less than zero. + * This value is read-only. To change it see the `setMin` method. + */ + readonly minHeight: number; + + /** + * The maximum allowed width. + * This value is read-only. To change it see the `setMax` method. + */ + readonly maxWidth: number; + + /** + * The maximum allowed height. + * This value is read-only. To change it see the `setMax` method. + */ + readonly maxHeight: number; + + /** + * A Vector2 containing the horizontal and vertical snap values, which the width and height are snapped to during resizing. + * + * By default this is disabled. + * + * This property is read-only. To change it see the `setSnap` method. + */ + readonly snapTo: Phaser.Math.Vector2; + + /** + * Sets the aspect mode of this Size component. + * + * The aspect mode controls what happens when you modify the `width` or `height` properties, or call `setSize`. + * + * It can be a number from 0 to 4, or a Size constant: + * + * 0. NONE = Do not make the size fit the aspect ratio. Change the ratio when the size changes. + * 1. WIDTH_CONTROLS_HEIGHT = The height is automatically adjusted based on the width. + * 2. HEIGHT_CONTROLS_WIDTH = The width is automatically adjusted based on the height. + * 3. FIT = The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. + * 4. ENVELOP = The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. + * + * Calling this method automatically recalculates the `width` and the `height`, if required. + * @param value The aspect mode value. Default 0. + */ + setAspectMode(value?: integer): this; + + /** + * By setting a Snap To value when this Size component is modified its dimensions will automatically + * by snapped to the nearest grid slice, using floor. For example, if you have snap value of 16, + * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored) + * + * Note that snapping takes place before adjustments by the parent, or the min / max settings. If these + * values are not multiples of the given snap values, then this can result in un-snapped dimensions. + * + * Call this method with no arguments to reset the snap values. + * + * Calling this method automatically recalculates the `width` and the `height`, if required. + * @param snapWidth The amount to snap the width to. If you don't want to snap the width, pass a value of zero. Default 0. + * @param snapHeight The amount to snap the height to. If not provided it will use the `snapWidth` value. If you don't want to snap the height, pass a value of zero. Default snapWidth. + */ + setSnap(snapWidth?: number, snapHeight?: number): this; + + /** + * Sets, or clears, the parent of this Size component. + * + * To clear the parent call this method with no arguments. + * + * The parent influences the maximum extents to which this Size compoent can expand, + * based on the aspect mode: + * + * NONE - The parent clamps both the width and height. + * WIDTH_CONTROLS_HEIGHT - The parent clamps just the width. + * HEIGHT_CONTROLS_WIDTH - The parent clamps just the height. + * FIT - The parent clamps whichever axis is required to ensure the size fits within it. + * ENVELOP - The parent is used to ensure the size fully envelops the parent. + * + * Calling this method automatically calls `setSize`. + * @param parent Sets the parent of this Size component. Don't provide a value to clear an existing parent. + */ + setParent(parent?: any): this; + + /** + * Set the minimum width and height values this Size component will allow. + * + * The minimum values can never be below zero, or greater than the maximum values. + * + * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. + * + * Note that based on the aspect mode, and if this Size component has a parent set or not, the minimums set here + * _can_ be exceed in some situations. + * @param width The minimum allowed width of the Size component. Default 0. + * @param height The minimum allowed height of the Size component. If not given, it will use the `width`. Default width. + */ + setMin(width?: number, height?: number): this; + + /** + * Set the maximum width and height values this Size component will allow. + * + * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. + * + * Note that based on the aspect mode, and if this Size component has a parent set or not, the maximums set here + * _can_ be exceed in some situations. + * @param width The maximum allowed width of the Size component. Default Number.MAX_VALUE. + * @param height The maximum allowed height of the Size component. If not given, it will use the `width`. Default width. + */ + setMax(width?: number, height?: number): this; + + /** + * Sets the width and height of this Size component based on the aspect mode. + * + * If the aspect mode is 'none' then calling this method will change the aspect ratio, otherwise the current + * aspect ratio is honored across all other modes. + * + * If snapTo values have been set then the given width and height are snapped first, prior to any further + * adjustment via min/max values, or a parent. + * + * If minimum and/or maximum dimensions have been specified, the values given to this method will be clamped into + * that range prior to adjustment, but may still exceed them depending on the aspect mode. + * + * If this Size component has a parent set, and the aspect mode is `fit` or `envelop`, then the given sizes will + * be clamped to the range specified by the parent. + * @param width The new width of the Size component. Default 0. + * @param height The new height of the Size component. If not given, it will use the `width`. Default width. + */ + setSize(width?: number, height?: number): this; + + /** + * Sets a new aspect ratio, overriding what was there previously. + * + * It then calls `setSize` immediately using the current dimensions. + * @param ratio The new aspect ratio. + */ + setAspectRatio(ratio: number): this; + + /** + * Sets a new width and height for this Size component and updates the aspect ratio based on them. + * + * It _doesn't_ change the `aspectMode` and still factors in size limits such as the min max and parent bounds. + * @param width The new width of the Size component. + * @param height The new height of the Size component. If not given, it will use the `width`. Default width. + */ + resize(width: number, height?: number): this; + + /** + * Takes a new width and passes it through the min/max clamp and then checks it doesn't exceed the parent width. + * @param value The value to clamp and check. + * @param checkParent Check the given value against the parent, if set. Default true. + */ + getNewWidth(value: number, checkParent?: boolean): number; + + /** + * Takes a new height and passes it through the min/max clamp and then checks it doesn't exceed the parent height. + * @param value The value to clamp and check. + * @param checkParent Check the given value against the parent, if set. Default true. + */ + getNewHeight(value: number, checkParent?: boolean): number; + + /** + * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. + * + * If `fit` is true there may be some space inside the target area which is not covered if its aspect ratio differs. + * If `fit` is false the size may extend further out than the target area if the aspect ratios differ. + * + * If this Size component has a parent set, then the width and height passed to this method will be clamped so + * it cannot exceed that of the parent. + * @param width The new width of the Size component. Default 0. + * @param height The new height of the Size component. If not given, it will use the width value. + * @param fit Perform a `fit` (true) constraint, or an `envelop` (false) constraint. Default true. + */ + constrain(width?: number, height?: number, fit?: boolean): this; + + /** + * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. + * + * There may be some space inside the target area which is not covered if its aspect ratio differs. + * + * If this Size component has a parent set, then the width and height passed to this method will be clamped so + * it cannot exceed that of the parent. + * @param width The new width of the Size component. Default 0. + * @param height The new height of the Size component. If not given, it will use the width value. + */ + fitTo(width?: number, height?: number): this; + + /** + * The current `width` and `height` are adjusted so that they fully envlop the given dimensions, while keeping the aspect ratio. + * + * The size may extend further out than the target area if the aspect ratios differ. + * + * If this Size component has a parent set, then the values are clamped so that it never exceeds the parent + * on the longest axis. + * @param width The new width of the Size component. Default 0. + * @param height The new height of the Size component. If not given, it will use the width value. + */ + envelop(width?: number, height?: number): this; + + /** + * Sets the width of this Size component. + * + * Depending on the aspect mode, changing the width may also update the height and aspect ratio. + * @param width The new width of the Size component. + */ + setWidth(width: number): this; + + /** + * Sets the height of this Size component. + * + * Depending on the aspect mode, changing the height may also update the width and aspect ratio. + * @param height The new height of the Size component. + */ + setHeight(height: number): this; + + /** + * Returns a string representation of this Size component. + */ + toString(): string; + + /** + * Sets the values of this Size component to the `element.style.width` and `height` + * properties of the given DOM Element. The properties are set as `px` values. + * @param element The DOM Element to set the CSS style on. + */ + setCSS(element: HTMLElement): void; + + /** + * Copies the aspect mode, aspect ratio, width and height from this Size component + * to the given Size component. Note that the parent, if set, is not copied across. + * @param destination The Size component to copy the values to. + */ + copy(destination: Phaser.Structs.Size): Phaser.Structs.Size; + + /** + * Destroys this Size component. + * + * This clears the local properties and any parent object, if set. + * + * A destroyed Size component cannot be re-used. + */ + destroy(): void; + + /** + * The width of this Size component. + * + * This value is clamped to the range specified by `minWidth` and `maxWidth`, if enabled. + * + * A width can never be less than zero. + * + * Changing this value will automatically update the `height` if the aspect ratio lock is enabled. + * You can also use the `setWidth` and `getWidth` methods. + */ + width: number; + + /** + * The height of this Size component. + * + * This value is clamped to the range specified by `minHeight` and `maxHeight`, if enabled. + * + * A height can never be less than zero. + * + * Changing this value will automatically update the `width` if the aspect ratio lock is enabled. + * You can also use the `setHeight` and `getHeight` methods. + */ + height: number; + + /** + * Do not make the size fit the aspect ratio. Change the ratio when the size changes. + */ + static readonly NONE: integer; + + /** + * The height is automatically adjusted based on the width. + */ + static readonly WIDTH_CONTROLS_HEIGHT: integer; + + /** + * The width is automatically adjusted based on the height. + */ + static readonly HEIGHT_CONTROLS_WIDTH: integer; + + /** + * The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. + */ + static readonly FIT: integer; + + /** + * The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. + */ + static readonly ENVELOP: integer; + + } + + } + + namespace Textures { + /** + * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. + * + * You can use the properties of this texture to draw to the canvas element directly, using all of the standard + * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. + * + * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to + * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this + * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep + * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading + * texture data to it. This restriction does not apply if using the Canvas Renderer. + * + * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify + * sections of the canvas using the `add` method. + * + * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying + * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause + * graphical errors. + */ + class CanvasTexture extends Phaser.Textures.Texture { + /** + * + * @param manager A reference to the Texture Manager this Texture belongs to. + * @param key The unique string-based key of this Texture. + * @param source The canvas element that is used as the base of this texture. + * @param width The width of the canvas. + * @param height The height of the canvas. + */ + constructor(manager: Phaser.Textures.CanvasTexture, key: string, source: HTMLCanvasElement, width: integer, height: integer); + + /** + * The source Canvas Element. + */ + readonly canvas: HTMLCanvasElement; + + /** + * The 2D Canvas Rendering Context. + */ + readonly context: CanvasRenderingContext2D; + + /** + * The width of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + */ + readonly width: integer; + + /** + * The height of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + */ + readonly height: integer; + + /** + * The context image data. + * Use the `update` method to populate this when the canvas changes. + */ + imageData: ImageData; + + /** + * A Uint8ClampedArray view into the `buffer`. + * Use the `update` method to populate this when the canvas changes. + * Note that this is unavailable in some browsers, such as Epic Browser, due to their security restrictions. + */ + data: Uint8ClampedArray; + + /** + * An Uint32Array view into the `buffer`. + */ + pixels: Uint32Array; + + /** + * An ArrayBuffer the same size as the context ImageData. + */ + buffer: ArrayBuffer; + + /** + * This re-creates the `imageData` from the current context. + * It then re-builds the ArrayBuffer, the `data` Uint8ClampedArray reference and the `pixels` Int32Array. + * + * Warning: This is a very expensive operation, so use it sparingly. + */ + update(): Phaser.Textures.CanvasTexture; + + /** + * Draws the given Image or Canvas element to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * @param x The x coordinate to draw the source at. + * @param y The y coordinate to draw the source at. + * @param source The element to draw to this canvas. + */ + draw(x: integer, y: integer, source: HTMLImageElement | HTMLCanvasElement): Phaser.Textures.CanvasTexture; + + /** + * Draws the given texture frame to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * @param key The unique string-based key of the Texture. + * @param frame The string-based name, or integer based index, of the Frame to get from the Texture. + * @param x The x coordinate to draw the source at. Default 0. + * @param y The y coordinate to draw the source at. Default 0. + */ + drawFrame(key: string, frame?: string | integer, x?: integer, y?: integer): Phaser.Textures.CanvasTexture; + + /** + * Sets a pixel in the CanvasTexture to the given color and alpha values. + * + * This is an expensive operation to run in large quantities, so use sparingly. + * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param red The red color value. A number between 0 and 255. + * @param green The green color value. A number between 0 and 255. + * @param blue The blue color value. A number between 0 and 255. + * @param alpha The alpha value. A number between 0 and 255. Default 255. + */ + setPixel(x: integer, y: integer, red: integer, green: integer, blue: integer, alpha?: integer): this; + + /** + * Puts the ImageData into the context of this CanvasTexture at the given coordinates. + * @param imageData The ImageData to put at the given location. + * @param x The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param dirtyX Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. Default 0. + * @param dirtyY Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. Default 0. + * @param dirtyWidth Width of the rectangle to be painted. Defaults to the width of the image data. + * @param dirtyHeight Height of the rectangle to be painted. Defaults to the height of the image data. + */ + putData(imageData: ImageData, x: integer, y: integer, dirtyX?: integer, dirtyY?: integer, dirtyWidth?: integer, dirtyHeight?: integer): this; + + /** + * Gets an ImageData region from this CanvasTexture from the position and size specified. + * You can write this back using `CanvasTexture.putData`, or manipulate it. + * @param x The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param width The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. + * @param height The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. + */ + getData(x: integer, y: integer, width: integer, height: integer): ImageData; + + /** + * Get the color of a specific pixel from this texture and store it in a Color object. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param out A Color object to store the pixel values in. If not provided a new Color object will be created. + */ + getPixel(x: integer, y: integer, out?: Phaser.Display.Color): Phaser.Display.Color; + + /** + * Returns an array containing all of the pixels in the given region. + * + * If the requested region extends outside the bounds of this CanvasTexture, + * the region is truncated to fit. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * @param x The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param width The width of the region to get. Must be an integer. + * @param height The height of the region to get. Must be an integer. If not given will be set to the `width`. + */ + getPixels(x: integer, y: integer, width: integer, height?: integer): Phaser.Types.Textures.PixelConfig[]; + + /** + * Returns the Image Data index for the given pixel in this CanvasTexture. + * + * The index can be used to read directly from the `this.data` array. + * + * The index points to the red value in the array. The subsequent 3 indexes + * point to green, blue and alpha respectively. + * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + */ + getIndex(x: integer, y: integer): integer; + + /** + * This should be called manually if you are running under WebGL. + * It will refresh the WebGLTexture from the Canvas source. Only call this if you know that the + * canvas has changed, as there is a significant GPU texture allocation cost involved in doing so. + */ + refresh(): Phaser.Textures.CanvasTexture; + + /** + * Gets the Canvas Element. + */ + getCanvas(): HTMLCanvasElement; + + /** + * Gets the 2D Canvas Rendering Context. + */ + getContext(): CanvasRenderingContext2D; + + /** + * Clears the given region of this Canvas Texture, resetting it back to transparent. + * If no region is given, the whole Canvas Texture is cleared. + * @param x The x coordinate of the top-left of the region to clear. Default 0. + * @param y The y coordinate of the top-left of the region to clear. Default 0. + * @param width The width of the region. + * @param height The height of the region. + */ + clear(x?: integer, y?: integer, width?: integer, height?: integer): Phaser.Textures.CanvasTexture; + + /** + * Changes the size of this Canvas Texture. + * @param width The new width of the Canvas. + * @param height The new height of the Canvas. If not given it will use the width as the height. + */ + setSize(width: integer, height?: integer): Phaser.Textures.CanvasTexture; + + /** + * Destroys this Texture and releases references to its sources and frames. + */ + destroy(): void; + + } + + /** + * Filter Types. + */ + enum FilterMode { + /** + * Linear filter type. + */ + LINEAR, + /** + * Nearest neighbor filter type. + */ + NEAREST, + } + + namespace Events { + /** + * The Texture Add Event. + * + * This event is dispatched by the Texture Manager when a texture is added to it. + * + * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`. + */ + const ADD: any; + + /** + * The Texture Load Error Event. + * + * This event is dispatched by the Texture Manager when a texture it requested to load failed. + * This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin. + * + * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`. + */ + const ERROR: any; + + /** + * The Texture Load Event. + * + * This event is dispatched by the Texture Manager when a texture has finished loading on it. + * This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin. + * + * Listen to this event from within a Scene using: `this.textures.on('onload', listener)`. + * + * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event. + */ + const LOAD: any; + + /** + * This internal event signifies that the Texture Manager is now ready and the Game can continue booting. + * + * When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking + * async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game + * instance, which tells the Game to carry on booting. + */ + const READY: any; + + /** + * The Texture Remove Event. + * + * This event is dispatched by the Texture Manager when a texture is removed from it. + * + * Listen to this event from within a Scene using: `this.textures.on('removetexture', listener)`. + * + * If you have any Game Objects still using the removed texture, they will start throwing + * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. + */ + const REMOVE: any; + + } + + /** + * A Frame is a section of a Texture. + */ + class Frame { + /** + * + * @param texture The Texture this Frame is a part of. + * @param name The name of this Frame. The name is unique within the Texture. + * @param sourceIndex The index of the TextureSource that this Frame is a part of. + * @param x The x coordinate of the top-left of this Frame. + * @param y The y coordinate of the top-left of this Frame. + * @param width The width of this Frame. + * @param height The height of this Frame. + */ + constructor(texture: Phaser.Textures.Texture, name: integer | string, sourceIndex: integer, x: number, y: number, width: number, height: number); + + /** + * The Texture this Frame is a part of. + */ + texture: Phaser.Textures.Texture; + + /** + * The name of this Frame. + * The name is unique within the Texture. + */ + name: string; + + /** + * The TextureSource this Frame is part of. + */ + source: Phaser.Textures.TextureSource; + + /** + * The index of the TextureSource in the Texture sources array. + */ + sourceIndex: integer; + + /** + * A reference to the Texture Source WebGL Texture that this Frame is using. + */ + glTexture: WebGLTexture; + + /** + * X position within the source image to cut from. + */ + cutX: integer; + + /** + * Y position within the source image to cut from. + */ + cutY: integer; + + /** + * The width of the area in the source image to cut. + */ + cutWidth: integer; + + /** + * The height of the area in the source image to cut. + */ + cutHeight: integer; + + /** + * The X rendering offset of this Frame, taking trim into account. + */ + x: integer; + + /** + * The Y rendering offset of this Frame, taking trim into account. + */ + y: integer; + + /** + * The rendering width of this Frame, taking trim into account. + */ + width: integer; + + /** + * The rendering height of this Frame, taking trim into account. + */ + height: integer; + + /** + * Half the width, floored. + * Precalculated for the renderer. + */ + halfWidth: integer; + + /** + * Half the height, floored. + * Precalculated for the renderer. + */ + halfHeight: integer; + + /** + * The x center of this frame, floored. + */ + centerX: integer; + + /** + * The y center of this frame, floored. + */ + centerY: integer; + + /** + * The horizontal pivot point of this Frame. + */ + pivotX: number; + + /** + * The vertical pivot point of this Frame. + */ + pivotY: number; + + /** + * Does this Frame have a custom pivot point? + */ + customPivot: boolean; + + /** + * **CURRENTLY UNSUPPORTED** + * + * Is this frame is rotated or not in the Texture? + * Rotation allows you to use rotated frames in texture atlas packing. + * It has nothing to do with Sprite rotation. + */ + rotated: boolean; + + /** + * Over-rides the Renderer setting. + * -1 = use Renderer Setting + * 0 = No rounding + * 1 = Round + */ + autoRound: integer; + + /** + * Any Frame specific custom data can be stored here. + */ + customData: object; + + /** + * WebGL UV u0 value. + */ + u0: number; + + /** + * WebGL UV v0 value. + */ + v0: number; + + /** + * WebGL UV u1 value. + */ + u1: number; + + /** + * WebGL UV v1 value. + */ + v1: number; + + /** + * Sets the width, height, x and y of this Frame. + * + * This is called automatically by the constructor + * and should rarely be changed on-the-fly. + * @param width The width of the frame before being trimmed. + * @param height The height of the frame before being trimmed. + * @param x The x coordinate of the top-left of this Frame. Default 0. + * @param y The y coordinate of the top-left of this Frame. Default 0. + */ + setSize(width: integer, height: integer, x?: integer, y?: integer): Phaser.Textures.Frame; + + /** + * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data. + * @param actualWidth The width of the frame before being trimmed. + * @param actualHeight The height of the frame before being trimmed. + * @param destX The destination X position of the trimmed frame for display. + * @param destY The destination Y position of the trimmed frame for display. + * @param destWidth The destination width of the trimmed frame for display. + * @param destHeight The destination height of the trimmed frame for display. + */ + setTrim(actualWidth: number, actualHeight: number, destX: number, destY: number, destWidth: number, destHeight: number): Phaser.Textures.Frame; + + /** + * Takes a crop data object and, based on the rectangular region given, calculates the + * required UV coordinates in order to crop this Frame for WebGL and Canvas rendering. + * + * This is called directly by the Game Object Texture Components `setCrop` method. + * Please use that method to crop a Game Object. + * @param crop The crop data object. This is the `GameObject._crop` property. + * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. + * @param y The y coordinate to start the crop from. Cannot be negative or exceed the Frame height. + * @param width The width of the crop rectangle. Cannot exceed the Frame width. + * @param height The height of the crop rectangle. Cannot exceed the Frame height. + * @param flipX Does the parent Game Object have flipX set? + * @param flipY Does the parent Game Object have flipY set? + */ + setCropUVs(crop: object, x: number, y: number, width: number, height: number, flipX: boolean, flipY: boolean): object; + + /** + * Takes a crop data object and recalculates the UVs based on the dimensions inside the crop object. + * Called automatically by `setFrame`. + * @param crop The crop data object. This is the `GameObject._crop` property. + * @param flipX Does the parent Game Object have flipX set? + * @param flipY Does the parent Game Object have flipY set? + */ + updateCropUVs(crop: object, flipX: boolean, flipY: boolean): object; + + /** + * Updates the internal WebGL UV cache and the drawImage cache. + */ + updateUVs(): Phaser.Textures.Frame; + + /** + * Updates the internal WebGL UV cache. + */ + updateUVsInverted(): Phaser.Textures.Frame; + + /** + * Clones this Frame into a new Frame object. + */ + clone(): Phaser.Textures.Frame; + + /** + * Destroys this Frames references. + */ + destroy(): void; + + /** + * The width of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + */ + readonly realWidth: number; + + /** + * The height of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + */ + readonly realHeight: number; + + /** + * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) + */ + readonly radius: number; + + /** + * Is the Frame trimmed or not? + */ + readonly trimmed: boolean; + + /** + * The Canvas drawImage data object. + */ + readonly canvasData: object; + + } + + /** + * Linear filter type. + */ + const LINEAR: integer; + + /** + * Nearest Neighbor filter type. + */ + const NEAREST: integer; + + namespace Parsers { + } + + /** + * A Texture consists of a source, usually an Image from the Cache, and a collection of Frames. + * The Frames represent the different areas of the Texture. For example a texture atlas + * may have many Frames, one for each element within the atlas. Where-as a single image would have + * just one frame, that encompasses the whole image. + * + * Every Texture, no matter where it comes from, always has at least 1 frame called the `__BASE` frame. + * This frame represents the entirety of the source image. + * + * Textures are managed by the global TextureManager. This is a singleton class that is + * responsible for creating and delivering Textures and their corresponding Frames to Game Objects. + * + * Sprites and other Game Objects get the texture data they need from the TextureManager. + */ + class Texture { + /** + * + * @param manager A reference to the Texture Manager this Texture belongs to. + * @param key The unique string-based key of this Texture. + * @param source An array of sources that are used to create the texture. Usually Images, but can also be a Canvas. + * @param width The width of the Texture. This is optional and automatically derived from the source images. + * @param height The height of the Texture. This is optional and automatically derived from the source images. + */ + constructor(manager: Phaser.Textures.TextureManager, key: string, source: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[], width?: number, height?: number); + + /** + * A reference to the Texture Manager this Texture belongs to. + */ + manager: Phaser.Textures.TextureManager; + + /** + * The unique string-based key of this Texture. + */ + key: string; + + /** + * An array of TextureSource instances. + * These are unique to this Texture and contain the actual Image (or Canvas) data. + */ + source: Phaser.Textures.TextureSource[]; + + /** + * An array of TextureSource data instances. + * Used to store additional data images, such as normal maps or specular maps. + */ + dataSource: any[]; + + /** + * A key-value object pair associating the unique Frame keys with the Frames objects. + */ + frames: object; + + /** + * Any additional data that was set in the source JSON (if any), + * or any extra data you'd like to store relating to this texture + */ + customData: object; + + /** + * The name of the first frame of the Texture. + */ + firstFrame: string; + + /** + * The total number of Frames in this Texture, including the `__BASE` frame. + * + * A Texture will always contain at least 1 frame because every Texture contains a `__BASE` frame by default, + * in addition to any extra frames that have been added to it, such as when parsing a Sprite Sheet or Texture Atlas. + */ + frameTotal: integer; + + /** + * Adds a new Frame to this Texture. + * + * A Frame is a rectangular region of a TextureSource with a unique index or string-based key. + * + * The name given must be unique within this Texture. If it already exists, this method will return `null`. + * @param name The name of this Frame. The name is unique within the Texture. + * @param sourceIndex The index of the TextureSource that this Frame is a part of. + * @param x The x coordinate of the top-left of this Frame. + * @param y The y coordinate of the top-left of this Frame. + * @param width The width of this Frame. + * @param height The height of this Frame. + */ + add(name: integer | string, sourceIndex: integer, x: number, y: number, width: number, height: number): Phaser.Textures.Frame; + + /** + * Checks to see if a Frame matching the given key exists within this Texture. + * @param name The key of the Frame to check for. + */ + has(name: string): boolean; + + /** + * Gets a Frame from this Texture based on either the key or the index of the Frame. + * + * In a Texture Atlas Frames are typically referenced by a key. + * In a Sprite Sheet Frames are referenced by an index. + * Passing no value for the name returns the base texture. + * @param name The string-based name, or integer based index, of the Frame to get from this Texture. + */ + get(name?: string | integer): Phaser.Textures.Frame; + + /** + * Takes the given TextureSource and returns the index of it within this Texture. + * If it's not in this Texture, it returns -1. + * Unless this Texture has multiple TextureSources, such as with a multi-atlas, this + * method will always return zero or -1. + * @param source The TextureSource to check. + */ + getTextureSourceIndex(source: Phaser.Textures.TextureSource): integer; + + /** + * Returns an array of all the Frames in the given TextureSource. + * @param sourceIndex The index of the TextureSource to get the Frames from. + * @param includeBase Include the `__BASE` Frame in the output array? Default false. + */ + getFramesFromTextureSource(sourceIndex: integer, includeBase?: boolean): Phaser.Textures.Frame[]; + + /** + * Returns an array with all of the names of the Frames in this Texture. + * + * Useful if you want to randomly assign a Frame to a Game Object, as you can + * pick a random element from the returned array. + * @param includeBase Include the `__BASE` Frame in the output array? Default false. + */ + getFrameNames(includeBase?: boolean): string[]; + + /** + * Given a Frame name, return the source image it uses to render with. + * + * This will return the actual DOM Image or Canvas element. + * @param name The string-based name, or integer based index, of the Frame to get from this Texture. + */ + getSourceImage(name?: string | integer): HTMLImageElement | HTMLCanvasElement | Phaser.GameObjects.RenderTexture; + + /** + * Given a Frame name, return the data source image it uses to render with. + * You can use this to get the normal map for an image for example. + * + * This will return the actual DOM Image. + * @param name The string-based name, or integer based index, of the Frame to get from this Texture. + */ + getDataSourceImage(name?: string | integer): HTMLImageElement | HTMLCanvasElement; + + /** + * Adds a data source image to this Texture. + * + * An example of a data source image would be a normal map, where all of the Frames for this Texture + * equally apply to the normal map. + * @param data The source image. + */ + setDataSource(data: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): void; + + /** + * Sets the Filter Mode for this Texture. + * + * The mode can be either Linear, the default, or Nearest. + * + * For pixel-art you should use Nearest. + * + * The mode applies to the entire Texture, not just a specific Frame of it. + * @param filterMode The Filter Mode. + */ + setFilter(filterMode: Phaser.Textures.FilterMode): void; + + /** + * Destroys this Texture and releases references to its sources and frames. + */ + destroy(): void; + + } + + /** + * Textures are managed by the global TextureManager. This is a singleton class that is + * responsible for creating and delivering Textures and their corresponding Frames to Game Objects. + * + * Sprites and other Game Objects get the texture data they need from the TextureManager. + * + * Access it via `scene.textures`. + */ + class TextureManager extends Phaser.Events.EventEmitter { + /** + * + * @param game The Phaser.Game instance this Texture Manager belongs to. + */ + constructor(game: Phaser.Game); + + /** + * The Game that this TextureManager belongs to. + */ + game: Phaser.Game; + + /** + * The name of this manager. + */ + name: string; + + /** + * An object that has all of textures that Texture Manager creates. + * Textures are assigned to keys so we can access to any texture that this object has directly by key value without iteration. + */ + list: object; + + /** + * Checks the given texture key and throws a console.warn if the key is already in use, then returns false. + * If you wish to avoid the console.warn then use `TextureManager.exists` instead. + * @param key The texture key to check. + */ + checkKey(key: string): boolean; + + /** + * Removes a Texture from the Texture Manager and destroys it. This will immediately + * clear all references to it from the Texture Manager, and if it has one, destroy its + * WebGLTexture. This will emit a `removetexture` event. + * + * Note: If you have any Game Objects still using this texture they will start throwing + * errors the next time they try to render. Make sure that removing the texture is the final + * step when clearing down to avoid this. + * @param key The key of the Texture to remove, or a reference to it. + */ + remove(key: string | Phaser.Textures.Texture): Phaser.Textures.TextureManager; + + /** + * Removes a key from the Texture Manager but does not destroy the Texture that was using the key. + * @param key The key to remove from the texture list. + */ + removeKey(key: string): Phaser.Textures.TextureManager; + + /** + * Adds a new Texture to the Texture Manager created from the given Base64 encoded data. + * @param key The unique string-based key of the Texture. + * @param data The Base64 encoded data. + */ + addBase64(key: string, data: any): this; + + /** + * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. + * + * You can also provide the image type and encoder options. + * @param key The unique string-based key of the Texture. + * @param frame The string-based name, or integer based index, of the Frame to get from the Texture. + * @param type [description] Default 'image/png'. + * @param encoderOptions [description] Default 0.92. + */ + getBase64(key: string, frame?: string | integer, type?: string, encoderOptions?: number): string; + + /** + * Adds a new Texture to the Texture Manager created from the given Image element. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param dataSource An optional data Image element. + */ + addImage(key: string, source: HTMLImageElement, dataSource?: HTMLImageElement | HTMLCanvasElement): Phaser.Textures.Texture; + + /** + * Adds a Render Texture to the Texture Manager using the given key. + * This allows you to then use the Render Texture as a normal texture for texture based Game Objects like Sprites. + * @param key The unique string-based key of the Texture. + * @param renderTexture The source Render Texture. + */ + addRenderTexture(key: string, renderTexture: Phaser.GameObjects.RenderTexture): Phaser.Textures.Texture; + + /** + * Creates a new Texture using the given config values. + * Generated textures consist of a Canvas element to which the texture data is drawn. + * See the Phaser.Create function for the more direct way to create textures. + * @param key The unique string-based key of the Texture. + * @param config The configuration object needed to generate the texture. + */ + generate(key: string, config: object): Phaser.Textures.Texture; + + /** + * Creates a new Texture using a blank Canvas element of the size given. + * + * Canvas elements are automatically pooled and calling this method will + * extract a free canvas from the CanvasPool, or create one if none are available. + * @param key The unique string-based key of the Texture. + * @param width The width of the Canvas element. Default 256. + * @param height The height of the Canvas element. Default 256. + */ + createCanvas(key: string, width?: integer, height?: integer): Phaser.Textures.CanvasTexture; + + /** + * Creates a new Canvas Texture object from an existing Canvas element + * and adds it to this Texture Manager, unless `skipCache` is true. + * @param key The unique string-based key of the Texture. + * @param source The Canvas element to form the base of the new Texture. + * @param skipCache Skip adding this Texture into the Cache? Default false. + */ + addCanvas(key: string, source: HTMLCanvasElement, skipCache?: boolean): Phaser.Textures.CanvasTexture; + + /** + * Adds a new Texture Atlas to this Texture Manager. + * It can accept either JSON Array or JSON Hash formats, as exported by Texture Packer and similar software. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param data The Texture Atlas data. + * @param dataSource An optional data Image element. + */ + addAtlas(key: string, source: HTMLImageElement, data: object, dataSource?: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): Phaser.Textures.Texture; + + /** + * Adds a Texture Atlas to this Texture Manager. + * The frame data of the atlas must be stored in an Array within the JSON. + * This is known as a JSON Array in software such as Texture Packer. + * @param key The unique string-based key of the Texture. + * @param source The source Image element/s. + * @param data The Texture Atlas data/s. + * @param dataSource An optional data Image element. + */ + addAtlasJSONArray(key: string, source: HTMLImageElement | HTMLImageElement[], data: object | object[], dataSource?: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): Phaser.Textures.Texture; + + /** + * Adds a Texture Atlas to this Texture Manager. + * The frame data of the atlas must be stored in an Object within the JSON. + * This is known as a JSON Hash in software such as Texture Packer. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param data The Texture Atlas data. + * @param dataSource An optional data Image element. + */ + addAtlasJSONHash(key: string, source: HTMLImageElement, data: object, dataSource?: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): Phaser.Textures.Texture; + + /** + * Adds a Texture Atlas to this Texture Manager, where the atlas data is given + * in the XML format. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param data The Texture Atlas XML data. + * @param dataSource An optional data Image element. + */ + addAtlasXML(key: string, source: HTMLImageElement, data: object, dataSource?: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): Phaser.Textures.Texture; + + /** + * Adds a Unity Texture Atlas to this Texture Manager. + * The data must be in the form of a Unity YAML file. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param data The Texture Atlas data. + * @param dataSource An optional data Image element. + */ + addUnityAtlas(key: string, source: HTMLImageElement, data: object, dataSource?: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): Phaser.Textures.Texture; + + /** + * Adds a Sprite Sheet to this Texture Manager. + * + * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact + * same size and cannot be trimmed or rotated. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param config The configuration object for this Sprite Sheet. + */ + addSpriteSheet(key: string, source: HTMLImageElement, config: Phaser.Types.Textures.SpriteSheetConfig): Phaser.Textures.Texture; + + /** + * Adds a Sprite Sheet to this Texture Manager, where the Sprite Sheet exists as a Frame within a Texture Atlas. + * + * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact + * same size and cannot be trimmed or rotated. + * @param key The unique string-based key of the Texture. + * @param config The configuration object for this Sprite Sheet. + */ + addSpriteSheetFromAtlas(key: string, config: Phaser.Types.Textures.SpriteSheetFromAtlasConfig): Phaser.Textures.Texture; + + /** + * Creates a new Texture using the given source and dimensions. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param width The width of the Texture. + * @param height The height of the Texture. + */ + create(key: string, source: HTMLImageElement, width: integer, height: integer): Phaser.Textures.Texture; + + /** + * Checks the given key to see if a Texture using it exists within this Texture Manager. + * @param key The unique string-based key of the Texture. + */ + exists(key: string): boolean; + + /** + * Returns a Texture from the Texture Manager that matches the given key. + * If the key is undefined it will return the `__DEFAULT` Texture. + * If the key is given, but not found, it will return the `__MISSING` Texture. + * @param key The unique string-based key of the Texture. + */ + get(key: string): Phaser.Textures.Texture; + + /** + * Takes a Texture key and Frame name and returns a clone of that Frame if found. + * @param key The unique string-based key of the Texture. + * @param frame The string or index of the Frame to be cloned. + */ + cloneFrame(key: string, frame: string | integer): Phaser.Textures.Frame; + + /** + * Takes a Texture key and Frame name and returns a reference to that Frame, if found. + * @param key The unique string-based key of the Texture. + * @param frame The string-based name, or integer based index, of the Frame to get from the Texture. + */ + getFrame(key: string, frame?: string | integer): Phaser.Textures.Frame; + + /** + * Returns an array with all of the keys of all Textures in this Texture Manager. + * The output array will exclude the `__DEFAULT` and `__MISSING` keys. + */ + getTextureKeys(): string[]; + + /** + * Given a Texture and an `x` and `y` coordinate this method will return a new + * Color object that has been populated with the color and alpha values of the pixel + * at that location in the Texture. + * @param x The x coordinate of the pixel within the Texture. + * @param y The y coordinate of the pixel within the Texture. + * @param key The unique string-based key of the Texture. + * @param frame The string or index of the Frame. + */ + getPixel(x: integer, y: integer, key: string, frame?: string | integer): Phaser.Display.Color; + + /** + * Given a Texture and an `x` and `y` coordinate this method will return a value between 0 and 255 + * corresponding to the alpha value of the pixel at that location in the Texture. If the coordinate + * is out of bounds it will return null. + * @param x The x coordinate of the pixel within the Texture. + * @param y The y coordinate of the pixel within the Texture. + * @param key The unique string-based key of the Texture. + * @param frame The string or index of the Frame. + */ + getPixelAlpha(x: integer, y: integer, key: string, frame?: string | integer): integer; + + /** + * Sets the given Game Objects `texture` and `frame` properties so that it uses + * the Texture and Frame specified in the `key` and `frame` arguments to this method. + * @param gameObject The Game Object the texture would be set on. + * @param key The unique string-based key of the Texture. + * @param frame The string or index of the Frame. + */ + setTexture(gameObject: Phaser.GameObjects.GameObject, key: string, frame?: string | integer): Phaser.GameObjects.GameObject; + + /** + * Changes the key being used by a Texture to the new key provided. + * + * The old key is removed, allowing it to be re-used. + * + * Game Objects are linked to Textures by a reference to the Texture object, so + * all existing references will be retained. + * @param currentKey The current string-based key of the Texture you wish to rename. + * @param newKey The new unique string-based key to use for the Texture. + */ + renameTexture(currentKey: string, newKey: string): boolean; + + /** + * Passes all Textures to the given callback. + * @param callback The callback function to be sent the Textures. + * @param scope The value to use as `this` when executing the callback. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + each(callback: EachTextureCallback, scope: object, ...args: any[]): void; + + /** + * Destroys the Texture Manager and all Textures stored within it. + */ + destroy(): void; + + } + + /** + * A Texture Source is the encapsulation of the actual source data for a Texture. + * This is typically an Image Element, loaded from the file system or network, or a Canvas Element. + * + * A Texture can contain multiple Texture Sources, which only happens when a multi-atlas is loaded. + */ + class TextureSource { + /** + * + * @param texture The Texture this TextureSource belongs to. + * @param source The source image data. + * @param width Optional width of the source image. If not given it's derived from the source itself. + * @param height Optional height of the source image. If not given it's derived from the source itself. + */ + constructor(texture: Phaser.Textures.Texture, source: HTMLImageElement | HTMLCanvasElement, width?: integer, height?: integer); + + /** + * The Texture this TextureSource belongs to. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The Texture this TextureSource belongs to. + */ + texture: Phaser.Textures.Texture; + + /** + * The source of the image data. + * This is either an Image Element, a Canvas Element or a RenderTexture. + */ + source: HTMLImageElement | HTMLCanvasElement | Phaser.GameObjects.RenderTexture; + + /** + * The image data. + * This is either an Image element or a Canvas element. + */ + image: HTMLImageElement | HTMLCanvasElement; + + /** + * Currently un-used. + */ + compressionAlgorithm: integer; + + /** + * The resolution of the source image. + */ + resolution: number; + + /** + * The width of the source image. If not specified in the constructor it will check + * the `naturalWidth` and then `width` properties of the source image. + */ + width: integer; + + /** + * The height of the source image. If not specified in the constructor it will check + * the `naturalHeight` and then `height` properties of the source image. + */ + height: integer; + + /** + * The Scale Mode the image will use when rendering. + * Either Linear or Nearest. + */ + scaleMode: number; + + /** + * Is the source image a Canvas Element? + */ + isCanvas: boolean; + + /** + * Is the source image a Render Texture? + */ + isRenderTexture: boolean; + + /** + * Are the source image dimensions a power of two? + */ + isPowerOf2: boolean; + + /** + * The WebGL Texture of the source image. + */ + glTexture: WebGLTexture; + + /** + * Creates a WebGL Texture, if required, and sets the Texture filter mode. + * @param game A reference to the Phaser Game instance. + */ + init(game: Phaser.Game): void; + + /** + * Sets the Filter Mode for this Texture. + * + * The mode can be either Linear, the default, or Nearest. + * + * For pixel-art you should use Nearest. + * @param filterMode The Filter Mode. + */ + setFilter(filterMode: Phaser.Textures.FilterMode): void; + + /** + * If this TextureSource is backed by a Canvas and is running under WebGL, + * it updates the WebGLTexture using the canvas data. + */ + update(): void; + + /** + * Destroys this Texture Source and nulls the references. + */ + destroy(): void; + + } + + } + + namespace Tilemaps { + namespace Components { + } + + /** + * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. + * + * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a + * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the + * tiles in a DynamicTilemapLayer. + * + * Use this over a Static Tilemap Layer when you need those features. + */ + class DynamicTilemapLayer extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param tilemap The Tilemap this layer is a part of. + * @param layerIndex The index of the LayerData associated with this layer. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The world x position where the top left of this layer will be placed. Default 0. + * @param y The world y position where the top left of this layer will be placed. Default 0. + */ + constructor(scene: Phaser.Scene, tilemap: Phaser.Tilemaps.Tilemap, layerIndex: integer, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number); + + /** + * Used internally by physics system to perform fast type checks. + */ + readonly isTilemap: boolean; + + /** + * The Tilemap that this layer is a part of. + */ + tilemap: Phaser.Tilemaps.Tilemap; + + /** + * The index of the LayerData associated with this layer. + */ + layerIndex: integer; + + /** + * The LayerData associated with this layer. LayerData can only be associated with one + * tilemap layer. + */ + layer: Phaser.Tilemaps.LayerData; + + /** + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. + */ + tileset: Phaser.Tilemaps.Tileset[]; + + /** + * Used internally with the canvas render. This holds the tiles that are visible within the + * camera. + */ + culledTiles: any[]; + + /** + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this, and toggling this flag allows + * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. + */ + skipCull: boolean; + + /** + * The total number of tiles drawn by the renderer in the last frame. + */ + readonly tilesDrawn: integer; + + /** + * The total number of tiles in this layer. Updated every frame. + */ + readonly tilesTotal: integer; + + /** + * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. + * + * See the method `setCullPadding` for more details. + */ + cullPaddingX: integer; + + /** + * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. + * + * See the method `setCullPadding` for more details. + */ + cullPaddingY: integer; + + /** + * The callback that is invoked when the tiles are culled. + * + * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. + * + * It will be sent 3 arguments: + * + * 1. The Phaser.Tilemaps.LayerData object for this Layer + * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. + * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. + * + * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. + */ + cullCallback: Function; + + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + */ + gidMap: Phaser.Tilemaps.Tileset[]; + + /** + * Sets the rendering (draw) order of the tiles in this layer. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * @param renderOrder The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + */ + setRenderOrder(renderOrder: integer | string): this; + + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * @param tileX The x coordinate. + * @param tileY The y coordinate. + */ + calculateFacesAt(tileX: integer, tileY: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + */ + calculateFacesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * @param indexes The tile index, or array of indexes, to create Sprites from. + * @param replacements The tile index, or array of indexes, to change a converted + * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a + * one-to-one mapping with the indexes array. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. + * scene.make.sprite). + * @param scene The Scene to create the Sprites within. Default scene the map is within. + * @param camera The Camera to use when determining the world XY Default main camera. + */ + createFromTiles(indexes: integer | any[], replacements: integer | any[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Sprite[]; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. + * This is used internally. + * @param camera The Camera to run the cull check against. + */ + cull(camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * @param srcTileX The x coordinate of the area to copy from, in tiles, not pixels. + * @param srcTileY The y coordinate of the area to copy from, in tiles, not pixels. + * @param width The width of the area to copy, in tiles, not pixels. + * @param height The height of the area to copy, in tiles, not pixels. + * @param destTileX The x coordinate of the area to copy to, in tiles, not pixels. + * @param destTileY The y coordinate of the area to copy to, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + copy(srcTileX: integer, srcTileY: integer, width: integer, height: integer, destTileX: integer, destTileY: integer, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Destroys this DynamicTilemapLayer and removes its link to the associated LayerData. + * @param removeFromTilemap Remove this layer from the parent Tilemap? Default true. + */ + destroy(removeFromTilemap?: boolean): void; + + /** + * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the + * specified index. Tiles will be set to collide if the given index is a colliding index. + * Collision information in the region will be recalculated. + * @param index The tile index to fill the area with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + fill(index: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + filterTiles(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * @param index The tile index value to search for. + * @param skip The number of times to skip a matching tile before returning. Default 0. + * @param reverse If true it will scan the layer in reverse, starting at the + * bottom-right. Otherwise it scans from the top-left. Default false. + */ + findByIndex(index: integer, skip?: integer, reverse?: boolean): Phaser.Tilemaps.Tile; + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + findTile(callback: FindTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + forEachTile(callback: EachTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Gets a tile at the given tile coordinates from the given layer. + * @param tileX X position to get the tile from (given in tile units, not pixels). + * @param tileY Y position to get the tile from (given in tile units, not pixels). + * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. Default false. + */ + getTileAt(tileX: integer, tileY: integer, nonNull?: boolean): Phaser.Tilemaps.Tile; + + /** + * Gets a tile at the given world coordinates from the given layer. + * @param worldX X position to get the tile from (given in pixels) + * @param worldY Y position to get the tile from (given in pixels) + * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + getTilesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * @param shape A shape in world (pixel) coordinates + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + */ + getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * @param worldX The world x coordinate for the top-left of the area. + * @param worldY The world y coordinate for the top-left of the area. + * @param width The width of the area. + * @param height The height of the area. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + */ + getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + */ + hasTileAt(tileX: integer, tileY: integer): boolean; + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + */ + hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index + * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified + * location. If you pass in an index, only the index at the specified location will be changed. + * Collision information will be recalculated at the specified location. + * @param tile The index of this tile to set or a Tile object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + putTileAt(tile: integer | Phaser.Tilemaps.Tile, tileX: integer, tileY: integer, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + + /** + * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either + * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the + * specified location. If you pass in an index, only the index at the specified location will be + * changed. Collision information will be recalculated at the specified location. + * @param tile The index of this tile to set or a Tile object. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + putTileAtWorldXY(tile: integer | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified + * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, + * all attributes will be copied over to the specified location. If you pass in an index, only the + * index at the specified location will be changed. Collision information will be recalculated + * within the region tiles were changed. + * @param tile A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + putTilesAt(tile: integer[] | integer[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: integer, tileY: integer, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then + * those will be used for randomly assigning new tile indexes. If an array is not provided, the + * indexes found within the region (excluding -1) will be used for randomly assigning new tile + * indexes. This method only modifies tile indexes and does not change collision information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param indexes An array of indexes to randomly draw from during randomization. + */ + randomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, indexes?: integer[]): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Removes the tile at the given tile coordinates in the specified layer and updates the layer's + * collision information. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + removeTileAt(tileX: integer, tileY: integer, replaceWithNull?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + + /** + * Removes the tile at the given world coordinates in the specified layer and updates the layer's + * collision information. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + removeTileAtWorldXY(worldX: number, worldY: number, replaceWithNull?: boolean, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * @param graphics The target Graphics object to draw upon. + * @param styleConfig An object specifying the colors to use for the debug drawing. + */ + renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does + * not change collision information. + * @param findIndex The index of the tile to search for. + * @param newIndex The index of the tile to replace it with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + */ + replaceByIndex(findIndex: integer, newIndex: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this. + * @param value Set to `true` to stop culling tiles. Set to `false` to enable culling again. Default true. + */ + setSkipCull(value?: boolean): this; + + /** + * When a Camera culls the tiles in this layer it does so using its view into the world, building up a + * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size + * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so + * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px + * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) + * @param paddingX The amount of extra horizontal tiles to add to the cull check padding. Default 1. + * @param paddingY The amount of extra vertical tiles to add to the cull check padding. Default 1. + */ + setCullPadding(paddingX?: integer, paddingY?: integer): this; + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * @param indexes Either a single tile index, or an array of tile indexes. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollision(indexes: integer | any[], collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * @param start The first index of the tile to be set for collision. + * @param stop The last index of the tile to be set for collision. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionBetween(start: integer, stop: integer, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * @param properties An object with tile properties and corresponding values that should be checked. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). + * @param indexes An array of the tile indexes to not be counted for collision. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionByExclusion(indexes: integer[], collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets collision on the tiles within a layer by checking each tiles collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tiles collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * @param indexes Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + */ + setTileIndexCallback(indexes: integer | integer[], callback: Function, callbackContext: object): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + */ + setTileLocationCallback(tileX?: integer, tileY?: integer, width?: integer, height?: integer, callback?: Function, callbackContext?: object): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given + * layer. It will only randomize the tiles in that area, so if they're all the same nothing will + * appear to have changed! This method only modifies tile indexes and does not change collision + * information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + */ + shuffle(tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision + * information. + * @param tileA First tile index. + * @param tileB Second tile index. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + */ + swapByIndex(tileA: integer, tileB: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileX The x coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + tileToWorldX(tileX: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + tileToWorldY(tileY: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + tileToWorldXY(tileX: integer, tileY: integer, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will recieve a new index. New indexes are drawn from the given + * weightedIndexes array. An example weighted array: + * + * [ + * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 + * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 + * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 + * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 + * ] + * + * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * method only modifies tile indexes and does not change collision information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param weightedIndexes An array of objects to randomly draw from during + * randomization. They should be in the form: { index: 0, weight: 4 } or + * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + */ + weightedRandomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, weightedIndexes?: object[]): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + namespace Formats { + /** + * CSV Map Type + */ + var CSV: number; + + /** + * Tiled JSON Map Type + */ + var TILED_JSON: number; + + /** + * 2D Array Map Type + */ + var ARRAY_2D: number; + + /** + * Weltmeister (Impact.js) Map Type + */ + var WELTMEISTER: number; + + } + + /** + * An Image Collection is a special Tile Set containing multiple images, with no slicing into each image. + * + * Image Collections are normally created automatically when Tiled data is loaded. + */ + class ImageCollection { + /** + * + * @param name The name of the image collection in the map data. + * @param firstgid The first image index this image collection contains. + * @param width Width of widest image (in pixels). Default 32. + * @param height Height of tallest image (in pixels). Default 32. + * @param margin The margin around all images in the collection (in pixels). Default 0. + * @param spacing The spacing between each image in the collection (in pixels). Default 0. + * @param properties Custom Image Collection properties. Default {}. + */ + constructor(name: string, firstgid: integer, width?: integer, height?: integer, margin?: integer, spacing?: integer, properties?: object); + + /** + * The name of the Image Collection. + */ + name: string; + + /** + * The Tiled firstgid value. + * This is the starting index of the first image index this Image Collection contains. + */ + firstgid: integer; + + /** + * The width of the widest image (in pixels). + */ + readonly imageWidth: integer; + + /** + * The height of the tallest image (in pixels). + */ + readonly imageHeight: integer; + + /** + * The margin around the images in the collection (in pixels). + * Use `setSpacing` to change. + */ + readonly imageMarge: integer; + + /** + * The spacing between each image in the collection (in pixels). + * Use `setSpacing` to change. + */ + readonly imageSpacing: integer; + + /** + * Image Collection-specific properties that are typically defined in the Tiled editor. + */ + properties: object; + + /** + * The cached images that are a part of this collection. + */ + readonly images: any[]; + + /** + * The total number of images in the image collection. + */ + readonly total: integer; + + /** + * Returns true if and only if this image collection contains the given image index. + * @param imageIndex The image index to search for. + */ + containsImageIndex(imageIndex: integer): boolean; + + /** + * Add an image to this Image Collection. + * @param gid The gid of the image in the Image Collection. + * @param image The the key of the image in the Image Collection and in the cache. + */ + addImage(gid: integer, image: string): Phaser.Tilemaps.ImageCollection; + + } + + /** + * A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled, + * etc. into this format. Tilemap, StaticTilemapLayer and DynamicTilemapLayer have a reference + * to this data and use it to look up and perform operations on tiles. + */ + class LayerData { + /** + * + * @param config [description] + */ + constructor(config?: object); + + /** + * The name of the layer, if specified in Tiled. + */ + name: string; + + /** + * The x offset of where to draw from the top left + */ + x: number; + + /** + * The y offset of where to draw from the top left + */ + y: number; + + /** + * The width in tile of the layer. + */ + width: number; + + /** + * The height in tiles of the layer. + */ + height: number; + + /** + * The pixel width of the tiles. + */ + tileWidth: number; + + /** + * The pixel height of the tiles. + */ + tileHeight: number; + + /** + * [description] + */ + baseTileWidth: number; + + /** + * [description] + */ + baseTileHeight: number; + + /** + * The width in pixels of the entire layer. + */ + widthInPixels: number; + + /** + * The height in pixels of the entire layer. + */ + heightInPixels: number; + + /** + * [description] + */ + alpha: number; + + /** + * [description] + */ + visible: boolean; + + /** + * Layer specific properties (can be specified in Tiled) + */ + properties: object; + + /** + * [description] + */ + indexes: any[]; + + /** + * [description] + */ + collideIndexes: any[]; + + /** + * [description] + */ + callbacks: any[]; + + /** + * [description] + */ + bodies: any[]; + + /** + * An array of the tile indexes + */ + data: number[]; + + /** + * [description] + */ + tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer; + + } + + /** + * A class for representing data about a map. Maps are parsed from CSV, Tiled, etc. into this + * format. A Tilemap object get a copy of this data and then unpacks the needed properties into + * itself. + */ + class MapData { + /** + * + * @param config The Map configuration object. + */ + constructor(config?: Phaser.Types.Tilemaps.MapDataConfig); + + /** + * The key in the Phaser cache that corresponds to the loaded tilemap data. + */ + name: string; + + /** + * The width of the entire tilemap. + */ + width: number; + + /** + * The height of the entire tilemap. + */ + height: number; + + /** + * If the map is infinite or not. + */ + infinite: boolean; + + /** + * The width of the tiles. + */ + tileWidth: number; + + /** + * The height of the tiles. + */ + tileHeight: number; + + /** + * The width in pixels of the entire tilemap. + */ + widthInPixels: number; + + /** + * The height in pixels of the entire tilemap. + */ + heightInPixels: number; + + /** + * [description] + */ + format: integer; + + /** + * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. + */ + orientation: string; + + /** + * Determines the draw order of tilemap. Default is right-down + * + * 0, or 'right-down' + * 1, or 'left-down' + * 2, or 'right-up' + * 3, or 'left-up' + */ + renderOrder: string; + + /** + * The version of the map data (as specified in Tiled). + */ + version: string; + + /** + * Map specific properties (can be specified in Tiled) + */ + properties: object; + + /** + * An array with all the layers configured to the MapData. + */ + layers: Phaser.Tilemaps.LayerData[] | Phaser.Tilemaps.ObjectLayer; + + /** + * An array of Tiled Image Layers. + */ + images: any[]; + + /** + * An object of Tiled Object Layers. + */ + objects: object; + + /** + * An object of collision data. Must be created as physics object or will return undefined. + */ + collision: object; + + /** + * An array of Tilesets. + */ + tilesets: Phaser.Tilemaps.Tileset[]; + + /** + * The collection of images the map uses(specified in Tiled) + */ + imageCollections: any[]; + + /** + * [description] + */ + tiles: any[]; + + } + + /** + * A class for representing a Tiled object layer in a map. This mirrors the structure of a Tiled + * object layer, except: + * - "x" & "y" properties are ignored since these cannot be changed in Tiled. + * - "offsetx" & "offsety" are applied to the individual object coordinates directly, so they + * are ignored as well. + * - "draworder" is ignored. + */ + class ObjectLayer { + /** + * + * @param config The data for the layer from the Tiled JSON object. + */ + constructor(config?: Phaser.Types.Tilemaps.ObjectLayerConfig); + + /** + * The name of the Object Layer. + */ + name: string; + + /** + * The opacity of the layer, between 0 and 1. + */ + opacity: number; + + /** + * The custom properties defined on the Object Layer, keyed by their name. + */ + properties: object; + + /** + * The type of each custom property defined on the Object Layer, keyed by its name. + */ + propertyTypes: object; + + /** + * The type of the layer, which should be `objectgroup`. + */ + type: string; + + /** + * Whether the layer is shown (`true`) or hidden (`false`). + */ + visible: boolean; + + /** + * An array of all objects on this Object Layer. + * + * Each Tiled object corresponds to a JavaScript object in this array. It has an `id` (unique), + * `name` (as assigned in Tiled), `type` (as assigned in Tiled), `rotation` (in clockwise degrees), + * `properties` (if any), `visible` state (`true` if visible, `false` otherwise), + * `x` and `y` coordinates (in pixels, relative to the tilemap), and a `width` and `height` (in pixels). + * + * An object tile has a `gid` property (GID of the represented tile), a `flippedHorizontal` property, + * a `flippedVertical` property, and `flippedAntiDiagonal` property. + * The {@link http://docs.mapeditor.org/en/latest/reference/tmx-map-format/|Tiled documentation} contains + * information on flipping and rotation. + * + * Polylines have a `polyline` property, which is an array of objects corresponding to points, + * where each point has an `x` property and a `y` property. Polygons have an identically structured + * array in their `polygon` property. Text objects have a `text` property with the text's properties. + * + * Rectangles and ellipses have a `rectangle` or `ellipse` property set to `true`. + */ + objects: Phaser.Types.Tilemaps.TiledObject[]; + + } + + namespace Parsers { + namespace Impact { + /** + * [description] + * @param json [description] + * @param insertNull [description] + */ + function ParseTileLayers(json: object, insertNull: boolean): any[]; + + /** + * [description] + * @param json [description] + */ + function ParseTilesets(json: object): any[]; + + /** + * Parses a Weltmeister JSON object into a new MapData object. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param json The Weltmeister JSON object. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function ParseWeltmeister(name: string, json: object, insertNull: boolean): object; + + } + + /** + * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format + * is found, returns `null`. When loading from CSV or a 2D array, you should specify the tileWidth & + * tileHeight. When parsing from a map from Tiled, the tileWidth & tileHeight will be pulled from + * the map data. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param mapFormat See ../Formats.js. + * @param data 2D array, CSV string or Tiled JSON object. + * @param tileWidth The width of a tile in pixels. Required for 2D array and CSV, but + * ignored for Tiled JSON. + * @param tileHeight The height of a tile in pixels. Required for 2D array and CSV, but + * ignored for Tiled JSON. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function Parse(name: string, mapFormat: integer, data: integer[][] | string | object, tileWidth: integer, tileHeight: integer, insertNull: boolean): Phaser.Tilemaps.MapData; + + /** + * Parses a 2D array of tile indexes into a new MapData object with a single layer. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param data 2D array, CSV string or Tiled JSON object. + * @param tileWidth The width of a tile in pixels. + * @param tileHeight The height of a tile in pixels. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function Parse2DArray(name: string, data: integer[][], tileWidth: integer, tileHeight: integer, insertNull: boolean): Phaser.Tilemaps.MapData; + + /** + * Parses a CSV string of tile indexes into a new MapData object with a single layer. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param data CSV string of tile indexes. + * @param tileWidth The width of a tile in pixels. + * @param tileHeight The height of a tile in pixels. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function ParseCSV(name: string, data: string, tileWidth: integer, tileHeight: integer, insertNull: boolean): Phaser.Tilemaps.MapData; + + namespace Tiled { + /** + * Copy properties from tileset to tiles. + * @param mapData [description] + */ + function AssignTileProperties(mapData: Phaser.Tilemaps.MapData): void; + + /** + * Decode base-64 encoded data, for example as exported by Tiled. + * @param data Base-64 encoded data to decode. + */ + function Base64Decode(data: object): any[]; + + /** + * Master list of tiles -> x, y, index in tileset. + * @param mapData [description] + */ + function BuildTilesetIndex(mapData: Phaser.Tilemaps.MapData): any[]; + + /** + * See Tiled documentation on tile flipping: + * http://docs.mapeditor.org/en/latest/reference/tmx-map-format/ + * @param gid [description] + */ + function ParseGID(gid: number): object; + + /** + * [description] + * @param json [description] + */ + function ParseImageLayers(json: object): any[]; + + /** + * Parses a Tiled JSON object into a new MapData object. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param json The Tiled JSON object. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function ParseJSONTiled(name: string, json: object, insertNull: boolean): Phaser.Tilemaps.MapData; + + /** + * Convert a Tiled object to an internal parsed object normalising and copying properties over, while applying optional x and y offsets. The parsed object will always have the properties `id`, `name`, `type`, `rotation`, `properties`, `visible`, `x`, `y`, `width` and `height`. Other properties will be added according to the object type (such as text, polyline, gid etc.) + * @param tiledObject Tiled object to convert to an internal parsed object normalising and copying properties over. + * @param offsetX Optional additional offset to apply to the object's x property. Defaults to 0. Default 0. + * @param offsetY Optional additional offset to apply to the object's y property. Defaults to 0. Default 0. + */ + function ParseObject(tiledObject: object, offsetX?: number, offsetY?: number): object; + + /** + * Parses a Tiled JSON object into an array of ObjectLayer objects. + * @param json The Tiled JSON object. + */ + function ParseObjectLayers(json: object): any[]; + + /** + * [description] + * @param json [description] + * @param insertNull [description] + */ + function ParseTileLayers(json: object, insertNull: boolean): any[]; + + /** + * Tilesets and Image Collections + * @param json [description] + */ + function ParseTilesets(json: object): object; + + } + + } + + /** + * Create a Tilemap from the given key or data. If neither is given, make a blank Tilemap. When + * loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing from + * a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map data. For + * an empty map, you should specify tileWidth, tileHeight, width & height. + * @param scene The Scene to which this Tilemap belongs. + * @param key The key in the Phaser cache that corresponds to the loaded tilemap data. + * @param tileWidth The width of a tile in pixels. Default 32. + * @param tileHeight The height of a tile in pixels. Default 32. + * @param width The width of the map in tiles. Default 10. + * @param height The height of the map in tiles. Default 10. + * @param data Instead of loading from the cache, you can also load directly from + * a 2D array of tile indexes. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the + * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. Default false. + */ + function ParseToTilemap(scene: Phaser.Scene, key?: string, tileWidth?: integer, tileHeight?: integer, width?: integer, height?: integer, data?: integer[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; + + /** + * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. + * + * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile + * effects like tint or alpha, or change the tiles or tilesets the layer uses. + * + * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features. + */ + class StaticTilemapLayer extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param tilemap The Tilemap this layer is a part of. + * @param layerIndex The index of the LayerData associated with this layer. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The world x position where the top left of this layer will be placed. Default 0. + * @param y The world y position where the top left of this layer will be placed. Default 0. + */ + constructor(scene: Phaser.Scene, tilemap: Phaser.Tilemaps.Tilemap, layerIndex: integer, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number); + + /** + * Used internally by physics system to perform fast type checks. + */ + readonly isTilemap: boolean; + + /** + * The Tilemap that this layer is a part of. + */ + tilemap: Phaser.Tilemaps.Tilemap; + + /** + * The index of the LayerData associated with this layer. + */ + layerIndex: integer; + + /** + * The LayerData associated with this layer. LayerData can only be associated with one + * tilemap layer. + */ + layer: Phaser.Tilemaps.LayerData; + + /** + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. + */ + tileset: Phaser.Tilemaps.Tileset[]; + + /** + * Used internally by the Canvas renderer. + * This holds the tiles that are visible within the camera in the last frame. + */ + culledTiles: any[]; + + /** + * Canvas only. + * + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this, and toggling this flag allows + * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. + */ + skipCull: boolean; + + /** + * Canvas only. + * + * The total number of tiles drawn by the renderer in the last frame. + * + * This only works when rending with Canvas. + */ + readonly tilesDrawn: integer; + + /** + * Canvas only. + * + * The total number of tiles in this layer. Updated every frame. + */ + readonly tilesTotal: integer; + + /** + * Canvas only. + * + * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. + * + * See the method `setCullPadding` for more details. + */ + cullPaddingX: integer; + + /** + * Canvas only. + * + * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. + * + * See the method `setCullPadding` for more details. + */ + cullPaddingY: integer; + + /** + * Canvas only. + * + * The callback that is invoked when the tiles are culled. + * + * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. + * + * It will be sent 3 arguments: + * + * 1. The Phaser.Tilemaps.LayerData object for this Layer + * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. + * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. + * + * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. + */ + cullCallback: Function; + + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + */ + gidMap: Phaser.Tilemaps.Tileset[]; + + /** + * Upload the tile data to a VBO. + * @param camera The camera to render to. + * @param tilesetIndex The tileset index. + */ + upload(camera: Phaser.Cameras.Scene2D.Camera, tilesetIndex: integer): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets the rendering (draw) order of the tiles in this layer. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * @param renderOrder The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + */ + setRenderOrder(renderOrder: integer | string): this; + + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * @param tileX The x coordinate. + * @param tileY The y coordinate. + */ + calculateFacesAt(tileX: integer, tileY: integer): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + */ + calculateFacesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * @param indexes The tile index, or array of indexes, to create Sprites from. + * @param replacements The tile index, or array of indexes, to change a converted + * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a + * one-to-one mapping with the indexes array. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. + * scene.make.sprite). + * @param scene The Scene to create the Sprites within. Default scene the map is within. + * @param camera The Camera to use when determining the world XY Default main camera. + */ + createFromTiles(indexes: integer | any[], replacements: integer | any[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Sprite[]; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. + * This is used internally. + * @param camera The Camera to run the cull check against. + */ + cull(camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Canvas only. + * + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this. + * @param value Set to `true` to stop culling tiles. Set to `false` to enable culling again. Default true. + */ + setSkipCull(value?: boolean): this; + + /** + * Canvas only. + * + * When a Camera culls the tiles in this layer it does so using its view into the world, building up a + * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size + * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so + * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px + * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) + * @param paddingX The amount of extra horizontal tiles to add to the cull check padding. Default 1. + * @param paddingY The amount of extra vertical tiles to add to the cull check padding. Default 1. + */ + setCullPadding(paddingX?: integer, paddingY?: integer): this; + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * @param index The tile index value to search for. + * @param skip The number of times to skip a matching tile before returning. Default 0. + * @param reverse If true it will scan the layer in reverse, starting at the + * bottom-right. Otherwise it scans from the top-left. Default false. + */ + findByIndex(index: integer, skip?: integer, reverse?: boolean): Phaser.Tilemaps.Tile; + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + findTile(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param context The context under which the callback should be run. + * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + filterTiles(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + forEachTile(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Gets a tile at the given tile coordinates from the given layer. + * @param tileX X position to get the tile from (given in tile units, not pixels). + * @param tileY Y position to get the tile from (given in tile units, not pixels). + * @param nonNull If true getTile won't return null for empty tiles, but a Tile + * object with an index of -1. Default false. + */ + getTileAt(tileX: integer, tileY: integer, nonNull?: boolean): Phaser.Tilemaps.Tile; + + /** + * Gets a tile at the given world coordinates from the given layer. + * @param worldX X position to get the tile from (given in pixels) + * @param worldY Y position to get the tile from (given in pixels) + * @param nonNull If true, function won't return null for empty tiles, but a Tile + * object with an index of -1. Default false. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + getTilesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * @param worldX The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param worldY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles high from the `tileY` index the area will be. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + */ + getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * @param shape A shape in world (pixel) coordinates + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param tileX X position to get the tile from in tile coordinates. + * @param tileY Y position to get the tile from in tile coordinates. + */ + hasTileAt(tileX: integer, tileY: integer): boolean; + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param worldX The X coordinate of the world position. + * @param worldY The Y coordinate of the world position. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * @param graphics The target Graphics object to draw upon. + * @param styleConfig An object specifying the colors to use for the debug drawing. + */ + renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * @param indexes Either a single tile index, or an array of tile indexes. + * @param collides If true it will enable collision. If false it will clear + * collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the + * update. Default true. + */ + setCollision(indexes: integer | any[], collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * @param start The first index of the tile to be set for collision. + * @param stop The last index of the tile to be set for collision. + * @param collides If true it will enable collision. If false it will clear + * collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the + * update. Default true. + */ + setCollisionBetween(start: integer, stop: integer, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * @param properties An object with tile properties and corresponding values that should + * be checked. + * @param collides If true it will enable collision. If false it will clear + * collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the + * update. Default true. + */ + setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). + * @param indexes An array of the tile indexes to not be counted for collision. + * @param collides If true it will enable collision. If false it will clear + * collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the + * update. Default true. + */ + setCollisionByExclusion(indexes: integer[], collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * @param indexes Either a single tile index, or an array of tile indexes to have a + * collision callback set for. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + */ + setTileIndexCallback(indexes: integer | any[], callback: Function, callbackContext: object): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets collision on the tiles within a layer by checking each tiles collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tiles collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * @param collides If true it will enable collision. If false it will clear + * collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the + * update. Default true. + */ + setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + */ + setTileLocationCallback(tileX: integer, tileY: integer, width: integer, height: integer, callback: Function, callbackContext?: object): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileX The X coordinate, in tile coordinates. + * @param camera The Camera to use when calculating the world values from the tile index. Default main camera. + */ + tileToWorldX(tileX: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileY The Y coordinate, in tile coordinates. + * @param camera The Camera to use when calculating the world values from the tile index. Default main camera. + */ + tileToWorldY(tileY: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The X coordinate, in tile coordinates. + * @param tileY The Y coordinate, in tile coordinates. + * @param point A Vector2 to store the coordinates in. If not given, a new Vector2 is created. + * @param camera The Camera to use when calculating the world values from the tile index. Default main camera. + */ + tileToWorldXY(tileX: integer, tileY: integer, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldX The X coordinate, in world pixels. + * @param snapToFloor Whether or not to round the tile coordinate down to the + * nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values.] Default main camera. + */ + worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldY The Y coordinate, in world pixels. + * @param snapToFloor Whether or not to round the tile coordinate down to the + * nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The X coordinate, in world pixels. + * @param worldY The Y coordinate, in world pixels. + * @param snapToFloor Whether or not to round the tile coordinate down to the + * nearest integer. Default true. + * @param point A Vector2 to store the coordinates in. If not given, a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Destroys this StaticTilemapLayer and removes its link to the associated LayerData. + * @param removeFromTilemap Remove this layer from the parent Tilemap? Default true. + */ + destroy(removeFromTilemap?: boolean): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + } + + /** + * A Tile is a representation of a single tile within the Tilemap. This is a lightweight data + * representation, so its position information is stored without factoring in scroll, layer + * scale or layer position. + */ + class Tile implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Visible { + /** + * + * @param layer The LayerData object in the Tilemap that this tile belongs to. + * @param index The unique index of this tile within the map. + * @param x The x coordinate of this tile in tile coordinates. + * @param y The y coordinate of this tile in tile coordinates. + * @param width Width of the tile in pixels. + * @param height Height of the tile in pixels. + * @param baseWidth The base width a tile in the map (in pixels). Tiled maps support + * multiple tileset sizes within one map, but they are still placed at intervals of the base + * tile width. + * @param baseHeight The base height of the tile in pixels (in pixels). Tiled maps + * support multiple tileset sizes within one map, but they are still placed at intervals of the + * base tile height. + */ + constructor(layer: Phaser.Tilemaps.LayerData, index: integer, x: integer, y: integer, width: integer, height: integer, baseWidth: integer, baseHeight: integer); + + /** + * The LayerData in the Tilemap data that this tile belongs to. + */ + layer: Phaser.Tilemaps.LayerData; + + /** + * The index of this tile within the map data corresponding to the tileset, or -1 if this + * represents a blank tile. + */ + index: integer; + + /** + * The x map coordinate of this tile in tile units. + */ + x: integer; + + /** + * The y map coordinate of this tile in tile units. + */ + y: integer; + + /** + * The width of the tile in pixels. + */ + width: integer; + + /** + * The height of the tile in pixels. + */ + height: integer; + + /** + * The map's base width of a tile in pixels. Tiled maps support multiple tileset sizes + * within one map, but they are still placed at intervals of the base tile size. + */ + baseWidth: integer; + + /** + * The map's base height of a tile in pixels. Tiled maps support multiple tileset sizes + * within one map, but they are still placed at intervals of the base tile size. + */ + baseHeight: integer; + + /** + * The x coordinate of the top left of this tile in pixels. This is relative to the top left + * of the layer this tile is being rendered within. This property does NOT factor in camera + * scroll, layer scale or layer position. + */ + pixelX: number; + + /** + * The y coordinate of the top left of this tile in pixels. This is relative to the top left + * of the layer this tile is being rendered within. This property does NOT factor in camera + * scroll, layer scale or layer position. + */ + pixelY: number; + + /** + * Tile specific properties. These usually come from Tiled. + */ + properties: any; + + /** + * The rotation angle of this tile. + */ + rotation: number; + + /** + * Whether the tile should collide with any object on the left side. + */ + collideLeft: boolean; + + /** + * Whether the tile should collide with any object on the right side. + */ + collideRight: boolean; + + /** + * Whether the tile should collide with any object on the top side. + */ + collideUp: boolean; + + /** + * Whether the tile should collide with any object on the bottom side. + */ + collideDown: boolean; + + /** + * Whether the tile's left edge is interesting for collisions. + */ + faceLeft: boolean; + + /** + * Whether the tile's right edge is interesting for collisions. + */ + faceRight: boolean; + + /** + * Whether the tile's top edge is interesting for collisions. + */ + faceTop: boolean; + + /** + * Whether the tile's bottom edge is interesting for collisions. + */ + faceBottom: boolean; + + /** + * Tile collision callback. + */ + collisionCallback: Function; + + /** + * The context in which the collision callback will be called. + */ + collisionCallbackContext: object; + + /** + * The tint to apply to this tile. Note: tint is currently a single color value instead of + * the 4 corner tint component on other GameObjects. + */ + tint: number; + + /** + * An empty object where physics-engine specific information (e.g. bodies) may be stored. + */ + physics: object; + + /** + * Check if the given x and y world coordinates are within this Tile. This does not factor in + * camera scroll, layer scale or layer position. + * @param x The x coordinate to test. + * @param y The y coordinate to test. + */ + containsPoint(x: number, y: number): boolean; + + /** + * Copies the tile data & properties from the given tile to this tile. This copies everything + * except for position and interesting faces. + * @param tile The tile to copy from. + */ + copy(tile: Phaser.Tilemaps.Tile): Phaser.Tilemaps.Tile; + + /** + * The collision group for this Tile, defined within the Tileset. This returns a reference to + * the collision group stored within the Tileset, so any modification of the returned object + * will impact all tiles that have the same index as this tile. + */ + getCollisionGroup(): object; + + /** + * The tile data for this Tile, defined within the Tileset. This typically contains Tiled + * collision data, tile animations and terrain information. This returns a reference to the tile + * data stored within the Tileset, so any modification of the returned object will impact all + * tiles that have the same index as this tile. + */ + getTileData(): object; + + /** + * Gets the world X position of the left side of the tile, factoring in the layers position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getLeft(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Gets the world X position of the right side of the tile, factoring in the layer's position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getRight(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Gets the world Y position of the top side of the tile, factoring in the layer's position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getTop(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Gets the world Y position of the bottom side of the tile, factoring in the layer's position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getBottom(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Gets the world rectangle bounding box for the tile, factoring in the layers position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + * @param output [description] + */ + getBounds(camera?: Phaser.Cameras.Scene2D.Camera, output?: object): Phaser.Geom.Rectangle | object; + + /** + * Gets the world X position of the center of the tile, factoring in the layer's position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getCenterX(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Gets the world Y position of the center of the tile, factoring in the layer's position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getCenterY(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Clean up memory. + */ + destroy(): void; + + /** + * Check for intersection with this tile. This does not factor in camera scroll, layer scale or + * layer position. + * @param x The x axis in pixels. + * @param y The y axis in pixels. + * @param right The right point. + * @param bottom The bottom point. + */ + intersects(x: number, y: number, right: number, bottom: number): boolean; + + /** + * Checks if the tile is interesting. + * @param collides If true, will consider the tile interesting if it collides on any side. + * @param faces If true, will consider the tile interesting if it has an interesting face. + */ + isInteresting(collides: boolean, faces: boolean): boolean; + + /** + * Reset collision status flags. + * @param recalculateFaces Whether or not to recalculate interesting faces for this tile and its neighbors. Default true. + */ + resetCollision(recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + + /** + * Reset faces. + */ + resetFaces(): Phaser.Tilemaps.Tile; + + /** + * Sets the collision flags for each side of this tile and updates the interesting faces list. + * @param left Indicating collide with any object on the left. + * @param right Indicating collide with any object on the right. + * @param up Indicating collide with any object on the top. + * @param down Indicating collide with any object on the bottom. + * @param recalculateFaces Whether or not to recalculate interesting faces + * for this tile and its neighbors. Default true. + */ + setCollision(left: boolean, right?: boolean, up?: boolean, down?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + + /** + * Set a callback to be called when this tile is hit by an object. The callback must true for + * collision processing to take place. + * @param callback Callback function. + * @param context Callback will be called within this context. + */ + setCollisionCallback(callback: Function, context: object): Phaser.Tilemaps.Tile; + + /** + * Sets the size of the tile and updates its pixelX and pixelY. + * @param tileWidth The width of the tile in pixels. + * @param tileHeight The height of the tile in pixels. + * @param baseWidth The base width a tile in the map (in pixels). + * @param baseHeight The base height of the tile in pixels (in pixels). + */ + setSize(tileWidth: integer, tileHeight: integer, baseWidth: integer, baseHeight: integer): Phaser.Tilemaps.Tile; + + /** + * Used internally. Updates the tile's world XY position based on the current tile size. + */ + updatePixelXY(): Phaser.Tilemaps.Tile; + + /** + * True if this tile can collide on any of its faces or has a collision callback set. + */ + readonly canCollide: boolean; + + /** + * True if this tile can collide on any of its faces. + */ + readonly collides: boolean; + + /** + * True if this tile has any interesting faces. + */ + readonly hasInterestingFace: boolean; + + /** + * The tileset that contains this Tile. This is null if accessed from a LayerData instance + * before the tile is placed in a StaticTilemapLayer or DynamicTilemapLayer, or if the tile has + * an index that doesn't correspond to any of the map's tilesets. + */ + readonly tileset: Phaser.Tilemaps.Tileset; + + /** + * The tilemap layer that contains this Tile. This will only return null if accessed from a + * LayerData instance before the tile is placed within a StaticTilemapLayer or + * DynamicTilemapLayer. + */ + readonly tilemapLayer: Phaser.Tilemaps.StaticTilemapLayer | Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * The tilemap that contains this Tile. This will only return null if accessed from a LayerData + * instance before the tile is placed within a StaticTilemapLayer or DynamicTilemapLayer. + */ + readonly tilemap: Phaser.Tilemaps.Tilemap; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Tilemap is a container for Tilemap data. This isn't a display object, rather, it holds data + * about the map and allows you to add tilesets and tilemap layers to it. A map can have one or + * more tilemap layers (StaticTilemapLayer or DynamicTilemapLayer), which are the display + * objects that actually render tiles. + * + * The Tilemap data be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free + * software package specifically for creating tile maps, and is available from: + * http://www.mapeditor.org + * + * A Tilemap has handy methods for getting & manipulating the tiles within a layer. You can only + * use the methods that change tiles (e.g. removeTileAt) on a DynamicTilemapLayer. + * + * Note that all Tilemaps use a base tile size to calculate dimensions from, but that a + * StaticTilemapLayer or DynamicTilemapLayer may have its own unique tile size that overrides + * it. + */ + class Tilemap { + /** + * + * @param scene The Scene to which this Tilemap belongs. + * @param mapData A MapData instance containing Tilemap data. + */ + constructor(scene: Phaser.Scene, mapData: Phaser.Tilemaps.MapData); + + scene: Phaser.Scene; + + /** + * The base width of a tile in pixels. Note that individual layers may have a different tile + * width. + */ + tileWidth: integer; + + /** + * The base height of a tile in pixels. Note that individual layers may have a different + * tile height. + */ + tileHeight: integer; + + /** + * The width of the map (in tiles). + */ + width: number; + + /** + * The height of the map (in tiles). + */ + height: number; + + /** + * The orientation of the map data (as specified in Tiled), usually 'orthogonal'. + */ + orientation: string; + + /** + * The render (draw) order of the map data (as specified in Tiled), usually 'right-down'. + * + * The draw orders are: + * + * right-down + * left-down + * right-up + * left-up + * + * This can be changed via the `setRenderOrder` method. + */ + renderOrder: string; + + /** + * The format of the map data. + */ + format: number; + + /** + * The version of the map data (as specified in Tiled, usually 1). + */ + version: number; + + /** + * Map specific properties as specified in Tiled. + */ + properties: object; + + /** + * The width of the map in pixels based on width * tileWidth. + */ + widthInPixels: number; + + /** + * The height of the map in pixels based on height * tileHeight. + */ + heightInPixels: number; + + imageCollections: Phaser.Tilemaps.ImageCollection[]; + + /** + * An array of Tiled Image Layers. + */ + images: any[]; + + /** + * An array of Tilemap layer data. + */ + layers: Phaser.Tilemaps.LayerData[]; + + /** + * An array of Tilesets used in the map. + */ + tilesets: Phaser.Tilemaps.Tileset[]; + + /** + * An array of ObjectLayer instances parsed from Tiled object layers. + */ + objects: Phaser.Tilemaps.ObjectLayer[]; + + /** + * The index of the currently selected LayerData object. + */ + currentLayerIndex: integer; + + /** + * Sets the rendering (draw) order of the tiles in this map. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * + * Calling this method _after_ creating Static or Dynamic Tilemap Layers will **not** automatically + * update them to use the new render order. If you call this method after creating layers, use their + * own `setRenderOrder` methods to change them as needed. + * @param renderOrder The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + */ + setRenderOrder(renderOrder: integer | string): this; + + /** + * Adds an image to the map to be used as a tileset. A single map may use multiple tilesets. + * Note that the tileset name can be found in the JSON file exported from Tiled, or in the Tiled + * editor. + * @param tilesetName The name of the tileset as specified in the map data. + * @param key The key of the Phaser.Cache image used for this tileset. If + * `undefined` or `null` it will look for an image with a key matching the tilesetName parameter. + * @param tileWidth The width of the tile (in pixels) in the Tileset Image. If not + * given it will default to the map's tileWidth value, or the tileWidth specified in the Tiled + * JSON file. + * @param tileHeight The height of the tiles (in pixels) in the Tileset Image. If + * not given it will default to the map's tileHeight value, or the tileHeight specified in the + * Tiled JSON file. + * @param tileMargin The margin around the tiles in the sheet (in pixels). If not + * specified, it will default to 0 or the value specified in the Tiled JSON file. + * @param tileSpacing The spacing between each the tile in the sheet (in pixels). + * If not specified, it will default to 0 or the value specified in the Tiled JSON file. + * @param gid If adding multiple tilesets to a blank map, specify the starting + * GID this set will use here. Default 0. + */ + addTilesetImage(tilesetName: string, key?: string, tileWidth?: integer, tileHeight?: integer, tileMargin?: integer, tileSpacing?: integer, gid?: integer): Phaser.Tilemaps.Tileset; + + /** + * Turns the DynamicTilemapLayer associated with the given layer into a StaticTilemapLayer. If + * no layer specified, the map's current layer is used. This is useful if you want to manipulate + * a map at the start of a scene, but then make it non-manipulable and optimize it for speed. + * Note: the DynamicTilemapLayer passed in is destroyed, so make sure to store the value + * returned from this method if you want to manipulate the new StaticTilemapLayer. + * @param layer The name of the layer from Tiled, the + * index of the layer in the map, or a DynamicTilemapLayer. + */ + convertLayerToStatic(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * + * If no layer specified, the map's current layer is used. This cannot be applied to StaticTilemapLayers. + * @param srcTileX The x coordinate of the area to copy from, in tiles, not pixels. + * @param srcTileY The y coordinate of the area to copy from, in tiles, not pixels. + * @param width The width of the area to copy, in tiles, not pixels. + * @param height The height of the area to copy, in tiles, not pixels. + * @param destTileX The x coordinate of the area to copy to, in tiles, not pixels. + * @param destTileY The y coordinate of the area to copy to, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + copy(srcTileX: integer, srcTileY: integer, width: integer, height: integer, destTileX: integer, destTileY: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer. + * @param name The name of this layer. Must be unique within the map. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The world x position where the top left of this layer will be placed. Default 0. + * @param y The world y position where the top left of this layer will be placed. Default 0. + * @param width The width of the layer in tiles. If not specified, it will default to the map's width. + * @param height The height of the layer in tiles. If not specified, it will default to the map's height. + * @param tileWidth The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. + * @param tileHeight The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. + */ + createBlankDynamicLayer(name: string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number, width?: integer, height?: integer, tileWidth?: integer, tileHeight?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Creates a new DynamicTilemapLayer that renders the LayerData associated with the given + * `layerID`. The currently selected layer in the map is set to this new layer. + * + * The `layerID` is important. If you've created your map in Tiled then you can get this by + * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and + * look at the layers[].name value. Either way it must match. + * + * Unlike a static layer, a dynamic layer can be modified. See DynamicTilemapLayer for more + * information. + * @param layerID The layer array index value, or if a string is given, the layer name from Tiled. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. + * @param y The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. + */ + createDynamicLayer(layerID: integer | string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Creates a Sprite for every object matching the given gid in the map data. All properties from + * the map data objectgroup are copied into the `spriteConfig`, so you can use this as an easy + * way to configure Sprite properties from within the map editor. For example giving an object a + * property of alpha: 0.5 in the map editor will duplicate that when the Sprite is created. + * + * Custom object properties not sharing names with the Sprite's own properties are copied to the + * Sprite's {@link Phaser.GameObjects.Sprite#data data store}. + * @param name The name of the object layer (from Tiled) to create Sprites from. + * @param id Either the id (object), gid (tile object) or name (object or + * tile object) from Tiled. Ids are unique in Tiled, but a gid is shared by all tile objects + * with the same graphic. The same name can be used on multiple objects. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. + * scene.make.sprite). + * @param scene The Scene to create the Sprites within. Default the scene the map is within. + */ + createFromObjects(name: string, id: integer | string, spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene): Phaser.GameObjects.Sprite[]; + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * @param indexes The tile index, or array of indexes, to create Sprites from. + * @param replacements The tile index, or array of indexes, to change a converted + * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a + * one-to-one mapping with the indexes array. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. scene.make.sprite). + * @param scene The Scene to create the Sprites within. Default scene the map is within. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + createFromTiles(indexes: integer | any[], replacements: integer | any[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.GameObjects.Sprite[]; + + /** + * Creates a new StaticTilemapLayer that renders the LayerData associated with the given + * `layerID`. The currently selected layer in the map is set to this new layer. + * + * The `layerID` is important. If you've created your map in Tiled then you can get this by + * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and + * look at the layers[].name value. Either way it must match. + * + * It's important to remember that a static layer cannot be modified. See StaticTilemapLayer for + * more information. + * @param layerID The layer array index value, or if a string is given, the layer name from Tiled. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. + * @param y The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. + */ + createStaticLayer(layerID: integer | string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any + * StaticTilemapLayers or DynamicTilemapLayers that have been linked to LayerData. + */ + destroy(): void; + + /** + * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the + * specified index. Tiles will be set to collide if the given index is a colliding index. + * Collision information in the region will be recalculated. + * + * If no layer specified, the map's current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param index The tile index to fill the area with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + fill(index: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * For each object in the given object layer, run the given filter callback function. Any + * objects that pass the filter test (i.e. where the callback returns true) will returned as a + * new array. Similar to Array.prototype.Filter in vanilla JS. + * @param objectLayer The name of an object layer (from Tiled) or an ObjectLayer instance. + * @param callback The callback. Each object in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + */ + filterObjects(objectLayer: Phaser.Tilemaps.ObjectLayer | string, callback: TilemapFilterCallback, context?: object): Phaser.GameObjects.GameObject[]; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * If no layer specified, the map's current layer is used. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The tile layer to use. If not given the current layer is used. + */ + filterTiles(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * If no layer specified, the map's current layer is used. + * @param index The tile index value to search for. + * @param skip The number of times to skip a matching tile before returning. Default 0. + * @param reverse If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. Default false. + * @param layer The tile layer to use. If not given the current layer is used. + */ + findByIndex(index: integer, skip?: integer, reverse?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Find the first object in the given object layer that satisfies the provided testing function. + * I.e. finds the first object for which `callback` returns true. Similar to + * Array.prototype.find in vanilla JS. + * @param objectLayer The name of an object layer (from Tiled) or an ObjectLayer instance. + * @param callback The callback. Each object in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + */ + findObject(objectLayer: Phaser.Tilemaps.ObjectLayer | string, callback: TilemapFindCallback, context?: object): Phaser.GameObjects.GameObject; + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * If no layer specified, the maps current layer is used. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tile layer to run the search on. If not provided will use the current layer. + */ + findTile(callback: FindTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * + * If no layer specified, the map's current layer is used. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tile layer to run the search on. If not provided will use the current layer. + */ + forEachTile(callback: EachTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Gets the image layer index based on its name. + * @param name The name of the image to get. + */ + getImageIndex(name: string): integer; + + /** + * Internally used. Returns the index of the object in one of the Tilemaps arrays whose name + * property matches the given `name`. + * @param location The Tilemap array to search. + * @param name The name of the array element to get. + */ + getIndex(location: any[], name: string): number; + + /** + * Gets the LayerData from this.layers that is associated with `layer`, or null if an invalid + * `layer` is given. + * @param layer The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the maps current layer index. + */ + getLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.LayerData; + + /** + * Gets the ObjectLayer from this.objects that has the given `name`, or null if no ObjectLayer + * is found with that name. + * @param name The name of the object layer from Tiled. + */ + getObjectLayer(name?: string): Phaser.Tilemaps.ObjectLayer; + + /** + * Gets the LayerData index of the given `layer` within this.layers, or null if an invalid + * `layer` is given. + * @param layer The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the map's current layer index. + */ + getLayerIndex(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): integer; + + /** + * Gets the index of the LayerData within this.layers that has the given `name`, or null if an + * invalid `name` is given. + * @param name The name of the layer to get. + */ + getLayerIndexByName(name: string): integer; + + /** + * Gets a tile at the given tile coordinates from the given layer. + * If no layer specified, the map's current layer is used. + * @param tileX X position to get the tile from (given in tile units, not pixels). + * @param tileY Y position to get the tile from (given in tile units, not pixels). + * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param layer The tile layer to use. If not given the current layer is used. + */ + getTileAt(tileX: integer, tileY: integer, nonNull?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Gets a tile at the given world coordinates from the given layer. + * If no layer specified, the map's current layer is used. + * @param worldX X position to get the tile from (given in pixels) + * @param worldY Y position to get the tile from (given in pixels) + * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * If no layer specified, the maps current layer is used. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The tile layer to use. If not given the current layer is used. + */ + getTilesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * If no layer specified, the maps current layer is used. + * @param shape A shape in world (pixel) coordinates + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * If no layer specified, the maps current layer is used. + * @param worldX The world x coordinate for the top-left of the area. + * @param worldY The world y coordinate for the top-left of the area. + * @param width The width of the area. + * @param height The height of the area. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + + /** + * Gets the Tileset that has the given `name`, or null if an invalid `name` is given. + * @param name The name of the Tileset to get. + */ + getTileset(name: string): Phaser.Tilemaps.Tileset; + + /** + * Gets the index of the Tileset within this.tilesets that has the given `name`, or null if an + * invalid `name` is given. + * @param name The name of the Tileset to get. + */ + getTilesetIndex(name: string): integer; + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * If no layer specified, the map's current layer is used. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param layer The tile layer to use. If not given the current layer is used. + */ + hasTileAt(tileX: integer, tileY: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): boolean; + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * If no layer specified, the maps current layer is used. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): boolean; + + /** + * The LayerData object that is currently selected in the map. You can set this property using + * any type supported by setLayer. + */ + layer: Phaser.Tilemaps.LayerData; + + /** + * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index + * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified + * location. If you pass in an index, only the index at the specified location will be changed. + * Collision information will be recalculated at the specified location. + * + * If no layer specified, the maps current layer is used. + * + * This cannot be applied to StaticTilemapLayers. + * @param tile The index of this tile to set or a Tile object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + putTileAt(tile: integer | Phaser.Tilemaps.Tile, tileX: integer, tileY: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either + * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the + * specified location. If you pass in an index, only the index at the specified location will be + * changed. Collision information will be recalculated at the specified location. + * + * If no layer specified, the maps current layer is used. This + * cannot be applied to StaticTilemapLayers. + * @param tile The index of this tile to set or a Tile object. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + putTileAtWorldXY(tile: integer | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified + * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, + * all attributes will be copied over to the specified location. If you pass in an index, only the + * index at the specified location will be changed. Collision information will be recalculated + * within the region tiles were changed. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param tile A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + putTilesAt(tile: integer[] | integer[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: integer, tileY: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then + * those will be used for randomly assigning new tile indexes. If an array is not provided, the + * indexes found within the region (excluding -1) will be used for randomly assigning new tile + * indexes. This method only modifies tile indexes and does not change collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param indexes An array of indexes to randomly draw from during randomization. + * @param layer The tile layer to use. If not given the current layer is used. + */ + randomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, indexes?: integer[], layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * + * If no layer specified, the maps current layer is used. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param layer The tile layer to use. If not given the current layer is used. + */ + calculateFacesAt(tileX: integer, tileY: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * + * If no layer specified, the map's current layer is used. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param layer The tile layer to use. If not given the current layer is used. + */ + calculateFacesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Removes the given TilemapLayer from this Tilemap without destroying it. + * + * If no layer specified, the map's current layer is used. + * @param layer The tile layer to be removed. + */ + removeLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Destroys the given TilemapLayer and removes it from this Tilemap. + * + * If no layer specified, the map's current layer is used. + * @param layer The tile layer to be destroyed. + */ + destroyLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Removes all layers from this Tilemap and destroys any associated StaticTilemapLayers or + * DynamicTilemapLayers. + */ + removeAllLayers(): Phaser.Tilemaps.Tilemap; + + /** + * Removes the given Tile, or an array of Tiles, from the layer to which they belong, + * and optionally recalculates the collision information. + * + * This cannot be applied to Tiles that belong to Static Tilemap Layers. + * @param tiles The Tile to remove, or an array of Tiles. + * @param replaceIndex After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile. Default -1. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + removeTile(tiles: Phaser.Tilemaps.Tile | Phaser.Tilemaps.Tile[], replaceIndex?: integer, recalculateFaces?: boolean): Phaser.Tilemaps.Tile[]; + + /** + * Removes the tile at the given tile coordinates in the specified layer and updates the layer's + * collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + removeTileAt(tileX: integer, tileY: integer, replaceWithNull?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Removes the tile at the given world coordinates in the specified layer and updates the layer's + * collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + removeTileAtWorldXY(worldX: number, worldY: number, replaceWithNull?: boolean, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * + * If no layer specified, the maps current layer is used. + * @param graphics The target Graphics object to draw upon. + * @param styleConfig An object specifying the colors to use for the debug drawing. + * @param layer The tile layer to use. If not given the current layer is used. + */ + renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Draws a debug representation of all layers within this Tilemap to the given Graphics object. + * + * This is helpful when you want to get a quick idea of which of your tiles are colliding and which + * have interesting faces. The tiles are drawn starting at (0, 0) in the Graphics, allowing you to + * place the debug representation wherever you want on the screen. + * @param graphics The target Graphics object to draw upon. + * @param styleConfig An object specifying the colors to use for the debug drawing. + * @param layer The tile layer to use. If not given the current layer is used. + */ + renderDebugFull(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does + * not change collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param findIndex The index of the tile to search for. + * @param newIndex The index of the tile to replace it with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param layer The tile layer to use. If not given the current layer is used. + */ + replaceByIndex(findIndex: integer, newIndex: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * + * If no layer specified, the map's current layer is used. + * @param indexes Either a single tile index, or an array of tile indexes. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setCollision(indexes: integer | any[], collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * + * If no layer specified, the map's current layer is used. + * @param start The first index of the tile to be set for collision. + * @param stop The last index of the tile to be set for collision. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setCollisionBetween(start: integer, stop: integer, collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * + * If no layer specified, the map's current layer is used. + * @param properties An object with tile properties and corresponding values that should be checked. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). + * + * If no layer specified, the map's current layer is used. + * @param indexes An array of the tile indexes to not be counted for collision. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setCollisionByExclusion(indexes: integer[], collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets collision on the tiles within a layer by checking each tile's collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tile's collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * + * If no layer specified, the map's current layer is used. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * + * If no layer specified, the map's current layer is used. + * @param indexes Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setTileIndexCallback(indexes: integer | any[], callback: Function, callbackContext: object, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets a collision callback for the given rectangular area (in tile coordindates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * + * If no layer specified, the map's current layer is used. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setTileLocationCallback(tileX: integer, tileY: integer, width: integer, height: integer, callback: Function, callbackContext?: object, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets the current layer to the LayerData associated with `layer`. + * @param layer The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the map's current layer index. + */ + setLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets the base tile size for the map. Note: this does not necessarily match the tileWidth and + * tileHeight for all layers. This also updates the base size on all tiles across all layers. + * @param tileWidth The width of the tiles the map uses for calculations. + * @param tileHeight The height of the tiles the map uses for calculations. + */ + setBaseTileSize(tileWidth: integer, tileHeight: integer): Phaser.Tilemaps.Tilemap; + + /** + * Sets the tile size for a specific `layer`. Note: this does not necessarily match the map's + * tileWidth and tileHeight for all layers. This will set the tile size for the layer and any + * tiles the layer has. + * @param tileWidth The width of the tiles (in pixels) in the layer. + * @param tileHeight The height of the tiles (in pixels) in the layer. + * @param layer The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the map's current layer index. + */ + setLayerTileSize(tileWidth: integer, tileHeight: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given + * layer. It will only randomize the tiles in that area, so if they're all the same nothing will + * appear to have changed! This method only modifies tile indexes and does not change collision + * information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param layer The tile layer to use. If not given the current layer is used. + */ + shuffle(tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision + * information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param tileA First tile index. + * @param tileB Second tile index. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param layer The tile layer to use. If not given the current layer is used. + */ + swapByIndex(tileA: integer, tileB: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * @param tileX The x coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + tileToWorldX(tileX: integer, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer + * to use. If not given the current layer is used. + */ + tileToWorldY(tileY: integer, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * If no layer specified, the maps current layer is used. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + tileToWorldXY(tileX: integer, tileY: integer, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Math.Vector2; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. New indexes are drawn from the given + * weightedIndexes array. An example weighted array: + * + * [ + * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 + * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 + * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 + * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 + * ] + * + * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * method only modifies tile indexes and does not change collision information. + * + * If no layer specified, the map's current layer is used. This + * cannot be applied to StaticTilemapLayers. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param weightedIndexes An array of objects to randomly draw from during + * randomization. They should be in the form: { index: 0, weight: 4 } or + * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param layer The tile layer to use. If not given the current layer is used. + */ + weightedRandomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, weightedIndexes?: object[], layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer + * to use. If not given the current layer is used. + */ + worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * If no layer specified, the maps current layer is used. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Math.Vector2; + + } + + /** + * A Tileset is a combination of an image containing the tiles and a container for data about + * each tile. + */ + class Tileset { + /** + * + * @param name The name of the tileset in the map data. + * @param firstgid The first tile index this tileset contains. + * @param tileWidth Width of each tile (in pixels). Default 32. + * @param tileHeight Height of each tile (in pixels). Default 32. + * @param tileMargin The margin around all tiles in the sheet (in pixels). Default 0. + * @param tileSpacing The spacing between each tile in the sheet (in pixels). Default 0. + * @param tileProperties Custom properties defined per tile in the Tileset. + * These typically are custom properties created in Tiled when editing a tileset. Default {}. + * @param tileData Data stored per tile. These typically are created in Tiled + * when editing a tileset, e.g. from Tiled's tile collision editor or terrain editor. Default {}. + */ + constructor(name: string, firstgid: integer, tileWidth?: integer, tileHeight?: integer, tileMargin?: integer, tileSpacing?: integer, tileProperties?: object, tileData?: object); + + /** + * The name of the Tileset. + */ + name: string; + + /** + * The starting index of the first tile index this Tileset contains. + */ + firstgid: integer; + + /** + * The width of each tile (in pixels). Use setTileSize to change. + */ + readonly tileWidth: integer; + + /** + * The height of each tile (in pixels). Use setTileSize to change. + */ + readonly tileHeight: integer; + + /** + * The margin around the tiles in the sheet (in pixels). Use `setSpacing` to change. + */ + readonly tileMargin: integer; + + /** + * The spacing between each the tile in the sheet (in pixels). Use `setSpacing` to change. + */ + readonly tileSpacing: integer; + + /** + * Tileset-specific properties per tile that are typically defined in the Tiled editor in the + * Tileset editor. + */ + tileProperties: object; + + /** + * Tileset-specific data per tile that are typically defined in the Tiled editor, e.g. within + * the Tileset collision editor. This is where collision objects and terrain are stored. + */ + tileData: object; + + /** + * The cached image that contains the individual tiles. Use setImage to set. + */ + readonly image: Phaser.Textures.Texture; + + /** + * The gl texture used by the WebGL renderer. + */ + readonly glTexture: WebGLTexture; + + /** + * The number of tile rows in the the tileset. + */ + readonly rows: integer; + + /** + * The number of tile columns in the tileset. + */ + readonly columns: integer; + + /** + * The total number of tiles in the tileset. + */ + readonly total: integer; + + /** + * The look-up table to specific tile image texture coordinates (UV in pixels). Each element + * contains the coordinates for a tile in an object of the form {x, y}. + */ + readonly texCoordinates: object[]; + + /** + * Get a tiles properties that are stored in the Tileset. Returns null if tile index is not + * contained in this Tileset. This is typically defined in Tiled under the Tileset editor. + * @param tileIndex The unique id of the tile across all tilesets in the map. + */ + getTileProperties(tileIndex: integer): object | undefined; + + /** + * Get a tile's data that is stored in the Tileset. Returns null if tile index is not contained + * in this Tileset. This is typically defined in Tiled and will contain both Tileset collision + * info and terrain mapping. + * @param tileIndex The unique id of the tile across all tilesets in the map. + */ + getTileData(tileIndex: integer): object | undefined; + + /** + * Get a tile's collision group that is stored in the Tileset. Returns null if tile index is not + * contained in this Tileset. This is typically defined within Tiled's tileset collision editor. + * @param tileIndex The unique id of the tile across all tilesets in the map. + */ + getTileCollisionGroup(tileIndex: integer): object; + + /** + * Returns true if and only if this Tileset contains the given tile index. + * @param tileIndex The unique id of the tile across all tilesets in the map. + */ + containsTileIndex(tileIndex: integer): boolean; + + /** + * Returns the texture coordinates (UV in pixels) in the Tileset image for the given tile index. + * Returns null if tile index is not contained in this Tileset. + * @param tileIndex The unique id of the tile across all tilesets in the map. + */ + getTileTextureCoordinates(tileIndex: integer): object; + + /** + * Sets the image associated with this Tileset and updates the tile data (rows, columns, etc.). + * @param texture The image that contains the tiles. + */ + setImage(texture: Phaser.Textures.Texture): Phaser.Tilemaps.Tileset; + + /** + * Sets the tile width & height and updates the tile data (rows, columns, etc.). + * @param tileWidth The width of a tile in pixels. + * @param tileHeight The height of a tile in pixels. + */ + setTileSize(tileWidth?: integer, tileHeight?: integer): Phaser.Tilemaps.Tileset; + + /** + * Sets the tile margin & spacing and updates the tile data (rows, columns, etc.). + * @param margin The margin around the tiles in the sheet (in pixels). + * @param spacing The spacing between the tiles in the sheet (in pixels). + */ + setSpacing(margin?: integer, spacing?: integer): Phaser.Tilemaps.Tileset; + + /** + * Updates tile texture coordinates and tileset data. + * @param imageWidth The (expected) width of the image to slice. + * @param imageHeight The (expected) height of the image to slice. + */ + updateTileData(imageWidth: integer, imageHeight: integer): Phaser.Tilemaps.Tileset; + + } + + } + + namespace Time { + /** + * The Clock is a Scene plugin which creates and updates Timer Events for its Scene. + */ + class Clock { + /** + * + * @param scene The Scene which owns this Clock. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene which owns this Clock. + */ + scene: Phaser.Scene; + + /** + * The Scene Systems object of the Scene which owns this Clock. + */ + systems: Phaser.Scenes.Systems; + + /** + * The current time of the Clock, in milliseconds. + * + * If accessed externally, this is equivalent to the `time` parameter normally passed to a Scene's `update` method. + */ + now: number; + + /** + * The scale of the Clock's time delta. + * + * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Clock and anything which uses it, such as its Timer Events. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing the Clock. + */ + timeScale: number; + + /** + * Whether the Clock is paused (`true`) or active (`false`). + * + * When paused, the Clock will not update any of its Timer Events, thus freezing time. + */ + paused: boolean; + + /** + * Creates a Timer Event and adds it to the Clock at the start of the frame. + * @param config The configuration for the Timer Event. + */ + addEvent(config: Phaser.Types.Time.TimerEventConfig): Phaser.Time.TimerEvent; + + /** + * Creates a Timer Event and adds it to the Clock at the start of the frame. + * + * This is a shortcut for {@link #addEvent} which can be shorter and is compatible with the syntax of the GreenSock Animation Platform (GSAP). + * @param delay The delay of the function call, in milliseconds. + * @param callback The function to call after the delay expires. + * @param args The arguments to call the function with. + * @param callbackScope The scope (`this` object) to call the function with. + */ + delayedCall(delay: number, callback: Function, args: any[], callbackScope: any): Phaser.Time.TimerEvent; + + /** + * Clears and recreates the array of pending Timer Events. + */ + clearPendingEvents(): Phaser.Time.Clock; + + /** + * Schedules all active Timer Events for removal at the start of the frame. + */ + removeAllEvents(): Phaser.Time.Clock; + + /** + * Updates the arrays of active and pending Timer Events. Called at the start of the frame. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + preUpdate(time: number, delta: number): void; + + /** + * Updates the Clock's internal time and all of its Timer Events. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(time: number, delta: number): void; + + } + + /** + * A Timer Event represents a delayed function call. It's managed by a Scene's {@link Clock} and will call its function after a set amount of time has passed. The Timer Event can optionally repeat - i.e. call its function multiple times before finishing, or loop indefinitely. + * + * Because it's managed by a Clock, a Timer Event is based on game time, will be affected by its Clock's time scale, and will pause if its Clock pauses. + */ + class TimerEvent { + /** + * + * @param config The configuration for the Timer Event, including its delay and callback. + */ + constructor(config: Phaser.Types.Time.TimerEventConfig); + + /** + * The delay in ms at which this TimerEvent fires. + */ + readonly delay: number; + + /** + * The total number of times this TimerEvent will repeat before finishing. + */ + readonly repeat: number; + + /** + * If repeating this contains the current repeat count. + */ + repeatCount: number; + + /** + * True if this TimerEvent loops, otherwise false. + */ + readonly loop: boolean; + + /** + * The callback that will be called when the TimerEvent occurs. + */ + callback: Function; + + /** + * The scope in which the callback will be called. + */ + callbackScope: object; + + /** + * Additional arguments to be passed to the callback. + */ + args: any[]; + + /** + * Scale the time causing this TimerEvent to update. + */ + timeScale: number; + + /** + * Start this many MS into the elapsed (useful if you want a long duration with repeat, but for the first loop to fire quickly) + */ + startAt: number; + + /** + * The time in milliseconds which has elapsed since the Timer Event's creation. + * + * This value is local for the Timer Event and is relative to its Clock. As such, it's influenced by the Clock's time scale and paused state, the Timer Event's initial {@link #startAt} property, and the Timer Event's {@link #timeScale} and {@link #paused} state. + */ + elapsed: number; + + /** + * Whether or not this timer is paused. + */ + paused: boolean; + + /** + * Whether the Timer Event's function has been called. + * + * When the Timer Event fires, this property will be set to `true` before the callback function is invoked and will be reset immediately afterward if the Timer Event should repeat. The value of this property does not directly influence whether the Timer Event will be removed from its Clock, but can prevent it from firing. + */ + hasDispatched: boolean; + + /** + * Completely reinitializes the Timer Event, regardless of its current state, according to a configuration object. + * @param config The new state for the Timer Event. + */ + reset(config: Phaser.Types.Time.TimerEventConfig): Phaser.Time.TimerEvent; + + /** + * Gets the progress of the current iteration, not factoring in repeats. + */ + getProgress(): number; + + /** + * Gets the progress of the timer overall, factoring in repeats. + */ + getOverallProgress(): number; + + /** + * Returns the number of times this Timer Event will repeat before finishing. + * + * This should not be confused with the number of times the Timer Event will fire before finishing. A return value of 0 doesn't indicate that the Timer Event has finished running - it indicates that it will not repeat after the next time it fires. + */ + getRepeatCount(): number; + + /** + * Returns the local elapsed time for the current iteration of the Timer Event. + */ + getElapsed(): number; + + /** + * Returns the local elapsed time for the current iteration of the Timer Event in seconds. + */ + getElapsedSeconds(): number; + + /** + * Forces the Timer Event to immediately expire, thus scheduling its removal in the next frame. + * @param dispatchCallback If `true` (by default `false`), the function of the Timer Event will be called before its removal from its Clock. + */ + remove(dispatchCallback?: boolean): void; + + /** + * Destroys all object references in the Timer Event, i.e. its callback, scope, and arguments. + * + * Normally, this method is only called by the Clock when it shuts down. As such, it doesn't stop the Timer Event. If called manually, the Timer Event will still be updated by the Clock, but it won't do anything when it fires. + */ + destroy(): void; + + } + + } + + namespace Tweens { + namespace Builders { + /** + * Retrieves the value of the given key from an object. + * @param source The object to retrieve the value from. + * @param key The key to look for in the `source` object. + * @param defaultValue The default value to return if the `key` doesn't exist or if no `source` object is provided. + */ + function GetBoolean(source: object, key: string, defaultValue: any): any; + + /** + * [description] + * @param ease [description] + * @param easeParams [description] + */ + function GetEaseFunction(ease: string | Function, easeParams: any[]): Function; + + /** + * [description] + * @param source [description] + * @param key [description] + * @param defaultValue [description] + */ + function GetNewValue(source: object, key: string, defaultValue: any): Function; + + /** + * [description] + * @param config The configuration object of the tween to get the target(s) from. + */ + function GetProps(config: object): any[]; + + /** + * Extracts an array of targets from a Tween configuration object. + * + * The targets will be looked for in a `targets` property. If it's a function, its return value will be used as the result. + * @param config The configuration object to use. + */ + function GetTargets(config: object): any[]; + + /** + * Returns an array of all tweens in the given config + * @param config [description] + */ + function GetTweens(config: object): any[]; + + /** + * Returns `getStart` and `getEnd` functions for a Tween's Data based on a target property and end value. + * + * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. A string can be provided to specify a relative end value which consists of an operation (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current value, or `/=` to divide the current value) followed by its operand. A function can be provided to allow greater control over the end value; it will receive the target object being tweened, the name of the property being tweened, and the current value of the property as its arguments. If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` property is provided, the property will be used as the effective value under the same rules described here. + * @param key The name of the property to modify. + * @param propertyValue The ending value of the property, as described above. + */ + function GetValueOp(key: string, propertyValue: any): Function; + + /** + * Creates a new Number Tween. + * @param parent The owner of the new Tween. + * @param config Configuration for the new Tween. + * @param defaults Tween configuration defaults. + */ + function NumberTweenBuilder(parent: Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline, config: Phaser.Types.Tweens.NumberTweenBuilderConfig, defaults: Phaser.Types.Tweens.TweenConfigDefaults): Phaser.Tweens.Tween; + + /** + * Builds a Timeline of Tweens based on a configuration object. + * @param manager The Tween Manager to which the Timeline will belong. + * @param config The configuration object for the Timeline. + */ + function TimelineBuilder(manager: Phaser.Tweens.TweenManager, config: Phaser.Types.Tweens.TimelineBuilderConfig): Phaser.Tweens.Timeline; + + /** + * Creates a new Tween. + * @param parent The owner of the new Tween. + * @param config Configuration for the new Tween. + * @param defaults Tween configuration defaults. + */ + function TweenBuilder(parent: Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline, config: Phaser.Types.Tweens.TweenBuilderConfig | object, defaults: Phaser.Types.Tweens.TweenConfigDefaults): Phaser.Tweens.Tween; + + } + + namespace Events { + /** + * The Timeline Complete Event. + * + * This event is dispatched by a Tween Timeline when it completes playback. + * + * Listen to it from a Timeline instance using `Timeline.on('complete', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('complete', listener); + * timeline.play(); + * ``` + */ + const TIMELINE_COMPLETE: any; + + /** + * The Timeline Loop Event. + * + * This event is dispatched by a Tween Timeline every time it loops. + * + * Listen to it from a Timeline instance using `Timeline.on('loop', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * loop: 4, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('loop', listener); + * timeline.play(); + * ``` + */ + const TIMELINE_LOOP: any; + + /** + * The Timeline Pause Event. + * + * This event is dispatched by a Tween Timeline when it is paused. + * + * Listen to it from a Timeline instance using `Timeline.on('pause', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('pause', listener); + * // At some point later ... + * timeline.pause(); + * ``` + */ + const TIMELINE_PAUSE: any; + + /** + * The Timeline Resume Event. + * + * This event is dispatched by a Tween Timeline when it is resumed from a paused state. + * + * Listen to it from a Timeline instance using `Timeline.on('resume', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('resume', listener); + * // At some point later ... + * timeline.resume(); + * ``` + */ + const TIMELINE_RESUME: any; + + /** + * The Timeline Start Event. + * + * This event is dispatched by a Tween Timeline when it starts. + * + * Listen to it from a Timeline instance using `Timeline.on('start', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('start', listener); + * timeline.play(); + * ``` + */ + const TIMELINE_START: any; + + /** + * The Timeline Update Event. + * + * This event is dispatched by a Tween Timeline every time it updates, which can happen a lot of times per second, + * so be careful about listening to this event unless you absolutely require it. + * + * Listen to it from a Timeline instance using `Timeline.on('update', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('update', listener); + * timeline.play(); + * ``` + */ + const TIMELINE_UPDATE: any; + + } + + /** + * A Timeline combines multiple Tweens into one. Its overall behavior is otherwise similar to a single Tween. + * + * The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence + * of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline. + */ + class Timeline extends Phaser.Events.EventEmitter { + /** + * + * @param manager The Tween Manager which owns this Timeline. + */ + constructor(manager: Phaser.Tweens.TweenManager); + + /** + * The Tween Manager which owns this Timeline. + */ + manager: Phaser.Tweens.TweenManager; + + /** + * A constant value which allows this Timeline to be easily identified as one. + */ + isTimeline: boolean; + + /** + * An array of Tween objects, each containing a unique property and target being tweened. + */ + data: any[]; + + /** + * The cached size of the data array. + */ + totalData: number; + + /** + * If true then duration, delay, etc values are all frame totals, rather than ms. + */ + useFrames: boolean; + + /** + * Scales the time applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * Value isn't used when calculating total duration of the Timeline, it's a run-time delta adjustment only. + */ + timeScale: number; + + /** + * Loop this Timeline? Can be -1 for an infinite loop, or an integer. + * When enabled it will play through ALL Tweens again (use Tween.repeat to loop a single tween) + */ + loop: number; + + /** + * Time in ms/frames before this Timeline loops. + */ + loopDelay: number; + + /** + * How many loops are left to run? + */ + loopCounter: number; + + /** + * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = true (as it never completes) + */ + completeDelay: number; + + /** + * Countdown timer value, as used by `loopDelay` and `completeDelay`. + */ + countdown: number; + + /** + * The current state of the Timeline. + */ + state: integer; + + /** + * Does the Timeline start off paused? (if so it needs to be started with Timeline.play) + */ + paused: boolean; + + /** + * Elapsed time in ms/frames of this run through of the Timeline. + */ + elapsed: number; + + /** + * Total elapsed time in ms/frames of the entire Timeline, including looping. + */ + totalElapsed: number; + + /** + * Time in ms/frames for the whole Timeline to play through once, excluding loop amounts and loop delays. + */ + duration: number; + + /** + * Value between 0 and 1. The amount of progress through the Timeline, _excluding loops_. + */ + progress: number; + + /** + * Time in ms/frames for all Tweens in this Timeline to complete (including looping) + */ + totalDuration: number; + + /** + * Value between 0 and 1. The amount through the entire Timeline, including looping. + */ + totalProgress: number; + + /** + * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + * + * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + * @param value The time scale value to set. + */ + setTimeScale(value: number): this; + + /** + * Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + */ + getTimeScale(): number; + + /** + * Check whether or not the Timeline is playing. + */ + isPlaying(): boolean; + + /** + * Creates a new Tween, based on the given Tween Config, and adds it to this Timeline. + * @param config The configuration object for the Tween. + */ + add(config: Phaser.Types.Tweens.TweenBuilderConfig | object): this; + + /** + * Adds an existing Tween to this Timeline. + * @param tween The Tween to be added to this Timeline. + */ + queue(tween: Phaser.Tweens.Tween): this; + + /** + * Checks whether a Tween has an offset value. + * @param tween The Tween to check. + */ + hasOffset(tween: Phaser.Tweens.Tween): boolean; + + /** + * Checks whether the offset value is a number or a directive that is relative to previous tweens. + * @param value The offset value to be evaluated. + */ + isOffsetAbsolute(value: number): boolean; + + /** + * Checks if the offset is a relative value rather than an absolute one. + * If the value is just a number, this returns false. + * @param value The offset value to be evaluated. + */ + isOffsetRelative(value: string): boolean; + + /** + * Parses the relative offset value, returning a positive or negative number. + * @param value The relative offset, in the format of '-=500', for example. The first character determines whether it will be a positive or negative number. Spacing matters here. + * @param base The value to use as the offset. + */ + getRelativeOffset(value: string, base: number): number; + + /** + * Calculates the total duration of the timeline. + * + * Computes all tween durations and returns the full duration of the timeline. + * + * The resulting number is stored in the timeline, not as a return value. + */ + calcDuration(): void; + + /** + * Initializes the timeline, which means all Tweens get their init() called, and the total duration will be computed. + * Returns a boolean indicating whether the timeline is auto-started or not. + */ + init(): boolean; + + /** + * Resets all of the timeline's tweens back to their initial states. + * The boolean parameter indicates whether tweens that are looping should reset as well, or not. + * @param resetFromLoop If `true`, resets all looping tweens to their initial values. + */ + resetTweens(resetFromLoop: boolean): void; + + /** + * Sets a callback for the Timeline. + * @param type The internal type of callback to set. + * @param callback Timeline allows multiple tweens to be linked together to create a streaming sequence. + * @param params The parameters to pass to the callback. + * @param scope The context scope of the callback. + */ + setCallback(type: string, callback: Function, params?: any[], scope?: object): this; + + /** + * Passed a Tween to the Tween Manager and requests it be made active. + * @param tween The tween object to make active. + */ + makeActive(tween: Phaser.Tweens.Tween): Phaser.Tweens.TweenManager; + + /** + * Starts playing the Timeline. + */ + play(): void; + + /** + * Updates the Timeline's `state` and fires callbacks and events. + */ + nextState(): void; + + /** + * Returns 'true' if this Timeline has finished and should be removed from the Tween Manager. + * Otherwise, returns false. + * @param timestamp The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(timestamp: number, delta: number): boolean; + + /** + * Stops the Timeline immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. + */ + stop(): void; + + /** + * Pauses the Timeline, retaining its internal state. + * + * Calling this on a Timeline that is already paused has no effect and fires no event. + */ + pause(): this; + + /** + * Resumes a paused Timeline from where it was when it was paused. + * + * Calling this on a Timeline that isn't paused has no effect and fires no event. + */ + resume(): this; + + /** + * Checks if any of the Tweens in this Timeline as operating on the target object. + * + * Returns `false` if no Tweens operate on the target object. + * @param target The target to check all Tweens against. + */ + hasTarget(target: object): boolean; + + /** + * Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags + * them for removal by the TweenManager. + */ + destroy(): void; + + } + + /** + * TweenData state. + */ + var CREATED: integer; + + /** + * TweenData state. + */ + var INIT: integer; + + /** + * TweenData state. + */ + var DELAY: integer; + + /** + * TweenData state. + */ + var OFFSET_DELAY: integer; + + /** + * TweenData state. + */ + var PENDING_RENDER: integer; + + /** + * TweenData state. + */ + var PLAYING_FORWARD: integer; + + /** + * TweenData state. + */ + var PLAYING_BACKWARD: integer; + + /** + * TweenData state. + */ + var HOLD_DELAY: integer; + + /** + * TweenData state. + */ + var REPEAT_DELAY: integer; + + /** + * TweenData state. + */ + var COMPLETE: integer; + + /** + * Tween state. + */ + var PENDING_ADD: integer; + + /** + * Tween state. + */ + var PAUSED: integer; + + /** + * Tween state. + */ + var LOOP_DELAY: integer; + + /** + * Tween state. + */ + var ACTIVE: integer; + + /** + * Tween state. + */ + var COMPLETE_DELAY: integer; + + /** + * Tween state. + */ + var PENDING_REMOVE: integer; + + /** + * Tween state. + */ + var REMOVED: integer; + + /** + * A Tween is able to manipulate the properties of one or more objects to any given value, based + * on a duration and type of ease. They are rarely instantiated directly and instead should be + * created via the TweenManager. + */ + class Tween { + /** + * + * @param parent A reference to the parent of this Tween. Either the Tween Manager or a Tween Timeline instance. + * @param data An array of TweenData objects, each containing a unique property to be tweened. + * @param targets An array of targets to be tweened. + */ + constructor(parent: Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline, data: Phaser.Types.Tweens.TweenDataConfig[], targets: any[]); + + /** + * A reference to the parent of this Tween. + * Either the Tween Manager or a Tween Timeline instance. + */ + parent: Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline; + + /** + * Is the parent of this Tween a Timeline? + */ + parentIsTimeline: boolean; + + /** + * An array of TweenData objects, each containing a unique property and target being tweened. + */ + data: Phaser.Types.Tweens.TweenDataConfig[]; + + /** + * The cached length of the data array. + */ + totalData: integer; + + /** + * An array of references to the target/s this Tween is operating on. + */ + targets: object[]; + + /** + * Cached target total (not necessarily the same as the data total) + */ + totalTargets: integer; + + /** + * If `true` then duration, delay, etc values are all frame totals. + */ + useFrames: boolean; + + /** + * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + */ + timeScale: number; + + /** + * Loop this tween? Can be -1 for an infinite loop, or an integer. + * When enabled it will play through ALL TweenDatas again. Use TweenData.repeat to loop a single element. + */ + loop: number; + + /** + * Time in ms/frames before the tween loops. + */ + loopDelay: number; + + /** + * How many loops are left to run? + */ + loopCounter: number; + + /** + * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes) + */ + completeDelay: number; + + /** + * Countdown timer (used by timeline offset, loopDelay and completeDelay) + */ + countdown: number; + + /** + * Set only if this Tween is part of a Timeline. + */ + offset: number; + + /** + * Set only if this Tween is part of a Timeline. The calculated offset amount. + */ + calculatedOffset: number; + + /** + * The current state of the tween + */ + state: integer; + + /** + * Does the Tween start off paused? (if so it needs to be started with Tween.play) + */ + paused: boolean; + + /** + * Elapsed time in ms/frames of this run through the Tween. + */ + elapsed: number; + + /** + * Total elapsed time in ms/frames of the entire Tween, including looping. + */ + totalElapsed: number; + + /** + * Time in ms/frames for the whole Tween to play through once, excluding loop amounts and loop delays. + */ + duration: number; + + /** + * Value between 0 and 1. The amount through the Tween, excluding loops. + */ + progress: number; + + /** + * Time in ms/frames for the Tween to complete (including looping) + */ + totalDuration: number; + + /** + * Value between 0 and 1. The amount through the entire Tween, including looping. + */ + totalProgress: number; + + /** + * An object containing the various Tween callback references. + */ + callbacks: object; + + /** + * Returns the current value of the Tween. + */ + getValue(): number; + + /** + * Set the scale the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * @param value The scale factor for timescale. + */ + setTimeScale(value: number): this; + + /** + * Returns the scale of the time applied to this Tween. + */ + getTimeScale(): number; + + /** + * Checks if the Tween is currently active. + */ + isPlaying(): boolean; + + /** + * Checks if the Tween is currently paused. + */ + isPaused(): boolean; + + /** + * See if this Tween is currently acting upon the given target. + * @param target The target to check against this Tween. + */ + hasTarget(target: object): boolean; + + /** + * Updates the value of a property of this Tween to a new value, without adjusting the + * Tween duration or current progress. + * + * You can optionally tell it to set the 'start' value to be the current value (before the change). + * @param key The property to set the new value for. + * @param value The new value of the property. + * @param startToCurrent Should this change set the start value to be the current value? Default false. + */ + updateTo(key: string, value: any, startToCurrent?: boolean): this; + + /** + * Restarts the tween from the beginning. + */ + restart(): this; + + /** + * Internal method that calculates the overall duration of the Tween. + */ + calcDuration(): void; + + /** + * Called by TweenManager.preUpdate as part of its loop to check pending and active tweens. + * Should not be called directly. + */ + init(): boolean; + + /** + * Internal method that advances to the next state of the Tween during playback. + */ + nextState(): void; + + /** + * Pauses the Tween immediately. Use `resume` to continue playback. + */ + pause(): this; + + /** + * Starts a Tween playing. + * + * You only need to call this method if you have configured the tween to be paused on creation. + * + * If the Tween is already playing, calling this method again will have no effect. If you wish to + * restart the Tween, use `Tween.restart` instead. + * + * Calling this method after the Tween has completed will start the Tween playing again from the start. + * This is the same as calling `Tween.seek(0)` and then `Tween.play()`. + * @param resetFromTimeline Is this Tween being played as part of a Timeline? Default false. + */ + play(resetFromTimeline?: boolean): this; + + /** + * Internal method that resets all of the Tween Data, including the progress and elapsed values. + * @param resetFromLoop Has this method been called as part of a loop? + */ + resetTweenData(resetFromLoop: boolean): void; + + /** + * Resumes the playback of a previously paused Tween. + */ + resume(): this; + + /** + * Attempts to seek to a specific position in a Tween. + * @param toPosition A value between 0 and 1 which represents the progress point to seek to. + */ + seek(toPosition: number): this; + + /** + * Sets an event based callback to be invoked during playback. + * @param type Type of the callback. + * @param callback Callback function. + * @param params An array of parameters for specified callbacks types. + * @param scope The context the callback will be invoked in. + */ + setCallback(type: string, callback: Function, params?: any[], scope?: object): this; + + /** + * Flags the Tween as being complete, whatever stage of progress it is at. + * + * If an onComplete callback has been defined it will automatically invoke it, unless a `delay` + * argument is provided, in which case the Tween will delay for that period of time before calling the callback. + * + * If you don't need a delay, or have an onComplete callback, then call `Tween.stop` instead. + * @param delay The time to wait before invoking the complete callback. If zero it will fire immediately. Default 0. + */ + complete(delay?: number): this; + + /** + * Immediately removes this Tween from the TweenManager and all of its internal arrays, + * no matter what stage it as it. Then sets the tween state to `REMOVED`. + * + * You should dispose of your reference to this tween after calling this method, to + * free it from memory. + */ + remove(): this; + + /** + * Stops the Tween immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. + * @param resetTo If you want to seek the tween, provide a value between 0 and 1. + */ + stop(resetTo?: number): this; + + /** + * Internal method that advances the Tween based on the time values. + * @param timestamp The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(timestamp: number, delta: number): boolean; + + /** + * Internal method used as part of the playback process that sets a tween to play in reverse. + * @param tween The Tween to update. + * @param tweenData The TweenData property to update. + * @param diff Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromEnd(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, diff: number): integer; + + /** + * Internal method used as part of the playback process that sets a tween to play from the start. + * @param tween The Tween to update. + * @param tweenData The TweenData property to update. + * @param diff Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromStart(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, diff: number): integer; + + /** + * Internal method that advances the TweenData based on the time value given. + * @param tween The Tween to update. + * @param tweenData The TweenData property to update. + * @param delta Either a value in ms, or 1 if Tween.useFrames is true + */ + updateTweenData(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, delta: number): boolean; + + } + + /** + * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. + * + * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, Tweens should be created using the GameObjectFactory or GameObjectCreator. + * @param target The target to tween. + * @param key The property of the target to tween. + * @param getEnd What the property will be at the END of the Tween. + * @param getStart What the property will be at the START of the Tween. + * @param ease The ease function this tween uses. + * @param delay Time in ms/frames before tween will start. + * @param duration Duration of the tween in ms/frames. + * @param yoyo Determines whether the tween should return back to its start value after hold has expired. + * @param hold Time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param repeat Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param repeatDelay Time in ms/frames before the repeat will start. + * @param flipX Should toggleFlipX be called when yoyo or repeat happens? + * @param flipY Should toggleFlipY be called when yoyo or repeat happens? + */ + function TweenData(target: object, key: string, getEnd: Function, getStart: Function, ease: Function, delay: number, duration: number, yoyo: boolean, hold: number, repeat: number, repeatDelay: number, flipX: boolean, flipY: boolean): Phaser.Types.Tweens.TweenDataConfig; + + /** + * The Tween Manager is a default Scene Plugin which controls and updates Tweens and Timelines. + */ + class TweenManager { + /** + * + * @param scene The Scene which owns this Tween Manager. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene which owns this Tween Manager. + */ + scene: Phaser.Scene; + + /** + * The Systems object of the Scene which owns this Tween Manager. + */ + systems: Phaser.Scenes.Systems; + + /** + * The time scale of the Tween Manager. + * + * This value scales the time delta between two frames, thus influencing the speed of time for all Tweens owned by this Tween Manager. + */ + timeScale: number; + + /** + * Create a Tween Timeline and return it, but do NOT add it to the active or pending Tween lists. + * @param config The configuration object for the Timeline and its Tweens. + */ + createTimeline(config: Phaser.Types.Tweens.TimelineBuilderConfig): Phaser.Tweens.Timeline; + + /** + * Create a Tween Timeline and add it to the active Tween list/ + * @param config The configuration object for the Timeline and its Tweens. + */ + timeline(config: Phaser.Types.Tweens.TimelineBuilderConfig): Phaser.Tweens.Timeline; + + /** + * Create a Tween and return it, but do NOT add it to the active or pending Tween lists. + * @param config The configuration object for the Tween. + */ + create(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; + + /** + * Create a Tween and add it to the active Tween list. + * @param config The configuration object for the Tween. + */ + add(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; + + /** + * Add an existing tween into the active Tween list. + * @param tween The Tween to add. + */ + existing(tween: Phaser.Tweens.Tween): Phaser.Tweens.TweenManager; + + /** + * Create a Number Tween and add it to the active Tween list. + * @param config The configuration object for the Number Tween. + */ + addCounter(config: Phaser.Types.Tweens.NumberTweenBuilderConfig): Phaser.Tweens.Tween; + + /** + * Updates the Tween Manager's internal lists at the start of the frame. + * + * This method will return immediately if no changes have been indicated. + */ + preUpdate(): void; + + /** + * Updates all Tweens and Timelines of the Tween Manager. + * @param timestamp The current time in milliseconds. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(timestamp: number, delta: number): void; + + /** + * Removes the given tween from the Tween Manager, regardless of its state (pending or active). + * @param tween The Tween to be removed. + */ + remove(tween: Phaser.Tweens.Tween): Phaser.Tweens.TweenManager; + + /** + * Checks if a Tween or Timeline is active and adds it to the Tween Manager at the start of the frame if it isn't. + * @param tween The Tween to check. + */ + makeActive(tween: Phaser.Tweens.Tween): Phaser.Tweens.TweenManager; + + /** + * Passes all Tweens to the given callback. + * @param callback The function to call. + * @param scope The scope (`this` object) to call the function with. + * @param args The arguments to pass into the function. Its first argument will always be the Tween currently being iterated. + */ + each(callback: Function, scope?: object, ...args: any[]): void; + + /** + * Returns an array of all active Tweens and Timelines in the Tween Manager. + */ + getAllTweens(): Phaser.Tweens.Tween[]; + + /** + * Returns the scale of the time delta for all Tweens and Timelines owned by this Tween Manager. + */ + getGlobalTimeScale(): number; + + /** + * Returns an array of all Tweens or Timelines in the Tween Manager which affect the given target or array of targets. + * @param target The target to look for. Provide an array to look for multiple targets. + */ + getTweensOf(target: object | any[]): Phaser.Tweens.Tween[]; + + /** + * Checks if the given object is being affected by a playing Tween. + * @param target target Phaser.Tweens.Tween object + */ + isTweening(target: object): boolean; + + /** + * Stops all Tweens in this Tween Manager. They will be removed at the start of the frame. + */ + killAll(): Phaser.Tweens.TweenManager; + + /** + * Stops all Tweens which affect the given target or array of targets. The Tweens will be removed from the Tween Manager at the start of the frame. + * @param target The target to look for. Provide an array to look for multiple targets. + */ + killTweensOf(target: object | any[]): Phaser.Tweens.TweenManager; + + /** + * Pauses all Tweens in this Tween Manager. + */ + pauseAll(): Phaser.Tweens.TweenManager; + + /** + * Resumes all Tweens in this Tween Manager. + */ + resumeAll(): Phaser.Tweens.TweenManager; + + /** + * Sets a new scale of the time delta for this Tween Manager. + * + * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Tween Manager and all Tweens it owns. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing all Tweens. + * @param value The new scale of the time delta, where 1 is the normal speed. + */ + setGlobalTimeScale(value: number): Phaser.Tweens.TweenManager; + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + */ + shutdown(): void; + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + */ + destroy(): void; + + } + + } + + namespace Utils { + namespace Array { + /** + * Adds the given item, or array of items, to the array. + * + * Each item must be unique within the array. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * @param array The array to be added to. + * @param item The item, or array of items, to add to the array. Each item must be unique within the array. + * @param limit Optional limit which caps the size of the array. + * @param callback A callback to be invoked for each item successfully added to the array. + * @param context The context in which the callback is invoked. + */ + function Add(array: any[], item: any | any[], limit?: integer, callback?: Function, context?: object): any[]; + + /** + * Adds the given item, or array of items, to the array starting at the index specified. + * + * Each item must be unique within the array. + * + * Existing elements in the array are shifted up. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * @param array The array to be added to. + * @param item The item, or array of items, to add to the array. + * @param index The index in the array where the item will be inserted. Default 0. + * @param limit Optional limit which caps the size of the array. + * @param callback A callback to be invoked for each item successfully added to the array. + * @param context The context in which the callback is invoked. + */ + function AddAt(array: any[], item: any | any[], index?: integer, limit?: integer, callback?: Function, context?: object): any[]; + + /** + * Moves the given element to the top of the array. + * The array is modified in-place. + * @param array The array. + * @param item The element to move. + */ + function BringToTop(array: any[], item: any): any; + + /** + * Returns the total number of elements in the array which have a property matching the given value. + * @param array The array to search. + * @param property The property to test on each array element. + * @param value The value to test the property against. Must pass a strict (`===`) comparison check. + * @param startIndex An optional start index to search from. + * @param endIndex An optional end index to search to. + */ + function CountAllMatching(array: any[], property: string, value: any, startIndex?: integer, endIndex?: integer): integer; + + /** + * Passes each element in the array to the given callback. + * @param array The array to search. + * @param callback A callback to be invoked for each item in the array. + * @param context The context in which the callback is invoked. + * @param args Additional arguments that will be passed to the callback, after the current array item. + */ + function Each(array: any[], callback: Function, context: object, ...args: any[]): any[]; + + /** + * Passes each element in the array, between the start and end indexes, to the given callback. + * @param array The array to search. + * @param callback A callback to be invoked for each item in the array. + * @param context The context in which the callback is invoked. + * @param startIndex The start index to search from. + * @param endIndex The end index to search to. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + function EachInRange(array: any[], callback: Function, context: object, startIndex: integer, endIndex: integer, ...args: any[]): any[]; + + /** + * Searches a pre-sorted array for the closet value to the given number. + * + * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, + * and will check for the closest value of those to the given number. + * @param value The value to search for in the array. + * @param array The array to search, which must be sorted. + * @param key An optional property key. If specified the array elements property will be checked against value. + */ + function FindClosestInSorted(value: number, array: any[], key?: string): number | any; + + /** + * Returns all elements in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return only elements that have their visible property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 elements. + * @param array The array to search. + * @param property The property to test on each array element. + * @param value The value to test the property against. Must pass a strict (`===`) comparison check. + * @param startIndex An optional start index to search from. + * @param endIndex An optional end index to search to. + */ + function GetAll(array: any[], property?: string, value?: any, startIndex?: integer, endIndex?: integer): any[]; + + /** + * Returns the first element in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return the first element that had its `visible` property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. + * @param array The array to search. + * @param property The property to test on each array element. + * @param value The value to test the property against. Must pass a strict (`===`) comparison check. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default array.length. + */ + function GetFirst(array: any[], property?: string, value?: any, startIndex?: integer, endIndex?: integer): object; + + /** + * Returns a Random element from the array. + * @param array The array to select the random entry from. + * @param startIndex An optional start index. Default 0. + * @param length An optional length, the total number of elements (from the startIndex) to choose from. Default array.length. + */ + function GetRandom(array: any[], startIndex?: integer, length?: integer): any; + + namespace Matrix { + /** + * Checks if an array can be used as a matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array to check. + */ + function CheckMatrix(matrix?: T[][]): boolean; + + /** + * Generates a string (which you can pass to console.log) from the given Array Matrix. + * @param matrix A 2-dimensional array. + */ + function MatrixToString(matrix?: T[][]): string; + + /** + * Reverses the columns in the given Array Matrix. + * @param matrix The array matrix to reverse the columns for. + */ + function ReverseColumns(matrix?: T[][]): T[][]; + + /** + * Reverses the rows in the given Array Matrix. + * @param matrix The array matrix to reverse the rows for. + */ + function ReverseRows(matrix?: T[][]): T[][]; + + /** + * Rotates the array matrix 180 degrees. + * @param matrix The array to rotate. + */ + function Rotate180(matrix?: T[][]): T[][]; + + /** + * Rotates the array matrix to the left (or 90 degrees) + * @param matrix The array to rotate. + */ + function RotateLeft(matrix?: T[][]): T[][]; + + /** + * Rotates the array matrix based on the given rotation value. + * + * The value can be given in degrees: 90, -90, 270, -270 or 180, + * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. + * + * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. + * @param matrix The array to rotate. + * @param direction The amount to rotate the matrix by. Default 90. + */ + function RotateMatrix(matrix?: T[][], direction?: number | string): T[][]; + + /** + * Rotates the array matrix to the left (or -90 degrees) + * @param matrix The array to rotate. + */ + function RotateRight(matrix?: T[][]): T[][]; + + /** + * Transposes the elements of the given matrix (array of arrays). + * + * The transpose of a matrix is a new matrix whose rows are the columns of the original. + * @param array The array matrix to transpose. + */ + function TransposeMatrix(array?: T[][]): T[][]; + + } + + /** + * Moves the given array element down one place in the array. + * The array is modified in-place. + * @param array The input array. + * @param item The element to move down the array. + */ + function MoveDown(array: any[], item: any): any[]; + + /** + * Moves an element in an array to a new position within the same array. + * The array is modified in-place. + * @param array The array. + * @param item The element to move. + * @param index The new index that the element will be moved to. + */ + function MoveTo(array: any[], item: any, index: integer): any; + + /** + * Moves the given array element up one place in the array. + * The array is modified in-place. + * @param array The input array. + * @param item The element to move up the array. + */ + function MoveUp(array: any[], item: any): any[]; + + /** + * Create an array representing the range of numbers (usually integers), between, and inclusive of, + * the given `start` and `end` arguments. For example: + * + * `var array = numberArray(2, 4); // array = [2, 3, 4]` + * `var array = numberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * + * This is equivalent to `numberArrayStep(start, end, 1)`. + * + * You can optionally provide a prefix and / or suffix string. If given the array will contain + * strings, not integers. For example: + * + * `var array = numberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` + * `var array = numberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` + * @param start The minimum value the array starts with. + * @param end The maximum value the array contains. + * @param prefix Optional prefix to place before the number. If provided the array will contain strings, not integers. + * @param suffix Optional suffix to place after the number. If provided the array will contain strings, not integers. + */ + function NumberArray(start: number, end: number, prefix?: string, suffix?: string): number[] | string[]; + + /** + * Create an array of numbers (positive and/or negative) progressing from `start` + * up to but not including `end` by advancing by `step`. + * + * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified. + * + * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; + * for forward compatibility make sure to pass in actual numbers. + * @param start The start of the range. Default 0. + * @param end The end of the range. Default null. + * @param step The value to increment or decrement by. Default 1. + */ + function NumberArrayStep(start?: number, end?: number, step?: number): number[]; + + /** + * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. + * + * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; + * The k-th element will have the (k - left + 1)th smallest value in [left, right]. + * + * The array is modified in-place. + * + * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) + * @param arr The array to sort. + * @param k The k-th element index. + * @param left The index of the left part of the range. Default 0. + * @param right The index of the right part of the range. + * @param compare An optional comparison function. Is passed two elements and should return 0, 1 or -1. + */ + function QuickSelect(arr: any[], k: integer, left?: integer, right?: integer, compare?: Function): void; + + /** + * Creates an array populated with a range of values, based on the given arguments and configuration object. + * + * Range ([a,b,c], [1,2,3]) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2,3], qty = 3) = + * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 + * + * Range ([a,b,c], [1,2,3], repeat x1) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = + * Maybe if max is set then repeat goes to -1 automatically? + * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) + * + * Range ([a], [1,2,3,4,5], random = true) = + * a4, a1, a5, a2, a3 + * + * Range ([a, b], [1,2,3], random = true) = + * b3, a2, a1, b1, a3, b2 + * + * Range ([a, b, c], [1,2,3], randomB = true) = + * a3, a1, a2, b2, b3, b1, c1, c3, c2 + * + * Range ([a], [1,2,3,4,5], yoyo = true) = + * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 + * + * Range ([a, b], [1,2,3], yoyo = true) = + * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 + * @param a The first array of range elements. + * @param b The second array of range elements. + * @param options A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty. + */ + function Range(a: any[], b: any[], options?: object): any[]; + + /** + * Removes the given item, or array of items, from the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for each item successfully removed from the array. + * @param array The array to be modified. + * @param item The item, or array of items, to be removed from the array. + * @param callback A callback to be invoked for each item successfully removed from the array. + * @param context The context in which the callback is invoked. + */ + function Remove(array: any[], item: any | any[], callback?: Function, context?: object): any | any[]; + + /** + * Removes the item from the given position in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. + * @param array The array to be modified. + * @param index The array index to remove the item from. The index must be in bounds or it will throw an error. + * @param callback A callback to be invoked for the item removed from the array. + * @param context The context in which the callback is invoked. + */ + function RemoveAt(array: any[], index: integer, callback?: Function, context?: object): any; + + /** + * Removes the item within the given range in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. + * @param array The array to be modified. + * @param startIndex The start index to remove from. + * @param endIndex The end index to remove to. + * @param callback A callback to be invoked for the item removed from the array. + * @param context The context in which the callback is invoked. + */ + function RemoveBetween(array: any[], startIndex: integer, endIndex: integer, callback?: Function, context?: object): any[]; + + /** + * Removes a random object from the given array and returns it. + * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index. + * @param array The array to removed a random element from. + * @param start The array index to start the search from. Default 0. + * @param length Optional restriction on the number of elements to randomly select from. Default array.length. + */ + function RemoveRandomElement(array: any[], start?: integer, length?: integer): object; + + /** + * Replaces an element of the array with the new element. + * The new element cannot already be a member of the array. + * The array is modified in-place. + * @param oldChild The element in the array that will be replaced. + * @param newChild The element to be inserted into the array at the position of `oldChild`. + */ + function Replace(oldChild: any, newChild: any): boolean; + + /** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * @param array The array to shift to the left. This array is modified in place. + * @param total The number of times to shift the array. Default 1. + */ + function RotateLeft(array: any[], total?: integer): any; + + /** + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. + * @param array The array to shift to the right. This array is modified in place. + * @param total The number of times to shift the array. Default 1. + */ + function RotateRight(array: any[], total?: integer): any; + + /** + * Tests if the start and end indexes are a safe range for the given array. + * @param array The array to check. + * @param startIndex The start index. + * @param endIndex The end index. + * @param throwError Throw an error if the range is out of bounds. Default true. + */ + function SafeRange(array: any[], startIndex: integer, endIndex: integer, throwError?: boolean): boolean; + + /** + * Moves the given element to the bottom of the array. + * The array is modified in-place. + * @param array The array. + * @param item The element to move. + */ + function SendToBack(array: any[], item: any): any; + + /** + * Scans the array for elements with the given property. If found, the property is set to the `value`. + * + * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements. + * @param array The array to search. + * @param property The property to test for on each array element. + * @param value The value to set the property to. + * @param startIndex An optional start index to search from. + * @param endIndex An optional end index to search to. + */ + function SetAll(array: any[], property: string, value: any, startIndex?: integer, endIndex?: integer): any[]; + + /** + * Shuffles the contents of the given array using the Fisher-Yates implementation. + * + * The original array is modified directly and returned. + * @param array The array to shuffle. This array is modified in place. + */ + function Shuffle(array: any[]): any[]; + + /** + * Removes a single item from an array and returns it without creating gc, like the native splice does. + * Based on code by Mike Reinstein. + * @param array The array to splice from. + * @param index The index of the item which should be spliced. + */ + function SpliceOne(array: any[], index: integer): any; + + namespace StableSortFunctions { + /** + * Sort the input array and simply copy it back if the result isn't in the original array, which happens on an odd number of passes. + * @param arr The input array. + * @param comp The comparison handler. + */ + function inplace(arr: any[], comp: Function): any[]; + + } + + /** + * A stable array sort, because `Array#sort()` is not guaranteed stable. + * This is an implementation of merge sort, without recursion. + * @param arr The input array to be sorted. + * @param comp The comparison handler. + */ + function StableSort(arr: any[], comp: Function): any[]; + + /** + * Swaps the position of two elements in the given array. + * The elements must exist in the same array. + * The array is modified in-place. + * @param array The input array. + * @param item1 The first element to swap. + * @param item2 The second element to swap. + */ + function Swap(array: any[], item1: any, item2: any): any[]; + + } + + namespace Base64 { + /** + * Converts an ArrayBuffer into a base64 string. + * + * The resulting string can optionally be a data uri if the `mediaType` argument is provided. + * + * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs for more details. + * @param arrayBuffer The Array Buffer to encode. + * @param mediaType An optional media type, i.e. `audio/ogg` or `image/jpeg`. If included the resulting string will be a data URI. + */ + function ArrayBufferToBase64(arrayBuffer: ArrayBuffer, mediaType?: string): string; + + /** + * Converts a base64 string, either with or without a data uri, into an Array Buffer. + * @param base64 The base64 string to be decoded. Can optionally contain a data URI header, which will be stripped out prior to decoding. + */ + function Base64ToArrayBuffer(base64: string): ArrayBuffer; + + } + + /** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + */ + function NOOP(): void; + + namespace Objects { + /** + * Shallow Object Clone. Will not clone nested objects. + * @param obj the object from which to clone + */ + function Clone(obj: object): object; + + /** + * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ + */ + function Extend(): object; + + /** + * Retrieves a value from an object. Allows for more advanced selection options, including: + * + * Allowed types: + * + * Implicit + * { + * x: 4 + * } + * + * From function + * { + * x: function () + * } + * + * Randomly pick one element from the array + * { + * x: [a, b, c, d, e, f] + * } + * + * Random integer between min and max: + * { + * x: { randInt: [min, max] } + * } + * + * Random float between min and max: + * { + * x: { randFloat: [min, max] } + * } + * @param source The object to retrieve the value from. + * @param key The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param defaultValue The value to return if the `key` isn't found in the `source` object. + */ + function GetAdvancedValue(source: object, key: string, defaultValue: any): any; + + /** + * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} + * @param source The object to search + * @param key The key for the property on source. Must exist at the top level of the source object (no periods) + * @param defaultValue The default value to use if the key does not exist. + */ + function GetFastValue(source: object, key: string, defaultValue?: any): any; + + /** + * Retrieves and clamps a numerical value from an object. + * @param source The object to retrieve the value from. + * @param key The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`). + * @param min The minimum value which can be returned. + * @param max The maximum value which can be returned. + * @param defaultValue The value to return if the property doesn't exist. It's also constrained to the given bounds. + */ + function GetMinMaxValue(source: object, key: string, min: number, max: number, defaultValue: number): number; + + /** + * Retrieves a value from an object. + * @param source The object to retrieve the value from. + * @param key The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param defaultValue The value to return if the `key` isn't found in the `source` object. + */ + function GetValue(source: object, key: string, defaultValue: any): any; + + /** + * Verifies that an object contains all requested keys + * @param source an object on which to check for key existence + * @param keys an array of keys to ensure the source object contains + */ + function HasAll(source: object, keys: string[]): boolean; + + /** + * Verifies that an object contains at least one of the requested keys + * @param source an object on which to check for key existence + * @param keys an array of keys to search the object for + */ + function HasAny(source: object, keys: string[]): boolean; + + /** + * Determine whether the source object has a property with the specified key. + * @param source The source object to be checked. + * @param key The property to check for within the object + */ + function HasValue(source: object, key: string): boolean; + + /** + * This is a slightly modified version of jQuery.isPlainObject. + * A plain object is an object whose internal class property is [object Object]. + * @param obj The object to inspect. + */ + function IsPlainObject(obj: object): boolean; + + /** + * Creates a new Object using all values from obj1 and obj2. + * If a value exists in both obj1 and obj2, the value in obj1 is used. + * @param obj1 The first object. + * @param obj2 The second object. + */ + function Merge(obj1: object, obj2: object): object; + + /** + * Creates a new Object using all values from obj1. + * + * Then scans obj2. If a property is found in obj2 that *also* exists in obj1, the value from obj2 is used, otherwise the property is skipped. + * @param obj1 The first object to merge. + * @param obj2 The second object to merge. Keys from this object which also exist in `obj1` will be copied to `obj1`. + */ + function MergeRight(obj1: object, obj2: object): object; + + /** + * Returns a new object that only contains the `keys` that were found on the object provided. + * If no `keys` are found, an empty object is returned. + * @param object The object to pick the provided keys from. + * @param keys An array of properties to retrieve from the provided object. + */ + function Pick(object: object, keys: any[]): object; + + /** + * Sets a value in an object, allowing for dot notation to control the depth of the property. + * + * For example: + * + * ```javascript + * var data = { + * world: { + * position: { + * x: 200, + * y: 100 + * } + * } + * }; + * + * SetValue(data, 'world.position.y', 300); + * + * console.log(data.world.position.y); // 300 + * ``` + * @param source The object to set the value in. + * @param key The name of the property in the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) + * @param value The value to set into the property, if found in the source object. + */ + function SetValue(source: object, key: string, value: any): boolean; + + } + + namespace String { + /** + * Takes a string and replaces instances of markers with values in the given array. + * The markers take the form of `%1`, `%2`, etc. I.e.: + * + * `Format("The %1 is worth %2 gold", [ 'Sword', 500 ])` + * @param string The string containing the replacement markers. + * @param values An array containing values that will replace the markers. If no value exists an empty string is inserted instead. + */ + function Format(string: string, values: any[]): string; + + /** + * Takes the given string and pads it out, to the length required, using the character + * specified. For example if you need a string to be 6 characters long, you can call: + * + * `pad('bob', 6, '-', 2)` + * + * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. + * + * You can also use it to pad numbers (they are always returned as strings): + * + * `pad(512, 6, '0', 1)` + * + * Would return: `000512` with the string padded to the left. + * + * If you don't specify a direction it'll pad to both sides: + * + * `pad('c64', 7, '*')` + * + * Would return: `**c64**` + * @param str The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. + * @param len The number of characters to be added. Default 0. + * @param pad The string to pad it out with (defaults to a space). Default " ". + * @param dir The direction dir = 1 (left), 2 (right), 3 (both). Default 3. + */ + function Pad(str: string, len?: integer, pad?: string, dir?: integer): string; + + /** + * Takes the given string and reverses it, returning the reversed string. + * For example if given the string `Atari 520ST` it would return `TS025 iratA`. + * @param string The string to be reversed. + */ + function Reverse(string: string): string; + + /** + * Capitalizes the first letter of a string if there is one. + * @param str The string to capitalize. + */ + function UppercaseFirst(str: string): string; + + /** + * Creates and returns an RFC4122 version 4 compliant UUID. + * + * The string is in the form: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` where each `x` is replaced with a random + * hexadecimal digit from 0 to f, and `y` is replaced with a random hexadecimal digit from 8 to b. + */ + function UUID(): string; + + } + + } + + /** + * The Facebook Instant Games Plugin for Phaser 3 provides a seamless bridge between Phaser + * and the Facebook Instant Games API version 6.2. + * + * You can access this plugin via the `facebook` property in a Scene, i.e: + * + * ```javascript + * this.facebook.getPlatform(); + * ``` + * + * If this is unavailable please check to make sure you're using a build of Phaser that has + * this plugin within it. You can quickly check this by looking at the dev tools console + * header - the Phaser version number will have `-FB` after it if this plugin is loaded. + * + * If you are building your own version of Phaser then use this Webpack DefinePlugin flag: + * + * `"typeof PLUGIN_FBINSTANT": JSON.stringify(true)` + * + * You will find that every Instant Games API method has a mapping in this plugin. + * For a full list please consult either the plugin documentation, or the 6.2 SDK documentation + * at https://developers.facebook.com/docs/games/instant-games/sdk/fbinstant6.2 + * + * Internally this plugin uses its own Data Manager to handle seamless user data updates and provides + * handy functions for advertisement displaying, opening share dialogs, logging, leaderboards, purchase API requests, + * loader integration and more. + * + * To get started with Facebook Instant Games you will need to register on Facebook and create a new Instant + * Game app that has its own unique app ID. Facebook have also provided a dashboard interface for setting up + * various features for your game, including leaderboards, ad requests and the payments API. There are lots + * of guides on the Facebook Developers portal to assist with setting these + * various systems up: https://developers.facebook.com/docs/games/instant-games/guides + * + * For more details follow the Quick Start guide here: https://developers.facebook.com/docs/games/instant-games + */ + class FacebookInstantGamesPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param game A reference to the Phaser.Game instance. + */ + constructor(game: Phaser.Game); + + /** + * A reference to the Phaser.Game instance. + */ + readonly game: Phaser.Game; + + /** + * A Data Manager instance. + * It allows you to store, query and retrieve any key/value data you may need to store. + * It's also used internally by the plugin to store FBIG API data. + */ + data: Phaser.Data.DataManager; + + /** + * Has the Facebook Instant Games API loaded yet? + * This is set automatically during the boot process. + */ + hasLoaded: boolean; + + /** + * Is the Data Manager currently locked? + */ + dataLocked: boolean; + + /** + * A list of the Facebook Instant Games APIs that are available, + * based on the given platform, context and user privacy settings. + * This value is populated automatically during boot. + */ + supportedAPIs: string[]; + + /** + * Holds the entry point that the game was launched from. + * This value is populated automatically during boot. + */ + entryPoint: string; + + /** + * An object that contains any data associated with the entry point that the game was launched from. + * The contents of the object are developer-defined, and can occur from entry points on different platforms. + * This will return null for older mobile clients, as well as when there is no data associated with the particular entry point. + * This value is populated automatically during boot. + */ + entryPointData: any; + + /** + * A unique identifier for the current game context. This represents a specific context + * that the game is being played in (for example, a particular messenger conversation or facebook post). + * The identifier will be null if game is being played in a solo context. + * This value is populated automatically during boot. + */ + contextID: string; + + /** + * The current context in which your game is running. This can be either `null` or + * one of: + * + * `POST` - The game is running inside of a Facebook post. + * `THREAD` - The game is running inside a Facebook Messenger thread. + * `GROUP` - The game is running inside a Facebook Group. + * `SOLO` - This is the default context, the player is the only participant. + * + * This value is populated automatically during boot. + */ + contextType: string; + + /** + * The current locale. + * See https://origincache.facebook.com/developers/resources/?id=FacebookLocales.xml for a complete list of supported locale values. + * Use this to determine what languages the current game should be localized with. + * This value is populated automatically during boot. + */ + locale: string; + + /** + * The platform on which the game is currently running, i.e. `IOS`. + * This value is populated automatically during boot. + */ + platform: string; + + /** + * The string representation of the Facebook Instant Games SDK version being used. + * This value is populated automatically during boot. + */ + version: string; + + /** + * Holds the id of the player. This is a string based ID, the same as `FBInstant.player.getID()`. + * This value is populated automatically during boot if the API is supported. + */ + playerID: string; + + /** + * The player's localized display name. + * This value is populated automatically during boot if the API is supported. + */ + playerName: string; + + /** + * A url to the player's public profile photo. The photo will always be a square, and with dimensions + * of at least 200x200. When rendering it in the game, the exact dimensions should never be assumed to be constant. + * It's recommended to always scale the image to a desired size before rendering. + * This value is populated automatically during boot if the API is supported. + */ + playerPhotoURL: string; + + /** + * Whether a player can subscribe to the game bot or not. + */ + playerCanSubscribeBot: boolean; + + /** + * Does the current platform and context allow for use of the payments API? + * Currently this is only available on Facebook.com and Android 6+. + */ + paymentsReady: boolean; + + /** + * The set of products that are registered to the game. + */ + catalog: Product[]; + + /** + * Contains all of the player's unconsumed purchases. + * The game must fetch the current player's purchases as soon as the client indicates that it is ready to perform payments-related operations, + * i.e. at game start. The game can then process and consume any purchases that are waiting to be consumed. + */ + purchases: Purchase[]; + + /** + * Contains all of the leaderboard data, as populated by the `getLeaderboard()` method. + */ + leaderboards: Phaser.FacebookInstantGamesLeaderboard[]; + + /** + * Contains AdInstance objects, as created by the `preloadAds()` method. + */ + ads: AdInstance[]; + + /** + * Call this method from your `Scene.preload` in order to sync the load progress + * of the Phaser Loader with the Facebook Instant Games loader display, i.e.: + * + * ```javascript + * this.facebook.showLoadProgress(this); + * this.facebook.once('startgame', this.startGame, this); + * ``` + * @param scene The Scene for which you want to show loader progress for. + */ + showLoadProgress(scene: Phaser.Scene): this; + + /** + * This method is called automatically when the game has finished loading, + * if you used the `showLoadProgress` method. If your game doesn't need to + * load any assets, or you're managing the load yourself, then call this + * method directly to start the API running. + * + * When the API has finished starting this plugin will emit a `startgame` event + * which you should listen for. + */ + gameStarted(): void; + + /** + * Checks to see if a given Facebook Instant Games API is available or not. + * @param api The API to check for, i.e. `player.getID`. + */ + checkAPI(api: string): boolean; + + /** + * Returns the unique identifier for the current game context. This represents a specific context + * that the game is being played in (for example, a particular messenger conversation or facebook post). + * The identifier will be null if game is being played in a solo context. + * + * It is only populated if `contextGetID` is in the list of supported APIs. + */ + getID(): string; + + /** + * Returns the current context in which your game is running. This can be either `null` or one of: + * + * `POST` - The game is running inside of a Facebook post. + * `THREAD` - The game is running inside a Facebook Messenger thread. + * `GROUP` - The game is running inside a Facebook Group. + * `SOLO` - This is the default context, the player is the only participant. + * + * It is only populated if `contextGetType` is in the list of supported APIs. + */ + getType(): string; + + /** + * Returns the current locale. + * See https://origincache.facebook.com/developers/resources/?id=FacebookLocales.xml for a complete list of supported locale values. + * Use this to determine what languages the current game should be localized with. + * It is only populated if `getLocale` is in the list of supported APIs. + */ + getLocale(): string; + + /** + * Returns the platform on which the game is currently running, i.e. `IOS`. + * It is only populated if `getPlatform` is in the list of supported APIs. + */ + getPlatform(): string; + + /** + * Returns the string representation of the Facebook Instant Games SDK version being used. + * It is only populated if `getSDKVersion` is in the list of supported APIs. + */ + getSDKVersion(): string; + + /** + * Returns the id of the player. This is a string based ID, the same as `FBInstant.player.getID()`. + * It is only populated if `playerGetID` is in the list of supported APIs. + */ + getPlayerID(): string; + + /** + * Returns the player's localized display name. + * It is only populated if `playerGetName` is in the list of supported APIs. + */ + getPlayerName(): string; + + /** + * Returns the url to the player's public profile photo. The photo will always be a square, and with dimensions + * of at least 200x200. When rendering it in the game, the exact dimensions should never be assumed to be constant. + * It's recommended to always scale the image to a desired size before rendering. + * It is only populated if `playerGetPhoto` is in the list of supported APIs. + */ + getPlayerPhotoURL(): string; + + /** + * Load the player's photo and store it in the Texture Manager, ready for use in-game. + * + * This method works by using a Scene Loader instance and then asking the Loader to + * retrieve the image. + * + * When complete the plugin will emit a `photocomplete` event, along with the key of the photo. + * + * ```javascript + * this.facebook.loadPlayerPhoto(this, 'player').once('photocomplete', function (key) { + * this.add.image(x, y, 'player'); + * }, this); + * ``` + * @param scene The Scene that will be responsible for loading this photo. + * @param key The key to use when storing the photo in the Texture Manager. + */ + loadPlayerPhoto(scene: Phaser.Scene, key: string): this; + + /** + * Checks if the current player can subscribe to the game bot. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they can subscribe, the `playerCanSubscribeBot` property is set to `true` + * and this plugin will emit the `cansubscribebot` event. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `cansubscribebotfail` event instead. + */ + canSubscribeBot(): this; + + /** + * Subscribes the current player to the game bot. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `subscribebot` event. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `subscribebotfail` event instead. + */ + subscribeBot(): this; + + /** + * Gets the associated data from the player based on the given key, or array of keys. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes the data is set into this plugins Data Manager and the + * `getdata` event will be emitted. + * @param keys The key/s of the data to retrieve. + */ + getData(keys: string | string[]): this; + + /** + * Set data to be saved to the designated cloud storage of the current player. The game can store up to 1MB of data for each unique player. + * + * The data save is requested in an async call, so the result isn't available immediately. + * + * Data managed via this plugins Data Manager instance is automatically synced with Facebook. However, you can call this + * method directly if you need to replace the data object directly. + * + * When the APIs `setDataAsync` call resolves it will emit the `savedata` event from this plugin. If the call fails for some + * reason it will emit `savedatafail` instead. + * + * The call resolving does not necessarily mean that the input has already been persisted. Rather, it means that the data was valid and + * has been scheduled to be saved. It also guarantees that all values that were set are now available in `getData`. + * @param data An object containing a set of key-value pairs that should be persisted to cloud storage. + * The object must contain only serializable values - any non-serializable values will cause the entire modification to be rejected. + */ + saveData(data: object): this; + + /** + * Immediately flushes any changes to the player data to the designated cloud storage. + * This function is expensive, and should primarily be used for critical changes where persistence needs to be immediate + * and known by the game. Non-critical changes should rely on the platform to persist them in the background. + * NOTE: Calls to player.setDataAsync will be rejected while this function's result is pending. + * + * Data managed via this plugins Data Manager instance is automatically synced with Facebook. However, you can call this + * method directly if you need to flush the data directly. + * + * When the APIs `flushDataAsync` call resolves it will emit the `flushdata` event from this plugin. If the call fails for some + * reason it will emit `flushdatafail` instead. + */ + flushData(): this; + + /** + * Retrieve stats from the designated cloud storage of the current player. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes the `getstats` event will be emitted along with the data object returned. + * + * If the call fails, i.e. it's not in the list of supported APIs, or the request was rejected, + * it will emit a `getstatsfail` event instead. + * @param keys An optional array of unique keys to retrieve stats for. If the function is called without it, it will fetch all stats. + */ + getStats(keys?: string[]): this; + + /** + * Save the stats of the current player to the designated cloud storage. + * + * Stats in the Facebook Instant Games API are purely numerical values paired with a string-based key. Only numbers can be saved as stats, + * all other data types will be ignored. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes the `savestats` event will be emitted along with the data object returned. + * + * If the call fails, i.e. it's not in the list of supported APIs, or the request was rejected, + * it will emit a `savestatsfail` event instead. + * @param data An object containing a set of key-value pairs that should be persisted to cloud storage as stats. Note that only numerical values are stored. + */ + saveStats(data: object): this; + + /** + * Increment the stats of the current player and save them to the designated cloud storage. + * + * Stats in the Facebook Instant Games API are purely numerical values paired with a string-based key. Only numbers can be saved as stats, + * all other data types will be ignored. + * + * The data object provided for this call should contain offsets for how much to modify the stats by: + * + * ```javascript + * this.facebook.incStats({ + * level: 1, + * zombiesSlain: 17, + * rank: -1 + * }); + * ``` + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes the `incstats` event will be emitted along with the data object returned. + * + * If the call fails, i.e. it's not in the list of supported APIs, or the request was rejected, + * it will emit a `incstatsfail` event instead. + * @param data An object containing a set of key-value pairs indicating how much to increment each stat in cloud storage. Note that only numerical values are processed. + */ + incStats(data: object): this; + + /** + * Sets the data associated with the individual gameplay session for the current context. + * + * This function should be called whenever the game would like to update the current session data. + * + * This session data may be used to populate a variety of payloads, such as game play webhooks. + * @param data An arbitrary data object, which must be less than or equal to 1000 characters when stringified. + */ + saveSession(data: object): this; + + /** + * This invokes a dialog to let the user share specified content, either as a message in Messenger or as a post on the user's timeline. + * + * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property. + * + * This data must be less than or equal to 1000 characters when stringified. + * + * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed. + * + * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not. + * @param text A text message to be shared. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param sessionData A blob of data to attach to the share. + */ + openShare(text: string, key: string, frame?: string, sessionData?: object): this; + + /** + * This invokes a dialog to let the user invite a friend to play this game, either as a message in Messenger or as a post on the user's timeline. + * + * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property. + * + * This data must be less than or equal to 1000 characters when stringified. + * + * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed. + * + * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not. + * @param text A text message to be shared. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param sessionData A blob of data to attach to the share. + */ + openInvite(text: string, key: string, frame?: string, sessionData?: object): this; + + /** + * This invokes a dialog to let the user share specified content, either as a message in Messenger or as a post on the user's timeline. + * + * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property. + * + * This data must be less than or equal to 1000 characters when stringified. + * + * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed. + * + * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not. + * @param text A text message to be shared. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param sessionData A blob of data to attach to the share. + */ + openRequest(text: string, key: string, frame?: string, sessionData?: object): this; + + /** + * This invokes a dialog to let the user share specified content, either as a message in Messenger or as a post on the user's timeline. + * + * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property. + * + * This data must be less than or equal to 1000 characters when stringified. + * + * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed. + * + * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not. + * @param text A text message to be shared. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param sessionData A blob of data to attach to the share. + */ + openChallenge(text: string, key: string, frame?: string, sessionData?: object): this; + + /** + * This function determines whether the number of participants in the current game context is between a given minimum and maximum, inclusive. + * If one of the bounds is null only the other bound will be checked against. + * It will always return the original result for the first call made in a context in a given game play session. + * Subsequent calls, regardless of arguments, will return the answer to the original query until a context change occurs and the query result is reset. + * @param min The minimum bound of the context size query. + * @param max The maximum bound of the context size query. + */ + isSizeBetween(min?: integer, max?: integer): object; + + /** + * Request a switch into a specific context. If the player does not have permission to enter that context, + * or if the player does not provide permission for the game to enter that context, this will emit a `switchfail` event. + * + * Otherwise, the plugin will emit the `switch` event when the game has switched into the specified context. + * @param contextID The ID of the desired context. + */ + switchContext(contextID: string): this; + + /** + * Opens a context selection dialog for the player. If the player selects an available context, + * the client will attempt to switch into that context, and emit the `choose` event if successful. + * Otherwise, if the player exits the menu or the client fails to switch into the new context, the `choosefail` event will be emitted. + * @param contextID The ID of the desired context. + */ + chooseContext(contextID: string): this; + + /** + * Attempts to create or switch into a context between a specified player and the current player. + * This plugin will emit the `create` event once the context switch is completed. + * If the API call fails, such as if the player listed is not a Connected Player of the current player or if the + * player does not provide permission to enter the new context, then the plugin will emit a 'createfail' event. + * @param playerID ID of the player. + */ + createContext(playerID: string): this; + + /** + * Fetches an array of ConnectedPlayer objects containing information about active players + * (people who played the game in the last 90 days) that are connected to the current player. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `players` event along + * with the player data. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `playersfail` event instead. + */ + getPlayers(): this; + + /** + * Fetches the game's product catalog. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `getcatalog` event along + * with the catalog data. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `getcatalogfail` event instead. + */ + getCatalog(): this; + + /** + * Fetches a single Product from the game's product catalog. + * + * The product catalog must have been populated using `getCatalog` prior to calling this method. + * + * Use this to look-up product details based on a purchase list. + * @param productID The Product ID of the item to get from the catalog. + */ + getProduct(productID: string): Product; + + /** + * Begins the purchase flow for a specific product. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `purchase` event along + * with the purchase data. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `purchasefail` event instead. + * @param productID The identifier of the product to purchase. + * @param developerPayload An optional developer-specified payload, to be included in the returned purchase's signed request. + */ + purchase(productID: string, developerPayload?: string): this; + + /** + * Fetches all of the player's unconsumed purchases. The game must fetch the current player's purchases + * as soon as the client indicates that it is ready to perform payments-related operations, + * i.e. at game start. The game can then process and consume any purchases that are waiting to be consumed. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `getpurchases` event along + * with the purchase data. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `getpurchasesfail` event instead. + */ + getPurchases(): this; + + /** + * Consumes a specific purchase belonging to the current player. Before provisioning a product's effects to the player, + * the game should request the consumption of the purchased product. Once the purchase is successfully consumed, + * the game should immediately provide the player with the effects of their purchase. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `consumepurchase` event along + * with the purchase data. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `consumepurchasefail` event instead. + * @param purchaseToken The purchase token of the purchase that should be consumed. + */ + consumePurchase(purchaseToken: string): this; + + /** + * Informs Facebook of a custom update that occurred in the game. + * This will temporarily yield control to Facebook and Facebook will decide what to do based on what the update is. + * Once Facebook returns control to the game the plugin will emit an `update` or `upatefail` event. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * The `text` parameter is an update payload with the following structure: + * + * ``` + * text: { + * default: 'X just invaded Y\'s village!', + * localizations: { + * ar_AR: 'X \u0641\u0642\u0637 \u063A\u0632\u062A ' + + * '\u0642\u0631\u064A\u0629 Y!', + * en_US: 'X just invaded Y\'s village!', + * es_LA: '\u00A1X acaba de invadir el pueblo de Y!', + * } + * } + * ``` + * @param cta The call to action text. + * @param text The text object. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param template The update template key. + * @param updateData The update data object payload. + */ + update(cta: string, text: object, key: string, frame: string | integer, template: string, updateData: object): this; + + /** + * Informs Facebook of a leaderboard update that occurred in the game. + * This will temporarily yield control to Facebook and Facebook will decide what to do based on what the update is. + * Once Facebook returns control to the game the plugin will emit an `update` or `upatefail` event. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * The `text` parameter is an update payload with the following structure: + * + * ``` + * text: { + * default: 'X just invaded Y\'s village!', + * localizations: { + * ar_AR: 'X \u0641\u0642\u0637 \u063A\u0632\u062A ' + + * '\u0642\u0631\u064A\u0629 Y!', + * en_US: 'X just invaded Y\'s village!', + * es_LA: '\u00A1X acaba de invadir el pueblo de Y!', + * } + * } + * ``` + * @param cta The call to action text. + * @param text The text object. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param template The update template key. + * @param updateData The update data object payload. + */ + updateLeaderboard(cta: string, text: object, key: string, frame: string | integer, template: string, updateData: object): this; + + /** + * Request that the client switch to a different Instant Game. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If the game switches successfully this plugin will emit the `switchgame` event and the client will load the new game. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `switchgamefail` event instead. + * @param appID The Application ID of the Instant Game to switch to. The application must be an Instant Game, and must belong to the same business as the current game. + * @param data An optional data payload. This will be set as the entrypoint data for the game being switched to. Must be less than or equal to 1000 characters when stringified. + */ + switchGame(appID: string, data?: object): this; + + /** + * Prompts the user to create a shortcut to the game if they are eligible to. + * Can only be called once per session. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If the user choose to create a shortcut this plugin will emit the `shortcutcreated` event. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `shortcutcreatedfail` event instead. + */ + createShortcut(): this; + + /** + * Quits the game. + */ + quit(): void; + + /** + * Log an app event with FB Analytics. + * + * See https://developers.facebook.com/docs/javascript/reference/v2.8#app_events for more details about FB Analytics. + * @param name Name of the event. Must be 2 to 40 characters, and can only contain '_', '-', ' ', and alphanumeric characters. + * @param value An optional numeric value that FB Analytics can calculate a sum with. + * @param params An optional object that can contain up to 25 key-value pairs to be logged with the event. Keys must be 2 to 40 characters, and can only contain '_', '-', ' ', and alphanumeric characters. Values must be less than 100 characters in length. + */ + log(name: string, value?: number, params?: object): this; + + /** + * Attempt to create an instance of an interstitial ad. + * + * If the instance is created successfully then the ad is preloaded ready for display in-game via the method `showAd()`. + * + * If the ad loads it will emit the `adloaded` event, passing the AdInstance as the only parameter. + * + * If the ad cannot be displayed because there was no inventory to fill it, it will emit the `adsnofill` event. + * @param placementID The ad placement ID, or an array of IDs, as created in your Audience Network settings within Facebook. + */ + preloadAds(placementID: string | string[]): this; + + /** + * Attempt to create an instance of an rewarded video ad. + * + * If the instance is created successfully then the ad is preloaded ready for display in-game via the method `showVideo()`. + * + * If the ad loads it will emit the `adloaded` event, passing the AdInstance as the only parameter. + * + * If the ad cannot be displayed because there was no inventory to fill it, it will emit the `adsnofill` event. + * @param placementID The ad placement ID, or an array of IDs, as created in your Audience Network settings within Facebook. + */ + preloadVideoAds(placementID: string | string[]): this; + + /** + * Displays a previously loaded interstitial ad. + * + * If the ad is successfully displayed this plugin will emit the `adfinished` event, with the AdInstance object as its parameter. + * + * If the ad cannot be displayed, it will emit the `adsnotloaded` event. + * @param placementID The ad placement ID to display. + */ + showAd(placementID: string): this; + + /** + * Displays a previously loaded interstitial video ad. + * + * If the ad is successfully displayed this plugin will emit the `adfinished` event, with the AdInstance object as its parameter. + * + * If the ad cannot be displayed, it will emit the `adsnotloaded` event. + * @param placementID The ad placement ID to display. + */ + showVideo(placementID: string): this; + + /** + * Attempts to match the current player with other users looking for people to play with. + * If successful, a new Messenger group thread will be created containing the matched players and the player will + * be context switched to that thread. This plugin will also dispatch the `matchplayer` event, containing the new context ID and Type. + * + * The default minimum and maximum number of players in one matched thread are 2 and 20 respectively, + * depending on how many players are trying to get matched around the same time. + * + * The values can be changed in `fbapp-config.json`. See the Bundle Config documentation for documentation about `fbapp-config.json`. + * @param matchTag Optional extra information about the player used to group them with similar players. Players will only be grouped with other players with exactly the same tag. The tag must only include letters, numbers, and underscores and be 100 characters or less in length. + * @param switchImmediately Optional extra parameter that specifies whether the player should be immediately switched to the new context when a match is found. By default this will be false which will mean the player needs explicitly press play after being matched to switch to the new context. Default false. + */ + matchPlayer(matchTag?: string, switchImmediately?: boolean): this; + + /** + * Fetch a specific leaderboard belonging to this Instant Game. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes the `getleaderboard` event will be emitted along with a Leaderboard object instance. + * @param name The name of the leaderboard. Each leaderboard for an Instant Game must have its own distinct name. + */ + getLeaderboard(name: string): this; + + /** + * Quits the Facebook API and then destroys this plugin. + */ + destroy(): void; + + } + + /** + * This class represents one single Leaderboard that belongs to a Facebook Instant Game. + * + * You do not need to instantiate this class directly, it will be created when you use the + * `getLeaderboard()` method of the main plugin. + */ + class FacebookInstantGamesLeaderboard { + /** + * + * @param plugin A reference to the Facebook Instant Games Plugin. + * @param data An Instant Game leaderboard instance. + */ + constructor(plugin: Phaser.FacebookInstantGamesPlugin, data: any); + + /** + * A reference to the Facebook Instant Games Plugin. + */ + plugin: Phaser.FacebookInstantGamesPlugin; + + /** + * An Instant Game leaderboard instance. + */ + ref: any; + + /** + * The name of the leaderboard. + */ + name: string; + + /** + * The ID of the context that the leaderboard is associated with, or null if the leaderboard is not tied to a particular context. + */ + contextID: string; + + /** + * The total number of player entries in the leaderboard. + * This value defaults to zero. Populate it via the `getEntryCount()` method. + */ + entryCount: integer; + + /** + * The players score object. + * This value defaults to `null`. Populate it via the `getPlayerScore()` method. + */ + playerScore: LeaderboardScore; + + /** + * The scores in the Leaderboard from the currently requested range. + * This value defaults to an empty array. Populate it via the `getScores()` method. + * The contents of this array are reset each time `getScores()` is called. + */ + scores: LeaderboardScore[]; + + /** + * Fetches the total number of player entries in the leaderboard. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes this Leaderboard will emit the `getentrycount` event along with the count and name of the Leaderboard. + */ + getEntryCount(): this; + + /** + * Updates the player's score. If the player has an existing score, the old score will only be replaced if the new score is better than it. + * NOTE: If the leaderboard is associated with a specific context, the game must be in that context to set a score for the player. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes this Leaderboard will emit the `setscore` event along with the LeaderboardScore object and the name of the Leaderboard. + * + * If the save fails the event will send `null` as the score value. + * @param score The new score for the player. Must be a 64-bit integer number. + * @param data Metadata to associate with the stored score. Must be less than 2KB in size. If an object is given it will be passed to `JSON.stringify`. + */ + setScore(score: integer, data?: string | any): this; + + /** + * Gets the players leaderboard entry and stores it in the `playerScore` property. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes this Leaderboard will emit the `getplayerscore` event along with the score and the name of the Leaderboard. + * + * If the player has not yet saved a score, the event will send `null` as the score value, and `playerScore` will be set to `null` as well. + */ + getPlayerScore(): this; + + /** + * Retrieves a set of leaderboard entries, ordered by score ranking in the leaderboard. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes this Leaderboard will emit the `getscores` event along with an array of LeaderboardScore entries and the name of the Leaderboard. + * @param count The number of entries to attempt to fetch from the leaderboard. Currently, up to a maximum of 100 entries may be fetched per query. Default 10. + * @param offset The offset from the top of the leaderboard that entries will be fetched from. Default 0. + */ + getScores(count?: integer, offset?: integer): this; + + /** + * Retrieves a set of leaderboard entries, based on the current player's connected players (including the current player), ordered by local rank within the set of connected players. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes this Leaderboard will emit the `getconnectedscores` event along with an array of LeaderboardScore entries and the name of the Leaderboard. + * @param count The number of entries to attempt to fetch from the leaderboard. Currently, up to a maximum of 100 entries may be fetched per query. Default 10. + * @param offset The offset from the top of the leaderboard that entries will be fetched from. Default 0. + */ + getConnectedScores(count?: integer, offset?: integer): this; + + } + +} + +declare type ArcadePhysicsCallback = (object1: Phaser.GameObjects.GameObject, object2: Phaser.GameObjects.GameObject)=>void; + +declare type CollideCallback = (body: Phaser.Physics.Impact.Body, other: Phaser.Physics.Impact.Body, axis: string)=>void; + +declare namespace MatterJS { + /** + * The `Matter.Body` module contains methods for creating and manipulating body models. + * A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`. + * Factories for commonly used body configurations (such as rectangles, circles and other polygons) can be found in the module `Matter.Bodies`. + */ + class Body { + } + + /** + * The `Matter.Bodies` module contains factory methods for creating rigid body models + * with commonly used body configurations (such as rectangles, circles and other polygons). + */ + class Bodies { + } + + /** + * The `Matter.Composite` module contains methods for creating and manipulating composite bodies. + * A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure. + * It is important to use the functions in this module to modify composites, rather than directly modifying their properties. + * Note that the `Matter.World` object is also a type of `Matter.Composite` and as such all composite methods here can also operate on a `Matter.World`. + */ + class Composite { + } + + /** + * The `Matter.World` module contains methods for creating and manipulating the world composite. + * A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. + * A `Matter.World` has a few additional properties including `gravity` and `bounds`. + * It is important to use the functions in the `Matter.Composite` module to modify the world composite, rather than directly modifying its properties. + * There are also a few methods here that alias those in `Matter.Composite` for easier readability. + */ + class World extends MatterJS.Composite { + } + + /** + * The `Matter.Constraint` module contains methods for creating and manipulating constraints. + * Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position). + * The stiffness of constraints can be modified to create springs or elastic. + */ + class Constraint { + } + + /** + * The `Matter.Engine` module contains methods for creating and manipulating engines. + * An engine is a controller that manages updating the simulation of the world. + */ + class Engine { + } + + /** + * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. + * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. + * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). + */ + class Vertices { + } + +} + +declare type WebGLContextCallback = (renderer: Phaser.Renderer.WebGL.WebGLRenderer)=>void; + +declare type EachListCallback = (item: I, ...args: any[])=>void; + +declare type EachMapCallback = (key: string, entry: E)=>void; + +declare type EachSetCallback = (entry: E, index: number)=>void; + +declare type EachTextureCallback = (texture: Phaser.Textures.Texture, ...args: any[])=>void; + +declare type FindTileCallback = (value: Phaser.Tilemaps.Tile, index: integer, array: Phaser.Tilemaps.Tile[])=>void; + +declare type EachTileCallback = (value: Phaser.Tilemaps.Tile, index: integer, array: Phaser.Tilemaps.Tile[])=>void; + +declare type TilemapFilterCallback = (value: Phaser.GameObjects.GameObject, index: number, array: Phaser.GameObjects.GameObject[])=>void; + +declare type TilemapFindCallback = (value: Phaser.GameObjects.GameObject, index: number, array: Phaser.GameObjects.GameObject[])=>void; + +/** + * Extends the given `myClass` object's prototype with the properties of `definition`. + * @param ctor The constructor object to mix into. + * @param definition A dictionary of functions for the class. + * @param isClassDescriptor Is the definition a class descriptor? + * @param extend The parent constructor object. + */ +declare function extend(ctor: Object, definition: Object, isClassDescriptor: boolean, extend?: Object): void; + +/** + * Applies the given `mixins` to the prototype of `myClass`. + * @param myClass The constructor object to mix into. + * @param mixins The mixins to apply to the constructor. + */ +declare function mixin(myClass: Object, mixins: Object | Object[]): void; + +/** + * Phaser.Class + */ +declare class Class { + /** + * + * @param definition a dictionary of functions for the class + */ + constructor(definition: Object); + +} + +declare type AdInstance = { + /** + * Represents an instance of an ad. + */ + instance: any; + /** + * The Audience Network placement ID of this ad instance. + */ + placementID: string; + /** + * Has this ad already been shown in-game? + */ + shown: boolean; + /** + * Is this a video ad? + */ + video: boolean; +}; + +declare type LeaderboardScore = { + /** + * An integer score value. + */ + score: integer; + /** + * The score value, formatted with the score format associated with the leaderboard. + */ + scoreFormatted: string; + /** + * The Unix timestamp of when the leaderboard entry was last updated. + */ + timestamp: integer; + /** + * The entry's leaderboard ranking. + */ + rank: integer; + /** + * The developer-specified payload associated with the score, or null if one was not set. + */ + data: string; + /** + * The player's localized display name. + */ + playerName: string; + /** + * A url to the player's public profile photo. + */ + playerPhotoURL: string; + /** + * The game's unique identifier for the player. + */ + playerID: string; +}; + +declare type Product = { + /** + * The title of the product. + */ + title?: string; + /** + * The product's game-specified identifier. + */ + productID?: string; + /** + * The product description. + */ + description?: string; + /** + * A link to the product's associated image. + */ + imageURI?: string; + /** + * The price of the product. + */ + price?: string; + /** + * The currency code for the product. + */ + priceCurrencyCode?: string; +}; + +declare type Purchase = { + /** + * A developer-specified string, provided during the purchase of the product. + */ + developerPayload?: string; + /** + * The identifier for the purchase transaction. + */ + paymentID?: string; + /** + * The product's game-specified identifier. + */ + productID?: string; + /** + * Unix timestamp of when the purchase occurred. + */ + purchaseTime?: string; + /** + * A token representing the purchase that may be used to consume the purchase. + */ + purchaseToken?: string; + /** + * Server-signed encoding of the purchase request. + */ + signedRequest?: string; +}; + +declare type integer = number; + +declare module 'phaser' { + export = Phaser; + +} + diff --git a/Phaser/Demos/README.md b/Phaser/Demos/README.md index 3223226f..9f3a4d85 100644 --- a/Phaser/Demos/README.md +++ b/Phaser/Demos/README.md @@ -1,39 +1,47 @@ -## How to Install -Follow this steps +## How to use the lib -1. download [DragonBonesJS](https://github.com/DragonBones/DragonBonesJS/archive/master.zip "DragonBonesJS") from Github and unzip +1. set up your project, or just clone this demo and modify as your project -2. create the folders `libs/dragonBones/` in `Phaser/Demos` +2. in your code where you initialize your Phaser.Game, please add db plugin into your game config like below: -3. copy-paste the content of `Phaser/2.x/out` in the folder `Phaser/Demos/libs/` +``` + const gameConfig = { + plugins: { + global: [ + { key: "DragonBonesPlugin", plugin: dragonBones.phaser.plugin.DragonBonesPlugin, start: true } // setup DB plugin + ] + }, + scene: TestSceneToDisplay // first scene to show + }; + + new Phaser.Game(gameConfig); +``` + +3. load db files and create armature into your scene: -4. Now you should have the following project structure: ``` -DragonBonesJS/Phaser/Demos - |-- libs - |-- dragonBones - |-- dragonBones.js - |-- ... - |-- phaser (optional, see note below*) - |-- phaser.d.ts - |-- pixi.d.ts - |-- p2.d.ts - |-- ... - |-- node_modules (automatically generated when using npm) - |-- ... - |-- out - |-- ... - |-- resource - |-- ... - |-- src - |-- ... - |-- index.html - |-- README.md - |-- ... + class TestSceneToDisplay extends Phaser.Scene { // test scene + preload(): void { // override + this.load.dragonbone( // load db files + "mecha_1002_101d_show", // db name + "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png", // atlas image + "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json", // atlas json + "resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin", // skeleton json or bin + null, // atlas image XHR settings + null, // atlas json XHR settings + { responseType: "arraybuffer" } // skeleton file XHR settings, must set responseType if your skeleton file is in binary format + ); + } + + create(): void { // override + const armatureDisplay = this.add.armature("mecha_1002_101d", "mecha_1002_101d_show"); // create armature, the second argument should use the name you set when load your db file in preload method, but it's actually optional, so just ignore it if you like. + armatureDisplay.animation.play("idle"); // play animation + + armatureDisplay.x = this.cameras.main.centerX; // set position + armatureDisplay.y = this.cameras.main.centerY + 200; + } + } ``` -**NOTE:** we are fetching Phaser with the package manager `npm` so you don't need to install it to run the demos. If you installed your own version of Phaser in `./libs/phaser/phaser.js`, you will need to modify the file `index.html`. Find the line ``, and replace it to `` -5. start a local server in `Phaser/Demos/` and go to visit `localhost:xxxx` in your favorite browser +4. more examples / code please check the [demo root directory](./src/) out. -## Phaser declaration -* [Get phaser.d.ts, pixi.d.ts, p2.d.ts](https://github.com/photonstorm/phaser-ce/tree/master/typescript/) diff --git a/Phaser/Demos/index.html b/Phaser/Demos/index.html index 90250667..f614b067 100644 --- a/Phaser/Demos/index.html +++ b/Phaser/Demos/index.html @@ -5,7 +5,7 @@ DragonBones Demo - + @@ -18,7 +18,6 @@ - @@ -26,27 +25,41 @@ diff --git a/Phaser/Demos/libs/dragonBones/.gitkeep b/Phaser/Demos/libs/dragonBones/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Phaser/Demos/libs/dragonBones/dragonBones.d.ts b/Phaser/Demos/libs/dragonBones/dragonBones.d.ts new file mode 100644 index 00000000..9c09bcde --- /dev/null +++ b/Phaser/Demos/libs/dragonBones/dragonBones.d.ts @@ -0,0 +1,6408 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + const enum BinaryOffset { + WeigthBoneCount = 0, + WeigthFloatOffset = 1, + WeigthBoneIndices = 2, + GeometryVertexCount = 0, + GeometryTriangleCount = 1, + GeometryFloatOffset = 2, + GeometryWeightOffset = 3, + GeometryVertexIndices = 4, + TimelineScale = 0, + TimelineOffset = 1, + TimelineKeyFrameCount = 2, + TimelineFrameValueCount = 3, + TimelineFrameValueOffset = 4, + TimelineFrameOffset = 5, + FramePosition = 0, + FrameTweenType = 1, + FrameTweenEasingOrCurveSampleCount = 2, + FrameCurveSamples = 3, + DeformVertexOffset = 0, + DeformCount = 1, + DeformValueCount = 2, + DeformValueOffset = 3, + DeformFloatOffset = 4 + } + /** + * @private + */ + const enum ArmatureType { + Armature = 0, + MovieClip = 1, + Stage = 2 + } + /** + * @private + */ + const enum BoneType { + Bone = 0, + Surface = 1 + } + /** + * @private + */ + const enum DisplayType { + Image = 0, + Armature = 1, + Mesh = 2, + BoundingBox = 3, + Path = 4 + } + /** + * - Bounding box type. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框类型。 + * @version DragonBones 5.0 + * @language zh_CN + */ + const enum BoundingBoxType { + Rectangle = 0, + Ellipse = 1, + Polygon = 2 + } + /** + * @private + */ + const enum ActionType { + Play = 0, + Frame = 10, + Sound = 11 + } + /** + * @private + */ + const enum BlendMode { + Normal = 0, + Add = 1, + Alpha = 2, + Darken = 3, + Difference = 4, + Erase = 5, + HardLight = 6, + Invert = 7, + Layer = 8, + Lighten = 9, + Multiply = 10, + Overlay = 11, + Screen = 12, + Subtract = 13 + } + /** + * @private + */ + const enum TweenType { + None = 0, + Line = 1, + Curve = 2, + QuadIn = 3, + QuadOut = 4, + QuadInOut = 5 + } + /** + * @private + */ + const enum TimelineType { + Action = 0, + ZOrder = 1, + BoneAll = 10, + BoneTranslate = 11, + BoneRotate = 12, + BoneScale = 13, + Surface = 50, + BoneAlpha = 60, + SlotDisplay = 20, + SlotColor = 21, + SlotDeform = 22, + SlotZIndex = 23, + SlotAlpha = 24, + IKConstraint = 30, + AnimationProgress = 40, + AnimationWeight = 41, + AnimationParameter = 42 + } + /** + * - Offset mode. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 偏移模式。 + * @version DragonBones 5.5 + * @language zh_CN + */ + const enum OffsetMode { + None = 0, + Additive = 1, + Override = 2 + } + /** + * - Animation fade out mode. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出模式。 + * @version DragonBones 4.5 + * @language zh_CN + */ + const enum AnimationFadeOutMode { + /** + * - Fade out the animation states of the same layer. + * @language en_US + */ + /** + * - 淡出同层的动画状态。 + * @language zh_CN + */ + SameLayer = 1, + /** + * - Fade out the animation states of the same group. + * @language en_US + */ + /** + * - 淡出同组的动画状态。 + * @language zh_CN + */ + SameGroup = 2, + /** + * - Fade out the animation states of the same layer and group. + * @language en_US + */ + /** + * - 淡出同层并且同组的动画状态。 + * @language zh_CN + */ + SameLayerAndGroup = 3, + /** + * - Fade out of all animation states. + * @language en_US + */ + /** + * - 淡出所有的动画状态。 + * @language zh_CN + */ + All = 4, + /** + * - Does not replace the animation state with the same name. + * @language en_US + */ + /** + * - 不替换同名的动画状态。 + * @language zh_CN + */ + Single = 5 + } + /** + * @private + */ + const enum AnimationBlendType { + None = 0, + E1D = 1 + } + /** + * @private + */ + const enum AnimationBlendMode { + Additive = 0, + Override = 1 + } + /** + * @private + */ + const enum ConstraintType { + IK = 0, + Path = 1 + } + /** + * @private + */ + const enum PositionMode { + Fixed = 0, + Percent = 1 + } + /** + * @private + */ + const enum SpacingMode { + Length = 0, + Fixed = 1, + Percent = 2 + } + /** + * @private + */ + const enum RotateMode { + Tangent = 0, + Chain = 1, + ChainScale = 2 + } + /** + * @private + */ + interface Map { + [key: string]: T; + } + /** + * @private + */ + class DragonBones { + static readonly VERSION: string; + static yDown: boolean; + static debug: boolean; + static debugDraw: boolean; + private readonly _clock; + private readonly _events; + private readonly _objects; + private _eventManager; + constructor(eventManager: IEventDispatcher); + advanceTime(passedTime: number): void; + bufferEvent(value: EventObject): void; + bufferObject(object: BaseObject): void; + readonly clock: WorldClock; + readonly eventManager: IEventDispatcher; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The BaseObject is the base class for all objects in the DragonBones framework. + * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 基础对象,通常 DragonBones 的对象都继承自该类。 + * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。 + * @version DragonBones 4.5 + * @language zh_CN + */ + abstract class BaseObject { + private static _hashCode; + private static _defaultMaxCount; + private static readonly _maxCountMap; + private static readonly _poolsMap; + private static _returnObject; + static toString(): string; + /** + * - Set the maximum cache count of the specify object pool. + * @param objectConstructor - The specify class. (Set all object pools max cache count if not set) + * @param maxCount - Max count. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 设置特定对象池的最大缓存数量。 + * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量) + * @param maxCount - 最大缓存数量。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static setMaxCount(objectConstructor: (typeof BaseObject) | null, maxCount: number): void; + /** + * - Clear the cached instances of a specify object pool. + * @param objectConstructor - Specify class. (Clear all cached instances if not set) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除特定对象池的缓存实例。 + * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例) + * @version DragonBones 4.5 + * @language zh_CN + */ + static clearPool(objectConstructor?: (typeof BaseObject) | null): void; + /** + * - Get an instance of the specify class from object pool. + * @param objectConstructor - The specify class. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从对象池中获取特定类的实例。 + * @param objectConstructor - 特定的类。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static borrowObject(objectConstructor: { + new (): T; + }): T; + /** + * - A unique identification number assigned to the object. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分配给此实例的唯一标识号。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly hashCode: number; + private _isInPool; + protected abstract _onClear(): void; + /** + * - Clear the object and return it back to object pool。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除该实例的所有数据并将其返还对象池。 + * @version DragonBones 4.5 + * @language zh_CN + */ + returnToPool(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - 2D Transform matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 转换矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Matrix { + /** + * - The value that affects the positioning of pixels along the x axis when scaling or rotating an image. + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 缩放或旋转图像时影响像素沿 x 轴定位的值。 + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + a: number; + /** + * - The value that affects the positioning of pixels along the y axis when rotating or skewing an image. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转或倾斜图像时影响像素沿 y 轴定位的值。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + b: number; + /** + * - The value that affects the positioning of pixels along the x axis when rotating or skewing an image. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转或倾斜图像时影响像素沿 x 轴定位的值。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + c: number; + /** + * - The value that affects the positioning of pixels along the y axis when scaling or rotating an image. + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 缩放或旋转图像时影响像素沿 y 轴定位的值。 + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + d: number; + /** + * - The distance by which to translate each point along the x axis. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 沿 x 轴平移每个点的距离。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + tx: number; + /** + * - The distance by which to translate each point along the y axis. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 沿 y 轴平移每个点的距离。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + ty: number; + /** + * @private + */ + constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number); + toString(): string; + /** + * @private + */ + copyFrom(value: Matrix): Matrix; + /** + * @private + */ + copyFromArray(value: Array, offset?: number): Matrix; + /** + * - Convert to unit matrix. + * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为单位矩阵。 + * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + identity(): Matrix; + /** + * - Multiplies the current matrix with another matrix. + * @param value - The matrix that needs to be multiplied. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将当前矩阵与另一个矩阵相乘。 + * @param value - 需要相乘的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + concat(value: Matrix): Matrix; + /** + * - Convert to inverse matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为逆矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + invert(): Matrix; + /** + * - Apply a matrix transformation to a specific point. + * @param x - X coordinate. + * @param y - Y coordinate. + * @param result - The point after the transformation is applied. + * @param delta - Whether to ignore tx, ty's conversion to point. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将矩阵转换应用于特定点。 + * @param x - 横坐标。 + * @param y - 纵坐标。 + * @param result - 应用转换之后的点。 + * @param delta - 是否忽略 tx,ty 对点的转换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + transformPoint(x: number, y: number, result: { + x: number; + y: number; + }, delta?: boolean): void; + /** + * @private + */ + transformRectangle(rectangle: { + x: number; + y: number; + width: number; + height: number; + }, delta?: boolean): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - 2D Transform. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 变换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Transform { + /** + * @private + */ + static readonly PI: number; + /** + * @private + */ + static readonly PI_D: number; + /** + * @private + */ + static readonly PI_H: number; + /** + * @private + */ + static readonly PI_Q: number; + /** + * @private + */ + static readonly RAD_DEG: number; + /** + * @private + */ + static readonly DEG_RAD: number; + /** + * @private + */ + static normalizeRadian(value: number): number; + /** + * - Horizontal translate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 水平位移。 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - Vertical translate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 垂直位移。 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - Skew. (In radians) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 倾斜。 (以弧度为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + skew: number; + /** + * - rotation. (In radians) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转。 (以弧度为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + rotation: number; + /** + * - Horizontal Scaling. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 水平缩放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + scaleX: number; + /** + * - Vertical scaling. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 垂直缩放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + scaleY: number; + /** + * @private + */ + constructor(x?: number, y?: number, skew?: number, rotation?: number, scaleX?: number, scaleY?: number); + toString(): string; + /** + * @private + */ + copyFrom(value: Transform): Transform; + /** + * @private + */ + identity(): Transform; + /** + * @private + */ + add(value: Transform): Transform; + /** + * @private + */ + minus(value: Transform): Transform; + /** + * @private + */ + fromMatrix(matrix: Matrix): Transform; + /** + * @private + */ + toMatrix(matrix: Matrix): Transform; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class ColorTransform { + alphaMultiplier: number; + redMultiplier: number; + greenMultiplier: number; + blueMultiplier: number; + alphaOffset: number; + redOffset: number; + greenOffset: number; + blueOffset: number; + constructor(alphaMultiplier?: number, redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaOffset?: number, redOffset?: number, greenOffset?: number, blueOffset?: number); + copyFrom(value: ColorTransform): void; + identity(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The Point object represents a location in a two-dimensional coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Point 对象表示二维坐标系统中的某个位置。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Point { + /** + * - The horizontal coordinate. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 该点的水平坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - The vertical coordinate. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 该点的垂直坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @param x - The horizontal coordinate. + * @param y - The vertical coordinate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。 + * @param x - 该对象的x属性值,默认为 0.0。 + * @param y - 该对象的y属性值,默认为 0.0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(x?: number, y?: number); + /** + * @private + */ + copyFrom(value: Point): void; + /** + * @private + */ + clear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its + * width and its height.
+ * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of + * one property has no effect on the others. However, the right and bottom properties are integrally related to those + * four properties. For example, if you change the value of the right property, the value of the width property changes; + * if you change the bottom property, the value of the height property changes. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
+ * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 + * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width + * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Rectangle { + /** + * - The x coordinate of the top-left corner of the rectangle. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形左上角的 x 坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - The y coordinate of the top-left corner of the rectangle. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形左上角的 y 坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - The width of the rectangle, in pixels. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形的宽度(以像素为单位)。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + width: number; + /** + * - 矩形的高度(以像素为单位)。 + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - The height of the rectangle, in pixels. + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + height: number; + /** + * @private + */ + constructor(x?: number, y?: number, width?: number, height?: number); + /** + * @private + */ + copyFrom(value: Rectangle): void; + /** + * @private + */ + clear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The user custom data. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 用户自定义数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + class UserData extends BaseObject { + static toString(): string; + /** + * - The custom int numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly ints: Array; + /** + * - The custom float numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly floats: Array; + /** + * - The custom strings. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly strings: Array; + protected _onClear(): void; + /** + * - Get the custom int number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getInt(index?: number): number; + /** + * - Get the custom float number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getFloat(index?: number): number; + /** + * - Get the custom string. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getString(index?: number): string; + } + /** + * @private + */ + class ActionData extends BaseObject { + static toString(): string; + type: ActionType; + name: string; + bone: BoneData | null; + slot: SlotData | null; + data: UserData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The DragonBones data. + * A DragonBones data contains multiple armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据。 + * 一个龙骨数据包含多个骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + class DragonBonesData extends BaseObject { + static toString(): string; + /** + * @private + */ + autoSearch: boolean; + /** + * - The animation frame rate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画帧频。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameRate: number; + /** + * - The data version. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 数据版本。 + * @version DragonBones 3.0 + * @language zh_CN + */ + version: string; + /** + * - The DragonBones data name. + * The name is consistent with the DragonBones project name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据名称。 + * 该名称与龙骨项目名保持一致。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + stage: ArmatureData | null; + /** + * - All armature data names. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly armatureNames: Array; + /** + * @private + */ + readonly armatures: Map; + /** + * @private + */ + userData: UserData | null; + protected _onClear(): void; + /** + * - Get a specific armature data. + * @param armatureName - The armature data name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param armatureName - 骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getArmature(armatureName: string): ArmatureData | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The armature data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class ArmatureData extends BaseObject { + static toString(): string; + /** + * @private + */ + type: ArmatureType; + /** + * - The animation frame rate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画帧率。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameRate: number; + /** + * @private + */ + cacheFrameRate: number; + /** + * @private + */ + scale: number; + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly aabb: Rectangle; + /** + * - The names of all the animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的动画数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animationNames: Array; + /** + * @private + */ + readonly sortedBones: Array; + /** + * @private + */ + readonly sortedSlots: Array; + /** + * @private + */ + readonly defaultActions: Array; + /** + * @private + */ + readonly actions: Array; + /** + * @private + */ + readonly bones: Map; + /** + * @private + */ + readonly slots: Map; + /** + * @private + */ + readonly constraints: Map; + /** + * @private + */ + readonly skins: Map; + /** + * @private + */ + readonly animations: Map; + /** + * - The default skin data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 默认插槽数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + defaultSkin: SkinData | null; + /** + * - The default animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 默认动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + defaultAnimation: AnimationData | null; + /** + * @private + */ + canvas: CanvasData | null; + /** + * @private + */ + userData: UserData | null; + /** + * @private + */ + parent: DragonBonesData; + protected _onClear(): void; + /** + * - Get a specific done data. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼数据。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getBone(boneName: string): BoneData | null; + /** + * - Get a specific slot data. + * @param slotName - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽数据。 + * @param slotName - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlot(slotName: string): SlotData | null; + /** + * @private + */ + getConstraint(constraintName: string): ConstraintData | null; + /** + * - Get a specific skin data. + * @param skinName - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定皮肤数据。 + * @param skinName - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getSkin(skinName: string): SkinData | null; + /** + * @private + */ + getMesh(skinName: string, slotName: string, meshName: string): MeshDisplayData | null; + /** + * - Get a specific animation data. + * @param animationName - The animation animationName. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的动画数据。 + * @param animationName - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getAnimation(animationName: string): AnimationData | null; + } + /** + * - The bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class BoneData extends BaseObject { + static toString(): string; + /** + * @private + */ + inheritTranslation: boolean; + /** + * @private + */ + inheritRotation: boolean; + /** + * @private + */ + inheritScale: boolean; + /** + * @private + */ + inheritReflection: boolean; + /** + * @private + */ + type: BoneType; + /** + * - The bone length. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼长度。 + * @version DragonBones 3.0 + * @language zh_CN + */ + length: number; + /** + * @private + */ + alpha: number; + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly transform: Transform; + /** + * @private + */ + userData: UserData | null; + /** + * - The parent bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 父骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + parent: BoneData | null; + protected _onClear(): void; + } + /** + * - The slot data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class SlotData extends BaseObject { + static toString(): string; + /** + * @private + */ + blendMode: BlendMode; + /** + * @private + */ + displayIndex: number; + /** + * @private + */ + zOrder: number; + /** + * @private + */ + zIndex: number; + /** + * @private + */ + alpha: number; + /** + * - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + color: ColorTransform; + /** + * @private + */ + userData: UserData | null; + /** + * - The parent bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 父骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + parent: BoneData; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + abstract class ConstraintData extends BaseObject { + order: number; + name: string; + type: ConstraintType; + target: BoneData; + root: BoneData; + bone: BoneData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class CanvasData extends BaseObject { + static toString(): string; + hasBackground: boolean; + color: number; + x: number; + y: number; + width: number; + height: number; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The skin data, typically a armature data instance contains at least one skinData. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class SkinData extends BaseObject { + static toString(): string; + /** + * - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly displays: Map>; + /** + * @private + */ + parent: ArmatureData; + protected _onClear(): void; + /** + * @private + */ + getDisplay(slotName: string, displayName: string): DisplayData | null; + /** + * @private + */ + getDisplays(slotName: string): Array | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class GeometryData { + isShared: boolean; + inheritDeform: boolean; + offset: number; + data: DragonBonesData; + weight: WeightData | null; + clear(): void; + shareFrom(value: GeometryData): void; + readonly vertexCount: number; + readonly triangleCount: number; + } + /** + * @private + */ + abstract class DisplayData extends BaseObject { + type: DisplayType; + name: string; + path: string; + readonly transform: Transform; + parent: SkinData; + protected _onClear(): void; + } + /** + * @private + */ + class ImageDisplayData extends DisplayData { + static toString(): string; + readonly pivot: Point; + texture: TextureData | null; + protected _onClear(): void; + } + /** + * @private + */ + class ArmatureDisplayData extends DisplayData { + static toString(): string; + inheritAnimation: boolean; + readonly actions: Array; + armature: ArmatureData | null; + protected _onClear(): void; + /** + * @private + */ + addAction(value: ActionData): void; + } + /** + * @private + */ + class MeshDisplayData extends DisplayData { + static toString(): string; + readonly geometry: GeometryData; + texture: TextureData | null; + protected _onClear(): void; + } + /** + * @private + */ + class BoundingBoxDisplayData extends DisplayData { + static toString(): string; + boundingBox: BoundingBoxData | null; + protected _onClear(): void; + } + /** + * @private + */ + class PathDisplayData extends DisplayData { + static toString(): string; + closed: boolean; + constantSpeed: boolean; + readonly geometry: GeometryData; + readonly curveLengths: Array; + protected _onClear(): void; + } + /** + * @private + */ + class WeightData extends BaseObject { + static toString(): string; + count: number; + offset: number; + readonly bones: Array; + protected _onClear(): void; + addBone(value: BoneData): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The base class of bounding box data. + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框数据基类。 + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract class BoundingBoxData extends BaseObject { + /** + * - The bounding box type. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框类型。 + * @version DragonBones 5.0 + * @language zh_CN + */ + type: BoundingBoxType; + /** + * @private + */ + color: number; + /** + * @private + */ + width: number; + /** + * @private + */ + height: number; + protected _onClear(): void; + /** + * - Check whether the bounding box contains a specific point. (Local coordinate system) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查边界框是否包含特定点。(本地坐标系) + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract containsPoint(pX: number, pY: number): boolean; + /** + * - Check whether the bounding box intersects a specific segment. (Local coordinate system) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查边界框是否与特定线段相交。(本地坐标系) + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA: { + x: number; + y: number; + } | null, intersectionPointB: { + x: number; + y: number; + } | null, normalRadians: { + x: number; + y: number; + } | null): number; + } + /** + * - The rectangle bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 矩形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class RectangleBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * - Compute the bit code for a point (x, y) using the clip rectangle + */ + private static _computeOutCode; + /** + * @private + */ + static rectangleIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xMin: number, yMin: number, xMax: number, yMax: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } + /** + * - The ellipse bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 椭圆边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class EllipseBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * @private + */ + static ellipseIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xC: number, yC: number, widthH: number, heightH: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } + /** + * - The polygon bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class PolygonBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * @private + */ + static polygonIntersectsSegment(xA: number, yA: number, xB: number, yB: number, vertices: Array, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + /** + * @private + */ + x: number; + /** + * @private + */ + y: number; + /** + * - The polygon vertices. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形顶点。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly vertices: Array; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class AnimationData extends BaseObject { + static toString(): string; + /** + * @private + */ + blendType: AnimationBlendType; + /** + * - The frame count of the animation. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的帧数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameCount: number; + /** + * - The play times of the animation. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The duration of the animation. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的持续时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + duration: number; + /** + * @private + */ + scale: number; + /** + * - The fade in time of the animation. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的淡入时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + fadeInTime: number; + /** + * @private + */ + cacheFrameRate: number; + /** + * - The animation name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly cachedFrames: Array; + /** + * @private + */ + readonly boneTimelines: Map>; + /** + * @private + */ + readonly slotTimelines: Map>; + /** + * @private + */ + readonly constraintTimelines: Map>; + /** + * @private + */ + readonly animationTimelines: Map>; + /** + * @private + */ + readonly boneCachedFrameIndices: Map>; + /** + * @private + */ + readonly slotCachedFrameIndices: Map>; + /** + * @private + */ + actionTimeline: TimelineData | null; + /** + * @private + */ + zOrderTimeline: TimelineData | null; + /** + * @private + */ + parent: ArmatureData; + protected _onClear(): void; + /** + * @private + */ + addBoneTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addSlotTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addConstraintTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addAnimationTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + getBoneTimelines(timelineName: string): Array | null; + /** + * @private + */ + getSlotTimelines(timelineName: string): Array | null; + /** + * @private + */ + getConstraintTimelines(timelineName: string): Array | null; + /** + * @private + */ + getAnimationTimelines(timelineName: string): Array | null; + /** + * @private + */ + getBoneCachedFrameIndices(boneName: string): Array | null; + /** + * @private + */ + getSlotCachedFrameIndices(slotName: string): Array | null; + } + /** + * @private + */ + class TimelineData extends BaseObject { + static toString(): string; + type: TimelineType; + offset: number; + frameIndicesOffset: number; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation config is used to describe all the information needed to play an animation state. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画配置用来描述播放一个动画状态所需要的全部信息。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + class AnimationConfig extends BaseObject { + static toString(): string; + /** + * @private + */ + pauseFadeOut: boolean; + /** + * - Fade out the pattern of other animation states when the animation state is fade in. + * This property is typically used to specify the substitution of multiple animation states blend. + * @default dragonBones.AnimationFadeOutMode.All + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 淡入动画状态时淡出其他动画状态的模式。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @default dragonBones.AnimationFadeOutMode.All + * @version DragonBones 5.0 + * @language zh_CN + */ + fadeOutMode: AnimationFadeOutMode; + /** + * @private + */ + fadeOutTweenType: TweenType; + /** + * @private + */ + fadeOutTime: number; + /** + * @private + */ + pauseFadeIn: boolean; + /** + * @private + */ + actionEnabled: boolean; + /** + * @private + */ + additive: boolean; + /** + * - Whether the animation state has control over the display property of the slots. + * Sometimes blend a animation state does not want it to control the display properties of the slots, + * especially if other animation state are controlling the display properties of the slots. + * @default true + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态是否对插槽的显示对象属性有控制权。 + * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, + * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 + * @default true + * @version DragonBones 5.0 + * @language zh_CN + */ + displayControl: boolean; + /** + * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. + * This property should usually be set to false when blend multiple animation states. + * @default true + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 + * 通常在混合多个动画状态时应该将该属性设置为 false。 + * @default true + * @version DragonBones 5.1 + * @language zh_CN + */ + resetToPose: boolean; + /** + * @private + */ + fadeInTweenType: TweenType; + /** + * - The play times. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The blend layer. + * High layer animation state will get the blend weight first. + * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合图层。 + * 图层高的动画状态会优先获取混合权重。 + * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + layer: number; + /** + * - The start time of play. (In seconds) + * @default 0.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 播放的开始时间。 (以秒为单位) + * @default 0.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + position: number; + /** + * - The duration of play. + * [-1: Use the default value of the animation data, 0: Stop play, (0~N]: The duration] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 播放的持续时间。 + * [-1: 使用动画数据默认值, 0: 动画停止, (0~N]: 持续时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + duration: number; + /** + * - The play speed. + * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. + * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度。 + * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 + * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + weight: number; + /** + * - The fade in time. + * [-1: Use the default value of the animation data, [0~N]: The fade in time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 淡入时间。 + * [-1: 使用动画数据默认值, [0~N]: 淡入时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + fadeInTime: number; + /** + * - The auto fade out time when the animation state play completed. + * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态播放完成后的自动淡出时间。 + * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + autoFadeOutTime: number; + /** + * - The name of the animation state. (Can be different from the name of the animation data) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态名称。 (可以不同于动画数据) + * @version DragonBones 5.0 + * @language zh_CN + */ + name: string; + /** + * - The animation data name. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画数据名称。 + * @version DragonBones 5.0 + * @language zh_CN + */ + animation: string; + /** + * - The blend group name of the animation state. + * This property is typically used to specify the substitution of multiple animation states blend. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合组名称。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + group: string; + /** + * @private + */ + readonly boneMask: Array; + protected _onClear(): void; + /** + * @private + */ + clear(): void; + /** + * @private + */ + copyFrom(value: AnimationConfig): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class TextureAtlasData extends BaseObject { + /** + * @private + */ + autoSearch: boolean; + /** + * @private + */ + width: number; + /** + * @private + */ + height: number; + /** + * @private + */ + scale: number; + /** + * - The texture atlas name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * - The image path of the texture atlas. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集图片路径。 + * @version DragonBones 3.0 + * @language zh_CN + */ + imagePath: string; + /** + * @private + */ + readonly textures: Map; + protected _onClear(): void; + /** + * @private + */ + copyFrom(value: TextureAtlasData): void; + /** + * @private + */ + getTexture(textureName: string): TextureData | null; + } + /** + * @private + */ + abstract class TextureData extends BaseObject { + static createRectangle(): Rectangle; + rotated: boolean; + name: string; + readonly region: Rectangle; + parent: TextureAtlasData; + frame: Rectangle | null; + protected _onClear(): void; + copyFrom(value: TextureData): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The armature proxy interface, the docking engine needs to implement it concretely. + * @see dragonBones.Armature + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 骨架代理接口,对接的引擎需要对其进行具体实现。 + * @see dragonBones.Armature + * @version DragonBones 5.0 + * @language zh_CN + */ + interface IArmatureProxy extends IEventDispatcher { + /** + * - Dispose the instance and the Armature instance. (The Armature instance will return to the object pool) + * @example + *
+         *     removeChild(armatureDisplay);
+         *     armatureDisplay.dispose();
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 释放该实例和骨架。 (骨架会回收到对象池) + * @example + *
+         *     removeChild(armatureDisplay);
+         *     armatureDisplay.dispose();
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + dispose(disposeProxy: boolean): void; + /** + * - The armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly armature: Armature; + /** + * - The animation player. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animation: Animation; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Armature is the core of the skeleton animation system. + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架是骨骼动画系统的核心。 + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + class Armature extends BaseObject implements IAnimatable { + static toString(): string; + private static _onSortSlots; + /** + * - Whether to inherit the animation control of the parent armature. + * True to try to have the child armature play an animation with the same name when the parent armature play the animation. + * @default true + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 是否继承父骨架的动画控制。 + * 如果该值为 true,当父骨架播放动画时,会尝试让子骨架播放同名动画。 + * @default true + * @version DragonBones 4.5 + * @language zh_CN + */ + inheritAnimation: boolean; + /** + * @private + */ + userData: any; + private _slotsDirty; + private _zOrderDirty; + private _flipX; + private _flipY; + private _alpha; + private readonly _bones; + private readonly _slots; + private readonly _actions; + private _animation; + private _proxy; + private _display; + private _replacedTexture; + private _clock; + protected _onClear(): void; + /** + * - Dispose the armature. (Return to the object pool) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 释放骨架。 (回收到对象池) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + dispose(): void; + /** + * @inheritDoc + */ + advanceTime(passedTime: number): void; + /** + * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. + * @param boneName - The bone name. (If not set, all bones will be update) + * @param updateSlot - Whether to update the bone's slots. (Default: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 + * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) + * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + invalidUpdate(boneName?: string | null, updateSlot?: boolean): void; + /** + * - Check whether a specific point is inside a custom bounding box in a slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在某个插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + containsPoint(x: number, y: number): Slot | null; + /** + * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 + * @version DragonBones 5.0 + * @language zh_CN + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): Slot | null; + /** + * - Get a specific bone. + * @param name - The bone name. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼。 + * @param name - 骨骼名称。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBone(name: string): Bone | null; + /** + * - Get a specific bone by the display. + * @param display - The display object. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的骨骼。 + * @param display - 显示对象。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBoneByDisplay(display: any): Bone | null; + /** + * - Get a specific slot. + * @param name - The slot name. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽。 + * @param name - 插槽名称。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlot(name: string): Slot | null; + /** + * - Get a specific slot by the display. + * @param display - The display object. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的插槽。 + * @param display - 显示对象。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlotByDisplay(display: any): Slot | null; + /** + * - Get all bones. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBones(): Array; + /** + * - Get all slots. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的插槽。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlots(): Array; + /** + * - Whether to flip the armature horizontally. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架水平翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + flipX: boolean; + /** + * - Whether to flip the armature vertically. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架垂直翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + flipY: boolean; + /** + * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. + * There is a certain amount of memory overhead to improve performance by caching animation data in memory. + * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. + * When the animation cache is turned on, some features will fail, such as the offset property of bone. + * @example + *
+         *     armature.cacheFrameRate = 24;
+         * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 + * @example + *
+         *     armature.cacheFrameRate = 24;
+         * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language zh_CN + */ + cacheFrameRate: number; + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - The armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly armatureData: ArmatureData; + /** + * - The animation player. + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animation: Animation; + /** + * @pivate + */ + readonly proxy: IArmatureProxy; + /** + * - The EventDispatcher instance of the armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架的 EventDispatcher 实例。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly eventDispatcher: IEventDispatcher; + /** + * - The display container. + * The display of the slot is displayed as the parent. + * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 显示容器实例。 + * 插槽的显示对象都会以此显示容器为父级。 + * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly display: any; + /** + * @private + */ + replacedTexture: any; + /** + * @inheritDoc + */ + clock: WorldClock | null; + /** + * - Get the parent slot which the armature belongs to. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架所属的父插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly parent: Slot | null; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + getDisplay(): any; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The base class of the transform object. + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 变换对象的基类。 + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language zh_CN + */ + abstract class TransformObject extends BaseObject { + protected static readonly _helpMatrix: Matrix; + protected static readonly _helpTransform: Transform; + protected static readonly _helpPoint: Point; + /** + * - A matrix relative to the armature coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly globalTransformMatrix: Matrix; + /** + * - A transform relative to the armature coordinate system. + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的变换。 + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly global: Transform; + /** + * - The offset transform relative to the armature or the parent bone coordinate system. + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架或父骨骼坐标系的偏移变换。 + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly offset: Transform; + /** + * @private + */ + origin: Transform | null; + /** + * @private + */ + userData: any; + protected _globalDirty: boolean; + /** + */ + protected _onClear(): void; + /** + * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, + * some engines do not rely on these attributes to update rendering, such as Egret. + * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 + * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + updateGlobalTransform(): void; + /** + * - The armature to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的骨架。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly armature: Armature; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Bone is one of the most important logical units in the armature animation system, + * and is responsible for the realization of translate, rotation, scaling in the animations. + * A armature can contain multiple bones. + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 + * 一个骨架中可以包含多个骨骼。 + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + class Bone extends TransformObject { + static toString(): string; + /** + * - The offset mode. + * @see #offset + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 偏移模式。 + * @see #offset + * @version DragonBones 5.5 + * @language zh_CN + */ + offsetMode: OffsetMode; + protected _localDirty: boolean; + protected _visible: boolean; + protected _cachedFrameIndex: number; + /** + * @private + */ + protected _parent: Bone | null; + protected _onClear(): void; + protected _updateGlobalTransformMatrix(isCache: boolean): void; + /** + * - Forces the bone to update the transform in the next frame. + * When the bone is not animated or its animation state is finished, the bone will not continue to update, + * and when the skeleton must be updated for some reason, the method needs to be called explicitly. + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制骨骼在下一帧更新变换。 + * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + invalidUpdate(): void; + /** + * - Check whether the bone contains a specific bone. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查该骨骼是否包含特定的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + contains(value: Bone): boolean; + /** + * - The bone data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly boneData: BoneData; + /** + * - The visible of all slots in the bone. + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 此骨骼所有插槽的可见。 + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language zh_CN + */ + visible: boolean; + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly parent: Bone | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class DisplayFrame extends BaseObject { + static toString(): string; + rawDisplayData: DisplayData | null; + displayData: DisplayData | null; + textureData: TextureData | null; + display: any | Armature | null; + readonly deformVertices: Array; + protected _onClear(): void; + updateDeformVertices(): void; + getGeometryData(): GeometryData | null; + getBoundingBox(): BoundingBoxData | null; + getTextureData(): TextureData | null; + } + /** + * - The slot attached to the armature, controls the display status and properties of the display object. + * A bone can contain multiple slots. + * A slot can contain multiple display objects, displaying only one of the display objects at a time, + * but you can toggle the display object into frame animation while the animation is playing. + * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, + * and a custom other display object. + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class Slot extends TransformObject { + /** + * - Displays the animated state or mixed group name controlled by the object, set to null to be controlled by all animation states. + * @default null + * @see dragonBones.AnimationState#displayControl + * @see dragonBones.AnimationState#name + * @see dragonBones.AnimationState#group + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 显示对象受到控制的动画状态或混合组名称,设置为 null 则表示受所有的动画状态控制。 + * @default null + * @see dragonBones.AnimationState#displayControl + * @see dragonBones.AnimationState#name + * @see dragonBones.AnimationState#group + * @version DragonBones 4.5 + * @language zh_CN + */ + displayController: string | null; + protected _displayDataDirty: boolean; + protected _displayDirty: boolean; + protected _geometryDirty: boolean; + protected _textureDirty: boolean; + protected _visibleDirty: boolean; + protected _blendModeDirty: boolean; + protected _zOrderDirty: boolean; + protected _transformDirty: boolean; + protected _visible: boolean; + protected _blendMode: BlendMode; + protected _displayIndex: number; + protected _animationDisplayIndex: number; + protected _cachedFrameIndex: number; + protected readonly _localMatrix: Matrix; + protected _boundingBoxData: BoundingBoxData | null; + protected _textureData: TextureData | null; + protected _rawDisplay: any; + protected _meshDisplay: any; + protected _display: any | null; + protected _childArmature: Armature | null; + /** + * @private + */ + protected _parent: Bone; + protected _onClear(): void; + protected abstract _initDisplay(value: any, isRetain: boolean): void; + protected abstract _disposeDisplay(value: any, isRelease: boolean): void; + protected abstract _onUpdateDisplay(): void; + protected abstract _addDisplay(): void; + protected abstract _replaceDisplay(value: any): void; + protected abstract _removeDisplay(): void; + protected abstract _updateZOrder(): void; + protected abstract _updateBlendMode(): void; + protected abstract _updateColor(): void; + protected abstract _updateFrame(): void; + protected abstract _updateMesh(): void; + protected abstract _updateTransform(): void; + protected abstract _identityTransform(): void; + protected _hasDisplay(display: any): boolean; + protected _updateDisplayData(): void; + protected _updateDisplay(): void; + protected _updateGlobalTransformMatrix(isCache: boolean): void; + /** + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + invalidUpdate(): void; + /** + * @private + */ + updateTransformAndMatrix(): void; + /** + * @private + */ + replaceRawDisplayData(displayData: DisplayData | null, index?: number): void; + /** + * @private + */ + replaceDisplayData(displayData: DisplayData | null, index?: number): void; + /** + * @private + */ + replaceTextureData(textureData: TextureData | null, index?: number): void; + /** + * @private + */ + replaceDisplay(value: any | Armature | null, index?: number): void; + /** + * - Check whether a specific point is inside a custom bounding box in the slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + containsPoint(x: number, y: number): boolean; + /** + * - Check whether a specific segment intersects a custom bounding box for the slot. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] + * @version DragonBones 5.0 + * @language zh_CN + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + /** + * @private + */ + getDisplayFrameAt(index: number): DisplayFrame; + /** + * - The visible of slot's display object. + * @default true + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 插槽的显示对象的可见。 + * @default true + * @version DragonBones 5.6 + * @language zh_CN + */ + visible: boolean; + /** + * @private + */ + displayFrameCount: number; + /** + * - The index of the display object displayed in the display list. + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     slot.displayIndex = 3;
+         *     slot.displayController = "none";
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 此时显示的显示对象在显示列表中的索引。 + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     slot.displayIndex = 3;
+         *     slot.displayController = "none";
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + displayIndex: number; + /** + * - The slot name. + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - Contains a display list of display objects or child armatures. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + * @language zh_CN + */ + displayList: Array; + /** + * - The slot data. + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 插槽数据。 + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly slotData: SlotData; + /** + * - The custom bounding box data for the slot at current time. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 插槽此时的自定义包围盒数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly boundingBoxData: BoundingBoxData | null; + /** + * @private + */ + readonly rawDisplay: any; + /** + * @private + */ + readonly meshDisplay: any; + /** + * - The display object that the slot displays at this time. + * @example + *
+         *     let slot = armature.getSlot("text");
+         *     slot.display = new yourEngine.TextField();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的显示对象。 + * @example + *
+         *     let slot = armature.getSlot("text");
+         *     slot.display = new yourEngine.TextField();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + display: any; + /** + * - The child armature that the slot displayed at current time. + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
+         *     }
+         *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的子骨架。 + * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
+         *     }
+         *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + childArmature: Armature | null; + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly parent: Bone; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + getDisplay(): any; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + setDisplay(value: any): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Play animation interface. (Both Armature and Wordclock implement the interface) + * Any instance that implements the interface can be added to the Worldclock instance and advance time by Worldclock instance uniformly. + * @see dragonBones.WorldClock + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放动画接口。 (Armature 和 WordClock 都实现了该接口) + * 任何实现了此接口的实例都可以添加到 WorldClock 实例中,由 WorldClock 实例统一更新时间。 + * @see dragonBones.WorldClock + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + interface IAnimatable { + /** + * - Advance time. + * @param passedTime - Passed time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 更新时间。 + * @param passedTime - 前进的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + advanceTime(passedTime: number): void; + /** + * - The Wordclock instance to which the current belongs. + * @example + *
+         *     armature.clock = factory.clock; // Add armature to clock.
+         *     armature.clock = null; // Remove armature from clock.
+         * 
+ * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 当前所属的 WordClock 实例。 + * @example + *
+         *     armature.clock = factory.clock; // 将骨架添加到时钟。
+         *     armature.clock = null; // 将骨架从时钟移除。
+         * 
+ * @version DragonBones 5.0 + * @language zh_CN + */ + clock: WorldClock | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + class WorldClock implements IAnimatable { + /** + * - Current time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + time: number; + /** + * - The play speed, used to control animation speed-shift play. + * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度,用于控制动画变速播放。 + * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + private _systemTime; + private readonly _animatebles; + private _clock; + /** + * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. + * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 + * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(time?: number); + /** + * - Advance time for all IAnimatable instances. + * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 为所有的 IAnimatable 实例更新时间。 + * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + advanceTime(passedTime: number): void; + /** + * - Check whether contains a specific instance of IAnimatable. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + contains(value: IAnimatable): boolean; + /** + * - Add IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + add(value: IAnimatable): void; + /** + * - Removes a specified IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + remove(value: IAnimatable): void; + /** + * - Clear all IAnimatable instances. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + clear(): void; + /** + * @inheritDoc + */ + clock: WorldClock | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation player is used to play the animation data and manage the animation states. + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器用来播放动画数据和管理动画状态。 + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + class Animation extends BaseObject { + static toString(): string; + /** + * - The play speed of all animations. [0: Stop, (0~1): Slow, 1: Normal, (1~N): Fast] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有动画的播放速度。 [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * Update bones and slots cachedFrameIndices. + */ + private _animationDirty; + private _inheritTimeScale; + private readonly _animationNames; + private readonly _animationStates; + private readonly _animations; + private readonly _blendStates; + private _armature; + private _animationConfig; + private _lastAnimationState; + protected _onClear(): void; + private _fadeOut; + /** + * - Clear all animations states. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除所有的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + reset(): void; + /** + * - Pause a specific animation state. + * @param animationName - The name of animation state. (If not set, it will pause all animations) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停指定动画状态的播放。 + * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + stop(animationName?: string | null): void; + /** + * - Play animation with a specific animation config. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @param animationConfig - The animation config. + * @returns The playing animation state. + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 通过指定的动画配置来播放动画。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @param animationConfig - 动画配置。 + * @returns 播放的动画状态。 + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + playConfig(animationConfig: AnimationConfig): AnimationState | null; + /** + * - Play a specific animation. + * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) + * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放指定动画。 + * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + play(animationName?: string | null, playTimes?: number): AnimationState | null; + /** + * - Fade in a specific animation. + * @param animationName - The name of animation data. + * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) + * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) + * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) + * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 淡入播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) + * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) + * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + fadeIn(animationName: string, fadeInTime?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode): AnimationState | null; + /** + * - Play a specific animation from the specific time. + * @param animationName - The name of animation data. + * @param time - The start time point of playing. (In seconds) + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定时间开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param time - 播放开始的时间。 (以秒为单位) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByTime(animationName: string, time?: number, playTimes?: number): AnimationState | null; + /** + * - Play a specific animation from the specific frame. + * @param animationName - The name of animation data. + * @param frame - The start frame of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定帧开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param frame - 播放开始的帧数。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByFrame(animationName: string, frame?: number, playTimes?: number): AnimationState | null; + /** + * - Play a specific animation from the specific progress. + * @param animationName - The name of animation data. + * @param progress - The start progress value of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定进度开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param progress - 开始播放的进度。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByProgress(animationName: string, progress?: number, playTimes?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific time. + * @param animationName - The name of animation data. + * @param time - The stop time. (In seconds) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定时间停止指定动画播放 + * @param animationName - 动画数据名称。 + * @param time - 停止的时间。 (以秒为单位) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByTime(animationName: string, time?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific frame. + * @param animationName - The name of animation data. + * @param frame - The stop frame. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定帧停止指定动画的播放 + * @param animationName - 动画数据名称。 + * @param frame - 停止的帧数。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByFrame(animationName: string, frame?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific progress. + * @param animationName - The name of animation data. + * @param progress - The stop progress value. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定的进度停止指定的动画播放。 + * @param animationName - 动画数据名称。 + * @param progress - 停止进度。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByProgress(animationName: string, progress?: number): AnimationState | null; + /** + * - Get a specific animation state. + * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取指定的动画状态。 + * @param animationName - 动画状态名称。 + * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + getState(animationName: string, layer?: number): AnimationState | null; + /** + * - Check whether a specific animation data is included. + * @param animationName - The name of animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含指定的动画数据 + * @param animationName - 动画数据名称。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + hasAnimation(animationName: string): boolean; + /** + * - Get all the animation states. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取所有的动画状态 + * @version DragonBones 5.1 + * @language zh_CN + */ + getStates(): ReadonlyArray; + /** + * - Check whether there is an animation state is playing + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否有动画状态正在播放 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isPlaying: boolean; + /** + * - Check whether all the animation states' playing were finished. + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否所有的动画状态均已播放完毕。 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isCompleted: boolean; + /** + * - The name of the last playing animation state. + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态名称 + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly lastAnimationName: string; + /** + * - The name of all animation data + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有动画数据的名称 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly animationNames: ReadonlyArray; + /** + * - All animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有的动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + animations: Map; + /** + * - An AnimationConfig instance that can be used quickly. + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 一个可以快速使用的动画配置实例。 + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly animationConfig: AnimationConfig; + /** + * - The last playing animation state + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly lastAnimationState: AnimationState | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation state is generated when the animation data is played. + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画状态由播放动画数据时产生。 + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + class AnimationState extends BaseObject { + static toString(): string; + /** + * @private + */ + actionEnabled: boolean; + /** + * @private + */ + additive: boolean; + /** + * - Whether the animation state has control over the display object properties of the slots. + * Sometimes blend a animation state does not want it to control the display object properties of the slots, + * especially if other animation state are controlling the display object properties of the slots. + * @default true + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态是否对插槽的显示对象属性有控制权。 + * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, + * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 + * @default true + * @version DragonBones 5.0 + * @language zh_CN + */ + displayControl: boolean; + /** + * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. + * This property should usually be set to false when blend multiple animation states. + * @default true + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 + * 通常在混合多个动画状态时应该将该属性设置为 false。 + * @default true + * @version DragonBones 5.1 + * @language zh_CN + */ + resetToPose: boolean; + /** + * @private + */ + blendType: AnimationBlendType; + /** + * - The play times. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The blend layer. + * High layer animation state will get the blend weight first. + * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合图层。 + * 图层高的动画状态会优先获取混合权重。 + * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + layer: number; + /** + * - The play speed. + * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. + * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度。 + * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 + * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * @private + */ + parameterX: number; + /** + * @private + */ + parameterY: number; + /** + * @private + */ + positionX: number; + /** + * @private + */ + positionY: number; + /** + * - The auto fade out time when the animation state play completed. + * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态播放完成后的自动淡出时间。 + * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + autoFadeOutTime: number; + /** + * @private + */ + fadeTotalTime: number; + /** + * - The name of the animation state. (Can be different from the name of the animation data) + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态名称。 (可以不同于动画数据) + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + name: string; + /** + * - The blend group name of the animation state. + * This property is typically used to specify the substitution of multiple animation states blend. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合组名称。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + group: string; + private _timelineDirty; + private _weight; + private _fadeTime; + private _time; + private readonly _boneMask; + private readonly _boneTimelines; + private readonly _boneBlendTimelines; + private readonly _slotTimelines; + private readonly _slotBlendTimelines; + private readonly _constraintTimelines; + private readonly _animationTimelines; + private readonly _poseTimelines; + private _animationData; + private _armature; + private _zOrderTimeline; + private _activeChildA; + private _activeChildB; + protected _onClear(): void; + private _updateTimelines; + private _updateBoneAndSlotTimelines; + private _advanceFadeTime; + /** + * - Continue play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 继续播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + play(): void; + /** + * - Stop play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + stop(): void; + /** + * - Fade out the animation state. + * @param fadeOutTime - The fade out time. (In seconds) + * @param pausePlayhead - Whether to pause the animation playing when fade out. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 淡出动画状态。 + * @param fadeOutTime - 淡出时间。 (以秒为单位) + * @param pausePlayhead - 淡出时是否暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + fadeOut(fadeOutTime: number, pausePlayhead?: boolean): void; + /** + * - Check if a specific bone mask is included. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + containsBoneMask(boneName: string): boolean; + /** + * - Add a specific bone mask. + * @param boneName - The bone name. + * @param recursive - Whether or not to add a mask to the bone's sub-bone. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加特定的骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + addBoneMask(boneName: string, recursive?: boolean): void; + /** + * - Remove the mask of a specific bone. + * @param boneName - The bone name. + * @param recursive - Whether to remove the bone's sub-bone mask. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除特定骨骼的遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + removeBoneMask(boneName: string, recursive?: boolean): void; + /** + * - Remove all bone masks. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + removeAllBoneMask(): void; + /** + * @private + */ + addState(animationState: AnimationState, timelineDatas?: TimelineData[] | null): void; + /** + * - Whether the animation state is fading in. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡入。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeIn: boolean; + /** + * - Whether the animation state is fading out. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡出。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeOut: boolean; + /** + * - Whether the animation state is fade completed. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否淡入或淡出完毕。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeComplete: boolean; + /** + * - Whether the animation state is playing. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否正在播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isPlaying: boolean; + /** + * - Whether the animation state is play completed. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否播放完毕。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isCompleted: boolean; + /** + * - The times has been played. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 已经循环播放的次数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly currentPlayTimes: number; + /** + * - The total time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 总播放时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly totalTime: number; + /** + * - The time is currently playing. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前播放的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + currentTime: number; + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + /** + * - The animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + weight: number; + /** + * - 动画数据。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animationData: AnimationData; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The properties of the object carry basic information about an event, + * which are passed as parameter or parameter's parameter to event listeners when an event occurs. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 + * @version DragonBones 4.5 + * @language zh_CN + */ + class EventObject extends BaseObject { + /** + * - Animation start play. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画开始播放。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly START: string; + /** + * - Animation loop play complete once. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画循环播放完成一次。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly LOOP_COMPLETE: string; + /** + * - Animation play complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画播放完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly COMPLETE: string; + /** + * - Animation fade in start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_IN: string; + /** + * - Animation fade in complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_IN_COMPLETE: string; + /** + * - Animation fade out start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_OUT: string; + /** + * - Animation fade out complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_OUT_COMPLETE: string; + /** + * - Animation frame event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FRAME_EVENT: string; + /** + * - Animation frame sound event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧声音事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly SOUND_EVENT: string; + static toString(): string; + /** + * - If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 如果是帧事件,此值用来描述该事件在动画时间轴中所处的时间。(以秒为单位) + * @version DragonBones 4.5 + * @language zh_CN + */ + time: number; + /** + * - The event type。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件类型。 + * @version DragonBones 4.5 + * @language zh_CN + */ + type: EventStringType; + /** + * - The event name. (The frame event name or the frame sound name) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件名称。 (帧事件的名称或帧声音的名称) + * @version DragonBones 4.5 + * @language zh_CN + */ + name: string; + /** + * - The armature that dispatch the event. + * @see dragonBones.Armature + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的骨架。 + * @see dragonBones.Armature + * @version DragonBones 4.5 + * @language zh_CN + */ + armature: Armature; + /** + * - The bone that dispatch the event. + * @see dragonBones.Bone + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 4.5 + * @language zh_CN + */ + bone: Bone | null; + /** + * - The slot that dispatch the event. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + slot: Slot | null; + /** + * - The animation state that dispatch the event. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + animationState: AnimationState; + /** + * @private + */ + actionData: ActionData | null; + /** + * @private + */ + /** + * - The custom data. + * @see dragonBones.CustomData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义数据。 + * @see dragonBones.CustomData + * @version DragonBones 5.0 + * @language zh_CN + */ + data: UserData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + type EventStringType = string | "start" | "loopComplete" | "complete" | "fadeIn" | "fadeInComplete" | "fadeOut" | "fadeOutComplete" | "frameEvent" | "soundEvent"; + /** + * - The event dispatcher interface. + * Dragonbones event dispatch usually relies on docking engine to implement, which defines the event method to be implemented when docking the engine. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件派发接口。 + * DragonBones 的事件派发通常依赖于对接的引擎来实现,该接口定义了对接引擎时需要实现的事件方法。 + * @version DragonBones 4.5 + * @language zh_CN + */ + interface IEventDispatcher { + /** + * - Checks whether the object has any listeners registered for a specific type of event。 + * @param type - Event type. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 检查是否为特定的事件类型注册了任何侦听器。 + * @param type - 事件类型。 + * @version DragonBones 4.5 + * @language zh_CN + */ + hasDBEventListener(type: EventStringType): boolean; + /** + * - Dispatches an event into the event flow. + * @param type - Event type. + * @param eventObject - Event object. + * @see dragonBones.EventObject + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分派特定的事件到事件流中。 + * @param type - 事件类型。 + * @param eventObject - 事件数据。 + * @see dragonBones.EventObject + * @version DragonBones 4.5 + * @language zh_CN + */ + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + /** + * - Add an event listener object so that the listener receives notification of an event. + * @param type - Event type. + * @param listener - Event listener. + * @param thisObject - The listener function's "this". + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 添加特定事件类型的事件侦听器,以使侦听器能够接收事件通知。 + * @param type - 事件类型。 + * @param listener - 事件侦听器。 + * @param thisObject - 侦听函数绑定的 this 对象。 + * @version DragonBones 4.5 + * @language zh_CN + */ + addDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; + /** + * - Removes a listener from the object. + * @param type - Event type. + * @param listener - Event listener. + * @param thisObject - The listener function's "this". + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 删除特定事件类型的侦听器。 + * @param type - 事件类型。 + * @param listener - 事件侦听器。 + * @param thisObject - 侦听函数绑定的 this 对象。 + * @version DragonBones 4.5 + * @language zh_CN + */ + removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + abstract class DataParser { + protected static readonly DATA_VERSION_2_3: string; + protected static readonly DATA_VERSION_3_0: string; + protected static readonly DATA_VERSION_4_0: string; + protected static readonly DATA_VERSION_4_5: string; + protected static readonly DATA_VERSION_5_0: string; + protected static readonly DATA_VERSION_5_5: string; + protected static readonly DATA_VERSION_5_6: string; + protected static readonly DATA_VERSION: string; + protected static readonly DATA_VERSIONS: Array; + protected static readonly TEXTURE_ATLAS: string; + protected static readonly SUB_TEXTURE: string; + protected static readonly FORMAT: string; + protected static readonly IMAGE_PATH: string; + protected static readonly WIDTH: string; + protected static readonly HEIGHT: string; + protected static readonly ROTATED: string; + protected static readonly FRAME_X: string; + protected static readonly FRAME_Y: string; + protected static readonly FRAME_WIDTH: string; + protected static readonly FRAME_HEIGHT: string; + protected static readonly DRADON_BONES: string; + protected static readonly USER_DATA: string; + protected static readonly ARMATURE: string; + protected static readonly CANVAS: string; + protected static readonly BONE: string; + protected static readonly SURFACE: string; + protected static readonly SLOT: string; + protected static readonly CONSTRAINT: string; + protected static readonly SKIN: string; + protected static readonly DISPLAY: string; + protected static readonly FRAME: string; + protected static readonly IK: string; + protected static readonly PATH_CONSTRAINT: string; + protected static readonly ANIMATION: string; + protected static readonly TIMELINE: string; + protected static readonly FFD: string; + protected static readonly TRANSLATE_FRAME: string; + protected static readonly ROTATE_FRAME: string; + protected static readonly SCALE_FRAME: string; + protected static readonly DISPLAY_FRAME: string; + protected static readonly COLOR_FRAME: string; + protected static readonly DEFAULT_ACTIONS: string; + protected static readonly ACTIONS: string; + protected static readonly EVENTS: string; + protected static readonly INTS: string; + protected static readonly FLOATS: string; + protected static readonly STRINGS: string; + protected static readonly TRANSFORM: string; + protected static readonly PIVOT: string; + protected static readonly AABB: string; + protected static readonly COLOR: string; + protected static readonly VERSION: string; + protected static readonly COMPATIBLE_VERSION: string; + protected static readonly FRAME_RATE: string; + protected static readonly TYPE: string; + protected static readonly SUB_TYPE: string; + protected static readonly NAME: string; + protected static readonly PARENT: string; + protected static readonly TARGET: string; + protected static readonly STAGE: string; + protected static readonly SHARE: string; + protected static readonly PATH: string; + protected static readonly LENGTH: string; + protected static readonly DISPLAY_INDEX: string; + protected static readonly Z_ORDER: string; + protected static readonly Z_INDEX: string; + protected static readonly BLEND_MODE: string; + protected static readonly INHERIT_TRANSLATION: string; + protected static readonly INHERIT_ROTATION: string; + protected static readonly INHERIT_SCALE: string; + protected static readonly INHERIT_REFLECTION: string; + protected static readonly INHERIT_ANIMATION: string; + protected static readonly INHERIT_DEFORM: string; + protected static readonly SEGMENT_X: string; + protected static readonly SEGMENT_Y: string; + protected static readonly BEND_POSITIVE: string; + protected static readonly CHAIN: string; + protected static readonly WEIGHT: string; + protected static readonly BLEND_TYPE: string; + protected static readonly FADE_IN_TIME: string; + protected static readonly PLAY_TIMES: string; + protected static readonly SCALE: string; + protected static readonly OFFSET: string; + protected static readonly POSITION: string; + protected static readonly DURATION: string; + protected static readonly TWEEN_EASING: string; + protected static readonly TWEEN_ROTATE: string; + protected static readonly TWEEN_SCALE: string; + protected static readonly CLOCK_WISE: string; + protected static readonly CURVE: string; + protected static readonly SOUND: string; + protected static readonly EVENT: string; + protected static readonly ACTION: string; + protected static readonly X: string; + protected static readonly Y: string; + protected static readonly SKEW_X: string; + protected static readonly SKEW_Y: string; + protected static readonly SCALE_X: string; + protected static readonly SCALE_Y: string; + protected static readonly VALUE: string; + protected static readonly ROTATE: string; + protected static readonly SKEW: string; + protected static readonly ALPHA: string; + protected static readonly ALPHA_OFFSET: string; + protected static readonly RED_OFFSET: string; + protected static readonly GREEN_OFFSET: string; + protected static readonly BLUE_OFFSET: string; + protected static readonly ALPHA_MULTIPLIER: string; + protected static readonly RED_MULTIPLIER: string; + protected static readonly GREEN_MULTIPLIER: string; + protected static readonly BLUE_MULTIPLIER: string; + protected static readonly UVS: string; + protected static readonly VERTICES: string; + protected static readonly TRIANGLES: string; + protected static readonly WEIGHTS: string; + protected static readonly SLOT_POSE: string; + protected static readonly BONE_POSE: string; + protected static readonly BONES: string; + protected static readonly POSITION_MODE: string; + protected static readonly SPACING_MODE: string; + protected static readonly ROTATE_MODE: string; + protected static readonly SPACING: string; + protected static readonly ROTATE_OFFSET: string; + protected static readonly ROTATE_MIX: string; + protected static readonly TRANSLATE_MIX: string; + protected static readonly TARGET_DISPLAY: string; + protected static readonly CLOSED: string; + protected static readonly CONSTANT_SPEED: string; + protected static readonly VERTEX_COUNT: string; + protected static readonly LENGTHS: string; + protected static readonly GOTO_AND_PLAY: string; + protected static readonly DEFAULT_NAME: string; + protected static _getArmatureType(value: string): ArmatureType; + protected static _getBoneType(value: string): BoneType; + protected static _getPositionMode(value: string): PositionMode; + protected static _getSpacingMode(value: string): SpacingMode; + protected static _getRotateMode(value: string): RotateMode; + protected static _getDisplayType(value: string): DisplayType; + protected static _getBoundingBoxType(value: string): BoundingBoxType; + protected static _getBlendMode(value: string): BlendMode; + protected static _getAnimationBlendType(value: string): AnimationBlendType; + protected static _getActionType(value: string): ActionType; + abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null; + abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + const enum FrameValueType { + Step = 0, + Int = 1, + Float = 2 + } + /** + * @private + */ + class ObjectDataParser extends DataParser { + protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean; + protected static _getNumber(rawData: any, key: string, defaultValue: number): number; + protected static _getString(rawData: any, key: string, defaultValue: string): string; + protected _rawTextureAtlasIndex: number; + protected readonly _rawBones: Array; + protected _data: DragonBonesData; + protected _armature: ArmatureData; + protected _bone: BoneData; + protected _geometry: GeometryData; + protected _slot: SlotData; + protected _skin: SkinData; + protected _mesh: MeshDisplayData; + protected _animation: AnimationData; + protected _timeline: TimelineData; + protected _rawTextureAtlases: Array | null; + private _frameValueType; + private _defaultColorOffset; + private _prevClockwise; + private _prevRotation; + private _frameDefaultValue; + private _frameValueScale; + private readonly _helpMatrixA; + private readonly _helpMatrixB; + private readonly _helpTransform; + private readonly _helpColorTransform; + private readonly _helpPoint; + private readonly _helpArray; + private readonly _intArray; + private readonly _floatArray; + private readonly _frameIntArray; + private readonly _frameFloatArray; + private readonly _frameArray; + private readonly _timelineArray; + private readonly _colorArray; + private readonly _cacheRawMeshes; + private readonly _cacheMeshes; + private readonly _actionFrames; + private readonly _weightSlotPose; + private readonly _weightBonePoses; + private readonly _cacheBones; + private readonly _slotChildActions; + private _getCurvePoint; + private _samplingEasingCurve; + private _parseActionDataInFrame; + private _mergeActionFrame; + protected _parseArmature(rawData: any, scale: number): ArmatureData; + protected _parseBone(rawData: any): BoneData; + protected _parseIKConstraint(rawData: any): ConstraintData | null; + protected _parsePathConstraint(rawData: any): ConstraintData | null; + protected _parseSlot(rawData: any, zOrder: number): SlotData; + protected _parseSkin(rawData: any): SkinData; + protected _parseDisplay(rawData: any): DisplayData | null; + protected _parsePath(rawData: any, display: PathDisplayData): void; + protected _parsePivot(rawData: any, display: ImageDisplayData): void; + protected _parseMesh(rawData: any, mesh: MeshDisplayData): void; + protected _parseBoundingBox(rawData: any): BoundingBoxData | null; + protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData; + protected _parseAnimation(rawData: any): AnimationData; + protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, timelineType: TimelineType, frameValueType: FrameValueType, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number, timeline?: TimelineData | null): TimelineData | null; + protected _parseBoneTimeline(rawData: any): void; + protected _parseSlotTimeline(rawData: any): void; + protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSingleValueFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseDoubleValueFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number; + protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotDeformFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array; + protected _parseDeformFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseTransform(rawData: any, transform: Transform, scale: number): void; + protected _parseColorTransform(rawData: any, color: ColorTransform): void; + protected _parseGeometry(rawData: any, geometry: GeometryData): void; + protected _parseArray(rawData: any): void; + protected _modifyArray(): void; + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null; + parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale?: number): boolean; + private static _objectDataParserInstance; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + static getInstance(): ObjectDataParser; + } + /** + * @private + */ + class ActionFrame { + frameStart: number; + readonly actions: Array; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class BinaryDataParser extends ObjectDataParser { + private _binaryOffset; + private _binary; + private _intArrayBuffer; + private _frameArrayBuffer; + private _timelineArrayBuffer; + private _inRange; + private _decodeUTF8; + private _parseBinaryTimeline; + protected _parseAnimation(rawData: any): AnimationData; + protected _parseGeometry(rawData: any, geometry: GeometryData): void; + protected _parseArray(rawData: any): void; + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null; + private static _binaryDataParserInstance; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + static getInstance(): BinaryDataParser; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) + * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. + * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) + * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 + * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class BaseFactory { + protected static _objectParser: ObjectDataParser; + protected static _binaryParser: BinaryDataParser; + /** + * @private + */ + autoSearch: boolean; + protected readonly _dragonBonesDataMap: Map; + protected readonly _textureAtlasDataMap: Map>; + protected _dragonBones: DragonBones; + protected _dataParser: DataParser; + /** + * - Create a factory instance. (typically only one global factory instance is required) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(dataParser?: DataParser | null); + protected _isSupportMesh(): boolean; + protected _getTextureData(textureAtlasName: string, textureName: string): TextureData | null; + protected _fillBuildArmaturePackage(dataPackage: BuildArmaturePackage, dragonBonesName: string, armatureName: string, skinName: string, textureAtlasName: string): boolean; + protected _buildBones(dataPackage: BuildArmaturePackage, armature: Armature): void; + /** + * @private + */ + protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void; + protected _buildConstraints(dataPackage: BuildArmaturePackage, armature: Armature): void; + protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, _slot: Slot, displayData: ArmatureDisplayData): Armature | null; + protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, slot: Slot): any; + protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData; + protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature; + protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot; + /** + * - Parse the raw data to a DragonBonesData instance and cache it to the factory. + * @param rawData - The raw data. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for all armatures. (Default: 1.0) + * @returns DragonBonesData instance + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 + * @param rawData - 原始数据。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) + * @returns DragonBonesData 实例 + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language zh_CN + */ + parseDragonBonesData(rawData: any, name?: string | null, scale?: number): DragonBonesData | null; + /** + * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. + * @param rawData - The raw texture atlas data. + * @param textureAtlas - The texture atlas object. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for the map set. (Default: 1.0) + * @returns TextureAtlasData instance + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 + * @param rawData - 原始贴图集数据。 + * @param textureAtlas - 贴图集对象。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) + * @returns TextureAtlasData 实例 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language zh_CN + */ + parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData; + /** + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN + */ + updateTextureAtlases(textureAtlases: Array, name: string): void; + /** + * - Get a specific DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @returns DragonBonesData instance + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 DragonBonesData 实例。 + * @param name - DragonBonesData 实例的缓存名称。 + * @returns DragonBonesData 实例 + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + getDragonBonesData(name: string): DragonBonesData | null; + /** + * - Cache a DragonBonesData instance to the factory. + * @param data - The DragonBonesData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 DragonBonesData 实例缓存到工厂中。 + * @param data - DragonBonesData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + addDragonBonesData(data: DragonBonesData, name?: string | null): void; + /** + * - Remove a DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @param disposeData - Whether to dispose data. (Default: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 DragonBonesData 实例。 + * @param name - DragonBonesData 实例缓存名称。 + * @param disposeData - 是否释放数据。 (默认: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + removeDragonBonesData(name: string, disposeData?: boolean): void; + /** + * - Get a list of specific TextureAtlasData instances. + * @param name - The TextureAtlasData cahce name. + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 TextureAtlasData 实例列表。 + * @param name - TextureAtlasData 实例缓存名称。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + getTextureAtlasData(name: string): Array | null; + /** + * - Cache a TextureAtlasData instance to the factory. + * @param data - The TextureAtlasData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 TextureAtlasData 实例缓存到工厂中。 + * @param data - TextureAtlasData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + addTextureAtlasData(data: TextureAtlasData, name?: string | null): void; + /** + * - Remove a TextureAtlasData instance. + * @param name - The TextureAtlasData instance cache name. + * @param disposeData - Whether to dispose data. + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 TextureAtlasData 实例。 + * @param name - TextureAtlasData 实例的缓存名称。 + * @param disposeData - 是否释放数据。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + removeTextureAtlasData(name: string, disposeData?: boolean): void; + /** + * - Get a specific armature data. + * @param name - The armature data name. + * @param dragonBonesName - The cached name for DragonbonesData instance. + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param name - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language zh_CN + */ + getArmatureData(name: string, dragonBonesName?: string): ArmatureData | null; + /** + * - Clear all cached DragonBonesData instances and TextureAtlasData instances. + * @param disposeData - Whether to dispose data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 + * @param disposeData - 是否释放数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + clear(disposeData?: boolean): void; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. + * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature. + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 + * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架。 + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + buildArmature(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): Armature | null; + /** + * @private + */ + replaceDisplay(slot: Slot, displayData: DisplayData | null, displayIndex?: number): void; + /** + * - Replaces the current display data for a particular slot with a specific display data. + * Specify display data with "dragonBonesName/armatureName/slotName/displayName". + * @param dragonBonesName - The DragonBonesData instance cache name. + * @param armatureName - The armature data name. + * @param slotName - The slot data name. + * @param displayName - The display data name. + * @param slot - The slot. + * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 + * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @param armatureName - 骨架数据名称。 + * @param slotName - 插槽数据名称。 + * @param displayName - 显示对象数据名称。 + * @param slot - 插槽。 + * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + replaceSlotDisplay(dragonBonesName: string, armatureName: string, slotName: string, displayName: string, slot: Slot, displayIndex?: number): boolean; + /** + * @private + */ + replaceSlotDisplayList(dragonBonesName: string | null, armatureName: string, slotName: string, slot: Slot): boolean; + /** + * - Share specific skin data with specific armature. + * @param armature - The armature. + * @param skin - The skin data. + * @param isOverride - Whether it completely override the original skin. (Default: false) + * @param exclude - A list of slot names that do not need to be replace. + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 将特定的皮肤数据共享给特定的骨架使用。 + * @param armature - 骨架。 + * @param skin - 皮肤数据。 + * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) + * @param exclude - 不需要被替换的插槽名称列表。 + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language zh_CN + */ + replaceSkin(armature: Armature, skin: SkinData, isOverride?: boolean, exclude?: Array | null): boolean; + /** + * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. + * This enables you to make a armature template so that other armature without animations can share it's animations. + * @param armature - The armtaure. + * @param armatureData - The armature data. + * @param isOverride - Whether to completely overwrite the original animation. (Default: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 + * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 + * @param armature - 骨架。 + * @param armatureData - 骨架数据。 + * @param isOverride - 是否完全覆盖原来的动画。(默认: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language zh_CN + */ + replaceAnimation(armature: Armature, armatureData: ArmatureData, isOverride?: boolean): boolean; + /** + * @private + */ + getAllDragonBonesData(): Map; + /** + * @private + */ + getAllTextureAtlasData(): Map>; + /** + * - An Worldclock instance updated by engine. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 由引擎驱动的 WorldClock 实例。 + * @version DragonBones 5.7 + * @language zh_CN + */ + readonly clock: WorldClock; + /** + * @private + */ + readonly dragonBones: DragonBones; + } + /** + * @private + */ + class BuildArmaturePackage { + dataName: string; + textureAtlasName: string; + data: DragonBonesData; + armature: ArmatureData; + skin: SkinData | null; + } +} +declare namespace dragonBones.phaser.util { + class EventDispatcher extends Phaser.Events.EventEmitter implements IEventDispatcher { + hasDBEventListener(type: EventStringType): boolean; + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + addDBEventListener(type: EventStringType, listener: (e: EventObject) => void, thisObject?: any): void; + removeDBEventListener(type: EventStringType, listener: (e: EventObject) => void, thisObject?: any): void; + } +} +declare namespace dragonBones.phaser.util { + const Skew: { + getSkewX(): number; + setSkewX(v: number): void; + getSkewY(): number; + setSkewY(v: number): void; + setSkew(sx: number, sy?: number): void; + }; + const extendSkew: (clazz: any) => void; +} +declare namespace dragonBones.phaser.util { + class TransformMatrix extends Phaser.GameObjects.Components.TransformMatrix { + constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number); + decomposeMatrix(): any; + applyITRSC(x: number, y: number, rotation: number, scaleX: number, scaleY: number, skewX: number, skewY: number): this; + readonly skewX: number; + readonly skewY: number; + } +} +declare namespace dragonBones.phaser.display { + class DisplayContainer extends Phaser.GameObjects.Container { + private _skewX; + private _skewY; + private tempTransformMatrix; + constructor(scene: Phaser.Scene, x?: number, y?: number, children?: Phaser.GameObjects.GameObject[]); + pointToContainer(source: Phaser.Math.Vector2 | Phaser.Geom.Point | { + x?: number; + y?: number; + }, output?: Phaser.Math.Vector2 | Phaser.Geom.Point | { + x?: number; + y?: number; + }): Phaser.Math.Vector2 | Phaser.Geom.Point | { + x?: number; + y?: number; + }; + skewX: number; + skewY: number; + setSkew(sx: number, sy?: number): this; + } +} +declare namespace dragonBones.phaser.display { + class ArmatureDisplay extends DisplayContainer implements IArmatureProxy { + debugDraw: boolean; + private _armature; + constructor(scene: Phaser.Scene); + dbInit(armature: Armature): void; + dbClear(): void; + dbUpdate(): void; + dispose(disposeProxy: boolean): void; + destroy(): void; + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + hasDBEventListener(type: EventStringType): boolean; + addDBEventListener(type: EventStringType, listener: (event: EventObject) => void, scope?: any): void; + removeDBEventListener(type: EventStringType, listener: (event: EventObject) => void, scope?: any): void; + readonly armature: Armature; + readonly animation: Animation; + } +} +declare namespace dragonBones.phaser.display { + class SlotImage extends Phaser.GameObjects.Image { + constructor(scene: Phaser.Scene, x: number, y: number, texture?: string, frame?: string | number); + } +} +declare namespace dragonBones.phaser.display { + class SlotSprite extends Phaser.GameObjects.Sprite { + constructor(scene: Phaser.Scene, x: number, y: number, texture?: string, frame?: string | number); + } +} +declare namespace dragonBones.phaser.display { + class Slot extends dragonBones.Slot { + static toString(): string; + private _textureScale; + private _renderDisplay; + protected _onClear(): void; + protected _initDisplay(rawDisplay: any, isRetain: boolean): void; + protected _disposeDisplay(prevDisplay: any, isRelease: boolean): void; + protected _onUpdateDisplay(): void; + protected _addDisplay(): void; + protected _replaceDisplay(prevDisplay: any): void; + protected _removeDisplay(): void; + protected _updateZOrder(): void; + _updateVisible(): void; + protected _updateBlendMode(): void; + protected _updateColor(): void; + protected _updateFrame(): void; + protected _updateMesh(): void; + protected _updateTransform(): void; + protected _identityTransform(): void; + } +} +declare namespace dragonBones.phaser.display { + class TextureAtlasData extends dragonBones.TextureAtlasData { + static toString(): string; + private _renderTexture; + protected _onClear(): void; + createTexture(): TextureData; + renderTexture: Phaser.Textures.Texture; + } + class TextureData extends dragonBones.TextureData { + static toString(): string; + renderTexture: Phaser.Textures.Frame; + protected _onClear(): void; + } +} +declare namespace dragonBones.phaser.pipeline { + class TextureTintPipeline extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline { + private _tempMatrix1; + private _tempMatrix2; + private _tempMatrix3; + constructor(config: any); + batchSprite(sprite: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + } +} +declare namespace dragonBones.phaser.plugin { + interface FileTypeClass { + new (...args: any[]): Phaser.Loader.File; + } + const FileTypes: { + IMAGE: string; + JSON: string; + BINARY: string; + map: { + imageFile: typeof Phaser.Loader.FileTypes.ImageFile; + jsonFile: typeof Phaser.Loader.FileTypes.JSONFile; + binaryFile: typeof Phaser.Loader.FileTypes.BinaryFile; + }; + setType: (type: string, clazz: FileTypeClass) => void; + getType: (type: string) => FileTypeClass; + }; +} +declare namespace dragonBones.phaser.plugin { + class DragonBonesFile extends Phaser.Loader.MultiFile { + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | object, textureURL?: string, atlasURL?: string, boneURL?: string, textureXhrSettings?: XHRSettingsObject, atlasXhrSettings?: XHRSettingsObject, boneXhrSettings?: XHRSettingsObject); + addToCache(): void; + } +} +declare namespace dragonBones.phaser.plugin { + class DragonBonesScenePlugin extends Phaser.Plugins.ScenePlugin { + protected _dbInst: dragonBones.DragonBones; + protected _factory: Factory; + constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager); + createArmature(armature: string, dragonBones?: string, skinName?: string, atlasTextureName?: string, textureScale?: number): display.ArmatureDisplay; + readonly factory: Factory; + createSlotDisplayPlaceholder(): display.SlotImage | display.SlotSprite; + boot(): void; + start(): void; + private update; + shutdown(): void; + destroy(): void; + } +} +declare namespace dragonBones.phaser { + class Factory extends BaseFactory { + protected _scene: Phaser.Scene; + protected _dragonBones: DragonBones; + constructor(dragonBones: DragonBones, scene: Phaser.Scene, dataParser?: DataParser); + protected _isSupportMesh(): boolean; + protected _buildTextureAtlasData(textureAtlasData: display.TextureAtlasData, textureAtlas: Phaser.Textures.Texture): TextureAtlasData; + protected _buildArmature(dataPackage: BuildArmaturePackage): Armature; + protected _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot; + buildArmatureDisplay(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string, textureScale?: number): display.ArmatureDisplay; + } +} diff --git a/Phaser/Demos/libs/dragonBones/dragonBones.js b/Phaser/Demos/libs/dragonBones/dragonBones.js new file mode 100644 index 00000000..73c3a699 --- /dev/null +++ b/Phaser/Demos/libs/dragonBones/dragonBones.js @@ -0,0 +1,16088 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DragonBones = /** @class */ (function () { + function DragonBones(eventManager) { + this._clock = new dragonBones.WorldClock(); + this._events = []; + this._objects = []; + this._eventManager = null; + this._eventManager = eventManager; + console.info("DragonBones: " + DragonBones.VERSION + "\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/"); + } + DragonBones.prototype.advanceTime = function (passedTime) { + if (this._objects.length > 0) { + for (var _i = 0, _a = this._objects; _i < _a.length; _i++) { + var object = _a[_i]; + object.returnToPool(); + } + this._objects.length = 0; + } + this._clock.advanceTime(passedTime); + if (this._events.length > 0) { + for (var i = 0; i < this._events.length; ++i) { + var eventObject = this._events[i]; + var armature = eventObject.armature; + if (armature._armatureData !== null) { // May be armature disposed before advanceTime. + armature.eventDispatcher.dispatchDBEvent(eventObject.type, eventObject); + if (eventObject.type === dragonBones.EventObject.SOUND_EVENT) { + this._eventManager.dispatchDBEvent(eventObject.type, eventObject); + } + } + this.bufferObject(eventObject); + } + this._events.length = 0; + } + }; + DragonBones.prototype.bufferEvent = function (value) { + if (this._events.indexOf(value) < 0) { + this._events.push(value); + } + }; + DragonBones.prototype.bufferObject = function (object) { + if (this._objects.indexOf(object) < 0) { + this._objects.push(object); + } + }; + Object.defineProperty(DragonBones.prototype, "clock", { + get: function () { + return this._clock; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragonBones.prototype, "eventManager", { + get: function () { + return this._eventManager; + }, + enumerable: true, + configurable: true + }); + DragonBones.VERSION = "5.7.000"; + DragonBones.yDown = true; + DragonBones.debug = false; + DragonBones.debugDraw = false; + return DragonBones; + }()); + dragonBones.DragonBones = DragonBones; +})(dragonBones || (dragonBones = {})); +// +if (!console.warn) { + console.warn = function () { }; +} +if (!console.assert) { + console.assert = function () { }; +} +// +if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; +} +// Weixin can not support typescript extends. +var __extends = function (t, e) { + function r() { + this.constructor = t; + } + for (var i in e) { + if (e.hasOwnProperty(i)) { + t[i] = e[i]; + } + } + r.prototype = e.prototype, t.prototype = new r(); +}; +// +if (typeof global === "undefined" && typeof window !== "undefined") { + var global = window; +} +if (typeof exports === "object" && typeof module === "object") { + module.exports = dragonBones; +} +else if (typeof define === "function" && define["amd"]) { + define(["dragonBones"], function () { return dragonBones; }); +} +else if (typeof exports === "object") { + exports = dragonBones; +} +else if (typeof global !== "undefined") { + global.dragonBones = dragonBones; +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The BaseObject is the base class for all objects in the DragonBones framework. + * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 基础对象,通常 DragonBones 的对象都继承自该类。 + * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。 + * @version DragonBones 4.5 + * @language zh_CN + */ + var BaseObject = /** @class */ (function () { + function BaseObject() { + /** + * - A unique identification number assigned to the object. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分配给此实例的唯一标识号。 + * @version DragonBones 4.5 + * @language zh_CN + */ + this.hashCode = BaseObject._hashCode++; + this._isInPool = false; + } + BaseObject._returnObject = function (object) { + var classType = String(object.constructor); + var maxCount = classType in BaseObject._maxCountMap ? BaseObject._maxCountMap[classType] : BaseObject._defaultMaxCount; + var pool = BaseObject._poolsMap[classType] = BaseObject._poolsMap[classType] || []; + if (pool.length < maxCount) { + if (!object._isInPool) { + object._isInPool = true; + pool.push(object); + } + else { + console.warn("The object is already in the pool."); + } + } + else { + } + }; + BaseObject.toString = function () { + throw new Error(); + }; + /** + * - Set the maximum cache count of the specify object pool. + * @param objectConstructor - The specify class. (Set all object pools max cache count if not set) + * @param maxCount - Max count. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 设置特定对象池的最大缓存数量。 + * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量) + * @param maxCount - 最大缓存数量。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.setMaxCount = function (objectConstructor, maxCount) { + if (maxCount < 0 || maxCount !== maxCount) { // isNaN + maxCount = 0; + } + if (objectConstructor !== null) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > maxCount) { + pool.length = maxCount; + } + BaseObject._maxCountMap[classType] = maxCount; + } + else { + BaseObject._defaultMaxCount = maxCount; + for (var classType in BaseObject._poolsMap) { + var pool = BaseObject._poolsMap[classType]; + if (pool.length > maxCount) { + pool.length = maxCount; + } + if (classType in BaseObject._maxCountMap) { + BaseObject._maxCountMap[classType] = maxCount; + } + } + } + }; + /** + * - Clear the cached instances of a specify object pool. + * @param objectConstructor - Specify class. (Clear all cached instances if not set) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除特定对象池的缓存实例。 + * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例) + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.clearPool = function (objectConstructor) { + if (objectConstructor === void 0) { objectConstructor = null; } + if (objectConstructor !== null) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > 0) { + pool.length = 0; + } + } + else { + for (var k in BaseObject._poolsMap) { + var pool = BaseObject._poolsMap[k]; + pool.length = 0; + } + } + }; + /** + * - Get an instance of the specify class from object pool. + * @param objectConstructor - The specify class. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从对象池中获取特定类的实例。 + * @param objectConstructor - 特定的类。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.borrowObject = function (objectConstructor) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > 0) { + var object_1 = pool.pop(); + object_1._isInPool = false; + return object_1; + } + var object = new objectConstructor(); + object._onClear(); + return object; + }; + /** + * - Clear the object and return it back to object pool。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除该实例的所有数据并将其返还对象池。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.prototype.returnToPool = function () { + this._onClear(); + BaseObject._returnObject(this); + }; + BaseObject._hashCode = 0; + BaseObject._defaultMaxCount = 3000; + BaseObject._maxCountMap = {}; + BaseObject._poolsMap = {}; + return BaseObject; + }()); + dragonBones.BaseObject = BaseObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - 2D Transform matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 转换矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Matrix = /** @class */ (function () { + /** + * @private + */ + function Matrix(a, b, c, d, tx, ty) { + if (a === void 0) { a = 1.0; } + if (b === void 0) { b = 0.0; } + if (c === void 0) { c = 0.0; } + if (d === void 0) { d = 1.0; } + if (tx === void 0) { tx = 0.0; } + if (ty === void 0) { ty = 0.0; } + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.tx = tx; + this.ty = ty; + } + Matrix.prototype.toString = function () { + return "[object dragonBones.Matrix] a:" + this.a + " b:" + this.b + " c:" + this.c + " d:" + this.d + " tx:" + this.tx + " ty:" + this.ty; + }; + /** + * @private + */ + Matrix.prototype.copyFrom = function (value) { + this.a = value.a; + this.b = value.b; + this.c = value.c; + this.d = value.d; + this.tx = value.tx; + this.ty = value.ty; + return this; + }; + /** + * @private + */ + Matrix.prototype.copyFromArray = function (value, offset) { + if (offset === void 0) { offset = 0; } + this.a = value[offset]; + this.b = value[offset + 1]; + this.c = value[offset + 2]; + this.d = value[offset + 3]; + this.tx = value[offset + 4]; + this.ty = value[offset + 5]; + return this; + }; + /** + * - Convert to unit matrix. + * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为单位矩阵。 + * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.identity = function () { + this.a = this.d = 1.0; + this.b = this.c = 0.0; + this.tx = this.ty = 0.0; + return this; + }; + /** + * - Multiplies the current matrix with another matrix. + * @param value - The matrix that needs to be multiplied. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将当前矩阵与另一个矩阵相乘。 + * @param value - 需要相乘的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.concat = function (value) { + var aA = this.a * value.a; + var bA = 0.0; + var cA = 0.0; + var dA = this.d * value.d; + var txA = this.tx * value.a + value.tx; + var tyA = this.ty * value.d + value.ty; + if (this.b !== 0.0 || this.c !== 0.0) { + aA += this.b * value.c; + bA += this.b * value.d; + cA += this.c * value.a; + dA += this.c * value.b; + } + if (value.b !== 0.0 || value.c !== 0.0) { + bA += this.a * value.b; + cA += this.d * value.c; + txA += this.ty * value.c; + tyA += this.tx * value.b; + } + this.a = aA; + this.b = bA; + this.c = cA; + this.d = dA; + this.tx = txA; + this.ty = tyA; + return this; + }; + /** + * - Convert to inverse matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为逆矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.invert = function () { + var aA = this.a; + var bA = this.b; + var cA = this.c; + var dA = this.d; + var txA = this.tx; + var tyA = this.ty; + if (bA === 0.0 && cA === 0.0) { + this.b = this.c = 0.0; + if (aA === 0.0 || dA === 0.0) { + this.a = this.b = this.tx = this.ty = 0.0; + } + else { + aA = this.a = 1.0 / aA; + dA = this.d = 1.0 / dA; + this.tx = -aA * txA; + this.ty = -dA * tyA; + } + return this; + } + var determinant = aA * dA - bA * cA; + if (determinant === 0.0) { + this.a = this.d = 1.0; + this.b = this.c = 0.0; + this.tx = this.ty = 0.0; + return this; + } + determinant = 1.0 / determinant; + var k = this.a = dA * determinant; + bA = this.b = -bA * determinant; + cA = this.c = -cA * determinant; + dA = this.d = aA * determinant; + this.tx = -(k * txA + cA * tyA); + this.ty = -(bA * txA + dA * tyA); + return this; + }; + /** + * - Apply a matrix transformation to a specific point. + * @param x - X coordinate. + * @param y - Y coordinate. + * @param result - The point after the transformation is applied. + * @param delta - Whether to ignore tx, ty's conversion to point. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将矩阵转换应用于特定点。 + * @param x - 横坐标。 + * @param y - 纵坐标。 + * @param result - 应用转换之后的点。 + * @param delta - 是否忽略 tx,ty 对点的转换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.transformPoint = function (x, y, result, delta) { + if (delta === void 0) { delta = false; } + result.x = this.a * x + this.c * y; + result.y = this.b * x + this.d * y; + if (!delta) { + result.x += this.tx; + result.y += this.ty; + } + }; + /** + * @private + */ + Matrix.prototype.transformRectangle = function (rectangle, delta) { + if (delta === void 0) { delta = false; } + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + var tx = delta ? 0.0 : this.tx; + var ty = delta ? 0.0 : this.ty; + var x = rectangle.x; + var y = rectangle.y; + var xMax = x + rectangle.width; + var yMax = y + rectangle.height; + var x0 = a * x + c * y + tx; + var y0 = b * x + d * y + ty; + var x1 = a * xMax + c * y + tx; + var y1 = b * xMax + d * y + ty; + var x2 = a * xMax + c * yMax + tx; + var y2 = b * xMax + d * yMax + ty; + var x3 = a * x + c * yMax + tx; + var y3 = b * x + d * yMax + ty; + var tmp = 0.0; + if (x0 > x1) { + tmp = x0; + x0 = x1; + x1 = tmp; + } + if (x2 > x3) { + tmp = x2; + x2 = x3; + x3 = tmp; + } + rectangle.x = Math.floor(x0 < x2 ? x0 : x2); + rectangle.width = Math.ceil((x1 > x3 ? x1 : x3) - rectangle.x); + if (y0 > y1) { + tmp = y0; + y0 = y1; + y1 = tmp; + } + if (y2 > y3) { + tmp = y2; + y2 = y3; + y3 = tmp; + } + rectangle.y = Math.floor(y0 < y2 ? y0 : y2); + rectangle.height = Math.ceil((y1 > y3 ? y1 : y3) - rectangle.y); + }; + return Matrix; + }()); + dragonBones.Matrix = Matrix; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - 2D Transform. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 变换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Transform = /** @class */ (function () { + /** + * @private + */ + function Transform(x, y, skew, rotation, scaleX, scaleY) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (skew === void 0) { skew = 0.0; } + if (rotation === void 0) { rotation = 0.0; } + if (scaleX === void 0) { scaleX = 1.0; } + if (scaleY === void 0) { scaleY = 1.0; } + this.x = x; + this.y = y; + this.skew = skew; + this.rotation = rotation; + this.scaleX = scaleX; + this.scaleY = scaleY; + } + /** + * @private + */ + Transform.normalizeRadian = function (value) { + value = (value + Math.PI) % (Math.PI * 2.0); + value += value > 0.0 ? -Math.PI : Math.PI; + return value; + }; + Transform.prototype.toString = function () { + return "[object dragonBones.Transform] x:" + this.x + " y:" + this.y + " skewX:" + this.skew * 180.0 / Math.PI + " skewY:" + this.rotation * 180.0 / Math.PI + " scaleX:" + this.scaleX + " scaleY:" + this.scaleY; + }; + /** + * @private + */ + Transform.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + this.skew = value.skew; + this.rotation = value.rotation; + this.scaleX = value.scaleX; + this.scaleY = value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.identity = function () { + this.x = this.y = 0.0; + this.skew = this.rotation = 0.0; + this.scaleX = this.scaleY = 1.0; + return this; + }; + /** + * @private + */ + Transform.prototype.add = function (value) { + this.x += value.x; + this.y += value.y; + this.skew += value.skew; + this.rotation += value.rotation; + this.scaleX *= value.scaleX; + this.scaleY *= value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.minus = function (value) { + this.x -= value.x; + this.y -= value.y; + this.skew -= value.skew; + this.rotation -= value.rotation; + this.scaleX /= value.scaleX; + this.scaleY /= value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.fromMatrix = function (matrix) { + var backupScaleX = this.scaleX, backupScaleY = this.scaleY; + var PI_Q = Transform.PI_Q; + this.x = matrix.tx; + this.y = matrix.ty; + this.rotation = Math.atan(matrix.b / matrix.a); + var skewX = Math.atan(-matrix.c / matrix.d); + this.scaleX = (this.rotation > -PI_Q && this.rotation < PI_Q) ? matrix.a / Math.cos(this.rotation) : matrix.b / Math.sin(this.rotation); + this.scaleY = (skewX > -PI_Q && skewX < PI_Q) ? matrix.d / Math.cos(skewX) : -matrix.c / Math.sin(skewX); + if (backupScaleX >= 0.0 && this.scaleX < 0.0) { + this.scaleX = -this.scaleX; + this.rotation = this.rotation - Math.PI; + } + if (backupScaleY >= 0.0 && this.scaleY < 0.0) { + this.scaleY = -this.scaleY; + skewX = skewX - Math.PI; + } + this.skew = skewX - this.rotation; + return this; + }; + /** + * @private + */ + Transform.prototype.toMatrix = function (matrix) { + if (this.rotation === 0.0) { + matrix.a = 1.0; + matrix.b = 0.0; + } + else { + matrix.a = Math.cos(this.rotation); + matrix.b = Math.sin(this.rotation); + } + if (this.skew === 0.0) { + matrix.c = -matrix.b; + matrix.d = matrix.a; + } + else { + matrix.c = -Math.sin(this.skew + this.rotation); + matrix.d = Math.cos(this.skew + this.rotation); + } + if (this.scaleX !== 1.0) { + matrix.a *= this.scaleX; + matrix.b *= this.scaleX; + } + if (this.scaleY !== 1.0) { + matrix.c *= this.scaleY; + matrix.d *= this.scaleY; + } + matrix.tx = this.x; + matrix.ty = this.y; + return this; + }; + /** + * @private + */ + Transform.PI = Math.PI; + /** + * @private + */ + Transform.PI_D = Math.PI * 2.0; + /** + * @private + */ + Transform.PI_H = Math.PI / 2.0; + /** + * @private + */ + Transform.PI_Q = Math.PI / 4.0; + /** + * @private + */ + Transform.RAD_DEG = 180.0 / Math.PI; + /** + * @private + */ + Transform.DEG_RAD = Math.PI / 180.0; + return Transform; + }()); + dragonBones.Transform = Transform; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ColorTransform = /** @class */ (function () { + function ColorTransform(alphaMultiplier, redMultiplier, greenMultiplier, blueMultiplier, alphaOffset, redOffset, greenOffset, blueOffset) { + if (alphaMultiplier === void 0) { alphaMultiplier = 1.0; } + if (redMultiplier === void 0) { redMultiplier = 1.0; } + if (greenMultiplier === void 0) { greenMultiplier = 1.0; } + if (blueMultiplier === void 0) { blueMultiplier = 1.0; } + if (alphaOffset === void 0) { alphaOffset = 0; } + if (redOffset === void 0) { redOffset = 0; } + if (greenOffset === void 0) { greenOffset = 0; } + if (blueOffset === void 0) { blueOffset = 0; } + this.alphaMultiplier = alphaMultiplier; + this.redMultiplier = redMultiplier; + this.greenMultiplier = greenMultiplier; + this.blueMultiplier = blueMultiplier; + this.alphaOffset = alphaOffset; + this.redOffset = redOffset; + this.greenOffset = greenOffset; + this.blueOffset = blueOffset; + } + ColorTransform.prototype.copyFrom = function (value) { + this.alphaMultiplier = value.alphaMultiplier; + this.redMultiplier = value.redMultiplier; + this.greenMultiplier = value.greenMultiplier; + this.blueMultiplier = value.blueMultiplier; + this.alphaOffset = value.alphaOffset; + this.redOffset = value.redOffset; + this.greenOffset = value.greenOffset; + this.blueOffset = value.blueOffset; + }; + ColorTransform.prototype.identity = function () { + this.alphaMultiplier = this.redMultiplier = this.greenMultiplier = this.blueMultiplier = 1.0; + this.alphaOffset = this.redOffset = this.greenOffset = this.blueOffset = 0; + }; + return ColorTransform; + }()); + dragonBones.ColorTransform = ColorTransform; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The Point object represents a location in a two-dimensional coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Point 对象表示二维坐标系统中的某个位置。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Point = /** @class */ (function () { + /** + * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @param x - The horizontal coordinate. + * @param y - The vertical coordinate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。 + * @param x - 该对象的x属性值,默认为 0.0。 + * @param y - 该对象的y属性值,默认为 0.0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + function Point(x, y) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + this.x = x; + this.y = y; + } + /** + * @private + */ + Point.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + }; + /** + * @private + */ + Point.prototype.clear = function () { + this.x = this.y = 0.0; + }; + return Point; + }()); + dragonBones.Point = Point; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its + * width and its height.
+ * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of + * one property has no effect on the others. However, the right and bottom properties are integrally related to those + * four properties. For example, if you change the value of the right property, the value of the width property changes; + * if you change the bottom property, the value of the height property changes. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
+ * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 + * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width + * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Rectangle = /** @class */ (function () { + /** + * @private + */ + function Rectangle(x, y, width, height) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (width === void 0) { width = 0.0; } + if (height === void 0) { height = 0.0; } + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + /** + * @private + */ + Rectangle.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + this.width = value.width; + this.height = value.height; + }; + /** + * @private + */ + Rectangle.prototype.clear = function () { + this.x = this.y = 0.0; + this.width = this.height = 0.0; + }; + return Rectangle; + }()); + dragonBones.Rectangle = Rectangle; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The user custom data. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 用户自定义数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + var UserData = /** @class */ (function (_super) { + __extends(UserData, _super); + function UserData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - The custom int numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.ints = []; + /** + * - The custom float numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.floats = []; + /** + * - The custom strings. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.strings = []; + return _this; + } + UserData.toString = function () { + return "[class dragonBones.UserData]"; + }; + UserData.prototype._onClear = function () { + this.ints.length = 0; + this.floats.length = 0; + this.strings.length = 0; + }; + /** + * @internal + */ + UserData.prototype.addInt = function (value) { + this.ints.push(value); + }; + /** + * @internal + */ + UserData.prototype.addFloat = function (value) { + this.floats.push(value); + }; + /** + * @internal + */ + UserData.prototype.addString = function (value) { + this.strings.push(value); + }; + /** + * - Get the custom int number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getInt = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.ints.length ? this.ints[index] : 0; + }; + /** + * - Get the custom float number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getFloat = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.floats.length ? this.floats[index] : 0.0; + }; + /** + * - Get the custom string. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getString = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.strings.length ? this.strings[index] : ""; + }; + return UserData; + }(dragonBones.BaseObject)); + dragonBones.UserData = UserData; + /** + * @private + */ + var ActionData = /** @class */ (function (_super) { + __extends(ActionData, _super); + function ActionData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.data = null; // + return _this; + } + ActionData.toString = function () { + return "[class dragonBones.ActionData]"; + }; + ActionData.prototype._onClear = function () { + if (this.data !== null) { + this.data.returnToPool(); + } + this.type = 0 /* Play */; + this.name = ""; + this.bone = null; + this.slot = null; + this.data = null; + }; + return ActionData; + }(dragonBones.BaseObject)); + dragonBones.ActionData = ActionData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The DragonBones data. + * A DragonBones data contains multiple armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据。 + * 一个龙骨数据包含多个骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + var DragonBonesData = /** @class */ (function (_super) { + __extends(DragonBonesData, _super); + function DragonBonesData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @internal + */ + _this.frameIndices = []; + /** + * @internal + */ + _this.cachedFrames = []; + /** + * - All armature data names. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.armatureNames = []; + /** + * @private + */ + _this.armatures = {}; + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + DragonBonesData.toString = function () { + return "[class dragonBones.DragonBonesData]"; + }; + DragonBonesData.prototype._onClear = function () { + for (var k in this.armatures) { + this.armatures[k].returnToPool(); + delete this.armatures[k]; + } + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.autoSearch = false; + this.frameRate = 0; + this.version = ""; + this.name = ""; + this.stage = null; + this.frameIndices.length = 0; + this.cachedFrames.length = 0; + this.armatureNames.length = 0; + //this.armatures.clear(); + this.binary = null; // + this.intArray = null; // + this.floatArray = null; // + this.frameIntArray = null; // + this.frameFloatArray = null; // + this.frameArray = null; // + this.timelineArray = null; // + this.colorArray = null; // + this.userData = null; + }; + /** + * @internal + */ + DragonBonesData.prototype.addArmature = function (value) { + if (value.name in this.armatures) { + console.warn("Same armature: " + value.name); + return; + } + value.parent = this; + this.armatures[value.name] = value; + this.armatureNames.push(value.name); + }; + /** + * - Get a specific armature data. + * @param armatureName - The armature data name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param armatureName - 骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + DragonBonesData.prototype.getArmature = function (armatureName) { + return armatureName in this.armatures ? this.armatures[armatureName] : null; + }; + return DragonBonesData; + }(dragonBones.BaseObject)); + dragonBones.DragonBonesData = DragonBonesData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The armature data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var ArmatureData = /** @class */ (function (_super) { + __extends(ArmatureData, _super); + function ArmatureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.aabb = new dragonBones.Rectangle(); + /** + * - The names of all the animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的动画数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.animationNames = []; + /** + * @private + */ + _this.sortedBones = []; + /** + * @private + */ + _this.sortedSlots = []; + /** + * @private + */ + _this.defaultActions = []; + /** + * @private + */ + _this.actions = []; + /** + * @private + */ + _this.bones = {}; + /** + * @private + */ + _this.slots = {}; + /** + * @private + */ + _this.constraints = {}; + /** + * @private + */ + _this.skins = {}; + /** + * @private + */ + _this.animations = {}; + /** + * @private + */ + _this.canvas = null; // Initial value. + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + ArmatureData.toString = function () { + return "[class dragonBones.ArmatureData]"; + }; + ArmatureData.prototype._onClear = function () { + for (var _i = 0, _a = this.defaultActions; _i < _a.length; _i++) { + var action = _a[_i]; + action.returnToPool(); + } + for (var _b = 0, _c = this.actions; _b < _c.length; _b++) { + var action = _c[_b]; + action.returnToPool(); + } + for (var k in this.bones) { + this.bones[k].returnToPool(); + delete this.bones[k]; + } + for (var k in this.slots) { + this.slots[k].returnToPool(); + delete this.slots[k]; + } + for (var k in this.constraints) { + this.constraints[k].returnToPool(); + delete this.constraints[k]; + } + for (var k in this.skins) { + this.skins[k].returnToPool(); + delete this.skins[k]; + } + for (var k in this.animations) { + this.animations[k].returnToPool(); + delete this.animations[k]; + } + if (this.canvas !== null) { + this.canvas.returnToPool(); + } + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.type = 0 /* Armature */; + this.frameRate = 0; + this.cacheFrameRate = 0; + this.scale = 1.0; + this.name = ""; + this.aabb.clear(); + this.animationNames.length = 0; + this.sortedBones.length = 0; + this.sortedSlots.length = 0; + this.defaultActions.length = 0; + this.actions.length = 0; + // this.bones.clear(); + // this.slots.clear(); + // this.constraints.clear(); + // this.skins.clear(); + // this.animations.clear(); + this.defaultSkin = null; + this.defaultAnimation = null; + this.canvas = null; + this.userData = null; + this.parent = null; // + }; + /** + * @internal + */ + ArmatureData.prototype.sortBones = function () { + var total = this.sortedBones.length; + if (total <= 0) { + return; + } + var sortHelper = this.sortedBones.concat(); + var index = 0; + var count = 0; + this.sortedBones.length = 0; + while (count < total) { + var bone = sortHelper[index++]; + if (index >= total) { + index = 0; + } + if (this.sortedBones.indexOf(bone) >= 0) { + continue; + } + var flag = false; + for (var k in this.constraints) { // Wait constraint. + var constraint = this.constraints[k]; + if (constraint.root === bone && this.sortedBones.indexOf(constraint.target) < 0) { + flag = true; + break; + } + } + if (flag) { + continue; + } + if (bone.parent !== null && this.sortedBones.indexOf(bone.parent) < 0) { // Wait parent. + continue; + } + this.sortedBones.push(bone); + count++; + } + }; + /** + * @internal + */ + ArmatureData.prototype.cacheFrames = function (frameRate) { + if (this.cacheFrameRate > 0) { // TODO clear cache. + return; + } + this.cacheFrameRate = frameRate; + for (var k in this.animations) { + this.animations[k].cacheFrames(this.cacheFrameRate); + } + }; + /** + * @internal + */ + ArmatureData.prototype.setCacheFrame = function (globalTransformMatrix, transform) { + var dataArray = this.parent.cachedFrames; + var arrayOffset = dataArray.length; + dataArray.length += 10; + dataArray[arrayOffset] = globalTransformMatrix.a; + dataArray[arrayOffset + 1] = globalTransformMatrix.b; + dataArray[arrayOffset + 2] = globalTransformMatrix.c; + dataArray[arrayOffset + 3] = globalTransformMatrix.d; + dataArray[arrayOffset + 4] = globalTransformMatrix.tx; + dataArray[arrayOffset + 5] = globalTransformMatrix.ty; + dataArray[arrayOffset + 6] = transform.rotation; + dataArray[arrayOffset + 7] = transform.skew; + dataArray[arrayOffset + 8] = transform.scaleX; + dataArray[arrayOffset + 9] = transform.scaleY; + return arrayOffset; + }; + /** + * @internal + */ + ArmatureData.prototype.getCacheFrame = function (globalTransformMatrix, transform, arrayOffset) { + var dataArray = this.parent.cachedFrames; + globalTransformMatrix.a = dataArray[arrayOffset]; + globalTransformMatrix.b = dataArray[arrayOffset + 1]; + globalTransformMatrix.c = dataArray[arrayOffset + 2]; + globalTransformMatrix.d = dataArray[arrayOffset + 3]; + globalTransformMatrix.tx = dataArray[arrayOffset + 4]; + globalTransformMatrix.ty = dataArray[arrayOffset + 5]; + transform.rotation = dataArray[arrayOffset + 6]; + transform.skew = dataArray[arrayOffset + 7]; + transform.scaleX = dataArray[arrayOffset + 8]; + transform.scaleY = dataArray[arrayOffset + 9]; + transform.x = globalTransformMatrix.tx; + transform.y = globalTransformMatrix.ty; + }; + /** + * @internal + */ + ArmatureData.prototype.addBone = function (value) { + if (value.name in this.bones) { + console.warn("Same bone: " + value.name); + return; + } + this.bones[value.name] = value; + this.sortedBones.push(value); + }; + /** + * @internal + */ + ArmatureData.prototype.addSlot = function (value) { + if (value.name in this.slots) { + console.warn("Same slot: " + value.name); + return; + } + this.slots[value.name] = value; + this.sortedSlots.push(value); + }; + /** + * @internal + */ + ArmatureData.prototype.addConstraint = function (value) { + if (value.name in this.constraints) { + console.warn("Same constraint: " + value.name); + return; + } + this.constraints[value.name] = value; + }; + /** + * @internal + */ + ArmatureData.prototype.addSkin = function (value) { + if (value.name in this.skins) { + console.warn("Same skin: " + value.name); + return; + } + value.parent = this; + this.skins[value.name] = value; + if (this.defaultSkin === null) { + this.defaultSkin = value; + } + if (value.name === "default") { + this.defaultSkin = value; + } + }; + /** + * @internal + */ + ArmatureData.prototype.addAnimation = function (value) { + if (value.name in this.animations) { + console.warn("Same animation: " + value.name); + return; + } + value.parent = this; + this.animations[value.name] = value; + this.animationNames.push(value.name); + if (this.defaultAnimation === null) { + this.defaultAnimation = value; + } + }; + /** + * @internal + */ + ArmatureData.prototype.addAction = function (value, isDefault) { + if (isDefault) { + this.defaultActions.push(value); + } + else { + this.actions.push(value); + } + }; + /** + * - Get a specific done data. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼数据。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getBone = function (boneName) { + return boneName in this.bones ? this.bones[boneName] : null; + }; + /** + * - Get a specific slot data. + * @param slotName - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽数据。 + * @param slotName - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getSlot = function (slotName) { + return slotName in this.slots ? this.slots[slotName] : null; + }; + /** + * @private + */ + ArmatureData.prototype.getConstraint = function (constraintName) { + return constraintName in this.constraints ? this.constraints[constraintName] : null; + }; + /** + * - Get a specific skin data. + * @param skinName - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定皮肤数据。 + * @param skinName - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getSkin = function (skinName) { + return skinName in this.skins ? this.skins[skinName] : null; + }; + /** + * @private + */ + ArmatureData.prototype.getMesh = function (skinName, slotName, meshName) { + var skin = this.getSkin(skinName); + if (skin === null) { + return null; + } + return skin.getDisplay(slotName, meshName); + }; + /** + * - Get a specific animation data. + * @param animationName - The animation animationName. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的动画数据。 + * @param animationName - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getAnimation = function (animationName) { + return animationName in this.animations ? this.animations[animationName] : null; + }; + return ArmatureData; + }(dragonBones.BaseObject)); + dragonBones.ArmatureData = ArmatureData; + /** + * - The bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var BoneData = /** @class */ (function (_super) { + __extends(BoneData, _super); + function BoneData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.transform = new dragonBones.Transform(); + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + BoneData.toString = function () { + return "[class dragonBones.BoneData]"; + }; + BoneData.prototype._onClear = function () { + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.inheritTranslation = false; + this.inheritRotation = false; + this.inheritScale = false; + this.inheritReflection = false; + this.type = 0 /* Bone */; + this.length = 0.0; + this.alpha = 1.0; + this.name = ""; + this.transform.identity(); + this.userData = null; + this.parent = null; + }; + return BoneData; + }(dragonBones.BaseObject)); + dragonBones.BoneData = BoneData; + /** + * @internal + */ + var SurfaceData = /** @class */ (function (_super) { + __extends(SurfaceData, _super); + function SurfaceData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new dragonBones.GeometryData(); + return _this; + } + SurfaceData.toString = function () { + return "[class dragonBones.SurfaceData]"; + }; + SurfaceData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 1 /* Surface */; + this.segmentX = 0; + this.segmentY = 0; + this.geometry.clear(); + }; + return SurfaceData; + }(BoneData)); + dragonBones.SurfaceData = SurfaceData; + /** + * - The slot data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var SlotData = /** @class */ (function (_super) { + __extends(SlotData, _super); + function SlotData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.color = null; // Initial value. + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + /** + * @internal + */ + SlotData.createColor = function () { + return new dragonBones.ColorTransform(); + }; + SlotData.toString = function () { + return "[class dragonBones.SlotData]"; + }; + SlotData.prototype._onClear = function () { + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.blendMode = 0 /* Normal */; + this.displayIndex = 0; + this.zOrder = 0; + this.zIndex = 0; + this.alpha = 1.0; + this.name = ""; + this.color = null; // + this.userData = null; + this.parent = null; // + }; + /** + * @internal + */ + SlotData.DEFAULT_COLOR = new dragonBones.ColorTransform(); + return SlotData; + }(dragonBones.BaseObject)); + dragonBones.SlotData = SlotData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ConstraintData = /** @class */ (function (_super) { + __extends(ConstraintData, _super); + function ConstraintData() { + return _super !== null && _super.apply(this, arguments) || this; + } + ConstraintData.prototype._onClear = function () { + this.order = 0; + this.name = ""; + this.type = 0 /* IK */; + this.target = null; // + this.root = null; // + this.bone = null; + }; + return ConstraintData; + }(dragonBones.BaseObject)); + dragonBones.ConstraintData = ConstraintData; + /** + * @internal + */ + var IKConstraintData = /** @class */ (function (_super) { + __extends(IKConstraintData, _super); + function IKConstraintData() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraintData.toString = function () { + return "[class dragonBones.IKConstraintData]"; + }; + IKConstraintData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.scaleEnabled = false; + this.bendPositive = false; + this.weight = 1.0; + }; + return IKConstraintData; + }(ConstraintData)); + dragonBones.IKConstraintData = IKConstraintData; + /** + * @internal + */ + var PathConstraintData = /** @class */ (function (_super) { + __extends(PathConstraintData, _super); + function PathConstraintData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.bones = []; + return _this; + } + PathConstraintData.toString = function () { + return "[class dragonBones.PathConstraintData]"; + }; + PathConstraintData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.pathSlot = null; + this.pathDisplayData = null; + this.bones.length = 0; + this.positionMode = 0 /* Fixed */; + this.spacingMode = 1 /* Fixed */; + this.rotateMode = 1 /* Chain */; + this.position = 0.0; + this.spacing = 0.0; + this.rotateOffset = 0.0; + this.rotateMix = 0.0; + this.translateMix = 0.0; + }; + PathConstraintData.prototype.AddBone = function (value) { + this.bones.push(value); + }; + return PathConstraintData; + }(ConstraintData)); + dragonBones.PathConstraintData = PathConstraintData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var CanvasData = /** @class */ (function (_super) { + __extends(CanvasData, _super); + function CanvasData() { + return _super !== null && _super.apply(this, arguments) || this; + } + CanvasData.toString = function () { + return "[class dragonBones.CanvasData]"; + }; + CanvasData.prototype._onClear = function () { + this.hasBackground = false; + this.color = 0x000000; + this.x = 0; + this.y = 0; + this.width = 0; + this.height = 0; + }; + return CanvasData; + }(dragonBones.BaseObject)); + dragonBones.CanvasData = CanvasData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The skin data, typically a armature data instance contains at least one skinData. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var SkinData = /** @class */ (function (_super) { + __extends(SkinData, _super); + function SkinData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.displays = {}; + return _this; + } + SkinData.toString = function () { + return "[class dragonBones.SkinData]"; + }; + SkinData.prototype._onClear = function () { + for (var k in this.displays) { + var slotDisplays = this.displays[k]; + for (var _i = 0, slotDisplays_1 = slotDisplays; _i < slotDisplays_1.length; _i++) { + var display = slotDisplays_1[_i]; + if (display !== null) { + display.returnToPool(); + } + } + delete this.displays[k]; + } + this.name = ""; + // this.displays.clear(); + this.parent = null; // + }; + /** + * @internal + */ + SkinData.prototype.addDisplay = function (slotName, value) { + if (!(slotName in this.displays)) { + this.displays[slotName] = []; + } + if (value !== null) { + value.parent = this; + } + var slotDisplays = this.displays[slotName]; // TODO clear prev + slotDisplays.push(value); + }; + /** + * @private + */ + SkinData.prototype.getDisplay = function (slotName, displayName) { + var slotDisplays = this.getDisplays(slotName); + if (slotDisplays !== null) { + for (var _i = 0, slotDisplays_2 = slotDisplays; _i < slotDisplays_2.length; _i++) { + var display = slotDisplays_2[_i]; + if (display !== null && display.name === displayName) { + return display; + } + } + } + return null; + }; + /** + * @private + */ + SkinData.prototype.getDisplays = function (slotName) { + if (!(slotName in this.displays)) { + return null; + } + return this.displays[slotName]; + }; + return SkinData; + }(dragonBones.BaseObject)); + dragonBones.SkinData = SkinData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var GeometryData = /** @class */ (function () { + function GeometryData() { + this.weight = null; // Initial value. + } + GeometryData.prototype.clear = function () { + if (!this.isShared && this.weight !== null) { + this.weight.returnToPool(); + } + this.isShared = false; + this.inheritDeform = false; + this.offset = 0; + this.data = null; + this.weight = null; + }; + GeometryData.prototype.shareFrom = function (value) { + this.isShared = true; + this.offset = value.offset; + this.weight = value.weight; + }; + Object.defineProperty(GeometryData.prototype, "vertexCount", { + get: function () { + var intArray = this.data.intArray; + return intArray[this.offset + 0 /* GeometryVertexCount */]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GeometryData.prototype, "triangleCount", { + get: function () { + var intArray = this.data.intArray; + return intArray[this.offset + 1 /* GeometryTriangleCount */]; + }, + enumerable: true, + configurable: true + }); + return GeometryData; + }()); + dragonBones.GeometryData = GeometryData; + /** + * @private + */ + var DisplayData = /** @class */ (function (_super) { + __extends(DisplayData, _super); + function DisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.transform = new dragonBones.Transform(); + return _this; + } + DisplayData.prototype._onClear = function () { + this.name = ""; + this.path = ""; + this.transform.identity(); + this.parent = null; // + }; + return DisplayData; + }(dragonBones.BaseObject)); + dragonBones.DisplayData = DisplayData; + /** + * @private + */ + var ImageDisplayData = /** @class */ (function (_super) { + __extends(ImageDisplayData, _super); + function ImageDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.pivot = new dragonBones.Point(); + return _this; + } + ImageDisplayData.toString = function () { + return "[class dragonBones.ImageDisplayData]"; + }; + ImageDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 0 /* Image */; + this.pivot.clear(); + this.texture = null; + }; + return ImageDisplayData; + }(DisplayData)); + dragonBones.ImageDisplayData = ImageDisplayData; + /** + * @private + */ + var ArmatureDisplayData = /** @class */ (function (_super) { + __extends(ArmatureDisplayData, _super); + function ArmatureDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.actions = []; + return _this; + } + ArmatureDisplayData.toString = function () { + return "[class dragonBones.ArmatureDisplayData]"; + }; + ArmatureDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + for (var _i = 0, _a = this.actions; _i < _a.length; _i++) { + var action = _a[_i]; + action.returnToPool(); + } + this.type = 1 /* Armature */; + this.inheritAnimation = false; + this.actions.length = 0; + this.armature = null; + }; + /** + * @private + */ + ArmatureDisplayData.prototype.addAction = function (value) { + this.actions.push(value); + }; + return ArmatureDisplayData; + }(DisplayData)); + dragonBones.ArmatureDisplayData = ArmatureDisplayData; + /** + * @private + */ + var MeshDisplayData = /** @class */ (function (_super) { + __extends(MeshDisplayData, _super); + function MeshDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new GeometryData(); + return _this; + } + MeshDisplayData.toString = function () { + return "[class dragonBones.MeshDisplayData]"; + }; + MeshDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 2 /* Mesh */; + this.geometry.clear(); + this.texture = null; + }; + return MeshDisplayData; + }(DisplayData)); + dragonBones.MeshDisplayData = MeshDisplayData; + /** + * @private + */ + var BoundingBoxDisplayData = /** @class */ (function (_super) { + __extends(BoundingBoxDisplayData, _super); + function BoundingBoxDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.boundingBox = null; // Initial value. + return _this; + } + BoundingBoxDisplayData.toString = function () { + return "[class dragonBones.BoundingBoxDisplayData]"; + }; + BoundingBoxDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this.boundingBox !== null) { + this.boundingBox.returnToPool(); + } + this.type = 3 /* BoundingBox */; + this.boundingBox = null; + }; + return BoundingBoxDisplayData; + }(DisplayData)); + dragonBones.BoundingBoxDisplayData = BoundingBoxDisplayData; + /** + * @private + */ + var PathDisplayData = /** @class */ (function (_super) { + __extends(PathDisplayData, _super); + function PathDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new GeometryData(); + _this.curveLengths = []; + return _this; + } + PathDisplayData.toString = function () { + return "[class dragonBones.PathDisplayData]"; + }; + PathDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 4 /* Path */; + this.closed = false; + this.constantSpeed = false; + this.geometry.clear(); + this.curveLengths.length = 0; + }; + return PathDisplayData; + }(DisplayData)); + dragonBones.PathDisplayData = PathDisplayData; + /** + * @private + */ + var WeightData = /** @class */ (function (_super) { + __extends(WeightData, _super); + function WeightData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.bones = []; + return _this; + } + WeightData.toString = function () { + return "[class dragonBones.WeightData]"; + }; + WeightData.prototype._onClear = function () { + this.count = 0; + this.offset = 0; + this.bones.length = 0; + }; + WeightData.prototype.addBone = function (value) { + this.bones.push(value); + }; + return WeightData; + }(dragonBones.BaseObject)); + dragonBones.WeightData = WeightData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The base class of bounding box data. + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框数据基类。 + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language zh_CN + */ + var BoundingBoxData = /** @class */ (function (_super) { + __extends(BoundingBoxData, _super); + function BoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoundingBoxData.prototype._onClear = function () { + this.color = 0x000000; + this.width = 0.0; + this.height = 0.0; + }; + return BoundingBoxData; + }(dragonBones.BaseObject)); + dragonBones.BoundingBoxData = BoundingBoxData; + /** + * - The rectangle bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 矩形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var RectangleBoundingBoxData = /** @class */ (function (_super) { + __extends(RectangleBoundingBoxData, _super); + function RectangleBoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + RectangleBoundingBoxData.toString = function () { + return "[class dragonBones.RectangleBoundingBoxData]"; + }; + /** + * - Compute the bit code for a point (x, y) using the clip rectangle + */ + RectangleBoundingBoxData._computeOutCode = function (x, y, xMin, yMin, xMax, yMax) { + var code = 0 /* InSide */; // initialised as being inside of [[clip window]] + if (x < xMin) { // to the left of clip window + code |= 1 /* Left */; + } + else if (x > xMax) { // to the right of clip window + code |= 2 /* Right */; + } + if (y < yMin) { // below the clip window + code |= 4 /* Top */; + } + else if (y > yMax) { // above the clip window + code |= 8 /* Bottom */; + } + return code; + }; + /** + * @private + */ + RectangleBoundingBoxData.rectangleIntersectsSegment = function (xA, yA, xB, yB, xMin, yMin, xMax, yMax, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var inSideA = xA > xMin && xA < xMax && yA > yMin && yA < yMax; + var inSideB = xB > xMin && xB < xMax && yB > yMin && yB < yMax; + if (inSideA && inSideB) { + return -1; + } + var intersectionCount = 0; + var outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax); + var outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax); + while (true) { + if ((outcode0 | outcode1) === 0) { // Bitwise OR is 0. Trivially accept and get out of loop + intersectionCount = 2; + break; + } + else if ((outcode0 & outcode1) !== 0) { // Bitwise AND is not 0. Trivially reject and get out of loop + break; + } + // failed both tests, so calculate the line segment to clip + // from an outside point to an intersection with clip edge + var x = 0.0; + var y = 0.0; + var normalRadian = 0.0; + // At least one endpoint is outside the clip rectangle; pick it. + var outcodeOut = outcode0 !== 0 ? outcode0 : outcode1; + // Now find the intersection point; + if ((outcodeOut & 4 /* Top */) !== 0) { // point is above the clip rectangle + x = xA + (xB - xA) * (yMin - yA) / (yB - yA); + y = yMin; + if (normalRadians !== null) { + normalRadian = -Math.PI * 0.5; + } + } + else if ((outcodeOut & 8 /* Bottom */) !== 0) { // point is below the clip rectangle + x = xA + (xB - xA) * (yMax - yA) / (yB - yA); + y = yMax; + if (normalRadians !== null) { + normalRadian = Math.PI * 0.5; + } + } + else if ((outcodeOut & 2 /* Right */) !== 0) { // point is to the right of clip rectangle + y = yA + (yB - yA) * (xMax - xA) / (xB - xA); + x = xMax; + if (normalRadians !== null) { + normalRadian = 0; + } + } + else if ((outcodeOut & 1 /* Left */) !== 0) { // point is to the left of clip rectangle + y = yA + (yB - yA) * (xMin - xA) / (xB - xA); + x = xMin; + if (normalRadians !== null) { + normalRadian = Math.PI; + } + } + // Now we move outside point to intersection point to clip + // and get ready for next pass. + if (outcodeOut === outcode0) { + xA = x; + yA = y; + outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax); + if (normalRadians !== null) { + normalRadians.x = normalRadian; + } + } + else { + xB = x; + yB = y; + outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax); + if (normalRadians !== null) { + normalRadians.y = normalRadian; + } + } + } + if (intersectionCount) { + if (inSideA) { + intersectionCount = 2; // 10 + if (intersectionPointA !== null) { + intersectionPointA.x = xB; + intersectionPointA.y = yB; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = xB; + } + if (normalRadians !== null) { + normalRadians.x = normalRadians.y + Math.PI; + } + } + else if (inSideB) { + intersectionCount = 1; // 01 + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA; + intersectionPointB.y = yA; + } + if (normalRadians !== null) { + normalRadians.y = normalRadians.x + Math.PI; + } + } + else { + intersectionCount = 3; // 11 + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = yB; + } + } + } + return intersectionCount; + }; + RectangleBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 0 /* Rectangle */; + }; + /** + * @inheritDoc + */ + RectangleBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var widthH = this.width * 0.5; + if (pX >= -widthH && pX <= widthH) { + var heightH = this.height * 0.5; + if (pY >= -heightH && pY <= heightH) { + return true; + } + } + return false; + }; + /** + * @inheritDoc + */ + RectangleBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var widthH = this.width * 0.5; + var heightH = this.height * 0.5; + var intersectionCount = RectangleBoundingBoxData.rectangleIntersectsSegment(xA, yA, xB, yB, -widthH, -heightH, widthH, heightH, intersectionPointA, intersectionPointB, normalRadians); + return intersectionCount; + }; + return RectangleBoundingBoxData; + }(BoundingBoxData)); + dragonBones.RectangleBoundingBoxData = RectangleBoundingBoxData; + /** + * - The ellipse bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 椭圆边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var EllipseBoundingBoxData = /** @class */ (function (_super) { + __extends(EllipseBoundingBoxData, _super); + function EllipseBoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + EllipseBoundingBoxData.toString = function () { + return "[class dragonBones.EllipseData]"; + }; + /** + * @private + */ + EllipseBoundingBoxData.ellipseIntersectsSegment = function (xA, yA, xB, yB, xC, yC, widthH, heightH, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var d = widthH / heightH; + var dd = d * d; + yA *= d; + yB *= d; + var dX = xB - xA; + var dY = yB - yA; + var lAB = Math.sqrt(dX * dX + dY * dY); + var xD = dX / lAB; + var yD = dY / lAB; + var a = (xC - xA) * xD + (yC - yA) * yD; + var aa = a * a; + var ee = xA * xA + yA * yA; + var rr = widthH * widthH; + var dR = rr - ee + aa; + var intersectionCount = 0; + if (dR >= 0.0) { + var dT = Math.sqrt(dR); + var sA = a - dT; + var sB = a + dT; + var inSideA = sA < 0.0 ? -1 : (sA <= lAB ? 0 : 1); + var inSideB = sB < 0.0 ? -1 : (sB <= lAB ? 0 : 1); + var sideAB = inSideA * inSideB; + if (sideAB < 0) { + return -1; + } + else if (sideAB === 0) { + if (inSideA === -1) { + intersectionCount = 2; // 10 + xB = xA + sB * xD; + yB = (yA + sB * yD) / d; + if (intersectionPointA !== null) { + intersectionPointA.x = xB; + intersectionPointA.y = yB; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = yB; + } + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yB / rr * dd, xB / rr); + normalRadians.y = normalRadians.x + Math.PI; + } + } + else if (inSideB === 1) { + intersectionCount = 1; // 01 + xA = xA + sA * xD; + yA = (yA + sA * yD) / d; + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA; + intersectionPointB.y = yA; + } + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yA / rr * dd, xA / rr); + normalRadians.y = normalRadians.x + Math.PI; + } + } + else { + intersectionCount = 3; // 11 + if (intersectionPointA !== null) { + intersectionPointA.x = xA + sA * xD; + intersectionPointA.y = (yA + sA * yD) / d; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(intersectionPointA.y / rr * dd, intersectionPointA.x / rr); + } + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA + sB * xD; + intersectionPointB.y = (yA + sB * yD) / d; + if (normalRadians !== null) { + normalRadians.y = Math.atan2(intersectionPointB.y / rr * dd, intersectionPointB.x / rr); + } + } + } + } + } + return intersectionCount; + }; + EllipseBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 1 /* Ellipse */; + }; + /** + * @inheritDoc + */ + EllipseBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var widthH = this.width * 0.5; + if (pX >= -widthH && pX <= widthH) { + var heightH = this.height * 0.5; + if (pY >= -heightH && pY <= heightH) { + pY *= widthH / heightH; + return Math.sqrt(pX * pX + pY * pY) <= widthH; + } + } + return false; + }; + /** + * @inheritDoc + */ + EllipseBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var intersectionCount = EllipseBoundingBoxData.ellipseIntersectsSegment(xA, yA, xB, yB, 0.0, 0.0, this.width * 0.5, this.height * 0.5, intersectionPointA, intersectionPointB, normalRadians); + return intersectionCount; + }; + return EllipseBoundingBoxData; + }(BoundingBoxData)); + dragonBones.EllipseBoundingBoxData = EllipseBoundingBoxData; + /** + * - The polygon bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var PolygonBoundingBoxData = /** @class */ (function (_super) { + __extends(PolygonBoundingBoxData, _super); + function PolygonBoundingBoxData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - The polygon vertices. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形顶点。 + * @version DragonBones 5.1 + * @language zh_CN + */ + _this.vertices = []; + return _this; + } + PolygonBoundingBoxData.toString = function () { + return "[class dragonBones.PolygonBoundingBoxData]"; + }; + /** + * @private + */ + PolygonBoundingBoxData.polygonIntersectsSegment = function (xA, yA, xB, yB, vertices, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + if (xA === xB) { + xA = xB + 0.000001; + } + if (yA === yB) { + yA = yB + 0.000001; + } + var count = vertices.length; + var dXAB = xA - xB; + var dYAB = yA - yB; + var llAB = xA * yB - yA * xB; + var intersectionCount = 0; + var xC = vertices[count - 2]; + var yC = vertices[count - 1]; + var dMin = 0.0; + var dMax = 0.0; + var xMin = 0.0; + var yMin = 0.0; + var xMax = 0.0; + var yMax = 0.0; + for (var i = 0; i < count; i += 2) { + var xD = vertices[i]; + var yD = vertices[i + 1]; + if (xC === xD) { + xC = xD + 0.0001; + } + if (yC === yD) { + yC = yD + 0.0001; + } + var dXCD = xC - xD; + var dYCD = yC - yD; + var llCD = xC * yD - yC * xD; + var ll = dXAB * dYCD - dYAB * dXCD; + var x = (llAB * dXCD - dXAB * llCD) / ll; + if (((x >= xC && x <= xD) || (x >= xD && x <= xC)) && (dXAB === 0.0 || (x >= xA && x <= xB) || (x >= xB && x <= xA))) { + var y = (llAB * dYCD - dYAB * llCD) / ll; + if (((y >= yC && y <= yD) || (y >= yD && y <= yC)) && (dYAB === 0.0 || (y >= yA && y <= yB) || (y >= yB && y <= yA))) { + if (intersectionPointB !== null) { + var d = x - xA; + if (d < 0.0) { + d = -d; + } + if (intersectionCount === 0) { + dMin = d; + dMax = d; + xMin = x; + yMin = y; + xMax = x; + yMax = y; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + normalRadians.y = normalRadians.x; + } + } + else { + if (d < dMin) { + dMin = d; + xMin = x; + yMin = y; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + } + } + if (d > dMax) { + dMax = d; + xMax = x; + yMax = y; + if (normalRadians !== null) { + normalRadians.y = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + } + } + } + intersectionCount++; + } + else { + xMin = x; + yMin = y; + xMax = x; + yMax = y; + intersectionCount++; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + normalRadians.y = normalRadians.x; + } + break; + } + } + } + xC = xD; + yC = yD; + } + if (intersectionCount === 1) { + if (intersectionPointA !== null) { + intersectionPointA.x = xMin; + intersectionPointA.y = yMin; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xMin; + intersectionPointB.y = yMin; + } + if (normalRadians !== null) { + normalRadians.y = normalRadians.x + Math.PI; + } + } + else if (intersectionCount > 1) { + intersectionCount++; + if (intersectionPointA !== null) { + intersectionPointA.x = xMin; + intersectionPointA.y = yMin; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xMax; + intersectionPointB.y = yMax; + } + } + return intersectionCount; + }; + PolygonBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 2 /* Polygon */; + this.x = 0.0; + this.y = 0.0; + this.vertices.length = 0; + }; + /** + * @inheritDoc + */ + PolygonBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var isInSide = false; + if (pX >= this.x && pX <= this.width && pY >= this.y && pY <= this.height) { + for (var i = 0, l = this.vertices.length, iP = l - 2; i < l; i += 2) { + var yA = this.vertices[iP + 1]; + var yB = this.vertices[i + 1]; + if ((yB < pY && yA >= pY) || (yA < pY && yB >= pY)) { + var xA = this.vertices[iP]; + var xB = this.vertices[i]; + if ((pY - yB) * (xA - xB) / (yA - yB) + xB < pX) { + isInSide = !isInSide; + } + } + iP = i; + } + } + return isInSide; + }; + /** + * @inheritDoc + */ + PolygonBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var intersectionCount = 0; + if (RectangleBoundingBoxData.rectangleIntersectsSegment(xA, yA, xB, yB, this.x, this.y, this.x + this.width, this.y + this.height, null, null, null) !== 0) { + intersectionCount = PolygonBoundingBoxData.polygonIntersectsSegment(xA, yA, xB, yB, this.vertices, intersectionPointA, intersectionPointB, normalRadians); + } + return intersectionCount; + }; + return PolygonBoundingBoxData; + }(BoundingBoxData)); + dragonBones.PolygonBoundingBoxData = PolygonBoundingBoxData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var AnimationData = /** @class */ (function (_super) { + __extends(AnimationData, _super); + function AnimationData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.cachedFrames = []; + /** + * @private + */ + _this.boneTimelines = {}; + /** + * @private + */ + _this.slotTimelines = {}; + /** + * @private + */ + _this.constraintTimelines = {}; + /** + * @private + */ + _this.animationTimelines = {}; + /** + * @private + */ + _this.boneCachedFrameIndices = {}; + /** + * @private + */ + _this.slotCachedFrameIndices = {}; + /** + * @private + */ + _this.actionTimeline = null; // Initial value. + /** + * @private + */ + _this.zOrderTimeline = null; // Initial value. + return _this; + } + AnimationData.toString = function () { + return "[class dragonBones.AnimationData]"; + }; + AnimationData.prototype._onClear = function () { + for (var k in this.boneTimelines) { + for (var _i = 0, _a = this.boneTimelines[k]; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.returnToPool(); + } + delete this.boneTimelines[k]; + } + for (var k in this.slotTimelines) { + for (var _b = 0, _c = this.slotTimelines[k]; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.returnToPool(); + } + delete this.slotTimelines[k]; + } + for (var k in this.constraintTimelines) { + for (var _d = 0, _e = this.constraintTimelines[k]; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.returnToPool(); + } + delete this.constraintTimelines[k]; + } + for (var k in this.animationTimelines) { + for (var _f = 0, _g = this.animationTimelines[k]; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.returnToPool(); + } + delete this.animationTimelines[k]; + } + for (var k in this.boneCachedFrameIndices) { + delete this.boneCachedFrameIndices[k]; + } + for (var k in this.slotCachedFrameIndices) { + delete this.slotCachedFrameIndices[k]; + } + if (this.actionTimeline !== null) { + this.actionTimeline.returnToPool(); + } + if (this.zOrderTimeline !== null) { + this.zOrderTimeline.returnToPool(); + } + this.frameIntOffset = 0; + this.frameFloatOffset = 0; + this.frameOffset = 0; + this.blendType = 0 /* None */; + this.frameCount = 0; + this.playTimes = 0; + this.duration = 0.0; + this.scale = 1.0; + this.fadeInTime = 0.0; + this.cacheFrameRate = 0.0; + this.name = ""; + this.cachedFrames.length = 0; + // this.boneTimelines.clear(); + // this.slotTimelines.clear(); + // this.constraintTimelines.clear(); + // this.animationTimelines.clear(); + // this.boneCachedFrameIndices.clear(); + // this.slotCachedFrameIndices.clear(); + this.actionTimeline = null; + this.zOrderTimeline = null; + this.parent = null; // + }; + /** + * @internal + */ + AnimationData.prototype.cacheFrames = function (frameRate) { + if (this.cacheFrameRate > 0.0) { // TODO clear cache. + return; + } + this.cacheFrameRate = Math.max(Math.ceil(frameRate * this.scale), 1.0); + var cacheFrameCount = Math.ceil(this.cacheFrameRate * this.duration) + 1; // Cache one more frame. + this.cachedFrames.length = cacheFrameCount; + for (var i = 0, l = this.cacheFrames.length; i < l; ++i) { + this.cachedFrames[i] = false; + } + for (var _i = 0, _a = this.parent.sortedBones; _i < _a.length; _i++) { + var bone = _a[_i]; + var indices = new Array(cacheFrameCount); + for (var i = 0, l = indices.length; i < l; ++i) { + indices[i] = -1; + } + this.boneCachedFrameIndices[bone.name] = indices; + } + for (var _b = 0, _c = this.parent.sortedSlots; _b < _c.length; _b++) { + var slot = _c[_b]; + var indices = new Array(cacheFrameCount); + for (var i = 0, l = indices.length; i < l; ++i) { + indices[i] = -1; + } + this.slotCachedFrameIndices[slot.name] = indices; + } + }; + /** + * @private + */ + AnimationData.prototype.addBoneTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : (this.boneTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addSlotTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : (this.slotTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addConstraintTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : (this.constraintTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addAnimationTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.animationTimelines ? this.animationTimelines[timelineName] : (this.animationTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.getBoneTimelines = function (timelineName) { + return timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getSlotTimelines = function (timelineName) { + return timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getConstraintTimelines = function (timelineName) { + return timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getAnimationTimelines = function (timelineName) { + return timelineName in this.animationTimelines ? this.animationTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getBoneCachedFrameIndices = function (boneName) { + return boneName in this.boneCachedFrameIndices ? this.boneCachedFrameIndices[boneName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getSlotCachedFrameIndices = function (slotName) { + return slotName in this.slotCachedFrameIndices ? this.slotCachedFrameIndices[slotName] : null; + }; + return AnimationData; + }(dragonBones.BaseObject)); + dragonBones.AnimationData = AnimationData; + /** + * @private + */ + var TimelineData = /** @class */ (function (_super) { + __extends(TimelineData, _super); + function TimelineData() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimelineData.toString = function () { + return "[class dragonBones.TimelineData]"; + }; + TimelineData.prototype._onClear = function () { + this.type = 10 /* BoneAll */; + this.offset = 0; + this.frameIndicesOffset = -1; + }; + return TimelineData; + }(dragonBones.BaseObject)); + dragonBones.TimelineData = TimelineData; + /** + * @internal + */ + var AnimationTimelineData = /** @class */ (function (_super) { + __extends(AnimationTimelineData, _super); + function AnimationTimelineData() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationTimelineData.toString = function () { + return "[class dragonBones.AnimationTimelineData]"; + }; + AnimationTimelineData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.x = 0.0; + this.y = 0.0; + }; + return AnimationTimelineData; + }(TimelineData)); + dragonBones.AnimationTimelineData = AnimationTimelineData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation config is used to describe all the information needed to play an animation state. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画配置用来描述播放一个动画状态所需要的全部信息。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + var AnimationConfig = /** @class */ (function (_super) { + __extends(AnimationConfig, _super); + function AnimationConfig() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.boneMask = []; + return _this; + } + AnimationConfig.toString = function () { + return "[class dragonBones.AnimationConfig]"; + }; + AnimationConfig.prototype._onClear = function () { + this.pauseFadeOut = true; + this.fadeOutMode = 4 /* All */; + this.fadeOutTweenType = 1 /* Line */; + this.fadeOutTime = -1.0; + this.actionEnabled = true; + this.additive = false; + this.displayControl = true; + this.pauseFadeIn = true; + this.resetToPose = true; + this.fadeInTweenType = 1 /* Line */; + this.playTimes = -1; + this.layer = 0; + this.position = 0.0; + this.duration = -1.0; + this.timeScale = -100.0; + this.weight = 1.0; + this.fadeInTime = -1.0; + this.autoFadeOutTime = -1.0; + this.name = ""; + this.animation = ""; + this.group = ""; + this.boneMask.length = 0; + }; + /** + * @private + */ + AnimationConfig.prototype.clear = function () { + this._onClear(); + }; + /** + * @private + */ + AnimationConfig.prototype.copyFrom = function (value) { + this.pauseFadeOut = value.pauseFadeOut; + this.fadeOutMode = value.fadeOutMode; + this.autoFadeOutTime = value.autoFadeOutTime; + this.fadeOutTweenType = value.fadeOutTweenType; + this.actionEnabled = value.actionEnabled; + this.additive = value.additive; + this.displayControl = value.displayControl; + this.pauseFadeIn = value.pauseFadeIn; + this.resetToPose = value.resetToPose; + this.playTimes = value.playTimes; + this.layer = value.layer; + this.position = value.position; + this.duration = value.duration; + this.timeScale = value.timeScale; + this.fadeInTime = value.fadeInTime; + this.fadeOutTime = value.fadeOutTime; + this.fadeInTweenType = value.fadeInTweenType; + this.weight = value.weight; + this.name = value.name; + this.animation = value.animation; + this.group = value.group; + this.boneMask.length = value.boneMask.length; + for (var i = 0, l = this.boneMask.length; i < l; ++i) { + this.boneMask[i] = value.boneMask[i]; + } + }; + return AnimationConfig; + }(dragonBones.BaseObject)); + dragonBones.AnimationConfig = AnimationConfig; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var TextureAtlasData = /** @class */ (function (_super) { + __extends(TextureAtlasData, _super); + function TextureAtlasData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.textures = {}; + return _this; + } + TextureAtlasData.prototype._onClear = function () { + for (var k in this.textures) { + this.textures[k].returnToPool(); + delete this.textures[k]; + } + this.autoSearch = false; + this.width = 0; + this.height = 0; + this.scale = 1.0; + // this.textures.clear(); + this.name = ""; + this.imagePath = ""; + }; + /** + * @private + */ + TextureAtlasData.prototype.copyFrom = function (value) { + this.autoSearch = value.autoSearch; + this.scale = value.scale; + this.width = value.width; + this.height = value.height; + this.name = value.name; + this.imagePath = value.imagePath; + for (var k in this.textures) { + this.textures[k].returnToPool(); + delete this.textures[k]; + } + // this.textures.clear(); + for (var k in value.textures) { + var texture = this.createTexture(); + texture.copyFrom(value.textures[k]); + this.textures[k] = texture; + } + }; + /** + * @internal + */ + TextureAtlasData.prototype.addTexture = function (value) { + if (value.name in this.textures) { + console.warn("Same texture: " + value.name); + return; + } + value.parent = this; + this.textures[value.name] = value; + }; + /** + * @private + */ + TextureAtlasData.prototype.getTexture = function (textureName) { + return textureName in this.textures ? this.textures[textureName] : null; + }; + return TextureAtlasData; + }(dragonBones.BaseObject)); + dragonBones.TextureAtlasData = TextureAtlasData; + /** + * @private + */ + var TextureData = /** @class */ (function (_super) { + __extends(TextureData, _super); + function TextureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.region = new dragonBones.Rectangle(); + _this.frame = null; // Initial value. + return _this; + } + TextureData.createRectangle = function () { + return new dragonBones.Rectangle(); + }; + TextureData.prototype._onClear = function () { + this.rotated = false; + this.name = ""; + this.region.clear(); + this.parent = null; // + this.frame = null; + }; + TextureData.prototype.copyFrom = function (value) { + this.rotated = value.rotated; + this.name = value.name; + this.region.copyFrom(value.region); + this.parent = value.parent; + if (this.frame === null && value.frame !== null) { + this.frame = TextureData.createRectangle(); + } + else if (this.frame !== null && value.frame === null) { + this.frame = null; + } + if (this.frame !== null && value.frame !== null) { + this.frame.copyFrom(value.frame); + } + }; + return TextureData; + }(dragonBones.BaseObject)); + dragonBones.TextureData = TextureData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones_1) { + /** + * - Armature is the core of the skeleton animation system. + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架是骨骼动画系统的核心。 + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + var Armature = /** @class */ (function (_super) { + __extends(Armature, _super); + function Armature() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._bones = []; + _this._slots = []; + /** + * @internal + */ + _this._constraints = []; + _this._actions = []; + _this._animation = null; // Initial value. + _this._proxy = null; // Initial value. + /** + * @internal + */ + _this._replaceTextureAtlasData = null; // Initial value. + _this._clock = null; // Initial value. + return _this; + } + Armature.toString = function () { + return "[class dragonBones.Armature]"; + }; + Armature._onSortSlots = function (a, b) { + return a._zIndex * 1000 + a._zOrder > b._zIndex * 1000 + b._zOrder ? 1 : -1; + }; + Armature.prototype._onClear = function () { + if (this._clock !== null) { // Remove clock first. + this._clock.remove(this); + } + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + bone.returnToPool(); + } + for (var _b = 0, _c = this._slots; _b < _c.length; _b++) { + var slot = _c[_b]; + slot.returnToPool(); + } + for (var _d = 0, _e = this._constraints; _d < _e.length; _d++) { + var constraint = _e[_d]; + constraint.returnToPool(); + } + for (var _f = 0, _g = this._actions; _f < _g.length; _f++) { + var action = _g[_f]; + action.returnToPool(); + } + if (this._animation !== null) { + this._animation.returnToPool(); + } + if (this._proxy !== null) { + this._proxy.dbClear(); + } + if (this._replaceTextureAtlasData !== null) { + this._replaceTextureAtlasData.returnToPool(); + } + this.inheritAnimation = true; + this.userData = null; + this._lockUpdate = false; + this._slotsDirty = true; + this._zOrderDirty = false; + this._zIndexDirty = false; + this._alphaDirty = true; + this._flipX = false; + this._flipY = false; + this._cacheFrameIndex = -1; + this._alpha = 1.0; + this._globalAlpha = 1.0; + this._bones.length = 0; + this._slots.length = 0; + this._constraints.length = 0; + this._actions.length = 0; + this._armatureData = null; // + this._animation = null; // + this._proxy = null; // + this._display = null; + this._replaceTextureAtlasData = null; + this._replacedTexture = null; + this._dragonBones = null; // + this._clock = null; + this._parent = null; + }; + /** + * @internal + */ + Armature.prototype._sortZOrder = function (slotIndices, offset) { + var slotDatas = this._armatureData.sortedSlots; + var isOriginal = slotIndices === null; + if (this._zOrderDirty || !isOriginal) { + for (var i = 0, l = slotDatas.length; i < l; ++i) { + var slotIndex = isOriginal ? i : slotIndices[offset + i]; + if (slotIndex < 0 || slotIndex >= l) { + continue; + } + var slotData = slotDatas[slotIndex]; + var slot = this.getSlot(slotData.name); + if (slot !== null) { + slot._setZOrder(i); + } + } + this._slotsDirty = true; + this._zOrderDirty = !isOriginal; + } + }; + /** + * @internal + */ + Armature.prototype._addBone = function (value) { + if (this._bones.indexOf(value) < 0) { + this._bones.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._addSlot = function (value) { + if (this._slots.indexOf(value) < 0) { + this._slots.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._addConstraint = function (value) { + if (this._constraints.indexOf(value) < 0) { + this._constraints.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._bufferAction = function (action, append) { + if (this._actions.indexOf(action) < 0) { + if (append) { + this._actions.push(action); + } + else { + this._actions.unshift(action); + } + } + }; + /** + * - Dispose the armature. (Return to the object pool) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 释放骨架。 (回收到对象池) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.dispose = function () { + if (this._armatureData !== null) { + this._lockUpdate = true; + this._dragonBones.bufferObject(this); + } + }; + /** + * @internal + */ + Armature.prototype.init = function (armatureData, proxy, display, dragonBones) { + if (this._armatureData !== null) { + return; + } + this._armatureData = armatureData; + this._animation = dragonBones_1.BaseObject.borrowObject(dragonBones_1.Animation); + this._proxy = proxy; + this._display = display; + this._dragonBones = dragonBones; + this._proxy.dbInit(this); + this._animation.init(this); + this._animation.animations = this._armatureData.animations; + }; + /** + * @inheritDoc + */ + Armature.prototype.advanceTime = function (passedTime) { + if (this._lockUpdate) { + return; + } + this._lockUpdate = true; + if (this._armatureData === null) { + console.warn("The armature has been disposed."); + return; + } + else if (this._armatureData.parent === null) { + console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear()."); + return; + } + var prevCacheFrameIndex = this._cacheFrameIndex; + // Update animation. + this._animation.advanceTime(passedTime); + // Sort slots. + if (this._slotsDirty || this._zIndexDirty) { + this._slots.sort(Armature._onSortSlots); + if (this._zIndexDirty) { + for (var i = 0, l = this._slots.length; i < l; ++i) { + this._slots[i]._setZOrder(i); // + } + } + this._slotsDirty = false; + this._zIndexDirty = false; + } + // Update alpha. + if (this._alphaDirty) { + this._alphaDirty = false; + this._globalAlpha = this._alpha * (this._parent !== null ? this._parent._globalAlpha : 1.0); + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + bone._updateAlpha(); + } + for (var _b = 0, _c = this._slots; _b < _c.length; _b++) { + var slot = _c[_b]; + slot._updateAlpha(); + } + } + // Update bones and slots. + if (this._cacheFrameIndex < 0 || this._cacheFrameIndex !== prevCacheFrameIndex) { + var i = 0, l = 0; + for (i = 0, l = this._bones.length; i < l; ++i) { + this._bones[i].update(this._cacheFrameIndex); + } + for (i = 0, l = this._slots.length; i < l; ++i) { + this._slots[i].update(this._cacheFrameIndex); + } + } + // Do actions. + if (this._actions.length > 0) { + for (var _d = 0, _e = this._actions; _d < _e.length; _d++) { + var action = _e[_d]; + var actionData = action.actionData; + if (actionData !== null) { + if (actionData.type === 0 /* Play */) { + if (action.slot !== null) { + var childArmature = action.slot.childArmature; + if (childArmature !== null) { + childArmature.animation.fadeIn(actionData.name); + } + } + else if (action.bone !== null) { + for (var _f = 0, _g = this.getSlots(); _f < _g.length; _f++) { + var slot = _g[_f]; + if (slot.parent === action.bone) { + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.animation.fadeIn(actionData.name); + } + } + } + } + else { + this._animation.fadeIn(actionData.name); + } + } + } + action.returnToPool(); + } + this._actions.length = 0; + } + this._lockUpdate = false; + this._proxy.dbUpdate(); + }; + /** + * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. + * @param boneName - The bone name. (If not set, all bones will be update) + * @param updateSlot - Whether to update the bone's slots. (Default: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 + * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) + * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.invalidUpdate = function (boneName, updateSlot) { + if (boneName === void 0) { boneName = null; } + if (updateSlot === void 0) { updateSlot = false; } + if (boneName !== null && boneName.length > 0) { + var bone = this.getBone(boneName); + if (bone !== null) { + bone.invalidUpdate(); + if (updateSlot) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.parent === bone) { + slot.invalidUpdate(); + } + } + } + } + } + else { + for (var _b = 0, _c = this._bones; _b < _c.length; _b++) { + var bone = _c[_b]; + bone.invalidUpdate(); + } + if (updateSlot) { + for (var _d = 0, _e = this._slots; _d < _e.length; _d++) { + var slot = _e[_d]; + slot.invalidUpdate(); + } + } + } + }; + /** + * - Check whether a specific point is inside a custom bounding box in a slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在某个插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Armature.prototype.containsPoint = function (x, y) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.containsPoint(x, y)) { + return slot; + } + } + return null; + }; + /** + * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Armature.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var isV = xA === xB; + var dMin = 0.0; + var dMax = 0.0; + var intXA = 0.0; + var intYA = 0.0; + var intXB = 0.0; + var intYB = 0.0; + var intAN = 0.0; + var intBN = 0.0; + var intSlotA = null; + var intSlotB = null; + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var intersectionCount = slot.intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); + if (intersectionCount > 0) { + if (intersectionPointA !== null || intersectionPointB !== null) { + if (intersectionPointA !== null) { + var d = isV ? intersectionPointA.y - yA : intersectionPointA.x - xA; + if (d < 0.0) { + d = -d; + } + if (intSlotA === null || d < dMin) { + dMin = d; + intXA = intersectionPointA.x; + intYA = intersectionPointA.y; + intSlotA = slot; + if (normalRadians) { + intAN = normalRadians.x; + } + } + } + if (intersectionPointB !== null) { + var d = intersectionPointB.x - xA; + if (d < 0.0) { + d = -d; + } + if (intSlotB === null || d > dMax) { + dMax = d; + intXB = intersectionPointB.x; + intYB = intersectionPointB.y; + intSlotB = slot; + if (normalRadians !== null) { + intBN = normalRadians.y; + } + } + } + } + else { + intSlotA = slot; + break; + } + } + } + if (intSlotA !== null && intersectionPointA !== null) { + intersectionPointA.x = intXA; + intersectionPointA.y = intYA; + if (normalRadians !== null) { + normalRadians.x = intAN; + } + } + if (intSlotB !== null && intersectionPointB !== null) { + intersectionPointB.x = intXB; + intersectionPointB.y = intYB; + if (normalRadians !== null) { + normalRadians.y = intBN; + } + } + return intSlotA; + }; + /** + * - Get a specific bone. + * @param name - The bone name. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼。 + * @param name - 骨骼名称。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBone = function (name) { + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + if (bone.name === name) { + return bone; + } + } + return null; + }; + /** + * - Get a specific bone by the display. + * @param display - The display object. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的骨骼。 + * @param display - 显示对象。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBoneByDisplay = function (display) { + var slot = this.getSlotByDisplay(display); + return slot !== null ? slot.parent : null; + }; + /** + * - Get a specific slot. + * @param name - The slot name. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽。 + * @param name - 插槽名称。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlot = function (name) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.name === name) { + return slot; + } + } + return null; + }; + /** + * - Get a specific slot by the display. + * @param display - The display object. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的插槽。 + * @param display - 显示对象。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlotByDisplay = function (display) { + if (display !== null) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.display === display) { + return slot; + } + } + } + return null; + }; + /** + * - Get all bones. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBones = function () { + return this._bones; + }; + /** + * - Get all slots. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的插槽。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlots = function () { + return this._slots; + }; + Object.defineProperty(Armature.prototype, "flipX", { + /** + * - Whether to flip the armature horizontally. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架水平翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + get: function () { + return this._flipX; + }, + set: function (value) { + if (this._flipX === value) { + return; + } + this._flipX = value; + this.invalidUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "flipY", { + /** + * - Whether to flip the armature vertically. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架垂直翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + get: function () { + return this._flipY; + }, + set: function (value) { + if (this._flipY === value) { + return; + } + this._flipY = value; + this.invalidUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "cacheFrameRate", { + /** + * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. + * There is a certain amount of memory overhead to improve performance by caching animation data in memory. + * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. + * When the animation cache is turned on, some features will fail, such as the offset property of bone. + * @example + *
+             *     armature.cacheFrameRate = 24;
+             * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 + * @example + *
+             *     armature.cacheFrameRate = 24;
+             * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._armatureData.cacheFrameRate; + }, + set: function (value) { + if (this._armatureData.cacheFrameRate !== value) { + this._armatureData.cacheFrames(value); + // Set child armature frameRate. + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.cacheFrameRate = value; + } + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "name", { + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._armatureData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "armatureData", { + /** + * - The armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._armatureData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "animation", { + /** + * - The animation player. + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._animation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "proxy", { + /** + * @pivate + */ + get: function () { + return this._proxy; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "eventDispatcher", { + /** + * - The EventDispatcher instance of the armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架的 EventDispatcher 实例。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._proxy; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "display", { + /** + * - The display container. + * The display of the slot is displayed as the parent. + * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 显示容器实例。 + * 插槽的显示对象都会以此显示容器为父级。 + * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._display; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "replacedTexture", { + /** + * @private + */ + get: function () { + return this._replacedTexture; + }, + set: function (value) { + if (this._replacedTexture === value) { + return; + } + if (this._replaceTextureAtlasData !== null) { + this._replaceTextureAtlasData.returnToPool(); + this._replaceTextureAtlasData = null; + } + this._replacedTexture = value; + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + slot.invalidUpdate(); + slot.update(-1); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "clock", { + /** + * @inheritDoc + */ + get: function () { + return this._clock; + }, + set: function (value) { + if (this._clock === value) { + return; + } + if (this._clock !== null) { + this._clock.remove(this); + } + this._clock = value; + if (this._clock) { + this._clock.add(this); + } + // Update childArmature clock. + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.clock = this._clock; + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "parent", { + /** + * - Get the parent slot which the armature belongs to. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架所属的父插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Armature.prototype.getDisplay = function () { + return this._display; + }; + return Armature; + }(dragonBones_1.BaseObject)); + dragonBones_1.Armature = Armature; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The base class of the transform object. + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 变换对象的基类。 + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language zh_CN + */ + var TransformObject = /** @class */ (function (_super) { + __extends(TransformObject, _super); + function TransformObject() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - A matrix relative to the armature coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.globalTransformMatrix = new dragonBones.Matrix(); + /** + * - A transform relative to the armature coordinate system. + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的变换。 + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.global = new dragonBones.Transform(); + /** + * - The offset transform relative to the armature or the parent bone coordinate system. + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架或父骨骼坐标系的偏移变换。 + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.offset = new dragonBones.Transform(); + return _this; + } + /** + */ + TransformObject.prototype._onClear = function () { + this.globalTransformMatrix.identity(); + this.global.identity(); + this.offset.identity(); + this.origin = null; + this.userData = null; + this._globalDirty = false; + this._alpha = 1.0; + this._globalAlpha = 1.0; + this._armature = null; // + }; + /** + * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, + * some engines do not rely on these attributes to update rendering, such as Egret. + * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 + * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + TransformObject.prototype.updateGlobalTransform = function () { + if (this._globalDirty) { + this._globalDirty = false; + this.global.fromMatrix(this.globalTransformMatrix); + } + }; + Object.defineProperty(TransformObject.prototype, "armature", { + /** + * - The armature to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的骨架。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._armature; + }, + enumerable: true, + configurable: true + }); + TransformObject._helpMatrix = new dragonBones.Matrix(); + TransformObject._helpTransform = new dragonBones.Transform(); + TransformObject._helpPoint = new dragonBones.Point(); + return TransformObject; + }(dragonBones.BaseObject)); + dragonBones.TransformObject = TransformObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Bone is one of the most important logical units in the armature animation system, + * and is responsible for the realization of translate, rotation, scaling in the animations. + * A armature can contain multiple bones. + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 + * 一个骨架中可以包含多个骨骼。 + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + var Bone = /** @class */ (function (_super) { + __extends(Bone, _super); + function Bone() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @internal + */ + _this.animationPose = new dragonBones.Transform(); + return _this; + } + Bone.toString = function () { + return "[class dragonBones.Bone]"; + }; + Bone.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.offsetMode = 1 /* Additive */; + this.animationPose.identity(); + this._transformDirty = false; + this._childrenTransformDirty = false; + this._localDirty = true; + this._hasConstraint = false; + this._visible = true; + this._cachedFrameIndex = -1; + this._boneData = null; // + this._parent = null; // + this._cachedFrameIndices = null; + }; + Bone.prototype._updateGlobalTransformMatrix = function (isCache) { + // For typescript. + var boneData = this._boneData; + var global = this.global; + var globalTransformMatrix = this.globalTransformMatrix; + var origin = this.origin; + var offset = this.offset; + var animationPose = this.animationPose; + var parent = this._parent; // + var flipX = this._armature.flipX; + var flipY = this._armature.flipY === dragonBones.DragonBones.yDown; + var inherit = parent !== null; + var rotation = 0.0; + if (this.offsetMode === 1 /* Additive */) { + if (origin !== null) { + // global.copyFrom(this.origin).add(this.offset).add(this.animationPose); + global.x = origin.x + offset.x + animationPose.x; + global.scaleX = origin.scaleX * offset.scaleX * animationPose.scaleX; + global.scaleY = origin.scaleY * offset.scaleY * animationPose.scaleY; + if (dragonBones.DragonBones.yDown) { + global.y = origin.y + offset.y + animationPose.y; + global.skew = origin.skew + offset.skew + animationPose.skew; + global.rotation = origin.rotation + offset.rotation + animationPose.rotation; + } + else { + global.y = origin.y - offset.y + animationPose.y; + global.skew = origin.skew - offset.skew + animationPose.skew; + global.rotation = origin.rotation - offset.rotation + animationPose.rotation; + } + } + else { + global.copyFrom(offset); + if (!dragonBones.DragonBones.yDown) { + global.y = -global.y; + global.skew = -global.skew; + global.rotation = -global.rotation; + } + global.add(animationPose); + } + } + else if (this.offsetMode === 0 /* None */) { + if (origin !== null) { + global.copyFrom(origin).add(animationPose); + } + else { + global.copyFrom(animationPose); + } + } + else { + inherit = false; + global.copyFrom(offset); + if (!dragonBones.DragonBones.yDown) { + global.y = -global.y; + global.skew = -global.skew; + global.rotation = -global.rotation; + } + } + if (inherit) { + var isSurface = parent._boneData.type === 1 /* Surface */; + var surfaceBone = isSurface ? parent._bone : null; + var parentMatrix = isSurface ? parent._getGlobalTransformMatrix(global.x, global.y) : parent.globalTransformMatrix; + if (boneData.inheritScale && (!isSurface || surfaceBone !== null)) { + if (isSurface) { + if (boneData.inheritRotation) { + global.rotation += parent.global.rotation; + } + surfaceBone.updateGlobalTransform(); + global.scaleX *= surfaceBone.global.scaleX; + global.scaleY *= surfaceBone.global.scaleY; + parentMatrix.transformPoint(global.x, global.y, global); + global.toMatrix(globalTransformMatrix); + if (boneData.inheritTranslation) { + global.x = globalTransformMatrix.tx; + global.y = globalTransformMatrix.ty; + } + else { + globalTransformMatrix.tx = global.x; + globalTransformMatrix.ty = global.y; + } + } + else { + if (!boneData.inheritRotation) { + parent.updateGlobalTransform(); + if (flipX && flipY) { + rotation = global.rotation - (parent.global.rotation + Math.PI); + } + else if (flipX) { + rotation = global.rotation + parent.global.rotation + Math.PI; + } + else if (flipY) { + rotation = global.rotation + parent.global.rotation; + } + else { + rotation = global.rotation - parent.global.rotation; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + globalTransformMatrix.concat(parentMatrix); + if (boneData.inheritTranslation) { + global.x = globalTransformMatrix.tx; + global.y = globalTransformMatrix.ty; + } + else { + globalTransformMatrix.tx = global.x; + globalTransformMatrix.ty = global.y; + } + if (isCache) { + global.fromMatrix(globalTransformMatrix); + } + else { + this._globalDirty = true; + } + } + } + else { + if (boneData.inheritTranslation) { + var x = global.x; + var y = global.y; + global.x = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + global.y = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + } + else { + if (flipX) { + global.x = -global.x; + } + if (flipY) { + global.y = -global.y; + } + } + if (boneData.inheritRotation) { + parent.updateGlobalTransform(); + if (parent.global.scaleX < 0.0) { + rotation = global.rotation + parent.global.rotation + Math.PI; + } + else { + rotation = global.rotation + parent.global.rotation; + } + if (parentMatrix.a * parentMatrix.d - parentMatrix.b * parentMatrix.c < 0.0) { + rotation -= global.rotation * 2.0; + if (flipX !== flipY || boneData.inheritReflection) { + global.skew += Math.PI; + } + if (!dragonBones.DragonBones.yDown) { + global.skew = -global.skew; + } + } + global.rotation = rotation; + } + else if (flipX || flipY) { + if (flipX && flipY) { + rotation = global.rotation + Math.PI; + } + else { + if (flipX) { + rotation = Math.PI - global.rotation; + } + else { + rotation = -global.rotation; + } + global.skew += Math.PI; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + } + } + else { + if (flipX || flipY) { + if (flipX) { + global.x = -global.x; + } + if (flipY) { + global.y = -global.y; + } + if (flipX && flipY) { + rotation = global.rotation + Math.PI; + } + else { + if (flipX) { + rotation = Math.PI - global.rotation; + } + else { + rotation = -global.rotation; + } + global.skew += Math.PI; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + } + }; + /** + * @internal + */ + Bone.prototype._updateAlpha = function () { + if (this._parent !== null) { + this._globalAlpha = this._alpha * this._parent._globalAlpha; + } + else { + this._globalAlpha = this._alpha * this._armature._globalAlpha; + } + }; + /** + * @internal + */ + Bone.prototype.init = function (boneData, armatureValue) { + if (this._boneData !== null) { + return; + } + this._boneData = boneData; + this._armature = armatureValue; + this._alpha = this._boneData.alpha; + if (this._boneData.parent !== null) { + this._parent = this._armature.getBone(this._boneData.parent.name); + } + this._armature._addBone(this); + // + this.origin = this._boneData.transform; + }; + /** + * @internal + */ + Bone.prototype.update = function (cacheFrameIndex) { + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache. + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { // Has been Cached. + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || + (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet. + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) { + var constraint = _c[_b]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + if (this._transformDirty) { + this._transformDirty = false; + this._childrenTransformDirty = true; + // + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + if (this._localDirty) { + this._updateGlobalTransformMatrix(isCache); + } + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + // + } + else if (this._childrenTransformDirty) { + this._childrenTransformDirty = false; + } + this._localDirty = true; + }; + /** + * @internal + */ + Bone.prototype.updateByConstraint = function () { + if (this._localDirty) { + this._localDirty = false; + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { + this._updateGlobalTransformMatrix(true); + } + this._transformDirty = true; + } + }; + /** + * - Forces the bone to update the transform in the next frame. + * When the bone is not animated or its animation state is finished, the bone will not continue to update, + * and when the skeleton must be updated for some reason, the method needs to be called explicitly. + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制骨骼在下一帧更新变换。 + * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Bone.prototype.invalidUpdate = function () { + this._transformDirty = true; + }; + /** + * - Check whether the bone contains a specific bone. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查该骨骼是否包含特定的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Bone.prototype.contains = function (value) { + if (value === this) { + return false; + } + var ancestor = value; + while (ancestor !== this && ancestor !== null) { + ancestor = ancestor.parent; + } + return ancestor === this; + }; + Object.defineProperty(Bone.prototype, "boneData", { + /** + * - The bone data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._boneData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "visible", { + /** + * - The visible of all slots in the bone. + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 此骨骼所有插槽的可见。 + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._visible; + }, + set: function (value) { + if (this._visible === value) { + return; + } + this._visible = value; + for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.parent === this) { + slot._updateVisible(); + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "name", { + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._boneData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "parent", { + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return Bone; + }(dragonBones.TransformObject)); + dragonBones.Bone = Bone; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var Surface = /** @class */ (function (_super) { + __extends(Surface, _super); + function Surface() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._vertices = []; + _this._deformVertices = []; + /** + * - x1, y1, x2, y2, x3, y3, x4, y4, d1X, d1Y, d2X, d2Y + */ + _this._hullCache = []; + /** + * - Inside [flag, a, b, c, d, tx, ty], Outside [flag, a, b, c, d, tx, ty] + */ + _this._matrixCahce = []; + return _this; + } + Surface.toString = function () { + return "[class dragonBones.Surface]"; + }; + Surface.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._dX = 0.0; + this._dY = 0.0; + this._k = 0.0; + this._kX = 0.0; + this._kY = 0.0; + this._vertices.length = 0; + this._deformVertices.length = 0; + this._matrixCahce.length = 0; + this._hullCache.length = 0; + this._bone = null; + }; + Surface.prototype._getAffineTransform = function (x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown) { + var dabX = bX - aX; + var dabY = bY - aY; + var dacX = cX - aX; + var dacY = cY - aY; + transform.rotation = Math.atan2(dabY, dabX); + transform.skew = Math.atan2(dacY, dacX) - Math.PI * 0.5 - transform.rotation; + if (isDown) { + transform.rotation += Math.PI; + } + transform.scaleX = Math.sqrt(dabX * dabX + dabY * dabY) / lX; + transform.scaleY = Math.sqrt(dacX * dacX + dacY * dacY) / lY; + transform.toMatrix(matrix); + transform.x = matrix.tx = aX - (matrix.a * x + matrix.c * y); + transform.y = matrix.ty = aY - (matrix.b * x + matrix.d * y); + }; + Surface.prototype._updateVertices = function () { + var data = this._armature.armatureData.parent; + var geometry = this._boneData.geometry; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometry.offset + 0 /* GeometryVertexCount */]; + var verticesOffset = intArray[geometry.offset + 2 /* GeometryFloatOffset */]; + var vertices = this._vertices; + var animationVertices = this._deformVertices; + if (this._parent !== null) { + if (this._parent._boneData.type === 1 /* Surface */) { + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + var x = floatArray[verticesOffset + iD] + animationVertices[iD]; + var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + var matrix = this._parent._getGlobalTransformMatrix(x, y); + // + vertices[iD] = matrix.a * x + matrix.c * y + matrix.tx; + vertices[iD + 1] = matrix.b * x + matrix.d * y + matrix.ty; + } + } + else { + var parentMatrix = this._parent.globalTransformMatrix; + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + var x = floatArray[verticesOffset + iD] + animationVertices[iD]; + var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + // + vertices[iD] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + vertices[iD + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + } + } + } + else { + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + vertices[iD] = floatArray[verticesOffset + iD] + animationVertices[iD]; + vertices[iD + 1] = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + } + } + }; + Surface.prototype._updateGlobalTransformMatrix = function (isCache) { + // tslint:disable-next-line:no-unused-expression + isCache; + var segmentXD = this._boneData.segmentX * 2; + var lastIndex = this._vertices.length - 2; + var lA = 200.0; + // + var raX = this._vertices[0]; + var raY = this._vertices[1]; + var rbX = this._vertices[segmentXD]; + var rbY = this._vertices[segmentXD + 1]; + var rcX = this._vertices[lastIndex]; + var rcY = this._vertices[lastIndex + 1]; + var rdX = this._vertices[lastIndex - segmentXD]; + var rdY = this._vertices[lastIndex - segmentXD + 1]; + // + var dacX = raX + (rcX - raX) * 0.5; + var dacY = raY + (rcY - raY) * 0.5; + var dbdX = rbX + (rdX - rbX) * 0.5; + var dbdY = rbY + (rdY - rbY) * 0.5; + var aX = dacX + (dbdX - dacX) * 0.5; + var aY = dacY + (dbdY - dacY) * 0.5; + var bX = rbX + (rcX - rbX) * 0.5; + var bY = rbY + (rcY - rbY) * 0.5; + var cX = rdX + (rcX - rdX) * 0.5; + var cY = rdY + (rcY - rdY) * 0.5; + // TODO interpolation + this._getAffineTransform(0.0, 0.0, lA, lA, aX, aY, bX, bY, cX, cY, this.global, this.globalTransformMatrix, false); + this._globalDirty = false; + }; + Surface.prototype._getGlobalTransformMatrix = function (x, y) { + var lA = 200.0; + var lB = 1000.0; + if (x < -lB || lB < x || y < -lB || lB < y) { + return this.globalTransformMatrix; + } + var isDown = false; + var surfaceData = this._boneData; + var segmentX = surfaceData.segmentX; + var segmentY = surfaceData.segmentY; + var segmentXD = surfaceData.segmentX * 2; + var dX = this._dX; + var dY = this._dY; + var indexX = Math.floor((x + lA) / dX); // -1 ~ segmentX - 1 + var indexY = Math.floor((y + lA) / dY); // -1 ~ segmentY - 1 + var matrixIndex = 0; + var pX = indexX * dX - lA; + var pY = indexY * dY - lA; + // + var matrices = this._matrixCahce; + var helpMatrix = Surface._helpMatrix; + if (x < -lA) { + if (y < -lA || y >= lA) { // Out. + return this.globalTransformMatrix; + } + // Left. + isDown = y > this._kX * (x + lA) + pY; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexY * (segmentXD + 2); + var ddX = this._hullCache[4]; + var ddY = this._hullCache[5]; + var sX = this._hullCache[2] - (segmentY - indexY) * ddX; + var sY = this._hullCache[3] - (segmentY - indexY) * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(-lA, pY + dY, lB - lA, dY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], sX + ddX, sY + ddY, vertices[vertexIndex], vertices[vertexIndex + 1], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(-lB, pY, lB - lA, dY, sX, sY, vertices[vertexIndex], vertices[vertexIndex + 1], sX + ddX, sY + ddY, Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (x >= lA) { + if (y < -lA || y >= lA) { // Out. + return this.globalTransformMatrix; + } + // Right. + isDown = y > this._kX * (x - lB) + pY; + matrixIndex = ((segmentX * segmentY + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = (indexY + 1) * (segmentXD + 2) - 2; + var ddX = this._hullCache[4]; + var ddY = this._hullCache[5]; + var sX = this._hullCache[0] + indexY * ddX; + var sY = this._hullCache[1] + indexY * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(lB, pY + dY, lB - lA, dY, sX + ddX, sY + ddY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], sX, sY, Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(lA, pY, lB - lA, dY, vertices[vertexIndex], vertices[vertexIndex + 1], sX, sY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (y < -lA) { + if (x < -lA || x >= lA) { // Out. + return this.globalTransformMatrix; + } + // Up. + isDown = y > this._kY * (x - pX - dX) - lB; + matrixIndex = ((segmentX * segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexX * 2; + var ddX = this._hullCache[10]; + var ddY = this._hullCache[11]; + var sX = this._hullCache[8] + indexX * ddX; + var sY = this._hullCache[9] + indexX * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, -lA, dX, lB - lA, vertices[vertexIndex + 2], vertices[vertexIndex + 3], vertices[vertexIndex], vertices[vertexIndex + 1], sX + ddX, sY + ddY, Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, -lB, dX, lB - lA, sX, sY, sX + ddX, sY + ddY, vertices[vertexIndex], vertices[vertexIndex + 1], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (y >= lA) { + if (x < -lA || x >= lA) { // Out. + return this.globalTransformMatrix; + } + // Down + isDown = y > this._kY * (x - pX - dX) + lA; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = segmentY * (segmentXD + 2) + indexX * 2; + var ddX = this._hullCache[10]; + var ddY = this._hullCache[11]; + var sX = this._hullCache[6] - (segmentX - indexX) * ddX; + var sY = this._hullCache[7] - (segmentX - indexX) * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, lB, dX, lB - lA, sX + ddX, sY + ddY, sX, sY, vertices[vertexIndex + 2], vertices[vertexIndex + 3], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, lA, dX, lB - lA, vertices[vertexIndex], vertices[vertexIndex + 1], vertices[vertexIndex + 2], vertices[vertexIndex + 3], sX, sY, Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else { // Center. + isDown = y > this._k * (x - pX - dX) + pY; + matrixIndex = ((segmentX * indexY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexX * 2 + indexY * (segmentXD + 2); + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, pY + dY, dX, dY, vertices[vertexIndex + segmentXD + 4], vertices[vertexIndex + segmentXD + 5], vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], vertices[vertexIndex + 2], vertices[vertexIndex + 3], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, pY, dX, dY, vertices[vertexIndex], vertices[vertexIndex + 1], vertices[vertexIndex + 2], vertices[vertexIndex + 3], vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + return helpMatrix; + }; + /** + * @internal + * @private + */ + Surface.prototype.init = function (surfaceData, armatureValue) { + if (this._boneData !== null) { + return; + } + _super.prototype.init.call(this, surfaceData, armatureValue); + var segmentX = surfaceData.segmentX; + var segmentY = surfaceData.segmentY; + var vertexCount = this._armature.armatureData.parent.intArray[surfaceData.geometry.offset + 0 /* GeometryVertexCount */]; + var lB = 1000.0; + var lA = 200.0; + // + this._dX = lA * 2.0 / segmentX; + this._dY = lA * 2.0 / segmentY; + this._k = -this._dY / this._dX; + this._kX = -this._dY / (lB - lA); + this._kY = -(lB - lA) / this._dX; + this._vertices.length = vertexCount * 2; + this._deformVertices.length = vertexCount * 2; + this._matrixCahce.length = (segmentX * segmentY + segmentX * 2 + segmentY * 2) * 2 * 7; + this._hullCache.length = 10; + for (var i = 0; i < vertexCount * 2; ++i) { + this._deformVertices[i] = 0.0; + } + if (this._parent !== null) { + if (this._parent.boneData.type === 0 /* Bone */) { + this._bone = this._parent; + } + else { + this._bone = this._parent._bone; + } + } + }; + /** + * @internal + */ + Surface.prototype.update = function (cacheFrameIndex) { + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache. + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { // Has been Cached. + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || + (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet. + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) { + var constraint = _c[_b]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + if (this._transformDirty) { + this._transformDirty = false; + this._childrenTransformDirty = true; + // + for (var i = 0, l = this._matrixCahce.length; i < l; i += 7) { + this._matrixCahce[i] = -1.0; + } + // + this._updateVertices(); + // + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + if (this._localDirty) { + this._updateGlobalTransformMatrix(isCache); + } + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + // Update hull vertices. + var lB = 1000.0; + var lA = 200.0; + var ddX = 2 * this.global.x; + var ddY = 2 * this.global.y; + // + var helpPoint = Surface._helpPoint; + this.globalTransformMatrix.transformPoint(lB, -lA, helpPoint); + this._hullCache[0] = helpPoint.x; + this._hullCache[1] = helpPoint.y; + this._hullCache[2] = ddX - helpPoint.x; + this._hullCache[3] = ddY - helpPoint.y; + this.globalTransformMatrix.transformPoint(0.0, this._dY, helpPoint, true); + this._hullCache[4] = helpPoint.x; + this._hullCache[5] = helpPoint.y; + // + this.globalTransformMatrix.transformPoint(lA, lB, helpPoint); + this._hullCache[6] = helpPoint.x; + this._hullCache[7] = helpPoint.y; + this._hullCache[8] = ddX - helpPoint.x; + this._hullCache[9] = ddY - helpPoint.y; + this.globalTransformMatrix.transformPoint(this._dX, 0.0, helpPoint, true); + this._hullCache[10] = helpPoint.x; + this._hullCache[11] = helpPoint.y; + } + else if (this._childrenTransformDirty) { + this._childrenTransformDirty = false; + } + this._localDirty = true; + }; + return Surface; + }(dragonBones.Bone)); + dragonBones.Surface = Surface; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DisplayFrame = /** @class */ (function (_super) { + __extends(DisplayFrame, _super); + function DisplayFrame() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.deformVertices = []; + return _this; + } + DisplayFrame.toString = function () { + return "[class dragonBones.DisplayFrame]"; + }; + DisplayFrame.prototype._onClear = function () { + this.rawDisplayData = null; + this.displayData = null; + this.textureData = null; + this.display = null; + this.deformVertices.length = 0; + }; + DisplayFrame.prototype.updateDeformVertices = function () { + if (this.rawDisplayData === null || this.deformVertices.length !== 0) { + return; + } + var rawGeometryData; + if (this.rawDisplayData.type === 2 /* Mesh */) { + rawGeometryData = this.rawDisplayData.geometry; + } + else if (this.rawDisplayData.type === 4 /* Path */) { + rawGeometryData = this.rawDisplayData.geometry; + } + else { + return; + } + var vertexCount = 0; + if (rawGeometryData.weight !== null) { + vertexCount = rawGeometryData.weight.count * 2; + } + else { + vertexCount = rawGeometryData.data.intArray[rawGeometryData.offset + 0 /* GeometryVertexCount */] * 2; + } + this.deformVertices.length = vertexCount; + for (var i = 0, l = this.deformVertices.length; i < l; ++i) { + this.deformVertices[i] = 0.0; + } + }; + DisplayFrame.prototype.getGeometryData = function () { + if (this.displayData !== null) { + if (this.displayData.type === 2 /* Mesh */) { + return this.displayData.geometry; + } + if (this.displayData.type === 4 /* Path */) { + return this.displayData.geometry; + } + } + if (this.rawDisplayData !== null) { + if (this.rawDisplayData.type === 2 /* Mesh */) { + return this.rawDisplayData.geometry; + } + if (this.rawDisplayData.type === 4 /* Path */) { + return this.rawDisplayData.geometry; + } + } + return null; + }; + DisplayFrame.prototype.getBoundingBox = function () { + if (this.displayData !== null && this.displayData.type === 3 /* BoundingBox */) { + return this.displayData.boundingBox; + } + if (this.rawDisplayData !== null && this.rawDisplayData.type === 3 /* BoundingBox */) { + return this.rawDisplayData.boundingBox; + } + return null; + }; + DisplayFrame.prototype.getTextureData = function () { + if (this.displayData !== null) { + if (this.displayData.type === 0 /* Image */) { + return this.displayData.texture; + } + if (this.displayData.type === 2 /* Mesh */) { + return this.displayData.texture; + } + } + if (this.textureData !== null) { + return this.textureData; + } + if (this.rawDisplayData !== null) { + if (this.rawDisplayData.type === 0 /* Image */) { + return this.rawDisplayData.texture; + } + if (this.rawDisplayData.type === 2 /* Mesh */) { + return this.rawDisplayData.texture; + } + } + return null; + }; + return DisplayFrame; + }(dragonBones.BaseObject)); + dragonBones.DisplayFrame = DisplayFrame; + /** + * - The slot attached to the armature, controls the display status and properties of the display object. + * A bone can contain multiple slots. + * A slot can contain multiple display objects, displaying only one of the display objects at a time, + * but you can toggle the display object into frame animation while the animation is playing. + * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, + * and a custom other display object. + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language zh_CN + */ + var Slot = /** @class */ (function (_super) { + __extends(Slot, _super); + function Slot() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._localMatrix = new dragonBones.Matrix(); + /** + * @internal + */ + _this._colorTransform = new dragonBones.ColorTransform(); + /** + * @internal + */ + _this._displayFrames = []; + /** + * @internal + */ + _this._geometryBones = []; + _this._rawDisplay = null; // Initial value. + _this._meshDisplay = null; // Initial value. + _this._display = null; + return _this; + } + Slot.prototype._onClear = function () { + _super.prototype._onClear.call(this); + var disposeDisplayList = []; + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var dispayFrame = _a[_i]; + var display = dispayFrame.display; + if (display !== this._rawDisplay && display !== this._meshDisplay && + disposeDisplayList.indexOf(display) < 0) { + disposeDisplayList.push(display); + } + dispayFrame.returnToPool(); + } + for (var _b = 0, disposeDisplayList_1 = disposeDisplayList; _b < disposeDisplayList_1.length; _b++) { + var eachDisplay = disposeDisplayList_1[_b]; + if (eachDisplay instanceof dragonBones.Armature) { + eachDisplay.dispose(); + } + else { + this._disposeDisplay(eachDisplay, true); + } + } + if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) { // May be _meshDisplay and _rawDisplay is the same one. + this._disposeDisplay(this._meshDisplay, false); + } + if (this._rawDisplay !== null) { + this._disposeDisplay(this._rawDisplay, false); + } + this.displayController = null; + this._displayDataDirty = false; + this._displayDirty = false; + this._geometryDirty = false; + this._textureDirty = false; + this._visibleDirty = false; + this._blendModeDirty = false; + this._zOrderDirty = false; + this._colorDirty = false; + this._verticesDirty = false; + this._transformDirty = false; + this._visible = true; + this._blendMode = 0 /* Normal */; + this._displayIndex = -1; + this._animationDisplayIndex = -1; + this._zOrder = 0; + this._zIndex = 0; + this._cachedFrameIndex = -1; + this._pivotX = 0.0; + this._pivotY = 0.0; + this._localMatrix.identity(); + this._colorTransform.identity(); + this._displayFrames.length = 0; + this._geometryBones.length = 0; + this._slotData = null; // + this._displayFrame = null; + this._geometryData = null; + this._boundingBoxData = null; + this._textureData = null; + this._rawDisplay = null; + this._meshDisplay = null; + this._display = null; + this._childArmature = null; + this._parent = null; // + this._cachedFrameIndices = null; + }; + Slot.prototype._hasDisplay = function (display) { + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var displayFrame = _a[_i]; + if (displayFrame.display === display) { + return true; + } + } + return false; + }; + /** + * @internal + */ + Slot.prototype._isBonesUpdate = function () { + for (var _i = 0, _a = this._geometryBones; _i < _a.length; _i++) { + var bone = _a[_i]; + if (bone !== null && bone._childrenTransformDirty) { + return true; + } + } + return false; + }; + /** + * @internal + */ + Slot.prototype._updateAlpha = function () { + var globalAlpha = this._alpha * this._parent._globalAlpha; + if (this._globalAlpha !== globalAlpha) { + this._globalAlpha = globalAlpha; + this._colorDirty = true; + } + }; + Slot.prototype._updateDisplayData = function () { + var prevDisplayFrame = this._displayFrame; + var prevGeometryData = this._geometryData; + var prevTextureData = this._textureData; + var rawDisplayData = null; + var displayData = null; + this._displayFrame = null; + this._geometryData = null; + this._boundingBoxData = null; + this._textureData = null; + if (this._displayIndex >= 0 && this._displayIndex < this._displayFrames.length) { + this._displayFrame = this._displayFrames[this._displayIndex]; + rawDisplayData = this._displayFrame.rawDisplayData; + displayData = this._displayFrame.displayData; + this._geometryData = this._displayFrame.getGeometryData(); + this._boundingBoxData = this._displayFrame.getBoundingBox(); + this._textureData = this._displayFrame.getTextureData(); + } + if (this._displayFrame !== prevDisplayFrame || + this._geometryData !== prevGeometryData || this._textureData !== prevTextureData) { + // Update pivot offset. + if (this._geometryData === null && this._textureData !== null) { + var imageDisplayData = ((displayData !== null && displayData.type === 0 /* Image */) ? displayData : rawDisplayData); // + var scale = this._textureData.parent.scale * this._armature._armatureData.scale; + var frame = this._textureData.frame; + this._pivotX = imageDisplayData.pivot.x; + this._pivotY = imageDisplayData.pivot.y; + var rect = frame !== null ? frame : this._textureData.region; + var width = rect.width; + var height = rect.height; + if (this._textureData.rotated && frame === null) { + width = rect.height; + height = rect.width; + } + this._pivotX *= width * scale; + this._pivotY *= height * scale; + if (frame !== null) { + this._pivotX += frame.x * scale; + this._pivotY += frame.y * scale; + } + // Update replace pivot. TODO + if (rawDisplayData !== null && imageDisplayData !== rawDisplayData) { + rawDisplayData.transform.toMatrix(Slot._helpMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint); + this._pivotX -= Slot._helpPoint.x; + this._pivotY -= Slot._helpPoint.y; + imageDisplayData.transform.toMatrix(Slot._helpMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint); + this._pivotX += Slot._helpPoint.x; + this._pivotY += Slot._helpPoint.y; + } + if (!dragonBones.DragonBones.yDown) { + this._pivotY = (this._textureData.rotated ? this._textureData.region.width : this._textureData.region.height) * scale - this._pivotY; + } + } + else { + this._pivotX = 0.0; + this._pivotY = 0.0; + } + // Update original transform. + if (rawDisplayData !== null) { // Compatible. + this.origin = rawDisplayData.transform; + } + else if (displayData !== null) { // Compatible. + this.origin = displayData.transform; + } + else { + this.origin = null; + } + // TODO remove slot offset. + if (this.origin !== null) { + this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix); + } + else { + this.global.copyFrom(this.offset).toMatrix(this._localMatrix); + } + // Update geometry. + if (this._geometryData !== prevGeometryData) { + this._geometryDirty = true; + this._verticesDirty = true; + if (this._geometryData !== null) { + this._geometryBones.length = 0; + if (this._geometryData.weight !== null) { + for (var i = 0, l = this._geometryData.weight.bones.length; i < l; ++i) { + var bone = this._armature.getBone(this._geometryData.weight.bones[i].name); + this._geometryBones.push(bone); + } + } + } + else { + this._geometryBones.length = 0; + this._geometryData = null; + } + } + this._textureDirty = this._textureData !== prevTextureData; + this._transformDirty = true; + } + }; + Slot.prototype._updateDisplay = function () { + var prevDisplay = this._display !== null ? this._display : this._rawDisplay; + var prevChildArmature = this._childArmature; + // Update display and child armature. + if (this._displayFrame !== null) { + this._display = this._displayFrame.display; + if (this._display !== null && this._display instanceof dragonBones.Armature) { + this._childArmature = this._display; + this._display = this._childArmature.display; + } + else { + this._childArmature = null; + } + } + else { + this._display = null; + this._childArmature = null; + } + // Update display. + var currentDisplay = this._display !== null ? this._display : this._rawDisplay; + if (currentDisplay !== prevDisplay) { + this._textureDirty = true; + this._visibleDirty = true; + this._blendModeDirty = true; + // this._zOrderDirty = true; + this._colorDirty = true; + this._transformDirty = true; + this._onUpdateDisplay(); + this._replaceDisplay(prevDisplay); + } + // Update child armature. + if (this._childArmature !== prevChildArmature) { + if (prevChildArmature !== null) { + prevChildArmature._parent = null; // Update child armature parent. + prevChildArmature.clock = null; + if (prevChildArmature.inheritAnimation) { + prevChildArmature.animation.reset(); + } + } + if (this._childArmature !== null) { + this._childArmature._parent = this; // Update child armature parent. + this._childArmature.clock = this._armature.clock; + if (this._childArmature.inheritAnimation) { // Set child armature cache frameRate. + if (this._childArmature.cacheFrameRate === 0) { + var cacheFrameRate = this._armature.cacheFrameRate; + if (cacheFrameRate !== 0) { + this._childArmature.cacheFrameRate = cacheFrameRate; + } + } + // Child armature action. + if (this._displayFrame !== null) { + var actions = null; + var displayData = this._displayFrame.displayData !== null ? this._displayFrame.displayData : this._displayFrame.rawDisplayData; + if (displayData !== null && displayData.type === 1 /* Armature */) { + actions = displayData.actions; + } + if (actions !== null && actions.length > 0) { + for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) { + var action = actions_1[_i]; + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + eventObject.slot = this; + this._armature._bufferAction(eventObject, false); + } + } + else { + this._childArmature.animation.play(); + } + } + } + } + } + }; + Slot.prototype._updateGlobalTransformMatrix = function (isCache) { + var parentMatrix = this._parent._boneData.type === 0 /* Bone */ ? this._parent.globalTransformMatrix : this._parent._getGlobalTransformMatrix(this.global.x, this.global.y); + this.globalTransformMatrix.copyFrom(this._localMatrix); + this.globalTransformMatrix.concat(parentMatrix); + if (isCache) { + this.global.fromMatrix(this.globalTransformMatrix); + } + else { + this._globalDirty = true; + } + }; + /** + * @internal + */ + Slot.prototype._setDisplayIndex = function (value, isAnimation) { + if (isAnimation === void 0) { isAnimation = false; } + if (isAnimation) { + if (this._animationDisplayIndex === value) { + return; + } + this._animationDisplayIndex = value; + } + if (this._displayIndex === value) { + return; + } + this._displayIndex = value < this._displayFrames.length ? value : this._displayFrames.length - 1; + this._displayDataDirty = true; + this._displayDirty = this._displayIndex < 0 || this._display !== this._displayFrames[this._displayIndex].display; + }; + /** + * @internal + */ + Slot.prototype._setZOrder = function (value) { + if (this._zOrder === value) { + // return false; + } + this._zOrder = value; + this._zOrderDirty = true; + return this._zOrderDirty; + }; + /** + * @internal + */ + Slot.prototype._setColor = function (value) { + this._colorTransform.copyFrom(value); + return this._colorDirty = true; + }; + /** + * @internal + */ + Slot.prototype.init = function (slotData, armatureValue, rawDisplay, meshDisplay) { + if (this._slotData !== null) { + return; + } + this._slotData = slotData; + this._colorDirty = true; // + this._blendModeDirty = true; // + this._blendMode = this._slotData.blendMode; + this._zOrder = this._slotData.zOrder; + this._zIndex = this._slotData.zIndex; + this._alpha = this._slotData.alpha; + this._colorTransform.copyFrom(this._slotData.color); + this._rawDisplay = rawDisplay; + this._meshDisplay = meshDisplay; + // + this._armature = armatureValue; + var slotParent = this._armature.getBone(this._slotData.parent.name); + if (slotParent !== null) { + this._parent = slotParent; + } + else { + // Never; + } + this._armature._addSlot(this); + // + this._initDisplay(this._rawDisplay, false); + if (this._rawDisplay !== this._meshDisplay) { + this._initDisplay(this._meshDisplay, false); + } + this._onUpdateDisplay(); + this._addDisplay(); + }; + /** + * @internal + */ + Slot.prototype.update = function (cacheFrameIndex) { + if (this._displayDataDirty) { + this._updateDisplayData(); + this._displayDataDirty = false; + } + if (this._displayDirty) { + this._updateDisplay(); + this._displayDirty = false; + } + if (this._geometryDirty || this._textureDirty) { + if (this._display === null || this._display === this._rawDisplay || this._display === this._meshDisplay) { + this._updateFrame(); + } + this._geometryDirty = false; + this._textureDirty = false; + } + if (this._display === null) { + return; + } + if (this._visibleDirty) { + this._updateVisible(); + this._visibleDirty = false; + } + if (this._blendModeDirty) { + this._updateBlendMode(); + this._blendModeDirty = false; + } + if (this._colorDirty) { + this._updateColor(); + this._colorDirty = false; + } + if (this._zOrderDirty) { + this._updateZOrder(); + this._zOrderDirty = false; + } + if (this._geometryData !== null && this._display === this._meshDisplay) { + var isSkinned = this._geometryData.weight !== null; + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + if (this._verticesDirty || + (isSkinned && this._isBonesUpdate()) || + (isSurface && this._parent._childrenTransformDirty)) { + this._verticesDirty = false; // Allow update mesh to reset the dirty value. + this._updateMesh(); + } + if (isSkinned || isSurface) { // Compatible. + return; + } + } + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache. + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { // Has been Cached. + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else if (this._transformDirty || this._parent._childrenTransformDirty) { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet. + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + else if (this._transformDirty || this._parent._childrenTransformDirty) { // Dirty. + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + if (this._transformDirty) { + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + this._updateGlobalTransformMatrix(isCache); + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + this._updateTransform(); + this._transformDirty = false; + } + }; + /** + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Slot.prototype.invalidUpdate = function () { + this._displayDataDirty = true; + this._displayDirty = true; + // + this._transformDirty = true; + }; + /** + * @private + */ + Slot.prototype.updateTransformAndMatrix = function () { + if (this._transformDirty) { + this._updateGlobalTransformMatrix(false); + this._transformDirty = false; + } + }; + /** + * @private + */ + Slot.prototype.replaceRawDisplayData = function (displayData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.rawDisplayData !== displayData) { + displayFrame.deformVertices.length = 0; + displayFrame.rawDisplayData = displayData; + if (displayFrame.rawDisplayData === null) { + var defaultSkin = this._armature._armatureData.defaultSkin; + if (defaultSkin !== null) { + var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name); + if (defaultRawDisplayDatas !== null && index < defaultRawDisplayDatas.length) { + displayFrame.rawDisplayData = defaultRawDisplayDatas[index]; + } + } + } + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceDisplayData = function (displayData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.displayData !== displayData && displayFrame.rawDisplayData !== displayData) { + displayFrame.displayData = displayData; + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceTextureData = function (textureData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.textureData !== textureData) { + displayFrame.textureData = textureData; + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceDisplay = function (value, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.display !== value) { + var prevDisplay = displayFrame.display; + displayFrame.display = value; + if (prevDisplay !== null && + prevDisplay !== this._rawDisplay && prevDisplay !== this._meshDisplay && + !this._hasDisplay(prevDisplay)) { + if (prevDisplay instanceof dragonBones.Armature) { + // (eachDisplay as Armature).dispose(); + } + else { + this._disposeDisplay(prevDisplay, true); + } + } + if (value !== null && + value !== this._rawDisplay && value !== this._meshDisplay && + !this._hasDisplay(prevDisplay) && + !(value instanceof dragonBones.Armature)) { + this._initDisplay(value, true); + } + if (index === this._displayIndex) { + this._displayDirty = true; + } + } + }; + /** + * - Check whether a specific point is inside a custom bounding box in the slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Slot.prototype.containsPoint = function (x, y) { + if (this._boundingBoxData === null) { + return false; + } + this.updateTransformAndMatrix(); + Slot._helpMatrix.copyFrom(this.globalTransformMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(x, y, Slot._helpPoint); + return this._boundingBoxData.containsPoint(Slot._helpPoint.x, Slot._helpPoint.y); + }; + /** + * - Check whether a specific segment intersects a custom bounding box for the slot. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] + * @version DragonBones 5.0 + * @language zh_CN + */ + Slot.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + if (this._boundingBoxData === null) { + return 0; + } + this.updateTransformAndMatrix(); + Slot._helpMatrix.copyFrom(this.globalTransformMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(xA, yA, Slot._helpPoint); + xA = Slot._helpPoint.x; + yA = Slot._helpPoint.y; + Slot._helpMatrix.transformPoint(xB, yB, Slot._helpPoint); + xB = Slot._helpPoint.x; + yB = Slot._helpPoint.y; + var intersectionCount = this._boundingBoxData.intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); + if (intersectionCount > 0) { + if (intersectionCount === 1 || intersectionCount === 2) { + if (intersectionPointA !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointA.x, intersectionPointA.y, intersectionPointA); + if (intersectionPointB !== null) { + intersectionPointB.x = intersectionPointA.x; + intersectionPointB.y = intersectionPointA.y; + } + } + else if (intersectionPointB !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointB.x, intersectionPointB.y, intersectionPointB); + } + } + else { + if (intersectionPointA !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointA.x, intersectionPointA.y, intersectionPointA); + } + if (intersectionPointB !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointB.x, intersectionPointB.y, intersectionPointB); + } + } + if (normalRadians !== null) { + this.globalTransformMatrix.transformPoint(Math.cos(normalRadians.x), Math.sin(normalRadians.x), Slot._helpPoint, true); + normalRadians.x = Math.atan2(Slot._helpPoint.y, Slot._helpPoint.x); + this.globalTransformMatrix.transformPoint(Math.cos(normalRadians.y), Math.sin(normalRadians.y), Slot._helpPoint, true); + normalRadians.y = Math.atan2(Slot._helpPoint.y, Slot._helpPoint.x); + } + } + return intersectionCount; + }; + /** + * @private + */ + Slot.prototype.getDisplayFrameAt = function (index) { + return this._displayFrames[index]; + }; + Object.defineProperty(Slot.prototype, "visible", { + /** + * - The visible of slot's display object. + * @default true + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 插槽的显示对象的可见。 + * @default true + * @version DragonBones 5.6 + * @language zh_CN + */ + get: function () { + return this._visible; + }, + set: function (value) { + if (this._visible === value) { + return; + } + this._visible = value; + this._updateVisible(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayFrameCount", { + /** + * @private + */ + get: function () { + return this._displayFrames.length; + }, + set: function (value) { + var prevCount = this._displayFrames.length; + if (prevCount < value) { + this._displayFrames.length = value; + for (var i = prevCount; i < value; ++i) { + this._displayFrames[i] = dragonBones.BaseObject.borrowObject(DisplayFrame); + } + } + else if (prevCount > value) { + for (var i = prevCount - 1; i < value; --i) { + this.replaceDisplay(null, i); + this._displayFrames[i].returnToPool(); + } + this._displayFrames.length = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayIndex", { + /** + * - The index of the display object displayed in the display list. + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     slot.displayIndex = 3;
+             *     slot.displayController = "none";
+             * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 此时显示的显示对象在显示列表中的索引。 + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     slot.displayIndex = 3;
+             *     slot.displayController = "none";
+             * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._displayIndex; + }, + set: function (value) { + this._setDisplayIndex(value); + this.update(-1); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "name", { + /** + * - The slot name. + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._slotData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayList", { + /** + * - Contains a display list of display objects or child armatures. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + var displays = new Array(); + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var displayFrame = _a[_i]; + displays.push(displayFrame.display); + } + return displays; + }, + set: function (value) { + this.displayFrameCount = value.length; + var index = 0; + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var eachDisplay = value_1[_i]; + this.replaceDisplay(eachDisplay, index++); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "slotData", { + /** + * - The slot data. + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 插槽数据。 + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._slotData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "boundingBoxData", { + /** + * - The custom bounding box data for the slot at current time. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 插槽此时的自定义包围盒数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + get: function () { + return this._boundingBoxData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "rawDisplay", { + /** + * @private + */ + get: function () { + return this._rawDisplay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "meshDisplay", { + /** + * @private + */ + get: function () { + return this._meshDisplay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "display", { + /** + * - The display object that the slot displays at this time. + * @example + *
+             *     let slot = armature.getSlot("text");
+             *     slot.display = new yourEngine.TextField();
+             * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的显示对象。 + * @example + *
+             *     let slot = armature.getSlot("text");
+             *     slot.display = new yourEngine.TextField();
+             * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._display; + }, + set: function (value) { + if (this._display === value) { + return; + } + if (this._displayFrames.length === 0) { + this.displayFrameCount = 1; + this._displayIndex = 0; + } + this.replaceDisplay(value, this._displayIndex); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "childArmature", { + /** + * - The child armature that the slot displayed at current time. + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
+             *     }
+             *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+             * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的子骨架。 + * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
+             *     }
+             *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+             * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._childArmature; + }, + set: function (value) { + if (this._childArmature === value) { + return; + } + this.display = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "parent", { + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Slot.prototype.getDisplay = function () { + return this._display; + }; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Slot.prototype.setDisplay = function (value) { + this.display = value; + }; + return Slot; + }(dragonBones.TransformObject)); + dragonBones.Slot = Slot; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var Constraint = /** @class */ (function (_super) { + __extends(Constraint, _super); + function Constraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + Constraint.prototype._onClear = function () { + this._armature = null; // + this._target = null; // + this._root = null; // + this._bone = null; + }; + Object.defineProperty(Constraint.prototype, "name", { + get: function () { + return this._constraintData.name; + }, + enumerable: true, + configurable: true + }); + Constraint._helpMatrix = new dragonBones.Matrix(); + Constraint._helpTransform = new dragonBones.Transform(); + Constraint._helpPoint = new dragonBones.Point(); + return Constraint; + }(dragonBones.BaseObject)); + dragonBones.Constraint = Constraint; + /** + * @internal + */ + var IKConstraint = /** @class */ (function (_super) { + __extends(IKConstraint, _super); + function IKConstraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraint.toString = function () { + return "[class dragonBones.IKConstraint]"; + }; + IKConstraint.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._scaleEnabled = false; + this._bendPositive = false; + this._weight = 1.0; + this._constraintData = null; + }; + IKConstraint.prototype._computeA = function () { + var ikGlobal = this._target.global; + var global = this._root.global; + var globalTransformMatrix = this._root.globalTransformMatrix; + var radian = Math.atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); + if (global.scaleX < 0.0) { + radian += Math.PI; + } + global.rotation += dragonBones.Transform.normalizeRadian(radian - global.rotation) * this._weight; + global.toMatrix(globalTransformMatrix); + }; + IKConstraint.prototype._computeB = function () { + var boneLength = this._bone._boneData.length; + var parent = this._root; + var ikGlobal = this._target.global; + var parentGlobal = parent.global; + var global = this._bone.global; + var globalTransformMatrix = this._bone.globalTransformMatrix; + var x = globalTransformMatrix.a * boneLength; + var y = globalTransformMatrix.b * boneLength; + var lLL = x * x + y * y; + var lL = Math.sqrt(lLL); + var dX = global.x - parentGlobal.x; + var dY = global.y - parentGlobal.y; + var lPP = dX * dX + dY * dY; + var lP = Math.sqrt(lPP); + var rawRadian = global.rotation; + var rawParentRadian = parentGlobal.rotation; + var rawRadianA = Math.atan2(dY, dX); + dX = ikGlobal.x - parentGlobal.x; + dY = ikGlobal.y - parentGlobal.y; + var lTT = dX * dX + dY * dY; + var lT = Math.sqrt(lTT); + var radianA = 0.0; + if (lL + lP <= lT || lT + lL <= lP || lT + lP <= lL) { + radianA = Math.atan2(ikGlobal.y - parentGlobal.y, ikGlobal.x - parentGlobal.x); + if (lL + lP <= lT) { + } + else if (lP < lL) { + radianA += Math.PI; + } + } + else { + var h = (lPP - lLL + lTT) / (2.0 * lTT); + var r = Math.sqrt(lPP - h * h * lTT) / lT; + var hX = parentGlobal.x + (dX * h); + var hY = parentGlobal.y + (dY * h); + var rX = -dY * r; + var rY = dX * r; + var isPPR = false; + var parentParent = parent.parent; + if (parentParent !== null) { + var parentParentMatrix = parentParent.globalTransformMatrix; + isPPR = parentParentMatrix.a * parentParentMatrix.d - parentParentMatrix.b * parentParentMatrix.c < 0.0; + } + if (isPPR !== this._bendPositive) { + global.x = hX - rX; + global.y = hY - rY; + } + else { + global.x = hX + rX; + global.y = hY + rY; + } + radianA = Math.atan2(global.y - parentGlobal.y, global.x - parentGlobal.x); + } + var dR = dragonBones.Transform.normalizeRadian(radianA - rawRadianA); + parentGlobal.rotation = rawParentRadian + dR * this._weight; + parentGlobal.toMatrix(parent.globalTransformMatrix); + // + var currentRadianA = rawRadianA + dR * this._weight; + global.x = parentGlobal.x + Math.cos(currentRadianA) * lP; + global.y = parentGlobal.y + Math.sin(currentRadianA) * lP; + // + var radianB = Math.atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); + if (global.scaleX < 0.0) { + radianB += Math.PI; + } + global.rotation = parentGlobal.rotation + rawRadian - rawParentRadian + dragonBones.Transform.normalizeRadian(radianB - dR - rawRadian) * this._weight; + global.toMatrix(globalTransformMatrix); + }; + IKConstraint.prototype.init = function (constraintData, armature) { + if (this._constraintData !== null) { + return; + } + this._constraintData = constraintData; + this._armature = armature; + this._target = this._armature.getBone(this._constraintData.target.name); + this._root = this._armature.getBone(this._constraintData.root.name); + this._bone = this._constraintData.bone !== null ? this._armature.getBone(this._constraintData.bone.name) : null; + { + var ikConstraintData = this._constraintData; + this._scaleEnabled = ikConstraintData.scaleEnabled; + this._bendPositive = ikConstraintData.bendPositive; + this._weight = ikConstraintData.weight; + } + this._root._hasConstraint = true; + }; + IKConstraint.prototype.update = function () { + this._root.updateByConstraint(); + if (this._bone !== null) { + this._bone.updateByConstraint(); + this._computeB(); + } + else { + this._computeA(); + } + }; + IKConstraint.prototype.invalidUpdate = function () { + this._root.invalidUpdate(); + if (this._bone !== null) { + this._bone.invalidUpdate(); + } + }; + return IKConstraint; + }(Constraint)); + dragonBones.IKConstraint = IKConstraint; + /** + * @internal + */ + var PathConstraint = /** @class */ (function (_super) { + __extends(PathConstraint, _super); + function PathConstraint() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._bones = []; + _this._spaces = []; + _this._positions = []; + _this._curves = []; + _this._boneLengths = []; + _this._pathGlobalVertices = []; + _this._segments = [10]; + return _this; + } + PathConstraint.toString = function () { + return "[class dragonBones.PathConstraint]"; + }; + PathConstraint.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.dirty = false; + this.pathOffset = 0; + this.position = 0.0; + this.spacing = 0.0; + this.rotateOffset = 0.0; + this.rotateMix = 1.0; + this.translateMix = 1.0; + this._pathSlot = null; + this._bones.length = 0; + this._spaces.length = 0; + this._positions.length = 0; + this._curves.length = 0; + this._boneLengths.length = 0; + this._pathGlobalVertices.length = 0; + }; + PathConstraint.prototype._updatePathVertices = function (verticesData) { + //计算曲线的节点数据 + var armature = this._armature; + var dragonBonesData = armature.armatureData.parent; + var scale = armature.armatureData.scale; + var intArray = dragonBonesData.intArray; + var floatArray = dragonBonesData.floatArray; + var pathOffset = verticesData.offset; + var pathVertexCount = intArray[pathOffset + 0 /* GeometryVertexCount */]; + var pathVertexOffset = intArray[pathOffset + 2 /* GeometryFloatOffset */]; + this._pathGlobalVertices.length = pathVertexCount * 2; + var weightData = verticesData.weight; + //没有骨骼约束我,那节点只受自己的Bone控制 + if (weightData === null) { + var parentBone = this._pathSlot.parent; + parentBone.updateByConstraint(); + var matrix = parentBone.globalTransformMatrix; + for (var i = 0, iV_1 = pathVertexOffset; i < pathVertexCount; i += 2) { + var vx = floatArray[iV_1++] * scale; + var vy = floatArray[iV_1++] * scale; + var x = matrix.a * vx + matrix.c * vy + matrix.tx; + var y = matrix.b * vx + matrix.d * vy + matrix.ty; + // + this._pathGlobalVertices[i] = x; + this._pathGlobalVertices[i + 1] = y; + } + return; + } + //有骨骼约束我,那我的节点受骨骼权重控制 + var bones = this._pathSlot._geometryBones; + var weightBoneCount = weightData.bones.length; + var weightOffset = weightData.offset; + var floatOffset = intArray[weightOffset + 1 /* WeigthFloatOffset */]; + var iV = floatOffset; + var iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount; + for (var i = 0, iW = 0; i < pathVertexCount; i++) { + var vertexBoneCount = intArray[iB++]; // + var xG = 0.0, yG = 0.0; + for (var ii = 0, ll = vertexBoneCount; ii < ll; ii++) { + var boneIndex = intArray[iB++]; + var bone = bones[boneIndex]; + if (bone === null) { + continue; + } + bone.updateByConstraint(); + var matrix = bone.globalTransformMatrix; + var weight = floatArray[iV++]; + var vx = floatArray[iV++] * scale; + var vy = floatArray[iV++] * scale; + xG += (matrix.a * vx + matrix.c * vy + matrix.tx) * weight; + yG += (matrix.b * vx + matrix.d * vy + matrix.ty) * weight; + } + this._pathGlobalVertices[iW++] = xG; + this._pathGlobalVertices[iW++] = yG; + } + }; + PathConstraint.prototype._computeVertices = function (start, count, offset, out) { + //TODO优化 + for (var i = offset, iW = start; i < count; i += 2) { + out[i] = this._pathGlobalVertices[iW++]; + out[i + 1] = this._pathGlobalVertices[iW++]; + } + }; + PathConstraint.prototype._computeBezierCurve = function (pathDisplayDta, spaceCount, tangents, percentPosition, percentSpacing) { + //计算当前的骨骼在曲线上的位置 + var armature = this._armature; + var intArray = armature.armatureData.parent.intArray; + var vertexCount = intArray[pathDisplayDta.geometry.offset + 0 /* GeometryVertexCount */]; + var positions = this._positions; + var spaces = this._spaces; + var isClosed = pathDisplayDta.closed; + var curveVertices = Array(); + var verticesLength = vertexCount * 2; + var curveCount = verticesLength / 6; + var preCurve = -1; + var position = this.position; + positions.length = spaceCount * 3 + 2; + var pathLength = 0.0; + //不需要匀速运动,效率高些 + if (!pathDisplayDta.constantSpeed) { + var lenghts = pathDisplayDta.curveLengths; + curveCount -= isClosed ? 1 : 2; + pathLength = lenghts[curveCount]; + if (percentPosition) { + position *= pathLength; + } + if (percentSpacing) { + for (var i = 0; i < spaceCount; i++) { + spaces[i] *= pathLength; + } + } + curveVertices.length = 8; + for (var i = 0, o = 0, curve = 0; i < spaceCount; i++, o += 3) { + var space = spaces[i]; + position += space; + if (isClosed) { + position %= pathLength; + if (position < 0) { + position += pathLength; + } + curve = 0; + } + else if (position < 0) { + //TODO + continue; + } + else if (position > pathLength) { + //TODO + continue; + } + var percent = 0.0; + for (;; curve++) { + var len = lenghts[curve]; + if (position > len) { + continue; + } + if (curve === 0) { + percent = position / len; + } + else { + var preLen = lenghts[curve - 1]; + percent = (position - preLen) / (len - preLen); + } + break; + } + if (curve !== preCurve) { + preCurve = curve; + if (isClosed && curve === curveCount) { + //计算曲线 + this._computeVertices(verticesLength - 4, 4, 0, curveVertices); + this._computeVertices(0, 4, 4, curveVertices); + } + else { + this._computeVertices(curve * 6 + 2, 8, 0, curveVertices); + } + } + // + this.addCurvePosition(percent, curveVertices[0], curveVertices[1], curveVertices[2], curveVertices[3], curveVertices[4], curveVertices[5], curveVertices[6], curveVertices[7], positions, o, tangents); + } + return; + } + //匀速的 + if (isClosed) { + verticesLength += 2; + curveVertices.length = vertexCount; + this._computeVertices(2, verticesLength - 4, 0, curveVertices); + this._computeVertices(0, 2, verticesLength - 4, curveVertices); + curveVertices[verticesLength - 2] = curveVertices[0]; + curveVertices[verticesLength - 1] = curveVertices[1]; + } + else { + curveCount--; + verticesLength -= 4; + curveVertices.length = verticesLength; + this._computeVertices(2, verticesLength, 0, curveVertices); + } + // + var curves = new Array(curveCount); + pathLength = 0; + var x1 = curveVertices[0], y1 = curveVertices[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = curveVertices[w]; + cy1 = curveVertices[w + 1]; + cx2 = curveVertices[w + 2]; + cy2 = curveVertices[w + 3]; + x2 = curveVertices[w + 4]; + y2 = curveVertices[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) { + position *= pathLength; + } + if (percentSpacing) { + for (var i = 0; i < spaceCount; i++) { + spaces[i] *= pathLength; + } + } + var segments = this._segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spaceCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (isClosed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + continue; + } + else if (p > pathLength) { + continue; + } + // Determine curve containing position. + for (;; curve++) { + var length_1 = curves[curve]; + if (p > length_1) + continue; + if (curve === 0) + p /= length_1; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_1 - prev); + } + break; + } + if (curve !== preCurve) { + preCurve = curve; + var ii = curve * 6; + x1 = curveVertices[ii]; + y1 = curveVertices[ii + 1]; + cx1 = curveVertices[ii + 2]; + cy1 = curveVertices[ii + 3]; + cx2 = curveVertices[ii + 4]; + cy2 = curveVertices[ii + 5]; + x2 = curveVertices[ii + 6]; + y2 = curveVertices[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + // Weight by segment length. + p *= curveLength; + for (;; segment++) { + var length_2 = segments[segment]; + if (p > length_2) + continue; + if (segment === 0) + p /= length_2; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_2 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, positions, o, tangents); + } + }; + //Calculates a point on the curve, for a given t value between 0 and 1. + PathConstraint.prototype.addCurvePosition = function (t, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, offset, tangents) { + if (t === 0) { + out[offset] = x1; + out[offset + 1] = y1; + out[offset + 2] = 0; + return; + } + if (t === 1) { + out[offset] = x2; + out[offset + 1] = y2; + out[offset + 2] = 0; + return; + } + var mt = 1 - t; + var mt2 = mt * mt; + var t2 = t * t; + var a = mt2 * mt; + var b = mt2 * t * 3; + var c = mt * t2 * 3; + var d = t * t2; + var x = a * x1 + b * cx1 + c * cx2 + d * x2; + var y = a * y1 + b * cy1 + c * cy2 + d * y2; + out[offset] = x; + out[offset + 1] = y; + if (tangents) { + //Calculates the curve tangent at the specified t value + out[offset + 2] = Math.atan2(y - (a * y1 + b * cy1 + c * cy2), x - (a * x1 + b * cx1 + c * cx2)); + } + else { + out[offset + 2] = 0; + } + }; + PathConstraint.prototype.init = function (constraintData, armature) { + this._constraintData = constraintData; + this._armature = armature; + var data = constraintData; + this.pathOffset = data.pathDisplayData.geometry.offset; + // + this.position = data.position; + this.spacing = data.spacing; + this.rotateOffset = data.rotateOffset; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + // + this._root = this._armature.getBone(data.root.name); + this._target = this._armature.getBone(data.target.name); + this._pathSlot = this._armature.getSlot(data.pathSlot.name); + for (var i = 0, l = data.bones.length; i < l; i++) { + var bone = this._armature.getBone(data.bones[i].name); + if (bone !== null) { + this._bones.push(bone); + } + } + if (data.rotateMode === 2 /* ChainScale */) { + this._boneLengths.length = this._bones.length; + } + this._root._hasConstraint = true; + }; + PathConstraint.prototype.update = function () { + var pathSlot = this._pathSlot; + if (pathSlot._geometryData === null || + pathSlot._geometryData.offset !== this.pathOffset) { + return; + } + var constraintData = this._constraintData; + // + //曲线节点数据改变:父亲bone改变,权重bones改变,变形顶点改变 + var isPathVerticeDirty = false; + if (this._root._childrenTransformDirty) { + this._updatePathVertices(pathSlot._geometryData); + isPathVerticeDirty = true; + } + else if (pathSlot._verticesDirty || pathSlot._isBonesUpdate()) { + this._updatePathVertices(pathSlot._geometryData); + pathSlot._verticesDirty = false; + isPathVerticeDirty = true; + } + if (!isPathVerticeDirty && !this.dirty) { + return; + } + // + var positionMode = constraintData.positionMode; + var spacingMode = constraintData.spacingMode; + var rotateMode = constraintData.rotateMode; + var bones = this._bones; + var isLengthMode = spacingMode === 0 /* Length */; + var isChainScaleMode = rotateMode === 2 /* ChainScale */; + var isTangentMode = rotateMode === 0 /* Tangent */; + var boneCount = bones.length; + var spacesCount = isTangentMode ? boneCount : boneCount + 1; + var spacing = this.spacing; + var spaces = this._spaces; + spaces.length = spacesCount; + //计曲线间隔和长度 + if (isChainScaleMode || isLengthMode) { + //Bone改变和spacing改变触发 + spaces[0] = 0; + for (var i = 0, l = spacesCount - 1; i < l; i++) { + var bone = bones[i]; + bone.updateByConstraint(); + var boneLength = bone._boneData.length; + var matrix = bone.globalTransformMatrix; + var x = boneLength * matrix.a; + var y = boneLength * matrix.b; + var len = Math.sqrt(x * x + y * y); + if (isChainScaleMode) { + this._boneLengths[i] = len; + } + spaces[i + 1] = (boneLength + spacing) * len / boneLength; + } + } + else { + for (var i = 0; i < spacesCount; i++) { + spaces[i] = spacing; + } + } + // + this._computeBezierCurve(pathSlot._displayFrame.rawDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); + //根据新的节点数据重新采样 + var positions = this._positions; + var rotateOffset = this.rotateOffset; + var boneX = positions[0], boneY = positions[1]; + var tip; + if (rotateOffset === 0) { + tip = rotateMode === 1 /* Chain */; + } + else { + tip = false; + var bone = pathSlot.parent; + if (bone !== null) { + var matrix = bone.globalTransformMatrix; + rotateOffset *= matrix.a * matrix.d - matrix.b * matrix.c > 0 ? dragonBones.Transform.DEG_RAD : -dragonBones.Transform.DEG_RAD; + } + } + // + var rotateMix = this.rotateMix; + var translateMix = this.translateMix; + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.updateByConstraint(); + var matrix = bone.globalTransformMatrix; + matrix.tx += (boneX - matrix.tx) * translateMix; + matrix.ty += (boneY - matrix.ty) * translateMix; + var x = positions[p], y = positions[p + 1]; + var dx = x - boneX, dy = y - boneY; + if (isChainScaleMode) { + var lenght = this._boneLengths[i]; + var s = (Math.sqrt(dx * dx + dy * dy) / lenght - 1) * rotateMix + 1; + matrix.a *= s; + matrix.b *= s; + } + boneX = x; + boneY = y; + if (rotateMix > 0) { + var a = matrix.a, b = matrix.b, c = matrix.c, d = matrix.d, r = void 0, cos = void 0, sin = void 0; + if (isTangentMode) { + r = positions[p - 1]; + } + else { + r = Math.atan2(dy, dx); + } + r -= Math.atan2(b, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_3 = bone._boneData.length; + boneX += (length_3 * (cos * a - sin * b) - dx) * rotateMix; + boneY += (length_3 * (sin * a + cos * b) - dy) * rotateMix; + } + else { + r += rotateOffset; + } + if (r > dragonBones.Transform.PI) { + r -= dragonBones.Transform.PI_D; + } + else if (r < -dragonBones.Transform.PI) { + r += dragonBones.Transform.PI_D; + } + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + matrix.a = cos * a - sin * b; + matrix.b = sin * a + cos * b; + matrix.c = cos * c - sin * d; + matrix.d = sin * c + cos * d; + } + bone.global.fromMatrix(matrix); + } + this.dirty = false; + }; + PathConstraint.prototype.invalidUpdate = function () { + }; + return PathConstraint; + }(Constraint)); + dragonBones.PathConstraint = PathConstraint; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + var WorldClock = /** @class */ (function () { + /** + * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. + * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 + * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 + * @version DragonBones 3.0 + * @language zh_CN + */ + function WorldClock(time) { + if (time === void 0) { time = 0.0; } + /** + * - Current time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + this.time = 0.0; + /** + * - The play speed, used to control animation speed-shift play. + * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度,用于控制动画变速播放。 + * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + this.timeScale = 1.0; + this._systemTime = 0.0; + this._animatebles = []; + this._clock = null; + this.time = time; + this._systemTime = new Date().getTime() * 0.001; + } + /** + * - Advance time for all IAnimatable instances. + * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 为所有的 IAnimatable 实例更新时间。 + * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.advanceTime = function (passedTime) { + if (passedTime !== passedTime) { + passedTime = 0.0; + } + var currentTime = Date.now() * 0.001; + if (passedTime < 0.0) { + passedTime = currentTime - this._systemTime; + } + this._systemTime = currentTime; + if (this.timeScale !== 1.0) { + passedTime *= this.timeScale; + } + if (passedTime === 0.0) { + return; + } + if (passedTime < 0.0) { + this.time -= passedTime; + } + else { + this.time += passedTime; + } + var i = 0, r = 0, l = this._animatebles.length; + for (; i < l; ++i) { + var animatable = this._animatebles[i]; + if (animatable !== null) { + if (r > 0) { + this._animatebles[i - r] = animatable; + this._animatebles[i] = null; + } + animatable.advanceTime(passedTime); + } + else { + r++; + } + } + if (r > 0) { + l = this._animatebles.length; + for (; i < l; ++i) { + var animateble = this._animatebles[i]; + if (animateble !== null) { + this._animatebles[i - r] = animateble; + } + else { + r++; + } + } + this._animatebles.length -= r; + } + }; + /** + * - Check whether contains a specific instance of IAnimatable. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.contains = function (value) { + if (value === this) { + return false; + } + var ancestor = value; + while (ancestor !== this && ancestor !== null) { + ancestor = ancestor.clock; + } + return ancestor === this; + }; + /** + * - Add IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.add = function (value) { + if (this._animatebles.indexOf(value) < 0) { + this._animatebles.push(value); + value.clock = this; + } + }; + /** + * - Removes a specified IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.remove = function (value) { + var index = this._animatebles.indexOf(value); + if (index >= 0) { + this._animatebles[index] = null; + value.clock = null; + } + }; + /** + * - Clear all IAnimatable instances. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.clear = function () { + for (var _i = 0, _a = this._animatebles; _i < _a.length; _i++) { + var animatable = _a[_i]; + if (animatable !== null) { + animatable.clock = null; + } + } + }; + Object.defineProperty(WorldClock.prototype, "clock", { + /** + * @inheritDoc + */ + get: function () { + return this._clock; + }, + set: function (value) { + if (this._clock === value) { + return; + } + if (this._clock !== null) { + this._clock.remove(this); + } + this._clock = value; + if (this._clock !== null) { + this._clock.add(this); + } + }, + enumerable: true, + configurable: true + }); + return WorldClock; + }()); + dragonBones.WorldClock = WorldClock; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation player is used to play the animation data and manage the animation states. + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器用来播放动画数据和管理动画状态。 + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + var Animation = /** @class */ (function (_super) { + __extends(Animation, _super); + function Animation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._animationNames = []; + _this._animationStates = []; + _this._animations = {}; + _this._blendStates = {}; + _this._animationConfig = null; // Initial value. + return _this; + } + Animation.toString = function () { + return "[class dragonBones.Animation]"; + }; + Animation.prototype._onClear = function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.returnToPool(); + } + for (var k in this._animations) { + delete this._animations[k]; + } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].returnToPool(); + } + delete this._blendStates[k]; + } + if (this._animationConfig !== null) { + this._animationConfig.returnToPool(); + } + this.timeScale = 1.0; + this._animationDirty = false; + this._inheritTimeScale = 1.0; + this._animationNames.length = 0; + this._animationStates.length = 0; + //this._animations.clear(); + this._armature = null; // + this._animationConfig = null; // + this._lastAnimationState = null; + }; + Animation.prototype._fadeOut = function (animationConfig) { + switch (animationConfig.fadeOutMode) { + case 1 /* SameLayer */: + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (animationState._parent !== null) { + continue; + } + if (animationState.layer === animationConfig.layer) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 2 /* SameGroup */: + for (var _b = 0, _c = this._animationStates; _b < _c.length; _b++) { + var animationState = _c[_b]; + if (animationState._parent !== null) { + continue; + } + if (animationState.group === animationConfig.group) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 3 /* SameLayerAndGroup */: + for (var _d = 0, _e = this._animationStates; _d < _e.length; _d++) { + var animationState = _e[_d]; + if (animationState._parent !== null) { + continue; + } + if (animationState.layer === animationConfig.layer && + animationState.group === animationConfig.group) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 4 /* All */: + for (var _f = 0, _g = this._animationStates; _f < _g.length; _f++) { + var animationState = _g[_f]; + if (animationState._parent !== null) { + continue; + } + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + break; + case 5 /* Single */: // TODO + default: + break; + } + }; + /** + * @internal + */ + Animation.prototype.init = function (armature) { + if (this._armature !== null) { + return; + } + this._armature = armature; + this._animationConfig = dragonBones.BaseObject.borrowObject(dragonBones.AnimationConfig); + }; + /** + * @internal + */ + Animation.prototype.advanceTime = function (passedTime) { + if (passedTime < 0.0) { // Only animationState can reverse play. + passedTime = -passedTime; + } + if (this._armature.inheritAnimation && this._armature._parent !== null) { // Inherit parent animation timeScale. + this._inheritTimeScale = this._armature._parent._armature.animation._inheritTimeScale * this.timeScale; + } + else { + this._inheritTimeScale = this.timeScale; + } + if (this._inheritTimeScale !== 1.0) { + passedTime *= this._inheritTimeScale; + } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].reset(); + } + } + var animationStateCount = this._animationStates.length; + if (animationStateCount === 1) { + var animationState = this._animationStates[0]; + if (animationState._fadeState > 0 && animationState._subFadeState > 0) { + this._armature._dragonBones.bufferObject(animationState); + this._animationStates.length = 0; + this._lastAnimationState = null; + } + else { + var animationData = animationState.animationData; + var cacheFrameRate = animationData.cacheFrameRate; + if (this._animationDirty && cacheFrameRate > 0.0) { // Update cachedFrameIndices. + this._animationDirty = false; + for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { + var bone = _a[_i]; + bone._cachedFrameIndices = animationData.getBoneCachedFrameIndices(bone.name); + } + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { + var slot = _c[_b]; + if (slot.displayFrameCount > 0) { + var rawDisplayData = slot.getDisplayFrameAt(0).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.parent === this._armature.armatureData.defaultSkin) { + slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); + continue; + } + } + slot._cachedFrameIndices = null; + } + } + animationState.advanceTime(passedTime, cacheFrameRate); + } + } + else if (animationStateCount > 1) { + for (var i = 0, r = 0; i < animationStateCount; ++i) { + var animationState = this._animationStates[i]; + if (animationState._fadeState > 0 && animationState._subFadeState > 0) { + r++; + this._armature._dragonBones.bufferObject(animationState); + this._animationDirty = true; + if (this._lastAnimationState === animationState) { // Update last animation state. + this._lastAnimationState = null; + } + } + else { + if (r > 0) { + this._animationStates[i - r] = animationState; + } + animationState.advanceTime(passedTime, 0.0); + } + if (i === animationStateCount - 1 && r > 0) { // Modify animation states size. + this._animationStates.length -= r; + if (this._lastAnimationState === null && this._animationStates.length > 0) { + this._lastAnimationState = this._animationStates[this._animationStates.length - 1]; + } + } + } + this._armature._cacheFrameIndex = -1; + } + else { + this._armature._cacheFrameIndex = -1; + } + }; + /** + * - Clear all animations states. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除所有的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.reset = function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.returnToPool(); + } + this._animationDirty = false; + this._animationConfig.clear(); + this._animationStates.length = 0; + this._lastAnimationState = null; + }; + /** + * - Pause a specific animation state. + * @param animationName - The name of animation state. (If not set, it will pause all animations) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停指定动画状态的播放。 + * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.stop = function (animationName) { + if (animationName === void 0) { animationName = null; } + if (animationName !== null) { + var animationState = this.getState(animationName); + if (animationState !== null) { + animationState.stop(); + } + } + else { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.stop(); + } + } + }; + /** + * - Play animation with a specific animation config. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @param animationConfig - The animation config. + * @returns The playing animation state. + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 通过指定的动画配置来播放动画。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @param animationConfig - 动画配置。 + * @returns 播放的动画状态。 + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + Animation.prototype.playConfig = function (animationConfig) { + var animationName = animationConfig.animation; + if (!(animationName in this._animations)) { + console.warn("Non-existent animation.\n", "DragonBones name: " + this._armature.armatureData.parent.name, "Armature name: " + this._armature.name, "Animation name: " + animationName); + return null; + } + var animationData = this._animations[animationName]; + if (animationConfig.fadeOutMode === 5 /* Single */) { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState_1 = _a[_i]; + if (animationState_1._fadeState < 1 && + animationState_1.layer === animationConfig.layer && + animationState_1.animationData === animationData) { + return animationState_1; + } + } + } + if (this._animationStates.length === 0) { + animationConfig.fadeInTime = 0.0; + } + else if (animationConfig.fadeInTime < 0.0) { + animationConfig.fadeInTime = animationData.fadeInTime; + } + if (animationConfig.fadeOutTime < 0.0) { + animationConfig.fadeOutTime = animationConfig.fadeInTime; + } + if (animationConfig.timeScale <= -100.0) { + animationConfig.timeScale = 1.0 / animationData.scale; + } + if (animationData.frameCount > 0) { + if (animationConfig.position < 0.0) { + animationConfig.position %= animationData.duration; + animationConfig.position = animationData.duration - animationConfig.position; + } + else if (animationConfig.position === animationData.duration) { + animationConfig.position -= 0.000001; // Play a little time before end. + } + else if (animationConfig.position > animationData.duration) { + animationConfig.position %= animationData.duration; + } + if (animationConfig.duration > 0.0 && animationConfig.position + animationConfig.duration > animationData.duration) { + animationConfig.duration = animationData.duration - animationConfig.position; + } + if (animationConfig.playTimes < 0) { + animationConfig.playTimes = animationData.playTimes; + } + } + else { + animationConfig.playTimes = 1; + animationConfig.position = 0.0; + if (animationConfig.duration > 0.0) { + animationConfig.duration = 0.0; + } + } + if (animationConfig.duration === 0.0) { + animationConfig.duration = -1.0; + } + this._fadeOut(animationConfig); + // + var animationState = dragonBones.BaseObject.borrowObject(dragonBones.AnimationState); + animationState.init(this._armature, animationData, animationConfig); + this._animationDirty = true; + this._armature._cacheFrameIndex = -1; + if (this._animationStates.length > 0) { // Sort animation state. + var added = false; + for (var i = 0, l = this._animationStates.length; i < l; ++i) { + if (animationState.layer > this._animationStates[i].layer) { + added = true; + this._animationStates.splice(i, 0, animationState); + break; + } + else if (i !== l - 1 && animationState.layer > this._animationStates[i + 1].layer) { + added = true; + this._animationStates.splice(i + 1, 0, animationState); + break; + } + } + if (!added) { + this._animationStates.push(animationState); + } + } + else { + this._animationStates.push(animationState); + } + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { // Child armature play same name animation. + var slot = _c[_b]; + var childArmature = slot.childArmature; + if (childArmature !== null && childArmature.inheritAnimation && + childArmature.animation.hasAnimation(animationName) && + childArmature.animation.getState(animationName) === null) { + childArmature.animation.fadeIn(animationName); // + } + } + for (var k in animationData.animationTimelines) { // Blend animation node. + var childAnimationState = this.fadeIn(k, 0.0, 1, animationState.layer, "", 5 /* Single */); + if (childAnimationState === null) { + continue; + } + var timelines = animationData.animationTimelines[k]; + childAnimationState.actionEnabled = false; + childAnimationState.resetToPose = false; + childAnimationState.stop(); + animationState.addState(childAnimationState, timelines); + // + var index = this._animationStates.indexOf(animationState); + var childIndex = this._animationStates.indexOf(childAnimationState); + if (childIndex < index) { + this._animationStates.splice(index, 1); + this._animationStates.splice(childIndex, 0, animationState); + } + } + // if (!this._armature._lockUpdate && animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. + // this._armature.advanceTime(0.0); + // } + this._lastAnimationState = animationState; + return animationState; + }; + /** + * - Play a specific animation. + * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) + * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放指定动画。 + * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.play = function (animationName, playTimes) { + if (animationName === void 0) { animationName = null; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName !== null ? animationName : ""; + if (animationName !== null && animationName.length > 0) { + this.playConfig(this._animationConfig); + } + else if (this._lastAnimationState === null) { + var defaultAnimation = this._armature.armatureData.defaultAnimation; + if (defaultAnimation !== null) { + this._animationConfig.animation = defaultAnimation.name; + this.playConfig(this._animationConfig); + } + } + else if (!this._lastAnimationState.isPlaying && !this._lastAnimationState.isCompleted) { + this._lastAnimationState.play(); + } + else { + this._animationConfig.animation = this._lastAnimationState.name; + this.playConfig(this._animationConfig); + } + return this._lastAnimationState; + }; + /** + * - Fade in a specific animation. + * @param animationName - The name of animation data. + * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) + * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) + * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) + * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 淡入播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) + * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) + * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.fadeIn = function (animationName, fadeInTime, playTimes, layer, group, fadeOutMode) { + if (fadeInTime === void 0) { fadeInTime = -1.0; } + if (playTimes === void 0) { playTimes = -1; } + if (layer === void 0) { layer = 0; } + if (group === void 0) { group = null; } + if (fadeOutMode === void 0) { fadeOutMode = 3 /* SameLayerAndGroup */; } + this._animationConfig.clear(); + this._animationConfig.fadeOutMode = fadeOutMode; + this._animationConfig.playTimes = playTimes; + this._animationConfig.layer = layer; + this._animationConfig.fadeInTime = fadeInTime; + this._animationConfig.animation = animationName; + this._animationConfig.group = group !== null ? group : ""; + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific time. + * @param animationName - The name of animation data. + * @param time - The start time point of playing. (In seconds) + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定时间开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param time - 播放开始的时间。 (以秒为单位) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByTime = function (animationName, time, playTimes) { + if (time === void 0) { time = 0.0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.position = time; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific frame. + * @param animationName - The name of animation data. + * @param frame - The start frame of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定帧开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param frame - 播放开始的帧数。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByFrame = function (animationName, frame, playTimes) { + if (frame === void 0) { frame = 0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + var animationData = animationName in this._animations ? this._animations[animationName] : null; + if (animationData !== null) { + this._animationConfig.position = animationData.frameCount > 0 ? animationData.duration * frame / animationData.frameCount : 0.0; + } + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific progress. + * @param animationName - The name of animation data. + * @param progress - The start progress value of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定进度开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param progress - 开始播放的进度。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByProgress = function (animationName, progress, playTimes) { + if (progress === void 0) { progress = 0.0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + var animationData = animationName in this._animations ? this._animations[animationName] : null; + if (animationData !== null) { + this._animationConfig.position = animationData.duration * (progress > 0.0 ? progress : 0.0); + } + return this.playConfig(this._animationConfig); + }; + /** + * - Stop a specific animation at the specific time. + * @param animationName - The name of animation data. + * @param time - The stop time. (In seconds) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定时间停止指定动画播放 + * @param animationName - 动画数据名称。 + * @param time - 停止的时间。 (以秒为单位) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByTime = function (animationName, time) { + if (time === void 0) { time = 0.0; } + var animationState = this.gotoAndPlayByTime(animationName, time, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * - Stop a specific animation at the specific frame. + * @param animationName - The name of animation data. + * @param frame - The stop frame. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定帧停止指定动画的播放 + * @param animationName - 动画数据名称。 + * @param frame - 停止的帧数。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByFrame = function (animationName, frame) { + if (frame === void 0) { frame = 0; } + var animationState = this.gotoAndPlayByFrame(animationName, frame, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * - Stop a specific animation at the specific progress. + * @param animationName - The name of animation data. + * @param progress - The stop progress value. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定的进度停止指定的动画播放。 + * @param animationName - 动画数据名称。 + * @param progress - 停止进度。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByProgress = function (animationName, progress) { + if (progress === void 0) { progress = 0.0; } + var animationState = this.gotoAndPlayByProgress(animationName, progress, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * @internal + */ + Animation.prototype.getBlendState = function (type, name, target) { + if (!(type in this._blendStates)) { + this._blendStates[type] = {}; + } + var blendStates = this._blendStates[type]; + if (!(name in blendStates)) { + var blendState = blendStates[name] = dragonBones.BaseObject.borrowObject(dragonBones.BlendState); + blendState.target = target; + } + return blendStates[name]; + }; + /** + * - Get a specific animation state. + * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取指定的动画状态。 + * @param animationName - 动画状态名称。 + * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.getState = function (animationName, layer) { + if (layer === void 0) { layer = -1; } + var i = this._animationStates.length; + while (i--) { + var animationState = this._animationStates[i]; + if (animationState.name === animationName && (layer < 0 || animationState.layer === layer)) { + return animationState; + } + } + return null; + }; + /** + * - Check whether a specific animation data is included. + * @param animationName - The name of animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含指定的动画数据 + * @param animationName - 动画数据名称。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.hasAnimation = function (animationName) { + return animationName in this._animations; + }; + /** + * - Get all the animation states. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取所有的动画状态 + * @version DragonBones 5.1 + * @language zh_CN + */ + Animation.prototype.getStates = function () { + return this._animationStates; + }; + Object.defineProperty(Animation.prototype, "isPlaying", { + /** + * - Check whether there is an animation state is playing + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否有动画状态正在播放 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (animationState.isPlaying) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "isCompleted", { + /** + * - Check whether all the animation states' playing were finished. + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否所有的动画状态均已播放完毕。 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (!animationState.isCompleted) { + return false; + } + } + return this._animationStates.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "lastAnimationName", { + /** + * - The name of the last playing animation state. + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态名称 + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._lastAnimationState !== null ? this._lastAnimationState.name : ""; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animationNames", { + /** + * - The name of all animation data + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有动画数据的名称 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._animationNames; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animations", { + /** + * - All animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有的动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._animations; + }, + set: function (value) { + if (this._animations === value) { + return; + } + this._animationNames.length = 0; + for (var k in this._animations) { + delete this._animations[k]; + } + for (var k in value) { + this._animationNames.push(k); + this._animations[k] = value[k]; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animationConfig", { + /** + * - An AnimationConfig instance that can be used quickly. + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 一个可以快速使用的动画配置实例。 + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language zh_CN + */ + get: function () { + this._animationConfig.clear(); + return this._animationConfig; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "lastAnimationState", { + /** + * - The last playing animation state + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._lastAnimationState; + }, + enumerable: true, + configurable: true + }); + return Animation; + }(dragonBones.BaseObject)); + dragonBones.Animation = Animation; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation state is generated when the animation data is played. + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画状态由播放动画数据时产生。 + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + var AnimationState = /** @class */ (function (_super) { + __extends(AnimationState, _super); + function AnimationState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._boneMask = []; + _this._boneTimelines = []; + _this._boneBlendTimelines = []; + _this._slotTimelines = []; + _this._slotBlendTimelines = []; + _this._constraintTimelines = []; + _this._animationTimelines = []; + _this._poseTimelines = []; + /** + * @internal + */ + _this._actionTimeline = null; // Initial value. + _this._zOrderTimeline = null; // Initial value. + return _this; + } + AnimationState.toString = function () { + return "[class dragonBones.AnimationState]"; + }; + AnimationState.prototype._onClear = function () { + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.returnToPool(); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.returnToPool(); + } + for (var _d = 0, _e = this._slotTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.returnToPool(); + } + for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.returnToPool(); + } + for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) { + var timeline = _j[_h]; + timeline.returnToPool(); + } + for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) { + var timeline = _l[_k]; + var animationState = timeline.target; + if (animationState._parent === this) { + animationState._fadeState = 1; + animationState._subFadeState = 1; + animationState._parent = null; + } + timeline.returnToPool(); + } + if (this._actionTimeline !== null) { + this._actionTimeline.returnToPool(); + } + if (this._zOrderTimeline !== null) { + this._zOrderTimeline.returnToPool(); + } + this.actionEnabled = false; + this.additive = false; + this.displayControl = false; + this.resetToPose = false; + this.blendType = 0 /* None */; + this.playTimes = 1; + this.layer = 0; + this.timeScale = 1.0; + this._weight = 1.0; + this.parameterX = 0.0; + this.parameterY = 0.0; + this.positionX = 0.0; + this.positionY = 0.0; + this.autoFadeOutTime = 0.0; + this.fadeTotalTime = 0.0; + this.name = ""; + this.group = ""; + this._timelineDirty = 2; + this._playheadState = 0; + this._fadeState = -1; + this._subFadeState = -1; + this._position = 0.0; + this._duration = 0.0; + this._fadeTime = 0.0; + this._time = 0.0; + this._fadeProgress = 0.0; + this._weightResult = 0.0; + this._boneMask.length = 0; + this._boneTimelines.length = 0; + this._boneBlendTimelines.length = 0; + this._slotTimelines.length = 0; + this._slotBlendTimelines.length = 0; + this._constraintTimelines.length = 0; + this._animationTimelines.length = 0; + this._poseTimelines.length = 0; + // this._bonePoses.clear(); + this._animationData = null; // + this._armature = null; // + this._actionTimeline = null; // + this._zOrderTimeline = null; + this._activeChildA = null; + this._activeChildB = null; + this._parent = null; + }; + AnimationState.prototype._updateTimelines = function () { + { // Update constraint timelines. + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + var timelineDatas = this._animationData.getConstraintTimelines(constraint.name); + if (timelineDatas !== null) { + for (var _b = 0, timelineDatas_1 = timelineDatas; _b < timelineDatas_1.length; _b++) { + var timelineData = timelineDatas_1[_b]; + switch (timelineData.type) { + case 30 /* IKConstraint */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState); + timeline.target = constraint; + timeline.init(this._armature, this, timelineData); + this._constraintTimelines.push(timeline); + break; + } + default: + break; + } + } + } + else if (this.resetToPose) { // Pose timeline. + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState); + timeline.target = constraint; + timeline.init(this._armature, this, null); + this._constraintTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + }; + AnimationState.prototype._updateBoneAndSlotTimelines = function () { + { // Update bone and surface timelines. + var boneTimelines = {}; + // Create bone timelines map. + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + var timelineName = timeline.target.target.name; + if (!(timelineName in boneTimelines)) { + boneTimelines[timelineName] = []; + } + boneTimelines[timelineName].push(timeline); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + var timelineName = timeline.target.target.name; + if (!(timelineName in boneTimelines)) { + boneTimelines[timelineName] = []; + } + boneTimelines[timelineName].push(timeline); + } + // + for (var _d = 0, _e = this._armature.getBones(); _d < _e.length; _d++) { + var bone = _e[_d]; + var timelineName = bone.name; + if (!this.containsBoneMask(timelineName)) { + continue; + } + if (timelineName in boneTimelines) { // Remove bone timeline from map. + delete boneTimelines[timelineName]; + } + else { // Create new bone timeline. + var timelineDatas = this._animationData.getBoneTimelines(timelineName); + var blendState = this._armature.animation.getBlendState(BlendState.BONE_TRANSFORM, bone.name, bone); + if (timelineDatas !== null) { + for (var _f = 0, timelineDatas_2 = timelineDatas; _f < timelineDatas_2.length; _f++) { + var timelineData = timelineDatas_2[_f]; + switch (timelineData.type) { + case 10 /* BoneAll */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 11 /* BoneTranslate */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneTranslateTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 12 /* BoneRotate */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneRotateTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 13 /* BoneScale */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneScaleTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 60 /* BoneAlpha */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.BONE_ALPHA, bone.name, bone); + timeline.init(this._armature, this, timelineData); + this._boneBlendTimelines.push(timeline); + break; + } + case 50 /* Surface */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone); + timeline.init(this._armature, this, timelineData); + this._boneBlendTimelines.push(timeline); + break; + } + default: + break; + } + } + } + else if (this.resetToPose) { // Pose timeline. + if (bone._boneData.type === 0 /* Bone */) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, null); + this._boneTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + else { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone); + timeline.init(this._armature, this, null); + this._boneBlendTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + } + for (var k in boneTimelines) { // Remove bone timelines. + for (var _g = 0, _h = boneTimelines[k]; _g < _h.length; _g++) { + var timeline = _h[_g]; + var index = this._boneTimelines.indexOf(timeline); + if (index >= 0) { + this._boneTimelines.splice(index, 1); + timeline.returnToPool(); + } + index = this._boneBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._boneBlendTimelines.splice(index, 1); + timeline.returnToPool(); + } + } + } + } + { // Update slot timelines. + var slotTimelines = {}; + var ffdFlags = []; + // Create slot timelines map. + for (var _j = 0, _k = this._slotTimelines; _j < _k.length; _j++) { + var timeline = _k[_j]; + var timelineName = timeline.target.name; + if (!(timelineName in slotTimelines)) { + slotTimelines[timelineName] = []; + } + slotTimelines[timelineName].push(timeline); + } + for (var _l = 0, _m = this._slotBlendTimelines; _l < _m.length; _l++) { + var timeline = _m[_l]; + var timelineName = timeline.target.target.name; + if (!(timelineName in slotTimelines)) { + slotTimelines[timelineName] = []; + } + slotTimelines[timelineName].push(timeline); + } + // + for (var _o = 0, _p = this._armature.getSlots(); _o < _p.length; _o++) { + var slot = _p[_o]; + var boneName = slot.parent.name; + if (!this.containsBoneMask(boneName)) { + continue; + } + var timelineName = slot.name; + if (timelineName in slotTimelines) { // Remove slot timeline from map. + delete slotTimelines[timelineName]; + } + else { // Create new slot timeline. + var displayIndexFlag = false; + var colorFlag = false; + ffdFlags.length = 0; + var timelineDatas = this._animationData.getSlotTimelines(timelineName); + if (timelineDatas !== null) { + for (var _q = 0, timelineDatas_3 = timelineDatas; _q < timelineDatas_3.length; _q++) { + var timelineData = timelineDatas_3[_q]; + switch (timelineData.type) { + case 20 /* SlotDisplay */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, timelineData); + this._slotTimelines.push(timeline); + displayIndexFlag = true; + break; + } + case 23 /* SlotZIndex */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotZIndexTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_Z_INDEX, slot.name, slot); + timeline.init(this._armature, this, timelineData); + this._slotBlendTimelines.push(timeline); + break; + } + case 21 /* SlotColor */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, timelineData); + this._slotTimelines.push(timeline); + colorFlag = true; + break; + } + case 22 /* SlotDeform */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot); + timeline.init(this._armature, this, timelineData); + if (timeline.target !== null) { + this._slotBlendTimelines.push(timeline); + ffdFlags.push(timeline.geometryOffset); + } + else { + timeline.returnToPool(); + } + break; + } + case 24 /* SlotAlpha */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_ALPHA, slot.name, slot); + timeline.init(this._armature, this, timelineData); + this._slotBlendTimelines.push(timeline); + break; + } + default: + break; + } + } + } + if (this.resetToPose) { // Pose timeline. + if (!displayIndexFlag) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, null); + this._slotTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + if (!colorFlag) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, null); + this._slotTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayFrame = slot.getDisplayFrameAt(i); + if (displayFrame.deformVertices.length === 0) { + continue; + } + var geometryData = displayFrame.getGeometryData(); + if (geometryData !== null && ffdFlags.indexOf(geometryData.offset) < 0) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState); + timeline.geometryOffset = geometryData.offset; // + timeline.displayFrame = displayFrame; // + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot); + timeline.init(this._armature, this, null); + this._slotBlendTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + } + } + for (var k in slotTimelines) { // Remove slot timelines. + for (var _r = 0, _s = slotTimelines[k]; _r < _s.length; _r++) { + var timeline = _s[_r]; + var index = this._slotTimelines.indexOf(timeline); + if (index >= 0) { + this._slotTimelines.splice(index, 1); + timeline.returnToPool(); + } + index = this._slotBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._slotBlendTimelines.splice(index, 1); + timeline.returnToPool(); + } + } + } + } + }; + AnimationState.prototype._advanceFadeTime = function (passedTime) { + var isFadeOut = this._fadeState > 0; + if (this._subFadeState < 0) { // Fade start event. + this._subFadeState = 0; + var eventActive = this._parent === null && this.actionEnabled; + if (eventActive) { + var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN; + if (this._armature.eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = eventType; + eventObject.armature = this._armature; + eventObject.animationState = this; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + if (passedTime < 0.0) { + passedTime = -passedTime; + } + this._fadeTime += passedTime; + if (this._fadeTime >= this.fadeTotalTime) { // Fade complete. + this._subFadeState = 1; + this._fadeProgress = isFadeOut ? 0.0 : 1.0; + } + else if (this._fadeTime > 0.0) { // Fading. + this._fadeProgress = isFadeOut ? (1.0 - this._fadeTime / this.fadeTotalTime) : (this._fadeTime / this.fadeTotalTime); + } + else { // Before fade. + this._fadeProgress = isFadeOut ? 1.0 : 0.0; + } + if (this._subFadeState > 0) { // Fade complete event. + if (!isFadeOut) { + this._playheadState |= 1; // x1 + this._fadeState = 0; + } + var eventActive = this._parent === null && this.actionEnabled; + if (eventActive) { + var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE; + if (this._armature.eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = eventType; + eventObject.armature = this._armature; + eventObject.animationState = this; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + }; + /** + * @internal + */ + AnimationState.prototype.init = function (armature, animationData, animationConfig) { + if (this._armature !== null) { + return; + } + this._armature = armature; + this._animationData = animationData; + // + this.resetToPose = animationConfig.resetToPose; + this.additive = animationConfig.additive; + this.displayControl = animationConfig.displayControl; + this.actionEnabled = animationConfig.actionEnabled; + this.blendType = animationData.blendType; + this.layer = animationConfig.layer; + this.playTimes = animationConfig.playTimes; + this.timeScale = animationConfig.timeScale; + this.fadeTotalTime = animationConfig.fadeInTime; + this.autoFadeOutTime = animationConfig.autoFadeOutTime; + this.name = animationConfig.name.length > 0 ? animationConfig.name : animationConfig.animation; + this.group = animationConfig.group; + // + this._weight = animationConfig.weight; + if (animationConfig.pauseFadeIn) { + this._playheadState = 2; // 10 + } + else { + this._playheadState = 3; // 11 + } + if (animationConfig.duration < 0.0) { + this._position = 0.0; + this._duration = this._animationData.duration; + if (animationConfig.position !== 0.0) { + if (this.timeScale >= 0.0) { + this._time = animationConfig.position; + } + else { + this._time = animationConfig.position - this._duration; + } + } + else { + this._time = 0.0; + } + } + else { + this._position = animationConfig.position; + this._duration = animationConfig.duration; + this._time = 0.0; + } + if (this.timeScale < 0.0 && this._time === 0.0) { + this._time = -0.000001; // Turn to end. + } + if (this.fadeTotalTime <= 0.0) { + this._fadeProgress = 0.999999; // Make different. + } + if (animationConfig.boneMask.length > 0) { + this._boneMask.length = animationConfig.boneMask.length; + for (var i = 0, l = this._boneMask.length; i < l; ++i) { + this._boneMask[i] = animationConfig.boneMask[i]; + } + } + this._actionTimeline = dragonBones.BaseObject.borrowObject(dragonBones.ActionTimelineState); + this._actionTimeline.init(this._armature, this, this._animationData.actionTimeline); + this._actionTimeline.currentTime = this._time; + if (this._actionTimeline.currentTime < 0.0) { + this._actionTimeline.currentTime = this._duration - this._actionTimeline.currentTime; + } + if (this._animationData.zOrderTimeline !== null) { + this._zOrderTimeline = dragonBones.BaseObject.borrowObject(dragonBones.ZOrderTimelineState); + this._zOrderTimeline.init(this._armature, this, this._animationData.zOrderTimeline); + } + }; + /** + * @internal + */ + AnimationState.prototype.advanceTime = function (passedTime, cacheFrameRate) { + // Update fade time. + if (this._fadeState !== 0 || this._subFadeState !== 0) { + this._advanceFadeTime(passedTime); + } + // Update time. + if (this._playheadState === 3) { // 11 + if (this.timeScale !== 1.0) { + passedTime *= this.timeScale; + } + this._time += passedTime; + } + // Update timeline. + if (this._timelineDirty !== 0) { + if (this._timelineDirty === 2) { + this._updateTimelines(); + } + this._timelineDirty = 0; + this._updateBoneAndSlotTimelines(); + } + var isBlendDirty = this._fadeState !== 0 || this._subFadeState === 0; + var isCacheEnabled = this._fadeState === 0 && cacheFrameRate > 0.0; + var isUpdateTimeline = true; + var isUpdateBoneTimeline = true; + var time = this._time; + this._weightResult = this._weight * this._fadeProgress; + if (this._parent !== null) { + this._weightResult *= this._parent._weightResult; + } + if (this._actionTimeline.playState <= 0) { // Update main timeline. + this._actionTimeline.update(time); + } + if (this._weight === 0.0) { + return; + } + if (isCacheEnabled) { // Cache time internval. + var internval = cacheFrameRate * 2.0; + this._actionTimeline.currentTime = Math.floor(this._actionTimeline.currentTime * internval) / internval; + } + if (this._zOrderTimeline !== null && this._zOrderTimeline.playState <= 0) { // Update zOrder timeline. + this._zOrderTimeline.update(time); + } + if (isCacheEnabled) { // Update cache. + var cacheFrameIndex = Math.floor(this._actionTimeline.currentTime * cacheFrameRate); // uint + if (this._armature._cacheFrameIndex === cacheFrameIndex) { // Same cache. + isUpdateTimeline = false; + isUpdateBoneTimeline = false; + } + else { + this._armature._cacheFrameIndex = cacheFrameIndex; + if (this._animationData.cachedFrames[cacheFrameIndex]) { // Cached. + isUpdateBoneTimeline = false; + } + else { // Cache. + this._animationData.cachedFrames[cacheFrameIndex] = true; + } + } + } + if (isUpdateTimeline) { + var isBlend = false; + var prevTarget = null; // + if (isUpdateBoneTimeline) { + for (var i = 0, l = this._boneTimelines.length; i < l; ++i) { + var timeline = this._boneTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (timeline.target !== prevTarget) { + var blendState = timeline.target; + isBlend = blendState.update(this); + prevTarget = blendState; + if (blendState.dirty === 1) { + var pose = blendState.target.animationPose; + pose.x = 0.0; + pose.y = 0.0; + pose.rotation = 0.0; + pose.skew = 0.0; + pose.scaleX = 1.0; + pose.scaleY = 1.0; + } + } + if (isBlend) { + timeline.blend(isBlendDirty); + } + } + } + for (var i = 0, l = this._boneBlendTimelines.length; i < l; ++i) { + var timeline = this._boneBlendTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (timeline.target.update(this)) { + timeline.blend(isBlendDirty); + } + } + if (this.displayControl) { + for (var i = 0, l = this._slotTimelines.length; i < l; ++i) { + var timeline = this._slotTimelines[i]; + if (timeline.playState <= 0) { + var slot = timeline.target; + var displayController = slot.displayController; + if (displayController === null || + displayController === this.name || + displayController === this.group) { + timeline.update(time); + } + } + } + } + for (var i = 0, l = this._slotBlendTimelines.length; i < l; ++i) { + var timeline = this._slotBlendTimelines[i]; + if (timeline.playState <= 0) { + var blendState = timeline.target; + timeline.update(time); + if (blendState.update(this)) { + timeline.blend(isBlendDirty); + } + } + } + for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) { + var timeline = this._constraintTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + } + if (this._animationTimelines.length > 0) { + var dL = 100.0; + var dR = 100.0; + var leftState = null; + var rightState = null; + for (var i = 0, l = this._animationTimelines.length; i < l; ++i) { + var timeline = this._animationTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (this.blendType === 1 /* E1D */) { // TODO + var animationState = timeline.target; + var d = this.parameterX - animationState.positionX; + if (d >= 0.0) { + if (d < dL) { + dL = d; + leftState = animationState; + } + } + else { + if (-d < dR) { + dR = -d; + rightState = animationState; + } + } + } + } + if (leftState !== null) { + if (this._activeChildA !== leftState) { + if (this._activeChildA !== null) { + this._activeChildA.weight = 0.0; + } + this._activeChildA = leftState; + this._activeChildA.activeTimeline(); + } + if (this._activeChildB !== rightState) { + if (this._activeChildB !== null) { + this._activeChildB.weight = 0.0; + } + this._activeChildB = rightState; + } + leftState.weight = dR / (dL + dR); + if (rightState) { + rightState.weight = 1.0 - leftState.weight; + } + } + } + } + if (this._fadeState === 0) { + if (this._subFadeState > 0) { + this._subFadeState = 0; + if (this._poseTimelines.length > 0) { // Remove pose timelines. + for (var _i = 0, _a = this._poseTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + var index = this._boneTimelines.indexOf(timeline); + if (index >= 0) { + this._boneTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._boneBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._boneBlendTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._slotTimelines.indexOf(timeline); + if (index >= 0) { + this._slotTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._slotBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._slotBlendTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._constraintTimelines.indexOf(timeline); + if (index >= 0) { + this._constraintTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + } + this._poseTimelines.length = 0; + } + } + if (this._actionTimeline.playState > 0) { + if (this.autoFadeOutTime >= 0.0) { // Auto fade out. + this.fadeOut(this.autoFadeOutTime); + } + } + } + }; + /** + * - Continue play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 继续播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.play = function () { + this._playheadState = 3; // 11 + }; + /** + * - Stop play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.stop = function () { + this._playheadState &= 1; // 0x + }; + /** + * - Fade out the animation state. + * @param fadeOutTime - The fade out time. (In seconds) + * @param pausePlayhead - Whether to pause the animation playing when fade out. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 淡出动画状态。 + * @param fadeOutTime - 淡出时间。 (以秒为单位) + * @param pausePlayhead - 淡出时是否暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.fadeOut = function (fadeOutTime, pausePlayhead) { + if (pausePlayhead === void 0) { pausePlayhead = true; } + if (fadeOutTime < 0.0) { + fadeOutTime = 0.0; + } + if (pausePlayhead) { + this._playheadState &= 2; // x0 + } + if (this._fadeState > 0) { + if (fadeOutTime > this.fadeTotalTime - this._fadeTime) { // If the animation is already in fade out, the new fade out will be ignored. + return; + } + } + else { + this._fadeState = 1; + this._subFadeState = -1; + if (fadeOutTime <= 0.0 || this._fadeProgress <= 0.0) { + this._fadeProgress = 0.000001; // Modify fade progress to different value. + } + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.fadeOut(); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.fadeOut(); + } + for (var _d = 0, _e = this._slotTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.fadeOut(); + } + for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.fadeOut(); + } + for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) { + var timeline = _j[_h]; + timeline.fadeOut(); + } + for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) { + var timeline = _l[_k]; + timeline.fadeOut(); + // + var animaitonState = timeline.target; + animaitonState.fadeOut(999999.0, true); + } + } + this.displayControl = false; // + this.fadeTotalTime = this._fadeProgress > 0.000001 ? fadeOutTime / this._fadeProgress : 0.0; + this._fadeTime = this.fadeTotalTime * (1.0 - this._fadeProgress); + }; + /** + * - Check if a specific bone mask is included. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.containsBoneMask = function (boneName) { + return this._boneMask.length === 0 || this._boneMask.indexOf(boneName) >= 0; + }; + /** + * - Add a specific bone mask. + * @param boneName - The bone name. + * @param recursive - Whether or not to add a mask to the bone's sub-bone. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加特定的骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.addBoneMask = function (boneName, recursive) { + if (recursive === void 0) { recursive = true; } + var currentBone = this._armature.getBone(boneName); + if (currentBone === null) { + return; + } + if (this._boneMask.indexOf(boneName) < 0) { // Add mixing + this._boneMask.push(boneName); + } + if (recursive) { // Add recursive mixing. + for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { + var bone = _a[_i]; + if (this._boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) { + this._boneMask.push(bone.name); + } + } + } + this._timelineDirty = 1; + }; + /** + * - Remove the mask of a specific bone. + * @param boneName - The bone name. + * @param recursive - Whether to remove the bone's sub-bone mask. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除特定骨骼的遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.removeBoneMask = function (boneName, recursive) { + if (recursive === void 0) { recursive = true; } + var index = this._boneMask.indexOf(boneName); + if (index >= 0) { // Remove mixing. + this._boneMask.splice(index, 1); + } + if (recursive) { + var currentBone = this._armature.getBone(boneName); + if (currentBone !== null) { + var bones = this._armature.getBones(); + if (this._boneMask.length > 0) { // Remove recursive mixing. + for (var _i = 0, bones_1 = bones; _i < bones_1.length; _i++) { + var bone = bones_1[_i]; + var index_1 = this._boneMask.indexOf(bone.name); + if (index_1 >= 0 && currentBone.contains(bone)) { + this._boneMask.splice(index_1, 1); + } + } + } + else { // Add unrecursive mixing. + for (var _a = 0, bones_2 = bones; _a < bones_2.length; _a++) { + var bone = bones_2[_a]; + if (bone === currentBone) { + continue; + } + if (!currentBone.contains(bone)) { + this._boneMask.push(bone.name); + } + } + } + } + } + this._timelineDirty = 1; + }; + /** + * - Remove all bone masks. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.removeAllBoneMask = function () { + this._boneMask.length = 0; + this._timelineDirty = 1; + }; + /** + * @private + */ + AnimationState.prototype.addState = function (animationState, timelineDatas) { + if (timelineDatas === void 0) { timelineDatas = null; } + if (timelineDatas !== null) { + for (var _i = 0, timelineDatas_4 = timelineDatas; _i < timelineDatas_4.length; _i++) { + var timelineData = timelineDatas_4[_i]; + switch (timelineData.type) { + case 40 /* AnimationProgress */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationProgressTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + if (this.blendType !== 0 /* None */) { + var animaitonTimelineData = timelineData; + animationState.positionX = animaitonTimelineData.x; + animationState.positionY = animaitonTimelineData.y; + animationState.weight = 0.0; + } + animationState._parent = this; + this.resetToPose = false; + break; + } + case 41 /* AnimationWeight */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationWeightTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + break; + } + case 42 /* AnimationParameter */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationParametersTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + break; + } + default: + break; + } + } + } + if (animationState._parent === null) { + animationState._parent = this; + } + }; + /** + * @internal + */ + AnimationState.prototype.activeTimeline = function () { + for (var _i = 0, _a = this._slotTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.dirty = true; + timeline.currentTime = -1.0; + } + }; + Object.defineProperty(AnimationState.prototype, "isFadeIn", { + /** + * - Whether the animation state is fading in. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡入。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState < 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isFadeOut", { + /** + * - Whether the animation state is fading out. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡出。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isFadeComplete", { + /** + * - Whether the animation state is fade completed. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否淡入或淡出完毕。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState === 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isPlaying", { + /** + * - Whether the animation state is playing. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否正在播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return (this._playheadState & 2) !== 0 && this._actionTimeline.playState <= 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isCompleted", { + /** + * - Whether the animation state is play completed. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否播放完毕。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.playState > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "currentPlayTimes", { + /** + * - The times has been played. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 已经循环播放的次数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.currentPlayTimes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "totalTime", { + /** + * - The total time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 总播放时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._duration; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "currentTime", { + /** + * - The time is currently playing. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前播放的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.currentTime; + }, + set: function (value) { + var currentPlayTimes = this._actionTimeline.currentPlayTimes - (this._actionTimeline.playState > 0 ? 1 : 0); + if (value < 0 || this._duration < value) { + value = (value % this._duration) + currentPlayTimes * this._duration; + if (value < 0) { + value += this._duration; + } + } + if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 && + value === this._duration && this._parent === null) { + value = this._duration - 0.000001; // + } + if (this._time === value) { + return; + } + this._time = value; + this._actionTimeline.setCurrentTime(this._time); + if (this._zOrderTimeline !== null) { + this._zOrderTimeline.playState = -1; + } + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.playState = -1; + } + for (var _b = 0, _c = this._slotTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.playState = -1; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "weight", { + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + /** + * - The animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + get: function () { + return this._weight; + }, + set: function (value) { + if (this._weight === value) { + return; + } + this._weight = value; + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.dirty = true; + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.dirty = true; + } + for (var _d = 0, _e = this._slotBlendTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.dirty = true; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "animationData", { + /** + * - 动画数据。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._animationData; + }, + enumerable: true, + configurable: true + }); + return AnimationState; + }(dragonBones.BaseObject)); + dragonBones.AnimationState = AnimationState; + /** + * @internal + */ + var BlendState = /** @class */ (function (_super) { + __extends(BlendState, _super); + function BlendState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlendState.toString = function () { + return "[class dragonBones.BlendState]"; + }; + BlendState.prototype._onClear = function () { + this.reset(); + this.target = null; + }; + BlendState.prototype.update = function (animationState) { + var animationLayer = animationState.layer; + var animationWeight = animationState._weightResult; + if (this.dirty > 0) { + if (this.leftWeight > 0.0) { + if (this.layer !== animationLayer) { + if (this.layerWeight >= this.leftWeight) { + this.dirty++; + this.layer = animationLayer; + this.leftWeight = 0.0; + this.blendWeight = 0.0; + return false; + } + this.layer = animationLayer; + this.leftWeight -= this.layerWeight; + this.layerWeight = 0.0; + } + animationWeight *= this.leftWeight; + this.dirty++; + this.blendWeight = animationWeight; + this.layerWeight += this.blendWeight; + return true; + } + return false; + } + this.dirty++; + this.layer = animationLayer; + this.leftWeight = 1.0; + this.blendWeight = animationWeight; + this.layerWeight = animationWeight; + return true; + }; + BlendState.prototype.reset = function () { + this.dirty = 0; + this.layer = 0; + this.leftWeight = 0.0; + this.layerWeight = 0.0; + this.blendWeight = 0.0; + }; + BlendState.BONE_TRANSFORM = "boneTransform"; + BlendState.BONE_ALPHA = "boneAlpha"; + BlendState.SURFACE = "surface"; + BlendState.SLOT_DEFORM = "slotDeform"; + BlendState.SLOT_ALPHA = "slotAlpha"; + BlendState.SLOT_Z_INDEX = "slotZIndex"; + return BlendState; + }(dragonBones.BaseObject)); + dragonBones.BlendState = BlendState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var TimelineState = /** @class */ (function (_super) { + __extends(TimelineState, _super); + function TimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimelineState.prototype._onClear = function () { + this.dirty = false; + this.playState = -1; + this.currentPlayTimes = 0; + this.currentTime = -1.0; + this.target = null; + this._isTween = false; + this._valueOffset = 0; + this._frameValueOffset = 0; + this._frameOffset = 0; + this._frameRate = 0; + this._frameCount = 0; + this._frameIndex = -1; + this._frameRateR = 0.0; + this._position = 0.0; + this._duration = 0.0; + this._timeScale = 1.0; + this._timeOffset = 0.0; + this._animationData = null; // + this._timelineData = null; // + this._armature = null; // + this._animationState = null; // + this._actionTimeline = null; // + this._frameArray = null; // + this._valueArray = null; // + this._timelineArray = null; // + this._frameIndices = null; // + }; + TimelineState.prototype._setCurrentTime = function (passedTime) { + var prevState = this.playState; + var prevPlayTimes = this.currentPlayTimes; + var prevTime = this.currentTime; + if (this._actionTimeline !== null && this._frameCount <= 1) { // No frame or only one frame. + this.playState = this._actionTimeline.playState >= 0 ? 1 : -1; + this.currentPlayTimes = 1; + this.currentTime = this._actionTimeline.currentTime; + } + else if (this._actionTimeline === null || this._timeScale !== 1.0 || this._timeOffset !== 0.0) { // Action timeline or has scale and offset. + var playTimes = this._animationState.playTimes; + var totalTime = playTimes * this._duration; + passedTime *= this._timeScale; + if (this._timeOffset !== 0.0) { + passedTime += this._timeOffset * this._animationData.duration; + } + if (playTimes > 0 && (passedTime >= totalTime || passedTime <= -totalTime)) { + if (this.playState <= 0 && this._animationState._playheadState === 3) { + this.playState = 1; + } + this.currentPlayTimes = playTimes; + if (passedTime < 0.0) { + this.currentTime = 0.0; + } + else { + this.currentTime = this.playState === 1 ? this._duration + 0.000001 : this._duration; // Precision problem + } + } + else { + if (this.playState !== 0 && this._animationState._playheadState === 3) { + this.playState = 0; + } + if (passedTime < 0.0) { + passedTime = -passedTime; + this.currentPlayTimes = Math.floor(passedTime / this._duration); + this.currentTime = this._duration - (passedTime % this._duration); + } + else { + this.currentPlayTimes = Math.floor(passedTime / this._duration); + this.currentTime = passedTime % this._duration; + } + } + this.currentTime += this._position; + } + else { // Multi frames. + this.playState = this._actionTimeline.playState; + this.currentPlayTimes = this._actionTimeline.currentPlayTimes; + this.currentTime = this._actionTimeline.currentTime; + } + if (this.currentPlayTimes === prevPlayTimes && this.currentTime === prevTime) { + return false; + } + // Clear frame flag when timeline start or loopComplete. + if ((prevState < 0 && this.playState !== prevState) || + (this.playState <= 0 && this.currentPlayTimes !== prevPlayTimes)) { + this._frameIndex = -1; + } + return true; + }; + TimelineState.prototype.init = function (armature, animationState, timelineData) { + this._armature = armature; + this._animationState = animationState; + this._timelineData = timelineData; + this._actionTimeline = this._animationState._actionTimeline; + if (this === this._actionTimeline) { + this._actionTimeline = null; // + } + this._animationData = this._animationState.animationData; + // + this._frameRate = this._animationData.parent.frameRate; + this._frameRateR = 1.0 / this._frameRate; + this._position = this._animationState._position; + this._duration = this._animationState._duration; + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data. + this._frameArray = dragonBonesData.frameArray; + this._timelineArray = dragonBonesData.timelineArray; + this._frameIndices = dragonBonesData.frameIndices; + // + this._frameCount = this._timelineArray[this._timelineData.offset + 2 /* TimelineKeyFrameCount */]; + this._frameValueOffset = this._timelineArray[this._timelineData.offset + 4 /* TimelineFrameValueOffset */]; + this._timeScale = 100.0 / this._timelineArray[this._timelineData.offset + 0 /* TimelineScale */]; + this._timeOffset = this._timelineArray[this._timelineData.offset + 1 /* TimelineOffset */] * 0.01; + } + }; + TimelineState.prototype.fadeOut = function () { + this.dirty = false; + }; + TimelineState.prototype.update = function (passedTime) { + if (this._setCurrentTime(passedTime)) { + if (this._frameCount > 1) { + var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint + var frameIndex = this._frameIndices[this._timelineData.frameIndicesOffset + timelineFrameIndex]; + if (this._frameIndex !== frameIndex) { + this._frameIndex = frameIndex; + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex]; + this._onArriveAtFrame(); + } + } + else if (this._frameIndex < 0) { + this._frameIndex = 0; + if (this._timelineData !== null) { // May be pose timeline. + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */]; + } + this._onArriveAtFrame(); + } + if (this._isTween || this.dirty) { + this._onUpdateFrame(); + } + } + }; + TimelineState.prototype.blend = function (_isDirty) { + }; + return TimelineState; + }(dragonBones.BaseObject)); + dragonBones.TimelineState = TimelineState; + /** + * @internal + */ + var TweenTimelineState = /** @class */ (function (_super) { + __extends(TweenTimelineState, _super); + function TweenTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + TweenTimelineState._getEasingValue = function (tweenType, progress, easing) { + var value = progress; + switch (tweenType) { + case 3 /* QuadIn */: + value = Math.pow(progress, 2.0); + break; + case 4 /* QuadOut */: + value = 1.0 - Math.pow(1.0 - progress, 2.0); + break; + case 5 /* QuadInOut */: + value = 0.5 * (1.0 - Math.cos(progress * Math.PI)); + break; + } + return (value - progress) * easing + progress; + }; + TweenTimelineState._getEasingCurveValue = function (progress, samples, count, offset) { + if (progress <= 0.0) { + return 0.0; + } + else if (progress >= 1.0) { + return 1.0; + } + var isOmited = count > 0; + var segmentCount = count + 1; // + 2 - 1 + var valueIndex = Math.floor(progress * segmentCount); + var fromValue = 0.0; + var toValue = 0.0; + if (isOmited) { + fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1]; + toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex]; + } + else { + fromValue = samples[offset + valueIndex - 1]; + toValue = samples[offset + valueIndex]; + } + return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001; + }; + TweenTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._tweenType = 0 /* None */; + this._curveCount = 0; + this._framePosition = 0.0; + this._frameDurationR = 0.0; + this._tweenEasing = 0.0; + this._tweenProgress = 0.0; + this._valueScale = 1.0; + }; + TweenTimelineState.prototype._onArriveAtFrame = function () { + if (this._frameCount > 1 && + (this._frameIndex !== this._frameCount - 1 || + this._animationState.playTimes === 0 || + this._animationState.currentPlayTimes < this._animationState.playTimes - 1)) { + this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */]; + this._isTween = this._tweenType !== 0 /* None */; + if (this._isTween) { + if (this._tweenType === 2 /* Curve */) { + this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */]; + } + else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) { + this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01; + } + } + else { + this.dirty = true; + } + this._framePosition = this._frameArray[this._frameOffset] * this._frameRateR; + if (this._frameIndex === this._frameCount - 1) { + this._frameDurationR = 1.0 / (this._animationData.duration - this._framePosition); + } + else { + var nextFrameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex + 1]; + var frameDuration = this._frameArray[nextFrameOffset] * this._frameRateR - this._framePosition; + if (frameDuration > 0) { + this._frameDurationR = 1.0 / frameDuration; + } + else { + this._frameDurationR = 0.0; + } + } + } + else { + this.dirty = true; + this._isTween = false; + } + }; + TweenTimelineState.prototype._onUpdateFrame = function () { + if (this._isTween) { + this.dirty = true; + this._tweenProgress = (this.currentTime - this._framePosition) * this._frameDurationR; + if (this._tweenType === 2 /* Curve */) { + this._tweenProgress = TweenTimelineState._getEasingCurveValue(this._tweenProgress, this._frameArray, this._curveCount, this._frameOffset + 3 /* FrameCurveSamples */); + } + else if (this._tweenType !== 1 /* Line */) { + this._tweenProgress = TweenTimelineState._getEasingValue(this._tweenType, this._tweenProgress, this._tweenEasing); + } + } + }; + return TweenTimelineState; + }(TimelineState)); + dragonBones.TweenTimelineState = TweenTimelineState; + /** + * @internal + */ + var SingleValueTimelineState = /** @class */ (function (_super) { + __extends(SingleValueTimelineState, _super); + function SingleValueTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SingleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._current = 0.0; + this._difference = 0.0; + this._result = 0.0; + }; + SingleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + 1; + if (valueScale === 1.0) { + this._current = valueArray[valueOffset]; + this._difference = valueArray[nextValueOffset] - this._current; + } + else { + this._current = valueArray[valueOffset] * valueScale; + this._difference = valueArray[nextValueOffset] * valueScale - this._current; + } + } + else { + this._result = valueArray[valueOffset] * valueScale; + } + } + else { + this._result = 0.0; + } + }; + SingleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._result = this._current + this._difference * this._tweenProgress; + } + }; + return SingleValueTimelineState; + }(TweenTimelineState)); + dragonBones.SingleValueTimelineState = SingleValueTimelineState; + /** + * @internal + */ + var DoubleValueTimelineState = /** @class */ (function (_super) { + __extends(DoubleValueTimelineState, _super); + function DoubleValueTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + DoubleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._currentA = 0.0; + this._currentB = 0.0; + this._differenceA = 0.0; + this._differenceB = 0.0; + this._resultA = 0.0; + this._resultB = 0.0; + }; + DoubleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * 2; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + 2; + if (valueScale === 1.0) { + this._currentA = valueArray[valueOffset]; + this._currentB = valueArray[valueOffset + 1]; + this._differenceA = valueArray[nextValueOffset] - this._currentA; + this._differenceB = valueArray[nextValueOffset + 1] - this._currentB; + } + else { + this._currentA = valueArray[valueOffset] * valueScale; + this._currentB = valueArray[valueOffset + 1] * valueScale; + this._differenceA = valueArray[nextValueOffset] * valueScale - this._currentA; + this._differenceB = valueArray[nextValueOffset + 1] * valueScale - this._currentB; + } + } + else { + this._resultA = valueArray[valueOffset] * valueScale; + this._resultB = valueArray[valueOffset + 1] * valueScale; + } + } + else { + this._resultA = 0.0; + this._resultB = 0.0; + } + }; + DoubleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._resultA = this._currentA + this._differenceA * this._tweenProgress; + this._resultB = this._currentB + this._differenceB * this._tweenProgress; + } + }; + return DoubleValueTimelineState; + }(TweenTimelineState)); + dragonBones.DoubleValueTimelineState = DoubleValueTimelineState; + /** + * @internal + */ + var MutilpleValueTimelineState = /** @class */ (function (_super) { + __extends(MutilpleValueTimelineState, _super); + function MutilpleValueTimelineState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._rd = []; + return _this; + } + MutilpleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._valueCount = 0; + this._rd.length = 0; + }; + MutilpleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + var valueCount = this._valueCount; + var rd = this._rd; + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + valueCount; + if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[valueCount + i] = valueArray[nextValueOffset + i] - valueArray[valueOffset + i]; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[valueCount + i] = (valueArray[nextValueOffset + i] - valueArray[valueOffset + i]) * valueScale; + } + } + } + else if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i]; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] * valueScale; + } + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = 0.0; + } + } + }; + MutilpleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + var valueCount = this._valueCount; + var valueScale = this._valueScale; + var tweenProgress = this._tweenProgress; + var valueArray = this._valueArray; + var rd = this._rd; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount; + if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] + rd[valueCount + i] * tweenProgress; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] * valueScale + rd[valueCount + i] * tweenProgress; + } + } + } + }; + return MutilpleValueTimelineState; + }(TweenTimelineState)); + dragonBones.MutilpleValueTimelineState = MutilpleValueTimelineState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var ActionTimelineState = /** @class */ (function (_super) { + __extends(ActionTimelineState, _super); + function ActionTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + ActionTimelineState.toString = function () { + return "[class dragonBones.ActionTimelineState]"; + }; + ActionTimelineState.prototype._onCrossFrame = function (frameIndex) { + var eventDispatcher = this._armature.eventDispatcher; + if (this._animationState.actionEnabled) { + var frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + frameIndex]; + var actionCount = this._frameArray[frameOffset + 1]; + var actions = this._animationData.parent.actions; // May be the animaton data not belong to this armature data. + for (var i = 0; i < actionCount; ++i) { + var actionIndex = this._frameArray[frameOffset + 2 + i]; + var action = actions[actionIndex]; + if (action.type === 0 /* Play */) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + // eventObject.time = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + eventObject.time = this._frameArray[frameOffset] / this._frameRate; + eventObject.animationState = this._animationState; + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + this._armature._bufferAction(eventObject, true); + } + else { + var eventType = action.type === 10 /* Frame */ ? dragonBones.EventObject.FRAME_EVENT : dragonBones.EventObject.SOUND_EVENT; + if (action.type === 11 /* Sound */ || eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + // eventObject.time = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + eventObject.time = this._frameArray[frameOffset] / this._frameRate; + eventObject.animationState = this._animationState; + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + } + }; + ActionTimelineState.prototype._onArriveAtFrame = function () { }; + ActionTimelineState.prototype._onUpdateFrame = function () { }; + ActionTimelineState.prototype.update = function (passedTime) { + var prevState = this.playState; + var prevPlayTimes = this.currentPlayTimes; + var prevTime = this.currentTime; + if (this._setCurrentTime(passedTime)) { + var eventActive = this._animationState._parent === null && this._animationState.actionEnabled; + var eventDispatcher = this._armature.eventDispatcher; + if (prevState < 0) { + if (this.playState !== prevState) { + if (this._animationState.displayControl && this._animationState.resetToPose) { // Reset zorder to pose. + this._armature._sortZOrder(null, 0); + } + // prevPlayTimes = this.currentPlayTimes; // TODO + if (eventActive && eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = dragonBones.EventObject.START; + eventObject.armature = this._armature; + eventObject.animationState = this._animationState; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + else { + return; + } + } + var isReverse = this._animationState.timeScale < 0.0; + var loopCompleteEvent = null; + var completeEvent = null; + if (eventActive && this.currentPlayTimes !== prevPlayTimes) { + if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.LOOP_COMPLETE)) { + loopCompleteEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + loopCompleteEvent.type = dragonBones.EventObject.LOOP_COMPLETE; + loopCompleteEvent.armature = this._armature; + loopCompleteEvent.animationState = this._animationState; + } + if (this.playState > 0) { + if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.COMPLETE)) { + completeEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + completeEvent.type = dragonBones.EventObject.COMPLETE; + completeEvent.armature = this._armature; + completeEvent.animationState = this._animationState; + } + } + } + if (this._frameCount > 1) { + var timelineData = this._timelineData; + var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint + var frameIndex = this._frameIndices[timelineData.frameIndicesOffset + timelineFrameIndex]; + if (this._frameIndex !== frameIndex) { // Arrive at frame. + var crossedFrameIndex = this._frameIndex; + this._frameIndex = frameIndex; + if (this._timelineArray !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex]; + if (isReverse) { + if (crossedFrameIndex < 0) { + var prevFrameIndex = Math.floor(prevTime * this._frameRate); + crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex]; + if (this.currentPlayTimes === prevPlayTimes) { // Start. + if (crossedFrameIndex === frameIndex) { // Uncrossed. + crossedFrameIndex = -1; + } + } + } + while (crossedFrameIndex >= 0) { + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this._position <= framePosition && + framePosition <= this._position + this._duration) { // Support interval play. + this._onCrossFrame(crossedFrameIndex); + } + if (loopCompleteEvent !== null && crossedFrameIndex === 0) { // Add loop complete event after first frame. + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + if (crossedFrameIndex > 0) { + crossedFrameIndex--; + } + else { + crossedFrameIndex = this._frameCount - 1; + } + if (crossedFrameIndex === frameIndex) { + break; + } + } + } + else { + if (crossedFrameIndex < 0) { + var prevFrameIndex = Math.floor(prevTime * this._frameRate); + crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex]; + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this.currentPlayTimes === prevPlayTimes) { // Start. + if (prevTime <= framePosition) { // Crossed. + if (crossedFrameIndex > 0) { + crossedFrameIndex--; + } + else { + crossedFrameIndex = this._frameCount - 1; + } + } + else if (crossedFrameIndex === frameIndex) { // Uncrossed. + crossedFrameIndex = -1; + } + } + } + while (crossedFrameIndex >= 0) { + if (crossedFrameIndex < this._frameCount - 1) { + crossedFrameIndex++; + } + else { + crossedFrameIndex = 0; + } + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this._position <= framePosition && + framePosition <= this._position + this._duration // + ) { // Support interval play. + this._onCrossFrame(crossedFrameIndex); + } + if (loopCompleteEvent !== null && crossedFrameIndex === 0) { // Add loop complete event before first frame. + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + if (crossedFrameIndex === frameIndex) { + break; + } + } + } + } + } + } + else if (this._frameIndex < 0) { + this._frameIndex = 0; + if (this._timelineData !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */]; + // Arrive at frame. + var framePosition = this._frameArray[this._frameOffset] / this._frameRate; + if (this.currentPlayTimes === prevPlayTimes) { // Start. + if (prevTime <= framePosition) { + this._onCrossFrame(this._frameIndex); + } + } + else if (this._position <= framePosition) { // Loop complete. + if (!isReverse && loopCompleteEvent !== null) { // Add loop complete event before first frame. + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + this._onCrossFrame(this._frameIndex); + } + } + } + if (loopCompleteEvent !== null) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + } + if (completeEvent !== null) { + this._armature._dragonBones.bufferEvent(completeEvent); + } + } + }; + ActionTimelineState.prototype.setCurrentTime = function (value) { + this._setCurrentTime(value); + this._frameIndex = -1; + }; + return ActionTimelineState; + }(dragonBones.TimelineState)); + dragonBones.ActionTimelineState = ActionTimelineState; + /** + * @internal + */ + var ZOrderTimelineState = /** @class */ (function (_super) { + __extends(ZOrderTimelineState, _super); + function ZOrderTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + ZOrderTimelineState.toString = function () { + return "[class dragonBones.ZOrderTimelineState]"; + }; + ZOrderTimelineState.prototype._onArriveAtFrame = function () { + if (this.playState >= 0) { + var count = this._frameArray[this._frameOffset + 1]; + if (count > 0) { + this._armature._sortZOrder(this._frameArray, this._frameOffset + 2); + } + else { + this._armature._sortZOrder(null, 0); + } + } + }; + ZOrderTimelineState.prototype._onUpdateFrame = function () { }; + return ZOrderTimelineState; + }(dragonBones.TimelineState)); + dragonBones.ZOrderTimelineState = ZOrderTimelineState; + /** + * @internal + */ + var BoneAllTimelineState = /** @class */ (function (_super) { + __extends(BoneAllTimelineState, _super); + function BoneAllTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneAllTimelineState.toString = function () { + return "[class dragonBones.BoneAllTimelineState]"; + }; + BoneAllTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._isTween && this._frameIndex === this._frameCount - 1) { + this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]); + this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]); + } + if (this._timelineData === null) { // Pose. + this._rd[4] = 1.0; + this._rd[5] = 1.0; + } + }; + BoneAllTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = 6; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneAllTimelineState.prototype.fadeOut = function () { + this.dirty = false; + this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]); + this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]); + }; + BoneAllTimelineState.prototype.blend = function (isDirty) { + var valueScale = this._armature.armatureData.scale; + var rd = this._rd; + // + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.x += rd[0] * blendWeight * valueScale; + result.y += rd[1] * blendWeight * valueScale; + result.rotation += rd[2] * blendWeight; + result.skew += rd[3] * blendWeight; + result.scaleX += (rd[4] - 1.0) * blendWeight; + result.scaleY += (rd[5] - 1.0) * blendWeight; + } + else { + result.x = rd[0] * blendWeight * valueScale; + result.y = rd[1] * blendWeight * valueScale; + result.rotation = rd[2] * blendWeight; + result.skew = rd[3] * blendWeight; + result.scaleX = (rd[4] - 1.0) * blendWeight + 1.0; // + result.scaleY = (rd[5] - 1.0) * blendWeight + 1.0; // + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneAllTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.BoneAllTimelineState = BoneAllTimelineState; + /** + * @internal + */ + var BoneTranslateTimelineState = /** @class */ (function (_super) { + __extends(BoneTranslateTimelineState, _super); + function BoneTranslateTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneTranslateTimelineState.toString = function () { + return "[class dragonBones.BoneTranslateTimelineState]"; + }; + BoneTranslateTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneTranslateTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.x += this._resultA * blendWeight; + result.y += this._resultB * blendWeight; + } + else if (blendWeight !== 1.0) { + result.x = this._resultA * blendWeight; + result.y = this._resultB * blendWeight; + } + else { + result.x = this._resultA; + result.y = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneTranslateTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneTranslateTimelineState = BoneTranslateTimelineState; + /** + * @internal + */ + var BoneRotateTimelineState = /** @class */ (function (_super) { + __extends(BoneRotateTimelineState, _super); + function BoneRotateTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneRotateTimelineState.toString = function () { + return "[class dragonBones.BoneRotateTimelineState]"; + }; + BoneRotateTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._isTween && this._frameIndex === this._frameCount - 1) { + this._differenceA = dragonBones.Transform.normalizeRadian(this._differenceA); + this._differenceB = dragonBones.Transform.normalizeRadian(this._differenceB); + } + }; + BoneRotateTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneRotateTimelineState.prototype.fadeOut = function () { + this.dirty = false; + this._resultA = dragonBones.Transform.normalizeRadian(this._resultA); + this._resultB = dragonBones.Transform.normalizeRadian(this._resultB); + }; + BoneRotateTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.rotation += this._resultA * blendWeight; + result.skew += this._resultB * blendWeight; + } + else if (blendWeight !== 1.0) { + result.rotation = this._resultA * blendWeight; + result.skew = this._resultB * blendWeight; + } + else { + result.rotation = this._resultA; + result.skew = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneRotateTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneRotateTimelineState = BoneRotateTimelineState; + /** + * @internal + */ + var BoneScaleTimelineState = /** @class */ (function (_super) { + __extends(BoneScaleTimelineState, _super); + function BoneScaleTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneScaleTimelineState.toString = function () { + return "[class dragonBones.BoneScaleTimelineState]"; + }; + BoneScaleTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { // Pose. + this._resultA = 1.0; + this._resultB = 1.0; + } + }; + BoneScaleTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneScaleTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.scaleX += (this._resultA - 1.0) * blendWeight; + result.scaleY += (this._resultB - 1.0) * blendWeight; + } + else if (blendWeight !== 1.0) { + result.scaleX = (this._resultA - 1.0) * blendWeight + 1.0; + result.scaleY = (this._resultB - 1.0) * blendWeight + 1.0; + } + else { + result.scaleX = this._resultA; + result.scaleY = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneScaleTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneScaleTimelineState = BoneScaleTimelineState; + /** + * @internal + */ + var SurfaceTimelineState = /** @class */ (function (_super) { + __extends(SurfaceTimelineState, _super); + function SurfaceTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SurfaceTimelineState.toString = function () { + return "[class dragonBones.SurfaceTimelineState]"; + }; + SurfaceTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._deformCount = 0; + this._deformOffset = 0; + this._sameValueOffset = 0; + }; + SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; + var frameIntArray = dragonBonesData.frameIntArray; + var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */]; + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */]; + this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */]; + this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */]; + this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = dragonBonesData.frameFloatArray; + this._rd.length = this._valueCount * 2; + } + else { + this._deformCount = this.target.target._deformVertices.length; + } + }; + SurfaceTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var surface = blendState.target; + var blendWeight = blendState.blendWeight; + var result = surface._deformVertices; + var valueArray = this._valueArray; + if (valueArray !== null) { + var valueCount = this._valueCount; + var deformOffset = this._deformOffset; + var sameValueOffset = this._sameValueOffset; + var rd = this._rd; + for (var i = 0; i < this._deformCount; ++i) { + var value = 0.0; + if (i < deformOffset) { + value = valueArray[sameValueOffset + i]; + } + else if (i < deformOffset + valueCount) { + value = rd[i - deformOffset]; + } + else { + value = valueArray[sameValueOffset + i - valueCount]; + } + if (blendState.dirty > 1) { + result[i] += value * blendWeight; + } + else { + result[i] = value * blendWeight; + } + } + } + else if (blendState.dirty === 1) { + for (var i = 0; i < this._deformCount; ++i) { + result[i] = 0.0; + } + } + if (isDirty || this.dirty) { + this.dirty = false; + surface._transformDirty = true; + } + }; + return SurfaceTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.SurfaceTimelineState = SurfaceTimelineState; + /** + * @internal + */ + var AlphaTimelineState = /** @class */ (function (_super) { + __extends(AlphaTimelineState, _super); + function AlphaTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AlphaTimelineState.toString = function () { + return "[class dragonBones.AlphaTimelineState]"; + }; + AlphaTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { // Pose. + this._result = 1.0; + } + }; + AlphaTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.01; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + AlphaTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var alphaTarget = blendState.target; + var blendWeight = blendState.blendWeight; + if (blendState.dirty > 1) { + alphaTarget._alpha += this._result * blendWeight; + if (alphaTarget._alpha > 1.0) { + alphaTarget._alpha = 1.0; + } + } + else { + alphaTarget._alpha = this._result * blendWeight; + } + if (isDirty || this.dirty) { + this.dirty = false; + this._armature._alphaDirty = true; + } + }; + return AlphaTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AlphaTimelineState = AlphaTimelineState; + /** + * @internal + */ + var SlotDisplayTimelineState = /** @class */ (function (_super) { + __extends(SlotDisplayTimelineState, _super); + function SlotDisplayTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SlotDisplayTimelineState.toString = function () { + return "[class dragonBones.SlotDisplayTimelineState]"; + }; + SlotDisplayTimelineState.prototype._onArriveAtFrame = function () { + if (this.playState >= 0) { + var slot = this.target; + var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : slot._slotData.displayIndex; + if (slot.displayIndex !== displayIndex) { + slot._setDisplayIndex(displayIndex, true); + } + } + }; + SlotDisplayTimelineState.prototype._onUpdateFrame = function () { + }; + return SlotDisplayTimelineState; + }(dragonBones.TimelineState)); + dragonBones.SlotDisplayTimelineState = SlotDisplayTimelineState; + /** + * @internal + */ + var SlotColorTimelineState = /** @class */ (function (_super) { + __extends(SlotColorTimelineState, _super); + function SlotColorTimelineState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._current = [0, 0, 0, 0, 0, 0, 0, 0]; + _this._difference = [0, 0, 0, 0, 0, 0, 0, 0]; + _this._result = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]; + return _this; + } + SlotColorTimelineState.toString = function () { + return "[class dragonBones.SlotColorTimelineState]"; + }; + SlotColorTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; + var colorArray = dragonBonesData.colorArray; + var frameIntArray = dragonBonesData.frameIntArray; + var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex; + var colorOffset = frameIntArray[valueOffset]; + if (colorOffset < 0) { + colorOffset += 65536; // Fixed out of bounds bug. + } + if (this._isTween) { + this._current[0] = colorArray[colorOffset++]; + this._current[1] = colorArray[colorOffset++]; + this._current[2] = colorArray[colorOffset++]; + this._current[3] = colorArray[colorOffset++]; + this._current[4] = colorArray[colorOffset++]; + this._current[5] = colorArray[colorOffset++]; + this._current[6] = colorArray[colorOffset++]; + this._current[7] = colorArray[colorOffset++]; + if (this._frameIndex === this._frameCount - 1) { + colorOffset = frameIntArray[this._animationData.frameIntOffset + this._frameValueOffset]; + } + else { + colorOffset = frameIntArray[valueOffset + 1]; + } + if (colorOffset < 0) { + colorOffset += 65536; // Fixed out of bounds bug. + } + this._difference[0] = colorArray[colorOffset++] - this._current[0]; + this._difference[1] = colorArray[colorOffset++] - this._current[1]; + this._difference[2] = colorArray[colorOffset++] - this._current[2]; + this._difference[3] = colorArray[colorOffset++] - this._current[3]; + this._difference[4] = colorArray[colorOffset++] - this._current[4]; + this._difference[5] = colorArray[colorOffset++] - this._current[5]; + this._difference[6] = colorArray[colorOffset++] - this._current[6]; + this._difference[7] = colorArray[colorOffset++] - this._current[7]; + } + else { + this._result[0] = colorArray[colorOffset++] * 0.01; + this._result[1] = colorArray[colorOffset++] * 0.01; + this._result[2] = colorArray[colorOffset++] * 0.01; + this._result[3] = colorArray[colorOffset++] * 0.01; + this._result[4] = colorArray[colorOffset++]; + this._result[5] = colorArray[colorOffset++]; + this._result[6] = colorArray[colorOffset++]; + this._result[7] = colorArray[colorOffset++]; + } + } + else { // Pose. + var slot = this.target; + var color = slot.slotData.color; + this._result[0] = color.alphaMultiplier; + this._result[1] = color.redMultiplier; + this._result[2] = color.greenMultiplier; + this._result[3] = color.blueMultiplier; + this._result[4] = color.alphaOffset; + this._result[5] = color.redOffset; + this._result[6] = color.greenOffset; + this._result[7] = color.blueOffset; + } + }; + SlotColorTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._result[0] = (this._current[0] + this._difference[0] * this._tweenProgress) * 0.01; + this._result[1] = (this._current[1] + this._difference[1] * this._tweenProgress) * 0.01; + this._result[2] = (this._current[2] + this._difference[2] * this._tweenProgress) * 0.01; + this._result[3] = (this._current[3] + this._difference[3] * this._tweenProgress) * 0.01; + this._result[4] = this._current[4] + this._difference[4] * this._tweenProgress; + this._result[5] = this._current[5] + this._difference[5] * this._tweenProgress; + this._result[6] = this._current[6] + this._difference[6] * this._tweenProgress; + this._result[7] = this._current[7] + this._difference[7] * this._tweenProgress; + } + }; + SlotColorTimelineState.prototype.fadeOut = function () { + this._isTween = false; + }; + SlotColorTimelineState.prototype.update = function (passedTime) { + _super.prototype.update.call(this, passedTime); + // Fade animation. + if (this._isTween || this.dirty) { + var slot = this.target; + var result = slot._colorTransform; + if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) { + if (result.alphaMultiplier !== this._result[0] || + result.redMultiplier !== this._result[1] || + result.greenMultiplier !== this._result[2] || + result.blueMultiplier !== this._result[3] || + result.alphaOffset !== this._result[4] || + result.redOffset !== this._result[5] || + result.greenOffset !== this._result[6] || + result.blueOffset !== this._result[7]) { + var fadeProgress = Math.pow(this._animationState._fadeProgress, 4); + result.alphaMultiplier += (this._result[0] - result.alphaMultiplier) * fadeProgress; + result.redMultiplier += (this._result[1] - result.redMultiplier) * fadeProgress; + result.greenMultiplier += (this._result[2] - result.greenMultiplier) * fadeProgress; + result.blueMultiplier += (this._result[3] - result.blueMultiplier) * fadeProgress; + result.alphaOffset += (this._result[4] - result.alphaOffset) * fadeProgress; + result.redOffset += (this._result[5] - result.redOffset) * fadeProgress; + result.greenOffset += (this._result[6] - result.greenOffset) * fadeProgress; + result.blueOffset += (this._result[7] - result.blueOffset) * fadeProgress; + slot._colorDirty = true; + } + } + else if (this.dirty) { + this.dirty = false; + if (result.alphaMultiplier !== this._result[0] || + result.redMultiplier !== this._result[1] || + result.greenMultiplier !== this._result[2] || + result.blueMultiplier !== this._result[3] || + result.alphaOffset !== this._result[4] || + result.redOffset !== this._result[5] || + result.greenOffset !== this._result[6] || + result.blueOffset !== this._result[7]) { + result.alphaMultiplier = this._result[0]; + result.redMultiplier = this._result[1]; + result.greenMultiplier = this._result[2]; + result.blueMultiplier = this._result[3]; + result.alphaOffset = this._result[4]; + result.redOffset = this._result[5]; + result.greenOffset = this._result[6]; + result.blueOffset = this._result[7]; + slot._colorDirty = true; + } + } + } + }; + return SlotColorTimelineState; + }(dragonBones.TweenTimelineState)); + dragonBones.SlotColorTimelineState = SlotColorTimelineState; + /** + * @internal + */ + var SlotZIndexTimelineState = /** @class */ (function (_super) { + __extends(SlotZIndexTimelineState, _super); + function SlotZIndexTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SlotZIndexTimelineState.toString = function () { + return "[class dragonBones.SlotZIndexTimelineState]"; + }; + SlotZIndexTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { // Pose. + var blendState = this.target; + var slot = blendState.target; + this._result = slot.slotData.zIndex; + } + }; + SlotZIndexTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + SlotZIndexTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var slot = blendState.target; + var blendWeight = blendState.blendWeight; + if (blendState.dirty > 1) { + slot._zIndex += this._result * blendWeight; + } + else { + slot._zIndex = this._result * blendWeight; + } + if (isDirty || this.dirty) { + this.dirty = false; + this._armature._zIndexDirty = true; + } + }; + return SlotZIndexTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.SlotZIndexTimelineState = SlotZIndexTimelineState; + /** + * @internal + */ + var DeformTimelineState = /** @class */ (function (_super) { + __extends(DeformTimelineState, _super); + function DeformTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + DeformTimelineState.toString = function () { + return "[class dragonBones.DeformTimelineState]"; + }; + DeformTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.geometryOffset = 0; + this.displayFrame = null; + this._deformCount = 0; + this._deformOffset = 0; + this._sameValueOffset = 0; + }; + DeformTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + if (this._timelineData !== null) { + var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */]; + var dragonBonesData = this._animationData.parent.parent; + var frameIntArray = dragonBonesData.frameIntArray; + var slot = this.target.target; + this.geometryOffset = frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */]; + if (this.geometryOffset < 0) { + this.geometryOffset += 65536; // Fixed out of bounds bug. + } + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayFrame = slot.getDisplayFrameAt(i); + var geometryData = displayFrame.getGeometryData(); + if (geometryData === null) { + continue; + } + if (geometryData.offset === this.geometryOffset) { + this.displayFrame = displayFrame; + this.displayFrame.updateDeformVertices(); + break; + } + } + if (this.displayFrame === null) { + this.returnToPool(); // + return; + } + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */]; + this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */]; + this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */]; + this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = dragonBonesData.frameFloatArray; + this._rd.length = this._valueCount * 2; + } + else { + this._deformCount = this.displayFrame.deformVertices.length; + } + }; + DeformTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var slot = blendState.target; + var blendWeight = blendState.blendWeight; + var result = this.displayFrame.deformVertices; + var valueArray = this._valueArray; + if (valueArray !== null) { + var valueCount = this._valueCount; + var deformOffset = this._deformOffset; + var sameValueOffset = this._sameValueOffset; + var rd = this._rd; + for (var i = 0; i < this._deformCount; ++i) { + var value = 0.0; + if (i < deformOffset) { + value = valueArray[sameValueOffset + i]; + } + else if (i < deformOffset + valueCount) { + value = rd[i - deformOffset]; + } + else { + value = valueArray[sameValueOffset + i - valueCount]; + } + if (blendState.dirty > 1) { + result[i] += value * blendWeight; + } + else { + result[i] = value * blendWeight; + } + } + } + else if (blendState.dirty === 1) { + for (var i = 0; i < this._deformCount; ++i) { + result[i] = 0.0; + } + } + if (isDirty || this.dirty) { + this.dirty = false; + if (slot._geometryData === this.displayFrame.getGeometryData()) { + slot._verticesDirty = true; + } + } + }; + return DeformTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.DeformTimelineState = DeformTimelineState; + /** + * @internal + */ + var IKConstraintTimelineState = /** @class */ (function (_super) { + __extends(IKConstraintTimelineState, _super); + function IKConstraintTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraintTimelineState.toString = function () { + return "[class dragonBones.IKConstraintTimelineState]"; + }; + IKConstraintTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var ikConstraint = this.target; + if (this._timelineData !== null) { + ikConstraint._bendPositive = this._currentA > 0.0; + ikConstraint._weight = this._currentB; + } + else { + var ikConstraintData = ikConstraint._constraintData; + ikConstraint._bendPositive = ikConstraintData.bendPositive; + ikConstraint._weight = ikConstraintData.weight; + } + ikConstraint.invalidUpdate(); + this.dirty = false; + }; + IKConstraintTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.01; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return IKConstraintTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.IKConstraintTimelineState = IKConstraintTimelineState; + /** + * @internal + */ + var AnimationProgressTimelineState = /** @class */ (function (_super) { + __extends(AnimationProgressTimelineState, _super); + function AnimationProgressTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationProgressTimelineState.toString = function () { + return "[class dragonBones.AnimationProgressTimelineState]"; + }; + AnimationProgressTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.currentTime = this._result * animationState.totalTime; + } + this.dirty = false; + }; + AnimationProgressTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationProgressTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AnimationProgressTimelineState = AnimationProgressTimelineState; + /** + * @internal + */ + var AnimationWeightTimelineState = /** @class */ (function (_super) { + __extends(AnimationWeightTimelineState, _super); + function AnimationWeightTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationWeightTimelineState.toString = function () { + return "[class dragonBones.AnimationWeightTimelineState]"; + }; + AnimationWeightTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.weight = this._result; + } + this.dirty = false; + }; + AnimationWeightTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationWeightTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AnimationWeightTimelineState = AnimationWeightTimelineState; + /** + * @internal + */ + var AnimationParametersTimelineState = /** @class */ (function (_super) { + __extends(AnimationParametersTimelineState, _super); + function AnimationParametersTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationParametersTimelineState.toString = function () { + return "[class dragonBones.AnimationParametersTimelineState]"; + }; + AnimationParametersTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.parameterX = this._resultA; + animationState.parameterY = this._resultB; + } + this.dirty = false; + }; + AnimationParametersTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationParametersTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.AnimationParametersTimelineState = AnimationParametersTimelineState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The properties of the object carry basic information about an event, + * which are passed as parameter or parameter's parameter to event listeners when an event occurs. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 + * @version DragonBones 4.5 + * @language zh_CN + */ + var EventObject = /** @class */ (function (_super) { + __extends(EventObject, _super); + function EventObject() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @internal + * @private + */ + EventObject.actionDataToInstance = function (data, instance, armature) { + if (data.type === 0 /* Play */) { + instance.type = EventObject.FRAME_EVENT; + } + else { + instance.type = data.type === 10 /* Frame */ ? EventObject.FRAME_EVENT : EventObject.SOUND_EVENT; + } + instance.name = data.name; + instance.armature = armature; + instance.actionData = data; + instance.data = data.data; + if (data.bone !== null) { + instance.bone = armature.getBone(data.bone.name); + } + if (data.slot !== null) { + instance.slot = armature.getSlot(data.slot.name); + } + }; + EventObject.toString = function () { + return "[class dragonBones.EventObject]"; + }; + EventObject.prototype._onClear = function () { + this.time = 0.0; + this.type = ""; + this.name = ""; + this.armature = null; + this.bone = null; + this.slot = null; + this.animationState = null; + this.actionData = null; + this.data = null; + }; + /** + * - Animation start play. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画开始播放。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.START = "start"; + /** + * - Animation loop play complete once. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画循环播放完成一次。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.LOOP_COMPLETE = "loopComplete"; + /** + * - Animation play complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画播放完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.COMPLETE = "complete"; + /** + * - Animation fade in start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_IN = "fadeIn"; + /** + * - Animation fade in complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_IN_COMPLETE = "fadeInComplete"; + /** + * - Animation fade out start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_OUT = "fadeOut"; + /** + * - Animation fade out complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_OUT_COMPLETE = "fadeOutComplete"; + /** + * - Animation frame event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FRAME_EVENT = "frameEvent"; + /** + * - Animation frame sound event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧声音事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.SOUND_EVENT = "soundEvent"; + return EventObject; + }(dragonBones.BaseObject)); + dragonBones.EventObject = EventObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DataParser = /** @class */ (function () { + function DataParser() { + } + DataParser._getArmatureType = function (value) { + switch (value.toLowerCase()) { + case "stage": + return 2 /* Stage */; + case "armature": + return 0 /* Armature */; + case "movieclip": + return 1 /* MovieClip */; + default: + return 0 /* Armature */; + } + }; + DataParser._getBoneType = function (value) { + switch (value.toLowerCase()) { + case "bone": + return 0 /* Bone */; + case "surface": + return 1 /* Surface */; + default: + return 0 /* Bone */; + } + }; + DataParser._getPositionMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "percent": + return 1 /* Percent */; + case "fixed": + return 0 /* Fixed */; + default: + return 1 /* Percent */; + } + }; + DataParser._getSpacingMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "length": + return 0 /* Length */; + case "percent": + return 2 /* Percent */; + case "fixed": + return 1 /* Fixed */; + default: + return 0 /* Length */; + } + }; + DataParser._getRotateMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "tangent": + return 0 /* Tangent */; + case "chain": + return 1 /* Chain */; + case "chainscale": + return 2 /* ChainScale */; + default: + return 0 /* Tangent */; + } + }; + DataParser._getDisplayType = function (value) { + switch (value.toLowerCase()) { + case "image": + return 0 /* Image */; + case "mesh": + return 2 /* Mesh */; + case "armature": + return 1 /* Armature */; + case "boundingbox": + return 3 /* BoundingBox */; + case "path": + return 4 /* Path */; + default: + return 0 /* Image */; + } + }; + DataParser._getBoundingBoxType = function (value) { + switch (value.toLowerCase()) { + case "rectangle": + return 0 /* Rectangle */; + case "ellipse": + return 1 /* Ellipse */; + case "polygon": + return 2 /* Polygon */; + default: + return 0 /* Rectangle */; + } + }; + DataParser._getBlendMode = function (value) { + switch (value.toLowerCase()) { + case "normal": + return 0 /* Normal */; + case "add": + return 1 /* Add */; + case "alpha": + return 2 /* Alpha */; + case "darken": + return 3 /* Darken */; + case "difference": + return 4 /* Difference */; + case "erase": + return 5 /* Erase */; + case "hardlight": + return 6 /* HardLight */; + case "invert": + return 7 /* Invert */; + case "layer": + return 8 /* Layer */; + case "lighten": + return 9 /* Lighten */; + case "multiply": + return 10 /* Multiply */; + case "overlay": + return 11 /* Overlay */; + case "screen": + return 12 /* Screen */; + case "subtract": + return 13 /* Subtract */; + default: + return 0 /* Normal */; + } + }; + DataParser._getAnimationBlendType = function (value) { + switch (value.toLowerCase()) { + case "none": + return 0 /* None */; + case "1d": + return 1 /* E1D */; + default: + return 0 /* None */; + } + }; + DataParser._getActionType = function (value) { + switch (value.toLowerCase()) { + case "play": + return 0 /* Play */; + case "frame": + return 10 /* Frame */; + case "sound": + return 11 /* Sound */; + default: + return 0 /* Play */; + } + }; + DataParser.DATA_VERSION_2_3 = "2.3"; + DataParser.DATA_VERSION_3_0 = "3.0"; + DataParser.DATA_VERSION_4_0 = "4.0"; + DataParser.DATA_VERSION_4_5 = "4.5"; + DataParser.DATA_VERSION_5_0 = "5.0"; + DataParser.DATA_VERSION_5_5 = "5.5"; + DataParser.DATA_VERSION_5_6 = "5.6"; + DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_6; + DataParser.DATA_VERSIONS = [ + DataParser.DATA_VERSION_4_0, + DataParser.DATA_VERSION_4_5, + DataParser.DATA_VERSION_5_0, + DataParser.DATA_VERSION_5_5, + DataParser.DATA_VERSION_5_6 + ]; + DataParser.TEXTURE_ATLAS = "textureAtlas"; + DataParser.SUB_TEXTURE = "SubTexture"; + DataParser.FORMAT = "format"; + DataParser.IMAGE_PATH = "imagePath"; + DataParser.WIDTH = "width"; + DataParser.HEIGHT = "height"; + DataParser.ROTATED = "rotated"; + DataParser.FRAME_X = "frameX"; + DataParser.FRAME_Y = "frameY"; + DataParser.FRAME_WIDTH = "frameWidth"; + DataParser.FRAME_HEIGHT = "frameHeight"; + DataParser.DRADON_BONES = "dragonBones"; + DataParser.USER_DATA = "userData"; + DataParser.ARMATURE = "armature"; + DataParser.CANVAS = "canvas"; + DataParser.BONE = "bone"; + DataParser.SURFACE = "surface"; + DataParser.SLOT = "slot"; + DataParser.CONSTRAINT = "constraint"; + DataParser.SKIN = "skin"; + DataParser.DISPLAY = "display"; + DataParser.FRAME = "frame"; + DataParser.IK = "ik"; + DataParser.PATH_CONSTRAINT = "path"; + DataParser.ANIMATION = "animation"; + DataParser.TIMELINE = "timeline"; + DataParser.FFD = "ffd"; + DataParser.TRANSLATE_FRAME = "translateFrame"; + DataParser.ROTATE_FRAME = "rotateFrame"; + DataParser.SCALE_FRAME = "scaleFrame"; + DataParser.DISPLAY_FRAME = "displayFrame"; + DataParser.COLOR_FRAME = "colorFrame"; + DataParser.DEFAULT_ACTIONS = "defaultActions"; + DataParser.ACTIONS = "actions"; + DataParser.EVENTS = "events"; + DataParser.INTS = "ints"; + DataParser.FLOATS = "floats"; + DataParser.STRINGS = "strings"; + DataParser.TRANSFORM = "transform"; + DataParser.PIVOT = "pivot"; + DataParser.AABB = "aabb"; + DataParser.COLOR = "color"; + DataParser.VERSION = "version"; + DataParser.COMPATIBLE_VERSION = "compatibleVersion"; + DataParser.FRAME_RATE = "frameRate"; + DataParser.TYPE = "type"; + DataParser.SUB_TYPE = "subType"; + DataParser.NAME = "name"; + DataParser.PARENT = "parent"; + DataParser.TARGET = "target"; + DataParser.STAGE = "stage"; + DataParser.SHARE = "share"; + DataParser.PATH = "path"; + DataParser.LENGTH = "length"; + DataParser.DISPLAY_INDEX = "displayIndex"; + DataParser.Z_ORDER = "zOrder"; + DataParser.Z_INDEX = "zIndex"; + DataParser.BLEND_MODE = "blendMode"; + DataParser.INHERIT_TRANSLATION = "inheritTranslation"; + DataParser.INHERIT_ROTATION = "inheritRotation"; + DataParser.INHERIT_SCALE = "inheritScale"; + DataParser.INHERIT_REFLECTION = "inheritReflection"; + DataParser.INHERIT_ANIMATION = "inheritAnimation"; + DataParser.INHERIT_DEFORM = "inheritDeform"; + DataParser.SEGMENT_X = "segmentX"; + DataParser.SEGMENT_Y = "segmentY"; + DataParser.BEND_POSITIVE = "bendPositive"; + DataParser.CHAIN = "chain"; + DataParser.WEIGHT = "weight"; + DataParser.BLEND_TYPE = "blendType"; + DataParser.FADE_IN_TIME = "fadeInTime"; + DataParser.PLAY_TIMES = "playTimes"; + DataParser.SCALE = "scale"; + DataParser.OFFSET = "offset"; + DataParser.POSITION = "position"; + DataParser.DURATION = "duration"; + DataParser.TWEEN_EASING = "tweenEasing"; + DataParser.TWEEN_ROTATE = "tweenRotate"; + DataParser.TWEEN_SCALE = "tweenScale"; + DataParser.CLOCK_WISE = "clockwise"; + DataParser.CURVE = "curve"; + DataParser.SOUND = "sound"; + DataParser.EVENT = "event"; + DataParser.ACTION = "action"; + DataParser.X = "x"; + DataParser.Y = "y"; + DataParser.SKEW_X = "skX"; + DataParser.SKEW_Y = "skY"; + DataParser.SCALE_X = "scX"; + DataParser.SCALE_Y = "scY"; + DataParser.VALUE = "value"; + DataParser.ROTATE = "rotate"; + DataParser.SKEW = "skew"; + DataParser.ALPHA = "alpha"; + DataParser.ALPHA_OFFSET = "aO"; + DataParser.RED_OFFSET = "rO"; + DataParser.GREEN_OFFSET = "gO"; + DataParser.BLUE_OFFSET = "bO"; + DataParser.ALPHA_MULTIPLIER = "aM"; + DataParser.RED_MULTIPLIER = "rM"; + DataParser.GREEN_MULTIPLIER = "gM"; + DataParser.BLUE_MULTIPLIER = "bM"; + DataParser.UVS = "uvs"; + DataParser.VERTICES = "vertices"; + DataParser.TRIANGLES = "triangles"; + DataParser.WEIGHTS = "weights"; + DataParser.SLOT_POSE = "slotPose"; + DataParser.BONE_POSE = "bonePose"; + DataParser.BONES = "bones"; + DataParser.POSITION_MODE = "positionMode"; + DataParser.SPACING_MODE = "spacingMode"; + DataParser.ROTATE_MODE = "rotateMode"; + DataParser.SPACING = "spacing"; + DataParser.ROTATE_OFFSET = "rotateOffset"; + DataParser.ROTATE_MIX = "rotateMix"; + DataParser.TRANSLATE_MIX = "translateMix"; + DataParser.TARGET_DISPLAY = "targetDisplay"; + DataParser.CLOSED = "closed"; + DataParser.CONSTANT_SPEED = "constantSpeed"; + DataParser.VERTEX_COUNT = "vertexCount"; + DataParser.LENGTHS = "lengths"; + DataParser.GOTO_AND_PLAY = "gotoAndPlay"; + DataParser.DEFAULT_NAME = "default"; + return DataParser; + }()); + dragonBones.DataParser = DataParser; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ObjectDataParser = /** @class */ (function (_super) { + __extends(ObjectDataParser, _super); + function ObjectDataParser() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._rawTextureAtlasIndex = 0; + _this._rawBones = []; + _this._data = null; // + _this._armature = null; // + _this._bone = null; // + _this._geometry = null; // + _this._slot = null; // + _this._skin = null; // + _this._mesh = null; // + _this._animation = null; // + _this._timeline = null; // + _this._rawTextureAtlases = null; + _this._frameValueType = 0 /* Step */; + _this._defaultColorOffset = -1; + _this._prevClockwise = 0; + _this._prevRotation = 0.0; + _this._frameDefaultValue = 0.0; + _this._frameValueScale = 1.0; + _this._helpMatrixA = new dragonBones.Matrix(); + _this._helpMatrixB = new dragonBones.Matrix(); + _this._helpTransform = new dragonBones.Transform(); + _this._helpColorTransform = new dragonBones.ColorTransform(); + _this._helpPoint = new dragonBones.Point(); + _this._helpArray = []; + _this._intArray = []; + _this._floatArray = []; + _this._frameIntArray = []; + _this._frameFloatArray = []; + _this._frameArray = []; + _this._timelineArray = []; + _this._colorArray = []; + _this._cacheRawMeshes = []; + _this._cacheMeshes = []; + _this._actionFrames = []; + _this._weightSlotPose = {}; + _this._weightBonePoses = {}; + _this._cacheBones = {}; + _this._slotChildActions = {}; + return _this; + } + ObjectDataParser._getBoolean = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + var type = typeof value; + if (type === "boolean") { + return value; + } + else if (type === "string") { + switch (value) { + case "0": + case "NaN": + case "": + case "false": + case "null": + case "undefined": + return false; + default: + return true; + } + } + else { + return !!value; + } + } + return defaultValue; + }; + ObjectDataParser._getNumber = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + if (value === null || value === "NaN") { + return defaultValue; + } + return +value || 0; + } + return defaultValue; + }; + ObjectDataParser._getString = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + var type = typeof value; + if (type === "string") { + return value; + } + return String(value); + } + return defaultValue; + }; + ObjectDataParser.prototype._getCurvePoint = function (x1, y1, x2, y2, x3, y3, x4, y4, t, result) { + var l_t = 1.0 - t; + var powA = l_t * l_t; + var powB = t * t; + var kA = l_t * powA; + var kB = 3.0 * t * powA; + var kC = 3.0 * l_t * powB; + var kD = t * powB; + result.x = kA * x1 + kB * x2 + kC * x3 + kD * x4; + result.y = kA * y1 + kB * y2 + kC * y3 + kD * y4; + }; + ObjectDataParser.prototype._samplingEasingCurve = function (curve, samples) { + var curveCount = curve.length; + if (curveCount % 3 === 1) { + var stepIndex = -2; + for (var i = 0, l = samples.length; i < l; ++i) { + var t = (i + 1) / (l + 1); // float + while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) { // stepIndex + 3 * 2 + stepIndex += 6; + } + var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount; + var x1 = isInCurve ? curve[stepIndex] : 0.0; + var y1 = isInCurve ? curve[stepIndex + 1] : 0.0; + var x2 = curve[stepIndex + 2]; + var y2 = curve[stepIndex + 3]; + var x3 = curve[stepIndex + 4]; + var y3 = curve[stepIndex + 5]; + var x4 = isInCurve ? curve[stepIndex + 6] : 1.0; + var y4 = isInCurve ? curve[stepIndex + 7] : 1.0; + var lower = 0.0; + var higher = 1.0; + while (higher - lower > 0.0001) { + var percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } + } + samples[i] = this._helpPoint.y; + } + return true; + } + else { + var stepIndex = 0; + for (var i = 0, l = samples.length; i < l; ++i) { + var t = (i + 1) / (l + 1); // float + while (curve[stepIndex + 6] < t) { // stepIndex + 3 * 2 + stepIndex += 6; + } + var x1 = curve[stepIndex]; + var y1 = curve[stepIndex + 1]; + var x2 = curve[stepIndex + 2]; + var y2 = curve[stepIndex + 3]; + var x3 = curve[stepIndex + 4]; + var y3 = curve[stepIndex + 5]; + var x4 = curve[stepIndex + 6]; + var y4 = curve[stepIndex + 7]; + var lower = 0.0; + var higher = 1.0; + while (higher - lower > 0.0001) { + var percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } + } + samples[i] = this._helpPoint.y; + } + return false; + } + }; + ObjectDataParser.prototype._parseActionDataInFrame = function (rawData, frameStart, bone, slot) { + if (dragonBones.DataParser.EVENT in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.EVENT], frameStart, 10 /* Frame */, bone, slot); + } + if (dragonBones.DataParser.SOUND in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.SOUND], frameStart, 11 /* Sound */, bone, slot); + } + if (dragonBones.DataParser.ACTION in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.ACTION], frameStart, 0 /* Play */, bone, slot); + } + if (dragonBones.DataParser.EVENTS in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.EVENTS], frameStart, 10 /* Frame */, bone, slot); + } + if (dragonBones.DataParser.ACTIONS in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.ACTIONS], frameStart, 0 /* Play */, bone, slot); + } + }; + ObjectDataParser.prototype._mergeActionFrame = function (rawData, frameStart, type, bone, slot) { + var actionOffset = this._armature.actions.length; + var actions = this._parseActionData(rawData, type, bone, slot); + var frameIndex = 0; + var frame = null; + for (var _i = 0, actions_2 = actions; _i < actions_2.length; _i++) { + var action = actions_2[_i]; + this._armature.addAction(action, false); + } + if (this._actionFrames.length === 0) { // First frame. + frame = new ActionFrame(); + frame.frameStart = 0; + this._actionFrames.push(frame); + frame = null; + } + for (var _a = 0, _b = this._actionFrames; _a < _b.length; _a++) { // Get same frame. + var eachFrame = _b[_a]; + if (eachFrame.frameStart === frameStart) { + frame = eachFrame; + break; + } + else if (eachFrame.frameStart > frameStart) { + break; + } + frameIndex++; + } + if (frame === null) { // Create and cache frame. + frame = new ActionFrame(); + frame.frameStart = frameStart; + this._actionFrames.splice(frameIndex, 0, frame); + } + for (var i = 0; i < actions.length; ++i) { // Cache action offsets. + frame.actions.push(actionOffset + i); + } + }; + ObjectDataParser.prototype._parseArmature = function (rawData, scale) { + var armature = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureData); + armature.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + armature.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, this._data.frameRate); + armature.scale = scale; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + armature.type = dragonBones.DataParser._getArmatureType(rawData[dragonBones.DataParser.TYPE]); + } + else { + armature.type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Armature */); + } + if (armature.frameRate === 0) { // Data error. + armature.frameRate = 24; + } + this._armature = armature; + if (dragonBones.DataParser.CANVAS in rawData) { + var rawCanvas = rawData[dragonBones.DataParser.CANVAS]; + var canvas = dragonBones.BaseObject.borrowObject(dragonBones.CanvasData); + if (dragonBones.DataParser.COLOR in rawCanvas) { + canvas.hasBackground = true; + } + else { + canvas.hasBackground = false; + } + canvas.color = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.COLOR, 0); + canvas.x = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.X, 0) * armature.scale; + canvas.y = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.Y, 0) * armature.scale; + canvas.width = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.WIDTH, 0) * armature.scale; + canvas.height = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.HEIGHT, 0) * armature.scale; + armature.canvas = canvas; + } + if (dragonBones.DataParser.AABB in rawData) { + var rawAABB = rawData[dragonBones.DataParser.AABB]; + armature.aabb.x = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.X, 0.0) * armature.scale; + armature.aabb.y = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.Y, 0.0) * armature.scale; + armature.aabb.width = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.WIDTH, 0.0) * armature.scale; + armature.aabb.height = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.HEIGHT, 0.0) * armature.scale; + } + if (dragonBones.DataParser.BONE in rawData) { + var rawBones = rawData[dragonBones.DataParser.BONE]; + for (var _i = 0, rawBones_1 = rawBones; _i < rawBones_1.length; _i++) { + var rawBone = rawBones_1[_i]; + var parentName = ObjectDataParser._getString(rawBone, dragonBones.DataParser.PARENT, ""); + var bone = this._parseBone(rawBone); + if (parentName.length > 0) { // Get bone parent. + var parent_1 = armature.getBone(parentName); + if (parent_1 !== null) { + bone.parent = parent_1; + } + else { // Cache. + if (!(parentName in this._cacheBones)) { + this._cacheBones[parentName] = []; + } + this._cacheBones[parentName].push(bone); + } + } + if (bone.name in this._cacheBones) { + for (var _a = 0, _b = this._cacheBones[bone.name]; _a < _b.length; _a++) { + var child = _b[_a]; + child.parent = bone; + } + delete this._cacheBones[bone.name]; + } + armature.addBone(bone); + this._rawBones.push(bone); // Cache raw bones sort. + } + } + if (dragonBones.DataParser.IK in rawData) { + var rawIKS = rawData[dragonBones.DataParser.IK]; + for (var _c = 0, rawIKS_1 = rawIKS; _c < rawIKS_1.length; _c++) { + var rawIK = rawIKS_1[_c]; + var constraint = this._parseIKConstraint(rawIK); + if (constraint) { + armature.addConstraint(constraint); + } + } + } + armature.sortBones(); + if (dragonBones.DataParser.SLOT in rawData) { + var zOrder = 0; + var rawSlots = rawData[dragonBones.DataParser.SLOT]; + for (var _d = 0, rawSlots_1 = rawSlots; _d < rawSlots_1.length; _d++) { + var rawSlot = rawSlots_1[_d]; + armature.addSlot(this._parseSlot(rawSlot, zOrder++)); + } + } + if (dragonBones.DataParser.SKIN in rawData) { + var rawSkins = rawData[dragonBones.DataParser.SKIN]; + for (var _e = 0, rawSkins_1 = rawSkins; _e < rawSkins_1.length; _e++) { + var rawSkin = rawSkins_1[_e]; + armature.addSkin(this._parseSkin(rawSkin)); + } + } + if (dragonBones.DataParser.PATH_CONSTRAINT in rawData) { + var rawPaths = rawData[dragonBones.DataParser.PATH_CONSTRAINT]; + for (var _f = 0, rawPaths_1 = rawPaths; _f < rawPaths_1.length; _f++) { + var rawPath = rawPaths_1[_f]; + var constraint = this._parsePathConstraint(rawPath); + if (constraint) { + armature.addConstraint(constraint); + } + } + } + for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) { // Link mesh. + var rawData_1 = this._cacheRawMeshes[i]; + var shareName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SHARE, ""); + if (shareName.length === 0) { + continue; + } + var skinName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME); + if (skinName.length === 0) { // + skinName = dragonBones.DataParser.DEFAULT_NAME; + } + var shareMesh = armature.getMesh(skinName, "", shareName); // TODO slot; + if (shareMesh === null) { + continue; // Error. + } + var mesh = this._cacheMeshes[i]; + mesh.geometry.shareFrom(shareMesh.geometry); + } + if (dragonBones.DataParser.ANIMATION in rawData) { + var rawAnimations = rawData[dragonBones.DataParser.ANIMATION]; + for (var _g = 0, rawAnimations_1 = rawAnimations; _g < rawAnimations_1.length; _g++) { + var rawAnimation = rawAnimations_1[_g]; + var animation = this._parseAnimation(rawAnimation); + armature.addAnimation(animation); + } + } + if (dragonBones.DataParser.DEFAULT_ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.DEFAULT_ACTIONS], 0 /* Play */, null, null); + for (var _h = 0, actions_3 = actions; _h < actions_3.length; _h++) { + var action = actions_3[_h]; + armature.addAction(action, true); + if (action.type === 0 /* Play */) { // Set default animation from default action. + var animation = armature.getAnimation(action.name); + if (animation !== null) { + armature.defaultAnimation = animation; + } + } + } + } + if (dragonBones.DataParser.ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + for (var _j = 0, actions_4 = actions; _j < actions_4.length; _j++) { + var action = actions_4[_j]; + armature.addAction(action, false); + } + } + // Clear helper. + this._rawBones.length = 0; + this._cacheRawMeshes.length = 0; + this._cacheMeshes.length = 0; + this._armature = null; + for (var k in this._weightSlotPose) { + delete this._weightSlotPose[k]; + } + for (var k in this._weightBonePoses) { + delete this._weightBonePoses[k]; + } + for (var k in this._cacheBones) { + delete this._cacheBones[k]; + } + for (var k in this._slotChildActions) { + delete this._slotChildActions[k]; + } + return armature; + }; + ObjectDataParser.prototype._parseBone = function (rawData) { + var type = 0 /* Bone */; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + type = dragonBones.DataParser._getBoneType(rawData[dragonBones.DataParser.TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Bone */); + } + if (type === 0 /* Bone */) { + var scale = this._armature.scale; + var bone = dragonBones.BaseObject.borrowObject(dragonBones.BoneData); + bone.inheritTranslation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_TRANSLATION, true); + bone.inheritRotation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_ROTATION, true); + bone.inheritScale = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_SCALE, true); + bone.inheritReflection = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_REFLECTION, true); + bone.length = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.LENGTH, 0) * scale; + bone.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + bone.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + if (dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], bone.transform, scale); + } + return bone; + } + var surface = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceData); + surface.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + surface.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + surface.segmentX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_X, 0); + surface.segmentY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_Y, 0); + this._parseGeometry(rawData, surface.geometry); + return surface; + }; + ObjectDataParser.prototype._parseIKConstraint = function (rawData) { + var bone = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.BONE, "")); + if (bone === null) { + return null; + } + var target = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET, "")); + if (target === null) { + return null; + } + var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0); + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintData); + constraint.scaleEnabled = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.SCALE, false); + constraint.bendPositive = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true); + constraint.weight = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0); + constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + constraint.type = 0 /* IK */; + constraint.target = target; + if (chain > 0 && bone.parent !== null) { + constraint.root = bone.parent; + constraint.bone = bone; + } + else { + constraint.root = bone; + constraint.bone = null; + } + return constraint; + }; + ObjectDataParser.prototype._parsePathConstraint = function (rawData) { + var target = this._armature.getSlot(ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET, "")); + if (target === null) { + return null; + } + var defaultSkin = this._armature.defaultSkin; + if (defaultSkin === null) { + return null; + } + //TODO + var targetDisplay = defaultSkin.getDisplay(target.name, ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET_DISPLAY, target.name)); + if (targetDisplay === null || !(targetDisplay instanceof dragonBones.PathDisplayData)) { + return null; + } + var bones = rawData[dragonBones.DataParser.BONES]; + if (bones === null || bones.length === 0) { + return null; + } + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.PathConstraintData); + constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + constraint.type = 1 /* Path */; + constraint.pathSlot = target; + constraint.pathDisplayData = targetDisplay; + constraint.target = target.parent; + constraint.positionMode = dragonBones.DataParser._getPositionMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.POSITION_MODE, "")); + constraint.spacingMode = dragonBones.DataParser._getSpacingMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.SPACING_MODE, "")); + constraint.rotateMode = dragonBones.DataParser._getRotateMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.ROTATE_MODE, "")); + constraint.position = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.POSITION, 0); + constraint.spacing = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SPACING, 0); + constraint.rotateOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE_OFFSET, 0); + constraint.rotateMix = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE_MIX, 1); + constraint.translateMix = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TRANSLATE_MIX, 1); + // + for (var _i = 0, bones_3 = bones; _i < bones_3.length; _i++) { + var boneName = bones_3[_i]; + var bone = this._armature.getBone(boneName); + if (bone !== null) { + constraint.AddBone(bone); + if (constraint.root === null) { + constraint.root = bone; + } + } + } + return constraint; + }; + ObjectDataParser.prototype._parseSlot = function (rawData, zOrder) { + var slot = dragonBones.BaseObject.borrowObject(dragonBones.SlotData); + slot.displayIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0); + slot.zOrder = zOrder; + slot.zIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Z_INDEX, 0); + slot.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + slot.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + slot.parent = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.PARENT, "")); // + if (dragonBones.DataParser.BLEND_MODE in rawData && typeof rawData[dragonBones.DataParser.BLEND_MODE] === "string") { + slot.blendMode = dragonBones.DataParser._getBlendMode(rawData[dragonBones.DataParser.BLEND_MODE]); + } + else { + slot.blendMode = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLEND_MODE, 0 /* Normal */); + } + if (dragonBones.DataParser.COLOR in rawData) { + slot.color = dragonBones.SlotData.createColor(); + this._parseColorTransform(rawData[dragonBones.DataParser.COLOR], slot.color); + } + else { + slot.color = dragonBones.SlotData.DEFAULT_COLOR; + } + if (dragonBones.DataParser.ACTIONS in rawData) { + this._slotChildActions[slot.name] = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + } + return slot; + }; + ObjectDataParser.prototype._parseSkin = function (rawData) { + var skin = dragonBones.BaseObject.borrowObject(dragonBones.SkinData); + skin.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (skin.name.length === 0) { + skin.name = dragonBones.DataParser.DEFAULT_NAME; + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawSlots = rawData[dragonBones.DataParser.SLOT]; + this._skin = skin; + for (var _i = 0, rawSlots_2 = rawSlots; _i < rawSlots_2.length; _i++) { + var rawSlot = rawSlots_2[_i]; + var slotName = ObjectDataParser._getString(rawSlot, dragonBones.DataParser.NAME, ""); + var slot = this._armature.getSlot(slotName); + if (slot !== null) { + this._slot = slot; + if (dragonBones.DataParser.DISPLAY in rawSlot) { + var rawDisplays = rawSlot[dragonBones.DataParser.DISPLAY]; + for (var _a = 0, rawDisplays_1 = rawDisplays; _a < rawDisplays_1.length; _a++) { + var rawDisplay = rawDisplays_1[_a]; + if (rawDisplay) { + skin.addDisplay(slotName, this._parseDisplay(rawDisplay)); + } + else { + skin.addDisplay(slotName, null); + } + } + } + this._slot = null; // + } + } + this._skin = null; // + } + return skin; + }; + ObjectDataParser.prototype._parseDisplay = function (rawData) { + var name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + var path = ObjectDataParser._getString(rawData, dragonBones.DataParser.PATH, ""); + var type = 0 /* Image */; + var display = null; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + type = dragonBones.DataParser._getDisplayType(rawData[dragonBones.DataParser.TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, type); + } + switch (type) { + case 0 /* Image */: { + var imageDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ImageDisplayData); + imageDisplay.name = name; + imageDisplay.path = path.length > 0 ? path : name; + this._parsePivot(rawData, imageDisplay); + break; + } + case 1 /* Armature */: { + var armatureDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureDisplayData); + armatureDisplay.name = name; + armatureDisplay.path = path.length > 0 ? path : name; + armatureDisplay.inheritAnimation = true; + if (dragonBones.DataParser.ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + for (var _i = 0, actions_5 = actions; _i < actions_5.length; _i++) { + var action = actions_5[_i]; + armatureDisplay.addAction(action); + } + } + else if (this._slot.name in this._slotChildActions) { + var displays = this._skin.getDisplays(this._slot.name); + if (displays === null ? this._slot.displayIndex === 0 : this._slot.displayIndex === displays.length) { + for (var _a = 0, _b = this._slotChildActions[this._slot.name]; _a < _b.length; _a++) { + var action = _b[_a]; + armatureDisplay.addAction(action); + } + delete this._slotChildActions[this._slot.name]; + } + } + break; + } + case 2 /* Mesh */: { + var meshDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.MeshDisplayData); + meshDisplay.geometry.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true); + meshDisplay.name = name; + meshDisplay.path = path.length > 0 ? path : name; + if (dragonBones.DataParser.SHARE in rawData) { + meshDisplay.geometry.data = this._data; + this._cacheRawMeshes.push(rawData); + this._cacheMeshes.push(meshDisplay); + } + else { + this._parseMesh(rawData, meshDisplay); + } + break; + } + case 3 /* BoundingBox */: { + var boundingBox = this._parseBoundingBox(rawData); + if (boundingBox !== null) { + var boundingBoxDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.BoundingBoxDisplayData); + boundingBoxDisplay.name = name; + boundingBoxDisplay.path = path.length > 0 ? path : name; + boundingBoxDisplay.boundingBox = boundingBox; + } + break; + } + case 4 /* Path */: { + var rawCurveLengths = rawData[dragonBones.DataParser.LENGTHS]; + var pathDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.PathDisplayData); + pathDisplay.closed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CLOSED, false); + pathDisplay.constantSpeed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CONSTANT_SPEED, false); + pathDisplay.name = name; + pathDisplay.path = path.length > 0 ? path : name; + pathDisplay.curveLengths.length = rawCurveLengths.length; + for (var i = 0, l = rawCurveLengths.length; i < l; ++i) { + pathDisplay.curveLengths[i] = rawCurveLengths[i]; + } + this._parsePath(rawData, pathDisplay); + break; + } + } + if (display !== null && dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], display.transform, this._armature.scale); + } + return display; + }; + ObjectDataParser.prototype._parsePath = function (rawData, display) { + this._parseGeometry(rawData, display.geometry); + }; + ObjectDataParser.prototype._parsePivot = function (rawData, display) { + if (dragonBones.DataParser.PIVOT in rawData) { + var rawPivot = rawData[dragonBones.DataParser.PIVOT]; + display.pivot.x = ObjectDataParser._getNumber(rawPivot, dragonBones.DataParser.X, 0.0); + display.pivot.y = ObjectDataParser._getNumber(rawPivot, dragonBones.DataParser.Y, 0.0); + } + else { + display.pivot.x = 0.5; + display.pivot.y = 0.5; + } + }; + ObjectDataParser.prototype._parseMesh = function (rawData, mesh) { + this._parseGeometry(rawData, mesh.geometry); + if (dragonBones.DataParser.WEIGHTS in rawData) { // Cache pose data. + var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE]; + var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE]; + var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; + this._weightSlotPose[meshName] = rawSlotPose; + this._weightBonePoses[meshName] = rawBonePoses; + } + }; + ObjectDataParser.prototype._parseBoundingBox = function (rawData) { + var boundingBox = null; + var type = 0 /* Rectangle */; + if (dragonBones.DataParser.SUB_TYPE in rawData && typeof rawData[dragonBones.DataParser.SUB_TYPE] === "string") { + type = dragonBones.DataParser._getBoundingBoxType(rawData[dragonBones.DataParser.SUB_TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SUB_TYPE, type); + } + switch (type) { + case 0 /* Rectangle */: + boundingBox = dragonBones.BaseObject.borrowObject(dragonBones.RectangleBoundingBoxData); + break; + case 1 /* Ellipse */: + boundingBox = dragonBones.BaseObject.borrowObject(dragonBones.EllipseBoundingBoxData); + break; + case 2 /* Polygon */: + boundingBox = this._parsePolygonBoundingBox(rawData); + break; + } + if (boundingBox !== null) { + boundingBox.color = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.COLOR, 0x000000); + if (boundingBox.type === 0 /* Rectangle */ || boundingBox.type === 1 /* Ellipse */) { + boundingBox.width = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WIDTH, 0.0); + boundingBox.height = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.HEIGHT, 0.0); + } + } + return boundingBox; + }; + ObjectDataParser.prototype._parsePolygonBoundingBox = function (rawData) { + var polygonBoundingBox = dragonBones.BaseObject.borrowObject(dragonBones.PolygonBoundingBoxData); + if (dragonBones.DataParser.VERTICES in rawData) { + var scale = this._armature.scale; + var rawVertices = rawData[dragonBones.DataParser.VERTICES]; + var vertices = polygonBoundingBox.vertices; + vertices.length = rawVertices.length; + for (var i = 0, l = rawVertices.length; i < l; i += 2) { + var x = rawVertices[i] * scale; + var y = rawVertices[i + 1] * scale; + vertices[i] = x; + vertices[i + 1] = y; + // AABB. + if (i === 0) { + polygonBoundingBox.x = x; + polygonBoundingBox.y = y; + polygonBoundingBox.width = x; + polygonBoundingBox.height = y; + } + else { + if (x < polygonBoundingBox.x) { + polygonBoundingBox.x = x; + } + else if (x > polygonBoundingBox.width) { + polygonBoundingBox.width = x; + } + if (y < polygonBoundingBox.y) { + polygonBoundingBox.y = y; + } + else if (y > polygonBoundingBox.height) { + polygonBoundingBox.height = y; + } + } + } + polygonBoundingBox.width -= polygonBoundingBox.x; + polygonBoundingBox.height -= polygonBoundingBox.y; + } + else { + console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug."); + } + return polygonBoundingBox; + }; + ObjectDataParser.prototype._parseAnimation = function (rawData) { + var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData); + animation.blendType = dragonBones.DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, "")); + animation.frameCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0); + animation.playTimes = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1); + animation.duration = animation.frameCount / this._armature.frameRate; // float + animation.fadeInTime = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0); + animation.scale = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0); + animation.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (animation.name.length === 0) { + animation.name = dragonBones.DataParser.DEFAULT_NAME; + } + animation.frameIntOffset = this._frameIntArray.length; + animation.frameFloatOffset = this._frameFloatArray.length; + animation.frameOffset = this._frameArray.length; + this._animation = animation; + if (dragonBones.DataParser.FRAME in rawData) { + var rawFrames = rawData[dragonBones.DataParser.FRAME]; + var keyFrameCount = rawFrames.length; + if (keyFrameCount > 0) { + for (var i = 0, frameStart = 0; i < keyFrameCount; ++i) { + var rawFrame = rawFrames[i]; + this._parseActionDataInFrame(rawFrame, frameStart, null, null); + frameStart += ObjectDataParser._getNumber(rawFrame, dragonBones.DataParser.DURATION, 1); + } + } + } + if (dragonBones.DataParser.Z_ORDER in rawData) { + this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, 0 /* Step */, 0, this._parseZOrderFrame); + } + if (dragonBones.DataParser.BONE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.BONE]; + for (var _i = 0, rawTimelines_1 = rawTimelines; _i < rawTimelines_1.length; _i++) { + var rawTimeline = rawTimelines_1[_i]; + this._parseBoneTimeline(rawTimeline); + } + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.SLOT]; + for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) { + var rawTimeline = rawTimelines_2[_a]; + this._parseSlotTimeline(rawTimeline); + } + } + if (dragonBones.DataParser.FFD in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.FFD]; + for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) { + var rawTimeline = rawTimelines_3[_b]; + var skinName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME); + var slotName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SLOT, ""); + var displayName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + if (skinName.length === 0) { // + skinName = dragonBones.DataParser.DEFAULT_NAME; + } + this._slot = this._armature.getSlot(slotName); + this._mesh = this._armature.getMesh(skinName, slotName, displayName); + if (this._slot === null || this._mesh === null) { + continue; + } + var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, 2 /* Float */, 0, this._parseSlotDeformFrame); + if (timeline !== null) { + this._animation.addSlotTimeline(slotName, timeline); + } + this._slot = null; // + this._mesh = null; // + } + } + if (dragonBones.DataParser.IK in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.IK]; + for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) { + var rawTimeline = rawTimelines_4[_c]; + var constraintName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var constraint = this._armature.getConstraint(constraintName); + if (constraint === null) { + continue; + } + var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, 1 /* Int */, 2, this._parseIKConstraintFrame); + if (timeline !== null) { + this._animation.addConstraintTimeline(constraintName, timeline); + } + } + } + if (this._actionFrames.length > 0) { + this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, 0 /* Step */, 0, this._parseActionFrame); + this._actionFrames.length = 0; + } + if (dragonBones.DataParser.TIMELINE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.TIMELINE]; + for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) { + var rawTimeline = rawTimelines_5[_d]; + var timelineType = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */); + var timelineName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var timeline = null; + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 20 /* SlotDisplay */: // TODO + case 23 /* SlotZIndex */: + case 60 /* BoneAlpha */: + case 24 /* SlotAlpha */: + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + if (timelineType === 20 /* SlotDisplay */) { + this._frameValueType = 0 /* Step */; + this._frameValueScale = 1.0; + } + else { + this._frameValueType = 1 /* Int */; + if (timelineType === 23 /* SlotZIndex */) { + this._frameValueScale = 1.0; + } + else if (timelineType === 40 /* AnimationProgress */ || + timelineType === 41 /* AnimationWeight */) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + if (timelineType === 60 /* BoneAlpha */ || + timelineType === 24 /* SlotAlpha */ || + timelineType === 41 /* AnimationWeight */) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData); + var animaitonTimeline = timeline; + animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0); + animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0); + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 1, this._parseSingleValueFrame, timeline); + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 30 /* IKConstraint */: + case 42 /* AnimationParameter */: + if (timelineType === 30 /* IKConstraint */ || + timelineType === 42 /* AnimationParameter */) { + this._frameValueType = 1 /* Int */; + if (timelineType === 42 /* AnimationParameter */) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + else { + if (timelineType === 12 /* BoneRotate */) { + this._frameValueScale = dragonBones.Transform.DEG_RAD; + } + else { + this._frameValueScale = 1.0; + } + this._frameValueType = 2 /* Float */; + } + if (timelineType === 13 /* BoneScale */ || + timelineType === 30 /* IKConstraint */) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 2, this._parseDoubleValueFrame); + break; + case 1 /* ZOrder */: + // TODO + break; + case 50 /* Surface */: { + var surface = this._armature.getBone(timelineName); + if (surface === null) { + continue; + } + this._geometry = surface.geometry; + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame); + this._geometry = null; // + break; + } + case 22 /* SlotDeform */: { + this._geometry = null; // + for (var skinName in this._armature.skins) { + var skin = this._armature.skins[skinName]; + for (var slontName in skin.displays) { + var displays = skin.displays[slontName]; + for (var _e = 0, displays_1 = displays; _e < displays_1.length; _e++) { + var display = displays_1[_e]; + if (display !== null && display.name === timelineName) { + this._geometry = display.geometry; + break; + } + } + } + } + if (this._geometry === null) { + continue; + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame); + this._geometry = null; // + break; + } + case 21 /* SlotColor */: + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 1 /* Int */, 1, this._parseSlotColorFrame); + break; + } + if (timeline !== null) { + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 1 /* ZOrder */: + // TODO + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 50 /* Surface */: + case 60 /* BoneAlpha */: + this._animation.addBoneTimeline(timelineName, timeline); + break; + case 20 /* SlotDisplay */: + case 21 /* SlotColor */: + case 22 /* SlotDeform */: + case 23 /* SlotZIndex */: + case 24 /* SlotAlpha */: + this._animation.addSlotTimeline(timelineName, timeline); + break; + case 30 /* IKConstraint */: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + case 42 /* AnimationParameter */: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null; // + return animation; + }; + ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, timelineType, frameValueType, frameValueCount, frameParser, timeline) { + if (timeline === void 0) { timeline = null; } + if (rawData !== null && framesKey.length > 0 && framesKey in rawData) { + rawFrames = rawData[framesKey]; + } + if (rawFrames === null) { + return null; + } + var keyFrameCount = rawFrames.length; + if (keyFrameCount === 0) { + return null; + } + var frameIntArrayLength = this._frameIntArray.length; + var frameFloatArrayLength = this._frameFloatArray.length; + var timelineOffset = this._timelineArray.length; + if (timeline === null) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData); + } + timeline.type = timelineType; + timeline.offset = timelineOffset; + this._frameValueType = frameValueType; + this._timeline = timeline; + this._timelineArray.length += 1 + 1 + 1 + 1 + 1 + keyFrameCount; + if (rawData !== null) { + this._timelineArray[timelineOffset + 0 /* TimelineScale */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0) * 100); + this._timelineArray[timelineOffset + 1 /* TimelineOffset */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0.0) * 100); + } + else { + this._timelineArray[timelineOffset + 0 /* TimelineScale */] = 100; + this._timelineArray[timelineOffset + 1 /* TimelineOffset */] = 0; + } + this._timelineArray[timelineOffset + 2 /* TimelineKeyFrameCount */] = keyFrameCount; + this._timelineArray[timelineOffset + 3 /* TimelineFrameValueCount */] = frameValueCount; + switch (this._frameValueType) { + case 0 /* Step */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0; + break; + case 1 /* Int */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset; + break; + case 2 /* Float */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset; + break; + } + if (keyFrameCount === 1) { // Only one frame. + timeline.frameIndicesOffset = -1; + this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + 0] = frameParser.call(this, rawFrames[0], 0, 0) - this._animation.frameOffset; + } + else { + var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. + var frameIndices = this._data.frameIndices; + var frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; + timeline.frameIndicesOffset = frameIndicesOffset; + for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) { + if (frameStart + frameCount <= i && iK < keyFrameCount) { + var rawFrame = rawFrames[iK]; + frameStart = i; // frame.frameStart; + if (iK === keyFrameCount - 1) { + frameCount = this._animation.frameCount - frameStart; + } + else { + if (rawFrame instanceof ActionFrame) { + frameCount = this._actionFrames[iK + 1].frameStart - frameStart; + } + else { + frameCount = ObjectDataParser._getNumber(rawFrame, dragonBones.DataParser.DURATION, 1); + } + } + this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + iK] = frameParser.call(this, rawFrame, frameStart, frameCount) - this._animation.frameOffset; + iK++; + } + frameIndices[frameIndicesOffset + i] = iK - 1; + } + } + this._timeline = null; // + return timeline; + }; + ObjectDataParser.prototype._parseBoneTimeline = function (rawData) { + var bone = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "")); + if (bone === null) { + return; + } + this._bone = bone; + this._slot = this._armature.getSlot(this._bone.name); + if (dragonBones.DataParser.TRANSLATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, 2 /* Float */, 2, this._parseDoubleValueFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.ROTATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, 2 /* Float */, 2, this._parseBoneRotateFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.SCALE_FRAME in rawData) { + this._frameDefaultValue = 1.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, 2 /* Float */, 2, this._parseBoneScaleFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.FRAME in rawData) { + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, 2 /* Float */, 6, this._parseBoneAllFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + this._bone = null; // + this._slot = null; // + }; + ObjectDataParser.prototype._parseSlotTimeline = function (rawData) { + var slot = this._armature.getSlot(ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "")); + if (slot === null) { + return; + } + var displayTimeline = null; + var colorTimeline = null; + this._slot = slot; + if (dragonBones.DataParser.DISPLAY_FRAME in rawData) { + displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame); + } + else { + displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame); + } + if (dragonBones.DataParser.COLOR_FRAME in rawData) { + colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame); + } + else { + colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame); + } + if (displayTimeline !== null) { + this._animation.addSlotTimeline(slot.name, displayTimeline); + } + if (colorTimeline !== null) { + this._animation.addSlotTimeline(slot.name, colorTimeline); + } + this._slot = null; // + }; + ObjectDataParser.prototype._parseFrame = function (rawData, frameStart, frameCount) { + // tslint:disable-next-line:no-unused-expression + rawData; + // tslint:disable-next-line:no-unused-expression + frameCount; + var frameOffset = this._frameArray.length; + this._frameArray.length += 1; + this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart; + return frameOffset; + }; + ObjectDataParser.prototype._parseTweenFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + if (frameCount > 0) { + if (dragonBones.DataParser.CURVE in rawData) { + var sampleCount = frameCount + 1; + this._helpArray.length = sampleCount; + var isOmited = this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray); + this._frameArray.length += 1 + 1 + this._helpArray.length; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 2 /* Curve */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = isOmited ? sampleCount : -sampleCount; + for (var i = 0; i < sampleCount; ++i) { + this._frameArray[frameOffset + 3 /* FrameCurveSamples */ + i] = Math.round(this._helpArray[i] * 10000.0); + } + } + else { + var noTween = -2.0; + var tweenEasing = noTween; + if (dragonBones.DataParser.TWEEN_EASING in rawData) { + tweenEasing = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TWEEN_EASING, noTween); + } + if (tweenEasing === noTween) { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 0 /* None */; + } + else if (tweenEasing === 0.0) { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 1 /* Line */; + } + else if (tweenEasing < 0.0) { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 3 /* QuadIn */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(-tweenEasing * 100.0); + } + else if (tweenEasing <= 1.0) { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 4 /* QuadOut */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(tweenEasing * 100.0); + } + else { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 5 /* QuadInOut */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(tweenEasing * 100.0 - 100.0); + } + } + } + else { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 0 /* None */; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseSingleValueFrame = function (rawData, frameStart, frameCount) { + var frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue); + break; + } + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale); + break; + } + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 1; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + return frameOffset; + }; + ObjectDataParser.prototype._parseDoubleValueFrame = function (rawData, frameStart, frameCount) { + var frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 2; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue); + this._frameArray[frameOffset + 2] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue); + break; + } + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale); + this._frameIntArray[frameValueOffset + 1] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale); + break; + } + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale; + this._frameFloatArray[frameValueOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + return frameOffset; + }; + ObjectDataParser.prototype._parseActionFrame = function (frame, frameStart, frameCount) { + // tslint:disable-next-line:no-unused-expression + frameCount; + var frameOffset = this._frameArray.length; + var actionCount = frame.actions.length; + this._frameArray.length += 1 + 1 + actionCount; + this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart; + this._frameArray[frameOffset + 0 /* FramePosition */ + 1] = actionCount; // Action count. + for (var i = 0; i < actionCount; ++i) { // Action offsets. + this._frameArray[frameOffset + 0 /* FramePosition */ + 2 + i] = frame.actions[i]; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseZOrderFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + if (dragonBones.DataParser.Z_ORDER in rawData) { + var rawZOrder = rawData[dragonBones.DataParser.Z_ORDER]; + if (rawZOrder.length > 0) { + var slotCount = this._armature.sortedSlots.length; + var unchanged = new Array(slotCount - rawZOrder.length / 2); + var zOrders = new Array(slotCount); + for (var i_1 = 0; i_1 < unchanged.length; ++i_1) { + unchanged[i_1] = 0; + } + for (var i_2 = 0; i_2 < slotCount; ++i_2) { + zOrders[i_2] = -1; + } + var originalIndex = 0; + var unchangedIndex = 0; + for (var i_3 = 0, l = rawZOrder.length; i_3 < l; i_3 += 2) { + var slotIndex = rawZOrder[i_3]; + var zOrderOffset = rawZOrder[i_3 + 1]; + while (originalIndex !== slotIndex) { + unchanged[unchangedIndex++] = originalIndex++; + } + var index = originalIndex + zOrderOffset; + zOrders[index] = originalIndex++; + } + while (originalIndex < slotCount) { + unchanged[unchangedIndex++] = originalIndex++; + } + this._frameArray.length += 1 + slotCount; + this._frameArray[frameOffset + 1] = slotCount; + var i = slotCount; + while (i--) { + if (zOrders[i] === -1) { + this._frameArray[frameOffset + 2 + i] = unchanged[--unchangedIndex] || 0; + } + else { + this._frameArray[frameOffset + 2 + i] = zOrders[i] || 0; + } + } + return frameOffset; + } + } + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = 0; + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneAllFrame = function (rawData, frameStart, frameCount) { + this._helpTransform.identity(); + if (dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], this._helpTransform, 1.0); + } + // Modify rotation. + var rotation = this._helpTransform.rotation; + if (frameStart !== 0) { + if (this._prevClockwise === 0) { + rotation = this._prevRotation + dragonBones.Transform.normalizeRadian(rotation - this._prevRotation); + } + else { + if (this._prevClockwise > 0 ? rotation >= this._prevRotation : rotation <= this._prevRotation) { + this._prevClockwise = this._prevClockwise > 0 ? this._prevClockwise - 1 : this._prevClockwise + 1; + } + rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise; + } + } + this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TWEEN_ROTATE, 0.0); + this._prevRotation = rotation; + // + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 6; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.x; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.y; + this._frameFloatArray[frameFloatOffset++] = rotation; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.skew; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleX; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleY; + this._parseActionDataInFrame(rawData, frameStart, this._bone, this._slot); + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneTranslateFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0); + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneRotateFrame = function (rawData, frameStart, frameCount) { + // Modify rotation. + var rotation = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE, 0.0) * dragonBones.Transform.DEG_RAD; + if (frameStart !== 0) { + if (this._prevClockwise === 0) { + rotation = this._prevRotation + dragonBones.Transform.normalizeRadian(rotation - this._prevRotation); + } + else { + if (this._prevClockwise > 0 ? rotation >= this._prevRotation : rotation <= this._prevRotation) { + this._prevClockwise = this._prevClockwise > 0 ? this._prevClockwise - 1 : this._prevClockwise + 1; + } + rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise; + } + } + this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CLOCK_WISE, 0); + this._prevRotation = rotation; + // + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = rotation; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD; + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneScaleFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 1.0); + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotDisplayFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + if (dragonBones.DataParser.VALUE in rawData) { + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, 0); + } + else { + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0); + } + this._parseActionDataInFrame(rawData, frameStart, this._slot.parent, this._slot); + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotColorFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var colorOffset = -1; + if (dragonBones.DataParser.VALUE in rawData || dragonBones.DataParser.COLOR in rawData) { + var rawColor = dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : rawData[dragonBones.DataParser.COLOR]; + for (var k in rawColor) { // Detects the presence of color. + // tslint:disable-next-line:no-unused-expression + k; + this._parseColorTransform(rawColor, this._helpColorTransform); + colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset); + colorOffset -= 8; + break; + } + } + if (colorOffset < 0) { + if (this._defaultColorOffset < 0) { + this._defaultColorOffset = colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + } + colorOffset = this._defaultColorOffset; + } + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameIntOffset] = colorOffset; + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotDeformFrame = function (rawData, frameStart, frameCount) { + var frameFloatOffset = this._frameFloatArray.length; + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var rawVertices = dragonBones.DataParser.VERTICES in rawData ? rawData[dragonBones.DataParser.VERTICES] : null; + var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint + var vertexCount = this._intArray[this._mesh.geometry.offset + 0 /* GeometryVertexCount */]; + var meshName = this._mesh.parent.name + "_" + this._slot.name + "_" + this._mesh.name; + var weight = this._mesh.geometry.weight; + var x = 0.0; + var y = 0.0; + var iB = 0; + var iV = 0; + if (weight !== null) { + var rawSlotPose = this._weightSlotPose[meshName]; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + this._frameFloatArray.length += weight.count * 2; + iB = weight.offset + 2 /* WeigthBoneIndices */ + weight.bones.length; + } + else { + this._frameFloatArray.length += vertexCount * 2; + } + for (var i = 0; i < vertexCount * 2; i += 2) { + if (rawVertices === null) { // Fill 0. + x = 0.0; + y = 0.0; + } + else { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + if (weight !== null) { // If mesh is skinned, transform point by bone bind pose. + var rawBonePoses = this._weightBonePoses[meshName]; + var vertexBoneCount = this._intArray[iB++]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint, true); + x = this._helpPoint.x; + y = this._helpPoint.y; + for (var j = 0; j < vertexBoneCount; ++j) { + var boneIndex = this._intArray[iB++]; + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint, true); + this._frameFloatArray[frameFloatOffset + iV++] = this._helpPoint.x; + this._frameFloatArray[frameFloatOffset + iV++] = this._helpPoint.y; + } + } + else { + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + if (frameStart === 0) { + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.geometry.offset; + this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0; + this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseIKConstraintFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameIntOffset++] = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true) ? 1 : 0; + this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseActionData = function (rawData, type, bone, slot) { + var actions = new Array(); + if (typeof rawData === "string") { + var action = dragonBones.BaseObject.borrowObject(dragonBones.ActionData); + action.type = type; + action.name = rawData; + action.bone = bone; + action.slot = slot; + actions.push(action); + } + else if (rawData instanceof Array) { + for (var _i = 0, rawData_2 = rawData; _i < rawData_2.length; _i++) { + var rawAction = rawData_2[_i]; + var action = dragonBones.BaseObject.borrowObject(dragonBones.ActionData); + if (dragonBones.DataParser.GOTO_AND_PLAY in rawAction) { + action.type = 0 /* Play */; + action.name = ObjectDataParser._getString(rawAction, dragonBones.DataParser.GOTO_AND_PLAY, ""); + } + else { + if (dragonBones.DataParser.TYPE in rawAction && typeof rawAction[dragonBones.DataParser.TYPE] === "string") { + action.type = dragonBones.DataParser._getActionType(rawAction[dragonBones.DataParser.TYPE]); + } + else { + action.type = ObjectDataParser._getNumber(rawAction, dragonBones.DataParser.TYPE, type); + } + action.name = ObjectDataParser._getString(rawAction, dragonBones.DataParser.NAME, ""); + } + if (dragonBones.DataParser.BONE in rawAction) { + var boneName = ObjectDataParser._getString(rawAction, dragonBones.DataParser.BONE, ""); + action.bone = this._armature.getBone(boneName); + } + else { + action.bone = bone; + } + if (dragonBones.DataParser.SLOT in rawAction) { + var slotName = ObjectDataParser._getString(rawAction, dragonBones.DataParser.SLOT, ""); + action.slot = this._armature.getSlot(slotName); + } + else { + action.slot = slot; + } + var userData = null; + if (dragonBones.DataParser.INTS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawInts = rawAction[dragonBones.DataParser.INTS]; + for (var _a = 0, rawInts_1 = rawInts; _a < rawInts_1.length; _a++) { + var rawValue = rawInts_1[_a]; + userData.addInt(rawValue); + } + } + if (dragonBones.DataParser.FLOATS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawFloats = rawAction[dragonBones.DataParser.FLOATS]; + for (var _b = 0, rawFloats_1 = rawFloats; _b < rawFloats_1.length; _b++) { + var rawValue = rawFloats_1[_b]; + userData.addFloat(rawValue); + } + } + if (dragonBones.DataParser.STRINGS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawStrings = rawAction[dragonBones.DataParser.STRINGS]; + for (var _c = 0, rawStrings_1 = rawStrings; _c < rawStrings_1.length; _c++) { + var rawValue = rawStrings_1[_c]; + userData.addString(rawValue); + } + } + action.data = userData; + actions.push(action); + } + } + return actions; + }; + ObjectDataParser.prototype._parseDeformFrame = function (rawData, frameStart, frameCount) { + var frameFloatOffset = this._frameFloatArray.length; + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var rawVertices = dragonBones.DataParser.VERTICES in rawData ? + rawData[dragonBones.DataParser.VERTICES] : + (dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : null); + var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint + var vertexCount = this._intArray[this._geometry.offset + 0 /* GeometryVertexCount */]; + var weight = this._geometry.weight; + var x = 0.0; + var y = 0.0; + if (weight !== null) { + // TODO + } + else { + this._frameFloatArray.length += vertexCount * 2; + for (var i = 0; i < vertexCount * 2; i += 2) { + if (rawVertices !== null) { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + else { + x = 0.0; + y = 0.0; + } + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + if (frameStart === 0) { + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._geometry.offset; + this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0; + this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseTransform = function (rawData, transform, scale) { + transform.x = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0) * scale; + transform.y = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0) * scale; + if (dragonBones.DataParser.ROTATE in rawData || dragonBones.DataParser.SKEW in rawData) { + transform.rotation = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE, 0.0) * dragonBones.Transform.DEG_RAD); + transform.skew = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD); + } + else if (dragonBones.DataParser.SKEW_X in rawData || dragonBones.DataParser.SKEW_Y in rawData) { + transform.rotation = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW_Y, 0.0) * dragonBones.Transform.DEG_RAD); + transform.skew = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW_X, 0.0) * dragonBones.Transform.DEG_RAD) - transform.rotation; + } + transform.scaleX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE_X, 1.0); + transform.scaleY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE_Y, 1.0); + }; + ObjectDataParser.prototype._parseColorTransform = function (rawData, color) { + color.alphaMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA_MULTIPLIER, 100) * 0.01; + color.redMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.RED_MULTIPLIER, 100) * 0.01; + color.greenMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_MULTIPLIER, 100) * 0.01; + color.blueMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_MULTIPLIER, 100) * 0.01; + color.alphaOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA_OFFSET, 0); + color.redOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.RED_OFFSET, 0); + color.greenOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_OFFSET, 0); + color.blueOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_OFFSET, 0); + }; + ObjectDataParser.prototype._parseGeometry = function (rawData, geometry) { + var rawVertices = rawData[dragonBones.DataParser.VERTICES]; + var vertexCount = Math.floor(rawVertices.length / 2); // uint + var triangleCount = 0; + var geometryOffset = this._intArray.length; + var verticesOffset = this._floatArray.length; + // + geometry.offset = geometryOffset; + geometry.data = this._data; + // + this._intArray.length += 1 + 1 + 1 + 1; + this._intArray[geometryOffset + 0 /* GeometryVertexCount */] = vertexCount; + this._intArray[geometryOffset + 2 /* GeometryFloatOffset */] = verticesOffset; + this._intArray[geometryOffset + 3 /* GeometryWeightOffset */] = -1; // + // + this._floatArray.length += vertexCount * 2; + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[verticesOffset + i] = rawVertices[i]; + } + if (dragonBones.DataParser.TRIANGLES in rawData) { + var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES]; + triangleCount = Math.floor(rawTriangles.length / 3); // uint + // + this._intArray.length += triangleCount * 3; + for (var i = 0, l = triangleCount * 3; i < l; ++i) { + this._intArray[geometryOffset + 4 /* GeometryVertexIndices */ + i] = rawTriangles[i]; + } + } + // Fill triangle count. + this._intArray[geometryOffset + 1 /* GeometryTriangleCount */] = triangleCount; + if (dragonBones.DataParser.UVS in rawData) { + var rawUVs = rawData[dragonBones.DataParser.UVS]; + var uvOffset = verticesOffset + vertexCount * 2; + this._floatArray.length += vertexCount * 2; + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[uvOffset + i] = rawUVs[i]; + } + } + if (dragonBones.DataParser.WEIGHTS in rawData) { + var rawWeights = rawData[dragonBones.DataParser.WEIGHTS]; + var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint + var weightOffset = this._intArray.length; + var floatOffset = this._floatArray.length; + var weightBoneCount = 0; + var sortedBones = this._armature.sortedBones; + var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData); + weight.count = weightCount; + weight.offset = weightOffset; + this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount; + this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset; + if (dragonBones.DataParser.BONE_POSE in rawData) { + var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE]; + var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE]; + var weightBoneIndices = new Array(); + weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint + weightBoneIndices.length = weightBoneCount; + for (var i = 0; i < weightBoneCount; ++i) { + var rawBoneIndex = rawBonePoses[i * 7]; // uint + var bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + weightBoneIndices[i] = rawBoneIndex; + this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone); + } + this._floatArray.length += weightCount * 3; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) { + var iD = i * 2; + var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint + var x = this._floatArray[verticesOffset + iD]; + var y = this._floatArray[verticesOffset + iD + 1]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint); + x = this._helpPoint.x; + y = this._helpPoint.y; + for (var j = 0; j < vertexBoneCount; ++j) { + var rawBoneIndex = rawWeights[iW++]; // uint + var boneIndex = weightBoneIndices.indexOf(rawBoneIndex); + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint); + this._intArray[iB++] = boneIndex; + this._floatArray[iV++] = rawWeights[iW++]; + this._floatArray[iV++] = this._helpPoint.x; + this._floatArray[iV++] = this._helpPoint.y; + } + } + } + else { + var rawBones = rawData[dragonBones.DataParser.BONES]; + weightBoneCount = rawBones.length; + for (var i = 0; i < weightBoneCount; i++) { + var rawBoneIndex = rawBones[i]; + var bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone); + } + this._floatArray.length += weightCount * 3; + for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) { + var vertexBoneCount = rawWeights[iW++]; + this._intArray[iB++] = vertexBoneCount; + for (var j = 0; j < vertexBoneCount; j++) { + var boneIndex = rawWeights[iW++]; + var boneWeight = rawWeights[iW++]; + var x = rawVertices[iV++]; + var y = rawVertices[iV++]; + this._intArray[iB++] = rawBones.indexOf(boneIndex); + this._floatArray[iF++] = boneWeight; + this._floatArray[iF++] = x; + this._floatArray[iF++] = y; + } + } + } + geometry.weight = weight; + } + }; + ObjectDataParser.prototype._parseArray = function (rawData) { + // tslint:disable-next-line:no-unused-expression + rawData; + this._intArray.length = 0; + this._floatArray.length = 0; + this._frameIntArray.length = 0; + this._frameFloatArray.length = 0; + this._frameArray.length = 0; + this._timelineArray.length = 0; + this._colorArray.length = 0; + }; + ObjectDataParser.prototype._modifyArray = function () { + // Align. + if ((this._intArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._intArray.push(0); + } + if ((this._frameIntArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._frameIntArray.push(0); + } + if ((this._frameArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._frameArray.push(0); + } + if ((this._timelineArray.length % Uint16Array.BYTES_PER_ELEMENT) !== 0) { + this._timelineArray.push(0); + } + if ((this._timelineArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._colorArray.push(0); + } + var l1 = this._intArray.length * Int16Array.BYTES_PER_ELEMENT; + var l2 = this._floatArray.length * Float32Array.BYTES_PER_ELEMENT; + var l3 = this._frameIntArray.length * Int16Array.BYTES_PER_ELEMENT; + var l4 = this._frameFloatArray.length * Float32Array.BYTES_PER_ELEMENT; + var l5 = this._frameArray.length * Int16Array.BYTES_PER_ELEMENT; + var l6 = this._timelineArray.length * Uint16Array.BYTES_PER_ELEMENT; + var l7 = this._colorArray.length * Int16Array.BYTES_PER_ELEMENT; + var lTotal = l1 + l2 + l3 + l4 + l5 + l6 + l7; + // + var binary = new ArrayBuffer(lTotal); + var intArray = new Uint16Array(binary, 0, this._intArray.length); + var floatArray = new Float32Array(binary, l1, this._floatArray.length); + var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length); + var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length); + var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length); + var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length); + var colorArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5 + l6, this._colorArray.length); + for (var i = 0, l = this._intArray.length; i < l; ++i) { + intArray[i] = this._intArray[i]; + } + for (var i = 0, l = this._floatArray.length; i < l; ++i) { + floatArray[i] = this._floatArray[i]; + } + for (var i = 0, l = this._frameIntArray.length; i < l; ++i) { + frameIntArray[i] = this._frameIntArray[i]; + } + for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) { + frameFloatArray[i] = this._frameFloatArray[i]; + } + for (var i = 0, l = this._frameArray.length; i < l; ++i) { + frameArray[i] = this._frameArray[i]; + } + for (var i = 0, l = this._timelineArray.length; i < l; ++i) { + timelineArray[i] = this._timelineArray[i]; + } + for (var i = 0, l = this._colorArray.length; i < l; ++i) { + colorArray[i] = this._colorArray[i]; + } + this._data.binary = binary; + this._data.intArray = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = frameArray; + this._data.timelineArray = timelineArray; + this._data.colorArray = colorArray; + this._defaultColorOffset = -1; + }; + ObjectDataParser.prototype.parseDragonBonesData = function (rawData, scale) { + if (scale === void 0) { scale = 1; } + console.assert(rawData !== null && rawData !== undefined, "Data error."); + var version = ObjectDataParser._getString(rawData, dragonBones.DataParser.VERSION, ""); + var compatibleVersion = ObjectDataParser._getString(rawData, dragonBones.DataParser.COMPATIBLE_VERSION, ""); + if (dragonBones.DataParser.DATA_VERSIONS.indexOf(version) >= 0 || + dragonBones.DataParser.DATA_VERSIONS.indexOf(compatibleVersion) >= 0) { + var data = dragonBones.BaseObject.borrowObject(dragonBones.DragonBonesData); + data.version = version; + data.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + data.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, 24); + if (data.frameRate === 0) { // Data error. + data.frameRate = 24; + } + if (dragonBones.DataParser.ARMATURE in rawData) { + this._data = data; + this._parseArray(rawData); + var rawArmatures = rawData[dragonBones.DataParser.ARMATURE]; + for (var _i = 0, rawArmatures_1 = rawArmatures; _i < rawArmatures_1.length; _i++) { + var rawArmature = rawArmatures_1[_i]; + data.addArmature(this._parseArmature(rawArmature, scale)); + } + if (!this._data.binary) { // DragonBones.webAssembly ? 0 : null; + this._modifyArray(); + } + if (dragonBones.DataParser.STAGE in rawData) { + data.stage = data.getArmature(ObjectDataParser._getString(rawData, dragonBones.DataParser.STAGE, "")); + } + else if (data.armatureNames.length > 0) { + data.stage = data.getArmature(data.armatureNames[0]); + } + this._data = null; + } + if (dragonBones.DataParser.TEXTURE_ATLAS in rawData) { + this._rawTextureAtlases = rawData[dragonBones.DataParser.TEXTURE_ATLAS]; + } + return data; + } + else { + console.assert(false, "Nonsupport data version: " + version + "\n" + + "Please convert DragonBones data to support version.\n" + + "Read more: https://github.com/DragonBones/Tools/"); + } + return null; + }; + ObjectDataParser.prototype.parseTextureAtlasData = function (rawData, textureAtlasData, scale) { + if (scale === void 0) { scale = 1.0; } + console.assert(rawData !== undefined); + if (rawData === null) { + if (this._rawTextureAtlases === null || this._rawTextureAtlases.length === 0) { + return false; + } + var rawTextureAtlas = this._rawTextureAtlases[this._rawTextureAtlasIndex++]; + this.parseTextureAtlasData(rawTextureAtlas, textureAtlasData, scale); + if (this._rawTextureAtlasIndex >= this._rawTextureAtlases.length) { + this._rawTextureAtlasIndex = 0; + this._rawTextureAtlases = null; + } + return true; + } + // Texture format. + textureAtlasData.width = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WIDTH, 0); + textureAtlasData.height = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.HEIGHT, 0); + textureAtlasData.scale = scale === 1.0 ? (1.0 / ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0)) : scale; + textureAtlasData.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + textureAtlasData.imagePath = ObjectDataParser._getString(rawData, dragonBones.DataParser.IMAGE_PATH, ""); + if (dragonBones.DataParser.SUB_TEXTURE in rawData) { + var rawTextures = rawData[dragonBones.DataParser.SUB_TEXTURE]; + for (var i = 0, l = rawTextures.length; i < l; ++i) { + var rawTexture = rawTextures[i]; + var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0); + var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0); + var textureData = textureAtlasData.createTexture(); + textureData.rotated = ObjectDataParser._getBoolean(rawTexture, dragonBones.DataParser.ROTATED, false); + textureData.name = ObjectDataParser._getString(rawTexture, dragonBones.DataParser.NAME, ""); + textureData.region.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.X, 0.0); + textureData.region.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.Y, 0.0); + textureData.region.width = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.WIDTH, 0.0); + textureData.region.height = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.HEIGHT, 0.0); + if (frameWidth > 0.0 && frameHeight > 0.0) { + textureData.frame = dragonBones.TextureData.createRectangle(); + textureData.frame.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_X, 0.0); + textureData.frame.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_Y, 0.0); + textureData.frame.width = frameWidth; + textureData.frame.height = frameHeight; + } + textureAtlasData.addTexture(textureData); + } + } + return true; + }; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + ObjectDataParser.getInstance = function () { + if (ObjectDataParser._objectDataParserInstance === null) { + ObjectDataParser._objectDataParserInstance = new ObjectDataParser(); + } + return ObjectDataParser._objectDataParserInstance; + }; + ObjectDataParser._objectDataParserInstance = null; + return ObjectDataParser; + }(dragonBones.DataParser)); + dragonBones.ObjectDataParser = ObjectDataParser; + /** + * @private + */ + var ActionFrame = /** @class */ (function () { + function ActionFrame() { + this.frameStart = 0; + this.actions = []; + } + return ActionFrame; + }()); + dragonBones.ActionFrame = ActionFrame; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var BinaryDataParser = /** @class */ (function (_super) { + __extends(BinaryDataParser, _super); + function BinaryDataParser() { + return _super !== null && _super.apply(this, arguments) || this; + } + BinaryDataParser.prototype._inRange = function (a, min, max) { + return min <= a && a <= max; + }; + BinaryDataParser.prototype._decodeUTF8 = function (data) { + var EOF_byte = -1; + var EOF_code_point = -1; + var FATAL_POINT = 0xFFFD; + var pos = 0; + var result = ""; + var code_point; + var utf8_code_point = 0; + var utf8_bytes_needed = 0; + var utf8_bytes_seen = 0; + var utf8_lower_boundary = 0; + while (data.length > pos) { + var _byte = data[pos++]; + if (_byte === EOF_byte) { + if (utf8_bytes_needed !== 0) { + code_point = FATAL_POINT; + } + else { + code_point = EOF_code_point; + } + } + else { + if (utf8_bytes_needed === 0) { + if (this._inRange(_byte, 0x00, 0x7F)) { + code_point = _byte; + } + else { + if (this._inRange(_byte, 0xC2, 0xDF)) { + utf8_bytes_needed = 1; + utf8_lower_boundary = 0x80; + utf8_code_point = _byte - 0xC0; + } + else if (this._inRange(_byte, 0xE0, 0xEF)) { + utf8_bytes_needed = 2; + utf8_lower_boundary = 0x800; + utf8_code_point = _byte - 0xE0; + } + else if (this._inRange(_byte, 0xF0, 0xF4)) { + utf8_bytes_needed = 3; + utf8_lower_boundary = 0x10000; + utf8_code_point = _byte - 0xF0; + } + else { + } + utf8_code_point = utf8_code_point * Math.pow(64, utf8_bytes_needed); + code_point = null; + } + } + else if (!this._inRange(_byte, 0x80, 0xBF)) { + utf8_code_point = 0; + utf8_bytes_needed = 0; + utf8_bytes_seen = 0; + utf8_lower_boundary = 0; + pos--; + code_point = _byte; + } + else { + utf8_bytes_seen += 1; + utf8_code_point = utf8_code_point + (_byte - 0x80) * Math.pow(64, utf8_bytes_needed - utf8_bytes_seen); + if (utf8_bytes_seen !== utf8_bytes_needed) { + code_point = null; + } + else { + var cp = utf8_code_point; + var lower_boundary = utf8_lower_boundary; + utf8_code_point = 0; + utf8_bytes_needed = 0; + utf8_bytes_seen = 0; + utf8_lower_boundary = 0; + if (this._inRange(cp, lower_boundary, 0x10FFFF) && !this._inRange(cp, 0xD800, 0xDFFF)) { + code_point = cp; + } + else { + code_point = _byte; + } + } + } + } + //Decode string + if (code_point !== null && code_point !== EOF_code_point) { + if (code_point <= 0xFFFF) { + if (code_point > 0) + result += String.fromCharCode(code_point); + } + else { + code_point -= 0x10000; + result += String.fromCharCode(0xD800 + ((code_point >> 10) & 0x3ff)); + result += String.fromCharCode(0xDC00 + (code_point & 0x3ff)); + } + } + } + return result; + }; + BinaryDataParser.prototype._parseBinaryTimeline = function (type, offset, timelineData) { + if (timelineData === void 0) { timelineData = null; } + var timeline = timelineData !== null ? timelineData : dragonBones.BaseObject.borrowObject(dragonBones.TimelineData); + timeline.type = type; + timeline.offset = offset; + this._timeline = timeline; + var keyFrameCount = this._timelineArrayBuffer[timeline.offset + 2 /* TimelineKeyFrameCount */]; + if (keyFrameCount === 1) { + timeline.frameIndicesOffset = -1; + } + else { + var frameIndicesOffset = 0; + var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. + var frameIndices = this._data.frameIndices; + frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; + timeline.frameIndicesOffset = frameIndicesOffset; + for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) { + if (frameStart + frameCount <= i && iK < keyFrameCount) { + frameStart = this._frameArrayBuffer[this._animation.frameOffset + this._timelineArrayBuffer[timeline.offset + 5 /* TimelineFrameOffset */ + iK]]; + if (iK === keyFrameCount - 1) { + frameCount = this._animation.frameCount - frameStart; + } + else { + frameCount = this._frameArrayBuffer[this._animation.frameOffset + this._timelineArrayBuffer[timeline.offset + 5 /* TimelineFrameOffset */ + iK + 1]] - frameStart; + } + iK++; + } + frameIndices[frameIndicesOffset + i] = iK - 1; + } + } + this._timeline = null; // + return timeline; + }; + BinaryDataParser.prototype._parseAnimation = function (rawData) { + var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData); + animation.blendType = dragonBones.DataParser._getAnimationBlendType(dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, "")); + animation.frameCount = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0); + animation.playTimes = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1); + animation.duration = animation.frameCount / this._armature.frameRate; // float + animation.fadeInTime = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0); + animation.scale = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0); + animation.name = dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (animation.name.length === 0) { + animation.name = dragonBones.DataParser.DEFAULT_NAME; + } + // Offsets. + var offsets = rawData[dragonBones.DataParser.OFFSET]; + animation.frameIntOffset = offsets[0]; + animation.frameFloatOffset = offsets[1]; + animation.frameOffset = offsets[2]; + this._animation = animation; + if (dragonBones.DataParser.ACTION in rawData) { + animation.actionTimeline = this._parseBinaryTimeline(0 /* Action */, rawData[dragonBones.DataParser.ACTION]); + } + if (dragonBones.DataParser.Z_ORDER in rawData) { + animation.zOrderTimeline = this._parseBinaryTimeline(1 /* ZOrder */, rawData[dragonBones.DataParser.Z_ORDER]); + } + if (dragonBones.DataParser.BONE in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.BONE]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var bone = this._armature.getBone(k); + if (bone === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addBoneTimeline(bone.name, timeline); + } + } + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.SLOT]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var slot = this._armature.getSlot(k); + if (slot === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addSlotTimeline(slot.name, timeline); + } + } + } + if (dragonBones.DataParser.CONSTRAINT in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.CONSTRAINT]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var constraint = this._armature.getConstraint(k); + if (constraint === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addConstraintTimeline(constraint.name, timeline); + } + } + } + if (dragonBones.DataParser.TIMELINE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.TIMELINE]; + for (var _i = 0, rawTimelines_6 = rawTimelines; _i < rawTimelines_6.length; _i++) { + var rawTimeline = rawTimelines_6[_i]; + var timelineOffset = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.OFFSET, 0); + if (timelineOffset >= 0) { + var timelineType = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */); + var timelineName = dragonBones.ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var timeline = null; + if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData); + var animaitonTimeline = timeline; + animaitonTimeline.x = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0); + animaitonTimeline.y = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0); + } + timeline = this._parseBinaryTimeline(timelineType, timelineOffset, timeline); + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 1 /* ZOrder */: + // TODO + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 50 /* Surface */: + case 60 /* BoneAlpha */: + this._animation.addBoneTimeline(timelineName, timeline); + break; + case 20 /* SlotDisplay */: + case 21 /* SlotColor */: + case 22 /* SlotDeform */: + case 23 /* SlotZIndex */: + case 24 /* SlotAlpha */: + this._animation.addSlotTimeline(timelineName, timeline); + break; + case 30 /* IKConstraint */: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + case 42 /* AnimationParameter */: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null; + return animation; + }; + BinaryDataParser.prototype._parseGeometry = function (rawData, geometry) { + geometry.offset = rawData[dragonBones.DataParser.OFFSET]; + geometry.data = this._data; + var weightOffset = this._intArrayBuffer[geometry.offset + 3 /* GeometryWeightOffset */]; + if (weightOffset >= 0) { + var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData); + var vertexCount = this._intArrayBuffer[geometry.offset + 0 /* GeometryVertexCount */]; + var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */]; + weight.offset = weightOffset; + for (var i = 0; i < boneCount; ++i) { + var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i]; + weight.addBone(this._rawBones[boneIndex]); + } + var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount; + var weightCount = 0; + for (var i = 0, l = vertexCount; i < l; ++i) { + var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++]; + weightCount += vertexBoneCount; + boneIndicesOffset += vertexBoneCount; + } + weight.count = weightCount; + geometry.weight = weight; + } + }; + BinaryDataParser.prototype._parseArray = function (rawData) { + var offsets = rawData[dragonBones.DataParser.OFFSET]; + var l1 = offsets[1]; + var l2 = offsets[3]; + var l3 = offsets[5]; + var l4 = offsets[7]; + var l5 = offsets[9]; + var l6 = offsets[11]; + var l7 = offsets.length > 12 ? offsets[13] : 0; // Color. + var intArray = new Uint16Array(this._binary, this._binaryOffset + offsets[0], l1 / Uint16Array.BYTES_PER_ELEMENT); + var floatArray = new Float32Array(this._binary, this._binaryOffset + offsets[2], l2 / Float32Array.BYTES_PER_ELEMENT); + var frameIntArray = new Int16Array(this._binary, this._binaryOffset + offsets[4], l3 / Int16Array.BYTES_PER_ELEMENT); + var frameFloatArray = new Float32Array(this._binary, this._binaryOffset + offsets[6], l4 / Float32Array.BYTES_PER_ELEMENT); + var frameArray = new Int16Array(this._binary, this._binaryOffset + offsets[8], l5 / Int16Array.BYTES_PER_ELEMENT); + var timelineArray = new Uint16Array(this._binary, this._binaryOffset + offsets[10], l6 / Uint16Array.BYTES_PER_ELEMENT); + var colorArray = l7 > 0 ? new Uint16Array(this._binary, this._binaryOffset + offsets[12], l7 / Uint16Array.BYTES_PER_ELEMENT) : intArray; // Color. + this._data.binary = this._binary; + this._data.intArray = this._intArrayBuffer = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = this._frameArrayBuffer = frameArray; + this._data.timelineArray = this._timelineArrayBuffer = timelineArray; + this._data.colorArray = colorArray; + }; + BinaryDataParser.prototype.parseDragonBonesData = function (rawData, scale) { + if (scale === void 0) { scale = 1; } + console.assert(rawData !== null && rawData !== undefined && rawData instanceof ArrayBuffer, "Data error."); + var tag = new Uint8Array(rawData, 0, 8); + if (tag[0] !== "D".charCodeAt(0) || + tag[1] !== "B".charCodeAt(0) || + tag[2] !== "D".charCodeAt(0) || + tag[3] !== "T".charCodeAt(0)) { + console.assert(false, "Nonsupport data."); + return null; + } + var headerLength = new Uint32Array(rawData, 8, 1)[0]; + var headerBytes = new Uint8Array(rawData, 8 + 4, headerLength); + var headerString = this._decodeUTF8(headerBytes); + var header = JSON.parse(headerString); + // + this._binaryOffset = 8 + 4 + headerLength; + this._binary = rawData; + return _super.prototype.parseDragonBonesData.call(this, header, scale); + }; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + BinaryDataParser.getInstance = function () { + if (BinaryDataParser._binaryDataParserInstance === null) { + BinaryDataParser._binaryDataParserInstance = new BinaryDataParser(); + } + return BinaryDataParser._binaryDataParserInstance; + }; + BinaryDataParser._binaryDataParserInstance = null; + return BinaryDataParser; + }(dragonBones.ObjectDataParser)); + dragonBones.BinaryDataParser = BinaryDataParser; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) + * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. + * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) + * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 + * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + var BaseFactory = /** @class */ (function () { + /** + * - Create a factory instance. (typically only one global factory instance is required) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) + * @version DragonBones 3.0 + * @language zh_CN + */ + function BaseFactory(dataParser) { + if (dataParser === void 0) { dataParser = null; } + /** + * @private + */ + this.autoSearch = false; + this._dragonBonesDataMap = {}; + this._textureAtlasDataMap = {}; + this._dragonBones = null; + this._dataParser = null; + if (BaseFactory._objectParser === null) { + BaseFactory._objectParser = new dragonBones.ObjectDataParser(); + } + if (BaseFactory._binaryParser === null) { + BaseFactory._binaryParser = new dragonBones.BinaryDataParser(); + } + this._dataParser = dataParser !== null ? dataParser : BaseFactory._objectParser; + } + BaseFactory.prototype._isSupportMesh = function () { + return true; + }; + BaseFactory.prototype._getTextureData = function (textureAtlasName, textureName) { + if (textureAtlasName in this._textureAtlasDataMap) { + for (var _i = 0, _a = this._textureAtlasDataMap[textureAtlasName]; _i < _a.length; _i++) { + var textureAtlasData = _a[_i]; + var textureData = textureAtlasData.getTexture(textureName); + if (textureData !== null) { + return textureData; + } + } + } + if (this.autoSearch) { // Will be search all data, if the autoSearch is true. + for (var k in this._textureAtlasDataMap) { + for (var _b = 0, _c = this._textureAtlasDataMap[k]; _b < _c.length; _b++) { + var textureAtlasData = _c[_b]; + if (textureAtlasData.autoSearch) { + var textureData = textureAtlasData.getTexture(textureName); + if (textureData !== null) { + return textureData; + } + } + } + } + } + return null; + }; + BaseFactory.prototype._fillBuildArmaturePackage = function (dataPackage, dragonBonesName, armatureName, skinName, textureAtlasName) { + var dragonBonesData = null; + var armatureData = null; + if (dragonBonesName.length > 0) { + if (dragonBonesName in this._dragonBonesDataMap) { + dragonBonesData = this._dragonBonesDataMap[dragonBonesName]; + armatureData = dragonBonesData.getArmature(armatureName); + } + } + if (armatureData === null && (dragonBonesName.length === 0 || this.autoSearch)) { // Will be search all data, if do not give a data name or the autoSearch is true. + for (var k in this._dragonBonesDataMap) { + dragonBonesData = this._dragonBonesDataMap[k]; + if (dragonBonesName.length === 0 || dragonBonesData.autoSearch) { + armatureData = dragonBonesData.getArmature(armatureName); + if (armatureData !== null) { + dragonBonesName = k; + break; + } + } + } + } + if (armatureData !== null) { + dataPackage.dataName = dragonBonesName; + dataPackage.textureAtlasName = textureAtlasName; + dataPackage.data = dragonBonesData; + dataPackage.armature = armatureData; + dataPackage.skin = null; + if (skinName.length > 0) { + dataPackage.skin = armatureData.getSkin(skinName); + if (dataPackage.skin === null && this.autoSearch) { + for (var k in this._dragonBonesDataMap) { + var skinDragonBonesData = this._dragonBonesDataMap[k]; + var skinArmatureData = skinDragonBonesData.getArmature(skinName); + if (skinArmatureData !== null) { + dataPackage.skin = skinArmatureData.defaultSkin; + break; + } + } + } + } + if (dataPackage.skin === null) { + dataPackage.skin = armatureData.defaultSkin; + } + return true; + } + return false; + }; + BaseFactory.prototype._buildBones = function (dataPackage, armature) { + for (var _i = 0, _a = dataPackage.armature.sortedBones; _i < _a.length; _i++) { + var boneData = _a[_i]; + var bone = dragonBones.BaseObject.borrowObject(boneData.type === 0 /* Bone */ ? dragonBones.Bone : dragonBones.Surface); + bone.init(boneData, armature); + } + }; + /** + * @private + */ + BaseFactory.prototype._buildSlots = function (dataPackage, armature) { + var currentSkin = dataPackage.skin; + var defaultSkin = dataPackage.armature.defaultSkin; + if (currentSkin === null || defaultSkin === null) { + return; + } + var skinSlots = {}; + for (var k in defaultSkin.displays) { + var displays = defaultSkin.getDisplays(k); + skinSlots[k] = displays; + } + if (currentSkin !== defaultSkin) { + for (var k in currentSkin.displays) { + var displays = currentSkin.getDisplays(k); + skinSlots[k] = displays; + } + } + for (var _i = 0, _a = dataPackage.armature.sortedSlots; _i < _a.length; _i++) { + var slotData = _a[_i]; + var displayDatas = slotData.name in skinSlots ? skinSlots[slotData.name] : null; + var slot = this._buildSlot(dataPackage, slotData, armature); + if (displayDatas !== null) { + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); + if (displayData !== null) { + if (dataPackage.textureAtlasName.length > 0) { + var textureData = this._getTextureData(dataPackage.textureAtlasName, displayData.path); + slot.replaceTextureData(textureData, i); + } + var display = this._getSlotDisplay(dataPackage, displayData, slot); + slot.replaceDisplay(display, i); + } + else { + slot.replaceDisplay(null); + } + } + } + slot._setDisplayIndex(slotData.displayIndex, true); + } + }; + BaseFactory.prototype._buildConstraints = function (dataPackage, armature) { + var constraints = dataPackage.armature.constraints; + for (var k in constraints) { + var constraintData = constraints[k]; + // TODO more constraint type. + switch (constraintData.type) { + case 0 /* IK */: + var ikConstraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraint); + ikConstraint.init(constraintData, armature); + armature._addConstraint(ikConstraint); + break; + case 1 /* Path */: + var pathConstraint = dragonBones.BaseObject.borrowObject(dragonBones.PathConstraint); + pathConstraint.init(constraintData, armature); + armature._addConstraint(pathConstraint); + break; + default: + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraint); + constraint.init(constraintData, armature); + armature._addConstraint(constraint); + break; + } + } + }; + BaseFactory.prototype._buildChildArmature = function (dataPackage, _slot, displayData) { + return this.buildArmature(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage !== null ? dataPackage.textureAtlasName : ""); + }; + BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, slot) { + var dataName = dataPackage !== null ? dataPackage.dataName : displayData.parent.parent.parent.name; + var display = null; + switch (displayData.type) { + case 0 /* Image */: { + var imageDisplayData = displayData; + if (imageDisplayData.texture === null) { + imageDisplayData.texture = this._getTextureData(dataName, displayData.path); + } + display = slot.rawDisplay; + break; + } + case 2 /* Mesh */: { + var meshDisplayData = displayData; + if (meshDisplayData.texture === null) { + meshDisplayData.texture = this._getTextureData(dataName, meshDisplayData.path); + } + if (this._isSupportMesh()) { + display = slot.meshDisplay; + } + else { + display = slot.rawDisplay; + } + break; + } + case 1 /* Armature */: { + var armatureDisplayData = displayData; + var childArmature = this._buildChildArmature(dataPackage, slot, armatureDisplayData); + if (childArmature !== null) { + childArmature.inheritAnimation = armatureDisplayData.inheritAnimation; + if (!childArmature.inheritAnimation) { + var actions = armatureDisplayData.actions.length > 0 ? armatureDisplayData.actions : childArmature.armatureData.defaultActions; + if (actions.length > 0) { + for (var _i = 0, actions_6 = actions; _i < actions_6.length; _i++) { + var action = actions_6[_i]; + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + dragonBones.EventObject.actionDataToInstance(action, eventObject, slot.armature); + eventObject.slot = slot; + slot.armature._bufferAction(eventObject, false); + } + } + else { + childArmature.animation.play(); + } + } + armatureDisplayData.armature = childArmature.armatureData; // + } + display = childArmature; + break; + } + case 3 /* BoundingBox */: + break; + default: + break; + } + return display; + }; + /** + * - Parse the raw data to a DragonBonesData instance and cache it to the factory. + * @param rawData - The raw data. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for all armatures. (Default: 1.0) + * @returns DragonBonesData instance + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 + * @param rawData - 原始数据。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) + * @returns DragonBonesData 实例 + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.parseDragonBonesData = function (rawData, name, scale) { + if (name === void 0) { name = null; } + if (scale === void 0) { scale = 1.0; } + var dataParser = rawData instanceof ArrayBuffer ? BaseFactory._binaryParser : this._dataParser; + var dragonBonesData = dataParser.parseDragonBonesData(rawData, scale); + while (true) { + var textureAtlasData = this._buildTextureAtlasData(null, null); + if (dataParser.parseTextureAtlasData(null, textureAtlasData, scale)) { + this.addTextureAtlasData(textureAtlasData, name); + } + else { + textureAtlasData.returnToPool(); + break; + } + } + if (dragonBonesData !== null) { + this.addDragonBonesData(dragonBonesData, name); + } + return dragonBonesData; + }; + /** + * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. + * @param rawData - The raw texture atlas data. + * @param textureAtlas - The texture atlas object. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for the map set. (Default: 1.0) + * @returns TextureAtlasData instance + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 + * @param rawData - 原始贴图集数据。 + * @param textureAtlas - 贴图集对象。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) + * @returns TextureAtlasData 实例 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.parseTextureAtlasData = function (rawData, textureAtlas, name, scale) { + if (name === void 0) { name = null; } + if (scale === void 0) { scale = 1.0; } + var textureAtlasData = this._buildTextureAtlasData(null, null); + this._dataParser.parseTextureAtlasData(rawData, textureAtlasData, scale); + this._buildTextureAtlasData(textureAtlasData, textureAtlas || null); + this.addTextureAtlasData(textureAtlasData, name); + return textureAtlasData; + }; + /** + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN + */ + BaseFactory.prototype.updateTextureAtlases = function (textureAtlases, name) { + var textureAtlasDatas = this.getTextureAtlasData(name); + if (textureAtlasDatas !== null) { + for (var i = 0, l = textureAtlasDatas.length; i < l; ++i) { + if (i < textureAtlases.length) { + this._buildTextureAtlasData(textureAtlasDatas[i], textureAtlases[i]); + } + } + } + }; + /** + * - Get a specific DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @returns DragonBonesData instance + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 DragonBonesData 实例。 + * @param name - DragonBonesData 实例的缓存名称。 + * @returns DragonBonesData 实例 + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.getDragonBonesData = function (name) { + return (name in this._dragonBonesDataMap) ? this._dragonBonesDataMap[name] : null; + }; + /** + * - Cache a DragonBonesData instance to the factory. + * @param data - The DragonBonesData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 DragonBonesData 实例缓存到工厂中。 + * @param data - DragonBonesData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.addDragonBonesData = function (data, name) { + if (name === void 0) { name = null; } + name = name !== null ? name : data.name; + if (name in this._dragonBonesDataMap) { + if (this._dragonBonesDataMap[name] === data) { + return; + } + console.warn("Can not add same name data: " + name); + return; + } + this._dragonBonesDataMap[name] = data; + }; + /** + * - Remove a DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @param disposeData - Whether to dispose data. (Default: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 DragonBonesData 实例。 + * @param name - DragonBonesData 实例缓存名称。 + * @param disposeData - 是否释放数据。 (默认: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.removeDragonBonesData = function (name, disposeData) { + if (disposeData === void 0) { disposeData = true; } + if (name in this._dragonBonesDataMap) { + if (disposeData) { + this._dragonBones.bufferObject(this._dragonBonesDataMap[name]); + } + delete this._dragonBonesDataMap[name]; + } + }; + /** + * - Get a list of specific TextureAtlasData instances. + * @param name - The TextureAtlasData cahce name. + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 TextureAtlasData 实例列表。 + * @param name - TextureAtlasData 实例缓存名称。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.getTextureAtlasData = function (name) { + return (name in this._textureAtlasDataMap) ? this._textureAtlasDataMap[name] : null; + }; + /** + * - Cache a TextureAtlasData instance to the factory. + * @param data - The TextureAtlasData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 TextureAtlasData 实例缓存到工厂中。 + * @param data - TextureAtlasData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.addTextureAtlasData = function (data, name) { + if (name === void 0) { name = null; } + name = name !== null ? name : data.name; + var textureAtlasList = (name in this._textureAtlasDataMap) ? this._textureAtlasDataMap[name] : (this._textureAtlasDataMap[name] = []); + if (textureAtlasList.indexOf(data) < 0) { + textureAtlasList.push(data); + } + }; + /** + * - Remove a TextureAtlasData instance. + * @param name - The TextureAtlasData instance cache name. + * @param disposeData - Whether to dispose data. + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 TextureAtlasData 实例。 + * @param name - TextureAtlasData 实例的缓存名称。 + * @param disposeData - 是否释放数据。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.removeTextureAtlasData = function (name, disposeData) { + if (disposeData === void 0) { disposeData = true; } + if (name in this._textureAtlasDataMap) { + var textureAtlasDataList = this._textureAtlasDataMap[name]; + if (disposeData) { + for (var _i = 0, textureAtlasDataList_1 = textureAtlasDataList; _i < textureAtlasDataList_1.length; _i++) { + var textureAtlasData = textureAtlasDataList_1[_i]; + this._dragonBones.bufferObject(textureAtlasData); + } + } + delete this._textureAtlasDataMap[name]; + } + }; + /** + * - Get a specific armature data. + * @param name - The armature data name. + * @param dragonBonesName - The cached name for DragonbonesData instance. + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param name - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language zh_CN + */ + BaseFactory.prototype.getArmatureData = function (name, dragonBonesName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + var dataPackage = new BuildArmaturePackage(); + if (!this._fillBuildArmaturePackage(dataPackage, dragonBonesName, name, "", "")) { + return null; + } + return dataPackage.armature; + }; + /** + * - Clear all cached DragonBonesData instances and TextureAtlasData instances. + * @param disposeData - Whether to dispose data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 + * @param disposeData - 是否释放数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.clear = function (disposeData) { + if (disposeData === void 0) { disposeData = true; } + for (var k in this._dragonBonesDataMap) { + if (disposeData) { + this._dragonBones.bufferObject(this._dragonBonesDataMap[k]); + } + delete this._dragonBonesDataMap[k]; + } + for (var k in this._textureAtlasDataMap) { + if (disposeData) { + var textureAtlasDataList = this._textureAtlasDataMap[k]; + for (var _i = 0, textureAtlasDataList_2 = textureAtlasDataList; _i < textureAtlasDataList_2.length; _i++) { + var textureAtlasData = textureAtlasDataList_2[_i]; + this._dragonBones.bufferObject(textureAtlasData); + } + } + delete this._textureAtlasDataMap[k]; + } + }; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. + * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature. + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 + * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架。 + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.buildArmature = function (armatureName, dragonBonesName, skinName, textureAtlasName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + if (skinName === void 0) { skinName = ""; } + if (textureAtlasName === void 0) { textureAtlasName = ""; } + var dataPackage = new BuildArmaturePackage(); + if (!this._fillBuildArmaturePackage(dataPackage, dragonBonesName || "", armatureName, skinName || "", textureAtlasName || "")) { + console.warn("No armature data: " + armatureName + ", " + (dragonBonesName !== null ? dragonBonesName : "")); + return null; + } + var armature = this._buildArmature(dataPackage); + this._buildBones(dataPackage, armature); + this._buildSlots(dataPackage, armature); + this._buildConstraints(dataPackage, armature); + armature.invalidUpdate(null, true); + armature.advanceTime(0.0); // Update armature pose. + return armature; + }; + /** + * @private + */ + BaseFactory.prototype.replaceDisplay = function (slot, displayData, displayIndex) { + if (displayIndex === void 0) { displayIndex = -1; } + if (displayIndex < 0) { + displayIndex = slot.displayIndex; + } + if (displayIndex < 0) { + displayIndex = 0; + } + slot.replaceDisplayData(displayData, displayIndex); + if (displayData !== null) { + var display = this._getSlotDisplay(null, displayData, slot); + if (displayData.type === 0 /* Image */) { + var rawDisplayData = slot.getDisplayFrameAt(displayIndex).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.type === 2 /* Mesh */) { + display = slot.meshDisplay; + } + } + slot.replaceDisplay(display, displayIndex); + } + else { + slot.replaceDisplay(null, displayIndex); + } + }; + /** + * - Replaces the current display data for a particular slot with a specific display data. + * Specify display data with "dragonBonesName/armatureName/slotName/displayName". + * @param dragonBonesName - The DragonBonesData instance cache name. + * @param armatureName - The armature data name. + * @param slotName - The slot data name. + * @param displayName - The display data name. + * @param slot - The slot. + * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 + * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @param armatureName - 骨架数据名称。 + * @param slotName - 插槽数据名称。 + * @param displayName - 显示对象数据名称。 + * @param slot - 插槽。 + * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.replaceSlotDisplay = function (dragonBonesName, armatureName, slotName, displayName, slot, displayIndex) { + if (displayIndex === void 0) { displayIndex = -1; } + var armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); + if (armatureData === null || armatureData.defaultSkin === null) { + return false; + } + var displayData = armatureData.defaultSkin.getDisplay(slotName, displayName); + this.replaceDisplay(slot, displayData, displayIndex); + return true; + }; + /** + * @private + */ + BaseFactory.prototype.replaceSlotDisplayList = function (dragonBonesName, armatureName, slotName, slot) { + var armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); + if (!armatureData || !armatureData.defaultSkin) { + return false; + } + var displayDatas = armatureData.defaultSkin.getDisplays(slotName); + if (!displayDatas) { + return false; + } + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + this.replaceDisplay(slot, displayData, i); + } + return true; + }; + /** + * - Share specific skin data with specific armature. + * @param armature - The armature. + * @param skin - The skin data. + * @param isOverride - Whether it completely override the original skin. (Default: false) + * @param exclude - A list of slot names that do not need to be replace. + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 将特定的皮肤数据共享给特定的骨架使用。 + * @param armature - 骨架。 + * @param skin - 皮肤数据。 + * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) + * @param exclude - 不需要被替换的插槽名称列表。 + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language zh_CN + */ + BaseFactory.prototype.replaceSkin = function (armature, skin, isOverride, exclude) { + if (isOverride === void 0) { isOverride = false; } + if (exclude === void 0) { exclude = null; } + var success = false; + var defaultSkin = skin.parent.defaultSkin; + for (var _i = 0, _a = armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + if (exclude !== null && exclude.indexOf(slot.name) >= 0) { + continue; + } + var displayDatas = skin.getDisplays(slot.name); + if (displayDatas === null) { + if (defaultSkin !== null && skin !== defaultSkin) { + displayDatas = defaultSkin.getDisplays(slot.name); + } + if (displayDatas === null) { + if (isOverride) { + slot.displayFrameCount = 0; + } + continue; + } + } + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); + if (displayData !== null) { + slot.replaceDisplay(this._getSlotDisplay(null, displayData, slot), i); + } + else { + slot.replaceDisplay(null, i); + } + } + success = true; + } + return success; + }; + /** + * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. + * This enables you to make a armature template so that other armature without animations can share it's animations. + * @param armature - The armtaure. + * @param armatureData - The armature data. + * @param isOverride - Whether to completely overwrite the original animation. (Default: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 + * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 + * @param armature - 骨架。 + * @param armatureData - 骨架数据。 + * @param isOverride - 是否完全覆盖原来的动画。(默认: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language zh_CN + */ + BaseFactory.prototype.replaceAnimation = function (armature, armatureData, isOverride) { + if (isOverride === void 0) { isOverride = true; } + var skinData = armatureData.defaultSkin; + if (skinData === null) { + return false; + } + if (isOverride) { + armature.animation.animations = armatureData.animations; + } + else { + var rawAnimations = armature.animation.animations; + var animations = {}; + for (var k in rawAnimations) { + animations[k] = rawAnimations[k]; + } + for (var k in armatureData.animations) { + animations[k] = armatureData.animations[k]; + } + armature.animation.animations = animations; + } + for (var _i = 0, _a = armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + var index = 0; + for (var _b = 0, _c = slot.displayList; _b < _c.length; _b++) { + var display = _c[_b]; + if (display instanceof dragonBones.Armature) { + var displayDatas = skinData.getDisplays(slot.name); + if (displayDatas !== null && index < displayDatas.length) { + var displayData = displayDatas[index]; + if (displayData !== null && displayData.type === 1 /* Armature */) { + var childArmatureData = this.getArmatureData(displayData.path, displayData.parent.parent.parent.name); + if (childArmatureData) { + this.replaceAnimation(display, childArmatureData, isOverride); + } + } + } + } + index++; + } + } + return true; + }; + /** + * @private + */ + BaseFactory.prototype.getAllDragonBonesData = function () { + return this._dragonBonesDataMap; + }; + /** + * @private + */ + BaseFactory.prototype.getAllTextureAtlasData = function () { + return this._textureAtlasDataMap; + }; + Object.defineProperty(BaseFactory.prototype, "clock", { + /** + * - An Worldclock instance updated by engine. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 由引擎驱动的 WorldClock 实例。 + * @version DragonBones 5.7 + * @language zh_CN + */ + get: function () { + return this._dragonBones.clock; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseFactory.prototype, "dragonBones", { + /** + * @private + */ + get: function () { + return this._dragonBones; + }, + enumerable: true, + configurable: true + }); + BaseFactory._objectParser = null; + BaseFactory._binaryParser = null; + return BaseFactory; + }()); + dragonBones.BaseFactory = BaseFactory; + /** + * @private + */ + var BuildArmaturePackage = /** @class */ (function () { + function BuildArmaturePackage() { + this.dataName = ""; + this.textureAtlasName = ""; + this.skin = null; + } + return BuildArmaturePackage; + }()); + dragonBones.BuildArmaturePackage = BuildArmaturePackage; +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var util; + (function (util) { + var EventDispatcher = /** @class */ (function (_super) { + __extends(EventDispatcher, _super); + function EventDispatcher() { + return _super !== null && _super.apply(this, arguments) || this; + } + EventDispatcher.prototype.hasDBEventListener = function (type) { + return this.listenerCount(type) > 0; + }; + EventDispatcher.prototype.dispatchDBEvent = function (type, eventObject) { + this.emit(type, eventObject); + }; + EventDispatcher.prototype.addDBEventListener = function (type, listener, thisObject) { + this.on(type, listener, thisObject); + }; + EventDispatcher.prototype.removeDBEventListener = function (type, listener, thisObject) { + this.off(type, listener, thisObject); + }; + return EventDispatcher; + }(Phaser.Events.EventEmitter)); + util.EventDispatcher = EventDispatcher; + })(util = phaser.util || (phaser.util = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var util; + (function (util) { + util.Skew = { + getSkewX: function () { + return this._skewX || 0; + }, + setSkewX: function (v) { + this._skewX = v; + }, + getSkewY: function () { + return this._skewY || 0; + }, + setSkewY: function (v) { + this._skewY = v; + }, + setSkew: function (sx, sy) { + sy = sy === void 0 ? sx : sy; + this._skewX = sx; + this._skewY = sy; + } + }; + util.extendSkew = function (clazz) { + Object.defineProperty(clazz.prototype, "skewX", { + get: util.Skew.getSkewX, + set: util.Skew.setSkewX, + enumerable: true, + configurable: true + }); + Object.defineProperty(clazz.prototype, "skewY", { + get: util.Skew.getSkewY, + set: util.Skew.setSkewY, + enumerable: true, + configurable: true + }); + clazz.prototype.setSkew = util.Skew.setSkew; + }; + })(util = phaser.util || (phaser.util = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var util; + (function (util) { + var TransformMatrix = /** @class */ (function (_super) { + __extends(TransformMatrix, _super); + function TransformMatrix(a, b, c, d, tx, ty) { + var _this = _super.call(this, a, b, c, d, tx, ty) || this; + _this.decomposedMatrix.skewX = 0; + _this.decomposedMatrix.skewY = 0; + return _this; + } + TransformMatrix.prototype.decomposeMatrix = function () { + // sort out rotation / skew.. + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + var skewX = -Math.atan2(-c, d); + var skewY = Math.atan2(b, a); + var delta = Math.abs(skewX + skewY); + if (delta < 0.00001 || Math.abs(Phaser.Math.PI2 - delta) < 0.00001) { + this.decomposedMatrix.rotation = skewY; + if (a < 0 && d >= 0) + this.decomposedMatrix.rotation += (this.decomposedMatrix.rotation <= 0) ? Math.PI : -Math.PI; + this.decomposedMatrix.skewX = this.decomposedMatrix.skewY = 0; + } + else { + this.decomposedMatrix.rotation = 0; + this.decomposedMatrix.skewX = skewX; + this.decomposedMatrix.skewY = skewY; + } + // next set scale + this.decomposedMatrix.scaleX = Math.sqrt((a * a) + (b * b)); + this.decomposedMatrix.scaleY = Math.sqrt((c * c) + (d * d)); + // next set position + this.decomposedMatrix.translateX = this.tx; + this.decomposedMatrix.translateY = this.ty; + return this.decomposedMatrix; + }; + TransformMatrix.prototype.applyITRSC = function (x, y, rotation, scaleX, scaleY, skewX, skewY) { + this.a = Math.cos(rotation - skewY) * scaleX; + this.b = Math.sin(rotation - skewY) * scaleX; + this.c = -Math.sin(rotation + skewX) * scaleY; + this.d = Math.cos(rotation + skewX) * scaleY; + this.tx = x; + this.ty = y; + return this; + }; + Object.defineProperty(TransformMatrix.prototype, "skewX", { + get: function () { + return -Math.atan2(-this.c, this.d); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransformMatrix.prototype, "skewY", { + get: function () { + return Math.atan2(this.b, this.a); + }, + enumerable: true, + configurable: true + }); + return TransformMatrix; + }(Phaser.GameObjects.Components.TransformMatrix)); + util.TransformMatrix = TransformMatrix; + })(util = phaser.util || (phaser.util = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + // this class will be refactored due to official Container will be removed soon. + var DisplayContainer = /** @class */ (function (_super) { + __extends(DisplayContainer, _super); + function DisplayContainer(scene, x, y, children) { + var _this = _super.call(this, scene, x, y, children) || this; + _this._skewX = 0; + _this._skewY = 0; + _this.tempTransformMatrix = new phaser.util.TransformMatrix(); + return _this; + } + DisplayContainer.prototype.pointToContainer = function (source, output) { + if (output === undefined) + output = new Phaser.Math.Vector2(); + if (this.parentContainer) + return this.parentContainer.pointToContainer(source, output); + var tempMatrix = this.tempTransformMatrix; + // No need to loadIdentity because applyITRSC overwrites every value anyway + tempMatrix.applyITRSC(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this._skewX, this._skewY); + tempMatrix.invert(); + tempMatrix.transformPoint(source.x, source.y, output); + return output; + }; + Object.defineProperty(DisplayContainer.prototype, "skewX", { + get: function () { + return this._skewX; + }, + set: function (v) { + this._skewX = v; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DisplayContainer.prototype, "skewY", { + get: function () { + return this._skewY; + }, + set: function (v) { + this._skewY = v; + }, + enumerable: true, + configurable: true + }); + DisplayContainer.prototype.setSkew = function (sx, sy) { + sy = sy === void 0 ? sx : sy; + this.skewX = sx; + this.skewY = sy; + return this; + }; + return DisplayContainer; + }(Phaser.GameObjects.Container)); + display.DisplayContainer = DisplayContainer; + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + var ArmatureDisplay = /** @class */ (function (_super) { + __extends(ArmatureDisplay, _super); + function ArmatureDisplay(scene) { + var _this = _super.call(this, scene) || this; + _this.debugDraw = false; + return _this; + } + ArmatureDisplay.prototype.dbInit = function (armature) { + this._armature = armature; + }; + ArmatureDisplay.prototype.dbClear = function () { + this.removeAllListeners(); + if (this._armature) + this._armature.dispose(); + this._armature = null; + }; + ArmatureDisplay.prototype.dbUpdate = function () { + // TODO: draw debug graphics + if (this.debugDraw) { + } + }; + ArmatureDisplay.prototype.dispose = function (disposeProxy) { + this.dbClear(); + if (disposeProxy === true) + _super.prototype.destroy.call(this); + }; + ArmatureDisplay.prototype.destroy = function () { + this.dispose(true); + }; + ArmatureDisplay.prototype.dispatchDBEvent = function (type, eventObject) { + this.emit(type, eventObject); + }; + ArmatureDisplay.prototype.hasDBEventListener = function (type) { + return this.listenerCount(type) > 0; + }; + ArmatureDisplay.prototype.addDBEventListener = function (type, listener, scope) { + this.on(type, listener, scope); + }; + ArmatureDisplay.prototype.removeDBEventListener = function (type, listener, scope) { + this.off(type, listener, scope); + }; + Object.defineProperty(ArmatureDisplay.prototype, "armature", { + get: function () { + return this._armature; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ArmatureDisplay.prototype, "animation", { + get: function () { + return this._armature.animation; + }, + enumerable: true, + configurable: true + }); + return ArmatureDisplay; + }(display.DisplayContainer)); + display.ArmatureDisplay = ArmatureDisplay; + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + var SlotImage = /** @class */ (function (_super) { + __extends(SlotImage, _super); + function SlotImage(scene, x, y, texture, frame) { + var _this = _super.call(this, scene, x, y, texture, frame) || this; + _this.setPipeline("PhaserTextureTintPipeline"); // use customized pipeline + return _this; + } + return SlotImage; + }(Phaser.GameObjects.Image)); + display.SlotImage = SlotImage; + phaser.util.extendSkew(SlotImage); // skew mixin + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + var SlotSprite = /** @class */ (function (_super) { + __extends(SlotSprite, _super); + function SlotSprite(scene, x, y, texture, frame) { + var _this = _super.call(this, scene, x, y, texture, frame) || this; + _this.setPipeline("PhaserTextureTintPipeline"); // use customized pipeline + return _this; + } + return SlotSprite; + }(Phaser.GameObjects.Sprite)); + display.SlotSprite = SlotSprite; + phaser.util.extendSkew(SlotSprite); // skew mixin + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + var Slot = /** @class */ (function (_super) { + __extends(Slot, _super); + function Slot() { + return _super !== null && _super.apply(this, arguments) || this; + } + Slot.toString = function () { + return "[class dragonBones.PhaserSlot]"; + }; + Slot.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._textureScale = 1.0; + if (this._renderDisplay) { + this._renderDisplay.destroy(); + this._renderDisplay = null; + } + }; + Slot.prototype._initDisplay = function (rawDisplay, isRetain) { + }; + Slot.prototype._disposeDisplay = function (prevDisplay, isRelease) { + // do nothing here, prevDisplay normally is an user customized GameObject set for this slot, so user need to destroy it manually. + }; + Slot.prototype._onUpdateDisplay = function () { + this._renderDisplay = this._display || this._rawDisplay; + }; + // Phaser will soone remove the functionality of nested container, so here we need to look for an alternative solution for display.add(childArmatureDisplay) + Slot.prototype._addDisplay = function () { + this.armature.display.add(this._renderDisplay); + }; + Slot.prototype._replaceDisplay = function (prevDisplay) { + if (!this._renderDisplay["setSkew"]) { + console.warn("please call dragonBones.phaser.util.extendSkew to mix skew component into your display object,\n and set its pipeline to 'PhaserTextureTintPipeline' by calling 'setPiepline' method, more detail please refer to the 'ReplaceSlotDisplay.ts' example"); + return; + } + this.armature.display.replace(prevDisplay, this._renderDisplay); + this._renderDisplay.parentContainer = this.armature.display; + }; + Slot.prototype._removeDisplay = function () { + // can't use this._armature.display.remove here, perphaps this._renderDisplay is a child of armature. + this._renderDisplay.parentContainer.remove(this._renderDisplay); + }; + Slot.prototype._updateZOrder = function () { + if (this._renderDisplay.depth === this._zOrder) + return; + this._renderDisplay.setDepth(this._zOrder); + }; + Slot.prototype._updateVisible = function () { + this._renderDisplay.setVisible(this._parent.visible && this._visible); + }; + Slot.prototype._updateBlendMode = function () { + var mode = Phaser.BlendModes.NORMAL; + switch (this._blendMode) { + case 0 /* Normal */: + mode = Phaser.BlendModes.NORMAL; + break; + case 1 /* Add */: + mode = Phaser.BlendModes.ADD; + break; + case 3 /* Darken */: + mode = Phaser.BlendModes.DARKEN; + break; + case 4 /* Difference */: + mode = Phaser.BlendModes.DIFFERENCE; + break; + case 6 /* HardLight */: + mode = Phaser.BlendModes.HARD_LIGHT; + break; + case 9 /* Lighten */: + mode = Phaser.BlendModes.LIGHTEN; + break; + case 10 /* Multiply */: + mode = Phaser.BlendModes.MULTIPLY; + break; + case 11 /* Overlay */: + mode = Phaser.BlendModes.OVERLAY; + break; + case 12 /* Screen */: + mode = Phaser.BlendModes.SCREEN; + break; + default: + break; + } + this._renderDisplay.setBlendMode(mode); + }; + Slot.prototype._updateColor = function () { + var c = this._colorTransform; + var a = this._globalAlpha * c.alphaMultiplier + c.alphaOffset; + this._renderDisplay.setAlpha(a); + if (this._renderDisplay instanceof display.DisplayContainer) + return; + var r = 0xff * c.redMultiplier + c.redOffset; + var g = 0xff * c.greenMultiplier + c.greenOffset; + var b = 0xff * c.blueMultiplier + c.blueOffset; + var rgb = (r << 16) | (g << 8) | b; + this._renderDisplay.setTint(rgb); + }; + Slot.prototype._updateFrame = function () { + if (this._renderDisplay instanceof display.DisplayContainer) + return; + var currentTextureData = this._textureData; + if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) { + var currentTextureAtlasData = currentTextureData.parent; + if (this.armature.replacedTexture !== null) { // Update replaced texture atlas. + if (this.armature._replaceTextureAtlasData === null) { + currentTextureAtlasData = dragonBones.BaseObject.borrowObject(display.TextureAtlasData); + currentTextureAtlasData.copyFrom(currentTextureData.parent); + currentTextureAtlasData.renderTexture = this.armature.replacedTexture; + this.armature._replaceTextureAtlasData = currentTextureAtlasData; + } + else + currentTextureAtlasData = this.armature._replaceTextureAtlasData; + currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name); + } + var frame = currentTextureData.renderTexture; + if (frame !== null) { + if (this._geometryData !== null) { // Mesh. + // ignored, Phaser currently does not support mesh.indices + } + else { // normal texture. + this._renderDisplay.texture = frame.texture; + this._renderDisplay.frame = frame; + this._renderDisplay.setDisplayOrigin(this._pivotX, this._pivotY); + this._textureScale = currentTextureData.parent.scale * this.armature.armatureData.scale; + this._renderDisplay.setScale(this._textureScale); + } + this._visibleDirty = true; + return; + } + } + else { + this._renderDisplay.x = 0.0; + this._renderDisplay.y = 0.0; + this._renderDisplay.setTexture(undefined); + } + }; + Slot.prototype._updateMesh = function () { + // ignored, Phaser currently does not support mesh.indices + }; + Slot.prototype._updateTransform = function () { + this.updateGlobalTransform(); + var transform = this.global; + this._renderDisplay.x = transform.x; // No need to calcuate pivot offset manually here as Phaser.GameObjects.GameObject takes that into account already. + this._renderDisplay.y = transform.y; + this._renderDisplay.rotation = transform.rotation; + this._renderDisplay["setSkew"](transform.skew, 0); + this._renderDisplay.setScale(transform.scaleX * this._textureScale, transform.scaleY * this._textureScale); + }; + Slot.prototype._identityTransform = function () { + this._renderDisplay.setPosition(); + this._renderDisplay.setRotation(); + this._textureScale = 1.0; + this._renderDisplay.setScale(this._textureScale); + this._renderDisplay["setSkew"](0); + }; + return Slot; + }(dragonBones.Slot)); + display.Slot = Slot; + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var display; + (function (display) { + var TextureAtlasData = /** @class */ (function (_super) { + __extends(TextureAtlasData, _super); + function TextureAtlasData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._renderTexture = null; + return _this; + } + TextureAtlasData.toString = function () { + return "[class dragonBones.PhaserTextureAtlasData]"; + }; + TextureAtlasData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this._renderTexture !== null) + this._renderTexture.destroy(); + this._renderTexture = null; + }; + TextureAtlasData.prototype.createTexture = function () { + return dragonBones.BaseObject.borrowObject(TextureData); + }; + Object.defineProperty(TextureAtlasData.prototype, "renderTexture", { + get: function () { + return this._renderTexture; + }, + // TODO: test set value runtime + set: function (value) { + if (!value || this._renderTexture === value) + return; + if (this._renderTexture) + this._renderTexture.destroy(); + this._renderTexture = value; + for (var k in this.textures) { + var data = this.textures[k]; + var frame = this._renderTexture.add(k, 0, // all textures were added through `textures.addImage`, so their sourceIndex are all 0 + data.region.x, data.region.y, data.region.width, data.region.height); + if (data.rotated) { + frame.rotated = true; + frame.updateUVsInverted(); + } + data.renderTexture = frame; + } + }, + enumerable: true, + configurable: true + }); + return TextureAtlasData; + }(dragonBones.TextureAtlasData)); + display.TextureAtlasData = TextureAtlasData; + var TextureData = /** @class */ (function (_super) { + __extends(TextureData, _super); + function TextureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.renderTexture = null; // Initial value. + return _this; + } + TextureData.toString = function () { + return "[class dragonBones.PhaserTextureData]"; + }; + TextureData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this.renderTexture !== null) + this.renderTexture.destroy(); + this.renderTexture = null; + }; + return TextureData; + }(dragonBones.TextureData)); + display.TextureData = TextureData; + })(display = phaser.display || (phaser.display = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var pipeline; + (function (pipeline) { + var TextureTintPipeline = /** @class */ (function (_super) { + __extends(TextureTintPipeline, _super); + function TextureTintPipeline(config) { + var _this = _super.call(this, config) || this; + _this._tempMatrix1 = new phaser.util.TransformMatrix(); + _this._tempMatrix2 = new phaser.util.TransformMatrix(); + _this._tempMatrix3 = new phaser.util.TransformMatrix(); + return _this; + } + TextureTintPipeline.prototype.batchSprite = function (sprite, camera, parentTransformMatrix) { + this.renderer.setPipeline(this); + var camMatrix = this._tempMatrix1; + var spriteMatrix = this._tempMatrix2; + var calcMatrix = this._tempMatrix3; + var frame = sprite.frame; + var texture = frame.glTexture; + var u0 = frame.u0; + var v0 = frame.v0; + var u1 = frame.u1; + var v1 = frame.v1; + var frameX = frame.x; + var frameY = frame.y; + var frameWidth = frame.width; + var frameHeight = frame.height; + var x = -sprite.displayOriginX + frameX; + var y = -sprite.displayOriginY + frameY; + if (sprite.isCropped) { + var crop = sprite["_crop"]; + if (crop.flipX !== sprite.flipX || crop.flipY !== sprite.flipY) + frame.updateCropUVs(crop, sprite.flipX, sprite.flipY); + u0 = crop.u0; + v0 = crop.v0; + u1 = crop.u1; + v1 = crop.v1; + frameWidth = crop.width; + frameHeight = crop.height; + frameX = crop.x; + frameY = crop.y; + x = -sprite.displayOriginX + frameX; + y = -sprite.displayOriginY + frameY; + } + if (sprite.flipX) { + x += frameWidth; + frameWidth *= -1; + } + if (sprite.flipY) { + y += frameHeight; + frameHeight *= -1; + } + var xw = x + frameWidth; + var yh = y + frameHeight; + spriteMatrix.applyITRSC(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY, sprite["skewX"] || 0, sprite["skewY"] || 0); + camMatrix.copyFrom(camera["matrix"]); + if (parentTransformMatrix) { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * sprite.scrollFactorX, -camera.scrollY * sprite.scrollFactorY); + // Undo the camera scroll + spriteMatrix.e = sprite.x; + spriteMatrix.f = sprite.y; + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else { + spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX; + spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY; + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + var tintTL = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintTL"], camera.alpha * sprite["_alphaTL"]); + var tintTR = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintTR"], camera.alpha * sprite["_alphaTR"]); + var tintBL = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintBL"], camera.alpha * sprite["_alphaBL"]); + var tintBR = Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(sprite["_tintBR"], camera.alpha * sprite["_alphaBR"]); + if (camera.roundPixels) { + tx0 |= 0; + ty0 |= 0; + tx1 |= 0; + ty1 |= 0; + tx2 |= 0; + ty2 |= 0; + tx3 |= 0; + ty3 |= 0; + } + this.setTexture2D(texture, 0); + var tintEffect = (sprite["_isTinted"] && sprite.tintFill); + this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); + }; + return TextureTintPipeline; + }(Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline)); + pipeline.TextureTintPipeline = TextureTintPipeline; + })(pipeline = phaser.pipeline || (phaser.pipeline = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var plugin; + (function (plugin) { + plugin.FileTypes = { + IMAGE: "imageFile", + JSON: "jsonFile", + BINARY: "binaryFile", + map: { + imageFile: Phaser.Loader.FileTypes.ImageFile, + jsonFile: Phaser.Loader.FileTypes.JSONFile, + binaryFile: Phaser.Loader.FileTypes.BinaryFile + }, + setType: function (type, clazz) { + plugin.FileTypes.map[type] = clazz; + }, + getType: function (type) { + return plugin.FileTypes.map[type]; + } + }; + })(plugin = phaser.plugin || (phaser.plugin = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones) { + var phaser; + (function (phaser) { + var plugin; + (function (plugin) { + var DragonBonesFile = /** @class */ (function (_super) { + __extends(DragonBonesFile, _super); + function DragonBonesFile(loader, key, textureURL, atlasURL, boneURL, textureXhrSettings, atlasXhrSettings, boneXhrSettings) { + var _this = this; + var image; + var data; + var boneData; + var keyName; + var binFileType = plugin.FileTypes.getType(plugin.FileTypes.BINARY); + var jsonFileType = plugin.FileTypes.getType(plugin.FileTypes.JSON); + var imageFileType = plugin.FileTypes.getType(plugin.FileTypes.IMAGE); + var createBoneFileByType = function (loader, key, boneURL, boneXhrSettings) { + var type = "json"; + if (boneXhrSettings && boneXhrSettings.responseType) { + switch (boneXhrSettings.responseType) { + case "arraybuffer": + case "blob": + type = "bin"; + break; + case "json": + case "text": + type = "json"; + break; + } + } + return type === "bin" ? + new binFileType(loader, key, boneURL, boneXhrSettings) : + new jsonFileType(loader, key, boneURL, boneXhrSettings); + }; + if (Phaser.Utils.Objects.IsPlainObject(key)) { + // key is actually a config object + var config = key; + keyName = Phaser.Utils.Objects.GetFastValue(config, 'key'); + image = new imageFileType(loader, { + key: keyName, + url: Phaser.Utils.Objects.GetFastValue(config, 'textureURL'), + extension: Phaser.Utils.Objects.GetFastValue(config, 'textureExtension', 'png'), + xhrSettings: Phaser.Utils.Objects.GetFastValue(config, 'textureXhrSettings') + }); + data = new jsonFileType(loader, { + key: keyName + "_atlasjson", + url: Phaser.Utils.Objects.GetFastValue(config, 'atlasURL'), + extension: Phaser.Utils.Objects.GetFastValue(config, 'atlasExtension', 'json'), + xhrSettings: Phaser.Utils.Objects.GetFastValue(config, 'atlasXhrSettings') + }); + boneData = createBoneFileByType(loader, keyName, Phaser.Utils.Objects.GetFastValue(config, 'boneURL'), Phaser.Utils.Objects.GetFastValue(config, 'boneXhrSettings')); + } + else { + keyName = key; + image = new imageFileType(loader, keyName, textureURL, textureXhrSettings); + data = new jsonFileType(loader, keyName + "_atlasjson", atlasURL, atlasXhrSettings); + boneData = createBoneFileByType(loader, keyName, boneURL, boneXhrSettings); + } + boneData.cache = loader["cacheManager"].custom.dragonbone; + _this = _super.call(this, loader, 'dragonbone', keyName, [image, data, boneData]) || this; + return _this; + } + DragonBonesFile.prototype.addToCache = function () { + if (this.isReadyToProcess()) { + var image = this.files[0]; + var json = this.files[1]; + var bone = this.files[2]; + json.addToCache(); + bone.addToCache(); + image.addToCache(); + this.complete = true; + } + }; + return DragonBonesFile; + }(Phaser.Loader.MultiFile)); + plugin.DragonBonesFile = DragonBonesFile; + })(plugin = phaser.plugin || (phaser.plugin = {})); + })(phaser = dragonBones.phaser || (dragonBones.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones_2) { + var phaser; + (function (phaser) { + var plugin; + (function (plugin) { + var DragonBonesScenePlugin = /** @class */ (function (_super) { + __extends(DragonBonesScenePlugin, _super); + function DragonBonesScenePlugin(scene, pluginManager) { + var _this = _super.call(this, scene, pluginManager) || this; + var game = _this.game; + // bone data store + game.cache.addCustom("dragonbone"); + if (_this.game.config.renderType === Phaser.WEBGL) { + var renderer = _this.game.renderer; + if (!renderer.hasPipeline('PhaserTextureTintPipeline')) + renderer.addPipeline('PhaserTextureTintPipeline', new phaser.pipeline.TextureTintPipeline({ game: game, renderer: renderer })); + } + // Add dragonBones only + pluginManager.registerGameObject("dragonBones", CreateDragonBonesRegisterHandler); + // Add armature, this will add dragonBones when not exist + pluginManager.registerGameObject("armature", CreateArmatureRegisterHandler); + pluginManager.registerFileType("dragonbone", DragonBoneFileRegisterHandler, scene); + return _this; + } + DragonBonesScenePlugin.prototype.createArmature = function (armature, dragonBones, skinName, atlasTextureName, textureScale) { + if (textureScale === void 0) { textureScale = 1.0; } + var display = this.factory.buildArmatureDisplay(armature, dragonBones, skinName, atlasTextureName, textureScale); + this.systems.displayList.add(display); + // use db.clock instead, if here we just use this.systems.updateList.add(display), that will cause the db event is dispatched with 1 or more frames delay + this._dbInst.clock.add(display.armature); + return display; + }; + DragonBonesScenePlugin.prototype.createDragonBones = function (dragonBonesName, textureScale) { + if (textureScale === void 0) { textureScale = 1.0; } + return this.factory.buildDragonBonesData(dragonBonesName, textureScale); + }; + Object.defineProperty(DragonBonesScenePlugin.prototype, "factory", { + get: function () { + if (!this._factory) { + this._dbInst = new dragonBones.DragonBones(new phaser.util.EventDispatcher()); + this._factory = new phaser.Factory(this._dbInst, this.scene); + } + return this._factory; + }, + enumerable: true, + configurable: true + }); + /* + * Slot has a default display, usually it is a transparent image, here you could create a display whatever you want as the default one which - + * has both skewX / skewY attributes and use "PhaserTextureTintPipeline" to render itself, or simply just use SlotImage or SlotSprite. + */ + DragonBonesScenePlugin.prototype.createSlotDisplayPlaceholder = function () { + return new phaser.display.SlotImage(this.scene, 0, 0); + }; + DragonBonesScenePlugin.prototype.boot = function () { + this.systems.events.once('destroy', this.destroy, this); + this.start(); + }; + DragonBonesScenePlugin.prototype.start = function () { + var ee = this.systems.events; + ee.on('update', this.update, this); + ee.once('shutdown', this.shutdown, this); + }; + DragonBonesScenePlugin.prototype.update = function (time, delta) { + this._dbInst && this._dbInst.advanceTime(delta * 0.001); + }; + DragonBonesScenePlugin.prototype.shutdown = function () { + var ee = this.systems.events; + ee.off('update', this.update, this); + ee.off('shutdown', this.shutdown, this); + }; + DragonBonesScenePlugin.prototype.destroy = function () { + this.shutdown(); + this._factory = + this._dbInst = null; + this.pluginManager = + this.game = + this.scene = + this.systems = null; + }; + return DragonBonesScenePlugin; + }(Phaser.Plugins.ScenePlugin)); + plugin.DragonBonesScenePlugin = DragonBonesScenePlugin; + var CreateDragonBonesRegisterHandler = function (dragonBonesName, textureScale) { + if (textureScale === void 0) { textureScale = 1.0; } + return this.scene.dragonbone.createDragonBones(dragonBonesName, textureScale); + }; + var CreateArmatureRegisterHandler = function (armature, dragonBones, skinName, atlasTextureName) { + return this.scene.dragonbone.createArmature(armature, dragonBones, skinName, atlasTextureName); + }; + var DragonBoneFileRegisterHandler = function (dragonbonesName, textureURL, atlasURL, boneURL, textureXhrSettings, atlasXhrSettings, boneXhrSettings) { + var multifile = new plugin.DragonBonesFile(this, dragonbonesName, textureURL, atlasURL, boneURL, textureXhrSettings, atlasXhrSettings, boneXhrSettings); + this.addFile(multifile.files); + return this; + }; + })(plugin = phaser.plugin || (phaser.plugin = {})); + })(phaser = dragonBones_2.phaser || (dragonBones_2.phaser = {})); +})(dragonBones || (dragonBones = {})); +var dragonBones; +(function (dragonBones_3) { + var phaser; + (function (phaser) { + var Factory = /** @class */ (function (_super) { + __extends(Factory, _super); + function Factory(dragonBones, scene, dataParser) { + var _this = _super.call(this, dataParser) || this; + _this._scene = scene; + _this._dragonBones = dragonBones; + return _this; + } + Factory.prototype._isSupportMesh = function () { + console.warn("Mesh is not supported yet"); + return false; + }; + Factory.prototype._buildTextureAtlasData = function (textureAtlasData, textureAtlas) { + if (textureAtlasData) { + textureAtlasData.renderTexture = textureAtlas; + } + else + textureAtlasData = dragonBones_3.BaseObject.borrowObject(phaser.display.TextureAtlasData); + return textureAtlasData; + }; + Factory.prototype._buildArmature = function (dataPackage) { + var armature = dragonBones_3.BaseObject.borrowObject(dragonBones_3.Armature); + var armatureDisplay = new phaser.display.ArmatureDisplay(this._scene); + armature.init(dataPackage.armature, armatureDisplay, armatureDisplay, this._dragonBones); + return armature; + }; + Factory.prototype._buildSlot = function (dataPackage, slotData, armature) { + var slot = dragonBones_3.BaseObject.borrowObject(phaser.display.Slot); + var rawDisplay = this._scene.dragonbone.createSlotDisplayPlaceholder(); + var meshDisplay = rawDisplay; // TODO: meshDisplay is not supported yet + slot.init(slotData, armature, rawDisplay, meshDisplay); + return slot; + }; + // dragonBonesName must be assigned, or can't find in cache inside + Factory.prototype.buildArmatureDisplay = function (armatureName, dragonBonesName, skinName, textureAtlasName, textureScale) { + if (skinName === void 0) { skinName = ""; } + if (textureAtlasName === void 0) { textureAtlasName = ""; } + if (textureScale === void 0) { textureScale = 1.0; } + var armature; + if (this.buildDragonBonesData(dragonBonesName, textureScale)) { + armature = this.buildArmature(armatureName, dragonBonesName, skinName, textureAtlasName); + } + return armature.display; + }; + Factory.prototype.buildDragonBonesData = function (dragonBonesName, textureScale) { + if (textureScale === void 0) { textureScale = 1.0; } + var data = this._dragonBonesDataMap[dragonBonesName]; + if (!data) { + var cache = this._scene.cache; + var boneRawData = cache.custom.dragonbone.get(dragonBonesName); + if (boneRawData) { + // parse raw data and add to cache map + data = this.parseDragonBonesData(boneRawData, dragonBonesName, textureScale); + var texture = this._scene.textures.get(dragonBonesName); + var json = cache.json.get(dragonBonesName + "_atlasjson"); + this.parseTextureAtlasData(json, texture, texture.key, textureScale); + } + } + return data; + }; + return Factory; + }(dragonBones_3.BaseFactory)); + phaser.Factory = Factory; + })(phaser = dragonBones_3.phaser || (dragonBones_3.phaser = {})); +})(dragonBones || (dragonBones = {})); diff --git a/Phaser/Demos/libs/dragonBones/dragonBones.min.js b/Phaser/Demos/libs/dragonBones/dragonBones.min.js new file mode 100644 index 00000000..0949ed4e --- /dev/null +++ b/Phaser/Demos/libs/dragonBones/dragonBones.min.js @@ -0,0 +1 @@ +"use strict";var __extends=this&&this.__extends||function(){var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(t,e){r(t,e);function a(){this.constructor=t}t.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}();var dragonBones;(function(o){var t=function(){function e(t){this._clock=new o.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=t;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(t){if(this._objects.length>0){for(var e=0,a=this._objects;e0){for(var i=0;ie){r.length=e}n._maxCountMap[a]=e}else{n._defaultMaxCount=e;for(var a in n._poolsMap){var r=n._poolsMap[a];if(r.length>e){r.length=e}if(a in n._maxCountMap){n._maxCountMap[a]=e}}}};n.clearPool=function(t){if(t===void 0){t=null}if(t!==null){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){a.length=0}}else{for(var r in n._poolsMap){var a=n._poolsMap[r];a.length=0}}};n.borrowObject=function(t){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){var r=a.pop();r._isInPool=false;return r}var i=new t;i._onClear();return i};n.prototype.returnToPool=function(){this._onClear();n._returnObject(this)};n._hashCode=0;n._defaultMaxCount=3e3;n._maxCountMap={};n._poolsMap={};return n}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var u=l+t.width;var f=h+t.height;var _=a*l+i*h+s;var p=r*l+n*h+o;var c=a*u+i*h+s;var m=r*u+n*h+o;var d=a*u+i*f+s;var y=r*u+n*f+o;var v=a*l+i*f+s;var g=r*l+n*f+o;var D=0;if(_>c){D=_;_=c;c=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_v?c:v)-t.x);if(p>m){D=p;p=m;m=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(pg?m:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function n(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}n.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};n.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};n.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};n.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};n.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};n.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};n.prototype.fromMatrix=function(t){var e=this.scaleX,a=this.scaleY;var r=n.PI_Q;this.x=t.tx;this.y=t.ty;this.rotation=Math.atan(t.b/t.a);var i=Math.atan(-t.c/t.d);this.scaleX=this.rotation>-r&&this.rotation-r&&i=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(a>=0&&this.scaleY<0){this.scaleY=-this.scaleY;i=i-Math.PI}this.skew=i-this.rotation;return this};n.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};n.PI=Math.PI;n.PI_D=Math.PI*2;n.PI_H=Math.PI/2;n.PI_Q=Math.PI/4;n.RAD_DEG=180/Math.PI;n.DEG_RAD=Math.PI/180;return n}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.ints=[];t.floats=[];t.strings=[];return t}t.toString=function(){return"[class dragonBones.UserData]"};t.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};t.prototype.addInt=function(t){this.ints.push(t)};t.prototype.addFloat=function(t){this.floats.push(t)};t.prototype.addString=function(t){this.strings.push(t)};t.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};t.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};t.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};t.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};t.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};t.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};t.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};t.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};t.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};t.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};t.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};t.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};t.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};t.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};t.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};t.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return t}(a.BaseObject);a.ArmatureData=t;var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.transform=new a.Transform;t.userData=null;return t}t.toString=function(){return"[class dragonBones.BoneData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return t}(a.BaseObject);a.BoneData=e;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.geometry=new a.GeometryData;return t}t.toString=function(){return"[class dragonBones.SurfaceData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return t}(e);a.SurfaceData=r;var i=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}t.createColor=function(){return new a.ColorTransform};t.toString=function(){return"[class dragonBones.SlotData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.zIndex=0;this.alpha=1;this.name="";this.color=null;this.userData=null;this.parent=null};t.DEFAULT_COLOR=new a.ColorTransform;return t}(a.BaseObject);a.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.order=0;this.name="";this.type=0;this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.scaleEnabled=false;this.bendPositive=false;this.weight=1};return e}(e);t.IKConstraintData=a;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.bones=[];return t}t.toString=function(){return"[class dragonBones.PathConstraintData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.pathSlot=null;this.pathDisplayData=null;this.bones.length=0;this.positionMode=0;this.spacingMode=1;this.rotateMode=1;this.position=0;this.spacing=0;this.rotateOffset=0;this.rotateMix=0;this.translateMix=0};t.prototype.AddBone=function(t){this.bones.push(t)};return t}(e);t.PathConstraintData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.displays={};return t}t.toString=function(){return"[class dragonBones.SkinData]"};t.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};D.rectangleIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=t>i&&tn&&ei&&an&&r=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};D.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=this.width*.5;var l=this.height*.5;var h=D.rectangleIntersectsSegment(t,e,a,r,-o,-l,o,l,i,n,s);return h};return D}(e);t.RectangleBoundingBoxData=h;var a=function(t){__extends(l,t);function l(){return t!==null&&t.apply(this,arguments)||this}l.toString=function(){return"[class dragonBones.EllipseData]"};l.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=s/o;var _=f*f;e*=f;r*=f;var p=a-t;var c=r-e;var m=Math.sqrt(p*p+c*c);var d=p/m;var y=c/m;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var T=s*s;var b=T-D+g;var A=0;if(b>=0){var P=Math.sqrt(b);var S=v-P;var O=v+P;var x=S<0?-1:S<=m?0:1;var B=O<0?-1:O<=m?0:1;var M=x*B;if(M<0){return-1}else if(M===0){if(x===-1){A=2;a=t+O*d;r=(e+O*y)/f;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,a/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*y)/f;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.x=Math.atan2(e/T*_,t/T);u.y=u.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+O*d;h.y=(e+O*y)/f;if(u!==null){u.y=Math.atan2(h.y/T*_,h.x/T)}}}}}return A};l.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};l.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};l.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=l.ellipseIntersectsSegment(t,e,a,r,0,0,this.width*.5,this.height*.5,i,n,s);return o};return l}(e);t.EllipseBoundingBoxData=a;var r=function(e){__extends(l,e);function l(){var t=e!==null&&e.apply(this,arguments)||this;t.vertices=[];return t}l.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};l.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var u=e-r;var f=t*r-e*a;var _=0;var p=i[l-2];var c=i[l-1];var m=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var T=0;T=p&&B<=b||B>=b&&B<=p)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var M=(f*S-u*O)/x;if((M>=c&&M<=A||M>=A&&M<=c)&&(u===0||M>=e&&M<=r||M>=r&&M<=e)){if(s!==null){var E=B-t;if(E<0){E=-E}if(_===0){m=E;d=E;y=B;v=M;g=B;D=M;if(o!==null){o.x=Math.atan2(A-c,b-p)-Math.PI*.5;o.y=o.x}}else{if(Ed){d=E;g=B;D=M;if(o!==null){o.y=Math.atan2(A-c,b-p)-Math.PI*.5}}}_++}else{y=B;v=M;g=B;D=M;_++;if(o!==null){o.x=Math.atan2(A-c,b-p)-Math.PI*.5;o.y=o.x}break}}}p=b;c=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};l.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};l.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;ae._zIndex*1e3+e._zOrder?1:-1};y.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};y.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};y.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};y.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};y.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};y.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};y.prototype.init=function(t,e,a,r){if(this._armatureData!==null){return}this._armatureData=t;this._animation=i.BaseObject.borrowObject(i.Animation);this._proxy=e;this._display=a;this._dragonBones=r;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};y.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty||this._zIndexDirty){this._slots.sort(y._onSortSlots);if(this._zIndexDirty){for(var a=0,r=this._slots.length;a0){for(var u=0,f=this._actions;u0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var b=o?i.y-e:i.x-t;if(b<0){b=-b}if(d===null||bh){h=b;_=n.x;p=n.y;y=D;if(s!==null){m=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=u;i.y=f;if(s!==null){s.x=c}}if(y!==null&&n!==null){n.x=_;n.y=p;if(s!==null){s.y=m}}return d};y.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};t.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};t.prototype.invalidUpdate=function(){this._transformDirty=true};t.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(t.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=a){return this.globalTransformMatrix}i=e>this._kX*(t+a)+m;p=((s*o+s+o+o+_)*2+(i?1:0))*7;if(d[p]>0){y.copyFromArray(d,p+1)}else{var v=_*(l+2);var g=this._hullCache[4];var D=this._hullCache[5];var T=this._hullCache[2]-(o-_)*g;var b=this._hullCache[3]-(o-_)*D;var A=this._vertices;if(i){this._getAffineTransform(-a,m+u,r-a,u,A[v+l+2],A[v+l+3],T+g,b+D,A[v],A[v+1],P._helpTransform,y,true)}else{this._getAffineTransform(-r,m,r-a,u,T,b,A[v],A[v+1],T+g,b+D,P._helpTransform,y,false)}d[p]=1;d[p+1]=y.a;d[p+2]=y.b;d[p+3]=y.c;d[p+4]=y.d;d[p+5]=y.tx;d[p+6]=y.ty}}else if(t>=a){if(e<-a||e>=a){return this.globalTransformMatrix}i=e>this._kX*(t-r)+m;p=((s*o+s+_)*2+(i?1:0))*7;if(d[p]>0){y.copyFromArray(d,p+1)}else{var v=(_+1)*(l+2)-2;var g=this._hullCache[4];var D=this._hullCache[5];var T=this._hullCache[0]+_*g;var b=this._hullCache[1]+_*D;var A=this._vertices;if(i){this._getAffineTransform(r,m+u,r-a,u,T+g,b+D,A[v+l+2],A[v+l+3],T,b,P._helpTransform,y,true)}else{this._getAffineTransform(a,m,r-a,u,A[v],A[v+1],T,b,A[v+l+2],A[v+l+3],P._helpTransform,y,false)}d[p]=1;d[p+1]=y.a;d[p+2]=y.b;d[p+3]=y.c;d[p+4]=y.d;d[p+5]=y.tx;d[p+6]=y.ty}}else if(e<-a){if(t<-a||t>=a){return this.globalTransformMatrix}i=e>this._kY*(t-c-h)-r;p=((s*o+f)*2+(i?1:0))*7;if(d[p]>0){y.copyFromArray(d,p+1)}else{var v=f*2;var g=this._hullCache[10];var D=this._hullCache[11];var T=this._hullCache[8]+f*g;var b=this._hullCache[9]+f*D;var A=this._vertices;if(i){this._getAffineTransform(c+h,-a,h,r-a,A[v+2],A[v+3],A[v],A[v+1],T+g,b+D,P._helpTransform,y,true)}else{this._getAffineTransform(c,-r,h,r-a,T,b,T+g,b+D,A[v],A[v+1],P._helpTransform,y,false)}d[p]=1;d[p+1]=y.a;d[p+2]=y.b;d[p+3]=y.c;d[p+4]=y.d;d[p+5]=y.tx;d[p+6]=y.ty}}else if(e>=a){if(t<-a||t>=a){return this.globalTransformMatrix}i=e>this._kY*(t-c-h)+a;p=((s*o+s+o+f)*2+(i?1:0))*7;if(d[p]>0){y.copyFromArray(d,p+1)}else{var v=o*(l+2)+f*2;var g=this._hullCache[10];var D=this._hullCache[11];var T=this._hullCache[6]-(s-f)*g;var b=this._hullCache[7]-(s-f)*D;var A=this._vertices;if(i){this._getAffineTransform(c+h,r,h,r-a,T+g,b+D,T,b,A[v+2],A[v+3],P._helpTransform,y,true)}else{this._getAffineTransform(c,a,h,r-a,A[v],A[v+1],A[v+2],A[v+3],T,b,P._helpTransform,y,false)}d[p]=1;d[p+1]=y.a;d[p+2]=y.b;d[p+3]=y.c;d[p+4]=y.d;d[p+5]=y.tx;d[p+6]=y.ty}}else{i=e>this._k*(t-c-h)+m;p=((s*_+f)*2+(i?1:0))*7;if(d[p]>0){y.copyFromArray(d,p+1)}else{var v=f*2+_*(l+2);var A=this._vertices;if(i){this._getAffineTransform(c+h,m+u,h,u,A[v+l+4],A[v+l+5],A[v+l+2],A[v+l+3],A[v+2],A[v+3],P._helpTransform,y,true)}else{this._getAffineTransform(c,m,h,u,A[v],A[v+1],A[v+2],A[v+3],A[v+l+2],A[v+l+3],P._helpTransform,y,false)}d[p]=1;d[p+1]=y.a;d[p+2]=y.b;d[p+3]=y.c;d[p+4]=y.d;d[p+5]=y.tx;d[p+6]=y.ty}}return y};P.prototype.init=function(t,e){if(this._boneData!==null){return}l.prototype.init.call(this,t,e);var a=t.segmentX;var r=t.segmentY;var i=this._armature.armatureData.parent.intArray[t.geometry.offset+0];var n=1e3;var s=200;this._dX=s*2/a;this._dY=s*2/r;this._k=-this._dY/this._dX;this._kX=-this._dY/(n-s);this._kY=-(n-s)/this._dX;this._vertices.length=i*2;this._deformVertices.length=i*2;this._matrixCahce.length=(a*r+a*2+r*2)*2*7;this._hullCache.length=10;for(var o=0;o=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(h)}if(h&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var u=1e3;var f=200;var _=2*this.global.x;var p=2*this.global.y;var c=P._helpPoint;this.globalTransformMatrix.transformPoint(u,-f,c);this._hullCache[0]=c.x;this._hullCache[1]=c.y;this._hullCache[2]=_-c.x;this._hullCache[3]=p-c.y;this.globalTransformMatrix.transformPoint(0,this._dY,c,true);this._hullCache[4]=c.x;this._hullCache[5]=c.y;this.globalTransformMatrix.transformPoint(f,u,c);this._hullCache[6]=c.x;this._hullCache[7]=c.y;this._hullCache[8]=_-c.x;this._hullCache[9]=p-c.y;this.globalTransformMatrix.transformPoint(this._dX,0,c,true);this._hullCache[10]=c.x;this._hullCache[11]=c.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return P}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(m){var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.deformVertices=[];return t}t.toString=function(){return"[class dragonBones.DisplayFrame]"};t.prototype._onClear=function(){this.rawDisplayData=null;this.displayData=null;this.textureData=null;this.display=null;this.deformVertices.length=0};t.prototype.updateDeformVertices=function(){if(this.rawDisplayData===null||this.deformVertices.length!==0){return}var t;if(this.rawDisplayData.type===2){t=this.rawDisplayData.geometry}else if(this.rawDisplayData.type===4){t=this.rawDisplayData.geometry}else{return}var e=0;if(t.weight!==null){e=t.weight.count*2}else{e=t.data.intArray[t.offset+0]*2}this.deformVertices.length=e;for(var a=0,r=this.deformVertices.length;a=0&&this._displayIndex0){for(var s=0,o=i;s=0&&this._cachedFrameIndices!==null){var r=this._cachedFrameIndices[t];if(r>=0&&this._cachedFrameIndex===r){this._transformDirty=false}else if(r>=0){this._transformDirty=true;this._cachedFrameIndex=r}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._transformDirty){if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform();this._transformDirty=false}};c.prototype.invalidUpdate=function(){this._displayDataDirty=true;this._displayDirty=true;this._transformDirty=true};c.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._updateGlobalTransformMatrix(false);this._transformDirty=false}};c.prototype.replaceRawDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.rawDisplayData!==t){a.deformVertices.length=0;a.rawDisplayData=t;if(a.rawDisplayData===null){var r=this._armature._armatureData.defaultSkin;if(r!==null){var i=r.getDisplays(this._slotData.name);if(i!==null&&e=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.displayData!==t&&a.rawDisplayData!==t){a.displayData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};c.prototype.replaceTextureData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.textureData!==t){a.textureData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};c.prototype.replaceDisplay=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.display!==t){var r=a.display;a.display=t;if(r!==null&&r!==this._rawDisplay&&r!==this._meshDisplay&&!this._hasDisplay(r)){if(r instanceof m.Armature){}else{this._disposeDisplay(r,true)}}if(t!==null&&t!==this._rawDisplay&&t!==this._meshDisplay&&!this._hasDisplay(r)&&!(t instanceof m.Armature)){this._initDisplay(t,true)}if(e===this._displayIndex){this._displayDirty=true}}};c.prototype.containsPoint=function(t,e){if(this._boundingBoxData===null){return false}this.updateTransformAndMatrix();c._helpMatrix.copyFrom(this.globalTransformMatrix);c._helpMatrix.invert();c._helpMatrix.transformPoint(t,e,c._helpPoint);return this._boundingBoxData.containsPoint(c._helpPoint.x,c._helpPoint.y)};c.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}if(this._boundingBoxData===null){return 0}this.updateTransformAndMatrix();c._helpMatrix.copyFrom(this.globalTransformMatrix);c._helpMatrix.invert();c._helpMatrix.transformPoint(t,e,c._helpPoint);t=c._helpPoint.x;e=c._helpPoint.y;c._helpMatrix.transformPoint(a,r,c._helpPoint);a=c._helpPoint.x;r=c._helpPoint.y;var o=this._boundingBoxData.intersectsSegment(t,e,a,r,i,n,s);if(o>0){if(o===1||o===2){if(i!==null){this.globalTransformMatrix.transformPoint(i.x,i.y,i);if(n!==null){n.x=i.x;n.y=i.y}}else if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}}else{if(i!==null){this.globalTransformMatrix.transformPoint(i.x,i.y,i)}if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}}if(s!==null){this.globalTransformMatrix.transformPoint(Math.cos(s.x),Math.sin(s.x),c._helpPoint,true);s.x=Math.atan2(c._helpPoint.y,c._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(s.y),Math.sin(s.y),c._helpPoint,true);s.y=Math.atan2(c._helpPoint.y,c._helpPoint.x)}}return o};c.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]};Object.defineProperty(c.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(c.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(t){var e=this._displayFrames.length;if(et){for(var a=e-1;ad){continue}var b=0;for(;;D++){var A=y[D];if(m>A){continue}if(D===0){b=m/A}else{var P=y[D-1];b=(m-P)/(A-P)}break}if(D!==c){c=D;if(u&&D===p){this._computeVertices(_-4,4,0,f);this._computeVertices(0,4,4,f)}else{this._computeVertices(D*6+2,8,0,f)}}this.addCurvePosition(b,f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],l,g,a)}return}if(u){_+=2;f.length=o;this._computeVertices(2,_-4,0,f);this._computeVertices(0,2,_-4,f);f[_-2]=f[0];f[_-1]=f[1]}else{p--;_-=4;f.length=_;this._computeVertices(2,_,0,f)}var S=new Array(p);d=0;var O=f[0],x=f[1],B=0,M=0,E=0,I=0,F=0,w=0;var C,N,R,k,j,L,V,Y;for(var v=0,U=2;vd){continue}for(;;D++){var H=S[D];if(z>H)continue;if(D===0)z/=H;else{var K=S[D-1];z=(z-K)/(H-K)}break}if(D!==c){c=D;var Z=D*6;O=f[Z];x=f[Z+1];B=f[Z+2];M=f[Z+3];E=f[Z+4];I=f[Z+5];F=f[Z+6];w=f[Z+7];C=(O-B*2+E)*.03;N=(x-M*2+I)*.03;R=((B-E)*3-O+F)*.006;k=((M-I)*3-x+w)*.006;j=C*2+R;L=N*2+k;V=(B-O)*.3+C+R*.16666667;Y=(M-x)*.3+N+k*.16666667;G=Math.sqrt(V*V+Y*Y);X[0]=G;for(Z=1;Z<8;Z++){V+=j;Y+=L;j+=R;L+=k;G+=Math.sqrt(V*V+Y*Y);X[Z]=G}V+=j;Y+=L;G+=Math.sqrt(V*V+Y*Y);X[8]=G;V+=j+R;Y+=L+k;G+=Math.sqrt(V*V+Y*Y);X[9]=G;W=0}z*=G;for(;;W++){var q=X[W];if(z>q)continue;if(W===0)z/=q;else{var K=X[W-1];z=W+(z-K)/(q-K)}break}this.addCurvePosition(z*.1,O,x,B,M,E,I,F,w,l,g,a)}};t.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,u,f){if(t===0){h[u]=e;h[u+1]=a;h[u+2]=0;return}if(t===1){h[u]=o;h[u+1]=l;h[u+2]=0;return}var _=1-t;var p=_*_;var c=t*t;var m=p*_;var d=p*t*3;var y=_*c*3;var v=t*c;var g=m*e+d*r+y*n+v*o;var D=m*a+d*i+y*s+v*l;h[u]=g;h[u+1]=D;if(f){h[u+2]=Math.atan2(D-(m*a+d*i+y*s),g-(m*e+d*r+y*n))}else{h[u+2]=0}};t.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?U.Transform.DEG_RAD:-U.Transform.DEG_RAD}}var x=this.rotateMix;var B=this.translateMix;for(var c=0,M=3;c0){var C=v.a,N=v.b,R=v.c,k=v.d,j=void 0,L=void 0,V=void 0;if(h){j=b[M-1]}else{j=Math.atan2(I,E)}j-=Math.atan2(N,C);if(O){L=Math.cos(j);V=Math.sin(j);var Y=d._boneData.length;P+=(Y*(L*C-V*N)-E)*x;S+=(Y*(V*C+L*N)-I)*x}else{j+=A}if(j>U.Transform.PI){j-=U.Transform.PI_D}else if(j<-U.Transform.PI){j+=U.Transform.PI_D}j*=x;L=Math.cos(j);V=Math.sin(j);v.a=L*C-V*N;v.b=V*C+L*N;v.c=L*R-V*k;v.d=V*R+L*k}d.global.fromMatrix(v)}this.dirty=false};t.prototype.invalidUpdate=function(){};return t}(t);U.PathConstraint=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=0}this.time=0;this.timeScale=1;this._systemTime=0;this._animatebles=[];this._clock=null;this.time=t;this._systemTime=(new Date).getTime()*.001}t.prototype.advanceTime=function(t){if(t!==t){t=0}var e=Date.now()*.001;if(t<0){t=e-this._systemTime}this._systemTime=e;if(this.timeScale!==1){t*=this.timeScale}if(t===0){return}if(t<0){this.time-=t}else{this.time+=t}var a=0,r=0,i=this._animatebles.length;for(;a0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&n._subFadeState>0){this._armature._dragonBones.bufferObject(n);this._animationStates.length=0;this._lastAnimationState=null}else{var s=n.animationData;var o=s.cacheFrameRate;if(this._animationDirty&&o>0){this._animationDirty=false;for(var l=0,h=this._armature.getBones();l0){var c=p.getDisplayFrameAt(0).rawDisplayData;if(c!==null&&c.parent===this._armature.armatureData.defaultSkin){p._cachedFrameIndices=s.getSlotCachedFrameIndices(p.name);continue}}p._cachedFrameIndices=null}}n.advanceTime(t,o)}}else if(i>1){for(var m=0,d=0;m0&&n._subFadeState>0){d++;this._armature._dragonBones.bufferObject(n);this._animationDirty=true;if(this._lastAnimationState===n){this._lastAnimationState=null}}else{if(d>0){this._animationStates[m-d]=n}n.advanceTime(t,0)}if(m===i-1&&d>0){this._animationStates.length-=d;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};t.prototype.reset=function(){for(var t=0,e=this._animationStates;t0){if(t.position<0){t.position%=a.duration;t.position=a.duration-t.position}else if(t.position===a.duration){t.position-=1e-6}else if(t.position>a.duration){t.position%=a.duration}if(t.duration>0&&t.position+t.duration>a.duration){t.duration=a.duration-t.position}if(t.playTimes<0){t.playTimes=a.playTimes}}else{t.playTimes=1;t.position=0;if(t.duration>0){t.duration=0}}if(t.duration===0){t.duration=-1}this._fadeOut(t);var s=g.BaseObject.borrowObject(g.AnimationState);s.init(this._armature,a,t);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var o=false;for(var l=0,h=this._animationStates.length;lthis._animationStates[l].layer){o=true;this._animationStates.splice(l,0,s);break}else if(l!==h-1&&s.layer>this._animationStates[l+1].layer){o=true;this._animationStates.splice(l+1,0,s);break}}if(!o){this._animationStates.push(s)}}else{this._animationStates.push(s)}for(var u=0,f=this._armature.getSlots();u0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};t.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.frameCount>0?r.duration*e/r.frameCount:0}return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};t.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};t.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};t.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};t.prototype.getBlendState=function(t,e,a){if(!(t in this._blendStates)){this._blendStates[t]={}}var r=this._blendStates[t];if(!(e in r)){var i=r[e]=g.BaseObject.borrowObject(g.BlendState);i.target=a}return r[e]};t.prototype.getState=function(t,e){if(e===void 0){e=-1}var a=this._animationStates.length;while(a--){var r=this._animationStates[a];if(r.name===t&&(e<0||r.layer===e)){return r}}return null};t.prototype.hasAnimation=function(t){return t in this._animations};t.prototype.getStates=function(){return this._animationStates};Object.defineProperty(t.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});return t}(g.BaseObject);g.Animation=t})(dragonBones||(dragonBones={}));var dragonBones;(function(L){var t=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t._boneMask=[];t._boneTimelines=[];t._boneBlendTimelines=[];t._slotTimelines=[];t._slotBlendTimelines=[];t._constraintTimelines=[];t._animationTimelines=[];t._poseTimelines=[];t._actionTimeline=null;t._zOrderTimeline=null;return t}t.toString=function(){return"[class dragonBones.AnimationState]"};t.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0){this._boneTimelines.splice(v,1);r.returnToPool()}v=this._boneBlendTimelines.indexOf(r);if(v>=0){this._boneBlendTimelines.splice(v,1);r.returnToPool()}}}}{var g={};var D=[];for(var T=0,b=this._slotTimelines;T=0){this._slotTimelines.splice(v,1);r.returnToPool()}v=this._slotBlendTimelines.indexOf(r);if(v>=0){this._slotBlendTimelines.splice(v,1);r.returnToPool()}}}}};t.prototype._advanceFadeTime=function(t){var e=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var a=this._parent===null&&this.actionEnabled;if(a){var r=e?L.EventObject.FADE_OUT:L.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=L.BaseObject.borrowObject(L.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}}if(t<0){t=-t}this._fadeTime+=t;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=e?0:1}else if(this._fadeTime>0){this._fadeProgress=e?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=e?1:0}if(this._subFadeState>0){if(!e){this._playheadState|=1;this._fadeState=0}var a=this._parent===null&&this.actionEnabled;if(a){var r=e?L.EventObject.FADE_OUT_COMPLETE:L.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=L.BaseObject.borrowObject(L.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}}};t.prototype.init=function(t,e,a){if(this._armature!==null){return}this._armature=t;this._animationData=e;this.resetToPose=a.resetToPose;this.additive=a.additive;this.displayControl=a.displayControl;this.actionEnabled=a.actionEnabled;this.blendType=e.blendType;this.layer=a.layer;this.playTimes=a.playTimes;this.timeScale=a.timeScale;this.fadeTotalTime=a.fadeInTime;this.autoFadeOutTime=a.autoFadeOutTime;this.name=a.name.length>0?a.name:a.animation;this.group=a.group;this._weight=a.weight;if(a.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(a.duration<0){this._position=0;this._duration=this._animationData.duration;if(a.position!==0){if(this.timeScale>=0){this._time=a.position}else{this._time=a.position-this._duration}}else{this._time=0}}else{this._position=a.position;this._duration=a.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(a.boneMask.length>0){this._boneMask.length=a.boneMask.length;for(var r=0,i=this._boneMask.length;r0;var i=true;var n=true;var s=this._time;this._weightResult=this._weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(this._weight===0){return}if(r){var o=e*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*e);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){var h=false;var u=null;if(n){for(var f=0,_=this._boneTimelines.length;f<_;++f){var p=this._boneTimelines[f];if(p.playState<=0){p.update(s)}if(p.target!==u){var c=p.target;h=c.update(this);u=c;if(c.dirty===1){var m=c.target.animationPose;m.x=0;m.y=0;m.rotation=0;m.skew=0;m.scaleX=1;m.scaleY=1}}if(h){p.blend(a)}}}for(var f=0,_=this._boneBlendTimelines.length;f<_;++f){var p=this._boneBlendTimelines[f];if(p.playState<=0){p.update(s)}if(p.target.update(this)){p.blend(a)}}if(this.displayControl){for(var f=0,_=this._slotTimelines.length;f<_;++f){var p=this._slotTimelines[f];if(p.playState<=0){var d=p.target;var y=d.displayController;if(y===null||y===this.name||y===this.group){p.update(s)}}}}for(var f=0,_=this._slotBlendTimelines.length;f<_;++f){var p=this._slotBlendTimelines[f];if(p.playState<=0){var c=p.target;p.update(s);if(c.update(this)){p.blend(a)}}}for(var f=0,_=this._constraintTimelines.length;f<_;++f){var p=this._constraintTimelines[f];if(p.playState<=0){p.update(s)}}if(this._animationTimelines.length>0){var v=100;var g=100;var D=null;var T=null;for(var f=0,_=this._animationTimelines.length;f<_;++f){var p=this._animationTimelines[f];if(p.playState<=0){p.update(s)}if(this.blendType===1){var b=p.target;var A=this.parameterX-b.positionX;if(A>=0){if(A0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var P=0,S=this._poseTimelines;P=0){this._boneTimelines.splice(O,1);p.returnToPool();continue}O=this._boneBlendTimelines.indexOf(p);if(O>=0){this._boneBlendTimelines.splice(O,1);p.returnToPool();continue}O=this._slotTimelines.indexOf(p);if(O>=0){this._slotTimelines.splice(O,1);p.returnToPool();continue}O=this._slotBlendTimelines.indexOf(p);if(O>=0){this._slotBlendTimelines.splice(O,1);p.returnToPool();continue}O=this._constraintTimelines.indexOf(p);if(O>=0){this._constraintTimelines.splice(O,1);p.returnToPool();continue}}this._poseTimelines.length=0}}if(this._actionTimeline.playState>0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};t.prototype.play=function(){this._playheadState=3};t.prototype.stop=function(){this._playheadState&=1};t.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};t.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};t.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,u=i;h0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&this._parent===null){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.dirty++;this.layer=e;this.leftWeight=0;this.blendWeight=0;return false}this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}a*=this.leftWeight;this.dirty++;this.blendWeight=a;this.layerWeight+=this.blendWeight;return true}return false}this.dirty++;this.layer=e;this.leftWeight=1;this.blendWeight=a;this.layerWeight=a;return true};e.prototype.reset=function(){this.dirty=0;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};e.BONE_TRANSFORM="boneTransform";e.BONE_ALPHA="boneAlpha";e.SURFACE="surface";e.SLOT_DEFORM="slotDeform";e.SLOT_ALPHA="slotAlpha";e.SLOT_Z_INDEX="slotZIndex";return e}(L.BaseObject);L.BlendState=V})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.dirty=false;this.playState=-1;this.currentPlayTimes=0;this.currentTime=-1;this.target=null;this._isTween=false;this._valueOffset=0;this._frameValueOffset=0;this._frameOffset=0;this._frameRate=0;this._frameCount=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._valueArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this.playState===1?this._duration+1e-6:this._duration}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState.animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;if(this._timelineData!==null){var r=this._animationData.parent.parent;this._frameArray=r.frameArray;this._timelineArray=r.timelineArray;this._frameIndices=r.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){this.dirty=false};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._isTween||this.dirty){this._onUpdateFrame()}}};e.prototype.blend=function(t){};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a>0;var n=a+1;var s=Math.floor(t*n);var o=0;var l=0;if(i){o=s===0?0:e[r+s-1];l=s===n-1?1e4:e[r+s]}else{o=e[r+s-1];l=e[r+s]}return(o+(l-o)*(t*n-s))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenEasing=0;this._tweenProgress=0;this._valueScale=1};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this.dirty=true;this._isTween=false}};e.prototype._onUpdateFrame=function(){if(this._isTween){this.dirty=true;this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}};return e}(e);t.TweenTimelineState=a;var r=function(i){__extends(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}t.prototype._onClear=function(){i.prototype._onClear.call(this);this._current=0;this._difference=0;this._result=0};t.prototype._onArriveAtFrame=function(){i.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._valueScale;var e=this._valueArray;var a=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:a+1;if(t===1){this._current=e[a];this._difference=e[r]-this._current}else{this._current=e[a]*t;this._difference=e[r]*t-this._current}}else{this._result=e[a]*t}}else{this._result=0}};t.prototype._onUpdateFrame=function(){i.prototype._onUpdateFrame.call(this);if(this._isTween){this._result=this._current+this._difference*this._tweenProgress}};return t}(a);t.SingleValueTimelineState=r;var i=function(i){__extends(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}t.prototype._onClear=function(){i.prototype._onClear.call(this);this._currentA=0;this._currentB=0;this._differenceA=0;this._differenceB=0;this._resultA=0;this._resultB=0};t.prototype._onArriveAtFrame=function(){i.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._valueScale;var e=this._valueArray;var a=this._valueOffset+this._frameValueOffset+this._frameIndex*2;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:a+2;if(t===1){this._currentA=e[a];this._currentB=e[a+1];this._differenceA=e[r]-this._currentA;this._differenceB=e[r+1]-this._currentB}else{this._currentA=e[a]*t;this._currentB=e[a+1]*t;this._differenceA=e[r]*t-this._currentA;this._differenceB=e[r+1]*t-this._currentB}}else{this._resultA=e[a]*t;this._resultB=e[a+1]*t}}else{this._resultA=0;this._resultB=0}};t.prototype._onUpdateFrame=function(){i.prototype._onUpdateFrame.call(this);if(this._isTween){this._resultA=this._currentA+this._differenceA*this._tweenProgress;this._resultB=this._currentB+this._differenceB*this._tweenProgress}};return t}(a);t.DoubleValueTimelineState=i;var n=function(o){__extends(t,o);function t(){var t=o!==null&&o.apply(this,arguments)||this;t._rd=[];return t}t.prototype._onClear=function(){o.prototype._onClear.call(this);this._valueCount=0;this._rd.length=0};t.prototype._onArriveAtFrame=function(){o.prototype._onArriveAtFrame.call(this);var t=this._valueCount;var e=this._rd;if(this._timelineData!==null){var a=this._valueScale;var r=this._valueArray;var i=this._valueOffset+this._frameValueOffset+this._frameIndex*t;if(this._isTween){var n=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:i+t;if(a===1){for(var s=0;s0){if(n.hasDBEventListener(y.EventObject.COMPLETE)){h=y.BaseObject.borrowObject(y.EventObject);h.type=y.EventObject.COMPLETE;h.armature=this._armature;h.animationState=this._animationState}}}if(this._frameCount>1){var u=this._timelineData;var f=Math.floor(this.currentTime*this._frameRate);var _=this._frameIndices[u.frameIndicesOffset+f];if(this._frameIndex!==_){var p=this._frameIndex;this._frameIndex=_;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[u.offset+5+this._frameIndex];if(o){if(p<0){var c=Math.floor(r*this._frameRate);p=this._frameIndices[u.frameIndicesOffset+c];if(this.currentPlayTimes===a){if(p===_){p=-1}}}while(p>=0){var m=this._animationData.frameOffset+this._timelineArray[u.offset+5+p];var d=this._frameArray[m]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(p)}if(l!==null&&p===0){this._armature._dragonBones.bufferEvent(l);l=null}if(p>0){p--}else{p=this._frameCount-1}if(p===_){break}}}else{if(p<0){var c=Math.floor(r*this._frameRate);p=this._frameIndices[u.frameIndicesOffset+c];var m=this._animationData.frameOffset+this._timelineArray[u.offset+5+p];var d=this._frameArray[m]/this._frameRate;if(this.currentPlayTimes===a){if(r<=d){if(p>0){p--}else{p=this._frameCount-1}}else if(p===_){p=-1}}}while(p>=0){if(p=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(y.TimelineState);y.ZOrderTimelineState=e;var a=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._rd[2]=y.Transform.normalizeRadian(this._rd[2]);this._rd[3]=y.Transform.normalizeRadian(this._rd[3])}if(this._timelineData===null){this._rd[4]=1;this._rd[5]=1}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=6;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.fadeOut=function(){this.dirty=false;this._rd[2]=y.Transform.normalizeRadian(this._rd[2]);this._rd[3]=y.Transform.normalizeRadian(this._rd[3])};t.prototype.blend=function(t){var e=this._armature.armatureData.scale;var a=this._rd;var r=this.target;var i=r.target;var n=r.blendWeight;var s=i.animationPose;if(r.dirty>1){s.x+=a[0]*n*e;s.y+=a[1]*n*e;s.rotation+=a[2]*n;s.skew+=a[3]*n;s.scaleX+=(a[4]-1)*n;s.scaleY+=(a[5]-1)*n}else{s.x=a[0]*n*e;s.y=a[1]*n*e;s.rotation=a[2]*n;s.skew=a[3]*n;s.scaleX=(a[4]-1)*n+1;s.scaleY=(a[5]-1)*n+1}if(t||this.dirty){this.dirty=false;i._transformDirty=true}};return t}(y.MutilpleValueTimelineState);y.BoneAllTimelineState=a;var r=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.x+=this._resultA*r;i.y+=this._resultB*r}else if(r!==1){i.x=this._resultA*r;i.y=this._resultB*r}else{i.x=this._resultA;i.y=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneTranslateTimelineState=r;var i=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._differenceA=y.Transform.normalizeRadian(this._differenceA);this._differenceB=y.Transform.normalizeRadian(this._differenceB)}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.fadeOut=function(){this.dirty=false;this._resultA=y.Transform.normalizeRadian(this._resultA);this._resultB=y.Transform.normalizeRadian(this._resultB)};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.rotation+=this._resultA*r;i.skew+=this._resultB*r}else if(r!==1){i.rotation=this._resultA*r;i.skew=this._resultB*r}else{i.rotation=this._resultA;i.skew=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneRotateTimelineState=i;var n=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){this._resultA=1;this._resultB=1}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.scaleX+=(this._resultA-1)*r;i.scaleY+=(this._resultB-1)*r}else if(r!==1){i.scaleX=(this._resultA-1)*r+1;i.scaleY=(this._resultB-1)*r+1}else{i.scaleX=this._resultA;i.scaleY=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneScaleTimelineState=n;var s=function(s){__extends(t,s);function t(){return s!==null&&s.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};t.prototype._onClear=function(){s.prototype._onClear.call(this);this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};t.prototype.init=function(t,e,a){s.prototype.init.call(this,t,e,a);if(this._timelineData!==null){var r=this._animationData.parent.parent;var i=r.frameIntArray;var n=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=i[n+2];this._deformCount=i[n+1];this._deformOffset=i[n+3];this._sameValueOffset=i[n+4]+this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=r.frameFloatArray;this._rd.length=this._valueCount*2}else{this._deformCount=this.target.target._deformVertices.length}};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a._deformVertices;var n=this._valueArray;if(n!==null){var s=this._valueCount;var o=this._deformOffset;var l=this._sameValueOffset;var h=this._rd;for(var u=0;u1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u1){a._alpha+=this._result*r;if(a._alpha>1){a._alpha=1}}else{a._alpha=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._alphaDirty=true}};return t}(y.SingleValueTimelineState);y.AlphaTimelineState=o;var l=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotDisplayTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target;var e=this._timelineData!==null?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;if(t.displayIndex!==e){t._setDisplayIndex(e,true)}}};e.prototype._onUpdateFrame=function(){};return e}(y.TimelineState);y.SlotDisplayTimelineState=l;var h=function(o){__extends(t,o);function t(){var t=o!==null&&o.apply(this,arguments)||this;t._current=[0,0,0,0,0,0,0,0];t._difference=[0,0,0,0,0,0,0,0];t._result=[0,0,0,0,0,0,0,0];return t}t.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};t.prototype._onArriveAtFrame=function(){o.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.parent.parent;var e=t.colorArray;var a=t.frameIntArray;var r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex;var i=a[r];if(i<0){i+=65536}if(this._isTween){this._current[0]=e[i++];this._current[1]=e[i++];this._current[2]=e[i++];this._current[3]=e[i++];this._current[4]=e[i++];this._current[5]=e[i++];this._current[6]=e[i++];this._current[7]=e[i++];if(this._frameIndex===this._frameCount-1){i=a[this._animationData.frameIntOffset+this._frameValueOffset]}else{i=a[r+1]}if(i<0){i+=65536}this._difference[0]=e[i++]-this._current[0];this._difference[1]=e[i++]-this._current[1];this._difference[2]=e[i++]-this._current[2];this._difference[3]=e[i++]-this._current[3];this._difference[4]=e[i++]-this._current[4];this._difference[5]=e[i++]-this._current[5];this._difference[6]=e[i++]-this._current[6];this._difference[7]=e[i++]-this._current[7]}else{this._result[0]=e[i++]*.01;this._result[1]=e[i++]*.01;this._result[2]=e[i++]*.01;this._result[3]=e[i++]*.01;this._result[4]=e[i++];this._result[5]=e[i++];this._result[6]=e[i++];this._result[7]=e[i++]}}else{var n=this.target;var s=n.slotData.color;this._result[0]=s.alphaMultiplier;this._result[1]=s.redMultiplier;this._result[2]=s.greenMultiplier;this._result[3]=s.blueMultiplier;this._result[4]=s.alphaOffset;this._result[5]=s.redOffset;this._result[6]=s.greenOffset;this._result[7]=s.blueOffset}};t.prototype._onUpdateFrame=function(){o.prototype._onUpdateFrame.call(this);if(this._isTween){this._result[0]=(this._current[0]+this._difference[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._difference[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._difference[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._difference[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress;this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress;this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress;this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress}};t.prototype.fadeOut=function(){this._isTween=false};t.prototype.update=function(t){o.prototype.update.call(this,t);if(this._isTween||this.dirty){var e=this.target;var a=e._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);a.alphaMultiplier+=(this._result[0]-a.alphaMultiplier)*r;a.redMultiplier+=(this._result[1]-a.redMultiplier)*r;a.greenMultiplier+=(this._result[2]-a.greenMultiplier)*r;a.blueMultiplier+=(this._result[3]-a.blueMultiplier)*r;a.alphaOffset+=(this._result[4]-a.alphaOffset)*r;a.redOffset+=(this._result[5]-a.redOffset)*r;a.greenOffset+=(this._result[6]-a.greenOffset)*r;a.blueOffset+=(this._result[7]-a.blueOffset)*r;e._colorDirty=true}}else if(this.dirty){this.dirty=false;if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){a.alphaMultiplier=this._result[0];a.redMultiplier=this._result[1];a.greenMultiplier=this._result[2];a.blueMultiplier=this._result[3];a.alphaOffset=this._result[4];a.redOffset=this._result[5];a.greenOffset=this._result[6];a.blueOffset=this._result[7];e._colorDirty=true}}}};return t}(y.TweenTimelineState);y.SlotColorTimelineState=h;var u=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){var t=this.target;var e=t.target;this._result=e.slotData.zIndex}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueArray=this._animationData.parent.parent.frameIntArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;if(e.dirty>1){a._zIndex+=this._result*r}else{a._zIndex=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._zIndexDirty=true}};return t}(y.SingleValueTimelineState);y.SlotZIndexTimelineState=u;var f=function(f){__extends(t,f);function t(){return f!==null&&f.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.DeformTimelineState]"};t.prototype._onClear=function(){f.prototype._onClear.call(this);this.geometryOffset=0;this.displayFrame=null;this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};t.prototype.init=function(t,e,a){f.prototype.init.call(this,t,e,a);if(this._timelineData!==null){var r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];var i=this._animationData.parent.parent;var n=i.frameIntArray;var s=this.target.target;this.geometryOffset=n[r+0];if(this.geometryOffset<0){this.geometryOffset+=65536}for(var o=0,l=s.displayFrameCount;o1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u0;t._weight=this._currentB}else{var e=t._constraintData;t._bendPositive=e.bendPositive;t._weight=e.weight}t.invalidUpdate();this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=.01;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.DoubleValueTimelineState);y.IKConstraintTimelineState=_;var p=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.currentTime=this._result*t.totalTime}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.SingleValueTimelineState);y.AnimationProgressTimelineState=p;var c=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.weight=this._result}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.SingleValueTimelineState);y.AnimationWeightTimelineState=c;var m=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.parameterX=this._resultA;t.parameterY=this._resultB}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.DoubleValueTimelineState);y.AnimationParametersTimelineState=m})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.actionDataToInstance=function(t,e,a){if(t.type===0){e.type=r.FRAME_EVENT}else{e.type=t.type===10?r.FRAME_EVENT:r.SOUND_EVENT}e.name=t.name;e.armature=a;e.actionData=t;e.data=t.data;if(t.bone!==null){e.bone=a.getBone(t.bone.name)}if(t.slot!==null){e.slot=a.getSlot(t.slot.name)}};r.toString=function(){return"[class dragonBones.EventObject]"};r.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};r.START="start";r.LOOP_COMPLETE="loopComplete";r.COMPLETE="complete";r.FADE_IN="fadeIn";r.FADE_IN_COMPLETE="fadeInComplete";r.FADE_OUT="fadeOut";r.FADE_OUT_COMPLETE="fadeOutComplete";r.FRAME_EVENT="frameEvent";r.SOUND_EVENT="soundEvent";return r}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(){}t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}};t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};t.DATA_VERSION_2_3="2.3";t.DATA_VERSION_3_0="3.0";t.DATA_VERSION_4_0="4.0";t.DATA_VERSION_4_5="4.5";t.DATA_VERSION_5_0="5.0";t.DATA_VERSION_5_5="5.5";t.DATA_VERSION_5_6="5.6";t.DATA_VERSION=t.DATA_VERSION_5_6;t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6];t.TEXTURE_ATLAS="textureAtlas";t.SUB_TEXTURE="SubTexture";t.FORMAT="format";t.IMAGE_PATH="imagePath";t.WIDTH="width";t.HEIGHT="height";t.ROTATED="rotated";t.FRAME_X="frameX";t.FRAME_Y="frameY";t.FRAME_WIDTH="frameWidth";t.FRAME_HEIGHT="frameHeight";t.DRADON_BONES="dragonBones";t.USER_DATA="userData";t.ARMATURE="armature";t.CANVAS="canvas";t.BONE="bone";t.SURFACE="surface";t.SLOT="slot";t.CONSTRAINT="constraint";t.SKIN="skin";t.DISPLAY="display";t.FRAME="frame";t.IK="ik";t.PATH_CONSTRAINT="path";t.ANIMATION="animation";t.TIMELINE="timeline";t.FFD="ffd";t.TRANSLATE_FRAME="translateFrame";t.ROTATE_FRAME="rotateFrame";t.SCALE_FRAME="scaleFrame";t.DISPLAY_FRAME="displayFrame";t.COLOR_FRAME="colorFrame";t.DEFAULT_ACTIONS="defaultActions";t.ACTIONS="actions";t.EVENTS="events";t.INTS="ints";t.FLOATS="floats";t.STRINGS="strings";t.TRANSFORM="transform";t.PIVOT="pivot";t.AABB="aabb";t.COLOR="color";t.VERSION="version";t.COMPATIBLE_VERSION="compatibleVersion";t.FRAME_RATE="frameRate";t.TYPE="type";t.SUB_TYPE="subType";t.NAME="name";t.PARENT="parent";t.TARGET="target";t.STAGE="stage";t.SHARE="share";t.PATH="path";t.LENGTH="length";t.DISPLAY_INDEX="displayIndex";t.Z_ORDER="zOrder";t.Z_INDEX="zIndex";t.BLEND_MODE="blendMode";t.INHERIT_TRANSLATION="inheritTranslation";t.INHERIT_ROTATION="inheritRotation";t.INHERIT_SCALE="inheritScale";t.INHERIT_REFLECTION="inheritReflection";t.INHERIT_ANIMATION="inheritAnimation";t.INHERIT_DEFORM="inheritDeform";t.SEGMENT_X="segmentX";t.SEGMENT_Y="segmentY";t.BEND_POSITIVE="bendPositive";t.CHAIN="chain";t.WEIGHT="weight";t.BLEND_TYPE="blendType";t.FADE_IN_TIME="fadeInTime";t.PLAY_TIMES="playTimes";t.SCALE="scale";t.OFFSET="offset";t.POSITION="position";t.DURATION="duration";t.TWEEN_EASING="tweenEasing";t.TWEEN_ROTATE="tweenRotate";t.TWEEN_SCALE="tweenScale";t.CLOCK_WISE="clockwise";t.CURVE="curve";t.SOUND="sound";t.EVENT="event";t.ACTION="action";t.X="x";t.Y="y";t.SKEW_X="skX";t.SKEW_Y="skY";t.SCALE_X="scX";t.SCALE_Y="scY";t.VALUE="value";t.ROTATE="rotate";t.SKEW="skew";t.ALPHA="alpha";t.ALPHA_OFFSET="aO";t.RED_OFFSET="rO";t.GREEN_OFFSET="gO";t.BLUE_OFFSET="bO";t.ALPHA_MULTIPLIER="aM";t.RED_MULTIPLIER="rM";t.GREEN_MULTIPLIER="gM";t.BLUE_MULTIPLIER="bM";t.UVS="uvs";t.VERTICES="vertices";t.TRIANGLES="triangles";t.WEIGHTS="weights";t.SLOT_POSE="slotPose";t.BONE_POSE="bonePose";t.BONES="bones";t.POSITION_MODE="positionMode";t.SPACING_MODE="spacingMode";t.ROTATE_MODE="rotateMode";t.SPACING="spacing";t.ROTATE_OFFSET="rotateOffset";t.ROTATE_MIX="rotateMix";t.TRANSLATE_MIX="translateMix";t.TARGET_DISPLAY="targetDisplay";t.CLOSED="closed";t.CONSTANT_SPEED="constantSpeed";t.VERTEX_COUNT="vertexCount";t.LENGTHS="lengths";t.GOTO_AND_PLAY="gotoAndPlay";t.DEFAULT_NAME="default";return t}();t.DataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(tt){var t=function(e){__extends($,e);function $(){var t=e!==null&&e.apply(this,arguments)||this;t._rawTextureAtlasIndex=0;t._rawBones=[];t._data=null;t._armature=null;t._bone=null;t._geometry=null;t._slot=null;t._skin=null;t._mesh=null;t._animation=null;t._timeline=null;t._rawTextureAtlases=null;t._frameValueType=0;t._defaultColorOffset=-1;t._prevClockwise=0;t._prevRotation=0;t._frameDefaultValue=0;t._frameValueScale=1;t._helpMatrixA=new tt.Matrix;t._helpMatrixB=new tt.Matrix;t._helpTransform=new tt.Transform;t._helpColorTransform=new tt.ColorTransform;t._helpPoint=new tt.Point;t._helpArray=[];t._intArray=[];t._floatArray=[];t._frameIntArray=[];t._frameFloatArray=[];t._frameArray=[];t._timelineArray=[];t._colorArray=[];t._cacheRawMeshes=[];t._cacheMeshes=[];t._actionFrames=[];t._weightSlotPose={};t._weightBonePoses={};t._cacheBones={};t._slotChildActions={};return t}$._getBoolean=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="boolean"){return r}else if(i==="string"){switch(r){case"0":case"NaN":case"":case"false":case"null":case"undefined":return false;default:return true}}else{return!!r}}return a};$._getNumber=function(t,e,a){if(e in t){var r=t[e];if(r===null||r==="NaN"){return a}return+r||0}return a};$._getString=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="string"){return r}return String(r)}return a};$.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var u=1-l;var f=u*u;var _=l*l;var p=u*f;var c=3*l*f;var m=3*u*_;var d=l*_;h.x=p*t+c*a+m*i+d*s;h.y=p*e+c*r+m*n+d*o};$.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3===1){var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,p,c,m,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return true}else{var r=0;for(var i=0,n=e.length;i1e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,p,c,m,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return false}};$.prototype._parseActionDataInFrame=function(t,e,a,r){if(tt.DataParser.EVENT in t){this._mergeActionFrame(t[tt.DataParser.EVENT],e,10,a,r)}if(tt.DataParser.SOUND in t){this._mergeActionFrame(t[tt.DataParser.SOUND],e,11,a,r)}if(tt.DataParser.ACTION in t){this._mergeActionFrame(t[tt.DataParser.ACTION],e,0,a,r)}if(tt.DataParser.EVENTS in t){this._mergeActionFrame(t[tt.DataParser.EVENTS],e,10,a,r)}if(tt.DataParser.ACTIONS in t){this._mergeActionFrame(t[tt.DataParser.ACTIONS],e,0,a,r)}};$.prototype._mergeActionFrame=function(t,e,a,r,i){var n=this._armature.actions.length;var s=this._parseActionData(t,a,r,i);var o=0;var l=null;for(var h=0,u=s;he){break}o++}if(l===null){l=new D;l.frameStart=e;this._actionFrames.splice(o,0,l)}for(var m=0;m0){var _=a.getBone(u);if(_!==null){f.parent=_}else{if(!(u in this._cacheBones)){this._cacheBones[u]=[]}this._cacheBones[u].push(f)}}if(f.name in this._cacheBones){for(var p=0,c=this._cacheBones[f.name];p0&&e.parent!==null){i.root=e.parent;i.bone=e}else{i.root=e;i.bone=null}return i};$.prototype._parsePathConstraint=function(t){var e=this._armature.getSlot($._getString(t,tt.DataParser.TARGET,""));if(e===null){return null}var a=this._armature.defaultSkin;if(a===null){return null}var r=a.getDisplay(e.name,$._getString(t,tt.DataParser.TARGET_DISPLAY,e.name));if(r===null||!(r instanceof tt.PathDisplayData)){return null}var i=t[tt.DataParser.BONES];if(i===null||i.length===0){return null}var n=tt.BaseObject.borrowObject(tt.PathConstraintData);n.name=$._getString(t,tt.DataParser.NAME,"");n.type=1;n.pathSlot=e;n.pathDisplayData=r;n.target=e.parent;n.positionMode=tt.DataParser._getPositionMode($._getString(t,tt.DataParser.POSITION_MODE,""));n.spacingMode=tt.DataParser._getSpacingMode($._getString(t,tt.DataParser.SPACING_MODE,""));n.rotateMode=tt.DataParser._getRotateMode($._getString(t,tt.DataParser.ROTATE_MODE,""));n.position=$._getNumber(t,tt.DataParser.POSITION,0);n.spacing=$._getNumber(t,tt.DataParser.SPACING,0);n.rotateOffset=$._getNumber(t,tt.DataParser.ROTATE_OFFSET,0);n.rotateMix=$._getNumber(t,tt.DataParser.ROTATE_MIX,1);n.translateMix=$._getNumber(t,tt.DataParser.TRANSLATE_MIX,1);for(var s=0,o=i;s0?a:e;this._parsePivot(t,n);break}case 1:{var s=i=tt.BaseObject.borrowObject(tt.ArmatureDisplayData);s.name=e;s.path=a.length>0?a:e;s.inheritAnimation=true;if(tt.DataParser.ACTIONS in t){var o=this._parseActionData(t[tt.DataParser.ACTIONS],0,null,null);for(var l=0,h=o;l0?a:e;if(tt.DataParser.SHARE in t){c.geometry.data=this._data;this._cacheRawMeshes.push(t);this._cacheMeshes.push(c)}else{this._parseMesh(t,c)}break}case 3:{var m=this._parseBoundingBox(t);if(m!==null){var d=i=tt.BaseObject.borrowObject(tt.BoundingBoxDisplayData);d.name=e;d.path=a.length>0?a:e;d.boundingBox=m}break}case 4:{var y=t[tt.DataParser.LENGTHS];var v=i=tt.BaseObject.borrowObject(tt.PathDisplayData);v.closed=$._getBoolean(t,tt.DataParser.CLOSED,false);v.constantSpeed=$._getBoolean(t,tt.DataParser.CONSTANT_SPEED,false);v.name=e;v.path=a.length>0?a:e;v.curveLengths.length=y.length;for(var g=0,D=y.length;ge.width){e.width=o}if(le.height){e.height=l}}}e.width-=e.x;e.height-=e.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return e};$.prototype._parseAnimation=function(t){var e=tt.BaseObject.borrowObject(tt.AnimationData);e.blendType=tt.DataParser._getAnimationBlendType($._getString(t,tt.DataParser.BLEND_TYPE,""));e.frameCount=$._getNumber(t,tt.DataParser.DURATION,0);e.playTimes=$._getNumber(t,tt.DataParser.PLAY_TIMES,1);e.duration=e.frameCount/this._armature.frameRate;e.fadeInTime=$._getNumber(t,tt.DataParser.FADE_IN_TIME,0);e.scale=$._getNumber(t,tt.DataParser.SCALE,1);e.name=$._getString(t,tt.DataParser.NAME,tt.DataParser.DEFAULT_NAME);if(e.name.length===0){e.name=tt.DataParser.DEFAULT_NAME}e.frameIntOffset=this._frameIntArray.length;e.frameFloatOffset=this._frameFloatArray.length;e.frameOffset=this._frameArray.length;this._animation=e;if(tt.DataParser.FRAME in t){var a=t[tt.DataParser.FRAME];var r=a.length;if(r>0){for(var i=0,n=0;i0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame);this._actionFrames.length=0}if(tt.DataParser.TIMELINE in t){var o=t[tt.DataParser.TIMELINE];for(var A=0,P=o;A0&&a in t){e=t[a]}if(e===null){return null}var l=e.length;if(l===0){return null}var h=this._frameIntArray.length;var u=this._frameFloatArray.length;var f=this._timelineArray.length;if(o===null){o=tt.BaseObject.borrowObject(tt.TimelineData)}o.type=r;o.offset=f;this._frameValueType=i;this._timeline=o;this._timelineArray.length+=1+1+1+1+1+l;if(t!==null){this._timelineArray[f+0]=Math.round($._getNumber(t,tt.DataParser.SCALE,1)*100);this._timelineArray[f+1]=Math.round($._getNumber(t,tt.DataParser.OFFSET,0)*100)}else{this._timelineArray[f+0]=100;this._timelineArray[f+1]=0}this._timelineArray[f+2]=l;this._timelineArray[f+3]=n;switch(this._frameValueType){case 0:this._timelineArray[f+4]=0;break;case 1:this._timelineArray[f+4]=h-this._animation.frameIntOffset;break;case 2:this._timelineArray[f+4]=u-this._animation.frameFloatOffset;break}if(l===1){o.frameIndicesOffset=-1;this._timelineArray[f+5+0]=s.call(this,e[0],0,0)-this._animation.frameOffset}else{var _=this._animation.frameCount+1;var p=this._data.frameIndices;var c=p.length;p.length+=_;o.frameIndicesOffset=c;for(var m=0,d=0,y=0,v=0;m<_;++m){if(y+v<=m&&d0){if(tt.DataParser.CURVE in t){var i=a+1;this._helpArray.length=i;var n=this._samplingEasingCurve(t[tt.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[r+1]=2;this._frameArray[r+2]=n?i:-i;for(var s=0;s0){var n=this._armature.sortedSlots.length;var s=new Array(n-i.length/2);var o=new Array(n);for(var l=0;l0?r>=this._prevRotation:r<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}r=this._prevRotation+r-this._prevRotation+tt.Transform.PI_D*this._prevClockwise}}this._prevClockwise=$._getNumber(t,tt.DataParser.TWEEN_ROTATE,0);this._prevRotation=r;var i=this._parseTweenFrame(t,e,a);var n=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[n++]=this._helpTransform.x;this._frameFloatArray[n++]=this._helpTransform.y;this._frameFloatArray[n++]=r;this._frameFloatArray[n++]=this._helpTransform.skew;this._frameFloatArray[n++]=this._helpTransform.scaleX;this._frameFloatArray[n++]=this._helpTransform.scaleY;this._parseActionDataInFrame(t,e,this._bone,this._slot);return i};$.prototype._parseBoneTranslateFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.X,0);this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.Y,0);return r};$.prototype._parseBoneRotateFrame=function(t,e,a){var r=$._getNumber(t,tt.DataParser.ROTATE,0)*tt.Transform.DEG_RAD;if(e!==0){if(this._prevClockwise===0){r=this._prevRotation+tt.Transform.normalizeRadian(r-this._prevRotation)}else{if(this._prevClockwise>0?r>=this._prevRotation:r<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}r=this._prevRotation+r-this._prevRotation+tt.Transform.PI_D*this._prevClockwise}}this._prevClockwise=$._getNumber(t,tt.DataParser.CLOCK_WISE,0);this._prevRotation=r;var i=this._parseTweenFrame(t,e,a);var n=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[n++]=r;this._frameFloatArray[n++]=$._getNumber(t,tt.DataParser.SKEW,0)*tt.Transform.DEG_RAD;return i};$.prototype._parseBoneScaleFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.X,1);this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.Y,1);return r};$.prototype._parseSlotDisplayFrame=function(t,e,a){var r=this._parseFrame(t,e,a);this._frameArray.length+=1;if(tt.DataParser.VALUE in t){this._frameArray[r+1]=$._getNumber(t,tt.DataParser.VALUE,0)}else{this._frameArray[r+1]=$._getNumber(t,tt.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(t,e,this._slot.parent,this._slot);return r};$.prototype._parseSlotColorFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=-1;if(tt.DataParser.VALUE in t||tt.DataParser.COLOR in t){var n=tt.DataParser.VALUE in t?t[tt.DataParser.VALUE]:t[tt.DataParser.COLOR];for(var s in n){s;this._parseColorTransform(n,this._helpColorTransform);i=this._colorArray.length;this._colorArray.length+=8;this._colorArray[i++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.redMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.alphaOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.redOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.greenOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.blueOffset);i-=8;break}}if(i<0){if(this._defaultColorOffset<0){this._defaultColorOffset=i=this._colorArray.length;this._colorArray.length+=8;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=0;this._colorArray[i++]=0;this._colorArray[i++]=0;this._colorArray[i++]=0}i=this._defaultColorOffset}var o=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[o]=i;return r};$.prototype._parseSlotDeformFrame=function(t,e,a){var r=this._frameFloatArray.length;var i=this._parseTweenFrame(t,e,a);var n=tt.DataParser.VERTICES in t?t[tt.DataParser.VERTICES]:null;var s=$._getNumber(t,tt.DataParser.OFFSET,0);var o=this._intArray[this._mesh.geometry.offset+0];var l=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var h=this._mesh.geometry.weight;var u=0;var f=0;var _=0;var p=0;if(h!==null){var c=this._weightSlotPose[l];this._helpMatrixA.copyFromArray(c,0);this._frameFloatArray.length+=h.count*2;_=h.offset+2+h.bones.length}else{this._frameFloatArray.length+=o*2}for(var m=0;m=n.length){u=0}else{u=n[m-s]}if(m+1=n.length){f=0}else{f=n[m+1-s]}}if(h!==null){var d=this._weightBonePoses[l];var y=this._intArray[_++];this._helpMatrixA.transformPoint(u,f,this._helpPoint,true);u=this._helpPoint.x;f=this._helpPoint.y;for(var v=0;v=n.length){h=0}else{h=n[f-s]}if(f+1=n.length){u=0}else{u=n[f+1-s]}}else{h=0;u=0}this._frameFloatArray[r+f]=h;this._frameFloatArray[r+f+1]=u}}if(e===0){var _=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[_+0]=this._geometry.offset;this._frameIntArray[_+1]=this._frameFloatArray.length-r;this._frameIntArray[_+2]=this._frameFloatArray.length-r;this._frameIntArray[_+3]=0;this._frameIntArray[_+4]=r-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=_-this._animation.frameIntOffset}return i};$.prototype._parseTransform=function(t,e,a){e.x=$._getNumber(t,tt.DataParser.X,0)*a;e.y=$._getNumber(t,tt.DataParser.Y,0)*a;if(tt.DataParser.ROTATE in t||tt.DataParser.SKEW in t){e.rotation=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.ROTATE,0)*tt.Transform.DEG_RAD);e.skew=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW,0)*tt.Transform.DEG_RAD)}else if(tt.DataParser.SKEW_X in t||tt.DataParser.SKEW_Y in t){e.rotation=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW_Y,0)*tt.Transform.DEG_RAD);e.skew=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW_X,0)*tt.Transform.DEG_RAD)-e.rotation}e.scaleX=$._getNumber(t,tt.DataParser.SCALE_X,1);e.scaleY=$._getNumber(t,tt.DataParser.SCALE_Y,1)};$.prototype._parseColorTransform=function(t,e){e.alphaMultiplier=$._getNumber(t,tt.DataParser.ALPHA_MULTIPLIER,100)*.01;e.redMultiplier=$._getNumber(t,tt.DataParser.RED_MULTIPLIER,100)*.01;e.greenMultiplier=$._getNumber(t,tt.DataParser.GREEN_MULTIPLIER,100)*.01;e.blueMultiplier=$._getNumber(t,tt.DataParser.BLUE_MULTIPLIER,100)*.01;e.alphaOffset=$._getNumber(t,tt.DataParser.ALPHA_OFFSET,0);e.redOffset=$._getNumber(t,tt.DataParser.RED_OFFSET,0);e.greenOffset=$._getNumber(t,tt.DataParser.GREEN_OFFSET,0);e.blueOffset=$._getNumber(t,tt.DataParser.BLUE_OFFSET,0)};$.prototype._parseGeometry=function(t,e){var a=t[tt.DataParser.VERTICES];var r=Math.floor(a.length/2);var i=0;var n=this._intArray.length;var s=this._floatArray.length;e.offset=n;e.data=this._data;this._intArray.length+=1+1+1+1;this._intArray[n+0]=r;this._intArray[n+2]=s;this._intArray[n+3]=-1;this._floatArray.length+=r*2;for(var o=0,l=r*2;o=0||tt.DataParser.DATA_VERSIONS.indexOf(r)>=0){var i=tt.BaseObject.borrowObject(tt.DragonBonesData);i.version=a;i.name=$._getString(t,tt.DataParser.NAME,"");i.frameRate=$._getNumber(t,tt.DataParser.FRAME_RATE,24);if(i.frameRate===0){i.frameRate=24}if(tt.DataParser.ARMATURE in t){this._data=i;this._parseArray(t);var n=t[tt.DataParser.ARMATURE];for(var s=0,o=n;s0){i.stage=i.getArmature(i.armatureNames[0])}this._data=null}if(tt.DataParser.TEXTURE_ATLAS in t){this._rawTextureAtlases=t[tt.DataParser.TEXTURE_ATLAS]}return i}else{console.assert(false,"Nonsupport data version: "+a+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};$.prototype.parseTextureAtlasData=function(t,e,a){if(a===void 0){a=1}console.assert(t!==undefined);if(t===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var r=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(r,e,a);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}e.width=$._getNumber(t,tt.DataParser.WIDTH,0);e.height=$._getNumber(t,tt.DataParser.HEIGHT,0);e.scale=a===1?1/$._getNumber(t,tt.DataParser.SCALE,1):a;e.name=$._getString(t,tt.DataParser.NAME,"");e.imagePath=$._getString(t,tt.DataParser.IMAGE_PATH,"");if(tt.DataParser.SUB_TEXTURE in t){var i=t[tt.DataParser.SUB_TEXTURE];for(var n=0,s=i.length;n0&&h>0){u.frame=tt.TextureData.createRectangle();u.frame.x=$._getNumber(o,tt.DataParser.FRAME_X,0);u.frame.y=$._getNumber(o,tt.DataParser.FRAME_Y,0);u.frame.width=l;u.frame.height=h}e.addTexture(u)}}return true};$.getInstance=function(){if($._objectDataParserInstance===null){$._objectDataParserInstance=new $}return $._objectDataParserInstance};$._objectDataParserInstance=null;return $}(tt.DataParser);tt.ObjectDataParser=t;var D=function(){function t(){this.frameStart=0;this.actions=[]}return t}();tt.ActionFrame=D})(dragonBones||(dragonBones={}));var dragonBones;(function(g){var t=function(o){__extends(t,o);function t(){return o!==null&&o.apply(this,arguments)||this}t.prototype._inRange=function(t,e,a){return e<=t&&t<=a};t.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var u=0;while(t.length>i){var f=t[i++];if(f===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(f,0,127)){s=f}else{if(this._inRange(f,194,223)){l=1;u=128;o=f-192}else if(this._inRange(f,224,239)){l=2;u=2048;o=f-224}else if(this._inRange(f,240,244)){l=3;u=65536;o=f-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(f,128,191)){o=0;l=0;h=0;u=0;i--;s=f}else{h+=1;o=o+(f-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var p=u;o=0;l=0;h=0;u=0;if(this._inRange(_,p,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=f}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};t.prototype._parseBinaryTimeline=function(t,e,a){if(a===void 0){a=null}var r=a!==null?a:g.BaseObject.borrowObject(g.TimelineData);r.type=t;r.offset=e;this._timeline=r;var i=this._timelineArrayBuffer[r.offset+2];if(i===1){r.frameIndicesOffset=-1}else{var n=0;var s=this._animation.frameCount+1;var o=this._data.frameIndices;n=o.length;o.length+=s;r.frameIndicesOffset=n;for(var l=0,h=0,u=0,f=0;l=0){var h=g.ObjectDataParser._getNumber(d,g.DataParser.TYPE,0);var y=g.ObjectDataParser._getString(d,g.DataParser.NAME,"");var f=null;if(h===40&&e.blendType!==0){f=g.BaseObject.borrowObject(g.AnimationTimelineData);var v=f;v.x=g.ObjectDataParser._getNumber(d,g.DataParser.X,0);v.y=g.ObjectDataParser._getNumber(d,g.DataParser.Y,0)}f=this._parseBinaryTimeline(h,u,f);switch(h){case 0:break;case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(y,f);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(y,f);break;case 30:this._animation.addConstraintTimeline(y,f);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(y,f);break}}}}this._animation=null;return e};t.prototype._parseGeometry=function(t,e){e.offset=t[g.DataParser.OFFSET];e.data=this._data;var a=this._intArrayBuffer[e.offset+3];if(a>=0){var r=g.BaseObject.borrowObject(g.WeightData);var i=this._intArrayBuffer[e.offset+0];var n=this._intArrayBuffer[a+0];r.offset=a;for(var s=0;s12?e[13]:0;var h=new Uint16Array(this._binary,this._binaryOffset+e[0],a/Uint16Array.BYTES_PER_ELEMENT);var u=new Float32Array(this._binary,this._binaryOffset+e[2],r/Float32Array.BYTES_PER_ELEMENT);var f=new Int16Array(this._binary,this._binaryOffset+e[4],i/Int16Array.BYTES_PER_ELEMENT);var _=new Float32Array(this._binary,this._binaryOffset+e[6],n/Float32Array.BYTES_PER_ELEMENT);var p=new Int16Array(this._binary,this._binaryOffset+e[8],s/Int16Array.BYTES_PER_ELEMENT);var c=new Uint16Array(this._binary,this._binaryOffset+e[10],o/Uint16Array.BYTES_PER_ELEMENT);var m=l>0?new Uint16Array(this._binary,this._binaryOffset+e[12],l/Uint16Array.BYTES_PER_ELEMENT):h;this._data.binary=this._binary;this._data.intArray=this._intArrayBuffer=h;this._data.floatArray=u;this._data.frameIntArray=f;this._data.frameFloatArray=_;this._data.frameArray=this._frameArrayBuffer=p;this._data.timelineArray=this._timelineArrayBuffer=c;this._data.colorArray=m};t.prototype.parseDragonBonesData=function(t,e){if(e===void 0){e=1}console.assert(t!==null&&t!==undefined&&t instanceof ArrayBuffer,"Data error.");var a=new Uint8Array(t,0,8);if(a[0]!=="D".charCodeAt(0)||a[1]!=="B".charCodeAt(0)||a[2]!=="D".charCodeAt(0)||a[3]!=="T".charCodeAt(0)){console.assert(false,"Nonsupport data.");return null}var r=new Uint32Array(t,8,1)[0];var i=new Uint8Array(t,8+4,r);var n=this._decodeUTF8(i);var s=JSON.parse(n);this._binaryOffset=8+4+r;this._binary=t;return o.prototype.parseDragonBonesData.call(this,s,e)};t.getInstance=function(){if(t._binaryDataParserInstance===null){t._binaryDataParserInstance=new t}return t._binaryDataParserInstance};t._binaryDataParserInstance=null;return t}(g.ObjectDataParser);g.BinaryDataParser=t})(dragonBones||(dragonBones={}));var dragonBones;(function(y){var t=function(){function s(t){if(t===void 0){t=null}this.autoSearch=false;this._dragonBonesDataMap={};this._textureAtlasDataMap={};this._dragonBones=null;this._dataParser=null;if(s._objectParser===null){s._objectParser=new y.ObjectDataParser}if(s._binaryParser===null){s._binaryParser=new y.BinaryDataParser}this._dataParser=t!==null?t:s._objectParser}s.prototype._isSupportMesh=function(){return true};s.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap){for(var a=0,r=this._textureAtlasDataMap[t];a0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};s.prototype._buildBones=function(t,e){for(var a=0,r=t.armature.sortedBones;a0){var m=this._getTextureData(t.textureAtlasName,c.path);f.replaceTextureData(m,_)}var d=this._getSlotDisplay(t,c,f);f.replaceDisplay(d,_)}else{f.replaceDisplay(null)}}}f._setDisplayIndex(h.displayIndex,true)}};s.prototype._buildConstraints=function(t,e){var a=t.armature.constraints;for(var r in a){var i=a[r];switch(i.type){case 0:var n=y.BaseObject.borrowObject(y.IKConstraint);n.init(i,e);e._addConstraint(n);break;case 1:var s=y.BaseObject.borrowObject(y.PathConstraint);s.init(i,e);e._addConstraint(s);break;default:var o=y.BaseObject.borrowObject(y.IKConstraint);o.init(i,e);e._addConstraint(o);break}}};s.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,t!==null?t.dataName:"","",t!==null?t.textureAtlasName:"")};s.prototype._getSlotDisplay=function(t,e,a){var r=t!==null?t.dataName:e.parent.parent.parent.name;var i=null;switch(e.type){case 0:{var n=e;if(n.texture===null){n.texture=this._getTextureData(r,e.path)}i=a.rawDisplay;break}case 2:{var s=e;if(s.texture===null){s.texture=this._getTextureData(r,s.path)}if(this._isSupportMesh()){i=a.meshDisplay}else{i=a.rawDisplay}break}case 1:{var o=e;var l=this._buildChildArmature(t,a,o);if(l!==null){l.inheritAnimation=o.inheritAnimation;if(!l.inheritAnimation){var h=o.actions.length>0?o.actions:l.armatureData.defaultActions;if(h.length>0){for(var u=0,f=h;u=0){continue}var h=e.getDisplays(l.name);if(h===null){if(n!==null&&e!==n){h=n.getDisplays(l.name)}if(h===null){if(a){l.displayFrameCount=0}continue}}l.displayFrameCount=h.length;for(var u=0,f=l.displayFrameCount;u0};e.prototype.dispatchDBEvent=function(t,e){this.emit(t,e)};e.prototype.addDBEventListener=function(t,e,a){this.on(t,e,a)};e.prototype.removeDBEventListener=function(t,e,a){this.off(t,e,a)};return e}(Phaser.Events.EventEmitter);t.EventDispatcher=e})(e=t.util||(t.util={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(t){var e;(function(e){e.Skew={getSkewX:function(){return this._skewX||0},setSkewX:function(t){this._skewX=t},getSkewY:function(){return this._skewY||0},setSkewY:function(t){this._skewY=t},setSkew:function(t,e){e=e===void 0?t:e;this._skewX=t;this._skewY=e}};e.extendSkew=function(t){Object.defineProperty(t.prototype,"skewX",{get:e.Skew.getSkewX,set:e.Skew.setSkewX,enumerable:true,configurable:true});Object.defineProperty(t.prototype,"skewY",{get:e.Skew.getSkewY,set:e.Skew.setSkewY,enumerable:true,configurable:true});t.prototype.setSkew=e.Skew.setSkew}})(e=t.util||(t.util={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(t){var e;(function(t){var e=function(o){__extends(t,o);function t(t,e,a,r,i,n){var s=o.call(this,t,e,a,r,i,n)||this;s.decomposedMatrix.skewX=0;s.decomposedMatrix.skewY=0;return s}t.prototype.decomposeMatrix=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=-Math.atan2(-a,r);var n=Math.atan2(e,t);var s=Math.abs(i+n);if(s<1e-5||Math.abs(Phaser.Math.PI2-s)<1e-5){this.decomposedMatrix.rotation=n;if(t<0&&r>=0)this.decomposedMatrix.rotation+=this.decomposedMatrix.rotation<=0?Math.PI:-Math.PI;this.decomposedMatrix.skewX=this.decomposedMatrix.skewY=0}else{this.decomposedMatrix.rotation=0;this.decomposedMatrix.skewX=i;this.decomposedMatrix.skewY=n}this.decomposedMatrix.scaleX=Math.sqrt(t*t+e*e);this.decomposedMatrix.scaleY=Math.sqrt(a*a+r*r);this.decomposedMatrix.translateX=this.tx;this.decomposedMatrix.translateY=this.ty;return this.decomposedMatrix};t.prototype.applyITRSC=function(t,e,a,r,i,n,s){this.a=Math.cos(a-s)*r;this.b=Math.sin(a-s)*r;this.c=-Math.sin(a+n)*i;this.d=Math.cos(a+n)*i;this.tx=t;this.ty=e;return this};Object.defineProperty(t.prototype,"skewX",{get:function(){return-Math.atan2(-this.c,this.d)},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"skewY",{get:function(){return Math.atan2(this.b,this.a)},enumerable:true,configurable:true});return t}(Phaser.GameObjects.Components.TransformMatrix);t.TransformMatrix=e})(e=t.util||(t.util={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(s){var t;(function(t){var e=function(n){__extends(t,n);function t(t,e,a,r){var i=n.call(this,t,e,a,r)||this;i._skewX=0;i._skewY=0;i.tempTransformMatrix=new s.util.TransformMatrix;return i}t.prototype.pointToContainer=function(t,e){if(e===undefined)e=new Phaser.Math.Vector2;if(this.parentContainer)return this.parentContainer.pointToContainer(t,e);var a=this.tempTransformMatrix;a.applyITRSC(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this._skewX,this._skewY);a.invert();a.transformPoint(t.x,t.y,e);return e};Object.defineProperty(t.prototype,"skewX",{get:function(){return this._skewX},set:function(t){this._skewX=t},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"skewY",{get:function(){return this._skewY},set:function(t){this._skewY=t},enumerable:true,configurable:true});t.prototype.setSkew=function(t,e){e=e===void 0?t:e;this.skewX=t;this.skewY=e;return this};return t}(Phaser.GameObjects.Container);t.DisplayContainer=e})(t=s.display||(s.display={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(t){var e;(function(t){var e=function(a){__extends(t,a);function t(t){var e=a.call(this,t)||this;e.debugDraw=false;return e}t.prototype.dbInit=function(t){this._armature=t};t.prototype.dbClear=function(){this.removeAllListeners();if(this._armature)this._armature.dispose();this._armature=null};t.prototype.dbUpdate=function(){if(this.debugDraw){}};t.prototype.dispose=function(t){this.dbClear();if(t===true)a.prototype.destroy.call(this)};t.prototype.destroy=function(){this.dispose(true)};t.prototype.dispatchDBEvent=function(t,e){this.emit(t,e)};t.prototype.hasDBEventListener=function(t){return this.listenerCount(t)>0};t.prototype.addDBEventListener=function(t,e,a){this.on(t,e,a)};t.prototype.removeDBEventListener=function(t,e,a){this.off(t,e,a)};Object.defineProperty(t.prototype,"armature",{get:function(){return this._armature},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animation",{get:function(){return this._armature.animation},enumerable:true,configurable:true});return t}(t.DisplayContainer);t.ArmatureDisplay=e})(e=t.display||(t.display={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(a){var t;(function(t){var e=function(s){__extends(t,s);function t(t,e,a,r,i){var n=s.call(this,t,e,a,r,i)||this;n.setPipeline("PhaserTextureTintPipeline");return n}return t}(Phaser.GameObjects.Image);t.SlotImage=e;a.util.extendSkew(e)})(t=a.display||(a.display={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(a){var t;(function(t){var e=function(s){__extends(t,s);function t(t,e,a,r,i){var n=s.call(this,t,e,a,r,i)||this;n.setPipeline("PhaserTextureTintPipeline");return n}return t}(Phaser.GameObjects.Sprite);t.SlotSprite=e;a.util.extendSkew(e)})(t=a.display||(a.display={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(r){var t;(function(t){var e;(function(s){var t=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.PhaserSlot]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._textureScale=1;if(this._renderDisplay){this._renderDisplay.destroy();this._renderDisplay=null}};e.prototype._initDisplay=function(t,e){};e.prototype._disposeDisplay=function(t,e){};e.prototype._onUpdateDisplay=function(){this._renderDisplay=this._display||this._rawDisplay};e.prototype._addDisplay=function(){this.armature.display.add(this._renderDisplay)};e.prototype._replaceDisplay=function(t){if(!this._renderDisplay["setSkew"]){console.warn("please call dragonBones.phaser.util.extendSkew to mix skew component into your display object,\n and set its pipeline to 'PhaserTextureTintPipeline' by calling 'setPiepline' method, more detail please refer to the 'ReplaceSlotDisplay.ts' example");return}this.armature.display.replace(t,this._renderDisplay);this._renderDisplay.parentContainer=this.armature.display};e.prototype._removeDisplay=function(){this._renderDisplay.parentContainer.remove(this._renderDisplay)};e.prototype._updateZOrder=function(){if(this._renderDisplay.depth===this._zOrder)return;this._renderDisplay.setDepth(this._zOrder)};e.prototype._updateVisible=function(){this._renderDisplay.setVisible(this._parent.visible&&this._visible)};e.prototype._updateBlendMode=function(){var t=Phaser.BlendModes.NORMAL;switch(this._blendMode){case 0:t=Phaser.BlendModes.NORMAL;break;case 1:t=Phaser.BlendModes.ADD;break;case 3:t=Phaser.BlendModes.DARKEN;break;case 4:t=Phaser.BlendModes.DIFFERENCE;break;case 6:t=Phaser.BlendModes.HARD_LIGHT;break;case 9:t=Phaser.BlendModes.LIGHTEN;break;case 10:t=Phaser.BlendModes.MULTIPLY;break;case 11:t=Phaser.BlendModes.OVERLAY;break;case 12:t=Phaser.BlendModes.SCREEN;break;default:break}this._renderDisplay.setBlendMode(t)};e.prototype._updateColor=function(){var t=this._colorTransform;var e=this._globalAlpha*t.alphaMultiplier+t.alphaOffset;this._renderDisplay.setAlpha(e);if(this._renderDisplay instanceof s.DisplayContainer)return;var a=255*t.redMultiplier+t.redOffset;var r=255*t.greenMultiplier+t.greenOffset;var i=255*t.blueMultiplier+t.blueOffset;var n=a<<16|r<<8|i;this._renderDisplay.setTint(n)};e.prototype._updateFrame=function(){if(this._renderDisplay instanceof s.DisplayContainer)return;var t=this._textureData;if(this._displayIndex>=0&&this._display!==null&&t!==null){var e=t.parent;if(this.armature.replacedTexture!==null){if(this.armature._replaceTextureAtlasData===null){e=r.BaseObject.borrowObject(s.TextureAtlasData);e.copyFrom(t.parent);e.renderTexture=this.armature.replacedTexture;this.armature._replaceTextureAtlasData=e}else e=this.armature._replaceTextureAtlasData;t=e.getTexture(t.name)}var a=t.renderTexture;if(a!==null){if(this._geometryData!==null){}else{this._renderDisplay.texture=a.texture;this._renderDisplay.frame=a;this._renderDisplay.setDisplayOrigin(this._pivotX,this._pivotY);this._textureScale=t.parent.scale*this.armature.armatureData.scale;this._renderDisplay.setScale(this._textureScale)}this._visibleDirty=true;return}}else{this._renderDisplay.x=0;this._renderDisplay.y=0;this._renderDisplay.setTexture(undefined)}};e.prototype._updateMesh=function(){};e.prototype._updateTransform=function(){this.updateGlobalTransform();var t=this.global;this._renderDisplay.x=t.x;this._renderDisplay.y=t.y;this._renderDisplay.rotation=t.rotation;this._renderDisplay["setSkew"](t.skew,0);this._renderDisplay.setScale(t.scaleX*this._textureScale,t.scaleY*this._textureScale)};e.prototype._identityTransform=function(){this._renderDisplay.setPosition();this._renderDisplay.setRotation();this._textureScale=1;this._renderDisplay.setScale(this._textureScale);this._renderDisplay["setSkew"](0)};return e}(r.Slot);s.Slot=t})(e=t.display||(t.display={}))})(t=r.phaser||(r.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(r){var t;(function(t){var e;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t._renderTexture=null;return t}t.toString=function(){return"[class dragonBones.PhaserTextureAtlasData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);if(this._renderTexture!==null)this._renderTexture.destroy();this._renderTexture=null};t.prototype.createTexture=function(){return r.BaseObject.borrowObject(a)};Object.defineProperty(t.prototype,"renderTexture",{get:function(){return this._renderTexture},set:function(t){if(!t||this._renderTexture===t)return;if(this._renderTexture)this._renderTexture.destroy();this._renderTexture=t;for(var e in this.textures){var a=this.textures[e];var r=this._renderTexture.add(e,0,a.region.x,a.region.y,a.region.width,a.region.height);if(a.rotated){r.rotated=true;r.updateUVsInverted()}a.renderTexture=r}},enumerable:true,configurable:true});return t}(r.TextureAtlasData);t.TextureAtlasData=e;var a=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.renderTexture=null;return t}t.toString=function(){return"[class dragonBones.PhaserTextureData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);if(this.renderTexture!==null)this.renderTexture.destroy();this.renderTexture=null};return t}(r.TextureData);t.TextureData=a})(e=t.display||(t.display={}))})(t=r.phaser||(r.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(r){var t;(function(t){var e=function(a){__extends(t,a);function t(t){var e=a.call(this,t)||this;e._tempMatrix1=new r.util.TransformMatrix;e._tempMatrix2=new r.util.TransformMatrix;e._tempMatrix3=new r.util.TransformMatrix;return e}t.prototype.batchSprite=function(t,e,a){this.renderer.setPipeline(this);var r=this._tempMatrix1;var i=this._tempMatrix2;var n=this._tempMatrix3;var s=t.frame;var o=s.glTexture;var l=s.u0;var h=s.v0;var u=s.u1;var f=s.v1;var _=s.x;var p=s.y;var c=s.width;var m=s.height;var d=-t.displayOriginX+_;var y=-t.displayOriginY+p;if(t.isCropped){var v=t["_crop"];if(v.flipX!==t.flipX||v.flipY!==t.flipY)s.updateCropUVs(v,t.flipX,t.flipY);l=v.u0;h=v.v0;u=v.u1;f=v.v1;c=v.width;m=v.height;_=v.x;p=v.y;d=-t.displayOriginX+_;y=-t.displayOriginY+p}if(t.flipX){d+=c;c*=-1}if(t.flipY){y+=m;m*=-1}var g=d+c;var D=y+m;i.applyITRSC(t.x,t.y,t.rotation,t.scaleX,t.scaleY,t["skewX"]||0,t["skewY"]||0);r.copyFrom(e["matrix"]);if(a){r.multiplyWithOffset(a,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY);i.e=t.x;i.f=t.y;r.multiply(i,n)}else{i.e-=e.scrollX*t.scrollFactorX;i.f-=e.scrollY*t.scrollFactorY;r.multiply(i,n)}var T=n.getX(d,y);var b=n.getY(d,y);var A=n.getX(d,D);var P=n.getY(d,D);var S=n.getX(g,D);var O=n.getY(g,D);var x=n.getX(g,y);var B=n.getY(g,y);var M=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(t["_tintTL"],e.alpha*t["_alphaTL"]);var E=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(t["_tintTR"],e.alpha*t["_alphaTR"]);var I=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(t["_tintBL"],e.alpha*t["_alphaBL"]);var F=Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha(t["_tintBR"],e.alpha*t["_alphaBR"]);if(e.roundPixels){T|=0;b|=0;A|=0;P|=0;S|=0;O|=0;x|=0;B|=0}this.setTexture2D(o,0);var w=t["_isTinted"]&&t.tintFill;this.batchQuad(T,b,A,P,S,O,x,B,l,h,u,f,M,E,I,F,w)};return t}(Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline);t.TextureTintPipeline=e})(t=r.pipeline||(r.pipeline={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(t){var e;(function(a){a.FileTypes={IMAGE:"imageFile",JSON:"jsonFile",BINARY:"binaryFile",map:{imageFile:Phaser.Loader.FileTypes.ImageFile,jsonFile:Phaser.Loader.FileTypes.JSONFile,binaryFile:Phaser.Loader.FileTypes.BinaryFile},setType:function(t,e){a.FileTypes.map[t]=e},getType:function(t){return a.FileTypes.map[t]}}})(e=t.plugin||(t.plugin={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(t){var e;(function(g){var t=function(v){__extends(t,v);function t(t,e,a,r,i,n,s,o){var l=this;var h;var u;var f;var _;var p=g.FileTypes.getType(g.FileTypes.BINARY);var c=g.FileTypes.getType(g.FileTypes.JSON);var m=g.FileTypes.getType(g.FileTypes.IMAGE);var d=function(t,e,a,r){var i="json";if(r&&r.responseType){switch(r.responseType){case"arraybuffer":case"blob":i="bin";break;case"json":case"text":i="json";break}}return i==="bin"?new p(t,e,a,r):new c(t,e,a,r)};if(Phaser.Utils.Objects.IsPlainObject(e)){var y=e;_=Phaser.Utils.Objects.GetFastValue(y,"key");h=new m(t,{key:_,url:Phaser.Utils.Objects.GetFastValue(y,"textureURL"),extension:Phaser.Utils.Objects.GetFastValue(y,"textureExtension","png"),xhrSettings:Phaser.Utils.Objects.GetFastValue(y,"textureXhrSettings")});u=new c(t,{key:_+"_atlasjson",url:Phaser.Utils.Objects.GetFastValue(y,"atlasURL"),extension:Phaser.Utils.Objects.GetFastValue(y,"atlasExtension","json"),xhrSettings:Phaser.Utils.Objects.GetFastValue(y,"atlasXhrSettings")});f=d(t,_,Phaser.Utils.Objects.GetFastValue(y,"boneURL"),Phaser.Utils.Objects.GetFastValue(y,"boneXhrSettings"))}else{_=e;h=new m(t,_,a,n);u=new c(t,_+"_atlasjson",r,s);f=d(t,_,i,o)}f.cache=t["cacheManager"].custom.dragonbone;l=v.call(this,t,"dragonbone",_,[h,u,f])||this;return l}t.prototype.addToCache=function(){if(this.isReadyToProcess()){var t=this.files[0];var e=this.files[1];var a=this.files[2];e.addToCache();a.addToCache();t.addToCache();this.complete=true}};return t}(Phaser.Loader.MultiFile);g.DragonBonesFile=t})(e=t.plugin||(t.plugin={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e;(function(u){var t;(function(l){var t=function(n){__extends(t,n);function t(t,e){var a=n.call(this,t,e)||this;var r=a.game;r.cache.addCustom("dragonbone");if(a.game.config.renderType===Phaser.WEBGL){var i=a.game.renderer;if(!i.hasPipeline("PhaserTextureTintPipeline"))i.addPipeline("PhaserTextureTintPipeline",new u.pipeline.TextureTintPipeline({game:r,renderer:i}))}e.registerGameObject("dragonBones",s);e.registerGameObject("armature",o);e.registerFileType("dragonbone",h,t);return a}t.prototype.createArmature=function(t,e,a,r,i){if(i===void 0){i=1}var n=this.factory.buildArmatureDisplay(t,e,a,r,i);this.systems.displayList.add(n);this._dbInst.clock.add(n.armature);return n};t.prototype.createDragonBones=function(t,e){if(e===void 0){e=1}return this.factory.buildDragonBonesData(t,e)};Object.defineProperty(t.prototype,"factory",{get:function(){if(!this._factory){this._dbInst=new dragonBones.DragonBones(new u.util.EventDispatcher);this._factory=new u.Factory(this._dbInst,this.scene)}return this._factory},enumerable:true,configurable:true});t.prototype.createSlotDisplayPlaceholder=function(){return new u.display.SlotImage(this.scene,0,0)};t.prototype.boot=function(){this.systems.events.once("destroy",this.destroy,this);this.start()};t.prototype.start=function(){var t=this.systems.events;t.on("update",this.update,this);t.once("shutdown",this.shutdown,this)};t.prototype.update=function(t,e){this._dbInst&&this._dbInst.advanceTime(e*.001)};t.prototype.shutdown=function(){var t=this.systems.events;t.off("update",this.update,this);t.off("shutdown",this.shutdown,this)};t.prototype.destroy=function(){this.shutdown();this._factory=this._dbInst=null;this.pluginManager=this.game=this.scene=this.systems=null};return t}(Phaser.Plugins.ScenePlugin);l.DragonBonesScenePlugin=t;var s=function(t,e){if(e===void 0){e=1}return this.scene.dragonbone.createDragonBones(t,e)};var o=function(t,e,a,r){return this.scene.dragonbone.createArmature(t,e,a,r)};var h=function(t,e,a,r,i,n,s){var o=new l.DragonBonesFile(this,t,e,a,r,i,n,s);this.addFile(o.files);return this}})(t=u.plugin||(u.plugin={}))})(e=t.phaser||(t.phaser={}))})(dragonBones||(dragonBones={}));var dragonBones;(function(o){var t;(function(s){var t=function(i){__extends(t,i);function t(t,e,a){var r=i.call(this,a)||this;r._scene=e;r._dragonBones=t;return r}t.prototype._isSupportMesh=function(){console.warn("Mesh is not supported yet");return false};t.prototype._buildTextureAtlasData=function(t,e){if(t){t.renderTexture=e}else t=o.BaseObject.borrowObject(s.display.TextureAtlasData);return t};t.prototype._buildArmature=function(t){var e=o.BaseObject.borrowObject(o.Armature);var a=new s.display.ArmatureDisplay(this._scene);e.init(t.armature,a,a,this._dragonBones);return e};t.prototype._buildSlot=function(t,e,a){var r=o.BaseObject.borrowObject(s.display.Slot);var i=this._scene.dragonbone.createSlotDisplayPlaceholder();var n=i;r.init(e,a,i,n);return r};t.prototype.buildArmatureDisplay=function(t,e,a,r,i){if(a===void 0){a=""}if(r===void 0){r=""}if(i===void 0){i=1}var n;if(this.buildDragonBonesData(e,i)){n=this.buildArmature(t,e,a,r)}return n.display};t.prototype.buildDragonBonesData=function(t,e){if(e===void 0){e=1}var a=this._dragonBonesDataMap[t];if(!a){var r=this._scene.cache;var i=r.custom.dragonbone.get(t);if(i){a=this.parseDragonBonesData(i,t,e);var n=this._scene.textures.get(t);var s=r.json.get(t+"_atlasjson");this.parseTextureAtlasData(s,n,n.key,e)}}return a};return t}(o.BaseFactory);s.Factory=t})(t=o.phaser||(o.phaser={}))})(dragonBones||(dragonBones={})); \ No newline at end of file diff --git a/Phaser/Demos/libs/dragonBones/phaser-plugin.d.ts b/Phaser/Demos/libs/dragonBones/phaser-plugin.d.ts new file mode 100644 index 00000000..40229bc5 --- /dev/null +++ b/Phaser/Demos/libs/dragonBones/phaser-plugin.d.ts @@ -0,0 +1,23 @@ +// Extends phaser declaration + +declare namespace Phaser { + namespace Loader { + interface LoaderPlugin { + dragonbone: (dragonbonesName: string | object, + textureURL?: string, + atlasURL?: string, + boneURL?: string, + textureXhrSettings?: XHRSettingsObject, + atlasXhrSettings?: XHRSettingsObject, + boneXhrSettings?: XHRSettingsObject) => Phaser.Loader.LoaderPlugin; + } + } + + namespace GameObjects { + interface GameObjectFactory { + armature: (armature: string, dragonBones?: string, skinName?: string, atlasTextureName?: string) + => dragonBones.phaser.display.ArmatureDisplay; + dragonBones: (dragonBonesName: string, textureScale?: number) => dragonBones.DragonBonesData; + } + } +} diff --git a/Phaser/Demos/libs/phaser/.gitkeep b/Phaser/Demos/libs/phaser/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Phaser/Demos/libs/phaser/phaser.d.ts b/Phaser/Demos/libs/phaser/phaser.d.ts new file mode 100644 index 00000000..8eb1194f --- /dev/null +++ b/Phaser/Demos/libs/phaser/phaser.d.ts @@ -0,0 +1,83455 @@ +declare type DataEachCallback = (parent: any, key: string, value: any, ...args: any[])=>void; + +declare type ContentLoadedCallback = ()=>void; + +declare type CreateCallback = (bob: Phaser.GameObjects.Bob, index: integer)=>void; + +declare type EachContainerCallback = (item: any, ...args: any[])=>void; + +declare type LightForEach = (light: Phaser.GameObjects.Light)=>void; + +/** + * A custom function that will be responsible for wrapping the text. + */ +declare type TextStyleWordWrapCallback = (text: string, textObject: Phaser.GameObjects.Text)=>void; + +declare type CenterFunction = (triangle: Phaser.Geom.Triangle)=>void; + +declare namespace Phaser { + namespace Actions { + /** + * Takes an array of Game Objects, or any objects that have a public `angle` property, + * and then adds the given value to each of their `angle` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `Angle(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `angle` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function Angle(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of objects and passes each of them to the given callback. + * @param items The array of items to be updated by this action. + * @param callback The callback to be invoked. It will be passed just one argument: the item from the array. + * @param context The scope in which the callback will be invoked. + */ + function Call(items: G, callback: Phaser.Types.Actions.CallCallback, context: any): G; + + /** + * Takes an array of objects and returns the first element in the array that has properties which match + * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` + * then it would return the first item which had the property `scaleX` set to 0.5 and `alpha` set to 1. + * + * To use this with a Group: `GetFirst(group.getChildren(), compare, index)` + * @param items The array of items to be searched by this action. + * @param compare The comparison object. Each property in this object will be checked against the items of the array. + * @param index An optional offset to start searching from within the items array. Default 0. + */ + function GetFirst(items: G, compare: object, index?: integer): object | Phaser.GameObjects.GameObject; + + /** + * Takes an array of objects and returns the last element in the array that has properties which match + * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` + * then it would return the last item which had the property `scaleX` set to 0.5 and `alpha` set to 1. + * + * To use this with a Group: `GetLast(group.getChildren(), compare, index)` + * @param items The array of items to be searched by this action. + * @param compare The comparison object. Each property in this object will be checked against the items of the array. + * @param index An optional offset to start searching from within the items array. Default 0. + */ + function GetLast(items: G, compare: object, index?: integer): object | Phaser.GameObjects.GameObject; + + /** + * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, + * and then aligns them based on the grid configuration given to this action. + * @param items The array of items to be updated by this action. + * @param options The GridAlign Configuration object. + */ + function GridAlign(items: G, options: Phaser.Types.Actions.GridAlignConfig): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `alpha` property, + * and then adds the given value to each of their `alpha` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncAlpha(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `alpha` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function IncAlpha(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `x` property, + * and then adds the given value to each of their `x` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncX(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `x` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function IncX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, + * and then adds the given value to each of them. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncXY(group.getChildren(), x, y, stepX, stepY)` + * @param items The array of items to be updated by this action. + * @param x The amount to be added to the `x` property. + * @param y The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value. Default x. + * @param stepX This is added to the `x` amount, multiplied by the iteration counter. Default 0. + * @param stepY This is added to the `y` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function IncXY(items: G, x: number, y?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `y` property, + * and then adds the given value to each of their `y` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncY(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `y` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function IncY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param circle The Circle to position the Game Objects on. + * @param startAngle Optional angle to start position from, in radians. Default 0. + * @param endAngle Optional angle to stop position at, in radians. Default 6.28. + */ + function PlaceOnCircle(items: G, circle: Phaser.Geom.Circle, startAngle?: number, endAngle?: number): G; + + /** + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of an Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param ellipse The Ellipse to position the Game Objects on. + * @param startAngle Optional angle to start position from, in radians. Default 0. + * @param endAngle Optional angle to stop position at, in radians. Default 6.28. + */ + function PlaceOnEllipse(items: G, ellipse: Phaser.Geom.Ellipse, startAngle?: number, endAngle?: number): G; + + /** + * Positions an array of Game Objects on evenly spaced points of a Line. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param line The Line to position the Game Objects on. + */ + function PlaceOnLine(items: G, line: Phaser.Geom.Line): G; + + /** + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. + * + * Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction. + * If the `shift` parameter is given you can offset where placement begins. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param rect The Rectangle to position the Game Objects on. + * @param shift An optional positional offset. Default 1. + */ + function PlaceOnRectangle(items: G, rect: Phaser.Geom.Rectangle, shift?: integer): G; + + /** + * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param triangle The Triangle to position the Game Objects on. + * @param stepRate An optional step rate, to increase or decrease the packing of the Game Objects on the lines. Default 1. + */ + function PlaceOnTriangle(items: G, triangle: Phaser.Geom.Triangle, stepRate?: number): G; + + /** + * Play an animation with the given key, starting at the given startFrame on all Game Objects in items. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param key The name of the animation to play. + * @param startFrame The starting frame of the animation with the given key. + */ + function PlayAnimation(items: G, key: string, startFrame?: string | integer): G; + + /** + * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, + * and then adds the given value to it. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `PropertyValueInc(group.getChildren(), key, value, step)` + * @param items The array of items to be updated by this action. + * @param key The property to be updated. + * @param value The amount to be added to the property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function PropertyValueInc(items: G, key: string, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` + * @param items The array of items to be updated by this action. + * @param key The property to be updated. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function PropertyValueSet(items: G, key: string, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects and positions them at random locations within the Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param circle The Circle to position the Game Objects within. + */ + function RandomCircle(items: G, circle: Phaser.Geom.Circle): G; + + /** + * Takes an array of Game Objects and positions them at random locations within the Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param ellipse The Ellipse to position the Game Objects within. + */ + function RandomEllipse(items: G, ellipse: Phaser.Geom.Ellipse): G; + + /** + * Takes an array of Game Objects and positions them at random locations on the Line. + * + * If you wish to pass a `Phaser.GameObjects.Line` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param line The Line to position the Game Objects randomly on. + */ + function RandomLine(items: G, line: Phaser.Geom.Line): G; + + /** + * Takes an array of Game Objects and positions them at random locations within the Rectangle. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param rect The Rectangle to position the Game Objects within. + */ + function RandomRectangle(items: G, rect: Phaser.Geom.Rectangle): G; + + /** + * Takes an array of Game Objects and positions them at random locations within the Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param triangle The Triangle to position the Game Objects within. + */ + function RandomTriangle(items: G, triangle: Phaser.Geom.Triangle): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `rotation` property, + * and then adds the given value to each of their `rotation` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `Rotate(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `rotation` property (in radians). + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function Rotate(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Rotates each item around the given point by the given angle. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param point Any object with public `x` and `y` properties. + * @param angle The angle to rotate by, in radians. + */ + function RotateAround(items: G, point: object, angle: number): G; + + /** + * Rotates an array of Game Objects around a point by the given angle and distance. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param point Any object with public `x` and `y` properties. + * @param angle The angle to rotate by, in radians. + * @param distance The distance from the point of rotation in pixels. + */ + function RotateAroundDistance(items: G, point: object, angle: number, distance: number): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `scaleX` property, + * and then adds the given value to each of their `scaleX` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `ScaleX(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `scaleX` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function ScaleX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties, + * and then adds the given value to each of them. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `ScaleXY(group.getChildren(), scaleX, scaleY, stepX, stepY)` + * @param items The array of items to be updated by this action. + * @param scaleX The amount to be added to the `scaleX` property. + * @param scaleY The amount to be added to the `scaleY` property. If `undefined` or `null` it uses the `scaleX` value. + * @param stepX This is added to the `scaleX` amount, multiplied by the iteration counter. Default 0. + * @param stepY This is added to the `y` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function ScaleXY(items: G, scaleX: number, scaleY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have a public `scaleY` property, + * and then adds the given value to each of their `scaleY` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `ScaleY(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to be added to the `scaleY` property. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function ScaleY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `alpha` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetAlpha(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetAlpha(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `blendMode` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetBlendMode(group.getChildren(), value)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetBlendMode(items: G, value: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `depth` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetDepth(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetDepth(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param hitAreaCallback A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. + */ + function SetHitArea(items: G, hitArea: any, hitAreaCallback: Phaser.Types.Input.HitAreaCallback): G; + + /** + * Takes an array of Game Objects, or any objects that have the public properties `originX` and `originY` + * and then sets them to the given values. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetOrigin(group.getChildren(), originX, originY, stepX, stepY)` + * @param items The array of items to be updated by this action. + * @param originX The amount to set the `originX` property to. + * @param originY The amount to set the `originY` property to. If `undefined` or `null` it uses the `originX` value. + * @param stepX This is added to the `originX` amount, multiplied by the iteration counter. Default 0. + * @param stepY This is added to the `originY` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetOrigin(items: G, originX: number, originY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `rotation` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetRotation(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetRotation(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public properties `scaleX` and `scaleY` + * and then sets them to the given values. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetScale(group.getChildren(), scaleX, scaleY, stepX, stepY)` + * @param items The array of items to be updated by this action. + * @param scaleX The amount to set the `scaleX` property to. + * @param scaleY The amount to set the `scaleY` property to. If `undefined` or `null` it uses the `scaleX` value. + * @param stepX This is added to the `scaleX` amount, multiplied by the iteration counter. Default 0. + * @param stepY This is added to the `scaleY` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetScale(items: G, scaleX: number, scaleY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `scaleX` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetScaleX(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetScaleX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `scaleY` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetScaleY(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetScaleY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public method setTint() and then updates it to the given value(s). You can specify tint color per corner or provide only one color value for `topLeft` parameter, in which case whole item will be tinted with that color. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param topLeft The tint being applied to top-left corner of item. If other parameters are given no value, this tint will be applied to whole item. + * @param topRight The tint to be applied to top-right corner of item. + * @param bottomLeft The tint to be applied to the bottom-left corner of item. + * @param bottomRight The tint to be applied to the bottom-right corner of item. + */ + function SetTint(items: G, topLeft: number, topRight?: number, bottomLeft?: number, bottomRight?: number): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `visible` + * and then sets it to the given value. + * + * To use this with a Group: `SetVisible(group.getChildren(), value)` + * @param items The array of items to be updated by this action. + * @param value The value to set the property to. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetVisible(items: G, value: boolean, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `x` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetX(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public properties `x` and `y` + * and then sets them to the given values. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetXY(group.getChildren(), x, y, stepX, stepY)` + * @param items The array of items to be updated by this action. + * @param x The amount to set the `x` property to. + * @param y The amount to set the `y` property to. If `undefined` or `null` it uses the `x` value. Default x. + * @param stepX This is added to the `x` amount, multiplied by the iteration counter. Default 0. + * @param stepY This is added to the `y` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetXY(items: G, x: number, y?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + + /** + * Takes an array of Game Objects, or any objects that have the public property `y` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetY(group.getChildren(), value, step)` + * @param items The array of items to be updated by this action. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. Default 0. + * @param index An optional offset to start searching from within the items array. Default 0. + * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. + */ + function SetY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + + /** + * Iterate through the items array changing the position of each element to be that of the element that came before + * it in the array (or after it if direction = 1) + * + * The first items position is set to x/y. + * + * The final x/y coords are returned + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param x The x coordinate to place the first item in the array at. + * @param y The y coordinate to place the first item in the array at. + * @param direction The iteration direction. 0 = first to last and 1 = last to first. Default 0. + * @param output An optional objec to store the final objects position in. + */ + function ShiftPosition(items: G, x: number, y: number, direction?: integer, output?: O): O; + + /** + * Shuffles the array in place. The shuffled array is both modified and returned. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + */ + function Shuffle(items: G): G; + + /** + * Smootherstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param property The property of the Game Object to interpolate. + * @param min The minimum interpolation value. + * @param max The maximum interpolation value. + * @param inc Should the values be incremented? `true` or set (`false`) Default false. + */ + function SmootherStep(items: G, property: string, min: number, max: number, inc?: boolean): G; + + /** + * Smoothstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param property The property of the Game Object to interpolate. + * @param min The minimum interpolation value. + * @param max The maximum interpolation value. + * @param inc Should the values be incremented? `true` or set (`false`) Default false. + */ + function SmoothStep(items: G, property: string, min: number, max: number, inc?: boolean): G; + + /** + * Takes an array of Game Objects and then modifies their `property` so the value equals, or is incremented, by the + * calculated spread value. + * + * The spread value is derived from the given `min` and `max` values and the total number of items in the array. + * + * For example, to cause an array of Sprites to change in alpha from 0 to 1 you could call: + * + * ```javascript + * Phaser.Actions.Spread(itemsArray, 'alpha', 0, 1); + * ``` + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param property The property of the Game Object to spread. + * @param min The minimum value. + * @param max The maximum value. + * @param inc Should the values be incremented? `true` or set (`false`) Default false. + */ + function Spread(items: G, property: string, min: number, max: number, inc?: boolean): G; + + /** + * Takes an array of Game Objects and toggles the visibility of each one. + * Those previously `visible = false` will become `visible = true`, and vice versa. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + */ + function ToggleVisible(items: G): G; + + /** + * Wrap each item's coordinates within a rectangle's area. + * @param items An array of Game Objects. The contents of this array are updated by this Action. + * @param rect The rectangle. + * @param padding An amount added to each side of the rectangle during the operation. Default 0. + */ + function WrapInRectangle(items: G, rect: Phaser.Geom.Rectangle, padding?: number): G; + + } + + namespace Animations { + /** + * A Frame based Animation. + * + * This consists of a key, some default values (like the frame rate) and a bunch of Frame objects. + * + * The Animation Manager creates these. Game Objects don't own an instance of these directly. + * Game Objects have the Animation Component, which are like playheads to global Animations (these objects) + * So multiple Game Objects can have playheads all pointing to this one Animation instance. + */ + class Animation extends Phaser.Events.EventEmitter { + /** + * + * @param manager A reference to the global Animation Manager + * @param key The unique identifying string for this animation. + * @param config The Animation configuration. + */ + constructor(manager: Phaser.Animations.AnimationManager, key: string, config: Phaser.Types.Animations.Animation); + + /** + * A reference to the global Animation Manager. + */ + manager: Phaser.Animations.AnimationManager; + + /** + * The unique identifying string for this animation. + */ + key: string; + + /** + * A frame based animation (as opposed to a bone based animation) + */ + type: string; + + /** + * Extract all the frame data into the frames array. + */ + frames: Phaser.Animations.AnimationFrame[]; + + /** + * The frame rate of playback in frames per second (default 24 if duration is null) + */ + frameRate: integer; + + /** + * How long the animation should play for, in milliseconds. + * If the `frameRate` property has been set then it overrides this value, + * otherwise the `frameRate` is derived from `duration`. + */ + duration: integer; + + /** + * How many ms per frame, not including frame specific modifiers. + */ + msPerFrame: integer; + + /** + * Skip frames if the time lags, or always advanced anyway? + */ + skipMissedFrames: boolean; + + /** + * The delay in ms before the playback will begin. + */ + delay: integer; + + /** + * Number of times to repeat the animation. Set to -1 to repeat forever. + */ + repeat: integer; + + /** + * The delay in ms before the a repeat play starts. + */ + repeatDelay: integer; + + /** + * Should the animation yoyo (reverse back down to the start) before repeating? + */ + yoyo: boolean; + + /** + * Should the GameObject's `visible` property be set to `true` when the animation starts to play? + */ + showOnStart: boolean; + + /** + * Should the GameObject's `visible` property be set to `false` when the animation finishes? + */ + hideOnComplete: boolean; + + /** + * Global pause. All Game Objects using this Animation instance are impacted by this property. + */ + paused: boolean; + + /** + * Add frames to the end of the animation. + * @param config [description] + */ + addFrame(config: string | Phaser.Types.Animations.AnimationFrame[]): Phaser.Animations.Animation; + + /** + * Add frame/s into the animation. + * @param index The index to insert the frame at within the animation. + * @param config [description] + */ + addFrameAt(index: integer, config: string | Phaser.Types.Animations.AnimationFrame[]): Phaser.Animations.Animation; + + /** + * Check if the given frame index is valid. + * @param index The index to be checked. + */ + checkFrame(index: integer): boolean; + + /** + * [description] + * @param component [description] + */ + protected completeAnimation(component: Phaser.GameObjects.Components.Animation): void; + + /** + * [description] + * @param component [description] + * @param includeDelay [description] Default true. + */ + protected getFirstTick(component: Phaser.GameObjects.Components.Animation, includeDelay?: boolean): void; + + /** + * Returns the AnimationFrame at the provided index + * @param index The index in the AnimationFrame array + */ + protected getFrameAt(index: integer): Phaser.Animations.AnimationFrame; + + /** + * [description] + * @param textureManager [description] + * @param frames [description] + * @param defaultTextureKey [description] + */ + getFrames(textureManager: Phaser.Textures.TextureManager, frames: string | Phaser.Types.Animations.AnimationFrame[], defaultTextureKey?: string): Phaser.Animations.AnimationFrame[]; + + /** + * [description] + * @param component [description] + */ + getNextTick(component: Phaser.GameObjects.Components.Animation): void; + + /** + * Returns the frame closest to the given progress value between 0 and 1. + * @param value A value between 0 and 1. + */ + getFrameByProgress(value: number): Phaser.Animations.AnimationFrame; + + /** + * Advance the animation frame. + * @param component The Animation Component to advance. + */ + nextFrame(component: Phaser.GameObjects.Components.Animation): void; + + /** + * Returns the animation last frame. + */ + getLastFrame(): Phaser.Animations.AnimationFrame; + + /** + * [description] + * @param component [description] + */ + previousFrame(component: Phaser.GameObjects.Components.Animation): void; + + /** + * [description] + * @param frame [description] + */ + removeFrame(frame: Phaser.Animations.AnimationFrame): Phaser.Animations.Animation; + + /** + * Removes a frame from the AnimationFrame array at the provided index + * and updates the animation accordingly. + * @param index The index in the AnimationFrame array + */ + removeFrameAt(index: integer): Phaser.Animations.Animation; + + /** + * [description] + * @param component [description] + */ + repeatAnimation(component: Phaser.GameObjects.Components.Animation): void; + + /** + * Sets the texture frame the animation uses for rendering. + * @param component [description] + */ + setFrame(component: Phaser.GameObjects.Components.Animation): void; + + /** + * Converts the animation data to JSON. + */ + toJSON(): Phaser.Types.Animations.JSONAnimation; + + /** + * [description] + */ + updateFrameSequence(): Phaser.Animations.Animation; + + /** + * [description] + */ + pause(): Phaser.Animations.Animation; + + /** + * [description] + */ + resume(): Phaser.Animations.Animation; + + /** + * [description] + */ + destroy(): void; + + } + + /** + * A single frame in an Animation sequence. + * + * An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other + * frames in the animation, and index data. It also has the ability to modify the animation timing. + * + * AnimationFrames are generated automatically by the Animation class. + */ + class AnimationFrame { + /** + * + * @param textureKey The key of the Texture this AnimationFrame uses. + * @param textureFrame The key of the Frame within the Texture that this AnimationFrame uses. + * @param index The index of this AnimationFrame within the Animation sequence. + * @param frame A reference to the Texture Frame this AnimationFrame uses for rendering. + */ + constructor(textureKey: string, textureFrame: string | integer, index: integer, frame: Phaser.Textures.Frame); + + /** + * The key of the Texture this AnimationFrame uses. + */ + textureKey: string; + + /** + * The key of the Frame within the Texture that this AnimationFrame uses. + */ + textureFrame: string | integer; + + /** + * The index of this AnimationFrame within the Animation sequence. + */ + index: integer; + + /** + * A reference to the Texture Frame this AnimationFrame uses for rendering. + */ + frame: Phaser.Textures.Frame; + + /** + * Is this the first frame in an animation sequence? + */ + readonly isFirst: boolean; + + /** + * Is this the last frame in an animation sequence? + */ + readonly isLast: boolean; + + /** + * A reference to the AnimationFrame that comes before this one in the animation, if any. + */ + readonly prevFrame: Phaser.Animations.AnimationFrame; + + /** + * A reference to the AnimationFrame that comes after this one in the animation, if any. + */ + readonly nextFrame: Phaser.Animations.AnimationFrame; + + /** + * Additional time (in ms) that this frame should appear for during playback. + * The value is added onto the msPerFrame set by the animation. + */ + duration: number; + + /** + * What % through the animation does this frame come? + * This value is generated when the animation is created and cached here. + */ + readonly progress: number; + + /** + * Generates a JavaScript object suitable for converting to JSON. + */ + toJSON(): Phaser.Types.Animations.JSONAnimationFrame; + + /** + * Destroys this object by removing references to external resources and callbacks. + */ + destroy(): void; + + } + + /** + * The Animation Manager. + * + * Animations are managed by the global Animation Manager. This is a singleton class that is + * responsible for creating and delivering animations and their corresponding data to all Game Objects. + * Unlike plugins it is owned by the Game instance, not the Scene. + * + * Sprites and other Game Objects get the data they need from the AnimationManager. + */ + class AnimationManager extends Phaser.Events.EventEmitter { + /** + * + * @param game A reference to the Phaser.Game instance. + */ + constructor(game: Phaser.Game); + + /** + * A reference to the Phaser.Game instance. + */ + protected game: Phaser.Game; + + /** + * A reference to the Texture Manager. + */ + protected textureManager: Phaser.Textures.TextureManager; + + /** + * The global time scale of the Animation Manager. + * + * This scales the time delta between two frames, thus influencing the speed of time for the Animation Manager. + */ + globalTimeScale: number; + + /** + * The Animations registered in the Animation Manager. + * + * This map should be modified with the {@link #add} and {@link #create} methods of the Animation Manager. + */ + protected anims: Phaser.Structs.Map; + + /** + * Whether the Animation Manager is paused along with all of its Animations. + */ + paused: boolean; + + /** + * The name of this Animation Manager. + */ + name: string; + + /** + * Registers event listeners after the Game boots. + */ + boot(): void; + + /** + * Adds an existing Animation to the Animation Manager. + * @param key The key under which the Animation should be added. The Animation will be updated with it. Must be unique. + * @param animation The Animation which should be added to the Animation Manager. + */ + add(key: string, animation: Phaser.Animations.Animation): Phaser.Animations.AnimationManager; + + /** + * Checks to see if the given key is already in use within the Animation Manager or not. + * + * Animations are global. Keys created in one scene can be used from any other Scene in your game. They are not Scene specific. + * @param key The key of the Animation to check. + */ + exists(key: string): boolean; + + /** + * Creates a new Animation and adds it to the Animation Manager. + * + * Animations are global. Once created, you can use them in any Scene in your game. They are not Scene specific. + * + * If an invalid key is given this method will return `false`. + * + * If you pass the key of an animation that already exists in the Animation Manager, that animation will be returned. + * + * A brand new animation is only created if the key is valid and not already in use. + * + * If you wish to re-use an existing key, call `AnimationManager.remove` first, then this method. + * @param config The configuration settings for the Animation. + */ + create(config: Phaser.Types.Animations.Animation): Phaser.Animations.Animation | false; + + /** + * Loads this Animation Manager's Animations and settings from a JSON object. + * @param data The JSON object to parse. + * @param clearCurrentAnimations If set to `true`, the current animations will be removed (`anims.clear()`). If set to `false` (default), the animations in `data` will be added. Default false. + */ + fromJSON(data: string | Phaser.Types.Animations.JSONAnimations | Phaser.Types.Animations.JSONAnimation, clearCurrentAnimations?: boolean): Phaser.Animations.Animation[]; + + /** + * [description] + * @param key The key for the texture containing the animation frames. + * @param config The configuration object for the animation frame names. + */ + generateFrameNames(key: string, config?: Phaser.Types.Animations.GenerateFrameNames): Phaser.Types.Animations.AnimationFrame[]; + + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. + * @param key The key for the texture containing the animation frames. + * @param config The configuration object for the animation frames. + */ + generateFrameNumbers(key: string, config: Phaser.Types.Animations.GenerateFrameNumbers): Phaser.Types.Animations.AnimationFrame[]; + + /** + * Get an Animation. + * @param key The key of the Animation to retrieve. + */ + get(key: string): Phaser.Animations.Animation; + + /** + * Load an Animation into a Game Object's Animation Component. + * @param child The Game Object to load the animation into. + * @param key The key of the animation to load. + * @param startFrame The name of a start frame to set on the loaded animation. + */ + load(child: Phaser.GameObjects.GameObject, key: string, startFrame?: string | integer): Phaser.GameObjects.GameObject; + + /** + * Pause all animations. + */ + pauseAll(): Phaser.Animations.AnimationManager; + + /** + * Play an animation on the given Game Objects that have an Animation Component. + * @param key The key of the animation to play on the Game Object. + * @param child The Game Objects to play the animation on. + */ + play(key: string, child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.Animations.AnimationManager; + + /** + * Remove an animation. + * @param key The key of the animation to remove. + */ + remove(key: string): Phaser.Animations.Animation; + + /** + * Resume all paused animations. + */ + resumeAll(): Phaser.Animations.AnimationManager; + + /** + * Takes an array of Game Objects that have an Animation Component and then + * starts the given animation playing on them, each one offset by the + * `stagger` amount given to this method. + * @param key The key of the animation to play on the Game Objects. + * @param children An array of Game Objects to play the animation on. They must have an Animation Component. + * @param stagger The amount of time, in milliseconds, to offset each play time by. Default 0. + */ + staggerPlay(key: string, children: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], stagger?: number): G; + + /** + * Get the animation data as javascript object by giving key, or get the data of all animations as array of objects, if key wasn't provided. + * @param key [description] + */ + toJSON(key: string): Phaser.Types.Animations.JSONAnimations; + + /** + * Destroy this Animation Manager and clean up animation definitions and references to other objects. + * This method should not be called directly. It will be called automatically as a response to a `destroy` event from the Phaser.Game instance. + */ + destroy(): void; + + } + + namespace Events { + /** + * The Add Animation Event. + * + * This event is dispatched when a new animation is added to the global Animation Manager. + * + * This can happen either as a result of an animation instance being added to the Animation Manager, + * or the Animation Manager creating a new animation directly. + */ + const ADD_ANIMATION: any; + + /** + * The Animation Complete Event. + * + * This event is dispatched by an Animation instance when it completes, i.e. finishes playing or is manually stopped. + * + * Be careful with the volume of events this could generate. If a group of Sprites all complete the same + * animation at the same time, this event will invoke its handler for each one of them. + */ + const ANIMATION_COMPLETE: any; + + /** + * The Animation Repeat Event. + * + * This event is dispatched when a currently playing animation repeats. + * + * The event is dispatched directly from the Animation object itself. Which means that listeners + * bound to this event will be invoked every time the Animation repeats, for every Game Object that may have it. + */ + const ANIMATION_REPEAT: any; + + /** + * The Animation Restart Event. + * + * This event is dispatched by an Animation instance when it restarts. + * + * Be careful with the volume of events this could generate. If a group of Sprites all restart the same + * animation at the same time, this event will invoke its handler for each one of them. + */ + const ANIMATION_RESTART: any; + + /** + * The Animation Start Event. + * + * This event is dispatched by an Animation instance when it starts playing. + * + * Be careful with the volume of events this could generate. If a group of Sprites all play the same + * animation at the same time, this event will invoke its handler for each one of them. + */ + const ANIMATION_START: any; + + /** + * The Pause All Animations Event. + * + * This event is dispatched when the global Animation Manager is told to pause. + * + * When this happens all current animations will stop updating, although it doesn't necessarily mean + * that the game has paused as well. + */ + const PAUSE_ALL: any; + + /** + * The Remove Animation Event. + * + * This event is dispatched when an animation is removed from the global Animation Manager. + */ + const REMOVE_ANIMATION: any; + + /** + * The Resume All Animations Event. + * + * This event is dispatched when the global Animation Manager resumes, having been previously paused. + * + * When this happens all current animations will continue updating again. + */ + const RESUME_ALL: any; + + /** + * The Sprite Animation Complete Event. + * + * This event is dispatched by a Sprite when an animation finishes playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_COMPLETE` event. + */ + const SPRITE_ANIMATION_COMPLETE: any; + + /** + * The Sprite Animation Key Complete Event. + * + * This event is dispatched by a Sprite when a specific animation finishes playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationcomplete-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationcomplete-explode`. + */ + const SPRITE_ANIMATION_KEY_COMPLETE: any; + + /** + * The Sprite Animation Key Repeat Event. + * + * This event is dispatched by a Sprite when a specific animation repeats playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrepeat-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrepeat-explode`. + */ + const SPRITE_ANIMATION_KEY_REPEAT: any; + + /** + * The Sprite Animation Key Restart Event. + * + * This event is dispatched by a Sprite when a specific animation restarts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrestart-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrestart-explode`. + */ + const SPRITE_ANIMATION_KEY_RESTART: any; + + /** + * The Sprite Animation Key Start Event. + * + * This event is dispatched by a Sprite when a specific animation starts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationstart-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationstart-explode`. + */ + const SPRITE_ANIMATION_KEY_START: any; + + /** + * The Sprite Animation Key Update Event. + * + * This event is dispatched by a Sprite when a specific animation playing on it updates. This happens when the animation changes frame, + * based on the animation frame rate and other factors like `timeScale` and `delay`. + * + * Listen for it on the Sprite using `sprite.on('animationupdate-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationupdate-explode`. + */ + const SPRITE_ANIMATION_KEY_UPDATE: any; + + /** + * The Sprite Animation Repeat Event. + * + * This event is dispatched by a Sprite when an animation repeats playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_REPEAT` event. + */ + const SPRITE_ANIMATION_REPEAT: any; + + /** + * The Sprite Animation Restart Event. + * + * This event is dispatched by a Sprite when an animation restarts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_RESTART` event. + */ + const SPRITE_ANIMATION_RESTART: any; + + /** + * The Sprite Animation Start Event. + * + * This event is dispatched by a Sprite when an animation starts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationstart', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_START` event. + */ + const SPRITE_ANIMATION_START: any; + + /** + * The Sprite Animation Update Event. + * + * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame, + * based on the animation frame rate and other factors like `timeScale` and `delay`. + * + * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_UPDATE` event. + */ + const SPRITE_ANIMATION_UPDATE: any; + + } + + } + + namespace Cache { + /** + * The BaseCache is a base Cache class that can be used for storing references to any kind of data. + * + * Data can be added, retrieved and removed based on the given keys. + * + * Keys are string-based. + */ + class BaseCache { + /** + * The Map in which the cache objects are stored. + * + * You can query the Map directly or use the BaseCache methods. + */ + entries: Phaser.Structs.Map; + + /** + * An instance of EventEmitter used by the cache to emit related events. + */ + events: Phaser.Events.EventEmitter; + + /** + * Adds an item to this cache. The item is referenced by a unique string, which you are responsible + * for setting and keeping track of. The item can only be retrieved by using this string. + * @param key The unique key by which the data added to the cache will be referenced. + * @param data The data to be stored in the cache. + */ + add(key: string, data: any): Phaser.Cache.BaseCache; + + /** + * Checks if this cache contains an item matching the given key. + * This performs the same action as `BaseCache.exists`. + * @param key The unique key of the item to be checked in this cache. + */ + has(key: string): boolean; + + /** + * Checks if this cache contains an item matching the given key. + * This performs the same action as `BaseCache.has` and is called directly by the Loader. + * @param key The unique key of the item to be checked in this cache. + */ + exists(key: string): boolean; + + /** + * Gets an item from this cache based on the given key. + * @param key The unique key of the item to be retrieved from this cache. + */ + get(key: string): any; + + /** + * Removes and item from this cache based on the given key. + * + * If an entry matching the key is found it is removed from the cache and a `remove` event emitted. + * No additional checks are done on the item removed. If other systems or parts of your game code + * are relying on this item, it is up to you to sever those relationships prior to removing the item. + * @param key The unique key of the item to remove from the cache. + */ + remove(key: string): Phaser.Cache.BaseCache; + + /** + * Returns all keys in use in this cache. + */ + getKeys(): string[]; + + /** + * Destroys this cache and all items within it. + */ + destroy(): void; + + } + + /** + * The Cache Manager is the global cache owned and maintained by the Game instance. + * + * Various systems, such as the file Loader, rely on this cache in order to store the files + * it has loaded. The manager itself doesn't store any files, but instead owns multiple BaseCache + * instances, one per type of file. You can also add your own custom caches. + */ + class CacheManager { + /** + * + * @param game A reference to the Phaser.Game instance that owns this CacheManager. + */ + constructor(game: Phaser.Game); + + /** + * A reference to the Phaser.Game instance that owns this CacheManager. + */ + protected game: Phaser.Game; + + /** + * A Cache storing all binary files, typically added via the Loader. + */ + binary: Phaser.Cache.BaseCache; + + /** + * A Cache storing all bitmap font data files, typically added via the Loader. + * Only the font data is stored in this cache, the textures are part of the Texture Manager. + */ + bitmapFont: Phaser.Cache.BaseCache; + + /** + * A Cache storing all JSON data files, typically added via the Loader. + */ + json: Phaser.Cache.BaseCache; + + /** + * A Cache storing all physics data files, typically added via the Loader. + */ + physics: Phaser.Cache.BaseCache; + + /** + * A Cache storing all shader source files, typically added via the Loader. + */ + shader: Phaser.Cache.BaseCache; + + /** + * A Cache storing all non-streaming audio files, typically added via the Loader. + */ + audio: Phaser.Cache.BaseCache; + + /** + * A Cache storing all text files, typically added via the Loader. + */ + text: Phaser.Cache.BaseCache; + + /** + * A Cache storing all html files, typically added via the Loader. + */ + html: Phaser.Cache.BaseCache; + + /** + * A Cache storing all WaveFront OBJ files, typically added via the Loader. + */ + obj: Phaser.Cache.BaseCache; + + /** + * A Cache storing all tilemap data files, typically added via the Loader. + * Only the data is stored in this cache, the textures are part of the Texture Manager. + */ + tilemap: Phaser.Cache.BaseCache; + + /** + * A Cache storing all xml data files, typically added via the Loader. + */ + xml: Phaser.Cache.BaseCache; + + /** + * An object that contains your own custom BaseCache entries. + * Add to this via the `addCustom` method. + */ + custom: {[key: string]: Phaser.Cache.BaseCache}; + + /** + * Add your own custom Cache for storing your own files. + * The cache will be available under `Cache.custom.key`. + * The cache will only be created if the key is not already in use. + * @param key The unique key of your custom cache. + */ + addCustom(key: string): Phaser.Cache.BaseCache; + + /** + * Removes all entries from all BaseCaches and destroys all custom caches. + */ + destroy(): void; + + } + + namespace Events { + /** + * The Cache Add Event. + * + * This event is dispatched by any Cache that extends the BaseCache each time a new object is added to it. + */ + const ADD: any; + + /** + * The Cache Remove Event. + * + * This event is dispatched by any Cache that extends the BaseCache each time an object is removed from it. + */ + const REMOVE: any; + + } + + } + + namespace Cameras { + namespace Scene2D { + /** + * A Base Camera class. + * + * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world, + * and can be positioned, rotated, zoomed and scrolled accordingly. + * + * A Camera consists of two elements: The viewport and the scroll values. + * + * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are + * created the same size as your game, but their position and size can be set to anything. This means if you + * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, + * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). + * + * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this + * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the + * viewport, and changing the viewport has no impact on the scrolling. + * + * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, + * allowing you to filter Game Objects out on a per-Camera basis. + * + * The Base Camera is extended by the Camera class, which adds in special effects including Fade, + * Flash and Camera Shake, as well as the ability to follow Game Objects. + * + * The Base Camera was introduced in Phaser 3.12. It was split off from the Camera class, to allow + * you to isolate special effects as needed. Therefore the 'since' values for properties of this class relate + * to when they were added to the Camera class. + */ + class BaseCamera extends Phaser.Events.EventEmitter implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.Visible { + /** + * + * @param x The x position of the Camera, relative to the top-left of the game canvas. + * @param y The y position of the Camera, relative to the top-left of the game canvas. + * @param width The width of the Camera, in pixels. + * @param height The height of the Camera, in pixels. + */ + constructor(x: number, y: number, width: number, height: number); + + /** + * A reference to the Scene this camera belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Game Scene Manager. + */ + sceneManager: Phaser.Scenes.SceneManager; + + /** + * A reference to the Game Scale Manager. + */ + scaleManager: Phaser.Scale.ScaleManager; + + /** + * A reference to the Scene's Camera Manager to which this Camera belongs. + */ + cameraManager: Phaser.Cameras.Scene2D.CameraManager; + + /** + * The Camera ID. Assigned by the Camera Manager and used to handle camera exclusion. + * This value is a bitmask. + */ + readonly id: integer; + + /** + * The name of the Camera. This is left empty for your own use. + */ + name: string; + + /** + * This property is un-used in v3.16. + * + * The resolution of the Game, used in most Camera calculations. + */ + readonly resolution: number; + + /** + * Should this camera round its pixel values to integers? + */ + roundPixels: boolean; + + /** + * Is this Camera visible or not? + * + * A visible camera will render and perform input tests. + * An invisible camera will not render anything and will skip input tests. + */ + visible: boolean; + + /** + * Is this Camera using a bounds to restrict scrolling movement? + * + * Set this property along with the bounds via `Camera.setBounds`. + */ + useBounds: boolean; + + /** + * The World View is a Rectangle that defines the area of the 'world' the Camera is currently looking at. + * This factors in the Camera viewport size, zoom and scroll position and is updated in the Camera preRender step. + * If you have enabled Camera bounds the worldview will be clamped to those bounds accordingly. + * You can use it for culling or intersection checks. + */ + readonly worldView: Phaser.Geom.Rectangle; + + /** + * Is this Camera dirty? + * + * A dirty Camera has had either its viewport size, bounds, scroll, rotation or zoom levels changed since the last frame. + * + * This flag is cleared during the `postRenderCamera` method of the renderer. + */ + dirty: boolean; + + /** + * Does this Camera have a transparent background? + */ + transparent: boolean; + + /** + * The background color of this Camera. Only used if `transparent` is `false`. + */ + backgroundColor: Phaser.Display.Color; + + /** + * The Camera alpha value. Setting this property impacts every single object that this Camera + * renders. You can either set the property directly, i.e. via a Tween, to fade a Camera in or out, + * or via the chainable `setAlpha` method instead. + */ + alpha: number; + + /** + * Should the camera cull Game Objects before checking them for input hit tests? + * In some special cases it may be beneficial to disable this. + */ + disableCull: boolean; + + /** + * The mid-point of the Camera in 'world' coordinates. + * + * Use it to obtain exactly where in the world the center of the camera is currently looking. + * + * This value is updated in the preRender method, after the scroll values and follower + * have been processed. + */ + readonly midPoint: Phaser.Math.Vector2; + + /** + * The horizontal origin of rotation for this Camera. + * + * By default the camera rotates around the center of the viewport. + * + * Changing the origin allows you to adjust the point in the viewport from which rotation happens. + * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. + * + * See `setOrigin` to set both origins in a single, chainable call. + */ + originX: number; + + /** + * The vertical origin of rotation for this Camera. + * + * By default the camera rotates around the center of the viewport. + * + * Changing the origin allows you to adjust the point in the viewport from which rotation happens. + * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. + * + * See `setOrigin` to set both origins in a single, chainable call. + */ + originY: number; + + /** + * The Mask this Camera is using during render. + * Set the mask using the `setMask` method. Remove the mask using the `clearMask` method. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Set the Alpha level of this Camera. The alpha controls the opacity of the Camera as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * @param value The Camera alpha value. Default 1. + */ + setAlpha(value?: number): this; + + /** + * Sets the rotation origin of this Camera. + * + * The values are given in the range 0 to 1 and are only used when calculating Camera rotation. + * + * By default the camera rotates around the center of the viewport. + * + * Changing the origin allows you to adjust the point in the viewport from which rotation happens. + * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Calculates what the Camera.scrollX and scrollY values would need to be in order to move + * the Camera so it is centered on the given x and y coordinates, without actually moving + * the Camera there. The results are clamped based on the Camera bounds, if set. + * @param x The horizontal coordinate to center on. + * @param y The vertical coordinate to center on. + * @param out A Vec2 to store the values in. If not given a new Vec2 is created. + */ + getScroll(x: number, y: number, out?: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Moves the Camera horizontally so that it is centered on the given x coordinate, bounds allowing. + * Calling this does not change the scrollY value. + * @param x The horizontal coordinate to center on. + */ + centerOnX(x: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Moves the Camera vertically so that it is centered on the given y coordinate, bounds allowing. + * Calling this does not change the scrollX value. + * @param y The vertical coordinate to center on. + */ + centerOnY(y: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Moves the Camera so that it is centered on the given coordinates, bounds allowing. + * @param x The horizontal coordinate to center on. + * @param y The vertical coordinate to center on. + */ + centerOn(x: number, y: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Moves the Camera so that it is looking at the center of the Camera Bounds, if enabled. + */ + centerToBounds(): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Moves the Camera so that it is re-centered based on its viewport size. + */ + centerToSize(): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Takes an array of Game Objects and returns a new array featuring only those objects + * visible by this camera. + * @param renderableObjects An array of Game Objects to cull. + */ + cull(renderableObjects: G): G; + + /** + * Converts the given `x` and `y` coordinates into World space, based on this Cameras transform. + * You can optionally provide a Vector2, or similar object, to store the results in. + * @param x The x position to convert to world space. + * @param y The y position to convert to world space. + * @param output An optional object to store the results in. If not provided a new Vector2 will be created. + */ + getWorldPoint(x: number, y: number, output?: O): O; + + /** + * Given a Game Object, or an array of Game Objects, it will update all of their camera filter settings + * so that they are ignored by this Camera. This means they will not be rendered by this Camera. + * @param entries The Game Object, or array of Game Objects, to be ignored by this Camera. + */ + ignore(entries: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Internal preRender step. + * @param resolution The game resolution, as set in the Scale Manager. + */ + protected preRender(resolution: number): void; + + /** + * Takes an x value and checks it's within the range of the Camera bounds, adjusting if required. + * Do not call this method if you are not using camera bounds. + * @param x The value to horizontally scroll clamp. + */ + clampX(x: number): number; + + /** + * Takes a y value and checks it's within the range of the Camera bounds, adjusting if required. + * Do not call this method if you are not using camera bounds. + * @param y The value to vertically scroll clamp. + */ + clampY(y: number): number; + + /** + * If this Camera has previously had movement bounds set on it, this will remove them. + */ + removeBounds(): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the rotation of this Camera. This causes everything it renders to appear rotated. + * + * Rotating a camera does not rotate the viewport itself, it is applied during rendering. + * @param value The cameras angle of rotation, given in degrees. Default 0. + */ + setAngle(value?: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Sets the background color for this Camera. + * + * By default a Camera has a transparent background but it can be given a solid color, with any level + * of transparency, via this method. + * + * The color value can be specified using CSS color notation, hex or numbers. + * @param color The color value. In CSS, hex or numeric color notation. Default 'rgba(0,0,0,0)'. + */ + setBackgroundColor(color?: string | number | Phaser.Types.Display.InputColorObject): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the bounds of the Camera. The bounds are an axis-aligned rectangle. + * + * The Camera bounds controls where the Camera can scroll to, stopping it from scrolling off the + * edges and into blank space. It does not limit the placement of Game Objects, or where + * the Camera viewport can be positioned. + * + * Temporarily disable the bounds by changing the boolean `Camera.useBounds`. + * + * Clear the bounds entirely by calling `Camera.removeBounds`. + * + * If you set bounds that are smaller than the viewport it will stop the Camera from being + * able to scroll. The bounds can be positioned where-ever you wish. By default they are from + * 0x0 to the canvas width x height. This means that the coordinate 0x0 is the top left of + * the Camera bounds. However, you can position them anywhere. So if you wanted a game world + * that was 2048x2048 in size, with 0x0 being the center of it, you can set the bounds x/y + * to be -1024, -1024, with a width and height of 2048. Depending on your game you may find + * it easier for 0x0 to be the top-left of the bounds, or you may wish 0x0 to be the middle. + * @param x The top-left x coordinate of the bounds. + * @param y The top-left y coordinate of the bounds. + * @param width The width of the bounds, in pixels. + * @param height The height of the bounds, in pixels. + * @param centerOn If `true` the Camera will automatically be centered on the new bounds. Default false. + */ + setBounds(x: integer, y: integer, width: integer, height: integer, centerOn?: boolean): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Returns a rectangle containing the bounds of the Camera. + * + * If the Camera does not have any bounds the rectangle will be empty. + * + * The rectangle is a copy of the bounds, so is safe to modify. + * @param out An optional Rectangle to store the bounds in. If not given, a new Rectangle will be created. + */ + getBounds(out?: Phaser.Geom.Rectangle): Phaser.Geom.Rectangle; + + /** + * Sets the name of this Camera. + * This value is for your own use and isn't used internally. + * @param value The name of the Camera. Default ''. + */ + setName(value?: string): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the position of the Camera viewport within the game. + * + * This does not change where the camera is 'looking'. See `setScroll` to control that. + * @param x The top-left x coordinate of the Camera viewport. + * @param y The top-left y coordinate of the Camera viewport. Default x. + */ + setPosition(x: number, y?: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the rotation of this Camera. This causes everything it renders to appear rotated. + * + * Rotating a camera does not rotate the viewport itself, it is applied during rendering. + * @param value The rotation of the Camera, in radians. Default 0. + */ + setRotation(value?: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Should the Camera round pixel values to whole integers when rendering Game Objects? + * + * In some types of game, especially with pixel art, this is required to prevent sub-pixel aliasing. + * @param value `true` to round Camera pixels, `false` to not. + */ + setRoundPixels(value: boolean): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Sets the Scene the Camera is bound to. + * + * Also populates the `resolution` property and updates the internal size values. + * @param scene The Scene the camera is bound to. + */ + setScene(scene: Phaser.Scene): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the position of where the Camera is looking within the game. + * You can also modify the properties `Camera.scrollX` and `Camera.scrollY` directly. + * Use this method, or the scroll properties, to move your camera around the game world. + * + * This does not change where the camera viewport is placed. See `setPosition` to control that. + * @param x The x coordinate of the Camera in the game world. + * @param y The y coordinate of the Camera in the game world. Default x. + */ + setScroll(x: number, y?: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the size of the Camera viewport. + * + * By default a Camera is the same size as the game, but can be made smaller via this method, + * allowing you to create mini-cam style effects by creating and positioning a smaller Camera + * viewport within your game. + * @param width The width of the Camera viewport. + * @param height The height of the Camera viewport. Default width. + */ + setSize(width: integer, height?: integer): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * This method sets the position and size of the Camera viewport in a single call. + * + * If you're trying to change where the Camera is looking at in your game, then see + * the method `Camera.setScroll` instead. This method is for changing the viewport + * itself, not what the camera can see. + * + * By default a Camera is the same size as the game, but can be made smaller via this method, + * allowing you to create mini-cam style effects by creating and positioning a smaller Camera + * viewport within your game. + * @param x The top-left x coordinate of the Camera viewport. + * @param y The top-left y coordinate of the Camera viewport. + * @param width The width of the Camera viewport. + * @param height The height of the Camera viewport. Default width. + */ + setViewport(x: number, y: number, width: integer, height?: integer): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Set the zoom value of the Camera. + * + * Changing to a smaller value, such as 0.5, will cause the camera to 'zoom out'. + * Changing to a larger value, such as 2, will cause the camera to 'zoom in'. + * + * A value of 1 means 'no zoom' and is the default. + * + * Changing the zoom does not impact the Camera viewport in any way, it is only applied during rendering. + * @param value The zoom value of the Camera. The minimum it can be is 0.001. Default 1. + */ + setZoom(value?: number): Phaser.Cameras.Scene2D.BaseCamera; + + /** + * Sets the mask to be applied to this Camera during rendering. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * + * Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Camera it will be immediately replaced. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * + * Note: You cannot mask a Camera that has `renderToTexture` set. + * @param mask The mask this Camera will use when rendering. + * @param fixedPosition Should the mask translate along with the Camera, or be fixed in place and not impacted by the Cameras transform? Default true. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask, fixedPosition?: boolean): this; + + /** + * Clears the mask that this Camera was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Sets the visibility of this Camera. + * + * An invisible Camera will skip rendering and input tests of everything it can see. + * @param value The visible state of the Camera. + */ + setVisible(value: boolean): this; + + /** + * Returns an Object suitable for JSON storage containing all of the Camera viewport and rendering properties. + */ + toJSON(): Phaser.Types.Cameras.Scene2D.JSONCamera; + + /** + * Internal method called automatically by the Camera Manager. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected update(time: integer, delta: number): void; + + /** + * Destroys this Camera instance and its internal properties and references. + * Once destroyed you cannot use this Camera again, even if re-added to a Camera Manager. + * + * This method is called automatically by `CameraManager.remove` if that methods `runDestroy` argument is `true`, which is the default. + * + * Unless you have a specific reason otherwise, always use `CameraManager.remove` and allow it to handle the camera destruction, + * rather than calling this method directly. + */ + destroy(): void; + + /** + * The x position of the Camera viewport, relative to the top-left of the game canvas. + * The viewport is the area into which the camera renders. + * To adjust the position the camera is looking at in the game world, see the `scrollX` value. + */ + x: number; + + /** + * The y position of the Camera viewport, relative to the top-left of the game canvas. + * The viewport is the area into which the camera renders. + * To adjust the position the camera is looking at in the game world, see the `scrollY` value. + */ + y: number; + + /** + * The width of the Camera viewport, in pixels. + * + * The viewport is the area into which the Camera renders. Setting the viewport does + * not restrict where the Camera can scroll to. + */ + width: number; + + /** + * The height of the Camera viewport, in pixels. + * + * The viewport is the area into which the Camera renders. Setting the viewport does + * not restrict where the Camera can scroll to. + */ + height: number; + + /** + * The horizontal scroll position of this Camera. + * + * Change this value to cause the Camera to scroll around your Scene. + * + * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, + * will automatically adjust the Camera scroll values accordingly. + * + * You can set the bounds within which the Camera can scroll via the `setBounds` method. + */ + scrollX: number; + + /** + * The vertical scroll position of this Camera. + * + * Change this value to cause the Camera to scroll around your Scene. + * + * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, + * will automatically adjust the Camera scroll values accordingly. + * + * You can set the bounds within which the Camera can scroll via the `setBounds` method. + */ + scrollY: number; + + /** + * The Camera zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + */ + zoom: number; + + /** + * The horizontal position of the center of the Camera's viewport, relative to the left of the game canvas. + */ + readonly centerX: number; + + /** + * The vertical position of the center of the Camera's viewport, relative to the top of the game canvas. + */ + readonly centerY: number; + + /** + * The displayed width of the camera viewport, factoring in the camera zoom level. + * + * If a camera has a viewport width of 800 and a zoom of 0.5 then its display width + * would be 1600, as it's displaying twice as many pixels as zoom level 1. + * + * Equally, a camera with a width of 800 and zoom of 2 would have a display width + * of 400 pixels. + */ + readonly displayWidth: number; + + /** + * The displayed height of the camera viewport, factoring in the camera zoom level. + * + * If a camera has a viewport height of 600 and a zoom of 0.5 then its display height + * would be 1200, as it's displaying twice as many pixels as zoom level 1. + * + * Equally, a camera with a height of 600 and zoom of 2 would have a display height + * of 300 pixels. + */ + readonly displayHeight: number; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + } + + /** + * A Camera. + * + * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world, + * and can be positioned, rotated, zoomed and scrolled accordingly. + * + * A Camera consists of two elements: The viewport and the scroll values. + * + * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are + * created the same size as your game, but their position and size can be set to anything. This means if you + * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, + * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). + * + * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this + * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the + * viewport, and changing the viewport has no impact on the scrolling. + * + * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, + * allowing you to filter Game Objects out on a per-Camera basis. + * + * A Camera also has built-in special effects including Fade, Flash and Camera Shake. + */ + class Camera extends Phaser.Cameras.Scene2D.BaseCamera implements Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Tint { + /** + * + * @param x The x position of the Camera, relative to the top-left of the game canvas. + * @param y The y position of the Camera, relative to the top-left of the game canvas. + * @param width The width of the Camera, in pixels. + * @param height The height of the Camera, in pixels. + */ + constructor(x: number, y: number, width: number, height: number); + + /** + * Does this Camera allow the Game Objects it renders to receive input events? + */ + inputEnabled: boolean; + + /** + * The Camera Fade effect handler. + * To fade this camera see the `Camera.fade` methods. + */ + fadeEffect: Phaser.Cameras.Scene2D.Effects.Fade; + + /** + * The Camera Flash effect handler. + * To flash this camera see the `Camera.flash` method. + */ + flashEffect: Phaser.Cameras.Scene2D.Effects.Flash; + + /** + * The Camera Shake effect handler. + * To shake this camera see the `Camera.shake` method. + */ + shakeEffect: Phaser.Cameras.Scene2D.Effects.Shake; + + /** + * The Camera Pan effect handler. + * To pan this camera see the `Camera.pan` method. + */ + panEffect: Phaser.Cameras.Scene2D.Effects.Pan; + + /** + * The Camera Zoom effect handler. + * To zoom this camera see the `Camera.zoom` method. + */ + zoomEffect: Phaser.Cameras.Scene2D.Effects.Zoom; + + /** + * The linear interpolation value to use when following a target. + * + * Can also be set via `setLerp` or as part of the `startFollow` call. + * + * The default values of 1 means the camera will instantly snap to the target coordinates. + * A lower value, such as 0.1 means the camera will more slowly track the target, giving + * a smooth transition. You can set the horizontal and vertical values independently, and also + * adjust this value in real-time during your game. + * + * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis. + */ + lerp: Phaser.Math.Vector2; + + /** + * The values stored in this property are subtracted from the Camera targets position, allowing you to + * offset the camera from the actual target x/y coordinates by this amount. + * Can also be set via `setFollowOffset` or as part of the `startFollow` call. + */ + followOffset: Phaser.Math.Vector2; + + /** + * The Camera dead zone. + * + * The deadzone is only used when the camera is following a target. + * + * It defines a rectangular region within which if the target is present, the camera will not scroll. + * If the target moves outside of this area, the camera will begin scrolling in order to follow it. + * + * The `lerp` values that you can set for a follower target also apply when using a deadzone. + * + * You can directly set this property to be an instance of a Rectangle. Or, you can use the + * `setDeadzone` method for a chainable approach. + * + * The rectangle you provide can have its dimensions adjusted dynamically, however, please + * note that its position is updated every frame, as it is constantly re-centered on the cameras mid point. + * + * Calling `setDeadzone` with no arguments will reset an active deadzone, as will setting this property + * to `null`. + */ + deadzone: Phaser.Geom.Rectangle; + + /** + * Is this Camera rendering directly to the canvas or to a texture? + * + * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough) + * + * Once enabled you can toggle it by switching this property. + * + * To properly remove a render texture you should call the `clearRenderToTexture()` method. + */ + renderToTexture: boolean; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the HTML Canvas Element that the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only populated if Phaser is running with the Canvas Renderer. + */ + canvas: HTMLCanvasElement; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the Rendering Context belonging to the Canvas element the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only populated if Phaser is running with the Canvas Renderer. + */ + context: CanvasRenderingContext2D; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the GL Texture belonging the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only set if Phaser is running with the WebGL Renderer. + */ + glTexture: WebGLTexture; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the GL Frame Buffer belonging the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only set if Phaser is running with the WebGL Renderer. + */ + framebuffer: WebGLFramebuffer; + + /** + * If this Camera has been set to render to a texture and to use a custom pipeline, + * then this holds a reference to the pipeline the Camera is drawing with. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only set if Phaser is running with the WebGL Renderer. + */ + pipeline: any; + + /** + * Sets the Camera to render to a texture instead of to the main canvas. + * + * The Camera will redirect all Game Objects it's asked to render to this texture. + * + * During the render sequence, the texture itself will then be rendered to the main canvas. + * + * Doing this gives you the ability to modify the texture before this happens, + * allowing for special effects such as Camera specific shaders, or post-processing + * on the texture. + * + * If running under Canvas the Camera will render to its `canvas` property. + * + * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties. + * + * If you set a camera to render to a texture then it will emit 2 events during the render loop: + * + * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. + * + * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the + * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before + * it appears in-game. + * + * You should not enable this unless you plan on actually using the texture it creates + * somehow, otherwise you're just doubling the work required to render your game. + * + * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean. + * + * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method, + * which will delete the respective textures and free-up resources. + * @param pipeline An optional WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. + */ + setRenderToTexture(pipeline?: string | Phaser.Renderer.WebGL.WebGLPipeline): Phaser.Cameras.Scene2D.Camera; + + /** + * Sets the WebGL pipeline this Camera is using when rendering to a texture. + * + * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself. + * + * Call this method with no arguments to clear any previously set pipeline. + * @param pipeline The WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. Or if left empty it will clear the pipeline. + */ + setPipeline(pipeline?: string | Phaser.Renderer.WebGL.WebGLPipeline): Phaser.Cameras.Scene2D.Camera; + + /** + * If this Camera was set to render to a texture, this will clear the resources it was using and + * redirect it to render back to the primary Canvas again. + * + * If you only wish to temporarily disable rendering to a texture then you can toggle the + * property `renderToTexture` instead. + */ + clearRenderToTexture(): Phaser.Cameras.Scene2D.Camera; + + /** + * Sets the Camera dead zone. + * + * The deadzone is only used when the camera is following a target. + * + * It defines a rectangular region within which if the target is present, the camera will not scroll. + * If the target moves outside of this area, the camera will begin scrolling in order to follow it. + * + * The deadzone rectangle is re-positioned every frame so that it is centered on the mid-point + * of the camera. This allows you to use the object for additional game related checks, such as + * testing if an object is within it or not via a Rectangle.contains call. + * + * The `lerp` values that you can set for a follower target also apply when using a deadzone. + * + * Calling this method with no arguments will reset an active deadzone. + * @param width The width of the deadzone rectangle in pixels. If not specified the deadzone is removed. + * @param height The height of the deadzone rectangle in pixels. + */ + setDeadzone(width?: number, height?: number): Phaser.Cameras.Scene2D.Camera; + + /** + * Fades the Camera in from the given color over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 0. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 0. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 0. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + fadeIn(duration?: integer, red?: integer, green?: integer, blue?: integer, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Fades the Camera out to the given color over the duration specified. + * This is an alias for Camera.fade that forces the fade to start, regardless of existing fades. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 0. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 0. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 0. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + fadeOut(duration?: integer, red?: integer, green?: integer, blue?: integer, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Fades the Camera from the given color to transparent over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 0. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 0. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 0. + * @param force Force the effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + fadeFrom(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Fades the Camera from transparent to the given color over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 0. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 0. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 0. + * @param force Force the effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + fade(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Flashes the Camera by setting it to the given color immediately and then fading it away again quickly over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 250. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 255. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 255. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 255. + * @param force Force the effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + flash(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Shakes the Camera by the given intensity over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 100. + * @param intensity The intensity of the shake. Default 0.05. + * @param force Force the shake effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + shake(duration?: integer, intensity?: number, force?: boolean, callback?: Function, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, + * over the duration and with the ease specified. + * @param x The destination x coordinate to scroll the center of the Camera viewport to. + * @param y The destination y coordinate to scroll the center of the Camera viewport to. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param ease The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. Default 'Linear'. + * @param force Force the pan effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * the current camera scroll x coordinate and the current camera scroll y coordinate. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + pan(x: number, y: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * This effect will zoom the Camera to the given scale, over the duration and with the ease specified. + * @param zoom The target Camera zoom value. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param ease The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. Default 'Linear'. + * @param force Force the pan effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * the current camera scroll x coordinate and the current camera scroll y coordinate. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + zoomTo(zoom: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * Internal preRender step. + * @param resolution The game resolution, as set in the Scale Manager. + */ + protected preRender(resolution: number): void; + + /** + * Sets the linear interpolation value to use when following a target. + * + * The default values of 1 means the camera will instantly snap to the target coordinates. + * A lower value, such as 0.1 means the camera will more slowly track the target, giving + * a smooth transition. You can set the horizontal and vertical values independently, and also + * adjust this value in real-time during your game. + * + * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis. + * @param x The amount added to the horizontal linear interpolation of the follow target. Default 1. + * @param y The amount added to the vertical linear interpolation of the follow target. Default 1. + */ + setLerp(x?: number, y?: number): this; + + /** + * Sets the horizontal and vertical offset of the camera from its follow target. + * The values are subtracted from the targets position during the Cameras update step. + * @param x The horizontal offset from the camera follow target.x position. Default 0. + * @param y The vertical offset from the camera follow target.y position. Default 0. + */ + setFollowOffset(x?: number, y?: number): this; + + /** + * Sets the Camera to follow a Game Object. + * + * When enabled the Camera will automatically adjust its scroll position to keep the target Game Object + * in its center. + * + * You can set the linear interpolation value used in the follow code. + * Use low lerp values (such as 0.1) to automatically smooth the camera motion. + * + * If you find you're getting a slight "jitter" effect when following an object it's probably to do with sub-pixel + * rendering of the targets position. This can be rounded by setting the `roundPixels` argument to `true` to + * force full pixel rounding rendering. Note that this can still be broken if you have specified a non-integer zoom + * value on the camera. So be sure to keep the camera zoom to integers. + * @param target The target for the Camera to follow. + * @param roundPixels Round the camera position to whole integers to avoid sub-pixel rendering? Default false. + * @param lerpX A value between 0 and 1. This value specifies the amount of linear interpolation to use when horizontally tracking the target. The closer the value to 1, the faster the camera will track. Default 1. + * @param lerpY A value between 0 and 1. This value specifies the amount of linear interpolation to use when vertically tracking the target. The closer the value to 1, the faster the camera will track. Default 1. + * @param offsetX The horizontal offset from the camera follow target.x position. Default 0. + * @param offsetY The vertical offset from the camera follow target.y position. Default 0. + */ + startFollow(target: Phaser.GameObjects.GameObject | object, roundPixels?: boolean, lerpX?: number, lerpY?: number, offsetX?: number, offsetY?: number): this; + + /** + * Stops a Camera from following a Game Object, if previously set via `Camera.startFollow`. + */ + stopFollow(): Phaser.Cameras.Scene2D.Camera; + + /** + * Resets any active FX, such as a fade, flash or shake. Useful to call after a fade in order to + * remove the fade. + */ + resetFX(): Phaser.Cameras.Scene2D.Camera; + + /** + * Internal method called automatically by the Camera Manager. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected update(time: integer, delta: number): void; + + /** + * Destroys this Camera instance. You rarely need to call this directly. + * + * Called by the Camera Manager. If you wish to destroy a Camera please use `CameraManager.remove` as + * cameras are stored in a pool, ready for recycling later, and calling this directly will prevent that. + */ + destroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + } + + /** + * The Camera Manager is a plugin that belongs to a Scene and is responsible for managing all of the Scene Cameras. + * + * By default you can access the Camera Manager from within a Scene using `this.cameras`, although this can be changed + * in your game config. + * + * Create new Cameras using the `add` method. Or extend the Camera class with your own addition code and then add + * the new Camera in using the `addExisting` method. + * + * Cameras provide a view into your game world, and can be positioned, rotated, zoomed and scrolled accordingly. + * + * A Camera consists of two elements: The viewport and the scroll values. + * + * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are + * created the same size as your game, but their position and size can be set to anything. This means if you + * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, + * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). + * + * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this + * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the + * viewport, and changing the viewport has no impact on the scrolling. + * + * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, + * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique + * 'Game Object ignore capable' Cameras. Any Cameras beyond 31 that you create will all be given a Camera ID of + * zero, meaning that they cannot be used for Game Object exclusion. This means if you need your Camera to ignore + * Game Objects, make sure it's one of the first 31 created. + * + * A Camera also has built-in special effects including Fade, Flash, Camera Shake, Pan and Zoom. + */ + class CameraManager { + /** + * + * @param scene The Scene that owns the Camera Manager plugin. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene that owns the Camera Manager plugin. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems handler for the Scene that owns the Camera Manager. + */ + systems: Phaser.Scenes.Systems; + + /** + * All Cameras created by, or added to, this Camera Manager, will have their `roundPixels` + * property set to match this value. By default it is set to match the value set in the + * game configuration, but can be changed at any point. Equally, individual cameras can + * also be changed as needed. + */ + roundPixels: boolean; + + /** + * An Array of the Camera objects being managed by this Camera Manager. + * The Cameras are updated and rendered in the same order in which they appear in this array. + * Do not directly add or remove entries to this array. However, you can move the contents + * around the array should you wish to adjust the display order. + */ + cameras: Phaser.Cameras.Scene2D.Camera[]; + + /** + * A handy reference to the 'main' camera. By default this is the first Camera the + * Camera Manager creates. You can also set it directly, or use the `makeMain` argument + * in the `add` and `addExisting` methods. It allows you to access it from your game: + * + * ```javascript + * var cam = this.cameras.main; + * ``` + * + * Also see the properties `camera1`, `camera2` and so on. + */ + main: Phaser.Cameras.Scene2D.Camera; + + /** + * A default un-transformed Camera that doesn't exist on the camera list and doesn't + * count towards the total number of cameras being managed. It exists for other + * systems, as well as your own code, should they require a basic un-transformed + * camera instance from which to calculate a view matrix. + */ + default: Phaser.Cameras.Scene2D.Camera; + + /** + * Adds a new Camera into the Camera Manager. The Camera Manager can support up to 31 different Cameras. + * + * Each Camera has its own viewport, which controls the size of the Camera and its position within the canvas. + * + * Use the `Camera.scrollX` and `Camera.scrollY` properties to change where the Camera is looking, or the + * Camera methods such as `centerOn`. Cameras also have built in special effects, such as fade, flash, shake, + * pan and zoom. + * + * By default Cameras are transparent and will render anything that they can see based on their `scrollX` + * and `scrollY` values. Game Objects can be set to be ignored by a Camera by using the `Camera.ignore` method. + * + * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change + * it after creation if required. + * + * See the Camera class documentation for more details. + * @param x The horizontal position of the Camera viewport. Default 0. + * @param y The vertical position of the Camera viewport. Default 0. + * @param width The width of the Camera viewport. If not given it'll be the game config size. + * @param height The height of the Camera viewport. If not given it'll be the game config size. + * @param makeMain Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. Default false. + * @param name The name of the Camera. Default ''. + */ + add(x?: integer, y?: integer, width?: integer, height?: integer, makeMain?: boolean, name?: string): Phaser.Cameras.Scene2D.Camera; + + /** + * Adds an existing Camera into the Camera Manager. + * + * The Camera should either be a `Phaser.Cameras.Scene2D.Camera` instance, or a class that extends from it. + * + * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change + * it after addition if required. + * + * The Camera will be assigned an ID, which is used for Game Object exclusion and then added to the + * manager. As long as it doesn't already exist in the manager it will be added then returned. + * + * If this method returns `null` then the Camera already exists in this Camera Manager. + * @param camera The Camera to be added to the Camera Manager. + * @param makeMain Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. Default false. + */ + addExisting(camera: Phaser.Cameras.Scene2D.Camera, makeMain?: boolean): Phaser.Cameras.Scene2D.Camera; + + /** + * Gets the total number of Cameras in this Camera Manager. + * + * If the optional `isVisible` argument is set it will only count Cameras that are currently visible. + * @param isVisible Set the `true` to only include visible Cameras in the total. Default false. + */ + getTotal(isVisible?: boolean): integer; + + /** + * Populates this Camera Manager based on the given configuration object, or an array of config objects. + * + * See the `Phaser.Types.Cameras.Scene2D.CameraConfig` documentation for details of the object structure. + * @param config A Camera configuration object, or an array of them, to be added to this Camera Manager. + */ + fromJSON(config: Phaser.Types.Cameras.Scene2D.CameraConfig | Phaser.Types.Cameras.Scene2D.CameraConfig[]): Phaser.Cameras.Scene2D.CameraManager; + + /** + * Gets a Camera based on its name. + * + * Camera names are optional and don't have to be set, so this method is only of any use if you + * have given your Cameras unique names. + * @param name The name of the Camera. + */ + getCamera(name: string): Phaser.Cameras.Scene2D.Camera; + + /** + * Returns an array of all cameras below the given Pointer. + * + * The first camera in the array is the top-most camera in the camera list. + * @param pointer The Pointer to check against. + */ + getCamerasBelowPointer(pointer: Phaser.Input.Pointer): Phaser.Cameras.Scene2D.Camera[]; + + /** + * Removes the given Camera, or an array of Cameras, from this Camera Manager. + * + * If found in the Camera Manager it will be immediately removed from the local cameras array. + * If also currently the 'main' camera, 'main' will be reset to be camera 0. + * + * The removed Cameras are automatically destroyed if the `runDestroy` argument is `true`, which is the default. + * If you wish to re-use the cameras then set this to `false`, but know that they will retain their references + * and internal data until destroyed or re-added to a Camera Manager. + * @param camera The Camera, or an array of Cameras, to be removed from this Camera Manager. + * @param runDestroy Automatically call `Camera.destroy` on each Camera removed from this Camera Manager. Default true. + */ + remove(camera: Phaser.Cameras.Scene2D.Camera | Phaser.Cameras.Scene2D.Camera[], runDestroy?: boolean): integer; + + /** + * The internal render method. This is called automatically by the Scene and should not be invoked directly. + * + * It will iterate through all local cameras and render them in turn, as long as they're visible and have + * an alpha level > 0. + * @param renderer The Renderer that will render the children to this camera. + * @param children An array of renderable Game Objects. + * @param interpolation Interpolation value. Reserved for future use. + */ + protected render(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer, children: Phaser.GameObjects.GameObject[], interpolation: number): void; + + /** + * Resets this Camera Manager. + * + * This will iterate through all current Cameras, destroying them all, then it will reset the + * cameras array, reset the ID counter and create 1 new single camera using the default values. + */ + resetAll(): Phaser.Cameras.Scene2D.Camera; + + /** + * The main update loop. Called automatically when the Scene steps. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected update(time: integer, delta: number): void; + + /** + * The event handler that manages the `resize` event dispatched by the Scale Manager. + * @param gameSize The default Game Size object. This is the un-modified game dimensions. + * @param baseSize The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + */ + onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size): void; + + /** + * Resizes all cameras to the given dimensions. + * @param width The new width of the camera. + * @param height The new height of the camera. + */ + resize(width: number, height: number): void; + + } + + namespace Effects { + /** + * A Camera Fade effect. + * + * This effect will fade the camera viewport to the given color, over the duration specified. + * + * Only the camera viewport is faded. None of the objects it is displaying are impacted, i.e. their colors do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect, if required. + */ + class Fade { + /** + * + * @param camera The camera this effect is acting upon. + */ + constructor(camera: Phaser.Cameras.Scene2D.Camera); + + /** + * The Camera this effect belongs to. + */ + readonly camera: Phaser.Cameras.Scene2D.Camera; + + /** + * Is this effect actively running? + */ + readonly isRunning: boolean; + + /** + * Has this effect finished running? + * + * This is different from `isRunning` because it remains set to `true` when the effect is over, + * until the effect is either reset or started again. + */ + readonly isComplete: boolean; + + /** + * The direction of the fade. + * `true` = fade out (transparent to color), `false` = fade in (color to transparent) + */ + readonly direction: boolean; + + /** + * The duration of the effect, in milliseconds. + */ + readonly duration: integer; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + */ + progress: number; + + /** + * Fades the Camera to or from the given color over the duration specified. + * @param direction The direction of the fade. `true` = fade out (transparent to color), `false` = fade in (color to transparent) Default true. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 0. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 0. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 0. + * @param force Force the effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + start(direction?: boolean, duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraFadeCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * The main update loop for this effect. Called automatically by the Camera. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: integer, delta: number): void; + + /** + * Called internally by the Canvas Renderer. + * @param ctx The Canvas context to render to. + */ + postRenderCanvas(ctx: CanvasRenderingContext2D): boolean; + + /** + * Called internally by the WebGL Renderer. + * @param pipeline The WebGL Pipeline to render to. + * @param getTintFunction A function that will return the gl safe tint colors. + */ + postRenderWebGL(pipeline: Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline, getTintFunction: Function): boolean; + + /** + * Called internally when the effect completes. + */ + effectComplete(): void; + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + */ + reset(): void; + + /** + * Destroys this effect, releasing it from the Camera. + */ + destroy(): void; + + } + + /** + * A Camera Flash effect. + * + * This effect will flash the camera viewport to the given color, over the duration specified. + * + * Only the camera viewport is flashed. None of the objects it is displaying are impacted, i.e. their colors do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect, if required. + */ + class Flash { + /** + * + * @param camera The camera this effect is acting upon. + */ + constructor(camera: Phaser.Cameras.Scene2D.Camera); + + /** + * The Camera this effect belongs to. + */ + readonly camera: Phaser.Cameras.Scene2D.Camera; + + /** + * Is this effect actively running? + */ + readonly isRunning: boolean; + + /** + * The duration of the effect, in milliseconds. + */ + readonly duration: integer; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + */ + progress: number; + + /** + * Flashes the Camera to or from the given color over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 250. + * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 255. + * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 255. + * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 255. + * @param force Force the effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + start(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraFlashCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * The main update loop for this effect. Called automatically by the Camera. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: integer, delta: number): void; + + /** + * Called internally by the Canvas Renderer. + * @param ctx The Canvas context to render to. + */ + postRenderCanvas(ctx: CanvasRenderingContext2D): boolean; + + /** + * Called internally by the WebGL Renderer. + * @param pipeline The WebGL Pipeline to render to. + * @param getTintFunction A function that will return the gl safe tint colors. + */ + postRenderWebGL(pipeline: Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline, getTintFunction: Function): boolean; + + /** + * Called internally when the effect completes. + */ + effectComplete(): void; + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + */ + reset(): void; + + /** + * Destroys this effect, releasing it from the Camera. + */ + destroy(): void; + + } + + /** + * A Camera Pan effect. + * + * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, + * over the duration and with the ease specified. + * + * Only the camera scroll is moved. None of the objects it is displaying are impacted, i.e. their positions do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect if required. + */ + class Pan { + /** + * + * @param camera The camera this effect is acting upon. + */ + constructor(camera: Phaser.Cameras.Scene2D.Camera); + + /** + * The Camera this effect belongs to. + */ + readonly camera: Phaser.Cameras.Scene2D.Camera; + + /** + * Is this effect actively running? + */ + readonly isRunning: boolean; + + /** + * The duration of the effect, in milliseconds. + */ + readonly duration: integer; + + /** + * The starting scroll coordinates to pan the camera from. + */ + source: Phaser.Math.Vector2; + + /** + * The constantly updated value based on zoom. + */ + current: Phaser.Math.Vector2; + + /** + * The destination scroll coordinates to pan the camera to. + */ + destination: Phaser.Math.Vector2; + + /** + * The ease function to use during the pan. + */ + ease: Function; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + */ + progress: number; + + /** + * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, + * over the duration and with the ease specified. + * @param x The destination x coordinate to scroll the center of the Camera viewport to. + * @param y The destination y coordinate to scroll the center of the Camera viewport to. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param ease The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. Default 'Linear'. + * @param force Force the pan effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * the current camera scroll x coordinate and the current camera scroll y coordinate. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + start(x: number, y: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * The main update loop for this effect. Called automatically by the Camera. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: integer, delta: number): void; + + /** + * Called internally when the effect completes. + */ + effectComplete(): void; + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + */ + reset(): void; + + /** + * Destroys this effect, releasing it from the Camera. + */ + destroy(): void; + + } + + /** + * A Camera Shake effect. + * + * This effect will shake the camera viewport by a random amount, bounded by the specified intensity, each frame. + * + * Only the camera viewport is moved. None of the objects it is displaying are impacted, i.e. their positions do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect if required. + */ + class Shake { + /** + * + * @param camera The camera this effect is acting upon. + */ + constructor(camera: Phaser.Cameras.Scene2D.Camera); + + /** + * The Camera this effect belongs to. + */ + readonly camera: Phaser.Cameras.Scene2D.Camera; + + /** + * Is this effect actively running? + */ + readonly isRunning: boolean; + + /** + * The duration of the effect, in milliseconds. + */ + readonly duration: integer; + + /** + * The intensity of the effect. Use small float values. The default when the effect starts is 0.05. + * This is a Vector2 object, allowing you to control the shake intensity independently across x and y. + * You can modify this value while the effect is active to create more varied shake effects. + */ + intensity: Phaser.Math.Vector2; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + */ + progress: number; + + /** + * Shakes the Camera by the given intensity over the duration specified. + * @param duration The duration of the effect in milliseconds. Default 100. + * @param intensity The intensity of the shake. Default 0.05. + * @param force Force the shake effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + start(duration?: integer, intensity?: number, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraShakeCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * The pre-render step for this effect. Called automatically by the Camera. + */ + preRender(): void; + + /** + * The main update loop for this effect. Called automatically by the Camera. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: integer, delta: number): void; + + /** + * Called internally when the effect completes. + */ + effectComplete(): void; + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + */ + reset(): void; + + /** + * Destroys this effect, releasing it from the Camera. + */ + destroy(): void; + + } + + /** + * A Camera Zoom effect. + * + * This effect will zoom the Camera to the given scale, over the duration and with the ease specified. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect if required. + */ + class Zoom { + /** + * + * @param camera The camera this effect is acting upon. + */ + constructor(camera: Phaser.Cameras.Scene2D.Camera); + + /** + * The Camera this effect belongs to. + */ + readonly camera: Phaser.Cameras.Scene2D.Camera; + + /** + * Is this effect actively running? + */ + readonly isRunning: boolean; + + /** + * The duration of the effect, in milliseconds. + */ + readonly duration: integer; + + /** + * The starting zoom value; + */ + source: number; + + /** + * The destination zoom value. + */ + destination: number; + + /** + * The ease function to use during the zoom. + */ + ease: Function; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + */ + progress: number; + + /** + * This effect will zoom the Camera to the given scale, over the duration and with the ease specified. + * @param zoom The target Camera zoom value. + * @param duration The duration of the effect in milliseconds. Default 1000. + * @param ease The ease to use for the Zoom. Can be any of the Phaser Easing constants or a custom function. Default 'Linear'. + * @param force Force the zoom effect to start immediately, even if already running. Default false. + * @param callback This callback will be invoked every frame for the duration of the effect. + * It is sent three arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * and the current camera zoom value. + * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + */ + start(zoom: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraZoomCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + + /** + * The main update loop for this effect. Called automatically by the Camera. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: integer, delta: number): void; + + /** + * Called internally when the effect completes. + */ + effectComplete(): void; + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + */ + reset(): void; + + /** + * Destroys this effect, releasing it from the Camera. + */ + destroy(): void; + + } + + } + + namespace Events { + /** + * The Destroy Camera Event. + * + * This event is dispatched by a Camera instance when it is destroyed by the Camera Manager. + */ + const DESTROY: any; + + /** + * The Camera Fade In Complete Event. + * + * This event is dispatched by a Camera instance when the Fade In Effect completes. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeincomplete', listener)`. + */ + const FADE_IN_COMPLETE: any; + + /** + * The Camera Fade In Start Event. + * + * This event is dispatched by a Camera instance when the Fade In Effect starts. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeinstart', listener)`. + */ + const FADE_IN_START: any; + + /** + * The Camera Fade Out Complete Event. + * + * This event is dispatched by a Camera instance when the Fade Out Effect completes. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeoutcomplete', listener)`. + */ + const FADE_OUT_COMPLETE: any; + + /** + * The Camera Fade Out Start Event. + * + * This event is dispatched by a Camera instance when the Fade Out Effect starts. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeoutstart', listener)`. + */ + const FADE_OUT_START: any; + + /** + * The Camera Flash Complete Event. + * + * This event is dispatched by a Camera instance when the Flash Effect completes. + */ + const FLASH_COMPLETE: any; + + /** + * The Camera Flash Start Event. + * + * This event is dispatched by a Camera instance when the Flash Effect starts. + */ + const FLASH_START: any; + + /** + * The Camera Pan Complete Event. + * + * This event is dispatched by a Camera instance when the Pan Effect completes. + */ + const PAN_COMPLETE: any; + + /** + * The Camera Pan Start Event. + * + * This event is dispatched by a Camera instance when the Pan Effect starts. + */ + const PAN_START: any; + + /** + * The Camera Post-Render Event. + * + * This event is dispatched by a Camera instance after is has finished rendering. + * It is only dispatched if the Camera is rendering to a texture. + * + * Listen to it from a Camera instance using: `camera.on('postrender', listener)`. + */ + const POST_RENDER: any; + + /** + * The Camera Pre-Render Event. + * + * This event is dispatched by a Camera instance when it is about to render. + * It is only dispatched if the Camera is rendering to a texture. + * + * Listen to it from a Camera instance using: `camera.on('prerender', listener)`. + */ + const PRE_RENDER: any; + + /** + * The Camera Shake Complete Event. + * + * This event is dispatched by a Camera instance when the Shake Effect completes. + */ + const SHAKE_COMPLETE: any; + + /** + * The Camera Shake Start Event. + * + * This event is dispatched by a Camera instance when the Shake Effect starts. + */ + const SHAKE_START: any; + + /** + * The Camera Zoom Complete Event. + * + * This event is dispatched by a Camera instance when the Zoom Effect completes. + */ + const ZOOM_COMPLETE: any; + + /** + * The Camera Zoom Start Event. + * + * This event is dispatched by a Camera instance when the Zoom Effect starts. + */ + const ZOOM_START: any; + + } + + } + + namespace Controls { + /** + * A Fixed Key Camera Control. + * + * This allows you to control the movement and zoom of a camera using the defined keys. + * + * ```javascript + * var camControl = new FixedKeyControl({ + * camera: this.cameras.main, + * left: cursors.left, + * right: cursors.right, + * speed: float OR { x: 0, y: 0 } + * }); + * ``` + * + * Movement is precise and has no 'smoothing' applied to it. + * + * You must call the `update` method of this controller every frame. + */ + class FixedKeyControl { + /** + * + * @param config The Fixed Key Control configuration object. + */ + constructor(config: Phaser.Types.Cameras.Controls.FixedKeyControlConfig); + + /** + * The Camera that this Control will update. + */ + camera: Phaser.Cameras.Scene2D.Camera; + + /** + * The Key to be pressed that will move the Camera left. + */ + left: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera right. + */ + right: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera up. + */ + up: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera down. + */ + down: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will zoom the Camera in. + */ + zoomIn: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will zoom the Camera out. + */ + zoomOut: Phaser.Input.Keyboard.Key; + + /** + * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. + */ + zoomSpeed: number; + + /** + * The horizontal speed the camera will move. + */ + speedX: number; + + /** + * The vertical speed the camera will move. + */ + speedY: number; + + /** + * A flag controlling if the Controls will update the Camera or not. + */ + active: boolean; + + /** + * Starts the Key Control running, providing it has been linked to a camera. + */ + start(): Phaser.Cameras.Controls.FixedKeyControl; + + /** + * Stops this Key Control from running. Call `start` to start it again. + */ + stop(): Phaser.Cameras.Controls.FixedKeyControl; + + /** + * Binds this Key Control to a camera. + * @param camera The camera to bind this Key Control to. + */ + setCamera(camera: Phaser.Cameras.Scene2D.Camera): Phaser.Cameras.Controls.FixedKeyControl; + + /** + * Applies the results of pressing the control keys to the Camera. + * + * You must call this every step, it is not called automatically. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(delta: number): void; + + /** + * Destroys this Key Control. + */ + destroy(): void; + + } + + /** + * A Smoothed Key Camera Control. + * + * This allows you to control the movement and zoom of a camera using the defined keys. + * Unlike the Fixed Camera Control you can also provide physics values for acceleration, drag and maxSpeed for smoothing effects. + * + * ```javascript + * var controlConfig = { + * camera: this.cameras.main, + * left: cursors.left, + * right: cursors.right, + * up: cursors.up, + * down: cursors.down, + * zoomIn: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.Q), + * zoomOut: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.E), + * zoomSpeed: 0.02, + * acceleration: 0.06, + * drag: 0.0005, + * maxSpeed: 1.0 + * }; + * ``` + * + * You must call the `update` method of this controller every frame. + */ + class SmoothedKeyControl { + /** + * + * @param config The Smoothed Key Control configuration object. + */ + constructor(config: Phaser.Types.Cameras.Controls.SmoothedKeyControlConfig); + + /** + * The Camera that this Control will update. + */ + camera: Phaser.Cameras.Scene2D.Camera; + + /** + * The Key to be pressed that will move the Camera left. + */ + left: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera right. + */ + right: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera up. + */ + up: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will move the Camera down. + */ + down: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will zoom the Camera in. + */ + zoomIn: Phaser.Input.Keyboard.Key; + + /** + * The Key to be pressed that will zoom the Camera out. + */ + zoomOut: Phaser.Input.Keyboard.Key; + + /** + * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. + */ + zoomSpeed: number; + + /** + * The horizontal acceleration the camera will move. + */ + accelX: number; + + /** + * The vertical acceleration the camera will move. + */ + accelY: number; + + /** + * The horizontal drag applied to the camera when it is moving. + */ + dragX: number; + + /** + * The vertical drag applied to the camera when it is moving. + */ + dragY: number; + + /** + * The maximum horizontal speed the camera will move. + */ + maxSpeedX: number; + + /** + * The maximum vertical speed the camera will move. + */ + maxSpeedY: number; + + /** + * A flag controlling if the Controls will update the Camera or not. + */ + active: boolean; + + /** + * Starts the Key Control running, providing it has been linked to a camera. + */ + start(): Phaser.Cameras.Controls.SmoothedKeyControl; + + /** + * Stops this Key Control from running. Call `start` to start it again. + */ + stop(): Phaser.Cameras.Controls.SmoothedKeyControl; + + /** + * Binds this Key Control to a camera. + * @param camera The camera to bind this Key Control to. + */ + setCamera(camera: Phaser.Cameras.Scene2D.Camera): Phaser.Cameras.Controls.SmoothedKeyControl; + + /** + * Applies the results of pressing the control keys to the Camera. + * + * You must call this every step, it is not called automatically. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(delta: number): void; + + /** + * Destroys this Key Control. + */ + destroy(): void; + + } + + } + + } + + /** + * Phaser Release Version + */ + const VERSION: string; + + /** + * AUTO Detect Renderer. + */ + const AUTO: integer; + + /** + * Canvas Renderer. + */ + const CANVAS: integer; + + /** + * WebGL Renderer. + */ + const WEBGL: integer; + + /** + * Headless Renderer. + */ + const HEADLESS: integer; + + /** + * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead + * to help you remember what the value is doing in your code. + */ + const FOREVER: integer; + + /** + * Direction constant. + */ + const NONE: integer; + + /** + * Direction constant. + */ + const UP: integer; + + /** + * Direction constant. + */ + const DOWN: integer; + + /** + * Direction constant. + */ + const LEFT: integer; + + /** + * Direction constant. + */ + const RIGHT: integer; + + /** + * The Phaser.Game instance is the main controller for the entire Phaser game. It is responsible + * for handling the boot process, parsing the configuration values, creating the renderer, + * and setting-up all of the global Phaser systems, such as sound and input. + * Once that is complete it will start the Scene Manager and then begin the main game loop. + * + * You should generally avoid accessing any of the systems created by Game, and instead use those + * made available to you via the Phaser.Scene Systems class instead. + */ + class Game { + /** + * + * @param GameConfig The configuration object for your Phaser Game instance. + */ + constructor(GameConfig?: Phaser.Types.Core.GameConfig); + + /** + * The parsed Game Configuration object. + * + * The values stored within this object are read-only and should not be changed at run-time. + */ + readonly config: Phaser.Core.Config; + + /** + * A reference to either the Canvas or WebGL Renderer that this Game is using. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * A reference to an HTML Div Element used as the DOM Element Container. + * + * Only set if `createDOMContainer` is `true` in the game config (by default it is `false`) and + * if you provide a parent element to insert the Phaser Game inside. + * + * See the DOM Element Game Object for more details. + */ + domContainer: HTMLDivElement; + + /** + * A reference to the HTML Canvas Element that Phaser uses to render the game. + * This is created automatically by Phaser unless you provide a `canvas` property + * in your Game Config. + */ + canvas: HTMLCanvasElement; + + /** + * A reference to the Rendering Context belonging to the Canvas Element this game is rendering to. + * If the game is running under Canvas it will be a 2d Canvas Rendering Context. + * If the game is running under WebGL it will be a WebGL Rendering Context. + * This context is created automatically by Phaser unless you provide a `context` property + * in your Game Config. + */ + context: CanvasRenderingContext2D | WebGLRenderingContext; + + /** + * A flag indicating when this Game instance has finished its boot process. + */ + readonly isBooted: boolean; + + /** + * A flag indicating if this Game is currently running its game step or not. + */ + readonly isRunning: boolean; + + /** + * An Event Emitter which is used to broadcast game-level events from the global systems. + */ + events: Phaser.Events.EventEmitter; + + /** + * An instance of the Animation Manager. + * + * The Animation Manager is a global system responsible for managing all animations used within your game. + */ + anims: Phaser.Animations.AnimationManager; + + /** + * An instance of the Texture Manager. + * + * The Texture Manager is a global system responsible for managing all textures being used by your game. + */ + textures: Phaser.Textures.TextureManager; + + /** + * An instance of the Cache Manager. + * + * The Cache Manager is a global system responsible for caching, accessing and releasing external game assets. + */ + cache: Phaser.Cache.CacheManager; + + /** + * An instance of the Data Manager + */ + registry: Phaser.Data.DataManager; + + /** + * An instance of the Input Manager. + * + * The Input Manager is a global system responsible for the capture of browser-level input events. + */ + input: Phaser.Input.InputManager; + + /** + * An instance of the Scene Manager. + * + * The Scene Manager is a global system responsible for creating, modifying and updating the Scenes in your game. + */ + scene: Phaser.Scenes.SceneManager; + + /** + * A reference to the Device inspector. + * + * Contains information about the device running this game, such as OS, browser vendor and feature support. + * Used by various systems to determine capabilities and code paths. + */ + device: Phaser.DeviceConf; + + /** + * An instance of the Scale Manager. + * + * The Scale Manager is a global system responsible for handling scaling of the game canvas. + */ + scale: Phaser.Scale.ScaleManager; + + /** + * An instance of the base Sound Manager. + * + * The Sound Manager is a global system responsible for the playback and updating of all audio in your game. + * + * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag. + */ + sound: Phaser.Sound.BaseSoundManager; + + /** + * An instance of the Time Step. + * + * The Time Step is a global system responsible for setting-up and responding to the browser frame events, processing + * them and calculating delta values. It then automatically calls the game step. + */ + loop: Phaser.Core.TimeStep; + + /** + * An instance of the Plugin Manager. + * + * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install + * those plugins into Scenes as required. + */ + plugins: Phaser.Plugins.PluginManager; + + /** + * An instance of the Facebook Instant Games Plugin. + * + * This will only be available if the plugin has been built into Phaser, + * or you're using the special Facebook Instant Games custom build. + */ + facebook: Phaser.FacebookInstantGamesPlugin; + + /** + * Does the window the game is running in currently have focus or not? + * This is modified by the VisibilityHandler. + */ + readonly hasFocus: boolean; + + /** + * This method is called automatically when the DOM is ready. It is responsible for creating the renderer, + * displaying the Debug Header, adding the game canvas to the DOM and emitting the 'boot' event. + * It listens for a 'ready' event from the base systems and once received it will call `Game.start`. + */ + protected boot(): void; + + /** + * Called automatically by Game.boot once all of the global systems have finished setting themselves up. + * By this point the Game is now ready to start the main loop running. + * It will also enable the Visibility Handler. + */ + protected start(): void; + + /** + * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of + * Request Animation Frame, or Set Timeout on very old browsers.) + * + * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager. + * + * It will then render each Scene in turn, via the Renderer. This process emits `prerender` and `postrender` events. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + step(time: number, delta: number): void; + + /** + * A special version of the Game Step for the HEADLESS renderer only. + * + * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of + * Request Animation Frame, or Set Timeout on very old browsers.) + * + * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager. + * + * This process emits `prerender` and `postrender` events, even though nothing actually displays. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + headlessStep(time: number, delta: number): void; + + /** + * Called automatically by the Visibility Handler. + * This will pause the main loop and then emit a pause event. + */ + protected onHidden(): void; + + /** + * Called automatically by the Visibility Handler. + * This will resume the main loop and then emit a resume event. + */ + protected onVisible(): void; + + /** + * Called automatically by the Visibility Handler. + * This will set the main loop into a 'blurred' state, which pauses it. + */ + protected onBlur(): void; + + /** + * Called automatically by the Visibility Handler. + * This will set the main loop into a 'focused' state, which resumes it. + */ + protected onFocus(): void; + + /** + * Returns the current game frame. + * + * When the game starts running, the frame is incremented every time Request Animation Frame, or Set Timeout, fires. + */ + getFrame(): number; + + /** + * Returns the time that the current game step started at, as based on `performance.now`. + */ + getTime(): number; + + /** + * Flags this Game instance as needing to be destroyed on the _next frame_, making this an asynchronous operation. + * + * It will wait until the current frame has completed and then call `runDestroy` internally. + * + * If you need to react to the games eventual destruction, listen for the `DESTROY` event. + * + * If you **do not** need to run Phaser again on the same web page you can set the `noReturn` argument to `true` and it will free-up + * memory being held by the core Phaser plugins. If you do need to create another game instance on the same page, leave this as `false`. + * @param removeCanvas Set to `true` if you would like the parent canvas element removed from the DOM, or `false` to leave it in place. + * @param noReturn If `true` all the core Phaser plugins are destroyed. You cannot create another instance of Phaser on the same web page if you do this. Default false. + */ + destroy(removeCanvas: boolean, noReturn?: boolean): void; + + } + + namespace Core { + /** + * The active game configuration settings, parsed from a {@link Phaser.Types.Core.GameConfig} object. + */ + class Config { + /** + * + * @param GameConfig The configuration object for your Phaser Game instance. + */ + constructor(GameConfig?: Phaser.Types.Core.GameConfig); + + /** + * The width of the underlying canvas, in pixels. + */ + readonly width: integer | string; + + /** + * The height of the underlying canvas, in pixels. + */ + readonly height: integer | string; + + /** + * The zoom factor, as used by the Scale Manager. + */ + readonly zoom: Phaser.Scale.ZoomType | integer; + + /** + * The canvas device pixel resolution. Currently un-used. + */ + readonly resolution: number; + + /** + * A parent DOM element into which the canvas created by the renderer will be injected. + */ + readonly parent: any; + + /** + * The scale mode as used by the Scale Manager. The default is zero, which is no scaling. + */ + readonly scaleMode: Phaser.Scale.ScaleModeType; + + /** + * Is the Scale Manager allowed to adjust the CSS height property of the parent to be 100%? + */ + readonly expandParent: boolean; + + /** + * Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. + */ + readonly autoRound: integer; + + /** + * Automatically center the canvas within the parent? + */ + readonly autoCenter: Phaser.Scale.CenterType; + + /** + * How many ms should elapse before checking if the browser size has changed? + */ + readonly resizeInterval: integer; + + /** + * The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. + */ + readonly fullscreenTarget: HTMLElement | string; + + /** + * The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. + */ + readonly minWidth: integer; + + /** + * The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. + */ + readonly maxWidth: integer; + + /** + * The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. + */ + readonly minHeight: integer; + + /** + * The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. + */ + readonly maxHeight: integer; + + /** + * Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default) + */ + readonly renderType: number; + + /** + * Force Phaser to use your own Canvas element instead of creating one. + */ + readonly canvas: HTMLCanvasElement; + + /** + * Force Phaser to use your own Canvas context instead of creating one. + */ + readonly context: CanvasRenderingContext2D | WebGLRenderingContext; + + /** + * Optional CSS attributes to be set on the canvas object created by the renderer. + */ + readonly canvasStyle: string; + + /** + * Is Phaser running under a custom (non-native web) environment? If so, set this to `true` to skip internal Feature detection. If `true` the `renderType` cannot be left as `AUTO`. + */ + readonly customEnvironment: boolean; + + /** + * The default Scene configuration object. + */ + readonly sceneConfig: object; + + /** + * A seed which the Random Data Generator will use. If not given, a dynamic seed based on the time is used. + */ + readonly seed: string[]; + + /** + * The title of the game. + */ + readonly gameTitle: string; + + /** + * The URL of the game. + */ + readonly gameURL: string; + + /** + * The version of the game. + */ + readonly gameVersion: string; + + /** + * If `true` the window will automatically be given focus immediately and on any future mousedown event. + */ + readonly autoFocus: boolean; + + /** + * Should the game create a div element to act as a DOM Container? Only enable if you're using DOM Element objects. You must provide a parent object if you use this feature. + */ + readonly domCreateContainer: boolean; + + /** + * Should the DOM Container that is created (if `dom.createContainer` is true) be positioned behind (true) or over the top (false, the default) of the game canvas? + */ + readonly domBehindCanvas: boolean; + + /** + * Enable the Keyboard Plugin. This can be disabled in games that don't need keyboard input. + */ + readonly inputKeyboard: boolean; + + /** + * The DOM Target to listen for keyboard events on. Defaults to `window` if not specified. + */ + readonly inputKeyboardEventTarget: any; + + /** + * `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty. + */ + readonly inputKeyboardCapture: integer[]; + + /** + * Enable the Mouse Plugin. This can be disabled in games that don't need mouse input. + */ + readonly inputMouse: boolean | object; + + /** + * The DOM Target to listen for mouse events on. Defaults to the game canvas if not specified. + */ + readonly inputMouseEventTarget: any; + + /** + * Should mouse events be captured? I.e. have prevent default called on them. + */ + readonly inputMouseCapture: boolean; + + /** + * Enable the Touch Plugin. This can be disabled in games that don't need touch input. + */ + readonly inputTouch: boolean; + + /** + * The DOM Target to listen for touch events on. Defaults to the game canvas if not specified. + */ + readonly inputTouchEventTarget: any; + + /** + * Should touch events be captured? I.e. have prevent default called on them. + */ + readonly inputTouchCapture: boolean; + + /** + * The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1. + */ + readonly inputActivePointers: integer; + + /** + * The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. + */ + readonly inputSmoothFactor: integer; + + /** + * Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire. + */ + readonly inputWindowEvents: boolean; + + /** + * Enable the Gamepad Plugin. This can be disabled in games that don't need gamepad input. + */ + readonly inputGamepad: boolean; + + /** + * The DOM Target to listen for gamepad events on. Defaults to `window` if not specified. + */ + readonly inputGamepadEventTarget: any; + + /** + * Set to `true` to disable the right-click context menu. + */ + readonly disableContextMenu: boolean; + + /** + * The Audio Configuration object. + */ + readonly audio: Phaser.Types.Core.AudioConfig; + + /** + * Don't write the banner line to the console.log. + */ + readonly hideBanner: boolean; + + /** + * Omit Phaser's name and version from the banner. + */ + readonly hidePhaser: boolean; + + /** + * The color of the banner text. + */ + readonly bannerTextColor: string; + + /** + * The background colors of the banner. + */ + readonly bannerBackgroundColor: string[]; + + /** + * The Frame Rate Configuration object, as parsed by the Timestep class. + */ + readonly fps: Phaser.Types.Core.FPSConfig; + + /** + * When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. + */ + readonly antialias: boolean; + + /** + * When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details. + */ + readonly desynchronized: boolean; + + /** + * Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. + */ + readonly roundPixels: boolean; + + /** + * Prevent pixel art from becoming blurred when scaled. It will remain crisp (tells the WebGL renderer to automatically create textures using a linear filter mode). + */ + readonly pixelArt: boolean; + + /** + * Whether the game canvas will have a transparent background. + */ + readonly transparent: boolean; + + /** + * Whether the game canvas will be cleared between each rendering frame. You can disable this if you have a full-screen background image or game object. + */ + readonly clearBeforeRender: boolean; + + /** + * In WebGL mode, sets the drawing buffer to contain colors with pre-multiplied alpha. + */ + readonly premultipliedAlpha: boolean; + + /** + * Let the browser abort creating a WebGL context if it judges performance would be unacceptable. + */ + readonly failIfMajorPerformanceCaveat: boolean; + + /** + * "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. + */ + readonly powerPreference: string; + + /** + * The default WebGL Batch size. + */ + readonly batchSize: integer; + + /** + * The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. + */ + readonly maxLights: integer; + + /** + * The background color of the game canvas. The default is black. This value is ignored if `transparent` is set to `true`. + */ + readonly backgroundColor: Phaser.Display.Color; + + /** + * Called before Phaser boots. Useful for initializing anything not related to Phaser that Phaser may require while booting. + */ + readonly preBoot: Phaser.Types.Core.BootCallback; + + /** + * A function to run at the end of the boot sequence. At this point, all the game systems have started and plugins have been loaded. + */ + readonly postBoot: Phaser.Types.Core.BootCallback; + + /** + * The Physics Configuration object. + */ + readonly physics: Phaser.Types.Core.PhysicsConfig; + + /** + * The default physics system. It will be started for each scene. Either 'arcade', 'impact' or 'matter'. + */ + readonly defaultPhysicsSystem: boolean | string; + + /** + * A URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'. + */ + readonly loaderBaseURL: string; + + /** + * A URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'. + */ + readonly loaderPath: string; + + /** + * Maximum parallel downloads allowed for resources (Default to 32). + */ + readonly loaderMaxParallelDownloads: integer; + + /** + * 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. + */ + readonly loaderCrossOrigin: string | undefined; + + /** + * The response type of the XHR request, e.g. `blob`, `text`, etc. + */ + readonly loaderResponseType: string; + + /** + * Should the XHR request use async or not? + */ + readonly loaderAsync: boolean; + + /** + * Optional username for all XHR requests. + */ + readonly loaderUser: string; + + /** + * Optional password for all XHR requests. + */ + readonly loaderPassword: string; + + /** + * Optional XHR timeout value, in ms. + */ + readonly loaderTimeout: integer; + + /** + * An array of global plugins to be installed. + */ + readonly installGlobalPlugins: any; + + /** + * An array of Scene level plugins to be installed. + */ + readonly installScenePlugins: any; + + /** + * The plugins installed into every Scene (in addition to CoreScene and Global). + */ + readonly defaultPlugins: any; + + /** + * A base64 encoded PNG that will be used as the default blank texture. + */ + readonly defaultImage: string; + + /** + * A base64 encoded PNG that will be used as the default texture when a texture is assigned that is missing or not loaded. + */ + readonly missingImage: string; + + } + + /** + * Called automatically by Phaser.Game and responsible for creating the renderer it will use. + * + * Relies upon two webpack global flags to be defined: `WEBGL_RENDERER` and `CANVAS_RENDERER` during build time, but not at run-time. + * @param game The Phaser.Game instance on which the renderer will be set. + */ + function CreateRenderer(game: Phaser.Game): void; + + /** + * Called automatically by Phaser.Game and responsible for creating the console.log debug header. + * + * You can customize or disable the header via the Game Config object. + * @param game The Phaser.Game instance which will output this debug header. + */ + function DebugHeader(game: Phaser.Game): void; + + namespace Events { + /** + * The Game Blur Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps + * tab, or if they simply remove focus from the browser to another app. + */ + const BLUR: any; + + /** + * The Game Boot Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. + * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. + */ + const BOOT: any; + + /** + * The Game Destroy Event. + * + * This event is dispatched when the game instance has been told to destroy itself. + * Lots of internal systems listen to this event in order to clear themselves out. + * Custom plugins and game code should also do the same. + */ + const DESTROY: any; + + /** + * The Game Focus Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. + */ + const FOCUS: any; + + /** + * The Game Hidden Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. + * + * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which + * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something + * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) + */ + const HIDDEN: any; + + /** + * The Game Pause Event. + * + * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. + */ + const PAUSE: any; + + /** + * The Game Post-Render Event. + * + * This event is dispatched right at the end of the render process. + * + * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. + * Use it for any last minute post-processing before the next game step begins. + */ + const POST_RENDER: any; + + /** + * The Game Post-Step Event. + * + * This event is dispatched after the Scene Manager has updated. + * Hook into it from plugins or systems that need to do things before the render starts. + */ + const POST_STEP: any; + + /** + * The Game Pre-Render Event. + * + * This event is dispatched immediately before any of the Scenes have started to render. + * + * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. + */ + const PRE_RENDER: any; + + /** + * The Game Pre-Step Event. + * + * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. + * Hook into it from plugins or systems that need to update before the Scene Manager does. + */ + const PRE_STEP: any; + + /** + * The Game Ready Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, + * and all local systems are now able to start. + */ + const READY: any; + + /** + * The Game Resume Event. + * + * This event is dispatched when the game loop leaves a paused state and resumes running. + */ + const RESUME: any; + + /** + * The Game Step Event. + * + * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. + * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. + */ + const STEP: any; + + /** + * The Game Visible Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a visible state, previously having been hidden. + * + * Only browsers that support the Visibility API will cause this event to be emitted. + */ + const VISIBLE: any; + + } + + /** + * [description] + */ + class TimeStep { + /** + * + * @param game A reference to the Phaser.Game instance that owns this Time Step. + */ + constructor(game: Phaser.Game, config: Phaser.Types.Core.FPSConfig); + + /** + * A reference to the Phaser.Game instance. + */ + readonly game: Phaser.Game; + + /** + * [description] + */ + readonly raf: Phaser.DOM.RequestAnimationFrame; + + /** + * A flag that is set once the TimeStep has started running and toggled when it stops. + */ + readonly started: boolean; + + /** + * A flag that is set once the TimeStep has started running and toggled when it stops. + * The difference between this value and `started` is that `running` is toggled when + * the TimeStep is sent to sleep, where-as `started` remains `true`, only changing if + * the TimeStep is actually stopped, not just paused. + */ + readonly running: boolean; + + /** + * The minimum fps rate you want the Time Step to run at. + */ + minFps: integer; + + /** + * The target fps rate for the Time Step to run at. + * + * Setting this value will not actually change the speed at which the browser runs, that is beyond + * the control of Phaser. Instead, it allows you to determine performance issues and if the Time Step + * is spiraling out of control. + */ + targetFps: integer; + + /** + * An exponential moving average of the frames per second. + */ + readonly actualFps: integer; + + /** + * [description] + */ + readonly nextFpsUpdate: integer; + + /** + * The number of frames processed this second. + */ + readonly framesThisSecond: integer; + + /** + * A callback to be invoked each time the Time Step steps. + */ + callback: Phaser.Types.Core.TimeStepCallback; + + /** + * You can force the Time Step to use Set Timeout instead of Request Animation Frame by setting + * the `forceSetTimeOut` property to `true` in the Game Configuration object. It cannot be changed at run-time. + */ + readonly forceSetTimeOut: boolean; + + /** + * The time, calculated at the start of the current step, as smoothed by the delta value. + */ + time: number; + + /** + * The time at which the game started running. This value is adjusted if the game is then + * paused and resumes. + */ + startTime: number; + + /** + * The time, as returned by `performance.now` of the previous step. + */ + lastTime: number; + + /** + * The current frame the game is on. This counter is incremented once every game step, regardless of how much + * time has passed and is unaffected by delta smoothing. + */ + readonly frame: integer; + + /** + * Is the browser currently considered in focus by the Page Visibility API? + * This value is set in the `blur` method, which is called automatically by the Game instance. + */ + readonly inFocus: boolean; + + /** + * The delta time, in ms, since the last game step. This is a clamped and smoothed average value. + */ + delta: integer; + + /** + * Internal index of the delta history position. + */ + deltaIndex: integer; + + /** + * Internal array holding the previous delta values, used for delta smoothing. + */ + deltaHistory: integer[]; + + /** + * The maximum number of delta values that are retained in order to calculate a smoothed moving average. + * + * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. + */ + deltaSmoothingMax: integer; + + /** + * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually + * as a result of switching tabs and regaining focus. + * + * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. + */ + panicMax: integer; + + /** + * The actual elapsed time in ms between one update and the next. + * + * Unlike with `delta`, no smoothing, capping, or averaging is applied to this value. + * So please be careful when using this value in math calculations. + */ + rawDelta: number; + + /** + * The time, as returned by `performance.now` at the very start of the current step. + * This can differ from the `time` value in that it isn't calculated based on the delta value. + */ + now: number; + + /** + * Called by the Game instance when the DOM window.onBlur event triggers. + */ + blur(): void; + + /** + * Called by the Game instance when the DOM window.onFocus event triggers. + */ + focus(): void; + + /** + * Called when the visibility API says the game is 'hidden' (tab switch out of view, etc) + */ + pause(): void; + + /** + * Called when the visibility API says the game is 'visible' again (tab switch back into view, etc) + */ + resume(): void; + + /** + * Resets the time, lastTime, fps averages and delta history. + * Called automatically when a browser sleeps them resumes. + */ + resetDelta(): void; + + /** + * Starts the Time Step running, if it is not already doing so. + * Called automatically by the Game Boot process. + * @param callback The callback to be invoked each time the Time Step steps. + */ + start(callback: Phaser.Types.Core.TimeStepCallback): void; + + /** + * The main step method. This is called each time the browser updates, either by Request Animation Frame, + * or by Set Timeout. It is responsible for calculating the delta values, frame totals, cool down history and more. + * You generally should never call this method directly. + */ + step(): void; + + /** + * Manually calls `TimeStep.step`. + */ + tick(): void; + + /** + * Sends the TimeStep to sleep, stopping Request Animation Frame (or SetTimeout) and toggling the `running` flag to false. + */ + sleep(): void; + + /** + * Wakes-up the TimeStep, restarting Request Animation Frame (or SetTimeout) and toggling the `running` flag to true. + * The `seamless` argument controls if the wake-up should adjust the start time or not. + * @param seamless Adjust the startTime based on the lastTime values. Default false. + */ + wake(seamless?: boolean): void; + + /** + * Gets the duration which the game has been running, in seconds. + */ + getDuration(): number; + + /** + * Gets the duration which the game has been running, in ms. + */ + getDurationMS(): number; + + /** + * Stops the TimeStep running. + */ + stop(): Phaser.Core.TimeStep; + + /** + * Destroys the TimeStep. This will stop Request Animation Frame, stop the step, clear the callbacks and null + * any objects. + */ + destroy(): void; + + } + + /** + * The Visibility Handler is responsible for listening out for document level visibility change events. + * This includes `visibilitychange` if the browser supports it, and blur and focus events. It then uses + * the provided Event Emitter and fires the related events. + * @param game The Game instance this Visibility Handler is working on. + */ + function VisibilityHandler(game: Phaser.Game): void; + + } + + namespace Create { + /** + * [description] + * @param config [description] + */ + function GenerateTexture(config: Phaser.Types.Create.GenerateTextureConfig): HTMLCanvasElement; + + namespace Palettes { + /** + * A 16 color palette by [Arne](http://androidarts.com/palette/16pal.htm) + */ + var ARNE16: Phaser.Types.Create.Palette; + + /** + * A 16 color palette inspired by the Commodore 64. + */ + var C64: Phaser.Types.Create.Palette; + + /** + * A 16 color CGA inspired palette by [Arne](http://androidarts.com/palette/16pal.htm) + */ + var CGA: Phaser.Types.Create.Palette; + + /** + * A 16 color JMP palette by [Arne](http://androidarts.com/palette/16pal.htm) + */ + var JMP: Phaser.Types.Create.Palette; + + /** + * A 16 color palette inspired by Japanese computers like the MSX. + */ + var MSX: Phaser.Types.Create.Palette; + + } + + } + + namespace Curves { + /** + * A higher-order Bézier curve constructed of four points. + */ + class CubicBezier extends Phaser.Curves.Curve { + /** + * + * @param p0 Start point, or an array of point pairs. + * @param p1 Control Point 1. + * @param p2 Control Point 2. + * @param p3 End Point. + */ + constructor(p0: Phaser.Math.Vector2 | Phaser.Math.Vector2[], p1: Phaser.Math.Vector2, p2: Phaser.Math.Vector2, p3: Phaser.Math.Vector2); + + /** + * The start point of this curve. + */ + p0: Phaser.Math.Vector2; + + /** + * The first control point of this curve. + */ + p1: Phaser.Math.Vector2; + + /** + * The second control point of this curve. + */ + p2: Phaser.Math.Vector2; + + /** + * The end point of this curve. + */ + p3: Phaser.Math.Vector2; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * Returns the resolution of this curve. + * @param divisions The amount of divisions used by this curve. + */ + getResolution(divisions: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * Draws this curve to the specified graphics object. + * @param graphics The graphics object this curve should be drawn to. + * @param pointsTotal The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. Default 32. + */ + draw(graphics: G, pointsTotal?: integer): G; + + /** + * Returns a JSON object that describes this curve. + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + /** + * Generates a curve from a JSON object. + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.CubicBezier; + + } + + /** + * A Base Curve class, which all other curve types extend. + * + * Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) + */ + class Curve { + /** + * + * @param type [description] + */ + constructor(type: string); + + /** + * String based identifier for the type of curve. + */ + type: string; + + /** + * The default number of divisions within the curve. + */ + defaultDivisions: integer; + + /** + * The quantity of arc length divisions within the curve. + */ + arcLengthDivisions: integer; + + /** + * An array of cached arc length values. + */ + cacheArcLengths: number[]; + + /** + * Does the data of this curve need updating? + */ + needsUpdate: boolean; + + /** + * [description] + */ + active: boolean; + + /** + * Draws this curve on the given Graphics object. + * + * The curve is drawn using `Graphics.strokePoints` so will be drawn at whatever the present Graphics stroke color is. + * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. + * @param graphics The Graphics instance onto which this curve will be drawn. + * @param pointsTotal The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance. Default 32. + */ + draw(graphics: G, pointsTotal?: integer): G; + + /** + * Returns a Rectangle where the position and dimensions match the bounds of this Curve. + * + * You can control the accuracy of the bounds. The value given is used to work out how many points + * to plot across the curve. Higher values are more accurate at the cost of calculation speed. + * @param out The Rectangle to store the bounds in. If falsey a new object will be created. + * @param accuracy The accuracy of the bounds calculations. Default 16. + */ + getBounds(out?: Phaser.Geom.Rectangle, accuracy?: integer): Phaser.Geom.Rectangle; + + /** + * Returns an array of points, spaced out X distance pixels apart. + * The smaller the distance, the larger the array will be. + * @param distance The distance, in pixels, between each point along the curve. + */ + getDistancePoints(distance: integer): Phaser.Geom.Point[]; + + /** + * [description] + * @param out Optional Vector object to store the result in. + */ + getEndPoint(out?: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * [description] + */ + getLength(): number; + + /** + * [description] + * @param divisions [description] + */ + getLengths(divisions?: integer): number[]; + + /** + * [description] + * @param u [description] + * @param out [description] + */ + getPointAt(u: number, out?: O): O; + + /** + * [description] + * @param divisions [description] + */ + getPoints(divisions?: integer): Phaser.Math.Vector2[]; + + /** + * [description] + * @param out [description] + */ + getRandomPoint(out?: O): O; + + /** + * [description] + * @param divisions [description] + */ + getSpacedPoints(divisions?: integer): Phaser.Math.Vector2[]; + + /** + * [description] + * @param out [description] + */ + getStartPoint(out?: O): O; + + /** + * [description] + * @param t [description] + * @param out [description] + */ + getTangent(t: number, out?: O): O; + + /** + * [description] + * @param u [description] + * @param out [description] + */ + getTangentAt(u: number, out?: O): O; + + /** + * [description] + * @param distance [description] + * @param divisions [description] + */ + getTFromDistance(distance: integer, divisions?: integer): number; + + /** + * [description] + * @param u [description] + * @param distance [description] + * @param divisions [description] + */ + getUtoTmapping(u: number, distance: integer, divisions?: integer): number; + + /** + * [description] + */ + updateArcLengths(): void; + + } + + /** + * An Elliptical Curve derived from the Base Curve class. + * + * See https://en.wikipedia.org/wiki/Elliptic_curve for more details. + */ + class Ellipse extends Phaser.Curves.Curve { + /** + * + * @param x The x coordinate of the ellipse, or an Ellipse Curve configuration object. Default 0. + * @param y The y coordinate of the ellipse. Default 0. + * @param xRadius The horizontal radius of ellipse. Default 0. + * @param yRadius The vertical radius of ellipse. Default 0. + * @param startAngle The start angle of the ellipse, in degrees. Default 0. + * @param endAngle The end angle of the ellipse, in degrees. Default 360. + * @param clockwise Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) Default false. + * @param rotation The rotation of the ellipse, in degrees. Default 0. + */ + constructor(x?: number | Phaser.Types.Curves.EllipseCurveConfig, y?: number, xRadius?: number, yRadius?: number, startAngle?: integer, endAngle?: integer, clockwise?: boolean, rotation?: integer); + + /** + * The center point of the ellipse. Used for calculating rotation. + */ + p0: Phaser.Math.Vector2; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * [description] + * @param divisions [description] + */ + getResolution(divisions: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * Sets the horizontal radius of this curve. + * @param value The horizontal radius of this curve. + */ + setXRadius(value: number): Phaser.Curves.Ellipse; + + /** + * Sets the vertical radius of this curve. + * @param value The vertical radius of this curve. + */ + setYRadius(value: number): Phaser.Curves.Ellipse; + + /** + * Sets the width of this curve. + * @param value The width of this curve. + */ + setWidth(value: number): Phaser.Curves.Ellipse; + + /** + * Sets the height of this curve. + * @param value The height of this curve. + */ + setHeight(value: number): Phaser.Curves.Ellipse; + + /** + * Sets the start angle of this curve. + * @param value The start angle of this curve, in radians. + */ + setStartAngle(value: number): Phaser.Curves.Ellipse; + + /** + * Sets the end angle of this curve. + * @param value The end angle of this curve, in radians. + */ + setEndAngle(value: number): Phaser.Curves.Ellipse; + + /** + * Sets if this curve extends clockwise or anti-clockwise. + * @param value The clockwise state of this curve. + */ + setClockwise(value: boolean): Phaser.Curves.Ellipse; + + /** + * Sets the rotation of this curve. + * @param value The rotation of this curve, in radians. + */ + setRotation(value: number): Phaser.Curves.Ellipse; + + /** + * The x coordinate of the center of the ellipse. + */ + x: number; + + /** + * The y coordinate of the center of the ellipse. + */ + y: number; + + /** + * The horizontal radius of the ellipse. + */ + xRadius: number; + + /** + * The vertical radius of the ellipse. + */ + yRadius: number; + + /** + * The start angle of the ellipse in degrees. + */ + startAngle: number; + + /** + * The end angle of the ellipse in degrees. + */ + endAngle: number; + + /** + * `true` if the ellipse rotation is clockwise or `false` if anti-clockwise. + */ + clockwise: boolean; + + /** + * The rotation of the ellipse, relative to the center, in degrees. + */ + angle: number; + + /** + * The rotation of the ellipse, relative to the center, in radians. + */ + rotation: number; + + /** + * JSON serialization of the curve. + */ + toJSON(): Phaser.Types.Curves.JSONEllipseCurve; + + /** + * Creates a curve from the provided Ellipse Curve Configuration object. + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONEllipseCurve): Phaser.Curves.Ellipse; + + } + + /** + * A LineCurve is a "curve" comprising exactly two points (a line segment). + */ + class Line extends Phaser.Curves.Curve { + /** + * + * @param p0 The first endpoint. + * @param p1 The second endpoint. + */ + constructor(p0: Phaser.Math.Vector2 | number[], p1?: Phaser.Math.Vector2); + + /** + * The first endpoint. + */ + p0: Phaser.Math.Vector2; + + /** + * The second endpoint. + */ + p1: Phaser.Math.Vector2; + + /** + * Returns a Rectangle where the position and dimensions match the bounds of this Curve. + * @param out A Rectangle object to store the bounds in. If not given a new Rectangle will be created. + */ + getBounds(out?: O): O; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * Gets the resolution of the line. + * @param divisions The number of divisions to consider. Default 1. + */ + getResolution(divisions?: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * Gets a point at a given position on the line. + * @param u The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPointAt(u: number, out?: O): O; + + /** + * Gets the slope of the line as a unit vector. + */ + getTangent(): O; + + /** + * Draws this curve on the given Graphics object. + * + * The curve is drawn using `Graphics.lineBetween` so will be drawn at whatever the present Graphics line color is. + * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. + * @param graphics The Graphics instance onto which this curve will be drawn. + */ + draw(graphics: G): G; + + /** + * Gets a JSON representation of the line. + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + /** + * Configures this line from a JSON representation. + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.Line; + + } + + /** + * A MoveTo Curve is a very simple curve consisting of only a single point. Its intended use is to move the ending point in a Path. + */ + class MoveTo { + /** + * + * @param x `x` pixel coordinate. + * @param y `y` pixel coordinate. + */ + constructor(x?: number, y?: number); + + /** + * Denotes that this Curve does not influence the bounds, points, and drawing of its parent Path. Must be `false` or some methods in the parent Path will throw errors. + */ + active: boolean; + + /** + * The lone point which this curve consists of. + */ + p0: Phaser.Math.Vector2; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * Retrieves the point at given position in the curve. This will always return this curve's only point. + * @param u The position in the path to retrieve, between 0 and 1. Not used. + * @param out An optional vector in which to store the point. + */ + getPointAt(u: number, out?: O): O; + + /** + * Gets the resolution of this curve. + */ + getResolution(): number; + + /** + * Gets the length of this curve. + */ + getLength(): number; + + /** + * Converts this curve into a JSON-serializable object. + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + } + + /** + * A Path combines multiple Curves into one continuous compound curve. + * It does not matter how many Curves are in the Path or what type they are. + * + * A Curve in a Path does not have to start where the previous Curve ends - that is to say, a Path does not + * have to be an uninterrupted curve. Only the order of the Curves influences the actual points on the Path. + */ + class Path { + /** + * + * @param x The X coordinate of the Path's starting point or a {@link Phaser.Types.Curves.JSONPath}. Default 0. + * @param y The Y coordinate of the Path's starting point. Default 0. + */ + constructor(x?: number, y?: number); + + /** + * The name of this Path. + * Empty by default and never populated by Phaser, this is left for developers to use. + */ + name: string; + + /** + * The list of Curves which make up this Path. + */ + curves: Phaser.Curves.Curve[]; + + /** + * The cached length of each Curve in the Path. + * + * Used internally by {@link #getCurveLengths}. + */ + cacheLengths: number[]; + + /** + * Automatically closes the path. + */ + autoClose: boolean; + + /** + * The starting point of the Path. + * + * This is not necessarily equivalent to the starting point of the first Curve in the Path. In an empty Path, it's also treated as the ending point. + */ + startPoint: Phaser.Math.Vector2; + + /** + * Appends a Curve to the end of the Path. + * + * The Curve does not have to start where the Path ends or, for an empty Path, at its defined starting point. + * @param curve The Curve to append. + */ + add(curve: Phaser.Curves.Curve): Phaser.Curves.Path; + + /** + * Creates a circular Ellipse Curve positioned at the end of the Path. + * @param radius The radius of the circle. + * @param clockwise `true` to create a clockwise circle as opposed to a counter-clockwise circle. Default false. + * @param rotation The rotation of the circle in degrees. Default 0. + */ + circleTo(radius: number, clockwise?: boolean, rotation?: number): Phaser.Curves.Path; + + /** + * Ensures that the Path is closed. + * + * A closed Path starts and ends at the same point. If the Path is not closed, a straight Line Curve will be created from the ending point directly to the starting point. During the check, the actual starting point of the Path, i.e. the starting point of the first Curve, will be used as opposed to the Path's defined {@link startPoint}, which could differ. + * + * Calling this method on an empty Path will result in an error. + */ + closePath(): Phaser.Curves.Path; + + /** + * Creates a cubic bezier curve starting at the previous end point and ending at p3, using p1 and p2 as control points. + * @param x The x coordinate of the end point. Or, if a Vec2, the p1 value. + * @param y The y coordinate of the end point. Or, if a Vec2, the p2 value. + * @param control1X The x coordinate of the first control point. Or, if a Vec2, the p3 value. + * @param control1Y The y coordinate of the first control point. Not used if vec2s are provided as the first 3 arguments. + * @param control2X The x coordinate of the second control point. Not used if vec2s are provided as the first 3 arguments. + * @param control2Y The y coordinate of the second control point. Not used if vec2s are provided as the first 3 arguments. + */ + cubicBezierTo(x: number | Phaser.Math.Vector2, y: number | Phaser.Math.Vector2, control1X: number | Phaser.Math.Vector2, control1Y?: number, control2X?: number, control2Y?: number): Phaser.Curves.Path; + + /** + * Creates a Quadratic Bezier Curve starting at the ending point of the Path. + * @param x The X coordinate of the second control point or, if it's a `Vector2`, the first control point. + * @param y The Y coordinate of the second control point or, if `x` is a `Vector2`, the second control point. + * @param controlX If `x` is not a `Vector2`, the X coordinate of the first control point. + * @param controlY If `x` is not a `Vector2`, the Y coordinate of the first control point. + */ + quadraticBezierTo(x: number | Phaser.Math.Vector2[], y?: number, controlX?: number, controlY?: number): Phaser.Curves.Path; + + /** + * Draws all Curves in the Path to a Graphics Game Object. + * @param graphics The Graphics Game Object to draw to. + * @param pointsTotal The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing. Default 32. + */ + draw(graphics: Phaser.GameObjects.Graphics, pointsTotal?: integer): G; + + /** + * Creates an ellipse curve positioned at the previous end point, using the given parameters. + * @param xRadius The horizontal radius of the ellipse. + * @param yRadius The vertical radius of the ellipse. + * @param startAngle The start angle of the ellipse, in degrees. + * @param endAngle The end angle of the ellipse, in degrees. + * @param clockwise Whether the ellipse should be rotated clockwise (`true`) or counter-clockwise (`false`). + * @param rotation The rotation of the ellipse, in degrees. + */ + ellipseTo(xRadius: number, yRadius: number, startAngle: number, endAngle: number, clockwise: boolean, rotation: number): Phaser.Curves.Path; + + /** + * Creates a Path from a Path Configuration object. + * + * The provided object should be a {@link Phaser.Types.Curves.JSONPath}, as returned by {@link #toJSON}. Providing a malformed object may cause errors. + * @param data The JSON object containing the Path data. + */ + fromJSON(data: Phaser.Types.Curves.JSONPath): Phaser.Curves.Path; + + /** + * Returns a Rectangle with a position and size matching the bounds of this Path. + * @param out The Rectangle to store the bounds in. + * @param accuracy The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed. Default 16. + */ + getBounds(out?: O, accuracy?: integer): O; + + /** + * Returns an array containing the length of the Path at the end of each Curve. + * + * The result of this method will be cached to avoid recalculating it in subsequent calls. The cache is only invalidated when the {@link #curves} array changes in length, leading to potential inaccuracies if a Curve in the Path is changed, or if a Curve is removed and another is added in its place. + */ + getCurveLengths(): number[]; + + /** + * Returns the ending point of the Path. + * + * A Path's ending point is equivalent to the ending point of the last Curve in the Path. For an empty Path, the ending point is at the Path's defined {@link #startPoint}. + * @param out The object to store the point in. + */ + getEndPoint(out?: O): O; + + /** + * Returns the total length of the Path. + */ + getLength(): number; + + /** + * Calculates the coordinates of the point at the given normalized location (between 0 and 1) on the Path. + * + * The location is relative to the entire Path, not to an individual Curve. A location of 0.5 is always in the middle of the Path and is thus an equal distance away from both its starting and ending points. In a Path with one Curve, it would be in the middle of the Curve; in a Path with two Curves, it could be anywhere on either one of them depending on their lengths. + * @param t The location of the point to return, between 0 and 1. + * @param out The object in which to store the calculated point. + */ + getPoint(t: number, out?: O): O; + + /** + * Returns the defined starting point of the Path. + * + * This is not necessarily equal to the starting point of the first Curve if it differs from {@link startPoint}. + * @param divisions The number of points to divide the path in to. Default 12. + */ + getPoints(divisions?: integer): Phaser.Math.Vector2[]; + + /** + * [description] + * @param out `Vector2` instance that should be used for storing the result. If `undefined` a new `Vector2` will be created. + */ + getRandomPoint(out?: O): O; + + /** + * Creates a straight Line Curve from the ending point of the Path to the given coordinates. + * @param divisions The X coordinate of the line's ending point, or the line's ending point as a `Vector2`. Default 40. + */ + getSpacedPoints(divisions?: integer): Phaser.Math.Vector2[]; + + /** + * [description] + * @param out [description] + */ + getStartPoint(out?: O): O; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + lineTo(x: number | Phaser.Math.Vector2, y?: number): Phaser.Curves.Path; + + /** + * [description] + * @param points [description] + */ + splineTo(points: Phaser.Math.Vector2[]): Phaser.Curves.Path; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + moveTo(x: number, y: number): Phaser.Curves.Path; + + /** + * [description] + */ + toJSON(): Phaser.Types.Curves.JSONPath; + + /** + * [description] + */ + updateArcLengths(): void; + + /** + * [description] + */ + destroy(): void; + + } + + /** + * [description] + */ + class QuadraticBezier extends Phaser.Curves.Curve { + /** + * + * @param p0 Start point, or an array of point pairs. + * @param p1 Control Point 1. + * @param p2 Control Point 2. + */ + constructor(p0: Phaser.Math.Vector2 | number[], p1: Phaser.Math.Vector2, p2: Phaser.Math.Vector2); + + /** + * [description] + */ + p0: Phaser.Math.Vector2; + + /** + * [description] + */ + p1: Phaser.Math.Vector2; + + /** + * [description] + */ + p2: Phaser.Math.Vector2; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * [description] + * @param divisions [description] + */ + getResolution(divisions: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * [description] + * @param graphics `Graphics` object to draw onto. + * @param pointsTotal Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. Default 32. + */ + draw(graphics: G, pointsTotal?: integer): G; + + /** + * Converts the curve into a JSON compatible object. + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + /** + * Creates a curve from a JSON object, e. g. created by `toJSON`. + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.QuadraticBezier; + + } + + /** + * [description] + */ + class Spline extends Phaser.Curves.Curve { + /** + * + * @param points [description] + */ + constructor(points?: Phaser.Math.Vector2[]); + + /** + * [description] + */ + points: Phaser.Math.Vector2[]; + + /** + * [description] + * @param points [description] + */ + addPoints(points: Phaser.Math.Vector2[] | number[] | number[][]): Phaser.Curves.Spline; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + addPoint(x: number, y: number): Phaser.Math.Vector2; + + /** + * Gets the starting point on the curve. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getStartPoint(out?: O): O; + + /** + * [description] + * @param divisions [description] + */ + getResolution(divisions: number): number; + + /** + * Get point at relative position in curve according to length. + * @param t The position along the curve to return. Where 0 is the start and 1 is the end. + * @param out A Vector2 object to store the result in. If not given will be created. + */ + getPoint(t: number, out?: O): O; + + /** + * [description] + */ + toJSON(): Phaser.Types.Curves.JSONCurve; + + /** + * [description] + * @param data The JSON object containing this curve data. + */ + static fromJSON(data: Phaser.Types.Curves.JSONCurve): Phaser.Curves.Spline; + + } + + } + + namespace Data { + /** + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + */ + class DataManager { + /** + * + * @param parent The object that this DataManager belongs to. + * @param eventEmitter The DataManager's event emitter. + */ + constructor(parent: object, eventEmitter: Phaser.Events.EventEmitter); + + /** + * The object that this DataManager belongs to. + */ + parent: any; + + /** + * The DataManager's event emitter. + */ + events: Phaser.Events.EventEmitter; + + /** + * The data list. + */ + list: {[key: string]: any}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + */ + values: {[key: string]: any}; + + /** + * Retrieves the value for the given key, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * @param key The key of the value to retrieve, or an array of keys. + */ + get(key: string | string[]): any; + + /** + * Retrieves all data values in a new object. + */ + getAll(): {[key: string]: any}; + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * @param search A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + */ + query(search: RegExp): {[key: string]: any}; + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * @param key The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. + * @param data The value to set for the given key. If an object is provided as the key this argument is ignored. + */ + set(key: string | object, data: any): Phaser.Data.DataManager; + + /** + * Passes all data entries to the given callback. + * @param callback The function to call. + * @param context Value to use as `this` when executing callback. + * @param args Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + each(callback: DataEachCallback, context?: any, ...args: any[]): Phaser.Data.DataManager; + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * @param data The data to merge. + * @param overwrite Whether to overwrite existing data. Defaults to true. Default true. + */ + merge(data: {[key: string]: any}, overwrite?: boolean): Phaser.Data.DataManager; + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * @param key The key to remove, or an array of keys to remove. + */ + remove(key: string | string[]): Phaser.Data.DataManager; + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * @param key The key of the value to retrieve and delete. + */ + pop(key: string): any; + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * @param key The key to check. + */ + has(key: string): boolean; + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * @param value Whether to freeze or unfreeze the Data Manager. + */ + setFreeze(value: boolean): Phaser.Data.DataManager; + + /** + * Delete all data in this Data Manager and unfreeze it. + */ + reset(): Phaser.Data.DataManager; + + /** + * Destroy this data manager. + */ + destroy(): void; + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + */ + freeze: boolean; + + /** + * Return the total number of entries in this Data Manager. + */ + count: integer; + + } + + /** + * The Data Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + */ + class DataManagerPlugin extends Phaser.Data.DataManager { + /** + * + * @param scene A reference to the Scene that this DataManager belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * A reference to the Scene that this DataManager belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene's Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + */ + destroy(): void; + + } + + namespace Events { + /** + * The Change Data Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`. + * + * This event is dispatched for all items that change in the Data Manager. + * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. + */ + const CHANGE_DATA: any; + + /** + * The Change Data Key Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`, + * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` + * then you can listen for `sprite.data.on('changedata-gold')`. + */ + const CHANGE_DATA_KEY: any; + + /** + * The Remove Data Event. + * + * This event is dispatched by a Data Manager when an item is removed from it. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`. + */ + const REMOVE_DATA: any; + + /** + * The Set Data Event. + * + * This event is dispatched by a Data Manager when a new item is added to the data store. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`. + */ + const SET_DATA: any; + + } + + } + + namespace Device { + /** + * Determines the audio playback capabilities of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.audio` from within any Scene. + */ + type Audio = { + /** + * Can this device play HTML Audio tags? + */ + audioData: boolean; + /** + * Can this device play EC-3 Dolby Digital Plus files? + */ + dolby: boolean; + /** + * Can this device can play m4a files. + */ + m4a: boolean; + /** + * Can this device play mp3 files? + */ + mp3: boolean; + /** + * Can this device play ogg files? + */ + ogg: boolean; + /** + * Can this device play opus files? + */ + opus: boolean; + /** + * Can this device play wav files? + */ + wav: boolean; + /** + * Does this device have the Web Audio API? + */ + webAudio: boolean; + /** + * Can this device play webm files? + */ + webm: boolean; + }; + + /** + * Determines the browser type and version running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.browser` from within any Scene. + */ + type Browser = { + /** + * Set to true if running in Chrome. + */ + chrome: boolean; + /** + * Set to true if running in Microsoft Edge browser. + */ + edge: boolean; + /** + * Set to true if running in Firefox. + */ + firefox: boolean; + /** + * Set to true if running in Internet Explorer 11 or less (not Edge). + */ + ie: boolean; + /** + * Set to true if running in Mobile Safari. + */ + mobileSafari: boolean; + /** + * Set to true if running in Opera. + */ + opera: boolean; + /** + * Set to true if running in Safari. + */ + safari: boolean; + /** + * Set to true if running in the Silk browser (as used on the Amazon Kindle) + */ + silk: boolean; + /** + * Set to true if running a Trident version of Internet Explorer (IE11+) + */ + trident: boolean; + /** + * If running in Chrome this will contain the major version number. + */ + chromeVersion: number; + /** + * If running in Firefox this will contain the major version number. + */ + firefoxVersion: number; + /** + * If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion. + */ + ieVersion: number; + /** + * If running in Safari this will contain the major version number. + */ + safariVersion: number; + /** + * If running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx} + */ + tridentVersion: number; + }; + + /** + * Determines the canvas features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.canvasFeatures` from within any Scene. + */ + type CanvasFeatures = { + /** + * Set to true if the browser supports inversed alpha. + */ + supportInverseAlpha: boolean; + /** + * Set to true if the browser supports new canvas blend modes. + */ + supportNewBlendModes: boolean; + }; + + /** + * Determines the features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.features` from within any Scene. + */ + type Features = { + /** + * True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap. + */ + canvasBitBltShift: boolean; + /** + * Is canvas available? + */ + canvas: boolean; + /** + * Is file available? + */ + file: boolean; + /** + * Is fileSystem available? + */ + fileSystem: boolean; + /** + * Does the device support the getUserMedia API? + */ + getUserMedia: boolean; + /** + * Is the device big or little endian? (only detected if the browser supports TypedArrays) + */ + littleEndian: boolean; + /** + * Is localStorage available? + */ + localStorage: boolean; + /** + * Is Pointer Lock available? + */ + pointerLock: boolean; + /** + * Does the device context support 32bit pixel manipulation using array buffer views? + */ + support32bit: boolean; + /** + * Does the device support the Vibration API? + */ + vibration: boolean; + /** + * Is webGL available? + */ + webGL: boolean; + /** + * Is worker available? + */ + worker: boolean; + }; + + /** + * Determines the full screen support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.fullscreen` from within any Scene. + */ + type Fullscreen = { + /** + * Does the browser support the Full Screen API? + */ + available: boolean; + /** + * Does the browser support access to the Keyboard during Full Screen mode? + */ + keyboard: boolean; + /** + * If the browser supports the Full Screen API this holds the call you need to use to cancel it. + */ + cancel: string; + /** + * If the browser supports the Full Screen API this holds the call you need to use to activate it. + */ + request: string; + }; + + /** + * Determines the input support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.input` from within any Scene. + */ + type Input = { + /** + * The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll' + */ + wheelType: string; + /** + * Is navigator.getGamepads available? + */ + gamepads: boolean; + /** + * Is mspointer available? + */ + mspointer: boolean; + /** + * Is touch available? + */ + touch: boolean; + }; + + /** + * Determines the operating system of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.os` from within any Scene. + */ + type OS = { + /** + * Is running on android? + */ + android: boolean; + /** + * Is running on chromeOS? + */ + chromeOS: boolean; + /** + * Is the game running under Apache Cordova? + */ + cordova: boolean; + /** + * Is the game running under the Intel Crosswalk XDK? + */ + crosswalk: boolean; + /** + * Is running on a desktop? + */ + desktop: boolean; + /** + * Is the game running under Ejecta? + */ + ejecta: boolean; + /** + * Is the game running under GitHub Electron? + */ + electron: boolean; + /** + * Is running on iOS? + */ + iOS: boolean; + /** + * Is running on iPad? + */ + iPad: boolean; + /** + * Is running on iPhone? + */ + iPhone: boolean; + /** + * Is running on an Amazon Kindle? + */ + kindle: boolean; + /** + * Is running on linux? + */ + linux: boolean; + /** + * Is running on macOS? + */ + macOS: boolean; + /** + * Is the game running under Node.js? + */ + node: boolean; + /** + * Is the game running under Node-Webkit? + */ + nodeWebkit: boolean; + /** + * Set to true if running as a WebApp, i.e. within a WebView + */ + webApp: boolean; + /** + * Is running on windows? + */ + windows: boolean; + /** + * Is running on a Windows Phone? + */ + windowsPhone: boolean; + /** + * If running in iOS this will contain the major version number. + */ + iOSVersion: number; + /** + * PixelRatio of the host device? + */ + pixelRatio: number; + }; + + /** + * Determines the video support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.video` from within any Scene. + */ + type Video = { + /** + * Can this device play h264 mp4 video files? + */ + h264Video: boolean; + /** + * Can this device play hls video files? + */ + hlsVideo: boolean; + /** + * Can this device play h264 mp4 video files? + */ + mp4Video: boolean; + /** + * Can this device play ogg video files? + */ + oggVideo: boolean; + /** + * Can this device play vp9 video files? + */ + vp9Video: boolean; + /** + * Can this device play webm video files? + */ + webmVideo: boolean; + }; + + } + + type DeviceConf = { + /** + * The OS Device functions. + */ + os: Phaser.Device.OS; + /** + * The Browser Device functions. + */ + browser: Phaser.Device.Browser; + /** + * The Features Device functions. + */ + features: Phaser.Device.Features; + /** + * The Input Device functions. + */ + input: Phaser.Device.Input; + /** + * The Audio Device functions. + */ + audio: Phaser.Device.Audio; + /** + * The Video Device functions. + */ + video: Phaser.Device.Video; + /** + * The Fullscreen Device functions. + */ + fullscreen: Phaser.Device.Fullscreen; + /** + * The Canvas Device functions. + */ + canvasFeatures: Phaser.Device.CanvasFeatures; + }; + + namespace Display { + namespace Align { + /** + * A constant representing a top-left alignment or position. + */ + const TOP_LEFT: integer; + + /** + * A constant representing a top-center alignment or position. + */ + const TOP_CENTER: integer; + + /** + * A constant representing a top-right alignment or position. + */ + const TOP_RIGHT: integer; + + /** + * A constant representing a left-top alignment or position. + */ + const LEFT_TOP: integer; + + /** + * A constant representing a left-center alignment or position. + */ + const LEFT_CENTER: integer; + + /** + * A constant representing a left-bottom alignment or position. + */ + const LEFT_BOTTOM: integer; + + /** + * A constant representing a center alignment or position. + */ + const CENTER: integer; + + /** + * A constant representing a right-top alignment or position. + */ + const RIGHT_TOP: integer; + + /** + * A constant representing a right-center alignment or position. + */ + const RIGHT_CENTER: integer; + + /** + * A constant representing a right-bottom alignment or position. + */ + const RIGHT_BOTTOM: integer; + + /** + * A constant representing a bottom-left alignment or position. + */ + const BOTTOM_LEFT: integer; + + /** + * A constant representing a bottom-center alignment or position. + */ + const BOTTOM_CENTER: integer; + + /** + * A constant representing a bottom-right alignment or position. + */ + const BOTTOM_RIGHT: integer; + + namespace In { + /** + * Takes given Game Object and aligns it so that it is positioned in the bottom center of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomCenter(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the bottom left of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomLeft(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the bottom right of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomRight(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the center of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function Center(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the left center of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function LeftCenter(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned relative to the other. + * The alignment used is based on the `position` argument, which is an `ALIGN_CONST` value, such as `LEFT_CENTER` or `TOP_RIGHT`. + * @param child The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param position The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function QuickSet(child: G, alignIn: Phaser.GameObjects.GameObject, position: integer, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the right center of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function RightCenter(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the top center of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopCenter(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the top left of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopLeft(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned in the top right of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignIn The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopRight(gameObject: G, alignIn: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + } + + namespace To { + /** + * Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomCenter(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomLeft(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function BottomRight(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function LeftBottom(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the left center position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function LeftCenter(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the left top position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function LeftTop(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function RightBottom(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the right center position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function RightCenter(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the right top position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function RightTop(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the top center position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopCenter(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the top left position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopLeft(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + /** + * Takes given Game Object and aligns it so that it is positioned next to the top right position of the other. + * @param gameObject The Game Object that will be positioned. + * @param alignTo The Game Object to base the alignment position on. + * @param offsetX Optional horizontal offset from the position. Default 0. + * @param offsetY Optional vertical offset from the position. Default 0. + */ + function TopRight(gameObject: G, alignTo: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number): G; + + } + + } + + namespace Bounds { + /** + * Positions the Game Object so that it is centered on the given coordinates. + * @param gameObject The Game Object that will be re-positioned. + * @param x The horizontal coordinate to position the Game Object on. + * @param y The vertical coordinate to position the Game Object on. + */ + function CenterOn(gameObject: G, x: number, y: number): G; + + /** + * Returns the bottom coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetBottom(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the center x coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetCenterX(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the center y coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetCenterY(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the left coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetLeft(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the amount the Game Object is visually offset from its x coordinate. + * This is the same as `width * origin.x`. + * This value will only be > 0 if `origin.x` is not equal to zero. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetOffsetX(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the amount the Game Object is visually offset from its y coordinate. + * This is the same as `width * origin.y`. + * This value will only be > 0 if `origin.y` is not equal to zero. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetOffsetY(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the right coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetRight(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Returns the top coordinate from the bounds of the Game Object. + * @param gameObject The Game Object to get the bounds value from. + */ + function GetTop(gameObject: Phaser.GameObjects.GameObject): number; + + /** + * Positions the Game Object so that the bottom of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param value The coordinate to position the Game Object bounds on. + */ + function SetBottom(gameObject: G, value: number): G; + + /** + * Positions the Game Object so that the center top of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param x The coordinate to position the Game Object bounds on. + */ + function SetCenterX(gameObject: G, x: number): G; + + /** + * Positions the Game Object so that the center top of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param y The coordinate to position the Game Object bounds on. + */ + function SetCenterY(gameObject: G, y: number): G; + + /** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param value The coordinate to position the Game Object bounds on. + */ + function SetLeft(gameObject: G, value: number): G; + + /** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param value The coordinate to position the Game Object bounds on. + */ + function SetRight(gameObject: G, value: number): G; + + /** + * Positions the Game Object so that the top of its bounds aligns with the given coordinate. + * @param gameObject The Game Object that will be re-positioned. + * @param value The coordinate to position the Game Object bounds on. + */ + function SetTop(gameObject: G, value: number): G; + + } + + namespace Canvas { + namespace CanvasInterpolation { + /** + * Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit). + * @param canvas The canvas object to have the style set on. + */ + function setCrisp(canvas: HTMLCanvasElement): HTMLCanvasElement; + + /** + * Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto'). + * @param canvas The canvas object to have the style set on. + */ + function setBicubic(canvas: HTMLCanvasElement): HTMLCanvasElement; + + } + + /** + * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * which is useless for some of the Phaser pipelines / renderer. + * + * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. + * Which means all instances of Phaser Games on the same page can share the one single pool. + */ + namespace CanvasPool { + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * @param parent The parent of the Canvas object. + * @param width The width of the Canvas. Default 1. + * @param height The height of the Canvas. Default 1. + * @param canvasType The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. Default Phaser.CANVAS. + * @param selfParent Use the generated Canvas element as the parent? Default false. + */ + function create(parent: any, width?: integer, height?: integer, canvasType?: integer, selfParent?: boolean): HTMLCanvasElement; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * @param parent The parent of the Canvas object. + * @param width The width of the Canvas. Default 1. + * @param height The height of the Canvas. Default 1. + */ + function create2D(parent: any, width?: integer, height?: integer): HTMLCanvasElement; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * @param parent The parent of the Canvas object. + * @param width The width of the Canvas. Default 1. + * @param height The height of the Canvas. Default 1. + */ + function createWebGL(parent: any, width?: integer, height?: integer): HTMLCanvasElement; + + /** + * Gets the first free canvas index from the pool. + * @param canvasType The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. Default Phaser.CANVAS. + */ + function first(canvasType?: integer): HTMLCanvasElement; + + /** + * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. + * The canvas has its width and height set to 1, and its parent attribute nulled. + * @param parent The canvas or the parent of the canvas to free. + */ + function remove(parent: any): void; + + /** + * Gets the total number of used canvas elements in the pool. + */ + function total(): integer; + + /** + * Gets the total number of free canvas elements in the pool. + */ + function free(): integer; + + /** + * Disable context smoothing on any new Canvas element created. + */ + function disableSmoothing(): void; + + /** + * Enable context smoothing on any new Canvas element created. + */ + function enableSmoothing(): void; + + } + + namespace Smoothing { + /** + * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. + * @param context The canvas context to check. + */ + function getPrefix(context: CanvasRenderingContext2D | WebGLRenderingContext): string; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * @param context The context on which to enable smoothing. + */ + function enable(context: CanvasRenderingContext2D | WebGLRenderingContext): CanvasRenderingContext2D | WebGLRenderingContext; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * @param context The context on which to disable smoothing. + */ + function disable(context: CanvasRenderingContext2D | WebGLRenderingContext): CanvasRenderingContext2D | WebGLRenderingContext; + + /** + * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. + * Returns null if no smoothing prefix is available. + * @param context The context to check. + */ + function isEnabled(context: CanvasRenderingContext2D | WebGLRenderingContext): boolean; + + } + + /** + * Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions. + * @param canvas The canvas element to have the style applied to. + * @param value The touch action value to set on the canvas. Set to `none` to disable touch actions. Default 'none'. + */ + function TouchAction(canvas: HTMLCanvasElement, value?: string): HTMLCanvasElement; + + /** + * Sets the user-select property on the canvas style. Can be used to disable default browser selection actions. + * @param canvas The canvas element to have the style applied to. + * @param value The touch callout value to set on the canvas. Set to `none` to disable touch callouts. Default 'none'. + */ + function UserSelect(canvas: HTMLCanvasElement, value?: string): HTMLCanvasElement; + + } + + namespace Color { + namespace Interpolate { + /** + * Interpolates between the two given color ranges over the length supplied. + * @param r1 Red value. + * @param g1 Blue value. + * @param b1 Green value. + * @param r2 Red value. + * @param g2 Blue value. + * @param b2 Green value. + * @param length Distance to interpolate over. Default 100. + * @param index Index to start from. Default 0. + */ + function RGBWithRGB(r1: number, g1: number, b1: number, r2: number, g2: number, b2: number, length?: number, index?: number): Phaser.Types.Display.ColorObject; + + /** + * Interpolates between the two given color objects over the length supplied. + * @param color1 The first Color object. + * @param color2 The second Color object. + * @param length Distance to interpolate over. Default 100. + * @param index Index to start from. Default 0. + */ + function ColorWithColor(color1: Phaser.Display.Color, color2: Phaser.Display.Color, length?: number, index?: number): Phaser.Types.Display.ColorObject; + + /** + * Interpolates between the Color object and color values over the length supplied. + * @param color1 The first Color object. + * @param r Red value. + * @param g Blue value. + * @param b Green value. + * @param length Distance to interpolate over. Default 100. + * @param index Index to start from. Default 0. + */ + function ColorWithRGB(color1: Phaser.Display.Color, r: number, g: number, b: number, length?: number, index?: number): Phaser.Types.Display.ColorObject; + + } + + } + + /** + * The Color class holds a single color value and allows for easy modification and reading of it. + */ + class Color { + /** + * + * @param red The red color value. A number between 0 and 255. Default 0. + * @param green The green color value. A number between 0 and 255. Default 0. + * @param blue The blue color value. A number between 0 and 255. Default 0. + * @param alpha The alpha value. A number between 0 and 255. Default 255. + */ + constructor(red?: integer, green?: integer, blue?: integer, alpha?: integer); + + /** + * An array containing the calculated color values for WebGL use. + */ + gl: number[]; + + /** + * Sets this color to be transparent. Sets all values to zero. + */ + transparent(): Phaser.Display.Color; + + /** + * Sets the color of this Color component. + * @param red The red color value. A number between 0 and 255. + * @param green The green color value. A number between 0 and 255. + * @param blue The blue color value. A number between 0 and 255. + * @param alpha The alpha value. A number between 0 and 255. Default 255. + * @param updateHSV Update the HSV values after setting the RGB values? Default true. + */ + setTo(red: integer, green: integer, blue: integer, alpha?: integer, updateHSV?: boolean): Phaser.Display.Color; + + /** + * Sets the red, green, blue and alpha GL values of this Color component. + * @param red The red color value. A number between 0 and 1. + * @param green The green color value. A number between 0 and 1. + * @param blue The blue color value. A number between 0 and 1. + * @param alpha The alpha value. A number between 0 and 1. Default 1. + */ + setGLTo(red: number, green: number, blue: number, alpha?: number): Phaser.Display.Color; + + /** + * Sets the color based on the color object given. + * @param color An object containing `r`, `g`, `b` and optionally `a` values in the range 0 to 255. + */ + setFromRGB(color: Phaser.Types.Display.InputColorObject): Phaser.Display.Color; + + /** + * Sets the color based on the hue, saturation and lightness values given. + * @param h The hue, in the range 0 - 1. This is the base color. + * @param s The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. + * @param v The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black. + */ + setFromHSV(h: number, s: number, v: number): Phaser.Display.Color; + + /** + * Returns a new Color component using the values from this one. + */ + clone(): Phaser.Display.Color; + + /** + * Sets this Color object to be grayscaled based on the shade value given. + * @param shade A value between 0 and 255. + */ + gray(shade: integer): Phaser.Display.Color; + + /** + * Sets this Color object to be a random color between the `min` and `max` values given. + * @param min The minimum random color value. Between 0 and 255. Default 0. + * @param max The maximum random color value. Between 0 and 255. Default 255. + */ + random(min?: integer, max?: integer): Phaser.Display.Color; + + /** + * Sets this Color object to be a random grayscale color between the `min` and `max` values given. + * @param min The minimum random color value. Between 0 and 255. Default 0. + * @param max The maximum random color value. Between 0 and 255. Default 255. + */ + randomGray(min?: integer, max?: integer): Phaser.Display.Color; + + /** + * Increase the saturation of this Color by the percentage amount given. + * The saturation is the amount of the base color in the hue. + * @param amount The percentage amount to change this color by. A value between 0 and 100. + */ + saturate(amount: integer): Phaser.Display.Color; + + /** + * Decrease the saturation of this Color by the percentage amount given. + * The saturation is the amount of the base color in the hue. + * @param amount The percentage amount to change this color by. A value between 0 and 100. + */ + desaturate(amount: integer): Phaser.Display.Color; + + /** + * Increase the lightness of this Color by the percentage amount given. + * @param amount The percentage amount to change this color by. A value between 0 and 100. + */ + lighten(amount: integer): Phaser.Display.Color; + + /** + * Decrease the lightness of this Color by the percentage amount given. + * @param amount The percentage amount to change this color by. A value between 0 and 100. + */ + darken(amount: integer): Phaser.Display.Color; + + /** + * Brighten this Color by the percentage amount given. + * @param amount The percentage amount to change this color by. A value between 0 and 100. + */ + brighten(amount: integer): Phaser.Display.Color; + + /** + * The color of this Color component, not including the alpha channel. + */ + readonly color: number; + + /** + * The color of this Color component, including the alpha channel. + */ + readonly color32: number; + + /** + * The color of this Color component as a string which can be used in CSS color values. + */ + readonly rgba: string; + + /** + * The red color value, normalized to the range 0 to 1. + */ + redGL: number; + + /** + * The green color value, normalized to the range 0 to 1. + */ + greenGL: number; + + /** + * The blue color value, normalized to the range 0 to 1. + */ + blueGL: number; + + /** + * The alpha color value, normalized to the range 0 to 1. + */ + alphaGL: number; + + /** + * The red color value, normalized to the range 0 to 255. + */ + red: number; + + /** + * The green color value, normalized to the range 0 to 255. + */ + green: number; + + /** + * The blue color value, normalized to the range 0 to 255. + */ + blue: number; + + /** + * The alpha color value, normalized to the range 0 to 255. + */ + alpha: number; + + /** + * The hue color value. A number between 0 and 1. + * This is the base color. + */ + h: number; + + /** + * The saturation color value. A number between 0 and 1. + * This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. + */ + s: number; + + /** + * The lightness color value. A number between 0 and 1. + * This controls how dark the color is. Where 1 is as bright as possible and 0 is black. + */ + v: number; + + /** + * Converts the given color value into an Object containing r,g,b and a properties. + * @param color A color value, optionally including the alpha value. + */ + static ColorToRGBA(color: number): Phaser.Types.Display.ColorObject; + + /** + * Returns a string containing a hex representation of the given color component. + * @param color The color channel to get the hex value for, must be a value between 0 and 255. + */ + static ComponentToHex(color: integer): string; + + /** + * Given 3 separate color values this will return an integer representation of it. + * @param red The red color value. A number between 0 and 255. + * @param green The green color value. A number between 0 and 255. + * @param blue The blue color value. A number between 0 and 255. + */ + static GetColor(red: integer, green: integer, blue: integer): number; + + /** + * Given an alpha and 3 color values this will return an integer representation of it. + * @param red The red color value. A number between 0 and 255. + * @param green The green color value. A number between 0 and 255. + * @param blue The blue color value. A number between 0 and 255. + * @param alpha The alpha color value. A number between 0 and 255. + */ + static GetColor32(red: integer, green: integer, blue: integer, alpha: integer): number; + + /** + * Converts a hex string into a Phaser Color object. + * + * The hex string can supplied as `'#0033ff'` or the short-hand format of `'#03f'`; it can begin with an optional "#" or "0x", or be unprefixed. + * + * An alpha channel is _not_ supported. + * @param hex The hex color value to convert, such as `#0033ff` or the short-hand format: `#03f`. + */ + static HexStringToColor(hex: string): Phaser.Display.Color; + + /** + * Converts HSL (hue, saturation and lightness) values to a Phaser Color object. + * @param h The hue value in the range 0 to 1. + * @param s The saturation value in the range 0 to 1. + * @param l The lightness value in the range 0 to 1. + */ + static HSLToColor(h: number, s: number, l: number): Phaser.Display.Color; + + /** + * Get HSV color wheel values in an array which will be 360 elements in size. + * @param s The saturation, in the range 0 - 1. Default 1. + * @param v The value, in the range 0 - 1. Default 1. + */ + static HSVColorWheel(s?: number, v?: number): Phaser.Types.Display.ColorObject[]; + + /** + * Converts an HSV (hue, saturation and value) color value to RGB. + * Conversion formula from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes HSV values are contained in the set [0, 1]. + * Based on code by Michael Jackson (https://github.com/mjijackson) + * @param h The hue, in the range 0 - 1. This is the base color. + * @param s The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. + * @param v The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black. + * @param out A Color object to store the results in. If not given a new ColorObject will be created. + */ + static HSVToRGB(h: number, s: number, v: number, out?: Phaser.Types.Display.ColorObject | Phaser.Display.Color): Phaser.Types.Display.ColorObject | Phaser.Display.Color; + + /** + * Converts a hue to an RGB color. + * Based on code by Michael Jackson (https://github.com/mjijackson) + */ + static HueToComponent(p: number, q: number, t: number): number; + + /** + * Converts the given color value into an instance of a Color object. + * @param input The color value to convert into a Color object. + */ + static IntegerToColor(input: integer): Phaser.Display.Color; + + /** + * Return the component parts of a color as an Object with the properties alpha, red, green, blue. + * + * Alpha will only be set if it exists in the given color (0xAARRGGBB) + * @param input The color value to convert into a Color object. + */ + static IntegerToRGB(input: integer): Phaser.Types.Display.ColorObject; + + /** + * Converts an object containing `r`, `g`, `b` and `a` properties into a Color class instance. + * @param input An object containing `r`, `g`, `b` and `a` properties in the range 0 to 255. + */ + static ObjectToColor(input: Phaser.Types.Display.InputColorObject): Phaser.Display.Color; + + /** + * Creates a new Color object where the r, g, and b values have been set to random values + * based on the given min max values. + * @param min The minimum value to set the random range from (between 0 and 255) Default 0. + * @param max The maximum value to set the random range from (between 0 and 255) Default 255. + */ + static RandomRGB(min?: integer, max?: integer): Phaser.Display.Color; + + /** + * Converts a CSS 'web' string into a Phaser Color object. + * + * The web string can be in the format `'rgb(r,g,b)'` or `'rgba(r,g,b,a)'` where r/g/b are in the range [0..255] and a is in the range [0..1]. + * @param rgb The CSS format color string, using the `rgb` or `rgba` format. + */ + static RGBStringToColor(rgb: string): Phaser.Display.Color; + + /** + * Converts an RGB color value to HSV (hue, saturation and value). + * Conversion forumla from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes RGB values are contained in the set [0, 255] and returns h, s and v in the set [0, 1]. + * Based on code by Michael Jackson (https://github.com/mjijackson) + * @param r The red color value. A number between 0 and 255. + * @param g The green color value. A number between 0 and 255. + * @param b The blue color value. A number between 0 and 255. + * @param out An object to store the color values in. If not given an HSV Color Object will be created. + */ + static RGBToHSV(r: integer, g: integer, b: integer, out?: Phaser.Types.Display.HSVColorObject | Phaser.Display.Color): Phaser.Types.Display.HSVColorObject | Phaser.Display.Color; + + /** + * Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`. + * @param r The red color value. A number between 0 and 255. + * @param g The green color value. A number between 0 and 255. + * @param b The blue color value. A number between 0 and 255. + * @param a The alpha value. A number between 0 and 255. Default 255. + * @param prefix The prefix of the string. Either `#` or `0x`. Default #. + */ + static RGBToString(r: integer, g: integer, b: integer, a?: integer, prefix?: string): string; + + /** + * Converts the given source color value into an instance of a Color class. + * The value can be either a string, prefixed with `rgb` or a hex string, a number or an Object. + * @param input The source color value to convert. + */ + static ValueToColor(input: string | number | Phaser.Types.Display.InputColorObject): Phaser.Display.Color; + + } + + namespace Masks { + /** + * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. + * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, + * not a clipping path. It is only available when using the WebGL Renderer. + * + * A Bitmap Mask can use any Game Object to determine the alpha of each pixel of the masked Game Object(s). + * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha + * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the + * Bitmap Mask doesn't matter. + * + * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an + * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * corresponding pixel in the mask. + * + * The Bitmap Mask's location matches the location of its Game Object, not the location of the + * masked objects. Moving or transforming the underlying Game Object will change the mask + * (and affect the visibility of any masked objects), whereas moving or transforming a masked object + * will not affect the mask. + * + * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a + * Scene's display list, it will only be used for the mask and its full texture will not be directly + * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will + * render as a normal Game Object and will also serve as a mask. + */ + class BitmapMask { + /** + * + * @param scene The Scene which this Bitmap Mask will be used in. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + constructor(scene: Phaser.Scene, renderable: Phaser.GameObjects.GameObject); + + /** + * A reference to either the Canvas or WebGL Renderer that this Mask is using. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * A renderable Game Object that uses a texture, such as a Sprite. + */ + bitmapMask: Phaser.GameObjects.GameObject; + + /** + * The texture used for the mask's framebuffer. + */ + maskTexture: WebGLTexture; + + /** + * The texture used for the main framebuffer. + */ + mainTexture: WebGLTexture; + + /** + * Whether the Bitmap Mask is dirty and needs to be updated. + */ + dirty: boolean; + + /** + * The framebuffer to which a masked Game Object is rendered. + */ + mainFramebuffer: WebGLFramebuffer; + + /** + * The framebuffer to which the Bitmap Mask's masking Game Object is rendered. + */ + maskFramebuffer: WebGLFramebuffer; + + /** + * The previous framebuffer set in the renderer before this one was enabled. + */ + prevFramebuffer: WebGLFramebuffer; + + /** + * Whether to invert the masks alpha. + * + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + */ + invertAlpha: boolean; + + /** + * Is this mask a stencil mask? + */ + readonly isStencil: boolean; + + /** + * Sets a new masking Game Object for the Bitmap Mask. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + setBitmap(renderable: Phaser.GameObjects.GameObject): void; + + /** + * Prepares the WebGL Renderer to render a Game Object with this mask applied. + * + * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame. + * @param renderer The WebGL Renderer to prepare. + * @param maskedObject The masked Game Object which will be drawn. + * @param camera The Camera to render to. + */ + preRenderWebGL(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer, maskedObject: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Finalizes rendering of a masked Game Object. + * + * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect. + * @param renderer The WebGL Renderer to clean up. + */ + postRenderWebGL(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer): void; + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * @param renderer The Canvas Renderer which would be rendered to. + * @param mask The masked Game Object which would be rendered. + * @param camera The Camera to render to. + */ + preRenderCanvas(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer, mask: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * @param renderer The Canvas Renderer which would be rendered to. + */ + postRenderCanvas(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer): void; + + /** + * Destroys this BitmapMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + */ + destroy(): void; + + } + + /** + * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect + * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only + * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * + * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) + * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed + * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and + * alpha of the pixel from the Geometry Mask do not matter. + * + * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. + * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility + * of any masked objects), whereas moving or transforming a masked object will not affect the mask. + * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed + * in front of all masked objects which has its own visual properties and, naturally, respects the camera's + * visual properties, but isn't affected by and doesn't follow the masked objects by itself. + */ + class GeometryMask { + /** + * + * @param scene This parameter is not used. + * @param graphicsGeometry The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. + */ + constructor(scene: Phaser.Scene, graphicsGeometry: Phaser.GameObjects.Graphics); + + /** + * The Graphics object which describes the Geometry Mask. + */ + geometryMask: Phaser.GameObjects.Graphics; + + /** + * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels + * drawn to the Geometry Mask. + */ + invertAlpha: boolean; + + /** + * Is this mask a stencil mask? + */ + readonly isStencil: boolean; + + /** + * Sets a new Graphics object for the Geometry Mask. + * @param graphicsGeometry The Graphics object which will be used for the Geometry Mask. + */ + setShape(graphicsGeometry: Phaser.GameObjects.Graphics): this; + + /** + * Sets the `invertAlpha` property of this Geometry Mask. + * Inverting the alpha essentially flips the way the mask works. + * @param value Invert the alpha of this mask? Default true. + */ + setInvertAlpha(value?: boolean): this; + + /** + * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. + * @param renderer The WebGL Renderer instance to draw to. + * @param child The Game Object being rendered. + * @param camera The camera the Game Object is being rendered through. + */ + preRenderWebGL(renderer: Phaser.Renderer.WebGL.WebGLRenderer, child: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Applies the current stencil mask to the renderer. + * @param renderer The WebGL Renderer instance to draw to. + * @param camera The camera the Game Object is being rendered through. + * @param inc Is this an INCR stencil or a DECR stencil? + */ + applyStencil(renderer: Phaser.Renderer.WebGL.WebGLRenderer, camera: Phaser.Cameras.Scene2D.Camera, inc: boolean): void; + + /** + * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. + * @param renderer The WebGL Renderer instance to draw flush. + */ + postRenderWebGL(renderer: Phaser.Renderer.WebGL.WebGLRenderer): void; + + /** + * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. + * @param renderer The Canvas Renderer instance to set the clipping path on. + * @param mask The Game Object being rendered. + * @param camera The camera the Game Object is being rendered through. + */ + preRenderCanvas(renderer: Phaser.Renderer.Canvas.CanvasRenderer, mask: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Restore the canvas context's previous clipping path, thus turning off the mask for it. + * @param renderer The Canvas Renderer instance being restored. + */ + postRenderCanvas(renderer: Phaser.Renderer.Canvas.CanvasRenderer): void; + + /** + * Destroys this GeometryMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + */ + destroy(): void; + + } + + } + + /** + * A BaseShader is a small resource class that contains the data required for a WebGL Shader to be created. + * + * It contains the raw source code to the fragment and vertex shader, as well as an object that defines + * the uniforms the shader requires, if any. + * + * BaseShaders are stored in the Shader Cache, available in a Scene via `this.cache.shaders` and are referenced + * by a unique key-based string. Retrieve them via `this.cache.shaders.get(key)`. + * + * BaseShaders are created automatically by the GLSL File Loader when loading an external shader resource. + * They can also be created at runtime, allowing you to use dynamically generated shader source code. + * + * Default fragment and vertex source is used if not provided in the constructor, setting-up a basic shader, + * suitable for debug rendering. + */ + class BaseShader { + /** + * + * @param key The key of this shader. Must be unique within the shader cache. + * @param fragmentSrc The fragment source for the shader. + * @param vertexSrc The vertex source for the shader. + * @param uniforms Optional object defining the uniforms the shader uses. + */ + constructor(key: string, fragmentSrc?: string, vertexSrc?: string, uniforms?: any); + + /** + * The key of this shader, unique within the shader cache of this Phaser game instance. + */ + key: string; + + /** + * The source code, as a string, of the fragment shader being used. + */ + fragmentSrc: string; + + /** + * The source code, as a string, of the vertex shader being used. + */ + vertexSrc: string; + + /** + * The default uniforms for this shader. + */ + uniforms: any; + + } + + } + + namespace DOM { + /** + * Adds the given element to the DOM. If a parent is provided the element is added as a child of the parent, providing it was able to access it. + * If no parent was given it falls back to using `document.body`. + * @param element The element to be added to the DOM. Usually a Canvas object. + * @param parent The parent in which to add the element. Can be a string which is passed to `getElementById` or an actual DOM object. + */ + function AddToDOM(element: HTMLElement, parent?: string | HTMLElement): HTMLElement; + + /** + * Inspects the readyState of the document. If the document is already complete then it invokes the given callback. + * If not complete it sets up several event listeners such as `deviceready`, and once those fire, it invokes the callback. + * Called automatically by the Phaser.Game instance. Should not usually be accessed directly. + * @param callback The callback to be invoked when the device is ready and the DOM content is loaded. + */ + function DOMContentLoaded(callback: ContentLoadedCallback): void; + + /** + * Attempts to determine the document inner height across iOS and standard devices. + * Based on code by @tylerjpeterson + * @param iOS Is this running on iOS? + */ + function GetInnerHeight(iOS: boolean): number; + + /** + * Attempts to determine the screen orientation using the Orientation API. + * @param width The width of the viewport. + * @param height The height of the viewport. + */ + function GetScreenOrientation(width: number, height: number): string; + + /** + * Attempts to get the target DOM element based on the given value, which can be either + * a string, in which case it will be looked-up by ID, or an element node. If nothing + * can be found it will return a reference to the document.body. + * @param element The DOM element to look-up. + */ + function GetTarget(element: HTMLElement): void; + + /** + * Takes the given data string and parses it as XML. + * First tries to use the window.DOMParser and reverts to the Microsoft.XMLDOM if that fails. + * The parsed XML object is returned, or `null` if there was an error while parsing the data. + * @param data The XML source stored in a string. + */ + function ParseXML(data: string): DOMParser | ActiveXObject; + + /** + * Attempts to remove the element from its parentNode in the DOM. + * @param element The DOM element to remove from its parent node. + */ + function RemoveFromDOM(element: HTMLElement): void; + + /** + * Abstracts away the use of RAF or setTimeOut for the core game update loop. + * This is invoked automatically by the Phaser.Game instance. + */ + class RequestAnimationFrame { + /** + * True if RequestAnimationFrame is running, otherwise false. + */ + isRunning: boolean; + + /** + * The callback to be invoked each step. + */ + callback: FrameRequestCallback; + + /** + * The most recent timestamp. Either a DOMHighResTimeStamp under RAF or `Date.now` under SetTimeout. + */ + tick: number; + + /** + * True if the step is using setTimeout instead of RAF. + */ + isSetTimeOut: boolean; + + /** + * The setTimeout or RAF callback ID used when canceling them. + */ + timeOutID: number; + + /** + * The previous time the step was called. + */ + lastTime: number; + + /** + * The RAF step function. + * Updates the local tick value, invokes the callback and schedules another call to requestAnimationFrame. + */ + step: FrameRequestCallback; + + /** + * The SetTimeout step function. + * Updates the local tick value, invokes the callback and schedules another call to setTimeout. + */ + stepTimeout: Function; + + /** + * Starts the requestAnimationFrame or setTimeout process running. + * @param callback The callback to invoke each step. + * @param forceSetTimeOut Should it use SetTimeout, even if RAF is available? + */ + start(callback: FrameRequestCallback, forceSetTimeOut: boolean): void; + + /** + * Stops the requestAnimationFrame or setTimeout from running. + */ + stop(): void; + + /** + * Stops the step from running and clears the callback reference. + */ + destroy(): void; + + } + + } + + namespace Events { + /** + * EventEmitter is a Scene Systems plugin compatible version of eventemitter3. + */ + class EventEmitter { + /** + * Removes all listeners. + */ + shutdown(): void; + + /** + * Removes all listeners. + */ + destroy(): void; + + /** + * Return an array listing the events for which the emitter has registered listeners. + */ + eventNames(): any[]; + + /** + * Return the listeners registered for a given event. + * @param event The event name. + */ + listeners(event: string | symbol): any[]; + + /** + * Return the number of listeners listening to a given event. + * @param event The event name. + */ + listenerCount(event: string | symbol): number; + + /** + * Calls each of the listeners registered for a given event. + * @param event The event name. + * @param args Additional arguments that will be passed to the event handler. + */ + emit(event: string | symbol, ...args: any[]): boolean; + + /** + * Add a listener for a given event. + * @param event The event name. + * @param fn The listener function. + * @param context The context to invoke the listener with. Default this. + */ + on(event: string | symbol, fn: Function, context?: any): Phaser.Events.EventEmitter; + + /** + * Add a listener for a given event. + * @param event The event name. + * @param fn The listener function. + * @param context The context to invoke the listener with. Default this. + */ + addListener(event: string | symbol, fn: Function, context?: any): Phaser.Events.EventEmitter; + + /** + * Add a one-time listener for a given event. + * @param event The event name. + * @param fn The listener function. + * @param context The context to invoke the listener with. Default this. + */ + once(event: string | symbol, fn: Function, context?: any): Phaser.Events.EventEmitter; + + /** + * Remove the listeners of a given event. + * @param event The event name. + * @param fn Only remove the listeners that match this function. + * @param context Only remove the listeners that have this context. + * @param once Only remove one-time listeners. + */ + removeListener(event: string | symbol, fn?: Function, context?: any, once?: boolean): Phaser.Events.EventEmitter; + + /** + * Remove the listeners of a given event. + * @param event The event name. + * @param fn Only remove the listeners that match this function. + * @param context Only remove the listeners that have this context. + * @param once Only remove one-time listeners. + */ + off(event: string | symbol, fn?: Function, context?: any, once?: boolean): Phaser.Events.EventEmitter; + + /** + * Remove all listeners, or those of the specified event. + * @param event The event name. + */ + removeAllListeners(event?: string | symbol): Phaser.Events.EventEmitter; + + } + + } + + /** + * Phaser Blend Modes to CSS Blend Modes Map. + */ + enum CSSBlendModes { + } + + namespace GameObjects { + /** + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * Dynamic Bitmap Text objects are different from Static Bitmap Text in that they invoke a callback for each + * letter being rendered during the render pass. This callback allows you to manipulate the properties of + * each letter being rendered, such as its position, scale or tint, allowing you to create interesting effects + * like jiggling text, which can't be done with Static text. This means that Dynamic Text takes more processing + * time, so only use them if you require the callback ability they have. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + */ + class DynamicBitmapText extends Phaser.GameObjects.BitmapText { + /** + * + * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. + * @param x The x coordinate of this Game Object in world space. + * @param y The y coordinate of this Game Object in world space. + * @param font The key of the font to use from the Bitmap Font cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size of this Bitmap Text. + * @param align The alignment of the text in a multi-line BitmapText object. Default 0. + */ + constructor(scene: Phaser.Scene, x: number, y: number, font: string, text?: string | string[], size?: number, align?: integer); + + /** + * The horizontal scroll position of the Bitmap Text. + */ + scrollX: number; + + /** + * The vertical scroll position of the Bitmap Text. + */ + scrollY: number; + + /** + * The crop width of the Bitmap Text. + */ + cropWidth: number; + + /** + * The crop height of the Bitmap Text. + */ + cropHeight: number; + + /** + * A callback that alters how each character of the Bitmap Text is rendered. + */ + displayCallback: Phaser.Types.GameObjects.BitmapText.DisplayCallback; + + /** + * The data object that is populated during rendering, then passed to the displayCallback. + * You should modify this object then return it back from the callback. It's updated values + * will be used to render the specific glyph. + * + * Please note that if you need a reference to this object locally in your game code then you + * should shallow copy it, as it's updated and re-used for every glyph in the text. + */ + callbackData: Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig; + + /** + * Set the crop size of this Bitmap Text. + * @param width The width of the crop. + * @param height The height of the crop. + */ + setSize(width: number, height: number): Phaser.GameObjects.DynamicBitmapText; + + /** + * Set a callback that alters how each character of the Bitmap Text is rendered. + * + * The callback receives a {@link Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig} object that contains information about the character that's + * about to be rendered. + * + * It should return an object with `x`, `y`, `scale` and `rotation` properties that will be used instead of the + * usual values when rendering. + * @param callback The display callback to set. + */ + setDisplayCallback(callback: Phaser.Types.GameObjects.BitmapText.DisplayCallback): Phaser.GameObjects.DynamicBitmapText; + + /** + * Set the horizontal scroll position of this Bitmap Text. + * @param value The horizontal scroll position to set. + */ + setScrollX(value: number): Phaser.GameObjects.DynamicBitmapText; + + /** + * Set the vertical scroll position of this Bitmap Text. + * @param value The vertical scroll position to set. + */ + setScrollY(value: number): Phaser.GameObjects.DynamicBitmapText; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + namespace RetroFont { + /** + * Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ + */ + var TEXT_SET1: string; + + /** + * Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ + */ + var TEXT_SET2: string; + + /** + * Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 + */ + var TEXT_SET3: string; + + /** + * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 + */ + var TEXT_SET4: string; + + /** + * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 + */ + var TEXT_SET5: string; + + /** + * Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.' + */ + var TEXT_SET6: string; + + /** + * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39 + */ + var TEXT_SET7: string; + + /** + * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ + */ + var TEXT_SET8: string; + + /** + * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?! + */ + var TEXT_SET9: string; + + /** + * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ + */ + var TEXT_SET10: string; + + /** + * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789 + */ + var TEXT_SET11: string; + + /** + * Parses a Retro Font configuration object so you can pass it to the BitmapText constructor + * and create a BitmapText object using a fixed-width retro font. + * @param scene A reference to the Phaser Scene. + * @param config The font configuration object. + */ + function Parse(scene: Phaser.Scene, config: Phaser.Types.GameObjects.BitmapText.RetroFontConfig): object; + + } + + /** + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} + * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} + * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} + */ + class BitmapText extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. + * @param x The x coordinate of this Game Object in world space. + * @param y The y coordinate of this Game Object in world space. + * @param font The key of the font to use from the Bitmap Font cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size of this Bitmap Text. + * @param align The alignment of the text in a multi-line BitmapText object. Default 0. + */ + constructor(scene: Phaser.Scene, x: number, y: number, font: string, text?: string | string[], size?: number, align?: integer); + + /** + * The key of the Bitmap Font used by this Bitmap Text. + * To change the font after creation please use `setFont`. + */ + readonly font: string; + + /** + * The data of the Bitmap Font used by this Bitmap Text. + */ + readonly fontData: Phaser.Types.GameObjects.BitmapText.BitmapFontData; + + /** + * Set the lines of text in this BitmapText to be left-aligned. + * This only has any effect if this BitmapText contains more than one line of text. + */ + setLeftAlign(): this; + + /** + * Set the lines of text in this BitmapText to be center-aligned. + * This only has any effect if this BitmapText contains more than one line of text. + */ + setCenterAlign(): this; + + /** + * Set the lines of text in this BitmapText to be right-aligned. + * This only has any effect if this BitmapText contains more than one line of text. + */ + setRightAlign(): this; + + /** + * Set the font size of this Bitmap Text. + * @param size The font size to set. + */ + setFontSize(size: number): this; + + /** + * Sets the letter spacing between each character of this Bitmap Text. + * Can be a positive value to increase the space, or negative to reduce it. + * Spacing is applied after the kerning values have been set. + * @param spacing The amount of horizontal space to add between each character. Default 0. + */ + setLetterSpacing(spacing?: number): this; + + /** + * Set the textual content of this BitmapText. + * + * An array of strings will be converted into multi-line text. Use the align methods to change multi-line alignment. + * @param value The string, or array of strings, to be set as the content of this BitmapText. + */ + setText(value: string | string[]): this; + + /** + * Calculate the bounds of this Bitmap Text. + * + * An object is returned that contains the position, width and height of the Bitmap Text in local and global + * contexts. + * + * Local size is based on just the font size and a [0, 0] position. + * + * Global size takes into account the Game Object's scale, world position and display origin. + * + * Also in the object is data regarding the length of each line, should this be a multi-line BitmapText. + * @param round Whether to round the results to the nearest integer. + */ + getTextBounds(round?: boolean): Phaser.Types.GameObjects.BitmapText.BitmapTextSize; + + /** + * Changes the font this BitmapText is using to render. + * + * The new texture is loaded and applied to the BitmapText. The existing test, size and alignment are preserved, + * unless overridden via the arguments. + * @param font The key of the font to use from the Bitmap Font cache. + * @param size The font size of this Bitmap Text. If not specified the current size will be used. + * @param align The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used. Default 0. + */ + setFont(font: string, size?: number, align?: integer): this; + + /** + * Controls the alignment of each line of text in this BitmapText object. + * + * Only has any effect when this BitmapText contains multiple lines of text, split with carriage-returns. + * Has no effect with single-lines of text. + * + * See the methods `setLeftAlign`, `setCenterAlign` and `setRightAlign`. + * + * 0 = Left aligned (default) + * 1 = Middle aligned + * 2 = Right aligned + * + * The alignment position is based on the longest line of text. + */ + align: integer; + + /** + * The text that this Bitmap Text object displays. + * + * You can also use the method `setText` if you want a chainable way to change the text content. + */ + text: string; + + /** + * The font size of this Bitmap Text. + * + * You can also use the method `setFontSize` if you want a chainable way to change the font size. + */ + fontSize: number; + + /** + * Adds / Removes spacing between characters. + * + * Can be a negative or positive number. + * + * You can also use the method `setLetterSpacing` if you want a chainable way to change the letter spacing. + */ + letterSpacing: number; + + /** + * The width of this Bitmap Text. + */ + readonly width: number; + + /** + * The height of this bitmap text. + */ + readonly height: number; + + /** + * Build a JSON representation of this Bitmap Text. + */ + toJSON(): Phaser.Types.GameObjects.BitmapText.JSONBitmapText; + + /** + * Left align the text characters in a multi-line BitmapText object. + */ + static ALIGN_LEFT: integer; + + /** + * Center align the text characters in a multi-line BitmapText object. + */ + static ALIGN_CENTER: integer; + + /** + * Right align the text characters in a multi-line BitmapText object. + */ + static ALIGN_RIGHT: integer; + + /** + * Parse an XML Bitmap Font from an Atlas. + * + * Adds the parsed Bitmap Font data to the cache with the `fontName` key. + */ + static ParseFromAtlas: Function; + + /** + * Parse an XML font to Bitmap Font data for the Bitmap Font cache. + */ + static ParseXMLBitmapFont: Function; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Blitter Game Object. + * + * The Blitter Game Object is a special kind of container that creates, updates and manages Bob objects. + * Bobs are designed for rendering speed rather than flexibility. They consist of a texture, or frame from a texture, + * a position and an alpha value. You cannot scale or rotate them. They use a batched drawing method for speed + * during rendering. + * + * A Blitter Game Object has one texture bound to it. Bobs created by the Blitter can use any Frame from this + * Texture to render with, but they cannot use any other Texture. It is this single texture-bind that allows + * them their speed. + * + * If you have a need to blast a large volume of frames around the screen then Blitter objects are well worth + * investigating. They are especially useful for using as a base for your own special effects systems. + */ + class Blitter extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. + * @param x The x coordinate of this Game Object in world space. Default 0. + * @param y The y coordinate of this Game Object in world space. Default 0. + * @param texture The key of the texture this Game Object will use for rendering. The Texture must already exist in the Texture Manager. Default '__DEFAULT'. + * @param frame The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. Default 0. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, texture?: string, frame?: string | integer); + + /** + * The children of this Blitter. + * This List contains all of the Bob objects created by the Blitter. + */ + children: Phaser.Structs.List; + + /** + * Is the Blitter considered dirty? + * A 'dirty' Blitter has had its child count changed since the last frame. + */ + dirty: boolean; + + /** + * Creates a new Bob in this Blitter. + * + * The Bob is created at the given coordinates, relative to the Blitter and uses the given frame. + * A Bob can use any frame belonging to the texture bound to the Blitter. + * @param x The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param y The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param frame The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * @param visible Should the created Bob render or not? Default true. + * @param index The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. + */ + create(x: number, y: number, frame?: string | integer | Phaser.Textures.Frame, visible?: boolean, index?: integer): Phaser.GameObjects.Bob; + + /** + * Creates multiple Bob objects within this Blitter and then passes each of them to the specified callback. + * @param callback The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob. + * @param quantity The quantity of Bob objects to create. + * @param frame The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param visible Should the created Bob render or not? Default true. + */ + createFromCallback(callback: CreateCallback, quantity: integer, frame?: string | integer | Phaser.Textures.Frame | string[] | integer[] | Phaser.Textures.Frame[], visible?: boolean): Phaser.GameObjects.Bob[]; + + /** + * Creates multiple Bobs in one call. + * + * The amount created is controlled by a combination of the `quantity` argument and the number of frames provided. + * + * If the quantity is set to 10 and you provide 2 frames, then 20 Bobs will be created. 10 with the first + * frame and 10 with the second. + * @param quantity The quantity of Bob objects to create. + * @param frame The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param visible Should the created Bob render or not? Default true. + */ + createMultiple(quantity: integer, frame?: string | integer | Phaser.Textures.Frame | string[] | integer[] | Phaser.Textures.Frame[], visible?: boolean): Phaser.GameObjects.Bob[]; + + /** + * Checks if the given child can render or not, by checking its `visible` and `alpha` values. + * @param child The Bob to check for rendering. + */ + childCanRender(child: Phaser.GameObjects.Bob): boolean; + + /** + * Returns an array of Bobs to be rendered. + * If the Blitter is dirty then a new list is generated and stored in `renderList`. + */ + getRenderList(): Phaser.GameObjects.Bob[]; + + /** + * Removes all Bobs from the children List and clears the dirty flag. + */ + clear(): void; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Bob Game Object. + * + * A Bob belongs to a Blitter Game Object. The Blitter is responsible for managing and rendering this object. + * + * A Bob has a position, alpha value and a frame from a texture that it uses to render with. You can also toggle + * the flipped and visible state of the Bob. The Frame the Bob uses to render can be changed dynamically, but it + * must be a Frame within the Texture used by the parent Blitter. + * + * Bob positions are relative to the Blitter parent. So if you move the Blitter parent, all Bob children will + * have their positions impacted by this change as well. + * + * You can manipulate Bob objects directly from your game code, but the creation and destruction of them should be + * handled via the Blitter parent. + */ + class Bob { + /** + * + * @param blitter The parent Blitter object is responsible for updating this Bob. + * @param x The horizontal position of this Game Object in the world, relative to the parent Blitter position. + * @param y The vertical position of this Game Object in the world, relative to the parent Blitter position. + * @param frame The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. + * @param visible Should the Bob render visible or not to start with? + */ + constructor(blitter: Phaser.GameObjects.Blitter, x: number, y: number, frame: string | integer, visible: boolean); + + /** + * The Blitter object that this Bob belongs to. + */ + parent: Phaser.GameObjects.Blitter; + + /** + * The x position of this Bob, relative to the x position of the Blitter. + */ + x: number; + + /** + * The y position of this Bob, relative to the y position of the Blitter. + */ + y: number; + + /** + * The frame that the Bob uses to render with. + * To change the frame use the `Bob.setFrame` method. + */ + protected frame: Phaser.Textures.Frame; + + /** + * A blank object which can be used to store data related to this Bob in. + */ + data: object; + + /** + * The horizontally flipped state of the Bob. + * A Bob that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Bob. + * A Bob that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture. + */ + flipY: boolean; + + /** + * Changes the Texture Frame being used by this Bob. + * The frame must be part of the Texture the parent Blitter is using. + * If no value is given it will use the default frame of the Blitter parent. + * @param frame The frame to be used during rendering. + */ + setFrame(frame?: string | integer | Phaser.Textures.Frame): Phaser.GameObjects.Bob; + + /** + * Resets the horizontal and vertical flipped state of this Bob back to their default un-flipped state. + */ + resetFlip(): Phaser.GameObjects.Bob; + + /** + * Resets this Bob. + * + * Changes the position to the values given, and optionally changes the frame. + * + * Also resets the flipX and flipY values, sets alpha back to 1 and visible to true. + * @param x The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param y The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param frame The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + */ + reset(x: number, y: number, frame?: string | integer | Phaser.Textures.Frame): Phaser.GameObjects.Bob; + + /** + * Sets the horizontal flipped state of this Bob. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): Phaser.GameObjects.Bob; + + /** + * Sets the vertical flipped state of this Bob. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): Phaser.GameObjects.Bob; + + /** + * Sets the horizontal and vertical flipped state of this Bob. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): Phaser.GameObjects.Bob; + + /** + * Sets the visibility of this Bob. + * + * An invisible Bob will skip rendering. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): Phaser.GameObjects.Bob; + + /** + * Set the Alpha level of this Bob. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * A Bob with alpha 0 will skip rendering. + * @param value The alpha value used for this Bob. Between 0 and 1. + */ + setAlpha(value: number): Phaser.GameObjects.Bob; + + /** + * Destroys this Bob instance. + * Removes itself from the Blitter and clears the parent, frame and data properties. + */ + destroy(): void; + + /** + * The visible state of the Bob. + * + * An invisible Bob will skip rendering. + */ + visible: boolean; + + /** + * The alpha value of the Bob, between 0 and 1. + * + * A Bob with alpha 0 will skip rendering. + */ + alpha: number; + + } + + /** + * Builds a Game Object using the provided configuration object. + * @param scene A reference to the Scene. + * @param gameObject The initial GameObject. + * @param config The config to build the GameObject with. + */ + function BuildGameObject(scene: Phaser.Scene, gameObject: Phaser.GameObjects.GameObject, config: Phaser.Types.GameObjects.GameObjectConfig): Phaser.GameObjects.GameObject; + + /** + * Adds an Animation component to a Sprite and populates it based on the given config. + * @param sprite The sprite to add an Animation component to. + * @param config The animation config. + */ + function BuildGameObjectAnimation(sprite: Phaser.GameObjects.Sprite, config: object): Phaser.GameObjects.Sprite; + + namespace Components { + /** + * Provides methods used for setting the alpha properties of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Alpha { + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + } + + interface Animation { + /** + * The Game Object to which this animation controller belongs. + */ + parent: Phaser.GameObjects.GameObject; + /** + * A reference to the global Animation Manager. + */ + animationManager: Phaser.Animations.AnimationManager; + /** + * Is an animation currently playing or not? + */ + isPlaying: boolean; + /** + * The current Animation loaded into this Animation Controller. + */ + currentAnim: Phaser.Animations.Animation; + /** + * The current AnimationFrame being displayed by this Animation Controller. + */ + currentFrame: Phaser.Animations.AnimationFrame; + /** + * The key of the next Animation to be loaded into this Animation Controller when the current animation completes. + */ + nextAnim: string; + /** + * The frame rate of playback in frames per second. + * The default is 24 if the `duration` property is `null`. + */ + frameRate: number; + /** + * How long the animation should play for, in milliseconds. + * If the `frameRate` property has been set then it overrides this value, + * otherwise the `frameRate` is derived from `duration`. + */ + duration: number; + /** + * ms per frame, not including frame specific modifiers that may be present in the Animation data. + */ + msPerFrame: number; + /** + * Skip frames if the time lags, or always advanced anyway? + */ + skipMissedFrames: boolean; + /** + * Will the playhead move forwards (`true`) or in reverse (`false`). + */ + forward: boolean; + /** + * Internal time overflow accumulator. + */ + accumulator: number; + /** + * The time point at which the next animation frame will change. + */ + nextTick: number; + /** + * An internal counter keeping track of how many repeats are left to play. + */ + repeatCounter: number; + /** + * An internal flag keeping track of pending repeats. + */ + pendingRepeat: boolean; + /** + * Sets an animation to be played immediately after the current one completes. + * + * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, or have the `stop` method called directly on it. + * + * An animation set to repeat forever will never enter a completed state. + * + * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` callback). + * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. + * + * Call this method with no arguments to reset the chained animation. + * @param key The string-based key of the animation to play next, as defined previously in the Animation Manager. Or an Animation instance. + */ + chain(key?: string | Phaser.Animations.Animation): Phaser.GameObjects.GameObject; + /** + * Sets the amount of time, in milliseconds, that the animation will be delayed before starting playback. + * @param value The amount of time, in milliseconds, to wait before starting playback. Default 0. + */ + setDelay(value?: integer): Phaser.GameObjects.GameObject; + /** + * Gets the amount of time, in milliseconds that the animation will be delayed before starting playback. + */ + getDelay(): integer; + /** + * Waits for the specified delay, in milliseconds, then starts playback of the requested animation. + * @param delay The delay, in milliseconds, to wait before starting the animation playing. + * @param key The key of the animation to play. + * @param startFrame The frame of the animation to start from. Default 0. + */ + delayedPlay(delay: integer, key: string, startFrame?: integer): Phaser.GameObjects.GameObject; + /** + * Returns the key of the animation currently loaded into this component. + */ + getCurrentKey(): string; + /** + * Internal method used to load an animation into this component. + * @param key The key of the animation to load. + * @param startFrame The start frame of the animation to load. Default 0. + */ + load(key: string, startFrame?: integer): Phaser.GameObjects.GameObject; + /** + * Pause the current animation and set the `isPlaying` property to `false`. + * You can optionally pause it at a specific frame. + * @param atFrame An optional frame to set after pausing the animation. + */ + pause(atFrame?: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + /** + * Resumes playback of a paused animation and sets the `isPlaying` property to `true`. + * You can optionally tell it to start playback from a specific frame. + * @param fromFrame An optional frame to set before restarting playback. + */ + resume(fromFrame?: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + /** + * `true` if the current animation is paused, otherwise `false`. + */ + readonly isPaused: boolean; + /** + * Plays an Animation on a Game Object that has the Animation component, such as a Sprite. + * + * Animations are stored in the global Animation Manager and are referenced by a unique string-based key. + * @param key The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. + * @param ignoreIfPlaying If this animation is already playing then ignore this call. Default false. + * @param startFrame Optionally start the animation playing from this frame index. Default 0. + */ + play(key: string | Phaser.Animations.Animation, ignoreIfPlaying?: boolean, startFrame?: integer): Phaser.GameObjects.GameObject; + /** + * Plays an Animation (in reverse mode) on the Game Object that owns this Animation Component. + * @param key The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. + * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. + * @param startFrame Optionally start the animation playing from this frame index. Default 0. + */ + playReverse(key: string | Phaser.Animations.Animation, ignoreIfPlaying?: boolean, startFrame?: integer): Phaser.GameObjects.GameObject; + /** + * Load an Animation and fires 'onStartEvent' event, extracted from 'play' method. + * @param key The string-based key of the animation to play, as defined previously in the Animation Manager. + * @param startFrame Optionally start the animation playing from this frame index. Default 0. + */ + _startAnimation(key: string, startFrame?: integer): Phaser.GameObjects.GameObject; + /** + * Reverse the Animation that is already playing on the Game Object. + */ + reverse(): Phaser.GameObjects.GameObject; + /** + * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. + * If the animation has a non-zero repeat defined, `getProgress` and `getTotalProgress` will be different + * because `getProgress` doesn't include any repeats or repeat delays, whereas `getTotalProgress` does. + */ + getProgress(): number; + /** + * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. + * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. + * @param value The progress value, between 0 and 1. Default 0. + */ + setProgress(value?: number): Phaser.GameObjects.GameObject; + /** + * Handle the removal of an animation from the Animation Manager. + * @param key The key of the removed Animation. + * @param animation The removed Animation. + */ + remove(key?: string, animation?: Phaser.Animations.Animation): void; + /** + * Gets the number of times that the animation will repeat + * after its first iteration. For example, if returns 1, the animation will + * play a total of twice (the initial play plus 1 repeat). + * A value of -1 means the animation will repeat indefinitely. + */ + getRepeat(): integer; + /** + * Sets the number of times that the animation should repeat + * after its first iteration. For example, if repeat is 1, the animation will + * play a total of twice (the initial play plus 1 repeat). + * To repeat indefinitely, use -1. repeat should always be an integer. + * @param value The number of times that the animation should repeat. + */ + setRepeat(value: integer): Phaser.GameObjects.GameObject; + /** + * Gets the amount of delay between repeats, if any. + */ + getRepeatDelay(): number; + /** + * Sets the amount of time in seconds between repeats. + * For example, if `repeat` is 2 and `repeatDelay` is 10, the animation will play initially, + * then wait for 10 seconds before repeating, then play again, then wait another 10 seconds + * before doing its final repeat. + * @param value The delay to wait between repeats, in seconds. + */ + setRepeatDelay(value: number): Phaser.GameObjects.GameObject; + /** + * Restarts the current animation from its beginning, optionally including its delay value. + * @param includeDelay Whether to include the delay value of the animation when restarting. Default false. + */ + restart(includeDelay?: boolean): Phaser.GameObjects.GameObject; + /** + * Immediately stops the current animation from playing and dispatches the `animationcomplete` event. + * + * If no animation is set, no event will be dispatched. + * + * If there is another animation queued (via the `chain` method) then it will start playing immediately. + */ + stop(): Phaser.GameObjects.GameObject; + /** + * Stops the current animation from playing after the specified time delay, given in milliseconds. + * @param delay The number of milliseconds to wait before stopping this animation. + */ + stopAfterDelay(delay: integer): Phaser.GameObjects.GameObject; + /** + * Stops the current animation from playing when it next repeats. + */ + stopOnRepeat(): Phaser.GameObjects.GameObject; + /** + * Stops the current animation from playing when it next sets the given frame. + * If this frame doesn't exist within the animation it will not stop it from playing. + * @param frame The frame to check before stopping this animation. + */ + stopOnFrame(frame: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + /** + * Sets the Time Scale factor, allowing you to make the animation go go faster or slower than default. + * Where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. + * @param value The time scale factor, where 1 is no change, 0.5 is half speed, etc. Default 1. + */ + setTimeScale(value?: number): Phaser.GameObjects.GameObject; + /** + * Gets the Time Scale factor. + */ + getTimeScale(): number; + /** + * Returns the total number of frames in this animation. + */ + getTotalFrames(): integer; + /** + * The internal update loop for the Animation Component. + * @param time The current timestamp. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: number, delta: number): void; + /** + * Sets the given Animation Frame as being the current frame + * and applies it to the parent Game Object, adjusting its size and origin as needed. + * @param animationFrame The Animation Frame to set as being current. + */ + setCurrentFrame(animationFrame: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + /** + * Advances the animation to the next frame, regardless of the time or animation state. + * If the animation is set to repeat, or yoyo, this will still take effect. + * + * Calling this does not change the direction of the animation. I.e. if it was currently + * playing in reverse, calling this method doesn't then change the direction to forwards. + */ + nextFrame(): Phaser.GameObjects.GameObject; + /** + * Advances the animation to the previous frame, regardless of the time or animation state. + * If the animation is set to repeat, or yoyo, this will still take effect. + * + * Calling this does not change the direction of the animation. I.e. if it was currently + * playing in forwards, calling this method doesn't then change the direction to backwards. + */ + previousFrame(): Phaser.GameObjects.GameObject; + /** + * Sets if the current Animation will yoyo when it reaches the end. + * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. + * @param value `true` if the animation should yoyo, `false` to not. Default false. + */ + setYoyo(value?: boolean): Phaser.GameObjects.GameObject; + /** + * Gets if the current Animation will yoyo when it reaches the end. + * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. + */ + getYoyo(): boolean; + /** + * Destroy this Animation component. + * + * Unregisters event listeners and cleans up its references. + */ + destroy(): void; + } + + /** + * Provides methods used for setting the blend mode of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface BlendMode { + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + } + + /** + * Provides methods used for calculating and setting the size of a non-Frame based Game Object. + * Should be applied as a mixin and not used directly. + */ + interface ComputedSize { + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + } + + /** + * Provides methods used for getting and setting the texture of a Game Object. + */ + interface Crop { + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + } + + /** + * Provides methods used for setting the depth of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Depth { + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + } + + /** + * Provides methods used for visually flipping a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Flip { + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + } + + /** + * Provides methods used for obtaining the bounds of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface GetBounds { + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + } + + /** + * Provides methods used for getting and setting the mask of a Game Object. + */ + interface Mask { + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + } + + /** + * Provides methods used for getting and setting the origin of a Game Object. + * Values are normalized, given in the range 0 to 1. + * Display values contain the calculated pixel values. + * Should be applied as a mixin and not used directly. + */ + interface Origin { + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + } + + /** + * Provides methods used for managing a Game Object following a Path. + * Should be applied as a mixin and not used directly. + */ + interface PathFollower { + /** + * The Path this PathFollower is following. It can only follow one Path at a time. + */ + path: Phaser.Curves.Path; + /** + * Should the PathFollower automatically rotate to point in the direction of the Path? + */ + rotateToPath: boolean; + /** + * Set the Path that this PathFollower should follow. + * + * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. + * @param path The Path this PathFollower is following. It can only follow one Path at a time. + * @param config Settings for the PathFollower. + */ + setPath(path: Phaser.Curves.Path, config?: number | Phaser.Types.GameObjects.PathFollower.PathConfig | Phaser.Types.Tweens.NumberTweenBuilderConfig): Phaser.GameObjects.PathFollower; + /** + * Set whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param value Whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param offset Rotation offset in degrees. Default 0. + */ + setRotateToPath(value: boolean, offset?: number): Phaser.GameObjects.PathFollower; + /** + * Is this PathFollower actively following a Path or not? + * + * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. + */ + isFollowing(): boolean; + /** + * Starts this PathFollower following its given Path. + * @param config The duration of the follow, or a PathFollower config object. Default {}. + * @param startAt Optional start position of the follow, between 0 and 1. Default 0. + */ + startFollow(config?: number | Phaser.Types.GameObjects.PathFollower.PathConfig | Phaser.Types.Tweens.NumberTweenBuilderConfig, startAt?: number): Phaser.GameObjects.PathFollower; + /** + * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the + * point on the Path at which you paused it. + */ + pauseFollow(): Phaser.GameObjects.PathFollower; + /** + * Resumes a previously paused PathFollower. + * + * If the PathFollower was not paused this has no effect. + */ + resumeFollow(): Phaser.GameObjects.PathFollower; + /** + * Stops this PathFollower from following the path any longer. + * + * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. + */ + stopFollow(): Phaser.GameObjects.PathFollower; + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + */ + pathUpdate(): void; + } + + /** + * Provides methods used for setting the WebGL rendering pipeline of a Game Object. + */ + interface Pipeline { + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + } + + /** + * Provides methods used for getting and setting the Scroll Factor of a Game Object. + */ + interface ScrollFactor { + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + } + + /** + * Provides methods used for getting and setting the size of a Game Object. + */ + interface Size { + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + } + + /** + * Provides methods used for getting and setting the texture of a Game Object. + */ + interface Texture { + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + } + + /** + * Provides methods used for getting and setting the texture of a Game Object. + */ + interface TextureCrop { + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + } + + /** + * Provides methods used for setting the tint of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Tint { + /** + * Fill or additive? + */ + tintFill: boolean; + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + } + + /** + * Build a JSON representation of the given Game Object. + * + * This is typically extended further by Game Object specific implementations. + */ + interface ToJSON { + } + + /** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + */ + interface Transform { + /** + * The x position of this Game Object. + */ + x: number; + /** + * The y position of this Game Object. + */ + y: number; + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + /** + * The w position of this Game Object. + */ + w: number; + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + } + + /** + * A Matrix used for display transformations for rendering. + * + * It is represented like so: + * + * ``` + * | a | c | tx | + * | b | d | ty | + * | 0 | 0 | 1 | + * ``` + */ + class TransformMatrix { + /** + * + * @param a The Scale X value. Default 1. + * @param b The Shear Y value. Default 0. + * @param c The Shear X value. Default 0. + * @param d The Scale Y value. Default 1. + * @param tx The Translate X value. Default 0. + * @param ty The Translate Y value. Default 0. + */ + constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number); + + /** + * The matrix values. + */ + matrix: Float32Array; + + /** + * The decomposed matrix. + */ + decomposedMatrix: object; + + /** + * The Scale X value. + */ + a: number; + + /** + * The Shear Y value. + */ + b: number; + + /** + * The Shear X value. + */ + c: number; + + /** + * The Scale Y value. + */ + d: number; + + /** + * The Translate X value. + */ + e: number; + + /** + * The Translate Y value. + */ + f: number; + + /** + * The Translate X value. + */ + tx: number; + + /** + * The Translate Y value. + */ + ty: number; + + /** + * The rotation of the Matrix. + */ + readonly rotation: number; + + /** + * The horizontal scale of the Matrix. + */ + readonly scaleX: number; + + /** + * The vertical scale of the Matrix. + */ + readonly scaleY: number; + + /** + * Reset the Matrix to an identity matrix. + */ + loadIdentity(): this; + + /** + * Translate the Matrix. + * @param x The horizontal translation value. + * @param y The vertical translation value. + */ + translate(x: number, y: number): this; + + /** + * Scale the Matrix. + * @param x The horizontal scale value. + * @param y The vertical scale value. + */ + scale(x: number, y: number): this; + + /** + * Rotate the Matrix. + * @param angle The angle of rotation in radians. + */ + rotate(angle: number): this; + + /** + * Multiply this Matrix by the given Matrix. + * + * If an `out` Matrix is given then the results will be stored in it. + * If it is not given, this matrix will be updated in place instead. + * Use an `out` Matrix if you do not wish to mutate this matrix. + * @param rhs The Matrix to multiply by. + * @param out An optional Matrix to store the results in. + */ + multiply(rhs: Phaser.GameObjects.Components.TransformMatrix, out?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Multiply this Matrix by the matrix given, including the offset. + * + * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. + * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. + * @param src The source Matrix to copy from. + * @param offsetX Horizontal offset to factor in to the multiplication. + * @param offsetY Vertical offset to factor in to the multiplication. + */ + multiplyWithOffset(src: Phaser.GameObjects.Components.TransformMatrix, offsetX: number, offsetY: number): this; + + /** + * Transform the Matrix. + * @param a The Scale X value. + * @param b The Shear Y value. + * @param c The Shear X value. + * @param d The Scale Y value. + * @param tx The Translate X value. + * @param ty The Translate Y value. + */ + transform(a: number, b: number, c: number, d: number, tx: number, ty: number): this; + + /** + * Transform a point using this Matrix. + * @param x The x coordinate of the point to transform. + * @param y The y coordinate of the point to transform. + * @param point The Point object to store the transformed coordinates. + */ + transformPoint(x: number, y: number, point: Phaser.Geom.Point | Phaser.Math.Vector2 | object): Phaser.Geom.Point | Phaser.Math.Vector2 | object; + + /** + * Invert the Matrix. + */ + invert(): this; + + /** + * Set the values of this Matrix to copy those of the matrix given. + * @param src The source Matrix to copy from. + */ + copyFrom(src: Phaser.GameObjects.Components.TransformMatrix): this; + + /** + * Set the values of this Matrix to copy those of the array given. + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * @param src The array of values to set into this matrix. + */ + copyFromArray(src: any[]): this; + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.transform method. + * @param ctx The Canvas Rendering Context to copy the matrix values to. + */ + copyToContext(ctx: CanvasRenderingContext2D): CanvasRenderingContext2D; + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.setTransform method. + * @param ctx The Canvas Rendering Context to copy the matrix values to. + */ + setToContext(ctx: CanvasRenderingContext2D): CanvasRenderingContext2D; + + /** + * Copy the values in this Matrix to the array given. + * + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * @param out The array to copy the matrix values in to. + */ + copyToArray(out?: any[]): any[]; + + /** + * Set the values of this Matrix. + * @param a The Scale X value. + * @param b The Shear Y value. + * @param c The Shear X value. + * @param d The Scale Y value. + * @param tx The Translate X value. + * @param ty The Translate Y value. + */ + setTransform(a: number, b: number, c: number, d: number, tx: number, ty: number): this; + + /** + * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. + * + * The result must be applied in the following order to reproduce the current matrix: + * + * translate -> rotate -> scale + */ + decomposeMatrix(): object; + + /** + * Apply the identity, translate, rotate and scale operations on the Matrix. + * @param x The horizontal translation. + * @param y The vertical translation. + * @param rotation The angle of rotation in radians. + * @param scaleX The horizontal scale. + * @param scaleY The vertical scale. + */ + applyITRS(x: number, y: number, rotation: number, scaleX: number, scaleY: number): this; + + /** + * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of + * the current matrix with its transformation applied. + * + * Can be used to translate points from world to local space. + * @param x The x position to translate. + * @param y The y position to translate. + * @param output A Vector2, or point-like object, to store the results in. + */ + applyInverse(x: number, y: number, output?: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Returns the X component of this matrix multiplied by the given values. + * This is the same as `x * a + y * c + e`. + * @param x The x value. + * @param y The y value. + */ + getX(x: number, y: number): number; + + /** + * Returns the Y component of this matrix multiplied by the given values. + * This is the same as `x * b + y * d + f`. + * @param x The x value. + * @param y The y value. + */ + getY(x: number, y: number): number; + + /** + * Returns a string that can be used in a CSS Transform call as a `matrix` property. + */ + getCSSMatrix(): string; + + /** + * Destroys this Transform Matrix. + */ + destroy(): void; + + } + + /** + * Provides methods used for setting the visibility of a Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Visible { + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + } + + } + + /** + * A Container Game Object. + * + * A Container, as the name implies, can 'contain' other types of Game Object. + * When a Game Object is added to a Container, the Container becomes responsible for the rendering of it. + * By default it will be removed from the Display List and instead added to the Containers own internal list. + * + * The position of the Game Object automatically becomes relative to the position of the Container. + * + * When the Container is rendered, all of its children are rendered as well, in the order in which they exist + * within the Container. Container children can be repositioned using methods such as `MoveUp`, `MoveDown` and `SendToBack`. + * + * If you modify a transform property of the Container, such as `Container.x` or `Container.rotation` then it will + * automatically influence all children as well. + * + * Containers can include other Containers for deeply nested transforms. + * + * Containers can have masks set on them and can be used as a mask too. However, Container children cannot be masked. + * The masks do not 'stack up'. Only a Container on the root of the display list will use its mask. + * + * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them + * to use as their hit area. Container children can also be enabled for input, independent of the Container. + * + * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, + * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, + * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children + * with physics do not factor in the Container due to the excessive extra calculations needed. Please structure + * your game to work around this. + * + * It's important to understand the impact of using Containers. They add additional processing overhead into + * every one of their children. The deeper you nest them, the more the cost escalates. This is especially true + * for input events. You also loose the ability to set the display depth of Container children in the same + * flexible manner as those not within them. In short, don't use them for the sake of it. You pay a small cost + * every time you create one, try to structure your game around avoiding that where possible. + */ + class Container extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param children An optional array of Game Objects to add to this Container. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, children?: Phaser.GameObjects.GameObject[]); + + /** + * An array holding the children of this Container. + */ + list: Phaser.GameObjects.GameObject[]; + + /** + * Does this Container exclusively manage its children? + * + * The default is `true` which means a child added to this Container cannot + * belong in another Container, which includes the Scene display list. + * + * If you disable this then this Container will no longer exclusively manage its children. + * This allows you to create all kinds of interesting graphical effects, such as replicating + * Game Objects without reparenting them all over the Scene. + * However, doing so will prevent children from receiving any kind of input event or have + * their physics bodies work by default, as they're no longer a single entity on the + * display list, but are being replicated where-ever this Container is. + */ + exclusive: boolean; + + /** + * Containers can have an optional maximum size. If set to anything above 0 it + * will constrict the addition of new Game Objects into the Container, capping off + * the maximum limit the Container can grow in size to. + */ + maxSize: integer; + + /** + * The cursor position. + */ + position: integer; + + /** + * Internal Transform Matrix used for local space conversion. + */ + localTransform: Phaser.GameObjects.Components.TransformMatrix; + + /** + * The horizontal scroll factor of this Container. + * + * The scroll factor controls the influence of the movement of a Camera upon this Container. + * + * When a camera scrolls it will change the location at which this Container is rendered on-screen. + * It does not change the Containers actual position values. + * + * For a Container, setting this value will only update the Container itself, not its children. + * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Container. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Container. + * + * The scroll factor controls the influence of the movement of a Camera upon this Container. + * + * When a camera scrolls it will change the location at which this Container is rendered on-screen. + * It does not change the Containers actual position values. + * + * For a Container, setting this value will only update the Container itself, not its children. + * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Container. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + */ + readonly originX: number; + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + */ + readonly originY: number; + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + */ + readonly displayOriginX: number; + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + */ + readonly displayOriginY: number; + + /** + * Does this Container exclusively manage its children? + * + * The default is `true` which means a child added to this Container cannot + * belong in another Container, which includes the Scene display list. + * + * If you disable this then this Container will no longer exclusively manage its children. + * This allows you to create all kinds of interesting graphical effects, such as replicating + * Game Objects without reparenting them all over the Scene. + * However, doing so will prevent children from receiving any kind of input event or have + * their physics bodies work by default, as they're no longer a single entity on the + * display list, but are being replicated where-ever this Container is. + * @param value The exclusive state of this Container. Default true. + */ + setExclusive(value?: boolean): Phaser.GameObjects.Container; + + /** + * Gets the bounds of this Container. It works by iterating all children of the Container, + * getting their respective bounds, and then working out a min-max rectangle from that. + * It does not factor in if the children render or not, all are included. + * + * Some children are unable to return their bounds, such as Graphics objects, in which case + * they are skipped. + * + * Depending on the quantity of children in this Container it could be a really expensive call, + * so cache it and only poll it as needed. + * + * The values are stored and returned in a Rectangle object. + * @param output A Geom.Rectangle object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: Phaser.Geom.Rectangle): Phaser.Geom.Rectangle; + + /** + * Takes a Point-like object, such as a Vector2, Geom.Point or object with public x and y properties, + * and transforms it into the space of this Container, then returns it in the output object. + * @param source The Source Point to be transformed. + * @param output A destination object to store the transformed point in. If none given a Vector2 will be created and returned. + */ + pointToContainer(source: object | Phaser.Geom.Point | Phaser.Math.Vector2, output?: object | Phaser.Geom.Point | Phaser.Math.Vector2): object | Phaser.Geom.Point | Phaser.Math.Vector2; + + /** + * Returns the world transform matrix as used for Bounds checks. + * + * The returned matrix is temporal and shouldn't be stored. + */ + getBoundsTransformMatrix(): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Adds the given Game Object, or array of Game Objects, to this Container. + * + * Each Game Object must be unique within the Container. + * @param child The Game Object, or array of Game Objects, to add to the Container. + */ + add(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.GameObjects.Container; + + /** + * Adds the given Game Object, or array of Game Objects, to this Container at the specified position. + * + * Existing Game Objects in the Container are shifted up. + * + * Each Game Object must be unique within the Container. + * @param child The Game Object, or array of Game Objects, to add to the Container. + * @param index The position to insert the Game Object/s at. Default 0. + */ + addAt(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], index?: integer): Phaser.GameObjects.Container; + + /** + * Returns the Game Object at the given position in this Container. + * @param index The position to get the Game Object from. + */ + getAt(index: integer): Phaser.GameObjects.GameObject; + + /** + * Returns the index of the given Game Object in this Container. + * @param child The Game Object to search for in this Container. + */ + getIndex(child: Phaser.GameObjects.GameObject): integer; + + /** + * Sort the contents of this Container so the items are in order based on the given property. + * For example: `sort('alpha')` would sort the elements based on the value of their `alpha` property. + * @param property The property to lexically sort by. + * @param handler Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean. + */ + sort(property: string, handler?: Function): Phaser.GameObjects.Container; + + /** + * Searches for the first instance of a child with its `name` property matching the given argument. + * Should more than one child have the same name only the first is returned. + * @param name The name to search for. + */ + getByName(name: string): Phaser.GameObjects.GameObject; + + /** + * Returns a random Game Object from this Container. + * @param startIndex An optional start index. Default 0. + * @param length An optional length, the total number of elements (from the startIndex) to choose from. + */ + getRandom(startIndex?: integer, length?: integer): Phaser.GameObjects.GameObject; + + /** + * Gets the first Game Object in this Container. + * + * You can also specify a property and value to search for, in which case it will return the first + * Game Object in this Container with a matching property and / or value. + * + * For example: `getFirst('visible', true)` would return the first Game Object that had its `visible` property set. + * + * You can limit the search to the `startIndex` - `endIndex` range. + * @param property The property to test on each Game Object in the Container. + * @param value The value to test the property against. Must pass a strict (`===`) comparison check. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default Container.length. + */ + getFirst(property: string, value: any, startIndex?: integer, endIndex?: integer): Phaser.GameObjects.GameObject; + + /** + * Returns all Game Objects in this Container. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('body')` would return only Game Objects that have a body property. + * + * You can also specify a value to compare the property to: + * + * `getAll('visible', true)` would return only Game Objects that have their visible property set to `true`. + * + * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 Game Objects. + * @param property The property to test on each Game Object in the Container. + * @param value If property is set then the `property` must strictly equal this value to be included in the results. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default Container.length. + */ + getAll(property?: string, value?: any, startIndex?: integer, endIndex?: integer): Phaser.GameObjects.GameObject[]; + + /** + * Returns the total number of Game Objects in this Container that have a property + * matching the given value. + * + * For example: `count('visible', true)` would count all the elements that have their visible property set. + * + * You can optionally limit the operation to the `startIndex` - `endIndex` range. + * @param property The property to check. + * @param value The value to check. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default Container.length. + */ + count(property: string, value: any, startIndex?: integer, endIndex?: integer): integer; + + /** + * Swaps the position of two Game Objects in this Container. + * Both Game Objects must belong to this Container. + * @param child1 The first Game Object to swap. + * @param child2 The second Game Object to swap. + */ + swap(child1: Phaser.GameObjects.GameObject, child2: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container; + + /** + * Moves a Game Object to a new position within this Container. + * + * The Game Object must already be a child of this Container. + * + * The Game Object is removed from its old position and inserted into the new one. + * Therefore the Container size does not change. Other children will change position accordingly. + * @param child The Game Object to move. + * @param index The new position of the Game Object in this Container. + */ + moveTo(child: Phaser.GameObjects.GameObject, index: integer): Phaser.GameObjects.Container; + + /** + * Removes the given Game Object, or array of Game Objects, from this Container. + * + * The Game Objects must already be children of this Container. + * + * You can also optionally call `destroy` on each Game Object that is removed from the Container. + * @param child The Game Object, or array of Game Objects, to be removed from the Container. + * @param destroyChild Optionally call `destroy` on each child successfully removed from this Container. Default false. + */ + remove(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], destroyChild?: boolean): Phaser.GameObjects.Container; + + /** + * Removes the Game Object at the given position in this Container. + * + * You can also optionally call `destroy` on the Game Object, if one is found. + * @param index The index of the Game Object to be removed. + * @param destroyChild Optionally call `destroy` on the Game Object if successfully removed from this Container. Default false. + */ + removeAt(index: integer, destroyChild?: boolean): Phaser.GameObjects.Container; + + /** + * Removes the Game Objects between the given positions in this Container. + * + * You can also optionally call `destroy` on each Game Object that is removed from the Container. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default Container.length. + * @param destroyChild Optionally call `destroy` on each Game Object successfully removed from this Container. Default false. + */ + removeBetween(startIndex?: integer, endIndex?: integer, destroyChild?: boolean): Phaser.GameObjects.Container; + + /** + * Removes all Game Objects from this Container. + * + * You can also optionally call `destroy` on each Game Object that is removed from the Container. + * @param destroyChild Optionally call `destroy` on each Game Object successfully removed from this Container. Default false. + */ + removeAll(destroyChild?: boolean): Phaser.GameObjects.Container; + + /** + * Brings the given Game Object to the top of this Container. + * This will cause it to render on-top of any other objects in the Container. + * @param child The Game Object to bring to the top of the Container. + */ + bringToTop(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container; + + /** + * Sends the given Game Object to the bottom of this Container. + * This will cause it to render below any other objects in the Container. + * @param child The Game Object to send to the bottom of the Container. + */ + sendToBack(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container; + + /** + * Moves the given Game Object up one place in this Container, unless it's already at the top. + * @param child The Game Object to be moved in the Container. + */ + moveUp(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container; + + /** + * Moves the given Game Object down one place in this Container, unless it's already at the bottom. + * @param child The Game Object to be moved in the Container. + */ + moveDown(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container; + + /** + * Reverses the order of all Game Objects in this Container. + */ + reverse(): Phaser.GameObjects.Container; + + /** + * Shuffles the all Game Objects in this Container using the Fisher-Yates implementation. + */ + shuffle(): Phaser.GameObjects.Container; + + /** + * Replaces a Game Object in this Container with the new Game Object. + * The new Game Object cannot already be a child of this Container. + * @param oldChild The Game Object in this Container that will be replaced. + * @param newChild The Game Object to be added to this Container. + * @param destroyChild Optionally call `destroy` on the Game Object if successfully removed from this Container. Default false. + */ + replace(oldChild: Phaser.GameObjects.GameObject, newChild: Phaser.GameObjects.GameObject, destroyChild?: boolean): Phaser.GameObjects.Container; + + /** + * Returns `true` if the given Game Object is a direct child of this Container. + * + * This check does not scan nested Containers. + * @param child The Game Object to check for within this Container. + */ + exists(child: Phaser.GameObjects.GameObject): boolean; + + /** + * Sets the property to the given value on all Game Objects in this Container. + * + * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 Game Objects. + * @param property The property that must exist on the Game Object. + * @param value The value to get the property to. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default Container.length. + */ + setAll(property: string, value: any, startIndex?: integer, endIndex?: integer): Phaser.GameObjects.Container; + + /** + * Passes all Game Objects in this Container to the given callback. + * + * A copy of the Container is made before passing each entry to your callback. + * This protects against the callback itself modifying the Container. + * + * If you know for sure that the callback will not change the size of this Container + * then you can use the more performant `Container.iterate` method instead. + * @param callback The function to call. + * @param context Value to use as `this` when executing callback. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + each(callback: Function, context?: object, ...args: any[]): Phaser.GameObjects.Container; + + /** + * Passes all Game Objects in this Container to the given callback. + * + * Only use this method when you absolutely know that the Container will not be modified during + * the iteration, i.e. by removing or adding to its contents. + * @param callback The function to call. + * @param context Value to use as `this` when executing callback. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + iterate(callback: Function, context?: object, ...args: any[]): Phaser.GameObjects.Container; + + /** + * Sets the scroll factor of this Container and optionally all of its children. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + * @param updateChildren Apply this scrollFactor to all Container children as well? Default false. + */ + setScrollFactor(x: number, y?: number, updateChildren?: boolean): this; + + /** + * The number of Game Objects inside this Container. + */ + readonly length: integer; + + /** + * Returns the first Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + */ + readonly first: Phaser.GameObjects.GameObject; + + /** + * Returns the last Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + */ + readonly last: Phaser.GameObjects.GameObject; + + /** + * Returns the next Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + */ + readonly next: Phaser.GameObjects.GameObject; + + /** + * Returns the previous Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + */ + readonly previous: Phaser.GameObjects.GameObject; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Display List plugin. + * + * Display Lists belong to a Scene and maintain the list of Game Objects to render every frame. + * + * Some of these Game Objects may also be part of the Scene's [Update List]{@link Phaser.GameObjects.UpdateList}, for updating. + */ + class DisplayList extends Phaser.Structs.List { + /** + * + * @param scene The Scene that this Display List belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. + */ + sortChildrenFlag: boolean; + + /** + * The Scene that this Display List belongs to. + */ + scene: Phaser.Scene; + + /** + * The Scene's Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * Force a sort of the display list on the next call to depthSort. + */ + queueDepthSort(): void; + + /** + * Immediately sorts the display list if the flag is set. + */ + depthSort(): void; + + /** + * Compare the depth of two Game Objects. + * @param childA The first Game Object. + * @param childB The second Game Object. + */ + sortByDepth(childA: Phaser.GameObjects.GameObject, childB: Phaser.GameObjects.GameObject): integer; + + /** + * Returns an array which contains all objects currently on the Display List. + * This is a reference to the main list array, not a copy of it, so be careful not to modify it. + */ + getChildren(): Phaser.GameObjects.GameObject[]; + + } + + /** + * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. + * + * In order for DOM Elements to display you have to enable them by adding the following to your game + * configuration object: + * + * ```javascript + * dom { + * createContainer: true + * } + * ``` + * + * When this is added, Phaser will automatically create a DOM Container div that is positioned over the top + * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of + * settings within the Scale Manager, the dom container is resized accordingly. + * + * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing + * Element that you wish to be placed under the control of Phaser. For example: + * + * ```javascript + * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in + * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case, + * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font. + * + * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control + * alignment and positioning of the elements next to regular game content. + * + * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the + * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other + * methods available in this class to help construct your elements. + * + * Once the element has been created you can then control it like you would any other Game Object. You can set its + * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped + * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that + * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have + * a DOM Element, then a Sprite, then another DOM Element behind it. + * + * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event + * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas + * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you + * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly. + * + * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in. + * + * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert + * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table. + * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and + * UI. The choice is up to you, just remember that you're dealing with standard HTML and CSS floating over the top + * of your game, and should treat it accordingly. + */ + class DOMElement extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this DOM Element in the world. Default 0. + * @param y The vertical position of this DOM Element in the world. Default 0. + * @param element An existing DOM element, or a string. If a string starting with a # it will do a `getElementById` look-up on the string (minus the hash). Without a hash, it represents the type of element to create, i.e. 'div'. + * @param style If a string, will be set directly as the elements `style` property value. If a plain object, will be iterated and the values transferred. In both cases the values replacing whatever CSS styles may have been previously set. + * @param innerText If given, will be set directly as the elements `innerText` property value, replacing whatever was there before. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, element?: Element | string, style?: string | any, innerText?: string); + + /** + * A reference to the parent DOM Container that the Game instance created when it started. + */ + parent: Element; + + /** + * A reference to the HTML Cache. + */ + cache: Phaser.Cache.BaseCache; + + /** + * The actual DOM Element that this Game Object is bound to. For example, if you've created a `
` + * then this property is a direct reference to that element within the dom. + */ + node: Element; + + /** + * By default a DOM Element will have its transform, display, opacity, zIndex and blend mode properties + * updated when its rendered. If, for some reason, you don't want any of these changed other than the + * CSS transform, then set this flag to `true`. When `true` only the CSS Transform is applied and it's + * up to you to keep track of and set the other properties as required. + * + * This can be handy if, for example, you've a nested DOM Element and you don't want the opacity to be + * picked-up by any of its children. + */ + transformOnly: boolean; + + /** + * The angle, in radians, by which to skew the DOM Element on the horizontal axis. + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform + */ + skewX: number; + + /** + * The angle, in radians, by which to skew the DOM Element on the vertical axis. + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform + */ + skewY: number; + + /** + * A Vector4 that contains the 3D rotation of this DOM Element around a fixed axis in 3D space. + * + * All values in the Vector4 are treated as degrees, unless the `rotate3dAngle` property is changed. + * + * For more details see the following MDN page: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d + */ + rotate3d: Phaser.Math.Vector4; + + /** + * The unit that represents the 3D rotation values. By default this is `deg` for degrees, but can + * be changed to any supported unit. See this page for further details: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d + */ + rotate3dAngle: string; + + /** + * The native (un-scaled) width of this Game Object. + * + * For a DOM Element this property is read-only. + * + * The property `displayWidth` holds the computed bounds of this DOM Element, factoring in scaling. + */ + readonly width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * For a DOM Element this property is read-only. + * + * The property `displayHeight` holds the computed bounds of this DOM Element, factoring in scaling. + */ + readonly height: number; + + /** + * The computed display width of this Game Object, based on the `getBoundingClientRect` DOM call. + * + * The property `width` holds the un-scaled width of this DOM Element. + */ + readonly displayWidth: number; + + /** + * The computed display height of this Game Object, based on the `getBoundingClientRect` DOM call. + * + * The property `height` holds the un-scaled height of this DOM Element. + */ + readonly displayHeight: number; + + /** + * Sets the horizontal and vertical skew values of this DOM Element. + * + * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/transform + * @param x The angle, in radians, by which to skew the DOM Element on the horizontal axis. Default 0. + * @param y The angle, in radians, by which to skew the DOM Element on the vertical axis. Default x. + */ + setSkew(x?: number, y?: number): this; + + /** + * Sets the perspective CSS property of the _parent DOM Container_. This determines the distance between the z=0 + * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with + * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined + * by the value of this property. + * + * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective + * + * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.** + * @param value The perspective value, in pixels, that determines the distance between the z plane and the user. + */ + setPerspective(value: number): this; + + /** + * The perspective CSS property value of the _parent DOM Container_. This determines the distance between the z=0 + * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with + * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined + * by the value of this property. + * + * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective + * + * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.** + */ + perspective: number; + + /** + * Adds one or more native DOM event listeners onto the underlying Element of this Game Object. + * The event is then dispatched via this Game Objects standard event emitter. + * + * For example: + * + * ```javascript + * var div = this.add.dom(x, y, element); + * + * div.addListener('click'); + * + * div.on('click', handler); + * ``` + * @param events The DOM event/s to listen for. You can specify multiple events by separating them with spaces. + */ + addListener(events: string): this; + + /** + * Removes one or more native DOM event listeners from the underlying Element of this Game Object. + * @param events The DOM event/s to stop listening for. You can specify multiple events by separating them with spaces. + */ + removeListener(events: string): this; + + /** + * Creates a native DOM Element, adds it to the parent DOM Container and then binds it to this Game Object, + * so you can control it. The `tagName` should be a string and is passed to `document.createElement`: + * + * ```javascript + * this.add.dom().createElement('div'); + * ``` + * + * For more details on acceptable tag names see: https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement + * + * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText` + * value as well. Here is an example of a DOMString: + * + * ```javascript + * this.add.dom().createElement('div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * And using a style object: + * + * ```javascript + * var style = { + * 'background-color': 'lime'; + * 'width': '200px'; + * 'height': '100px'; + * 'font': '48px Arial'; + * }; + * + * this.add.dom().createElement('div', style, 'Phaser'); + * ``` + * + * If this Game Object already has an Element, it is removed from the DOM entirely first. + * Any event listeners you may have previously created will need to be re-created after this call. + * @param tagName A string that specifies the type of element to be created. The nodeName of the created element is initialized with the value of tagName. Don't use qualified names (like "html:a") with this method. + * @param style Either a DOMString that holds the CSS styles to be applied to the created element, or an object the styles will be ready from. + * @param innerText A DOMString that holds the text that will be set as the innerText of the created element. + */ + createElement(tagName: string, style?: string | any, innerText?: string): this; + + /** + * Binds a new DOM Element to this Game Object. If this Game Object already has an Element it is removed from the DOM + * entirely first. Any event listeners you may have previously created will need to be re-created on the new element. + * + * The `element` argument you pass to this method can be either a string tagName: + * + * ```javascript + *

Phaser

+ * + * this.add.dom().setElement('heading'); + * ``` + * + * Or a reference to an Element instance: + * + * ```javascript + *

Phaser

+ * + * var h1 = document.getElementById('heading'); + * + * this.add.dom().setElement(h1); + * ``` + * + * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText` + * value as well. Here is an example of a DOMString: + * + * ```javascript + * this.add.dom().setElement(h1, 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * And using a style object: + * + * ```javascript + * var style = { + * 'background-color': 'lime'; + * 'width': '200px'; + * 'height': '100px'; + * 'font': '48px Arial'; + * }; + * + * this.add.dom().setElement(h1, style, 'Phaser'); + * ``` + * @param element If a string it is passed to `getElementById()`, or it should be a reference to an existing Element. + * @param style Either a DOMString that holds the CSS styles to be applied to the created element, or an object the styles will be ready from. + * @param innerText A DOMString that holds the text that will be set as the innerText of the created element. + */ + setElement(element: string | Element, style?: string | any, innerText?: string): this; + + /** + * Takes a block of html from the HTML Cache, that has previously been preloaded into the game, and then + * creates a DOM Element from it. The loaded HTML is set as the `innerHTML` property of the created + * element. + * + * Assume the following html is stored in a file called `loginform.html`: + * + * ```html + * + * + * ``` + * + * Which is loaded into your game using the cache key 'login': + * + * ```javascript + * this.load.html('login', 'assets/loginform.html'); + * ``` + * + * You can create a DOM Element from it using the cache key: + * + * ```javascript + * this.add.dom().createFromCache('login'); + * ``` + * + * The optional `elementType` argument controls the container that is created, into which the loaded html is inserted. + * The default is a plain `div` object, but any valid tagName can be given. + * + * If this Game Object already has an Element, it is removed from the DOM entirely first. + * Any event listeners you may have previously created will need to be re-created after this call. + * @param The key of the html cache entry to use for this DOM Element. + * @param tagName The tag name of the element into which all of the loaded html will be inserted. Defaults to a plain div tag. Default 'div'. + */ + createFromCache(The: string, tagName?: string): this; + + /** + * Takes a string of html and then creates a DOM Element from it. The HTML is set as the `innerHTML` + * property of the created element. + * + * ```javascript + * let form = ` + * + * + * `; + * ``` + * + * You can create a DOM Element from it using the string: + * + * ```javascript + * this.add.dom().createFromHTML(form); + * ``` + * + * The optional `elementType` argument controls the type of container that is created, into which the html is inserted. + * The default is a plain `div` object, but any valid tagName can be given. + * + * If this Game Object already has an Element, it is removed from the DOM entirely first. + * Any event listeners you may have previously created will need to be re-created after this call. + * @param A string of html to be set as the `innerHTML` property of the created element. + * @param tagName The tag name of the element into which all of the html will be inserted. Defaults to a plain div tag. Default 'div'. + */ + createFromHTML(A: string, tagName?: string): this; + + /** + * Removes the current DOM Element bound to this Game Object from the DOM entirely and resets the + * `node` property of this Game Object to be `null`. + */ + removeElement(): this; + + /** + * Internal method that calls `getBoundingClientRect` on the `node` and then sets the bounds width + * and height into the `displayWidth` and `displayHeight` properties, and the `clientWidth` and `clientHeight` + * values into the `width` and `height` properties respectively. + * + * This is called automatically whenever a new element is created or set. + */ + updateSize(): this; + + /** + * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through + * them, looking for the first one that has a property matching the given key and value. It then returns this child + * if found, or `null` if not. + * @param property The property to search the children for. + * @param value The value the property must strictly equal. + */ + getChildByProperty(property: string, value: string): Element; + + /** + * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through + * them, looking for the first one that has a matching id. It then returns this child if found, or `null` if not. + * + * Be aware that class and id names are case-sensitive. + * @param id The id to search the children for. + */ + getChildByID(id: string): Element; + + /** + * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through + * them, looking for the first one that has a matching name. It then returns this child if found, or `null` if not. + * + * Be aware that class and id names are case-sensitive. + * @param name The name to search the children for. + */ + getChildByName(name: string): Element; + + /** + * Sets the `className` property of the DOM Element node and updates the internal sizes. + * @param className A string representing the class or space-separated classes of the element. + */ + setClassName(className: string): this; + + /** + * Sets the `innerText` property of the DOM Element node and updates the internal sizes. + * + * Note that only certain types of Elements can have `innerText` set on them. + * @param text A DOMString representing the rendered text content of the element. + */ + setText(text: string): this; + + /** + * Sets the `innerHTML` property of the DOM Element node and updates the internal sizes. + * @param html A DOMString of html to be set as the `innerHTML` property of the element. + */ + setHTML(html: string): this; + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * + * DOMElements always return `true` as they need to still set values during the render pass, even if not visible. + */ + willRender(): boolean; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + namespace Events { + /** + * The Game Object Destroy Event. + * + * This event is dispatched when a Game Object instance is being destroyed. + * + * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. + */ + const DESTROY: any; + + } + + /** + * An Extern Game Object is a special type of Game Object that allows you to pass + * rendering off to a 3rd party. + * + * When you create an Extern and place it in the display list of a Scene, the renderer will + * process the list as usual. When it finds an Extern it will flush the current batch, + * clear down the pipeline and prepare a transform matrix which your render function can + * take advantage of, if required. + * + * The WebGL context is then left is a 'clean' state, ready for you to bind your own shaders, + * or draw to it, whatever you wish to do. Once you've finished, you should free-up any + * of your resources. The Extern will then rebind the Phaser pipeline and carry on + * rendering the display list. + * + * Although this object has lots of properties such as Alpha, Blend Mode and Tint, none of + * them are used during rendering unless you take advantage of them in your own render code. + */ + class Extern extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + */ + constructor(scene: Phaser.Scene); + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The base class that all Game Objects extend. + * You don't create GameObjects directly and they cannot be added to the display list. + * Instead, use them as the base for your own custom classes. + */ + class GameObject extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param type A textual representation of the type of Game Object, i.e. `sprite`. + */ + constructor(scene: Phaser.Scene, type: string); + + /** + * The Scene to which this Game Object belongs. + * Game Objects can only belong to one Scene. + */ + protected scene: Phaser.Scene; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + */ + type: string; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could move from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + */ + state: integer | string; + + /** + * The parent Container of this Game Object, if it has one. + */ + parentContainer: Phaser.GameObjects.Container; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + */ + name: string; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + */ + active: boolean; + + /** + * The Tab Index of the Game Object. + * Reserved for future use by plugins and the Input Manager. + */ + tabIndex: integer; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + */ + data: Phaser.Data.DataManager; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + */ + renderFlags: integer; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + */ + cameraFilter: number; + + /** + * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. + * Not usually set directly. Instead call `GameObject.setInteractive()`. + */ + input: Phaser.Types.Input.InteractiveObject; + + /** + * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body. + */ + body: object | Phaser.Physics.Arcade.Body | Phaser.Physics.Impact.Body; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + */ + ignoreDestroy: boolean; + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * @param value True if this Game Object should be set as active, false if not. + */ + setActive(value: boolean): this; + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * @param value The name to be given to this Game Object. + */ + setName(value: string): this; + + /** + * Sets the current state of this Game Object. + * + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * @param value The state of the Game Object. + */ + setState(value: integer | string): this; + + /** + * Adds a Data Manager component to this Game Object. + */ + setDataEnabled(): this; + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * @param key The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. + * @param data The value to set for the given key. If an object is provided as the key this argument is ignored. + */ + setData(key: string | object, data: any): this; + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * @param key The key of the value to retrieve, or an array of keys. + */ + getData(key: string | string[]): any; + + /** + * Pass this Game Object to the Input Manager to enable it for Input. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * @param shape Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param callback A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. + * @param dropZone Should this Game Object be treated as a drop zone target? Default false. + */ + setInteractive(shape?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; + + /** + * If this Game Object has previously been enabled for input, this will disable it. + * + * An object that is disabled for input stops processing or being considered for + * input events, but can be turned back on again at any time by simply calling + * `setInteractive()` with no arguments provided. + * + * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. + */ + disableInteractive(): this; + + /** + * If this Game Object has previously been enabled for input, this will queue it + * for removal, causing it to no longer be interactive. The removal happens on + * the next game step, it is not immediate. + * + * The Interactive Object that was assigned to this Game Object will be destroyed, + * removed from the Input Manager and cleared from this Game Object. + * + * If you wish to re-enable this Game Object at a later date you will need to + * re-create its InteractiveObject by calling `setInteractive` again. + * + * If you wish to only temporarily stop an object from receiving input then use + * `disableInteractive` instead, as that toggles the interactive state, where-as + * this erases it completely. + * + * If you wish to resize a hit area, don't remove and then set it as being + * interactive. Instead, access the hitarea object directly and resize the shape + * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the + * shape is a Rectangle, which it is by default.) + */ + removeInteractive(): this; + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * @param args args + */ + update(...args: any[]): void; + + /** + * Returns a JSON representation of the Game Object. + */ + toJSON(): Phaser.Types.GameObjects.JSONGameObject; + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * @param camera The Camera to check against this Game Object. + */ + willRender(camera: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Returns an array containing the display list index of either this Game Object, or if it has one, + * its parent Container. It then iterates up through all of the parent containers until it hits the + * root of the display list (which is index 0 in the returned array). + * + * Used internally by the InputPlugin but also useful if you wish to find out the display depth of + * this Game Object and all of its ancestors. + */ + getIndexList(): integer[]; + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Also removes itself from the Input Manager and Physics Manager if previously enabled. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. + * @param fromScene Is this Game Object being destroyed as the result of a Scene shutdown? Default false. + */ + destroy(fromScene?: boolean): void; + + /** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + */ + static readonly RENDER_MASK: integer; + + } + + /** + * The Game Object Creator is a Scene plugin that allows you to quickly create many common + * types of Game Objects and return them. Unlike the Game Object Factory, they are not automatically + * added to the Scene. + * + * Game Objects directly register themselves with the Creator and inject their own creation + * methods into the class. + */ + class GameObjectCreator { + /** + * + * @param scene The Scene to which this Game Object Factory belongs. + */ + constructor(scene: Phaser.Scene); + + /** + * Creates a new Dynamic Bitmap Text Game Object and returns it. + * + * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + dynamicBitmapText(config: Phaser.Types.GameObjects.BitmapText.BitmapTextConfig, addToScene?: boolean): Phaser.GameObjects.DynamicBitmapText; + + /** + * Creates a new Bitmap Text Game Object and returns it. + * + * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + bitmapText(config: Phaser.Types.GameObjects.BitmapText.BitmapTextConfig, addToScene?: boolean): Phaser.GameObjects.BitmapText; + + /** + * Creates a new Blitter Game Object and returns it. + * + * Note: This method will only be available if the Blitter Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + blitter(config: object, addToScene?: boolean): Phaser.GameObjects.Blitter; + + /** + * Creates a new Container Game Object and returns it. + * + * Note: This method will only be available if the Container Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + container(config: object, addToScene?: boolean): Phaser.GameObjects.Container; + + /** + * The Scene to which this Game Object Creator belongs. + */ + protected scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems. + */ + protected systems: Phaser.Scenes.Systems; + + /** + * A reference to the Scene Display List. + */ + protected displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene Update List. + */ + protected "updateList;": Phaser.GameObjects.UpdateList; + + /** + * Creates a new Graphics Game Object and returns it. + * + * Note: This method will only be available if the Graphics Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + graphics(config: object, addToScene?: boolean): Phaser.GameObjects.Graphics; + + /** + * Creates a new Group Game Object and returns it. + * + * Note: This method will only be available if the Group Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + */ + group(config: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.GameObjects.Group; + + /** + * Creates a new Image Game Object and returns it. + * + * Note: This method will only be available if the Image Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + image(config: object, addToScene?: boolean): Phaser.GameObjects.Image; + + /** + * Creates a new Mesh Game Object and returns it. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + mesh(config: object, addToScene?: boolean): Phaser.GameObjects.Mesh; + + /** + * Creates a new Particle Emitter Manager Game Object and returns it. + * + * Note: This method will only be available if the Particles Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + particles(config: object, addToScene?: boolean): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Creates a new Quad Game Object and returns it. + * + * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + quad(config: object, addToScene?: boolean): Phaser.GameObjects.Quad; + + /** + * Creates a new Render Texture Game Object and returns it. + * + * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + renderTexture(config: Phaser.Types.GameObjects.RenderTexture.RenderTextureConfig, addToScene?: boolean): Phaser.GameObjects.RenderTexture; + + /** + * Creates a new Shader Game Object and returns it. + * + * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + shader(config: object, addToScene?: boolean): Phaser.GameObjects.Shader; + + /** + * Creates a new Sprite Game Object and returns it. + * + * Note: This method will only be available if the Sprite Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + sprite(config: Phaser.Types.GameObjects.Sprite.SpriteConfig, addToScene?: boolean): Phaser.GameObjects.Sprite; + + /** + * Creates a new Text Game Object and returns it. + * + * Note: This method will only be available if the Text Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + text(config: object, addToScene?: boolean): Phaser.GameObjects.Text; + + /** + * Creates a new TileSprite Game Object and returns it. + * + * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + tileSprite(config: Phaser.Types.GameObjects.TileSprite.TileSpriteConfig, addToScene?: boolean): Phaser.GameObjects.TileSprite; + + /** + * Creates a new Zone Game Object and returns it. + * + * Note: This method will only be available if the Zone Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + */ + zone(config: object): Phaser.GameObjects.Zone; + + /** + * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. + * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing + * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map + * data. For an empty map, you should specify tileWidth, tileHeight, width & height. + * @param config The config options for the Tilemap. + */ + tilemap(config?: Phaser.Types.Tilemaps.TilemapConfig): Phaser.Tilemaps.Tilemap; + + /** + * Creates a new Tween object and returns it. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * @param config The Tween configuration. + */ + tween(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; + + } + + /** + * The Game Object Factory is a Scene plugin that allows you to quickly create many common + * types of Game Objects and have them automatically registered with the Scene. + * + * Game Objects directly register themselves with the Factory and inject their own creation + * methods into the class. + */ + class GameObjectFactory { + /** + * + * @param scene The Scene to which this Game Object Factory belongs. + */ + constructor(scene: Phaser.Scene); + + /** + * Creates a new Path Object. + * @param x The horizontal position of this Path. + * @param y The vertical position of this Path. + */ + path(x: number, y: number): Phaser.Curves.Path; + + /** + * Creates a new Dynamic Bitmap Text Game Object and adds it to the Scene. + * + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * Dynamic Bitmap Text objects are different from Static Bitmap Text in that they invoke a callback for each + * letter being rendered during the render pass. This callback allows you to manipulate the properties of + * each letter being rendered, such as its position, scale or tint, allowing you to create interesting effects + * like jiggling text, which can't be done with Static text. This means that Dynamic Text takes more processing + * time, so only use them if you require the callback ability they have. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + * + * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser. + * @param x The x position of the Game Object. + * @param y The y position of the Game Object. + * @param font The key of the font to use from the BitmapFont cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size to set. + */ + dynamicBitmapText(x: number, y: number, font: string, text?: string | string[], size?: number): Phaser.GameObjects.DynamicBitmapText; + + /** + * Creates a new Bitmap Text Game Object and adds it to the Scene. + * + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + * + * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser. + * @param x The x position of the Game Object. + * @param y The y position of the Game Object. + * @param font The key of the font to use from the BitmapFont cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size to set. + * @param align The alignment of the text in a multi-line BitmapText object. Default 0. + */ + bitmapText(x: number, y: number, font: string, text?: string | string[], size?: number, align?: integer): Phaser.GameObjects.BitmapText; + + /** + * Creates a new Blitter Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Blitter Game Object has been built into Phaser. + * @param x The x position of the Game Object. + * @param y The y position of the Game Object. + * @param key The key of the Texture the Blitter object will use. + * @param frame The default Frame children of the Blitter will use. + */ + blitter(x: number, y: number, key: string, frame?: string | integer): Phaser.GameObjects.Blitter; + + /** + * Creates a new Container Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Container Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param children An optional array of Game Objects to add to this Container. + */ + container(x: number, y: number, children?: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.GameObjects.Container; + + /** + * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. + * + * In order for DOM Elements to display you have to enable them by adding the following to your game + * configuration object: + * + * ```javascript + * dom { + * createContainer: true + * } + * ``` + * + * When this is added, Phaser will automatically create a DOM Container div that is positioned over the top + * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of + * settings within the Scale Manager, the dom container is resized accordingly. + * + * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing + * Element that you wish to be placed under the control of Phaser. For example: + * + * ```javascript + * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in + * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case, + * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font. + * + * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control + * alignment and positioning of the elements next to regular game content. + * + * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the + * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other + * methods available in this class to help construct your elements. + * + * Once the element has been created you can then control it like you would any other Game Object. You can set its + * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped + * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that + * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have + * a DOM Element, then a Sprite, then another DOM Element behind it. + * + * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event + * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas + * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you + * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly. + * + * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in. + * + * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert + * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table. + * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and + * UI. The choice is up to you, just remember that you're dealing with standard HTML and CSS floating over the top + * of your game, and should treat it accordingly. + * + * Note: This method will only be available if the DOM Element Game Object has been built into Phaser. + * @param x The horizontal position of this DOM Element in the world. + * @param y The vertical position of this DOM Element in the world. + * @param element An existing DOM element, or a string. If a string starting with a # it will do a `getElementById` look-up on the string (minus the hash). Without a hash, it represents the type of element to create, i.e. 'div'. + * @param style If a string, will be set directly as the elements `style` property value. If a plain object, will be iterated and the values transferred. In both cases the values replacing whatever CSS styles may have been previously set. + * @param innerText If given, will be set directly as the elements `innerText` property value, replacing whatever was there before. + */ + dom(x: number, y: number, element?: HTMLElement | string, style?: string | any, innerText?: string): Phaser.GameObjects.DOMElement; + + /** + * Creates a new Extern Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Extern Game Object has been built into Phaser. + */ + extern(): Phaser.GameObjects.Extern; + + /** + * The Scene to which this Game Object Factory belongs. + */ + protected scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems. + */ + protected systems: Phaser.Scenes.Systems; + + /** + * A reference to the Scene Display List. + */ + protected displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene Update List. + */ + protected "updateList;": Phaser.GameObjects.UpdateList; + + /** + * Adds an existing Game Object to this Scene. + * + * If the Game Object renders, it will be added to the Display List. + * If it has a `preUpdate` method, it will be added to the Update List. + * @param child The child to be added to this Scene. + */ + existing(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.GameObject; + + /** + * Creates a new Graphics Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Graphics Game Object has been built into Phaser. + * @param config The Graphics configuration. + */ + graphics(config?: Phaser.Types.GameObjects.Graphics.Options): Phaser.GameObjects.Graphics; + + /** + * Creates a new Group Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Group Game Object has been built into Phaser. + * @param children Game Objects to add to this Group; or the `config` argument. + * @param config A Group Configuration object. + */ + group(children?: Phaser.GameObjects.GameObject[] | Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupConfig[], config?: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.GameObjects.Group; + + /** + * Creates a new Image Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Image Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + image(x: number, y: number, texture: string, frame?: string | integer): Phaser.GameObjects.Image; + + /** + * Creates a new Mesh Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param vertices An array containing the vertices data for this Mesh. + * @param uv An array containing the uv data for this Mesh. + * @param colors An array containing the color data for this Mesh. + * @param alphas An array containing the alpha data for this Mesh. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + mesh(x: number, y: number, vertices: number[], uv: number[], colors: number[], alphas: number[], texture: string, frame?: string | integer): Phaser.GameObjects.Mesh; + + /** + * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Particles Game Object has been built into Phaser. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param emitters Configuration settings for one or more emitters to create. + */ + particles(texture: string, frame?: string | integer | object, emitters?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Creates a new PathFollower Game Object and adds it to the Scene. + * + * Note: This method will only be available if the PathFollower Game Object has been built into Phaser. + * @param path The Path this PathFollower is connected to. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + follower(path: Phaser.Curves.Path, x: number, y: number, texture: string, frame?: string | integer): Phaser.GameObjects.PathFollower; + + /** + * Creates a new Quad Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + quad(x: number, y: number, texture: string, frame?: string | integer): Phaser.GameObjects.Quad; + + /** + * Creates a new Render Texture Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. + * + * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and + * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic + * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Render Texture. Default 32. + * @param height The height of the Render Texture. Default 32. + */ + renderTexture(x: number, y: number, width?: integer, height?: integer): Phaser.GameObjects.RenderTexture; + + /** + * Creates a new Shader Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser. + * @param key The key of the shader to use from the shader cache, or a BaseShader instance. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the Game Object. Default 128. + * @param height The height of the Game Object. Default 128. + * @param textures Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. + */ + shader(key: string | Phaser.Display.BaseShader, x?: number, y?: number, width?: number, height?: number, textures?: string[]): Phaser.GameObjects.Shader; + + /** + * Creates a new Arc Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Arc Game Object has been built into Phaser. + * + * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an arc shape. You can control the start and end angles of the arc, + * as well as if the angles are winding clockwise or anti-clockwise. With the default settings + * it renders as a complete circle. By changing the angles you can create other arc shapes, + * such as half-circles. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param radius The radius of the arc. Default 128. + * @param startAngle The start angle of the arc, in degrees. Default 0. + * @param endAngle The end angle of the arc, in degrees. Default 360. + * @param anticlockwise The winding order of the start and end angles. Default false. + * @param fillColor The color the arc will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + arc(x?: number, y?: number, radius?: number, startAngle?: integer, endAngle?: integer, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; + + /** + * Creates a new Circle Shape Game Object and adds it to the Scene. + * + * A Circle is an Arc with no defined start and end angle, making it render as a complete circle. + * + * Note: This method will only be available if the Arc Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param radius The radius of the circle. Default 128. + * @param fillColor The color the circle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the circle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + circle(x?: number, y?: number, radius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; + + /** + * Creates a new Curve Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Curve Game Object has been built into Phaser. + * + * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to + * the Curve Shape in the constructor. + * + * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param curve The Curve object to use to create the Shape. + * @param fillColor The color the curve will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the curve will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + curve(x?: number, y?: number, curve?: Phaser.Curves.Curve, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Curve; + + /** + * Creates a new Ellipse Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Ellipse Game Object has been built into Phaser. + * + * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. + * If the width and height match it will render as a circle. If the width is less than the height, + * it will look more like an egg shape. + * + * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. + * @param height The height of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. + * @param fillColor The color the ellipse will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + ellipse(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Ellipse; + + /** + * Creates a new Grid Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Grid Game Object has been built into Phaser. + * + * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * A Grid Shape allows you to display a grid in your game, where you can control the size of the + * grid as well as the width and height of the grid cells. You can set a fill color for each grid + * cell as well as an alternate fill color. When the alternate fill color is set then the grid + * cells will alternate the fill colors as they render, creating a chess-board effect. You can + * also optionally have an outline fill color. If set, this draws lines between the grid cells + * in the given color. If you specify an outline color with an alpha of zero, then it will draw + * the cells spaced out, but without the lines between them. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the grid. Default 128. + * @param height The height of the grid. Default 128. + * @param cellWidth The width of one cell in the grid. Default 32. + * @param cellHeight The height of one cell in the grid. Default 32. + * @param fillColor The color the grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * @param outlineFillColor The color of the lines between the grid cells. + * @param outlineFillAlpha The alpha of the lines between the grid cells. + */ + grid(x?: number, y?: number, width?: number, height?: number, cellWidth?: number, cellHeight?: number, fillColor?: number, fillAlpha?: number, outlineFillColor?: number, outlineFillAlpha?: number): Phaser.GameObjects.Grid; + + /** + * Creates a new IsoBox Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the IsoBox Game Object has been built into Phaser. + * + * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set + * the color of the top, left and right faces of the rectangle respectively. You can also choose + * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting + * the `projection` property. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param size The width of the iso box in pixels. The left and right faces will be exactly half this value. Default 48. + * @param height The height of the iso box. The left and right faces will be this tall. The overall height of the isobox will be this value plus half the `size` value. Default 32. + * @param fillTop The fill color of the top face of the iso box. Default 0xeeeeee. + * @param fillLeft The fill color of the left face of the iso box. Default 0x999999. + * @param fillRight The fill color of the right face of the iso box. Default 0xcccccc. + */ + isobox(x?: number, y?: number, size?: number, height?: number, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoBox; + + /** + * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the IsoTriangle Game Object has been built into Phaser. + * + * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different + * fill color. You can set the color of the top, left and right faces of the triangle respectively + * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting + * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside + * down or not. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param size The width of the iso triangle in pixels. The left and right faces will be exactly half this value. Default 48. + * @param height The height of the iso triangle. The left and right faces will be this tall. The overall height of the iso triangle will be this value plus half the `size` value. Default 32. + * @param reversed Is the iso triangle upside down? Default false. + * @param fillTop The fill color of the top face of the iso triangle. Default 0xeeeeee. + * @param fillLeft The fill color of the left face of the iso triangle. Default 0x999999. + * @param fillRight The fill color of the right face of the iso triangle. Default 0xcccccc. + */ + isotriangle(x?: number, y?: number, size?: number, height?: number, reversed?: boolean, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoTriangle; + + /** + * Creates a new Line Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Line Game Object has been built into Phaser. + * + * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only stroke colors and cannot be filled. + * + * A Line Shape allows you to draw a line between two points in your game. You can control the + * stroke color and thickness of the line. In WebGL only you can also specify a different + * thickness for the start and end of the line, allowing you to render lines that taper-off. + * + * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the start of the line. Default 0. + * @param y1 The vertical position of the start of the line. Default 0. + * @param x2 The horizontal position of the end of the line. Default 128. + * @param y2 The vertical position of the end of the line. Default 0. + * @param strokeColor The color the line will be drawn in, i.e. 0xff0000 for red. + * @param strokeAlpha The alpha the line will be drawn in. You can also set the alpha of the overall Shape using its `alpha` property. + */ + line(x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, strokeColor?: number, strokeAlpha?: number): Phaser.GameObjects.Line; + + /** + * Creates a new Polygon Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Polygon Game Object has been built into Phaser. + * + * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Polygon Shape is created by providing a list of points, which are then used to create an + * internal Polygon geometry object. The points can be set from a variety of formats: + * + * - An array of Point or Vector2 objects: `[new Phaser.Math.Vec2(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending + * on the coordinates of the points provided, the final shape may be rendered offset from its origin. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The points that make up the polygon. + * @param fillColor The color the polygon will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the polygon will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + polygon(x?: number, y?: number, points?: any, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Polygon; + + /** + * Creates a new Rectangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Rectangle Game Object has been built into Phaser. + * + * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * You can change the size of the rectangle by changing the `width` and `height` properties. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the rectangle. Default 128. + * @param height The height of the rectangle. Default 128. + * @param fillColor The color the rectangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the rectangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + rectangle(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Rectangle; + + /** + * Creates a new Star Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Star Game Object has been built into Phaser. + * + * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * As the name implies, the Star shape will display a star in your game. You can control several + * aspects of it including the number of points that constitute the star. The default is 5. If + * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky + * star shape. + * + * You can also control the inner and outer radius, which is how 'long' each point of the star is. + * Modify these values to create more interesting shapes. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The number of points on the star. Default 5. + * @param innerRadius The inner radius of the star. Default 32. + * @param outerRadius The outer radius of the star. Default 64. + * @param fillColor The color the star will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + star(x?: number, y?: number, points?: number, innerRadius?: number, outerRadius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Star; + + /** + * Creates a new Triangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Triangle Game Object has been built into Phaser. + * + * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the + * position of each point of these lines. The triangle is always closed and cannot have an open + * face. If you require that, consider using a Polygon instead. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the first point in the triangle. Default 0. + * @param y1 The vertical position of the first point in the triangle. Default 128. + * @param x2 The horizontal position of the second point in the triangle. Default 64. + * @param y2 The vertical position of the second point in the triangle. Default 0. + * @param x3 The horizontal position of the third point in the triangle. Default 128. + * @param y3 The vertical position of the third point in the triangle. Default 128. + * @param fillColor The color the triangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + triangle(x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Triangle; + + /** + * Creates a new Sprite Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Sprite Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + sprite(x: number, y: number, texture: string, frame?: string | integer): Phaser.GameObjects.Sprite; + + /** + * Creates a new Text Game Object and adds it to the Scene. + * + * A Text Game Object. + * + * Text objects work by creating their own internal hidden Canvas and then renders text to it using + * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered + * to your game during the render pass. + * + * Because it uses the Canvas API you can take advantage of all the features this offers, such as + * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts + * loaded externally, such as Google or TypeKit Web fonts. + * + * You can only display fonts that are currently loaded and available to the browser: therefore fonts must + * be pre-loaded. Phaser does not do ths for you, so you will require the use of a 3rd party font loader, + * or have the fonts ready available in the CSS on the page in which your Phaser game resides. + * + * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts + * across mobile browsers. + * + * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being + * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the + * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of + * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text + * instead, as it benefits from batching and avoids expensive Canvas API calls. + * + * Note: This method will only be available if the Text Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param text The text this Text object will display. + * @param style The Text style configuration object. + */ + text(x: number, y: number, text: string | string[], style?: object): Phaser.GameObjects.Text; + + /** + * Creates a new TileSprite Game Object and adds it to the Scene. + * + * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. If zero it will use the size of the texture frame. + * @param height The height of the Game Object. If zero it will use the size of the texture frame. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + tileSprite(x: number, y: number, width: integer, height: integer, texture: string, frame?: string | integer): Phaser.GameObjects.TileSprite; + + /** + * Creates a new Zone Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Zone Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. + * @param height The height of the Game Object. + */ + zone(x: number, y: number, width: number, height: number): Phaser.GameObjects.Zone; + + /** + * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. + * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing + * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map + * data. For an empty map, you should specify tileWidth, tileHeight, width & height. + * @param key The key in the Phaser cache that corresponds to the loaded tilemap data. + * @param tileWidth The width of a tile in pixels. Pass in `null` to leave as the + * default. Default 32. + * @param tileHeight The height of a tile in pixels. Pass in `null` to leave as the + * default. Default 32. + * @param width The width of the map in tiles. Pass in `null` to leave as the + * default. Default 10. + * @param height The height of the map in tiles. Pass in `null` to leave as the + * default. Default 10. + * @param data Instead of loading from the cache, you can also load directly from + * a 2D array of tile indexes. Pass in `null` for no data. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the + * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. Default false. + */ + tilemap(key?: string, tileWidth?: integer, tileHeight?: integer, width?: integer, height?: integer, data?: integer[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; + + /** + * Creates a new Tween object. + * + * Note: This method will only be available Tweens have been built into Phaser. + * @param config The Tween configuration. + */ + tween(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; + + } + + /** + * A Graphics object is a way to draw primitive shapes to your game. Primitives include forms of geometry, such as + * Rectangles, Circles, and Polygons. They also include lines, arcs and curves. When you initially create a Graphics + * object it will be empty. + * + * To draw to it you must first specify a line style or fill style (or both), draw shapes using paths, and finally + * fill or stroke them. For example: + * + * ```javascript + * graphics.lineStyle(5, 0xFF00FF, 1.0); + * graphics.beginPath(); + * graphics.moveTo(100, 100); + * graphics.lineTo(200, 200); + * graphics.closePath(); + * graphics.strokePath(); + * ``` + * + * There are also many helpful methods that draw and fill/stroke common shapes for you. + * + * ```javascript + * graphics.lineStyle(5, 0xFF00FF, 1.0); + * graphics.fillStyle(0xFFFFFF, 1.0); + * graphics.fillRect(50, 50, 400, 200); + * graphics.strokeRect(50, 50, 400, 200); + * ``` + * + * When a Graphics object is rendered it will render differently based on if the game is running under Canvas or WebGL. + * Under Canvas it will use the HTML Canvas context drawing operations to draw the path. + * Under WebGL the graphics data is decomposed into polygons. Both of these are expensive processes, especially with + * complex shapes. + * + * If your Graphics object doesn't change much (or at all) once you've drawn your shape to it, then you will help + * performance by calling {@link Phaser.GameObjects.Graphics#generateTexture}. This will 'bake' the Graphics object into + * a Texture, and return it. You can then use this Texture for Sprites or other display objects. If your Graphics object + * updates frequently then you should avoid doing this, as it will constantly generate new textures, which will consume + * memory. + * + * As you can tell, Graphics objects are a bit of a trade-off. While they are extremely useful, you need to be careful + * in their complexity and quantity of them in your game. + */ + class Graphics extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { + /** + * + * @param scene The Scene to which this Graphics object belongs. + * @param options Options that set the position and default style of this Graphics object. + */ + constructor(scene: Phaser.Scene, options?: Phaser.Types.GameObjects.Graphics.Options); + + /** + * The horizontal display origin of the Graphics. + */ + displayOriginX: number; + + /** + * The vertical display origin of the Graphics. + */ + displayOriginY: number; + + /** + * The array of commands used to render the Graphics. + */ + commandBuffer: any[]; + + /** + * The default fill color for shapes rendered by this Graphics object. + */ + defaultFillColor: number; + + /** + * The default fill alpha for shapes rendered by this Graphics object. + */ + defaultFillAlpha: number; + + /** + * The default stroke width for shapes rendered by this Graphics object. + */ + defaultStrokeWidth: number; + + /** + * The default stroke color for shapes rendered by this Graphics object. + */ + defaultStrokeColor: number; + + /** + * The default stroke alpha for shapes rendered by this Graphics object. + */ + defaultStrokeAlpha: number; + + /** + * Set the default style settings for this Graphics object. + * @param options The styles to set as defaults. + */ + setDefaultStyles(options: Phaser.Types.GameObjects.Graphics.Styles): Phaser.GameObjects.Graphics; + + /** + * Set the current line style. + * @param lineWidth The stroke width. + * @param color The stroke color. + * @param alpha The stroke alpha. Default 1. + */ + lineStyle(lineWidth: number, color: number, alpha?: number): Phaser.GameObjects.Graphics; + + /** + * Set the current fill style. + * @param color The fill color. + * @param alpha The fill alpha. Default 1. + */ + fillStyle(color: number, alpha?: number): Phaser.GameObjects.Graphics; + + /** + * Sets a gradient fill style. This is a WebGL only feature. + * + * The gradient color values represent the 4 corners of an untransformed rectangle. + * The gradient is used to color all filled shapes and paths drawn after calling this method. + * If you wish to turn a gradient off, call `fillStyle` and provide a new single fill color. + * + * When filling a triangle only the first 3 color values provided are used for the 3 points of a triangle. + * + * This feature is best used only on rectangles and triangles. All other shapes will give strange results. + * + * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used + * will be filled with a gradient on its own. There is no ability to gradient fill a shape or path as a single + * entity at this time. + * @param topLeft The tint being applied to the top-left of the Game Object. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + * @param alpha The fill alpha. Default 1. + */ + fillGradientStyle(topLeft: integer, topRight: integer, bottomLeft: integer, bottomRight: integer, alpha?: number): Phaser.GameObjects.Graphics; + + /** + * Sets a gradient line style. This is a WebGL only feature. + * + * The gradient color values represent the 4 corners of an untransformed rectangle. + * The gradient is used to color all stroked shapes and paths drawn after calling this method. + * If you wish to turn a gradient off, call `lineStyle` and provide a new single line color. + * + * This feature is best used only on single lines. All other shapes will give strange results. + * + * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used + * will be filled with a gradient on its own. There is no ability to gradient stroke a shape or path as a single + * entity at this time. + * @param lineWidth The stroke width. + * @param topLeft The tint being applied to the top-left of the Game Object. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + * @param alpha The fill alpha. Default 1. + */ + lineGradientStyle(lineWidth: number, topLeft: integer, topRight: integer, bottomLeft: integer, bottomRight: integer, alpha?: number): Phaser.GameObjects.Graphics; + + /** + * Sets the texture frame this Graphics Object will use when drawing all shapes defined after calling this. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * Once set, all shapes will use this texture. Call this method with no arguments to clear it. + * + * The textures are not tiled. They are stretched to the dimensions of the shapes being rendered. For this reason, + * it works best with seamless / tileable textures. + * + * The mode argument controls how the textures are combined with the fill colors. The default value (0) will + * multiply the texture by the fill color. A value of 1 will use just the fill color, but the alpha data from the texture, + * and a value of 2 will use just the texture and no fill color at all. + * @param key The key of the texture to be used, as stored in the Texture Manager. Leave blank to clear a previously set texture. + * @param frame The name or index of the frame within the Texture. + * @param mode The texture tint mode. 0 is multiply, 1 is alpha only and 2 is texture only. Default 0. + */ + setTexture(key?: string, frame?: string | integer, mode?: number): this; + + /** + * Start a new shape path. + */ + beginPath(): Phaser.GameObjects.Graphics; + + /** + * Close the current path. + */ + closePath(): Phaser.GameObjects.Graphics; + + /** + * Fill the current path. + */ + fillPath(): Phaser.GameObjects.Graphics; + + /** + * Fill the current path. + * + * This is an alias for `Graphics.fillPath` and does the same thing. + * It was added to match the CanvasRenderingContext 2D API. + */ + fill(): Phaser.GameObjects.Graphics; + + /** + * Stroke the current path. + */ + strokePath(): Phaser.GameObjects.Graphics; + + /** + * Stroke the current path. + * + * This is an alias for `Graphics.strokePath` and does the same thing. + * It was added to match the CanvasRenderingContext 2D API. + */ + stroke(): Phaser.GameObjects.Graphics; + + /** + * Fill the given circle. + * @param circle The circle to fill. + */ + fillCircleShape(circle: Phaser.Geom.Circle): Phaser.GameObjects.Graphics; + + /** + * Stroke the given circle. + * @param circle The circle to stroke. + */ + strokeCircleShape(circle: Phaser.Geom.Circle): Phaser.GameObjects.Graphics; + + /** + * Fill a circle with the given position and radius. + * @param x The x coordinate of the center of the circle. + * @param y The y coordinate of the center of the circle. + * @param radius The radius of the circle. + */ + fillCircle(x: number, y: number, radius: number): Phaser.GameObjects.Graphics; + + /** + * Stroke a circle with the given position and radius. + * @param x The x coordinate of the center of the circle. + * @param y The y coordinate of the center of the circle. + * @param radius The radius of the circle. + */ + strokeCircle(x: number, y: number, radius: number): Phaser.GameObjects.Graphics; + + /** + * Fill the given rectangle. + * @param rect The rectangle to fill. + */ + fillRectShape(rect: Phaser.Geom.Rectangle): Phaser.GameObjects.Graphics; + + /** + * Stroke the given rectangle. + * @param rect The rectangle to stroke. + */ + strokeRectShape(rect: Phaser.Geom.Rectangle): Phaser.GameObjects.Graphics; + + /** + * Fill a rectangle with the given position and size. + * @param x The x coordinate of the top-left of the rectangle. + * @param y The y coordinate of the top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + */ + fillRect(x: number, y: number, width: number, height: number): Phaser.GameObjects.Graphics; + + /** + * Stroke a rectangle with the given position and size. + * @param x The x coordinate of the top-left of the rectangle. + * @param y The y coordinate of the top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + */ + strokeRect(x: number, y: number, width: number, height: number): Phaser.GameObjects.Graphics; + + /** + * Fill a rounded rectangle with the given position, size and radius. + * @param x The x coordinate of the top-left of the rectangle. + * @param y The y coordinate of the top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param radius The corner radius; It can also be an object to specify different radii for corners. Default 20. + */ + fillRoundedRect(x: number, y: number, width: number, height: number, radius?: Phaser.Types.GameObjects.Graphics.RoundedRectRadius | number): Phaser.GameObjects.Graphics; + + /** + * Stroke a rounded rectangle with the given position, size and radius. + * @param x The x coordinate of the top-left of the rectangle. + * @param y The y coordinate of the top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param radius The corner radius; It can also be an object to specify different radii for corners. Default 20. + */ + strokeRoundedRect(x: number, y: number, width: number, height: number, radius?: Phaser.Types.GameObjects.Graphics.RoundedRectRadius | number): Phaser.GameObjects.Graphics; + + /** + * Fill the given point. + * + * Draws a square at the given position, 1 pixel in size by default. + * @param point The point to fill. + * @param size The size of the square to draw. Default 1. + */ + fillPointShape(point: Phaser.Geom.Point | Phaser.Math.Vector2 | object, size?: number): Phaser.GameObjects.Graphics; + + /** + * Fill a point at the given position. + * + * Draws a square at the given position, 1 pixel in size by default. + * @param x The x coordinate of the point. + * @param y The y coordinate of the point. + * @param size The size of the square to draw. Default 1. + */ + fillPoint(x: number, y: number, size?: number): Phaser.GameObjects.Graphics; + + /** + * Fill the given triangle. + * @param triangle The triangle to fill. + */ + fillTriangleShape(triangle: Phaser.Geom.Triangle): Phaser.GameObjects.Graphics; + + /** + * Stroke the given triangle. + * @param triangle The triangle to stroke. + */ + strokeTriangleShape(triangle: Phaser.Geom.Triangle): Phaser.GameObjects.Graphics; + + /** + * Fill a triangle with the given points. + * @param x0 The x coordinate of the first point. + * @param y0 The y coordinate of the first point. + * @param x1 The x coordinate of the second point. + * @param y1 The y coordinate of the second point. + * @param x2 The x coordinate of the third point. + * @param y2 The y coordinate of the third point. + */ + fillTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number): Phaser.GameObjects.Graphics; + + /** + * Stroke a triangle with the given points. + * @param x0 The x coordinate of the first point. + * @param y0 The y coordinate of the first point. + * @param x1 The x coordinate of the second point. + * @param y1 The y coordinate of the second point. + * @param x2 The x coordinate of the third point. + * @param y2 The y coordinate of the third point. + */ + strokeTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number): Phaser.GameObjects.Graphics; + + /** + * Draw the given line. + * @param line The line to stroke. + */ + strokeLineShape(line: Phaser.Geom.Line): Phaser.GameObjects.Graphics; + + /** + * Draw a line between the given points. + * @param x1 The x coordinate of the start point of the line. + * @param y1 The y coordinate of the start point of the line. + * @param x2 The x coordinate of the end point of the line. + * @param y2 The y coordinate of the end point of the line. + */ + lineBetween(x1: number, y1: number, x2: number, y2: number): Phaser.GameObjects.Graphics; + + /** + * Draw a line from the current drawing position to the given position. + * + * Moves the current drawing position to the given position. + * @param x The x coordinate to draw the line to. + * @param y The y coordinate to draw the line to. + */ + lineTo(x: number, y: number): Phaser.GameObjects.Graphics; + + /** + * Move the current drawing position to the given position. + * @param x The x coordinate to move to. + * @param y The y coordinate to move to. + */ + moveTo(x: number, y: number): Phaser.GameObjects.Graphics; + + /** + * Stroke the shape represented by the given array of points. + * + * Pass `closeShape` to automatically close the shape by joining the last to the first point. + * + * Pass `closePath` to automatically close the path before it is stroked. + * @param points The points to stroke. + * @param closeShape When `true`, the shape is closed by joining the last point to the first point. Default false. + * @param closePath When `true`, the path is closed before being stroked. Default false. + * @param endIndex The index of `points` to stop drawing at. Defaults to `points.length`. + */ + strokePoints(points: any[] | Phaser.Geom.Point[], closeShape?: boolean, closePath?: boolean, endIndex?: integer): Phaser.GameObjects.Graphics; + + /** + * Fill the shape represented by the given array of points. + * + * Pass `closeShape` to automatically close the shape by joining the last to the first point. + * + * Pass `closePath` to automatically close the path before it is filled. + * @param points The points to fill. + * @param closeShape When `true`, the shape is closed by joining the last point to the first point. Default false. + * @param closePath When `true`, the path is closed before being stroked. Default false. + * @param endIndex The index of `points` to stop at. Defaults to `points.length`. + */ + fillPoints(points: any[] | Phaser.Geom.Point[], closeShape?: boolean, closePath?: boolean, endIndex?: integer): Phaser.GameObjects.Graphics; + + /** + * Stroke the given ellipse. + * @param ellipse The ellipse to stroke. + * @param smoothness The number of points to draw the ellipse with. Default 32. + */ + strokeEllipseShape(ellipse: Phaser.Geom.Ellipse, smoothness?: integer): Phaser.GameObjects.Graphics; + + /** + * Stroke an ellipse with the given position and size. + * @param x The x coordinate of the center of the ellipse. + * @param y The y coordinate of the center of the ellipse. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + * @param smoothness The number of points to draw the ellipse with. Default 32. + */ + strokeEllipse(x: number, y: number, width: number, height: number, smoothness?: integer): Phaser.GameObjects.Graphics; + + /** + * Fill the given ellipse. + * @param ellipse The ellipse to fill. + * @param smoothness The number of points to draw the ellipse with. Default 32. + */ + fillEllipseShape(ellipse: Phaser.Geom.Ellipse, smoothness?: integer): Phaser.GameObjects.Graphics; + + /** + * Fill an ellipse with the given position and size. + * @param x The x coordinate of the center of the ellipse. + * @param y The y coordinate of the center of the ellipse. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + * @param smoothness The number of points to draw the ellipse with. Default 32. + */ + fillEllipse(x: number, y: number, width: number, height: number, smoothness?: integer): Phaser.GameObjects.Graphics; + + /** + * Draw an arc. + * + * This method can be used to create circles, or parts of circles. + * + * Make sure you call `beginPath` before starting the arc unless you wish for the arc to automatically + * close when filled or stroked. + * + * Use the optional `overshoot` argument increase the number of iterations that take place when + * the arc is rendered in WebGL. This is useful if you're drawing an arc with an especially thick line, + * as it will allow the arc to fully join-up. Try small values at first, i.e. 0.01. + * + * Call {@link Phaser.GameObjects.Graphics#fillPath} or {@link Phaser.GameObjects.Graphics#strokePath} after calling + * this method to draw the arc. + * @param x The x coordinate of the center of the circle. + * @param y The y coordinate of the center of the circle. + * @param radius The radius of the circle. + * @param startAngle The starting angle, in radians. + * @param endAngle The ending angle, in radians. + * @param anticlockwise Whether the drawing should be anticlockwise or clockwise. Default false. + * @param overshoot This value allows you to increase the segment iterations in WebGL rendering. Useful if the arc has a thick stroke and needs to overshoot to join-up cleanly. Use small numbers such as 0.01 to start with and increase as needed. Default 0. + */ + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean, overshoot?: number): Phaser.GameObjects.Graphics; + + /** + * Creates a pie-chart slice shape centered at `x`, `y` with the given radius. + * You must define the start and end angle of the slice. + * + * Setting the `anticlockwise` argument to `true` creates a shape similar to Pacman. + * Setting it to `false` creates a shape like a slice of pie. + * + * This method will begin a new path and close the path at the end of it. + * To display the actual slice you need to call either `strokePath` or `fillPath` after it. + * @param x The horizontal center of the slice. + * @param y The vertical center of the slice. + * @param radius The radius of the slice. + * @param startAngle The start angle of the slice, given in radians. + * @param endAngle The end angle of the slice, given in radians. + * @param anticlockwise Whether the drawing should be anticlockwise or clockwise. Default false. + * @param overshoot This value allows you to overshoot the endAngle by this amount. Useful if the arc has a thick stroke and needs to overshoot to join-up cleanly. Default 0. + */ + slice(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean, overshoot?: number): Phaser.GameObjects.Graphics; + + /** + * Saves the state of the Graphics by pushing the current state onto a stack. + * + * The most recently saved state can then be restored with {@link Phaser.GameObjects.Graphics#restore}. + */ + save(): Phaser.GameObjects.Graphics; + + /** + * Restores the most recently saved state of the Graphics by popping from the state stack. + * + * Use {@link Phaser.GameObjects.Graphics#save} to save the current state, and call this afterwards to restore that state. + * + * If there is no saved state, this command does nothing. + */ + restore(): Phaser.GameObjects.Graphics; + + /** + * Inserts a translation command into this Graphics objects command buffer. + * + * All objects drawn _after_ calling this method will be translated + * by the given amount. + * + * This does not change the position of the Graphics object itself, + * only of the objects drawn by it after calling this method. + * @param x The horizontal translation to apply. + * @param y The vertical translation to apply. + */ + translateCanvas(x: number, y: number): Phaser.GameObjects.Graphics; + + /** + * Inserts a scale command into this Graphics objects command buffer. + * + * All objects drawn _after_ calling this method will be scaled + * by the given amount. + * + * This does not change the scale of the Graphics object itself, + * only of the objects drawn by it after calling this method. + * @param x The horizontal scale to apply. + * @param y The vertical scale to apply. + */ + scaleCanvas(x: number, y: number): Phaser.GameObjects.Graphics; + + /** + * Inserts a rotation command into this Graphics objects command buffer. + * + * All objects drawn _after_ calling this method will be rotated + * by the given amount. + * + * This does not change the rotation of the Graphics object itself, + * only of the objects drawn by it after calling this method. + * @param radians The rotation angle, in radians. + */ + rotateCanvas(radians: number): Phaser.GameObjects.Graphics; + + /** + * Clear the command buffer and reset the fill style and line style to their defaults. + */ + clear(): Phaser.GameObjects.Graphics; + + /** + * Generate a texture from this Graphics object. + * + * If `key` is a string it'll generate a new texture using it and add it into the + * Texture Manager (assuming no key conflict happens). + * + * If `key` is a Canvas it will draw the texture to that canvas context. Note that it will NOT + * automatically upload it to the GPU in WebGL mode. + * @param key The key to store the texture with in the Texture Manager, or a Canvas to draw to. + * @param width The width of the graphics to generate. + * @param height The height of the graphics to generate. + */ + generateTexture(key: string | HTMLCanvasElement, width?: integer, height?: integer): Phaser.GameObjects.Graphics; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * A Camera used specifically by the Graphics system for rendering to textures. + */ + static TargetCamera: Phaser.Cameras.Scene2D.Camera; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + } + + /** + * A Group is a way for you to create, manipulate, or recycle similar Game Objects. + * + * Group membership is non-exclusive. A Game Object can belong to several groups, one group, or none. + * + * Groups themselves aren't displayable, and can't be positioned, rotated, scaled, or hidden. + */ + class Group { + /** + * + * @param scene The scene this group belongs to. + * @param children Game Objects to add to this group; or the `config` argument. + * @param config Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings. + */ + constructor(scene: Phaser.Scene, children?: Phaser.GameObjects.GameObject[] | Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig); + + /** + * This scene this group belongs to. + */ + scene: Phaser.Scene; + + /** + * Members of this group. + */ + children: Phaser.Structs.Set; + + /** + * A flag identifying this object as a group. + */ + isParent: boolean; + + /** + * The class to create new group members from. + */ + classType: Function; + + /** + * The name of this group. + * Empty by default and never populated by Phaser, this is left for developers to use. + */ + name: string; + + /** + * Whether this group runs its {@link Phaser.GameObjects.Group#preUpdate} method + * (which may update any members). + */ + active: boolean; + + /** + * The maximum size of this group, if used as a pool. -1 is no limit. + */ + maxSize: integer; + + /** + * A default texture key to use when creating new group members. + * + * This is used in {@link Phaser.GameObjects.Group#create} + * but not in {@link Phaser.GameObjects.Group#createMultiple}. + */ + defaultKey: string; + + /** + * A default texture frame to use when creating new group members. + */ + defaultFrame: string | integer; + + /** + * Whether to call the update method of any members. + */ + runChildUpdate: boolean; + + /** + * A function to be called when adding or creating group members. + */ + createCallback: Phaser.Types.GameObjects.Group.GroupCallback; + + /** + * A function to be called when removing group members. + */ + removeCallback: Phaser.Types.GameObjects.Group.GroupCallback; + + /** + * A function to be called when creating several group members at once. + */ + createMultipleCallback: Phaser.Types.GameObjects.Group.GroupMultipleCreateCallback; + + /** + * Creates a new Game Object and adds it to this group, unless the group {@link Phaser.GameObjects.Group#isFull is full}. + * + * Calls {@link Phaser.GameObjects.Group#createCallback}. + * @param x The horizontal position of the new Game Object in the world. Default 0. + * @param y The vertical position of the new Game Object in the world. Default 0. + * @param key The texture key of the new Game Object. Default defaultKey. + * @param frame The texture frame of the new Game Object. Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of the new Game Object. Default true. + * @param active The {@link Phaser.GameObjects.GameObject#active} state of the new Game Object. Default true. + */ + create(x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean, active?: boolean): any; + + /** + * Creates several Game Objects and adds them to this group. + * + * If the group becomes {@link Phaser.GameObjects.Group#isFull}, no further Game Objects are created. + * + * Calls {@link Phaser.GameObjects.Group#createMultipleCallback} and {@link Phaser.GameObjects.Group#createCallback}. + * @param config Creation settings. This can be a single configuration object or an array of such objects, which will be applied in turn. + */ + createMultiple(config: Phaser.Types.GameObjects.Group.GroupCreateConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig[]): any[]; + + /** + * A helper for {@link Phaser.GameObjects.Group#createMultiple}. + * @param options Creation settings. + */ + createFromConfig(options: Phaser.Types.GameObjects.Group.GroupCreateConfig): any[]; + + /** + * Updates any group members, if {@link Phaser.GameObjects.Group#runChildUpdate} is enabled. + * @param time The current timestamp. + * @param delta The delta time elapsed since the last frame. + */ + preUpdate(time: number, delta: number): void; + + /** + * Adds a Game Object to this group. + * + * Calls {@link Phaser.GameObjects.Group#createCallback}. + * @param child The Game Object to add. + * @param addToScene Also add the Game Object to the scene. Default false. + */ + add(child: Phaser.GameObjects.GameObject, addToScene?: boolean): Phaser.GameObjects.Group; + + /** + * Adds several Game Objects to this group. + * + * Calls {@link Phaser.GameObjects.Group#createCallback}. + * @param children The Game Objects to add. + * @param addToScene Also add the Game Objects to the scene. Default false. + */ + addMultiple(children: Phaser.GameObjects.GameObject[], addToScene?: boolean): Phaser.GameObjects.Group; + + /** + * Removes a member of this Group and optionally removes it from the Scene and / or destroys it. + * + * Calls {@link Phaser.GameObjects.Group#removeCallback}. + * @param child The Game Object to remove. + * @param removeFromScene Optionally remove the Group member from the Scene it belongs to. Default false. + * @param destroyChild Optionally call destroy on the removed Group member. Default false. + */ + remove(child: Phaser.GameObjects.GameObject, removeFromScene?: boolean, destroyChild?: boolean): Phaser.GameObjects.Group; + + /** + * Removes all members of this Group and optionally removes them from the Scene and / or destroys them. + * + * Does not call {@link Phaser.GameObjects.Group#removeCallback}. + * @param removeFromScene Optionally remove each Group member from the Scene. Default false. + * @param destroyChild Optionally call destroy on the removed Group members. Default false. + */ + clear(removeFromScene?: boolean, destroyChild?: boolean): Phaser.GameObjects.Group; + + /** + * Tests if a Game Object is a member of this group. + * @param child A Game Object. + */ + contains(child: Phaser.GameObjects.GameObject): boolean; + + /** + * All members of the group. + */ + getChildren(): Phaser.GameObjects.GameObject[]; + + /** + * The number of members of the group. + */ + getLength(): integer; + + /** + * Scans the Group, from top to bottom, for the first member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getFirst(state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the Group, from top to bottom, for the nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param nth The nth matching Group member to search for. + * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getFirstNth(nth: integer, state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the Group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getLast(state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the Group for the last nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param nth The nth matching Group member to search for. + * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getLastNth(nth: integer, state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, + * assigns `x` and `y`, and returns the member. + * + * If no inactive member is found and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * The new Game Object will have its active state set to `true`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + get(x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `true`, + * assigns `x` and `y`, and returns the member. + * + * If no active member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getFirstAlive(createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, + * assigns `x` and `y`, and returns the member. + * + * If no inactive member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`. + * The new Game Object will have an active state set to `true`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. + * @param x The horizontal position of the Game Object in the world. + * @param y The vertical position of the Game Object in the world. + * @param key The texture key assigned to a new Game Object (if one is created). Default defaultKey. + * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. + * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. + */ + getFirstDead(createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + + /** + * {@link Phaser.GameObjects.Components.Animation#play Plays} an animation for all members of this group. + * @param key The string-based key of the animation to play. + * @param startFrame Optionally start the animation playing from this frame index. Default 0. + */ + playAnimation(key: string, startFrame?: string): Phaser.GameObjects.Group; + + /** + * Whether this group's size at its {@link Phaser.GameObjects.Group#maxSize maximum}. + */ + isFull(): boolean; + + /** + * Counts the number of active (or inactive) group members. + * @param value Count active (true) or inactive (false) group members. Default true. + */ + countActive(value?: boolean): integer; + + /** + * Counts the number of in-use (active) group members. + */ + getTotalUsed(): integer; + + /** + * The difference of {@link Phaser.GameObjects.Group#maxSize} and the number of active group members. + * + * This represents the number of group members that could be created or reactivated before reaching the size limit. + */ + getTotalFree(): integer; + + /** + * Sets the depth of each group member. + * @param value The amount to set the property to. + * @param step This is added to the `value` amount, multiplied by the iteration counter. + */ + setDepth(value: number, step: number): Phaser.GameObjects.Group; + + /** + * Deactivates a member of this group. + * @param gameObject A member of this group. + */ + kill(gameObject: Phaser.GameObjects.GameObject): void; + + /** + * Deactivates and hides a member of this group. + * @param gameObject A member of this group. + */ + killAndHide(gameObject: Phaser.GameObjects.GameObject): void; + + /** + * Toggles (flips) the visible state of each member of this group. + */ + toggleVisible(): Phaser.GameObjects.Group; + + /** + * Empties this group and removes it from the Scene. + * + * Does not call {@link Phaser.GameObjects.Group#removeCallback}. + * @param destroyChildren Also {@link Phaser.GameObjects.GameObject#destroy} each group member. Default false. + */ + destroy(destroyChildren?: boolean): void; + + } + + /** + * An Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + */ + class Image extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer); + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A 2D point light. + * + * These are typically created by a {@link Phaser.GameObjects.LightsManager}, available from within a scene via `this.lights`. + * + * Any Game Objects using the Light2D pipeline will then be affected by these Lights. + * + * They can also simply be used to represent a point light for your own purposes. + */ + class Light { + /** + * + * @param x The horizontal position of the light. + * @param y The vertical position of the light. + * @param radius The radius of the light. + * @param r The red color of the light. A value between 0 and 1. + * @param g The green color of the light. A value between 0 and 1. + * @param b The blue color of the light. A value between 0 and 1. + * @param intensity The intensity of the light. + */ + constructor(x: number, y: number, radius: number, r: number, g: number, b: number, intensity: number); + + /** + * The horizontal position of the light. + */ + x: number; + + /** + * The vertical position of the light. + */ + y: number; + + /** + * The radius of the light. + */ + radius: number; + + /** + * The red color of the light. A value between 0 and 1. + */ + r: number; + + /** + * The green color of the light. A value between 0 and 1. + */ + g: number; + + /** + * The blue color of the light. A value between 0 and 1. + */ + b: number; + + /** + * The intensity of the light. + */ + intensity: number; + + /** + * The horizontal scroll factor of the light. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of the light. + */ + scrollFactorY: number; + + /** + * Set the properties of the light. + * + * Sets both horizontal and vertical scroll factor to 1. Use {@link Phaser.GameObjects.Light#setScrollFactor} to set + * the scroll factor. + * @param x The horizontal position of the light. + * @param y The vertical position of the light. + * @param radius The radius of the light. + * @param r The red color. A value between 0 and 1. + * @param g The green color. A value between 0 and 1. + * @param b The blue color. A value between 0 and 1. + * @param intensity The intensity of the light. + */ + set(x: number, y: number, radius: number, r: number, g: number, b: number, intensity: number): Phaser.GameObjects.Light; + + /** + * Set the scroll factor of the light. + * @param x The horizontal scroll factor of the light. + * @param y The vertical scroll factor of the light. + */ + setScrollFactor(x: number, y: number): Phaser.GameObjects.Light; + + /** + * Set the color of the light from a single integer RGB value. + * @param rgb The integer RGB color of the light. + */ + setColor(rgb: number): Phaser.GameObjects.Light; + + /** + * Set the intensity of the light. + * @param intensity The intensity of the light. + */ + setIntensity(intensity: number): Phaser.GameObjects.Light; + + /** + * Set the position of the light. + * @param x The horizontal position of the light. + * @param y The vertical position of the light. + */ + setPosition(x: number, y: number): Phaser.GameObjects.Light; + + /** + * Set the radius of the light. + * @param radius The radius of the light. + */ + setRadius(radius: number): Phaser.GameObjects.Light; + + } + + /** + * Manages Lights for a Scene. + * + * Affects the rendering of Game Objects using the `Light2D` pipeline. + */ + class LightsManager { + /** + * The pool of Lights. + * + * Used to recycle removed Lights for a more efficient use of memory. + */ + lightPool: Phaser.GameObjects.Light[]; + + /** + * The Lights in the Scene. + */ + lights: Phaser.GameObjects.Light[]; + + /** + * Lights that have been culled from a Camera's viewport. + * + * Lights in this list will not be rendered. + */ + culledLights: Phaser.GameObjects.Light[]; + + /** + * The ambient color. + */ + ambientColor: Object; + + /** + * Whether the Lights Manager is enabled. + */ + active: boolean; + + /** + * The maximum number of lights that a single Camera and the lights shader can process. + * Change this via the `maxLights` property in your game config, as it cannot be changed at runtime. + */ + readonly maxLights: integer; + + /** + * Enable the Lights Manager. + */ + enable(): Phaser.GameObjects.LightsManager; + + /** + * Disable the Lights Manager. + */ + disable(): Phaser.GameObjects.LightsManager; + + /** + * Cull any Lights that aren't visible to the given Camera. + * + * Culling Lights improves performance by ensuring that only Lights within a Camera's viewport are rendered. + * @param camera The Camera to cull Lights for. + */ + cull(camera: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Light[]; + + /** + * Iterate over each Light with a callback. + * @param callback The callback that is called with each Light. + */ + forEachLight(callback: LightForEach): Phaser.GameObjects.LightsManager; + + /** + * Set the ambient light color. + * @param rgb The integer RGB color of the ambient light. + */ + setAmbientColor(rgb: number): Phaser.GameObjects.LightsManager; + + /** + * Returns the maximum number of Lights allowed to appear at once. + */ + getMaxVisibleLights(): integer; + + /** + * Get the number of Lights managed by this Lights Manager. + */ + getLightCount(): integer; + + /** + * Add a Light. + * @param x The horizontal position of the Light. Default 0. + * @param y The vertical position of the Light. Default 0. + * @param radius The radius of the Light. Default 100. + * @param rgb The integer RGB color of the light. Default 0xffffff. + * @param intensity The intensity of the Light. Default 1. + */ + addLight(x?: number, y?: number, radius?: number, rgb?: number, intensity?: number): Phaser.GameObjects.Light; + + /** + * Remove a Light. + * @param light The Light to remove. + */ + removeLight(light: Phaser.GameObjects.Light): Phaser.GameObjects.LightsManager; + + /** + * Shut down the Lights Manager. + * + * Recycles all active Lights into the Light pool, resets ambient light color and clears the lists of Lights and + * culled Lights. + */ + shutdown(): void; + + /** + * Destroy the Lights Manager. + * + * Cleans up all references by calling {@link Phaser.GameObjects.LightsManager#shutdown}. + */ + destroy(): void; + + } + + /** + * A Scene plugin that provides a {@link Phaser.GameObjects.LightsManager} for the Light2D pipeline. + * + * Available from within a Scene via `this.lights`. + * + * Add Lights using the {@link Phaser.GameObjects.LightsManager#addLight} method: + * + * ```javascript + * // Enable the Lights Manager because it is disabled by default + * this.lights.enable(); + * + * // Create a Light at [400, 300] with a radius of 200 + * this.lights.addLight(400, 300, 200); + * ``` + * + * For Game Objects to be affected by the Lights when rendered, you will need to set them to use the `Light2D` pipeline like so: + * + * ```javascript + * sprite.setPipeline('Light2D'); + * ``` + */ + class LightsPlugin extends Phaser.GameObjects.LightsManager { + /** + * + * @param scene The Scene that this Lights Plugin belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * A reference to the Scene that this Lights Plugin belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene's systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * Boot the Lights Plugin. + */ + boot(): void; + + /** + * Destroy the Lights Plugin. + * + * Cleans up all references. + */ + destroy(): void; + + } + + /** + * A Mesh Game Object. + */ + class Mesh extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param vertices An array containing the vertices data for this Mesh. + * @param uv An array containing the uv data for this Mesh. + * @param colors An array containing the color data for this Mesh. + * @param alphas An array containing the alpha data for this Mesh. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, vertices: number[], uv: number[], colors: number[], alphas: number[], texture: string, frame?: string | integer); + + /** + * An array containing the vertices data for this Mesh. + */ + vertices: Float32Array; + + /** + * An array containing the uv data for this Mesh. + */ + uv: Float32Array; + + /** + * An array containing the color data for this Mesh. + */ + colors: Uint32Array; + + /** + * An array containing the alpha data for this Mesh. + */ + alphas: Float32Array; + + /** + * Fill or additive mode used when blending the color values? + */ + tintFill: boolean; + + /** + * This method is left intentionally empty and does not do anything. + * It is retained to allow a Mesh or Quad to be added to a Container. + */ + setAlpha(): void; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + } + + namespace Particles { + /** + * A Particle Emitter property. + * + * Facilitates changing Particle properties as they are emitted and throughout their lifetime. + */ + class EmitterOp { + /** + * + * @param config Settings for the Particle Emitter that owns this property. + * @param key The name of the property. + * @param defaultValue The default value of the property. + * @param emitOnly Whether the property can only be modified when a Particle is emitted. Default false. + */ + constructor(config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig, key: string, defaultValue: number, emitOnly?: boolean); + + /** + * The name of this property. + */ + propertyKey: string; + + /** + * The value of this property. + */ + propertyValue: number; + + /** + * The default value of this property. + */ + defaultValue: number; + + /** + * The number of steps for stepped easing between {@link Phaser.GameObjects.Particles.EmitterOp#start} and + * {@link Phaser.GameObjects.Particles.EmitterOp#end} values, per emit. + */ + steps: number; + + /** + * The step counter for stepped easing, per emit. + */ + counter: number; + + /** + * The start value for this property to ease between. + */ + start: number; + + /** + * The end value for this property to ease between. + */ + end: number; + + /** + * The easing function to use for updating this property. + */ + ease: Function; + + /** + * Whether this property can only be modified when a Particle is emitted. + * + * Set to `true` to allow only {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} callbacks to be set and + * affect this property. + * + * Set to `false` to allow both {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} and + * {@link Phaser.GameObjects.Particles.EmitterOp#onUpdate} callbacks to be set and affect this property. + */ + emitOnly: boolean; + + /** + * The callback to run for Particles when they are emitted from the Particle Emitter. + */ + onEmit: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback; + + /** + * The callback to run for Particles when they are updated. + */ + onUpdate: Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback; + + /** + * Load the property from a Particle Emitter configuration object. + * + * Optionally accepts a new property key to use, replacing the current one. + * @param config Settings for the Particle Emitter that owns this property. + * @param newKey The new key to use for this property, if any. + */ + loadConfig(config?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig, newKey?: string): void; + + /** + * Build a JSON representation of this Particle Emitter property. + */ + toJSON(): object; + + /** + * Change the current value of the property and update its callback methods. + * @param value The value of the property. + */ + onChange(value: number): Phaser.GameObjects.Particles.EmitterOp; + + /** + * Update the {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} and + * {@link Phaser.GameObjects.Particles.EmitterOp#onUpdate} callbacks based on the type of the current + * {@link Phaser.GameObjects.Particles.EmitterOp#propertyValue}. + */ + setMethods(): Phaser.GameObjects.Particles.EmitterOp; + + /** + * Check whether an object has the given property. + * @param object The object to check. + * @param key The key of the property to look for in the object. + */ + has(object: object, key: string): boolean; + + /** + * Check whether an object has both of the given properties. + * @param object The object to check. + * @param key1 The key of the first property to check the object for. + * @param key2 The key of the second property to check the object for. + */ + hasBoth(object: object, key1: string, key2: string): boolean; + + /** + * Check whether an object has at least one of the given properties. + * @param object The object to check. + * @param key1 The key of the first property to check the object for. + * @param key2 The key of the second property to check the object for. + */ + hasEither(object: object, key1: string, key2: string): boolean; + + /** + * The returned value sets what the property will be at the START of the particles life, on emit. + * @param particle The particle. + * @param key The name of the property. + * @param value The current value of the property. + */ + defaultEmit(particle: Phaser.GameObjects.Particles.Particle, key: string, value?: number): number; + + /** + * The returned value updates the property for the duration of the particles life. + * @param particle The particle. + * @param key The name of the property. + * @param t The T value (between 0 and 1) + * @param value The current value of the property. + */ + defaultUpdate(particle: Phaser.GameObjects.Particles.Particle, key: string, t: number, value: number): number; + + /** + * An `onEmit` callback that returns the current value of the property. + */ + staticValueEmit(): number; + + /** + * An `onUpdate` callback that returns the current value of the property. + */ + staticValueUpdate(): number; + + /** + * An `onEmit` callback that returns a random value from the current value array. + */ + randomStaticValueEmit(): number; + + /** + * An `onEmit` callback that returns a value between the {@link Phaser.GameObjects.Particles.EmitterOp#start} and + * {@link Phaser.GameObjects.Particles.EmitterOp#end} range. + * @param particle The particle. + * @param key The key of the property. + */ + randomRangedValueEmit(particle: Phaser.GameObjects.Particles.Particle, key: string): number; + + /** + * An `onEmit` callback that returns a stepped value between the + * {@link Phaser.GameObjects.Particles.EmitterOp#start} and {@link Phaser.GameObjects.Particles.EmitterOp#end} + * range. + */ + steppedEmit(): number; + + /** + * An `onEmit` callback for an eased property. + * + * It prepares the particle for easing by {@link Phaser.GameObjects.Particles.EmitterOp#easeValueUpdate}. + * @param particle The particle. + * @param key The name of the property. + */ + easedValueEmit(particle: Phaser.GameObjects.Particles.Particle, key: string): number; + + /** + * An `onUpdate` callback that returns an eased value between the + * {@link Phaser.GameObjects.Particles.EmitterOp#start} and {@link Phaser.GameObjects.Particles.EmitterOp#end} + * range. + * @param particle The particle. + * @param key The name of the property. + * @param t The T value (between 0 and 1) + */ + easeValueUpdate(particle: Phaser.GameObjects.Particles.Particle, key: string, t: number): number; + + } + + /** + * The GravityWell action applies a force on the particle to draw it towards, or repel it from, a single point. + * + * The force applied is inversely proportional to the square of the distance from the particle to the point, in accordance with Newton's law of gravity. + * + * This simulates the effect of gravity over large distances (as between planets, for example). + */ + class GravityWell { + /** + * + * @param x The x coordinate of the Gravity Well, in world space. Default 0. + * @param y The y coordinate of the Gravity Well, in world space. Default 0. + * @param power The strength of the gravity force - larger numbers produce a stronger force. Default 0. + * @param epsilon The minimum distance for which the gravity force is calculated. Default 100. + * @param gravity The gravitational force of this Gravity Well. Default 50. + */ + constructor(x?: number | Phaser.Types.GameObjects.Particles.GravityWellConfig, y?: number, power?: number, epsilon?: number, gravity?: number); + + /** + * The x coordinate of the Gravity Well, in world space. + */ + x: number; + + /** + * The y coordinate of the Gravity Well, in world space. + */ + y: number; + + /** + * The active state of the Gravity Well. An inactive Gravity Well will not influence any particles. + */ + active: boolean; + + /** + * The strength of the gravity force - larger numbers produce a stronger force. + */ + power: number; + + /** + * The minimum distance for which the gravity force is calculated. + */ + epsilon: number; + + /** + * Takes a Particle and updates it based on the properties of this Gravity Well. + * @param particle The Particle to update. + * @param delta The delta time in ms. + * @param step The delta value divided by 1000. + */ + update(particle: Phaser.GameObjects.Particles.Particle, delta: number, step: number): void; + + } + + /** + * A Particle is a simple Game Object controlled by a Particle Emitter and Manager, and rendered by the Manager. + * It uses its own lightweight physics system, and can interact only with its Emitter's bounds and zones. + */ + class Particle { + /** + * + * @param emitter The Emitter to which this Particle belongs. + */ + constructor(emitter: Phaser.GameObjects.Particles.ParticleEmitter); + + /** + * The Emitter to which this Particle belongs. + * + * A Particle can only belong to a single Emitter and is created, updated and destroyed via it. + */ + emitter: Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * The texture frame used to render this Particle. + */ + frame: Phaser.Textures.Frame; + + /** + * The x coordinate of this Particle. + */ + x: number; + + /** + * The y coordinate of this Particle. + */ + y: number; + + /** + * The x velocity of this Particle. + */ + velocityX: number; + + /** + * The y velocity of this Particle. + */ + velocityY: number; + + /** + * The x acceleration of this Particle. + */ + accelerationX: number; + + /** + * The y acceleration of this Particle. + */ + accelerationY: number; + + /** + * The maximum horizontal velocity this Particle can travel at. + */ + maxVelocityX: number; + + /** + * The maximum vertical velocity this Particle can travel at. + */ + maxVelocityY: number; + + /** + * The bounciness, or restitution, of this Particle. + */ + bounce: number; + + /** + * The horizontal scale of this Particle. + */ + scaleX: number; + + /** + * The vertical scale of this Particle. + */ + scaleY: number; + + /** + * The alpha value of this Particle. + */ + alpha: number; + + /** + * The angle of this Particle in degrees. + */ + angle: number; + + /** + * The angle of this Particle in radians. + */ + rotation: number; + + /** + * The tint applied to this Particle. + */ + tint: integer; + + /** + * The lifespan of this Particle in ms. + */ + life: number; + + /** + * The current life of this Particle in ms. + */ + lifeCurrent: number; + + /** + * The delay applied to this Particle upon emission, in ms. + */ + delayCurrent: number; + + /** + * The normalized lifespan T value, where 0 is the start and 1 is the end. + */ + lifeT: number; + + /** + * The data used by the ease equation. + */ + data: object; + + /** + * Checks to see if this Particle is alive and updating. + */ + isAlive(): boolean; + + /** + * Resets the position of this particle back to zero. + */ + resetPosition(): void; + + /** + * Starts this Particle from the given coordinates. + * @param x The x coordinate to launch this Particle from. + * @param y The y coordinate to launch this Particle from. + */ + fire(x: number, y: number): void; + + /** + * An internal method that calculates the velocity of the Particle. + * @param emitter The Emitter that is updating this Particle. + * @param delta The delta time in ms. + * @param step The delta value divided by 1000. + * @param processors Particle processors (gravity wells). + */ + computeVelocity(emitter: Phaser.GameObjects.Particles.ParticleEmitter, delta: number, step: number, processors: any[]): void; + + /** + * Checks if this Particle is still within the bounds defined by the given Emitter. + * + * If not, and depending on the Emitter collision flags, the Particle may either stop or rebound. + * @param emitter The Emitter to check the bounds against. + */ + checkBounds(emitter: Phaser.GameObjects.Particles.ParticleEmitter): void; + + /** + * The main update method for this Particle. + * + * Updates its life values, computes the velocity and repositions the Particle. + * @param delta The delta time in ms. + * @param step The delta value divided by 1000. + * @param processors An optional array of update processors. + */ + update(delta: number, step: number, processors: any[]): boolean; + + } + + /** + * A particle emitter represents a single particle stream. + * It controls a pool of {@link Phaser.GameObjects.Particles.Particle Particles} and is controlled by a {@link Phaser.GameObjects.Particles.ParticleEmitterManager Particle Emitter Manager}. + */ + class ParticleEmitter implements Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { + /** + * + * @param manager The Emitter Manager this Emitter belongs to. + * @param config Settings for this emitter. + */ + constructor(manager: Phaser.GameObjects.Particles.ParticleEmitterManager, config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig); + + /** + * The Emitter Manager this Emitter belongs to. + */ + manager: Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * The texture assigned to particles. + */ + texture: Phaser.Textures.Texture; + + /** + * The texture frames assigned to particles. + */ + frames: Phaser.Textures.Frame[]; + + /** + * The default texture frame assigned to particles. + */ + defaultFrame: Phaser.Textures.Frame; + + /** + * Names of simple configuration properties. + */ + configFastMap: object; + + /** + * Names of complex configuration properties. + */ + configOpMap: object; + + /** + * The name of this Particle Emitter. + * + * Empty by default and never populated by Phaser, this is left for developers to use. + */ + name: string; + + /** + * The Particle Class which will be emitted by this Emitter. + */ + particleClass: Phaser.GameObjects.Particles.Particle; + + /** + * The x-coordinate of the particle origin (where particles will be emitted). + */ + x: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The y-coordinate of the particle origin (where particles will be emitted). + */ + y: Phaser.GameObjects.Particles.EmitterOp; + + /** + * A radial emitter will emit particles in all directions between angle min and max, + * using {@link Phaser.GameObjects.Particles.ParticleEmitter#speed} as the value. If set to false then this acts as a point Emitter. + * A point emitter will emit particles only in the direction derived from the speedX and speedY values. + */ + radial: boolean; + + /** + * Horizontal acceleration applied to emitted particles, in pixels per second squared. + */ + gravityX: number; + + /** + * Vertical acceleration applied to emitted particles, in pixels per second squared. + */ + gravityY: number; + + /** + * Whether accelerationX and accelerationY are non-zero. Set automatically during configuration. + */ + acceleration: boolean; + + /** + * Horizontal acceleration applied to emitted particles, in pixels per second squared. + */ + accelerationX: Phaser.GameObjects.Particles.EmitterOp; + + /** + * Vertical acceleration applied to emitted particles, in pixels per second squared. + */ + accelerationY: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The maximum horizontal velocity of emitted particles, in pixels per second squared. + */ + maxVelocityX: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The maximum vertical velocity of emitted particles, in pixels per second squared. + */ + maxVelocityY: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The initial horizontal speed of emitted particles, in pixels per second. + */ + speedX: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The initial vertical speed of emitted particles, in pixels per second. + */ + speedY: Phaser.GameObjects.Particles.EmitterOp; + + /** + * Whether moveToX and moveToY are nonzero. Set automatically during configuration. + */ + moveTo: boolean; + + /** + * The x-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. + */ + moveToX: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The y-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. + */ + moveToY: Phaser.GameObjects.Particles.EmitterOp; + + /** + * Whether particles will rebound when they meet the emitter bounds. + */ + bounce: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The horizontal scale of emitted particles. + */ + scaleX: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The vertical scale of emitted particles. + */ + scaleY: Phaser.GameObjects.Particles.EmitterOp; + + /** + * Color tint applied to emitted particles. Any alpha component (0xAA000000) is ignored. + */ + tint: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The alpha (transparency) of emitted particles. + */ + alpha: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The lifespan of emitted particles, in ms. + */ + lifespan: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The angle of the initial velocity of emitted particles, in degrees. + */ + angle: Phaser.GameObjects.Particles.EmitterOp; + + /** + * The rotation of emitted particles, in degrees. + */ + rotate: Phaser.GameObjects.Particles.EmitterOp; + + /** + * A function to call when a particle is emitted. + */ + emitCallback: Phaser.Types.GameObjects.Particles.ParticleEmitterCallback; + + /** + * The calling context for {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallback}. + */ + emitCallbackScope: any; + + /** + * A function to call when a particle dies. + */ + deathCallback: Phaser.Types.GameObjects.Particles.ParticleDeathCallback; + + /** + * The calling context for {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallback}. + */ + deathCallbackScope: any; + + /** + * Set to hard limit the amount of particle objects this emitter is allowed to create. + * 0 means unlimited. + */ + maxParticles: integer; + + /** + * How many particles are emitted each time particles are emitted (one explosion or one flow cycle). + */ + quantity: Phaser.GameObjects.Particles.EmitterOp; + + /** + * How many ms to wait after emission before the particles start updating. + */ + delay: Phaser.GameObjects.Particles.EmitterOp; + + /** + * For a flow emitter, the time interval (>= 0) between particle flow cycles in ms. + * A value of 0 means there is one particle flow cycle for each logic update (the maximum flow frequency). This is the default setting. + * For an exploding emitter, this value will be -1. + * Calling {@link Phaser.GameObjects.Particles.ParticleEmitter#flow} also puts the emitter in flow mode (frequency >= 0). + * Calling {@link Phaser.GameObjects.Particles.ParticleEmitter#explode} also puts the emitter in explode mode (frequency = -1). + */ + frequency: number; + + /** + * Controls if the emitter is currently emitting a particle flow (when frequency >= 0). + * Already alive particles will continue to update until they expire. + * Controlled by {@link Phaser.GameObjects.Particles.ParticleEmitter#start} and {@link Phaser.GameObjects.Particles.ParticleEmitter#stop}. + */ + on: boolean; + + /** + * Newly emitted particles are added to the top of the particle list, i.e. rendered above those already alive. + * Set to false to send them to the back. + */ + particleBringToTop: boolean; + + /** + * The time rate applied to active particles, affecting lifespan, movement, and tweens. Values larger than 1 are faster than normal. + */ + timeScale: number; + + /** + * An object describing a shape to emit particles from. + */ + emitZone: Phaser.GameObjects.Particles.Zones.EdgeZone | Phaser.GameObjects.Particles.Zones.RandomZone; + + /** + * An object describing a shape that deactivates particles when they interact with it. + */ + deathZone: Phaser.GameObjects.Particles.Zones.DeathZone; + + /** + * A rectangular boundary constraining particle movement. + */ + bounds: Phaser.Geom.Rectangle; + + /** + * Whether particles interact with the left edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + */ + collideLeft: boolean; + + /** + * Whether particles interact with the right edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + */ + collideRight: boolean; + + /** + * Whether particles interact with the top edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + */ + collideTop: boolean; + + /** + * Whether particles interact with the bottom edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + */ + collideBottom: boolean; + + /** + * Whether this emitter updates itself and its particles. + * + * Controlled by {@link Phaser.GameObjects.Particles.ParticleEmitter#pause} + * and {@link Phaser.GameObjects.Particles.ParticleEmitter#resume}. + */ + active: boolean; + + /** + * Set this to false to hide any active particles. + */ + visible: boolean; + + /** + * The blend mode of this emitter's particles. + */ + blendMode: integer; + + /** + * A Game Object whose position is used as the particle origin. + */ + follow: Phaser.GameObjects.GameObject; + + /** + * The offset of the particle origin from the {@link Phaser.GameObjects.Particles.ParticleEmitter#follow} target. + */ + followOffset: Phaser.Math.Vector2; + + /** + * Whether the emitter's {@link Phaser.GameObjects.Particles.ParticleEmitter#visible} state will track + * the {@link Phaser.GameObjects.Particles.ParticleEmitter#follow} target's visibility state. + */ + trackVisible: boolean; + + /** + * The current texture frame, as an index of {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. + */ + currentFrame: integer; + + /** + * Whether texture {@link Phaser.GameObjects.Particles.ParticleEmitter#frames} are selected at random. + */ + randomFrame: boolean; + + /** + * The number of consecutive particles that receive a single texture frame (per frame cycle). + */ + frameQuantity: integer; + + /** + * Merges configuration settings into the emitter's current settings. + * @param config Settings for this emitter. + */ + fromJSON(config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Creates a description of this emitter suitable for JSON serialization. + * @param output An object to copy output into. + */ + toJSON(output?: object): object; + + /** + * Continuously moves the particle origin to follow a Game Object's position. + * @param target The Game Object to follow. + * @param offsetX Horizontal offset of the particle origin from the Game Object. Default 0. + * @param offsetY Vertical offset of the particle origin from the Game Object. Default 0. + * @param trackVisible Whether the emitter's visible state will track the target's visible state. Default false. + */ + startFollow(target: Phaser.GameObjects.GameObject, offsetX?: number, offsetY?: number, trackVisible?: boolean): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Stops following a Game Object. + */ + stopFollow(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Chooses a texture frame from {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. + */ + getFrame(): Phaser.Textures.Frame; + + /** + * Sets a pattern for assigning texture frames to emitted particles. + * @param frames One or more texture frames, or a configuration object. + * @param pickRandom Whether frames should be assigned at random from `frames`. Default true. + * @param quantity The number of consecutive particles that will receive each frame. Default 1. + */ + setFrame(frames: any[] | string | integer | Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig, pickRandom?: boolean, quantity?: integer): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle movement on or off. + * @param value Radial mode (true) or point mode (true). Default true. + */ + setRadial(value?: boolean): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the position of the emitter's particle origin. + * New particles will be emitted here. + * @param x The x-coordinate of the particle origin. + * @param y The y-coordinate of the particle origin. + */ + setPosition(x: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType, y: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets or modifies a rectangular boundary constraining the particles. + * + * To remove the boundary, set {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds} to null. + * @param x The x-coordinate of the left edge of the boundary, or an object representing a rectangle. + * @param y The y-coordinate of the top edge of the boundary. + * @param width The width of the boundary. + * @param height The height of the boundary. + */ + setBounds(x: number | Phaser.Types.GameObjects.Particles.ParticleEmitterBounds | Phaser.Types.GameObjects.Particles.ParticleEmitterBoundsAlt, y: number, width: number, height: number): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the initial horizontal speed of emitted particles. + * Changes the emitter to point mode. + * @param value The speed, in pixels per second. + */ + setSpeedX(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the initial vertical speed of emitted particles. + * Changes the emitter to point mode. + * @param value The speed, in pixels per second. + */ + setSpeedY(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the initial radial speed of emitted particles. + * Changes the emitter to radial mode. + * @param value The speed, in pixels per second. + */ + setSpeed(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the horizontal scale of emitted particles. + * @param value The scale, relative to 1. + */ + setScaleX(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the vertical scale of emitted particles. + * @param value The scale, relative to 1. + */ + setScaleY(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the scale of emitted particles. + * @param value The scale, relative to 1. + */ + setScale(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the horizontal gravity applied to emitted particles. + * @param value Acceleration due to gravity, in pixels per second squared. + */ + setGravityX(value: number): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the vertical gravity applied to emitted particles. + * @param value Acceleration due to gravity, in pixels per second squared. + */ + setGravityY(value: number): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the gravity applied to emitted particles. + * @param x Horizontal acceleration due to gravity, in pixels per second squared. + * @param y Vertical acceleration due to gravity, in pixels per second squared. + */ + setGravity(x: number, y: number): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the opacity of emitted particles. + * @param value A value between 0 (transparent) and 1 (opaque). + */ + setAlpha(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the angle of a {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle stream. + * @param value The angle of the initial velocity of emitted particles. + */ + setEmitterAngle(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the angle of a {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle stream. + * @param value The angle of the initial velocity of emitted particles. + */ + setAngle(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the lifespan of newly emitted particles. + * @param value The particle lifespan, in ms. + */ + setLifespan(value: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the number of particles released at each flow cycle or explosion. + * @param quantity The number of particles to release at each flow cycle or explosion. + */ + setQuantity(quantity: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets the emitter's {@link Phaser.GameObjects.Particles.ParticleEmitter#frequency} + * and {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param frequency The time interval (>= 0) of each flow cycle, in ms; or -1 to put the emitter in explosion mode. + * @param quantity The number of particles to release at each flow cycle or explosion. + */ + setFrequency(frequency: number, quantity?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets or removes the {@link Phaser.GameObjects.Particles.ParticleEmitter#emitZone}. + * + * An {@link Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig EdgeZone} places particles on its edges. Its {@link Phaser.Types.GameObjects.Particles.EdgeZoneSource source} can be a Curve, Path, Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback getPoints} method. + * + * A {@link Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig RandomZone} places randomly within its interior. Its {@link RandomZoneSource source} can be a Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback getRandomPoint} method. + * @param zoneConfig An object describing the zone, or `undefined` to remove any current emit zone. + */ + setEmitZone(zoneConfig?: Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets or removes the {@link Phaser.GameObjects.Particles.ParticleEmitter#deathZone}. + * @param zoneConfig An object describing the zone, or `undefined` to remove any current death zone. + */ + setDeathZone(zoneConfig?: Phaser.Types.GameObjects.Particles.ParticleEmitterDeathZoneConfig): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Creates inactive particles and adds them to this emitter's pool. + * @param particleCount The number of particles to create. + */ + reserve(particleCount: integer): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Gets the number of active (in-use) particles in this emitter. + */ + getAliveParticleCount(): integer; + + /** + * Gets the number of inactive (available) particles in this emitter. + */ + getDeadParticleCount(): integer; + + /** + * Gets the total number of particles in this emitter. + */ + getParticleCount(): integer; + + /** + * Whether this emitter is at its limit (if set). + */ + atLimit(): boolean; + + /** + * Sets a function to call for each newly emitted particle. + * @param callback The function. + * @param context The calling context. + */ + onParticleEmit(callback: Phaser.Types.GameObjects.Particles.ParticleEmitterCallback, context?: any): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sets a function to call for each particle death. + * @param callback The function. + * @param context The function's calling context. + */ + onParticleDeath(callback: Phaser.Types.GameObjects.Particles.ParticleDeathCallback, context?: any): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Deactivates every particle in this emitter. + */ + killAll(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Calls a function for each active particle in this emitter. + * @param callback The function. + * @param context The function's calling context. + */ + forEachAlive(callback: Phaser.Types.GameObjects.Particles.ParticleEmitterCallback, context: any): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Calls a function for each inactive particle in this emitter. + * @param callback The function. + * @param context The function's calling context. + */ + forEachDead(callback: Phaser.Types.GameObjects.Particles.ParticleEmitterCallback, context: any): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#on} the emitter and resets the flow counter. + * + * If this emitter is in flow mode (frequency >= 0; the default), the particle flow will start (or restart). + * + * If this emitter is in explode mode (frequency = -1), nothing will happen. + * Use {@link Phaser.GameObjects.Particles.ParticleEmitter#explode} or {@link Phaser.GameObjects.Particles.ParticleEmitter#flow} instead. + */ + start(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#on off} the emitter. + */ + stop(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * {@link Phaser.GameObjects.Particles.ParticleEmitter#active Deactivates} the emitter. + */ + pause(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * {@link Phaser.GameObjects.Particles.ParticleEmitter#active Activates} the emitter. + */ + resume(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Sorts active particles with {@link Phaser.GameObjects.Particles.ParticleEmitter#depthSortCallback}. + */ + depthSort(): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Puts the emitter in flow mode (frequency >= 0) and starts (or restarts) a particle flow. + * + * To resume a flow at the current frequency and quantity, use {@link Phaser.GameObjects.Particles.ParticleEmitter#start} instead. + * @param frequency The time interval (>= 0) of each flow cycle, in ms. + * @param count The number of particles to emit at each flow cycle. Default 1. + */ + flow(frequency: number, count?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Puts the emitter in explode mode (frequency = -1), stopping any current particle flow, and emits several particles all at once. + * @param count The amount of Particles to emit. + * @param x The x coordinate to emit the Particles from. + * @param y The y coordinate to emit the Particles from. + */ + explode(count: integer, x: number, y: number): Phaser.GameObjects.Particles.Particle; + + /** + * Emits particles at a given position (or the emitter's current position). + * @param x The x coordinate to emit the Particles from. Default this.x. + * @param y The y coordinate to emit the Particles from. Default this.x. + * @param count The number of Particles to emit. Default this.quantity. + */ + emitParticleAt(x?: number, y?: number, count?: integer): Phaser.GameObjects.Particles.Particle; + + /** + * Emits particles at a given position (or the emitter's current position). + * @param count The number of Particles to emit. Default this.quantity. + * @param x The x coordinate to emit the Particles from. Default this.x. + * @param y The y coordinate to emit the Particles from. Default this.x. + */ + emitParticle(count?: integer, x?: number, y?: number): Phaser.GameObjects.Particles.Particle; + + /** + * Updates this emitter and its particles. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + preUpdate(time: integer, delta: number): void; + + /** + * Calculates the difference of two particles, for sorting them by depth. + * @param a The first particle. + * @param b The second particle. + */ + depthSortCallback(a: object, b: object): integer; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Particle Emitter Manager creates and controls {@link Phaser.GameObjects.Particles.ParticleEmitter Particle Emitters} and {@link Phaser.GameObjects.Particles.GravityWell Gravity Wells}. + */ + class ParticleEmitterManager extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Emitter Manager belongs. + * @param texture The key of the Texture this Emitter Manager will use to render particles, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Emitter Manager will use to render particles. + * @param emitters Configuration settings for one or more emitters to create. + */ + constructor(scene: Phaser.Scene, texture: string, frame?: string | integer, emitters?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]); + + /** + * The time scale applied to all emitters and particles, affecting flow rate, lifespan, and movement. + * Values larger than 1 are faster than normal. + * This is multiplied with any timeScale set on each individual emitter. + */ + timeScale: number; + + /** + * The texture used to render this Emitter Manager's particles. + */ + texture: Phaser.Textures.Texture; + + /** + * The texture frame used to render this Emitter Manager's particles. + */ + frame: Phaser.Textures.Frame; + + /** + * Names of this Emitter Manager's texture frames. + */ + frameNames: string[]; + + /** + * A list of Emitters being managed by this Emitter Manager. + */ + emitters: Phaser.Structs.List; + + /** + * A list of Gravity Wells being managed by this Emitter Manager. + */ + wells: Phaser.Structs.List; + + /** + * Sets the texture and frame this Emitter Manager will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Sets the frame this Emitter Manager will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * @param frame The name or index of the frame within the Texture. + */ + setFrame(frame?: string | integer): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Assigns texture frames to an emitter. + * @param frames The texture frames. + * @param emitter The particle emitter to modify. + */ + setEmitterFrames(frames: Phaser.Textures.Frame | Phaser.Textures.Frame[], emitter: Phaser.GameObjects.Particles.ParticleEmitter): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Adds an existing Particle Emitter to this Emitter Manager. + * @param emitter The Particle Emitter to add to this Emitter Manager. + */ + addEmitter(emitter: Phaser.GameObjects.Particles.ParticleEmitter): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Creates a new Particle Emitter object, adds it to this Emitter Manager and returns a reference to it. + * @param config Configuration settings for the Particle Emitter to create. + */ + createEmitter(config: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig): Phaser.GameObjects.Particles.ParticleEmitter; + + /** + * Adds an existing Gravity Well object to this Emitter Manager. + * @param well The Gravity Well to add to this Emitter Manager. + */ + addGravityWell(well: Phaser.GameObjects.Particles.GravityWell): Phaser.GameObjects.Particles.GravityWell; + + /** + * Creates a new Gravity Well, adds it to this Emitter Manager and returns a reference to it. + * @param config Configuration settings for the Gravity Well to create. + */ + createGravityWell(config: Phaser.Types.GameObjects.Particles.GravityWellConfig): Phaser.GameObjects.Particles.GravityWell; + + /** + * Emits particles from each active emitter. + * @param count The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param x The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. + * @param y The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. + */ + emitParticle(count?: integer, x?: number, y?: number): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Emits particles from each active emitter. + * @param x The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. + * @param y The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. + * @param count The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + */ + emitParticleAt(x?: number, y?: number, count?: integer): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Pauses this Emitter Manager. + * + * This has the effect of pausing all emitters, and all particles of those emitters, currently under its control. + * + * The particles will still render, but they will not have any of their logic updated. + */ + pause(): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Resumes this Emitter Manager, should it have been previously paused. + */ + resume(): Phaser.GameObjects.Particles.ParticleEmitterManager; + + /** + * Gets all active particle processors (gravity wells). + */ + getProcessors(): Phaser.GameObjects.Particles.GravityWell[]; + + /** + * Updates all active emitters. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + preUpdate(time: integer, delta: number): void; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + namespace Zones { + /** + * A Death Zone. + * + * A Death Zone is a special type of zone that will kill a Particle as soon as it either enters, or leaves, the zone. + * + * The zone consists of a `source` which could be a Geometric shape, such as a Rectangle or Ellipse, or your own + * object as long as it includes a `contains` method for which the Particles can be tested against. + */ + class DeathZone { + /** + * + * @param source An object instance that has a `contains` method that returns a boolean when given `x` and `y` arguments. + * @param killOnEnter Should the Particle be killed when it enters the zone? `true` or leaves it? `false` + */ + constructor(source: Phaser.Types.GameObjects.Particles.DeathZoneSource, killOnEnter: boolean); + + /** + * An object instance that has a `contains` method that returns a boolean when given `x` and `y` arguments. + * This could be a Geometry shape, such as `Phaser.Geom.Circle`, or your own custom object. + */ + source: Phaser.Types.GameObjects.Particles.DeathZoneSource; + + /** + * Set to `true` if the Particle should be killed if it enters this zone. + * Set to `false` to kill the Particle if it leaves this zone. + */ + killOnEnter: boolean; + + /** + * Checks if the given Particle will be killed or not by this zone. + * @param particle The Particle to be checked against this zone. + */ + willKill(particle: Phaser.GameObjects.Particles.Particle): boolean; + + } + + /** + * A zone that places particles on a shape's edges. + */ + class EdgeZone { + /** + * + * @param source An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. + * @param quantity The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + * @param stepRate The distance between each particle. When set, `quantity` is implied and should be set to 0. + * @param yoyo Whether particles are placed from start to end and then end to start. Default false. + * @param seamless Whether one endpoint will be removed if it's identical to the other. Default true. + */ + constructor(source: Phaser.Types.GameObjects.Particles.EdgeZoneSource, quantity: integer, stepRate: number, yoyo?: boolean, seamless?: boolean); + + /** + * An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. + */ + source: Phaser.Types.GameObjects.Particles.EdgeZoneSource | Phaser.Types.GameObjects.Particles.RandomZoneSource; + + /** + * The points placed on the source edge. + */ + points: Phaser.Geom.Point[]; + + /** + * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + */ + quantity: integer; + + /** + * The distance between each particle. When set, `quantity` is implied and should be set to 0. + */ + stepRate: number; + + /** + * Whether particles are placed from start to end and then end to start. + */ + yoyo: boolean; + + /** + * The counter used for iterating the EdgeZone's points. + */ + counter: number; + + /** + * Whether one endpoint will be removed if it's identical to the other. + */ + seamless: boolean; + + /** + * Update the {@link Phaser.GameObjects.Particles.Zones.EdgeZone#points} from the EdgeZone's + * {@link Phaser.GameObjects.Particles.Zones.EdgeZone#source}. + * + * Also updates internal properties. + */ + updateSource(): Phaser.GameObjects.Particles.Zones.EdgeZone; + + /** + * Change the source of the EdgeZone. + * @param source An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. + */ + changeSource(source: Phaser.Types.GameObjects.Particles.EdgeZoneSource): Phaser.GameObjects.Particles.Zones.EdgeZone; + + /** + * Get the next point in the Zone and set its coordinates on the given Particle. + * @param particle The Particle. + */ + getPoint(particle: Phaser.GameObjects.Particles.Particle): void; + + } + + /** + * A zone that places particles randomly within a shape's area. + */ + class RandomZone { + /** + * + * @param source An object instance with a `getRandomPoint(point)` method. + */ + constructor(source: Phaser.Types.GameObjects.Particles.RandomZoneSource); + + /** + * An object instance with a `getRandomPoint(point)` method. + */ + source: Phaser.Types.GameObjects.Particles.RandomZoneSource; + + /** + * Get the next point in the Zone and set its coordinates on the given Particle. + * @param particle The Particle. + */ + getPoint(particle: Phaser.GameObjects.Particles.Particle): void; + + } + + } + + } + + /** + * A PathFollower Game Object. + * + * A PathFollower is a Sprite Game Object with some extra helpers to allow it to follow a Path automatically. + * + * Anything you can do with a standard Sprite can be done with this PathFollower, such as animate it, tint it, + * scale it and so on. + * + * PathFollowers are bound to a single Path at any one time and can traverse the length of the Path, from start + * to finish, forwards or backwards, or from any given point on the Path to its end. They can optionally rotate + * to face the direction of the path, be offset from the path coordinates or rotate independently of the Path. + */ + class PathFollower extends Phaser.GameObjects.Sprite implements Phaser.GameObjects.Components.PathFollower { + /** + * + * @param scene The Scene to which this PathFollower belongs. + * @param path The Path this PathFollower is following. It can only follow one Path at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, path: Phaser.Curves.Path, x: number, y: number, texture: string, frame?: string | integer); + + /** + * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath) + * this value is added to the rotation value. This allows you to rotate objects to a path but control + * the angle of the rotation as well. + */ + pathRotationOffset: number; + + /** + * An additional vector to add to the PathFollowers position, allowing you to offset it from the + * Path coordinates. + */ + pathOffset: Phaser.Math.Vector2; + + /** + * A Vector2 that stores the current point of the path the follower is on. + */ + pathVector: Phaser.Math.Vector2; + + /** + * The Tween used for following the Path. + */ + pathTween: Phaser.Tweens.Tween; + + /** + * Settings for the PathFollower. + */ + pathConfig: Phaser.Types.GameObjects.PathFollower.PathConfig; + + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected preUpdate(time: integer, delta: number): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * The Path this PathFollower is following. It can only follow one Path at a time. + */ + path: Phaser.Curves.Path; + + /** + * Should the PathFollower automatically rotate to point in the direction of the Path? + */ + rotateToPath: boolean; + + /** + * Set the Path that this PathFollower should follow. + * + * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. + * @param path The Path this PathFollower is following. It can only follow one Path at a time. + * @param config Settings for the PathFollower. + */ + setPath(path: Phaser.Curves.Path, config?: number | Phaser.Types.GameObjects.PathFollower.PathConfig | Phaser.Types.Tweens.NumberTweenBuilderConfig): Phaser.GameObjects.PathFollower; + + /** + * Set whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param value Whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param offset Rotation offset in degrees. Default 0. + */ + setRotateToPath(value: boolean, offset?: number): Phaser.GameObjects.PathFollower; + + /** + * Is this PathFollower actively following a Path or not? + * + * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. + */ + isFollowing(): boolean; + + /** + * Starts this PathFollower following its given Path. + * @param config The duration of the follow, or a PathFollower config object. Default {}. + * @param startAt Optional start position of the follow, between 0 and 1. Default 0. + */ + startFollow(config?: number | Phaser.Types.GameObjects.PathFollower.PathConfig | Phaser.Types.Tweens.NumberTweenBuilderConfig, startAt?: number): Phaser.GameObjects.PathFollower; + + /** + * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the + * point on the Path at which you paused it. + */ + pauseFollow(): Phaser.GameObjects.PathFollower; + + /** + * Resumes a previously paused PathFollower. + * + * If the PathFollower was not paused this has no effect. + */ + resumeFollow(): Phaser.GameObjects.PathFollower; + + /** + * Stops this PathFollower from following the path any longer. + * + * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. + */ + stopFollow(): Phaser.GameObjects.PathFollower; + + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + */ + pathUpdate(): void; + + } + + /** + * A Quad Game Object. + * + * A Quad is a Mesh Game Object pre-configured with two triangles arranged into a rectangle, with a single + * texture spread across them. + * + * You can manipulate the corner points of the quad via the getters and setters such as `topLeftX`, and also + * change their alpha and color values. The quad itself can be moved by adjusting the `x` and `y` properties. + */ + class Quad extends Phaser.GameObjects.Mesh { + /** + * + * @param scene The Scene to which this Quad belongs. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer); + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + */ + setFrame(frame: string | integer): this; + + /** + * The top-left x vertex of this Quad. + */ + topLeftX: number; + + /** + * The top-left y vertex of this Quad. + */ + topLeftY: number; + + /** + * The top-right x vertex of this Quad. + */ + topRightX: number; + + /** + * The top-right y vertex of this Quad. + */ + topRightY: number; + + /** + * The bottom-left x vertex of this Quad. + */ + bottomLeftX: number; + + /** + * The bottom-left y vertex of this Quad. + */ + bottomLeftY: number; + + /** + * The bottom-right x vertex of this Quad. + */ + bottomRightX: number; + + /** + * The bottom-right y vertex of this Quad. + */ + bottomRightY: number; + + /** + * The top-left alpha value of this Quad. + */ + topLeftAlpha: number; + + /** + * The top-right alpha value of this Quad. + */ + topRightAlpha: number; + + /** + * The bottom-left alpha value of this Quad. + */ + bottomLeftAlpha: number; + + /** + * The bottom-right alpha value of this Quad. + */ + bottomRightAlpha: number; + + /** + * The top-left color value of this Quad. + */ + topLeftColor: number; + + /** + * The top-right color value of this Quad. + */ + topRightColor: number; + + /** + * The bottom-left color value of this Quad. + */ + bottomLeftColor: number; + + /** + * The bottom-right color value of this Quad. + */ + bottomRightColor: number; + + /** + * Sets the top-left vertex position of this Quad. + * @param x The horizontal coordinate of the vertex. + * @param y The vertical coordinate of the vertex. + */ + setTopLeft(x: number, y: number): Phaser.GameObjects.Quad; + + /** + * Sets the top-right vertex position of this Quad. + * @param x The horizontal coordinate of the vertex. + * @param y The vertical coordinate of the vertex. + */ + setTopRight(x: number, y: number): Phaser.GameObjects.Quad; + + /** + * Sets the bottom-left vertex position of this Quad. + * @param x The horizontal coordinate of the vertex. + * @param y The vertical coordinate of the vertex. + */ + setBottomLeft(x: number, y: number): Phaser.GameObjects.Quad; + + /** + * Sets the bottom-right vertex position of this Quad. + * @param x The horizontal coordinate of the vertex. + * @param y The vertical coordinate of the vertex. + */ + setBottomRight(x: number, y: number): Phaser.GameObjects.Quad; + + /** + * Resets the positions of the four corner vertices of this Quad. + */ + resetPosition(): Phaser.GameObjects.Quad; + + /** + * Resets the alpha values used by this Quad back to 1. + */ + resetAlpha(): Phaser.GameObjects.Quad; + + /** + * Resets the color values used by this Quad back to 0xffffff. + */ + resetColors(): Phaser.GameObjects.Quad; + + /** + * Resets the position, alpha and color values used by this Quad. + */ + reset(): Phaser.GameObjects.Quad; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + } + + /** + * A Render Texture. + * + * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and + * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic + * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. + * + * Note that under WebGL a FrameBuffer, which is what the Render Texture uses internally, cannot be anti-aliased. This means + * that when drawing objects such as Shapes to a Render Texture they will appear to be drawn with no aliasing, however this + * is a technical limitation of WebGL. To get around it, create your shape as a texture in an art package, then draw that + * to the Render Texture. + */ + class RenderTexture extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the Render Texture. Default 32. + * @param height The height of the Render Texture. Default 32. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, width?: integer, height?: integer); + + /** + * A reference to either the Canvas or WebGL Renderer that the Game instance is using. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * A reference to the Texture Manager. + */ + textureManager: Phaser.Textures.TextureManager; + + /** + * The tint of the Render Texture when rendered. + */ + globalTint: number; + + /** + * The alpha of the Render Texture when rendered. + */ + globalAlpha: number; + + /** + * The HTML Canvas Element that the Render Texture is drawing to when using the Canvas Renderer. + */ + canvas: HTMLCanvasElement; + + /** + * A reference to the GL Frame Buffer this Render Texture is drawing to. + * This is only set if Phaser is running with the WebGL Renderer. + */ + framebuffer: WebGLFramebuffer; + + /** + * Is this Render Texture dirty or not? If not it won't spend time clearing or filling itself. + */ + dirty: boolean; + + /** + * The Texture corresponding to this Render Texture. + */ + texture: Phaser.Textures.Texture; + + /** + * The Frame corresponding to this Render Texture. + */ + frame: Phaser.Textures.Frame; + + /** + * A reference to the Rendering Context belonging to the Canvas Element this Render Texture is drawing to. + */ + context: CanvasRenderingContext2D; + + /** + * An internal Camera that can be used to move around the Render Texture. + * Control it just like you would any Scene Camera. The difference is that it only impacts the placement of what + * is drawn to the Render Texture. You can scroll, zoom and rotate this Camera. + */ + camera: Phaser.Cameras.Scene2D.BaseCamera; + + /** + * A reference to the WebGL Rendering Context. + */ + gl: WebGLRenderingContext; + + /** + * Sets the size of this Game Object. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Resizes the Render Texture to the new dimensions given. + * + * If Render Texture was created from specific frame, only the size of the frame will be changed. The size of the source + * texture will not change. + * + * If Render Texture was not created from specific frame, the following will happen: + * In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture. + * In Canvas it will resize the underlying canvas element. + * Both approaches will erase everything currently drawn to the Render Texture. + * + * If the dimensions given are the same as those already being used, calling this method will do nothing. + * @param width The new width of the Render Texture. + * @param height The new height of the Render Texture. If not specified, will be set the same as the `width`. Default width. + */ + resize(width: number, height?: number): this; + + /** + * Set the tint to use when rendering this Render Texture. + * @param tint The tint value. + */ + setGlobalTint(tint: integer): this; + + /** + * Set the alpha to use when rendering this Render Texture. + * @param alpha The alpha value. + */ + setGlobalAlpha(alpha: number): this; + + /** + * Stores a copy of this Render Texture in the Texture Manager using the given key. + * + * After doing this, any texture based Game Object, such as a Sprite, can use the contents of this + * Render Texture by using the texture key: + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 128, 128); + * + * // Draw something to the Render Texture + * + * rt.saveTexture('doodle'); + * + * this.add.image(400, 300, 'doodle'); + * ``` + * + * Updating the contents of this Render Texture will automatically update _any_ Game Object + * that is using it as a texture. Calling `saveTexture` again will not save another copy + * of the same texture, it will just rename the key of the existing copy. + * + * By default it will create a single base texture. You can add frames to the texture + * by using the `Texture.add` method. After doing this, you can then allow Game Objects + * to use a specific frame from a Render Texture. + * @param key The unique key to store the texture as within the global Texture Manager. + */ + saveTexture(key: string): Phaser.Textures.Texture; + + /** + * Fills the Render Texture with the given color. + * @param rgb The color to fill the Render Texture with. + * @param alpha The alpha value used by the fill. Default 1. + * @param x The left coordinate of the fill rectangle. Default 0. + * @param y The top coordinate of the fill rectangle. Default 0. + * @param width The width of the fill rectangle. Default this.frame.cutWidth. + * @param height The height of the fill rectangle. Default this.frame.cutHeight. + */ + fill(rgb: number, alpha?: number, x?: number, y?: number, width?: number, height?: number): this; + + /** + * Clears the Render Texture. + */ + clear(): this; + + /** + * Draws the given object, or an array of objects, to this Render Texture using a blend mode of ERASE. + * This has the effect of erasing any filled pixels in the objects from this Render Texture. + * + * It can accept any of the following: + * + * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. + * * Dynamic and Static Tilemap Layers. + * * A Group. The contents of which will be iterated and drawn in turn. + * * A Container. The contents of which will be iterated fully, and drawn in turn. + * * A Scene's Display List. Pass in `Scene.children` to draw the whole list. + * * Another Render Texture. + * * A Texture Frame instance. + * * A string. This is used to look-up a texture from the Texture Manager. + * + * Note: You cannot erase a Render Texture from itself. + * + * If passing in a Group or Container it will only draw children that return `true` + * when their `willRender()` method is called. I.e. a Container with 10 children, + * 5 of which have `visible=false` will only draw the 5 visible ones. + * + * If passing in an array of Game Objects it will draw them all, regardless if + * they pass a `willRender` check or not. + * + * You can pass in a string in which case it will look for a texture in the Texture + * Manager matching that string, and draw the base frame. + * + * You can pass in the `x` and `y` coordinates to draw the objects at. The use of + * the coordinates differ based on what objects are being drawn. If the object is + * a Group, Container or Display List, the coordinates are _added_ to the positions + * of the children. For all other types of object, the coordinates are exact. + * + * Calling this method causes the WebGL batch to flush, so it can write the texture + * data to the framebuffer being used internally. The batch is flushed at the end, + * after the entries have been iterated. So if you've a bunch of objects to draw, + * try and pass them in an array in one single call, rather than making lots of + * separate calls. + * @param entries Any renderable Game Object, or Group, Container, Display List, other Render Texture, Texture Frame or an array of any of these. + * @param x The x position to draw the Frame at, or the offset applied to the object. + * @param y The y position to draw the Frame at, or the offset applied to the object. + */ + erase(entries: any, x?: number, y?: number): this; + + /** + * Draws the given object, or an array of objects, to this Render Texture. + * + * It can accept any of the following: + * + * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. + * * Dynamic and Static Tilemap Layers. + * * A Group. The contents of which will be iterated and drawn in turn. + * * A Container. The contents of which will be iterated fully, and drawn in turn. + * * A Scene's Display List. Pass in `Scene.children` to draw the whole list. + * * Another Render Texture. + * * A Texture Frame instance. + * * A string. This is used to look-up a texture from the Texture Manager. + * + * Note: You cannot draw a Render Texture to itself. + * + * If passing in a Group or Container it will only draw children that return `true` + * when their `willRender()` method is called. I.e. a Container with 10 children, + * 5 of which have `visible=false` will only draw the 5 visible ones. + * + * If passing in an array of Game Objects it will draw them all, regardless if + * they pass a `willRender` check or not. + * + * You can pass in a string in which case it will look for a texture in the Texture + * Manager matching that string, and draw the base frame. If you need to specify + * exactly which frame to draw then use the method `drawFrame` instead. + * + * You can pass in the `x` and `y` coordinates to draw the objects at. The use of + * the coordinates differ based on what objects are being drawn. If the object is + * a Group, Container or Display List, the coordinates are _added_ to the positions + * of the children. For all other types of object, the coordinates are exact. + * + * The `alpha` and `tint` values are only used by Texture Frames. + * Game Objects use their own alpha and tint values when being drawn. + * + * Calling this method causes the WebGL batch to flush, so it can write the texture + * data to the framebuffer being used internally. The batch is flushed at the end, + * after the entries have been iterated. So if you've a bunch of objects to draw, + * try and pass them in an array in one single call, rather than making lots of + * separate calls. + * @param entries Any renderable Game Object, or Group, Container, Display List, other Render Texture, Texture Frame or an array of any of these. + * @param x The x position to draw the Frame at, or the offset applied to the object. + * @param y The y position to draw the Frame at, or the offset applied to the object. + * @param alpha The alpha value. Only used for Texture Frames and if not specified defaults to the `globalAlpha` property. Game Objects use their own current alpha value. + * @param tint WebGL only. The tint color value. Only used for Texture Frames and if not specified defaults to the `globalTint` property. Game Objects use their own current tint value. + */ + draw(entries: any, x?: number, y?: number, alpha?: number, tint?: number): this; + + /** + * Draws the Texture Frame to the Render Texture at the given position. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 800, 600); + * rt.drawFrame(key, frame); + * ``` + * + * You can optionally provide a position, alpha and tint value to apply to the frame + * before it is drawn. + * + * Calling this method will cause a batch flush, so if you've got a stack of things to draw + * in a tight loop, try using the `draw` method instead. + * + * If you need to draw a Sprite to this Render Texture, use the `draw` method instead. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + * @param x The x position to draw the frame at. Default 0. + * @param y The y position to draw the frame at. Default 0. + * @param alpha The alpha to use. If not specified it uses the `globalAlpha` property. + * @param tint WebGL only. The tint color to use. If not specified it uses the `globalTint` property. + */ + drawFrame(key: string, frame?: string | integer, x?: number, y?: number, alpha?: number, tint?: number): this; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Shader Game Object. + * + * This Game Object allows you to easily add a quad with its own shader into the display list, and manipulate it + * as you would any other Game Object, including scaling, rotating, positioning and adding to Containers. Shaders + * can be masked with either Bitmap or Geometry masks and can also be used as a Bitmap Mask for a Camera or other + * Game Object. They can also be made interactive and used for input events. + * + * It works by taking a reference to a `Phaser.Display.BaseShader` instance, as found in the Shader Cache. These can + * be created dynamically at runtime, or loaded in via the GLSL File Loader: + * + * ```javascript + * function preload () + * { + * this.load.glsl('fire', 'shaders/fire.glsl.js'); + * } + * + * function create () + * { + * this.add.shader('fire', 400, 300, 512, 512); + * } + * ``` + * + * Please see the Phaser 3 Examples GitHub repo for examples of loading and creating shaders dynamically. + * + * Due to the way in which they work, you cannot directly change the alpha or blend mode of a Shader. This should + * be handled via exposed uniforms in the shader code itself. + * + * By default a Shader will be created with a standard set of uniforms. These were added to match those + * found on sites such as ShaderToy or GLSLSandbox, and provide common functionality a shader may need, + * such as the timestamp, resolution or pointer position. You can replace them by specifying your own uniforms + * in the Base Shader. + * + * These Shaders work by halting the current pipeline during rendering, creating a viewport matched to the + * size of this Game Object and then renders a quad using the bound shader. At the end, the pipeline is restored. + * + * Because it blocks the pipeline it means it will interrupt any batching that is currently going on, so you should + * use these Game Objects sparingly. If you need to have a fully batched custom shader, then please look at using + * a custom pipeline instead. However, for background or special masking effects, they are extremely effective. + */ + class Shader extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param key The key of the shader to use from the shader cache, or a BaseShader instance. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the Game Object. Default 128. + * @param height The height of the Game Object. Default 128. + * @param textures Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. + */ + constructor(scene: Phaser.Scene, key: string | Phaser.Display.BaseShader, x?: number, y?: number, width?: number, height?: number, textures?: string[]); + + /** + * The underlying shader object being used. + * Empty by default and set during a call to the `setShader` method. + */ + shader: Phaser.Display.BaseShader; + + /** + * A reference to the current renderer. + * Shaders only work with the WebGL Renderer. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The WebGL context belonging to the renderer. + */ + gl: WebGLRenderingContext; + + /** + * Raw byte buffer of vertices this Shader uses. + */ + vertexData: ArrayBuffer; + + /** + * The WebGL vertex buffer object this shader uses. + */ + vertexBuffer: WebGLBuffer; + + /** + * The WebGL shader program this shader uses. + */ + program: WebGLProgram; + + /** + * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources to the GPU. + */ + bytes: Uint8Array; + + /** + * Float32 view of the array buffer containing the shaders vertices. + */ + vertexViewF32: Float32Array; + + /** + * The view matrix the shader uses during rendering. + */ + readonly viewMatrix: Float32Array; + + /** + * The projection matrix the shader uses during rendering. + */ + readonly projectionMatrix: Float32Array; + + /** + * The default uniform mappings. These can be added to (or replaced) by specifying your own uniforms when + * creating this shader game object. The uniforms are updated automatically during the render step. + * + * The defaults are: + * + * `resolution` (2f) - Set to the size of this shader. + * `time` (1f) - The elapsed game time, in seconds. + * `mouse` (2f) - If a pointer has been bound (with `setPointer`), this uniform contains its position each frame. + * `date` (4fv) - A vec4 containing the year, month, day and time in seconds. + * `sampleRate` (1f) - Sound sample rate. 44100 by default. + * `iChannel0...3` (sampler2D) - Input channels 0 to 3. `null` by default. + */ + uniforms: any; + + /** + * The pointer bound to this shader, if any. + * Set via the chainable `setPointer` method, or by modifying this property directly. + */ + pointer: Phaser.Input.Pointer; + + /** + * Sets the fragment and, optionally, the vertex shader source code that this Shader will use. + * This will immediately delete the active shader program, if set, and then create a new one + * with the given source. Finally, the shader uniforms are initialized. + * @param key The key of the shader to use from the shader cache, or a BaseShader instance. + * @param textures Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. + */ + setShader(key: string | Phaser.Display.BaseShader, textures?: string[]): this; + + /** + * Binds a Phaser Pointer object to this Shader. + * + * The screen position of the pointer will be set in to the shaders `mouse` uniform + * automatically every frame. Call this method with no arguments to unbind the pointer. + * @param pointer The Pointer to bind to this shader. + */ + setPointer(pointer?: Phaser.Input.Pointer): this; + + /** + * Sets this shader to use an orthographic projection matrix. + * This matrix is stored locally in the `projectionMatrix` property, + * as well as being bound to the `uProjectionMatrix` uniform. + * @param left The left value. + * @param right The right value. + * @param bottom The bottom value. + * @param top The top value. + */ + projOrtho(left: number, right: number, bottom: number, top: number): void; + + /** + * Sets a sampler2D uniform on this shader. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * @param uniformKey The key of the sampler2D uniform to be updated, i.e. `iChannel0`. + * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param textureIndex The texture index. Default 0. + * @param textureData Additional texture data. + */ + setSampler2D(uniformKey: string, textureKey: string, textureIndex?: integer, textureData?: any): this; + + /** + * Sets a property of a uniform already present on this shader. + * + * To modify the value of a uniform such as a 1f or 1i use the `value` property directly: + * + * ```javascript + * shader.setUniform('size.value', 16); + * ``` + * + * You can use dot notation to access deeper values, for example: + * + * ```javascript + * shader.setUniform('resolution.value.x', 512); + * ``` + * + * The change to the uniform will take effect the next time the shader is rendered. + * @param key The key of the uniform to modify. Use dots for deep properties, i.e. `resolution.value.x`. + * @param value The value to set into the uniform. + */ + setUniform(key: string, value: any): this; + + /** + * Returns the uniform object for the given key, or `null` if the uniform couldn't be found. + * @param key The key of the uniform to return the value for. + */ + getUniform(key: string): this; + + /** + * A short-cut method that will directly set the texture being used by the `iChannel0` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param textureData Additional texture data. + */ + setChannel0(textureKey: string, textureData?: any): this; + + /** + * A short-cut method that will directly set the texture being used by the `iChannel1` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param textureData Additional texture data. + */ + setChannel1(textureKey: string, textureData?: any): this; + + /** + * A short-cut method that will directly set the texture being used by the `iChannel2` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param textureData Additional texture data. + */ + setChannel2(textureKey: string, textureData?: any): this; + + /** + * A short-cut method that will directly set the texture being used by the `iChannel3` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * @param textureKey The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param textureData Additional texture data. + */ + setChannel3(textureKey: string, textureData?: any): this; + + /** + * Called automatically during render. + * + * This method performs matrix ITRS and then stores the resulting value in the `uViewMatrix` uniform. + * It then sets up the vertex buffer and shader, updates and syncs the uniforms ready + * for flush to be called. + * @param matrix2D The transform matrix to use during rendering. + */ + load(matrix2D: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Called automatically during render. + * + * Sets the active shader, loads the vertex buffer and then draws. + */ + flush(): void; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an arc shape. You can control the start and end angles of the arc, + * as well as if the angles are winding clockwise or anti-clockwise. With the default settings + * it renders as a complete circle. By changing the angles you can create other arc shapes, + * such as half-circles. + * + * Arcs also have an `iterations` property and corresponding `setIterations` method. This allows + * you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. + */ + class Arc extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param radius The radius of the arc. Default 128. + * @param startAngle The start angle of the arc, in degrees. Default 0. + * @param endAngle The end angle of the arc, in degrees. Default 360. + * @param anticlockwise The winding order of the start and end angles. Default false. + * @param fillColor The color the arc will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, radius?: number, startAngle?: integer, endAngle?: integer, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number); + + /** + * The number of iterations used when drawing the arc. + * Increase this value for smoother arcs, at the cost of more polygons being rendered. + * Modify this value by small amounts, such as 0.01. + */ + iterations: number; + + /** + * The radius of the arc. + */ + radius: number; + + /** + * The start angle of the arc, in degrees. + */ + startAngle: integer; + + /** + * The end angle of the arc, in degrees. + */ + endAngle: integer; + + /** + * The winding order of the start and end angles. + */ + anticlockwise: boolean; + + /** + * Sets the radius of the arc. + * This call can be chained. + * @param value The value to set the radius to. + */ + setRadius(value: number): this; + + /** + * Sets the number of iterations used when drawing the arc. + * Increase this value for smoother arcs, at the cost of more polygons being rendered. + * Modify this value by small amounts, such as 0.01. + * This call can be chained. + * @param value The value to set the iterations to. + */ + setIterations(value: number): this; + + /** + * Sets the starting angle of the arc, in degrees. + * This call can be chained. + * @param value The value to set the starting angle to. + */ + setStartAngle(value: integer): this; + + /** + * Sets the ending angle of the arc, in degrees. + * This call can be chained. + * @param value The value to set the ending angle to. + */ + setEndAngle(value: integer): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to + * the Curve Shape in the constructor. + * + * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + */ + class Curve extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param curve The Curve object to use to create the Shape. + * @param fillColor The color the curve will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the curve will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, curve?: Phaser.Curves.Curve, fillColor?: number, fillAlpha?: number); + + /** + * The smoothness of the curve. The number of points used when rendering it. + * Increase this value for smoother curves, at the cost of more polygons being rendered. + */ + smoothness: integer; + + /** + * Sets the smoothness of the curve. The number of points used when rendering it. + * Increase this value for smoother curves, at the cost of more polygons being rendered. + * This call can be chained. + * @param value The value to set the smoothness to. + */ + setSmoothness(value: integer): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. + * If the width and height match it will render as a circle. If the width is less than the height, + * it will look more like an egg shape. + * + * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + */ + class Ellipse extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. + * @param height The height of the ellipse. An ellipse with equal width and height renders as a circle. Default 128. + * @param fillColor The color the ellipse will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number); + + /** + * The smoothness of the ellipse. The number of points used when rendering it. + * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. + */ + smoothness: integer; + + /** + * Sets the size of the ellipse by changing the underlying geometry data, rather than scaling the object. + * This call can be chained. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + */ + setSize(width: number, height: number): this; + + /** + * Sets the smoothness of the ellipse. The number of points used when rendering it. + * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. + * This call can be chained. + * @param value The value to set the smoothness to. + */ + setSmoothness(value: integer): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * A Grid Shape allows you to display a grid in your game, where you can control the size of the + * grid as well as the width and height of the grid cells. You can set a fill color for each grid + * cell as well as an alternate fill color. When the alternate fill color is set then the grid + * cells will alternate the fill colors as they render, creating a chess-board effect. You can + * also optionally have an outline fill color. If set, this draws lines between the grid cells + * in the given color. If you specify an outline color with an alpha of zero, then it will draw + * the cells spaced out, but without the lines between them. + */ + class Grid extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param width The width of the grid. Default 128. + * @param height The height of the grid. Default 128. + * @param cellWidth The width of one cell in the grid. Default 32. + * @param cellHeight The height of one cell in the grid. Default 32. + * @param fillColor The color the grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * @param outlineFillColor The color of the lines between the grid cells. See the `setOutline` method. + * @param outlineFillAlpha The alpha of the lines between the grid cells. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, width?: number, height?: number, cellWidth?: number, cellHeight?: number, fillColor?: number, fillAlpha?: number, outlineFillColor?: number, outlineFillAlpha?: number); + + /** + * The width of each grid cell. + * Must be a positive value. + */ + cellWidth: number; + + /** + * The height of each grid cell. + * Must be a positive value. + */ + cellHeight: number; + + /** + * Will the grid render its cells in the `fillColor`? + */ + showCells: boolean; + + /** + * The color of the lines between each grid cell. + */ + outlineFillColor: number; + + /** + * The alpha value for the color of the lines between each grid cell. + */ + outlineFillAlpha: number; + + /** + * Will the grid display the lines between each cell when it renders? + */ + showOutline: boolean; + + /** + * Will the grid render the alternating cells in the `altFillColor`? + */ + showAltCells: boolean; + + /** + * The color the alternating grid cells will be filled with, i.e. 0xff0000 for red. + */ + altFillColor: number; + + /** + * The alpha the alternating grid cells will be filled with. + * You can also set the alpha of the overall Shape using its `alpha` property. + */ + altFillAlpha: number; + + /** + * Sets the fill color and alpha level the grid cells will use when rendering. + * + * If this method is called with no values then the grid cells will not be rendered, + * however the grid lines and alternating cells may still be. + * + * Also see the `setOutlineStyle` and `setAltFillStyle` methods. + * + * This call can be chained. + * @param fillColor The color the grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. Default 1. + */ + setFillStyle(fillColor?: number, fillAlpha?: number): this; + + /** + * Sets the fill color and alpha level that the alternating grid cells will use. + * + * If this method is called with no values then alternating grid cells will not be rendered in a different color. + * + * Also see the `setOutlineStyle` and `setFillStyle` methods. + * + * This call can be chained. + * @param fillColor The color the alternating grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the alternating grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. Default 1. + */ + setAltFillStyle(fillColor?: number, fillAlpha?: number): this; + + /** + * Sets the fill color and alpha level that the lines between each grid cell will use. + * + * If this method is called with no values then the grid lines will not be rendered at all, however + * the cells themselves may still be if they have colors set. + * + * Also see the `setFillStyle` and `setAltFillStyle` methods. + * + * This call can be chained. + * @param fillColor The color the lines between the grid cells will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the lines between the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. Default 1. + */ + setOutlineStyle(fillColor?: number, fillAlpha?: number): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set + * the color of the top, left and right faces of the rectangle respectively. You can also choose + * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting + * the `projection` property. + */ + class IsoBox extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param size The width of the iso box in pixels. The left and right faces will be exactly half this value. Default 48. + * @param height The height of the iso box. The left and right faces will be this tall. The overall height of the isobox will be this value plus half the `size` value. Default 32. + * @param fillTop The fill color of the top face of the iso box. Default 0xeeeeee. + * @param fillLeft The fill color of the left face of the iso box. Default 0x999999. + * @param fillRight The fill color of the right face of the iso box. Default 0xcccccc. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, size?: number, height?: number, fillTop?: number, fillLeft?: number, fillRight?: number); + + /** + * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. + */ + projection: integer; + + /** + * The color used to fill in the top of the iso box. + */ + fillTop: number; + + /** + * The color used to fill in the left-facing side of the iso box. + */ + fillLeft: number; + + /** + * The color used to fill in the right-facing side of the iso box. + */ + fillRight: number; + + /** + * Controls if the top-face of the iso box be rendered. + */ + showTop: boolean; + + /** + * Controls if the left-face of the iso box be rendered. + */ + showLeft: boolean; + + /** + * Controls if the right-face of the iso box be rendered. + */ + showRight: boolean; + + /** + * Sets the projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. + * This call can be chained. + * @param value The value to set the projection to. + */ + setProjection(value: integer): this; + + /** + * Sets which faces of the iso box will be rendered. + * This call can be chained. + * @param showTop Show the top-face of the iso box. Default true. + * @param showLeft Show the left-face of the iso box. Default true. + * @param showRight Show the right-face of the iso box. Default true. + */ + setFaces(showTop?: boolean, showLeft?: boolean, showRight?: boolean): this; + + /** + * Sets the fill colors for each face of the iso box. + * This call can be chained. + * @param fillTop The color used to fill the top of the iso box. + * @param fillLeft The color used to fill in the left-facing side of the iso box. + * @param fillRight The color used to fill in the right-facing side of the iso box. + */ + setFillStyle(fillTop?: number, fillLeft?: number, fillRight?: number): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different + * fill color. You can set the color of the top, left and right faces of the triangle respectively + * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting + * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside + * down or not. + */ + class IsoTriangle extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param size The width of the iso triangle in pixels. The left and right faces will be exactly half this value. Default 48. + * @param height The height of the iso triangle. The left and right faces will be this tall. The overall height of the iso triangle will be this value plus half the `size` value. Default 32. + * @param reversed Is the iso triangle upside down? Default false. + * @param fillTop The fill color of the top face of the iso triangle. Default 0xeeeeee. + * @param fillLeft The fill color of the left face of the iso triangle. Default 0x999999. + * @param fillRight The fill color of the right face of the iso triangle. Default 0xcccccc. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, size?: number, height?: number, reversed?: boolean, fillTop?: number, fillLeft?: number, fillRight?: number); + + /** + * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. + */ + projection: integer; + + /** + * The color used to fill in the top of the iso triangle. This is only used if the triangle is reversed. + */ + fillTop: number; + + /** + * The color used to fill in the left-facing side of the iso triangle. + */ + fillLeft: number; + + /** + * The color used to fill in the right-facing side of the iso triangle. + */ + fillRight: number; + + /** + * Controls if the top-face of the iso triangle be rendered. + */ + showTop: boolean; + + /** + * Controls if the left-face of the iso triangle be rendered. + */ + showLeft: boolean; + + /** + * Controls if the right-face of the iso triangle be rendered. + */ + showRight: boolean; + + /** + * Sets if the iso triangle will be rendered upside down or not. + */ + isReversed: boolean; + + /** + * Sets the projection level of the iso triangle. Change this to change the 'angle' at which you are looking at the pyramid. + * This call can be chained. + * @param value The value to set the projection to. + */ + setProjection(value: integer): this; + + /** + * Sets if the iso triangle will be rendered upside down or not. + * This call can be chained. + * @param reversed Sets if the iso triangle will be rendered upside down or not. + */ + setReversed(reversed: boolean): this; + + /** + * Sets which faces of the iso triangle will be rendered. + * This call can be chained. + * @param showTop Show the top-face of the iso triangle (only if `reversed` is true) Default true. + * @param showLeft Show the left-face of the iso triangle. Default true. + * @param showRight Show the right-face of the iso triangle. Default true. + */ + setFaces(showTop?: boolean, showLeft?: boolean, showRight?: boolean): this; + + /** + * Sets the fill colors for each face of the iso triangle. + * This call can be chained. + * @param fillTop The color used to fill the top of the iso triangle. + * @param fillLeft The color used to fill in the left-facing side of the iso triangle. + * @param fillRight The color used to fill in the right-facing side of the iso triangle. + */ + setFillStyle(fillTop?: number, fillLeft?: number, fillRight?: number): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only stroke colors and cannot be filled. + * + * A Line Shape allows you to draw a line between two points in your game. You can control the + * stroke color and thickness of the line. In WebGL only you can also specify a different + * thickness for the start and end of the line, allowing you to render lines that taper-off. + * + * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. + * + * Be aware that as with all Game Objects the default origin is 0.5. If you need to draw a Line + * between two points and want the x1/y1 values to match the x/y values, then set the origin to 0. + */ + class Line extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the start of the line. Default 0. + * @param y1 The vertical position of the start of the line. Default 0. + * @param x2 The horizontal position of the end of the line. Default 128. + * @param y2 The vertical position of the end of the line. Default 0. + * @param strokeColor The color the line will be drawn in, i.e. 0xff0000 for red. + * @param strokeAlpha The alpha the line will be drawn in. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, strokeColor?: number, strokeAlpha?: number); + + /** + * The width (or thickness) of the line. + * See the setLineWidth method for extra details on changing this on WebGL. + */ + lineWidth: number; + + /** + * Sets the width of the line. + * + * When using the WebGL renderer you can have different start and end widths. + * When using the Canvas renderer only the `startWidth` value is used. The `endWidth` is ignored. + * + * This call can be chained. + * @param startWidth The start width of the line. + * @param endWidth The end width of the line. Only used in WebGL. + */ + setLineWidth(startWidth: number, endWidth?: number): this; + + /** + * Sets the start and end coordinates of this Line. + * @param x1 The horizontal position of the start of the line. Default 0. + * @param y1 The vertical position of the start of the line. Default 0. + * @param x2 The horizontal position of the end of the line. Default 0. + * @param y2 The vertical position of the end of the line. Default 0. + */ + setTo(x1?: number, y1?: number, x2?: number, y2?: number): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Polygon Shape is created by providing a list of points, which are then used to create an + * internal Polygon geometry object. The points can be set from a variety of formats: + * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point or Vector2 objects: `[new Phaser.Math.Vec2(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending + * on the coordinates of the points provided, the final shape may be rendered offset from its origin. + */ + class Polygon extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The points that make up the polygon. + * @param fillColor The color the polygon will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the polygon will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, points?: any, fillColor?: number, fillAlpha?: number); + + /** + * Smooths the polygon over the number of iterations specified. + * The base polygon data will be updated and replaced with the smoothed values. + * This call can be chained. + * @param iterations The number of times to apply the polygon smoothing. Default 1. + */ + smooth(iterations?: integer): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * You can change the size of the rectangle by changing the `width` and `height` properties. + */ + class Rectangle extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the rectangle. Default 128. + * @param height The height of the rectangle. Default 128. + * @param fillColor The color the rectangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the rectangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x: number, y: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number); + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. + * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. + */ + class Shape extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param type The internal type of the Shape. + * @param data The data of the source shape geometry, if any. + */ + constructor(scene: Phaser.Scene, type?: string, data?: any); + + /** + * The source Shape data. Typically a geometry object. + * You should not manipulate this directly. + */ + readonly data: any; + + /** + * Holds the polygon path data for filled rendering. + */ + readonly pathData: number[]; + + /** + * Holds the earcut polygon path index data for filled rendering. + */ + readonly pathIndexes: integer[]; + + /** + * The fill color used by this Shape. + */ + fillColor: number; + + /** + * The fill alpha value used by this Shape. + */ + fillAlpha: number; + + /** + * The stroke color used by this Shape. + */ + strokeColor: number; + + /** + * The stroke alpha value used by this Shape. + */ + strokeAlpha: number; + + /** + * The stroke line width used by this Shape. + */ + lineWidth: number; + + /** + * Controls if this Shape is filled or not. + * Note that some Shapes do not support being filled (such as Line shapes) + */ + isFilled: boolean; + + /** + * Controls if this Shape is stroked or not. + * Note that some Shapes do not support being stroked (such as Iso Box shapes) + */ + isStroked: boolean; + + /** + * Controls if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + */ + closePath: boolean; + + /** + * Sets the fill color and alpha for this Shape. + * + * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. + * + * Note that some Shapes do not support fill colors, such as the Line shape. + * + * This call can be chained. + * @param color The color used to fill this shape. If not provided the Shape will not be filled. + * @param alpha The alpha value used when filling this shape, if a fill color is given. Default 1. + */ + setFillStyle(color?: number, alpha?: number): this; + + /** + * Sets the stroke color and alpha for this Shape. + * + * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. + * + * Note that some Shapes do not support being stroked, such as the Iso Box shape. + * + * This call can be chained. + * @param lineWidth The width of line to stroke with. If not provided or undefined the Shape will not be stroked. + * @param color The color used to stroke this shape. If not provided the Shape will not be stroked. + * @param alpha The alpha value used when stroking this shape, if a stroke color is given. Default 1. + */ + setStrokeStyle(lineWidth?: number, color?: number, alpha?: number): this; + + /** + * Sets if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * This call can be chained. + * @param value Set to `true` if the Shape should be closed when stroked, otherwise `false`. + */ + setClosePath(value: boolean): this; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * As the name implies, the Star shape will display a star in your game. You can control several + * aspects of it including the number of points that constitute the star. The default is 5. If + * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky + * star shape. + * + * You can also control the inner and outer radius, which is how 'long' each point of the star is. + * Modify these values to create more interesting shapes. + */ + class Star extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The number of points on the star. Default 5. + * @param innerRadius The inner radius of the star. Default 32. + * @param outerRadius The outer radius of the star. Default 64. + * @param fillColor The color the star will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, points?: number, innerRadius?: number, outerRadius?: number, fillColor?: number, fillAlpha?: number); + + /** + * Sets the number of points that make up the Star shape. + * This call can be chained. + * @param value The amount of points the Star will have. + */ + setPoints(value: integer): this; + + /** + * Sets the inner radius of the Star shape. + * This call can be chained. + * @param value The amount to set the inner radius to. + */ + setInnerRadius(value: number): this; + + /** + * Sets the outer radius of the Star shape. + * This call can be chained. + * @param value The amount to set the outer radius to. + */ + setOuterRadius(value: number): this; + + /** + * The number of points that make up the Star shape. + */ + points: integer; + + /** + * The inner radius of the Star shape. + */ + innerRadius: number; + + /** + * The outer radius of the Star shape. + */ + outerRadius: number; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the + * position of each point of these lines. The triangle is always closed and cannot have an open + * face. If you require that, consider using a Polygon instead. + */ + class Triangle extends Phaser.GameObjects.Shape { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the first point in the triangle. Default 0. + * @param y1 The vertical position of the first point in the triangle. Default 128. + * @param x2 The horizontal position of the second point in the triangle. Default 64. + * @param y2 The vertical position of the second point in the triangle. Default 0. + * @param x3 The horizontal position of the third point in the triangle. Default 128. + * @param y3 The vertical position of the third point in the triangle. Default 128. + * @param fillColor The color the triangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number, fillColor?: number, fillAlpha?: number); + + /** + * Sets the data for the lines that make up this Triangle shape. + * @param x1 The horizontal position of the first point in the triangle. Default 0. + * @param y1 The vertical position of the first point in the triangle. Default 0. + * @param x2 The horizontal position of the second point in the triangle. Default 0. + * @param y2 The vertical position of the second point in the triangle. Default 0. + * @param x3 The horizontal position of the third point in the triangle. Default 0. + * @param y3 The vertical position of the third point in the triangle. Default 0. + */ + setTo(x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number): this; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Sprite Game Object. + * + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + */ + class Sprite extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer); + + /** + * The Animation Controller of this Sprite. + */ + anims: Phaser.GameObjects.Components.Animation; + + /** + * Update this Sprite's animations. + * @param time The current timestamp. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected preUpdate(time: number, delta: number): void; + + /** + * Start playing the given animation. + * @param key The string-based key of the animation to play. + * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. + * @param startFrame Optionally start the animation playing from this frame index. Default 0. + */ + play(key: string, ignoreIfPlaying?: boolean, startFrame?: integer): Phaser.GameObjects.Sprite; + + /** + * Build a JSON representation of this Sprite. + */ + toJSON(): Phaser.Types.GameObjects.JSONGameObject; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Text Game Object. + * + * Text objects work by creating their own internal hidden Canvas and then renders text to it using + * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered + * to your game during the render pass. + * + * Because it uses the Canvas API you can take advantage of all the features this offers, such as + * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts + * loaded externally, such as Google or TypeKit Web fonts. + * + * **Important:** If the font you wish to use has a space or digit in its name, such as + * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes, either + * when creating the Text object, or when setting the font via `setFont` or `setFontFamily`. I.e.: + * + * ```javascript + * this.add.text(0, 0, 'Hello World', { fontFamily: '"Roboto Condensed"' }); + * ``` + * + * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all + * quoted properly, too: + * + * ```javascript + * this.add.text(0, 0, 'Hello World', { fontFamily: 'Verdana, "Times New Roman", Tahoma, serif' }); + * ``` + * + * You can only display fonts that are currently loaded and available to the browser: therefore fonts must + * be pre-loaded. Phaser does not do ths for you, so you will require the use of a 3rd party font loader, + * or have the fonts ready available in the CSS on the page in which your Phaser game resides. + * + * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts + * across mobile browsers. + * + * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being + * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the + * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of + * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text + * instead, as it benefits from batching and avoids expensive Canvas API calls. + */ + class Text extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Crop, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param text The text this Text object will display. + * @param style The text style configuration object. + */ + constructor(scene: Phaser.Scene, x: number, y: number, text: string | string[], style: Phaser.Types.GameObjects.Text.TextSyle); + + /** + * Returns an object containing dimensions of the Text object. + * @param text The Text object to calculate the size from. + * @param size The Text metrics to use when calculating the size. + * @param lines The lines of text to calculate the size from. + */ + static GetTextSize(text: Phaser.GameObjects.Text, size: Phaser.Types.GameObjects.Text.TextMetrics, lines: any[]): object; + + /** + * Calculates the ascent, descent and fontSize of a given font style. + * @param textStyle The TextStyle object to measure. + */ + static MeasureText(textStyle: Phaser.GameObjects.TextStyle): Phaser.Types.GameObjects.Text.TextMetrics; + + /** + * The renderer in use by this Text object. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The canvas element that the text is rendered to. + */ + canvas: HTMLCanvasElement; + + /** + * The context of the canvas element that the text is rendered to. + */ + context: CanvasRenderingContext2D; + + /** + * The Text Style object. + * + * Manages the style of this Text object. + */ + style: Phaser.GameObjects.TextStyle; + + /** + * Whether to automatically round line positions. + */ + autoRound: boolean; + + /** + * The Regular Expression that is used to split the text up into lines, in + * multi-line text. By default this is `/(?:\r\n|\r|\n)/`. + * You can change this RegExp to be anything else that you may need. + */ + splitRegExp: object; + + /** + * Specify a padding value which is added to the line width and height when calculating the Text size. + * Allows you to add extra spacing if the browser is unable to accurately determine the true font dimensions. + */ + padding: Object; + + /** + * The width of this Text object. + */ + width: number; + + /** + * The height of this Text object. + */ + height: number; + + /** + * The line spacing value. + * This value is added to the font height to calculate the overall line height. + * Only has an effect if this Text object contains multiple lines of text. + * + * If you update this property directly, instead of using the `setLineSpacing` method, then + * be sure to call `updateText` after, or you won't see the change reflected in the Text object. + */ + lineSpacing: number; + + /** + * Whether the text or its settings have changed and need updating. + */ + dirty: boolean; + + /** + * Initialize right to left text. + */ + initRTL(): void; + + /** + * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal + * bounds. + * @param text The text to perform word wrap detection against. + */ + runWordWrap(text: string): string; + + /** + * Advanced wrapping algorithm that will wrap words as the line grows longer than its horizontal + * bounds. Consecutive spaces will be collapsed and replaced with a single space. Lines will be + * trimmed of white space before processing. Throws an error if wordWrapWidth is less than a + * single character. + * @param text The text to perform word wrap detection against. + * @param context The Canvas Rendering Context. + * @param wordWrapWidth The word wrap width. + */ + advancedWordWrap(text: string, context: CanvasRenderingContext2D, wordWrapWidth: number): string; + + /** + * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal + * bounds. Spaces are not collapsed and whitespace is not trimmed. + * @param text The text to perform word wrap detection against. + * @param context The Canvas Rendering Context. + * @param wordWrapWidth The word wrap width. + */ + basicWordWrap(text: string, context: CanvasRenderingContext2D, wordWrapWidth: number): string; + + /** + * Runs the given text through this Text objects word wrapping and returns the results as an + * array, where each element of the array corresponds to a wrapped line of text. + * @param text The text for which the wrapping will be calculated. If unspecified, the Text objects current text will be used. + */ + getWrappedText(text: string): string[]; + + /** + * Set the text to display. + * + * An array of strings will be joined with `\n` line breaks. + * @param value The string, or array of strings, to be set as the content of this Text object. + */ + setText(value: string | string[]): Phaser.GameObjects.Text; + + /** + * Set the text style. + * @param style The style settings to set. + */ + setStyle(style: object): Phaser.GameObjects.Text; + + /** + * Set the font. + * + * If a string is given, the font family is set. + * + * If an object is given, the `fontFamily`, `fontSize` and `fontStyle` + * properties of that object are set. + * + * **Important:** If the font you wish to use has a space or digit in its name, such as + * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes: + * + * ```javascript + * Text.setFont('"Roboto Condensed"'); + * ``` + * + * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all + * quoted properly, too: + * + * ```javascript + * Text.setFont('Verdana, "Times New Roman", Tahoma, serif'); + * ``` + * @param font The font family or font settings to set. + */ + setFont(font: string): Phaser.GameObjects.Text; + + /** + * Set the font family. + * + * **Important:** If the font you wish to use has a space or digit in its name, such as + * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes: + * + * ```javascript + * Text.setFont('"Roboto Condensed"'); + * ``` + * + * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all + * quoted properly, too: + * + * ```javascript + * Text.setFont('Verdana, "Times New Roman", Tahoma, serif'); + * ``` + * @param family The font family. + */ + setFontFamily(family: string): Phaser.GameObjects.Text; + + /** + * Set the font size. + * @param size The font size. + */ + setFontSize(size: number): Phaser.GameObjects.Text; + + /** + * Set the font style. + * @param style The font style. + */ + setFontStyle(style: string): Phaser.GameObjects.Text; + + /** + * Set a fixed width and height for the text. + * + * Pass in `0` for either of these parameters to disable fixed width or height respectively. + * @param width The fixed width to set. `0` disables fixed width. + * @param height The fixed height to set. `0` disables fixed height. + */ + setFixedSize(width: number, height: number): Phaser.GameObjects.Text; + + /** + * Set the background color. + * @param color The background color. + */ + setBackgroundColor(color: string): Phaser.GameObjects.Text; + + /** + * Set the fill style to be used by the Text object. + * + * This can be any valid CanvasRenderingContext2D fillStyle value, such as + * a color (in hex, rgb, rgba, hsl or named values), a gradient or a pattern. + * + * See the [MDN fillStyle docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle) for more details. + * @param color The text fill style. Can be any valid CanvasRenderingContext `fillStyle` value. + */ + setFill(color: string | any): Phaser.GameObjects.Text; + + /** + * Set the text fill color. + * @param color The text fill color. + */ + setColor(color: string): Phaser.GameObjects.Text; + + /** + * Set the stroke settings. + * @param color The stroke color. + * @param thickness The stroke thickness. + */ + setStroke(color: string, thickness: number): Phaser.GameObjects.Text; + + /** + * Set the shadow settings. + * @param x The horizontal shadow offset. Default 0. + * @param y The vertical shadow offset. Default 0. + * @param color The shadow color. Default '#000'. + * @param blur The shadow blur radius. Default 0. + * @param shadowStroke Whether to stroke the shadow. Default false. + * @param shadowFill Whether to fill the shadow. Default true. + */ + setShadow(x?: number, y?: number, color?: string, blur?: number, shadowStroke?: boolean, shadowFill?: boolean): Phaser.GameObjects.Text; + + /** + * Set the shadow offset. + * @param x The horizontal shadow offset. + * @param y The vertical shadow offset. + */ + setShadowOffset(x: number, y: number): Phaser.GameObjects.Text; + + /** + * Set the shadow color. + * @param color The shadow color. + */ + setShadowColor(color: string): Phaser.GameObjects.Text; + + /** + * Set the shadow blur radius. + * @param blur The shadow blur radius. + */ + setShadowBlur(blur: number): Phaser.GameObjects.Text; + + /** + * Enable or disable shadow stroke. + * @param enabled Whether shadow stroke is enabled or not. + */ + setShadowStroke(enabled: boolean): Phaser.GameObjects.Text; + + /** + * Enable or disable shadow fill. + * @param enabled Whether shadow fill is enabled or not. + */ + setShadowFill(enabled: boolean): Phaser.GameObjects.Text; + + /** + * Set the width (in pixels) to use for wrapping lines. Pass in null to remove wrapping by width. + * @param width The maximum width of a line in pixels. Set to null to remove wrapping. + * @param useAdvancedWrap Whether or not to use the advanced wrapping + * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false, + * spaces and whitespace are left as is. Default false. + */ + setWordWrapWidth(width: number, useAdvancedWrap?: boolean): Phaser.GameObjects.Text; + + /** + * Set a custom callback for wrapping lines. Pass in null to remove wrapping by callback. + * @param callback A custom function that will be responsible for wrapping the + * text. It will receive two arguments: text (the string to wrap), textObject (this Text + * instance). It should return the wrapped lines either as an array of lines or as a string with + * newline characters in place to indicate where breaks should happen. + * @param scope The scope that will be applied when the callback is invoked. Default null. + */ + setWordWrapCallback(callback: TextStyleWordWrapCallback, scope?: object): Phaser.GameObjects.Text; + + /** + * Set the alignment of the text in this Text object. + * + * The argument can be one of: `left`, `right`, `center` or `justify`. + * + * Alignment only works if the Text object has more than one line of text. + * @param align The text alignment for multi-line text. Default 'left'. + */ + setAlign(align?: string): Phaser.GameObjects.Text; + + /** + * Set the resolution used by this Text object. + * + * By default it will be set to match the resolution set in the Game Config, + * but you can override it via this method, or by specifying it in the Text style configuration object. + * + * It allows for much clearer text on High DPI devices, at the cost of memory because it uses larger + * internal Canvas textures for the Text. + * + * Therefore, please use with caution, as the more high res Text you have, the more memory it uses. + * @param value The resolution for this Text object to use. + */ + setResolution(value: number): Phaser.GameObjects.Text; + + /** + * Sets the line spacing value. + * + * This value is _added_ to the height of the font when calculating the overall line height. + * This only has an effect if this Text object consists of multiple lines of text. + * @param value The amount to add to the font height to achieve the overall line height. + */ + setLineSpacing(value: number): Phaser.GameObjects.Text; + + /** + * Set the text padding. + * + * 'left' can be an object. + * + * If only 'left' and 'top' are given they are treated as 'x' and 'y'. + * @param left The left padding value, or a padding config object. + * @param top The top padding value. + * @param right The right padding value. + * @param bottom The bottom padding value. + */ + setPadding(left: number | Phaser.Types.GameObjects.Text.TextPadding, top: number, right: number, bottom: number): Phaser.GameObjects.Text; + + /** + * Set the maximum number of lines to draw. + * @param max The maximum number of lines to draw. Default 0. + */ + setMaxLines(max?: integer): Phaser.GameObjects.Text; + + /** + * Update the displayed text. + */ + updateText(): Phaser.GameObjects.Text; + + /** + * Get the current text metrics. + */ + getTextMetrics(): object; + + /** + * The text string being rendered by this Text Game Object. + */ + text: string; + + /** + * Build a JSON representation of the Text object. + */ + toJSON(): Phaser.Types.GameObjects.JSONGameObject; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A TextStyle class manages all of the style settings for a Text object. + * + * Text Game Objects create a TextStyle instance automatically, which is + * accessed via the `Text.style` property. You do not normally need to + * instantiate one yourself. + */ + class TextStyle { + /** + * + * @param text The Text object that this TextStyle is styling. + * @param style The style settings to set. + */ + constructor(text: Phaser.GameObjects.Text, style: Phaser.Types.GameObjects.Text.TextSyle); + + /** + * The Text object that this TextStyle is styling. + */ + parent: Phaser.GameObjects.Text; + + /** + * The font family. + */ + fontFamily: string; + + /** + * The font size. + */ + fontSize: string; + + /** + * The font style. + */ + fontStyle: string; + + /** + * The background color. + */ + backgroundColor: string; + + /** + * The text fill color. + */ + color: string; + + /** + * The text stroke color. + */ + stroke: string; + + /** + * The text stroke thickness. + */ + strokeThickness: number; + + /** + * The horizontal shadow offset. + */ + shadowOffsetX: number; + + /** + * The vertical shadow offset. + */ + shadowOffsetY: number; + + /** + * The shadow color. + */ + shadowColor: string; + + /** + * The shadow blur radius. + */ + shadowBlur: number; + + /** + * Whether shadow stroke is enabled or not. + */ + shadowStroke: boolean; + + /** + * Whether shadow fill is enabled or not. + */ + shadowFill: boolean; + + /** + * The text alignment. + */ + align: string; + + /** + * The maximum number of lines to draw. + */ + maxLines: integer; + + /** + * The fixed width of the text. + * + * `0` means no fixed with. + */ + fixedWidth: number; + + /** + * The fixed height of the text. + * + * `0` means no fixed height. + */ + fixedHeight: number; + + /** + * The resolution the text is rendered to its internal canvas at. + * The default is 0, which means it will use the resolution set in the Game Config. + */ + resolution: number; + + /** + * Whether the text should render right to left. + */ + rtl: boolean; + + /** + * The test string to use when measuring the font. + */ + testString: string; + + /** + * The amount of horizontal padding added to the width of the text when calculating the font metrics. + */ + baselineX: number; + + /** + * The amount of vertical padding added to the height of the text when calculating the font metrics. + */ + baselineY: number; + + /** + * Set the text style. + * @param style The style settings to set. + * @param updateText Whether to update the text immediately. Default true. + * @param setDefaults Use the default values is not set, or the local values. Default false. + */ + setStyle(style: Phaser.Types.GameObjects.Text.TextSyle, updateText?: boolean, setDefaults?: boolean): Phaser.GameObjects.Text; + + /** + * Synchronize the font settings to the given Canvas Rendering Context. + * @param canvas The Canvas Element. + * @param context The Canvas Rendering Context. + */ + syncFont(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D): void; + + /** + * Synchronize the text style settings to the given Canvas Rendering Context. + * @param canvas The Canvas Element. + * @param context The Canvas Rendering Context. + */ + syncStyle(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D): void; + + /** + * Synchronize the shadow settings to the given Canvas Rendering Context. + * @param context The Canvas Rendering Context. + * @param enabled Whether shadows are enabled or not. + */ + syncShadow(context: CanvasRenderingContext2D, enabled: boolean): void; + + /** + * Update the style settings for the parent Text object. + * @param recalculateMetrics Whether to recalculate font and text metrics. + */ + update(recalculateMetrics: boolean): Phaser.GameObjects.Text; + + /** + * Set the font. + * + * If a string is given, the font family is set. + * + * If an object is given, the `fontFamily`, `fontSize` and `fontStyle` + * properties of that object are set. + * @param font The font family or font settings to set. + * @param updateText Whether to update the text immediately. Default true. + */ + setFont(font: string | object, updateText?: boolean): Phaser.GameObjects.Text; + + /** + * Set the font family. + * @param family The font family. + */ + setFontFamily(family: string): Phaser.GameObjects.Text; + + /** + * Set the font style. + * @param style The font style. + */ + setFontStyle(style: string): Phaser.GameObjects.Text; + + /** + * Set the font size. + * @param size The font size. + */ + setFontSize(size: number | string): Phaser.GameObjects.Text; + + /** + * Set the test string to use when measuring the font. + * @param string The test string to use when measuring the font. + */ + setTestString(string: string): Phaser.GameObjects.Text; + + /** + * Set a fixed width and height for the text. + * + * Pass in `0` for either of these parameters to disable fixed width or height respectively. + * @param width The fixed width to set. + * @param height The fixed height to set. + */ + setFixedSize(width: number, height: number): Phaser.GameObjects.Text; + + /** + * Set the background color. + * @param color The background color. + */ + setBackgroundColor(color: string): Phaser.GameObjects.Text; + + /** + * Set the text fill color. + * @param color The text fill color. + */ + setFill(color: string): Phaser.GameObjects.Text; + + /** + * Set the text fill color. + * @param color The text fill color. + */ + setColor(color: string): Phaser.GameObjects.Text; + + /** + * Set the resolution used by the Text object. + * + * By default it will be set to match the resolution set in the Game Config, + * but you can override it via this method. It allows for much clearer text on High DPI devices, + * at the cost of memory because it uses larger internal Canvas textures for the Text. + * + * Please use with caution, as the more high res Text you have, the more memory it uses up. + * @param value The resolution for this Text object to use. + */ + setResolution(value: number): Phaser.GameObjects.Text; + + /** + * Set the stroke settings. + * @param color The stroke color. + * @param thickness The stroke thickness. + */ + setStroke(color: string, thickness: number): Phaser.GameObjects.Text; + + /** + * Set the shadow settings. + * + * Calling this method always re-measures the parent Text object, + * so only call it when you actually change the shadow settings. + * @param x The horizontal shadow offset. Default 0. + * @param y The vertical shadow offset. Default 0. + * @param color The shadow color. Default '#000'. + * @param blur The shadow blur radius. Default 0. + * @param shadowStroke Whether to stroke the shadow. Default false. + * @param shadowFill Whether to fill the shadow. Default true. + */ + setShadow(x?: number, y?: number, color?: string, blur?: number, shadowStroke?: boolean, shadowFill?: boolean): Phaser.GameObjects.Text; + + /** + * Set the shadow offset. + * @param x The horizontal shadow offset. Default 0. + * @param y The vertical shadow offset. Default 0. + */ + setShadowOffset(x?: number, y?: number): Phaser.GameObjects.Text; + + /** + * Set the shadow color. + * @param color The shadow color. Default '#000'. + */ + setShadowColor(color?: string): Phaser.GameObjects.Text; + + /** + * Set the shadow blur radius. + * @param blur The shadow blur radius. Default 0. + */ + setShadowBlur(blur?: number): Phaser.GameObjects.Text; + + /** + * Enable or disable shadow stroke. + * @param enabled Whether shadow stroke is enabled or not. + */ + setShadowStroke(enabled: boolean): Phaser.GameObjects.Text; + + /** + * Enable or disable shadow fill. + * @param enabled Whether shadow fill is enabled or not. + */ + setShadowFill(enabled: boolean): Phaser.GameObjects.Text; + + /** + * Set the width (in pixels) to use for wrapping lines. + * + * Pass in null to remove wrapping by width. + * @param width The maximum width of a line in pixels. Set to null to remove wrapping. + * @param useAdvancedWrap Whether or not to use the advanced wrapping + * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false, + * spaces and whitespace are left as is. Default false. + */ + setWordWrapWidth(width: number, useAdvancedWrap?: boolean): Phaser.GameObjects.Text; + + /** + * Set a custom callback for wrapping lines. + * + * Pass in null to remove wrapping by callback. + * @param callback A custom function that will be responsible for wrapping the + * text. It will receive two arguments: text (the string to wrap), textObject (this Text + * instance). It should return the wrapped lines either as an array of lines or as a string with + * newline characters in place to indicate where breaks should happen. + * @param scope The scope that will be applied when the callback is invoked. Default null. + */ + setWordWrapCallback(callback: TextStyleWordWrapCallback, scope?: object): Phaser.GameObjects.Text; + + /** + * Set the alignment of the text in this Text object. + * + * The argument can be one of: `left`, `right`, `center` or `justify`. + * + * Alignment only works if the Text object has more than one line of text. + * @param align The text alignment for multi-line text. Default 'left'. + */ + setAlign(align?: string): Phaser.GameObjects.Text; + + /** + * Set the maximum number of lines to draw. + * @param max The maximum number of lines to draw. Default 0. + */ + setMaxLines(max?: integer): Phaser.GameObjects.Text; + + /** + * Get the current text metrics. + */ + getTextMetrics(): Phaser.Types.GameObjects.Text.TextMetrics; + + /** + * Build a JSON representation of this Text Style. + */ + toJSON(): object; + + /** + * Destroy this Text Style. + */ + destroy(): void; + + } + + /** + * A TileSprite is a Sprite that has a repeating texture. + * + * The texture can be scrolled and scaled independently of the TileSprite itself. Textures will automatically wrap and + * are designed so that you can create game backdrops using seamless textures as a source. + * + * You shouldn't ever create a TileSprite any larger than your actual canvas size. If you want to create a large repeating background + * that scrolls across the whole map of your game, then you create a TileSprite that fits the canvas size and then use the `tilePosition` + * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will + * consume huge amounts of memory and cause performance issues. Remember: use `tilePosition` to scroll your texture and `tileScale` to + * adjust the scale of the texture - don't resize the sprite itself or make it larger than it needs. + * + * An important note about Tile Sprites and NPOT textures: Internally, TileSprite textures use GL_REPEAT to provide + * seamless repeating of the textures. This, combined with the way in which the textures are handled in WebGL, means + * they need to be POT (power-of-two) sizes in order to wrap. If you provide a NPOT (non power-of-two) texture to a + * TileSprite it will generate a POT sized canvas and draw your texture to it, scaled up to the POT size. It's then + * scaled back down again during rendering to the original dimensions. While this works, in that it allows you to use + * any size texture for a Tile Sprite, it does mean that NPOT textures are going to appear anti-aliased when rendered, + * due to the interpolation that took place when it was resized into a POT texture. This is especially visible in + * pixel art graphics. If you notice it and it becomes an issue, the only way to avoid it is to ensure that you + * provide POT textures for Tile Sprites. + */ + class TileSprite extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Crop, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. If zero it will use the size of the texture frame. + * @param height The height of the Game Object. If zero it will use the size of the texture frame. + * @param textureKey The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frameKey An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, width: integer, height: integer, textureKey: string, frameKey?: string | integer); + + /** + * Whether the Tile Sprite has changed in some way, requiring an re-render of its tile texture. + * + * Such changes include the texture frame and scroll position of the Tile Sprite. + */ + dirty: boolean; + + /** + * The renderer in use by this Tile Sprite. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The Canvas element that the TileSprite renders its fill pattern in to. + * Only used in Canvas mode. + */ + canvas: HTMLCanvasElement; + + /** + * The Context of the Canvas element that the TileSprite renders its fill pattern in to. + * Only used in Canvas mode. + */ + context: CanvasRenderingContext2D; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * The next power of two value from the width of the Fill Pattern frame. + */ + potWidth: integer; + + /** + * The next power of two value from the height of the Fill Pattern frame. + */ + potHeight: integer; + + /** + * The Canvas that the TileSprites texture is rendered to. + * This is used to create a WebGL texture from. + */ + fillCanvas: HTMLCanvasElement; + + /** + * The Canvas Context used to render the TileSprites texture. + */ + fillContext: CanvasRenderingContext2D; + + /** + * The texture that the Tile Sprite is rendered to, which is then rendered to a Scene. + * In WebGL this is a WebGLTexture. In Canvas it's a Canvas Fill Pattern. + */ + fillPattern: WebGLTexture | CanvasPattern; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * @param frame The name or index of the frame within the Texture. + */ + setFrame(frame: string | integer): this; + + /** + * Sets {@link Phaser.GameObjects.TileSprite#tilePositionX} and {@link Phaser.GameObjects.TileSprite#tilePositionY}. + * @param x The x position of this sprite's tiling texture. + * @param y The y position of this sprite's tiling texture. + */ + setTilePosition(x?: number, y?: number): this; + + /** + * Sets {@link Phaser.GameObjects.TileSprite#tileScaleX} and {@link Phaser.GameObjects.TileSprite#tileScaleY}. + * @param x The horizontal scale of the tiling texture. If not given it will use the current `tileScaleX` value. + * @param y The vertical scale of the tiling texture. If not given it will use the `x` value. Default x. + */ + setTileScale(x?: number, y?: number): this; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * The horizontal scroll position of the Tile Sprite. + */ + tilePositionX: number; + + /** + * The vertical scroll position of the Tile Sprite. + */ + tilePositionY: number; + + /** + * The horizontal scale of the Tile Sprite texture. + */ + tileScaleX: number; + + /** + * The vertical scale of the Tile Sprite texture. + */ + tileScaleY: number; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Update List plugin. + * + * Update Lists belong to a Scene and maintain the list Game Objects to be updated every frame. + * + * Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering. + */ + class UpdateList { + /** + * + * @param scene The Scene that the Update List belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene that the Update List belongs to. + */ + scene: Phaser.Scene; + + /** + * The Scene's Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * Add a Game Object to the Update List. + * @param child The Game Object to add. + */ + add(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.GameObject; + + /** + * The pre-update step. + * + * Handles Game Objects that are pending insertion to and removal from the list. + */ + preUpdate(): void; + + /** + * The update step. + * + * Pre-updates every active Game Object in the list. + * @param time The current timestamp. + * @param delta The delta time elapsed since the last frame. + */ + update(time: number, delta: number): void; + + /** + * Remove a Game Object from the list. + * @param child The Game Object to remove from the list. + */ + remove(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.GameObject; + + /** + * Remove all Game Objects from the list. + */ + removeAll(): Phaser.GameObjects.UpdateList; + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + */ + shutdown(): void; + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + */ + destroy(): void; + + /** + * The length of the list. + */ + readonly length: integer; + + } + + /** + * A Zone Game Object. + * + * A Zone is a non-rendering rectangular Game Object that has a position and size. + * It has no texture and never displays, but does live on the display list and + * can be moved, scaled and rotated like any other Game Object. + * + * Its primary use is for creating Drop Zones and Input Hit Areas and it has a couple of helper methods + * specifically for this. It is also useful for object overlap checks, or as a base for your own + * non-displaying Game Objects. + * The default origin is 0.5, the center of the Zone, the same as with Game Objects. + */ + class Zone extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. Default 1. + * @param height The height of the Game Object. Default 1. + */ + constructor(scene: Phaser.Scene, x: number, y: number, width?: number, height?: number); + + /** + * The native (un-scaled) width of this Game Object. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + */ + height: number; + + /** + * The Blend Mode of the Game Object. + * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into + * display lists without causing a batch flush. + */ + blendMode: integer; + + /** + * The displayed width of this Game Object. + * This value takes into account the scale factor. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * This value takes into account the scale factor. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + * @param resizeInput If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. Default true. + */ + setSize(width: number, height: number, resizeInput?: boolean): Phaser.GameObjects.Zone; + + /** + * Sets the display size of this Game Object. + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): Phaser.GameObjects.Zone; + + /** + * Sets this Zone to be a Circular Drop Zone. + * The circle is centered on this Zones `x` and `y` coordinates. + * @param radius The radius of the Circle that will form the Drop Zone. + */ + setCircleDropZone(radius: number): Phaser.GameObjects.Zone; + + /** + * Sets this Zone to be a Rectangle Drop Zone. + * The rectangle is centered on this Zones `x` and `y` coordinates. + * @param width The width of the rectangle drop zone. + * @param height The height of the rectangle drop zone. + */ + setRectangleDropZone(width: number, height: number): Phaser.GameObjects.Zone; + + /** + * Allows you to define your own Geometry shape to be used as a Drop Zone. + * @param shape A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. + * @param callback A function that will return `true` if the given x/y coords it is sent are within the shape. + */ + setDropZone(shape: object, callback: Phaser.Types.Input.HitAreaCallback): Phaser.GameObjects.Zone; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + } + + namespace Geom { + /** + * A Circle object. + * + * This is a geometry object, containing numerical values and related methods to inspect and modify them. + * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. + * To render a Circle you should look at the capabilities of the Graphics class. + */ + class Circle { + /** + * + * @param x The x position of the center of the circle. Default 0. + * @param y The y position of the center of the circle. Default 0. + * @param radius The radius of the circle. Default 0. + */ + constructor(x?: number, y?: number, radius?: number); + + /** + * Calculates the area of the circle. + * @param circle The Circle to get the area of. + */ + static Area(circle: Phaser.Geom.Circle): number; + + /** + * The x position of the center of the circle. + */ + x: number; + + /** + * The y position of the center of the circle. + */ + y: number; + + /** + * Check to see if the Circle contains the given x / y coordinates. + * @param x The x coordinate to check within the circle. + * @param y The y coordinate to check within the circle. + */ + contains(x: number, y: number): boolean; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Circle + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * @param position A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle. + * @param out An object to store the return values in. If not given a Point object will be created. + */ + getPoint(position: number, out?: O): O; + + /** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle, + * based on the given quantity or stepRate values. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. + * @param output An array to insert the points in to. If not provided a new array will be created. + */ + getPoints(quantity: integer, stepRate?: number, output?: O): O; + + /** + * Returns a uniformly distributed random point from anywhere within the Circle. + * @param point A Point or point-like object to set the random `x` and `y` values in. + */ + getRandomPoint(point?: O): O; + + /** + * Sets the x, y and radius of this circle. + * @param x The x position of the center of the circle. Default 0. + * @param y The y position of the center of the circle. Default 0. + * @param radius The radius of the circle. Default 0. + */ + setTo(x?: number, y?: number, radius?: number): Phaser.Geom.Circle; + + /** + * Sets this Circle to be empty with a radius of zero. + * Does not change its position. + */ + setEmpty(): Phaser.Geom.Circle; + + /** + * Sets the position of this Circle. + * @param x The x position of the center of the circle. Default 0. + * @param y The y position of the center of the circle. Default 0. + */ + setPosition(x?: number, y?: number): Phaser.Geom.Circle; + + /** + * Checks to see if the Circle is empty: has a radius of zero. + */ + isEmpty(): boolean; + + /** + * The radius of the Circle. + */ + radius: number; + + /** + * The diameter of the Circle. + */ + diameter: number; + + /** + * The left position of the Circle. + */ + left: number; + + /** + * The right position of the Circle. + */ + right: number; + + /** + * The top position of the Circle. + */ + top: number; + + /** + * The bottom position of the Circle. + */ + bottom: number; + + /** + * Returns the circumference of the given Circle. + * @param circle The Circle to get the circumference of. + */ + static Circumference(circle: Phaser.Geom.Circle): number; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle. + * @param circle The Circle to get the circumference point on. + * @param angle The angle from the center of the Circle to the circumference to return the point from. Given in radians. + * @param out A Point, or point-like object, to store the results in. If not given a Point will be created. + */ + static CircumferencePoint(circle: Phaser.Geom.Circle, angle: number, out?: O): O; + + /** + * Creates a new Circle instance based on the values contained in the given source. + * @param source The Circle to be cloned. Can be an instance of a Circle or a circle-like object, with x, y and radius properties. + */ + static Clone(source: Phaser.Geom.Circle | object): Phaser.Geom.Circle; + + /** + * Check to see if the Circle contains the given x / y coordinates. + * @param circle The Circle to check. + * @param x The x coordinate to check within the circle. + * @param y The y coordinate to check within the circle. + */ + static Contains(circle: Phaser.Geom.Circle, x: number, y: number): boolean; + + /** + * Check to see if the Circle contains the given Point object. + * @param circle The Circle to check. + * @param point The Point object to check if it's within the Circle or not. + */ + static ContainsPoint(circle: Phaser.Geom.Circle, point: Phaser.Geom.Point | object): boolean; + + /** + * Check to see if the Circle contains all four points of the given Rectangle object. + * @param circle The Circle to check. + * @param rect The Rectangle object to check if it's within the Circle or not. + */ + static ContainsRect(circle: Phaser.Geom.Circle, rect: Phaser.Geom.Rectangle | object): boolean; + + /** + * Copies the `x`, `y` and `radius` properties from the `source` Circle + * into the given `dest` Circle, then returns the `dest` Circle. + * @param source The source Circle to copy the values from. + * @param dest The destination Circle to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Circle, dest: O): O; + + /** + * Compares the `x`, `y` and `radius` properties of the two given Circles. + * Returns `true` if they all match, otherwise returns `false`. + * @param circle The first Circle to compare. + * @param toCompare The second Circle to compare. + */ + static Equals(circle: Phaser.Geom.Circle, toCompare: Phaser.Geom.Circle): boolean; + + /** + * Returns the bounds of the Circle object. + * @param circle The Circle to get the bounds from. + * @param out A Rectangle, or rectangle-like object, to store the circle bounds in. If not given a new Rectangle will be created. + */ + static GetBounds(circle: Phaser.Geom.Circle, out?: O): O; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Circle + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * @param circle The Circle to get the circumference point on. + * @param position A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle. + * @param out An object to store the return values in. If not given a Point object will be created. + */ + static GetPoint(circle: Phaser.Geom.Circle, position: number, out?: O): O; + + /** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle, + * based on the given quantity or stepRate values. + * @param circle The Circle to get the points from. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. + * @param output An array to insert the points in to. If not provided a new array will be created. + */ + static GetPoints(circle: Phaser.Geom.Circle, quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + + /** + * Offsets the Circle by the values given. + * @param circle The Circle to be offset (translated.) + * @param x The amount to horizontally offset the Circle by. + * @param y The amount to vertically offset the Circle by. + */ + static Offset(circle: O, x: number, y: number): O; + + /** + * Offsets the Circle by the values given in the `x` and `y` properties of the Point object. + * @param circle The Circle to be offset (translated.) + * @param point The Point object containing the values to offset the Circle by. + */ + static OffsetPoint(circle: O, point: Phaser.Geom.Point | object): O; + + /** + * Returns a uniformly distributed random point from anywhere within the given Circle. + * @param circle The Circle to get a random point from. + * @param out A Point or point-like object to set the random `x` and `y` values in. + */ + static Random(circle: Phaser.Geom.Circle, out?: O): O; + + } + + /** + * An Ellipse object. + * + * This is a geometry object, containing numerical values and related methods to inspect and modify them. + * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. + * To render an Ellipse you should look at the capabilities of the Graphics class. + */ + class Ellipse { + /** + * + * @param x The x position of the center of the ellipse. Default 0. + * @param y The y position of the center of the ellipse. Default 0. + * @param width The width of the ellipse. Default 0. + * @param height The height of the ellipse. Default 0. + */ + constructor(x?: number, y?: number, width?: number, height?: number); + + /** + * Calculates the area of the Ellipse. + * @param ellipse The Ellipse to get the area of. + */ + static Area(ellipse: Phaser.Geom.Ellipse): number; + + /** + * Returns the circumference of the given Ellipse. + * @param ellipse The Ellipse to get the circumference of. + */ + static Circumference(ellipse: Phaser.Geom.Ellipse): number; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse based on the given angle. + * @param ellipse The Ellipse to get the circumference point on. + * @param angle The angle from the center of the Ellipse to the circumference to return the point from. Given in radians. + * @param out A Point, or point-like object, to store the results in. If not given a Point will be created. + */ + static CircumferencePoint(ellipse: Phaser.Geom.Ellipse, angle: number, out?: O): O; + + /** + * Creates a new Ellipse instance based on the values contained in the given source. + * @param source The Ellipse to be cloned. Can be an instance of an Ellipse or a ellipse-like object, with x, y, width and height properties. + */ + static Clone(source: Phaser.Geom.Ellipse): Phaser.Geom.Ellipse; + + /** + * Check to see if the Ellipse contains the given x / y coordinates. + * @param ellipse The Ellipse to check. + * @param x The x coordinate to check within the ellipse. + * @param y The y coordinate to check within the ellipse. + */ + static Contains(ellipse: Phaser.Geom.Ellipse, x: number, y: number): boolean; + + /** + * Check to see if the Ellipse contains the given Point object. + * @param ellipse The Ellipse to check. + * @param point The Point object to check if it's within the Circle or not. + */ + static ContainsPoint(ellipse: Phaser.Geom.Ellipse, point: Phaser.Geom.Point | object): boolean; + + /** + * Check to see if the Ellipse contains all four points of the given Rectangle object. + * @param ellipse The Ellipse to check. + * @param rect The Rectangle object to check if it's within the Ellipse or not. + */ + static ContainsRect(ellipse: Phaser.Geom.Ellipse, rect: Phaser.Geom.Rectangle | object): boolean; + + /** + * Copies the `x`, `y`, `width` and `height` properties from the `source` Ellipse + * into the given `dest` Ellipse, then returns the `dest` Ellipse. + * @param source The source Ellipse to copy the values from. + * @param dest The destination Ellipse to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Ellipse, dest: O): O; + + /** + * The x position of the center of the ellipse. + */ + x: number; + + /** + * The y position of the center of the ellipse. + */ + y: number; + + /** + * The width of the ellipse. + */ + width: number; + + /** + * The height of the ellipse. + */ + height: number; + + /** + * Check to see if the Ellipse contains the given x / y coordinates. + * @param x The x coordinate to check within the ellipse. + * @param y The y coordinate to check within the ellipse. + */ + contains(x: number, y: number): boolean; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * @param position A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse. + * @param out An object to store the return values in. If not given a Point object will be created. + */ + getPoint(position: number, out?: O): O; + + /** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse, + * based on the given quantity or stepRate values. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. + * @param output An array to insert the points in to. If not provided a new array will be created. + */ + getPoints(quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + + /** + * Returns a uniformly distributed random point from anywhere within the given Ellipse. + * @param point A Point or point-like object to set the random `x` and `y` values in. + */ + getRandomPoint(point?: O): O; + + /** + * Sets the x, y, width and height of this ellipse. + * @param x The x position of the center of the ellipse. + * @param y The y position of the center of the ellipse. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + */ + setTo(x: number, y: number, width: number, height: number): Phaser.Geom.Ellipse; + + /** + * Sets this Ellipse to be empty with a width and height of zero. + * Does not change its position. + */ + setEmpty(): Phaser.Geom.Ellipse; + + /** + * Sets the position of this Ellipse. + * @param x The x position of the center of the ellipse. + * @param y The y position of the center of the ellipse. + */ + setPosition(x: number, y: number): Phaser.Geom.Ellipse; + + /** + * Sets the size of this Ellipse. + * Does not change its position. + * @param width The width of the ellipse. + * @param height The height of the ellipse. Default width. + */ + setSize(width: number, height?: number): Phaser.Geom.Ellipse; + + /** + * Checks to see if the Ellipse is empty: has a width or height equal to zero. + */ + isEmpty(): boolean; + + /** + * Returns the minor radius of the ellipse. Also known as the Semi Minor Axis. + */ + getMinorRadius(): number; + + /** + * Returns the major radius of the ellipse. Also known as the Semi Major Axis. + */ + getMajorRadius(): number; + + /** + * The left position of the Ellipse. + */ + left: number; + + /** + * The right position of the Ellipse. + */ + right: number; + + /** + * The top position of the Ellipse. + */ + top: number; + + /** + * The bottom position of the Ellipse. + */ + bottom: number; + + /** + * Compares the `x`, `y`, `width` and `height` properties of the two given Ellipses. + * Returns `true` if they all match, otherwise returns `false`. + * @param ellipse The first Ellipse to compare. + * @param toCompare The second Ellipse to compare. + */ + static Equals(ellipse: Phaser.Geom.Ellipse, toCompare: Phaser.Geom.Ellipse): boolean; + + /** + * Returns the bounds of the Ellipse object. + * @param ellipse The Ellipse to get the bounds from. + * @param out A Rectangle, or rectangle-like object, to store the ellipse bounds in. If not given a new Rectangle will be created. + */ + static GetBounds(ellipse: Phaser.Geom.Ellipse, out?: O): O; + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * @param ellipse The Ellipse to get the circumference point on. + * @param position A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse. + * @param out An object to store the return values in. If not given a Point object will be created. + */ + static GetPoint(ellipse: Phaser.Geom.Ellipse, position: number, out?: O): O; + + /** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse, + * based on the given quantity or stepRate values. + * @param ellipse The Ellipse to get the points from. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. + * @param out An array to insert the points in to. If not provided a new array will be created. + */ + static GetPoints(ellipse: Phaser.Geom.Ellipse, quantity: integer, stepRate?: number, out?: O): O; + + /** + * Offsets the Ellipse by the values given. + * @param ellipse The Ellipse to be offset (translated.) + * @param x The amount to horizontally offset the Ellipse by. + * @param y The amount to vertically offset the Ellipse by. + */ + static Offset(ellipse: O, x: number, y: number): O; + + /** + * Offsets the Ellipse by the values given in the `x` and `y` properties of the Point object. + * @param ellipse The Ellipse to be offset (translated.) + * @param point The Point object containing the values to offset the Ellipse by. + */ + static OffsetPoint(ellipse: O, point: Phaser.Geom.Point | object): O; + + /** + * Returns a uniformly distributed random point from anywhere within the given Ellipse. + * @param ellipse The Ellipse to get a random point from. + * @param out A Point or point-like object to set the random `x` and `y` values in. + */ + static Random(ellipse: Phaser.Geom.Ellipse, out?: O): O; + + } + + namespace Intersects { + /** + * Checks if two Circles intersect. + * @param circleA The first Circle to check for intersection. + * @param circleB The second Circle to check for intersection. + */ + function CircleToCircle(circleA: Phaser.Geom.Circle, circleB: Phaser.Geom.Circle): boolean; + + /** + * Checks for intersection between a circle and a rectangle. + * @param circle The circle to be checked. + * @param rect The rectangle to be checked. + */ + function CircleToRectangle(circle: Phaser.Geom.Circle, rect: Phaser.Geom.Rectangle): boolean; + + /** + * Checks if two Circles intersect and returns the intersection points as a Point object array. + * @param circleA The first Circle to check for intersection. + * @param circleB The second Circle to check for intersection. + * @param out An optional array in which to store the points of intersection. + */ + function GetCircleToCircle(circleA: Phaser.Geom.Circle, circleB: Phaser.Geom.Circle, out?: any[]): any[]; + + /** + * Checks for intersection between a circle and a rectangle, + * and returns the intersection points as a Point object array. + * @param circle The circle to be checked. + * @param rect The rectangle to be checked. + * @param out An optional array in which to store the points of intersection. + */ + function GetCircleToRectangle(circle: Phaser.Geom.Circle, rect: Phaser.Geom.Rectangle, out?: any[]): any[]; + + /** + * Checks for intersection between the line segment and circle, + * and returns the intersection points as a Point object array. + * @param line The line segment to check. + * @param circle The circle to check against the line. + * @param out An optional array in which to store the points of intersection. + */ + function GetLineToCircle(line: Phaser.Geom.Line, circle: Phaser.Geom.Circle, out?: any[]): any[]; + + /** + * Checks for intersection between the Line and a Rectangle shape, + * and returns the intersection points as a Point object array. + * @param line The Line to check for intersection. + * @param rect The Rectangle to check for intersection. + * @param out An optional array in which to store the points of intersection. + */ + function GetLineToRectangle(line: Phaser.Geom.Line, rect: Phaser.Geom.Rectangle | object, out?: any[]): any[]; + + /** + * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. + * + * If optional `output` parameter is omitted, new Rectangle object is created and returned. If there is intersection, it will contain intersection area. If there is no intersection, it wil be empty Rectangle (all values set to zero). + * + * If Rectangle object is passed as `output` and there is intersection, then intersection area data will be loaded into it and it will be returned. If there is no intersetion, it will be returned without any change. + * @param rectA The first Rectangle object. + * @param rectB The second Rectangle object. + * @param output Optional Rectangle object. If given, the intersection data will be loaded into it (in case of no intersection, it will be left unchanged). Otherwise, new Rectangle object will be created and returned with either intersection data or empty (all values set to zero), if there is no intersection. + */ + function GetRectangleIntersection(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, output?: O): O; + + /** + * Checks if two Rectangles intersect and returns the intersection points as a Point object array. + * + * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle. + * @param rectA The first Rectangle to check for intersection. + * @param rectB The second Rectangle to check for intersection. + * @param out An optional array in which to store the points of intersection. + */ + function GetRectangleToRectangle(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: any[]): any[]; + + /** + * Checks for intersection between Rectangle shape and Triangle shape, + * and returns the intersection points as a Point object array. + * @param rect Rectangle object to test. + * @param triangle Triangle object to test. + * @param out An optional array in which to store the points of intersection. + */ + function GetRectangleToTriangle(rect: Phaser.Geom.Rectangle, triangle: Phaser.Geom.Triangle, out?: any[]): any[]; + + /** + * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array. + * + * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection. + * @param triangle The Triangle to check for intersection. + * @param circle The Circle to check for intersection. + * @param out An optional array in which to store the points of intersection. + */ + function GetTriangleToCircle(triangle: Phaser.Geom.Triangle, circle: Phaser.Geom.Circle, out?: any[]): any[]; + + /** + * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array. + * + * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". + * @param triangle The Triangle to check with. + * @param line The Line to check with. + * @param out An optional array in which to store the points of intersection. + */ + function GetTriangleToLine(triangle: Phaser.Geom.Triangle, line: Phaser.Geom.Line, out?: any[]): any[]; + + /** + * Checks if two Triangles intersect, and returns the intersection points as a Point object array. + * + * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid". + * @param triangleA The first Triangle to check for intersection. + * @param triangleB The second Triangle to check for intersection. + * @param out An optional array in which to store the points of intersection. + */ + function GetTriangleToTriangle(triangleA: Phaser.Geom.Triangle, triangleB: Phaser.Geom.Triangle, out?: any[]): any[]; + + /** + * Checks for intersection between the line segment and circle. + * + * Based on code by [Matt DesLauriers](https://github.com/mattdesl/line-circle-collision/blob/master/LICENSE.md). + * @param line The line segment to check. + * @param circle The circle to check against the line. + * @param nearest An optional Point-like object. If given the closest point on the Line where the circle intersects will be stored in this object. + */ + function LineToCircle(line: Phaser.Geom.Line, circle: Phaser.Geom.Circle, nearest?: Phaser.Geom.Point | any): boolean; + + /** + * Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting. + * @param line1 The first Line to check. + * @param line2 The second Line to check. + * @param out A Point in which to optionally store the point of intersection. + */ + function LineToLine(line1: Phaser.Geom.Line, line2: Phaser.Geom.Line, out?: Phaser.Geom.Point): boolean; + + /** + * Checks for intersection between the Line and a Rectangle shape, or a rectangle-like + * object, with public `x`, `y`, `right` and `bottom` properties, such as a Sprite or Body. + * + * An intersection is considered valid if: + * + * The line starts within, or ends within, the Rectangle. + * The line segment intersects one of the 4 rectangle edges. + * + * The for the purposes of this function rectangles are considered 'solid'. + * @param line The Line to check for intersection. + * @param rect The Rectangle to check for intersection. + */ + function LineToRectangle(line: Phaser.Geom.Line, rect: Phaser.Geom.Rectangle | object): boolean; + + /** + * Checks if the a Point falls between the two end-points of a Line, based on the given line thickness. + * + * Assumes that the line end points are circular, not square. + * @param point The point, or point-like object to check. + * @param line The line segment to test for intersection on. + * @param lineThickness The line thickness. Assumes that the line end points are circular. Default 1. + */ + function PointToLine(point: Phaser.Geom.Point | any, line: Phaser.Geom.Line, lineThickness?: number): boolean; + + /** + * Checks if a Point is located on the given line segment. + * @param point The Point to check for intersection. + * @param line The line segment to check for intersection. + */ + function PointToLineSegment(point: Phaser.Geom.Point, line: Phaser.Geom.Line): boolean; + + /** + * Checks if two Rectangles intersect. + * + * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle. + * @param rectA The first Rectangle to check for intersection. + * @param rectB The second Rectangle to check for intersection. + */ + function RectangleToRectangle(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle): boolean; + + /** + * Checks for intersection between Rectangle shape and Triangle shape. + * @param rect Rectangle object to test. + * @param triangle Triangle object to test. + */ + function RectangleToTriangle(rect: Phaser.Geom.Rectangle, triangle: Phaser.Geom.Triangle): boolean; + + /** + * Check if rectangle intersects with values. + * @param rect The rectangle object + * @param left The x coordinate of the left of the Rectangle. + * @param right The x coordinate of the right of the Rectangle. + * @param top The y coordinate of the top of the Rectangle. + * @param bottom The y coordinate of the bottom of the Rectangle. + * @param tolerance Tolerance allowed in the calculation, expressed in pixels. Default 0. + */ + function RectangleToValues(rect: Phaser.Geom.Rectangle, left: number, right: number, top: number, bottom: number, tolerance?: number): boolean; + + /** + * Checks if a Triangle and a Circle intersect. + * + * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection. + * @param triangle The Triangle to check for intersection. + * @param circle The Circle to check for intersection. + */ + function TriangleToCircle(triangle: Phaser.Geom.Triangle, circle: Phaser.Geom.Circle): boolean; + + /** + * Checks if a Triangle and a Line intersect. + * + * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". + * @param triangle The Triangle to check with. + * @param line The Line to check with. + */ + function TriangleToLine(triangle: Phaser.Geom.Triangle, line: Phaser.Geom.Line): boolean; + + /** + * Checks if two Triangles intersect. + * + * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid". + * @param triangleA The first Triangle to check for intersection. + * @param triangleB The second Triangle to check for intersection. + */ + function TriangleToTriangle(triangleA: Phaser.Geom.Triangle, triangleB: Phaser.Geom.Triangle): boolean; + + } + + /** + * Defines a Line segment, a part of a line between two endpoints. + */ + class Line { + /** + * + * @param x1 The x coordinate of the lines starting point. Default 0. + * @param y1 The y coordinate of the lines starting point. Default 0. + * @param x2 The x coordinate of the lines ending point. Default 0. + * @param y2 The y coordinate of the lines ending point. Default 0. + */ + constructor(x1?: number, y1?: number, x2?: number, y2?: number); + + /** + * Calculate the angle of the line in radians. + * @param line The line to calculate the angle of. + */ + static Angle(line: Phaser.Geom.Line): number; + + /** + * Using Bresenham's line algorithm this will return an array of all coordinates on this line. + * + * The `start` and `end` points are rounded before this runs as the algorithm works on integers. + * @param line The line. + * @param stepRate The optional step rate for the points on the line. Default 1. + * @param results An optional array to push the resulting coordinates into. + */ + static BresenhamPoints(line: Phaser.Geom.Line, stepRate?: integer, results?: any[]): object[]; + + /** + * Center a line on the given coordinates. + * @param line The line to center. + * @param x The horizontal coordinate to center the line on. + * @param y The vertical coordinate to center the line on. + */ + static CenterOn(line: Phaser.Geom.Line, x: number, y: number): Phaser.Geom.Line; + + /** + * Clone the given line. + * @param source The source line to clone. + */ + static Clone(source: Phaser.Geom.Line): Phaser.Geom.Line; + + /** + * Copy the values of one line to a destination line. + * @param source The source line to copy the values from. + * @param dest The destination line to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Line, dest: O): O; + + /** + * Compare two lines for strict equality. + * @param line The first line to compare. + * @param toCompare The second line to compare. + */ + static Equals(line: Phaser.Geom.Line, toCompare: Phaser.Geom.Line): boolean; + + /** + * Extends the start and end points of a Line by the given amounts. + * + * The amounts can be positive or negative. Positive points will increase the length of the line, + * while negative ones will decrease it. + * + * If no `right` value is provided it will extend the length of the line equally in both directions. + * + * Pass a value of zero to leave the start or end point unchanged. + * @param line The line instance to extend. + * @param left The amount to extend the start of the line by. + * @param right The amount to extend the end of the line by. If not given it will be set to the `left` value. + */ + static Extend(line: Phaser.Geom.Line, left: number, right?: number): Phaser.Geom.Line; + + /** + * Get the midpoint of the given line. + * @param line The line to get the midpoint of. + * @param out An optional point object to store the midpoint in. + */ + static GetMidPoint(line: Phaser.Geom.Line, out?: O): O; + + /** + * Get the nearest point on a line perpendicular to the given point. + * @param line The line to get the nearest point on. + * @param point The point to get the nearest point to. + * @param out An optional point, or point-like object, to store the coordinates of the nearest point on the line. + */ + static GetNearestPoint(line: Phaser.Geom.Line, point: Phaser.Geom.Point | object, out?: O): O; + + /** + * Calculate the normal of the given line. + * + * The normal of a line is a vector that points perpendicular from it. + * @param line The line to calculate the normal of. + * @param out An optional point object to store the normal in. + */ + static GetNormal(line: Phaser.Geom.Line, out?: O): O; + + /** + * Get a point on a line that's a given percentage along its length. + * @param line The line. + * @param position A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. + * @param out An optional point, or point-like object, to store the coordinates of the point on the line. + */ + static GetPoint(line: Phaser.Geom.Line, position: number, out?: O): O; + + /** + * Get a number of points along a line's length. + * + * Provide a `quantity` to get an exact number of points along the line. + * + * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when + * providing a `stepRate`. + * @param line The line. + * @param quantity The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param stepRate The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param out An optional array of Points, or point-like objects, to store the coordinates of the points on the line. + */ + static GetPoints(line: Phaser.Geom.Line, quantity: integer, stepRate?: number, out?: O): O; + + /** + * Get the shortest distance from a Line to the given Point. + * @param line The line to get the distance from. + * @param point The point to get the shortest distance to. + */ + static GetShortestDistance(line: Phaser.Geom.Line, point: Phaser.Geom.Point | object): O; + + /** + * Calculate the height of the given line. + * @param line The line to calculate the height of. + */ + static Height(line: Phaser.Geom.Line): number; + + /** + * Calculate the length of the given line. + * @param line The line to calculate the length of. + */ + static Length(line: Phaser.Geom.Line): number; + + /** + * The x coordinate of the lines starting point. + */ + x1: number; + + /** + * The y coordinate of the lines starting point. + */ + y1: number; + + /** + * The x coordinate of the lines ending point. + */ + x2: number; + + /** + * The y coordinate of the lines ending point. + */ + y2: number; + + /** + * Get a point on a line that's a given percentage along its length. + * @param position A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. + * @param output An optional point, or point-like object, to store the coordinates of the point on the line. + */ + getPoint(position: number, output?: O): O; + + /** + * Get a number of points along a line's length. + * + * Provide a `quantity` to get an exact number of points along the line. + * + * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when + * providing a `stepRate`. + * @param quantity The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param stepRate The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param output An optional array of Points, or point-like objects, to store the coordinates of the points on the line. + */ + getPoints(quantity: integer, stepRate?: integer, output?: O): O; + + /** + * Get a random Point on the Line. + * @param point An instance of a Point to be modified. + */ + getRandomPoint(point?: O): O; + + /** + * Set new coordinates for the line endpoints. + * @param x1 The x coordinate of the lines starting point. Default 0. + * @param y1 The y coordinate of the lines starting point. Default 0. + * @param x2 The x coordinate of the lines ending point. Default 0. + * @param y2 The y coordinate of the lines ending point. Default 0. + */ + setTo(x1?: number, y1?: number, x2?: number, y2?: number): Phaser.Geom.Line; + + /** + * Returns a Vector2 object that corresponds to the start of this Line. + * @param vec2 A Vector2 object to set the results in. If `undefined` a new Vector2 will be created. + */ + getPointA(vec2?: O): O; + + /** + * Returns a Vector2 object that corresponds to the end of this Line. + * @param vec2 A Vector2 object to set the results in. If `undefined` a new Vector2 will be created. + */ + getPointB(vec2?: O): O; + + /** + * The left position of the Line. + */ + left: number; + + /** + * The right position of the Line. + */ + right: number; + + /** + * The top position of the Line. + */ + top: number; + + /** + * The bottom position of the Line. + */ + bottom: number; + + /** + * Get the angle of the normal of the given line in radians. + * @param line The line to calculate the angle of the normal of. + */ + static NormalAngle(line: Phaser.Geom.Line): number; + + /** + * [description] + * @param line The Line object to get the normal value from. + */ + static NormalX(line: Phaser.Geom.Line): number; + + /** + * The Y value of the normal of the given line. + * The normal of a line is a vector that points perpendicular from it. + * @param line The line to calculate the normal of. + */ + static NormalY(line: Phaser.Geom.Line): number; + + /** + * Offset a line by the given amount. + * @param line The line to offset. + * @param x The horizontal offset to add to the line. + * @param y The vertical offset to add to the line. + */ + static Offset(line: O, x: number, y: number): O; + + /** + * Calculate the perpendicular slope of the given line. + * @param line The line to calculate the perpendicular slope of. + */ + static PerpSlope(line: Phaser.Geom.Line): number; + + /** + * Returns a random point on a given Line. + * @param line The Line to calculate the random Point on. + * @param out An instance of a Point to be modified. + */ + static Random(line: Phaser.Geom.Line, out?: O): O; + + /** + * Calculate the reflected angle between two lines. + * + * This is the outgoing angle based on the angle of Line 1 and the normalAngle of Line 2. + * @param lineA The first line. + * @param lineB The second line. + */ + static ReflectAngle(lineA: Phaser.Geom.Line, lineB: Phaser.Geom.Line): number; + + /** + * Rotate a line around its midpoint by the given angle in radians. + * @param line The line to rotate. + * @param angle The angle of rotation in radians. + */ + static Rotate(line: O, angle: number): O; + + /** + * Rotate a line around a point by the given angle in radians. + * @param line The line to rotate. + * @param point The point to rotate the line around. + * @param angle The angle of rotation in radians. + */ + static RotateAroundPoint(line: O, point: Phaser.Geom.Point | object, angle: number): O; + + /** + * Rotate a line around the given coordinates by the given angle in radians. + * @param line The line to rotate. + * @param x The horizontal coordinate to rotate the line around. + * @param y The vertical coordinate to rotate the line around. + * @param angle The angle of rotation in radians. + */ + static RotateAroundXY(line: O, x: number, y: number, angle: number): O; + + /** + * Set a line to a given position, angle and length. + * @param line The line to set. + * @param x The horizontal start position of the line. + * @param y The vertical start position of the line. + * @param angle The angle of the line in radians. + * @param length The length of the line. + */ + static SetToAngle(line: O, x: number, y: number, angle: number, length: number): O; + + /** + * Calculate the slope of the given line. + * @param line The line to calculate the slope of. + */ + static Slope(line: Phaser.Geom.Line): number; + + /** + * Calculate the width of the given line. + * @param line The line to calculate the width of. + */ + static Width(line: Phaser.Geom.Line): number; + + } + + /** + * Defines a Point in 2D space, with an x and y component. + */ + class Point { + /** + * + * @param x The x coordinate of this Point. Default 0. + * @param y The y coordinate of this Point. Default x. + */ + constructor(x?: number, y?: number); + + /** + * Apply `Math.ceil()` to each coordinate of the given Point. + * @param point The Point to ceil. + */ + static Ceil(point: O): O; + + /** + * Clone the given Point. + * @param source The source Point to clone. + */ + static Clone(source: Phaser.Geom.Point): Phaser.Geom.Point; + + /** + * Copy the values of one Point to a destination Point. + * @param source The source Point to copy the values from. + * @param dest The destination Point to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Point, dest: O): O; + + /** + * A comparison of two `Point` objects to see if they are equal. + * @param point The original `Point` to compare against. + * @param toCompare The second `Point` to compare. + */ + static Equals(point: Phaser.Geom.Point, toCompare: Phaser.Geom.Point): boolean; + + /** + * Apply `Math.ceil()` to each coordinate of the given Point. + * @param point The Point to floor. + */ + static Floor(point: O): O; + + /** + * Get the centroid or geometric center of a plane figure (the arithmetic mean position of all the points in the figure). + * Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin. + * @param points [description] + * @param out [description] + */ + static GetCentroid(points: Phaser.Geom.Point[], out?: O): O; + + /** + * Calculate the magnitude of the point, which equivalent to the length of the line from the origin to this point. + * @param point The point to calculate the magnitude for + */ + static GetMagnitude(point: Phaser.Geom.Point): number; + + /** + * Calculates the square of magnitude of given point.(Can be used for fast magnitude calculation of point) + * @param point Returns square of the magnitude/length of given point. + */ + static GetMagnitudeSq(point: Phaser.Geom.Point): number; + + /** + * Calculates the Axis Aligned Bounding Box (or aabb) from an array of points. + * @param points [description] + * @param out [description] + */ + static GetRectangleFromPoints(points: Phaser.Geom.Point[], out?: O): O; + + /** + * [description] + * @param pointA The starting `Point` for the interpolation. + * @param pointB The target `Point` for the interpolation. + * @param t The amount to interpolate between the two points. Generally, a value between 0 (returns the starting `Point`) and 1 (returns the target `Point`). If omitted, 0 is used. Default 0. + * @param out An optional `Point` object whose `x` and `y` values will be set to the result of the interpolation (can also be any object with `x` and `y` properties). If omitted, a new `Point` created and returned. + */ + static Interpolate(pointA: Phaser.Geom.Point, pointB: Phaser.Geom.Point, t?: number, out?: O): O; + + /** + * Swaps the X and the Y coordinate of a point. + * @param point The Point to modify. + */ + static Invert(point: O): O; + + /** + * Inverts a Point's coordinates. + * @param point The Point to invert. + * @param out The Point to return the inverted coordinates in. + */ + static Negative(point: Phaser.Geom.Point, out?: O): O; + + /** + * The x coordinate of this Point. + */ + x: number; + + /** + * The y coordinate of this Point. + */ + y: number; + + /** + * Set the x and y coordinates of the point to the given values. + * @param x The x coordinate of this Point. Default 0. + * @param y The y coordinate of this Point. Default x. + */ + setTo(x?: number, y?: number): Phaser.Geom.Point; + + /** + * [description] + * @param pointA [description] + * @param pointB [description] + * @param out [description] + */ + static Project(pointA: Phaser.Geom.Point, pointB: Phaser.Geom.Point, out?: O): O; + + /** + * [description] + * @param pointA [description] + * @param pointB [description] + * @param out [description] + */ + static ProjectUnit(pointA: Phaser.Geom.Point, pointB: Phaser.Geom.Point, out?: O): O; + + /** + * Changes the magnitude (length) of a two-dimensional vector without changing its direction. + * @param point The Point to treat as the end point of the vector. + * @param magnitude The new magnitude of the vector. + */ + static SetMagnitude(point: O, magnitude: number): O; + + } + + /** + * A Polygon object + * + * The polygon is a closed shape consists of a series of connected straight lines defined by list of ordered points. + * Several formats are supported to define the list of points, check the setTo method for details. + * This is a geometry object allowing you to define and inspect the shape. + * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. + * To render a Polygon you should look at the capabilities of the Graphics class. + */ + class Polygon { + /** + * + * @param points List of points defining the perimeter of this Polygon. Several formats are supported: + * - A string containing paired x y values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` + * - An array of objects with public x y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + */ + constructor(points?: Phaser.Geom.Point[]); + + /** + * Create a new polygon which is a copy of the specified polygon + * @param polygon The polygon to create a clone of + */ + static Clone(polygon: Phaser.Geom.Polygon): Phaser.Geom.Polygon; + + /** + * Checks if a point is within the bounds of a Polygon. + * @param polygon The Polygon to check against. + * @param x The X coordinate of the point to check. + * @param y The Y coordinate of the point to check. + */ + static Contains(polygon: Phaser.Geom.Polygon, x: number, y: number): boolean; + + /** + * [description] + * @param polygon [description] + * @param point [description] + */ + static ContainsPoint(polygon: Phaser.Geom.Polygon, point: Phaser.Geom.Point): boolean; + + /** + * Calculates the bounding AABB rectangle of a polygon. + * @param polygon The polygon that should be calculated. + * @param out The rectangle or object that has x, y, width, and height properties to store the result. Optional. + */ + static GetAABB(polygon: Phaser.Geom.Polygon, out?: O): O; + + /** + * Stores all of the points of a Polygon into a flat array of numbers following the sequence [ x,y, x,y, x,y ], + * i.e. each point of the Polygon, in the order it's defined, corresponds to two elements of the resultant + * array for the point's X and Y coordinate. + * @param polygon The Polygon whose points to export. + * @param output An array to which the points' coordinates should be appended. + */ + static GetNumberArray(polygon: Phaser.Geom.Polygon, output?: O): O; + + /** + * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, + * based on the given quantity or stepRate values. + * @param polygon The Polygon to get the points from. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. + * @param output An array to insert the points in to. If not provided a new array will be created. + */ + static GetPoints(polygon: Phaser.Geom.Polygon, quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + + /** + * Returns the perimeter of the given Polygon. + * @param polygon The Polygon to get the perimeter of. + */ + static Perimeter(polygon: Phaser.Geom.Polygon): number; + + /** + * The area of this Polygon. + */ + area: number; + + /** + * An array of number pair objects that make up this polygon. I.e. [ {x,y}, {x,y}, {x,y} ] + */ + points: Phaser.Geom.Point[]; + + /** + * Check to see if the Polygon contains the given x / y coordinates. + * @param x The x coordinate to check within the polygon. + * @param y The y coordinate to check within the polygon. + */ + contains(x: number, y: number): boolean; + + /** + * Sets this Polygon to the given points. + * + * The points can be set from a variety of formats: + * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * `setTo` may also be called without any arguments to remove all points. + * @param points Points defining the perimeter of this polygon. Please check function description above for the different supported formats. + */ + setTo(points: any[]): Phaser.Geom.Polygon; + + /** + * Calculates the area of the Polygon. This is available in the property Polygon.area + */ + calculateArea(): number; + + /** + * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, + * based on the given quantity or stepRate values. + * @param quantity The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param stepRate Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. + * @param output An array to insert the points in to. If not provided a new array will be created. + */ + getPoints(quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + + /** + * Reverses the order of the points of a Polygon. + * @param polygon The Polygon to modify. + */ + static Reverse(polygon: O): O; + + /** + * Takes a Polygon object and applies Chaikin's smoothing algorithm on its points. + * @param polygon The polygon to be smoothed. The polygon will be modified in-place and returned. + */ + static Smooth(polygon: O): O; + + } + + /** + * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) + */ + class Rectangle { + /** + * + * @param x The X coordinate of the top left corner of the Rectangle. Default 0. + * @param y The Y coordinate of the top left corner of the Rectangle. Default 0. + * @param width The width of the Rectangle. Default 0. + * @param height The height of the Rectangle. Default 0. + */ + constructor(x?: number, y?: number, width?: number, height?: number); + + /** + * Calculates the area of the given Rectangle object. + * @param rect The rectangle to calculate the area of. + */ + static Area(rect: Phaser.Geom.Rectangle): number; + + /** + * Rounds a Rectangle's position up to the smallest integer greater than or equal to each current coordinate. + * @param rect The Rectangle to adjust. + */ + static Ceil(rect: O): O; + + /** + * Rounds a Rectangle's position and size up to the smallest integer greater than or equal to each respective value. + * @param rect The Rectangle to modify. + */ + static CeilAll(rect: O): O; + + /** + * Moves the top-left corner of a Rectangle so that its center is at the given coordinates. + * @param rect The Rectangle to be centered. + * @param x The X coordinate of the Rectangle's center. + * @param y The Y coordinate of the Rectangle's center. + */ + static CenterOn(rect: O, x: number, y: number): O; + + /** + * Creates a new Rectangle which is identical to the given one. + * @param source The Rectangle to clone. + */ + static Clone(source: Phaser.Geom.Rectangle): Phaser.Geom.Rectangle; + + /** + * Checks if a given point is inside a Rectangle's bounds. + * @param rect The Rectangle to check. + * @param x The X coordinate of the point to check. + * @param y The Y coordinate of the point to check. + */ + static Contains(rect: Phaser.Geom.Rectangle, x: number, y: number): boolean; + + /** + * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. + * @param rect The Rectangle object. + * @param point The point object to be checked. Can be a Phaser Point object or any object with x and y values. + */ + static ContainsPoint(rect: Phaser.Geom.Rectangle, point: Phaser.Geom.Point): boolean; + + /** + * Tests if one rectangle fully contains another. + * @param rectA The first rectangle. + * @param rectB The second rectangle. + */ + static ContainsRect(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle): boolean; + + /** + * Copy the values of one Rectangle to a destination Rectangle. + * @param source The source Rectangle to copy the values from. + * @param dest The destination Rectangle to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Rectangle, dest: O): O; + + /** + * Create an array of points for each corner of a Rectangle + * If an array is specified, each point object will be added to the end of the array, otherwise a new array will be created. + * @param rect The Rectangle object to be decomposed. + * @param out If provided, each point will be added to this array. + */ + static Decompose(rect: Phaser.Geom.Rectangle, out?: any[]): any[]; + + /** + * Compares the `x`, `y`, `width` and `height` properties of two rectangles. + * @param rect Rectangle A + * @param toCompare Rectangle B + */ + static Equals(rect: Phaser.Geom.Rectangle, toCompare: Phaser.Geom.Rectangle): boolean; + + /** + * Adjusts the target rectangle, changing its width, height and position, + * so that it fits inside the area of the source rectangle, while maintaining its original + * aspect ratio. + * + * Unlike the `FitOutside` function, there may be some space inside the source area not covered. + * @param target The target rectangle to adjust. + * @param source The source rectangle to envlope the target in. + */ + static FitInside(target: O, source: Phaser.Geom.Rectangle): O; + + /** + * Adjusts the target rectangle, changing its width, height and position, + * so that it fully covers the area of the source rectangle, while maintaining its original + * aspect ratio. + * + * Unlike the `FitInside` function, the target rectangle may extend further out than the source. + * @param target The target rectangle to adjust. + * @param source The source rectangle to envlope the target in. + */ + static FitOutside(target: O, source: Phaser.Geom.Rectangle): O; + + /** + * Rounds down (floors) the top left X and Y co-ordinates of the given Rectangle to the largest integer less than or equal to them + * @param rect The rectangle to floor the top left X and Y co-ordinates of + */ + static Floor(rect: O): O; + + /** + * Rounds a Rectangle's position and size down to the largest integer less than or equal to each current coordinate or dimension. + * @param rect The Rectangle to adjust. + */ + static FloorAll(rect: O): O; + + /** + * Constructs new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds. + * @param points An array of points (either arrays with two elements corresponding to the X and Y coordinate or an object with public `x` and `y` properties) which should be surrounded by the Rectangle. + * @param out Optional Rectangle to adjust. + */ + static FromPoints(points: any[], out?: O): O; + + /** + * Calculates the width/height ratio of a rectangle. + * @param rect The rectangle. + */ + static GetAspectRatio(rect: Phaser.Geom.Rectangle): number; + + /** + * Returns the center of a Rectangle as a Point. + * @param rect The Rectangle to get the center of. + * @param out Optional point-like object to update with the center coordinates. + */ + static GetCenter(rect: Phaser.Geom.Rectangle, out?: O): O; + + /** + * Position is a value between 0 and 1 where 0 = the top-left of the rectangle and 0.5 = the bottom right. + * @param rectangle [description] + * @param position [description] + * @param out [description] + */ + static GetPoint(rectangle: Phaser.Geom.Rectangle, position: number, out?: O): O; + + /** + * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. + * @param rectangle The Rectangle object to get the points from. + * @param step Step between points. Used to calculate the number of points to return when quantity is falsy. Ignored if quantity is positive. + * @param quantity The number of evenly spaced points from the rectangles perimeter to return. If falsy, step param will be used to calculate the number of points. + * @param out An optional array to store the points in. + */ + static GetPoints(rectangle: Phaser.Geom.Rectangle, step: number, quantity: integer, out?: O): O; + + /** + * [description] + * @param rect [description] + * @param out [description] + */ + static GetSize(rect: Phaser.Geom.Rectangle, out?: O): O; + + /** + * Increases the size of a Rectangle by a specified amount. + * + * The center of the Rectangle stays the same. The amounts are added to each side, so the actual increase in width or height is two times bigger than the respective argument. + * @param rect The Rectangle to inflate. + * @param x How many pixels the left and the right side should be moved by horizontally. + * @param y How many pixels the top and the bottom side should be moved by vertically. + */ + static Inflate(rect: O, x: number, y: number): O; + + /** + * Takes two Rectangles and first checks to see if they intersect. + * If they intersect it will return the area of intersection in the `out` Rectangle. + * If they do not intersect, the `out` Rectangle will have a width and height of zero. + * @param rectA The first Rectangle to get the intersection from. + * @param rectB The second Rectangle to get the intersection from. + * @param out A Rectangle to store the intersection results in. + */ + static Intersection(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: Phaser.Geom.Rectangle): O; + + /** + * [description] + * @param rect [description] + * @param step [description] + * @param quantity [description] + * @param out [description] + */ + static MarchingAnts(rect: Phaser.Geom.Rectangle, step: number, quantity: integer, out?: O): O; + + /** + * Merges a Rectangle with a list of points by repositioning and/or resizing it such that all points are located on or within its bounds. + * @param target The Rectangle which should be merged. + * @param points An array of Points (or any object with public `x` and `y` properties) which should be merged with the Rectangle. + */ + static MergePoints(target: O, points: Phaser.Geom.Point[]): O; + + /** + * Merges the source rectangle into the target rectangle and returns the target. + * Neither rectangle should have a negative width or height. + * @param target Target rectangle. Will be modified to include source rectangle. + * @param source Rectangle that will be merged into target rectangle. + */ + static MergeRect(target: O, source: Phaser.Geom.Rectangle): O; + + /** + * Merges a Rectangle with a point by repositioning and/or resizing it so that the point is on or within its bounds. + * @param target The Rectangle which should be merged and modified. + * @param x The X coordinate of the point which should be merged. + * @param y The Y coordinate of the point which should be merged. + */ + static MergeXY(target: O, x: number, y: number): O; + + /** + * Nudges (translates) the top left corner of a Rectangle by a given offset. + * @param rect The Rectangle to adjust. + * @param x The distance to move the Rectangle horizontally. + * @param y The distance to move the Rectangle vertically. + */ + static Offset(rect: O, x: number, y: number): O; + + /** + * Nudges (translates) the top-left corner of a Rectangle by the coordinates of a point (translation vector). + * @param rect The Rectangle to adjust. + * @param point The point whose coordinates should be used as an offset. + */ + static OffsetPoint(rect: O, point: Phaser.Geom.Point | Phaser.Math.Vector2): O; + + /** + * Checks if two Rectangles overlap. If a Rectangle is within another Rectangle, the two will be considered overlapping. Thus, the Rectangles are treated as "solid". + * @param rectA The first Rectangle to check. + * @param rectB The second Rectangle to check. + */ + static Overlaps(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle): boolean; + + /** + * Calculates the perimeter of a Rectangle. + * @param rect The Rectangle to use. + */ + static Perimeter(rect: Phaser.Geom.Rectangle): number; + + /** + * [description] + * @param rectangle [description] + * @param angle [description] + * @param out [description] + */ + static PerimeterPoint(rectangle: Phaser.Geom.Rectangle, angle: integer, out?: O): O; + + /** + * Returns a random point within a Rectangle. + * @param rect The Rectangle to return a point from. + * @param out The object to update with the point's coordinates. + */ + static Random(rect: Phaser.Geom.Rectangle, out: O): O; + + /** + * Calculates a random point that lies within the `outer` Rectangle, but outside of the `inner` Rectangle. + * The inner Rectangle must be fully contained within the outer rectangle. + * @param outer The outer Rectangle to get the random point within. + * @param inner The inner Rectangle to exclude from the returned point. + * @param out A Point, or Point-like object to store the result in. If not specified, a new Point will be created. + */ + static RandomOutside(outer: Phaser.Geom.Rectangle, inner: Phaser.Geom.Rectangle, out?: O): O; + + /** + * The X coordinate of the top left corner of the Rectangle. + */ + x: number; + + /** + * The Y coordinate of the top left corner of the Rectangle. + */ + y: number; + + /** + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. + */ + width: number; + + /** + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. + */ + height: number; + + /** + * Checks if the given point is inside the Rectangle's bounds. + * @param x The X coordinate of the point to check. + * @param y The Y coordinate of the point to check. + */ + contains(x: number, y: number): boolean; + + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * @param position The normalized distance into the Rectangle's perimeter to return. + * @param output An object to update with the `x` and `y` coordinates of the point. + */ + getPoint(position: number, output?: O): O; + + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. + * @param quantity The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param stepRate If `quantity` is 0, determines the normalized distance between each returned point. + * @param output An array to which to append the points. + */ + getPoints(quantity: integer, stepRate?: number, output?: O): O; + + /** + * Returns a random point within the Rectangle's bounds. + * @param point The object in which to store the `x` and `y` coordinates of the point. + */ + getRandomPoint(point?: O): O; + + /** + * Sets the position, width, and height of the Rectangle. + * @param x The X coordinate of the top left corner of the Rectangle. + * @param y The Y coordinate of the top left corner of the Rectangle. + * @param width The width of the Rectangle. + * @param height The height of the Rectangle. + */ + setTo(x: number, y: number, width: number, height: number): Phaser.Geom.Rectangle; + + /** + * Resets the position, width, and height of the Rectangle to 0. + */ + setEmpty(): Phaser.Geom.Rectangle; + + /** + * Sets the position of the Rectangle. + * @param x The X coordinate of the top left corner of the Rectangle. + * @param y The Y coordinate of the top left corner of the Rectangle. Default x. + */ + setPosition(x: number, y?: number): Phaser.Geom.Rectangle; + + /** + * Sets the width and height of the Rectangle. + * @param width The width to set the Rectangle to. + * @param height The height to set the Rectangle to. Default width. + */ + setSize(width: number, height?: number): Phaser.Geom.Rectangle; + + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + */ + isEmpty(): boolean; + + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineA(line?: O): O; + + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineB(line?: O): O; + + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineC(line?: O): O; + + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineD(line?: O): O; + + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. + */ + left: number; + + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. + */ + right: number; + + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. + */ + top: number; + + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + */ + bottom: number; + + /** + * The x coordinate of the center of the Rectangle. + */ + centerX: number; + + /** + * The y coordinate of the center of the Rectangle. + */ + centerY: number; + + /** + * Determines if the two objects (either Rectangles or Rectangle-like) have the same width and height values under strict equality. + * @param rect The first Rectangle object. + * @param toCompare The second Rectangle object. + */ + static SameDimensions(rect: Phaser.Geom.Rectangle, toCompare: Phaser.Geom.Rectangle): boolean; + + /** + * Scales the width and height of this Rectangle by the given amounts. + * @param rect The `Rectangle` object that will be scaled by the specified amount(s). + * @param x The factor by which to scale the rectangle horizontally. + * @param y The amount by which to scale the rectangle vertically. If this is not specified, the rectangle will be scaled by the factor `x` in both directions. + */ + static Scale(rect: O, x: number, y: number): O; + + /** + * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. + * @param rectA The first Rectangle to use. + * @param rectB The second Rectangle to use. + * @param out The Rectangle to store the union in. + */ + static Union(rectA: Phaser.Geom.Rectangle, rectB: Phaser.Geom.Rectangle, out?: O): O; + + } + + /** + * A triangle is a plane created by connecting three points. + * The first two arguments specify the first point, the middle two arguments + * specify the second point, and the last two arguments specify the third point. + */ + class Triangle { + /** + * + * @param x1 `x` coordinate of the first point. Default 0. + * @param y1 `y` coordinate of the first point. Default 0. + * @param x2 `x` coordinate of the second point. Default 0. + * @param y2 `y` coordinate of the second point. Default 0. + * @param x3 `x` coordinate of the third point. Default 0. + * @param y3 `y` coordinate of the third point. Default 0. + */ + constructor(x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number); + + /** + * Returns the area of a Triangle. + * @param triangle The Triangle to use. + */ + static Area(triangle: Phaser.Geom.Triangle): number; + + /** + * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). + * The x/y specifies the top-middle of the triangle (x1/y1) and length is the length of each side. + * @param x x coordinate of the top point of the triangle. + * @param y y coordinate of the top point of the triangle. + * @param length Length of each side of the triangle. + */ + static BuildEquilateral(x: number, y: number, length: number): Phaser.Geom.Triangle; + + /** + * [description] + * @param data A flat array of vertice coordinates like [x0,y0, x1,y1, x2,y2, ...] + * @param holes An array of hole indices if any (e.g. [5, 8] for a 12-vertice input would mean one hole with vertices 5–7 and another with 8–11). Default null. + * @param scaleX [description] Default 1. + * @param scaleY [description] Default 1. + * @param out [description] + */ + static BuildFromPolygon(data: any[], holes?: any[], scaleX?: number, scaleY?: number, out?: O): O; + + /** + * Builds a right triangle, i.e. one which has a 90-degree angle and two acute angles. + * @param x The X coordinate of the right angle, which will also be the first X coordinate of the constructed Triangle. + * @param y The Y coordinate of the right angle, which will also be the first Y coordinate of the constructed Triangle. + * @param width The length of the side which is to the left or to the right of the right angle. + * @param height The length of the side which is above or below the right angle. + */ + static BuildRight(x: number, y: number, width: number, height: number): Phaser.Geom.Triangle; + + /** + * Positions the Triangle so that it is centered on the given coordinates. + * @param triangle The triangle to be positioned. + * @param x The horizontal coordinate to center on. + * @param y The vertical coordinate to center on. + * @param centerFunc The function used to center the triangle. Defaults to Centroid centering. + */ + static CenterOn(triangle: O, x: number, y: number, centerFunc?: CenterFunction): O; + + /** + * Calculates the position of a Triangle's centroid, which is also its center of mass (center of gravity). + * + * The centroid is the point in a Triangle at which its three medians (the lines drawn from the vertices to the bisectors of the opposite sides) meet. It divides each one in a 2:1 ratio. + * @param triangle The Triangle to use. + * @param out An object to store the coordinates in. + */ + static Centroid(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Computes the circumcentre of a triangle. The circumcentre is the centre of + * the circumcircle, the smallest circle which encloses the triangle. It is also + * the common intersection point of the perpendicular bisectors of the sides of + * the triangle, and is the only point which has equal distance to all three + * vertices of the triangle. + * @param triangle [description] + * @param out [description] + */ + static CircumCenter(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Finds the circumscribed circle (circumcircle) of a Triangle object. The circumcircle is the circle which touches all of the triangle's vertices. + * @param triangle The Triangle to use as input. + * @param out An optional Circle to store the result in. + */ + static CircumCircle(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Clones a Triangle object. + * @param source The Triangle to clone. + */ + static Clone(source: Phaser.Geom.Triangle): Phaser.Geom.Triangle; + + /** + * Checks if a point (as a pair of coordinates) is inside a Triangle's bounds. + * @param triangle The Triangle to check. + * @param x The X coordinate of the point to check. + * @param y The Y coordinate of the point to check. + */ + static Contains(triangle: Phaser.Geom.Triangle, x: number, y: number): boolean; + + /** + * Filters an array of point-like objects to only those contained within a triangle. + * If `returnFirst` is true, will return an array containing only the first point in the provided array that is within the triangle (or an empty array if there are no such points). + * @param triangle The triangle that the points are being checked in. + * @param points An array of point-like objects (objects that have an `x` and `y` property) + * @param returnFirst If `true`, return an array containing only the first point found that is within the triangle. Default false. + * @param out If provided, the points that are within the triangle will be appended to this array instead of being added to a new array. If `returnFirst` is true, only the first point found within the triangle will be appended. This array will also be returned by this function. + */ + static ContainsArray(triangle: Phaser.Geom.Triangle, points: Phaser.Geom.Point[], returnFirst?: boolean, out?: any[]): Phaser.Geom.Point[]; + + /** + * Tests if a triangle contains a point. + * @param triangle The triangle. + * @param point The point to test, or any point-like object with public `x` and `y` properties. + */ + static ContainsPoint(triangle: Phaser.Geom.Triangle, point: Phaser.Geom.Point | Phaser.Math.Vector2 | any): boolean; + + /** + * Copy the values of one Triangle to a destination Triangle. + * @param source The source Triangle to copy the values from. + * @param dest The destination Triangle to copy the values to. + */ + static CopyFrom(source: Phaser.Geom.Triangle, dest: O): O; + + /** + * Decomposes a Triangle into an array of its points. + * @param triangle The Triangle to decompose. + * @param out An array to store the points into. + */ + static Decompose(triangle: Phaser.Geom.Triangle, out?: any[]): any[]; + + /** + * Returns true if two triangles have the same coordinates. + * @param triangle The first triangle to check. + * @param toCompare The second triangle to check. + */ + static Equals(triangle: Phaser.Geom.Triangle, toCompare: Phaser.Geom.Triangle): boolean; + + /** + * Returns a Point from around the perimeter of a Triangle. + * @param triangle The Triangle to get the point on its perimeter from. + * @param position The position along the perimeter of the triangle. A value between 0 and 1. + * @param out An option Point, or Point-like object to store the value in. If not given a new Point will be created. + */ + static GetPoint(triangle: Phaser.Geom.Triangle, position: number, out?: O): O; + + /** + * Returns an array of evenly spaced points on the perimeter of a Triangle. + * @param triangle The Triangle to get the points from. + * @param quantity The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. + * @param stepRate If `quantity` is 0, the distance between each returned point. + * @param out An array to which the points should be appended. + */ + static GetPoints(triangle: Phaser.Geom.Triangle, quantity: integer, stepRate: number, out?: O): O; + + /** + * Calculates the position of the incenter of a Triangle object. This is the point where its three angle bisectors meet and it's also the center of the incircle, which is the circle inscribed in the triangle. + * @param triangle The Triangle to find the incenter of. + * @param out An optional Point in which to store the coordinates. + */ + static InCenter(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Moves each point (vertex) of a Triangle by a given offset, thus moving the entire Triangle by that offset. + * @param triangle The Triangle to move. + * @param x The horizontal offset (distance) by which to move each point. Can be positive or negative. + * @param y The vertical offset (distance) by which to move each point. Can be positive or negative. + */ + static Offset(triangle: O, x: number, y: number): O; + + /** + * Gets the length of the perimeter of the given triangle. + * @param triangle [description] + */ + static Perimeter(triangle: Phaser.Geom.Triangle): number; + + /** + * [description] + * @param triangle [description] + * @param out [description] + */ + static Random(triangle: Phaser.Geom.Triangle, out?: O): O; + + /** + * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet. + * @param triangle The Triangle to rotate. + * @param angle The angle by which to rotate the Triangle, in radians. + */ + static Rotate(triangle: O, angle: number): O; + + /** + * Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties. + * @param triangle The Triangle to rotate. + * @param point The Point to rotate the Triangle about. + * @param angle The angle by which to rotate the Triangle, in radians. + */ + static RotateAroundPoint(triangle: O, point: Phaser.Geom.Point, angle: number): O; + + /** + * Rotates an entire Triangle at a given angle about a specific point. + * @param triangle The Triangle to rotate. + * @param x The X coordinate of the point to rotate the Triangle about. + * @param y The Y coordinate of the point to rotate the Triangle about. + * @param angle The angle by which to rotate the Triangle, in radians. + */ + static RotateAroundXY(triangle: O, x: number, y: number, angle: number): O; + + /** + * `x` coordinate of the first point. + */ + x1: number; + + /** + * `y` coordinate of the first point. + */ + y1: number; + + /** + * `x` coordinate of the second point. + */ + x2: number; + + /** + * `y` coordinate of the second point. + */ + y2: number; + + /** + * `x` coordinate of the third point. + */ + x3: number; + + /** + * `y` coordinate of the third point. + */ + y3: number; + + /** + * Checks whether a given points lies within the triangle. + * @param x The x coordinate of the point to check. + * @param y The y coordinate of the point to check. + */ + contains(x: number, y: number): boolean; + + /** + * Returns a specific point on the triangle. + * @param position Position as float within `0` and `1`. `0` equals the first point. + * @param output Optional Point, or point-like object, that the calculated point will be written to. + */ + getPoint(position: number, output?: O): O; + + /** + * Calculates a list of evenly distributed points on the triangle. It is either possible to pass an amount of points to be generated (`quantity`) or the distance between two points (`stepRate`). + * @param quantity Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. + * @param stepRate Distance between two points. Will only be used when `quantity` is falsey. + * @param output Optional Array for writing the calculated points into. Otherwise a new array will be created. + */ + getPoints(quantity: integer, stepRate?: number, output?: O): O; + + /** + * Returns a random point along the triangle. + * @param point Optional `Point` that should be modified. Otherwise a new one will be created. + */ + getRandomPoint(point?: O): O; + + /** + * Sets all three points of the triangle. Leaving out any coordinate sets it to be `0`. + * @param x1 `x` coordinate of the first point. Default 0. + * @param y1 `y` coordinate of the first point. Default 0. + * @param x2 `x` coordinate of the second point. Default 0. + * @param y2 `y` coordinate of the second point. Default 0. + * @param x3 `x` coordinate of the third point. Default 0. + * @param y3 `y` coordinate of the third point. Default 0. + */ + setTo(x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number): Phaser.Geom.Triangle; + + /** + * Returns a Line object that corresponds to Line A of this Triangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineA(line?: O): O; + + /** + * Returns a Line object that corresponds to Line B of this Triangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineB(line?: O): O; + + /** + * Returns a Line object that corresponds to Line C of this Triangle. + * @param line A Line object to set the results in. If `undefined` a new Line will be created. + */ + getLineC(line?: O): O; + + /** + * Left most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. + */ + left: number; + + /** + * Right most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. + */ + right: number; + + /** + * Top most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. + */ + top: number; + + /** + * Bottom most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. + */ + bottom: number; + + } + + } + + namespace Input { + /** + * The mouse pointer is being held down. + */ + var MOUSE_DOWN: integer; + + /** + * The mouse pointer is being moved. + */ + var MOUSE_MOVE: integer; + + /** + * The mouse pointer is released. + */ + var MOUSE_UP: integer; + + /** + * A touch pointer has been started. + */ + var TOUCH_START: integer; + + /** + * A touch pointer has been started. + */ + var TOUCH_MOVE: integer; + + /** + * A touch pointer has been started. + */ + var TOUCH_END: integer; + + /** + * The pointer lock has changed. + */ + var POINTER_LOCK_CHANGE: integer; + + /** + * A touch pointer has been been cancelled by the browser. + */ + var TOUCH_CANCEL: integer; + + /** + * The mouse wheel changes. + */ + var MOUSE_WHEEL: integer; + + /** + * Creates a new Interactive Object. + * + * This is called automatically by the Input Manager when you enable a Game Object for input. + * + * The resulting Interactive Object is mapped to the Game Object's `input` property. + * @param gameObject The Game Object to which this Interactive Object is bound. + * @param hitArea The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle. + * @param hitAreaCallback The 'contains' check callback that the hit area shape will use for all hit tests. + */ + function CreateInteractiveObject(gameObject: Phaser.GameObjects.GameObject, hitArea: any, hitAreaCallback: Phaser.Types.Input.HitAreaCallback): Phaser.Types.Input.InteractiveObject; + + /** + * Creates a new Pixel Perfect Handler function. + * + * Access via `InputPlugin.makePixelPerfect` rather than calling it directly. + * @param textureManager A reference to the Texture Manager. + * @param alphaTolerance The alpha level that the pixel should be above to be included as a successful interaction. + */ + function CreatePixelPerfectHandler(textureManager: Phaser.Textures.TextureManager, alphaTolerance: integer): Function; + + namespace Events { + /** + * The Input Plugin Boot Event. + * + * This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves. + */ + const BOOT: any; + + /** + * The Input Plugin Destroy Event. + * + * This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves. + */ + const DESTROY: any; + + /** + * The Pointer Drag End Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer stops dragging a Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('dragend', listener)`. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_END]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_END} event instead. + */ + const DRAG_END: any; + + /** + * The Pointer Drag Enter Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object into a Drag Target. + * + * Listen to this event from within a Scene using: `this.input.on('dragenter', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_ENTER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_ENTER} event instead. + */ + const DRAG_ENTER: any; + + /** + * The Pointer Drag Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves while dragging a Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('drag', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG} event instead. + */ + const DRAG: any; + + /** + * The Pointer Drag Leave Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object out of a Drag Target. + * + * Listen to this event from within a Scene using: `this.input.on('dragleave', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_LEAVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_LEAVE} event instead. + */ + const DRAG_LEAVE: any; + + /** + * The Pointer Drag Over Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object over a Drag Target. + * + * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within + * the drag target, it will emit this event instead. + * + * Listen to this event from within a Scene using: `this.input.on('dragover', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_OVER} event instead. + */ + const DRAG_OVER: any; + + /** + * The Pointer Drag Start Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer starts to drag any Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('dragstart', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_START]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_START} event instead. + */ + const DRAG_START: any; + + /** + * The Pointer Drop Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drops a Game Object on a Drag Target. + * + * Listen to this event from within a Scene using: `this.input.on('drop', listener)`. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DROP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DROP} event instead. + */ + const DROP: any; + + /** + * The Game Object Down Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down on _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectdown', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_DOWN: any; + + /** + * The Game Object Drag End Event. + * + * This event is dispatched by an interactive Game Object if a pointer stops dragging it. + * + * Listen to this event from a Game Object using: `gameObject.on('dragend', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive](Phaser.GameObjects.GameObject#setInteractive) for more details. + */ + const GAMEOBJECT_DRAG_END: any; + + /** + * The Game Object Drag Enter Event. + * + * This event is dispatched by an interactive Game Object if a pointer drags it into a drag target. + * + * Listen to this event from a Game Object using: `gameObject.on('dragenter', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + */ + const GAMEOBJECT_DRAG_ENTER: any; + + /** + * The Game Object Drag Event. + * + * This event is dispatched by an interactive Game Object if a pointer moves while dragging it. + * + * Listen to this event from a Game Object using: `gameObject.on('drag', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + */ + const GAMEOBJECT_DRAG: any; + + /** + * The Game Object Drag Leave Event. + * + * This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target. + * + * Listen to this event from a Game Object using: `gameObject.on('dragleave', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + */ + const GAMEOBJECT_DRAG_LEAVE: any; + + /** + * The Game Object Drag Over Event. + * + * This event is dispatched by an interactive Game Object if a pointer drags it over a drag target. + * + * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within + * the drag target, it will emit this event instead. + * + * Listen to this event from a Game Object using: `gameObject.on('dragover', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + */ + const GAMEOBJECT_DRAG_OVER: any; + + /** + * The Game Object Drag Start Event. + * + * This event is dispatched by an interactive Game Object if a pointer starts to drag it. + * + * Listen to this event from a Game Object using: `gameObject.on('dragstart', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * There are lots of useful drag related properties that are set within the Game Object when dragging occurs. + * For example, `gameObject.input.dragStartX`, `dragStartY` and so on. + */ + const GAMEOBJECT_DRAG_START: any; + + /** + * The Game Object Drop Event. + * + * This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target. + * + * Listen to this event from a Game Object using: `gameObject.on('drop', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + */ + const GAMEOBJECT_DROP: any; + + /** + * The Game Object Move Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved across _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectmove', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} + * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} + * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_MOVE: any; + + /** + * The Game Object Out Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectout', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} + * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} + * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_OUT: any; + + /** + * The Game Object Over Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectover', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} + * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} + * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_OVER: any; + + /** + * The Game Object Pointer Down Event. + * + * This event is dispatched by an interactive Game Object if a pointer is pressed down on it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerdown', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_DOWN: any; + + /** + * The Game Object Pointer Move Event. + * + * This event is dispatched by an interactive Game Object if a pointer is moved while over it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointermove', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} + * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} + * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_MOVE: any; + + /** + * The Game Object Pointer Out Event. + * + * This event is dispatched by an interactive Game Object if a pointer moves out of it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerout', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} + * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} + * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_OUT: any; + + /** + * The Game Object Pointer Over Event. + * + * This event is dispatched by an interactive Game Object if a pointer moves over it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerover', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} + * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} + * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_OVER: any; + + /** + * The Game Object Pointer Up Event. + * + * This event is dispatched by an interactive Game Object if a pointer is released while over it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerup', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_UP: any; + + /** + * The Game Object Pointer Wheel Event. + * + * This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it. + * + * Listen to this event from a Game Object using: `gameObject.on('wheel', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} + * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} + * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_POINTER_WHEEL: any; + + /** + * The Game Object Up Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released while over _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectup', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_UP: any; + + /** + * The Game Object Wheel Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel moved while over _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectwheel', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} + * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} + * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const GAMEOBJECT_WHEEL: any; + + /** + * The Input Plugin Game Out Event. + * + * This event is dispatched by the Input Plugin if the active pointer leaves the game canvas and is now + * outside of it, elsewhere on the web page. + * + * Listen to this event from within a Scene using: `this.input.on('gameout', listener)`. + */ + const GAME_OUT: any; + + /** + * The Input Plugin Game Over Event. + * + * This event is dispatched by the Input Plugin if the active pointer enters the game canvas and is now + * over of it, having previously been elsewhere on the web page. + * + * Listen to this event from within a Scene using: `this.input.on('gameover', listener)`. + */ + const GAME_OVER: any; + + /** + * The Input Manager Boot Event. + * + * This internal event is dispatched by the Input Manager when it boots. + */ + const MANAGER_BOOT: any; + + /** + * The Input Manager Process Event. + * + * This internal event is dispatched by the Input Manager when not using the legacy queue system, + * and it wants the Input Plugins to update themselves. + */ + const MANAGER_PROCESS: any; + + /** + * The Input Manager Update Event. + * + * This internal event is dispatched by the Input Manager as part of its update step. + */ + const MANAGER_UPDATE: any; + + /** + * The Input Manager Pointer Lock Change Event. + * + * This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event. + */ + const POINTERLOCK_CHANGE: any; + + /** + * The Pointer Down Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere. + * + * Listen to this event from within a Scene using: `this.input.on('pointerdown', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_DOWN: any; + + /** + * The Pointer Down Outside Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere outside of the game canvas. + * + * Listen to this event from within a Scene using: `this.input.on('pointerdownoutside', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_DOWN_OUTSIDE: any; + + /** + * The Pointer Move Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved anywhere. + * + * Listen to this event from within a Scene using: `this.input.on('pointermove', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} + * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} + * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_MOVE: any; + + /** + * The Pointer Out Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} + * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} + * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_OUT: any; + + /** + * The Pointer Over Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('pointerover', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} + * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} + * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_OVER: any; + + /** + * The Pointer Up Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere. + * + * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_UP: any; + + /** + * The Pointer Up Outside Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere outside of the game canvas. + * + * Listen to this event from within a Scene using: `this.input.on('pointerupoutside', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_UP_OUTSIDE: any; + + /** + * The Pointer Wheel Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel updated. + * + * Listen to this event from within a Scene using: `this.input.on('wheel', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} + * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} + * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + */ + const POINTER_WHEEL: any; + + /** + * The Input Plugin Pre-Update Event. + * + * This internal event is dispatched by the Input Plugin at the start of its `preUpdate` method. + * This hook is designed specifically for input plugins, but can also be listened to from user-land code. + */ + const PRE_UPDATE: any; + + /** + * The Input Plugin Shutdown Event. + * + * This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down. + */ + const SHUTDOWN: any; + + /** + * The Input Plugin Start Event. + * + * This internal event is dispatched by the Input Plugin when it has finished setting-up, + * signalling to all of its internal systems to start. + */ + const START: any; + + /** + * The Input Plugin Update Event. + * + * This internal event is dispatched by the Input Plugin at the start of its `update` method. + * This hook is designed specifically for input plugins, but can also be listened to from user-land code. + */ + const UPDATE: any; + + } + + namespace Gamepad { + /** + * Contains information about a specific Gamepad Axis. + * Axis objects are created automatically by the Gamepad as they are needed. + */ + class Axis { + /** + * + * @param pad A reference to the Gamepad that this Axis belongs to. + * @param index The index of this Axis. + */ + constructor(pad: Phaser.Input.Gamepad.Gamepad, index: integer); + + /** + * A reference to the Gamepad that this Axis belongs to. + */ + pad: Phaser.Input.Gamepad.Gamepad; + + /** + * An event emitter to use to emit the axis events. + */ + events: Phaser.Events.EventEmitter; + + /** + * The index of this Axis. + */ + index: integer; + + /** + * The raw axis value, between -1 and 1 with 0 being dead center. + * Use the method `getValue` to get a normalized value with the threshold applied. + */ + value: number; + + /** + * Movement tolerance threshold below which axis values are ignored in `getValue`. + */ + threshold: number; + + /** + * Applies the `threshold` value to the axis and returns it. + */ + getValue(): number; + + /** + * Destroys this Axis instance and releases external references it holds. + */ + destroy(): void; + + } + + /** + * Contains information about a specific button on a Gamepad. + * Button objects are created automatically by the Gamepad as they are needed. + */ + class Button { + /** + * + * @param pad A reference to the Gamepad that this Button belongs to. + * @param index The index of this Button. + */ + constructor(pad: Phaser.Input.Gamepad.Gamepad, index: integer); + + /** + * A reference to the Gamepad that this Button belongs to. + */ + pad: Phaser.Input.Gamepad.Gamepad; + + /** + * An event emitter to use to emit the button events. + */ + events: Phaser.Events.EventEmitter; + + /** + * The index of this Button. + */ + index: integer; + + /** + * Between 0 and 1. + */ + value: number; + + /** + * Can be set for analogue buttons to enable a 'pressure' threshold, + * before a button is considered as being 'pressed'. + */ + threshold: number; + + /** + * Is the Button being pressed down or not? + */ + pressed: boolean; + + /** + * Destroys this Button instance and releases external references it holds. + */ + destroy(): void; + + } + + namespace Configs { + /** + * Tatar SNES USB Controller Gamepad Configuration. + * USB Gamepad (STANDARD GAMEPAD Vendor: 0079 Product: 0011) + */ + var SNES_USB: object; + + /** + * PlayStation DualShock 4 Gamepad Configuration. + * Sony PlayStation DualShock 4 (v2) wireless controller + */ + var DUALSHOCK_4: object; + + /** + * XBox 360 Gamepad Configuration. + */ + var XBOX_360: object; + + } + + namespace Events { + /** + * The Gamepad Button Down Event. + * + * This event is dispatched by the Gamepad Plugin when a button has been pressed on any active Gamepad. + * + * Listen to this event from within a Scene using: `this.input.gamepad.on('down', listener)`. + * + * You can also listen for a DOWN event from a Gamepad instance. See the [GAMEPAD_BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_DOWN} event for details. + */ + const BUTTON_DOWN: any; + + /** + * The Gamepad Button Up Event. + * + * This event is dispatched by the Gamepad Plugin when a button has been released on any active Gamepad. + * + * Listen to this event from within a Scene using: `this.input.gamepad.on('up', listener)`. + * + * You can also listen for an UP event from a Gamepad instance. See the [GAMEPAD_BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_UP} event for details. + */ + const BUTTON_UP: any; + + /** + * The Gamepad Connected Event. + * + * This event is dispatched by the Gamepad Plugin when a Gamepad has been connected. + * + * Listen to this event from within a Scene using: `this.input.gamepad.once('connected', listener)`. + * + * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, + * this is for security reasons. However, it may also trust the page already, in which case you won't get the + * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads + * already connected. + */ + const CONNECTED: any; + + /** + * The Gamepad Disconnected Event. + * + * This event is dispatched by the Gamepad Plugin when a Gamepad has been disconnected. + * + * Listen to this event from within a Scene using: `this.input.gamepad.once('disconnected', listener)`. + */ + const DISCONNECTED: any; + + /** + * The Gamepad Button Down Event. + * + * This event is dispatched by a Gamepad instance when a button has been pressed on it. + * + * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: + * `this.input.gamepad.pad1.on('down', listener)`. + * + * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. + * + * You can also listen for a DOWN event from the Gamepad Plugin. See the [BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_DOWN} event for details. + */ + const GAMEPAD_BUTTON_DOWN: any; + + /** + * The Gamepad Button Up Event. + * + * This event is dispatched by a Gamepad instance when a button has been released on it. + * + * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: + * `this.input.gamepad.pad1.on('up', listener)`. + * + * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. + * + * You can also listen for an UP event from the Gamepad Plugin. See the [BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_UP} event for details. + */ + const GAMEPAD_BUTTON_UP: any; + + } + + /** + * A single Gamepad. + * + * These are created, updated and managed by the Gamepad Plugin. + */ + class Gamepad extends Phaser.Events.EventEmitter { + /** + * + * @param manager A reference to the Gamepad Plugin. + * @param pad The Gamepad object, as extracted from GamepadEvent. + */ + constructor(manager: Phaser.Input.Gamepad.GamepadPlugin, pad: Phaser.Types.Input.Gamepad.Pad); + + /** + * A reference to the Gamepad Plugin. + */ + manager: Phaser.Input.Gamepad.GamepadPlugin; + + /** + * A reference to the native Gamepad object that is connected to the browser. + */ + pad: any; + + /** + * A string containing some information about the controller. + * + * This is not strictly specified, but in Firefox it will contain three pieces of information + * separated by dashes (-): two 4-digit hexadecimal strings containing the USB vendor and + * product id of the controller, and the name of the controller as provided by the driver. + * In Chrome it will contain the name of the controller as provided by the driver, + * followed by vendor and product 4-digit hexadecimal strings. + */ + id: string; + + /** + * An integer that is unique for each Gamepad currently connected to the system. + * This can be used to distinguish multiple controllers. + * Note that disconnecting a device and then connecting a new device may reuse the previous index. + */ + index: number; + + /** + * An array of Gamepad Button objects, corresponding to the different buttons available on the Gamepad. + */ + buttons: Phaser.Input.Gamepad.Button[]; + + /** + * An array of Gamepad Axis objects, corresponding to the different axes available on the Gamepad, if any. + */ + axes: Phaser.Input.Gamepad.Axis[]; + + /** + * The Gamepad's Haptic Actuator (Vibration / Rumble support). + * This is highly experimental and only set if both present on the device, + * and exposed by both the hardware and browser. + */ + vibration: GamepadHapticActuator; + + /** + * A Vector2 containing the most recent values from the Gamepad's left axis stick. + * This is updated automatically as part of the Gamepad.update cycle. + * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. + * The values are based on the Axis thresholds. + * If the Gamepad does not have a left axis stick, the values will always be zero. + */ + leftStick: Phaser.Math.Vector2; + + /** + * A Vector2 containing the most recent values from the Gamepad's right axis stick. + * This is updated automatically as part of the Gamepad.update cycle. + * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. + * The values are based on the Axis thresholds. + * If the Gamepad does not have a right axis stick, the values will always be zero. + */ + rightStick: Phaser.Math.Vector2; + + /** + * Gets the total number of axis this Gamepad claims to support. + */ + getAxisTotal(): integer; + + /** + * Gets the value of an axis based on the given index. + * The index must be valid within the range of axes supported by this Gamepad. + * The return value will be a float between 0 and 1. + * @param index The index of the axes to get the value for. + */ + getAxisValue(index: integer): number; + + /** + * Sets the threshold value of all axis on this Gamepad. + * The value is a float between 0 and 1 and is the amount below which the axis is considered as not having been moved. + * @param value A value between 0 and 1. + */ + setAxisThreshold(value: number): void; + + /** + * Gets the total number of buttons this Gamepad claims to have. + */ + getButtonTotal(): integer; + + /** + * Gets the value of a button based on the given index. + * The index must be valid within the range of buttons supported by this Gamepad. + * + * The return value will be either 0 or 1 for an analogue button, or a float between 0 and 1 + * for a pressure-sensitive digital button, such as the shoulder buttons on a Dual Shock. + * @param index The index of the button to get the value for. + */ + getButtonValue(index: integer): number; + + /** + * Returns if the button is pressed down or not. + * The index must be valid within the range of buttons supported by this Gamepad. + * @param index The index of the button to get the value for. + */ + isButtonDown(index: integer): boolean; + + /** + * Destroys this Gamepad instance, its buttons and axes, and releases external references it holds. + */ + destroy(): void; + + /** + * Is this Gamepad currently connected or not? + */ + connected: boolean; + + /** + * A timestamp containing the most recent time this Gamepad was updated. + */ + timestamp: number; + + /** + * Is the Gamepad's Left button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad left button under standard Gamepad mapping. + */ + left: boolean; + + /** + * Is the Gamepad's Right button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad right button under standard Gamepad mapping. + */ + right: boolean; + + /** + * Is the Gamepad's Up button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad up button under standard Gamepad mapping. + */ + up: boolean; + + /** + * Is the Gamepad's Down button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad down button under standard Gamepad mapping. + */ + down: boolean; + + /** + * Is the Gamepad's bottom button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the X button. + * On an XBox controller it's the A button. + */ + A: boolean; + + /** + * Is the Gamepad's top button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Triangle button. + * On an XBox controller it's the Y button. + */ + Y: boolean; + + /** + * Is the Gamepad's left button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Square button. + * On an XBox controller it's the X button. + */ + X: boolean; + + /** + * Is the Gamepad's right button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Circle button. + * On an XBox controller it's the B button. + */ + B: boolean; + + /** + * Returns the value of the Gamepad's top left shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the L1 button. + * On an XBox controller it's the LB button. + */ + L1: number; + + /** + * Returns the value of the Gamepad's bottom left shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the L2 button. + * On an XBox controller it's the LT button. + */ + L2: number; + + /** + * Returns the value of the Gamepad's top right shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the R1 button. + * On an XBox controller it's the RB button. + */ + R1: number; + + /** + * Returns the value of the Gamepad's bottom right shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the R2 button. + * On an XBox controller it's the RT button. + */ + R2: number; + + } + + /** + * The Gamepad Plugin is an input plugin that belongs to the Scene-owned Input system. + * + * Its role is to listen for native DOM Gamepad Events and then process them. + * + * You do not need to create this class directly, the Input system will create an instance of it automatically. + * + * You can access it from within a Scene using `this.input.gamepad`. + * + * To listen for a gamepad being connected: + * + * ```javascript + * this.input.gamepad.once('connected', function (pad) { + * // 'pad' is a reference to the gamepad that was just connected + * }); + * ``` + * + * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, + * this is for security reasons. However, it may also trust the page already, in which case you won't get the + * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads + * already connected. + * + * Once you have received the connected event, or polled the gamepads and found them enabled, you can access + * them via the built-in properties `GamepadPlugin.pad1` to `pad4`, for up to 4 game pads. With a reference + * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on + * the `Gamepad` class for more details. + * + * For more information about Gamepad support in browsers see the following resources: + * + * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API + * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API + * https://www.smashingmagazine.com/2015/11/gamepad-api-in-web-games/ + * http://html5gamepad.com/ + */ + class GamepadPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param sceneInputPlugin A reference to the Scene Input Plugin that the KeyboardPlugin belongs to. + */ + constructor(sceneInputPlugin: Phaser.Input.InputPlugin); + + /** + * A reference to the Scene that this Input Plugin is responsible for. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems Settings. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * A reference to the Scene Input Plugin that created this Keyboard Plugin. + */ + sceneInputPlugin: Phaser.Input.InputPlugin; + + /** + * A boolean that controls if the Gamepad Manager is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * The Gamepad Event target, as defined in the Game Config. + * Typically the browser window, but can be any interactive DOM element. + */ + target: any; + + /** + * An array of the connected Gamepads. + */ + gamepads: Phaser.Input.Gamepad.Gamepad[]; + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + */ + isActive(): boolean; + + /** + * Disconnects all current Gamepads. + */ + disconnectAll(): void; + + /** + * Returns an array of all currently connected Gamepads. + */ + getAll(): Phaser.Input.Gamepad.Gamepad[]; + + /** + * Looks-up a single Gamepad based on the given index value. + * @param index The index of the Gamepad to get. + */ + getPad(index: number): Phaser.Input.Gamepad.Gamepad; + + /** + * The total number of connected game pads. + */ + total: integer; + + /** + * A reference to the first connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad1: Phaser.Input.Gamepad.Gamepad; + + /** + * A reference to the second connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad2: Phaser.Input.Gamepad.Gamepad; + + /** + * A reference to the third connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad3: Phaser.Input.Gamepad.Gamepad; + + /** + * A reference to the fourth connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + */ + pad4: Phaser.Input.Gamepad.Gamepad; + + } + + } + + /** + * The Input Manager is responsible for handling the pointer related systems in a single Phaser Game instance. + * + * Based on the Game Config it will create handlers for mouse and touch support. + * + * Keyboard and Gamepad are plugins, handled directly by the InputPlugin class. + * + * It then manages the events, pointer creation and general hit test related operations. + * + * You rarely need to interact with the Input Manager directly, and as such, all of its properties and methods + * should be considered private. Instead, you should use the Input Plugin, which is a Scene level system, responsible + * for dealing with all input events for a Scene. + */ + class InputManager { + /** + * + * @param game The Game instance that owns the Input Manager. + * @param config The Input Configuration object, as set in the Game Config. + */ + constructor(game: Phaser.Game, config: object); + + /** + * The Game instance that owns the Input Manager. + * A Game only maintains on instance of the Input Manager at any time. + */ + readonly game: Phaser.Game; + + /** + * A reference to the global Game Scale Manager. + * Used for all bounds checks and pointer scaling. + */ + scaleManager: Phaser.Scale.ScaleManager; + + /** + * The Canvas that is used for all DOM event input listeners. + */ + canvas: HTMLCanvasElement; + + /** + * The Game Configuration object, as set during the game boot. + */ + config: Phaser.Core.Config; + + /** + * If set, the Input Manager will run its update loop every frame. + */ + enabled: boolean; + + /** + * The Event Emitter instance that the Input Manager uses to emit events from. + */ + events: Phaser.Events.EventEmitter; + + /** + * Are any mouse or touch pointers currently over the game canvas? + * This is updated automatically by the canvas over and out handlers. + */ + readonly isOver: boolean; + + /** + * The default CSS cursor to be used when interacting with your game. + * + * See the `setDefaultCursor` method for more details. + */ + defaultCursor: string; + + /** + * A reference to the Keyboard Manager class, if enabled via the `input.keyboard` Game Config property. + */ + keyboard: Phaser.Input.Keyboard.KeyboardManager; + + /** + * A reference to the Mouse Manager class, if enabled via the `input.mouse` Game Config property. + */ + mouse: Phaser.Input.Mouse.MouseManager; + + /** + * A reference to the Touch Manager class, if enabled via the `input.touch` Game Config property. + */ + touch: Phaser.Input.Touch.TouchManager; + + /** + * An array of Pointers that have been added to the game. + * The first entry is reserved for the Mouse Pointer, the rest are Touch Pointers. + * + * By default there is 1 touch pointer enabled. If you need more use the `addPointer` method to start them, + * or set the `input.activePointers` property in the Game Config. + */ + pointers: Phaser.Input.Pointer[]; + + /** + * The number of touch objects activated and being processed each update. + * + * You can change this by either calling `addPointer` at run-time, or by + * setting the `input.activePointers` property in the Game Config. + */ + readonly pointersTotal: integer; + + /** + * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. + * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer` + * which will always map to the most recently interacted pointer. + */ + mousePointer: Phaser.Input.Pointer; + + /** + * The most recently active Pointer object. + * + * If you've only 1 Pointer in your game then this will accurately be either the first finger touched, or the mouse. + * + * If your game doesn't need to support multi-touch then you can safely use this property in all of your game + * code and it will adapt to be either the mouse or the touch, based on device. + */ + activePointer: Phaser.Input.Pointer; + + /** + * If the top-most Scene in the Scene List receives an input it will stop input from + * propagating any lower down the scene list, i.e. if you have a UI Scene at the top + * and click something on it, that click will not then be passed down to any other + * Scene below. Disable this to have input events passed through all Scenes, all the time. + */ + globalTopOnly: boolean; + + /** + * The time this Input Manager was last updated. + * This value is populated by the Game Step each frame. + */ + readonly time: number; + + /** + * The Boot handler is called by Phaser.Game when it first starts up. + * The renderer is available by now. + */ + protected boot(): void; + + /** + * Tells the Input system to set a custom cursor. + * + * This cursor will be the default cursor used when interacting with the game canvas. + * + * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. + * + * Any valid CSS cursor value is allowed, including paths to image files, i.e.: + * + * ```javascript + * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); + * ``` + * + * Please read about the differences between browsers when it comes to the file formats and sizes they support: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property + * + * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support. + * @param cursor The CSS to be used when setting the default cursor. + */ + setDefaultCursor(cursor: string): void; + + /** + * Adds new Pointer objects to the Input Manager. + * + * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`. + * + * You can create more either by calling this method, or by setting the `input.activePointers` property + * in the Game Config, up to a maximum of 10 pointers. + * + * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added + * via this method. + * @param quantity The number of new Pointers to create. A maximum of 10 is allowed in total. Default 1. + */ + addPointer(quantity?: integer): Phaser.Input.Pointer[]; + + /** + * Internal method that gets a list of all the active Input Plugins in the game + * and updates each of them in turn, in reverse order (top to bottom), to allow + * for DOM top-level event handling simulation. + * @param type The type of event to process. + * @param pointers An array of Pointers on which the event occurred. + */ + updateInputPlugins(type: integer, pointers: Phaser.Input.Pointer[]): void; + + /** + * Performs a hit test using the given Pointer and camera, against an array of interactive Game Objects. + * + * The Game Objects are culled against the camera, and then the coordinates are translated into the local camera space + * and used to determine if they fall within the remaining Game Objects hit areas or not. + * + * If nothing is matched an empty array is returned. + * + * This method is called automatically by InputPlugin.hitTestPointer and doesn't usually need to be invoked directly. + * @param pointer The Pointer to test against. + * @param gameObjects An array of interactive Game Objects to check. + * @param camera The Camera which is being tested against. + * @param output An array to store the results in. If not given, a new empty array is created. + */ + hitTest(pointer: Phaser.Input.Pointer, gameObjects: any[], camera: Phaser.Cameras.Scene2D.Camera, output?: any[]): any[]; + + /** + * Checks if the given x and y coordinate are within the hit area of the Game Object. + * + * This method assumes that the coordinate values have already been translated into the space of the Game Object. + * + * If the coordinates are within the hit area they are set into the Game Objects Input `localX` and `localY` properties. + * @param gameObject The interactive Game Object to check against. + * @param x The translated x coordinate for the hit test. + * @param y The translated y coordinate for the hit test. + */ + pointWithinHitArea(gameObject: Phaser.GameObjects.GameObject, x: number, y: number): boolean; + + /** + * Checks if the given x and y coordinate are within the hit area of the Interactive Object. + * + * This method assumes that the coordinate values have already been translated into the space of the Interactive Object. + * + * If the coordinates are within the hit area they are set into the Interactive Objects Input `localX` and `localY` properties. + * @param object The Interactive Object to check against. + * @param x The translated x coordinate for the hit test. + * @param y The translated y coordinate for the hit test. + */ + pointWithinInteractiveObject(object: Phaser.Types.Input.InteractiveObject, x: number, y: number): boolean; + + /** + * Transforms the pageX and pageY values of a Pointer into the scaled coordinate space of the Input Manager. + * @param pointer The Pointer to transform the values for. + * @param pageX The Page X value. + * @param pageY The Page Y value. + * @param wasMove Are we transforming the Pointer from a move event, or an up / down event? + */ + transformPointer(pointer: Phaser.Input.Pointer, pageX: number, pageY: number, wasMove: boolean): void; + + /** + * Destroys the Input Manager and all of its systems. + * + * There is no way to recover from doing this. + */ + destroy(): void; + + } + + /** + * The Input Plugin belongs to a Scene and handles all input related events and operations for it. + * + * You can access it from within a Scene using `this.input`. + * + * It emits events directly. For example, you can do: + * + * ```javascript + * this.input.on('pointerdown', callback, context); + * ``` + * + * To listen for a pointer down event anywhere on the game canvas. + * + * Game Objects can be enabled for input by calling their `setInteractive` method. After which they + * will directly emit input events: + * + * ```javascript + * var sprite = this.add.sprite(x, y, texture); + * sprite.setInteractive(); + * sprite.on('pointerdown', callback, context); + * ``` + * + * There are lots of game configuration options available relating to input. + * See the [Input Config object]{@linkcode Phaser.Types.Core.InputConfig} for more details, including how to deal with Phaser + * listening for input events outside of the canvas, how to set a default number of pointers, input + * capture settings and more. + * + * Please also see the Input examples and tutorials for further information. + */ + class InputPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param scene A reference to the Scene that this Input Plugin is responsible for. + */ + constructor(scene: Phaser.Scene); + + /** + * An instance of the Gamepad Plugin class, if enabled via the `input.gamepad` Scene or Game Config property. + * Use this to create access Gamepads connected to the browser and respond to gamepad buttons. + */ + gamepad: Phaser.Input.Gamepad.GamepadPlugin; + + /** + * A reference to the Scene that this Input Plugin is responsible for. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems class. + */ + systems: Phaser.Scenes.Systems; + + /** + * A reference to the Scene Systems Settings. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * A reference to the Game Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * If `true` this Input Plugin will process DOM input events. + */ + enabled: boolean; + + /** + * A reference to the Scene Display List. This property is set during the `boot` method. + */ + displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene Cameras Manager. This property is set during the `boot` method. + */ + cameras: Phaser.Cameras.Scene2D.CameraManager; + + /** + * A reference to the Mouse Manager. + * + * This property is only set if Mouse support has been enabled in your Game Configuration file. + * + * If you just wish to get access to the mouse pointer, use the `mousePointer` property instead. + */ + mouse: Phaser.Input.Mouse.MouseManager; + + /** + * When set to `true` (the default) the Input Plugin will emulate DOM behavior by only emitting events from + * the top-most Game Objects in the Display List. + * + * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one. + */ + topOnly: boolean; + + /** + * How often should the Pointers be checked? + * + * The value is a time, given in ms, and is the time that must have elapsed between game steps before + * the Pointers will be polled again. When a pointer is polled it runs a hit test to see which Game + * Objects are currently below it, or being interacted with it. + * + * Pointers will *always* be checked if they have been moved by the user, or press or released. + * + * This property only controls how often they will be polled if they have not been updated. + * You should set this if you want to have Game Objects constantly check against the pointers, even + * if the pointer didn't itself move. + * + * Set to 0 to poll constantly. Set to -1 to only poll on user movement. + */ + pollRate: integer; + + /** + * The distance, in pixels, a pointer has to move while being held down, before it thinks it is being dragged. + */ + dragDistanceThreshold: number; + + /** + * The amount of time, in ms, a pointer has to be held down before it thinks it is dragging. + */ + dragTimeThreshold: number; + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + */ + isActive(): boolean; + + /** + * This is called automatically by the Input Manager. + * It emits events for plugins to listen to and also handles polling updates, if enabled. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + updatePoll(time: number, delta: number): boolean; + + /** + * Clears a Game Object so it no longer has an Interactive Object associated with it. + * The Game Object is then queued for removal from the Input Plugin on the next update. + * @param gameObject The Game Object that will have its Interactive Object removed. + * @param skipQueue Skip adding this Game Object into the removal queue? Default false. + */ + clear(gameObject: Phaser.GameObjects.GameObject, skipQueue?: boolean): Phaser.GameObjects.GameObject; + + /** + * Disables Input on a single Game Object. + * + * An input disabled Game Object still retains its Interactive Object component and can be re-enabled + * at any time, by passing it to `InputPlugin.enable`. + * @param gameObject The Game Object to have its input system disabled. + */ + disable(gameObject: Phaser.GameObjects.GameObject): void; + + /** + * Enable a Game Object for interaction. + * + * If the Game Object already has an Interactive Object component, it is enabled and returned. + * + * Otherwise, a new Interactive Object component is created and assigned to the Game Object's `input` property. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * @param gameObject The Game Object to be enabled for input. + * @param shape Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param callback The 'contains' function to invoke to check if the pointer is within the hit area. + * @param dropZone Is this Game Object a drop zone or not? Default false. + */ + enable(gameObject: Phaser.GameObjects.GameObject, shape?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): Phaser.Input.InputPlugin; + + /** + * Takes the given Pointer and performs a hit test against it, to see which interactive Game Objects + * it is currently above. + * + * The hit test is performed against which-ever Camera the Pointer is over. If it is over multiple + * cameras, it starts checking the camera at the top of the camera list, and if nothing is found, iterates down the list. + * @param pointer The Pointer to check against the Game Objects. + */ + hitTestPointer(pointer: Phaser.Input.Pointer): Phaser.GameObjects.GameObject[]; + + /** + * Returns the drag state of the given Pointer for this Input Plugin. + * + * The state will be one of the following: + * + * 0 = Not dragging anything + * 1 = Primary button down and objects below, so collect a draglist + * 2 = Pointer being checked if meets drag criteria + * 3 = Pointer meets criteria, notify the draglist + * 4 = Pointer actively dragging the draglist and has moved + * 5 = Pointer actively dragging but has been released, notify draglist + * @param pointer The Pointer to get the drag state for. + */ + getDragState(pointer: Phaser.Input.Pointer): integer; + + /** + * Sets the drag state of the given Pointer for this Input Plugin. + * + * The state must be one of the following values: + * + * 0 = Not dragging anything + * 1 = Primary button down and objects below, so collect a draglist + * 2 = Pointer being checked if meets drag criteria + * 3 = Pointer meets criteria, notify the draglist + * 4 = Pointer actively dragging the draglist and has moved + * 5 = Pointer actively dragging but has been released, notify draglist + * @param pointer The Pointer to set the drag state for. + * @param state The drag state value. An integer between 0 and 5. + */ + setDragState(pointer: Phaser.Input.Pointer, state: integer): void; + + /** + * Sets the draggable state of the given array of Game Objects. + * + * They can either be set to be draggable, or can have their draggable state removed by passing `false`. + * + * A Game Object will not fire drag events unless it has been specifically enabled for drag. + * @param gameObjects An array of Game Objects to change the draggable state on. + * @param value Set to `true` if the Game Objects should be made draggable, `false` if they should be unset. Default true. + */ + setDraggable(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], value?: boolean): Phaser.Input.InputPlugin; + + /** + * Creates a function that can be passed to `setInteractive`, `enable` or `setHitArea` that will handle + * pixel-perfect input detection on an Image or Sprite based Game Object, or any custom class that extends them. + * + * The following will create a sprite that is clickable on any pixel that has an alpha value >= 1. + * + * ```javascript + * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect()); + * ``` + * + * The following will create a sprite that is clickable on any pixel that has an alpha value >= 150. + * + * ```javascript + * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect(150)); + * ``` + * + * Once you have made an Interactive Object pixel perfect it impacts all input related events for it: down, up, + * dragstart, drag, etc. + * + * As a pointer interacts with the Game Object it will constantly poll the texture, extracting a single pixel from + * the given coordinates and checking its color values. This is an expensive process, so should only be enabled on + * Game Objects that really need it. + * + * You cannot make non-texture based Game Objects pixel perfect. So this will not work on Graphics, BitmapText, + * Render Textures, Text, Tilemaps, Containers or Particles. + * @param alphaTolerance The alpha level that the pixel should be above to be included as a successful interaction. Default 1. + */ + makePixelPerfect(alphaTolerance?: integer): Function; + + /** + * Sets the hit area for the given array of Game Objects. + * + * A hit area is typically one of the geometric shapes Phaser provides, such as a `Phaser.Geom.Rectangle` + * or `Phaser.Geom.Circle`. However, it can be any object as long as it works with the provided callback. + * + * If no hit area is provided a Rectangle is created based on the size of the Game Object, if possible + * to calculate. + * + * The hit area callback is the function that takes an `x` and `y` coordinate and returns a boolean if + * those values fall within the area of the shape or not. All of the Phaser geometry objects provide this, + * such as `Phaser.Geom.Rectangle.Contains`. + * @param gameObjects An array of Game Objects to set the hit area on. + * @param shape Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param callback The 'contains' function to invoke to check if the pointer is within the hit area. + */ + setHitArea(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], shape?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Circle` shape, using + * the given coordinates and radius to control its position and size. + * @param gameObjects An array of Game Objects to set as having a circle hit area. + * @param x The center of the circle. + * @param y The center of the circle. + * @param radius The radius of the circle. + * @param callback The hit area callback. If undefined it uses Circle.Contains. + */ + setHitAreaCircle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, radius: number, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Ellipse` shape, using + * the given coordinates and dimensions to control its position and size. + * @param gameObjects An array of Game Objects to set as having an ellipse hit area. + * @param x The center of the ellipse. + * @param y The center of the ellipse. + * @param width The width of the ellipse. + * @param height The height of the ellipse. + * @param callback The hit area callback. If undefined it uses Ellipse.Contains. + */ + setHitAreaEllipse(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, width: number, height: number, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using + * the Game Objects texture frame to define the position and size of the hit area. + * @param gameObjects An array of Game Objects to set as having an ellipse hit area. + * @param callback The hit area callback. If undefined it uses Rectangle.Contains. + */ + setHitAreaFromTexture(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using + * the given coordinates and dimensions to control its position and size. + * @param gameObjects An array of Game Objects to set as having a rectangular hit area. + * @param x The top-left of the rectangle. + * @param y The top-left of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param callback The hit area callback. If undefined it uses Rectangle.Contains. + */ + setHitAreaRectangle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x: number, y: number, width: number, height: number, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Triangle` shape, using + * the given coordinates to control the position of its points. + * @param gameObjects An array of Game Objects to set as having a triangular hit area. + * @param x1 The x coordinate of the first point of the triangle. + * @param y1 The y coordinate of the first point of the triangle. + * @param x2 The x coordinate of the second point of the triangle. + * @param y2 The y coordinate of the second point of the triangle. + * @param x3 The x coordinate of the third point of the triangle. + * @param y3 The y coordinate of the third point of the triangle. + * @param callback The hit area callback. If undefined it uses Triangle.Contains. + */ + setHitAreaTriangle(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, callback?: Phaser.Types.Input.HitAreaCallback): Phaser.Input.InputPlugin; + + /** + * Sets the Pointers to always poll. + * + * When a pointer is polled it runs a hit test to see which Game Objects are currently below it, + * or being interacted with it, regardless if the Pointer has actually moved or not. + * + * You should enable this if you want objects in your game to fire over / out events, and the objects + * are constantly moving, but the pointer may not have. Polling every frame has additional computation + * costs, especially if there are a large number of interactive objects in your game. + */ + setPollAlways(): Phaser.Input.InputPlugin; + + /** + * Sets the Pointers to only poll when they are moved or updated. + * + * When a pointer is polled it runs a hit test to see which Game Objects are currently below it, + * or being interacted with it. + */ + setPollOnMove(): Phaser.Input.InputPlugin; + + /** + * Sets the poll rate value. This is the amount of time that should have elapsed before a pointer + * will be polled again. See the `setPollAlways` and `setPollOnMove` methods. + * @param value The amount of time, in ms, that should elapsed before re-polling the pointers. + */ + setPollRate(value: number): Phaser.Input.InputPlugin; + + /** + * When set to `true` the global Input Manager will emulate DOM behavior by only emitting events from + * the top-most Scene in the Scene List. By default, if a Scene receives an input event it will then stop the event + * from flowing down to any Scenes below it in the Scene list. To disable this behavior call this method with `false`. + * @param value Set to `true` to stop processing input events on the Scene that receives it, or `false` to let the event continue down the Scene list. + */ + setGlobalTopOnly(value: boolean): Phaser.Input.InputPlugin; + + /** + * When set to `true` this Input Plugin will emulate DOM behavior by only emitting events from + * the top-most Game Objects in the Display List. + * + * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one. + * @param value `true` to only include the top-most Game Object, or `false` to include all Game Objects in a hit test. + */ + setTopOnly(value: boolean): Phaser.Input.InputPlugin; + + /** + * Given an array of Game Objects, sort the array and return it, so that the objects are in depth index order + * with the lowest at the bottom. + * @param gameObjects An array of Game Objects to be sorted. + */ + sortGameObjects(gameObjects: Phaser.GameObjects.GameObject[]): Phaser.GameObjects.GameObject[]; + + /** + * This method should be called from within an input event handler, such as `pointerdown`. + * + * When called, it stops the Input Manager from allowing _this specific event_ to be processed by any other Scene + * not yet handled in the scene list. + */ + stopPropagation(): Phaser.Input.InputPlugin; + + /** + * Adds new Pointer objects to the Input Manager. + * + * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`. + * + * You can create more either by calling this method, or by setting the `input.activePointers` property + * in the Game Config, up to a maximum of 10 pointers. + * + * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added + * via this method. + * @param quantity The number of new Pointers to create. A maximum of 10 is allowed in total. Default 1. + */ + addPointer(quantity?: integer): Phaser.Input.Pointer[]; + + /** + * Tells the Input system to set a custom cursor. + * + * This cursor will be the default cursor used when interacting with the game canvas. + * + * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. + * + * Any valid CSS cursor value is allowed, including paths to image files, i.e.: + * + * ```javascript + * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); + * ``` + * + * Please read about the differences between browsers when it comes to the file formats and sizes they support: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property + * + * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support. + * @param cursor The CSS to be used when setting the default cursor. + */ + setDefaultCursor(cursor: string): Phaser.Input.InputPlugin; + + /** + * The x coordinates of the ActivePointer based on the first camera in the camera list. + * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch. + */ + readonly x: number; + + /** + * The y coordinates of the ActivePointer based on the first camera in the camera list. + * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch. + */ + readonly y: number; + + /** + * Are any mouse or touch pointers currently over the game canvas? + */ + readonly isOver: boolean; + + /** + * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. + * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer` + * which will always map to the most recently interacted pointer. + */ + readonly mousePointer: Phaser.Input.Pointer; + + /** + * The current active input Pointer. + */ + readonly activePointer: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer1: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer2: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer3: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer4: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer5: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer6: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer7: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer8: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer9: Phaser.Input.Pointer; + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + */ + readonly pointer10: Phaser.Input.Pointer; + + /** + * An instance of the Keyboard Plugin class, if enabled via the `input.keyboard` Scene or Game Config property. + * Use this to create Key objects and listen for keyboard specific events. + */ + keyboard: Phaser.Input.Keyboard.KeyboardPlugin; + + } + + namespace InputPluginCache { + /** + * Static method called directly by the Core internal Plugins. + * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) + * Plugin is the object to instantiate to create the plugin + * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) + */ + var register: Function; + + /** + * Returns the input plugin object from the cache based on the given key. + */ + var getCore: Function; + + /** + * Installs all of the registered Input Plugins into the given target. + */ + var install: Function; + + /** + * Removes an input plugin based on the given key. + */ + var remove: Function; + + } + + namespace Keyboard { + /** + * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them + * it will emit a `keycombomatch` event from the Keyboard Manager. + * + * The keys to be listened for can be defined as: + * + * A string (i.e. 'ATARI') + * An array of either integers (key codes) or strings, or a mixture of both + * An array of objects (such as Key objects) with a public 'keyCode' property + * + * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter) + * you could pass the following array of key codes: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + * + * Or, to listen for the user entering the word PHASER: + * + * ```javascript + * this.input.keyboard.createCombo('PHASER'); + * ``` + */ + class KeyCombo { + /** + * + * @param keyboardPlugin A reference to the Keyboard Plugin. + * @param keys The keys that comprise this combo. + * @param config A Key Combo configuration object. + */ + constructor(keyboardPlugin: Phaser.Input.Keyboard.KeyboardPlugin, keys: string | integer[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig); + + /** + * A reference to the Keyboard Manager + */ + manager: Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * A flag that controls if this Key Combo is actively processing keys or not. + */ + enabled: boolean; + + /** + * An array of the keycodes that comprise this combo. + */ + keyCodes: any[]; + + /** + * The current keyCode the combo is waiting for. + */ + current: integer; + + /** + * The current index of the key being waited for in the 'keys' string. + */ + index: integer; + + /** + * The length of this combo (in keycodes) + */ + size: number; + + /** + * The time the previous key in the combo was matched. + */ + timeLastMatched: number; + + /** + * Has this Key Combo been matched yet? + */ + matched: boolean; + + /** + * The time the entire combo was matched. + */ + timeMatched: number; + + /** + * If they press the wrong key do we reset the combo? + */ + resetOnWrongKey: boolean; + + /** + * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. + */ + maxKeyDelay: integer; + + /** + * If previously matched and they press the first key of the combo again, will it reset? + */ + resetOnMatch: boolean; + + /** + * If the combo matches, will it delete itself? + */ + deleteOnMatch: boolean; + + /** + * How far complete is this combo? A value between 0 and 1. + */ + readonly progress: number; + + /** + * Destroys this Key Combo and all of its references. + */ + destroy(): void; + + } + + namespace Events { + /** + * The Global Key Down Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. + * + * Listen to this event from within a Scene using: `this.input.keyboard.on('keydown', listener)`. + * + * You can also listen for a specific key being pressed. See [Keyboard.Events.KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_DOWN} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. + * + * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. + * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * There are others. So, please check your extensions if you find you have specific keys that don't work. + */ + const ANY_KEY_DOWN: any; + + /** + * The Global Key Up Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. + * + * Listen to this event from within a Scene using: `this.input.keyboard.on('keyup', listener)`. + * + * You can also listen for a specific key being released. See [Keyboard.Events.KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_UP} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. + */ + const ANY_KEY_UP: any; + + /** + * The Key Combo Match Event. + * + * This event is dispatched by the Keyboard Plugin when a [Key Combo]{@link Phaser.Input.Keyboard.KeyCombo} is matched. + * + * Listen for this event from the Key Plugin after a combo has been created: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + */ + const COMBO_MATCH: any; + + /** + * The Key Down Event. + * + * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is pressed. + * + * Listen for this event from the Key object instance directly: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * + * spaceBar.on('down', listener) + * ``` + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. + */ + const DOWN: any; + + /** + * The Key Down Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. + * + * Unlike the `ANY_KEY_DOWN` event, this one has a special dynamic event name. For example, to listen for the `A` key being pressed + * use the following from within a Scene: `this.input.keyboard.on('keydown-A', listener)`. You can replace the `-A` part of the event + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * `this.input.keyboard.on('keydown-SPACE', listener)`. + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. + * + * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. + * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * There are others. So, please check your extensions if you find you have specific keys that don't work. + */ + const KEY_DOWN: any; + + /** + * The Key Up Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. + * + * Unlike the `ANY_KEY_UP` event, this one has a special dynamic event name. For example, to listen for the `A` key being released + * use the following from within a Scene: `this.input.keyboard.on('keyup-A', listener)`. You can replace the `-A` part of the event + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * `this.input.keyboard.on('keyup-SPACE', listener)`. + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. + */ + const KEY_UP: any; + + /** + * The Key Up Event. + * + * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is released. + * + * Listen for this event from the Key object instance directly: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * + * spaceBar.on('up', listener) + * ``` + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. + */ + const UP: any; + + } + + /** + * The Keyboard Manager is a helper class that belongs to the global Input Manager. + * + * Its role is to listen for native DOM Keyboard Events and then store them for further processing by the Keyboard Plugin. + * + * You do not need to create this class directly, the Input Manager will create an instance of it automatically if keyboard + * input has been enabled in the Game Config. + */ + class KeyboardManager { + /** + * + * @param inputManager A reference to the Input Manager. + */ + constructor(inputManager: Phaser.Input.InputManager); + + /** + * A reference to the Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * A flag that controls if the non-modified keys, matching those stored in the `captures` array, + * have `preventDefault` called on them or not. + * + * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are + * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows). + * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier. + * However, if the user presses just the r key on its own, it will have its event prevented. + * + * If you wish to stop capturing the keys, for example switching out to a DOM based element, then + * you can toggle this property at run-time. + */ + preventDefault: boolean; + + /** + * An array of Key Code values that will automatically have `preventDefault` called on them, + * as long as the `KeyboardManager.preventDefault` boolean is set to `true`. + * + * By default the array is empty. + * + * The key must be non-modified when pressed in order to be captured. + * + * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are + * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows). + * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier. + * However, if the user presses just the r key on its own, it will have its event prevented. + * + * If you wish to stop capturing the keys, for example switching out to a DOM based element, then + * you can toggle the `KeyboardManager.preventDefault` boolean at run-time. + * + * If you need more specific control, you can create Key objects and set the flag on each of those instead. + * + * This array can be populated via the Game Config by setting the `input.keyboard.capture` array, or you + * can call the `addCapture` method. See also `removeCapture` and `clearCaptures`. + */ + captures: integer[]; + + /** + * A boolean that controls if the Keyboard Manager is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * The Keyboard Event target, as defined in the Game Config. + * Typically the window in which the game is rendering, but can be any interactive DOM element. + */ + target: any; + + /** + * The Key Down Event handler. + * This function is sent the native DOM KeyEvent. + * Initially empty and bound in the `startListeners` method. + */ + onKeyDown: Function; + + /** + * The Key Up Event handler. + * This function is sent the native DOM KeyEvent. + * Initially empty and bound in the `startListeners` method. + */ + onKeyUp: Function; + + /** + * Starts the Keyboard Event listeners running. + * This is called automatically and does not need to be manually invoked. + */ + startListeners(): void; + + /** + * Stops the Key Event listeners. + * This is called automatically and does not need to be manually invoked. + */ + stopListeners(): void; + + /** + * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. + * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. + * + * This `addCapture` method enables consuming keyboard event for specific keys so it doesn't bubble up to the the browser + * and cause the default browser behavior. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent + * the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one. + * + * You can pass in a single key code value, or an array of key codes, or a string: + * + * ```javascript + * this.input.keyboard.addCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.addCapture([ 62, 63, 64 ]); + * ``` + * + * Or a string: + * + * ```javascript + * this.input.keyboard.addCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * + * If there are active captures after calling this method, the `preventDefault` property is set to `true`. + * @param keycode The Key Codes to enable capture for, preventing them reaching the browser. + */ + addCapture(keycode: string | integer | integer[] | any[]): void; + + /** + * Removes an existing key capture. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to remove + * the capture of a key, then it will remove it for any Scene in your game, not just the calling one. + * + * You can pass in a single key code value, or an array of key codes, or a string: + * + * ```javascript + * this.input.keyboard.removeCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.removeCapture([ 62, 63, 64 ]); + * ``` + * + * Or a string: + * + * ```javascript + * this.input.keyboard.removeCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * + * If there are no captures left after calling this method, the `preventDefault` property is set to `false`. + * @param keycode The Key Codes to disable capture for, allowing them reaching the browser again. + */ + removeCapture(keycode: string | integer | integer[] | any[]): void; + + /** + * Removes all keyboard captures and sets the `preventDefault` property to `false`. + */ + clearCaptures(): void; + + /** + * Destroys this Keyboard Manager instance. + */ + destroy(): void; + + } + + /** + * The Keyboard Plugin is an input plugin that belongs to the Scene-owned Input system. + * + * Its role is to listen for native DOM Keyboard Events and then process them. + * + * You do not need to create this class directly, the Input system will create an instance of it automatically. + * + * You can access it from within a Scene using `this.input.keyboard`. For example, you can do: + * + * ```javascript + * this.input.keyboard.on('keydown', callback, context); + * ``` + * + * Or, to listen for a specific key: + * + * ```javascript + * this.input.keyboard.on('keydown-A', callback, context); + * ``` + * + * You can also create Key objects, which you can then poll in your game loop: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * ``` + * + * If you have multiple parallel Scenes, each trying to get keyboard input, be sure to disable capture on them to stop them from + * stealing input from another Scene in the list. You can do this with `this.input.keyboard.enabled = false` within the + * Scene to stop all input, or `this.input.keyboard.preventDefault = false` to stop a Scene halting input on another Scene. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details. + * + * Also please be aware that certain browser extensions can disable or override Phaser keyboard handling. + * For example the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * And there are others. So, please check your extensions before opening Phaser issues about keys that don't work. + */ + class KeyboardPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param sceneInputPlugin A reference to the Scene Input Plugin that the KeyboardPlugin belongs to. + */ + constructor(sceneInputPlugin: Phaser.Input.InputPlugin); + + /** + * A reference to the core game, so we can listen for visibility events. + */ + game: Phaser.Game; + + /** + * A reference to the Scene that this Input Plugin is responsible for. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems Settings. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * A reference to the Scene Input Plugin that created this Keyboard Plugin. + */ + sceneInputPlugin: Phaser.Input.InputPlugin; + + /** + * A reference to the global Keyboard Manager. + */ + manager: Phaser.Input.InputPlugin; + + /** + * A boolean that controls if this Keyboard Plugin is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * An array of Key objects to process. + */ + keys: Phaser.Input.Keyboard.Key[]; + + /** + * An array of KeyCombo objects to process. + */ + combos: Phaser.Input.Keyboard.KeyCombo[]; + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + */ + isActive(): boolean; + + /** + * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. + * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. + * + * This `addCapture` method enables consuming keyboard events for specific keys, so they don't bubble up the browser + * and cause the default behaviors. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent + * the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one. + * + * You can pass a single key code value: + * + * ```javascript + * this.input.keyboard.addCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.addCapture([ 62, 63, 64 ]); + * ``` + * + * Or, a comma-delimited string: + * + * ```javascript + * this.input.keyboard.addCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * @param keycode The Key Codes to enable event capture for. + */ + addCapture(keycode: string | integer | integer[] | any[]): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Removes an existing key capture. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to remove + * the capture of a key, then it will remove it for any Scene in your game, not just the calling one. + * + * You can pass a single key code value: + * + * ```javascript + * this.input.keyboard.removeCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.removeCapture([ 62, 63, 64 ]); + * ``` + * + * Or, a comma-delimited string: + * + * ```javascript + * this.input.keyboard.removeCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * @param keycode The Key Codes to disable event capture for. + */ + removeCapture(keycode: string | integer | integer[] | any[]): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Returns an array that contains all of the keyboard captures currently enabled. + */ + getCaptures(): integer[]; + + /** + * Allows Phaser to prevent any key captures you may have defined from bubbling up the browser. + * You can use this to re-enable event capturing if you had paused it via `disableGlobalCapture`. + */ + enableGlobalCapture(): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Disables Phaser from preventing any key captures you may have defined, without actually removing them. + * You can use this to temporarily disable event capturing if, for example, you swap to a DOM element. + */ + disableGlobalCapture(): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Removes all keyboard captures. + * + * Note that this is a global change. It will clear all event captures across your game, not just for this specific Scene. + */ + clearCaptures(): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Creates and returns an object containing 4 hotkeys for Up, Down, Left and Right, and also Space Bar and shift. + */ + createCursorKeys(): Phaser.Types.Input.Keyboard.CursorKeys; + + /** + * A practical way to create an object containing user selected hotkeys. + * + * For example: + * + * ```javascript + * this.input.keyboard.addKeys({ 'up': Phaser.Input.Keyboard.KeyCodes.W, 'down': Phaser.Input.Keyboard.KeyCodes.S }); + * ``` + * + * would return an object containing the properties (`up` and `down`) mapped to W and S {@link Phaser.Input.Keyboard.Key} objects. + * + * You can also pass in a comma-separated string: + * + * ```javascript + * this.input.keyboard.addKeys('W,S,A,D'); + * ``` + * + * Which will return an object with the properties W, S, A and D mapped to the relevant Key objects. + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * @param keys An object containing Key Codes, or a comma-separated string. + * @param enableCapture Automatically call `preventDefault` on the native DOM browser event for the key codes being added. Default true. + * @param emitOnRepeat Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). Default false. + */ + addKeys(keys: object | string, enableCapture?: boolean, emitOnRepeat?: boolean): object; + + /** + * Adds a Key object to this Keyboard Plugin. + * + * The given argument can be either an existing Key object, a string, such as `A` or `SPACE`, or a key code value. + * + * If a Key object is given, and one already exists matching the same key code, the existing one is replaced with the new one. + * @param key Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param enableCapture Automatically call `preventDefault` on the native DOM browser event for the key codes being added. Default true. + * @param emitOnRepeat Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). Default false. + */ + addKey(key: Phaser.Input.Keyboard.Key | string | integer, enableCapture?: boolean, emitOnRepeat?: boolean): Phaser.Input.Keyboard.Key; + + /** + * Removes a Key object from this Keyboard Plugin. + * + * The given argument can be either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param key Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param destroy Call `Key.destroy` on the removed Key object? Default false. + */ + removeKey(key: Phaser.Input.Keyboard.Key | string | integer, destroy?: boolean): Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * Creates a new KeyCombo. + * + * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them + * it will emit a `keycombomatch` event from this Keyboard Plugin. + * + * The keys to be listened for can be defined as: + * + * A string (i.e. 'ATARI') + * An array of either integers (key codes) or strings, or a mixture of both + * An array of objects (such as Key objects) with a public 'keyCode' property + * + * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter) + * you could pass the following array of key codes: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + * + * Or, to listen for the user entering the word PHASER: + * + * ```javascript + * this.input.keyboard.createCombo('PHASER'); + * ``` + * @param keys The keys that comprise this combo. + * @param config A Key Combo configuration object. + */ + createCombo(keys: string | integer[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig): Phaser.Input.Keyboard.KeyCombo; + + /** + * Checks if the given Key object is currently being held down. + * + * The difference between this method and checking the `Key.isDown` property directly is that you can provide + * a duration to this method. For example, if you wanted a key press to fire a bullet, but you only wanted + * it to be able to fire every 100ms, then you can call this method with a `duration` of 100 and it + * will only return `true` every 100ms. + * + * If the Keyboard Plugin has been disabled, this method will always return `false`. + * @param key A Key object. + * @param duration The duration which must have elapsed before this Key is considered as being down. Default 0. + */ + checkDown(key: Phaser.Input.Keyboard.Key, duration?: number): boolean; + + /** + * Resets all Key objects created by _this_ Keyboard Plugin back to their default un-pressed states. + * This can only reset keys created via the `addKey`, `addKeys` or `createCursorKeys` methods. + * If you have created a Key object directly you'll need to reset it yourself. + * + * This method is called automatically when the Keyboard Plugin shuts down, but can be + * invoked directly at any time you require. + */ + resetKeys(): Phaser.Input.Keyboard.KeyboardPlugin; + + } + + /** + * Returns `true` if the Key was pressed down within the `duration` value given, based on the current + * game clock time. Or `false` if it either isn't down, or was pressed down longer ago than the given duration. + * @param key The Key object to test. + * @param duration The duration, in ms, within which the key must have been pressed down. Default 50. + */ + function DownDuration(key: Phaser.Input.Keyboard.Key, duration?: integer): boolean; + + /** + * The justDown value allows you to test if this Key has just been pressed down or not. + * + * When you check this value it will return `true` if the Key is down, otherwise `false`. + * + * You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. + * This allows you to use it in situations where you want to check if this key is down without using an event, such as in a core game loop. + * @param key The Key to check to see if it's just down or not. + */ + function JustDown(key: Phaser.Input.Keyboard.Key): boolean; + + /** + * The justUp value allows you to test if this Key has just been released or not. + * + * When you check this value it will return `true` if the Key is up, otherwise `false`. + * + * You can only call JustUp once per key release. It will only return `true` once, until the Key is pressed down and released again. + * This allows you to use it in situations where you want to check if this key is up without using an event, such as in a core game loop. + * @param key The Key to check to see if it's just up or not. + */ + function JustUp(key: Phaser.Input.Keyboard.Key): boolean; + + /** + * A generic Key object which can be passed to the Process functions (and so on) + * keycode must be an integer + */ + class Key extends Phaser.Events.EventEmitter { + /** + * + * @param plugin The Keyboard Plugin instance that owns this Key object. + * @param keyCode The keycode of this key. + */ + constructor(plugin: Phaser.Input.Keyboard.KeyboardPlugin, keyCode: integer); + + /** + * The Keyboard Plugin instance that owns this Key object. + */ + plugin: Phaser.Input.Keyboard.KeyboardPlugin; + + /** + * The keycode of this key. + */ + keyCode: integer; + + /** + * The original DOM event. + */ + originalEvent: KeyboardEvent; + + /** + * Can this Key be processed? + */ + enabled: boolean; + + /** + * The "down" state of the key. This will remain `true` for as long as the keyboard thinks this key is held down. + */ + isDown: boolean; + + /** + * The "up" state of the key. This will remain `true` for as long as the keyboard thinks this key is up. + */ + isUp: boolean; + + /** + * The down state of the ALT key, if pressed at the same time as this key. + */ + altKey: boolean; + + /** + * The down state of the CTRL key, if pressed at the same time as this key. + */ + ctrlKey: boolean; + + /** + * The down state of the SHIFT key, if pressed at the same time as this key. + */ + shiftKey: boolean; + + /** + * The down state of the Meta key, if pressed at the same time as this key. + * On a Mac the Meta Key is the Command key. On Windows keyboards, it's the Windows key. + */ + metaKey: boolean; + + /** + * The location of the modifier key. 0 for standard (or unknown), 1 for left, 2 for right, 3 for numpad. + */ + location: number; + + /** + * The timestamp when the key was last pressed down. + */ + timeDown: number; + + /** + * The number of milliseconds this key was held down for in the previous down - up sequence. + * This value isn't updated every game step, only when the Key changes state. + * To get the current duration use the `getDuration` method. + */ + duration: number; + + /** + * The timestamp when the key was last released. + */ + timeUp: number; + + /** + * When a key is held down should it continuously fire the `down` event each time it repeats? + * + * By default it will emit the `down` event just once, but if you wish to receive the event + * for each repeat as well, enable this property. + */ + emitOnRepeat: boolean; + + /** + * If a key is held down this holds down the number of times the key has 'repeated'. + */ + repeats: number; + + /** + * Controls if this Key will continuously emit a `down` event while being held down (true), + * or emit the event just once, on first press, and then skip future events (false). + * @param value Emit `down` events on repeated key down actions, or just once? + */ + setEmitOnRepeat(value: boolean): Phaser.Input.Keyboard.Key; + + /** + * Processes the Key Down action for this Key. + * Called automatically by the Keyboard Plugin. + * @param event The native DOM Keyboard event. + */ + onDown(event: KeyboardEvent): void; + + /** + * Processes the Key Up action for this Key. + * Called automatically by the Keyboard Plugin. + * @param event The native DOM Keyboard event. + */ + onUp(event: KeyboardEvent): void; + + /** + * Resets this Key object back to its default un-pressed state. + */ + reset(): Phaser.Input.Keyboard.Key; + + /** + * Returns the duration, in ms, that the Key has been held down for. + * + * If the key is not currently down it will return zero. + * + * The get the duration the Key was held down for in the previous up-down cycle, + * use the `Key.duration` property value instead. + */ + getDuration(): number; + + /** + * Removes any bound event handlers and removes local references. + */ + destroy(): void; + + } + + /** + * Keyboard Codes. + */ + namespace KeyCodes { + /** + * The BACKSPACE key. + */ + var BACKSPACE: integer; + + /** + * The TAB key. + */ + var TAB: integer; + + /** + * The ENTER key. + */ + var ENTER: integer; + + /** + * The SHIFT key. + */ + var SHIFT: integer; + + /** + * The CTRL key. + */ + var CTRL: integer; + + /** + * The ALT key. + */ + var ALT: integer; + + /** + * The PAUSE key. + */ + var PAUSE: integer; + + /** + * The CAPS_LOCK key. + */ + var CAPS_LOCK: integer; + + /** + * The ESC key. + */ + var ESC: integer; + + /** + * The SPACE key. + */ + var SPACE: integer; + + /** + * The PAGE_UP key. + */ + var PAGE_UP: integer; + + /** + * The PAGE_DOWN key. + */ + var PAGE_DOWN: integer; + + /** + * The END key. + */ + var END: integer; + + /** + * The HOME key. + */ + var HOME: integer; + + /** + * The LEFT key. + */ + var LEFT: integer; + + /** + * The UP key. + */ + var UP: integer; + + /** + * The RIGHT key. + */ + var RIGHT: integer; + + /** + * The DOWN key. + */ + var DOWN: integer; + + /** + * The PRINT_SCREEN key. + */ + var PRINT_SCREEN: integer; + + /** + * The INSERT key. + */ + var INSERT: integer; + + /** + * The DELETE key. + */ + var DELETE: integer; + + /** + * The ZERO key. + */ + var ZERO: integer; + + /** + * The ONE key. + */ + var ONE: integer; + + /** + * The TWO key. + */ + var TWO: integer; + + /** + * The THREE key. + */ + var THREE: integer; + + /** + * The FOUR key. + */ + var FOUR: integer; + + /** + * The FIVE key. + */ + var FIVE: integer; + + /** + * The SIX key. + */ + var SIX: integer; + + /** + * The SEVEN key. + */ + var SEVEN: integer; + + /** + * The EIGHT key. + */ + var EIGHT: integer; + + /** + * The NINE key. + */ + var NINE: integer; + + /** + * The NUMPAD_ZERO key. + */ + var NUMPAD_ZERO: integer; + + /** + * The NUMPAD_ONE key. + */ + var NUMPAD_ONE: integer; + + /** + * The NUMPAD_TWO key. + */ + var NUMPAD_TWO: integer; + + /** + * The NUMPAD_THREE key. + */ + var NUMPAD_THREE: integer; + + /** + * The NUMPAD_FOUR key. + */ + var NUMPAD_FOUR: integer; + + /** + * The NUMPAD_FIVE key. + */ + var NUMPAD_FIVE: integer; + + /** + * The NUMPAD_SIX key. + */ + var NUMPAD_SIX: integer; + + /** + * The NUMPAD_SEVEN key. + */ + var NUMPAD_SEVEN: integer; + + /** + * The NUMPAD_EIGHT key. + */ + var NUMPAD_EIGHT: integer; + + /** + * The NUMPAD_NINE key. + */ + var NUMPAD_NINE: integer; + + /** + * The A key. + */ + var A: integer; + + /** + * The B key. + */ + var B: integer; + + /** + * The C key. + */ + var C: integer; + + /** + * The D key. + */ + var D: integer; + + /** + * The E key. + */ + var E: integer; + + /** + * The F key. + */ + var F: integer; + + /** + * The G key. + */ + var G: integer; + + /** + * The H key. + */ + var H: integer; + + /** + * The I key. + */ + var I: integer; + + /** + * The J key. + */ + var J: integer; + + /** + * The K key. + */ + var K: integer; + + /** + * The L key. + */ + var L: integer; + + /** + * The M key. + */ + var M: integer; + + /** + * The N key. + */ + var N: integer; + + /** + * The O key. + */ + var O: integer; + + /** + * The P key. + */ + var P: integer; + + /** + * The Q key. + */ + var Q: integer; + + /** + * The R key. + */ + var R: integer; + + /** + * The S key. + */ + var S: integer; + + /** + * The T key. + */ + var T: integer; + + /** + * The U key. + */ + var U: integer; + + /** + * The V key. + */ + var V: integer; + + /** + * The W key. + */ + var W: integer; + + /** + * The X key. + */ + var X: integer; + + /** + * The Y key. + */ + var Y: integer; + + /** + * The Z key. + */ + var Z: integer; + + /** + * The F1 key. + */ + var F1: integer; + + /** + * The F2 key. + */ + var F2: integer; + + /** + * The F3 key. + */ + var F3: integer; + + /** + * The F4 key. + */ + var F4: integer; + + /** + * The F5 key. + */ + var F5: integer; + + /** + * The F6 key. + */ + var F6: integer; + + /** + * The F7 key. + */ + var F7: integer; + + /** + * The F8 key. + */ + var F8: integer; + + /** + * The F9 key. + */ + var F9: integer; + + /** + * The F10 key. + */ + var F10: integer; + + /** + * The F11 key. + */ + var F11: integer; + + /** + * The F12 key. + */ + var F12: integer; + + /** + * The SEMICOLON key. + */ + var SEMICOLON: integer; + + /** + * The PLUS key. + */ + var PLUS: integer; + + /** + * The COMMA key. + */ + var COMMA: integer; + + /** + * The MINUS key. + */ + var MINUS: integer; + + /** + * The PERIOD key. + */ + var PERIOD: integer; + + /** + * The FORWARD_SLASH key. + */ + var FORWARD_SLASH: integer; + + /** + * The BACK_SLASH key. + */ + var BACK_SLASH: integer; + + /** + * The QUOTES key. + */ + var QUOTES: integer; + + /** + * The BACKTICK key. + */ + var BACKTICK: integer; + + /** + * The OPEN_BRACKET key. + */ + var OPEN_BRACKET: integer; + + /** + * The CLOSED_BRACKET key. + */ + var CLOSED_BRACKET: integer; + + /** + * The SEMICOLON_FIREFOX key. + */ + var SEMICOLON_FIREFOX: integer; + + /** + * The COLON key. + */ + var COLON: integer; + + /** + * The COMMA_FIREFOX_WINDOWS key. + */ + var COMMA_FIREFOX_WINDOWS: integer; + + /** + * The COMMA_FIREFOX key. + */ + var COMMA_FIREFOX: integer; + + /** + * The BRACKET_RIGHT_FIREFOX key. + */ + var BRACKET_RIGHT_FIREFOX: integer; + + /** + * The BRACKET_LEFT_FIREFOX key. + */ + var BRACKET_LEFT_FIREFOX: integer; + + } + + /** + * Returns `true` if the Key was released within the `duration` value given, based on the current + * game clock time. Or returns `false` if it either isn't up, or was released longer ago than the given duration. + * @param key The Key object to test. + * @param duration The duration, in ms, within which the key must have been released. Default 50. + */ + function UpDuration(key: Phaser.Input.Keyboard.Key, duration?: integer): boolean; + + } + + namespace Mouse { + /** + * The Mouse Manager is a helper class that belongs to the Input Manager. + * + * Its role is to listen for native DOM Mouse Events and then pass them onto the Input Manager for further processing. + * + * You do not need to create this class directly, the Input Manager will create an instance of it automatically. + */ + class MouseManager { + /** + * + * @param inputManager A reference to the Input Manager. + */ + constructor(inputManager: Phaser.Input.InputManager); + + /** + * A reference to the Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * If true the DOM mouse events will have event.preventDefault applied to them, if false they will propagate fully. + */ + capture: boolean; + + /** + * A boolean that controls if the Mouse Manager is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * The Touch Event target, as defined in the Game Config. + * Typically the canvas to which the game is rendering, but can be any interactive DOM element. + */ + target: any; + + /** + * If the mouse has been pointer locked successfully this will be set to true. + */ + locked: boolean; + + /** + * The Mouse Move Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseMove: Function; + + /** + * The Mouse Down Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseDown: Function; + + /** + * The Mouse Up Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseUp: Function; + + /** + * The Mouse Down Event handler specifically for events on the Window. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseDownWindow: Function; + + /** + * The Mouse Up Event handler specifically for events on the Window. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseUpWindow: Function; + + /** + * The Mouse Over Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseOver: Function; + + /** + * The Mouse Out Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseOut: Function; + + /** + * The Mouse Wheel Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + onMouseWheel: Function; + + /** + * Internal pointerLockChange handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + */ + pointerLockChange: Function; + + /** + * Attempts to disable the context menu from appearing if you right-click on the browser. + * + * Works by listening for the `contextmenu` event and prevent defaulting it. + * + * Use this if you need to enable right-button mouse support in your game, and the browser + * menu keeps getting in the way. + */ + disableContextMenu(): Phaser.Input.Mouse.MouseManager; + + /** + * If the browser supports it, you can request that the pointer be locked to the browser window. + * + * This is classically known as 'FPS controls', where the pointer can't leave the browser until + * the user presses an exit key. + * + * If the browser successfully enters a locked state, a `POINTER_LOCK_CHANGE_EVENT` will be dispatched, + * from the games Input Manager, with an `isPointerLocked` property. + * + * It is important to note that pointer lock can only be enabled after an 'engagement gesture', + * see: https://w3c.github.io/pointerlock/#dfn-engagement-gesture. + */ + requestPointerLock(): void; + + /** + * If the browser supports pointer lock, this will request that the pointer lock is released. If + * the browser successfully enters a locked state, a 'POINTER_LOCK_CHANGE_EVENT' will be + * dispatched - from the game's input manager - with an `isPointerLocked` property. + */ + releasePointerLock(): void; + + /** + * Starts the Mouse Event listeners running. + * This is called automatically and does not need to be manually invoked. + */ + startListeners(): void; + + /** + * Stops the Mouse Event listeners. + * This is called automatically and does not need to be manually invoked. + */ + stopListeners(): void; + + /** + * Destroys this Mouse Manager instance. + */ + destroy(): void; + + } + + } + + /** + * A Pointer object encapsulates both mouse and touch input within Phaser. + * + * By default, Phaser will create 2 pointers for your game to use. If you require more, i.e. for a multi-touch + * game, then use the `InputPlugin.addPointer` method to do so, rather than instantiating this class directly, + * otherwise it won't be managed by the input system. + * + * You can reference the current active pointer via `InputPlugin.activePointer`. You can also use the properties + * `InputPlugin.pointer1` through to `pointer10`, for each pointer you have enabled in your game. + * + * The properties of this object are set by the Input Plugin during processing. This object is then sent in all + * input related events that the Input Plugin emits, so you can reference properties from it directly in your + * callbacks. + */ + class Pointer { + /** + * + * @param manager A reference to the Input Manager. + * @param id The internal ID of this Pointer. + */ + constructor(manager: Phaser.Input.InputManager, id: integer); + + /** + * A reference to the Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * The internal ID of this Pointer. + */ + readonly id: integer; + + /** + * The most recent native DOM Event this Pointer has processed. + */ + event: TouchEvent | MouseEvent; + + /** + * The DOM element the Pointer was pressed down on, taken from the DOM event. + * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element. + */ + readonly downElement: any; + + /** + * The DOM element the Pointer was released on, taken from the DOM event. + * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element. + */ + readonly upElement: any; + + /** + * The camera the Pointer interacted with during its last update. + * + * A Pointer can only ever interact with one camera at once, which will be the top-most camera + * in the list should multiple cameras be positioned on-top of each other. + */ + camera: Phaser.Cameras.Scene2D.Camera; + + /** + * A read-only property that indicates which button was pressed, or released, on the pointer + * during the most recent event. It is only set during `up` and `down` events. + * + * On Touch devices the value is always 0. + * + * Users may change the configuration of buttons on their pointing device so that if an event's button property + * is zero, it may not have been caused by the button that is physically left–most on the pointing device; + * however, it should behave as if the left button was clicked in the standard button layout. + */ + readonly button: integer; + + /** + * 0: No button or un-initialized + * 1: Left button + * 2: Right button + * 4: Wheel button or middle button + * 8: 4th button (typically the "Browser Back" button) + * 16: 5th button (typically the "Browser Forward" button) + * + * For a mouse configured for left-handed use, the button actions are reversed. + * In this case, the values are read from right to left. + */ + buttons: integer; + + /** + * The position of the Pointer in screen space. + */ + readonly position: Phaser.Math.Vector2; + + /** + * The previous position of the Pointer in screen space. + * + * The old x and y values are stored in here during the InputManager.transformPointer call. + * + * Use the properties `velocity`, `angle` and `distance` to create your own gesture recognition. + */ + readonly prevPosition: Phaser.Math.Vector2; + + /** + * The current velocity of the Pointer, based on its current and previous positions. + * + * This value is smoothed out each frame, according to the `motionFactor` property. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + */ + readonly velocity: Phaser.Math.Vector2; + + /** + * The current angle the Pointer is moving, in radians, based on its previous and current position. + * + * The angle is based on the old position facing to the current position. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + */ + readonly angle: number; + + /** + * The distance the Pointer has moved, based on its previous and current position. + * + * This value is smoothed out each frame, according to the `motionFactor` property. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + * + * If you need the total distance travelled since the primary buttons was pressed down, + * then use the `Pointer.getDistance` method. + */ + readonly distance: number; + + /** + * The smoothing factor to apply to the Pointer position. + * + * Due to their nature, pointer positions are inherently noisy. While this is fine for lots of games, if you need cleaner positions + * then you can set this value to apply an automatic smoothing to the positions as they are recorded. + * + * The default value of zero means 'no smoothing'. + * Set to a small value, such as 0.2, to apply an average level of smoothing between positions. You can do this by changing this + * value directly, or by setting the `input.smoothFactor` property in the Game Config. + * + * Positions are only smoothed when the pointer moves. If the primary button on this Pointer enters an Up or Down state, then the position + * is always precise, and not smoothed. + */ + smoothFactor: number; + + /** + * The factor applied to the motion smoothing each frame. + * + * This value is passed to the Smooth Step Interpolation that is used to calculate the velocity, + * angle and distance of the Pointer. It's applied every frame, until the midPoint reaches the current + * position of the Pointer. 0.2 provides a good average but can be increased if you need a + * quicker update and are working in a high performance environment. Never set this value to + * zero. + */ + motionFactor: number; + + /** + * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + */ + worldX: number; + + /** + * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + */ + worldY: number; + + /** + * Time when this Pointer was most recently moved (regardless of the state of its buttons, if any) + */ + moveTime: number; + + /** + * X coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects. + */ + downX: number; + + /** + * Y coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects. + */ + downY: number; + + /** + * Time when Button 1 (left button), or Touch, was pressed, used for dragging objects. + */ + downTime: number; + + /** + * X coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects. + */ + upX: number; + + /** + * Y coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects. + */ + upY: number; + + /** + * Time when Button 1 (left button), or Touch, was released, used for dragging objects. + */ + upTime: number; + + /** + * Is the primary button down? (usually button 0, the left mouse button) + */ + primaryDown: boolean; + + /** + * Is _any_ button on this pointer considered as being down? + */ + isDown: boolean; + + /** + * Did the previous input event come from a Touch input (true) or Mouse? (false) + */ + wasTouch: boolean; + + /** + * Did this Pointer get canceled by a touchcancel event? + * + * Note: "canceled" is the American-English spelling of "cancelled". Please don't submit PRs correcting it! + */ + wasCanceled: boolean; + + /** + * If the mouse is locked, the horizontal relative movement of the Pointer in pixels since last frame. + */ + movementX: number; + + /** + * If the mouse is locked, the vertical relative movement of the Pointer in pixels since last frame. + */ + movementY: number; + + /** + * The identifier property of the Pointer as set by the DOM event when this Pointer is started. + */ + identifier: number; + + /** + * The pointerId property of the Pointer as set by the DOM event when this Pointer is started. + * The browser can and will recycle this value. + */ + pointerId: number; + + /** + * An active Pointer is one that is currently pressed down on the display. + * A Mouse is always considered as active. + */ + active: boolean; + + /** + * Time when this Pointer was most recently updated by a DOM Event. + */ + time: number; + + /** + * The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. + */ + deltaX: number; + + /** + * The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. + */ + deltaY: number; + + /** + * The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device. + */ + deltaZ: number; + + /** + * Takes a Camera and returns a Vector2 containing the translated position of this Pointer + * within that Camera. This can be used to convert this Pointers position into camera space. + * @param camera The Camera to use for the translation. + * @param output A Vector2-like object in which to store the translated position. + */ + positionToCamera(camera: Phaser.Cameras.Scene2D.Camera, output?: Phaser.Math.Vector2 | object): Phaser.Math.Vector2 | object; + + /** + * Checks to see if any buttons are being held down on this Pointer. + */ + noButtonDown(): boolean; + + /** + * Checks to see if the left button is being held down on this Pointer. + */ + leftButtonDown(): boolean; + + /** + * Checks to see if the right button is being held down on this Pointer. + */ + rightButtonDown(): boolean; + + /** + * Checks to see if the middle button is being held down on this Pointer. + */ + middleButtonDown(): boolean; + + /** + * Checks to see if the back button is being held down on this Pointer. + */ + backButtonDown(): boolean; + + /** + * Checks to see if the forward button is being held down on this Pointer. + */ + forwardButtonDown(): boolean; + + /** + * Checks to see if the left button was just released on this Pointer. + */ + leftButtonReleased(): boolean; + + /** + * Checks to see if the right button was just released on this Pointer. + */ + rightButtonReleased(): boolean; + + /** + * Checks to see if the middle button was just released on this Pointer. + */ + middleButtonReleased(): boolean; + + /** + * Checks to see if the back button was just released on this Pointer. + */ + backButtonReleased(): boolean; + + /** + * Checks to see if the forward button was just released on this Pointer. + */ + forwardButtonReleased(): boolean; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded distance, based on where + * the Pointer was when the button was released. + * + * If you wish to get the distance being travelled currently, based on the velocity of the Pointer, + * then see the `Pointer.distance` property. + */ + getDistance(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * horizontal distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded horizontal distance, based on where + * the Pointer was when the button was released. + */ + getDistanceX(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * vertical distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded vertical distance, based on where + * the Pointer was when the button was released. + */ + getDistanceY(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * duration since the button was pressed down. + * + * If no button is held down, it will return the last recorded duration, based on the time + * the Pointer button was released. + */ + getDuration(): number; + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * angle between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded angle, based on where + * the Pointer was when the button was released. + * + * The angle is based on the old position facing to the current position. + * + * If you wish to get the current angle, based on the velocity of the Pointer, then + * see the `Pointer.angle` property. + */ + getAngle(): number; + + /** + * Takes the previous and current Pointer positions and then generates an array of interpolated values between + * the two. The array will be populated up to the size of the `steps` argument. + * + * ```javaScript + * var points = pointer.getInterpolatedPosition(4); + * + * // points[0] = { x: 0, y: 0 } + * // points[1] = { x: 2, y: 1 } + * // points[2] = { x: 3, y: 2 } + * // points[3] = { x: 6, y: 3 } + * ``` + * + * Use this if you need to get smoothed values between the previous and current pointer positions. DOM pointer + * events can often fire faster than the main browser loop, and this will help you avoid janky movement + * especially if you have an object following a Pointer. + * + * Note that if you provide an output array it will only be populated up to the number of steps provided. + * It will not clear any previous data that may have existed beyond the range of the steps count. + * + * Internally it uses the Smooth Step interpolation calculation. + * @param steps The number of interpolation steps to use. Default 10. + * @param out An array to store the results in. If not provided a new one will be created. + */ + getInterpolatedPosition(steps?: integer, out?: any[]): any[]; + + /** + * Destroys this Pointer instance and resets its external references. + */ + destroy(): void; + + /** + * The x position of this Pointer. + * The value is in screen space. + * See `worldX` to get a camera converted position. + */ + x: number; + + /** + * The y position of this Pointer. + * The value is in screen space. + * See `worldY` to get a camera converted position. + */ + y: number; + + } + + namespace Touch { + /** + * The Touch Manager is a helper class that belongs to the Input Manager. + * + * Its role is to listen for native DOM Touch Events and then pass them onto the Input Manager for further processing. + * + * You do not need to create this class directly, the Input Manager will create an instance of it automatically. + */ + class TouchManager { + /** + * + * @param inputManager A reference to the Input Manager. + */ + constructor(inputManager: Phaser.Input.InputManager); + + /** + * A reference to the Input Manager. + */ + manager: Phaser.Input.InputManager; + + /** + * If true the DOM events will have event.preventDefault applied to them, if false they will propagate fully. + */ + capture: boolean; + + /** + * A boolean that controls if the Touch Manager is enabled or not. + * Can be toggled on the fly. + */ + enabled: boolean; + + /** + * The Touch Event target, as defined in the Game Config. + * Typically the canvas to which the game is rendering, but can be any interactive DOM element. + */ + target: any; + + /** + * The Touch Start event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchStart: Function; + + /** + * The Touch Start event handler function specifically for events on the Window. + * Initially empty and bound in the `startListeners` method. + */ + onTouchStartWindow: Function; + + /** + * The Touch Move event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchMove: Function; + + /** + * The Touch End event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchEnd: Function; + + /** + * The Touch End event handler function specifically for events on the Window. + * Initially empty and bound in the `startListeners` method. + */ + onTouchEndWindow: Function; + + /** + * The Touch Cancel event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchCancel: Function; + + /** + * The Touch Cancel event handler function specifically for events on the Window. + * Initially empty and bound in the `startListeners` method. + */ + onTouchCancelWindow: Function; + + /** + * The Touch Over event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchOver: Function; + + /** + * The Touch Out event handler function. + * Initially empty and bound in the `startListeners` method. + */ + onTouchOut: Function; + + /** + * Starts the Touch Event listeners running as long as an input target is set. + * + * This method is called automatically if Touch Input is enabled in the game config, + * which it is by default. However, you can call it manually should you need to + * delay input capturing until later in the game. + */ + startListeners(): void; + + /** + * Stops the Touch Event listeners. + * This is called automatically and does not need to be manually invoked. + */ + stopListeners(): void; + + /** + * Destroys this Touch Manager instance. + */ + destroy(): void; + + } + + } + + } + + namespace Loader { + /** + * The Loader is idle. + */ + var LOADER_IDLE: integer; + + /** + * The Loader is actively loading. + */ + var LOADER_LOADING: integer; + + /** + * The Loader is processing files is has loaded. + */ + var LOADER_PROCESSING: integer; + + /** + * The Loader has completed loading and processing. + */ + var LOADER_COMPLETE: integer; + + /** + * The Loader is shutting down. + */ + var LOADER_SHUTDOWN: integer; + + /** + * The Loader has been destroyed. + */ + var LOADER_DESTROYED: integer; + + /** + * File is in the load queue but not yet started + */ + var FILE_PENDING: integer; + + /** + * File has been started to load by the loader (onLoad called) + */ + var FILE_LOADING: integer; + + /** + * File has loaded successfully, awaiting processing + */ + var FILE_LOADED: integer; + + /** + * File failed to load + */ + var FILE_FAILED: integer; + + /** + * File is being processed (onProcess callback) + */ + var FILE_PROCESSING: integer; + + /** + * The File has errored somehow during processing. + */ + var FILE_ERRORED: integer; + + /** + * File has finished processing. + */ + var FILE_COMPLETE: integer; + + /** + * File has been destroyed + */ + var FILE_DESTROYED: integer; + + /** + * File was populated from local data and doesn't need an HTTP request + */ + var FILE_POPULATED: integer; + + namespace Events { + /** + * The Loader Plugin Add File Event. + * + * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. + * + * Listen to it from a Scene using: `this.load.on('addfile', listener)`. + * + * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. + */ + const ADD: any; + + /** + * The Loader Plugin Complete Event. + * + * This event is dispatched when the Loader has fully processed everything in the load queue. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Listen to it from a Scene using: `this.load.on('complete', listener)`. + */ + const COMPLETE: any; + + /** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. + * + * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. + * + * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. + */ + const FILE_COMPLETE: any; + + /** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. + * + * It uses a special dynamic event name constructed from the key and type of the file. + * + * For example, if you have loaded an `image` with a key of `monster`, you can listen for it + * using the following: + * + * ```javascript + * this.load.on('filecomplete-image-monster', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a texture `atlas` with a key of `Level1`: + * + * ```javascript + * this.load.on('filecomplete-atlas-Level1', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: + * + * ```javascript + * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. + */ + const FILE_KEY_COMPLETE: any; + + /** + * The File Load Error Event. + * + * This event is dispatched by the Loader Plugin when a file fails to load. + * + * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. + */ + const FILE_LOAD_ERROR: any; + + /** + * The File Load Event. + * + * This event is dispatched by the Loader Plugin when a file finishes loading, + * but _before_ it is processed and added to the internal Phaser caches. + * + * Listen to it from a Scene using: `this.load.on('load', listener)`. + */ + const FILE_LOAD: any; + + /** + * The File Load Progress Event. + * + * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and + * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. + * + * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. + */ + const FILE_PROGRESS: any; + + /** + * The Loader Plugin Post Process Event. + * + * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. + * It is dispatched before the internal lists are cleared and each File is destroyed. + * + * Use this hook to perform any last minute processing of files that can only happen once the + * Loader has completed, but prior to it emitting the `complete` event. + * + * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. + */ + const POST_PROCESS: any; + + /** + * The Loader Plugin Progress Event. + * + * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. + * + * Listen to it from a Scene using: `this.load.on('progress', listener)`. + */ + const PROGRESS: any; + + /** + * The Loader Plugin Start Event. + * + * This event is dispatched when the Loader starts running. At this point load progress is zero. + * + * This event is dispatched even if there aren't any files in the load queue. + * + * Listen to it from a Scene using: `this.load.on('start', listener)`. + */ + const START: any; + + } + + /** + * The base File class used by all File Types that the Loader can support. + * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods. + */ + class File { + /** + * + * @param loader The Loader that is going to load this File. + * @param fileConfig The file configuration object, as created by the file type. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, fileConfig: Phaser.Types.Loader.FileConfig); + + /** + * A reference to the Loader that is going to load this file. + */ + loader: Phaser.Loader.LoaderPlugin; + + /** + * A reference to the Cache, or Texture Manager, that is going to store this file if it loads. + */ + cache: Phaser.Cache.BaseCache | Phaser.Textures.TextureManager; + + /** + * The file type string (image, json, etc) for sorting within the Loader. + */ + type: string; + + /** + * Unique cache key (unique within its file type) + */ + key: string; + + /** + * The URL of the file, not including baseURL. + * Automatically has Loader.path prepended to it. + */ + url: string; + + /** + * The final URL this file will load from, including baseURL and path. + * Set automatically when the Loader calls 'load' on this file. + */ + src: string; + + /** + * The merged XHRSettings for this file. + */ + xhrSettings: Phaser.Types.Loader.XHRSettingsObject; + + /** + * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File. + */ + xhrLoader: XMLHttpRequest; + + /** + * The current state of the file. One of the FILE_CONST values. + */ + state: integer; + + /** + * The total size of this file. + * Set by onProgress and only if loading via XHR. + */ + bytesTotal: number; + + /** + * Updated as the file loads. + * Only set if loading via XHR. + */ + bytesLoaded: number; + + /** + * A percentage value between 0 and 1 indicating how much of this file has loaded. + * Only set if loading via XHR. + */ + percentComplete: number; + + /** + * For CORs based loading. + * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set) + */ + crossOrigin: string | undefined; + + /** + * The processed file data, stored here after the file has loaded. + */ + data: any; + + /** + * A config object that can be used by file types to store transitional data. + */ + config: any; + + /** + * If this is a multipart file, i.e. an atlas and its json together, then this is a reference + * to the parent MultiFile. Set and used internally by the Loader or specific file types. + */ + multiFile: Phaser.Loader.MultiFile; + + /** + * Does this file have an associated linked file? Such as an image and a normal map. + * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't + * actually bound by data, where-as a linkFile is. + */ + linkFile: Phaser.Loader.File; + + /** + * Links this File with another, so they depend upon each other for loading and processing. + * @param fileB The file to link to this one. + */ + setLink(fileB: Phaser.Loader.File): void; + + /** + * Resets the XHRLoader instance this file is using. + */ + resetXHR(): void; + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + */ + load(): void; + + /** + * Called when the file finishes loading, is sent a DOM ProgressEvent. + * @param xhr The XMLHttpRequest that caused this onload event. + * @param event The DOM ProgressEvent that resulted from this load. + */ + onLoad(xhr: XMLHttpRequest, event: ProgressEvent): void; + + /** + * Called if the file errors while loading, is sent a DOM ProgressEvent. + * @param xhr The XMLHttpRequest that caused this onload event. + * @param event The DOM ProgressEvent that resulted from this error. + */ + onError(xhr: XMLHttpRequest, event: ProgressEvent): void; + + /** + * Called during the file load progress. Is sent a DOM ProgressEvent. + * @param event The DOM ProgressEvent. + */ + onProgress(event: ProgressEvent): void; + + /** + * Usually overridden by the FileTypes and is called by Loader.nextFile. + * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage. + */ + onProcess(): void; + + /** + * Called when the File has completed processing. + * Checks on the state of its multifile, if set. + */ + onProcessComplete(): void; + + /** + * Called when the File has completed processing but it generated an error. + * Checks on the state of its multifile, if set. + */ + onProcessError(): void; + + /** + * Checks if a key matching the one used by this file exists in the target Cache or not. + * This is called automatically by the LoaderPlugin to decide if the file can be safely + * loaded or will conflict. + */ + hasCacheConflict(): boolean; + + /** + * Adds this file to its target cache upon successful loading and processing. + * This method is often overridden by specific file types. + */ + addToCache(): void; + + /** + * Called once the file has been added to its cache and is now ready for deletion from the Loader. + * It will emit a `filecomplete` event from the LoaderPlugin. + */ + pendingDestroy(): void; + + /** + * Destroy this File and any references it holds. + */ + destroy(): void; + + /** + * Static method for creating object URL using URL API and setting it as image 'src' attribute. + * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader. + * @param image Image object which 'src' attribute should be set to object URL. + * @param blob A Blob object to create an object URL for. + * @param defaultType Default mime type used if blob type is not available. + */ + static createObjectURL(image: HTMLImageElement, blob: Blob, defaultType: string): void; + + /** + * Static method for releasing an existing object URL which was previously created + * by calling {@link File#createObjectURL} method. + * @param image Image object which 'src' attribute should be revoked. + */ + static revokeObjectURL(image: HTMLImageElement): void; + + } + + namespace FileTypes { + /** + * A single Animation JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#animation method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#animation. + */ + class AnimationJSONFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Called at the end of the load process, after the Loader has finished all files in its queue. + */ + onLoadComplete(): void; + + } + + /** + * A single JSON based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. + * + * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm + */ + class AtlasJSONFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig, textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single XML based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlasXML method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlasXML. + */ + class AtlasXMLFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas xml file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig, textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Audio File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. + */ + class AudioFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param urlConfig The absolute or relative URL to load this file from in a config object. + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param audioContext The AudioContext this file will use to process itself. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioFileConfig, urlConfig?: any, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, audioContext?: AudioContext); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * An Audio Sprite File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audioSprite method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audioSprite. + */ + class AudioSpriteFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param jsonURL The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead. + * @param audioURL The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file. + * @param audioConfig The audio configuration options. + * @param audioXhrSettings An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings. + * @param jsonXhrSettings An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig, jsonURL: string, audioURL?: Object, audioConfig?: any, audioXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, jsonXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called by each File when it finishes loading. + * @param file The File that has completed processing. + */ + onFileComplete(file: Phaser.Loader.File): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Binary File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#binary method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#binary. + */ + class BinaryFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.bin`, i.e. if `key` was "alien" then the URL will be "alien.bin". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataType Optional type to cast the binary file to once loaded. For example, `Uint8Array`. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.BinaryFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataType?: any); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Bitmap Font based File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#bitmapFont method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#bitmapFont. + */ + class BitmapFontFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the font image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param fontDataURL The absolute or relative URL to load the font xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param textureXhrSettings An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings. + * @param fontDataXhrSettings An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.BitmapFontFileConfig, textureURL?: string | string[], fontDataURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, fontDataXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single CSS File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#css method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#css. + */ + class CSSFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.CSSFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single GLSL File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#glsl method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#glsl. + */ + class GLSLFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param shaderType The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle. Default 'fragment'. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.GLSLFileConfig, url?: string, shaderType?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + /** + * Returns the name of the shader from the header block. + * @param headerSource The header data. + */ + getShaderName(headerSource: string[]): string; + + /** + * Returns the type of the shader from the header block. + * @param headerSource The header data. + */ + getShaderType(headerSource: string[]): string; + + /** + * Returns the shader uniforms from the header block. + * @param headerSource The header data. + */ + getShaderUniforms(headerSource: string[]): any; + + } + + /** + * A single Audio File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. + */ + class HTML5AudioFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param urlConfig The absolute or relative URL to load this file from. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AudioFileConfig, urlConfig?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called when the file finishes loading. + */ + onLoad(): void; + + /** + * Called if the file errors while loading. + */ + onError(): void; + + /** + * Called during the file load progress. Is sent a DOM ProgressEvent. + */ + onProgress(): void; + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + */ + load(): void; + + } + + /** + * A single HTML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#html method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#html. + */ + class HTMLFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single HTML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#htmlTexture method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#htmlTexture. + */ + class HTMLTextureFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param width The width of the texture the HTML will be rendered to. + * @param height The height of the texture the HTML will be rendered to. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig, url?: string, width?: integer, height?: integer, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. + */ + class ImageFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param frameConfig The frame configuration object. Only provided for, and used by, Sprite Sheets. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ImageFileConfig, url?: string | string[], xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + */ + class JSONFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Multi Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#multiatlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#multiatlas. + */ + class MultiAtlasFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key of the file. Must be unique within both the Loader and the Texture Manager. + * @param atlasURL The absolute or relative URL to load the multi atlas json file from. + * @param path Optional path to use when loading the textures defined in the atlas data. + * @param baseURL Optional Base URL to use when loading the textures defined in the atlas data. + * @param atlasXhrSettings Extra XHR Settings specifically for the atlas json file. + * @param textureXhrSettings Extra XHR Settings specifically for the texture files. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string, atlasURL?: string, path?: string, baseURL?: string, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called by each File when it finishes loading. + * @param file The File that has completed processing. + */ + onFileComplete(file: Phaser.Loader.File): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A Multi Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#scripts method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scripts. + */ + class MultiScriptFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array. + * @param xhrSettings An XHR Settings configuration object for the script files. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.MultiScriptFileConfig, url?: string[], xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single JSON Pack File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#pack method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#pack. + */ + class PackFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.PackFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject, dataKey?: string); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Plugin Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#plugin method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#plugin. + */ + class PluginFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param start Automatically start the plugin after loading? Default false. + * @param mapping If this plugin is to be injected into the Scene, this is the property key used. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.PluginFileConfig, url?: string, start?: boolean, mapping?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * An external Scene JavaScript File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#sceneFile method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#sceneFile. + */ + class SceneFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SceneFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Scene Plugin Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#scenePlugin method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scenePlugin. + */ + class ScenePluginFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param systemKey If this plugin is to be added to Scene.Systems, this is the property key for it. + * @param sceneKey If this plugin is to be added to the Scene, this is the property key for it. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ScenePluginFileConfig, url?: string, systemKey?: string, sceneKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#script method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#script. + */ + class ScriptFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.ScriptFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Sprite Sheet Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#spritesheet method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spritesheet. + */ + class SpriteSheetFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param frameConfig The frame configuration object. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig, url?: string | string[], frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single SVG File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#svg method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#svg. + */ + class SVGFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was "alien" then the URL will be "alien.svg". + * @param svgConfig The svg size configuration object. + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.SVGFileConfig, url?: string, svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Text File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. + */ + class TextFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TextFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + /** + * A single Tilemap CSV File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapCSV method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapCSV. + */ + class TilemapCSVFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.csv`, i.e. if `key` was "alien" then the URL will be "alien.csv". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Impact.js Tilemap JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapImpact method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapImpact. + */ + class TilemapImpactFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single Tiled Tilemap JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapTiledJSON method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapTiledJSON. + */ + class TilemapJSONFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single text file based Unity Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#unityAtlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#unityAtlas. + */ + class UnityAtlasFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig, textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + + /** + * A single XML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#xml method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#xml. + */ + class XMLFile extends Phaser.Loader.File { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param xhrSettings Extra XHR Settings specifically for this file. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.XMLFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + */ + onProcess(): void; + + } + + } + + namespace FileTypesManager { + /** + * Static method called when a LoaderPlugin is created. + * + * Loops through the local types object and injects all of them as + * properties into the LoaderPlugin instance. + * @param loader The LoaderPlugin to install the types into. + */ + function install(loader: Phaser.Loader.LoaderPlugin): void; + + /** + * Static method called directly by the File Types. + * + * The key is a reference to the function used to load the files via the Loader, i.e. `image`. + * @param key The key that will be used as the method name in the LoaderPlugin. + * @param factoryFunction The function that will be called when LoaderPlugin.key is invoked. + */ + function register(key: string, factoryFunction: Function): void; + + /** + * Removed all associated file types. + */ + function destroy(): void; + + } + + /** + * Given a File and a baseURL value this returns the URL the File will use to download from. + * @param file The File object. + * @param baseURL A default base URL. + */ + function GetURL(file: Phaser.Loader.File, baseURL: string): string; + + /** + * The Loader handles loading all external content such as Images, Sounds, Texture Atlases and data files. + * You typically interact with it via `this.load` in your Scene. Scenes can have a `preload` method, which is always + * called before the Scenes `create` method, allowing you to preload assets that the Scene may need. + * + * If you call any `this.load` methods from outside of `Scene.preload` then you need to start the Loader going + * yourself by calling `Loader.start()`. It's only automatically started during the Scene preload. + * + * The Loader uses a combination of tag loading (eg. Audio elements) and XHR and provides progress and completion events. + * Files are loaded in parallel by default. The amount of concurrent connections can be controlled in your Game Configuration. + * + * Once the Loader has started loading you are still able to add files to it. These can be injected as a result of a loader + * event, the type of file being loaded (such as a pack file) or other external events. As long as the Loader hasn't finished + * simply adding a new file to it, while running, will ensure it's added into the current queue. + * + * Every Scene has its own instance of the Loader and they are bound to the Scene in which they are created. However, + * assets loaded by the Loader are placed into global game-level caches. For example, loading an XML file will place that + * file inside `Game.cache.xml`, which is accessible from every Scene in your game, no matter who was responsible + * for loading it. The same is true of Textures. A texture loaded in one Scene is instantly available to all other Scenes + * in your game. + * + * The Loader works by using custom File Types. These are stored in the FileTypesManager, which injects them into the Loader + * when it's instantiated. You can create your own custom file types by extending either the File or MultiFile classes. + * See those files for more details. + */ + class LoaderPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene which owns this Loader instance. + */ + constructor(scene: Phaser.Scene); + + /** + * Adds an Animation JSON Data file, or array of Animation JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.animation('baddieAnims', 'files/BaddieAnims.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.animation({ + * key: 'baddieAnims', + * url: 'files/BaddieAnims.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading it will automatically be passed to the global Animation Managers `fromJSON` method. + * This will parse all of the JSON data and create animation data from it. This process happens at the very end + * of the Loader, once every other file in the load queue has finished. The reason for this is to allow you to load + * both animation data and the images it relies upon in the same load call. + * + * Once the animation data has been parsed you will be able to play animations using that data. + * Please see the Animation Manager `fromJSON` method for more details about the format and playback. + * + * You can also access the raw animation data from its Cache using its key: + * + * ```javascript + * this.load.animation('baddieAnims', 'files/BaddieAnims.json'); + * // and later in your game ... + * var data = this.cache.json.get('baddieAnims'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And if you only wanted to create animations from the `boss` data, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param dataKey When the Animation JSON file loads only this property will be stored in the Cache and used to create animation data. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + animation(key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig | Phaser.Types.Loader.FileTypes.JSONFileConfig[], url?: string, dataKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a JSON based Texture Atlas, or array of atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in a JSON file, using either the JSON Hash or JSON Array format. + * These files are created by software such as Texture Packer, Shoebox and Adobe Flash / Animate. + * If you are using Texture Packer and have enabled multi-atlas support, then please use the Phaser Multi Atlas loader + * instead of this one. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.atlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * atlasURL: 'images/MainMenu.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig` for more details. + * + * Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); + * // and later in your game ... + * this.add.image(x, y, 'mainmenu', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.atlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.json'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.atlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * normalMap: 'images/MainMenu-n.png', + * atlasURL: 'images/MainMenu.json' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Atlas JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ + atlas(key: string | Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig | Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig[], textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an XML based Texture Atlas, or array of atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.atlasXML('mainmenu', 'images/MainMenu.png', 'images/MainMenu.xml'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in an XML file format. + * These files are created by software such as Shoebox and Adobe Flash / Animate. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.atlasXML({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * atlasURL: 'images/MainMenu.xml' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig` for more details. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.atlasXML('mainmenu', 'images/MainMenu.png', 'images/MainMenu.xml'); + * // and later in your game ... + * this.add.image(x, y, 'mainmenu', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.atlasXML('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.xml'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.atlasXML({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * normalMap: 'images/MainMenu-n.png', + * atlasURL: 'images/MainMenu.xml' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Atlas XML File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas xml file. Used in replacement of the Loaders default XHR Settings. + */ + atlasXML(key: string | Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig | Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig[], textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an Audio or HTML5Audio file, or array of audio files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.audio('title', [ 'music/Title.ogg', 'music/Title.mp3', 'music/Title.m4a' ]); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Audio Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Audio Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Audio Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.audio({ + * key: 'title', + * url: [ 'music/Title.ogg', 'music/Title.mp3', 'music/Title.m4a' ] + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AudioFileConfig` for more details. + * + * The URLs can be relative or absolute. If the URLs are relative the `Loader.baseURL` and `Loader.path` values will be prepended to them. + * + * Due to different browsers supporting different audio file types you should usually provide your audio files in a variety of formats. + * ogg, mp3 and m4a are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on + * browser support. + * + * If audio has been disabled in your game, either via the game config, or lack of support from the device, then no audio will be loaded. + * + * Note: The ability to load this type of file will only be available if the Audio File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param urls The absolute or relative URL to load the audio files from. + * @param config An object containing an `instances` property for HTML5Audio. Defaults to 1. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + audio(key: string | Phaser.Types.Loader.FileTypes.AudioFileConfig | Phaser.Types.Loader.FileTypes.AudioFileConfig[], urls?: string | string[], config?: any, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a JSON based Audio Sprite, or array of audio sprites, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.audioSprite('kyobi', 'kyobi.json', [ + * 'kyobi.ogg', + * 'kyobi.mp3', + * 'kyobi.m4a' + * ]); + * } + * ``` + * + * Audio Sprites are a combination of audio files and a JSON configuration. + * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite + * + * If the JSON file includes a 'resource' object then you can let Phaser parse it and load the audio + * files automatically based on its content. To do this exclude the audio URLs from the load: + * + * ```javascript + * function preload () + * { + * this.load.audioSprite('kyobi', 'kyobi.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * The key must be a unique String. It is used to add the file to the global Audio Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Audio Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Audio Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.audioSprite({ + * key: 'kyobi', + * jsonURL: 'audio/Kyobi.json', + * audioURL: [ + * 'audio/Kyobi.ogg', + * 'audio/Kyobi.mp3', + * 'audio/Kyobi.m4a' + * ] + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig` for more details. + * + * Instead of passing a URL for the audio JSON data you can also pass in a well formed JSON object instead. + * + * Once the audio has finished loading you can use it create an Audio Sprite by referencing its key: + * + * ```javascript + * this.load.audioSprite('kyobi', 'kyobi.json'); + * // and later in your game ... + * var music = this.sound.addAudioSprite('kyobi'); + * music.play('title'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * Due to different browsers supporting different audio file types you should usually provide your audio files in a variety of formats. + * ogg, mp3 and m4a are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on + * browser support. + * + * If audio has been disabled in your game, either via the game config, or lack of support from the device, then no audio will be loaded. + * + * Note: The ability to load this type of file will only be available if the Audio Sprite File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or an array of objects. + * @param jsonURL The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead. + * @param audioURL The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file. + * @param audioConfig The audio configuration options. + * @param audioXhrSettings An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings. + * @param jsonXhrSettings An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + */ + audioSprite(key: string | Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig | Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig[], jsonURL: string, audioURL?: string | string[], audioConfig?: any, audioXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, jsonXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Binary file, or array of Binary files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.binary('doom', 'files/Doom.wad'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Binary Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Binary Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Binary Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.binary({ + * key: 'doom', + * url: 'files/Doom.wad', + * dataType: Uint8Array + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.BinaryFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.binary('doom', 'files/Doom.wad'); + * // and later in your game ... + * var data = this.cache.binary.get('doom'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Data` the final key will be `LEVEL1.Data` and + * this is what you would use to retrieve the text from the Binary Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "doom" + * and no URL is given then the Loader will set the URL to be "doom.bin". It will always add `.bin` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Binary File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.bin`, i.e. if `key` was "alien" then the URL will be "alien.bin". + * @param dataType Optional type to cast the binary file to once loaded. For example, `Uint8Array`. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + binary(key: string | Phaser.Types.Loader.FileTypes.BinaryFileConfig | Phaser.Types.Loader.FileTypes.BinaryFileConfig[], url?: string, dataType?: any, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an XML based Bitmap Font, or array of fonts, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * ```javascript + * function preload () + * { + * this.load.bitmapFont('goldenFont', 'images/GoldFont.png', 'images/GoldFont.xml'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the font data to be provided in an XML file format. + * These files are created by software such as the [Angelcode Bitmap Font Generator](http://www.angelcode.com/products/bmfont/), + * [Littera](http://kvazars.com/littera/) or [Glyph Designer](https://71squared.com/glyphdesigner) + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.bitmapFont({ + * key: 'goldenFont', + * textureURL: 'images/GoldFont.png', + * fontDataURL: 'images/GoldFont.xml' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.BitmapFontFileConfig` for more details. + * + * Once the atlas has finished loading you can use key of it when creating a Bitmap Text Game Object: + * + * ```javascript + * this.load.bitmapFont('goldenFont', 'images/GoldFont.png', 'images/GoldFont.xml'); + * // and later in your game ... + * this.add.bitmapText(x, y, 'goldenFont', 'Hello World'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use when creating a Bitmap Text object. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.bitmapFont('goldenFont', [ 'images/GoldFont.png', 'images/GoldFont-n.png' ], 'images/GoldFont.xml'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.bitmapFont({ + * key: 'goldenFont', + * textureURL: 'images/GoldFont.png', + * normalMap: 'images/GoldFont-n.png', + * fontDataURL: 'images/GoldFont.xml' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Bitmap Font File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param textureURL The absolute or relative URL to load the font image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param fontDataURL The absolute or relative URL to load the font xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param textureXhrSettings An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings. + * @param fontDataXhrSettings An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings. + */ + bitmapFont(key: string | Phaser.Types.Loader.FileTypes.BitmapFontFileConfig | Phaser.Types.Loader.FileTypes.BitmapFontFileConfig[], textureURL?: string | string[], fontDataURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, fontDataXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a CSS file, or array of CSS files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.css('headers', 'styles/headers.css'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.css({ + * key: 'headers', + * url: 'styles/headers.css' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.CSSFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a style DOM element + * via `document.createElement('style')`. It will have its `defer` property set to false and then the + * resulting element will be appended to `document.head`. The CSS styles are then applied to the current document. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.css". It will always add `.css` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the CSS File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.css`, i.e. if `key` was "alien" then the URL will be "alien.css". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + css(key: string | Phaser.Types.Loader.FileTypes.CSSFileConfig | Phaser.Types.Loader.FileTypes.CSSFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a GLSL file, or array of GLSL files, to the current load queue. + * In Phaser 3 GLSL files are just plain Text files at the current moment in time. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.glsl('plasma', 'shaders/Plasma.glsl'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Shader Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Shader Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Shader Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.glsl({ + * key: 'plasma', + * shaderType: 'fragment', + * url: 'shaders/Plasma.glsl' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.GLSLFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.glsl('plasma', 'shaders/Plasma.glsl'); + * // and later in your game ... + * var data = this.cache.shader.get('plasma'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `FX.` and the key was `Plasma` the final key will be `FX.Plasma` and + * this is what you would use to retrieve the text from the Shader Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "plasma" + * and no URL is given then the Loader will set the URL to be "plasma.glsl". It will always add `.glsl` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the GLSL File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.glsl`, i.e. if `key` was "alien" then the URL will be "alien.glsl". + * @param shaderType The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle. Default 'fragment'. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + glsl(key: string | Phaser.Types.Loader.FileTypes.GLSLFileConfig | Phaser.Types.Loader.FileTypes.GLSLFileConfig[], url?: string, shaderType?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an HTML file, or array of HTML files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.html('story', 'files/LoginForm.html'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global HTML Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the HTML Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the HTML Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.html({ + * key: 'login', + * url: 'files/LoginForm.html' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.HTMLFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.html('login', 'files/LoginForm.html'); + * // and later in your game ... + * var data = this.cache.html.get('login'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the html from the HTML Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.html". It will always add `.html` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the HTML File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + html(key: string | Phaser.Types.Loader.FileTypes.HTMLFileConfig | Phaser.Types.Loader.FileTypes.HTMLFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an HTML File, or array of HTML Files, to the current load queue. When the files are loaded they + * will be rendered to textures and stored in the Texture Manager. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.htmlTexture('instructions', 'content/intro.html', 256, 512); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.htmlTexture({ + * key: 'instructions', + * url: 'content/intro.html', + * width: 256, + * height: 512 + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.htmlTexture('instructions', 'content/intro.html', 256, 512); + * // and later in your game ... + * this.add.image(x, y, 'instructions'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.html". It will always add `.html` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * The width and height are the size of the texture to which the HTML will be rendered. It's not possible to determine these + * automatically, so you will need to provide them, either as arguments or in the file config object. + * When the HTML file has loaded a new SVG element is created with a size and viewbox set to the width and height given. + * The SVG file has a body tag added to it, with the HTML file contents included. It then calls `window.Blob` on the SVG, + * and if successful is added to the Texture Manager, otherwise it fails processing. The overall quality of the rendered + * HTML depends on your browser, and some of them may not even support the svg / blob process used. Be aware that there are + * limitations on what HTML can be inside an SVG. You can find out more details in this + * [Mozilla MDN entry](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas). + * + * Note: The ability to load this type of file will only be available if the HTMLTextureFile File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param width The width of the texture the HTML will be rendered to. Default 512. + * @param height The height of the texture the HTML will be rendered to. Default 512. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + htmlTexture(key: string | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig[], url?: string, width?: integer, height?: integer, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an Image, or array of Images, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.image('logo', 'images/phaserLogo.png'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.image('logo', 'images/AtariLogo.png'); + * // and later in your game ... + * this.add.image(x, y, 'logo'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + image(key: string | Phaser.Types.Loader.FileTypes.ImageFileConfig | Phaser.Types.Loader.FileTypes.ImageFileConfig[], url?: string | string[], xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + json(key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig | Phaser.Types.Loader.FileTypes.JSONFileConfig[], url?: string, dataKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Multi Texture Atlas, or array of multi atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.multiatlas('level1', 'images/Level1.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in a JSON file as exported from the application Texture Packer, + * version 4.6.3 or above, where you have made sure to use the Phaser 3 Export option. + * + * The way it works internally is that you provide a URL to the JSON file. Phaser then loads this JSON, parses it and + * extracts which texture files it also needs to load to complete the process. If the JSON also defines normal maps, + * Phaser will load those as well. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.multiatlas({ + * key: 'level1', + * atlasURL: 'images/Level1.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig` for more details. + * + * Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.multiatlas('level1', 'images/Level1.json'); + * // and later in your game ... + * this.add.image(x, y, 'level1', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Multi Atlas File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param path Optional path to use when loading the textures defined in the atlas data. + * @param baseURL Optional Base URL to use when loading the textures defined in the atlas data. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ + multiatlas(key: string | Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig | Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig[], atlasURL?: string, path?: string, baseURL?: string, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an array of Script files to the current load queue. + * + * The difference between this and the `ScriptFile` file type is that you give an array of scripts to this method, + * and the scripts are then processed _exactly_ in that order. This allows you to load a bunch of scripts that + * may have dependancies on each other without worrying about the async nature of traditional script loading. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.scripts('PostProcess', [ + * 'libs/shaders/CopyShader.js', + * 'libs/postprocessing/EffectComposer.js', + * 'libs/postprocessing/RenderPass.js', + * 'libs/postprocessing/MaskPass.js', + * 'libs/postprocessing/ShaderPass.js', + * 'libs/postprocessing/AfterimagePass.js' + * ]); + * } + * ``` + * + * In the code above the script files will all be loaded in parallel but only processed (i.e. invoked) in the exact + * order given in the array. + * + * The files are **not** loaded right away. They are added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the files are queued + * it means you cannot use the files immediately after calling this method, but must wait for the files to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.scripts({ + * key: 'PostProcess', + * url: [ + * 'libs/shaders/CopyShader.js', + * 'libs/postprocessing/EffectComposer.js', + * 'libs/postprocessing/RenderPass.js', + * 'libs/postprocessing/MaskPass.js', + * 'libs/postprocessing/ShaderPass.js', + * 'libs/postprocessing/AfterimagePass.js' + * ] + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.MultiScriptFileConfig` for more details. + * + * Once all the files have finished loading they will automatically be converted into a script element + * via `document.createElement('script')`. They will have their language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. This is done in the exact order the files are specified in the url array. + * + * The URLs can be relative or absolute. If the URLs are relative the `Loader.baseURL` and `Loader.path` values will be prepended to them. + * + * Note: The ability to load this type of file will only be available if the MultiScript File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array. + * @param extension The default file extension to use if no url is provided. Default 'js'. + * @param xhrSettings Extra XHR Settings specifically for these files. + */ + scripts(key: string | Phaser.Types.Loader.FileTypes.MultiScriptFileConfig | Phaser.Types.Loader.FileTypes.MultiScriptFileConfig[], url?: string[], extension?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a JSON File Pack, or array of packs, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.pack('level1', 'data/Level1Files.json'); + * } + * ``` + * + * A File Pack is a JSON file (or object) that contains details about other files that should be added into the Loader. + * Here is a small example: + * + * ```json + * { + * "test1": { + * "files": [ + * { + * "type": "image", + * "key": "taikodrummaster", + * "url": "assets/pics/taikodrummaster.jpg" + * }, + * { + * "type": "image", + * "key": "sukasuka-chtholly", + * "url": "assets/pics/sukasuka-chtholly.png" + * } + * ] + * }, + * "meta": { + * "generated": "1401380327373", + * "app": "Phaser 3 Asset Packer", + * "url": "https://phaser.io", + * "version": "1.0", + * "copyright": "Photon Storm Ltd. 2018" + * } + * } + * ``` + * + * The pack can be split into sections. In the example above you'll see a section called `test1. You can tell + * the `load.pack` method to parse only a particular section of a pack. The pack is stored in the JSON Cache, + * so you can pass it to the Loader to process additional sections as needed in your game, or you can just load + * them all at once without specifying anything. + * + * The pack file can contain an entry for any type of file that Phaser can load. The object structures exactly + * match that of the file type configs, and all properties available within the file type configs can be used + * in the pack file too. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.pack({ + * key: 'level1', + * url: 'data/Level1Files.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.PackFileConfig` for more details. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the Pack File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param dataKey When the JSON file loads only this property will be stored in the Cache. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + pack(key: string | Phaser.Types.Loader.FileTypes.PackFileConfig | Phaser.Types.Loader.FileTypes.PackFileConfig[], url?: string, dataKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Plugin Script file, or array of plugin files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.plugin('modplayer', 'plugins/ModPlayer.js'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.plugin({ + * key: 'modplayer', + * url: 'plugins/ModPlayer.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.PluginFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a script element + * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. It will then be passed to the Phaser PluginCache.register method. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Plugin File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". Or, a plugin function. + * @param start Automatically start the plugin after loading? + * @param mapping If this plugin is to be injected into the Scene, this is the property key used. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + plugin(key: string | Phaser.Types.Loader.FileTypes.PluginFileConfig | Phaser.Types.Loader.FileTypes.PluginFileConfig[], url?: string | Function, start?: boolean, mapping?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an external Scene file, or array of Scene files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.sceneFile('Level1', 'src/Level1.js'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Scene Manager upon a successful load. + * + * For a Scene File it's vitally important that the key matches the class name in the JavaScript file. + * + * For example here is the source file: + * + * ```javascript + * class ExternalScene extends Phaser.Scene { + * + * constructor () + * { + * super('myScene'); + * } + * + * } + * ``` + * + * Because the class is called `ExternalScene` that is the exact same key you must use when loading it: + * + * ```javascript + * function preload () + * { + * this.load.sceneFile('ExternalScene', 'src/yourScene.js'); + * } + * ``` + * + * The key that is used within the Scene Manager can either be set to the same, or you can override it in the Scene + * constructor, as we've done in the example above, where the Scene key was changed to `myScene`. + * + * The key should be unique both in terms of files being loaded and Scenes already present in the Scene Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Scene Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.sceneFile({ + * key: 'Level1', + * url: 'src/Level1.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SceneFileConfig` for more details. + * + * Once the file has finished loading it will be added to the Scene Manager. + * + * ```javascript + * this.load.sceneFile('Level1', 'src/Level1.js'); + * // and later in your game ... + * this.scene.start('Level1'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `WORLD1.` and the key was `Story` the final key will be `WORLD1.Story` and + * this is what you would use to retrieve the text from the Scene Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Scene File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + sceneFile(key: string | Phaser.Types.Loader.FileTypes.SceneFileConfig | Phaser.Types.Loader.FileTypes.SceneFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Scene Plugin Script file, or array of plugin files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.scenePlugin('ModPlayer', 'plugins/ModPlayer.js', 'modPlayer', 'mods'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.scenePlugin({ + * key: 'modplayer', + * url: 'plugins/ModPlayer.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ScenePluginFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a script element + * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. It will then be passed to the Phaser PluginCache.register method. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Script File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". Or, set to a plugin function. + * @param systemKey If this plugin is to be added to Scene.Systems, this is the property key for it. + * @param sceneKey If this plugin is to be added to the Scene, this is the property key for it. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + scenePlugin(key: string | Phaser.Types.Loader.FileTypes.ScenePluginFileConfig | Phaser.Types.Loader.FileTypes.ScenePluginFileConfig[], url?: string | Function, systemKey?: string, sceneKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Script file, or array of Script files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.script('aliens', 'lib/aliens.js'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.script({ + * key: 'aliens', + * url: 'lib/aliens.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ScriptFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a script element + * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Script File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + script(key: string | Phaser.Types.Loader.FileTypes.ScriptFileConfig | Phaser.Types.Loader.FileTypes.ScriptFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Sprite Sheet Image, or array of Sprite Sheet Images, to the current load queue. + * + * The term 'Sprite Sheet' in Phaser means a fixed-size sheet. Where every frame in the sheet is the exact same size, + * and you reference those frames using numbers, not frame names. This is not the same thing as a Texture Atlas, where + * the frames are packed in a way where they take up the least amount of space, and are referenced by their names, + * not numbers. Some articles and software use the term 'Sprite Sheet' to mean Texture Atlas, so please be aware of + * what sort of file you're actually trying to load. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 }); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.spritesheet({ + * key: 'bot', + * url: 'images/robot.png', + * frameConfig: { + * frameWidth: 32, + * frameHeight: 38, + * startFrame: 0, + * endFrame: 8 + * } + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 }); + * // and later in your game ... + * this.add.image(x, y, 'bot', 0); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `PLAYER.` and the key was `Running` the final key will be `PLAYER.Running` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.spritesheet('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ], { frameWidth: 256, frameHeight: 80 }); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.spritesheet({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png', + * frameConfig: { + * frameWidth: 256, + * frameHeight: 80 + * } + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Sprite Sheet File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param frameConfig The frame configuration object. At a minimum it should have a `frameWidth` property. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + spritesheet(key: string | Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig | Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig[], url?: string, frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an SVG File, or array of SVG Files, to the current load queue. When the files are loaded they + * will be rendered to bitmap textures and stored in the Texture Manager. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SVGFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.svg('morty', 'images/Morty.svg'); + * // and later in your game ... + * this.add.image(x, y, 'morty'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.html". It will always add `.html` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can optionally pass an SVG Resize Configuration object when you load an SVG file. By default the SVG will be rendered to a texture + * at the same size defined in the SVG file attributes. However, this isn't always desirable. You may wish to resize the SVG (either down + * or up) to improve texture clarity, or reduce texture memory consumption. You can either specify an exact width and height to resize + * the SVG to: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg', { width: 300, height: 600 }); + * } + * ``` + * + * Or when using a configuration object: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg', + * svgConfig: { + * width: 300, + * height: 600 + * } + * }); + * ``` + * + * Alternatively, you can just provide a scale factor instead: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg', { scale: 2.5 }); + * } + * ``` + * + * Or when using a configuration object: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg', + * svgConfig: { + * scale: 2.5 + * } + * }); + * ``` + * + * If scale, width and height values are all given, the scale has priority and the width and height values are ignored. + * + * Note: The ability to load this type of file will only be available if the SVG File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was "alien" then the URL will be "alien.svg". + * @param svgConfig The svg size configuration object. + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + svg(key: string | Phaser.Types.Loader.FileTypes.SVGFileConfig | Phaser.Types.Loader.FileTypes.SVGFileConfig[], url?: string, svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Text file, or array of Text files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.text('story', 'files/IntroStory.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Text Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.text({ + * key: 'story', + * url: 'files/IntroStory.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.text('story', 'files/IntroStory.txt'); + * // and later in your game ... + * var data = this.cache.text.get('story'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Text Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + text(key: string | Phaser.Types.Loader.FileTypes.TextFileConfig | Phaser.Types.Loader.FileTypes.TextFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a CSV Tilemap file, or array of CSV files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.tilemapCSV('level1', 'maps/Level1.csv'); + * } + * ``` + * + * Tilemap CSV data can be created in a text editor, or a 3rd party app that exports as CSV. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.tilemapCSV({ + * key: 'level1', + * url: 'maps/Level1.csv' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.tilemapCSV('level1', 'maps/Level1.csv'); + * // and later in your game ... + * var map = this.make.tilemap({ key: 'level1' }); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Tilemap Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "level" + * and no URL is given then the Loader will set the URL to be "level.csv". It will always add `.csv` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Tilemap CSV File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.csv`, i.e. if `key` was "alien" then the URL will be "alien.csv". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + tilemapCSV(key: string | Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig | Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an Impact.js Tilemap file, or array of map files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.tilemapImpact('level1', 'maps/Level1.json'); + * } + * ``` + * + * Impact Tilemap data is created the Impact.js Map Editor called Weltmeister. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.tilemapImpact({ + * key: 'level1', + * url: 'maps/Level1.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.tilemapImpact('level1', 'maps/Level1.json'); + * // and later in your game ... + * var map = this.make.tilemap({ key: 'level1' }); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Tilemap Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "level" + * and no URL is given then the Loader will set the URL to be "level.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Tilemap Impact File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + tilemapImpact(key: string | Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig | Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Tiled JSON Tilemap file, or array of map files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.tilemapTiledJSON('level1', 'maps/Level1.json'); + * } + * ``` + * + * The Tilemap data is created using the Tiled Map Editor and selecting JSON as the export format. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.tilemapTiledJSON({ + * key: 'level1', + * url: 'maps/Level1.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.tilemapTiledJSON('level1', 'maps/Level1.json'); + * // and later in your game ... + * var map = this.make.tilemap({ key: 'level1' }); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Tilemap Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "level" + * and no URL is given then the Loader will set the URL to be "level.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Tilemap JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + tilemapTiledJSON(key: string | Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig | Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds a Unity YAML based Texture Atlas, or array of atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in a YAML formatted text file as exported from Unity. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.unityAtlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * atlasURL: 'images/MainMenu.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig` for more details. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); + * // and later in your game ... + * this.add.image(x, y, 'mainmenu', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.unityAtlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.txt'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.unityAtlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * normalMap: 'images/MainMenu-n.png', + * atlasURL: 'images/MainMenu.txt' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Unity Atlas File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + */ + unityAtlas(key: string | Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig | Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig[], textureURL?: string | string[], atlasURL?: string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * Adds an XML file, or array of XML files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.xml('wavedata', 'files/AlienWaveData.xml'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global XML Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the XML Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the XML Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.xml({ + * key: 'wavedata', + * url: 'files/AlienWaveData.xml' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.XMLFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.xml('wavedata', 'files/AlienWaveData.xml'); + * // and later in your game ... + * var data = this.cache.xml.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the XML Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.xml". It will always add `.xml` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the XML File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + xml(key: string | Phaser.Types.Loader.FileTypes.XMLFileConfig | Phaser.Types.Loader.FileTypes.XMLFileConfig[], url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): Phaser.Loader.LoaderPlugin; + + /** + * The Scene which owns this Loader instance. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * A reference to the global Cache Manager. + */ + cacheManager: Phaser.Cache.CacheManager; + + /** + * A reference to the global Texture Manager. + */ + textureManager: Phaser.Textures.TextureManager; + + /** + * A reference to the global Scene Manager. + */ + protected sceneManager: Phaser.Scenes.SceneManager; + + /** + * An optional prefix that is automatically prepended to the start of every file key. + * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`. + * You can set this directly, or call `Loader.setPrefix()`. It will then affect every file added to the Loader + * from that point on. It does _not_ change any file already in the load queue. + */ + prefix: string; + + /** + * The value of `path`, if set, is placed before any _relative_ file path given. For example: + * + * ```javascript + * this.load.path = "images/sprites/"; + * this.load.image("ball", "ball.png"); + * this.load.image("tree", "level1/oaktree.png"); + * this.load.image("boom", "http://server.com/explode.png"); + * ``` + * + * Would load the `ball` file from `images/sprites/ball.png` and the tree from + * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL + * given as it's an absolute URL. + * + * Please note that the path is added before the filename but *after* the baseURL (if set.) + * + * If you set this property directly then it _must_ end with a "/". Alternatively, call `setPath()` and it'll do it for you. + */ + path: string; + + /** + * If you want to append a URL before the path of any asset you can set this here. + * + * Useful if allowing the asset base url to be configured outside of the game code. + * + * If you set this property directly then it _must_ end with a "/". Alternatively, call `setBaseURL()` and it'll do it for you. + */ + baseURL: string; + + /** + * The number of concurrent / parallel resources to try and fetch at once. + * + * Old browsers limit 6 requests per domain; modern ones, especially those with HTTP/2 don't limit it at all. + * + * The default is 32 but you can change this in your Game Config, or by changing this property before the Loader starts. + */ + maxParallelDownloads: integer; + + /** + * xhr specific global settings (can be overridden on a per-file basis) + */ + xhr: Phaser.Types.Loader.XHRSettingsObject; + + /** + * The crossOrigin value applied to loaded images. Very often this needs to be set to 'anonymous'. + */ + crossOrigin: string; + + /** + * The total number of files to load. It may not always be accurate because you may add to the Loader during the process + * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. + */ + totalToLoad: integer; + + /** + * The progress of the current load queue, as a float value between 0 and 1. + * This is updated automatically as files complete loading. + * Note that it is possible for this value to go down again if you add content to the current load queue during a load. + */ + progress: number; + + /** + * Files are placed in this Set when they're added to the Loader via `addFile`. + * + * They are moved to the `inflight` Set when they start loading, and assuming a successful + * load, to the `queue` Set for further processing. + * + * By the end of the load process this Set will be empty. + */ + list: Phaser.Structs.Set; + + /** + * Files are stored in this Set while they're in the process of being loaded. + * + * Upon a successful load they are moved to the `queue` Set. + * + * By the end of the load process this Set will be empty. + */ + inflight: Phaser.Structs.Set; + + /** + * Files are stored in this Set while they're being processed. + * + * If the process is successful they are moved to their final destination, which could be + * a Cache or the Texture Manager. + * + * At the end of the load process this Set will be empty. + */ + queue: Phaser.Structs.Set; + + /** + * The total number of files that failed to load during the most recent load. + * This value is reset when you call `Loader.start`. + */ + totalFailed: integer; + + /** + * The total number of files that successfully loaded during the most recent load. + * This value is reset when you call `Loader.start`. + */ + totalComplete: integer; + + /** + * The current state of the Loader. + */ + readonly state: integer; + + /** + * If you want to append a URL before the path of any asset you can set this here. + * + * Useful if allowing the asset base url to be configured outside of the game code. + * + * Once a base URL is set it will affect every file loaded by the Loader from that point on. It does _not_ change any + * file _already_ being loaded. To reset it, call this method with no arguments. + * @param url The URL to use. Leave empty to reset. + */ + setBaseURL(url?: string): Phaser.Loader.LoaderPlugin; + + /** + * The value of `path`, if set, is placed before any _relative_ file path given. For example: + * + * ```javascript + * this.load.setPath("images/sprites/"); + * this.load.image("ball", "ball.png"); + * this.load.image("tree", "level1/oaktree.png"); + * this.load.image("boom", "http://server.com/explode.png"); + * ``` + * + * Would load the `ball` file from `images/sprites/ball.png` and the tree from + * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL + * given as it's an absolute URL. + * + * Please note that the path is added before the filename but *after* the baseURL (if set.) + * + * Once a path is set it will then affect every file added to the Loader from that point on. It does _not_ change any + * file _already_ in the load queue. To reset it, call this method with no arguments. + * @param path The path to use. Leave empty to reset. + */ + setPath(path?: string): Phaser.Loader.LoaderPlugin; + + /** + * An optional prefix that is automatically prepended to the start of every file key. + * + * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`. + * + * Once a prefix is set it will then affect every file added to the Loader from that point on. It does _not_ change any + * file _already_ in the load queue. To reset it, call this method with no arguments. + * @param prefix The prefix to use. Leave empty to reset. + */ + setPrefix(prefix?: string): Phaser.Loader.LoaderPlugin; + + /** + * Sets the Cross Origin Resource Sharing value used when loading files. + * + * Files can override this value on a per-file basis by specifying an alternative `crossOrigin` value in their file config. + * + * Once CORs is set it will then affect every file loaded by the Loader from that point on, as long as they don't have + * their own CORs setting. To reset it, call this method with no arguments. + * + * For more details about CORs see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS + * @param crossOrigin The value to use for the `crossOrigin` property in the load request. + */ + setCORS(crossOrigin?: string): Phaser.Loader.LoaderPlugin; + + /** + * Adds a file, or array of files, into the load queue. + * + * The file must be an instance of `Phaser.Loader.File`, or a class that extends it. The Loader will check that the key + * used by the file won't conflict with any other key either in the loader, the inflight queue or the target cache. + * If allowed it will then add the file into the pending list, read for the load to start. Or, if the load has already + * started, ready for the next batch of files to be pulled from the list to the inflight queue. + * + * You should not normally call this method directly, but rather use one of the Loader methods like `image` or `atlas`, + * however you can call this as long as the file given to it is well formed. + * @param file The file, or array of files, to be added to the load queue. + */ + addFile(file: Phaser.Loader.File | Phaser.Loader.File[]): void; + + /** + * Checks the key and type of the given file to see if it will conflict with anything already + * in a Cache, the Texture Manager, or the list or inflight queues. + * @param file The file to check the key of. + */ + keyExists(file: Phaser.Loader.File): boolean; + + /** + * Takes a well formed, fully parsed pack file object and adds its entries into the load queue. Usually you do not call + * this method directly, but instead use `Loader.pack` and supply a path to a JSON file that holds the + * pack data. However, if you've got the data prepared you can pass it to this method. + * + * You can also provide an optional key. If you do then it will only add the entries from that part of the pack into + * to the load queue. If not specified it will add all entries it finds. For more details about the pack file format + * see the `LoaderPlugin.pack` method. + * @param data The Pack File data to be parsed and each entry of it to added to the load queue. + * @param packKey An optional key to use from the pack file data. + */ + addPack(data: any, packKey?: string): boolean; + + /** + * Is the Loader actively loading, or processing loaded files? + */ + isLoading(): boolean; + + /** + * Is the Loader ready to start a new load? + */ + isReady(): boolean; + + /** + * Starts the Loader running. This will reset the progress and totals and then emit a `start` event. + * If there is nothing in the queue the Loader will immediately complete, otherwise it will start + * loading the first batch of files. + * + * The Loader is started automatically if the queue is populated within your Scenes `preload` method. + * + * However, outside of this, you need to call this method to start it. + * + * If the Loader is already running this method will simply return. + */ + start(): void; + + /** + * Called automatically during the load process. + * It updates the `progress` value and then emits a progress event, which you can use to + * display a loading bar in your game. + */ + updateProgress(): void; + + /** + * Called automatically during the load process. + */ + update(): void; + + /** + * An internal method called automatically by the XHRLoader belong to a File. + * + * This method will remove the given file from the inflight Set and update the load progress. + * If the file was successful its `onProcess` method is called, otherwise it is added to the delete queue. + * @param file The File that just finished loading, or errored during load. + * @param success `true` if the file loaded successfully, otherwise `false`. + */ + nextFile(file: Phaser.Loader.File, success: boolean): void; + + /** + * An internal method that is called automatically by the File when it has finished processing. + * + * If the process was successful, and the File isn't part of a MultiFile, its `addToCache` method is called. + * + * It this then removed from the queue. If there are no more files to load `loadComplete` is called. + * @param file The file that has finished processing. + */ + fileProcessComplete(file: Phaser.Loader.File): void; + + /** + * Called at the end when the load queue is exhausted and all files have either loaded or errored. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Also clears down the Sets, puts progress to 1 and clears the deletion queue. + */ + loadComplete(): void; + + /** + * Adds a File into the pending-deletion queue. + * @param file The File to be queued for deletion when the Loader completes. + */ + flagForRemoval(file: Phaser.Loader.File): void; + + /** + * Converts the given JSON data into a file that the browser then prompts you to download so you can save it locally. + * + * The data must be well formed JSON and ready-parsed, not a JavaScript object. + * @param data The JSON data, ready parsed. + * @param filename The name to save the JSON file as. Default file.json. + */ + saveJSON(data: any, filename?: string): Phaser.Loader.LoaderPlugin; + + /** + * Causes the browser to save the given data as a file to its default Downloads folder. + * + * Creates a DOM level anchor link, assigns it as being a `download` anchor, sets the href + * to be an ObjectURL based on the given data, and then invokes a click event. + * @param data The data to be saved. Will be passed through URL.createObjectURL. + * @param filename The filename to save the file as. Default file.json. + * @param filetype The file type to use when saving the file. Defaults to JSON. Default application/json. + */ + save(data: any, filename?: string, filetype?: string): Phaser.Loader.LoaderPlugin; + + /** + * Resets the Loader. + * + * This will clear all lists and reset the base URL, path and prefix. + * + * Warning: If the Loader is currently downloading files, or has files in its queue, they will be aborted. + */ + reset(): void; + + } + + /** + * Takes two XHRSettings Objects and creates a new XHRSettings object from them. + * + * The new object is seeded by the values given in the global settings, but any setting in + * the local object overrides the global ones. + * @param global The global XHRSettings object. + * @param local The local XHRSettings object. + */ + function MergeXHRSettings(global: Phaser.Types.Loader.XHRSettingsObject, local: Phaser.Types.Loader.XHRSettingsObject): Phaser.Types.Loader.XHRSettingsObject; + + /** + * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after + * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. + * + * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. + */ + class MultiFile { + /** + * + * @param loader The Loader that is going to load this File. + * @param type The file type string for sorting within the Loader. + * @param key The key of the file within the loader. + * @param files An array of Files that make-up this MultiFile. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, type: string, key: string, files: Phaser.Loader.File[]); + + /** + * A reference to the Loader that is going to load this file. + */ + loader: Phaser.Loader.LoaderPlugin; + + /** + * The file type string for sorting within the Loader. + */ + type: string; + + /** + * Unique cache key (unique within its file type) + */ + key: string; + + /** + * Array of files that make up this MultiFile. + */ + files: Phaser.Loader.File[]; + + /** + * The completion status of this MultiFile. + */ + complete: boolean; + + /** + * The number of files to load. + */ + pending: integer; + + /** + * The number of files that failed to load. + */ + failed: integer; + + /** + * A storage container for transient data that the loading files need. + */ + config: any; + + /** + * Checks if this MultiFile is ready to process its children or not. + */ + isReadyToProcess(): boolean; + + /** + * Adds another child to this MultiFile, increases the pending count and resets the completion status. + * @param files The File to add to this MultiFile. + */ + addToMultiFile(files: Phaser.Loader.File): Phaser.Loader.MultiFile; + + /** + * Called by each File when it finishes loading. + * @param file The File that has completed processing. + */ + onFileComplete(file: Phaser.Loader.File): void; + + /** + * Called by each File that fails to load. + * @param file The File that has failed to load. + */ + onFileFailed(file: Phaser.Loader.File): void; + + } + + /** + * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings + * and starts the download of it. It uses the Files own XHRSettings and merges them + * with the global XHRSettings object to set the xhr values before download. + * @param file The File to download. + * @param globalXHRSettings The global XHRSettings object. + */ + function XHRLoader(file: Phaser.Loader.File, globalXHRSettings: Phaser.Types.Loader.XHRSettingsObject): XMLHttpRequest; + + /** + * Creates an XHRSettings Object with default values. + * @param responseType The responseType, such as 'text'. Default ''. + * @param async Should the XHR request use async or not? Default true. + * @param user Optional username for the XHR request. Default ''. + * @param password Optional password for the XHR request. Default ''. + * @param timeout Optional XHR timeout value. Default 0. + */ + function XHRSettings(responseType?: XMLHttpRequestResponseType, async?: boolean, user?: string, password?: string, timeout?: integer): Phaser.Types.Loader.XHRSettingsObject; + + } + + namespace Math { + namespace Angle { + /** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Between(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * Calculates the angle of the vector from the first point to the second point. + * @param point1 The first point. + * @param point2 The second point. + */ + function BetweenPoints(point1: Phaser.Geom.Point | object, point2: Phaser.Geom.Point | object): number; + + /** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate + * travels down the screen. + * @param point1 The first point. + * @param point2 The second point. + */ + function BetweenPointsY(point1: Phaser.Geom.Point | object, point2: Phaser.Geom.Point | object): number; + + /** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate + * travels down the screen. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function BetweenY(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Takes an angle in Phasers default clockwise format and converts it so that + * 0 is North, 90 is West, 180 is South and 270 is East, + * therefore running counter-clockwise instead of clockwise. + * + * You can pass in the angle from a Game Object using: + * + * ```javascript + * var converted = CounterClockwise(gameobject.rotation); + * ``` + * + * All values for this function are in radians. + * @param angle The angle to convert, in radians. + */ + function CounterClockwise(angle: number): number; + + /** + * Normalize an angle to the [0, 2pi] range. + * @param angle The angle to normalize, in radians. + */ + function Normalize(angle: number): number; + + /** + * Reverse the given angle. + * @param angle The angle to reverse, in radians. + */ + function Reverse(angle: number): number; + + /** + * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. + * @param currentAngle The current angle, in radians. + * @param targetAngle The target angle to rotate to, in radians. + * @param lerp The lerp value to add to the current angle. Default 0.05. + */ + function RotateTo(currentAngle: number, targetAngle: number, lerp?: number): number; + + /** + * Gets the shortest angle between `angle1` and `angle2`. + * + * Both angles must be in the range -180 to 180, which is the same clamped + * range that `sprite.angle` uses, so you can pass in two sprite angles to + * this method and get the shortest angle back between the two of them. + * + * The angle returned will be in the same range. If the returned angle is + * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's + * a clockwise rotation. + * + * TODO: Wrap the angles in this function? + * @param angle1 The first angle in the range -180 to 180. + * @param angle2 The second angle in the range -180 to 180. + */ + function ShortestBetween(angle1: number, angle2: number): number; + + /** + * Wrap an angle. + * + * Wraps the angle to a value in the range of -PI to PI. + * @param angle The angle to wrap, in radians. + */ + function Wrap(angle: number): number; + + /** + * Wrap an angle in degrees. + * + * Wraps the angle to a value in the range of -180 to 180. + * @param angle The angle to wrap, in degrees. + */ + function WrapDegrees(angle: number): number; + + } + + /** + * Calculate the mean average of the given values. + * @param values The values to average. + */ + function Average(values: number[]): number; + + /** + * [description] + * @param n [description] + * @param i [description] + */ + function Bernstein(n: number, i: number): number; + + /** + * Compute a random integer between the `min` and `max` values, inclusive. + * @param min The minimum value. + * @param max The maximum value. + */ + function Between(min: integer, max: integer): integer; + + /** + * Calculates a Catmull-Rom value. + * @param t [description] + * @param p0 [description] + * @param p1 [description] + * @param p2 [description] + * @param p3 [description] + */ + function CatmullRom(t: number, p0: number, p1: number, p2: number, p3: number): number; + + /** + * Ceils to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * @param value The value to round. + * @param place The place to round to. Default 0. + * @param base The base to round in. Default is 10 for decimal. Default 10. + */ + function CeilTo(value: number, place?: number, base?: integer): number; + + /** + * Force a value within the boundaries by clamping it to the range `min`, `max`. + * @param value The value to be clamped. + * @param min The minimum bounds. + * @param max The maximum bounds. + */ + function Clamp(value: number, min: number, max: number): number; + + /** + * The value of PI * 2. + */ + var PI2: number; + + /** + * The value of PI * 0.5. + */ + var TAU: number; + + /** + * An epsilon value (1.0e-6) + */ + var EPSILON: number; + + /** + * For converting degrees to radians (PI / 180) + */ + var DEG_TO_RAD: number; + + /** + * For converting radians to degrees (180 / PI) + */ + var RAD_TO_DEG: number; + + /** + * An instance of the Random Number Generator. + * This is not set until the Game boots. + */ + var RND: Phaser.Math.RandomDataGenerator; + + /** + * Convert the given angle from degrees, to the equivalent angle in radians. + * @param degrees The angle (in degrees) to convert to radians. + */ + function DegToRad(degrees: integer): number; + + /** + * Calculates the positive difference of two given numbers. + * @param a The first number in the calculation. + * @param b The second number in the calculation. + */ + function Difference(a: number, b: number): number; + + namespace Distance { + /** + * Calculate the distance between two sets of coordinates (points). + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Between(x1: number, y1: number, x2: number, y2: number): number; + + /** + * Calculate the distance between two sets of coordinates (points) to the power of `pow`. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + * @param pow The exponent. + */ + function Power(x1: number, y1: number, x2: number, y2: number, pow: number): number; + + /** + * Calculate the distance between two sets of coordinates (points), squared. + * @param x1 The x coordinate of the first point. + * @param y1 The y coordinate of the first point. + * @param x2 The x coordinate of the second point. + * @param y2 The y coordinate of the second point. + */ + function Squared(x1: number, y1: number, x2: number, y2: number): number; + + } + + namespace Easing { + namespace Back { + /** + * Back ease-in. + * @param v The value to be tweened. + * @param overshoot The overshoot amount. Default 1.70158. + */ + function In(v: number, overshoot?: number): number; + + /** + * Back ease-in/out. + * @param v The value to be tweened. + * @param overshoot The overshoot amount. Default 1.70158. + */ + function InOut(v: number, overshoot?: number): number; + + /** + * Back ease-out. + * @param v The value to be tweened. + * @param overshoot The overshoot amount. Default 1.70158. + */ + function Out(v: number, overshoot?: number): number; + + } + + namespace Bounce { + /** + * Bounce ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Bounce ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Bounce ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Circular { + /** + * Circular ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Circular ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Circular ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Cubic { + /** + * Cubic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Cubic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Cubic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Elastic { + /** + * Elastic ease-in. + * @param v The value to be tweened. + * @param amplitude The amplitude of the elastic ease. Default 0.1. + * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. + */ + function In(v: number, amplitude?: number, period?: number): number; + + /** + * Elastic ease-in/out. + * @param v The value to be tweened. + * @param amplitude The amplitude of the elastic ease. Default 0.1. + * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. + */ + function InOut(v: number, amplitude?: number, period?: number): number; + + /** + * Elastic ease-out. + * @param v The value to be tweened. + * @param amplitude The amplitude of the elastic ease. Default 0.1. + * @param period Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. Default 0.1. + */ + function Out(v: number, amplitude?: number, period?: number): number; + + } + + namespace Expo { + /** + * Exponential ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Exponential ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Exponential ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Linear { + /** + * Linear easing (no variation). + * @param v The value to be tweened. + */ + function Linear(v: number): number; + + } + + namespace Quadratic { + /** + * Quadratic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Quadratic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Quadratic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Quartic { + /** + * Quartic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Quartic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Quartic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Quintic { + /** + * Quintic ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Quintic ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Quintic ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Sine { + /** + * Sinusoidal ease-in. + * @param v The value to be tweened. + */ + function In(v: number): number; + + /** + * Sinusoidal ease-in/out. + * @param v The value to be tweened. + */ + function InOut(v: number): number; + + /** + * Sinusoidal ease-out. + * @param v The value to be tweened. + */ + function Out(v: number): number; + + } + + namespace Stepped { + /** + * Stepped easing. + * @param v The value to be tweened. + * @param steps The number of steps in the ease. Default 1. + */ + function Stepped(v: number, steps?: number): number; + + } + + } + + /** + * Calculates the factorial of a given number for integer values greater than 0. + * @param value A positive integer to calculate the factorial of. + */ + function Factorial(value: number): number; + + /** + * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive. + * @param min The lower bound for the float, inclusive. + * @param max The upper bound for the float exclusive. + */ + function FloatBetween(min: number, max: number): number; + + /** + * Floors to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * @param value The value to round. + * @param place The place to round to. Default 0. + * @param base The base to round in. Default is 10 for decimal. Default 10. + */ + function FloorTo(value: number, place?: integer, base?: integer): number; + + /** + * Return a value based on the range between `min` and `max` and the percentage given. + * @param percent A value between 0 and 1 representing the percentage. + * @param min The minimum value. + * @param max The maximum value. + */ + function FromPercent(percent: number, min: number, max?: number): number; + + namespace Fuzzy { + /** + * Calculate the fuzzy ceiling of the given value. + * @param value The value. + * @param epsilon The epsilon. Default 0.0001. + */ + function Ceil(value: number, epsilon?: number): number; + + /** + * Check whether the given values are fuzzily equal. + * + * Two numbers are fuzzily equal if their difference is less than `epsilon`. + * @param a The first value. + * @param b The second value. + * @param epsilon The epsilon. Default 0.0001. + */ + function Equal(a: number, b: number, epsilon?: number): boolean; + + /** + * Calculate the fuzzy floor of the given value. + * @param value The value. + * @param epsilon The epsilon. Default 0.0001. + */ + function Floor(value: number, epsilon?: number): number; + + /** + * Check whether `a` is fuzzily greater than `b`. + * + * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. + * @param a The first value. + * @param b The second value. + * @param epsilon The epsilon. Default 0.0001. + */ + function GreaterThan(a: number, b: number, epsilon?: number): boolean; + + /** + * Check whether `a` is fuzzily less than `b`. + * + * `a` is fuzzily less than `b` if it is less than `b + epsilon`. + * @param a The first value. + * @param b The second value. + * @param epsilon The epsilon. Default 0.0001. + */ + function LessThan(a: number, b: number, epsilon?: number): boolean; + + } + + /** + * Calculate the speed required to cover a distance in the time given. + * @param distance The distance to travel in pixels. + * @param time The time, in ms, to cover the distance in. + */ + function GetSpeed(distance: number, time: integer): number; + + namespace Interpolation { + /** + * A bezier interpolation method. + * @param v The input array of values to interpolate between. + * @param k The percentage of interpolation, between 0 and 1. + */ + function Bezier(v: number[], k: number): number; + + /** + * A Catmull-Rom interpolation method. + * @param v The input array of values to interpolate between. + * @param k The percentage of interpolation, between 0 and 1. + */ + function CatmullRom(v: number[], k: number): number; + + /** + * A cubic bezier interpolation method. + * + * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a + * @param t The percentage of interpolation, between 0 and 1. + * @param p0 The start point. + * @param p1 The first control point. + * @param p2 The second control point. + * @param p3 The end point. + */ + function CubicBezier(t: number, p0: number, p1: number, p2: number, p3: number): number; + + /** + * A linear interpolation method. + * @param v The input array of values to interpolate between. + * @param k The percentage of interpolation, between 0 and 1. + */ + function Linear(v: number[], k: number): number; + + /** + * A quadratic bezier interpolation method. + * @param t The percentage of interpolation, between 0 and 1. + * @param p0 The start point. + * @param p1 The control point. + * @param p2 The end point. + */ + function QuadraticBezier(t: number, p0: number, p1: number, p2: number): number; + + /** + * A Smoother Step interpolation method. + * @param t The percentage of interpolation, between 0 and 1. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmootherStep(t: number, min: number, max: number): number; + + /** + * A Smooth Step interpolation method. + * @param t The percentage of interpolation, between 0 and 1. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmoothStep(t: number, min: number, max: number): number; + + } + + /** + * Check if a given value is an even number. + * @param value The number to perform the check with. + */ + function IsEven(value: number): boolean; + + /** + * Check if a given value is an even number using a strict type check. + * @param value The number to perform the check with. + */ + function IsEvenStrict(value: number): boolean; + + /** + * Calculates a linear (interpolation) value over t. + * @param p0 The first point. + * @param p1 The second point. + * @param t The percentage between p0 and p1 to return, represented as a number between 0 and 1. + */ + function Linear(p0: number, p1: number, t: number): number; + + /** + * A three-dimensional matrix. + * + * Defaults to the identity matrix when instantiated. + */ + class Matrix3 { + /** + * + * @param m Optional Matrix3 to copy values from. + */ + constructor(m?: Phaser.Math.Matrix3); + + /** + * The matrix values. + */ + val: Float32Array; + + /** + * Make a clone of this Matrix3. + */ + clone(): Phaser.Math.Matrix3; + + /** + * This method is an alias for `Matrix3.copy`. + * @param src The Matrix to set the values of this Matrix's from. + */ + set(src: Phaser.Math.Matrix3): Phaser.Math.Matrix3; + + /** + * Copy the values of a given Matrix into this Matrix. + * @param src The Matrix to copy the values from. + */ + copy(src: Phaser.Math.Matrix3): Phaser.Math.Matrix3; + + /** + * Copy the values of a given Matrix4 into this Matrix3. + * @param m The Matrix4 to copy the values from. + */ + fromMat4(m: Phaser.Math.Matrix4): Phaser.Math.Matrix3; + + /** + * Set the values of this Matrix from the given array. + * @param a The array to copy the values from. + */ + fromArray(a: any[]): Phaser.Math.Matrix3; + + /** + * Reset this Matrix to an identity (default) matrix. + */ + identity(): Phaser.Math.Matrix3; + + /** + * Transpose this Matrix. + */ + transpose(): Phaser.Math.Matrix3; + + /** + * Invert this Matrix. + */ + invert(): Phaser.Math.Matrix3; + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + */ + adjoint(): Phaser.Math.Matrix3; + + /** + * Calculate the determinant of this Matrix. + */ + determinant(): number; + + /** + * Multiply this Matrix by the given Matrix. + * @param src The Matrix to multiply this Matrix by. + */ + multiply(src: Phaser.Math.Matrix3): Phaser.Math.Matrix3; + + /** + * Translate this Matrix using the given Vector. + * @param v The Vector to translate this Matrix with. + */ + translate(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Matrix3; + + /** + * Apply a rotation transformation to this Matrix. + * @param rad The angle in radians to rotate by. + */ + rotate(rad: number): Phaser.Math.Matrix3; + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x` and `y` components of the given Vector to scale the Matrix. + * @param v The Vector to scale this Matrix with. + */ + scale(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Matrix3; + + /** + * Set the values of this Matrix from the given Quaternion. + * @param q The Quaternion to set the values of this Matrix from. + */ + fromQuat(q: Phaser.Math.Quaternion): Phaser.Math.Matrix3; + + /** + * [description] + * @param m [description] + */ + normalFromMat4(m: Phaser.Math.Matrix4): Phaser.Math.Matrix3; + + } + + /** + * A four-dimensional matrix. + */ + class Matrix4 { + /** + * + * @param m Optional Matrix4 to copy values from. + */ + constructor(m?: Phaser.Math.Matrix4); + + /** + * The matrix values. + */ + val: Float32Array; + + /** + * Make a clone of this Matrix4. + */ + clone(): Phaser.Math.Matrix4; + + /** + * This method is an alias for `Matrix4.copy`. + * @param src The Matrix to set the values of this Matrix's from. + */ + set(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + /** + * Copy the values of a given Matrix into this Matrix. + * @param src The Matrix to copy the values from. + */ + copy(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + /** + * Set the values of this Matrix from the given array. + * @param a The array to copy the values from. + */ + fromArray(a: any[]): Phaser.Math.Matrix4; + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + */ + zero(): Phaser.Math.Matrix4; + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * @param x The x value. + * @param y The y value. + * @param z The z value. + */ + xyz(x: number, y: number, z: number): Phaser.Math.Matrix4; + + /** + * Set the scaling values of this Matrix. + * @param x The x scaling value. + * @param y The y scaling value. + * @param z The z scaling value. + */ + scaling(x: number, y: number, z: number): Phaser.Math.Matrix4; + + /** + * Reset this Matrix to an identity (default) matrix. + */ + identity(): Phaser.Math.Matrix4; + + /** + * Transpose this Matrix. + */ + transpose(): Phaser.Math.Matrix4; + + /** + * Invert this Matrix. + */ + invert(): Phaser.Math.Matrix4; + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + */ + adjoint(): Phaser.Math.Matrix4; + + /** + * Calculate the determinant of this Matrix. + */ + determinant(): number; + + /** + * Multiply this Matrix by the given Matrix. + * @param src The Matrix to multiply this Matrix by. + */ + multiply(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + /** + * [description] + * @param src [description] + */ + multiplyLocal(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + /** + * Translate this Matrix using the given Vector. + * @param v The Vector to translate this Matrix with. + */ + translate(v: Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Matrix4; + + /** + * Translate this Matrix using the given values. + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + translateXYZ(x: number, y: number, z: number): Phaser.Math.Matrix4; + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * @param v The Vector to scale this Matrix with. + */ + scale(v: Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Matrix4; + + /** + * Apply a scale transformation to this Matrix. + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + scaleXYZ(x: number, y: number, z: number): Phaser.Math.Matrix4; + + /** + * Derive a rotation matrix around the given axis. + * @param axis The rotation axis. + * @param angle The rotation angle in radians. + */ + makeRotationAxis(axis: Phaser.Math.Vector3 | Phaser.Math.Vector4, angle: number): Phaser.Math.Matrix4; + + /** + * Apply a rotation transformation to this Matrix. + * @param rad The angle in radians to rotate by. + * @param axis The axis to rotate upon. + */ + rotate(rad: number, axis: Phaser.Math.Vector3): Phaser.Math.Matrix4; + + /** + * Rotate this matrix on its X axis. + * @param rad The angle in radians to rotate by. + */ + rotateX(rad: number): Phaser.Math.Matrix4; + + /** + * Rotate this matrix on its Y axis. + * @param rad The angle to rotate by, in radians. + */ + rotateY(rad: number): Phaser.Math.Matrix4; + + /** + * Rotate this matrix on its Z axis. + * @param rad The angle to rotate by, in radians. + */ + rotateZ(rad: number): Phaser.Math.Matrix4; + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * @param q The Quaternion to set rotation from. + * @param v The Vector to set translation from. + */ + fromRotationTranslation(q: Phaser.Math.Quaternion, v: Phaser.Math.Vector3): Phaser.Math.Matrix4; + + /** + * Set the values of this Matrix from the given Quaternion. + * @param q The Quaternion to set the values of this Matrix from. + */ + fromQuat(q: Phaser.Math.Quaternion): Phaser.Math.Matrix4; + + /** + * Generate a frustum matrix with the given bounds. + * @param left The left bound of the frustum. + * @param right The right bound of the frustum. + * @param bottom The bottom bound of the frustum. + * @param top The top bound of the frustum. + * @param near The near bound of the frustum. + * @param far The far bound of the frustum. + */ + frustum(left: number, right: number, bottom: number, top: number, near: number, far: number): Phaser.Math.Matrix4; + + /** + * Generate a perspective projection matrix with the given bounds. + * @param fovy Vertical field of view in radians + * @param aspect Aspect ratio. Typically viewport width /height. + * @param near Near bound of the frustum. + * @param far Far bound of the frustum. + */ + perspective(fovy: number, aspect: number, near: number, far: number): Phaser.Math.Matrix4; + + /** + * Generate a perspective projection matrix with the given bounds. + * @param width The width of the frustum. + * @param height The height of the frustum. + * @param near Near bound of the frustum. + * @param far Far bound of the frustum. + */ + perspectiveLH(width: number, height: number, near: number, far: number): Phaser.Math.Matrix4; + + /** + * Generate an orthogonal projection matrix with the given bounds. + * @param left The left bound of the frustum. + * @param right The right bound of the frustum. + * @param bottom The bottom bound of the frustum. + * @param top The top bound of the frustum. + * @param near The near bound of the frustum. + * @param far The far bound of the frustum. + */ + ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): Phaser.Math.Matrix4; + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * @param eye Position of the viewer + * @param center Point the viewer is looking at + * @param up vec3 pointing up. + */ + lookAt(eye: Phaser.Math.Vector3, center: Phaser.Math.Vector3, up: Phaser.Math.Vector3): Phaser.Math.Matrix4; + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * @param yaw [description] + * @param pitch [description] + * @param roll [description] + */ + yawPitchRoll(yaw: number, pitch: number, roll: number): Phaser.Math.Matrix4; + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * @param rotation The rotation of the world matrix. + * @param position The position of the world matrix. + * @param scale The scale of the world matrix. + * @param viewMatrix The view matrix. + * @param projectionMatrix The projection matrix. + */ + setWorldMatrix(rotation: Phaser.Math.Vector3, position: Phaser.Math.Vector3, scale: Phaser.Math.Vector3, viewMatrix?: Phaser.Math.Matrix4, projectionMatrix?: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + } + + /** + * Add an `amount` to a `value`, limiting the maximum result to `max`. + * @param value The value to add to. + * @param amount The amount to add. + * @param max The maximum value to return. + */ + function MaxAdd(value: number, amount: number, max: number): number; + + /** + * Subtract an `amount` from `value`, limiting the minimum result to `min`. + * @param value The value to subtract from. + * @param amount The amount to subtract. + * @param min The minimum value to return. + */ + function MinSub(value: number, amount: number, min: number): number; + + /** + * Work out what percentage `value` is of the range between `min` and `max`. + * If `max` isn't given then it will return the percentage of `value` to `min`. + * + * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again. + * @param value The value to determine the percentage of. + * @param min The minimum value. + * @param max The maximum value. + * @param upperMax The mid-way point in the range that represents 100%. + */ + function Percent(value: number, min: number, max?: number, upperMax?: number): number; + + namespace Pow2 { + /** + * Returns the nearest power of 2 to the given `value`. + * @param value The value. + */ + function GetPowerOfTwo(value: number): integer; + + /** + * Checks if the given `width` and `height` are a power of two. + * Useful for checking texture dimensions. + * @param width The width. + * @param height The height. + */ + function IsSizePowerOfTwo(width: number, height: number): boolean; + + /** + * Tests the value and returns `true` if it is a power of two. + * @param value The value to check if it's a power of two. + */ + function IsValuePowerOfTwo(value: number): boolean; + + } + + /** + * A quaternion. + */ + class Quaternion { + /** + * + * @param x The x component. + * @param y The y component. + * @param z The z component. + * @param w The w component. + */ + constructor(x?: number, y?: number, z?: number, w?: number); + + /** + * The x component of this Quaternion. + */ + x: number; + + /** + * The y component of this Quaternion. + */ + y: number; + + /** + * The z component of this Quaternion. + */ + z: number; + + /** + * The w component of this Quaternion. + */ + w: number; + + /** + * Copy the components of a given Quaternion or Vector into this Quaternion. + * @param src The Quaternion or Vector to copy the components from. + */ + copy(src: Phaser.Math.Quaternion | Phaser.Math.Vector4): Phaser.Math.Quaternion; + + /** + * Set the components of this Quaternion. + * @param x The x component, or an object containing x, y, z, and w components. Default 0. + * @param y The y component. Default 0. + * @param z The z component. Default 0. + * @param w The w component. Default 0. + */ + set(x?: number | object, y?: number, z?: number, w?: number): Phaser.Math.Quaternion; + + /** + * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. + * @param v The Quaternion or Vector to add to this Quaternion. + */ + add(v: Phaser.Math.Quaternion | Phaser.Math.Vector4): Phaser.Math.Quaternion; + + /** + * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. + * @param v The Quaternion or Vector to subtract from this Quaternion. + */ + subtract(v: Phaser.Math.Quaternion | Phaser.Math.Vector4): Phaser.Math.Quaternion; + + /** + * Scale this Quaternion by the given value. + * @param scale The value to scale this Quaternion by. + */ + scale(scale: number): Phaser.Math.Quaternion; + + /** + * Calculate the length of this Quaternion. + */ + length(): number; + + /** + * Calculate the length of this Quaternion squared. + */ + lengthSq(): number; + + /** + * Normalize this Quaternion. + */ + normalize(): Phaser.Math.Quaternion; + + /** + * Calculate the dot product of this Quaternion and the given Quaternion or Vector. + * @param v The Quaternion or Vector to dot product with this Quaternion. + */ + dot(v: Phaser.Math.Quaternion | Phaser.Math.Vector4): number; + + /** + * Linearly interpolate this Quaternion towards the given Quaternion or Vector. + * @param v The Quaternion or Vector to interpolate towards. + * @param t The percentage of interpolation. Default 0. + */ + lerp(v: Phaser.Math.Quaternion | Phaser.Math.Vector4, t?: number): Phaser.Math.Quaternion; + + /** + * [description] + * @param a [description] + * @param b [description] + */ + rotationTo(a: Phaser.Math.Vector3, b: Phaser.Math.Vector3): Phaser.Math.Quaternion; + + /** + * Set the axes of this Quaternion. + * @param view The view axis. + * @param right The right axis. + * @param up The upwards axis. + */ + setAxes(view: Phaser.Math.Vector3, right: Phaser.Math.Vector3, up: Phaser.Math.Vector3): Phaser.Math.Quaternion; + + /** + * Reset this Matrix to an identity (default) Quaternion. + */ + identity(): Phaser.Math.Quaternion; + + /** + * Set the axis angle of this Quaternion. + * @param axis The axis. + * @param rad The angle in radians. + */ + setAxisAngle(axis: Phaser.Math.Vector3, rad: number): Phaser.Math.Quaternion; + + /** + * Multiply this Quaternion by the given Quaternion or Vector. + * @param b The Quaternion or Vector to multiply this Quaternion by. + */ + multiply(b: Phaser.Math.Quaternion | Phaser.Math.Vector4): Phaser.Math.Quaternion; + + /** + * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. + * @param b The Quaternion or Vector to interpolate towards. + * @param t The percentage of interpolation. + */ + slerp(b: Phaser.Math.Quaternion | Phaser.Math.Vector4, t: number): Phaser.Math.Quaternion; + + /** + * Invert this Quaternion. + */ + invert(): Phaser.Math.Quaternion; + + /** + * Convert this Quaternion into its conjugate. + * + * Sets the x, y and z components. + */ + conjugate(): Phaser.Math.Quaternion; + + /** + * Rotate this Quaternion on the X axis. + * @param rad The rotation angle in radians. + */ + rotateX(rad: number): Phaser.Math.Quaternion; + + /** + * Rotate this Quaternion on the Y axis. + * @param rad The rotation angle in radians. + */ + rotateY(rad: number): Phaser.Math.Quaternion; + + /** + * Rotate this Quaternion on the Z axis. + * @param rad The rotation angle in radians. + */ + rotateZ(rad: number): Phaser.Math.Quaternion; + + /** + * Create a unit (or rotation) Quaternion from its x, y, and z components. + * + * Sets the w component. + */ + calculateW(): Phaser.Math.Quaternion; + + /** + * Convert the given Matrix into this Quaternion. + * @param mat The Matrix to convert from. + */ + fromMat3(mat: Phaser.Math.Matrix3): Phaser.Math.Quaternion; + + } + + /** + * Convert the given angle in radians, to the equivalent angle in degrees. + * @param radians The angle in radians to convert ot degrees. + */ + function RadToDeg(radians: number): integer; + + /** + * A seeded Random Data Generator. + * + * Access via `Phaser.Math.RND` which is an instance of this class pre-defined + * by Phaser. Or, create your own instance to use as you require. + * + * The `Math.RND` generator is seeded by the Game Config property value `seed`. + * If no such config property exists, a random number is used. + * + * If you create your own instance of this class you should provide a seed for it. + * If no seed is given it will use a 'random' one based on Date.now. + */ + class RandomDataGenerator { + /** + * + * @param seeds The seeds to use for the random number generator. + */ + constructor(seeds?: string | string[]); + + /** + * Signs to choose from. + */ + signs: number[]; + + /** + * Initialize the state of the random data generator. + * @param seeds The seeds to initialize the random data generator with. + */ + init(seeds: string | string[]): void; + + /** + * Reset the seed of the random data generator. + * + * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. + * @param seeds The array of seeds: the `toString()` of each value is used. + */ + sow(seeds: string[]): void; + + /** + * Returns a random integer between 0 and 2^32. + */ + integer(): number; + + /** + * Returns a random real number between 0 and 1. + */ + frac(): number; + + /** + * Returns a random real number between 0 and 2^32. + */ + real(): number; + + /** + * Returns a random integer between and including min and max. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + integerInRange(min: number, max: number): number; + + /** + * Returns a random integer between and including min and max. + * This method is an alias for RandomDataGenerator.integerInRange. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + between(min: number, max: number): number; + + /** + * Returns a random real number between min and max. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + realInRange(min: number, max: number): number; + + /** + * Returns a random real number between -1 and 1. + */ + normal(): number; + + /** + * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 + */ + uuid(): string; + + /** + * Returns a random element from within the given array. + * @param array The array to pick a random element from. + */ + pick(array: any[]): any; + + /** + * Returns a sign to be used with multiplication operator. + */ + sign(): number; + + /** + * Returns a random element from within the given array, favoring the earlier entries. + * @param array The array to pick a random element from. + */ + weightedPick(array: any[]): any; + + /** + * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. + * @param min The minimum value in the range. + * @param max The maximum value in the range. + */ + timestamp(min: number, max: number): number; + + /** + * Returns a random angle between -180 and 180. + */ + angle(): number; + + /** + * Returns a random rotation in radians, between -3.141 and 3.141 + */ + rotation(): number; + + /** + * Gets or Sets the state of the generator. This allows you to retain the values + * that the generator is using between games, i.e. in a game save file. + * + * To seed this generator with a previously saved state you can pass it as the + * `seed` value in your game config, or call this method directly after Phaser has booted. + * + * Call this method with no parameters to return the current state. + * + * If providing a state it should match the same format that this method + * returns, which is a string with a header `!rnd` followed by the `c`, + * `s0`, `s1` and `s2` values respectively, each comma-delimited. + * @param state Generator state to be set. + */ + state(state?: string): string; + + /** + * Shuffles the given array, using the current seed. + * @param array The array to be shuffled. + */ + shuffle(array?: any[]): any[]; + + } + + /** + * Compute a random unit vector. + * + * Computes random values for the given vector between -1 and 1 that can be used to represent a direction. + * + * Optionally accepts a scale value to scale the resulting vector by. + * @param vector The Vector to compute random values for. + * @param scale The scale of the random values. Default 1. + */ + function RandomXY(vector: Phaser.Math.Vector2, scale?: number): Phaser.Math.Vector2; + + /** + * Compute a random position vector in a spherical area, optionally defined by the given radius. + * @param vec3 The Vector to compute random values for. + * @param radius The radius. Default 1. + */ + function RandomXYZ(vec3: Phaser.Math.Vector3, radius?: number): Phaser.Math.Vector3; + + /** + * Compute a random four-dimensional vector. + * @param vec4 The Vector to compute random values for. + * @param scale The scale of the random values. Default 1. + */ + function RandomXYZW(vec4: Phaser.Math.Vector4, scale?: number): Phaser.Math.Vector4; + + /** + * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction. + * @param point The point to be rotated. + * @param angle The angle to be rotated by in an anticlockwise direction. + */ + function Rotate(point: Phaser.Geom.Point | object, angle: number): Phaser.Geom.Point; + + /** + * Rotate a `point` around `x` and `y` by the given `angle`. + * @param point The point to be rotated. + * @param x The horizontal coordinate to rotate around. + * @param y The vertical coordinate to rotate around. + * @param angle The angle of rotation in radians. + */ + function RotateAround(point: Phaser.Geom.Point | object, x: number, y: number, angle: number): Phaser.Geom.Point; + + /** + * Rotate a `point` around `x` and `y` by the given `angle` and `distance`. + * @param point The point to be rotated. + * @param x The horizontal coordinate to rotate around. + * @param y The vertical coordinate to rotate around. + * @param angle The angle of rotation in radians. + * @param distance The distance from (x, y) to place the point at. + */ + function RotateAroundDistance(point: Phaser.Geom.Point | object, x: number, y: number, angle: number, distance: number): Phaser.Geom.Point; + + /** + * Rotates a vector in place by axis angle. + * + * This is the same as transforming a point by an + * axis-angle quaternion, but it has higher precision. + * @param vec The vector to be rotated. + * @param axis The axis to rotate around. + * @param radians The angle of rotation in radians. + */ + function RotateVec3(vec: Phaser.Math.Vector3, axis: Phaser.Math.Vector3, radians: number): Phaser.Math.Vector3; + + /** + * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. + * @param value The number to round. + */ + function RoundAwayFromZero(value: number): number; + + /** + * Round a value to the given precision. + * + * For example: + * + * ```javascript + * RoundTo(123.456, 0) = 123 + * RoundTo(123.456, 1) = 120 + * RoundTo(123.456, 2) = 100 + * ``` + * + * To round the decimal, i.e. to round to precision, pass in a negative `place`: + * + * ```javascript + * RoundTo(123.456789, 0) = 123 + * RoundTo(123.456789, -1) = 123.5 + * RoundTo(123.456789, -2) = 123.46 + * RoundTo(123.456789, -3) = 123.457 + * ``` + * @param value The value to round. + * @param place The place to round to. Positive to round the units, negative to round the decimal. Default 0. + * @param base The base to round in. Default is 10 for decimal. Default 10. + */ + function RoundTo(value: number, place?: integer, base?: integer): number; + + /** + * Generate a series of sine and cosine values. + * @param length The number of values to generate. + * @param sinAmp The sine value amplitude. Default 1. + * @param cosAmp The cosine value amplitude. Default 1. + * @param frequency The frequency of the values. Default 1. + */ + function SinCosTableGenerator(length: number, sinAmp?: number, cosAmp?: number, frequency?: number): Phaser.Types.Math.SinCosTable; + + /** + * Calculate a smoother interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. + * @param x The input value. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmootherStep(x: number, min: number, max: number): number; + + /** + * Calculate a smooth interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * @param x The input value. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + */ + function SmoothStep(x: number, min: number, max: number): number; + + namespace Snap { + /** + * Snap a value to nearest grid slice, using ceil. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. + * As will `14` snap to `15`... but `16` will snap to `20`. + * @param value The value to snap. + * @param gap The interval gap of the grid. + * @param start Optional starting offset for gap. Default 0. + * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. + */ + function Ceil(value: number, gap: number, start?: number, divide?: boolean): number; + + /** + * Snap a value to nearest grid slice, using floor. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. + * As will `14` snap to `10`... but `16` will snap to `15`. + * @param value The value to snap. + * @param gap The interval gap of the grid. + * @param start Optional starting offset for gap. Default 0. + * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. + */ + function Floor(value: number, gap: number, start?: number, divide?: boolean): number; + + /** + * Snap a value to nearest grid slice, using rounding. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. + * @param value The value to snap. + * @param gap The interval gap of the grid. + * @param start Optional starting offset for gap. Default 0. + * @param divide If `true` it will divide the snapped value by the gap before returning. Default false. + */ + function To(value: number, gap: number, start?: number, divide?: boolean): number; + + } + + /** + * Takes the `x` and `y` coordinates and transforms them into the same space as + * defined by the position, rotation and scale values. + * @param x The x coordinate to be transformed. + * @param y The y coordinate to be transformed. + * @param positionX Horizontal position of the transform point. + * @param positionY Vertical position of the transform point. + * @param rotation Rotation of the transform point, in radians. + * @param scaleX Horizontal scale of the transform point. + * @param scaleY Vertical scale of the transform point. + * @param output The output vector, point or object for the translated coordinates. + */ + function TransformXY(x: number, y: number, positionX: number, positionY: number, rotation: number, scaleX: number, scaleY: number, output?: Phaser.Math.Vector2 | Phaser.Geom.Point | object): Phaser.Math.Vector2 | Phaser.Geom.Point | object; + + /** + * A representation of a vector in 2D space. + * + * A two-component vector. + */ + class Vector2 { + /** + * + * @param x The x component, or an object with `x` and `y` properties. + * @param y The y component. + */ + constructor(x?: number | Phaser.Types.Math.Vector2Like, y?: number); + + /** + * The x component of this Vector. + */ + x: number; + + /** + * The y component of this Vector. + */ + y: number; + + /** + * Make a clone of this Vector2. + */ + clone(): Phaser.Math.Vector2; + + /** + * Copy the components of a given Vector into this Vector. + * @param src The Vector to copy the components from. + */ + copy(src: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Set the component values of this Vector from a given Vector2Like object. + * @param obj The object containing the component values to set for this Vector. + */ + setFromObject(obj: Phaser.Types.Math.Vector2Like): Phaser.Math.Vector2; + + /** + * Set the `x` and `y` components of the this Vector to the given `x` and `y` values. + * @param x The x value to set for this Vector. + * @param y The y value to set for this Vector. Default x. + */ + set(x: number, y?: number): Phaser.Math.Vector2; + + /** + * This method is an alias for `Vector2.set`. + * @param x The x value to set for this Vector. + * @param y The y value to set for this Vector. Default x. + */ + setTo(x: number, y?: number): Phaser.Math.Vector2; + + /** + * Sets the `x` and `y` values of this object from a given polar coordinate. + * @param azimuth The angular coordinate, in radians. + * @param radius The radial coordinate (length). Default 1. + */ + setToPolar(azimuth: number, radius?: number): Phaser.Math.Vector2; + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * @param v The vector to compare with this Vector. + */ + equals(v: Phaser.Math.Vector2): boolean; + + /** + * Calculate the angle between this Vector and the positive x-axis, in radians. + */ + angle(): number; + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * @param src The Vector to add to this Vector. + */ + add(src: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * @param src The Vector to subtract from this Vector. + */ + subtract(src: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * @param src The Vector to multiply this Vector by. + */ + multiply(src: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Scale this Vector by the given value. + * @param value The value to scale this Vector by. + */ + scale(value: number): Phaser.Math.Vector2; + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * @param src The Vector to divide this Vector by. + */ + divide(src: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Negate the `x` and `y` components of this Vector. + */ + negate(): Phaser.Math.Vector2; + + /** + * Calculate the distance between this Vector and the given Vector. + * @param src The Vector to calculate the distance to. + */ + distance(src: Phaser.Math.Vector2): number; + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * @param src The Vector to calculate the distance to. + */ + distanceSq(src: Phaser.Math.Vector2): number; + + /** + * Calculate the length (or magnitude) of this Vector. + */ + length(): number; + + /** + * Calculate the length of this Vector squared. + */ + lengthSq(): number; + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + */ + normalize(): Phaser.Math.Vector2; + + /** + * Right-hand normalize (make unit length) this Vector. + */ + normalizeRightHand(): Phaser.Math.Vector2; + + /** + * Calculate the dot product of this Vector and the given Vector. + * @param src The Vector2 to dot product with this Vector2. + */ + dot(src: Phaser.Math.Vector2): number; + + /** + * Calculate the cross product of this Vector and the given Vector. + * @param src The Vector2 to cross with this Vector2. + */ + cross(src: Phaser.Math.Vector2): number; + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * @param src The Vector2 to interpolate towards. + * @param t The interpolation percentage, between 0 and 1. Default 0. + */ + lerp(src: Phaser.Math.Vector2, t?: number): Phaser.Math.Vector2; + + /** + * Transform this Vector with the given Matrix. + * @param mat The Matrix3 to transform this Vector2 with. + */ + transformMat3(mat: Phaser.Math.Matrix3): Phaser.Math.Vector2; + + /** + * Transform this Vector with the given Matrix. + * @param mat The Matrix4 to transform this Vector2 with. + */ + transformMat4(mat: Phaser.Math.Matrix4): Phaser.Math.Vector2; + + /** + * Make this Vector the zero vector (0, 0). + */ + reset(): Phaser.Math.Vector2; + + /** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly ZERO: Phaser.Math.Vector2; + + /** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly RIGHT: Phaser.Math.Vector2; + + /** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly LEFT: Phaser.Math.Vector2; + + /** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly UP: Phaser.Math.Vector2; + + /** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly DOWN: Phaser.Math.Vector2; + + /** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly ONE: Phaser.Math.Vector2; + + } + + /** + * A representation of a vector in 3D space. + * + * A three-component vector. + */ + class Vector3 { + /** + * + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + constructor(x?: number, y?: number, z?: number); + + /** + * The x component of this Vector. + */ + x: number; + + /** + * The y component of this Vector. + */ + y: number; + + /** + * The z component of this Vector. + */ + z: number; + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + */ + up(): Phaser.Math.Vector3; + + /** + * Make a clone of this Vector3. + */ + clone(): Phaser.Math.Vector3; + + /** + * Calculate the cross (vector) product of two given Vectors. + * @param a The first Vector to multiply. + * @param b The second Vector to multiply. + */ + crossVectors(a: Phaser.Math.Vector3, b: Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * @param v The Vector3 to compare against. + */ + equals(v: Phaser.Math.Vector3): boolean; + + /** + * Copy the components of a given Vector into this Vector. + * @param src The Vector to copy the components from. + */ + copy(src: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * @param x The x value to set for this Vector, or an object containing x, y and z components. + * @param y The y value to set for this Vector. + * @param z The z value to set for this Vector. + */ + set(x: number | object, y?: number, z?: number): Phaser.Math.Vector3; + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * @param v The Vector to add to this Vector. + */ + add(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * @param v The Vector to subtract from this Vector. + */ + subtract(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * @param v The Vector to multiply this Vector by. + */ + multiply(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Scale this Vector by the given value. + * @param scale The value to scale this Vector by. + */ + scale(scale: number): Phaser.Math.Vector3; + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * @param v The Vector to divide this Vector by. + */ + divide(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Negate the `x`, `y` and `z` components of this Vector. + */ + negate(): Phaser.Math.Vector3; + + /** + * Calculate the distance between this Vector and the given Vector. + * @param v The Vector to calculate the distance to. + */ + distance(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): number; + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * @param v The Vector to calculate the distance to. + */ + distanceSq(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): number; + + /** + * Calculate the length (or magnitude) of this Vector. + */ + length(): number; + + /** + * Calculate the length of this Vector squared. + */ + lengthSq(): number; + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + */ + normalize(): Phaser.Math.Vector3; + + /** + * Calculate the dot product of this Vector and the given Vector. + * @param v The Vector3 to dot product with this Vector3. + */ + dot(v: Phaser.Math.Vector3): number; + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * @param v The Vector to cross product with. + */ + cross(v: Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * @param v The Vector3 to interpolate towards. + * @param t The interpolation percentage, between 0 and 1. Default 0. + */ + lerp(v: Phaser.Math.Vector3, t?: number): Phaser.Math.Vector3; + + /** + * Transform this Vector with the given Matrix. + * @param mat The Matrix3 to transform this Vector3 with. + */ + transformMat3(mat: Phaser.Math.Matrix3): Phaser.Math.Vector3; + + /** + * Transform this Vector with the given Matrix. + * @param mat The Matrix4 to transform this Vector3 with. + */ + transformMat4(mat: Phaser.Math.Matrix4): Phaser.Math.Vector3; + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * @param mat The Matrix4 to transform this Vector3 with. + */ + transformCoordinates(mat: Phaser.Math.Matrix4): Phaser.Math.Vector3; + + /** + * Transform this Vector with the given Quaternion. + * @param q The Quaternion to transform this Vector with. + */ + transformQuat(q: Phaser.Math.Quaternion): Phaser.Math.Vector3; + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * @param mat The Matrix4 to multiply this Vector3 with. + */ + project(mat: Phaser.Math.Matrix4): Phaser.Math.Vector3; + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * @param viewport Screen x, y, width and height in pixels. + * @param invProjectionView Combined projection and view matrix. + */ + unproject(viewport: Phaser.Math.Vector4, invProjectionView: Phaser.Math.Matrix4): Phaser.Math.Vector3; + + /** + * Make this Vector the zero vector (0, 0, 0). + */ + reset(): Phaser.Math.Vector3; + + /** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly ZERO: Phaser.Math.Vector3; + + /** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly RIGHT: Phaser.Math.Vector3; + + /** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly LEFT: Phaser.Math.Vector3; + + /** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly UP: Phaser.Math.Vector3; + + /** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly DOWN: Phaser.Math.Vector3; + + /** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly FORWARD: Phaser.Math.Vector3; + + /** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly BACK: Phaser.Math.Vector3; + + /** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + */ + static readonly ONE: Phaser.Math.Vector3; + + } + + /** + * A representation of a vector in 4D space. + * + * A four-component vector. + */ + class Vector4 { + /** + * + * @param x The x component. + * @param y The y component. + * @param z The z component. + * @param w The w component. + */ + constructor(x?: number, y?: number, z?: number, w?: number); + + /** + * The x component of this Vector. + */ + x: number; + + /** + * The y component of this Vector. + */ + y: number; + + /** + * The z component of this Vector. + */ + z: number; + + /** + * The w component of this Vector. + */ + w: number; + + /** + * Make a clone of this Vector4. + */ + clone(): Phaser.Math.Vector4; + + /** + * Copy the components of a given Vector into this Vector. + * @param src The Vector to copy the components from. + */ + copy(src: Phaser.Math.Vector4): Phaser.Math.Vector4; + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict quality check against each Vector's components. + * @param v The vector to check equality with. + */ + equals(v: Phaser.Math.Vector4): boolean; + + /** + * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values. + * @param x The x value to set for this Vector, or an object containing x, y, z and w components. + * @param y The y value to set for this Vector. + * @param z The z value to set for this Vector. + * @param w The z value to set for this Vector. + */ + set(x: number | object, y: number, z: number, w: number): Phaser.Math.Vector4; + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * @param v The Vector to add to this Vector. + */ + add(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Vector4; + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * @param v The Vector to subtract from this Vector. + */ + subtract(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Vector4; + + /** + * Scale this Vector by the given value. + * @param scale The value to scale this Vector by. + */ + scale(scale: number): Phaser.Math.Vector4; + + /** + * Calculate the length (or magnitude) of this Vector. + */ + length(): number; + + /** + * Calculate the length of this Vector squared. + */ + lengthSq(): number; + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + */ + normalize(): Phaser.Math.Vector4; + + /** + * Calculate the dot product of this Vector and the given Vector. + * @param v The Vector4 to dot product with this Vector4. + */ + dot(v: Phaser.Math.Vector4): number; + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * @param v The Vector4 to interpolate towards. + * @param t The interpolation percentage, between 0 and 1. Default 0. + */ + lerp(v: Phaser.Math.Vector4, t?: number): Phaser.Math.Vector4; + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * @param v The Vector to multiply this Vector by. + */ + multiply(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Vector4; + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * @param v The Vector to divide this Vector by. + */ + divide(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Vector4; + + /** + * Calculate the distance between this Vector and the given Vector. + * @param v The Vector to calculate the distance to. + */ + distance(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): number; + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * @param v The Vector to calculate the distance to. + */ + distanceSq(v: Phaser.Math.Vector2 | Phaser.Math.Vector3 | Phaser.Math.Vector4): number; + + /** + * Negate the `x`, `y`, `z` and `w` components of this Vector. + */ + negate(): Phaser.Math.Vector4; + + /** + * Transform this Vector with the given Matrix. + * @param mat The Matrix4 to transform this Vector4 with. + */ + transformMat4(mat: Phaser.Math.Matrix4): Phaser.Math.Vector4; + + /** + * Transform this Vector with the given Quaternion. + * @param q The Quaternion to transform this Vector with. + */ + transformQuat(q: Phaser.Math.Quaternion): Phaser.Math.Vector4; + + /** + * Make this Vector the zero vector (0, 0, 0, 0). + */ + reset(): Phaser.Math.Vector4; + + } + + /** + * Checks if the two values are within the given `tolerance` of each other. + * @param a The first value to use in the calculation. + * @param b The second value to use in the calculation. + * @param tolerance The tolerance. Anything equal to or less than this value is considered as being within range. + */ + function Within(a: number, b: number, tolerance: number): boolean; + + /** + * Wrap the given `value` between `min` and `max. + * @param value The value to wrap. + * @param min The minimum value. + * @param max The maximum value. + */ + function Wrap(value: number, min: number, max: number): number; + + } + + /** + * The root types namespace. + */ + namespace Types { + namespace Actions { + type CallCallback = (item: Phaser.GameObjects.GameObject)=>void; + + type GridAlignConfig = { + /** + * The width of the grid in items (not pixels). -1 means lay all items out horizontally, regardless of quantity. + * If both this value and height are set to -1 then this value overrides it and the `height` value is ignored. + */ + width?: integer; + /** + * The height of the grid in items (not pixels). -1 means lay all items out vertically, regardless of quantity. + * If both this value and `width` are set to -1 then `width` overrides it and this value is ignored. + */ + height?: integer; + /** + * The width of the cell, in pixels, in which the item is positioned. + */ + cellWidth?: integer; + /** + * The height of the cell, in pixels, in which the item is positioned. + */ + cellHeight?: integer; + /** + * The alignment position. One of the Phaser.Display.Align consts such as `TOP_LEFT` or `RIGHT_CENTER`. + */ + position?: integer; + /** + * Optionally place the top-left of the final grid at this coordinate. + */ + x?: number; + /** + * Optionally place the top-left of the final grid at this coordinate. + */ + y?: number; + }; + + } + + namespace Animations { + type Animation = { + /** + * The key that the animation will be associated with. i.e. sprite.animations.play(key) + */ + key?: string; + /** + * An object containing data used to generate the frames for the animation + */ + frames?: Phaser.Types.Animations.AnimationFrame[]; + /** + * The key of the texture all frames of the animation will use. Can be overridden on a per frame basis. + */ + defaultTextureKey?: string; + /** + * The frame rate of playback in frames per second (default 24 if duration is null) + */ + frameRate?: integer; + /** + * How long the animation should play for in milliseconds. If not given its derived from frameRate. + */ + duration?: integer; + /** + * Skip frames if the time lags, or always advanced anyway? + */ + skipMissedFrames?: boolean; + /** + * Delay before starting playback. Value given in milliseconds. + */ + delay?: integer; + /** + * Number of times to repeat the animation (-1 for infinity) + */ + repeat?: integer; + /** + * Delay before the animation repeats. Value given in milliseconds. + */ + repeatDelay?: integer; + /** + * Should the animation yoyo? (reverse back down to the start) before repeating? + */ + yoyo?: boolean; + /** + * Should sprite.visible = true when the animation starts to play? + */ + showOnStart?: boolean; + /** + * Should sprite.visible = false when the animation finishes? + */ + hideOnComplete?: boolean; + }; + + type AnimationFrame = { + /** + * The key that the animation will be associated with. i.e. sprite.animations.play(key) + */ + key: string; + /** + * [description] + */ + frame: string | number; + /** + * [description] + */ + duration?: number; + /** + * [description] + */ + visible?: boolean; + }; + + type GenerateFrameNames = { + /** + * The string to append to every resulting frame name if using a range or an array of `frames`. + */ + prefix?: string; + /** + * If `frames` is not provided, the number of the first frame to return. + */ + start?: integer; + /** + * If `frames` is not provided, the number of the last frame to return. + */ + end?: integer; + /** + * The string to append to every resulting frame name if using a range or an array of `frames`. + */ + suffix?: string; + /** + * The minimum expected lengths of each resulting frame's number. Numbers will be left-padded with zeroes until they are this long, then prepended and appended to create the resulting frame name. + */ + zeroPad?: integer; + /** + * The array to append the created configuration objects to. + */ + outputArray?: Phaser.Types.Animations.AnimationFrame[]; + /** + * If provided as an array, the range defined by `start` and `end` will be ignored and these frame numbers will be used. + */ + frames?: boolean; + }; + + type GenerateFrameNumbers = { + /** + * The starting frame of the animation. + */ + start?: integer; + /** + * The ending frame of the animation. + */ + end?: integer; + /** + * A frame to put at the beginning of the animation, before `start` or `outputArray` or `frames`. + */ + first?: boolean | integer; + /** + * An array to concatenate the output onto. + */ + outputArray?: Phaser.Types.Animations.AnimationFrame[]; + /** + * A custom sequence of frames. + */ + frames?: boolean | integer[]; + }; + + type JSONAnimation = { + /** + * The key that the animation will be associated with. i.e. sprite.animations.play(key) + */ + key: string; + /** + * A frame based animation (as opposed to a bone based animation) + */ + type: string; + /** + * [description] + */ + frames: Phaser.Types.Animations.JSONAnimationFrame[]; + /** + * The frame rate of playback in frames per second (default 24 if duration is null) + */ + frameRate: integer; + /** + * How long the animation should play for in milliseconds. If not given its derived from frameRate. + */ + duration: integer; + /** + * Skip frames if the time lags, or always advanced anyway? + */ + skipMissedFrames: boolean; + /** + * Delay before starting playback. Value given in milliseconds. + */ + delay: integer; + /** + * Number of times to repeat the animation (-1 for infinity) + */ + repeat: integer; + /** + * Delay before the animation repeats. Value given in milliseconds. + */ + repeatDelay: integer; + /** + * Should the animation yoyo? (reverse back down to the start) before repeating? + */ + yoyo: boolean; + /** + * Should sprite.visible = true when the animation starts to play? + */ + showOnStart: boolean; + /** + * Should sprite.visible = false when the animation finishes? + */ + hideOnComplete: boolean; + }; + + type JSONAnimationFrame = { + /** + * The key of the Texture this AnimationFrame uses. + */ + key: string; + /** + * The key of the Frame within the Texture that this AnimationFrame uses. + */ + frame: string | integer; + /** + * Additional time (in ms) that this frame should appear for during playback. + */ + duration: number; + }; + + type JSONAnimations = { + /** + * An array of all Animations added to the Animation Manager. + */ + anims: Phaser.Types.Animations.JSONAnimation[]; + /** + * The global time scale of the Animation Manager. + */ + globalTimeScale: number; + }; + + } + + namespace Cameras { + namespace Scene2D { + type CameraConfig = { + /** + * The name of the Camera. + */ + name?: string; + /** + * The horizontal position of the Camera viewport. + */ + x?: integer; + /** + * The vertical position of the Camera viewport. + */ + y?: integer; + /** + * The width of the Camera viewport. + */ + width?: integer; + /** + * The height of the Camera viewport. + */ + height?: integer; + /** + * The default zoom level of the Camera. + */ + zoom?: number; + /** + * The rotation of the Camera, in radians. + */ + rotation?: number; + /** + * Should the Camera round pixels before rendering? + */ + roundPixels?: boolean; + /** + * The horizontal scroll position of the Camera. + */ + scrollX?: number; + /** + * The vertical scroll position of the Camera. + */ + scrollY?: number; + /** + * A CSS color string controlling the Camera background color. + */ + backgroundColor?: false | string; + /** + * Defines the Camera bounds. + */ + bounds?: object; + /** + * The top-left extent of the Camera bounds. + */ + "bounds.x"?: number; + /** + * The top-left extent of the Camera bounds. + */ + "bounds.y"?: number; + /** + * The width of the Camera bounds. + */ + "bounds.width"?: number; + /** + * The height of the Camera bounds. + */ + "bounds.height"?: number; + }; + + type CameraFadeCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number)=>void; + + type CameraFlashCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number)=>void; + + type CameraPanCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number, x: number, y: number)=>void; + + type CameraShakeCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number)=>void; + + type CameraZoomCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number, zoom: number)=>void; + + type JSONCamera = { + /** + * The name of the camera + */ + name: string; + /** + * The horizontal position of camera + */ + x: number; + /** + * The vertical position of camera + */ + y: number; + /** + * The width size of camera + */ + width: number; + /** + * The height size of camera + */ + height: number; + /** + * The zoom of camera + */ + zoom: number; + /** + * The rotation of camera + */ + rotation: number; + /** + * The round pixels st status of camera + */ + roundPixels: boolean; + /** + * The horizontal scroll of camera + */ + scrollX: number; + /** + * The vertical scroll of camera + */ + scrollY: number; + /** + * The background color of camera + */ + backgroundColor: string; + /** + * The bounds of camera + */ + bounds?: Phaser.Types.Cameras.Scene2D.JSONCameraBounds | undefined; + }; + + type JSONCameraBounds = { + /** + * The horizontal position of camera + */ + x: number; + /** + * The vertical position of camera + */ + y: number; + /** + * The width size of camera + */ + width: number; + /** + * The height size of camera + */ + height: number; + }; + + } + + namespace Controls { + type FixedKeyControlConfig = { + /** + * The Camera that this Control will update. + */ + camera?: Phaser.Cameras.Scene2D.Camera; + /** + * The Key to be pressed that will move the Camera left. + */ + left?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will move the Camera right. + */ + right?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will move the Camera up. + */ + up?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will move the Camera down. + */ + down?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will zoom the Camera in. + */ + zoomIn?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will zoom the Camera out. + */ + zoomOut?: Phaser.Input.Keyboard.Key; + /** + * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. + */ + zoomSpeed?: number; + /** + * The horizontal and vertical speed the camera will move. + */ + speed?: number | Object; + }; + + type SmoothedKeyControlConfig = { + /** + * The Camera that this Control will update. + */ + camera?: Phaser.Cameras.Scene2D.Camera; + /** + * The Key to be pressed that will move the Camera left. + */ + left?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will move the Camera right. + */ + right?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will move the Camera up. + */ + up?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will zoom the Camera in. + */ + zoomIn?: Phaser.Input.Keyboard.Key; + /** + * The Key to be pressed that will zoom the Camera out. + */ + zoomOut?: Phaser.Input.Keyboard.Key; + /** + * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. + */ + zoomSpeed?: number; + /** + * The horizontal and vertical acceleration the camera will move. + */ + acceleration?: number | Object; + /** + * The horizontal and vertical drag applied to the camera when it is moving. + */ + drag?: number | Object; + /** + * The maximum horizontal and vertical speed the camera will move. + */ + maxSpeed?: number | Object; + }; + + } + + } + + namespace Core { + /** + * Config object containing various sound settings. + */ + type AudioConfig = { + /** + * Use HTML5 Audio instead of Web Audio. + */ + disableWebAudio?: boolean; + /** + * An existing Web Audio context. + */ + context?: AudioContext; + /** + * Disable all audio output. + */ + noAudio?: boolean; + }; + + type BannerConfig = { + /** + * Omit Phaser's name and version from the banner. + */ + hidePhaser?: boolean; + /** + * The color of the banner text. + */ + text?: string; + /** + * The background colors of the banner. + */ + background?: string[]; + }; + + type BootCallback = (game: Phaser.Game)=>void; + + type CallbacksConfig = { + /** + * A function to run at the start of the boot sequence. + */ + preBoot?: Phaser.Types.Core.BootCallback; + /** + * A function to run at the end of the boot sequence. At this point, all the game systems have started and plugins have been loaded. + */ + postBoot?: Phaser.Types.Core.BootCallback; + }; + + type DOMContainerConfig = { + /** + * Should the game create a div element to act as a DOM Container? Only enable if you're using DOM Element objects. You must provide a parent object if you use this feature. + */ + createContainer?: boolean; + /** + * Should the DOM Container that is created (if `dom.createContainer` is true) be positioned behind (true) or over the top (false, the default) of the game canvas? + */ + behindCanvas?: boolean; + }; + + type FPSConfig = { + /** + * The minimum acceptable rendering rate, in frames per second. + */ + min?: integer; + /** + * The optimum rendering rate, in frames per second. + */ + target?: integer; + /** + * Use setTimeout instead of requestAnimationFrame to run the game loop. + */ + forceSetTimeOut?: boolean; + /** + * Calculate the average frame delta from this many consecutive frame intervals. + */ + deltaHistory?: integer; + /** + * The amount of frames the time step counts before we trust the delta values again. + */ + panicMax?: integer; + }; + + type GameConfig = { + /** + * The width of the game, in game pixels. + */ + width?: integer | string; + /** + * The height of the game, in game pixels. + */ + height?: integer | string; + /** + * Simple scale applied to the game canvas. 2 is double size, 0.5 is half size, etc. + */ + zoom?: number; + /** + * The size of each game pixel, in canvas pixels. Values larger than 1 are "high" resolution. + */ + resolution?: number; + /** + * Which renderer to use. Phaser.AUTO, Phaser.CANVAS, Phaser.HEADLESS, or Phaser.WEBGL. AUTO picks WEBGL if available, otherwise CANVAS. + */ + type?: number; + /** + * The DOM element that will contain the game canvas, or its `id`. If undefined or if the named element doesn't exist, the game canvas is inserted directly into the document body. If `null` no parent will be used and you are responsible for adding the canvas to your environment. + */ + parent?: HTMLElement | string; + /** + * Provide your own Canvas element for Phaser to use instead of creating one. + */ + canvas?: HTMLCanvasElement; + /** + * CSS styles to apply to the game canvas instead of Phasers default styles. + */ + canvasStyle?: string; + /** + * Provide your own Canvas Context for Phaser to use, instead of creating one. + */ + context?: CanvasRenderingContext2D; + /** + * A scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have `{ active: true }`. See the `sceneConfig` argument in `Phaser.Scenes.SceneManager#add`. + */ + scene?: Phaser.Scene | Phaser.Scene[] | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.SettingsConfig[] | Phaser.Types.Scenes.CreateSceneFromObjectConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig[] | Function | Function[]; + /** + * Seed for the random number generator. + */ + seed?: string[]; + /** + * The title of the game. Shown in the browser console. + */ + title?: string; + /** + * The URL of the game. Shown in the browser console. + */ + url?: string; + /** + * The version of the game. Shown in the browser console. + */ + version?: string; + /** + * Automatically call window.focus() when the game boots. Usually necessary to capture input events if the game is in a separate frame. + */ + autoFocus?: boolean; + /** + * Input configuration, or `false` to disable all game input. + */ + input?: boolean | Phaser.Types.Core.InputConfig; + /** + * Disable the browser's default 'contextmenu' event (usually triggered by a right-button mouse click). + */ + disableContextMenu?: boolean; + /** + * Whether the game canvas will have a transparent background. + */ + transparent?: boolean; + /** + * Configuration for the banner printed in the browser console when the game starts. + */ + banner?: boolean | Phaser.Types.Core.BannerConfig; + /** + * The DOM Container configuration object. + */ + dom?: Phaser.Types.Core.DOMContainerConfig; + /** + * Game loop configuration. + */ + fps?: Phaser.Types.Core.FPSConfig; + /** + * Game renderer configuration. + */ + render?: Phaser.Types.Core.RenderConfig; + /** + * The background color of the game canvas. The default is black. + */ + backgroundColor?: string | number; + /** + * Optional callbacks to run before or after game boot. + */ + callbacks?: Phaser.Types.Core.CallbacksConfig; + /** + * Loader configuration. + */ + loader?: Phaser.Types.Core.LoaderConfig; + /** + * Images configuration. + */ + images?: Phaser.Types.Core.ImagesConfig; + /** + * Physics configuration. + */ + physics?: Phaser.Types.Core.PhysicsConfig; + /** + * Plugins to install. + */ + plugins?: Phaser.Types.Core.PluginObject | Phaser.Types.Core.PluginObjectItem[]; + /** + * The Scale Manager configuration. + */ + scale?: Phaser.Types.Core.ScaleConfig; + /** + * The Audio Configuration object. + */ + audio?: Phaser.Types.Core.AudioConfig; + }; + + type GamepadInputConfig = { + /** + * Where the Gamepad Manager listens for gamepad input events. + */ + target?: any; + }; + + type ImagesConfig = { + /** + * URL to use for the 'default' texture. + */ + default?: string; + /** + * URL to use for the 'missing' texture. + */ + missing?: string; + }; + + type InputConfig = { + /** + * Keyboard input configuration. `true` uses the default configuration and `false` disables keyboard input. + */ + keyboard?: boolean | Phaser.Types.Core.KeyboardInputConfig; + /** + * Mouse input configuration. `true` uses the default configuration and `false` disables mouse input. + */ + mouse?: boolean | Phaser.Types.Core.MouseInputConfig; + /** + * Touch input configuration. `true` uses the default configuration and `false` disables touch input. + */ + touch?: boolean | Phaser.Types.Core.TouchInputConfig; + /** + * Gamepad input configuration. `true` enables gamepad input. + */ + gamepad?: boolean | Phaser.Types.Core.GamepadInputConfig; + /** + * The maximum number of touch pointers. See {@link Phaser.Input.InputManager#pointers}. + */ + activePointers?: integer; + /** + * The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. + */ + smoothFactor?: number; + /** + * Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire. + */ + windowEvents?: boolean; + }; + + type KeyboardInputConfig = { + /** + * Where the Keyboard Manager listens for keyboard input events. + */ + target?: any; + /** + * `preventDefault` will be called on every non-modified key which has a key code in this array. By default it is empty. + */ + capture?: integer[]; + }; + + type LoaderConfig = { + /** + * A URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'. + */ + baseURL?: string; + /** + * A URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'. + */ + path?: string; + /** + * The maximum number of resources the loader will start loading at once. + */ + maxParallelDownloads?: integer; + /** + * 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. + */ + crossOrigin?: string | undefined; + /** + * The response type of the XHR request, e.g. `blob`, `text`, etc. + */ + responseType?: string; + /** + * Should the XHR request use async or not? + */ + async?: boolean; + /** + * Optional username for all XHR requests. + */ + user?: string; + /** + * Optional password for all XHR requests. + */ + password?: string; + /** + * Optional XHR timeout value, in ms. + */ + timeout?: integer; + }; + + type MouseInputConfig = { + /** + * Where the Mouse Manager listens for mouse input events. The default is the game canvas. + */ + target?: any; + /** + * Whether mouse input events have `preventDefault` called on them. + */ + capture?: boolean; + }; + + /** + * This callback type is completely empty, a no-operation. + */ + type NOOP = ()=>void; + + type PhysicsConfig = { + /** + * The default physics system. It will be started for each scene. Phaser provides 'arcade', 'impact', and 'matter'. + */ + default?: string; + /** + * Arcade Physics configuration. + */ + arcade?: Phaser.Types.Physics.Arcade.ArcadeWorldConfig; + /** + * Impact Physics configuration. + */ + impact?: Phaser.Types.Physics.Impact.WorldConfig; + /** + * Matter Physics configuration. + */ + matter?: Phaser.Types.Physics.Matter.MatterWorldConfig; + }; + + type PluginObject = { + /** + * Global plugins to install. + */ + global?: Phaser.Types.Core.PluginObjectItem[]; + /** + * Scene plugins to install. + */ + scene?: Phaser.Types.Core.PluginObjectItem[]; + /** + * The default set of scene plugins (names). + */ + default?: string[]; + /** + * Plugins to *add* to the default set of scene plugins. + */ + defaultMerge?: string[]; + }; + + type PluginObjectItem = { + /** + * A key to identify the plugin in the Plugin Manager. + */ + key?: string; + /** + * The plugin itself. Usually a class/constructor. + */ + plugin?: any; + /** + * Whether the plugin should be started automatically. + */ + start?: boolean; + /** + * For a scene plugin, add the plugin to the scene's systems object under this key (`this.sys.KEY`, from the scene). + */ + systemKey?: string; + /** + * For a scene plugin, add the plugin to the scene object under this key (`this.KEY`, from the scene). + */ + sceneKey?: string; + /** + * If this plugin is to be injected into the Scene Systems, this is the property key map used. + */ + mapping?: string; + /** + * Arbitrary data passed to the plugin's init() method. + */ + data?: any; + }; + + type RenderConfig = { + /** + * When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. + */ + antialias?: boolean; + /** + * When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details. + */ + desynchronized?: boolean; + /** + * Sets `antialias` and `roundPixels` to true. This is the best setting for pixel-art games. + */ + pixelArt?: boolean; + /** + * Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. + */ + roundPixels?: boolean; + /** + * Whether the game canvas will be transparent. Boolean that indicates if the canvas contains an alpha channel. If set to false, the browser now knows that the backdrop is always opaque, which can speed up drawing of transparent content and images. + */ + transparent?: boolean; + /** + * Whether the game canvas will be cleared between each rendering frame. + */ + clearBeforeRender?: boolean; + /** + * In WebGL mode, the drawing buffer contains colors with pre-multiplied alpha. + */ + premultipliedAlpha?: boolean; + /** + * Let the browser abort creating a WebGL context if it judges performance would be unacceptable. + */ + failIfMajorPerformanceCaveat?: boolean; + /** + * "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. + */ + powerPreference?: string; + /** + * The default WebGL batch size. + */ + batchSize?: integer; + /** + * The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. + */ + maxLights?: integer; + }; + + type ScaleConfig = { + /** + * The base width of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size. + */ + width?: integer | string; + /** + * The base height of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size. + */ + height?: integer | string; + /** + * The zoom value of the game canvas. + */ + zoom?: Phaser.Scale.ZoomType | integer; + /** + * The rendering resolution of the canvas. This is reserved for future use and is currently ignored. + */ + resolution?: number; + /** + * The DOM element that will contain the game canvas, or its `id`. If undefined, or if the named element doesn't exist, the game canvas is inserted directly into the document body. If `null` no parent will be used and you are responsible for adding the canvas to your environment. + */ + parent?: HTMLElement | string; + /** + * Is the Scale Manager allowed to adjust the CSS height property of the parent and/or document body to be 100%? + */ + expandParent?: boolean; + /** + * The scale mode. + */ + mode?: Phaser.Scale.ScaleModeType; + /** + * The minimum width and height the canvas can be scaled down to. + */ + min?: WidthHeight; + /** + * The maximum width the canvas can be scaled up to. + */ + max?: WidthHeight; + /** + * Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. + */ + autoRound?: boolean; + /** + * Automatically center the canvas within the parent? + */ + autoCenter?: Phaser.Scale.CenterType; + /** + * How many ms should elapse before checking if the browser size has changed? + */ + resizeInterval?: integer; + /** + * The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. + */ + fullscreenTarget?: HTMLElement | string; + }; + + type TimeStepCallback = (time: number, average: number, interpolation: number)=>void; + + type TouchInputConfig = { + /** + * Where the Touch Manager listens for touch input events. The default is the game canvas. + */ + target?: any; + /** + * Whether touch input events have preventDefault() called on them. + */ + capture?: boolean; + }; + + type WidthHeight = { + /** + * The width. + */ + width?: integer; + /** + * The height. + */ + height?: integer; + }; + + } + + namespace Create { + type GenerateTextureCallback = (canvas: HTMLCanvasElement, context: CanvasRenderingContext2D)=>void; + + type GenerateTextureConfig = { + /** + * [description] + */ + data?: any[]; + /** + * [description] + */ + canvas?: HTMLCanvasElement; + /** + * [description] + */ + palette?: Phaser.Types.Create.Palette; + /** + * The width of each 'pixel' in the generated texture. + */ + pixelWidth?: number; + /** + * The height of each 'pixel' in the generated texture. + */ + pixelHeight?: number; + /** + * [description] + */ + resizeCanvas?: boolean; + /** + * [description] + */ + clearCanvas?: boolean; + /** + * [description] + */ + preRender?: Phaser.Types.Create.GenerateTextureCallback; + /** + * [description] + */ + postRender?: Phaser.Types.Create.GenerateTextureCallback; + }; + + type Palette = { + /** + * Color value 1. + */ + "0": string; + /** + * Color value 2. + */ + "1": string; + /** + * Color value 3. + */ + "2": string; + /** + * Color value 4. + */ + "3": string; + /** + * Color value 5. + */ + "4": string; + /** + * Color value 6. + */ + "5": string; + /** + * Color value 7. + */ + "6": string; + /** + * Color value 8. + */ + "7": string; + /** + * Color value 9. + */ + "8": string; + /** + * Color value 10. + */ + "9": string; + /** + * Color value 11. + */ + A: string; + /** + * Color value 12. + */ + B: string; + /** + * Color value 13. + */ + C: string; + /** + * Color value 14. + */ + D: string; + /** + * Color value 15. + */ + E: string; + /** + * Color value 16. + */ + F: string; + }; + + } + + namespace Curves { + type EllipseCurveConfig = { + /** + * The x coordinate of the ellipse. + */ + x?: number; + /** + * The y coordinate of the ellipse. + */ + y?: number; + /** + * The horizontal radius of the ellipse. + */ + xRadius?: number; + /** + * The vertical radius of the ellipse. + */ + yRadius?: number; + /** + * The start angle of the ellipse, in degrees. + */ + startAngle?: integer; + /** + * The end angle of the ellipse, in degrees. + */ + endAngle?: integer; + /** + * Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + */ + clockwise?: boolean; + /** + * The rotation of the ellipse, in degrees. + */ + rotation?: integer; + }; + + type JSONCurve = { + /** + * The of the curve + */ + type: string; + /** + * The arrays of points like `[x1, y1, x2, y2]` + */ + points: number[]; + }; + + type JSONEllipseCurve = { + /** + * The of the curve. + */ + type: string; + /** + * The x coordinate of the ellipse. + */ + x: number; + /** + * The y coordinate of the ellipse. + */ + y: number; + /** + * The horizontal radius of ellipse. + */ + xRadius: number; + /** + * The vertical radius of ellipse. + */ + yRadius: number; + /** + * The start angle of the ellipse, in degrees. + */ + startAngle: integer; + /** + * The end angle of the ellipse, in degrees. + */ + endAngle: integer; + /** + * Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + */ + clockwise: boolean; + /** + * The rotation of ellipse, in degrees. + */ + rotation: integer; + }; + + type JSONPath = { + /** + * The of the curve. + */ + type: string; + /** + * The X coordinate of the curve's starting point. + */ + x: number; + /** + * The Y coordinate of the path's starting point. + */ + y: number; + /** + * The path is auto closed. + */ + autoClose: boolean; + /** + * The list of the curves + */ + curves: Phaser.Types.Curves.JSONCurve[]; + }; + + } + + namespace Display { + type ColorObject = { + /** + * The red color value in the range 0 to 255. + */ + r: number; + /** + * The green color value in the range 0 to 255. + */ + g: number; + /** + * The blue color value in the range 0 to 255. + */ + b: number; + /** + * The alpha color value in the range 0 to 255. + */ + a: number; + }; + + type HSVColorObject = { + /** + * The hue color value. A number between 0 and 1 + */ + h: number; + /** + * The saturation color value. A number between 0 and 1 + */ + s: number; + /** + * The lightness color value. A number between 0 and 1 + */ + v: number; + }; + + type InputColorObject = { + /** + * The red color value in the range 0 to 255. + */ + r?: number; + /** + * The green color value in the range 0 to 255. + */ + g?: number; + /** + * The blue color value in the range 0 to 255. + */ + b?: number; + /** + * The alpha color value in the range 0 to 255. + */ + a?: number; + }; + + } + + namespace GameObjects { + namespace BitmapText { + /** + * The font data for an individual character of a Bitmap Font. + * + * Describes the character's position, size, offset and kerning. + */ + type BitmapFontCharacterData = { + /** + * The x position of the character. + */ + x: number; + /** + * The y position of the character. + */ + y: number; + /** + * The width of the character. + */ + width: number; + /** + * The height of the character. + */ + height: number; + /** + * The center x position of the character. + */ + centerX: number; + /** + * The center y position of the character. + */ + centerY: number; + /** + * The x offset of the character. + */ + xOffset: number; + /** + * The y offset of the character. + */ + yOffset: number; + /** + * Extra data for the character. + */ + data: object; + /** + * Kerning values, keyed by character code. + */ + kerning: {[key: string]: number}; + }; + + /** + * Bitmap Font data that can be used by a BitmapText Game Object. + */ + type BitmapFontData = { + /** + * The name of the font. + */ + font: string; + /** + * The size of the font. + */ + size: number; + /** + * The line height of the font. + */ + lineHeight: number; + /** + * Whether this font is a retro font (monospace). + */ + retroFont: boolean; + /** + * The character data of the font, keyed by character code. Each character datum includes a position, size, offset and more. + */ + chars: {[key: number]: Phaser.Types.GameObjects.BitmapText.BitmapFontCharacterData}; + }; + + type BitmapTextConfig = Phaser.Types.GameObjects.GameObjectConfig & { + /** + * The key of the font to use from the BitmapFont cache. + */ + font?: string; + /** + * The string, or array of strings, to be set as the content of this Bitmap Text. + */ + text?: string; + /** + * The font size to set. + */ + size?: number | false; + }; + + type BitmapTextSize = { + /** + * The position and size of the BitmapText, taking into account the position and scale of the Game Object. + */ + global: Phaser.Types.GameObjects.BitmapText.GlobalBitmapTextSize; + /** + * The position and size of the BitmapText, taking just the font size into account. + */ + local: Phaser.Types.GameObjects.BitmapText.LocalBitmapTextSize; + }; + + type DisplayCallbackConfig = { + /** + * The Dynamic Bitmap Text object that owns this character being rendered. + */ + parent: Phaser.GameObjects.DynamicBitmapText; + /** + * The tint of the character being rendered. Always zero in Canvas. + */ + tint: Phaser.Types.GameObjects.BitmapText.TintConfig; + /** + * The index of the character being rendered. + */ + index: number; + /** + * The character code of the character being rendered. + */ + charCode: number; + /** + * The x position of the character being rendered. + */ + x: number; + /** + * The y position of the character being rendered. + */ + y: number; + /** + * The scale of the character being rendered. + */ + scale: number; + /** + * The rotation of the character being rendered. + */ + rotation: number; + /** + * Custom data stored with the character being rendered. + */ + data: any; + }; + + type DisplayCallback = (display: Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig)=>void; + + /** + * The position and size of the Bitmap Text in global space, taking into account the Game Object's scale and world position. + */ + type GlobalBitmapTextSize = { + /** + * The x position of the BitmapText, taking into account the x position and scale of the Game Object. + */ + x: number; + /** + * The y position of the BitmapText, taking into account the y position and scale of the Game Object. + */ + y: number; + /** + * The width of the BitmapText, taking into account the x scale of the Game Object. + */ + width: number; + /** + * The height of the BitmapText, taking into account the y scale of the Game Object. + */ + height: number; + }; + + type JSONBitmapText = Phaser.Types.GameObjects.JSONGameObject & { + /** + * The name of the font. + */ + font: string; + /** + * The text that this Bitmap Text displays. + */ + text: string; + /** + * The size of the font. + */ + fontSize: number; + /** + * Adds / Removes spacing between characters. + */ + letterSpacing: number; + /** + * The alignment of the text in a multi-line BitmapText object. + */ + align: integer; + }; + + /** + * The position and size of the Bitmap Text in local space, taking just the font size into account. + */ + type LocalBitmapTextSize = { + /** + * The x position of the BitmapText. + */ + x: number; + /** + * The y position of the BitmapText. + */ + y: number; + /** + * The width of the BitmapText. + */ + width: number; + /** + * The height of the BitmapText. + */ + height: number; + }; + + type RetroFontConfig = { + /** + * The key of the image containing the font. + */ + image: string; + /** + * If the font set doesn't start at the top left of the given image, specify the X coordinate offset here. + */ + "offset.x": number; + /** + * If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here. + */ + "offset.y": number; + /** + * The width of each character in the font set. + */ + width: number; + /** + * The height of each character in the font set. + */ + height: number; + /** + * The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements. + */ + chars: string; + /** + * The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth. + */ + charsPerRow: number; + /** + * If the characters in the font set have horizontal spacing between them set the required amount here. + */ + "spacing.x": number; + /** + * If the characters in the font set have vertical spacing between them set the required amount here. + */ + "spacing.y": number; + /** + * The amount of vertical space to add to the line height of the font. + */ + lineSpacing: number; + }; + + type TintConfig = { + /** + * The top left tint value. Always zero in canvas. + */ + topLeft: number; + /** + * The top right tint value. Always zero in canvas. + */ + topRight: number; + /** + * The bottom left tint value. Always zero in canvas. + */ + bottomLeft: number; + /** + * The bottom right tint value. Always zero in canvas. + */ + bottomRight: number; + }; + + } + + namespace Graphics { + /** + * Graphics fill style settings. + */ + type FillStyle = { + /** + * The fill color. + */ + color?: number; + /** + * The fill alpha. + */ + alpha?: number; + }; + + /** + * Graphics line style (or stroke style) settings. + */ + type LineStyle = { + /** + * The stroke width. + */ + width?: number; + /** + * The stroke color. + */ + color?: number; + /** + * The stroke alpha. + */ + alpha?: number; + }; + + /** + * Options for the Graphics game Object. + */ + type Options = Phaser.Types.GameObjects.Graphics.Styles & { + /** + * The x coordinate of the Graphics. + */ + x?: number; + /** + * The y coordinate of the Graphics. + */ + y?: number; + }; + + type RoundedRectRadius = { + /** + * Top left + */ + tl?: number; + /** + * Top right + */ + tr?: number; + /** + * Bottom right + */ + br?: number; + /** + * Bottom left + */ + bl?: number; + }; + + /** + * Graphics style settings. + */ + type Styles = { + /** + * The style applied to shape outlines. + */ + lineStyle?: Phaser.Types.GameObjects.Graphics.LineStyle; + /** + * The style applied to shape areas. + */ + fillStyle?: Phaser.Types.GameObjects.Graphics.FillStyle; + }; + + } + + namespace Group { + type GroupCallback = (item: Phaser.GameObjects.GameObject)=>void; + + type GroupConfig = { + /** + * Sets {@link Phaser.GameObjects.Group#classType}. + */ + classType?: Function; + /** + * Sets {@link Phaser.GameObjects.Group#name}. + */ + name?: string; + /** + * Sets {@link Phaser.GameObjects.Group#active}. + */ + active?: boolean; + /** + * Sets {@link Phaser.GameObjects.Group#maxSize}. + */ + maxSize?: number; + /** + * Sets {@link Phaser.GameObjects.Group#defaultKey}. + */ + defaultKey?: string; + /** + * Sets {@link Phaser.GameObjects.Group#defaultFrame}. + */ + defaultFrame?: string | integer; + /** + * Sets {@link Phaser.GameObjects.Group#runChildUpdate}. + */ + runChildUpdate?: boolean; + /** + * Sets {@link Phaser.GameObjects.Group#createCallback}. + */ + createCallback?: Phaser.Types.GameObjects.Group.GroupCallback; + /** + * Sets {@link Phaser.GameObjects.Group#removeCallback}. + */ + removeCallback?: Phaser.Types.GameObjects.Group.GroupCallback; + /** + * Sets {@link Phaser.GameObjects.Group#createMultipleCallback}. + */ + createMultipleCallback?: Phaser.Types.GameObjects.Group.GroupMultipleCreateCallback; + }; + + /** + * The total number of objects created will be + * + * key.length * frame.length * frameQuantity * (yoyo ? 2 : 1) * (1 + repeat) + * + * If `max` is nonzero, then the total created will not exceed `max`. + * + * `key` is required. {@link Phaser.GameObjects.Group#defaultKey} is not used. + */ + type GroupCreateConfig = { + /** + * The class of each new Game Object. + */ + classType?: Function; + /** + * The texture key of each new Game Object. + */ + key?: string | string[]; + /** + * The texture frame of each new Game Object. + */ + frame?: string | string[] | integer | integer[]; + /** + * The visible state of each new Game Object. + */ + visible?: boolean; + /** + * The active state of each new Game Object. + */ + active?: boolean; + /** + * The number of times each `key` × `frame` combination will be *repeated* (after the first combination). + */ + repeat?: number; + /** + * Select a `key` at random. + */ + randomKey?: boolean; + /** + * Select a `frame` at random. + */ + randomFrame?: boolean; + /** + * Select keys and frames by moving forward then backward through `key` and `frame`. + */ + yoyo?: boolean; + /** + * The number of times each `frame` should be combined with one `key`. + */ + frameQuantity?: number; + /** + * The maximum number of new Game Objects to create. 0 is no maximum. + */ + max?: number; + setXY?: object; + /** + * The horizontal position of each new Game Object. + */ + "setXY.x"?: number; + /** + * The vertical position of each new Game Object. + */ + "setXY.y"?: number; + /** + * Increment each Game Object's horizontal position from the previous by this amount, starting from `setXY.x`. + */ + "setXY.stepX"?: number; + /** + * Increment each Game Object's vertical position from the previous by this amount, starting from `setXY.y`. + */ + "setXY.stepY"?: number; + setRotation?: object; + /** + * Rotation of each new Game Object. + */ + "setRotation.value"?: number; + /** + * Increment each Game Object's rotation from the previous by this amount, starting at `setRotation.value`. + */ + "setRotation.step"?: number; + setScale?: object; + /** + * The horizontal scale of each new Game Object. + */ + "setScale.x"?: number; + /** + * The vertical scale of each new Game Object. + */ + "setScale.y"?: number; + /** + * Increment each Game Object's horizontal scale from the previous by this amount, starting from `setScale.x`. + */ + "setScale.stepX"?: number; + /** + * Increment each Game object's vertical scale from the previous by this amount, starting from `setScale.y`. + */ + "setScale.stepY"?: number; + setAlpha?: object; + /** + * The alpha value of each new Game Object. + */ + "setAlpha.value"?: number; + /** + * Increment each Game Object's alpha from the previous by this amount, starting from `setAlpha.value`. + */ + "setAlpha.step"?: number; + /** + * A geometric shape that defines the hit area for the Game Object. + */ + hitArea?: any; + /** + * A callback to be invoked when the Game Object is interacted with. + */ + hitAreaCallback?: Phaser.Types.Input.HitAreaCallback; + /** + * Align the new Game Objects in a grid using these settings. + */ + gridAlign?: false | Phaser.Types.Actions.GridAlignConfig; + }; + + type GroupMultipleCreateCallback = (items: Phaser.GameObjects.GameObject[])=>void; + + } + + namespace Particles { + type DeathZoneSource = { + contains: Phaser.Types.GameObjects.Particles.DeathZoneSourceCallback; + }; + + type DeathZoneSourceCallback = (x: number, y: number)=>void; + + type EdgeZoneSource = { + /** + * A function placing points on the sources edge or edges. + */ + getPoints: Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback; + }; + + type EdgeZoneSourceCallback = (quantity: integer, stepRate?: number)=>void; + + type EmitterOpCustomEmitConfig = { + /** + * A callback that is invoked each time the emitter emits a particle. + */ + onEmit: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback; + }; + + type EmitterOpCustomUpdateConfig = { + /** + * A callback that is invoked each time the emitter emits a particle. + */ + onEmit?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback; + /** + * A callback that is invoked each time the emitter updates. + */ + onUpdate: Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback; + }; + + /** + * Defines an operation yielding a value incremented continuously across a range. + */ + type EmitterOpEaseConfig = { + /** + * The starting value. + */ + start: number; + /** + * The ending value. + */ + end: number; + /** + * The name of the easing function. + */ + ease?: string; + }; + + /** + * The returned value sets what the property will be at the START of the particle's life, on emit. + */ + type EmitterOpOnEmitCallback = (particle: Phaser.GameObjects.Particles.Particle, key: string, value: number)=>void; + + type EmitterOpOnEmitType = number | number[] | Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback | Phaser.Types.GameObjects.Particles.EmitterOpRandomConfig | Phaser.Types.GameObjects.Particles.EmitterOpRandomMinMaxConfig | Phaser.Types.GameObjects.Particles.EmitterOpRandomStartEndConfig | Phaser.Types.GameObjects.Particles.EmitterOpSteppedConfig | Phaser.Types.GameObjects.Particles.EmitterOpCustomEmitConfig; + + /** + * The returned value updates the property for the duration of the particle's life. + */ + type EmitterOpOnUpdateCallback = (particle: Phaser.GameObjects.Particles.Particle, key: string, t: number, value: number)=>void; + + type EmitterOpOnUpdateType = Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback | Phaser.Types.GameObjects.Particles.EmitterOpEaseConfig | Phaser.Types.GameObjects.Particles.EmitterOpCustomUpdateConfig; + + /** + * Defines an operation yielding a random value within a range. + */ + type EmitterOpRandomConfig = { + /** + * The minimum and maximum values, as [min, max]. + */ + random: number[]; + }; + + /** + * Defines an operation yielding a random value within a range. + */ + type EmitterOpRandomMinMaxConfig = { + /** + * The minimum value. + */ + min: number; + /** + * The maximum value. + */ + max: number; + }; + + /** + * Defines an operation yielding a random value within a range. + */ + type EmitterOpRandomStartEndConfig = { + /** + * The starting value. + */ + start: number; + /** + * The ending value. + */ + end: number; + /** + * If false, this becomes {@link EmitterOpEaseConfig}. + */ + random: boolean; + }; + + /** + * Defines an operation yielding a value incremented by steps across a range. + */ + type EmitterOpSteppedConfig = { + /** + * The starting value. + */ + start: number; + /** + * The ending value. + */ + end: number; + /** + * The number of steps between start and end. + */ + steps: number; + }; + + type GravityWellConfig = { + /** + * The x coordinate of the Gravity Well, in world space. + */ + x?: number; + /** + * The y coordinate of the Gravity Well, in world space. + */ + y?: number; + /** + * The strength of the gravity force - larger numbers produce a stronger force. + */ + power?: number; + /** + * The minimum distance for which the gravity force is calculated. + */ + epsilon?: number; + /** + * The gravitational force of this Gravity Well. + */ + gravity?: number; + }; + + type ParticleDeathCallback = (particle: Phaser.GameObjects.Particles.Particle)=>void; + + type ParticleEmitterBounds = { + /** + * The left edge of the rectangle. + */ + x: number; + /** + * The top edge of the rectangle. + */ + y: number; + /** + * The width of the rectangle. + */ + width: number; + /** + * The height of the rectangle. + */ + height: number; + }; + + type ParticleEmitterBoundsAlt = { + /** + * The left edge of the rectangle. + */ + x: number; + /** + * The top edge of the rectangle. + */ + y: number; + /** + * The width of the rectangle. + */ + w: number; + /** + * The height of the rectangle. + */ + h: number; + }; + + type ParticleEmitterCallback = (particle: Phaser.GameObjects.Particles.Particle, emitter: Phaser.GameObjects.Particles.ParticleEmitter)=>void; + + type ParticleEmitterConfig = { + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#active}. + */ + active?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#blendMode}. + */ + blendMode?: Phaser.BlendModes | string; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallbackScope} and {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallbackScope}. + */ + callbackScope?: any; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideBottom}. + */ + collideBottom?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideLeft}. + */ + collideLeft?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideRight}. + */ + collideRight?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideTop}. + */ + collideTop?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallback}. + */ + deathCallback?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallbackScope}. + */ + deathCallbackScope?: any; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallback}. + */ + emitCallback?: Function; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallbackScope}. + */ + emitCallbackScope?: any; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#follow}. + */ + follow?: Phaser.GameObjects.GameObject; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#frequency}. + */ + frequency?: number; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#gravityX}. + */ + gravityX?: number; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#gravityY}. + */ + gravityY?: number; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxParticles}. + */ + maxParticles?: integer; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#name}. + */ + name?: string; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#on}. + */ + on?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#particleBringToTop}. + */ + particleBringToTop?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#particleClass}. + */ + particleClass?: Phaser.GameObjects.Particles.Particle; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#radial}. + */ + radial?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#timeScale}. + */ + timeScale?: number; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#trackVisible}. + */ + trackVisible?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#visible}. + */ + visible?: boolean; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#accelerationX} (emit only). + */ + accelerationX?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#accelerationY} (emit only). + */ + accelerationY?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#alpha}. + */ + alpha?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#angle} (emit only). + */ + angle?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#bounce} (emit only). + */ + bounce?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#delay} (emit only). + */ + delay?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#lifespan} (emit only). + */ + lifespan?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityX} (emit only). + */ + maxVelocityX?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityY} (emit only). + */ + maxVelocityY?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#moveToX} (emit only). + */ + moveToX?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#moveToY} (emit only). + */ + moveToY?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity} (emit only). + */ + quantity?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#rotate}. + */ + rotate?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setScale}. + */ + scale?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#scaleX}. + */ + scaleX?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#scaleY}. + */ + scaleY?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setSpeed} (emit only). + */ + speed?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#speedX} (emit only). + */ + speedX?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#speedY} (emit only). + */ + speedY?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#tint}. + */ + tint?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType | Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#x} (emit only). + */ + x?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#y} (emit only). + */ + y?: Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType; + /** + * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone}. + */ + emitZone?: object; + /** + * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setBounds}. + */ + bounds?: Phaser.Types.GameObjects.Particles.ParticleEmitterBounds | Phaser.Types.GameObjects.Particles.ParticleEmitterBoundsAlt; + /** + * Assigns to {@link Phaser.GameObjects.Particles.ParticleEmitter#followOffset}. + */ + followOffset?: object; + /** + * x-coordinate of the offset. + */ + "followOffset.x"?: number; + /** + * y-coordinate of the offset. + */ + "followOffset.y"?: number; + /** + * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. + */ + frame?: number | number[] | string | string[] | Phaser.Textures.Frame | Phaser.Textures.Frame[] | Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig; + }; + + type ParticleEmitterDeathZoneConfig = { + /** + * A shape representing the zone. See {@link Phaser.GameObjects.Particles.Zones.DeathZone#source}. + */ + source: Phaser.Types.GameObjects.Particles.DeathZoneSource; + /** + * 'onEnter' or 'onLeave'. + */ + type?: string; + }; + + type ParticleEmitterEdgeZoneConfig = { + /** + * A shape representing the zone. See {@link Phaser.GameObjects.Particles.Zones.EdgeZone#source}. + */ + source: Phaser.Types.GameObjects.Particles.EdgeZoneSource; + /** + * 'edge'. + */ + type: string; + /** + * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + */ + quantity: integer; + /** + * The distance between each particle. When set, `quantity` is implied and should be set to 0. + */ + stepRate?: number; + /** + * Whether particles are placed from start to end and then end to start. + */ + yoyo?: boolean; + /** + * Whether one endpoint will be removed if it's identical to the other. + */ + seamless?: boolean; + }; + + type ParticleEmitterFrameConfig = { + /** + * One or more texture frames. + */ + frames?: number | number[] | string | string[] | Phaser.Textures.Frame | Phaser.Textures.Frame[]; + /** + * Whether texture frames will be assigned consecutively (true) or at random (false). + */ + cycle?: boolean; + /** + * The number of consecutive particles receiving each texture frame, when `cycle` is true. + */ + quantity?: integer; + }; + + type ParticleEmitterRandomZoneConfig = { + /** + * A shape representing the zone. See {@link Phaser.GameObjects.Particles.Zones.RandomZone#source}. + */ + source: Phaser.Types.GameObjects.Particles.RandomZoneSource; + /** + * 'random'. + */ + type?: string; + }; + + type RandomZoneSource = { + /** + * A function modifying its point argument. + */ + getRandomPoint: Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback; + }; + + type RandomZoneSourceCallback = (point: Phaser.Math.Vector2)=>void; + + } + + namespace PathFollower { + /** + * Settings for a PathFollower. + */ + type PathConfig = { + /** + * The duration of the path follow in ms. Must be `> 0`. + */ + duration?: number; + /** + * The start position of the path follow, between 0 and 1. Must be less than `to`. + */ + from?: number; + /** + * The end position of the path follow, between 0 and 1. Must be more than `from`. + */ + to?: number; + /** + * Whether to position the PathFollower on the Path using its path offset. + */ + positionOnPath?: boolean; + /** + * Should the PathFollower automatically rotate to point in the direction of the Path? + */ + rotateToPath?: boolean; + /** + * If the PathFollower is rotating to match the Path, this value is added to the rotation value. This allows you to rotate objects to a path but control the angle of the rotation as well. + */ + rotationOffset?: number; + /** + * Current start position of the path follow, must be between `from` and `to`. + */ + startAt?: number; + }; + + } + + namespace RenderTexture { + type RenderTextureConfig = { + /** + * The x coordinate of the RenderTextures position. + */ + x?: number; + /** + * The y coordinate of the RenderTextures position. + */ + y?: number; + /** + * The width of the RenderTexture. + */ + width?: number; + /** + * The height of the RenderTexture. + */ + height?: number; + /** + * The texture key to make the RenderTexture from. + */ + key?: string; + /** + * the frame to make the RenderTexture from. + */ + frame?: string; + }; + + } + + namespace Sprite { + type SpriteConfig = Phaser.Types.GameObjects.GameObjectConfig & { + /** + * The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + */ + key?: string; + /** + * An optional frame from the Texture this Game Object is rendering with. + */ + frame?: number | string; + }; + + } + + namespace Text { + /** + * Font metrics for a Text Style object. + */ + type TextMetrics = { + /** + * The ascent of the font. + */ + ascent: number; + /** + * The descent of the font. + */ + descent: number; + /** + * The size of the font. + */ + fontSize: number; + }; + + /** + * A Text Padding configuration object as used by the Text Style. + */ + type TextPadding = { + /** + * If set this value is used for both the left and right padding. + */ + x?: number; + /** + * If set this value is used for both the top and bottom padding. + */ + y?: number; + /** + * The amount of padding added to the left of the Text object. + */ + left?: number; + /** + * The amount of padding added to the right of the Text object. + */ + right?: number; + /** + * The amount of padding added to the top of the Text object. + */ + top?: number; + /** + * The amount of padding added to the bottom of the Text object. + */ + bottom?: number; + }; + + /** + * A Text Shadow configuration object as used by the Text Style. + */ + type TextShadow = { + /** + * The horizontal offset of the shadow. + */ + offsetX?: number; + /** + * The vertical offset of the shadow. + */ + offsetY?: number; + /** + * The color of the shadow, given as a CSS string value. + */ + color?: string; + /** + * The amount of blur applied to the shadow. Leave as zero for a hard shadow. + */ + blur?: number; + /** + * Apply the shadow to the stroke effect on the Text object? + */ + stroke?: boolean; + /** + * Apply the shadow to the fill effect on the Text object? + */ + fill?: boolean; + }; + + /** + * A Text Style configuration object as used by the Text Game Object. + */ + type TextSyle = { + /** + * The font the Text object will render with. This is a Canvas style font string. + */ + fontFamily?: string; + /** + * The font size, as a CSS size string. + */ + fontSize?: string; + /** + * Any addition font styles, such as 'strong'. + */ + fontStyle?: string; + /** + * A solid fill color that is rendered behind the Text object. Given as a CSS string color such as `#ff0`. + */ + backgroundColor?: string; + /** + * The color the Text is drawn in. Given as a CSS string color such as `#fff` or `rgb()`. + */ + color?: string; + /** + * The color used to stroke the Text if the `strokeThickness` property is greater than zero. + */ + stroke?: string; + /** + * The thickness of the stroke around the Text. Set to zero for no stroke. + */ + strokeThickness?: number; + /** + * The Text shadow configuration object. + */ + shadow?: Phaser.Types.GameObjects.Text.TextShadow; + /** + * A Text Padding object. + */ + padding?: Phaser.Types.GameObjects.Text.TextPadding; + /** + * The alignment of the Text. This only impacts multi-line text. Either `left`, `right`, `center` or `justify`. + */ + align?: string; + /** + * The maximum number of lines to display within the Text object. + */ + maxLines?: integer; + /** + * Force the Text object to have the exact width specified in this property. Leave as zero for it to change accordingly to content. + */ + fixedWidth?: number; + /** + * Force the Text object to have the exact height specified in this property. Leave as zero for it to change accordingly to content. + */ + fixedHeight?: number; + /** + * Sets the resolution (DPI setting) of the Text object. Leave at zero for it to use the game resolution. + */ + resolution?: number; + /** + * Set to `true` if this Text object should render from right-to-left. + */ + rtl?: boolean; + /** + * This is the string used to aid Canvas in calculating the height of the font. + */ + testString?: string; + /** + * The amount of horizontal padding added to the width of the text when calculating the font metrics. + */ + baselineX?: number; + /** + * The amount of vertical padding added to the height of the text when calculating the font metrics. + */ + baselineY?: number; + /** + * The Text Word wrap configuration object. + */ + wordWrap?: Phaser.Types.GameObjects.Text.TextWordWrap; + /** + * A Text Metrics object. Use this to avoid expensive font size calculations in text heavy games. + */ + metrics?: Phaser.Types.GameObjects.Text.TextMetrics; + }; + + /** + * A Text Word Wrap configuration object as used by the Text Style configuration. + */ + type TextWordWrap = { + /** + * The width at which text should be considered for word-wrapping. + */ + width?: number; + /** + * Provide a custom callback when word wrapping is enabled. + */ + callback?: TextStyleWordWrapCallback; + /** + * The context in which the word wrap callback is invoked. + */ + callbackScope?: any; + /** + * Use basic or advanced word wrapping? + */ + useAdvancedWrap?: boolean; + }; + + } + + namespace TileSprite { + type TileSpriteConfig = Phaser.Types.GameObjects.GameObjectConfig & { + /** + * The x coordinate of the Tile Sprite. + */ + x?: number; + /** + * The y coordinate of the Tile Sprite. + */ + y?: number; + /** + * The width of the Tile Sprite. If zero it will use the size of the texture frame. + */ + width?: integer; + /** + * The height of the Tile Sprite. If zero it will use the size of the texture frame. + */ + height?: integer; + /** + * The key of the Texture this Tile Sprite will use to render with, as stored in the Texture Manager. + */ + key?: string; + /** + * An optional frame from the Texture this Tile Sprite is rendering with. + */ + frame?: string; + }; + + } + + type GameObjectConfig = { + /** + * The x position of the Game Object. + */ + x?: number; + /** + * The y position of the Game Object. + */ + y?: number; + /** + * The depth of the GameObject. + */ + depth?: number; + /** + * The horizontally flipped state of the Game Object. + */ + flipX?: boolean; + /** + * The vertically flipped state of the Game Object. + */ + flipY?: boolean; + /** + * The scale of the GameObject. + */ + scale?: number | object; + /** + * The scroll factor of the GameObject. + */ + scrollFactor?: number | object; + /** + * The rotation angle of the Game Object, in radians. + */ + rotation?: number; + /** + * The rotation angle of the Game Object, in degrees. + */ + angle?: number; + /** + * The alpha (opacity) of the Game Object. + */ + alpha?: number; + /** + * The origin of the Game Object. + */ + origin?: number | object; + /** + * The scale mode of the GameObject. + */ + scaleMode?: number; + /** + * The blend mode of the GameObject. + */ + blendMode?: number; + /** + * The visible state of the Game Object. + */ + visible?: boolean; + /** + * Add the GameObject to the scene. + */ + add?: boolean; + }; + + type JSONGameObject = { + /** + * The name of this Game Object. + */ + name: string; + /** + * A textual representation of this Game Object, i.e. `sprite`. + */ + type: string; + /** + * The x position of this Game Object. + */ + x: number; + /** + * The y position of this Game Object. + */ + y: number; + /** + * The scale of this Game Object + */ + scale: object; + /** + * The horizontal scale of this Game Object. + */ + "scale.x": number; + /** + * The vertical scale of this Game Object. + */ + "scale.y": number; + /** + * The origin of this Game Object. + */ + origin: object; + /** + * The horizontal origin of this Game Object. + */ + "origin.x": number; + /** + * The vertical origin of this Game Object. + */ + "origin.y": number; + /** + * The horizontally flipped state of the Game Object. + */ + flipX: boolean; + /** + * The vertically flipped state of the Game Object. + */ + flipY: boolean; + /** + * The angle of this Game Object in radians. + */ + rotation: number; + /** + * The alpha value of the Game Object. + */ + alpha: number; + /** + * The visible state of the Game Object. + */ + visible: boolean; + /** + * The Scale Mode being used by this Game Object. + */ + scaleMode: integer; + /** + * Sets the Blend Mode being used by this Game Object. + */ + blendMode: integer | string; + /** + * The texture key of this Game Object. + */ + textureKey: string; + /** + * The frame key of this Game Object. + */ + frameKey: string; + /** + * The data of this Game Object. + */ + data: object; + }; + + } + + namespace Input { + namespace Gamepad { + /** + * The Gamepad object, as extracted from GamepadEvent. + */ + type Pad = { + /** + * The ID of the Gamepad. + */ + id: string; + /** + * The index of the Gamepad. + */ + index: integer; + }; + + } + + namespace Keyboard { + type CursorKeys = { + /** + * A Key object mapping to the UP arrow key. + */ + up?: Phaser.Input.Keyboard.Key; + /** + * A Key object mapping to the DOWN arrow key. + */ + down?: Phaser.Input.Keyboard.Key; + /** + * A Key object mapping to the LEFT arrow key. + */ + left?: Phaser.Input.Keyboard.Key; + /** + * A Key object mapping to the RIGHT arrow key. + */ + right?: Phaser.Input.Keyboard.Key; + /** + * A Key object mapping to the SPACE BAR key. + */ + space?: Phaser.Input.Keyboard.Key; + /** + * A Key object mapping to the SHIFT key. + */ + shift?: Phaser.Input.Keyboard.Key; + }; + + type KeyboardKeydownCallback = (event: KeyboardEvent)=>void; + + type KeyComboConfig = { + /** + * If they press the wrong key do we reset the combo? + */ + resetOnWrongKey?: boolean; + /** + * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. + */ + maxKeyDelay?: number; + /** + * If previously matched and they press the first key of the combo again, will it reset? + */ + resetOnMatch?: boolean; + /** + * If the combo matches, will it delete itself? + */ + deleteOnMatch?: boolean; + }; + + } + + /** + * A Phaser Input Event Data object. + * + * This object is passed to the registered event listeners and allows you to stop any further propagation. + */ + type EventData = { + /** + * The cancelled state of this Event. + */ + cancelled?: boolean; + /** + * Call this method to stop this event from passing any further down the event chain. + */ + stopPropagation: Function; + }; + + type HitAreaCallback = (hitArea: any, x: number, y: number, gameObject: Phaser.GameObjects.GameObject)=>void; + + type InputConfiguration = { + /** + * The object / shape to use as the Hit Area. If not given it will try to create a Rectangle based on the texture frame. + */ + hitArea?: any; + /** + * The callback that determines if the pointer is within the Hit Area shape or not. + */ + hitAreaCallback?: Function; + /** + * If `true` the Interactive Object will be set to be draggable and emit drag events. + */ + draggable?: boolean; + /** + * If `true` the Interactive Object will be set to be a drop zone for draggable objects. + */ + dropZone?: boolean; + /** + * If `true` the Interactive Object will set the `pointer` hand cursor when a pointer is over it. This is a short-cut for setting `cursor: 'pointer'`. + */ + useHandCursor?: boolean; + /** + * The CSS string to be used when the cursor is over this Interactive Object. + */ + cursor?: string; + /** + * If `true` the a pixel perfect function will be set for the hit area callback. Only works with texture based Game Objects. + */ + pixelPerfect?: boolean; + /** + * If `pixelPerfect` is set, this is the alpha tolerance threshold value used in the callback. + */ + alphaTolerance?: integer; + }; + + type InputPluginContainer = { + /** + * The unique name of this plugin in the input plugin cache. + */ + key: string; + /** + * The plugin to be stored. Should be the source object, not instantiated. + */ + plugin: Function; + /** + * If this plugin is to be injected into the Input Plugin, this is the property key map used. + */ + mapping?: string; + }; + + type InteractiveObject = { + /** + * The Game Object to which this Interactive Object is bound. + */ + gameObject: Phaser.GameObjects.GameObject; + /** + * Is this Interactive Object currently enabled for input events? + */ + enabled: boolean; + /** + * Is this Interactive Object draggable? Enable with `InputPlugin.setDraggable`. + */ + draggable: boolean; + /** + * Is this Interactive Object a drag-targets drop zone? Set when the object is created. + */ + dropZone: boolean; + /** + * Should this Interactive Object change the cursor (via css) when over? (desktop only) + */ + cursor: boolean | string; + /** + * An optional drop target for a draggable Interactive Object. + */ + target: Phaser.GameObjects.GameObject; + /** + * The most recent Camera to be tested against this Interactive Object. + */ + camera: Phaser.Cameras.Scene2D.Camera; + /** + * The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle. + */ + hitArea: any; + /** + * The 'contains' check callback that the hit area shape will use for all hit tests. + */ + hitAreaCallback: Phaser.Types.Input.HitAreaCallback; + /** + * Was the hitArea for this Interactive Object created based on texture size (false), or a custom shape? (true) + */ + customHitArea: boolean; + /** + * The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + */ + localX: number; + /** + * The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + */ + localY: number; + /** + * The current drag state of this Interactive Object. 0 = Not being dragged, 1 = being checked for drag, or 2 = being actively dragged. + */ + dragState: 0 | 1 | 2; + /** + * The x coordinate of the Game Object that owns this Interactive Object when the drag started. + */ + dragStartX: number; + /** + * The y coordinate of the Game Object that owns this Interactive Object when the drag started. + */ + dragStartY: number; + /** + * The x coordinate that the Pointer started dragging this Interactive Object from. + */ + dragStartXGlobal: number; + /** + * The y coordinate that the Pointer started dragging this Interactive Object from. + */ + dragStartYGlobal: number; + /** + * The x coordinate that this Interactive Object is currently being dragged to. + */ + dragX: number; + /** + * The y coordinate that this Interactive Object is currently being dragged to. + */ + dragY: number; + }; + + } + + namespace Loader { + namespace FileTypes { + type AtlasJSONFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the texture image file from. + */ + textureURL?: string; + /** + * The default file extension to use for the image texture if no url is provided. + */ + textureExtension?: string; + /** + * Extra XHR Settings specifically for the texture image file. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The filename of an associated normal map. It uses the same path and url to load as the texture image. + */ + normalMap?: string; + /** + * The absolute or relative URL to load the atlas json file from. Or a well formed JSON object to use instead. + */ + atlasURL?: string; + /** + * The default file extension to use for the atlas json if no url is provided. + */ + atlasExtension?: string; + /** + * Extra XHR Settings specifically for the atlas json file. + */ + atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type AtlasXMLFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the texture image file from. + */ + textureURL?: string; + /** + * The default file extension to use for the image texture if no url is provided. + */ + textureExtension?: string; + /** + * Extra XHR Settings specifically for the texture image file. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The filename of an associated normal map. It uses the same path and url to load as the texture image. + */ + normalMap?: string; + /** + * The absolute or relative URL to load the atlas xml file from. + */ + atlasURL?: string; + /** + * The default file extension to use for the atlas xml if no url is provided. + */ + atlasExtension?: string; + /** + * Extra XHR Settings specifically for the atlas xml file. + */ + atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type AudioFileConfig = { + /** + * The key of the file. Must be unique within the Loader and Audio Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + urlConfig?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The AudioContext this file will use to process itself. + */ + audioContext?: AudioContext; + }; + + type AudioSpriteFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Audio Cache. + */ + key: string; + /** + * The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead. + */ + jsonURL: string; + /** + * Extra XHR Settings specifically for the json file. + */ + jsonXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The absolute or relative URL to load the audio file from. + */ + audioURL?: Object; + /** + * The audio configuration options. + */ + audioConfig?: any; + /** + * Extra XHR Settings specifically for the audio file. + */ + audioXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type BinaryFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Binary Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * Optional type to cast the binary file to once loaded. For example, `Uint8Array`. + */ + dataType?: any; + }; + + type BitmapFontFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the texture image file from. + */ + textureURL?: string; + /** + * The default file extension to use for the image texture if no url is provided. + */ + textureExtension?: string; + /** + * Extra XHR Settings specifically for the texture image file. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The filename of an associated normal map. It uses the same path and url to load as the texture image. + */ + normalMap?: string; + /** + * The absolute or relative URL to load the font data xml file from. + */ + fontDataURL?: string; + /** + * The default file extension to use for the font data xml if no url is provided. + */ + fontDataExtension?: string; + /** + * Extra XHR Settings specifically for the font data xml file. + */ + fontDataXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type CSSFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type GLSLFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Text Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle. + */ + shaderType?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type HTMLFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Text Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type HTMLTextureFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The width of the texture the HTML will be rendered to. + */ + width?: integer; + /** + * The height of the texture the HTML will be rendered to. + */ + height?: integer; + }; + + type ImageFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * The filename of an associated normal map. It uses the same path and url to load as the image. + */ + normalMap?: string; + /** + * The frame configuration object. Only provided for, and used by, Sprite Sheets. + */ + frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type ImageFrameConfig = { + /** + * The width of the frame in pixels. + */ + frameWidth: integer; + /** + * The height of the frame in pixels. Uses the `frameWidth` value if not provided. + */ + frameHeight?: integer; + /** + * The first frame to start parsing from. + */ + startFrame?: integer; + /** + * The frame to stop parsing at. If not provided it will calculate the value based on the image and frame dimensions. + */ + endFrame?: integer; + /** + * The margin in the image. This is the space around the edge of the frames. + */ + margin?: integer; + /** + * The spacing between each frame in the image. + */ + spacing?: integer; + }; + + type JSONFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the JSON Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. Or can be a ready formed JSON object, in which case it will be directly added to the Cache. + */ + url?: string | any; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * If specified instead of the whole JSON file being parsed and added to the Cache, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it. + */ + dataKey?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type MultiAtlasFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the multi atlas json file from. Or, a well formed JSON object. + */ + atlasURL?: string; + /** + * The default file extension to use for the atlas json if no url is provided. + */ + atlasExtension?: string; + /** + * Extra XHR Settings specifically for the atlas json file. + */ + atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * Optional path to use when loading the textures defined in the atlas data. + */ + path?: string; + /** + * Optional Base URL to use when loading the textures defined in the atlas data. + */ + baseURL?: string; + /** + * Extra XHR Settings specifically for the texture files. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type MultiScriptFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array. + */ + url?: string[]; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for these files. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type PackFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the JSON Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. Or can be a ready formed JSON object, in which case it will be directly processed. + */ + url?: string | any; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * If specified instead of the whole JSON file being parsed, only the section corresponding to this property key will be added. If the property you want to extract is nested, use periods to divide it. + */ + dataKey?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type PluginFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Automatically start the plugin after loading? + */ + start?: boolean; + /** + * If this plugin is to be injected into the Scene, this is the property key used. + */ + mapping?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type SceneFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Text Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type ScenePluginFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * The absolute or relative URL to load the file from. Or, a Scene Plugin. + */ + url?: string | Function; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * If this plugin is to be added to Scene.Systems, this is the property key for it. + */ + systemKey?: string; + /** + * If this plugin is to be added to the Scene, this is the property key for it. + */ + sceneKey?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type ScriptFileConfig = { + /** + * The key of the file. Must be unique within the Loader. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type SpriteSheetFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * The filename of an associated normal map. It uses the same path and url to load as the image. + */ + normalMap?: string; + /** + * The frame configuration object. + */ + frameConfig?: Phaser.Types.Loader.FileTypes.ImageFrameConfig; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type SVGFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The svg size configuration object. + */ + svgConfig?: Phaser.Types.Loader.FileTypes.SVGSizeConfig; + }; + + type SVGSizeConfig = { + /** + * An optional width. The SVG will be resized to this size before being rendered to a texture. + */ + width?: integer; + /** + * An optional height. The SVG will be resized to this size before being rendered to a texture. + */ + height?: integer; + /** + * An optional scale. If given it overrides the width / height properties. The SVG is scaled by the scale factor before being rendered to a texture. + */ + scale?: number; + }; + + type TextFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Text Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type TilemapCSVFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Tilemap Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type TilemapImpactFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Tilemap Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type TilemapJSONFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Tilemap Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type UnityAtlasFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the texture image file from. + */ + textureURL?: string; + /** + * The default file extension to use for the image texture if no url is provided. + */ + textureExtension?: string; + /** + * Extra XHR Settings specifically for the texture image file. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The filename of an associated normal map. It uses the same path and url to load as the texture image. + */ + normalMap?: string; + /** + * The absolute or relative URL to load the atlas data file from. + */ + atlasURL?: string; + /** + * The default file extension to use for the atlas data if no url is provided. + */ + atlasExtension?: string; + /** + * Extra XHR Settings specifically for the atlas data file. + */ + atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + type XMLFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Text Cache. + */ + key: string; + /** + * The absolute or relative URL to load the file from. + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + + } + + type FileConfig = { + /** + * The file type string (image, json, etc) for sorting within the Loader. + */ + type: string; + /** + * Unique cache key (unique within its file type) + */ + key: string; + /** + * The URL of the file, not including baseURL. + */ + url?: string; + /** + * The path of the file, not including the baseURL. + */ + path?: string; + /** + * The default extension this file uses. + */ + extension?: string; + /** + * The responseType to be used by the XHR request. + */ + responseType?: XMLHttpRequestResponseType; + /** + * Custom XHR Settings specific to this file and merged with the Loader defaults. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject | false; + /** + * A config object that can be used by file types to store transitional data. + */ + config?: any; + }; + + type XHRSettingsObject = { + /** + * The response type of the XHR request, i.e. `blob`, `text`, etc. + */ + responseType: XMLHttpRequestResponseType; + /** + * Should the XHR request use async or not? + */ + async?: boolean; + /** + * Optional username for the XHR request. + */ + user?: string; + /** + * Optional password for the XHR request. + */ + password?: string; + /** + * Optional XHR timeout value. + */ + timeout?: integer; + /** + * This value is used to populate the XHR `setRequestHeader` and is undefined by default. + */ + header?: string | undefined; + /** + * This value is used to populate the XHR `setRequestHeader` and is undefined by default. + */ + headerValue?: string | undefined; + /** + * This value is used to populate the XHR `setRequestHeader` and is undefined by default. + */ + requestedWith?: string | undefined; + /** + * Provide a custom mime-type to use instead of the default. + */ + overrideMimeType?: string | undefined; + }; + + } + + namespace Math { + type SinCosTable = { + /** + * The sine value. + */ + sin: number; + /** + * The cosine value. + */ + cos: number; + /** + * The length. + */ + length: number; + }; + + type Vector2Like = { + /** + * The x component. + */ + x?: number; + /** + * The y component. + */ + y?: number; + }; + + } + + namespace Physics { + namespace Arcade { + type ArcadeBodyBounds = { + /** + * The left edge. + */ + x: number; + /** + * The upper edge. + */ + y: number; + /** + * The right edge. + */ + right: number; + /** + * The lower edge. + */ + bottom: number; + }; + + type ArcadeBodyCollision = { + /** + * True if the Body is not colliding. + */ + none: boolean; + /** + * True if the Body is colliding on its upper edge. + */ + up: boolean; + /** + * True if the Body is colliding on its lower edge. + */ + down: boolean; + /** + * True if the Body is colliding on its left edge. + */ + left: boolean; + /** + * True if the Body is colliding on its right edge. + */ + right: boolean; + }; + + /** + * An Arcade Physics Collider Type. + */ + type ArcadeColliderType = Phaser.GameObjects.GameObject | Phaser.GameObjects.Group | Phaser.Physics.Arcade.Sprite | Phaser.Physics.Arcade.Image | Phaser.Physics.Arcade.StaticGroup | Phaser.Physics.Arcade.Group | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer | Phaser.GameObjects.GameObject[] | Phaser.Physics.Arcade.Sprite[] | Phaser.Physics.Arcade.Image[] | Phaser.Physics.Arcade.StaticGroup[] | Phaser.Physics.Arcade.Group[] | Phaser.Tilemaps.DynamicTilemapLayer[] | Phaser.Tilemaps.StaticTilemapLayer[]; + + type ArcadeWorldConfig = { + /** + * Sets {@link Phaser.Physics.Arcade.World#fps}. + */ + fps?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#timeScale}. + */ + timeScale?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#gravity}. + */ + gravity?: Phaser.Types.Math.Vector2Like; + /** + * Sets {@link Phaser.Physics.Arcade.World#bounds bounds.x}. + */ + x?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#bounds bounds.y}. + */ + y?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#bounds bounds.width}. + */ + width?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#bounds bounds.height}. + */ + height?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#checkCollision}. + */ + checkCollision?: Phaser.Types.Physics.Arcade.CheckCollisionObject; + /** + * Sets {@link Phaser.Physics.Arcade.World#OVERLAP_BIAS}. + */ + overlapBias?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#TILE_BIAS}. + */ + tileBias?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#forceX}. + */ + forceX?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#isPaused}. + */ + isPaused?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#debug}. + */ + debug?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugShowBody}. + */ + debugShowBody?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugShowStaticBody}. + */ + debugShowStaticBody?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugShowStaticBody}. + */ + debugShowVelocity?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugBodyColor}. + */ + debugBodyColor?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugStaticBodyColor}. + */ + debugStaticBodyColor?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#defaults debugVelocityColor}. + */ + debugVelocityColor?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#maxEntries}. + */ + maxEntries?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#useTree}. + */ + useTree?: boolean; + }; + + type ArcadeWorldDefaults = { + /** + * Set to `true` to render dynamic body outlines to the debug display. + */ + debugShowBody: boolean; + /** + * Set to `true` to render static body outlines to the debug display. + */ + debugShowStaticBody: boolean; + /** + * Set to `true` to render body velocity markers to the debug display. + */ + debugShowVelocity: boolean; + /** + * The color of dynamic body outlines when rendered to the debug display. + */ + bodyDebugColor: number; + /** + * The color of static body outlines when rendered to the debug display. + */ + staticBodyDebugColor: number; + /** + * The color of the velocity markers when rendered to the debug display. + */ + velocityDebugColor: number; + }; + + type ArcadeWorldTreeMinMax = { + /** + * The minimum x value used in RTree searches. + */ + minX: number; + /** + * The minimum y value used in RTree searches. + */ + minY: number; + /** + * The maximum x value used in RTree searches. + */ + maxX: number; + /** + * The maximum y value used in RTree searches. + */ + maxY: number; + }; + + type CheckCollisionObject = { + /** + * Will bodies collide with the top side of the world bounds? + */ + up: boolean; + /** + * Will bodies collide with the bottom side of the world bounds? + */ + down: boolean; + /** + * Will bodies collide with the left side of the world bounds? + */ + left: boolean; + /** + * Will bodies collide with the right side of the world bounds? + */ + right: boolean; + }; + + type PhysicsGroupConfig = Phaser.Types.GameObjects.Group.GroupConfig & { + /** + * Sets {@link Phaser.Physics.Arcade.Body#collideWorldBounds}. + */ + collideWorldBounds?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.Body#acceleration acceleration.x}. + */ + accelerationX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#acceleration acceleration.y}. + */ + accelerationY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#allowDrag}. + */ + allowDrag?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.Body#allowGravity}. + */ + allowGravity?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.Body#allowRotation}. + */ + allowRotation?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.Body#bounce bounce.x}. + */ + bounceX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#bounce bounce.y}. + */ + bounceY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#drag drag.x}. + */ + dragX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#drag drag.y}. + */ + dragY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#enable enable}. + */ + enable?: boolean; + /** + * Sets {@link Phaser.Physics.Arcade.Body#gravity gravity.x}. + */ + gravityX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#gravity gravity.y}. + */ + gravityY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#friction friction.x}. + */ + frictionX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#friction friction.y}. + */ + frictionY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#velocity velocity.x}. + */ + velocityX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#velocity velocity.y}. + */ + velocityY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#angularVelocity}. + */ + angularVelocity?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#angularAcceleration}. + */ + angularAcceleration?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#angularDrag}. + */ + angularDrag?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#mass}. + */ + mass?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#immovable}. + */ + immovable?: boolean; + }; + + type PhysicsGroupDefaults = { + /** + * As {@link Phaser.Physics.Arcade.Body#setCollideWorldBounds}. + */ + setCollideWorldBounds: boolean; + /** + * As {@link Phaser.Physics.Arcade.Body#setAccelerationX}. + */ + setAccelerationX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setAccelerationY}. + */ + setAccelerationY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setAllowDrag}. + */ + setAllowDrag: boolean; + /** + * As {@link Phaser.Physics.Arcade.Body#setAllowGravity}. + */ + setAllowGravity: boolean; + /** + * As {@link Phaser.Physics.Arcade.Body#setAllowRotation}. + */ + setAllowRotation: boolean; + /** + * As {@link Phaser.Physics.Arcade.Body#setBounceX}. + */ + setBounceX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setBounceY}. + */ + setBounceY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setDragX}. + */ + setDragX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setDragY}. + */ + setDragY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setEnable}. + */ + setEnable: boolean; + /** + * As {@link Phaser.Physics.Arcade.Body#setGravityX}. + */ + setGravityX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setGravityY}. + */ + setGravityY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setFrictionX}. + */ + setFrictionX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setFrictionY}. + */ + setFrictionY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setVelocityX}. + */ + setVelocityX: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setVelocityY}. + */ + setVelocityY: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setAngularVelocity}. + */ + setAngularVelocity: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setAngularAcceleration}. + */ + setAngularAcceleration: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setAngularDrag}. + */ + setAngularDrag: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setMass}. + */ + setMass: number; + /** + * As {@link Phaser.Physics.Arcade.Body#setImmovable}. + */ + setImmovable: boolean; + }; + + } + + namespace Impact { + type BodyUpdateCallback = (body: Phaser.Physics.Impact.Body)=>void; + + type CollisionOptions = { + /** + * Slope IDs can be stored on tiles directly + * using Impacts tileset editor. If a tile has a property with the given slopeTileProperty string + * name, the value of that property for the tile will be used for its slope mapping. E.g. a 45 + * degree slope upward could be given a "slope" property with a value of 2. + */ + slopeTileProperty?: string; + /** + * A tile index to slope definition map. + */ + slopeMap?: object; + /** + * If specified, the default slope ID to + * assign to a colliding tile. If not specified, the tile's index is used. + */ + defaultCollidingSlope?: integer; + /** + * The default slope ID to assign to a + * non-colliding tile. + */ + defaultNonCollidingSlope?: integer; + }; + + type JSONImpactBody = { + /** + * [description] + */ + name: string; + /** + * [description] + */ + size: Phaser.Types.Math.Vector2Like; + /** + * The entity's position in the game world. + */ + pos: Phaser.Types.Math.Vector2Like; + /** + * Current velocity in pixels per second. + */ + vel: Phaser.Types.Math.Vector2Like; + /** + * Current acceleration to be added to the entity's velocity per second. E.g. an entity with a `vel.x` of 0 and `accel.x` of 10 will have a `vel.x` of 100 ten seconds later. + */ + accel: Phaser.Types.Math.Vector2Like; + /** + * Deceleration to be subtracted from the entity's velocity per second. Only applies if `accel` is 0. + */ + friction: Phaser.Types.Math.Vector2Like; + /** + * The maximum velocity a body can move. + */ + maxVel: Phaser.Types.Math.Vector2Like; + /** + * [description] + */ + gravityFactor: number; + /** + * [description] + */ + bounciness: number; + /** + * [description] + */ + minBounceVelocity: number; + /** + * [description] + */ + type: Phaser.Physics.Impact.TYPE; + /** + * [description] + */ + checkAgainst: Phaser.Physics.Impact.TYPE; + /** + * [description] + */ + collides: Phaser.Physics.Impact.COLLIDES; + }; + + type WorldConfig = { + /** + * Sets {@link Phaser.Physics.Impact.World#gravity} + */ + gravity?: number; + /** + * The size of the cells used for the broadphase pass. Increase this value if you have lots of large objects in the world. + */ + cellSize?: number; + /** + * A number that allows per-body time scaling, e.g. a force-field where bodies inside are in slow-motion, while others are at full speed. + */ + timeScale?: number; + /** + * [description] + */ + maxStep?: number; + /** + * Sets {@link Phaser.Physics.Impact.World#debug}. + */ + debug?: boolean; + /** + * The maximum velocity a body can move. + */ + maxVelocity?: number; + /** + * Whether the Body's boundary is drawn to the debug display. + */ + debugShowBody?: boolean; + /** + * Whether the Body's velocity is drawn to the debug display. + */ + debugShowVelocity?: boolean; + /** + * The color of this Body on the debug display. + */ + debugBodyColor?: number; + /** + * The color of the Body's velocity on the debug display. + */ + debugVelocityColor?: number; + /** + * Maximum X velocity objects can move. + */ + maxVelocityX?: number; + /** + * Maximum Y velocity objects can move. + */ + maxVelocityY?: number; + /** + * The minimum velocity an object can be moving at to be considered for bounce. + */ + minBounceVelocity?: number; + /** + * Gravity multiplier. Set to 0 for no gravity. + */ + gravityFactor?: number; + /** + * The default bounce, or restitution, of bodies in the world. + */ + bounciness?: number; + /** + * Should the world have bounds enabled by default? + */ + setBounds?: object | boolean; + /** + * The x coordinate of the world bounds. + */ + "setBounds.x"?: number; + /** + * The y coordinate of the world bounds. + */ + "setBounds.y"?: number; + /** + * The width of the world bounds. + */ + "setBounds.width"?: number; + /** + * The height of the world bounds. + */ + "setBounds.height"?: number; + /** + * The thickness of the walls of the world bounds. + */ + "setBounds.thickness"?: number; + /** + * Should the left-side world bounds wall be created? + */ + "setBounds.left"?: boolean; + /** + * Should the right-side world bounds wall be created? + */ + "setBounds.right"?: boolean; + /** + * Should the top world bounds wall be created? + */ + "setBounds.top"?: boolean; + /** + * Should the bottom world bounds wall be created? + */ + "setBounds.bottom"?: boolean; + }; + + /** + * An object containing the 4 wall bodies that bound the physics world. + */ + type WorldDefaults = { + /** + * Whether the Body's boundary is drawn to the debug display. + */ + debugShowBody: boolean; + /** + * Whether the Body's velocity is drawn to the debug display. + */ + debugShowVelocity: boolean; + /** + * The color of this Body on the debug display. + */ + bodyDebugColor: number; + /** + * The color of the Body's velocity on the debug display. + */ + velocityDebugColor: number; + /** + * Maximum X velocity objects can move. + */ + maxVelocityX: number; + /** + * Maximum Y velocity objects can move. + */ + maxVelocityY: number; + /** + * The minimum velocity an object can be moving at to be considered for bounce. + */ + minBounceVelocity: number; + /** + * Gravity multiplier. Set to 0 for no gravity. + */ + gravityFactor: number; + /** + * The default bounce, or restitution, of bodies in the world. + */ + bounciness: number; + }; + + type WorldWalls = { + /** + * The left-side wall of the world bounds. + */ + left: Phaser.Physics.Impact.Body; + /** + * The right-side wall of the world bounds. + */ + right: Phaser.Physics.Impact.Body; + /** + * The top wall of the world bounds. + */ + top: Phaser.Physics.Impact.Body; + /** + * The bottom wall of the world bounds. + */ + bottom: Phaser.Physics.Impact.Body; + }; + + } + + namespace Matter { + type MatterBodyTileOptions = { + /** + * Whether or not the newly created body should be made static. This defaults to true since typically tiles should not be moved. + */ + isStatic?: boolean; + /** + * Whether or not to add the newly created body (or existing body if options.body is used) to the Matter world. + */ + addToWorld?: boolean; + }; + + type MatterTileOptions = { + /** + * An existing Matter body to be used instead of creating a new one. + */ + body?: MatterJS.Body; + /** + * Whether or not the newly created body should be made static. This defaults to true since typically tiles should not be moved. + */ + isStatic?: boolean; + /** + * Whether or not to add the newly created body (or existing body if options.body is used) to the Matter world. + */ + addToWorld?: boolean; + }; + + type MatterWorldConfig = { + /** + * Sets {@link Phaser.Physics.Matter.World#gravity}. + */ + gravity?: Phaser.Types.Math.Vector2Like; + /** + * Should the world have bounds enabled by default? + */ + setBounds?: object | boolean; + /** + * The x coordinate of the world bounds. + */ + "setBounds.x"?: number; + /** + * The y coordinate of the world bounds. + */ + "setBounds.y"?: number; + /** + * The width of the world bounds. + */ + "setBounds.width"?: number; + /** + * The height of the world bounds. + */ + "setBounds.height"?: number; + /** + * The thickness of the walls of the world bounds. + */ + "setBounds.thickness"?: number; + /** + * Should the left-side world bounds wall be created? + */ + "setBounds.left"?: boolean; + /** + * Should the right-side world bounds wall be created? + */ + "setBounds.right"?: boolean; + /** + * Should the top world bounds wall be created? + */ + "setBounds.top"?: boolean; + /** + * Should the bottom world bounds wall be created? + */ + "setBounds.bottom"?: boolean; + /** + * The number of position iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance. + */ + positionIterations?: number; + /** + * The number of velocity iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance. + */ + velocityIterations?: number; + /** + * The number of constraint iterations to perform each update. The higher the value, the higher quality the simulation will be at the expense of performance. + */ + constraintIterations?: number; + /** + * A flag that specifies whether the engine should allow sleeping via the `Matter.Sleeping` module. Sleeping can improve stability and performance, but often at the expense of accuracy. + */ + enableSleeping?: boolean; + /** + * A `Number` that specifies the current simulation-time in milliseconds starting from `0`. It is incremented on every `Engine.update` by the given `delta` argument. + */ + "timing.timestamp"?: number; + /** + * A `Number` that specifies the global scaling factor of time for all bodies. A value of `0` freezes the simulation. A value of `0.1` gives a slow-motion effect. A value of `1.2` gives a speed-up effect. + */ + "timing.timeScale"?: number; + /** + * Toggles if the world is enabled or not. + */ + enabled?: boolean; + /** + * An optional Number that specifies the time correction factor to apply to the update. + */ + correction?: number; + /** + * This function is called every time the core game loop steps, which is bound to the Request Animation Frame frequency unless otherwise modified. + */ + getDelta?: Function; + /** + * Automatically call Engine.update every time the game steps. + */ + autoUpdate?: boolean; + /** + * Sets if Matter will render to the debug Graphic overlay. Do not enable this in production. + */ + debug?: boolean; + /** + * Should dynamic bodies be drawn to the debug graphic? + */ + debugShowBody?: boolean; + /** + * Should static bodies be drawn to the debug graphic? + */ + debugShowStaticBody?: boolean; + /** + * Should the velocity vector be drawn to the debug graphic? + */ + debugShowVelocity?: boolean; + /** + * The color that dynamic body debug outlines are drawn in. + */ + debugBodyColor?: number; + /** + * The color that dynamic body debug fills are drawn in. + */ + debugBodyFillColor?: number; + /** + * The color that static body debug outlines are drawn in. + */ + debugStaticBodyColor?: number; + /** + * The color that the debug velocity vector lines are drawn in. + */ + debugVelocityColor?: number; + /** + * Render joints to the debug graphic. + */ + debugShowJoint?: boolean; + /** + * The color that the debug joints are drawn in. + */ + debugJointColor?: number; + /** + * Render the debug output as wireframes. + */ + debugWireframes?: boolean; + /** + * Render internal edges to the debug. + */ + debugShowInternalEdges?: boolean; + /** + * Render convex hulls to the debug. + */ + debugShowConvexHulls?: boolean; + /** + * The color that the debug convex hulls are drawn in, if enabled. + */ + debugConvexHullColor?: number; + /** + * Render sleeping bodies the debug. + */ + debugShowSleeping?: boolean; + }; + + } + + } + + namespace Plugins { + type CorePluginContainer = { + /** + * The unique name of this plugin in the core plugin cache. + */ + key: string; + /** + * The plugin to be stored. Should be the source object, not instantiated. + */ + plugin: Function; + /** + * If this plugin is to be injected into the Scene Systems, this is the property key map used. + */ + mapping?: string; + /** + * Core Scene plugin or a Custom Scene plugin? + */ + custom?: boolean; + }; + + type CustomPluginContainer = { + /** + * The unique name of this plugin in the custom plugin cache. + */ + key: string; + /** + * The plugin to be stored. Should be the source object, not instantiated. + */ + plugin: Function; + }; + + type GlobalPlugin = { + /** + * The unique name of this plugin within the plugin cache. + */ + key: string; + /** + * An instance of the plugin. + */ + plugin: Function; + /** + * Is the plugin active or not? + */ + active?: boolean; + /** + * If this plugin is to be injected into the Scene Systems, this is the property key map used. + */ + mapping?: string; + }; + + } + + namespace Renderer { + namespace Snapshot { + type SnapshotCallback = (snapshot: Phaser.Display.Color | HTMLImageElement)=>void; + + type SnapshotState = { + /** + * The function to call after the snapshot is taken. + */ + callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback; + /** + * The format of the image to create, usually `image/png` or `image/jpeg`. + */ + type?: string; + /** + * The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + */ + encoderOptions?: number; + /** + * The x coordinate to start the snapshot from. + */ + x?: integer; + /** + * The y coordinate to start the snapshot from. + */ + y?: integer; + /** + * The width of the snapshot. + */ + width?: integer; + /** + * The height of the snapshot. + */ + height?: integer; + /** + * Is this a snapshot to get a single pixel, or an area? + */ + getPixel?: boolean; + }; + + } + + } + + namespace Scenes { + type CreateSceneFromObjectConfig = { + /** + * See {@link Phaser.Scene#init}. + */ + init?: Function; + /** + * See See {@link Phaser.Scene#preload}. + */ + preload?: Function; + /** + * See {@link Phaser.Scene#create}. + */ + create?: Function; + /** + * See {@link Phaser.Scene#update}. + */ + update?: Function; + /** + * Any additional properties, which will be copied to the Scene after it's created (except `data` or `sys`). + */ + extend?: any; + /** + * Any values, which will be merged into the Scene's Data Manager store. + */ + "extend.data"?: any; + }; + + type SceneTransitionConfig = { + /** + * The Scene key to transition to. + */ + target: string; + /** + * The duration, in ms, for the transition to last. + */ + duration?: integer; + /** + * Will the Scene responsible for the transition be sent to sleep on completion (`true`), or stopped? (`false`) + */ + sleep?: boolean; + /** + * Will the Scenes Input system be able to process events while it is transitioning in or out? + */ + allowInput?: boolean; + /** + * Move the target Scene to be above this one before the transition starts. + */ + moveAbove?: boolean; + /** + * Move the target Scene to be below this one before the transition starts. + */ + moveBelow?: boolean; + /** + * This callback is invoked every frame for the duration of the transition. + */ + onUpdate?: Function; + /** + * The context in which the callback is invoked. + */ + onUpdateScope?: any; + /** + * An object containing any data you wish to be passed to the target Scenes init / create methods. + */ + data?: any; + }; + + type SettingsConfig = { + /** + * The unique key of this Scene. Must be unique within the entire Game instance. + */ + key?: string; + /** + * Does the Scene start as active or not? An active Scene updates each step. + */ + active?: boolean; + /** + * Does the Scene start as visible or not? A visible Scene renders each step. + */ + visible?: boolean; + /** + * An optional Loader Packfile to be loaded before the Scene begins. + */ + pack?: false | Phaser.Types.Loader.FileTypes.PackFileConfig; + /** + * An optional Camera configuration object. + */ + cameras?: Phaser.Types.Cameras.Scene2D.JSONCamera | Phaser.Types.Cameras.Scene2D.JSONCamera[]; + /** + * Overwrites the default injection map for a scene. + */ + map?: {[key: string]: string}; + /** + * Extends the injection map for a scene. + */ + mapAdd?: {[key: string]: string}; + /** + * The physics configuration object for the Scene. + */ + physics?: Phaser.Types.Core.PhysicsConfig; + /** + * The loader configuration object for the Scene. + */ + loader?: Phaser.Types.Core.LoaderConfig; + /** + * The plugin configuration object for the Scene. + */ + plugins?: false | any; + }; + + type SettingsObject = { + /** + * The current status of the Scene. Maps to the Scene constants. + */ + status: number; + /** + * The unique key of this Scene. Unique within the entire Game instance. + */ + key: string; + /** + * The active state of this Scene. An active Scene updates each step. + */ + active: boolean; + /** + * The visible state of this Scene. A visible Scene renders each step. + */ + visible: boolean; + /** + * Has the Scene finished booting? + */ + isBooted: boolean; + /** + * Is the Scene in a state of transition? + */ + isTransition: boolean; + /** + * The Scene this Scene is transitioning from, if set. + */ + transitionFrom: Phaser.Scene; + /** + * The duration of the transition, if set. + */ + transitionDuration: integer; + /** + * Is this Scene allowed to receive input during transitions? + */ + transitionAllowInput: boolean; + /** + * a data bundle passed to this Scene from the Scene Manager. + */ + data: object; + /** + * The Loader Packfile to be loaded before the Scene begins. + */ + pack: false | Phaser.Types.Loader.FileTypes.PackFileConfig; + /** + * The Camera configuration object. + */ + cameras: Phaser.Types.Cameras.Scene2D.JSONCamera | Phaser.Types.Cameras.Scene2D.JSONCamera[]; + /** + * The Scene's Injection Map. + */ + map: {[key: string]: string}; + /** + * The physics configuration object for the Scene. + */ + physics: Phaser.Types.Core.PhysicsConfig; + /** + * The loader configuration object for the Scene. + */ + loader: Phaser.Types.Core.LoaderConfig; + /** + * The plugin configuration object for the Scene. + */ + plugins: false | any; + }; + + } + + namespace Sound { + /** + * Audio sprite sound type. + */ + type AudioSpriteSound = { + /** + * Local reference to 'spritemap' object form json file generated by audiosprite tool. + */ + spritemap: object; + }; + + /** + * A Audio Data object. + * + * You can pass an array of these objects to the WebAudioSoundManager `decodeAudio` method to have it decode + * them all at once. + */ + type DecodeAudioConfig = { + /** + * The string-based key to be used to reference the decoded audio in the audio cache. + */ + key: string; + /** + * The audio data, either a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. + */ + data: ArrayBuffer | string; + }; + + type EachActiveSoundCallback = (manager: Phaser.Sound.BaseSoundManager, sound: Phaser.Sound.BaseSound, index: number, sounds: Phaser.Sound.BaseSound[])=>void; + + /** + * Config object containing various sound settings. + */ + type SoundConfig = { + /** + * Boolean indicating whether the sound should be muted or not. + */ + mute?: boolean; + /** + * A value between 0 (silence) and 1 (full volume). + */ + volume?: number; + /** + * Defines the speed at which the sound should be played. + */ + rate?: number; + /** + * Represents detuning of sound in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + */ + detune?: number; + /** + * Position of playback for this sound, in seconds. + */ + seek?: number; + /** + * Whether or not the sound or current sound marker should loop. + */ + loop?: boolean; + /** + * Time, in seconds, that should elapse before the sound actually starts its playback. + */ + delay?: number; + }; + + /** + * Marked section of a sound represented by name, and optionally start time, duration, and config object. + */ + type SoundMarker = { + /** + * Unique identifier of a sound marker. + */ + name: string; + /** + * Sound position offset at witch playback should start. + */ + start?: number; + /** + * Playback duration of this marker. + */ + duration?: number; + /** + * An optional config object containing default marker settings. + */ + config?: Phaser.Types.Sound.SoundConfig; + }; + + } + + namespace Textures { + /** + * An object containing the position and color data for a single pixel in a CanvasTexture. + */ + type PixelConfig = { + /** + * The x-coordinate of the pixel. + */ + x: integer; + /** + * The y-coordinate of the pixel. + */ + y: integer; + /** + * The color of the pixel, not including the alpha channel. + */ + color: integer; + /** + * The alpha of the pixel, between 0 and 1. + */ + alpha: number; + }; + + type SpriteSheetConfig = { + /** + * The fixed width of each frame. + */ + frameWidth: integer; + /** + * The fixed height of each frame. If not set it will use the frameWidth as the height. + */ + frameHeight?: integer; + /** + * Skip a number of frames. Useful when there are multiple sprite sheets in one Texture. + */ + startFrame?: integer; + /** + * The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames". + */ + endFrame?: integer; + /** + * If the frames have been drawn with a margin, specify the amount here. + */ + margin?: integer; + /** + * If the frames have been drawn with spacing between them, specify the amount here. + */ + spacing?: integer; + }; + + type SpriteSheetFromAtlasConfig = { + /** + * The key of the Texture Atlas in which this Sprite Sheet can be found. + */ + atlas: string; + /** + * The key of the Texture Atlas Frame in which this Sprite Sheet can be found. + */ + frame: string; + /** + * The fixed width of each frame. + */ + frameWidth: integer; + /** + * The fixed height of each frame. If not set it will use the frameWidth as the height. + */ + frameHeight?: integer; + /** + * Skip a number of frames. Useful when there are multiple sprite sheets in one Texture. + */ + startFrame?: integer; + /** + * The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames". + */ + endFrame?: integer; + /** + * If the frames have been drawn with a margin, specify the amount here. + */ + margin?: integer; + /** + * If the frames have been drawn with spacing between them, specify the amount here. + */ + spacing?: integer; + }; + + } + + namespace Tilemaps { + type FilteringOptions = { + /** + * If true, only return tiles that don't have -1 for an index. + */ + isNotEmpty?: boolean; + /** + * If true, only return tiles that collide on at least one side. + */ + isColliding?: boolean; + /** + * If true, only return tiles that have at least one interesting face. + */ + hasInterestingFace?: boolean; + }; + + type GetTilesWithinFilteringOptions = { + /** + * If true, only return tiles that don't have -1 for an index. + */ + isNotEmpty?: boolean; + /** + * If true, only return tiles that collide on at least one side. + */ + isColliding?: boolean; + /** + * If true, only return tiles that have at least one interesting face. + */ + hasInterestingFace?: boolean; + }; + + type MapDataConfig = { + /** + * The key in the Phaser cache that corresponds to the loaded tilemap data. + */ + name?: string; + /** + * The width of the entire tilemap. + */ + width?: number; + /** + * The height of the entire tilemap. + */ + height?: number; + /** + * The width of the tiles. + */ + tileWidth?: number; + /** + * The height of the tiles. + */ + tileHeight?: number; + /** + * The width in pixels of the entire tilemap. + */ + widthInPixels?: number; + /** + * The height in pixels of the entire tilemap. + */ + heightInPixels?: number; + /** + * The format of the Tilemap, as defined in Tiled. + */ + format?: integer; + /** + * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. + */ + orientation?: string; + /** + * Determines the draw order of tilemap. Default is right-down. + */ + renderOrder?: string; + /** + * The version of Tiled the map uses. + */ + version?: number; + /** + * Map specific properties (can be specified in Tiled). + */ + properties?: number; + /** + * The layers of the tilemap. + */ + layers?: Phaser.Tilemaps.LayerData[]; + /** + * An array with all the layers configured to the MapData. + */ + images?: any[]; + /** + * An array of Tiled Image Layers. + */ + objects?: object; + /** + * An object of Tiled Object Layers. + */ + collision?: object; + /** + * The tilesets the map uses. + */ + tilesets?: Phaser.Tilemaps.Tileset[]; + /** + * The collection of images the map uses(specified in Tiled). + */ + imageCollections?: any[]; + /** + * [description] + */ + tiles?: any[]; + }; + + type ObjectLayerConfig = { + /** + * The name of the Object Layer. + */ + name?: string; + /** + * The opacity of the layer, between 0 and 1. + */ + opacity?: number; + /** + * The custom properties defined on the Object Layer, keyed by their name. + */ + properties?: any; + /** + * The type of each custom property defined on the Object Layer, keyed by its name. + */ + propertytypes?: any; + /** + * The type of the layer, which should be `objectgroup`. + */ + type?: string; + /** + * Whether the layer is shown (`true`) or hidden (`false`). + */ + visible?: boolean; + /** + * An array of all objects on this Object Layer. + */ + objects?: any[]; + }; + + type StyleConfig = { + /** + * Color to use for drawing a filled rectangle at non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. + */ + tileColor?: Phaser.Display.Color | number | null; + /** + * Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. + */ + collidingTileColor?: Phaser.Display.Color | number | null; + /** + * Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn. + */ + faceColor?: Phaser.Display.Color | number | null; + }; + + type TiledObject = { + /** + * The unique object ID. + */ + id: integer; + /** + * The name this object was assigned in Tiled. + */ + name: string; + /** + * The type, as assigned in Tiled. + */ + type: string; + /** + * The visible state of this object. + */ + visible?: boolean; + /** + * The horizontal position of this object, in pixels, relative to the tilemap. + */ + x?: number; + /** + * The vertical position of this object, in pixels, relative to the tilemap. + */ + y?: number; + /** + * The width of this object, in pixels. + */ + width?: number; + /** + * The height of this object, in pixels. + */ + height?: number; + /** + * The rotation of the object in clockwise degrees. + */ + rotation?: number; + /** + * Custom properties object. + */ + properties?: any; + /** + * Only set if of type 'tile'. + */ + gid?: integer; + /** + * Only set if a tile object. The horizontal flip value. + */ + flippedHorizontal?: boolean; + /** + * Only set if a tile object. The vertical flip value. + */ + flippedVertical?: boolean; + /** + * Only set if a tile object. The diagonal flip value. + */ + flippedAntiDiagonal?: boolean; + /** + * Only set if a polyline object. An array of objects corresponding to points, where each point has an `x` property and a `y` property. + */ + polyline?: Phaser.Types.Math.Vector2Like[]; + /** + * Only set if a polygon object. An array of objects corresponding to points, where each point has an `x` property and a `y` property. + */ + polygon?: Phaser.Types.Math.Vector2Like[]; + /** + * Only set if a text object. Contains the text objects properties. + */ + text?: any; + /** + * Only set, and set to `true`, if a rectangle object. + */ + rectangle?: boolean; + /** + * Only set, and set to `true`, if a ellipse object. + */ + ellipse?: boolean; + }; + + type TilemapConfig = { + /** + * The key in the Phaser cache that corresponds to the loaded tilemap data. + */ + key?: string; + /** + * Instead of loading from the cache, you can also load directly from a 2D array of tile indexes. + */ + data?: integer[][]; + /** + * The width of a tile in pixels. + */ + tileWidth?: integer; + /** + * The height of a tile in pixels. + */ + tileHeight?: integer; + /** + * The width of the map in tiles. + */ + width?: integer; + /** + * The height of the map in tiles. + */ + height?: integer; + /** + * Controls how empty tiles, tiles with an index of -1, + * in the map data are handled. If `true`, empty locations will get a value of `null`. If `false`, + * empty location will get a Tile object with an index of -1. If you've a large sparsely populated + * map and the tile data doesn't need to change then setting this value to `true` will help with + * memory consumption. However if your map is small or you need to update the tiles dynamically, + * then leave the default value set. + */ + insertNull?: boolean; + }; + + } + + namespace Time { + type TimerEventConfig = { + /** + * The delay after which the Timer Event should fire, in milliseconds. + */ + delay?: number; + /** + * The total number of times the Timer Event will repeat before finishing. + */ + repeat?: number; + /** + * `true` if the Timer Event should repeat indefinitely. + */ + loop?: boolean; + /** + * The callback which will be called when the Timer Event fires. + */ + callback?: Function; + /** + * The scope (`this` object) with which to invoke the `callback`. + */ + callbackScope?: any; + /** + * Additional arguments to be passed to the `callback`. + */ + args?: any[]; + /** + * The scale of the elapsed time. + */ + timeScale?: number; + /** + * The initial elapsed time in milliseconds. Useful if you want a long duration with repeat, but for the first loop to fire quickly. + */ + startAt?: number; + /** + * `true` if the Timer Event should be paused. + */ + paused?: boolean; + }; + + } + + namespace Tweens { + type TweenConfigDefaults = { + /** + * The object, or an array of objects, to run the tween on. + */ + targets: object | object[]; + /** + * The number of milliseconds to delay before the tween will start. + */ + delay?: number; + /** + * The duration of the tween in milliseconds. + */ + duration?: number; + /** + * The easing equation to use for the tween. + */ + ease?: string; + /** + * Optional easing parameters. + */ + easeParams?: any[]; + /** + * The number of milliseconds to hold the tween for before yoyo'ing. + */ + hold?: number; + /** + * The number of times to repeat the tween. + */ + repeat?: number; + /** + * The number of milliseconds to pause before a tween will repeat. + */ + repeatDelay?: number; + /** + * Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. + */ + yoyo?: boolean; + /** + * Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. + */ + flipX?: boolean; + /** + * Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. + */ + flipY?: boolean; + }; + + type GetEndCallback = (target: any, key: string, value: number)=>void; + + type GetStartCallback = (target: any, key: string, value: number)=>void; + + type NumberTweenBuilderConfig = { + /** + * The start number. + */ + from?: number; + /** + * The end number. + */ + to?: number; + /** + * The number of milliseconds to delay before the tween will start. + */ + delay?: number; + /** + * The duration of the tween in milliseconds. + */ + duration?: number; + /** + * The easing equation to use for the tween. + */ + ease?: string | Function; + /** + * Optional easing parameters. + */ + easeParams?: any[]; + /** + * The number of milliseconds to hold the tween for before yoyo'ing. + */ + hold?: number; + /** + * The number of times to repeat the tween. + */ + repeat?: number; + /** + * The number of milliseconds to pause before a tween will repeat. + */ + repeatDelay?: number; + /** + * Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. + */ + yoyo?: boolean; + /** + * Used when the Tween is part of a Timeline. + */ + offset?: number | Function | object | any[]; + /** + * The time the tween will wait before the onComplete event is dispatched once it has completed, in ms. + */ + completeDelay?: number | Function | object | any[]; + /** + * The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property tween has completed once. + */ + loop?: number | Function | object | any[]; + /** + * The time the tween will pause before starting either a yoyo or returning to the start for a repeat. + */ + loopDelay?: number | Function | object | any[]; + /** + * Does the tween start in a paused state (true) or playing (false)? + */ + paused?: boolean; + /** + * Use frames or milliseconds? + */ + useFrames?: boolean; + /** + * Scope (this) for the callbacks. The default scope is the tween. + */ + callbackScope?: any; + /** + * A function to call when the tween completes. + */ + onComplete?: Phaser.Types.Tweens.TweenOnCompleteCallback; + /** + * Additional parameters to pass to `onComplete`. + */ + onCompleteParams?: any[]; + /** + * Scope (this) for `onComplete`. + */ + onCompleteScope?: any; + /** + * A function to call each time the tween loops. + */ + onLoop?: Phaser.Types.Tweens.TweenOnLoopCallback; + /** + * Additional parameters to pass to `onLoop`. + */ + onLoopParams?: any[]; + /** + * Scope (this) for `onLoop`. + */ + onLoopScope?: any; + /** + * A function to call each time the tween repeats. Called once per property per target. + */ + onRepeat?: Phaser.Types.Tweens.TweenOnRepeatCallback; + /** + * Additional parameters to pass to `onRepeat`. + */ + onRepeatParams?: any[]; + /** + * Scope (this) for `onRepeat`. + */ + onRepeatScope?: any; + /** + * A function to call when the tween starts. + */ + onStart?: Phaser.Types.Tweens.TweenOnStartCallback; + /** + * Additional parameters to pass to `onStart`. + */ + onStartParams?: any[]; + /** + * Scope (this) for `onStart`. + */ + onStartScope?: any; + /** + * A function to call each time the tween steps. Called once per property per target. + */ + onUpdate?: Phaser.Types.Tweens.TweenOnUpdateCallback; + /** + * Additional parameters to pass to `onUpdate`. + */ + onUpdateParams?: any[]; + /** + * Scope (this) for `onUpdate`. + */ + onUpdateScope?: any; + /** + * A function to call each time the tween yoyos. Called once per property per target. + */ + onYoyo?: Phaser.Types.Tweens.TweenOnYoyoCallback; + /** + * Additional parameters to pass to `onYoyo`. + */ + onYoyoParams?: any[]; + /** + * Scope (this) for `onYoyo`. + */ + onYoyoScope?: any; + }; + + type TimelineBuilderConfig = { + /** + * An array of tween configuration objects to create and add into the new Timeline. If this doesn't exist or is empty, the Timeline will start off paused and none of the other configuration settings will be read. If it's a function, it will be called and its return value will be used as the array. + */ + tweens?: Phaser.Types.Tweens.TweenBuilderConfig[] | object[] | Function; + /** + * An array (or function which returns one) of default targets to which to apply the Timeline. Each individual Tween configuration can override this value. + */ + targets?: any; + /** + * If specified, each Tween in the Timeline will get an equal portion of this duration, usually in milliseconds, by default. Each individual Tween configuration can override the Tween's duration. + */ + totalDuration?: number; + /** + * If `totalDuration` is not specified, the default duration, usually in milliseconds, of each Tween which will be created. Each individual Tween configuration can override the Tween's duration. + */ + duration?: number; + /** + * The number of milliseconds to delay before the tween will start. Each individual Tween configuration can override this value. + */ + delay?: number; + /** + * Optional easing parameters. Each individual Tween configuration can override this value. + */ + easeParams?: any[]; + /** + * The easing equation to use for each tween. Each individual Tween configuration can override this value. + */ + ease?: string | Function; + /** + * The number of milliseconds to hold each tween before yoyoing. Each individual Tween configuration can override this value. + */ + hold?: number; + /** + * The number of times to repeat each tween. Each individual Tween configuration can override this value. + */ + repeat?: integer; + /** + * The number of milliseconds to pause before each tween will repeat. Each individual Tween configuration can override this value. + */ + repeatDelay?: number; + /** + * Should each tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. Each individual Tween configuration can override this value. + */ + yoyo?: boolean; + /** + * Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. Each individual Tween configuration can override this value. + */ + flipX?: boolean; + /** + * Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. Each individual Tween configuration can override this value. + */ + flipY?: boolean; + /** + * If specified, the time to wait, usually in milliseconds, before the Timeline completes. + */ + completeDelay?: number | Function | object | any[]; + /** + * How many times the Timeline should loop, or -1 to loop indefinitely. + */ + loop?: number | Function | object | any[]; + /** + * The time, usually in milliseconds, between each loop. + */ + loopDelay?: number | Function | object | any[]; + /** + * If `true`, the Timeline will start paused. + */ + paused?: boolean; + /** + * If `true`, all duration in the Timeline will be in frames instead of milliseconds. + */ + useFrames?: boolean; + /** + * The default scope (`this` value) to use for each callback registered by the Timeline Builder. If not specified, the Timeline itself will be used. + */ + callbackScope?: any; + /** + * If specified, the `onStart` callback for the Timeline, called every time it starts playing. + */ + onStart?: Phaser.Types.Tweens.TimelineOnStartCallback; + /** + * The scope (`this` value) to use for the `onStart` callback. If not specified, the `callbackScope` will be used. + */ + onStartScope?: any; + /** + * Additional arguments to pass to the `onStart` callback. The Timeline will always be the first argument. + */ + onStartParams?: any[]; + /** + * If specified, the `onUpdate` callback for the Timeline, called every frame it's active, regardless of its Tweens. + */ + onUpdate?: Phaser.Types.Tweens.TimelineOnUpdateCallback; + /** + * The scope (`this` value) to use for the `onUpdate` callback. If not specified, the `callbackScope` will be used. + */ + onUpdateScope?: any; + /** + * Additional arguments to pass to the `onUpdate` callback. The Timeline will always be the first argument. + */ + onUpdateParams?: any[]; + /** + * If specified, the `onLoop` callback for the Timeline, called every time it loops. + */ + onLoop?: Phaser.Types.Tweens.TimelineOnLoopCallback; + /** + * The scope (`this` value) to use for the `onLoop` callback. If not specified, the `callbackScope` will be used. + */ + onLoopScope?: any; + /** + * Additional arguments to pass to the `onLoop` callback. The Timeline will always be the first argument. + */ + onLoopParams?: any[]; + /** + * If specified, the `onYoyo` callback for the Timeline, called every time it yoyos. + */ + onYoyo?: Phaser.Types.Tweens.TimelineOnYoyoCallback; + /** + * The scope (`this` value) to use for the `onYoyo` callback. If not specified, the `callbackScope` will be used. + */ + onYoyoScope?: any; + /** + * Additional arguments to pass to the `onYoyo` callback. The first argument will always be `null`, while the Timeline will always be the second argument. + */ + onYoyoParams?: any[]; + /** + * If specified, the `onComplete` callback for the Timeline, called after it completes. + */ + onComplete?: Phaser.Types.Tweens.TimelineOnCompleteCallback; + /** + * The scope (`this` value) to use for the `onComplete` callback. If not specified, the `callbackScope` will be used. + */ + onCompleteScope?: any; + /** + * Additional arguments to pass to the `onComplete` callback. The Timeline will always be the first argument. + */ + onCompleteParams?: any[]; + }; + + type TimelineOnCompleteCallback = (timeline: Phaser.Tweens.Timeline, ...param: any[])=>void; + + type TimelineOnLoopCallback = (timeline: Phaser.Tweens.Timeline, ...param: any[])=>void; + + type TimelineOnStartCallback = (timeline: Phaser.Tweens.Timeline, ...param: any[])=>void; + + type TimelineOnUpdateCallback = (timeline: Phaser.Tweens.Timeline, ...param: any[])=>void; + + type TimelineOnYoyoCallback = (timeline: Phaser.Tweens.Timeline, ...param: any[])=>void; + + type TweenBuilderConfig = { + /** + * The object, or an array of objects, to run the tween on. + */ + targets: any; + /** + * The number of milliseconds to delay before the tween will start. + */ + delay?: number; + /** + * The duration of the tween in milliseconds. + */ + duration?: number; + /** + * The easing equation to use for the tween. + */ + ease?: string | Function; + /** + * Optional easing parameters. + */ + easeParams?: any[]; + /** + * The number of milliseconds to hold the tween for before yoyo'ing. + */ + hold?: number; + /** + * The number of times each property tween repeats. + */ + repeat?: number; + /** + * The number of milliseconds to pause before a repeat. + */ + repeatDelay?: number; + /** + * Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. + */ + yoyo?: boolean; + /** + * Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. + */ + flipX?: boolean; + /** + * Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. + */ + flipY?: boolean; + /** + * Used when the Tween is part of a Timeline. + */ + offset?: number | Function | object | any[]; + /** + * The time the tween will wait before the onComplete event is dispatched once it has completed, in ms. + */ + completeDelay?: number | Function | object | any[]; + /** + * The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property tween has completed once. + */ + loop?: number | Function | object | any[]; + /** + * The time the tween will pause before starting either a yoyo or returning to the start for a repeat. + */ + loopDelay?: number | Function | object | any[]; + /** + * Does the tween start in a paused state (true) or playing (false)? + */ + paused?: boolean; + /** + * The properties to tween. + */ + props?: {[key: string]: (number|string|Phaser.Types.Tweens.GetEndCallback|Phaser.Types.Tweens.TweenPropConfig)}; + /** + * Use frames or milliseconds? + */ + useFrames?: boolean; + /** + * Scope (this) for the callbacks. The default scope is the tween. + */ + callbackScope?: any; + /** + * A function to call when the tween completes. + */ + onComplete?: Phaser.Types.Tweens.TweenOnCompleteCallback; + /** + * Additional parameters to pass to `onComplete`. + */ + onCompleteParams?: any[]; + /** + * Scope (this) for `onComplete`. + */ + onCompleteScope?: any; + /** + * A function to call each time the tween loops. + */ + onLoop?: Phaser.Types.Tweens.TweenOnLoopCallback; + /** + * Additional parameters to pass to `onLoop`. + */ + onLoopParams?: any[]; + /** + * Scope (this) for `onLoop`. + */ + onLoopScope?: any; + /** + * A function to call each time the tween repeats. Called once per property per target. + */ + onRepeat?: Phaser.Types.Tweens.TweenOnRepeatCallback; + /** + * Additional parameters to pass to `onRepeat`. + */ + onRepeatParams?: any[]; + /** + * Scope (this) for `onRepeat`. + */ + onRepeatScope?: any; + /** + * A function to call when the tween starts. + */ + onStart?: Phaser.Types.Tweens.TweenOnStartCallback; + /** + * Additional parameters to pass to `onStart`. + */ + onStartParams?: any[]; + /** + * Scope (this) for `onStart`. + */ + onStartScope?: any; + /** + * A function to call each time the tween steps. Called once per property per target. + */ + onUpdate?: Phaser.Types.Tweens.TweenOnUpdateCallback; + /** + * Additional parameters to pass to `onUpdate`. + */ + onUpdateParams?: any[]; + /** + * Scope (this) for `onUpdate`. + */ + onUpdateScope?: any; + /** + * A function to call each time the tween yoyos. Called once per property per target. + */ + onYoyo?: Phaser.Types.Tweens.TweenOnYoyoCallback; + /** + * Additional parameters to pass to `onYoyo`. + */ + onYoyoParams?: any[]; + /** + * Scope (this) for `onYoyo`. + */ + onYoyoScope?: any; + }; + + type TweenDataConfig = { + /** + * The target to tween. + */ + target: any; + /** + * The property of the target being tweened. + */ + key: string; + /** + * The returned value sets what the property will be at the END of the Tween. + */ + getEndValue: Function; + /** + * The returned value sets what the property will be at the START of the Tween. + */ + getStartValue: Function; + /** + * The ease function this tween uses. + */ + ease: Function; + /** + * Duration of the tween in ms/frames, excludes time for yoyo or repeats. + */ + duration?: number; + /** + * The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo) + */ + totalDuration?: number; + /** + * Time in ms/frames before tween will start. + */ + delay?: number; + /** + * Cause the tween to return back to its start value after hold has expired. + */ + yoyo?: boolean; + /** + * Time in ms/frames the tween will pause before running the yoyo or starting a repeat. + */ + hold?: number; + /** + * Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + */ + repeat?: integer; + /** + * Time in ms/frames before the repeat will start. + */ + repeatDelay?: number; + /** + * Automatically call toggleFlipX when the TweenData yoyos or repeats + */ + flipX?: boolean; + /** + * Automatically call toggleFlipY when the TweenData yoyos or repeats + */ + flipY?: boolean; + /** + * Between 0 and 1 showing completion of this TweenData. + */ + progress?: number; + /** + * Delta counter + */ + elapsed?: number; + /** + * How many repeats are left to run? + */ + repeatCounter?: integer; + /** + * Ease value data. + */ + start?: number; + /** + * Ease value data. + */ + current?: number; + /** + * Ease value data. + */ + end?: number; + /** + * Time duration 1. + */ + t1?: number; + /** + * Time duration 2. + */ + t2?: number; + /** + * LoadValue generation functions. + */ + gen?: Phaser.Types.Tweens.TweenDataGenConfig; + /** + * TWEEN_CONST.CREATED + */ + state?: integer; + }; + + type TweenDataGenConfig = { + /** + * Time in ms/frames before tween will start. + */ + delay: Function; + /** + * Duration of the tween in ms/frames, excludes time for yoyo or repeats. + */ + duration: Function; + /** + * Time in ms/frames the tween will pause before running the yoyo or starting a repeat. + */ + hold: Function; + /** + * Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + */ + repeat: Function; + /** + * Time in ms/frames before the repeat will start. + */ + repeatDelay: Function; + }; + + type TweenOnCompleteCallback = (tween: Phaser.Tweens.Tween, targets: any[], ...param: any[])=>void; + + type TweenOnLoopCallback = (tween: Phaser.Tweens.Tween, targets: any[], ...param: any[])=>void; + + type TweenOnRepeatCallback = (tween: Phaser.Tweens.Tween, target: any, ...param: any[])=>void; + + type TweenOnStartCallback = (tween: Phaser.Tweens.Tween, targets: any[], ...param: any[])=>void; + + type TweenOnUpdateCallback = (tween: Phaser.Tweens.Tween, target: any, ...param: any[])=>void; + + type TweenOnYoyoCallback = (tween: Phaser.Tweens.Tween, target: any, ...param: any[])=>void; + + type TweenPropConfig = { + /** + * What the property will be at the END of the Tween. + */ + value?: number | string | Phaser.Types.Tweens.GetEndCallback | Phaser.Types.Tweens.TweenPropConfig; + /** + * What the property will be at the END of the Tween. + */ + getEnd?: Phaser.Types.Tweens.GetEndCallback; + /** + * What the property will be at the START of the Tween. + */ + getStart?: Phaser.Types.Tweens.GetStartCallback; + /** + * The ease function this tween uses. + */ + ease?: string | Function; + /** + * Time in ms/frames before tween will start. + */ + delay?: number; + /** + * Duration of the tween in ms/frames. + */ + duration?: number; + /** + * Determines whether the tween should return back to its start value after hold has expired. + */ + yoyo?: boolean; + /** + * Time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + */ + hold?: number; + /** + * Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + */ + repeat?: number; + /** + * Time in ms/frames before the repeat will start. + */ + repeatDelay?: number; + /** + * Should toggleFlipX be called when yoyo or repeat happens? + */ + flipX?: boolean; + /** + * Should toggleFlipY be called when yoyo or repeat happens? + */ + flipY?: boolean; + }; + + } + + } + + namespace Physics { + namespace Arcade { + /** + * An Arcade Physics Image is an Image with an Arcade Physics body and related components. + * The body can be dynamic or static. + * + * The main difference between an Arcade Image and an Arcade Sprite is that you cannot animate an Arcade Image. + */ + class Image extends Phaser.GameObjects.Image implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer); + + /** + * This Game Object's Physics Body. + */ + body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. + * @param x The horizontal acceleration + * @param y The vertical acceleration Default x. + */ + setAcceleration(x: number, y?: number): this; + + /** + * Sets the body's horizontal acceleration. + * @param value The horizontal acceleration + */ + setAccelerationX(value: number): this; + + /** + * Sets the body's vertical acceleration. + * @param value The vertical acceleration + */ + setAccelerationY(value: number): this; + + /** + * Sets the angular velocity of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular velocity. + */ + setAngularVelocity(value: number): this; + + /** + * Sets the angular acceleration of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular acceleration. + */ + setAngularAcceleration(value: number): this; + + /** + * Sets the angular drag of the body. Drag is applied to the current velocity, providing a form of deceleration. + * @param value The amount of drag. + */ + setAngularDrag(value: number): this; + + /** + * Sets the bounce values of this body. + * + * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. + * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. + * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + * @param y The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. Default x. + */ + setBounce(x: number, y?: number): this; + + /** + * Sets the horizontal bounce value for this body. + * @param value The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceX(value: number): this; + + /** + * Sets the vertical bounce value for this body. + * @param value The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceY(value: number): this; + + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Vec2 first. + * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. + * @param bounceX If given this will be replace the `worldBounce.x` value. + * @param bounceY If given this will be replace the `worldBounce.y` value. + */ + setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number): this; + + /** + * Sets the debug values of this body. + * + * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. + * Note that there is a performance cost in drawing debug displays. It should never be used in production. + * @param showBody Set to `true` to have this body render its outline to the debug display. + * @param showVelocity Set to `true` to have this body render a velocity marker to the debug display. + * @param bodyColor The color of the body outline when rendered to the debug display. + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): this; + + /** + * Sets the color of the body outline when it renders to the debug display. + * @param value The color of the body outline when rendered to the debug display. + */ + setDebugBodyColor(value: number): this; + + /** + * Set to `true` to have this body render its outline to the debug display. + */ + debugShowBody: boolean; + + /** + * Set to `true` to have this body render a velocity marker to the debug display. + */ + debugShowVelocity: boolean; + + /** + * The color of the body outline when it renders to the debug display. + */ + debugBodyColor: number; + + /** + * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param x The amount of horizontal drag to apply. + * @param y The amount of vertical drag to apply. Default x. + */ + setDrag(x: number, y?: number): this; + + /** + * Sets the body's horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of horizontal drag to apply. + */ + setDragX(value: number): this; + + /** + * Sets the body's vertical drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of vertical drag to apply. + */ + setDragY(value: number): this; + + /** + * If this Body is using `drag` for deceleration this function controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * @param value `true` to use damping for deceleration, or `false` to use linear deceleration. + */ + setDamping(value: boolean): this; + + /** + * Enables this Game Object's Body. + * @param reset Also reset the Body and place it at (x, y). + * @param x The horizontal position to place the Game Object and Body. + * @param y The horizontal position to place the Game Object and Body. + * @param enableGameObject Also activate this Game Object. + * @param showGameObject Also show this Game Object. + */ + enableBody(reset: boolean, x: number, y: number, enableGameObject: boolean, showGameObject: boolean): this; + + /** + * Stops and disables this Game Object's Body. + * @param disableGameObject Also deactivate this Game Object. Default false. + * @param hideGameObject Also hide this Game Object. Default false. + */ + disableBody(disableGameObject?: boolean, hideGameObject?: boolean): this; + + /** + * Syncs the Body's position and size with its parent Game Object. + * You don't need to call this for Dynamic Bodies, as it happens automatically. + * But for Static bodies it's a useful way of modifying the position of a Static Body + * in the Physics World, based on its Game Object. + */ + refreshBody(): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of horizontal friction to apply. + * @param y The amount of vertical friction to apply. Default x. + */ + setFriction(x: number, y?: number): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionX(x: number): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionY(x: number): this; + + /** + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. + * @param x The gravitational force to be applied to the X-axis. + * @param y The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. Default x. + */ + setGravity(x: number, y?: number): this; + + /** + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param x The gravitational force to be applied to the X-axis. + */ + setGravityX(x: number): this; + + /** + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param y The gravitational force to be applied to the Y-axis. + */ + setGravityY(y: number): this; + + /** + * Sets Whether this Body can be moved by collisions with another Body. + * @param value Sets if this body can be moved by collisions with another Body. Default true. + */ + setImmovable(value?: boolean): this; + + /** + * Sets the mass of the physics body + * @param value New value for the mass of the body. + */ + setMass(value: number): this; + + /** + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. + * @param x The amount to offset the body from the parent Game Object along the x-axis. + * @param y The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. Default x. + */ + setOffset(x: number, y?: number): this; + + /** + * Sets this physics body to use a circle for collision instead of a rectangle. + * @param radius The radius of the physics body, in pixels. + * @param offsetX The amount to offset the body from the parent Game Object along the x-axis. + * @param offsetY The amount to offset the body from the parent Game Object along the y-axis. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): this; + + /** + * Sets the velocity of the Body. + * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. + * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. + */ + setVelocity(x: number, y?: number): this; + + /** + * Sets the horizontal component of the body's velocity. + * + * Positive values move the body to the right, while negative values move it to the left. + * @param x The new horizontal velocity. + */ + setVelocityX(x: number): this; + + /** + * Sets the vertical component of the body's velocity. + * + * Positive values move the body down, while negative values move it up. + * @param y The new vertical velocity of the body. + */ + setVelocityY(y: number): this; + + /** + * Sets the maximum velocity of the body. + * @param x The new maximum horizontal velocity. + * @param y The new maximum vertical velocity. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + + } + + /** + * The Arcade Physics Plugin belongs to a Scene and sets up and manages the Scene's physics simulation. + * It also holds some useful methods for moving and rotating Arcade Physics Bodies. + * + * You can access it from within a Scene using `this.physics`. + * + * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable + * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. + * The separation that stops two objects penetrating may create a new penetration against a different object. If you + * require a high level of stability please consider using an alternative physics system, such as Matter.js. + */ + class ArcadePhysics { + /** + * + * @param scene The Scene that this Plugin belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene that this Plugin belongs to. + */ + scene: Phaser.Scene; + + /** + * The Scene's Systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * A configuration object. Union of the `physics.arcade.*` properties of the GameConfig and SceneConfig objects. + */ + config: object; + + /** + * The physics simulation. + */ + world: Phaser.Physics.Arcade.World; + + /** + * An object holding the Arcade Physics factory methods. + */ + add: Phaser.Physics.Arcade.Factory; + + /** + * Creates the physics configuration for the current Scene. + */ + getConfig(): object; + + /** + * Tests if Game Objects overlap. See {@link Phaser.Physics.Arcade.World#overlap} + * @param object1 The first object or array of objects to check. + * @param object2 The second object or array of objects to check, or `undefined`. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + overlap(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2?: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * Performs a collision check and separation between the two physics enabled objects given, which can be single + * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. + * + * If you don't require separation then use {@link #overlap} instead. + * + * If two Groups or arrays are passed, each member of one will be tested against each member of the other. + * + * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members. + * + * If **only** one Array is passed, the array is iterated and every element in it is tested against the others. + * + * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding + * objects are passed to it. + * + * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable + * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. + * The separation that stops two objects penetrating may create a new penetration against a different object. If you + * require a high level of stability please consider using an alternative physics system, such as Matter.js. + * @param object1 The first object or array of objects to check. + * @param object2 The second object or array of objects to check, or `undefined`. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + collide(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2?: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects. + * + * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for collision with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions + * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * + * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have + * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the + * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on + * dynamic maps, this method can prove very useful. + * @param sprite The first object to check for collision. + * @param tiles An array of Tiles to check for collision against. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + collideTiles(sprite: Phaser.GameObjects.GameObject, tiles: Phaser.Tilemaps.Tile[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects. + * + * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap + * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * @param sprite The first object to check for collision. + * @param tiles An array of Tiles to check for collision against. + * @param collideCallback An optional callback function that is called if the objects overlap. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + overlapTiles(sprite: Phaser.GameObjects.GameObject, tiles: Phaser.Tilemaps.Tile[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * Pauses the simulation. + */ + pause(): Phaser.Physics.Arcade.World; + + /** + * Resumes the simulation (if paused). + */ + resume(): Phaser.Physics.Arcade.World; + + /** + * Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared) + * + * You must give a maximum speed value, beyond which the game object won't go any faster. + * + * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course. + * Note: The game object doesn't stop moving once it reaches the destination coordinates. + * @param gameObject Any Game Object with an Arcade Physics body. + * @param x The x coordinate to accelerate towards. + * @param y The y coordinate to accelerate towards. + * @param speed The acceleration (change in speed) in pixels per second squared. Default 60. + * @param xSpeedMax The maximum x velocity the game object can reach. Default 500. + * @param ySpeedMax The maximum y velocity the game object can reach. Default 500. + */ + accelerateTo(gameObject: Phaser.GameObjects.GameObject, x: number, y: number, speed?: number, xSpeedMax?: number, ySpeedMax?: number): number; + + /** + * Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared) + * + * You must give a maximum speed value, beyond which the game object won't go any faster. + * + * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course. + * Note: The game object doesn't stop moving once it reaches the destination coordinates. + * @param gameObject Any Game Object with an Arcade Physics body. + * @param destination The Game Object to move towards. Can be any object but must have visible x/y properties. + * @param speed The acceleration (change in speed) in pixels per second squared. Default 60. + * @param xSpeedMax The maximum x velocity the game object can reach. Default 500. + * @param ySpeedMax The maximum y velocity the game object can reach. Default 500. + */ + accelerateToObject(gameObject: Phaser.GameObjects.GameObject, destination: Phaser.GameObjects.GameObject, speed?: number, xSpeedMax?: number, ySpeedMax?: number): number; + + /** + * Finds the Dynamic Body closest to a source point or object. + * + * If two or more bodies are the exact same distance from the source point, only the first body + * is returned. + * @param source Any object with public `x` and `y` properties, such as a Game Object or Geometry object. + */ + closest(source: any): Phaser.Physics.Arcade.Body; + + /** + * Finds the Dynamic Body farthest from a source point or object. + * + * If two or more bodies are the exact same distance from the source point, only the first body + * is returned. + * @param source Any object with public `x` and `y` properties, such as a Game Object or Geometry object. + */ + furthest(source: any): Phaser.Physics.Arcade.Body; + + /** + * Move the given display object towards the x/y coordinates at a steady velocity. + * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds. + * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. + * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. + * Note: The display object doesn't stop moving once it reaches the destination coordinates. + * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) + * @param gameObject Any Game Object with an Arcade Physics body. + * @param x The x coordinate to move towards. + * @param y The y coordinate to move towards. + * @param speed The speed it will move, in pixels per second (default is 60 pixels/sec) Default 60. + * @param maxTime Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms. Default 0. + */ + moveTo(gameObject: Phaser.GameObjects.GameObject, x: number, y: number, speed?: number, maxTime?: number): number; + + /** + * Move the given display object towards the destination object at a steady velocity. + * If you specify a maxTime then it will adjust the speed (overwriting what you set) so it arrives at the destination in that number of seconds. + * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. + * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. + * Note: The display object doesn't stop moving once it reaches the destination coordinates. + * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) + * @param gameObject Any Game Object with an Arcade Physics body. + * @param destination Any object with public `x` and `y` properties, such as a Game Object or Geometry object. + * @param speed The speed it will move, in pixels per second (default is 60 pixels/sec) Default 60. + * @param maxTime Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms. Default 0. + */ + moveToObject(gameObject: Phaser.GameObjects.GameObject, destination: object, speed?: number, maxTime?: number): number; + + /** + * Given the angle (in degrees) and speed calculate the velocity and return it as a vector, or set it to the given vector object. + * One way to use this is: velocityFromAngle(angle, 200, sprite.body.velocity) which will set the values directly to the sprite's velocity and not create a new vector object. + * @param angle The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) + * @param speed The speed it will move, in pixels per second squared. Default 60. + * @param vec2 The Vector2 in which the x and y properties will be set to the calculated velocity. + */ + velocityFromAngle(angle: number, speed?: number, vec2?: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * Given the rotation (in radians) and speed calculate the velocity and return it as a vector, or set it to the given vector object. + * One way to use this is: velocityFromRotation(rotation, 200, sprite.body.velocity) which will set the values directly to the sprite's velocity and not create a new vector object. + * @param rotation The angle in radians. + * @param speed The speed it will move, in pixels per second squared Default 60. + * @param vec2 The Vector2 in which the x and y properties will be set to the calculated velocity. + */ + velocityFromRotation(rotation: number, speed?: number, vec2?: Phaser.Math.Vector2): Phaser.Math.Vector2; + + /** + * This method will search the given rectangular area and return an array of all physics bodies that + * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. + * + * A body only has to intersect with the search area to be considered, it doesn't have to be fully + * contained within it. + * + * If Arcade Physics is set to use the RTree (which it is by default) then the search for is extremely fast, + * otherwise the search is O(N) for Dynamic Bodies. + * @param x The top-left x coordinate of the area to search within. + * @param y The top-left y coordinate of the area to search within. + * @param width The width of the area to search within. + * @param height The height of the area to search within. + * @param includeDynamic Should the search include Dynamic Bodies? Default true. + * @param includeStatic Should the search include Static Bodies? Default false. + */ + overlapRect(x: number, y: number, width: number, height: number, includeDynamic?: boolean, includeStatic?: boolean): Phaser.Physics.Arcade.Body[] | Phaser.Physics.Arcade.StaticBody[]; + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + */ + shutdown(): void; + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + */ + destroy(): void; + + } + + /** + * An Arcade Physics Sprite is a Sprite with an Arcade Physics body and related components. + * The body can be dynamic or static. + * + * The main difference between an Arcade Sprite and an Arcade Image is that you cannot animate an Arcade Image. + * If you do not require animation then you can safely use Arcade Images instead of Arcade Sprites. + */ + class Sprite extends Phaser.GameObjects.Sprite implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(scene: Phaser.Scene, x: number, y: number, texture: string, frame?: string | integer); + + /** + * This Game Object's Physics Body. + */ + body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. + * @param x The horizontal acceleration + * @param y The vertical acceleration Default x. + */ + setAcceleration(x: number, y?: number): this; + + /** + * Sets the body's horizontal acceleration. + * @param value The horizontal acceleration + */ + setAccelerationX(value: number): this; + + /** + * Sets the body's vertical acceleration. + * @param value The vertical acceleration + */ + setAccelerationY(value: number): this; + + /** + * Sets the angular velocity of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular velocity. + */ + setAngularVelocity(value: number): this; + + /** + * Sets the angular acceleration of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular acceleration. + */ + setAngularAcceleration(value: number): this; + + /** + * Sets the angular drag of the body. Drag is applied to the current velocity, providing a form of deceleration. + * @param value The amount of drag. + */ + setAngularDrag(value: number): this; + + /** + * Sets the bounce values of this body. + * + * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. + * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. + * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + * @param y The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. Default x. + */ + setBounce(x: number, y?: number): this; + + /** + * Sets the horizontal bounce value for this body. + * @param value The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceX(value: number): this; + + /** + * Sets the vertical bounce value for this body. + * @param value The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceY(value: number): this; + + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Vec2 first. + * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. + * @param bounceX If given this will be replace the `worldBounce.x` value. + * @param bounceY If given this will be replace the `worldBounce.y` value. + */ + setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number): this; + + /** + * Sets the debug values of this body. + * + * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. + * Note that there is a performance cost in drawing debug displays. It should never be used in production. + * @param showBody Set to `true` to have this body render its outline to the debug display. + * @param showVelocity Set to `true` to have this body render a velocity marker to the debug display. + * @param bodyColor The color of the body outline when rendered to the debug display. + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): this; + + /** + * Sets the color of the body outline when it renders to the debug display. + * @param value The color of the body outline when rendered to the debug display. + */ + setDebugBodyColor(value: number): this; + + /** + * Set to `true` to have this body render its outline to the debug display. + */ + debugShowBody: boolean; + + /** + * Set to `true` to have this body render a velocity marker to the debug display. + */ + debugShowVelocity: boolean; + + /** + * The color of the body outline when it renders to the debug display. + */ + debugBodyColor: number; + + /** + * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param x The amount of horizontal drag to apply. + * @param y The amount of vertical drag to apply. Default x. + */ + setDrag(x: number, y?: number): this; + + /** + * Sets the body's horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of horizontal drag to apply. + */ + setDragX(value: number): this; + + /** + * Sets the body's vertical drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of vertical drag to apply. + */ + setDragY(value: number): this; + + /** + * If this Body is using `drag` for deceleration this function controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * @param value `true` to use damping for deceleration, or `false` to use linear deceleration. + */ + setDamping(value: boolean): this; + + /** + * Enables this Game Object's Body. + * @param reset Also reset the Body and place it at (x, y). + * @param x The horizontal position to place the Game Object and Body. + * @param y The horizontal position to place the Game Object and Body. + * @param enableGameObject Also activate this Game Object. + * @param showGameObject Also show this Game Object. + */ + enableBody(reset: boolean, x: number, y: number, enableGameObject: boolean, showGameObject: boolean): this; + + /** + * Stops and disables this Game Object's Body. + * @param disableGameObject Also deactivate this Game Object. Default false. + * @param hideGameObject Also hide this Game Object. Default false. + */ + disableBody(disableGameObject?: boolean, hideGameObject?: boolean): this; + + /** + * Syncs the Body's position and size with its parent Game Object. + * You don't need to call this for Dynamic Bodies, as it happens automatically. + * But for Static bodies it's a useful way of modifying the position of a Static Body + * in the Physics World, based on its Game Object. + */ + refreshBody(): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of horizontal friction to apply. + * @param y The amount of vertical friction to apply. Default x. + */ + setFriction(x: number, y?: number): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionX(x: number): this; + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionY(x: number): this; + + /** + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. + * @param x The gravitational force to be applied to the X-axis. + * @param y The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. Default x. + */ + setGravity(x: number, y?: number): this; + + /** + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param x The gravitational force to be applied to the X-axis. + */ + setGravityX(x: number): this; + + /** + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param y The gravitational force to be applied to the Y-axis. + */ + setGravityY(y: number): this; + + /** + * Sets Whether this Body can be moved by collisions with another Body. + * @param value Sets if this body can be moved by collisions with another Body. Default true. + */ + setImmovable(value?: boolean): this; + + /** + * Sets the mass of the physics body + * @param value New value for the mass of the body. + */ + setMass(value: number): this; + + /** + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. + * @param x The amount to offset the body from the parent Game Object along the x-axis. + * @param y The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. Default x. + */ + setOffset(x: number, y?: number): this; + + /** + * Sets this physics body to use a circle for collision instead of a rectangle. + * @param radius The radius of the physics body, in pixels. + * @param offsetX The amount to offset the body from the parent Game Object along the x-axis. + * @param offsetY The amount to offset the body from the parent Game Object along the y-axis. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): this; + + /** + * Sets the velocity of the Body. + * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. + * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. + */ + setVelocity(x: number, y?: number): this; + + /** + * Sets the horizontal component of the body's velocity. + * + * Positive values move the body to the right, while negative values move it to the left. + * @param x The new horizontal velocity. + */ + setVelocityX(x: number): this; + + /** + * Sets the vertical component of the body's velocity. + * + * Positive values move the body down, while negative values move it up. + * @param y The new vertical velocity of the body. + */ + setVelocityY(y: number): this; + + /** + * Sets the maximum velocity of the body. + * @param x The new maximum horizontal velocity. + * @param y The new maximum vertical velocity. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + + } + + /** + * A Dynamic Arcade Body. + * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticBody}. + */ + class Body { + /** + * + * @param world The Arcade Physics simulation this Body belongs to. + * @param gameObject The Game Object this Body belongs to. + */ + constructor(world: Phaser.Physics.Arcade.World, gameObject: Phaser.GameObjects.GameObject); + + /** + * The Arcade Physics simulation this Body belongs to. + */ + world: Phaser.Physics.Arcade.World; + + /** + * The Game Object this Body belongs to. + */ + gameObject: Phaser.GameObjects.GameObject; + + /** + * Transformations applied to this Body. + */ + transform: object; + + /** + * Whether the Body's boundary is drawn to the debug display. + */ + debugShowBody: boolean; + + /** + * Whether the Body's velocity is drawn to the debug display. + */ + debugShowVelocity: boolean; + + /** + * The color of this Body on the debug display. + */ + debugBodyColor: integer; + + /** + * Whether this Body is updated by the physics simulation. + */ + enable: boolean; + + /** + * Whether this Body's boundary is circular (true) or rectangular (false). + */ + isCircle: boolean; + + /** + * If this Body is circular, this is the unscaled radius of the Body's boundary, as set by setCircle(), in source pixels. + * The true radius is equal to `halfWidth`. + */ + radius: number; + + /** + * The offset of this Body's position from its Game Object's position, in source pixels. + */ + offset: Phaser.Math.Vector2; + + /** + * The position of this Body within the simulation. + */ + position: Phaser.Math.Vector2; + + /** + * The position of this Body during the previous step. + */ + prev: Phaser.Math.Vector2; + + /** + * Whether this Body's `rotation` is affected by its angular acceleration and angular velocity. + */ + allowRotation: boolean; + + /** + * This body's rotation, in degrees, based on its angular acceleration and angular velocity. + * The Body's rotation controls the `angle` of its Game Object. + * It doesn't rotate the Body's boundary, which is always an axis-aligned rectangle or a circle. + */ + rotation: number; + + /** + * The Body's rotation, in degrees, during the previous step. + */ + preRotation: number; + + /** + * The width of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. + */ + width: number; + + /** + * The height of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. + */ + height: number; + + /** + * The unscaled width of the Body, in source pixels, as set by setSize(). + * The default is the width of the Body's Game Object's texture frame. + */ + sourceWidth: number; + + /** + * The unscaled height of the Body, in source pixels, as set by setSize(). + * The default is the height of the Body's Game Object's texture frame. + */ + sourceHeight: number; + + /** + * Half the Body's width, in pixels. + */ + halfWidth: number; + + /** + * Half the Body's height, in pixels. + */ + halfHeight: number; + + /** + * The center of the Body's boundary. + * The midpoint of its `position` (top-left corner) and its bottom-right corner. + */ + center: Phaser.Math.Vector2; + + /** + * The Body's velocity, in pixels per second. + */ + velocity: Phaser.Math.Vector2; + + /** + * The Body's calculated velocity, in pixels per second, at the last step. + */ + readonly newVelocity: Phaser.Math.Vector2; + + /** + * The Body's absolute maximum change in position, in pixels per step. + */ + deltaMax: Phaser.Math.Vector2; + + /** + * The Body's change in velocity, in pixels per second squared. + */ + acceleration: Phaser.Math.Vector2; + + /** + * Whether this Body's velocity is affected by its `drag`. + */ + allowDrag: boolean; + + /** + * Absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + */ + drag: Phaser.Math.Vector2 | number; + + /** + * Whether this Body's position is affected by gravity (local or world). + */ + allowGravity: boolean; + + /** + * Acceleration due to gravity (specific to this Body), in pixels per second squared. + * Total gravity is the sum of this vector and the simulation's `gravity`. + */ + gravity: Phaser.Math.Vector2; + + /** + * Rebound following a collision, relative to 1. + */ + bounce: Phaser.Math.Vector2; + + /** + * Rebound following a collision with the world boundary, relative to 1. + * If null, `bounce` is used instead. + */ + worldBounce: Phaser.Math.Vector2; + + /** + * Whether the simulation emits a `worldbounds` event when this Body collides with the world boundary (and `collideWorldBounds` is also true). + */ + onWorldBounds: boolean; + + /** + * Whether the simulation emits a `collide` event when this Body collides with another. + */ + onCollide: boolean; + + /** + * Whether the simulation emits an `overlap` event when this Body overlaps with another. + */ + onOverlap: boolean; + + /** + * The Body's absolute maximum velocity, in pixels per second. + * The horizontal and vertical components are applied separately. + */ + maxVelocity: Phaser.Math.Vector2; + + /** + * The maximum speed this Body is allowed to reach. + * + * If not negative it limits the scalar value of speed. + * + * Any negative value means no maximum is being applied. + */ + maxSpeed: number; + + /** + * If this Body is `immovable` and in motion, `friction` is the proportion of this Body's motion received by the riding Body on each axis, relative to 1. + * The default value (1, 0) moves the riding Body horizontally in equal proportion to this Body and vertically not at all. + * The horizontal component (x) is applied only when two colliding Bodies are separated vertically. + * The vertical component (y) is applied only when two colliding Bodies are separated horizontally. + */ + friction: Phaser.Math.Vector2; + + /** + * If this Body is using `drag` for deceleration this property controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + */ + useDamping: boolean; + + /** + * The rate of change of this Body's `rotation`, in degrees per second. + */ + angularVelocity: number; + + /** + * The Body's angular acceleration (change in angular velocity), in degrees per second squared. + */ + angularAcceleration: number; + + /** + * Loss of angular velocity due to angular movement, in degrees per second. + * + * Angular drag is applied only when angular acceleration is zero. + */ + angularDrag: number; + + /** + * The Body's maximum angular velocity, in degrees per second. + */ + maxAngular: number; + + /** + * The Body's inertia, relative to a default unit (1). + * With `bounce`, this affects the exchange of momentum (velocities) during collisions. + */ + mass: number; + + /** + * The calculated angle of this Body's velocity vector, in radians, during the last step. + */ + angle: number; + + /** + * The calculated magnitude of the Body's velocity, in pixels per second, during the last step. + */ + speed: number; + + /** + * The direction of the Body's velocity, as calculated during the last step. + * If the Body is moving on both axes (diagonally), this describes motion on the vertical axis only. + */ + facing: integer; + + /** + * Whether this Body can be moved by collisions with another Body. + */ + immovable: boolean; + + /** + * Whether the Body's position and rotation are affected by its velocity, acceleration, drag, and gravity. + */ + moves: boolean; + + /** + * A flag disabling the default horizontal separation of colliding bodies. + * Pass your own `collideCallback` to the collider. + */ + customSeparateX: boolean; + + /** + * A flag disabling the default vertical separation of colliding bodies. + * Pass your own `collideCallback` to the collider. + */ + customSeparateY: boolean; + + /** + * The amount of horizontal overlap (before separation), if this Body is colliding with another. + */ + overlapX: number; + + /** + * The amount of vertical overlap (before separation), if this Body is colliding with another. + */ + overlapY: number; + + /** + * The amount of overlap (before separation), if this Body is circular and colliding with another circular body. + */ + overlapR: number; + + /** + * Whether this Body is overlapped with another and both are not moving. + */ + embedded: boolean; + + /** + * Whether this Body interacts with the world boundary. + */ + collideWorldBounds: boolean; + + /** + * Whether this Body is checked for collisions and for which directions. + * You can set `checkCollision.none = true` to disable collision checks. + */ + checkCollision: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this Body is colliding with another and in which direction. + */ + touching: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this Body was colliding with another during the last step, and in which direction. + */ + wasTouching: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this Body is colliding with a tile or the world boundary. + */ + blocked: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether to automatically synchronize this Body's dimensions to the dimensions of its Game Object's visual bounds. + */ + syncBounds: boolean; + + /** + * The Body's physics type (dynamic or static). + */ + readonly physicsType: integer; + + /** + * Updates the Body's `transform`, `width`, `height`, and `center` from its Game Object. + * The Body's `position` isn't changed. + */ + updateBounds(): void; + + /** + * Updates the Body's `center` from its `position`, `width`, and `height`. + */ + updateCenter(): void; + + /** + * Prepares the Body for a physics step by resetting the `wasTouching`, `touching` and `blocked` states. + * + * This method is only called if the physics world is going to run a step this frame. + */ + resetFlags(): void; + + /** + * Syncs the position body position with the parent Game Object. + * + * This method is called every game frame, regardless if the world steps or not. + * @param willStep Will this Body run an update as well? + * @param delta The delta time, in seconds, elapsed since the last frame. + */ + preUpdate(willStep: boolean, delta: number): void; + + /** + * Performs a single physics step and updates the body velocity, angle, speed and other properties. + * + * This method can be called multiple times per game frame, depending on the physics step rate. + * + * The results are synced back to the Game Object in `postUpdate`. + * @param delta The delta time, in seconds, elapsed since the last frame. + */ + update(delta: number): void; + + /** + * Feeds the Body results back into the parent Game Object. + * + * This method is called every game frame, regardless if the world steps or not. + */ + postUpdate(): void; + + /** + * Checks for collisions between this Body and the world boundary and separates them. + */ + checkWorldBounds(): boolean; + + /** + * Sets the offset of the Body's position from its Game Object's position. + * @param x The horizontal offset, in source pixels. + * @param y The vertical offset, in source pixels. Default x. + */ + setOffset(x: number, y?: number): Phaser.Physics.Arcade.Body; + + /** + * Sizes and positions this Body's boundary, as a rectangle. + * Modifies the Body `offset` if `center` is true (the default). + * Resets the width and height to match current frame, if no width and height provided and a frame is found. + * @param width The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param height The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param center Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. Default true. + */ + setSize(width?: integer, height?: integer, center?: boolean): Phaser.Physics.Arcade.Body; + + /** + * Sizes and positions this Body's boundary, as a circle. + * @param radius The radius of the Body, in source pixels. + * @param offsetX The horizontal offset of the Body from its Game Object, in source pixels. + * @param offsetY The vertical offset of the Body from its Game Object, in source pixels. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): Phaser.Physics.Arcade.Body; + + /** + * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates. + * If the Body had any velocity or acceleration it is lost as a result of calling this. + * @param x The horizontal position to place the Game Object and Body. + * @param y The vertical position to place the Game Object and Body. + */ + reset(x: number, y: number): void; + + /** + * Sets acceleration, velocity, and speed to zero. + */ + stop(): Phaser.Physics.Arcade.Body; + + /** + * Copies the coordinates of this Body's edges into an object. + * @param obj An object to copy the values into. + */ + getBounds(obj: Phaser.Types.Physics.Arcade.ArcadeBodyBounds): Phaser.Types.Physics.Arcade.ArcadeBodyBounds; + + /** + * Tests if the coordinates are within this Body's boundary. + * @param x The horizontal coordinate. + * @param y The vertical coordinate. + */ + hitTest(x: number, y: number): boolean; + + /** + * Whether this Body is touching a tile or the world boundary while moving down. + */ + onFloor(): boolean; + + /** + * Whether this Body is touching a tile or the world boundary while moving up. + */ + onCeiling(): boolean; + + /** + * Whether this Body is touching a tile or the world boundary while moving left or right. + */ + onWall(): boolean; + + /** + * The absolute (non-negative) change in this Body's horizontal position from the previous step. + */ + deltaAbsX(): number; + + /** + * The absolute (non-negative) change in this Body's vertical position from the previous step. + */ + deltaAbsY(): number; + + /** + * The change in this Body's horizontal position from the previous step. + * This value is set during the Body's update phase. + */ + deltaX(): number; + + /** + * The change in this Body's vertical position from the previous step. + * This value is set during the Body's update phase. + */ + deltaY(): number; + + /** + * The change in this Body's rotation from the previous step, in degrees. + */ + deltaZ(): number; + + /** + * Disables this Body and marks it for deletion by the simulation. + */ + destroy(): void; + + /** + * Draws this Body's boundary and velocity, if enabled. + * @param graphic The Graphics object to draw on. + */ + drawDebug(graphic: Phaser.GameObjects.Graphics): void; + + /** + * Whether this Body will be drawn to the debug display. + */ + willDrawDebug(): boolean; + + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Vec2 first. + * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. + * @param bounceX If given this will be replace the `worldBounce.x` value. + * @param bounceY If given this will be replace the `worldBounce.y` value. + */ + setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's velocity. + * @param x The horizontal velocity, in pixels per second. + * @param y The vertical velocity, in pixels per second. Default x. + */ + setVelocity(x: number, y?: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal velocity. + * @param value The velocity, in pixels per second. + */ + setVelocityX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical velocity. + * @param value The velocity, in pixels per second. + */ + setVelocityY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's maximum velocity. + * @param x The horizontal velocity, in pixels per second. + * @param y The vertical velocity, in pixels per second. Default x. + */ + setMaxVelocity(x: number, y?: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the maximum speed the Body can move. + * @param value The maximum speed value, in pixels per second. Set to a negative value to disable. + */ + setMaxSpeed(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's bounce. + * @param x The horizontal bounce, relative to 1. + * @param y The vertical bounce, relative to 1. + */ + setBounce(x: number, y: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal bounce. + * @param value The bounce, relative to 1. + */ + setBounceX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical bounce. + * @param value The bounce, relative to 1. + */ + setBounceY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's acceleration. + * @param x The horizontal component, in pixels per second squared. + * @param y The vertical component, in pixels per second squared. + */ + setAcceleration(x: number, y: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal acceleration. + * @param value The acceleration, in pixels per second squared. + */ + setAccelerationX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical acceleration. + * @param value The acceleration, in pixels per second squared. + */ + setAccelerationY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Enables or disables drag. + * @param value `true` to allow drag on this body, or `false` to disable it. Default true. + */ + setAllowDrag(value?: boolean): Phaser.Physics.Arcade.Body; + + /** + * Enables or disables gravity's effect on this Body. + * @param value `true` to allow gravity on this body, or `false` to disable it. Default true. + */ + setAllowGravity(value?: boolean): Phaser.Physics.Arcade.Body; + + /** + * Enables or disables rotation. + * @param value `true` to allow rotation on this body, or `false` to disable it. Default true. + */ + setAllowRotation(value?: boolean): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's drag. + * @param x The horizontal component, in pixels per second squared. + * @param y The vertical component, in pixels per second squared. + */ + setDrag(x: number, y: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal drag. + * @param value The drag, in pixels per second squared. + */ + setDragX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical drag. + * @param value The drag, in pixels per second squared. + */ + setDragY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's gravity. + * @param x The horizontal component, in pixels per second squared. + * @param y The vertical component, in pixels per second squared. + */ + setGravity(x: number, y: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal gravity. + * @param value The gravity, in pixels per second squared. + */ + setGravityX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical gravity. + * @param value The gravity, in pixels per second squared. + */ + setGravityY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's friction. + * @param x The horizontal component, relative to 1. + * @param y The vertical component, relative to 1. + */ + setFriction(x: number, y: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's horizontal friction. + * @param value The friction value, relative to 1. + */ + setFrictionX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's vertical friction. + * @param value The friction value, relative to 1. + */ + setFrictionY(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's angular velocity. + * @param value The velocity, in degrees per second. + */ + setAngularVelocity(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's angular acceleration. + * @param value The acceleration, in degrees per second squared. + */ + setAngularAcceleration(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's angular drag. + * @param value The drag, in degrees per second squared. + */ + setAngularDrag(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's mass. + * @param value The mass value, relative to 1. + */ + setMass(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's `immovable` property. + * @param value The value to assign to `immovable`. Default true. + */ + setImmovable(value?: boolean): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's `enable` property. + * @param value The value to assign to `enable`. Default true. + */ + setEnable(value?: boolean): Phaser.Physics.Arcade.Body; + + /** + * The Body's horizontal position (left edge). + */ + x: number; + + /** + * The Body's vertical position (top edge). + */ + y: number; + + /** + * The left edge of the Body's boundary. Identical to x. + */ + readonly left: number; + + /** + * The right edge of the Body's boundary. + */ + readonly right: number; + + /** + * The top edge of the Body's boundary. Identical to y. + */ + readonly top: number; + + /** + * The bottom edge of this Body's boundary. + */ + readonly bottom: number; + + } + + /** + * An Arcade Physics Collider will automatically check for collision, or overlaps, between two objects + * every step. If a collision, or overlap, occurs it will invoke the given callbacks. + */ + class Collider { + /** + * + * @param world The Arcade physics World that will manage the collisions. + * @param overlapOnly Whether to check for collisions or overlap. + * @param object1 The first object to check for collision. + * @param object2 The second object to check for collision. + * @param collideCallback The callback to invoke when the two objects collide. + * @param processCallback The callback to invoke when the two objects collide. Must return a boolean. + * @param callbackContext The scope in which to call the callbacks. + */ + constructor(world: Phaser.Physics.Arcade.World, overlapOnly: boolean, object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback: ArcadePhysicsCallback, processCallback: ArcadePhysicsCallback, callbackContext: any); + + /** + * The world in which the bodies will collide. + */ + world: Phaser.Physics.Arcade.World; + + /** + * The name of the collider (unused by Phaser). + */ + name: string; + + /** + * Whether the collider is active. + */ + active: boolean; + + /** + * Whether to check for collisions or overlaps. + */ + overlapOnly: boolean; + + /** + * The first object to check for collision. + */ + object1: Phaser.Types.Physics.Arcade.ArcadeColliderType; + + /** + * The second object to check for collision. + */ + object2: Phaser.Types.Physics.Arcade.ArcadeColliderType; + + /** + * The callback to invoke when the two objects collide. + */ + collideCallback: ArcadePhysicsCallback; + + /** + * If a processCallback exists it must return true or collision checking will be skipped. + */ + processCallback: ArcadePhysicsCallback; + + /** + * The context the collideCallback and processCallback will run in. + */ + callbackContext: object; + + /** + * A name for the Collider. + * + * Phaser does not use this value, it's for your own reference. + * @param name The name to assign to the Collider. + */ + setName(name: string): Phaser.Physics.Arcade.Collider; + + /** + * Called by World as part of its step processing, initial operation of collision checking. + */ + update(): void; + + /** + * Removes Collider from World and disposes of its resources. + */ + destroy(): void; + + } + + namespace Components { + /** + * Provides methods used for setting the acceleration properties of an Arcade Physics Body. + */ + interface Acceleration { + /** + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. + * @param x The horizontal acceleration + * @param y The vertical acceleration Default x. + */ + setAcceleration(x: number, y?: number): this; + /** + * Sets the body's horizontal acceleration. + * @param value The horizontal acceleration + */ + setAccelerationX(value: number): this; + /** + * Sets the body's vertical acceleration. + * @param value The vertical acceleration + */ + setAccelerationY(value: number): this; + } + + /** + * Provides methods used for setting the angular acceleration properties of an Arcade Physics Body. + */ + interface Angular { + /** + * Sets the angular velocity of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular velocity. + */ + setAngularVelocity(value: number): this; + /** + * Sets the angular acceleration of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * @param value The amount of angular acceleration. + */ + setAngularAcceleration(value: number): this; + /** + * Sets the angular drag of the body. Drag is applied to the current velocity, providing a form of deceleration. + * @param value The amount of drag. + */ + setAngularDrag(value: number): this; + } + + /** + * Provides methods used for setting the bounce properties of an Arcade Physics Body. + */ + interface Bounce { + /** + * Sets the bounce values of this body. + * + * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. + * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. + * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + * @param y The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. Default x. + */ + setBounce(x: number, y?: number): this; + /** + * Sets the horizontal bounce value for this body. + * @param value The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceX(value: number): this; + /** + * Sets the vertical bounce value for this body. + * @param value The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. + */ + setBounceY(value: number): this; + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Vec2 first. + * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. + * @param bounceX If given this will be replace the `worldBounce.x` value. + * @param bounceY If given this will be replace the `worldBounce.y` value. + */ + setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number): this; + } + + /** + * Provides methods used for setting the debug properties of an Arcade Physics Body. + */ + interface Debug { + /** + * Sets the debug values of this body. + * + * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. + * Note that there is a performance cost in drawing debug displays. It should never be used in production. + * @param showBody Set to `true` to have this body render its outline to the debug display. + * @param showVelocity Set to `true` to have this body render a velocity marker to the debug display. + * @param bodyColor The color of the body outline when rendered to the debug display. + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): this; + /** + * Sets the color of the body outline when it renders to the debug display. + * @param value The color of the body outline when rendered to the debug display. + */ + setDebugBodyColor(value: number): this; + /** + * Set to `true` to have this body render its outline to the debug display. + */ + debugShowBody: boolean; + /** + * Set to `true` to have this body render a velocity marker to the debug display. + */ + debugShowVelocity: boolean; + /** + * The color of the body outline when it renders to the debug display. + */ + debugBodyColor: number; + } + + /** + * Provides methods used for setting the drag properties of an Arcade Physics Body. + */ + interface Drag { + /** + * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param x The amount of horizontal drag to apply. + * @param y The amount of vertical drag to apply. Default x. + */ + setDrag(x: number, y?: number): this; + /** + * Sets the body's horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of horizontal drag to apply. + */ + setDragX(value: number): this; + /** + * Sets the body's vertical drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * @param value The amount of vertical drag to apply. + */ + setDragY(value: number): this; + /** + * If this Body is using `drag` for deceleration this function controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * @param value `true` to use damping for deceleration, or `false` to use linear deceleration. + */ + setDamping(value: boolean): this; + } + + /** + * Provides methods used for setting the enable properties of an Arcade Physics Body. + */ + interface Enable { + /** + * Enables this Game Object's Body. + * @param reset Also reset the Body and place it at (x, y). + * @param x The horizontal position to place the Game Object and Body. + * @param y The horizontal position to place the Game Object and Body. + * @param enableGameObject Also activate this Game Object. + * @param showGameObject Also show this Game Object. + */ + enableBody(reset: boolean, x: number, y: number, enableGameObject: boolean, showGameObject: boolean): this; + /** + * Stops and disables this Game Object's Body. + * @param disableGameObject Also deactivate this Game Object. Default false. + * @param hideGameObject Also hide this Game Object. Default false. + */ + disableBody(disableGameObject?: boolean, hideGameObject?: boolean): this; + /** + * Syncs the Body's position and size with its parent Game Object. + * You don't need to call this for Dynamic Bodies, as it happens automatically. + * But for Static bodies it's a useful way of modifying the position of a Static Body + * in the Physics World, based on its Game Object. + */ + refreshBody(): this; + } + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. The higher than friction, the faster the body will slow down once force stops being applied to it. + */ + interface Friction { + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of horizontal friction to apply. + * @param y The amount of vertical friction to apply. Default x. + */ + setFriction(x: number, y?: number): this; + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionX(x: number): this; + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * @param x The amount of friction to apply. + */ + setFrictionY(x: number): this; + } + + /** + * Provides methods for setting the gravity properties of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Gravity { + /** + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. + * @param x The gravitational force to be applied to the X-axis. + * @param y The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. Default x. + */ + setGravity(x: number, y?: number): this; + /** + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param x The gravitational force to be applied to the X-axis. + */ + setGravityX(x: number): this; + /** + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. + * @param y The gravitational force to be applied to the Y-axis. + */ + setGravityY(y: number): this; + } + + /** + * Provides methods used for setting the immovable properties of an Arcade Physics Body. + */ + interface Immovable { + /** + * Sets Whether this Body can be moved by collisions with another Body. + * @param value Sets if this body can be moved by collisions with another Body. Default true. + */ + setImmovable(value?: boolean): this; + } + + /** + * Provides methods used for setting the mass properties of an Arcade Physics Body. + */ + interface Mass { + /** + * Sets the mass of the physics body + * @param value New value for the mass of the body. + */ + setMass(value: number): this; + } + + /** + * This method will search the given rectangular area and return an array of all physics bodies that + * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. + * + * A body only has to intersect with the search area to be considered, it doesn't have to be fully + * contained within it. + * + * If Arcade Physics is set to use the RTree (which it is by default) then the search for is extremely fast, + * otherwise the search is O(N) for Dynamic Bodies. + */ + interface OverlapRect { + } + + /** + * Provides methods for setting the size of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. + */ + interface Size { + /** + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. + * @param x The amount to offset the body from the parent Game Object along the x-axis. + * @param y The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. Default x. + */ + setOffset(x: number, y?: number): this; + /** + * Sets the size of this physics body. Setting the size does not adjust the dimensions + * of the parent Game Object. + * @param width The new width of the physics body, in pixels. + * @param height The new height of the physics body, in pixels. + * @param center Should the body be re-positioned so its center aligns with the parent Game Object? Default true. + */ + setSize(width: number, height: number, center?: boolean): this; + /** + * Sets this physics body to use a circle for collision instead of a rectangle. + * @param radius The radius of the physics body, in pixels. + * @param offsetX The amount to offset the body from the parent Game Object along the x-axis. + * @param offsetY The amount to offset the body from the parent Game Object along the y-axis. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): this; + } + + /** + * Provides methods for modifying the velocity of an Arcade Physics body. + * + * Should be applied as a mixin and not used directly. + */ + interface Velocity { + /** + * Sets the velocity of the Body. + * @param x The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. + * @param y The vertical velocity of the body. Positive values move the body down, while negative values move it up. Default x. + */ + setVelocity(x: number, y?: number): this; + /** + * Sets the horizontal component of the body's velocity. + * + * Positive values move the body to the right, while negative values move it to the left. + * @param x The new horizontal velocity. + */ + setVelocityX(x: number): this; + /** + * Sets the vertical component of the body's velocity. + * + * Positive values move the body down, while negative values move it up. + * @param y The new vertical velocity of the body. + */ + setVelocityY(y: number): this; + /** + * Sets the maximum velocity of the body. + * @param x The new maximum horizontal velocity. + * @param y The new maximum vertical velocity. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + } + + } + + /** + * Dynamic Body. + */ + var DYNAMIC_BODY: number; + + /** + * Static Body. + */ + var STATIC_BODY: number; + + /** + * Arcade Physics Group containing Dynamic Bodies. + */ + var GROUP: number; + + /** + * A Tilemap Layer. + */ + var TILEMAPLAYER: number; + + /** + * Facing no direction (initial value). + */ + var FACING_NONE: number; + + /** + * Facing up. + */ + var FACING_UP: number; + + /** + * Facing down. + */ + var FACING_DOWN: number; + + /** + * Facing left. + */ + var FACING_LEFT: number; + + /** + * Facing right. + */ + var FACING_RIGHT: number; + + namespace Events { + /** + * The Arcade Physics World Collide Event. + * + * This event is dispatched by an Arcade Physics World instance if two bodies collide _and_ at least + * one of them has their [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('collide', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const COLLIDE: any; + + /** + * The Arcade Physics World Overlap Event. + * + * This event is dispatched by an Arcade Physics World instance if two bodies overlap _and_ at least + * one of them has their [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. + * + * It provides an alternative means to handling overlap events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('overlap', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const OVERLAP: any; + + /** + * The Arcade Physics World Pause Event. + * + * This event is dispatched by an Arcade Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`. + */ + const PAUSE: any; + + /** + * The Arcade Physics World Resume Event. + * + * This event is dispatched by an Arcade Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`. + */ + const RESUME: any; + + /** + * The Arcade Physics Tile Collide Event. + * + * This event is dispatched by an Arcade Physics World instance if a body collides with a Tile _and_ + * has its [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('tilecollide', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const TILE_COLLIDE: any; + + /** + * The Arcade Physics Tile Overlap Event. + * + * This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile _and_ + * has its [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. + * + * It provides an alternative means to handling overlap events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('tileoverlap', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + */ + const TILE_OVERLAP: any; + + /** + * The Arcade Physics World Bounds Event. + * + * This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds _and_ + * it has its [onWorldBounds]{@link Phaser.Physics.Arcade.Body#onWorldBounds} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`. + */ + const WORLD_BOUNDS: any; + + /** + * The Arcade Physics World Step Event. + * + * This event is dispatched by an Arcade Physics World instance whenever a physics step is run. + * It is emitted _after_ the bodies and colliders have been updated. + * + * In high framerate settings this can be multiple times per game frame. + * + * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. + */ + const WORLD_STEP: any; + + } + + /** + * The Arcade Physics Factory allows you to easily create Arcade Physics enabled Game Objects. + * Objects that are created by this Factory are automatically added to the physics world. + */ + class Factory { + /** + * + * @param world The Arcade Physics World instance. + */ + constructor(world: Phaser.Physics.Arcade.World); + + /** + * A reference to the Arcade Physics World. + */ + world: Phaser.Physics.Arcade.World; + + /** + * A reference to the Scene this Arcade Physics instance belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems this Arcade Physics instance belongs to. + */ + sys: Phaser.Scenes.Systems; + + /** + * Creates a new Arcade Physics Collider object. + * @param object1 The first object to check for collision. + * @param object2 The second object to check for collision. + * @param collideCallback The callback to invoke when the two objects collide. + * @param processCallback The callback to invoke when the two objects collide. Must return a boolean. + * @param callbackContext The scope in which to call the callbacks. + */ + collider(object1: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], object2: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): Phaser.Physics.Arcade.Collider; + + /** + * Creates a new Arcade Physics Collider Overlap object. + * @param object1 The first object to check for overlap. + * @param object2 The second object to check for overlap. + * @param collideCallback The callback to invoke when the two objects collide. + * @param processCallback The callback to invoke when the two objects collide. Must return a boolean. + * @param callbackContext The scope in which to call the callbacks. + */ + overlap(object1: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], object2: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): Phaser.Physics.Arcade.Collider; + + /** + * Adds an Arcade Physics Body to the given Game Object. + * @param gameObject A Game Object. + * @param isStatic Create a Static body (true) or Dynamic body (false). Default false. + */ + existing(gameObject: Phaser.GameObjects.GameObject, isStatic?: boolean): Phaser.GameObjects.GameObject; + + /** + * Creates a new Arcade Image object with a Static body. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + staticImage(x: number, y: number, texture: string, frame?: string | integer): Phaser.Physics.Arcade.Image; + + /** + * Creates a new Arcade Image object with a Dynamic body. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + image(x: number, y: number, texture: string, frame?: string | integer): Phaser.Physics.Arcade.Image; + + /** + * Creates a new Arcade Sprite object with a Static body. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + staticSprite(x: number, y: number, texture: string, frame?: string | integer): Phaser.Physics.Arcade.Sprite; + + /** + * Creates a new Arcade Sprite object with a Dynamic body. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + sprite(x: number, y: number, key: string, frame?: string | integer): Phaser.Physics.Arcade.Sprite; + + /** + * Creates a Static Physics Group object. + * All Game Objects created by this Group will automatically be static Arcade Physics objects. + * @param children Game Objects to add to this group; or the `config` argument. + * @param config Settings for this group. + */ + staticGroup(children?: Phaser.GameObjects.GameObject[] | Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.Physics.Arcade.StaticGroup; + + /** + * Creates a Physics Group object. + * All Game Objects created by this Group will automatically be dynamic Arcade Physics objects. + * @param children Game Objects to add to this group; or the `config` argument. + * @param config Settings for this group. + */ + group(children?: Phaser.GameObjects.GameObject[] | Phaser.Types.Physics.Arcade.PhysicsGroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.Physics.Arcade.PhysicsGroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig): Phaser.Physics.Arcade.Group; + + /** + * Destroys this Factory. + */ + destroy(): void; + + } + + /** + * Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties + * accordingly, including: `touching.left`, `touching.right`, `touching.none` and `overlapX'. + * @param body1 The first Body to separate. + * @param body2 The second Body to separate. + * @param overlapOnly Is this an overlap only check, or part of separation? + * @param bias A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding). + */ + function GetOverlapX(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly: boolean, bias: number): number; + + /** + * Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties + * accordingly, including: `touching.up`, `touching.down`, `touching.none` and `overlapY'. + * @param body1 The first Body to separate. + * @param body2 The second Body to separate. + * @param overlapOnly Is this an overlap only check, or part of separation? + * @param bias A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding). + */ + function GetOverlapY(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly: boolean, bias: number): number; + + /** + * An Arcade Physics Group object. + * + * All Game Objects created by this Group will automatically be given dynamic Arcade Physics bodies. + * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticGroup}. + */ + class Group extends Phaser.GameObjects.Group { + /** + * + * @param world The physics simulation. + * @param scene The scene this group belongs to. + * @param children Game Objects to add to this group; or the `config` argument. + * @param config Settings for this group. + */ + constructor(world: Phaser.Physics.Arcade.World, scene: Phaser.Scene, children?: Phaser.GameObjects.GameObject[] | Phaser.Types.Physics.Arcade.PhysicsGroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.Physics.Arcade.PhysicsGroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig); + + /** + * The physics simulation. + */ + world: Phaser.Physics.Arcade.World; + + /** + * The class to create new Group members from. + * + * This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those. + */ + classType: Function; + + /** + * The physics type of the Group's members. + */ + physicsType: integer; + + /** + * Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument. + */ + defaults: Phaser.Types.Physics.Arcade.PhysicsGroupDefaults; + + /** + * Enables a Game Object's Body and assigns `defaults`. Called when a Group member is added or created. + * @param child The Game Object being added. + */ + createCallbackHandler(child: Phaser.GameObjects.GameObject): void; + + /** + * Disables a Game Object's Body. Called when a Group member is removed. + * @param child The Game Object being removed. + */ + removeCallbackHandler(child: Phaser.GameObjects.GameObject): void; + + /** + * Sets the velocity of each Group member. + * @param x The horizontal velocity. + * @param y The vertical velocity. + * @param step The velocity increment. When set, the first member receives velocity (x, y), the second (x + step, y + step), and so on. Default 0. + */ + setVelocity(x: number, y: number, step?: number): Phaser.Physics.Arcade.Group; + + /** + * Sets the horizontal velocity of each Group member. + * @param value The velocity value. + * @param step The velocity increment. When set, the first member receives velocity (x), the second (x + step), and so on. Default 0. + */ + setVelocityX(value: number, step?: number): Phaser.Physics.Arcade.Group; + + /** + * Sets the vertical velocity of each Group member. + * @param value The velocity value. + * @param step The velocity increment. When set, the first member receives velocity (y), the second (y + step), and so on. Default 0. + */ + setVelocityY(value: number, step?: number): Phaser.Physics.Arcade.Group; + + } + + /** + * Separates two overlapping bodies on the X-axis (horizontally). + * + * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection. + * + * The bodies won't be separated if there is no horizontal overlap between them, if they are static, or if either one uses custom logic for its separation. + * @param body1 The first Body to separate. + * @param body2 The second Body to separate. + * @param overlapOnly If `true`, the bodies will only have their overlap data set and no separation will take place. + * @param bias A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. + */ + function SeparateX(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly: boolean, bias: number): boolean; + + /** + * Separates two overlapping bodies on the Y-axis (vertically). + * + * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection. + * + * The bodies won't be separated if there is no vertical overlap between them, if they are static, or if either one uses custom logic for its separation. + * @param body1 The first Body to separate. + * @param body2 The second Body to separate. + * @param overlapOnly If `true`, the bodies will only have their overlap data set and no separation will take place. + * @param bias A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. + */ + function SeparateY(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly: boolean, bias: number): boolean; + + /** + * A Static Arcade Physics Body. + * + * A Static Body never moves, and isn't automatically synchronized with its parent Game Object. + * That means if you make any change to the parent's origin, position, or scale after creating or adding the body, you'll need to update the Body manually. + * + * A Static Body can collide with other Bodies, but is never moved by collisions. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Body}. + */ + class StaticBody { + /** + * + * @param world The Arcade Physics simulation this Static Body belongs to. + * @param gameObject The Game Object this Static Body belongs to. + */ + constructor(world: Phaser.Physics.Arcade.World, gameObject: Phaser.GameObjects.GameObject); + + /** + * The Arcade Physics simulation this Static Body belongs to. + */ + world: Phaser.Physics.Arcade.World; + + /** + * The Game Object this Static Body belongs to. + */ + gameObject: Phaser.GameObjects.GameObject; + + /** + * Whether the Static Body's boundary is drawn to the debug display. + */ + debugShowBody: boolean; + + /** + * The color of this Static Body on the debug display. + */ + debugBodyColor: integer; + + /** + * Whether this Static Body is updated by the physics simulation. + */ + enable: boolean; + + /** + * Whether this Static Body's boundary is circular (`true`) or rectangular (`false`). + */ + isCircle: boolean; + + /** + * If this Static Body is circular, this is the unscaled radius of the Static Body's boundary, as set by {@link #setCircle}, in source pixels. + * The true radius is equal to `halfWidth`. + */ + radius: number; + + /** + * The offset of this Static Body's actual position from any updated position. + * + * Unlike a dynamic Body, a Static Body does not follow its Game Object. As such, this offset is only applied when resizing the Static Body. + */ + offset: Phaser.Math.Vector2; + + /** + * The position of this Static Body within the simulation. + */ + position: Phaser.Math.Vector2; + + /** + * The width of the Static Body's boundary, in pixels. + * If the Static Body is circular, this is also the Static Body's diameter. + */ + width: number; + + /** + * The height of the Static Body's boundary, in pixels. + * If the Static Body is circular, this is also the Static Body's diameter. + */ + height: number; + + /** + * Half the Static Body's width, in pixels. + * If the Static Body is circular, this is also the Static Body's radius. + */ + halfWidth: number; + + /** + * Half the Static Body's height, in pixels. + * If the Static Body is circular, this is also the Static Body's radius. + */ + halfHeight: number; + + /** + * The center of the Static Body's boundary. + * This is the midpoint of its `position` (top-left corner) and its bottom-right corner. + */ + center: Phaser.Math.Vector2; + + /** + * A constant zero velocity used by the Arcade Physics simulation for calculations. + */ + readonly velocity: Phaser.Math.Vector2; + + /** + * A constant `false` value expected by the Arcade Physics simulation. + */ + readonly allowGravity: boolean; + + /** + * Gravitational force applied specifically to this Body. Values are in pixels per second squared. Always zero for a Static Body. + */ + readonly gravity: Phaser.Math.Vector2; + + /** + * Rebound, or restitution, following a collision, relative to 1. Always zero for a Static Body. + */ + readonly bounce: Phaser.Math.Vector2; + + /** + * Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary. + * Always false for a Static Body. (Static Bodies never collide with the world boundary and never trigger a `worldbounds` event.) + */ + readonly onWorldBounds: boolean; + + /** + * Whether the simulation emits a `collide` event when this StaticBody collides with another. + */ + onCollide: boolean; + + /** + * Whether the simulation emits an `overlap` event when this StaticBody overlaps with another. + */ + onOverlap: boolean; + + /** + * The StaticBody's inertia, relative to a default unit (1). With `bounce`, this affects the exchange of momentum (velocities) during collisions. + */ + mass: number; + + /** + * Whether this object can be moved by collisions with another body. + */ + immovable: boolean; + + /** + * A flag disabling the default horizontal separation of colliding bodies. Pass your own `collideHandler` to the collider. + */ + customSeparateX: boolean; + + /** + * A flag disabling the default vertical separation of colliding bodies. Pass your own `collideHandler` to the collider. + */ + customSeparateY: boolean; + + /** + * The amount of horizontal overlap (before separation), if this Body is colliding with another. + */ + overlapX: number; + + /** + * The amount of vertical overlap (before separation), if this Body is colliding with another. + */ + overlapY: number; + + /** + * The amount of overlap (before separation), if this StaticBody is circular and colliding with another circular body. + */ + overlapR: number; + + /** + * Whether this StaticBody has ever overlapped with another while both were not moving. + */ + embedded: boolean; + + /** + * Whether this StaticBody interacts with the world boundary. + * Always false for a Static Body. (Static Bodies never collide with the world boundary.) + */ + readonly collideWorldBounds: boolean; + + /** + * Whether this StaticBody is checked for collisions and for which directions. You can set `checkCollision.none = false` to disable collision checks. + */ + checkCollision: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this StaticBody has ever collided with another body and in which direction. + */ + touching: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this StaticBody was colliding with another body during the last step or any previous step, and in which direction. + */ + wasTouching: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * Whether this StaticBody has ever collided with a tile or the world boundary. + */ + blocked: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; + + /** + * The StaticBody's physics type (static by default). + */ + physicsType: integer; + + /** + * Changes the Game Object this Body is bound to. + * First it removes its reference from the old Game Object, then sets the new one. + * You can optionally update the position and dimensions of this Body to reflect that of the new Game Object. + * @param gameObject The new Game Object that will own this Body. + * @param update Reposition and resize this Body to match the new Game Object? Default true. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, update?: boolean): Phaser.Physics.Arcade.StaticBody; + + /** + * Updates this Static Body so that its position and dimensions are updated + * based on the current Game Object it is bound to. + */ + updateFromGameObject(): Phaser.Physics.Arcade.StaticBody; + + /** + * Sets the offset of the body. + * @param x The horizontal offset of the Body from the Game Object's center. + * @param y The vertical offset of the Body from the Game Object's center. + */ + setOffset(x: number, y: number): Phaser.Physics.Arcade.StaticBody; + + /** + * Sets the size of the body. + * Resets the width and height to match current frame, if no width and height provided and a frame is found. + * @param width The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param height The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param center Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. Default true. + */ + setSize(width?: integer, height?: integer, center?: boolean): Phaser.Physics.Arcade.StaticBody; + + /** + * Sets this Static Body to have a circular body and sets its sizes and position. + * @param radius The radius of the StaticBody, in pixels. + * @param offsetX The horizontal offset of the StaticBody from its Game Object, in pixels. + * @param offsetY The vertical offset of the StaticBody from its Game Object, in pixels. + */ + setCircle(radius: number, offsetX?: number, offsetY?: number): Phaser.Physics.Arcade.StaticBody; + + /** + * Updates the StaticBody's `center` from its `position` and dimensions. + */ + updateCenter(): void; + + /** + * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates. + * Similar to `updateFromGameObject`, but doesn't modify the Body's dimensions. + * @param x The x coordinate to reset the body to. If not given will use the parent Game Object's coordinate. + * @param y The y coordinate to reset the body to. If not given will use the parent Game Object's coordinate. + */ + reset(x?: number, y?: number): void; + + /** + * NOOP function. A Static Body cannot be stopped. + */ + stop(): Phaser.Physics.Arcade.StaticBody; + + /** + * Returns the x and y coordinates of the top left and bottom right points of the StaticBody. + * @param obj The object which will hold the coordinates of the bounds. + */ + getBounds(obj: Phaser.Types.Physics.Arcade.ArcadeBodyBounds): Phaser.Types.Physics.Arcade.ArcadeBodyBounds; + + /** + * Checks to see if a given x,y coordinate is colliding with this Static Body. + * @param x The x coordinate to check against this body. + * @param y The y coordinate to check against this body. + */ + hitTest(x: number, y: number): boolean; + + /** + * NOOP + */ + postUpdate(): void; + + /** + * The absolute (non-negative) change in this StaticBody's horizontal position from the previous step. Always zero. + */ + deltaAbsX(): number; + + /** + * The absolute (non-negative) change in this StaticBody's vertical position from the previous step. Always zero. + */ + deltaAbsY(): number; + + /** + * The change in this StaticBody's horizontal position from the previous step. Always zero. + */ + deltaX(): number; + + /** + * The change in this StaticBody's vertical position from the previous step. Always zero. + */ + deltaY(): number; + + /** + * The change in this StaticBody's rotation from the previous step. Always zero. + */ + deltaZ(): number; + + /** + * Disables this Body and marks it for destruction during the next step. + */ + destroy(): void; + + /** + * Draws a graphical representation of the StaticBody for visual debugging purposes. + * @param graphic The Graphics object to use for the debug drawing of the StaticBody. + */ + drawDebug(graphic: Phaser.GameObjects.Graphics): void; + + /** + * Indicates whether the StaticBody is going to be showing a debug visualization during postUpdate. + */ + willDrawDebug(): boolean; + + /** + * Sets the Mass of the StaticBody. Will set the Mass to 0.1 if the value passed is less than or equal to zero. + * @param value The value to set the Mass to. Values of zero or less are changed to 0.1. + */ + setMass(value: number): Phaser.Physics.Arcade.StaticBody; + + /** + * The x coordinate of the StaticBody. + */ + x: number; + + /** + * The y coordinate of the StaticBody. + */ + y: number; + + /** + * Returns the left-most x coordinate of the area of the StaticBody. + */ + readonly left: number; + + /** + * The right-most x coordinate of the area of the StaticBody. + */ + readonly right: number; + + /** + * The highest y coordinate of the area of the StaticBody. + */ + readonly top: number; + + /** + * The lowest y coordinate of the area of the StaticBody. (y + height) + */ + readonly bottom: number; + + } + + /** + * An Arcade Physics Static Group object. + * + * All Game Objects created by this Group will automatically be given static Arcade Physics bodies. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Group}. + */ + class StaticGroup extends Phaser.GameObjects.Group { + /** + * + * @param world The physics simulation. + * @param scene The scene this group belongs to. + * @param children Game Objects to add to this group; or the `config` argument. + * @param config Settings for this group. + */ + constructor(world: Phaser.Physics.Arcade.World, scene: Phaser.Scene, children?: Phaser.GameObjects.GameObject[] | Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig, config?: Phaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfig); + + /** + * The physics simulation. + */ + world: Phaser.Physics.Arcade.World; + + /** + * The scene this group belongs to. + */ + physicsType: integer; + + /** + * Adds a static physics body to the new group member (if it lacks one) and adds it to the simulation. + * @param child The new group member. + */ + createCallbackHandler(child: Phaser.GameObjects.GameObject): void; + + /** + * Disables the group member's physics body, removing it from the simulation. + * @param child The group member being removed. + */ + removeCallbackHandler(child: Phaser.GameObjects.GameObject): void; + + /** + * Refreshes the group. + * @param entries The newly created group members. + */ + createMultipleCallbackHandler(entries: Phaser.GameObjects.GameObject[]): void; + + /** + * Resets each Body to the position of its parent Game Object. + * Body sizes aren't changed (use {@link Phaser.Physics.Arcade.Components.Enable#refreshBody} for that). + */ + refresh(): Phaser.Physics.Arcade.StaticGroup; + + } + + namespace Tilemap { + /** + * A function to process the collision callbacks between a single tile and an Arcade Physics enabled Game Object. + * @param tile The Tile to process. + * @param sprite The Game Object to process with the Tile. + */ + function ProcessTileCallbacks(tile: Phaser.Tilemaps.Tile, sprite: Phaser.GameObjects.Sprite): boolean; + + /** + * Internal function to process the separation of a physics body from a tile. + * @param body The Body object to separate. + * @param x The x separation amount. + */ + function ProcessTileSeparationX(body: Phaser.Physics.Arcade.Body, x: number): void; + + /** + * Internal function to process the separation of a physics body from a tile. + * @param body The Body object to separate. + * @param y The y separation amount. + */ + function ProcessTileSeparationY(body: Phaser.Physics.Arcade.Body, y: number): void; + + /** + * The core separation function to separate a physics body and a tile. + * @param i The index of the tile within the map data. + * @param body The Body object to separate. + * @param tile The tile to collide against. + * @param tileWorldRect A rectangle-like object defining the dimensions of the tile. + * @param tilemapLayer The tilemapLayer to collide against. + * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? + */ + function SeparateTile(i: number, body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileWorldRect: Phaser.Geom.Rectangle, tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, tileBias: number, isLayer: boolean): boolean; + + /** + * Check the body against the given tile on the X axis. + * Used internally by the SeparateTile function. + * @param body The Body object to separate. + * @param tile The tile to check. + * @param tileLeft The left position of the tile within the tile world. + * @param tileRight The right position of the tile within the tile world. + * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? + */ + function TileCheckX(body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileLeft: number, tileRight: number, tileBias: number, isLayer: boolean): number; + + /** + * Check the body against the given tile on the Y axis. + * Used internally by the SeparateTile function. + * @param body The Body object to separate. + * @param tile The tile to check. + * @param tileTop The top position of the tile within the tile world. + * @param tileBottom The bottom position of the tile within the tile world. + * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? + */ + function TileCheckY(body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileTop: number, tileBottom: number, tileBias: number, isLayer: boolean): number; + + /** + * Checks for intersection between the given tile rectangle-like object and an Arcade Physics body. + * @param tileWorldRect A rectangle object that defines the tile placement in the world. + * @param body The body to check for intersection against. + */ + function TileIntersectsBody(tileWorldRect: Object, body: Phaser.Physics.Arcade.Body): boolean; + + } + + /** + * The Arcade Physics World. + * + * The World is responsible for creating, managing, colliding and updating all of the bodies within it. + * + * An instance of the World belongs to a Phaser.Scene and is accessed via the property `physics.world`. + */ + class World extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene to which this World instance belongs. + * @param config An Arcade Physics Configuration object. + */ + constructor(scene: Phaser.Scene, config: Phaser.Types.Physics.Arcade.ArcadeWorldConfig); + + /** + * The Scene this simulation belongs to. + */ + scene: Phaser.Scene; + + /** + * Dynamic Bodies in this simulation. + */ + bodies: Phaser.Structs.Set; + + /** + * Static Bodies in this simulation. + */ + staticBodies: Phaser.Structs.Set; + + /** + * Static Bodies marked for deletion. + */ + pendingDestroy: Phaser.Structs.Set<(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)>; + + /** + * This simulation's collision processors. + */ + colliders: Phaser.Structs.ProcessQueue; + + /** + * Acceleration of Bodies due to gravity, in pixels per second. + */ + gravity: Phaser.Math.Vector2; + + /** + * A boundary constraining Bodies. + */ + bounds: Phaser.Geom.Rectangle; + + /** + * The boundary edges that Bodies can collide with. + */ + checkCollision: Phaser.Types.Physics.Arcade.CheckCollisionObject; + + /** + * The number of physics steps to be taken per second. + * + * This property is read-only. Use the `setFPS` method to modify it at run-time. + */ + readonly fps: number; + + /** + * The number of steps that took place in the last frame. + */ + readonly stepsLastFrame: number; + + /** + * Scaling factor applied to the frame rate. + * + * - 1.0 = normal speed + * - 2.0 = half speed + * - 0.5 = double speed + */ + timeScale: number; + + /** + * The maximum absolute difference of a Body's per-step velocity and its overlap with another Body that will result in separation on *each axis*. + * Larger values favor separation. + * Smaller values favor no separation. + */ + OVERLAP_BIAS: number; + + /** + * The maximum absolute value of a Body's overlap with a tile that will result in separation on *each axis*. + * Larger values favor separation. + * Smaller values favor no separation. + * The optimum value may be similar to the tile size. + */ + TILE_BIAS: number; + + /** + * Always separate overlapping Bodies horizontally before vertically. + * False (the default) means Bodies are first separated on the axis of greater gravity, or the vertical axis if neither is greater. + */ + forceX: boolean; + + /** + * Whether the simulation advances with the game loop. + */ + isPaused: boolean; + + /** + * Enables the debug display. + */ + drawDebug: boolean; + + /** + * The graphics object drawing the debug display. + */ + debugGraphic: Phaser.GameObjects.Graphics; + + /** + * Default debug display settings for new Bodies. + */ + defaults: Phaser.Types.Physics.Arcade.ArcadeWorldDefaults; + + /** + * The maximum number of items per node on the RTree. + * + * This is ignored if `useTree` is `false`. If you have a large number of bodies in + * your world then you may find search performance improves by increasing this value, + * to allow more items per node and less node division. + */ + maxEntries: integer; + + /** + * Should this Arcade Physics World use an RTree for Dynamic and Static Physics bodies? + * + * An RTree is a fast way of spatially sorting of all the bodies in the world. + * However, at certain limits, the cost of clearing and inserting the bodies into the + * tree every frame becomes more expensive than the search speed gains it provides. + * + * If you have a large number of dynamic bodies in your world then it may be best to + * disable the use of the RTree by setting this property to `false` in the physics config. + * + * The number it can cope with depends on browser and device, but a conservative estimate + * of around 5,000 bodies should be considered the max before disabling it. + * + * This only applies to dynamic bodies. Static bodies are always kept in an RTree, + * because they don't have to be cleared every frame, so you benefit from the + * massive search speeds all the time. + */ + useTree: boolean; + + /** + * The spatial index of Dynamic Bodies. + */ + tree: Phaser.Structs.RTree; + + /** + * The spatial index of Static Bodies. + */ + staticTree: Phaser.Structs.RTree; + + /** + * Recycled input for tree searches. + */ + treeMinMax: Phaser.Types.Physics.Arcade.ArcadeWorldTreeMinMax; + + /** + * Adds an Arcade Physics Body to a Game Object, an array of Game Objects, or the children of a Group. + * + * The difference between this and the `enableBody` method is that you can pass arrays or Groups + * to this method. + * + * You can specify if the bodies are to be Dynamic or Static. A dynamic body can move via velocity and + * acceleration. A static body remains fixed in place and as such is able to use an optimized search + * tree, making it ideal for static elements such as level objects. You can still collide and overlap + * with static bodies. + * + * Normally, rather than calling this method directly, you'd use the helper methods available in the + * Arcade Physics Factory, such as: + * + * ```javascript + * this.physics.add.image(x, y, textureKey); + * this.physics.add.sprite(x, y, textureKey); + * ``` + * + * Calling factory methods encapsulates the creation of a Game Object and the creation of its + * body at the same time. If you are creating custom classes then you can pass them to this + * method to have their bodies created. + * @param object The object, or objects, on which to create the bodies. + * @param bodyType The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + */ + enable(object: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], bodyType?: integer): void; + + /** + * Creates an Arcade Physics Body on a single Game Object. + * + * If the Game Object already has a body, this method will simply add it back into the simulation. + * + * You can specify if the body is Dynamic or Static. A dynamic body can move via velocity and + * acceleration. A static body remains fixed in place and as such is able to use an optimized search + * tree, making it ideal for static elements such as level objects. You can still collide and overlap + * with static bodies. + * + * Normally, rather than calling this method directly, you'd use the helper methods available in the + * Arcade Physics Factory, such as: + * + * ```javascript + * this.physics.add.image(x, y, textureKey); + * this.physics.add.sprite(x, y, textureKey); + * ``` + * + * Calling factory methods encapsulates the creation of a Game Object and the creation of its + * body at the same time. If you are creating custom classes then you can pass them to this + * method to have their bodies created. + * @param object The Game Object on which to create the body. + * @param bodyType The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + */ + enableBody(object: Phaser.GameObjects.GameObject, bodyType?: integer): Phaser.GameObjects.GameObject; + + /** + * Adds an existing Arcade Physics Body or StaticBody to the simulation. + * + * The body is enabled and added to the local search trees. + * @param body The Body to be added to the simulation. + */ + add(body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody): Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody; + + /** + * Disables the Arcade Physics Body of a Game Object, an array of Game Objects, or the children of a Group. + * + * The difference between this and the `disableBody` method is that you can pass arrays or Groups + * to this method. + * + * The body itself is not deleted, it just has its `enable` property set to false, which + * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`. + * @param object The object, or objects, on which to disable the bodies. + */ + disable(object: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[]): void; + + /** + * Disables an existing Arcade Physics Body or StaticBody and removes it from the simulation. + * + * The body is disabled and removed from the local search trees. + * + * The body itself is not deleted, it just has its `enable` property set to false, which + * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`. + * @param body The Body to be disabled. + */ + disableBody(body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody): void; + + /** + * Removes an existing Arcade Physics Body or StaticBody from the simulation. + * + * The body is disabled and removed from the local search trees. + * + * The body itself is not deleted, it just has its `enabled` property set to false, which + * means you can re-enable it again at any point by passing it to enable `enable` or `add`. + * @param body The body to be removed from the simulation. + */ + remove(body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody): void; + + /** + * Creates a Graphics Game Object that the world will use to render the debug display to. + * + * This is called automatically when the World is instantiated if the `debug` config property + * was set to `true`. However, you can call it at any point should you need to display the + * debug Graphic from a fixed point. + * + * You can control which objects are drawn to the Graphics object, and the colors they use, + * by setting the debug properties in the physics config. + * + * You should not typically use this in a production game. Use it to aid during debugging. + */ + createDebugGraphic(): Phaser.GameObjects.Graphics; + + /** + * Sets the position, size and properties of the World boundary. + * + * The World boundary is an invisible rectangle that defines the edges of the World. + * If a Body is set to collide with the world bounds then it will automatically stop + * when it reaches any of the edges. You can optionally set which edges of the boundary + * should be checked against. + * @param x The top-left x coordinate of the boundary. + * @param y The top-left y coordinate of the boundary. + * @param width The width of the boundary. + * @param height The height of the boundary. + * @param checkLeft Should bodies check against the left edge of the boundary? + * @param checkRight Should bodies check against the right edge of the boundary? + * @param checkUp Should bodies check against the top edge of the boundary? + * @param checkDown Should bodies check against the bottom edge of the boundary? + */ + setBounds(x: number, y: number, width: number, height: number, checkLeft?: boolean, checkRight?: boolean, checkUp?: boolean, checkDown?: boolean): Phaser.Physics.Arcade.World; + + /** + * Enables or disables collisions on each edge of the World boundary. + * @param left Should bodies check against the left edge of the boundary? Default true. + * @param right Should bodies check against the right edge of the boundary? Default true. + * @param up Should bodies check against the top edge of the boundary? Default true. + * @param down Should bodies check against the bottom edge of the boundary? Default true. + */ + setBoundsCollision(left?: boolean, right?: boolean, up?: boolean, down?: boolean): Phaser.Physics.Arcade.World; + + /** + * Pauses the simulation. + * + * A paused simulation does not update any existing bodies, or run any Colliders. + * + * However, you can still enable and disable bodies within it, or manually run collide or overlap + * checks. + */ + pause(): Phaser.Physics.Arcade.World; + + /** + * Resumes the simulation, if paused. + */ + resume(): Phaser.Physics.Arcade.World; + + /** + * Creates a new Collider object and adds it to the simulation. + * + * A Collider is a way to automatically perform collision checks between two objects, + * calling the collide and process callbacks if they occur. + * + * Colliders are run as part of the World update, after all of the Bodies have updated. + * + * By creating a Collider you don't need then call `World.collide` in your `update` loop, + * as it will be handled for you automatically. + * @param object1 The first object to check for collision. + * @param object2 The second object to check for collision. + * @param collideCallback The callback to invoke when the two objects collide. + * @param processCallback The callback to invoke when the two objects collide. Must return a boolean. + * @param callbackContext The scope in which to call the callbacks. + */ + addCollider(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): Phaser.Physics.Arcade.Collider; + + /** + * Creates a new Overlap Collider object and adds it to the simulation. + * + * A Collider is a way to automatically perform overlap checks between two objects, + * calling the collide and process callbacks if they occur. + * + * Colliders are run as part of the World update, after all of the Bodies have updated. + * + * By creating a Collider you don't need then call `World.overlap` in your `update` loop, + * as it will be handled for you automatically. + * @param object1 The first object to check for overlap. + * @param object2 The second object to check for overlap. + * @param collideCallback The callback to invoke when the two objects overlap. + * @param processCallback The callback to invoke when the two objects overlap. Must return a boolean. + * @param callbackContext The scope in which to call the callbacks. + */ + addOverlap(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): Phaser.Physics.Arcade.Collider; + + /** + * Removes a Collider from the simulation so it is no longer processed. + * + * This method does not destroy the Collider. If you wish to add it back at a later stage you can call + * `World.colliders.add(Collider)`. + * + * If you no longer need the Collider you can call the `Collider.destroy` method instead, which will + * automatically clear all of its references and then remove it from the World. If you call destroy on + * a Collider you _don't_ need to pass it to this method too. + * @param collider The Collider to remove from the simulation. + */ + removeCollider(collider: Phaser.Physics.Arcade.Collider): Phaser.Physics.Arcade.World; + + /** + * Sets the frame rate to run the simulation at. + * + * The frame rate value is used to simulate a fixed update time step. This fixed + * time step allows for a straightforward implementation of a deterministic game state. + * + * This frame rate is independent of the frequency at which the game is rendering. The + * higher you set the fps, the more physics simulation steps will occur per game step. + * Conversely, the lower you set it, the less will take place. + * + * You can optionally advance the simulation directly yourself by calling the `step` method. + * @param framerate The frame rate to advance the simulation at. + */ + setFPS(framerate: integer): this; + + /** + * Advances the simulation based on the elapsed time and fps rate. + * + * This is called automatically by your Scene and does not need to be invoked directly. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected update(time: number, delta: number): void; + + /** + * Advances the simulation by a time increment. + * @param delta The delta time amount, in seconds, by which to advance the simulation. + */ + step(delta: number): void; + + /** + * Updates bodies, draws the debug display, and handles pending queue operations. + */ + postUpdate(): void; + + /** + * Calculates a Body's velocity and updates its position. + * @param body The Body to be updated. + * @param delta The delta value to be used in the motion calculations, in seconds. + */ + updateMotion(body: Phaser.Physics.Arcade.Body, delta: number): void; + + /** + * Calculates a Body's angular velocity. + * @param body The Body to compute the velocity for. + * @param delta The delta value to be used in the calculation, in seconds. + */ + computeAngularVelocity(body: Phaser.Physics.Arcade.Body, delta: number): void; + + /** + * Calculates a Body's per-axis velocity. + * @param body The Body to compute the velocity for. + * @param delta The delta value to be used in the calculation, in seconds. + */ + computeVelocity(body: Phaser.Physics.Arcade.Body, delta: number): void; + + /** + * Separates two Bodies. + * @param body1 The first Body to be separated. + * @param body2 The second Body to be separated. + * @param processCallback The process callback. + * @param callbackContext The context in which to invoke the callback. + * @param overlapOnly If this a collide or overlap check? + */ + separate(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, processCallback?: ArcadePhysicsCallback, callbackContext?: any, overlapOnly?: boolean): boolean; + + /** + * Separates two Bodies, when both are circular. + * @param body1 The first Body to be separated. + * @param body2 The second Body to be separated. + * @param overlapOnly If this a collide or overlap check? + * @param bias A small value added to the calculations. + */ + separateCircle(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body, overlapOnly?: boolean, bias?: number): boolean; + + /** + * Checks to see if two Bodies intersect at all. + * @param body1 The first body to check. + * @param body2 The second body to check. + */ + intersects(body1: Phaser.Physics.Arcade.Body, body2: Phaser.Physics.Arcade.Body): boolean; + + /** + * Tests if a circular Body intersects with another Body. + * @param circle The circular body to test. + * @param body The rectangular body to test. + */ + circleBodyIntersects(circle: Phaser.Physics.Arcade.Body, body: Phaser.Physics.Arcade.Body): boolean; + + /** + * Tests if Game Objects overlap. + * @param object1 The first object or array of objects to check. + * @param object2 The second object or array of objects to check, or `undefined`. + * @param overlapCallback An optional callback function that is called if the objects overlap. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + overlap(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2?: Phaser.Types.Physics.Arcade.ArcadeColliderType, overlapCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * Performs a collision check and separation between the two physics enabled objects given, which can be single + * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. + * + * If you don't require separation then use {@link #overlap} instead. + * + * If two Groups or arrays are passed, each member of one will be tested against each member of the other. + * + * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members. + * + * If **only** one Array is passed, the array is iterated and every element in it is tested against the others. + * + * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding + * objects are passed to it. + * + * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable + * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. + * The separation that stops two objects penetrating may create a new penetration against a different object. If you + * require a high level of stability please consider using an alternative physics system, such as Matter.js. + * @param object1 The first object or array of objects to check. + * @param object2 The second object or array of objects to check, or `undefined`. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + collide(object1: Phaser.Types.Physics.Arcade.ArcadeColliderType, object2?: Phaser.Types.Physics.Arcade.ArcadeColliderType, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects. + * + * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for collision with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions + * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * + * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have + * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the + * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on + * dynamic maps, this method can prove very useful. + * @param sprite The first object to check for collision. + * @param tiles An array of Tiles to check for collision against. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + collideTiles(sprite: Phaser.GameObjects.GameObject, tiles: Phaser.Tilemaps.Tile[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects. + * + * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap + * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * @param sprite The first object to check for collision. + * @param tiles An array of Tiles to check for collision against. + * @param collideCallback An optional callback function that is called if the objects overlap. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + */ + overlapTiles(sprite: Phaser.GameObjects.GameObject, tiles: Phaser.Tilemaps.Tile[], collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any): boolean; + + /** + * Internal handler for Sprite vs. Tilemap collisions. + * Please use Phaser.Physics.Arcade.World#collide instead. + * @param sprite The first object to check for collision. + * @param tilemapLayer The second object to check for collision. + * @param collideCallback An optional callback function that is called if the objects collide. + * @param processCallback An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param callbackContext The context in which to run the callbacks. + * @param overlapOnly Whether this is a collision or overlap check. + */ + collideSpriteVsTilemapLayer(sprite: Phaser.GameObjects.GameObject, tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any, overlapOnly?: boolean): boolean; + + /** + * Wrap an object's coordinates (or several objects' coordinates) within {@link Phaser.Physics.Arcade.World#bounds}. + * + * If the object is outside any boundary edge (left, top, right, bottom), it will be moved to the same offset from the opposite edge (the interior). + * @param object A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. + * @param padding An amount added to each boundary edge during the operation. Default 0. + */ + wrap(object: any, padding?: number): void; + + /** + * Wrap each object's coordinates within {@link Phaser.Physics.Arcade.World#bounds}. + * @param objects An array of objects to be wrapped. + * @param padding An amount added to the boundary. Default 0. + */ + wrapArray(objects: any[], padding?: number): void; + + /** + * Wrap an object's coordinates within {@link Phaser.Physics.Arcade.World#bounds}. + * @param object A Game Object, a Physics Body, or any object with `x` and `y` coordinates + * @param padding An amount added to the boundary. Default 0. + */ + wrapObject(object: any, padding?: number): void; + + /** + * Shuts down the simulation, clearing physics data and removing listeners. + */ + shutdown(): void; + + /** + * Shuts down the simulation and disconnects it from the current scene. + */ + destroy(): void; + + } + + } + + /** + * An Impact.js compatible physics world, body and solver, for those who are used + * to the Impact way of defining and controlling physics bodies. Also works with + * the new Loader support for Weltmeister map data. + * + * World updated to run off the Phaser main loop. + * Body extended to support additional setter functions. + * + * To create the map data you'll need Weltmeister, which comes with Impact + * and can be purchased from http://impactjs.com + * + * My thanks to Dominic Szablewski for his permission to support Impact in Phaser. + */ + namespace Impact { + /** + * An Impact.js compatible physics body. + * This re-creates the properties you'd get on an Entity and the math needed to update them. + */ + class Body { + /** + * + * @param world [description] + * @param x [description] + * @param y [description] + * @param sx [description] Default 16. + * @param sy [description] Default 16. + */ + constructor(world: Phaser.Physics.Impact.World, x: number, y: number, sx?: number, sy?: number); + + /** + * [description] + */ + world: Phaser.Physics.Impact.World; + + /** + * [description] + */ + gameObject: Phaser.GameObjects.GameObject; + + /** + * [description] + */ + enabled: boolean; + + /** + * The ImpactBody, ImpactSprite or ImpactImage object that owns this Body, if any. + */ + parent: Phaser.Physics.Impact.ImpactBody | Phaser.Physics.Impact.ImpactImage | Phaser.Physics.Impact.ImpactSprite; + + /** + * [description] + */ + id: integer; + + /** + * [description] + */ + name: string; + + /** + * [description] + */ + size: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + offset: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + pos: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + last: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + vel: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + accel: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + friction: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + maxVel: Phaser.Types.Math.Vector2Like; + + /** + * [description] + */ + standing: boolean; + + /** + * [description] + */ + gravityFactor: number; + + /** + * [description] + */ + bounciness: number; + + /** + * [description] + */ + minBounceVelocity: number; + + /** + * [description] + */ + accelGround: number; + + /** + * [description] + */ + accelAir: number; + + /** + * [description] + */ + jumpSpeed: number; + + /** + * [description] + */ + type: Phaser.Physics.Impact.TYPE; + + /** + * [description] + */ + checkAgainst: Phaser.Physics.Impact.TYPE; + + /** + * [description] + */ + collides: Phaser.Physics.Impact.COLLIDES; + + /** + * [description] + */ + debugShowBody: boolean; + + /** + * [description] + */ + debugShowVelocity: boolean; + + /** + * [description] + */ + debugBodyColor: integer; + + /** + * [description] + */ + updateCallback: Phaser.Types.Physics.Impact.BodyUpdateCallback; + + /** + * min 44 deg, max 136 deg + */ + slopeStanding: Object; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + reset(x: number, y: number): void; + + /** + * [description] + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(delta: number): void; + + /** + * [description] + * @param graphic [description] + */ + drawDebug(graphic: Phaser.GameObjects.Graphics): void; + + /** + * [description] + */ + willDrawDebug(): boolean; + + /** + * [description] + */ + skipHash(): boolean; + + /** + * Determines whether the body collides with the `other` one or not. + * @param other [description] + */ + touches(other: Phaser.Physics.Impact.Body): boolean; + + /** + * Reset the size and position of the physics body. + * @param x The x coordinate to position the body. + * @param y The y coordinate to position the body. + * @param width The width of the body. + * @param height The height of the body. + */ + resetSize(x: number, y: number, width: number, height: number): Phaser.Physics.Impact.Body; + + /** + * Export this body object to JSON. + */ + toJSON(): Phaser.Types.Physics.Impact.JSONImpactBody; + + /** + * [description] + * @param config [description] + */ + fromJSON(config: object): void; + + /** + * Can be overridden by user code + * @param other [description] + */ + check(other: Phaser.Physics.Impact.Body): void; + + /** + * Can be overridden by user code + * @param other [description] + * @param axis [description] + */ + collideWith(other: Phaser.Physics.Impact.Body, axis: string): void; + + /** + * Can be overridden by user code but must return a boolean. + * @param res [description] + */ + handleMovementTrace(res: number): boolean; + + /** + * [description] + */ + destroy(): void; + + } + + /** + * Collision Types - Determine if and how entities collide with each other. + * + * In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves, + * while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE + * collisions, both entities are moved. LITE or PASSIVE entities don't collide + * with other LITE or PASSIVE entities at all. The behavior for FIXED vs. + * FIXED collisions is undefined. + */ + enum COLLIDES { + /** + * Never collides. + */ + NEVER, + /** + * Lite collision. + */ + LITE, + /** + * Passive collision. + */ + PASSIVE, + /** + * Active collision. + */ + ACTIVE, + /** + * Fixed collision. + */ + FIXED, + } + + /** + * [description] + */ + class CollisionMap { + /** + * + * @param tilesize [description] Default 32. + * @param data [description] + */ + constructor(tilesize?: integer, data?: any[]); + + /** + * [description] + */ + tilesize: integer; + + /** + * [description] + */ + data: any[]; + + /** + * [description] + */ + width: number; + + /** + * [description] + */ + height: number; + + /** + * [description] + */ + lastSlope: integer; + + /** + * [description] + */ + tiledef: object; + + /** + * [description] + * @param x [description] + * @param y [description] + * @param vx [description] + * @param vy [description] + * @param objectWidth [description] + * @param objectHeight [description] + */ + trace(x: number, y: number, vx: number, vy: number, objectWidth: number, objectHeight: number): boolean; + + /** + * [description] + * @param res [description] + * @param x [description] + * @param y [description] + * @param vx [description] + * @param vy [description] + * @param width [description] + * @param height [description] + * @param rvx [description] + * @param rvy [description] + * @param step [description] + */ + step(res: object, x: number, y: number, vx: number, vy: number, width: number, height: number, rvx: number, rvy: number, step: number): void; + + /** + * [description] + * @param res [description] + * @param t [description] + * @param x [description] + * @param y [description] + * @param vx [description] + * @param vy [description] + * @param width [description] + * @param height [description] + * @param tileX [description] + * @param tileY [description] + */ + checkDef(res: object, t: number, x: number, y: number, vx: number, vy: number, width: number, height: number, tileX: number, tileY: number): boolean; + + } + + namespace Components { + /** + * The Impact Acceleration component. + * Should be applied as a mixin. + */ + interface Acceleration { + /** + * Sets the horizontal acceleration of this body. + * @param x The amount of acceleration to apply. + */ + setAccelerationX(x: number): this; + /** + * Sets the vertical acceleration of this body. + * @param y The amount of acceleration to apply. + */ + setAccelerationY(y: number): this; + /** + * Sets the horizontal and vertical acceleration of this body. + * @param x The amount of horizontal acceleration to apply. + * @param y The amount of vertical acceleration to apply. + */ + setAcceleration(x: number, y: number): this; + } + + /** + * The Impact Body Scale component. + * Should be applied as a mixin. + */ + interface BodyScale { + /** + * Sets the size of the physics body. + * @param width The width of the body in pixels. + * @param height The height of the body in pixels. Default width. + */ + setBodySize(width: number, height?: number): this; + /** + * Sets the scale of the physics body. + * @param scaleX The horizontal scale of the body. + * @param scaleY The vertical scale of the body. If not given, will use the horizontal scale value. + */ + setBodyScale(scaleX: number, scaleY?: number): this; + } + + /** + * The Impact Body Type component. + * Should be applied as a mixin. + */ + interface BodyType { + /** + * [description] + */ + getBodyType(): number; + /** + * [description] + */ + setTypeNone(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setTypeA(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setTypeB(): Phaser.GameObjects.GameObject; + } + + /** + * The Impact Bounce component. + * Should be applied as a mixin. + */ + interface Bounce { + /** + * Sets the impact physics bounce, or restitution, value. + * @param value A value between 0 (no rebound) and 1 (full rebound) + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. + * @param value The minimum allowed velocity. + */ + setMinBounceVelocity(value: number): Phaser.GameObjects.GameObject; + /** + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) + */ + bounce: number; + } + + /** + * The Impact Check Against component. + * Should be applied as a mixin. + */ + interface CheckAgainst { + /** + * [description] + */ + setAvsB(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setBvsA(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setCheckAgainstNone(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setCheckAgainstA(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setCheckAgainstB(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + checkAgainst: number; + } + + /** + * The Impact Collides component. + * Should be applied as a mixin. + */ + interface Collides { + /** + * [description] + * @param callback [description] + * @param scope [description] + */ + setCollideCallback(callback: CollideCallback, scope: any): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setCollidesNever(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setLiteCollision(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setPassiveCollision(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setActiveCollision(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + setFixedCollision(): Phaser.GameObjects.GameObject; + /** + * [description] + */ + collides: number; + } + + /** + * The Impact Debug component. + * Should be applied as a mixin. + */ + interface Debug { + /** + * [description] + * @param showBody [description] + * @param showVelocity [description] + * @param bodyColor [description] + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): Phaser.GameObjects.GameObject; + /** + * [description] + * @param value [description] + */ + setDebugBodyColor(value: number): Phaser.GameObjects.GameObject; + /** + * [description] + */ + debugShowBody: boolean; + /** + * [description] + */ + debugShowVelocity: boolean; + /** + * [description] + */ + debugBodyColor: number; + } + + /** + * The Impact Friction component. + * Should be applied as a mixin. + */ + interface Friction { + /** + * [description] + * @param x [description] + */ + setFrictionX(x: number): Phaser.GameObjects.GameObject; + /** + * [description] + * @param y [description] + */ + setFrictionY(y: number): Phaser.GameObjects.GameObject; + /** + * [description] + * @param x [description] + * @param y [description] + */ + setFriction(x: number, y: number): Phaser.GameObjects.GameObject; + } + + /** + * The Impact Gravity component. + * Should be applied as a mixin. + */ + interface Gravity { + /** + * [description] + * @param value [description] + */ + setGravity(value: number): Phaser.GameObjects.GameObject; + /** + * [description] + */ + gravity: number; + } + + /** + * The Impact Offset component. + * Should be applied as a mixin. + */ + interface Offset { + /** + * [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + setOffset(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.GameObject; + } + + /** + * The Impact Set Game Object component. + * Should be applied as a mixin. + */ + interface SetGameObject { + /** + * [description] + * @param gameObject [description] + * @param sync [description] Default true. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, sync?: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + */ + syncGameObject(): Phaser.GameObjects.GameObject; + } + + /** + * The Impact Velocity component. + * Should be applied as a mixin. + */ + interface Velocity { + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): this; + /** + * Sets the vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): this; + /** + * Sets the horizontal and vertical velocities of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value. If not given, defaults to the horizontal value. Default x. + */ + setVelocity(x: number, y?: number): this; + /** + * Sets the maximum velocity this body can travel at. + * @param x The maximum allowed horizontal velocity. + * @param y The maximum allowed vertical velocity. If not given, defaults to the horizontal value. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + } + + } + + namespace Events { + /** + * The Impact Physics World Collide Event. + * + * This event is dispatched by an Impact Physics World instance if two bodies collide. + * + * Listen to it from a Scene using: `this.impact.world.on('collide', listener)`. + */ + const COLLIDE: any; + + /** + * The Impact Physics World Pause Event. + * + * This event is dispatched by an Impact Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.impact.world.on('pause', listener)`. + */ + const PAUSE: any; + + /** + * The Impact Physics World Resume Event. + * + * This event is dispatched by an Impact Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.impact.world.on('resume', listener)`. + */ + const RESUME: any; + + } + + /** + * The Impact Physics Factory allows you to easily create Impact Physics enabled Game Objects. + * Objects that are created by this Factory are automatically added to the physics world. + */ + class Factory { + /** + * + * @param world A reference to the Impact Physics world. + */ + constructor(world: Phaser.Physics.Impact.World); + + /** + * A reference to the Impact Physics world. + */ + world: Phaser.Physics.Impact.World; + + /** + * A reference to the Scene.Systems this Impact Physics instance belongs to. + */ + sys: Phaser.Scenes.Systems; + + /** + * Creates a new ImpactBody object and adds it to the physics simulation. + * @param x The horizontal position of the body in the physics world. + * @param y The vertical position of the body in the physics world. + * @param width The width of the body. + * @param height The height of the body. + */ + body(x: number, y: number, width: number, height: number): Phaser.Physics.Impact.ImpactBody; + + /** + * Adds an Impact Physics Body to the given Game Object. + * @param gameObject The Game Object to receive the physics body. + */ + existing(gameObject: Phaser.GameObjects.GameObject): Phaser.GameObjects.GameObject; + + /** + * Creates a new ImpactImage object and adds it to the physics world. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + image(x: number, y: number, key: string, frame?: string | integer): Phaser.Physics.Impact.ImpactImage; + + /** + * Creates a new ImpactSprite object and adds it to the physics world. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + sprite(x: number, y: number, key: string, frame?: string | integer): Phaser.Physics.Impact.ImpactSprite; + + /** + * Destroys this Factory. + */ + destroy(): void; + + } + + /** + * [description] + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + * @param vel [description] + * @param accel [description] + * @param friction [description] + * @param max [description] + */ + function GetVelocity(delta: number, vel: number, accel: number, friction: number, max: number): number; + + /** + * [description] + */ + class ImpactBody implements Phaser.Physics.Impact.Components.Acceleration, Phaser.Physics.Impact.Components.BodyScale, Phaser.Physics.Impact.Components.BodyType, Phaser.Physics.Impact.Components.Bounce, Phaser.Physics.Impact.Components.CheckAgainst, Phaser.Physics.Impact.Components.Collides, Phaser.Physics.Impact.Components.Debug, Phaser.Physics.Impact.Components.Friction, Phaser.Physics.Impact.Components.Gravity, Phaser.Physics.Impact.Components.Offset, Phaser.Physics.Impact.Components.SetGameObject, Phaser.Physics.Impact.Components.Velocity { + /** + * + * @param world [description] + * @param x x - The horizontal position of this physics body in the world. + * @param y y - The vertical position of this physics body in the world. + * @param width The width of the physics body in the world. + * @param height [description] + */ + constructor(world: Phaser.Physics.Impact.World, x: number, y: number, width: number, height: number); + + /** + * [description] + */ + body: Phaser.Physics.Impact.Body; + + /** + * [description] + */ + size: Object; + + /** + * [description] + */ + offset: Object; + + /** + * [description] + */ + vel: Object; + + /** + * [description] + */ + accel: Object; + + /** + * [description] + */ + friction: Object; + + /** + * [description] + */ + maxVel: Object; + + /** + * Sets the horizontal acceleration of this body. + * @param x The amount of acceleration to apply. + */ + setAccelerationX(x: number): this; + + /** + * Sets the vertical acceleration of this body. + * @param y The amount of acceleration to apply. + */ + setAccelerationY(y: number): this; + + /** + * Sets the horizontal and vertical acceleration of this body. + * @param x The amount of horizontal acceleration to apply. + * @param y The amount of vertical acceleration to apply. + */ + setAcceleration(x: number, y: number): this; + + /** + * Sets the size of the physics body. + * @param width The width of the body in pixels. + * @param height The height of the body in pixels. Default width. + */ + setBodySize(width: number, height?: number): this; + + /** + * Sets the scale of the physics body. + * @param scaleX The horizontal scale of the body. + * @param scaleY The vertical scale of the body. If not given, will use the horizontal scale value. + */ + setBodyScale(scaleX: number, scaleY?: number): this; + + /** + * [description] + */ + getBodyType(): number; + + /** + * [description] + */ + setTypeNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeB(): Phaser.GameObjects.GameObject; + + /** + * Sets the impact physics bounce, or restitution, value. + * @param value A value between 0 (no rebound) and 1 (full rebound) + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. + * @param value The minimum allowed velocity. + */ + setMinBounceVelocity(value: number): Phaser.GameObjects.GameObject; + + /** + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) + */ + bounce: number; + + /** + * [description] + */ + setAvsB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setBvsA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + checkAgainst: number; + + /** + * [description] + * @param callback [description] + * @param scope [description] + */ + setCollideCallback(callback: CollideCallback, scope: any): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCollidesNever(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setLiteCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setPassiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setActiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setFixedCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + collides: number; + + /** + * [description] + * @param showBody [description] + * @param showVelocity [description] + * @param bodyColor [description] + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setDebugBodyColor(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + debugShowBody: boolean; + + /** + * [description] + */ + debugShowVelocity: boolean; + + /** + * [description] + */ + debugBodyColor: number; + + /** + * [description] + * @param x [description] + */ + setFrictionX(x: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param y [description] + */ + setFrictionY(y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + setFriction(x: number, y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setGravity(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + gravity: number; + + /** + * [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + setOffset(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param gameObject [description] + * @param sync [description] Default true. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, sync?: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + syncGameObject(): Phaser.GameObjects.GameObject; + + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): this; + + /** + * Sets the vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): this; + + /** + * Sets the horizontal and vertical velocities of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value. If not given, defaults to the horizontal value. Default x. + */ + setVelocity(x: number, y?: number): this; + + /** + * Sets the maximum velocity this body can travel at. + * @param x The maximum allowed horizontal velocity. + * @param y The maximum allowed vertical velocity. If not given, defaults to the horizontal value. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + + } + + /** + * An Impact Physics Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + */ + class ImpactImage extends Phaser.GameObjects.Image implements Phaser.Physics.Impact.Components.Acceleration, Phaser.Physics.Impact.Components.BodyScale, Phaser.Physics.Impact.Components.BodyType, Phaser.Physics.Impact.Components.Bounce, Phaser.Physics.Impact.Components.CheckAgainst, Phaser.Physics.Impact.Components.Collides, Phaser.Physics.Impact.Components.Debug, Phaser.Physics.Impact.Components.Friction, Phaser.Physics.Impact.Components.Gravity, Phaser.Physics.Impact.Components.Offset, Phaser.Physics.Impact.Components.SetGameObject, Phaser.Physics.Impact.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param world The physics world of the Impact physics system. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(world: Phaser.Physics.Impact.World, x: number, y: number, texture: string, frame?: string | integer); + + /** + * The Physics Body linked to an ImpactImage. + */ + body: Phaser.Physics.Impact.Body; + + /** + * The size of the physics Body. + */ + size: Object; + + /** + * The X and Y offset of the Body from the left and top of the Image. + */ + offset: Object; + + /** + * The velocity, or rate of change the Body's position. Measured in pixels per second. + */ + vel: Object; + + /** + * The acceleration is the rate of change of the velocity. Measured in pixels per second squared. + */ + accel: Object; + + /** + * Friction between colliding bodies. + */ + friction: Object; + + /** + * The maximum velocity of the body. + */ + maxVel: Object; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the horizontal acceleration of this body. + * @param x The amount of acceleration to apply. + */ + setAccelerationX(x: number): this; + + /** + * Sets the vertical acceleration of this body. + * @param y The amount of acceleration to apply. + */ + setAccelerationY(y: number): this; + + /** + * Sets the horizontal and vertical acceleration of this body. + * @param x The amount of horizontal acceleration to apply. + * @param y The amount of vertical acceleration to apply. + */ + setAcceleration(x: number, y: number): this; + + /** + * Sets the size of the physics body. + * @param width The width of the body in pixels. + * @param height The height of the body in pixels. Default width. + */ + setBodySize(width: number, height?: number): this; + + /** + * Sets the scale of the physics body. + * @param scaleX The horizontal scale of the body. + * @param scaleY The vertical scale of the body. If not given, will use the horizontal scale value. + */ + setBodyScale(scaleX: number, scaleY?: number): this; + + /** + * [description] + */ + getBodyType(): number; + + /** + * [description] + */ + setTypeNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeB(): Phaser.GameObjects.GameObject; + + /** + * Sets the impact physics bounce, or restitution, value. + * @param value A value between 0 (no rebound) and 1 (full rebound) + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. + * @param value The minimum allowed velocity. + */ + setMinBounceVelocity(value: number): Phaser.GameObjects.GameObject; + + /** + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) + */ + bounce: number; + + /** + * [description] + */ + setAvsB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setBvsA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + checkAgainst: number; + + /** + * [description] + * @param callback [description] + * @param scope [description] + */ + setCollideCallback(callback: CollideCallback, scope: any): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCollidesNever(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setLiteCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setPassiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setActiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setFixedCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + collides: number; + + /** + * [description] + * @param showBody [description] + * @param showVelocity [description] + * @param bodyColor [description] + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setDebugBodyColor(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + debugShowBody: boolean; + + /** + * [description] + */ + debugShowVelocity: boolean; + + /** + * [description] + */ + debugBodyColor: number; + + /** + * [description] + * @param x [description] + */ + setFrictionX(x: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param y [description] + */ + setFrictionY(y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + setFriction(x: number, y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setGravity(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + gravity: number; + + /** + * [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + setOffset(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param gameObject [description] + * @param sync [description] Default true. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, sync?: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + syncGameObject(): Phaser.GameObjects.GameObject; + + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): this; + + /** + * Sets the vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): this; + + /** + * Sets the horizontal and vertical velocities of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value. If not given, defaults to the horizontal value. Default x. + */ + setVelocity(x: number, y?: number): this; + + /** + * Sets the maximum velocity this body can travel at. + * @param x The maximum allowed horizontal velocity. + * @param y The maximum allowed vertical velocity. If not given, defaults to the horizontal value. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + + } + + /** + * [description] + */ + class ImpactPhysics { + /** + * + * @param scene [description] + */ + constructor(scene: Phaser.Scene); + + /** + * [description] + */ + scene: Phaser.Scene; + + /** + * [description] + */ + systems: Phaser.Scenes.Systems; + + /** + * [description] + */ + config: object; + + /** + * [description] + */ + world: Phaser.Physics.Impact.World; + + /** + * [description] + */ + add: Phaser.Physics.Impact.Factory; + + /** + * [description] + */ + getConfig(): object; + + /** + * [description] + */ + pause(): Phaser.Physics.Impact.World; + + /** + * [description] + */ + resume(): Phaser.Physics.Impact.World; + + } + + /** + * An Impact Physics Sprite Game Object. + * + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + */ + class ImpactSprite extends Phaser.GameObjects.Sprite implements Phaser.Physics.Impact.Components.Acceleration, Phaser.Physics.Impact.Components.BodyScale, Phaser.Physics.Impact.Components.BodyType, Phaser.Physics.Impact.Components.Bounce, Phaser.Physics.Impact.Components.CheckAgainst, Phaser.Physics.Impact.Components.Collides, Phaser.Physics.Impact.Components.Debug, Phaser.Physics.Impact.Components.Friction, Phaser.Physics.Impact.Components.Gravity, Phaser.Physics.Impact.Components.Offset, Phaser.Physics.Impact.Components.SetGameObject, Phaser.Physics.Impact.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param world [description] + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + */ + constructor(world: Phaser.Physics.Impact.World, x: number, y: number, texture: string, frame?: string | integer); + + /** + * [description] + */ + body: Phaser.Physics.Impact.Body; + + /** + * [description] + */ + size: Object; + + /** + * [description] + */ + offset: Object; + + /** + * [description] + */ + vel: Object; + + /** + * [description] + */ + accel: Object; + + /** + * [description] + */ + friction: Object; + + /** + * [description] + */ + maxVel: Object; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the horizontal acceleration of this body. + * @param x The amount of acceleration to apply. + */ + setAccelerationX(x: number): this; + + /** + * Sets the vertical acceleration of this body. + * @param y The amount of acceleration to apply. + */ + setAccelerationY(y: number): this; + + /** + * Sets the horizontal and vertical acceleration of this body. + * @param x The amount of horizontal acceleration to apply. + * @param y The amount of vertical acceleration to apply. + */ + setAcceleration(x: number, y: number): this; + + /** + * Sets the size of the physics body. + * @param width The width of the body in pixels. + * @param height The height of the body in pixels. Default width. + */ + setBodySize(width: number, height?: number): this; + + /** + * Sets the scale of the physics body. + * @param scaleX The horizontal scale of the body. + * @param scaleY The vertical scale of the body. If not given, will use the horizontal scale value. + */ + setBodyScale(scaleX: number, scaleY?: number): this; + + /** + * [description] + */ + getBodyType(): number; + + /** + * [description] + */ + setTypeNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setTypeB(): Phaser.GameObjects.GameObject; + + /** + * Sets the impact physics bounce, or restitution, value. + * @param value A value between 0 (no rebound) and 1 (full rebound) + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. + * @param value The minimum allowed velocity. + */ + setMinBounceVelocity(value: number): Phaser.GameObjects.GameObject; + + /** + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) + */ + bounce: number; + + /** + * [description] + */ + setAvsB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setBvsA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstNone(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstA(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCheckAgainstB(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + checkAgainst: number; + + /** + * [description] + * @param callback [description] + * @param scope [description] + */ + setCollideCallback(callback: CollideCallback, scope: any): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setCollidesNever(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setLiteCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setPassiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setActiveCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + setFixedCollision(): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + collides: number; + + /** + * [description] + * @param showBody [description] + * @param showVelocity [description] + * @param bodyColor [description] + */ + setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setDebugBodyColor(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + debugShowBody: boolean; + + /** + * [description] + */ + debugShowVelocity: boolean; + + /** + * [description] + */ + debugBodyColor: number; + + /** + * [description] + * @param x [description] + */ + setFrictionX(x: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param y [description] + */ + setFrictionY(y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param x [description] + * @param y [description] + */ + setFriction(x: number, y: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setGravity(value: number): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + gravity: number; + + /** + * [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + setOffset(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param gameObject [description] + * @param sync [description] Default true. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, sync?: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + syncGameObject(): Phaser.GameObjects.GameObject; + + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): this; + + /** + * Sets the vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): this; + + /** + * Sets the horizontal and vertical velocities of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value. If not given, defaults to the horizontal value. Default x. + */ + setVelocity(x: number, y?: number): this; + + /** + * Sets the maximum velocity this body can travel at. + * @param x The maximum allowed horizontal velocity. + * @param y The maximum allowed vertical velocity. If not given, defaults to the horizontal value. Default x. + */ + setMaxVelocity(x: number, y?: number): this; + + } + + /** + * [description] + * @param world [description] + * @param left [description] + * @param right [description] + * @param weak [description] + */ + function SeparateX(world: Phaser.Physics.Impact.World, left: Phaser.Physics.Impact.Body, right: Phaser.Physics.Impact.Body, weak?: Phaser.Physics.Impact.Body): void; + + /** + * [description] + * @param world [description] + * @param top [description] + * @param bottom [description] + * @param weak [description] + */ + function SeparateY(world: Phaser.Physics.Impact.World, top: Phaser.Physics.Impact.Body, bottom: Phaser.Physics.Impact.Body, weak?: Phaser.Physics.Impact.Body): void; + + /** + * Impact Physics Solver + * @param world The Impact simulation to run the solver in. + * @param bodyA The first body in the collision. + * @param bodyB The second body in the collision. + */ + function Solver(world: Phaser.Physics.Impact.World, bodyA: Phaser.Physics.Impact.Body, bodyB: Phaser.Physics.Impact.Body): void; + + /** + * Collision Types - Determine if and how entities collide with each other. + * + * In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves, + * while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE + * collisions, both entities are moved. LITE or PASSIVE entities don't collide + * with other LITE or PASSIVE entities at all. The behavior for FIXED vs. + * FIXED collisions is undefined. + */ + enum TYPE { + /** + * Collides with nothing. + */ + NONE, + /** + * Type A. Collides with Type B. + */ + A, + /** + * Type B. Collides with Type A. + */ + B, + /** + * Collides with both types A and B. + */ + BOTH, + } + + /** + * Set up the trace-result + * var res = { + * collision: {x: false, y: false, slope: false}, + * pos: {x: x, y: y}, + * tile: {x: 0, y: 0} + * }; + * @param body [description] + * @param res [description] + */ + function UpdateMotion(body: Phaser.Physics.Impact.Body, res: object): void; + + /** + * [description] + */ + class World extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene to which this Impact World instance belongs. + * @param config [description] + */ + constructor(scene: Phaser.Scene, config: Phaser.Types.Physics.Impact.WorldConfig); + + /** + * [description] + */ + scene: Phaser.Scene; + + /** + * [description] + */ + bodies: Phaser.Structs.Set; + + /** + * [description] + */ + gravity: number; + + /** + * Spatial hash cell dimensions + */ + cellSize: integer; + + /** + * [description] + */ + collisionMap: Phaser.Physics.Impact.CollisionMap; + + /** + * [description] + */ + timeScale: number; + + /** + * Impacts maximum time step is 20 fps. + */ + maxStep: number; + + /** + * [description] + */ + enabled: boolean; + + /** + * [description] + */ + drawDebug: boolean; + + /** + * [description] + */ + debugGraphic: Phaser.GameObjects.Graphics; + + /** + * [description] + */ + defaults: Phaser.Types.Physics.Impact.WorldDefaults; + + /** + * An object containing the 4 wall bodies that bound the physics world. + */ + walls: Phaser.Types.Physics.Impact.WorldWalls; + + /** + * [description] + */ + delta: number; + + /** + * Sets the collision map for the world either from a Weltmeister JSON level in the cache or from + * a 2D array. If loading from a Weltmeister level, the map must have a layer called "collision". + * @param key Either a string key that corresponds to a Weltmeister level + * in the cache, or a 2D array of collision IDs. + * @param tileSize The size of a tile. This is optional if loading from a Weltmeister + * level in the cache. + */ + setCollisionMap(key: string | integer[][], tileSize: integer): Phaser.Physics.Impact.CollisionMap; + + /** + * Sets the collision map for the world from a tilemap layer. Only tiles that are marked as + * colliding will be used. You can specify the mapping from tiles to slope IDs in a couple of + * ways. The easiest is to use Tiled and the slopeTileProperty option. Alternatively, you can + * manually create a slopeMap that stores the mapping between tile indices and slope IDs. + * @param tilemapLayer The tilemap layer to use. + * @param options Options for controlling the mapping from tiles to slope IDs. + */ + setCollisionMapFromTilemapLayer(tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, options?: Phaser.Types.Physics.Impact.CollisionOptions): Phaser.Physics.Impact.CollisionMap; + + /** + * Sets the bounds of the Physics world to match the given world pixel dimensions. + * You can optionally set which 'walls' to create: left, right, top or bottom. + * If none of the walls are given it will default to use the walls settings it had previously. + * I.e. if you previously told it to not have the left or right walls, and you then adjust the world size + * the newly created bounds will also not have the left and right walls. + * Explicitly state them in the parameters to override this. + * @param x The x coordinate of the top-left corner of the bounds. + * @param y The y coordinate of the top-left corner of the bounds. + * @param width The width of the bounds. + * @param height The height of the bounds. + * @param thickness [description] Default 64. + * @param left If true will create the left bounds wall. Default true. + * @param right If true will create the right bounds wall. Default true. + * @param top If true will create the top bounds wall. Default true. + * @param bottom If true will create the bottom bounds wall. Default true. + */ + setBounds(x?: number, y?: number, width?: number, height?: number, thickness?: number, left?: boolean, right?: boolean, top?: boolean, bottom?: boolean): Phaser.Physics.Impact.World; + + /** + * position = 'left', 'right', 'top' or 'bottom' + * @param add [description] + * @param position [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + updateWall(add: boolean, position: string, x: number, y: number, width: number, height: number): void; + + /** + * Creates a Graphics Game Object used for debug display and enables the world for debug drawing. + */ + createDebugGraphic(): Phaser.GameObjects.Graphics; + + /** + * [description] + */ + getNextID(): integer; + + /** + * [description] + * @param x [description] + * @param y [description] + * @param sizeX [description] + * @param sizeY [description] + */ + create(x: number, y: number, sizeX: number, sizeY: number): Phaser.Physics.Impact.Body; + + /** + * [description] + * @param object The Body to remove from this World. + */ + remove(object: Phaser.Physics.Impact.Body): void; + + /** + * [description] + */ + pause(): Phaser.Physics.Impact.World; + + /** + * [description] + */ + resume(): Phaser.Physics.Impact.World; + + /** + * [description] + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(time: number, delta: number): void; + + /** + * Check the body against the spatial hash. + * @param body [description] + * @param hash [description] + * @param size [description] + */ + checkHash(body: Phaser.Physics.Impact.Body, hash: object, size: number): void; + + /** + * [description] + * @param bodyA [description] + * @param bodyB [description] + */ + checkBodies(bodyA: Phaser.Physics.Impact.Body, bodyB: Phaser.Physics.Impact.Body): void; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the collides value on. + */ + setCollidesNever(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the collides value on. + */ + setLite(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the collides value on. + */ + setPassive(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the collides value on. + */ + setActive(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the collides value on. + */ + setFixed(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setTypeNone(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setTypeA(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setTypeB(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setAvsB(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setBvsA(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setCheckAgainstNone(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setCheckAgainstA(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + * @param bodies An Array of Impact Bodies to set the type value on. + */ + setCheckAgainstB(bodies: Phaser.Physics.Impact.Body[]): Phaser.Physics.Impact.World; + + /** + * [description] + */ + shutdown(): void; + + /** + * [description] + */ + destroy(): void; + + } + + } + + namespace Matter { + namespace Components { + /** + * A component to set restitution on objects. + */ + interface Bounce { + /** + * Sets the restitution on the physics object. + * @param value A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + } + + /** + * Contains methods for changing the collision filter of a Matter Body. Should be used as a mixin and not called directly. + */ + interface Collision { + /** + * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision categories are included in their collision masks (see {@link #setCollidesWith}). + * @param value Unique category bitfield. + */ + setCollisionCategory(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, they will never collide. + * @param value Unique group index. + */ + setCollisionGroup(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` are both true. + * @param categories A unique category bitfield, or an array of them. + */ + setCollidesWith(categories: number | number[]): Phaser.GameObjects.GameObject; + } + + /** + * A component to apply force to Matter.js bodies. + */ + interface Force { + /** + * Applies a force to a body. + * @param force A Vector that specifies the force to apply. + */ + applyForce(force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + /** + * Applies a force to a body from a given position. + * @param position The position in which the force comes from. + * @param force A Vector that specifies the force to apply. + */ + applyForceFrom(position: Phaser.Math.Vector2, force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the forward position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrust(speed: number): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the left position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustLeft(speed: number): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the right position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustRight(speed: number): Phaser.GameObjects.GameObject; + /** + * Apply thrust to the back position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustBack(speed: number): Phaser.GameObjects.GameObject; + } + + /** + * Contains methods for changing the friction of a Game Object's Matter Body. Should be used a mixin, not called directly. + */ + interface Friction { + /** + * Sets new friction values for this Game Object's Matter Body. + * @param value The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. + * @param air If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. + * @param fstatic If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. + */ + setFriction(value: number, air?: number, fstatic?: number): Phaser.GameObjects.GameObject; + /** + * Sets a new air resistance for this Game Object's Matter Body. A value of 0 means the Body will never slow as it moves through space. The higher the value, the faster a Body slows when moving through space. + * @param value The new air resistance for the Body. + */ + setFrictionAir(value: number): Phaser.GameObjects.GameObject; + /** + * Sets a new static friction for this Game Object's Matter Body. A value of 0 means the Body will never "stick" when it is nearly stationary. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. + * @param value The new static friction for the Body. + */ + setFrictionStatic(value: number): Phaser.GameObjects.GameObject; + } + + /** + * A component to manipulate world gravity for Matter.js bodies. + */ + interface Gravity { + /** + * A togglable function for ignoring world gravity in real-time on the current body. + * @param value Set to true to ignore the effect of world gravity, or false to not ignore it. + */ + setIgnoreGravity(value: boolean): Phaser.GameObjects.GameObject; + } + + /** + * Allows accessing the mass, density, and center of mass of a Matter-enabled Game Object. Should be used as a mixin and not directly. + */ + interface Mass { + /** + * Sets the mass of the Game Object's Matter Body. + * @param value The new mass of the body. + */ + setMass(value: number): Phaser.GameObjects.GameObject; + /** + * Sets density of the body. + * @param value The new density of the body. + */ + setDensity(value: number): Phaser.GameObjects.GameObject; + /** + * The body's center of mass. + */ + readonly centerOfMass: Phaser.Math.Vector2; + } + + /** + * [description] + */ + interface Sensor { + /** + * [description] + * @param value [description] + */ + setSensor(value: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + */ + isSensor(): boolean; + } + + /** + * [description] + */ + interface SetBody { + /** + * Set the body on a Game Object to a rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param options [description] + */ + setRectangle(width: number, height: number, options: object): Phaser.GameObjects.GameObject; + /** + * [description] + * @param radius [description] + * @param options [description] + */ + setCircle(radius: number, options: object): Phaser.GameObjects.GameObject; + /** + * Set the body on the Game Object to a polygon shape. + * @param radius The radius of the polygon. + * @param sides The amount of sides creating the polygon. + * @param options A matterjs config object. + */ + setPolygon(radius: number, sides: number, options: object): Phaser.GameObjects.GameObject; + /** + * Creates a new matterjs trapezoid body. + * @param width The width of the trapezoid. + * @param height The height of the trapezoid. + * @param slope The angle of slope for the trapezoid. + * @param options A matterjs config object for the body. + */ + setTrapezoid(width: number, height: number, slope: number, options: object): Phaser.GameObjects.GameObject; + /** + * [description] + * @param body [description] + * @param addToWorld [description] Default true. + */ + setExistingBody(body: MatterJS.Body, addToWorld?: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + * @param config [description] + * @param options [description] + */ + setBody(config: object, options: object): Phaser.GameObjects.GameObject; + } + + /** + * [description] + */ + interface Sleep { + /** + * [description] + * @param value [description] Default 60. + */ + setSleepThreshold(value?: number): Phaser.GameObjects.GameObject; + /** + * [description] + * @param start [description] + * @param end [description] + */ + setSleepEvents(start: boolean, end: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + * @param value [description] + */ + setSleepStartEvent(value: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + * @param value [description] + */ + setSleepEndEvent(value: boolean): Phaser.GameObjects.GameObject; + } + + /** + * [description] + */ + interface Static { + /** + * [description] + * @param value [description] + */ + setStatic(value: boolean): Phaser.GameObjects.GameObject; + /** + * [description] + */ + isStatic(): boolean; + } + + /** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + */ + interface Transform { + /** + * The x position of this Game Object. + */ + x: number; + /** + * The y position of this Game Object. + */ + y: number; + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + /** + * Use `angle` to set or get rotation of the physics body associated to this GameObject. Unlike rotation, when using set the value can be in degrees, which will be converted to radians internally. + */ + angle: number; + /** + * Use `rotation` to set or get the rotation of the physics body associated with this GameObject. The value when set must be in radians. + */ + rotation: number; + /** + * Sets the position of the physics body along x and y axes. Both the parameters to this function are optional and if not passed any they default to 0. + * @param x The horizontal position of the body. Default 0. + * @param y The vertical position of the body. Default x. + */ + setPosition(x?: number, y?: number): this; + /** + * [description] + * @param radians [description] Default 0. + */ + setRotation(radians?: number): this; + /** + * [description] + */ + setFixedRotation(): this; + /** + * [description] + * @param degrees [description] Default 0. + */ + setAngle(degrees?: number): this; + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. Default 1. + * @param y The vertical scale of this Game Object. If not set it will use the x value. Default x. + * @param point The point (Vector2) from which scaling will occur. + */ + setScale(x?: number, y?: number, point?: Phaser.Math.Vector2): this; + } + + /** + * [description] + */ + interface Velocity { + /** + * [description] + * @param value [description] + */ + setAngularVelocity(value: number): Phaser.GameObjects.GameObject; + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): Phaser.GameObjects.GameObject; + /** + * Sets vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): Phaser.GameObjects.GameObject; + /** + * Sets both the horizontal and vertical velocity of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the `x` value. Default x. + */ + setVelocity(x: number, y?: number): Phaser.GameObjects.GameObject; + } + + } + + namespace Events { + type AfterUpdateEvent = { + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics After Update Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved. + * + * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`. + */ + const AFTER_UPDATE: any; + + type BeforeUpdateEvent = { + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Before Update Event. + * + * This event is dispatched by a Matter Physics World instance right before all the collision processing takes place. + * + * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`. + */ + const BEFORE_UPDATE: any; + + type CollisionActiveEvent = { + /** + * A list of all affected pairs in the collision. + */ + pairs: any[]; + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Collision Active Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that are colliding in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`. + */ + const COLLISION_ACTIVE: any; + + type CollisionEndEvent = { + /** + * A list of all affected pairs in the collision. + */ + pairs: any[]; + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Collision End Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that have finished colliding in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`. + */ + const COLLISION_END: any; + + type CollisionStartEvent = { + /** + * A list of all affected pairs in the collision. + */ + pairs: any[]; + /** + * The Matter Engine `timing.timestamp` value for the event. + */ + timestamp: number; + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Collision Start Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that have started to collide in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`. + */ + const COLLISION_START: any; + + /** + * The Matter Physics Drag End Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * stops dragging a body. + * + * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`. + */ + const DRAG_END: any; + + /** + * The Matter Physics Drag Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * is actively dragging a body. It is emitted each time the pointer moves. + * + * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`. + */ + const DRAG: any; + + /** + * The Matter Physics Drag Start Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * starts dragging a body. + * + * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. + */ + const DRAG_START: any; + + /** + * The Matter Physics World Pause Event. + * + * This event is dispatched by an Matter Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`. + */ + const PAUSE: any; + + /** + * The Matter Physics World Resume Event. + * + * This event is dispatched by an Matter Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`. + */ + const RESUME: any; + + type SleepEndEvent = { + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Sleep End Event. + * + * This event is dispatched by a Matter Physics World instance when a Body stop sleeping. + * + * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`. + */ + const SLEEP_END: any; + + type SleepStartEvent = { + /** + * The source object of the event. + */ + source: any; + /** + * The name of the event. + */ + name: string; + }; + + /** + * The Matter Physics Sleep Start Event. + * + * This event is dispatched by a Matter Physics World instance when a Body goes to sleep. + * + * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`. + */ + const SLEEP_START: any; + + } + + /** + * The Matter Factory can create different types of bodies and them to a physics world. + */ + class Factory { + /** + * + * @param world The Matter World which this Factory adds to. + */ + constructor(world: Phaser.Physics.Matter.World); + + /** + * The Matter World which this Factory adds to. + */ + world: Phaser.Physics.Matter.World; + + /** + * The Scene which this Factory's Matter World belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene.Systems this Matter Physics instance belongs to. + */ + sys: Phaser.Scenes.Systems; + + /** + * Creates a new rigid rectangular Body and adds it to the World. + * @param x The X coordinate of the center of the Body. + * @param y The Y coordinate of the center of the Body. + * @param width The width of the Body. + * @param height The height of the Body. + * @param options An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + */ + rectangle(x: number, y: number, width: number, height: number, options: object): MatterJS.Body; + + /** + * Creates a new rigid trapezoidal Body and adds it to the World. + * @param x The X coordinate of the center of the Body. + * @param y The Y coordinate of the center of the Body. + * @param width The width of the trapezoid of the Body. + * @param height The height of the trapezoid of the Body. + * @param slope The slope of the trapezoid. 0 creates a rectangle, while 1 creates a triangle. Positive values make the top side shorter, while negative values make the bottom side shorter. + * @param options An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + */ + trapezoid(x: number, y: number, width: number, height: number, slope: number, options: object): MatterJS.Body; + + /** + * Creates a new rigid circular Body and adds it to the World. + * @param x The X coordinate of the center of the Body. + * @param y The Y coordinate of the center of the Body. + * @param radius The radius of the circle. + * @param options An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + * @param maxSides The maximum amount of sides to use for the polygon which will approximate this circle. + */ + circle(x: number, y: number, radius: number, options?: object, maxSides?: number): MatterJS.Body; + + /** + * Creates a new rigid polygonal Body and adds it to the World. + * @param x The X coordinate of the center of the Body. + * @param y The Y coordinate of the center of the Body. + * @param sides The number of sides the polygon will have. + * @param radius The "radius" of the polygon, i.e. the distance from its center to any vertex. This is also the radius of its circumcircle. + * @param options An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + */ + polygon(x: number, y: number, sides: number, radius: number, options: object): MatterJS.Body; + + /** + * Creates a body using the supplied vertices (or an array containing multiple sets of vertices) and adds it to the World. + * If the vertices are convex, they will pass through as supplied. Otherwise, if the vertices are concave, they will be decomposed. Note that this process is not guaranteed to support complex sets of vertices, e.g. ones with holes. + * @param x The X coordinate of the center of the Body. + * @param y The Y coordinate of the center of the Body. + * @param vertexSets [description] + * @param options [description] + * @param flagInternal Flag internal edges (coincident part edges) Default false. + * @param removeCollinear Whether Matter.js will discard collinear edges (to improve performance). Default 0.01. + * @param minimumArea During decomposition discard parts that have an area less than this. Default 10. + */ + fromVertices(x: number, y: number, vertexSets: string | any[], options?: object, flagInternal?: boolean, removeCollinear?: number, minimumArea?: number): MatterJS.Body; + + /** + * Create a new composite containing Matter Image objects created in a grid arrangement. + * This function uses the body bounds to prevent overlaps. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param x The horizontal position of this composite in the world. + * @param y The vertical position of this composite in the world. + * @param columns The number of columns in the grid. + * @param rows The number of rows in the grid. + * @param columnGap The distance between each column. Default 0. + * @param rowGap The distance between each row. Default 0. + * @param options [description] + */ + imageStack(key: string, frame: string | integer, x: number, y: number, columns: number, rows: number, columnGap?: number, rowGap?: number, options?: object): MatterJS.Composite; + + /** + * Create a new composite containing bodies created in the callback in a grid arrangement. + * This function uses the body bounds to prevent overlaps. + * @param x The horizontal position of this composite in the world. + * @param y The vertical position of this composite in the world. + * @param columns The number of columns in the grid. + * @param rows The number of rows in the grid. + * @param columnGap The distance between each column. + * @param rowGap The distance between each row. + * @param callback The callback that creates the stack. + */ + stack(x: number, y: number, columns: number, rows: number, columnGap: number, rowGap: number, callback: Function): MatterJS.Composite; + + /** + * Create a new composite containing bodies created in the callback in a pyramid arrangement. + * This function uses the body bounds to prevent overlaps. + * @param x The horizontal position of this composite in the world. + * @param y The vertical position of this composite in the world. + * @param columns The number of columns in the pyramid. + * @param rows The number of rows in the pyramid. + * @param columnGap The distance between each column. + * @param rowGap The distance between each row. + * @param callback The callback function to be invoked. + */ + pyramid(x: number, y: number, columns: number, rows: number, columnGap: number, rowGap: number, callback: Function): MatterJS.Composite; + + /** + * Chains all bodies in the given composite together using constraints. + * @param composite [description] + * @param xOffsetA [description] + * @param yOffsetA [description] + * @param xOffsetB [description] + * @param yOffsetB [description] + * @param options [description] + */ + chain(composite: MatterJS.Composite, xOffsetA: number, yOffsetA: number, xOffsetB: number, yOffsetB: number, options: object): MatterJS.Composite; + + /** + * Connects bodies in the composite with constraints in a grid pattern, with optional cross braces. + * @param composite [description] + * @param columns [description] + * @param rows [description] + * @param crossBrace [description] + * @param options [description] + */ + mesh(composite: MatterJS.Composite, columns: number, rows: number, crossBrace: boolean, options: object): MatterJS.Composite; + + /** + * Creates a composite with a Newton's Cradle setup of bodies and constraints. + * @param x [description] + * @param y [description] + * @param number [description] + * @param size [description] + * @param length [description] + */ + newtonsCradle(x: number, y: number, number: number, size: number, length: number): MatterJS.Composite; + + /** + * Creates a composite with simple car setup of bodies and constraints. + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + * @param wheelSize [description] + */ + car(x: number, y: number, width: number, height: number, wheelSize: number): MatterJS.Composite; + + /** + * Creates a simple soft body like object. + * @param x The horizontal position of this composite in the world. + * @param y The vertical position of this composite in the world. + * @param columns The number of columns in the Composite. + * @param rows The number of rows in the Composite. + * @param columnGap The distance between each column. + * @param rowGap The distance between each row. + * @param crossBrace [description] + * @param particleRadius The radius of this circlular composite. + * @param particleOptions [description] + * @param constraintOptions [description] + */ + softBody(x: number, y: number, columns: number, rows: number, columnGap: number, rowGap: number, crossBrace: boolean, particleRadius: number, particleOptions: object, constraintOptions: object): MatterJS.Composite; + + /** + * [description] + * @param bodyA [description] + * @param bodyB [description] + * @param length [description] + * @param stiffness [description] Default 1. + * @param options [description] Default {}. + */ + joint(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length: number, stiffness?: number, options?: object): MatterJS.Constraint; + + /** + * [description] + * @param bodyA The first possible `Body` that this constraint is attached to. + * @param bodyB The second possible `Body` that this constraint is attached to. + * @param length A Number that specifies the target resting length of the constraint. It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB` + * @param stiffness A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. Default 1. + * @param options [description] Default {}. + */ + spring(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length: number, stiffness?: number, options?: object): MatterJS.Constraint; + + /** + * [description] + * @param bodyA [description] + * @param bodyB [description] + * @param length [description] + * @param stiffness [description] Default 1. + * @param options [description] Default {}. + */ + constraint(bodyA: MatterJS.Body, bodyB: MatterJS.Body, length?: number, stiffness?: number, options?: object): MatterJS.Constraint; + + /** + * [description] + * @param bodyB [description] + * @param length [description] + * @param stiffness [description] Default 1. + * @param options [description] Default {}. + */ + worldConstraint(bodyB: MatterJS.Body, length: number, stiffness?: number, options?: object): MatterJS.Constraint; + + /** + * [description] + * @param options [description] + */ + mouseSpring(options: object): MatterJS.Constraint; + + /** + * [description] + * @param options [description] + */ + pointerConstraint(options: object): MatterJS.Constraint; + + /** + * [description] + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param options [description] Default {}. + */ + image(x: number, y: number, key: string, frame?: string | integer, options?: object): Phaser.Physics.Matter.Image; + + /** + * [description] + * @param tile [description] + * @param options [description] + */ + tileBody(tile: Phaser.Tilemaps.Tile, options: object): Phaser.Physics.Matter.TileBody; + + /** + * [description] + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param options [description] Default {}. + */ + sprite(x: number, y: number, key: string, frame?: string | integer, options?: object): Phaser.Physics.Matter.Sprite; + + /** + * [description] + * @param gameObject The Game Object to inject the Matter Body in to. + * @param options A Matter Body configuration object, or an instance of a Matter Body. + */ + gameObject(gameObject: Phaser.GameObjects.GameObject, options: object | MatterJS.Body): Phaser.GameObjects.GameObject; + + /** + * Instantly sets the linear velocity of the given body. Position, angle, force etc. are unchanged. + * + * See also `force`. + * @param body The Matter Body to set the velocity on. + * @param velocity The velocity to set. An object with public `x` and `y` components. + */ + velocity(body: MatterJS.Body, velocity: Phaser.Types.Math.Vector2Like): MatterJS.Body; + + /** + * Instantly sets the angular velocity of the given body. Position, angle, force etc. are unchanged. + * + * See also `force`. + * @param body The Matter Body to set the velocity on. + * @param velocity The angular velocity to set. + */ + angularVelocity(body: MatterJS.Body, velocity: number): MatterJS.Body; + + /** + * Applies a force to a body from a given world-space position, including resulting torque. + * @param body The Matter Body to set the force on. + * @param position The world position to apply the force from. An object with public `x` and `y` components. + * @param force The force to set. An object with public `x` and `y` components. + */ + force(body: MatterJS.Body, position: Phaser.Types.Math.Vector2Like, force: Phaser.Types.Math.Vector2Like): MatterJS.Body; + + /** + * Destroys this Factory. + */ + destroy(): void; + + } + + /** + * [description] + * @param world The Matter world to add the body to. + * @param gameObject The Game Object that will have the Matter body applied to it. + * @param options A Matter Body configuration object, or an instance of a Matter Body. + */ + function MatterGameObject(world: Phaser.Physics.Matter.World, gameObject: Phaser.GameObjects.GameObject, options: object | MatterJS.Body): Phaser.GameObjects.GameObject; + + /** + * A Matter Physics Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + */ + class Image extends Phaser.GameObjects.Image implements Phaser.Physics.Matter.Components.Bounce, Phaser.Physics.Matter.Components.Collision, Phaser.Physics.Matter.Components.Force, Phaser.Physics.Matter.Components.Friction, Phaser.Physics.Matter.Components.Gravity, Phaser.Physics.Matter.Components.Mass, Phaser.Physics.Matter.Components.Sensor, Phaser.Physics.Matter.Components.SetBody, Phaser.Physics.Matter.Components.Sleep, Phaser.Physics.Matter.Components.Static, Phaser.Physics.Matter.Components.Transform, Phaser.Physics.Matter.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param world [description] + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param options Matter.js configuration object. Default {}. + */ + constructor(world: Phaser.Physics.Matter.World, x: number, y: number, texture: string, frame?: string | integer, options?: object); + + /** + * [description] + */ + world: Phaser.Physics.Matter.World; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the restitution on the physics object. + * @param value A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision categories are included in their collision masks (see {@link #setCollidesWith}). + * @param value Unique category bitfield. + */ + setCollisionCategory(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, they will never collide. + * @param value Unique group index. + */ + setCollisionGroup(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` are both true. + * @param categories A unique category bitfield, or an array of them. + */ + setCollidesWith(categories: number | number[]): Phaser.GameObjects.GameObject; + + /** + * Applies a force to a body. + * @param force A Vector that specifies the force to apply. + */ + applyForce(force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + + /** + * Applies a force to a body from a given position. + * @param position The position in which the force comes from. + * @param force A Vector that specifies the force to apply. + */ + applyForceFrom(position: Phaser.Math.Vector2, force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the forward position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrust(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the left position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustLeft(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the right position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustRight(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the back position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustBack(speed: number): Phaser.GameObjects.GameObject; + + /** + * Sets new friction values for this Game Object's Matter Body. + * @param value The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. + * @param air If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. + * @param fstatic If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. + */ + setFriction(value: number, air?: number, fstatic?: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new air resistance for this Game Object's Matter Body. A value of 0 means the Body will never slow as it moves through space. The higher the value, the faster a Body slows when moving through space. + * @param value The new air resistance for the Body. + */ + setFrictionAir(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new static friction for this Game Object's Matter Body. A value of 0 means the Body will never "stick" when it is nearly stationary. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. + * @param value The new static friction for the Body. + */ + setFrictionStatic(value: number): Phaser.GameObjects.GameObject; + + /** + * A togglable function for ignoring world gravity in real-time on the current body. + * @param value Set to true to ignore the effect of world gravity, or false to not ignore it. + */ + setIgnoreGravity(value: boolean): Phaser.GameObjects.GameObject; + + /** + * Sets the mass of the Game Object's Matter Body. + * @param value The new mass of the body. + */ + setMass(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets density of the body. + * @param value The new density of the body. + */ + setDensity(value: number): Phaser.GameObjects.GameObject; + + /** + * The body's center of mass. + */ + readonly centerOfMass: Phaser.Math.Vector2; + + /** + * [description] + * @param value [description] + */ + setSensor(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isSensor(): boolean; + + /** + * Set the body on a Game Object to a rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param options [description] + */ + setRectangle(width: number, height: number, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param radius [description] + * @param options [description] + */ + setCircle(radius: number, options: object): Phaser.GameObjects.GameObject; + + /** + * Set the body on the Game Object to a polygon shape. + * @param radius The radius of the polygon. + * @param sides The amount of sides creating the polygon. + * @param options A matterjs config object. + */ + setPolygon(radius: number, sides: number, options: object): Phaser.GameObjects.GameObject; + + /** + * Creates a new matterjs trapezoid body. + * @param width The width of the trapezoid. + * @param height The height of the trapezoid. + * @param slope The angle of slope for the trapezoid. + * @param options A matterjs config object for the body. + */ + setTrapezoid(width: number, height: number, slope: number, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param body [description] + * @param addToWorld [description] Default true. + */ + setExistingBody(body: MatterJS.Body, addToWorld?: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param config [description] + * @param options [description] + */ + setBody(config: object, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] Default 60. + */ + setSleepThreshold(value?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param start [description] + * @param end [description] + */ + setSleepEvents(start: boolean, end: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepStartEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepEndEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setStatic(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isStatic(): boolean; + + /** + * [description] + */ + setFixedRotation(): this; + + /** + * [description] + * @param value [description] + */ + setAngularVelocity(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): Phaser.GameObjects.GameObject; + + /** + * Sets vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): Phaser.GameObjects.GameObject; + + /** + * Sets both the horizontal and vertical velocity of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the `x` value. Default x. + */ + setVelocity(x: number, y?: number): Phaser.GameObjects.GameObject; + + } + + /** + * [description] + */ + class MatterPhysics { + /** + * + * @param scene [description] + */ + constructor(scene: Phaser.Scene); + + /** + * [description] + */ + scene: Phaser.Scene; + + /** + * [description] + */ + systems: Phaser.Scenes.Systems; + + /** + * [description] + */ + config: object; + + /** + * [description] + */ + world: Phaser.Physics.Matter.World; + + /** + * [description] + */ + add: Phaser.Physics.Matter.Factory; + + /** + * A reference to the `Matter.Vertices` module which contains methods for creating and manipulating sets of vertices. + * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. + * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). + */ + verts: MatterJS.Vertices; + + /** + * A reference to the `Matter.Body` module which contains methods for creating and manipulating body models. + */ + body: MatterJS.Body; + + /** + * A reference to the `Matter.Bodies` module which contains methods for creating bodies. + */ + bodies: MatterJS.Bodies; + + /** + * [description] + */ + getConfig(): object; + + /** + * [description] + */ + enableAttractorPlugin(): Phaser.Physics.Matter.MatterPhysics; + + /** + * [description] + */ + enableWrapPlugin(): Phaser.Physics.Matter.MatterPhysics; + + /** + * [description] + */ + pause(): Phaser.Physics.Matter.World; + + /** + * [description] + */ + resume(): Phaser.Physics.Matter.World; + + /** + * Sets the Matter Engine to run at fixed timestep of 60Hz and enables `autoUpdate`. + * If you have set a custom `getDelta` function then this will override it. + */ + set60Hz(): Phaser.Physics.Matter.MatterPhysics; + + /** + * Sets the Matter Engine to run at fixed timestep of 30Hz and enables `autoUpdate`. + * If you have set a custom `getDelta` function then this will override it. + */ + set30Hz(): Phaser.Physics.Matter.MatterPhysics; + + /** + * Manually advances the physics simulation by one iteration. + * + * You can optionally pass in the `delta` and `correction` values to be used by Engine.update. + * If undefined they use the Matter defaults of 60Hz and no correction. + * + * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`. + * + * It also ignores any custom `getDelta` functions, as you should be passing the delta + * value in to this call. + * + * You can adjust the number of iterations that Engine.update performs internally. + * Use the Scene Matter Physics config object to set the following properties: + * + * positionIterations (defaults to 6) + * velocityIterations (defaults to 4) + * constraintIterations (defaults to 2) + * + * Adjusting these values can help performance in certain situations, depending on the physics requirements + * of your game. + * @param delta [description] Default 16.666. + * @param correction [description] Default 1. + */ + step(delta?: number, correction?: number): void; + + } + + /** + * A Matter Physics Sprite Game Object. + * + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + */ + class Sprite extends Phaser.GameObjects.Sprite implements Phaser.Physics.Matter.Components.Bounce, Phaser.Physics.Matter.Components.Collision, Phaser.Physics.Matter.Components.Force, Phaser.Physics.Matter.Components.Friction, Phaser.Physics.Matter.Components.Gravity, Phaser.Physics.Matter.Components.Mass, Phaser.Physics.Matter.Components.Sensor, Phaser.Physics.Matter.Components.SetBody, Phaser.Physics.Matter.Components.Sleep, Phaser.Physics.Matter.Components.Static, Phaser.Physics.Matter.Components.Transform, Phaser.Physics.Matter.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param world [description] + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param options Matter.js configuration object. Default {}. + */ + constructor(world: Phaser.Physics.Matter.World, x: number, y: number, texture: string, frame?: string | integer, options?: object); + + /** + * [description] + */ + world: Phaser.Physics.Matter.World; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param frame The frame to base the size of this Game Object on. + */ + setSizeToFrame(frame: Phaser.Textures.Frame): this; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The Texture this Game Object is using to render with. + */ + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + + /** + * The Texture Frame this Game Object is using to render with. + */ + frame: Phaser.Textures.Frame; + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + */ + isCropped: boolean; + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * @param x The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param y The y coordinate to start the crop from. + * @param width The width of the crop rectangle in pixels. + * @param height The height of the crop rectangle in pixels. + */ + setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + */ + setTexture(key: string, frame?: string | integer): this; + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * @param frame The name or index of the frame within the Texture. + * @param updateSize Should this call adjust the size of the Game Object? Default true. + * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. + */ + setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + + /** + * Fill or additive? + */ + tintFill: boolean; + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + */ + clearTint(): this; + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * @param topLeft The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * @param topLeft The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the Game Object. + * @param bottomLeft The tint being applied to the bottom-left of the Game Object. + * @param bottomRight The tint being applied to the bottom-right of the Game Object. + */ + setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopLeft: integer; + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintTopRight: integer; + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomLeft: integer; + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + tintBottomRight: integer; + + /** + * The tint value being applied to the whole of the Game Object. + */ + tint: integer; + + /** + * Does this Game Object have a tint applied to it or not? + */ + readonly isTinted: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * Sets the restitution on the physics object. + * @param value A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision categories are included in their collision masks (see {@link #setCollidesWith}). + * @param value Unique category bitfield. + */ + setCollisionCategory(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, they will never collide. + * @param value Unique group index. + */ + setCollisionGroup(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` are both true. + * @param categories A unique category bitfield, or an array of them. + */ + setCollidesWith(categories: number | number[]): Phaser.GameObjects.GameObject; + + /** + * Applies a force to a body. + * @param force A Vector that specifies the force to apply. + */ + applyForce(force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + + /** + * Applies a force to a body from a given position. + * @param position The position in which the force comes from. + * @param force A Vector that specifies the force to apply. + */ + applyForceFrom(position: Phaser.Math.Vector2, force: Phaser.Math.Vector2): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the forward position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrust(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the left position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustLeft(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the right position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustRight(speed: number): Phaser.GameObjects.GameObject; + + /** + * Apply thrust to the back position of the body. + * @param speed A speed value to be applied to a directional force. + */ + thrustBack(speed: number): Phaser.GameObjects.GameObject; + + /** + * Sets new friction values for this Game Object's Matter Body. + * @param value The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. + * @param air If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. + * @param fstatic If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. + */ + setFriction(value: number, air?: number, fstatic?: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new air resistance for this Game Object's Matter Body. A value of 0 means the Body will never slow as it moves through space. The higher the value, the faster a Body slows when moving through space. + * @param value The new air resistance for the Body. + */ + setFrictionAir(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new static friction for this Game Object's Matter Body. A value of 0 means the Body will never "stick" when it is nearly stationary. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. + * @param value The new static friction for the Body. + */ + setFrictionStatic(value: number): Phaser.GameObjects.GameObject; + + /** + * A togglable function for ignoring world gravity in real-time on the current body. + * @param value Set to true to ignore the effect of world gravity, or false to not ignore it. + */ + setIgnoreGravity(value: boolean): Phaser.GameObjects.GameObject; + + /** + * Sets the mass of the Game Object's Matter Body. + * @param value The new mass of the body. + */ + setMass(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets density of the body. + * @param value The new density of the body. + */ + setDensity(value: number): Phaser.GameObjects.GameObject; + + /** + * The body's center of mass. + */ + readonly centerOfMass: Phaser.Math.Vector2; + + /** + * [description] + * @param value [description] + */ + setSensor(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isSensor(): boolean; + + /** + * Set the body on a Game Object to a rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param options [description] + */ + setRectangle(width: number, height: number, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param radius [description] + * @param options [description] + */ + setCircle(radius: number, options: object): Phaser.GameObjects.GameObject; + + /** + * Set the body on the Game Object to a polygon shape. + * @param radius The radius of the polygon. + * @param sides The amount of sides creating the polygon. + * @param options A matterjs config object. + */ + setPolygon(radius: number, sides: number, options: object): Phaser.GameObjects.GameObject; + + /** + * Creates a new matterjs trapezoid body. + * @param width The width of the trapezoid. + * @param height The height of the trapezoid. + * @param slope The angle of slope for the trapezoid. + * @param options A matterjs config object for the body. + */ + setTrapezoid(width: number, height: number, slope: number, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param body [description] + * @param addToWorld [description] Default true. + */ + setExistingBody(body: MatterJS.Body, addToWorld?: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param config [description] + * @param options [description] + */ + setBody(config: object, options: object): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] Default 60. + */ + setSleepThreshold(value?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param start [description] + * @param end [description] + */ + setSleepEvents(start: boolean, end: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepStartEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepEndEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setStatic(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isStatic(): boolean; + + /** + * [description] + */ + setFixedRotation(): this; + + /** + * [description] + * @param value [description] + */ + setAngularVelocity(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the horizontal velocity of the physics body. + * @param x The horizontal velocity value. + */ + setVelocityX(x: number): Phaser.GameObjects.GameObject; + + /** + * Sets vertical velocity of the physics body. + * @param y The vertical velocity value. + */ + setVelocityY(y: number): Phaser.GameObjects.GameObject; + + /** + * Sets both the horizontal and vertical velocity of the physics body. + * @param x The horizontal velocity value. + * @param y The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the `x` value. Default x. + */ + setVelocity(x: number, y?: number): Phaser.GameObjects.GameObject; + + } + + /** + * A wrapper around a Tile that provides access to a corresponding Matter body. A tile can only + * have one Matter body associated with it. You can either pass in an existing Matter body for + * the tile or allow the constructor to create the corresponding body for you. If the Tile has a + * collision group (defined in Tiled), those shapes will be used to create the body. If not, the + * tile's rectangle bounding box will be used. + * + * The corresponding body will be accessible on the Tile itself via Tile.physics.matterBody. + * + * Note: not all Tiled collision shapes are supported. See + * Phaser.Physics.Matter.TileBody#setFromTileCollision for more information. + */ + class TileBody implements Phaser.Physics.Matter.Components.Bounce, Phaser.Physics.Matter.Components.Collision, Phaser.Physics.Matter.Components.Friction, Phaser.Physics.Matter.Components.Gravity, Phaser.Physics.Matter.Components.Mass, Phaser.Physics.Matter.Components.Sensor, Phaser.Physics.Matter.Components.Sleep, Phaser.Physics.Matter.Components.Static { + /** + * + * @param world [description] + * @param tile The target tile that should have a Matter body. + * @param options Options to be used when creating the Matter body. + */ + constructor(world: Phaser.Physics.Matter.World, tile: Phaser.Tilemaps.Tile, options?: Phaser.Types.Physics.Matter.MatterTileOptions); + + /** + * The tile object the body is associated with. + */ + tile: Phaser.Tilemaps.Tile; + + /** + * The Matter world the body exists within. + */ + world: Phaser.Physics.Matter.World; + + /** + * Sets the current body to a rectangle that matches the bounds of the tile. + * @param options Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. + */ + setFromTileRectangle(options?: Phaser.Types.Physics.Matter.MatterBodyTileOptions): Phaser.Physics.Matter.TileBody; + + /** + * Sets the current body from the collision group associated with the Tile. This is typically + * set up in Tiled's collision editor. + * + * Note: Matter doesn't support all shapes from Tiled. Rectangles and polygons are directly + * supported. Ellipses are converted into circle bodies. Polylines are treated as if they are + * closed polygons. If a tile has multiple shapes, a multi-part body will be created. Concave + * shapes are supported if poly-decomp library is included. Decomposition is not guaranteed to + * work for complex shapes (e.g. holes), so it's often best to manually decompose a concave + * polygon into multiple convex polygons yourself. + * @param options Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. + */ + setFromTileCollision(options?: Phaser.Types.Physics.Matter.MatterBodyTileOptions): Phaser.Physics.Matter.TileBody; + + /** + * Sets the current body to the given body. This will remove the previous body, if one already + * exists. + * @param body The new Matter body to use. + * @param addToWorld Whether or not to add the body to the Matter world. Default true. + */ + setBody(body: MatterJS.Body, addToWorld?: boolean): Phaser.Physics.Matter.TileBody; + + /** + * Removes the current body from the TileBody and from the Matter world + */ + removeBody(): Phaser.Physics.Matter.TileBody; + + /** + * Removes the current body from the tile and the world. + */ + destroy(): Phaser.Physics.Matter.TileBody; + + /** + * Sets the restitution on the physics object. + * @param value A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` + */ + setBounce(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision categories are included in their collision masks (see {@link #setCollidesWith}). + * @param value Unique category bitfield. + */ + setCollisionCategory(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, they will never collide. + * @param value Unique group index. + */ + setCollisionGroup(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` are both true. + * @param categories A unique category bitfield, or an array of them. + */ + setCollidesWith(categories: number | number[]): Phaser.GameObjects.GameObject; + + /** + * Sets new friction values for this Game Object's Matter Body. + * @param value The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. + * @param air If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. + * @param fstatic If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. + */ + setFriction(value: number, air?: number, fstatic?: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new air resistance for this Game Object's Matter Body. A value of 0 means the Body will never slow as it moves through space. The higher the value, the faster a Body slows when moving through space. + * @param value The new air resistance for the Body. + */ + setFrictionAir(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets a new static friction for this Game Object's Matter Body. A value of 0 means the Body will never "stick" when it is nearly stationary. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. + * @param value The new static friction for the Body. + */ + setFrictionStatic(value: number): Phaser.GameObjects.GameObject; + + /** + * A togglable function for ignoring world gravity in real-time on the current body. + * @param value Set to true to ignore the effect of world gravity, or false to not ignore it. + */ + setIgnoreGravity(value: boolean): Phaser.GameObjects.GameObject; + + /** + * Sets the mass of the Game Object's Matter Body. + * @param value The new mass of the body. + */ + setMass(value: number): Phaser.GameObjects.GameObject; + + /** + * Sets density of the body. + * @param value The new density of the body. + */ + setDensity(value: number): Phaser.GameObjects.GameObject; + + /** + * The body's center of mass. + */ + readonly centerOfMass: Phaser.Math.Vector2; + + /** + * [description] + * @param value [description] + */ + setSensor(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isSensor(): boolean; + + /** + * [description] + * @param value [description] Default 60. + */ + setSleepThreshold(value?: number): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param start [description] + * @param end [description] + */ + setSleepEvents(start: boolean, end: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepStartEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setSleepEndEvent(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + * @param value [description] + */ + setStatic(value: boolean): Phaser.GameObjects.GameObject; + + /** + * [description] + */ + isStatic(): boolean; + + } + + /** + * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file + * created and exported with PhysicsEditor (https://www.codeandweb.com/physicseditor). + */ + namespace PhysicsEditorParser { + /** + * Parses a body element exported by PhysicsEditor. + * @param x x position. + * @param y y position. + * @param w width. + * @param h height. + * @param config body configuration and fixture (child body) definitions. + */ + function parseBody(x: number, y: number, w: number, h: number, config: object): object; + + /** + * Parses an element of the "fixtures" list exported by PhysicsEditor + * @param fixtureConfig the fixture object to parse + */ + function parseFixture(fixtureConfig: object): object[]; + + /** + * Parses the "vertices" lists exported by PhysicsEditor. + * @param vertexSets The vertex lists to parse. + * @param options Matter body options. + */ + function parseVertices(vertexSets: object, options: object): object[]; + + } + + /** + * A Pointer Constraint is a special type of constraint that allows you to click + * and drag bodies in a Matter World. It monitors the active Pointers in a Scene, + * and when one is pressed down it checks to see if that hit any part of any active + * body in the world. If it did, and the body has input enabled, it will begin to + * drag it until either released, or you stop it via the `stopDrag` method. + * + * You can adjust the stiffness, length and other properties of the constraint via + * the `options` object on creation. + */ + class PointerConstraint { + /** + * + * @param scene A reference to the Scene to which this Pointer Constraint belongs. + * @param world A reference to the Matter World instance to which this Constraint belongs. + * @param options A Constraint configuration object. + */ + constructor(scene: Phaser.Scene, world: Phaser.Physics.Matter.World, options?: object); + + /** + * A reference to the Scene to which this Pointer Constraint belongs. + * This is the same Scene as the Matter World instance. + */ + scene: Phaser.Scene; + + /** + * A reference to the Matter World instance to which this Constraint belongs. + */ + world: Phaser.Physics.Matter.World; + + /** + * The Camera the Pointer was interacting with when the input + * down event was processed. + */ + camera: Phaser.Cameras.Scene2D.Camera; + + /** + * A reference to the Input Pointer that activated this Constraint. + * This is set in the `onDown` handler. + */ + pointer: Phaser.Input.Pointer; + + /** + * Is this Constraint active or not? + * + * An active constraint will be processed each update. An inactive one will be skipped. + * Use this to toggle a Pointer Constraint on and off. + */ + active: boolean; + + /** + * The internal transformed position. + */ + position: Phaser.Math.Vector2; + + /** + * The body that is currently being dragged, if any. + */ + body: MatterJS.Body; + + /** + * The part of the body that was clicked on to start the drag. + */ + part: MatterJS.Body; + + /** + * The native Matter Constraint that is used to attach to bodies. + */ + constraint: object; + + /** + * A Pointer has been pressed down onto the Scene. + * + * If this Constraint doesn't have an active Pointer then a hit test is + * run against all active bodies in the world. If one is found it is bound + * to this constraint and the drag begins. + * @param pointer A reference to the Pointer that was pressed. + */ + onDown(pointer: Phaser.Input.Pointer): void; + + /** + * Scans all active bodies in the current Matter World to see if any of them + * are hit by the Pointer. The _first one_ found to hit is set as the active contraint + * body. + */ + getBody(): boolean; + + /** + * Scans the current body to determine if a part of it was clicked on. + * If a part is found the body is set as the `constraint.bodyB` property, + * as well as the `body` property of this class. The part is also set. + * @param body The Matter Body to check. + * @param position A translated hit test position. + */ + hitTestBody(body: MatterJS.Body, position: Phaser.Math.Vector2): boolean; + + /** + * Internal update handler. Called in the Matter BEFORE_UPDATE step. + */ + update(): void; + + /** + * Stops the Pointer Constraint from dragging the body any further. + * + * This is called automatically if the Pointer is released while actively + * dragging a body. Or, you can call it manually to release a body from a + * constraint without having to first release the pointer. + */ + stopDrag(): void; + + /** + * Destroys this Pointer Constraint instance and all of its references. + */ + destroy(): void; + + } + + /** + * [description] + */ + class World extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene to which this Matter World instance belongs. + * @param config The Matter World configuration object. + */ + constructor(scene: Phaser.Scene, config: Phaser.Types.Physics.Matter.MatterWorldConfig); + + /** + * The Scene to which this Matter World instance belongs. + */ + scene: Phaser.Scene; + + /** + * An instance of the MatterJS Engine. + */ + engine: MatterJS.Engine; + + /** + * A `World` composite object that will contain all simulated bodies and constraints. + */ + localWorld: MatterJS.World; + + /** + * An object containing the 4 wall bodies that bound the physics world. + */ + walls: object; + + /** + * A flag that toggles if the world is enabled or not. + */ + enabled: boolean; + + /** + * The correction argument is an optional Number that specifies the time correction factor to apply to the update. + * This can help improve the accuracy of the simulation in cases where delta is changing between updates. + * The value of correction is defined as delta / lastDelta, i.e. the percentage change of delta over the last step. + * Therefore the value is always 1 (no correction) when delta constant (or when no correction is desired, which is the default). + * See the paper on Time Corrected Verlet for more information. + */ + correction: number; + + /** + * This function is called every time the core game loop steps, which is bound to the + * Request Animation Frame frequency unless otherwise modified. + * + * The function is passed two values: `time` and `delta`, both of which come from the game step values. + * + * It must return a number. This number is used as the delta value passed to Matter.Engine.update. + * + * You can override this function with your own to define your own timestep. + * + * If you need to update the Engine multiple times in a single game step then call + * `World.update` as many times as required. Each call will trigger the `getDelta` function. + * If you wish to have full control over when the Engine updates then see the property `autoUpdate`. + * + * You can also adjust the number of iterations that Engine.update performs. + * Use the Scene Matter Physics config object to set the following properties: + * + * positionIterations (defaults to 6) + * velocityIterations (defaults to 4) + * constraintIterations (defaults to 2) + * + * Adjusting these values can help performance in certain situations, depending on the physics requirements + * of your game. + */ + getDelta: Function; + + /** + * Automatically call Engine.update every time the game steps. + * If you disable this then you are responsible for calling `World.step` directly from your game. + * If you call `set60Hz` or `set30Hz` then `autoUpdate` is reset to `true`. + */ + autoUpdate: boolean; + + /** + * A flag that controls if the debug graphics will be drawn to or not. + */ + drawDebug: boolean; + + /** + * An instance of the Graphics object the debug bodies are drawn to, if enabled. + */ + debugGraphic: Phaser.GameObjects.Graphics; + + /** + * The default configuration values. + */ + defaults: object; + + /** + * [description] + */ + setEventsProxy(): void; + + /** + * Sets the bounds of the Physics world to match the given world pixel dimensions. + * You can optionally set which 'walls' to create: left, right, top or bottom. + * If none of the walls are given it will default to use the walls settings it had previously. + * I.e. if you previously told it to not have the left or right walls, and you then adjust the world size + * the newly created bounds will also not have the left and right walls. + * Explicitly state them in the parameters to override this. + * @param x The x coordinate of the top-left corner of the bounds. Default 0. + * @param y The y coordinate of the top-left corner of the bounds. Default 0. + * @param width The width of the bounds. + * @param height The height of the bounds. + * @param thickness The thickness of each wall, in pixels. Default 128. + * @param left If true will create the left bounds wall. Default true. + * @param right If true will create the right bounds wall. Default true. + * @param top If true will create the top bounds wall. Default true. + * @param bottom If true will create the bottom bounds wall. Default true. + */ + setBounds(x?: number, y?: number, width?: number, height?: number, thickness?: number, left?: boolean, right?: boolean, top?: boolean, bottom?: boolean): Phaser.Physics.Matter.World; + + /** + * [description] + * @param add [description] + * @param position [description] + * @param x [description] + * @param y [description] + * @param width [description] + * @param height [description] + */ + updateWall(add: boolean, position: string, x: number, y: number, width: number, height: number): void; + + /** + * [description] + */ + createDebugGraphic(): Phaser.GameObjects.Graphics; + + /** + * Sets the world's gravity and gravity scale to 0. + */ + disableGravity(): Phaser.Physics.Matter.World; + + /** + * Sets the world's gravity + * @param x The world gravity x component. Default 0. + * @param y The world gravity y component. Default 1. + * @param scale [description] + */ + setGravity(x?: number, y?: number, scale?: number): Phaser.Physics.Matter.World; + + /** + * Creates a rectangle Matter body and adds it to the world. + * @param x The horizontal position of the body in the world. + * @param y The vertical position of the body in the world. + * @param width The width of the body. + * @param height The height of the body. + * @param options Optional Matter configuration object. + */ + create(x: number, y: number, width: number, height: number, options: object): MatterJS.Body; + + /** + * Adds an object to the world. + * @param object Can be single or an array, and can be a body, composite or constraint + */ + add(object: object | object[]): Phaser.Physics.Matter.World; + + /** + * [description] + * @param object The object to be removed from the world. + * @param deep [description] + */ + remove(object: object, deep: boolean): Phaser.Physics.Matter.World; + + /** + * [description] + * @param constraint [description] + * @param deep [description] + */ + removeConstraint(constraint: MatterJS.Constraint, deep: boolean): Phaser.Physics.Matter.World; + + /** + * Adds MatterTileBody instances for all the colliding tiles within the given tilemap layer. Set + * the appropriate tiles in your layer to collide before calling this method! + * @param tilemapLayer An array of tiles. + * @param options Options to be passed to the MatterTileBody constructor. {@ee Phaser.Physics.Matter.TileBody} + */ + convertTilemapLayer(tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, options?: object): Phaser.Physics.Matter.World; + + /** + * Adds MatterTileBody instances for the given tiles. This adds bodies regardless of whether the + * tiles are set to collide or not. + * @param tiles An array of tiles. + * @param options Options to be passed to the MatterTileBody constructor. {@see Phaser.Physics.Matter.TileBody} + */ + convertTiles(tiles: Phaser.Tilemaps.Tile[], options?: object): Phaser.Physics.Matter.World; + + /** + * [description] + * @param isNonColliding [description] + */ + nextGroup(isNonColliding: boolean): number; + + /** + * [description] + */ + nextCategory(): number; + + /** + * [description] + */ + pause(): Phaser.Physics.Matter.World; + + /** + * [description] + */ + resume(): Phaser.Physics.Matter.World; + + /** + * [description] + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(time: number, delta: number): void; + + /** + * Manually advances the physics simulation by one iteration. + * + * You can optionally pass in the `delta` and `correction` values to be used by Engine.update. + * If undefined they use the Matter defaults of 60Hz and no correction. + * + * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`. + * + * It also ignores any custom `getDelta` functions, as you should be passing the delta + * value in to this call. + * + * You can adjust the number of iterations that Engine.update performs internally. + * Use the Scene Matter Physics config object to set the following properties: + * + * positionIterations (defaults to 6) + * velocityIterations (defaults to 4) + * constraintIterations (defaults to 2) + * + * Adjusting these values can help performance in certain situations, depending on the physics requirements + * of your game. + * @param delta [description] Default 16.666. + * @param correction [description] Default 1. + */ + step(delta?: number, correction?: number): void; + + /** + * Runs the Matter Engine.update at a fixed timestep of 60Hz. + */ + update60Hz(): number; + + /** + * Runs the Matter Engine.update at a fixed timestep of 30Hz. + */ + update30Hz(): number; + + /** + * [description] + * @param path [description] + * @param points [description] + */ + fromPath(path: string, points: any[]): any[]; + + /** + * Resets the internal collision IDs that Matter.JS uses for Body collision groups. + * + * You should call this before destroying your game if you need to restart the game + * again on the same page, without first reloading the page. Or, if you wish to + * consistently destroy a Scene that contains Matter.js and then run it again + * later in the same game. + */ + resetCollisionIDs(): void; + + /** + * Will remove all Matter physics event listeners and clear the matter physics world, + * engine and any debug graphics, if any. + */ + shutdown(): void; + + /** + * Will remove all Matter physics event listeners and clear the matter physics world, + * engine and any debug graphics, if any. + * + * After destroying the world it cannot be re-used again. + */ + destroy(): void; + + } + + } + + } + + namespace Plugins { + /** + * A Global Plugin is installed just once into the Game owned Plugin Manager. + * It can listen for Game events and respond to them. + */ + class BasePlugin { + /** + * + * @param pluginManager A reference to the Plugin Manager. + */ + constructor(pluginManager: Phaser.Plugins.PluginManager); + + /** + * A handy reference to the Plugin Manager that is responsible for this plugin. + * Can be used as a route to gain access to game systems and events. + */ + protected pluginManager: Phaser.Plugins.PluginManager; + + /** + * A reference to the Game instance this plugin is running under. + */ + protected game: Phaser.Game; + + /** + * A reference to the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You cannot use it during the `init` method, but you can during the `boot` method. + */ + protected scene: Phaser.Scene; + + /** + * A reference to the Scene Systems of the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You cannot use it during the `init` method, but you can during the `boot` method. + */ + protected systems: Phaser.Scenes.Systems; + + /** + * Called by the PluginManager when this plugin is first instantiated. + * It will never be called again on this instance. + * In here you can set-up whatever you need for this plugin to run. + * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this. + * @param data A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually). + */ + init(data?: any): void; + + /** + * Called by the PluginManager when this plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + */ + start(): void; + + /** + * Called by the PluginManager when this plugin is stopped. + * The game code has requested that your plugin stop doing whatever it does. + * It is now considered as 'inactive' by the PluginManager. + * Handle that process here (i.e. stop listening for events, etc) + * If the plugin is started again then `BasePlugin.start` will be called again. + */ + stop(): void; + + /** + * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. + * By this point the plugin properties `scene` and `systems` will have already been set. + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + */ + boot(): void; + + /** + * Game instance has been destroyed. + * You must release everything in here, all references, all objects, free it all up. + */ + destroy(): void; + + } + + type DefaultPlugins = { + /** + * These are the Global Managers that are created by the Phaser.Game instance. + */ + Global: any[]; + /** + * These are the core plugins that are installed into every Scene.Systems instance, no matter what. + */ + CoreScene: any[]; + /** + * These plugins are created in Scene.Systems in addition to the CoreScenePlugins. + */ + DefaultScene: any[]; + }; + + /** + * These are the Global Managers that are created by the Phaser.Game instance. + * They are referenced from Scene.Systems so that plugins can use them. + */ + var Global: any[]; + + /** + * These are the core plugins that are installed into every Scene.Systems instance, no matter what. + * They are optionally exposed in the Scene as well (see the InjectionMap for details) + * + * They are created in the order in which they appear in this array and EventEmitter is always first. + */ + var CoreScene: any[]; + + /** + * These plugins are created in Scene.Systems in addition to the CoreScenePlugins. + * + * You can elect not to have these plugins by either creating a DefaultPlugins object as part + * of the Game Config, by creating a Plugins object as part of a Scene Config, or by modifying this array + * and building your own bundle. + * + * They are optionally exposed in the Scene as well (see the InjectionMap for details) + * + * They are always created in the order in which they appear in the array. + */ + var DefaultScene: any[]; + + namespace PluginCache { + /** + * Static method called directly by the Core internal Plugins. + * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) + * Plugin is the object to instantiate to create the plugin + * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) + * @param key A reference used to get this plugin from the plugin cache. + * @param plugin The plugin to be stored. Should be the core object, not instantiated. + * @param mapping If this plugin is to be injected into the Scene Systems, this is the property key map used. + * @param custom Core Scene plugin or a Custom Scene plugin? Default false. + */ + function register(key: string, plugin: Function, mapping: string, custom?: boolean): void; + + /** + * Stores a custom plugin in the global plugin cache. + * The key must be unique, within the scope of the cache. + * @param key A reference used to get this plugin from the plugin cache. + * @param plugin The plugin to be stored. Should be the core object, not instantiated. + * @param mapping If this plugin is to be injected into the Scene Systems, this is the property key map used. + * @param data A value to be passed to the plugin's `init` method. + */ + function registerCustom(key: string, plugin: Function, mapping: string, data: any): void; + + /** + * Checks if the given key is already being used in the core plugin cache. + * @param key The key to check for. + */ + function hasCore(key: string): boolean; + + /** + * Checks if the given key is already being used in the custom plugin cache. + * @param key The key to check for. + */ + function hasCustom(key: string): boolean; + + /** + * Returns the core plugin object from the cache based on the given key. + * @param key The key of the core plugin to get. + */ + function getCore(key: string): Phaser.Types.Plugins.CorePluginContainer; + + /** + * Returns the custom plugin object from the cache based on the given key. + * @param key The key of the custom plugin to get. + */ + function getCustom(key: string): Phaser.Types.Plugins.CustomPluginContainer; + + /** + * Returns an object from the custom cache based on the given key that can be instantiated. + * @param key The key of the custom plugin to get. + */ + function getCustomClass(key: string): Function; + + /** + * Removes a core plugin based on the given key. + * @param key The key of the core plugin to remove. + */ + function remove(key: string): void; + + /** + * Removes a custom plugin based on the given key. + * @param key The key of the custom plugin to remove. + */ + function removeCustom(key: string): void; + + /** + * Removes all Core Plugins. + * + * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. + * So be sure you only call this if you do not wish to run Phaser again. + */ + function destroyCorePlugins(): void; + + /** + * Removes all Custom Plugins. + */ + function destroyCustomPlugins(): void; + + } + + /** + * The PluginManager is responsible for installing and adding plugins to Phaser. + * + * It is a global system and therefore belongs to the Game instance, not a specific Scene. + * + * It works in conjunction with the PluginCache. Core internal plugins automatically register themselves + * with the Cache, but it's the Plugin Manager that is responsible for injecting them into the Scenes. + * + * There are two types of plugin: + * + * 1. A Global Plugin + * 2. A Scene Plugin + * + * A Global Plugin is a plugin that lives within the Plugin Manager rather than a Scene. You can get + * access to it by calling `PluginManager.get` and providing a key. Any Scene that requests a plugin in + * this way will all get access to the same plugin instance, allowing you to use a single plugin across + * multiple Scenes. + * + * A Scene Plugin is a plugin dedicated to running within a Scene. These are different to Global Plugins + * in that their instances do not live within the Plugin Manager, but within the Scene Systems class instead. + * And that every Scene created is given its own unique instance of a Scene Plugin. Examples of core Scene + * Plugins include the Input Plugin, the Tween Plugin and the physics Plugins. + * + * You can add a plugin to Phaser in three different ways: + * + * 1. Preload it + * 2. Include it in your source code and install it via the Game Config + * 3. Include it in your source code and install it within a Scene + * + * For examples of all of these approaches please see the Phaser 3 Examples Repo `plugins` folder. + * + * For information on creating your own plugin please see the Phaser 3 Plugin Template. + */ + class PluginManager { + /** + * + * @param game The game instance that owns this Plugin Manager. + */ + constructor(game: Phaser.Game); + + /** + * The game instance that owns this Plugin Manager. + */ + game: Phaser.Game; + + /** + * The global plugins currently running and managed by this Plugin Manager. + * A plugin must have been started at least once in order to appear in this list. + */ + plugins: Phaser.Types.Plugins.GlobalPlugin[]; + + /** + * A list of plugin keys that should be installed into Scenes as well as the Core Plugins. + */ + scenePlugins: string[]; + + /** + * Run once the game has booted and installs all of the plugins configured in the Game Config. + */ + protected boot(): void; + + /** + * Called by the Scene Systems class. Tells the plugin manager to install all Scene plugins into it. + * + * First it will install global references, i.e. references from the Game systems into the Scene Systems (and Scene if mapped.) + * Then it will install Core Scene Plugins followed by Scene Plugins registered with the PluginManager. + * Finally it will install any references to Global Plugins that have a Scene mapping property into the Scene itself. + * @param sys The Scene Systems class to install all the plugins in to. + * @param globalPlugins An array of global plugins to install. + * @param scenePlugins An array of scene plugins to install. + */ + protected addToScene(sys: Phaser.Scenes.Systems, globalPlugins: any[], scenePlugins: any[]): void; + + /** + * Called by the Scene Systems class. Returns a list of plugins to be installed. + */ + protected getDefaultScenePlugins(): string[]; + + /** + * Installs a new Scene Plugin into the Plugin Manager and optionally adds it + * to the given Scene as well. A Scene Plugin added to the manager in this way + * will be automatically installed into all new Scenes using the key and mapping given. + * + * The `key` property is what the plugin is injected into Scene.Systems as. + * The `mapping` property is optional, and if specified is what the plugin is installed into + * the Scene as. For example: + * + * ```javascript + * this.plugins.installScenePlugin('powerupsPlugin', pluginCode, 'powerups'); + * + * // and from within the scene: + * this.sys.powerupsPlugin; // key value + * this.powerups; // mapping value + * ``` + * + * This method is called automatically by Phaser if you install your plugins using either the + * Game Configuration object, or by preloading them via the Loader. + * @param key The property key that will be used to add this plugin to Scene.Systems. + * @param plugin The plugin code. This should be the non-instantiated version. + * @param mapping If this plugin is injected into the Phaser.Scene class, this is the property key to use. + * @param addToScene Optionally automatically add this plugin to the given Scene. + * @param fromLoader Is this being called by the Loader? Default false. + */ + installScenePlugin(key: string, plugin: Function, mapping?: string, addToScene?: Phaser.Scene, fromLoader?: boolean): void; + + /** + * Installs a new Global Plugin into the Plugin Manager and optionally starts it running. + * A global plugin belongs to the Plugin Manager, rather than a specific Scene, and can be accessed + * and used by all Scenes in your game. + * + * The `key` property is what you use to access this plugin from the Plugin Manager. + * + * ```javascript + * this.plugins.install('powerupsPlugin', pluginCode); + * + * // and from within the scene: + * this.plugins.get('powerupsPlugin'); + * ``` + * + * This method is called automatically by Phaser if you install your plugins using either the + * Game Configuration object, or by preloading them via the Loader. + * + * The same plugin can be installed multiple times into the Plugin Manager by simply giving each + * instance its own unique key. + * @param key The unique handle given to this plugin within the Plugin Manager. + * @param plugin The plugin code. This should be the non-instantiated version. + * @param start Automatically start the plugin running? This is always `true` if you provide a mapping value. Default false. + * @param mapping If this plugin is injected into the Phaser.Scene class, this is the property key to use. + * @param data A value passed to the plugin's `init` method. + */ + install(key: string, plugin: Function, start?: boolean, mapping?: string, data?: any): Phaser.Plugins.BasePlugin; + + /** + * Gets an index of a global plugin based on the given key. + * @param key The unique plugin key. + */ + protected getIndex(key: string): integer; + + /** + * Gets a global plugin based on the given key. + * @param key The unique plugin key. + */ + protected getEntry(key: string): Phaser.Types.Plugins.GlobalPlugin; + + /** + * Checks if the given global plugin, based on its key, is active or not. + * @param key The unique plugin key. + */ + isActive(key: string): boolean; + + /** + * Starts a global plugin running. + * + * If the plugin was previously active then calling `start` will reset it to an active state and then + * call its `start` method. + * + * If the plugin has never been run before a new instance of it will be created within the Plugin Manager, + * its active state set and then both of its `init` and `start` methods called, in that order. + * + * If the plugin is already running under the given key then nothing happens. + * @param key The key of the plugin to start. + * @param runAs Run the plugin under a new key. This allows you to run one plugin multiple times. + */ + start(key: string, runAs?: string): Phaser.Plugins.BasePlugin; + + /** + * Stops a global plugin from running. + * + * If the plugin is active then its active state will be set to false and the plugins `stop` method + * will be called. + * + * If the plugin is not already running, nothing will happen. + * @param key The key of the plugin to stop. + */ + stop(key: string): Phaser.Plugins.PluginManager; + + /** + * Gets a global plugin from the Plugin Manager based on the given key and returns it. + * + * If it cannot find an active plugin based on the key, but there is one in the Plugin Cache with the same key, + * then it will create a new instance of the cached plugin and return that. + * @param key The key of the plugin to get. + * @param autoStart Automatically start a new instance of the plugin if found in the cache, but not actively running. Default true. + */ + get(key: string, autoStart?: boolean): Phaser.Plugins.BasePlugin | Function; + + /** + * Returns the plugin class from the cache. + * Used internally by the Plugin Manager. + * @param key The key of the plugin to get. + */ + getClass(key: string): Phaser.Plugins.BasePlugin; + + /** + * Removes a global plugin from the Plugin Manager and Plugin Cache. + * + * It is up to you to remove all references to this plugin that you may hold within your game code. + * @param key The key of the plugin to remove. + */ + removeGlobalPlugin(key: string): void; + + /** + * Removes a scene plugin from the Plugin Manager and Plugin Cache. + * + * This will not remove the plugin from any active Scenes that are already using it. + * + * It is up to you to remove all references to this plugin that you may hold within your game code. + * @param key The key of the plugin to remove. + */ + removeScenePlugin(key: string): void; + + /** + * Registers a new type of Game Object with the global Game Object Factory and / or Creator. + * This is usually called from within your Plugin code and is a helpful short-cut for creating + * new Game Objects. + * + * The key is the property that will be injected into the factories and used to create the + * Game Object. For example: + * + * ```javascript + * this.plugins.registerGameObject('clown', clownFactoryCallback, clownCreatorCallback); + * // later in your game code: + * this.add.clown(); + * this.make.clown(); + * ``` + * + * The callbacks are what are called when the factories try to create a Game Object + * matching the given key. It's important to understand that the callbacks are invoked within + * the context of the GameObjectFactory. In this context there are several properties available + * to use: + * + * this.scene - A reference to the Scene that owns the GameObjectFactory. + * this.displayList - A reference to the Display List the Scene owns. + * this.updateList - A reference to the Update List the Scene owns. + * + * See the GameObjectFactory and GameObjectCreator classes for more details. + * Any public property or method listed is available from your callbacks under `this`. + * @param key The key of the Game Object that the given callbacks will create, i.e. `image`, `sprite`. + * @param factoryCallback The callback to invoke when the Game Object Factory is called. + * @param creatorCallback The callback to invoke when the Game Object Creator is called. + */ + registerGameObject(key: string, factoryCallback?: Function, creatorCallback?: Function): void; + + /** + * Registers a new file type with the global File Types Manager, making it available to all Loader + * Plugins created after this. + * + * This is usually called from within your Plugin code and is a helpful short-cut for creating + * new loader file types. + * + * The key is the property that will be injected into the Loader Plugin and used to load the + * files. For example: + * + * ```javascript + * this.plugins.registerFileType('wad', doomWadLoaderCallback); + * // later in your preload code: + * this.load.wad(); + * ``` + * + * The callback is what is called when the loader tries to load a file matching the given key. + * It's important to understand that the callback is invoked within + * the context of the LoaderPlugin. In this context there are several properties / methods available + * to use: + * + * this.addFile - A method to add the new file to the load queue. + * this.scene - The Scene that owns the Loader Plugin instance. + * + * See the LoaderPlugin class for more details. Any public property or method listed is available from + * your callback under `this`. + * @param key The key of the Game Object that the given callbacks will create, i.e. `image`, `sprite`. + * @param callback The callback to invoke when the Game Object Factory is called. + * @param addToScene Optionally add this file type into the Loader Plugin owned by the given Scene. + */ + registerFileType(key: string, callback: Function, addToScene?: Phaser.Scene): void; + + /** + * Destroys this Plugin Manager and all associated plugins. + * It will iterate all plugins found and call their `destroy` methods. + * + * The PluginCache will remove all custom plugins. + */ + destroy(): void; + + } + + /** + * A Scene Level Plugin is installed into every Scene and belongs to that Scene. + * It can listen for Scene events and respond to them. + * It can map itself to a Scene property, or into the Scene Systems, or both. + */ + class ScenePlugin extends Phaser.Plugins.BasePlugin { + /** + * + * @param scene A reference to the Scene that has installed this plugin. + * @param pluginManager A reference to the Plugin Manager. + */ + constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager); + + /** + * This method is called when the Scene boots. It is only ever called once. + * + * By this point the plugin properties `scene` and `systems` will have already been set. + * + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + * Here are the Scene events you can listen to: + * + * start + * ready + * preupdate + * update + * postupdate + * resize + * pause + * resume + * sleep + * wake + * transitioninit + * transitionstart + * transitioncomplete + * transitionout + * shutdown + * destroy + * + * At the very least you should offer a destroy handler for when the Scene closes down, i.e: + * + * ```javascript + * var eventEmitter = this.systems.events; + * eventEmitter.once('destroy', this.sceneDestroy, this); + * ``` + */ + boot(): void; + + } + + } + + /** + * Phaser Blend Modes. + */ + enum BlendModes { + /** + * Skips the Blend Mode check in the renderer. + */ + SKIP_CHECK, + /** + * Normal blend mode. For Canvas and WebGL. + * This is the default setting and draws new shapes on top of the existing canvas content. + */ + NORMAL, + /** + * Add blend mode. For Canvas and WebGL. + * Where both shapes overlap the color is determined by adding color values. + */ + ADD, + /** + * Multiply blend mode. For Canvas and WebGL. + * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. + */ + MULTIPLY, + /** + * Screen blend mode. For Canvas and WebGL. + * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) + */ + SCREEN, + /** + * Overlay blend mode. For Canvas only. + * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. + */ + OVERLAY, + /** + * Darken blend mode. For Canvas only. + * Retains the darkest pixels of both layers. + */ + DARKEN, + /** + * Lighten blend mode. For Canvas only. + * Retains the lightest pixels of both layers. + */ + LIGHTEN, + /** + * Color Dodge blend mode. For Canvas only. + * Divides the bottom layer by the inverted top layer. + */ + COLOR_DODGE, + /** + * Color Burn blend mode. For Canvas only. + * Divides the inverted bottom layer by the top layer, and then inverts the result. + */ + COLOR_BURN, + /** + * Hard Light blend mode. For Canvas only. + * A combination of multiply and screen like overlay, but with top and bottom layer swapped. + */ + HARD_LIGHT, + /** + * Soft Light blend mode. For Canvas only. + * A softer version of hard-light. Pure black or white does not result in pure black or white. + */ + SOFT_LIGHT, + /** + * Difference blend mode. For Canvas only. + * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. + */ + DIFFERENCE, + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + */ + EXCLUSION, + /** + * Hue blend mode. For Canvas only. + * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. + */ + HUE, + /** + * Saturation blend mode. For Canvas only. + * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. + */ + SATURATION, + /** + * Color blend mode. For Canvas only. + * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. + */ + COLOR, + /** + * Luminosity blend mode. For Canvas only. + * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. + */ + LUMINOSITY, + /** + * Alpha erase blend mode. For Canvas and WebGL. + */ + ERASE, + /** + * Source-in blend mode. For Canvas only. + * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. + */ + SOURCE_IN, + /** + * Source-out blend mode. For Canvas only. + * The new shape is drawn where it doesn't overlap the existing canvas content. + */ + SOURCE_OUT, + /** + * Source-out blend mode. For Canvas only. + * The new shape is only drawn where it overlaps the existing canvas content. + */ + SOURCE_ATOP, + /** + * Destination-over blend mode. For Canvas only. + * New shapes are drawn behind the existing canvas content. + */ + DESTINATION_OVER, + /** + * Destination-in blend mode. For Canvas only. + * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. + */ + DESTINATION_IN, + /** + * Destination-out blend mode. For Canvas only. + * The existing content is kept where it doesn't overlap the new shape. + */ + DESTINATION_OUT, + /** + * Destination-out blend mode. For Canvas only. + * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. + */ + DESTINATION_ATOP, + /** + * Lighten blend mode. For Canvas only. + * Where both shapes overlap the color is determined by adding color values. + */ + LIGHTER, + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + */ + COPY, + /** + * Xor blend mode. For Canvas only. + * Shapes are made transparent where both overlap and drawn normal everywhere else. + */ + XOR, + } + + namespace Renderer { + namespace Canvas { + /** + * The Canvas Renderer is responsible for managing 2D canvas rendering contexts, including the one used by the Game's canvas. It tracks the internal state of a given context and can renderer textured Game Objects to it, taking into account alpha, blending, and scaling. + */ + class CanvasRenderer { + /** + * + * @param game The Phaser Game instance that owns this renderer. + */ + constructor(game: Phaser.Game); + + /** + * The Phaser Game instance that owns this renderer. + */ + game: Phaser.Game; + + /** + * A constant which allows the renderer to be easily identified as a Canvas Renderer. + */ + type: integer; + + /** + * The total number of Game Objects which were rendered in a frame. + */ + drawCount: number; + + /** + * The width of the canvas being rendered to. + */ + width: integer; + + /** + * The height of the canvas being rendered to. + */ + height: integer; + + /** + * The local configuration settings of the CanvasRenderer. + */ + config: object; + + /** + * The scale mode which should be used by the CanvasRenderer. + */ + scaleMode: integer; + + /** + * The canvas element which the Game uses. + */ + gameCanvas: HTMLCanvasElement; + + /** + * The canvas context used to render all Cameras in all Scenes during the game loop. + */ + gameContext: CanvasRenderingContext2D; + + /** + * The canvas context currently used by the CanvasRenderer for all rendering operations. + */ + currentContext: CanvasRenderingContext2D; + + /** + * The blend modes supported by the Canvas Renderer. + * + * This object maps the {@link Phaser.BlendModes} to canvas compositing operations. + */ + blendModes: any[]; + + /** + * The scale mode currently in use by the Canvas Renderer. + */ + currentScaleMode: number; + + /** + * Details about the currently scheduled snapshot. + * + * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. + */ + snapshotState: Phaser.Types.Renderer.Snapshot.SnapshotState; + + /** + * Prepares the game canvas for rendering. + */ + init(): void; + + /** + * The event handler that manages the `resize` event dispatched by the Scale Manager. + * @param gameSize The default Game Size object. This is the un-modified game dimensions. + * @param baseSize The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + * @param displaySize The display Size object. The size of the canvas style width / height attributes. + * @param resolution The Scale Manager resolution setting. + */ + onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size, displaySize: Phaser.Structs.Size, resolution?: number): void; + + /** + * Resize the main game canvas. + * @param width The new width of the renderer. + * @param height The new height of the renderer. + */ + resize(width?: number, height?: number): void; + + /** + * A NOOP method for handling lost context. Intentionally empty. + * @param callback Ignored parameter. + */ + onContextLost(callback: Function): void; + + /** + * A NOOP method for handling restored context. Intentionally empty. + * @param callback Ignored parameter. + */ + onContextRestored(callback: Function): void; + + /** + * Resets the transformation matrix of the current context to the identity matrix, thus resetting any transformation. + */ + resetTransform(): void; + + /** + * Sets the blend mode (compositing operation) of the current context. + * @param blendMode The new blend mode which should be used. + */ + setBlendMode(blendMode: string): this; + + /** + * Changes the Canvas Rendering Context that all draw operations are performed against. + * @param ctx The new Canvas Rendering Context to draw everything to. Leave empty to reset to the Game Canvas. + */ + setContext(ctx?: CanvasRenderingContext2D): this; + + /** + * Sets the global alpha of the current context. + * @param alpha The new alpha to use, where 0 is fully transparent and 1 is fully opaque. + */ + setAlpha(alpha: number): this; + + /** + * Called at the start of the render loop. + */ + preRender(): void; + + /** + * Renders the Scene to the given Camera. + * @param scene The Scene to render. + * @param children The Game Objects within the Scene to be rendered. + * @param interpolationPercentage The interpolation percentage to apply. Currently unused. + * @param camera The Scene Camera to render with. + */ + render(scene: Phaser.Scene, children: Phaser.GameObjects.DisplayList, interpolationPercentage: number, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Restores the game context's global settings and takes a snapshot if one is scheduled. + * + * The post-render step happens after all Cameras in all Scenes have been rendered. + */ + postRender(): void; + + /** + * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. + * + * To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets + * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param callback The Function to invoke after the snapshot image is created. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshot(callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + + /** + * Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets + * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param x The x coordinate to grab from. + * @param y The y coordinate to grab from. + * @param width The width of the area to grab. + * @param height The height of the area to grab. + * @param callback The Function to invoke after the snapshot image is created. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshotArea(x: integer, y: integer, width: integer, height: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + + /** + * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then + * calling this method will override it. + * + * Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for + * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, + * using less memory. + * @param x The x coordinate of the pixel to get. + * @param y The y coordinate of the pixel to get. + * @param callback The Function to invoke after the snapshot pixel data is extracted. + */ + snapshotPixel(x: integer, y: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; + + /** + * Takes a Sprite Game Object, or any object that extends it, and draws it to the current context. + * @param sprite The texture based Game Object to draw. + * @param frame The frame to draw, doesn't have to be that owned by the Game Object. + * @param camera The Camera to use for the rendering transform. + * @param parentTransformMatrix The transform matrix of the parent container, if set. + */ + batchSprite(sprite: Phaser.GameObjects.GameObject, frame: Phaser.Textures.Frame, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Destroys all object references in the Canvas Renderer. + */ + destroy(): void; + + } + + /** + * Returns an array which maps the default blend modes to supported Canvas blend modes. + * + * If the browser doesn't support a blend mode, it will default to the normal `source-over` blend mode. + */ + function GetBlendModes(): any[]; + + /** + * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix + * and then performs the following steps: + * + * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. + * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. + * 3. Sets the blend mode of the context to be that used by the Game Object. + * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. + * 5. Saves the context state. + * 6. Sets the final matrix values into the context via setTransform. + * + * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. + * @param renderer A reference to the current active Canvas renderer. + * @param ctx The canvas context to set the transform on. + * @param src The Game Object being rendered. Can be any type that extends the base class. + * @param camera The Camera that is rendering the Game Object. + * @param parentMatrix A parent transform matrix to apply to the Game Object before rendering. + */ + function SetTransform(renderer: Phaser.Renderer.Canvas.CanvasRenderer, ctx: CanvasRenderingContext2D, src: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): boolean; + + } + + namespace Snapshot { + /** + * Takes a snapshot of an area from the current frame displayed by a canvas. + * + * This is then copied to an Image object. When this loads, the results are sent + * to the callback provided in the Snapshot Configuration object. + * @param sourceCanvas The canvas to take a snapshot of. + * @param config The snapshot configuration object. + */ + function Canvas(sourceCanvas: HTMLCanvasElement, config: Phaser.Types.Renderer.Snapshot.SnapshotState): void; + + /** + * Takes a snapshot of an area from the current frame displayed by a WebGL canvas. + * + * This is then copied to an Image object. When this loads, the results are sent + * to the callback provided in the Snapshot Configuration object. + * @param sourceCanvas The canvas to take a snapshot of. + * @param config The snapshot configuration object. + */ + function WebGL(sourceCanvas: HTMLCanvasElement, config: Phaser.Types.Renderer.Snapshot.SnapshotState): void; + + } + + namespace WebGL { + namespace Pipelines { + /** + * BitmapMaskPipeline handles all bitmap masking rendering in WebGL. It works by using + * sampling two texture on the fragment shader and using the fragment's alpha to clip the region. + * The config properties are: + * - game: Current game instance. + * - renderer: Current WebGL renderer. + * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. + * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). + * - vertShader: Source for vertex shader as a string. + * - fragShader: Source for fragment shader as a string. + * - vertexCapacity: The amount of vertices that shall be allocated + * - vertexSize: The size of a single vertex in bytes. + */ + class BitmapMaskPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config Used for overriding shader an pipeline properties if extending this pipeline. + */ + constructor(config: object); + + /** + * Float32 view of the array buffer containing the pipeline's vertices. + */ + vertexViewF32: Float32Array; + + /** + * Size of the batch. + */ + maxQuads: number; + + /** + * Dirty flag to check if resolution properties need to be updated on the + * masking shader. + */ + resolutionDirty: boolean; + + /** + * Called every time the pipeline needs to be used. + * It binds all necessary resources. + */ + onBind(): this; + + /** + * [description] + * @param width [description] + * @param height [description] + * @param resolution [description] + */ + resize(width: number, height: number, resolution: number): this; + + /** + * Binds necessary resources and renders the mask to a separated framebuffer. + * The framebuffer for the masked object is also bound for further use. + * @param mask GameObject used as mask. + * @param maskedObject GameObject masked by the mask GameObject. + * @param camera [description] + */ + beginMask(mask: Phaser.GameObjects.GameObject, maskedObject: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * The masked game objects framebuffer is unbound and its texture + * is bound together with the mask texture and the mask shader and + * a draw call with a single quad is processed. Here is where the + * masking effect is applied. + * @param mask GameObject used as a mask. + */ + endMask(mask: Phaser.GameObjects.GameObject): void; + + } + + /** + * Implements a model view projection matrices. + * Pipelines can implement this for doing 2D and 3D rendering. + */ + interface ModelViewProjection { + /** + * Dirty flag for checking if model matrix needs to be updated on GPU. + */ + modelMatrixDirty: boolean; + /** + * Dirty flag for checking if view matrix needs to be updated on GPU. + */ + viewMatrixDirty: boolean; + /** + * Dirty flag for checking if projection matrix needs to be updated on GPU. + */ + projectionMatrixDirty: boolean; + /** + * Model matrix + */ + modelMatrix: Float32Array; + /** + * View matrix + */ + viewMatrix: Float32Array; + /** + * Projection matrix + */ + projectionMatrix: Float32Array; + /** + * Initializes MVP matrices with an identity matrix + */ + mvpInit(): void; + /** + * If dirty flags are set then the matrices are uploaded to the GPU. + */ + mvpUpdate(): void; + /** + * Loads an identity matrix to the model matrix + */ + modelIdentity(): void; + /** + * Scale model matrix + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + modelScale(x: number, y: number, z: number): this; + /** + * Translate model matrix + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + modelTranslate(x: number, y: number, z: number): this; + /** + * Rotates the model matrix in the X axis. + * @param radians The amount to rotate by. + */ + modelRotateX(radians: number): this; + /** + * Rotates the model matrix in the Y axis. + * @param radians The amount to rotate by. + */ + modelRotateY(radians: number): this; + /** + * Rotates the model matrix in the Z axis. + * @param radians The amount to rotate by. + */ + modelRotateZ(radians: number): this; + /** + * Loads identity matrix into the view matrix + */ + viewIdentity(): this; + /** + * Scales view matrix + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + viewScale(x: number, y: number, z: number): this; + /** + * Translates view matrix + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + viewTranslate(x: number, y: number, z: number): this; + /** + * Rotates view matrix in the X axis. + * @param radians The amount to rotate by. + */ + viewRotateX(radians: number): this; + /** + * Rotates view matrix in the Y axis. + * @param radians The amount to rotate by. + */ + viewRotateY(radians: number): this; + /** + * Rotates view matrix in the Z axis. + * @param radians The amount to rotate by. + */ + viewRotateZ(radians: number): this; + /** + * Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix + * @param matrix2D The Matrix2D. + */ + viewLoad2D(matrix2D: Float32Array): this; + /** + * Copies a 4x4 matrix into the view matrix + * @param matrix The Matrix2D. + */ + viewLoad(matrix: Float32Array): this; + /** + * Loads identity matrix into the projection matrix. + */ + projIdentity(): this; + /** + * Sets up an orthographic projection matrix + * @param left The left value. + * @param right The right value. + * @param bottom The bottom value. + * @param top The top value. + * @param near The near value. + * @param far The far value. + */ + projOrtho(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + /** + * Sets up a perspective projection matrix + * @param fovY The fov value. + * @param aspectRatio The aspectRatio value. + * @param near The near value. + * @param far The far value. + */ + projPersp(fovY: number, aspectRatio: number, near: number, far: number): this; + } + + /** + * ForwardDiffuseLightPipeline implements a forward rendering approach for 2D lights. + * This pipeline extends TextureTintPipeline so it implements all it's rendering functions + * and batching system. + */ + class ForwardDiffuseLightPipeline extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline { + /** + * + * @param config The configuration of the pipeline, same as the {@link Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline}. The fragment shader will be replaced with the lighting shader. + */ + constructor(config: object); + + /** + * This function sets all the needed resources for each camera pass. + * @param scene The Scene being rendered. + * @param camera The Scene Camera being rendered with. + */ + onRender(scene: Phaser.Scene, camera: Phaser.Cameras.Scene2D.Camera): this; + + /** + * Generic function for batching a textured quad + * @param gameObject Source GameObject + * @param texture Raw WebGLTexture associated with the quad + * @param textureWidth Real texture width + * @param textureHeight Real texture height + * @param srcX X coordinate of the quad + * @param srcY Y coordinate of the quad + * @param srcWidth Width of the quad + * @param srcHeight Height of the quad + * @param scaleX X component of scale + * @param scaleY Y component of scale + * @param rotation Rotation of the quad + * @param flipX Indicates if the quad is horizontally flipped + * @param flipY Indicates if the quad is vertically flipped + * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll + * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll + * @param displayOriginX Horizontal origin in pixels + * @param displayOriginY Vertical origin in pixels + * @param frameX X coordinate of the texture frame + * @param frameY Y coordinate of the texture frame + * @param frameWidth Width of the texture frame + * @param frameHeight Height of the texture frame + * @param tintTL Tint for top left + * @param tintTR Tint for top right + * @param tintBL Tint for bottom left + * @param tintBR Tint for bottom right + * @param tintEffect The tint effect (0 for additive, 1 for replacement) + * @param uOffset Horizontal offset on texture coordinate + * @param vOffset Vertical offset on texture coordinate + * @param camera Current used camera + * @param parentTransformMatrix Parent container + */ + batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: integer, textureHeight: integer, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: integer, tintTR: integer, tintBL: integer, tintBR: integer, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Sets the Game Objects normal map as the active texture. + * @param gameObject The Game Object to update. + */ + setNormalMap(gameObject: Phaser.GameObjects.GameObject): void; + + /** + * Rotates the normal map vectors inversely by the given angle. + * Only works in 2D space. + * @param rotation The angle of rotation in radians. + */ + setNormalMapRotation(rotation: number): void; + + /** + * Takes a Sprite Game Object, or any object that extends it, which has a normal texture and adds it to the batch. + * @param sprite The texture-based Game Object to add to the batch. + * @param camera The Camera to use for the rendering transform. + * @param parentTransformMatrix The transform matrix of the parent container, if set. + */ + batchSprite(sprite: Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + } + + /** + * TextureTintPipeline implements the rendering infrastructure + * for displaying textured objects + * The config properties are: + * - game: Current game instance. + * - renderer: Current WebGL renderer. + * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. + * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). + * - vertShader: Source for vertex shader as a string. + * - fragShader: Source for fragment shader as a string. + * - vertexCapacity: The amount of vertices that shall be allocated + * - vertexSize: The size of a single vertex in bytes. + */ + class TextureTintPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config The configuration options for this Texture Tint Pipeline, as described above. + */ + constructor(config: object); + + /** + * Float32 view of the array buffer containing the pipeline's vertices. + */ + vertexViewF32: Float32Array; + + /** + * Uint32 view of the array buffer containing the pipeline's vertices. + */ + vertexViewU32: Uint32Array; + + /** + * Size of the batch. + */ + maxQuads: integer; + + /** + * Collection of batch information + */ + batches: any[]; + + /** + * Called every time the pipeline needs to be used. + * It binds all necessary resources. + */ + onBind(): this; + + /** + * Resizes this pipeline and updates the projection. + * @param width The new width. + * @param height The new height. + * @param resolution The resolution. + */ + resize(width: number, height: number, resolution: number): this; + + /** + * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. + * @param texture WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. + * @param unit Texture unit to which the texture needs to be bound. Default 0. + */ + setTexture2D(texture?: WebGLTexture, unit?: integer): Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline; + + /** + * Checks if the current batch has the same texture and texture unit, or if we need to create a new batch. + * @param texture WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. + * @param unit Texture unit to which the texture needs to be bound. + */ + requireTextureBatch(texture: WebGLTexture, unit: integer): boolean; + + /** + * Creates a new batch object and pushes it to a batch array. + * The batch object contains information relevant to the current + * vertex batch like the offset in the vertex buffer, vertex count and + * the textures used by that batch. + * @param texture Optional WebGLTexture that will be assigned to the created batch. + * @param unit Texture unit to which the texture needs to be bound. + */ + pushBatch(texture: WebGLTexture, unit: integer): void; + + /** + * Uploads the vertex data and emits a draw call for the current batch of vertices. + */ + flush(): this; + + /** + * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. + * @param sprite The texture based Game Object to add to the batch. + * @param camera The Camera to use for the rendering transform. + * @param parentTransformMatrix The transform matrix of the parent container, if set. + */ + batchSprite(sprite: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 + * @param x0 The top-left x position. + * @param y0 The top-left y position. + * @param x1 The bottom-left x position. + * @param y1 The bottom-left y position. + * @param x2 The bottom-right x position. + * @param y2 The bottom-right y position. + * @param x3 The top-right x position. + * @param y3 The top-right y position. + * @param u0 UV u0 value. + * @param v0 UV v0 value. + * @param u1 UV u1 value. + * @param v1 UV v1 value. + * @param tintTL The top-left tint color value. + * @param tintTR The top-right tint color value. + * @param tintBL The bottom-left tint color value. + * @param tintBR The bottom-right tint color value. + * @param tintEffect The tint effect for the shader to use. + * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param unit Texture unit to which the texture needs to be bound. Default 0. + */ + batchQuad(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, u0: number, v0: number, u1: number, v1: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number | boolean, texture?: WebGLTexture, unit?: integer): boolean; + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 3 vertices in the following arrangement: + * + * ``` + * 0 + * |\ + * | \ + * | \ + * | \ + * | \ + * 1-----2 + * ``` + * @param x1 The bottom-left x position. + * @param y1 The bottom-left y position. + * @param x2 The bottom-right x position. + * @param y2 The bottom-right y position. + * @param x3 The top-right x position. + * @param y3 The top-right y position. + * @param u0 UV u0 value. + * @param v0 UV v0 value. + * @param u1 UV u1 value. + * @param v1 UV v1 value. + * @param tintTL The top-left tint color value. + * @param tintTR The top-right tint color value. + * @param tintBL The bottom-left tint color value. + * @param tintEffect The tint effect for the shader to use. + * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param unit Texture unit to which the texture needs to be bound. Default 0. + */ + batchTri(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, u0: number, v0: number, u1: number, v1: number, tintTL: number, tintTR: number, tintBL: number, tintEffect: number | boolean, texture?: WebGLTexture, unit?: integer): boolean; + + /** + * Generic function for batching a textured quad using argument values instead of a Game Object. + * @param gameObject Source GameObject. + * @param texture Raw WebGLTexture associated with the quad. + * @param textureWidth Real texture width. + * @param textureHeight Real texture height. + * @param srcX X coordinate of the quad. + * @param srcY Y coordinate of the quad. + * @param srcWidth Width of the quad. + * @param srcHeight Height of the quad. + * @param scaleX X component of scale. + * @param scaleY Y component of scale. + * @param rotation Rotation of the quad. + * @param flipX Indicates if the quad is horizontally flipped. + * @param flipY Indicates if the quad is vertically flipped. + * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll. + * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll. + * @param displayOriginX Horizontal origin in pixels. + * @param displayOriginY Vertical origin in pixels. + * @param frameX X coordinate of the texture frame. + * @param frameY Y coordinate of the texture frame. + * @param frameWidth Width of the texture frame. + * @param frameHeight Height of the texture frame. + * @param tintTL Tint for top left. + * @param tintTR Tint for top right. + * @param tintBL Tint for bottom left. + * @param tintBR Tint for bottom right. + * @param tintEffect The tint effect. + * @param uOffset Horizontal offset on texture coordinate. + * @param vOffset Vertical offset on texture coordinate. + * @param camera Current used camera. + * @param parentTransformMatrix Parent container. + * @param skipFlip Skip the renderTexture check. Default false. + */ + batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: integer, textureHeight: integer, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: integer, tintTR: integer, tintBL: integer, tintBR: integer, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean): void; + + /** + * Adds a Texture Frame into the batch for rendering. + * @param frame The Texture Frame to be rendered. + * @param x The horizontal position to render the texture at. + * @param y The vertical position to render the texture at. + * @param tint The tint color. + * @param alpha The alpha value. + * @param transformMatrix The Transform Matrix to use for the texture. + * @param parentTransformMatrix A parent Transform Matrix. + */ + batchTextureFrame(frame: Phaser.Textures.Frame, x: number, y: number, tint: number, alpha: number, transformMatrix: Phaser.GameObjects.Components.TransformMatrix, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Pushes a filled rectangle into the vertex batch. + * Rectangle has no transform values and isn't transformed into the local space. + * Used for directly batching untransformed rectangles, such as Camera background colors. + * @param x Horizontal top left coordinate of the rectangle. + * @param y Vertical top left coordinate of the rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param color Color of the rectangle to draw. + * @param alpha Alpha value of the rectangle to draw. + */ + drawFillRect(x: number, y: number, width: number, height: number, color: number, alpha: number): void; + + /** + * Pushes a filled rectangle into the vertex batch. + * Rectangle factors in the given transform matrices before adding to the batch. + * @param x Horizontal top left coordinate of the rectangle. + * @param y Vertical top left coordinate of the rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchFillRect(x: number, y: number, width: number, height: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Pushes a filled triangle into the vertex batch. + * Triangle factors in the given transform matrices before adding to the batch. + * @param x0 Point 0 x coordinate. + * @param y0 Point 0 y coordinate. + * @param x1 Point 1 x coordinate. + * @param y1 Point 1 y coordinate. + * @param x2 Point 2 x coordinate. + * @param y2 Point 2 y coordinate. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchFillTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Pushes a stroked triangle into the vertex batch. + * Triangle factors in the given transform matrices before adding to the batch. + * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. + * @param x0 Point 0 x coordinate. + * @param y0 Point 0 y coordinate. + * @param x1 Point 1 x coordinate. + * @param y1 Point 1 y coordinate. + * @param x2 Point 2 x coordinate. + * @param y2 Point 2 y coordinate. + * @param lineWidth The width of the line in pixels. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchStrokeTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, lineWidth: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and then passing it through Earcut, which + * creates a list of polygons. Each polygon is then added to the batch. + * + * The path is always automatically closed because it's filled. + * @param path Collection of points that represent the path. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchFillPath(path: any[], currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and calling `batchLine` for each section + * of the path. + * + * The path is optionally closed at the end. + * @param path Collection of points that represent the path. + * @param lineWidth The width of the line segments in pixels. + * @param pathOpen Indicates if the path should be closed or left open. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. + */ + batchStrokePath(path: any[], lineWidth: number, pathOpen: boolean, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + + /** + * Creates a quad and adds it to the vertex batch based on the given line values. + * @param ax X coordinate to the start of the line + * @param ay Y coordinate to the start of the line + * @param bx X coordinate to the end of the line + * @param by Y coordinate to the end of the line + * @param aLineWidth Width of the start of the line + * @param bLineWidth Width of the end of the line + * @param currentMatrix Parent matrix, generally used by containers + */ + batchLine(ax: number, ay: number, bx: number, by: number, aLineWidth: number, bLineWidth: number, currentMatrix: Float32Array): void; + + } + + } + + namespace Utils { + /** + * Packs four floats on a range from 0.0 to 1.0 into a single Uint32 + * @param r Red component in a range from 0.0 to 1.0 + * @param g Green component in a range from 0.0 to 1.0 + * @param b Blue component in a range from 0.0 to 1.0 + * @param a Alpha component in a range from 0.0 to 1.0 + */ + function getTintFromFloats(r: number, g: number, b: number, a: number): number; + + /** + * Packs a Uint24, representing RGB components, with a Float32, representing + * the alpha component, with a range between 0.0 and 1.0 and return a Uint32 + * @param rgb Uint24 representing RGB components + * @param a Float32 representing Alpha component + */ + function getTintAppendFloatAlpha(rgb: number, a: number): number; + + /** + * Packs a Uint24, representing RGB components, with a Float32, representing + * the alpha component, with a range between 0.0 and 1.0 and return a + * swizzled Uint32 + * @param rgb Uint24 representing RGB components + * @param a Float32 representing Alpha component + */ + function getTintAppendFloatAlphaAndSwap(rgb: number, a: number): number; + + /** + * Unpacks a Uint24 RGB into an array of floats of ranges of 0.0 and 1.0 + * @param rgb RGB packed as a Uint24 + */ + function getFloatsFromUintRGB(rgb: number): any[]; + + /** + * Counts how many attributes of 32 bits a vertex has + * @param attributes Array of attributes + * @param glContext WebGLContext used for check types + */ + function getComponentCount(attributes: any[], glContext: WebGLRenderingContext): number; + + } + + /** + * WebGLPipeline is a class that describes the way elements will be rendererd + * in WebGL, specially focused on batching vertices (batching is not provided). + * Pipelines are mostly used for describing 2D rendering passes but it's + * flexible enough to be used for any type of rendering including 3D. + * Internally WebGLPipeline will handle things like compiling shaders, + * creating vertex buffers, assigning primitive topology and binding + * vertex attributes. + * + * The config properties are: + * - game: Current game instance. + * - renderer: Current WebGL renderer. + * - gl: Current WebGL context. + * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. + * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). + * - vertShader: Source for vertex shader as a string. + * - fragShader: Source for fragment shader as a string. + * - vertexCapacity: The amount of vertices that shall be allocated + * - vertexSize: The size of a single vertex in bytes. + * - vertices: An optional buffer of vertices + * - attributes: An array describing the vertex attributes + * + * The vertex attributes properties are: + * - name : String - Name of the attribute in the vertex shader + * - size : integer - How many components describe the attribute. For ex: vec3 = size of 3, float = size of 1 + * - type : GLenum - WebGL type (gl.BYTE, gl.SHORT, gl.UNSIGNED_BYTE, gl.UNSIGNED_SHORT, gl.FLOAT) + * - normalized : boolean - Is the attribute normalized + * - offset : integer - The offset in bytes to the current attribute in the vertex. Equivalent to offsetof(vertex, attrib) in C + * Here you can find more information of how to describe an attribute: + * - https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer + */ + class WebGLPipeline { + /** + * + * @param config The configuration object for this WebGL Pipeline, as described above. + */ + constructor(config: object); + + /** + * Name of the Pipeline. Used for identifying + */ + name: string; + + /** + * The Game which owns this WebGL Pipeline. + */ + game: Phaser.Game; + + /** + * The canvas which this WebGL Pipeline renders to. + */ + view: HTMLCanvasElement; + + /** + * Used to store the current game resolution + */ + resolution: number; + + /** + * Width of the current viewport + */ + width: number; + + /** + * Height of the current viewport + */ + height: number; + + /** + * The WebGL context this WebGL Pipeline uses. + */ + gl: WebGLRenderingContext; + + /** + * How many vertices have been fed to the current pipeline. + */ + vertexCount: number; + + /** + * The limit of vertices that the pipeline can hold + */ + vertexCapacity: integer; + + /** + * The WebGL Renderer which owns this WebGL Pipeline. + */ + renderer: Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * Raw byte buffer of vertices. + */ + vertexData: ArrayBuffer; + + /** + * The handle to a WebGL vertex buffer object. + */ + vertexBuffer: WebGLBuffer; + + /** + * The handle to a WebGL program + */ + program: WebGLProgram; + + /** + * Array of objects that describe the vertex attributes + */ + attributes: object; + + /** + * The size in bytes of the vertex + */ + vertexSize: integer; + + /** + * The primitive topology which the pipeline will use to submit draw calls + */ + topology: integer; + + /** + * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources + * to the GPU. + */ + bytes: Uint8Array; + + /** + * This will store the amount of components of 32 bit length + */ + vertexComponentCount: integer; + + /** + * Indicates if the current pipeline is flushing the contents to the GPU. + * When the variable is set the flush function will be locked. + */ + flushLocked: boolean; + + /** + * Indicates if the current pipeline is active or not for this frame only. + * Reset in the onRender method. + */ + active: boolean; + + /** + * Called when the Game has fully booted and the Renderer has finished setting up. + * + * By this stage all Game level systems are now in place and you can perform any final + * tasks that the pipeline may need that relied on game systems such as the Texture Manager. + */ + boot(): void; + + /** + * Adds a description of vertex attribute to the pipeline + * @param name Name of the vertex attribute + * @param size Vertex component size + * @param type Type of the attribute + * @param normalized Is the value normalized to a range + * @param offset Byte offset to the beginning of the first element in the vertex + */ + addAttribute(name: string, size: integer, type: integer, normalized: boolean, offset: integer): this; + + /** + * Check if the current batch of vertices is full. + */ + shouldFlush(): boolean; + + /** + * Resizes the properties used to describe the viewport + * @param width The new width of this WebGL Pipeline. + * @param height The new height of this WebGL Pipeline. + * @param resolution The resolution this WebGL Pipeline should be resized to. + */ + resize(width: number, height: number, resolution: number): this; + + /** + * Binds the pipeline resources, including programs, vertex buffers and binds attributes + */ + bind(): this; + + /** + * Set whenever this WebGL Pipeline is bound to a WebGL Renderer. + * + * This method is called every time the WebGL Pipeline is attempted to be bound, even if it already is the current pipeline. + */ + onBind(): this; + + /** + * Called before each frame is rendered, but after the canvas has been cleared. + */ + onPreRender(): this; + + /** + * Called before a Scene's Camera is rendered. + * @param scene The Scene being rendered. + * @param camera The Scene Camera being rendered with. + */ + onRender(scene: Phaser.Scene, camera: Phaser.Cameras.Scene2D.Camera): this; + + /** + * Called after each frame has been completely rendered and snapshots have been taken. + */ + onPostRender(): this; + + /** + * Uploads the vertex data and emits a draw call + * for the current batch of vertices. + */ + flush(): this; + + /** + * Removes all object references in this WebGL Pipeline and removes its program from the WebGL context. + */ + destroy(): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new value of the `float` uniform. + */ + setFloat1(name: string, x: number): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component of the `vec2` uniform. + * @param y The new Y component of the `vec2` uniform. + */ + setFloat2(name: string, x: number, y: number): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component of the `vec3` uniform. + * @param y The new Y component of the `vec3` uniform. + * @param z The new Z component of the `vec3` uniform. + */ + setFloat3(name: string, x: number, y: number, z: number): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x X component of the uniform + * @param y Y component of the uniform + * @param z Z component of the uniform + * @param w W component of the uniform + */ + setFloat4(name: string, x: number, y: number, z: number, w: number): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat1v(name: string, arr: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat2v(name: string, arr: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat3v(name: string, arr: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat4v(name: string, arr: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new value of the `int` uniform. + */ + setInt1(name: string, x: integer): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component of the `ivec2` uniform. + * @param y The new Y component of the `ivec2` uniform. + */ + setInt2(name: string, x: integer, y: integer): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component of the `ivec3` uniform. + * @param y The new Y component of the `ivec3` uniform. + * @param z The new Z component of the `ivec3` uniform. + */ + setInt3(name: string, x: integer, y: integer, z: integer): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param x X component of the uniform + * @param y Y component of the uniform + * @param z Z component of the uniform + * @param w W component of the uniform + */ + setInt4(name: string, x: integer, y: integer, z: integer, w: integer): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param transpose Whether to transpose the matrix. Should be `false`. + * @param matrix The new values for the `mat2` uniform. + */ + setMatrix2(name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param transpose Whether to transpose the matrix. Should be `false`. + * @param matrix The new values for the `mat3` uniform. + */ + setMatrix3(name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * Set a uniform value of the current pipeline program. + * @param name The name of the uniform to look-up and modify. + * @param transpose Should the matrix be transpose + * @param matrix Matrix data + */ + setMatrix4(name: string, transpose: boolean, matrix: Float32Array): this; + + } + + /** + * WebGLRenderer is a class that contains the needed functionality to keep the + * WebGLRenderingContext state clean. The main idea of the WebGLRenderer is to keep track of + * any context change that happens for WebGL rendering inside of Phaser. This means + * if raw webgl functions are called outside the WebGLRenderer of the Phaser WebGL + * rendering ecosystem they might pollute the current WebGLRenderingContext state producing + * unexpected behavior. It's recommended that WebGL interaction is done through + * WebGLRenderer and/or WebGLPipeline. + */ + class WebGLRenderer { + /** + * + * @param game The Game instance which owns this WebGL Renderer. + */ + constructor(game: Phaser.Game); + + /** + * The local configuration settings of this WebGL Renderer. + */ + config: object; + + /** + * The Game instance which owns this WebGL Renderer. + */ + game: Phaser.Game; + + /** + * A constant which allows the renderer to be easily identified as a WebGL Renderer. + */ + type: integer; + + /** + * The width of the canvas being rendered to. + * This is populated in the onResize event handler. + */ + width: integer; + + /** + * The height of the canvas being rendered to. + * This is populated in the onResize event handler. + */ + height: integer; + + /** + * The canvas which this WebGL Renderer draws to. + */ + canvas: HTMLCanvasElement; + + /** + * An array of functions to invoke if the WebGL context is lost. + */ + lostContextCallbacks: WebGLContextCallback[]; + + /** + * An array of functions to invoke if the WebGL context is restored. + */ + restoredContextCallbacks: WebGLContextCallback[]; + + /** + * An array of blend modes supported by the WebGL Renderer. + * + * This array includes the default blend modes as well as any custom blend modes added through {@link #addBlendMode}. + */ + blendModes: any[]; + + /** + * Keeps track of any WebGLTexture created with the current WebGLRenderingContext + */ + nativeTextures: any[]; + + /** + * Set to `true` if the WebGL context of the renderer is lost. + */ + contextLost: boolean; + + /** + * This object will store all pipelines created through addPipeline + */ + pipelines: object; + + /** + * Details about the currently scheduled snapshot. + * + * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. + */ + snapshotState: Phaser.Types.Renderer.Snapshot.SnapshotState; + + /** + * Cached value for the last texture unit that was used + */ + currentActiveTextureUnit: integer; + + /** + * An array of the last texture handles that were bound to the WebGLRenderingContext + */ + currentTextures: any[]; + + /** + * Current framebuffer in use + */ + currentFramebuffer: WebGLFramebuffer; + + /** + * Current WebGLPipeline in use + */ + currentPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Current WebGLProgram in use + */ + currentProgram: WebGLProgram; + + /** + * Current WebGLBuffer (Vertex buffer) in use + */ + currentVertexBuffer: WebGLBuffer; + + /** + * Current WebGLBuffer (Index buffer) in use + */ + currentIndexBuffer: WebGLBuffer; + + /** + * Current blend mode in use + */ + currentBlendMode: integer; + + /** + * Indicates if the the scissor state is enabled in WebGLRenderingContext + */ + currentScissorEnabled: boolean; + + /** + * Stores the current scissor data + */ + currentScissor: Uint32Array; + + /** + * Stack of scissor data + */ + scissorStack: Uint32Array; + + /** + * The underlying WebGL context of the renderer. + */ + gl: WebGLRenderingContext; + + /** + * Array of strings that indicate which WebGL extensions are supported by the browser + */ + supportedExtensions: object; + + /** + * Extensions loaded into the current context + */ + extensions: object; + + /** + * Stores the current WebGL component formats for further use + */ + glFormats: any[]; + + /** + * Stores the supported WebGL texture compression formats. + */ + compression: any[]; + + /** + * Cached drawing buffer height to reduce gl calls. + */ + readonly drawingBufferHeight: number; + + /** + * A blank 32x32 transparent texture, as used by the Graphics system where needed. + * This is set in the `boot` method. + */ + readonly blankTexture: WebGLTexture; + + /** + * A default Camera used in calls when no other camera has been provided. + */ + defaultCamera: Phaser.Cameras.Scene2D.BaseCamera; + + /** + * The total number of masks currently stacked. + */ + maskCount: integer; + + /** + * The mask stack. + */ + maskStack: Phaser.Display.Masks.GeometryMask[]; + + /** + * Internal property that tracks the currently set mask. + */ + currentMask: any; + + /** + * Internal property that tracks the currently set camera mask. + */ + currentCameraMask: any; + + /** + * Internal gl function mapping for uniform look-up. + * https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform + */ + glFuncMap: any; + + /** + * Creates a new WebGLRenderingContext and initializes all internal state. + * @param config The configuration object for the renderer. + */ + init(config: object): this; + + /** + * The event handler that manages the `resize` event dispatched by the Scale Manager. + * @param gameSize The default Game Size object. This is the un-modified game dimensions. + * @param baseSize The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + * @param displaySize The display Size object. The size of the canvas style width / height attributes. + * @param resolution The Scale Manager resolution setting. + */ + onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size, displaySize: Phaser.Structs.Size, resolution?: number): void; + + /** + * Resizes the drawing buffer to match that required by the Scale Manager. + * @param width The new width of the renderer. + * @param height The new height of the renderer. + * @param resolution The new resolution of the renderer. + */ + resize(width?: number, height?: number, resolution?: number): this; + + /** + * Adds a callback to be invoked when the WebGL context has been restored by the browser. + * @param callback The callback to be invoked on context restoration. + * @param target The context of the callback. + */ + onContextRestored(callback: WebGLContextCallback, target: object): this; + + /** + * Adds a callback to be invoked when the WebGL context has been lost by the browser. + * @param callback The callback to be invoked on context loss. + * @param target The context of the callback. + */ + onContextLost(callback: WebGLContextCallback, target: object): this; + + /** + * Checks if a WebGL extension is supported + * @param extensionName Name of the WebGL extension + */ + hasExtension(extensionName: string): boolean; + + /** + * Loads a WebGL extension + * @param extensionName The name of the extension to load. + */ + getExtension(extensionName: string): object; + + /** + * Flushes the current pipeline if the pipeline is bound + */ + flush(): void; + + /** + * Checks if a pipeline is present in the current WebGLRenderer + * @param pipelineName The name of the pipeline. + */ + hasPipeline(pipelineName: string): boolean; + + /** + * Returns the pipeline by name if the pipeline exists + * @param pipelineName The name of the pipeline. + */ + getPipeline(pipelineName: string): Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Removes a pipeline by name. + * @param pipelineName The name of the pipeline to be removed. + */ + removePipeline(pipelineName: string): this; + + /** + * Adds a pipeline instance into the collection of pipelines + * @param pipelineName A unique string-based key for the pipeline. + * @param pipelineInstance A pipeline instance which must extend WebGLPipeline. + */ + addPipeline(pipelineName: string, pipelineInstance: Phaser.Renderer.WebGL.WebGLPipeline): Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Pushes a new scissor state. This is used to set nested scissor states. + * @param x The x position of the scissor. + * @param y The y position of the scissor. + * @param width The width of the scissor. + * @param height The height of the scissor. + * @param drawingBufferHeight Optional drawingBufferHeight override value. + */ + pushScissor(x: integer, y: integer, width: integer, height: integer, drawingBufferHeight?: integer): integer[]; + + /** + * Sets the current scissor state. + * @param x The x position of the scissor. + * @param y The y position of the scissor. + * @param width The width of the scissor. + * @param height The height of the scissor. + * @param drawingBufferHeight Optional drawingBufferHeight override value. + */ + setScissor(x: integer, y: integer, width: integer, height: integer, drawingBufferHeight?: integer): void; + + /** + * Pops the last scissor state and sets it. + */ + popScissor(): void; + + /** + * Binds a WebGLPipeline and sets it as the current pipeline to be used. + * @param pipelineInstance The pipeline instance to be activated. + * @param gameObject The Game Object that invoked this pipeline, if any. + */ + setPipeline(pipelineInstance: Phaser.Renderer.WebGL.WebGLPipeline, gameObject?: Phaser.GameObjects.GameObject): Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Is there an active stencil mask? + */ + hasActiveStencilMask(): boolean; + + /** + * Use this to reset the gl context to the state that Phaser requires to continue rendering. + * Calling this will: + * + * * Disable `DEPTH_TEST`, `CULL_FACE` and `STENCIL_TEST`. + * * Clear the depth buffer and stencil buffers. + * * Reset the viewport size. + * * Reset the blend mode. + * * Bind a blank texture as the active texture on texture unit zero. + * * Rebinds the given pipeline instance. + * + * You should call this having previously called `clearPipeline` and then wishing to return + * control to Phaser again. + * @param pipelineInstance The pipeline instance to be activated. + */ + rebindPipeline(pipelineInstance: Phaser.Renderer.WebGL.WebGLPipeline): void; + + /** + * Flushes the current WebGLPipeline being used and then clears it, along with the + * the current shader program and vertex buffer. Then resets the blend mode to NORMAL. + * Call this before jumping to your own gl context handler, and then call `rebindPipeline` when + * you wish to return control to Phaser again. + */ + clearPipeline(): void; + + /** + * Sets the blend mode to the value given. + * + * If the current blend mode is different from the one given, the pipeline is flushed and the new + * blend mode is enabled. + * @param blendModeId The blend mode to be set. Can be a `BlendModes` const or an integer value. + * @param force Force the blend mode to be set, regardless of the currently set blend mode. Default false. + */ + setBlendMode(blendModeId: integer, force?: boolean): boolean; + + /** + * Creates a new custom blend mode for the renderer. + * @param func An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. + * @param equation The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. + */ + addBlendMode(func: Function, equation: Function): integer; + + /** + * Updates the function bound to a given custom blend mode. + * @param index The index of the custom blend mode. + * @param func The function to use for the blend mode. + * @param equation The equation to use for the blend mode. + */ + updateBlendMode(index: integer, func: Function, equation: Function): this; + + /** + * Removes a custom blend mode from the renderer. + * Any Game Objects still using this blend mode will error, so be sure to clear them first. + * @param index The index of the custom blend mode to be removed. + */ + removeBlendMode(index: integer): this; + + /** + * Binds a texture at a texture unit. If a texture is already + * bound to that unit it will force a flush on the current pipeline. + * @param texture The WebGL texture that needs to be bound. + * @param textureUnit The texture unit to which the texture will be bound. + * @param flush Will the current pipeline be flushed if this is a new texture, or not? Default true. + */ + setTexture2D(texture: WebGLTexture, textureUnit: integer, flush?: boolean): this; + + /** + * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush. + * @param framebuffer The framebuffer that needs to be bound. + * @param updateScissor If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. Default false. + */ + setFramebuffer(framebuffer: WebGLFramebuffer, updateScissor?: boolean): this; + + /** + * Binds a program. If there was another program already bound it will force a pipeline flush. + * @param program The program that needs to be bound. + */ + setProgram(program: WebGLProgram): this; + + /** + * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush. + * @param vertexBuffer The buffer that needs to be bound. + */ + setVertexBuffer(vertexBuffer: WebGLBuffer): this; + + /** + * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush. + * @param indexBuffer The buffer the needs to be bound. + */ + setIndexBuffer(indexBuffer: WebGLBuffer): this; + + /** + * Creates a texture from an image source. If the source is not valid it creates an empty texture. + * @param source The source of the texture. + * @param width The width of the texture. + * @param height The height of the texture. + * @param scaleMode The scale mode to be used by the texture. + */ + createTextureFromSource(source: object, width: integer, height: integer, scaleMode: integer): WebGLTexture; + + /** + * A wrapper for creating a WebGLTexture. If no pixel data is passed it will create an empty texture. + * @param mipLevel Mip level of the texture. + * @param minFilter Filtering of the texture. + * @param magFilter Filtering of the texture. + * @param wrapT Wrapping mode of the texture. + * @param wrapS Wrapping mode of the texture. + * @param format Which format does the texture use. + * @param pixels pixel data. + * @param width Width of the texture in pixels. + * @param height Height of the texture in pixels. + * @param pma Does the texture have premultiplied alpha? + */ + createTexture2D(mipLevel: integer, minFilter: integer, magFilter: integer, wrapT: integer, wrapS: integer, format: integer, pixels: object, width: integer, height: integer, pma: boolean): WebGLTexture; + + /** + * Wrapper for creating WebGLFramebuffer. + * @param width Width in pixels of the framebuffer + * @param height Height in pixels of the framebuffer + * @param renderTexture The color texture to where the color pixels are written + * @param addDepthStencilBuffer Indicates if the current framebuffer support depth and stencil buffers + */ + createFramebuffer(width: integer, height: integer, renderTexture: WebGLTexture, addDepthStencilBuffer: boolean): WebGLFramebuffer; + + /** + * Wrapper for creating a WebGLProgram + * @param vertexShader Source to the vertex shader + * @param fragmentShader Source to the fragment shader + */ + createProgram(vertexShader: string, fragmentShader: string): WebGLProgram; + + /** + * Wrapper for creating a vertex buffer. + * @param initialDataOrSize It's either ArrayBuffer or an integer indicating the size of the vbo + * @param bufferUsage How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW + */ + createVertexBuffer(initialDataOrSize: ArrayBuffer, bufferUsage: integer): WebGLBuffer; + + /** + * Wrapper for creating a vertex buffer. + * @param initialDataOrSize Either ArrayBuffer or an integer indicating the size of the vbo. + * @param bufferUsage How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. + */ + createIndexBuffer(initialDataOrSize: ArrayBuffer, bufferUsage: integer): WebGLBuffer; + + /** + * Removes the given texture from the nativeTextures array and then deletes it from the GPU. + * @param texture The WebGL Texture to be deleted. + */ + deleteTexture(texture: WebGLTexture): this; + + /** + * Deletes a WebGLFramebuffer from the GL instance. + * @param framebuffer The Framebuffer to be deleted. + */ + deleteFramebuffer(framebuffer: WebGLFramebuffer): this; + + /** + * Deletes a WebGLProgram from the GL instance. + * @param program The shader program to be deleted. + */ + deleteProgram(program: WebGLProgram): this; + + /** + * Deletes a WebGLBuffer from the GL instance. + * @param vertexBuffer The WebGLBuffer to be deleted. + */ + deleteBuffer(vertexBuffer: WebGLBuffer): this; + + /** + * Controls the pre-render operations for the given camera. + * Handles any clipping needed by the camera and renders the background color if a color is visible. + * @param camera The Camera to pre-render. + */ + preRenderCamera(camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Controls the post-render operations for the given camera. + * Renders the foreground camera effects like flash and fading. It resets the current scissor state. + * @param camera The Camera to post-render. + */ + postRenderCamera(camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Clears the current vertex buffer and updates pipelines. + */ + preRender(): void; + + /** + * The core render step for a Scene Camera. + * + * Iterates through the given Game Object's array and renders them with the given Camera. + * + * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked + * by the Scene Systems.render method. + * + * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. + * @param scene The Scene to render. + * @param children The Game Object's within the Scene to be rendered. + * @param interpolationPercentage The interpolation percentage to apply. Currently un-used. + * @param camera The Scene Camera to render with. + */ + render(scene: Phaser.Scene, children: Phaser.GameObjects.GameObject, interpolationPercentage: number, camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * The post-render step happens after all Cameras in all Scenes have been rendered. + */ + postRender(): void; + + /** + * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. + * + * To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param callback The Function to invoke after the snapshot image is created. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshot(callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + + /** + * Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * @param x The x coordinate to grab from. + * @param y The y coordinate to grab from. + * @param width The width of the area to grab. + * @param height The height of the area to grab. + * @param callback The Function to invoke after the snapshot image is created. + * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. + * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. + */ + snapshotArea(x: integer, y: integer, width: integer, height: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + + /** + * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then + * calling this method will override it. + * + * Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for + * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, + * using less memory. + * @param x The x coordinate of the pixel to get. + * @param y The y coordinate of the pixel to get. + * @param callback The Function to invoke after the snapshot pixel data is extracted. + */ + snapshotPixel(x: integer, y: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; + + /** + * Creates a WebGL Texture based on the given canvas element. + * @param srcCanvas The Canvas element that will be used to populate the texture. + * @param dstTexture Is this going to replace an existing texture? If so, pass it here. + * @param noRepeat Should this canvas never be allowed to set REPEAT? (such as for Text objects) Default false. + */ + canvasToTexture(srcCanvas: HTMLCanvasElement, dstTexture?: WebGLTexture, noRepeat?: boolean): WebGLTexture; + + /** + * Sets the minification and magnification filter for a texture. + * @param texture The texture to set the filter for. + * @param filter The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. + */ + setTextureFilter(texture: integer, filter: integer): this; + + /** + * [description] + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x [description] + */ + setFloat1(program: WebGLProgram, name: string, x: number): this; + + /** + * [description] + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x [description] + * @param y [description] + */ + setFloat2(program: WebGLProgram, name: string, x: number, y: number): this; + + /** + * [description] + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x [description] + * @param y [description] + * @param z [description] + */ + setFloat3(program: WebGLProgram, name: string, x: number, y: number, z: number): this; + + /** + * Sets uniform of a WebGLProgram + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + */ + setFloat4(program: WebGLProgram, name: string, x: number, y: number, z: number, w: number): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat1v(program: WebGLProgram, name: string, arr: Float32Array): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat2v(program: WebGLProgram, name: string, arr: Float32Array): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat3v(program: WebGLProgram, name: string, arr: Float32Array): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param arr The new value to be used for the uniform variable. + */ + setFloat4v(program: WebGLProgram, name: string, arr: Float32Array): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x [description] + */ + setInt1(program: WebGLProgram, name: string, x: integer): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component + * @param y The new Y component + */ + setInt2(program: WebGLProgram, name: string, x: integer, y: integer): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x The new X component + * @param y The new Y component + * @param z The new Z component + */ + setInt3(program: WebGLProgram, name: string, x: integer, y: integer, z: integer): this; + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param x X component + * @param y Y component + * @param z Z component + * @param w W component + */ + setInt4(program: WebGLProgram, name: string, x: integer, y: integer, z: integer, w: integer): this; + + /** + * Sets the value of a 2x2 matrix uniform variable in the given WebGLProgram. + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param transpose The value indicating whether to transpose the matrix. Must be false. + * @param matrix The new matrix value. + */ + setMatrix2(program: WebGLProgram, name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * [description] + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param transpose [description] + * @param matrix [description] + */ + setMatrix3(program: WebGLProgram, name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * Sets uniform of a WebGLProgram + * @param program The target WebGLProgram from which the uniform location will be looked-up. + * @param name The name of the uniform to look-up and modify. + * @param transpose Is the matrix transposed + * @param matrix Matrix data + */ + setMatrix4(program: WebGLProgram, name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * Returns the maximum number of texture units that can be used in a fragment shader. + */ + getMaxTextures(): integer; + + /** + * Returns the largest texture size (either width or height) that can be created. + * Note that VRAM may not allow a texture of any given size, it just expresses + * hardware / driver support for a given size. + */ + getMaxTextureSize(): integer; + + /** + * Destroy this WebGLRenderer, cleaning up all related resources such as pipelines, native textures, etc. + */ + destroy(): void; + + } + + } + + } + + /** + * Phaser Scale Modes. + */ + enum ScaleModes { + /** + * Default Scale Mode (Linear). + */ + DEFAULT, + /** + * Linear Scale Mode. + */ + LINEAR, + /** + * Nearest Scale Mode. + */ + NEAREST, + } + + namespace Scale { + /** + * Phaser Scale Manager constants for centering the game canvas. + */ + enum Center { + /** + * The game canvas is not centered within the parent by Phaser. + * You can still center it yourself via CSS. + */ + NO_CENTER, + /** + * The game canvas is centered both horizontally and vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + CENTER_BOTH, + /** + * The game canvas is centered horizontally within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + CENTER_HORIZONTALLY, + /** + * The game canvas is centered both vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + CENTER_VERTICALLY, + } + + /** + * Phaser Scale Manager constants for centering the game canvas. + * + * To find out what each mode does please see [Phaser.Scale.Center]{@link Phaser.Scale.Center}. + */ + type CenterType = Phaser.Scale.Center; + + /** + * Phaser Scale Manager constants for orientation. + */ + enum Orientation { + /** + * A landscape orientation. + */ + LANDSCAPE, + /** + * A portrait orientation. + */ + PORTRAIT, + } + + /** + * Phaser Scale Manager constants for orientation. + * + * To find out what each mode does please see [Phaser.Scale.Orientation]{@link Phaser.Scale.Orientation}. + */ + type OrientationType = Phaser.Scale.Orientation; + + /** + * Phaser Scale Manager constants for the different scale modes available. + */ + enum ScaleModes { + /** + * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it + * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need + * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. + */ + NONE, + /** + * The height is automatically adjusted based on the width. + */ + WIDTH_CONTROLS_HEIGHT, + /** + * The width is automatically adjusted based on the height. + */ + HEIGHT_CONTROLS_WIDTH, + /** + * The width and height are automatically adjusted to fit inside the given target area, + * while keeping the aspect ratio. Depending on the aspect ratio there may be some space + * inside the area which is not covered. + */ + FIT, + /** + * The width and height are automatically adjusted to make the size cover the entire target + * area while keeping the aspect ratio. This may extend further out than the target size. + */ + ENVELOP, + /** + * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. + */ + RESIZE, + } + + /** + * Phaser Scale Manager constants for the different scale modes available. + * + * To find out what each mode does please see [Phaser.Scale.ScaleModes]{@link Phaser.Scale.ScaleModes}. + */ + type ScaleModeType = Phaser.Scale.ScaleModes; + + /** + * Phaser Scale Manager constants for zoom modes. + */ + enum Zoom { + /** + * The game canvas will not be zoomed by Phaser. + */ + NO_ZOOM, + /** + * The game canvas will be 2x zoomed by Phaser. + */ + ZOOM_2X, + /** + * The game canvas will be 4x zoomed by Phaser. + */ + ZOOM_4X, + /** + * Calculate the zoom value based on the maximum multiplied game size that will + * fit into the parent, or browser window if no parent is set. + */ + MAX_ZOOM, + } + + /** + * Phaser Scale Manager constants for zoom modes. + * + * To find out what each mode does please see [Phaser.Scale.Zoom]{@link Phaser.Scale.Zoom}. + */ + type ZoomType = Phaser.Scale.Zoom; + + namespace Events { + /** + * The Scale Manager has successfully entered fullscreen mode. + */ + const ENTER_FULLSCREEN: any; + + /** + * The Scale Manager tried to enter fullscreen mode but failed. + */ + const FULLSCREEN_FAILED: any; + + /** + * The Scale Manager tried to enter fullscreen mode, but it is unsupported by the browser. + */ + const FULLSCREEN_UNSUPPORTED: any; + + /** + * The Scale Manager was in fullscreen mode, but has since left, either directly via game code, + * or via a user gestured, such as pressing the ESC key. + */ + const LEAVE_FULLSCREEN: any; + + /** + * The Scale Manager Orientation Change Event. + */ + const ORIENTATION_CHANGE: any; + + /** + * The Scale Manager Resize Event. + * + * This event is dispatched whenever the Scale Manager detects a resize event from the browser. + * It sends three parameters to the callback, each of them being Size components. You can read + * the `width`, `height`, `aspectRatio` and other properties of these components to help with + * scaling your own game content. + */ + const RESIZE: any; + + } + + /** + * The Scale Manager handles the scaling, resizing and alignment of the game canvas. + * + * The way scaling is handled is by setting the game canvas to a fixed size, which is defined in the + * game configuration. You also define the parent container in the game config. If no parent is given, + * it will default to using the document body. The Scale Manager will then look at the available space + * within the _parent_ and scale the canvas accordingly. Scaling is handled by setting the canvas CSS + * width and height properties, leaving the width and height of the canvas element itself untouched. + * Scaling is therefore achieved by keeping the core canvas the same size and 'stretching' + * it via its CSS properties. This gives the same result and speed as using the `transform-scale` CSS + * property, without the need for browser prefix handling. + * + * The calculations for the scale are heavily influenced by the bounding parent size, which is the computed + * dimensions of the canvas's parent. The CSS rules of the parent element play an important role in the + * operation of the Scale Manager. For example, if the parent has no defined width or height, then actions + * like auto-centering will fail to achieve the required result. The Scale Manager works in tandem with the + * CSS you set-up on the page hosting your game, rather than taking control of it. + * + * #### Parent and Display canvas containment guidelines: + * + * - Style the Parent element (of the game canvas) to control the Parent size and thus the games size and layout. + * + * - The Parent element's CSS styles should _effectively_ apply maximum (and minimum) bounding behavior. + * + * - The Parent element should _not_ apply a padding as this is not accounted for. + * If a padding is required apply it to the Parent's parent or apply a margin to the Parent. + * If you need to add a border, margin or any other CSS around your game container, then use a parent element and + * apply the CSS to this instead, otherwise you'll be constantly resizing the shape of the game container. + * + * - The Display canvas layout CSS styles (i.e. margins, size) should not be altered / specified as + * they may be updated by the Scale Manager. + * + * #### Scale Modes + * + * The way the scaling is handled is determined by the `scaleMode` property. The default is `NO_SCALE`, + * which prevents Phaser from scaling or touching the canvas, or its parent, at all. In this mode, you are + * responsible for all scaling. The other scaling modes afford you automatic scaling. + * + * If you wish to scale your game so that it always fits into the available space within the parent, you + * should use the scale mode `FIT`. Look at the documentation for other scale modes to see what options are + * available. Here is a basic config showing how to set this scale mode: + * + * ```javascript + * scale: { + * parent: 'yourgamediv', + * mode: Phaser.Scale.FIT, + * width: 800, + * height: 600 + * } + * ``` + * + * Place the `scale` config object within your game config. + * + * If you wish for the canvas to be resized directly, so that the canvas itself fills the available space + * (i.e. it isn't scaled, it's resized) then use the `RESIZE` scale mode. This will give you a 1:1 mapping + * of canvas pixels to game size. In this mode CSS isn't used to scale the canvas, it's literally adjusted + * to fill all available space within the parent. You should be extremely careful about the size of the + * canvas you're creating when doing this, as the larger the area, the more work the GPU has to do and it's + * very easy to hit fill-rate limits quickly. + * + * For complex, custom-scaling requirements, you should probably consider using the `RESIZE` scale mode, + * with your own limitations in place re: canvas dimensions and managing the scaling with the game scenes + * yourself. For the vast majority of games, however, the `FIT` mode is likely to be the most used. + * + * Please appreciate that the Scale Manager cannot perform miracles. All it does is scale your game canvas + * as best it can, based on what it can infer from its surrounding area. There are all kinds of environments + * where it's up to you to guide and help the canvas position itself, especially when built into rendering + * frameworks like React and Vue. If your page requires meta tags to prevent user scaling gestures, or such + * like, then it's up to you to ensure they are present in the html. + * + * #### Centering + * + * You can also have the game canvas automatically centered. Again, this relies heavily on the parent being + * properly configured and styled, as the centering offsets are based entirely on the available space + * within the parent element. Centering is disabled by default, or can be applied horizontally, vertically, + * or both. Here's an example: + * + * ```javascript + * scale: { + * parent: 'yourgamediv', + * autoCenter: Phaser.Scale.CENTER_BOTH, + * width: 800, + * height: 600 + * } + * ``` + * + * #### Fullscreen API + * + * If the browser supports it, you can send your game into fullscreen mode. In this mode, the game will fill + * the entire display, removing all browser UI and anything else present on the screen. It will remain in this + * mode until your game either disables it, or until the user tabs out or presses ESCape if on desktop. It's a + * great way to achieve a desktop-game like experience from the browser, but it does require a modern browser + * to handle it. Some mobile browsers also support this. + */ + class ScaleManager extends Phaser.Events.EventEmitter { + /** + * + * @param game A reference to the Phaser.Game instance. + */ + constructor(game: Phaser.Game); + + /** + * A reference to the Phaser.Game instance. + */ + readonly game: Phaser.Game; + + /** + * A reference to the HTML Canvas Element that Phaser uses to render the game. + */ + canvas: HTMLCanvasElement; + + /** + * The DOM bounds of the canvas element. + */ + canvasBounds: Phaser.Geom.Rectangle; + + /** + * The parent object of the Canvas. Often a div, or the browser window, or nothing in non-browser environments. + * + * This is set in the Game Config as the `parent` property. If undefined (or just not present), it will default + * to use the document body. If specifically set to `null` Phaser will ignore all parent operations. + */ + parent: any; + + /** + * Is the parent element the browser window? + */ + parentIsWindow: boolean; + + /** + * The Parent Size component. + */ + parentSize: Phaser.Structs.Size; + + /** + * The Game Size component. + * + * The un-modified game size, as requested in the game config (the raw width / height), + * as used for world bounds, cameras, etc + */ + gameSize: Phaser.Structs.Size; + + /** + * The Base Size component. + * + * The modified game size, which is the gameSize * resolution, used to set the canvas width and height + * (but not the CSS style) + */ + baseSize: Phaser.Structs.Size; + + /** + * The Display Size component. + * + * The size used for the canvas style, factoring in the scale mode, parent and other values. + */ + displaySize: Phaser.Structs.Size; + + /** + * The game scale mode. + */ + scaleMode: Phaser.Scale.ScaleModeType; + + /** + * The canvas resolution. + * + * This is hard-coded to a value of 1 in the 3.16 release of Phaser and will be enabled at a later date. + */ + resolution: number; + + /** + * The game zoom factor. + * + * This value allows you to multiply your games base size by the given zoom factor. + * This is then used when calculating the display size, even in `NO_SCALE` situations. + * If you don't want Phaser to touch the canvas style at all, this value should be 1. + * + * Can also be set to `MAX_ZOOM` in which case the zoom value will be derived based + * on the game size and available space within the parent. + */ + zoom: number; + + /** + * The scale factor between the baseSize and the canvasBounds. + */ + displayScale: Phaser.Math.Vector2; + + /** + * If set, the canvas sizes will be automatically passed through Math.floor. + * This results in rounded pixel display values, which is important for performance on legacy + * and low powered devices, but at the cost of not achieving a 'perfect' fit in some browser windows. + */ + autoRound: boolean; + + /** + * Automatically center the canvas within the parent? The different centering modes are: + * + * 1. No centering. + * 2. Center both horizontally and vertically. + * 3. Center horizontally. + * 4. Center vertically. + * + * Please be aware that in order to center the game canvas, you must have specified a parent + * that has a size set, or the canvas parent is the document.body. + */ + autoCenter: Phaser.Scale.CenterType; + + /** + * The current device orientation. + * + * Orientation events are dispatched via the Device Orientation API, typically only on mobile browsers. + */ + orientation: Phaser.Scale.OrientationType; + + /** + * A reference to the Device.Fullscreen object. + */ + fullscreen: Phaser.Device.Fullscreen; + + /** + * The DOM Element which is sent into fullscreen mode. + */ + fullscreenTarget: any; + + /** + * The dirty state of the Scale Manager. + * Set if there is a change between the parent size and the current size. + */ + dirty: boolean; + + /** + * How many milliseconds should elapse before checking if the browser size has changed? + * + * Most modern browsers dispatch a 'resize' event, which the Scale Manager will listen for. + * However, older browsers fail to do this, or do it consistently, so we fall back to a + * more traditional 'size check' based on a time interval. You can control how often it is + * checked here. + */ + resizeInterval: integer; + + /** + * Called _before_ the canvas object is created and added to the DOM. + */ + protected preBoot(): void; + + /** + * The Boot handler is called by Phaser.Game when it first starts up. + * The renderer is available by now and the canvas has been added to the DOM. + */ + protected boot(): void; + + /** + * Parses the game configuration to set-up the scale defaults. + * @param config The Game configuration object. + */ + protected parseConfig(config: Phaser.Types.Core.GameConfig): void; + + /** + * Determines the parent element of the game canvas, if any, based on the game configuration. + * @param config The Game configuration object. + */ + getParent(config: Phaser.Types.Core.GameConfig): void; + + /** + * Calculates the size of the parent bounds and updates the `parentSize` component, if the canvas has a dom parent. + */ + getParentBounds(): boolean; + + /** + * Attempts to lock the orientation of the web browser using the Screen Orientation API. + * + * This API is only available on modern mobile browsers. + * See https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation for details. + * @param orientation The orientation you'd like to lock the browser in. Should be an API string such as 'landscape', 'landscape-primary', 'portrait', etc. + */ + lockOrientation(orientation: string): boolean; + + /** + * This method will set the size of the Parent Size component, which is used in scaling + * and centering calculations. You only need to call this method if you have explicitly + * disabled the use of a parent in your game config, but still wish to take advantage of + * other Scale Manager features. + * @param width The new width of the parent. + * @param height The new height of the parent. + */ + setParentSize(width: number, height: number): this; + + /** + * This method will set a new size for your game. + * + * It should only be used if you're looking to change the base size of your game and are using + * one of the Scale Manager scaling modes, i.e. `FIT`. If you're using `NO_SCALE` and wish to + * change the game and canvas size directly, then please use the `resize` method instead. + * @param width The new width of the game. + * @param height The new height of the game. + */ + setGameSize(width: number, height: number): this; + + /** + * Call this to modify the size of the Phaser canvas element directly. + * You should only use this if you are using the `NO_SCALE` scale mode, + * it will update all internal components completely. + * + * If all you want to do is change the size of the parent, see the `setParentSize` method. + * + * If all you want is to change the base size of the game, but still have the Scale Manager + * manage all the scaling (i.e. you're **not** using `NO_SCALE`), then see the `setGameSize` method. + * + * This method will set the `gameSize`, `baseSize` and `displaySize` components to the given + * dimensions. It will then resize the canvas width and height to the values given, by + * directly setting the properties. Finally, if you have set the Scale Manager zoom value + * to anything other than 1 (the default), it will set the canvas CSS width and height to + * be the given size multiplied by the zoom factor (the canvas pixel size remains untouched). + * + * If you have enabled `autoCenter`, it is then passed to the `updateCenter` method and + * the margins are set, allowing the canvas to be centered based on its parent element + * alone. Finally, the `displayScale` is adjusted and the RESIZE event dispatched. + * @param width The new width of the game. + * @param height The new height of the game. + */ + resize(width: number, height: number): this; + + /** + * Sets the zoom value of the Scale Manager. + * @param value The new zoom value of the game. + */ + setZoom(value: integer): this; + + /** + * Sets the zoom to be the maximum possible based on the _current_ parent size. + */ + setMaxZoom(): this; + + /** + * Refreshes the internal scale values, bounds sizes and orientation checks. + * + * Once finished, dispatches the resize event. + * + * This is called automatically by the Scale Manager when the browser window size changes, + * as long as it is using a Scale Mode other than 'NONE'. + * @param previousWidth The previous width of the game. Only set if the gameSize has changed. + * @param previousHeight The previous height of the game. Only set if the gameSize has changed. + */ + refresh(previousWidth?: number, previousHeight?: number): this; + + /** + * Internal method that checks the current screen orientation, only if the internal check flag is set. + * + * If the orientation has changed it updates the orientation property and then dispatches the orientation change event. + */ + updateOrientation(): void; + + /** + * Internal method that manages updating the size components based on the scale mode. + */ + updateScale(): void; + + /** + * Calculates and returns the largest possible zoom factor, based on the current + * parent and game sizes. If the parent has no dimensions (i.e. an unstyled div), + * or is smaller than the un-zoomed game, then this will return a value of 1 (no zoom) + */ + getMaxZoom(): integer; + + /** + * Calculates and updates the canvas CSS style in order to center it within the + * bounds of its parent. If you have explicitly set parent to be `null` in your + * game config then this method will likely give incorrect results unless you have called the + * `setParentSize` method first. + * + * It works by modifying the canvas CSS `marginLeft` and `marginTop` properties. + * + * If they have already been set by your own style sheet, or code, this will overwrite them. + * + * To prevent the Scale Manager from centering the canvas, either do not set the + * `autoCenter` property in your game config, or make sure it is set to `NO_CENTER`. + */ + updateCenter(): void; + + /** + * Updates the `canvasBounds` rectangle to match the bounding client rectangle of the + * canvas element being used to track input events. + */ + updateBounds(): void; + + /** + * Transforms the pageX value into the scaled coordinate space of the Scale Manager. + * @param pageX The DOM pageX value. + */ + transformX(pageX: number): number; + + /** + * Transforms the pageY value into the scaled coordinate space of the Scale Manager. + * @param pageY The DOM pageY value. + */ + transformY(pageY: number): number; + + /** + * Sends a request to the browser to ask it to go in to full screen mode, using the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API Fullscreen API}. + * + * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. + * + * This method _must_ be called from a user-input gesture, such as `pointerup`. You cannot launch + * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked + * from fullscreen unless the iframe has the `allowfullscreen` attribute. + * + * On touch devices, such as Android and iOS Safari, you should always use `pointerup` and NOT `pointerdown`, + * otherwise the request will fail unless the document in which your game is embedded has already received + * some form of touch input, which you cannot guarantee. Activating fullscreen via `pointerup` circumvents + * this issue. + * + * Performing an action that navigates to another page, or opens another tab, will automatically cancel + * fullscreen mode, as will the user pressing the ESC key. To cancel fullscreen mode directly from your game, + * i.e. by clicking an icon, call the `stopFullscreen` method. + * + * A browser can only send one DOM element into fullscreen. You can control which element this is by + * setting the `fullscreenTarget` property in your game config, or changing the property in the Scale Manager. + * Note that the game canvas _must_ be a child of the target. If you do not give a target, Phaser will + * automatically create a blank `
` element and move the canvas into it, before going fullscreen. + * When it leaves fullscreen, the div will be removed. + * @param fullscreenOptions The FullscreenOptions dictionary is used to provide configuration options when entering full screen. + */ + startFullscreen(fullscreenOptions?: object): void; + + /** + * An internal method that gets the target element that is used when entering fullscreen mode. + */ + getFullscreenTarget(): object; + + /** + * Removes the fullscreen target that was added to the DOM. + */ + removeFullscreenTarget(): void; + + /** + * Calling this method will cancel fullscreen mode, if the browser has entered it. + */ + stopFullscreen(): void; + + /** + * Toggles the fullscreen mode. If already in fullscreen, calling this will cancel it. + * If not in fullscreen, this will request the browser to enter fullscreen mode. + * + * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. + * + * This method _must_ be called from a user-input gesture, such as `pointerdown`. You cannot launch + * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked + * from fullscreen unless the iframe has the `allowfullscreen` attribute. + * @param fullscreenOptions The FullscreenOptions dictionary is used to provide configuration options when entering full screen. + */ + toggleFullscreen(fullscreenOptions?: object): void; + + /** + * An internal method that starts the different DOM event listeners running. + */ + startListeners(): void; + + /** + * Triggered when a fullscreenchange event is dispatched by the DOM. + */ + onFullScreenChange(): void; + + /** + * Triggered when a fullscreenerror event is dispatched by the DOM. + */ + onFullScreenError(): void; + + /** + * Internal method, called automatically by the game step. + * Monitors the elapsed time and resize interval to see if a parent bounds check needs to take place. + * @param time The time value from the most recent Game step. Typically a high-resolution timer value, or Date.now(). + * @param delta The delta value since the last frame. This is smoothed to avoid delta spikes by the TimeStep class. + */ + step(time: number, delta: number): void; + + /** + * Stops all DOM event listeners. + */ + stopListeners(): void; + + /** + * Destroys this Scale Manager, releasing all references to external resources. + * Once destroyed, the Scale Manager cannot be used again. + */ + destroy(): void; + + /** + * Is the browser currently in fullscreen mode or not? + */ + readonly isFullscreen: boolean; + + /** + * The game width. + * + * This is typically the size given in the game configuration. + */ + readonly width: number; + + /** + * The game height. + * + * This is typically the size given in the game configuration. + */ + readonly height: number; + + /** + * Is the device in a portrait orientation as reported by the Orientation API? + * This value is usually only available on mobile devices. + */ + readonly isPortrait: boolean; + + /** + * Is the device in a landscape orientation as reported by the Orientation API? + * This value is usually only available on mobile devices. + */ + readonly isLandscape: boolean; + + /** + * Are the game dimensions portrait? (i.e. taller than they are wide) + * + * This is different to the device itself being in a portrait orientation. + */ + readonly isGamePortrait: boolean; + + /** + * Are the game dimensions landscape? (i.e. wider than they are tall) + * + * This is different to the device itself being in a landscape orientation. + */ + readonly isGameLandscape: boolean; + + } + + /** + * The game canvas is not centered within the parent by Phaser. + * You can still center it yourself via CSS. + */ + const NO_CENTER: integer; + + /** + * The game canvas is centered both horizontally and vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + const CENTER_BOTH: integer; + + /** + * The game canvas is centered horizontally within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + const CENTER_HORIZONTALLY: integer; + + /** + * The game canvas is centered both vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + */ + const CENTER_VERTICALLY: integer; + + /** + * A landscape orientation. + */ + const LANDSCAPE: string; + + /** + * A portrait orientation. + */ + const PORTRAIT: string; + + /** + * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it + * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need + * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. + */ + const NONE: integer; + + /** + * The height is automatically adjusted based on the width. + */ + const WIDTH_CONTROLS_HEIGHT: integer; + + /** + * The width is automatically adjusted based on the height. + */ + const HEIGHT_CONTROLS_WIDTH: integer; + + /** + * The width and height are automatically adjusted to fit inside the given target area, + * while keeping the aspect ratio. Depending on the aspect ratio there may be some space + * inside the area which is not covered. + */ + const FIT: integer; + + /** + * The width and height are automatically adjusted to make the size cover the entire target + * area while keeping the aspect ratio. This may extend further out than the target size. + */ + const ENVELOP: integer; + + /** + * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. + */ + const RESIZE: integer; + + /** + * The game canvas will not be zoomed by Phaser. + */ + const NO_ZOOM: integer; + + /** + * The game canvas will be 2x zoomed by Phaser. + */ + const ZOOM_2X: integer; + + /** + * The game canvas will be 4x zoomed by Phaser. + */ + const ZOOM_4X: integer; + + /** + * Calculate the zoom value based on the maximum multiplied game size that will + * fit into the parent, or browser window if no parent is set. + */ + const MAX_ZOOM: integer; + + } + + namespace Scenes { + /** + * Scene state. + */ + var PENDING: integer; + + /** + * Scene state. + */ + var INIT: integer; + + /** + * Scene state. + */ + var START: integer; + + /** + * Scene state. + */ + var LOADING: integer; + + /** + * Scene state. + */ + var CREATING: integer; + + /** + * Scene state. + */ + var RUNNING: integer; + + /** + * Scene state. + */ + var PAUSED: integer; + + /** + * Scene state. + */ + var SLEEPING: integer; + + /** + * Scene state. + */ + var SHUTDOWN: integer; + + /** + * Scene state. + */ + var DESTROYED: integer; + + namespace Events { + /** + * The Scene Systems Boot Event. + * + * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.scene.events.on('boot', listener)`. + */ + const BOOT: any; + + /** + * The Scene Create Event. + * + * This event is dispatched by a Scene after it has been created by the Scene Manager. + * + * If a Scene has a `create` method then this event is emitted _after_ that has run. + * + * If there is a transition, this event will be fired after the `TRANSITION_START` event. + * + * Listen to it from a Scene using `this.scene.events.on('create', listener)`. + */ + const CREATE: any; + + /** + * The Scene Systems Destroy Event. + * + * This event is dispatched by a Scene during the Scene Systems destroy process. + * + * Listen to it from a Scene using `this.scene.events.on('destroy', listener)`. + * + * You should destroy any resources that may be in use by your Scene in this event handler. + */ + const DESTROY: any; + + /** + * The Scene Systems Pause Event. + * + * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an + * action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('pause', listener)`. + */ + const PAUSE: any; + + /** + * The Scene Systems Post Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + */ + const POST_UPDATE: any; + + /** + * The Scene Systems Pre Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + */ + const PRE_UPDATE: any; + + /** + * The Scene Systems Ready Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. + * By this point in the process the Scene is now fully active and rendering. + * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. + * + * Listen to it from a Scene using `this.scene.events.on('ready', listener)`. + */ + const READY: any; + + /** + * The Scene Systems Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('render', listener)`. + * + * A Scene will only render if it is visible and active. + * By the time this event is dispatched, the Scene will have already been rendered. + */ + const RENDER: any; + + /** + * The Scene Systems Resume Event. + * + * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('resume', listener)`. + */ + const RESUME: any; + + /** + * The Scene Systems Shutdown Event. + * + * This event is dispatched by a Scene during the Scene Systems shutdown process. + * + * Listen to it from a Scene using `this.scene.events.on('shutdown', listener)`. + * + * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding + * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not + * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. + */ + const SHUTDOWN: any; + + /** + * The Scene Systems Sleep Event. + * + * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('sleep', listener)`. + */ + const SLEEP: any; + + /** + * The Scene Systems Start Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.scene.events.on('start', listener)`. + */ + const START: any; + + /** + * The Scene Transition Complete Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration + * of the transition. + * + * Listen to it from a Scene using `this.scene.events.on('transitioncomplete', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_COMPLETE: any; + + /** + * The Scene Transition Init Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, + * this event is not dispatched. + * + * Listen to it from a Scene using `this.scene.events.on('transitioninit', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_INIT: any; + + /** + * The Scene Transition Out Event. + * + * This event is dispatched by a Scene when it initiates a transition to another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('transitionout', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_OUT: any; + + /** + * The Scene Transition Start Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. + * + * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, + * this event is dispatched anyway. + * + * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is + * dispatched instead of this event. + * + * Listen to it from a Scene using `this.scene.events.on('transitionstart', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_START: any; + + /** + * The Scene Transition Wake Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before + * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. + * + * Listen to it from a Scene using `this.scene.events.on('transitionwake', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + */ + const TRANSITION_WAKE: any; + + /** + * The Scene Systems Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + */ + const UPDATE: any; + + /** + * The Scene Systems Wake Event. + * + * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('wake', listener)`. + */ + const WAKE: any; + + } + + /** + * Builds an array of which physics plugins should be activated for the given Scene. + * @param sys The scene system to get the physics systems of. + */ + function GetPhysicsPlugins(sys: Phaser.Scenes.Systems): any[]; + + /** + * Builds an array of which plugins (not including physics plugins) should be activated for the given Scene. + * @param sys The Scene Systems object to check for plugins. + */ + function GetScenePlugins(sys: Phaser.Scenes.Systems): any[]; + + /** + * The Scene Manager. + * + * The Scene Manager is a Game level system, responsible for creating, processing and updating all of the + * Scenes in a Game instance. + */ + class SceneManager { + /** + * + * @param game The Phaser.Game instance this Scene Manager belongs to. + * @param sceneConfig Scene specific configuration settings. + */ + constructor(game: Phaser.Game, sceneConfig: object); + + /** + * The Game that this SceneManager belongs to. + */ + game: Phaser.Game; + + /** + * An object that maps the keys to the scene so we can quickly get a scene from a key without iteration. + */ + keys: object; + + /** + * The array in which all of the scenes are kept. + */ + scenes: any[]; + + /** + * Is the Scene Manager actively processing the Scenes list? + */ + readonly isProcessing: boolean; + + /** + * Has the Scene Manager properly started? + */ + readonly isBooted: boolean; + + /** + * Do any of the Cameras in any of the Scenes require a custom viewport? + * If not we can skip scissor tests. + */ + customViewports: number; + + /** + * Process the Scene operations queue. + */ + processQueue(): void; + + /** + * Adds a new Scene into the SceneManager. + * You must give each Scene a unique key by which you'll identify it. + * + * The `sceneConfig` can be: + * + * * A `Phaser.Scene` object, or an object that extends it. + * * A plain JavaScript object + * * A JavaScript ES6 Class that extends `Phaser.Scene` + * * A JavaScript ES5 prototype based Class + * * A JavaScript function + * + * If a function is given then a new Scene will be created by calling it. + * @param key A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`. + * @param sceneConfig The config for the Scene + * @param autoStart If `true` the Scene will be started immediately after being added. Default false. + * @param data Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`. + */ + add(key: string, sceneConfig: Phaser.Scene | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig | Function, autoStart?: boolean, data?: object): Phaser.Scene; + + /** + * Removes a Scene from the SceneManager. + * + * The Scene is removed from the local scenes array, it's key is cleared from the keys + * cache and Scene.Systems.destroy is then called on it. + * + * If the SceneManager is processing the Scenes when this method is called it will + * queue the operation for the next update sequence. + * @param scene The Scene to be removed. + */ + remove(scene: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Updates the Scenes. + * @param time Time elapsed. + * @param delta Delta time from the last update. + */ + update(time: number, delta: number): void; + + /** + * Renders the Scenes. + * @param renderer The renderer to use. + */ + render(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer): void; + + /** + * Returns an array of all the current Scenes being managed by this Scene Manager. + * + * You can filter the output by the active state of the Scene and choose to have + * the array returned in normal or reversed order. + * @param isActive Only include Scene's that are currently active? Default true. + * @param inReverse Return the array of Scenes in reverse? Default false. + */ + getScenes(isActive?: boolean, inReverse?: boolean): Phaser.Scene[]; + + /** + * Retrieves a Scene. + * @param key The Scene to retrieve. + */ + getScene(key: string | Phaser.Scene): Phaser.Scene; + + /** + * Determines whether a Scene is running. + * @param key The Scene to check. + */ + isActive(key: string): boolean; + + /** + * Determines whether a Scene is paused. + * @param key The Scene to check. + */ + isPaused(key: string): boolean; + + /** + * Determines whether a Scene is visible. + * @param key The Scene to check. + */ + isVisible(key: string): boolean; + + /** + * Determines whether a Scene is sleeping. + * @param key The Scene to check. + */ + isSleeping(key: string): boolean; + + /** + * Pauses the given Scene. + * @param key The Scene to pause. + * @param data An optional data object that will be passed to the Scene and emitted by its pause event. + */ + pause(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Resumes the given Scene. + * @param key The Scene to resume. + * @param data An optional data object that will be passed to the Scene and emitted by its resume event. + */ + resume(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Puts the given Scene to sleep. + * @param key The Scene to put to sleep. + * @param data An optional data object that will be passed to the Scene and emitted by its sleep event. + */ + sleep(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Awakens the given Scene. + * @param key The Scene to wake up. + * @param data An optional data object that will be passed to the Scene and emitted by its wake event. + */ + wake(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Runs the given Scene, but does not change the state of this Scene. + * + * If the given Scene is paused, it will resume it. If sleeping, it will wake it. + * If not running at all, it will be started. + * + * Use this if you wish to open a modal Scene by calling `pause` on the current + * Scene, then `run` on the modal Scene. + * @param key The Scene to run. + * @param data A data object that will be passed to the Scene on start, wake, or resume. + */ + run(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Starts the given Scene. + * @param key The Scene to start. + * @param data Optional data object to pass to Scene.Settings and Scene.init. + */ + start(key: string, data?: object): Phaser.Scenes.SceneManager; + + /** + * Stops the given Scene. + * @param key The Scene to stop. + */ + stop(key: string): Phaser.Scenes.SceneManager; + + /** + * Sleeps one one Scene and starts the other. + * @param from The Scene to sleep. + * @param to The Scene to start. + */ + switch(from: string, to: string): Phaser.Scenes.SceneManager; + + /** + * Retrieves a Scene by numeric index. + * @param index The index of the Scene to retrieve. + */ + getAt(index: integer): Phaser.Scene | undefined; + + /** + * Retrieves the numeric index of a Scene. + * @param key The key of the Scene. + */ + getIndex(key: string | Phaser.Scene): integer; + + /** + * Brings a Scene to the top of the Scenes list. + * + * This means it will render above all other Scenes. + * @param key The Scene to move. + */ + bringToTop(key: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Sends a Scene to the back of the Scenes list. + * + * This means it will render below all other Scenes. + * @param key The Scene to move. + */ + sendToBack(key: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Moves a Scene down one position in the Scenes list. + * @param key The Scene to move. + */ + moveDown(key: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Moves a Scene up one position in the Scenes list. + * @param key The Scene to move. + */ + moveUp(key: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Moves a Scene so it is immediately above another Scene in the Scenes list. + * + * This means it will render over the top of the other Scene. + * @param keyA The Scene that Scene B will be moved above. + * @param keyB The Scene to be moved. + */ + moveAbove(keyA: string | Phaser.Scene, keyB: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Moves a Scene so it is immediately below another Scene in the Scenes list. + * + * This means it will render behind the other Scene. + * @param keyA The Scene that Scene B will be moved above. + * @param keyB The Scene to be moved. + */ + moveBelow(keyA: string | Phaser.Scene, keyB: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Swaps the positions of two Scenes in the Scenes list. + * @param keyA The first Scene to swap. + * @param keyB The second Scene to swap. + */ + swapPosition(keyA: string | Phaser.Scene, keyB: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Dumps debug information about each Scene to the developer console. + */ + dump(): void; + + /** + * Destroy the SceneManager and all of its Scene's systems. + */ + destroy(): void; + + } + + /** + * A proxy class to the Global Scene Manager. + */ + class ScenePlugin { + /** + * + * @param scene The Scene that this ScenePlugin belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene that this ScenePlugin belongs to. + */ + scene: Phaser.Scene; + + /** + * The Scene Systems instance of the Scene that this ScenePlugin belongs to. + */ + systems: Phaser.Scenes.Systems; + + /** + * The settings of the Scene this ScenePlugin belongs to. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * The key of the Scene this ScenePlugin belongs to. + */ + key: string; + + /** + * The Game's SceneManager. + */ + manager: Phaser.Scenes.SceneManager; + + /** + * If this Scene is currently transitioning to another, this holds + * the current percentage of the transition progress, between 0 and 1. + */ + transitionProgress: number; + + /** + * Shutdown this Scene and run the given one. + * @param key The Scene to start. + * @param data The Scene data. + */ + start(key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Restarts this Scene. + * @param data The Scene data. + */ + restart(data?: object): Phaser.Scenes.ScenePlugin; + + /** + * This will start a transition from the current Scene to the target Scene given. + * + * The transition will last for the duration specified in milliseconds. + * + * You can have the target Scene moved above or below this one in the display list. + * + * You can specify an update callback. This callback will be invoked _every frame_ for the duration + * of the transition. + * + * This Scene can either be sent to sleep at the end of the transition, or stopped. The default is to stop. + * + * There are also 5 transition related events: This scene will emit the event `transitionout` when + * the transition begins, which is typically the frame after calling this method. + * + * The target Scene will emit the event `transitioninit` when that Scene's `init` method is called. + * It will then emit the event `transitionstart` when its `create` method is called. + * If the Scene was sleeping and has been woken up, it will emit the event `transitionwake` instead of these two, + * as the Scenes `init` and `create` methods are not invoked when a Scene wakes up. + * + * When the duration of the transition has elapsed it will emit the event `transitioncomplete`. + * These events are cleared of all listeners when the Scene shuts down, but not if it is sent to sleep. + * + * It's important to understand that the duration of the transition begins the moment you call this method. + * If the Scene you are transitioning to includes delayed processes, such as waiting for files to load, the + * time still counts down even while that is happening. If the game itself pauses, or something else causes + * this Scenes update loop to stop, then the transition will also pause for that duration. There are + * checks in place to prevent you accidentally stopping a transitioning Scene but if you've got code to + * override this understand that until the target Scene completes it might never be unlocked for input events. + * @param config The transition configuration object. + */ + transition(config: Phaser.Types.Scenes.SceneTransitionConfig): boolean; + + /** + * Add the Scene into the Scene Manager and start it if 'autoStart' is true or the Scene config 'active' property is set. + * @param key The Scene key. + * @param sceneConfig The config for the Scene. + * @param autoStart Whether to start the Scene after it's added. + * @param data Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`. + */ + add(key: string, sceneConfig: Phaser.Scene | Phaser.Types.Scenes.SettingsConfig | Phaser.Types.Scenes.CreateSceneFromObjectConfig | Function, autoStart: boolean, data?: object): Phaser.Scene; + + /** + * Launch the given Scene and run it in parallel with this one. + * @param key The Scene to launch. + * @param data The Scene data. + */ + launch(key: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Runs the given Scene, but does not change the state of this Scene. + * + * If the given Scene is paused, it will resume it. If sleeping, it will wake it. + * If not running at all, it will be started. + * + * Use this if you wish to open a modal Scene by calling `pause` on the current + * Scene, then `run` on the modal Scene. + * @param key The Scene to run. + * @param data A data object that will be passed to the Scene and emitted in its ready, wake, or resume events. + */ + run(key: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Pause the Scene - this stops the update step from happening but it still renders. + * @param key The Scene to pause. + * @param data An optional data object that will be passed to the Scene and emitted in its pause event. + */ + pause(key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Resume the Scene - starts the update loop again. + * @param key The Scene to resume. + * @param data An optional data object that will be passed to the Scene and emitted in its resume event. + */ + resume(key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Makes the Scene sleep (no update, no render) but doesn't shutdown. + * @param key The Scene to put to sleep. + * @param data An optional data object that will be passed to the Scene and emitted in its sleep event. + */ + sleep(key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Makes the Scene wake-up (starts update and render) + * @param key The Scene to wake up. + * @param data An optional data object that will be passed to the Scene and emitted in its wake event. + */ + wake(key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Makes this Scene sleep then starts the Scene given. + * + * No checks are made to see if an instance of the given Scene is already running. + * Because Scenes in Phaser are non-exclusive, you are allowed to run multiple + * instances of them _at the same time_. This means, calling this function + * may launch another instance of the requested Scene if it's already running. + * @param key The Scene to start. + */ + switch(key: string): Phaser.Scenes.ScenePlugin; + + /** + * Shutdown the Scene, clearing display list, timers, etc. + * @param key The Scene to stop. + */ + stop(key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Sets the active state of the given Scene. + * @param value If `true` the Scene will be resumed. If `false` it will be paused. + * @param key The Scene to set the active state of. + * @param data An optional data object that will be passed to the Scene and emitted with its events. + */ + setActive(value: boolean, key?: string, data?: object): Phaser.Scenes.ScenePlugin; + + /** + * Sets the visible state of the given Scene. + * @param value The visible value. + * @param key The Scene to set the visible state for. + */ + setVisible(value: boolean, key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Checks if the given Scene is sleeping or not? + * @param key The Scene to check. + */ + isSleeping(key?: string): boolean; + + /** + * Checks if the given Scene is running or not? + * @param key The Scene to check. + */ + isActive(key?: string): boolean; + + /** + * Checks if the given Scene is paused or not? + * @param key The Scene to check. + */ + isPaused(key?: string): boolean; + + /** + * Checks if the given Scene is visible or not? + * @param key The Scene to check. + */ + isVisible(key?: string): boolean; + + /** + * Swaps the position of two scenes in the Scenes list. + * + * This controls the order in which they are rendered and updated. + * @param keyA The first Scene to swap. + * @param keyB The second Scene to swap. If none is given it defaults to this Scene. + */ + swapPosition(keyA: string, keyB?: string): Phaser.Scenes.ScenePlugin; + + /** + * Swaps the position of two scenes in the Scenes list, so that Scene B is directly above Scene A. + * + * This controls the order in which they are rendered and updated. + * @param keyA The Scene that Scene B will be moved to be above. + * @param keyB The Scene to be moved. If none is given it defaults to this Scene. + */ + moveAbove(keyA: string, keyB?: string): Phaser.Scenes.ScenePlugin; + + /** + * Swaps the position of two scenes in the Scenes list, so that Scene B is directly below Scene A. + * + * This controls the order in which they are rendered and updated. + * @param keyA The Scene that Scene B will be moved to be below. + * @param keyB The Scene to be moved. If none is given it defaults to this Scene. + */ + moveBelow(keyA: string, keyB?: string): Phaser.Scenes.ScenePlugin; + + /** + * Removes a Scene from the SceneManager. + * + * The Scene is removed from the local scenes array, it's key is cleared from the keys + * cache and Scene.Systems.destroy is then called on it. + * + * If the SceneManager is processing the Scenes when this method is called it wil + * queue the operation for the next update sequence. + * @param key The Scene to be removed. + */ + remove(key?: string | Phaser.Scene): Phaser.Scenes.SceneManager; + + /** + * Moves a Scene up one position in the Scenes list. + * @param key The Scene to move. + */ + moveUp(key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Moves a Scene down one position in the Scenes list. + * @param key The Scene to move. + */ + moveDown(key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Brings a Scene to the top of the Scenes list. + * + * This means it will render above all other Scenes. + * @param key The Scene to move. + */ + bringToTop(key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Sends a Scene to the back of the Scenes list. + * + * This means it will render below all other Scenes. + * @param key The Scene to move. + */ + sendToBack(key?: string): Phaser.Scenes.ScenePlugin; + + /** + * Retrieve a Scene. + * @param key The Scene to retrieve. + */ + get(key: string): Phaser.Scene; + + /** + * Retrieves the numeric index of a Scene in the Scenes list. + * @param key The Scene to get the index of. + */ + getIndex(key?: string | Phaser.Scene): integer; + + } + + namespace Settings { + /** + * Takes a Scene configuration object and returns a fully formed System Settings object. + * @param config The Scene configuration object used to create this Scene Settings. + */ + function create(config: string | Phaser.Types.Scenes.SettingsConfig): Phaser.Types.Scenes.SettingsObject; + + } + + /** + * The Scene Systems class. + * + * This class is available from within a Scene under the property `sys`. + * It is responsible for managing all of the plugins a Scene has running, including the display list, and + * handling the update step and renderer. It also contains references to global systems belonging to Game. + */ + class Systems { + /** + * + * @param scene The Scene that owns this Systems instance. + * @param config Scene specific configuration settings. + */ + constructor(scene: Phaser.Scene, config: string | Phaser.Types.Scenes.SettingsConfig); + + /** + * A reference to the Scene that these Systems belong to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Phaser Game instance. + */ + game: Phaser.Game; + + /** + * A reference to either the Canvas or WebGL Renderer that this Game is using. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The Facebook Instant Games Plugin. + */ + facebook: Phaser.FacebookInstantGamesPlugin; + + /** + * The Scene Configuration object, as passed in when creating the Scene. + */ + config: string | Phaser.Types.Scenes.SettingsConfig; + + /** + * The Scene Settings. This is the parsed output based on the Scene configuration. + */ + settings: Phaser.Types.Scenes.SettingsObject; + + /** + * A handy reference to the Scene canvas / context. + */ + canvas: HTMLCanvasElement; + + /** + * A reference to the Canvas Rendering Context being used by the renderer. + */ + context: CanvasRenderingContext2D; + + /** + * A reference to the global Animations Manager. + * + * In the default set-up you can access this from within a Scene via the `this.anims` property. + */ + anims: Phaser.Animations.AnimationManager; + + /** + * A reference to the global Cache. The Cache stores all files bought in to Phaser via + * the Loader, with the exception of images. Images are stored in the Texture Manager. + * + * In the default set-up you can access this from within a Scene via the `this.cache` property. + */ + cache: Phaser.Cache.CacheManager; + + /** + * A reference to the global Plugins Manager. + * + * In the default set-up you can access this from within a Scene via the `this.plugins` property. + */ + plugins: Phaser.Plugins.PluginManager; + + /** + * A reference to the global registry. This is a game-wide instance of the Data Manager, allowing + * you to exchange data between Scenes via a universal and shared point. + * + * In the default set-up you can access this from within a Scene via the `this.registry` property. + */ + registry: Phaser.Data.DataManager; + + /** + * A reference to the global Scale Manager. + * + * In the default set-up you can access this from within a Scene via the `this.scale` property. + */ + scale: Phaser.Scale.ScaleManager; + + /** + * A reference to the global Sound Manager. + * + * In the default set-up you can access this from within a Scene via the `this.sound` property. + */ + sound: Phaser.Sound.BaseSoundManager; + + /** + * A reference to the global Texture Manager. + * + * In the default set-up you can access this from within a Scene via the `this.textures` property. + */ + textures: Phaser.Textures.TextureManager; + + /** + * A reference to the Scene's Game Object Factory. + * + * Use this to quickly and easily create new Game Object's. + * + * In the default set-up you can access this from within a Scene via the `this.add` property. + */ + add: Phaser.GameObjects.GameObjectFactory; + + /** + * A reference to the Scene's Camera Manager. + * + * Use this to manipulate and create Cameras for this specific Scene. + * + * In the default set-up you can access this from within a Scene via the `this.cameras` property. + */ + cameras: Phaser.Cameras.Scene2D.CameraManager; + + /** + * A reference to the Scene's Display List. + * + * Use this to organize the children contained in the display list. + * + * In the default set-up you can access this from within a Scene via the `this.children` property. + */ + displayList: Phaser.GameObjects.DisplayList; + + /** + * A reference to the Scene's Event Manager. + * + * Use this to listen for Scene specific events, such as `pause` and `shutdown`. + * + * In the default set-up you can access this from within a Scene via the `this.events` property. + */ + events: Phaser.Events.EventEmitter; + + /** + * A reference to the Scene's Game Object Creator. + * + * Use this to quickly and easily create new Game Object's. The difference between this and the + * Game Object Factory, is that the Creator just creates and returns Game Object instances, it + * doesn't then add them to the Display List or Update List. + * + * In the default set-up you can access this from within a Scene via the `this.make` property. + */ + make: Phaser.GameObjects.GameObjectCreator; + + /** + * A reference to the Scene Manager Plugin. + * + * Use this to manipulate both this and other Scene's in your game, for example to launch a parallel Scene, + * or pause or resume a Scene, or switch from this Scene to another. + * + * In the default set-up you can access this from within a Scene via the `this.scene` property. + */ + scenePlugin: Phaser.Scenes.ScenePlugin; + + /** + * A reference to the Scene's Update List. + * + * Use this to organize the children contained in the update list. + * + * The Update List is responsible for managing children that need their `preUpdate` methods called, + * in order to process so internal components, such as Sprites with Animations. + * + * In the default set-up there is no reference to this from within the Scene itself. + */ + updateList: Phaser.GameObjects.UpdateList; + + /** + * This method is called only once by the Scene Manager when the Scene is instantiated. + * It is responsible for setting up all of the Scene plugins and references. + * It should never be called directly. + * @param game A reference to the Phaser Game instance. + */ + protected init(game: Phaser.Game): void; + + /** + * A single game step. Called automatically by the Scene Manager as a result of a Request Animation + * Frame or Set Timeout call to the main Game instance. + * @param time The time value from the most recent Game step. Typically a high-resolution timer value, or Date.now(). + * @param delta The delta value since the last frame. This is smoothed to avoid delta spikes by the TimeStep class. + */ + step(time: number, delta: number): void; + + /** + * Called automatically by the Scene Manager. + * Instructs the Scene to render itself via its Camera Manager to the renderer given. + * @param renderer The renderer that invoked the render call. + */ + render(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer): void; + + /** + * Force a sort of the display list on the next render. + */ + queueDepthSort(): void; + + /** + * Immediately sorts the display list if the flag is set. + */ + depthSort(): void; + + /** + * Pause this Scene. + * A paused Scene still renders, it just doesn't run ANY of its update handlers or systems. + * @param data A data object that will be passed in the 'pause' event. + */ + pause(data?: object): Phaser.Scenes.Systems; + + /** + * Resume this Scene from a paused state. + * @param data A data object that will be passed in the 'resume' event. + */ + resume(data?: object): Phaser.Scenes.Systems; + + /** + * Send this Scene to sleep. + * + * A sleeping Scene doesn't run it's update step or render anything, but it also isn't shut down + * or have any of its systems or children removed, meaning it can be re-activated at any point and + * will carry on from where it left off. It also keeps everything in memory and events and callbacks + * from other Scenes may still invoke changes within it, so be careful what is left active. + * @param data A data object that will be passed in the 'sleep' event. + */ + sleep(data?: object): Phaser.Scenes.Systems; + + /** + * Wake-up this Scene if it was previously asleep. + * @param data A data object that will be passed in the 'wake' event. + */ + wake(data?: object): Phaser.Scenes.Systems; + + /** + * Is this Scene sleeping? + */ + isSleeping(): boolean; + + /** + * Is this Scene running? + */ + isActive(): boolean; + + /** + * Is this Scene paused? + */ + isPaused(): boolean; + + /** + * Is this Scene currently transitioning out to, or in from another Scene? + */ + isTransitioning(): boolean; + + /** + * Is this Scene currently transitioning out from itself to another Scene? + */ + isTransitionOut(): boolean; + + /** + * Is this Scene currently transitioning in from another Scene? + */ + isTransitionIn(): boolean; + + /** + * Is this Scene visible and rendering? + */ + isVisible(): boolean; + + /** + * Sets the visible state of this Scene. + * An invisible Scene will not render, but will still process updates. + * @param value `true` to render this Scene, otherwise `false`. + */ + setVisible(value: boolean): Phaser.Scenes.Systems; + + /** + * Set the active state of this Scene. + * + * An active Scene will run its core update loop. + * @param value If `true` the Scene will be resumed, if previously paused. If `false` it will be paused. + * @param data A data object that will be passed in the 'resume' or 'pause' events. + */ + setActive(value: boolean, data?: object): Phaser.Scenes.Systems; + + /** + * Start this Scene running and rendering. + * Called automatically by the SceneManager. + * @param data Optional data object that may have been passed to this Scene from another. + */ + start(data: object): void; + + /** + * Shutdown this Scene and send a shutdown event to all of its systems. + * A Scene that has been shutdown will not run its update loop or render, but it does + * not destroy any of its plugins or references. It is put into hibernation for later use. + * If you don't ever plan to use this Scene again, then it should be destroyed instead + * to free-up resources. + * @param data A data object that will be passed in the 'shutdown' event. + */ + shutdown(data?: object): void; + + } + + } + + /** + * A base Phaser.Scene class which can be extended for your own use. + */ + class Scene { + /** + * + * @param config Scene specific configuration settings. + */ + constructor(config: string | Phaser.Types.Scenes.SettingsConfig); + + /** + * The Scene Systems. You must never overwrite this property, or all hell will break lose. + */ + sys: Phaser.Scenes.Systems; + + /** + * A reference to the Phaser.Game instance. + * This property will only be available if defined in the Scene Injection Map. + */ + game: Phaser.Game; + + /** + * A reference to the global Animation Manager. + * This property will only be available if defined in the Scene Injection Map. + */ + anims: Phaser.Animations.AnimationManager; + + /** + * A reference to the global Cache. + * This property will only be available if defined in the Scene Injection Map. + */ + cache: Phaser.Cache.CacheManager; + + /** + * A reference to the game level Data Manager. + * This property will only be available if defined in the Scene Injection Map. + */ + registry: Phaser.Data.DataManager; + + /** + * A reference to the Sound Manager. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + sound: Phaser.Sound.BaseSoundManager; + + /** + * A reference to the Texture Manager. + * This property will only be available if defined in the Scene Injection Map. + */ + textures: Phaser.Textures.TextureManager; + + /** + * A scene level Event Emitter. + * This property will only be available if defined in the Scene Injection Map. + */ + events: Phaser.Events.EventEmitter; + + /** + * A scene level Camera System. + * This property will only be available if defined in the Scene Injection Map. + */ + cameras: Phaser.Cameras.Scene2D.CameraManager; + + /** + * A scene level Game Object Factory. + * This property will only be available if defined in the Scene Injection Map. + */ + add: Phaser.GameObjects.GameObjectFactory; + + /** + * A scene level Game Object Creator. + * This property will only be available if defined in the Scene Injection Map. + */ + make: Phaser.GameObjects.GameObjectCreator; + + /** + * A reference to the Scene Manager Plugin. + * This property will only be available if defined in the Scene Injection Map. + */ + scene: Phaser.Scenes.ScenePlugin; + + /** + * A scene level Game Object Display List. + * This property will only be available if defined in the Scene Injection Map. + */ + children: Phaser.GameObjects.DisplayList; + + /** + * A scene level Lights Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + lights: Phaser.GameObjects.LightsManager; + + /** + * A scene level Data Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + data: Phaser.Data.DataManager; + + /** + * A scene level Input Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + input: Phaser.Input.InputPlugin; + + /** + * A scene level Loader Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + load: Phaser.Loader.LoaderPlugin; + + /** + * A scene level Time and Clock Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + time: Phaser.Time.Clock; + + /** + * A scene level Tween Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + */ + tweens: Phaser.Tweens.TweenManager; + + /** + * A scene level Arcade Physics Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + physics: Phaser.Physics.Arcade.ArcadePhysics; + + /** + * A scene level Impact Physics Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + impact: Phaser.Physics.Impact.ImpactPhysics; + + /** + * A scene level Matter Physics Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + matter: Phaser.Physics.Matter.MatterPhysics; + + /** + * A scene level Facebook Instant Games Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + */ + facebook: Phaser.FacebookInstantGamesPlugin; + + /** + * A reference to the global Scale Manager. + * This property will only be available if defined in the Scene Injection Map. + */ + scale: Phaser.Scale.ScaleManager; + + /** + * A reference to the Plugin Manager. + * + * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install + * those plugins into Scenes as required. + */ + plugins: Phaser.Plugins.PluginManager; + + /** + * Should be overridden by your own Scenes. + * This method is called once per game step while the scene is running. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(time: number, delta: number): void; + + } + + namespace Sound { + /** + * Class containing all the shared state and behavior of a sound object, independent of the implementation. + */ + class BaseSound extends Phaser.Events.EventEmitter { + /** + * + * @param manager Reference to the current sound manager instance. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. + */ + constructor(manager: Phaser.Sound.BaseSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + + /** + * Asset key for the sound. + */ + readonly key: string; + + /** + * Flag indicating if sound is currently playing. + */ + readonly isPlaying: boolean; + + /** + * Flag indicating if sound is currently paused. + */ + readonly isPaused: boolean; + + /** + * A property that holds the value of sound's actual playback rate, + * after its rate and detune values has been combined with global + * rate and detune values. + */ + readonly totalRate: number; + + /** + * A value representing the duration, in seconds. + * It could be total sound duration or a marker duration. + */ + readonly duration: number; + + /** + * The total duration of the sound in seconds. + */ + readonly totalDuration: number; + + /** + * Object containing markers definitions. + */ + readonly markers: {[key: string]: Phaser.Types.Sound.SoundMarker}; + + /** + * Currently playing marker. + * 'null' if whole sound is playing. + */ + readonly currentMarker: Phaser.Types.Sound.SoundMarker; + + /** + * Adds a marker into the current sound. A marker is represented by name, start time, duration, and optionally config object. + * This allows you to bundle multiple sounds together into a single audio file and use markers to jump between them for playback. + * @param marker Marker object. + */ + addMarker(marker: Phaser.Types.Sound.SoundMarker): boolean; + + /** + * Updates previously added marker. + * @param marker Marker object with updated values. + */ + updateMarker(marker: Phaser.Types.Sound.SoundMarker): boolean; + + /** + * Removes a marker from the sound. + * @param markerName The name of the marker to remove. + */ + removeMarker(markerName: string): Phaser.Types.Sound.SoundMarker; + + /** + * Play this sound, or a marked section of it. + * It always plays the sound from the start. If you want to start playback from a specific time + * you can set 'seek' setting of the config object, provided to this call, to that value. + * @param markerName If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound. Default ''. + * @param config Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound. + */ + play(markerName?: string, config?: Phaser.Types.Sound.SoundConfig): boolean; + + /** + * Pauses the sound. + */ + pause(): boolean; + + /** + * Resumes the sound. + */ + resume(): boolean; + + /** + * Stop playing this sound. + */ + stop(): boolean; + + /** + * Method used internally for applying config values to some of the sound properties. + */ + protected applyConfig(): void; + + /** + * Method used internally for resetting values of some of the config properties. + */ + protected resetConfig(): void; + + /** + * Update method called automatically by sound manager on every game step. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time elapsed since the last frame. + */ + protected update(time: number, delta: number): void; + + /** + * Method used internally to calculate total playback rate of the sound. + */ + protected calculateRate(): void; + + /** + * Destroys this sound and all associated events and marks it for removal from the sound manager. + */ + destroy(): void; + + } + + /** + * The sound manager is responsible for playing back audio via Web Audio API or HTML Audio tag as fallback. + * The audio file type and the encoding of those files are extremely important. + * + * Not all browsers can play all audio formats. + * + * There is a good guide to what's supported [here](https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Cross-browser_audio_basics#Audio_Codec_Support). + */ + class BaseSoundManager extends Phaser.Events.EventEmitter { + /** + * + * @param game Reference to the current game instance. + */ + constructor(game: Phaser.Game); + + /** + * Local reference to game. + */ + readonly game: Phaser.Game; + + /** + * Local reference to the JSON Cache, as used by Audio Sprites. + */ + readonly jsonCache: Phaser.Cache.BaseCache; + + /** + * Global mute setting. + */ + mute: boolean; + + /** + * Global volume setting. + */ + volume: number; + + /** + * Flag indicating if sounds should be paused when game looses focus, + * for instance when user switches to another tab/program/app. + */ + pauseOnBlur: boolean; + + /** + * Mobile devices require sounds to be triggered from an explicit user action, + * such as a tap, before any sound can be loaded/played on a web page. + * Set to true if the audio system is currently locked awaiting user interaction. + */ + readonly locked: boolean; + + /** + * Adds a new sound into the sound manager. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. + */ + add(key: string, config?: Phaser.Types.Sound.SoundConfig): Phaser.Sound.BaseSound; + + /** + * Adds a new audio sprite sound into the sound manager. + * Audio Sprites are a combination of audio files and a JSON configuration. + * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. + */ + addAudioSprite(key: string, config?: Phaser.Types.Sound.SoundConfig): Phaser.Types.Sound.AudioSpriteSound; + + /** + * Enables playing sound on the fly without the need to keep a reference to it. + * Sound will auto destroy once its playback ends. + * @param key Asset key for the sound. + * @param extra An optional additional object containing settings to be applied to the sound. It could be either config or marker object. + */ + play(key: string, extra?: Phaser.Types.Sound.SoundConfig | Phaser.Types.Sound.SoundMarker): boolean; + + /** + * Enables playing audio sprite sound on the fly without the need to keep a reference to it. + * Sound will auto destroy once its playback ends. + * @param key Asset key for the sound. + * @param spriteName The name of the sound sprite to play. + * @param config An optional config object containing default sound settings. + */ + playAudioSprite(key: string, spriteName: string, config?: Phaser.Types.Sound.SoundConfig): boolean; + + /** + * Removes a sound from the sound manager. + * The removed sound is destroyed before removal. + * @param sound The sound object to remove. + */ + remove(sound: Phaser.Sound.BaseSound): boolean; + + /** + * Removes all sounds from the sound manager that have an asset key matching the given value. + * The removed sounds are destroyed before removal. + * @param key The key to match when removing sound objects. + */ + removeByKey(key: string): number; + + /** + * Pauses all the sounds in the game. + */ + pauseAll(): void; + + /** + * Resumes all the sounds in the game. + */ + resumeAll(): void; + + /** + * Stops all the sounds in the game. + */ + stopAll(): void; + + /** + * Method used internally for unlocking audio playback on devices that + * require user interaction before any sound can be played on a web page. + * + * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09). + */ + protected unlock(): void; + + /** + * Method used internally for pausing sound manager if + * Phaser.Sound.BaseSoundManager#pauseOnBlur is set to true. + */ + protected onBlur(): void; + + /** + * Method used internally for resuming sound manager if + * Phaser.Sound.BaseSoundManager#pauseOnBlur is set to true. + */ + protected onFocus(): void; + + /** + * Update method called on every game step. + * Removes destroyed sounds and updates every active sound in the game. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time elapsed since the last frame. + */ + protected update(time: number, delta: number): void; + + /** + * Destroys all the sounds in the game and all associated events. + */ + destroy(): void; + + /** + * Sets the global playback rate at which all the sounds will be played. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * @param value Global playback rate at which all the sounds will be played. + */ + setRate(value: number): Phaser.Sound.BaseSoundManager; + + /** + * Global playback rate at which all the sounds will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audio's playback speed. + */ + rate: number; + + /** + * Sets the global detuning of all sounds in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * @param value The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + setDetune(value: number): Phaser.Sound.BaseSoundManager; + + /** + * Global detuning of all sounds in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + detune: number; + + } + + namespace Events { + /** + * The Sound Complete Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they complete playback. + * + * Listen to it from a Sound instance using `Sound.on('complete', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('complete', listener); + * music.play(); + * ``` + */ + const COMPLETE: any; + + /** + * The Audio Data Decoded All Event. + * + * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method, + * once all files passed to the method have been decoded (or errored). + * + * Use `Phaser.Sound.Events#DECODED` to listen for single sounds being decoded, and `DECODED_ALL` to + * listen for them all completing. + * + * Listen to it from the Sound Manager in a Scene using `this.sound.on('decodedall', listener)`, i.e.: + * + * ```javascript + * this.sound.once('decodedall', handler); + * this.sound.decodeAudio([ audioFiles ]); + * ``` + */ + const DECODED_ALL: any; + + /** + * The Audio Data Decoded Event. + * + * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method. + * + * Listen to it from the Sound Manager in a Scene using `this.sound.on('decoded', listener)`, i.e.: + * + * ```javascript + * this.sound.on('decoded', handler); + * this.sound.decodeAudio(key, audioData); + * ``` + */ + const DECODED: any; + + /** + * The Sound Destroy Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are destroyed, either + * directly or via a Sound Manager. + * + * Listen to it from a Sound instance using `Sound.on('destroy', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('destroy', listener); + * music.destroy(); + * ``` + */ + const DESTROY: any; + + /** + * The Sound Detune Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their detune value changes. + * + * Listen to it from a Sound instance using `Sound.on('detune', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('detune', listener); + * music.play(); + * music.setDetune(200); + * ``` + */ + const DETUNE: any; + + /** + * The Sound Manager Global Detune Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `detune` property of the Sound Manager is changed, which globally + * adjusts the detuning of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('rate', listener)`. + */ + const GLOBAL_DETUNE: any; + + /** + * The Sound Manager Global Mute Event. + * + * This event is dispatched by the Sound Manager when its `mute` property is changed, either directly + * or via the `setMute` method. This changes the mute state of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('mute', listener)`. + */ + const GLOBAL_MUTE: any; + + /** + * The Sound Manager Global Rate Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `rate` property of the Sound Manager is changed, which globally + * adjusts the playback rate of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('rate', listener)`. + */ + const GLOBAL_RATE: any; + + /** + * The Sound Manager Global Volume Event. + * + * This event is dispatched by the Sound Manager when its `volume` property is changed, either directly + * or via the `setVolume` method. This changes the volume of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('volume', listener)`. + */ + const GLOBAL_VOLUME: any; + + /** + * The Sound Looped Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they loop during playback. + * + * Listen to it from a Sound instance using `Sound.on('looped', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('looped', listener); + * music.setLoop(true); + * music.play(); + * ``` + * + * This is not to be confused with the [LOOP]{@linkcode Phaser.Sound.Events#event:LOOP} event, which only emits when the loop state of a Sound is changed. + */ + const LOOPED: any; + + /** + * The Sound Loop Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed. + * + * Listen to it from a Sound instance using `Sound.on('loop', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('loop', listener); + * music.setLoop(true); + * ``` + * + * This is not to be confused with the [LOOPED]{@linkcode Phaser.Sound.Events#event:LOOPED} event, which emits each time a Sound loops during playback. + */ + const LOOP: any; + + /** + * The Sound Mute Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their mute state changes. + * + * Listen to it from a Sound instance using `Sound.on('mute', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('mute', listener); + * music.play(); + * music.setMute(true); + * ``` + */ + const MUTE: any; + + /** + * The Pause All Sounds Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `pauseAll` method is invoked and after all current Sounds + * have been paused. + * + * Listen to it from a Scene using: `this.sound.on('pauseall', listener)`. + */ + const PAUSE_ALL: any; + + /** + * The Sound Pause Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are paused. + * + * Listen to it from a Sound instance using `Sound.on('pause', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('pause', listener); + * music.play(); + * music.pause(); + * ``` + */ + const PAUSE: any; + + /** + * The Sound Play Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are played. + * + * Listen to it from a Sound instance using `Sound.on('play', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('play', listener); + * music.play(); + * ``` + */ + const PLAY: any; + + /** + * The Sound Rate Change Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their rate changes. + * + * Listen to it from a Sound instance using `Sound.on('rate', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('rate', listener); + * music.play(); + * music.setRate(0.5); + * ``` + */ + const RATE: any; + + /** + * The Resume All Sounds Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `resumeAll` method is invoked and after all current Sounds + * have been resumed. + * + * Listen to it from a Scene using: `this.sound.on('resumeall', listener)`. + */ + const RESUME_ALL: any; + + /** + * The Sound Resume Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are resumed from a paused state. + * + * Listen to it from a Sound instance using `Sound.on('resume', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('resume', listener); + * music.play(); + * music.pause(); + * music.resume(); + * ``` + */ + const RESUME: any; + + /** + * The Sound Seek Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are seeked to a new position. + * + * Listen to it from a Sound instance using `Sound.on('seek', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('seek', listener); + * music.play(); + * music.setSeek(5000); + * ``` + */ + const SEEK: any; + + /** + * The Stop All Sounds Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `stopAll` method is invoked and after all current Sounds + * have been stopped. + * + * Listen to it from a Scene using: `this.sound.on('stopall', listener)`. + */ + const STOP_ALL: any; + + /** + * The Sound Stop Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are stopped. + * + * Listen to it from a Sound instance using `Sound.on('stop', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('stop', listener); + * music.play(); + * music.stop(); + * ``` + */ + const STOP: any; + + /** + * The Sound Manager Unlocked Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched during the update loop when the Sound Manager becomes unlocked. For + * Web Audio this is on the first user gesture on the page. + * + * Listen to it from a Scene using: `this.sound.on('unlocked', listener)`. + */ + const UNLOCKED: any; + + /** + * The Sound Volume Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes. + * + * Listen to it from a Sound instance using `Sound.on('volume', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('volume', listener); + * music.play(); + * music.setVolume(0.5); + * ``` + */ + const VOLUME: any; + + } + + /** + * HTML5 Audio implementation of the sound. + */ + class HTML5AudioSound extends Phaser.Sound.BaseSound { + /** + * + * @param manager Reference to the current sound manager instance. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. Default {}. + */ + constructor(manager: Phaser.Sound.HTML5AudioSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + + /** + * Play this sound, or a marked section of it. + * It always plays the sound from the start. If you want to start playback from a specific time + * you can set 'seek' setting of the config object, provided to this call, to that value. + * @param markerName If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound. Default ''. + * @param config Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound. + */ + play(markerName?: string, config?: Phaser.Types.Sound.SoundConfig): boolean; + + /** + * Pauses the sound. + */ + pause(): boolean; + + /** + * Resumes the sound. + */ + resume(): boolean; + + /** + * Stop playing this sound. + */ + stop(): boolean; + + /** + * Update method called automatically by sound manager on every game step. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time elapsed since the last frame. + */ + protected update(time: number, delta: number): void; + + /** + * Calls Phaser.Sound.BaseSound#destroy method + * and cleans up all HTML5 Audio related stuff. + */ + destroy(): void; + + /** + * Method used internally to calculate total playback rate of the sound. + */ + protected calculateRate(): void; + + /** + * Boolean indicating whether the sound is muted or not. + * Gets or sets the muted state of this sound. + */ + mute: boolean; + + /** + * Sets the muted state of this Sound. + * @param value `true` to mute this sound, `false` to unmute it. + */ + setMute(value: boolean): Phaser.Sound.HTML5AudioSound; + + /** + * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume). + */ + volume: number; + + /** + * Sets the volume of this Sound. + * @param value The volume of the sound. + */ + setVolume(value: number): Phaser.Sound.HTML5AudioSound; + + /** + * Rate at which this Sound will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + */ + rate: number; + + /** + * Sets the playback rate of this Sound. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * @param value The playback rate at of this Sound. + */ + setRate(value: number): Phaser.Sound.HTML5AudioSound; + + /** + * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + detune: number; + + /** + * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * @param value The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + setDetune(value: number): Phaser.Sound.HTML5AudioSound; + + /** + * Property representing the position of playback for this sound, in seconds. + * Setting it to a specific value moves current playback to that position. + * The value given is clamped to the range 0 to current marker duration. + * Setting seek of a stopped sound has no effect. + */ + seek: number; + + /** + * Seeks to a specific point in this sound. + * @param value The point in the sound to seek to. + */ + setSeek(value: number): Phaser.Sound.HTML5AudioSound; + + /** + * Flag indicating whether or not the sound or current sound marker will loop. + */ + loop: boolean; + + /** + * Sets the loop state of this Sound. + * @param value `true` to loop this sound, `false` to not loop it. + */ + setLoop(value: boolean): Phaser.Sound.HTML5AudioSound; + + } + + /** + * HTML5AudioSoundManager + */ + class HTML5AudioSoundManager extends Phaser.Sound.BaseSoundManager { + /** + * + * @param game Reference to the current game instance. + */ + constructor(game: Phaser.Game); + + /** + * Flag indicating whether if there are no idle instances of HTML5 Audio tag, + * for any particular sound, if one of the used tags should be hijacked and used + * for succeeding playback or if succeeding Phaser.Sound.HTML5AudioSound#play + * call should be ignored. + */ + override: boolean; + + /** + * Value representing time difference, in seconds, between calling + * play method on an audio tag and when it actually starts playing. + * It is used to achieve more accurate delayed sound playback. + * + * You might need to tweak this value to get the desired results + * since audio play delay varies depending on the browser/platform. + */ + audioPlayDelay: number; + + /** + * A value by which we should offset the loop end marker of the + * looping sound to compensate for lag, caused by changing audio + * tag playback position, in order to achieve gapless looping. + * + * You might need to tweak this value to get the desired results + * since loop lag varies depending on the browser/platform. + */ + loopEndOffset: number; + + /** + * Adds a new sound into the sound manager. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. + */ + add(key: string, config?: Phaser.Types.Sound.SoundConfig): Phaser.Sound.HTML5AudioSound; + + /** + * Unlocks HTML5 Audio loading and playback on mobile + * devices on the initial explicit user interaction. + */ + unlock(): void; + + /** + * Method used internally for pausing sound manager if + * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. + */ + protected onBlur(): void; + + /** + * Method used internally for resuming sound manager if + * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. + */ + protected onFocus(): void; + + /** + * Calls Phaser.Sound.BaseSoundManager#destroy method + * and cleans up all HTML5 Audio related stuff. + */ + destroy(): void; + + /** + * Method used internally by Phaser.Sound.HTML5AudioSound class methods and property setters + * to check if sound manager is locked and then either perform action immediately or queue it + * to be performed once the sound manager gets unlocked. + * @param sound Sound object on which to perform queued action. + * @param prop Name of the method to be called or property to be assigned a value to. + * @param value An optional parameter that either holds an array of arguments to be passed to the method call or value to be set to the property. + */ + protected isLocked(sound: Phaser.Sound.HTML5AudioSound, prop: string, value?: any): boolean; + + /** + * Sets the muted state of all this Sound Manager. + * @param value `true` to mute all sounds, `false` to unmute them. + */ + setMute(value: boolean): Phaser.Sound.HTML5AudioSoundManager; + + mute: boolean; + + /** + * Sets the volume of this Sound Manager. + * @param value The global volume of this Sound Manager. + */ + setVolume(value: number): Phaser.Sound.HTML5AudioSoundManager; + + volume: number; + + } + + /** + * No audio implementation of the sound. It is used if audio has been + * disabled in the game config or the device doesn't support any audio. + * + * It represents a graceful degradation of sound logic that provides + * minimal functionality and prevents Phaser projects that use audio from + * breaking on devices that don't support any audio playback technologies. + */ + class NoAudioSound extends Phaser.Sound.BaseSound { + /** + * + * @param manager Reference to the current sound manager instance. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. Default {}. + */ + constructor(manager: Phaser.Sound.NoAudioSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + + } + + /** + * No audio implementation of the sound manager. It is used if audio has been + * disabled in the game config or the device doesn't support any audio. + * + * It represents a graceful degradation of sound manager logic that provides + * minimal functionality and prevents Phaser projects that use audio from + * breaking on devices that don't support any audio playback technologies. + */ + class NoAudioSoundManager extends Phaser.Sound.BaseSoundManager { + /** + * + * @param game Reference to the current game instance. + */ + constructor(game: Phaser.Game); + + } + + /** + * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings. + * + * Be aware of https://developers.google.com/web/updates/2017/09/autoplay-policy-changes + * @param game Reference to the current game instance. + */ + function SoundManagerCreator(game: Phaser.Game): void; + + /** + * Web Audio API implementation of the sound. + */ + class WebAudioSound extends Phaser.Sound.BaseSound { + /** + * + * @param manager Reference to the current sound manager instance. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. Default {}. + */ + constructor(manager: Phaser.Sound.WebAudioSoundManager, key: string, config?: Phaser.Types.Sound.SoundConfig); + + /** + * Play this sound, or a marked section of it. + * + * It always plays the sound from the start. If you want to start playback from a specific time + * you can set 'seek' setting of the config object, provided to this call, to that value. + * @param markerName If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound. Default ''. + * @param config Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound. + */ + play(markerName?: string, config?: Phaser.Types.Sound.SoundConfig): boolean; + + /** + * Pauses the sound. + */ + pause(): boolean; + + /** + * Resumes the sound. + */ + resume(): boolean; + + /** + * Stop playing this sound. + */ + stop(): boolean; + + /** + * Method used internally for applying config values to some of the sound properties. + */ + protected applyConfig(): void; + + /** + * Update method called automatically by sound manager on every game step. + * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param delta The delta time elapsed since the last frame. + */ + protected update(time: number, delta: number): void; + + /** + * Calls Phaser.Sound.BaseSound#destroy method + * and cleans up all Web Audio API related stuff. + */ + destroy(): void; + + /** + * Method used internally to calculate total playback rate of the sound. + */ + protected calculateRate(): void; + + /** + * Rate at which this Sound will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + */ + rate: number; + + /** + * Sets the playback rate of this Sound. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * @param value The playback rate at of this Sound. + */ + setRate(value: number): Phaser.Sound.WebAudioSound; + + /** + * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + detune: number; + + /** + * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * @param value The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + */ + setDetune(value: number): Phaser.Sound.WebAudioSound; + + /** + * Boolean indicating whether the sound is muted or not. + * Gets or sets the muted state of this sound. + */ + mute: boolean; + + /** + * Sets the muted state of this Sound. + * @param value `true` to mute this sound, `false` to unmute it. + */ + setMute(value: boolean): Phaser.Sound.WebAudioSound; + + /** + * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume). + */ + volume: number; + + /** + * Sets the volume of this Sound. + * @param value The volume of the sound. + */ + setVolume(value: number): Phaser.Sound.WebAudioSound; + + /** + * Property representing the position of playback for this sound, in seconds. + * Setting it to a specific value moves current playback to that position. + * The value given is clamped to the range 0 to current marker duration. + * Setting seek of a stopped sound has no effect. + */ + seek: number; + + /** + * Seeks to a specific point in this sound. + * @param value The point in the sound to seek to. + */ + setSeek(value: number): Phaser.Sound.WebAudioSound; + + /** + * Flag indicating whether or not the sound or current sound marker will loop. + */ + loop: boolean; + + /** + * Sets the loop state of this Sound. + * @param value `true` to loop this sound, `false` to not loop it. + */ + setLoop(value: boolean): Phaser.Sound.WebAudioSound; + + } + + /** + * Web Audio API implementation of the sound manager. + */ + class WebAudioSoundManager extends Phaser.Sound.BaseSoundManager { + /** + * + * @param game Reference to the current game instance. + */ + constructor(game: Phaser.Game); + + /** + * Adds a new sound into the sound manager. + * @param key Asset key for the sound. + * @param config An optional config object containing default sound settings. + */ + add(key: string, config?: Phaser.Types.Sound.SoundConfig): Phaser.Sound.WebAudioSound; + + /** + * Decode audio data into a format ready for playback via Web Audio. + * + * The audio data can be a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. + * + * The `audioKey` is the key that will be used to save the decoded audio to the audio cache. + * + * Instead of passing a single entry you can instead pass an array of `Phaser.Types.Sound.DecodeAudioConfig` + * objects as the first and only argument. + * + * Decoding is an async process, so be sure to listen for the events to know when decoding has completed. + * + * Once the audio has decoded it can be added to the Sound Manager or played via its key. + * @param audioKey The string-based key to be used to reference the decoded audio in the audio cache, or an array of audio config objects. + * @param audioData The audio data, either a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. + */ + decodeAudio(audioKey?: Phaser.Types.Sound.DecodeAudioConfig[] | string, audioData?: ArrayBuffer | string): void; + + /** + * Unlocks Web Audio API on the initial input event. + * + * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09). + */ + unlock(): void; + + /** + * Method used internally for pausing sound manager if + * Phaser.Sound.WebAudioSoundManager#pauseOnBlur is set to true. + */ + protected onBlur(): void; + + /** + * Method used internally for resuming sound manager if + * Phaser.Sound.WebAudioSoundManager#pauseOnBlur is set to true. + */ + protected onFocus(): void; + + /** + * Calls Phaser.Sound.BaseSoundManager#destroy method + * and cleans up all Web Audio API related stuff. + */ + destroy(): void; + + /** + * Sets the muted state of all this Sound Manager. + * @param value `true` to mute all sounds, `false` to unmute them. + */ + setMute(value: boolean): Phaser.Sound.WebAudioSoundManager; + + mute: boolean; + + /** + * Sets the volume of this Sound Manager. + * @param value The global volume of this Sound Manager. + */ + setVolume(value: number): Phaser.Sound.WebAudioSoundManager; + + volume: number; + + } + + } + + namespace Structs { + /** + * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. + */ + class List { + /** + * + * @param parent The parent of this list. + */ + constructor(parent: any); + + /** + * The parent of this list. + */ + parent: any; + + /** + * The objects that belong to this collection. + */ + list: T[]; + + /** + * The index of the current element. + * + * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. + */ + position: integer; + + /** + * A callback that is invoked every time a child is added to this list. + */ + addCallback: Function; + + /** + * A callback that is invoked every time a child is removed from this list. + */ + removeCallback: Function; + + /** + * The property key to sort by. + */ + _sortKey: string; + + /** + * Adds the given item to the end of the list. Each item must be unique. + * @param child The item, or array of items, to add to the list. + * @param skipCallback Skip calling the List.addCallback if this child is added successfully. Default false. + */ + add(child: T, skipCallback?: boolean): T; + + /** + * Adds an item to list, starting at a specified index. Each item must be unique within the list. + * @param child The item, or array of items, to add to the list. + * @param index The index in the list at which the element(s) will be inserted. Default 0. + * @param skipCallback Skip calling the List.addCallback if this child is added successfully. Default false. + */ + addAt(child: T, index?: integer, skipCallback?: boolean): T; + + /** + * Retrieves the item at a given position inside the List. + * @param index The index of the item. + */ + getAt(index: integer): T; + + /** + * Locates an item within the List and returns its index. + * @param child The item to locate. + */ + getIndex(child: T): integer; + + /** + * Sort the contents of this List so the items are in order based on the given property. + * For example, `sort('alpha')` would sort the List contents based on the value of their `alpha` property. + * @param property The property to lexically sort by. + * @param handler Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean. + */ + sort(property: string, handler?: Function): T[]; + + /** + * Searches for the first instance of a child with its `name` + * property matching the given argument. Should more than one child have + * the same name only the first is returned. + * @param name The name to search for. + */ + getByName(name: string): T | null; + + /** + * Returns a random child from the group. + * @param startIndex Offset from the front of the group (lowest child). Default 0. + * @param length Restriction on the number of values you want to randomly select from. Default (to top). + */ + getRandom(startIndex?: integer, length?: integer): T | null; + + /** + * Returns the first element in a given part of the List which matches a specific criterion. + * @param property The name of the property to test or a falsey value to have no criterion. + * @param value The value to test the `property` against, or `undefined` to allow any value and only check for existence. + * @param startIndex The position in the List to start the search at. Default 0. + * @param endIndex The position in the List to optionally stop the search at. It won't be checked. + */ + getFirst(property: string, value: any, startIndex?: number, endIndex?: number): T | null; + + /** + * Returns all children in this List. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('parent')` would return only children that have a property called `parent`. + * + * You can also specify a value to compare the property to: + * + * `getAll('visible', true)` would return only children that have their visible property set to `true`. + * + * Optionally you can specify a start and end index. For example if this List had 100 children, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 children in the List. + * @param property An optional property to test against the value argument. + * @param value If property is set then Child.property must strictly equal this value to be included in the results. + * @param startIndex The first child index to start the search from. + * @param endIndex The last child index to search up until. + */ + getAll(property?: string, value?: T, startIndex?: integer, endIndex?: integer): T[]; + + /** + * Returns the total number of items in the List which have a property matching the given value. + * @param property The property to test on each item. + * @param value The value to test the property against. + */ + count(property: string, value: T): integer; + + /** + * Swaps the positions of two items in the list. + * @param child1 The first item to swap. + * @param child2 The second item to swap. + */ + swap(child1: T, child2: T): void; + + /** + * Moves an item in the List to a new position. + * @param child The item to move. + * @param index Moves an item in the List to a new position. + */ + moveTo(child: T, index: integer): T; + + /** + * Removes one or many items from the List. + * @param child The item, or array of items, to remove. + * @param skipCallback Skip calling the List.removeCallback. Default false. + */ + remove(child: T, skipCallback?: boolean): T; + + /** + * Removes the item at the given position in the List. + * @param index The position to remove the item from. + * @param skipCallback Skip calling the List.removeCallback. Default false. + */ + removeAt(index: integer, skipCallback?: boolean): T; + + /** + * Removes the items within the given range in the List. + * @param startIndex The index to start removing from. Default 0. + * @param endIndex The position to stop removing at. The item at this position won't be removed. + * @param skipCallback Skip calling the List.removeCallback. Default false. + */ + removeBetween(startIndex?: integer, endIndex?: integer, skipCallback?: boolean): T[]; + + /** + * Removes all the items. + * @param skipCallback Skip calling the List.removeCallback. Default false. + */ + removeAll(skipCallback?: boolean): Phaser.Structs.List; + + /** + * Brings the given child to the top of this List. + * @param child The item to bring to the top of the List. + */ + bringToTop(child: T): T; + + /** + * Sends the given child to the bottom of this List. + * @param child The item to send to the back of the list. + */ + sendToBack(child: T): T; + + /** + * Moves the given child up one place in this group unless it's already at the top. + * @param child The item to move up. + */ + moveUp(child: T): T; + + /** + * Moves the given child down one place in this group unless it's already at the bottom. + * @param child The item to move down. + */ + moveDown(child: T): T; + + /** + * Reverses the order of all children in this List. + */ + reverse(): Phaser.Structs.List; + + /** + * Shuffles the items in the list. + */ + shuffle(): Phaser.Structs.List; + + /** + * Replaces a child of this List with the given newChild. The newChild cannot be a member of this List. + * @param oldChild The child in this List that will be replaced. + * @param newChild The child to be inserted into this List. + */ + replace(oldChild: T, newChild: T): T; + + /** + * Checks if an item exists within the List. + * @param child The item to check for the existence of. + */ + exists(child: T): boolean; + + /** + * Sets the property `key` to the given value on all members of this List. + * @param property The name of the property to set. + * @param value The value to set the property to. + * @param startIndex The first child index to start the search from. + * @param endIndex The last child index to search up until. + */ + setAll(property: string, value: T, startIndex?: integer, endIndex?: integer): void; + + /** + * Passes all children to the given callback. + * @param callback The function to call. + * @param context Value to use as `this` when executing callback. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + each(callback: EachListCallback, context?: any, ...args: any[]): void; + + /** + * Clears the List and recreates its internal array. + */ + shutdown(): void; + + /** + * Destroys this List. + */ + destroy(): void; + + /** + * The number of items inside the List. + */ + readonly length: integer; + + /** + * The first item in the List or `null` for an empty List. + */ + readonly first: T; + + /** + * The last item in the List, or `null` for an empty List. + */ + readonly last: T; + + /** + * The next item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. + */ + readonly next: T; + + /** + * The previous item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. + */ + readonly previous: T; + + } + + /** + * The keys of a Map can be arbitrary values. + * + * ```javascript + * var map = new Map([ + * [ 1, 'one' ], + * [ 2, 'two' ], + * [ 3, 'three' ] + * ]); + * ``` + */ + class Map { + /** + * + * @param elements An optional array of key-value pairs to populate this Map with. + */ + constructor(elements: V[]); + + /** + * The entries in this Map. + */ + entries: {[key: string]: V}; + + /** + * The number of key / value pairs in this Map. + */ + size: number; + + /** + * Adds an element with a specified `key` and `value` to this Map. + * If the `key` already exists, the value will be replaced. + * @param key The key of the element to be added to this Map. + * @param value The value of the element to be added to this Map. + */ + set(key: K, value: V): Phaser.Structs.Map; + + /** + * Returns the value associated to the `key`, or `undefined` if there is none. + * @param key The key of the element to return from the `Map` object. + */ + get(key: K): V; + + /** + * Returns an `Array` of all the values stored in this Map. + */ + getArray(): V[]; + + /** + * Returns a boolean indicating whether an element with the specified key exists or not. + * @param key The key of the element to test for presence of in this Map. + */ + has(key: K): boolean; + + /** + * Delete the specified element from this Map. + * @param key The key of the element to delete from this Map. + */ + delete(key: K): Phaser.Structs.Map; + + /** + * Delete all entries from this Map. + */ + clear(): Phaser.Structs.Map; + + /** + * Returns all entries keys in this Map. + */ + keys(): K[]; + + /** + * Returns an `Array` of all entries. + */ + values(): V[]; + + /** + * Dumps the contents of this Map to the console via `console.group`. + */ + dump(): void; + + /** + * Passes all entries in this Map to the given callback. + * @param callback The callback which will receive the keys and entries held in this Map. + */ + each(callback: EachMapCallback): Phaser.Structs.Map; + + /** + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. + * @param value The value to search for. + */ + contains(value: V): boolean; + + /** + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. + * @param map The Map to merge in to this Map. + * @param override Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. Default false. + */ + merge(map: Phaser.Structs.Map, override?: boolean): Phaser.Structs.Map; + + } + + /** + * A Process Queue maintains three internal lists. + * + * The `pending` list is a selection of items which are due to be made 'active' in the next update. + * The `active` list is a selection of items which are considered active and should be updated. + * The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update. + * + * When new items are added to a Process Queue they are put in the pending list, rather than being added + * immediately the active list. Equally, items that are removed are put into the destroy list, rather than + * being destroyed immediately. This allows the Process Queue to carefully process each item at a specific, fixed + * time, rather than at the time of the request from the API. + */ + class ProcessQueue { + /** + * Adds a new item to the Process Queue. + * The item is added to the pending list and made active in the next update. + * @param item The item to add to the queue. + */ + add(item: T): Phaser.Structs.ProcessQueue; + + /** + * Removes an item from the Process Queue. + * The item is added to the pending destroy and fully removed in the next update. + * @param item The item to be removed from the queue. + */ + remove(item: T): Phaser.Structs.ProcessQueue; + + /** + * Update this queue. First it will process any items awaiting destruction, and remove them. + * + * Then it will check to see if there are any items pending insertion, and move them to an + * active state. Finally, it will return a list of active items for further processing. + */ + update(): T[]; + + /** + * Returns the current list of active items. + */ + getActive(): T[]; + + /** + * Immediately destroys this process queue, clearing all of its internal arrays and resetting the process totals. + */ + destroy(): void; + + } + + /** + * RBush is a high-performance JavaScript library for 2D spatial indexing of points and rectangles. + * It's based on an optimized R-tree data structure with bulk insertion support. + * + * Spatial index is a special data structure for points and rectangles that allows you to perform queries like + * "all items within this bounding box" very efficiently (e.g. hundreds of times faster than looping over all items). + * + * This version of RBush uses a fixed min/max accessor structure of `[ '.left', '.top', '.right', '.bottom' ]`. + * This is to avoid the eval like function creation that the original library used, which caused CSP policy violations. + * + * rbush is forked from https://github.com/mourner/rbush by Vladimir Agafonkin + */ + class RTree { + } + + /** + * A Set is a collection of unique elements. + */ + class Set { + /** + * + * @param elements An optional array of elements to insert into this Set. + */ + constructor(elements?: T[]); + + /** + * The entries of this Set. Stored internally as an array. + */ + entries: T[]; + + /** + * Inserts the provided value into this Set. If the value is already contained in this Set this method will have no effect. + * @param value The value to insert into this Set. + */ + set(value: T): Phaser.Structs.Set; + + /** + * Get an element of this Set which has a property of the specified name, if that property is equal to the specified value. + * If no elements of this Set satisfy the condition then this method will return `null`. + * @param property The property name to check on the elements of this Set. + * @param value The value to check for. + */ + get(property: string, value: T): T; + + /** + * Returns an array containing all the values in this Set. + */ + getArray(): T[]; + + /** + * Removes the given value from this Set if this Set contains that value. + * @param value The value to remove from the Set. + */ + delete(value: T): Phaser.Structs.Set; + + /** + * Dumps the contents of this Set to the console via `console.group`. + */ + dump(): void; + + /** + * Passes each value in this Set to the given callback. + * Use this function when you know this Set will be modified during the iteration, otherwise use `iterate`. + * @param callback The callback to be invoked and passed each value this Set contains. + * @param callbackScope The scope of the callback. + */ + each(callback: EachSetCallback, callbackScope?: any): Phaser.Structs.Set; + + /** + * Passes each value in this Set to the given callback. + * For when you absolutely know this Set won't be modified during the iteration. + * @param callback The callback to be invoked and passed each value this Set contains. + * @param callbackScope The scope of the callback. + */ + iterate(callback: EachSetCallback, callbackScope?: any): Phaser.Structs.Set; + + /** + * Goes through each entry in this Set and invokes the given function on them, passing in the arguments. + * @param callbackKey The key of the function to be invoked on each Set entry. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + iterateLocal(callbackKey: string, ...args: any[]): Phaser.Structs.Set; + + /** + * Clears this Set so that it no longer contains any values. + */ + clear(): Phaser.Structs.Set; + + /** + * Returns `true` if this Set contains the given value, otherwise returns `false`. + * @param value The value to check for in this Set. + */ + contains(value: T): boolean; + + /** + * Returns a new Set containing all values that are either in this Set or in the Set provided as an argument. + * @param set The Set to perform the union with. + */ + union(set: Phaser.Structs.Set): Phaser.Structs.Set; + + /** + * Returns a new Set that contains only the values which are in this Set and that are also in the given Set. + * @param set The Set to intersect this set with. + */ + intersect(set: Phaser.Structs.Set): Phaser.Structs.Set; + + /** + * Returns a new Set containing all the values in this Set which are *not* also in the given Set. + * @param set The Set to perform the difference with. + */ + difference(set: Phaser.Structs.Set): Phaser.Structs.Set; + + /** + * The size of this Set. This is the number of entries within it. + * Changing the size will truncate the Set if the given value is smaller than the current size. + * Increasing the size larger than the current size has no effect. + */ + size: integer; + + } + + /** + * The Size component allows you to set `width` and `height` properties and define the relationship between them. + * + * The component can automatically maintain the aspect ratios between the two values, and clamp them + * to a defined min-max range. You can also control the dominant axis. When dimensions are given to the Size component + * that would cause it to exceed its min-max range, the dimensions are adjusted based on the dominant axis. + */ + class Size { + /** + * + * @param width The width of the Size component. Default 0. + * @param height The height of the Size component. If not given, it will use the `width`. Default width. + * @param aspectMode The aspect mode of the Size component. Defaults to 0, no mode. Default 0. + * @param parent The parent of this Size component. Can be any object with public `width` and `height` properties. Dimensions are clamped to keep them within the parent bounds where possible. Default null. + */ + constructor(width?: number, height?: number, aspectMode?: integer, parent?: any); + + /** + * The aspect mode this Size component will use when calculating its dimensions. + * This property is read-only. To change it use the `setAspectMode` method. + */ + readonly aspectMode: integer; + + /** + * The proportional relationship between the width and height. + * + * This property is read-only and is updated automatically when either the `width` or `height` properties are changed, + * depending on the aspect mode. + */ + readonly aspectRatio: number; + + /** + * The minimum allowed width. + * Cannot be less than zero. + * This value is read-only. To change it see the `setMin` method. + */ + readonly minWidth: number; + + /** + * The minimum allowed height. + * Cannot be less than zero. + * This value is read-only. To change it see the `setMin` method. + */ + readonly minHeight: number; + + /** + * The maximum allowed width. + * This value is read-only. To change it see the `setMax` method. + */ + readonly maxWidth: number; + + /** + * The maximum allowed height. + * This value is read-only. To change it see the `setMax` method. + */ + readonly maxHeight: number; + + /** + * A Vector2 containing the horizontal and vertical snap values, which the width and height are snapped to during resizing. + * + * By default this is disabled. + * + * This property is read-only. To change it see the `setSnap` method. + */ + readonly snapTo: Phaser.Math.Vector2; + + /** + * Sets the aspect mode of this Size component. + * + * The aspect mode controls what happens when you modify the `width` or `height` properties, or call `setSize`. + * + * It can be a number from 0 to 4, or a Size constant: + * + * 0. NONE = Do not make the size fit the aspect ratio. Change the ratio when the size changes. + * 1. WIDTH_CONTROLS_HEIGHT = The height is automatically adjusted based on the width. + * 2. HEIGHT_CONTROLS_WIDTH = The width is automatically adjusted based on the height. + * 3. FIT = The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. + * 4. ENVELOP = The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. + * + * Calling this method automatically recalculates the `width` and the `height`, if required. + * @param value The aspect mode value. Default 0. + */ + setAspectMode(value?: integer): this; + + /** + * By setting a Snap To value when this Size component is modified its dimensions will automatically + * by snapped to the nearest grid slice, using floor. For example, if you have snap value of 16, + * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored) + * + * Note that snapping takes place before adjustments by the parent, or the min / max settings. If these + * values are not multiples of the given snap values, then this can result in un-snapped dimensions. + * + * Call this method with no arguments to reset the snap values. + * + * Calling this method automatically recalculates the `width` and the `height`, if required. + * @param snapWidth The amount to snap the width to. If you don't want to snap the width, pass a value of zero. Default 0. + * @param snapHeight The amount to snap the height to. If not provided it will use the `snapWidth` value. If you don't want to snap the height, pass a value of zero. Default snapWidth. + */ + setSnap(snapWidth?: number, snapHeight?: number): this; + + /** + * Sets, or clears, the parent of this Size component. + * + * To clear the parent call this method with no arguments. + * + * The parent influences the maximum extents to which this Size compoent can expand, + * based on the aspect mode: + * + * NONE - The parent clamps both the width and height. + * WIDTH_CONTROLS_HEIGHT - The parent clamps just the width. + * HEIGHT_CONTROLS_WIDTH - The parent clamps just the height. + * FIT - The parent clamps whichever axis is required to ensure the size fits within it. + * ENVELOP - The parent is used to ensure the size fully envelops the parent. + * + * Calling this method automatically calls `setSize`. + * @param parent Sets the parent of this Size component. Don't provide a value to clear an existing parent. + */ + setParent(parent?: any): this; + + /** + * Set the minimum width and height values this Size component will allow. + * + * The minimum values can never be below zero, or greater than the maximum values. + * + * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. + * + * Note that based on the aspect mode, and if this Size component has a parent set or not, the minimums set here + * _can_ be exceed in some situations. + * @param width The minimum allowed width of the Size component. Default 0. + * @param height The minimum allowed height of the Size component. If not given, it will use the `width`. Default width. + */ + setMin(width?: number, height?: number): this; + + /** + * Set the maximum width and height values this Size component will allow. + * + * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. + * + * Note that based on the aspect mode, and if this Size component has a parent set or not, the maximums set here + * _can_ be exceed in some situations. + * @param width The maximum allowed width of the Size component. Default Number.MAX_VALUE. + * @param height The maximum allowed height of the Size component. If not given, it will use the `width`. Default width. + */ + setMax(width?: number, height?: number): this; + + /** + * Sets the width and height of this Size component based on the aspect mode. + * + * If the aspect mode is 'none' then calling this method will change the aspect ratio, otherwise the current + * aspect ratio is honored across all other modes. + * + * If snapTo values have been set then the given width and height are snapped first, prior to any further + * adjustment via min/max values, or a parent. + * + * If minimum and/or maximum dimensions have been specified, the values given to this method will be clamped into + * that range prior to adjustment, but may still exceed them depending on the aspect mode. + * + * If this Size component has a parent set, and the aspect mode is `fit` or `envelop`, then the given sizes will + * be clamped to the range specified by the parent. + * @param width The new width of the Size component. Default 0. + * @param height The new height of the Size component. If not given, it will use the `width`. Default width. + */ + setSize(width?: number, height?: number): this; + + /** + * Sets a new aspect ratio, overriding what was there previously. + * + * It then calls `setSize` immediately using the current dimensions. + * @param ratio The new aspect ratio. + */ + setAspectRatio(ratio: number): this; + + /** + * Sets a new width and height for this Size component and updates the aspect ratio based on them. + * + * It _doesn't_ change the `aspectMode` and still factors in size limits such as the min max and parent bounds. + * @param width The new width of the Size component. + * @param height The new height of the Size component. If not given, it will use the `width`. Default width. + */ + resize(width: number, height?: number): this; + + /** + * Takes a new width and passes it through the min/max clamp and then checks it doesn't exceed the parent width. + * @param value The value to clamp and check. + * @param checkParent Check the given value against the parent, if set. Default true. + */ + getNewWidth(value: number, checkParent?: boolean): number; + + /** + * Takes a new height and passes it through the min/max clamp and then checks it doesn't exceed the parent height. + * @param value The value to clamp and check. + * @param checkParent Check the given value against the parent, if set. Default true. + */ + getNewHeight(value: number, checkParent?: boolean): number; + + /** + * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. + * + * If `fit` is true there may be some space inside the target area which is not covered if its aspect ratio differs. + * If `fit` is false the size may extend further out than the target area if the aspect ratios differ. + * + * If this Size component has a parent set, then the width and height passed to this method will be clamped so + * it cannot exceed that of the parent. + * @param width The new width of the Size component. Default 0. + * @param height The new height of the Size component. If not given, it will use the width value. + * @param fit Perform a `fit` (true) constraint, or an `envelop` (false) constraint. Default true. + */ + constrain(width?: number, height?: number, fit?: boolean): this; + + /** + * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. + * + * There may be some space inside the target area which is not covered if its aspect ratio differs. + * + * If this Size component has a parent set, then the width and height passed to this method will be clamped so + * it cannot exceed that of the parent. + * @param width The new width of the Size component. Default 0. + * @param height The new height of the Size component. If not given, it will use the width value. + */ + fitTo(width?: number, height?: number): this; + + /** + * The current `width` and `height` are adjusted so that they fully envlop the given dimensions, while keeping the aspect ratio. + * + * The size may extend further out than the target area if the aspect ratios differ. + * + * If this Size component has a parent set, then the values are clamped so that it never exceeds the parent + * on the longest axis. + * @param width The new width of the Size component. Default 0. + * @param height The new height of the Size component. If not given, it will use the width value. + */ + envelop(width?: number, height?: number): this; + + /** + * Sets the width of this Size component. + * + * Depending on the aspect mode, changing the width may also update the height and aspect ratio. + * @param width The new width of the Size component. + */ + setWidth(width: number): this; + + /** + * Sets the height of this Size component. + * + * Depending on the aspect mode, changing the height may also update the width and aspect ratio. + * @param height The new height of the Size component. + */ + setHeight(height: number): this; + + /** + * Returns a string representation of this Size component. + */ + toString(): string; + + /** + * Sets the values of this Size component to the `element.style.width` and `height` + * properties of the given DOM Element. The properties are set as `px` values. + * @param element The DOM Element to set the CSS style on. + */ + setCSS(element: HTMLElement): void; + + /** + * Copies the aspect mode, aspect ratio, width and height from this Size component + * to the given Size component. Note that the parent, if set, is not copied across. + * @param destination The Size component to copy the values to. + */ + copy(destination: Phaser.Structs.Size): Phaser.Structs.Size; + + /** + * Destroys this Size component. + * + * This clears the local properties and any parent object, if set. + * + * A destroyed Size component cannot be re-used. + */ + destroy(): void; + + /** + * The width of this Size component. + * + * This value is clamped to the range specified by `minWidth` and `maxWidth`, if enabled. + * + * A width can never be less than zero. + * + * Changing this value will automatically update the `height` if the aspect ratio lock is enabled. + * You can also use the `setWidth` and `getWidth` methods. + */ + width: number; + + /** + * The height of this Size component. + * + * This value is clamped to the range specified by `minHeight` and `maxHeight`, if enabled. + * + * A height can never be less than zero. + * + * Changing this value will automatically update the `width` if the aspect ratio lock is enabled. + * You can also use the `setHeight` and `getHeight` methods. + */ + height: number; + + /** + * Do not make the size fit the aspect ratio. Change the ratio when the size changes. + */ + static readonly NONE: integer; + + /** + * The height is automatically adjusted based on the width. + */ + static readonly WIDTH_CONTROLS_HEIGHT: integer; + + /** + * The width is automatically adjusted based on the height. + */ + static readonly HEIGHT_CONTROLS_WIDTH: integer; + + /** + * The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. + */ + static readonly FIT: integer; + + /** + * The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. + */ + static readonly ENVELOP: integer; + + } + + } + + namespace Textures { + /** + * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. + * + * You can use the properties of this texture to draw to the canvas element directly, using all of the standard + * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. + * + * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to + * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this + * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep + * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading + * texture data to it. This restriction does not apply if using the Canvas Renderer. + * + * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify + * sections of the canvas using the `add` method. + * + * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying + * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause + * graphical errors. + */ + class CanvasTexture extends Phaser.Textures.Texture { + /** + * + * @param manager A reference to the Texture Manager this Texture belongs to. + * @param key The unique string-based key of this Texture. + * @param source The canvas element that is used as the base of this texture. + * @param width The width of the canvas. + * @param height The height of the canvas. + */ + constructor(manager: Phaser.Textures.CanvasTexture, key: string, source: HTMLCanvasElement, width: integer, height: integer); + + /** + * The source Canvas Element. + */ + readonly canvas: HTMLCanvasElement; + + /** + * The 2D Canvas Rendering Context. + */ + readonly context: CanvasRenderingContext2D; + + /** + * The width of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + */ + readonly width: integer; + + /** + * The height of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + */ + readonly height: integer; + + /** + * The context image data. + * Use the `update` method to populate this when the canvas changes. + */ + imageData: ImageData; + + /** + * A Uint8ClampedArray view into the `buffer`. + * Use the `update` method to populate this when the canvas changes. + * Note that this is unavailable in some browsers, such as Epic Browser, due to their security restrictions. + */ + data: Uint8ClampedArray; + + /** + * An Uint32Array view into the `buffer`. + */ + pixels: Uint32Array; + + /** + * An ArrayBuffer the same size as the context ImageData. + */ + buffer: ArrayBuffer; + + /** + * This re-creates the `imageData` from the current context. + * It then re-builds the ArrayBuffer, the `data` Uint8ClampedArray reference and the `pixels` Int32Array. + * + * Warning: This is a very expensive operation, so use it sparingly. + */ + update(): Phaser.Textures.CanvasTexture; + + /** + * Draws the given Image or Canvas element to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * @param x The x coordinate to draw the source at. + * @param y The y coordinate to draw the source at. + * @param source The element to draw to this canvas. + */ + draw(x: integer, y: integer, source: HTMLImageElement | HTMLCanvasElement): Phaser.Textures.CanvasTexture; + + /** + * Draws the given texture frame to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * @param key The unique string-based key of the Texture. + * @param frame The string-based name, or integer based index, of the Frame to get from the Texture. + * @param x The x coordinate to draw the source at. Default 0. + * @param y The y coordinate to draw the source at. Default 0. + */ + drawFrame(key: string, frame?: string | integer, x?: integer, y?: integer): Phaser.Textures.CanvasTexture; + + /** + * Sets a pixel in the CanvasTexture to the given color and alpha values. + * + * This is an expensive operation to run in large quantities, so use sparingly. + * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param red The red color value. A number between 0 and 255. + * @param green The green color value. A number between 0 and 255. + * @param blue The blue color value. A number between 0 and 255. + * @param alpha The alpha value. A number between 0 and 255. Default 255. + */ + setPixel(x: integer, y: integer, red: integer, green: integer, blue: integer, alpha?: integer): this; + + /** + * Puts the ImageData into the context of this CanvasTexture at the given coordinates. + * @param imageData The ImageData to put at the given location. + * @param x The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param dirtyX Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. Default 0. + * @param dirtyY Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. Default 0. + * @param dirtyWidth Width of the rectangle to be painted. Defaults to the width of the image data. + * @param dirtyHeight Height of the rectangle to be painted. Defaults to the height of the image data. + */ + putData(imageData: ImageData, x: integer, y: integer, dirtyX?: integer, dirtyY?: integer, dirtyWidth?: integer, dirtyHeight?: integer): this; + + /** + * Gets an ImageData region from this CanvasTexture from the position and size specified. + * You can write this back using `CanvasTexture.putData`, or manipulate it. + * @param x The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param width The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. + * @param height The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. + */ + getData(x: integer, y: integer, width: integer, height: integer): ImageData; + + /** + * Get the color of a specific pixel from this texture and store it in a Color object. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param out A Color object to store the pixel values in. If not provided a new Color object will be created. + */ + getPixel(x: integer, y: integer, out?: Phaser.Display.Color): Phaser.Display.Color; + + /** + * Returns an array containing all of the pixels in the given region. + * + * If the requested region extends outside the bounds of this CanvasTexture, + * the region is truncated to fit. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * @param x The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param width The width of the region to get. Must be an integer. + * @param height The height of the region to get. Must be an integer. If not given will be set to the `width`. + */ + getPixels(x: integer, y: integer, width: integer, height?: integer): Phaser.Types.Textures.PixelConfig[]; + + /** + * Returns the Image Data index for the given pixel in this CanvasTexture. + * + * The index can be used to read directly from the `this.data` array. + * + * The index points to the red value in the array. The subsequent 3 indexes + * point to green, blue and alpha respectively. + * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param y The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + */ + getIndex(x: integer, y: integer): integer; + + /** + * This should be called manually if you are running under WebGL. + * It will refresh the WebGLTexture from the Canvas source. Only call this if you know that the + * canvas has changed, as there is a significant GPU texture allocation cost involved in doing so. + */ + refresh(): Phaser.Textures.CanvasTexture; + + /** + * Gets the Canvas Element. + */ + getCanvas(): HTMLCanvasElement; + + /** + * Gets the 2D Canvas Rendering Context. + */ + getContext(): CanvasRenderingContext2D; + + /** + * Clears the given region of this Canvas Texture, resetting it back to transparent. + * If no region is given, the whole Canvas Texture is cleared. + * @param x The x coordinate of the top-left of the region to clear. Default 0. + * @param y The y coordinate of the top-left of the region to clear. Default 0. + * @param width The width of the region. + * @param height The height of the region. + */ + clear(x?: integer, y?: integer, width?: integer, height?: integer): Phaser.Textures.CanvasTexture; + + /** + * Changes the size of this Canvas Texture. + * @param width The new width of the Canvas. + * @param height The new height of the Canvas. If not given it will use the width as the height. + */ + setSize(width: integer, height?: integer): Phaser.Textures.CanvasTexture; + + /** + * Destroys this Texture and releases references to its sources and frames. + */ + destroy(): void; + + } + + /** + * Filter Types. + */ + enum FilterMode { + /** + * Linear filter type. + */ + LINEAR, + /** + * Nearest neighbor filter type. + */ + NEAREST, + } + + namespace Events { + /** + * The Texture Add Event. + * + * This event is dispatched by the Texture Manager when a texture is added to it. + * + * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`. + */ + const ADD: any; + + /** + * The Texture Load Error Event. + * + * This event is dispatched by the Texture Manager when a texture it requested to load failed. + * This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin. + * + * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`. + */ + const ERROR: any; + + /** + * The Texture Load Event. + * + * This event is dispatched by the Texture Manager when a texture has finished loading on it. + * This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin. + * + * Listen to this event from within a Scene using: `this.textures.on('onload', listener)`. + * + * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event. + */ + const LOAD: any; + + /** + * This internal event signifies that the Texture Manager is now ready and the Game can continue booting. + * + * When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking + * async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game + * instance, which tells the Game to carry on booting. + */ + const READY: any; + + /** + * The Texture Remove Event. + * + * This event is dispatched by the Texture Manager when a texture is removed from it. + * + * Listen to this event from within a Scene using: `this.textures.on('removetexture', listener)`. + * + * If you have any Game Objects still using the removed texture, they will start throwing + * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. + */ + const REMOVE: any; + + } + + /** + * A Frame is a section of a Texture. + */ + class Frame { + /** + * + * @param texture The Texture this Frame is a part of. + * @param name The name of this Frame. The name is unique within the Texture. + * @param sourceIndex The index of the TextureSource that this Frame is a part of. + * @param x The x coordinate of the top-left of this Frame. + * @param y The y coordinate of the top-left of this Frame. + * @param width The width of this Frame. + * @param height The height of this Frame. + */ + constructor(texture: Phaser.Textures.Texture, name: integer | string, sourceIndex: integer, x: number, y: number, width: number, height: number); + + /** + * The Texture this Frame is a part of. + */ + texture: Phaser.Textures.Texture; + + /** + * The name of this Frame. + * The name is unique within the Texture. + */ + name: string; + + /** + * The TextureSource this Frame is part of. + */ + source: Phaser.Textures.TextureSource; + + /** + * The index of the TextureSource in the Texture sources array. + */ + sourceIndex: integer; + + /** + * A reference to the Texture Source WebGL Texture that this Frame is using. + */ + glTexture: WebGLTexture; + + /** + * X position within the source image to cut from. + */ + cutX: integer; + + /** + * Y position within the source image to cut from. + */ + cutY: integer; + + /** + * The width of the area in the source image to cut. + */ + cutWidth: integer; + + /** + * The height of the area in the source image to cut. + */ + cutHeight: integer; + + /** + * The X rendering offset of this Frame, taking trim into account. + */ + x: integer; + + /** + * The Y rendering offset of this Frame, taking trim into account. + */ + y: integer; + + /** + * The rendering width of this Frame, taking trim into account. + */ + width: integer; + + /** + * The rendering height of this Frame, taking trim into account. + */ + height: integer; + + /** + * Half the width, floored. + * Precalculated for the renderer. + */ + halfWidth: integer; + + /** + * Half the height, floored. + * Precalculated for the renderer. + */ + halfHeight: integer; + + /** + * The x center of this frame, floored. + */ + centerX: integer; + + /** + * The y center of this frame, floored. + */ + centerY: integer; + + /** + * The horizontal pivot point of this Frame. + */ + pivotX: number; + + /** + * The vertical pivot point of this Frame. + */ + pivotY: number; + + /** + * Does this Frame have a custom pivot point? + */ + customPivot: boolean; + + /** + * **CURRENTLY UNSUPPORTED** + * + * Is this frame is rotated or not in the Texture? + * Rotation allows you to use rotated frames in texture atlas packing. + * It has nothing to do with Sprite rotation. + */ + rotated: boolean; + + /** + * Over-rides the Renderer setting. + * -1 = use Renderer Setting + * 0 = No rounding + * 1 = Round + */ + autoRound: integer; + + /** + * Any Frame specific custom data can be stored here. + */ + customData: object; + + /** + * WebGL UV u0 value. + */ + u0: number; + + /** + * WebGL UV v0 value. + */ + v0: number; + + /** + * WebGL UV u1 value. + */ + u1: number; + + /** + * WebGL UV v1 value. + */ + v1: number; + + /** + * Sets the width, height, x and y of this Frame. + * + * This is called automatically by the constructor + * and should rarely be changed on-the-fly. + * @param width The width of the frame before being trimmed. + * @param height The height of the frame before being trimmed. + * @param x The x coordinate of the top-left of this Frame. Default 0. + * @param y The y coordinate of the top-left of this Frame. Default 0. + */ + setSize(width: integer, height: integer, x?: integer, y?: integer): Phaser.Textures.Frame; + + /** + * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data. + * @param actualWidth The width of the frame before being trimmed. + * @param actualHeight The height of the frame before being trimmed. + * @param destX The destination X position of the trimmed frame for display. + * @param destY The destination Y position of the trimmed frame for display. + * @param destWidth The destination width of the trimmed frame for display. + * @param destHeight The destination height of the trimmed frame for display. + */ + setTrim(actualWidth: number, actualHeight: number, destX: number, destY: number, destWidth: number, destHeight: number): Phaser.Textures.Frame; + + /** + * Takes a crop data object and, based on the rectangular region given, calculates the + * required UV coordinates in order to crop this Frame for WebGL and Canvas rendering. + * + * This is called directly by the Game Object Texture Components `setCrop` method. + * Please use that method to crop a Game Object. + * @param crop The crop data object. This is the `GameObject._crop` property. + * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. + * @param y The y coordinate to start the crop from. Cannot be negative or exceed the Frame height. + * @param width The width of the crop rectangle. Cannot exceed the Frame width. + * @param height The height of the crop rectangle. Cannot exceed the Frame height. + * @param flipX Does the parent Game Object have flipX set? + * @param flipY Does the parent Game Object have flipY set? + */ + setCropUVs(crop: object, x: number, y: number, width: number, height: number, flipX: boolean, flipY: boolean): object; + + /** + * Takes a crop data object and recalculates the UVs based on the dimensions inside the crop object. + * Called automatically by `setFrame`. + * @param crop The crop data object. This is the `GameObject._crop` property. + * @param flipX Does the parent Game Object have flipX set? + * @param flipY Does the parent Game Object have flipY set? + */ + updateCropUVs(crop: object, flipX: boolean, flipY: boolean): object; + + /** + * Updates the internal WebGL UV cache and the drawImage cache. + */ + updateUVs(): Phaser.Textures.Frame; + + /** + * Updates the internal WebGL UV cache. + */ + updateUVsInverted(): Phaser.Textures.Frame; + + /** + * Clones this Frame into a new Frame object. + */ + clone(): Phaser.Textures.Frame; + + /** + * Destroys this Frames references. + */ + destroy(): void; + + /** + * The width of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + */ + readonly realWidth: number; + + /** + * The height of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + */ + readonly realHeight: number; + + /** + * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) + */ + readonly radius: number; + + /** + * Is the Frame trimmed or not? + */ + readonly trimmed: boolean; + + /** + * The Canvas drawImage data object. + */ + readonly canvasData: object; + + } + + /** + * Linear filter type. + */ + const LINEAR: integer; + + /** + * Nearest Neighbor filter type. + */ + const NEAREST: integer; + + namespace Parsers { + } + + /** + * A Texture consists of a source, usually an Image from the Cache, and a collection of Frames. + * The Frames represent the different areas of the Texture. For example a texture atlas + * may have many Frames, one for each element within the atlas. Where-as a single image would have + * just one frame, that encompasses the whole image. + * + * Every Texture, no matter where it comes from, always has at least 1 frame called the `__BASE` frame. + * This frame represents the entirety of the source image. + * + * Textures are managed by the global TextureManager. This is a singleton class that is + * responsible for creating and delivering Textures and their corresponding Frames to Game Objects. + * + * Sprites and other Game Objects get the texture data they need from the TextureManager. + */ + class Texture { + /** + * + * @param manager A reference to the Texture Manager this Texture belongs to. + * @param key The unique string-based key of this Texture. + * @param source An array of sources that are used to create the texture. Usually Images, but can also be a Canvas. + * @param width The width of the Texture. This is optional and automatically derived from the source images. + * @param height The height of the Texture. This is optional and automatically derived from the source images. + */ + constructor(manager: Phaser.Textures.TextureManager, key: string, source: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[], width?: number, height?: number); + + /** + * A reference to the Texture Manager this Texture belongs to. + */ + manager: Phaser.Textures.TextureManager; + + /** + * The unique string-based key of this Texture. + */ + key: string; + + /** + * An array of TextureSource instances. + * These are unique to this Texture and contain the actual Image (or Canvas) data. + */ + source: Phaser.Textures.TextureSource[]; + + /** + * An array of TextureSource data instances. + * Used to store additional data images, such as normal maps or specular maps. + */ + dataSource: any[]; + + /** + * A key-value object pair associating the unique Frame keys with the Frames objects. + */ + frames: object; + + /** + * Any additional data that was set in the source JSON (if any), + * or any extra data you'd like to store relating to this texture + */ + customData: object; + + /** + * The name of the first frame of the Texture. + */ + firstFrame: string; + + /** + * The total number of Frames in this Texture, including the `__BASE` frame. + * + * A Texture will always contain at least 1 frame because every Texture contains a `__BASE` frame by default, + * in addition to any extra frames that have been added to it, such as when parsing a Sprite Sheet or Texture Atlas. + */ + frameTotal: integer; + + /** + * Adds a new Frame to this Texture. + * + * A Frame is a rectangular region of a TextureSource with a unique index or string-based key. + * + * The name given must be unique within this Texture. If it already exists, this method will return `null`. + * @param name The name of this Frame. The name is unique within the Texture. + * @param sourceIndex The index of the TextureSource that this Frame is a part of. + * @param x The x coordinate of the top-left of this Frame. + * @param y The y coordinate of the top-left of this Frame. + * @param width The width of this Frame. + * @param height The height of this Frame. + */ + add(name: integer | string, sourceIndex: integer, x: number, y: number, width: number, height: number): Phaser.Textures.Frame; + + /** + * Checks to see if a Frame matching the given key exists within this Texture. + * @param name The key of the Frame to check for. + */ + has(name: string): boolean; + + /** + * Gets a Frame from this Texture based on either the key or the index of the Frame. + * + * In a Texture Atlas Frames are typically referenced by a key. + * In a Sprite Sheet Frames are referenced by an index. + * Passing no value for the name returns the base texture. + * @param name The string-based name, or integer based index, of the Frame to get from this Texture. + */ + get(name?: string | integer): Phaser.Textures.Frame; + + /** + * Takes the given TextureSource and returns the index of it within this Texture. + * If it's not in this Texture, it returns -1. + * Unless this Texture has multiple TextureSources, such as with a multi-atlas, this + * method will always return zero or -1. + * @param source The TextureSource to check. + */ + getTextureSourceIndex(source: Phaser.Textures.TextureSource): integer; + + /** + * Returns an array of all the Frames in the given TextureSource. + * @param sourceIndex The index of the TextureSource to get the Frames from. + * @param includeBase Include the `__BASE` Frame in the output array? Default false. + */ + getFramesFromTextureSource(sourceIndex: integer, includeBase?: boolean): Phaser.Textures.Frame[]; + + /** + * Returns an array with all of the names of the Frames in this Texture. + * + * Useful if you want to randomly assign a Frame to a Game Object, as you can + * pick a random element from the returned array. + * @param includeBase Include the `__BASE` Frame in the output array? Default false. + */ + getFrameNames(includeBase?: boolean): string[]; + + /** + * Given a Frame name, return the source image it uses to render with. + * + * This will return the actual DOM Image or Canvas element. + * @param name The string-based name, or integer based index, of the Frame to get from this Texture. + */ + getSourceImage(name?: string | integer): HTMLImageElement | HTMLCanvasElement | Phaser.GameObjects.RenderTexture; + + /** + * Given a Frame name, return the data source image it uses to render with. + * You can use this to get the normal map for an image for example. + * + * This will return the actual DOM Image. + * @param name The string-based name, or integer based index, of the Frame to get from this Texture. + */ + getDataSourceImage(name?: string | integer): HTMLImageElement | HTMLCanvasElement; + + /** + * Adds a data source image to this Texture. + * + * An example of a data source image would be a normal map, where all of the Frames for this Texture + * equally apply to the normal map. + * @param data The source image. + */ + setDataSource(data: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): void; + + /** + * Sets the Filter Mode for this Texture. + * + * The mode can be either Linear, the default, or Nearest. + * + * For pixel-art you should use Nearest. + * + * The mode applies to the entire Texture, not just a specific Frame of it. + * @param filterMode The Filter Mode. + */ + setFilter(filterMode: Phaser.Textures.FilterMode): void; + + /** + * Destroys this Texture and releases references to its sources and frames. + */ + destroy(): void; + + } + + /** + * Textures are managed by the global TextureManager. This is a singleton class that is + * responsible for creating and delivering Textures and their corresponding Frames to Game Objects. + * + * Sprites and other Game Objects get the texture data they need from the TextureManager. + * + * Access it via `scene.textures`. + */ + class TextureManager extends Phaser.Events.EventEmitter { + /** + * + * @param game The Phaser.Game instance this Texture Manager belongs to. + */ + constructor(game: Phaser.Game); + + /** + * The Game that this TextureManager belongs to. + */ + game: Phaser.Game; + + /** + * The name of this manager. + */ + name: string; + + /** + * An object that has all of textures that Texture Manager creates. + * Textures are assigned to keys so we can access to any texture that this object has directly by key value without iteration. + */ + list: object; + + /** + * Checks the given texture key and throws a console.warn if the key is already in use, then returns false. + * If you wish to avoid the console.warn then use `TextureManager.exists` instead. + * @param key The texture key to check. + */ + checkKey(key: string): boolean; + + /** + * Removes a Texture from the Texture Manager and destroys it. This will immediately + * clear all references to it from the Texture Manager, and if it has one, destroy its + * WebGLTexture. This will emit a `removetexture` event. + * + * Note: If you have any Game Objects still using this texture they will start throwing + * errors the next time they try to render. Make sure that removing the texture is the final + * step when clearing down to avoid this. + * @param key The key of the Texture to remove, or a reference to it. + */ + remove(key: string | Phaser.Textures.Texture): Phaser.Textures.TextureManager; + + /** + * Removes a key from the Texture Manager but does not destroy the Texture that was using the key. + * @param key The key to remove from the texture list. + */ + removeKey(key: string): Phaser.Textures.TextureManager; + + /** + * Adds a new Texture to the Texture Manager created from the given Base64 encoded data. + * @param key The unique string-based key of the Texture. + * @param data The Base64 encoded data. + */ + addBase64(key: string, data: any): this; + + /** + * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. + * + * You can also provide the image type and encoder options. + * @param key The unique string-based key of the Texture. + * @param frame The string-based name, or integer based index, of the Frame to get from the Texture. + * @param type [description] Default 'image/png'. + * @param encoderOptions [description] Default 0.92. + */ + getBase64(key: string, frame?: string | integer, type?: string, encoderOptions?: number): string; + + /** + * Adds a new Texture to the Texture Manager created from the given Image element. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param dataSource An optional data Image element. + */ + addImage(key: string, source: HTMLImageElement, dataSource?: HTMLImageElement | HTMLCanvasElement): Phaser.Textures.Texture; + + /** + * Adds a Render Texture to the Texture Manager using the given key. + * This allows you to then use the Render Texture as a normal texture for texture based Game Objects like Sprites. + * @param key The unique string-based key of the Texture. + * @param renderTexture The source Render Texture. + */ + addRenderTexture(key: string, renderTexture: Phaser.GameObjects.RenderTexture): Phaser.Textures.Texture; + + /** + * Creates a new Texture using the given config values. + * Generated textures consist of a Canvas element to which the texture data is drawn. + * See the Phaser.Create function for the more direct way to create textures. + * @param key The unique string-based key of the Texture. + * @param config The configuration object needed to generate the texture. + */ + generate(key: string, config: object): Phaser.Textures.Texture; + + /** + * Creates a new Texture using a blank Canvas element of the size given. + * + * Canvas elements are automatically pooled and calling this method will + * extract a free canvas from the CanvasPool, or create one if none are available. + * @param key The unique string-based key of the Texture. + * @param width The width of the Canvas element. Default 256. + * @param height The height of the Canvas element. Default 256. + */ + createCanvas(key: string, width?: integer, height?: integer): Phaser.Textures.CanvasTexture; + + /** + * Creates a new Canvas Texture object from an existing Canvas element + * and adds it to this Texture Manager, unless `skipCache` is true. + * @param key The unique string-based key of the Texture. + * @param source The Canvas element to form the base of the new Texture. + * @param skipCache Skip adding this Texture into the Cache? Default false. + */ + addCanvas(key: string, source: HTMLCanvasElement, skipCache?: boolean): Phaser.Textures.CanvasTexture; + + /** + * Adds a new Texture Atlas to this Texture Manager. + * It can accept either JSON Array or JSON Hash formats, as exported by Texture Packer and similar software. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param data The Texture Atlas data. + * @param dataSource An optional data Image element. + */ + addAtlas(key: string, source: HTMLImageElement, data: object, dataSource?: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): Phaser.Textures.Texture; + + /** + * Adds a Texture Atlas to this Texture Manager. + * The frame data of the atlas must be stored in an Array within the JSON. + * This is known as a JSON Array in software such as Texture Packer. + * @param key The unique string-based key of the Texture. + * @param source The source Image element/s. + * @param data The Texture Atlas data/s. + * @param dataSource An optional data Image element. + */ + addAtlasJSONArray(key: string, source: HTMLImageElement | HTMLImageElement[], data: object | object[], dataSource?: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): Phaser.Textures.Texture; + + /** + * Adds a Texture Atlas to this Texture Manager. + * The frame data of the atlas must be stored in an Object within the JSON. + * This is known as a JSON Hash in software such as Texture Packer. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param data The Texture Atlas data. + * @param dataSource An optional data Image element. + */ + addAtlasJSONHash(key: string, source: HTMLImageElement, data: object, dataSource?: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): Phaser.Textures.Texture; + + /** + * Adds a Texture Atlas to this Texture Manager, where the atlas data is given + * in the XML format. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param data The Texture Atlas XML data. + * @param dataSource An optional data Image element. + */ + addAtlasXML(key: string, source: HTMLImageElement, data: object, dataSource?: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): Phaser.Textures.Texture; + + /** + * Adds a Unity Texture Atlas to this Texture Manager. + * The data must be in the form of a Unity YAML file. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param data The Texture Atlas data. + * @param dataSource An optional data Image element. + */ + addUnityAtlas(key: string, source: HTMLImageElement, data: object, dataSource?: HTMLImageElement | HTMLCanvasElement | HTMLImageElement[] | HTMLCanvasElement[]): Phaser.Textures.Texture; + + /** + * Adds a Sprite Sheet to this Texture Manager. + * + * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact + * same size and cannot be trimmed or rotated. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param config The configuration object for this Sprite Sheet. + */ + addSpriteSheet(key: string, source: HTMLImageElement, config: Phaser.Types.Textures.SpriteSheetConfig): Phaser.Textures.Texture; + + /** + * Adds a Sprite Sheet to this Texture Manager, where the Sprite Sheet exists as a Frame within a Texture Atlas. + * + * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact + * same size and cannot be trimmed or rotated. + * @param key The unique string-based key of the Texture. + * @param config The configuration object for this Sprite Sheet. + */ + addSpriteSheetFromAtlas(key: string, config: Phaser.Types.Textures.SpriteSheetFromAtlasConfig): Phaser.Textures.Texture; + + /** + * Creates a new Texture using the given source and dimensions. + * @param key The unique string-based key of the Texture. + * @param source The source Image element. + * @param width The width of the Texture. + * @param height The height of the Texture. + */ + create(key: string, source: HTMLImageElement, width: integer, height: integer): Phaser.Textures.Texture; + + /** + * Checks the given key to see if a Texture using it exists within this Texture Manager. + * @param key The unique string-based key of the Texture. + */ + exists(key: string): boolean; + + /** + * Returns a Texture from the Texture Manager that matches the given key. + * If the key is undefined it will return the `__DEFAULT` Texture. + * If the key is given, but not found, it will return the `__MISSING` Texture. + * @param key The unique string-based key of the Texture. + */ + get(key: string): Phaser.Textures.Texture; + + /** + * Takes a Texture key and Frame name and returns a clone of that Frame if found. + * @param key The unique string-based key of the Texture. + * @param frame The string or index of the Frame to be cloned. + */ + cloneFrame(key: string, frame: string | integer): Phaser.Textures.Frame; + + /** + * Takes a Texture key and Frame name and returns a reference to that Frame, if found. + * @param key The unique string-based key of the Texture. + * @param frame The string-based name, or integer based index, of the Frame to get from the Texture. + */ + getFrame(key: string, frame?: string | integer): Phaser.Textures.Frame; + + /** + * Returns an array with all of the keys of all Textures in this Texture Manager. + * The output array will exclude the `__DEFAULT` and `__MISSING` keys. + */ + getTextureKeys(): string[]; + + /** + * Given a Texture and an `x` and `y` coordinate this method will return a new + * Color object that has been populated with the color and alpha values of the pixel + * at that location in the Texture. + * @param x The x coordinate of the pixel within the Texture. + * @param y The y coordinate of the pixel within the Texture. + * @param key The unique string-based key of the Texture. + * @param frame The string or index of the Frame. + */ + getPixel(x: integer, y: integer, key: string, frame?: string | integer): Phaser.Display.Color; + + /** + * Given a Texture and an `x` and `y` coordinate this method will return a value between 0 and 255 + * corresponding to the alpha value of the pixel at that location in the Texture. If the coordinate + * is out of bounds it will return null. + * @param x The x coordinate of the pixel within the Texture. + * @param y The y coordinate of the pixel within the Texture. + * @param key The unique string-based key of the Texture. + * @param frame The string or index of the Frame. + */ + getPixelAlpha(x: integer, y: integer, key: string, frame?: string | integer): integer; + + /** + * Sets the given Game Objects `texture` and `frame` properties so that it uses + * the Texture and Frame specified in the `key` and `frame` arguments to this method. + * @param gameObject The Game Object the texture would be set on. + * @param key The unique string-based key of the Texture. + * @param frame The string or index of the Frame. + */ + setTexture(gameObject: Phaser.GameObjects.GameObject, key: string, frame?: string | integer): Phaser.GameObjects.GameObject; + + /** + * Changes the key being used by a Texture to the new key provided. + * + * The old key is removed, allowing it to be re-used. + * + * Game Objects are linked to Textures by a reference to the Texture object, so + * all existing references will be retained. + * @param currentKey The current string-based key of the Texture you wish to rename. + * @param newKey The new unique string-based key to use for the Texture. + */ + renameTexture(currentKey: string, newKey: string): boolean; + + /** + * Passes all Textures to the given callback. + * @param callback The callback function to be sent the Textures. + * @param scope The value to use as `this` when executing the callback. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + each(callback: EachTextureCallback, scope: object, ...args: any[]): void; + + /** + * Destroys the Texture Manager and all Textures stored within it. + */ + destroy(): void; + + } + + /** + * A Texture Source is the encapsulation of the actual source data for a Texture. + * This is typically an Image Element, loaded from the file system or network, or a Canvas Element. + * + * A Texture can contain multiple Texture Sources, which only happens when a multi-atlas is loaded. + */ + class TextureSource { + /** + * + * @param texture The Texture this TextureSource belongs to. + * @param source The source image data. + * @param width Optional width of the source image. If not given it's derived from the source itself. + * @param height Optional height of the source image. If not given it's derived from the source itself. + */ + constructor(texture: Phaser.Textures.Texture, source: HTMLImageElement | HTMLCanvasElement, width?: integer, height?: integer); + + /** + * The Texture this TextureSource belongs to. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The Texture this TextureSource belongs to. + */ + texture: Phaser.Textures.Texture; + + /** + * The source of the image data. + * This is either an Image Element, a Canvas Element or a RenderTexture. + */ + source: HTMLImageElement | HTMLCanvasElement | Phaser.GameObjects.RenderTexture; + + /** + * The image data. + * This is either an Image element or a Canvas element. + */ + image: HTMLImageElement | HTMLCanvasElement; + + /** + * Currently un-used. + */ + compressionAlgorithm: integer; + + /** + * The resolution of the source image. + */ + resolution: number; + + /** + * The width of the source image. If not specified in the constructor it will check + * the `naturalWidth` and then `width` properties of the source image. + */ + width: integer; + + /** + * The height of the source image. If not specified in the constructor it will check + * the `naturalHeight` and then `height` properties of the source image. + */ + height: integer; + + /** + * The Scale Mode the image will use when rendering. + * Either Linear or Nearest. + */ + scaleMode: number; + + /** + * Is the source image a Canvas Element? + */ + isCanvas: boolean; + + /** + * Is the source image a Render Texture? + */ + isRenderTexture: boolean; + + /** + * Are the source image dimensions a power of two? + */ + isPowerOf2: boolean; + + /** + * The WebGL Texture of the source image. + */ + glTexture: WebGLTexture; + + /** + * Creates a WebGL Texture, if required, and sets the Texture filter mode. + * @param game A reference to the Phaser Game instance. + */ + init(game: Phaser.Game): void; + + /** + * Sets the Filter Mode for this Texture. + * + * The mode can be either Linear, the default, or Nearest. + * + * For pixel-art you should use Nearest. + * @param filterMode The Filter Mode. + */ + setFilter(filterMode: Phaser.Textures.FilterMode): void; + + /** + * If this TextureSource is backed by a Canvas and is running under WebGL, + * it updates the WebGLTexture using the canvas data. + */ + update(): void; + + /** + * Destroys this Texture Source and nulls the references. + */ + destroy(): void; + + } + + } + + namespace Tilemaps { + namespace Components { + } + + /** + * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. + * + * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a + * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the + * tiles in a DynamicTilemapLayer. + * + * Use this over a Static Tilemap Layer when you need those features. + */ + class DynamicTilemapLayer extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param tilemap The Tilemap this layer is a part of. + * @param layerIndex The index of the LayerData associated with this layer. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The world x position where the top left of this layer will be placed. Default 0. + * @param y The world y position where the top left of this layer will be placed. Default 0. + */ + constructor(scene: Phaser.Scene, tilemap: Phaser.Tilemaps.Tilemap, layerIndex: integer, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number); + + /** + * Used internally by physics system to perform fast type checks. + */ + readonly isTilemap: boolean; + + /** + * The Tilemap that this layer is a part of. + */ + tilemap: Phaser.Tilemaps.Tilemap; + + /** + * The index of the LayerData associated with this layer. + */ + layerIndex: integer; + + /** + * The LayerData associated with this layer. LayerData can only be associated with one + * tilemap layer. + */ + layer: Phaser.Tilemaps.LayerData; + + /** + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. + */ + tileset: Phaser.Tilemaps.Tileset[]; + + /** + * Used internally with the canvas render. This holds the tiles that are visible within the + * camera. + */ + culledTiles: any[]; + + /** + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this, and toggling this flag allows + * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. + */ + skipCull: boolean; + + /** + * The total number of tiles drawn by the renderer in the last frame. + */ + readonly tilesDrawn: integer; + + /** + * The total number of tiles in this layer. Updated every frame. + */ + readonly tilesTotal: integer; + + /** + * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. + * + * See the method `setCullPadding` for more details. + */ + cullPaddingX: integer; + + /** + * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. + * + * See the method `setCullPadding` for more details. + */ + cullPaddingY: integer; + + /** + * The callback that is invoked when the tiles are culled. + * + * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. + * + * It will be sent 3 arguments: + * + * 1. The Phaser.Tilemaps.LayerData object for this Layer + * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. + * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. + * + * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. + */ + cullCallback: Function; + + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + */ + gidMap: Phaser.Tilemaps.Tileset[]; + + /** + * Sets the rendering (draw) order of the tiles in this layer. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * @param renderOrder The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + */ + setRenderOrder(renderOrder: integer | string): this; + + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * @param tileX The x coordinate. + * @param tileY The y coordinate. + */ + calculateFacesAt(tileX: integer, tileY: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + */ + calculateFacesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * @param indexes The tile index, or array of indexes, to create Sprites from. + * @param replacements The tile index, or array of indexes, to change a converted + * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a + * one-to-one mapping with the indexes array. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. + * scene.make.sprite). + * @param scene The Scene to create the Sprites within. Default scene the map is within. + * @param camera The Camera to use when determining the world XY Default main camera. + */ + createFromTiles(indexes: integer | any[], replacements: integer | any[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Sprite[]; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. + * This is used internally. + * @param camera The Camera to run the cull check against. + */ + cull(camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * @param srcTileX The x coordinate of the area to copy from, in tiles, not pixels. + * @param srcTileY The y coordinate of the area to copy from, in tiles, not pixels. + * @param width The width of the area to copy, in tiles, not pixels. + * @param height The height of the area to copy, in tiles, not pixels. + * @param destTileX The x coordinate of the area to copy to, in tiles, not pixels. + * @param destTileY The y coordinate of the area to copy to, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + copy(srcTileX: integer, srcTileY: integer, width: integer, height: integer, destTileX: integer, destTileY: integer, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Destroys this DynamicTilemapLayer and removes its link to the associated LayerData. + * @param removeFromTilemap Remove this layer from the parent Tilemap? Default true. + */ + destroy(removeFromTilemap?: boolean): void; + + /** + * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the + * specified index. Tiles will be set to collide if the given index is a colliding index. + * Collision information in the region will be recalculated. + * @param index The tile index to fill the area with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + fill(index: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + filterTiles(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * @param index The tile index value to search for. + * @param skip The number of times to skip a matching tile before returning. Default 0. + * @param reverse If true it will scan the layer in reverse, starting at the + * bottom-right. Otherwise it scans from the top-left. Default false. + */ + findByIndex(index: integer, skip?: integer, reverse?: boolean): Phaser.Tilemaps.Tile; + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + findTile(callback: FindTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + forEachTile(callback: EachTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Gets a tile at the given tile coordinates from the given layer. + * @param tileX X position to get the tile from (given in tile units, not pixels). + * @param tileY Y position to get the tile from (given in tile units, not pixels). + * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. Default false. + */ + getTileAt(tileX: integer, tileY: integer, nonNull?: boolean): Phaser.Tilemaps.Tile; + + /** + * Gets a tile at the given world coordinates from the given layer. + * @param worldX X position to get the tile from (given in pixels) + * @param worldY Y position to get the tile from (given in pixels) + * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + getTilesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * @param shape A shape in world (pixel) coordinates + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + */ + getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * @param worldX The world x coordinate for the top-left of the area. + * @param worldY The world y coordinate for the top-left of the area. + * @param width The width of the area. + * @param height The height of the area. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + */ + getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + */ + hasTileAt(tileX: integer, tileY: integer): boolean; + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + */ + hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index + * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified + * location. If you pass in an index, only the index at the specified location will be changed. + * Collision information will be recalculated at the specified location. + * @param tile The index of this tile to set or a Tile object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + putTileAt(tile: integer | Phaser.Tilemaps.Tile, tileX: integer, tileY: integer, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + + /** + * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either + * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the + * specified location. If you pass in an index, only the index at the specified location will be + * changed. Collision information will be recalculated at the specified location. + * @param tile The index of this tile to set or a Tile object. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + putTileAtWorldXY(tile: integer | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified + * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, + * all attributes will be copied over to the specified location. If you pass in an index, only the + * index at the specified location will be changed. Collision information will be recalculated + * within the region tiles were changed. + * @param tile A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + putTilesAt(tile: integer[] | integer[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: integer, tileY: integer, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then + * those will be used for randomly assigning new tile indexes. If an array is not provided, the + * indexes found within the region (excluding -1) will be used for randomly assigning new tile + * indexes. This method only modifies tile indexes and does not change collision information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param indexes An array of indexes to randomly draw from during randomization. + */ + randomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, indexes?: integer[]): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Removes the tile at the given tile coordinates in the specified layer and updates the layer's + * collision information. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + removeTileAt(tileX: integer, tileY: integer, replaceWithNull?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + + /** + * Removes the tile at the given world coordinates in the specified layer and updates the layer's + * collision information. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + removeTileAtWorldXY(worldX: number, worldY: number, replaceWithNull?: boolean, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * @param graphics The target Graphics object to draw upon. + * @param styleConfig An object specifying the colors to use for the debug drawing. + */ + renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does + * not change collision information. + * @param findIndex The index of the tile to search for. + * @param newIndex The index of the tile to replace it with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + */ + replaceByIndex(findIndex: integer, newIndex: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this. + * @param value Set to `true` to stop culling tiles. Set to `false` to enable culling again. Default true. + */ + setSkipCull(value?: boolean): this; + + /** + * When a Camera culls the tiles in this layer it does so using its view into the world, building up a + * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size + * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so + * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px + * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) + * @param paddingX The amount of extra horizontal tiles to add to the cull check padding. Default 1. + * @param paddingY The amount of extra vertical tiles to add to the cull check padding. Default 1. + */ + setCullPadding(paddingX?: integer, paddingY?: integer): this; + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * @param indexes Either a single tile index, or an array of tile indexes. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollision(indexes: integer | any[], collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * @param start The first index of the tile to be set for collision. + * @param stop The last index of the tile to be set for collision. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionBetween(start: integer, stop: integer, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * @param properties An object with tile properties and corresponding values that should be checked. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). + * @param indexes An array of the tile indexes to not be counted for collision. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionByExclusion(indexes: integer[], collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets collision on the tiles within a layer by checking each tiles collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tiles collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * @param indexes Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + */ + setTileIndexCallback(indexes: integer | integer[], callback: Function, callbackContext: object): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + */ + setTileLocationCallback(tileX?: integer, tileY?: integer, width?: integer, height?: integer, callback?: Function, callbackContext?: object): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given + * layer. It will only randomize the tiles in that area, so if they're all the same nothing will + * appear to have changed! This method only modifies tile indexes and does not change collision + * information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + */ + shuffle(tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision + * information. + * @param tileA First tile index. + * @param tileB Second tile index. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + */ + swapByIndex(tileA: integer, tileB: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileX The x coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + tileToWorldX(tileX: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + tileToWorldY(tileY: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + tileToWorldXY(tileX: integer, tileY: integer, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will recieve a new index. New indexes are drawn from the given + * weightedIndexes array. An example weighted array: + * + * [ + * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 + * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 + * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 + * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 + * ] + * + * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * method only modifies tile indexes and does not change collision information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param weightedIndexes An array of objects to randomly draw from during + * randomization. They should be in the form: { index: 0, weight: 4 } or + * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + */ + weightedRandomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, weightedIndexes?: object[]): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + namespace Formats { + /** + * CSV Map Type + */ + var CSV: number; + + /** + * Tiled JSON Map Type + */ + var TILED_JSON: number; + + /** + * 2D Array Map Type + */ + var ARRAY_2D: number; + + /** + * Weltmeister (Impact.js) Map Type + */ + var WELTMEISTER: number; + + } + + /** + * An Image Collection is a special Tile Set containing multiple images, with no slicing into each image. + * + * Image Collections are normally created automatically when Tiled data is loaded. + */ + class ImageCollection { + /** + * + * @param name The name of the image collection in the map data. + * @param firstgid The first image index this image collection contains. + * @param width Width of widest image (in pixels). Default 32. + * @param height Height of tallest image (in pixels). Default 32. + * @param margin The margin around all images in the collection (in pixels). Default 0. + * @param spacing The spacing between each image in the collection (in pixels). Default 0. + * @param properties Custom Image Collection properties. Default {}. + */ + constructor(name: string, firstgid: integer, width?: integer, height?: integer, margin?: integer, spacing?: integer, properties?: object); + + /** + * The name of the Image Collection. + */ + name: string; + + /** + * The Tiled firstgid value. + * This is the starting index of the first image index this Image Collection contains. + */ + firstgid: integer; + + /** + * The width of the widest image (in pixels). + */ + readonly imageWidth: integer; + + /** + * The height of the tallest image (in pixels). + */ + readonly imageHeight: integer; + + /** + * The margin around the images in the collection (in pixels). + * Use `setSpacing` to change. + */ + readonly imageMarge: integer; + + /** + * The spacing between each image in the collection (in pixels). + * Use `setSpacing` to change. + */ + readonly imageSpacing: integer; + + /** + * Image Collection-specific properties that are typically defined in the Tiled editor. + */ + properties: object; + + /** + * The cached images that are a part of this collection. + */ + readonly images: any[]; + + /** + * The total number of images in the image collection. + */ + readonly total: integer; + + /** + * Returns true if and only if this image collection contains the given image index. + * @param imageIndex The image index to search for. + */ + containsImageIndex(imageIndex: integer): boolean; + + /** + * Add an image to this Image Collection. + * @param gid The gid of the image in the Image Collection. + * @param image The the key of the image in the Image Collection and in the cache. + */ + addImage(gid: integer, image: string): Phaser.Tilemaps.ImageCollection; + + } + + /** + * A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled, + * etc. into this format. Tilemap, StaticTilemapLayer and DynamicTilemapLayer have a reference + * to this data and use it to look up and perform operations on tiles. + */ + class LayerData { + /** + * + * @param config [description] + */ + constructor(config?: object); + + /** + * The name of the layer, if specified in Tiled. + */ + name: string; + + /** + * The x offset of where to draw from the top left + */ + x: number; + + /** + * The y offset of where to draw from the top left + */ + y: number; + + /** + * The width in tile of the layer. + */ + width: number; + + /** + * The height in tiles of the layer. + */ + height: number; + + /** + * The pixel width of the tiles. + */ + tileWidth: number; + + /** + * The pixel height of the tiles. + */ + tileHeight: number; + + /** + * [description] + */ + baseTileWidth: number; + + /** + * [description] + */ + baseTileHeight: number; + + /** + * The width in pixels of the entire layer. + */ + widthInPixels: number; + + /** + * The height in pixels of the entire layer. + */ + heightInPixels: number; + + /** + * [description] + */ + alpha: number; + + /** + * [description] + */ + visible: boolean; + + /** + * Layer specific properties (can be specified in Tiled) + */ + properties: object; + + /** + * [description] + */ + indexes: any[]; + + /** + * [description] + */ + collideIndexes: any[]; + + /** + * [description] + */ + callbacks: any[]; + + /** + * [description] + */ + bodies: any[]; + + /** + * An array of the tile indexes + */ + data: number[]; + + /** + * [description] + */ + tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer; + + } + + /** + * A class for representing data about a map. Maps are parsed from CSV, Tiled, etc. into this + * format. A Tilemap object get a copy of this data and then unpacks the needed properties into + * itself. + */ + class MapData { + /** + * + * @param config The Map configuration object. + */ + constructor(config?: Phaser.Types.Tilemaps.MapDataConfig); + + /** + * The key in the Phaser cache that corresponds to the loaded tilemap data. + */ + name: string; + + /** + * The width of the entire tilemap. + */ + width: number; + + /** + * The height of the entire tilemap. + */ + height: number; + + /** + * If the map is infinite or not. + */ + infinite: boolean; + + /** + * The width of the tiles. + */ + tileWidth: number; + + /** + * The height of the tiles. + */ + tileHeight: number; + + /** + * The width in pixels of the entire tilemap. + */ + widthInPixels: number; + + /** + * The height in pixels of the entire tilemap. + */ + heightInPixels: number; + + /** + * [description] + */ + format: integer; + + /** + * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. + */ + orientation: string; + + /** + * Determines the draw order of tilemap. Default is right-down + * + * 0, or 'right-down' + * 1, or 'left-down' + * 2, or 'right-up' + * 3, or 'left-up' + */ + renderOrder: string; + + /** + * The version of the map data (as specified in Tiled). + */ + version: string; + + /** + * Map specific properties (can be specified in Tiled) + */ + properties: object; + + /** + * An array with all the layers configured to the MapData. + */ + layers: Phaser.Tilemaps.LayerData[] | Phaser.Tilemaps.ObjectLayer; + + /** + * An array of Tiled Image Layers. + */ + images: any[]; + + /** + * An object of Tiled Object Layers. + */ + objects: object; + + /** + * An object of collision data. Must be created as physics object or will return undefined. + */ + collision: object; + + /** + * An array of Tilesets. + */ + tilesets: Phaser.Tilemaps.Tileset[]; + + /** + * The collection of images the map uses(specified in Tiled) + */ + imageCollections: any[]; + + /** + * [description] + */ + tiles: any[]; + + } + + /** + * A class for representing a Tiled object layer in a map. This mirrors the structure of a Tiled + * object layer, except: + * - "x" & "y" properties are ignored since these cannot be changed in Tiled. + * - "offsetx" & "offsety" are applied to the individual object coordinates directly, so they + * are ignored as well. + * - "draworder" is ignored. + */ + class ObjectLayer { + /** + * + * @param config The data for the layer from the Tiled JSON object. + */ + constructor(config?: Phaser.Types.Tilemaps.ObjectLayerConfig); + + /** + * The name of the Object Layer. + */ + name: string; + + /** + * The opacity of the layer, between 0 and 1. + */ + opacity: number; + + /** + * The custom properties defined on the Object Layer, keyed by their name. + */ + properties: object; + + /** + * The type of each custom property defined on the Object Layer, keyed by its name. + */ + propertyTypes: object; + + /** + * The type of the layer, which should be `objectgroup`. + */ + type: string; + + /** + * Whether the layer is shown (`true`) or hidden (`false`). + */ + visible: boolean; + + /** + * An array of all objects on this Object Layer. + * + * Each Tiled object corresponds to a JavaScript object in this array. It has an `id` (unique), + * `name` (as assigned in Tiled), `type` (as assigned in Tiled), `rotation` (in clockwise degrees), + * `properties` (if any), `visible` state (`true` if visible, `false` otherwise), + * `x` and `y` coordinates (in pixels, relative to the tilemap), and a `width` and `height` (in pixels). + * + * An object tile has a `gid` property (GID of the represented tile), a `flippedHorizontal` property, + * a `flippedVertical` property, and `flippedAntiDiagonal` property. + * The {@link http://docs.mapeditor.org/en/latest/reference/tmx-map-format/|Tiled documentation} contains + * information on flipping and rotation. + * + * Polylines have a `polyline` property, which is an array of objects corresponding to points, + * where each point has an `x` property and a `y` property. Polygons have an identically structured + * array in their `polygon` property. Text objects have a `text` property with the text's properties. + * + * Rectangles and ellipses have a `rectangle` or `ellipse` property set to `true`. + */ + objects: Phaser.Types.Tilemaps.TiledObject[]; + + } + + namespace Parsers { + namespace Impact { + /** + * [description] + * @param json [description] + * @param insertNull [description] + */ + function ParseTileLayers(json: object, insertNull: boolean): any[]; + + /** + * [description] + * @param json [description] + */ + function ParseTilesets(json: object): any[]; + + /** + * Parses a Weltmeister JSON object into a new MapData object. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param json The Weltmeister JSON object. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function ParseWeltmeister(name: string, json: object, insertNull: boolean): object; + + } + + /** + * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format + * is found, returns `null`. When loading from CSV or a 2D array, you should specify the tileWidth & + * tileHeight. When parsing from a map from Tiled, the tileWidth & tileHeight will be pulled from + * the map data. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param mapFormat See ../Formats.js. + * @param data 2D array, CSV string or Tiled JSON object. + * @param tileWidth The width of a tile in pixels. Required for 2D array and CSV, but + * ignored for Tiled JSON. + * @param tileHeight The height of a tile in pixels. Required for 2D array and CSV, but + * ignored for Tiled JSON. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function Parse(name: string, mapFormat: integer, data: integer[][] | string | object, tileWidth: integer, tileHeight: integer, insertNull: boolean): Phaser.Tilemaps.MapData; + + /** + * Parses a 2D array of tile indexes into a new MapData object with a single layer. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param data 2D array, CSV string or Tiled JSON object. + * @param tileWidth The width of a tile in pixels. + * @param tileHeight The height of a tile in pixels. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function Parse2DArray(name: string, data: integer[][], tileWidth: integer, tileHeight: integer, insertNull: boolean): Phaser.Tilemaps.MapData; + + /** + * Parses a CSV string of tile indexes into a new MapData object with a single layer. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param data CSV string of tile indexes. + * @param tileWidth The width of a tile in pixels. + * @param tileHeight The height of a tile in pixels. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function ParseCSV(name: string, data: string, tileWidth: integer, tileHeight: integer, insertNull: boolean): Phaser.Tilemaps.MapData; + + namespace Tiled { + /** + * Copy properties from tileset to tiles. + * @param mapData [description] + */ + function AssignTileProperties(mapData: Phaser.Tilemaps.MapData): void; + + /** + * Decode base-64 encoded data, for example as exported by Tiled. + * @param data Base-64 encoded data to decode. + */ + function Base64Decode(data: object): any[]; + + /** + * Master list of tiles -> x, y, index in tileset. + * @param mapData [description] + */ + function BuildTilesetIndex(mapData: Phaser.Tilemaps.MapData): any[]; + + /** + * See Tiled documentation on tile flipping: + * http://docs.mapeditor.org/en/latest/reference/tmx-map-format/ + * @param gid [description] + */ + function ParseGID(gid: number): object; + + /** + * [description] + * @param json [description] + */ + function ParseImageLayers(json: object): any[]; + + /** + * Parses a Tiled JSON object into a new MapData object. + * @param name The name of the tilemap, used to set the name on the MapData. + * @param json The Tiled JSON object. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + */ + function ParseJSONTiled(name: string, json: object, insertNull: boolean): Phaser.Tilemaps.MapData; + + /** + * Convert a Tiled object to an internal parsed object normalising and copying properties over, while applying optional x and y offsets. The parsed object will always have the properties `id`, `name`, `type`, `rotation`, `properties`, `visible`, `x`, `y`, `width` and `height`. Other properties will be added according to the object type (such as text, polyline, gid etc.) + * @param tiledObject Tiled object to convert to an internal parsed object normalising and copying properties over. + * @param offsetX Optional additional offset to apply to the object's x property. Defaults to 0. Default 0. + * @param offsetY Optional additional offset to apply to the object's y property. Defaults to 0. Default 0. + */ + function ParseObject(tiledObject: object, offsetX?: number, offsetY?: number): object; + + /** + * Parses a Tiled JSON object into an array of ObjectLayer objects. + * @param json The Tiled JSON object. + */ + function ParseObjectLayers(json: object): any[]; + + /** + * [description] + * @param json [description] + * @param insertNull [description] + */ + function ParseTileLayers(json: object, insertNull: boolean): any[]; + + /** + * Tilesets and Image Collections + * @param json [description] + */ + function ParseTilesets(json: object): object; + + } + + } + + /** + * Create a Tilemap from the given key or data. If neither is given, make a blank Tilemap. When + * loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing from + * a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map data. For + * an empty map, you should specify tileWidth, tileHeight, width & height. + * @param scene The Scene to which this Tilemap belongs. + * @param key The key in the Phaser cache that corresponds to the loaded tilemap data. + * @param tileWidth The width of a tile in pixels. Default 32. + * @param tileHeight The height of a tile in pixels. Default 32. + * @param width The width of the map in tiles. Default 10. + * @param height The height of the map in tiles. Default 10. + * @param data Instead of loading from the cache, you can also load directly from + * a 2D array of tile indexes. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the + * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. Default false. + */ + function ParseToTilemap(scene: Phaser.Scene, key?: string, tileWidth?: integer, tileHeight?: integer, width?: integer, height?: integer, data?: integer[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; + + /** + * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. + * + * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile + * effects like tint or alpha, or change the tiles or tilesets the layer uses. + * + * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features. + */ + class StaticTilemapLayer extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param tilemap The Tilemap this layer is a part of. + * @param layerIndex The index of the LayerData associated with this layer. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The world x position where the top left of this layer will be placed. Default 0. + * @param y The world y position where the top left of this layer will be placed. Default 0. + */ + constructor(scene: Phaser.Scene, tilemap: Phaser.Tilemaps.Tilemap, layerIndex: integer, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number); + + /** + * Used internally by physics system to perform fast type checks. + */ + readonly isTilemap: boolean; + + /** + * The Tilemap that this layer is a part of. + */ + tilemap: Phaser.Tilemaps.Tilemap; + + /** + * The index of the LayerData associated with this layer. + */ + layerIndex: integer; + + /** + * The LayerData associated with this layer. LayerData can only be associated with one + * tilemap layer. + */ + layer: Phaser.Tilemaps.LayerData; + + /** + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. + */ + tileset: Phaser.Tilemaps.Tileset[]; + + /** + * Used internally by the Canvas renderer. + * This holds the tiles that are visible within the camera in the last frame. + */ + culledTiles: any[]; + + /** + * Canvas only. + * + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this, and toggling this flag allows + * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. + */ + skipCull: boolean; + + /** + * Canvas only. + * + * The total number of tiles drawn by the renderer in the last frame. + * + * This only works when rending with Canvas. + */ + readonly tilesDrawn: integer; + + /** + * Canvas only. + * + * The total number of tiles in this layer. Updated every frame. + */ + readonly tilesTotal: integer; + + /** + * Canvas only. + * + * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. + * + * See the method `setCullPadding` for more details. + */ + cullPaddingX: integer; + + /** + * Canvas only. + * + * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. + * + * See the method `setCullPadding` for more details. + */ + cullPaddingY: integer; + + /** + * Canvas only. + * + * The callback that is invoked when the tiles are culled. + * + * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. + * + * It will be sent 3 arguments: + * + * 1. The Phaser.Tilemaps.LayerData object for this Layer + * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. + * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. + * + * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. + */ + cullCallback: Function; + + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + */ + gidMap: Phaser.Tilemaps.Tileset[]; + + /** + * Upload the tile data to a VBO. + * @param camera The camera to render to. + * @param tilesetIndex The tileset index. + */ + upload(camera: Phaser.Cameras.Scene2D.Camera, tilesetIndex: integer): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets the rendering (draw) order of the tiles in this layer. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * @param renderOrder The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + */ + setRenderOrder(renderOrder: integer | string): this; + + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * @param tileX The x coordinate. + * @param tileY The y coordinate. + */ + calculateFacesAt(tileX: integer, tileY: integer): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + */ + calculateFacesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * @param indexes The tile index, or array of indexes, to create Sprites from. + * @param replacements The tile index, or array of indexes, to change a converted + * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a + * one-to-one mapping with the indexes array. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. + * scene.make.sprite). + * @param scene The Scene to create the Sprites within. Default scene the map is within. + * @param camera The Camera to use when determining the world XY Default main camera. + */ + createFromTiles(indexes: integer | any[], replacements: integer | any[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Sprite[]; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. + * This is used internally. + * @param camera The Camera to run the cull check against. + */ + cull(camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Canvas only. + * + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this. + * @param value Set to `true` to stop culling tiles. Set to `false` to enable culling again. Default true. + */ + setSkipCull(value?: boolean): this; + + /** + * Canvas only. + * + * When a Camera culls the tiles in this layer it does so using its view into the world, building up a + * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size + * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so + * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px + * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) + * @param paddingX The amount of extra horizontal tiles to add to the cull check padding. Default 1. + * @param paddingY The amount of extra vertical tiles to add to the cull check padding. Default 1. + */ + setCullPadding(paddingX?: integer, paddingY?: integer): this; + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * @param index The tile index value to search for. + * @param skip The number of times to skip a matching tile before returning. Default 0. + * @param reverse If true it will scan the layer in reverse, starting at the + * bottom-right. Otherwise it scans from the top-left. Default false. + */ + findByIndex(index: integer, skip?: integer, reverse?: boolean): Phaser.Tilemaps.Tile; + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + findTile(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param context The context under which the callback should be run. + * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + filterTiles(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + forEachTile(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Gets a tile at the given tile coordinates from the given layer. + * @param tileX X position to get the tile from (given in tile units, not pixels). + * @param tileY Y position to get the tile from (given in tile units, not pixels). + * @param nonNull If true getTile won't return null for empty tiles, but a Tile + * object with an index of -1. Default false. + */ + getTileAt(tileX: integer, tileY: integer, nonNull?: boolean): Phaser.Tilemaps.Tile; + + /** + * Gets a tile at the given world coordinates from the given layer. + * @param worldX X position to get the tile from (given in pixels) + * @param worldY Y position to get the tile from (given in pixels) + * @param nonNull If true, function won't return null for empty tiles, but a Tile + * object with an index of -1. Default false. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + getTilesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * @param worldX The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param worldY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles high from the `tileY` index the area will be. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + */ + getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * @param shape A shape in world (pixel) coordinates + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param tileX X position to get the tile from in tile coordinates. + * @param tileY Y position to get the tile from in tile coordinates. + */ + hasTileAt(tileX: integer, tileY: integer): boolean; + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param worldX The X coordinate of the world position. + * @param worldY The Y coordinate of the world position. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * @param graphics The target Graphics object to draw upon. + * @param styleConfig An object specifying the colors to use for the debug drawing. + */ + renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * @param indexes Either a single tile index, or an array of tile indexes. + * @param collides If true it will enable collision. If false it will clear + * collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the + * update. Default true. + */ + setCollision(indexes: integer | any[], collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * @param start The first index of the tile to be set for collision. + * @param stop The last index of the tile to be set for collision. + * @param collides If true it will enable collision. If false it will clear + * collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the + * update. Default true. + */ + setCollisionBetween(start: integer, stop: integer, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * @param properties An object with tile properties and corresponding values that should + * be checked. + * @param collides If true it will enable collision. If false it will clear + * collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the + * update. Default true. + */ + setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). + * @param indexes An array of the tile indexes to not be counted for collision. + * @param collides If true it will enable collision. If false it will clear + * collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the + * update. Default true. + */ + setCollisionByExclusion(indexes: integer[], collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * @param indexes Either a single tile index, or an array of tile indexes to have a + * collision callback set for. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + */ + setTileIndexCallback(indexes: integer | any[], callback: Function, callbackContext: object): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets collision on the tiles within a layer by checking each tiles collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tiles collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * @param collides If true it will enable collision. If false it will clear + * collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the + * update. Default true. + */ + setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + */ + setTileLocationCallback(tileX: integer, tileY: integer, width: integer, height: integer, callback: Function, callbackContext?: object): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileX The X coordinate, in tile coordinates. + * @param camera The Camera to use when calculating the world values from the tile index. Default main camera. + */ + tileToWorldX(tileX: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileY The Y coordinate, in tile coordinates. + * @param camera The Camera to use when calculating the world values from the tile index. Default main camera. + */ + tileToWorldY(tileY: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The X coordinate, in tile coordinates. + * @param tileY The Y coordinate, in tile coordinates. + * @param point A Vector2 to store the coordinates in. If not given, a new Vector2 is created. + * @param camera The Camera to use when calculating the world values from the tile index. Default main camera. + */ + tileToWorldXY(tileX: integer, tileY: integer, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldX The X coordinate, in world pixels. + * @param snapToFloor Whether or not to round the tile coordinate down to the + * nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values.] Default main camera. + */ + worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldY The Y coordinate, in world pixels. + * @param snapToFloor Whether or not to round the tile coordinate down to the + * nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The X coordinate, in world pixels. + * @param worldY The Y coordinate, in world pixels. + * @param snapToFloor Whether or not to round the tile coordinate down to the + * nearest integer. Default true. + * @param point A Vector2 to store the coordinates in. If not given, a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + */ + worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Destroys this StaticTilemapLayer and removes its link to the associated LayerData. + * @param removeFromTilemap Remove this layer from the parent Tilemap? Default true. + */ + destroy(removeFromTilemap?: boolean): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: integer): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + */ + initPipeline(pipelineName?: string): boolean; + + /** + * Sets the active WebGL Pipeline of this Game Object. + * @param pipelineName The name of the pipeline to set on this Game Object. + */ + setPipeline(pipelineName: string): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + */ + resetPipeline(): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: integer; + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + } + + /** + * A Tile is a representation of a single tile within the Tilemap. This is a lightweight data + * representation, so its position information is stored without factoring in scroll, layer + * scale or layer position. + */ + class Tile implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Visible { + /** + * + * @param layer The LayerData object in the Tilemap that this tile belongs to. + * @param index The unique index of this tile within the map. + * @param x The x coordinate of this tile in tile coordinates. + * @param y The y coordinate of this tile in tile coordinates. + * @param width Width of the tile in pixels. + * @param height Height of the tile in pixels. + * @param baseWidth The base width a tile in the map (in pixels). Tiled maps support + * multiple tileset sizes within one map, but they are still placed at intervals of the base + * tile width. + * @param baseHeight The base height of the tile in pixels (in pixels). Tiled maps + * support multiple tileset sizes within one map, but they are still placed at intervals of the + * base tile height. + */ + constructor(layer: Phaser.Tilemaps.LayerData, index: integer, x: integer, y: integer, width: integer, height: integer, baseWidth: integer, baseHeight: integer); + + /** + * The LayerData in the Tilemap data that this tile belongs to. + */ + layer: Phaser.Tilemaps.LayerData; + + /** + * The index of this tile within the map data corresponding to the tileset, or -1 if this + * represents a blank tile. + */ + index: integer; + + /** + * The x map coordinate of this tile in tile units. + */ + x: integer; + + /** + * The y map coordinate of this tile in tile units. + */ + y: integer; + + /** + * The width of the tile in pixels. + */ + width: integer; + + /** + * The height of the tile in pixels. + */ + height: integer; + + /** + * The map's base width of a tile in pixels. Tiled maps support multiple tileset sizes + * within one map, but they are still placed at intervals of the base tile size. + */ + baseWidth: integer; + + /** + * The map's base height of a tile in pixels. Tiled maps support multiple tileset sizes + * within one map, but they are still placed at intervals of the base tile size. + */ + baseHeight: integer; + + /** + * The x coordinate of the top left of this tile in pixels. This is relative to the top left + * of the layer this tile is being rendered within. This property does NOT factor in camera + * scroll, layer scale or layer position. + */ + pixelX: number; + + /** + * The y coordinate of the top left of this tile in pixels. This is relative to the top left + * of the layer this tile is being rendered within. This property does NOT factor in camera + * scroll, layer scale or layer position. + */ + pixelY: number; + + /** + * Tile specific properties. These usually come from Tiled. + */ + properties: any; + + /** + * The rotation angle of this tile. + */ + rotation: number; + + /** + * Whether the tile should collide with any object on the left side. + */ + collideLeft: boolean; + + /** + * Whether the tile should collide with any object on the right side. + */ + collideRight: boolean; + + /** + * Whether the tile should collide with any object on the top side. + */ + collideUp: boolean; + + /** + * Whether the tile should collide with any object on the bottom side. + */ + collideDown: boolean; + + /** + * Whether the tile's left edge is interesting for collisions. + */ + faceLeft: boolean; + + /** + * Whether the tile's right edge is interesting for collisions. + */ + faceRight: boolean; + + /** + * Whether the tile's top edge is interesting for collisions. + */ + faceTop: boolean; + + /** + * Whether the tile's bottom edge is interesting for collisions. + */ + faceBottom: boolean; + + /** + * Tile collision callback. + */ + collisionCallback: Function; + + /** + * The context in which the collision callback will be called. + */ + collisionCallbackContext: object; + + /** + * The tint to apply to this tile. Note: tint is currently a single color value instead of + * the 4 corner tint component on other GameObjects. + */ + tint: number; + + /** + * An empty object where physics-engine specific information (e.g. bodies) may be stored. + */ + physics: object; + + /** + * Check if the given x and y world coordinates are within this Tile. This does not factor in + * camera scroll, layer scale or layer position. + * @param x The x coordinate to test. + * @param y The y coordinate to test. + */ + containsPoint(x: number, y: number): boolean; + + /** + * Copies the tile data & properties from the given tile to this tile. This copies everything + * except for position and interesting faces. + * @param tile The tile to copy from. + */ + copy(tile: Phaser.Tilemaps.Tile): Phaser.Tilemaps.Tile; + + /** + * The collision group for this Tile, defined within the Tileset. This returns a reference to + * the collision group stored within the Tileset, so any modification of the returned object + * will impact all tiles that have the same index as this tile. + */ + getCollisionGroup(): object; + + /** + * The tile data for this Tile, defined within the Tileset. This typically contains Tiled + * collision data, tile animations and terrain information. This returns a reference to the tile + * data stored within the Tileset, so any modification of the returned object will impact all + * tiles that have the same index as this tile. + */ + getTileData(): object; + + /** + * Gets the world X position of the left side of the tile, factoring in the layers position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getLeft(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Gets the world X position of the right side of the tile, factoring in the layer's position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getRight(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Gets the world Y position of the top side of the tile, factoring in the layer's position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getTop(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Gets the world Y position of the bottom side of the tile, factoring in the layer's position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getBottom(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Gets the world rectangle bounding box for the tile, factoring in the layers position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + * @param output [description] + */ + getBounds(camera?: Phaser.Cameras.Scene2D.Camera, output?: object): Phaser.Geom.Rectangle | object; + + /** + * Gets the world X position of the center of the tile, factoring in the layer's position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getCenterX(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Gets the world Y position of the center of the tile, factoring in the layer's position, + * scale and scroll. + * @param camera The Camera to use to perform the check. + */ + getCenterY(camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Clean up memory. + */ + destroy(): void; + + /** + * Check for intersection with this tile. This does not factor in camera scroll, layer scale or + * layer position. + * @param x The x axis in pixels. + * @param y The y axis in pixels. + * @param right The right point. + * @param bottom The bottom point. + */ + intersects(x: number, y: number, right: number, bottom: number): boolean; + + /** + * Checks if the tile is interesting. + * @param collides If true, will consider the tile interesting if it collides on any side. + * @param faces If true, will consider the tile interesting if it has an interesting face. + */ + isInteresting(collides: boolean, faces: boolean): boolean; + + /** + * Reset collision status flags. + * @param recalculateFaces Whether or not to recalculate interesting faces for this tile and its neighbors. Default true. + */ + resetCollision(recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + + /** + * Reset faces. + */ + resetFaces(): Phaser.Tilemaps.Tile; + + /** + * Sets the collision flags for each side of this tile and updates the interesting faces list. + * @param left Indicating collide with any object on the left. + * @param right Indicating collide with any object on the right. + * @param up Indicating collide with any object on the top. + * @param down Indicating collide with any object on the bottom. + * @param recalculateFaces Whether or not to recalculate interesting faces + * for this tile and its neighbors. Default true. + */ + setCollision(left: boolean, right?: boolean, up?: boolean, down?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + + /** + * Set a callback to be called when this tile is hit by an object. The callback must true for + * collision processing to take place. + * @param callback Callback function. + * @param context Callback will be called within this context. + */ + setCollisionCallback(callback: Function, context: object): Phaser.Tilemaps.Tile; + + /** + * Sets the size of the tile and updates its pixelX and pixelY. + * @param tileWidth The width of the tile in pixels. + * @param tileHeight The height of the tile in pixels. + * @param baseWidth The base width a tile in the map (in pixels). + * @param baseHeight The base height of the tile in pixels (in pixels). + */ + setSize(tileWidth: integer, tileHeight: integer, baseWidth: integer, baseHeight: integer): Phaser.Tilemaps.Tile; + + /** + * Used internally. Updates the tile's world XY position based on the current tile size. + */ + updatePixelXY(): Phaser.Tilemaps.Tile; + + /** + * True if this tile can collide on any of its faces or has a collision callback set. + */ + readonly canCollide: boolean; + + /** + * True if this tile can collide on any of its faces. + */ + readonly collides: boolean; + + /** + * True if this tile has any interesting faces. + */ + readonly hasInterestingFace: boolean; + + /** + * The tileset that contains this Tile. This is null if accessed from a LayerData instance + * before the tile is placed in a StaticTilemapLayer or DynamicTilemapLayer, or if the tile has + * an index that doesn't correspond to any of the map's tilesets. + */ + readonly tileset: Phaser.Tilemaps.Tileset; + + /** + * The tilemap layer that contains this Tile. This will only return null if accessed from a + * LayerData instance before the tile is placed within a StaticTilemapLayer or + * DynamicTilemapLayer. + */ + readonly tilemapLayer: Phaser.Tilemaps.StaticTilemapLayer | Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * The tilemap that contains this Tile. This will only return null if accessed from a LayerData + * instance before the tile is placed within a StaticTilemapLayer or DynamicTilemapLayer. + */ + readonly tilemap: Phaser.Tilemaps.Tilemap; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A Tilemap is a container for Tilemap data. This isn't a display object, rather, it holds data + * about the map and allows you to add tilesets and tilemap layers to it. A map can have one or + * more tilemap layers (StaticTilemapLayer or DynamicTilemapLayer), which are the display + * objects that actually render tiles. + * + * The Tilemap data be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free + * software package specifically for creating tile maps, and is available from: + * http://www.mapeditor.org + * + * A Tilemap has handy methods for getting & manipulating the tiles within a layer. You can only + * use the methods that change tiles (e.g. removeTileAt) on a DynamicTilemapLayer. + * + * Note that all Tilemaps use a base tile size to calculate dimensions from, but that a + * StaticTilemapLayer or DynamicTilemapLayer may have its own unique tile size that overrides + * it. + */ + class Tilemap { + /** + * + * @param scene The Scene to which this Tilemap belongs. + * @param mapData A MapData instance containing Tilemap data. + */ + constructor(scene: Phaser.Scene, mapData: Phaser.Tilemaps.MapData); + + scene: Phaser.Scene; + + /** + * The base width of a tile in pixels. Note that individual layers may have a different tile + * width. + */ + tileWidth: integer; + + /** + * The base height of a tile in pixels. Note that individual layers may have a different + * tile height. + */ + tileHeight: integer; + + /** + * The width of the map (in tiles). + */ + width: number; + + /** + * The height of the map (in tiles). + */ + height: number; + + /** + * The orientation of the map data (as specified in Tiled), usually 'orthogonal'. + */ + orientation: string; + + /** + * The render (draw) order of the map data (as specified in Tiled), usually 'right-down'. + * + * The draw orders are: + * + * right-down + * left-down + * right-up + * left-up + * + * This can be changed via the `setRenderOrder` method. + */ + renderOrder: string; + + /** + * The format of the map data. + */ + format: number; + + /** + * The version of the map data (as specified in Tiled, usually 1). + */ + version: number; + + /** + * Map specific properties as specified in Tiled. + */ + properties: object; + + /** + * The width of the map in pixels based on width * tileWidth. + */ + widthInPixels: number; + + /** + * The height of the map in pixels based on height * tileHeight. + */ + heightInPixels: number; + + imageCollections: Phaser.Tilemaps.ImageCollection[]; + + /** + * An array of Tiled Image Layers. + */ + images: any[]; + + /** + * An array of Tilemap layer data. + */ + layers: Phaser.Tilemaps.LayerData[]; + + /** + * An array of Tilesets used in the map. + */ + tilesets: Phaser.Tilemaps.Tileset[]; + + /** + * An array of ObjectLayer instances parsed from Tiled object layers. + */ + objects: Phaser.Tilemaps.ObjectLayer[]; + + /** + * The index of the currently selected LayerData object. + */ + currentLayerIndex: integer; + + /** + * Sets the rendering (draw) order of the tiles in this map. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * + * Calling this method _after_ creating Static or Dynamic Tilemap Layers will **not** automatically + * update them to use the new render order. If you call this method after creating layers, use their + * own `setRenderOrder` methods to change them as needed. + * @param renderOrder The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + */ + setRenderOrder(renderOrder: integer | string): this; + + /** + * Adds an image to the map to be used as a tileset. A single map may use multiple tilesets. + * Note that the tileset name can be found in the JSON file exported from Tiled, or in the Tiled + * editor. + * @param tilesetName The name of the tileset as specified in the map data. + * @param key The key of the Phaser.Cache image used for this tileset. If + * `undefined` or `null` it will look for an image with a key matching the tilesetName parameter. + * @param tileWidth The width of the tile (in pixels) in the Tileset Image. If not + * given it will default to the map's tileWidth value, or the tileWidth specified in the Tiled + * JSON file. + * @param tileHeight The height of the tiles (in pixels) in the Tileset Image. If + * not given it will default to the map's tileHeight value, or the tileHeight specified in the + * Tiled JSON file. + * @param tileMargin The margin around the tiles in the sheet (in pixels). If not + * specified, it will default to 0 or the value specified in the Tiled JSON file. + * @param tileSpacing The spacing between each the tile in the sheet (in pixels). + * If not specified, it will default to 0 or the value specified in the Tiled JSON file. + * @param gid If adding multiple tilesets to a blank map, specify the starting + * GID this set will use here. Default 0. + */ + addTilesetImage(tilesetName: string, key?: string, tileWidth?: integer, tileHeight?: integer, tileMargin?: integer, tileSpacing?: integer, gid?: integer): Phaser.Tilemaps.Tileset; + + /** + * Turns the DynamicTilemapLayer associated with the given layer into a StaticTilemapLayer. If + * no layer specified, the map's current layer is used. This is useful if you want to manipulate + * a map at the start of a scene, but then make it non-manipulable and optimize it for speed. + * Note: the DynamicTilemapLayer passed in is destroyed, so make sure to store the value + * returned from this method if you want to manipulate the new StaticTilemapLayer. + * @param layer The name of the layer from Tiled, the + * index of the layer in the map, or a DynamicTilemapLayer. + */ + convertLayerToStatic(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * + * If no layer specified, the map's current layer is used. This cannot be applied to StaticTilemapLayers. + * @param srcTileX The x coordinate of the area to copy from, in tiles, not pixels. + * @param srcTileY The y coordinate of the area to copy from, in tiles, not pixels. + * @param width The width of the area to copy, in tiles, not pixels. + * @param height The height of the area to copy, in tiles, not pixels. + * @param destTileX The x coordinate of the area to copy to, in tiles, not pixels. + * @param destTileY The y coordinate of the area to copy to, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + copy(srcTileX: integer, srcTileY: integer, width: integer, height: integer, destTileX: integer, destTileY: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer. + * @param name The name of this layer. Must be unique within the map. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The world x position where the top left of this layer will be placed. Default 0. + * @param y The world y position where the top left of this layer will be placed. Default 0. + * @param width The width of the layer in tiles. If not specified, it will default to the map's width. + * @param height The height of the layer in tiles. If not specified, it will default to the map's height. + * @param tileWidth The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. + * @param tileHeight The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. + */ + createBlankDynamicLayer(name: string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number, width?: integer, height?: integer, tileWidth?: integer, tileHeight?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Creates a new DynamicTilemapLayer that renders the LayerData associated with the given + * `layerID`. The currently selected layer in the map is set to this new layer. + * + * The `layerID` is important. If you've created your map in Tiled then you can get this by + * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and + * look at the layers[].name value. Either way it must match. + * + * Unlike a static layer, a dynamic layer can be modified. See DynamicTilemapLayer for more + * information. + * @param layerID The layer array index value, or if a string is given, the layer name from Tiled. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. + * @param y The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. + */ + createDynamicLayer(layerID: integer | string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number): Phaser.Tilemaps.DynamicTilemapLayer; + + /** + * Creates a Sprite for every object matching the given gid in the map data. All properties from + * the map data objectgroup are copied into the `spriteConfig`, so you can use this as an easy + * way to configure Sprite properties from within the map editor. For example giving an object a + * property of alpha: 0.5 in the map editor will duplicate that when the Sprite is created. + * + * Custom object properties not sharing names with the Sprite's own properties are copied to the + * Sprite's {@link Phaser.GameObjects.Sprite#data data store}. + * @param name The name of the object layer (from Tiled) to create Sprites from. + * @param id Either the id (object), gid (tile object) or name (object or + * tile object) from Tiled. Ids are unique in Tiled, but a gid is shared by all tile objects + * with the same graphic. The same name can be used on multiple objects. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. + * scene.make.sprite). + * @param scene The Scene to create the Sprites within. Default the scene the map is within. + */ + createFromObjects(name: string, id: integer | string, spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene): Phaser.GameObjects.Sprite[]; + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * @param indexes The tile index, or array of indexes, to create Sprites from. + * @param replacements The tile index, or array of indexes, to change a converted + * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a + * one-to-one mapping with the indexes array. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. scene.make.sprite). + * @param scene The Scene to create the Sprites within. Default scene the map is within. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + createFromTiles(indexes: integer | any[], replacements: integer | any[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.GameObjects.Sprite[]; + + /** + * Creates a new StaticTilemapLayer that renders the LayerData associated with the given + * `layerID`. The currently selected layer in the map is set to this new layer. + * + * The `layerID` is important. If you've created your map in Tiled then you can get this by + * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and + * look at the layers[].name value. Either way it must match. + * + * It's important to remember that a static layer cannot be modified. See StaticTilemapLayer for + * more information. + * @param layerID The layer array index value, or if a string is given, the layer name from Tiled. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. + * @param y The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. + */ + createStaticLayer(layerID: integer | string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number): Phaser.Tilemaps.StaticTilemapLayer; + + /** + * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any + * StaticTilemapLayers or DynamicTilemapLayers that have been linked to LayerData. + */ + destroy(): void; + + /** + * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the + * specified index. Tiles will be set to collide if the given index is a colliding index. + * Collision information in the region will be recalculated. + * + * If no layer specified, the map's current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param index The tile index to fill the area with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + fill(index: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * For each object in the given object layer, run the given filter callback function. Any + * objects that pass the filter test (i.e. where the callback returns true) will returned as a + * new array. Similar to Array.prototype.Filter in vanilla JS. + * @param objectLayer The name of an object layer (from Tiled) or an ObjectLayer instance. + * @param callback The callback. Each object in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + */ + filterObjects(objectLayer: Phaser.Tilemaps.ObjectLayer | string, callback: TilemapFilterCallback, context?: object): Phaser.GameObjects.GameObject[]; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * If no layer specified, the map's current layer is used. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The tile layer to use. If not given the current layer is used. + */ + filterTiles(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * If no layer specified, the map's current layer is used. + * @param index The tile index value to search for. + * @param skip The number of times to skip a matching tile before returning. Default 0. + * @param reverse If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. Default false. + * @param layer The tile layer to use. If not given the current layer is used. + */ + findByIndex(index: integer, skip?: integer, reverse?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Find the first object in the given object layer that satisfies the provided testing function. + * I.e. finds the first object for which `callback` returns true. Similar to + * Array.prototype.find in vanilla JS. + * @param objectLayer The name of an object layer (from Tiled) or an ObjectLayer instance. + * @param callback The callback. Each object in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + */ + findObject(objectLayer: Phaser.Tilemaps.ObjectLayer | string, callback: TilemapFindCallback, context?: object): Phaser.GameObjects.GameObject; + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * If no layer specified, the maps current layer is used. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tile layer to run the search on. If not provided will use the current layer. + */ + findTile(callback: FindTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * + * If no layer specified, the map's current layer is used. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tile layer to run the search on. If not provided will use the current layer. + */ + forEachTile(callback: EachTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Gets the image layer index based on its name. + * @param name The name of the image to get. + */ + getImageIndex(name: string): integer; + + /** + * Internally used. Returns the index of the object in one of the Tilemaps arrays whose name + * property matches the given `name`. + * @param location The Tilemap array to search. + * @param name The name of the array element to get. + */ + getIndex(location: any[], name: string): number; + + /** + * Gets the LayerData from this.layers that is associated with `layer`, or null if an invalid + * `layer` is given. + * @param layer The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the maps current layer index. + */ + getLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.LayerData; + + /** + * Gets the ObjectLayer from this.objects that has the given `name`, or null if no ObjectLayer + * is found with that name. + * @param name The name of the object layer from Tiled. + */ + getObjectLayer(name?: string): Phaser.Tilemaps.ObjectLayer; + + /** + * Gets the LayerData index of the given `layer` within this.layers, or null if an invalid + * `layer` is given. + * @param layer The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the map's current layer index. + */ + getLayerIndex(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): integer; + + /** + * Gets the index of the LayerData within this.layers that has the given `name`, or null if an + * invalid `name` is given. + * @param name The name of the layer to get. + */ + getLayerIndexByName(name: string): integer; + + /** + * Gets a tile at the given tile coordinates from the given layer. + * If no layer specified, the map's current layer is used. + * @param tileX X position to get the tile from (given in tile units, not pixels). + * @param tileY Y position to get the tile from (given in tile units, not pixels). + * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param layer The tile layer to use. If not given the current layer is used. + */ + getTileAt(tileX: integer, tileY: integer, nonNull?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Gets a tile at the given world coordinates from the given layer. + * If no layer specified, the map's current layer is used. + * @param worldX X position to get the tile from (given in pixels) + * @param worldY Y position to get the tile from (given in pixels) + * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * If no layer specified, the maps current layer is used. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The tile layer to use. If not given the current layer is used. + */ + getTilesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * If no layer specified, the maps current layer is used. + * @param shape A shape in world (pixel) coordinates + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * If no layer specified, the maps current layer is used. + * @param worldX The world x coordinate for the top-left of the area. + * @param worldY The world y coordinate for the top-left of the area. + * @param width The width of the area. + * @param height The height of the area. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + + /** + * Gets the Tileset that has the given `name`, or null if an invalid `name` is given. + * @param name The name of the Tileset to get. + */ + getTileset(name: string): Phaser.Tilemaps.Tileset; + + /** + * Gets the index of the Tileset within this.tilesets that has the given `name`, or null if an + * invalid `name` is given. + * @param name The name of the Tileset to get. + */ + getTilesetIndex(name: string): integer; + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * If no layer specified, the map's current layer is used. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param layer The tile layer to use. If not given the current layer is used. + */ + hasTileAt(tileX: integer, tileY: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): boolean; + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * If no layer specified, the maps current layer is used. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): boolean; + + /** + * The LayerData object that is currently selected in the map. You can set this property using + * any type supported by setLayer. + */ + layer: Phaser.Tilemaps.LayerData; + + /** + * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index + * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified + * location. If you pass in an index, only the index at the specified location will be changed. + * Collision information will be recalculated at the specified location. + * + * If no layer specified, the maps current layer is used. + * + * This cannot be applied to StaticTilemapLayers. + * @param tile The index of this tile to set or a Tile object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + putTileAt(tile: integer | Phaser.Tilemaps.Tile, tileX: integer, tileY: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either + * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the + * specified location. If you pass in an index, only the index at the specified location will be + * changed. Collision information will be recalculated at the specified location. + * + * If no layer specified, the maps current layer is used. This + * cannot be applied to StaticTilemapLayers. + * @param tile The index of this tile to set or a Tile object. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + putTileAtWorldXY(tile: integer | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified + * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, + * all attributes will be copied over to the specified location. If you pass in an index, only the + * index at the specified location will be changed. Collision information will be recalculated + * within the region tiles were changed. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param tile A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + putTilesAt(tile: integer[] | integer[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: integer, tileY: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then + * those will be used for randomly assigning new tile indexes. If an array is not provided, the + * indexes found within the region (excluding -1) will be used for randomly assigning new tile + * indexes. This method only modifies tile indexes and does not change collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param indexes An array of indexes to randomly draw from during randomization. + * @param layer The tile layer to use. If not given the current layer is used. + */ + randomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, indexes?: integer[], layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * + * If no layer specified, the maps current layer is used. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param layer The tile layer to use. If not given the current layer is used. + */ + calculateFacesAt(tileX: integer, tileY: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * + * If no layer specified, the map's current layer is used. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param layer The tile layer to use. If not given the current layer is used. + */ + calculateFacesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Removes the given TilemapLayer from this Tilemap without destroying it. + * + * If no layer specified, the map's current layer is used. + * @param layer The tile layer to be removed. + */ + removeLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Destroys the given TilemapLayer and removes it from this Tilemap. + * + * If no layer specified, the map's current layer is used. + * @param layer The tile layer to be destroyed. + */ + destroyLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Removes all layers from this Tilemap and destroys any associated StaticTilemapLayers or + * DynamicTilemapLayers. + */ + removeAllLayers(): Phaser.Tilemaps.Tilemap; + + /** + * Removes the given Tile, or an array of Tiles, from the layer to which they belong, + * and optionally recalculates the collision information. + * + * This cannot be applied to Tiles that belong to Static Tilemap Layers. + * @param tiles The Tile to remove, or an array of Tiles. + * @param replaceIndex After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile. Default -1. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + removeTile(tiles: Phaser.Tilemaps.Tile | Phaser.Tilemaps.Tile[], replaceIndex?: integer, recalculateFaces?: boolean): Phaser.Tilemaps.Tile[]; + + /** + * Removes the tile at the given tile coordinates in the specified layer and updates the layer's + * collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + removeTileAt(tileX: integer, tileY: integer, replaceWithNull?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Removes the tile at the given world coordinates in the specified layer and updates the layer's + * collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + removeTileAtWorldXY(worldX: number, worldY: number, replaceWithNull?: boolean, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * + * If no layer specified, the maps current layer is used. + * @param graphics The target Graphics object to draw upon. + * @param styleConfig An object specifying the colors to use for the debug drawing. + * @param layer The tile layer to use. If not given the current layer is used. + */ + renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Draws a debug representation of all layers within this Tilemap to the given Graphics object. + * + * This is helpful when you want to get a quick idea of which of your tiles are colliding and which + * have interesting faces. The tiles are drawn starting at (0, 0) in the Graphics, allowing you to + * place the debug representation wherever you want on the screen. + * @param graphics The target Graphics object to draw upon. + * @param styleConfig An object specifying the colors to use for the debug drawing. + * @param layer The tile layer to use. If not given the current layer is used. + */ + renderDebugFull(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does + * not change collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param findIndex The index of the tile to search for. + * @param newIndex The index of the tile to replace it with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param layer The tile layer to use. If not given the current layer is used. + */ + replaceByIndex(findIndex: integer, newIndex: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * + * If no layer specified, the map's current layer is used. + * @param indexes Either a single tile index, or an array of tile indexes. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setCollision(indexes: integer | any[], collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * + * If no layer specified, the map's current layer is used. + * @param start The first index of the tile to be set for collision. + * @param stop The last index of the tile to be set for collision. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setCollisionBetween(start: integer, stop: integer, collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * + * If no layer specified, the map's current layer is used. + * @param properties An object with tile properties and corresponding values that should be checked. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). + * + * If no layer specified, the map's current layer is used. + * @param indexes An array of the tile indexes to not be counted for collision. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setCollisionByExclusion(indexes: integer[], collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets collision on the tiles within a layer by checking each tile's collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tile's collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * + * If no layer specified, the map's current layer is used. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * + * If no layer specified, the map's current layer is used. + * @param indexes Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setTileIndexCallback(indexes: integer | any[], callback: Function, callbackContext: object, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets a collision callback for the given rectangular area (in tile coordindates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * + * If no layer specified, the map's current layer is used. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + * @param layer The tile layer to use. If not given the current layer is used. + */ + setTileLocationCallback(tileX: integer, tileY: integer, width: integer, height: integer, callback: Function, callbackContext?: object, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets the current layer to the LayerData associated with `layer`. + * @param layer The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the map's current layer index. + */ + setLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Sets the base tile size for the map. Note: this does not necessarily match the tileWidth and + * tileHeight for all layers. This also updates the base size on all tiles across all layers. + * @param tileWidth The width of the tiles the map uses for calculations. + * @param tileHeight The height of the tiles the map uses for calculations. + */ + setBaseTileSize(tileWidth: integer, tileHeight: integer): Phaser.Tilemaps.Tilemap; + + /** + * Sets the tile size for a specific `layer`. Note: this does not necessarily match the map's + * tileWidth and tileHeight for all layers. This will set the tile size for the layer and any + * tiles the layer has. + * @param tileWidth The width of the tiles (in pixels) in the layer. + * @param tileHeight The height of the tiles (in pixels) in the layer. + * @param layer The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the map's current layer index. + */ + setLayerTileSize(tileWidth: integer, tileHeight: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given + * layer. It will only randomize the tiles in that area, so if they're all the same nothing will + * appear to have changed! This method only modifies tile indexes and does not change collision + * information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param layer The tile layer to use. If not given the current layer is used. + */ + shuffle(tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision + * information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * @param tileA First tile index. + * @param tileB Second tile index. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param layer The tile layer to use. If not given the current layer is used. + */ + swapByIndex(tileA: integer, tileB: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * @param tileX The x coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + tileToWorldX(tileX: integer, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer + * to use. If not given the current layer is used. + */ + tileToWorldY(tileY: integer, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * If no layer specified, the maps current layer is used. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + tileToWorldXY(tileX: integer, tileY: integer, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Math.Vector2; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. New indexes are drawn from the given + * weightedIndexes array. An example weighted array: + * + * [ + * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 + * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 + * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 + * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 + * ] + * + * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * method only modifies tile indexes and does not change collision information. + * + * If no layer specified, the map's current layer is used. This + * cannot be applied to StaticTilemapLayers. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. + * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. + * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param weightedIndexes An array of objects to randomly draw from during + * randomization. They should be in the form: { index: 0, weight: 4 } or + * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param layer The tile layer to use. If not given the current layer is used. + */ + weightedRandomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, weightedIndexes?: object[], layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer + * to use. If not given the current layer is used. + */ + worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * If no layer specified, the maps current layer is used. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param layer The tile layer to use. If not given the current layer is used. + */ + worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Math.Vector2; + + } + + /** + * A Tileset is a combination of an image containing the tiles and a container for data about + * each tile. + */ + class Tileset { + /** + * + * @param name The name of the tileset in the map data. + * @param firstgid The first tile index this tileset contains. + * @param tileWidth Width of each tile (in pixels). Default 32. + * @param tileHeight Height of each tile (in pixels). Default 32. + * @param tileMargin The margin around all tiles in the sheet (in pixels). Default 0. + * @param tileSpacing The spacing between each tile in the sheet (in pixels). Default 0. + * @param tileProperties Custom properties defined per tile in the Tileset. + * These typically are custom properties created in Tiled when editing a tileset. Default {}. + * @param tileData Data stored per tile. These typically are created in Tiled + * when editing a tileset, e.g. from Tiled's tile collision editor or terrain editor. Default {}. + */ + constructor(name: string, firstgid: integer, tileWidth?: integer, tileHeight?: integer, tileMargin?: integer, tileSpacing?: integer, tileProperties?: object, tileData?: object); + + /** + * The name of the Tileset. + */ + name: string; + + /** + * The starting index of the first tile index this Tileset contains. + */ + firstgid: integer; + + /** + * The width of each tile (in pixels). Use setTileSize to change. + */ + readonly tileWidth: integer; + + /** + * The height of each tile (in pixels). Use setTileSize to change. + */ + readonly tileHeight: integer; + + /** + * The margin around the tiles in the sheet (in pixels). Use `setSpacing` to change. + */ + readonly tileMargin: integer; + + /** + * The spacing between each the tile in the sheet (in pixels). Use `setSpacing` to change. + */ + readonly tileSpacing: integer; + + /** + * Tileset-specific properties per tile that are typically defined in the Tiled editor in the + * Tileset editor. + */ + tileProperties: object; + + /** + * Tileset-specific data per tile that are typically defined in the Tiled editor, e.g. within + * the Tileset collision editor. This is where collision objects and terrain are stored. + */ + tileData: object; + + /** + * The cached image that contains the individual tiles. Use setImage to set. + */ + readonly image: Phaser.Textures.Texture; + + /** + * The gl texture used by the WebGL renderer. + */ + readonly glTexture: WebGLTexture; + + /** + * The number of tile rows in the the tileset. + */ + readonly rows: integer; + + /** + * The number of tile columns in the tileset. + */ + readonly columns: integer; + + /** + * The total number of tiles in the tileset. + */ + readonly total: integer; + + /** + * The look-up table to specific tile image texture coordinates (UV in pixels). Each element + * contains the coordinates for a tile in an object of the form {x, y}. + */ + readonly texCoordinates: object[]; + + /** + * Get a tiles properties that are stored in the Tileset. Returns null if tile index is not + * contained in this Tileset. This is typically defined in Tiled under the Tileset editor. + * @param tileIndex The unique id of the tile across all tilesets in the map. + */ + getTileProperties(tileIndex: integer): object | undefined; + + /** + * Get a tile's data that is stored in the Tileset. Returns null if tile index is not contained + * in this Tileset. This is typically defined in Tiled and will contain both Tileset collision + * info and terrain mapping. + * @param tileIndex The unique id of the tile across all tilesets in the map. + */ + getTileData(tileIndex: integer): object | undefined; + + /** + * Get a tile's collision group that is stored in the Tileset. Returns null if tile index is not + * contained in this Tileset. This is typically defined within Tiled's tileset collision editor. + * @param tileIndex The unique id of the tile across all tilesets in the map. + */ + getTileCollisionGroup(tileIndex: integer): object; + + /** + * Returns true if and only if this Tileset contains the given tile index. + * @param tileIndex The unique id of the tile across all tilesets in the map. + */ + containsTileIndex(tileIndex: integer): boolean; + + /** + * Returns the texture coordinates (UV in pixels) in the Tileset image for the given tile index. + * Returns null if tile index is not contained in this Tileset. + * @param tileIndex The unique id of the tile across all tilesets in the map. + */ + getTileTextureCoordinates(tileIndex: integer): object; + + /** + * Sets the image associated with this Tileset and updates the tile data (rows, columns, etc.). + * @param texture The image that contains the tiles. + */ + setImage(texture: Phaser.Textures.Texture): Phaser.Tilemaps.Tileset; + + /** + * Sets the tile width & height and updates the tile data (rows, columns, etc.). + * @param tileWidth The width of a tile in pixels. + * @param tileHeight The height of a tile in pixels. + */ + setTileSize(tileWidth?: integer, tileHeight?: integer): Phaser.Tilemaps.Tileset; + + /** + * Sets the tile margin & spacing and updates the tile data (rows, columns, etc.). + * @param margin The margin around the tiles in the sheet (in pixels). + * @param spacing The spacing between the tiles in the sheet (in pixels). + */ + setSpacing(margin?: integer, spacing?: integer): Phaser.Tilemaps.Tileset; + + /** + * Updates tile texture coordinates and tileset data. + * @param imageWidth The (expected) width of the image to slice. + * @param imageHeight The (expected) height of the image to slice. + */ + updateTileData(imageWidth: integer, imageHeight: integer): Phaser.Tilemaps.Tileset; + + } + + } + + namespace Time { + /** + * The Clock is a Scene plugin which creates and updates Timer Events for its Scene. + */ + class Clock { + /** + * + * @param scene The Scene which owns this Clock. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene which owns this Clock. + */ + scene: Phaser.Scene; + + /** + * The Scene Systems object of the Scene which owns this Clock. + */ + systems: Phaser.Scenes.Systems; + + /** + * The current time of the Clock, in milliseconds. + * + * If accessed externally, this is equivalent to the `time` parameter normally passed to a Scene's `update` method. + */ + now: number; + + /** + * The scale of the Clock's time delta. + * + * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Clock and anything which uses it, such as its Timer Events. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing the Clock. + */ + timeScale: number; + + /** + * Whether the Clock is paused (`true`) or active (`false`). + * + * When paused, the Clock will not update any of its Timer Events, thus freezing time. + */ + paused: boolean; + + /** + * Creates a Timer Event and adds it to the Clock at the start of the frame. + * @param config The configuration for the Timer Event. + */ + addEvent(config: Phaser.Types.Time.TimerEventConfig): Phaser.Time.TimerEvent; + + /** + * Creates a Timer Event and adds it to the Clock at the start of the frame. + * + * This is a shortcut for {@link #addEvent} which can be shorter and is compatible with the syntax of the GreenSock Animation Platform (GSAP). + * @param delay The delay of the function call, in milliseconds. + * @param callback The function to call after the delay expires. + * @param args The arguments to call the function with. + * @param callbackScope The scope (`this` object) to call the function with. + */ + delayedCall(delay: number, callback: Function, args: any[], callbackScope: any): Phaser.Time.TimerEvent; + + /** + * Clears and recreates the array of pending Timer Events. + */ + clearPendingEvents(): Phaser.Time.Clock; + + /** + * Schedules all active Timer Events for removal at the start of the frame. + */ + removeAllEvents(): Phaser.Time.Clock; + + /** + * Updates the arrays of active and pending Timer Events. Called at the start of the frame. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + preUpdate(time: number, delta: number): void; + + /** + * Updates the Clock's internal time and all of its Timer Events. + * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(time: number, delta: number): void; + + } + + /** + * A Timer Event represents a delayed function call. It's managed by a Scene's {@link Clock} and will call its function after a set amount of time has passed. The Timer Event can optionally repeat - i.e. call its function multiple times before finishing, or loop indefinitely. + * + * Because it's managed by a Clock, a Timer Event is based on game time, will be affected by its Clock's time scale, and will pause if its Clock pauses. + */ + class TimerEvent { + /** + * + * @param config The configuration for the Timer Event, including its delay and callback. + */ + constructor(config: Phaser.Types.Time.TimerEventConfig); + + /** + * The delay in ms at which this TimerEvent fires. + */ + readonly delay: number; + + /** + * The total number of times this TimerEvent will repeat before finishing. + */ + readonly repeat: number; + + /** + * If repeating this contains the current repeat count. + */ + repeatCount: number; + + /** + * True if this TimerEvent loops, otherwise false. + */ + readonly loop: boolean; + + /** + * The callback that will be called when the TimerEvent occurs. + */ + callback: Function; + + /** + * The scope in which the callback will be called. + */ + callbackScope: object; + + /** + * Additional arguments to be passed to the callback. + */ + args: any[]; + + /** + * Scale the time causing this TimerEvent to update. + */ + timeScale: number; + + /** + * Start this many MS into the elapsed (useful if you want a long duration with repeat, but for the first loop to fire quickly) + */ + startAt: number; + + /** + * The time in milliseconds which has elapsed since the Timer Event's creation. + * + * This value is local for the Timer Event and is relative to its Clock. As such, it's influenced by the Clock's time scale and paused state, the Timer Event's initial {@link #startAt} property, and the Timer Event's {@link #timeScale} and {@link #paused} state. + */ + elapsed: number; + + /** + * Whether or not this timer is paused. + */ + paused: boolean; + + /** + * Whether the Timer Event's function has been called. + * + * When the Timer Event fires, this property will be set to `true` before the callback function is invoked and will be reset immediately afterward if the Timer Event should repeat. The value of this property does not directly influence whether the Timer Event will be removed from its Clock, but can prevent it from firing. + */ + hasDispatched: boolean; + + /** + * Completely reinitializes the Timer Event, regardless of its current state, according to a configuration object. + * @param config The new state for the Timer Event. + */ + reset(config: Phaser.Types.Time.TimerEventConfig): Phaser.Time.TimerEvent; + + /** + * Gets the progress of the current iteration, not factoring in repeats. + */ + getProgress(): number; + + /** + * Gets the progress of the timer overall, factoring in repeats. + */ + getOverallProgress(): number; + + /** + * Returns the number of times this Timer Event will repeat before finishing. + * + * This should not be confused with the number of times the Timer Event will fire before finishing. A return value of 0 doesn't indicate that the Timer Event has finished running - it indicates that it will not repeat after the next time it fires. + */ + getRepeatCount(): number; + + /** + * Returns the local elapsed time for the current iteration of the Timer Event. + */ + getElapsed(): number; + + /** + * Returns the local elapsed time for the current iteration of the Timer Event in seconds. + */ + getElapsedSeconds(): number; + + /** + * Forces the Timer Event to immediately expire, thus scheduling its removal in the next frame. + * @param dispatchCallback If `true` (by default `false`), the function of the Timer Event will be called before its removal from its Clock. + */ + remove(dispatchCallback?: boolean): void; + + /** + * Destroys all object references in the Timer Event, i.e. its callback, scope, and arguments. + * + * Normally, this method is only called by the Clock when it shuts down. As such, it doesn't stop the Timer Event. If called manually, the Timer Event will still be updated by the Clock, but it won't do anything when it fires. + */ + destroy(): void; + + } + + } + + namespace Tweens { + namespace Builders { + /** + * Retrieves the value of the given key from an object. + * @param source The object to retrieve the value from. + * @param key The key to look for in the `source` object. + * @param defaultValue The default value to return if the `key` doesn't exist or if no `source` object is provided. + */ + function GetBoolean(source: object, key: string, defaultValue: any): any; + + /** + * [description] + * @param ease [description] + * @param easeParams [description] + */ + function GetEaseFunction(ease: string | Function, easeParams: any[]): Function; + + /** + * [description] + * @param source [description] + * @param key [description] + * @param defaultValue [description] + */ + function GetNewValue(source: object, key: string, defaultValue: any): Function; + + /** + * [description] + * @param config The configuration object of the tween to get the target(s) from. + */ + function GetProps(config: object): any[]; + + /** + * Extracts an array of targets from a Tween configuration object. + * + * The targets will be looked for in a `targets` property. If it's a function, its return value will be used as the result. + * @param config The configuration object to use. + */ + function GetTargets(config: object): any[]; + + /** + * Returns an array of all tweens in the given config + * @param config [description] + */ + function GetTweens(config: object): any[]; + + /** + * Returns `getStart` and `getEnd` functions for a Tween's Data based on a target property and end value. + * + * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. A string can be provided to specify a relative end value which consists of an operation (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current value, or `/=` to divide the current value) followed by its operand. A function can be provided to allow greater control over the end value; it will receive the target object being tweened, the name of the property being tweened, and the current value of the property as its arguments. If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` property is provided, the property will be used as the effective value under the same rules described here. + * @param key The name of the property to modify. + * @param propertyValue The ending value of the property, as described above. + */ + function GetValueOp(key: string, propertyValue: any): Function; + + /** + * Creates a new Number Tween. + * @param parent The owner of the new Tween. + * @param config Configuration for the new Tween. + * @param defaults Tween configuration defaults. + */ + function NumberTweenBuilder(parent: Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline, config: Phaser.Types.Tweens.NumberTweenBuilderConfig, defaults: Phaser.Types.Tweens.TweenConfigDefaults): Phaser.Tweens.Tween; + + /** + * Builds a Timeline of Tweens based on a configuration object. + * @param manager The Tween Manager to which the Timeline will belong. + * @param config The configuration object for the Timeline. + */ + function TimelineBuilder(manager: Phaser.Tweens.TweenManager, config: Phaser.Types.Tweens.TimelineBuilderConfig): Phaser.Tweens.Timeline; + + /** + * Creates a new Tween. + * @param parent The owner of the new Tween. + * @param config Configuration for the new Tween. + * @param defaults Tween configuration defaults. + */ + function TweenBuilder(parent: Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline, config: Phaser.Types.Tweens.TweenBuilderConfig | object, defaults: Phaser.Types.Tweens.TweenConfigDefaults): Phaser.Tweens.Tween; + + } + + namespace Events { + /** + * The Timeline Complete Event. + * + * This event is dispatched by a Tween Timeline when it completes playback. + * + * Listen to it from a Timeline instance using `Timeline.on('complete', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('complete', listener); + * timeline.play(); + * ``` + */ + const TIMELINE_COMPLETE: any; + + /** + * The Timeline Loop Event. + * + * This event is dispatched by a Tween Timeline every time it loops. + * + * Listen to it from a Timeline instance using `Timeline.on('loop', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * loop: 4, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('loop', listener); + * timeline.play(); + * ``` + */ + const TIMELINE_LOOP: any; + + /** + * The Timeline Pause Event. + * + * This event is dispatched by a Tween Timeline when it is paused. + * + * Listen to it from a Timeline instance using `Timeline.on('pause', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('pause', listener); + * // At some point later ... + * timeline.pause(); + * ``` + */ + const TIMELINE_PAUSE: any; + + /** + * The Timeline Resume Event. + * + * This event is dispatched by a Tween Timeline when it is resumed from a paused state. + * + * Listen to it from a Timeline instance using `Timeline.on('resume', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('resume', listener); + * // At some point later ... + * timeline.resume(); + * ``` + */ + const TIMELINE_RESUME: any; + + /** + * The Timeline Start Event. + * + * This event is dispatched by a Tween Timeline when it starts. + * + * Listen to it from a Timeline instance using `Timeline.on('start', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('start', listener); + * timeline.play(); + * ``` + */ + const TIMELINE_START: any; + + /** + * The Timeline Update Event. + * + * This event is dispatched by a Tween Timeline every time it updates, which can happen a lot of times per second, + * so be careful about listening to this event unless you absolutely require it. + * + * Listen to it from a Timeline instance using `Timeline.on('update', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('update', listener); + * timeline.play(); + * ``` + */ + const TIMELINE_UPDATE: any; + + } + + /** + * A Timeline combines multiple Tweens into one. Its overall behavior is otherwise similar to a single Tween. + * + * The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence + * of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline. + */ + class Timeline extends Phaser.Events.EventEmitter { + /** + * + * @param manager The Tween Manager which owns this Timeline. + */ + constructor(manager: Phaser.Tweens.TweenManager); + + /** + * The Tween Manager which owns this Timeline. + */ + manager: Phaser.Tweens.TweenManager; + + /** + * A constant value which allows this Timeline to be easily identified as one. + */ + isTimeline: boolean; + + /** + * An array of Tween objects, each containing a unique property and target being tweened. + */ + data: any[]; + + /** + * The cached size of the data array. + */ + totalData: number; + + /** + * If true then duration, delay, etc values are all frame totals, rather than ms. + */ + useFrames: boolean; + + /** + * Scales the time applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * Value isn't used when calculating total duration of the Timeline, it's a run-time delta adjustment only. + */ + timeScale: number; + + /** + * Loop this Timeline? Can be -1 for an infinite loop, or an integer. + * When enabled it will play through ALL Tweens again (use Tween.repeat to loop a single tween) + */ + loop: number; + + /** + * Time in ms/frames before this Timeline loops. + */ + loopDelay: number; + + /** + * How many loops are left to run? + */ + loopCounter: number; + + /** + * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = true (as it never completes) + */ + completeDelay: number; + + /** + * Countdown timer value, as used by `loopDelay` and `completeDelay`. + */ + countdown: number; + + /** + * The current state of the Timeline. + */ + state: integer; + + /** + * Does the Timeline start off paused? (if so it needs to be started with Timeline.play) + */ + paused: boolean; + + /** + * Elapsed time in ms/frames of this run through of the Timeline. + */ + elapsed: number; + + /** + * Total elapsed time in ms/frames of the entire Timeline, including looping. + */ + totalElapsed: number; + + /** + * Time in ms/frames for the whole Timeline to play through once, excluding loop amounts and loop delays. + */ + duration: number; + + /** + * Value between 0 and 1. The amount of progress through the Timeline, _excluding loops_. + */ + progress: number; + + /** + * Time in ms/frames for all Tweens in this Timeline to complete (including looping) + */ + totalDuration: number; + + /** + * Value between 0 and 1. The amount through the entire Timeline, including looping. + */ + totalProgress: number; + + /** + * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + * + * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + * @param value The time scale value to set. + */ + setTimeScale(value: number): this; + + /** + * Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + */ + getTimeScale(): number; + + /** + * Check whether or not the Timeline is playing. + */ + isPlaying(): boolean; + + /** + * Creates a new Tween, based on the given Tween Config, and adds it to this Timeline. + * @param config The configuration object for the Tween. + */ + add(config: Phaser.Types.Tweens.TweenBuilderConfig | object): this; + + /** + * Adds an existing Tween to this Timeline. + * @param tween The Tween to be added to this Timeline. + */ + queue(tween: Phaser.Tweens.Tween): this; + + /** + * Checks whether a Tween has an offset value. + * @param tween The Tween to check. + */ + hasOffset(tween: Phaser.Tweens.Tween): boolean; + + /** + * Checks whether the offset value is a number or a directive that is relative to previous tweens. + * @param value The offset value to be evaluated. + */ + isOffsetAbsolute(value: number): boolean; + + /** + * Checks if the offset is a relative value rather than an absolute one. + * If the value is just a number, this returns false. + * @param value The offset value to be evaluated. + */ + isOffsetRelative(value: string): boolean; + + /** + * Parses the relative offset value, returning a positive or negative number. + * @param value The relative offset, in the format of '-=500', for example. The first character determines whether it will be a positive or negative number. Spacing matters here. + * @param base The value to use as the offset. + */ + getRelativeOffset(value: string, base: number): number; + + /** + * Calculates the total duration of the timeline. + * + * Computes all tween durations and returns the full duration of the timeline. + * + * The resulting number is stored in the timeline, not as a return value. + */ + calcDuration(): void; + + /** + * Initializes the timeline, which means all Tweens get their init() called, and the total duration will be computed. + * Returns a boolean indicating whether the timeline is auto-started or not. + */ + init(): boolean; + + /** + * Resets all of the timeline's tweens back to their initial states. + * The boolean parameter indicates whether tweens that are looping should reset as well, or not. + * @param resetFromLoop If `true`, resets all looping tweens to their initial values. + */ + resetTweens(resetFromLoop: boolean): void; + + /** + * Sets a callback for the Timeline. + * @param type The internal type of callback to set. + * @param callback Timeline allows multiple tweens to be linked together to create a streaming sequence. + * @param params The parameters to pass to the callback. + * @param scope The context scope of the callback. + */ + setCallback(type: string, callback: Function, params?: any[], scope?: object): this; + + /** + * Passed a Tween to the Tween Manager and requests it be made active. + * @param tween The tween object to make active. + */ + makeActive(tween: Phaser.Tweens.Tween): Phaser.Tweens.TweenManager; + + /** + * Starts playing the Timeline. + */ + play(): void; + + /** + * Updates the Timeline's `state` and fires callbacks and events. + */ + nextState(): void; + + /** + * Returns 'true' if this Timeline has finished and should be removed from the Tween Manager. + * Otherwise, returns false. + * @param timestamp The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(timestamp: number, delta: number): boolean; + + /** + * Stops the Timeline immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. + */ + stop(): void; + + /** + * Pauses the Timeline, retaining its internal state. + * + * Calling this on a Timeline that is already paused has no effect and fires no event. + */ + pause(): this; + + /** + * Resumes a paused Timeline from where it was when it was paused. + * + * Calling this on a Timeline that isn't paused has no effect and fires no event. + */ + resume(): this; + + /** + * Checks if any of the Tweens in this Timeline as operating on the target object. + * + * Returns `false` if no Tweens operate on the target object. + * @param target The target to check all Tweens against. + */ + hasTarget(target: object): boolean; + + /** + * Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags + * them for removal by the TweenManager. + */ + destroy(): void; + + } + + /** + * TweenData state. + */ + var CREATED: integer; + + /** + * TweenData state. + */ + var INIT: integer; + + /** + * TweenData state. + */ + var DELAY: integer; + + /** + * TweenData state. + */ + var OFFSET_DELAY: integer; + + /** + * TweenData state. + */ + var PENDING_RENDER: integer; + + /** + * TweenData state. + */ + var PLAYING_FORWARD: integer; + + /** + * TweenData state. + */ + var PLAYING_BACKWARD: integer; + + /** + * TweenData state. + */ + var HOLD_DELAY: integer; + + /** + * TweenData state. + */ + var REPEAT_DELAY: integer; + + /** + * TweenData state. + */ + var COMPLETE: integer; + + /** + * Tween state. + */ + var PENDING_ADD: integer; + + /** + * Tween state. + */ + var PAUSED: integer; + + /** + * Tween state. + */ + var LOOP_DELAY: integer; + + /** + * Tween state. + */ + var ACTIVE: integer; + + /** + * Tween state. + */ + var COMPLETE_DELAY: integer; + + /** + * Tween state. + */ + var PENDING_REMOVE: integer; + + /** + * Tween state. + */ + var REMOVED: integer; + + /** + * A Tween is able to manipulate the properties of one or more objects to any given value, based + * on a duration and type of ease. They are rarely instantiated directly and instead should be + * created via the TweenManager. + */ + class Tween { + /** + * + * @param parent A reference to the parent of this Tween. Either the Tween Manager or a Tween Timeline instance. + * @param data An array of TweenData objects, each containing a unique property to be tweened. + * @param targets An array of targets to be tweened. + */ + constructor(parent: Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline, data: Phaser.Types.Tweens.TweenDataConfig[], targets: any[]); + + /** + * A reference to the parent of this Tween. + * Either the Tween Manager or a Tween Timeline instance. + */ + parent: Phaser.Tweens.TweenManager | Phaser.Tweens.Timeline; + + /** + * Is the parent of this Tween a Timeline? + */ + parentIsTimeline: boolean; + + /** + * An array of TweenData objects, each containing a unique property and target being tweened. + */ + data: Phaser.Types.Tweens.TweenDataConfig[]; + + /** + * The cached length of the data array. + */ + totalData: integer; + + /** + * An array of references to the target/s this Tween is operating on. + */ + targets: object[]; + + /** + * Cached target total (not necessarily the same as the data total) + */ + totalTargets: integer; + + /** + * If `true` then duration, delay, etc values are all frame totals. + */ + useFrames: boolean; + + /** + * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + */ + timeScale: number; + + /** + * Loop this tween? Can be -1 for an infinite loop, or an integer. + * When enabled it will play through ALL TweenDatas again. Use TweenData.repeat to loop a single element. + */ + loop: number; + + /** + * Time in ms/frames before the tween loops. + */ + loopDelay: number; + + /** + * How many loops are left to run? + */ + loopCounter: number; + + /** + * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes) + */ + completeDelay: number; + + /** + * Countdown timer (used by timeline offset, loopDelay and completeDelay) + */ + countdown: number; + + /** + * Set only if this Tween is part of a Timeline. + */ + offset: number; + + /** + * Set only if this Tween is part of a Timeline. The calculated offset amount. + */ + calculatedOffset: number; + + /** + * The current state of the tween + */ + state: integer; + + /** + * Does the Tween start off paused? (if so it needs to be started with Tween.play) + */ + paused: boolean; + + /** + * Elapsed time in ms/frames of this run through the Tween. + */ + elapsed: number; + + /** + * Total elapsed time in ms/frames of the entire Tween, including looping. + */ + totalElapsed: number; + + /** + * Time in ms/frames for the whole Tween to play through once, excluding loop amounts and loop delays. + */ + duration: number; + + /** + * Value between 0 and 1. The amount through the Tween, excluding loops. + */ + progress: number; + + /** + * Time in ms/frames for the Tween to complete (including looping) + */ + totalDuration: number; + + /** + * Value between 0 and 1. The amount through the entire Tween, including looping. + */ + totalProgress: number; + + /** + * An object containing the various Tween callback references. + */ + callbacks: object; + + /** + * Returns the current value of the Tween. + */ + getValue(): number; + + /** + * Set the scale the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * @param value The scale factor for timescale. + */ + setTimeScale(value: number): this; + + /** + * Returns the scale of the time applied to this Tween. + */ + getTimeScale(): number; + + /** + * Checks if the Tween is currently active. + */ + isPlaying(): boolean; + + /** + * Checks if the Tween is currently paused. + */ + isPaused(): boolean; + + /** + * See if this Tween is currently acting upon the given target. + * @param target The target to check against this Tween. + */ + hasTarget(target: object): boolean; + + /** + * Updates the value of a property of this Tween to a new value, without adjusting the + * Tween duration or current progress. + * + * You can optionally tell it to set the 'start' value to be the current value (before the change). + * @param key The property to set the new value for. + * @param value The new value of the property. + * @param startToCurrent Should this change set the start value to be the current value? Default false. + */ + updateTo(key: string, value: any, startToCurrent?: boolean): this; + + /** + * Restarts the tween from the beginning. + */ + restart(): this; + + /** + * Internal method that calculates the overall duration of the Tween. + */ + calcDuration(): void; + + /** + * Called by TweenManager.preUpdate as part of its loop to check pending and active tweens. + * Should not be called directly. + */ + init(): boolean; + + /** + * Internal method that advances to the next state of the Tween during playback. + */ + nextState(): void; + + /** + * Pauses the Tween immediately. Use `resume` to continue playback. + */ + pause(): this; + + /** + * Starts a Tween playing. + * + * You only need to call this method if you have configured the tween to be paused on creation. + * + * If the Tween is already playing, calling this method again will have no effect. If you wish to + * restart the Tween, use `Tween.restart` instead. + * + * Calling this method after the Tween has completed will start the Tween playing again from the start. + * This is the same as calling `Tween.seek(0)` and then `Tween.play()`. + * @param resetFromTimeline Is this Tween being played as part of a Timeline? Default false. + */ + play(resetFromTimeline?: boolean): this; + + /** + * Internal method that resets all of the Tween Data, including the progress and elapsed values. + * @param resetFromLoop Has this method been called as part of a loop? + */ + resetTweenData(resetFromLoop: boolean): void; + + /** + * Resumes the playback of a previously paused Tween. + */ + resume(): this; + + /** + * Attempts to seek to a specific position in a Tween. + * @param toPosition A value between 0 and 1 which represents the progress point to seek to. + */ + seek(toPosition: number): this; + + /** + * Sets an event based callback to be invoked during playback. + * @param type Type of the callback. + * @param callback Callback function. + * @param params An array of parameters for specified callbacks types. + * @param scope The context the callback will be invoked in. + */ + setCallback(type: string, callback: Function, params?: any[], scope?: object): this; + + /** + * Flags the Tween as being complete, whatever stage of progress it is at. + * + * If an onComplete callback has been defined it will automatically invoke it, unless a `delay` + * argument is provided, in which case the Tween will delay for that period of time before calling the callback. + * + * If you don't need a delay, or have an onComplete callback, then call `Tween.stop` instead. + * @param delay The time to wait before invoking the complete callback. If zero it will fire immediately. Default 0. + */ + complete(delay?: number): this; + + /** + * Immediately removes this Tween from the TweenManager and all of its internal arrays, + * no matter what stage it as it. Then sets the tween state to `REMOVED`. + * + * You should dispose of your reference to this tween after calling this method, to + * free it from memory. + */ + remove(): this; + + /** + * Stops the Tween immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. + * @param resetTo If you want to seek the tween, provide a value between 0 and 1. + */ + stop(resetTo?: number): this; + + /** + * Internal method that advances the Tween based on the time values. + * @param timestamp The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(timestamp: number, delta: number): boolean; + + /** + * Internal method used as part of the playback process that sets a tween to play in reverse. + * @param tween The Tween to update. + * @param tweenData The TweenData property to update. + * @param diff Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromEnd(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, diff: number): integer; + + /** + * Internal method used as part of the playback process that sets a tween to play from the start. + * @param tween The Tween to update. + * @param tweenData The TweenData property to update. + * @param diff Any extra time that needs to be accounted for in the elapsed and progress values. + */ + setStateFromStart(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, diff: number): integer; + + /** + * Internal method that advances the TweenData based on the time value given. + * @param tween The Tween to update. + * @param tweenData The TweenData property to update. + * @param delta Either a value in ms, or 1 if Tween.useFrames is true + */ + updateTweenData(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, delta: number): boolean; + + } + + /** + * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. + * + * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, Tweens should be created using the GameObjectFactory or GameObjectCreator. + * @param target The target to tween. + * @param key The property of the target to tween. + * @param getEnd What the property will be at the END of the Tween. + * @param getStart What the property will be at the START of the Tween. + * @param ease The ease function this tween uses. + * @param delay Time in ms/frames before tween will start. + * @param duration Duration of the tween in ms/frames. + * @param yoyo Determines whether the tween should return back to its start value after hold has expired. + * @param hold Time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param repeat Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param repeatDelay Time in ms/frames before the repeat will start. + * @param flipX Should toggleFlipX be called when yoyo or repeat happens? + * @param flipY Should toggleFlipY be called when yoyo or repeat happens? + */ + function TweenData(target: object, key: string, getEnd: Function, getStart: Function, ease: Function, delay: number, duration: number, yoyo: boolean, hold: number, repeat: number, repeatDelay: number, flipX: boolean, flipY: boolean): Phaser.Types.Tweens.TweenDataConfig; + + /** + * The Tween Manager is a default Scene Plugin which controls and updates Tweens and Timelines. + */ + class TweenManager { + /** + * + * @param scene The Scene which owns this Tween Manager. + */ + constructor(scene: Phaser.Scene); + + /** + * The Scene which owns this Tween Manager. + */ + scene: Phaser.Scene; + + /** + * The Systems object of the Scene which owns this Tween Manager. + */ + systems: Phaser.Scenes.Systems; + + /** + * The time scale of the Tween Manager. + * + * This value scales the time delta between two frames, thus influencing the speed of time for all Tweens owned by this Tween Manager. + */ + timeScale: number; + + /** + * Create a Tween Timeline and return it, but do NOT add it to the active or pending Tween lists. + * @param config The configuration object for the Timeline and its Tweens. + */ + createTimeline(config: Phaser.Types.Tweens.TimelineBuilderConfig): Phaser.Tweens.Timeline; + + /** + * Create a Tween Timeline and add it to the active Tween list/ + * @param config The configuration object for the Timeline and its Tweens. + */ + timeline(config: Phaser.Types.Tweens.TimelineBuilderConfig): Phaser.Tweens.Timeline; + + /** + * Create a Tween and return it, but do NOT add it to the active or pending Tween lists. + * @param config The configuration object for the Tween. + */ + create(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; + + /** + * Create a Tween and add it to the active Tween list. + * @param config The configuration object for the Tween. + */ + add(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; + + /** + * Add an existing tween into the active Tween list. + * @param tween The Tween to add. + */ + existing(tween: Phaser.Tweens.Tween): Phaser.Tweens.TweenManager; + + /** + * Create a Number Tween and add it to the active Tween list. + * @param config The configuration object for the Number Tween. + */ + addCounter(config: Phaser.Types.Tweens.NumberTweenBuilderConfig): Phaser.Tweens.Tween; + + /** + * Updates the Tween Manager's internal lists at the start of the frame. + * + * This method will return immediately if no changes have been indicated. + */ + preUpdate(): void; + + /** + * Updates all Tweens and Timelines of the Tween Manager. + * @param timestamp The current time in milliseconds. + * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update(timestamp: number, delta: number): void; + + /** + * Removes the given tween from the Tween Manager, regardless of its state (pending or active). + * @param tween The Tween to be removed. + */ + remove(tween: Phaser.Tweens.Tween): Phaser.Tweens.TweenManager; + + /** + * Checks if a Tween or Timeline is active and adds it to the Tween Manager at the start of the frame if it isn't. + * @param tween The Tween to check. + */ + makeActive(tween: Phaser.Tweens.Tween): Phaser.Tweens.TweenManager; + + /** + * Passes all Tweens to the given callback. + * @param callback The function to call. + * @param scope The scope (`this` object) to call the function with. + * @param args The arguments to pass into the function. Its first argument will always be the Tween currently being iterated. + */ + each(callback: Function, scope?: object, ...args: any[]): void; + + /** + * Returns an array of all active Tweens and Timelines in the Tween Manager. + */ + getAllTweens(): Phaser.Tweens.Tween[]; + + /** + * Returns the scale of the time delta for all Tweens and Timelines owned by this Tween Manager. + */ + getGlobalTimeScale(): number; + + /** + * Returns an array of all Tweens or Timelines in the Tween Manager which affect the given target or array of targets. + * @param target The target to look for. Provide an array to look for multiple targets. + */ + getTweensOf(target: object | any[]): Phaser.Tweens.Tween[]; + + /** + * Checks if the given object is being affected by a playing Tween. + * @param target target Phaser.Tweens.Tween object + */ + isTweening(target: object): boolean; + + /** + * Stops all Tweens in this Tween Manager. They will be removed at the start of the frame. + */ + killAll(): Phaser.Tweens.TweenManager; + + /** + * Stops all Tweens which affect the given target or array of targets. The Tweens will be removed from the Tween Manager at the start of the frame. + * @param target The target to look for. Provide an array to look for multiple targets. + */ + killTweensOf(target: object | any[]): Phaser.Tweens.TweenManager; + + /** + * Pauses all Tweens in this Tween Manager. + */ + pauseAll(): Phaser.Tweens.TweenManager; + + /** + * Resumes all Tweens in this Tween Manager. + */ + resumeAll(): Phaser.Tweens.TweenManager; + + /** + * Sets a new scale of the time delta for this Tween Manager. + * + * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Tween Manager and all Tweens it owns. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing all Tweens. + * @param value The new scale of the time delta, where 1 is the normal speed. + */ + setGlobalTimeScale(value: number): Phaser.Tweens.TweenManager; + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + */ + shutdown(): void; + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + */ + destroy(): void; + + } + + } + + namespace Utils { + namespace Array { + /** + * Adds the given item, or array of items, to the array. + * + * Each item must be unique within the array. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * @param array The array to be added to. + * @param item The item, or array of items, to add to the array. Each item must be unique within the array. + * @param limit Optional limit which caps the size of the array. + * @param callback A callback to be invoked for each item successfully added to the array. + * @param context The context in which the callback is invoked. + */ + function Add(array: any[], item: any | any[], limit?: integer, callback?: Function, context?: object): any[]; + + /** + * Adds the given item, or array of items, to the array starting at the index specified. + * + * Each item must be unique within the array. + * + * Existing elements in the array are shifted up. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * @param array The array to be added to. + * @param item The item, or array of items, to add to the array. + * @param index The index in the array where the item will be inserted. Default 0. + * @param limit Optional limit which caps the size of the array. + * @param callback A callback to be invoked for each item successfully added to the array. + * @param context The context in which the callback is invoked. + */ + function AddAt(array: any[], item: any | any[], index?: integer, limit?: integer, callback?: Function, context?: object): any[]; + + /** + * Moves the given element to the top of the array. + * The array is modified in-place. + * @param array The array. + * @param item The element to move. + */ + function BringToTop(array: any[], item: any): any; + + /** + * Returns the total number of elements in the array which have a property matching the given value. + * @param array The array to search. + * @param property The property to test on each array element. + * @param value The value to test the property against. Must pass a strict (`===`) comparison check. + * @param startIndex An optional start index to search from. + * @param endIndex An optional end index to search to. + */ + function CountAllMatching(array: any[], property: string, value: any, startIndex?: integer, endIndex?: integer): integer; + + /** + * Passes each element in the array to the given callback. + * @param array The array to search. + * @param callback A callback to be invoked for each item in the array. + * @param context The context in which the callback is invoked. + * @param args Additional arguments that will be passed to the callback, after the current array item. + */ + function Each(array: any[], callback: Function, context: object, ...args: any[]): any[]; + + /** + * Passes each element in the array, between the start and end indexes, to the given callback. + * @param array The array to search. + * @param callback A callback to be invoked for each item in the array. + * @param context The context in which the callback is invoked. + * @param startIndex The start index to search from. + * @param endIndex The end index to search to. + * @param args Additional arguments that will be passed to the callback, after the child. + */ + function EachInRange(array: any[], callback: Function, context: object, startIndex: integer, endIndex: integer, ...args: any[]): any[]; + + /** + * Searches a pre-sorted array for the closet value to the given number. + * + * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, + * and will check for the closest value of those to the given number. + * @param value The value to search for in the array. + * @param array The array to search, which must be sorted. + * @param key An optional property key. If specified the array elements property will be checked against value. + */ + function FindClosestInSorted(value: number, array: any[], key?: string): number | any; + + /** + * Returns all elements in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return only elements that have their visible property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 elements. + * @param array The array to search. + * @param property The property to test on each array element. + * @param value The value to test the property against. Must pass a strict (`===`) comparison check. + * @param startIndex An optional start index to search from. + * @param endIndex An optional end index to search to. + */ + function GetAll(array: any[], property?: string, value?: any, startIndex?: integer, endIndex?: integer): any[]; + + /** + * Returns the first element in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return the first element that had its `visible` property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. + * @param array The array to search. + * @param property The property to test on each array element. + * @param value The value to test the property against. Must pass a strict (`===`) comparison check. + * @param startIndex An optional start index to search from. Default 0. + * @param endIndex An optional end index to search up to (but not included) Default array.length. + */ + function GetFirst(array: any[], property?: string, value?: any, startIndex?: integer, endIndex?: integer): object; + + /** + * Returns a Random element from the array. + * @param array The array to select the random entry from. + * @param startIndex An optional start index. Default 0. + * @param length An optional length, the total number of elements (from the startIndex) to choose from. Default array.length. + */ + function GetRandom(array: any[], startIndex?: integer, length?: integer): any; + + namespace Matrix { + /** + * Checks if an array can be used as a matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array to check. + */ + function CheckMatrix(matrix?: T[][]): boolean; + + /** + * Generates a string (which you can pass to console.log) from the given Array Matrix. + * @param matrix A 2-dimensional array. + */ + function MatrixToString(matrix?: T[][]): string; + + /** + * Reverses the columns in the given Array Matrix. + * @param matrix The array matrix to reverse the columns for. + */ + function ReverseColumns(matrix?: T[][]): T[][]; + + /** + * Reverses the rows in the given Array Matrix. + * @param matrix The array matrix to reverse the rows for. + */ + function ReverseRows(matrix?: T[][]): T[][]; + + /** + * Rotates the array matrix 180 degrees. + * @param matrix The array to rotate. + */ + function Rotate180(matrix?: T[][]): T[][]; + + /** + * Rotates the array matrix to the left (or 90 degrees) + * @param matrix The array to rotate. + */ + function RotateLeft(matrix?: T[][]): T[][]; + + /** + * Rotates the array matrix based on the given rotation value. + * + * The value can be given in degrees: 90, -90, 270, -270 or 180, + * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. + * + * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. + * @param matrix The array to rotate. + * @param direction The amount to rotate the matrix by. Default 90. + */ + function RotateMatrix(matrix?: T[][], direction?: number | string): T[][]; + + /** + * Rotates the array matrix to the left (or -90 degrees) + * @param matrix The array to rotate. + */ + function RotateRight(matrix?: T[][]): T[][]; + + /** + * Transposes the elements of the given matrix (array of arrays). + * + * The transpose of a matrix is a new matrix whose rows are the columns of the original. + * @param array The array matrix to transpose. + */ + function TransposeMatrix(array?: T[][]): T[][]; + + } + + /** + * Moves the given array element down one place in the array. + * The array is modified in-place. + * @param array The input array. + * @param item The element to move down the array. + */ + function MoveDown(array: any[], item: any): any[]; + + /** + * Moves an element in an array to a new position within the same array. + * The array is modified in-place. + * @param array The array. + * @param item The element to move. + * @param index The new index that the element will be moved to. + */ + function MoveTo(array: any[], item: any, index: integer): any; + + /** + * Moves the given array element up one place in the array. + * The array is modified in-place. + * @param array The input array. + * @param item The element to move up the array. + */ + function MoveUp(array: any[], item: any): any[]; + + /** + * Create an array representing the range of numbers (usually integers), between, and inclusive of, + * the given `start` and `end` arguments. For example: + * + * `var array = numberArray(2, 4); // array = [2, 3, 4]` + * `var array = numberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * + * This is equivalent to `numberArrayStep(start, end, 1)`. + * + * You can optionally provide a prefix and / or suffix string. If given the array will contain + * strings, not integers. For example: + * + * `var array = numberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` + * `var array = numberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` + * @param start The minimum value the array starts with. + * @param end The maximum value the array contains. + * @param prefix Optional prefix to place before the number. If provided the array will contain strings, not integers. + * @param suffix Optional suffix to place after the number. If provided the array will contain strings, not integers. + */ + function NumberArray(start: number, end: number, prefix?: string, suffix?: string): number[] | string[]; + + /** + * Create an array of numbers (positive and/or negative) progressing from `start` + * up to but not including `end` by advancing by `step`. + * + * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified. + * + * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; + * for forward compatibility make sure to pass in actual numbers. + * @param start The start of the range. Default 0. + * @param end The end of the range. Default null. + * @param step The value to increment or decrement by. Default 1. + */ + function NumberArrayStep(start?: number, end?: number, step?: number): number[]; + + /** + * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. + * + * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; + * The k-th element will have the (k - left + 1)th smallest value in [left, right]. + * + * The array is modified in-place. + * + * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) + * @param arr The array to sort. + * @param k The k-th element index. + * @param left The index of the left part of the range. Default 0. + * @param right The index of the right part of the range. + * @param compare An optional comparison function. Is passed two elements and should return 0, 1 or -1. + */ + function QuickSelect(arr: any[], k: integer, left?: integer, right?: integer, compare?: Function): void; + + /** + * Creates an array populated with a range of values, based on the given arguments and configuration object. + * + * Range ([a,b,c], [1,2,3]) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2,3], qty = 3) = + * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 + * + * Range ([a,b,c], [1,2,3], repeat x1) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = + * Maybe if max is set then repeat goes to -1 automatically? + * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) + * + * Range ([a], [1,2,3,4,5], random = true) = + * a4, a1, a5, a2, a3 + * + * Range ([a, b], [1,2,3], random = true) = + * b3, a2, a1, b1, a3, b2 + * + * Range ([a, b, c], [1,2,3], randomB = true) = + * a3, a1, a2, b2, b3, b1, c1, c3, c2 + * + * Range ([a], [1,2,3,4,5], yoyo = true) = + * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 + * + * Range ([a, b], [1,2,3], yoyo = true) = + * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 + * @param a The first array of range elements. + * @param b The second array of range elements. + * @param options A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty. + */ + function Range(a: any[], b: any[], options?: object): any[]; + + /** + * Removes the given item, or array of items, from the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for each item successfully removed from the array. + * @param array The array to be modified. + * @param item The item, or array of items, to be removed from the array. + * @param callback A callback to be invoked for each item successfully removed from the array. + * @param context The context in which the callback is invoked. + */ + function Remove(array: any[], item: any | any[], callback?: Function, context?: object): any | any[]; + + /** + * Removes the item from the given position in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. + * @param array The array to be modified. + * @param index The array index to remove the item from. The index must be in bounds or it will throw an error. + * @param callback A callback to be invoked for the item removed from the array. + * @param context The context in which the callback is invoked. + */ + function RemoveAt(array: any[], index: integer, callback?: Function, context?: object): any; + + /** + * Removes the item within the given range in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. + * @param array The array to be modified. + * @param startIndex The start index to remove from. + * @param endIndex The end index to remove to. + * @param callback A callback to be invoked for the item removed from the array. + * @param context The context in which the callback is invoked. + */ + function RemoveBetween(array: any[], startIndex: integer, endIndex: integer, callback?: Function, context?: object): any[]; + + /** + * Removes a random object from the given array and returns it. + * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index. + * @param array The array to removed a random element from. + * @param start The array index to start the search from. Default 0. + * @param length Optional restriction on the number of elements to randomly select from. Default array.length. + */ + function RemoveRandomElement(array: any[], start?: integer, length?: integer): object; + + /** + * Replaces an element of the array with the new element. + * The new element cannot already be a member of the array. + * The array is modified in-place. + * @param oldChild The element in the array that will be replaced. + * @param newChild The element to be inserted into the array at the position of `oldChild`. + */ + function Replace(oldChild: any, newChild: any): boolean; + + /** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * @param array The array to shift to the left. This array is modified in place. + * @param total The number of times to shift the array. Default 1. + */ + function RotateLeft(array: any[], total?: integer): any; + + /** + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. + * @param array The array to shift to the right. This array is modified in place. + * @param total The number of times to shift the array. Default 1. + */ + function RotateRight(array: any[], total?: integer): any; + + /** + * Tests if the start and end indexes are a safe range for the given array. + * @param array The array to check. + * @param startIndex The start index. + * @param endIndex The end index. + * @param throwError Throw an error if the range is out of bounds. Default true. + */ + function SafeRange(array: any[], startIndex: integer, endIndex: integer, throwError?: boolean): boolean; + + /** + * Moves the given element to the bottom of the array. + * The array is modified in-place. + * @param array The array. + * @param item The element to move. + */ + function SendToBack(array: any[], item: any): any; + + /** + * Scans the array for elements with the given property. If found, the property is set to the `value`. + * + * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements. + * @param array The array to search. + * @param property The property to test for on each array element. + * @param value The value to set the property to. + * @param startIndex An optional start index to search from. + * @param endIndex An optional end index to search to. + */ + function SetAll(array: any[], property: string, value: any, startIndex?: integer, endIndex?: integer): any[]; + + /** + * Shuffles the contents of the given array using the Fisher-Yates implementation. + * + * The original array is modified directly and returned. + * @param array The array to shuffle. This array is modified in place. + */ + function Shuffle(array: any[]): any[]; + + /** + * Removes a single item from an array and returns it without creating gc, like the native splice does. + * Based on code by Mike Reinstein. + * @param array The array to splice from. + * @param index The index of the item which should be spliced. + */ + function SpliceOne(array: any[], index: integer): any; + + namespace StableSortFunctions { + /** + * Sort the input array and simply copy it back if the result isn't in the original array, which happens on an odd number of passes. + * @param arr The input array. + * @param comp The comparison handler. + */ + function inplace(arr: any[], comp: Function): any[]; + + } + + /** + * A stable array sort, because `Array#sort()` is not guaranteed stable. + * This is an implementation of merge sort, without recursion. + * @param arr The input array to be sorted. + * @param comp The comparison handler. + */ + function StableSort(arr: any[], comp: Function): any[]; + + /** + * Swaps the position of two elements in the given array. + * The elements must exist in the same array. + * The array is modified in-place. + * @param array The input array. + * @param item1 The first element to swap. + * @param item2 The second element to swap. + */ + function Swap(array: any[], item1: any, item2: any): any[]; + + } + + namespace Base64 { + /** + * Converts an ArrayBuffer into a base64 string. + * + * The resulting string can optionally be a data uri if the `mediaType` argument is provided. + * + * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs for more details. + * @param arrayBuffer The Array Buffer to encode. + * @param mediaType An optional media type, i.e. `audio/ogg` or `image/jpeg`. If included the resulting string will be a data URI. + */ + function ArrayBufferToBase64(arrayBuffer: ArrayBuffer, mediaType?: string): string; + + /** + * Converts a base64 string, either with or without a data uri, into an Array Buffer. + * @param base64 The base64 string to be decoded. Can optionally contain a data URI header, which will be stripped out prior to decoding. + */ + function Base64ToArrayBuffer(base64: string): ArrayBuffer; + + } + + /** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + */ + function NOOP(): void; + + namespace Objects { + /** + * Shallow Object Clone. Will not clone nested objects. + * @param obj the object from which to clone + */ + function Clone(obj: object): object; + + /** + * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ + */ + function Extend(): object; + + /** + * Retrieves a value from an object. Allows for more advanced selection options, including: + * + * Allowed types: + * + * Implicit + * { + * x: 4 + * } + * + * From function + * { + * x: function () + * } + * + * Randomly pick one element from the array + * { + * x: [a, b, c, d, e, f] + * } + * + * Random integer between min and max: + * { + * x: { randInt: [min, max] } + * } + * + * Random float between min and max: + * { + * x: { randFloat: [min, max] } + * } + * @param source The object to retrieve the value from. + * @param key The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param defaultValue The value to return if the `key` isn't found in the `source` object. + */ + function GetAdvancedValue(source: object, key: string, defaultValue: any): any; + + /** + * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} + * @param source The object to search + * @param key The key for the property on source. Must exist at the top level of the source object (no periods) + * @param defaultValue The default value to use if the key does not exist. + */ + function GetFastValue(source: object, key: string, defaultValue?: any): any; + + /** + * Retrieves and clamps a numerical value from an object. + * @param source The object to retrieve the value from. + * @param key The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`). + * @param min The minimum value which can be returned. + * @param max The maximum value which can be returned. + * @param defaultValue The value to return if the property doesn't exist. It's also constrained to the given bounds. + */ + function GetMinMaxValue(source: object, key: string, min: number, max: number, defaultValue: number): number; + + /** + * Retrieves a value from an object. + * @param source The object to retrieve the value from. + * @param key The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param defaultValue The value to return if the `key` isn't found in the `source` object. + */ + function GetValue(source: object, key: string, defaultValue: any): any; + + /** + * Verifies that an object contains all requested keys + * @param source an object on which to check for key existence + * @param keys an array of keys to ensure the source object contains + */ + function HasAll(source: object, keys: string[]): boolean; + + /** + * Verifies that an object contains at least one of the requested keys + * @param source an object on which to check for key existence + * @param keys an array of keys to search the object for + */ + function HasAny(source: object, keys: string[]): boolean; + + /** + * Determine whether the source object has a property with the specified key. + * @param source The source object to be checked. + * @param key The property to check for within the object + */ + function HasValue(source: object, key: string): boolean; + + /** + * This is a slightly modified version of jQuery.isPlainObject. + * A plain object is an object whose internal class property is [object Object]. + * @param obj The object to inspect. + */ + function IsPlainObject(obj: object): boolean; + + /** + * Creates a new Object using all values from obj1 and obj2. + * If a value exists in both obj1 and obj2, the value in obj1 is used. + * @param obj1 The first object. + * @param obj2 The second object. + */ + function Merge(obj1: object, obj2: object): object; + + /** + * Creates a new Object using all values from obj1. + * + * Then scans obj2. If a property is found in obj2 that *also* exists in obj1, the value from obj2 is used, otherwise the property is skipped. + * @param obj1 The first object to merge. + * @param obj2 The second object to merge. Keys from this object which also exist in `obj1` will be copied to `obj1`. + */ + function MergeRight(obj1: object, obj2: object): object; + + /** + * Returns a new object that only contains the `keys` that were found on the object provided. + * If no `keys` are found, an empty object is returned. + * @param object The object to pick the provided keys from. + * @param keys An array of properties to retrieve from the provided object. + */ + function Pick(object: object, keys: any[]): object; + + /** + * Sets a value in an object, allowing for dot notation to control the depth of the property. + * + * For example: + * + * ```javascript + * var data = { + * world: { + * position: { + * x: 200, + * y: 100 + * } + * } + * }; + * + * SetValue(data, 'world.position.y', 300); + * + * console.log(data.world.position.y); // 300 + * ``` + * @param source The object to set the value in. + * @param key The name of the property in the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) + * @param value The value to set into the property, if found in the source object. + */ + function SetValue(source: object, key: string, value: any): boolean; + + } + + namespace String { + /** + * Takes a string and replaces instances of markers with values in the given array. + * The markers take the form of `%1`, `%2`, etc. I.e.: + * + * `Format("The %1 is worth %2 gold", [ 'Sword', 500 ])` + * @param string The string containing the replacement markers. + * @param values An array containing values that will replace the markers. If no value exists an empty string is inserted instead. + */ + function Format(string: string, values: any[]): string; + + /** + * Takes the given string and pads it out, to the length required, using the character + * specified. For example if you need a string to be 6 characters long, you can call: + * + * `pad('bob', 6, '-', 2)` + * + * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. + * + * You can also use it to pad numbers (they are always returned as strings): + * + * `pad(512, 6, '0', 1)` + * + * Would return: `000512` with the string padded to the left. + * + * If you don't specify a direction it'll pad to both sides: + * + * `pad('c64', 7, '*')` + * + * Would return: `**c64**` + * @param str The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. + * @param len The number of characters to be added. Default 0. + * @param pad The string to pad it out with (defaults to a space). Default " ". + * @param dir The direction dir = 1 (left), 2 (right), 3 (both). Default 3. + */ + function Pad(str: string, len?: integer, pad?: string, dir?: integer): string; + + /** + * Takes the given string and reverses it, returning the reversed string. + * For example if given the string `Atari 520ST` it would return `TS025 iratA`. + * @param string The string to be reversed. + */ + function Reverse(string: string): string; + + /** + * Capitalizes the first letter of a string if there is one. + * @param str The string to capitalize. + */ + function UppercaseFirst(str: string): string; + + /** + * Creates and returns an RFC4122 version 4 compliant UUID. + * + * The string is in the form: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` where each `x` is replaced with a random + * hexadecimal digit from 0 to f, and `y` is replaced with a random hexadecimal digit from 8 to b. + */ + function UUID(): string; + + } + + } + + /** + * The Facebook Instant Games Plugin for Phaser 3 provides a seamless bridge between Phaser + * and the Facebook Instant Games API version 6.2. + * + * You can access this plugin via the `facebook` property in a Scene, i.e: + * + * ```javascript + * this.facebook.getPlatform(); + * ``` + * + * If this is unavailable please check to make sure you're using a build of Phaser that has + * this plugin within it. You can quickly check this by looking at the dev tools console + * header - the Phaser version number will have `-FB` after it if this plugin is loaded. + * + * If you are building your own version of Phaser then use this Webpack DefinePlugin flag: + * + * `"typeof PLUGIN_FBINSTANT": JSON.stringify(true)` + * + * You will find that every Instant Games API method has a mapping in this plugin. + * For a full list please consult either the plugin documentation, or the 6.2 SDK documentation + * at https://developers.facebook.com/docs/games/instant-games/sdk/fbinstant6.2 + * + * Internally this plugin uses its own Data Manager to handle seamless user data updates and provides + * handy functions for advertisement displaying, opening share dialogs, logging, leaderboards, purchase API requests, + * loader integration and more. + * + * To get started with Facebook Instant Games you will need to register on Facebook and create a new Instant + * Game app that has its own unique app ID. Facebook have also provided a dashboard interface for setting up + * various features for your game, including leaderboards, ad requests and the payments API. There are lots + * of guides on the Facebook Developers portal to assist with setting these + * various systems up: https://developers.facebook.com/docs/games/instant-games/guides + * + * For more details follow the Quick Start guide here: https://developers.facebook.com/docs/games/instant-games + */ + class FacebookInstantGamesPlugin extends Phaser.Events.EventEmitter { + /** + * + * @param game A reference to the Phaser.Game instance. + */ + constructor(game: Phaser.Game); + + /** + * A reference to the Phaser.Game instance. + */ + readonly game: Phaser.Game; + + /** + * A Data Manager instance. + * It allows you to store, query and retrieve any key/value data you may need to store. + * It's also used internally by the plugin to store FBIG API data. + */ + data: Phaser.Data.DataManager; + + /** + * Has the Facebook Instant Games API loaded yet? + * This is set automatically during the boot process. + */ + hasLoaded: boolean; + + /** + * Is the Data Manager currently locked? + */ + dataLocked: boolean; + + /** + * A list of the Facebook Instant Games APIs that are available, + * based on the given platform, context and user privacy settings. + * This value is populated automatically during boot. + */ + supportedAPIs: string[]; + + /** + * Holds the entry point that the game was launched from. + * This value is populated automatically during boot. + */ + entryPoint: string; + + /** + * An object that contains any data associated with the entry point that the game was launched from. + * The contents of the object are developer-defined, and can occur from entry points on different platforms. + * This will return null for older mobile clients, as well as when there is no data associated with the particular entry point. + * This value is populated automatically during boot. + */ + entryPointData: any; + + /** + * A unique identifier for the current game context. This represents a specific context + * that the game is being played in (for example, a particular messenger conversation or facebook post). + * The identifier will be null if game is being played in a solo context. + * This value is populated automatically during boot. + */ + contextID: string; + + /** + * The current context in which your game is running. This can be either `null` or + * one of: + * + * `POST` - The game is running inside of a Facebook post. + * `THREAD` - The game is running inside a Facebook Messenger thread. + * `GROUP` - The game is running inside a Facebook Group. + * `SOLO` - This is the default context, the player is the only participant. + * + * This value is populated automatically during boot. + */ + contextType: string; + + /** + * The current locale. + * See https://origincache.facebook.com/developers/resources/?id=FacebookLocales.xml for a complete list of supported locale values. + * Use this to determine what languages the current game should be localized with. + * This value is populated automatically during boot. + */ + locale: string; + + /** + * The platform on which the game is currently running, i.e. `IOS`. + * This value is populated automatically during boot. + */ + platform: string; + + /** + * The string representation of the Facebook Instant Games SDK version being used. + * This value is populated automatically during boot. + */ + version: string; + + /** + * Holds the id of the player. This is a string based ID, the same as `FBInstant.player.getID()`. + * This value is populated automatically during boot if the API is supported. + */ + playerID: string; + + /** + * The player's localized display name. + * This value is populated automatically during boot if the API is supported. + */ + playerName: string; + + /** + * A url to the player's public profile photo. The photo will always be a square, and with dimensions + * of at least 200x200. When rendering it in the game, the exact dimensions should never be assumed to be constant. + * It's recommended to always scale the image to a desired size before rendering. + * This value is populated automatically during boot if the API is supported. + */ + playerPhotoURL: string; + + /** + * Whether a player can subscribe to the game bot or not. + */ + playerCanSubscribeBot: boolean; + + /** + * Does the current platform and context allow for use of the payments API? + * Currently this is only available on Facebook.com and Android 6+. + */ + paymentsReady: boolean; + + /** + * The set of products that are registered to the game. + */ + catalog: Product[]; + + /** + * Contains all of the player's unconsumed purchases. + * The game must fetch the current player's purchases as soon as the client indicates that it is ready to perform payments-related operations, + * i.e. at game start. The game can then process and consume any purchases that are waiting to be consumed. + */ + purchases: Purchase[]; + + /** + * Contains all of the leaderboard data, as populated by the `getLeaderboard()` method. + */ + leaderboards: Phaser.FacebookInstantGamesLeaderboard[]; + + /** + * Contains AdInstance objects, as created by the `preloadAds()` method. + */ + ads: AdInstance[]; + + /** + * Call this method from your `Scene.preload` in order to sync the load progress + * of the Phaser Loader with the Facebook Instant Games loader display, i.e.: + * + * ```javascript + * this.facebook.showLoadProgress(this); + * this.facebook.once('startgame', this.startGame, this); + * ``` + * @param scene The Scene for which you want to show loader progress for. + */ + showLoadProgress(scene: Phaser.Scene): this; + + /** + * This method is called automatically when the game has finished loading, + * if you used the `showLoadProgress` method. If your game doesn't need to + * load any assets, or you're managing the load yourself, then call this + * method directly to start the API running. + * + * When the API has finished starting this plugin will emit a `startgame` event + * which you should listen for. + */ + gameStarted(): void; + + /** + * Checks to see if a given Facebook Instant Games API is available or not. + * @param api The API to check for, i.e. `player.getID`. + */ + checkAPI(api: string): boolean; + + /** + * Returns the unique identifier for the current game context. This represents a specific context + * that the game is being played in (for example, a particular messenger conversation or facebook post). + * The identifier will be null if game is being played in a solo context. + * + * It is only populated if `contextGetID` is in the list of supported APIs. + */ + getID(): string; + + /** + * Returns the current context in which your game is running. This can be either `null` or one of: + * + * `POST` - The game is running inside of a Facebook post. + * `THREAD` - The game is running inside a Facebook Messenger thread. + * `GROUP` - The game is running inside a Facebook Group. + * `SOLO` - This is the default context, the player is the only participant. + * + * It is only populated if `contextGetType` is in the list of supported APIs. + */ + getType(): string; + + /** + * Returns the current locale. + * See https://origincache.facebook.com/developers/resources/?id=FacebookLocales.xml for a complete list of supported locale values. + * Use this to determine what languages the current game should be localized with. + * It is only populated if `getLocale` is in the list of supported APIs. + */ + getLocale(): string; + + /** + * Returns the platform on which the game is currently running, i.e. `IOS`. + * It is only populated if `getPlatform` is in the list of supported APIs. + */ + getPlatform(): string; + + /** + * Returns the string representation of the Facebook Instant Games SDK version being used. + * It is only populated if `getSDKVersion` is in the list of supported APIs. + */ + getSDKVersion(): string; + + /** + * Returns the id of the player. This is a string based ID, the same as `FBInstant.player.getID()`. + * It is only populated if `playerGetID` is in the list of supported APIs. + */ + getPlayerID(): string; + + /** + * Returns the player's localized display name. + * It is only populated if `playerGetName` is in the list of supported APIs. + */ + getPlayerName(): string; + + /** + * Returns the url to the player's public profile photo. The photo will always be a square, and with dimensions + * of at least 200x200. When rendering it in the game, the exact dimensions should never be assumed to be constant. + * It's recommended to always scale the image to a desired size before rendering. + * It is only populated if `playerGetPhoto` is in the list of supported APIs. + */ + getPlayerPhotoURL(): string; + + /** + * Load the player's photo and store it in the Texture Manager, ready for use in-game. + * + * This method works by using a Scene Loader instance and then asking the Loader to + * retrieve the image. + * + * When complete the plugin will emit a `photocomplete` event, along with the key of the photo. + * + * ```javascript + * this.facebook.loadPlayerPhoto(this, 'player').once('photocomplete', function (key) { + * this.add.image(x, y, 'player'); + * }, this); + * ``` + * @param scene The Scene that will be responsible for loading this photo. + * @param key The key to use when storing the photo in the Texture Manager. + */ + loadPlayerPhoto(scene: Phaser.Scene, key: string): this; + + /** + * Checks if the current player can subscribe to the game bot. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they can subscribe, the `playerCanSubscribeBot` property is set to `true` + * and this plugin will emit the `cansubscribebot` event. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `cansubscribebotfail` event instead. + */ + canSubscribeBot(): this; + + /** + * Subscribes the current player to the game bot. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `subscribebot` event. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `subscribebotfail` event instead. + */ + subscribeBot(): this; + + /** + * Gets the associated data from the player based on the given key, or array of keys. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes the data is set into this plugins Data Manager and the + * `getdata` event will be emitted. + * @param keys The key/s of the data to retrieve. + */ + getData(keys: string | string[]): this; + + /** + * Set data to be saved to the designated cloud storage of the current player. The game can store up to 1MB of data for each unique player. + * + * The data save is requested in an async call, so the result isn't available immediately. + * + * Data managed via this plugins Data Manager instance is automatically synced with Facebook. However, you can call this + * method directly if you need to replace the data object directly. + * + * When the APIs `setDataAsync` call resolves it will emit the `savedata` event from this plugin. If the call fails for some + * reason it will emit `savedatafail` instead. + * + * The call resolving does not necessarily mean that the input has already been persisted. Rather, it means that the data was valid and + * has been scheduled to be saved. It also guarantees that all values that were set are now available in `getData`. + * @param data An object containing a set of key-value pairs that should be persisted to cloud storage. + * The object must contain only serializable values - any non-serializable values will cause the entire modification to be rejected. + */ + saveData(data: object): this; + + /** + * Immediately flushes any changes to the player data to the designated cloud storage. + * This function is expensive, and should primarily be used for critical changes where persistence needs to be immediate + * and known by the game. Non-critical changes should rely on the platform to persist them in the background. + * NOTE: Calls to player.setDataAsync will be rejected while this function's result is pending. + * + * Data managed via this plugins Data Manager instance is automatically synced with Facebook. However, you can call this + * method directly if you need to flush the data directly. + * + * When the APIs `flushDataAsync` call resolves it will emit the `flushdata` event from this plugin. If the call fails for some + * reason it will emit `flushdatafail` instead. + */ + flushData(): this; + + /** + * Retrieve stats from the designated cloud storage of the current player. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes the `getstats` event will be emitted along with the data object returned. + * + * If the call fails, i.e. it's not in the list of supported APIs, or the request was rejected, + * it will emit a `getstatsfail` event instead. + * @param keys An optional array of unique keys to retrieve stats for. If the function is called without it, it will fetch all stats. + */ + getStats(keys?: string[]): this; + + /** + * Save the stats of the current player to the designated cloud storage. + * + * Stats in the Facebook Instant Games API are purely numerical values paired with a string-based key. Only numbers can be saved as stats, + * all other data types will be ignored. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes the `savestats` event will be emitted along with the data object returned. + * + * If the call fails, i.e. it's not in the list of supported APIs, or the request was rejected, + * it will emit a `savestatsfail` event instead. + * @param data An object containing a set of key-value pairs that should be persisted to cloud storage as stats. Note that only numerical values are stored. + */ + saveStats(data: object): this; + + /** + * Increment the stats of the current player and save them to the designated cloud storage. + * + * Stats in the Facebook Instant Games API are purely numerical values paired with a string-based key. Only numbers can be saved as stats, + * all other data types will be ignored. + * + * The data object provided for this call should contain offsets for how much to modify the stats by: + * + * ```javascript + * this.facebook.incStats({ + * level: 1, + * zombiesSlain: 17, + * rank: -1 + * }); + * ``` + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes the `incstats` event will be emitted along with the data object returned. + * + * If the call fails, i.e. it's not in the list of supported APIs, or the request was rejected, + * it will emit a `incstatsfail` event instead. + * @param data An object containing a set of key-value pairs indicating how much to increment each stat in cloud storage. Note that only numerical values are processed. + */ + incStats(data: object): this; + + /** + * Sets the data associated with the individual gameplay session for the current context. + * + * This function should be called whenever the game would like to update the current session data. + * + * This session data may be used to populate a variety of payloads, such as game play webhooks. + * @param data An arbitrary data object, which must be less than or equal to 1000 characters when stringified. + */ + saveSession(data: object): this; + + /** + * This invokes a dialog to let the user share specified content, either as a message in Messenger or as a post on the user's timeline. + * + * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property. + * + * This data must be less than or equal to 1000 characters when stringified. + * + * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed. + * + * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not. + * @param text A text message to be shared. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param sessionData A blob of data to attach to the share. + */ + openShare(text: string, key: string, frame?: string, sessionData?: object): this; + + /** + * This invokes a dialog to let the user invite a friend to play this game, either as a message in Messenger or as a post on the user's timeline. + * + * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property. + * + * This data must be less than or equal to 1000 characters when stringified. + * + * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed. + * + * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not. + * @param text A text message to be shared. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param sessionData A blob of data to attach to the share. + */ + openInvite(text: string, key: string, frame?: string, sessionData?: object): this; + + /** + * This invokes a dialog to let the user share specified content, either as a message in Messenger or as a post on the user's timeline. + * + * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property. + * + * This data must be less than or equal to 1000 characters when stringified. + * + * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed. + * + * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not. + * @param text A text message to be shared. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param sessionData A blob of data to attach to the share. + */ + openRequest(text: string, key: string, frame?: string, sessionData?: object): this; + + /** + * This invokes a dialog to let the user share specified content, either as a message in Messenger or as a post on the user's timeline. + * + * A blob of data can be attached to the share which every game session launched from the share will be able to access via the `this.entryPointData` property. + * + * This data must be less than or equal to 1000 characters when stringified. + * + * When this method is called you should consider your game paused. Listen out for the `resume` event from this plugin to know when the dialog has been closed. + * + * The user may choose to cancel the share action and close the dialog. The resulting `resume` event will be dispatched regardless if the user actually shared the content or not. + * @param text A text message to be shared. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param sessionData A blob of data to attach to the share. + */ + openChallenge(text: string, key: string, frame?: string, sessionData?: object): this; + + /** + * This function determines whether the number of participants in the current game context is between a given minimum and maximum, inclusive. + * If one of the bounds is null only the other bound will be checked against. + * It will always return the original result for the first call made in a context in a given game play session. + * Subsequent calls, regardless of arguments, will return the answer to the original query until a context change occurs and the query result is reset. + * @param min The minimum bound of the context size query. + * @param max The maximum bound of the context size query. + */ + isSizeBetween(min?: integer, max?: integer): object; + + /** + * Request a switch into a specific context. If the player does not have permission to enter that context, + * or if the player does not provide permission for the game to enter that context, this will emit a `switchfail` event. + * + * Otherwise, the plugin will emit the `switch` event when the game has switched into the specified context. + * @param contextID The ID of the desired context. + */ + switchContext(contextID: string): this; + + /** + * Opens a context selection dialog for the player. If the player selects an available context, + * the client will attempt to switch into that context, and emit the `choose` event if successful. + * Otherwise, if the player exits the menu or the client fails to switch into the new context, the `choosefail` event will be emitted. + * @param contextID The ID of the desired context. + */ + chooseContext(contextID: string): this; + + /** + * Attempts to create or switch into a context between a specified player and the current player. + * This plugin will emit the `create` event once the context switch is completed. + * If the API call fails, such as if the player listed is not a Connected Player of the current player or if the + * player does not provide permission to enter the new context, then the plugin will emit a 'createfail' event. + * @param playerID ID of the player. + */ + createContext(playerID: string): this; + + /** + * Fetches an array of ConnectedPlayer objects containing information about active players + * (people who played the game in the last 90 days) that are connected to the current player. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `players` event along + * with the player data. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `playersfail` event instead. + */ + getPlayers(): this; + + /** + * Fetches the game's product catalog. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `getcatalog` event along + * with the catalog data. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `getcatalogfail` event instead. + */ + getCatalog(): this; + + /** + * Fetches a single Product from the game's product catalog. + * + * The product catalog must have been populated using `getCatalog` prior to calling this method. + * + * Use this to look-up product details based on a purchase list. + * @param productID The Product ID of the item to get from the catalog. + */ + getProduct(productID: string): Product; + + /** + * Begins the purchase flow for a specific product. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `purchase` event along + * with the purchase data. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `purchasefail` event instead. + * @param productID The identifier of the product to purchase. + * @param developerPayload An optional developer-specified payload, to be included in the returned purchase's signed request. + */ + purchase(productID: string, developerPayload?: string): this; + + /** + * Fetches all of the player's unconsumed purchases. The game must fetch the current player's purchases + * as soon as the client indicates that it is ready to perform payments-related operations, + * i.e. at game start. The game can then process and consume any purchases that are waiting to be consumed. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `getpurchases` event along + * with the purchase data. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `getpurchasesfail` event instead. + */ + getPurchases(): this; + + /** + * Consumes a specific purchase belonging to the current player. Before provisioning a product's effects to the player, + * the game should request the consumption of the purchased product. Once the purchase is successfully consumed, + * the game should immediately provide the player with the effects of their purchase. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If they are successfully subscribed this plugin will emit the `consumepurchase` event along + * with the purchase data. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `consumepurchasefail` event instead. + * @param purchaseToken The purchase token of the purchase that should be consumed. + */ + consumePurchase(purchaseToken: string): this; + + /** + * Informs Facebook of a custom update that occurred in the game. + * This will temporarily yield control to Facebook and Facebook will decide what to do based on what the update is. + * Once Facebook returns control to the game the plugin will emit an `update` or `upatefail` event. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * The `text` parameter is an update payload with the following structure: + * + * ``` + * text: { + * default: 'X just invaded Y\'s village!', + * localizations: { + * ar_AR: 'X \u0641\u0642\u0637 \u063A\u0632\u062A ' + + * '\u0642\u0631\u064A\u0629 Y!', + * en_US: 'X just invaded Y\'s village!', + * es_LA: '\u00A1X acaba de invadir el pueblo de Y!', + * } + * } + * ``` + * @param cta The call to action text. + * @param text The text object. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param template The update template key. + * @param updateData The update data object payload. + */ + update(cta: string, text: object, key: string, frame: string | integer, template: string, updateData: object): this; + + /** + * Informs Facebook of a leaderboard update that occurred in the game. + * This will temporarily yield control to Facebook and Facebook will decide what to do based on what the update is. + * Once Facebook returns control to the game the plugin will emit an `update` or `upatefail` event. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * The `text` parameter is an update payload with the following structure: + * + * ``` + * text: { + * default: 'X just invaded Y\'s village!', + * localizations: { + * ar_AR: 'X \u0641\u0642\u0637 \u063A\u0632\u062A ' + + * '\u0642\u0631\u064A\u0629 Y!', + * en_US: 'X just invaded Y\'s village!', + * es_LA: '\u00A1X acaba de invadir el pueblo de Y!', + * } + * } + * ``` + * @param cta The call to action text. + * @param text The text object. + * @param key The key of the texture to use as the share image. + * @param frame The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data. + * @param template The update template key. + * @param updateData The update data object payload. + */ + updateLeaderboard(cta: string, text: object, key: string, frame: string | integer, template: string, updateData: object): this; + + /** + * Request that the client switch to a different Instant Game. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If the game switches successfully this plugin will emit the `switchgame` event and the client will load the new game. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `switchgamefail` event instead. + * @param appID The Application ID of the Instant Game to switch to. The application must be an Instant Game, and must belong to the same business as the current game. + * @param data An optional data payload. This will be set as the entrypoint data for the game being switched to. Must be less than or equal to 1000 characters when stringified. + */ + switchGame(appID: string, data?: object): this; + + /** + * Prompts the user to create a shortcut to the game if they are eligible to. + * Can only be called once per session. + * + * It makes an async call to the API, so the result isn't available immediately. + * + * If the user choose to create a shortcut this plugin will emit the `shortcutcreated` event. + * + * If they cannot, i.e. it's not in the list of supported APIs, or the request + * was rejected, it will emit a `shortcutcreatedfail` event instead. + */ + createShortcut(): this; + + /** + * Quits the game. + */ + quit(): void; + + /** + * Log an app event with FB Analytics. + * + * See https://developers.facebook.com/docs/javascript/reference/v2.8#app_events for more details about FB Analytics. + * @param name Name of the event. Must be 2 to 40 characters, and can only contain '_', '-', ' ', and alphanumeric characters. + * @param value An optional numeric value that FB Analytics can calculate a sum with. + * @param params An optional object that can contain up to 25 key-value pairs to be logged with the event. Keys must be 2 to 40 characters, and can only contain '_', '-', ' ', and alphanumeric characters. Values must be less than 100 characters in length. + */ + log(name: string, value?: number, params?: object): this; + + /** + * Attempt to create an instance of an interstitial ad. + * + * If the instance is created successfully then the ad is preloaded ready for display in-game via the method `showAd()`. + * + * If the ad loads it will emit the `adloaded` event, passing the AdInstance as the only parameter. + * + * If the ad cannot be displayed because there was no inventory to fill it, it will emit the `adsnofill` event. + * @param placementID The ad placement ID, or an array of IDs, as created in your Audience Network settings within Facebook. + */ + preloadAds(placementID: string | string[]): this; + + /** + * Attempt to create an instance of an rewarded video ad. + * + * If the instance is created successfully then the ad is preloaded ready for display in-game via the method `showVideo()`. + * + * If the ad loads it will emit the `adloaded` event, passing the AdInstance as the only parameter. + * + * If the ad cannot be displayed because there was no inventory to fill it, it will emit the `adsnofill` event. + * @param placementID The ad placement ID, or an array of IDs, as created in your Audience Network settings within Facebook. + */ + preloadVideoAds(placementID: string | string[]): this; + + /** + * Displays a previously loaded interstitial ad. + * + * If the ad is successfully displayed this plugin will emit the `adfinished` event, with the AdInstance object as its parameter. + * + * If the ad cannot be displayed, it will emit the `adsnotloaded` event. + * @param placementID The ad placement ID to display. + */ + showAd(placementID: string): this; + + /** + * Displays a previously loaded interstitial video ad. + * + * If the ad is successfully displayed this plugin will emit the `adfinished` event, with the AdInstance object as its parameter. + * + * If the ad cannot be displayed, it will emit the `adsnotloaded` event. + * @param placementID The ad placement ID to display. + */ + showVideo(placementID: string): this; + + /** + * Attempts to match the current player with other users looking for people to play with. + * If successful, a new Messenger group thread will be created containing the matched players and the player will + * be context switched to that thread. This plugin will also dispatch the `matchplayer` event, containing the new context ID and Type. + * + * The default minimum and maximum number of players in one matched thread are 2 and 20 respectively, + * depending on how many players are trying to get matched around the same time. + * + * The values can be changed in `fbapp-config.json`. See the Bundle Config documentation for documentation about `fbapp-config.json`. + * @param matchTag Optional extra information about the player used to group them with similar players. Players will only be grouped with other players with exactly the same tag. The tag must only include letters, numbers, and underscores and be 100 characters or less in length. + * @param switchImmediately Optional extra parameter that specifies whether the player should be immediately switched to the new context when a match is found. By default this will be false which will mean the player needs explicitly press play after being matched to switch to the new context. Default false. + */ + matchPlayer(matchTag?: string, switchImmediately?: boolean): this; + + /** + * Fetch a specific leaderboard belonging to this Instant Game. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes the `getleaderboard` event will be emitted along with a Leaderboard object instance. + * @param name The name of the leaderboard. Each leaderboard for an Instant Game must have its own distinct name. + */ + getLeaderboard(name: string): this; + + /** + * Quits the Facebook API and then destroys this plugin. + */ + destroy(): void; + + } + + /** + * This class represents one single Leaderboard that belongs to a Facebook Instant Game. + * + * You do not need to instantiate this class directly, it will be created when you use the + * `getLeaderboard()` method of the main plugin. + */ + class FacebookInstantGamesLeaderboard { + /** + * + * @param plugin A reference to the Facebook Instant Games Plugin. + * @param data An Instant Game leaderboard instance. + */ + constructor(plugin: Phaser.FacebookInstantGamesPlugin, data: any); + + /** + * A reference to the Facebook Instant Games Plugin. + */ + plugin: Phaser.FacebookInstantGamesPlugin; + + /** + * An Instant Game leaderboard instance. + */ + ref: any; + + /** + * The name of the leaderboard. + */ + name: string; + + /** + * The ID of the context that the leaderboard is associated with, or null if the leaderboard is not tied to a particular context. + */ + contextID: string; + + /** + * The total number of player entries in the leaderboard. + * This value defaults to zero. Populate it via the `getEntryCount()` method. + */ + entryCount: integer; + + /** + * The players score object. + * This value defaults to `null`. Populate it via the `getPlayerScore()` method. + */ + playerScore: LeaderboardScore; + + /** + * The scores in the Leaderboard from the currently requested range. + * This value defaults to an empty array. Populate it via the `getScores()` method. + * The contents of this array are reset each time `getScores()` is called. + */ + scores: LeaderboardScore[]; + + /** + * Fetches the total number of player entries in the leaderboard. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes this Leaderboard will emit the `getentrycount` event along with the count and name of the Leaderboard. + */ + getEntryCount(): this; + + /** + * Updates the player's score. If the player has an existing score, the old score will only be replaced if the new score is better than it. + * NOTE: If the leaderboard is associated with a specific context, the game must be in that context to set a score for the player. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes this Leaderboard will emit the `setscore` event along with the LeaderboardScore object and the name of the Leaderboard. + * + * If the save fails the event will send `null` as the score value. + * @param score The new score for the player. Must be a 64-bit integer number. + * @param data Metadata to associate with the stored score. Must be less than 2KB in size. If an object is given it will be passed to `JSON.stringify`. + */ + setScore(score: integer, data?: string | any): this; + + /** + * Gets the players leaderboard entry and stores it in the `playerScore` property. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes this Leaderboard will emit the `getplayerscore` event along with the score and the name of the Leaderboard. + * + * If the player has not yet saved a score, the event will send `null` as the score value, and `playerScore` will be set to `null` as well. + */ + getPlayerScore(): this; + + /** + * Retrieves a set of leaderboard entries, ordered by score ranking in the leaderboard. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes this Leaderboard will emit the `getscores` event along with an array of LeaderboardScore entries and the name of the Leaderboard. + * @param count The number of entries to attempt to fetch from the leaderboard. Currently, up to a maximum of 100 entries may be fetched per query. Default 10. + * @param offset The offset from the top of the leaderboard that entries will be fetched from. Default 0. + */ + getScores(count?: integer, offset?: integer): this; + + /** + * Retrieves a set of leaderboard entries, based on the current player's connected players (including the current player), ordered by local rank within the set of connected players. + * + * The data is requested in an async call, so the result isn't available immediately. + * + * When the call completes this Leaderboard will emit the `getconnectedscores` event along with an array of LeaderboardScore entries and the name of the Leaderboard. + * @param count The number of entries to attempt to fetch from the leaderboard. Currently, up to a maximum of 100 entries may be fetched per query. Default 10. + * @param offset The offset from the top of the leaderboard that entries will be fetched from. Default 0. + */ + getConnectedScores(count?: integer, offset?: integer): this; + + } + +} + +declare type ArcadePhysicsCallback = (object1: Phaser.GameObjects.GameObject, object2: Phaser.GameObjects.GameObject)=>void; + +declare type CollideCallback = (body: Phaser.Physics.Impact.Body, other: Phaser.Physics.Impact.Body, axis: string)=>void; + +declare namespace MatterJS { + /** + * The `Matter.Body` module contains methods for creating and manipulating body models. + * A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`. + * Factories for commonly used body configurations (such as rectangles, circles and other polygons) can be found in the module `Matter.Bodies`. + */ + class Body { + } + + /** + * The `Matter.Bodies` module contains factory methods for creating rigid body models + * with commonly used body configurations (such as rectangles, circles and other polygons). + */ + class Bodies { + } + + /** + * The `Matter.Composite` module contains methods for creating and manipulating composite bodies. + * A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure. + * It is important to use the functions in this module to modify composites, rather than directly modifying their properties. + * Note that the `Matter.World` object is also a type of `Matter.Composite` and as such all composite methods here can also operate on a `Matter.World`. + */ + class Composite { + } + + /** + * The `Matter.World` module contains methods for creating and manipulating the world composite. + * A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. + * A `Matter.World` has a few additional properties including `gravity` and `bounds`. + * It is important to use the functions in the `Matter.Composite` module to modify the world composite, rather than directly modifying its properties. + * There are also a few methods here that alias those in `Matter.Composite` for easier readability. + */ + class World extends MatterJS.Composite { + } + + /** + * The `Matter.Constraint` module contains methods for creating and manipulating constraints. + * Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position). + * The stiffness of constraints can be modified to create springs or elastic. + */ + class Constraint { + } + + /** + * The `Matter.Engine` module contains methods for creating and manipulating engines. + * An engine is a controller that manages updating the simulation of the world. + */ + class Engine { + } + + /** + * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. + * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. + * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). + */ + class Vertices { + } + +} + +declare type WebGLContextCallback = (renderer: Phaser.Renderer.WebGL.WebGLRenderer)=>void; + +declare type EachListCallback = (item: I, ...args: any[])=>void; + +declare type EachMapCallback = (key: string, entry: E)=>void; + +declare type EachSetCallback = (entry: E, index: number)=>void; + +declare type EachTextureCallback = (texture: Phaser.Textures.Texture, ...args: any[])=>void; + +declare type FindTileCallback = (value: Phaser.Tilemaps.Tile, index: integer, array: Phaser.Tilemaps.Tile[])=>void; + +declare type EachTileCallback = (value: Phaser.Tilemaps.Tile, index: integer, array: Phaser.Tilemaps.Tile[])=>void; + +declare type TilemapFilterCallback = (value: Phaser.GameObjects.GameObject, index: number, array: Phaser.GameObjects.GameObject[])=>void; + +declare type TilemapFindCallback = (value: Phaser.GameObjects.GameObject, index: number, array: Phaser.GameObjects.GameObject[])=>void; + +/** + * Extends the given `myClass` object's prototype with the properties of `definition`. + * @param ctor The constructor object to mix into. + * @param definition A dictionary of functions for the class. + * @param isClassDescriptor Is the definition a class descriptor? + * @param extend The parent constructor object. + */ +declare function extend(ctor: Object, definition: Object, isClassDescriptor: boolean, extend?: Object): void; + +/** + * Applies the given `mixins` to the prototype of `myClass`. + * @param myClass The constructor object to mix into. + * @param mixins The mixins to apply to the constructor. + */ +declare function mixin(myClass: Object, mixins: Object | Object[]): void; + +/** + * Phaser.Class + */ +declare class Class { + /** + * + * @param definition a dictionary of functions for the class + */ + constructor(definition: Object); + +} + +declare type AdInstance = { + /** + * Represents an instance of an ad. + */ + instance: any; + /** + * The Audience Network placement ID of this ad instance. + */ + placementID: string; + /** + * Has this ad already been shown in-game? + */ + shown: boolean; + /** + * Is this a video ad? + */ + video: boolean; +}; + +declare type LeaderboardScore = { + /** + * An integer score value. + */ + score: integer; + /** + * The score value, formatted with the score format associated with the leaderboard. + */ + scoreFormatted: string; + /** + * The Unix timestamp of when the leaderboard entry was last updated. + */ + timestamp: integer; + /** + * The entry's leaderboard ranking. + */ + rank: integer; + /** + * The developer-specified payload associated with the score, or null if one was not set. + */ + data: string; + /** + * The player's localized display name. + */ + playerName: string; + /** + * A url to the player's public profile photo. + */ + playerPhotoURL: string; + /** + * The game's unique identifier for the player. + */ + playerID: string; +}; + +declare type Product = { + /** + * The title of the product. + */ + title?: string; + /** + * The product's game-specified identifier. + */ + productID?: string; + /** + * The product description. + */ + description?: string; + /** + * A link to the product's associated image. + */ + imageURI?: string; + /** + * The price of the product. + */ + price?: string; + /** + * The currency code for the product. + */ + priceCurrencyCode?: string; +}; + +declare type Purchase = { + /** + * A developer-specified string, provided during the purchase of the product. + */ + developerPayload?: string; + /** + * The identifier for the purchase transaction. + */ + paymentID?: string; + /** + * The product's game-specified identifier. + */ + productID?: string; + /** + * Unix timestamp of when the purchase occurred. + */ + purchaseTime?: string; + /** + * A token representing the purchase that may be used to consume the purchase. + */ + purchaseToken?: string; + /** + * Server-signed encoding of the purchase request. + */ + signedRequest?: string; +}; + +declare type integer = number; + +declare module 'phaser' { + export = Phaser; + +} + diff --git a/Phaser/Demos/libs/phaser/phaser.js b/Phaser/Demos/libs/phaser/phaser.js new file mode 100644 index 00000000..0adeb8f1 --- /dev/null +++ b/Phaser/Demos/libs/phaser/phaser.js @@ -0,0 +1,188913 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define("Phaser", [], factory); + else if(typeof exports === 'object') + exports["Phaser"] = factory(); + else + root["Phaser"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 1338); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Taken from klasse by mattdesl https://github.com/mattdesl/klasse + +function hasGetterOrSetter (def) +{ + return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function'); +} + +function getProperty (definition, k, isClassDescriptor) +{ + // This may be a lightweight object, OR it might be a property that was defined previously. + + // For simple class descriptors we can just assume its NOT previously defined. + var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k); + + if (!isClassDescriptor && def.value && typeof def.value === 'object') + { + def = def.value; + } + + // This might be a regular property, or it may be a getter/setter the user defined in a class. + if (def && hasGetterOrSetter(def)) + { + if (typeof def.enumerable === 'undefined') + { + def.enumerable = true; + } + + if (typeof def.configurable === 'undefined') + { + def.configurable = true; + } + + return def; + } + else + { + return false; + } +} + +function hasNonConfigurable (obj, k) +{ + var prop = Object.getOwnPropertyDescriptor(obj, k); + + if (!prop) + { + return false; + } + + if (prop.value && typeof prop.value === 'object') + { + prop = prop.value; + } + + if (prop.configurable === false) + { + return true; + } + + return false; +} + +/** + * Extends the given `myClass` object's prototype with the properties of `definition`. + * + * @function extend + * @param {Object} ctor The constructor object to mix into. + * @param {Object} definition A dictionary of functions for the class. + * @param {boolean} isClassDescriptor Is the definition a class descriptor? + * @param {Object} [extend] The parent constructor object. + */ +function extend (ctor, definition, isClassDescriptor, extend) +{ + for (var k in definition) + { + if (!definition.hasOwnProperty(k)) + { + continue; + } + + var def = getProperty(definition, k, isClassDescriptor); + + if (def !== false) + { + // If Extends is used, we will check its prototype to see if the final variable exists. + + var parent = extend || ctor; + + if (hasNonConfigurable(parent.prototype, k)) + { + // Just skip the final property + if (Class.ignoreFinals) + { + continue; + } + + // We cannot re-define a property that is configurable=false. + // So we will consider them final and throw an error. This is by + // default so it is clear to the developer what is happening. + // You can set ignoreFinals to true if you need to extend a class + // which has configurable=false; it will simply not re-define final properties. + throw new Error('cannot override final property \'' + k + '\', set Class.ignoreFinals = true to skip'); + } + + Object.defineProperty(ctor.prototype, k, def); + } + else + { + ctor.prototype[k] = definition[k]; + } + } +} + +/** + * Applies the given `mixins` to the prototype of `myClass`. + * + * @function mixin + * @param {Object} myClass The constructor object to mix into. + * @param {Object|Array} mixins The mixins to apply to the constructor. + */ +function mixin (myClass, mixins) +{ + if (!mixins) + { + return; + } + + if (!Array.isArray(mixins)) + { + mixins = [ mixins ]; + } + + for (var i = 0; i < mixins.length; i++) + { + extend(myClass, mixins[i].prototype || mixins[i]); + } +} + +/** + * Creates a new class with the given descriptor. + * The constructor, defined by the name `initialize`, + * is an optional function. If unspecified, an anonymous + * function will be used which calls the parent class (if + * one exists). + * + * You can also use `Extends` and `Mixins` to provide subclassing + * and inheritance. + * + * @class Phaser.Class + * @constructor + * @param {Object} definition a dictionary of functions for the class + * @example + * + * var MyClass = new Phaser.Class({ + * + * initialize: function() { + * this.foo = 2.0; + * }, + * + * bar: function() { + * return this.foo + 5; + * } + * }); + */ +function Class (definition) +{ + if (!definition) + { + definition = {}; + } + + // The variable name here dictates what we see in Chrome debugger + var initialize; + var Extends; + + if (definition.initialize) + { + if (typeof definition.initialize !== 'function') + { + throw new Error('initialize must be a function'); + } + + initialize = definition.initialize; + + // Usually we should avoid 'delete' in V8 at all costs. + // However, its unlikely to make any performance difference + // here since we only call this on class creation (i.e. not object creation). + delete definition.initialize; + } + else if (definition.Extends) + { + var base = definition.Extends; + + initialize = function () + { + base.apply(this, arguments); + }; + } + else + { + initialize = function () {}; + } + + if (definition.Extends) + { + initialize.prototype = Object.create(definition.Extends.prototype); + initialize.prototype.constructor = initialize; + + // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin) + + Extends = definition.Extends; + + delete definition.Extends; + } + else + { + initialize.prototype.constructor = initialize; + } + + // Grab the mixins, if they are specified... + var mixins = null; + + if (definition.Mixins) + { + mixins = definition.Mixins; + delete definition.Mixins; + } + + // First, mixin if we can. + mixin(initialize, mixins); + + // Now we grab the actual definition which defines the overrides. + extend(initialize, definition, true, Extends); + + return initialize; +} + +Class.extend = extend; +Class.mixin = mixin; +Class.ignoreFinals = false; + +module.exports = Class; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + * + * @function Phaser.Utils.NOOP + * @since 3.0.0 + */ +var NOOP = function () +{ + // NOOP +}; + +module.exports = NOOP; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} + * + * @function Phaser.Utils.Objects.GetFastValue + * @since 3.0.0 + * + * @param {object} source - The object to search + * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods) + * @param {*} [defaultValue] - The default value to use if the key does not exist. + * + * @return {*} The value if found; otherwise, defaultValue (null if none provided) + */ +var GetFastValue = function (source, key, defaultValue) +{ + var t = typeof(source); + + if (!source || t === 'number' || t === 'string') + { + return defaultValue; + } + else if (source.hasOwnProperty(key) && source[key] !== undefined) + { + return source[key]; + } + else + { + return defaultValue; + } +}; + +module.exports = GetFastValue; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * Defines a Point in 2D space, with an x and y component. + * + * @class Point + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x coordinate of this Point. + * @param {number} [y=x] - The y coordinate of this Point. + */ +var Point = new Class({ + + initialize: + + function Point (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + /** + * The x coordinate of this Point. + * + * @name Phaser.Geom.Point#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The y coordinate of this Point. + * + * @name Phaser.Geom.Point#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + }, + + /** + * Set the x and y coordinates of the point to the given values. + * + * @method Phaser.Geom.Point#setTo + * @since 3.0.0 + * + * @param {number} [x=0] - The x coordinate of this Point. + * @param {number} [y=x] - The y coordinate of this Point. + * + * @return {Phaser.Geom.Point} This Point object. + */ + setTo: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + } + +}); + +module.exports = Point; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A representation of a vector in 2D space. + * + * A two-component vector. + * + * @class Vector2 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties. + * @param {number} [y] - The y component. + */ +var Vector2 = new Class({ + + initialize: + + function Vector2 (x, y) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector2#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector2#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + } + else + { + if (y === undefined) { y = x; } + + this.x = x || 0; + this.y = y || 0; + } + }, + + /** + * Make a clone of this Vector2. + * + * @method Phaser.Math.Vector2#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} A clone of this Vector2. + */ + clone: function () + { + return new Vector2(this.x, this.y); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector2#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + copy: function (src) + { + this.x = src.x || 0; + this.y = src.y || 0; + + return this; + }, + + /** + * Set the component values of this Vector from a given Vector2Like object. + * + * @method Phaser.Math.Vector2#setFromObject + * @since 3.0.0 + * + * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setFromObject: function (obj) + { + this.x = obj.x || 0; + this.y = obj.y || 0; + + return this; + }, + + /** + * Set the `x` and `y` components of the this Vector to the given `x` and `y` values. + * + * @method Phaser.Math.Vector2#set + * @since 3.0.0 + * + * @param {number} x - The x value to set for this Vector. + * @param {number} [y=x] - The y value to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + set: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * This method is an alias for `Vector2.set`. + * + * @method Phaser.Math.Vector2#setTo + * @since 3.4.0 + * + * @param {number} x - The x value to set for this Vector. + * @param {number} [y=x] - The y value to set for this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setTo: function (x, y) + { + return this.set(x, y); + }, + + /** + * Sets the `x` and `y` values of this object from a given polar coordinate. + * + * @method Phaser.Math.Vector2#setToPolar + * @since 3.0.0 + * + * @param {number} azimuth - The angular coordinate, in radians. + * @param {number} [radius=1] - The radial coordinate (length). + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + setToPolar: function (azimuth, radius) + { + if (radius == null) { radius = 1; } + + this.x = Math.cos(azimuth) * radius; + this.y = Math.sin(azimuth) * radius; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector2#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector. + * + * @return {boolean} Whether the given Vector is equal to this Vector. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y)); + }, + + /** + * Calculate the angle between this Vector and the positive x-axis, in radians. + * + * @method Phaser.Math.Vector2#angle + * @since 3.0.0 + * + * @return {number} The angle between this Vector, and the positive x-axis, given in radians. + */ + angle: function () + { + // computes the angle in radians with respect to the positive x-axis + + var angle = Math.atan2(this.y, this.x); + + if (angle < 0) + { + angle += 2 * Math.PI; + } + + return angle; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector2#add + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + add: function (src) + { + this.x += src.x; + this.y += src.y; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector2#subtract + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + subtract: function (src) + { + this.x -= src.x; + this.y -= src.y; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector2#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + multiply: function (src) + { + this.x *= src.x; + this.y *= src.y; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector2#scale + * @since 3.0.0 + * + * @param {number} value - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + scale: function (value) + { + if (isFinite(value)) + { + this.x *= value; + this.y *= value; + } + else + { + this.x = 0; + this.y = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector2#divide + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + divide: function (src) + { + this.x /= src.x; + this.y /= src.y; + + return this; + }, + + /** + * Negate the `x` and `y` components of this Vector. + * + * @method Phaser.Math.Vector2#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#distance + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (src) + { + var dx = src.x - this.x; + var dy = src.y - this.y; + + return Math.sqrt(dx * dx + dy * dy); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector2#distanceSq + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (src) + { + var dx = src.x - this.x; + var dy = src.y - this.y; + + return dx * dx + dy * dy; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector2#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + + return Math.sqrt(x * x + y * y); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector2#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + + return x * x + y * y; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector2#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var len = x * x + y * y; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + } + + return this; + }, + + /** + * Right-hand normalize (make unit length) this Vector. + * + * @method Phaser.Math.Vector2#normalizeRightHand + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + normalizeRightHand: function () + { + var x = this.x; + + this.x = this.y * -1; + this.y = x; + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector2 to dot product with this Vector2. + * + * @return {number} The dot product of this Vector and the given Vector. + */ + dot: function (src) + { + return this.x * src.x + this.y * src.y; + }, + + /** + * Calculate the cross product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector2#cross + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector2 to cross with this Vector2. + * + * @return {number} The cross product of this Vector and the given Vector. + */ + cross: function (src) + { + return this.x * src.y - this.y * src.x; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector2#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} src - The Vector2 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + lerp: function (src, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + + this.x = ax + t * (src.x - ax); + this.y = ay + t * (src.y - ay); + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector2#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var m = mat.val; + + this.x = m[0] * x + m[3] * y + m[6]; + this.y = m[1] * x + m[4] * y + m[7]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector2#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with. + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[12]; + this.y = m[1] * x + m[5] * y + m[13]; + + return this; + }, + + /** + * Make this Vector the zero vector (0, 0). + * + * @method Phaser.Math.Vector2#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector2} This Vector2. + */ + reset: function () + { + this.x = 0; + this.y = 0; + + return this; + } + +}); + +/** + * A static zero Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.ZERO + * @type {Phaser.Math.Vector2} + * @since 3.1.0 + */ +Vector2.ZERO = new Vector2(); + +/** + * A static right Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.RIGHT + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.RIGHT = new Vector2(1, 0); + +/** + * A static left Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.LEFT + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.LEFT = new Vector2(-1, 0); + +/** + * A static up Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.UP + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.UP = new Vector2(0, -1); + +/** + * A static down Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.DOWN + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.DOWN = new Vector2(0, 1); + +/** + * A static one Vector2 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector2.ONE + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ +Vector2.ONE = new Vector2(1, 1); + +module.exports = Vector2; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); + +/** + * @classdesc + * The Game Object Factory is a Scene plugin that allows you to quickly create many common + * types of Game Objects and have them automatically registered with the Scene. + * + * Game Objects directly register themselves with the Factory and inject their own creation + * methods into the class. + * + * @class GameObjectFactory + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object Factory belongs. + */ +var GameObjectFactory = new Class({ + + initialize: + + function GameObjectFactory (scene) + { + /** + * The Scene to which this Game Object Factory belongs. + * + * @name Phaser.GameObjects.GameObjectFactory#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Scene.Systems. + * + * @name Phaser.GameObjects.GameObjectFactory#systems + * @type {Phaser.Scenes.Systems} + * @protected + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * A reference to the Scene Display List. + * + * @name Phaser.GameObjects.GameObjectFactory#displayList + * @type {Phaser.GameObjects.DisplayList} + * @protected + * @since 3.0.0 + */ + this.displayList; + + /** + * A reference to the Scene Update List. + * + * @name Phaser.GameObjects.GameObjectFactory#updateList; + * @type {Phaser.GameObjects.UpdateList} + * @protected + * @since 3.0.0 + */ + this.updateList; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.GameObjectFactory#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.displayList = this.systems.displayList; + this.updateList = this.systems.updateList; + + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.GameObjectFactory#start + * @private + * @since 3.5.0 + */ + start: function () + { + this.systems.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * Adds an existing Game Object to this Scene. + * + * If the Game Object renders, it will be added to the Display List. + * If it has a `preUpdate` method, it will be added to the Update List. + * + * @method Phaser.GameObjects.GameObjectFactory#existing + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The child to be added to this Scene. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was added. + */ + existing: function (child) + { + if (child.renderCanvas || child.renderWebGL) + { + this.displayList.add(child); + } + + if (child.preUpdate) + { + this.updateList.add(child); + } + + return child; + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.GameObjects.GameObjectFactory#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + this.systems.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.GameObjects.GameObjectFactory#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + + this.displayList = null; + this.updateList = null; + } + +}); + +// Static method called directly by the Game Object factory functions + +GameObjectFactory.register = function (factoryType, factoryFunction) +{ + if (!GameObjectFactory.prototype.hasOwnProperty(factoryType)) + { + GameObjectFactory.prototype[factoryType] = factoryFunction; + } +}; + +PluginCache.register('GameObjectFactory', GameObjectFactory, 'add'); + +module.exports = GameObjectFactory; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Source object +// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner' +// The default value to use if the key doesn't exist + +/** + * Retrieves a value from an object. + * + * @function Phaser.Utils.Objects.GetValue + * @since 3.0.0 + * + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * + * @return {*} The value of the requested key. + */ +var GetValue = function (source, key, defaultValue) +{ + if (!source || typeof source === 'number') + { + return defaultValue; + } + else if (source.hasOwnProperty(key)) + { + return source[key]; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parent = source; + var value = defaultValue; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parent.hasOwnProperty(keys[i])) + { + // Yes it has a key property, let's carry on down + value = parent[keys[i]]; + + parent = parent[keys[i]]; + } + else + { + // Can't go any further, so reset to default + value = defaultValue; + break; + } + } + + return value; + } + else + { + return defaultValue; + } +}; + +module.exports = GetValue; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a slightly modified version of jQuery.isPlainObject. + * A plain object is an object whose internal class property is [object Object]. + * + * @function Phaser.Utils.Objects.IsPlainObject + * @since 3.0.0 + * + * @param {object} obj - The object to inspect. + * + * @return {boolean} `true` if the object is plain, otherwise `false`. + */ +var IsPlainObject = function (obj) +{ + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) + { + return false; + } + + // Support: Firefox <20 + // The try/catch suppresses exceptions thrown when attempting to access + // the "constructor" property of certain host objects, ie. |window.location| + // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 + try + { + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) + { + return false; + } + } + catch (e) + { + return false; + } + + // If the function hasn't returned already, we're confident that + // |obj| is a plain object, created by {} or constructed with new Object + return true; +}; + +module.exports = IsPlainObject; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var types = {}; + +/** + * @namespace Phaser.Loader.FileTypesManager + */ + +var FileTypesManager = { + + /** + * Static method called when a LoaderPlugin is created. + * + * Loops through the local types object and injects all of them as + * properties into the LoaderPlugin instance. + * + * @method Phaser.Loader.FileTypesManager.install + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into. + */ + install: function (loader) + { + for (var key in types) + { + loader[key] = types[key]; + } + }, + + /** + * Static method called directly by the File Types. + * + * The key is a reference to the function used to load the files via the Loader, i.e. `image`. + * + * @method Phaser.Loader.FileTypesManager.register + * @since 3.0.0 + * + * @param {string} key - The key that will be used as the method name in the LoaderPlugin. + * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked. + */ + register: function (key, factoryFunction) + { + types[key] = factoryFunction; + }, + + /** + * Removed all associated file types. + * + * @method Phaser.Loader.FileTypesManager.destroy + * @since 3.0.0 + */ + destroy: function () + { + types = {}; + } + +}; + +module.exports = FileTypesManager; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Renderer.WebGL.Utils + * @since 3.0.0 + */ +module.exports = { + + /** + * Packs four floats on a range from 0.0 to 1.0 into a single Uint32 + * + * @function Phaser.Renderer.WebGL.Utils.getTintFromFloats + * @since 3.0.0 + * + * @param {number} r - Red component in a range from 0.0 to 1.0 + * @param {number} g - Green component in a range from 0.0 to 1.0 + * @param {number} b - Blue component in a range from 0.0 to 1.0 + * @param {number} a - Alpha component in a range from 0.0 to 1.0 + * + * @return {number} [description] + */ + getTintFromFloats: function (r, g, b, a) + { + var ur = ((r * 255.0)|0) & 0xFF; + var ug = ((g * 255.0)|0) & 0xFF; + var ub = ((b * 255.0)|0) & 0xFF; + var ua = ((a * 255.0)|0) & 0xFF; + + return ((ua << 24) | (ur << 16) | (ug << 8) | ub) >>> 0; + }, + + /** + * Packs a Uint24, representing RGB components, with a Float32, representing + * the alpha component, with a range between 0.0 and 1.0 and return a Uint32 + * + * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha + * @since 3.0.0 + * + * @param {number} rgb - Uint24 representing RGB components + * @param {number} a - Float32 representing Alpha component + * + * @return {number} Packed RGBA as Uint32 + */ + getTintAppendFloatAlpha: function (rgb, a) + { + var ua = ((a * 255.0)|0) & 0xFF; + return ((ua << 24) | rgb) >>> 0; + }, + + /** + * Packs a Uint24, representing RGB components, with a Float32, representing + * the alpha component, with a range between 0.0 and 1.0 and return a + * swizzled Uint32 + * + * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlphaAndSwap + * @since 3.0.0 + * + * @param {number} rgb - Uint24 representing RGB components + * @param {number} a - Float32 representing Alpha component + * + * @return {number} Packed RGBA as Uint32 + */ + getTintAppendFloatAlphaAndSwap: function (rgb, a) + { + var ur = ((rgb >> 16)|0) & 0xff; + var ug = ((rgb >> 8)|0) & 0xff; + var ub = (rgb|0) & 0xff; + var ua = ((a * 255.0)|0) & 0xFF; + + return ((ua << 24) | (ub << 16) | (ug << 8) | ur) >>> 0; + }, + + /** + * Unpacks a Uint24 RGB into an array of floats of ranges of 0.0 and 1.0 + * + * @function Phaser.Renderer.WebGL.Utils.getFloatsFromUintRGB + * @since 3.0.0 + * + * @param {number} rgb - RGB packed as a Uint24 + * + * @return {array} Array of floats representing each component as a float + */ + getFloatsFromUintRGB: function (rgb) + { + var ur = ((rgb >> 16)|0) & 0xff; + var ug = ((rgb >> 8)|0) & 0xff; + var ub = (rgb|0) & 0xff; + + return [ ur / 255.0, ug / 255.0, ub / 255.0 ]; + }, + + /** + * Counts how many attributes of 32 bits a vertex has + * + * @function Phaser.Renderer.WebGL.Utils.getComponentCount + * @since 3.0.0 + * + * @param {array} attributes - Array of attributes + * @param {WebGLRenderingContext} glContext - WebGLContext used for check types + * + * @return {number} Count of 32 bit attributes in vertex + */ + getComponentCount: function (attributes, glContext) + { + var count = 0; + + for (var index = 0; index < attributes.length; ++index) + { + var element = attributes[index]; + + if (element.type === glContext.FLOAT) + { + count += element.size; + } + else + { + count += 1; // We'll force any other type to be 32 bit. for now + } + } + + return count; + } + +}; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Contains = __webpack_require__(47); +var GetPoint = __webpack_require__(147); +var GetPoints = __webpack_require__(249); +var Line = __webpack_require__(54); +var Random = __webpack_require__(150); + +/** + * @classdesc + * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) + * + * @class Rectangle + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. + * @param {number} [width=0] - The width of the Rectangle. + * @param {number} [height=0] - The height of the Rectangle. + */ +var Rectangle = new Class({ + + initialize: + + function Rectangle (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 0; } + if (height === undefined) { height = 0; } + + /** + * The X coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The Y coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + + /** + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. + * + * @name Phaser.Geom.Rectangle#width + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.width = width; + + /** + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. + * + * @name Phaser.Geom.Rectangle#height + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.height = height; + }, + + /** + * Checks if the given point is inside the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#contains + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ + contains: function (x, y) + { + return Contains(this, x, y); + }, + + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @method Phaser.Geom.Rectangle#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [output,$return] + * + * @param {number} position - The normalized distance into the Rectangle's perimeter to return. + * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. + * + * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. + */ + getPoint: function (position, output) + { + return GetPoint(this, position, output); + }, + + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. + * + * @method Phaser.Geom.Rectangle#getPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [output,$return] + * + * @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. + * + * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. + */ + getPoints: function (quantity, stepRate, output) + { + return GetPoints(this, quantity, stepRate, output); + }, + + /** + * Returns a random point within the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. + * + * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. + */ + getRandomPoint: function (point) + { + return Random(this, point); + }, + + /** + * Sets the position, width, and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setTo + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} y - The Y coordinate of the top left corner of the Rectangle. + * @param {number} width - The width of the Rectangle. + * @param {number} height - The height of the Rectangle. + * + * @return {Phaser.Geom.Rectangle} This Rectangle object. + */ + setTo: function (x, y, width, height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + + return this; + }, + + /** + * Resets the position, width, and height of the Rectangle to 0. + * + * @method Phaser.Geom.Rectangle#setEmpty + * @since 3.0.0 + * + * @return {Phaser.Geom.Rectangle} This Rectangle object. + */ + setEmpty: function () + { + return this.setTo(0, 0, 0, 0); + }, + + /** + * Sets the position of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setPosition + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. + * + * @return {Phaser.Geom.Rectangle} This Rectangle object. + */ + setPosition: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * Sets the width and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setSize + * @since 3.0.0 + * + * @param {number} width - The width to set the Rectangle to. + * @param {number} [height=width] - The height to set the Rectangle to. + * + * @return {Phaser.Geom.Rectangle} This Rectangle object. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + this.width = width; + this.height = height; + + return this; + }, + + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + * + * @method Phaser.Geom.Rectangle#isEmpty + * @since 3.0.0 + * + * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. + */ + isEmpty: function () + { + return (this.width <= 0 || this.height <= 0); + }, + + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineA + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. + */ + getLineA: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.y, this.right, this.y); + + return line; + }, + + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineB + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. + */ + getLineB: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.y, this.right, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineC + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. + */ + getLineC: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.bottom, this.x, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineD + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. + */ + getLineD: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.bottom, this.x, this.y); + + return line; + }, + + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. + * + * @name Phaser.Geom.Rectangle#left + * @type {number} + * @since 3.0.0 + */ + left: { + + get: function () + { + return this.x; + }, + + set: function (value) + { + if (value >= this.right) + { + this.width = 0; + } + else + { + this.width = this.right - value; + } + + this.x = value; + } + + }, + + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. + * + * @name Phaser.Geom.Rectangle#right + * @type {number} + * @since 3.0.0 + */ + right: { + + get: function () + { + return this.x + this.width; + }, + + set: function (value) + { + if (value <= this.x) + { + this.width = 0; + } + else + { + this.width = value - this.x; + } + } + + }, + + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. + * + * @name Phaser.Geom.Rectangle#top + * @type {number} + * @since 3.0.0 + */ + top: { + + get: function () + { + return this.y; + }, + + set: function (value) + { + if (value >= this.bottom) + { + this.height = 0; + } + else + { + this.height = (this.bottom - value); + } + + this.y = value; + } + + }, + + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + * + * @name Phaser.Geom.Rectangle#bottom + * @type {number} + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return this.y + this.height; + }, + + set: function (value) + { + if (value <= this.y) + { + this.height = 0; + } + else + { + this.height = value - this.y; + } + } + + }, + + /** + * The x coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerX + * @type {number} + * @since 3.0.0 + */ + centerX: { + + get: function () + { + return this.x + (this.width / 2); + }, + + set: function (value) + { + this.x = value - (this.width / 2); + } + + }, + + /** + * The y coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerY + * @type {number} + * @since 3.0.0 + */ + centerY: { + + get: function () + { + return this.y + (this.height / 2); + }, + + set: function (value) + { + this.y = value - (this.height / 2); + } + + } + +}); + +module.exports = Rectangle; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Components + */ + +module.exports = { + + Alpha: __webpack_require__(244), + Animation: __webpack_require__(479), + BlendMode: __webpack_require__(247), + ComputedSize: __webpack_require__(522), + Crop: __webpack_require__(523), + Depth: __webpack_require__(248), + Flip: __webpack_require__(524), + GetBounds: __webpack_require__(525), + Mask: __webpack_require__(252), + Origin: __webpack_require__(526), + PathFollower: __webpack_require__(527), + Pipeline: __webpack_require__(151), + ScrollFactor: __webpack_require__(255), + Size: __webpack_require__(528), + Texture: __webpack_require__(529), + TextureCrop: __webpack_require__(530), + Tint: __webpack_require__(531), + ToJSON: __webpack_require__(256), + Transform: __webpack_require__(257), + TransformMatrix: __webpack_require__(32), + Visible: __webpack_require__(258) + +}; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var ComponentsToJSON = __webpack_require__(256); +var DataManager = __webpack_require__(109); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(110); + +/** + * @classdesc + * The base class that all Game Objects extend. + * You don't create GameObjects directly and they cannot be added to the display list. + * Instead, use them as the base for your own custom classes. + * + * @class GameObject + * @memberof Phaser.GameObjects + * @extends Phaser.Events.EventEmitter + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. + * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`. + */ +var GameObject = new Class({ + + Extends: EventEmitter, + + initialize: + + function GameObject (scene, type) + { + EventEmitter.call(this); + + /** + * The Scene to which this Game Object belongs. + * Game Objects can only belong to one Scene. + * + * @name Phaser.GameObjects.GameObject#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + * + * @name Phaser.GameObjects.GameObject#type + * @type {string} + * @since 3.0.0 + */ + this.type = type; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could move from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @name Phaser.GameObjects.GameObject#state + * @type {(integer|string)} + * @since 3.16.0 + */ + this.state = 0; + + /** + * The parent Container of this Game Object, if it has one. + * + * @name Phaser.GameObjects.GameObject#parentContainer + * @type {Phaser.GameObjects.Container} + * @since 3.4.0 + */ + this.parentContainer = null; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.GameObjects.GameObject#name + * @type {string} + * @default '' + * @since 3.0.0 + */ + this.name = ''; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + * + * @name Phaser.GameObjects.GameObject#active + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.active = true; + + /** + * The Tab Index of the Game Object. + * Reserved for future use by plugins and the Input Manager. + * + * @name Phaser.GameObjects.GameObject#tabIndex + * @type {integer} + * @default -1 + * @since 3.0.0 + */ + this.tabIndex = -1; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + * + * @name Phaser.GameObjects.GameObject#data + * @type {Phaser.Data.DataManager} + * @default null + * @since 3.0.0 + */ + this.data = null; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + * + * @name Phaser.GameObjects.GameObject#renderFlags + * @type {integer} + * @default 15 + * @since 3.0.0 + */ + this.renderFlags = 15; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + * + * @example + * this.cameraFilter |= camera.id + * + * @name Phaser.GameObjects.GameObject#cameraFilter + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.cameraFilter = 0; + + /** + * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. + * Not usually set directly. Instead call `GameObject.setInteractive()`. + * + * @name Phaser.GameObjects.GameObject#input + * @type {?Phaser.Types.Input.InteractiveObject} + * @default null + * @since 3.0.0 + */ + this.input = null; + + /** + * If this Game Object is enabled for physics then this property will contain a reference to a Physics Body. + * + * @name Phaser.GameObjects.GameObject#body + * @type {?(object|Phaser.Physics.Arcade.Body|Phaser.Physics.Impact.Body)} + * @default null + * @since 3.0.0 + */ + this.body = null; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + * + * @name Phaser.GameObjects.GameObject#ignoreDestroy + * @type {boolean} + * @default false + * @since 3.5.0 + */ + this.ignoreDestroy = false; + + // Tell the Scene to re-sort the children + scene.sys.queueDepthSort(); + }, + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * + * @method Phaser.GameObjects.GameObject#setActive + * @since 3.0.0 + * + * @param {boolean} value - True if this Game Object should be set as active, false if not. + * + * @return {this} This GameObject. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * + * @method Phaser.GameObjects.GameObject#setName + * @since 3.0.0 + * + * @param {string} value - The name to be given to this Game Object. + * + * @return {this} This GameObject. + */ + setName: function (value) + { + this.name = value; + + return this; + }, + + /** + * Sets the current state of this Game Object. + * + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @method Phaser.GameObjects.GameObject#setState + * @since 3.16.0 + * + * @param {(integer|string)} value - The state of the Game Object. + * + * @return {this} This GameObject. + */ + setState: function (value) + { + this.state = value; + + return this; + }, + + /** + * Adds a Data Manager component to this Game Object. + * + * @method Phaser.GameObjects.GameObject#setDataEnabled + * @since 3.0.0 + * @see Phaser.Data.DataManager + * + * @return {this} This GameObject. + */ + setDataEnabled: function () + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this; + }, + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.GameObjects.GameObject#setData + * @since 3.0.0 + * + * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. + * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored. + * + * @return {this} This GameObject. + */ + setData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.set(key, value); + + return this; + }, + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.GameObjects.GameObject#getData + * @since 3.0.0 + * + * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. + * + * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. + */ + getData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this.data.get(key); + }, + + /** + * Pass this Game Object to the Input Manager to enable it for Input. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * + * @method Phaser.GameObjects.GameObject#setInteractive + * @since 3.0.0 + * + * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. + * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target? + * + * @return {this} This GameObject. + */ + setInteractive: function (shape, callback, dropZone) + { + this.scene.sys.input.enable(this, shape, callback, dropZone); + + return this; + }, + + /** + * If this Game Object has previously been enabled for input, this will disable it. + * + * An object that is disabled for input stops processing or being considered for + * input events, but can be turned back on again at any time by simply calling + * `setInteractive()` with no arguments provided. + * + * If want to completely remove interaction from this Game Object then use `removeInteractive` instead. + * + * @method Phaser.GameObjects.GameObject#disableInteractive + * @since 3.7.0 + * + * @return {this} This GameObject. + */ + disableInteractive: function () + { + if (this.input) + { + this.input.enabled = false; + } + + return this; + }, + + /** + * If this Game Object has previously been enabled for input, this will queue it + * for removal, causing it to no longer be interactive. The removal happens on + * the next game step, it is not immediate. + * + * The Interactive Object that was assigned to this Game Object will be destroyed, + * removed from the Input Manager and cleared from this Game Object. + * + * If you wish to re-enable this Game Object at a later date you will need to + * re-create its InteractiveObject by calling `setInteractive` again. + * + * If you wish to only temporarily stop an object from receiving input then use + * `disableInteractive` instead, as that toggles the interactive state, where-as + * this erases it completely. + * + * If you wish to resize a hit area, don't remove and then set it as being + * interactive. Instead, access the hitarea object directly and resize the shape + * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the + * shape is a Rectangle, which it is by default.) + * + * @method Phaser.GameObjects.GameObject#removeInteractive + * @since 3.7.0 + * + * @return {this} This GameObject. + */ + removeInteractive: function () + { + this.scene.sys.input.clear(this); + + this.input = undefined; + + return this; + }, + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * + * @method Phaser.GameObjects.GameObject#update + * @since 3.0.0 + * + * @param {...*} [args] - args + */ + update: function () + { + }, + + /** + * Returns a JSON representation of the Game Object. + * + * @method Phaser.GameObjects.GameObject#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + return ComponentsToJSON(this); + }, + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * + * @method Phaser.GameObjects.GameObject#willRender + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. + * + * @return {boolean} True if the Game Object should be rendered, otherwise false. + */ + willRender: function (camera) + { + return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + }, + + /** + * Returns an array containing the display list index of either this Game Object, or if it has one, + * its parent Container. It then iterates up through all of the parent containers until it hits the + * root of the display list (which is index 0 in the returned array). + * + * Used internally by the InputPlugin but also useful if you wish to find out the display depth of + * this Game Object and all of its ancestors. + * + * @method Phaser.GameObjects.GameObject#getIndexList + * @since 3.4.0 + * + * @return {integer[]} An array of display list position indexes. + */ + getIndexList: function () + { + // eslint-disable-next-line consistent-this + var child = this; + var parent = this.parentContainer; + + var indexes = []; + + while (parent) + { + // indexes.unshift([parent.getIndex(child), parent.name]); + indexes.unshift(parent.getIndex(child)); + + child = parent; + + if (!parent.parentContainer) + { + break; + } + else + { + parent = parent.parentContainer; + } + } + + // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']); + indexes.unshift(this.scene.sys.displayList.getIndex(child)); + + return indexes; + }, + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Also removes itself from the Input Manager and Physics Manager if previously enabled. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. + * + * @method Phaser.GameObjects.GameObject#destroy + * @fires Phaser.GameObjects.Events#DESTROY + * @since 3.0.0 + * + * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown? + */ + destroy: function (fromScene) + { + if (fromScene === undefined) { fromScene = false; } + + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (this.preDestroy) + { + this.preDestroy.call(this); + } + + this.emit(Events.DESTROY, this); + + var sys = this.scene.sys; + + if (!fromScene) + { + sys.displayList.remove(this); + sys.updateList.remove(this); + } + + if (this.input) + { + sys.input.clear(this); + this.input = undefined; + } + + if (this.data) + { + this.data.destroy(); + + this.data = undefined; + } + + if (this.body) + { + this.body.destroy(); + this.body = undefined; + } + + // Tell the Scene to re-sort the children + if (!fromScene) + { + sys.queueDepthSort(); + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + + this.parentContainer = undefined; + + this.removeAllListeners(); + } + +}); + +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {integer} RENDER_MASK + * @memberof Phaser.GameObjects.GameObject + * @default + */ +GameObject.RENDER_MASK = 15; + +module.exports = GameObject; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH = __webpack_require__(165); +var GetValue = __webpack_require__(6); + +/** + * Retrieves a value from an object. Allows for more advanced selection options, including: + * + * Allowed types: + * + * Implicit + * { + * x: 4 + * } + * + * From function + * { + * x: function () + * } + * + * Randomly pick one element from the array + * { + * x: [a, b, c, d, e, f] + * } + * + * Random integer between min and max: + * { + * x: { randInt: [min, max] } + * } + * + * Random float between min and max: + * { + * x: { randFloat: [min, max] } + * } + * + * + * @function Phaser.Utils.Objects.GetAdvancedValue + * @since 3.0.0 + * + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object. + * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object. + * + * @return {*} The value of the requested key. + */ +var GetAdvancedValue = function (source, key, defaultValue) +{ + var value = GetValue(source, key, null); + + if (value === null) + { + return defaultValue; + } + else if (Array.isArray(value)) + { + return MATH.RND.pick(value); + } + else if (typeof value === 'object') + { + if (value.hasOwnProperty('randInt')) + { + return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]); + } + else if (value.hasOwnProperty('randFloat')) + { + return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]); + } + } + else if (typeof value === 'function') + { + return value(key); + } + + return value; +}; + +module.exports = GetAdvancedValue; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); + +/** + * @classdesc + * The Game Object Creator is a Scene plugin that allows you to quickly create many common + * types of Game Objects and return them. Unlike the Game Object Factory, they are not automatically + * added to the Scene. + * + * Game Objects directly register themselves with the Creator and inject their own creation + * methods into the class. + * + * @class GameObjectCreator + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object Factory belongs. + */ +var GameObjectCreator = new Class({ + + initialize: + + function GameObjectCreator (scene) + { + /** + * The Scene to which this Game Object Creator belongs. + * + * @name Phaser.GameObjects.GameObjectCreator#scene + * @type {Phaser.Scene} + * @protected + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Scene.Systems. + * + * @name Phaser.GameObjects.GameObjectCreator#systems + * @type {Phaser.Scenes.Systems} + * @protected + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * A reference to the Scene Display List. + * + * @name Phaser.GameObjects.GameObjectCreator#displayList + * @type {Phaser.GameObjects.DisplayList} + * @protected + * @since 3.0.0 + */ + this.displayList; + + /** + * A reference to the Scene Update List. + * + * @name Phaser.GameObjects.GameObjectCreator#updateList; + * @type {Phaser.GameObjects.UpdateList} + * @protected + * @since 3.0.0 + */ + this.updateList; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.GameObjectCreator#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.displayList = this.systems.displayList; + this.updateList = this.systems.updateList; + + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.GameObjectCreator#start + * @private + * @since 3.5.0 + */ + start: function () + { + this.systems.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.GameObjects.GameObjectCreator#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + this.systems.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.GameObjects.GameObjectCreator#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + this.displayList = null; + this.updateList = null; + } + +}); + +// Static method called directly by the Game Object creator functions + +GameObjectCreator.register = function (factoryType, factoryFunction) +{ + if (!GameObjectCreator.prototype.hasOwnProperty(factoryType)) + { + GameObjectCreator.prototype[factoryType] = factoryFunction; + } +}; + +PluginCache.register('GameObjectCreator', GameObjectCreator, 'make'); + +module.exports = GameObjectCreator; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FILE_CONST = { + + /** + * The Loader is idle. + * + * @name Phaser.Loader.LOADER_IDLE + * @type {integer} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {integer} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {integer} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {integer} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started + * + * @name Phaser.Loader.FILE_PENDING + * @type {integer} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing + * + * @name Phaser.Loader.FILE_LOADED + * @type {integer} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load + * + * @name Phaser.Loader.FILE_FAILED + * @type {integer} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {integer} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {integer} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {integer} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {integer} + * @since 3.0.0 + */ + FILE_DESTROYED: 18, + + /** + * File was populated from local data and doesn't need an HTTP request + * + * @name Phaser.Loader.FILE_POPULATED + * @type {integer} + * @since 3.0.0 + */ + FILE_POPULATED: 19 + +}; + +module.exports = FILE_CONST; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsPlainObject = __webpack_require__(7); + +// @param {boolean} deep - Perform a deep copy? +// @param {object} target - The target object to copy to. +// @return {object} The extended object. + +/** + * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ + * + * @function Phaser.Utils.Objects.Extend + * @since 3.0.0 + * + * @return {object} The extended object. + */ +var Extend = function () +{ + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') + { + deep = target; + target = arguments[1] || {}; + + // skip the boolean and the target + i = 2; + } + + // extend Phaser if only one argument is passed + if (length === i) + { + target = this; + --i; + } + + for (; i < length; i++) + { + // Only deal with non-null/undefined values + if ((options = arguments[i]) != null) + { + // Extend the base object + for (name in options) + { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target === copy) + { + continue; + } + + // Recurse if we're merging plain objects or arrays + if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) + { + if (copyIsArray) + { + copyIsArray = false; + clone = src && Array.isArray(src) ? src : []; + } + else + { + clone = src && IsPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = Extend(deep, clone, copy); + + // Don't bring in undefined values + } + else if (copy !== undefined) + { + target[name] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +module.exports = Extend; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Contains the plugins that Phaser uses globally and locally. +// These are the source objects, not instantiated. +var corePlugins = {}; + +// Contains the plugins that the dev has loaded into their game +// These are the source objects, not instantiated. +var customPlugins = {}; + +var PluginCache = {}; + +/** + * @namespace Phaser.Plugins.PluginCache + */ + +/** + * Static method called directly by the Core internal Plugins. + * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) + * Plugin is the object to instantiate to create the plugin + * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) + * + * @method Phaser.Plugins.PluginCache.register + * @since 3.8.0 + * + * @param {string} key - A reference used to get this plugin from the plugin cache. + * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. + * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. + * @param {boolean} [custom=false] - Core Scene plugin or a Custom Scene plugin? + */ +PluginCache.register = function (key, plugin, mapping, custom) +{ + if (custom === undefined) { custom = false; } + + corePlugins[key] = { plugin: plugin, mapping: mapping, custom: custom }; +}; + +/** + * Stores a custom plugin in the global plugin cache. + * The key must be unique, within the scope of the cache. + * + * @method Phaser.Plugins.PluginCache.registerCustom + * @since 3.8.0 + * + * @param {string} key - A reference used to get this plugin from the plugin cache. + * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. + * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. + * @param {?any} data - A value to be passed to the plugin's `init` method. + */ +PluginCache.registerCustom = function (key, plugin, mapping, data) +{ + customPlugins[key] = { plugin: plugin, mapping: mapping, data: data }; +}; + +/** + * Checks if the given key is already being used in the core plugin cache. + * + * @method Phaser.Plugins.PluginCache.hasCore + * @since 3.8.0 + * + * @param {string} key - The key to check for. + * + * @return {boolean} `true` if the key is already in use in the core cache, otherwise `false`. + */ +PluginCache.hasCore = function (key) +{ + return corePlugins.hasOwnProperty(key); +}; + +/** + * Checks if the given key is already being used in the custom plugin cache. + * + * @method Phaser.Plugins.PluginCache.hasCustom + * @since 3.8.0 + * + * @param {string} key - The key to check for. + * + * @return {boolean} `true` if the key is already in use in the custom cache, otherwise `false`. + */ +PluginCache.hasCustom = function (key) +{ + return customPlugins.hasOwnProperty(key); +}; + +/** + * Returns the core plugin object from the cache based on the given key. + * + * @method Phaser.Plugins.PluginCache.getCore + * @since 3.8.0 + * + * @param {string} key - The key of the core plugin to get. + * + * @return {Phaser.Types.Plugins.CorePluginContainer} The core plugin object. + */ +PluginCache.getCore = function (key) +{ + return corePlugins[key]; +}; + +/** + * Returns the custom plugin object from the cache based on the given key. + * + * @method Phaser.Plugins.PluginCache.getCustom + * @since 3.8.0 + * + * @param {string} key - The key of the custom plugin to get. + * + * @return {Phaser.Types.Plugins.CustomPluginContainer} The custom plugin object. + */ +PluginCache.getCustom = function (key) +{ + return customPlugins[key]; +}; + +/** + * Returns an object from the custom cache based on the given key that can be instantiated. + * + * @method Phaser.Plugins.PluginCache.getCustomClass + * @since 3.8.0 + * + * @param {string} key - The key of the custom plugin to get. + * + * @return {function} The custom plugin object. + */ +PluginCache.getCustomClass = function (key) +{ + return (customPlugins.hasOwnProperty(key)) ? customPlugins[key].plugin : null; +}; + +/** + * Removes a core plugin based on the given key. + * + * @method Phaser.Plugins.PluginCache.remove + * @since 3.8.0 + * + * @param {string} key - The key of the core plugin to remove. + */ +PluginCache.remove = function (key) +{ + if (corePlugins.hasOwnProperty(key)) + { + delete corePlugins[key]; + } +}; + +/** + * Removes a custom plugin based on the given key. + * + * @method Phaser.Plugins.PluginCache.removeCustom + * @since 3.8.0 + * + * @param {string} key - The key of the custom plugin to remove. + */ +PluginCache.removeCustom = function (key) +{ + if (customPlugins.hasOwnProperty(key)) + { + delete customPlugins[key]; + } +}; + +/** + * Removes all Core Plugins. + * + * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. + * So be sure you only call this if you do not wish to run Phaser again. + * + * @method Phaser.Plugins.PluginCache.destroyCorePlugins + * @since 3.12.0 + */ +PluginCache.destroyCorePlugins = function () +{ + for (var key in corePlugins) + { + if (corePlugins.hasOwnProperty(key)) + { + delete corePlugins[key]; + } + } +}; + +/** + * Removes all Custom Plugins. + * + * @method Phaser.Plugins.PluginCache.destroyCustomPlugins + * @since 3.12.0 + */ +PluginCache.destroyCustomPlugins = function () +{ + for (var key in customPlugins) + { + if (customPlugins.hasOwnProperty(key)) + { + delete customPlugins[key]; + } + } +}; + +module.exports = PluginCache; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scenes.Events + */ + +module.exports = { + + BOOT: __webpack_require__(661), + CREATE: __webpack_require__(662), + DESTROY: __webpack_require__(663), + PAUSE: __webpack_require__(664), + POST_UPDATE: __webpack_require__(665), + PRE_UPDATE: __webpack_require__(666), + READY: __webpack_require__(667), + RENDER: __webpack_require__(668), + RESUME: __webpack_require__(669), + SHUTDOWN: __webpack_require__(670), + SLEEP: __webpack_require__(671), + START: __webpack_require__(672), + TRANSITION_COMPLETE: __webpack_require__(673), + TRANSITION_INIT: __webpack_require__(674), + TRANSITION_OUT: __webpack_require__(675), + TRANSITION_START: __webpack_require__(676), + TRANSITION_WAKE: __webpack_require__(677), + UPDATE: __webpack_require__(678), + WAKE: __webpack_require__(679) + +}; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var Events = __webpack_require__(80); +var GetFastValue = __webpack_require__(2); +var GetURL = __webpack_require__(204); +var MergeXHRSettings = __webpack_require__(205); +var XHRLoader = __webpack_require__(428); +var XHRSettings = __webpack_require__(133); + +/** + * @classdesc + * The base File class used by all File Types that the Loader can support. + * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods. + * + * @class File + * @memberof Phaser.Loader + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. + * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type. + */ +var File = new Class({ + + initialize: + + function File (loader, fileConfig) + { + /** + * A reference to the Loader that is going to load this file. + * + * @name Phaser.Loader.File#loader + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.0.0 + */ + this.loader = loader; + + /** + * A reference to the Cache, or Texture Manager, that is going to store this file if it loads. + * + * @name Phaser.Loader.File#cache + * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)} + * @since 3.7.0 + */ + this.cache = GetFastValue(fileConfig, 'cache', false); + + /** + * The file type string (image, json, etc) for sorting within the Loader. + * + * @name Phaser.Loader.File#type + * @type {string} + * @since 3.0.0 + */ + this.type = GetFastValue(fileConfig, 'type', false); + + /** + * Unique cache key (unique within its file type) + * + * @name Phaser.Loader.File#key + * @type {string} + * @since 3.0.0 + */ + this.key = GetFastValue(fileConfig, 'key', false); + + var loadKey = this.key; + + if (loader.prefix && loader.prefix !== '') + { + this.key = loader.prefix + loadKey; + } + + if (!this.type || !this.key) + { + throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + } + + /** + * The URL of the file, not including baseURL. + * Automatically has Loader.path prepended to it. + * + * @name Phaser.Loader.File#url + * @type {string} + * @since 3.0.0 + */ + this.url = GetFastValue(fileConfig, 'url'); + + if (this.url === undefined) + { + this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof(this.url) !== 'function') + { + this.url = loader.path + this.url; + } + + /** + * The final URL this file will load from, including baseURL and path. + * Set automatically when the Loader calls 'load' on this file. + * + * @name Phaser.Loader.File#src + * @type {string} + * @since 3.0.0 + */ + this.src = ''; + + /** + * The merged XHRSettings for this file. + * + * @name Phaser.Loader.File#xhrSettings + * @type {Phaser.Types.Loader.XHRSettingsObject} + * @since 3.0.0 + */ + this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined)); + + if (GetFastValue(fileConfig, 'xhrSettings', false)) + { + this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {})); + } + + /** + * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File. + * + * @name Phaser.Loader.File#xhrLoader + * @type {?XMLHttpRequest} + * @since 3.0.0 + */ + this.xhrLoader = null; + + /** + * The current state of the file. One of the FILE_CONST values. + * + * @name Phaser.Loader.File#state + * @type {integer} + * @since 3.0.0 + */ + this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; + + /** + * The total size of this file. + * Set by onProgress and only if loading via XHR. + * + * @name Phaser.Loader.File#bytesTotal + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.bytesTotal = 0; + + /** + * Updated as the file loads. + * Only set if loading via XHR. + * + * @name Phaser.Loader.File#bytesLoaded + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.bytesLoaded = -1; + + /** + * A percentage value between 0 and 1 indicating how much of this file has loaded. + * Only set if loading via XHR. + * + * @name Phaser.Loader.File#percentComplete + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.percentComplete = -1; + + /** + * For CORs based loading. + * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set) + * + * @name Phaser.Loader.File#crossOrigin + * @type {(string|undefined)} + * @since 3.0.0 + */ + this.crossOrigin = undefined; + + /** + * The processed file data, stored here after the file has loaded. + * + * @name Phaser.Loader.File#data + * @type {*} + * @since 3.0.0 + */ + this.data = undefined; + + /** + * A config object that can be used by file types to store transitional data. + * + * @name Phaser.Loader.File#config + * @type {*} + * @since 3.0.0 + */ + this.config = GetFastValue(fileConfig, 'config', {}); + + /** + * If this is a multipart file, i.e. an atlas and its json together, then this is a reference + * to the parent MultiFile. Set and used internally by the Loader or specific file types. + * + * @name Phaser.Loader.File#multiFile + * @type {?Phaser.Loader.MultiFile} + * @since 3.7.0 + */ + this.multiFile; + + /** + * Does this file have an associated linked file? Such as an image and a normal map. + * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't + * actually bound by data, where-as a linkFile is. + * + * @name Phaser.Loader.File#linkFile + * @type {?Phaser.Loader.File} + * @since 3.7.0 + */ + this.linkFile; + }, + + /** + * Links this File with another, so they depend upon each other for loading and processing. + * + * @method Phaser.Loader.File#setLink + * @since 3.7.0 + * + * @param {Phaser.Loader.File} fileB - The file to link to this one. + */ + setLink: function (fileB) + { + this.linkFile = fileB; + + fileB.linkFile = this; + }, + + /** + * Resets the XHRLoader instance this file is using. + * + * @method Phaser.Loader.File#resetXHR + * @since 3.0.0 + */ + resetXHR: function () + { + if (this.xhrLoader) + { + this.xhrLoader.onload = undefined; + this.xhrLoader.onerror = undefined; + this.xhrLoader.onprogress = undefined; + } + }, + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + * + * @method Phaser.Loader.File#load + * @since 3.0.0 + */ + load: function () + { + if (this.state === CONST.FILE_POPULATED) + { + // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL + this.loader.nextFile(this, true); + } + else + { + this.src = GetURL(this, this.loader.baseURL); + + if (this.src.indexOf('data:') === 0) + { + console.warn('Local data URIs are not supported: ' + this.key); + } + else + { + // The creation of this XHRLoader starts the load process going. + // It will automatically call the following, based on the load outcome: + // + // xhr.onload = this.onLoad + // xhr.onerror = this.onError + // xhr.onprogress = this.onProgress + + this.xhrLoader = XHRLoader(this, this.loader.xhr); + } + } + }, + + /** + * Called when the file finishes loading, is sent a DOM ProgressEvent. + * + * @method Phaser.Loader.File#onLoad + * @since 3.0.0 + * + * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. + * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load. + */ + onLoad: function (xhr, event) + { + var localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && event.target.status === 0)); + + var success = !(event.target && event.target.status !== 200) || localFileOk; + + // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called. + if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599) + { + success = false; + } + + this.resetXHR(); + + this.loader.nextFile(this, success); + }, + + /** + * Called if the file errors while loading, is sent a DOM ProgressEvent. + * + * @method Phaser.Loader.File#onError + * @since 3.0.0 + * + * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event. + * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error. + */ + onError: function () + { + this.resetXHR(); + + this.loader.nextFile(this, false); + }, + + /** + * Called during the file load progress. Is sent a DOM ProgressEvent. + * + * @method Phaser.Loader.File#onProgress + * @fires Phaser.Loader.Events#FILE_PROGRESS + * @since 3.0.0 + * + * @param {ProgressEvent} event - The DOM ProgressEvent. + */ + onProgress: function (event) + { + if (event.lengthComputable) + { + this.bytesLoaded = event.loaded; + this.bytesTotal = event.total; + + this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1); + + this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete); + } + }, + + /** + * Usually overridden by the FileTypes and is called by Loader.nextFile. + * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage. + * + * @method Phaser.Loader.File#onProcess + * @since 3.0.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.onProcessComplete(); + }, + + /** + * Called when the File has completed processing. + * Checks on the state of its multifile, if set. + * + * @method Phaser.Loader.File#onProcessComplete + * @since 3.7.0 + */ + onProcessComplete: function () + { + this.state = CONST.FILE_COMPLETE; + + if (this.multiFile) + { + this.multiFile.onFileComplete(this); + } + + this.loader.fileProcessComplete(this); + }, + + /** + * Called when the File has completed processing but it generated an error. + * Checks on the state of its multifile, if set. + * + * @method Phaser.Loader.File#onProcessError + * @since 3.7.0 + */ + onProcessError: function () + { + this.state = CONST.FILE_ERRORED; + + if (this.multiFile) + { + this.multiFile.onFileFailed(this); + } + + this.loader.fileProcessComplete(this); + }, + + /** + * Checks if a key matching the one used by this file exists in the target Cache or not. + * This is called automatically by the LoaderPlugin to decide if the file can be safely + * loaded or will conflict. + * + * @method Phaser.Loader.File#hasCacheConflict + * @since 3.7.0 + * + * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`. + */ + hasCacheConflict: function () + { + return (this.cache && this.cache.exists(this.key)); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * This method is often overridden by specific file types. + * + * @method Phaser.Loader.File#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.cache) + { + this.cache.add(this.key, this.data); + } + + this.pendingDestroy(); + }, + + /** + * Called once the file has been added to its cache and is now ready for deletion from the Loader. + * It will emit a `filecomplete` event from the LoaderPlugin. + * + * @method Phaser.Loader.File#pendingDestroy + * @fires Phaser.Loader.Events#FILE_COMPLETE + * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.7.0 + */ + pendingDestroy: function (data) + { + if (data === undefined) { data = this.data; } + + var key = this.key; + var type = this.type; + + this.loader.emit(Events.FILE_COMPLETE, key, type, data); + this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data); + + this.loader.flagForRemoval(this); + }, + + /** + * Destroy this File and any references it holds. + * + * @method Phaser.Loader.File#destroy + * @since 3.7.0 + */ + destroy: function () + { + this.loader = null; + this.cache = null; + this.xhrSettings = null; + this.multiFile = null; + this.linkFile = null; + this.data = null; + } + +}); + +/** + * Static method for creating object URL using URL API and setting it as image 'src' attribute. + * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader. + * + * @method Phaser.Loader.File.createObjectURL + * @static + * @since 3.7.0 + * + * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL. + * @param {Blob} blob - A Blob object to create an object URL for. + * @param {string} defaultType - Default mime type used if blob type is not available. + */ +File.createObjectURL = function (image, blob, defaultType) +{ + if (typeof URL === 'function') + { + image.src = URL.createObjectURL(blob); + } + else + { + var reader = new FileReader(); + + reader.onload = function () + { + image.removeAttribute('crossOrigin'); + image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1]; + }; + + reader.onerror = image.onerror; + + reader.readAsDataURL(blob); + } +}; + +/** + * Static method for releasing an existing object URL which was previously created + * by calling {@link File#createObjectURL} method. + * + * @method Phaser.Loader.File.revokeObjectURL + * @static + * @since 3.7.0 + * + * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked. + */ +File.revokeObjectURL = function (image) +{ + if (typeof URL === 'function') + { + URL.revokeObjectURL(image.src); + } +}; + +module.exports = File; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetFastValue = __webpack_require__(2); + +/** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * + * @function Phaser.Tilemaps.Components.GetTilesWithin + * @private + * @since 3.0.0 + * + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.GetTilesWithinFilteringOptions} GetTilesWithinFilteringOptions - Optional filters to apply when getting the tiles. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. + */ +var GetTilesWithin = function (tileX, tileY, width, height, filteringOptions, layer) +{ + if (tileX === undefined) { tileX = 0; } + if (tileY === undefined) { tileY = 0; } + if (width === undefined) { width = layer.width; } + if (height === undefined) { height = layer.height; } + + var isNotEmpty = GetFastValue(filteringOptions, 'isNotEmpty', false); + var isColliding = GetFastValue(filteringOptions, 'isColliding', false); + var hasInterestingFace = GetFastValue(filteringOptions, 'hasInterestingFace', false); + + // Clip x, y to top left of map, while shrinking width/height to match. + if (tileX < 0) + { + width += tileX; + tileX = 0; + } + if (tileY < 0) + { + height += tileY; + tileY = 0; + } + + // Clip width and height to bottom right of map. + if (tileX + width > layer.width) + { + width = Math.max(layer.width - tileX, 0); + } + if (tileY + height > layer.height) + { + height = Math.max(layer.height - tileY, 0); + } + + var results = []; + + for (var ty = tileY; ty < tileY + height; ty++) + { + for (var tx = tileX; tx < tileX + width; tx++) + { + var tile = layer.data[ty][tx]; + if (tile !== null) + { + if (isNotEmpty && tile.index === -1) { continue; } + if (isColliding && !tile.collides) { continue; } + if (hasInterestingFace && !tile.hasInterestingFace) { continue; } + results.push(tile); + } + } + } + + return results; +}; + +module.exports = GetTilesWithin; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Force a value within the boundaries by clamping it to the range `min`, `max`. + * + * @function Phaser.Math.Clamp + * @since 3.0.0 + * + * @param {number} value - The value to be clamped. + * @param {number} min - The minimum bounds. + * @param {number} max - The maximum bounds. + * + * @return {number} The clamped value. + */ +var Clamp = function (value, min, max) +{ + return Math.max(min, Math.min(max, value)); +}; + +module.exports = Clamp; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = { + + /** + * The value of PI * 2. + * + * @name Phaser.Math.PI2 + * @type {number} + * @since 3.0.0 + */ + PI2: Math.PI * 2, + + /** + * The value of PI * 0.5. + * + * @name Phaser.Math.TAU + * @type {number} + * @since 3.0.0 + */ + TAU: Math.PI * 0.5, + + /** + * An epsilon value (1.0e-6) + * + * @name Phaser.Math.EPSILON + * @type {number} + * @since 3.0.0 + */ + EPSILON: 1.0e-6, + + /** + * For converting degrees to radians (PI / 180) + * + * @name Phaser.Math.DEG_TO_RAD + * @type {number} + * @since 3.0.0 + */ + DEG_TO_RAD: Math.PI / 180, + + /** + * For converting radians to degrees (180 / PI) + * + * @name Phaser.Math.RAD_TO_DEG + * @type {number} + * @since 3.0.0 + */ + RAD_TO_DEG: 180 / Math.PI, + + /** + * An instance of the Random Number Generator. + * This is not set until the Game boots. + * + * @name Phaser.Math.RND + * @type {Phaser.Math.RandomDataGenerator} + * @since 3.0.0 + */ + RND: null + +}; + +module.exports = MATH_CONST; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(26); +var Smoothing = __webpack_require__(113); + +// The pool into which the canvas elements are placed. +var pool = []; + +// Automatically apply smoothing(false) to created Canvas elements +var _disableContextSmoothing = false; + +/** + * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * which is useless for some of the Phaser pipelines / renderer. + * + * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. + * Which means all instances of Phaser Games on the same page can share the one single pool. + * + * @namespace Phaser.Display.Canvas.CanvasPool + * @since 3.0.0 + */ +var CanvasPool = function () +{ + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {integer} [width=1] - The width of the Canvas. + * @param {integer} [height=1] - The height of the Canvas. + * @param {integer} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? + * + * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool + */ + var create = function (parent, width, height, canvasType, selfParent) + { + if (width === undefined) { width = 1; } + if (height === undefined) { height = 1; } + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + if (selfParent === undefined) { selfParent = false; } + + var canvas; + var container = first(canvasType); + + if (container === null) + { + container = { + parent: parent, + canvas: document.createElement('canvas'), + type: canvasType + }; + + if (canvasType === CONST.CANVAS) + { + pool.push(container); + } + + canvas = container.canvas; + } + else + { + container.parent = parent; + + canvas = container.canvas; + } + + if (selfParent) + { + container.parent = canvas; + } + + canvas.width = width; + canvas.height = height; + + if (_disableContextSmoothing && canvasType === CONST.CANVAS) + { + Smoothing.disable(canvas.getContext('2d')); + } + + return canvas; + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create2D + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {integer} [width=1] - The width of the Canvas. + * @param {integer} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created canvas. + */ + var create2D = function (parent, width, height) + { + return create(parent, width, height, CONST.CANVAS); + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.createWebGL + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {integer} [width=1] - The width of the Canvas. + * @param {integer} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created WebGL canvas. + */ + var createWebGL = function (parent, width, height) + { + return create(parent, width, height, CONST.WEBGL); + }; + + /** + * Gets the first free canvas index from the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.first + * @since 3.0.0 + * + * @param {integer} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * + * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. + */ + var first = function (canvasType) + { + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + + if (canvasType === CONST.WEBGL) + { + return null; + } + + for (var i = 0; i < pool.length; i++) + { + var container = pool[i]; + + if (!container.parent && container.type === canvasType) + { + return container; + } + } + + return null; + }; + + /** + * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. + * The canvas has its width and height set to 1, and its parent attribute nulled. + * + * @function Phaser.Display.Canvas.CanvasPool.remove + * @since 3.0.0 + * + * @param {*} parent - The canvas or the parent of the canvas to free. + */ + var remove = function (parent) + { + // Check to see if the parent is a canvas object + var isCanvas = parent instanceof HTMLCanvasElement; + + pool.forEach(function (container) + { + if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) + { + container.parent = null; + container.canvas.width = 1; + container.canvas.height = 1; + } + }); + }; + + /** + * Gets the total number of used canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.total + * @since 3.0.0 + * + * @return {integer} The number of used canvases. + */ + var total = function () + { + var c = 0; + + pool.forEach(function (container) + { + if (container.parent) + { + c++; + } + }); + + return c; + }; + + /** + * Gets the total number of free canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.free + * @since 3.0.0 + * + * @return {integer} The number of free canvases. + */ + var free = function () + { + return pool.length - total(); + }; + + /** + * Disable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing + * @since 3.0.0 + */ + var disableSmoothing = function () + { + _disableContextSmoothing = true; + }; + + /** + * Enable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing + * @since 3.0.0 + */ + var enableSmoothing = function () + { + _disableContextSmoothing = false; + }; + + return { + create2D: create2D, + create: create, + createWebGL: createWebGL, + disableSmoothing: disableSmoothing, + enableSmoothing: enableSmoothing, + first: first, + free: free, + pool: pool, + remove: remove, + total: total + }; +}; + +// If we export the called function here, it'll only be invoked once (not every time it's required). +module.exports = CanvasPool(); + + +/***/ }), +/* 25 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix + * and then performs the following steps: + * + * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. + * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. + * 3. Sets the blend mode of the context to be that used by the Game Object. + * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. + * 5. Saves the context state. + * 6. Sets the final matrix values into the context via setTransform. + * + * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. + * + * @function Phaser.Renderer.Canvas.SetTransform + * @since 3.12.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {CanvasRenderingContext2D} ctx - The canvas context to set the transform on. + * @param {Phaser.GameObjects.GameObject} src - The Game Object being rendered. Can be any type that extends the base class. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A parent transform matrix to apply to the Game Object before rendering. + * + * @return {boolean} `true` if the Game Object context was set, otherwise `false`. + */ +var SetTransform = function (renderer, ctx, src, camera, parentMatrix) +{ + var alpha = camera.alpha * src.alpha; + + if (alpha <= 0) + { + // Nothing to see, so don't waste time calculating stuff + return false; + } + + var camMatrix = renderer._tempMatrix1.copyFromArray(camera.matrix.matrix); + var gameObjectMatrix = renderer._tempMatrix2.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + var calcMatrix = renderer._tempMatrix3; + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + gameObjectMatrix.e = src.x; + gameObjectMatrix.f = src.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(gameObjectMatrix, calcMatrix); + } + else + { + gameObjectMatrix.e -= camera.scrollX * src.scrollFactorX; + gameObjectMatrix.f -= camera.scrollY * src.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(gameObjectMatrix, calcMatrix); + } + + // Blend Mode + ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; + + // Alpha + ctx.globalAlpha = alpha; + + ctx.save(); + + calcMatrix.setToContext(ctx); + + return true; +}; + +module.exports = SetTransform; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Global constants. + * + * @ignore + */ + +var CONST = { + + /** + * Phaser Release Version + * + * @name Phaser.VERSION + * @const + * @type {string} + * @since 3.0.0 + */ + VERSION: '3.18.1', + + BlendModes: __webpack_require__(52), + + ScaleModes: __webpack_require__(104), + + /** + * AUTO Detect Renderer. + * + * @name Phaser.AUTO + * @const + * @type {integer} + * @since 3.0.0 + */ + AUTO: 0, + + /** + * Canvas Renderer. + * + * @name Phaser.CANVAS + * @const + * @type {integer} + * @since 3.0.0 + */ + CANVAS: 1, + + /** + * WebGL Renderer. + * + * @name Phaser.WEBGL + * @const + * @type {integer} + * @since 3.0.0 + */ + WEBGL: 2, + + /** + * Headless Renderer. + * + * @name Phaser.HEADLESS + * @const + * @type {integer} + * @since 3.0.0 + */ + HEADLESS: 3, + + /** + * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead + * to help you remember what the value is doing in your code. + * + * @name Phaser.FOREVER + * @const + * @type {integer} + * @since 3.0.0 + */ + FOREVER: -1, + + /** + * Direction constant. + * + * @name Phaser.NONE + * @const + * @type {integer} + * @since 3.0.0 + */ + NONE: 4, + + /** + * Direction constant. + * + * @name Phaser.UP + * @const + * @type {integer} + * @since 3.0.0 + */ + UP: 5, + + /** + * Direction constant. + * + * @name Phaser.DOWN + * @const + * @type {integer} + * @since 3.0.0 + */ + DOWN: 6, + + /** + * Direction constant. + * + * @name Phaser.LEFT + * @const + * @type {integer} + * @since 3.0.0 + */ + LEFT: 7, + + /** + * Direction constant. + * + * @name Phaser.RIGHT + * @const + * @type {integer} + * @since 3.0.0 + */ + RIGHT: 8 + +}; + +module.exports = CONST; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` + * + * @function Phaser.Actions.PropertyValueSet + * @since 3.3.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {string} key - The property to be updated. + * @param {number} value - The amount to set the property to. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var PropertyValueSet = function (items, key, value, step, index, direction) +{ + if (step === undefined) { step = 0; } + if (index === undefined) { index = 0; } + if (direction === undefined) { direction = 1; } + + var i; + var t = 0; + var end = items.length; + + if (direction === 1) + { + // Start to End + for (i = index; i < end; i++) + { + items[i][key] = value + (t * step); + t++; + } + } + else + { + // End to Start + for (i = index; i >= 0; i--) + { + items[i][key] = value + (t * step); + t++; + } + } + + return items; +}; + +module.exports = PropertyValueSet; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Core.Events + */ + +module.exports = { + + BLUR: __webpack_require__(580), + BOOT: __webpack_require__(581), + DESTROY: __webpack_require__(582), + FOCUS: __webpack_require__(583), + HIDDEN: __webpack_require__(584), + PAUSE: __webpack_require__(585), + POST_RENDER: __webpack_require__(586), + POST_STEP: __webpack_require__(587), + PRE_RENDER: __webpack_require__(588), + PRE_STEP: __webpack_require__(589), + READY: __webpack_require__(590), + RESUME: __webpack_require__(591), + STEP: __webpack_require__(592), + VISIBLE: __webpack_require__(593) + +}; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(52); +var GetAdvancedValue = __webpack_require__(14); +var ScaleModes = __webpack_require__(104); + +/** + * Builds a Game Object using the provided configuration object. + * + * @function Phaser.GameObjects.BuildGameObject + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene. + * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. + * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. + * + * @return {Phaser.GameObjects.GameObject} The built Game Object. + */ +var BuildGameObject = function (scene, gameObject, config) +{ + // Position + + gameObject.x = GetAdvancedValue(config, 'x', 0); + gameObject.y = GetAdvancedValue(config, 'y', 0); + gameObject.depth = GetAdvancedValue(config, 'depth', 0); + + // Flip + + gameObject.flipX = GetAdvancedValue(config, 'flipX', false); + gameObject.flipY = GetAdvancedValue(config, 'flipY', false); + + // Scale + // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} + + var scale = GetAdvancedValue(config, 'scale', null); + + if (typeof scale === 'number') + { + gameObject.setScale(scale); + } + else if (scale !== null) + { + gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); + gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); + } + + // ScrollFactor + // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} + + var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); + + if (typeof scrollFactor === 'number') + { + gameObject.setScrollFactor(scrollFactor); + } + else if (scrollFactor !== null) + { + gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); + gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); + } + + // Rotation + + gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); + + var angle = GetAdvancedValue(config, 'angle', null); + + if (angle !== null) + { + gameObject.angle = angle; + } + + // Alpha + + gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); + + // Origin + // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} + + var origin = GetAdvancedValue(config, 'origin', null); + + if (typeof origin === 'number') + { + gameObject.setOrigin(origin); + } + else if (origin !== null) + { + var ox = GetAdvancedValue(origin, 'x', 0.5); + var oy = GetAdvancedValue(origin, 'y', 0.5); + + gameObject.setOrigin(ox, oy); + } + + // ScaleMode + + gameObject.scaleMode = GetAdvancedValue(config, 'scaleMode', ScaleModes.DEFAULT); + + // BlendMode + + gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); + + // Visible + + gameObject.visible = GetAdvancedValue(config, 'visible', true); + + // Add to Scene + + var add = GetAdvancedValue(config, 'add', true); + + if (add) + { + scene.sys.displayList.add(gameObject); + } + + if (gameObject.preUpdate) + { + scene.sys.updateList.add(gameObject); + } + + return gameObject; +}; + +module.exports = BuildGameObject; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var GameObject = __webpack_require__(13); +var Line = __webpack_require__(54); + +/** + * @classdesc + * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. + * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. + * + * @class Shape + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.ComputedSize + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {string} [type] - The internal type of the Shape. + * @param {any} [data] - The data of the source shape geometry, if any. + */ +var Shape = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.ComputedSize, + Components.Depth, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Transform, + Components.Visible + ], + + initialize: + + function Shape (scene, type, data) + { + if (type === undefined) { type = 'Shape'; } + + GameObject.call(this, scene, type); + + /** + * The source Shape data. Typically a geometry object. + * You should not manipulate this directly. + * + * @name Phaser.GameObjects.Shape#data + * @type {any} + * @readonly + * @since 3.13.0 + */ + this.geom = data; + + /** + * Holds the polygon path data for filled rendering. + * + * @name Phaser.GameObjects.Shape#pathData + * @type {number[]} + * @readonly + * @since 3.13.0 + */ + this.pathData = []; + + /** + * Holds the earcut polygon path index data for filled rendering. + * + * @name Phaser.GameObjects.Shape#pathIndexes + * @type {integer[]} + * @readonly + * @since 3.13.0 + */ + this.pathIndexes = []; + + /** + * The fill color used by this Shape. + * + * @name Phaser.GameObjects.Shape#fillColor + * @type {number} + * @since 3.13.0 + */ + this.fillColor = 0xffffff; + + /** + * The fill alpha value used by this Shape. + * + * @name Phaser.GameObjects.Shape#fillAlpha + * @type {number} + * @since 3.13.0 + */ + this.fillAlpha = 1; + + /** + * The stroke color used by this Shape. + * + * @name Phaser.GameObjects.Shape#strokeColor + * @type {number} + * @since 3.13.0 + */ + this.strokeColor = 0xffffff; + + /** + * The stroke alpha value used by this Shape. + * + * @name Phaser.GameObjects.Shape#strokeAlpha + * @type {number} + * @since 3.13.0 + */ + this.strokeAlpha = 1; + + /** + * The stroke line width used by this Shape. + * + * @name Phaser.GameObjects.Shape#lineWidth + * @type {number} + * @since 3.13.0 + */ + this.lineWidth = 1; + + /** + * Controls if this Shape is filled or not. + * Note that some Shapes do not support being filled (such as Line shapes) + * + * @name Phaser.GameObjects.Shape#isFilled + * @type {boolean} + * @since 3.13.0 + */ + this.isFilled = false; + + /** + * Controls if this Shape is stroked or not. + * Note that some Shapes do not support being stroked (such as Iso Box shapes) + * + * @name Phaser.GameObjects.Shape#isStroked + * @type {boolean} + * @since 3.13.0 + */ + this.isStroked = false; + + /** + * Controls if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * @name Phaser.GameObjects.Shape#closePath + * @type {boolean} + * @since 3.13.0 + */ + this.closePath = true; + + /** + * Private internal value. + * A Line used when parsing internal path data to avoid constant object re-creation. + * + * @name Phaser.GameObjects.Curve#_tempLine + * @type {Phaser.Geom.Line} + * @private + * @since 3.13.0 + */ + this._tempLine = new Line(); + + this.initPipeline(); + }, + + /** + * Sets the fill color and alpha for this Shape. + * + * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. + * + * Note that some Shapes do not support fill colors, such as the Line shape. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setFillStyle + * @since 3.13.0 + * + * @param {number} [color] - The color used to fill this shape. If not provided the Shape will not be filled. + * @param {number} [alpha=1] - The alpha value used when filling this shape, if a fill color is given. + * + * @return {this} This Game Object instance. + */ + setFillStyle: function (color, alpha) + { + if (alpha === undefined) { alpha = 1; } + + if (color === undefined) + { + this.isFilled = false; + } + else + { + this.fillColor = color; + this.fillAlpha = alpha; + this.isFilled = true; + } + + return this; + }, + + /** + * Sets the stroke color and alpha for this Shape. + * + * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. + * + * Note that some Shapes do not support being stroked, such as the Iso Box shape. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setStrokeStyle + * @since 3.13.0 + * + * @param {number} [lineWidth] - The width of line to stroke with. If not provided or undefined the Shape will not be stroked. + * @param {number} [color] - The color used to stroke this shape. If not provided the Shape will not be stroked. + * @param {number} [alpha=1] - The alpha value used when stroking this shape, if a stroke color is given. + * + * @return {this} This Game Object instance. + */ + setStrokeStyle: function (lineWidth, color, alpha) + { + if (alpha === undefined) { alpha = 1; } + + if (lineWidth === undefined) + { + this.isStroked = false; + } + else + { + this.lineWidth = lineWidth; + this.strokeColor = color; + this.strokeAlpha = alpha; + this.isStroked = true; + } + + return this; + }, + + /** + * Sets if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setClosePath + * @since 3.13.0 + * + * @param {boolean} value - Set to `true` if the Shape should be closed when stroked, otherwise `false`. + * + * @return {this} This Game Object instance. + */ + setClosePath: function (value) + { + this.closePath = value; + + return this; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.Shape#preDestroy + * @protected + * @since 3.13.0 + */ + preDestroy: function () + { + this.geom = null; + this._tempLine = null; + this.pathData = []; + this.pathIndexes = []; + } + +}); + +module.exports = Shape; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tilemaps.Formats + */ + +module.exports = { + + /** + * CSV Map Type + * + * @name Phaser.Tilemaps.Formats.CSV + * @type {number} + * @since 3.0.0 + */ + CSV: 0, + + /** + * Tiled JSON Map Type + * + * @name Phaser.Tilemaps.Formats.TILED_JSON + * @type {number} + * @since 3.0.0 + */ + TILED_JSON: 1, + + /** + * 2D Array Map Type + * + * @name Phaser.Tilemaps.Formats.ARRAY_2D + * @type {number} + * @since 3.0.0 + */ + ARRAY_2D: 2, + + /** + * Weltmeister (Impact.js) Map Type + * + * @name Phaser.Tilemaps.Formats.WELTMEISTER + * @type {number} + * @since 3.0.0 + */ + WELTMEISTER: 3 + +}; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Matrix used for display transformations for rendering. + * + * It is represented like so: + * + * ``` + * | a | c | tx | + * | b | d | ty | + * | 0 | 0 | 1 | + * ``` + * + * @class TransformMatrix + * @memberof Phaser.GameObjects.Components + * @constructor + * @since 3.0.0 + * + * @param {number} [a=1] - The Scale X value. + * @param {number} [b=0] - The Shear Y value. + * @param {number} [c=0] - The Shear X value. + * @param {number} [d=1] - The Scale Y value. + * @param {number} [tx=0] - The Translate X value. + * @param {number} [ty=0] - The Translate Y value. + */ +var TransformMatrix = new Class({ + + initialize: + + function TransformMatrix (a, b, c, d, tx, ty) + { + if (a === undefined) { a = 1; } + if (b === undefined) { b = 0; } + if (c === undefined) { c = 0; } + if (d === undefined) { d = 1; } + if (tx === undefined) { tx = 0; } + if (ty === undefined) { ty = 0; } + + /** + * The matrix values. + * + * @name Phaser.GameObjects.Components.TransformMatrix#matrix + * @type {Float32Array} + * @since 3.0.0 + */ + this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]); + + /** + * The decomposed matrix. + * + * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix + * @type {object} + * @since 3.0.0 + */ + this.decomposedMatrix = { + translateX: 0, + translateY: 0, + scaleX: 1, + scaleY: 1, + rotation: 0 + }; + }, + + /** + * The Scale X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#a + * @type {number} + * @since 3.4.0 + */ + a: { + + get: function () + { + return this.matrix[0]; + }, + + set: function (value) + { + this.matrix[0] = value; + } + + }, + + /** + * The Shear Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#b + * @type {number} + * @since 3.4.0 + */ + b: { + + get: function () + { + return this.matrix[1]; + }, + + set: function (value) + { + this.matrix[1] = value; + } + + }, + + /** + * The Shear X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#c + * @type {number} + * @since 3.4.0 + */ + c: { + + get: function () + { + return this.matrix[2]; + }, + + set: function (value) + { + this.matrix[2] = value; + } + + }, + + /** + * The Scale Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#d + * @type {number} + * @since 3.4.0 + */ + d: { + + get: function () + { + return this.matrix[3]; + }, + + set: function (value) + { + this.matrix[3] = value; + } + + }, + + /** + * The Translate X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#e + * @type {number} + * @since 3.11.0 + */ + e: { + + get: function () + { + return this.matrix[4]; + }, + + set: function (value) + { + this.matrix[4] = value; + } + + }, + + /** + * The Translate Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#f + * @type {number} + * @since 3.11.0 + */ + f: { + + get: function () + { + return this.matrix[5]; + }, + + set: function (value) + { + this.matrix[5] = value; + } + + }, + + /** + * The Translate X value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#tx + * @type {number} + * @since 3.4.0 + */ + tx: { + + get: function () + { + return this.matrix[4]; + }, + + set: function (value) + { + this.matrix[4] = value; + } + + }, + + /** + * The Translate Y value. + * + * @name Phaser.GameObjects.Components.TransformMatrix#ty + * @type {number} + * @since 3.4.0 + */ + ty: { + + get: function () + { + return this.matrix[5]; + }, + + set: function (value) + { + this.matrix[5] = value; + } + + }, + + /** + * The rotation of the Matrix. + * + * @name Phaser.GameObjects.Components.TransformMatrix#rotation + * @type {number} + * @readonly + * @since 3.4.0 + */ + rotation: { + + get: function () + { + return Math.acos(this.a / this.scaleX) * (Math.atan(-this.c / this.a) < 0 ? -1 : 1); + } + + }, + + /** + * The horizontal scale of the Matrix. + * + * @name Phaser.GameObjects.Components.TransformMatrix#scaleX + * @type {number} + * @readonly + * @since 3.4.0 + */ + scaleX: { + + get: function () + { + return Math.sqrt((this.a * this.a) + (this.c * this.c)); + } + + }, + + /** + * The vertical scale of the Matrix. + * + * @name Phaser.GameObjects.Components.TransformMatrix#scaleY + * @type {number} + * @readonly + * @since 3.4.0 + */ + scaleY: { + + get: function () + { + return Math.sqrt((this.b * this.b) + (this.d * this.d)); + } + + }, + + /** + * Reset the Matrix to an identity matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity + * @since 3.0.0 + * + * @return {this} This TransformMatrix. + */ + loadIdentity: function () + { + var matrix = this.matrix; + + matrix[0] = 1; + matrix[1] = 0; + matrix[2] = 0; + matrix[3] = 1; + matrix[4] = 0; + matrix[5] = 0; + + return this; + }, + + /** + * Translate the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#translate + * @since 3.0.0 + * + * @param {number} x - The horizontal translation value. + * @param {number} y - The vertical translation value. + * + * @return {this} This TransformMatrix. + */ + translate: function (x, y) + { + var matrix = this.matrix; + + matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4]; + matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5]; + + return this; + }, + + /** + * Scale the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#scale + * @since 3.0.0 + * + * @param {number} x - The horizontal scale value. + * @param {number} y - The vertical scale value. + * + * @return {this} This TransformMatrix. + */ + scale: function (x, y) + { + var matrix = this.matrix; + + matrix[0] *= x; + matrix[1] *= x; + matrix[2] *= y; + matrix[3] *= y; + + return this; + }, + + /** + * Rotate the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#rotate + * @since 3.0.0 + * + * @param {number} angle - The angle of rotation in radians. + * + * @return {this} This TransformMatrix. + */ + rotate: function (angle) + { + var sin = Math.sin(angle); + var cos = Math.cos(angle); + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + matrix[0] = a * cos + c * sin; + matrix[1] = b * cos + d * sin; + matrix[2] = a * -sin + c * cos; + matrix[3] = b * -sin + d * cos; + + return this; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * If an `out` Matrix is given then the results will be stored in it. + * If it is not given, this matrix will be updated in place instead. + * Use an `out` Matrix if you do not wish to mutate this matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#multiply + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by. + * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} Either this TransformMatrix, or the `out` Matrix, if given in the arguments. + */ + multiply: function (rhs, out) + { + var matrix = this.matrix; + var source = rhs.matrix; + + var localA = matrix[0]; + var localB = matrix[1]; + var localC = matrix[2]; + var localD = matrix[3]; + var localE = matrix[4]; + var localF = matrix[5]; + + var sourceA = source[0]; + var sourceB = source[1]; + var sourceC = source[2]; + var sourceD = source[3]; + var sourceE = source[4]; + var sourceF = source[5]; + + var destinationMatrix = (out === undefined) ? this : out; + + destinationMatrix.a = (sourceA * localA) + (sourceB * localC); + destinationMatrix.b = (sourceA * localB) + (sourceB * localD); + destinationMatrix.c = (sourceC * localA) + (sourceD * localC); + destinationMatrix.d = (sourceC * localB) + (sourceD * localD); + destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE; + destinationMatrix.f = (sourceE * localB) + (sourceF * localD) + localF; + + return destinationMatrix; + }, + + /** + * Multiply this Matrix by the matrix given, including the offset. + * + * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. + * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset + * @since 3.11.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. + * @param {number} offsetX - Horizontal offset to factor in to the multiplication. + * @param {number} offsetY - Vertical offset to factor in to the multiplication. + * + * @return {this} This TransformMatrix. + */ + multiplyWithOffset: function (src, offsetX, offsetY) + { + var matrix = this.matrix; + var otherMatrix = src.matrix; + + var a0 = matrix[0]; + var b0 = matrix[1]; + var c0 = matrix[2]; + var d0 = matrix[3]; + var tx0 = matrix[4]; + var ty0 = matrix[5]; + + var pse = offsetX * a0 + offsetY * c0 + tx0; + var psf = offsetX * b0 + offsetY * d0 + ty0; + + var a1 = otherMatrix[0]; + var b1 = otherMatrix[1]; + var c1 = otherMatrix[2]; + var d1 = otherMatrix[3]; + var tx1 = otherMatrix[4]; + var ty1 = otherMatrix[5]; + + matrix[0] = a1 * a0 + b1 * c0; + matrix[1] = a1 * b0 + b1 * d0; + matrix[2] = c1 * a0 + d1 * c0; + matrix[3] = c1 * b0 + d1 * d0; + matrix[4] = tx1 * a0 + ty1 * c0 + pse; + matrix[5] = tx1 * b0 + ty1 * d0 + psf; + + return this; + }, + + /** + * Transform the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#transform + * @since 3.0.0 + * + * @param {number} a - The Scale X value. + * @param {number} b - The Shear Y value. + * @param {number} c - The Shear X value. + * @param {number} d - The Scale Y value. + * @param {number} tx - The Translate X value. + * @param {number} ty - The Translate Y value. + * + * @return {this} This TransformMatrix. + */ + transform: function (a, b, c, d, tx, ty) + { + var matrix = this.matrix; + + var a0 = matrix[0]; + var b0 = matrix[1]; + var c0 = matrix[2]; + var d0 = matrix[3]; + var tx0 = matrix[4]; + var ty0 = matrix[5]; + + matrix[0] = a * a0 + b * c0; + matrix[1] = a * b0 + b * d0; + matrix[2] = c * a0 + d * c0; + matrix[3] = c * b0 + d * d0; + matrix[4] = tx * a0 + ty * c0 + tx0; + matrix[5] = tx * b0 + ty * d0 + ty0; + + return this; + }, + + /** + * Transform a point using this Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the point to transform. + * @param {number} y - The y coordinate of the point to transform. + * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates. + * + * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates. + */ + transformPoint: function (x, y, point) + { + if (point === undefined) { point = { x: 0, y: 0 }; } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + point.x = x * a + y * c + tx; + point.y = x * b + y * d + ty; + + return point; + }, + + /** + * Invert the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#invert + * @since 3.0.0 + * + * @return {this} This TransformMatrix. + */ + invert: function () + { + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + var n = a * d - b * c; + + matrix[0] = d / n; + matrix[1] = -b / n; + matrix[2] = -c / n; + matrix[3] = a / n; + matrix[4] = (c * ty - d * tx) / n; + matrix[5] = -(a * ty - b * tx) / n; + + return this; + }, + + /** + * Set the values of this Matrix to copy those of the matrix given. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom + * @since 3.11.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from. + * + * @return {this} This TransformMatrix. + */ + copyFrom: function (src) + { + var matrix = this.matrix; + + matrix[0] = src.a; + matrix[1] = src.b; + matrix[2] = src.c; + matrix[3] = src.d; + matrix[4] = src.e; + matrix[5] = src.f; + + return this; + }, + + /** + * Set the values of this Matrix to copy those of the array given. + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray + * @since 3.11.0 + * + * @param {array} src - The array of values to set into this matrix. + * + * @return {this} This TransformMatrix. + */ + copyFromArray: function (src) + { + var matrix = this.matrix; + + matrix[0] = src[0]; + matrix[1] = src[1]; + matrix[2] = src[2]; + matrix[3] = src[3]; + matrix[4] = src[4]; + matrix[5] = src[5]; + + return this; + }, + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.transform method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext + * @since 3.12.0 + * + * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context. + */ + copyToContext: function (ctx) + { + var matrix = this.matrix; + + ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + + return ctx; + }, + + /** + * Copy the values from this Matrix to the given Canvas Rendering Context. + * This will use the Context.setTransform method. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setToContext + * @since 3.12.0 + * + * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to. + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context. + */ + setToContext: function (ctx) + { + var matrix = this.matrix; + + ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + + return ctx; + }, + + /** + * Copy the values in this Matrix to the array given. + * + * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. + * + * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray + * @since 3.12.0 + * + * @param {array} [out] - The array to copy the matrix values in to. + * + * @return {array} An array where elements 0 to 5 contain the values from this matrix. + */ + copyToArray: function (out) + { + var matrix = this.matrix; + + if (out === undefined) + { + out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ]; + } + else + { + out[0] = matrix[0]; + out[1] = matrix[1]; + out[2] = matrix[2]; + out[3] = matrix[3]; + out[4] = matrix[4]; + out[5] = matrix[5]; + } + + return out; + }, + + /** + * Set the values of this Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#setTransform + * @since 3.0.0 + * + * @param {number} a - The Scale X value. + * @param {number} b - The Shear Y value. + * @param {number} c - The Shear X value. + * @param {number} d - The Scale Y value. + * @param {number} tx - The Translate X value. + * @param {number} ty - The Translate Y value. + * + * @return {this} This TransformMatrix. + */ + setTransform: function (a, b, c, d, tx, ty) + { + var matrix = this.matrix; + + matrix[0] = a; + matrix[1] = b; + matrix[2] = c; + matrix[3] = d; + matrix[4] = tx; + matrix[5] = ty; + + return this; + }, + + /** + * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. + * + * The result must be applied in the following order to reproduce the current matrix: + * + * translate -> rotate -> scale + * + * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix + * @since 3.0.0 + * + * @return {object} The decomposed Matrix. + */ + decomposeMatrix: function () + { + var decomposedMatrix = this.decomposedMatrix; + + var matrix = this.matrix; + + // a = scale X (1) + // b = shear Y (0) + // c = shear X (0) + // d = scale Y (1) + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + + var determ = a * d - b * c; + + decomposedMatrix.translateX = matrix[4]; + decomposedMatrix.translateY = matrix[5]; + + if (a || b) + { + var r = Math.sqrt(a * a + b * b); + + decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r); + decomposedMatrix.scaleX = r; + decomposedMatrix.scaleY = determ / r; + } + else if (c || d) + { + var s = Math.sqrt(c * c + d * d); + + decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s)); + decomposedMatrix.scaleX = determ / s; + decomposedMatrix.scaleY = s; + } + else + { + decomposedMatrix.rotation = 0; + decomposedMatrix.scaleX = 0; + decomposedMatrix.scaleY = 0; + } + + return decomposedMatrix; + }, + + /** + * Apply the identity, translate, rotate and scale operations on the Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS + * @since 3.0.0 + * + * @param {number} x - The horizontal translation. + * @param {number} y - The vertical translation. + * @param {number} rotation - The angle of rotation in radians. + * @param {number} scaleX - The horizontal scale. + * @param {number} scaleY - The vertical scale. + * + * @return {this} This TransformMatrix. + */ + applyITRS: function (x, y, rotation, scaleX, scaleY) + { + var matrix = this.matrix; + + var radianSin = Math.sin(rotation); + var radianCos = Math.cos(rotation); + + // Translate + matrix[4] = x; + matrix[5] = y; + + // Rotate and Scale + matrix[0] = radianCos * scaleX; + matrix[1] = radianSin * scaleX; + matrix[2] = -radianSin * scaleY; + matrix[3] = radianCos * scaleY; + + return this; + }, + + /** + * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of + * the current matrix with its transformation applied. + * + * Can be used to translate points from world to local space. + * + * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse + * @since 3.12.0 + * + * @param {number} x - The x position to translate. + * @param {number} y - The y position to translate. + * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in. + * + * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix. + */ + applyInverse: function (x, y, output) + { + if (output === undefined) { output = new Vector2(); } + + var matrix = this.matrix; + + var a = matrix[0]; + var b = matrix[1]; + var c = matrix[2]; + var d = matrix[3]; + var tx = matrix[4]; + var ty = matrix[5]; + + var id = 1 / ((a * d) + (c * -b)); + + output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id); + output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id); + + return output; + }, + + /** + * Returns the X component of this matrix multiplied by the given values. + * This is the same as `x * a + y * c + e`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getX + * @since 3.12.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * + * @return {number} The calculated x value. + */ + getX: function (x, y) + { + return x * this.a + y * this.c + this.e; + }, + + /** + * Returns the Y component of this matrix multiplied by the given values. + * This is the same as `x * b + y * d + f`. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getY + * @since 3.12.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * + * @return {number} The calculated y value. + */ + getY: function (x, y) + { + return x * this.b + y * this.d + this.f; + }, + + /** + * Returns a string that can be used in a CSS Transform call as a `matrix` property. + * + * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix + * @since 3.12.0 + * + * @return {string} A string containing the CSS Transform matrix values. + */ + getCSSMatrix: function () + { + var m = this.matrix; + + return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')'; + }, + + /** + * Destroys this Transform Matrix. + * + * @method Phaser.GameObjects.Components.TransformMatrix#destroy + * @since 3.4.0 + */ + destroy: function () + { + this.matrix = null; + this.decomposedMatrix = null; + } + +}); + +module.exports = TransformMatrix; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetColor = __webpack_require__(160); +var GetColor32 = __webpack_require__(270); +var HSVToRGB = __webpack_require__(161); +var RGBToHSV = __webpack_require__(271); + +/** + * @namespace Phaser.Display.Color + */ + +/** + * @classdesc + * The Color class holds a single color value and allows for easy modification and reading of it. + * + * @class Color + * @memberof Phaser.Display + * @constructor + * @since 3.0.0 + * + * @param {integer} [red=0] - The red color value. A number between 0 and 255. + * @param {integer} [green=0] - The green color value. A number between 0 and 255. + * @param {integer} [blue=0] - The blue color value. A number between 0 and 255. + * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + */ +var Color = new Class({ + + initialize: + + function Color (red, green, blue, alpha) + { + if (red === undefined) { red = 0; } + if (green === undefined) { green = 0; } + if (blue === undefined) { blue = 0; } + if (alpha === undefined) { alpha = 255; } + + /** + * The internal red color value. + * + * @name Phaser.Display.Color#r + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this.r = 0; + + /** + * The internal green color value. + * + * @name Phaser.Display.Color#g + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this.g = 0; + + /** + * The internal blue color value. + * + * @name Phaser.Display.Color#b + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this.b = 0; + + /** + * The internal alpha color value. + * + * @name Phaser.Display.Color#a + * @type {number} + * @private + * @default 255 + * @since 3.0.0 + */ + this.a = 255; + + /** + * The hue color value. A number between 0 and 1. + * This is the base color. + * + * @name Phaser.Display.Color#_h + * @type {number} + * @default 0 + * @private + * @since 3.13.0 + */ + this._h = 0; + + /** + * The saturation color value. A number between 0 and 1. + * This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. + * + * @name Phaser.Display.Color#_s + * @type {number} + * @default 0 + * @private + * @since 3.13.0 + */ + this._s = 0; + + /** + * The lightness color value. A number between 0 and 1. + * This controls how dark the color is. Where 1 is as bright as possible and 0 is black. + * + * @name Phaser.Display.Color#_v + * @type {number} + * @default 0 + * @private + * @since 3.13.0 + */ + this._v = 0; + + /** + * Is this color update locked? + * + * @name Phaser.Display.Color#_locked + * @type {boolean} + * @private + * @since 3.13.0 + */ + this._locked = false; + + /** + * An array containing the calculated color values for WebGL use. + * + * @name Phaser.Display.Color#gl + * @type {number[]} + * @since 3.0.0 + */ + this.gl = [ 0, 0, 0, 1 ]; + + /** + * Pre-calculated internal color value. + * + * @name Phaser.Display.Color#_color + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._color = 0; + + /** + * Pre-calculated internal color32 value. + * + * @name Phaser.Display.Color#_color32 + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._color32 = 0; + + /** + * Pre-calculated internal color rgb string value. + * + * @name Phaser.Display.Color#_rgba + * @type {string} + * @private + * @default '' + * @since 3.0.0 + */ + this._rgba = ''; + + this.setTo(red, green, blue, alpha); + }, + + /** + * Sets this color to be transparent. Sets all values to zero. + * + * @method Phaser.Display.Color#transparent + * @since 3.0.0 + * + * @return {Phaser.Display.Color} This Color object. + */ + transparent: function () + { + this._locked = true; + + this.red = 0; + this.green = 0; + this.blue = 0; + this.alpha = 0; + + this._locked = false; + + return this.update(true); + }, + + /** + * Sets the color of this Color component. + * + * @method Phaser.Display.Color#setTo + * @since 3.0.0 + * + * @param {integer} red - The red color value. A number between 0 and 255. + * @param {integer} green - The green color value. A number between 0 and 255. + * @param {integer} blue - The blue color value. A number between 0 and 255. + * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * @param {boolean} [updateHSV=true] - Update the HSV values after setting the RGB values? + * + * @return {Phaser.Display.Color} This Color object. + */ + setTo: function (red, green, blue, alpha, updateHSV) + { + if (alpha === undefined) { alpha = 255; } + if (updateHSV === undefined) { updateHSV = true; } + + this._locked = true; + + this.red = red; + this.green = green; + this.blue = blue; + this.alpha = alpha; + + this._locked = false; + + return this.update(updateHSV); + }, + + /** + * Sets the red, green, blue and alpha GL values of this Color component. + * + * @method Phaser.Display.Color#setGLTo + * @since 3.0.0 + * + * @param {number} red - The red color value. A number between 0 and 1. + * @param {number} green - The green color value. A number between 0 and 1. + * @param {number} blue - The blue color value. A number between 0 and 1. + * @param {number} [alpha=1] - The alpha value. A number between 0 and 1. + * + * @return {Phaser.Display.Color} This Color object. + */ + setGLTo: function (red, green, blue, alpha) + { + if (alpha === undefined) { alpha = 1; } + + this._locked = true; + + this.redGL = red; + this.greenGL = green; + this.blueGL = blue; + this.alphaGL = alpha; + + this._locked = false; + + return this.update(true); + }, + + /** + * Sets the color based on the color object given. + * + * @method Phaser.Display.Color#setFromRGB + * @since 3.0.0 + * + * @param {Phaser.Types.Display.InputColorObject} color - An object containing `r`, `g`, `b` and optionally `a` values in the range 0 to 255. + * + * @return {Phaser.Display.Color} This Color object. + */ + setFromRGB: function (color) + { + this._locked = true; + + this.red = color.r; + this.green = color.g; + this.blue = color.b; + + if (color.hasOwnProperty('a')) + { + this.alpha = color.a; + } + + this._locked = false; + + return this.update(true); + }, + + /** + * Sets the color based on the hue, saturation and lightness values given. + * + * @method Phaser.Display.Color#setFromHSV + * @since 3.13.0 + * + * @param {number} h - The hue, in the range 0 - 1. This is the base color. + * @param {number} s - The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. + * @param {number} v - The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black. + * + * @return {Phaser.Display.Color} This Color object. + */ + setFromHSV: function (h, s, v) + { + return HSVToRGB(h, s, v, this); + }, + + /** + * Updates the internal cache values. + * + * @method Phaser.Display.Color#update + * @private + * @since 3.0.0 + * + * @return {Phaser.Display.Color} This Color object. + */ + update: function (updateHSV) + { + if (updateHSV === undefined) { updateHSV = false; } + + if (this._locked) + { + return this; + } + + var r = this.r; + var g = this.g; + var b = this.b; + var a = this.a; + + this._color = GetColor(r, g, b); + this._color32 = GetColor32(r, g, b, a); + this._rgba = 'rgba(' + r + ',' + g + ',' + b + ',' + (a / 255) + ')'; + + if (updateHSV) + { + RGBToHSV(r, g, b, this); + } + + return this; + }, + + /** + * Updates the internal hsv cache values. + * + * @method Phaser.Display.Color#updateHSV + * @private + * @since 3.13.0 + * + * @return {Phaser.Display.Color} This Color object. + */ + updateHSV: function () + { + var r = this.r; + var g = this.g; + var b = this.b; + + RGBToHSV(r, g, b, this); + + return this; + }, + + /** + * Returns a new Color component using the values from this one. + * + * @method Phaser.Display.Color#clone + * @since 3.0.0 + * + * @return {Phaser.Display.Color} A new Color object. + */ + clone: function () + { + return new Color(this.r, this.g, this.b, this.a); + }, + + /** + * Sets this Color object to be grayscaled based on the shade value given. + * + * @method Phaser.Display.Color#gray + * @since 3.13.0 + * + * @param {integer} shade - A value between 0 and 255. + * + * @return {Phaser.Display.Color} This Color object. + */ + gray: function (shade) + { + return this.setTo(shade, shade, shade); + }, + + /** + * Sets this Color object to be a random color between the `min` and `max` values given. + * + * @method Phaser.Display.Color#random + * @since 3.13.0 + * + * @param {integer} [min=0] - The minimum random color value. Between 0 and 255. + * @param {integer} [max=255] - The maximum random color value. Between 0 and 255. + * + * @return {Phaser.Display.Color} This Color object. + */ + random: function (min, max) + { + if (min === undefined) { min = 0; } + if (max === undefined) { max = 255; } + + var r = Math.floor(min + Math.random() * (max - min)); + var g = Math.floor(min + Math.random() * (max - min)); + var b = Math.floor(min + Math.random() * (max - min)); + + return this.setTo(r, g, b); + }, + + /** + * Sets this Color object to be a random grayscale color between the `min` and `max` values given. + * + * @method Phaser.Display.Color#randomGray + * @since 3.13.0 + * + * @param {integer} [min=0] - The minimum random color value. Between 0 and 255. + * @param {integer} [max=255] - The maximum random color value. Between 0 and 255. + * + * @return {Phaser.Display.Color} This Color object. + */ + randomGray: function (min, max) + { + if (min === undefined) { min = 0; } + if (max === undefined) { max = 255; } + + var s = Math.floor(min + Math.random() * (max - min)); + + return this.setTo(s, s, s); + }, + + /** + * Increase the saturation of this Color by the percentage amount given. + * The saturation is the amount of the base color in the hue. + * + * @method Phaser.Display.Color#saturate + * @since 3.13.0 + * + * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * + * @return {Phaser.Display.Color} This Color object. + */ + saturate: function (amount) + { + this.s += amount / 100; + + return this; + }, + + /** + * Decrease the saturation of this Color by the percentage amount given. + * The saturation is the amount of the base color in the hue. + * + * @method Phaser.Display.Color#desaturate + * @since 3.13.0 + * + * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * + * @return {Phaser.Display.Color} This Color object. + */ + desaturate: function (amount) + { + this.s -= amount / 100; + + return this; + }, + + /** + * Increase the lightness of this Color by the percentage amount given. + * + * @method Phaser.Display.Color#lighten + * @since 3.13.0 + * + * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * + * @return {Phaser.Display.Color} This Color object. + */ + lighten: function (amount) + { + this.v += amount / 100; + + return this; + }, + + /** + * Decrease the lightness of this Color by the percentage amount given. + * + * @method Phaser.Display.Color#darken + * @since 3.13.0 + * + * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * + * @return {Phaser.Display.Color} This Color object. + */ + darken: function (amount) + { + this.v -= amount / 100; + + return this; + }, + + /** + * Brighten this Color by the percentage amount given. + * + * @method Phaser.Display.Color#brighten + * @since 3.13.0 + * + * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * + * @return {Phaser.Display.Color} This Color object. + */ + brighten: function (amount) + { + var r = this.r; + var g = this.g; + var b = this.b; + + r = Math.max(0, Math.min(255, r - Math.round(255 * - (amount / 100)))); + g = Math.max(0, Math.min(255, g - Math.round(255 * - (amount / 100)))); + b = Math.max(0, Math.min(255, b - Math.round(255 * - (amount / 100)))); + + return this.setTo(r, g, b); + }, + + /** + * The color of this Color component, not including the alpha channel. + * + * @name Phaser.Display.Color#color + * @type {number} + * @readonly + * @since 3.0.0 + */ + color: { + + get: function () + { + return this._color; + } + + }, + + /** + * The color of this Color component, including the alpha channel. + * + * @name Phaser.Display.Color#color32 + * @type {number} + * @readonly + * @since 3.0.0 + */ + color32: { + + get: function () + { + return this._color32; + } + + }, + + /** + * The color of this Color component as a string which can be used in CSS color values. + * + * @name Phaser.Display.Color#rgba + * @type {string} + * @readonly + * @since 3.0.0 + */ + rgba: { + + get: function () + { + return this._rgba; + } + + }, + + /** + * The red color value, normalized to the range 0 to 1. + * + * @name Phaser.Display.Color#redGL + * @type {number} + * @since 3.0.0 + */ + redGL: { + + get: function () + { + return this.gl[0]; + }, + + set: function (value) + { + this.gl[0] = Math.min(Math.abs(value), 1); + + this.r = Math.floor(this.gl[0] * 255); + + this.update(true); + } + + }, + + /** + * The green color value, normalized to the range 0 to 1. + * + * @name Phaser.Display.Color#greenGL + * @type {number} + * @since 3.0.0 + */ + greenGL: { + + get: function () + { + return this.gl[1]; + }, + + set: function (value) + { + this.gl[1] = Math.min(Math.abs(value), 1); + + this.g = Math.floor(this.gl[1] * 255); + + this.update(true); + } + + }, + + /** + * The blue color value, normalized to the range 0 to 1. + * + * @name Phaser.Display.Color#blueGL + * @type {number} + * @since 3.0.0 + */ + blueGL: { + + get: function () + { + return this.gl[2]; + }, + + set: function (value) + { + this.gl[2] = Math.min(Math.abs(value), 1); + + this.b = Math.floor(this.gl[2] * 255); + + this.update(true); + } + + }, + + /** + * The alpha color value, normalized to the range 0 to 1. + * + * @name Phaser.Display.Color#alphaGL + * @type {number} + * @since 3.0.0 + */ + alphaGL: { + + get: function () + { + return this.gl[3]; + }, + + set: function (value) + { + this.gl[3] = Math.min(Math.abs(value), 1); + + this.a = Math.floor(this.gl[3] * 255); + + this.update(); + } + + }, + + /** + * The red color value, normalized to the range 0 to 255. + * + * @name Phaser.Display.Color#red + * @type {number} + * @since 3.0.0 + */ + red: { + + get: function () + { + return this.r; + }, + + set: function (value) + { + value = Math.floor(Math.abs(value)); + + this.r = Math.min(value, 255); + + this.gl[0] = value / 255; + + this.update(true); + } + + }, + + /** + * The green color value, normalized to the range 0 to 255. + * + * @name Phaser.Display.Color#green + * @type {number} + * @since 3.0.0 + */ + green: { + + get: function () + { + return this.g; + }, + + set: function (value) + { + value = Math.floor(Math.abs(value)); + + this.g = Math.min(value, 255); + + this.gl[1] = value / 255; + + this.update(true); + } + + }, + + /** + * The blue color value, normalized to the range 0 to 255. + * + * @name Phaser.Display.Color#blue + * @type {number} + * @since 3.0.0 + */ + blue: { + + get: function () + { + return this.b; + }, + + set: function (value) + { + value = Math.floor(Math.abs(value)); + + this.b = Math.min(value, 255); + + this.gl[2] = value / 255; + + this.update(true); + } + + }, + + /** + * The alpha color value, normalized to the range 0 to 255. + * + * @name Phaser.Display.Color#alpha + * @type {number} + * @since 3.0.0 + */ + alpha: { + + get: function () + { + return this.a; + }, + + set: function (value) + { + value = Math.floor(Math.abs(value)); + + this.a = Math.min(value, 255); + + this.gl[3] = value / 255; + + this.update(); + } + + }, + + /** + * The hue color value. A number between 0 and 1. + * This is the base color. + * + * @name Phaser.Display.Color#h + * @type {number} + * @since 3.13.0 + */ + h: { + + get: function () + { + return this._h; + }, + + set: function (value) + { + this._h = value; + + HSVToRGB(value, this._s, this._v, this); + } + + }, + + /** + * The saturation color value. A number between 0 and 1. + * This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. + * + * @name Phaser.Display.Color#s + * @type {number} + * @since 3.13.0 + */ + s: { + + get: function () + { + return this._s; + }, + + set: function (value) + { + this._s = value; + + HSVToRGB(this._h, value, this._v, this); + } + + }, + + /** + * The lightness color value. A number between 0 and 1. + * This controls how dark the color is. Where 1 is as bright as possible and 0 is black. + * + * @name Phaser.Display.Color#v + * @type {number} + * @since 3.13.0 + */ + v: { + + get: function () + { + return this._v; + }, + + set: function (value) + { + this._v = value; + + HSVToRGB(this._h, this._s, value, this); + } + + } + +}); + +module.exports = Color; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, + * and then adds the given value to it. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `PropertyValueInc(group.getChildren(), key, value, step)` + * + * @function Phaser.Actions.PropertyValueInc + * @since 3.3.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {string} key - The property to be updated. + * @param {number} value - The amount to be added to the property. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var PropertyValueInc = function (items, key, value, step, index, direction) +{ + if (step === undefined) { step = 0; } + if (index === undefined) { index = 0; } + if (direction === undefined) { direction = 1; } + + var i; + var t = 0; + var end = items.length; + + if (direction === 1) + { + // Start to End + for (i = index; i < end; i++) + { + items[i][key] += value + (t * step); + t++; + } + } + else + { + // End to Start + for (i = index; i >= 0; i--) + { + items[i][key] += value + (t * step); + t++; + } + } + + return items; +}; + +module.exports = PropertyValueInc; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(23); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {integer} degrees - The angle (in degrees) to convert to radians. + * + * @return {number} The given angle converted to radians. + */ +var DegToRad = function (degrees) +{ + return degrees * CONST.DEG_TO_RAD; +}; + +module.exports = DegToRad; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sets the fillStyle on the target context based on the given Shape. + * + * @method Phaser.GameObjects.Shape#FillStyleCanvas + * @since 3.13.0 + * @private + * + * @param {CanvasRenderingContext2D} ctx - The context to set the fill style on. + * @param {Phaser.GameObjects.Shape} src - The Game Object to set the fill style from. + * @param {number} [altColor] - An alternative color to render with. + * @param {number} [altAlpha] - An alternative alpha to render with. + */ +var FillStyleCanvas = function (ctx, src, altColor, altAlpha) +{ + var fillColor = (altColor) ? altColor : src.fillColor; + var fillAlpha = (altAlpha) ? altAlpha : src.fillAlpha; + + var red = ((fillColor & 0xFF0000) >>> 16); + var green = ((fillColor & 0xFF00) >>> 8); + var blue = (fillColor & 0xFF); + + ctx.fillStyle = 'rgba(' + red + ',' + green + ',' + blue + ',' + fillAlpha + ')'; +}; + +module.exports = FillStyleCanvas; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {/** +* The `Matter.Common` module contains utility functions that are common to all modules. +* +* @class Common +*/ + +var Common = {}; + +module.exports = Common; + +(function() { + + Common._nextId = 0; + Common._seed = 0; + Common._nowStartTime = +(new Date()); + + /** + * Extends the object in the first argument using the object in the second argument. + * @method extend + * @param {} obj + * @param {boolean} deep + * @return {} obj extended + */ + Common.extend = function(obj, deep) { + var argsStart, + args, + deepClone; + + if (typeof deep === 'boolean') { + argsStart = 2; + deepClone = deep; + } else { + argsStart = 1; + deepClone = true; + } + + for (var i = argsStart; i < arguments.length; i++) { + var source = arguments[i]; + + if (source) { + for (var prop in source) { + if (deepClone && source[prop] && source[prop].constructor === Object) { + if (!obj[prop] || obj[prop].constructor === Object) { + obj[prop] = obj[prop] || {}; + Common.extend(obj[prop], deepClone, source[prop]); + } else { + obj[prop] = source[prop]; + } + } else { + obj[prop] = source[prop]; + } + } + } + } + + return obj; + }; + + /** + * Creates a new clone of the object, if deep is true references will also be cloned. + * @method clone + * @param {} obj + * @param {bool} deep + * @return {} obj cloned + */ + Common.clone = function(obj, deep) { + return Common.extend({}, deep, obj); + }; + + /** + * Returns the list of keys for the given object. + * @method keys + * @param {} obj + * @return {string[]} keys + */ + Common.keys = function(obj) { + if (Object.keys) + return Object.keys(obj); + + // avoid hasOwnProperty for performance + var keys = []; + for (var key in obj) + keys.push(key); + return keys; + }; + + /** + * Returns the list of values for the given object. + * @method values + * @param {} obj + * @return {array} Array of the objects property values + */ + Common.values = function(obj) { + var values = []; + + if (Object.keys) { + var keys = Object.keys(obj); + for (var i = 0; i < keys.length; i++) { + values.push(obj[keys[i]]); + } + return values; + } + + // avoid hasOwnProperty for performance + for (var key in obj) + values.push(obj[key]); + return values; + }; + + /** + * Gets a value from `base` relative to the `path` string. + * @method get + * @param {} obj The base object + * @param {string} path The path relative to `base`, e.g. 'Foo.Bar.baz' + * @param {number} [begin] Path slice begin + * @param {number} [end] Path slice end + * @return {} The object at the given path + */ + Common.get = function(obj, path, begin, end) { + path = path.split('.').slice(begin, end); + + for (var i = 0; i < path.length; i += 1) { + obj = obj[path[i]]; + } + + return obj; + }; + + /** + * Sets a value on `base` relative to the given `path` string. + * @method set + * @param {} obj The base object + * @param {string} path The path relative to `base`, e.g. 'Foo.Bar.baz' + * @param {} val The value to set + * @param {number} [begin] Path slice begin + * @param {number} [end] Path slice end + * @return {} Pass through `val` for chaining + */ + Common.set = function(obj, path, val, begin, end) { + var parts = path.split('.').slice(begin, end); + Common.get(obj, path, 0, -1)[parts[parts.length - 1]] = val; + return val; + }; + + /** + * Shuffles the given array in-place. + * The function uses a seeded random generator. + * @method shuffle + * @param {array} array + * @return {array} array shuffled randomly + */ + Common.shuffle = function(array) { + for (var i = array.length - 1; i > 0; i--) { + var j = Math.floor(Common.random() * (i + 1)); + var temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } + return array; + }; + + /** + * Randomly chooses a value from a list with equal probability. + * The function uses a seeded random generator. + * @method choose + * @param {array} choices + * @return {object} A random choice object from the array + */ + Common.choose = function(choices) { + return choices[Math.floor(Common.random() * choices.length)]; + }; + + /** + * Returns true if the object is a HTMLElement, otherwise false. + * @method isElement + * @param {object} obj + * @return {boolean} True if the object is a HTMLElement, otherwise false + */ + Common.isElement = function(obj) { + if (typeof HTMLElement !== 'undefined') { + return obj instanceof HTMLElement; + } + + return !!(obj && obj.nodeType && obj.nodeName); + }; + + /** + * Returns true if the object is an array. + * @method isArray + * @param {object} obj + * @return {boolean} True if the object is an array, otherwise false + */ + Common.isArray = function(obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; + }; + + /** + * Returns true if the object is a function. + * @method isFunction + * @param {object} obj + * @return {boolean} True if the object is a function, otherwise false + */ + Common.isFunction = function(obj) { + return typeof obj === "function"; + }; + + /** + * Returns true if the object is a plain object. + * @method isPlainObject + * @param {object} obj + * @return {boolean} True if the object is a plain object, otherwise false + */ + Common.isPlainObject = function(obj) { + return typeof obj === 'object' && obj.constructor === Object; + }; + + /** + * Returns true if the object is a string. + * @method isString + * @param {object} obj + * @return {boolean} True if the object is a string, otherwise false + */ + Common.isString = function(obj) { + return toString.call(obj) === '[object String]'; + }; + + /** + * Returns the given value clamped between a minimum and maximum value. + * @method clamp + * @param {number} value + * @param {number} min + * @param {number} max + * @return {number} The value clamped between min and max inclusive + */ + Common.clamp = function(value, min, max) { + if (value < min) + return min; + if (value > max) + return max; + return value; + }; + + /** + * Returns the sign of the given value. + * @method sign + * @param {number} value + * @return {number} -1 if negative, +1 if 0 or positive + */ + Common.sign = function(value) { + return value < 0 ? -1 : 1; + }; + + /** + * Returns the current timestamp since the time origin (e.g. from page load). + * The result will be high-resolution including decimal places if available. + * @method now + * @return {number} the current timestamp + */ + Common.now = function() { + if (window.performance) { + if (window.performance.now) { + return window.performance.now(); + } else if (window.performance.webkitNow) { + return window.performance.webkitNow(); + } + } + + return (new Date()) - Common._nowStartTime; + }; + + /** + * Returns a random value between a minimum and a maximum value inclusive. + * The function uses a seeded random generator. + * @method random + * @param {number} min + * @param {number} max + * @return {number} A random number between min and max inclusive + */ + Common.random = function(min, max) { + min = (typeof min !== "undefined") ? min : 0; + max = (typeof max !== "undefined") ? max : 1; + return min + _seededRandom() * (max - min); + }; + + var _seededRandom = function() { + // https://en.wikipedia.org/wiki/Linear_congruential_generator + Common._seed = (Common._seed * 9301 + 49297) % 233280; + return Common._seed / 233280; + }; + + /** + * Converts a CSS hex colour string into an integer. + * @method colorToNumber + * @param {string} colorString + * @return {number} An integer representing the CSS hex string + */ + Common.colorToNumber = function(colorString) { + colorString = colorString.replace('#',''); + + if (colorString.length == 3) { + colorString = colorString.charAt(0) + colorString.charAt(0) + + colorString.charAt(1) + colorString.charAt(1) + + colorString.charAt(2) + colorString.charAt(2); + } + + return parseInt(colorString, 16); + }; + + /** + * The console logging level to use, where each level includes all levels above and excludes the levels below. + * The default level is 'debug' which shows all console messages. + * + * Possible level values are: + * - 0 = None + * - 1 = Debug + * - 2 = Info + * - 3 = Warn + * - 4 = Error + * @property Common.logLevel + * @type {Number} + * @default 1 + */ + Common.logLevel = 1; + + /** + * Shows a `console.log` message only if the current `Common.logLevel` allows it. + * The message will be prefixed with 'matter-js' to make it easily identifiable. + * @method log + * @param ...objs {} The objects to log. + */ + Common.log = function() { + if (console && Common.logLevel > 0 && Common.logLevel <= 3) { + console.log.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments))); + } + }; + + /** + * Shows a `console.info` message only if the current `Common.logLevel` allows it. + * The message will be prefixed with 'matter-js' to make it easily identifiable. + * @method info + * @param ...objs {} The objects to log. + */ + Common.info = function() { + if (console && Common.logLevel > 0 && Common.logLevel <= 2) { + console.info.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments))); + } + }; + + /** + * Shows a `console.warn` message only if the current `Common.logLevel` allows it. + * The message will be prefixed with 'matter-js' to make it easily identifiable. + * @method warn + * @param ...objs {} The objects to log. + */ + Common.warn = function() { + if (console && Common.logLevel > 0 && Common.logLevel <= 3) { + console.warn.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments))); + } + }; + + /** + * Returns the next unique sequential ID. + * @method nextId + * @return {Number} Unique sequential ID + */ + Common.nextId = function() { + return Common._nextId++; + }; + + /** + * A cross browser compatible indexOf implementation. + * @method indexOf + * @param {array} haystack + * @param {object} needle + * @return {number} The position of needle in haystack, otherwise -1. + */ + Common.indexOf = function(haystack, needle) { + if (haystack.indexOf) + return haystack.indexOf(needle); + + for (var i = 0; i < haystack.length; i++) { + if (haystack[i] === needle) + return i; + } + + return -1; + }; + + /** + * A cross browser compatible array map implementation. + * @method map + * @param {array} list + * @param {function} func + * @return {array} Values from list transformed by func. + */ + Common.map = function(list, func) { + if (list.map) { + return list.map(func); + } + + var mapped = []; + + for (var i = 0; i < list.length; i += 1) { + mapped.push(func(list[i])); + } + + return mapped; + }; + + /** + * Takes a directed graph and returns the partially ordered set of vertices in topological order. + * Circular dependencies are allowed. + * @method topologicalSort + * @param {object} graph + * @return {array} Partially ordered set of vertices in topological order. + */ + Common.topologicalSort = function(graph) { + // https://github.com/mgechev/javascript-algorithms + // Copyright (c) Minko Gechev (MIT license) + // Modifications: tidy formatting and naming + var result = [], + visited = [], + temp = []; + + for (var node in graph) { + if (!visited[node] && !temp[node]) { + Common._topologicalSort(node, visited, temp, graph, result); + } + } + + return result; + }; + + Common._topologicalSort = function(node, visited, temp, graph, result) { + var neighbors = graph[node] || []; + temp[node] = true; + + for (var i = 0; i < neighbors.length; i += 1) { + var neighbor = neighbors[i]; + + if (temp[neighbor]) { + // skip circular dependencies + continue; + } + + if (!visited[neighbor]) { + Common._topologicalSort(neighbor, visited, temp, graph, result); + } + } + + temp[node] = false; + visited[node] = true; + + result.push(node); + }; + + /** + * Takes _n_ functions as arguments and returns a new function that calls them in order. + * The arguments applied when calling the new function will also be applied to every function passed. + * The value of `this` refers to the last value returned in the chain that was not `undefined`. + * Therefore if a passed function does not return a value, the previously returned value is maintained. + * After all passed functions have been called the new function returns the last returned value (if any). + * If any of the passed functions are a chain, then the chain will be flattened. + * @method chain + * @param ...funcs {function} The functions to chain. + * @return {function} A new function that calls the passed functions in order. + */ + Common.chain = function() { + var funcs = []; + + for (var i = 0; i < arguments.length; i += 1) { + var func = arguments[i]; + + if (func._chained) { + // flatten already chained functions + funcs.push.apply(funcs, func._chained); + } else { + funcs.push(func); + } + } + + var chain = function() { + // https://github.com/GoogleChrome/devtools-docs/issues/53#issuecomment-51941358 + var lastResult, + args = new Array(arguments.length); + + for (var i = 0, l = arguments.length; i < l; i++) { + args[i] = arguments[i]; + } + + for (i = 0; i < funcs.length; i += 1) { + var result = funcs[i].apply(lastResult, args); + + if (typeof result !== 'undefined') { + lastResult = result; + } + } + + return lastResult; + }; + + chain._chained = funcs; + + return chain; + }; + + /** + * Chains a function to excute before the original function on the given `path` relative to `base`. + * See also docs for `Common.chain`. + * @method chainPathBefore + * @param {} base The base object + * @param {string} path The path relative to `base` + * @param {function} func The function to chain before the original + * @return {function} The chained function that replaced the original + */ + Common.chainPathBefore = function(base, path, func) { + return Common.set(base, path, Common.chain( + func, + Common.get(base, path) + )); + }; + + /** + * Chains a function to excute after the original function on the given `path` relative to `base`. + * See also docs for `Common.chain`. + * @method chainPathAfter + * @param {} base The base object + * @param {string} path The path relative to `base` + * @param {function} func The function to chain after the original + * @return {function} The chained function that replaced the original + */ + Common.chainPathAfter = function(base, path, func) { + return Common.set(base, path, Common.chain( + Common.get(base, path), + func + )); + }; + + /** + * Used to require external libraries outside of the bundle. + * It first looks for the `globalName` on the environment's global namespace. + * If the global is not found, it will fall back to using the standard `require` using the `moduleName`. + * @private + * @method _requireGlobal + * @param {string} globalName The global module name + * @param {string} moduleName The fallback CommonJS module name + * @return {} The loaded module + */ + Common._requireGlobal = function(globalName, moduleName) { + var obj = (typeof window !== 'undefined' ? window[globalName] : typeof global !== 'undefined' ? global[globalName] : null); + + // Breaks webpack :( + // return obj || require(moduleName); + + return obj; + }; +})(); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(222))) + +/***/ }), +/* 38 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the bottom coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetBottom + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The bottom coordinate of the bounds of the Game Object. + */ +var GetBottom = function (gameObject) +{ + return (gameObject.y + gameObject.height) - (gameObject.height * gameObject.originY); +}; + +module.exports = GetBottom; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Positions the Game Object so that the bottom of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetBottom + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetBottom = function (gameObject, value) +{ + gameObject.y = (value - gameObject.height) + (gameObject.height * gameObject.originY); + + return gameObject; +}; + +module.exports = SetBottom; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the left coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetLeft + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The left coordinate of the bounds of the Game Object. + */ +var GetLeft = function (gameObject) +{ + return gameObject.x - (gameObject.width * gameObject.originX); +}; + +module.exports = GetLeft; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetLeft + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetLeft = function (gameObject, value) +{ + gameObject.x = value + (gameObject.width * gameObject.originX); + + return gameObject; +}; + +module.exports = SetLeft; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the right coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetRight + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The right coordinate of the bounds of the Game Object. + */ +var GetRight = function (gameObject) +{ + return (gameObject.x + gameObject.width) - (gameObject.width * gameObject.originX); +}; + +module.exports = GetRight; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Positions the Game Object so that the left of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetRight + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetRight = function (gameObject, value) +{ + gameObject.x = (value - gameObject.width) + (gameObject.width * gameObject.originX); + + return gameObject; +}; + +module.exports = SetRight; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the top coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetTop + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The top coordinate of the bounds of the Game Object. + */ +var GetTop = function (gameObject) +{ + return gameObject.y - (gameObject.height * gameObject.originY); +}; + +module.exports = GetTop; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Positions the Game Object so that the top of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetTop + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} value - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetTop = function (gameObject, value) +{ + gameObject.y = value + (gameObject.height * gameObject.originY); + + return gameObject; +}; + +module.exports = SetTop; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check to see if the Circle contains the given x / y coordinates. + * + * @function Phaser.Geom.Circle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The Circle to check. + * @param {number} x - The x coordinate to check within the circle. + * @param {number} y - The y coordinate to check within the circle. + * + * @return {boolean} True if the coordinates are within the circle, otherwise false. + */ +var Contains = function (circle, x, y) +{ + // Check if x/y are within the bounds first + if (circle.radius > 0 && x >= circle.left && x <= circle.right && y >= circle.top && y <= circle.bottom) + { + var dx = (circle.x - x) * (circle.x - x); + var dy = (circle.y - y) * (circle.y - y); + + return (dx + dy) <= (circle.radius * circle.radius); + } + else + { + return false; + } +}; + +module.exports = Contains; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if a given point is inside a Rectangle's bounds. + * + * @function Phaser.Geom.Rectangle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ +var Contains = function (rect, x, y) +{ + if (rect.width <= 0 || rect.height <= 0) + { + return false; + } + + return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y); +}; + +module.exports = Contains; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Cameras.Scene2D.Events + */ + +module.exports = { + + DESTROY: __webpack_require__(602), + FADE_IN_COMPLETE: __webpack_require__(603), + FADE_IN_START: __webpack_require__(604), + FADE_OUT_COMPLETE: __webpack_require__(605), + FADE_OUT_START: __webpack_require__(606), + FLASH_COMPLETE: __webpack_require__(607), + FLASH_START: __webpack_require__(608), + PAN_COMPLETE: __webpack_require__(609), + PAN_START: __webpack_require__(610), + POST_RENDER: __webpack_require__(611), + PRE_RENDER: __webpack_require__(612), + SHAKE_COMPLETE: __webpack_require__(613), + SHAKE_START: __webpack_require__(614), + ZOOM_COMPLETE: __webpack_require__(615), + ZOOM_START: __webpack_require__(616) + +}; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sets the strokeStyle and lineWidth on the target context based on the given Shape. + * + * @method Phaser.GameObjects.Shape#LineStyleCanvas + * @since 3.13.0 + * @private + * + * @param {CanvasRenderingContext2D} ctx - The context to set the stroke style on. + * @param {Phaser.GameObjects.Shape} src - The Game Object to set the stroke style from. + * @param {number} [altColor] - An alternative color to render with. + * @param {number} [altAlpha] - An alternative alpha to render with. + */ +var LineStyleCanvas = function (ctx, src, altColor, altAlpha) +{ + var strokeColor = (altColor) ? altColor : src.strokeColor; + var strokeAlpha = (altAlpha) ? altAlpha : src.strokeAlpha; + + var red = ((strokeColor & 0xFF0000) >>> 16); + var green = ((strokeColor & 0xFF00) >>> 8); + var blue = (strokeColor & 0xFF); + + ctx.strokeStyle = 'rgba(' + red + ',' + green + ',' + blue + ',' + strokeAlpha + ')'; + ctx.lineWidth = src.lineWidth; +}; + +module.exports = LineStyleCanvas; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Arcade Physics consts. + * + * @ignore + */ + +var CONST = { + + /** + * Dynamic Body. + * + * @name Phaser.Physics.Arcade.DYNAMIC_BODY + * @readonly + * @type {number} + * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#physicsType + * @see Phaser.Physics.Arcade.Group#physicsType + */ + DYNAMIC_BODY: 0, + + /** + * Static Body. + * + * @name Phaser.Physics.Arcade.STATIC_BODY + * @readonly + * @type {number} + * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#physicsType + * @see Phaser.Physics.Arcade.StaticBody#physicsType + */ + STATIC_BODY: 1, + + /** + * Arcade Physics Group containing Dynamic Bodies. + * + * @name Phaser.Physics.Arcade.GROUP + * @readonly + * @type {number} + * @since 3.0.0 + */ + GROUP: 2, + + /** + * A Tilemap Layer. + * + * @name Phaser.Physics.Arcade.TILEMAPLAYER + * @readonly + * @type {number} + * @since 3.0.0 + */ + TILEMAPLAYER: 3, + + /** + * Facing no direction (initial value). + * + * @name Phaser.Physics.Arcade.FACING_NONE + * @readonly + * @type {number} + * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing + */ + FACING_NONE: 10, + + /** + * Facing up. + * + * @name Phaser.Physics.Arcade.FACING_UP + * @readonly + * @type {number} + * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing + */ + FACING_UP: 11, + + /** + * Facing down. + * + * @name Phaser.Physics.Arcade.FACING_DOWN + * @readonly + * @type {number} + * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing + */ + FACING_DOWN: 12, + + /** + * Facing left. + * + * @name Phaser.Physics.Arcade.FACING_LEFT + * @readonly + * @type {number} + * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing + */ + FACING_LEFT: 13, + + /** + * Facing right. + * + * @name Phaser.Physics.Arcade.FACING_RIGHT + * @readonly + * @type {number} + * @since 3.0.0 + * + * @see Phaser.Physics.Arcade.Body#facing + */ + FACING_RIGHT: 14 + +}; + +module.exports = CONST; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTileAt = __webpack_require__(137); +var GetTilesWithin = __webpack_require__(21); + +/** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * + * @function Phaser.Tilemaps.Components.CalculateFacesWithin + * @private + * @since 3.0.0 + * + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var CalculateFacesWithin = function (tileX, tileY, width, height, layer) +{ + var above = null; + var below = null; + var left = null; + var right = null; + + var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + + for (var i = 0; i < tiles.length; i++) + { + var tile = tiles[i]; + + if (tile) + { + if (tile.collides) + { + above = GetTileAt(tile.x, tile.y - 1, true, layer); + below = GetTileAt(tile.x, tile.y + 1, true, layer); + left = GetTileAt(tile.x - 1, tile.y, true, layer); + right = GetTileAt(tile.x + 1, tile.y, true, layer); + + tile.faceTop = (above && above.collides) ? false : true; + tile.faceBottom = (below && below.collides) ? false : true; + tile.faceLeft = (left && left.collides) ? false : true; + tile.faceRight = (right && right.collides) ? false : true; + } + else + { + tile.resetFaces(); + } + } + } +}; + +module.exports = CalculateFacesWithin; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Blend Modes. + * + * @namespace Phaser.BlendModes + * @since 3.0.0 + */ + +module.exports = { + + /** + * Skips the Blend Mode check in the renderer. + * + * @name Phaser.BlendModes.SKIP_CHECK + * @type {integer} + * @const + * @since 3.0.0 + */ + SKIP_CHECK: -1, + + /** + * Normal blend mode. For Canvas and WebGL. + * This is the default setting and draws new shapes on top of the existing canvas content. + * + * @name Phaser.BlendModes.NORMAL + * @type {integer} + * @const + * @since 3.0.0 + */ + NORMAL: 0, + + /** + * Add blend mode. For Canvas and WebGL. + * Where both shapes overlap the color is determined by adding color values. + * + * @name Phaser.BlendModes.ADD + * @type {integer} + * @const + * @since 3.0.0 + */ + ADD: 1, + + /** + * Multiply blend mode. For Canvas and WebGL. + * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. + * + * @name Phaser.BlendModes.MULTIPLY + * @type {integer} + * @const + * @since 3.0.0 + */ + MULTIPLY: 2, + + /** + * Screen blend mode. For Canvas and WebGL. + * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) + * + * @name Phaser.BlendModes.SCREEN + * @type {integer} + * @const + * @since 3.0.0 + */ + SCREEN: 3, + + /** + * Overlay blend mode. For Canvas only. + * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. + * + * @name Phaser.BlendModes.OVERLAY + * @type {integer} + * @const + * @since 3.0.0 + */ + OVERLAY: 4, + + /** + * Darken blend mode. For Canvas only. + * Retains the darkest pixels of both layers. + * + * @name Phaser.BlendModes.DARKEN + * @type {integer} + * @const + * @since 3.0.0 + */ + DARKEN: 5, + + /** + * Lighten blend mode. For Canvas only. + * Retains the lightest pixels of both layers. + * + * @name Phaser.BlendModes.LIGHTEN + * @type {integer} + * @const + * @since 3.0.0 + */ + LIGHTEN: 6, + + /** + * Color Dodge blend mode. For Canvas only. + * Divides the bottom layer by the inverted top layer. + * + * @name Phaser.BlendModes.COLOR_DODGE + * @type {integer} + * @const + * @since 3.0.0 + */ + COLOR_DODGE: 7, + + /** + * Color Burn blend mode. For Canvas only. + * Divides the inverted bottom layer by the top layer, and then inverts the result. + * + * @name Phaser.BlendModes.COLOR_BURN + * @type {integer} + * @const + * @since 3.0.0 + */ + COLOR_BURN: 8, + + /** + * Hard Light blend mode. For Canvas only. + * A combination of multiply and screen like overlay, but with top and bottom layer swapped. + * + * @name Phaser.BlendModes.HARD_LIGHT + * @type {integer} + * @const + * @since 3.0.0 + */ + HARD_LIGHT: 9, + + /** + * Soft Light blend mode. For Canvas only. + * A softer version of hard-light. Pure black or white does not result in pure black or white. + * + * @name Phaser.BlendModes.SOFT_LIGHT + * @type {integer} + * @const + * @since 3.0.0 + */ + SOFT_LIGHT: 10, + + /** + * Difference blend mode. For Canvas only. + * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. + * + * @name Phaser.BlendModes.DIFFERENCE + * @type {integer} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {integer} + * @const + * @since 3.0.0 + */ + EXCLUSION: 12, + + /** + * Hue blend mode. For Canvas only. + * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. + * + * @name Phaser.BlendModes.HUE + * @type {integer} + * @const + * @since 3.0.0 + */ + HUE: 13, + + /** + * Saturation blend mode. For Canvas only. + * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. + * + * @name Phaser.BlendModes.SATURATION + * @type {integer} + * @const + * @since 3.0.0 + */ + SATURATION: 14, + + /** + * Color blend mode. For Canvas only. + * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. + * + * @name Phaser.BlendModes.COLOR + * @type {integer} + * @const + * @since 3.0.0 + */ + COLOR: 15, + + /** + * Luminosity blend mode. For Canvas only. + * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. + * + * @name Phaser.BlendModes.LUMINOSITY + * @type {integer} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {integer} + * @const + * @since 3.0.0 + */ + ERASE: 17, + + /** + * Source-in blend mode. For Canvas only. + * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.SOURCE_IN + * @type {integer} + * @const + * @since 3.0.0 + */ + SOURCE_IN: 18, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is drawn where it doesn't overlap the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_OUT + * @type {integer} + * @const + * @since 3.0.0 + */ + SOURCE_OUT: 19, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is only drawn where it overlaps the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_ATOP + * @type {integer} + * @const + * @since 3.0.0 + */ + SOURCE_ATOP: 20, + + /** + * Destination-over blend mode. For Canvas only. + * New shapes are drawn behind the existing canvas content. + * + * @name Phaser.BlendModes.DESTINATION_OVER + * @type {integer} + * @const + * @since 3.0.0 + */ + DESTINATION_OVER: 21, + + /** + * Destination-in blend mode. For Canvas only. + * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.DESTINATION_IN + * @type {integer} + * @const + * @since 3.0.0 + */ + DESTINATION_IN: 22, + + /** + * Destination-out blend mode. For Canvas only. + * The existing content is kept where it doesn't overlap the new shape. + * + * @name Phaser.BlendModes.DESTINATION_OUT + * @type {integer} + * @const + * @since 3.0.0 + */ + DESTINATION_OUT: 23, + + /** + * Destination-out blend mode. For Canvas only. + * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. + * + * @name Phaser.BlendModes.DESTINATION_ATOP + * @type {integer} + * @const + * @since 3.0.0 + */ + DESTINATION_ATOP: 24, + + /** + * Lighten blend mode. For Canvas only. + * Where both shapes overlap the color is determined by adding color values. + * + * @name Phaser.BlendModes.LIGHTER + * @type {integer} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {integer} + * @const + * @since 3.0.0 + */ + COPY: 26, + + /** + * Xor blend mode. For Canvas only. + * Shapes are made transparent where both overlap and drawn normal everywhere else. + * + * @name Phaser.BlendModes.XOR + * @type {integer} + * @const + * @since 3.0.0 + */ + XOR: 27 + +}; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Input.Events + */ + +module.exports = { + + BOOT: __webpack_require__(782), + DESTROY: __webpack_require__(783), + DRAG_END: __webpack_require__(784), + DRAG_ENTER: __webpack_require__(785), + DRAG: __webpack_require__(786), + DRAG_LEAVE: __webpack_require__(787), + DRAG_OVER: __webpack_require__(788), + DRAG_START: __webpack_require__(789), + DROP: __webpack_require__(790), + GAME_OUT: __webpack_require__(791), + GAME_OVER: __webpack_require__(792), + GAMEOBJECT_DOWN: __webpack_require__(793), + GAMEOBJECT_DRAG_END: __webpack_require__(794), + GAMEOBJECT_DRAG_ENTER: __webpack_require__(795), + GAMEOBJECT_DRAG: __webpack_require__(796), + GAMEOBJECT_DRAG_LEAVE: __webpack_require__(797), + GAMEOBJECT_DRAG_OVER: __webpack_require__(798), + GAMEOBJECT_DRAG_START: __webpack_require__(799), + GAMEOBJECT_DROP: __webpack_require__(800), + GAMEOBJECT_MOVE: __webpack_require__(801), + GAMEOBJECT_OUT: __webpack_require__(802), + GAMEOBJECT_OVER: __webpack_require__(803), + GAMEOBJECT_POINTER_DOWN: __webpack_require__(804), + GAMEOBJECT_POINTER_MOVE: __webpack_require__(805), + GAMEOBJECT_POINTER_OUT: __webpack_require__(806), + GAMEOBJECT_POINTER_OVER: __webpack_require__(807), + GAMEOBJECT_POINTER_UP: __webpack_require__(808), + GAMEOBJECT_POINTER_WHEEL: __webpack_require__(809), + GAMEOBJECT_UP: __webpack_require__(810), + GAMEOBJECT_WHEEL: __webpack_require__(811), + MANAGER_BOOT: __webpack_require__(812), + MANAGER_PROCESS: __webpack_require__(813), + MANAGER_UPDATE: __webpack_require__(814), + POINTER_DOWN: __webpack_require__(815), + POINTER_DOWN_OUTSIDE: __webpack_require__(816), + POINTER_MOVE: __webpack_require__(817), + POINTER_OUT: __webpack_require__(818), + POINTER_OVER: __webpack_require__(819), + POINTER_UP: __webpack_require__(820), + POINTER_UP_OUTSIDE: __webpack_require__(821), + POINTER_WHEEL: __webpack_require__(822), + POINTERLOCK_CHANGE: __webpack_require__(823), + PRE_UPDATE: __webpack_require__(824), + SHUTDOWN: __webpack_require__(825), + START: __webpack_require__(826), + UPDATE: __webpack_require__(827) + +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetPoint = __webpack_require__(250); +var GetPoints = __webpack_require__(148); +var Random = __webpack_require__(149); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * Defines a Line segment, a part of a line between two endpoints. + * + * @class Line + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x1=0] - The x coordinate of the lines starting point. + * @param {number} [y1=0] - The y coordinate of the lines starting point. + * @param {number} [x2=0] - The x coordinate of the lines ending point. + * @param {number} [y2=0] - The y coordinate of the lines ending point. + */ +var Line = new Class({ + + initialize: + + function Line (x1, y1, x2, y2) + { + if (x1 === undefined) { x1 = 0; } + if (y1 === undefined) { y1 = 0; } + if (x2 === undefined) { x2 = 0; } + if (y2 === undefined) { y2 = 0; } + + /** + * The x coordinate of the lines starting point. + * + * @name Phaser.Geom.Line#x1 + * @type {number} + * @since 3.0.0 + */ + this.x1 = x1; + + /** + * The y coordinate of the lines starting point. + * + * @name Phaser.Geom.Line#y1 + * @type {number} + * @since 3.0.0 + */ + this.y1 = y1; + + /** + * The x coordinate of the lines ending point. + * + * @name Phaser.Geom.Line#x2 + * @type {number} + * @since 3.0.0 + */ + this.x2 = x2; + + /** + * The y coordinate of the lines ending point. + * + * @name Phaser.Geom.Line#y2 + * @type {number} + * @since 3.0.0 + */ + this.y2 = y2; + }, + + /** + * Get a point on a line that's a given percentage along its length. + * + * @method Phaser.Geom.Line#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [output,$return] + * + * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. + * @param {(Phaser.Geom.Point|object)} [output] - An optional point, or point-like object, to store the coordinates of the point on the line. + * + * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point on the line. + */ + getPoint: function (position, output) + { + return GetPoint(this, position, output); + }, + + /** + * Get a number of points along a line's length. + * + * Provide a `quantity` to get an exact number of points along the line. + * + * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when + * providing a `stepRate`. + * + * @method Phaser.Geom.Line#getPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [output,$return] + * + * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {integer} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param {(array|Phaser.Geom.Point[])} [output] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. + * + * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. + */ + getPoints: function (quantity, stepRate, output) + { + return GetPoints(this, quantity, stepRate, output); + }, + + /** + * Get a random Point on the Line. + * + * @method Phaser.Geom.Line#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} [point] - An instance of a Point to be modified. + * + * @return {Phaser.Geom.Point} A random Point on the Line. + */ + getRandomPoint: function (point) + { + return Random(this, point); + }, + + /** + * Set new coordinates for the line endpoints. + * + * @method Phaser.Geom.Line#setTo + * @since 3.0.0 + * + * @param {number} [x1=0] - The x coordinate of the lines starting point. + * @param {number} [y1=0] - The y coordinate of the lines starting point. + * @param {number} [x2=0] - The x coordinate of the lines ending point. + * @param {number} [y2=0] - The y coordinate of the lines ending point. + * + * @return {Phaser.Geom.Line} This Line object. + */ + setTo: function (x1, y1, x2, y2) + { + if (x1 === undefined) { x1 = 0; } + if (y1 === undefined) { y1 = 0; } + if (x2 === undefined) { x2 = 0; } + if (y2 === undefined) { y2 = 0; } + + this.x1 = x1; + this.y1 = y1; + + this.x2 = x2; + this.y2 = y2; + + return this; + }, + + /** + * Returns a Vector2 object that corresponds to the start of this Line. + * + * @method Phaser.Geom.Line#getPointA + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [vec2,$return] + * + * @param {Phaser.Math.Vector2} [vec2] - A Vector2 object to set the results in. If `undefined` a new Vector2 will be created. + * + * @return {Phaser.Math.Vector2} A Vector2 object that corresponds to the start of this Line. + */ + getPointA: function (vec2) + { + if (vec2 === undefined) { vec2 = new Vector2(); } + + vec2.set(this.x1, this.y1); + + return vec2; + }, + + /** + * Returns a Vector2 object that corresponds to the end of this Line. + * + * @method Phaser.Geom.Line#getPointB + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [vec2,$return] + * + * @param {Phaser.Math.Vector2} [vec2] - A Vector2 object to set the results in. If `undefined` a new Vector2 will be created. + * + * @return {Phaser.Math.Vector2} A Vector2 object that corresponds to the end of this Line. + */ + getPointB: function (vec2) + { + if (vec2 === undefined) { vec2 = new Vector2(); } + + vec2.set(this.x2, this.y2); + + return vec2; + }, + + /** + * The left position of the Line. + * + * @name Phaser.Geom.Line#left + * @type {number} + * @since 3.0.0 + */ + left: { + + get: function () + { + return Math.min(this.x1, this.x2); + }, + + set: function (value) + { + if (this.x1 <= this.x2) + { + this.x1 = value; + } + else + { + this.x2 = value; + } + } + + }, + + /** + * The right position of the Line. + * + * @name Phaser.Geom.Line#right + * @type {number} + * @since 3.0.0 + */ + right: { + + get: function () + { + return Math.max(this.x1, this.x2); + }, + + set: function (value) + { + if (this.x1 > this.x2) + { + this.x1 = value; + } + else + { + this.x2 = value; + } + } + + }, + + /** + * The top position of the Line. + * + * @name Phaser.Geom.Line#top + * @type {number} + * @since 3.0.0 + */ + top: { + + get: function () + { + return Math.min(this.y1, this.y2); + }, + + set: function (value) + { + if (this.y1 <= this.y2) + { + this.y1 = value; + } + else + { + this.y2 = value; + } + } + + }, + + /** + * The bottom position of the Line. + * + * @name Phaser.Geom.Line#bottom + * @type {number} + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return Math.max(this.y1, this.y2); + }, + + set: function (value) + { + if (this.y1 > this.y2) + { + this.y1 = value; + } + else + { + this.y2 = value; + } + } + + } + +}); + +module.exports = Line; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the length of the given line. + * + * @function Phaser.Geom.Line.Length + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the length of. + * + * @return {number} The length of the line. + */ +var Length = function (line) +{ + return Math.sqrt((line.x2 - line.x1) * (line.x2 - line.x1) + (line.y2 - line.y1) * (line.y2 - line.y1)); +}; + +module.exports = Length; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Wrap the given `value` between `min` and `max. + * + * @function Phaser.Math.Wrap + * @since 3.0.0 + * + * @param {number} value - The value to wrap. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The wrapped value. + */ +var Wrap = function (value, min, max) +{ + var range = max - min; + + return (min + ((((value - min) % range) + range) % range)); +}; + +module.exports = Wrap; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points). + * + * @function Phaser.Math.Distance.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point. + */ +var DistanceBetween = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return Math.sqrt(dx * dx + dy * dy); +}; + +module.exports = DistanceBetween; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var GetValue = __webpack_require__(6); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * + * @class JSONFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var JSONFile = new Class({ + + Extends: File, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function JSONFile (loader, key, url, xhrSettings, dataKey) + { + var extension = 'json'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataKey = GetFastValue(config, 'dataKey', dataKey); + } + + var fileConfig = { + type: 'json', + cache: loader.cacheManager.json, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: dataKey + }; + + File.call(this, loader, fileConfig); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + if (dataKey) + { + this.data = GetValue(url, dataKey); + } + else + { + this.data = url; + } + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; + + var json = JSON.parse(this.xhrLoader.responseText); + + var key = this.config; + + if (typeof key === 'string') + { + this.data = GetValue(json, key, json); + } + else + { + this.data = json; + } + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#json + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new JSONFile(this, key[i])); + } + } + else + { + this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + } + + return this; +}); + +module.exports = JSONFile; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after + * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. + * + * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. + * + * @class MultiFile + * @memberof Phaser.Loader + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. + * @param {string} type - The file type string for sorting within the Loader. + * @param {string} key - The key of the file within the loader. + * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. + */ +var MultiFile = new Class({ + + initialize: + + function MultiFile (loader, type, key, files) + { + /** + * A reference to the Loader that is going to load this file. + * + * @name Phaser.Loader.MultiFile#loader + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.7.0 + */ + this.loader = loader; + + /** + * The file type string for sorting within the Loader. + * + * @name Phaser.Loader.MultiFile#type + * @type {string} + * @since 3.7.0 + */ + this.type = type; + + /** + * Unique cache key (unique within its file type) + * + * @name Phaser.Loader.MultiFile#key + * @type {string} + * @since 3.7.0 + */ + this.key = key; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = files; + + /** + * The completion status of this MultiFile. + * + * @name Phaser.Loader.MultiFile#complete + * @type {boolean} + * @default false + * @since 3.7.0 + */ + this.complete = false; + + /** + * The number of files to load. + * + * @name Phaser.Loader.MultiFile#pending + * @type {integer} + * @since 3.7.0 + */ + + this.pending = files.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {integer} + * @default 0 + * @since 3.7.0 + */ + this.failed = 0; + + /** + * A storage container for transient data that the loading files need. + * + * @name Phaser.Loader.MultiFile#config + * @type {any} + * @since 3.7.0 + */ + this.config = {}; + + // Link the files + for (var i = 0; i < files.length; i++) + { + files[i].multiFile = this; + } + }, + + /** + * Checks if this MultiFile is ready to process its children or not. + * + * @method Phaser.Loader.MultiFile#isReadyToProcess + * @since 3.7.0 + * + * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. + */ + isReadyToProcess: function () + { + return (this.pending === 0 && this.failed === 0 && !this.complete); + }, + + /** + * Adds another child to this MultiFile, increases the pending count and resets the completion status. + * + * @method Phaser.Loader.MultiFile#addToMultiFile + * @since 3.7.0 + * + * @param {Phaser.Loader.File} files - The File to add to this MultiFile. + * + * @return {Phaser.Loader.MultiFile} This MultiFile instance. + */ + addToMultiFile: function (file) + { + this.files.push(file); + + file.multiFile = this; + + this.pending++; + + this.complete = false; + + return this; + }, + + /** + * Called by each File when it finishes loading. + * + * @method Phaser.Loader.MultiFile#onFileComplete + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has completed processing. + */ + onFileComplete: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.pending--; + } + }, + + /** + * Called by each File that fails to load. + * + * @method Phaser.Loader.MultiFile#onFileFailed + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has failed to load. + */ + onFileFailed: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.failed++; + } + } + +}); + +module.exports = MultiFile; + + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Body` module contains methods for creating and manipulating body models. +* A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`. +* Factories for commonly used body configurations (such as rectangles, circles and other polygons) can be found in the module `Matter.Bodies`. +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). + +* @class Body +*/ + +var Body = {}; + +module.exports = Body; + +var Vertices = __webpack_require__(84); +var Vector = __webpack_require__(99); +var Sleeping = __webpack_require__(448); +var Common = __webpack_require__(37); +var Bounds = __webpack_require__(100); +var Axes = __webpack_require__(1240); + +(function() { + + Body._inertiaScale = 4; + Body._nextCollidingGroupId = 1; + Body._nextNonCollidingGroupId = -1; + Body._nextCategory = 0x0001; + + /** + * Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults. + * All properties have default values, and many are pre-calculated automatically based on other properties. + * Vertices must be specified in clockwise order. + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {} options + * @return {body} body + */ + Body.create = function(options) { + var defaults = { + id: Common.nextId(), + type: 'body', + label: 'Body', + gameObject: null, + parts: [], + plugin: {}, + angle: 0, + vertices: Vertices.fromPath('L 0 0 L 40 0 L 40 40 L 0 40'), + position: { x: 0, y: 0 }, + force: { x: 0, y: 0 }, + torque: 0, + positionImpulse: { x: 0, y: 0 }, + previousPositionImpulse: { x: 0, y: 0 }, + constraintImpulse: { x: 0, y: 0, angle: 0 }, + totalContacts: 0, + speed: 0, + angularSpeed: 0, + velocity: { x: 0, y: 0 }, + angularVelocity: 0, + isSensor: false, + isStatic: false, + isSleeping: false, + ignoreGravity: false, + ignorePointer: false, + motion: 0, + sleepThreshold: 60, + density: 0.001, + restitution: 0, + friction: 0.1, + frictionStatic: 0.5, + frictionAir: 0.01, + collisionFilter: { + category: 0x0001, + mask: 0xFFFFFFFF, + group: 0 + }, + slop: 0.05, + timeScale: 1, + render: { + visible: true, + opacity: 1, + sprite: { + xScale: 1, + yScale: 1, + xOffset: 0, + yOffset: 0 + }, + lineWidth: 0 + }, + + events: null, + bounds: null, + chamfer: null, + circleRadius: 0, + positionPrev: null, + anglePrev: 0, + parent: null, + + axes: null, + area: 0, + mass: 0, + inertia: 0, + + _original: null + }; + + var body = Common.extend(defaults, options); + + _initProperties(body, options); + + return body; + }; + + /** + * Returns the next unique group index for which bodies will collide. + * If `isNonColliding` is `true`, returns the next unique group index for which bodies will _not_ collide. + * See `body.collisionFilter` for more information. + * @method nextGroup + * @param {bool} [isNonColliding=false] + * @return {Number} Unique group index + */ + Body.nextGroup = function(isNonColliding) { + if (isNonColliding) + return Body._nextNonCollidingGroupId--; + + return Body._nextCollidingGroupId++; + }; + + /** + * Returns the next unique category bitfield (starting after the initial default category `0x0001`). + * There are 32 available. See `body.collisionFilter` for more information. + * @method nextCategory + * @return {Number} Unique category bitfield + */ + Body.nextCategory = function() { + Body._nextCategory = Body._nextCategory << 1; + return Body._nextCategory; + }; + + /** + * Initialises body properties. + * @method _initProperties + * @private + * @param {body} body + * @param {} [options] + */ + var _initProperties = function(body, options) { + options = options || {}; + + // init required properties (order is important) + Body.set(body, { + bounds: body.bounds || Bounds.create(body.vertices), + positionPrev: body.positionPrev || Vector.clone(body.position), + anglePrev: body.anglePrev || body.angle, + vertices: body.vertices, + parts: body.parts || [body], + isStatic: body.isStatic, + isSleeping: body.isSleeping, + parent: body.parent || body + }); + + Vertices.rotate(body.vertices, body.angle, body.position); + Axes.rotate(body.axes, body.angle); + Bounds.update(body.bounds, body.vertices, body.velocity); + + // allow options to override the automatically calculated properties + Body.set(body, { + axes: options.axes || body.axes, + area: options.area || body.area, + mass: options.mass || body.mass, + inertia: options.inertia || body.inertia + }); + + // render properties + var defaultFillStyle = (body.isStatic ? '#2e2b44' : Common.choose(['#006BA6', '#0496FF', '#FFBC42', '#D81159', '#8F2D56'])), + defaultStrokeStyle = '#000'; + body.render.fillStyle = body.render.fillStyle || defaultFillStyle; + body.render.strokeStyle = body.render.strokeStyle || defaultStrokeStyle; + body.render.sprite.xOffset += -(body.bounds.min.x - body.position.x) / (body.bounds.max.x - body.bounds.min.x); + body.render.sprite.yOffset += -(body.bounds.min.y - body.position.y) / (body.bounds.max.y - body.bounds.min.y); + }; + + /** + * Given a property and a value (or map of), sets the property(s) on the body, using the appropriate setter functions if they exist. + * Prefer to use the actual setter functions in performance critical situations. + * @method set + * @param {body} body + * @param {} settings A property name (or map of properties and values) to set on the body. + * @param {} value The value to set if `settings` is a single property name. + */ + Body.set = function(body, settings, value) { + var property; + + if (typeof settings === 'string') { + property = settings; + settings = {}; + settings[property] = value; + } + + for (property in settings) { + + if (!settings.hasOwnProperty(property)) + continue; + + value = settings[property]; + switch (property) { + + case 'isStatic': + Body.setStatic(body, value); + break; + case 'isSleeping': + Sleeping.set(body, value); + break; + case 'mass': + Body.setMass(body, value); + break; + case 'density': + Body.setDensity(body, value); + break; + case 'inertia': + Body.setInertia(body, value); + break; + case 'vertices': + Body.setVertices(body, value); + break; + case 'position': + Body.setPosition(body, value); + break; + case 'angle': + Body.setAngle(body, value); + break; + case 'velocity': + Body.setVelocity(body, value); + break; + case 'angularVelocity': + Body.setAngularVelocity(body, value); + break; + case 'parts': + Body.setParts(body, value); + break; + default: + body[property] = value; + + } + } + }; + + /** + * Sets the body as static, including isStatic flag and setting mass and inertia to Infinity. + * @method setStatic + * @param {body} body + * @param {bool} isStatic + */ + Body.setStatic = function(body, isStatic) { + for (var i = 0; i < body.parts.length; i++) { + var part = body.parts[i]; + part.isStatic = isStatic; + + if (isStatic) { + part._original = { + restitution: part.restitution, + friction: part.friction, + mass: part.mass, + inertia: part.inertia, + density: part.density, + inverseMass: part.inverseMass, + inverseInertia: part.inverseInertia + }; + + part.restitution = 0; + part.friction = 1; + part.mass = part.inertia = part.density = Infinity; + part.inverseMass = part.inverseInertia = 0; + + part.positionPrev.x = part.position.x; + part.positionPrev.y = part.position.y; + part.anglePrev = part.angle; + part.angularVelocity = 0; + part.speed = 0; + part.angularSpeed = 0; + part.motion = 0; + } else if (part._original) { + part.restitution = part._original.restitution; + part.friction = part._original.friction; + part.mass = part._original.mass; + part.inertia = part._original.inertia; + part.density = part._original.density; + part.inverseMass = part._original.inverseMass; + part.inverseInertia = part._original.inverseInertia; + + part._original = null; + } + } + }; + + /** + * Sets the mass of the body. Inverse mass, density and inertia are automatically updated to reflect the change. + * @method setMass + * @param {body} body + * @param {number} mass + */ + Body.setMass = function(body, mass) { + var moment = body.inertia / (body.mass / 6); + body.inertia = moment * (mass / 6); + body.inverseInertia = 1 / body.inertia; + + body.mass = mass; + body.inverseMass = 1 / body.mass; + body.density = body.mass / body.area; + }; + + /** + * Sets the density of the body. Mass and inertia are automatically updated to reflect the change. + * @method setDensity + * @param {body} body + * @param {number} density + */ + Body.setDensity = function(body, density) { + Body.setMass(body, density * body.area); + body.density = density; + }; + + /** + * Sets the moment of inertia (i.e. second moment of area) of the body of the body. + * Inverse inertia is automatically updated to reflect the change. Mass is not changed. + * @method setInertia + * @param {body} body + * @param {number} inertia + */ + Body.setInertia = function(body, inertia) { + body.inertia = inertia; + body.inverseInertia = 1 / body.inertia; + }; + + /** + * Sets the body's vertices and updates body properties accordingly, including inertia, area and mass (with respect to `body.density`). + * Vertices will be automatically transformed to be orientated around their centre of mass as the origin. + * They are then automatically translated to world space based on `body.position`. + * + * The `vertices` argument should be passed as an array of `Matter.Vector` points (or a `Matter.Vertices` array). + * Vertices must form a convex hull, concave hulls are not supported. + * + * @method setVertices + * @param {body} body + * @param {vector[]} vertices + */ + Body.setVertices = function(body, vertices) { + // change vertices + if (vertices[0].body === body) { + body.vertices = vertices; + } else { + body.vertices = Vertices.create(vertices, body); + } + + // update properties + body.axes = Axes.fromVertices(body.vertices); + body.area = Vertices.area(body.vertices); + Body.setMass(body, body.density * body.area); + + // orient vertices around the centre of mass at origin (0, 0) + var centre = Vertices.centre(body.vertices); + Vertices.translate(body.vertices, centre, -1); + + // update inertia while vertices are at origin (0, 0) + Body.setInertia(body, Body._inertiaScale * Vertices.inertia(body.vertices, body.mass)); + + // update geometry + Vertices.translate(body.vertices, body.position); + Bounds.update(body.bounds, body.vertices, body.velocity); + }; + + /** + * Sets the parts of the `body` and updates mass, inertia and centroid. + * Each part will have its parent set to `body`. + * By default the convex hull will be automatically computed and set on `body`, unless `autoHull` is set to `false.` + * Note that this method will ensure that the first part in `body.parts` will always be the `body`. + * @method setParts + * @param {body} body + * @param [body] parts + * @param {bool} [autoHull=true] + */ + Body.setParts = function(body, parts, autoHull) { + var i; + + // add all the parts, ensuring that the first part is always the parent body + parts = parts.slice(0); + body.parts.length = 0; + body.parts.push(body); + body.parent = body; + + for (i = 0; i < parts.length; i++) { + var part = parts[i]; + if (part !== body) { + part.parent = body; + body.parts.push(part); + } + } + + if (body.parts.length === 1) + return; + + autoHull = typeof autoHull !== 'undefined' ? autoHull : true; + + // find the convex hull of all parts to set on the parent body + if (autoHull) { + var vertices = []; + for (i = 0; i < parts.length; i++) { + vertices = vertices.concat(parts[i].vertices); + } + + Vertices.clockwiseSort(vertices); + + var hull = Vertices.hull(vertices), + hullCentre = Vertices.centre(hull); + + Body.setVertices(body, hull); + Vertices.translate(body.vertices, hullCentre); + } + + // sum the properties of all compound parts of the parent body + var total = Body._totalProperties(body); + + body.area = total.area; + body.parent = body; + body.position.x = total.centre.x; + body.position.y = total.centre.y; + body.positionPrev.x = total.centre.x; + body.positionPrev.y = total.centre.y; + + Body.setMass(body, total.mass); + Body.setInertia(body, total.inertia); + Body.setPosition(body, total.centre); + }; + + /** + * Sets the position of the body instantly. Velocity, angle, force etc. are unchanged. + * @method setPosition + * @param {body} body + * @param {vector} position + */ + Body.setPosition = function(body, position) { + var delta = Vector.sub(position, body.position); + body.positionPrev.x += delta.x; + body.positionPrev.y += delta.y; + + for (var i = 0; i < body.parts.length; i++) { + var part = body.parts[i]; + part.position.x += delta.x; + part.position.y += delta.y; + Vertices.translate(part.vertices, delta); + Bounds.update(part.bounds, part.vertices, body.velocity); + } + }; + + /** + * Sets the angle of the body instantly. Angular velocity, position, force etc. are unchanged. + * @method setAngle + * @param {body} body + * @param {number} angle + */ + Body.setAngle = function(body, angle) { + var delta = angle - body.angle; + body.anglePrev += delta; + + for (var i = 0; i < body.parts.length; i++) { + var part = body.parts[i]; + part.angle += delta; + Vertices.rotate(part.vertices, delta, body.position); + Axes.rotate(part.axes, delta); + Bounds.update(part.bounds, part.vertices, body.velocity); + if (i > 0) { + Vector.rotateAbout(part.position, delta, body.position, part.position); + } + } + }; + + /** + * Sets the linear velocity of the body instantly. Position, angle, force etc. are unchanged. See also `Body.applyForce`. + * @method setVelocity + * @param {body} body + * @param {vector} velocity + */ + Body.setVelocity = function(body, velocity) { + body.positionPrev.x = body.position.x - velocity.x; + body.positionPrev.y = body.position.y - velocity.y; + body.velocity.x = velocity.x; + body.velocity.y = velocity.y; + body.speed = Vector.magnitude(body.velocity); + }; + + /** + * Sets the angular velocity of the body instantly. Position, angle, force etc. are unchanged. See also `Body.applyForce`. + * @method setAngularVelocity + * @param {body} body + * @param {number} velocity + */ + Body.setAngularVelocity = function(body, velocity) { + body.anglePrev = body.angle - velocity; + body.angularVelocity = velocity; + body.angularSpeed = Math.abs(body.angularVelocity); + }; + + /** + * Moves a body by a given vector relative to its current position, without imparting any velocity. + * @method translate + * @param {body} body + * @param {vector} translation + */ + Body.translate = function(body, translation) { + Body.setPosition(body, Vector.add(body.position, translation)); + }; + + /** + * Rotates a body by a given angle relative to its current angle, without imparting any angular velocity. + * @method rotate + * @param {body} body + * @param {number} rotation + * @param {vector} [point] + */ + Body.rotate = function(body, rotation, point) { + if (!point) { + Body.setAngle(body, body.angle + rotation); + } else { + var cos = Math.cos(rotation), + sin = Math.sin(rotation), + dx = body.position.x - point.x, + dy = body.position.y - point.y; + + Body.setPosition(body, { + x: point.x + (dx * cos - dy * sin), + y: point.y + (dx * sin + dy * cos) + }); + + Body.setAngle(body, body.angle + rotation); + } + }; + + /** + * Scales the body, including updating physical properties (mass, area, axes, inertia), from a world-space point (default is body centre). + * @method scale + * @param {body} body + * @param {number} scaleX + * @param {number} scaleY + * @param {vector} [point] + */ + Body.scale = function(body, scaleX, scaleY, point) { + var totalArea = 0, + totalInertia = 0; + + point = point || body.position; + + for (var i = 0; i < body.parts.length; i++) { + var part = body.parts[i]; + + // scale vertices + Vertices.scale(part.vertices, scaleX, scaleY, point); + + // update properties + part.axes = Axes.fromVertices(part.vertices); + part.area = Vertices.area(part.vertices); + Body.setMass(part, body.density * part.area); + + // update inertia (requires vertices to be at origin) + Vertices.translate(part.vertices, { x: -part.position.x, y: -part.position.y }); + Body.setInertia(part, Body._inertiaScale * Vertices.inertia(part.vertices, part.mass)); + Vertices.translate(part.vertices, { x: part.position.x, y: part.position.y }); + + if (i > 0) { + totalArea += part.area; + totalInertia += part.inertia; + } + + // scale position + part.position.x = point.x + (part.position.x - point.x) * scaleX; + part.position.y = point.y + (part.position.y - point.y) * scaleY; + + // update bounds + Bounds.update(part.bounds, part.vertices, body.velocity); + } + + // handle parent body + if (body.parts.length > 1) { + body.area = totalArea; + + if (!body.isStatic) { + Body.setMass(body, body.density * totalArea); + Body.setInertia(body, totalInertia); + } + } + + // handle circles + if (body.circleRadius) { + if (scaleX === scaleY) { + body.circleRadius *= scaleX; + } else { + // body is no longer a circle + body.circleRadius = null; + } + } + }; + + /** + * Performs a simulation step for the given `body`, including updating position and angle using Verlet integration. + * @method update + * @param {body} body + * @param {number} deltaTime + * @param {number} timeScale + * @param {number} correction + */ + Body.update = function(body, deltaTime, timeScale, correction) { + var deltaTimeSquared = Math.pow(deltaTime * timeScale * body.timeScale, 2); + + // from the previous step + var frictionAir = 1 - body.frictionAir * timeScale * body.timeScale, + velocityPrevX = body.position.x - body.positionPrev.x, + velocityPrevY = body.position.y - body.positionPrev.y; + + // update velocity with Verlet integration + body.velocity.x = (velocityPrevX * frictionAir * correction) + (body.force.x / body.mass) * deltaTimeSquared; + body.velocity.y = (velocityPrevY * frictionAir * correction) + (body.force.y / body.mass) * deltaTimeSquared; + + body.positionPrev.x = body.position.x; + body.positionPrev.y = body.position.y; + body.position.x += body.velocity.x; + body.position.y += body.velocity.y; + + // update angular velocity with Verlet integration + body.angularVelocity = ((body.angle - body.anglePrev) * frictionAir * correction) + (body.torque / body.inertia) * deltaTimeSquared; + body.anglePrev = body.angle; + body.angle += body.angularVelocity; + + // track speed and acceleration + body.speed = Vector.magnitude(body.velocity); + body.angularSpeed = Math.abs(body.angularVelocity); + + // transform the body geometry + for (var i = 0; i < body.parts.length; i++) { + var part = body.parts[i]; + + Vertices.translate(part.vertices, body.velocity); + + if (i > 0) { + part.position.x += body.velocity.x; + part.position.y += body.velocity.y; + } + + if (body.angularVelocity !== 0) { + Vertices.rotate(part.vertices, body.angularVelocity, body.position); + Axes.rotate(part.axes, body.angularVelocity); + if (i > 0) { + Vector.rotateAbout(part.position, body.angularVelocity, body.position, part.position); + } + } + + Bounds.update(part.bounds, part.vertices, body.velocity); + } + }; + + /** + * Applies a force to a body from a given world-space position, including resulting torque. + * @method applyForce + * @param {body} body + * @param {vector} position + * @param {vector} force + */ + Body.applyForce = function(body, position, force) { + body.force.x += force.x; + body.force.y += force.y; + var offset = { x: position.x - body.position.x, y: position.y - body.position.y }; + body.torque += offset.x * force.y - offset.y * force.x; + }; + + /** + * Returns the sums of the properties of all compound parts of the parent body. + * @method _totalProperties + * @private + * @param {body} body + * @return {} + */ + Body._totalProperties = function(body) { + // from equations at: + // https://ecourses.ou.edu/cgi-bin/ebook.cgi?doc=&topic=st&chap_sec=07.2&page=theory + // http://output.to/sideway/default.asp?qno=121100087 + + var properties = { + mass: 0, + area: 0, + inertia: 0, + centre: { x: 0, y: 0 } + }; + + // sum the properties of all compound parts of the parent body + for (var i = body.parts.length === 1 ? 0 : 1; i < body.parts.length; i++) { + var part = body.parts[i], + mass = part.mass !== Infinity ? part.mass : 1; + + properties.mass += mass; + properties.area += part.area; + properties.inertia += part.inertia; + properties.centre = Vector.add(properties.centre, Vector.mult(part.position, mass)); + } + + properties.centre = Vector.div(properties.centre, properties.mass); + + return properties; + }; + + /* + * + * Events Documentation + * + */ + + /** + * Fired when a body starts sleeping (where `this` is the body). + * + * @event sleepStart + * @this {body} The body that has started sleeping + * @param {} event An event object + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /** + * Fired when a body ends sleeping (where `this` is the body). + * + * @event sleepEnd + * @this {body} The body that has ended sleeping + * @param {} event An event object + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /* + * + * Properties Documentation + * + */ + + /** + * An integer `Number` uniquely identifying number generated in `Body.create` by `Common.nextId`. + * + * @property id + * @type number + */ + + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "body" + * @readOnly + */ + + /** + * An arbitrary `String` name to help the user identify and manage bodies. + * + * @property label + * @type string + * @default "Body" + */ + + /** + * An array of bodies that make up this body. + * The first body in the array must always be a self reference to the current body instance. + * All bodies in the `parts` array together form a single rigid compound body. + * Parts are allowed to overlap, have gaps or holes or even form concave bodies. + * Parts themselves should never be added to a `World`, only the parent body should be. + * Use `Body.setParts` when setting parts to ensure correct updates of all properties. + * + * @property parts + * @type body[] + */ + + /** + * An object reserved for storing plugin-specific properties. + * + * @property plugin + * @type {} + */ + + /** + * A self reference if the body is _not_ a part of another body. + * Otherwise this is a reference to the body that this is a part of. + * See `body.parts`. + * + * @property parent + * @type body + */ + + /** + * A `Number` specifying the angle of the body, in radians. + * + * @property angle + * @type number + * @default 0 + */ + + /** + * An array of `Vector` objects that specify the convex hull of the rigid body. + * These should be provided about the origin `(0, 0)`. E.g. + * + * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }] + * + * When passed via `Body.create`, the vertices are translated relative to `body.position` (i.e. world-space, and constantly updated by `Body.update` during simulation). + * The `Vector` objects are also augmented with additional properties required for efficient collision detection. + * + * Other properties such as `inertia` and `bounds` are automatically calculated from the passed vertices (unless provided via `options`). + * Concave hulls are not currently supported. The module `Matter.Vertices` contains useful methods for working with vertices. + * + * @property vertices + * @type vector[] + */ + + /** + * A `Vector` that specifies the current world-space position of the body. + * + * @property position + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * A `Vector` that specifies the force to apply in the current step. It is zeroed after every `Body.update`. See also `Body.applyForce`. + * + * @property force + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * A `Number` that specifies the torque (turning force) to apply in the current step. It is zeroed after every `Body.update`. + * + * @property torque + * @type number + * @default 0 + */ + + /** + * A `Number` that _measures_ the current speed of the body after the last `Body.update`. It is read-only and always positive (it's the magnitude of `body.velocity`). + * + * @readOnly + * @property speed + * @type number + * @default 0 + */ + + /** + * A `Number` that _measures_ the current angular speed of the body after the last `Body.update`. It is read-only and always positive (it's the magnitude of `body.angularVelocity`). + * + * @readOnly + * @property angularSpeed + * @type number + * @default 0 + */ + + /** + * A `Vector` that _measures_ the current velocity of the body after the last `Body.update`. It is read-only. + * If you need to modify a body's velocity directly, you should either apply a force or simply change the body's `position` (as the engine uses position-Verlet integration). + * + * @readOnly + * @property velocity + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * A `Number` that _measures_ the current angular velocity of the body after the last `Body.update`. It is read-only. + * If you need to modify a body's angular velocity directly, you should apply a torque or simply change the body's `angle` (as the engine uses position-Verlet integration). + * + * @readOnly + * @property angularVelocity + * @type number + * @default 0 + */ + + /** + * A flag that indicates whether a body is considered static. A static body can never change position or angle and is completely fixed. + * If you need to set a body as static after its creation, you should use `Body.setStatic` as this requires more than just setting this flag. + * + * @property isStatic + * @type boolean + * @default false + */ + + /** + * A flag that indicates whether a body is a sensor. Sensor triggers collision events, but doesn't react with colliding body physically. + * + * @property isSensor + * @type boolean + * @default false + */ + + /** + * A flag that indicates whether the body is considered sleeping. A sleeping body acts similar to a static body, except it is only temporary and can be awoken. + * If you need to set a body as sleeping, you should use `Sleeping.set` as this requires more than just setting this flag. + * + * @property isSleeping + * @type boolean + * @default false + */ + + /** + * A `Number` that _measures_ the amount of movement a body currently has (a combination of `speed` and `angularSpeed`). It is read-only and always positive. + * It is used and updated by the `Matter.Sleeping` module during simulation to decide if a body has come to rest. + * + * @readOnly + * @property motion + * @type number + * @default 0 + */ + + /** + * A `Number` that defines the number of updates in which this body must have near-zero velocity before it is set as sleeping by the `Matter.Sleeping` module (if sleeping is enabled by the engine). + * + * @property sleepThreshold + * @type number + * @default 60 + */ + + /** + * A `Number` that defines the density of the body, that is its mass per unit area. + * If you pass the density via `Body.create` the `mass` property is automatically calculated for you based on the size (area) of the object. + * This is generally preferable to simply setting mass and allows for more intuitive definition of materials (e.g. rock has a higher density than wood). + * + * @property density + * @type number + * @default 0.001 + */ + + /** + * A `Number` that defines the mass of the body, although it may be more appropriate to specify the `density` property instead. + * If you modify this value, you must also modify the `body.inverseMass` property (`1 / mass`). + * + * @property mass + * @type number + */ + + /** + * A `Number` that defines the inverse mass of the body (`1 / mass`). + * If you modify this value, you must also modify the `body.mass` property. + * + * @property inverseMass + * @type number + */ + + /** + * A `Number` that defines the moment of inertia (i.e. second moment of area) of the body. + * It is automatically calculated from the given convex hull (`vertices` array) and density in `Body.create`. + * If you modify this value, you must also modify the `body.inverseInertia` property (`1 / inertia`). + * + * @property inertia + * @type number + */ + + /** + * A `Number` that defines the inverse moment of inertia of the body (`1 / inertia`). + * If you modify this value, you must also modify the `body.inertia` property. + * + * @property inverseInertia + * @type number + */ + + /** + * A `Number` that defines the restitution (elasticity) of the body. The value is always positive and is in the range `(0, 1)`. + * A value of `0` means collisions may be perfectly inelastic and no bouncing may occur. + * A value of `0.8` means the body may bounce back with approximately 80% of its kinetic energy. + * Note that collision response is based on _pairs_ of bodies, and that `restitution` values are _combined_ with the following formula: + * + * Math.max(bodyA.restitution, bodyB.restitution) + * + * @property restitution + * @type number + * @default 0 + */ + + /** + * A `Number` that defines the friction of the body. The value is always positive and is in the range `(0, 1)`. + * A value of `0` means that the body may slide indefinitely. + * A value of `1` means the body may come to a stop almost instantly after a force is applied. + * + * The effects of the value may be non-linear. + * High values may be unstable depending on the body. + * The engine uses a Coulomb friction model including static and kinetic friction. + * Note that collision response is based on _pairs_ of bodies, and that `friction` values are _combined_ with the following formula: + * + * Math.min(bodyA.friction, bodyB.friction) + * + * @property friction + * @type number + * @default 0.1 + */ + + /** + * A `Number` that defines the static friction of the body (in the Coulomb friction model). + * A value of `0` means the body will never 'stick' when it is nearly stationary and only dynamic `friction` is used. + * The higher the value (e.g. `10`), the more force it will take to initially get the body moving when nearly stationary. + * This value is multiplied with the `friction` property to make it easier to change `friction` and maintain an appropriate amount of static friction. + * + * @property frictionStatic + * @type number + * @default 0.5 + */ + + /** + * A `Number` that defines the air friction of the body (air resistance). + * A value of `0` means the body will never slow as it moves through space. + * The higher the value, the faster a body slows when moving through space. + * The effects of the value are non-linear. + * + * @property frictionAir + * @type number + * @default 0.01 + */ + + /** + * An `Object` that specifies the collision filtering properties of this body. + * + * Collisions between two bodies will obey the following rules: + * - If the two bodies have the same non-zero value of `collisionFilter.group`, + * they will always collide if the value is positive, and they will never collide + * if the value is negative. + * - If the two bodies have different values of `collisionFilter.group` or if one + * (or both) of the bodies has a value of 0, then the category/mask rules apply as follows: + * + * Each body belongs to a collision category, given by `collisionFilter.category`. This + * value is used as a bit field and the category should have only one bit set, meaning that + * the value of this property is a power of two in the range [1, 2^31]. Thus, there are 32 + * different collision categories available. + * + * Each body also defines a collision bitmask, given by `collisionFilter.mask` which specifies + * the categories it collides with (the value is the bitwise AND value of all these categories). + * + * Using the category/mask rules, two bodies `A` and `B` collide if each includes the other's + * category in its mask, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` + * are both true. + * + * @property collisionFilter + * @type object + */ + + /** + * An Integer `Number`, that specifies the collision group this body belongs to. + * See `body.collisionFilter` for more information. + * + * @property collisionFilter.group + * @type object + * @default 0 + */ + + /** + * A bit field that specifies the collision category this body belongs to. + * The category value should have only one bit set, for example `0x0001`. + * This means there are up to 32 unique collision categories available. + * See `body.collisionFilter` for more information. + * + * @property collisionFilter.category + * @type object + * @default 1 + */ + + /** + * A bit mask that specifies the collision categories this body may collide with. + * See `body.collisionFilter` for more information. + * + * @property collisionFilter.mask + * @type object + * @default -1 + */ + + /** + * A `Number` that specifies a tolerance on how far a body is allowed to 'sink' or rotate into other bodies. + * Avoid changing this value unless you understand the purpose of `slop` in physics engines. + * The default should generally suffice, although very large bodies may require larger values for stable stacking. + * + * @property slop + * @type number + * @default 0.05 + */ + + /** + * A `Number` that allows per-body time scaling, e.g. a force-field where bodies inside are in slow-motion, while others are at full speed. + * + * @property timeScale + * @type number + * @default 1 + */ + + /** + * An `Object` that defines the rendering properties to be consumed by the module `Matter.Render`. + * + * @property render + * @type object + */ + + /** + * A flag that indicates if the body should be rendered. + * + * @property render.visible + * @type boolean + * @default true + */ + + /** + * Sets the opacity to use when rendering. + * + * @property render.opacity + * @type number + * @default 1 + */ + + /** + * An `Object` that defines the sprite properties to use when rendering, if any. + * + * @property render.sprite + * @type object + */ + + /** + * An `String` that defines the path to the image to use as the sprite texture, if any. + * + * @property render.sprite.texture + * @type string + */ + + /** + * A `Number` that defines the scaling in the x-axis for the sprite, if any. + * + * @property render.sprite.xScale + * @type number + * @default 1 + */ + + /** + * A `Number` that defines the scaling in the y-axis for the sprite, if any. + * + * @property render.sprite.yScale + * @type number + * @default 1 + */ + + /** + * A `Number` that defines the offset in the x-axis for the sprite (normalised by texture width). + * + * @property render.sprite.xOffset + * @type number + * @default 0 + */ + + /** + * A `Number` that defines the offset in the y-axis for the sprite (normalised by texture height). + * + * @property render.sprite.yOffset + * @type number + * @default 0 + */ + + /** + * A `Number` that defines the line width to use when rendering the body outline (if a sprite is not defined). + * A value of `0` means no outline will be rendered. + * + * @property render.lineWidth + * @type number + * @default 0 + */ + + /** + * A `String` that defines the fill style to use when rendering the body (if a sprite is not defined). + * It is the same as when using a canvas, so it accepts CSS style property values. + * + * @property render.fillStyle + * @type string + * @default a random colour + */ + + /** + * A `String` that defines the stroke style to use when rendering the body outline (if a sprite is not defined). + * It is the same as when using a canvas, so it accepts CSS style property values. + * + * @property render.strokeStyle + * @type string + * @default a random colour + */ + + /** + * An array of unique axis vectors (edge normals) used for collision detection. + * These are automatically calculated from the given convex hull (`vertices` array) in `Body.create`. + * They are constantly updated by `Body.update` during the simulation. + * + * @property axes + * @type vector[] + */ + + /** + * A `Number` that _measures_ the area of the body's convex hull, calculated at creation by `Body.create`. + * + * @property area + * @type string + * @default + */ + + /** + * A `Bounds` object that defines the AABB region for the body. + * It is automatically calculated from the given convex hull (`vertices` array) in `Body.create` and constantly updated by `Body.update` during simulation. + * + * @property bounds + * @type bounds + */ + +})(); + + +/***/ }), +/* 61 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileX + * @private + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The X location in tile units. + */ +var WorldToTileX = function (worldX, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileWidth = layer.baseTileWidth; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + return snapToFloor + ? Math.floor(worldX / tileWidth) + : worldX / tileWidth; +}; + +module.exports = WorldToTileX; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileY + * @private + * @since 3.0.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var WorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return snapToFloor + ? Math.floor(worldY / tileHeight) + : worldY / tileHeight; +}; + +module.exports = WorldToTileY; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Earcut 2.1.4 (December 4th 2018) + +/* + * ISC License + * + * Copyright (c) 2016, Mapbox + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + + + +module.exports = earcut; + +function earcut(data, holeIndices, dim) { + + dim = dim || 2; + + var hasHoles = holeIndices && holeIndices.length, + outerLen = hasHoles ? holeIndices[0] * dim : data.length, + outerNode = linkedList(data, 0, outerLen, dim, true), + triangles = []; + + if (!outerNode || outerNode.next === outerNode.prev) return triangles; + + var minX, minY, maxX, maxY, x, y, invSize; + + if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim); + + // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox + if (data.length > 80 * dim) { + minX = maxX = data[0]; + minY = maxY = data[1]; + + for (var i = dim; i < outerLen; i += dim) { + x = data[i]; + y = data[i + 1]; + if (x < minX) minX = x; + if (y < minY) minY = y; + if (x > maxX) maxX = x; + if (y > maxY) maxY = y; + } + + // minX, minY and invSize are later used to transform coords into integers for z-order calculation + invSize = Math.max(maxX - minX, maxY - minY); + invSize = invSize !== 0 ? 1 / invSize : 0; + } + + earcutLinked(outerNode, triangles, dim, minX, minY, invSize); + + return triangles; +} + +// create a circular doubly linked list from polygon points in the specified winding order +function linkedList(data, start, end, dim, clockwise) { + var i, last; + + if (clockwise === (signedArea(data, start, end, dim) > 0)) { + for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last); + } else { + for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last); + } + + if (last && equals(last, last.next)) { + removeNode(last); + last = last.next; + } + + return last; +} + +// eliminate colinear or duplicate points +function filterPoints(start, end) { + if (!start) return start; + if (!end) end = start; + + var p = start, + again; + do { + again = false; + + if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) { + removeNode(p); + p = end = p.prev; + if (p === p.next) break; + again = true; + + } else { + p = p.next; + } + } while (again || p !== end); + + return end; +} + +// main ear slicing loop which triangulates a polygon (given as a linked list) +function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) { + if (!ear) return; + + // interlink polygon nodes in z-order + if (!pass && invSize) indexCurve(ear, minX, minY, invSize); + + var stop = ear, + prev, next; + + // iterate through ears, slicing them one by one + while (ear.prev !== ear.next) { + prev = ear.prev; + next = ear.next; + + if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) { + // cut off the triangle + triangles.push(prev.i / dim); + triangles.push(ear.i / dim); + triangles.push(next.i / dim); + + removeNode(ear); + + // skipping the next vertex leads to less sliver triangles + ear = next.next; + stop = next.next; + + continue; + } + + ear = next; + + // if we looped through the whole remaining polygon and can't find any more ears + if (ear === stop) { + // try filtering points and slicing again + if (!pass) { + earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1); + + // if this didn't work, try curing all small self-intersections locally + } else if (pass === 1) { + ear = cureLocalIntersections(ear, triangles, dim); + earcutLinked(ear, triangles, dim, minX, minY, invSize, 2); + + // as a last resort, try splitting the remaining polygon into two + } else if (pass === 2) { + splitEarcut(ear, triangles, dim, minX, minY, invSize); + } + + break; + } + } +} + +// check whether a polygon node forms a valid ear with adjacent nodes +function isEar(ear) { + var a = ear.prev, + b = ear, + c = ear.next; + + if (area(a, b, c) >= 0) return false; // reflex, can't be an ear + + // now make sure we don't have other points inside the potential ear + var p = ear.next.next; + + while (p !== ear.prev) { + if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && + area(p.prev, p, p.next) >= 0) return false; + p = p.next; + } + + return true; +} + +function isEarHashed(ear, minX, minY, invSize) { + var a = ear.prev, + b = ear, + c = ear.next; + + if (area(a, b, c) >= 0) return false; // reflex, can't be an ear + + // triangle bbox; min & max are calculated like this for speed + var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x), + minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y), + maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x), + maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y); + + // z-order range for the current triangle bbox; + var minZ = zOrder(minTX, minTY, minX, minY, invSize), + maxZ = zOrder(maxTX, maxTY, minX, minY, invSize); + + var p = ear.prevZ, + n = ear.nextZ; + + // look for points inside the triangle in both directions + while (p && p.z >= minZ && n && n.z <= maxZ) { + if (p !== ear.prev && p !== ear.next && + pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && + area(p.prev, p, p.next) >= 0) return false; + p = p.prevZ; + + if (n !== ear.prev && n !== ear.next && + pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) && + area(n.prev, n, n.next) >= 0) return false; + n = n.nextZ; + } + + // look for remaining points in decreasing z-order + while (p && p.z >= minZ) { + if (p !== ear.prev && p !== ear.next && + pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && + area(p.prev, p, p.next) >= 0) return false; + p = p.prevZ; + } + + // look for remaining points in increasing z-order + while (n && n.z <= maxZ) { + if (n !== ear.prev && n !== ear.next && + pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) && + area(n.prev, n, n.next) >= 0) return false; + n = n.nextZ; + } + + return true; +} + +// go through all polygon nodes and cure small local self-intersections +function cureLocalIntersections(start, triangles, dim) { + var p = start; + do { + var a = p.prev, + b = p.next.next; + + if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) { + + triangles.push(a.i / dim); + triangles.push(p.i / dim); + triangles.push(b.i / dim); + + // remove two nodes involved + removeNode(p); + removeNode(p.next); + + p = start = b; + } + p = p.next; + } while (p !== start); + + return p; +} + +// try splitting polygon into two and triangulate them independently +function splitEarcut(start, triangles, dim, minX, minY, invSize) { + // look for a valid diagonal that divides the polygon into two + var a = start; + do { + var b = a.next.next; + while (b !== a.prev) { + if (a.i !== b.i && isValidDiagonal(a, b)) { + // split the polygon in two by the diagonal + var c = splitPolygon(a, b); + + // filter colinear points around the cuts + a = filterPoints(a, a.next); + c = filterPoints(c, c.next); + + // run earcut on each half + earcutLinked(a, triangles, dim, minX, minY, invSize); + earcutLinked(c, triangles, dim, minX, minY, invSize); + return; + } + b = b.next; + } + a = a.next; + } while (a !== start); +} + +// link every hole into the outer loop, producing a single-ring polygon without holes +function eliminateHoles(data, holeIndices, outerNode, dim) { + var queue = [], + i, len, start, end, list; + + for (i = 0, len = holeIndices.length; i < len; i++) { + start = holeIndices[i] * dim; + end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; + list = linkedList(data, start, end, dim, false); + if (list === list.next) list.steiner = true; + queue.push(getLeftmost(list)); + } + + queue.sort(compareX); + + // process holes from left to right + for (i = 0; i < queue.length; i++) { + eliminateHole(queue[i], outerNode); + outerNode = filterPoints(outerNode, outerNode.next); + } + + return outerNode; +} + +function compareX(a, b) { + return a.x - b.x; +} + +// find a bridge between vertices that connects hole with an outer ring and and link it +function eliminateHole(hole, outerNode) { + outerNode = findHoleBridge(hole, outerNode); + if (outerNode) { + var b = splitPolygon(outerNode, hole); + filterPoints(b, b.next); + } +} + +// David Eberly's algorithm for finding a bridge between hole and outer polygon +function findHoleBridge(hole, outerNode) { + var p = outerNode, + hx = hole.x, + hy = hole.y, + qx = -Infinity, + m; + + // find a segment intersected by a ray from the hole's leftmost point to the left; + // segment's endpoint with lesser x will be potential connection point + do { + if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) { + var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y); + if (x <= hx && x > qx) { + qx = x; + if (x === hx) { + if (hy === p.y) return p; + if (hy === p.next.y) return p.next; + } + m = p.x < p.next.x ? p : p.next; + } + } + p = p.next; + } while (p !== outerNode); + + if (!m) return null; + + if (hx === qx) return m.prev; // hole touches outer segment; pick lower endpoint + + // look for points inside the triangle of hole point, segment intersection and endpoint; + // if there are no points found, we have a valid connection; + // otherwise choose the point of the minimum angle with the ray as connection point + + var stop = m, + mx = m.x, + my = m.y, + tanMin = Infinity, + tan; + + p = m.next; + + while (p !== stop) { + if (hx >= p.x && p.x >= mx && hx !== p.x && + pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) { + + tan = Math.abs(hy - p.y) / (hx - p.x); // tangential + + if ((tan < tanMin || (tan === tanMin && p.x > m.x)) && locallyInside(p, hole)) { + m = p; + tanMin = tan; + } + } + + p = p.next; + } + + return m; +} + +// interlink polygon nodes in z-order +function indexCurve(start, minX, minY, invSize) { + var p = start; + do { + if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize); + p.prevZ = p.prev; + p.nextZ = p.next; + p = p.next; + } while (p !== start); + + p.prevZ.nextZ = null; + p.prevZ = null; + + sortLinked(p); +} + +// Simon Tatham's linked list merge sort algorithm +// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html +function sortLinked(list) { + var i, p, q, e, tail, numMerges, pSize, qSize, + inSize = 1; + + do { + p = list; + list = null; + tail = null; + numMerges = 0; + + while (p) { + numMerges++; + q = p; + pSize = 0; + for (i = 0; i < inSize; i++) { + pSize++; + q = q.nextZ; + if (!q) break; + } + qSize = inSize; + + while (pSize > 0 || (qSize > 0 && q)) { + + if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) { + e = p; + p = p.nextZ; + pSize--; + } else { + e = q; + q = q.nextZ; + qSize--; + } + + if (tail) tail.nextZ = e; + else list = e; + + e.prevZ = tail; + tail = e; + } + + p = q; + } + + tail.nextZ = null; + inSize *= 2; + + } while (numMerges > 1); + + return list; +} + +// z-order of a point given coords and inverse of the longer side of data bbox +function zOrder(x, y, minX, minY, invSize) { + // coords are transformed into non-negative 15-bit integer range + x = 32767 * (x - minX) * invSize; + y = 32767 * (y - minY) * invSize; + + x = (x | (x << 8)) & 0x00FF00FF; + x = (x | (x << 4)) & 0x0F0F0F0F; + x = (x | (x << 2)) & 0x33333333; + x = (x | (x << 1)) & 0x55555555; + + y = (y | (y << 8)) & 0x00FF00FF; + y = (y | (y << 4)) & 0x0F0F0F0F; + y = (y | (y << 2)) & 0x33333333; + y = (y | (y << 1)) & 0x55555555; + + return x | (y << 1); +} + +// find the leftmost node of a polygon ring +function getLeftmost(start) { + var p = start, + leftmost = start; + do { + if (p.x < leftmost.x) leftmost = p; + p = p.next; + } while (p !== start); + + return leftmost; +} + +// check if a point lies within a convex triangle +function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) { + return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && + (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && + (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0; +} + +// check if a diagonal between two polygon nodes is valid (lies in polygon interior) +function isValidDiagonal(a, b) { + return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && + locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b); +} + +// signed area of a triangle +function area(p, q, r) { + return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); +} + +// check if two points are equal +function equals(p1, p2) { + return p1.x === p2.x && p1.y === p2.y; +} + +// check if two segments intersect +function intersects(p1, q1, p2, q2) { + if ((equals(p1, q1) && equals(p2, q2)) || + (equals(p1, q2) && equals(p2, q1))) return true; + return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 && + area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0; +} + +// check if a polygon diagonal intersects any polygon segments +function intersectsPolygon(a, b) { + var p = a; + do { + if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && + intersects(p, p.next, a, b)) return true; + p = p.next; + } while (p !== a); + + return false; +} + +// check if a polygon diagonal is locally inside the polygon +function locallyInside(a, b) { + return area(a.prev, a, a.next) < 0 ? + area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : + area(a, b, a.prev) < 0 || area(a, a.next, b) < 0; +} + +// check if the middle point of a polygon diagonal is inside the polygon +function middleInside(a, b) { + var p = a, + inside = false, + px = (a.x + b.x) / 2, + py = (a.y + b.y) / 2; + do { + if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y && + (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)) + inside = !inside; + p = p.next; + } while (p !== a); + + return inside; +} + +// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; +// if one belongs to the outer ring and another to a hole, it merges it into a single ring +function splitPolygon(a, b) { + var a2 = new Node(a.i, a.x, a.y), + b2 = new Node(b.i, b.x, b.y), + an = a.next, + bp = b.prev; + + a.next = b; + b.prev = a; + + a2.next = an; + an.prev = a2; + + b2.next = a2; + a2.prev = b2; + + bp.next = b2; + b2.prev = bp; + + return b2; +} + +// create a node and optionally link it with previous one (in a circular doubly linked list) +function insertNode(i, x, y, last) { + var p = new Node(i, x, y); + + if (!last) { + p.prev = p; + p.next = p; + + } else { + p.next = last.next; + p.prev = last; + last.next.prev = p; + last.next = p; + } + return p; +} + +function removeNode(p) { + p.next.prev = p.prev; + p.prev.next = p.next; + + if (p.prevZ) p.prevZ.nextZ = p.nextZ; + if (p.nextZ) p.nextZ.prevZ = p.prevZ; +} + +function Node(i, x, y) { + // vertex index in coordinates array + this.i = i; + + // vertex coordinates + this.x = x; + this.y = y; + + // previous and next vertex nodes in a polygon ring + this.prev = null; + this.next = null; + + // z-order curve value + this.z = null; + + // previous and next nodes in z-order + this.prevZ = null; + this.nextZ = null; + + // indicates whether this is a steiner point + this.steiner = false; +} + +// return a percentage difference between the polygon area and its triangulation area; +// used to verify correctness of triangulation +earcut.deviation = function (data, holeIndices, dim, triangles) { + var hasHoles = holeIndices && holeIndices.length; + var outerLen = hasHoles ? holeIndices[0] * dim : data.length; + + var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim)); + if (hasHoles) { + for (var i = 0, len = holeIndices.length; i < len; i++) { + var start = holeIndices[i] * dim; + var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; + polygonArea -= Math.abs(signedArea(data, start, end, dim)); + } + } + + var trianglesArea = 0; + for (i = 0; i < triangles.length; i += 3) { + var a = triangles[i] * dim; + var b = triangles[i + 1] * dim; + var c = triangles[i + 2] * dim; + trianglesArea += Math.abs( + (data[a] - data[c]) * (data[b + 1] - data[a + 1]) - + (data[a] - data[b]) * (data[c + 1] - data[a + 1])); + } + + return polygonArea === 0 && trianglesArea === 0 ? 0 : + Math.abs((trianglesArea - polygonArea) / polygonArea); +}; + +function signedArea(data, start, end, dim) { + var sum = 0; + for (var i = start, j = end - dim; i < end; i += dim) { + sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]); + j = i; + } + return sum; +} + +// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts +earcut.flatten = function (data) { + var dim = data[0][0].length, + result = {vertices: [], holes: [], dimensions: dim}, + holeIndex = 0; + + for (var i = 0; i < data.length; i++) { + for (var j = 0; j < data[i].length; j++) { + for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]); + } + if (i > 0) { + holeIndex += data[i - 1].length; + result.holes.push(holeIndex); + } + } + return result; +}; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Shallow Object Clone. Will not clone nested objects. + * + * @function Phaser.Utils.Objects.Clone + * @since 3.0.0 + * + * @param {object} obj - the object from which to clone + * + * @return {object} a new object with the same properties as the input obj + */ +var Clone = function (obj) +{ + var clone = {}; + + for (var key in obj) + { + if (Array.isArray(obj[key])) + { + clone[key] = obj[key].slice(0); + } + else + { + clone[key] = obj[key]; + } + } + + return clone; +}; + +module.exports = Clone; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Sound.Events + */ + +module.exports = { + + COMPLETE: __webpack_require__(851), + DECODED: __webpack_require__(852), + DECODED_ALL: __webpack_require__(853), + DESTROY: __webpack_require__(854), + DETUNE: __webpack_require__(855), + GLOBAL_DETUNE: __webpack_require__(856), + GLOBAL_MUTE: __webpack_require__(857), + GLOBAL_RATE: __webpack_require__(858), + GLOBAL_VOLUME: __webpack_require__(859), + LOOP: __webpack_require__(860), + LOOPED: __webpack_require__(861), + MUTE: __webpack_require__(862), + PAUSE_ALL: __webpack_require__(863), + PAUSE: __webpack_require__(864), + PLAY: __webpack_require__(865), + RATE: __webpack_require__(866), + RESUME_ALL: __webpack_require__(867), + RESUME: __webpack_require__(868), + SEEK: __webpack_require__(869), + STOP_ALL: __webpack_require__(870), + STOP: __webpack_require__(871), + UNLOCKED: __webpack_require__(872), + VOLUME: __webpack_require__(873) + +}; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Tests if the start and end indexes are a safe range for the given array. + * + * @function Phaser.Utils.Array.SafeRange + * @since 3.4.0 + * + * @param {array} array - The array to check. + * @param {integer} startIndex - The start index. + * @param {integer} endIndex - The end index. + * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. + * + * @return {boolean} True if the range is safe, otherwise false. + */ +var SafeRange = function (array, startIndex, endIndex, throwError) +{ + var len = array.length; + + if (startIndex < 0 || + startIndex > len || + startIndex >= endIndex || + endIndex > len || + startIndex + endIndex > len) + { + if (throwError) + { + throw new Error('Range Error: Values outside acceptable range'); + } + + return false; + } + else + { + return true; + } +}; + +module.exports = SafeRange; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var GameObject = __webpack_require__(13); +var SpriteRender = __webpack_require__(926); + +/** + * @classdesc + * A Sprite Game Object. + * + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + * + * @class Sprite + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.TextureCrop + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + */ +var Sprite = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.Depth, + Components.Flip, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Size, + Components.TextureCrop, + Components.Tint, + Components.Transform, + Components.Visible, + SpriteRender + ], + + initialize: + + function Sprite (scene, x, y, texture, frame) + { + GameObject.call(this, scene, 'Sprite'); + + /** + * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. + * + * @name Phaser.GameObjects.Sprite#_crop + * @type {object} + * @private + * @since 3.11.0 + */ + this._crop = this.resetCropObject(); + + /** + * The Animation Controller of this Sprite. + * + * @name Phaser.GameObjects.Sprite#anims + * @type {Phaser.GameObjects.Components.Animation} + * @since 3.0.0 + */ + this.anims = new Components.Animation(this); + + this.setTexture(texture, frame); + this.setPosition(x, y); + this.setSizeToFrame(); + this.setOriginFromFrame(); + this.initPipeline(); + }, + + /** + * Update this Sprite's animations. + * + * @method Phaser.GameObjects.Sprite#preUpdate + * @protected + * @since 3.0.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + this.anims.update(time, delta); + }, + + /** + * Start playing the given animation. + * + * @method Phaser.GameObjects.Sprite#play + * @since 3.0.0 + * + * @param {string} key - The string-based key of the animation to play. + * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. + * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. + * + * @return {Phaser.GameObjects.Sprite} This Game Object. + */ + play: function (key, ignoreIfPlaying, startFrame) + { + this.anims.play(key, ignoreIfPlaying, startFrame); + + return this; + }, + + /** + * Build a JSON representation of this Sprite. + * + * @method Phaser.GameObjects.Sprite#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + var data = Components.ToJSON(this); + + // Extra Sprite data is added here + + return data; + }, + + /** + * Handles the pre-destroy step for the Sprite, which removes the Animation component. + * + * @method Phaser.GameObjects.Sprite#preDestroy + * @private + * @since 3.14.0 + */ + preDestroy: function () + { + this.anims.destroy(); + + this.anims = undefined; + } + +}); + +module.exports = Sprite; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders a stroke outline around the given Shape. + * + * @method Phaser.GameObjects.Shape#StrokePathWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The WebGL Pipeline used to render this Shape. + * @param {Phaser.GameObjects.Shape} src - The Game Object shape being rendered in this call. + * @param {number} alpha - The base alpha value. + * @param {number} dx - The source displayOriginX. + * @param {number} dy - The source displayOriginY. + */ +var StrokePathWebGL = function (pipeline, src, alpha, dx, dy) +{ + var strokeTint = pipeline.strokeTint; + var strokeTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.strokeColor, src.strokeAlpha * alpha); + + strokeTint.TL = strokeTintColor; + strokeTint.TR = strokeTintColor; + strokeTint.BL = strokeTintColor; + strokeTint.BR = strokeTintColor; + + var path = src.pathData; + var pathLength = path.length - 1; + var lineWidth = src.lineWidth; + var halfLineWidth = lineWidth / 2; + + var px1 = path[0] - dx; + var py1 = path[1] - dy; + + if (!src.closePath) + { + pathLength -= 2; + } + + for (var i = 2; i < pathLength; i += 2) + { + var px2 = path[i] - dx; + var py2 = path[i + 1] - dy; + + pipeline.setTexture2D(); + + pipeline.batchLine( + px1, + py1, + px2, + py2, + halfLineWidth, + halfLineWidth, + lineWidth, + i - 2, + (src.closePath) ? (i === pathLength - 1) : false + ); + + px1 = px2; + py1 = py2; + } +}; + +module.exports = StrokePathWebGL; + + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Contains = __webpack_require__(81); +var GetPoint = __webpack_require__(396); +var GetPoints = __webpack_require__(397); +var Line = __webpack_require__(54); +var Random = __webpack_require__(153); + +/** + * @classdesc + * A triangle is a plane created by connecting three points. + * The first two arguments specify the first point, the middle two arguments + * specify the second point, and the last two arguments specify the third point. + * + * @class Triangle + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x1=0] - `x` coordinate of the first point. + * @param {number} [y1=0] - `y` coordinate of the first point. + * @param {number} [x2=0] - `x` coordinate of the second point. + * @param {number} [y2=0] - `y` coordinate of the second point. + * @param {number} [x3=0] - `x` coordinate of the third point. + * @param {number} [y3=0] - `y` coordinate of the third point. + */ +var Triangle = new Class({ + + initialize: + + function Triangle (x1, y1, x2, y2, x3, y3) + { + if (x1 === undefined) { x1 = 0; } + if (y1 === undefined) { y1 = 0; } + if (x2 === undefined) { x2 = 0; } + if (y2 === undefined) { y2 = 0; } + if (x3 === undefined) { x3 = 0; } + if (y3 === undefined) { y3 = 0; } + + /** + * `x` coordinate of the first point. + * + * @name Phaser.Geom.Triangle#x1 + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x1 = x1; + + /** + * `y` coordinate of the first point. + * + * @name Phaser.Geom.Triangle#y1 + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y1 = y1; + + /** + * `x` coordinate of the second point. + * + * @name Phaser.Geom.Triangle#x2 + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x2 = x2; + + /** + * `y` coordinate of the second point. + * + * @name Phaser.Geom.Triangle#y2 + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y2 = y2; + + /** + * `x` coordinate of the third point. + * + * @name Phaser.Geom.Triangle#x3 + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x3 = x3; + + /** + * `y` coordinate of the third point. + * + * @name Phaser.Geom.Triangle#y3 + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y3 = y3; + }, + + /** + * Checks whether a given points lies within the triangle. + * + * @method Phaser.Geom.Triangle#contains + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the point to check. + * @param {number} y - The y coordinate of the point to check. + * + * @return {boolean} `true` if the coordinate pair is within the triangle, otherwise `false`. + */ + contains: function (x, y) + { + return Contains(this, x, y); + }, + + /** + * Returns a specific point on the triangle. + * + * @method Phaser.Geom.Triangle#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [output,$return] + * + * @param {number} position - Position as float within `0` and `1`. `0` equals the first point. + * @param {(Phaser.Geom.Point|object)} [output] - Optional Point, or point-like object, that the calculated point will be written to. + * + * @return {(Phaser.Geom.Point|object)} Calculated `Point` that represents the requested position. It is the same as `output` when this parameter has been given. + */ + getPoint: function (position, output) + { + return GetPoint(this, position, output); + }, + + /** + * Calculates a list of evenly distributed points on the triangle. It is either possible to pass an amount of points to be generated (`quantity`) or the distance between two points (`stepRate`). + * + * @method Phaser.Geom.Triangle#getPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [output,$return] + * + * @param {integer} quantity - Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. + * @param {number} [stepRate] - Distance between two points. Will only be used when `quantity` is falsey. + * @param {(array|Phaser.Geom.Point[])} [output] - Optional Array for writing the calculated points into. Otherwise a new array will be created. + * + * @return {(array|Phaser.Geom.Point[])} Returns a list of calculated `Point` instances or the filled array passed as parameter `output`. + */ + getPoints: function (quantity, stepRate, output) + { + return GetPoints(this, quantity, stepRate, output); + }, + + /** + * Returns a random point along the triangle. + * + * @method Phaser.Geom.Triangle#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} [point] - Optional `Point` that should be modified. Otherwise a new one will be created. + * + * @return {Phaser.Geom.Point} Random `Point`. When parameter `point` has been provided it will be returned. + */ + getRandomPoint: function (point) + { + return Random(this, point); + }, + + /** + * Sets all three points of the triangle. Leaving out any coordinate sets it to be `0`. + * + * @method Phaser.Geom.Triangle#setTo + * @since 3.0.0 + * + * @param {number} [x1=0] - `x` coordinate of the first point. + * @param {number} [y1=0] - `y` coordinate of the first point. + * @param {number} [x2=0] - `x` coordinate of the second point. + * @param {number} [y2=0] - `y` coordinate of the second point. + * @param {number} [x3=0] - `x` coordinate of the third point. + * @param {number} [y3=0] - `y` coordinate of the third point. + * + * @return {Phaser.Geom.Triangle} This Triangle object. + */ + setTo: function (x1, y1, x2, y2, x3, y3) + { + if (x1 === undefined) { x1 = 0; } + if (y1 === undefined) { y1 = 0; } + if (x2 === undefined) { x2 = 0; } + if (y2 === undefined) { y2 = 0; } + if (x3 === undefined) { x3 = 0; } + if (y3 === undefined) { y3 = 0; } + + this.x1 = x1; + this.y1 = y1; + + this.x2 = x2; + this.y2 = y2; + + this.x3 = x3; + this.y3 = y3; + + return this; + }, + + /** + * Returns a Line object that corresponds to Line A of this Triangle. + * + * @method Phaser.Geom.Triangle#getLineA + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to line A of this Triangle. + */ + getLineA: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x1, this.y1, this.x2, this.y2); + + return line; + }, + + /** + * Returns a Line object that corresponds to Line B of this Triangle. + * + * @method Phaser.Geom.Triangle#getLineB + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to line B of this Triangle. + */ + getLineB: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x2, this.y2, this.x3, this.y3); + + return line; + }, + + /** + * Returns a Line object that corresponds to Line C of this Triangle. + * + * @method Phaser.Geom.Triangle#getLineC + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to line C of this Triangle. + */ + getLineC: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x3, this.y3, this.x1, this.y1); + + return line; + }, + + /** + * Left most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. + * + * @name Phaser.Geom.Triangle#left + * @type {number} + * @since 3.0.0 + */ + left: { + + get: function () + { + return Math.min(this.x1, this.x2, this.x3); + }, + + set: function (value) + { + var diff = 0; + + if (this.x1 <= this.x2 && this.x1 <= this.x3) + { + diff = this.x1 - value; + } + else if (this.x2 <= this.x1 && this.x2 <= this.x3) + { + diff = this.x2 - value; + } + else + { + diff = this.x3 - value; + } + + this.x1 -= diff; + this.x2 -= diff; + this.x3 -= diff; + } + + }, + + /** + * Right most X coordinate of the triangle. Setting it moves the triangle on the X axis accordingly. + * + * @name Phaser.Geom.Triangle#right + * @type {number} + * @since 3.0.0 + */ + right: { + + get: function () + { + return Math.max(this.x1, this.x2, this.x3); + }, + + set: function (value) + { + var diff = 0; + + if (this.x1 >= this.x2 && this.x1 >= this.x3) + { + diff = this.x1 - value; + } + else if (this.x2 >= this.x1 && this.x2 >= this.x3) + { + diff = this.x2 - value; + } + else + { + diff = this.x3 - value; + } + + this.x1 -= diff; + this.x2 -= diff; + this.x3 -= diff; + } + + }, + + /** + * Top most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. + * + * @name Phaser.Geom.Triangle#top + * @type {number} + * @since 3.0.0 + */ + top: { + + get: function () + { + return Math.min(this.y1, this.y2, this.y3); + }, + + set: function (value) + { + var diff = 0; + + if (this.y1 <= this.y2 && this.y1 <= this.y3) + { + diff = this.y1 - value; + } + else if (this.y2 <= this.y1 && this.y2 <= this.y3) + { + diff = this.y2 - value; + } + else + { + diff = this.y3 - value; + } + + this.y1 -= diff; + this.y2 -= diff; + this.y3 -= diff; + } + + }, + + /** + * Bottom most Y coordinate of the triangle. Setting it moves the triangle on the Y axis accordingly. + * + * @name Phaser.Geom.Triangle#bottom + * @type {number} + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return Math.max(this.y1, this.y2, this.y3); + }, + + set: function (value) + { + var diff = 0; + + if (this.y1 >= this.y2 && this.y1 >= this.y3) + { + diff = this.y1 - value; + } + else if (this.y2 >= this.y1 && this.y2 >= this.y3) + { + diff = this.y2 - value; + } + else + { + diff = this.y3 - value; + } + + this.y1 -= diff; + this.y2 -= diff; + this.y3 -= diff; + } + + } + +}); + +module.exports = Triangle; + + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. + * + * @class ImageFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. + */ +var ImageFile = new Class({ + + Extends: File, + + initialize: + + function ImageFile (loader, key, url, xhrSettings, frameConfig) + { + var extension = 'png'; + var normalMapURL; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + normalMapURL = GetFastValue(config, 'normalMap'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + frameConfig = GetFastValue(config, 'frameConfig'); + } + + if (Array.isArray(url)) + { + normalMapURL = url[1]; + url = url[0]; + } + + var fileConfig = { + type: 'image', + cache: loader.textureManager, + extension: extension, + responseType: 'blob', + key: key, + url: url, + xhrSettings: xhrSettings, + config: frameConfig + }; + + File.call(this, loader, fileConfig); + + // Do we have a normal map to load as well? + if (normalMapURL) + { + var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); + + normalMap.type = 'normalMap'; + + this.setLink(normalMap); + + loader.addFile(normalMap); + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.ImageFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + var _this = this; + + this.data.onload = function () + { + File.revokeObjectURL(_this.data); + + _this.onProcessComplete(); + }; + + this.data.onerror = function () + { + File.revokeObjectURL(_this.data); + + _this.onProcessError(); + }; + + File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture; + var linkFile = this.linkFile; + + if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + { + if (this.type === 'image') + { + texture = this.cache.addImage(this.key, this.data, linkFile.data); + } + else + { + texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); + } + + this.pendingDestroy(texture); + + linkFile.pendingDestroy(texture); + } + else if (!linkFile) + { + texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } + } + +}); + +/** + * Adds an Image, or array of Images, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.image('logo', 'images/phaserLogo.png'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.image('logo', 'images/AtariLogo.png'); + * // and later in your game ... + * this.add.image(x, y, 'logo'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#image + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('image', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new ImageFile(this, key[i])); + } + } + else + { + this.addFile(new ImageFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = ImageFile; + + +/***/ }), +/* 71 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Internally used method to set the colliding state of a tile. This does not recalculate + * interesting faces. + * + * @function Phaser.Tilemaps.Components.SetTileCollision + * @private + * @since 3.0.0 + * + * @param {Phaser.Tilemaps.Tile} tile - The Tile to set the collision on. + * @param {boolean} [collides=true] - Should the tile index collide or not? + */ +var SetTileCollision = function (tile, collides) +{ + if (collides) + { + tile.setCollision(true, true, true, true, false); + } + else + { + tile.resetCollision(false); + } +}; + +module.exports = SetTileCollision; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var Rectangle = __webpack_require__(417); + +/** + * @classdesc + * A Tile is a representation of a single tile within the Tilemap. This is a lightweight data + * representation, so its position information is stored without factoring in scroll, layer + * scale or layer position. + * + * @class Tile + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Tilemaps.LayerData} layer - The LayerData object in the Tilemap that this tile belongs to. + * @param {integer} index - The unique index of this tile within the map. + * @param {integer} x - The x coordinate of this tile in tile coordinates. + * @param {integer} y - The y coordinate of this tile in tile coordinates. + * @param {integer} width - Width of the tile in pixels. + * @param {integer} height - Height of the tile in pixels. + * @param {integer} baseWidth - The base width a tile in the map (in pixels). Tiled maps support + * multiple tileset sizes within one map, but they are still placed at intervals of the base + * tile width. + * @param {integer} baseHeight - The base height of the tile in pixels (in pixels). Tiled maps + * support multiple tileset sizes within one map, but they are still placed at intervals of the + * base tile height. + */ +var Tile = new Class({ + + Mixins: [ + Components.Alpha, + Components.Flip, + Components.Visible + ], + + initialize: + + function Tile (layer, index, x, y, width, height, baseWidth, baseHeight) + { + /** + * The LayerData in the Tilemap data that this tile belongs to. + * + * @name Phaser.Tilemaps.Tile#layer + * @type {Phaser.Tilemaps.LayerData} + * @since 3.0.0 + */ + this.layer = layer; + + /** + * The index of this tile within the map data corresponding to the tileset, or -1 if this + * represents a blank tile. + * + * @name Phaser.Tilemaps.Tile#index + * @type {integer} + * @since 3.0.0 + */ + this.index = index; + + /** + * The x map coordinate of this tile in tile units. + * + * @name Phaser.Tilemaps.Tile#x + * @type {integer} + * @since 3.0.0 + */ + this.x = x; + + /** + * The y map coordinate of this tile in tile units. + * + * @name Phaser.Tilemaps.Tile#y + * @type {integer} + * @since 3.0.0 + */ + this.y = y; + + /** + * The width of the tile in pixels. + * + * @name Phaser.Tilemaps.Tile#width + * @type {integer} + * @since 3.0.0 + */ + this.width = width; + + /** + * The height of the tile in pixels. + * + * @name Phaser.Tilemaps.Tile#height + * @type {integer} + * @since 3.0.0 + */ + this.height = height; + + /** + * The map's base width of a tile in pixels. Tiled maps support multiple tileset sizes + * within one map, but they are still placed at intervals of the base tile size. + * + * @name Phaser.Tilemaps.Tile#baseWidth + * @type {integer} + * @since 3.0.0 + */ + this.baseWidth = (baseWidth !== undefined) ? baseWidth : width; + + /** + * The map's base height of a tile in pixels. Tiled maps support multiple tileset sizes + * within one map, but they are still placed at intervals of the base tile size. + * + * @name Phaser.Tilemaps.Tile#baseHeight + * @type {integer} + * @since 3.0.0 + */ + this.baseHeight = (baseHeight !== undefined) ? baseHeight : height; + + /** + * The x coordinate of the top left of this tile in pixels. This is relative to the top left + * of the layer this tile is being rendered within. This property does NOT factor in camera + * scroll, layer scale or layer position. + * + * @name Phaser.Tilemaps.Tile#pixelX + * @type {number} + * @since 3.0.0 + */ + this.pixelX = 0; + + /** + * The y coordinate of the top left of this tile in pixels. This is relative to the top left + * of the layer this tile is being rendered within. This property does NOT factor in camera + * scroll, layer scale or layer position. + * + * @name Phaser.Tilemaps.Tile#pixelY + * @type {number} + * @since 3.0.0 + */ + this.pixelY = 0; + + this.updatePixelXY(); + + /** + * Tile specific properties. These usually come from Tiled. + * + * @name Phaser.Tilemaps.Tile#properties + * @type {any} + * @since 3.0.0 + */ + this.properties = {}; + + /** + * The rotation angle of this tile. + * + * @name Phaser.Tilemaps.Tile#rotation + * @type {number} + * @since 3.0.0 + */ + this.rotation = 0; + + /** + * Whether the tile should collide with any object on the left side. + * + * @name Phaser.Tilemaps.Tile#collideLeft + * @type {boolean} + * @since 3.0.0 + */ + this.collideLeft = false; + + /** + * Whether the tile should collide with any object on the right side. + * + * @name Phaser.Tilemaps.Tile#collideRight + * @type {boolean} + * @since 3.0.0 + */ + this.collideRight = false; + + /** + * Whether the tile should collide with any object on the top side. + * + * @name Phaser.Tilemaps.Tile#collideUp + * @type {boolean} + * @since 3.0.0 + */ + this.collideUp = false; + + /** + * Whether the tile should collide with any object on the bottom side. + * + * @name Phaser.Tilemaps.Tile#collideDown + * @type {boolean} + * @since 3.0.0 + */ + this.collideDown = false; + + /** + * Whether the tile's left edge is interesting for collisions. + * + * @name Phaser.Tilemaps.Tile#faceLeft + * @type {boolean} + * @since 3.0.0 + */ + this.faceLeft = false; + + /** + * Whether the tile's right edge is interesting for collisions. + * + * @name Phaser.Tilemaps.Tile#faceRight + * @type {boolean} + * @since 3.0.0 + */ + this.faceRight = false; + + /** + * Whether the tile's top edge is interesting for collisions. + * + * @name Phaser.Tilemaps.Tile#faceTop + * @type {boolean} + * @since 3.0.0 + */ + this.faceTop = false; + + /** + * Whether the tile's bottom edge is interesting for collisions. + * + * @name Phaser.Tilemaps.Tile#faceBottom + * @type {boolean} + * @since 3.0.0 + */ + this.faceBottom = false; + + /** + * Tile collision callback. + * + * @name Phaser.Tilemaps.Tile#collisionCallback + * @type {function} + * @since 3.0.0 + */ + this.collisionCallback = null; + + /** + * The context in which the collision callback will be called. + * + * @name Phaser.Tilemaps.Tile#collisionCallbackContext + * @type {object} + * @since 3.0.0 + */ + this.collisionCallbackContext = this; + + /** + * The tint to apply to this tile. Note: tint is currently a single color value instead of + * the 4 corner tint component on other GameObjects. + * + * @name Phaser.Tilemaps.Tile#tint + * @type {number} + * @default + * @since 3.0.0 + */ + this.tint = 0xffffff; + + /** + * An empty object where physics-engine specific information (e.g. bodies) may be stored. + * + * @name Phaser.Tilemaps.Tile#physics + * @type {object} + * @since 3.0.0 + */ + this.physics = {}; + }, + + /** + * Check if the given x and y world coordinates are within this Tile. This does not factor in + * camera scroll, layer scale or layer position. + * + * @method Phaser.Tilemaps.Tile#containsPoint + * @since 3.0.0 + * + * @param {number} x - The x coordinate to test. + * @param {number} y - The y coordinate to test. + * + * @return {boolean} True if the coordinates are within this Tile, otherwise false. + */ + containsPoint: function (x, y) + { + return !(x < this.pixelX || y < this.pixelY || x > this.right || y > this.bottom); + }, + + /** + * Copies the tile data & properties from the given tile to this tile. This copies everything + * except for position and interesting faces. + * + * @method Phaser.Tilemaps.Tile#copy + * @since 3.0.0 + * + * @param {Phaser.Tilemaps.Tile} tile - The tile to copy from. + * + * @return {Phaser.Tilemaps.Tile} This Tile object. + */ + copy: function (tile) + { + this.index = tile.index; + this.alpha = tile.alpha; + this.properties = tile.properties; + this.visible = tile.visible; + this.setFlip(tile.flipX, tile.flipY); + this.tint = tile.tint; + this.rotation = tile.rotation; + this.collideUp = tile.collideUp; + this.collideDown = tile.collideDown; + this.collideLeft = tile.collideLeft; + this.collideRight = tile.collideRight; + this.collisionCallback = tile.collisionCallback; + this.collisionCallbackContext = tile.collisionCallbackContext; + + return this; + }, + + /** + * The collision group for this Tile, defined within the Tileset. This returns a reference to + * the collision group stored within the Tileset, so any modification of the returned object + * will impact all tiles that have the same index as this tile. + * + * @method Phaser.Tilemaps.Tile#getCollisionGroup + * @since 3.0.0 + * + * @return {?object} tileset + */ + getCollisionGroup: function () + { + return this.tileset ? this.tileset.getTileCollisionGroup(this.index) : null; + }, + + /** + * The tile data for this Tile, defined within the Tileset. This typically contains Tiled + * collision data, tile animations and terrain information. This returns a reference to the tile + * data stored within the Tileset, so any modification of the returned object will impact all + * tiles that have the same index as this tile. + * + * @method Phaser.Tilemaps.Tile#getTileData + * @since 3.0.0 + * + * @return {?object} tileset + */ + getTileData: function () + { + return this.tileset ? this.tileset.getTileData(this.index) : null; + }, + + /** + * Gets the world X position of the left side of the tile, factoring in the layers position, + * scale and scroll. + * + * @method Phaser.Tilemaps.Tile#getLeft + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. + * + * @return {number} + */ + getLeft: function (camera) + { + var tilemapLayer = this.tilemapLayer; + + return (tilemapLayer) ? tilemapLayer.tileToWorldX(this.x, camera) : this.x * this.baseWidth; + }, + + /** + * Gets the world X position of the right side of the tile, factoring in the layer's position, + * scale and scroll. + * + * @method Phaser.Tilemaps.Tile#getRight + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. + * + * @return {number} + */ + getRight: function (camera) + { + var tilemapLayer = this.tilemapLayer; + + return (tilemapLayer) ? this.getLeft(camera) + this.width * tilemapLayer.scaleX : this.getLeft(camera) + this.width; + }, + + /** + * Gets the world Y position of the top side of the tile, factoring in the layer's position, + * scale and scroll. + * + * @method Phaser.Tilemaps.Tile#getTop + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. + * + * @return {number} + */ + getTop: function (camera) + { + var tilemapLayer = this.tilemapLayer; + + // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile in grid + // units is the bottom left, so the y coordinate needs to be adjusted by the difference + // between the base size and this tile's size. + return tilemapLayer + ? tilemapLayer.tileToWorldY(this.y, camera) - (this.height - this.baseHeight) * tilemapLayer.scaleY + : this.y * this.baseHeight - (this.height - this.baseHeight); + }, + + /** + * Gets the world Y position of the bottom side of the tile, factoring in the layer's position, + * scale and scroll. + + * @method Phaser.Tilemaps.Tile#getBottom + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. + * + * @return {number} + */ + getBottom: function (camera) + { + var tilemapLayer = this.tilemapLayer; + return tilemapLayer + ? this.getTop(camera) + this.height * tilemapLayer.scaleY + : this.getTop(camera) + this.height; + }, + + + /** + * Gets the world rectangle bounding box for the tile, factoring in the layers position, + * scale and scroll. + * + * @method Phaser.Tilemaps.Tile#getBounds + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. + * @param {object} [output] - [description] + * + * @return {(Phaser.Geom.Rectangle|object)} + */ + getBounds: function (camera, output) + { + if (output === undefined) { output = new Rectangle(); } + + output.x = this.getLeft(); + output.y = this.getTop(); + output.width = this.getRight() - output.x; + output.height = this.getBottom() - output.y; + + return output; + }, + + /** + * Gets the world X position of the center of the tile, factoring in the layer's position, + * scale and scroll. + * + * @method Phaser.Tilemaps.Tile#getCenterX + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. + * + * @return {number} + */ + getCenterX: function (camera) + { + return (this.getLeft(camera) + this.getRight(camera)) / 2; + }, + + /** + * Gets the world Y position of the center of the tile, factoring in the layer's position, + * scale and scroll. + * + * @method Phaser.Tilemaps.Tile#getCenterY + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. + * + * @return {number} + */ + getCenterY: function (camera) + { + return (this.getTop(camera) + this.getBottom(camera)) / 2; + }, + + /** + * Clean up memory. + * + * @method Phaser.Tilemaps.Tile#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.collisionCallback = undefined; + this.collisionCallbackContext = undefined; + this.properties = undefined; + }, + + /** + * Check for intersection with this tile. This does not factor in camera scroll, layer scale or + * layer position. + * + * @method Phaser.Tilemaps.Tile#intersects + * @since 3.0.0 + * + * @param {number} x - The x axis in pixels. + * @param {number} y - The y axis in pixels. + * @param {number} right - The right point. + * @param {number} bottom - The bottom point. + * + * @return {boolean} + */ + intersects: function (x, y, right, bottom) + { + return !( + right <= this.pixelX || bottom <= this.pixelY || + x >= this.right || y >= this.bottom + ); + }, + + /** + * Checks if the tile is interesting. + * + * @method Phaser.Tilemaps.Tile#isInteresting + * @since 3.0.0 + * + * @param {boolean} collides - If true, will consider the tile interesting if it collides on any side. + * @param {boolean} faces - If true, will consider the tile interesting if it has an interesting face. + * + * @return {boolean} True if the Tile is interesting, otherwise false. + */ + isInteresting: function (collides, faces) + { + if (collides && faces) { return (this.canCollide || this.hasInterestingFace); } + else if (collides) { return this.collides; } + else if (faces) { return this.hasInterestingFace; } + return false; + }, + + /** + * Reset collision status flags. + * + * @method Phaser.Tilemaps.Tile#resetCollision + * @since 3.0.0 + * + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces for this tile and its neighbors. + * + * @return {Phaser.Tilemaps.Tile} This Tile object. + */ + resetCollision: function (recalculateFaces) + { + if (recalculateFaces === undefined) { recalculateFaces = true; } + + this.collideLeft = false; + this.collideRight = false; + this.collideUp = false; + this.collideDown = false; + + this.faceTop = false; + this.faceBottom = false; + this.faceLeft = false; + this.faceRight = false; + + if (recalculateFaces) + { + var tilemapLayer = this.tilemapLayer; + + if (tilemapLayer) + { + this.tilemapLayer.calculateFacesAt(this.x, this.y); + } + } + + return this; + }, + + /** + * Reset faces. + * + * @method Phaser.Tilemaps.Tile#resetFaces + * @since 3.0.0 + * + * @return {Phaser.Tilemaps.Tile} This Tile object. + */ + resetFaces: function () + { + this.faceTop = false; + this.faceBottom = false; + this.faceLeft = false; + this.faceRight = false; + + return this; + }, + + /** + * Sets the collision flags for each side of this tile and updates the interesting faces list. + * + * @method Phaser.Tilemaps.Tile#setCollision + * @since 3.0.0 + * + * @param {boolean} left - Indicating collide with any object on the left. + * @param {boolean} [right] - Indicating collide with any object on the right. + * @param {boolean} [up] - Indicating collide with any object on the top. + * @param {boolean} [down] - Indicating collide with any object on the bottom. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces + * for this tile and its neighbors. + * + * @return {Phaser.Tilemaps.Tile} This Tile object. + */ + setCollision: function (left, right, up, down, recalculateFaces) + { + if (right === undefined) { right = left; } + if (up === undefined) { up = left; } + if (down === undefined) { down = left; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + + this.collideLeft = left; + this.collideRight = right; + this.collideUp = up; + this.collideDown = down; + + this.faceLeft = left; + this.faceRight = right; + this.faceTop = up; + this.faceBottom = down; + + if (recalculateFaces) + { + var tilemapLayer = this.tilemapLayer; + + if (tilemapLayer) + { + this.tilemapLayer.calculateFacesAt(this.x, this.y); + } + } + + return this; + }, + + /** + * Set a callback to be called when this tile is hit by an object. The callback must true for + * collision processing to take place. + * + * @method Phaser.Tilemaps.Tile#setCollisionCallback + * @since 3.0.0 + * + * @param {function} callback - Callback function. + * @param {object} context - Callback will be called within this context. + * + * @return {Phaser.Tilemaps.Tile} This Tile object. + */ + setCollisionCallback: function (callback, context) + { + if (callback === null) + { + this.collisionCallback = undefined; + this.collisionCallbackContext = undefined; + } + else + { + this.collisionCallback = callback; + this.collisionCallbackContext = context; + } + + return this; + }, + + /** + * Sets the size of the tile and updates its pixelX and pixelY. + * + * @method Phaser.Tilemaps.Tile#setSize + * @since 3.0.0 + * + * @param {integer} tileWidth - The width of the tile in pixels. + * @param {integer} tileHeight - The height of the tile in pixels. + * @param {integer} baseWidth - The base width a tile in the map (in pixels). + * @param {integer} baseHeight - The base height of the tile in pixels (in pixels). + * + * @return {Phaser.Tilemaps.Tile} This Tile object. + */ + setSize: function (tileWidth, tileHeight, baseWidth, baseHeight) + { + if (tileWidth !== undefined) { this.width = tileWidth; } + if (tileHeight !== undefined) { this.height = tileHeight; } + if (baseWidth !== undefined) { this.baseWidth = baseWidth; } + if (baseHeight !== undefined) { this.baseHeight = baseHeight; } + + this.updatePixelXY(); + + return this; + }, + + /** + * Used internally. Updates the tile's world XY position based on the current tile size. + * + * @method Phaser.Tilemaps.Tile#updatePixelXY + * @since 3.0.0 + * + * @return {Phaser.Tilemaps.Tile} This Tile object. + */ + updatePixelXY: function () + { + // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the + // bottom left, while the Phaser renderer assumes the origin is the top left. The y + // coordinate needs to be adjusted by the difference. + this.pixelX = this.x * this.baseWidth; + this.pixelY = this.y * this.baseHeight; + + // this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight); + + return this; + }, + + /** + * True if this tile can collide on any of its faces or has a collision callback set. + * + * @name Phaser.Tilemaps.Tile#canCollide + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + canCollide: { + get: function () + { + return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback); + } + }, + + /** + * True if this tile can collide on any of its faces. + * + * @name Phaser.Tilemaps.Tile#collides + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + collides: { + get: function () + { + return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown); + } + }, + + /** + * True if this tile has any interesting faces. + * + * @name Phaser.Tilemaps.Tile#hasInterestingFace + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + hasInterestingFace: { + get: function () + { + return (this.faceTop || this.faceBottom || this.faceLeft || this.faceRight); + } + }, + + /** + * The tileset that contains this Tile. This is null if accessed from a LayerData instance + * before the tile is placed in a StaticTilemapLayer or DynamicTilemapLayer, or if the tile has + * an index that doesn't correspond to any of the map's tilesets. + * + * @name Phaser.Tilemaps.Tile#tileset + * @type {?Phaser.Tilemaps.Tileset} + * @readonly + * @since 3.0.0 + */ + tileset: { + + get: function () + { + var tilemapLayer = this.layer.tilemapLayer; + + if (tilemapLayer) + { + var tileset = tilemapLayer.gidMap[this.index]; + + if (tileset) + { + return tileset; + } + } + + return null; + } + + }, + + /** + * The tilemap layer that contains this Tile. This will only return null if accessed from a + * LayerData instance before the tile is placed within a StaticTilemapLayer or + * DynamicTilemapLayer. + * + * @name Phaser.Tilemaps.Tile#tilemapLayer + * @type {?Phaser.Tilemaps.StaticTilemapLayer|Phaser.Tilemaps.DynamicTilemapLayer} + * @readonly + * @since 3.0.0 + */ + tilemapLayer: { + get: function () + { + return this.layer.tilemapLayer; + } + }, + + /** + * The tilemap that contains this Tile. This will only return null if accessed from a LayerData + * instance before the tile is placed within a StaticTilemapLayer or DynamicTilemapLayer. + * + * @name Phaser.Tilemaps.Tile#tilemap + * @type {?Phaser.Tilemaps.Tilemap} + * @readonly + * @since 3.0.0 + */ + tilemap: { + get: function () + { + var tilemapLayer = this.tilemapLayer; + return tilemapLayer ? tilemapLayer.tilemap : null; + } + } + +}); + +module.exports = Tile; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the center x coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetCenterX + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The center x coordinate of the bounds of the Game Object. + */ +var GetCenterX = function (gameObject) +{ + return gameObject.x - (gameObject.width * gameObject.originX) + (gameObject.width * 0.5); +}; + +module.exports = GetCenterX; + + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Positions the Game Object so that the center top of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetCenterX + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} x - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetCenterX = function (gameObject, x) +{ + var offsetX = gameObject.width * gameObject.originX; + + gameObject.x = (x + offsetX) - (gameObject.width * 0.5); + + return gameObject; +}; + +module.exports = SetCenterX; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Positions the Game Object so that the center top of its bounds aligns with the given coordinate. + * + * @function Phaser.Display.Bounds.SetCenterY + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} y - The coordinate to position the Game Object bounds on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var SetCenterY = function (gameObject, y) +{ + var offsetY = gameObject.height * gameObject.originY; + + gameObject.y = (y + offsetY) - (gameObject.height * 0.5); + + return gameObject; +}; + +module.exports = SetCenterY; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the center y coordinate from the bounds of the Game Object. + * + * @function Phaser.Display.Bounds.GetCenterY + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The center y coordinate of the bounds of the Game Object. + */ +var GetCenterY = function (gameObject) +{ + return gameObject.y - (gameObject.height * gameObject.originY) + (gameObject.height * 0.5); +}; + +module.exports = GetCenterY; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Contains = __webpack_require__(46); +var GetPoint = __webpack_require__(241); +var GetPoints = __webpack_require__(242); +var Random = __webpack_require__(145); + +/** + * @classdesc + * A Circle object. + * + * This is a geometry object, containing numerical values and related methods to inspect and modify them. + * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. + * To render a Circle you should look at the capabilities of the Graphics class. + * + * @class Circle + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x position of the center of the circle. + * @param {number} [y=0] - The y position of the center of the circle. + * @param {number} [radius=0] - The radius of the circle. + */ +var Circle = new Class({ + + initialize: + + function Circle (x, y, radius) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (radius === undefined) { radius = 0; } + + /** + * The x position of the center of the circle. + * + * @name Phaser.Geom.Circle#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The y position of the center of the circle. + * + * @name Phaser.Geom.Circle#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + + /** + * The internal radius of the circle. + * + * @name Phaser.Geom.Circle#_radius + * @type {number} + * @private + * @since 3.0.0 + */ + this._radius = radius; + + /** + * The internal diameter of the circle. + * + * @name Phaser.Geom.Circle#_diameter + * @type {number} + * @private + * @since 3.0.0 + */ + this._diameter = radius * 2; + }, + + /** + * Check to see if the Circle contains the given x / y coordinates. + * + * @method Phaser.Geom.Circle#contains + * @since 3.0.0 + * + * @param {number} x - The x coordinate to check within the circle. + * @param {number} y - The y coordinate to check within the circle. + * + * @return {boolean} True if the coordinates are within the circle, otherwise false. + */ + contains: function (x, y) + { + return Contains(this, x, y); + }, + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Circle + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * + * @method Phaser.Geom.Circle#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {number} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle. + * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created. + * + * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the circle. + */ + getPoint: function (position, point) + { + return GetPoint(this, position, point); + }, + + /** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle, + * based on the given quantity or stepRate values. + * + * @method Phaser.Geom.Circle#getPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [output,$return] + * + * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. + * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. + * + * @return {(array|Phaser.Geom.Point[])} An array of Point objects pertaining to the points around the circumference of the circle. + */ + getPoints: function (quantity, stepRate, output) + { + return GetPoints(this, quantity, stepRate, output); + }, + + /** + * Returns a uniformly distributed random point from anywhere within the Circle. + * + * @method Phaser.Geom.Circle#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in. + * + * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties. + */ + getRandomPoint: function (point) + { + return Random(this, point); + }, + + /** + * Sets the x, y and radius of this circle. + * + * @method Phaser.Geom.Circle#setTo + * @since 3.0.0 + * + * @param {number} [x=0] - The x position of the center of the circle. + * @param {number} [y=0] - The y position of the center of the circle. + * @param {number} [radius=0] - The radius of the circle. + * + * @return {Phaser.Geom.Circle} This Circle object. + */ + setTo: function (x, y, radius) + { + this.x = x; + this.y = y; + this._radius = radius; + this._diameter = radius * 2; + + return this; + }, + + /** + * Sets this Circle to be empty with a radius of zero. + * Does not change its position. + * + * @method Phaser.Geom.Circle#setEmpty + * @since 3.0.0 + * + * @return {Phaser.Geom.Circle} This Circle object. + */ + setEmpty: function () + { + this._radius = 0; + this._diameter = 0; + + return this; + }, + + /** + * Sets the position of this Circle. + * + * @method Phaser.Geom.Circle#setPosition + * @since 3.0.0 + * + * @param {number} [x=0] - The x position of the center of the circle. + * @param {number} [y=0] - The y position of the center of the circle. + * + * @return {Phaser.Geom.Circle} This Circle object. + */ + setPosition: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * Checks to see if the Circle is empty: has a radius of zero. + * + * @method Phaser.Geom.Circle#isEmpty + * @since 3.0.0 + * + * @return {boolean} True if the Circle is empty, otherwise false. + */ + isEmpty: function () + { + return (this._radius <= 0); + }, + + /** + * The radius of the Circle. + * + * @name Phaser.Geom.Circle#radius + * @type {number} + * @since 3.0.0 + */ + radius: { + + get: function () + { + return this._radius; + }, + + set: function (value) + { + this._radius = value; + this._diameter = value * 2; + } + + }, + + /** + * The diameter of the Circle. + * + * @name Phaser.Geom.Circle#diameter + * @type {number} + * @since 3.0.0 + */ + diameter: { + + get: function () + { + return this._diameter; + }, + + set: function (value) + { + this._diameter = value; + this._radius = value * 0.5; + } + + }, + + /** + * The left position of the Circle. + * + * @name Phaser.Geom.Circle#left + * @type {number} + * @since 3.0.0 + */ + left: { + + get: function () + { + return this.x - this._radius; + }, + + set: function (value) + { + this.x = value + this._radius; + } + + }, + + /** + * The right position of the Circle. + * + * @name Phaser.Geom.Circle#right + * @type {number} + * @since 3.0.0 + */ + right: { + + get: function () + { + return this.x + this._radius; + }, + + set: function (value) + { + this.x = value - this._radius; + } + + }, + + /** + * The top position of the Circle. + * + * @name Phaser.Geom.Circle#top + * @type {number} + * @since 3.0.0 + */ + top: { + + get: function () + { + return this.y - this._radius; + }, + + set: function (value) + { + this.y = value + this._radius; + } + + }, + + /** + * The bottom position of the Circle. + * + * @name Phaser.Geom.Circle#bottom + * @type {number} + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return this.y + this._radius; + }, + + set: function (value) + { + this.y = value - this._radius; + } + + } + +}); + +module.exports = Circle; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Removes a single item from an array and returns it without creating gc, like the native splice does. + * Based on code by Mike Reinstein. + * + * @function Phaser.Utils.Array.SpliceOne + * @since 3.0.0 + * + * @param {array} array - The array to splice from. + * @param {integer} index - The index of the item which should be spliced. + * + * @return {*} The item which was spliced (removed). + */ +var SpliceOne = function (array, index) +{ + if (index >= array.length) + { + return; + } + + var len = array.length - 1; + + var item = array[index]; + + for (var i = index; i < len; i++) + { + array[i] = array[i + 1]; + } + + array.length = len; + + return item; +}; + +module.exports = SpliceOne; + + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FromPoints = __webpack_require__(172); +var Rectangle = __webpack_require__(10); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Base Curve class, which all other curve types extend. + * + * Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) + * + * @class Curve + * @memberof Phaser.Curves + * @constructor + * @since 3.0.0 + * + * @param {string} type - [description] + */ +var Curve = new Class({ + + initialize: + + function Curve (type) + { + /** + * String based identifier for the type of curve. + * + * @name Phaser.Curves.Curve#type + * @type {string} + * @since 3.0.0 + */ + this.type = type; + + /** + * The default number of divisions within the curve. + * + * @name Phaser.Curves.Curve#defaultDivisions + * @type {integer} + * @default 5 + * @since 3.0.0 + */ + this.defaultDivisions = 5; + + /** + * The quantity of arc length divisions within the curve. + * + * @name Phaser.Curves.Curve#arcLengthDivisions + * @type {integer} + * @default 100 + * @since 3.0.0 + */ + this.arcLengthDivisions = 100; + + /** + * An array of cached arc length values. + * + * @name Phaser.Curves.Curve#cacheArcLengths + * @type {number[]} + * @default [] + * @since 3.0.0 + */ + this.cacheArcLengths = []; + + /** + * Does the data of this curve need updating? + * + * @name Phaser.Curves.Curve#needsUpdate + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.needsUpdate = true; + + /** + * [description] + * + * @name Phaser.Curves.Curve#active + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.active = true; + + /** + * A temporary calculation Vector. + * + * @name Phaser.Curves.Curve#_tmpVec2A + * @type {Phaser.Math.Vector2} + * @private + * @since 3.0.0 + */ + this._tmpVec2A = new Vector2(); + + /** + * A temporary calculation Vector. + * + * @name Phaser.Curves.Curve#_tmpVec2B + * @type {Phaser.Math.Vector2} + * @private + * @since 3.0.0 + */ + this._tmpVec2B = new Vector2(); + }, + + /** + * Draws this curve on the given Graphics object. + * + * The curve is drawn using `Graphics.strokePoints` so will be drawn at whatever the present Graphics stroke color is. + * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. + * + * @method Phaser.Curves.Curve#draw + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] + * + * @param {Phaser.GameObjects.Graphics} graphics - The Graphics instance onto which this curve will be drawn. + * @param {integer} [pointsTotal=32] - The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance. + * + * @return {Phaser.GameObjects.Graphics} The Graphics object to which the curve was drawn. + */ + draw: function (graphics, pointsTotal) + { + if (pointsTotal === undefined) { pointsTotal = 32; } + + // So you can chain graphics calls + return graphics.strokePoints(this.getPoints(pointsTotal)); + }, + + /** + * Returns a Rectangle where the position and dimensions match the bounds of this Curve. + * + * You can control the accuracy of the bounds. The value given is used to work out how many points + * to plot across the curve. Higher values are more accurate at the cost of calculation speed. + * + * @method Phaser.Curves.Curve#getBounds + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in. If falsey a new object will be created. + * @param {integer} [accuracy=16] - The accuracy of the bounds calculations. + * + * @return {Phaser.Geom.Rectangle} A Rectangle object holding the bounds of this curve. If `out` was given it will be this object. + */ + getBounds: function (out, accuracy) + { + if (!out) { out = new Rectangle(); } + if (accuracy === undefined) { accuracy = 16; } + + var len = this.getLength(); + + if (accuracy > len) + { + accuracy = len / 2; + } + + // The length of the curve in pixels + // So we'll have 1 spaced point per 'accuracy' pixels + + var spaced = Math.max(1, Math.round(len / accuracy)); + + return FromPoints(this.getSpacedPoints(spaced), out); + }, + + /** + * Returns an array of points, spaced out X distance pixels apart. + * The smaller the distance, the larger the array will be. + * + * @method Phaser.Curves.Curve#getDistancePoints + * @since 3.0.0 + * + * @param {integer} distance - The distance, in pixels, between each point along the curve. + * + * @return {Phaser.Geom.Point[]} An Array of Point objects. + */ + getDistancePoints: function (distance) + { + var len = this.getLength(); + + var spaced = Math.max(1, len / distance); + + return this.getSpacedPoints(spaced); + }, + + /** + * [description] + * + * @method Phaser.Curves.Curve#getEndPoint + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} [out] - Optional Vector object to store the result in. + * + * @return {Phaser.Math.Vector2} Vector2 containing the coordinates of the curves end point. + */ + getEndPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + return this.getPointAt(1, out); + }, + + // Get total curve arc length + + /** + * [description] + * + * @method Phaser.Curves.Curve#getLength + * @since 3.0.0 + * + * @return {number} [description] + */ + getLength: function () + { + var lengths = this.getLengths(); + + return lengths[lengths.length - 1]; + }, + + // Get list of cumulative segment lengths + + /** + * [description] + * + * @method Phaser.Curves.Curve#getLengths + * @since 3.0.0 + * + * @param {integer} [divisions] - [description] + * + * @return {number[]} [description] + */ + getLengths: function (divisions) + { + if (divisions === undefined) { divisions = this.arcLengthDivisions; } + + if ((this.cacheArcLengths.length === divisions + 1) && !this.needsUpdate) + { + return this.cacheArcLengths; + } + + this.needsUpdate = false; + + var cache = []; + var current; + var last = this.getPoint(0, this._tmpVec2A); + var sum = 0; + + cache.push(0); + + for (var p = 1; p <= divisions; p++) + { + current = this.getPoint(p / divisions, this._tmpVec2B); + + sum += current.distance(last); + + cache.push(sum); + + last.copy(current); + } + + this.cacheArcLengths = cache; + + return cache; // { sums: cache, sum:sum }; Sum is in the last element. + }, + + // Get point at relative position in curve according to arc length + + // - u [0 .. 1] + + /** + * [description] + * + * @method Phaser.Curves.Curve#getPointAt + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} u - [description] + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ + getPointAt: function (u, out) + { + var t = this.getUtoTmapping(u); + + return this.getPoint(t, out); + }, + + // Get sequence of points using getPoint( t ) + + /** + * [description] + * + * @method Phaser.Curves.Curve#getPoints + * @since 3.0.0 + * + * @param {integer} [divisions] - [description] + * + * @return {Phaser.Math.Vector2[]} [description] + */ + getPoints: function (divisions) + { + if (divisions === undefined) { divisions = this.defaultDivisions; } + + var points = []; + + for (var d = 0; d <= divisions; d++) + { + points.push(this.getPoint(d / divisions)); + } + + return points; + }, + + /** + * [description] + * + * @method Phaser.Curves.Curve#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ + getRandomPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + return this.getPoint(Math.random(), out); + }, + + // Get sequence of points using getPointAt( u ) + + /** + * [description] + * + * @method Phaser.Curves.Curve#getSpacedPoints + * @since 3.0.0 + * + * @param {integer} [divisions] - [description] + * + * @return {Phaser.Math.Vector2[]} [description] + */ + getSpacedPoints: function (divisions) + { + if (divisions === undefined) { divisions = this.defaultDivisions; } + + var points = []; + + for (var d = 0; d <= divisions; d++) + { + var t = this.getUtoTmapping(d / divisions, null, divisions); + + points.push(this.getPoint(t)); + } + + return points; + }, + + /** + * [description] + * + * @method Phaser.Curves.Curve#getStartPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ + getStartPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + return this.getPointAt(0, out); + }, + + // Returns a unit vector tangent at t + // In case any sub curve does not implement its tangent derivation, + // 2 points a small delta apart will be used to find its gradient + // which seems to give a reasonable approximation + + /** + * [description] + * + * @method Phaser.Curves.Curve#getTangent + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} t - [description] + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} Vector approximating the tangent line at the point t (delta +/- 0.0001) + */ + getTangent: function (t, out) + { + if (out === undefined) { out = new Vector2(); } + + var delta = 0.0001; + var t1 = t - delta; + var t2 = t + delta; + + // Capping in case of danger + + if (t1 < 0) + { + t1 = 0; + } + + if (t2 > 1) + { + t2 = 1; + } + + this.getPoint(t1, this._tmpVec2A); + this.getPoint(t2, out); + + return out.subtract(this._tmpVec2A).normalize(); + }, + + /** + * [description] + * + * @method Phaser.Curves.Curve#getTangentAt + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} u - [description] + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ + getTangentAt: function (u, out) + { + var t = this.getUtoTmapping(u); + + return this.getTangent(t, out); + }, + + // Given a distance in pixels, get a t to find p. + /** + * [description] + * + * @method Phaser.Curves.Curve#getTFromDistance + * @since 3.0.0 + * + * @param {integer} distance - [description] + * @param {integer} [divisions] - [description] + * + * @return {number} [description] + */ + getTFromDistance: function (distance, divisions) + { + if (distance <= 0) + { + return 0; + } + + return this.getUtoTmapping(0, distance, divisions); + }, + + // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant + + /** + * [description] + * + * @method Phaser.Curves.Curve#getUtoTmapping + * @since 3.0.0 + * + * @param {number} u - [description] + * @param {integer} distance - [description] + * @param {integer} [divisions] - [description] + * + * @return {number} [description] + */ + getUtoTmapping: function (u, distance, divisions) + { + var arcLengths = this.getLengths(divisions); + + var i = 0; + var il = arcLengths.length; + + var targetArcLength; // The targeted u distance value to get + + if (distance) + { + // Cannot overshoot the curve + targetArcLength = Math.min(distance, arcLengths[il - 1]); + } + else + { + targetArcLength = u * arcLengths[il - 1]; + } + + // binary search for the index with largest value smaller than target u distance + + var low = 0; + var high = il - 1; + var comparison; + + while (low <= high) + { + i = Math.floor(low + (high - low) / 2); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats + + comparison = arcLengths[i] - targetArcLength; + + if (comparison < 0) + { + low = i + 1; + } + else if (comparison > 0) + { + high = i - 1; + } + else + { + high = i; + break; + } + } + + i = high; + + if (arcLengths[i] === targetArcLength) + { + return i / (il - 1); + } + + // we could get finer grain at lengths, or use simple interpolation between two points + + var lengthBefore = arcLengths[i]; + var lengthAfter = arcLengths[i + 1]; + + var segmentLength = lengthAfter - lengthBefore; + + // determine where we are between the 'before' and 'after' points + + var segmentFraction = (targetArcLength - lengthBefore) / segmentLength; + + // add that fractional amount to t + + return (i + segmentFraction) / (il - 1); + }, + + /** + * [description] + * + * @method Phaser.Curves.Curve#updateArcLengths + * @since 3.0.0 + */ + updateArcLengths: function () + { + this.needsUpdate = true; + + this.getLengths(); + } + +}); + +module.exports = Curve; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Loader.Events + */ + +module.exports = { + + ADD: __webpack_require__(829), + COMPLETE: __webpack_require__(830), + FILE_COMPLETE: __webpack_require__(831), + FILE_KEY_COMPLETE: __webpack_require__(832), + FILE_LOAD_ERROR: __webpack_require__(833), + FILE_LOAD: __webpack_require__(834), + FILE_PROGRESS: __webpack_require__(835), + POST_PROCESS: __webpack_require__(836), + PROGRESS: __webpack_require__(837), + START: __webpack_require__(838) + +}; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// http://www.blackpawn.com/texts/pointinpoly/ + +/** + * Checks if a point (as a pair of coordinates) is inside a Triangle's bounds. + * + * @function Phaser.Geom.Triangle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to check. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is inside the Triangle, otherwise `false`. + */ +var Contains = function (triangle, x, y) +{ + var v0x = triangle.x3 - triangle.x1; + var v0y = triangle.y3 - triangle.y1; + + var v1x = triangle.x2 - triangle.x1; + var v1y = triangle.y2 - triangle.y1; + + var v2x = x - triangle.x1; + var v2y = y - triangle.y1; + + var dot00 = (v0x * v0x) + (v0y * v0y); + var dot01 = (v0x * v1x) + (v0y * v1y); + var dot02 = (v0x * v2x) + (v0y * v2y); + var dot11 = (v1x * v1x) + (v1y * v1y); + var dot12 = (v1x * v2x) + (v1y * v2y); + + // Compute barycentric coordinates + var b = ((dot00 * dot11) - (dot01 * dot01)); + var inv = (b === 0) ? 0 : (1 / b); + var u = ((dot11 * dot02) - (dot01 * dot12)) * inv; + var v = ((dot00 * dot12) - (dot01 * dot02)) * inv; + + return (u >= 0 && v >= 0 && (u + v < 1)); +}; + +module.exports = Contains; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +// This is based off an explanation and expanded math presented by Paul Bourke: +// See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ + +/** + * Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting. + * + * @function Phaser.Geom.Intersects.LineToLine + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line1 - The first Line to check. + * @param {Phaser.Geom.Line} line2 - The second Line to check. + * @param {Phaser.Geom.Point} [out] - A Point in which to optionally store the point of intersection. + * + * @return {boolean} `true` if the two Lines intersect, and the `out` object will be populated, if given. Otherwise, `false`. + */ +var LineToLine = function (line1, line2, out) +{ + if (out === undefined) { out = new Point(); } + + var x1 = line1.x1; + var y1 = line1.y1; + var x2 = line1.x2; + var y2 = line1.y2; + + var x3 = line2.x1; + var y3 = line2.y1; + var x4 = line2.x2; + var y4 = line2.y2; + + var numA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3); + var numB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3); + var deNom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1); + + // Make sure there is not a division by zero - this also indicates that the lines are parallel. + // If numA and numB were both equal to zero the lines would be on top of each other (coincidental). + // This check is not done because it is not necessary for this implementation (the parallel check accounts for this). + + if (deNom === 0) + { + return false; + } + + // Calculate the intermediate fractional point that the lines potentially intersect. + + var uA = numA / deNom; + var uB = numB / deNom; + + // The fractional point will be between 0 and 1 inclusive if the lines intersect. + // If the fractional calculation is larger than 1 or smaller than 0 the lines would need to be longer to intersect. + + if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) + { + out.x = x1 + (uA * (x2 - x1)); + out.y = y1 + (uA * (y2 - y1)); + + return true; + } + + return false; +}; + +module.exports = LineToLine; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the angle of the line in radians. + * + * @function Phaser.Geom.Line.Angle + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the angle of. + * + * @return {number} The angle of the line, in radians. + */ +var Angle = function (line) +{ + return Math.atan2(line.y2 - line.y1, line.x2 - line.x1); +}; + +module.exports = Angle; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. +* A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. +* A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Vertices +*/ + +var Vertices = {}; + +module.exports = Vertices; + +var Vector = __webpack_require__(99); +var Common = __webpack_require__(37); + +(function() { + + /** + * Creates a new set of `Matter.Body` compatible vertices. + * The `points` argument accepts an array of `Matter.Vector` points orientated around the origin `(0, 0)`, for example: + * + * [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }] + * + * The `Vertices.create` method returns a new array of vertices, which are similar to Matter.Vector objects, + * but with some additional references required for efficient collision detection routines. + * + * Vertices must be specified in clockwise order. + * + * Note that the `body` argument is not optional, a `Matter.Body` reference must be provided. + * + * @method create + * @param {vector[]} points + * @param {body} body + */ + Vertices.create = function(points, body) { + var vertices = []; + + for (var i = 0; i < points.length; i++) { + var point = points[i], + vertex = { + x: point.x, + y: point.y, + index: i, + body: body, + isInternal: false, + contact: null + }; + + vertex.contact = { + vertex: vertex, + normalImpulse: 0, + tangentImpulse: 0 + }; + + vertices.push(vertex); + } + + return vertices; + }; + + /** + * Parses a string containing ordered x y pairs separated by spaces (and optionally commas), + * into a `Matter.Vertices` object for the given `Matter.Body`. + * For parsing SVG paths, see `Svg.pathToVertices`. + * @method fromPath + * @param {string} path + * @param {body} body + * @return {vertices} vertices + */ + Vertices.fromPath = function(path, body) { + var pathPattern = /L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/ig, + points = []; + + path.replace(pathPattern, function(match, x, y) { + points.push({ x: parseFloat(x), y: parseFloat(y) }); + }); + + return Vertices.create(points, body); + }; + + /** + * Returns the centre (centroid) of the set of vertices. + * @method centre + * @param {vertices} vertices + * @return {vector} The centre point + */ + Vertices.centre = function(vertices) { + var area = Vertices.area(vertices, true), + centre = { x: 0, y: 0 }, + cross, + temp, + j; + + for (var i = 0; i < vertices.length; i++) { + j = (i + 1) % vertices.length; + cross = Vector.cross(vertices[i], vertices[j]); + temp = Vector.mult(Vector.add(vertices[i], vertices[j]), cross); + centre = Vector.add(centre, temp); + } + + return Vector.div(centre, 6 * area); + }; + + /** + * Returns the average (mean) of the set of vertices. + * @method mean + * @param {vertices} vertices + * @return {vector} The average point + */ + Vertices.mean = function(vertices) { + var average = { x: 0, y: 0 }; + + for (var i = 0; i < vertices.length; i++) { + average.x += vertices[i].x; + average.y += vertices[i].y; + } + + return Vector.div(average, vertices.length); + }; + + /** + * Returns the area of the set of vertices. + * @method area + * @param {vertices} vertices + * @param {bool} signed + * @return {number} The area + */ + Vertices.area = function(vertices, signed) { + var area = 0, + j = vertices.length - 1; + + for (var i = 0; i < vertices.length; i++) { + area += (vertices[j].x - vertices[i].x) * (vertices[j].y + vertices[i].y); + j = i; + } + + if (signed) + return area / 2; + + return Math.abs(area) / 2; + }; + + /** + * Returns the moment of inertia (second moment of area) of the set of vertices given the total mass. + * @method inertia + * @param {vertices} vertices + * @param {number} mass + * @return {number} The polygon's moment of inertia + */ + Vertices.inertia = function(vertices, mass) { + var numerator = 0, + denominator = 0, + v = vertices, + cross, + j; + + // find the polygon's moment of inertia, using second moment of area + // from equations at http://www.physicsforums.com/showthread.php?t=25293 + for (var n = 0; n < v.length; n++) { + j = (n + 1) % v.length; + cross = Math.abs(Vector.cross(v[j], v[n])); + numerator += cross * (Vector.dot(v[j], v[j]) + Vector.dot(v[j], v[n]) + Vector.dot(v[n], v[n])); + denominator += cross; + } + + return (mass / 6) * (numerator / denominator); + }; + + /** + * Translates the set of vertices in-place. + * @method translate + * @param {vertices} vertices + * @param {vector} vector + * @param {number} scalar + */ + Vertices.translate = function(vertices, vector, scalar) { + var i; + if (scalar) { + for (i = 0; i < vertices.length; i++) { + vertices[i].x += vector.x * scalar; + vertices[i].y += vector.y * scalar; + } + } else { + for (i = 0; i < vertices.length; i++) { + vertices[i].x += vector.x; + vertices[i].y += vector.y; + } + } + + return vertices; + }; + + /** + * Rotates the set of vertices in-place. + * @method rotate + * @param {vertices} vertices + * @param {number} angle + * @param {vector} point + */ + Vertices.rotate = function(vertices, angle, point) { + if (angle === 0) + return; + + var cos = Math.cos(angle), + sin = Math.sin(angle); + + for (var i = 0; i < vertices.length; i++) { + var vertice = vertices[i], + dx = vertice.x - point.x, + dy = vertice.y - point.y; + + vertice.x = point.x + (dx * cos - dy * sin); + vertice.y = point.y + (dx * sin + dy * cos); + } + + return vertices; + }; + + /** + * Returns `true` if the `point` is inside the set of `vertices`. + * @method contains + * @param {vertices} vertices + * @param {vector} point + * @return {boolean} True if the vertices contains point, otherwise false + */ + Vertices.contains = function(vertices, point) { + for (var i = 0; i < vertices.length; i++) { + var vertice = vertices[i], + nextVertice = vertices[(i + 1) % vertices.length]; + if ((point.x - vertice.x) * (nextVertice.y - vertice.y) + (point.y - vertice.y) * (vertice.x - nextVertice.x) > 0) { + return false; + } + } + + return true; + }; + + /** + * Scales the vertices from a point (default is centre) in-place. + * @method scale + * @param {vertices} vertices + * @param {number} scaleX + * @param {number} scaleY + * @param {vector} point + */ + Vertices.scale = function(vertices, scaleX, scaleY, point) { + if (scaleX === 1 && scaleY === 1) + return vertices; + + point = point || Vertices.centre(vertices); + + var vertex, + delta; + + for (var i = 0; i < vertices.length; i++) { + vertex = vertices[i]; + delta = Vector.sub(vertex, point); + vertices[i].x = point.x + delta.x * scaleX; + vertices[i].y = point.y + delta.y * scaleY; + } + + return vertices; + }; + + /** + * Chamfers a set of vertices by giving them rounded corners, returns a new set of vertices. + * The radius parameter is a single number or an array to specify the radius for each vertex. + * @method chamfer + * @param {vertices} vertices + * @param {number[]} radius + * @param {number} quality + * @param {number} qualityMin + * @param {number} qualityMax + */ + Vertices.chamfer = function(vertices, radius, quality, qualityMin, qualityMax) { + if (typeof radius === 'number') { + radius = [radius]; + } else { + radius = radius || [8]; + } + + // quality defaults to -1, which is auto + quality = (typeof quality !== 'undefined') ? quality : -1; + qualityMin = qualityMin || 2; + qualityMax = qualityMax || 14; + + var newVertices = []; + + for (var i = 0; i < vertices.length; i++) { + var prevVertex = vertices[i - 1 >= 0 ? i - 1 : vertices.length - 1], + vertex = vertices[i], + nextVertex = vertices[(i + 1) % vertices.length], + currentRadius = radius[i < radius.length ? i : radius.length - 1]; + + if (currentRadius === 0) { + newVertices.push(vertex); + continue; + } + + var prevNormal = Vector.normalise({ + x: vertex.y - prevVertex.y, + y: prevVertex.x - vertex.x + }); + + var nextNormal = Vector.normalise({ + x: nextVertex.y - vertex.y, + y: vertex.x - nextVertex.x + }); + + var diagonalRadius = Math.sqrt(2 * Math.pow(currentRadius, 2)), + radiusVector = Vector.mult(Common.clone(prevNormal), currentRadius), + midNormal = Vector.normalise(Vector.mult(Vector.add(prevNormal, nextNormal), 0.5)), + scaledVertex = Vector.sub(vertex, Vector.mult(midNormal, diagonalRadius)); + + var precision = quality; + + if (quality === -1) { + // automatically decide precision + precision = Math.pow(currentRadius, 0.32) * 1.75; + } + + precision = Common.clamp(precision, qualityMin, qualityMax); + + // use an even value for precision, more likely to reduce axes by using symmetry + if (precision % 2 === 1) + precision += 1; + + var alpha = Math.acos(Vector.dot(prevNormal, nextNormal)), + theta = alpha / precision; + + for (var j = 0; j < precision; j++) { + newVertices.push(Vector.add(Vector.rotate(radiusVector, theta * j), scaledVertex)); + } + } + + return newVertices; + }; + + /** + * Sorts the input vertices into clockwise order in place. + * @method clockwiseSort + * @param {vertices} vertices + * @return {vertices} vertices + */ + Vertices.clockwiseSort = function(vertices) { + var centre = Vertices.mean(vertices); + + vertices.sort(function(vertexA, vertexB) { + return Vector.angle(centre, vertexA) - Vector.angle(centre, vertexB); + }); + + return vertices; + }; + + /** + * Returns true if the vertices form a convex shape (vertices must be in clockwise order). + * @method isConvex + * @param {vertices} vertices + * @return {bool} `true` if the `vertices` are convex, `false` if not (or `null` if not computable). + */ + Vertices.isConvex = function(vertices) { + // http://paulbourke.net/geometry/polygonmesh/ + // Copyright (c) Paul Bourke (use permitted) + + var flag = 0, + n = vertices.length, + i, + j, + k, + z; + + if (n < 3) + return null; + + for (i = 0; i < n; i++) { + j = (i + 1) % n; + k = (i + 2) % n; + z = (vertices[j].x - vertices[i].x) * (vertices[k].y - vertices[j].y); + z -= (vertices[j].y - vertices[i].y) * (vertices[k].x - vertices[j].x); + + if (z < 0) { + flag |= 1; + } else if (z > 0) { + flag |= 2; + } + + if (flag === 3) { + return false; + } + } + + if (flag !== 0){ + return true; + } else { + return null; + } + }; + + /** + * Returns the convex hull of the input vertices as a new array of points. + * @method hull + * @param {vertices} vertices + * @return [vertex] vertices + */ + Vertices.hull = function(vertices) { + // http://geomalgorithms.com/a10-_hull-1.html + + var upper = [], + lower = [], + vertex, + i; + + // sort vertices on x-axis (y-axis for ties) + vertices = vertices.slice(0); + vertices.sort(function(vertexA, vertexB) { + var dx = vertexA.x - vertexB.x; + return dx !== 0 ? dx : vertexA.y - vertexB.y; + }); + + // build lower hull + for (i = 0; i < vertices.length; i += 1) { + vertex = vertices[i]; + + while (lower.length >= 2 + && Vector.cross3(lower[lower.length - 2], lower[lower.length - 1], vertex) <= 0) { + lower.pop(); + } + + lower.push(vertex); + } + + // build upper hull + for (i = vertices.length - 1; i >= 0; i -= 1) { + vertex = vertices[i]; + + while (upper.length >= 2 + && Vector.cross3(upper[upper.length - 2], upper[upper.length - 1], vertex) <= 0) { + upper.pop(); + } + + upper.push(vertex); + } + + // concatenation of the lower and upper hulls gives the convex hull + // omit last points because they are repeated at the beginning of the other list + upper.pop(); + lower.pop(); + + return upper.concat(lower); + }; + +})(); + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clone = __webpack_require__(64); + +/** + * Creates a new Object using all values from obj1 and obj2. + * If a value exists in both obj1 and obj2, the value in obj1 is used. + * + * @function Phaser.Utils.Objects.Merge + * @since 3.0.0 + * + * @param {object} obj1 - The first object. + * @param {object} obj2 - The second object. + * + * @return {object} A new object containing the union of obj1's and obj2's properties. + */ +var Merge = function (obj1, obj2) +{ + var clone = Clone(obj1); + + for (var key in obj2) + { + if (!clone.hasOwnProperty(key)) + { + clone[key] = obj2[key]; + } + } + + return clone; +}; + +module.exports = Merge; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); + +/** + * Return a value based on the range between `min` and `max` and the percentage given. + * + * @function Phaser.Math.FromPercent + * @since 3.0.0 + * + * @param {number} percent - A value between 0 and 1 representing the percentage. + * @param {number} min - The minimum value. + * @param {number} [max] - The maximum value. + * + * @return {number} The value that is `percent` percent between `min` and `max`. + */ +var FromPercent = function (percent, min, max) +{ + percent = Clamp(percent, 0, 1); + + return (max - min) * percent; +}; + +module.exports = FromPercent; + + +/***/ }), +/* 87 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Retrieves the value of the given key from an object. + * + * @function Phaser.Tweens.Builders.GetBoolean + * @since 3.0.0 + * + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The key to look for in the `source` object. + * @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided. + * + * @return {*} The retrieved value. + */ +var GetBoolean = function (source, key, defaultValue) +{ + if (!source) + { + return defaultValue; + } + else if (source.hasOwnProperty(key)) + { + return source[key]; + } + else + { + return defaultValue; + } +}; + +module.exports = GetBoolean; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TWEEN_CONST = { + + /** + * TweenData state. + * + * @name Phaser.Tweens.CREATED + * @type {integer} + * @since 3.0.0 + */ + CREATED: 0, + + /** + * TweenData state. + * + * @name Phaser.Tweens.INIT + * @type {integer} + * @since 3.0.0 + */ + INIT: 1, + + /** + * TweenData state. + * + * @name Phaser.Tweens.DELAY + * @type {integer} + * @since 3.0.0 + */ + DELAY: 2, + + /** + * TweenData state. + * + * @name Phaser.Tweens.OFFSET_DELAY + * @type {integer} + * @since 3.0.0 + */ + OFFSET_DELAY: 3, + + /** + * TweenData state. + * + * @name Phaser.Tweens.PENDING_RENDER + * @type {integer} + * @since 3.0.0 + */ + PENDING_RENDER: 4, + + /** + * TweenData state. + * + * @name Phaser.Tweens.PLAYING_FORWARD + * @type {integer} + * @since 3.0.0 + */ + PLAYING_FORWARD: 5, + + /** + * TweenData state. + * + * @name Phaser.Tweens.PLAYING_BACKWARD + * @type {integer} + * @since 3.0.0 + */ + PLAYING_BACKWARD: 6, + + /** + * TweenData state. + * + * @name Phaser.Tweens.HOLD_DELAY + * @type {integer} + * @since 3.0.0 + */ + HOLD_DELAY: 7, + + /** + * TweenData state. + * + * @name Phaser.Tweens.REPEAT_DELAY + * @type {integer} + * @since 3.0.0 + */ + REPEAT_DELAY: 8, + + /** + * TweenData state. + * + * @name Phaser.Tweens.COMPLETE + * @type {integer} + * @since 3.0.0 + */ + COMPLETE: 9, + + // Tween specific (starts from 20 to cleanly allow extra TweenData consts in the future) + + /** + * Tween state. + * + * @name Phaser.Tweens.PENDING_ADD + * @type {integer} + * @since 3.0.0 + */ + PENDING_ADD: 20, + + /** + * Tween state. + * + * @name Phaser.Tweens.PAUSED + * @type {integer} + * @since 3.0.0 + */ + PAUSED: 21, + + /** + * Tween state. + * + * @name Phaser.Tweens.LOOP_DELAY + * @type {integer} + * @since 3.0.0 + */ + LOOP_DELAY: 22, + + /** + * Tween state. + * + * @name Phaser.Tweens.ACTIVE + * @type {integer} + * @since 3.0.0 + */ + ACTIVE: 23, + + /** + * Tween state. + * + * @name Phaser.Tweens.COMPLETE_DELAY + * @type {integer} + * @since 3.0.0 + */ + COMPLETE_DELAY: 24, + + /** + * Tween state. + * + * @name Phaser.Tweens.PENDING_REMOVE + * @type {integer} + * @since 3.0.0 + */ + PENDING_REMOVE: 25, + + /** + * Tween state. + * + * @name Phaser.Tweens.REMOVED + * @type {integer} + * @since 3.0.0 + */ + REMOVED: 26 + +}; + +module.exports = TWEEN_CONST; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Scale.Events + */ + +module.exports = { + + ENTER_FULLSCREEN: __webpack_require__(655), + FULLSCREEN_FAILED: __webpack_require__(656), + FULLSCREEN_UNSUPPORTED: __webpack_require__(657), + LEAVE_FULLSCREEN: __webpack_require__(658), + ORIENTATION_CHANGE: __webpack_require__(659), + RESIZE: __webpack_require__(660) + +}; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using floor. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. + * As will `14` snap to `10`... but `16` will snap to `15`. + * + * @function Phaser.Math.Snap.Floor + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapFloor = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.floor(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapFloor; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Clamp = __webpack_require__(22); +var Extend = __webpack_require__(17); + +/** + * @classdesc + * A Frame is a section of a Texture. + * + * @class Frame + * @memberof Phaser.Textures + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. + * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {number} x - The x coordinate of the top-left of this Frame. + * @param {number} y - The y coordinate of the top-left of this Frame. + * @param {number} width - The width of this Frame. + * @param {number} height - The height of this Frame. + */ +var Frame = new Class({ + + initialize: + + function Frame (texture, name, sourceIndex, x, y, width, height) + { + /** + * The Texture this Frame is a part of. + * + * @name Phaser.Textures.Frame#texture + * @type {Phaser.Textures.Texture} + * @since 3.0.0 + */ + this.texture = texture; + + /** + * The name of this Frame. + * The name is unique within the Texture. + * + * @name Phaser.Textures.Frame#name + * @type {string} + * @since 3.0.0 + */ + this.name = name; + + /** + * The TextureSource this Frame is part of. + * + * @name Phaser.Textures.Frame#source + * @type {Phaser.Textures.TextureSource} + * @since 3.0.0 + */ + this.source = texture.source[sourceIndex]; + + /** + * The index of the TextureSource in the Texture sources array. + * + * @name Phaser.Textures.Frame#sourceIndex + * @type {integer} + * @since 3.0.0 + */ + this.sourceIndex = sourceIndex; + + /** + * A reference to the Texture Source WebGL Texture that this Frame is using. + * + * @name Phaser.Textures.Frame#glTexture + * @type {?WebGLTexture} + * @default null + * @since 3.11.0 + */ + this.glTexture = this.source.glTexture; + + /** + * X position within the source image to cut from. + * + * @name Phaser.Textures.Frame#cutX + * @type {integer} + * @since 3.0.0 + */ + this.cutX; + + /** + * Y position within the source image to cut from. + * + * @name Phaser.Textures.Frame#cutY + * @type {integer} + * @since 3.0.0 + */ + this.cutY; + + /** + * The width of the area in the source image to cut. + * + * @name Phaser.Textures.Frame#cutWidth + * @type {integer} + * @since 3.0.0 + */ + this.cutWidth; + + /** + * The height of the area in the source image to cut. + * + * @name Phaser.Textures.Frame#cutHeight + * @type {integer} + * @since 3.0.0 + */ + this.cutHeight; + + /** + * The X rendering offset of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#x + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The Y rendering offset of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#y + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The rendering width of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#width + * @type {integer} + * @since 3.0.0 + */ + this.width; + + /** + * The rendering height of this Frame, taking trim into account. + * + * @name Phaser.Textures.Frame#height + * @type {integer} + * @since 3.0.0 + */ + this.height; + + /** + * Half the width, floored. + * Precalculated for the renderer. + * + * @name Phaser.Textures.Frame#halfWidth + * @type {integer} + * @since 3.0.0 + */ + this.halfWidth; + + /** + * Half the height, floored. + * Precalculated for the renderer. + * + * @name Phaser.Textures.Frame#halfHeight + * @type {integer} + * @since 3.0.0 + */ + this.halfHeight; + + /** + * The x center of this frame, floored. + * + * @name Phaser.Textures.Frame#centerX + * @type {integer} + * @since 3.0.0 + */ + this.centerX; + + /** + * The y center of this frame, floored. + * + * @name Phaser.Textures.Frame#centerY + * @type {integer} + * @since 3.0.0 + */ + this.centerY; + + /** + * The horizontal pivot point of this Frame. + * + * @name Phaser.Textures.Frame#pivotX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.pivotX = 0; + + /** + * The vertical pivot point of this Frame. + * + * @name Phaser.Textures.Frame#pivotY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.pivotY = 0; + + /** + * Does this Frame have a custom pivot point? + * + * @name Phaser.Textures.Frame#customPivot + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.customPivot = false; + + /** + * **CURRENTLY UNSUPPORTED** + * + * Is this frame is rotated or not in the Texture? + * Rotation allows you to use rotated frames in texture atlas packing. + * It has nothing to do with Sprite rotation. + * + * @name Phaser.Textures.Frame#rotated + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.rotated = false; + + /** + * Over-rides the Renderer setting. + * -1 = use Renderer Setting + * 0 = No rounding + * 1 = Round + * + * @name Phaser.Textures.Frame#autoRound + * @type {integer} + * @default -1 + * @since 3.0.0 + */ + this.autoRound = -1; + + /** + * Any Frame specific custom data can be stored here. + * + * @name Phaser.Textures.Frame#customData + * @type {object} + * @since 3.0.0 + */ + this.customData = {}; + + /** + * WebGL UV u0 value. + * + * @name Phaser.Textures.Frame#u0 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.u0 = 0; + + /** + * WebGL UV v0 value. + * + * @name Phaser.Textures.Frame#v0 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.v0 = 0; + + /** + * WebGL UV u1 value. + * + * @name Phaser.Textures.Frame#u1 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.u1 = 0; + + /** + * WebGL UV v1 value. + * + * @name Phaser.Textures.Frame#v1 + * @type {number} + * @default 0 + * @since 3.11.0 + */ + this.v1 = 0; + + /** + * The un-modified source frame, trim and UV data. + * + * @name Phaser.Textures.Frame#data + * @type {object} + * @private + * @since 3.0.0 + */ + this.data = { + cut: { + x: 0, + y: 0, + w: 0, + h: 0, + r: 0, + b: 0 + }, + trim: false, + sourceSize: { + w: 0, + h: 0 + }, + spriteSourceSize: { + x: 0, + y: 0, + w: 0, + h: 0, + r: 0, + b: 0 + }, + radius: 0, + drawImage: { + x: 0, + y: 0, + width: 0, + height: 0 + } + }; + + this.setSize(width, height, x, y); + }, + + /** + * Sets the width, height, x and y of this Frame. + * + * This is called automatically by the constructor + * and should rarely be changed on-the-fly. + * + * @method Phaser.Textures.Frame#setSize + * @since 3.7.0 + * + * @param {integer} width - The width of the frame before being trimmed. + * @param {integer} height - The height of the frame before being trimmed. + * @param {integer} [x=0] - The x coordinate of the top-left of this Frame. + * @param {integer} [y=0] - The y coordinate of the top-left of this Frame. + * + * @return {Phaser.Textures.Frame} This Frame object. + */ + setSize: function (width, height, x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + this.cutX = x; + this.cutY = y; + this.cutWidth = width; + this.cutHeight = height; + + this.width = width; + this.height = height; + + this.halfWidth = Math.floor(width * 0.5); + this.halfHeight = Math.floor(height * 0.5); + + this.centerX = Math.floor(width / 2); + this.centerY = Math.floor(height / 2); + + var data = this.data; + var cut = data.cut; + + cut.x = x; + cut.y = y; + cut.w = width; + cut.h = height; + cut.r = x + width; + cut.b = y + height; + + data.sourceSize.w = width; + data.sourceSize.h = height; + + data.spriteSourceSize.w = width; + data.spriteSourceSize.h = height; + + data.radius = 0.5 * Math.sqrt(width * width + height * height); + + var drawImage = data.drawImage; + + drawImage.x = x; + drawImage.y = y; + drawImage.width = width; + drawImage.height = height; + + return this.updateUVs(); + }, + + /** + * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data. + * + * @method Phaser.Textures.Frame#setTrim + * @since 3.0.0 + * + * @param {number} actualWidth - The width of the frame before being trimmed. + * @param {number} actualHeight - The height of the frame before being trimmed. + * @param {number} destX - The destination X position of the trimmed frame for display. + * @param {number} destY - The destination Y position of the trimmed frame for display. + * @param {number} destWidth - The destination width of the trimmed frame for display. + * @param {number} destHeight - The destination height of the trimmed frame for display. + * + * @return {Phaser.Textures.Frame} This Frame object. + */ + setTrim: function (actualWidth, actualHeight, destX, destY, destWidth, destHeight) + { + var data = this.data; + var ss = data.spriteSourceSize; + + // Store actual values + + data.trim = true; + + data.sourceSize.w = actualWidth; + data.sourceSize.h = actualHeight; + + ss.x = destX; + ss.y = destY; + ss.w = destWidth; + ss.h = destHeight; + ss.r = destX + destWidth; + ss.b = destY + destHeight; + + // Adjust properties + this.x = destX; + this.y = destY; + + this.width = destWidth; + this.height = destHeight; + + this.halfWidth = destWidth * 0.5; + this.halfHeight = destHeight * 0.5; + + this.centerX = Math.floor(destWidth / 2); + this.centerY = Math.floor(destHeight / 2); + + return this.updateUVs(); + }, + + /** + * Takes a crop data object and, based on the rectangular region given, calculates the + * required UV coordinates in order to crop this Frame for WebGL and Canvas rendering. + * + * This is called directly by the Game Object Texture Components `setCrop` method. + * Please use that method to crop a Game Object. + * + * @method Phaser.Textures.Frame#setCropUVs + * @since 3.11.0 + * + * @param {object} crop - The crop data object. This is the `GameObject._crop` property. + * @param {number} x - The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. + * @param {number} y - The y coordinate to start the crop from. Cannot be negative or exceed the Frame height. + * @param {number} width - The width of the crop rectangle. Cannot exceed the Frame width. + * @param {number} height - The height of the crop rectangle. Cannot exceed the Frame height. + * @param {boolean} flipX - Does the parent Game Object have flipX set? + * @param {boolean} flipY - Does the parent Game Object have flipY set? + * + * @return {object} The updated crop data object. + */ + setCropUVs: function (crop, x, y, width, height, flipX, flipY) + { + // Clamp the input values + + var cx = this.cutX; + var cy = this.cutY; + var cw = this.cutWidth; + var ch = this.cutHeight; + var rw = this.realWidth; + var rh = this.realHeight; + + x = Clamp(x, 0, rw); + y = Clamp(y, 0, rh); + + width = Clamp(width, 0, rw - x); + height = Clamp(height, 0, rh - y); + + var ox = cx + x; + var oy = cy + y; + var ow = width; + var oh = height; + + var data = this.data; + + if (data.trim) + { + var ss = data.spriteSourceSize; + + // Need to check for intersection between the cut area and the crop area + // If there is none, we set UV to be empty, otherwise set it to be the intersection area + + width = Clamp(width, 0, cw - x); + height = Clamp(height, 0, ch - y); + + var cropRight = x + width; + var cropBottom = y + height; + + var intersects = !(ss.r < x || ss.b < y || ss.x > cropRight || ss.y > cropBottom); + + if (intersects) + { + var ix = Math.max(ss.x, x); + var iy = Math.max(ss.y, y); + var iw = Math.min(ss.r, cropRight) - ix; + var ih = Math.min(ss.b, cropBottom) - iy; + + ow = iw; + oh = ih; + + if (flipX) + { + ox = cx + (cw - (ix - ss.x) - iw); + } + else + { + ox = cx + (ix - ss.x); + } + + if (flipY) + { + oy = cy + (ch - (iy - ss.y) - ih); + } + else + { + oy = cy + (iy - ss.y); + } + + x = ix; + y = iy; + + width = iw; + height = ih; + } + else + { + ox = 0; + oy = 0; + ow = 0; + oh = 0; + } + } + else + { + if (flipX) + { + ox = cx + (cw - x - width); + } + + if (flipY) + { + oy = cy + (ch - y - height); + } + } + + var tw = this.source.width; + var th = this.source.height; + + // Map the given coordinates into UV space, clamping to the 0-1 range. + + crop.u0 = Math.max(0, ox / tw); + crop.v0 = Math.max(0, oy / th); + crop.u1 = Math.min(1, (ox + ow) / tw); + crop.v1 = Math.min(1, (oy + oh) / th); + + crop.x = x; + crop.y = y; + + crop.cx = ox; + crop.cy = oy; + crop.cw = ow; + crop.ch = oh; + + crop.width = width; + crop.height = height; + + crop.flipX = flipX; + crop.flipY = flipY; + + return crop; + }, + + /** + * Takes a crop data object and recalculates the UVs based on the dimensions inside the crop object. + * Called automatically by `setFrame`. + * + * @method Phaser.Textures.Frame#updateCropUVs + * @since 3.11.0 + * + * @param {object} crop - The crop data object. This is the `GameObject._crop` property. + * @param {boolean} flipX - Does the parent Game Object have flipX set? + * @param {boolean} flipY - Does the parent Game Object have flipY set? + * + * @return {object} The updated crop data object. + */ + updateCropUVs: function (crop, flipX, flipY) + { + return this.setCropUVs(crop, crop.x, crop.y, crop.width, crop.height, flipX, flipY); + }, + + /** + * Updates the internal WebGL UV cache and the drawImage cache. + * + * @method Phaser.Textures.Frame#updateUVs + * @since 3.0.0 + * + * @return {Phaser.Textures.Frame} This Frame object. + */ + updateUVs: function () + { + var cx = this.cutX; + var cy = this.cutY; + var cw = this.cutWidth; + var ch = this.cutHeight; + + // Canvas data + + var cd = this.data.drawImage; + + cd.width = cw; + cd.height = ch; + + // WebGL data + + var tw = this.source.width; + var th = this.source.height; + + this.u0 = cx / tw; + this.v0 = cy / th; + + this.u1 = (cx + cw) / tw; + this.v1 = (cy + ch) / th; + + return this; + }, + + /** + * Updates the internal WebGL UV cache. + * + * @method Phaser.Textures.Frame#updateUVsInverted + * @since 3.0.0 + * + * @return {Phaser.Textures.Frame} This Frame object. + */ + updateUVsInverted: function () + { + var tw = this.source.width; + var th = this.source.height; + + this.u0 = (this.cutX + this.cutHeight) / tw; + this.v0 = this.cutY / th; + + this.u1 = this.cutX / tw; + this.v1 = (this.cutY + this.cutWidth) / th; + + return this; + }, + + /** + * Clones this Frame into a new Frame object. + * + * @method Phaser.Textures.Frame#clone + * @since 3.0.0 + * + * @return {Phaser.Textures.Frame} A clone of this Frame. + */ + clone: function () + { + var clone = new Frame(this.texture, this.name, this.sourceIndex); + + clone.cutX = this.cutX; + clone.cutY = this.cutY; + clone.cutWidth = this.cutWidth; + clone.cutHeight = this.cutHeight; + + clone.x = this.x; + clone.y = this.y; + + clone.width = this.width; + clone.height = this.height; + + clone.halfWidth = this.halfWidth; + clone.halfHeight = this.halfHeight; + + clone.centerX = this.centerX; + clone.centerY = this.centerY; + + clone.rotated = this.rotated; + + clone.data = Extend(true, clone.data, this.data); + + clone.updateUVs(); + + return clone; + }, + + /** + * Destroys this Frames references. + * + * @method Phaser.Textures.Frame#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.texture = null; + + this.source = null; + }, + + /** + * The width of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + * + * @name Phaser.Textures.Frame#realWidth + * @type {number} + * @readonly + * @since 3.0.0 + */ + realWidth: { + + get: function () + { + return this.data.sourceSize.w; + } + + }, + + /** + * The height of the Frame in its un-trimmed, un-padded state, as prepared in the art package, + * before being packed. + * + * @name Phaser.Textures.Frame#realHeight + * @type {number} + * @readonly + * @since 3.0.0 + */ + realHeight: { + + get: function () + { + return this.data.sourceSize.h; + } + + }, + + /** + * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) + * + * @name Phaser.Textures.Frame#radius + * @type {number} + * @readonly + * @since 3.0.0 + */ + radius: { + + get: function () + { + return this.data.radius; + } + + }, + + /** + * Is the Frame trimmed or not? + * + * @name Phaser.Textures.Frame#trimmed + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + trimmed: { + + get: function () + { + return this.data.trim; + } + + }, + + /** + * The Canvas drawImage data object. + * + * @name Phaser.Textures.Frame#canvasData + * @type {object} + * @readonly + * @since 3.0.0 + */ + canvasData: { + + get: function () + { + return this.data.drawImage; + } + + } + +}); + +module.exports = Frame; + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Contains = __webpack_require__(93); +var GetPoint = __webpack_require__(368); +var GetPoints = __webpack_require__(369); +var Random = __webpack_require__(152); + +/** + * @classdesc + * An Ellipse object. + * + * This is a geometry object, containing numerical values and related methods to inspect and modify them. + * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. + * To render an Ellipse you should look at the capabilities of the Graphics class. + * + * @class Ellipse + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x position of the center of the ellipse. + * @param {number} [y=0] - The y position of the center of the ellipse. + * @param {number} [width=0] - The width of the ellipse. + * @param {number} [height=0] - The height of the ellipse. + */ +var Ellipse = new Class({ + + initialize: + + function Ellipse (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 0; } + if (height === undefined) { height = 0; } + + /** + * The x position of the center of the ellipse. + * + * @name Phaser.Geom.Ellipse#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The y position of the center of the ellipse. + * + * @name Phaser.Geom.Ellipse#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + + /** + * The width of the ellipse. + * + * @name Phaser.Geom.Ellipse#width + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.width = width; + + /** + * The height of the ellipse. + * + * @name Phaser.Geom.Ellipse#height + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.height = height; + }, + + /** + * Check to see if the Ellipse contains the given x / y coordinates. + * + * @method Phaser.Geom.Ellipse#contains + * @since 3.0.0 + * + * @param {number} x - The x coordinate to check within the ellipse. + * @param {number} y - The y coordinate to check within the ellipse. + * + * @return {boolean} True if the coordinates are within the ellipse, otherwise false. + */ + contains: function (x, y) + { + return Contains(this, x, y); + }, + + /** + * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * + * @method Phaser.Geom.Ellipse#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {number} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse. + * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created. + * + * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse. + */ + getPoint: function (position, point) + { + return GetPoint(this, position, point); + }, + + /** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse, + * based on the given quantity or stepRate values. + * + * @method Phaser.Geom.Ellipse#getPoints + * @since 3.0.0 + * + * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. + * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. + * + * @return {Phaser.Geom.Point[]} An array of Point objects pertaining to the points around the circumference of the ellipse. + */ + getPoints: function (quantity, stepRate, output) + { + return GetPoints(this, quantity, stepRate, output); + }, + + /** + * Returns a uniformly distributed random point from anywhere within the given Ellipse. + * + * @method Phaser.Geom.Ellipse#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} [point] - A Point or point-like object to set the random `x` and `y` values in. + * + * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties. + */ + getRandomPoint: function (point) + { + return Random(this, point); + }, + + /** + * Sets the x, y, width and height of this ellipse. + * + * @method Phaser.Geom.Ellipse#setTo + * @since 3.0.0 + * + * @param {number} x - The x position of the center of the ellipse. + * @param {number} y - The y position of the center of the ellipse. + * @param {number} width - The width of the ellipse. + * @param {number} height - The height of the ellipse. + * + * @return {Phaser.Geom.Ellipse} This Ellipse object. + */ + setTo: function (x, y, width, height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets this Ellipse to be empty with a width and height of zero. + * Does not change its position. + * + * @method Phaser.Geom.Ellipse#setEmpty + * @since 3.0.0 + * + * @return {Phaser.Geom.Ellipse} This Ellipse object. + */ + setEmpty: function () + { + this.width = 0; + this.height = 0; + + return this; + }, + + /** + * Sets the position of this Ellipse. + * + * @method Phaser.Geom.Ellipse#setPosition + * @since 3.0.0 + * + * @param {number} x - The x position of the center of the ellipse. + * @param {number} y - The y position of the center of the ellipse. + * + * @return {Phaser.Geom.Ellipse} This Ellipse object. + */ + setPosition: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * Sets the size of this Ellipse. + * Does not change its position. + * + * @method Phaser.Geom.Ellipse#setSize + * @since 3.0.0 + * + * @param {number} width - The width of the ellipse. + * @param {number} [height=width] - The height of the ellipse. + * + * @return {Phaser.Geom.Ellipse} This Ellipse object. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + this.width = width; + this.height = height; + + return this; + }, + + /** + * Checks to see if the Ellipse is empty: has a width or height equal to zero. + * + * @method Phaser.Geom.Ellipse#isEmpty + * @since 3.0.0 + * + * @return {boolean} True if the Ellipse is empty, otherwise false. + */ + isEmpty: function () + { + return (this.width <= 0 || this.height <= 0); + }, + + /** + * Returns the minor radius of the ellipse. Also known as the Semi Minor Axis. + * + * @method Phaser.Geom.Ellipse#getMinorRadius + * @since 3.0.0 + * + * @return {number} The minor radius. + */ + getMinorRadius: function () + { + return Math.min(this.width, this.height) / 2; + }, + + /** + * Returns the major radius of the ellipse. Also known as the Semi Major Axis. + * + * @method Phaser.Geom.Ellipse#getMajorRadius + * @since 3.0.0 + * + * @return {number} The major radius. + */ + getMajorRadius: function () + { + return Math.max(this.width, this.height) / 2; + }, + + /** + * The left position of the Ellipse. + * + * @name Phaser.Geom.Ellipse#left + * @type {number} + * @since 3.0.0 + */ + left: { + + get: function () + { + return this.x - (this.width / 2); + }, + + set: function (value) + { + this.x = value + (this.width / 2); + } + + }, + + /** + * The right position of the Ellipse. + * + * @name Phaser.Geom.Ellipse#right + * @type {number} + * @since 3.0.0 + */ + right: { + + get: function () + { + return this.x + (this.width / 2); + }, + + set: function (value) + { + this.x = value - (this.width / 2); + } + + }, + + /** + * The top position of the Ellipse. + * + * @name Phaser.Geom.Ellipse#top + * @type {number} + * @since 3.0.0 + */ + top: { + + get: function () + { + return this.y - (this.height / 2); + }, + + set: function (value) + { + this.y = value + (this.height / 2); + } + + }, + + /** + * The bottom position of the Ellipse. + * + * @name Phaser.Geom.Ellipse#bottom + * @type {number} + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return this.y + (this.height / 2); + }, + + set: function (value) + { + this.y = value - (this.height / 2); + } + + } + +}); + +module.exports = Ellipse; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check to see if the Ellipse contains the given x / y coordinates. + * + * @function Phaser.Geom.Ellipse.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to check. + * @param {number} x - The x coordinate to check within the ellipse. + * @param {number} y - The y coordinate to check within the ellipse. + * + * @return {boolean} True if the coordinates are within the ellipse, otherwise false. + */ +var Contains = function (ellipse, x, y) +{ + if (ellipse.width <= 0 || ellipse.height <= 0) + { + return false; + } + + // Normalize the coords to an ellipse with center 0,0 and a radius of 0.5 + var normx = ((x - ellipse.x) / ellipse.width); + var normy = ((y - ellipse.y) / ellipse.height); + + normx *= normx; + normy *= normy; + + return (normx + normy < 0.25); +}; + +module.exports = Contains; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Actions = __webpack_require__(229); +var Class = __webpack_require__(0); +var Events = __webpack_require__(110); +var GetFastValue = __webpack_require__(2); +var GetValue = __webpack_require__(6); +var IsPlainObject = __webpack_require__(7); +var Range = __webpack_require__(362); +var Set = __webpack_require__(105); +var Sprite = __webpack_require__(67); + +/** + * @classdesc + * A Group is a way for you to create, manipulate, or recycle similar Game Objects. + * + * Group membership is non-exclusive. A Game Object can belong to several groups, one group, or none. + * + * Groups themselves aren't displayable, and can't be positioned, rotated, scaled, or hidden. + * + * @class Group + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * @param {Phaser.Scene} scene - The scene this group belongs to. + * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings. + * + * @see Phaser.Physics.Arcade.Group + * @see Phaser.Physics.Arcade.StaticGroup + */ +var Group = new Class({ + + initialize: + + function Group (scene, children, config) + { + // They can pass in any of the following as the first argument: + + // 1) A single child + // 2) An array of children + // 3) A config object + // 4) An array of config objects + + // Or they can pass in a child, or array of children AND a config object + + if (config) + { + // config has been set, are the children an array? + + if (children && !Array.isArray(children)) + { + children = [ children ]; + } + } + else if (Array.isArray(children)) + { + // No config, so let's check the children argument + + if (IsPlainObject(children[0])) + { + // It's an array of plain config objects + config = children; + children = null; + } + } + else if (IsPlainObject(children)) + { + // Children isn't an array. Is it a config object though? + config = children; + children = null; + } + + /** + * This scene this group belongs to. + * + * @name Phaser.GameObjects.Group#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * Members of this group. + * + * @name Phaser.GameObjects.Group#children + * @type {Phaser.Structs.Set.} + * @since 3.0.0 + */ + this.children = new Set(children); + + /** + * A flag identifying this object as a group. + * + * @name Phaser.GameObjects.Group#isParent + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.isParent = true; + + /** + * The class to create new group members from. + * + * @name Phaser.GameObjects.Group#classType + * @type {Function} + * @since 3.0.0 + * @default Phaser.GameObjects.Sprite + */ + this.classType = GetFastValue(config, 'classType', Sprite); + + /** + * The name of this group. + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.GameObjects.Group#name + * @type {string} + * @default '' + * @since 3.18.0 + */ + this.name = GetFastValue(config, 'name', ''); + + /** + * Whether this group runs its {@link Phaser.GameObjects.Group#preUpdate} method + * (which may update any members). + * + * @name Phaser.GameObjects.Group#active + * @type {boolean} + * @since 3.0.0 + */ + this.active = GetFastValue(config, 'active', true); + + /** + * The maximum size of this group, if used as a pool. -1 is no limit. + * + * @name Phaser.GameObjects.Group#maxSize + * @type {integer} + * @since 3.0.0 + * @default -1 + */ + this.maxSize = GetFastValue(config, 'maxSize', -1); + + /** + * A default texture key to use when creating new group members. + * + * This is used in {@link Phaser.GameObjects.Group#create} + * but not in {@link Phaser.GameObjects.Group#createMultiple}. + * + * @name Phaser.GameObjects.Group#defaultKey + * @type {string} + * @since 3.0.0 + */ + this.defaultKey = GetFastValue(config, 'defaultKey', null); + + /** + * A default texture frame to use when creating new group members. + * + * @name Phaser.GameObjects.Group#defaultFrame + * @type {(string|integer)} + * @since 3.0.0 + */ + this.defaultFrame = GetFastValue(config, 'defaultFrame', null); + + /** + * Whether to call the update method of any members. + * + * @name Phaser.GameObjects.Group#runChildUpdate + * @type {boolean} + * @default false + * @since 3.0.0 + * @see Phaser.GameObjects.Group#preUpdate + */ + this.runChildUpdate = GetFastValue(config, 'runChildUpdate', false); + + /** + * A function to be called when adding or creating group members. + * + * @name Phaser.GameObjects.Group#createCallback + * @type {?Phaser.Types.GameObjects.Group.GroupCallback} + * @since 3.0.0 + */ + this.createCallback = GetFastValue(config, 'createCallback', null); + + /** + * A function to be called when removing group members. + * + * @name Phaser.GameObjects.Group#removeCallback + * @type {?Phaser.Types.GameObjects.Group.GroupCallback} + * @since 3.0.0 + */ + this.removeCallback = GetFastValue(config, 'removeCallback', null); + + /** + * A function to be called when creating several group members at once. + * + * @name Phaser.GameObjects.Group#createMultipleCallback + * @type {?Phaser.Types.GameObjects.Group.GroupMultipleCreateCallback} + * @since 3.0.0 + */ + this.createMultipleCallback = GetFastValue(config, 'createMultipleCallback', null); + + if (config) + { + this.createMultiple(config); + } + }, + + /** + * Creates a new Game Object and adds it to this group, unless the group {@link Phaser.GameObjects.Group#isFull is full}. + * + * Calls {@link Phaser.GameObjects.Group#createCallback}. + * + * @method Phaser.GameObjects.Group#create + * @since 3.0.0 + * + * @param {number} [x=0] - The horizontal position of the new Game Object in the world. + * @param {number} [y=0] - The vertical position of the new Game Object in the world. + * @param {string} [key=defaultKey] - The texture key of the new Game Object. + * @param {(string|integer)} [frame=defaultFrame] - The texture frame of the new Game Object. + * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of the new Game Object. + * @param {boolean} [active=true] - The {@link Phaser.GameObjects.GameObject#active} state of the new Game Object. + * + * @return {any} The new Game Object (usually a Sprite, etc.). + */ + create: function (x, y, key, frame, visible, active) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (key === undefined) { key = this.defaultKey; } + if (frame === undefined) { frame = this.defaultFrame; } + if (visible === undefined) { visible = true; } + if (active === undefined) { active = true; } + + // Pool? + if (this.isFull()) + { + return null; + } + + var child = new this.classType(this.scene, x, y, key, frame); + + this.scene.sys.displayList.add(child); + + if (child.preUpdate) + { + this.scene.sys.updateList.add(child); + } + + child.visible = visible; + child.setActive(active); + + this.add(child); + + return child; + }, + + /** + * Creates several Game Objects and adds them to this group. + * + * If the group becomes {@link Phaser.GameObjects.Group#isFull}, no further Game Objects are created. + * + * Calls {@link Phaser.GameObjects.Group#createMultipleCallback} and {@link Phaser.GameObjects.Group#createCallback}. + * + * @method Phaser.GameObjects.Group#createMultiple + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Group.GroupCreateConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig[]} config - Creation settings. This can be a single configuration object or an array of such objects, which will be applied in turn. + * + * @return {any[]} The newly created Game Objects. + */ + createMultiple: function (config) + { + if (this.isFull()) + { + return []; + } + + if (!Array.isArray(config)) + { + config = [ config ]; + } + + var output = []; + + if (config[0].key) + { + for (var i = 0; i < config.length; i++) + { + var entries = this.createFromConfig(config[i]); + + output = output.concat(entries); + } + } + + return output; + }, + + /** + * A helper for {@link Phaser.GameObjects.Group#createMultiple}. + * + * @method Phaser.GameObjects.Group#createFromConfig + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Group.GroupCreateConfig} options - Creation settings. + * + * @return {any[]} The newly created Game Objects. + */ + createFromConfig: function (options) + { + if (this.isFull()) + { + return []; + } + + this.classType = GetFastValue(options, 'classType', this.classType); + + var key = GetFastValue(options, 'key', undefined); + var frame = GetFastValue(options, 'frame', null); + var visible = GetFastValue(options, 'visible', true); + var active = GetFastValue(options, 'active', true); + + var entries = []; + + // Can't do anything without at least a key + if (key === undefined) + { + return entries; + } + else + { + if (!Array.isArray(key)) + { + key = [ key ]; + } + + if (!Array.isArray(frame)) + { + frame = [ frame ]; + } + } + + // Build an array of key frame pairs to loop through + + var repeat = GetFastValue(options, 'repeat', 0); + var randomKey = GetFastValue(options, 'randomKey', false); + var randomFrame = GetFastValue(options, 'randomFrame', false); + var yoyo = GetFastValue(options, 'yoyo', false); + var quantity = GetFastValue(options, 'frameQuantity', 1); + var max = GetFastValue(options, 'max', 0); + + // If a grid is set we use that to override the quantity? + + var range = Range(key, frame, { + max: max, + qty: quantity, + random: randomKey, + randomB: randomFrame, + repeat: repeat, + yoyo: yoyo + }); + + if (options.createCallback) + { + this.createCallback = options.createCallback; + } + + if (options.removeCallback) + { + this.removeCallback = options.removeCallback; + } + + for (var c = 0; c < range.length; c++) + { + var created = this.create(0, 0, range[c].a, range[c].b, visible, active); + + if (!created) + { + break; + } + + entries.push(created); + } + + // Post-creation options (applied only to those items created in this call): + + var x = GetValue(options, 'setXY.x', 0); + var y = GetValue(options, 'setXY.y', 0); + var stepX = GetValue(options, 'setXY.stepX', 0); + var stepY = GetValue(options, 'setXY.stepY', 0); + + Actions.SetXY(entries, x, y, stepX, stepY); + + var rotation = GetValue(options, 'setRotation.value', 0); + var stepRotation = GetValue(options, 'setRotation.step', 0); + + Actions.SetRotation(entries, rotation, stepRotation); + + var scaleX = GetValue(options, 'setScale.x', 1); + var scaleY = GetValue(options, 'setScale.y', scaleX); + var stepScaleX = GetValue(options, 'setScale.stepX', 0); + var stepScaleY = GetValue(options, 'setScale.stepY', 0); + + Actions.SetScale(entries, scaleX, scaleY, stepScaleX, stepScaleY); + + var alpha = GetValue(options, 'setAlpha.value', 1); + var stepAlpha = GetValue(options, 'setAlpha.step', 0); + + Actions.SetAlpha(entries, alpha, stepAlpha); + + var hitArea = GetFastValue(options, 'hitArea', null); + var hitAreaCallback = GetFastValue(options, 'hitAreaCallback', null); + + if (hitArea) + { + Actions.SetHitArea(entries, hitArea, hitAreaCallback); + } + + var grid = GetFastValue(options, 'gridAlign', false); + + if (grid) + { + Actions.GridAlign(entries, grid); + } + + if (this.createMultipleCallback) + { + this.createMultipleCallback.call(this, entries); + } + + return entries; + }, + + /** + * Updates any group members, if {@link Phaser.GameObjects.Group#runChildUpdate} is enabled. + * + * @method Phaser.GameObjects.Group#preUpdate + * @since 3.0.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + if (!this.runChildUpdate || this.children.size === 0) + { + return; + } + + // Because a Group child may mess with the length of the Group during its update + var temp = this.children.entries.slice(); + + for (var i = 0; i < temp.length; i++) + { + var item = temp[i]; + + if (item.active) + { + item.update(time, delta); + } + } + }, + + /** + * Adds a Game Object to this group. + * + * Calls {@link Phaser.GameObjects.Group#createCallback}. + * + * @method Phaser.GameObjects.Group#add + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to add. + * @param {boolean} [addToScene=false] - Also add the Game Object to the scene. + * + * @return {Phaser.GameObjects.Group} This Group object. + */ + add: function (child, addToScene) + { + if (addToScene === undefined) { addToScene = false; } + + if (this.isFull()) + { + return this; + } + + this.children.set(child); + + if (this.createCallback) + { + this.createCallback.call(this, child); + } + + if (addToScene) + { + this.scene.sys.displayList.add(child); + + if (child.preUpdate) + { + this.scene.sys.updateList.add(child); + } + } + + child.on(Events.DESTROY, this.remove, this); + + return this; + }, + + /** + * Adds several Game Objects to this group. + * + * Calls {@link Phaser.GameObjects.Group#createCallback}. + * + * @method Phaser.GameObjects.Group#addMultiple + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject[]} children - The Game Objects to add. + * @param {boolean} [addToScene=false] - Also add the Game Objects to the scene. + * + * @return {Phaser.GameObjects.Group} This group. + */ + addMultiple: function (children, addToScene) + { + if (addToScene === undefined) { addToScene = false; } + + if (Array.isArray(children)) + { + for (var i = 0; i < children.length; i++) + { + this.add(children[i], addToScene); + } + } + + return this; + }, + + /** + * Removes a member of this Group and optionally removes it from the Scene and / or destroys it. + * + * Calls {@link Phaser.GameObjects.Group#removeCallback}. + * + * @method Phaser.GameObjects.Group#remove + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to remove. + * @param {boolean} [removeFromScene=false] - Optionally remove the Group member from the Scene it belongs to. + * @param {boolean} [destroyChild=false] - Optionally call destroy on the removed Group member. + * + * @return {Phaser.GameObjects.Group} This Group object. + */ + remove: function (child, removeFromScene, destroyChild) + { + if (removeFromScene === undefined) { removeFromScene = false; } + if (destroyChild === undefined) { destroyChild = false; } + + if (!this.children.contains(child)) + { + return this; + } + + this.children.delete(child); + + if (this.removeCallback) + { + this.removeCallback.call(this, child); + } + + child.off(Events.DESTROY, this.remove, this); + + if (destroyChild) + { + child.destroy(); + } + else if (removeFromScene) + { + child.scene.sys.displayList.remove(child); + + if (child.preUpdate) + { + child.scene.sys.updateList.remove(child); + } + } + + return this; + }, + + /** + * Removes all members of this Group and optionally removes them from the Scene and / or destroys them. + * + * Does not call {@link Phaser.GameObjects.Group#removeCallback}. + * + * @method Phaser.GameObjects.Group#clear + * @since 3.0.0 + * + * @param {boolean} [removeFromScene=false] - Optionally remove each Group member from the Scene. + * @param {boolean} [destroyChild=false] - Optionally call destroy on the removed Group members. + * + * @return {Phaser.GameObjects.Group} This group. + */ + clear: function (removeFromScene, destroyChild) + { + if (removeFromScene === undefined) { removeFromScene = false; } + if (destroyChild === undefined) { destroyChild = false; } + + var children = this.children; + + for (var i = 0; i < children.size; i++) + { + var gameObject = children.entries[i]; + + gameObject.off(Events.DESTROY, this.remove, this); + + if (destroyChild) + { + gameObject.destroy(); + } + else if (removeFromScene) + { + gameObject.scene.sys.displayList.remove(gameObject); + + if (gameObject.preUpdate) + { + gameObject.scene.sys.updateList.remove(gameObject); + } + } + } + + this.children.clear(); + + return this; + }, + + /** + * Tests if a Game Object is a member of this group. + * + * @method Phaser.GameObjects.Group#contains + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - A Game Object. + * + * @return {boolean} True if the Game Object is a member of this group. + */ + contains: function (child) + { + return this.children.contains(child); + }, + + /** + * All members of the group. + * + * @method Phaser.GameObjects.Group#getChildren + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject[]} The group members. + */ + getChildren: function () + { + return this.children.entries; + }, + + /** + * The number of members of the group. + * + * @method Phaser.GameObjects.Group#getLength + * @since 3.0.0 + * + * @return {integer} + */ + getLength: function () + { + return this.children.size; + }, + + /** + * Scans the Group, from top to bottom, for the first member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * + * @method Phaser.GameObjects.Group#getFirst + * @since 3.0.0 + * + * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. + * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. + * @param {number} [x] - The horizontal position of the Game Object in the world. + * @param {number} [y] - The vertical position of the Game Object in the world. + * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). + * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). + * + * @return {?any} The first matching group member, or a newly created member, or null. + */ + getFirst: function (state, createIfNull, x, y, key, frame, visible) + { + return this.getHandler(true, 1, state, createIfNull, x, y, key, frame, visible); + }, + + /** + * Scans the Group, from top to bottom, for the nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * + * @method Phaser.GameObjects.Group#getFirstNth + * @since 3.6.0 + * + * @param {integer} nth - The nth matching Group member to search for. + * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. + * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. + * @param {number} [x] - The horizontal position of the Game Object in the world. + * @param {number} [y] - The vertical position of the Game Object in the world. + * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). + * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). + * + * @return {?any} The first matching group member, or a newly created member, or null. + */ + getFirstNth: function (nth, state, createIfNull, x, y, key, frame, visible) + { + return this.getHandler(true, nth, state, createIfNull, x, y, key, frame, visible); + }, + + /** + * Scans the Group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * + * @method Phaser.GameObjects.Group#getLast + * @since 3.6.0 + * + * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. + * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. + * @param {number} [x] - The horizontal position of the Game Object in the world. + * @param {number} [y] - The vertical position of the Game Object in the world. + * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). + * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). + * + * @return {?any} The first matching group member, or a newly created member, or null. + */ + getLast: function (state, createIfNull, x, y, key, frame, visible) + { + return this.getHandler(false, 1, state, createIfNull, x, y, key, frame, visible); + }, + + /** + * Scans the Group for the last nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * + * @method Phaser.GameObjects.Group#getLastNth + * @since 3.6.0 + * + * @param {integer} nth - The nth matching Group member to search for. + * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. + * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. + * @param {number} [x] - The horizontal position of the Game Object in the world. + * @param {number} [y] - The vertical position of the Game Object in the world. + * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). + * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). + * + * @return {?any} The first matching group member, or a newly created member, or null. + */ + getLastNth: function (nth, state, createIfNull, x, y, key, frame, visible) + { + return this.getHandler(false, nth, state, createIfNull, x, y, key, frame, visible); + }, + + /** + * Scans the group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, + * assigns `x` and `y`, and returns the member. + * + * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * + * @method Phaser.GameObjects.Group#getHandler + * @private + * @since 3.6.0 + * + * @param {boolean} forwards - Search front to back or back to front? + * @param {integer} nth - Stop matching after nth successful matches. + * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. + * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. + * @param {number} [x] - The horizontal position of the Game Object in the world. + * @param {number} [y] - The vertical position of the Game Object in the world. + * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). + * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). + * + * @return {?any} The first matching group member, or a newly created member, or null. + */ + getHandler: function (forwards, nth, state, createIfNull, x, y, key, frame, visible) + { + if (state === undefined) { state = false; } + if (createIfNull === undefined) { createIfNull = false; } + + var gameObject; + + var i; + var total = 0; + var children = this.children.entries; + + if (forwards) + { + for (i = 0; i < children.length; i++) + { + gameObject = children[i]; + + if (gameObject.active === state) + { + total++; + + if (total === nth) + { + break; + } + } + else + { + gameObject = null; + } + } + } + else + { + for (i = children.length - 1; i >= 0; i--) + { + gameObject = children[i]; + + if (gameObject.active === state) + { + total++; + + if (total === nth) + { + break; + } + } + else + { + gameObject = null; + } + } + } + + if (gameObject) + { + if (typeof(x) === 'number') + { + gameObject.x = x; + } + + if (typeof(y) === 'number') + { + gameObject.y = y; + } + + return gameObject; + } + + // Got this far? We need to create or bail + if (createIfNull) + { + return this.create(x, y, key, frame, visible); + } + else + { + return null; + } + }, + + /** + * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, + * assigns `x` and `y`, and returns the member. + * + * If no inactive member is found and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. + * The new Game Object will have its active state set to `true`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * + * @method Phaser.GameObjects.Group#get + * @since 3.0.0 + * + * @param {number} [x] - The horizontal position of the Game Object in the world. + * @param {number} [y] - The vertical position of the Game Object in the world. + * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). + * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). + * + * @return {?any} The first inactive group member, or a newly created member, or null. + */ + get: function (x, y, key, frame, visible) + { + return this.getFirst(false, true, x, y, key, frame, visible); + }, + + /** + * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `true`, + * assigns `x` and `y`, and returns the member. + * + * If no active member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * + * @method Phaser.GameObjects.Group#getFirstAlive + * @since 3.0.0 + * + * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. + * @param {number} [x] - The horizontal position of the Game Object in the world. + * @param {number} [y] - The vertical position of the Game Object in the world. + * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). + * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). + * + * @return {any} The first active group member, or a newly created member, or null. + */ + getFirstAlive: function (createIfNull, x, y, key, frame, visible) + { + return this.getFirst(true, createIfNull, x, y, key, frame, visible); + }, + + /** + * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, + * assigns `x` and `y`, and returns the member. + * + * If no inactive member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`. + * The new Game Object will have an active state set to `true`. + * Unless a new member is created, `key`, `frame`, and `visible` are ignored. + * + * @method Phaser.GameObjects.Group#getFirstDead + * @since 3.0.0 + * + * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. + * @param {number} [x] - The horizontal position of the Game Object in the world. + * @param {number} [y] - The vertical position of the Game Object in the world. + * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). + * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). + * + * @return {any} The first inactive group member, or a newly created member, or null. + */ + getFirstDead: function (createIfNull, x, y, key, frame, visible) + { + return this.getFirst(false, createIfNull, x, y, key, frame, visible); + }, + + /** + * {@link Phaser.GameObjects.Components.Animation#play Plays} an animation for all members of this group. + * + * @method Phaser.GameObjects.Group#playAnimation + * @since 3.0.0 + * + * @param {string} key - The string-based key of the animation to play. + * @param {string} [startFrame=0] - Optionally start the animation playing from this frame index. + * + * @return {Phaser.GameObjects.Group} This Group object. + */ + playAnimation: function (key, startFrame) + { + Actions.PlayAnimation(this.children.entries, key, startFrame); + + return this; + }, + + /** + * Whether this group's size at its {@link Phaser.GameObjects.Group#maxSize maximum}. + * + * @method Phaser.GameObjects.Group#isFull + * @since 3.0.0 + * + * @return {boolean} True if the number of members equals {@link Phaser.GameObjects.Group#maxSize}. + */ + isFull: function () + { + if (this.maxSize === -1) + { + return false; + } + else + { + return (this.children.size >= this.maxSize); + } + }, + + /** + * Counts the number of active (or inactive) group members. + * + * @method Phaser.GameObjects.Group#countActive + * @since 3.0.0 + * + * @param {boolean} [value=true] - Count active (true) or inactive (false) group members. + * + * @return {integer} The number of group members with an active state matching the `active` argument. + */ + countActive: function (value) + { + if (value === undefined) { value = true; } + + var total = 0; + + for (var i = 0; i < this.children.size; i++) + { + if (this.children.entries[i].active === value) + { + total++; + } + } + + return total; + }, + + /** + * Counts the number of in-use (active) group members. + * + * @method Phaser.GameObjects.Group#getTotalUsed + * @since 3.0.0 + * + * @return {integer} The number of group members with an active state of true. + */ + getTotalUsed: function () + { + return this.countActive(); + }, + + /** + * The difference of {@link Phaser.GameObjects.Group#maxSize} and the number of active group members. + * + * This represents the number of group members that could be created or reactivated before reaching the size limit. + * + * @method Phaser.GameObjects.Group#getTotalFree + * @since 3.0.0 + * + * @return {integer} maxSize minus the number of active group numbers; or a large number (if maxSize is -1). + */ + getTotalFree: function () + { + var used = this.getTotalUsed(); + var capacity = (this.maxSize === -1) ? 999999999999 : this.maxSize; + + return (capacity - used); + }, + + /** + * Sets the depth of each group member. + * + * @method Phaser.GameObjects.Group#setDepth + * @since 3.0.0 + * + * @param {number} value - The amount to set the property to. + * @param {number} step - This is added to the `value` amount, multiplied by the iteration counter. + * + * @return {Phaser.GameObjects.Group} This Group object. + */ + setDepth: function (value, step) + { + Actions.SetDepth(this.children.entries, value, step); + + return this; + }, + + /** + * Deactivates a member of this group. + * + * @method Phaser.GameObjects.Group#kill + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A member of this group. + */ + kill: function (gameObject) + { + if (this.children.contains(gameObject)) + { + gameObject.setActive(false); + } + }, + + /** + * Deactivates and hides a member of this group. + * + * @method Phaser.GameObjects.Group#killAndHide + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A member of this group. + */ + killAndHide: function (gameObject) + { + if (this.children.contains(gameObject)) + { + gameObject.setActive(false); + gameObject.setVisible(false); + } + }, + + /** + * Toggles (flips) the visible state of each member of this group. + * + * @method Phaser.GameObjects.Group#toggleVisible + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Group} This Group object. + */ + toggleVisible: function () + { + Actions.ToggleVisible(this.children.entries); + + return this; + }, + + /** + * Empties this group and removes it from the Scene. + * + * Does not call {@link Phaser.GameObjects.Group#removeCallback}. + * + * @method Phaser.GameObjects.Group#destroy + * @since 3.0.0 + * + * @param {boolean} [destroyChildren=false] - Also {@link Phaser.GameObjects.GameObject#destroy} each group member. + */ + destroy: function (destroyChildren) + { + if (destroyChildren === undefined) { destroyChildren = false; } + + // This Game Object had already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + if (destroyChildren) + { + var children = this.children; + + for (var i = 0; i < children.size; i++) + { + var gameObject = children.entries[i]; + + // Remove the event hook first or it'll go all recursive hell on us + gameObject.off(Events.DESTROY, this.remove, this); + + gameObject.destroy(); + } + } + + this.children.clear(); + + this.scene = undefined; + this.children = undefined; + } + +}); + +module.exports = Group; + + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var GameObject = __webpack_require__(13); +var ImageRender = __webpack_require__(929); + +/** + * @classdesc + * An Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + * + * @class Image + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.TextureCrop + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + */ +var Image = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.Depth, + Components.Flip, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Size, + Components.TextureCrop, + Components.Tint, + Components.Transform, + Components.Visible, + ImageRender + ], + + initialize: + + function Image (scene, x, y, texture, frame) + { + GameObject.call(this, scene, 'Image'); + + /** + * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. + * + * @name Phaser.GameObjects.Image#_crop + * @type {object} + * @private + * @since 3.11.0 + */ + this._crop = this.resetCropObject(); + + this.setTexture(texture, frame); + this.setPosition(x, y); + this.setSizeToFrame(); + this.setOriginFromFrame(); + this.initPipeline(); + } + +}); + +module.exports = Image; + + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var EaseMap = __webpack_require__(163); + +/** + * [description] + * + * @function Phaser.Tweens.Builders.GetEaseFunction + * @since 3.0.0 + * + * @param {(string|function)} ease - [description] + * @param {array} easeParams - [description] + * + * @return {function} [description] + */ +var GetEaseFunction = function (ease, easeParams) +{ + if (typeof ease === 'string' && EaseMap.hasOwnProperty(ease)) + { + if (easeParams) + { + var cloneParams = easeParams.slice(0); + + cloneParams.unshift(0); + + return function (v) + { + cloneParams[0] = v; + + return EaseMap[ease].apply(this, cloneParams); + }; + } + else + { + // String based look-up + return EaseMap[ease]; + } + } + else if (typeof ease === 'function') + { + // Custom function + return ease; + } + else if (Array.isArray(ease) && ease.length === 4) + { + // Bezier function (TODO) + } + + return EaseMap.Power0; +}; + +module.exports = GetEaseFunction; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determine whether the source object has a property with the specified key. + * + * @function Phaser.Utils.Objects.HasValue + * @since 3.0.0 + * + * @param {object} source - The source object to be checked. + * @param {string} key - The property to check for within the object + * + * @return {boolean} `true` if the provided `key` exists on the `source` object, otherwise `false`. + */ +var HasValue = function (source, key) +{ + return (source.hasOwnProperty(key)); +}; + +module.exports = HasValue; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders a filled path for the given Shape. + * + * @method Phaser.GameObjects.Shape#FillPathWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The WebGL Pipeline used to render this Shape. + * @param {Phaser.GameObjects.Components.TransformMatrix} calcMatrix - The transform matrix used to get the position values. + * @param {Phaser.GameObjects.Shape} src - The Game Object shape being rendered in this call. + * @param {number} alpha - The base alpha value. + * @param {number} dx - The source displayOriginX. + * @param {number} dy - The source displayOriginY. + */ +var FillPathWebGL = function (pipeline, calcMatrix, src, alpha, dx, dy) +{ + var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + + var path = src.pathData; + var pathIndexes = src.pathIndexes; + + for (var i = 0; i < pathIndexes.length; i += 3) + { + var p0 = pathIndexes[i] * 2; + var p1 = pathIndexes[i + 1] * 2; + var p2 = pathIndexes[i + 2] * 2; + + var x0 = path[p0 + 0] - dx; + var y0 = path[p0 + 1] - dy; + var x1 = path[p1 + 0] - dx; + var y1 = path[p1 + 1] - dy; + var x2 = path[p2 + 0] - dx; + var y2 = path[p2 + 1] - dy; + + var tx0 = calcMatrix.getX(x0, y0); + var ty0 = calcMatrix.getY(x0, y0); + + var tx1 = calcMatrix.getX(x1, y1); + var ty1 = calcMatrix.getY(x1, y1); + + var tx2 = calcMatrix.getX(x2, y2); + var ty2 = calcMatrix.getY(x2, y2); + + pipeline.setTexture2D(); + + pipeline.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, 0, 0, 1, 1, fillTintColor, fillTintColor, fillTintColor, pipeline.tintEffect); + } +}; + +module.exports = FillPathWebGL; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports) { + +/** +* The `Matter.Vector` module contains methods for creating and manipulating vectors. +* Vectors are the basis of all the geometry related operations in the engine. +* A `Matter.Vector` object is of the form `{ x: 0, y: 0 }`. +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Vector +*/ + +// TODO: consider params for reusing vector objects + +var Vector = {}; + +module.exports = Vector; + +(function() { + + /** + * Creates a new vector. + * @method create + * @param {number} x + * @param {number} y + * @return {vector} A new vector + */ + Vector.create = function(x, y) { + return { x: x || 0, y: y || 0 }; + }; + + /** + * Returns a new vector with `x` and `y` copied from the given `vector`. + * @method clone + * @param {vector} vector + * @return {vector} A new cloned vector + */ + Vector.clone = function(vector) { + return { x: vector.x, y: vector.y }; + }; + + /** + * Returns the magnitude (length) of a vector. + * @method magnitude + * @param {vector} vector + * @return {number} The magnitude of the vector + */ + Vector.magnitude = function(vector) { + return Math.sqrt((vector.x * vector.x) + (vector.y * vector.y)); + }; + + /** + * Returns the magnitude (length) of a vector (therefore saving a `sqrt` operation). + * @method magnitudeSquared + * @param {vector} vector + * @return {number} The squared magnitude of the vector + */ + Vector.magnitudeSquared = function(vector) { + return (vector.x * vector.x) + (vector.y * vector.y); + }; + + /** + * Rotates the vector about (0, 0) by specified angle. + * @method rotate + * @param {vector} vector + * @param {number} angle + * @param {vector} [output] + * @return {vector} The vector rotated about (0, 0) + */ + Vector.rotate = function(vector, angle, output) { + var cos = Math.cos(angle), sin = Math.sin(angle); + if (!output) output = {}; + var x = vector.x * cos - vector.y * sin; + output.y = vector.x * sin + vector.y * cos; + output.x = x; + return output; + }; + + /** + * Rotates the vector about a specified point by specified angle. + * @method rotateAbout + * @param {vector} vector + * @param {number} angle + * @param {vector} point + * @param {vector} [output] + * @return {vector} A new vector rotated about the point + */ + Vector.rotateAbout = function(vector, angle, point, output) { + var cos = Math.cos(angle), sin = Math.sin(angle); + if (!output) output = {}; + var x = point.x + ((vector.x - point.x) * cos - (vector.y - point.y) * sin); + output.y = point.y + ((vector.x - point.x) * sin + (vector.y - point.y) * cos); + output.x = x; + return output; + }; + + /** + * Normalises a vector (such that its magnitude is `1`). + * @method normalise + * @param {vector} vector + * @return {vector} A new vector normalised + */ + Vector.normalise = function(vector) { + var magnitude = Vector.magnitude(vector); + if (magnitude === 0) + return { x: 0, y: 0 }; + return { x: vector.x / magnitude, y: vector.y / magnitude }; + }; + + /** + * Returns the dot-product of two vectors. + * @method dot + * @param {vector} vectorA + * @param {vector} vectorB + * @return {number} The dot product of the two vectors + */ + Vector.dot = function(vectorA, vectorB) { + return (vectorA.x * vectorB.x) + (vectorA.y * vectorB.y); + }; + + /** + * Returns the cross-product of two vectors. + * @method cross + * @param {vector} vectorA + * @param {vector} vectorB + * @return {number} The cross product of the two vectors + */ + Vector.cross = function(vectorA, vectorB) { + return (vectorA.x * vectorB.y) - (vectorA.y * vectorB.x); + }; + + /** + * Returns the cross-product of three vectors. + * @method cross3 + * @param {vector} vectorA + * @param {vector} vectorB + * @param {vector} vectorC + * @return {number} The cross product of the three vectors + */ + Vector.cross3 = function(vectorA, vectorB, vectorC) { + return (vectorB.x - vectorA.x) * (vectorC.y - vectorA.y) - (vectorB.y - vectorA.y) * (vectorC.x - vectorA.x); + }; + + /** + * Adds the two vectors. + * @method add + * @param {vector} vectorA + * @param {vector} vectorB + * @param {vector} [output] + * @return {vector} A new vector of vectorA and vectorB added + */ + Vector.add = function(vectorA, vectorB, output) { + if (!output) output = {}; + output.x = vectorA.x + vectorB.x; + output.y = vectorA.y + vectorB.y; + return output; + }; + + /** + * Subtracts the two vectors. + * @method sub + * @param {vector} vectorA + * @param {vector} vectorB + * @param {vector} [output] + * @return {vector} A new vector of vectorA and vectorB subtracted + */ + Vector.sub = function(vectorA, vectorB, output) { + if (!output) output = {}; + output.x = vectorA.x - vectorB.x; + output.y = vectorA.y - vectorB.y; + return output; + }; + + /** + * Multiplies a vector and a scalar. + * @method mult + * @param {vector} vector + * @param {number} scalar + * @return {vector} A new vector multiplied by scalar + */ + Vector.mult = function(vector, scalar) { + return { x: vector.x * scalar, y: vector.y * scalar }; + }; + + /** + * Divides a vector and a scalar. + * @method div + * @param {vector} vector + * @param {number} scalar + * @return {vector} A new vector divided by scalar + */ + Vector.div = function(vector, scalar) { + return { x: vector.x / scalar, y: vector.y / scalar }; + }; + + /** + * Returns the perpendicular vector. Set `negate` to true for the perpendicular in the opposite direction. + * @method perp + * @param {vector} vector + * @param {bool} [negate=false] + * @return {vector} The perpendicular vector + */ + Vector.perp = function(vector, negate) { + negate = negate === true ? -1 : 1; + return { x: negate * -vector.y, y: negate * vector.x }; + }; + + /** + * Negates both components of a vector such that it points in the opposite direction. + * @method neg + * @param {vector} vector + * @return {vector} The negated vector + */ + Vector.neg = function(vector) { + return { x: -vector.x, y: -vector.y }; + }; + + /** + * Returns the angle between the vector `vectorB - vectorA` and the x-axis in radians. + * @method angle + * @param {vector} vectorA + * @param {vector} vectorB + * @return {number} The angle in radians + */ + Vector.angle = function(vectorA, vectorB) { + return Math.atan2(vectorB.y - vectorA.y, vectorB.x - vectorA.x); + }; + + /** + * Temporary vector pool (not thread-safe). + * @property _temp + * @type {vector[]} + * @private + */ + Vector._temp = [ + Vector.create(), Vector.create(), + Vector.create(), Vector.create(), + Vector.create(), Vector.create() + ]; + +})(); + +/***/ }), +/* 100 */ +/***/ (function(module, exports) { + +/** +* The `Matter.Bounds` module contains methods for creating and manipulating axis-aligned bounding boxes (AABB). +* +* @class Bounds +*/ + +var Bounds = {}; + +module.exports = Bounds; + +(function() { + + /** + * Creates a new axis-aligned bounding box (AABB) for the given vertices. + * @method create + * @param {vertices} vertices + * @return {bounds} A new bounds object + */ + Bounds.create = function(vertices) { + var bounds = { + min: { x: 0, y: 0 }, + max: { x: 0, y: 0 } + }; + + if (vertices) + Bounds.update(bounds, vertices); + + return bounds; + }; + + /** + * Updates bounds using the given vertices and extends the bounds given a velocity. + * @method update + * @param {bounds} bounds + * @param {vertices} vertices + * @param {vector} velocity + */ + Bounds.update = function(bounds, vertices, velocity) { + bounds.min.x = Infinity; + bounds.max.x = -Infinity; + bounds.min.y = Infinity; + bounds.max.y = -Infinity; + + for (var i = 0; i < vertices.length; i++) { + var vertex = vertices[i]; + if (vertex.x > bounds.max.x) bounds.max.x = vertex.x; + if (vertex.x < bounds.min.x) bounds.min.x = vertex.x; + if (vertex.y > bounds.max.y) bounds.max.y = vertex.y; + if (vertex.y < bounds.min.y) bounds.min.y = vertex.y; + } + + if (velocity) { + if (velocity.x > 0) { + bounds.max.x += velocity.x; + } else { + bounds.min.x += velocity.x; + } + + if (velocity.y > 0) { + bounds.max.y += velocity.y; + } else { + bounds.min.y += velocity.y; + } + } + }; + + /** + * Returns true if the bounds contains the given point. + * @method contains + * @param {bounds} bounds + * @param {vector} point + * @return {boolean} True if the bounds contain the point, otherwise false + */ + Bounds.contains = function(bounds, point) { + return point.x >= bounds.min.x && point.x <= bounds.max.x + && point.y >= bounds.min.y && point.y <= bounds.max.y; + }; + + /** + * Returns true if the two bounds intersect. + * @method overlaps + * @param {bounds} boundsA + * @param {bounds} boundsB + * @return {boolean} True if the bounds overlap, otherwise false + */ + Bounds.overlaps = function(boundsA, boundsB) { + return (boundsA.min.x <= boundsB.max.x && boundsA.max.x >= boundsB.min.x + && boundsA.max.y >= boundsB.min.y && boundsA.min.y <= boundsB.max.y); + }; + + /** + * Translates the bounds by the given vector. + * @method translate + * @param {bounds} bounds + * @param {vector} vector + */ + Bounds.translate = function(bounds, vector) { + bounds.min.x += vector.x; + bounds.max.x += vector.x; + bounds.min.y += vector.y; + bounds.max.y += vector.y; + }; + + /** + * Shifts the bounds to the given position. + * @method shift + * @param {bounds} bounds + * @param {vector} position + */ + Bounds.shift = function(bounds, position) { + var deltaX = bounds.max.x - bounds.min.x, + deltaY = bounds.max.y - bounds.min.y; + + bounds.min.x = position.x; + bounds.max.x = position.x + deltaX; + bounds.min.y = position.y; + bounds.max.y = position.y + deltaY; + }; + +})(); + + +/***/ }), +/* 101 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if the given tile coordinates are within the bounds of the layer. + * + * @function Phaser.Tilemaps.Components.IsInLayerBounds + * @private + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {boolean} `true` if the tile coordinates are within the bounds of the layer, otherwise `false`. + */ +var IsInLayerBounds = function (tileX, tileY, layer) +{ + return (tileX >= 0 && tileX < layer.width && tileY >= 0 && tileY < layer.height); +}; + +module.exports = IsInLayerBounds; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(2); + +/** + * @classdesc + * A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled, + * etc. into this format. Tilemap, StaticTilemapLayer and DynamicTilemapLayer have a reference + * to this data and use it to look up and perform operations on tiles. + * + * @class LayerData + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @param {object} [config] - [description] + */ +var LayerData = new Class({ + + initialize: + + function LayerData (config) + { + if (config === undefined) { config = {}; } + + /** + * The name of the layer, if specified in Tiled. + * + * @name Phaser.Tilemaps.LayerData#name + * @type {string} + * @since 3.0.0 + */ + this.name = GetFastValue(config, 'name', 'layer'); + + /** + * The x offset of where to draw from the top left + * + * @name Phaser.Tilemaps.LayerData#x + * @type {number} + * @since 3.0.0 + */ + this.x = GetFastValue(config, 'x', 0); + + /** + * The y offset of where to draw from the top left + * + * @name Phaser.Tilemaps.LayerData#y + * @type {number} + * @since 3.0.0 + */ + this.y = GetFastValue(config, 'y', 0); + + /** + * The width in tile of the layer. + * + * @name Phaser.Tilemaps.LayerData#width + * @type {number} + * @since 3.0.0 + */ + this.width = GetFastValue(config, 'width', 0); + + /** + * The height in tiles of the layer. + * + * @name Phaser.Tilemaps.LayerData#height + * @type {number} + * @since 3.0.0 + */ + this.height = GetFastValue(config, 'height', 0); + + /** + * The pixel width of the tiles. + * + * @name Phaser.Tilemaps.LayerData#tileWidth + * @type {number} + * @since 3.0.0 + */ + this.tileWidth = GetFastValue(config, 'tileWidth', 0); + + /** + * The pixel height of the tiles. + * + * @name Phaser.Tilemaps.LayerData#tileHeight + * @type {number} + * @since 3.0.0 + */ + this.tileHeight = GetFastValue(config, 'tileHeight', 0); + + /** + * [description] + * + * @name Phaser.Tilemaps.LayerData#baseTileWidth + * @type {number} + * @since 3.0.0 + */ + this.baseTileWidth = GetFastValue(config, 'baseTileWidth', this.tileWidth); + + /** + * [description] + * + * @name Phaser.Tilemaps.LayerData#baseTileHeight + * @type {number} + * @since 3.0.0 + */ + this.baseTileHeight = GetFastValue(config, 'baseTileHeight', this.tileHeight); + + /** + * The width in pixels of the entire layer. + * + * @name Phaser.Tilemaps.LayerData#widthInPixels + * @type {number} + * @since 3.0.0 + */ + this.widthInPixels = GetFastValue(config, 'widthInPixels', this.width * this.baseTileWidth); + + /** + * The height in pixels of the entire layer. + * + * @name Phaser.Tilemaps.LayerData#heightInPixels + * @type {number} + * @since 3.0.0 + */ + this.heightInPixels = GetFastValue(config, 'heightInPixels', this.height * this.baseTileHeight); + + /** + * [description] + * + * @name Phaser.Tilemaps.LayerData#alpha + * @type {number} + * @since 3.0.0 + */ + this.alpha = GetFastValue(config, 'alpha', 1); + + /** + * [description] + * + * @name Phaser.Tilemaps.LayerData#visible + * @type {boolean} + * @since 3.0.0 + */ + this.visible = GetFastValue(config, 'visible', true); + + /** + * Layer specific properties (can be specified in Tiled) + * + * @name Phaser.Tilemaps.LayerData#properties + * @type {object} + * @since 3.0.0 + */ + this.properties = GetFastValue(config, 'properties', {}); + + /** + * [description] + * + * @name Phaser.Tilemaps.LayerData#indexes + * @type {array} + * @since 3.0.0 + */ + this.indexes = GetFastValue(config, 'indexes', []); + + /** + * [description] + * + * @name Phaser.Tilemaps.LayerData#collideIndexes + * @type {array} + * @since 3.0.0 + */ + this.collideIndexes = GetFastValue(config, 'collideIndexes', []); + + /** + * [description] + * + * @name Phaser.Tilemaps.LayerData#callbacks + * @type {array} + * @since 3.0.0 + */ + this.callbacks = GetFastValue(config, 'callbacks', []); + + /** + * [description] + * + * @name Phaser.Tilemaps.LayerData#bodies + * @type {array} + * @since 3.0.0 + */ + this.bodies = GetFastValue(config, 'bodies', []); + + /** + * An array of the tile indexes + * + * @name Phaser.Tilemaps.LayerData#data + * @type {(number[])} + * @since 3.0.0 + */ + this.data = GetFastValue(config, 'data', []); + + /** + * [description] + * + * @name Phaser.Tilemaps.LayerData#tilemapLayer + * @type {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} + * @since 3.0.0 + */ + this.tilemapLayer = GetFastValue(config, 'tilemapLayer', null); + } + +}); + +module.exports = LayerData; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(2); + +/** + * @classdesc + * A class for representing data about a map. Maps are parsed from CSV, Tiled, etc. into this + * format. A Tilemap object get a copy of this data and then unpacks the needed properties into + * itself. + * + * @class MapData + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.Tilemaps.MapDataConfig} [config] - The Map configuration object. + */ +var MapData = new Class({ + + initialize: + + function MapData (config) + { + if (config === undefined) { config = {}; } + + /** + * The key in the Phaser cache that corresponds to the loaded tilemap data. + * + * @name Phaser.Tilemaps.MapData#name + * @type {string} + * @since 3.0.0 + */ + this.name = GetFastValue(config, 'name', 'map'); + + /** + * The width of the entire tilemap. + * + * @name Phaser.Tilemaps.MapData#width + * @type {number} + * @since 3.0.0 + */ + this.width = GetFastValue(config, 'width', 0); + + /** + * The height of the entire tilemap. + * + * @name Phaser.Tilemaps.MapData#height + * @type {number} + * @since 3.0.0 + */ + this.height = GetFastValue(config, 'height', 0); + + /** + * If the map is infinite or not. + * + * @name Phaser.Tilemaps.MapData#infinite + * @type {boolean} + * @since 3.17.0 + */ + this.infinite = GetFastValue(config, 'infinite', false); + + /** + * The width of the tiles. + * + * @name Phaser.Tilemaps.MapData#tileWidth + * @type {number} + * @since 3.0.0 + */ + this.tileWidth = GetFastValue(config, 'tileWidth', 0); + + /** + * The height of the tiles. + * + * @name Phaser.Tilemaps.MapData#tileHeight + * @type {number} + * @since 3.0.0 + */ + this.tileHeight = GetFastValue(config, 'tileHeight', 0); + + /** + * The width in pixels of the entire tilemap. + * + * @name Phaser.Tilemaps.MapData#widthInPixels + * @type {number} + * @since 3.0.0 + */ + this.widthInPixels = GetFastValue(config, 'widthInPixels', this.width * this.tileWidth); + + /** + * The height in pixels of the entire tilemap. + * + * @name Phaser.Tilemaps.MapData#heightInPixels + * @type {number} + * @since 3.0.0 + */ + this.heightInPixels = GetFastValue(config, 'heightInPixels', this.height * this.tileHeight); + + /** + * [description] + * + * @name Phaser.Tilemaps.MapData#format + * @type {integer} + * @since 3.0.0 + */ + this.format = GetFastValue(config, 'format', null); + + /** + * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. + * + * @name Phaser.Tilemaps.MapData#orientation + * @type {string} + * @since 3.0.0 + */ + this.orientation = GetFastValue(config, 'orientation', 'orthogonal'); + + /** + * Determines the draw order of tilemap. Default is right-down + * + * 0, or 'right-down' + * 1, or 'left-down' + * 2, or 'right-up' + * 3, or 'left-up' + * + * @name Phaser.Tilemaps.MapData#renderOrder + * @type {string} + * @since 3.12.0 + */ + this.renderOrder = GetFastValue(config, 'renderOrder', 'right-down'); + + /** + * The version of the map data (as specified in Tiled). + * + * @name Phaser.Tilemaps.MapData#version + * @type {string} + * @since 3.0.0 + */ + this.version = GetFastValue(config, 'version', '1'); + + /** + * Map specific properties (can be specified in Tiled) + * + * @name Phaser.Tilemaps.MapData#properties + * @type {object} + * @since 3.0.0 + */ + this.properties = GetFastValue(config, 'properties', {}); + + /** + * An array with all the layers configured to the MapData. + * + * @name Phaser.Tilemaps.MapData#layers + * @type {(Phaser.Tilemaps.LayerData[]|Phaser.Tilemaps.ObjectLayer)} + * @since 3.0.0 + */ + this.layers = GetFastValue(config, 'layers', []); + + /** + * An array of Tiled Image Layers. + * + * @name Phaser.Tilemaps.MapData#images + * @type {array} + * @since 3.0.0 + */ + this.images = GetFastValue(config, 'images', []); + + /** + * An object of Tiled Object Layers. + * + * @name Phaser.Tilemaps.MapData#objects + * @type {object} + * @since 3.0.0 + */ + this.objects = GetFastValue(config, 'objects', {}); + + /** + * An object of collision data. Must be created as physics object or will return undefined. + * + * @name Phaser.Tilemaps.MapData#collision + * @type {object} + * @since 3.0.0 + */ + this.collision = GetFastValue(config, 'collision', {}); + + /** + * An array of Tilesets. + * + * @name Phaser.Tilemaps.MapData#tilesets + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.0.0 + */ + this.tilesets = GetFastValue(config, 'tilesets', []); + + /** + * The collection of images the map uses(specified in Tiled) + * + * @name Phaser.Tilemaps.MapData#imageCollections + * @type {array} + * @since 3.0.0 + */ + this.imageCollections = GetFastValue(config, 'imageCollections', []); + + /** + * [description] + * + * @name Phaser.Tilemaps.MapData#tiles + * @type {array} + * @since 3.0.0 + */ + this.tiles = GetFastValue(config, 'tiles', []); + } + +}); + +module.exports = MapData; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Scale Modes. + * + * @namespace Phaser.ScaleModes + * @since 3.0.0 + */ + +var ScaleModes = { + + /** + * Default Scale Mode (Linear). + * + * @name Phaser.ScaleModes.DEFAULT + * @type {integer} + * @readonly + * @since 3.0.0 + */ + DEFAULT: 0, + + /** + * Linear Scale Mode. + * + * @name Phaser.ScaleModes.LINEAR + * @type {integer} + * @readonly + * @since 3.0.0 + */ + LINEAR: 0, + + /** + * Nearest Scale Mode. + * + * @name Phaser.ScaleModes.NEAREST + * @type {integer} + * @readonly + * @since 3.0.0 + */ + NEAREST: 1 + +}; + +module.exports = ScaleModes; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @callback EachSetCallback + * + * @param {E} entry - The Set entry. + * @param {number} index - The index of the entry within the Set. + * + * @return {?boolean} The callback result. + */ + +/** + * @classdesc + * A Set is a collection of unique elements. + * + * @class Set + * @memberof Phaser.Structs + * @constructor + * @since 3.0.0 + * + * @generic T + * @genericUse {T[]} - [elements] + * + * @param {Array.<*>} [elements] - An optional array of elements to insert into this Set. + */ +var Set = new Class({ + + initialize: + + function Set (elements) + { + /** + * The entries of this Set. Stored internally as an array. + * + * @genericUse {T[]} - [$type] + * + * @name Phaser.Structs.Set#entries + * @type {Array.<*>} + * @default [] + * @since 3.0.0 + */ + this.entries = []; + + if (Array.isArray(elements)) + { + for (var i = 0; i < elements.length; i++) + { + this.set(elements[i]); + } + } + }, + + /** + * Inserts the provided value into this Set. If the value is already contained in this Set this method will have no effect. + * + * @method Phaser.Structs.Set#set + * @since 3.0.0 + * + * @genericUse {T} - [value] + * @genericUse {Phaser.Structs.Set.} - [$return] + * + * @param {*} value - The value to insert into this Set. + * + * @return {Phaser.Structs.Set} This Set object. + */ + set: function (value) + { + if (this.entries.indexOf(value) === -1) + { + this.entries.push(value); + } + + return this; + }, + + /** + * Get an element of this Set which has a property of the specified name, if that property is equal to the specified value. + * If no elements of this Set satisfy the condition then this method will return `null`. + * + * @method Phaser.Structs.Set#get + * @since 3.0.0 + * + * @genericUse {T} - [value,$return] + * + * @param {string} property - The property name to check on the elements of this Set. + * @param {*} value - The value to check for. + * + * @return {*} The first element of this Set that meets the required condition, or `null` if this Set contains no elements that meet the condition. + */ + get: function (property, value) + { + for (var i = 0; i < this.entries.length; i++) + { + var entry = this.entries[i]; + + if (entry[property] === value) + { + return entry; + } + } + }, + + /** + * Returns an array containing all the values in this Set. + * + * @method Phaser.Structs.Set#getArray + * @since 3.0.0 + * + * @genericUse {T[]} - [$return] + * + * @return {Array.<*>} An array containing all the values in this Set. + */ + getArray: function () + { + return this.entries.slice(0); + }, + + /** + * Removes the given value from this Set if this Set contains that value. + * + * @method Phaser.Structs.Set#delete + * @since 3.0.0 + * + * @genericUse {T} - [value] + * @genericUse {Phaser.Structs.Set.} - [$return] + * + * @param {*} value - The value to remove from the Set. + * + * @return {Phaser.Structs.Set} This Set object. + */ + delete: function (value) + { + var index = this.entries.indexOf(value); + + if (index > -1) + { + this.entries.splice(index, 1); + } + + return this; + }, + + /** + * Dumps the contents of this Set to the console via `console.group`. + * + * @method Phaser.Structs.Set#dump + * @since 3.0.0 + */ + dump: function () + { + // eslint-disable-next-line no-console + console.group('Set'); + + for (var i = 0; i < this.entries.length; i++) + { + var entry = this.entries[i]; + console.log(entry); + } + + // eslint-disable-next-line no-console + console.groupEnd(); + }, + + /** + * Passes each value in this Set to the given callback. + * Use this function when you know this Set will be modified during the iteration, otherwise use `iterate`. + * + * @method Phaser.Structs.Set#each + * @since 3.0.0 + * + * @genericUse {EachSetCallback.} - [callback] + * @genericUse {Phaser.Structs.Set.} - [$return] + * + * @param {EachSetCallback} callback - The callback to be invoked and passed each value this Set contains. + * @param {*} [callbackScope] - The scope of the callback. + * + * @return {Phaser.Structs.Set} This Set object. + */ + each: function (callback, callbackScope) + { + var i; + var temp = this.entries.slice(); + var len = temp.length; + + if (callbackScope) + { + for (i = 0; i < len; i++) + { + if (callback.call(callbackScope, temp[i], i) === false) + { + break; + } + } + } + else + { + for (i = 0; i < len; i++) + { + if (callback(temp[i], i) === false) + { + break; + } + } + } + + return this; + }, + + /** + * Passes each value in this Set to the given callback. + * For when you absolutely know this Set won't be modified during the iteration. + * + * @method Phaser.Structs.Set#iterate + * @since 3.0.0 + * + * @genericUse {EachSetCallback.} - [callback] + * @genericUse {Phaser.Structs.Set.} - [$return] + * + * @param {EachSetCallback} callback - The callback to be invoked and passed each value this Set contains. + * @param {*} [callbackScope] - The scope of the callback. + * + * @return {Phaser.Structs.Set} This Set object. + */ + iterate: function (callback, callbackScope) + { + var i; + var len = this.entries.length; + + if (callbackScope) + { + for (i = 0; i < len; i++) + { + if (callback.call(callbackScope, this.entries[i], i) === false) + { + break; + } + } + } + else + { + for (i = 0; i < len; i++) + { + if (callback(this.entries[i], i) === false) + { + break; + } + } + } + + return this; + }, + + /** + * Goes through each entry in this Set and invokes the given function on them, passing in the arguments. + * + * @method Phaser.Structs.Set#iterateLocal + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.Set.} - [$return] + * + * @param {string} callbackKey - The key of the function to be invoked on each Set entry. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + * + * @return {Phaser.Structs.Set} This Set object. + */ + iterateLocal: function (callbackKey) + { + var i; + var args = []; + + for (i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + var len = this.entries.length; + + for (i = 0; i < len; i++) + { + var entry = this.entries[i]; + + entry[callbackKey].apply(entry, args); + } + + return this; + }, + + /** + * Clears this Set so that it no longer contains any values. + * + * @method Phaser.Structs.Set#clear + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.Set.} - [$return] + * + * @return {Phaser.Structs.Set} This Set object. + */ + clear: function () + { + this.entries.length = 0; + + return this; + }, + + /** + * Returns `true` if this Set contains the given value, otherwise returns `false`. + * + * @method Phaser.Structs.Set#contains + * @since 3.0.0 + * + * @genericUse {T} - [value] + * + * @param {*} value - The value to check for in this Set. + * + * @return {boolean} `true` if the given value was found in this Set, otherwise `false`. + */ + contains: function (value) + { + return (this.entries.indexOf(value) > -1); + }, + + /** + * Returns a new Set containing all values that are either in this Set or in the Set provided as an argument. + * + * @method Phaser.Structs.Set#union + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.Set.} - [set,$return] + * + * @param {Phaser.Structs.Set} set - The Set to perform the union with. + * + * @return {Phaser.Structs.Set} A new Set containing all the values in this Set and the Set provided as an argument. + */ + union: function (set) + { + var newSet = new Set(); + + set.entries.forEach(function (value) + { + newSet.set(value); + }); + + this.entries.forEach(function (value) + { + newSet.set(value); + }); + + return newSet; + }, + + /** + * Returns a new Set that contains only the values which are in this Set and that are also in the given Set. + * + * @method Phaser.Structs.Set#intersect + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.Set.} - [set,$return] + * + * @param {Phaser.Structs.Set} set - The Set to intersect this set with. + * + * @return {Phaser.Structs.Set} The result of the intersection, as a new Set. + */ + intersect: function (set) + { + var newSet = new Set(); + + this.entries.forEach(function (value) + { + if (set.contains(value)) + { + newSet.set(value); + } + }); + + return newSet; + }, + + /** + * Returns a new Set containing all the values in this Set which are *not* also in the given Set. + * + * @method Phaser.Structs.Set#difference + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.Set.} - [set,$return] + * + * @param {Phaser.Structs.Set} set - The Set to perform the difference with. + * + * @return {Phaser.Structs.Set} A new Set containing all the values in this Set that are not also in the Set provided as an argument to this method. + */ + difference: function (set) + { + var newSet = new Set(); + + this.entries.forEach(function (value) + { + if (!set.contains(value)) + { + newSet.set(value); + } + }); + + return newSet; + }, + + /** + * The size of this Set. This is the number of entries within it. + * Changing the size will truncate the Set if the given value is smaller than the current size. + * Increasing the size larger than the current size has no effect. + * + * @name Phaser.Structs.Set#size + * @type {integer} + * @since 3.0.0 + */ + size: { + + get: function () + { + return this.entries.length; + }, + + set: function (value) + { + if (value < this.entries.length) + { + return this.entries.length = value; + } + else + { + return this.entries.length; + } + } + + } + +}); + +module.exports = Set; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(52); +var Circle = __webpack_require__(77); +var CircleContains = __webpack_require__(46); +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var GameObject = __webpack_require__(13); +var Rectangle = __webpack_require__(10); +var RectangleContains = __webpack_require__(47); + +/** + * @classdesc + * A Zone Game Object. + * + * A Zone is a non-rendering rectangular Game Object that has a position and size. + * It has no texture and never displays, but does live on the display list and + * can be moved, scaled and rotated like any other Game Object. + * + * Its primary use is for creating Drop Zones and Input Hit Areas and it has a couple of helper methods + * specifically for this. It is also useful for object overlap checks, or as a base for your own + * non-displaying Game Objects. + + * The default origin is 0.5, the center of the Zone, the same as with Game Objects. + * + * @class Zone + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {number} [width=1] - The width of the Game Object. + * @param {number} [height=1] - The height of the Game Object. + */ +var Zone = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Depth, + Components.GetBounds, + Components.Origin, + Components.Transform, + Components.ScrollFactor, + Components.Visible + ], + + initialize: + + function Zone (scene, x, y, width, height) + { + if (width === undefined) { width = 1; } + if (height === undefined) { height = width; } + + GameObject.call(this, scene, 'Zone'); + + this.setPosition(x, y); + + /** + * The native (un-scaled) width of this Game Object. + * + * @name Phaser.GameObjects.Zone#width + * @type {number} + * @since 3.0.0 + */ + this.width = width; + + /** + * The native (un-scaled) height of this Game Object. + * + * @name Phaser.GameObjects.Zone#height + * @type {number} + * @since 3.0.0 + */ + this.height = height; + + /** + * The Blend Mode of the Game Object. + * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into + * display lists without causing a batch flush. + * + * @name Phaser.GameObjects.Zone#blendMode + * @type {integer} + * @since 3.0.0 + */ + this.blendMode = BlendModes.NORMAL; + + this.updateDisplayOrigin(); + }, + + /** + * The displayed width of this Game Object. + * This value takes into account the scale factor. + * + * @name Phaser.GameObjects.Zone#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return this.scaleX * this.width; + }, + + set: function (value) + { + this.scaleX = value / this.width; + } + + }, + + /** + * The displayed height of this Game Object. + * This value takes into account the scale factor. + * + * @name Phaser.GameObjects.Zone#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return this.scaleY * this.height; + }, + + set: function (value) + { + this.scaleY = value / this.height; + } + + }, + + /** + * Sets the size of this Game Object. + * + * @method Phaser.GameObjects.Zone#setSize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * @param {boolean} [resizeInput=true] - If this Zone has a Rectangle for a hit area this argument will resize the hit area as well. + * + * @return {Phaser.GameObjects.Zone} This Game Object. + */ + setSize: function (width, height, resizeInput) + { + if (resizeInput === undefined) { resizeInput = true; } + + this.width = width; + this.height = height; + + this.updateDisplayOrigin(); + + var input = this.input; + + if (resizeInput && input && !input.customHitArea) + { + input.hitArea.width = width; + input.hitArea.height = height; + } + + return this; + }, + + /** + * Sets the display size of this Game Object. + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Zone#setDisplaySize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {Phaser.GameObjects.Zone} This Game Object. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + }, + + /** + * Sets this Zone to be a Circular Drop Zone. + * The circle is centered on this Zones `x` and `y` coordinates. + * + * @method Phaser.GameObjects.Zone#setCircleDropZone + * @since 3.0.0 + * + * @param {number} radius - The radius of the Circle that will form the Drop Zone. + * + * @return {Phaser.GameObjects.Zone} This Game Object. + */ + setCircleDropZone: function (radius) + { + return this.setDropZone(new Circle(0, 0, radius), CircleContains); + }, + + /** + * Sets this Zone to be a Rectangle Drop Zone. + * The rectangle is centered on this Zones `x` and `y` coordinates. + * + * @method Phaser.GameObjects.Zone#setRectangleDropZone + * @since 3.0.0 + * + * @param {number} width - The width of the rectangle drop zone. + * @param {number} height - The height of the rectangle drop zone. + * + * @return {Phaser.GameObjects.Zone} This Game Object. + */ + setRectangleDropZone: function (width, height) + { + return this.setDropZone(new Rectangle(0, 0, width, height), RectangleContains); + }, + + /** + * Allows you to define your own Geometry shape to be used as a Drop Zone. + * + * @method Phaser.GameObjects.Zone#setDropZone + * @since 3.0.0 + * + * @param {object} shape - A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. + * @param {Phaser.Types.Input.HitAreaCallback} callback - A function that will return `true` if the given x/y coords it is sent are within the shape. + * + * @return {Phaser.GameObjects.Zone} This Game Object. + */ + setDropZone: function (shape, callback) + { + if (shape === undefined) + { + this.setRectangleDropZone(this.width, this.height); + } + else if (!this.input) + { + this.setInteractive(shape, callback, true); + } + + return this; + }, + + /** + * A NOOP method so you can pass a Zone to a Container. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Zone#setAlpha + * @private + * @since 3.11.0 + */ + setAlpha: function () + { + }, + + /** + * A NOOP method so you can pass a Zone to a Container in Canvas. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Zone#setBlendMode + * @private + * @since 3.16.2 + */ + setBlendMode: function () + { + }, + + /** + * A Zone does not render. + * + * @method Phaser.GameObjects.Zone#renderCanvas + * @private + * @since 3.0.0 + */ + renderCanvas: function () + { + }, + + /** + * A Zone does not render. + * + * @method Phaser.GameObjects.Zone#renderWebGL + * @private + * @since 3.0.0 + */ + renderWebGL: function () + { + } + +}); + +module.exports = Zone; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Animations.Events + */ + +module.exports = { + + ADD_ANIMATION: __webpack_require__(504), + ANIMATION_COMPLETE: __webpack_require__(505), + ANIMATION_REPEAT: __webpack_require__(506), + ANIMATION_RESTART: __webpack_require__(507), + ANIMATION_START: __webpack_require__(508), + PAUSE_ALL: __webpack_require__(509), + REMOVE_ANIMATION: __webpack_require__(510), + RESUME_ALL: __webpack_require__(511), + SPRITE_ANIMATION_COMPLETE: __webpack_require__(512), + SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(513), + SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(514), + SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(515), + SPRITE_ANIMATION_KEY_START: __webpack_require__(516), + SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(517), + SPRITE_ANIMATION_REPEAT: __webpack_require__(518), + SPRITE_ANIMATION_RESTART: __webpack_require__(519), + SPRITE_ANIMATION_START: __webpack_require__(520), + SPRITE_ANIMATION_UPDATE: __webpack_require__(521) + +}; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the perimeter of a Rectangle. + * + * @function Phaser.Geom.Rectangle.Perimeter + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to use. + * + * @return {number} The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`. + */ +var Perimeter = function (rect) +{ + return 2 * (rect.width + rect.height); +}; + +module.exports = Perimeter; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(259); + +/** + * @callback DataEachCallback + * + * @param {*} parent - The parent object of the DataManager. + * @param {string} key - The key of the value. + * @param {*} value - The value. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + +/** + * @classdesc + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + * + * @class DataManager + * @memberof Phaser.Data + * @constructor + * @since 3.0.0 + * + * @param {object} parent - The object that this DataManager belongs to. + * @param {Phaser.Events.EventEmitter} eventEmitter - The DataManager's event emitter. + */ +var DataManager = new Class({ + + initialize: + + function DataManager (parent, eventEmitter) + { + /** + * The object that this DataManager belongs to. + * + * @name Phaser.Data.DataManager#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The DataManager's event emitter. + * + * @name Phaser.Data.DataManager#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = eventEmitter; + + if (!eventEmitter) + { + this.events = (parent.events) ? parent.events : parent; + } + + /** + * The data list. + * + * @name Phaser.Data.DataManager#list + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.list = {}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + * + * @name Phaser.Data.DataManager#values + * @type {Object.} + * @default {} + * @since 3.10.0 + */ + this.values = {}; + + /** + * Whether setting data is frozen for this DataManager. + * + * @name Phaser.Data.DataManager#_frozen + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._frozen = false; + + if (!parent.hasOwnProperty('sys') && this.events) + { + this.events.once('destroy', this.destroy, this); + } + }, + + /** + * Retrieves the value for the given key, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.Data.DataManager#get + * @since 3.0.0 + * + * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. + * + * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. + */ + get: function (key) + { + var list = this.list; + + if (Array.isArray(key)) + { + var output = []; + + for (var i = 0; i < key.length; i++) + { + output.push(list[key[i]]); + } + + return output; + } + else + { + return list[key]; + } + }, + + /** + * Retrieves all data values in a new object. + * + * @method Phaser.Data.DataManager#getAll + * @since 3.0.0 + * + * @return {Object.} All data values. + */ + getAll: function () + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * + * @method Phaser.Data.DataManager#query + * @since 3.0.0 + * + * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + * + * @return {Object.} The values of the keys matching the search string. + */ + query: function (search) + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key) && key.match(search)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.Data.DataManager#set + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. + * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + set: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (typeof key === 'string') + { + return this.setValue(key, data); + } + else + { + for (var entry in key) + { + this.setValue(entry, key[entry]); + } + } + + return this; + }, + + /** + * Internal value setter, called automatically by the `set` method. + * + * @method Phaser.Data.DataManager#setValue + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @private + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * @param {*} data - The value to set. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setValue: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (this.has(key)) + { + // Hit the key getter, which will in turn emit the events. + this.values[key] = data; + } + else + { + var _this = this; + var list = this.list; + var events = this.events; + var parent = this.parent; + + Object.defineProperty(this.values, key, { + + enumerable: true, + + configurable: true, + + get: function () + { + return list[key]; + }, + + set: function (value) + { + if (!_this._frozen) + { + var previousValue = list[key]; + list[key] = value; + + events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); + events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); + } + } + + }); + + list[key] = data; + + events.emit(Events.SET_DATA, parent, key, data); + } + + return this; + }, + + /** + * Passes all data entries to the given callback. + * + * @method Phaser.Data.DataManager#each + * @since 3.0.0 + * + * @param {DataEachCallback} callback - The function to call. + * @param {*} [context] - Value to use as `this` when executing callback. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + each: function (callback, context) + { + var args = [ this.parent, null, undefined ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var key in this.list) + { + args[1] = key; + args[2] = this.list[key]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * + * @method Phaser.Data.DataManager#merge + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {Object.} data - The data to merge. + * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + merge: function (data, overwrite) + { + if (overwrite === undefined) { overwrite = true; } + + // Merge data from another component into this one + for (var key in data) + { + if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) + { + this.setValue(key, data[key]); + } + } + + return this; + }, + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * + * @method Phaser.Data.DataManager#remove + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {(string|string[])} key - The key to remove, or an array of keys to remove. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + remove: function (key) + { + if (this._frozen) + { + return this; + } + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.removeValue(key[i]); + } + } + else + { + return this.removeValue(key); + } + + return this; + }, + + /** + * Internal value remover, called automatically by the `remove` method. + * + * @method Phaser.Data.DataManager#removeValue + * @private + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + removeValue: function (key) + { + if (this.has(key)) + { + var data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return this; + }, + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * + * @method Phaser.Data.DataManager#pop + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {string} key - The key of the value to retrieve and delete. + * + * @return {*} The value of the given key. + */ + pop: function (key) + { + var data = undefined; + + if (!this._frozen && this.has(key)) + { + data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return data; + }, + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.Data.DataManager#has + * @since 3.0.0 + * + * @param {string} key - The key to check. + * + * @return {boolean} Returns `true` if the key exists, otherwise `false`. + */ + has: function (key) + { + return this.list.hasOwnProperty(key); + }, + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * + * @method Phaser.Data.DataManager#setFreeze + * @since 3.0.0 + * + * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + setFreeze: function (value) + { + this._frozen = value; + + return this; + }, + + /** + * Delete all data in this Data Manager and unfreeze it. + * + * @method Phaser.Data.DataManager#reset + * @since 3.0.0 + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + reset: function () + { + for (var key in this.list) + { + delete this.list[key]; + delete this.values[key]; + } + + this._frozen = false; + + return this; + }, + + /** + * Destroy this data manager. + * + * @method Phaser.Data.DataManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.reset(); + + this.events.off(Events.CHANGE_DATA); + this.events.off(Events.SET_DATA); + this.events.off(Events.REMOVE_DATA); + + this.parent = null; + }, + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + * + * @name Phaser.Data.DataManager#freeze + * @type {boolean} + * @since 3.0.0 + */ + freeze: { + + get: function () + { + return this._frozen; + }, + + set: function (value) + { + this._frozen = (value) ? true : false; + } + + }, + + /** + * Return the total number of entries in this Data Manager. + * + * @name Phaser.Data.DataManager#count + * @type {integer} + * @since 3.0.0 + */ + count: { + + get: function () + { + var i = 0; + + for (var key in this.list) + { + if (this.list[key] !== undefined) + { + i++; + } + } + + return i; + } + + } + +}); + +module.exports = DataManager; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { DESTROY: __webpack_require__(536) }; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Shuffles the contents of the given array using the Fisher-Yates implementation. + * + * The original array is modified directly and returned. + * + * @function Phaser.Utils.Array.Shuffle + * @since 3.0.0 + * + * @param {array} array - The array to shuffle. This array is modified in place. + * + * @return {array} The shuffled array. + */ +var Shuffle = function (array) +{ + for (var i = array.length - 1; i > 0; i--) + { + var j = Math.floor(Math.random() * (i + 1)); + var temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } + + return array; +}; + +module.exports = Shuffle; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var DegToRad = __webpack_require__(35); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(48); +var Rectangle = __webpack_require__(10); +var TransformMatrix = __webpack_require__(32); +var ValueToColor = __webpack_require__(159); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Base Camera class. + * + * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world, + * and can be positioned, rotated, zoomed and scrolled accordingly. + * + * A Camera consists of two elements: The viewport and the scroll values. + * + * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are + * created the same size as your game, but their position and size can be set to anything. This means if you + * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, + * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). + * + * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this + * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the + * viewport, and changing the viewport has no impact on the scrolling. + * + * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, + * allowing you to filter Game Objects out on a per-Camera basis. + * + * The Base Camera is extended by the Camera class, which adds in special effects including Fade, + * Flash and Camera Shake, as well as the ability to follow Game Objects. + * + * The Base Camera was introduced in Phaser 3.12. It was split off from the Camera class, to allow + * you to isolate special effects as needed. Therefore the 'since' values for properties of this class relate + * to when they were added to the Camera class. + * + * @class BaseCamera + * @memberof Phaser.Cameras.Scene2D + * @constructor + * @since 3.12.0 + * + * @extends Phaser.Events.EventEmitter + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.Visible + * + * @param {number} x - The x position of the Camera, relative to the top-left of the game canvas. + * @param {number} y - The y position of the Camera, relative to the top-left of the game canvas. + * @param {number} width - The width of the Camera, in pixels. + * @param {number} height - The height of the Camera, in pixels. + */ +var BaseCamera = new Class({ + + Extends: EventEmitter, + + Mixins: [ + Components.Alpha, + Components.Visible + ], + + initialize: + + function BaseCamera (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 0; } + if (height === undefined) { height = 0; } + + EventEmitter.call(this); + + /** + * A reference to the Scene this camera belongs to. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene; + + /** + * A reference to the Game Scene Manager. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#sceneManager + * @type {Phaser.Scenes.SceneManager} + * @since 3.12.0 + */ + this.sceneManager; + + /** + * A reference to the Game Scale Manager. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#scaleManager + * @type {Phaser.Scale.ScaleManager} + * @since 3.16.0 + */ + this.scaleManager; + + /** + * A reference to the Scene's Camera Manager to which this Camera belongs. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#cameraManager + * @type {Phaser.Cameras.Scene2D.CameraManager} + * @since 3.17.0 + */ + this.cameraManager; + + /** + * The Camera ID. Assigned by the Camera Manager and used to handle camera exclusion. + * This value is a bitmask. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#id + * @type {integer} + * @readonly + * @since 3.11.0 + */ + this.id = 0; + + /** + * The name of the Camera. This is left empty for your own use. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#name + * @type {string} + * @default '' + * @since 3.0.0 + */ + this.name = ''; + + /** + * This property is un-used in v3.16. + * + * The resolution of the Game, used in most Camera calculations. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#resolution + * @type {number} + * @readonly + * @deprecated + * @since 3.12.0 + */ + this.resolution = 1; + + /** + * Should this camera round its pixel values to integers? + * + * @name Phaser.Cameras.Scene2D.BaseCamera#roundPixels + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.roundPixels = false; + + /** + * Is this Camera visible or not? + * + * A visible camera will render and perform input tests. + * An invisible camera will not render anything and will skip input tests. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#visible + * @type {boolean} + * @default true + * @since 3.10.0 + */ + + /** + * Is this Camera using a bounds to restrict scrolling movement? + * + * Set this property along with the bounds via `Camera.setBounds`. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#useBounds + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.useBounds = false; + + /** + * The World View is a Rectangle that defines the area of the 'world' the Camera is currently looking at. + * This factors in the Camera viewport size, zoom and scroll position and is updated in the Camera preRender step. + * If you have enabled Camera bounds the worldview will be clamped to those bounds accordingly. + * You can use it for culling or intersection checks. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#worldView + * @type {Phaser.Geom.Rectangle} + * @readonly + * @since 3.11.0 + */ + this.worldView = new Rectangle(); + + /** + * Is this Camera dirty? + * + * A dirty Camera has had either its viewport size, bounds, scroll, rotation or zoom levels changed since the last frame. + * + * This flag is cleared during the `postRenderCamera` method of the renderer. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#dirty + * @type {boolean} + * @default true + * @since 3.11.0 + */ + this.dirty = true; + + /** + * The x position of the Camera viewport, relative to the top-left of the game canvas. + * The viewport is the area into which the camera renders. + * To adjust the position the camera is looking at in the game world, see the `scrollX` value. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#x + * @type {number} + * @private + * @since 3.0.0 + */ + this._x = x; + + /** + * The y position of the Camera, relative to the top-left of the game canvas. + * The viewport is the area into which the camera renders. + * To adjust the position the camera is looking at in the game world, see the `scrollY` value. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#y + * @type {number} + * @private + * @since 3.0.0 + */ + this._y = y; + + /** + * Internal Camera X value multiplied by the resolution. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_cx + * @type {number} + * @private + * @since 3.12.0 + */ + this._cx = 0; + + /** + * Internal Camera Y value multiplied by the resolution. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_cy + * @type {number} + * @private + * @since 3.12.0 + */ + this._cy = 0; + + /** + * Internal Camera Width value multiplied by the resolution. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_cw + * @type {number} + * @private + * @since 3.12.0 + */ + this._cw = 0; + + /** + * Internal Camera Height value multiplied by the resolution. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_ch + * @type {number} + * @private + * @since 3.12.0 + */ + this._ch = 0; + + /** + * The width of the Camera viewport, in pixels. + * + * The viewport is the area into which the Camera renders. Setting the viewport does + * not restrict where the Camera can scroll to. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_width + * @type {number} + * @private + * @since 3.11.0 + */ + this._width = width; + + /** + * The height of the Camera viewport, in pixels. + * + * The viewport is the area into which the Camera renders. Setting the viewport does + * not restrict where the Camera can scroll to. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_height + * @type {number} + * @private + * @since 3.11.0 + */ + this._height = height; + + /** + * The bounds the camera is restrained to during scrolling. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_bounds + * @type {Phaser.Geom.Rectangle} + * @private + * @since 3.0.0 + */ + this._bounds = new Rectangle(); + + /** + * The horizontal scroll position of this Camera. + * + * Change this value to cause the Camera to scroll around your Scene. + * + * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, + * will automatically adjust the Camera scroll values accordingly. + * + * You can set the bounds within which the Camera can scroll via the `setBounds` method. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_scrollX + * @type {number} + * @private + * @default 0 + * @since 3.11.0 + */ + this._scrollX = 0; + + /** + * The vertical scroll position of this Camera. + * + * Change this value to cause the Camera to scroll around your Scene. + * + * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, + * will automatically adjust the Camera scroll values accordingly. + * + * You can set the bounds within which the Camera can scroll via the `setBounds` method. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_scrollY + * @type {number} + * @private + * @default 0 + * @since 3.11.0 + */ + this._scrollY = 0; + + /** + * The Camera zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_zoom + * @type {number} + * @private + * @default 1 + * @since 3.11.0 + */ + this._zoom = 1; + + /** + * The rotation of the Camera in radians. + * + * Camera rotation always takes place based on the Camera viewport. By default, rotation happens + * in the center of the viewport. You can adjust this with the `originX` and `originY` properties. + * + * Rotation influences the rendering of _all_ Game Objects visible by this Camera. However, it does not + * rotate the Camera viewport itself, which always remains an axis-aligned rectangle. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_rotation + * @type {number} + * @private + * @default 0 + * @since 3.11.0 + */ + this._rotation = 0; + + /** + * A local transform matrix used for internal calculations. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#matrix + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @private + * @since 3.0.0 + */ + this.matrix = new TransformMatrix(); + + /** + * Does this Camera have a transparent background? + * + * @name Phaser.Cameras.Scene2D.BaseCamera#transparent + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.transparent = true; + + /** + * The background color of this Camera. Only used if `transparent` is `false`. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#backgroundColor + * @type {Phaser.Display.Color} + * @since 3.0.0 + */ + this.backgroundColor = ValueToColor('rgba(0,0,0,0)'); + + /** + * The Camera alpha value. Setting this property impacts every single object that this Camera + * renders. You can either set the property directly, i.e. via a Tween, to fade a Camera in or out, + * or via the chainable `setAlpha` method instead. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#alpha + * @type {number} + * @default 1 + * @since 3.11.0 + */ + + /** + * Should the camera cull Game Objects before checking them for input hit tests? + * In some special cases it may be beneficial to disable this. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#disableCull + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.disableCull = false; + + /** + * A temporary array of culled objects. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#culledObjects + * @type {Phaser.GameObjects.GameObject[]} + * @default [] + * @private + * @since 3.0.0 + */ + this.culledObjects = []; + + /** + * The mid-point of the Camera in 'world' coordinates. + * + * Use it to obtain exactly where in the world the center of the camera is currently looking. + * + * This value is updated in the preRender method, after the scroll values and follower + * have been processed. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#midPoint + * @type {Phaser.Math.Vector2} + * @readonly + * @since 3.11.0 + */ + this.midPoint = new Vector2(width / 2, height / 2); + + /** + * The horizontal origin of rotation for this Camera. + * + * By default the camera rotates around the center of the viewport. + * + * Changing the origin allows you to adjust the point in the viewport from which rotation happens. + * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. + * + * See `setOrigin` to set both origins in a single, chainable call. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#originX + * @type {number} + * @default 0.5 + * @since 3.11.0 + */ + this.originX = 0.5; + + /** + * The vertical origin of rotation for this Camera. + * + * By default the camera rotates around the center of the viewport. + * + * Changing the origin allows you to adjust the point in the viewport from which rotation happens. + * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. + * + * See `setOrigin` to set both origins in a single, chainable call. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#originY + * @type {number} + * @default 0.5 + * @since 3.11.0 + */ + this.originY = 0.5; + + /** + * Does this Camera have a custom viewport? + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_customViewport + * @type {boolean} + * @private + * @default false + * @since 3.12.0 + */ + this._customViewport = false; + + /** + * The Mask this Camera is using during render. + * Set the mask using the `setMask` method. Remove the mask using the `clearMask` method. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#mask + * @type {?(Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask)} + * @since 3.17.0 + */ + this.mask = null; + + /** + * The Camera that this Camera uses for translation during masking. + * + * If the mask is fixed in position this will be a reference to + * the CameraManager.default instance. Otherwise, it'll be a reference + * to itself. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_maskCamera + * @type {?Phaser.Cameras.Scene2D.BaseCamera} + * @private + * @since 3.17.0 + */ + this._maskCamera = null; + }, + + /** + * Set the Alpha level of this Camera. The alpha controls the opacity of the Camera as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setAlpha + * @since 3.11.0 + * + * @param {number} [value=1] - The Camera alpha value. + * + * @return {this} This Camera instance. + */ + + /** + * Sets the rotation origin of this Camera. + * + * The values are given in the range 0 to 1 and are only used when calculating Camera rotation. + * + * By default the camera rotates around the center of the viewport. + * + * Changing the origin allows you to adjust the point in the viewport from which rotation happens. + * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setOrigin + * @since 3.11.0 + * + * @param {number} [x=0.5] - The horizontal origin value. + * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`. + * + * @return {this} This Camera instance. + */ + setOrigin: function (x, y) + { + if (x === undefined) { x = 0.5; } + if (y === undefined) { y = x; } + + this.originX = x; + this.originY = y; + + return this; + }, + + /** + * Calculates what the Camera.scrollX and scrollY values would need to be in order to move + * the Camera so it is centered on the given x and y coordinates, without actually moving + * the Camera there. The results are clamped based on the Camera bounds, if set. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#getScroll + * @since 3.11.0 + * + * @param {number} x - The horizontal coordinate to center on. + * @param {number} y - The vertical coordinate to center on. + * @param {Phaser.Math.Vector2} [out] - A Vec2 to store the values in. If not given a new Vec2 is created. + * + * @return {Phaser.Math.Vector2} The scroll coordinates stored in the `x` and `y` properties. + */ + getScroll: function (x, y, out) + { + if (out === undefined) { out = new Vector2(); } + + var originX = this.width * 0.5; + var originY = this.height * 0.5; + + out.x = x - originX; + out.y = y - originY; + + if (this.useBounds) + { + out.x = this.clampX(out.x); + out.y = this.clampY(out.y); + } + + return out; + }, + + /** + * Moves the Camera horizontally so that it is centered on the given x coordinate, bounds allowing. + * Calling this does not change the scrollY value. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#centerOnX + * @since 3.16.0 + * + * @param {number} x - The horizontal coordinate to center on. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + centerOnX: function (x) + { + var originX = this.width * 0.5; + + this.midPoint.x = x; + + this.scrollX = x - originX; + + if (this.useBounds) + { + this.scrollX = this.clampX(this.scrollX); + } + + return this; + }, + + /** + * Moves the Camera vertically so that it is centered on the given y coordinate, bounds allowing. + * Calling this does not change the scrollX value. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#centerOnY + * @since 3.16.0 + * + * @param {number} y - The vertical coordinate to center on. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + centerOnY: function (y) + { + var originY = this.height * 0.5; + + this.midPoint.y = y; + + this.scrollY = y - originY; + + if (this.useBounds) + { + this.scrollY = this.clampY(this.scrollY); + } + + return this; + }, + + /** + * Moves the Camera so that it is centered on the given coordinates, bounds allowing. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#centerOn + * @since 3.11.0 + * + * @param {number} x - The horizontal coordinate to center on. + * @param {number} y - The vertical coordinate to center on. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + centerOn: function (x, y) + { + this.centerOnX(x); + this.centerOnY(y); + + return this; + }, + + /** + * Moves the Camera so that it is looking at the center of the Camera Bounds, if enabled. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#centerToBounds + * @since 3.0.0 + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + centerToBounds: function () + { + if (this.useBounds) + { + var bounds = this._bounds; + var originX = this.width * 0.5; + var originY = this.height * 0.5; + + this.midPoint.set(bounds.centerX, bounds.centerY); + + this.scrollX = bounds.centerX - originX; + this.scrollY = bounds.centerY - originY; + } + + return this; + }, + + /** + * Moves the Camera so that it is re-centered based on its viewport size. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#centerToSize + * @since 3.0.0 + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + centerToSize: function () + { + this.scrollX = this.width * 0.5; + this.scrollY = this.height * 0.5; + + return this; + }, + + /** + * Takes an array of Game Objects and returns a new array featuring only those objects + * visible by this camera. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#cull + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [renderableObjects,$return] + * + * @param {Phaser.GameObjects.GameObject[]} renderableObjects - An array of Game Objects to cull. + * + * @return {Phaser.GameObjects.GameObject[]} An array of Game Objects visible to this Camera. + */ + cull: function (renderableObjects) + { + if (this.disableCull) + { + return renderableObjects; + } + + var cameraMatrix = this.matrix.matrix; + + var mva = cameraMatrix[0]; + var mvb = cameraMatrix[1]; + var mvc = cameraMatrix[2]; + var mvd = cameraMatrix[3]; + + /* First Invert Matrix */ + var determinant = (mva * mvd) - (mvb * mvc); + + if (!determinant) + { + return renderableObjects; + } + + var mve = cameraMatrix[4]; + var mvf = cameraMatrix[5]; + + var scrollX = this.scrollX; + var scrollY = this.scrollY; + var cameraW = this.width; + var cameraH = this.height; + var culledObjects = this.culledObjects; + var length = renderableObjects.length; + + determinant = 1 / determinant; + + culledObjects.length = 0; + + for (var index = 0; index < length; ++index) + { + var object = renderableObjects[index]; + + if (!object.hasOwnProperty('width') || object.parentContainer) + { + culledObjects.push(object); + continue; + } + + var objectW = object.width; + var objectH = object.height; + var objectX = (object.x - (scrollX * object.scrollFactorX)) - (objectW * object.originX); + var objectY = (object.y - (scrollY * object.scrollFactorY)) - (objectH * object.originY); + var tx = (objectX * mva + objectY * mvc + mve); + var ty = (objectX * mvb + objectY * mvd + mvf); + var tw = ((objectX + objectW) * mva + (objectY + objectH) * mvc + mve); + var th = ((objectX + objectW) * mvb + (objectY + objectH) * mvd + mvf); + var cullTop = this.y; + var cullBottom = cullTop + cameraH; + var cullLeft = this.x; + var cullRight = cullLeft + cameraW; + + if ((tw > cullLeft && tx < cullRight) && (th > cullTop && ty < cullBottom)) + { + culledObjects.push(object); + } + } + + return culledObjects; + }, + + /** + * Converts the given `x` and `y` coordinates into World space, based on this Cameras transform. + * You can optionally provide a Vector2, or similar object, to store the results in. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#getWorldPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {number} x - The x position to convert to world space. + * @param {number} y - The y position to convert to world space. + * @param {(object|Phaser.Math.Vector2)} [output] - An optional object to store the results in. If not provided a new Vector2 will be created. + * + * @return {Phaser.Math.Vector2} An object holding the converted values in its `x` and `y` properties. + */ + getWorldPoint: function (x, y, output) + { + if (output === undefined) { output = new Vector2(); } + + var cameraMatrix = this.matrix.matrix; + + var mva = cameraMatrix[0]; + var mvb = cameraMatrix[1]; + var mvc = cameraMatrix[2]; + var mvd = cameraMatrix[3]; + var mve = cameraMatrix[4]; + var mvf = cameraMatrix[5]; + + // Invert Matrix + var determinant = (mva * mvd) - (mvb * mvc); + + if (!determinant) + { + output.x = x; + output.y = y; + + return output; + } + + determinant = 1 / determinant; + + var ima = mvd * determinant; + var imb = -mvb * determinant; + var imc = -mvc * determinant; + var imd = mva * determinant; + var ime = (mvc * mvf - mvd * mve) * determinant; + var imf = (mvb * mve - mva * mvf) * determinant; + + var c = Math.cos(this.rotation); + var s = Math.sin(this.rotation); + + var zoom = this.zoom; + var res = this.resolution; + + var scrollX = this.scrollX; + var scrollY = this.scrollY; + + // Works for zoom of 1 with any resolution, but resolution > 1 and zoom !== 1 breaks + var sx = x + ((scrollX * c - scrollY * s) * zoom); + var sy = y + ((scrollX * s + scrollY * c) * zoom); + + // Apply transform to point + output.x = (sx * ima + sy * imc) * res + ime; + output.y = (sx * imb + sy * imd) * res + imf; + + return output; + }, + + /** + * Given a Game Object, or an array of Game Objects, it will update all of their camera filter settings + * so that they are ignored by this Camera. This means they will not be rendered by this Camera. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#ignore + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group)} entries - The Game Object, or array of Game Objects, to be ignored by this Camera. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + ignore: function (entries) + { + var id = this.id; + + if (!Array.isArray(entries)) + { + entries = [ entries ]; + } + + for (var i = 0; i < entries.length; i++) + { + var entry = entries[i]; + + if (Array.isArray(entry)) + { + this.ignore(entry); + } + else if (entry.isParent) + { + this.ignore(entry.getChildren()); + } + else + { + entry.cameraFilter |= id; + } + } + + return this; + }, + + /** + * Internal preRender step. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#preRender + * @protected + * @since 3.0.0 + * + * @param {number} resolution - The game resolution, as set in the Scale Manager. + */ + preRender: function (resolution) + { + var width = this.width; + var height = this.height; + + var halfWidth = width * 0.5; + var halfHeight = height * 0.5; + + var zoom = this.zoom * resolution; + var matrix = this.matrix; + + var originX = width * this.originX; + var originY = height * this.originY; + + var sx = this.scrollX; + var sy = this.scrollY; + + if (this.useBounds) + { + sx = this.clampX(sx); + sy = this.clampY(sy); + } + + if (this.roundPixels) + { + originX = Math.round(originX); + originY = Math.round(originY); + } + + // Values are in pixels and not impacted by zooming the Camera + this.scrollX = sx; + this.scrollY = sy; + + var midX = sx + halfWidth; + var midY = sy + halfHeight; + + // The center of the camera, in world space, so taking zoom into account + // Basically the pixel value of what it's looking at in the middle of the cam + this.midPoint.set(midX, midY); + + var displayWidth = width / zoom; + var displayHeight = height / zoom; + + this.worldView.setTo( + midX - (displayWidth / 2), + midY - (displayHeight / 2), + displayWidth, + displayHeight + ); + + matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoom, zoom); + matrix.translate(-originX, -originY); + }, + + /** + * Takes an x value and checks it's within the range of the Camera bounds, adjusting if required. + * Do not call this method if you are not using camera bounds. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#clampX + * @since 3.11.0 + * + * @param {number} x - The value to horizontally scroll clamp. + * + * @return {number} The adjusted value to use as scrollX. + */ + clampX: function (x) + { + var bounds = this._bounds; + + var dw = this.displayWidth; + + var bx = bounds.x + ((dw - this.width) / 2); + var bw = Math.max(bx, bx + bounds.width - dw); + + if (x < bx) + { + x = bx; + } + else if (x > bw) + { + x = bw; + } + + return x; + }, + + /** + * Takes a y value and checks it's within the range of the Camera bounds, adjusting if required. + * Do not call this method if you are not using camera bounds. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#clampY + * @since 3.11.0 + * + * @param {number} y - The value to vertically scroll clamp. + * + * @return {number} The adjusted value to use as scrollY. + */ + clampY: function (y) + { + var bounds = this._bounds; + + var dh = this.displayHeight; + + var by = bounds.y + ((dh - this.height) / 2); + var bh = Math.max(by, by + bounds.height - dh); + + if (y < by) + { + y = by; + } + else if (y > bh) + { + y = bh; + } + + return y; + }, + + /* + var gap = this._zoomInversed; + return gap * Math.round((src.x - this.scrollX * src.scrollFactorX) / gap); + */ + + /** + * If this Camera has previously had movement bounds set on it, this will remove them. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#removeBounds + * @since 3.0.0 + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + removeBounds: function () + { + this.useBounds = false; + + this.dirty = true; + + this._bounds.setEmpty(); + + return this; + }, + + /** + * Set the rotation of this Camera. This causes everything it renders to appear rotated. + * + * Rotating a camera does not rotate the viewport itself, it is applied during rendering. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setAngle + * @since 3.0.0 + * + * @param {number} [value=0] - The cameras angle of rotation, given in degrees. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setAngle: function (value) + { + if (value === undefined) { value = 0; } + + this.rotation = DegToRad(value); + + return this; + }, + + /** + * Sets the background color for this Camera. + * + * By default a Camera has a transparent background but it can be given a solid color, with any level + * of transparency, via this method. + * + * The color value can be specified using CSS color notation, hex or numbers. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setBackgroundColor + * @since 3.0.0 + * + * @param {(string|number|Phaser.Types.Display.InputColorObject)} [color='rgba(0,0,0,0)'] - The color value. In CSS, hex or numeric color notation. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setBackgroundColor: function (color) + { + if (color === undefined) { color = 'rgba(0,0,0,0)'; } + + this.backgroundColor = ValueToColor(color); + + this.transparent = (this.backgroundColor.alpha === 0); + + return this; + }, + + /** + * Set the bounds of the Camera. The bounds are an axis-aligned rectangle. + * + * The Camera bounds controls where the Camera can scroll to, stopping it from scrolling off the + * edges and into blank space. It does not limit the placement of Game Objects, or where + * the Camera viewport can be positioned. + * + * Temporarily disable the bounds by changing the boolean `Camera.useBounds`. + * + * Clear the bounds entirely by calling `Camera.removeBounds`. + * + * If you set bounds that are smaller than the viewport it will stop the Camera from being + * able to scroll. The bounds can be positioned where-ever you wish. By default they are from + * 0x0 to the canvas width x height. This means that the coordinate 0x0 is the top left of + * the Camera bounds. However, you can position them anywhere. So if you wanted a game world + * that was 2048x2048 in size, with 0x0 being the center of it, you can set the bounds x/y + * to be -1024, -1024, with a width and height of 2048. Depending on your game you may find + * it easier for 0x0 to be the top-left of the bounds, or you may wish 0x0 to be the middle. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setBounds + * @since 3.0.0 + * + * @param {integer} x - The top-left x coordinate of the bounds. + * @param {integer} y - The top-left y coordinate of the bounds. + * @param {integer} width - The width of the bounds, in pixels. + * @param {integer} height - The height of the bounds, in pixels. + * @param {boolean} [centerOn=false] - If `true` the Camera will automatically be centered on the new bounds. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setBounds: function (x, y, width, height, centerOn) + { + if (centerOn === undefined) { centerOn = false; } + + this._bounds.setTo(x, y, width, height); + + this.dirty = true; + this.useBounds = true; + + if (centerOn) + { + this.centerToBounds(); + } + else + { + this.scrollX = this.clampX(this.scrollX); + this.scrollY = this.clampY(this.scrollY); + } + + return this; + }, + + /** + * Returns a rectangle containing the bounds of the Camera. + * + * If the Camera does not have any bounds the rectangle will be empty. + * + * The rectangle is a copy of the bounds, so is safe to modify. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#getBounds + * @since 3.16.0 + * + * @param {Phaser.Geom.Rectangle} [out] - An optional Rectangle to store the bounds in. If not given, a new Rectangle will be created. + * + * @return {Phaser.Geom.Rectangle} A rectangle containing the bounds of this Camera. + */ + getBounds: function (out) + { + if (out === undefined) { out = new Rectangle(); } + + var source = this._bounds; + + out.setTo(source.x, source.y, source.width, source.height); + + return out; + }, + + /** + * Sets the name of this Camera. + * This value is for your own use and isn't used internally. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setName + * @since 3.0.0 + * + * @param {string} [value=''] - The name of the Camera. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setName: function (value) + { + if (value === undefined) { value = ''; } + + this.name = value; + + return this; + }, + + /** + * Set the position of the Camera viewport within the game. + * + * This does not change where the camera is 'looking'. See `setScroll` to control that. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setPosition + * @since 3.0.0 + * + * @param {number} x - The top-left x coordinate of the Camera viewport. + * @param {number} [y=x] - The top-left y coordinate of the Camera viewport. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setPosition: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * Set the rotation of this Camera. This causes everything it renders to appear rotated. + * + * Rotating a camera does not rotate the viewport itself, it is applied during rendering. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setRotation + * @since 3.0.0 + * + * @param {number} [value=0] - The rotation of the Camera, in radians. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setRotation: function (value) + { + if (value === undefined) { value = 0; } + + this.rotation = value; + + return this; + }, + + /** + * Should the Camera round pixel values to whole integers when rendering Game Objects? + * + * In some types of game, especially with pixel art, this is required to prevent sub-pixel aliasing. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setRoundPixels + * @since 3.0.0 + * + * @param {boolean} value - `true` to round Camera pixels, `false` to not. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setRoundPixels: function (value) + { + this.roundPixels = value; + + return this; + }, + + /** + * Sets the Scene the Camera is bound to. + * + * Also populates the `resolution` property and updates the internal size values. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setScene + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene the camera is bound to. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setScene: function (scene) + { + if (this.scene && this._customViewport) + { + this.sceneManager.customViewports--; + } + + this.scene = scene; + + var sys = scene.sys; + + this.sceneManager = sys.game.scene; + this.scaleManager = sys.scale; + this.cameraManager = sys.cameras; + + var res = this.scaleManager.resolution; + + this.resolution = res; + + this._cx = this._x * res; + this._cy = this._y * res; + this._cw = this._width * res; + this._ch = this._height * res; + + this.updateSystem(); + + return this; + }, + + /** + * Set the position of where the Camera is looking within the game. + * You can also modify the properties `Camera.scrollX` and `Camera.scrollY` directly. + * Use this method, or the scroll properties, to move your camera around the game world. + * + * This does not change where the camera viewport is placed. See `setPosition` to control that. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setScroll + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the Camera in the game world. + * @param {number} [y=x] - The y coordinate of the Camera in the game world. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setScroll: function (x, y) + { + if (y === undefined) { y = x; } + + this.scrollX = x; + this.scrollY = y; + + return this; + }, + + /** + * Set the size of the Camera viewport. + * + * By default a Camera is the same size as the game, but can be made smaller via this method, + * allowing you to create mini-cam style effects by creating and positioning a smaller Camera + * viewport within your game. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setSize + * @since 3.0.0 + * + * @param {integer} width - The width of the Camera viewport. + * @param {integer} [height=width] - The height of the Camera viewport. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + this.width = width; + this.height = height; + + return this; + }, + + /** + * This method sets the position and size of the Camera viewport in a single call. + * + * If you're trying to change where the Camera is looking at in your game, then see + * the method `Camera.setScroll` instead. This method is for changing the viewport + * itself, not what the camera can see. + * + * By default a Camera is the same size as the game, but can be made smaller via this method, + * allowing you to create mini-cam style effects by creating and positioning a smaller Camera + * viewport within your game. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setViewport + * @since 3.0.0 + * + * @param {number} x - The top-left x coordinate of the Camera viewport. + * @param {number} y - The top-left y coordinate of the Camera viewport. + * @param {integer} width - The width of the Camera viewport. + * @param {integer} [height=width] - The height of the Camera viewport. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setViewport: function (x, y, width, height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + + return this; + }, + + /** + * Set the zoom value of the Camera. + * + * Changing to a smaller value, such as 0.5, will cause the camera to 'zoom out'. + * Changing to a larger value, such as 2, will cause the camera to 'zoom in'. + * + * A value of 1 means 'no zoom' and is the default. + * + * Changing the zoom does not impact the Camera viewport in any way, it is only applied during rendering. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setZoom + * @since 3.0.0 + * + * @param {number} [value=1] - The zoom value of the Camera. The minimum it can be is 0.001. + * + * @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance. + */ + setZoom: function (value) + { + if (value === undefined) { value = 1; } + + if (value === 0) + { + value = 0.001; + } + + this.zoom = value; + + return this; + }, + + /** + * Sets the mask to be applied to this Camera during rendering. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * + * Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Camera it will be immediately replaced. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * + * Note: You cannot mask a Camera that has `renderToTexture` set. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setMask + * @since 3.17.0 + * + * @param {(Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask)} mask - The mask this Camera will use when rendering. + * @param {boolean} [fixedPosition=true] - Should the mask translate along with the Camera, or be fixed in place and not impacted by the Cameras transform? + * + * @return {this} This Camera instance. + */ + setMask: function (mask, fixedPosition) + { + if (fixedPosition === undefined) { fixedPosition = true; } + + this.mask = mask; + + this._maskCamera = (fixedPosition) ? this.cameraManager.default : this; + + return this; + }, + + /** + * Clears the mask that this Camera was using. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#clearMask + * @since 3.17.0 + * + * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it? + * + * @return {this} This Camera instance. + */ + clearMask: function (destroyMask) + { + if (destroyMask === undefined) { destroyMask = false; } + + if (destroyMask && this.mask) + { + this.mask.destroy(); + } + + this.mask = null; + + return this; + }, + + /** + * Sets the visibility of this Camera. + * + * An invisible Camera will skip rendering and input tests of everything it can see. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#setVisible + * @since 3.10.0 + * + * @param {boolean} value - The visible state of the Camera. + * + * @return {this} This Camera instance. + */ + + /** + * Returns an Object suitable for JSON storage containing all of the Camera viewport and rendering properties. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Cameras.Scene2D.JSONCamera} A well-formed object suitable for conversion to JSON. + */ + toJSON: function () + { + var output = { + name: this.name, + x: this.x, + y: this.y, + width: this.width, + height: this.height, + zoom: this.zoom, + rotation: this.rotation, + roundPixels: this.roundPixels, + scrollX: this.scrollX, + scrollY: this.scrollY, + backgroundColor: this.backgroundColor.rgba + }; + + if (this.useBounds) + { + output['bounds'] = { + x: this._bounds.x, + y: this._bounds.y, + width: this._bounds.width, + height: this._bounds.height + }; + } + + return output; + }, + + /** + * Internal method called automatically by the Camera Manager. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#update + * @protected + * @since 3.0.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function () + { + // NOOP + }, + + /** + * Internal method called automatically when the viewport changes. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#updateSystem + * @private + * @since 3.12.0 + */ + updateSystem: function () + { + if (!this.scaleManager) + { + return; + } + + var custom = (this._x !== 0 || this._y !== 0 || this.scaleManager.width !== this._width || this.scaleManager.height !== this._height); + + var sceneManager = this.sceneManager; + + if (custom && !this._customViewport) + { + // We need a custom viewport for this Camera + sceneManager.customViewports++; + } + else if (!custom && this._customViewport) + { + // We're turning off a custom viewport for this Camera + sceneManager.customViewports--; + } + + this.dirty = true; + this._customViewport = custom; + }, + + /** + * Destroys this Camera instance and its internal properties and references. + * Once destroyed you cannot use this Camera again, even if re-added to a Camera Manager. + * + * This method is called automatically by `CameraManager.remove` if that methods `runDestroy` argument is `true`, which is the default. + * + * Unless you have a specific reason otherwise, always use `CameraManager.remove` and allow it to handle the camera destruction, + * rather than calling this method directly. + * + * @method Phaser.Cameras.Scene2D.BaseCamera#destroy + * @fires Phaser.Cameras.Scene2D.Events#DESTROY + * @since 3.0.0 + */ + destroy: function () + { + this.emit(Events.DESTROY, this); + + this.removeAllListeners(); + + this.matrix.destroy(); + + this.culledObjects = []; + + if (this._customViewport) + { + // We're turning off a custom viewport for this Camera + this.sceneManager.customViewports--; + } + + this._bounds = null; + + this.scene = null; + this.scaleManager = null; + this.sceneManager = null; + this.cameraManager = null; + }, + + /** + * The x position of the Camera viewport, relative to the top-left of the game canvas. + * The viewport is the area into which the camera renders. + * To adjust the position the camera is looking at in the game world, see the `scrollX` value. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#x + * @type {number} + * @since 3.0.0 + */ + x: { + + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + this._cx = value * this.resolution; + this.updateSystem(); + } + + }, + + /** + * The y position of the Camera viewport, relative to the top-left of the game canvas. + * The viewport is the area into which the camera renders. + * To adjust the position the camera is looking at in the game world, see the `scrollY` value. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#y + * @type {number} + * @since 3.0.0 + */ + y: { + + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + this._cy = value * this.resolution; + this.updateSystem(); + } + + }, + + /** + * The width of the Camera viewport, in pixels. + * + * The viewport is the area into which the Camera renders. Setting the viewport does + * not restrict where the Camera can scroll to. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#width + * @type {number} + * @since 3.0.0 + */ + width: { + + get: function () + { + return this._width; + }, + + set: function (value) + { + this._width = value; + this._cw = value * this.resolution; + this.updateSystem(); + } + + }, + + /** + * The height of the Camera viewport, in pixels. + * + * The viewport is the area into which the Camera renders. Setting the viewport does + * not restrict where the Camera can scroll to. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#height + * @type {number} + * @since 3.0.0 + */ + height: { + + get: function () + { + return this._height; + }, + + set: function (value) + { + this._height = value; + this._ch = value * this.resolution; + this.updateSystem(); + } + + }, + + /** + * The horizontal scroll position of this Camera. + * + * Change this value to cause the Camera to scroll around your Scene. + * + * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, + * will automatically adjust the Camera scroll values accordingly. + * + * You can set the bounds within which the Camera can scroll via the `setBounds` method. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#scrollX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + scrollX: { + + get: function () + { + return this._scrollX; + }, + + set: function (value) + { + this._scrollX = value; + this.dirty = true; + } + + }, + + /** + * The vertical scroll position of this Camera. + * + * Change this value to cause the Camera to scroll around your Scene. + * + * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, + * will automatically adjust the Camera scroll values accordingly. + * + * You can set the bounds within which the Camera can scroll via the `setBounds` method. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#scrollY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + scrollY: { + + get: function () + { + return this._scrollY; + }, + + set: function (value) + { + this._scrollY = value; + this.dirty = true; + } + + }, + + /** + * The Camera zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#zoom + * @type {number} + * @default 1 + * @since 3.0.0 + */ + zoom: { + + get: function () + { + return this._zoom; + }, + + set: function (value) + { + this._zoom = value; + this.dirty = true; + } + + }, + + /** + * The rotation of the Camera in radians. + * + * Camera rotation always takes place based on the Camera viewport. By default, rotation happens + * in the center of the viewport. You can adjust this with the `originX` and `originY` properties. + * + * Rotation influences the rendering of _all_ Game Objects visible by this Camera. However, it does not + * rotate the Camera viewport itself, which always remains an axis-aligned rectangle. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#rotation + * @type {number} + * @private + * @default 0 + * @since 3.11.0 + */ + rotation: { + + get: function () + { + return this._rotation; + }, + + set: function (value) + { + this._rotation = value; + this.dirty = true; + } + + }, + + /** + * The horizontal position of the center of the Camera's viewport, relative to the left of the game canvas. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#centerX + * @type {number} + * @readonly + * @since 3.10.0 + */ + centerX: { + + get: function () + { + return this.x + (0.5 * this.width); + } + + }, + + /** + * The vertical position of the center of the Camera's viewport, relative to the top of the game canvas. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#centerY + * @type {number} + * @readonly + * @since 3.10.0 + */ + centerY: { + + get: function () + { + return this.y + (0.5 * this.height); + } + + }, + + /** + * The displayed width of the camera viewport, factoring in the camera zoom level. + * + * If a camera has a viewport width of 800 and a zoom of 0.5 then its display width + * would be 1600, as it's displaying twice as many pixels as zoom level 1. + * + * Equally, a camera with a width of 800 and zoom of 2 would have a display width + * of 400 pixels. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#displayWidth + * @type {number} + * @readonly + * @since 3.11.0 + */ + displayWidth: { + + get: function () + { + return this.width / this.zoom; + } + + }, + + /** + * The displayed height of the camera viewport, factoring in the camera zoom level. + * + * If a camera has a viewport height of 600 and a zoom of 0.5 then its display height + * would be 1200, as it's displaying twice as many pixels as zoom level 1. + * + * Equally, a camera with a height of 600 and zoom of 2 would have a display height + * of 300 pixels. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#displayHeight + * @type {number} + * @readonly + * @since 3.11.0 + */ + displayHeight: { + + get: function () + { + return this.height / this.zoom; + } + + } + +}); + +module.exports = BaseCamera; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Browser specific prefix, so not going to change between contexts, only between browsers +var prefix = ''; + +/** + * @namespace Phaser.Display.Canvas.Smoothing + * @since 3.0.0 + */ +var Smoothing = function () +{ + /** + * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. + * + * @function Phaser.Display.Canvas.Smoothing.getPrefix + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. + * + * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. + */ + var getPrefix = function (context) + { + var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; + + for (var i = 0; i < vendors.length; i++) + { + var s = vendors[i] + 'mageSmoothingEnabled'; + + if (s in context) + { + return s; + } + } + + return null; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.enable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var enable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = true; + } + + return context; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.disable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var disable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = false; + } + + return context; + }; + + /** + * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. + * Returns null if no smoothing prefix is available. + * + * @function Phaser.Display.Canvas.Smoothing.isEnabled + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. + * + * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. + */ + var isEnabled = function (context) + { + return (prefix !== null) ? context[prefix] : null; + }; + + return { + disable: disable, + enable: enable, + getPrefix: getPrefix, + isEnabled: isEnabled + }; + +}; + +module.exports = Smoothing(); + + +/***/ }), +/* 114 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a linear (interpolation) value over t. + * + * @function Phaser.Math.Linear + * @since 3.0.0 + * + * @param {number} p0 - The first point. + * @param {number} p1 - The second point. + * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. + * + * @return {number} The step t% of the way between p0 and p1. + */ +var Linear = function (p0, p1, t) +{ + return (p1 - p0) * t + p0; +}; + +module.exports = Linear; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determines the operating system of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.os` from within any Scene. + * + * @typedef {object} Phaser.Device.OS + * @since 3.0.0 + * + * @property {boolean} android - Is running on android? + * @property {boolean} chromeOS - Is running on chromeOS? + * @property {boolean} cordova - Is the game running under Apache Cordova? + * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? + * @property {boolean} desktop - Is running on a desktop? + * @property {boolean} ejecta - Is the game running under Ejecta? + * @property {boolean} electron - Is the game running under GitHub Electron? + * @property {boolean} iOS - Is running on iOS? + * @property {boolean} iPad - Is running on iPad? + * @property {boolean} iPhone - Is running on iPhone? + * @property {boolean} kindle - Is running on an Amazon Kindle? + * @property {boolean} linux - Is running on linux? + * @property {boolean} macOS - Is running on macOS? + * @property {boolean} node - Is the game running under Node.js? + * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? + * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView + * @property {boolean} windows - Is running on windows? + * @property {boolean} windowsPhone - Is running on a Windows Phone? + * @property {number} iOSVersion - If running in iOS this will contain the major version number. + * @property {number} pixelRatio - PixelRatio of the host device? + */ +var OS = { + + android: false, + chromeOS: false, + cordova: false, + crosswalk: false, + desktop: false, + ejecta: false, + electron: false, + iOS: false, + iOSVersion: 0, + iPad: false, + iPhone: false, + kindle: false, + linux: false, + macOS: false, + node: false, + nodeWebkit: false, + pixelRatio: 1, + webApp: false, + windows: false, + windowsPhone: false + +}; + +function init () +{ + var ua = navigator.userAgent; + + if (/Windows/.test(ua)) + { + OS.windows = true; + } + else if (/Mac OS/.test(ua) && !(/like Mac OS/.test(ua))) + { + OS.macOS = true; + } + else if (/Android/.test(ua)) + { + OS.android = true; + } + else if (/Linux/.test(ua)) + { + OS.linux = true; + } + else if (/iP[ao]d|iPhone/i.test(ua)) + { + OS.iOS = true; + + (navigator.appVersion).match(/OS (\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + + OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; + OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; + } + else if (/Kindle/.test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) + { + OS.kindle = true; + + // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... + // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" + } + else if (/CrOS/.test(ua)) + { + OS.chromeOS = true; + } + + if (/Windows Phone/i.test(ua) || (/IEMobile/i).test(ua)) + { + OS.android = false; + OS.iOS = false; + OS.macOS = false; + OS.windows = true; + OS.windowsPhone = true; + } + + var silk = (/Silk/).test(ua); + + if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) + { + OS.desktop = true; + } + + // Windows Phone / Table reset + if (OS.windowsPhone || ((/Windows NT/i.test(ua)) && (/Touch/i.test(ua)))) + { + OS.desktop = false; + } + + // WebApp mode in iOS + if (navigator.standalone) + { + OS.webApp = true; + } + + if (window.cordova !== undefined) + { + OS.cordova = true; + } + + if (typeof process !== 'undefined' && process.versions && process.versions.node) + { + OS.node = true; + } + + if (OS.node && typeof process.versions === 'object') + { + OS.nodeWebkit = !!process.versions['node-webkit']; + + OS.electron = !!process.versions.electron; + } + + if (window.ejecta !== undefined) + { + OS.ejecta = true; + } + + if ((/Crosswalk/).test(ua)) + { + OS.crosswalk = true; + } + + OS.pixelRatio = window['devicePixelRatio'] || 1; + + return OS; +} + +module.exports = init(); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(681))) + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var OS = __webpack_require__(115); + +/** + * Determines the browser type and version running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.browser` from within any Scene. + * + * @typedef {object} Phaser.Device.Browser + * @since 3.0.0 + * + * @property {boolean} chrome - Set to true if running in Chrome. + * @property {boolean} edge - Set to true if running in Microsoft Edge browser. + * @property {boolean} firefox - Set to true if running in Firefox. + * @property {boolean} ie - Set to true if running in Internet Explorer 11 or less (not Edge). + * @property {boolean} mobileSafari - Set to true if running in Mobile Safari. + * @property {boolean} opera - Set to true if running in Opera. + * @property {boolean} safari - Set to true if running in Safari. + * @property {boolean} silk - Set to true if running in the Silk browser (as used on the Amazon Kindle) + * @property {boolean} trident - Set to true if running a Trident version of Internet Explorer (IE11+) + * @property {number} chromeVersion - If running in Chrome this will contain the major version number. + * @property {number} firefoxVersion - If running in Firefox this will contain the major version number. + * @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion. + * @property {number} safariVersion - If running in Safari this will contain the major version number. + * @property {number} tridentVersion - If running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx} + */ +var Browser = { + + chrome: false, + chromeVersion: 0, + edge: false, + firefox: false, + firefoxVersion: 0, + ie: false, + ieVersion: 0, + mobileSafari: false, + opera: false, + safari: false, + safariVersion: 0, + silk: false, + trident: false, + tridentVersion: 0 + +}; + +function init () +{ + var ua = navigator.userAgent; + + if (/Edge\/\d+/.test(ua)) + { + Browser.edge = true; + } + else if ((/Chrome\/(\d+)/).test(ua) && !OS.windowsPhone) + { + Browser.chrome = true; + Browser.chromeVersion = parseInt(RegExp.$1, 10); + } + else if ((/Firefox\D+(\d+)/).test(ua)) + { + Browser.firefox = true; + Browser.firefoxVersion = parseInt(RegExp.$1, 10); + } + else if ((/AppleWebKit/).test(ua) && OS.iOS) + { + Browser.mobileSafari = true; + } + else if ((/MSIE (\d+\.\d+);/).test(ua)) + { + Browser.ie = true; + Browser.ieVersion = parseInt(RegExp.$1, 10); + } + else if ((/Opera/).test(ua)) + { + Browser.opera = true; + } + else if ((/Safari/).test(ua) && !OS.windowsPhone) + { + Browser.safari = true; + } + else if ((/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/).test(ua)) + { + Browser.ie = true; + Browser.trident = true; + Browser.tridentVersion = parseInt(RegExp.$1, 10); + Browser.ieVersion = parseInt(RegExp.$3, 10); + } + + // Silk gets its own if clause because its ua also contains 'Safari' + if ((/Silk/).test(ua)) + { + Browser.silk = true; + } + + return Browser; +} + +module.exports = init(); + + +/***/ }), +/* 117 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if the given `width` and `height` are a power of two. + * Useful for checking texture dimensions. + * + * @function Phaser.Math.Pow2.IsSizePowerOfTwo + * @since 3.0.0 + * + * @param {number} width - The width. + * @param {number} height - The height. + * + * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`. + */ +var IsSizePowerOfTwo = function (width, height) +{ + return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0); +}; + +module.exports = IsSizePowerOfTwo; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Textures.Events + */ + +module.exports = { + + ADD: __webpack_require__(727), + ERROR: __webpack_require__(728), + LOAD: __webpack_require__(729), + READY: __webpack_require__(730), + REMOVE: __webpack_require__(731) + +}; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds the given element to the DOM. If a parent is provided the element is added as a child of the parent, providing it was able to access it. + * If no parent was given it falls back to using `document.body`. + * + * @function Phaser.DOM.AddToDOM + * @since 3.0.0 + * + * @param {HTMLElement} element - The element to be added to the DOM. Usually a Canvas object. + * @param {(string|HTMLElement)} [parent] - The parent in which to add the element. Can be a string which is passed to `getElementById` or an actual DOM object. + * + * @return {HTMLElement} The element that was added to the DOM. + */ +var AddToDOM = function (element, parent) +{ + var target; + + if (parent) + { + if (typeof parent === 'string') + { + // Hopefully an element ID + target = document.getElementById(parent); + } + else if (typeof parent === 'object' && parent.nodeType === 1) + { + // Quick test for a HTMLElement + target = parent; + } + } + else if (element.parentElement) + { + return element; + } + + // Fallback, covers an invalid ID and a non HTMLElement object + if (!target) + { + target = document.body; + } + + target.appendChild(element); + + return element; +}; + +module.exports = AddToDOM; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(78); + +/** + * Removes the given item, or array of items, from the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for each item successfully removed from the array. + * + * @function Phaser.Utils.Array.Remove + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. + * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. + */ +var Remove = function (array, item, callback, context) +{ + if (context === undefined) { context = array; } + + var index; + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + index = array.indexOf(item); + + if (index !== -1) + { + SpliceOne(array, index); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to remove + + var itemLength = item.length - 1; + + while (itemLength >= 0) + { + var entry = item[itemLength]; + + index = array.indexOf(entry); + + if (index !== -1) + { + SpliceOne(array, index); + + if (callback) + { + callback.call(context, entry); + } + } + else + { + // Item wasn't found in the array, so remove it from our return results + item.pop(); + } + + itemLength--; + } + + return item; +}; + +module.exports = Remove; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Keyboard Codes. + * + * @namespace Phaser.Input.Keyboard.KeyCodes + * @memberof Phaser.Input.Keyboard + * @since 3.0.0 + */ + +var KeyCodes = { + + /** + * The BACKSPACE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.BACKSPACE + * @type {integer} + * @since 3.0.0 + */ + BACKSPACE: 8, + + /** + * The TAB key. + * + * @name Phaser.Input.Keyboard.KeyCodes.TAB + * @type {integer} + * @since 3.0.0 + */ + TAB: 9, + + /** + * The ENTER key. + * + * @name Phaser.Input.Keyboard.KeyCodes.ENTER + * @type {integer} + * @since 3.0.0 + */ + ENTER: 13, + + /** + * The SHIFT key. + * + * @name Phaser.Input.Keyboard.KeyCodes.SHIFT + * @type {integer} + * @since 3.0.0 + */ + SHIFT: 16, + + /** + * The CTRL key. + * + * @name Phaser.Input.Keyboard.KeyCodes.CTRL + * @type {integer} + * @since 3.0.0 + */ + CTRL: 17, + + /** + * The ALT key. + * + * @name Phaser.Input.Keyboard.KeyCodes.ALT + * @type {integer} + * @since 3.0.0 + */ + ALT: 18, + + /** + * The PAUSE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.PAUSE + * @type {integer} + * @since 3.0.0 + */ + PAUSE: 19, + + /** + * The CAPS_LOCK key. + * + * @name Phaser.Input.Keyboard.KeyCodes.CAPS_LOCK + * @type {integer} + * @since 3.0.0 + */ + CAPS_LOCK: 20, + + /** + * The ESC key. + * + * @name Phaser.Input.Keyboard.KeyCodes.ESC + * @type {integer} + * @since 3.0.0 + */ + ESC: 27, + + /** + * The SPACE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.SPACE + * @type {integer} + * @since 3.0.0 + */ + SPACE: 32, + + /** + * The PAGE_UP key. + * + * @name Phaser.Input.Keyboard.KeyCodes.PAGE_UP + * @type {integer} + * @since 3.0.0 + */ + PAGE_UP: 33, + + /** + * The PAGE_DOWN key. + * + * @name Phaser.Input.Keyboard.KeyCodes.PAGE_DOWN + * @type {integer} + * @since 3.0.0 + */ + PAGE_DOWN: 34, + + /** + * The END key. + * + * @name Phaser.Input.Keyboard.KeyCodes.END + * @type {integer} + * @since 3.0.0 + */ + END: 35, + + /** + * The HOME key. + * + * @name Phaser.Input.Keyboard.KeyCodes.HOME + * @type {integer} + * @since 3.0.0 + */ + HOME: 36, + + /** + * The LEFT key. + * + * @name Phaser.Input.Keyboard.KeyCodes.LEFT + * @type {integer} + * @since 3.0.0 + */ + LEFT: 37, + + /** + * The UP key. + * + * @name Phaser.Input.Keyboard.KeyCodes.UP + * @type {integer} + * @since 3.0.0 + */ + UP: 38, + + /** + * The RIGHT key. + * + * @name Phaser.Input.Keyboard.KeyCodes.RIGHT + * @type {integer} + * @since 3.0.0 + */ + RIGHT: 39, + + /** + * The DOWN key. + * + * @name Phaser.Input.Keyboard.KeyCodes.DOWN + * @type {integer} + * @since 3.0.0 + */ + DOWN: 40, + + /** + * The PRINT_SCREEN key. + * + * @name Phaser.Input.Keyboard.KeyCodes.PRINT_SCREEN + * @type {integer} + * @since 3.0.0 + */ + PRINT_SCREEN: 42, + + /** + * The INSERT key. + * + * @name Phaser.Input.Keyboard.KeyCodes.INSERT + * @type {integer} + * @since 3.0.0 + */ + INSERT: 45, + + /** + * The DELETE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.DELETE + * @type {integer} + * @since 3.0.0 + */ + DELETE: 46, + + /** + * The ZERO key. + * + * @name Phaser.Input.Keyboard.KeyCodes.ZERO + * @type {integer} + * @since 3.0.0 + */ + ZERO: 48, + + /** + * The ONE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.ONE + * @type {integer} + * @since 3.0.0 + */ + ONE: 49, + + /** + * The TWO key. + * + * @name Phaser.Input.Keyboard.KeyCodes.TWO + * @type {integer} + * @since 3.0.0 + */ + TWO: 50, + + /** + * The THREE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.THREE + * @type {integer} + * @since 3.0.0 + */ + THREE: 51, + + /** + * The FOUR key. + * + * @name Phaser.Input.Keyboard.KeyCodes.FOUR + * @type {integer} + * @since 3.0.0 + */ + FOUR: 52, + + /** + * The FIVE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.FIVE + * @type {integer} + * @since 3.0.0 + */ + FIVE: 53, + + /** + * The SIX key. + * + * @name Phaser.Input.Keyboard.KeyCodes.SIX + * @type {integer} + * @since 3.0.0 + */ + SIX: 54, + + /** + * The SEVEN key. + * + * @name Phaser.Input.Keyboard.KeyCodes.SEVEN + * @type {integer} + * @since 3.0.0 + */ + SEVEN: 55, + + /** + * The EIGHT key. + * + * @name Phaser.Input.Keyboard.KeyCodes.EIGHT + * @type {integer} + * @since 3.0.0 + */ + EIGHT: 56, + + /** + * The NINE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NINE + * @type {integer} + * @since 3.0.0 + */ + NINE: 57, + + /** + * The NUMPAD_ZERO key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ZERO + * @type {integer} + * @since 3.0.0 + */ + NUMPAD_ZERO: 96, + + /** + * The NUMPAD_ONE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ONE + * @type {integer} + * @since 3.0.0 + */ + NUMPAD_ONE: 97, + + /** + * The NUMPAD_TWO key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_TWO + * @type {integer} + * @since 3.0.0 + */ + NUMPAD_TWO: 98, + + /** + * The NUMPAD_THREE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_THREE + * @type {integer} + * @since 3.0.0 + */ + NUMPAD_THREE: 99, + + /** + * The NUMPAD_FOUR key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FOUR + * @type {integer} + * @since 3.0.0 + */ + NUMPAD_FOUR: 100, + + /** + * The NUMPAD_FIVE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FIVE + * @type {integer} + * @since 3.0.0 + */ + NUMPAD_FIVE: 101, + + /** + * The NUMPAD_SIX key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SIX + * @type {integer} + * @since 3.0.0 + */ + NUMPAD_SIX: 102, + + /** + * The NUMPAD_SEVEN key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SEVEN + * @type {integer} + * @since 3.0.0 + */ + NUMPAD_SEVEN: 103, + + /** + * The NUMPAD_EIGHT key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_EIGHT + * @type {integer} + * @since 3.0.0 + */ + NUMPAD_EIGHT: 104, + + /** + * The NUMPAD_NINE key. + * + * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_NINE + * @type {integer} + * @since 3.0.0 + */ + NUMPAD_NINE: 105, + + /** + * The A key. + * + * @name Phaser.Input.Keyboard.KeyCodes.A + * @type {integer} + * @since 3.0.0 + */ + A: 65, + + /** + * The B key. + * + * @name Phaser.Input.Keyboard.KeyCodes.B + * @type {integer} + * @since 3.0.0 + */ + B: 66, + + /** + * The C key. + * + * @name Phaser.Input.Keyboard.KeyCodes.C + * @type {integer} + * @since 3.0.0 + */ + C: 67, + + /** + * The D key. + * + * @name Phaser.Input.Keyboard.KeyCodes.D + * @type {integer} + * @since 3.0.0 + */ + D: 68, + + /** + * The E key. + * + * @name Phaser.Input.Keyboard.KeyCodes.E + * @type {integer} + * @since 3.0.0 + */ + E: 69, + + /** + * The F key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F + * @type {integer} + * @since 3.0.0 + */ + F: 70, + + /** + * The G key. + * + * @name Phaser.Input.Keyboard.KeyCodes.G + * @type {integer} + * @since 3.0.0 + */ + G: 71, + + /** + * The H key. + * + * @name Phaser.Input.Keyboard.KeyCodes.H + * @type {integer} + * @since 3.0.0 + */ + H: 72, + + /** + * The I key. + * + * @name Phaser.Input.Keyboard.KeyCodes.I + * @type {integer} + * @since 3.0.0 + */ + I: 73, + + /** + * The J key. + * + * @name Phaser.Input.Keyboard.KeyCodes.J + * @type {integer} + * @since 3.0.0 + */ + J: 74, + + /** + * The K key. + * + * @name Phaser.Input.Keyboard.KeyCodes.K + * @type {integer} + * @since 3.0.0 + */ + K: 75, + + /** + * The L key. + * + * @name Phaser.Input.Keyboard.KeyCodes.L + * @type {integer} + * @since 3.0.0 + */ + L: 76, + + /** + * The M key. + * + * @name Phaser.Input.Keyboard.KeyCodes.M + * @type {integer} + * @since 3.0.0 + */ + M: 77, + + /** + * The N key. + * + * @name Phaser.Input.Keyboard.KeyCodes.N + * @type {integer} + * @since 3.0.0 + */ + N: 78, + + /** + * The O key. + * + * @name Phaser.Input.Keyboard.KeyCodes.O + * @type {integer} + * @since 3.0.0 + */ + O: 79, + + /** + * The P key. + * + * @name Phaser.Input.Keyboard.KeyCodes.P + * @type {integer} + * @since 3.0.0 + */ + P: 80, + + /** + * The Q key. + * + * @name Phaser.Input.Keyboard.KeyCodes.Q + * @type {integer} + * @since 3.0.0 + */ + Q: 81, + + /** + * The R key. + * + * @name Phaser.Input.Keyboard.KeyCodes.R + * @type {integer} + * @since 3.0.0 + */ + R: 82, + + /** + * The S key. + * + * @name Phaser.Input.Keyboard.KeyCodes.S + * @type {integer} + * @since 3.0.0 + */ + S: 83, + + /** + * The T key. + * + * @name Phaser.Input.Keyboard.KeyCodes.T + * @type {integer} + * @since 3.0.0 + */ + T: 84, + + /** + * The U key. + * + * @name Phaser.Input.Keyboard.KeyCodes.U + * @type {integer} + * @since 3.0.0 + */ + U: 85, + + /** + * The V key. + * + * @name Phaser.Input.Keyboard.KeyCodes.V + * @type {integer} + * @since 3.0.0 + */ + V: 86, + + /** + * The W key. + * + * @name Phaser.Input.Keyboard.KeyCodes.W + * @type {integer} + * @since 3.0.0 + */ + W: 87, + + /** + * The X key. + * + * @name Phaser.Input.Keyboard.KeyCodes.X + * @type {integer} + * @since 3.0.0 + */ + X: 88, + + /** + * The Y key. + * + * @name Phaser.Input.Keyboard.KeyCodes.Y + * @type {integer} + * @since 3.0.0 + */ + Y: 89, + + /** + * The Z key. + * + * @name Phaser.Input.Keyboard.KeyCodes.Z + * @type {integer} + * @since 3.0.0 + */ + Z: 90, + + /** + * The F1 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F1 + * @type {integer} + * @since 3.0.0 + */ + F1: 112, + + /** + * The F2 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F2 + * @type {integer} + * @since 3.0.0 + */ + F2: 113, + + /** + * The F3 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F3 + * @type {integer} + * @since 3.0.0 + */ + F3: 114, + + /** + * The F4 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F4 + * @type {integer} + * @since 3.0.0 + */ + F4: 115, + + /** + * The F5 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F5 + * @type {integer} + * @since 3.0.0 + */ + F5: 116, + + /** + * The F6 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F6 + * @type {integer} + * @since 3.0.0 + */ + F6: 117, + + /** + * The F7 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F7 + * @type {integer} + * @since 3.0.0 + */ + F7: 118, + + /** + * The F8 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F8 + * @type {integer} + * @since 3.0.0 + */ + F8: 119, + + /** + * The F9 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F9 + * @type {integer} + * @since 3.0.0 + */ + F9: 120, + + /** + * The F10 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F10 + * @type {integer} + * @since 3.0.0 + */ + F10: 121, + + /** + * The F11 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F11 + * @type {integer} + * @since 3.0.0 + */ + F11: 122, + + /** + * The F12 key. + * + * @name Phaser.Input.Keyboard.KeyCodes.F12 + * @type {integer} + * @since 3.0.0 + */ + F12: 123, + + /** + * The SEMICOLON key. + * + * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON + * @type {integer} + * @since 3.0.0 + */ + SEMICOLON: 186, + + /** + * The PLUS key. + * + * @name Phaser.Input.Keyboard.KeyCodes.PLUS + * @type {integer} + * @since 3.0.0 + */ + PLUS: 187, + + /** + * The COMMA key. + * + * @name Phaser.Input.Keyboard.KeyCodes.COMMA + * @type {integer} + * @since 3.0.0 + */ + COMMA: 188, + + /** + * The MINUS key. + * + * @name Phaser.Input.Keyboard.KeyCodes.MINUS + * @type {integer} + * @since 3.0.0 + */ + MINUS: 189, + + /** + * The PERIOD key. + * + * @name Phaser.Input.Keyboard.KeyCodes.PERIOD + * @type {integer} + * @since 3.0.0 + */ + PERIOD: 190, + + /** + * The FORWARD_SLASH key. + * + * @name Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH + * @type {integer} + * @since 3.0.0 + */ + FORWARD_SLASH: 191, + + /** + * The BACK_SLASH key. + * + * @name Phaser.Input.Keyboard.KeyCodes.BACK_SLASH + * @type {integer} + * @since 3.0.0 + */ + BACK_SLASH: 220, + + /** + * The QUOTES key. + * + * @name Phaser.Input.Keyboard.KeyCodes.QUOTES + * @type {integer} + * @since 3.0.0 + */ + QUOTES: 222, + + /** + * The BACKTICK key. + * + * @name Phaser.Input.Keyboard.KeyCodes.BACKTICK + * @type {integer} + * @since 3.0.0 + */ + BACKTICK: 192, + + /** + * The OPEN_BRACKET key. + * + * @name Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET + * @type {integer} + * @since 3.0.0 + */ + OPEN_BRACKET: 219, + + /** + * The CLOSED_BRACKET key. + * + * @name Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET + * @type {integer} + * @since 3.0.0 + */ + CLOSED_BRACKET: 221, + + /** + * The SEMICOLON_FIREFOX key. + * + * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON_FIREFOX + * @type {integer} + * @since 3.0.0 + */ + SEMICOLON_FIREFOX: 59, + + /** + * The COLON key. + * + * @name Phaser.Input.Keyboard.KeyCodes.COLON + * @type {integer} + * @since 3.0.0 + */ + COLON: 58, + + /** + * The COMMA_FIREFOX_WINDOWS key. + * + * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX_WINDOWS + * @type {integer} + * @since 3.0.0 + */ + COMMA_FIREFOX_WINDOWS: 60, + + /** + * The COMMA_FIREFOX key. + * + * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX + * @type {integer} + * @since 3.0.0 + */ + COMMA_FIREFOX: 62, + + /** + * The BRACKET_RIGHT_FIREFOX key. + * + * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_RIGHT_FIREFOX + * @type {integer} + * @since 3.0.0 + */ + BRACKET_RIGHT_FIREFOX: 174, + + /** + * The BRACKET_LEFT_FIREFOX key. + * + * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_LEFT_FIREFOX + * @type {integer} + * @since 3.0.0 + */ + BRACKET_LEFT_FIREFOX: 175 +}; + +module.exports = KeyCodes; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Scene consts. + * + * @ignore + */ + +var CONST = { + + /** + * Scene state. + * + * @name Phaser.Scenes.PENDING + * @readonly + * @type {integer} + * @since 3.0.0 + */ + PENDING: 0, + + /** + * Scene state. + * + * @name Phaser.Scenes.INIT + * @readonly + * @type {integer} + * @since 3.0.0 + */ + INIT: 1, + + /** + * Scene state. + * + * @name Phaser.Scenes.START + * @readonly + * @type {integer} + * @since 3.0.0 + */ + START: 2, + + /** + * Scene state. + * + * @name Phaser.Scenes.LOADING + * @readonly + * @type {integer} + * @since 3.0.0 + */ + LOADING: 3, + + /** + * Scene state. + * + * @name Phaser.Scenes.CREATING + * @readonly + * @type {integer} + * @since 3.0.0 + */ + CREATING: 4, + + /** + * Scene state. + * + * @name Phaser.Scenes.RUNNING + * @readonly + * @type {integer} + * @since 3.0.0 + */ + RUNNING: 5, + + /** + * Scene state. + * + * @name Phaser.Scenes.PAUSED + * @readonly + * @type {integer} + * @since 3.0.0 + */ + PAUSED: 6, + + /** + * Scene state. + * + * @name Phaser.Scenes.SLEEPING + * @readonly + * @type {integer} + * @since 3.0.0 + */ + SLEEPING: 7, + + /** + * Scene state. + * + * @name Phaser.Scenes.SHUTDOWN + * @readonly + * @type {integer} + * @since 3.0.0 + */ + SHUTDOWN: 8, + + /** + * Scene state. + * + * @name Phaser.Scenes.DESTROYED + * @readonly + * @type {integer} + * @since 3.0.0 + */ + DESTROYED: 9 + +}; + +module.exports = CONST; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Clone = __webpack_require__(64); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(65); +var GameEvents = __webpack_require__(28); +var NOOP = __webpack_require__(1); + +/** + * @classdesc + * The sound manager is responsible for playing back audio via Web Audio API or HTML Audio tag as fallback. + * The audio file type and the encoding of those files are extremely important. + * + * Not all browsers can play all audio formats. + * + * There is a good guide to what's supported [here](https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Cross-browser_audio_basics#Audio_Codec_Support). + * + * @class BaseSoundManager + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Sound + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - Reference to the current game instance. + */ +var BaseSoundManager = new Class({ + + Extends: EventEmitter, + + initialize: + + function BaseSoundManager (game) + { + EventEmitter.call(this); + + /** + * Local reference to game. + * + * @name Phaser.Sound.BaseSoundManager#game + * @type {Phaser.Game} + * @readonly + * @since 3.0.0 + */ + this.game = game; + + /** + * Local reference to the JSON Cache, as used by Audio Sprites. + * + * @name Phaser.Sound.BaseSoundManager#jsonCache + * @type {Phaser.Cache.BaseCache} + * @readonly + * @since 3.7.0 + */ + this.jsonCache = game.cache.json; + + /** + * An array containing all added sounds. + * + * @name Phaser.Sound.BaseSoundManager#sounds + * @type {Phaser.Sound.BaseSound[]} + * @default [] + * @private + * @since 3.0.0 + */ + this.sounds = []; + + /** + * Global mute setting. + * + * @name Phaser.Sound.BaseSoundManager#mute + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.mute = false; + + /** + * Global volume setting. + * + * @name Phaser.Sound.BaseSoundManager#volume + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.volume = 1; + + /** + * Flag indicating if sounds should be paused when game looses focus, + * for instance when user switches to another tab/program/app. + * + * @name Phaser.Sound.BaseSoundManager#pauseOnBlur + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.pauseOnBlur = true; + + /** + * Property that actually holds the value of global playback rate. + * + * @name Phaser.Sound.BaseSoundManager#_rate + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + this._rate = 1; + + /** + * Property that actually holds the value of global detune. + * + * @name Phaser.Sound.BaseSoundManager#_detune + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._detune = 0; + + /** + * Mobile devices require sounds to be triggered from an explicit user action, + * such as a tap, before any sound can be loaded/played on a web page. + * Set to true if the audio system is currently locked awaiting user interaction. + * + * @name Phaser.Sound.BaseSoundManager#locked + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + this.locked = this.locked || false; + + /** + * Flag used internally for handling when the audio system + * has been unlocked, if there ever was a need for it. + * + * @name Phaser.Sound.BaseSoundManager#unlocked + * @type {boolean} + * @default false + * @private + * @since 3.0.0 + */ + this.unlocked = false; + + game.events.on(GameEvents.BLUR, function () + { + if (this.pauseOnBlur) + { + this.onBlur(); + } + }, this); + + game.events.on(GameEvents.FOCUS, function () + { + if (this.pauseOnBlur) + { + this.onFocus(); + } + }, this); + + game.events.on(GameEvents.PRE_STEP, this.update, this); + game.events.once(GameEvents.DESTROY, this.destroy, this); + }, + + /** + * Adds a new sound into the sound manager. + * + * @method Phaser.Sound.BaseSoundManager#add + * @override + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {Phaser.Sound.BaseSound} The new sound instance. + */ + add: NOOP, + + /** + * Adds a new audio sprite sound into the sound manager. + * Audio Sprites are a combination of audio files and a JSON configuration. + * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite + * + * @method Phaser.Sound.BaseSoundManager#addAudioSprite + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {Phaser.Types.Sound.AudioSpriteSound} The new audio sprite sound instance. + */ + addAudioSprite: function (key, config) + { + if (config === undefined) { config = {}; } + + var sound = this.add(key, config); + + sound.spritemap = this.jsonCache.get(key).spritemap; + + for (var markerName in sound.spritemap) + { + if (!sound.spritemap.hasOwnProperty(markerName)) + { + continue; + } + + var markerConfig = Clone(config); + + var marker = sound.spritemap[markerName]; + + markerConfig.loop = (marker.hasOwnProperty('loop')) ? marker.loop : false; + + sound.addMarker({ + name: markerName, + start: marker.start, + duration: marker.end - marker.start, + config: markerConfig + }); + } + + return sound; + }, + + /** + * Enables playing sound on the fly without the need to keep a reference to it. + * Sound will auto destroy once its playback ends. + * + * @method Phaser.Sound.BaseSoundManager#play + * @listens Phaser.Sound.Events#COMPLETE + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {(Phaser.Types.Sound.SoundConfig|Phaser.Types.Sound.SoundMarker)} [extra] - An optional additional object containing settings to be applied to the sound. It could be either config or marker object. + * + * @return {boolean} Whether the sound started playing successfully. + */ + play: function (key, extra) + { + var sound = this.add(key); + + sound.once(Events.COMPLETE, sound.destroy, sound); + + if (extra) + { + if (extra.name) + { + sound.addMarker(extra); + + return sound.play(extra.name); + } + else + { + return sound.play(extra); + } + } + else + { + return sound.play(); + } + }, + + /** + * Enables playing audio sprite sound on the fly without the need to keep a reference to it. + * Sound will auto destroy once its playback ends. + * + * @method Phaser.Sound.BaseSoundManager#playAudioSprite + * @listens Phaser.Sound.Events#COMPLETE + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {string} spriteName - The name of the sound sprite to play. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {boolean} Whether the audio sprite sound started playing successfully. + */ + playAudioSprite: function (key, spriteName, config) + { + var sound = this.addAudioSprite(key); + + sound.once(Events.COMPLETE, sound.destroy, sound); + + return sound.play(spriteName, config); + }, + + /** + * Removes a sound from the sound manager. + * The removed sound is destroyed before removal. + * + * @method Phaser.Sound.BaseSoundManager#remove + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSound} sound - The sound object to remove. + * + * @return {boolean} True if the sound was removed successfully, otherwise false. + */ + remove: function (sound) + { + var index = this.sounds.indexOf(sound); + + if (index !== -1) + { + sound.destroy(); + + this.sounds.splice(index, 1); + + return true; + } + + return false; + }, + + /** + * Removes all sounds from the sound manager that have an asset key matching the given value. + * The removed sounds are destroyed before removal. + * + * @method Phaser.Sound.BaseSoundManager#removeByKey + * @since 3.0.0 + * + * @param {string} key - The key to match when removing sound objects. + * + * @return {number} The number of matching sound objects that were removed. + */ + removeByKey: function (key) + { + var removed = 0; + + for (var i = this.sounds.length - 1; i >= 0; i--) + { + var sound = this.sounds[i]; + + if (sound.key === key) + { + sound.destroy(); + + this.sounds.splice(i, 1); + + removed++; + } + } + + return removed; + }, + + /** + * Pauses all the sounds in the game. + * + * @method Phaser.Sound.BaseSoundManager#pauseAll + * @fires Phaser.Sound.Events#PAUSE_ALL + * @since 3.0.0 + */ + pauseAll: function () + { + this.forEachActiveSound(function (sound) + { + sound.pause(); + }); + + this.emit(Events.PAUSE_ALL, this); + }, + + /** + * Resumes all the sounds in the game. + * + * @method Phaser.Sound.BaseSoundManager#resumeAll + * @fires Phaser.Sound.Events#RESUME_ALL + * @since 3.0.0 + */ + resumeAll: function () + { + this.forEachActiveSound(function (sound) + { + sound.resume(); + }); + + this.emit(Events.RESUME_ALL, this); + }, + + /** + * Stops all the sounds in the game. + * + * @method Phaser.Sound.BaseSoundManager#stopAll + * @fires Phaser.Sound.Events#STOP_ALL + * @since 3.0.0 + */ + stopAll: function () + { + this.forEachActiveSound(function (sound) + { + sound.stop(); + }); + + this.emit(Events.STOP_ALL, this); + }, + + /** + * Method used internally for unlocking audio playback on devices that + * require user interaction before any sound can be played on a web page. + * + * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09). + * + * @method Phaser.Sound.BaseSoundManager#unlock + * @override + * @protected + * @since 3.0.0 + */ + unlock: NOOP, + + /** + * Method used internally for pausing sound manager if + * Phaser.Sound.BaseSoundManager#pauseOnBlur is set to true. + * + * @method Phaser.Sound.BaseSoundManager#onBlur + * @override + * @protected + * @since 3.0.0 + */ + onBlur: NOOP, + + /** + * Method used internally for resuming sound manager if + * Phaser.Sound.BaseSoundManager#pauseOnBlur is set to true. + * + * @method Phaser.Sound.BaseSoundManager#onFocus + * @override + * @protected + * @since 3.0.0 + */ + onFocus: NOOP, + + /** + * Update method called on every game step. + * Removes destroyed sounds and updates every active sound in the game. + * + * @method Phaser.Sound.BaseSoundManager#update + * @protected + * @fires Phaser.Sound.Events#UNLOCKED + * @since 3.0.0 + * + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time elapsed since the last frame. + */ + update: function (time, delta) + { + if (this.unlocked) + { + this.unlocked = false; + this.locked = false; + + this.emit(Events.UNLOCKED, this); + } + + for (var i = this.sounds.length - 1; i >= 0; i--) + { + if (this.sounds[i].pendingRemove) + { + this.sounds.splice(i, 1); + } + } + + this.sounds.forEach(function (sound) + { + sound.update(time, delta); + }); + }, + + /** + * Destroys all the sounds in the game and all associated events. + * + * @method Phaser.Sound.BaseSoundManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.removeAllListeners(); + + this.forEachActiveSound(function (sound) + { + sound.destroy(); + }); + + this.sounds.length = 0; + this.sounds = null; + + this.game = null; + }, + + /** + * Method used internally for iterating only over active sounds and skipping sounds that are marked for removal. + * + * @method Phaser.Sound.BaseSoundManager#forEachActiveSound + * @private + * @since 3.0.0 + * + * @param {Phaser.Types.Sound.EachActiveSoundCallback} callback - Callback function. (manager: Phaser.Sound.BaseSoundManager, sound: Phaser.Sound.BaseSound, index: number, sounds: Phaser.Manager.BaseSound[]) => void + * @param {*} [scope] - Callback context. + */ + forEachActiveSound: function (callback, scope) + { + var _this = this; + + this.sounds.forEach(function (sound, index) + { + if (!sound.pendingRemove) + { + callback.call(scope || _this, sound, index, _this.sounds); + } + }); + }, + + /** + * Sets the global playback rate at which all the sounds will be played. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @method Phaser.Sound.BaseSoundManager#setRate + * @fires Phaser.Sound.Events#GLOBAL_RATE + * @since 3.3.0 + * + * @param {number} value - Global playback rate at which all the sounds will be played. + * + * @return {Phaser.Sound.BaseSoundManager} This Sound Manager. + */ + setRate: function (value) + { + this.rate = value; + + return this; + }, + + /** + * Global playback rate at which all the sounds will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audio's playback speed. + * + * @name Phaser.Sound.BaseSoundManager#rate + * @type {number} + * @default 1 + * @since 3.0.0 + */ + rate: { + + get: function () + { + return this._rate; + }, + + set: function (value) + { + this._rate = value; + + this.forEachActiveSound(function (sound) + { + sound.calculateRate(); + }); + + this.emit(Events.GLOBAL_RATE, this, value); + } + + }, + + /** + * Sets the global detuning of all sounds in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @method Phaser.Sound.BaseSoundManager#setDetune + * @fires Phaser.Sound.Events#GLOBAL_DETUNE + * @since 3.3.0 + * + * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @return {Phaser.Sound.BaseSoundManager} This Sound Manager. + */ + setDetune: function (value) + { + this.detune = value; + + return this; + }, + + /** + * Global detuning of all sounds in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @name Phaser.Sound.BaseSoundManager#detune + * @type {number} + * @default 0 + * @since 3.0.0 + */ + detune: { + + get: function () + { + return this._detune; + }, + + set: function (value) + { + this._detune = value; + + this.forEachActiveSound(function (sound) + { + sound.calculateRate(); + }); + + this.emit(Events.GLOBAL_DETUNE, this, value); + } + + } + +}); + +module.exports = BaseSoundManager; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(65); +var Extend = __webpack_require__(17); +var NOOP = __webpack_require__(1); + +/** + * @classdesc + * Class containing all the shared state and behavior of a sound object, independent of the implementation. + * + * @class BaseSound + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Sound + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSoundManager} manager - Reference to the current sound manager instance. + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + */ +var BaseSound = new Class({ + + Extends: EventEmitter, + + initialize: + + function BaseSound (manager, key, config) + { + EventEmitter.call(this); + + /** + * Local reference to the sound manager. + * + * @name Phaser.Sound.BaseSound#manager + * @type {Phaser.Sound.BaseSoundManager} + * @private + * @since 3.0.0 + */ + this.manager = manager; + + /** + * Asset key for the sound. + * + * @name Phaser.Sound.BaseSound#key + * @type {string} + * @readonly + * @since 3.0.0 + */ + this.key = key; + + /** + * Flag indicating if sound is currently playing. + * + * @name Phaser.Sound.BaseSound#isPlaying + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ + this.isPlaying = false; + + /** + * Flag indicating if sound is currently paused. + * + * @name Phaser.Sound.BaseSound#isPaused + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ + this.isPaused = false; + + /** + * A property that holds the value of sound's actual playback rate, + * after its rate and detune values has been combined with global + * rate and detune values. + * + * @name Phaser.Sound.BaseSound#totalRate + * @type {number} + * @default 1 + * @readonly + * @since 3.0.0 + */ + this.totalRate = 1; + + /** + * A value representing the duration, in seconds. + * It could be total sound duration or a marker duration. + * + * @name Phaser.Sound.BaseSound#duration + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.duration = this.duration || 0; + + /** + * The total duration of the sound in seconds. + * + * @name Phaser.Sound.BaseSound#totalDuration + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.totalDuration = this.totalDuration || 0; + + /** + * A config object used to store default sound settings' values. + * Default values will be set by properties' setters. + * + * @name Phaser.Sound.BaseSound#config + * @type {Phaser.Types.Sound.SoundConfig} + * @private + * @since 3.0.0 + */ + this.config = { + + mute: false, + volume: 1, + rate: 1, + detune: 0, + seek: 0, + loop: false, + delay: 0 + + }; + + /** + * Reference to the currently used config. + * It could be default config or marker config. + * + * @name Phaser.Sound.BaseSound#currentConfig + * @type {Phaser.Types.Sound.SoundConfig} + * @private + * @since 3.0.0 + */ + this.currentConfig = this.config; + + this.config = Extend(this.config, config); + + /** + * Object containing markers definitions. + * + * @name Phaser.Sound.BaseSound#markers + * @type {Object.} + * @default {} + * @readonly + * @since 3.0.0 + */ + this.markers = {}; + + /** + * Currently playing marker. + * 'null' if whole sound is playing. + * + * @name Phaser.Sound.BaseSound#currentMarker + * @type {Phaser.Types.Sound.SoundMarker} + * @default null + * @readonly + * @since 3.0.0 + */ + this.currentMarker = null; + + /** + * Flag indicating if destroy method was called on this sound. + * + * @name Phaser.Sound.BaseSound#pendingRemove + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this.pendingRemove = false; + }, + + /** + * Adds a marker into the current sound. A marker is represented by name, start time, duration, and optionally config object. + * This allows you to bundle multiple sounds together into a single audio file and use markers to jump between them for playback. + * + * @method Phaser.Sound.BaseSound#addMarker + * @since 3.0.0 + * + * @param {Phaser.Types.Sound.SoundMarker} marker - Marker object. + * + * @return {boolean} Whether the marker was added successfully. + */ + addMarker: function (marker) + { + if (!marker || !marker.name || typeof marker.name !== 'string') + { + return false; + } + + if (this.markers[marker.name]) + { + // eslint-disable-next-line no-console + console.error('addMarker ' + marker.name + ' already exists in Sound'); + + return false; + } + + marker = Extend(true, { + name: '', + start: 0, + duration: this.totalDuration - (marker.start || 0), + config: { + mute: false, + volume: 1, + rate: 1, + detune: 0, + seek: 0, + loop: false, + delay: 0 + } + }, marker); + + this.markers[marker.name] = marker; + + return true; + }, + + /** + * Updates previously added marker. + * + * @method Phaser.Sound.BaseSound#updateMarker + * @since 3.0.0 + * + * @param {Phaser.Types.Sound.SoundMarker} marker - Marker object with updated values. + * + * @return {boolean} Whether the marker was updated successfully. + */ + updateMarker: function (marker) + { + if (!marker || !marker.name || typeof marker.name !== 'string') + { + return false; + } + + if (!this.markers[marker.name]) + { + // eslint-disable-next-line no-console + console.warn('Audio Marker: ' + marker.name + ' missing in Sound: ' + this.key); + + return false; + } + + this.markers[marker.name] = Extend(true, this.markers[marker.name], marker); + + return true; + }, + + /** + * Removes a marker from the sound. + * + * @method Phaser.Sound.BaseSound#removeMarker + * @since 3.0.0 + * + * @param {string} markerName - The name of the marker to remove. + * + * @return {?Phaser.Types.Sound.SoundMarker} Removed marker object or 'null' if there was no marker with provided name. + */ + removeMarker: function (markerName) + { + var marker = this.markers[markerName]; + + if (!marker) + { + return null; + } + + this.markers[markerName] = null; + + return marker; + }, + + /** + * Play this sound, or a marked section of it. + * It always plays the sound from the start. If you want to start playback from a specific time + * you can set 'seek' setting of the config object, provided to this call, to that value. + * + * @method Phaser.Sound.BaseSound#play + * @since 3.0.0 + * + * @param {string} [markerName=''] - If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound. + * + * @return {boolean} Whether the sound started playing successfully. + */ + play: function (markerName, config) + { + if (markerName === undefined) { markerName = ''; } + + if (typeof markerName === 'object') + { + config = markerName; + markerName = ''; + } + + if (typeof markerName !== 'string') + { + return false; + } + + if (!markerName) + { + this.currentMarker = null; + this.currentConfig = this.config; + this.duration = this.totalDuration; + } + else + { + if (!this.markers[markerName]) + { + // eslint-disable-next-line no-console + console.warn('Marker: ' + markerName + ' missing in Sound: ' + this.key); + + return false; + } + + this.currentMarker = this.markers[markerName]; + this.currentConfig = this.currentMarker.config; + this.duration = this.currentMarker.duration; + } + + this.resetConfig(); + + this.currentConfig = Extend(this.currentConfig, config); + + this.isPlaying = true; + this.isPaused = false; + + return true; + }, + + /** + * Pauses the sound. + * + * @method Phaser.Sound.BaseSound#pause + * @since 3.0.0 + * + * @return {boolean} Whether the sound was paused successfully. + */ + pause: function () + { + if (this.isPaused || !this.isPlaying) + { + return false; + } + + this.isPlaying = false; + this.isPaused = true; + + return true; + }, + + /** + * Resumes the sound. + * + * @method Phaser.Sound.BaseSound#resume + * @since 3.0.0 + * + * @return {boolean} Whether the sound was resumed successfully. + */ + resume: function () + { + if (!this.isPaused || this.isPlaying) + { + return false; + } + + this.isPlaying = true; + this.isPaused = false; + + return true; + }, + + /** + * Stop playing this sound. + * + * @method Phaser.Sound.BaseSound#stop + * @since 3.0.0 + * + * @return {boolean} Whether the sound was stopped successfully. + */ + stop: function () + { + if (!this.isPaused && !this.isPlaying) + { + return false; + } + + this.isPlaying = false; + this.isPaused = false; + + this.resetConfig(); + + return true; + }, + + /** + * Method used internally for applying config values to some of the sound properties. + * + * @method Phaser.Sound.BaseSound#applyConfig + * @protected + * @since 3.0.0 + */ + applyConfig: function () + { + this.mute = this.currentConfig.mute; + this.volume = this.currentConfig.volume; + this.rate = this.currentConfig.rate; + this.detune = this.currentConfig.detune; + this.loop = this.currentConfig.loop; + }, + + /** + * Method used internally for resetting values of some of the config properties. + * + * @method Phaser.Sound.BaseSound#resetConfig + * @protected + * @since 3.0.0 + */ + resetConfig: function () + { + this.currentConfig.seek = 0; + this.currentConfig.delay = 0; + }, + + /** + * Update method called automatically by sound manager on every game step. + * + * @method Phaser.Sound.BaseSound#update + * @override + * @protected + * @since 3.0.0 + * + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time elapsed since the last frame. + */ + update: NOOP, + + /** + * Method used internally to calculate total playback rate of the sound. + * + * @method Phaser.Sound.BaseSound#calculateRate + * @protected + * @since 3.0.0 + */ + calculateRate: function () + { + var cent = 1.0005777895065548; // Math.pow(2, 1/1200); + var totalDetune = this.currentConfig.detune + this.manager.detune; + var detuneRate = Math.pow(cent, totalDetune); + + this.totalRate = this.currentConfig.rate * this.manager.rate * detuneRate; + }, + + /** + * Destroys this sound and all associated events and marks it for removal from the sound manager. + * + * @method Phaser.Sound.BaseSound#destroy + * @fires Phaser.Sound.Events#DESTROY + * @since 3.0.0 + */ + destroy: function () + { + if (this.pendingRemove) + { + return; + } + + this.emit(Events.DESTROY, this); + this.pendingRemove = true; + this.manager = null; + this.key = ''; + this.removeAllListeners(); + this.isPlaying = false; + this.isPaused = false; + this.config = null; + this.currentConfig = null; + this.markers = null; + this.currentMarker = null; + } + +}); + +module.exports = BaseSound; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArrayUtils = __webpack_require__(178); +var Class = __webpack_require__(0); +var NOOP = __webpack_require__(1); +var StableSort = __webpack_require__(127); + +/** + * @callback EachListCallback + * + * @param {I} item - The item which is currently being processed. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + */ + +/** + * @classdesc + * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. + * + * @class List + * @memberof Phaser.Structs + * @constructor + * @since 3.0.0 + * + * @generic T + * + * @param {*} parent - The parent of this list. + */ +var List = new Class({ + + initialize: + + function List (parent) + { + /** + * The parent of this list. + * + * @name Phaser.Structs.List#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The objects that belong to this collection. + * + * @genericUse {T[]} - [$type] + * + * @name Phaser.Structs.List#list + * @type {Array.<*>} + * @default [] + * @since 3.0.0 + */ + this.list = []; + + /** + * The index of the current element. + * + * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. + * + * @name Phaser.Structs.List#position + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.position = 0; + + /** + * A callback that is invoked every time a child is added to this list. + * + * @name Phaser.Structs.List#addCallback + * @type {function} + * @since 3.4.0 + */ + this.addCallback = NOOP; + + /** + * A callback that is invoked every time a child is removed from this list. + * + * @name Phaser.Structs.List#removeCallback + * @type {function} + * @since 3.4.0 + */ + this.removeCallback = NOOP; + + /** + * The property key to sort by. + * + * @name Phaser.Structs.List#_sortKey + * @type {string} + * @since 3.4.0 + */ + this._sortKey = ''; + }, + + /** + * Adds the given item to the end of the list. Each item must be unique. + * + * @method Phaser.Structs.List#add + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*|Array.<*>} child - The item, or array of items, to add to the list. + * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. + * + * @return {*} The list's underlying array. + */ + add: function (child, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.Add(this.list, child); + } + else + { + return ArrayUtils.Add(this.list, child, 0, this.addCallback, this); + } + }, + + /** + * Adds an item to list, starting at a specified index. Each item must be unique within the list. + * + * @method Phaser.Structs.List#addAt + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item, or array of items, to add to the list. + * @param {integer} [index=0] - The index in the list at which the element(s) will be inserted. + * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. + * + * @return {*} The List's underlying array. + */ + addAt: function (child, index, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.AddAt(this.list, child, index); + } + else + { + return ArrayUtils.AddAt(this.list, child, index, 0, this.addCallback, this); + } + }, + + /** + * Retrieves the item at a given position inside the List. + * + * @method Phaser.Structs.List#getAt + * @since 3.0.0 + * + * @genericUse {T} - [$return] + * + * @param {integer} index - The index of the item. + * + * @return {*} The retrieved item, or `undefined` if it's outside the List's bounds. + */ + getAt: function (index) + { + return this.list[index]; + }, + + /** + * Locates an item within the List and returns its index. + * + * @method Phaser.Structs.List#getIndex + * @since 3.0.0 + * + * @genericUse {T} - [child] + * + * @param {*} child - The item to locate. + * + * @return {integer} The index of the item within the List, or -1 if it's not in the List. + */ + getIndex: function (child) + { + // Return -1 if given child isn't a child of this display list + return this.list.indexOf(child); + }, + + /** + * Sort the contents of this List so the items are in order based on the given property. + * For example, `sort('alpha')` would sort the List contents based on the value of their `alpha` property. + * + * @method Phaser.Structs.List#sort + * @since 3.0.0 + * + * @genericUse {T[]} - [children,$return] + * + * @param {string} property - The property to lexically sort by. + * @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean. + * + * @return {Phaser.Structs.List} This List object. + */ + sort: function (property, handler) + { + if (!property) + { + return this; + } + + if (handler === undefined) + { + handler = function (childA, childB) + { + return childA[property] - childB[property]; + }; + } + + StableSort.inplace(this.list, handler); + + return this; + }, + + /** + * Searches for the first instance of a child with its `name` + * property matching the given argument. Should more than one child have + * the same name only the first is returned. + * + * @method Phaser.Structs.List#getByName + * @since 3.0.0 + * + * @genericUse {T | null} - [$return] + * + * @param {string} name - The name to search for. + * + * @return {?*} The first child with a matching name, or null if none were found. + */ + getByName: function (name) + { + return ArrayUtils.GetFirst(this.list, 'name', name); + }, + + /** + * Returns a random child from the group. + * + * @method Phaser.Structs.List#getRandom + * @since 3.0.0 + * + * @genericUse {T | null} - [$return] + * + * @param {integer} [startIndex=0] - Offset from the front of the group (lowest child). + * @param {integer} [length=(to top)] - Restriction on the number of values you want to randomly select from. + * + * @return {?*} A random child of this Group. + */ + getRandom: function (startIndex, length) + { + return ArrayUtils.GetRandom(this.list, startIndex, length); + }, + + /** + * Returns the first element in a given part of the List which matches a specific criterion. + * + * @method Phaser.Structs.List#getFirst + * @since 3.0.0 + * + * @genericUse {T | null} - [$return] + * + * @param {string} property - The name of the property to test or a falsey value to have no criterion. + * @param {*} value - The value to test the `property` against, or `undefined` to allow any value and only check for existence. + * @param {number} [startIndex=0] - The position in the List to start the search at. + * @param {number} [endIndex] - The position in the List to optionally stop the search at. It won't be checked. + * + * @return {?*} The first item which matches the given criterion, or `null` if no such item exists. + */ + getFirst: function (property, value, startIndex, endIndex) + { + return ArrayUtils.GetFirst(this.list, property, value, startIndex, endIndex); + }, + + /** + * Returns all children in this List. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('parent')` would return only children that have a property called `parent`. + * + * You can also specify a value to compare the property to: + * + * `getAll('visible', true)` would return only children that have their visible property set to `true`. + * + * Optionally you can specify a start and end index. For example if this List had 100 children, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 children in the List. + * + * @method Phaser.Structs.List#getAll + * @since 3.0.0 + * + * @genericUse {T} - [value] + * @genericUse {T[]} - [$return] + * + * @param {string} [property] - An optional property to test against the value argument. + * @param {*} [value] - If property is set then Child.property must strictly equal this value to be included in the results. + * @param {integer} [startIndex] - The first child index to start the search from. + * @param {integer} [endIndex] - The last child index to search up until. + * + * @return {Array.<*>} All items of the List which match the given criterion, if any. + */ + getAll: function (property, value, startIndex, endIndex) + { + return ArrayUtils.GetAll(this.list, property, value, startIndex, endIndex); + }, + + /** + * Returns the total number of items in the List which have a property matching the given value. + * + * @method Phaser.Structs.List#count + * @since 3.0.0 + * + * @genericUse {T} - [value] + * + * @param {string} property - The property to test on each item. + * @param {*} value - The value to test the property against. + * + * @return {integer} The total number of matching elements. + */ + count: function (property, value) + { + return ArrayUtils.CountAllMatching(this.list, property, value); + }, + + /** + * Swaps the positions of two items in the list. + * + * @method Phaser.Structs.List#swap + * @since 3.0.0 + * + * @genericUse {T} - [child1,child2] + * + * @param {*} child1 - The first item to swap. + * @param {*} child2 - The second item to swap. + */ + swap: function (child1, child2) + { + ArrayUtils.Swap(this.list, child1, child2); + }, + + /** + * Moves an item in the List to a new position. + * + * @method Phaser.Structs.List#moveTo + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to move. + * @param {integer} index - Moves an item in the List to a new position. + * + * @return {*} The item that was moved. + */ + moveTo: function (child, index) + { + return ArrayUtils.MoveTo(this.list, child, index); + }, + + /** + * Removes one or many items from the List. + * + * @method Phaser.Structs.List#remove + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item, or array of items, to remove. + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {*} The item, or array of items, which were successfully removed from the List. + */ + remove: function (child, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.Remove(this.list, child); + } + else + { + return ArrayUtils.Remove(this.list, child, this.removeCallback, this); + } + }, + + /** + * Removes the item at the given position in the List. + * + * @method Phaser.Structs.List#removeAt + * @since 3.0.0 + * + * @genericUse {T} - [$return] + * + * @param {integer} index - The position to remove the item from. + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {*} The item that was removed. + */ + removeAt: function (index, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.RemoveAt(this.list, index); + } + else + { + return ArrayUtils.RemoveAt(this.list, index, this.removeCallback, this); + } + }, + + /** + * Removes the items within the given range in the List. + * + * @method Phaser.Structs.List#removeBetween + * @since 3.0.0 + * + * @genericUse {T[]} - [$return] + * + * @param {integer} [startIndex=0] - The index to start removing from. + * @param {integer} [endIndex] - The position to stop removing at. The item at this position won't be removed. + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {Array.<*>} An array of the items which were removed. + */ + removeBetween: function (startIndex, endIndex, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex); + } + else + { + return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex, this.removeCallback, this); + } + }, + + /** + * Removes all the items. + * + * @method Phaser.Structs.List#removeAll + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.List.} - [$return] + * + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {Phaser.Structs.List} This List object. + */ + removeAll: function (skipCallback) + { + var i = this.list.length; + + while (i--) + { + this.remove(this.list[i], skipCallback); + } + + return this; + }, + + /** + * Brings the given child to the top of this List. + * + * @method Phaser.Structs.List#bringToTop + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to bring to the top of the List. + * + * @return {*} The item which was moved. + */ + bringToTop: function (child) + { + return ArrayUtils.BringToTop(this.list, child); + }, + + /** + * Sends the given child to the bottom of this List. + * + * @method Phaser.Structs.List#sendToBack + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to send to the back of the list. + * + * @return {*} The item which was moved. + */ + sendToBack: function (child) + { + return ArrayUtils.SendToBack(this.list, child); + }, + + /** + * Moves the given child up one place in this group unless it's already at the top. + * + * @method Phaser.Structs.List#moveUp + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to move up. + * + * @return {*} The item which was moved. + */ + moveUp: function (child) + { + ArrayUtils.MoveUp(this.list, child); + + return child; + }, + + /** + * Moves the given child down one place in this group unless it's already at the bottom. + * + * @method Phaser.Structs.List#moveDown + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to move down. + * + * @return {*} The item which was moved. + */ + moveDown: function (child) + { + ArrayUtils.MoveDown(this.list, child); + + return child; + }, + + /** + * Reverses the order of all children in this List. + * + * @method Phaser.Structs.List#reverse + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.List.} - [$return] + * + * @return {Phaser.Structs.List} This List object. + */ + reverse: function () + { + this.list.reverse(); + + return this; + }, + + /** + * Shuffles the items in the list. + * + * @method Phaser.Structs.List#shuffle + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.List.} - [$return] + * + * @return {Phaser.Structs.List} This List object. + */ + shuffle: function () + { + ArrayUtils.Shuffle(this.list); + + return this; + }, + + /** + * Replaces a child of this List with the given newChild. The newChild cannot be a member of this List. + * + * @method Phaser.Structs.List#replace + * @since 3.0.0 + * + * @genericUse {T} - [oldChild,newChild,$return] + * + * @param {*} oldChild - The child in this List that will be replaced. + * @param {*} newChild - The child to be inserted into this List. + * + * @return {*} Returns the oldChild that was replaced within this group. + */ + replace: function (oldChild, newChild) + { + return ArrayUtils.Replace(this.list, oldChild, newChild); + }, + + /** + * Checks if an item exists within the List. + * + * @method Phaser.Structs.List#exists + * @since 3.0.0 + * + * @genericUse {T} - [child] + * + * @param {*} child - The item to check for the existence of. + * + * @return {boolean} `true` if the item is found in the list, otherwise `false`. + */ + exists: function (child) + { + return (this.list.indexOf(child) > -1); + }, + + /** + * Sets the property `key` to the given value on all members of this List. + * + * @method Phaser.Structs.List#setAll + * @since 3.0.0 + * + * @genericUse {T} - [value] + * + * @param {string} property - The name of the property to set. + * @param {*} value - The value to set the property to. + * @param {integer} [startIndex] - The first child index to start the search from. + * @param {integer} [endIndex] - The last child index to search up until. + */ + setAll: function (property, value, startIndex, endIndex) + { + ArrayUtils.SetAll(this.list, property, value, startIndex, endIndex); + + return this; + }, + + /** + * Passes all children to the given callback. + * + * @method Phaser.Structs.List#each + * @since 3.0.0 + * + * @genericUse {EachListCallback.} - [callback] + * + * @param {EachListCallback} callback - The function to call. + * @param {*} [context] - Value to use as `this` when executing callback. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + */ + each: function (callback, context) + { + var args = [ null ]; + + for (var i = 2; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = 0; i < this.list.length; i++) + { + args[0] = this.list[i]; + + callback.apply(context, args); + } + }, + + /** + * Clears the List and recreates its internal array. + * + * @method Phaser.Structs.List#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + this.removeAll(); + + this.list = []; + }, + + /** + * Destroys this List. + * + * @method Phaser.Structs.List#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.removeAll(); + + this.parent = null; + this.addCallback = null; + this.removeCallback = null; + }, + + /** + * The number of items inside the List. + * + * @name Phaser.Structs.List#length + * @type {integer} + * @readonly + * @since 3.0.0 + */ + length: { + + get: function () + { + return this.list.length; + } + + }, + + /** + * The first item in the List or `null` for an empty List. + * + * @name Phaser.Structs.List#first + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + first: { + + get: function () + { + this.position = 0; + + if (this.list.length > 0) + { + return this.list[0]; + } + else + { + return null; + } + } + + }, + + /** + * The last item in the List, or `null` for an empty List. + * + * @name Phaser.Structs.List#last + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + last: { + + get: function () + { + if (this.list.length > 0) + { + this.position = this.list.length - 1; + + return this.list[this.position]; + } + else + { + return null; + } + } + + }, + + /** + * The next item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. + * + * @name Phaser.Structs.List#next + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + next: { + + get: function () + { + if (this.position < this.list.length) + { + this.position++; + + return this.list[this.position]; + } + else + { + return null; + } + } + + }, + + /** + * The previous item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. + * + * @name Phaser.Structs.List#previous + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + previous: { + + get: function () + { + if (this.position > 0) + { + this.position--; + + return this.list[this.position]; + } + else + { + return null; + } + } + + } + +}); + +module.exports = List; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CheckMatrix = __webpack_require__(179); +var TransposeMatrix = __webpack_require__(360); + +/** + * Rotates the array matrix based on the given rotation value. + * + * The value can be given in degrees: 90, -90, 270, -270 or 180, + * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. + * + * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. + * + * @function Phaser.Utils.Array.Matrix.RotateMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * @param {(number|string)} [direction=90] - The amount to rotate the matrix by. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateMatrix = function (matrix, direction) +{ + if (direction === undefined) { direction = 90; } + + if (!CheckMatrix(matrix)) + { + return null; + } + + if (typeof direction !== 'string') + { + direction = ((direction % 360) + 360) % 360; + } + + if (direction === 90 || direction === -270 || direction === 'rotateLeft') + { + matrix = TransposeMatrix(matrix); + matrix.reverse(); + } + else if (direction === -90 || direction === 270 || direction === 'rotateRight') + { + matrix.reverse(); + matrix = TransposeMatrix(matrix); + } + else if (Math.abs(direction) === 180 || direction === 'rotate180') + { + for (var i = 0; i < matrix.length; i++) + { + matrix[i].reverse(); + } + + matrix.reverse(); + } + + return matrix; +}; + +module.exports = RotateMatrix; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +//! stable.js 0.1.6, https://github.com/Two-Screen/stable +//! © 2017 Angry Bytes and contributors. MIT licensed. + +/** + * @namespace Phaser.Utils.Array.StableSortFunctions + */ + +(function() { + + /** + * A stable array sort, because `Array#sort()` is not guaranteed stable. + * This is an implementation of merge sort, without recursion. + * + * @function Phaser.Utils.Array.StableSort + * @since 3.0.0 + * + * @param {array} arr - The input array to be sorted. + * @param {function} comp - The comparison handler. + * + * @return {array} The sorted result. + */ +var stable = function(arr, comp) { + return exec(arr.slice(), comp); +}; + + /** + * Sort the input array and simply copy it back if the result isn't in the original array, which happens on an odd number of passes. + * + * @function Phaser.Utils.Array.StableSortFunctions.inplace + * @memberof Phaser.Utils.Array.StableSortFunctions + * @since 3.0.0 + * + * @param {array} arr - The input array. + * @param {function} comp - The comparison handler. + * + * @return {array} The sorted array. + */ +stable.inplace = function(arr, comp) { + var result = exec(arr, comp); + + // This simply copies back if the result isn't in the original array, + // which happens on an odd number of passes. + if (result !== arr) { + pass(result, null, arr.length, arr); + } + + return arr; +}; + +// Execute the sort using the input array and a second buffer as work space. +// Returns one of those two, containing the final result. +function exec(arr, comp) { + if (typeof(comp) !== 'function') { + comp = function(a, b) { + return String(a).localeCompare(b); + }; + } + + // Short-circuit when there's nothing to sort. + var len = arr.length; + if (len <= 1) { + return arr; + } + + // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. + // Chunks are the size of the left or right hand in merge sort. + // Stop when the left-hand covers all of the array. + var buffer = new Array(len); + for (var chk = 1; chk < len; chk *= 2) { + pass(arr, comp, chk, buffer); + + var tmp = arr; + arr = buffer; + buffer = tmp; + } + + return arr; +} + +// Run a single pass with the given chunk size. +var pass = function(arr, comp, chk, result) { + var len = arr.length; + var i = 0; + // Step size / double chunk size. + var dbl = chk * 2; + // Bounds of the left and right chunks. + var l, r, e; + // Iterators over the left and right chunk. + var li, ri; + + // Iterate over pairs of chunks. + for (l = 0; l < len; l += dbl) { + r = l + chk; + e = r + chk; + if (r > len) r = len; + if (e > len) e = len; + + // Iterate both chunks in parallel. + li = l; + ri = r; + while (true) { + // Compare the chunks. + if (li < r && ri < e) { + // This works for a regular `sort()` compatible comparator, + // but also for a simple comparator like: `a > b` + if (comp(arr[li], arr[ri]) <= 0) { + result[i++] = arr[li++]; + } + else { + result[i++] = arr[ri++]; + } + } + // Nothing to compare, just flush what's left. + else if (li < r) { + result[i++] = arr[li++]; + } + else if (ri < e) { + result[i++] = arr[ri++]; + } + // Both iterators are at the chunk ends. + else { + break; + } + } + } +}; + +// Export using CommonJS or to the window. +if (true) { + module.exports = stable; +} +else {} + +})(); + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var GameObject = __webpack_require__(13); +var GetBitmapTextSize = __webpack_require__(904); +var ParseFromAtlas = __webpack_require__(905); +var ParseXMLBitmapFont = __webpack_require__(181); +var Render = __webpack_require__(906); + +/** + * @classdesc + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} + * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} + * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} + * + * @class BitmapText + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. + * @param {number} x - The x coordinate of this Game Object in world space. + * @param {number} y - The y coordinate of this Game Object in world space. + * @param {string} font - The key of the font to use from the Bitmap Font cache. + * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. + * @param {number} [size] - The font size of this Bitmap Text. + * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + */ +var BitmapText = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.Depth, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Texture, + Components.Tint, + Components.Transform, + Components.Visible, + Render + ], + + initialize: + + function BitmapText (scene, x, y, font, text, size, align) + { + if (text === undefined) { text = ''; } + if (align === undefined) { align = 0; } + + GameObject.call(this, scene, 'BitmapText'); + + /** + * The key of the Bitmap Font used by this Bitmap Text. + * To change the font after creation please use `setFont`. + * + * @name Phaser.GameObjects.BitmapText#font + * @type {string} + * @readonly + * @since 3.0.0 + */ + this.font = font; + + var entry = this.scene.sys.cache.bitmapFont.get(font); + + /** + * The data of the Bitmap Font used by this Bitmap Text. + * + * @name Phaser.GameObjects.BitmapText#fontData + * @type {Phaser.Types.GameObjects.BitmapText.BitmapFontData} + * @readonly + * @since 3.0.0 + */ + this.fontData = entry.data; + + /** + * The text that this Bitmap Text object displays. + * + * @name Phaser.GameObjects.BitmapText#_text + * @type {string} + * @private + * @since 3.0.0 + */ + this._text = ''; + + /** + * The font size of this Bitmap Text. + * + * @name Phaser.GameObjects.BitmapText#_fontSize + * @type {number} + * @private + * @since 3.0.0 + */ + this._fontSize = size || this.fontData.size; + + /** + * Adds / Removes spacing between characters. + * + * Can be a negative or positive number. + * + * @name Phaser.GameObjects.BitmapText#_letterSpacing + * @type {number} + * @private + * @since 3.4.0 + */ + this._letterSpacing = 0; + + /** + * Controls the alignment of each line of text in this BitmapText object. + * Only has any effect when this BitmapText contains multiple lines of text, split with carriage-returns. + * Has no effect with single-lines of text. + * + * See the methods `setLeftAlign`, `setCenterAlign` and `setRightAlign`. + * + * 0 = Left aligned (default) + * 1 = Middle aligned + * 2 = Right aligned + * + * The alignment position is based on the longest line of text. + * + * @name Phaser.GameObjects.BitmapText#_align + * @type {integer} + * @private + * @since 3.11.0 + */ + this._align = align; + + /** + * An object that describes the size of this Bitmap Text. + * + * @name Phaser.GameObjects.BitmapText#_bounds + * @type {Phaser.Types.GameObjects.BitmapText.BitmapTextSize} + * @private + * @since 3.0.0 + */ + this._bounds = GetBitmapTextSize(this, false, this._bounds); + + /** + * An internal dirty flag for bounds calculation. + * + * @name Phaser.GameObjects.BitmapText#_dirty + * @type {boolean} + * @private + * @since 3.11.0 + */ + this._dirty = false; + + this.setTexture(entry.texture, entry.frame); + this.setPosition(x, y); + this.setOrigin(0, 0); + this.initPipeline(); + + this.setText(text); + }, + + /** + * Set the lines of text in this BitmapText to be left-aligned. + * This only has any effect if this BitmapText contains more than one line of text. + * + * @method Phaser.GameObjects.BitmapText#setLeftAlign + * @since 3.11.0 + * + * @return {this} This BitmapText Object. + */ + setLeftAlign: function () + { + this._align = BitmapText.ALIGN_LEFT; + + this._dirty = true; + + return this; + }, + + /** + * Set the lines of text in this BitmapText to be center-aligned. + * This only has any effect if this BitmapText contains more than one line of text. + * + * @method Phaser.GameObjects.BitmapText#setCenterAlign + * @since 3.11.0 + * + * @return {this} This BitmapText Object. + */ + setCenterAlign: function () + { + this._align = BitmapText.ALIGN_CENTER; + + this._dirty = true; + + return this; + }, + + /** + * Set the lines of text in this BitmapText to be right-aligned. + * This only has any effect if this BitmapText contains more than one line of text. + * + * @method Phaser.GameObjects.BitmapText#setRightAlign + * @since 3.11.0 + * + * @return {this} This BitmapText Object. + */ + setRightAlign: function () + { + this._align = BitmapText.ALIGN_RIGHT; + + this._dirty = true; + + return this; + }, + + /** + * Set the font size of this Bitmap Text. + * + * @method Phaser.GameObjects.BitmapText#setFontSize + * @since 3.0.0 + * + * @param {number} size - The font size to set. + * + * @return {this} This BitmapText Object. + */ + setFontSize: function (size) + { + this._fontSize = size; + + this._dirty = true; + + return this; + }, + + /** + * Sets the letter spacing between each character of this Bitmap Text. + * Can be a positive value to increase the space, or negative to reduce it. + * Spacing is applied after the kerning values have been set. + * + * @method Phaser.GameObjects.BitmapText#setLetterSpacing + * @since 3.4.0 + * + * @param {number} [spacing=0] - The amount of horizontal space to add between each character. + * + * @return {this} This BitmapText Object. + */ + setLetterSpacing: function (spacing) + { + if (spacing === undefined) { spacing = 0; } + + this._letterSpacing = spacing; + + this._dirty = true; + + return this; + }, + + /** + * Set the textual content of this BitmapText. + * + * An array of strings will be converted into multi-line text. Use the align methods to change multi-line alignment. + * + * @method Phaser.GameObjects.BitmapText#setText + * @since 3.0.0 + * + * @param {(string|string[])} value - The string, or array of strings, to be set as the content of this BitmapText. + * + * @return {this} This BitmapText Object. + */ + setText: function (value) + { + if (!value && value !== 0) + { + value = ''; + } + + if (Array.isArray(value)) + { + value = value.join('\n'); + } + + if (value !== this.text) + { + this._text = value.toString(); + + this._dirty = true; + + this.updateDisplayOrigin(); + } + + return this; + }, + + /** + * Calculate the bounds of this Bitmap Text. + * + * An object is returned that contains the position, width and height of the Bitmap Text in local and global + * contexts. + * + * Local size is based on just the font size and a [0, 0] position. + * + * Global size takes into account the Game Object's scale, world position and display origin. + * + * Also in the object is data regarding the length of each line, should this be a multi-line BitmapText. + * + * @method Phaser.GameObjects.BitmapText#getTextBounds + * @since 3.0.0 + * + * @param {boolean} [round] - Whether to round the results to the nearest integer. + * + * @return {Phaser.Types.GameObjects.BitmapText.BitmapTextSize} An object that describes the size of this Bitmap Text. + */ + getTextBounds: function (round) + { + // local = The BitmapText based on fontSize and 0x0 coords + // global = The BitmapText, taking into account scale and world position + // lines = The BitmapText line data + + if (this._dirty) + { + GetBitmapTextSize(this, round, this._bounds); + } + + return this._bounds; + }, + + /** + * Changes the font this BitmapText is using to render. + * + * The new texture is loaded and applied to the BitmapText. The existing test, size and alignment are preserved, + * unless overridden via the arguments. + * + * @method Phaser.GameObjects.BitmapText#setFont + * @since 3.11.0 + * + * @param {string} font - The key of the font to use from the Bitmap Font cache. + * @param {number} [size] - The font size of this Bitmap Text. If not specified the current size will be used. + * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used. + * + * @return {this} This BitmapText Object. + */ + setFont: function (key, size, align) + { + if (size === undefined) { size = this._fontSize; } + if (align === undefined) { align = this._align; } + + if (key !== this.font) + { + var entry = this.scene.sys.cache.bitmapFont.get(key); + + if (entry) + { + this.font = key; + this.fontData = entry.data; + this._fontSize = size; + this._align = align; + + this.setTexture(entry.texture, entry.frame); + + GetBitmapTextSize(this, false, this._bounds); + } + } + + return this; + }, + + /** + * Controls the alignment of each line of text in this BitmapText object. + * + * Only has any effect when this BitmapText contains multiple lines of text, split with carriage-returns. + * Has no effect with single-lines of text. + * + * See the methods `setLeftAlign`, `setCenterAlign` and `setRightAlign`. + * + * 0 = Left aligned (default) + * 1 = Middle aligned + * 2 = Right aligned + * + * The alignment position is based on the longest line of text. + * + * @name Phaser.GameObjects.BitmapText#align + * @type {integer} + * @since 3.11.0 + */ + align: { + + set: function (value) + { + this._align = value; + this._dirty = true; + }, + + get: function () + { + return this._align; + } + + }, + + /** + * The text that this Bitmap Text object displays. + * + * You can also use the method `setText` if you want a chainable way to change the text content. + * + * @name Phaser.GameObjects.BitmapText#text + * @type {string} + * @since 3.0.0 + */ + text: { + + set: function (value) + { + this.setText(value); + }, + + get: function () + { + return this._text; + } + + }, + + /** + * The font size of this Bitmap Text. + * + * You can also use the method `setFontSize` if you want a chainable way to change the font size. + * + * @name Phaser.GameObjects.BitmapText#fontSize + * @type {number} + * @since 3.0.0 + */ + fontSize: { + + set: function (value) + { + this._fontSize = value; + this._dirty = true; + }, + + get: function () + { + return this._fontSize; + } + + }, + + /** + * Adds / Removes spacing between characters. + * + * Can be a negative or positive number. + * + * You can also use the method `setLetterSpacing` if you want a chainable way to change the letter spacing. + * + * @name Phaser.GameObjects.BitmapText#letterSpacing + * @type {number} + * @since 3.0.0 + */ + letterSpacing: { + + set: function (value) + { + this._letterSpacing = value; + this._dirty = true; + }, + + get: function () + { + return this._letterSpacing; + } + + }, + + /** + * The width of this Bitmap Text. + * + * @name Phaser.GameObjects.BitmapText#width + * @type {number} + * @readonly + * @since 3.0.0 + */ + width: { + + get: function () + { + this.getTextBounds(false); + + return this._bounds.global.width; + } + + }, + + /** + * The height of this bitmap text. + * + * @name Phaser.GameObjects.BitmapText#height + * @type {number} + * @readonly + * @since 3.0.0 + */ + height: { + + get: function () + { + this.getTextBounds(false); + + return this._bounds.global.height; + } + + }, + + /** + * Build a JSON representation of this Bitmap Text. + * + * @method Phaser.GameObjects.BitmapText#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.BitmapText.JSONBitmapText} A JSON representation of this Bitmap Text. + */ + toJSON: function () + { + var out = Components.ToJSON(this); + + // Extra data is added here + + var data = { + font: this.font, + text: this.text, + fontSize: this.fontSize, + letterSpacing: this.letterSpacing, + align: this.align + }; + + out.data = data; + + return out; + } + +}); + +/** + * Left align the text characters in a multi-line BitmapText object. + * + * @name Phaser.GameObjects.BitmapText.ALIGN_LEFT + * @type {integer} + * @since 3.11.0 + */ +BitmapText.ALIGN_LEFT = 0; + +/** + * Center align the text characters in a multi-line BitmapText object. + * + * @name Phaser.GameObjects.BitmapText.ALIGN_CENTER + * @type {integer} + * @since 3.11.0 + */ +BitmapText.ALIGN_CENTER = 1; + +/** + * Right align the text characters in a multi-line BitmapText object. + * + * @name Phaser.GameObjects.BitmapText.ALIGN_RIGHT + * @type {integer} + * @since 3.11.0 + */ +BitmapText.ALIGN_RIGHT = 2; + +/** + * Parse an XML Bitmap Font from an Atlas. + * + * Adds the parsed Bitmap Font data to the cache with the `fontName` key. + * + * @name Phaser.GameObjects.BitmapText.ParseFromAtlas + * @type {function} + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to parse the Bitmap Font for. + * @param {string} fontName - The key of the font to add to the Bitmap Font cache. + * @param {string} textureKey - The key of the BitmapFont's texture. + * @param {string} frameKey - The key of the BitmapFont texture's frame. + * @param {string} xmlKey - The key of the XML data of the font to parse. + * @param {integer} [xSpacing] - The x-axis spacing to add between each letter. + * @param {integer} [ySpacing] - The y-axis spacing to add to the line height. + * + * @return {boolean} Whether the parsing was successful or not. + */ +BitmapText.ParseFromAtlas = ParseFromAtlas; + +/** + * Parse an XML font to Bitmap Font data for the Bitmap Font cache. + * + * @name Phaser.GameObjects.BitmapText.ParseXMLBitmapFont + * @type {function} + * @since 3.17.0 + * + * @param {XMLDocument} xml - The XML Document to parse the font from. + * @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter. + * @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height. + * @param {Phaser.Textures.Frame} [frame] - The texture frame to take into account while parsing. + * + * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} The parsed Bitmap Font data. + */ +BitmapText.ParseXMLBitmapFont = ParseXMLBitmapFont; + +module.exports = BitmapText; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var GameObject = __webpack_require__(13); +var MeshRender = __webpack_require__(1026); +var NOOP = __webpack_require__(1); + +/** + * @classdesc + * A Mesh Game Object. + * + * @class Mesh + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @webglOnly + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * @extends Phaser.GameObjects.Components.ScrollFactor + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {number[]} vertices - An array containing the vertices data for this Mesh. + * @param {number[]} uv - An array containing the uv data for this Mesh. + * @param {number[]} colors - An array containing the color data for this Mesh. + * @param {number[]} alphas - An array containing the alpha data for this Mesh. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + */ +var Mesh = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.BlendMode, + Components.Depth, + Components.GetBounds, + Components.Mask, + Components.Pipeline, + Components.Size, + Components.Texture, + Components.Transform, + Components.Visible, + Components.ScrollFactor, + MeshRender + ], + + initialize: + + function Mesh (scene, x, y, vertices, uv, colors, alphas, texture, frame) + { + GameObject.call(this, scene, 'Mesh'); + + if (vertices.length !== uv.length) + { + throw new Error('Mesh Vertex count must match UV count'); + } + + var verticesUB = (vertices.length / 2) | 0; + + if (colors.length > 0 && colors.length < verticesUB) + { + throw new Error('Mesh Color count must match Vertex count'); + } + + if (alphas.length > 0 && alphas.length < verticesUB) + { + throw new Error('Mesh Alpha count must match Vertex count'); + } + + var i; + + if (colors.length === 0) + { + for (i = 0; i < verticesUB; ++i) + { + colors[i] = 0xFFFFFF; + } + } + + if (alphas.length === 0) + { + for (i = 0; i < verticesUB; ++i) + { + alphas[i] = 1.0; + } + } + + /** + * An array containing the vertices data for this Mesh. + * + * @name Phaser.GameObjects.Mesh#vertices + * @type {Float32Array} + * @since 3.0.0 + */ + this.vertices = new Float32Array(vertices); + + /** + * An array containing the uv data for this Mesh. + * + * @name Phaser.GameObjects.Mesh#uv + * @type {Float32Array} + * @since 3.0.0 + */ + this.uv = new Float32Array(uv); + + /** + * An array containing the color data for this Mesh. + * + * @name Phaser.GameObjects.Mesh#colors + * @type {Uint32Array} + * @since 3.0.0 + */ + this.colors = new Uint32Array(colors); + + /** + * An array containing the alpha data for this Mesh. + * + * @name Phaser.GameObjects.Mesh#alphas + * @type {Float32Array} + * @since 3.0.0 + */ + this.alphas = new Float32Array(alphas); + + /** + * Fill or additive mode used when blending the color values? + * + * @name Phaser.GameObjects.Mesh#tintFill + * @type {boolean} + * @default false + * @since 3.11.0 + */ + this.tintFill = false; + + this.setTexture(texture, frame); + this.setPosition(x, y); + this.setSizeToFrame(); + this.initPipeline(); + }, + + /** + * This method is left intentionally empty and does not do anything. + * It is retained to allow a Mesh or Quad to be added to a Container. + * + * @method Phaser.GameObjects.Mesh#setAlpha + * @since 3.17.0 + */ + setAlpha: NOOP + +}); + +module.exports = Mesh; + + +/***/ }), +/* 130 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if two Rectangles intersect. + * + * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle. + * + * @function Phaser.Geom.Intersects.RectangleToRectangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to check for intersection. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to check for intersection. + * + * @return {boolean} `true` if the two Rectangles intersect, otherwise `false`. + */ +var RectangleToRectangle = function (rectA, rectB) +{ + if (rectA.width <= 0 || rectA.height <= 0 || rectB.width <= 0 || rectB.height <= 0) + { + return false; + } + + return !(rectA.right < rectB.x || rectA.bottom < rectB.y || rectA.x > rectB.right || rectA.y > rectB.bottom); +}; + +module.exports = RectangleToRectangle; + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetValue = __webpack_require__(6); + +// Contains the plugins that Phaser uses globally and locally. +// These are the source objects, not instantiated. +var inputPlugins = {}; + +/** + * @namespace Phaser.Input.InputPluginCache + */ + +var InputPluginCache = {}; + +/** + * Static method called directly by the Core internal Plugins. + * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) + * Plugin is the object to instantiate to create the plugin + * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) + * + * @name Phaser.Input.InputPluginCache.register + * @type {function} + * @static + * @since 3.10.0 + * + * @param {string} key - A reference used to get this plugin from the plugin cache. + * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. + * @param {string} mapping - If this plugin is to be injected into the Input Plugin, this is the property key used. + * @param {string} settingsKey - The key in the Scene Settings to check to see if this plugin should install or not. + * @param {string} configKey - The key in the Game Config to check to see if this plugin should install or not. + */ +InputPluginCache.register = function (key, plugin, mapping, settingsKey, configKey) +{ + inputPlugins[key] = { plugin: plugin, mapping: mapping, settingsKey: settingsKey, configKey: configKey }; +}; + +/** + * Returns the input plugin object from the cache based on the given key. + * + * @name Phaser.Input.InputPluginCache.getCore + * @type {function} + * @static + * @since 3.10.0 + * + * @param {string} key - The key of the input plugin to get. + * + * @return {Phaser.Types.Input.InputPluginContainer} The input plugin object. + */ +InputPluginCache.getPlugin = function (key) +{ + return inputPlugins[key]; +}; + +/** + * Installs all of the registered Input Plugins into the given target. + * + * @name Phaser.Input.InputPluginCache.install + * @type {function} + * @static + * @since 3.10.0 + * + * @param {Phaser.Input.InputPlugin} target - The target InputPlugin to install the plugins into. + */ +InputPluginCache.install = function (target) +{ + var sys = target.scene.sys; + var settings = sys.settings.input; + var config = sys.game.config; + + for (var key in inputPlugins) + { + var source = inputPlugins[key].plugin; + var mapping = inputPlugins[key].mapping; + var settingsKey = inputPlugins[key].settingsKey; + var configKey = inputPlugins[key].configKey; + + if (GetValue(settings, settingsKey, config[configKey])) + { + target[mapping] = new source(target); + } + } +}; + +/** + * Removes an input plugin based on the given key. + * + * @name Phaser.Input.InputPluginCache.remove + * @type {function} + * @static + * @since 3.10.0 + * + * @param {string} key - The key of the input plugin to remove. + */ +InputPluginCache.remove = function (key) +{ + if (inputPlugins.hasOwnProperty(key)) + { + delete inputPlugins[key]; + } +}; + +module.exports = InputPluginCache; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Input.Keyboard.Events + */ + +module.exports = { + + ANY_KEY_DOWN: __webpack_require__(1164), + ANY_KEY_UP: __webpack_require__(1165), + COMBO_MATCH: __webpack_require__(1166), + DOWN: __webpack_require__(1167), + KEY_DOWN: __webpack_require__(1168), + KEY_UP: __webpack_require__(1169), + UP: __webpack_require__(1170) + +}; + + +/***/ }), +/* 133 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Creates an XHRSettings Object with default values. + * + * @function Phaser.Loader.XHRSettings + * @since 3.0.0 + * + * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. + * @param {boolean} [async=true] - Should the XHR request use async or not? + * @param {string} [user=''] - Optional username for the XHR request. + * @param {string} [password=''] - Optional password for the XHR request. + * @param {integer} [timeout=0] - Optional XHR timeout value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + + // Before sending a request, set the xhr.responseType to "text", + // "arraybuffer", "blob", or "document", depending on your data needs. + // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". + + return { + + // Ignored by the Loader, only used by File. + responseType: responseType, + + async: async, + + // credentials + user: user, + password: password, + + // timeout in ms (0 = no timeout) + timeout: timeout, + + // setRequestHeader + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(207); +var Sprite = __webpack_require__(67); + +/** + * @classdesc + * An Arcade Physics Sprite is a Sprite with an Arcade Physics body and related components. + * The body can be dynamic or static. + * + * The main difference between an Arcade Sprite and an Arcade Image is that you cannot animate an Arcade Image. + * If you do not require animation then you can safely use Arcade Images instead of Arcade Sprites. + * + * @class Sprite + * @extends Phaser.GameObjects.Sprite + * @memberof Phaser.Physics.Arcade + * @constructor + * @since 3.0.0 + * + * @extends Phaser.Physics.Arcade.Components.Acceleration + * @extends Phaser.Physics.Arcade.Components.Angular + * @extends Phaser.Physics.Arcade.Components.Bounce + * @extends Phaser.Physics.Arcade.Components.Debug + * @extends Phaser.Physics.Arcade.Components.Drag + * @extends Phaser.Physics.Arcade.Components.Enable + * @extends Phaser.Physics.Arcade.Components.Friction + * @extends Phaser.Physics.Arcade.Components.Gravity + * @extends Phaser.Physics.Arcade.Components.Immovable + * @extends Phaser.Physics.Arcade.Components.Mass + * @extends Phaser.Physics.Arcade.Components.Size + * @extends Phaser.Physics.Arcade.Components.Velocity + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + */ +var ArcadeSprite = new Class({ + + Extends: Sprite, + + Mixins: [ + Components.Acceleration, + Components.Angular, + Components.Bounce, + Components.Debug, + Components.Drag, + Components.Enable, + Components.Friction, + Components.Gravity, + Components.Immovable, + Components.Mass, + Components.Size, + Components.Velocity + ], + + initialize: + + function ArcadeSprite (scene, x, y, texture, frame) + { + Sprite.call(this, scene, x, y, texture, frame); + + /** + * This Game Object's Physics Body. + * + * @name Phaser.Physics.Arcade.Sprite#body + * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} + * @default null + * @since 3.0.0 + */ + this.body = null; + } + +}); + +module.exports = ArcadeSprite; + + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Bodies` module contains factory methods for creating rigid body models +* with commonly used body configurations (such as rectangles, circles and other polygons). +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Bodies +*/ + +// TODO: true circle bodies + +var Bodies = {}; + +module.exports = Bodies; + +var Vertices = __webpack_require__(84); +var Common = __webpack_require__(37); +var Body = __webpack_require__(60); +var Bounds = __webpack_require__(100); +var Vector = __webpack_require__(99); +var decomp = __webpack_require__(1328); + +(function() { + + /** + * Creates a new rigid body model with a rectangle hull. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method rectangle + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {object} [options] + * @return {body} A new rectangle body + */ + Bodies.rectangle = function(x, y, width, height, options) { + options = options || {}; + + var rectangle = { + label: 'Rectangle Body', + position: { x: x, y: y }, + vertices: Vertices.fromPath('L 0 0 L ' + width + ' 0 L ' + width + ' ' + height + ' L 0 ' + height) + }; + + if (options.chamfer) { + var chamfer = options.chamfer; + rectangle.vertices = Vertices.chamfer(rectangle.vertices, chamfer.radius, + chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); + delete options.chamfer; + } + + return Body.create(Common.extend({}, rectangle, options)); + }; + + /** + * Creates a new rigid body model with a trapezoid hull. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method trapezoid + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @param {number} slope + * @param {object} [options] + * @return {body} A new trapezoid body + */ + Bodies.trapezoid = function(x, y, width, height, slope, options) { + options = options || {}; + + slope *= 0.5; + var roof = (1 - (slope * 2)) * width; + + var x1 = width * slope, + x2 = x1 + roof, + x3 = x2 + x1, + verticesPath; + + if (slope < 0.5) { + verticesPath = 'L 0 0 L ' + x1 + ' ' + (-height) + ' L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0'; + } else { + verticesPath = 'L 0 0 L ' + x2 + ' ' + (-height) + ' L ' + x3 + ' 0'; + } + + var trapezoid = { + label: 'Trapezoid Body', + position: { x: x, y: y }, + vertices: Vertices.fromPath(verticesPath) + }; + + if (options.chamfer) { + var chamfer = options.chamfer; + trapezoid.vertices = Vertices.chamfer(trapezoid.vertices, chamfer.radius, + chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); + delete options.chamfer; + } + + return Body.create(Common.extend({}, trapezoid, options)); + }; + + /** + * Creates a new rigid body model with a circle hull. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method circle + * @param {number} x + * @param {number} y + * @param {number} radius + * @param {object} [options] + * @param {number} [maxSides] + * @return {body} A new circle body + */ + Bodies.circle = function(x, y, radius, options, maxSides) { + options = options || {}; + + var circle = { + label: 'Circle Body', + circleRadius: radius + }; + + // approximate circles with polygons until true circles implemented in SAT + maxSides = maxSides || 25; + var sides = Math.ceil(Math.max(10, Math.min(maxSides, radius))); + + // optimisation: always use even number of sides (half the number of unique axes) + if (sides % 2 === 1) + sides += 1; + + return Bodies.polygon(x, y, sides, radius, Common.extend({}, circle, options)); + }; + + /** + * Creates a new rigid body model with a regular polygon hull with the given number of sides. + * The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method polygon + * @param {number} x + * @param {number} y + * @param {number} sides + * @param {number} radius + * @param {object} [options] + * @return {body} A new regular polygon body + */ + Bodies.polygon = function(x, y, sides, radius, options) { + options = options || {}; + + if (sides < 3) + return Bodies.circle(x, y, radius, options); + + var theta = 2 * Math.PI / sides, + path = '', + offset = theta * 0.5; + + for (var i = 0; i < sides; i += 1) { + var angle = offset + (i * theta), + xx = Math.cos(angle) * radius, + yy = Math.sin(angle) * radius; + + path += 'L ' + xx.toFixed(3) + ' ' + yy.toFixed(3) + ' '; + } + + var polygon = { + label: 'Polygon Body', + position: { x: x, y: y }, + vertices: Vertices.fromPath(path) + }; + + if (options.chamfer) { + var chamfer = options.chamfer; + polygon.vertices = Vertices.chamfer(polygon.vertices, chamfer.radius, + chamfer.quality, chamfer.qualityMin, chamfer.qualityMax); + delete options.chamfer; + } + + return Body.create(Common.extend({}, polygon, options)); + }; + + /** + * Creates a body using the supplied vertices (or an array containing multiple sets of vertices). + * If the vertices are convex, they will pass through as supplied. + * Otherwise if the vertices are concave, they will be decomposed if [poly-decomp.js](https://github.com/schteppe/poly-decomp.js) is available. + * Note that this process is not guaranteed to support complex sets of vertices (e.g. those with holes may fail). + * By default the decomposition will discard collinear edges (to improve performance). + * It can also optionally discard any parts that have an area less than `minimumArea`. + * If the vertices can not be decomposed, the result will fall back to using the convex hull. + * The options parameter is an object that specifies any `Matter.Body` properties you wish to override the defaults. + * See the properties section of the `Matter.Body` module for detailed information on what you can pass via the `options` object. + * @method fromVertices + * @param {number} x + * @param {number} y + * @param [[vector]] vertexSets + * @param {object} [options] + * @param {bool} [flagInternal=false] + * @param {number} [removeCollinear=0.01] + * @param {number} [minimumArea=10] + * @return {body} + */ + Bodies.fromVertices = function(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea) { + var body, + parts, + isConvex, + vertices, + i, + j, + k, + v, + z; + + options = options || {}; + parts = []; + + flagInternal = typeof flagInternal !== 'undefined' ? flagInternal : false; + removeCollinear = typeof removeCollinear !== 'undefined' ? removeCollinear : 0.01; + minimumArea = typeof minimumArea !== 'undefined' ? minimumArea : 10; + + if (!decomp) { + Common.warn('Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull.'); + } + + // ensure vertexSets is an array of arrays + if (!Common.isArray(vertexSets[0])) { + vertexSets = [vertexSets]; + } + + for (v = 0; v < vertexSets.length; v += 1) { + vertices = vertexSets[v]; + isConvex = Vertices.isConvex(vertices); + + if (isConvex || !decomp) { + if (isConvex) { + vertices = Vertices.clockwiseSort(vertices); + } else { + // fallback to convex hull when decomposition is not possible + vertices = Vertices.hull(vertices); + } + + parts.push({ + position: { x: x, y: y }, + vertices: vertices + }); + } else { + // initialise a decomposition + var concave = vertices.map(function(vertex) { + return [vertex.x, vertex.y]; + }); + + // vertices are concave and simple, we can decompose into parts + decomp.makeCCW(concave); + if (removeCollinear !== false) + decomp.removeCollinearPoints(concave, removeCollinear); + + // use the quick decomposition algorithm (Bayazit) + var decomposed = decomp.quickDecomp(concave); + + // for each decomposed chunk + for (i = 0; i < decomposed.length; i++) { + var chunk = decomposed[i]; + + // convert vertices into the correct structure + var chunkVertices = chunk.map(function(vertices) { + return { + x: vertices[0], + y: vertices[1] + }; + }); + + // skip small chunks + if (minimumArea > 0 && Vertices.area(chunkVertices) < minimumArea) + continue; + + // create a compound part + parts.push({ + position: Vertices.centre(chunkVertices), + vertices: chunkVertices + }); + } + } + } + + // create body parts + for (i = 0; i < parts.length; i++) { + parts[i] = Body.create(Common.extend(parts[i], options)); + } + + // flag internal edges (coincident part edges) + if (flagInternal) { + var coincident_max_dist = 5; + + for (i = 0; i < parts.length; i++) { + var partA = parts[i]; + + for (j = i + 1; j < parts.length; j++) { + var partB = parts[j]; + + if (Bounds.overlaps(partA.bounds, partB.bounds)) { + var pav = partA.vertices, + pbv = partB.vertices; + + // iterate vertices of both parts + for (k = 0; k < partA.vertices.length; k++) { + for (z = 0; z < partB.vertices.length; z++) { + // find distances between the vertices + var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z])), + db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length])); + + // if both vertices are very close, consider the edge concident (internal) + if (da < coincident_max_dist && db < coincident_max_dist) { + pav[k].isInternal = true; + pbv[z].isInternal = true; + } + } + } + + } + } + } + } + + if (parts.length > 1) { + // create the parent body to be returned, that contains generated compound parts + body = Body.create(Common.extend({ parts: parts.slice(0) }, options)); + Body.setPosition(body, { x: x, y: y }); + + return body; + } else { + return parts[0]; + } + }; + +})(); + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tilemaps.Components + */ + +module.exports = { + + CalculateFacesAt: __webpack_require__(210), + CalculateFacesWithin: __webpack_require__(51), + Copy: __webpack_require__(1257), + CreateFromTiles: __webpack_require__(1258), + CullTiles: __webpack_require__(1259), + Fill: __webpack_require__(1260), + FilterTiles: __webpack_require__(1261), + FindByIndex: __webpack_require__(1262), + FindTile: __webpack_require__(1263), + ForEachTile: __webpack_require__(1264), + GetTileAt: __webpack_require__(137), + GetTileAtWorldXY: __webpack_require__(1265), + GetTilesWithin: __webpack_require__(21), + GetTilesWithinShape: __webpack_require__(1266), + GetTilesWithinWorldXY: __webpack_require__(1267), + HasTileAt: __webpack_require__(451), + HasTileAtWorldXY: __webpack_require__(1268), + IsInLayerBounds: __webpack_require__(101), + PutTileAt: __webpack_require__(211), + PutTileAtWorldXY: __webpack_require__(1269), + PutTilesAt: __webpack_require__(1270), + Randomize: __webpack_require__(1271), + RemoveTileAt: __webpack_require__(452), + RemoveTileAtWorldXY: __webpack_require__(1272), + RenderDebug: __webpack_require__(1273), + ReplaceByIndex: __webpack_require__(450), + SetCollision: __webpack_require__(1274), + SetCollisionBetween: __webpack_require__(1275), + SetCollisionByExclusion: __webpack_require__(1276), + SetCollisionByProperty: __webpack_require__(1277), + SetCollisionFromCollisionGroup: __webpack_require__(1278), + SetTileIndexCallback: __webpack_require__(1279), + SetTileLocationCallback: __webpack_require__(1280), + Shuffle: __webpack_require__(1281), + SwapByIndex: __webpack_require__(1282), + TileToWorldX: __webpack_require__(138), + TileToWorldXY: __webpack_require__(1283), + TileToWorldY: __webpack_require__(139), + WeightedRandomize: __webpack_require__(1284), + WorldToTileX: __webpack_require__(61), + WorldToTileXY: __webpack_require__(1285), + WorldToTileY: __webpack_require__(62) + +}; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsInLayerBounds = __webpack_require__(101); + +/** + * Gets a tile at the given tile coordinates from the given layer. + * + * @function Phaser.Tilemaps.Components.GetTileAt + * @private + * @since 3.0.0 + * + * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates + * were invalid. + */ +var GetTileAt = function (tileX, tileY, nonNull, layer) +{ + if (nonNull === undefined) { nonNull = false; } + + if (IsInLayerBounds(tileX, tileY, layer)) + { + var tile = layer.data[tileY][tileX] || null; + if (tile === null) + { + return null; + } + else if (tile.index === -1) + { + return nonNull ? tile : null; + } + else + { + return tile; + } + } + else + { + return null; + } +}; + +module.exports = GetTileAt; + + +/***/ }), +/* 138 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.TileToWorldX + * @private + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} + */ +var TileToWorldX = function (tileX, camera, layer) +{ + var tileWidth = layer.baseTileWidth; + var tilemapLayer = layer.tilemapLayer; + var layerWorldX = 0; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + } + + return layerWorldX + tileX * tileWidth; +}; + +module.exports = TileToWorldX; + + +/***/ }), +/* 139 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.TileToWorldY + * @private + * @since 3.0.0 + * + * @param {integer} tileY - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} + */ +var TileToWorldY = function (tileY, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return layerWorldY + tileY * tileHeight; +}; + +module.exports = TileToWorldY; + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A Tileset is a combination of an image containing the tiles and a container for data about + * each tile. + * + * @class Tileset + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @param {string} name - The name of the tileset in the map data. + * @param {integer} firstgid - The first tile index this tileset contains. + * @param {integer} [tileWidth=32] - Width of each tile (in pixels). + * @param {integer} [tileHeight=32] - Height of each tile (in pixels). + * @param {integer} [tileMargin=0] - The margin around all tiles in the sheet (in pixels). + * @param {integer} [tileSpacing=0] - The spacing between each tile in the sheet (in pixels). + * @param {object} [tileProperties={}] - Custom properties defined per tile in the Tileset. + * These typically are custom properties created in Tiled when editing a tileset. + * @param {object} [tileData={}] - Data stored per tile. These typically are created in Tiled + * when editing a tileset, e.g. from Tiled's tile collision editor or terrain editor. + */ +var Tileset = new Class({ + + initialize: + + function Tileset (name, firstgid, tileWidth, tileHeight, tileMargin, tileSpacing, tileProperties, tileData) + { + if (tileWidth === undefined || tileWidth <= 0) { tileWidth = 32; } + if (tileHeight === undefined || tileHeight <= 0) { tileHeight = 32; } + if (tileMargin === undefined) { tileMargin = 0; } + if (tileSpacing === undefined) { tileSpacing = 0; } + if (tileProperties === undefined) { tileProperties = {}; } + if (tileData === undefined) { tileData = {}; } + + /** + * The name of the Tileset. + * + * @name Phaser.Tilemaps.Tileset#name + * @type {string} + * @since 3.0.0 + */ + this.name = name; + + /** + * The starting index of the first tile index this Tileset contains. + * + * @name Phaser.Tilemaps.Tileset#firstgid + * @type {integer} + * @since 3.0.0 + */ + this.firstgid = firstgid; + + /** + * The width of each tile (in pixels). Use setTileSize to change. + * + * @name Phaser.Tilemaps.Tileset#tileWidth + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.tileWidth = tileWidth; + + /** + * The height of each tile (in pixels). Use setTileSize to change. + * + * @name Phaser.Tilemaps.Tileset#tileHeight + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.tileHeight = tileHeight; + + /** + * The margin around the tiles in the sheet (in pixels). Use `setSpacing` to change. + * + * @name Phaser.Tilemaps.Tileset#tileMargin + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.tileMargin = tileMargin; + + /** + * The spacing between each the tile in the sheet (in pixels). Use `setSpacing` to change. + * + * @name Phaser.Tilemaps.Tileset#tileSpacing + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.tileSpacing = tileSpacing; + + /** + * Tileset-specific properties per tile that are typically defined in the Tiled editor in the + * Tileset editor. + * + * @name Phaser.Tilemaps.Tileset#tileProperties + * @type {object} + * @since 3.0.0 + */ + this.tileProperties = tileProperties; + + /** + * Tileset-specific data per tile that are typically defined in the Tiled editor, e.g. within + * the Tileset collision editor. This is where collision objects and terrain are stored. + * + * @name Phaser.Tilemaps.Tileset#tileData + * @type {object} + * @since 3.0.0 + */ + this.tileData = tileData; + + /** + * The cached image that contains the individual tiles. Use setImage to set. + * + * @name Phaser.Tilemaps.Tileset#image + * @type {?Phaser.Textures.Texture} + * @readonly + * @since 3.0.0 + */ + this.image = null; + + /** + * The gl texture used by the WebGL renderer. + * + * @name Phaser.Tilemaps.Tileset#glTexture + * @type {?WebGLTexture} + * @readonly + * @since 3.11.0 + */ + this.glTexture = null; + + /** + * The number of tile rows in the the tileset. + * + * @name Phaser.Tilemaps.Tileset#rows + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.rows = 0; + + /** + * The number of tile columns in the tileset. + * + * @name Phaser.Tilemaps.Tileset#columns + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.columns = 0; + + /** + * The total number of tiles in the tileset. + * + * @name Phaser.Tilemaps.Tileset#total + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.total = 0; + + /** + * The look-up table to specific tile image texture coordinates (UV in pixels). Each element + * contains the coordinates for a tile in an object of the form {x, y}. + * + * @name Phaser.Tilemaps.Tileset#texCoordinates + * @type {object[]} + * @readonly + * @since 3.0.0 + */ + this.texCoordinates = []; + }, + + /** + * Get a tiles properties that are stored in the Tileset. Returns null if tile index is not + * contained in this Tileset. This is typically defined in Tiled under the Tileset editor. + * + * @method Phaser.Tilemaps.Tileset#getTileProperties + * @since 3.0.0 + * + * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * + * @return {?(object|undefined)} + */ + getTileProperties: function (tileIndex) + { + if (!this.containsTileIndex(tileIndex)) { return null; } + + return this.tileProperties[tileIndex - this.firstgid]; + }, + + /** + * Get a tile's data that is stored in the Tileset. Returns null if tile index is not contained + * in this Tileset. This is typically defined in Tiled and will contain both Tileset collision + * info and terrain mapping. + * + * @method Phaser.Tilemaps.Tileset#getTileData + * @since 3.0.0 + * + * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * + * @return {?object|undefined} + */ + getTileData: function (tileIndex) + { + if (!this.containsTileIndex(tileIndex)) { return null; } + + return this.tileData[tileIndex - this.firstgid]; + }, + + /** + * Get a tile's collision group that is stored in the Tileset. Returns null if tile index is not + * contained in this Tileset. This is typically defined within Tiled's tileset collision editor. + * + * @method Phaser.Tilemaps.Tileset#getTileCollisionGroup + * @since 3.0.0 + * + * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * + * @return {?object} + */ + getTileCollisionGroup: function (tileIndex) + { + var data = this.getTileData(tileIndex); + + return (data && data.objectgroup) ? data.objectgroup : null; + }, + + /** + * Returns true if and only if this Tileset contains the given tile index. + * + * @method Phaser.Tilemaps.Tileset#containsTileIndex + * @since 3.0.0 + * + * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * + * @return {boolean} + */ + containsTileIndex: function (tileIndex) + { + return ( + tileIndex >= this.firstgid && + tileIndex < (this.firstgid + this.total) + ); + }, + + /** + * Returns the texture coordinates (UV in pixels) in the Tileset image for the given tile index. + * Returns null if tile index is not contained in this Tileset. + * + * @method Phaser.Tilemaps.Tileset#getTileTextureCoordinates + * @since 3.0.0 + * + * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * + * @return {?object} Object in the form { x, y } representing the top-left UV coordinate + * within the Tileset image. + */ + getTileTextureCoordinates: function (tileIndex) + { + if (!this.containsTileIndex(tileIndex)) { return null; } + + return this.texCoordinates[tileIndex - this.firstgid]; + }, + + /** + * Sets the image associated with this Tileset and updates the tile data (rows, columns, etc.). + * + * @method Phaser.Tilemaps.Tileset#setImage + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The image that contains the tiles. + * + * @return {Phaser.Tilemaps.Tileset} This Tileset object. + */ + setImage: function (texture) + { + this.image = texture; + + this.glTexture = texture.get().source.glTexture; + + this.updateTileData(this.image.source[0].width, this.image.source[0].height); + + return this; + }, + + /** + * Sets the tile width & height and updates the tile data (rows, columns, etc.). + * + * @method Phaser.Tilemaps.Tileset#setTileSize + * @since 3.0.0 + * + * @param {integer} [tileWidth] - The width of a tile in pixels. + * @param {integer} [tileHeight] - The height of a tile in pixels. + * + * @return {Phaser.Tilemaps.Tileset} This Tileset object. + */ + setTileSize: function (tileWidth, tileHeight) + { + if (tileWidth !== undefined) { this.tileWidth = tileWidth; } + if (tileHeight !== undefined) { this.tileHeight = tileHeight; } + + if (this.image) + { + this.updateTileData(this.image.source[0].width, this.image.source[0].height); + } + + return this; + }, + + /** + * Sets the tile margin & spacing and updates the tile data (rows, columns, etc.). + * + * @method Phaser.Tilemaps.Tileset#setSpacing + * @since 3.0.0 + * + * @param {integer} [margin] - The margin around the tiles in the sheet (in pixels). + * @param {integer} [spacing] - The spacing between the tiles in the sheet (in pixels). + * + * @return {Phaser.Tilemaps.Tileset} This Tileset object. + */ + setSpacing: function (margin, spacing) + { + if (margin !== undefined) { this.tileMargin = margin; } + if (spacing !== undefined) { this.tileSpacing = spacing; } + + if (this.image) + { + this.updateTileData(this.image.source[0].width, this.image.source[0].height); + } + + return this; + }, + + /** + * Updates tile texture coordinates and tileset data. + * + * @method Phaser.Tilemaps.Tileset#updateTileData + * @since 3.0.0 + * + * @param {integer} imageWidth - The (expected) width of the image to slice. + * @param {integer} imageHeight - The (expected) height of the image to slice. + * + * @return {Phaser.Tilemaps.Tileset} This Tileset object. + */ + updateTileData: function (imageWidth, imageHeight) + { + var rowCount = (imageHeight - this.tileMargin * 2 + this.tileSpacing) / (this.tileHeight + this.tileSpacing); + var colCount = (imageWidth - this.tileMargin * 2 + this.tileSpacing) / (this.tileWidth + this.tileSpacing); + + if (rowCount % 1 !== 0 || colCount % 1 !== 0) + { + console.warn('Image tile area not tile size multiple in: ' + this.name); + } + + // In Tiled a tileset image that is not an even multiple of the tile dimensions is truncated + // - hence the floor when calculating the rows/columns. + rowCount = Math.floor(rowCount); + colCount = Math.floor(colCount); + + this.rows = rowCount; + this.columns = colCount; + + // In Tiled, "empty" spaces in a tileset count as tiles and hence count towards the gid + this.total = rowCount * colCount; + + this.texCoordinates.length = 0; + + var tx = this.tileMargin; + var ty = this.tileMargin; + + for (var y = 0; y < this.rows; y++) + { + for (var x = 0; x < this.columns; x++) + { + this.texCoordinates.push({ x: tx, y: ty }); + tx += this.tileWidth + this.tileSpacing; + } + + tx = this.tileMargin; + ty += this.tileHeight + this.tileSpacing; + } + + return this; + } + +}); + +module.exports = Tileset; + + +/***/ }), +/* 141 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * [description] + * + * @function Phaser.Tweens.Builders.GetNewValue + * @since 3.0.0 + * + * @param {object} source - [description] + * @param {string} key - [description] + * @param {*} defaultValue - [description] + * + * @return {function} [description] + */ +var GetNewValue = function (source, key, defaultValue) +{ + var valueCallback; + + if (source.hasOwnProperty(key)) + { + var t = typeof(source[key]); + + if (t === 'function') + { + valueCallback = function (index, totalTargets, target) + { + return source[key](index, totalTargets, target); + }; + } + else + { + valueCallback = function () + { + return source[key]; + }; + } + } + else if (typeof defaultValue === 'function') + { + valueCallback = defaultValue; + } + else + { + valueCallback = function () + { + return defaultValue; + }; + } + + return valueCallback; +}; + +module.exports = GetNewValue; + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Defaults = __webpack_require__(219); +var GetAdvancedValue = __webpack_require__(14); +var GetBoolean = __webpack_require__(87); +var GetEaseFunction = __webpack_require__(96); +var GetNewValue = __webpack_require__(141); +var GetProps = __webpack_require__(473); +var GetTargets = __webpack_require__(217); +var GetValue = __webpack_require__(6); +var GetValueOp = __webpack_require__(218); +var Tween = __webpack_require__(220); +var TweenData = __webpack_require__(221); + +/** + * Creates a new Tween. + * + * @function Phaser.Tweens.Builders.TweenBuilder + * @since 3.0.0 + * + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween. + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - Configuration for the new Tween. + * @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults. + * + * @return {Phaser.Tweens.Tween} The new tween. + */ +var TweenBuilder = function (parent, config, defaults) +{ + if (defaults === undefined) + { + defaults = Defaults; + } + + // Create arrays of the Targets and the Properties + var targets = (defaults.targets) ? defaults.targets : GetTargets(config); + + // var props = (defaults.props) ? defaults.props : GetProps(config); + var props = GetProps(config); + + // Default Tween values + var delay = GetNewValue(config, 'delay', defaults.delay); + var duration = GetNewValue(config, 'duration', defaults.duration); + var easeParams = GetValue(config, 'easeParams', defaults.easeParams); + var ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), easeParams); + var hold = GetNewValue(config, 'hold', defaults.hold); + var repeat = GetNewValue(config, 'repeat', defaults.repeat); + var repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); + var yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); + var flipX = GetBoolean(config, 'flipX', defaults.flipX); + var flipY = GetBoolean(config, 'flipY', defaults.flipY); + + var data = []; + + // Loop through every property defined in the Tween, i.e.: props { x, y, alpha } + for (var p = 0; p < props.length; p++) + { + var key = props[p].key; + var value = props[p].value; + + // Create 1 TweenData per target, per property + for (var t = 0; t < targets.length; t++) + { + var ops = GetValueOp(key, value); + + var tweenData = TweenData( + targets[t], + key, + ops.getEnd, + ops.getStart, + GetEaseFunction(GetValue(value, 'ease', ease), easeParams), + GetNewValue(value, 'delay', delay), + GetNewValue(value, 'duration', duration), + GetBoolean(value, 'yoyo', yoyo), + GetNewValue(value, 'hold', hold), + GetNewValue(value, 'repeat', repeat), + GetNewValue(value, 'repeatDelay', repeatDelay), + GetBoolean(value, 'flipX', flipX), + GetBoolean(value, 'flipY', flipY) + ); + + data.push(tweenData); + } + } + + var tween = new Tween(parent, data, targets); + + tween.offset = GetAdvancedValue(config, 'offset', null); + tween.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); + tween.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); + tween.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); + tween.paused = GetBoolean(config, 'paused', false); + tween.useFrames = GetBoolean(config, 'useFrames', false); + + // Set the Callbacks + var scope = GetValue(config, 'callbackScope', tween); + + // Callback parameters: 0 = a reference to the Tween itself, 1 = the target/s of the Tween, ... your own params + var tweenArray = [ tween, null ]; + + var callbacks = Tween.TYPES; + + for (var i = 0; i < callbacks.length; i++) + { + var type = callbacks[i]; + + var callback = GetValue(config, type, false); + + if (callback) + { + var callbackScope = GetValue(config, type + 'Scope', scope); + var callbackParams = GetValue(config, type + 'Params', []); + + // The null is reset to be the Tween target + tween.setCallback(type, callback, tweenArray.concat(callbackParams), callbackScope); + } + } + + return tween; +}; + +module.exports = TweenBuilder; + + +/***/ }), +/* 143 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ALIGN_CONST = { + + /** + * A constant representing a top-left alignment or position. + * @constant + * @name Phaser.Display.Align.TOP_LEFT + * @since 3.0.0 + * @type {integer} + */ + TOP_LEFT: 0, + + /** + * A constant representing a top-center alignment or position. + * @constant + * @name Phaser.Display.Align.TOP_CENTER + * @since 3.0.0 + * @type {integer} + */ + TOP_CENTER: 1, + + /** + * A constant representing a top-right alignment or position. + * @constant + * @name Phaser.Display.Align.TOP_RIGHT + * @since 3.0.0 + * @type {integer} + */ + TOP_RIGHT: 2, + + /** + * A constant representing a left-top alignment or position. + * @constant + * @name Phaser.Display.Align.LEFT_TOP + * @since 3.0.0 + * @type {integer} + */ + LEFT_TOP: 3, + + /** + * A constant representing a left-center alignment or position. + * @constant + * @name Phaser.Display.Align.LEFT_CENTER + * @since 3.0.0 + * @type {integer} + */ + LEFT_CENTER: 4, + + /** + * A constant representing a left-bottom alignment or position. + * @constant + * @name Phaser.Display.Align.LEFT_BOTTOM + * @since 3.0.0 + * @type {integer} + */ + LEFT_BOTTOM: 5, + + /** + * A constant representing a center alignment or position. + * @constant + * @name Phaser.Display.Align.CENTER + * @since 3.0.0 + * @type {integer} + */ + CENTER: 6, + + /** + * A constant representing a right-top alignment or position. + * @constant + * @name Phaser.Display.Align.RIGHT_TOP + * @since 3.0.0 + * @type {integer} + */ + RIGHT_TOP: 7, + + /** + * A constant representing a right-center alignment or position. + * @constant + * @name Phaser.Display.Align.RIGHT_CENTER + * @since 3.0.0 + * @type {integer} + */ + RIGHT_CENTER: 8, + + /** + * A constant representing a right-bottom alignment or position. + * @constant + * @name Phaser.Display.Align.RIGHT_BOTTOM + * @since 3.0.0 + * @type {integer} + */ + RIGHT_BOTTOM: 9, + + /** + * A constant representing a bottom-left alignment or position. + * @constant + * @name Phaser.Display.Align.BOTTOM_LEFT + * @since 3.0.0 + * @type {integer} + */ + BOTTOM_LEFT: 10, + + /** + * A constant representing a bottom-center alignment or position. + * @constant + * @name Phaser.Display.Align.BOTTOM_CENTER + * @since 3.0.0 + * @type {integer} + */ + BOTTOM_CENTER: 11, + + /** + * A constant representing a bottom-right alignment or position. + * @constant + * @name Phaser.Display.Align.BOTTOM_RIGHT + * @since 3.0.0 + * @type {integer} + */ + BOTTOM_RIGHT: 12 + +}; + +module.exports = ALIGN_CONST; + + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle. + * + * @function Phaser.Geom.Circle.CircumferencePoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Circle} circle - The Circle to get the circumference point on. + * @param {number} angle - The angle from the center of the Circle to the circumference to return the point from. Given in radians. + * @param {(Phaser.Geom.Point|object)} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created. + * + * @return {(Phaser.Geom.Point|object)} A Point object where the `x` and `y` properties are the point on the circumference. + */ +var CircumferencePoint = function (circle, angle, out) +{ + if (out === undefined) { out = new Point(); } + + out.x = circle.x + (circle.radius * Math.cos(angle)); + out.y = circle.y + (circle.radius * Math.sin(angle)); + + return out; +}; + +module.exports = CircumferencePoint; + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Returns a uniformly distributed random point from anywhere within the given Circle. + * + * @function Phaser.Geom.Circle.Random + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Circle} circle - The Circle to get a random point from. + * @param {(Phaser.Geom.Point|object)} [out] - A Point or point-like object to set the random `x` and `y` values in. + * + * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties. + */ +var Random = function (circle, out) +{ + if (out === undefined) { out = new Point(); } + + var t = 2 * Math.PI * Math.random(); + var u = Math.random() + Math.random(); + var r = (u > 1) ? 2 - u : u; + var x = r * Math.cos(t); + var y = r * Math.sin(t); + + out.x = circle.x + (x * circle.radius); + out.y = circle.y + (y * circle.radius); + + return out; +}; + +module.exports = Random; + + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); +var Class = __webpack_require__(0); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(107); +var FindClosestInSorted = __webpack_require__(245); +var Frame = __webpack_require__(246); +var GetValue = __webpack_require__(6); + +/** + * @classdesc + * A Frame based Animation. + * + * This consists of a key, some default values (like the frame rate) and a bunch of Frame objects. + * + * The Animation Manager creates these. Game Objects don't own an instance of these directly. + * Game Objects have the Animation Component, which are like playheads to global Animations (these objects) + * So multiple Game Objects can have playheads all pointing to this one Animation instance. + * + * @class Animation + * @memberof Phaser.Animations + * @extends Phaser.Events.EventEmitter + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Animations.AnimationManager} manager - A reference to the global Animation Manager + * @param {string} key - The unique identifying string for this animation. + * @param {Phaser.Types.Animations.Animation} config - The Animation configuration. + */ +var Animation = new Class({ + + Extends: EventEmitter, + + initialize: + + function Animation (manager, key, config) + { + EventEmitter.call(this); + + /** + * A reference to the global Animation Manager. + * + * @name Phaser.Animations.Animation#manager + * @type {Phaser.Animations.AnimationManager} + * @since 3.0.0 + */ + this.manager = manager; + + /** + * The unique identifying string for this animation. + * + * @name Phaser.Animations.Animation#key + * @type {string} + * @since 3.0.0 + */ + this.key = key; + + /** + * A frame based animation (as opposed to a bone based animation) + * + * @name Phaser.Animations.Animation#type + * @type {string} + * @default frame + * @since 3.0.0 + */ + this.type = 'frame'; + + /** + * Extract all the frame data into the frames array. + * + * @name Phaser.Animations.Animation#frames + * @type {Phaser.Animations.AnimationFrame[]} + * @since 3.0.0 + */ + this.frames = this.getFrames( + manager.textureManager, + GetValue(config, 'frames', []), + GetValue(config, 'defaultTextureKey', null) + ); + + /** + * The frame rate of playback in frames per second (default 24 if duration is null) + * + * @name Phaser.Animations.Animation#frameRate + * @type {integer} + * @default 24 + * @since 3.0.0 + */ + this.frameRate = GetValue(config, 'frameRate', null); + + /** + * How long the animation should play for, in milliseconds. + * If the `frameRate` property has been set then it overrides this value, + * otherwise the `frameRate` is derived from `duration`. + * + * @name Phaser.Animations.Animation#duration + * @type {integer} + * @since 3.0.0 + */ + this.duration = GetValue(config, 'duration', null); + + if (this.duration === null && this.frameRate === null) + { + // No duration or frameRate given, use default frameRate of 24fps + this.frameRate = 24; + this.duration = (this.frameRate / this.frames.length) * 1000; + } + else if (this.duration && this.frameRate === null) + { + // Duration given but no frameRate, so set the frameRate based on duration + // I.e. 12 frames in the animation, duration = 4000 ms + // So frameRate is 12 / (4000 / 1000) = 3 fps + this.frameRate = this.frames.length / (this.duration / 1000); + } + else + { + // frameRate given, derive duration from it (even if duration also specified) + // I.e. 15 frames in the animation, frameRate = 30 fps + // So duration is 15 / 30 = 0.5 * 1000 (half a second, or 500ms) + this.duration = (this.frames.length / this.frameRate) * 1000; + } + + /** + * How many ms per frame, not including frame specific modifiers. + * + * @name Phaser.Animations.Animation#msPerFrame + * @type {integer} + * @since 3.0.0 + */ + this.msPerFrame = 1000 / this.frameRate; + + /** + * Skip frames if the time lags, or always advanced anyway? + * + * @name Phaser.Animations.Animation#skipMissedFrames + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.skipMissedFrames = GetValue(config, 'skipMissedFrames', true); + + /** + * The delay in ms before the playback will begin. + * + * @name Phaser.Animations.Animation#delay + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.delay = GetValue(config, 'delay', 0); + + /** + * Number of times to repeat the animation. Set to -1 to repeat forever. + * + * @name Phaser.Animations.Animation#repeat + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.repeat = GetValue(config, 'repeat', 0); + + /** + * The delay in ms before the a repeat play starts. + * + * @name Phaser.Animations.Animation#repeatDelay + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.repeatDelay = GetValue(config, 'repeatDelay', 0); + + /** + * Should the animation yoyo (reverse back down to the start) before repeating? + * + * @name Phaser.Animations.Animation#yoyo + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.yoyo = GetValue(config, 'yoyo', false); + + /** + * Should the GameObject's `visible` property be set to `true` when the animation starts to play? + * + * @name Phaser.Animations.Animation#showOnStart + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.showOnStart = GetValue(config, 'showOnStart', false); + + /** + * Should the GameObject's `visible` property be set to `false` when the animation finishes? + * + * @name Phaser.Animations.Animation#hideOnComplete + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.hideOnComplete = GetValue(config, 'hideOnComplete', false); + + /** + * Global pause. All Game Objects using this Animation instance are impacted by this property. + * + * @name Phaser.Animations.Animation#paused + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.paused = false; + + this.manager.on(Events.PAUSE_ALL, this.pause, this); + this.manager.on(Events.RESUME_ALL, this.resume, this); + }, + + /** + * Add frames to the end of the animation. + * + * @method Phaser.Animations.Animation#addFrame + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - [description] + * + * @return {Phaser.Animations.Animation} This Animation object. + */ + addFrame: function (config) + { + return this.addFrameAt(this.frames.length, config); + }, + + /** + * Add frame/s into the animation. + * + * @method Phaser.Animations.Animation#addFrameAt + * @since 3.0.0 + * + * @param {integer} index - The index to insert the frame at within the animation. + * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - [description] + * + * @return {Phaser.Animations.Animation} This Animation object. + */ + addFrameAt: function (index, config) + { + var newFrames = this.getFrames(this.manager.textureManager, config); + + if (newFrames.length > 0) + { + if (index === 0) + { + this.frames = newFrames.concat(this.frames); + } + else if (index === this.frames.length) + { + this.frames = this.frames.concat(newFrames); + } + else + { + var pre = this.frames.slice(0, index); + var post = this.frames.slice(index); + + this.frames = pre.concat(newFrames, post); + } + + this.updateFrameSequence(); + } + + return this; + }, + + /** + * Check if the given frame index is valid. + * + * @method Phaser.Animations.Animation#checkFrame + * @since 3.0.0 + * + * @param {integer} index - The index to be checked. + * + * @return {boolean} `true` if the index is valid, otherwise `false`. + */ + checkFrame: function (index) + { + return (index >= 0 && index < this.frames.length); + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#completeAnimation + * @protected + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - [description] + */ + completeAnimation: function (component) + { + if (this.hideOnComplete) + { + component.parent.visible = false; + } + + component.stop(); + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#getFirstTick + * @protected + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - [description] + * @param {boolean} [includeDelay=true] - [description] + */ + getFirstTick: function (component, includeDelay) + { + if (includeDelay === undefined) { includeDelay = true; } + + // When is the first update due? + component.accumulator = 0; + component.nextTick = component.msPerFrame + component.currentFrame.duration; + + if (includeDelay) + { + component.nextTick += component._delay; + } + }, + + /** + * Returns the AnimationFrame at the provided index + * + * @method Phaser.Animations.Animation#getFrameAt + * @protected + * @since 3.0.0 + * + * @param {integer} index - The index in the AnimationFrame array + * + * @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence + */ + getFrameAt: function (index) + { + return this.frames[index]; + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#getFrames + * @since 3.0.0 + * + * @param {Phaser.Textures.TextureManager} textureManager - [description] + * @param {(string|Phaser.Types.Animations.AnimationFrame[])} frames - [description] + * @param {string} [defaultTextureKey] - [description] + * + * @return {Phaser.Animations.AnimationFrame[]} [description] + */ + getFrames: function (textureManager, frames, defaultTextureKey) + { + var out = []; + var prev; + var animationFrame; + var index = 1; + var i; + var textureKey; + + // if frames is a string, we'll get all the frames from the texture manager as if it's a sprite sheet + if (typeof frames === 'string') + { + textureKey = frames; + + var texture = textureManager.get(textureKey); + var frameKeys = texture.getFrameNames(); + + frames = []; + + frameKeys.forEach(function (idx, value) + { + frames.push({ key: textureKey, frame: value }); + }); + } + + if (!Array.isArray(frames) || frames.length === 0) + { + return out; + } + + for (i = 0; i < frames.length; i++) + { + var item = frames[i]; + + var key = GetValue(item, 'key', defaultTextureKey); + + if (!key) + { + continue; + } + + // Could be an integer or a string + var frame = GetValue(item, 'frame', 0); + + // The actual texture frame + var textureFrame = textureManager.getFrame(key, frame); + + animationFrame = new Frame(key, frame, index, textureFrame); + + animationFrame.duration = GetValue(item, 'duration', 0); + + animationFrame.isFirst = (!prev); + + // The previously created animationFrame + if (prev) + { + prev.nextFrame = animationFrame; + + animationFrame.prevFrame = prev; + } + + out.push(animationFrame); + + prev = animationFrame; + + index++; + } + + if (out.length > 0) + { + animationFrame.isLast = true; + + // Link them end-to-end, so they loop + animationFrame.nextFrame = out[0]; + + out[0].prevFrame = animationFrame; + + // Generate the progress data + + var slice = 1 / (out.length - 1); + + for (i = 0; i < out.length; i++) + { + out[i].progress = i * slice; + } + } + + return out; + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#getNextTick + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - [description] + */ + getNextTick: function (component) + { + // accumulator += delta * _timeScale + // after a large delta surge (perf issue for example) we need to adjust for it here + + // When is the next update due? + component.accumulator -= component.nextTick; + + component.nextTick = component.msPerFrame + component.currentFrame.duration; + }, + + /** + * Loads the Animation values into the Animation Component. + * + * @method Phaser.Animations.Animation#load + * @private + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to load values into. + * @param {integer} startFrame - The start frame of the animation to load. + */ + load: function (component, startFrame) + { + if (startFrame >= this.frames.length) + { + startFrame = 0; + } + + if (component.currentAnim !== this) + { + component.currentAnim = this; + + component.frameRate = this.frameRate; + component.duration = this.duration; + component.msPerFrame = this.msPerFrame; + component.skipMissedFrames = this.skipMissedFrames; + + component._delay = this.delay; + component._repeat = this.repeat; + component._repeatDelay = this.repeatDelay; + component._yoyo = this.yoyo; + } + + var frame = this.frames[startFrame]; + + if (startFrame === 0 && !component.forward) + { + frame = this.getLastFrame(); + } + + component.updateFrame(frame); + }, + + /** + * Returns the frame closest to the given progress value between 0 and 1. + * + * @method Phaser.Animations.Animation#getFrameByProgress + * @since 3.4.0 + * + * @param {number} value - A value between 0 and 1. + * + * @return {Phaser.Animations.AnimationFrame} The frame closest to the given progress value. + */ + getFrameByProgress: function (value) + { + value = Clamp(value, 0, 1); + + return FindClosestInSorted(value, this.frames, 'progress'); + }, + + /** + * Advance the animation frame. + * + * @method Phaser.Animations.Animation#nextFrame + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. + */ + nextFrame: function (component) + { + var frame = component.currentFrame; + + // TODO: Add frame skip support + + if (frame.isLast) + { + // We're at the end of the animation + + // Yoyo? (happens before repeat) + if (component._yoyo) + { + this.handleYoyoFrame(component, false); + } + else if (component.repeatCounter > 0) + { + // Repeat (happens before complete) + + if (component._reverse && component.forward) + { + component.forward = false; + } + else + { + this.repeatAnimation(component); + } + } + else + { + this.completeAnimation(component); + } + } + else + { + this.updateAndGetNextTick(component, frame.nextFrame); + } + }, + + /** + * Handle the yoyo functionality in nextFrame and previousFrame methods. + * + * @method Phaser.Animations.Animation#handleYoyoFrame + * @private + * @since 3.12.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. + * @param {boolean} isReverse - Is animation in reverse mode? (Default: false) + */ + handleYoyoFrame: function (component, isReverse) + { + if (!isReverse) { isReverse = false; } + + if (component._reverse === !isReverse && component.repeatCounter > 0) + { + component.forward = isReverse; + + this.repeatAnimation(component); + + return; + } + + if (component._reverse !== isReverse && component.repeatCounter === 0) + { + this.completeAnimation(component); + + return; + } + + component.forward = isReverse; + + var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame; + + this.updateAndGetNextTick(component, frame); + }, + + /** + * Returns the animation last frame. + * + * @method Phaser.Animations.Animation#getLastFrame + * @since 3.12.0 + * + * @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame. + */ + getLastFrame: function () + { + return this.frames[this.frames.length - 1]; + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#previousFrame + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - [description] + */ + previousFrame: function (component) + { + var frame = component.currentFrame; + + // TODO: Add frame skip support + + if (frame.isFirst) + { + // We're at the start of the animation + + if (component._yoyo) + { + this.handleYoyoFrame(component, true); + } + else if (component.repeatCounter > 0) + { + if (component._reverse && !component.forward) + { + component.currentFrame = this.getLastFrame(); + this.repeatAnimation(component); + } + else + { + // Repeat (happens before complete) + component.forward = true; + this.repeatAnimation(component); + } + } + else + { + this.completeAnimation(component); + } + } + else + { + this.updateAndGetNextTick(component, frame.prevFrame); + } + }, + + /** + * Update Frame and Wait next tick. + * + * @method Phaser.Animations.Animation#updateAndGetNextTick + * @private + * @since 3.12.0 + * + * @param {Phaser.Animations.AnimationFrame} frame - An Animation frame. + */ + updateAndGetNextTick: function (component, frame) + { + component.updateFrame(frame); + + this.getNextTick(component); + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#removeFrame + * @since 3.0.0 + * + * @param {Phaser.Animations.AnimationFrame} frame - [description] + * + * @return {Phaser.Animations.Animation} This Animation object. + */ + removeFrame: function (frame) + { + var index = this.frames.indexOf(frame); + + if (index !== -1) + { + this.removeFrameAt(index); + } + + return this; + }, + + /** + * Removes a frame from the AnimationFrame array at the provided index + * and updates the animation accordingly. + * + * @method Phaser.Animations.Animation#removeFrameAt + * @since 3.0.0 + * + * @param {integer} index - The index in the AnimationFrame array + * + * @return {Phaser.Animations.Animation} This Animation object. + */ + removeFrameAt: function (index) + { + this.frames.splice(index, 1); + + this.updateFrameSequence(); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#repeatAnimation + * @fires Phaser.Animations.Events#ANIMATION_REPEAT + * @fires Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT + * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - [description] + */ + repeatAnimation: function (component) + { + if (component._pendingStop === 2) + { + return this.completeAnimation(component); + } + + if (component._repeatDelay > 0 && component.pendingRepeat === false) + { + component.pendingRepeat = true; + component.accumulator -= component.nextTick; + component.nextTick += component._repeatDelay; + } + else + { + component.repeatCounter--; + + component.updateFrame(component.currentFrame[(component.forward) ? 'nextFrame' : 'prevFrame']); + + if (component.isPlaying) + { + this.getNextTick(component); + + component.pendingRepeat = false; + + var frame = component.currentFrame; + var parent = component.parent; + + this.emit(Events.ANIMATION_REPEAT, this, frame); + + parent.emit(Events.SPRITE_ANIMATION_KEY_REPEAT + this.key, this, frame, component.repeatCounter, parent); + + parent.emit(Events.SPRITE_ANIMATION_REPEAT, this, frame, component.repeatCounter, parent); + } + } + }, + + /** + * Sets the texture frame the animation uses for rendering. + * + * @method Phaser.Animations.Animation#setFrame + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - [description] + */ + setFrame: function (component) + { + // Work out which frame should be set next on the child, and set it + if (component.forward) + { + this.nextFrame(component); + } + else + { + this.previousFrame(component); + } + }, + + /** + * Converts the animation data to JSON. + * + * @method Phaser.Animations.Animation#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Animations.JSONAnimation} [description] + */ + toJSON: function () + { + var output = { + key: this.key, + type: this.type, + frames: [], + frameRate: this.frameRate, + duration: this.duration, + skipMissedFrames: this.skipMissedFrames, + delay: this.delay, + repeat: this.repeat, + repeatDelay: this.repeatDelay, + yoyo: this.yoyo, + showOnStart: this.showOnStart, + hideOnComplete: this.hideOnComplete + }; + + this.frames.forEach(function (frame) + { + output.frames.push(frame.toJSON()); + }); + + return output; + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#updateFrameSequence + * @since 3.0.0 + * + * @return {Phaser.Animations.Animation} This Animation object. + */ + updateFrameSequence: function () + { + var len = this.frames.length; + var slice = 1 / (len - 1); + + for (var i = 0; i < len; i++) + { + var frame = this.frames[i]; + + frame.index = i + 1; + frame.isFirst = false; + frame.isLast = false; + frame.progress = i * slice; + + if (i === 0) + { + frame.isFirst = true; + frame.isLast = (len === 1); + frame.prevFrame = this.frames[len - 1]; + frame.nextFrame = this.frames[i + 1]; + } + else if (i === len - 1) + { + frame.isLast = true; + frame.prevFrame = this.frames[len - 2]; + frame.nextFrame = this.frames[0]; + } + else if (len > 1) + { + frame.prevFrame = this.frames[i - 1]; + frame.nextFrame = this.frames[i + 1]; + } + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#pause + * @since 3.0.0 + * + * @return {Phaser.Animations.Animation} This Animation object. + */ + pause: function () + { + this.paused = true; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#resume + * @since 3.0.0 + * + * @return {Phaser.Animations.Animation} This Animation object. + */ + resume: function () + { + this.paused = false; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Animations.Animation#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.removeAllListeners(); + + this.manager.off(Events.PAUSE_ALL, this.pause, this); + this.manager.off(Events.RESUME_ALL, this.resume, this); + + this.manager.remove(this.key); + + for (var i = 0; i < this.frames.length; i++) + { + this.frames[i].destroy(); + } + + this.frames = []; + + this.manager = null; + } + +}); + +module.exports = Animation; + + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Perimeter = __webpack_require__(108); +var Point = __webpack_require__(3); + +/** + * Position is a value between 0 and 1 where 0 = the top-left of the rectangle and 0.5 = the bottom right. + * + * @function Phaser.Geom.Rectangle.GetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectangle - [description] + * @param {number} position - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] + * + * @return {Phaser.Geom.Point} [description] + */ +var GetPoint = function (rectangle, position, out) +{ + if (out === undefined) { out = new Point(); } + + if (position <= 0 || position >= 1) + { + out.x = rectangle.x; + out.y = rectangle.y; + + return out; + } + + var p = Perimeter(rectangle) * position; + + if (position > 0.5) + { + p -= (rectangle.width + rectangle.height); + + if (p <= rectangle.width) + { + // Face 3 + out.x = rectangle.right - p; + out.y = rectangle.bottom; + } + else + { + // Face 4 + out.x = rectangle.x; + out.y = rectangle.bottom - (p - rectangle.width); + } + } + else if (p <= rectangle.width) + { + // Face 1 + out.x = rectangle.x + p; + out.y = rectangle.y; + } + else + { + // Face 2 + out.x = rectangle.right; + out.y = rectangle.y + (p - rectangle.width); + } + + return out; +}; + +module.exports = GetPoint; + + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Length = __webpack_require__(55); +var Point = __webpack_require__(3); + +/** + * Get a number of points along a line's length. + * + * Provide a `quantity` to get an exact number of points along the line. + * + * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when + * providing a `stepRate`. + * + * @function Phaser.Geom.Line.GetPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [out,$return] + * + * @param {Phaser.Geom.Line} line - The line. + * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. + * + * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. + */ +var GetPoints = function (line, quantity, stepRate, out) +{ + if (out === undefined) { out = []; } + + // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. + if (!quantity) + { + quantity = Length(line) / stepRate; + } + + var x1 = line.x1; + var y1 = line.y1; + + var x2 = line.x2; + var y2 = line.y2; + + for (var i = 0; i < quantity; i++) + { + var position = i / quantity; + + var x = x1 + (x2 - x1) * position; + var y = y1 + (y2 - y1) * position; + + out.push(new Point(x, y)); + } + + return out; +}; + +module.exports = GetPoints; + + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Returns a random point on a given Line. + * + * @function Phaser.Geom.Line.Random + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Line} line - The Line to calculate the random Point on. + * @param {(Phaser.Geom.Point|object)} [out] - An instance of a Point to be modified. + * + * @return {(Phaser.Geom.Point|object)} A random Point on the Line. + */ +var Random = function (line, out) +{ + if (out === undefined) { out = new Point(); } + + var t = Math.random(); + + out.x = line.x1 + t * (line.x2 - line.x1); + out.y = line.y1 + t * (line.y2 - line.y1); + + return out; +}; + +module.exports = Random; + + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Returns a random point within a Rectangle. + * + * @function Phaser.Geom.Rectangle.Random + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to return a point from. + * @param {Phaser.Geom.Point} out - The object to update with the point's coordinates. + * + * @return {Phaser.Geom.Point} The modified `out` object, or a new Point if none was provided. + */ +var Random = function (rect, out) +{ + if (out === undefined) { out = new Point(); } + + out.x = rect.x + (Math.random() * rect.width); + out.y = rect.y + (Math.random() * rect.height); + + return out; +}; + +module.exports = Random; + + +/***/ }), +/* 151 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the WebGL rendering pipeline of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Pipeline + * @webglOnly + * @since 3.0.0 + */ + +var Pipeline = { + + /** + * The initial WebGL pipeline of this Game Object. + * + * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @default null + * @webglOnly + * @since 3.0.0 + */ + defaultPipeline: null, + + /** + * The current WebGL pipeline of this Game Object. + * + * @name Phaser.GameObjects.Components.Pipeline#pipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @default null + * @webglOnly + * @since 3.0.0 + */ + pipeline: null, + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * This should only be called during the instantiation of the Game Object. + * + * @method Phaser.GameObjects.Components.Pipeline#initPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {string} [pipelineName=TextureTintPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. + * + * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. + */ + initPipeline: function (pipelineName) + { + if (pipelineName === undefined) { pipelineName = 'TextureTintPipeline'; } + + var renderer = this.scene.sys.game.renderer; + + if (renderer && renderer.gl && renderer.hasPipeline(pipelineName)) + { + this.defaultPipeline = renderer.getPipeline(pipelineName); + this.pipeline = this.defaultPipeline; + + return true; + } + + return false; + }, + + /** + * Sets the active WebGL Pipeline of this Game Object. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipeline + * @webglOnly + * @since 3.0.0 + * + * @param {string} pipelineName - The name of the pipeline to set on this Game Object. + * + * @return {this} This Game Object instance. + */ + setPipeline: function (pipelineName) + { + var renderer = this.scene.sys.game.renderer; + + if (renderer && renderer.gl && renderer.hasPipeline(pipelineName)) + { + this.pipeline = renderer.getPipeline(pipelineName); + } + + return this; + }, + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * + * @method Phaser.GameObjects.Components.Pipeline#resetPipeline + * @webglOnly + * @since 3.0.0 + * + * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. + */ + resetPipeline: function () + { + this.pipeline = this.defaultPipeline; + + return (this.pipeline !== null); + }, + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + * + * @method Phaser.GameObjects.Components.Pipeline#getPipelineName + * @webglOnly + * @since 3.0.0 + * + * @return {string} The string-based name of the pipeline being used by this Game Object. + */ + getPipelineName: function () + { + return this.pipeline.name; + } + +}; + +module.exports = Pipeline; + + +/***/ }), +/* 152 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Returns a uniformly distributed random point from anywhere within the given Ellipse. + * + * @function Phaser.Geom.Ellipse.Random + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get a random point from. + * @param {(Phaser.Geom.Point|object)} [out] - A Point or point-like object to set the random `x` and `y` values in. + * + * @return {(Phaser.Geom.Point|object)} A Point object with the random values set in the `x` and `y` properties. + */ +var Random = function (ellipse, out) +{ + if (out === undefined) { out = new Point(); } + + var p = Math.random() * Math.PI * 2; + var s = Math.sqrt(Math.random()); + + out.x = ellipse.x + ((s * Math.cos(p)) * ellipse.width / 2); + out.y = ellipse.y + ((s * Math.sin(p)) * ellipse.height / 2); + + return out; +}; + +module.exports = Random; + + +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * [description] + * + * @function Phaser.Geom.Triangle.Random + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Triangle} triangle - [description] + * @param {Phaser.Geom.Point} [out] - [description] + * + * @return {Phaser.Geom.Point} [description] + */ +var Random = function (triangle, out) +{ + if (out === undefined) { out = new Point(); } + + // Basis vectors + var ux = triangle.x2 - triangle.x1; + var uy = triangle.y2 - triangle.y1; + + var vx = triangle.x3 - triangle.x1; + var vy = triangle.y3 - triangle.y1; + + // Random point within the unit square + var r = Math.random(); + var s = Math.random(); + + // Point outside the triangle? Remap it. + if (r + s >= 1) + { + r = 1 - r; + s = 1 - s; + } + + out.x = triangle.x1 + ((ux * r) + (vx * s)); + out.y = triangle.y1 + ((uy * r) + (vy * s)); + + return out; +}; + +module.exports = Random; + + +/***/ }), +/* 154 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle` and `distance`. + * + * @function Phaser.Math.RotateAroundDistance + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} x - The horizontal coordinate to rotate around. + * @param {number} y - The vertical coordinate to rotate around. + * @param {number} angle - The angle of rotation in radians. + * @param {number} distance - The distance from (x, y) to place the point at. + * + * @return {Phaser.Geom.Point} The given point. + */ +var RotateAroundDistance = function (point, x, y, angle, distance) +{ + var t = angle + Math.atan2(point.y - y, point.x - x); + + point.x = x + (distance * Math.cos(t)); + point.y = y + (distance * Math.sin(t)); + + return point; +}; + +module.exports = RotateAroundDistance; + + +/***/ }), +/* 155 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smoother interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. + * + * @function Phaser.Math.SmootherStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmootherStep = function (x, min, max) +{ + x = Math.max(0, Math.min(1, (x - min) / (max - min))); + + return x * x * x * (x * (x * 6 - 15) + 10); +}; + +module.exports = SmootherStep; + + +/***/ }), +/* 156 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smooth interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * @function Phaser.Math.SmoothStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmoothStep = function (x, min, max) +{ + if (x <= min) + { + return 0; + } + + if (x >= max) + { + return 1; + } + + x = (x - min) / (max - min); + + return x * x * (3 - 2 * x); +}; + +module.exports = SmoothStep; + + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @callback EachMapCallback + * + * @param {string} key - The key of the Map entry. + * @param {E} entry - The value of the Map entry. + * + * @return {?boolean} The callback result. + */ + +/** + * @classdesc + * The keys of a Map can be arbitrary values. + * + * ```javascript + * var map = new Map([ + * [ 1, 'one' ], + * [ 2, 'two' ], + * [ 3, 'three' ] + * ]); + * ``` + * + * @class Map + * @memberof Phaser.Structs + * @constructor + * @since 3.0.0 + * + * @generic K + * @generic V + * @genericUse {V[]} - [elements] + * + * @param {Array.<*>} elements - An optional array of key-value pairs to populate this Map with. + */ +var Map = new Class({ + + initialize: + + function Map (elements) + { + /** + * The entries in this Map. + * + * @genericUse {Object.} - [$type] + * + * @name Phaser.Structs.Map#entries + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.entries = {}; + + /** + * The number of key / value pairs in this Map. + * + * @name Phaser.Structs.Map#size + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.size = 0; + + if (Array.isArray(elements)) + { + for (var i = 0; i < elements.length; i++) + { + this.set(elements[i][0], elements[i][1]); + } + } + }, + + /** + * Adds an element with a specified `key` and `value` to this Map. + * If the `key` already exists, the value will be replaced. + * + * @method Phaser.Structs.Map#set + * @since 3.0.0 + * + * @genericUse {K} - [key] + * @genericUse {V} - [value] + * @genericUse {Phaser.Structs.Map.} - [$return] + * + * @param {string} key - The key of the element to be added to this Map. + * @param {*} value - The value of the element to be added to this Map. + * + * @return {Phaser.Structs.Map} This Map object. + */ + set: function (key, value) + { + if (!this.has(key)) + { + this.size++; + } + + this.entries[key] = value; + + return this; + }, + + /** + * Returns the value associated to the `key`, or `undefined` if there is none. + * + * @method Phaser.Structs.Map#get + * @since 3.0.0 + * + * @genericUse {K} - [key] + * @genericUse {V} - [$return] + * + * @param {string} key - The key of the element to return from the `Map` object. + * + * @return {*} The element associated with the specified key or `undefined` if the key can't be found in this Map object. + */ + get: function (key) + { + if (this.has(key)) + { + return this.entries[key]; + } + }, + + /** + * Returns an `Array` of all the values stored in this Map. + * + * @method Phaser.Structs.Map#getArray + * @since 3.0.0 + * + * @genericUse {V[]} - [$return] + * + * @return {Array.<*>} An array of the values stored in this Map. + */ + getArray: function () + { + var output = []; + var entries = this.entries; + + for (var key in entries) + { + output.push(entries[key]); + } + + return output; + }, + + /** + * Returns a boolean indicating whether an element with the specified key exists or not. + * + * @method Phaser.Structs.Map#has + * @since 3.0.0 + * + * @genericUse {K} - [key] + * + * @param {string} key - The key of the element to test for presence of in this Map. + * + * @return {boolean} Returns `true` if an element with the specified key exists in this Map, otherwise `false`. + */ + has: function (key) + { + return (this.entries.hasOwnProperty(key)); + }, + + /** + * Delete the specified element from this Map. + * + * @method Phaser.Structs.Map#delete + * @since 3.0.0 + * + * @genericUse {K} - [key] + * @genericUse {Phaser.Structs.Map.} - [$return] + * + * @param {string} key - The key of the element to delete from this Map. + * + * @return {Phaser.Structs.Map} This Map object. + */ + delete: function (key) + { + if (this.has(key)) + { + delete this.entries[key]; + this.size--; + } + + return this; + }, + + /** + * Delete all entries from this Map. + * + * @method Phaser.Structs.Map#clear + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.Map.} - [$return] + * + * @return {Phaser.Structs.Map} This Map object. + */ + clear: function () + { + Object.keys(this.entries).forEach(function (prop) + { + delete this.entries[prop]; + + }, this); + + this.size = 0; + + return this; + }, + + /** + * Returns all entries keys in this Map. + * + * @method Phaser.Structs.Map#keys + * @since 3.0.0 + * + * @genericUse {K[]} - [$return] + * + * @return {string[]} Array containing entries' keys. + */ + keys: function () + { + return Object.keys(this.entries); + }, + + /** + * Returns an `Array` of all entries. + * + * @method Phaser.Structs.Map#values + * @since 3.0.0 + * + * @genericUse {V[]} - [$return] + * + * @return {Array.<*>} An `Array` of entries. + */ + values: function () + { + var output = []; + var entries = this.entries; + + for (var key in entries) + { + output.push(entries[key]); + } + + return output; + }, + + /** + * Dumps the contents of this Map to the console via `console.group`. + * + * @method Phaser.Structs.Map#dump + * @since 3.0.0 + */ + dump: function () + { + var entries = this.entries; + + // eslint-disable-next-line no-console + console.group('Map'); + + for (var key in entries) + { + console.log(key, entries[key]); + } + + // eslint-disable-next-line no-console + console.groupEnd(); + }, + + /** + * Passes all entries in this Map to the given callback. + * + * @method Phaser.Structs.Map#each + * @since 3.0.0 + * + * @genericUse {EachMapCallback.} - [callback] + * @genericUse {Phaser.Structs.Map.} - [$return] + * + * @param {EachMapCallback} callback - The callback which will receive the keys and entries held in this Map. + * + * @return {Phaser.Structs.Map} This Map object. + */ + each: function (callback) + { + var entries = this.entries; + + for (var key in entries) + { + if (callback(key, entries[key]) === false) + { + break; + } + } + + return this; + }, + + /** + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. + * + * @method Phaser.Structs.Map#contains + * @since 3.0.0 + * + * @genericUse {V} - [value] + * + * @param {*} value - The value to search for. + * + * @return {boolean} `true` if the value is found, otherwise `false`. + */ + contains: function (value) + { + var entries = this.entries; + + for (var key in entries) + { + if (entries[key] === value) + { + return true; + } + } + + return false; + }, + + /** + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. + * + * @method Phaser.Structs.Map#merge + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.Map.} - [map,$return] + * + * @param {Phaser.Structs.Map} map - The Map to merge in to this Map. + * @param {boolean} [override=false] - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. + * + * @return {Phaser.Structs.Map} This Map object. + */ + merge: function (map, override) + { + if (override === undefined) { override = false; } + + var local = this.entries; + var source = map.entries; + + for (var key in source) + { + if (local.hasOwnProperty(key) && override) + { + local[key] = source[key]; + } + else + { + this.set(key, source[key]); + } + } + + return this; + } + +}); + +module.exports = Map; + + +/***/ }), +/* 158 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes the given string and pads it out, to the length required, using the character + * specified. For example if you need a string to be 6 characters long, you can call: + * + * `pad('bob', 6, '-', 2)` + * + * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. + * + * You can also use it to pad numbers (they are always returned as strings): + * + * `pad(512, 6, '0', 1)` + * + * Would return: `000512` with the string padded to the left. + * + * If you don't specify a direction it'll pad to both sides: + * + * `pad('c64', 7, '*')` + * + * Would return: `**c64**` + * + * @function Phaser.Utils.String.Pad + * @since 3.0.0 + * + * @param {string} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. + * @param {integer} [len=0] - The number of characters to be added. + * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). + * @param {integer} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). + * + * @return {string} The padded string. + */ +var Pad = function (str, len, pad, dir) +{ + if (len === undefined) { len = 0; } + if (pad === undefined) { pad = ' '; } + if (dir === undefined) { dir = 3; } + + str = str.toString(); + + var padlen = 0; + + if (len + 1 >= str.length) + { + switch (dir) + { + case 1: + str = new Array(len + 1 - str.length).join(pad) + str; + break; + + case 3: + var right = Math.ceil((padlen = len - str.length) / 2); + var left = padlen - right; + str = new Array(left + 1).join(pad) + str + new Array(right + 1).join(pad); + break; + + default: + str = str + new Array(len + 1 - str.length).join(pad); + break; + } + } + + return str; +}; + +module.exports = Pad; + + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var HexStringToColor = __webpack_require__(269); +var IntegerToColor = __webpack_require__(272); +var ObjectToColor = __webpack_require__(274); +var RGBStringToColor = __webpack_require__(275); + +/** + * Converts the given source color value into an instance of a Color class. + * The value can be either a string, prefixed with `rgb` or a hex string, a number or an Object. + * + * @function Phaser.Display.Color.ValueToColor + * @since 3.0.0 + * + * @param {(string|number|Phaser.Types.Display.InputColorObject)} input - The source color value to convert. + * + * @return {Phaser.Display.Color} A Color object. + */ +var ValueToColor = function (input) +{ + var t = typeof input; + + switch (t) + { + case 'string': + + if (input.substr(0, 3).toLowerCase() === 'rgb') + { + return RGBStringToColor(input); + } + else + { + return HexStringToColor(input); + } + + case 'number': + + return IntegerToColor(input); + + case 'object': + + return ObjectToColor(input); + } +}; + +module.exports = ValueToColor; + + +/***/ }), +/* 160 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Given 3 separate color values this will return an integer representation of it. + * + * @function Phaser.Display.Color.GetColor + * @since 3.0.0 + * + * @param {integer} red - The red color value. A number between 0 and 255. + * @param {integer} green - The green color value. A number between 0 and 255. + * @param {integer} blue - The blue color value. A number between 0 and 255. + * + * @return {number} The combined color value. + */ +var GetColor = function (red, green, blue) +{ + return red << 16 | green << 8 | blue; +}; + +module.exports = GetColor; + + +/***/ }), +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetColor = __webpack_require__(160); + +/** + * Converts an HSV (hue, saturation and value) color value to RGB. + * Conversion formula from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes HSV values are contained in the set [0, 1]. + * Based on code by Michael Jackson (https://github.com/mjijackson) + * + * @function Phaser.Display.Color.HSVToRGB + * @since 3.0.0 + * + * @param {number} h - The hue, in the range 0 - 1. This is the base color. + * @param {number} s - The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. + * @param {number} v - The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black. + * @param {(Phaser.Types.Display.ColorObject|Phaser.Display.Color)} [out] - A Color object to store the results in. If not given a new ColorObject will be created. + * + * @return {(Phaser.Types.Display.ColorObject|Phaser.Display.Color)} An object with the red, green and blue values set in the r, g and b properties. + */ +var HSVToRGB = function (h, s, v, out) +{ + if (s === undefined) { s = 1; } + if (v === undefined) { v = 1; } + + var i = Math.floor(h * 6); + var f = h * 6 - i; + + var p = Math.floor((v * (1 - s)) * 255); + var q = Math.floor((v * (1 - f * s)) * 255); + var t = Math.floor((v * (1 - (1 - f) * s)) * 255); + + v = Math.floor(v *= 255); + + var r = v; + var g = v; + var b = v; + + var c = i % 6; + + if (c === 0) + { + g = t; + b = p; + } + else if (c === 1) + { + r = q; + b = p; + } + else if (c === 2) + { + r = p; + b = t; + } + else if (c === 3) + { + r = p; + g = q; + } + else if (c === 4) + { + r = t; + g = p; + } + else if (c === 5) + { + g = p; + b = q; + } + + if (!out) + { + return { r: r, g: g, b: b, color: GetColor(r, g, b) }; + } + else if (out.setTo) + { + return out.setTo(r, g, b, out.alpha, false); + } + else + { + out.r = r; + out.g = g; + out.b = b; + out.color = GetColor(r, g, b); + + return out; + } +}; + +module.exports = HSVToRGB; + + +/***/ }), +/* 162 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Centers this Rectangle so that the center coordinates match the given x and y values. + +/** + * Moves the top-left corner of a Rectangle so that its center is at the given coordinates. + * + * @function Phaser.Geom.Rectangle.CenterOn + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [rect,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to be centered. + * @param {number} x - The X coordinate of the Rectangle's center. + * @param {number} y - The Y coordinate of the Rectangle's center. + * + * @return {Phaser.Geom.Rectangle} The centered rectangle. + */ +var CenterOn = function (rect, x, y) +{ + rect.x = x - (rect.width / 2); + rect.y = y - (rect.height / 2); + + return rect; +}; + +module.exports = CenterOn; + + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Back = __webpack_require__(277); +var Bounce = __webpack_require__(278); +var Circular = __webpack_require__(279); +var Cubic = __webpack_require__(280); +var Elastic = __webpack_require__(281); +var Expo = __webpack_require__(282); +var Linear = __webpack_require__(283); +var Quadratic = __webpack_require__(284); +var Quartic = __webpack_require__(285); +var Quintic = __webpack_require__(286); +var Sine = __webpack_require__(287); +var Stepped = __webpack_require__(288); + +// EaseMap +module.exports = { + + Power0: Linear, + Power1: Quadratic.Out, + Power2: Cubic.Out, + Power3: Quartic.Out, + Power4: Quintic.Out, + + Linear: Linear, + Quad: Quadratic.Out, + Cubic: Cubic.Out, + Quart: Quartic.Out, + Quint: Quintic.Out, + Sine: Sine.Out, + Expo: Expo.Out, + Circ: Circular.Out, + Elastic: Elastic.Out, + Back: Back.Out, + Bounce: Bounce.Out, + Stepped: Stepped, + + 'Quad.easeIn': Quadratic.In, + 'Cubic.easeIn': Cubic.In, + 'Quart.easeIn': Quartic.In, + 'Quint.easeIn': Quintic.In, + 'Sine.easeIn': Sine.In, + 'Expo.easeIn': Expo.In, + 'Circ.easeIn': Circular.In, + 'Elastic.easeIn': Elastic.In, + 'Back.easeIn': Back.In, + 'Bounce.easeIn': Bounce.In, + + 'Quad.easeOut': Quadratic.Out, + 'Cubic.easeOut': Cubic.Out, + 'Quart.easeOut': Quartic.Out, + 'Quint.easeOut': Quintic.Out, + 'Sine.easeOut': Sine.Out, + 'Expo.easeOut': Expo.Out, + 'Circ.easeOut': Circular.Out, + 'Elastic.easeOut': Elastic.Out, + 'Back.easeOut': Back.Out, + 'Bounce.easeOut': Bounce.Out, + + 'Quad.easeInOut': Quadratic.InOut, + 'Cubic.easeInOut': Cubic.InOut, + 'Quart.easeInOut': Quartic.InOut, + 'Quint.easeInOut': Quintic.InOut, + 'Sine.easeInOut': Sine.InOut, + 'Expo.easeInOut': Expo.InOut, + 'Circ.easeInOut': Circular.InOut, + 'Elastic.easeInOut': Elastic.InOut, + 'Back.easeInOut': Back.InOut, + 'Bounce.easeInOut': Bounce.InOut + +}; + + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var OS = __webpack_require__(115); +var Browser = __webpack_require__(116); +var CanvasPool = __webpack_require__(24); + +/** + * Determines the features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.features` from within any Scene. + * + * @typedef {object} Phaser.Device.Features + * @since 3.0.0 + * + * @property {?boolean} canvasBitBltShift - True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap. + * @property {boolean} canvas - Is canvas available? + * @property {boolean} file - Is file available? + * @property {boolean} fileSystem - Is fileSystem available? + * @property {boolean} getUserMedia - Does the device support the getUserMedia API? + * @property {boolean} littleEndian - Is the device big or little endian? (only detected if the browser supports TypedArrays) + * @property {boolean} localStorage - Is localStorage available? + * @property {boolean} pointerLock - Is Pointer Lock available? + * @property {boolean} support32bit - Does the device context support 32bit pixel manipulation using array buffer views? + * @property {boolean} vibration - Does the device support the Vibration API? + * @property {boolean} webGL - Is webGL available? + * @property {boolean} worker - Is worker available? + */ +var Features = { + + canvas: false, + canvasBitBltShift: null, + file: false, + fileSystem: false, + getUserMedia: true, + littleEndian: false, + localStorage: false, + pointerLock: false, + support32bit: false, + vibration: false, + webGL: false, + worker: false + +}; + +// Check Little or Big Endian system. +// @author Matt DesLauriers (@mattdesl) +function checkIsLittleEndian () +{ + var a = new ArrayBuffer(4); + var b = new Uint8Array(a); + var c = new Uint32Array(a); + + b[0] = 0xa1; + b[1] = 0xb2; + b[2] = 0xc3; + b[3] = 0xd4; + + if (c[0] === 0xd4c3b2a1) + { + return true; + } + + if (c[0] === 0xa1b2c3d4) + { + return false; + } + else + { + // Could not determine endianness + return null; + } +} + +function init () +{ + Features.canvas = !!window['CanvasRenderingContext2D']; + + try + { + Features.localStorage = !!localStorage.getItem; + } + catch (error) + { + Features.localStorage = false; + } + + Features.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob']; + Features.fileSystem = !!window['requestFileSystem']; + + var isUint8 = false; + + var testWebGL = function () + { + if (window['WebGLRenderingContext']) + { + try + { + var canvas = CanvasPool.createWebGL(this); + + var ctx = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); + + var canvas2D = CanvasPool.create2D(this); + + var ctx2D = canvas2D.getContext('2d'); + + // Can't be done on a webgl context + var image = ctx2D.createImageData(1, 1); + + // Test to see if ImageData uses CanvasPixelArray or Uint8ClampedArray. + // @author Matt DesLauriers (@mattdesl) + isUint8 = image.data instanceof Uint8ClampedArray; + + CanvasPool.remove(canvas); + CanvasPool.remove(canvas2D); + + return !!ctx; + } + catch (e) + { + return false; + } + } + + return false; + }; + + Features.webGL = testWebGL(); + + Features.worker = !!window['Worker']; + + Features.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; + + navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; + + window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; + + Features.getUserMedia = Features.getUserMedia && !!navigator.getUserMedia && !!window.URL; + + // Older versions of firefox (< 21) apparently claim support but user media does not actually work + if (Browser.firefox && Browser.firefoxVersion < 21) + { + Features.getUserMedia = false; + } + + // Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it + // is safer to not try and use the fast copy-over method. + if (!OS.iOS && (Browser.ie || Browser.firefox || Browser.chrome)) + { + Features.canvasBitBltShift = true; + } + + // Known not to work + if (Browser.safari || Browser.mobileSafari) + { + Features.canvasBitBltShift = false; + } + + navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; + + if (navigator.vibrate) + { + Features.vibration = true; + } + + if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && typeof Uint32Array !== 'undefined') + { + Features.littleEndian = checkIsLittleEndian(); + } + + Features.support32bit = ( + typeof ArrayBuffer !== 'undefined' && + typeof Uint8ClampedArray !== 'undefined' && + typeof Int32Array !== 'undefined' && + Features.littleEndian !== null && + isUint8 + ); + + return Features; +} + +module.exports = init(); + + +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(23); +var Extend = __webpack_require__(17); + +/** + * @namespace Phaser.Math + */ + +var PhaserMath = { + + // Collections of functions + Angle: __webpack_require__(686), + Distance: __webpack_require__(694), + Easing: __webpack_require__(696), + Fuzzy: __webpack_require__(697), + Interpolation: __webpack_require__(700), + Pow2: __webpack_require__(705), + Snap: __webpack_require__(707), + + // Expose the RNG Class + RandomDataGenerator: __webpack_require__(709), + + // Single functions + Average: __webpack_require__(710), + Bernstein: __webpack_require__(297), + Between: __webpack_require__(168), + CatmullRom: __webpack_require__(167), + CeilTo: __webpack_require__(711), + Clamp: __webpack_require__(22), + DegToRad: __webpack_require__(35), + Difference: __webpack_require__(712), + Factorial: __webpack_require__(298), + FloatBetween: __webpack_require__(304), + FloorTo: __webpack_require__(713), + FromPercent: __webpack_require__(86), + GetSpeed: __webpack_require__(714), + IsEven: __webpack_require__(715), + IsEvenStrict: __webpack_require__(716), + Linear: __webpack_require__(114), + MaxAdd: __webpack_require__(717), + MinSub: __webpack_require__(718), + Percent: __webpack_require__(719), + RadToDeg: __webpack_require__(169), + RandomXY: __webpack_require__(720), + RandomXYZ: __webpack_require__(721), + RandomXYZW: __webpack_require__(722), + Rotate: __webpack_require__(305), + RotateAround: __webpack_require__(251), + RotateAroundDistance: __webpack_require__(154), + RoundAwayFromZero: __webpack_require__(306), + RoundTo: __webpack_require__(723), + SinCosTableGenerator: __webpack_require__(724), + SmootherStep: __webpack_require__(155), + SmoothStep: __webpack_require__(156), + TransformXY: __webpack_require__(307), + Within: __webpack_require__(725), + Wrap: __webpack_require__(56), + + // Vector classes + Vector2: __webpack_require__(4), + Vector3: __webpack_require__(170), + Vector4: __webpack_require__(308), + Matrix3: __webpack_require__(309), + Matrix4: __webpack_require__(310), + Quaternion: __webpack_require__(311), + RotateVec3: __webpack_require__(726) + +}; + +// Merge in the consts + +PhaserMath = Extend(false, PhaserMath, CONST); + +// Export it + +module.exports = PhaserMath; + + +/***/ }), +/* 166 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether the given values are fuzzily equal. + * + * Two numbers are fuzzily equal if their difference is less than `epsilon`. + * + * @function Phaser.Math.Fuzzy.Equal + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. + */ +var Equal = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.abs(a - b) < epsilon; +}; + +module.exports = Equal; + + +/***/ }), +/* 167 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - [description] + * @param {number} p0 - [description] + * @param {number} p1 - [description] + * @param {number} p2 - [description] + * @param {number} p3 - [description] + * + * @return {number} The Catmull-Rom value. + */ +var CatmullRom = function (t, p0, p1, p2, p3) +{ + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + var t2 = t * t; + var t3 = t * t2; + + return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; +}; + +module.exports = CatmullRom; + + +/***/ }), +/* 168 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random integer between the `min` and `max` values, inclusive. + * + * @function Phaser.Math.Between + * @since 3.0.0 + * + * @param {integer} min - The minimum value. + * @param {integer} max - The maximum value. + * + * @return {integer} The random integer. + */ +var Between = function (min, max) +{ + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +module.exports = Between; + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(23); + +/** + * Convert the given angle in radians, to the equivalent angle in degrees. + * + * @function Phaser.Math.RadToDeg + * @since 3.0.0 + * + * @param {number} radians - The angle in radians to convert ot degrees. + * + * @return {integer} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A representation of a vector in 3D space. + * + * A three-component vector. + * + * @class Vector3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Vector3 = new Class({ + + initialize: + + function Vector3 (x, y, z) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector3#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector3#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector3#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + }, + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + * + * @method Phaser.Math.Vector3#up + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + up: function () + { + this.x = 0; + this.y = 1; + this.z = 0; + + return this; + }, + + /** + * Make a clone of this Vector3. + * + * @method Phaser.Math.Vector3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. + */ + clone: function () + { + return new Vector3(this.x, this.y, this.z); + }, + + /** + * Calculate the cross (vector) product of two given Vectors. + * + * @method Phaser.Math.Vector3#crossVectors + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + crossVectors: function (a, b) + { + var ax = a.x; + var ay = a.y; + var az = a.z; + var bx = b.x; + var by = b.y; + var bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector3#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. + * + * @return {boolean} True if the two vectors strictly match, otherwise false. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector3#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + + return this; + }, + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * + * @method Phaser.Math.Vector3#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. + * @param {number} [y] - The y value to set for this Vector. + * @param {number} [z] - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + set: function (x, y, z) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector3#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector3#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + scale: function (scale) + { + if (isFinite(scale)) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + } + else + { + this.x = 0; + this.y = 0; + this.z = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + + return this; + }, + + /** + * Negate the `x`, `y` and `z` components of this Vector. + * + * @method Phaser.Math.Vector3#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector3#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return dx * dx + dy * dy + dz * dz; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector3#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return Math.sqrt(x * x + y * y + z * z); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector3#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return x * x + y * y + z * z; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector3#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var len = x * x + y * y + z * z; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. + * + * @return {number} The dot product of this Vector and `v`. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z; + }, + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * + * @method Phaser.Math.Vector3#cross + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + cross: function (v) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var bx = v.x; + var by = v.y; + var bz = v.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector3#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector3#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = x * m[0] + y * m[3] + z * m[6]; + this.y = x * m[1] + y * m[4] + z * m[7]; + this.z = x * m[2] + y * m[5] + z * m[8]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector3#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; + + return this; + }, + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformCoordinates + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformCoordinates: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.x = tx / tw; + this.y = ty / tw; + this.z = tz / tw; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector3#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformQuat: function (q) + { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * + * @method Phaser.Math.Vector3#project + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + project: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var a00 = m[0]; + var a01 = m[1]; + var a02 = m[2]; + var a03 = m[3]; + var a10 = m[4]; + var a11 = m[5]; + var a12 = m[6]; + var a13 = m[7]; + var a20 = m[8]; + var a21 = m[9]; + var a22 = m[10]; + var a23 = m[11]; + var a30 = m[12]; + var a31 = m[13]; + var a32 = m[14]; + var a33 = m[15]; + + var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); + + this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; + this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; + this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; + + return this; + }, + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * + * @method Phaser.Math.Vector3#unproject + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. + * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unproject: function (viewport, invProjectionView) + { + var viewX = viewport.x; + var viewY = viewport.y; + var viewWidth = viewport.z; + var viewHeight = viewport.w; + + var x = this.x - viewX; + var y = (viewHeight - this.y - 1) - viewY; + var z = this.z; + + this.x = (2 * x) / viewWidth - 1; + this.y = (2 * y) / viewHeight - 1; + this.z = 2 * z - 1; + + return this.project(invProjectionView); + }, + + /** + * Make this Vector the zero vector (0, 0, 0). + * + * @method Phaser.Math.Vector3#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + + return this; + } + +}); + +/** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ZERO + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ZERO = new Vector3(); + +/** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.RIGHT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.RIGHT = new Vector3(1, 0, 0); + +/** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.LEFT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.LEFT = new Vector3(-1, 0, 0); + +/** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.UP + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.UP = new Vector3(0, -1, 0); + +/** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.DOWN + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.DOWN = new Vector3(0, 1, 0); + +/** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.FORWARD + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.FORWARD = new Vector3(0, 0, 1); + +/** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.BACK + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.BACK = new Vector3(0, 0, -1); + +/** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ONE + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ONE = new Vector3(1, 1, 1); + +module.exports = Vector3; + + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @typedef {object} Phaser.Plugins.DefaultPlugins + * + * @property {array} Global - These are the Global Managers that are created by the Phaser.Game instance. + * @property {array} CoreScene - These are the core plugins that are installed into every Scene.Systems instance, no matter what. + * @property {array} DefaultScene - These plugins are created in Scene.Systems in addition to the CoreScenePlugins. + */ + +var DefaultPlugins = { + + /** + * These are the Global Managers that are created by the Phaser.Game instance. + * They are referenced from Scene.Systems so that plugins can use them. + * + * @name Phaser.Plugins.Global + * @type {array} + * @since 3.0.0 + */ + Global: [ + + 'game', + 'anims', + 'cache', + 'plugins', + 'registry', + 'scale', + 'sound', + 'textures' + + ], + + /** + * These are the core plugins that are installed into every Scene.Systems instance, no matter what. + * They are optionally exposed in the Scene as well (see the InjectionMap for details) + * + * They are created in the order in which they appear in this array and EventEmitter is always first. + * + * @name Phaser.Plugins.CoreScene + * @type {array} + * @since 3.0.0 + */ + CoreScene: [ + + 'EventEmitter', + + 'CameraManager', + 'GameObjectCreator', + 'GameObjectFactory', + 'ScenePlugin', + 'DisplayList', + 'UpdateList' + + ], + + /** + * These plugins are created in Scene.Systems in addition to the CoreScenePlugins. + * + * You can elect not to have these plugins by either creating a DefaultPlugins object as part + * of the Game Config, by creating a Plugins object as part of a Scene Config, or by modifying this array + * and building your own bundle. + * + * They are optionally exposed in the Scene as well (see the InjectionMap for details) + * + * They are always created in the order in which they appear in the array. + * + * @name Phaser.Plugins.DefaultScene + * @type {array} + * @since 3.0.0 + */ + DefaultScene: [ + + 'Clock', + 'DataManagerPlugin', + 'InputPlugin', + 'Loader', + 'TweenManager', + 'LightsPlugin' + + ] + +}; + +if (false) +{} + +if (false) +{} + +module.exports = DefaultPlugins; + + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); + +// points is an array of Point-like objects, +// either 2 dimensional arrays, or objects with public x/y properties: +// var points = [ +// [100, 200], +// [200, 400], +// { x: 30, y: 60 } +// ] + +/** + * Constructs new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds. + * + * @function Phaser.Geom.Rectangle.FromPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * + * @param {array} points - An array of points (either arrays with two elements corresponding to the X and Y coordinate or an object with public `x` and `y` properties) which should be surrounded by the Rectangle. + * @param {Phaser.Geom.Rectangle} [out] - Optional Rectangle to adjust. + * + * @return {Phaser.Geom.Rectangle} The adjusted `out` Rectangle, or a new Rectangle if none was provided. + */ +var FromPoints = function (points, out) +{ + if (out === undefined) { out = new Rectangle(); } + + if (points.length === 0) + { + return out; + } + + var minX = Number.MAX_VALUE; + var minY = Number.MAX_VALUE; + + var maxX = Number.MIN_SAFE_INTEGER; + var maxY = Number.MIN_SAFE_INTEGER; + + var p; + var px; + var py; + + for (var i = 0; i < points.length; i++) + { + p = points[i]; + + if (Array.isArray(p)) + { + px = p[0]; + py = p[1]; + } + else + { + px = p.x; + py = p.y; + } + + minX = Math.min(minX, px); + minY = Math.min(minY, py); + + maxX = Math.max(maxX, px); + maxY = Math.max(maxY, py); + } + + out.x = minX; + out.y = minY; + out.width = maxX - minX; + out.height = maxY - minY; + + return out; +}; + +module.exports = FromPoints; + + +/***/ }), +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = { + + CENTER: __webpack_require__(331), + ORIENTATION: __webpack_require__(332), + SCALE_MODE: __webpack_require__(333), + ZOOM: __webpack_require__(334) + +}; + +module.exports = CONST; + + +/***/ }), +/* 174 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Attempts to remove the element from its parentNode in the DOM. + * + * @function Phaser.DOM.RemoveFromDOM + * @since 3.0.0 + * + * @param {HTMLElement} element - The DOM element to remove from its parent node. + */ +var RemoveFromDOM = function (element) +{ + if (element.parentNode) + { + element.parentNode.removeChild(element); + } +}; + +module.exports = RemoveFromDOM; + + +/***/ }), +/* 175 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var INPUT_CONST = { + + /** + * The mouse pointer is being held down. + * + * @name Phaser.Input.MOUSE_DOWN + * @type {integer} + * @since 3.10.0 + */ + MOUSE_DOWN: 0, + + /** + * The mouse pointer is being moved. + * + * @name Phaser.Input.MOUSE_MOVE + * @type {integer} + * @since 3.10.0 + */ + MOUSE_MOVE: 1, + + /** + * The mouse pointer is released. + * + * @name Phaser.Input.MOUSE_UP + * @type {integer} + * @since 3.10.0 + */ + MOUSE_UP: 2, + + /** + * A touch pointer has been started. + * + * @name Phaser.Input.TOUCH_START + * @type {integer} + * @since 3.10.0 + */ + TOUCH_START: 3, + + /** + * A touch pointer has been started. + * + * @name Phaser.Input.TOUCH_MOVE + * @type {integer} + * @since 3.10.0 + */ + TOUCH_MOVE: 4, + + /** + * A touch pointer has been started. + * + * @name Phaser.Input.TOUCH_END + * @type {integer} + * @since 3.10.0 + */ + TOUCH_END: 5, + + /** + * The pointer lock has changed. + * + * @name Phaser.Input.POINTER_LOCK_CHANGE + * @type {integer} + * @since 3.10.0 + */ + POINTER_LOCK_CHANGE: 6, + + /** + * A touch pointer has been been cancelled by the browser. + * + * @name Phaser.Input.TOUCH_CANCEL + * @type {integer} + * @since 3.15.0 + */ + TOUCH_CANCEL: 7, + + /** + * The mouse wheel changes. + * + * @name Phaser.Input.MOUSE_WHEEL + * @type {integer} + * @since 3.18.0 + */ + MOUSE_WHEEL: 8 + +}; + +module.exports = INPUT_CONST; + + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(122); +var DefaultPlugins = __webpack_require__(171); +var Events = __webpack_require__(19); +var GetPhysicsPlugins = __webpack_require__(839); +var GetScenePlugins = __webpack_require__(840); +var NOOP = __webpack_require__(1); +var Settings = __webpack_require__(348); + +/** + * @classdesc + * The Scene Systems class. + * + * This class is available from within a Scene under the property `sys`. + * It is responsible for managing all of the plugins a Scene has running, including the display list, and + * handling the update step and renderer. It also contains references to global systems belonging to Game. + * + * @class Systems + * @memberof Phaser.Scenes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene that owns this Systems instance. + * @param {(string|Phaser.Types.Scenes.SettingsConfig)} config - Scene specific configuration settings. + */ +var Systems = new Class({ + + initialize: + + function Systems (scene, config) + { + /** + * A reference to the Scene that these Systems belong to. + * + * @name Phaser.Scenes.Systems#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Phaser Game instance. + * + * @name Phaser.Scenes.Systems#game + * @type {Phaser.Game} + * @since 3.0.0 + */ + this.game; + + /** + * A reference to either the Canvas or WebGL Renderer that this Game is using. + * + * @name Phaser.Scenes.Systems#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.17.0 + */ + this.renderer; + + if (false) + {} + + /** + * The Scene Configuration object, as passed in when creating the Scene. + * + * @name Phaser.Scenes.Systems#config + * @type {(string|Phaser.Types.Scenes.SettingsConfig)} + * @since 3.0.0 + */ + this.config = config; + + /** + * The Scene Settings. This is the parsed output based on the Scene configuration. + * + * @name Phaser.Scenes.Systems#settings + * @type {Phaser.Types.Scenes.SettingsObject} + * @since 3.0.0 + */ + this.settings = Settings.create(config); + + /** + * A handy reference to the Scene canvas / context. + * + * @name Phaser.Scenes.Systems#canvas + * @type {HTMLCanvasElement} + * @since 3.0.0 + */ + this.canvas; + + /** + * A reference to the Canvas Rendering Context being used by the renderer. + * + * @name Phaser.Scenes.Systems#context + * @type {CanvasRenderingContext2D} + * @since 3.0.0 + */ + this.context; + + // Global Systems - these are single-instance global managers that belong to Game + + /** + * A reference to the global Animations Manager. + * + * In the default set-up you can access this from within a Scene via the `this.anims` property. + * + * @name Phaser.Scenes.Systems#anims + * @type {Phaser.Animations.AnimationManager} + * @since 3.0.0 + */ + this.anims; + + /** + * A reference to the global Cache. The Cache stores all files bought in to Phaser via + * the Loader, with the exception of images. Images are stored in the Texture Manager. + * + * In the default set-up you can access this from within a Scene via the `this.cache` property. + * + * @name Phaser.Scenes.Systems#cache + * @type {Phaser.Cache.CacheManager} + * @since 3.0.0 + */ + this.cache; + + /** + * A reference to the global Plugins Manager. + * + * In the default set-up you can access this from within a Scene via the `this.plugins` property. + * + * @name Phaser.Scenes.Systems#plugins + * @type {Phaser.Plugins.PluginManager} + * @since 3.0.0 + */ + this.plugins; + + /** + * A reference to the global registry. This is a game-wide instance of the Data Manager, allowing + * you to exchange data between Scenes via a universal and shared point. + * + * In the default set-up you can access this from within a Scene via the `this.registry` property. + * + * @name Phaser.Scenes.Systems#registry + * @type {Phaser.Data.DataManager} + * @since 3.0.0 + */ + this.registry; + + /** + * A reference to the global Scale Manager. + * + * In the default set-up you can access this from within a Scene via the `this.scale` property. + * + * @name Phaser.Scenes.Systems#scale + * @type {Phaser.Scale.ScaleManager} + * @since 3.15.0 + */ + this.scale; + + /** + * A reference to the global Sound Manager. + * + * In the default set-up you can access this from within a Scene via the `this.sound` property. + * + * @name Phaser.Scenes.Systems#sound + * @type {Phaser.Sound.BaseSoundManager} + * @since 3.0.0 + */ + this.sound; + + /** + * A reference to the global Texture Manager. + * + * In the default set-up you can access this from within a Scene via the `this.textures` property. + * + * @name Phaser.Scenes.Systems#textures + * @type {Phaser.Textures.TextureManager} + * @since 3.0.0 + */ + this.textures; + + // Core Plugins - these are non-optional Scene plugins, needed by lots of the other systems + + /** + * A reference to the Scene's Game Object Factory. + * + * Use this to quickly and easily create new Game Object's. + * + * In the default set-up you can access this from within a Scene via the `this.add` property. + * + * @name Phaser.Scenes.Systems#add + * @type {Phaser.GameObjects.GameObjectFactory} + * @since 3.0.0 + */ + this.add; + + /** + * A reference to the Scene's Camera Manager. + * + * Use this to manipulate and create Cameras for this specific Scene. + * + * In the default set-up you can access this from within a Scene via the `this.cameras` property. + * + * @name Phaser.Scenes.Systems#cameras + * @type {Phaser.Cameras.Scene2D.CameraManager} + * @since 3.0.0 + */ + this.cameras; + + /** + * A reference to the Scene's Display List. + * + * Use this to organize the children contained in the display list. + * + * In the default set-up you can access this from within a Scene via the `this.children` property. + * + * @name Phaser.Scenes.Systems#displayList + * @type {Phaser.GameObjects.DisplayList} + * @since 3.0.0 + */ + this.displayList; + + /** + * A reference to the Scene's Event Manager. + * + * Use this to listen for Scene specific events, such as `pause` and `shutdown`. + * + * In the default set-up you can access this from within a Scene via the `this.events` property. + * + * @name Phaser.Scenes.Systems#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events; + + /** + * A reference to the Scene's Game Object Creator. + * + * Use this to quickly and easily create new Game Object's. The difference between this and the + * Game Object Factory, is that the Creator just creates and returns Game Object instances, it + * doesn't then add them to the Display List or Update List. + * + * In the default set-up you can access this from within a Scene via the `this.make` property. + * + * @name Phaser.Scenes.Systems#make + * @type {Phaser.GameObjects.GameObjectCreator} + * @since 3.0.0 + */ + this.make; + + /** + * A reference to the Scene Manager Plugin. + * + * Use this to manipulate both this and other Scene's in your game, for example to launch a parallel Scene, + * or pause or resume a Scene, or switch from this Scene to another. + * + * In the default set-up you can access this from within a Scene via the `this.scene` property. + * + * @name Phaser.Scenes.Systems#scenePlugin + * @type {Phaser.Scenes.ScenePlugin} + * @since 3.0.0 + */ + this.scenePlugin; + + /** + * A reference to the Scene's Update List. + * + * Use this to organize the children contained in the update list. + * + * The Update List is responsible for managing children that need their `preUpdate` methods called, + * in order to process so internal components, such as Sprites with Animations. + * + * In the default set-up there is no reference to this from within the Scene itself. + * + * @name Phaser.Scenes.Systems#updateList + * @type {Phaser.GameObjects.UpdateList} + * @since 3.0.0 + */ + this.updateList; + + /** + * The Scene Update function. + * + * This starts out as NOOP during init, preload and create, and at the end of create + * it swaps to be whatever the Scene.update function is. + * + * @name Phaser.Scenes.Systems#sceneUpdate + * @type {function} + * @private + * @since 3.10.0 + */ + this.sceneUpdate = NOOP; + }, + + /** + * This method is called only once by the Scene Manager when the Scene is instantiated. + * It is responsible for setting up all of the Scene plugins and references. + * It should never be called directly. + * + * @method Phaser.Scenes.Systems#init + * @protected + * @fires Phaser.Scenes.Events#BOOT + * @since 3.0.0 + * + * @param {Phaser.Game} game - A reference to the Phaser Game instance. + */ + init: function (game) + { + this.settings.status = CONST.INIT; + + // This will get replaced by the SceneManager with the actual update function, if it exists, once create is over. + this.sceneUpdate = NOOP; + + this.game = game; + this.renderer = game.renderer; + + this.canvas = game.canvas; + this.context = game.context; + + var pluginManager = game.plugins; + + this.plugins = pluginManager; + + pluginManager.addToScene(this, DefaultPlugins.Global, [ DefaultPlugins.CoreScene, GetScenePlugins(this), GetPhysicsPlugins(this) ]); + + this.events.emit(Events.BOOT, this); + + this.settings.isBooted = true; + }, + + /** + * Called by a plugin, it tells the System to install the plugin locally. + * + * @method Phaser.Scenes.Systems#install + * @private + * @since 3.0.0 + * + * @param {array} plugin - An array of plugins to install into this Scene. + */ + install: function (plugin) + { + if (!Array.isArray(plugin)) + { + plugin = [ plugin ]; + } + + this.plugins.installLocal(this, plugin); + }, + + /** + * A single game step. Called automatically by the Scene Manager as a result of a Request Animation + * Frame or Set Timeout call to the main Game instance. + * + * @method Phaser.Scenes.Systems#step + * @fires Phaser.Scenes.Events#PRE_UPDATE + * @fires Phaser.Scenes.Events#_UPDATE + * @fires Phaser.Scenes.Events#POST_UPDATE + * @since 3.0.0 + * + * @param {number} time - The time value from the most recent Game step. Typically a high-resolution timer value, or Date.now(). + * @param {number} delta - The delta value since the last frame. This is smoothed to avoid delta spikes by the TimeStep class. + */ + step: function (time, delta) + { + this.events.emit(Events.PRE_UPDATE, time, delta); + + this.events.emit(Events.UPDATE, time, delta); + + this.sceneUpdate.call(this.scene, time, delta); + + this.events.emit(Events.POST_UPDATE, time, delta); + }, + + /** + * Called automatically by the Scene Manager. + * Instructs the Scene to render itself via its Camera Manager to the renderer given. + * + * @method Phaser.Scenes.Systems#render + * @fires Phaser.Scenes.Events#RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that invoked the render call. + */ + render: function (renderer) + { + var displayList = this.displayList; + + displayList.depthSort(); + + this.cameras.render(renderer, displayList); + + this.events.emit(Events.RENDER, renderer); + }, + + /** + * Force a sort of the display list on the next render. + * + * @method Phaser.Scenes.Systems#queueDepthSort + * @since 3.0.0 + */ + queueDepthSort: function () + { + this.displayList.queueDepthSort(); + }, + + /** + * Immediately sorts the display list if the flag is set. + * + * @method Phaser.Scenes.Systems#depthSort + * @since 3.0.0 + */ + depthSort: function () + { + this.displayList.depthSort(); + }, + + /** + * Pause this Scene. + * A paused Scene still renders, it just doesn't run ANY of its update handlers or systems. + * + * @method Phaser.Scenes.Systems#pause + * @fires Phaser.Scenes.Events#PAUSE + * @since 3.0.0 + * + * @param {object} [data] - A data object that will be passed in the 'pause' event. + * + * @return {Phaser.Scenes.Systems} This Systems object. + */ + pause: function (data) + { + if (this.settings.active) + { + this.settings.status = CONST.PAUSED; + + this.settings.active = false; + + this.events.emit(Events.PAUSE, this, data); + } + + return this; + }, + + /** + * Resume this Scene from a paused state. + * + * @method Phaser.Scenes.Systems#resume + * @fires Phaser.Scenes.Events#RESUME + * @since 3.0.0 + * + * @param {object} [data] - A data object that will be passed in the 'resume' event. + * + * @return {Phaser.Scenes.Systems} This Systems object. + */ + resume: function (data) + { + if (!this.settings.active) + { + this.settings.status = CONST.RUNNING; + + this.settings.active = true; + + this.events.emit(Events.RESUME, this, data); + } + + return this; + }, + + /** + * Send this Scene to sleep. + * + * A sleeping Scene doesn't run it's update step or render anything, but it also isn't shut down + * or have any of its systems or children removed, meaning it can be re-activated at any point and + * will carry on from where it left off. It also keeps everything in memory and events and callbacks + * from other Scenes may still invoke changes within it, so be careful what is left active. + * + * @method Phaser.Scenes.Systems#sleep + * @fires Phaser.Scenes.Events#SLEEP + * @since 3.0.0 + * + * @param {object} [data] - A data object that will be passed in the 'sleep' event. + * + * @return {Phaser.Scenes.Systems} This Systems object. + */ + sleep: function (data) + { + this.settings.status = CONST.SLEEPING; + + this.settings.active = false; + this.settings.visible = false; + + this.events.emit(Events.SLEEP, this, data); + + return this; + }, + + /** + * Wake-up this Scene if it was previously asleep. + * + * @method Phaser.Scenes.Systems#wake + * @fires Phaser.Scenes.Events#WAKE + * @since 3.0.0 + * + * @param {object} [data] - A data object that will be passed in the 'wake' event. + * + * @return {Phaser.Scenes.Systems} This Systems object. + */ + wake: function (data) + { + var settings = this.settings; + + settings.status = CONST.RUNNING; + + settings.active = true; + settings.visible = true; + + this.events.emit(Events.WAKE, this, data); + + if (settings.isTransition) + { + this.events.emit(Events.TRANSITION_WAKE, settings.transitionFrom, settings.transitionDuration); + } + + return this; + }, + + /** + * Is this Scene sleeping? + * + * @method Phaser.Scenes.Systems#isSleeping + * @since 3.0.0 + * + * @return {boolean} `true` if this Scene is asleep, otherwise `false`. + */ + isSleeping: function () + { + return (this.settings.status === CONST.SLEEPING); + }, + + /** + * Is this Scene running? + * + * @method Phaser.Scenes.Systems#isActive + * @since 3.0.0 + * + * @return {boolean} `true` if this Scene is running, otherwise `false`. + */ + isActive: function () + { + return (this.settings.status === CONST.RUNNING); + }, + + /** + * Is this Scene paused? + * + * @method Phaser.Scenes.Systems#isPaused + * @since 3.13.0 + * + * @return {boolean} `true` if this Scene is paused, otherwise `false`. + */ + isPaused: function () + { + return (this.settings.status === CONST.PAUSED); + }, + + /** + * Is this Scene currently transitioning out to, or in from another Scene? + * + * @method Phaser.Scenes.Systems#isTransitioning + * @since 3.5.0 + * + * @return {boolean} `true` if this Scene is currently transitioning, otherwise `false`. + */ + isTransitioning: function () + { + return (this.settings.isTransition || this.scenePlugin._target !== null); + }, + + /** + * Is this Scene currently transitioning out from itself to another Scene? + * + * @method Phaser.Scenes.Systems#isTransitionOut + * @since 3.5.0 + * + * @return {boolean} `true` if this Scene is in transition to another Scene, otherwise `false`. + */ + isTransitionOut: function () + { + return (this.scenePlugin._target !== null && this.scenePlugin._duration > 0); + }, + + /** + * Is this Scene currently transitioning in from another Scene? + * + * @method Phaser.Scenes.Systems#isTransitionIn + * @since 3.5.0 + * + * @return {boolean} `true` if this Scene is transitioning in from another Scene, otherwise `false`. + */ + isTransitionIn: function () + { + return (this.settings.isTransition); + }, + + /** + * Is this Scene visible and rendering? + * + * @method Phaser.Scenes.Systems#isVisible + * @since 3.0.0 + * + * @return {boolean} `true` if this Scene is visible, otherwise `false`. + */ + isVisible: function () + { + return this.settings.visible; + }, + + /** + * Sets the visible state of this Scene. + * An invisible Scene will not render, but will still process updates. + * + * @method Phaser.Scenes.Systems#setVisible + * @since 3.0.0 + * + * @param {boolean} value - `true` to render this Scene, otherwise `false`. + * + * @return {Phaser.Scenes.Systems} This Systems object. + */ + setVisible: function (value) + { + this.settings.visible = value; + + return this; + }, + + /** + * Set the active state of this Scene. + * + * An active Scene will run its core update loop. + * + * @method Phaser.Scenes.Systems#setActive + * @since 3.0.0 + * + * @param {boolean} value - If `true` the Scene will be resumed, if previously paused. If `false` it will be paused. + * @param {object} [data] - A data object that will be passed in the 'resume' or 'pause' events. + * + * @return {Phaser.Scenes.Systems} This Systems object. + */ + setActive: function (value, data) + { + if (value) + { + return this.resume(data); + } + else + { + return this.pause(data); + } + }, + + /** + * Start this Scene running and rendering. + * Called automatically by the SceneManager. + * + * @method Phaser.Scenes.Systems#start + * @fires Phaser.Scenes.Events#START + * @fires Phaser.Scenes.Events#READY + * @since 3.0.0 + * + * @param {object} data - Optional data object that may have been passed to this Scene from another. + */ + start: function (data) + { + if (data) + { + this.settings.data = data; + } + + this.settings.status = CONST.START; + + this.settings.active = true; + this.settings.visible = true; + + // For plugins to listen out for + this.events.emit(Events.START, this); + + // For user-land code to listen out for + this.events.emit(Events.READY, this, data); + }, + + /** + * Shutdown this Scene and send a shutdown event to all of its systems. + * A Scene that has been shutdown will not run its update loop or render, but it does + * not destroy any of its plugins or references. It is put into hibernation for later use. + * If you don't ever plan to use this Scene again, then it should be destroyed instead + * to free-up resources. + * + * @method Phaser.Scenes.Systems#shutdown + * @fires Phaser.Scenes.Events#SHUTDOWN + * @since 3.0.0 + * + * @param {object} [data] - A data object that will be passed in the 'shutdown' event. + */ + shutdown: function (data) + { + this.events.off(Events.TRANSITION_INIT); + this.events.off(Events.TRANSITION_START); + this.events.off(Events.TRANSITION_COMPLETE); + this.events.off(Events.TRANSITION_OUT); + + this.settings.status = CONST.SHUTDOWN; + + this.settings.active = false; + this.settings.visible = false; + + this.events.emit(Events.SHUTDOWN, this, data); + }, + + /** + * Destroy this Scene and send a destroy event all of its systems. + * A destroyed Scene cannot be restarted. + * You should not call this directly, instead use `SceneManager.remove`. + * + * @method Phaser.Scenes.Systems#destroy + * @private + * @fires Phaser.Scenes.Events#DESTROY + * @since 3.0.0 + */ + destroy: function () + { + this.settings.status = CONST.DESTROYED; + + this.settings.active = false; + this.settings.visible = false; + + this.events.emit(Events.DESTROY, this); + + this.events.removeAllListeners(); + + var props = [ 'scene', 'game', 'anims', 'cache', 'plugins', 'registry', 'sound', 'textures', 'add', 'camera', 'displayList', 'events', 'make', 'scenePlugin', 'updateList' ]; + + for (var i = 0; i < props.length; i++) + { + this[props[i]] = null; + } + } + +}); + +module.exports = Systems; + + +/***/ }), +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Frame = __webpack_require__(91); +var TextureSource = __webpack_require__(350); + +var TEXTURE_MISSING_ERROR = 'Texture.frame missing: '; + +/** + * @classdesc + * A Texture consists of a source, usually an Image from the Cache, and a collection of Frames. + * The Frames represent the different areas of the Texture. For example a texture atlas + * may have many Frames, one for each element within the atlas. Where-as a single image would have + * just one frame, that encompasses the whole image. + * + * Every Texture, no matter where it comes from, always has at least 1 frame called the `__BASE` frame. + * This frame represents the entirety of the source image. + * + * Textures are managed by the global TextureManager. This is a singleton class that is + * responsible for creating and delivering Textures and their corresponding Frames to Game Objects. + * + * Sprites and other Game Objects get the texture data they need from the TextureManager. + * + * @class Texture + * @memberof Phaser.Textures + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to. + * @param {string} key - The unique string-based key of this Texture. + * @param {(HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[])} source - An array of sources that are used to create the texture. Usually Images, but can also be a Canvas. + * @param {number} [width] - The width of the Texture. This is optional and automatically derived from the source images. + * @param {number} [height] - The height of the Texture. This is optional and automatically derived from the source images. + */ +var Texture = new Class({ + + initialize: + + function Texture (manager, key, source, width, height) + { + if (!Array.isArray(source)) + { + source = [ source ]; + } + + /** + * A reference to the Texture Manager this Texture belongs to. + * + * @name Phaser.Textures.Texture#manager + * @type {Phaser.Textures.TextureManager} + * @since 3.0.0 + */ + this.manager = manager; + + /** + * The unique string-based key of this Texture. + * + * @name Phaser.Textures.Texture#key + * @type {string} + * @since 3.0.0 + */ + this.key = key; + + /** + * An array of TextureSource instances. + * These are unique to this Texture and contain the actual Image (or Canvas) data. + * + * @name Phaser.Textures.Texture#source + * @type {Phaser.Textures.TextureSource[]} + * @since 3.0.0 + */ + this.source = []; + + /** + * An array of TextureSource data instances. + * Used to store additional data images, such as normal maps or specular maps. + * + * @name Phaser.Textures.Texture#dataSource + * @type {array} + * @since 3.0.0 + */ + this.dataSource = []; + + /** + * A key-value object pair associating the unique Frame keys with the Frames objects. + * + * @name Phaser.Textures.Texture#frames + * @type {object} + * @since 3.0.0 + */ + this.frames = {}; + + /** + * Any additional data that was set in the source JSON (if any), + * or any extra data you'd like to store relating to this texture + * + * @name Phaser.Textures.Texture#customData + * @type {object} + * @since 3.0.0 + */ + this.customData = {}; + + /** + * The name of the first frame of the Texture. + * + * @name Phaser.Textures.Texture#firstFrame + * @type {string} + * @since 3.0.0 + */ + this.firstFrame = '__BASE'; + + /** + * The total number of Frames in this Texture, including the `__BASE` frame. + * + * A Texture will always contain at least 1 frame because every Texture contains a `__BASE` frame by default, + * in addition to any extra frames that have been added to it, such as when parsing a Sprite Sheet or Texture Atlas. + * + * @name Phaser.Textures.Texture#frameTotal + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.frameTotal = 0; + + // Load the Sources + for (var i = 0; i < source.length; i++) + { + this.source.push(new TextureSource(this, source[i], width, height)); + } + }, + + /** + * Adds a new Frame to this Texture. + * + * A Frame is a rectangular region of a TextureSource with a unique index or string-based key. + * + * The name given must be unique within this Texture. If it already exists, this method will return `null`. + * + * @method Phaser.Textures.Texture#add + * @since 3.0.0 + * + * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {number} x - The x coordinate of the top-left of this Frame. + * @param {number} y - The y coordinate of the top-left of this Frame. + * @param {number} width - The width of this Frame. + * @param {number} height - The height of this Frame. + * + * @return {?Phaser.Textures.Frame} The Frame that was added to this Texture, or `null` if the given name already exists. + */ + add: function (name, sourceIndex, x, y, width, height) + { + if (this.has(name)) + { + return null; + } + + var frame = new Frame(this, name, sourceIndex, x, y, width, height); + + this.frames[name] = frame; + + // Set the first frame of the Texture (other than __BASE) + // This is used to ensure we don't spam the display with entire + // atlases of sprite sheets, but instead just the first frame of them + // should the dev incorrectly specify the frame index + if (this.firstFrame === '__BASE') + { + this.firstFrame = name; + } + + this.frameTotal++; + + return frame; + }, + + /** + * Checks to see if a Frame matching the given key exists within this Texture. + * + * @method Phaser.Textures.Texture#has + * @since 3.0.0 + * + * @param {string} name - The key of the Frame to check for. + * + * @return {boolean} True if a Frame with the matching key exists in this Texture. + */ + has: function (name) + { + return (this.frames[name]); + }, + + /** + * Gets a Frame from this Texture based on either the key or the index of the Frame. + * + * In a Texture Atlas Frames are typically referenced by a key. + * In a Sprite Sheet Frames are referenced by an index. + * Passing no value for the name returns the base texture. + * + * @method Phaser.Textures.Texture#get + * @since 3.0.0 + * + * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * + * @return {Phaser.Textures.Frame} The Texture Frame. + */ + get: function (name) + { + // null, undefined, empty string, zero + if (!name) + { + name = this.firstFrame; + } + + var frame = this.frames[name]; + + if (!frame) + { + console.warn(TEXTURE_MISSING_ERROR + name); + + frame = this.frames[this.firstFrame]; + } + + return frame; + }, + + /** + * Takes the given TextureSource and returns the index of it within this Texture. + * If it's not in this Texture, it returns -1. + * Unless this Texture has multiple TextureSources, such as with a multi-atlas, this + * method will always return zero or -1. + * + * @method Phaser.Textures.Texture#getTextureSourceIndex + * @since 3.0.0 + * + * @param {Phaser.Textures.TextureSource} source - The TextureSource to check. + * + * @return {integer} The index of the TextureSource within this Texture, or -1 if not in this Texture. + */ + getTextureSourceIndex: function (source) + { + for (var i = 0; i < this.source.length; i++) + { + if (this.source[i] === source) + { + return i; + } + } + + return -1; + }, + + /** + * Returns an array of all the Frames in the given TextureSource. + * + * @method Phaser.Textures.Texture#getFramesFromTextureSource + * @since 3.0.0 + * + * @param {integer} sourceIndex - The index of the TextureSource to get the Frames from. + * @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array? + * + * @return {Phaser.Textures.Frame[]} An array of Texture Frames. + */ + getFramesFromTextureSource: function (sourceIndex, includeBase) + { + if (includeBase === undefined) { includeBase = false; } + + var out = []; + + for (var frameName in this.frames) + { + if (frameName === '__BASE' && !includeBase) + { + continue; + } + + var frame = this.frames[frameName]; + + if (frame.sourceIndex === sourceIndex) + { + out.push(frame); + } + } + + return out; + }, + + /** + * Returns an array with all of the names of the Frames in this Texture. + * + * Useful if you want to randomly assign a Frame to a Game Object, as you can + * pick a random element from the returned array. + * + * @method Phaser.Textures.Texture#getFrameNames + * @since 3.0.0 + * + * @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array? + * + * @return {string[]} An array of all Frame names in this Texture. + */ + getFrameNames: function (includeBase) + { + if (includeBase === undefined) { includeBase = false; } + + var out = Object.keys(this.frames); + + if (!includeBase) + { + var idx = out.indexOf('__BASE'); + + if (idx !== -1) + { + out.splice(idx, 1); + } + } + + return out; + }, + + /** + * Given a Frame name, return the source image it uses to render with. + * + * This will return the actual DOM Image or Canvas element. + * + * @method Phaser.Textures.Texture#getSourceImage + * @since 3.0.0 + * + * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * + * @return {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture)} The DOM Image, Canvas Element or Render Texture. + */ + getSourceImage: function (name) + { + if (name === undefined || name === null || this.frameTotal === 1) + { + name = '__BASE'; + } + + var frame = this.frames[name]; + + if (frame) + { + return frame.source.image; + } + else + { + console.warn(TEXTURE_MISSING_ERROR + name); + + return this.frames['__BASE'].source.image; + } + }, + + /** + * Given a Frame name, return the data source image it uses to render with. + * You can use this to get the normal map for an image for example. + * + * This will return the actual DOM Image. + * + * @method Phaser.Textures.Texture#getDataSourceImage + * @since 3.7.0 + * + * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * + * @return {(HTMLImageElement|HTMLCanvasElement)} The DOM Image or Canvas Element. + */ + getDataSourceImage: function (name) + { + if (name === undefined || name === null || this.frameTotal === 1) + { + name = '__BASE'; + } + + var frame = this.frames[name]; + var idx; + + if (!frame) + { + console.warn(TEXTURE_MISSING_ERROR + name); + + idx = this.frames['__BASE'].sourceIndex; + } + else + { + idx = frame.sourceIndex; + } + + return this.dataSource[idx].image; + }, + + /** + * Adds a data source image to this Texture. + * + * An example of a data source image would be a normal map, where all of the Frames for this Texture + * equally apply to the normal map. + * + * @method Phaser.Textures.Texture#setDataSource + * @since 3.0.0 + * + * @param {(HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[])} data - The source image. + */ + setDataSource: function (data) + { + if (!Array.isArray(data)) + { + data = [ data ]; + } + + for (var i = 0; i < data.length; i++) + { + var source = this.source[i]; + + this.dataSource.push(new TextureSource(this, data[i], source.width, source.height)); + } + }, + + /** + * Sets the Filter Mode for this Texture. + * + * The mode can be either Linear, the default, or Nearest. + * + * For pixel-art you should use Nearest. + * + * The mode applies to the entire Texture, not just a specific Frame of it. + * + * @method Phaser.Textures.Texture#setFilter + * @since 3.0.0 + * + * @param {Phaser.Textures.FilterMode} filterMode - The Filter Mode. + */ + setFilter: function (filterMode) + { + var i; + + for (i = 0; i < this.source.length; i++) + { + this.source[i].setFilter(filterMode); + } + + for (i = 0; i < this.dataSource.length; i++) + { + this.dataSource[i].setFilter(filterMode); + } + }, + + /** + * Destroys this Texture and releases references to its sources and frames. + * + * @method Phaser.Textures.Texture#destroy + * @since 3.0.0 + */ + destroy: function () + { + var i; + + for (i = 0; i < this.source.length; i++) + { + this.source[i].destroy(); + } + + for (i = 0; i < this.dataSource.length; i++) + { + this.dataSource[i].destroy(); + } + + for (var frameName in this.frames) + { + var frame = this.frames[frameName]; + + frame.destroy(); + } + + this.source = []; + this.dataSource = []; + this.frames = {}; + + this.manager.removeKey(this.key); + + this.manager = null; + } + +}); + +module.exports = Texture; + + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.Array + */ + +module.exports = { + + Matrix: __webpack_require__(876), + + Add: __webpack_require__(883), + AddAt: __webpack_require__(884), + BringToTop: __webpack_require__(885), + CountAllMatching: __webpack_require__(886), + Each: __webpack_require__(887), + EachInRange: __webpack_require__(888), + FindClosestInSorted: __webpack_require__(245), + GetAll: __webpack_require__(889), + GetFirst: __webpack_require__(890), + GetRandom: __webpack_require__(180), + MoveDown: __webpack_require__(891), + MoveTo: __webpack_require__(892), + MoveUp: __webpack_require__(893), + NumberArray: __webpack_require__(894), + NumberArrayStep: __webpack_require__(895), + QuickSelect: __webpack_require__(361), + Range: __webpack_require__(362), + Remove: __webpack_require__(120), + RemoveAt: __webpack_require__(896), + RemoveBetween: __webpack_require__(897), + RemoveRandomElement: __webpack_require__(898), + Replace: __webpack_require__(899), + RotateLeft: __webpack_require__(261), + RotateRight: __webpack_require__(262), + SafeRange: __webpack_require__(66), + SendToBack: __webpack_require__(900), + SetAll: __webpack_require__(901), + Shuffle: __webpack_require__(111), + SpliceOne: __webpack_require__(78), + StableSort: __webpack_require__(127), + Swap: __webpack_require__(902) + +}; + + +/***/ }), +/* 179 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if an array can be used as a matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.CheckMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix] + * + * @param {T[][]} [matrix] - The array to check. + * + * @return {boolean} `true` if the given `matrix` array is a valid matrix. + */ +var CheckMatrix = function (matrix) +{ + if (!Array.isArray(matrix) || matrix.length < 2 || !Array.isArray(matrix[0])) + { + return false; + } + + // How long is the first row? + var size = matrix[0].length; + + // Validate the rest of the rows are the same length + for (var i = 1; i < matrix.length; i++) + { + if (matrix[i].length !== size) + { + return false; + } + } + + return true; +}; + +module.exports = CheckMatrix; + + +/***/ }), +/* 180 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns a Random element from the array. + * + * @function Phaser.Utils.Array.GetRandom + * @since 3.0.0 + * + * @param {array} array - The array to select the random entry from. + * @param {integer} [startIndex=0] - An optional start index. + * @param {integer} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * + * @return {*} A random element from the array, or `null` if no element could be found in the range given. + */ +var GetRandom = function (array, startIndex, length) +{ + if (startIndex === undefined) { startIndex = 0; } + if (length === undefined) { length = array.length; } + + var randomIndex = startIndex + Math.floor(Math.random() * length); + + return (array[randomIndex] === undefined) ? null : array[randomIndex]; +}; + +module.exports = GetRandom; + + +/***/ }), +/* 181 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Read an integer value from an XML Node. + * + * @function getValue + * @since 3.0.0 + * @private + * + * @param {Node} node - The XML Node. + * @param {string} attribute - The attribute to read. + * + * @return {integer} The parsed value. + */ +function getValue (node, attribute) +{ + return parseInt(node.getAttribute(attribute), 10); +} + +/** + * Parse an XML font to Bitmap Font data for the Bitmap Font cache. + * + * @function ParseXMLBitmapFont + * @since 3.0.0 + * @private + * + * @param {XMLDocument} xml - The XML Document to parse the font from. + * @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter. + * @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height. + * @param {Phaser.Textures.Frame} [frame] - The texture frame to take into account while parsing. + * + * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} The parsed Bitmap Font data. + */ +var ParseXMLBitmapFont = function (xml, xSpacing, ySpacing, frame) +{ + if (xSpacing === undefined) { xSpacing = 0; } + if (ySpacing === undefined) { ySpacing = 0; } + + var data = {}; + var info = xml.getElementsByTagName('info')[0]; + var common = xml.getElementsByTagName('common')[0]; + + data.font = info.getAttribute('face'); + data.size = getValue(info, 'size'); + data.lineHeight = getValue(common, 'lineHeight') + ySpacing; + data.chars = {}; + + var letters = xml.getElementsByTagName('char'); + + var adjustForTrim = (frame !== undefined && frame.trimmed); + + if (adjustForTrim) + { + var top = frame.height; + var left = frame.width; + } + + for (var i = 0; i < letters.length; i++) + { + var node = letters[i]; + + var charCode = getValue(node, 'id'); + var gx = getValue(node, 'x'); + var gy = getValue(node, 'y'); + var gw = getValue(node, 'width'); + var gh = getValue(node, 'height'); + + // Handle frame trim issues + + if (adjustForTrim) + { + if (gx < left) + { + left = gx; + } + + if (gy < top) + { + top = gy; + } + } + + data.chars[charCode] = + { + x: gx, + y: gy, + width: gw, + height: gh, + centerX: Math.floor(gw / 2), + centerY: Math.floor(gh / 2), + xOffset: getValue(node, 'xoffset'), + yOffset: getValue(node, 'yoffset'), + xAdvance: getValue(node, 'xadvance') + xSpacing, + data: {}, + kerning: {} + }; + } + + if (adjustForTrim && top !== 0 && left !== 0) + { + // console.log('top and left', top, left, frame.x, frame.y); + + // Now we know the top and left coordinates of the glyphs in the original data + // so we can work out how much to adjust the glyphs by + + for (var code in data.chars) + { + var glyph = data.chars[code]; + + glyph.x -= frame.x; + glyph.y -= frame.y; + } + } + + var kernings = xml.getElementsByTagName('kerning'); + + for (i = 0; i < kernings.length; i++) + { + var kern = kernings[i]; + + var first = getValue(kern, 'first'); + var second = getValue(kern, 'second'); + var amount = getValue(kern, 'amount'); + + data.chars[second].kerning[first] = amount; + } + + return data; +}; + +module.exports = ParseXMLBitmapFont; + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlitterRender = __webpack_require__(909); +var Bob = __webpack_require__(912); +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var Frame = __webpack_require__(91); +var GameObject = __webpack_require__(13); +var List = __webpack_require__(125); + +/** + * @callback CreateCallback + * + * @param {Phaser.GameObjects.Bob} bob - The Bob that was created by the Blitter. + * @param {integer} index - The position of the Bob within the Blitter display list. + */ + +/** + * @classdesc + * A Blitter Game Object. + * + * The Blitter Game Object is a special kind of container that creates, updates and manages Bob objects. + * Bobs are designed for rendering speed rather than flexibility. They consist of a texture, or frame from a texture, + * a position and an alpha value. You cannot scale or rotate them. They use a batched drawing method for speed + * during rendering. + * + * A Blitter Game Object has one texture bound to it. Bobs created by the Blitter can use any Frame from this + * Texture to render with, but they cannot use any other Texture. It is this single texture-bind that allows + * them their speed. + * + * If you have a need to blast a large volume of frames around the screen then Blitter objects are well worth + * investigating. They are especially useful for using as a base for your own special effects systems. + * + * @class Blitter + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. + * @param {number} [x=0] - The x coordinate of this Game Object in world space. + * @param {number} [y=0] - The y coordinate of this Game Object in world space. + * @param {string} [texture='__DEFAULT'] - The key of the texture this Game Object will use for rendering. The Texture must already exist in the Texture Manager. + * @param {(string|integer)} [frame=0] - The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. + */ +var Blitter = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.Depth, + Components.Mask, + Components.Pipeline, + Components.ScrollFactor, + Components.Size, + Components.Texture, + Components.Transform, + Components.Visible, + BlitterRender + ], + + initialize: + + function Blitter (scene, x, y, texture, frame) + { + GameObject.call(this, scene, 'Blitter'); + + this.setTexture(texture, frame); + this.setPosition(x, y); + this.initPipeline(); + + /** + * The children of this Blitter. + * This List contains all of the Bob objects created by the Blitter. + * + * @name Phaser.GameObjects.Blitter#children + * @type {Phaser.Structs.List.} + * @since 3.0.0 + */ + this.children = new List(); + + /** + * A transient array that holds all of the Bobs that will be rendered this frame. + * The array is re-populated whenever the dirty flag is set. + * + * @name Phaser.GameObjects.Blitter#renderList + * @type {Phaser.GameObjects.Bob[]} + * @default [] + * @private + * @since 3.0.0 + */ + this.renderList = []; + + /** + * Is the Blitter considered dirty? + * A 'dirty' Blitter has had its child count changed since the last frame. + * + * @name Phaser.GameObjects.Blitter#dirty + * @type {boolean} + * @since 3.0.0 + */ + this.dirty = false; + }, + + /** + * Creates a new Bob in this Blitter. + * + * The Bob is created at the given coordinates, relative to the Blitter and uses the given frame. + * A Bob can use any frame belonging to the texture bound to the Blitter. + * + * @method Phaser.GameObjects.Blitter#create + * @since 3.0.0 + * + * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * @param {boolean} [visible=true] - Should the created Bob render or not? + * @param {integer} [index] - The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. + * + * @return {Phaser.GameObjects.Bob} The newly created Bob object. + */ + create: function (x, y, frame, visible, index) + { + if (visible === undefined) { visible = true; } + if (index === undefined) { index = this.children.length; } + + if (frame === undefined) + { + frame = this.frame; + } + else if (!(frame instanceof Frame)) + { + frame = this.texture.get(frame); + } + + var bob = new Bob(this, x, y, frame, visible); + + this.children.addAt(bob, index, false); + + this.dirty = true; + + return bob; + }, + + /** + * Creates multiple Bob objects within this Blitter and then passes each of them to the specified callback. + * + * @method Phaser.GameObjects.Blitter#createFromCallback + * @since 3.0.0 + * + * @param {CreateCallback} callback - The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob. + * @param {integer} quantity - The quantity of Bob objects to create. + * @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param {boolean} [visible=true] - Should the created Bob render or not? + * + * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that were created. + */ + createFromCallback: function (callback, quantity, frame, visible) + { + var bobs = this.createMultiple(quantity, frame, visible); + + for (var i = 0; i < bobs.length; i++) + { + var bob = bobs[i]; + + callback.call(this, bob, i); + } + + return bobs; + }, + + /** + * Creates multiple Bobs in one call. + * + * The amount created is controlled by a combination of the `quantity` argument and the number of frames provided. + * + * If the quantity is set to 10 and you provide 2 frames, then 20 Bobs will be created. 10 with the first + * frame and 10 with the second. + * + * @method Phaser.GameObjects.Blitter#createMultiple + * @since 3.0.0 + * + * @param {integer} quantity - The quantity of Bob objects to create. + * @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param {boolean} [visible=true] - Should the created Bob render or not? + * + * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that were created. + */ + createMultiple: function (quantity, frame, visible) + { + if (frame === undefined) { frame = this.frame.name; } + if (visible === undefined) { visible = true; } + + if (!Array.isArray(frame)) + { + frame = [ frame ]; + } + + var bobs = []; + var _this = this; + + frame.forEach(function (singleFrame) + { + for (var i = 0; i < quantity; i++) + { + bobs.push(_this.create(0, 0, singleFrame, visible)); + } + }); + + return bobs; + }, + + /** + * Checks if the given child can render or not, by checking its `visible` and `alpha` values. + * + * @method Phaser.GameObjects.Blitter#childCanRender + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Bob} child - The Bob to check for rendering. + * + * @return {boolean} Returns `true` if the given child can render, otherwise `false`. + */ + childCanRender: function (child) + { + return (child.visible && child.alpha > 0); + }, + + /** + * Returns an array of Bobs to be rendered. + * If the Blitter is dirty then a new list is generated and stored in `renderList`. + * + * @method Phaser.GameObjects.Blitter#getRenderList + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that will be rendered this frame. + */ + getRenderList: function () + { + if (this.dirty) + { + this.renderList = this.children.list.filter(this.childCanRender, this); + this.dirty = false; + } + + return this.renderList; + }, + + /** + * Removes all Bobs from the children List and clears the dirty flag. + * + * @method Phaser.GameObjects.Blitter#clear + * @since 3.0.0 + */ + clear: function () + { + this.children.removeAll(); + this.dirty = true; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.Blitter#preDestroy + * @protected + * @since 3.9.0 + */ + preDestroy: function () + { + this.children.destroy(); + + this.renderList = []; + } + +}); + +module.exports = Blitter; + + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArrayUtils = __webpack_require__(178); +var BlendModes = __webpack_require__(52); +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var Events = __webpack_require__(110); +var GameObject = __webpack_require__(13); +var Rectangle = __webpack_require__(10); +var Render = __webpack_require__(913); +var Union = __webpack_require__(364); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Container Game Object. + * + * A Container, as the name implies, can 'contain' other types of Game Object. + * When a Game Object is added to a Container, the Container becomes responsible for the rendering of it. + * By default it will be removed from the Display List and instead added to the Containers own internal list. + * + * The position of the Game Object automatically becomes relative to the position of the Container. + * + * When the Container is rendered, all of its children are rendered as well, in the order in which they exist + * within the Container. Container children can be repositioned using methods such as `MoveUp`, `MoveDown` and `SendToBack`. + * + * If you modify a transform property of the Container, such as `Container.x` or `Container.rotation` then it will + * automatically influence all children as well. + * + * Containers can include other Containers for deeply nested transforms. + * + * Containers can have masks set on them and can be used as a mask too. However, Container children cannot be masked. + * The masks do not 'stack up'. Only a Container on the root of the display list will use its mask. + * + * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them + * to use as their hit area. Container children can also be enabled for input, independent of the Container. + * + * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, + * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, + * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children + * with physics do not factor in the Container due to the excessive extra calculations needed. Please structure + * your game to work around this. + * + * It's important to understand the impact of using Containers. They add additional processing overhead into + * every one of their children. The deeper you nest them, the more the cost escalates. This is especially true + * for input events. You also loose the ability to set the display depth of Container children in the same + * flexible manner as those not within them. In short, don't use them for the sake of it. You pay a small cost + * every time you create one, try to structure your game around avoiding that where possible. + * + * @class Container + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.4.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.ComputedSize + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Container. + */ +var Container = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.ComputedSize, + Components.Depth, + Components.Mask, + Components.Transform, + Components.Visible, + Render + ], + + initialize: + + function Container (scene, x, y, children) + { + GameObject.call(this, scene, 'Container'); + + /** + * An array holding the children of this Container. + * + * @name Phaser.GameObjects.Container#list + * @type {Phaser.GameObjects.GameObject[]} + * @since 3.4.0 + */ + this.list = []; + + /** + * Does this Container exclusively manage its children? + * + * The default is `true` which means a child added to this Container cannot + * belong in another Container, which includes the Scene display list. + * + * If you disable this then this Container will no longer exclusively manage its children. + * This allows you to create all kinds of interesting graphical effects, such as replicating + * Game Objects without reparenting them all over the Scene. + * However, doing so will prevent children from receiving any kind of input event or have + * their physics bodies work by default, as they're no longer a single entity on the + * display list, but are being replicated where-ever this Container is. + * + * @name Phaser.GameObjects.Container#exclusive + * @type {boolean} + * @default true + * @since 3.4.0 + */ + this.exclusive = true; + + /** + * Containers can have an optional maximum size. If set to anything above 0 it + * will constrict the addition of new Game Objects into the Container, capping off + * the maximum limit the Container can grow in size to. + * + * @name Phaser.GameObjects.Container#maxSize + * @type {integer} + * @default -1 + * @since 3.4.0 + */ + this.maxSize = -1; + + /** + * The cursor position. + * + * @name Phaser.GameObjects.Container#position + * @type {integer} + * @since 3.4.0 + */ + this.position = 0; + + /** + * Internal Transform Matrix used for local space conversion. + * + * @name Phaser.GameObjects.Container#localTransform + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.4.0 + */ + this.localTransform = new Components.TransformMatrix(); + + /** + * Internal temporary Transform Matrix used to avoid object creation. + * + * @name Phaser.GameObjects.Container#tempTransformMatrix + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @private + * @since 3.4.0 + */ + this.tempTransformMatrix = new Components.TransformMatrix(); + + /** + * A reference to the Scene Display List. + * + * @name Phaser.GameObjects.Container#_displayList + * @type {Phaser.GameObjects.DisplayList} + * @private + * @since 3.4.0 + */ + this._displayList = scene.sys.displayList; + + /** + * The property key to sort by. + * + * @name Phaser.GameObjects.Container#_sortKey + * @type {string} + * @private + * @since 3.4.0 + */ + this._sortKey = ''; + + /** + * A reference to the Scene Systems Event Emitter. + * + * @name Phaser.GameObjects.Container#_sysEvents + * @type {Phaser.Events.EventEmitter} + * @private + * @since 3.9.0 + */ + this._sysEvents = scene.sys.events; + + /** + * The horizontal scroll factor of this Container. + * + * The scroll factor controls the influence of the movement of a Camera upon this Container. + * + * When a camera scrolls it will change the location at which this Container is rendered on-screen. + * It does not change the Containers actual position values. + * + * For a Container, setting this value will only update the Container itself, not its children. + * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Container. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Container#scrollFactorX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.scrollFactorX = 1; + + /** + * The vertical scroll factor of this Container. + * + * The scroll factor controls the influence of the movement of a Camera upon this Container. + * + * When a camera scrolls it will change the location at which this Container is rendered on-screen. + * It does not change the Containers actual position values. + * + * For a Container, setting this value will only update the Container itself, not its children. + * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Container. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Container#scrollFactorY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.scrollFactorY = 1; + + this.setPosition(x, y); + + this.clearAlpha(); + + this.setBlendMode(BlendModes.SKIP_CHECK); + + if (children) + { + this.add(children); + } + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#originX + * @type {number} + * @readonly + * @since 3.4.0 + */ + originX: { + + get: function () + { + return 0.5; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#originY + * @type {number} + * @readonly + * @since 3.4.0 + */ + originY: { + + get: function () + { + return 0.5; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#displayOriginX + * @type {number} + * @readonly + * @since 3.4.0 + */ + displayOriginX: { + + get: function () + { + return this.width * 0.5; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#displayOriginY + * @type {number} + * @readonly + * @since 3.4.0 + */ + displayOriginY: { + + get: function () + { + return this.height * 0.5; + } + + }, + + /** + * Does this Container exclusively manage its children? + * + * The default is `true` which means a child added to this Container cannot + * belong in another Container, which includes the Scene display list. + * + * If you disable this then this Container will no longer exclusively manage its children. + * This allows you to create all kinds of interesting graphical effects, such as replicating + * Game Objects without reparenting them all over the Scene. + * However, doing so will prevent children from receiving any kind of input event or have + * their physics bodies work by default, as they're no longer a single entity on the + * display list, but are being replicated where-ever this Container is. + * + * @method Phaser.GameObjects.Container#setExclusive + * @since 3.4.0 + * + * @param {boolean} [value=true] - The exclusive state of this Container. + * + * @return {Phaser.GameObjects.Container} This Container. + */ + setExclusive: function (value) + { + if (value === undefined) { value = true; } + + this.exclusive = value; + + return this; + }, + + /** + * Gets the bounds of this Container. It works by iterating all children of the Container, + * getting their respective bounds, and then working out a min-max rectangle from that. + * It does not factor in if the children render or not, all are included. + * + * Some children are unable to return their bounds, such as Graphics objects, in which case + * they are skipped. + * + * Depending on the quantity of children in this Container it could be a really expensive call, + * so cache it and only poll it as needed. + * + * The values are stored and returned in a Rectangle object. + * + * @method Phaser.GameObjects.Container#getBounds + * @since 3.4.0 + * + * @param {Phaser.Geom.Rectangle} [output] - A Geom.Rectangle object to store the values in. If not provided a new Rectangle will be created. + * + * @return {Phaser.Geom.Rectangle} The values stored in the output object. + */ + getBounds: function (output) + { + if (output === undefined) { output = new Rectangle(); } + + output.setTo(this.x, this.y, 0, 0); + + if (this.list.length > 0) + { + var children = this.list; + var tempRect = new Rectangle(); + + for (var i = 0; i < children.length; i++) + { + var entry = children[i]; + + if (entry.getBounds) + { + entry.getBounds(tempRect); + + Union(tempRect, output, output); + } + } + } + + return output; + }, + + /** + * Internal add handler. + * + * @method Phaser.GameObjects.Container#addHandler + * @private + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just added to this Container. + */ + addHandler: function (gameObject) + { + gameObject.once(Events.DESTROY, this.remove, this); + + if (this.exclusive) + { + this._displayList.remove(gameObject); + + if (gameObject.parentContainer) + { + gameObject.parentContainer.remove(gameObject); + } + + gameObject.parentContainer = this; + } + }, + + /** + * Internal remove handler. + * + * @method Phaser.GameObjects.Container#removeHandler + * @private + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just removed from this Container. + */ + removeHandler: function (gameObject) + { + gameObject.off(Events.DESTROY, this.remove); + + if (this.exclusive) + { + gameObject.parentContainer = null; + } + }, + + /** + * Takes a Point-like object, such as a Vector2, Geom.Point or object with public x and y properties, + * and transforms it into the space of this Container, then returns it in the output object. + * + * @method Phaser.GameObjects.Container#pointToContainer + * @since 3.4.0 + * + * @param {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} source - The Source Point to be transformed. + * @param {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} [output] - A destination object to store the transformed point in. If none given a Vector2 will be created and returned. + * + * @return {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} The transformed point. + */ + pointToContainer: function (source, output) + { + if (output === undefined) { output = new Vector2(); } + + if (this.parentContainer) + { + return this.parentContainer.pointToContainer(source, output); + } + + var tempMatrix = this.tempTransformMatrix; + + // No need to loadIdentity because applyITRS overwrites every value anyway + tempMatrix.applyITRS(this.x, this.y, this.rotation, this.scaleX, this.scaleY); + + tempMatrix.invert(); + + tempMatrix.transformPoint(source.x, source.y, output); + + return output; + }, + + /** + * Returns the world transform matrix as used for Bounds checks. + * + * The returned matrix is temporal and shouldn't be stored. + * + * @method Phaser.GameObjects.Container#getBoundsTransformMatrix + * @since 3.4.0 + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The world transform matrix. + */ + getBoundsTransformMatrix: function () + { + return this.getWorldTransformMatrix(this.tempTransformMatrix, this.localTransform); + }, + + /** + * Adds the given Game Object, or array of Game Objects, to this Container. + * + * Each Game Object must be unique within the Container. + * + * @method Phaser.GameObjects.Container#add + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + add: function (child) + { + ArrayUtils.Add(this.list, child, this.maxSize, this.addHandler, this); + + return this; + }, + + /** + * Adds the given Game Object, or array of Game Objects, to this Container at the specified position. + * + * Existing Game Objects in the Container are shifted up. + * + * Each Game Object must be unique within the Container. + * + * @method Phaser.GameObjects.Container#addAt + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container. + * @param {integer} [index=0] - The position to insert the Game Object/s at. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + addAt: function (child, index) + { + ArrayUtils.AddAt(this.list, child, index, this.maxSize, this.addHandler, this); + + return this; + }, + + /** + * Returns the Game Object at the given position in this Container. + * + * @method Phaser.GameObjects.Container#getAt + * @since 3.4.0 + * + * @param {integer} index - The position to get the Game Object from. + * + * @return {?Phaser.GameObjects.GameObject} The Game Object at the specified index, or `null` if none found. + */ + getAt: function (index) + { + return this.list[index]; + }, + + /** + * Returns the index of the given Game Object in this Container. + * + * @method Phaser.GameObjects.Container#getIndex + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to search for in this Container. + * + * @return {integer} The index of the Game Object in this Container, or -1 if not found. + */ + getIndex: function (child) + { + return this.list.indexOf(child); + }, + + /** + * Sort the contents of this Container so the items are in order based on the given property. + * For example: `sort('alpha')` would sort the elements based on the value of their `alpha` property. + * + * @method Phaser.GameObjects.Container#sort + * @since 3.4.0 + * + * @param {string} property - The property to lexically sort by. + * @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + sort: function (property, handler) + { + if (!property) + { + return this; + } + + if (handler === undefined) + { + handler = function (childA, childB) + { + return childA[property] - childB[property]; + }; + } + + ArrayUtils.StableSort.inplace(this.list, handler); + + return this; + }, + + /** + * Searches for the first instance of a child with its `name` property matching the given argument. + * Should more than one child have the same name only the first is returned. + * + * @method Phaser.GameObjects.Container#getByName + * @since 3.4.0 + * + * @param {string} name - The name to search for. + * + * @return {?Phaser.GameObjects.GameObject} The first child with a matching name, or `null` if none were found. + */ + getByName: function (name) + { + return ArrayUtils.GetFirst(this.list, 'name', name); + }, + + /** + * Returns a random Game Object from this Container. + * + * @method Phaser.GameObjects.Container#getRandom + * @since 3.4.0 + * + * @param {integer} [startIndex=0] - An optional start index. + * @param {integer} [length] - An optional length, the total number of elements (from the startIndex) to choose from. + * + * @return {?Phaser.GameObjects.GameObject} A random child from the Container, or `null` if the Container is empty. + */ + getRandom: function (startIndex, length) + { + return ArrayUtils.GetRandom(this.list, startIndex, length); + }, + + /** + * Gets the first Game Object in this Container. + * + * You can also specify a property and value to search for, in which case it will return the first + * Game Object in this Container with a matching property and / or value. + * + * For example: `getFirst('visible', true)` would return the first Game Object that had its `visible` property set. + * + * You can limit the search to the `startIndex` - `endIndex` range. + * + * @method Phaser.GameObjects.Container#getFirst + * @since 3.4.0 + * + * @param {string} property - The property to test on each Game Object in the Container. + * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {integer} [startIndex=0] - An optional start index to search from. + * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * + * @return {?Phaser.GameObjects.GameObject} The first matching Game Object, or `null` if none was found. + */ + getFirst: function (property, value, startIndex, endIndex) + { + return ArrayUtils.GetFirst(this.list, property, value, startIndex, endIndex); + }, + + /** + * Returns all Game Objects in this Container. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('body')` would return only Game Objects that have a body property. + * + * You can also specify a value to compare the property to: + * + * `getAll('visible', true)` would return only Game Objects that have their visible property set to `true`. + * + * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 Game Objects. + * + * @method Phaser.GameObjects.Container#getAll + * @since 3.4.0 + * + * @param {string} [property] - The property to test on each Game Object in the Container. + * @param {any} [value] - If property is set then the `property` must strictly equal this value to be included in the results. + * @param {integer} [startIndex=0] - An optional start index to search from. + * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * + * @return {Phaser.GameObjects.GameObject[]} An array of matching Game Objects from this Container. + */ + getAll: function (property, value, startIndex, endIndex) + { + return ArrayUtils.GetAll(this.list, property, value, startIndex, endIndex); + }, + + /** + * Returns the total number of Game Objects in this Container that have a property + * matching the given value. + * + * For example: `count('visible', true)` would count all the elements that have their visible property set. + * + * You can optionally limit the operation to the `startIndex` - `endIndex` range. + * + * @method Phaser.GameObjects.Container#count + * @since 3.4.0 + * + * @param {string} property - The property to check. + * @param {any} value - The value to check. + * @param {integer} [startIndex=0] - An optional start index to search from. + * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * + * @return {integer} The total number of Game Objects in this Container with a property matching the given value. + */ + count: function (property, value, startIndex, endIndex) + { + return ArrayUtils.CountAllMatching(this.list, property, value, startIndex, endIndex); + }, + + /** + * Swaps the position of two Game Objects in this Container. + * Both Game Objects must belong to this Container. + * + * @method Phaser.GameObjects.Container#swap + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} child1 - The first Game Object to swap. + * @param {Phaser.GameObjects.GameObject} child2 - The second Game Object to swap. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + swap: function (child1, child2) + { + ArrayUtils.Swap(this.list, child1, child2); + + return this; + }, + + /** + * Moves a Game Object to a new position within this Container. + * + * The Game Object must already be a child of this Container. + * + * The Game Object is removed from its old position and inserted into the new one. + * Therefore the Container size does not change. Other children will change position accordingly. + * + * @method Phaser.GameObjects.Container#moveTo + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to move. + * @param {integer} index - The new position of the Game Object in this Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + moveTo: function (child, index) + { + ArrayUtils.MoveTo(this.list, child, index); + + return this; + }, + + /** + * Removes the given Game Object, or array of Game Objects, from this Container. + * + * The Game Objects must already be children of this Container. + * + * You can also optionally call `destroy` on each Game Object that is removed from the Container. + * + * @method Phaser.GameObjects.Container#remove + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to be removed from the Container. + * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each child successfully removed from this Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + remove: function (child, destroyChild) + { + var removed = ArrayUtils.Remove(this.list, child, this.removeHandler, this); + + if (destroyChild && removed) + { + if (!Array.isArray(removed)) + { + removed = [ removed ]; + } + + for (var i = 0; i < removed.length; i++) + { + removed[i].destroy(); + } + } + + return this; + }, + + /** + * Removes the Game Object at the given position in this Container. + * + * You can also optionally call `destroy` on the Game Object, if one is found. + * + * @method Phaser.GameObjects.Container#removeAt + * @since 3.4.0 + * + * @param {integer} index - The index of the Game Object to be removed. + * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + removeAt: function (index, destroyChild) + { + var removed = ArrayUtils.RemoveAt(this.list, index, this.removeHandler, this); + + if (destroyChild && removed) + { + removed.destroy(); + } + + return this; + }, + + /** + * Removes the Game Objects between the given positions in this Container. + * + * You can also optionally call `destroy` on each Game Object that is removed from the Container. + * + * @method Phaser.GameObjects.Container#removeBetween + * @since 3.4.0 + * + * @param {integer} [startIndex=0] - An optional start index to search from. + * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + removeBetween: function (startIndex, endIndex, destroyChild) + { + var removed = ArrayUtils.RemoveBetween(this.list, startIndex, endIndex, this.removeHandler, this); + + if (destroyChild) + { + for (var i = 0; i < removed.length; i++) + { + removed[i].destroy(); + } + } + + return this; + }, + + /** + * Removes all Game Objects from this Container. + * + * You can also optionally call `destroy` on each Game Object that is removed from the Container. + * + * @method Phaser.GameObjects.Container#removeAll + * @since 3.4.0 + * + * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + removeAll: function (destroyChild) + { + var removed = ArrayUtils.RemoveBetween(this.list, 0, this.list.length, this.removeHandler, this); + + if (destroyChild) + { + for (var i = 0; i < removed.length; i++) + { + removed[i].destroy(); + } + } + + return this; + }, + + /** + * Brings the given Game Object to the top of this Container. + * This will cause it to render on-top of any other objects in the Container. + * + * @method Phaser.GameObjects.Container#bringToTop + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to bring to the top of the Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + bringToTop: function (child) + { + ArrayUtils.BringToTop(this.list, child); + + return this; + }, + + /** + * Sends the given Game Object to the bottom of this Container. + * This will cause it to render below any other objects in the Container. + * + * @method Phaser.GameObjects.Container#sendToBack + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to send to the bottom of the Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + sendToBack: function (child) + { + ArrayUtils.SendToBack(this.list, child); + + return this; + }, + + /** + * Moves the given Game Object up one place in this Container, unless it's already at the top. + * + * @method Phaser.GameObjects.Container#moveUp + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to be moved in the Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + moveUp: function (child) + { + ArrayUtils.MoveUp(this.list, child); + + return this; + }, + + /** + * Moves the given Game Object down one place in this Container, unless it's already at the bottom. + * + * @method Phaser.GameObjects.Container#moveDown + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to be moved in the Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + moveDown: function (child) + { + ArrayUtils.MoveDown(this.list, child); + + return this; + }, + + /** + * Reverses the order of all Game Objects in this Container. + * + * @method Phaser.GameObjects.Container#reverse + * @since 3.4.0 + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + reverse: function () + { + this.list.reverse(); + + return this; + }, + + /** + * Shuffles the all Game Objects in this Container using the Fisher-Yates implementation. + * + * @method Phaser.GameObjects.Container#shuffle + * @since 3.4.0 + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + shuffle: function () + { + ArrayUtils.Shuffle(this.list); + + return this; + }, + + /** + * Replaces a Game Object in this Container with the new Game Object. + * The new Game Object cannot already be a child of this Container. + * + * @method Phaser.GameObjects.Container#replace + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} oldChild - The Game Object in this Container that will be replaced. + * @param {Phaser.GameObjects.GameObject} newChild - The Game Object to be added to this Container. + * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + replace: function (oldChild, newChild, destroyChild) + { + var moved = ArrayUtils.Replace(this.list, oldChild, newChild); + + if (moved) + { + this.addHandler(newChild); + this.removeHandler(oldChild); + + if (destroyChild) + { + oldChild.destroy(); + } + } + + return this; + }, + + /** + * Returns `true` if the given Game Object is a direct child of this Container. + * + * This check does not scan nested Containers. + * + * @method Phaser.GameObjects.Container#exists + * @since 3.4.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to check for within this Container. + * + * @return {boolean} True if the Game Object is an immediate child of this Container, otherwise false. + */ + exists: function (child) + { + return (this.list.indexOf(child) > -1); + }, + + /** + * Sets the property to the given value on all Game Objects in this Container. + * + * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 Game Objects. + * + * @method Phaser.GameObjects.Container#setAll + * @since 3.4.0 + * + * @param {string} property - The property that must exist on the Game Object. + * @param {any} value - The value to get the property to. + * @param {integer} [startIndex=0] - An optional start index to search from. + * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + setAll: function (property, value, startIndex, endIndex) + { + ArrayUtils.SetAll(this.list, property, value, startIndex, endIndex); + + return this; + }, + + /** + * @callback EachContainerCallback + * @generic I - [item] + * + * @param {*} item - The child Game Object of the Container. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + */ + + /** + * Passes all Game Objects in this Container to the given callback. + * + * A copy of the Container is made before passing each entry to your callback. + * This protects against the callback itself modifying the Container. + * + * If you know for sure that the callback will not change the size of this Container + * then you can use the more performant `Container.iterate` method instead. + * + * @method Phaser.GameObjects.Container#each + * @since 3.4.0 + * + * @param {function} callback - The function to call. + * @param {object} [context] - Value to use as `this` when executing callback. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + each: function (callback, context) + { + var args = [ null ]; + var i; + var temp = this.list.slice(); + var len = temp.length; + + for (i = 2; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = 0; i < len; i++) + { + args[0] = temp[i]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Passes all Game Objects in this Container to the given callback. + * + * Only use this method when you absolutely know that the Container will not be modified during + * the iteration, i.e. by removing or adding to its contents. + * + * @method Phaser.GameObjects.Container#iterate + * @since 3.4.0 + * + * @param {function} callback - The function to call. + * @param {object} [context] - Value to use as `this` when executing callback. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + * + * @return {Phaser.GameObjects.Container} This Container instance. + */ + iterate: function (callback, context) + { + var args = [ null ]; + var i; + + for (i = 2; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = 0; i < this.list.length; i++) + { + args[0] = this.list[i]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Sets the scroll factor of this Container and optionally all of its children. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @method Phaser.GameObjects.Container#setScrollFactor + * @since 3.0.0 + * + * @param {number} x - The horizontal scroll factor of this Game Object. + * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. + * @param {boolean} [updateChildren=false] - Apply this scrollFactor to all Container children as well? + * + * @return {this} This Game Object instance. + */ + setScrollFactor: function (x, y, updateChildren) + { + if (y === undefined) { y = x; } + if (updateChildren === undefined) { updateChildren = false; } + + this.scrollFactorX = x; + this.scrollFactorY = y; + + if (updateChildren) + { + ArrayUtils.SetAll(this.list, 'scrollFactorX', x); + ArrayUtils.SetAll(this.list, 'scrollFactorY', y); + } + + return this; + }, + + /** + * The number of Game Objects inside this Container. + * + * @name Phaser.GameObjects.Container#length + * @type {integer} + * @readonly + * @since 3.4.0 + */ + length: { + + get: function () + { + return this.list.length; + } + + }, + + /** + * Returns the first Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + * + * @name Phaser.GameObjects.Container#first + * @type {?Phaser.GameObjects.GameObject} + * @readonly + * @since 3.4.0 + */ + first: { + + get: function () + { + this.position = 0; + + if (this.list.length > 0) + { + return this.list[0]; + } + else + { + return null; + } + } + + }, + + /** + * Returns the last Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + * + * @name Phaser.GameObjects.Container#last + * @type {?Phaser.GameObjects.GameObject} + * @readonly + * @since 3.4.0 + */ + last: { + + get: function () + { + if (this.list.length > 0) + { + this.position = this.list.length - 1; + + return this.list[this.position]; + } + else + { + return null; + } + } + + }, + + /** + * Returns the next Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + * + * @name Phaser.GameObjects.Container#next + * @type {?Phaser.GameObjects.GameObject} + * @readonly + * @since 3.4.0 + */ + next: { + + get: function () + { + if (this.position < this.list.length) + { + this.position++; + + return this.list[this.position]; + } + else + { + return null; + } + } + + }, + + /** + * Returns the previous Game Object within the Container, or `null` if it is empty. + * + * You can move the cursor by calling `Container.next` and `Container.previous`. + * + * @name Phaser.GameObjects.Container#previous + * @type {?Phaser.GameObjects.GameObject} + * @readonly + * @since 3.4.0 + */ + previous: { + + get: function () + { + if (this.position > 0) + { + this.position--; + + return this.list[this.position]; + } + else + { + return null; + } + } + + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.Container#preDestroy + * @protected + * @since 3.9.0 + */ + preDestroy: function () + { + this.removeAll(!!this.exclusive); + + this.localTransform.destroy(); + this.tempTransformMatrix.destroy(); + + this.list = []; + this._displayList = null; + } + +}); + +module.exports = Container; + + +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BitmapText = __webpack_require__(128); +var Class = __webpack_require__(0); +var Render = __webpack_require__(918); + +/** + * @classdesc + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * Dynamic Bitmap Text objects are different from Static Bitmap Text in that they invoke a callback for each + * letter being rendered during the render pass. This callback allows you to manipulate the properties of + * each letter being rendered, such as its position, scale or tint, allowing you to create interesting effects + * like jiggling text, which can't be done with Static text. This means that Dynamic Text takes more processing + * time, so only use them if you require the callback ability they have. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + * + * @class DynamicBitmapText + * @extends Phaser.GameObjects.BitmapText + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. + * @param {number} x - The x coordinate of this Game Object in world space. + * @param {number} y - The y coordinate of this Game Object in world space. + * @param {string} font - The key of the font to use from the Bitmap Font cache. + * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. + * @param {number} [size] - The font size of this Bitmap Text. + * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + */ +var DynamicBitmapText = new Class({ + + Extends: BitmapText, + + Mixins: [ + Render + ], + + initialize: + + function DynamicBitmapText (scene, x, y, font, text, size, align) + { + BitmapText.call(this, scene, x, y, font, text, size, align); + + this.type = 'DynamicBitmapText'; + + /** + * The horizontal scroll position of the Bitmap Text. + * + * @name Phaser.GameObjects.DynamicBitmapText#scrollX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.scrollX = 0; + + /** + * The vertical scroll position of the Bitmap Text. + * + * @name Phaser.GameObjects.DynamicBitmapText#scrollY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.scrollY = 0; + + /** + * The crop width of the Bitmap Text. + * + * @name Phaser.GameObjects.DynamicBitmapText#cropWidth + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.cropWidth = 0; + + /** + * The crop height of the Bitmap Text. + * + * @name Phaser.GameObjects.DynamicBitmapText#cropHeight + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.cropHeight = 0; + + /** + * A callback that alters how each character of the Bitmap Text is rendered. + * + * @name Phaser.GameObjects.DynamicBitmapText#displayCallback + * @type {Phaser.Types.GameObjects.BitmapText.DisplayCallback} + * @since 3.0.0 + */ + this.displayCallback; + + /** + * The data object that is populated during rendering, then passed to the displayCallback. + * You should modify this object then return it back from the callback. It's updated values + * will be used to render the specific glyph. + * + * Please note that if you need a reference to this object locally in your game code then you + * should shallow copy it, as it's updated and re-used for every glyph in the text. + * + * @name Phaser.GameObjects.DynamicBitmapText#callbackData + * @type {Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig} + * @since 3.11.0 + */ + this.callbackData = { + parent: this, + color: 0, + tint: { + topLeft: 0, + topRight: 0, + bottomLeft: 0, + bottomRight: 0 + }, + index: 0, + charCode: 0, + x: 0, + y: 0, + scale: 0, + rotation: 0, + data: 0 + }; + }, + + /** + * Set the crop size of this Bitmap Text. + * + * @method Phaser.GameObjects.DynamicBitmapText#setSize + * @since 3.0.0 + * + * @param {number} width - The width of the crop. + * @param {number} height - The height of the crop. + * + * @return {Phaser.GameObjects.DynamicBitmapText} This Game Object. + */ + setSize: function (width, height) + { + this.cropWidth = width; + this.cropHeight = height; + + return this; + }, + + /** + * Set a callback that alters how each character of the Bitmap Text is rendered. + * + * The callback receives a {@link Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig} object that contains information about the character that's + * about to be rendered. + * + * It should return an object with `x`, `y`, `scale` and `rotation` properties that will be used instead of the + * usual values when rendering. + * + * @method Phaser.GameObjects.DynamicBitmapText#setDisplayCallback + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.BitmapText.DisplayCallback} callback - The display callback to set. + * + * @return {Phaser.GameObjects.DynamicBitmapText} This Game Object. + */ + setDisplayCallback: function (callback) + { + this.displayCallback = callback; + + return this; + }, + + /** + * Set the horizontal scroll position of this Bitmap Text. + * + * @method Phaser.GameObjects.DynamicBitmapText#setScrollX + * @since 3.0.0 + * + * @param {number} value - The horizontal scroll position to set. + * + * @return {Phaser.GameObjects.DynamicBitmapText} This Game Object. + */ + setScrollX: function (value) + { + this.scrollX = value; + + return this; + }, + + /** + * Set the vertical scroll position of this Bitmap Text. + * + * @method Phaser.GameObjects.DynamicBitmapText#setScrollY + * @since 3.0.0 + * + * @param {number} value - The vertical scroll position to set. + * + * @return {Phaser.GameObjects.DynamicBitmapText} This Game Object. + */ + setScrollY: function (value) + { + this.scrollY = value; + + return this; + } + +}); + +module.exports = DynamicBitmapText; + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseCamera = __webpack_require__(112); +var Class = __webpack_require__(0); +var Commands = __webpack_require__(186); +var ComponentsAlpha = __webpack_require__(244); +var ComponentsBlendMode = __webpack_require__(247); +var ComponentsDepth = __webpack_require__(248); +var ComponentsMask = __webpack_require__(252); +var ComponentsPipeline = __webpack_require__(151); +var ComponentsTransform = __webpack_require__(257); +var ComponentsVisible = __webpack_require__(258); +var ComponentsScrollFactor = __webpack_require__(255); + +var TransformMatrix = __webpack_require__(32); + +var Ellipse = __webpack_require__(92); +var GameObject = __webpack_require__(13); +var GetFastValue = __webpack_require__(2); +var GetValue = __webpack_require__(6); +var MATH_CONST = __webpack_require__(23); +var Render = __webpack_require__(924); + +/** + * @classdesc + * A Graphics object is a way to draw primitive shapes to your game. Primitives include forms of geometry, such as + * Rectangles, Circles, and Polygons. They also include lines, arcs and curves. When you initially create a Graphics + * object it will be empty. + * + * To draw to it you must first specify a line style or fill style (or both), draw shapes using paths, and finally + * fill or stroke them. For example: + * + * ```javascript + * graphics.lineStyle(5, 0xFF00FF, 1.0); + * graphics.beginPath(); + * graphics.moveTo(100, 100); + * graphics.lineTo(200, 200); + * graphics.closePath(); + * graphics.strokePath(); + * ``` + * + * There are also many helpful methods that draw and fill/stroke common shapes for you. + * + * ```javascript + * graphics.lineStyle(5, 0xFF00FF, 1.0); + * graphics.fillStyle(0xFFFFFF, 1.0); + * graphics.fillRect(50, 50, 400, 200); + * graphics.strokeRect(50, 50, 400, 200); + * ``` + * + * When a Graphics object is rendered it will render differently based on if the game is running under Canvas or WebGL. + * Under Canvas it will use the HTML Canvas context drawing operations to draw the path. + * Under WebGL the graphics data is decomposed into polygons. Both of these are expensive processes, especially with + * complex shapes. + * + * If your Graphics object doesn't change much (or at all) once you've drawn your shape to it, then you will help + * performance by calling {@link Phaser.GameObjects.Graphics#generateTexture}. This will 'bake' the Graphics object into + * a Texture, and return it. You can then use this Texture for Sprites or other display objects. If your Graphics object + * updates frequently then you should avoid doing this, as it will constantly generate new textures, which will consume + * memory. + * + * As you can tell, Graphics objects are a bit of a trade-off. While they are extremely useful, you need to be careful + * in their complexity and quantity of them in your game. + * + * @class Graphics + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * @extends Phaser.GameObjects.Components.ScrollFactor + * + * @param {Phaser.Scene} scene - The Scene to which this Graphics object belongs. + * @param {Phaser.Types.GameObjects.Graphics.Options} [options] - Options that set the position and default style of this Graphics object. + */ +var Graphics = new Class({ + + Extends: GameObject, + + Mixins: [ + ComponentsAlpha, + ComponentsBlendMode, + ComponentsDepth, + ComponentsMask, + ComponentsPipeline, + ComponentsTransform, + ComponentsVisible, + ComponentsScrollFactor, + Render + ], + + initialize: + + function Graphics (scene, options) + { + var x = GetValue(options, 'x', 0); + var y = GetValue(options, 'y', 0); + + GameObject.call(this, scene, 'Graphics'); + + this.setPosition(x, y); + this.initPipeline(); + + /** + * The horizontal display origin of the Graphics. + * + * @name Phaser.GameObjects.Graphics#displayOriginX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.displayOriginX = 0; + + /** + * The vertical display origin of the Graphics. + * + * @name Phaser.GameObjects.Graphics#displayOriginY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.displayOriginY = 0; + + /** + * The array of commands used to render the Graphics. + * + * @name Phaser.GameObjects.Graphics#commandBuffer + * @type {array} + * @default [] + * @since 3.0.0 + */ + this.commandBuffer = []; + + /** + * The default fill color for shapes rendered by this Graphics object. + * + * @name Phaser.GameObjects.Graphics#defaultFillColor + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.defaultFillColor = -1; + + /** + * The default fill alpha for shapes rendered by this Graphics object. + * + * @name Phaser.GameObjects.Graphics#defaultFillAlpha + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.defaultFillAlpha = 1; + + /** + * The default stroke width for shapes rendered by this Graphics object. + * + * @name Phaser.GameObjects.Graphics#defaultStrokeWidth + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.defaultStrokeWidth = 1; + + /** + * The default stroke color for shapes rendered by this Graphics object. + * + * @name Phaser.GameObjects.Graphics#defaultStrokeColor + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.defaultStrokeColor = -1; + + /** + * The default stroke alpha for shapes rendered by this Graphics object. + * + * @name Phaser.GameObjects.Graphics#defaultStrokeAlpha + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.defaultStrokeAlpha = 1; + + /** + * Internal property that keeps track of the line width style setting. + * + * @name Phaser.GameObjects.Graphics#_lineWidth + * @type {number} + * @private + * @since 3.0.0 + */ + this._lineWidth = 1.0; + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.GameObjects.Graphics#_tempMatrix1 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.17.0 + */ + this._tempMatrix1 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.GameObjects.Graphics#_tempMatrix2 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.17.0 + */ + this._tempMatrix2 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.GameObjects.Graphics#_tempMatrix3 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.17.0 + */ + this._tempMatrix3 = new TransformMatrix(); + + this.setDefaultStyles(options); + }, + + /** + * Set the default style settings for this Graphics object. + * + * @method Phaser.GameObjects.Graphics#setDefaultStyles + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Graphics.Styles} options - The styles to set as defaults. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + setDefaultStyles: function (options) + { + if (GetValue(options, 'lineStyle', null)) + { + this.defaultStrokeWidth = GetValue(options, 'lineStyle.width', 1); + this.defaultStrokeColor = GetValue(options, 'lineStyle.color', 0xffffff); + this.defaultStrokeAlpha = GetValue(options, 'lineStyle.alpha', 1); + + this.lineStyle(this.defaultStrokeWidth, this.defaultStrokeColor, this.defaultStrokeAlpha); + } + + if (GetValue(options, 'fillStyle', null)) + { + this.defaultFillColor = GetValue(options, 'fillStyle.color', 0xffffff); + this.defaultFillAlpha = GetValue(options, 'fillStyle.alpha', 1); + + this.fillStyle(this.defaultFillColor, this.defaultFillAlpha); + } + + return this; + }, + + /** + * Set the current line style. + * + * @method Phaser.GameObjects.Graphics#lineStyle + * @since 3.0.0 + * + * @param {number} lineWidth - The stroke width. + * @param {number} color - The stroke color. + * @param {number} [alpha=1] - The stroke alpha. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + lineStyle: function (lineWidth, color, alpha) + { + if (alpha === undefined) { alpha = 1; } + + this.commandBuffer.push( + Commands.LINE_STYLE, + lineWidth, color, alpha + ); + + this._lineWidth = lineWidth; + + return this; + }, + + /** + * Set the current fill style. + * + * @method Phaser.GameObjects.Graphics#fillStyle + * @since 3.0.0 + * + * @param {number} color - The fill color. + * @param {number} [alpha=1] - The fill alpha. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillStyle: function (color, alpha) + { + if (alpha === undefined) { alpha = 1; } + + this.commandBuffer.push( + Commands.FILL_STYLE, + color, alpha + ); + + return this; + }, + + /** + * Sets a gradient fill style. This is a WebGL only feature. + * + * The gradient color values represent the 4 corners of an untransformed rectangle. + * The gradient is used to color all filled shapes and paths drawn after calling this method. + * If you wish to turn a gradient off, call `fillStyle` and provide a new single fill color. + * + * When filling a triangle only the first 3 color values provided are used for the 3 points of a triangle. + * + * This feature is best used only on rectangles and triangles. All other shapes will give strange results. + * + * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used + * will be filled with a gradient on its own. There is no ability to gradient fill a shape or path as a single + * entity at this time. + * + * @method Phaser.GameObjects.Graphics#fillGradientStyle + * @webglOnly + * @since 3.12.0 + * + * @param {integer} topLeft - The tint being applied to the top-left of the Game Object. + * @param {integer} topRight - The tint being applied to the top-right of the Game Object. + * @param {integer} bottomLeft - The tint being applied to the bottom-left of the Game Object. + * @param {integer} bottomRight - The tint being applied to the bottom-right of the Game Object. + * @param {number} [alpha=1] - The fill alpha. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillGradientStyle: function (topLeft, topRight, bottomLeft, bottomRight, alpha) + { + if (alpha === undefined) { alpha = 1; } + + this.commandBuffer.push( + Commands.GRADIENT_FILL_STYLE, + alpha, topLeft, topRight, bottomLeft, bottomRight + ); + + return this; + }, + + /** + * Sets a gradient line style. This is a WebGL only feature. + * + * The gradient color values represent the 4 corners of an untransformed rectangle. + * The gradient is used to color all stroked shapes and paths drawn after calling this method. + * If you wish to turn a gradient off, call `lineStyle` and provide a new single line color. + * + * This feature is best used only on single lines. All other shapes will give strange results. + * + * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used + * will be filled with a gradient on its own. There is no ability to gradient stroke a shape or path as a single + * entity at this time. + * + * @method Phaser.GameObjects.Graphics#lineGradientStyle + * @webglOnly + * @since 3.12.0 + * + * @param {number} lineWidth - The stroke width. + * @param {integer} topLeft - The tint being applied to the top-left of the Game Object. + * @param {integer} topRight - The tint being applied to the top-right of the Game Object. + * @param {integer} bottomLeft - The tint being applied to the bottom-left of the Game Object. + * @param {integer} bottomRight - The tint being applied to the bottom-right of the Game Object. + * @param {number} [alpha=1] - The fill alpha. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + lineGradientStyle: function (lineWidth, topLeft, topRight, bottomLeft, bottomRight, alpha) + { + if (alpha === undefined) { alpha = 1; } + + this.commandBuffer.push( + Commands.GRADIENT_LINE_STYLE, + lineWidth, alpha, topLeft, topRight, bottomLeft, bottomRight + ); + + return this; + }, + + /** + * Sets the texture frame this Graphics Object will use when drawing all shapes defined after calling this. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * Once set, all shapes will use this texture. Call this method with no arguments to clear it. + * + * The textures are not tiled. They are stretched to the dimensions of the shapes being rendered. For this reason, + * it works best with seamless / tileable textures. + * + * The mode argument controls how the textures are combined with the fill colors. The default value (0) will + * multiply the texture by the fill color. A value of 1 will use just the fill color, but the alpha data from the texture, + * and a value of 2 will use just the texture and no fill color at all. + * + * @method Phaser.GameObjects.Graphics#setTexture + * @since 3.12.0 + * @webglOnly + * + * @param {string} [key] - The key of the texture to be used, as stored in the Texture Manager. Leave blank to clear a previously set texture. + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {number} [mode=0] - The texture tint mode. 0 is multiply, 1 is alpha only and 2 is texture only. + * + * @return {this} This Game Object. + */ + setTexture: function (key, frame, mode) + { + if (mode === undefined) { mode = 0; } + + if (key === undefined) + { + this.commandBuffer.push( + Commands.CLEAR_TEXTURE + ); + } + else + { + var textureFrame = this.scene.sys.textures.getFrame(key, frame); + + if (textureFrame) + { + if (mode === 2) + { + mode = 3; + } + + this.commandBuffer.push( + Commands.SET_TEXTURE, + textureFrame, + mode + ); + } + } + + return this; + }, + + /** + * Start a new shape path. + * + * @method Phaser.GameObjects.Graphics#beginPath + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + beginPath: function () + { + this.commandBuffer.push( + Commands.BEGIN_PATH + ); + + return this; + }, + + /** + * Close the current path. + * + * @method Phaser.GameObjects.Graphics#closePath + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + closePath: function () + { + this.commandBuffer.push( + Commands.CLOSE_PATH + ); + + return this; + }, + + /** + * Fill the current path. + * + * @method Phaser.GameObjects.Graphics#fillPath + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillPath: function () + { + this.commandBuffer.push( + Commands.FILL_PATH + ); + + return this; + }, + + /** + * Fill the current path. + * + * This is an alias for `Graphics.fillPath` and does the same thing. + * It was added to match the CanvasRenderingContext 2D API. + * + * @method Phaser.GameObjects.Graphics#fill + * @since 3.16.0 + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fill: function () + { + this.commandBuffer.push( + Commands.FILL_PATH + ); + + return this; + }, + + /** + * Stroke the current path. + * + * @method Phaser.GameObjects.Graphics#strokePath + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokePath: function () + { + this.commandBuffer.push( + Commands.STROKE_PATH + ); + + return this; + }, + + /** + * Stroke the current path. + * + * This is an alias for `Graphics.strokePath` and does the same thing. + * It was added to match the CanvasRenderingContext 2D API. + * + * @method Phaser.GameObjects.Graphics#stroke + * @since 3.16.0 + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + stroke: function () + { + this.commandBuffer.push( + Commands.STROKE_PATH + ); + + return this; + }, + + /** + * Fill the given circle. + * + * @method Phaser.GameObjects.Graphics#fillCircleShape + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The circle to fill. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillCircleShape: function (circle) + { + return this.fillCircle(circle.x, circle.y, circle.radius); + }, + + /** + * Stroke the given circle. + * + * @method Phaser.GameObjects.Graphics#strokeCircleShape + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The circle to stroke. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokeCircleShape: function (circle) + { + return this.strokeCircle(circle.x, circle.y, circle.radius); + }, + + /** + * Fill a circle with the given position and radius. + * + * @method Phaser.GameObjects.Graphics#fillCircle + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the center of the circle. + * @param {number} y - The y coordinate of the center of the circle. + * @param {number} radius - The radius of the circle. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillCircle: function (x, y, radius) + { + this.beginPath(); + this.arc(x, y, radius, 0, MATH_CONST.PI2); + this.fillPath(); + + return this; + }, + + /** + * Stroke a circle with the given position and radius. + * + * @method Phaser.GameObjects.Graphics#strokeCircle + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the center of the circle. + * @param {number} y - The y coordinate of the center of the circle. + * @param {number} radius - The radius of the circle. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokeCircle: function (x, y, radius) + { + this.beginPath(); + this.arc(x, y, radius, 0, MATH_CONST.PI2); + this.strokePath(); + + return this; + }, + + /** + * Fill the given rectangle. + * + * @method Phaser.GameObjects.Graphics#fillRectShape + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The rectangle to fill. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillRectShape: function (rect) + { + return this.fillRect(rect.x, rect.y, rect.width, rect.height); + }, + + /** + * Stroke the given rectangle. + * + * @method Phaser.GameObjects.Graphics#strokeRectShape + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The rectangle to stroke. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokeRectShape: function (rect) + { + return this.strokeRect(rect.x, rect.y, rect.width, rect.height); + }, + + /** + * Fill a rectangle with the given position and size. + * + * @method Phaser.GameObjects.Graphics#fillRect + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the top-left of the rectangle. + * @param {number} y - The y coordinate of the top-left of the rectangle. + * @param {number} width - The width of the rectangle. + * @param {number} height - The height of the rectangle. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillRect: function (x, y, width, height) + { + this.commandBuffer.push( + Commands.FILL_RECT, + x, y, width, height + ); + + return this; + }, + + /** + * Stroke a rectangle with the given position and size. + * + * @method Phaser.GameObjects.Graphics#strokeRect + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the top-left of the rectangle. + * @param {number} y - The y coordinate of the top-left of the rectangle. + * @param {number} width - The width of the rectangle. + * @param {number} height - The height of the rectangle. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokeRect: function (x, y, width, height) + { + var lineWidthHalf = this._lineWidth / 2; + var minx = x - lineWidthHalf; + var maxx = x + lineWidthHalf; + + this.beginPath(); + this.moveTo(x, y); + this.lineTo(x, y + height); + this.strokePath(); + + this.beginPath(); + this.moveTo(x + width, y); + this.lineTo(x + width, y + height); + this.strokePath(); + + this.beginPath(); + this.moveTo(minx, y); + this.lineTo(maxx + width, y); + this.strokePath(); + + this.beginPath(); + this.moveTo(minx, y + height); + this.lineTo(maxx + width, y + height); + this.strokePath(); + + return this; + }, + + /** + * Fill a rounded rectangle with the given position, size and radius. + * + * @method Phaser.GameObjects.Graphics#fillRoundedRect + * @since 3.11.0 + * + * @param {number} x - The x coordinate of the top-left of the rectangle. + * @param {number} y - The y coordinate of the top-left of the rectangle. + * @param {number} width - The width of the rectangle. + * @param {number} height - The height of the rectangle. + * @param {(Phaser.Types.GameObjects.Graphics.RoundedRectRadius|number)} [radius=20] - The corner radius; It can also be an object to specify different radii for corners. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillRoundedRect: function (x, y, width, height, radius) + { + if (radius === undefined) { radius = 20; } + + var tl = radius; + var tr = radius; + var bl = radius; + var br = radius; + + if (typeof radius !== 'number') + { + tl = GetFastValue(radius, 'tl', 20); + tr = GetFastValue(radius, 'tr', 20); + bl = GetFastValue(radius, 'bl', 20); + br = GetFastValue(radius, 'br', 20); + } + + this.beginPath(); + this.moveTo(x + tl, y); + this.lineTo(x + width - tr, y); + this.arc(x + width - tr, y + tr, tr, -MATH_CONST.TAU, 0); + this.lineTo(x + width, y + height - br); + this.arc(x + width - br, y + height - br, br, 0, MATH_CONST.TAU); + this.lineTo(x + bl, y + height); + this.arc(x + bl, y + height - bl, bl, MATH_CONST.TAU, Math.PI); + this.lineTo(x, y + tl); + this.arc(x + tl, y + tl, tl, -Math.PI, -MATH_CONST.TAU); + this.fillPath(); + + return this; + }, + + /** + * Stroke a rounded rectangle with the given position, size and radius. + * + * @method Phaser.GameObjects.Graphics#strokeRoundedRect + * @since 3.11.0 + * + * @param {number} x - The x coordinate of the top-left of the rectangle. + * @param {number} y - The y coordinate of the top-left of the rectangle. + * @param {number} width - The width of the rectangle. + * @param {number} height - The height of the rectangle. + * @param {(Phaser.Types.GameObjects.Graphics.RoundedRectRadius|number)} [radius=20] - The corner radius; It can also be an object to specify different radii for corners. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokeRoundedRect: function (x, y, width, height, radius) + { + if (radius === undefined) { radius = 20; } + + var tl = radius; + var tr = radius; + var bl = radius; + var br = radius; + + if (typeof radius !== 'number') + { + tl = GetFastValue(radius, 'tl', 20); + tr = GetFastValue(radius, 'tr', 20); + bl = GetFastValue(radius, 'bl', 20); + br = GetFastValue(radius, 'br', 20); + } + + this.beginPath(); + this.moveTo(x + tl, y); + this.lineTo(x + width - tr, y); + this.arc(x + width - tr, y + tr, tr, -MATH_CONST.TAU, 0); + this.lineTo(x + width, y + height - br); + this.arc(x + width - br, y + height - br, br, 0, MATH_CONST.TAU); + this.lineTo(x + bl, y + height); + this.arc(x + bl, y + height - bl, bl, MATH_CONST.TAU, Math.PI); + this.lineTo(x, y + tl); + this.arc(x + tl, y + tl, tl, -Math.PI, -MATH_CONST.TAU); + this.strokePath(); + + return this; + }, + + /** + * Fill the given point. + * + * Draws a square at the given position, 1 pixel in size by default. + * + * @method Phaser.GameObjects.Graphics#fillPointShape + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The point to fill. + * @param {number} [size=1] - The size of the square to draw. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillPointShape: function (point, size) + { + return this.fillPoint(point.x, point.y, size); + }, + + /** + * Fill a point at the given position. + * + * Draws a square at the given position, 1 pixel in size by default. + * + * @method Phaser.GameObjects.Graphics#fillPoint + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the point. + * @param {number} y - The y coordinate of the point. + * @param {number} [size=1] - The size of the square to draw. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillPoint: function (x, y, size) + { + if (!size || size < 1) + { + size = 1; + } + else + { + x -= (size / 2); + y -= (size / 2); + } + + this.commandBuffer.push( + Commands.FILL_RECT, + x, y, size, size + ); + + return this; + }, + + /** + * Fill the given triangle. + * + * @method Phaser.GameObjects.Graphics#fillTriangleShape + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The triangle to fill. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillTriangleShape: function (triangle) + { + return this.fillTriangle(triangle.x1, triangle.y1, triangle.x2, triangle.y2, triangle.x3, triangle.y3); + }, + + /** + * Stroke the given triangle. + * + * @method Phaser.GameObjects.Graphics#strokeTriangleShape + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The triangle to stroke. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokeTriangleShape: function (triangle) + { + return this.strokeTriangle(triangle.x1, triangle.y1, triangle.x2, triangle.y2, triangle.x3, triangle.y3); + }, + + /** + * Fill a triangle with the given points. + * + * @method Phaser.GameObjects.Graphics#fillTriangle + * @since 3.0.0 + * + * @param {number} x0 - The x coordinate of the first point. + * @param {number} y0 - The y coordinate of the first point. + * @param {number} x1 - The x coordinate of the second point. + * @param {number} y1 - The y coordinate of the second point. + * @param {number} x2 - The x coordinate of the third point. + * @param {number} y2 - The y coordinate of the third point. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillTriangle: function (x0, y0, x1, y1, x2, y2) + { + this.commandBuffer.push( + Commands.FILL_TRIANGLE, + x0, y0, x1, y1, x2, y2 + ); + + return this; + }, + + /** + * Stroke a triangle with the given points. + * + * @method Phaser.GameObjects.Graphics#strokeTriangle + * @since 3.0.0 + * + * @param {number} x0 - The x coordinate of the first point. + * @param {number} y0 - The y coordinate of the first point. + * @param {number} x1 - The x coordinate of the second point. + * @param {number} y1 - The y coordinate of the second point. + * @param {number} x2 - The x coordinate of the third point. + * @param {number} y2 - The y coordinate of the third point. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokeTriangle: function (x0, y0, x1, y1, x2, y2) + { + this.commandBuffer.push( + Commands.STROKE_TRIANGLE, + x0, y0, x1, y1, x2, y2 + ); + + return this; + }, + + /** + * Draw the given line. + * + * @method Phaser.GameObjects.Graphics#strokeLineShape + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to stroke. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokeLineShape: function (line) + { + return this.lineBetween(line.x1, line.y1, line.x2, line.y2); + }, + + /** + * Draw a line between the given points. + * + * @method Phaser.GameObjects.Graphics#lineBetween + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the start point of the line. + * @param {number} y1 - The y coordinate of the start point of the line. + * @param {number} x2 - The x coordinate of the end point of the line. + * @param {number} y2 - The y coordinate of the end point of the line. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + lineBetween: function (x1, y1, x2, y2) + { + this.beginPath(); + this.moveTo(x1, y1); + this.lineTo(x2, y2); + this.strokePath(); + + return this; + }, + + /** + * Draw a line from the current drawing position to the given position. + * + * Moves the current drawing position to the given position. + * + * @method Phaser.GameObjects.Graphics#lineTo + * @since 3.0.0 + * + * @param {number} x - The x coordinate to draw the line to. + * @param {number} y - The y coordinate to draw the line to. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + lineTo: function (x, y) + { + this.commandBuffer.push( + Commands.LINE_TO, + x, y + ); + + return this; + }, + + /** + * Move the current drawing position to the given position. + * + * @method Phaser.GameObjects.Graphics#moveTo + * @since 3.0.0 + * + * @param {number} x - The x coordinate to move to. + * @param {number} y - The y coordinate to move to. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + moveTo: function (x, y) + { + this.commandBuffer.push( + Commands.MOVE_TO, + x, y + ); + + return this; + }, + + /** + * Stroke the shape represented by the given array of points. + * + * Pass `closeShape` to automatically close the shape by joining the last to the first point. + * + * Pass `closePath` to automatically close the path before it is stroked. + * + * @method Phaser.GameObjects.Graphics#strokePoints + * @since 3.0.0 + * + * @param {(array|Phaser.Geom.Point[])} points - The points to stroke. + * @param {boolean} [closeShape=false] - When `true`, the shape is closed by joining the last point to the first point. + * @param {boolean} [closePath=false] - When `true`, the path is closed before being stroked. + * @param {integer} [endIndex] - The index of `points` to stop drawing at. Defaults to `points.length`. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokePoints: function (points, closeShape, closePath, endIndex) + { + if (closeShape === undefined) { closeShape = false; } + if (closePath === undefined) { closePath = false; } + if (endIndex === undefined) { endIndex = points.length; } + + this.beginPath(); + + this.moveTo(points[0].x, points[0].y); + + for (var i = 1; i < endIndex; i++) + { + this.lineTo(points[i].x, points[i].y); + } + + if (closeShape) + { + this.lineTo(points[0].x, points[0].y); + } + + if (closePath) + { + this.closePath(); + } + + this.strokePath(); + + return this; + }, + + /** + * Fill the shape represented by the given array of points. + * + * Pass `closeShape` to automatically close the shape by joining the last to the first point. + * + * Pass `closePath` to automatically close the path before it is filled. + * + * @method Phaser.GameObjects.Graphics#fillPoints + * @since 3.0.0 + * + * @param {(array|Phaser.Geom.Point[])} points - The points to fill. + * @param {boolean} [closeShape=false] - When `true`, the shape is closed by joining the last point to the first point. + * @param {boolean} [closePath=false] - When `true`, the path is closed before being stroked. + * @param {integer} [endIndex] - The index of `points` to stop at. Defaults to `points.length`. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillPoints: function (points, closeShape, closePath, endIndex) + { + if (closeShape === undefined) { closeShape = false; } + if (closePath === undefined) { closePath = false; } + if (endIndex === undefined) { endIndex = points.length; } + + this.beginPath(); + + this.moveTo(points[0].x, points[0].y); + + for (var i = 1; i < endIndex; i++) + { + this.lineTo(points[i].x, points[i].y); + } + + if (closeShape) + { + this.lineTo(points[0].x, points[0].y); + } + + if (closePath) + { + this.closePath(); + } + + this.fillPath(); + + return this; + }, + + /** + * Stroke the given ellipse. + * + * @method Phaser.GameObjects.Graphics#strokeEllipseShape + * @since 3.0.0 + * + * @param {Phaser.Geom.Ellipse} ellipse - The ellipse to stroke. + * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokeEllipseShape: function (ellipse, smoothness) + { + if (smoothness === undefined) { smoothness = 32; } + + var points = ellipse.getPoints(smoothness); + + return this.strokePoints(points, true); + }, + + /** + * Stroke an ellipse with the given position and size. + * + * @method Phaser.GameObjects.Graphics#strokeEllipse + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the center of the ellipse. + * @param {number} y - The y coordinate of the center of the ellipse. + * @param {number} width - The width of the ellipse. + * @param {number} height - The height of the ellipse. + * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + strokeEllipse: function (x, y, width, height, smoothness) + { + if (smoothness === undefined) { smoothness = 32; } + + var ellipse = new Ellipse(x, y, width, height); + + var points = ellipse.getPoints(smoothness); + + return this.strokePoints(points, true); + }, + + /** + * Fill the given ellipse. + * + * @method Phaser.GameObjects.Graphics#fillEllipseShape + * @since 3.0.0 + * + * @param {Phaser.Geom.Ellipse} ellipse - The ellipse to fill. + * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillEllipseShape: function (ellipse, smoothness) + { + if (smoothness === undefined) { smoothness = 32; } + + var points = ellipse.getPoints(smoothness); + + return this.fillPoints(points, true); + }, + + /** + * Fill an ellipse with the given position and size. + * + * @method Phaser.GameObjects.Graphics#fillEllipse + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the center of the ellipse. + * @param {number} y - The y coordinate of the center of the ellipse. + * @param {number} width - The width of the ellipse. + * @param {number} height - The height of the ellipse. + * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + fillEllipse: function (x, y, width, height, smoothness) + { + if (smoothness === undefined) { smoothness = 32; } + + var ellipse = new Ellipse(x, y, width, height); + + var points = ellipse.getPoints(smoothness); + + return this.fillPoints(points, true); + }, + + /** + * Draw an arc. + * + * This method can be used to create circles, or parts of circles. + * + * Make sure you call `beginPath` before starting the arc unless you wish for the arc to automatically + * close when filled or stroked. + * + * Use the optional `overshoot` argument increase the number of iterations that take place when + * the arc is rendered in WebGL. This is useful if you're drawing an arc with an especially thick line, + * as it will allow the arc to fully join-up. Try small values at first, i.e. 0.01. + * + * Call {@link Phaser.GameObjects.Graphics#fillPath} or {@link Phaser.GameObjects.Graphics#strokePath} after calling + * this method to draw the arc. + * + * @method Phaser.GameObjects.Graphics#arc + * @since 3.0.0 + * + * @param {number} x - The x coordinate of the center of the circle. + * @param {number} y - The y coordinate of the center of the circle. + * @param {number} radius - The radius of the circle. + * @param {number} startAngle - The starting angle, in radians. + * @param {number} endAngle - The ending angle, in radians. + * @param {boolean} [anticlockwise=false] - Whether the drawing should be anticlockwise or clockwise. + * @param {number} [overshoot=0] - This value allows you to increase the segment iterations in WebGL rendering. Useful if the arc has a thick stroke and needs to overshoot to join-up cleanly. Use small numbers such as 0.01 to start with and increase as needed. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + arc: function (x, y, radius, startAngle, endAngle, anticlockwise, overshoot) + { + if (anticlockwise === undefined) { anticlockwise = false; } + if (overshoot === undefined) { overshoot = 0; } + + this.commandBuffer.push( + Commands.ARC, + x, y, radius, startAngle, endAngle, anticlockwise, overshoot + ); + + return this; + }, + + /** + * Creates a pie-chart slice shape centered at `x`, `y` with the given radius. + * You must define the start and end angle of the slice. + * + * Setting the `anticlockwise` argument to `true` creates a shape similar to Pacman. + * Setting it to `false` creates a shape like a slice of pie. + * + * This method will begin a new path and close the path at the end of it. + * To display the actual slice you need to call either `strokePath` or `fillPath` after it. + * + * @method Phaser.GameObjects.Graphics#slice + * @since 3.4.0 + * + * @param {number} x - The horizontal center of the slice. + * @param {number} y - The vertical center of the slice. + * @param {number} radius - The radius of the slice. + * @param {number} startAngle - The start angle of the slice, given in radians. + * @param {number} endAngle - The end angle of the slice, given in radians. + * @param {boolean} [anticlockwise=false] - Whether the drawing should be anticlockwise or clockwise. + * @param {number} [overshoot=0] - This value allows you to overshoot the endAngle by this amount. Useful if the arc has a thick stroke and needs to overshoot to join-up cleanly. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + slice: function (x, y, radius, startAngle, endAngle, anticlockwise, overshoot) + { + if (anticlockwise === undefined) { anticlockwise = false; } + if (overshoot === undefined) { overshoot = 0; } + + this.commandBuffer.push(Commands.BEGIN_PATH); + + this.commandBuffer.push(Commands.MOVE_TO, x, y); + + this.commandBuffer.push(Commands.ARC, x, y, radius, startAngle, endAngle, anticlockwise, overshoot); + + this.commandBuffer.push(Commands.CLOSE_PATH); + + return this; + }, + + /** + * Saves the state of the Graphics by pushing the current state onto a stack. + * + * The most recently saved state can then be restored with {@link Phaser.GameObjects.Graphics#restore}. + * + * @method Phaser.GameObjects.Graphics#save + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + save: function () + { + this.commandBuffer.push( + Commands.SAVE + ); + + return this; + }, + + /** + * Restores the most recently saved state of the Graphics by popping from the state stack. + * + * Use {@link Phaser.GameObjects.Graphics#save} to save the current state, and call this afterwards to restore that state. + * + * If there is no saved state, this command does nothing. + * + * @method Phaser.GameObjects.Graphics#restore + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + restore: function () + { + this.commandBuffer.push( + Commands.RESTORE + ); + + return this; + }, + + /** + * Inserts a translation command into this Graphics objects command buffer. + * + * All objects drawn _after_ calling this method will be translated + * by the given amount. + * + * This does not change the position of the Graphics object itself, + * only of the objects drawn by it after calling this method. + * + * @method Phaser.GameObjects.Graphics#translateCanvas + * @since 3.0.0 + * + * @param {number} x - The horizontal translation to apply. + * @param {number} y - The vertical translation to apply. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + translateCanvas: function (x, y) + { + this.commandBuffer.push( + Commands.TRANSLATE, + x, y + ); + + return this; + }, + + /** + * Inserts a scale command into this Graphics objects command buffer. + * + * All objects drawn _after_ calling this method will be scaled + * by the given amount. + * + * This does not change the scale of the Graphics object itself, + * only of the objects drawn by it after calling this method. + * + * @method Phaser.GameObjects.Graphics#scaleCanvas + * @since 3.0.0 + * + * @param {number} x - The horizontal scale to apply. + * @param {number} y - The vertical scale to apply. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + scaleCanvas: function (x, y) + { + this.commandBuffer.push( + Commands.SCALE, + x, y + ); + + return this; + }, + + /** + * Inserts a rotation command into this Graphics objects command buffer. + * + * All objects drawn _after_ calling this method will be rotated + * by the given amount. + * + * This does not change the rotation of the Graphics object itself, + * only of the objects drawn by it after calling this method. + * + * @method Phaser.GameObjects.Graphics#rotateCanvas + * @since 3.0.0 + * + * @param {number} radians - The rotation angle, in radians. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + rotateCanvas: function (radians) + { + this.commandBuffer.push( + Commands.ROTATE, + radians + ); + + return this; + }, + + /** + * Clear the command buffer and reset the fill style and line style to their defaults. + * + * @method Phaser.GameObjects.Graphics#clear + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + clear: function () + { + this.commandBuffer.length = 0; + + if (this.defaultFillColor > -1) + { + this.fillStyle(this.defaultFillColor, this.defaultFillAlpha); + } + + if (this.defaultStrokeColor > -1) + { + this.lineStyle(this.defaultStrokeWidth, this.defaultStrokeColor, this.defaultStrokeAlpha); + } + + return this; + }, + + /** + * Generate a texture from this Graphics object. + * + * If `key` is a string it'll generate a new texture using it and add it into the + * Texture Manager (assuming no key conflict happens). + * + * If `key` is a Canvas it will draw the texture to that canvas context. Note that it will NOT + * automatically upload it to the GPU in WebGL mode. + * + * @method Phaser.GameObjects.Graphics#generateTexture + * @since 3.0.0 + * + * @param {(string|HTMLCanvasElement)} key - The key to store the texture with in the Texture Manager, or a Canvas to draw to. + * @param {integer} [width] - The width of the graphics to generate. + * @param {integer} [height] - The height of the graphics to generate. + * + * @return {Phaser.GameObjects.Graphics} This Game Object. + */ + generateTexture: function (key, width, height) + { + var sys = this.scene.sys; + var renderer = sys.game.renderer; + + if (width === undefined) { width = sys.scale.width; } + if (height === undefined) { height = sys.scale.height; } + + Graphics.TargetCamera.setScene(this.scene); + Graphics.TargetCamera.setViewport(0, 0, width, height); + Graphics.TargetCamera.scrollX = this.x; + Graphics.TargetCamera.scrollY = this.y; + + var texture; + var ctx; + + if (typeof key === 'string') + { + if (sys.textures.exists(key)) + { + // Key is a string, it DOES exist in the Texture Manager AND is a canvas, so draw to it + + texture = sys.textures.get(key); + + var src = texture.getSourceImage(); + + if (src instanceof HTMLCanvasElement) + { + ctx = src.getContext('2d'); + } + } + else + { + // Key is a string and doesn't exist in the Texture Manager, so generate and save it + + texture = sys.textures.createCanvas(key, width, height); + + ctx = texture.getSourceImage().getContext('2d'); + } + } + else if (key instanceof HTMLCanvasElement) + { + // Key is a Canvas, so draw to it + + ctx = key.getContext('2d'); + } + + if (ctx) + { + // var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip) + this.renderCanvas(renderer, this, 0, Graphics.TargetCamera, null, ctx, false); + + if (texture) + { + texture.refresh(); + } + } + + return this; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.Graphics#preDestroy + * @protected + * @since 3.9.0 + */ + preDestroy: function () + { + this.commandBuffer = []; + } + +}); + +/** + * A Camera used specifically by the Graphics system for rendering to textures. + * + * @name Phaser.GameObjects.Graphics.TargetCamera + * @type {Phaser.Cameras.Scene2D.Camera} + * @since 3.1.0 + */ +Graphics.TargetCamera = new BaseCamera(); + +module.exports = Graphics; + + +/***/ }), +/* 186 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +module.exports = { + + ARC: 0, + BEGIN_PATH: 1, + CLOSE_PATH: 2, + FILL_RECT: 3, + LINE_TO: 4, + MOVE_TO: 5, + LINE_STYLE: 6, + FILL_STYLE: 7, + FILL_PATH: 8, + STROKE_PATH: 9, + FILL_TRIANGLE: 10, + STROKE_TRIANGLE: 11, + SAVE: 14, + RESTORE: 15, + TRANSLATE: 16, + SCALE: 17, + ROTATE: 18, + SET_TEXTURE: 19, + CLEAR_TEXTURE: 20, + GRADIENT_FILL_STYLE: 21, + GRADIENT_LINE_STYLE: 22 + +}; + + +/***/ }), +/* 187 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse based on the given angle. + * + * @function Phaser.Geom.Ellipse.CircumferencePoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference point on. + * @param {number} angle - The angle from the center of the Ellipse to the circumference to return the point from. Given in radians. + * @param {(Phaser.Geom.Point|object)} [out] - A Point, or point-like object, to store the results in. If not given a Point will be created. + * + * @return {(Phaser.Geom.Point|object)} A Point object where the `x` and `y` properties are the point on the circumference. + */ +var CircumferencePoint = function (ellipse, angle, out) +{ + if (out === undefined) { out = new Point(); } + + var halfWidth = ellipse.width / 2; + var halfHeight = ellipse.height / 2; + + out.x = ellipse.x + halfWidth * Math.cos(angle); + out.y = ellipse.y + halfHeight * Math.sin(angle); + + return out; +}; + +module.exports = CircumferencePoint; + + +/***/ }), +/* 188 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var GameObject = __webpack_require__(13); +var GravityWell = __webpack_require__(372); +var List = __webpack_require__(125); +var ParticleEmitter = __webpack_require__(374); +var Render = __webpack_require__(934); + +/** + * @classdesc + * A Particle Emitter Manager creates and controls {@link Phaser.GameObjects.Particles.ParticleEmitter Particle Emitters} and {@link Phaser.GameObjects.Particles.GravityWell Gravity Wells}. + * + * @class ParticleEmitterManager + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects.Particles + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Emitter Manager belongs. + * @param {string} texture - The key of the Texture this Emitter Manager will use to render particles, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Emitter Manager will use to render particles. + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create. + */ +var ParticleEmitterManager = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Depth, + Components.Mask, + Components.Pipeline, + Components.Transform, + Components.Visible, + Render + ], + + initialize: + + // frame is optional and can contain the emitters array or object if skipped + function ParticleEmitterManager (scene, texture, frame, emitters) + { + GameObject.call(this, scene, 'ParticleEmitterManager'); + + /** + * The blend mode applied to all emitters and particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitterManager#blendMode + * @type {integer} + * @default -1 + * @private + * @since 3.0.0 + */ + this.blendMode = -1; + + /** + * The time scale applied to all emitters and particles, affecting flow rate, lifespan, and movement. + * Values larger than 1 are faster than normal. + * This is multiplied with any timeScale set on each individual emitter. + * + * @name Phaser.GameObjects.Particles.ParticleEmitterManager#timeScale + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.timeScale = 1; + + /** + * The texture used to render this Emitter Manager's particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitterManager#texture + * @type {Phaser.Textures.Texture} + * @default null + * @since 3.0.0 + */ + this.texture = null; + + /** + * The texture frame used to render this Emitter Manager's particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitterManager#frame + * @type {Phaser.Textures.Frame} + * @default null + * @since 3.0.0 + */ + this.frame = null; + + /** + * Names of this Emitter Manager's texture frames. + * + * @name Phaser.GameObjects.Particles.ParticleEmitterManager#frameNames + * @type {string[]} + * @since 3.0.0 + */ + this.frameNames = []; + + // frame is optional and can contain the emitters array or object if skipped + if (frame !== null && (typeof frame === 'object' || Array.isArray(frame))) + { + emitters = frame; + frame = null; + } + + this.setTexture(texture, frame); + + this.initPipeline(); + + /** + * A list of Emitters being managed by this Emitter Manager. + * + * @name Phaser.GameObjects.Particles.ParticleEmitterManager#emitters + * @type {Phaser.Structs.List.} + * @since 3.0.0 + */ + this.emitters = new List(this); + + /** + * A list of Gravity Wells being managed by this Emitter Manager. + * + * @name Phaser.GameObjects.Particles.ParticleEmitterManager#wells + * @type {Phaser.Structs.List.} + * @since 3.0.0 + */ + this.wells = new List(this); + + if (emitters) + { + // An array of emitter configs? + if (!Array.isArray(emitters)) + { + emitters = [ emitters ]; + } + + for (var i = 0; i < emitters.length; i++) + { + this.createEmitter(emitters[i]); + } + } + }, + + /** + * Sets the texture and frame this Emitter Manager will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setTexture + * @since 3.0.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager. + */ + setTexture: function (key, frame) + { + this.texture = this.scene.sys.textures.get(key); + + return this.setFrame(frame); + }, + + /** + * Sets the frame this Emitter Manager will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setFrame + * @since 3.0.0 + * + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager. + */ + setFrame: function (frame) + { + this.frame = this.texture.get(frame); + + var frames = this.texture.getFramesFromTextureSource(this.frame.sourceIndex); + + var names = []; + + frames.forEach(function (sourceFrame) + { + names.push(sourceFrame.name); + }); + + this.frameNames = names; + + this.defaultFrame = this.frame; + + return this; + }, + + /** + * Assigns texture frames to an emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setEmitterFrames + * @since 3.0.0 + * + * @param {(Phaser.Textures.Frame|Phaser.Textures.Frame[])} frames - The texture frames. + * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - The particle emitter to modify. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager. + */ + setEmitterFrames: function (frames, emitter) + { + if (!Array.isArray(frames)) + { + frames = [ frames ]; + } + + var out = emitter.frames; + + out.length = 0; + + for (var i = 0; i < frames.length; i++) + { + var frame = frames[i]; + + if (this.frameNames.indexOf(frame) !== -1) + { + out.push(this.texture.get(frame)); + } + } + + if (out.length > 0) + { + emitter.defaultFrame = out[0]; + } + else + { + emitter.defaultFrame = this.defaultFrame; + } + + return this; + }, + + /** + * Adds an existing Particle Emitter to this Emitter Manager. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#addEmitter + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - The Particle Emitter to add to this Emitter Manager. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} The Particle Emitter that was added to this Emitter Manager. + */ + addEmitter: function (emitter) + { + return this.emitters.add(emitter); + }, + + /** + * Creates a new Particle Emitter object, adds it to this Emitter Manager and returns a reference to it. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#createEmitter + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} config - Configuration settings for the Particle Emitter to create. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} The Particle Emitter that was created. + */ + createEmitter: function (config) + { + return this.addEmitter(new ParticleEmitter(this, config)); + }, + + /** + * Adds an existing Gravity Well object to this Emitter Manager. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#addGravityWell + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.GravityWell} well - The Gravity Well to add to this Emitter Manager. + * + * @return {Phaser.GameObjects.Particles.GravityWell} The Gravity Well that was added to this Emitter Manager. + */ + addGravityWell: function (well) + { + return this.wells.add(well); + }, + + /** + * Creates a new Gravity Well, adds it to this Emitter Manager and returns a reference to it. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#createGravityWell + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.GravityWellConfig} config - Configuration settings for the Gravity Well to create. + * + * @return {Phaser.GameObjects.Particles.GravityWell} The Gravity Well that was created. + */ + createGravityWell: function (config) + { + return this.addGravityWell(new GravityWell(config)); + }, + + /** + * Emits particles from each active emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#emitParticle + * @since 3.0.0 + * + * @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. + * @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager. + */ + emitParticle: function (count, x, y) + { + var emitters = this.emitters.list; + + for (var i = 0; i < emitters.length; i++) + { + var emitter = emitters[i]; + + if (emitter.active) + { + emitter.emitParticle(count, x, y); + } + } + + return this; + }, + + /** + * Emits particles from each active emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#emitParticleAt + * @since 3.0.0 + * + * @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. + * @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. + * @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager. + */ + emitParticleAt: function (x, y, count) + { + return this.emitParticle(count, x, y); + }, + + /** + * Pauses this Emitter Manager. + * + * This has the effect of pausing all emitters, and all particles of those emitters, currently under its control. + * + * The particles will still render, but they will not have any of their logic updated. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#pause + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager. + */ + pause: function () + { + this.active = false; + + return this; + }, + + /** + * Resumes this Emitter Manager, should it have been previously paused. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#resume + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager. + */ + resume: function () + { + this.active = true; + + return this; + }, + + /** + * Gets all active particle processors (gravity wells). + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#getProcessors + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.GravityWell[]} - The active gravity wells. + */ + getProcessors: function () + { + return this.wells.getAll('active', true); + }, + + /** + * Updates all active emitters. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#preUpdate + * @since 3.0.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + // Scale the delta + delta *= this.timeScale; + + var emitters = this.emitters.list; + + for (var i = 0; i < emitters.length; i++) + { + var emitter = emitters[i]; + + if (emitter.active) + { + emitter.preUpdate(time, delta); + } + } + }, + + /** + * A NOOP method so you can pass an EmitterManager to a Container. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setAlpha + * @private + * @since 3.10.0 + */ + setAlpha: function () + { + }, + + /** + * A NOOP method so you can pass an EmitterManager to a Container. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setScrollFactor + * @private + * @since 3.10.0 + */ + setScrollFactor: function () + { + }, + + /** + * A NOOP method so you can pass an EmitterManager to a Container. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setBlendMode + * @private + * @since 3.15.0 + */ + setBlendMode: function () + { + } + +}); + +module.exports = ParticleEmitterManager; + + +/***/ }), +/* 189 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(52); +var Camera = __webpack_require__(112); +var CanvasPool = __webpack_require__(24); +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var CONST = __webpack_require__(26); +var Frame = __webpack_require__(91); +var GameObject = __webpack_require__(13); +var Render = __webpack_require__(938); +var Utils = __webpack_require__(9); +var UUID = __webpack_require__(380); + +/** + * @classdesc + * A Render Texture. + * + * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and + * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic + * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. + * + * Note that under WebGL a FrameBuffer, which is what the Render Texture uses internally, cannot be anti-aliased. This means + * that when drawing objects such as Shapes to a Render Texture they will appear to be drawn with no aliasing, however this + * is a technical limitation of WebGL. To get around it, create your shape as a texture in an art package, then draw that + * to the Render Texture. + * + * @class RenderTexture + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.2.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.ComputedSize + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {integer} [width=32] - The width of the Render Texture. + * @param {integer} [height=32] - The height of the Render Texture. + * @property {string} [key] - The texture key to make the RenderTexture from. + * @property {string} [frame] - the frame to make the RenderTexture from. + */ +var RenderTexture = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.ComputedSize, + Components.Crop, + Components.Depth, + Components.Flip, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Tint, + Components.Transform, + Components.Visible, + Render + ], + + initialize: + + function RenderTexture (scene, x, y, width, height, key, frame) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 32; } + if (height === undefined) { height = 32; } + + GameObject.call(this, scene, 'RenderTexture'); + + /** + * A reference to either the Canvas or WebGL Renderer that the Game instance is using. + * + * @name Phaser.GameObjects.RenderTexture#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.2.0 + */ + this.renderer = scene.sys.game.renderer; + + /** + * A reference to the Texture Manager. + * + * @name Phaser.GameObjects.RenderTexture#textureManager + * @type {Phaser.Textures.TextureManager} + * @since 3.12.0 + */ + this.textureManager = scene.sys.textures; + + /** + * The tint of the Render Texture when rendered. + * + * @name Phaser.GameObjects.RenderTexture#globalTint + * @type {number} + * @default 0xffffff + * @since 3.2.0 + */ + this.globalTint = 0xffffff; + + /** + * The alpha of the Render Texture when rendered. + * + * @name Phaser.GameObjects.RenderTexture#globalAlpha + * @type {number} + * @default 1 + * @since 3.2.0 + */ + this.globalAlpha = 1; + + /** + * The HTML Canvas Element that the Render Texture is drawing to when using the Canvas Renderer. + * + * @name Phaser.GameObjects.RenderTexture#canvas + * @type {HTMLCanvasElement} + * @since 3.2.0 + */ + this.canvas = null; + + /** + * A reference to the GL Frame Buffer this Render Texture is drawing to. + * This is only set if Phaser is running with the WebGL Renderer. + * + * @name Phaser.GameObjects.RenderTexture#framebuffer + * @type {?WebGLFramebuffer} + * @since 3.2.0 + */ + this.framebuffer = null; + + /** + * Is this Render Texture dirty or not? If not it won't spend time clearing or filling itself. + * + * @name Phaser.GameObjects.RenderTexture#dirty + * @type {boolean} + * @since 3.12.0 + */ + this.dirty = false; + + /** + * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. + * + * @name Phaser.GameObjects.RenderTexture#_crop + * @type {object} + * @private + * @since 3.12.0 + */ + this._crop = this.resetCropObject(); + + /** + * The Texture corresponding to this Render Texture. + * + * @name Phaser.GameObjects.RenderTexture#texture + * @type {Phaser.Textures.Texture} + * @since 3.12.0 + */ + this.texture = null; + + /** + * The Frame corresponding to this Render Texture. + * + * @name Phaser.GameObjects.RenderTexture#frame + * @type {Phaser.Textures.Frame} + * @since 3.12.0 + */ + this.frame = null; + + /** + * Internal saved texture flag. + * + * @name Phaser.GameObjects.RenderTexture#_saved + * @type {boolean} + * @private + * @since 3.12.0 + */ + this._saved = false; + + if (key === undefined) + { + this.canvas = CanvasPool.create2D(this, width, height); + + // Create a new Texture for this Text object + this.texture = scene.sys.textures.addCanvas(UUID(), this.canvas); + + // Get the frame + this.frame = this.texture.get(); + } + else + { + this.texture = scene.sys.textures.get(key); + + // Get the frame + this.frame = this.texture.get(frame); + + this.canvas = this.frame.source.image; + this._saved = true; + + this.dirty = true; + + this.width = this.frame.cutWidth; + this.height = this.frame.cutHeight; + } + + /** + * A reference to the Rendering Context belonging to the Canvas Element this Render Texture is drawing to. + * + * @name Phaser.GameObjects.RenderTexture#context + * @type {CanvasRenderingContext2D} + * @since 3.2.0 + */ + this.context = this.canvas.getContext('2d'); + + /** + * Internal erase mode flag. + * + * @name Phaser.GameObjects.RenderTexture#_eraseMode + * @type {boolean} + * @private + * @since 3.16.0 + */ + this._eraseMode = false; + + /** + * An internal Camera that can be used to move around the Render Texture. + * Control it just like you would any Scene Camera. The difference is that it only impacts the placement of what + * is drawn to the Render Texture. You can scroll, zoom and rotate this Camera. + * + * @name Phaser.GameObjects.RenderTexture#camera + * @type {Phaser.Cameras.Scene2D.BaseCamera} + * @since 3.12.0 + */ + this.camera = new Camera(0, 0, width, height); + + /** + * A reference to the WebGL Rendering Context. + * + * @name Phaser.GameObjects.RenderTexture#gl + * @type {WebGLRenderingContext} + * @default null + * @since 3.0.0 + */ + this.gl = null; + + var renderer = this.renderer; + + if (renderer.type === CONST.WEBGL) + { + var gl = renderer.gl; + + this.gl = gl; + this.drawGameObject = this.batchGameObjectWebGL; + this.framebuffer = renderer.createFramebuffer(width, height, this.frame.source.glTexture, false); + } + else if (renderer.type === CONST.CANVAS) + { + this.drawGameObject = this.batchGameObjectCanvas; + } + + this.camera.setScene(scene); + + this.setPosition(x, y); + + if (key === undefined) + { + this.setSize(width, height); + } + + this.setOrigin(0, 0); + this.initPipeline(); + }, + + /** + * Sets the size of this Game Object. + * + * @method Phaser.GameObjects.RenderTexture#setSize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + return this.resize(width, height); + }, + + /** + * Resizes the Render Texture to the new dimensions given. + * + * If Render Texture was created from specific frame, only the size of the frame will be changed. The size of the source + * texture will not change. + * + * If Render Texture was not created from specific frame, the following will happen: + * In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture. + * In Canvas it will resize the underlying canvas element. + * Both approaches will erase everything currently drawn to the Render Texture. + * + * If the dimensions given are the same as those already being used, calling this method will do nothing. + * + * @method Phaser.GameObjects.RenderTexture#resize + * @since 3.10.0 + * + * @param {number} width - The new width of the Render Texture. + * @param {number} [height=width] - The new height of the Render Texture. If not specified, will be set the same as the `width`. + * + * @return {this} This Render Texture. + */ + resize: function (width, height) + { + if (height === undefined) { height = width; } + + if (width !== this.width || height !== this.height) + { + if (this.frame.name === '__BASE') + { + // Tesize the texture + this.canvas.width = width; + this.canvas.height = height; + + if (this.gl) + { + var gl = this.gl; + + this.renderer.deleteTexture(this.frame.source.glTexture); + this.renderer.deleteFramebuffer(this.framebuffer); + + this.frame.source.glTexture = this.renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false); + this.framebuffer = this.renderer.createFramebuffer(width, height, this.frame.source.glTexture, false); + + this.frame.glTexture = this.frame.source.glTexture; + } + + this.frame.source.width = width; + this.frame.source.height = height; + + this.camera.setSize(width, height); + + this.frame.setSize(width, height); + + this.width = width; + this.height = height; + } + } + else + { + // Resize the frame + + var baseFrame = this.texture.getSourceImage(); + + if (this.frame.cutX + width > baseFrame.width) + { + width = baseFrame.width - this.frame.cutX; + } + + if (this.frame.cutY + height > baseFrame.height) + { + height = baseFrame.height - this.frame.cutY; + } + + this.frame.setSize(width, height, this.frame.cutX, this.frame.cutY); + } + + return this; + }, + + /** + * Set the tint to use when rendering this Render Texture. + * + * @method Phaser.GameObjects.RenderTexture#setGlobalTint + * @since 3.2.0 + * + * @param {integer} tint - The tint value. + * + * @return {this} This Render Texture. + */ + setGlobalTint: function (tint) + { + this.globalTint = tint; + + return this; + }, + + /** + * Set the alpha to use when rendering this Render Texture. + * + * @method Phaser.GameObjects.RenderTexture#setGlobalAlpha + * @since 3.2.0 + * + * @param {number} alpha - The alpha value. + * + * @return {this} This Render Texture. + */ + setGlobalAlpha: function (alpha) + { + this.globalAlpha = alpha; + + return this; + }, + + /** + * Stores a copy of this Render Texture in the Texture Manager using the given key. + * + * After doing this, any texture based Game Object, such as a Sprite, can use the contents of this + * Render Texture by using the texture key: + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 128, 128); + * + * // Draw something to the Render Texture + * + * rt.saveTexture('doodle'); + * + * this.add.image(400, 300, 'doodle'); + * ``` + * + * Updating the contents of this Render Texture will automatically update _any_ Game Object + * that is using it as a texture. Calling `saveTexture` again will not save another copy + * of the same texture, it will just rename the key of the existing copy. + * + * By default it will create a single base texture. You can add frames to the texture + * by using the `Texture.add` method. After doing this, you can then allow Game Objects + * to use a specific frame from a Render Texture. + * + * @method Phaser.GameObjects.RenderTexture#saveTexture + * @since 3.12.0 + * + * @param {string} key - The unique key to store the texture as within the global Texture Manager. + * + * @return {Phaser.Textures.Texture} The Texture that was saved. + */ + saveTexture: function (key) + { + this.textureManager.renameTexture(this.texture.key, key); + + this._saved = true; + + return this.texture; + }, + + /** + * Fills the Render Texture with the given color. + * + * @method Phaser.GameObjects.RenderTexture#fill + * @since 3.2.0 + * + * @param {number} rgb - The color to fill the Render Texture with. + * @param {number} [alpha=1] - The alpha value used by the fill. + * @param {number} [x=0] - The left coordinate of the fill rectangle. + * @param {number} [y=0] - The top coordinate of the fill rectangle. + * @param {number} [width=this.frame.cutWidth] - The width of the fill rectangle. + * @param {number} [height=this.frame.cutHeight] - The height of the fill rectangle. + * + * @return {this} This Render Texture instance. + */ + fill: function (rgb, alpha, x, y, width, height) + { + if (alpha === undefined) { alpha = 1; } + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.frame.cutWidth; } + if (height === undefined) { height = this.frame.cutHeight; } + + var r = ((rgb >> 16) | 0) & 0xff; + var g = ((rgb >> 8) | 0) & 0xff; + var b = (rgb | 0) & 0xff; + + var gl = this.gl; + var frame = this.frame; + + if (gl) + { + var renderer = this.renderer; + + var bounds = this.getBounds(); + + renderer.setFramebuffer(this.framebuffer, true); + + if (width !== frame.source.width || height !== frame.source.height) + { + gl.scissor(x + frame.cutX, y + frame.cutY, width, height); + } + + this.pipeline.drawFillRect( + bounds.x, bounds.y, bounds.right, bounds.bottom, + Utils.getTintFromFloats(r / 255, g / 255, b / 255, 1), + alpha + ); + + if (width !== frame.source.width || height !== frame.source.height) + { + gl.scissor(0, 0, frame.source.width, frame.source.height); + } + + this.renderer.setFramebuffer(null, true); + } + else + { + this.context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')'; + this.context.fillRect(x + frame.cutX, y + frame.cutY, width, height); + } + + return this; + }, + + /** + * Clears the Render Texture. + * + * @method Phaser.GameObjects.RenderTexture#clear + * @since 3.2.0 + * + * @return {this} This Render Texture instance. + */ + clear: function () + { + if (this.dirty) + { + var gl = this.gl; + + if (gl) + { + var renderer = this.renderer; + + renderer.setFramebuffer(this.framebuffer, true); + + if (this.frame.cutWidth !== this.canvas.width || this.frame.cutHeight !== this.canvas.height) + { + gl.scissor(this.frame.cutX, this.frame.cutY, this.frame.cutWidth, this.frame.cutHeight); + } + + gl.clearColor(0, 0, 0, 0); + gl.clear(gl.COLOR_BUFFER_BIT); + + renderer.setFramebuffer(null, true); + } + else + { + var ctx = this.context; + + ctx.save(); + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.clearRect(this.frame.cutX, this.frame.cutY, this.frame.cutWidth, this.frame.cutHeight); + ctx.restore(); + } + + this.dirty = false; + } + + return this; + }, + + /** + * Draws the given object, or an array of objects, to this Render Texture using a blend mode of ERASE. + * This has the effect of erasing any filled pixels in the objects from this Render Texture. + * + * It can accept any of the following: + * + * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. + * * Dynamic and Static Tilemap Layers. + * * A Group. The contents of which will be iterated and drawn in turn. + * * A Container. The contents of which will be iterated fully, and drawn in turn. + * * A Scene's Display List. Pass in `Scene.children` to draw the whole list. + * * Another Render Texture. + * * A Texture Frame instance. + * * A string. This is used to look-up a texture from the Texture Manager. + * + * Note: You cannot erase a Render Texture from itself. + * + * If passing in a Group or Container it will only draw children that return `true` + * when their `willRender()` method is called. I.e. a Container with 10 children, + * 5 of which have `visible=false` will only draw the 5 visible ones. + * + * If passing in an array of Game Objects it will draw them all, regardless if + * they pass a `willRender` check or not. + * + * You can pass in a string in which case it will look for a texture in the Texture + * Manager matching that string, and draw the base frame. + * + * You can pass in the `x` and `y` coordinates to draw the objects at. The use of + * the coordinates differ based on what objects are being drawn. If the object is + * a Group, Container or Display List, the coordinates are _added_ to the positions + * of the children. For all other types of object, the coordinates are exact. + * + * Calling this method causes the WebGL batch to flush, so it can write the texture + * data to the framebuffer being used internally. The batch is flushed at the end, + * after the entries have been iterated. So if you've a bunch of objects to draw, + * try and pass them in an array in one single call, rather than making lots of + * separate calls. + * + * @method Phaser.GameObjects.RenderTexture#erase + * @since 3.16.0 + * + * @param {any} entries - Any renderable Game Object, or Group, Container, Display List, other Render Texture, Texture Frame or an array of any of these. + * @param {number} [x] - The x position to draw the Frame at, or the offset applied to the object. + * @param {number} [y] - The y position to draw the Frame at, or the offset applied to the object. + * + * @return {this} This Render Texture instance. + */ + erase: function (entries, x, y) + { + this._eraseMode = true; + + var blendMode = this.renderer.currentBlendMode; + + this.renderer.setBlendMode(BlendModes.ERASE); + + this.draw(entries, x, y, 1, 16777215); + + this.renderer.setBlendMode(blendMode); + + this._eraseMode = false; + + return this; + }, + + /** + * Draws the given object, or an array of objects, to this Render Texture. + * + * It can accept any of the following: + * + * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. + * * Dynamic and Static Tilemap Layers. + * * A Group. The contents of which will be iterated and drawn in turn. + * * A Container. The contents of which will be iterated fully, and drawn in turn. + * * A Scene's Display List. Pass in `Scene.children` to draw the whole list. + * * Another Render Texture. + * * A Texture Frame instance. + * * A string. This is used to look-up a texture from the Texture Manager. + * + * Note: You cannot draw a Render Texture to itself. + * + * If passing in a Group or Container it will only draw children that return `true` + * when their `willRender()` method is called. I.e. a Container with 10 children, + * 5 of which have `visible=false` will only draw the 5 visible ones. + * + * If passing in an array of Game Objects it will draw them all, regardless if + * they pass a `willRender` check or not. + * + * You can pass in a string in which case it will look for a texture in the Texture + * Manager matching that string, and draw the base frame. If you need to specify + * exactly which frame to draw then use the method `drawFrame` instead. + * + * You can pass in the `x` and `y` coordinates to draw the objects at. The use of + * the coordinates differ based on what objects are being drawn. If the object is + * a Group, Container or Display List, the coordinates are _added_ to the positions + * of the children. For all other types of object, the coordinates are exact. + * + * The `alpha` and `tint` values are only used by Texture Frames. + * Game Objects use their own alpha and tint values when being drawn. + * + * Calling this method causes the WebGL batch to flush, so it can write the texture + * data to the framebuffer being used internally. The batch is flushed at the end, + * after the entries have been iterated. So if you've a bunch of objects to draw, + * try and pass them in an array in one single call, rather than making lots of + * separate calls. + * + * @method Phaser.GameObjects.RenderTexture#draw + * @since 3.2.0 + * + * @param {any} entries - Any renderable Game Object, or Group, Container, Display List, other Render Texture, Texture Frame or an array of any of these. + * @param {number} [x] - The x position to draw the Frame at, or the offset applied to the object. + * @param {number} [y] - The y position to draw the Frame at, or the offset applied to the object. + * @param {number} [alpha] - The alpha value. Only used for Texture Frames and if not specified defaults to the `globalAlpha` property. Game Objects use their own current alpha value. + * @param {number} [tint] - WebGL only. The tint color value. Only used for Texture Frames and if not specified defaults to the `globalTint` property. Game Objects use their own current tint value. + * + * @return {this} This Render Texture instance. + */ + draw: function (entries, x, y, alpha, tint) + { + if (alpha === undefined) { alpha = this.globalAlpha; } + + if (tint === undefined) + { + tint = (this.globalTint >> 16) + (this.globalTint & 0xff00) + ((this.globalTint & 0xff) << 16); + } + else + { + tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16); + } + + if (!Array.isArray(entries)) + { + entries = [ entries ]; + } + + var gl = this.gl; + + this.camera.preRender(1, 1); + + if (gl) + { + var cx = this.camera._cx; + var cy = this.camera._cy; + var cw = this.camera._cw; + var ch = this.camera._ch; + + this.renderer.setFramebuffer(this.framebuffer, false); + + this.renderer.pushScissor(cx, cy, cw, ch, ch); + + var pipeline = this.pipeline; + + pipeline.projOrtho(0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0); + + this.batchList(entries, x, y, alpha, tint); + + pipeline.flush(); + + this.renderer.setFramebuffer(null, false); + + this.renderer.popScissor(); + + pipeline.projOrtho(0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0); + } + else + { + this.renderer.setContext(this.context); + + this.batchList(entries, x, y, alpha, tint); + + this.renderer.setContext(); + } + + this.dirty = true; + + return this; + }, + + /** + * Draws the Texture Frame to the Render Texture at the given position. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 800, 600); + * rt.drawFrame(key, frame); + * ``` + * + * You can optionally provide a position, alpha and tint value to apply to the frame + * before it is drawn. + * + * Calling this method will cause a batch flush, so if you've got a stack of things to draw + * in a tight loop, try using the `draw` method instead. + * + * If you need to draw a Sprite to this Render Texture, use the `draw` method instead. + * + * @method Phaser.GameObjects.RenderTexture#drawFrame + * @since 3.12.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {number} [x=0] - The x position to draw the frame at. + * @param {number} [y=0] - The y position to draw the frame at. + * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. + * @param {number} [tint] - WebGL only. The tint color to use. If not specified it uses the `globalTint` property. + * + * @return {this} This Render Texture instance. + */ + drawFrame: function (key, frame, x, y, alpha, tint) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (alpha === undefined) { alpha = this.globalAlpha; } + + if (tint === undefined) + { + tint = (this.globalTint >> 16) + (this.globalTint & 0xff00) + ((this.globalTint & 0xff) << 16); + } + else + { + tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16); + } + + var gl = this.gl; + var textureFrame = this.textureManager.getFrame(key, frame); + + if (textureFrame) + { + this.camera.preRender(1, 1); + + if (gl) + { + var cx = this.camera._cx; + var cy = this.camera._cy; + var cw = this.camera._cw; + var ch = this.camera._ch; + + this.renderer.setFramebuffer(this.framebuffer, false); + + this.renderer.pushScissor(cx, cy, cw, ch, ch); + + var pipeline = this.pipeline; + + pipeline.projOrtho(0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0); + + pipeline.batchTextureFrame(textureFrame, x + this.frame.cutX, y + this.frame.cutY, tint, alpha, this.camera.matrix, null); + + pipeline.flush(); + + this.renderer.setFramebuffer(null, false); + + this.renderer.popScissor(); + + pipeline.projOrtho(0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0); + } + else + { + this.batchTextureFrame(textureFrame, x + this.frame.cutX, y + this.frame.cutY, alpha, tint); + } + + this.dirty = true; + } + + return this; + }, + + /** + * Internal method that handles the drawing of an array of children. + * + * @method Phaser.GameObjects.RenderTexture#batchList + * @private + * @since 3.12.0 + * + * @param {array} children - The array of Game Objects to draw. + * @param {number} [x] - The x position to offset the Game Object by. + * @param {number} [y] - The y position to offset the Game Object by. + * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. + * @param {number} [tint] - The tint color to use. If not specified it uses the `globalTint` property. + */ + batchList: function (children, x, y, alpha, tint) + { + for (var i = 0; i < children.length; i++) + { + var entry = children[i]; + + if (!entry || entry === this) + { + continue; + } + + if (entry.renderWebGL || entry.renderCanvas) + { + // Game Objects + this.drawGameObject(entry, x, y); + } + else if (entry.isParent || entry.list) + { + // Groups / Display Lists + this.batchGroup(entry.getChildren(), x, y); + } + else if (typeof entry === 'string') + { + // Texture key + this.batchTextureFrameKey(entry, null, x, y, alpha, tint); + } + else if (entry instanceof Frame) + { + // Texture Frame instance + this.batchTextureFrame(entry, x, y, alpha, tint); + } + else if (Array.isArray(entry)) + { + // Another Array + this.batchList(entry, x, y, alpha, tint); + } + } + }, + + /** + * Internal method that handles the drawing a Phaser Group contents. + * + * @method Phaser.GameObjects.RenderTexture#batchGroup + * @private + * @since 3.12.0 + * + * @param {array} children - The array of Game Objects to draw. + * @param {number} [x=0] - The x position to offset the Game Object by. + * @param {number} [y=0] - The y position to offset the Game Object by. + */ + batchGroup: function (children, x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + x += this.frame.cutX; + y += this.frame.cutY; + + for (var i = 0; i < children.length; i++) + { + var entry = children[i]; + + if (entry.willRender()) + { + var tx = entry.x + x; + var ty = entry.y + y; + + this.drawGameObject(entry, tx, ty); + } + } + }, + + /** + * Internal method that handles drawing a single Phaser Game Object to this Render Texture using WebGL. + * + * @method Phaser.GameObjects.RenderTexture#batchGameObjectWebGL + * @private + * @since 3.12.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to draw. + * @param {number} [x] - The x position to draw the Game Object at. + * @param {number} [y] - The y position to draw the Game Object at. + */ + batchGameObjectWebGL: function (gameObject, x, y) + { + if (x === undefined) { x = gameObject.x; } + if (y === undefined) { y = gameObject.y; } + + var prevX = gameObject.x; + var prevY = gameObject.y; + + if (!this._eraseMode) + { + this.renderer.setBlendMode(gameObject.blendMode); + } + + gameObject.setPosition(x + this.frame.cutX, y + this.frame.cutY); + + gameObject.renderWebGL(this.renderer, gameObject, 0, this.camera, null); + + gameObject.setPosition(prevX, prevY); + }, + + /** + * Internal method that handles drawing a single Phaser Game Object to this Render Texture using Canvas. + * + * @method Phaser.GameObjects.RenderTexture#batchGameObjectCanvas + * @private + * @since 3.12.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to draw. + * @param {number} [x] - The x position to draw the Game Object at. + * @param {number} [y] - The y position to draw the Game Object at. + */ + batchGameObjectCanvas: function (gameObject, x, y) + { + if (x === undefined) { x = gameObject.x; } + if (y === undefined) { y = gameObject.y; } + + var prevX = gameObject.x; + var prevY = gameObject.y; + + if (this._eraseMode) + { + var blendMode = gameObject.blendMode; + + gameObject.blendMode = BlendModes.ERASE; + } + + gameObject.setPosition(x + this.frame.cutX, y + this.frame.cutY); + + gameObject.renderCanvas(this.renderer, gameObject, 0, this.camera, null); + + gameObject.setPosition(prevX, prevY); + + if (this._eraseMode) + { + gameObject.blendMode = blendMode; + } + }, + + /** + * Internal method that handles the drawing of an array of children. + * + * @method Phaser.GameObjects.RenderTexture#batchTextureFrameKey + * @private + * @since 3.12.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {number} [x=0] - The x position to offset the Game Object by. + * @param {number} [y=0] - The y position to offset the Game Object by. + * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. + * @param {number} [tint] - The tint color to use. If not specified it uses the `globalTint` property. + * + * @return {boolean} `true` if the frame was found and drawn, otherwise `false`. + */ + batchTextureFrameKey: function (key, frame, x, y, alpha, tint) + { + var textureFrame = this.textureManager.getFrame(key, frame); + + if (textureFrame) + { + this.batchTextureFrame(textureFrame, x, y, alpha, tint); + } + }, + + /** + * Internal method that handles the drawing of a Texture Frame to this Render Texture. + * + * @method Phaser.GameObjects.RenderTexture#batchTextureFrame + * @private + * @since 3.12.0 + * + * @param {Phaser.Textures.Frame} textureFrame - The Texture Frame to draw. + * @param {number} [x=0] - The x position to draw the Frame at. + * @param {number} [y=0] - The y position to draw the Frame at. + * @param {number} [tint] - A tint color to be applied to the frame drawn to the Render Texture. + */ + batchTextureFrame: function (textureFrame, x, y, alpha, tint) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + x += this.frame.cutX; + y += this.frame.cutY; + + if (this.gl) + { + this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, this.camera.matrix, null); + } + else + { + var ctx = this.context; + var cd = textureFrame.canvasData; + var source = textureFrame.source.image; + + var matrix = this.camera.matrix; + + ctx.globalAlpha = this.globalAlpha; + + ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + + ctx.drawImage(source, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + } + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.RenderTexture#preDestroy + * @protected + * @since 3.9.0 + */ + preDestroy: function () + { + if (!this._saved) + { + CanvasPool.remove(this.canvas); + + if (this.gl) + { + this.renderer.deleteFramebuffer(this.framebuffer); + } + + this.texture.destroy(); + this.camera.destroy(); + + this.canvas = null; + this.context = null; + this.framebuffer = null; + this.texture = null; + } + } + +}); + +module.exports = RenderTexture; + + +/***/ }), +/* 190 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var AddToDOM = __webpack_require__(119); +var CanvasPool = __webpack_require__(24); +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var CONST = __webpack_require__(26); +var GameObject = __webpack_require__(13); +var GetTextSize = __webpack_require__(944); +var GetValue = __webpack_require__(6); +var RemoveFromDOM = __webpack_require__(174); +var TextRender = __webpack_require__(945); +var TextStyle = __webpack_require__(948); + +/** + * @classdesc + * A Text Game Object. + * + * Text objects work by creating their own internal hidden Canvas and then renders text to it using + * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered + * to your game during the render pass. + * + * Because it uses the Canvas API you can take advantage of all the features this offers, such as + * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts + * loaded externally, such as Google or TypeKit Web fonts. + * + * **Important:** If the font you wish to use has a space or digit in its name, such as + * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes, either + * when creating the Text object, or when setting the font via `setFont` or `setFontFamily`. I.e.: + * + * ```javascript + * this.add.text(0, 0, 'Hello World', { fontFamily: '"Roboto Condensed"' }); + * ``` + * + * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all + * quoted properly, too: + * + * ```javascript + * this.add.text(0, 0, 'Hello World', { fontFamily: 'Verdana, "Times New Roman", Tahoma, serif' }); + * ``` + * + * You can only display fonts that are currently loaded and available to the browser: therefore fonts must + * be pre-loaded. Phaser does not do ths for you, so you will require the use of a 3rd party font loader, + * or have the fonts ready available in the CSS on the page in which your Phaser game resides. + * + * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts + * across mobile browsers. + * + * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being + * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the + * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of + * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text + * instead, as it benefits from batching and avoids expensive Canvas API calls. + * + * @class Text + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.ComputedSize + * @extends Phaser.GameObjects.Components.Crop + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {(string|string[])} text - The text this Text object will display. + * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The text style configuration object. + */ +var Text = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.ComputedSize, + Components.Crop, + Components.Depth, + Components.Flip, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Tint, + Components.Transform, + Components.Visible, + TextRender + ], + + initialize: + + function Text (scene, x, y, text, style) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + GameObject.call(this, scene, 'Text'); + + /** + * The renderer in use by this Text object. + * + * @name Phaser.GameObjects.Text#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.12.0 + */ + this.renderer = scene.sys.game.renderer; + + this.setPosition(x, y); + this.setOrigin(0, 0); + this.initPipeline(); + + /** + * The canvas element that the text is rendered to. + * + * @name Phaser.GameObjects.Text#canvas + * @type {HTMLCanvasElement} + * @since 3.0.0 + */ + this.canvas = CanvasPool.create(this); + + /** + * The context of the canvas element that the text is rendered to. + * + * @name Phaser.GameObjects.Text#context + * @type {CanvasRenderingContext2D} + * @since 3.0.0 + */ + this.context = this.canvas.getContext('2d'); + + /** + * The Text Style object. + * + * Manages the style of this Text object. + * + * @name Phaser.GameObjects.Text#style + * @type {Phaser.GameObjects.TextStyle} + * @since 3.0.0 + */ + this.style = new TextStyle(this, style); + + /** + * Whether to automatically round line positions. + * + * @name Phaser.GameObjects.Text#autoRound + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.autoRound = true; + + /** + * The Regular Expression that is used to split the text up into lines, in + * multi-line text. By default this is `/(?:\r\n|\r|\n)/`. + * You can change this RegExp to be anything else that you may need. + * + * @name Phaser.GameObjects.Text#splitRegExp + * @type {object} + * @since 3.0.0 + */ + this.splitRegExp = /(?:\r\n|\r|\n)/; + + /** + * The text to display. + * + * @name Phaser.GameObjects.Text#_text + * @type {string} + * @private + * @since 3.12.0 + */ + this._text = undefined; + + /** + * Specify a padding value which is added to the line width and height when calculating the Text size. + * Allows you to add extra spacing if the browser is unable to accurately determine the true font dimensions. + * + * @name Phaser.GameObjects.Text#padding + * @type {{left:number,right:number,top:number,bottom:number}} + * @since 3.0.0 + */ + this.padding = { left: 0, right: 0, top: 0, bottom: 0 }; + + /** + * The width of this Text object. + * + * @name Phaser.GameObjects.Text#width + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.width = 1; + + /** + * The height of this Text object. + * + * @name Phaser.GameObjects.Text#height + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.height = 1; + + /** + * The line spacing value. + * This value is added to the font height to calculate the overall line height. + * Only has an effect if this Text object contains multiple lines of text. + * + * If you update this property directly, instead of using the `setLineSpacing` method, then + * be sure to call `updateText` after, or you won't see the change reflected in the Text object. + * + * @name Phaser.GameObjects.Text#lineSpacing + * @type {number} + * @since 3.13.0 + */ + this.lineSpacing = 0; + + /** + * Whether the text or its settings have changed and need updating. + * + * @name Phaser.GameObjects.Text#dirty + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.dirty = false; + + // If resolution wasn't set, then we get it from the game config + if (this.style.resolution === 0) + { + this.style.resolution = scene.sys.game.config.resolution; + } + + /** + * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. + * + * @name Phaser.GameObjects.Text#_crop + * @type {object} + * @private + * @since 3.12.0 + */ + this._crop = this.resetCropObject(); + + // Create a Texture for this Text object + this.texture = scene.sys.textures.addCanvas(null, this.canvas, true); + + // Get the frame + this.frame = this.texture.get(); + + // Set the resolution + this.frame.source.resolution = this.style.resolution; + + if (this.renderer && this.renderer.gl) + { + // Clear the default 1x1 glTexture, as we override it later + this.renderer.deleteTexture(this.frame.source.glTexture); + + this.frame.source.glTexture = null; + } + + this.initRTL(); + + this.setText(text); + + if (style && style.padding) + { + this.setPadding(style.padding); + } + + if (style && style.lineSpacing) + { + this.lineSpacing = style.lineSpacing; + } + + if (scene.sys.game.config.renderType === CONST.WEBGL) + { + scene.sys.game.renderer.onContextRestored(function () + { + this.dirty = true; + }, this); + } + }, + + /** + * Initialize right to left text. + * + * @method Phaser.GameObjects.Text#initRTL + * @since 3.0.0 + */ + initRTL: function () + { + if (!this.style.rtl) + { + return; + } + + // Here is where the crazy starts. + // + // Due to browser implementation issues, you cannot fillText BiDi text to a canvas + // that is not part of the DOM. It just completely ignores the direction property. + + this.canvas.dir = 'rtl'; + + // Experimental atm, but one day ... + this.context.direction = 'rtl'; + + // Add it to the DOM, but hidden within the parent canvas. + this.canvas.style.display = 'none'; + + AddToDOM(this.canvas, this.scene.sys.canvas); + + // And finally we set the x origin + this.originX = 1; + }, + + /** + * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal + * bounds. + * + * @method Phaser.GameObjects.Text#runWordWrap + * @since 3.0.0 + * + * @param {string} text - The text to perform word wrap detection against. + * + * @return {string} The text after wrapping has been applied. + */ + runWordWrap: function (text) + { + var style = this.style; + + if (style.wordWrapCallback) + { + var wrappedLines = style.wordWrapCallback.call(style.wordWrapCallbackScope, text, this); + + if (Array.isArray(wrappedLines)) + { + wrappedLines = wrappedLines.join('\n'); + } + + return wrappedLines; + } + else if (style.wordWrapWidth) + { + if (style.wordWrapUseAdvanced) + { + return this.advancedWordWrap(text, this.context, this.style.wordWrapWidth); + } + else + { + return this.basicWordWrap(text, this.context, this.style.wordWrapWidth); + } + } + else + { + return text; + } + }, + + /** + * Advanced wrapping algorithm that will wrap words as the line grows longer than its horizontal + * bounds. Consecutive spaces will be collapsed and replaced with a single space. Lines will be + * trimmed of white space before processing. Throws an error if wordWrapWidth is less than a + * single character. + * + * @method Phaser.GameObjects.Text#advancedWordWrap + * @since 3.0.0 + * + * @param {string} text - The text to perform word wrap detection against. + * @param {CanvasRenderingContext2D} context - The Canvas Rendering Context. + * @param {number} wordWrapWidth - The word wrap width. + * + * @return {string} The wrapped text. + */ + advancedWordWrap: function (text, context, wordWrapWidth) + { + var output = ''; + + // Condense consecutive spaces and split into lines + var lines = text + .replace(/ +/gi, ' ') + .split(this.splitRegExp); + + var linesCount = lines.length; + + for (var i = 0; i < linesCount; i++) + { + var line = lines[i]; + var out = ''; + + // Trim whitespace + line = line.replace(/^ *|\s*$/gi, ''); + + // If entire line is less than wordWrapWidth append the entire line and exit early + var lineWidth = context.measureText(line).width; + + if (lineWidth < wordWrapWidth) + { + output += line + '\n'; + continue; + } + + // Otherwise, calculate new lines + var currentLineWidth = wordWrapWidth; + + // Split into words + var words = line.split(' '); + + for (var j = 0; j < words.length; j++) + { + var word = words[j]; + var wordWithSpace = word + ' '; + var wordWidth = context.measureText(wordWithSpace).width; + + if (wordWidth > currentLineWidth) + { + // Break word + if (j === 0) + { + // Shave off letters from word until it's small enough + var newWord = wordWithSpace; + + while (newWord.length) + { + newWord = newWord.slice(0, -1); + wordWidth = context.measureText(newWord).width; + + if (wordWidth <= currentLineWidth) + { + break; + } + } + + // If wordWrapWidth is too small for even a single letter, shame user + // failure with a fatal error + if (!newWord.length) + { + throw new Error('This text\'s wordWrapWidth setting is less than a single character!'); + } + + // Replace current word in array with remainder + var secondPart = word.substr(newWord.length); + + words[j] = secondPart; + + // Append first piece to output + out += newWord; + } + + // If existing word length is 0, don't include it + var offset = (words[j].length) ? j : j + 1; + + // Collapse rest of sentence and remove any trailing white space + var remainder = words.slice(offset).join(' ') + .replace(/[ \n]*$/gi, ''); + + // Prepend remainder to next line + lines[i + 1] = remainder + ' ' + (lines[i + 1] || ''); + linesCount = lines.length; + + break; // Processing on this line + + // Append word with space to output + } + else + { + out += wordWithSpace; + currentLineWidth -= wordWidth; + } + } + + // Append processed line to output + output += out.replace(/[ \n]*$/gi, '') + '\n'; + } + + // Trim the end of the string + output = output.replace(/[\s|\n]*$/gi, ''); + + return output; + }, + + /** + * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal + * bounds. Spaces are not collapsed and whitespace is not trimmed. + * + * @method Phaser.GameObjects.Text#basicWordWrap + * @since 3.0.0 + * + * @param {string} text - The text to perform word wrap detection against. + * @param {CanvasRenderingContext2D} context - The Canvas Rendering Context. + * @param {number} wordWrapWidth - The word wrap width. + * + * @return {string} The wrapped text. + */ + basicWordWrap: function (text, context, wordWrapWidth) + { + var result = ''; + var lines = text.split(this.splitRegExp); + + for (var i = 0; i < lines.length; i++) + { + var spaceLeft = wordWrapWidth; + var words = lines[i].split(' '); + + for (var j = 0; j < words.length; j++) + { + var wordWidth = context.measureText(words[j]).width; + var wordWidthWithSpace = wordWidth + context.measureText(' ').width; + + if (wordWidthWithSpace > spaceLeft) + { + // Skip printing the newline if it's the first word of the line that is greater + // than the word wrap width. + if (j > 0) + { + result += '\n'; + } + + result += words[j] + ' '; + spaceLeft = wordWrapWidth - wordWidthWithSpace; + } + else + { + spaceLeft -= wordWidthWithSpace; + result += words[j]; + + if (j < (words.length - 1)) + { + result += ' '; + } + } + } + + if (i < lines.length - 1) + { + result += '\n'; + } + } + + return result; + }, + + /** + * Runs the given text through this Text objects word wrapping and returns the results as an + * array, where each element of the array corresponds to a wrapped line of text. + * + * @method Phaser.GameObjects.Text#getWrappedText + * @since 3.0.0 + * + * @param {string} text - The text for which the wrapping will be calculated. If unspecified, the Text objects current text will be used. + * + * @return {string[]} An array of strings with the pieces of wrapped text. + */ + getWrappedText: function (text) + { + if (text === undefined) { text = this._text; } + + this.style.syncFont(this.canvas, this.context); + + var wrappedLines = this.runWordWrap(text); + + return wrappedLines.split(this.splitRegExp); + }, + + /** + * Set the text to display. + * + * An array of strings will be joined with `\n` line breaks. + * + * @method Phaser.GameObjects.Text#setText + * @since 3.0.0 + * + * @param {(string|string[])} value - The string, or array of strings, to be set as the content of this Text object. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setText: function (value) + { + if (!value && value !== 0) + { + value = ''; + } + + if (Array.isArray(value)) + { + value = value.join('\n'); + } + + if (value !== this._text) + { + this._text = value.toString(); + + this.updateText(); + } + + return this; + }, + + /** + * Set the text style. + * + * @example + * text.setStyle({ + * fontSize: '64px', + * fontFamily: 'Arial', + * color: '#ffffff', + * align: 'center', + * backgroundColor: '#ff00ff' + * }); + * + * @method Phaser.GameObjects.Text#setStyle + * @since 3.0.0 + * + * @param {object} style - The style settings to set. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setStyle: function (style) + { + return this.style.setStyle(style); + }, + + /** + * Set the font. + * + * If a string is given, the font family is set. + * + * If an object is given, the `fontFamily`, `fontSize` and `fontStyle` + * properties of that object are set. + * + * **Important:** If the font you wish to use has a space or digit in its name, such as + * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes: + * + * ```javascript + * Text.setFont('"Roboto Condensed"'); + * ``` + * + * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all + * quoted properly, too: + * + * ```javascript + * Text.setFont('Verdana, "Times New Roman", Tahoma, serif'); + * ``` + * + * @method Phaser.GameObjects.Text#setFont + * @since 3.0.0 + * + * @param {string} font - The font family or font settings to set. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setFont: function (font) + { + return this.style.setFont(font); + }, + + /** + * Set the font family. + * + * **Important:** If the font you wish to use has a space or digit in its name, such as + * 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes: + * + * ```javascript + * Text.setFont('"Roboto Condensed"'); + * ``` + * + * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all + * quoted properly, too: + * + * ```javascript + * Text.setFont('Verdana, "Times New Roman", Tahoma, serif'); + * ``` + * + * @method Phaser.GameObjects.Text#setFontFamily + * @since 3.0.0 + * + * @param {string} family - The font family. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setFontFamily: function (family) + { + return this.style.setFontFamily(family); + }, + + /** + * Set the font size. + * + * @method Phaser.GameObjects.Text#setFontSize + * @since 3.0.0 + * + * @param {number} size - The font size. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setFontSize: function (size) + { + return this.style.setFontSize(size); + }, + + /** + * Set the font style. + * + * @method Phaser.GameObjects.Text#setFontStyle + * @since 3.0.0 + * + * @param {string} style - The font style. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setFontStyle: function (style) + { + return this.style.setFontStyle(style); + }, + + /** + * Set a fixed width and height for the text. + * + * Pass in `0` for either of these parameters to disable fixed width or height respectively. + * + * @method Phaser.GameObjects.Text#setFixedSize + * @since 3.0.0 + * + * @param {number} width - The fixed width to set. `0` disables fixed width. + * @param {number} height - The fixed height to set. `0` disables fixed height. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setFixedSize: function (width, height) + { + return this.style.setFixedSize(width, height); + }, + + /** + * Set the background color. + * + * @method Phaser.GameObjects.Text#setBackgroundColor + * @since 3.0.0 + * + * @param {string} color - The background color. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setBackgroundColor: function (color) + { + return this.style.setBackgroundColor(color); + }, + + /** + * Set the fill style to be used by the Text object. + * + * This can be any valid CanvasRenderingContext2D fillStyle value, such as + * a color (in hex, rgb, rgba, hsl or named values), a gradient or a pattern. + * + * See the [MDN fillStyle docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle) for more details. + * + * @method Phaser.GameObjects.Text#setFill + * @since 3.0.0 + * + * @param {(string|any)} color - The text fill style. Can be any valid CanvasRenderingContext `fillStyle` value. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setFill: function (fillStyle) + { + return this.style.setFill(fillStyle); + }, + + /** + * Set the text fill color. + * + * @method Phaser.GameObjects.Text#setColor + * @since 3.0.0 + * + * @param {string} color - The text fill color. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setColor: function (color) + { + return this.style.setColor(color); + }, + + /** + * Set the stroke settings. + * + * @method Phaser.GameObjects.Text#setStroke + * @since 3.0.0 + * + * @param {string} color - The stroke color. + * @param {number} thickness - The stroke thickness. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setStroke: function (color, thickness) + { + return this.style.setStroke(color, thickness); + }, + + /** + * Set the shadow settings. + * + * @method Phaser.GameObjects.Text#setShadow + * @since 3.0.0 + * + * @param {number} [x=0] - The horizontal shadow offset. + * @param {number} [y=0] - The vertical shadow offset. + * @param {string} [color='#000'] - The shadow color. + * @param {number} [blur=0] - The shadow blur radius. + * @param {boolean} [shadowStroke=false] - Whether to stroke the shadow. + * @param {boolean} [shadowFill=true] - Whether to fill the shadow. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setShadow: function (x, y, color, blur, shadowStroke, shadowFill) + { + return this.style.setShadow(x, y, color, blur, shadowStroke, shadowFill); + }, + + /** + * Set the shadow offset. + * + * @method Phaser.GameObjects.Text#setShadowOffset + * @since 3.0.0 + * + * @param {number} x - The horizontal shadow offset. + * @param {number} y - The vertical shadow offset. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setShadowOffset: function (x, y) + { + return this.style.setShadowOffset(x, y); + }, + + /** + * Set the shadow color. + * + * @method Phaser.GameObjects.Text#setShadowColor + * @since 3.0.0 + * + * @param {string} color - The shadow color. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setShadowColor: function (color) + { + return this.style.setShadowColor(color); + }, + + /** + * Set the shadow blur radius. + * + * @method Phaser.GameObjects.Text#setShadowBlur + * @since 3.0.0 + * + * @param {number} blur - The shadow blur radius. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setShadowBlur: function (blur) + { + return this.style.setShadowBlur(blur); + }, + + /** + * Enable or disable shadow stroke. + * + * @method Phaser.GameObjects.Text#setShadowStroke + * @since 3.0.0 + * + * @param {boolean} enabled - Whether shadow stroke is enabled or not. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setShadowStroke: function (enabled) + { + return this.style.setShadowStroke(enabled); + }, + + /** + * Enable or disable shadow fill. + * + * @method Phaser.GameObjects.Text#setShadowFill + * @since 3.0.0 + * + * @param {boolean} enabled - Whether shadow fill is enabled or not. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setShadowFill: function (enabled) + { + return this.style.setShadowFill(enabled); + }, + + /** + * Set the width (in pixels) to use for wrapping lines. Pass in null to remove wrapping by width. + * + * @method Phaser.GameObjects.Text#setWordWrapWidth + * @since 3.0.0 + * + * @param {?number} width - The maximum width of a line in pixels. Set to null to remove wrapping. + * @param {boolean} [useAdvancedWrap=false] - Whether or not to use the advanced wrapping + * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false, + * spaces and whitespace are left as is. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setWordWrapWidth: function (width, useAdvancedWrap) + { + return this.style.setWordWrapWidth(width, useAdvancedWrap); + }, + + /** + * Set a custom callback for wrapping lines. Pass in null to remove wrapping by callback. + * + * @method Phaser.GameObjects.Text#setWordWrapCallback + * @since 3.0.0 + * + * @param {TextStyleWordWrapCallback} callback - A custom function that will be responsible for wrapping the + * text. It will receive two arguments: text (the string to wrap), textObject (this Text + * instance). It should return the wrapped lines either as an array of lines or as a string with + * newline characters in place to indicate where breaks should happen. + * @param {object} [scope=null] - The scope that will be applied when the callback is invoked. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setWordWrapCallback: function (callback, scope) + { + return this.style.setWordWrapCallback(callback, scope); + }, + + /** + * Set the alignment of the text in this Text object. + * + * The argument can be one of: `left`, `right`, `center` or `justify`. + * + * Alignment only works if the Text object has more than one line of text. + * + * @method Phaser.GameObjects.Text#setAlign + * @since 3.0.0 + * + * @param {string} [align='left'] - The text alignment for multi-line text. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setAlign: function (align) + { + return this.style.setAlign(align); + }, + + /** + * Set the resolution used by this Text object. + * + * By default it will be set to match the resolution set in the Game Config, + * but you can override it via this method, or by specifying it in the Text style configuration object. + * + * It allows for much clearer text on High DPI devices, at the cost of memory because it uses larger + * internal Canvas textures for the Text. + * + * Therefore, please use with caution, as the more high res Text you have, the more memory it uses. + * + * @method Phaser.GameObjects.Text#setResolution + * @since 3.12.0 + * + * @param {number} value - The resolution for this Text object to use. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setResolution: function (value) + { + return this.style.setResolution(value); + }, + + /** + * Sets the line spacing value. + * + * This value is _added_ to the height of the font when calculating the overall line height. + * This only has an effect if this Text object consists of multiple lines of text. + * + * @method Phaser.GameObjects.Text#setLineSpacing + * @since 3.13.0 + * + * @param {number} value - The amount to add to the font height to achieve the overall line height. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setLineSpacing: function (value) + { + this.lineSpacing = value; + + return this.updateText(); + }, + + /** + * Set the text padding. + * + * 'left' can be an object. + * + * If only 'left' and 'top' are given they are treated as 'x' and 'y'. + * + * @method Phaser.GameObjects.Text#setPadding + * @since 3.0.0 + * + * @param {(number|Phaser.Types.GameObjects.Text.TextPadding)} left - The left padding value, or a padding config object. + * @param {number} top - The top padding value. + * @param {number} right - The right padding value. + * @param {number} bottom - The bottom padding value. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setPadding: function (left, top, right, bottom) + { + if (typeof left === 'object') + { + var config = left; + + // If they specify x and/or y this applies to all + var x = GetValue(config, 'x', null); + + if (x !== null) + { + left = x; + right = x; + } + else + { + left = GetValue(config, 'left', 0); + right = GetValue(config, 'right', left); + } + + var y = GetValue(config, 'y', null); + + if (y !== null) + { + top = y; + bottom = y; + } + else + { + top = GetValue(config, 'top', 0); + bottom = GetValue(config, 'bottom', top); + } + } + else + { + if (left === undefined) { left = 0; } + if (top === undefined) { top = left; } + if (right === undefined) { right = left; } + if (bottom === undefined) { bottom = top; } + } + + this.padding.left = left; + this.padding.top = top; + this.padding.right = right; + this.padding.bottom = bottom; + + return this.updateText(); + }, + + /** + * Set the maximum number of lines to draw. + * + * @method Phaser.GameObjects.Text#setMaxLines + * @since 3.0.0 + * + * @param {integer} [max=0] - The maximum number of lines to draw. + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + setMaxLines: function (max) + { + return this.style.setMaxLines(max); + }, + + /** + * Update the displayed text. + * + * @method Phaser.GameObjects.Text#updateText + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Text} This Text object. + */ + updateText: function () + { + var canvas = this.canvas; + var context = this.context; + var style = this.style; + var resolution = style.resolution; + var size = style.metrics; + + style.syncFont(canvas, context); + + var outputText = this._text; + + if (style.wordWrapWidth || style.wordWrapCallback) + { + outputText = this.runWordWrap(this._text); + } + + // Split text into lines + var lines = outputText.split(this.splitRegExp); + + var textSize = GetTextSize(this, size, lines); + + var padding = this.padding; + + var textWidth; + + if (style.fixedWidth === 0) + { + this.width = textSize.width + padding.left + padding.right; + + textWidth = textSize.width; + } + else + { + this.width = style.fixedWidth; + + textWidth = this.width - padding.left - padding.right; + + if (textWidth < textSize.width) + { + textWidth = textSize.width; + } + } + + if (style.fixedHeight === 0) + { + this.height = textSize.height + padding.top + padding.bottom; + } + else + { + this.height = style.fixedHeight; + } + + var w = this.width; + var h = this.height; + + this.updateDisplayOrigin(); + + w *= resolution; + h *= resolution; + + w = Math.max(w, 1); + h = Math.max(h, 1); + + if (canvas.width !== w || canvas.height !== h) + { + canvas.width = w; + canvas.height = h; + + this.frame.setSize(w, h); + + // Because resizing the canvas resets the context + style.syncFont(canvas, context); + } + else + { + context.clearRect(0, 0, w, h); + } + + context.save(); + + context.scale(resolution, resolution); + + if (style.backgroundColor) + { + context.fillStyle = style.backgroundColor; + context.fillRect(0, 0, w, h); + } + + style.syncStyle(canvas, context); + + context.textBaseline = 'alphabetic'; + + // Apply padding + context.translate(padding.left, padding.top); + + var linePositionX; + var linePositionY; + + // Draw text line by line + for (var i = 0; i < textSize.lines; i++) + { + linePositionX = style.strokeThickness / 2; + linePositionY = (style.strokeThickness / 2 + i * textSize.lineHeight) + size.ascent; + + if (i > 0) + { + linePositionY += (textSize.lineSpacing * i); + } + + if (style.rtl) + { + linePositionX = w - linePositionX; + } + else if (style.align === 'right') + { + linePositionX += textWidth - textSize.lineWidths[i]; + } + else if (style.align === 'center') + { + linePositionX += (textWidth - textSize.lineWidths[i]) / 2; + } + else if (style.align === 'justify') + { + // To justify text line its width must be no less than 85% of defined width + var minimumLengthToApplyJustification = 0.85; + + if (textSize.lineWidths[i] / textSize.width >= minimumLengthToApplyJustification) + { + var extraSpace = textSize.width - textSize.lineWidths[i]; + var spaceSize = context.measureText(' ').width; + var trimmedLine = lines[i].trim(); + var array = trimmedLine.split(' '); + + extraSpace += (lines[i].length - trimmedLine.length) * spaceSize; + + var extraSpaceCharacters = Math.floor(extraSpace / spaceSize); + var idx = 0; + + while (extraSpaceCharacters > 0) + { + array[idx] += ' '; + idx = (idx + 1) % (array.length - 1 || 1); + --extraSpaceCharacters; + } + + lines[i] = array.join(' '); + } + } + + if (this.autoRound) + { + linePositionX = Math.round(linePositionX); + linePositionY = Math.round(linePositionY); + } + + if (style.strokeThickness) + { + this.style.syncShadow(context, style.shadowStroke); + + context.strokeText(lines[i], linePositionX, linePositionY); + } + + if (style.color) + { + this.style.syncShadow(context, style.shadowFill); + + context.fillText(lines[i], linePositionX, linePositionY); + } + } + + context.restore(); + + if (this.renderer.gl) + { + this.frame.source.glTexture = this.renderer.canvasToTexture(canvas, this.frame.source.glTexture, true); + + this.frame.glTexture = this.frame.source.glTexture; + } + + this.dirty = true; + + var input = this.input; + + if (input && !input.customHitArea) + { + input.hitArea.width = this.width; + input.hitArea.height = this.height; + } + + return this; + }, + + /** + * Get the current text metrics. + * + * @method Phaser.GameObjects.Text#getTextMetrics + * @since 3.0.0 + * + * @return {object} The text metrics. + */ + getTextMetrics: function () + { + return this.style.getTextMetrics(); + }, + + /** + * The text string being rendered by this Text Game Object. + * + * @name Phaser.GameObjects.Text#text + * @type {string} + * @since 3.0.0 + */ + text: { + + get: function () + { + return this._text; + }, + + set: function (value) + { + this.setText(value); + } + + }, + + /** + * Build a JSON representation of the Text object. + * + * @method Phaser.GameObjects.Text#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Text object. + */ + toJSON: function () + { + var out = Components.ToJSON(this); + + // Extra Text data is added here + + var data = { + autoRound: this.autoRound, + text: this._text, + style: this.style.toJSON(), + padding: { + left: this.padding.left, + right: this.padding.right, + top: this.padding.top, + bottom: this.padding.bottom + } + }; + + out.data = data; + + return out; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.Text#preDestroy + * @protected + * @since 3.0.0 + */ + preDestroy: function () + { + if (this.style.rtl) + { + RemoveFromDOM(this.canvas); + } + + CanvasPool.remove(this.canvas); + + this.texture.destroy(); + } + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + * + * @name Phaser.GameObjects.Text#originX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + * + * @name Phaser.GameObjects.Text#originY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + +}); + +module.exports = Text; + + +/***/ }), +/* 191 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(24); +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var CONST = __webpack_require__(26); +var GameObject = __webpack_require__(13); +var GetPowerOfTwo = __webpack_require__(302); +var Smoothing = __webpack_require__(113); +var TileSpriteRender = __webpack_require__(950); +var Vector2 = __webpack_require__(4); + +// bitmask flag for GameObject.renderMask +var _FLAG = 8; // 1000 + +/** + * @classdesc + * A TileSprite is a Sprite that has a repeating texture. + * + * The texture can be scrolled and scaled independently of the TileSprite itself. Textures will automatically wrap and + * are designed so that you can create game backdrops using seamless textures as a source. + * + * You shouldn't ever create a TileSprite any larger than your actual canvas size. If you want to create a large repeating background + * that scrolls across the whole map of your game, then you create a TileSprite that fits the canvas size and then use the `tilePosition` + * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will + * consume huge amounts of memory and cause performance issues. Remember: use `tilePosition` to scroll your texture and `tileScale` to + * adjust the scale of the texture - don't resize the sprite itself or make it larger than it needs. + * + * An important note about Tile Sprites and NPOT textures: Internally, TileSprite textures use GL_REPEAT to provide + * seamless repeating of the textures. This, combined with the way in which the textures are handled in WebGL, means + * they need to be POT (power-of-two) sizes in order to wrap. If you provide a NPOT (non power-of-two) texture to a + * TileSprite it will generate a POT sized canvas and draw your texture to it, scaled up to the POT size. It's then + * scaled back down again during rendering to the original dimensions. While this works, in that it allows you to use + * any size texture for a Tile Sprite, it does mean that NPOT textures are going to appear anti-aliased when rendered, + * due to the interpolation that took place when it was resized into a POT texture. This is especially visible in + * pixel art graphics. If you notice it and it becomes an issue, the only way to avoid it is to ensure that you + * provide POT textures for Tile Sprites. + * + * @class TileSprite + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.ComputedSize + * @extends Phaser.GameObjects.Components.Crop + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame. + * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame. + * @param {string} textureKey - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frameKey] - An optional frame from the Texture this Game Object is rendering with. + */ +var TileSprite = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.ComputedSize, + Components.Crop, + Components.Depth, + Components.Flip, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Tint, + Components.Transform, + Components.Visible, + TileSpriteRender + ], + + initialize: + + function TileSprite (scene, x, y, width, height, textureKey, frameKey) + { + var renderer = scene.sys.game.renderer; + + GameObject.call(this, scene, 'TileSprite'); + + var displayTexture = scene.sys.textures.get(textureKey); + var displayFrame = displayTexture.get(frameKey); + + if (!width || !height) + { + width = displayFrame.width; + height = displayFrame.height; + } + else + { + width = Math.floor(width); + height = Math.floor(height); + } + + /** + * Internal tile position vector. + * + * @name Phaser.GameObjects.TileSprite#_tilePosition + * @type {Phaser.Math.Vector2} + * @private + * @since 3.12.0 + */ + this._tilePosition = new Vector2(); + + /** + * Internal tile scale vector. + * + * @name Phaser.GameObjects.TileSprite#_tileScale + * @type {Phaser.Math.Vector2} + * @private + * @since 3.12.0 + */ + this._tileScale = new Vector2(1, 1); + + /** + * Whether the Tile Sprite has changed in some way, requiring an re-render of its tile texture. + * + * Such changes include the texture frame and scroll position of the Tile Sprite. + * + * @name Phaser.GameObjects.TileSprite#dirty + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.dirty = false; + + /** + * The renderer in use by this Tile Sprite. + * + * @name Phaser.GameObjects.TileSprite#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.0.0 + */ + this.renderer = renderer; + + /** + * The Canvas element that the TileSprite renders its fill pattern in to. + * Only used in Canvas mode. + * + * @name Phaser.GameObjects.TileSprite#canvas + * @type {?HTMLCanvasElement} + * @since 3.12.0 + */ + this.canvas = CanvasPool.create(this, width, height); + + /** + * The Context of the Canvas element that the TileSprite renders its fill pattern in to. + * Only used in Canvas mode. + * + * @name Phaser.GameObjects.TileSprite#context + * @type {CanvasRenderingContext2D} + * @since 3.12.0 + */ + this.context = this.canvas.getContext('2d'); + + /** + * The Texture the TileSprite is using as its fill pattern. + * + * @name Phaser.GameObjects.TileSprite#displayTexture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @private + * @since 3.12.0 + */ + this.displayTexture = displayTexture; + + /** + * The Frame the TileSprite is using as its fill pattern. + * + * @name Phaser.GameObjects.TileSprite#displayFrame + * @type {Phaser.Textures.Frame} + * @private + * @since 3.12.0 + */ + this.displayFrame = displayFrame; + + /** + * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. + * + * @name Phaser.GameObjects.TileSprite#_crop + * @type {object} + * @private + * @since 3.12.0 + */ + this._crop = this.resetCropObject(); + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.TileSprite#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + this.texture = scene.sys.textures.addCanvas(null, this.canvas, true); + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.TileSprite#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + this.frame = this.texture.get(); + + /** + * The next power of two value from the width of the Fill Pattern frame. + * + * @name Phaser.GameObjects.TileSprite#potWidth + * @type {integer} + * @since 3.0.0 + */ + this.potWidth = GetPowerOfTwo(displayFrame.width); + + /** + * The next power of two value from the height of the Fill Pattern frame. + * + * @name Phaser.GameObjects.TileSprite#potHeight + * @type {integer} + * @since 3.0.0 + */ + this.potHeight = GetPowerOfTwo(displayFrame.height); + + /** + * The Canvas that the TileSprites texture is rendered to. + * This is used to create a WebGL texture from. + * + * @name Phaser.GameObjects.TileSprite#fillCanvas + * @type {HTMLCanvasElement} + * @since 3.12.0 + */ + this.fillCanvas = CanvasPool.create2D(this, this.potWidth, this.potHeight); + + /** + * The Canvas Context used to render the TileSprites texture. + * + * @name Phaser.GameObjects.TileSprite#fillContext + * @type {CanvasRenderingContext2D} + * @since 3.12.0 + */ + this.fillContext = this.fillCanvas.getContext('2d'); + + /** + * The texture that the Tile Sprite is rendered to, which is then rendered to a Scene. + * In WebGL this is a WebGLTexture. In Canvas it's a Canvas Fill Pattern. + * + * @name Phaser.GameObjects.TileSprite#fillPattern + * @type {?(WebGLTexture|CanvasPattern)} + * @since 3.12.0 + */ + this.fillPattern = null; + + this.setPosition(x, y); + this.setSize(width, height); + this.setFrame(frameKey); + this.setOriginFromFrame(); + this.initPipeline(); + + if (scene.sys.game.config.renderType === CONST.WEBGL) + { + scene.sys.game.renderer.onContextRestored(function (renderer) + { + var gl = renderer.gl; + + this.dirty = true; + this.fillPattern = null; + this.fillPattern = renderer.createTexture2D(0, gl.LINEAR, gl.LINEAR, gl.REPEAT, gl.REPEAT, gl.RGBA, this.fillCanvas, this.potWidth, this.potHeight); + }, this); + } + }, + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * @method Phaser.GameObjects.TileSprite#setTexture + * @since 3.0.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setTexture: function (key, frame) + { + this.displayTexture = this.scene.sys.textures.get(key); + + return this.setFrame(frame); + }, + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * @method Phaser.GameObjects.TileSprite#setFrame + * @since 3.0.0 + * + * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setFrame: function (frame) + { + this.displayFrame = this.displayTexture.get(frame); + + if (!this.displayFrame.cutWidth || !this.displayFrame.cutHeight) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + this.dirty = true; + + this.updateTileTexture(); + + return this; + }, + + /** + * Sets {@link Phaser.GameObjects.TileSprite#tilePositionX} and {@link Phaser.GameObjects.TileSprite#tilePositionY}. + * + * @method Phaser.GameObjects.TileSprite#setTilePosition + * @since 3.3.0 + * + * @param {number} [x] - The x position of this sprite's tiling texture. + * @param {number} [y] - The y position of this sprite's tiling texture. + * + * @return {this} This Tile Sprite instance. + */ + setTilePosition: function (x, y) + { + if (x !== undefined) + { + this.tilePositionX = x; + } + + if (y !== undefined) + { + this.tilePositionY = y; + } + + return this; + }, + + /** + * Sets {@link Phaser.GameObjects.TileSprite#tileScaleX} and {@link Phaser.GameObjects.TileSprite#tileScaleY}. + * + * @method Phaser.GameObjects.TileSprite#setTileScale + * @since 3.12.0 + * + * @param {number} [x] - The horizontal scale of the tiling texture. If not given it will use the current `tileScaleX` value. + * @param {number} [y=x] - The vertical scale of the tiling texture. If not given it will use the `x` value. + * + * @return {this} This Tile Sprite instance. + */ + setTileScale: function (x, y) + { + if (x === undefined) { x = this.tileScaleX; } + if (y === undefined) { y = x; } + + this.tileScaleX = x; + this.tileScaleY = y; + + return this; + }, + + /** + * Render the tile texture if it is dirty, or if the frame has changed. + * + * @method Phaser.GameObjects.TileSprite#updateTileTexture + * @private + * @since 3.0.0 + */ + updateTileTexture: function () + { + if (!this.dirty || !this.renderer) + { + return; + } + + // Draw the displayTexture to our fillCanvas + + var frame = this.displayFrame; + + var ctx = this.fillContext; + var canvas = this.fillCanvas; + + var fw = this.potWidth; + var fh = this.potHeight; + + if (!this.renderer.gl) + { + fw = frame.cutWidth; + fh = frame.cutHeight; + } + + ctx.clearRect(0, 0, fw, fh); + + canvas.width = fw; + canvas.height = fh; + + ctx.drawImage( + frame.source.image, + frame.cutX, frame.cutY, + frame.cutWidth, frame.cutHeight, + 0, 0, + fw, fh + ); + + if (this.renderer.gl) + { + this.fillPattern = this.renderer.canvasToTexture(canvas, this.fillPattern); + } + else + { + this.fillPattern = ctx.createPattern(canvas, 'repeat'); + } + + this.updateCanvas(); + + this.dirty = false; + }, + + /** + * Draw the fill pattern to the internal canvas. + * + * @method Phaser.GameObjects.TileSprite#updateCanvas + * @private + * @since 3.12.0 + */ + updateCanvas: function () + { + var canvas = this.canvas; + + if (canvas.width !== this.width || canvas.height !== this.height) + { + canvas.width = this.width; + canvas.height = this.height; + + this.frame.setSize(this.width, this.height); + this.updateDisplayOrigin(); + + this.dirty = true; + } + + if (!this.dirty || this.renderer && this.renderer.gl) + { + this.dirty = false; + return; + } + + var ctx = this.context; + + if (!this.scene.sys.game.config.antialias) + { + Smoothing.disable(ctx); + } + + var scaleX = this._tileScale.x; + var scaleY = this._tileScale.y; + + var positionX = this._tilePosition.x; + var positionY = this._tilePosition.y; + + ctx.clearRect(0, 0, this.width, this.height); + + ctx.save(); + + ctx.scale(scaleX, scaleY); + + ctx.translate(-positionX, -positionY); + + ctx.fillStyle = this.fillPattern; + + ctx.fillRect(positionX, positionY, this.width / scaleX, this.height / scaleY); + + ctx.restore(); + + this.dirty = false; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.TileSprite#preDestroy + * @protected + * @since 3.9.0 + */ + preDestroy: function () + { + if (this.renderer && this.renderer.gl) + { + this.renderer.deleteTexture(this.fillPattern); + } + + CanvasPool.remove(this.canvas); + CanvasPool.remove(this.fillCanvas); + + this.fillPattern = null; + this.fillContext = null; + this.fillCanvas = null; + + this.displayTexture = null; + this.displayFrame = null; + + this.texture.destroy(); + + this.renderer = null; + }, + + /** + * The horizontal scroll position of the Tile Sprite. + * + * @name Phaser.GameObjects.TileSprite#tilePositionX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + tilePositionX: { + + get: function () + { + return this._tilePosition.x; + }, + + set: function (value) + { + this._tilePosition.x = value; + this.dirty = true; + } + + }, + + /** + * The vertical scroll position of the Tile Sprite. + * + * @name Phaser.GameObjects.TileSprite#tilePositionY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + tilePositionY: { + + get: function () + { + return this._tilePosition.y; + }, + + set: function (value) + { + this._tilePosition.y = value; + this.dirty = true; + } + + }, + + /** + * The horizontal scale of the Tile Sprite texture. + * + * @name Phaser.GameObjects.TileSprite#tileScaleX + * @type {number} + * @default 1 + * @since 3.11.0 + */ + tileScaleX: { + + get: function () + { + return this._tileScale.x; + }, + + set: function (value) + { + this._tileScale.x = value; + this.dirty = true; + } + + }, + + /** + * The vertical scale of the Tile Sprite texture. + * + * @name Phaser.GameObjects.TileSprite#tileScaleY + * @type {number} + * @default 1 + * @since 3.11.0 + */ + tileScaleY: { + + get: function () + { + return this._tileScale.y; + }, + + set: function (value) + { + this._tileScale.y = value; + this.dirty = true; + } + + } + +}); + +module.exports = TileSprite; + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Contains = __webpack_require__(193); +var GetPoints = __webpack_require__(390); + +/** + * @classdesc + * A Polygon object + * + + * The polygon is a closed shape consists of a series of connected straight lines defined by list of ordered points. + * Several formats are supported to define the list of points, check the setTo method for details. + * This is a geometry object allowing you to define and inspect the shape. + * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. + * To render a Polygon you should look at the capabilities of the Graphics class. + * + * @class Polygon + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Geom.Point[]} [points] - List of points defining the perimeter of this Polygon. Several formats are supported: + * - A string containing paired x y values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` + * - An array of objects with public x y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + */ +var Polygon = new Class({ + + initialize: + + function Polygon (points) + { + /** + * The area of this Polygon. + * + * @name Phaser.Geom.Polygon#area + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.area = 0; + + /** + * An array of number pair objects that make up this polygon. I.e. [ {x,y}, {x,y}, {x,y} ] + * + * @name Phaser.Geom.Polygon#points + * @type {Phaser.Geom.Point[]} + * @since 3.0.0 + */ + this.points = []; + + if (points) + { + this.setTo(points); + } + }, + + /** + * Check to see if the Polygon contains the given x / y coordinates. + * + * @method Phaser.Geom.Polygon#contains + * @since 3.0.0 + * + * @param {number} x - The x coordinate to check within the polygon. + * @param {number} y - The y coordinate to check within the polygon. + * + * @return {boolean} `true` if the coordinates are within the polygon, otherwise `false`. + */ + contains: function (x, y) + { + return Contains(this, x, y); + }, + + /** + * Sets this Polygon to the given points. + * + * The points can be set from a variety of formats: + * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * `setTo` may also be called without any arguments to remove all points. + * + * @method Phaser.Geom.Polygon#setTo + * @since 3.0.0 + * + * @param {array} points - Points defining the perimeter of this polygon. Please check function description above for the different supported formats. + * + * @return {Phaser.Geom.Polygon} This Polygon object. + */ + setTo: function (points) + { + this.area = 0; + this.points = []; + + if (typeof points === 'string') + { + points = points.split(' '); + } + + if (!Array.isArray(points)) + { + return this; + } + + var p; + var y0 = Number.MAX_VALUE; + + // The points argument is an array, so iterate through it + for (var i = 0; i < points.length; i++) + { + p = { x: 0, y: 0 }; + + if (typeof points[i] === 'number' || typeof points[i] === 'string') + { + p.x = parseFloat(points[i]); + p.y = parseFloat(points[i + 1]); + i++; + } + else if (Array.isArray(points[i])) + { + // An array of arrays? + p.x = points[i][0]; + p.y = points[i][1]; + } + else + { + p.x = points[i].x; + p.y = points[i].y; + } + + this.points.push(p); + + // Lowest boundary + if (p.y < y0) + { + y0 = p.y; + } + } + + this.calculateArea(y0); + + return this; + }, + + /** + * Calculates the area of the Polygon. This is available in the property Polygon.area + * + * @method Phaser.Geom.Polygon#calculateArea + * @since 3.0.0 + * + * @return {number} The area of the polygon. + */ + calculateArea: function () + { + if (this.points.length < 3) + { + this.area = 0; + + return this.area; + } + + var sum = 0; + var p1; + var p2; + + for (var i = 0; i < this.points.length - 1; i++) + { + p1 = this.points[i]; + p2 = this.points[i + 1]; + + sum += (p2.x - p1.x) * (p1.y + p2.y); + } + + p1 = this.points[0]; + p2 = this.points[this.points.length - 1]; + + sum += (p1.x - p2.x) * (p2.y + p1.y); + + this.area = -sum * 0.5; + + return this.area; + }, + + /** + * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, + * based on the given quantity or stepRate values. + * + * @method Phaser.Geom.Polygon#getPoints + * @since 3.12.0 + * + * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. + * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. + * + * @return {Phaser.Geom.Point[]} An array of Point objects pertaining to the points around the perimeter of the Polygon. + */ + getPoints: function (quantity, step, output) + { + return GetPoints(this, quantity, step, output); + } + +}); + +module.exports = Polygon; + + +/***/ }), +/* 193 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Checks whether the x and y coordinates are contained within this polygon. +// Adapted from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html by Jonas Raoni Soares Silva + +/** + * Checks if a point is within the bounds of a Polygon. + * + * @function Phaser.Geom.Polygon.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Polygon} polygon - The Polygon to check against. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the bounds of the Polygon, otherwise `false`. + */ +var Contains = function (polygon, x, y) +{ + var inside = false; + + for (var i = -1, j = polygon.points.length - 1; ++i < polygon.points.length; j = i) + { + var ix = polygon.points[i].x; + var iy = polygon.points[i].y; + + var jx = polygon.points[j].x; + var jy = polygon.points[j].y; + + if (((iy <= y && y < jy) || (jy <= y && y < iy)) && (x < (jx - ix) * (y - iy) / (jy - iy) + ix)) + { + inside = !inside; + } + } + + return inside; +}; + +module.exports = Contains; + + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Mesh = __webpack_require__(129); + +/** + * @classdesc + * A Quad Game Object. + * + * A Quad is a Mesh Game Object pre-configured with two triangles arranged into a rectangle, with a single + * texture spread across them. + * + * You can manipulate the corner points of the quad via the getters and setters such as `topLeftX`, and also + * change their alpha and color values. The quad itself can be moved by adjusting the `x` and `y` properties. + * + * @class Quad + * @extends Phaser.GameObjects.Mesh + * @memberof Phaser.GameObjects + * @constructor + * @webglOnly + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Quad belongs. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + */ +var Quad = new Class({ + + Extends: Mesh, + + initialize: + + function Quad (scene, x, y, texture, frame) + { + // 0----3 + // |\ B| + // | \ | + // | \ | + // | A \| + // | \ + // 1----2 + + var vertices = [ + 0, 0, // tl + 0, 0, // bl + 0, 0, // br + 0, 0, // tl + 0, 0, // br + 0, 0 // tr + ]; + + var uv = [ + 0, 0, // tl + 0, 1, // bl + 1, 1, // br + 0, 0, // tl + 1, 1, // br + 1, 0 // tr + ]; + + var colors = [ + 0xffffff, // tl + 0xffffff, // bl + 0xffffff, // br + 0xffffff, // tl + 0xffffff, // br + 0xffffff // tr + ]; + + var alphas = [ + 1, // tl + 1, // bl + 1, // br + 1, // tl + 1, // br + 1 // tr + ]; + + Mesh.call(this, scene, x, y, vertices, uv, colors, alphas, texture, frame); + + this.resetPosition(); + }, + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * + * @method Phaser.GameObjects.Quad#setFrame + * @since 3.11.0 + * + * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setFrame: function (frame) + { + this.frame = this.texture.get(frame); + + if (!this.frame.cutWidth || !this.frame.cutHeight) + { + this.renderFlags &= ~8; + } + else + { + this.renderFlags |= 8; + } + + frame = this.frame; + + // TL + this.uv[0] = frame.u0; + this.uv[1] = frame.v0; + + // BL + this.uv[2] = frame.u0; + this.uv[3] = frame.v1; + + // BR + this.uv[4] = frame.u1; + this.uv[5] = frame.v1; + + // TL + this.uv[6] = frame.u0; + this.uv[7] = frame.v0; + + // BR + this.uv[8] = frame.u1; + this.uv[9] = frame.v1; + + // TR + this.uv[10] = frame.u1; + this.uv[11] = frame.v0; + + return this; + }, + + /** + * The top-left x vertex of this Quad. + * + * @name Phaser.GameObjects.Quad#topLeftX + * @type {number} + * @since 3.0.0 + */ + topLeftX: { + + get: function () + { + return this.x + this.vertices[0]; + }, + + set: function (value) + { + this.vertices[0] = value - this.x; + this.vertices[6] = value - this.x; + } + + }, + + /** + * The top-left y vertex of this Quad. + * + * @name Phaser.GameObjects.Quad#topLeftY + * @type {number} + * @since 3.0.0 + */ + topLeftY: { + + get: function () + { + return this.y + this.vertices[1]; + }, + + set: function (value) + { + this.vertices[1] = value - this.y; + this.vertices[7] = value - this.y; + } + + }, + + /** + * The top-right x vertex of this Quad. + * + * @name Phaser.GameObjects.Quad#topRightX + * @type {number} + * @since 3.0.0 + */ + topRightX: { + + get: function () + { + return this.x + this.vertices[10]; + }, + + set: function (value) + { + this.vertices[10] = value - this.x; + } + + }, + + /** + * The top-right y vertex of this Quad. + * + * @name Phaser.GameObjects.Quad#topRightY + * @type {number} + * @since 3.0.0 + */ + topRightY: { + + get: function () + { + return this.y + this.vertices[11]; + }, + + set: function (value) + { + this.vertices[11] = value - this.y; + } + + }, + + /** + * The bottom-left x vertex of this Quad. + * + * @name Phaser.GameObjects.Quad#bottomLeftX + * @type {number} + * @since 3.0.0 + */ + bottomLeftX: { + + get: function () + { + return this.x + this.vertices[2]; + }, + + set: function (value) + { + this.vertices[2] = value - this.x; + } + + }, + + /** + * The bottom-left y vertex of this Quad. + * + * @name Phaser.GameObjects.Quad#bottomLeftY + * @type {number} + * @since 3.0.0 + */ + bottomLeftY: { + + get: function () + { + return this.y + this.vertices[3]; + }, + + set: function (value) + { + this.vertices[3] = value - this.y; + } + + }, + + /** + * The bottom-right x vertex of this Quad. + * + * @name Phaser.GameObjects.Quad#bottomRightX + * @type {number} + * @since 3.0.0 + */ + bottomRightX: { + + get: function () + { + return this.x + this.vertices[4]; + }, + + set: function (value) + { + this.vertices[4] = value - this.x; + this.vertices[8] = value - this.x; + } + + }, + + /** + * The bottom-right y vertex of this Quad. + * + * @name Phaser.GameObjects.Quad#bottomRightY + * @type {number} + * @since 3.0.0 + */ + bottomRightY: { + + get: function () + { + return this.y + this.vertices[5]; + }, + + set: function (value) + { + this.vertices[5] = value - this.y; + this.vertices[9] = value - this.y; + } + + }, + + /** + * The top-left alpha value of this Quad. + * + * @name Phaser.GameObjects.Quad#topLeftAlpha + * @type {number} + * @since 3.0.0 + */ + topLeftAlpha: { + + get: function () + { + return this.alphas[0]; + }, + + set: function (value) + { + this.alphas[0] = value; + this.alphas[3] = value; + } + + }, + + /** + * The top-right alpha value of this Quad. + * + * @name Phaser.GameObjects.Quad#topRightAlpha + * @type {number} + * @since 3.0.0 + */ + topRightAlpha: { + + get: function () + { + return this.alphas[5]; + }, + + set: function (value) + { + this.alphas[5] = value; + } + + }, + + /** + * The bottom-left alpha value of this Quad. + * + * @name Phaser.GameObjects.Quad#bottomLeftAlpha + * @type {number} + * @since 3.0.0 + */ + bottomLeftAlpha: { + + get: function () + { + return this.alphas[1]; + }, + + set: function (value) + { + this.alphas[1] = value; + } + + }, + + /** + * The bottom-right alpha value of this Quad. + * + * @name Phaser.GameObjects.Quad#bottomRightAlpha + * @type {number} + * @since 3.0.0 + */ + bottomRightAlpha: { + + get: function () + { + return this.alphas[2]; + }, + + set: function (value) + { + this.alphas[2] = value; + this.alphas[4] = value; + } + + }, + + /** + * The top-left color value of this Quad. + * + * @name Phaser.GameObjects.Quad#topLeftColor + * @type {number} + * @since 3.0.0 + */ + topLeftColor: { + + get: function () + { + return this.colors[0]; + }, + + set: function (value) + { + this.colors[0] = value; + this.colors[3] = value; + } + + }, + + /** + * The top-right color value of this Quad. + * + * @name Phaser.GameObjects.Quad#topRightColor + * @type {number} + * @since 3.0.0 + */ + topRightColor: { + + get: function () + { + return this.colors[5]; + }, + + set: function (value) + { + this.colors[5] = value; + } + + }, + + /** + * The bottom-left color value of this Quad. + * + * @name Phaser.GameObjects.Quad#bottomLeftColor + * @type {number} + * @since 3.0.0 + */ + bottomLeftColor: { + + get: function () + { + return this.colors[1]; + }, + + set: function (value) + { + this.colors[1] = value; + } + + }, + + /** + * The bottom-right color value of this Quad. + * + * @name Phaser.GameObjects.Quad#bottomRightColor + * @type {number} + * @since 3.0.0 + */ + bottomRightColor: { + + get: function () + { + return this.colors[2]; + }, + + set: function (value) + { + this.colors[2] = value; + this.colors[4] = value; + } + + }, + + /** + * Sets the top-left vertex position of this Quad. + * + * @method Phaser.GameObjects.Quad#setTopLeft + * @since 3.0.0 + * + * @param {number} x - The horizontal coordinate of the vertex. + * @param {number} y - The vertical coordinate of the vertex. + * + * @return {Phaser.GameObjects.Quad} This Game Object. + */ + setTopLeft: function (x, y) + { + this.topLeftX = x; + this.topLeftY = y; + + return this; + }, + + /** + * Sets the top-right vertex position of this Quad. + * + * @method Phaser.GameObjects.Quad#setTopRight + * @since 3.0.0 + * + * @param {number} x - The horizontal coordinate of the vertex. + * @param {number} y - The vertical coordinate of the vertex. + * + * @return {Phaser.GameObjects.Quad} This Game Object. + */ + setTopRight: function (x, y) + { + this.topRightX = x; + this.topRightY = y; + + return this; + }, + + /** + * Sets the bottom-left vertex position of this Quad. + * + * @method Phaser.GameObjects.Quad#setBottomLeft + * @since 3.0.0 + * + * @param {number} x - The horizontal coordinate of the vertex. + * @param {number} y - The vertical coordinate of the vertex. + * + * @return {Phaser.GameObjects.Quad} This Game Object. + */ + setBottomLeft: function (x, y) + { + this.bottomLeftX = x; + this.bottomLeftY = y; + + return this; + }, + + /** + * Sets the bottom-right vertex position of this Quad. + * + * @method Phaser.GameObjects.Quad#setBottomRight + * @since 3.0.0 + * + * @param {number} x - The horizontal coordinate of the vertex. + * @param {number} y - The vertical coordinate of the vertex. + * + * @return {Phaser.GameObjects.Quad} This Game Object. + */ + setBottomRight: function (x, y) + { + this.bottomRightX = x; + this.bottomRightY = y; + + return this; + }, + + /** + * Resets the positions of the four corner vertices of this Quad. + * + * @method Phaser.GameObjects.Quad#resetPosition + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Quad} This Game Object. + */ + resetPosition: function () + { + var x = this.x; + var y = this.y; + var halfWidth = Math.floor(this.width / 2); + var halfHeight = Math.floor(this.height / 2); + + this.setTopLeft(x - halfWidth, y - halfHeight); + this.setTopRight(x + halfWidth, y - halfHeight); + this.setBottomLeft(x - halfWidth, y + halfHeight); + this.setBottomRight(x + halfWidth, y + halfHeight); + + return this; + }, + + /** + * Resets the alpha values used by this Quad back to 1. + * + * @method Phaser.GameObjects.Quad#resetAlpha + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Quad} This Game Object. + */ + resetAlpha: function () + { + var alphas = this.alphas; + + alphas[0] = 1; + alphas[1] = 1; + alphas[2] = 1; + alphas[3] = 1; + alphas[4] = 1; + alphas[5] = 1; + + return this; + }, + + /** + * Resets the color values used by this Quad back to 0xffffff. + * + * @method Phaser.GameObjects.Quad#resetColors + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Quad} This Game Object. + */ + resetColors: function () + { + var colors = this.colors; + + colors[0] = 0xffffff; + colors[1] = 0xffffff; + colors[2] = 0xffffff; + colors[3] = 0xffffff; + colors[4] = 0xffffff; + colors[5] = 0xffffff; + + return this; + }, + + /** + * Resets the position, alpha and color values used by this Quad. + * + * @method Phaser.GameObjects.Quad#reset + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Quad} This Game Object. + */ + reset: function () + { + this.resetPosition(); + + this.resetAlpha(); + + return this.resetColors(); + } + +}); + +module.exports = Quad; + + +/***/ }), +/* 195 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var GameObject = __webpack_require__(13); +var GetFastValue = __webpack_require__(2); +var Merge = __webpack_require__(85); +var SetValue = __webpack_require__(398); +var ShaderRender = __webpack_require__(1029); +var TransformMatrix = __webpack_require__(32); + +/** + * @classdesc + * A Shader Game Object. + * + * This Game Object allows you to easily add a quad with its own shader into the display list, and manipulate it + * as you would any other Game Object, including scaling, rotating, positioning and adding to Containers. Shaders + * can be masked with either Bitmap or Geometry masks and can also be used as a Bitmap Mask for a Camera or other + * Game Object. They can also be made interactive and used for input events. + * + * It works by taking a reference to a `Phaser.Display.BaseShader` instance, as found in the Shader Cache. These can + * be created dynamically at runtime, or loaded in via the GLSL File Loader: + * + * ```javascript + * function preload () + * { + * this.load.glsl('fire', 'shaders/fire.glsl.js'); + * } + * + * function create () + * { + * this.add.shader('fire', 400, 300, 512, 512); + * } + * ``` + * + * Please see the Phaser 3 Examples GitHub repo for examples of loading and creating shaders dynamically. + * + * Due to the way in which they work, you cannot directly change the alpha or blend mode of a Shader. This should + * be handled via exposed uniforms in the shader code itself. + * + * By default a Shader will be created with a standard set of uniforms. These were added to match those + * found on sites such as ShaderToy or GLSLSandbox, and provide common functionality a shader may need, + * such as the timestamp, resolution or pointer position. You can replace them by specifying your own uniforms + * in the Base Shader. + * + * These Shaders work by halting the current pipeline during rendering, creating a viewport matched to the + * size of this Game Object and then renders a quad using the bound shader. At the end, the pipeline is restored. + * + * Because it blocks the pipeline it means it will interrupt any batching that is currently going on, so you should + * use these Game Objects sparingly. If you need to have a fully batched custom shader, then please look at using + * a custom pipeline instead. However, for background or special masking effects, they are extremely effective. + * + * @class Shader + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @webglOnly + * @since 3.17.0 + * + * @extends Phaser.GameObjects.Components.ComputedSize + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {(string|Phaser.Display.BaseShader)} key - The key of the shader to use from the shader cache, or a BaseShader instance. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [width=128] - The width of the Game Object. + * @param {number} [height=128] - The height of the Game Object. + * @param {string[]} [textures] - Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. + */ +var Shader = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.ComputedSize, + Components.Depth, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.ScrollFactor, + Components.Transform, + Components.Visible, + ShaderRender + ], + + initialize: + + function Shader (scene, key, x, y, width, height, textures) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 128; } + if (height === undefined) { height = 128; } + + GameObject.call(this, scene, 'Shader'); + + /** + * This Game Object cannot have a blend mode, so skip all checks. + * + * @name Phaser.GameObjects.Shader#blendMode + * @type {integer} + * @private + * @since 3.17.0 + */ + this.blendMode = -1; + + /** + * The underlying shader object being used. + * Empty by default and set during a call to the `setShader` method. + * + * @name Phaser.GameObjects.Shader#shader + * @type {Phaser.Display.BaseShader} + * @since 3.17.0 + */ + this.shader; + + var renderer = scene.sys.renderer; + + /** + * A reference to the current renderer. + * Shaders only work with the WebGL Renderer. + * + * @name Phaser.GameObjects.Shader#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.17.0 + */ + this.renderer = renderer; + + /** + * The WebGL context belonging to the renderer. + * + * @name Phaser.GameObjects.Shader#gl + * @type {WebGLRenderingContext} + * @since 3.17.0 + */ + this.gl = renderer.gl; + + /** + * Raw byte buffer of vertices this Shader uses. + * + * @name Phaser.GameObjects.Shader#vertexData + * @type {ArrayBuffer} + * @since 3.17.0 + */ + this.vertexData = new ArrayBuffer(6 * (Float32Array.BYTES_PER_ELEMENT * 2)); + + /** + * The WebGL vertex buffer object this shader uses. + * + * @name Phaser.GameObjects.Shader#vertexBuffer + * @type {WebGLBuffer} + * @since 3.17.0 + */ + this.vertexBuffer = renderer.createVertexBuffer(this.vertexData.byteLength, this.gl.STREAM_DRAW); + + /** + * The WebGL shader program this shader uses. + * + * @name Phaser.GameObjects.Shader#program + * @type {WebGLProgram} + * @since 3.17.0 + */ + this.program = null; + + /** + * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources to the GPU. + * + * @name Phaser.GameObjects.Shader#bytes + * @type {Uint8Array} + * @since 3.17.0 + */ + this.bytes = new Uint8Array(this.vertexData); + + /** + * Float32 view of the array buffer containing the shaders vertices. + * + * @name Phaser.GameObjects.Shader#vertexViewF32 + * @type {Float32Array} + * @since 3.17.0 + */ + this.vertexViewF32 = new Float32Array(this.vertexData); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.GameObjects.Shader#_tempMatrix1 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.17.0 + */ + this._tempMatrix1 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.GameObjects.Shader#_tempMatrix2 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.17.0 + */ + this._tempMatrix2 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.GameObjects.Shader#_tempMatrix3 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.17.0 + */ + this._tempMatrix3 = new TransformMatrix(); + + /** + * The view matrix the shader uses during rendering. + * + * @name Phaser.GameObjects.Shader#viewMatrix + * @type {Float32Array} + * @readonly + * @since 3.17.0 + */ + this.viewMatrix = new Float32Array([ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]); + + /** + * The projection matrix the shader uses during rendering. + * + * @name Phaser.GameObjects.Shader#projectionMatrix + * @type {Float32Array} + * @readonly + * @since 3.17.0 + */ + this.projectionMatrix = new Float32Array([ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]); + + /** + * The default uniform mappings. These can be added to (or replaced) by specifying your own uniforms when + * creating this shader game object. The uniforms are updated automatically during the render step. + * + * The defaults are: + * + * `resolution` (2f) - Set to the size of this shader. + * `time` (1f) - The elapsed game time, in seconds. + * `mouse` (2f) - If a pointer has been bound (with `setPointer`), this uniform contains its position each frame. + * `date` (4fv) - A vec4 containing the year, month, day and time in seconds. + * `sampleRate` (1f) - Sound sample rate. 44100 by default. + * `iChannel0...3` (sampler2D) - Input channels 0 to 3. `null` by default. + * + * @name Phaser.GameObjects.Shader#uniforms + * @type {any} + * @since 3.17.0 + */ + this.uniforms = {}; + + /** + * The pointer bound to this shader, if any. + * Set via the chainable `setPointer` method, or by modifying this property directly. + * + * @name Phaser.GameObjects.Shader#pointer + * @type {Phaser.Input.Pointer} + * @since 3.17.0 + */ + this.pointer = null; + + /** + * The cached width of the renderer. + * + * @name Phaser.GameObjects.Shader#_rendererWidth + * @type {number} + * @private + * @since 3.17.0 + */ + this._rendererWidth = renderer.width; + + /** + * The cached height of the renderer. + * + * @name Phaser.GameObjects.Shader#_rendererHeight + * @type {number} + * @private + * @since 3.17.0 + */ + this._rendererHeight = renderer.height; + + /** + * Internal texture count tracker. + * + * @name Phaser.GameObjects.Shader#_textureCount + * @type {number} + * @private + * @since 3.17.0 + */ + this._textureCount = 0; + + this.setPosition(x, y); + this.setSize(width, height); + this.setOrigin(0.5, 0.5); + this.setShader(key, textures); + }, + + /** + * Sets the fragment and, optionally, the vertex shader source code that this Shader will use. + * This will immediately delete the active shader program, if set, and then create a new one + * with the given source. Finally, the shader uniforms are initialized. + * + * @method Phaser.GameObjects.Shader#setShader + * @since 3.17.0 + * + * @param {(string|Phaser.Display.BaseShader)} key - The key of the shader to use from the shader cache, or a BaseShader instance. + * @param {string[]} [textures] - Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. + * + * @return {this} This Shader instance. + */ + setShader: function (key, textures) + { + if (textures === undefined) { textures = []; } + + if (typeof key === 'string') + { + var cache = this.scene.sys.cache.shader; + + if (!cache.has(key)) + { + console.warn('Shader missing: ' + key); + return this; + } + + this.shader = cache.get(key); + } + else + { + this.shader = key; + } + + var gl = this.gl; + var renderer = this.renderer; + + if (this.program) + { + gl.deleteProgram(this.program); + } + + var program = renderer.createProgram(this.shader.vertexSrc, this.shader.fragmentSrc); + + // The default uniforms available within the vertex shader + renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); + renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); + renderer.setFloat2(program, 'uResolution', this.width, this.height); + + this.program = program; + + var d = new Date(); + + // The default uniforms available within the fragment shader + var defaultUniforms = { + resolution: { type: '2f', value: { x: this.width, y: this.height }}, + time: { type: '1f', value: 0 }, + mouse: { type: '2f', value: { x: this.width / 2, y: this.height / 2 } }, + date: { type: '4fv', value: [ d.getFullYear(), d.getMonth(), d.getDate(), d.getHours() * 60 * 60 + d.getMinutes() * 60 + d.getSeconds() ] }, + sampleRate: { type: '1f', value: 44100.0 }, + iChannel0: { type: 'sampler2D', value: null, textureData: { repeat: true } }, + iChannel1: { type: 'sampler2D', value: null, textureData: { repeat: true } }, + iChannel2: { type: 'sampler2D', value: null, textureData: { repeat: true } }, + iChannel3: { type: 'sampler2D', value: null, textureData: { repeat: true } } + }; + + if (this.shader.uniforms) + { + this.uniforms = Merge(this.shader.uniforms, defaultUniforms); + } + else + { + this.uniforms = defaultUniforms; + } + + for (var i = 0; i < 4; i++) + { + if (textures[i]) + { + this.setSampler2D('iChannel' + i, textures[i], i); + } + } + + this.initUniforms(); + + this.projOrtho(0, renderer.width, renderer.height, 0); + + return this; + }, + + /** + * Binds a Phaser Pointer object to this Shader. + * + * The screen position of the pointer will be set in to the shaders `mouse` uniform + * automatically every frame. Call this method with no arguments to unbind the pointer. + * + * @method Phaser.GameObjects.Shader#setPointer + * @since 3.17.0 + * + * @param {Phaser.Input.Pointer} [pointer] - The Pointer to bind to this shader. + * + * @return {this} This Shader instance. + */ + setPointer: function (pointer) + { + this.pointer = pointer; + + return this; + }, + + /** + * Sets this shader to use an orthographic projection matrix. + * This matrix is stored locally in the `projectionMatrix` property, + * as well as being bound to the `uProjectionMatrix` uniform. + * + * @method Phaser.GameObjects.Shader#projOrtho + * @since 3.17.0 + * + * @param {number} left - The left value. + * @param {number} right - The right value. + * @param {number} bottom - The bottom value. + * @param {number} top - The top value. + */ + projOrtho: function (left, right, bottom, top) + { + var near = -1000; + var far = 1000; + + var leftRight = 1 / (left - right); + var bottomTop = 1 / (bottom - top); + var nearFar = 1 / (near - far); + + var pm = this.projectionMatrix; + + pm[0] = -2 * leftRight; + pm[5] = -2 * bottomTop; + pm[10] = 2 * nearFar; + pm[12] = (left + right) * leftRight; + pm[13] = (top + bottom) * bottomTop; + pm[14] = (far + near) * nearFar; + + var program = this.program; + + this.renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); + + this._rendererWidth = right; + this._rendererHeight = bottom; + }, + + // Uniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/ + // http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf + + /** + * Initializes all of the uniforms this shader uses. + * + * @method Phaser.GameObjects.Shader#initUniforms + * @private + * @since 3.17.0 + */ + initUniforms: function () + { + var gl = this.gl; + var map = this.renderer.glFuncMap; + var program = this.program; + + this._textureCount = 0; + + for (var key in this.uniforms) + { + var uniform = this.uniforms[key]; + + var type = uniform.type; + var data = map[type]; + + uniform.uniformLocation = gl.getUniformLocation(program, key); + + if (type !== 'sampler2D') + { + uniform.glMatrix = data.matrix; + uniform.glValueLength = data.length; + uniform.glFunc = data.func; + } + } + }, + + /** + * Sets a sampler2D uniform on this shader. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * + * @method Phaser.GameObjects.Shader#setSampler2D + * @since 3.17.0 + * + * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`. + * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param {integer} [textureIndex=0] - The texture index. + * @param {any} [textureData] - Additional texture data. + * + * @return {this} This Shader instance. + */ + setSampler2D: function (uniformKey, textureKey, textureIndex, textureData) + { + if (textureIndex === undefined) { textureIndex = 0; } + + var textureManager = this.scene.sys.textures; + + if (textureManager.exists(textureKey)) + { + var frame = textureManager.getFrame(textureKey); + var uniform = this.uniforms[uniformKey]; + + uniform.textureKey = textureKey; + uniform.source = frame.source.image; + uniform.value = frame.glTexture; + + if (textureData) + { + uniform.textureData = textureData; + } + + this._textureCount = textureIndex; + + this.initSampler2D(uniform); + } + + return this; + }, + + /** + * Sets a property of a uniform already present on this shader. + * + * To modify the value of a uniform such as a 1f or 1i use the `value` property directly: + * + * ```javascript + * shader.setUniform('size.value', 16); + * ``` + * + * You can use dot notation to access deeper values, for example: + * + * ```javascript + * shader.setUniform('resolution.value.x', 512); + * ``` + * + * The change to the uniform will take effect the next time the shader is rendered. + * + * @method Phaser.GameObjects.Shader#setUniform + * @since 3.17.0 + * + * @param {string} key - The key of the uniform to modify. Use dots for deep properties, i.e. `resolution.value.x`. + * @param {any} value - The value to set into the uniform. + * + * @return {this} This Shader instance. + */ + setUniform: function (key, value) + { + SetValue(this.uniforms, key, value); + + return this; + }, + + /** + * Returns the uniform object for the given key, or `null` if the uniform couldn't be found. + * + * @method Phaser.GameObjects.Shader#getUniform + * @since 3.17.0 + * + * @param {string} key - The key of the uniform to return the value for. + * + * @return {this} This Shader instance. + */ + getUniform: function (key) + { + return GetFastValue(this.uniforms, key, null); + }, + + /** + * A short-cut method that will directly set the texture being used by the `iChannel0` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * + * @method Phaser.GameObjects.Shader#setChannel0 + * @since 3.17.0 + * + * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param {any} [textureData] - Additional texture data. + * + * @return {this} This Shader instance. + */ + setChannel0: function (textureKey, textureData) + { + return this.setSampler2D('iChannel0', textureKey, 0, textureData); + }, + + /** + * A short-cut method that will directly set the texture being used by the `iChannel1` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * + * @method Phaser.GameObjects.Shader#setChannel1 + * @since 3.17.0 + * + * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param {any} [textureData] - Additional texture data. + * + * @return {this} This Shader instance. + */ + setChannel1: function (textureKey, textureData) + { + return this.setSampler2D('iChannel1', textureKey, 1, textureData); + }, + + /** + * A short-cut method that will directly set the texture being used by the `iChannel2` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * + * @method Phaser.GameObjects.Shader#setChannel2 + * @since 3.17.0 + * + * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param {any} [textureData] - Additional texture data. + * + * @return {this} This Shader instance. + */ + setChannel2: function (textureKey, textureData) + { + return this.setSampler2D('iChannel2', textureKey, 2, textureData); + }, + + /** + * A short-cut method that will directly set the texture being used by the `iChannel3` sampler2D uniform. + * + * The textureKey given is the key from the Texture Manager cache. You cannot use a single frame + * from a texture, only the full image. Also, lots of shaders expect textures to be power-of-two sized. + * + * @method Phaser.GameObjects.Shader#setChannel3 + * @since 3.17.0 + * + * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded. + * @param {any} [textureData] - Additional texture data. + * + * @return {this} This Shader instance. + */ + setChannel3: function (textureKey, textureData) + { + return this.setSampler2D('iChannel3', textureKey, 3, textureData); + }, + + /** + * Internal method that takes a sampler2D uniform and prepares it for use by setting the + * gl texture parameters. + * + * @method Phaser.GameObjects.Shader#initSampler2D + * @private + * @since 3.17.0 + * + * @param {any} uniform - The sampler2D uniform to process. + */ + initSampler2D: function (uniform) + { + if (!uniform.value) + { + return; + } + + var gl = this.gl; + + gl.activeTexture(gl.TEXTURE0 + this._textureCount); + gl.bindTexture(gl.TEXTURE_2D, uniform.value); + + // Extended texture data + + var data = uniform.textureData; + + if (data) + { + // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D + + // mag / minFilter can be: gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR or gl.NEAREST + // wrapS/T can be: gl.CLAMP_TO_EDGE or gl.REPEAT + // format can be: gl.LUMINANCE or gl.RGBA + + var magFilter = gl[GetFastValue(data, 'magFilter', 'linear').toUpperCase()]; + var minFilter = gl[GetFastValue(data, 'minFilter', 'linear').toUpperCase()]; + var wrapS = gl[GetFastValue(data, 'wrapS', 'repeat').toUpperCase()]; + var wrapT = gl[GetFastValue(data, 'wrapT', 'repeat').toUpperCase()]; + var format = gl[GetFastValue(data, 'format', 'rgba').toUpperCase()]; + + if (data.repeat) + { + wrapS = gl.REPEAT; + wrapT = gl.REPEAT; + } + + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, !!data.flipY); + + if (data.width) + { + var width = GetFastValue(data, 'width', 512); + var height = GetFastValue(data, 'height', 2); + var border = GetFastValue(data, 'border', 0); + + // texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels) + gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, border, format, gl.UNSIGNED_BYTE, null); + } + else + { + // texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels) + gl.texImage2D(gl.TEXTURE_2D, 0, format, gl.RGBA, gl.UNSIGNED_BYTE, uniform.source); + } + + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); + } + + this.renderer.setProgram(this.program); + + gl.uniform1i(uniform.uniformLocation, this._textureCount); + + this._textureCount++; + }, + + /** + * Synchronizes all of the uniforms this shader uses. + * Each uniforms gl function is called in turn. + * + * @method Phaser.GameObjects.Shader#syncUniforms + * @private + * @since 3.17.0 + */ + syncUniforms: function () + { + var gl = this.gl; + + var uniforms = this.uniforms; + var uniform; + var length; + var glFunc; + var location; + var value; + var textureCount = 0; + + for (var key in uniforms) + { + uniform = uniforms[key]; + + glFunc = uniform.glFunc; + length = uniform.glValueLength; + location = uniform.uniformLocation; + value = uniform.value; + + if (length === 1) + { + if (uniform.glMatrix) + { + glFunc.call(gl, location, uniform.transpose, value); + } + else + { + glFunc.call(gl, location, value); + } + } + else if (length === 2) + { + glFunc.call(gl, location, value.x, value.y); + } + else if (length === 3) + { + glFunc.call(gl, location, value.x, value.y, value.z); + } + else if (length === 4) + { + glFunc.call(gl, location, value.x, value.y, value.z, value.w); + } + else if (uniform.type === 'sampler2D') + { + gl.activeTexture(gl['TEXTURE' + textureCount]); + + gl.bindTexture(gl.TEXTURE_2D, value); + + gl.uniform1i(location, textureCount); + + textureCount++; + } + } + }, + + /** + * Called automatically during render. + * + * This method performs matrix ITRS and then stores the resulting value in the `uViewMatrix` uniform. + * It then sets up the vertex buffer and shader, updates and syncs the uniforms ready + * for flush to be called. + * + * @method Phaser.GameObjects.Shader#load + * @since 3.17.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} matrix2D - The transform matrix to use during rendering. + */ + load: function (matrix2D) + { + // ITRS + + var width = this.width; + var height = this.height; + var renderer = this.renderer; + var program = this.program; + + var x = -this._displayOriginX; + var y = -this._displayOriginY; + + var vm = this.viewMatrix; + + vm[0] = matrix2D[0]; + vm[1] = matrix2D[1]; + vm[4] = matrix2D[2]; + vm[5] = matrix2D[3]; + vm[8] = matrix2D[4]; + vm[9] = matrix2D[5]; + vm[12] = vm[0] * x + vm[4] * y; + vm[13] = vm[1] * x + vm[5] * y; + + // Update vertex shader uniforms + + this.renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); + this.renderer.setFloat2(program, 'uResolution', this.width, this.height); + + // Update fragment shader uniforms + + var uniforms = this.uniforms; + var res = uniforms.resolution; + + res.value.x = width; + res.value.y = height; + + uniforms.time.value = renderer.game.loop.getDuration(); + + var pointer = this.pointer; + + if (pointer) + { + var mouse = uniforms.mouse; + + var px = pointer.x / width; + var py = 1 - pointer.y / height; + + mouse.value.x = px.toFixed(2); + mouse.value.y = py.toFixed(2); + } + + this.syncUniforms(); + }, + + /** + * Called automatically during render. + * + * Sets the active shader, loads the vertex buffer and then draws. + * + * @method Phaser.GameObjects.Shader#flush + * @since 3.17.0 + */ + flush: function () + { + // Bind + + var width = this.width; + var height = this.height; + var program = this.program; + + var gl = this.gl; + var vertexBuffer = this.vertexBuffer; + var renderer = this.renderer; + var vertexSize = Float32Array.BYTES_PER_ELEMENT * 2; + + renderer.setProgram(program); + renderer.setVertexBuffer(vertexBuffer); + + var location = gl.getAttribLocation(program, 'inPosition'); + + if (location !== -1) + { + gl.enableVertexAttribArray(location); + + gl.vertexAttribPointer(location, 2, gl.FLOAT, false, vertexSize, 0); + } + + // Draw + + var vf = this.vertexViewF32; + + vf[3] = height; + vf[4] = width; + vf[5] = height; + vf[8] = width; + vf[9] = height; + vf[10] = width; + + // Flush + + var vertexCount = 6; + + gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); + + gl.drawArrays(gl.TRIANGLES, 0, vertexCount); + }, + + /** + * A NOOP method so you can pass a Shader to a Container. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Shader#setAlpha + * @private + * @since 3.17.0 + */ + setAlpha: function () + { + }, + + /** + * A NOOP method so you can pass a Shader to a Container. + * Calling this method will do nothing. It is intentionally empty. + * + * @method Phaser.GameObjects.Shader#setBlendMode + * @private + * @since 3.17.0 + */ + setBlendMode: function () + { + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.Shader#preDestroy + * @protected + * @since 3.17.0 + */ + preDestroy: function () + { + var gl = this.gl; + + gl.deleteProgram(this.program); + gl.deleteBuffer(this.vertexBuffer); + } + +}); + +module.exports = Shader; + + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); +var LineToCircle = __webpack_require__(197); + +/** + * Checks for intersection between the line segment and circle, + * and returns the intersection points as a Point object array. + * + * @function Phaser.Geom.Intersects.GetLineToCircle + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line segment to check. + * @param {Phaser.Geom.Circle} circle - The circle to check against the line. + * @param {array} [out] - An optional array in which to store the points of intersection. + * + * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array. + */ +var GetLineToCircle = function (line, circle, out) +{ + if (out === undefined) { out = []; } + + if (LineToCircle(line, circle)) + { + var lx1 = line.x1; + var ly1 = line.y1; + + var lx2 = line.x2; + var ly2 = line.y2; + + var cx = circle.x; + var cy = circle.y; + var cr = circle.radius; + + var lDirX = lx2 - lx1; + var lDirY = ly2 - ly1; + var oDirX = lx1 - cx; + var oDirY = ly1 - cy; + + var coefficientA = lDirX * lDirX + lDirY * lDirY; + var coefficientB = 2 * (lDirX * oDirX + lDirY * oDirY); + var coefficientC = oDirX * oDirX + oDirY * oDirY - cr * cr; + + var lambda = (coefficientB * coefficientB) - (4 * coefficientA * coefficientC); + + var x, y; + + if (lambda === 0) + { + var root = -coefficientB / (2 * coefficientA); + x = lx1 + root * lDirX; + y = ly1 + root * lDirY; + if (root >= 0 && root <= 1) + { + out.push(new Point(x, y)); + } + } + else if (lambda > 0) + { + var root1 = (-coefficientB - Math.sqrt(lambda)) / (2 * coefficientA); + x = lx1 + root1 * lDirX; + y = ly1 + root1 * lDirY; + if (root1 >= 0 && root1 <= 1) + { + out.push(new Point(x, y)); + } + + var root2 = (-coefficientB + Math.sqrt(lambda)) / (2 * coefficientA); + x = lx1 + root2 * lDirX; + y = ly1 + root2 * lDirY; + if (root2 >= 0 && root2 <= 1) + { + out.push(new Point(x, y)); + } + } + } + + return out; +}; + +module.exports = GetLineToCircle; + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Contains = __webpack_require__(46); +var Point = __webpack_require__(3); + +var tmp = new Point(); + +/** + * Checks for intersection between the line segment and circle. + * + * Based on code by [Matt DesLauriers](https://github.com/mattdesl/line-circle-collision/blob/master/LICENSE.md). + * + * @function Phaser.Geom.Intersects.LineToCircle + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line segment to check. + * @param {Phaser.Geom.Circle} circle - The circle to check against the line. + * @param {(Phaser.Geom.Point|any)} [nearest] - An optional Point-like object. If given the closest point on the Line where the circle intersects will be stored in this object. + * + * @return {boolean} `true` if the two objects intersect, otherwise `false`. + */ +var LineToCircle = function (line, circle, nearest) +{ + if (nearest === undefined) { nearest = tmp; } + + if (Contains(circle, line.x1, line.y1)) + { + nearest.x = line.x1; + nearest.y = line.y1; + + return true; + } + + if (Contains(circle, line.x2, line.y2)) + { + nearest.x = line.x2; + nearest.y = line.y2; + + return true; + } + + var dx = line.x2 - line.x1; + var dy = line.y2 - line.y1; + + var lcx = circle.x - line.x1; + var lcy = circle.y - line.y1; + + // project lc onto d, resulting in vector p + var dLen2 = (dx * dx) + (dy * dy); + var px = dx; + var py = dy; + + if (dLen2 > 0) + { + var dp = ((lcx * dx) + (lcy * dy)) / dLen2; + + px *= dp; + py *= dp; + } + + nearest.x = line.x1 + px; + nearest.y = line.y1 + py; + + // len2 of p + var pLen2 = (px * px) + (py * py); + + return ( + pLen2 <= dLen2 && + ((px * dx) + (py * dy)) >= 0 && + Contains(circle, nearest.x, nearest.y) + ); +}; + +module.exports = LineToCircle; + + +/***/ }), +/* 198 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); +var LineToLine = __webpack_require__(82); +var LineToRectangle = __webpack_require__(405); + +/** + * Checks for intersection between the Line and a Rectangle shape, + * and returns the intersection points as a Point object array. + * + * @function Phaser.Geom.Intersects.GetLineToRectangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The Line to check for intersection. + * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle to check for intersection. + * @param {array} [out] - An optional array in which to store the points of intersection. + * + * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array. + */ +var GetLineToRectangle = function (line, rect, out) +{ + if (out === undefined) { out = []; } + + if (LineToRectangle(line, rect)) + { + var lineA = rect.getLineA(); + var lineB = rect.getLineB(); + var lineC = rect.getLineC(); + var lineD = rect.getLineD(); + + var output = [ new Point(), new Point(), new Point(), new Point() ]; + + var result = [ + LineToLine(lineA, line, output[0]), + LineToLine(lineB, line, output[1]), + LineToLine(lineC, line, output[2]), + LineToLine(lineD, line, output[3]) + ]; + + for (var i = 0; i < 4; i++) + { + if (result[i]) { out.push(output[i]); } + } + } + + return out; +}; + +module.exports = GetLineToRectangle; + + +/***/ }), +/* 199 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// http://www.blackpawn.com/texts/pointinpoly/ + +// points is an array of Point-like objects with public x/y properties +// returns an array containing all points that are within the triangle, or an empty array if none +// if 'returnFirst' is true it will return after the first point within the triangle is found + +/** + * Filters an array of point-like objects to only those contained within a triangle. + * If `returnFirst` is true, will return an array containing only the first point in the provided array that is within the triangle (or an empty array if there are no such points). + * + * @function Phaser.Geom.Triangle.ContainsArray + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The triangle that the points are being checked in. + * @param {Phaser.Geom.Point[]} points - An array of point-like objects (objects that have an `x` and `y` property) + * @param {boolean} [returnFirst=false] - If `true`, return an array containing only the first point found that is within the triangle. + * @param {array} [out] - If provided, the points that are within the triangle will be appended to this array instead of being added to a new array. If `returnFirst` is true, only the first point found within the triangle will be appended. This array will also be returned by this function. + * + * @return {Phaser.Geom.Point[]} An array containing all the points from `points` that are within the triangle, if an array was provided as `out`, points will be appended to that array and it will also be returned here. + */ +var ContainsArray = function (triangle, points, returnFirst, out) +{ + if (returnFirst === undefined) { returnFirst = false; } + if (out === undefined) { out = []; } + + var v0x = triangle.x3 - triangle.x1; + var v0y = triangle.y3 - triangle.y1; + + var v1x = triangle.x2 - triangle.x1; + var v1y = triangle.y2 - triangle.y1; + + var dot00 = (v0x * v0x) + (v0y * v0y); + var dot01 = (v0x * v1x) + (v0y * v1y); + var dot11 = (v1x * v1x) + (v1y * v1y); + + // Compute barycentric coordinates + var b = ((dot00 * dot11) - (dot01 * dot01)); + var inv = (b === 0) ? 0 : (1 / b); + + var u; + var v; + var v2x; + var v2y; + var dot02; + var dot12; + + var x1 = triangle.x1; + var y1 = triangle.y1; + + for (var i = 0; i < points.length; i++) + { + v2x = points[i].x - x1; + v2y = points[i].y - y1; + + dot02 = (v0x * v2x) + (v0y * v2y); + dot12 = (v1x * v2x) + (v1y * v2y); + + u = ((dot11 * dot02) - (dot01 * dot12)) * inv; + v = ((dot00 * dot12) - (dot01 * dot02)) * inv; + + if (u >= 0 && v >= 0 && (u + v < 1)) + { + out.push({ x: points[i].x, y: points[i].y }); + + if (returnFirst) + { + break; + } + } + } + + return out; +}; + +module.exports = ContainsArray; + + +/***/ }), +/* 200 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a line around the given coordinates by the given angle in radians. + * + * @function Phaser.Geom.Line.RotateAroundXY + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} line - The line to rotate. + * @param {number} x - The horizontal coordinate to rotate the line around. + * @param {number} y - The vertical coordinate to rotate the line around. + * @param {number} angle - The angle of rotation in radians. + * + * @return {Phaser.Geom.Line} The rotated line. + */ +var RotateAroundXY = function (line, x, y, angle) +{ + var c = Math.cos(angle); + var s = Math.sin(angle); + + var tx = line.x1 - x; + var ty = line.y1 - y; + + line.x1 = tx * c - ty * s + x; + line.y1 = tx * s + ty * c + y; + + tx = line.x2 - x; + ty = line.y2 - y; + + line.x2 = tx * c - ty * s + x; + line.y2 = tx * s + ty * c + y; + + return line; +}; + +module.exports = RotateAroundXY; + + +/***/ }), +/* 201 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the width/height ratio of a rectangle. + * + * @function Phaser.Geom.Rectangle.GetAspectRatio + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The rectangle. + * + * @return {number} The width/height ratio of the rectangle. + */ +var GetAspectRatio = function (rect) +{ + return (rect.height === 0) ? NaN : rect.width / rect.height; +}; + +module.exports = GetAspectRatio; + + +/***/ }), +/* 202 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotates an entire Triangle at a given angle about a specific point. + * + * @function Phaser.Geom.Triangle.RotateAroundXY + * @since 3.0.0 + * + * @generic {Phaser.Geom.Triangle} O - [triangle,$return] + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to rotate. + * @param {number} x - The X coordinate of the point to rotate the Triangle about. + * @param {number} y - The Y coordinate of the point to rotate the Triangle about. + * @param {number} angle - The angle by which to rotate the Triangle, in radians. + * + * @return {Phaser.Geom.Triangle} The rotated Triangle. + */ +var RotateAroundXY = function (triangle, x, y, angle) +{ + var c = Math.cos(angle); + var s = Math.sin(angle); + + var tx = triangle.x1 - x; + var ty = triangle.y1 - y; + + triangle.x1 = tx * c - ty * s + x; + triangle.y1 = tx * s + ty * c + y; + + tx = triangle.x2 - x; + ty = triangle.y2 - y; + + triangle.x2 = tx * c - ty * s + x; + triangle.y2 = tx * s + ty * c + y; + + tx = triangle.x3 - x; + ty = triangle.y3 - y; + + triangle.x3 = tx * c - ty * s + x; + triangle.y3 = tx * s + ty * c + y; + + return triangle; +}; + +module.exports = RotateAroundXY; + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Input.Gamepad.Events + */ + +module.exports = { + + BUTTON_DOWN: __webpack_require__(1150), + BUTTON_UP: __webpack_require__(1151), + CONNECTED: __webpack_require__(1152), + DISCONNECTED: __webpack_require__(1153), + GAMEPAD_BUTTON_DOWN: __webpack_require__(1154), + GAMEPAD_BUTTON_UP: __webpack_require__(1155) + +}; + + +/***/ }), +/* 204 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Given a File and a baseURL value this returns the URL the File will use to download from. + * + * @function Phaser.Loader.GetURL + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - The File object. + * @param {string} baseURL - A default base URL. + * + * @return {string} The URL the File will use. + */ +var GetURL = function (file, baseURL) +{ + if (!file.url) + { + return false; + } + + if (file.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)) + { + return file.url; + } + else + { + return baseURL + file.url; + } +}; + +module.exports = GetURL; + + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(17); +var XHRSettings = __webpack_require__(133); + +/** + * Takes two XHRSettings Objects and creates a new XHRSettings object from them. + * + * The new object is seeded by the values given in the global settings, but any setting in + * the local object overrides the global ones. + * + * @function Phaser.Loader.MergeXHRSettings + * @since 3.0.0 + * + * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. + * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. + */ +var MergeXHRSettings = function (global, local) +{ + var output = (global === undefined) ? XHRSettings() : Extend({}, global); + + if (local) + { + for (var setting in local) + { + if (local[setting] !== undefined) + { + output[setting] = local[setting]; + } + } + } + + return output; +}; + +module.exports = MergeXHRSettings; + + +/***/ }), +/* 206 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); +var ParseXML = __webpack_require__(336); + +/** + * @classdesc + * A single XML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#xml method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#xml. + * + * @class XMLFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.XMLFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var XMLFile = new Class({ + + Extends: File, + + initialize: + + function XMLFile (loader, key, url, xhrSettings) + { + var extension = 'xml'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'xml', + cache: loader.cacheManager.xml, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.XMLFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = ParseXML(this.xhrLoader.responseText); + + if (this.data) + { + this.onProcessComplete(); + } + else + { + console.warn('Invalid XMLFile: ' + this.key); + + this.onProcessError(); + } + } + +}); + +/** + * Adds an XML file, or array of XML files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.xml('wavedata', 'files/AlienWaveData.xml'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global XML Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the XML Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the XML Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.xml({ + * key: 'wavedata', + * url: 'files/AlienWaveData.xml' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.XMLFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.xml('wavedata', 'files/AlienWaveData.xml'); + * // and later in your game ... + * var data = this.cache.xml.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the XML Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.xml". It will always add `.xml` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the XML File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#xml + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.XMLFileConfig|Phaser.Types.Loader.FileTypes.XMLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('xml', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new XMLFile(this, key[i])); + } + } + else + { + this.addFile(new XMLFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = XMLFile; + + +/***/ }), +/* 207 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Physics.Arcade.Components + */ + +module.exports = { + + Acceleration: __webpack_require__(1209), + Angular: __webpack_require__(1210), + Bounce: __webpack_require__(1211), + Debug: __webpack_require__(1212), + Drag: __webpack_require__(1213), + Enable: __webpack_require__(1214), + Friction: __webpack_require__(1215), + Gravity: __webpack_require__(1216), + Immovable: __webpack_require__(1217), + Mass: __webpack_require__(1218), + Size: __webpack_require__(1219), + Velocity: __webpack_require__(1220) + +}; + + +/***/ }), +/* 208 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Physics.Arcade.Events + */ + +module.exports = { + + COLLIDE: __webpack_require__(1222), + OVERLAP: __webpack_require__(1223), + PAUSE: __webpack_require__(1224), + RESUME: __webpack_require__(1225), + TILE_COLLIDE: __webpack_require__(1226), + TILE_OVERLAP: __webpack_require__(1227), + WORLD_BOUNDS: __webpack_require__(1228), + WORLD_STEP: __webpack_require__(1229) + +}; + + +/***/ }), +/* 209 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Composite` module contains methods for creating and manipulating composite bodies. +* A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure. +* It is important to use the functions in this module to modify composites, rather than directly modifying their properties. +* Note that the `Matter.World` object is also a type of `Matter.Composite` and as such all composite methods here can also operate on a `Matter.World`. +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Composite +*/ + +var Composite = {}; + +module.exports = Composite; + +var Events = __webpack_require__(227); +var Common = __webpack_require__(37); +var Bounds = __webpack_require__(100); +var Body = __webpack_require__(60); + +(function() { + + /** + * Creates a new composite. The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properites section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {} [options] + * @return {composite} A new composite + */ + Composite.create = function(options) { + return Common.extend({ + id: Common.nextId(), + type: 'composite', + parent: null, + isModified: false, + bodies: [], + constraints: [], + composites: [], + label: 'Composite', + plugin: {} + }, options); + }; + + /** + * Sets the composite's `isModified` flag. + * If `updateParents` is true, all parents will be set (default: false). + * If `updateChildren` is true, all children will be set (default: false). + * @method setModified + * @param {composite} composite + * @param {boolean} isModified + * @param {boolean} [updateParents=false] + * @param {boolean} [updateChildren=false] + */ + Composite.setModified = function(composite, isModified, updateParents, updateChildren) { + composite.isModified = isModified; + + if (updateParents && composite.parent) { + Composite.setModified(composite.parent, isModified, updateParents, updateChildren); + } + + if (updateChildren) { + for(var i = 0; i < composite.composites.length; i++) { + var childComposite = composite.composites[i]; + Composite.setModified(childComposite, isModified, updateParents, updateChildren); + } + } + }; + + /** + * Generic add function. Adds one or many body(s), constraint(s) or a composite(s) to the given composite. + * Triggers `beforeAdd` and `afterAdd` events on the `composite`. + * @method add + * @param {composite} composite + * @param {} object + * @return {composite} The original composite with the objects added + */ + Composite.add = function(composite, object) { + var objects = [].concat(object); + + Events.trigger(composite, 'beforeAdd', { object: object }); + + for (var i = 0; i < objects.length; i++) { + var obj = objects[i]; + + switch (obj.type) { + + case 'body': + // skip adding compound parts + if (obj.parent !== obj) { + Common.warn('Composite.add: skipped adding a compound body part (you must add its parent instead)'); + break; + } + + Composite.addBody(composite, obj); + break; + case 'constraint': + Composite.addConstraint(composite, obj); + break; + case 'composite': + Composite.addComposite(composite, obj); + break; + case 'mouseConstraint': + Composite.addConstraint(composite, obj.constraint); + break; + + } + } + + Events.trigger(composite, 'afterAdd', { object: object }); + + return composite; + }; + + /** + * Generic remove function. Removes one or many body(s), constraint(s) or a composite(s) to the given composite. + * Optionally searching its children recursively. + * Triggers `beforeRemove` and `afterRemove` events on the `composite`. + * @method remove + * @param {composite} composite + * @param {} object + * @param {boolean} [deep=false] + * @return {composite} The original composite with the objects removed + */ + Composite.remove = function(composite, object, deep) { + var objects = [].concat(object); + + Events.trigger(composite, 'beforeRemove', { object: object }); + + for (var i = 0; i < objects.length; i++) { + var obj = objects[i]; + + switch (obj.type) { + + case 'body': + Composite.removeBody(composite, obj, deep); + break; + case 'constraint': + Composite.removeConstraint(composite, obj, deep); + break; + case 'composite': + Composite.removeComposite(composite, obj, deep); + break; + case 'mouseConstraint': + Composite.removeConstraint(composite, obj.constraint); + break; + + } + } + + Events.trigger(composite, 'afterRemove', { object: object }); + + return composite; + }; + + /** + * Adds a composite to the given composite. + * @private + * @method addComposite + * @param {composite} compositeA + * @param {composite} compositeB + * @return {composite} The original compositeA with the objects from compositeB added + */ + Composite.addComposite = function(compositeA, compositeB) { + compositeA.composites.push(compositeB); + compositeB.parent = compositeA; + Composite.setModified(compositeA, true, true, false); + return compositeA; + }; + + /** + * Removes a composite from the given composite, and optionally searching its children recursively. + * @private + * @method removeComposite + * @param {composite} compositeA + * @param {composite} compositeB + * @param {boolean} [deep=false] + * @return {composite} The original compositeA with the composite removed + */ + Composite.removeComposite = function(compositeA, compositeB, deep) { + var position = compositeA.composites.indexOf(compositeB); + if (position !== -1) { + Composite.removeCompositeAt(compositeA, position); + Composite.setModified(compositeA, true, true, false); + } + + if (deep) { + for (var i = 0; i < compositeA.composites.length; i++){ + Composite.removeComposite(compositeA.composites[i], compositeB, true); + } + } + + return compositeA; + }; + + /** + * Removes a composite from the given composite. + * @private + * @method removeCompositeAt + * @param {composite} composite + * @param {number} position + * @return {composite} The original composite with the composite removed + */ + Composite.removeCompositeAt = function(composite, position) { + composite.composites.splice(position, 1); + Composite.setModified(composite, true, true, false); + return composite; + }; + + /** + * Adds a body to the given composite. + * @private + * @method addBody + * @param {composite} composite + * @param {body} body + * @return {composite} The original composite with the body added + */ + Composite.addBody = function(composite, body) { + composite.bodies.push(body); + Composite.setModified(composite, true, true, false); + return composite; + }; + + /** + * Removes a body from the given composite, and optionally searching its children recursively. + * @private + * @method removeBody + * @param {composite} composite + * @param {body} body + * @param {boolean} [deep=false] + * @return {composite} The original composite with the body removed + */ + Composite.removeBody = function(composite, body, deep) { + var position = composite.bodies.indexOf(body); + if (position !== -1) { + Composite.removeBodyAt(composite, position); + Composite.setModified(composite, true, true, false); + } + + if (deep) { + for (var i = 0; i < composite.composites.length; i++){ + Composite.removeBody(composite.composites[i], body, true); + } + } + + return composite; + }; + + /** + * Removes a body from the given composite. + * @private + * @method removeBodyAt + * @param {composite} composite + * @param {number} position + * @return {composite} The original composite with the body removed + */ + Composite.removeBodyAt = function(composite, position) { + composite.bodies.splice(position, 1); + Composite.setModified(composite, true, true, false); + return composite; + }; + + /** + * Adds a constraint to the given composite. + * @private + * @method addConstraint + * @param {composite} composite + * @param {constraint} constraint + * @return {composite} The original composite with the constraint added + */ + Composite.addConstraint = function(composite, constraint) { + composite.constraints.push(constraint); + Composite.setModified(composite, true, true, false); + return composite; + }; + + /** + * Removes a constraint from the given composite, and optionally searching its children recursively. + * @private + * @method removeConstraint + * @param {composite} composite + * @param {constraint} constraint + * @param {boolean} [deep=false] + * @return {composite} The original composite with the constraint removed + */ + Composite.removeConstraint = function(composite, constraint, deep) { + var position = composite.constraints.indexOf(constraint); + if (position !== -1) { + Composite.removeConstraintAt(composite, position); + } + + if (deep) { + for (var i = 0; i < composite.composites.length; i++){ + Composite.removeConstraint(composite.composites[i], constraint, true); + } + } + + return composite; + }; + + /** + * Removes a body from the given composite. + * @private + * @method removeConstraintAt + * @param {composite} composite + * @param {number} position + * @return {composite} The original composite with the constraint removed + */ + Composite.removeConstraintAt = function(composite, position) { + composite.constraints.splice(position, 1); + Composite.setModified(composite, true, true, false); + return composite; + }; + + /** + * Removes all bodies, constraints and composites from the given composite. + * Optionally clearing its children recursively. + * @method clear + * @param {composite} composite + * @param {boolean} keepStatic + * @param {boolean} [deep=false] + */ + Composite.clear = function(composite, keepStatic, deep) { + if (deep) { + for (var i = 0; i < composite.composites.length; i++){ + Composite.clear(composite.composites[i], keepStatic, true); + } + } + + if (keepStatic) { + composite.bodies = composite.bodies.filter(function(body) { return body.isStatic; }); + } else { + composite.bodies.length = 0; + } + + composite.constraints.length = 0; + composite.composites.length = 0; + Composite.setModified(composite, true, true, false); + + return composite; + }; + + /** + * Returns all bodies in the given composite, including all bodies in its children, recursively. + * @method allBodies + * @param {composite} composite + * @return {body[]} All the bodies + */ + Composite.allBodies = function(composite) { + var bodies = [].concat(composite.bodies); + + for (var i = 0; i < composite.composites.length; i++) + bodies = bodies.concat(Composite.allBodies(composite.composites[i])); + + return bodies; + }; + + /** + * Returns all constraints in the given composite, including all constraints in its children, recursively. + * @method allConstraints + * @param {composite} composite + * @return {constraint[]} All the constraints + */ + Composite.allConstraints = function(composite) { + var constraints = [].concat(composite.constraints); + + for (var i = 0; i < composite.composites.length; i++) + constraints = constraints.concat(Composite.allConstraints(composite.composites[i])); + + return constraints; + }; + + /** + * Returns all composites in the given composite, including all composites in its children, recursively. + * @method allComposites + * @param {composite} composite + * @return {composite[]} All the composites + */ + Composite.allComposites = function(composite) { + var composites = [].concat(composite.composites); + + for (var i = 0; i < composite.composites.length; i++) + composites = composites.concat(Composite.allComposites(composite.composites[i])); + + return composites; + }; + + /** + * Searches the composite recursively for an object matching the type and id supplied, null if not found. + * @method get + * @param {composite} composite + * @param {number} id + * @param {string} type + * @return {object} The requested object, if found + */ + Composite.get = function(composite, id, type) { + var objects, + object; + + switch (type) { + case 'body': + objects = Composite.allBodies(composite); + break; + case 'constraint': + objects = Composite.allConstraints(composite); + break; + case 'composite': + objects = Composite.allComposites(composite).concat(composite); + break; + } + + if (!objects) + return null; + + object = objects.filter(function(object) { + return object.id.toString() === id.toString(); + }); + + return object.length === 0 ? null : object[0]; + }; + + /** + * Moves the given object(s) from compositeA to compositeB (equal to a remove followed by an add). + * @method move + * @param {compositeA} compositeA + * @param {object[]} objects + * @param {compositeB} compositeB + * @return {composite} Returns compositeA + */ + Composite.move = function(compositeA, objects, compositeB) { + Composite.remove(compositeA, objects); + Composite.add(compositeB, objects); + return compositeA; + }; + + /** + * Assigns new ids for all objects in the composite, recursively. + * @method rebase + * @param {composite} composite + * @return {composite} Returns composite + */ + Composite.rebase = function(composite) { + var objects = Composite.allBodies(composite) + .concat(Composite.allConstraints(composite)) + .concat(Composite.allComposites(composite)); + + for (var i = 0; i < objects.length; i++) { + objects[i].id = Common.nextId(); + } + + Composite.setModified(composite, true, true, false); + + return composite; + }; + + /** + * Translates all children in the composite by a given vector relative to their current positions, + * without imparting any velocity. + * @method translate + * @param {composite} composite + * @param {vector} translation + * @param {bool} [recursive=true] + */ + Composite.translate = function(composite, translation, recursive) { + var bodies = recursive ? Composite.allBodies(composite) : composite.bodies; + + for (var i = 0; i < bodies.length; i++) { + Body.translate(bodies[i], translation); + } + + Composite.setModified(composite, true, true, false); + + return composite; + }; + + /** + * Rotates all children in the composite by a given angle about the given point, without imparting any angular velocity. + * @method rotate + * @param {composite} composite + * @param {number} rotation + * @param {vector} point + * @param {bool} [recursive=true] + */ + Composite.rotate = function(composite, rotation, point, recursive) { + var cos = Math.cos(rotation), + sin = Math.sin(rotation), + bodies = recursive ? Composite.allBodies(composite) : composite.bodies; + + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i], + dx = body.position.x - point.x, + dy = body.position.y - point.y; + + Body.setPosition(body, { + x: point.x + (dx * cos - dy * sin), + y: point.y + (dx * sin + dy * cos) + }); + + Body.rotate(body, rotation); + } + + Composite.setModified(composite, true, true, false); + + return composite; + }; + + /** + * Scales all children in the composite, including updating physical properties (mass, area, axes, inertia), from a world-space point. + * @method scale + * @param {composite} composite + * @param {number} scaleX + * @param {number} scaleY + * @param {vector} point + * @param {bool} [recursive=true] + */ + Composite.scale = function(composite, scaleX, scaleY, point, recursive) { + var bodies = recursive ? Composite.allBodies(composite) : composite.bodies; + + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i], + dx = body.position.x - point.x, + dy = body.position.y - point.y; + + Body.setPosition(body, { + x: point.x + dx * scaleX, + y: point.y + dy * scaleY + }); + + Body.scale(body, scaleX, scaleY); + } + + Composite.setModified(composite, true, true, false); + + return composite; + }; + + /** + * Returns the union of the bounds of all of the composite's bodies. + * @method bounds + * @param {composite} composite The composite. + * @returns {bounds} The composite bounds. + */ + Composite.bounds = function(composite) { + var bodies = Composite.allBodies(composite), + vertices = []; + + for (var i = 0; i < bodies.length; i += 1) { + var body = bodies[i]; + vertices.push(body.bounds.min, body.bounds.max); + } + + return Bounds.create(vertices); + }; + + /* + * + * Events Documentation + * + */ + + /** + * Fired when a call to `Composite.add` is made, before objects have been added. + * + * @event beforeAdd + * @param {} event An event object + * @param {} event.object The object(s) to be added (may be a single body, constraint, composite or a mixed array of these) + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /** + * Fired when a call to `Composite.add` is made, after objects have been added. + * + * @event afterAdd + * @param {} event An event object + * @param {} event.object The object(s) that have been added (may be a single body, constraint, composite or a mixed array of these) + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /** + * Fired when a call to `Composite.remove` is made, before objects have been removed. + * + * @event beforeRemove + * @param {} event An event object + * @param {} event.object The object(s) to be removed (may be a single body, constraint, composite or a mixed array of these) + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /** + * Fired when a call to `Composite.remove` is made, after objects have been removed. + * + * @event afterRemove + * @param {} event An event object + * @param {} event.object The object(s) that have been removed (may be a single body, constraint, composite or a mixed array of these) + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /* + * + * Properties Documentation + * + */ + + /** + * An integer `Number` uniquely identifying number generated in `Composite.create` by `Common.nextId`. + * + * @property id + * @type number + */ + + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "composite" + * @readOnly + */ + + /** + * An arbitrary `String` name to help the user identify and manage composites. + * + * @property label + * @type string + * @default "Composite" + */ + + /** + * A flag that specifies whether the composite has been modified during the current step. + * Most `Matter.Composite` methods will automatically set this flag to `true` to inform the engine of changes to be handled. + * If you need to change it manually, you should use the `Composite.setModified` method. + * + * @property isModified + * @type boolean + * @default false + */ + + /** + * The `Composite` that is the parent of this composite. It is automatically managed by the `Matter.Composite` methods. + * + * @property parent + * @type composite + * @default null + */ + + /** + * An array of `Body` that are _direct_ children of this composite. + * To add or remove bodies you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property. + * If you wish to recursively find all descendants, you should use the `Composite.allBodies` method. + * + * @property bodies + * @type body[] + * @default [] + */ + + /** + * An array of `Constraint` that are _direct_ children of this composite. + * To add or remove constraints you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property. + * If you wish to recursively find all descendants, you should use the `Composite.allConstraints` method. + * + * @property constraints + * @type constraint[] + * @default [] + */ + + /** + * An array of `Composite` that are _direct_ children of this composite. + * To add or remove composites you should use `Composite.add` and `Composite.remove` methods rather than directly modifying this property. + * If you wish to recursively find all descendants, you should use the `Composite.allComposites` method. + * + * @property composites + * @type composite[] + * @default [] + */ + + /** + * An object reserved for storing plugin-specific properties. + * + * @property plugin + * @type {} + */ + +})(); + + +/***/ }), +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTileAt = __webpack_require__(137); + +/** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * + * @function Phaser.Tilemaps.Components.CalculateFacesAt + * @private + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate. + * @param {integer} tileY - The y coordinate. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var CalculateFacesAt = function (tileX, tileY, layer) +{ + var tile = GetTileAt(tileX, tileY, true, layer); + var above = GetTileAt(tileX, tileY - 1, true, layer); + var below = GetTileAt(tileX, tileY + 1, true, layer); + var left = GetTileAt(tileX - 1, tileY, true, layer); + var right = GetTileAt(tileX + 1, tileY, true, layer); + var tileCollides = tile && tile.collides; + + // Assume the changed tile has all interesting edges + if (tileCollides) + { + tile.faceTop = true; + tile.faceBottom = true; + tile.faceLeft = true; + tile.faceRight = true; + } + + // Reset edges that are shared between tile and its neighbors + if (above && above.collides) + { + if (tileCollides) { tile.faceTop = false; } + above.faceBottom = !tileCollides; + } + + if (below && below.collides) + { + if (tileCollides) { tile.faceBottom = false; } + below.faceTop = !tileCollides; + } + + if (left && left.collides) + { + if (tileCollides) { tile.faceLeft = false; } + left.faceRight = !tileCollides; + } + + if (right && right.collides) + { + if (tileCollides) { tile.faceRight = false; } + right.faceLeft = !tileCollides; + } + + if (tile && !tile.collides) { tile.resetFaces(); } + + return tile; +}; + +module.exports = CalculateFacesAt; + + +/***/ }), +/* 211 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Tile = __webpack_require__(72); +var IsInLayerBounds = __webpack_require__(101); +var CalculateFacesAt = __webpack_require__(210); +var SetTileCollision = __webpack_require__(71); + +/** + * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index + * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified + * location. If you pass in an index, only the index at the specified location will be changed. + * Collision information will be recalculated at the specified location. + * + * @function Phaser.Tilemaps.Components.PutTileAt + * @private + * @since 3.0.0 + * + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. + */ +var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) +{ + if (!IsInLayerBounds(tileX, tileY, layer)) { return null; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + + var oldTile = layer.data[tileY][tileX]; + var oldTileCollides = oldTile && oldTile.collides; + + if (tile instanceof Tile) + { + if (layer.data[tileY][tileX] === null) + { + layer.data[tileY][tileX] = new Tile(layer, tile.index, tileX, tileY, tile.width, tile.height); + } + layer.data[tileY][tileX].copy(tile); + } + else + { + var index = tile; + if (layer.data[tileY][tileX] === null) + { + layer.data[tileY][tileX] = new Tile(layer, index, tileX, tileY, layer.tileWidth, layer.tileHeight); + } + else + { + layer.data[tileY][tileX].index = index; + } + } + + // Updating colliding flag on the new tile + var newTile = layer.data[tileY][tileX]; + var collides = layer.collideIndexes.indexOf(newTile.index) !== -1; + SetTileCollision(newTile, collides); + + // Recalculate faces only if the colliding flag at (tileX, tileY) has changed + if (recalculateFaces && (oldTileCollides !== newTile.collides)) + { + CalculateFacesAt(tileX, tileY, layer); + } + + return newTile; +}; + +module.exports = PutTileAt; + + + +/***/ }), +/* 212 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Internally used method to keep track of the tile indexes that collide within a layer. This + * updates LayerData.collideIndexes to either contain or not contain the given `tileIndex`. + * + * @function Phaser.Tilemaps.Components.SetLayerCollisionIndex + * @private + * @since 3.0.0 + * + * @param {integer} tileIndex - The tile index to set the collision boolean for. + * @param {boolean} [collides=true] - Should the tile index collide or not? + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var SetLayerCollisionIndex = function (tileIndex, collides, layer) +{ + var loc = layer.collideIndexes.indexOf(tileIndex); + + if (collides && loc === -1) + { + layer.collideIndexes.push(tileIndex); + } + else if (!collides && loc !== -1) + { + layer.collideIndexes.splice(loc, 1); + } +}; + +module.exports = SetLayerCollisionIndex; + + +/***/ }), +/* 213 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Formats = __webpack_require__(31); +var LayerData = __webpack_require__(102); +var MapData = __webpack_require__(103); +var Tile = __webpack_require__(72); + +/** + * Parses a 2D array of tile indexes into a new MapData object with a single layer. + * + * @function Phaser.Tilemaps.Parsers.Parse2DArray + * @since 3.0.0 + * + * @param {string} name - The name of the tilemap, used to set the name on the MapData. + * @param {integer[][]} data - 2D array, CSV string or Tiled JSON object. + * @param {integer} tileWidth - The width of a tile in pixels. + * @param {integer} tileHeight - The height of a tile in pixels. + * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + * + * @return {Phaser.Tilemaps.MapData} [description] + */ +var Parse2DArray = function (name, data, tileWidth, tileHeight, insertNull) +{ + var layerData = new LayerData({ + tileWidth: tileWidth, + tileHeight: tileHeight + }); + + var mapData = new MapData({ + name: name, + tileWidth: tileWidth, + tileHeight: tileHeight, + format: Formats.ARRAY_2D, + layers: [ layerData ] + }); + + var tiles = []; + var height = data.length; + var width = 0; + + for (var y = 0; y < data.length; y++) + { + tiles[y] = []; + var row = data[y]; + + for (var x = 0; x < row.length; x++) + { + var tileIndex = parseInt(row[x], 10); + + if (isNaN(tileIndex) || tileIndex === -1) + { + tiles[y][x] = insertNull + ? null + : new Tile(layerData, -1, x, y, tileWidth, tileHeight); + } + else + { + tiles[y][x] = new Tile(layerData, tileIndex, x, y, tileWidth, tileHeight); + } + } + + if (width === 0) + { + width = row.length; + } + } + + mapData.width = layerData.width = width; + mapData.height = layerData.height = height; + mapData.widthInPixels = layerData.widthInPixels = width * tileWidth; + mapData.heightInPixels = layerData.heightInPixels = height * tileHeight; + layerData.data = tiles; + + return mapData; +}; + +module.exports = Parse2DArray; + + +/***/ }), +/* 214 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FLIPPED_HORIZONTAL = 0x80000000; +var FLIPPED_VERTICAL = 0x40000000; +var FLIPPED_ANTI_DIAGONAL = 0x20000000; // Top-right is swapped with bottom-left corners + +/** + * See Tiled documentation on tile flipping: + * http://docs.mapeditor.org/en/latest/reference/tmx-map-format/ + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseGID + * @since 3.0.0 + * + * @param {number} gid - [description] + * + * @return {object} [description] + */ +var ParseGID = function (gid) +{ + var flippedHorizontal = Boolean(gid & FLIPPED_HORIZONTAL); + var flippedVertical = Boolean(gid & FLIPPED_VERTICAL); + var flippedAntiDiagonal = Boolean(gid & FLIPPED_ANTI_DIAGONAL); + gid = gid & ~(FLIPPED_HORIZONTAL | FLIPPED_VERTICAL | FLIPPED_ANTI_DIAGONAL); + + // Parse the flip flags into something Phaser can use + var rotation = 0; + var flipped = false; + + if (flippedHorizontal && flippedVertical && flippedAntiDiagonal) + { + rotation = Math.PI / 2; + flipped = true; + } + else if (flippedHorizontal && flippedVertical && !flippedAntiDiagonal) + { + rotation = Math.PI; + flipped = false; + } + else if (flippedHorizontal && !flippedVertical && flippedAntiDiagonal) + { + rotation = Math.PI / 2; + flipped = false; + } + else if (flippedHorizontal && !flippedVertical && !flippedAntiDiagonal) + { + rotation = 0; + flipped = true; + } + else if (!flippedHorizontal && flippedVertical && flippedAntiDiagonal) + { + rotation = 3 * Math.PI / 2; + flipped = false; + } + else if (!flippedHorizontal && flippedVertical && !flippedAntiDiagonal) + { + rotation = Math.PI; + flipped = true; + } + else if (!flippedHorizontal && !flippedVertical && flippedAntiDiagonal) + { + rotation = 3 * Math.PI / 2; + flipped = true; + } + else if (!flippedHorizontal && !flippedVertical && !flippedAntiDiagonal) + { + rotation = 0; + flipped = false; + } + + return { + gid: gid, + flippedHorizontal: flippedHorizontal, + flippedVertical: flippedVertical, + flippedAntiDiagonal: flippedAntiDiagonal, + rotation: rotation, + flipped: flipped + }; +}; + +module.exports = ParseGID; + + +/***/ }), +/* 215 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Pick = __webpack_require__(461); +var ParseGID = __webpack_require__(214); + +var copyPoints = function (p) { return { x: p.x, y: p.y }; }; + +var commonObjectProps = [ 'id', 'name', 'type', 'rotation', 'properties', 'visible', 'x', 'y', 'width', 'height' ]; + +/** + * Convert a Tiled object to an internal parsed object normalising and copying properties over, while applying optional x and y offsets. The parsed object will always have the properties `id`, `name`, `type`, `rotation`, `properties`, `visible`, `x`, `y`, `width` and `height`. Other properties will be added according to the object type (such as text, polyline, gid etc.) + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseObject + * @since 3.0.0 + * + * @param {object} tiledObject - Tiled object to convert to an internal parsed object normalising and copying properties over. + * @param {number} [offsetX=0] - Optional additional offset to apply to the object's x property. Defaults to 0. + * @param {number} [offsetY=0] - Optional additional offset to apply to the object's y property. Defaults to 0. + * + * @return {object} The parsed object containing properties read from the Tiled object according to it's type with x and y values updated according to the given offsets. + */ +var ParseObject = function (tiledObject, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + var parsedObject = Pick(tiledObject, commonObjectProps); + + parsedObject.x += offsetX; + parsedObject.y += offsetY; + + if (tiledObject.gid) + { + // Object tiles + var gidInfo = ParseGID(tiledObject.gid); + parsedObject.gid = gidInfo.gid; + parsedObject.flippedHorizontal = gidInfo.flippedHorizontal; + parsedObject.flippedVertical = gidInfo.flippedVertical; + parsedObject.flippedAntiDiagonal = gidInfo.flippedAntiDiagonal; + } + else if (tiledObject.polyline) + { + parsedObject.polyline = tiledObject.polyline.map(copyPoints); + } + else if (tiledObject.polygon) + { + parsedObject.polygon = tiledObject.polygon.map(copyPoints); + } + else if (tiledObject.ellipse) + { + parsedObject.ellipse = tiledObject.ellipse; + parsedObject.width = tiledObject.width; + parsedObject.height = tiledObject.height; + } + else if (tiledObject.text) + { + parsedObject.width = tiledObject.width; + parsedObject.height = tiledObject.height; + parsedObject.text = tiledObject.text; + } + else + { + // Otherwise, assume it is a rectangle + parsedObject.rectangle = true; + parsedObject.width = tiledObject.width; + parsedObject.height = tiledObject.height; + } + + return parsedObject; +}; + +module.exports = ParseObject; + + +/***/ }), +/* 216 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Formats = __webpack_require__(31); +var MapData = __webpack_require__(103); +var Parse = __webpack_require__(453); +var Tilemap = __webpack_require__(469); + +/** + * Create a Tilemap from the given key or data. If neither is given, make a blank Tilemap. When + * loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing from + * a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map data. For + * an empty map, you should specify tileWidth, tileHeight, width & height. + * + * @function Phaser.Tilemaps.ParseToTilemap + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Tilemap belongs. + * @param {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data. + * @param {integer} [tileWidth=32] - The width of a tile in pixels. + * @param {integer} [tileHeight=32] - The height of a tile in pixels. + * @param {integer} [width=10] - The width of the map in tiles. + * @param {integer} [height=10] - The height of the map in tiles. + * @param {integer[][]} [data] - Instead of loading from the cache, you can also load directly from + * a 2D array of tile indexes. + * @param {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, in the + * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + * + * @return {Phaser.Tilemaps.Tilemap} + */ +var ParseToTilemap = function (scene, key, tileWidth, tileHeight, width, height, data, insertNull) +{ + if (tileWidth === undefined) { tileWidth = 32; } + if (tileHeight === undefined) { tileHeight = 32; } + if (width === undefined) { width = 10; } + if (height === undefined) { height = 10; } + if (insertNull === undefined) { insertNull = false; } + + var mapData = null; + + if (Array.isArray(data)) + { + var name = key !== undefined ? key : 'map'; + mapData = Parse(name, Formats.ARRAY_2D, data, tileWidth, tileHeight, insertNull); + } + else if (key !== undefined) + { + var tilemapData = scene.cache.tilemap.get(key); + + if (!tilemapData) + { + console.warn('No map data found for key ' + key); + } + else + { + mapData = Parse(key, tilemapData.format, tilemapData.data, tileWidth, tileHeight, insertNull); + } + } + + if (mapData === null) + { + mapData = new MapData({ + tileWidth: tileWidth, + tileHeight: tileHeight, + width: width, + height: height + }); + } + + return new Tilemap(scene, mapData); +}; + +module.exports = ParseToTilemap; + + +/***/ }), +/* 217 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetValue = __webpack_require__(6); + +/** + * Extracts an array of targets from a Tween configuration object. + * + * The targets will be looked for in a `targets` property. If it's a function, its return value will be used as the result. + * + * @function Phaser.Tweens.Builders.GetTargets + * @since 3.0.0 + * + * @param {object} config - The configuration object to use. + * + * @return {array} An array of targets (may contain only one element), or `null` if no targets were specified. + */ +var GetTargets = function (config) +{ + var targets = GetValue(config, 'targets', null); + + if (targets === null) + { + return targets; + } + + if (typeof targets === 'function') + { + targets = targets.call(); + } + + if (!Array.isArray(targets)) + { + targets = [ targets ]; + } + + return targets; +}; + +module.exports = GetTargets; + + +/***/ }), +/* 218 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function hasGetStart (def) +{ + return (!!def.getStart && typeof def.getStart === 'function'); +} + +/** + * @ignore + */ +function hasGetEnd (def) +{ + return (!!def.getEnd && typeof def.getEnd === 'function'); +} + +/** + * @ignore + */ +function hasGetters (def) +{ + return hasGetStart(def) || hasGetEnd(def); +} + +/** + * Returns `getStart` and `getEnd` functions for a Tween's Data based on a target property and end value. + * + * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. A string can be provided to specify a relative end value which consists of an operation (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current value, or `/=` to divide the current value) followed by its operand. A function can be provided to allow greater control over the end value; it will receive the target object being tweened, the name of the property being tweened, and the current value of the property as its arguments. If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` property is provided, the property will be used as the effective value under the same rules described here. + * + * @function Phaser.Tweens.Builders.GetValueOp + * @since 3.0.0 + * + * @param {string} key - The name of the property to modify. + * @param {*} propertyValue - The ending value of the property, as described above. + * + * @return {function} An array of two functions, `getStart` and `getEnd`, which return the starting and the ending value of the property based on the provided value. + */ +var GetValueOp = function (key, propertyValue) +{ + var callbacks; + + // The returned value sets what the property will be at the END of the Tween (usually called at the start of the Tween) + var getEnd = function (target, key, value) { return value; }; + + // The returned value sets what the property will be at the START of the Tween (usually called at the end of the Tween) + var getStart = function (target, key, value) { return value; }; + + var t = typeof(propertyValue); + + if (t === 'number') + { + // props: { + // x: 400, + // y: 300 + // } + + getEnd = function () + { + return propertyValue; + }; + } + else if (t === 'string') + { + // props: { + // x: '+=400', + // y: '-=300', + // z: '*=2', + // w: '/=2' + // } + + var op = propertyValue[0]; + var num = parseFloat(propertyValue.substr(2)); + + switch (op) + { + case '+': + getEnd = function (target, key, value) + { + return value + num; + }; + break; + + case '-': + getEnd = function (target, key, value) + { + return value - num; + }; + break; + + case '*': + getEnd = function (target, key, value) + { + return value * num; + }; + break; + + case '/': + getEnd = function (target, key, value) + { + return value / num; + }; + break; + + default: + getEnd = function () + { + return parseFloat(propertyValue); + }; + } + } + else if (t === 'function') + { + // The same as setting just the getEnd function and no getStart + + // props: { + // x: function (target, key, value) { return value + 50); }, + // } + + getEnd = propertyValue; + } + else if (t === 'object' && hasGetters(propertyValue)) + { + /* + x: { + // Called at the start of the Tween. The returned value sets what the property will be at the END of the Tween. + getEnd: function (target, key, value) + { + return value; + }, + + // Called at the end of the Tween. The returned value sets what the property will be at the START of the Tween. + getStart: function (target, key, value) + { + return value; + } + } + */ + + if (hasGetEnd(propertyValue)) + { + getEnd = propertyValue.getEnd; + } + + if (hasGetStart(propertyValue)) + { + getStart = propertyValue.getStart; + } + } + else if (propertyValue.hasOwnProperty('value')) + { + // Value may still be a string, function or a number + // props: { + // x: { value: 400, ... }, + // y: { value: 300, ... } + // } + + callbacks = GetValueOp(key, propertyValue.value); + } + + // If callback not set by the else if block above then set it here and return it + if (!callbacks) + { + callbacks = { + getEnd: getEnd, + getStart: getStart + }; + } + + return callbacks; +}; + +module.exports = GetValueOp; + + +/***/ }), +/* 219 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @typedef {object} Phaser.Types.Tweens.TweenConfigDefaults + * @since 3.0.0 + * + * @property {(object|object[])} targets - The object, or an array of objects, to run the tween on. + * @property {number} [delay=0] - The number of milliseconds to delay before the tween will start. + * @property {number} [duration=1000] - The duration of the tween in milliseconds. + * @property {string} [ease='Power0'] - The easing equation to use for the tween. + * @property {array} [easeParams] - Optional easing parameters. + * @property {number} [hold=0] - The number of milliseconds to hold the tween for before yoyo'ing. + * @property {number} [repeat=0] - The number of times to repeat the tween. + * @property {number} [repeatDelay=0] - The number of milliseconds to pause before a tween will repeat. + * @property {boolean} [yoyo=false] - Should the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. + * @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. + * @property {boolean} [flipY=false] - Vertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipY` property. + */ + +var TWEEN_DEFAULTS = { + targets: null, + delay: 0, + duration: 1000, + ease: 'Power0', + easeParams: null, + hold: 0, + repeat: 0, + repeatDelay: 0, + yoyo: false, + flipX: false, + flipY: false +}; + +module.exports = TWEEN_DEFAULTS; + + +/***/ }), +/* 220 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GameObjectCreator = __webpack_require__(15); +var GameObjectFactory = __webpack_require__(5); +var TWEEN_CONST = __webpack_require__(88); + +/** + * @classdesc + * A Tween is able to manipulate the properties of one or more objects to any given value, based + * on a duration and type of ease. They are rarely instantiated directly and instead should be + * created via the TweenManager. + * + * @class Tween + * @memberof Phaser.Tweens + * @constructor + * @since 3.0.0 + * + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - A reference to the parent of this Tween. Either the Tween Manager or a Tween Timeline instance. + * @param {Phaser.Types.Tweens.TweenDataConfig[]} data - An array of TweenData objects, each containing a unique property to be tweened. + * @param {array} targets - An array of targets to be tweened. + */ +var Tween = new Class({ + + initialize: + + function Tween (parent, data, targets) + { + /** + * A reference to the parent of this Tween. + * Either the Tween Manager or a Tween Timeline instance. + * + * @name Phaser.Tweens.Tween#parent + * @type {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * Is the parent of this Tween a Timeline? + * + * @name Phaser.Tweens.Tween#parentIsTimeline + * @type {boolean} + * @since 3.0.0 + */ + this.parentIsTimeline = parent.hasOwnProperty('isTimeline'); + + /** + * An array of TweenData objects, each containing a unique property and target being tweened. + * + * @name Phaser.Tweens.Tween#data + * @type {Phaser.Types.Tweens.TweenDataConfig[]} + * @since 3.0.0 + */ + this.data = data; + + /** + * The cached length of the data array. + * + * @name Phaser.Tweens.Tween#totalData + * @type {integer} + * @since 3.0.0 + */ + this.totalData = data.length; + + /** + * An array of references to the target/s this Tween is operating on. + * + * @name Phaser.Tweens.Tween#targets + * @type {object[]} + * @since 3.0.0 + */ + this.targets = targets; + + /** + * Cached target total (not necessarily the same as the data total) + * + * @name Phaser.Tweens.Tween#totalTargets + * @type {integer} + * @since 3.0.0 + */ + this.totalTargets = targets.length; + + /** + * If `true` then duration, delay, etc values are all frame totals. + * + * @name Phaser.Tweens.Tween#useFrames + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.useFrames = false; + + /** + * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * Value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + * + * @name Phaser.Tweens.Tween#timeScale + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.timeScale = 1; + + /** + * Loop this tween? Can be -1 for an infinite loop, or an integer. + * When enabled it will play through ALL TweenDatas again. Use TweenData.repeat to loop a single element. + * + * @name Phaser.Tweens.Tween#loop + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.loop = 0; + + /** + * Time in ms/frames before the tween loops. + * + * @name Phaser.Tweens.Tween#loopDelay + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.loopDelay = 0; + + /** + * How many loops are left to run? + * + * @name Phaser.Tweens.Tween#loopCounter + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.loopCounter = 0; + + /** + * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = -1 (as it never completes) + * + * @name Phaser.Tweens.Tween#completeDelay + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.completeDelay = 0; + + /** + * Countdown timer (used by timeline offset, loopDelay and completeDelay) + * + * @name Phaser.Tweens.Tween#countdown + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.countdown = 0; + + /** + * Set only if this Tween is part of a Timeline. + * + * @name Phaser.Tweens.Tween#offset + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.offset = 0; + + /** + * Set only if this Tween is part of a Timeline. The calculated offset amount. + * + * @name Phaser.Tweens.Tween#calculatedOffset + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.calculatedOffset = 0; + + /** + * The current state of the tween + * + * @name Phaser.Tweens.Tween#state + * @type {integer} + * @since 3.0.0 + */ + this.state = TWEEN_CONST.PENDING_ADD; + + /** + * The state of the tween when it was paused (used by Resume) + * + * @name Phaser.Tweens.Tween#_pausedState + * @type {integer} + * @private + * @since 3.0.0 + */ + this._pausedState = TWEEN_CONST.PENDING_ADD; + + /** + * Does the Tween start off paused? (if so it needs to be started with Tween.play) + * + * @name Phaser.Tweens.Tween#paused + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.paused = false; + + /** + * Elapsed time in ms/frames of this run through the Tween. + * + * @name Phaser.Tweens.Tween#elapsed + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.elapsed = 0; + + /** + * Total elapsed time in ms/frames of the entire Tween, including looping. + * + * @name Phaser.Tweens.Tween#totalElapsed + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.totalElapsed = 0; + + /** + * Time in ms/frames for the whole Tween to play through once, excluding loop amounts and loop delays. + * + * @name Phaser.Tweens.Tween#duration + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.duration = 0; + + /** + * Value between 0 and 1. The amount through the Tween, excluding loops. + * + * @name Phaser.Tweens.Tween#progress + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.progress = 0; + + /** + * Time in ms/frames for the Tween to complete (including looping) + * + * @name Phaser.Tweens.Tween#totalDuration + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.totalDuration = 0; + + /** + * Value between 0 and 1. The amount through the entire Tween, including looping. + * + * @name Phaser.Tweens.Tween#totalProgress + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.totalProgress = 0; + + /** + * An object containing the various Tween callback references. + * + * @name Phaser.Tweens.Tween#callbacks + * @type {object} + * @default 0 + * @since 3.0.0 + */ + this.callbacks = { + onComplete: null, + onLoop: null, + onRepeat: null, + onStart: null, + onUpdate: null, + onYoyo: null + }; + + this.callbackScope; + }, + + /** + * Returns the current value of the Tween. + * + * @method Phaser.Tweens.Tween#getValue + * @since 3.0.0 + * + * @return {number} The value of the Tween. + */ + getValue: function () + { + return this.data[0].current; + }, + + /** + * Set the scale the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * + * @method Phaser.Tweens.Tween#setTimeScale + * @since 3.0.0 + * + * @param {number} value - The scale factor for timescale. + * + * @return {this} - This Tween instance. + */ + setTimeScale: function (value) + { + this.timeScale = value; + + return this; + }, + + /** + * Returns the scale of the time applied to this Tween. + * + * @method Phaser.Tweens.Tween#getTimeScale + * @since 3.0.0 + * + * @return {number} The timescale of this tween (between 0 and 1) + */ + getTimeScale: function () + { + return this.timeScale; + }, + + /** + * Checks if the Tween is currently active. + * + * @method Phaser.Tweens.Tween#isPlaying + * @since 3.0.0 + * + * @return {boolean} `true` if the Tween is active, otherwise `false`. + */ + isPlaying: function () + { + return (this.state === TWEEN_CONST.ACTIVE); + }, + + /** + * Checks if the Tween is currently paused. + * + * @method Phaser.Tweens.Tween#isPaused + * @since 3.0.0 + * + * @return {boolean} `true` if the Tween is paused, otherwise `false`. + */ + isPaused: function () + { + return (this.state === TWEEN_CONST.PAUSED); + }, + + /** + * See if this Tween is currently acting upon the given target. + * + * @method Phaser.Tweens.Tween#hasTarget + * @since 3.0.0 + * + * @param {object} target - The target to check against this Tween. + * + * @return {boolean} `true` if the given target is a target of this Tween, otherwise `false`. + */ + hasTarget: function (target) + { + return (this.targets.indexOf(target) !== -1); + }, + + /** + * Updates the value of a property of this Tween to a new value, without adjusting the + * Tween duration or current progress. + * + * You can optionally tell it to set the 'start' value to be the current value (before the change). + * + * @method Phaser.Tweens.Tween#updateTo + * @since 3.0.0 + * + * @param {string} key - The property to set the new value for. + * @param {*} value - The new value of the property. + * @param {boolean} [startToCurrent=false] - Should this change set the start value to be the current value? + * + * @return {this} - This Tween instance. + */ + updateTo: function (key, value, startToCurrent) + { + if (startToCurrent === undefined) { startToCurrent = false; } + + for (var i = 0; i < this.totalData; i++) + { + var tweenData = this.data[i]; + + if (tweenData.key === key) + { + tweenData.end = value; + + if (startToCurrent) + { + tweenData.start = tweenData.current; + } + + break; + } + } + + return this; + }, + + /** + * Restarts the tween from the beginning. + * + * @method Phaser.Tweens.Tween#restart + * @since 3.0.0 + * + * @return {this} This Tween instance. + */ + restart: function () + { + // Reset these so they're ready for the next update + this.elapsed = 0; + this.progress = 0; + this.totalElapsed = 0; + this.totalProgress = 0; + + if (this.state === TWEEN_CONST.ACTIVE) + { + return this.seek(0); + } + else if (this.state === TWEEN_CONST.REMOVED) + { + this.seek(0); + this.parent.makeActive(this); + + return this; + } + else if (this.state === TWEEN_CONST.PENDING_ADD) + { + return this; + } + else + { + return this.play(); + } + }, + + /** + * Internal method that calculates the overall duration of the Tween. + * + * @method Phaser.Tweens.Tween#calcDuration + * @since 3.0.0 + */ + calcDuration: function () + { + var max = 0; + + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + var tweenData = data[i]; + + // Set t1 (duration + hold + yoyo) + tweenData.t1 = tweenData.duration + tweenData.hold; + + if (tweenData.yoyo) + { + tweenData.t1 += tweenData.duration; + } + + // Set t2 (repeatDelay + duration + hold + yoyo) + tweenData.t2 = tweenData.t1 + tweenData.repeatDelay; + + // Total Duration + tweenData.totalDuration = tweenData.delay + tweenData.t1; + + if (tweenData.repeat === -1) + { + tweenData.totalDuration += (tweenData.t2 * 999999999999); + } + else if (tweenData.repeat > 0) + { + tweenData.totalDuration += (tweenData.t2 * tweenData.repeat); + } + + if (tweenData.totalDuration > max) + { + // Get the longest TweenData from the Tween, used to calculate the Tween TD + max = tweenData.totalDuration; + } + } + + // Excludes loop values + + // If duration has been set to 0 then we give it a super-low value so that it always + // renders at least 1 frame, but no more, without causing divided by zero errors elsewhere. + this.duration = Math.max(max, 0.001); + + this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; + + if (this.loopCounter > 0) + { + this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); + } + else + { + this.totalDuration = this.duration + this.completeDelay; + } + }, + + /** + * Called by TweenManager.preUpdate as part of its loop to check pending and active tweens. + * Should not be called directly. + * + * @method Phaser.Tweens.Tween#init + * @since 3.0.0 + * + * @return {boolean} Returns `true` if this Tween should be moved from the pending list to the active list by the Tween Manager. + */ + init: function () + { + var data = this.data; + var totalTargets = this.totalTargets; + + for (var i = 0; i < this.totalData; i++) + { + var tweenData = data[i]; + var target = tweenData.target; + var gen = tweenData.gen; + + tweenData.delay = gen.delay(i, totalTargets, target); + tweenData.duration = Math.max(gen.duration(i, totalTargets, target), 0.001); + tweenData.hold = gen.hold(i, totalTargets, target); + tweenData.repeat = gen.repeat(i, totalTargets, target); + tweenData.repeatDelay = gen.repeatDelay(i, totalTargets, target); + } + + this.calcDuration(); + + this.progress = 0; + this.totalProgress = 0; + this.elapsed = 0; + this.totalElapsed = 0; + + // You can't have a paused Tween if it's part of a Timeline + if (this.paused && !this.parentIsTimeline) + { + this.state = TWEEN_CONST.PENDING_ADD; + this._pausedState = TWEEN_CONST.INIT; + + return false; + } + else + { + this.state = TWEEN_CONST.INIT; + + return true; + } + }, + + /** + * Internal method that advances to the next state of the Tween during playback. + * + * @method Phaser.Tweens.Tween#nextState + * @since 3.0.0 + */ + nextState: function () + { + if (this.loopCounter > 0) + { + this.elapsed = 0; + this.progress = 0; + this.loopCounter--; + + var onLoop = this.callbacks.onLoop; + + if (onLoop) + { + onLoop.params[1] = this.targets; + + onLoop.func.apply(onLoop.scope, onLoop.params); + } + + this.resetTweenData(true); + + if (this.loopDelay > 0) + { + this.countdown = this.loopDelay; + this.state = TWEEN_CONST.LOOP_DELAY; + } + else + { + this.state = TWEEN_CONST.ACTIVE; + } + } + else if (this.completeDelay > 0) + { + this.countdown = this.completeDelay; + this.state = TWEEN_CONST.COMPLETE_DELAY; + } + else + { + var onComplete = this.callbacks.onComplete; + + if (onComplete) + { + onComplete.params[1] = this.targets; + + onComplete.func.apply(onComplete.scope, onComplete.params); + } + + this.state = TWEEN_CONST.PENDING_REMOVE; + } + }, + + /** + * Pauses the Tween immediately. Use `resume` to continue playback. + * + * @method Phaser.Tweens.Tween#pause + * @since 3.0.0 + * + * @return {this} - This Tween instance. + */ + pause: function () + { + if (this.state === TWEEN_CONST.PAUSED) + { + return this; + } + + this.paused = true; + + this._pausedState = this.state; + + this.state = TWEEN_CONST.PAUSED; + + return this; + }, + + /** + * Starts a Tween playing. + * + * You only need to call this method if you have configured the tween to be paused on creation. + * + * If the Tween is already playing, calling this method again will have no effect. If you wish to + * restart the Tween, use `Tween.restart` instead. + * + * Calling this method after the Tween has completed will start the Tween playing again from the start. + * This is the same as calling `Tween.seek(0)` and then `Tween.play()`. + * + * @method Phaser.Tweens.Tween#play + * @since 3.0.0 + * + * @param {boolean} [resetFromTimeline=false] - Is this Tween being played as part of a Timeline? + * + * @return {this} This Tween instance. + */ + play: function (resetFromTimeline) + { + if (resetFromTimeline === undefined) { resetFromTimeline = false; } + + if (this.state === TWEEN_CONST.ACTIVE || (this.state === TWEEN_CONST.PENDING_ADD && this._pausedState === TWEEN_CONST.PENDING_ADD)) + { + return this; + } + else if (!this.parentIsTimeline && (this.state === TWEEN_CONST.PENDING_REMOVE || this.state === TWEEN_CONST.REMOVED)) + { + this.seek(0); + this.parent.makeActive(this); + + return this; + } + + var onStart = this.callbacks.onStart; + + if (this.parentIsTimeline) + { + this.resetTweenData(resetFromTimeline); + + if (this.calculatedOffset === 0) + { + if (onStart) + { + onStart.params[1] = this.targets; + + onStart.func.apply(onStart.scope, onStart.params); + } + + this.state = TWEEN_CONST.ACTIVE; + } + else + { + this.countdown = this.calculatedOffset; + + this.state = TWEEN_CONST.OFFSET_DELAY; + } + } + else if (this.paused) + { + this.paused = false; + + this.parent.makeActive(this); + } + else + { + this.resetTweenData(resetFromTimeline); + + this.state = TWEEN_CONST.ACTIVE; + + if (onStart) + { + onStart.params[1] = this.targets; + + onStart.func.apply(onStart.scope, onStart.params); + } + + this.parent.makeActive(this); + } + + return this; + }, + + /** + * Internal method that resets all of the Tween Data, including the progress and elapsed values. + * + * @method Phaser.Tweens.Tween#resetTweenData + * @since 3.0.0 + * + * @param {boolean} resetFromLoop - Has this method been called as part of a loop? + */ + resetTweenData: function (resetFromLoop) + { + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + var tweenData = data[i]; + + tweenData.progress = 0; + tweenData.elapsed = 0; + + tweenData.repeatCounter = (tweenData.repeat === -1) ? 999999999999 : tweenData.repeat; + + if (resetFromLoop) + { + tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); + + tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.end); + + tweenData.current = tweenData.start; + + tweenData.state = TWEEN_CONST.PLAYING_FORWARD; + } + else + { + tweenData.state = TWEEN_CONST.PENDING_RENDER; + } + + if (tweenData.delay > 0) + { + tweenData.elapsed = tweenData.delay; + tweenData.state = TWEEN_CONST.DELAY; + } + } + }, + + /** + * Resumes the playback of a previously paused Tween. + * + * @method Phaser.Tweens.Tween#resume + * @since 3.0.0 + * + * @return {this} - This Tween instance. + */ + resume: function () + { + if (this.state === TWEEN_CONST.PAUSED) + { + this.paused = false; + + this.state = this._pausedState; + } + else + { + this.play(); + } + + return this; + }, + + /** + * Attempts to seek to a specific position in a Tween. + * + * @method Phaser.Tweens.Tween#seek + * @since 3.0.0 + * + * @param {number} toPosition - A value between 0 and 1 which represents the progress point to seek to. + * + * @return {this} This Tween instance. + */ + seek: function (toPosition) + { + var data = this.data; + + for (var i = 0; i < this.totalData; i++) + { + // This won't work with loop > 0 yet + var ms = this.totalDuration * toPosition; + + var tweenData = data[i]; + var progress = 0; + var elapsed = 0; + + if (ms <= tweenData.delay) + { + progress = 0; + elapsed = 0; + } + else if (ms >= tweenData.totalDuration) + { + progress = 1; + elapsed = tweenData.duration; + } + else if (ms > tweenData.delay && ms <= tweenData.t1) + { + // Keep it zero bound + ms = Math.max(0, ms - tweenData.delay); + + // Somewhere in the first playthru range + progress = ms / tweenData.t1; + elapsed = tweenData.duration * progress; + } + else if (ms > tweenData.t1 && ms < tweenData.totalDuration) + { + // Somewhere in repeat land + ms -= tweenData.delay; + ms -= tweenData.t1; + + // var repeats = Math.floor(ms / tweenData.t2); + + // remainder + ms = ((ms / tweenData.t2) % 1) * tweenData.t2; + + if (ms > tweenData.repeatDelay) + { + progress = ms / tweenData.t1; + elapsed = tweenData.duration * progress; + } + } + + tweenData.progress = progress; + tweenData.elapsed = elapsed; + + var v = tweenData.ease(tweenData.progress); + + tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + + tweenData.target[tweenData.key] = tweenData.current; + } + + return this; + }, + + /** + * Sets an event based callback to be invoked during playback. + * + * @method Phaser.Tweens.Tween#setCallback + * @since 3.0.0 + * + * @param {string} type - Type of the callback. + * @param {function} callback - Callback function. + * @param {array} [params] - An array of parameters for specified callbacks types. + * @param {object} [scope] - The context the callback will be invoked in. + * + * @return {this} This Tween instance. + */ + setCallback: function (type, callback, params, scope) + { + this.callbacks[type] = { func: callback, scope: scope, params: params }; + + return this; + }, + + /** + * Flags the Tween as being complete, whatever stage of progress it is at. + * + * If an onComplete callback has been defined it will automatically invoke it, unless a `delay` + * argument is provided, in which case the Tween will delay for that period of time before calling the callback. + * + * If you don't need a delay, or have an onComplete callback, then call `Tween.stop` instead. + * + * @method Phaser.Tweens.Tween#complete + * @since 3.2.0 + * + * @param {number} [delay=0] - The time to wait before invoking the complete callback. If zero it will fire immediately. + * + * @return {this} This Tween instance. + */ + complete: function (delay) + { + if (delay === undefined) { delay = 0; } + + if (delay) + { + this.countdown = delay; + this.state = TWEEN_CONST.COMPLETE_DELAY; + } + else + { + var onComplete = this.callbacks.onComplete; + + if (onComplete) + { + onComplete.params[1] = this.targets; + + onComplete.func.apply(onComplete.scope, onComplete.params); + } + + this.state = TWEEN_CONST.PENDING_REMOVE; + } + + return this; + }, + + /** + * Immediately removes this Tween from the TweenManager and all of its internal arrays, + * no matter what stage it as it. Then sets the tween state to `REMOVED`. + * + * You should dispose of your reference to this tween after calling this method, to + * free it from memory. + * + * @method Phaser.Tweens.Tween#remove + * @since 3.17.0 + * + * @return {this} This Tween instance. + */ + remove: function () + { + this.parent.remove(this); + + return this; + }, + + /** + * Stops the Tween immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. + * + * @method Phaser.Tweens.Tween#stop + * @since 3.0.0 + * + * @param {number} [resetTo] - If you want to seek the tween, provide a value between 0 and 1. + * + * @return {this} This Tween instance. + */ + stop: function (resetTo) + { + if (this.state === TWEEN_CONST.ACTIVE) + { + if (resetTo !== undefined) + { + this.seek(resetTo); + } + } + + if (this.state !== TWEEN_CONST.REMOVED) + { + if (this.state === TWEEN_CONST.PAUSED || this.state === TWEEN_CONST.PENDING_ADD) + { + if (this.parentIsTimeline) + { + this.parent.manager._destroy.push(this); + this.parent.manager._toProcess++; + } + else + { + this.parent._destroy.push(this); + this.parent._toProcess++; + } + } + + this.state = TWEEN_CONST.PENDING_REMOVE; + } + + return this; + }, + + /** + * Internal method that advances the Tween based on the time values. + * + * @method Phaser.Tweens.Tween#update + * @since 3.0.0 + * + * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + * + * @return {boolean} Returns `true` if this Tween has finished and should be removed from the Tween Manager, otherwise returns `false`. + */ + update: function (timestamp, delta) + { + if (this.state === TWEEN_CONST.PAUSED) + { + return false; + } + + if (this.useFrames) + { + delta = 1 * this.parent.timeScale; + } + + delta *= this.timeScale; + + this.elapsed += delta; + this.progress = Math.min(this.elapsed / this.duration, 1); + + this.totalElapsed += delta; + this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1); + + switch (this.state) + { + case TWEEN_CONST.ACTIVE: + + var stillRunning = false; + + for (var i = 0; i < this.totalData; i++) + { + if (this.updateTweenData(this, this.data[i], delta)) + { + stillRunning = true; + } + } + + // Anything still running? If not, we're done + if (!stillRunning) + { + this.nextState(); + } + + break; + + case TWEEN_CONST.LOOP_DELAY: + + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.state = TWEEN_CONST.ACTIVE; + } + + break; + + case TWEEN_CONST.OFFSET_DELAY: + + this.countdown -= delta; + + if (this.countdown <= 0) + { + var onStart = this.callbacks.onStart; + + if (onStart) + { + onStart.params[1] = this.targets; + + onStart.func.apply(onStart.scope, onStart.params); + } + + this.state = TWEEN_CONST.ACTIVE; + } + + break; + + case TWEEN_CONST.COMPLETE_DELAY: + + this.countdown -= delta; + + if (this.countdown <= 0) + { + var onComplete = this.callbacks.onComplete; + + if (onComplete) + { + onComplete.func.apply(onComplete.scope, onComplete.params); + } + + this.state = TWEEN_CONST.PENDING_REMOVE; + } + + break; + } + + return (this.state === TWEEN_CONST.PENDING_REMOVE); + }, + + /** + * Internal method used as part of the playback process that sets a tween to play in reverse. + * + * @method Phaser.Tweens.Tween#setStateFromEnd + * @since 3.0.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to update. + * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + * + * @return {integer} The state of this Tween. + */ + setStateFromEnd: function (tween, tweenData, diff) + { + if (tweenData.yoyo) + { + // We've hit the end of a Playing Forward TweenData and we have a yoyo + + // Account for any extra time we got from the previous frame + tweenData.elapsed = diff; + tweenData.progress = diff / tweenData.duration; + + if (tweenData.flipX) + { + tweenData.target.toggleFlipX(); + } + + // Problem: The flip and callback and so on gets called for every TweenData that triggers it at the same time. + // If you're tweening several properties it can fire for all of them, at once. + + if (tweenData.flipY) + { + tweenData.target.toggleFlipY(); + } + + var onYoyo = tween.callbacks.onYoyo; + + if (onYoyo) + { + // Element 1 is reserved for the target of the yoyo (and needs setting here) + onYoyo.params[1] = tweenData.target; + + onYoyo.func.apply(onYoyo.scope, onYoyo.params); + } + + tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); + + return TWEEN_CONST.PLAYING_BACKWARD; + } + else if (tweenData.repeatCounter > 0) + { + // We've hit the end of a Playing Forward TweenData and we have a Repeat. + // So we're going to go right back to the start to repeat it again. + + tweenData.repeatCounter--; + + // Account for any extra time we got from the previous frame + tweenData.elapsed = diff; + tweenData.progress = diff / tweenData.duration; + + if (tweenData.flipX) + { + tweenData.target.toggleFlipX(); + } + + if (tweenData.flipY) + { + tweenData.target.toggleFlipY(); + } + + var onRepeat = tween.callbacks.onRepeat; + + if (onRepeat) + { + // Element 1 is reserved for the target of the repeat (and needs setting here) + onRepeat.params[1] = tweenData.target; + + onRepeat.func.apply(onRepeat.scope, onRepeat.params); + } + + tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.start); + + tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + + // Delay? + if (tweenData.repeatDelay > 0) + { + tweenData.elapsed = tweenData.repeatDelay - diff; + + tweenData.current = tweenData.start; + + tweenData.target[tweenData.key] = tweenData.current; + + return TWEEN_CONST.REPEAT_DELAY; + } + else + { + return TWEEN_CONST.PLAYING_FORWARD; + } + } + + return TWEEN_CONST.COMPLETE; + }, + + /** + * Internal method used as part of the playback process that sets a tween to play from the start. + * + * @method Phaser.Tweens.Tween#setStateFromStart + * @since 3.0.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to update. + * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. + * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. + * + * @return {integer} The state of this Tween. + */ + setStateFromStart: function (tween, tweenData, diff) + { + if (tweenData.repeatCounter > 0) + { + tweenData.repeatCounter--; + + // Account for any extra time we got from the previous frame + tweenData.elapsed = diff; + tweenData.progress = diff / tweenData.duration; + + if (tweenData.flipX) + { + tweenData.target.toggleFlipX(); + } + + if (tweenData.flipY) + { + tweenData.target.toggleFlipY(); + } + + var onRepeat = tween.callbacks.onRepeat; + + if (onRepeat) + { + // Element 1 is reserved for the target of the repeat (and needs setting here) + onRepeat.params[1] = tweenData.target; + + onRepeat.func.apply(onRepeat.scope, onRepeat.params); + } + + tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + + // Delay? + if (tweenData.repeatDelay > 0) + { + tweenData.elapsed = tweenData.repeatDelay - diff; + + tweenData.current = tweenData.start; + + tweenData.target[tweenData.key] = tweenData.current; + + return TWEEN_CONST.REPEAT_DELAY; + } + else + { + return TWEEN_CONST.PLAYING_FORWARD; + } + } + + return TWEEN_CONST.COMPLETE; + }, + + /** + * Internal method that advances the TweenData based on the time value given. + * + * @method Phaser.Tweens.Tween#updateTweenData + * @since 3.0.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to update. + * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. + * @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true + * + * @return {boolean} True if the tween is not complete (e.g., playing), or false if the tween is complete. + */ + updateTweenData: function (tween, tweenData, delta) + { + switch (tweenData.state) + { + case TWEEN_CONST.PLAYING_FORWARD: + case TWEEN_CONST.PLAYING_BACKWARD: + + if (!tweenData.target) + { + tweenData.state = TWEEN_CONST.COMPLETE; + break; + } + + var elapsed = tweenData.elapsed; + var duration = tweenData.duration; + var diff = 0; + + elapsed += delta; + + if (elapsed > duration) + { + diff = elapsed - duration; + elapsed = duration; + } + + var forward = (tweenData.state === TWEEN_CONST.PLAYING_FORWARD); + var progress = elapsed / duration; + + var v; + + if (forward) + { + v = tweenData.ease(progress); + } + else + { + v = tweenData.ease(1 - progress); + } + + tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + + tweenData.target[tweenData.key] = tweenData.current; + + tweenData.elapsed = elapsed; + tweenData.progress = progress; + + var onUpdate = tween.callbacks.onUpdate; + + if (onUpdate) + { + onUpdate.params[1] = tweenData.target; + + onUpdate.func.apply(onUpdate.scope, onUpdate.params); + } + + if (progress === 1) + { + if (forward) + { + if (tweenData.hold > 0) + { + tweenData.elapsed = tweenData.hold - diff; + + tweenData.state = TWEEN_CONST.HOLD_DELAY; + } + else + { + tweenData.state = this.setStateFromEnd(tween, tweenData, diff); + } + } + else + { + tweenData.state = this.setStateFromStart(tween, tweenData, diff); + } + } + + break; + + case TWEEN_CONST.DELAY: + + tweenData.elapsed -= delta; + + if (tweenData.elapsed <= 0) + { + tweenData.elapsed = Math.abs(tweenData.elapsed); + + tweenData.state = TWEEN_CONST.PENDING_RENDER; + } + + break; + + case TWEEN_CONST.REPEAT_DELAY: + + tweenData.elapsed -= delta; + + if (tweenData.elapsed <= 0) + { + tweenData.elapsed = Math.abs(tweenData.elapsed); + + tweenData.state = TWEEN_CONST.PLAYING_FORWARD; + } + + break; + + case TWEEN_CONST.HOLD_DELAY: + + tweenData.elapsed -= delta; + + if (tweenData.elapsed <= 0) + { + tweenData.state = this.setStateFromEnd(tween, tweenData, Math.abs(tweenData.elapsed)); + } + + break; + + case TWEEN_CONST.PENDING_RENDER: + + if (tweenData.target) + { + tweenData.start = tweenData.getStartValue(tweenData.target, tweenData.key, tweenData.target[tweenData.key]); + + tweenData.end = tweenData.getEndValue(tweenData.target, tweenData.key, tweenData.start); + + tweenData.current = tweenData.start; + + tweenData.target[tweenData.key] = tweenData.start; + + tweenData.state = TWEEN_CONST.PLAYING_FORWARD; + } + else + { + tweenData.state = TWEEN_CONST.COMPLETE; + } + + break; + } + + // Return TRUE if this TweenData still playing, otherwise return FALSE + return (tweenData.state !== TWEEN_CONST.COMPLETE); + } + +}); + +Tween.TYPES = [ + 'onComplete', + 'onLoop', + 'onRepeat', + 'onStart', + 'onUpdate', + 'onYoyo' +]; + +/** + * Creates a new Tween object. + * + * Note: This method will only be available Tweens have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#tween + * @since 3.0.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The Tween configuration. + * + * @return {Phaser.Tweens.Tween} The Tween that was created. + */ +GameObjectFactory.register('tween', function (config) +{ + return this.scene.sys.tweens.add(config); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + +/** + * Creates a new Tween object and returns it. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#tween + * @since 3.0.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The Tween configuration. + * + * @return {Phaser.Tweens.Tween} The Tween that was created. + */ +GameObjectCreator.register('tween', function (config) +{ + return this.scene.sys.tweens.create(config); +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + +module.exports = Tween; + + +/***/ }), +/* 221 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween. + * + * This is an internal function used by the TweenBuilder and should not be accessed directly, instead, Tweens should be created using the GameObjectFactory or GameObjectCreator. + * + * @function Phaser.Tweens.TweenData + * @since 3.0.0 + * + * @param {object} target - The target to tween. + * @param {string} key - The property of the target to tween. + * @param {function} getEnd - What the property will be at the END of the Tween. + * @param {function} getStart - What the property will be at the START of the Tween. + * @param {function} ease - The ease function this tween uses. + * @param {number} delay - Time in ms/frames before tween will start. + * @param {number} duration - Duration of the tween in ms/frames. + * @param {boolean} yoyo - Determines whether the tween should return back to its start value after hold has expired. + * @param {number} hold - Time in ms/frames the tween will pause before repeating or returning to its starting value if yoyo is set to true. + * @param {number} repeat - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @param {number} repeatDelay - Time in ms/frames before the repeat will start. + * @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens? + * @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens? + * + * @return {Phaser.Types.Tweens.TweenDataConfig} The config object describing this TweenData. + */ +var TweenData = function (target, key, getEnd, getStart, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY) +{ + return { + + // The target to tween + target: target, + + // The property of the target to tween + key: key, + + // The returned value sets what the property will be at the END of the Tween. + getEndValue: getEnd, + + // The returned value sets what the property will be at the START of the Tween. + getStartValue: getStart, + + // The ease function this tween uses. + ease: ease, + + // Duration of the tween in ms/frames, excludes time for yoyo or repeats. + duration: 0, + + // The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo) + totalDuration: 0, + + // Time in ms/frames before tween will start. + delay: 0, + + // Cause the tween to return back to its start value after hold has expired. + yoyo: yoyo, + + // Time in ms/frames the tween will pause before running the yoyo or starting a repeat. + hold: 0, + + // Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + repeat: 0, + + // Time in ms/frames before the repeat will start. + repeatDelay: 0, + + // Automatically call toggleFlipX when the TweenData yoyos or repeats + flipX: flipX, + + // Automatically call toggleFlipY when the TweenData yoyos or repeats + flipY: flipY, + + // Between 0 and 1 showing completion of this TweenData. + progress: 0, + + // Delta counter. + elapsed: 0, + + // How many repeats are left to run? + repeatCounter: 0, + + // Ease Value Data: + + start: 0, + current: 0, + end: 0, + + // Time Durations + t1: 0, + t2: 0, + + // LoadValue generation functions + gen: { + delay: delay, + duration: duration, + hold: hold, + repeat: repeat, + repeatDelay: repeatDelay + }, + + // TWEEN_CONST.CREATED + state: 0 + }; +}; + +module.exports = TweenData; + + +/***/ }), +/* 222 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1, eval)("this"); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 223 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(56); + +/** + * Wrap an angle. + * + * Wraps the angle to a value in the range of -PI to PI. + * + * @function Phaser.Math.Angle.Wrap + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in radians. + * + * @return {number} The wrapped angle, in radians. + */ +var Wrap = function (angle) +{ + return MathWrap(angle, -Math.PI, Math.PI); +}; + +module.exports = Wrap; + + +/***/ }), +/* 224 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(56); + +/** + * Wrap an angle in degrees. + * + * Wraps the angle to a value in the range of -180 to 180. + * + * @function Phaser.Math.Angle.WrapDegrees + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in degrees. + * + * @return {number} The wrapped angle, in degrees. + */ +var WrapDegrees = function (angle) +{ + return Wrap(angle, -180, 180); +}; + +module.exports = WrapDegrees; + + +/***/ }), +/* 225 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Utils = __webpack_require__(9); + +/** + * @classdesc + * WebGLPipeline is a class that describes the way elements will be rendererd + * in WebGL, specially focused on batching vertices (batching is not provided). + * Pipelines are mostly used for describing 2D rendering passes but it's + * flexible enough to be used for any type of rendering including 3D. + * Internally WebGLPipeline will handle things like compiling shaders, + * creating vertex buffers, assigning primitive topology and binding + * vertex attributes. + * + * The config properties are: + * - game: Current game instance. + * - renderer: Current WebGL renderer. + * - gl: Current WebGL context. + * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. + * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). + * - vertShader: Source for vertex shader as a string. + * - fragShader: Source for fragment shader as a string. + * - vertexCapacity: The amount of vertices that shall be allocated + * - vertexSize: The size of a single vertex in bytes. + * - vertices: An optional buffer of vertices + * - attributes: An array describing the vertex attributes + * + * The vertex attributes properties are: + * - name : String - Name of the attribute in the vertex shader + * - size : integer - How many components describe the attribute. For ex: vec3 = size of 3, float = size of 1 + * - type : GLenum - WebGL type (gl.BYTE, gl.SHORT, gl.UNSIGNED_BYTE, gl.UNSIGNED_SHORT, gl.FLOAT) + * - normalized : boolean - Is the attribute normalized + * - offset : integer - The offset in bytes to the current attribute in the vertex. Equivalent to offsetof(vertex, attrib) in C + * Here you can find more information of how to describe an attribute: + * - https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer + * + * @class WebGLPipeline + * @memberof Phaser.Renderer.WebGL + * @constructor + * @since 3.0.0 + * + * @param {object} config - The configuration object for this WebGL Pipeline, as described above. + */ +var WebGLPipeline = new Class({ + + initialize: + + function WebGLPipeline (config) + { + /** + * Name of the Pipeline. Used for identifying + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#name + * @type {string} + * @since 3.0.0 + */ + this.name = 'WebGLPipeline'; + + /** + * The Game which owns this WebGL Pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#game + * @type {Phaser.Game} + * @since 3.0.0 + */ + this.game = config.game; + + /** + * The canvas which this WebGL Pipeline renders to. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#view + * @type {HTMLCanvasElement} + * @since 3.0.0 + */ + this.view = config.game.canvas; + + /** + * Used to store the current game resolution + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#resolution + * @type {number} + * @since 3.0.0 + */ + this.resolution = 1; + + /** + * Width of the current viewport + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#width + * @type {number} + * @since 3.0.0 + */ + this.width = 0; + + /** + * Height of the current viewport + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#height + * @type {number} + * @since 3.0.0 + */ + this.height = 0; + + /** + * The WebGL context this WebGL Pipeline uses. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#gl + * @type {WebGLRenderingContext} + * @since 3.0.0 + */ + this.gl = config.gl; + + /** + * How many vertices have been fed to the current pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCount + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.vertexCount = 0; + + /** + * The limit of vertices that the pipeline can hold + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCapacity + * @type {integer} + * @since 3.0.0 + */ + this.vertexCapacity = config.vertexCapacity; + + /** + * The WebGL Renderer which owns this WebGL Pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#renderer + * @type {Phaser.Renderer.WebGL.WebGLRenderer} + * @since 3.0.0 + */ + this.renderer = config.renderer; + + /** + * Raw byte buffer of vertices. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexData + * @type {ArrayBuffer} + * @since 3.0.0 + */ + this.vertexData = (config.vertices ? config.vertices : new ArrayBuffer(config.vertexCapacity * config.vertexSize)); + + /** + * The handle to a WebGL vertex buffer object. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexBuffer + * @type {WebGLBuffer} + * @since 3.0.0 + */ + this.vertexBuffer = this.renderer.createVertexBuffer((config.vertices ? config.vertices : this.vertexData.byteLength), this.gl.STREAM_DRAW); + + /** + * The handle to a WebGL program + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#program + * @type {WebGLProgram} + * @since 3.0.0 + */ + this.program = this.renderer.createProgram(config.vertShader, config.fragShader); + + /** + * Array of objects that describe the vertex attributes + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#attributes + * @type {object} + * @since 3.0.0 + */ + this.attributes = config.attributes; + + /** + * The size in bytes of the vertex + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexSize + * @type {integer} + * @since 3.0.0 + */ + this.vertexSize = config.vertexSize; + + /** + * The primitive topology which the pipeline will use to submit draw calls + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#topology + * @type {integer} + * @since 3.0.0 + */ + this.topology = config.topology; + + /** + * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources + * to the GPU. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#bytes + * @type {Uint8Array} + * @since 3.0.0 + */ + this.bytes = new Uint8Array(this.vertexData); + + /** + * This will store the amount of components of 32 bit length + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexComponentCount + * @type {integer} + * @since 3.0.0 + */ + this.vertexComponentCount = Utils.getComponentCount(config.attributes, this.gl); + + /** + * Indicates if the current pipeline is flushing the contents to the GPU. + * When the variable is set the flush function will be locked. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#flushLocked + * @type {boolean} + * @since 3.1.0 + */ + this.flushLocked = false; + + /** + * Indicates if the current pipeline is active or not for this frame only. + * Reset in the onRender method. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#active + * @type {boolean} + * @since 3.10.0 + */ + this.active = false; + }, + + /** + * Called when the Game has fully booted and the Renderer has finished setting up. + * + * By this stage all Game level systems are now in place and you can perform any final + * tasks that the pipeline may need that relied on game systems such as the Texture Manager. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#boot + * @since 3.11.0 + */ + boot: function () + { + }, + + /** + * Adds a description of vertex attribute to the pipeline + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#addAttribute + * @since 3.2.0 + * + * @param {string} name - Name of the vertex attribute + * @param {integer} size - Vertex component size + * @param {integer} type - Type of the attribute + * @param {boolean} normalized - Is the value normalized to a range + * @param {integer} offset - Byte offset to the beginning of the first element in the vertex + * + * @return {this} This WebGLPipeline instance. + */ + addAttribute: function (name, size, type, normalized, offset) + { + this.attributes.push({ + name: name, + size: size, + type: this.renderer.glFormats[type], + normalized: normalized, + offset: offset + }); + + return this; + }, + + /** + * Check if the current batch of vertices is full. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#shouldFlush + * @since 3.0.0 + * + * @return {boolean} `true` if the current batch should be flushed, otherwise `false`. + */ + shouldFlush: function () + { + return (this.vertexCount >= this.vertexCapacity); + }, + + /** + * Resizes the properties used to describe the viewport + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#resize + * @since 3.0.0 + * + * @param {number} width - The new width of this WebGL Pipeline. + * @param {number} height - The new height of this WebGL Pipeline. + * @param {number} resolution - The resolution this WebGL Pipeline should be resized to. + * + * @return {this} This WebGLPipeline instance. + */ + resize: function (width, height, resolution) + { + this.width = width * resolution; + this.height = height * resolution; + this.resolution = resolution; + + return this; + }, + + /** + * Binds the pipeline resources, including programs, vertex buffers and binds attributes + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#bind + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + bind: function () + { + var gl = this.gl; + var vertexBuffer = this.vertexBuffer; + var attributes = this.attributes; + var program = this.program; + var renderer = this.renderer; + var vertexSize = this.vertexSize; + + renderer.setProgram(program); + renderer.setVertexBuffer(vertexBuffer); + + for (var index = 0; index < attributes.length; ++index) + { + var element = attributes[index]; + var location = gl.getAttribLocation(program, element.name); + + if (location >= 0) + { + gl.enableVertexAttribArray(location); + gl.vertexAttribPointer(location, element.size, element.type, element.normalized, vertexSize, element.offset); + } + else if (location !== -1) + { + gl.disableVertexAttribArray(location); + } + } + + return this; + }, + + /** + * Set whenever this WebGL Pipeline is bound to a WebGL Renderer. + * + * This method is called every time the WebGL Pipeline is attempted to be bound, even if it already is the current pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBind + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + onBind: function () + { + // This is for updating uniform data it's called on each bind attempt. + return this; + }, + + /** + * Called before each frame is rendered, but after the canvas has been cleared. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPreRender + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + onPreRender: function () + { + // called once every frame + return this; + }, + + /** + * Called before a Scene's Camera is rendered. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onRender + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with. + * + * @return {this} This WebGLPipeline instance. + */ + onRender: function () + { + // called for each camera + return this; + }, + + /** + * Called after each frame has been completely rendered and snapshots have been taken. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPostRender + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + onPostRender: function () + { + // called once every frame + return this; + }, + + /** + * Uploads the vertex data and emits a draw call + * for the current batch of vertices. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#flush + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + flush: function () + { + if (this.flushLocked) { return this; } + + this.flushLocked = true; + + var gl = this.gl; + var vertexCount = this.vertexCount; + var topology = this.topology; + var vertexSize = this.vertexSize; + + if (vertexCount === 0) + { + this.flushLocked = false; + return; + } + + gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); + gl.drawArrays(topology, 0, vertexCount); + + this.vertexCount = 0; + this.flushLocked = false; + + return this; + }, + + /** + * Removes all object references in this WebGL Pipeline and removes its program from the WebGL context. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#destroy + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + destroy: function () + { + var gl = this.gl; + + gl.deleteProgram(this.program); + gl.deleteBuffer(this.vertexBuffer); + + delete this.program; + delete this.vertexBuffer; + delete this.gl; + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat1 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {number} x - The new value of the `float` uniform. + * + * @return {this} This WebGLPipeline instance. + */ + setFloat1: function (name, x) + { + this.renderer.setFloat1(this.program, name, x); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat2 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {number} x - The new X component of the `vec2` uniform. + * @param {number} y - The new Y component of the `vec2` uniform. + * + * @return {this} This WebGLPipeline instance. + */ + setFloat2: function (name, x, y) + { + this.renderer.setFloat2(this.program, name, x, y); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat3 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {number} x - The new X component of the `vec3` uniform. + * @param {number} y - The new Y component of the `vec3` uniform. + * @param {number} z - The new Z component of the `vec3` uniform. + * + * @return {this} This WebGLPipeline instance. + */ + setFloat3: function (name, x, y, z) + { + this.renderer.setFloat3(this.program, name, x, y, z); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat4 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {number} x - X component of the uniform + * @param {number} y - Y component of the uniform + * @param {number} z - Z component of the uniform + * @param {number} w - W component of the uniform + * + * @return {this} This WebGLPipeline instance. + */ + setFloat4: function (name, x, y, z, w) + { + this.renderer.setFloat4(this.program, name, x, y, z, w); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat1v + * @since 3.13.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLPipeline instance. + */ + setFloat1v: function (name, arr) + { + this.renderer.setFloat1v(this.program, name, arr); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat2v + * @since 3.13.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLPipeline instance. + */ + setFloat2v: function (name, arr) + { + this.renderer.setFloat2v(this.program, name, arr); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat3v + * @since 3.13.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLPipeline instance. + */ + setFloat3v: function (name, arr) + { + this.renderer.setFloat3v(this.program, name, arr); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat4v + * @since 3.13.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLPipeline instance. + */ + setFloat4v: function (name, arr) + { + this.renderer.setFloat4v(this.program, name, arr); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt1 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {integer} x - The new value of the `int` uniform. + * + * @return {this} This WebGLPipeline instance. + */ + setInt1: function (name, x) + { + this.renderer.setInt1(this.program, name, x); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt2 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {integer} x - The new X component of the `ivec2` uniform. + * @param {integer} y - The new Y component of the `ivec2` uniform. + * + * @return {this} This WebGLPipeline instance. + */ + setInt2: function (name, x, y) + { + this.renderer.setInt2(this.program, name, x, y); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt3 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {integer} x - The new X component of the `ivec3` uniform. + * @param {integer} y - The new Y component of the `ivec3` uniform. + * @param {integer} z - The new Z component of the `ivec3` uniform. + * + * @return {this} This WebGLPipeline instance. + */ + setInt3: function (name, x, y, z) + { + this.renderer.setInt3(this.program, name, x, y, z); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt4 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {integer} x - X component of the uniform + * @param {integer} y - Y component of the uniform + * @param {integer} z - Z component of the uniform + * @param {integer} w - W component of the uniform + * + * @return {this} This WebGLPipeline instance. + */ + setInt4: function (name, x, y, z, w) + { + this.renderer.setInt4(this.program, name, x, y, z, w); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix2 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {Float32Array} matrix - The new values for the `mat2` uniform. + * + * @return {this} This WebGLPipeline instance. + */ + setMatrix2: function (name, transpose, matrix) + { + this.renderer.setMatrix2(this.program, name, transpose, matrix); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix3 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {Float32Array} matrix - The new values for the `mat3` uniform. + * + * @return {this} This WebGLPipeline instance. + */ + setMatrix3: function (name, transpose, matrix) + { + this.renderer.setMatrix3(this.program, name, transpose, matrix); + + return this; + }, + + /** + * Set a uniform value of the current pipeline program. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix4 + * @since 3.2.0 + * + * @param {string} name - The name of the uniform to look-up and modify. + * @param {boolean} transpose - Should the matrix be transpose + * @param {Float32Array} matrix - Matrix data + * + * @return {this} This WebGLPipeline instance. + */ + setMatrix4: function (name, transpose, matrix) + { + this.renderer.setMatrix4(this.program, name, transpose, matrix); + + return this; + } + +}); + +module.exports = WebGLPipeline; + + +/***/ }), +/* 226 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Earcut = __webpack_require__(63); +var GetFastValue = __webpack_require__(2); +var ModelViewProjection = __webpack_require__(487); +var ShaderSourceFS = __webpack_require__(735); +var ShaderSourceVS = __webpack_require__(736); +var TransformMatrix = __webpack_require__(32); +var Utils = __webpack_require__(9); +var WebGLPipeline = __webpack_require__(225); + +/** + * @classdesc + * TextureTintPipeline implements the rendering infrastructure + * for displaying textured objects + * The config properties are: + * - game: Current game instance. + * - renderer: Current WebGL renderer. + * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. + * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). + * - vertShader: Source for vertex shader as a string. + * - fragShader: Source for fragment shader as a string. + * - vertexCapacity: The amount of vertices that shall be allocated + * - vertexSize: The size of a single vertex in bytes. + * + * @class TextureTintPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.0.0 + * + * @param {object} config - The configuration options for this Texture Tint Pipeline, as described above. + */ +var TextureTintPipeline = new Class({ + + Extends: WebGLPipeline, + + Mixins: [ + ModelViewProjection + ], + + initialize: + + function TextureTintPipeline (config) + { + var rendererConfig = config.renderer.config; + + // Vertex Size = attribute size added together (2 + 2 + 1 + 4) + + WebGLPipeline.call(this, { + game: config.game, + renderer: config.renderer, + gl: config.renderer.gl, + topology: GetFastValue(config, 'topology', config.renderer.gl.TRIANGLES), + vertShader: GetFastValue(config, 'vertShader', ShaderSourceVS), + fragShader: GetFastValue(config, 'fragShader', ShaderSourceFS), + vertexCapacity: GetFastValue(config, 'vertexCapacity', 6 * rendererConfig.batchSize), + vertexSize: GetFastValue(config, 'vertexSize', Float32Array.BYTES_PER_ELEMENT * 5 + Uint8Array.BYTES_PER_ELEMENT * 4), + attributes: [ + { + name: 'inPosition', + size: 2, + type: config.renderer.gl.FLOAT, + normalized: false, + offset: 0 + }, + { + name: 'inTexCoord', + size: 2, + type: config.renderer.gl.FLOAT, + normalized: false, + offset: Float32Array.BYTES_PER_ELEMENT * 2 + }, + { + name: 'inTintEffect', + size: 1, + type: config.renderer.gl.FLOAT, + normalized: false, + offset: Float32Array.BYTES_PER_ELEMENT * 4 + }, + { + name: 'inTint', + size: 4, + type: config.renderer.gl.UNSIGNED_BYTE, + normalized: true, + offset: Float32Array.BYTES_PER_ELEMENT * 5 + } + ] + }); + + /** + * Float32 view of the array buffer containing the pipeline's vertices. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#vertexViewF32 + * @type {Float32Array} + * @since 3.0.0 + */ + this.vertexViewF32 = new Float32Array(this.vertexData); + + /** + * Uint32 view of the array buffer containing the pipeline's vertices. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#vertexViewU32 + * @type {Uint32Array} + * @since 3.0.0 + */ + this.vertexViewU32 = new Uint32Array(this.vertexData); + + /** + * Size of the batch. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#maxQuads + * @type {integer} + * @since 3.0.0 + */ + this.maxQuads = rendererConfig.batchSize; + + /** + * Collection of batch information + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batches + * @type {array} + * @since 3.1.0 + */ + this.batches = []; + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#_tempMatrix1 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this._tempMatrix1 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#_tempMatrix2 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this._tempMatrix2 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#_tempMatrix3 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this._tempMatrix3 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#_tempMatrix4 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this._tempMatrix4 = new TransformMatrix(); + + /** + * Used internally to draw stroked triangles. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#tempTriangle + * @type {array} + * @private + * @since 3.12.0 + */ + this.tempTriangle = [ + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 } + ]; + + /** + * The tint effect to be applied by the shader in the next geometry draw: + * + * 0 = texture multiplied by color + * 1 = solid color + texture alpha + * 2 = solid color, no texture + * 3 = solid texture, no color + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#tintEffect + * @type {number} + * @private + * @since 3.12.0 + */ + this.tintEffect = 2; + + /** + * Cached stroke tint. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#strokeTint + * @type {object} + * @private + * @since 3.12.0 + */ + this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; + + /** + * Cached fill tint. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#fillTint + * @type {object} + * @private + * @since 3.12.0 + */ + this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; + + /** + * Internal texture frame reference. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#currentFrame + * @type {Phaser.Textures.Frame} + * @private + * @since 3.12.0 + */ + this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }; + + /** + * Internal path quad cache. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#firstQuad + * @type {array} + * @private + * @since 3.12.0 + */ + this.firstQuad = [ 0, 0, 0, 0, 0 ]; + + /** + * Internal path quad cache. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#prevQuad + * @type {array} + * @private + * @since 3.12.0 + */ + this.prevQuad = [ 0, 0, 0, 0, 0 ]; + + /** + * Used internally for triangulating a polygon. + * + * @name Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#polygonCache + * @type {array} + * @private + * @since 3.12.0 + */ + this.polygonCache = []; + + this.mvpInit(); + }, + + /** + * Called every time the pipeline needs to be used. + * It binds all necessary resources. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#onBind + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + onBind: function () + { + WebGLPipeline.prototype.onBind.call(this); + + this.mvpUpdate(); + + return this; + }, + + /** + * Resizes this pipeline and updates the projection. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#resize + * @since 3.0.0 + * + * @param {number} width - The new width. + * @param {number} height - The new height. + * @param {number} resolution - The resolution. + * + * @return {this} This WebGLPipeline instance. + */ + resize: function (width, height, resolution) + { + WebGLPipeline.prototype.resize.call(this, width, height, resolution); + + this.projOrtho(0, this.width, this.height, 0, -1000.0, 1000.0); + + return this; + }, + + /** + * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#setTexture2D + * @since 3.1.0 + * + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. + * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound. + * + * @return {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} This pipeline instance. + */ + setTexture2D: function (texture, unit) + { + if (texture === undefined) { texture = this.renderer.blankTexture.glTexture; } + if (unit === undefined) { unit = 0; } + + if (this.requireTextureBatch(texture, unit)) + { + this.pushBatch(texture, unit); + } + + return this; + }, + + /** + * Checks if the current batch has the same texture and texture unit, or if we need to create a new batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#requireTextureBatch + * @since 3.16.0 + * + * @param {WebGLTexture} texture - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. + * @param {integer} unit - Texture unit to which the texture needs to be bound. + * + * @return {boolean} `true` if the pipeline needs to create a new batch, otherwise `false`. + */ + requireTextureBatch: function (texture, unit) + { + var batches = this.batches; + var batchLength = batches.length; + + if (batchLength > 0) + { + // If Texture Unit specified, we get the texture from the textures array, otherwise we use the texture property + var currentTexture = (unit > 0) ? batches[batchLength - 1].textures[unit - 1] : batches[batchLength - 1].texture; + + return !(currentTexture === texture); + } + + return true; + }, + + /** + * Creates a new batch object and pushes it to a batch array. + * The batch object contains information relevant to the current + * vertex batch like the offset in the vertex buffer, vertex count and + * the textures used by that batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#pushBatch + * @since 3.1.0 + * + * @param {WebGLTexture} texture - Optional WebGLTexture that will be assigned to the created batch. + * @param {integer} unit - Texture unit to which the texture needs to be bound. + */ + pushBatch: function (texture, unit) + { + if (unit === 0) + { + this.batches.push({ + first: this.vertexCount, + texture: texture, + textures: [] + }); + } + else + { + var textures = []; + + textures[unit - 1] = texture; + + this.batches.push({ + first: this.vertexCount, + texture: null, + textures: textures + }); + } + }, + + /** + * Uploads the vertex data and emits a draw call for the current batch of vertices. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#flush + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + flush: function () + { + if (this.flushLocked) + { + return this; + } + + this.flushLocked = true; + + var gl = this.gl; + var vertexCount = this.vertexCount; + var topology = this.topology; + var vertexSize = this.vertexSize; + var renderer = this.renderer; + + var batches = this.batches; + var batchCount = batches.length; + var batchVertexCount = 0; + var batch = null; + var batchNext; + var textureIndex; + var nTexture; + + if (batchCount === 0 || vertexCount === 0) + { + this.flushLocked = false; + + return this; + } + + gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); + + // Process the TEXTURE BATCHES + + for (var index = 0; index < batchCount - 1; index++) + { + batch = batches[index]; + batchNext = batches[index + 1]; + + // Multi-texture check (for non-zero texture units) + if (batch.textures.length > 0) + { + for (textureIndex = 0; textureIndex < batch.textures.length; ++textureIndex) + { + nTexture = batch.textures[textureIndex]; + + if (nTexture) + { + renderer.setTexture2D(nTexture, 1 + textureIndex, false); + } + } + + gl.activeTexture(gl.TEXTURE0); + } + + batchVertexCount = batchNext.first - batch.first; + + // Bail out if texture property is null (i.e. if a texture unit > 0) + if (batch.texture === null || batchVertexCount <= 0) + { + continue; + } + + renderer.setTexture2D(batch.texture, 0, false); + + gl.drawArrays(topology, batch.first, batchVertexCount); + } + + // Left over data + batch = batches[batchCount - 1]; + + // Multi-texture check (for non-zero texture units) + + if (batch.textures.length > 0) + { + for (textureIndex = 0; textureIndex < batch.textures.length; ++textureIndex) + { + nTexture = batch.textures[textureIndex]; + + if (nTexture) + { + renderer.setTexture2D(nTexture, 1 + textureIndex, false); + } + } + + gl.activeTexture(gl.TEXTURE0); + } + + batchVertexCount = vertexCount - batch.first; + + if (batch.texture && batchVertexCount > 0) + { + renderer.setTexture2D(batch.texture, 0, false); + + gl.drawArrays(topology, batch.first, batchVertexCount); + } + + this.vertexCount = 0; + + batches.length = 0; + + this.flushLocked = false; + + return this; + }, + + /** + * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchSprite + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} sprite - The texture based Game Object to add to the batch. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set. + */ + batchSprite: function (sprite, camera, parentTransformMatrix) + { + // Will cause a flush if there are batchSize entries already + this.renderer.setPipeline(this); + + var camMatrix = this._tempMatrix1; + var spriteMatrix = this._tempMatrix2; + var calcMatrix = this._tempMatrix3; + + var frame = sprite.frame; + var texture = frame.glTexture; + + var u0 = frame.u0; + var v0 = frame.v0; + var u1 = frame.u1; + var v1 = frame.v1; + var frameX = frame.x; + var frameY = frame.y; + var frameWidth = frame.cutWidth; + var frameHeight = frame.cutHeight; + + var x = -sprite.displayOriginX + frameX; + var y = -sprite.displayOriginY + frameY; + + if (sprite.isCropped) + { + var crop = sprite._crop; + + if (crop.flipX !== sprite.flipX || crop.flipY !== sprite.flipY) + { + frame.updateCropUVs(crop, sprite.flipX, sprite.flipY); + } + + u0 = crop.u0; + v0 = crop.v0; + u1 = crop.u1; + v1 = crop.v1; + + frameWidth = crop.width; + frameHeight = crop.height; + + frameX = crop.x; + frameY = crop.y; + + x = -sprite.displayOriginX + frameX; + y = -sprite.displayOriginY + frameY; + } + + if (sprite.flipX) + { + x += frameWidth; + frameWidth *= -1; + } + + if (sprite.flipY) + { + y += frameHeight; + frameHeight *= -1; + } + + var xw = x + frameWidth; + var yh = y + frameHeight; + + spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentTransformMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * sprite.scrollFactorX, -camera.scrollY * sprite.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = sprite.x; + spriteMatrix.f = sprite.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else + { + spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX; + spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + var tintTL = Utils.getTintAppendFloatAlpha(sprite._tintTL, camera.alpha * sprite._alphaTL); + var tintTR = Utils.getTintAppendFloatAlpha(sprite._tintTR, camera.alpha * sprite._alphaTR); + var tintBL = Utils.getTintAppendFloatAlpha(sprite._tintBL, camera.alpha * sprite._alphaBL); + var tintBR = Utils.getTintAppendFloatAlpha(sprite._tintBR, camera.alpha * sprite._alphaBR); + + if (camera.roundPixels) + { + tx0 = Math.round(tx0); + ty0 = Math.round(ty0); + + tx1 = Math.round(tx1); + ty1 = Math.round(ty1); + + tx2 = Math.round(tx2); + ty2 = Math.round(ty2); + + tx3 = Math.round(tx3); + ty3 = Math.round(ty3); + } + + this.setTexture2D(texture, 0); + + var tintEffect = (sprite._isTinted && sprite.tintFill); + + this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0); + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchQuad + * @since 3.12.0 + * + * @param {number} x0 - The top-left x position. + * @param {number} y0 - The top-left y position. + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {number} tintBR - The bottom-right tint color value. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit) + { + var hasFlushed = false; + + if (this.vertexCount + 6 > this.vertexCapacity) + { + this.flush(); + + hasFlushed = true; + + this.setTexture2D(texture, unit); + } + + var vertexViewF32 = this.vertexViewF32; + var vertexViewU32 = this.vertexViewU32; + + var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x0; + vertexViewF32[++vertexOffset] = y0; + vertexViewF32[++vertexOffset] = u0; + vertexViewF32[++vertexOffset] = v0; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tintTL; + + vertexViewF32[++vertexOffset] = x1; + vertexViewF32[++vertexOffset] = y1; + vertexViewF32[++vertexOffset] = u0; + vertexViewF32[++vertexOffset] = v1; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tintBL; + + vertexViewF32[++vertexOffset] = x2; + vertexViewF32[++vertexOffset] = y2; + vertexViewF32[++vertexOffset] = u1; + vertexViewF32[++vertexOffset] = v1; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tintBR; + + vertexViewF32[++vertexOffset] = x0; + vertexViewF32[++vertexOffset] = y0; + vertexViewF32[++vertexOffset] = u0; + vertexViewF32[++vertexOffset] = v0; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tintTL; + + vertexViewF32[++vertexOffset] = x2; + vertexViewF32[++vertexOffset] = y2; + vertexViewF32[++vertexOffset] = u1; + vertexViewF32[++vertexOffset] = v1; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tintBR; + + vertexViewF32[++vertexOffset] = x3; + vertexViewF32[++vertexOffset] = y3; + vertexViewF32[++vertexOffset] = u1; + vertexViewF32[++vertexOffset] = v0; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tintTR; + + this.vertexCount += 6; + + return hasFlushed; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 3 vertices in the following arrangement: + * + * ``` + * 0 + * |\ + * | \ + * | \ + * | \ + * | \ + * 1-----2 + * ``` + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchTri + * @since 3.12.0 + * + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchTri: function (x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit) + { + var hasFlushed = false; + + if (this.vertexCount + 3 > this.vertexCapacity) + { + this.flush(); + + this.setTexture2D(texture, unit); + + hasFlushed = true; + } + + var vertexViewF32 = this.vertexViewF32; + var vertexViewU32 = this.vertexViewU32; + + var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x1; + vertexViewF32[++vertexOffset] = y1; + vertexViewF32[++vertexOffset] = u0; + vertexViewF32[++vertexOffset] = v0; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tintTL; + + vertexViewF32[++vertexOffset] = x2; + vertexViewF32[++vertexOffset] = y2; + vertexViewF32[++vertexOffset] = u0; + vertexViewF32[++vertexOffset] = v1; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tintTR; + + vertexViewF32[++vertexOffset] = x3; + vertexViewF32[++vertexOffset] = y3; + vertexViewF32[++vertexOffset] = u1; + vertexViewF32[++vertexOffset] = v1; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tintBL; + + this.vertexCount += 3; + + return hasFlushed; + }, + + /** + * Generic function for batching a textured quad using argument values instead of a Game Object. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchTexture + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject. + * @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad. + * @param {integer} textureWidth - Real texture width. + * @param {integer} textureHeight - Real texture height. + * @param {number} srcX - X coordinate of the quad. + * @param {number} srcY - Y coordinate of the quad. + * @param {number} srcWidth - Width of the quad. + * @param {number} srcHeight - Height of the quad. + * @param {number} scaleX - X component of scale. + * @param {number} scaleY - Y component of scale. + * @param {number} rotation - Rotation of the quad. + * @param {boolean} flipX - Indicates if the quad is horizontally flipped. + * @param {boolean} flipY - Indicates if the quad is vertically flipped. + * @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll. + * @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll. + * @param {number} displayOriginX - Horizontal origin in pixels. + * @param {number} displayOriginY - Vertical origin in pixels. + * @param {number} frameX - X coordinate of the texture frame. + * @param {number} frameY - Y coordinate of the texture frame. + * @param {number} frameWidth - Width of the texture frame. + * @param {number} frameHeight - Height of the texture frame. + * @param {integer} tintTL - Tint for top left. + * @param {integer} tintTR - Tint for top right. + * @param {integer} tintBL - Tint for bottom left. + * @param {integer} tintBR - Tint for bottom right. + * @param {number} tintEffect - The tint effect. + * @param {number} uOffset - Horizontal offset on texture coordinate. + * @param {number} vOffset - Vertical offset on texture coordinate. + * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container. + * @param {boolean} [skipFlip=false] - Skip the renderTexture check. + */ + batchTexture: function ( + gameObject, + texture, + textureWidth, textureHeight, + srcX, srcY, + srcWidth, srcHeight, + scaleX, scaleY, + rotation, + flipX, flipY, + scrollFactorX, scrollFactorY, + displayOriginX, displayOriginY, + frameX, frameY, frameWidth, frameHeight, + tintTL, tintTR, tintBL, tintBR, tintEffect, + uOffset, vOffset, + camera, + parentTransformMatrix, + skipFlip) + { + this.renderer.setPipeline(this, gameObject); + + var camMatrix = this._tempMatrix1; + var spriteMatrix = this._tempMatrix2; + var calcMatrix = this._tempMatrix3; + + var u0 = (frameX / textureWidth) + uOffset; + var v0 = (frameY / textureHeight) + vOffset; + var u1 = (frameX + frameWidth) / textureWidth + uOffset; + var v1 = (frameY + frameHeight) / textureHeight + vOffset; + + var width = srcWidth; + var height = srcHeight; + + var x = -displayOriginX; + var y = -displayOriginY; + + if (gameObject.isCropped) + { + var crop = gameObject._crop; + + width = crop.width; + height = crop.height; + + srcWidth = crop.width; + srcHeight = crop.height; + + frameX = crop.x; + frameY = crop.y; + + var ox = frameX; + var oy = frameY; + + if (flipX) + { + ox = (frameWidth - crop.x - crop.width); + } + + if (flipY && !texture.isRenderTexture) + { + oy = (frameHeight - crop.y - crop.height); + } + + u0 = (ox / textureWidth) + uOffset; + v0 = (oy / textureHeight) + vOffset; + u1 = (ox + crop.width) / textureWidth + uOffset; + v1 = (oy + crop.height) / textureHeight + vOffset; + + x = -displayOriginX + frameX; + y = -displayOriginY + frameY; + } + + // Invert the flipY if this is a RenderTexture + flipY = flipY ^ (!skipFlip && texture.isRenderTexture ? 1 : 0); + + if (flipX) + { + width *= -1; + x += srcWidth; + } + + if (flipY) + { + height *= -1; + y += srcHeight; + } + + var xw = x + width; + var yh = y + height; + + spriteMatrix.applyITRS(srcX, srcY, rotation, scaleX, scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentTransformMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = srcX; + spriteMatrix.f = srcY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else + { + spriteMatrix.e -= camera.scrollX * scrollFactorX; + spriteMatrix.f -= camera.scrollY * scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + if (camera.roundPixels) + { + tx0 = Math.round(tx0); + ty0 = Math.round(ty0); + + tx1 = Math.round(tx1); + ty1 = Math.round(ty1); + + tx2 = Math.round(tx2); + ty2 = Math.round(ty2); + + tx3 = Math.round(tx3); + ty3 = Math.round(ty3); + } + + this.setTexture2D(texture, 0); + + this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0); + }, + + /** + * Adds a Texture Frame into the batch for rendering. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchTextureFrame + * @since 3.12.0 + * + * @param {Phaser.Textures.Frame} frame - The Texture Frame to be rendered. + * @param {number} x - The horizontal position to render the texture at. + * @param {number} y - The vertical position to render the texture at. + * @param {number} tint - The tint color. + * @param {number} alpha - The alpha value. + * @param {Phaser.GameObjects.Components.TransformMatrix} transformMatrix - The Transform Matrix to use for the texture. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - A parent Transform Matrix. + */ + batchTextureFrame: function ( + frame, + x, y, + tint, alpha, + transformMatrix, + parentTransformMatrix + ) + { + this.renderer.setPipeline(this); + + var spriteMatrix = this._tempMatrix1.copyFrom(transformMatrix); + var calcMatrix = this._tempMatrix2; + + var xw = x + frame.width; + var yh = y + frame.height; + + if (parentTransformMatrix) + { + spriteMatrix.multiply(parentTransformMatrix, calcMatrix); + } + else + { + calcMatrix = spriteMatrix; + } + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + this.setTexture2D(frame.glTexture, 0); + + tint = Utils.getTintAppendFloatAlpha(tint, alpha); + + this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, 0, frame.glTexture, 0); + }, + + /** + * Pushes a filled rectangle into the vertex batch. + * Rectangle has no transform values and isn't transformed into the local space. + * Used for directly batching untransformed rectangles, such as Camera background colors. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#drawFillRect + * @since 3.12.0 + * + * @param {number} x - Horizontal top left coordinate of the rectangle. + * @param {number} y - Vertical top left coordinate of the rectangle. + * @param {number} width - Width of the rectangle. + * @param {number} height - Height of the rectangle. + * @param {number} color - Color of the rectangle to draw. + * @param {number} alpha - Alpha value of the rectangle to draw. + */ + drawFillRect: function (x, y, width, height, color, alpha) + { + var xw = x + width; + var yh = y + height; + + this.setTexture2D(); + + var tint = Utils.getTintAppendFloatAlphaAndSwap(color, alpha); + + this.batchQuad(x, y, x, yh, xw, yh, xw, y, 0, 0, 1, 1, tint, tint, tint, tint, 2); + }, + + /** + * Pushes a filled rectangle into the vertex batch. + * Rectangle factors in the given transform matrices before adding to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchFillRect + * @since 3.12.0 + * + * @param {number} x - Horizontal top left coordinate of the rectangle. + * @param {number} y - Vertical top left coordinate of the rectangle. + * @param {number} width - Width of the rectangle. + * @param {number} height - Height of the rectangle. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix) + { + this.renderer.setPipeline(this); + + var calcMatrix = this._tempMatrix3; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var xw = x + width; + var yh = y + height; + + var x0 = calcMatrix.getX(x, y); + var y0 = calcMatrix.getY(x, y); + + var x1 = calcMatrix.getX(x, yh); + var y1 = calcMatrix.getY(x, yh); + + var x2 = calcMatrix.getX(xw, yh); + var y2 = calcMatrix.getY(xw, yh); + + var x3 = calcMatrix.getX(xw, y); + var y3 = calcMatrix.getY(xw, y); + + var frame = this.currentFrame; + + var u0 = frame.u0; + var v0 = frame.v0; + var u1 = frame.u1; + var v1 = frame.v1; + + this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, this.fillTint.TL, this.fillTint.TR, this.fillTint.BL, this.fillTint.BR, this.tintEffect); + }, + + /** + * Pushes a filled triangle into the vertex batch. + * Triangle factors in the given transform matrices before adding to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchFillTriangle + * @since 3.12.0 + * + * @param {number} x0 - Point 0 x coordinate. + * @param {number} y0 - Point 0 y coordinate. + * @param {number} x1 - Point 1 x coordinate. + * @param {number} y1 - Point 1 y coordinate. + * @param {number} x2 - Point 2 x coordinate. + * @param {number} y2 - Point 2 y coordinate. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix) + { + this.renderer.setPipeline(this); + + var calcMatrix = this._tempMatrix3; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var tx0 = calcMatrix.getX(x0, y0); + var ty0 = calcMatrix.getY(x0, y0); + + var tx1 = calcMatrix.getX(x1, y1); + var ty1 = calcMatrix.getY(x1, y1); + + var tx2 = calcMatrix.getX(x2, y2); + var ty2 = calcMatrix.getY(x2, y2); + + var frame = this.currentFrame; + + var u0 = frame.u0; + var v0 = frame.v0; + var u1 = frame.u1; + var v1 = frame.v1; + + this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, u0, v0, u1, v1, this.fillTint.TL, this.fillTint.TR, this.fillTint.BL, this.tintEffect); + }, + + /** + * Pushes a stroked triangle into the vertex batch. + * Triangle factors in the given transform matrices before adding to the batch. + * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchStrokeTriangle + * @since 3.12.0 + * + * @param {number} x0 - Point 0 x coordinate. + * @param {number} y0 - Point 0 y coordinate. + * @param {number} x1 - Point 1 x coordinate. + * @param {number} y1 - Point 1 y coordinate. + * @param {number} x2 - Point 2 x coordinate. + * @param {number} y2 - Point 2 y coordinate. + * @param {number} lineWidth - The width of the line in pixels. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix) + { + var tempTriangle = this.tempTriangle; + + tempTriangle[0].x = x0; + tempTriangle[0].y = y0; + tempTriangle[0].width = lineWidth; + + tempTriangle[1].x = x1; + tempTriangle[1].y = y1; + tempTriangle[1].width = lineWidth; + + tempTriangle[2].x = x2; + tempTriangle[2].y = y2; + tempTriangle[2].width = lineWidth; + + tempTriangle[3].x = x0; + tempTriangle[3].y = y0; + tempTriangle[3].width = lineWidth; + + this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix); + }, + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and then passing it through Earcut, which + * creates a list of polygons. Each polygon is then added to the batch. + * + * The path is always automatically closed because it's filled. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchFillPath + * @since 3.12.0 + * + * @param {array} path - Collection of points that represent the path. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillPath: function (path, currentMatrix, parentMatrix) + { + this.renderer.setPipeline(this); + + var calcMatrix = this._tempMatrix3; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var length = path.length; + var polygonCache = this.polygonCache; + var polygonIndexArray; + var point; + + var tintTL = this.fillTint.TL; + var tintTR = this.fillTint.TR; + var tintBL = this.fillTint.BL; + var tintEffect = this.tintEffect; + + for (var pathIndex = 0; pathIndex < length; ++pathIndex) + { + point = path[pathIndex]; + polygonCache.push(point.x, point.y); + } + + polygonIndexArray = Earcut(polygonCache); + length = polygonIndexArray.length; + + var frame = this.currentFrame; + + for (var index = 0; index < length; index += 3) + { + var p0 = polygonIndexArray[index + 0] * 2; + var p1 = polygonIndexArray[index + 1] * 2; + var p2 = polygonIndexArray[index + 2] * 2; + + var x0 = polygonCache[p0 + 0]; + var y0 = polygonCache[p0 + 1]; + var x1 = polygonCache[p1 + 0]; + var y1 = polygonCache[p1 + 1]; + var x2 = polygonCache[p2 + 0]; + var y2 = polygonCache[p2 + 1]; + + var tx0 = calcMatrix.getX(x0, y0); + var ty0 = calcMatrix.getY(x0, y0); + + var tx1 = calcMatrix.getX(x1, y1); + var ty1 = calcMatrix.getY(x1, y1); + + var tx2 = calcMatrix.getX(x2, y2); + var ty2 = calcMatrix.getY(x2, y2); + + var u0 = frame.u0; + var v0 = frame.v0; + var u1 = frame.u1; + var v1 = frame.v1; + + this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect); + } + + polygonCache.length = 0; + }, + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and calling `batchLine` for each section + * of the path. + * + * The path is optionally closed at the end. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchStrokePath + * @since 3.12.0 + * + * @param {array} path - Collection of points that represent the path. + * @param {number} lineWidth - The width of the line segments in pixels. + * @param {boolean} pathOpen - Indicates if the path should be closed or left open. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix) + { + this.renderer.setPipeline(this); + + // Reset the closePath booleans + this.prevQuad[4] = 0; + this.firstQuad[4] = 0; + + var pathLength = path.length - 1; + + for (var pathIndex = 0; pathIndex < pathLength; pathIndex++) + { + var point0 = path[pathIndex]; + var point1 = path[pathIndex + 1]; + + this.batchLine( + point0.x, + point0.y, + point1.x, + point1.y, + point0.width / 2, + point1.width / 2, + lineWidth, + pathIndex, + !pathOpen && (pathIndex === pathLength - 1), + currentMatrix, + parentMatrix + ); + } + }, + + /** + * Creates a quad and adds it to the vertex batch based on the given line values. + * + * @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchLine + * @since 3.12.0 + * + * @param {number} ax - X coordinate to the start of the line + * @param {number} ay - Y coordinate to the start of the line + * @param {number} bx - X coordinate to the end of the line + * @param {number} by - Y coordinate to the end of the line + * @param {number} aLineWidth - Width of the start of the line + * @param {number} bLineWidth - Width of the end of the line + * @param {Float32Array} currentMatrix - Parent matrix, generally used by containers + */ + batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix) + { + this.renderer.setPipeline(this); + + var calcMatrix = this._tempMatrix3; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var dx = bx - ax; + var dy = by - ay; + + var len = Math.sqrt(dx * dx + dy * dy); + var al0 = aLineWidth * (by - ay) / len; + var al1 = aLineWidth * (ax - bx) / len; + var bl0 = bLineWidth * (by - ay) / len; + var bl1 = bLineWidth * (ax - bx) / len; + + var lx0 = bx - bl0; + var ly0 = by - bl1; + var lx1 = ax - al0; + var ly1 = ay - al1; + var lx2 = bx + bl0; + var ly2 = by + bl1; + var lx3 = ax + al0; + var ly3 = ay + al1; + + // tx0 = bottom right + var brX = calcMatrix.getX(lx0, ly0); + var brY = calcMatrix.getY(lx0, ly0); + + // tx1 = bottom left + var blX = calcMatrix.getX(lx1, ly1); + var blY = calcMatrix.getY(lx1, ly1); + + // tx2 = top right + var trX = calcMatrix.getX(lx2, ly2); + var trY = calcMatrix.getY(lx2, ly2); + + // tx3 = top left + var tlX = calcMatrix.getX(lx3, ly3); + var tlY = calcMatrix.getY(lx3, ly3); + + var tint = this.strokeTint; + var tintEffect = this.tintEffect; + + var tintTL = tint.TL; + var tintTR = tint.TR; + var tintBL = tint.BL; + var tintBR = tint.BR; + + var frame = this.currentFrame; + + var u0 = frame.u0; + var v0 = frame.v0; + var u1 = frame.u1; + var v1 = frame.v1; + + // TL, BL, BR, TR + this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); + + if (lineWidth <= 2) + { + // No point doing a linejoin if the line isn't thick enough + return; + } + + var prev = this.prevQuad; + var first = this.firstQuad; + + if (index > 0 && prev[4]) + { + this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); + } + else + { + first[0] = tlX; + first[1] = tlY; + first[2] = blX; + first[3] = blY; + first[4] = 1; + } + + if (closePath && first[4]) + { + // Add a join for the final path segment + this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); + } + else + { + // Store it + + prev[0] = brX; + prev[1] = brY; + prev[2] = trX; + prev[3] = trY; + prev[4] = 1; + } + } + +}); + +module.exports = TextureTintPipeline; + + +/***/ }), +/* 227 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Events` module contains methods to fire and listen to events on other objects. +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Events +*/ + +var Events = {}; + +module.exports = Events; + +var Common = __webpack_require__(37); + +(function() { + + /** + * Subscribes a callback function to the given object's `eventName`. + * @method on + * @param {} object + * @param {string} eventNames + * @param {function} callback + */ + Events.on = function(object, eventNames, callback) { + var names = eventNames.split(' '), + name; + + for (var i = 0; i < names.length; i++) { + name = names[i]; + object.events = object.events || {}; + object.events[name] = object.events[name] || []; + object.events[name].push(callback); + } + + return callback; + }; + + /** + * Removes the given event callback. If no callback, clears all callbacks in `eventNames`. If no `eventNames`, clears all events. + * @method off + * @param {} object + * @param {string} eventNames + * @param {function} callback + */ + Events.off = function(object, eventNames, callback) { + if (!eventNames) { + object.events = {}; + return; + } + + // handle Events.off(object, callback) + if (typeof eventNames === 'function') { + callback = eventNames; + eventNames = Common.keys(object.events).join(' '); + } + + var names = eventNames.split(' '); + + for (var i = 0; i < names.length; i++) { + var callbacks = object.events[names[i]], + newCallbacks = []; + + if (callback && callbacks) { + for (var j = 0; j < callbacks.length; j++) { + if (callbacks[j] !== callback) + newCallbacks.push(callbacks[j]); + } + } + + object.events[names[i]] = newCallbacks; + } + }; + + /** + * Fires all the callbacks subscribed to the given object's `eventName`, in the order they subscribed, if any. + * @method trigger + * @param {} object + * @param {string} eventNames + * @param {} event + */ + Events.trigger = function(object, eventNames, event) { + var names, + name, + callbacks, + eventClone; + + var events = object.events; + + if (events && Common.keys(events).length > 0) { + if (!event) + event = {}; + + names = eventNames.split(' '); + + for (var i = 0; i < names.length; i++) { + name = names[i]; + callbacks = events[name]; + + if (callbacks) { + eventClone = Common.clone(event, false); + eventClone.name = name; + eventClone.source = object; + + for (var j = 0; j < callbacks.length; j++) { + callbacks[j].apply(object, [eventClone]); + } + } + } + } + }; + +})(); + + +/***/ }), +/* 228 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Constraint` module contains methods for creating and manipulating constraints. +* Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position). +* The stiffness of constraints can be modified to create springs or elastic. +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Constraint +*/ + +var Constraint = {}; + +module.exports = Constraint; + +var Vertices = __webpack_require__(84); +var Vector = __webpack_require__(99); +var Sleeping = __webpack_require__(448); +var Bounds = __webpack_require__(100); +var Axes = __webpack_require__(1240); +var Common = __webpack_require__(37); + +(function() { + + Constraint._warming = 0.4; + Constraint._torqueDampen = 1; + Constraint._minLength = 0.000001; + + /** + * Creates a new constraint. + * All properties have default values, and many are pre-calculated automatically based on other properties. + * To simulate a revolute constraint (or pin joint) set `length: 0` and a high `stiffness` value (e.g. `0.7` or above). + * If the constraint is unstable, try lowering the `stiffness` value and / or increasing `engine.constraintIterations`. + * For compound bodies, constraints must be applied to the parent body (not one of its parts). + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {} options + * @return {constraint} constraint + */ + Constraint.create = function(options) { + var constraint = options; + + // if bodies defined but no points, use body centre + if (constraint.bodyA && !constraint.pointA) + constraint.pointA = { x: 0, y: 0 }; + if (constraint.bodyB && !constraint.pointB) + constraint.pointB = { x: 0, y: 0 }; + + // calculate static length using initial world space points + var initialPointA = constraint.bodyA ? Vector.add(constraint.bodyA.position, constraint.pointA) : constraint.pointA, + initialPointB = constraint.bodyB ? Vector.add(constraint.bodyB.position, constraint.pointB) : constraint.pointB, + length = Vector.magnitude(Vector.sub(initialPointA, initialPointB)); + + constraint.length = typeof constraint.length !== 'undefined' ? constraint.length : length; + + // option defaults + constraint.id = constraint.id || Common.nextId(); + constraint.label = constraint.label || 'Constraint'; + constraint.type = 'constraint'; + constraint.stiffness = constraint.stiffness || (constraint.length > 0 ? 1 : 0.7); + constraint.damping = constraint.damping || 0; + constraint.angularStiffness = constraint.angularStiffness || 0; + constraint.angleA = constraint.bodyA ? constraint.bodyA.angle : constraint.angleA; + constraint.angleB = constraint.bodyB ? constraint.bodyB.angle : constraint.angleB; + constraint.plugin = {}; + + // render + var render = { + visible: true, + lineWidth: 2, + strokeStyle: '#ffffff', + type: 'line', + anchors: true + }; + + if (constraint.length === 0 && constraint.stiffness > 0.1) { + render.type = 'pin'; + render.anchors = false; + } else if (constraint.stiffness < 0.9) { + render.type = 'spring'; + } + + constraint.render = Common.extend(render, constraint.render); + + return constraint; + }; + + /** + * Prepares for solving by constraint warming. + * @private + * @method preSolveAll + * @param {body[]} bodies + */ + Constraint.preSolveAll = function(bodies) { + for (var i = 0; i < bodies.length; i += 1) { + var body = bodies[i], + impulse = body.constraintImpulse; + + if (body.isStatic || (impulse.x === 0 && impulse.y === 0 && impulse.angle === 0)) { + continue; + } + + body.position.x += impulse.x; + body.position.y += impulse.y; + body.angle += impulse.angle; + } + }; + + /** + * Solves all constraints in a list of collisions. + * @private + * @method solveAll + * @param {constraint[]} constraints + * @param {number} timeScale + */ + Constraint.solveAll = function(constraints, timeScale) { + // Solve fixed constraints first. + for (var i = 0; i < constraints.length; i += 1) { + var constraint = constraints[i], + fixedA = !constraint.bodyA || (constraint.bodyA && constraint.bodyA.isStatic), + fixedB = !constraint.bodyB || (constraint.bodyB && constraint.bodyB.isStatic); + + if (fixedA || fixedB) { + Constraint.solve(constraints[i], timeScale); + } + } + + // Solve free constraints last. + for (i = 0; i < constraints.length; i += 1) { + constraint = constraints[i]; + fixedA = !constraint.bodyA || (constraint.bodyA && constraint.bodyA.isStatic); + fixedB = !constraint.bodyB || (constraint.bodyB && constraint.bodyB.isStatic); + + if (!fixedA && !fixedB) { + Constraint.solve(constraints[i], timeScale); + } + } + }; + + /** + * Solves a distance constraint with Gauss-Siedel method. + * @private + * @method solve + * @param {constraint} constraint + * @param {number} timeScale + */ + Constraint.solve = function(constraint, timeScale) { + var bodyA = constraint.bodyA, + bodyB = constraint.bodyB, + pointA = constraint.pointA, + pointB = constraint.pointB; + + if (!bodyA && !bodyB) + return; + + // update reference angle + if (bodyA && !bodyA.isStatic) { + Vector.rotate(pointA, bodyA.angle - constraint.angleA, pointA); + constraint.angleA = bodyA.angle; + } + + // update reference angle + if (bodyB && !bodyB.isStatic) { + Vector.rotate(pointB, bodyB.angle - constraint.angleB, pointB); + constraint.angleB = bodyB.angle; + } + + var pointAWorld = pointA, + pointBWorld = pointB; + + if (bodyA) pointAWorld = Vector.add(bodyA.position, pointA); + if (bodyB) pointBWorld = Vector.add(bodyB.position, pointB); + + if (!pointAWorld || !pointBWorld) + return; + + var delta = Vector.sub(pointAWorld, pointBWorld), + currentLength = Vector.magnitude(delta); + + // prevent singularity + if (currentLength < Constraint._minLength) { + currentLength = Constraint._minLength; + } + + // solve distance constraint with Gauss-Siedel method + var difference = (currentLength - constraint.length) / currentLength, + stiffness = constraint.stiffness < 1 ? constraint.stiffness * timeScale : constraint.stiffness, + force = Vector.mult(delta, difference * stiffness), + massTotal = (bodyA ? bodyA.inverseMass : 0) + (bodyB ? bodyB.inverseMass : 0), + inertiaTotal = (bodyA ? bodyA.inverseInertia : 0) + (bodyB ? bodyB.inverseInertia : 0), + resistanceTotal = massTotal + inertiaTotal, + torque, + share, + normal, + normalVelocity, + relativeVelocity; + + if (constraint.damping) { + var zero = Vector.create(); + normal = Vector.div(delta, currentLength); + + relativeVelocity = Vector.sub( + bodyB && Vector.sub(bodyB.position, bodyB.positionPrev) || zero, + bodyA && Vector.sub(bodyA.position, bodyA.positionPrev) || zero + ); + + normalVelocity = Vector.dot(normal, relativeVelocity); + } + + if (bodyA && !bodyA.isStatic) { + share = bodyA.inverseMass / massTotal; + + // keep track of applied impulses for post solving + bodyA.constraintImpulse.x -= force.x * share; + bodyA.constraintImpulse.y -= force.y * share; + + // apply forces + bodyA.position.x -= force.x * share; + bodyA.position.y -= force.y * share; + + // apply damping + if (constraint.damping) { + bodyA.positionPrev.x -= constraint.damping * normal.x * normalVelocity * share; + bodyA.positionPrev.y -= constraint.damping * normal.y * normalVelocity * share; + } + + // apply torque + torque = (Vector.cross(pointA, force) / resistanceTotal) * Constraint._torqueDampen * bodyA.inverseInertia * (1 - constraint.angularStiffness); + bodyA.constraintImpulse.angle -= torque; + bodyA.angle -= torque; + } + + if (bodyB && !bodyB.isStatic) { + share = bodyB.inverseMass / massTotal; + + // keep track of applied impulses for post solving + bodyB.constraintImpulse.x += force.x * share; + bodyB.constraintImpulse.y += force.y * share; + + // apply forces + bodyB.position.x += force.x * share; + bodyB.position.y += force.y * share; + + // apply damping + if (constraint.damping) { + bodyB.positionPrev.x += constraint.damping * normal.x * normalVelocity * share; + bodyB.positionPrev.y += constraint.damping * normal.y * normalVelocity * share; + } + + // apply torque + torque = (Vector.cross(pointB, force) / resistanceTotal) * Constraint._torqueDampen * bodyB.inverseInertia * (1 - constraint.angularStiffness); + bodyB.constraintImpulse.angle += torque; + bodyB.angle += torque; + } + + }; + + /** + * Performs body updates required after solving constraints. + * @private + * @method postSolveAll + * @param {body[]} bodies + */ + Constraint.postSolveAll = function(bodies) { + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i], + impulse = body.constraintImpulse; + + if (body.isStatic || (impulse.x === 0 && impulse.y === 0 && impulse.angle === 0)) { + continue; + } + + Sleeping.set(body, false); + + // update geometry and reset + for (var j = 0; j < body.parts.length; j++) { + var part = body.parts[j]; + + Vertices.translate(part.vertices, impulse); + + if (j > 0) { + part.position.x += impulse.x; + part.position.y += impulse.y; + } + + if (impulse.angle !== 0) { + Vertices.rotate(part.vertices, impulse.angle, body.position); + Axes.rotate(part.axes, impulse.angle); + if (j > 0) { + Vector.rotateAbout(part.position, impulse.angle, body.position, part.position); + } + } + + Bounds.update(part.bounds, part.vertices, body.velocity); + } + + // dampen the cached impulse for warming next step + impulse.angle *= Constraint._warming; + impulse.x *= Constraint._warming; + impulse.y *= Constraint._warming; + } + }; + + /* + * + * Properties Documentation + * + */ + + /** + * An integer `Number` uniquely identifying number generated in `Composite.create` by `Common.nextId`. + * + * @property id + * @type number + */ + + /** + * A `String` denoting the type of object. + * + * @property type + * @type string + * @default "constraint" + * @readOnly + */ + + /** + * An arbitrary `String` name to help the user identify and manage bodies. + * + * @property label + * @type string + * @default "Constraint" + */ + + /** + * An `Object` that defines the rendering properties to be consumed by the module `Matter.Render`. + * + * @property render + * @type object + */ + + /** + * A flag that indicates if the constraint should be rendered. + * + * @property render.visible + * @type boolean + * @default true + */ + + /** + * A `Number` that defines the line width to use when rendering the constraint outline. + * A value of `0` means no outline will be rendered. + * + * @property render.lineWidth + * @type number + * @default 2 + */ + + /** + * A `String` that defines the stroke style to use when rendering the constraint outline. + * It is the same as when using a canvas, so it accepts CSS style property values. + * + * @property render.strokeStyle + * @type string + * @default a random colour + */ + + /** + * A `String` that defines the constraint rendering type. + * The possible values are 'line', 'pin', 'spring'. + * An appropriate render type will be automatically chosen unless one is given in options. + * + * @property render.type + * @type string + * @default 'line' + */ + + /** + * A `Boolean` that defines if the constraint's anchor points should be rendered. + * + * @property render.anchors + * @type boolean + * @default true + */ + + /** + * The first possible `Body` that this constraint is attached to. + * + * @property bodyA + * @type body + * @default null + */ + + /** + * The second possible `Body` that this constraint is attached to. + * + * @property bodyB + * @type body + * @default null + */ + + /** + * A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyA` if defined, otherwise a world-space position. + * + * @property pointA + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * A `Vector` that specifies the offset of the constraint from center of the `constraint.bodyB` if defined, otherwise a world-space position. + * + * @property pointB + * @type vector + * @default { x: 0, y: 0 } + */ + + /** + * A `Number` that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. + * A value of `1` means the constraint should be very stiff. + * A value of `0.2` means the constraint acts like a soft spring. + * + * @property stiffness + * @type number + * @default 1 + */ + + /** + * A `Number` that specifies the damping of the constraint, + * i.e. the amount of resistance applied to each body based on their velocities to limit the amount of oscillation. + * Damping will only be apparent when the constraint also has a very low `stiffness`. + * A value of `0.1` means the constraint will apply heavy damping, resulting in little to no oscillation. + * A value of `0` means the constraint will apply no damping. + * + * @property damping + * @type number + * @default 0 + */ + + /** + * A `Number` that specifies the target resting length of the constraint. + * It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB`. + * + * @property length + * @type number + */ + + /** + * An object reserved for storing plugin-specific properties. + * + * @property plugin + * @type {} + */ + +})(); + + +/***/ }), +/* 229 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Actions + */ + +module.exports = { + + Angle: __webpack_require__(499), + Call: __webpack_require__(500), + GetFirst: __webpack_require__(501), + GetLast: __webpack_require__(502), + GridAlign: __webpack_require__(503), + IncAlpha: __webpack_require__(537), + IncX: __webpack_require__(538), + IncXY: __webpack_require__(539), + IncY: __webpack_require__(540), + PlaceOnCircle: __webpack_require__(541), + PlaceOnEllipse: __webpack_require__(542), + PlaceOnLine: __webpack_require__(543), + PlaceOnRectangle: __webpack_require__(544), + PlaceOnTriangle: __webpack_require__(545), + PlayAnimation: __webpack_require__(546), + PropertyValueInc: __webpack_require__(34), + PropertyValueSet: __webpack_require__(27), + RandomCircle: __webpack_require__(547), + RandomEllipse: __webpack_require__(548), + RandomLine: __webpack_require__(549), + RandomRectangle: __webpack_require__(550), + RandomTriangle: __webpack_require__(551), + Rotate: __webpack_require__(552), + RotateAround: __webpack_require__(553), + RotateAroundDistance: __webpack_require__(554), + ScaleX: __webpack_require__(555), + ScaleXY: __webpack_require__(556), + ScaleY: __webpack_require__(557), + SetAlpha: __webpack_require__(558), + SetBlendMode: __webpack_require__(559), + SetDepth: __webpack_require__(560), + SetHitArea: __webpack_require__(561), + SetOrigin: __webpack_require__(562), + SetRotation: __webpack_require__(563), + SetScale: __webpack_require__(564), + SetScaleX: __webpack_require__(565), + SetScaleY: __webpack_require__(566), + SetTint: __webpack_require__(567), + SetVisible: __webpack_require__(568), + SetX: __webpack_require__(569), + SetXY: __webpack_require__(570), + SetY: __webpack_require__(571), + ShiftPosition: __webpack_require__(572), + Shuffle: __webpack_require__(573), + SmootherStep: __webpack_require__(574), + SmoothStep: __webpack_require__(575), + Spread: __webpack_require__(576), + ToggleVisible: __webpack_require__(577), + WrapInRectangle: __webpack_require__(578) + +}; + + +/***/ }), +/* 230 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ALIGN_CONST = __webpack_require__(143); + +var AlignInMap = []; + +AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(231); +AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(232); +AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(233); +AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(234); +AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(236); +AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(237); +AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(238); +AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(239); +AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(240); + +/** + * Takes given Game Object and aligns it so that it is positioned relative to the other. + * The alignment used is based on the `position` argument, which is an `ALIGN_CONST` value, such as `LEFT_CENTER` or `TOP_RIGHT`. + * + * @function Phaser.Display.Align.In.QuickSet + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [child,$return] + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. + * @param {integer} position - The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var QuickSet = function (child, alignIn, position, offsetX, offsetY) +{ + return AlignInMap[position](child, alignIn, offsetX, offsetY); +}; + +module.exports = QuickSet; + + +/***/ }), +/* 231 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetBottom = __webpack_require__(38); +var GetCenterX = __webpack_require__(73); +var SetBottom = __webpack_require__(39); +var SetCenterX = __webpack_require__(74); + +/** + * Takes given Game Object and aligns it so that it is positioned in the bottom center of the other. + * + * @function Phaser.Display.Align.In.BottomCenter + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var BottomCenter = function (gameObject, alignIn, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetCenterX(gameObject, GetCenterX(alignIn) + offsetX); + SetBottom(gameObject, GetBottom(alignIn) + offsetY); + + return gameObject; +}; + +module.exports = BottomCenter; + + +/***/ }), +/* 232 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetBottom = __webpack_require__(38); +var GetLeft = __webpack_require__(40); +var SetBottom = __webpack_require__(39); +var SetLeft = __webpack_require__(41); + +/** + * Takes given Game Object and aligns it so that it is positioned in the bottom left of the other. + * + * @function Phaser.Display.Align.In.BottomLeft + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var BottomLeft = function (gameObject, alignIn, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetLeft(gameObject, GetLeft(alignIn) - offsetX); + SetBottom(gameObject, GetBottom(alignIn) + offsetY); + + return gameObject; +}; + +module.exports = BottomLeft; + + +/***/ }), +/* 233 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetBottom = __webpack_require__(38); +var GetRight = __webpack_require__(42); +var SetBottom = __webpack_require__(39); +var SetRight = __webpack_require__(43); + +/** + * Takes given Game Object and aligns it so that it is positioned in the bottom right of the other. + * + * @function Phaser.Display.Align.In.BottomRight + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var BottomRight = function (gameObject, alignIn, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetRight(gameObject, GetRight(alignIn) + offsetX); + SetBottom(gameObject, GetBottom(alignIn) + offsetY); + + return gameObject; +}; + +module.exports = BottomRight; + + +/***/ }), +/* 234 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CenterOn = __webpack_require__(235); +var GetCenterX = __webpack_require__(73); +var GetCenterY = __webpack_require__(76); + +/** + * Takes given Game Object and aligns it so that it is positioned in the center of the other. + * + * @function Phaser.Display.Align.In.Center + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var Center = function (gameObject, alignIn, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + CenterOn(gameObject, GetCenterX(alignIn) + offsetX, GetCenterY(alignIn) + offsetY); + + return gameObject; +}; + +module.exports = Center; + + +/***/ }), +/* 235 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SetCenterX = __webpack_require__(74); +var SetCenterY = __webpack_require__(75); + +/** + * Positions the Game Object so that it is centered on the given coordinates. + * + * @function Phaser.Display.Bounds.CenterOn + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be re-positioned. + * @param {number} x - The horizontal coordinate to position the Game Object on. + * @param {number} y - The vertical coordinate to position the Game Object on. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was positioned. + */ +var CenterOn = function (gameObject, x, y) +{ + SetCenterX(gameObject, x); + + return SetCenterY(gameObject, y); +}; + +module.exports = CenterOn; + + +/***/ }), +/* 236 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetCenterY = __webpack_require__(76); +var GetLeft = __webpack_require__(40); +var SetCenterY = __webpack_require__(75); +var SetLeft = __webpack_require__(41); + +/** + * Takes given Game Object and aligns it so that it is positioned in the left center of the other. + * + * @function Phaser.Display.Align.In.LeftCenter + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var LeftCenter = function (gameObject, alignIn, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetLeft(gameObject, GetLeft(alignIn) - offsetX); + SetCenterY(gameObject, GetCenterY(alignIn) + offsetY); + + return gameObject; +}; + +module.exports = LeftCenter; + + +/***/ }), +/* 237 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetCenterY = __webpack_require__(76); +var GetRight = __webpack_require__(42); +var SetCenterY = __webpack_require__(75); +var SetRight = __webpack_require__(43); + +/** + * Takes given Game Object and aligns it so that it is positioned in the right center of the other. + * + * @function Phaser.Display.Align.In.RightCenter + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var RightCenter = function (gameObject, alignIn, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetRight(gameObject, GetRight(alignIn) + offsetX); + SetCenterY(gameObject, GetCenterY(alignIn) + offsetY); + + return gameObject; +}; + +module.exports = RightCenter; + + +/***/ }), +/* 238 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetCenterX = __webpack_require__(73); +var GetTop = __webpack_require__(44); +var SetCenterX = __webpack_require__(74); +var SetTop = __webpack_require__(45); + +/** + * Takes given Game Object and aligns it so that it is positioned in the top center of the other. + * + * @function Phaser.Display.Align.In.TopCenter + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var TopCenter = function (gameObject, alignIn, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetCenterX(gameObject, GetCenterX(alignIn) + offsetX); + SetTop(gameObject, GetTop(alignIn) - offsetY); + + return gameObject; +}; + +module.exports = TopCenter; + + +/***/ }), +/* 239 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetLeft = __webpack_require__(40); +var GetTop = __webpack_require__(44); +var SetLeft = __webpack_require__(41); +var SetTop = __webpack_require__(45); + +/** + * Takes given Game Object and aligns it so that it is positioned in the top left of the other. + * + * @function Phaser.Display.Align.In.TopLeft + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var TopLeft = function (gameObject, alignIn, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetLeft(gameObject, GetLeft(alignIn) - offsetX); + SetTop(gameObject, GetTop(alignIn) - offsetY); + + return gameObject; +}; + +module.exports = TopLeft; + + +/***/ }), +/* 240 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(44); +var SetRight = __webpack_require__(43); +var SetTop = __webpack_require__(45); + +/** + * Takes given Game Object and aligns it so that it is positioned in the top right of the other. + * + * @function Phaser.Display.Align.In.TopRight + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var TopRight = function (gameObject, alignIn, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetRight(gameObject, GetRight(alignIn) + offsetX); + SetTop(gameObject, GetTop(alignIn) - offsetY); + + return gameObject; +}; + +module.exports = TopRight; + + +/***/ }), +/* 241 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CircumferencePoint = __webpack_require__(144); +var FromPercent = __webpack_require__(86); +var MATH_CONST = __webpack_require__(23); +var Point = __webpack_require__(3); + +/** + * Returns a Point object containing the coordinates of a point on the circumference of the Circle + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * + * @function Phaser.Geom.Circle.GetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Circle} circle - The Circle to get the circumference point on. + * @param {number} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle. + * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created. + * + * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the circle. + */ +var GetPoint = function (circle, position, out) +{ + if (out === undefined) { out = new Point(); } + + var angle = FromPercent(position, 0, MATH_CONST.PI2); + + return CircumferencePoint(circle, angle, out); +}; + +module.exports = GetPoint; + + +/***/ }), +/* 242 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Circumference = __webpack_require__(243); +var CircumferencePoint = __webpack_require__(144); +var FromPercent = __webpack_require__(86); +var MATH_CONST = __webpack_require__(23); + +/** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle, + * based on the given quantity or stepRate values. + * + * @function Phaser.Geom.Circle.GetPoints + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The Circle to get the points from. + * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. + * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. + * + * @return {Phaser.Geom.Point[]} An array of Point objects pertaining to the points around the circumference of the circle. + */ +var GetPoints = function (circle, quantity, stepRate, out) +{ + if (out === undefined) { out = []; } + + // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. + if (!quantity) + { + quantity = Circumference(circle) / stepRate; + } + + for (var i = 0; i < quantity; i++) + { + var angle = FromPercent(i / quantity, 0, MATH_CONST.PI2); + + out.push(CircumferencePoint(circle, angle)); + } + + return out; +}; + +module.exports = GetPoints; + + +/***/ }), +/* 243 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the circumference of the given Circle. + * + * @function Phaser.Geom.Circle.Circumference + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The Circle to get the circumference of. + * + * @return {number} The circumference of the Circle. + */ +var Circumference = function (circle) +{ + return 2 * (Math.PI * circle.radius); +}; + +module.exports = Circumference; + + +/***/ }), +/* 244 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); + +// bitmask flag for GameObject.renderMask +var _FLAG = 2; // 0010 + +/** + * Provides methods used for setting the alpha properties of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Alpha + * @since 3.0.0 + */ + +var Alpha = { + + /** + * Private internal value. Holds the global alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alpha + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alpha: 1, + + /** + * Private internal value. Holds the top-left alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaTL + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaTL: 1, + + /** + * Private internal value. Holds the top-right alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaTR + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaTR: 1, + + /** + * Private internal value. Holds the bottom-left alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaBL + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaBL: 1, + + /** + * Private internal value. Holds the bottom-right alpha value. + * + * @name Phaser.GameObjects.Components.Alpha#_alphaBR + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _alphaBR: 1, + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + * + * @method Phaser.GameObjects.Components.Alpha#clearAlpha + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearAlpha: function () + { + return this.setAlpha(1); + }, + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * + * @method Phaser.GameObjects.Components.Alpha#setAlpha + * @since 3.0.0 + * + * @param {number} [topLeft=1] - The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. + * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only. + * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only. + * + * @return {this} This Game Object instance. + */ + setAlpha: function (topLeft, topRight, bottomLeft, bottomRight) + { + if (topLeft === undefined) { topLeft = 1; } + + // Treat as if there is only one alpha value for the whole Game Object + if (topRight === undefined) + { + this.alpha = topLeft; + } + else + { + this._alphaTL = Clamp(topLeft, 0, 1); + this._alphaTR = Clamp(topRight, 0, 1); + this._alphaBL = Clamp(bottomLeft, 0, 1); + this._alphaBR = Clamp(bottomRight, 0, 1); + } + + return this; + }, + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + * + * @name Phaser.GameObjects.Components.Alpha#alpha + * @type {number} + * @since 3.0.0 + */ + alpha: { + + get: function () + { + return this._alpha; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alpha = v; + this._alphaTL = v; + this._alphaTR = v; + this._alphaBL = v; + this._alphaBR = v; + + if (v === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaTopLeft: { + + get: function () + { + return this._alphaTL; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaTL = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaTopRight + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaTopRight: { + + get: function () + { + return this._alphaTR; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaTR = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaBottomLeft: { + + get: function () + { + return this._alphaBL; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaBL = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight + * @type {number} + * @webglOnly + * @since 3.0.0 + */ + alphaBottomRight: { + + get: function () + { + return this._alphaBR; + }, + + set: function (value) + { + var v = Clamp(value, 0, 1); + + this._alphaBR = v; + + if (v !== 0) + { + this.renderFlags |= _FLAG; + } + } + + } + +}; + +module.exports = Alpha; + + +/***/ }), +/* 245 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Searches a pre-sorted array for the closet value to the given number. + * + * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, + * and will check for the closest value of those to the given number. + * + * @function Phaser.Utils.Array.FindClosestInSorted + * @since 3.0.0 + * + * @param {number} value - The value to search for in the array. + * @param {array} array - The array to search, which must be sorted. + * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * + * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + */ +var FindClosestInSorted = function (value, array, key) +{ + if (!array.length) + { + return NaN; + } + else if (array.length === 1) + { + return array[0]; + } + + var i = 1; + var low; + var high; + + if (key) + { + if (value < array[0][key]) + { + return array[0]; + } + + while (array[i][key] < value) + { + i++; + } + } + else + { + while (array[i] < value) + { + i++; + } + } + + if (i > array.length) + { + i = array.length; + } + + if (key) + { + low = array[i - 1][key]; + high = array[i][key]; + + return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; + } + else + { + low = array[i - 1]; + high = array[i]; + + return ((high - value) <= (value - low)) ? high : low; + } +}; + +module.exports = FindClosestInSorted; + + +/***/ }), +/* 246 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A single frame in an Animation sequence. + * + * An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other + * frames in the animation, and index data. It also has the ability to modify the animation timing. + * + * AnimationFrames are generated automatically by the Animation class. + * + * @class AnimationFrame + * @memberof Phaser.Animations + * @constructor + * @since 3.0.0 + * + * @param {string} textureKey - The key of the Texture this AnimationFrame uses. + * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. + * @param {integer} index - The index of this AnimationFrame within the Animation sequence. + * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering. + */ +var AnimationFrame = new Class({ + + initialize: + + function AnimationFrame (textureKey, textureFrame, index, frame) + { + /** + * The key of the Texture this AnimationFrame uses. + * + * @name Phaser.Animations.AnimationFrame#textureKey + * @type {string} + * @since 3.0.0 + */ + this.textureKey = textureKey; + + /** + * The key of the Frame within the Texture that this AnimationFrame uses. + * + * @name Phaser.Animations.AnimationFrame#textureFrame + * @type {(string|integer)} + * @since 3.0.0 + */ + this.textureFrame = textureFrame; + + /** + * The index of this AnimationFrame within the Animation sequence. + * + * @name Phaser.Animations.AnimationFrame#index + * @type {integer} + * @since 3.0.0 + */ + this.index = index; + + /** + * A reference to the Texture Frame this AnimationFrame uses for rendering. + * + * @name Phaser.Animations.AnimationFrame#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + this.frame = frame; + + /** + * Is this the first frame in an animation sequence? + * + * @name Phaser.Animations.AnimationFrame#isFirst + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ + this.isFirst = false; + + /** + * Is this the last frame in an animation sequence? + * + * @name Phaser.Animations.AnimationFrame#isLast + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ + this.isLast = false; + + /** + * A reference to the AnimationFrame that comes before this one in the animation, if any. + * + * @name Phaser.Animations.AnimationFrame#prevFrame + * @type {?Phaser.Animations.AnimationFrame} + * @default null + * @readonly + * @since 3.0.0 + */ + this.prevFrame = null; + + /** + * A reference to the AnimationFrame that comes after this one in the animation, if any. + * + * @name Phaser.Animations.AnimationFrame#nextFrame + * @type {?Phaser.Animations.AnimationFrame} + * @default null + * @readonly + * @since 3.0.0 + */ + this.nextFrame = null; + + /** + * Additional time (in ms) that this frame should appear for during playback. + * The value is added onto the msPerFrame set by the animation. + * + * @name Phaser.Animations.AnimationFrame#duration + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.duration = 0; + + /** + * What % through the animation does this frame come? + * This value is generated when the animation is created and cached here. + * + * @name Phaser.Animations.AnimationFrame#progress + * @type {number} + * @default 0 + * @readonly + * @since 3.0.0 + */ + this.progress = 0; + }, + + /** + * Generates a JavaScript object suitable for converting to JSON. + * + * @method Phaser.Animations.AnimationFrame#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Animations.JSONAnimationFrame} The AnimationFrame data. + */ + toJSON: function () + { + return { + key: this.textureKey, + frame: this.textureFrame, + duration: this.duration + }; + }, + + /** + * Destroys this object by removing references to external resources and callbacks. + * + * @method Phaser.Animations.AnimationFrame#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.frame = undefined; + } + +}); + +module.exports = AnimationFrame; + + +/***/ }), +/* 247 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(52); + +/** + * Provides methods used for setting the blend mode of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.BlendMode + * @since 3.0.0 + */ + +var BlendMode = { + + /** + * Private internal value. Holds the current blend mode. + * + * @name Phaser.GameObjects.Components.BlendMode#_blendMode + * @type {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + _blendMode: BlendModes.NORMAL, + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + * + * @name Phaser.GameObjects.Components.BlendMode#blendMode + * @type {(Phaser.BlendModes|string)} + * @since 3.0.0 + */ + blendMode: { + + get: function () + { + return this._blendMode; + }, + + set: function (value) + { + if (typeof value === 'string') + { + value = BlendModes[value]; + } + + value |= 0; + + if (value >= -1) + { + this._blendMode = value; + } + } + + }, + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * + * @method Phaser.GameObjects.Components.BlendMode#setBlendMode + * @since 3.0.0 + * + * @param {(string|Phaser.BlendModes)} value - The BlendMode value. Either a string or a CONST. + * + * @return {this} This Game Object instance. + */ + setBlendMode: function (value) + { + this.blendMode = value; + + return this; + } + +}; + +module.exports = BlendMode; + + +/***/ }), +/* 248 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the depth of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Depth + * @since 3.0.0 + */ + +var Depth = { + + /** + * Private internal value. Holds the depth of the Game Object. + * + * @name Phaser.GameObjects.Components.Depth#_depth + * @type {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @name Phaser.GameObjects.Components.Depth#depth + * @type {number} + * @since 3.0.0 + */ + depth: { + + get: function () + { + return this._depth; + }, + + set: function (value) + { + this.scene.sys.queueDepthSort(); + this._depth = value; + } + + }, + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The depth starts from zero (the default value) and increases from that point. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @method Phaser.GameObjects.Components.Depth#setDepth + * @since 3.0.0 + * + * @param {integer} value - The depth of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetPoint = __webpack_require__(147); +var Perimeter = __webpack_require__(108); + +// Return an array of points from the perimeter of the rectangle +// each spaced out based on the quantity or step required + +/** + * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required. + * + * @function Phaser.Geom.Rectangle.GetPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. + * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsy. Ignored if quantity is positive. + * @param {integer} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsy, step param will be used to calculate the number of points. + * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. + * + * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. + */ +var GetPoints = function (rectangle, quantity, stepRate, out) +{ + if (out === undefined) { out = []; } + + // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. + if (!quantity) + { + quantity = Perimeter(rectangle) / stepRate; + } + + for (var i = 0; i < quantity; i++) + { + var position = i / quantity; + + out.push(GetPoint(rectangle, position)); + } + + return out; +}; + +module.exports = GetPoints; + + +/***/ }), +/* 250 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Get a point on a line that's a given percentage along its length. + * + * @function Phaser.Geom.Line.GetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Line} line - The line. + * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line. + * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the point on the line. + * + * @return {(Phaser.Geom.Point|object)} The point on the line. + */ +var GetPoint = function (line, position, out) +{ + if (out === undefined) { out = new Point(); } + + out.x = line.x1 + (line.x2 - line.x1) * position; + out.y = line.y1 + (line.y2 - line.y1) * position; + + return out; +}; + +module.exports = GetPoint; + + +/***/ }), +/* 251 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` by the given `angle`. + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} x - The horizontal coordinate to rotate around. + * @param {number} y - The vertical coordinate to rotate around. + * @param {number} angle - The angle of rotation in radians. + * + * @return {Phaser.Geom.Point} The given point, rotated by the given angle around the given coordinates. + */ +var RotateAround = function (point, x, y, angle) +{ + var c = Math.cos(angle); + var s = Math.sin(angle); + + var tx = point.x - x; + var ty = point.y - y; + + point.x = tx * c - ty * s + x; + point.y = tx * s + ty * c + y; + + return point; +}; + +module.exports = RotateAround; + + +/***/ }), +/* 252 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BitmapMask = __webpack_require__(253); +var GeometryMask = __webpack_require__(254); + +/** + * Provides methods used for getting and setting the mask of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Mask + * @since 3.0.0 + */ + +var Mask = { + + /** + * The Mask this Game Object is using during render. + * + * @name Phaser.GameObjects.Components.Mask#mask + * @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} + * @since 3.0.0 + */ + mask: null, + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * + * @method Phaser.GameObjects.Components.Mask#setMask + * @since 3.6.2 + * + * @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering. + * + * @return {this} This Game Object instance. + */ + setMask: function (mask) + { + this.mask = mask; + + return this; + }, + + /** + * Clears the mask that this Game Object was using. + * + * @method Phaser.GameObjects.Components.Mask#clearMask + * @since 3.6.2 + * + * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it? + * + * @return {this} This Game Object instance. + */ + clearMask: function (destroyMask) + { + if (destroyMask === undefined) { destroyMask = false; } + + if (destroyMask && this.mask) + { + this.mask.destroy(); + } + + this.mask = null; + + return this; + }, + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * + * @method Phaser.GameObjects.Components.Mask#createBitmapMask + * @since 3.6.2 + * + * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite. + * + * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. + */ + createBitmapMask: function (renderable) + { + if (renderable === undefined && (this.texture || this.shader)) + { + // eslint-disable-next-line consistent-this + renderable = this; + } + + return new BitmapMask(this.scene, renderable); + }, + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * + * @method Phaser.GameObjects.Components.Mask#createGeometryMask + * @since 3.6.2 + * + * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. + * + * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. + */ + createGeometryMask: function (graphics) + { + if (graphics === undefined && this.type === 'Graphics') + { + // eslint-disable-next-line consistent-this + graphics = this; + } + + return new GeometryMask(this.scene, graphics); + } + +}; + +module.exports = Mask; + + +/***/ }), +/* 253 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. + * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask, + * not a clipping path. It is only available when using the WebGL Renderer. + * + * A Bitmap Mask can use any Game Object to determine the alpha of each pixel of the masked Game Object(s). + * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha + * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the + * Bitmap Mask doesn't matter. + * + * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an + * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means + * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects + * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the + * corresponding pixel in the mask. + * + * The Bitmap Mask's location matches the location of its Game Object, not the location of the + * masked objects. Moving or transforming the underlying Game Object will change the mask + * (and affect the visibility of any masked objects), whereas moving or transforming a masked object + * will not affect the mask. + * + * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a + * Scene's display list, it will only be used for the mask and its full texture will not be directly + * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will + * render as a normal Game Object and will also serve as a mask. + * + * @class BitmapMask + * @memberof Phaser.Display.Masks + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene which this Bitmap Mask will be used in. + * @param {Phaser.GameObjects.GameObject} renderable - A renderable Game Object that uses a texture, such as a Sprite. + */ +var BitmapMask = new Class({ + + initialize: + + function BitmapMask (scene, renderable) + { + var renderer = scene.sys.game.renderer; + + /** + * A reference to either the Canvas or WebGL Renderer that this Mask is using. + * + * @name Phaser.Display.Masks.BitmapMask#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.11.0 + */ + this.renderer = renderer; + + /** + * A renderable Game Object that uses a texture, such as a Sprite. + * + * @name Phaser.Display.Masks.BitmapMask#bitmapMask + * @type {Phaser.GameObjects.GameObject} + * @since 3.0.0 + */ + this.bitmapMask = renderable; + + /** + * The texture used for the mask's framebuffer. + * + * @name Phaser.Display.Masks.BitmapMask#maskTexture + * @type {WebGLTexture} + * @default null + * @since 3.0.0 + */ + this.maskTexture = null; + + /** + * The texture used for the main framebuffer. + * + * @name Phaser.Display.Masks.BitmapMask#mainTexture + * @type {WebGLTexture} + * @default null + * @since 3.0.0 + */ + this.mainTexture = null; + + /** + * Whether the Bitmap Mask is dirty and needs to be updated. + * + * @name Phaser.Display.Masks.BitmapMask#dirty + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.dirty = true; + + /** + * The framebuffer to which a masked Game Object is rendered. + * + * @name Phaser.Display.Masks.BitmapMask#mainFramebuffer + * @type {WebGLFramebuffer} + * @since 3.0.0 + */ + this.mainFramebuffer = null; + + /** + * The framebuffer to which the Bitmap Mask's masking Game Object is rendered. + * + * @name Phaser.Display.Masks.BitmapMask#maskFramebuffer + * @type {WebGLFramebuffer} + * @since 3.0.0 + */ + this.maskFramebuffer = null; + + /** + * The previous framebuffer set in the renderer before this one was enabled. + * + * @name Phaser.Display.Masks.BitmapMask#prevFramebuffer + * @type {WebGLFramebuffer} + * @since 3.17.0 + */ + this.prevFramebuffer = null; + + /** + * Whether to invert the masks alpha. + * + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * + * @name Phaser.Display.Masks.BitmapMask#invertAlpha + * @type {boolean} + * @since 3.1.2 + */ + this.invertAlpha = false; + + /** + * Is this mask a stencil mask? + * + * @name Phaser.Display.Masks.BitmapMask#isStencil + * @type {boolean} + * @readonly + * @since 3.17.0 + */ + this.isStencil = false; + + if (renderer && renderer.gl) + { + var width = renderer.width; + var height = renderer.height; + var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); + var gl = renderer.gl; + var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; + var filter = gl.LINEAR; + + this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); + this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); + + renderer.onContextRestored(function (renderer) + { + var width = renderer.width; + var height = renderer.height; + var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); + var gl = renderer.gl; + var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; + var filter = gl.LINEAR; + + this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); + this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); + + }, this); + } + }, + + /** + * Sets a new masking Game Object for the Bitmap Mask. + * + * @method Phaser.Display.Masks.BitmapMask#setBitmap + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} renderable - A renderable Game Object that uses a texture, such as a Sprite. + */ + setBitmap: function (renderable) + { + this.bitmapMask = renderable; + }, + + /** + * Prepares the WebGL Renderer to render a Game Object with this mask applied. + * + * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame. + * + * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to prepare. + * @param {Phaser.GameObjects.GameObject} maskedObject - The masked Game Object which will be drawn. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + */ + preRenderWebGL: function (renderer, maskedObject, camera) + { + renderer.pipelines.BitmapMaskPipeline.beginMask(this, maskedObject, camera); + }, + + /** + * Finalizes rendering of a masked Game Object. + * + * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect. + * + * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to clean up. + */ + postRenderWebGL: function (renderer, camera) + { + renderer.pipelines.BitmapMaskPipeline.endMask(this, camera); + }, + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * + * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + * @param {Phaser.GameObjects.GameObject} mask - The masked Game Object which would be rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to. + */ + preRenderCanvas: function () + { + // NOOP + }, + + /** + * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer. + * + * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to. + */ + postRenderCanvas: function () + { + // NOOP + }, + + /** + * Destroys this BitmapMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * + * @method Phaser.Display.Masks.BitmapMask#destroy + * @since 3.7.0 + */ + destroy: function () + { + this.bitmapMask = null; + + var renderer = this.renderer; + + if (renderer && renderer.gl) + { + renderer.deleteTexture(this.mainTexture); + renderer.deleteTexture(this.maskTexture); + renderer.deleteFramebuffer(this.mainFramebuffer); + renderer.deleteFramebuffer(this.maskFramebuffer); + } + + this.mainTexture = null; + this.maskTexture = null; + this.mainFramebuffer = null; + this.maskFramebuffer = null; + this.prevFramebuffer = null; + this.renderer = null; + } + +}); + +module.exports = BitmapMask; + + +/***/ }), +/* 254 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect + * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only + * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). + * + * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) + * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed + * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and + * alpha of the pixel from the Geometry Mask do not matter. + * + * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. + * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility + * of any masked objects), whereas moving or transforming a masked object will not affect the mask. + * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed + * in front of all masked objects which has its own visual properties and, naturally, respects the camera's + * visual properties, but isn't affected by and doesn't follow the masked objects by itself. + * + * @class GeometryMask + * @memberof Phaser.Display.Masks + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - This parameter is not used. + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. + */ +var GeometryMask = new Class({ + + initialize: + + function GeometryMask (scene, graphicsGeometry) + { + /** + * The Graphics object which describes the Geometry Mask. + * + * @name Phaser.Display.Masks.GeometryMask#geometryMask + * @type {Phaser.GameObjects.Graphics} + * @since 3.0.0 + */ + this.geometryMask = graphicsGeometry; + + /** + * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels + * drawn to the Geometry Mask. + * + * @name Phaser.Display.Masks.GeometryMask#invertAlpha + * @type {boolean} + * @since 3.16.0 + */ + this.invertAlpha = false; + + /** + * Is this mask a stencil mask? + * + * @name Phaser.Display.Masks.GeometryMask#isStencil + * @type {boolean} + * @readonly + * @since 3.17.0 + */ + this.isStencil = true; + + /** + * The current stencil level. + * + * @name Phaser.Display.Masks.GeometryMask#level + * @type {boolean} + * @private + * @since 3.17.0 + */ + this.level = 0; + }, + + /** + * Sets a new Graphics object for the Geometry Mask. + * + * @method Phaser.Display.Masks.GeometryMask#setShape + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. + * + * @return {this} This Geometry Mask + */ + setShape: function (graphicsGeometry) + { + this.geometryMask = graphicsGeometry; + + return this; + }, + + /** + * Sets the `invertAlpha` property of this Geometry Mask. + * Inverting the alpha essentially flips the way the mask works. + * + * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha + * @since 3.17.0 + * + * @param {boolean} [value=true] - Invert the alpha of this mask? + * + * @return {this} This Geometry Mask + */ + setInvertAlpha: function (value) + { + if (value === undefined) { value = true; } + + this.invertAlpha = value; + + return this; + }, + + /** + * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask. + * + * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.GameObjects.GameObject} child - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + */ + preRenderWebGL: function (renderer, child, camera) + { + var gl = renderer.gl; + + // Force flushing before drawing to stencil buffer + renderer.flush(); + + if (renderer.maskStack.length === 0) + { + gl.enable(gl.STENCIL_TEST); + gl.clear(gl.STENCIL_BUFFER_BIT); + + renderer.maskCount = 0; + } + + if (renderer.currentCameraMask.mask !== this) + { + renderer.currentMask.mask = this; + } + + renderer.maskStack.push({ mask: this, camera: camera }); + + this.applyStencil(renderer, camera, true); + + renderer.maskCount++; + }, + + /** + * Applies the current stencil mask to the renderer. + * + * @method Phaser.Display.Masks.GeometryMask#applyStencil + * @since 3.17.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + * @param {boolean} inc - Is this an INCR stencil or a DECR stencil? + */ + applyStencil: function (renderer, camera, inc) + { + var gl = renderer.gl; + var geometryMask = this.geometryMask; + var level = renderer.maskCount; + + gl.colorMask(false, false, false, false); + + if (inc) + { + gl.stencilFunc(gl.EQUAL, level, 0xFF); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); + } + else + { + gl.stencilFunc(gl.EQUAL, level + 1, 0xFF); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR); + } + + // Write stencil buffer + geometryMask.renderWebGL(renderer, geometryMask, 0, camera); + + renderer.flush(); + + gl.colorMask(true, true, true, true); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + + if (inc) + { + if (this.invertAlpha) + { + gl.stencilFunc(gl.NOTEQUAL, level + 1, 0xFF); + } + else + { + gl.stencilFunc(gl.EQUAL, level + 1, 0xFF); + } + } + else if (this.invertAlpha) + { + gl.stencilFunc(gl.NOTEQUAL, level, 0xFF); + } + else + { + gl.stencilFunc(gl.EQUAL, level, 0xFF); + } + }, + + /** + * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it. + * + * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush. + */ + postRenderWebGL: function (renderer) + { + var gl = renderer.gl; + + renderer.maskStack.pop(); + + renderer.maskCount--; + + if (renderer.maskStack.length === 0) + { + // If this is the only mask in the stack, flush and disable + renderer.flush(); + + renderer.currentMask.mask = null; + + gl.disable(gl.STENCIL_TEST); + } + else + { + // Force flush before disabling stencil test + renderer.flush(); + + var prev = renderer.maskStack[renderer.maskStack.length - 1]; + + prev.mask.applyStencil(renderer, prev.camera, false); + + if (renderer.currentCameraMask.mask !== prev.mask) + { + renderer.currentMask.mask = prev.mask; + renderer.currentMask.camera = prev.camera; + } + else + { + renderer.currentMask.mask = null; + } + } + }, + + /** + * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object. + * + * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas + * @since 3.0.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on. + * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through. + */ + preRenderCanvas: function (renderer, mask, camera) + { + var geometryMask = this.geometryMask; + + renderer.currentContext.save(); + + geometryMask.renderCanvas(renderer, geometryMask, 0, camera, null, null, true); + + renderer.currentContext.clip(); + }, + + /** + * Restore the canvas context's previous clipping path, thus turning off the mask for it. + * + * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas + * @since 3.0.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored. + */ + postRenderCanvas: function (renderer) + { + renderer.currentContext.restore(); + }, + + /** + * Destroys this GeometryMask and nulls any references it holds. + * + * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, + * so be sure to call `clearMask` on any Game Object using it, before destroying it. + * + * @method Phaser.Display.Masks.GeometryMask#destroy + * @since 3.7.0 + */ + destroy: function () + { + this.geometryMask = null; + } + +}); + +module.exports = GeometryMask; + + +/***/ }), +/* 255 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the Scroll Factor of a Game Object. + * + * @namespace Phaser.GameObjects.Components.ScrollFactor + * @since 3.0.0 + */ + +var ScrollFactor = { + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorX: 1, + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorY: 1, + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor + * @since 3.0.0 + * + * @param {number} x - The horizontal scroll factor of this Game Object. + * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScrollFactor: function (x, y) + { + if (y === undefined) { y = x; } + + this.scrollFactorX = x; + this.scrollFactorY = y; + + return this; + } + +}; + +module.exports = ScrollFactor; + + +/***/ }), +/* 256 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Build a JSON representation of the given Game Object. + * + * This is typically extended further by Game Object specific implementations. + * + * @method Phaser.GameObjects.Components.ToJSON + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ +var ToJSON = function (gameObject) +{ + var out = { + name: gameObject.name, + type: gameObject.type, + x: gameObject.x, + y: gameObject.y, + depth: gameObject.depth, + scale: { + x: gameObject.scaleX, + y: gameObject.scaleY + }, + origin: { + x: gameObject.originX, + y: gameObject.originY + }, + flipX: gameObject.flipX, + flipY: gameObject.flipY, + rotation: gameObject.rotation, + alpha: gameObject.alpha, + visible: gameObject.visible, + scaleMode: gameObject.scaleMode, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), +/* 257 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(23); +var TransformMatrix = __webpack_require__(32); +var WrapAngle = __webpack_require__(223); +var WrapAngleDegrees = __webpack_require__(224); + +// global bitmask flag for GameObject.renderMask (used by Scale) +var _FLAG = 4; // 0100 + +/** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Transform + * @since 3.0.0 + */ + +var Transform = { + + /** + * Private internal value. Holds the horizontal scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleX + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleX: 1, + + /** + * Private internal value. Holds the vertical scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleY + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleY: 1, + + /** + * Private internal value. Holds the rotation value in radians. + * + * @name Phaser.GameObjects.Components.Transform#_rotation + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _rotation: 0, + + /** + * The x position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: 0, + + /** + * The y position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: 0, + + /** + * The z position of this Game Object. + * Note: Do not use this value to set the z-index, instead see the `depth` property. + * + * @name Phaser.GameObjects.Components.Transform#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: 0, + + /** + * The w position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: 0, + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + * + * @name Phaser.GameObjects.Components.Transform#scale + * @type {number} + * @default 1 + * @since 3.18.0 + */ + scale: { + + get: function () + { + return (this._scaleX + this._scaleY) / 2; + }, + + set: function (value) + { + this._scaleX = value; + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The horizontal scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The vertical scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The angle of this Game Object as expressed in degrees. + * + * Where 0 is to the right, 90 is down, 180 is left. + * + * If you prefer to work in radians, see the `rotation` property instead. + * + * @name Phaser.GameObjects.Components.Transform#angle + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + angle: { + + get: function () + { + return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); + }, + + set: function (value) + { + // value is in degrees + this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; + } + }, + + /** + * The angle of this Game Object in radians. + * + * If you prefer to work in degrees, see the `angle` property instead. + * + * @name Phaser.GameObjects.Components.Transform#rotation + * @type {number} + * @default 1 + * @since 3.0.0 + */ + rotation: { + + get: function () + { + return this._rotation; + }, + + set: function (value) + { + // value is in radians + this._rotation = WrapAngle(value); + } + }, + + /** + * Sets the position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setPosition + * @since 3.0.0 + * + * @param {number} [x=0] - The x position of this Game Object. + * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. + * @param {number} [z=0] - The z position of this Game Object. + * @param {number} [w=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setPosition: function (x, y, z, w) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + if (z === undefined) { z = 0; } + if (w === undefined) { w = 0; } + + this.x = x; + this.y = y; + this.z = z; + this.w = w; + + return this; + }, + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * + * @method Phaser.GameObjects.Components.Transform#setRandomPosition + * @since 3.8.0 + * + * @param {number} [x=0] - The x position of the top-left of the random area. + * @param {number} [y=0] - The y position of the top-left of the random area. + * @param {number} [width] - The width of the random area. + * @param {number} [height] - The height of the random area. + * + * @return {this} This Game Object instance. + */ + setRandomPosition: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.scene.sys.scale.width; } + if (height === undefined) { height = this.scene.sys.scale.height; } + + this.x = x + (Math.random() * width); + this.y = y + (Math.random() * height); + + return this; + }, + + /** + * Sets the rotation of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setRotation + * @since 3.0.0 + * + * @param {number} [radians=0] - The rotation of this Game Object, in radians. + * + * @return {this} This Game Object instance. + */ + setRotation: function (radians) + { + if (radians === undefined) { radians = 0; } + + this.rotation = radians; + + return this; + }, + + /** + * Sets the angle of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setAngle + * @since 3.0.0 + * + * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. + * + * @return {this} This Game Object instance. + */ + setAngle: function (degrees) + { + if (degrees === undefined) { degrees = 0; } + + this.angle = degrees; + + return this; + }, + + /** + * Sets the scale of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setScale + * @since 3.0.0 + * + * @param {number} x - The horizontal scale of this Game Object. + * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScale: function (x, y) + { + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } + + this.scaleX = x; + this.scaleY = y; + + return this; + }, + + /** + * Sets the x position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setX + * @since 3.0.0 + * + * @param {number} [value=0] - The x position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setX: function (value) + { + if (value === undefined) { value = 0; } + + this.x = value; + + return this; + }, + + /** + * Sets the y position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setY + * @since 3.0.0 + * + * @param {number} [value=0] - The y position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setY: function (value) + { + if (value === undefined) { value = 0; } + + this.y = value; + + return this; + }, + + /** + * Sets the z position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setZ + * @since 3.0.0 + * + * @param {number} [value=0] - The z position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setZ: function (value) + { + if (value === undefined) { value = 0; } + + this.z = value; + + return this; + }, + + /** + * Sets the w position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setW + * @since 3.0.0 + * + * @param {number} [value=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setW: function (value) + { + if (value === undefined) { value = 0; } + + this.w = value; + + return this; + }, + + /** + * Gets the local transform matrix for this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getLocalTransformMatrix: function (tempMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + + return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + }, + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * + * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getWorldTransformMatrix: function (tempMatrix, parentMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); } + + var parent = this.parentContainer; + + if (!parent) + { + return this.getLocalTransformMatrix(tempMatrix); + } + + tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + + while (parent) + { + parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); + + parentMatrix.multiply(tempMatrix, tempMatrix); + + parent = parent.parentContainer; + } + + return tempMatrix; + }, + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + * + * @method Phaser.GameObjects.Components.Transform#getParentRotation + * @since 3.18.0 + * + * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. + */ + getParentRotation: function () + { + var rotation = 0; + + var parent = this.parentContainer; + + while (parent) + { + rotation += parent.rotation; + + parent = parent.parentContainer; + } + + return rotation; + } + +}; + +module.exports = Transform; + + +/***/ }), +/* 258 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// bitmask flag for GameObject.renderMask +var _FLAG = 1; // 0001 + +/** + * Provides methods used for setting the visibility of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Visible + * @since 3.0.0 + */ + +var Visible = { + + /** + * Private internal value. Holds the visible value. + * + * @name Phaser.GameObjects.Components.Visible#_visible + * @type {boolean} + * @private + * @default true + * @since 3.0.0 + */ + _visible: true, + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * + * @name Phaser.GameObjects.Components.Visible#visible + * @type {boolean} + * @since 3.0.0 + */ + visible: { + + get: function () + { + return this._visible; + }, + + set: function (value) + { + if (value) + { + this._visible = true; + this.renderFlags |= _FLAG; + } + else + { + this._visible = false; + this.renderFlags &= ~_FLAG; + } + } + + }, + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * + * @method Phaser.GameObjects.Components.Visible#setVisible + * @since 3.0.0 + * + * @param {boolean} value - The visible state of the Game Object. + * + * @return {this} This Game Object instance. + */ + setVisible: function (value) + { + this.visible = value; + + return this; + } +}; + +module.exports = Visible; + + +/***/ }), +/* 259 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Data.Events + */ + +module.exports = { + + CHANGE_DATA: __webpack_require__(532), + CHANGE_DATA_KEY: __webpack_require__(533), + REMOVE_DATA: __webpack_require__(534), + SET_DATA: __webpack_require__(535) + +}; + + +/***/ }), +/* 260 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Perimeter = __webpack_require__(108); +var Point = __webpack_require__(3); + +// Return an array of points from the perimeter of the rectangle +// each spaced out based on the quantity or step required + +/** + * [description] + * + * @function Phaser.Geom.Rectangle.MarchingAnts + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {number} step - [description] + * @param {integer} quantity - [description] + * @param {(array|Phaser.Geom.Point[])} [out] - [description] + * + * @return {(array|Phaser.Geom.Point[])} [description] + */ +var MarchingAnts = function (rect, step, quantity, out) +{ + if (out === undefined) { out = []; } + + if (!step && !quantity) + { + // Bail out + return out; + } + + // If step is a falsey value (false, null, 0, undefined, etc) then we calculate + // it based on the quantity instead, otherwise we always use the step value + if (!step) + { + step = Perimeter(rect) / quantity; + } + else + { + quantity = Math.round(Perimeter(rect) / step); + } + + var x = rect.x; + var y = rect.y; + var face = 0; + + // Loop across each face of the rectangle + + for (var i = 0; i < quantity; i++) + { + out.push(new Point(x, y)); + + switch (face) + { + + // Top face + case 0: + x += step; + + if (x >= rect.right) + { + face = 1; + y += (x - rect.right); + x = rect.right; + } + break; + + // Right face + case 1: + y += step; + + if (y >= rect.bottom) + { + face = 2; + x -= (y - rect.bottom); + y = rect.bottom; + } + break; + + // Bottom face + case 2: + x -= step; + + if (x <= rect.left) + { + face = 3; + y -= (rect.left - x); + x = rect.left; + } + break; + + // Left face + case 3: + y -= step; + + if (y <= rect.top) + { + face = 0; + y = rect.top; + } + break; + } + } + + return out; +}; + +module.exports = MarchingAnts; + + +/***/ }), +/* 261 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * + * @function Phaser.Utils.Array.RotateLeft + * @since 3.0.0 + * + * @param {array} array - The array to shift to the left. This array is modified in place. + * @param {integer} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateLeft = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.shift(); + array.push(element); + } + + return element; +}; + +module.exports = RotateLeft; + + +/***/ }), +/* 262 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. + * + * @function Phaser.Utils.Array.RotateRight + * @since 3.0.0 + * + * @param {array} array - The array to shift to the right. This array is modified in place. + * @param {integer} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateRight = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.pop(); + array.unshift(element); + } + + return element; +}; + +module.exports = RotateRight; + + +/***/ }), +/* 263 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Using Bresenham's line algorithm this will return an array of all coordinates on this line. + * + * The `start` and `end` points are rounded before this runs as the algorithm works on integers. + * + * @function Phaser.Geom.Line.BresenhamPoints + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line. + * @param {integer} [stepRate=1] - The optional step rate for the points on the line. + * @param {array} [results] - An optional array to push the resulting coordinates into. + * + * @return {object[]} The array of coordinates on the line. + */ +var BresenhamPoints = function (line, stepRate, results) +{ + if (stepRate === undefined) { stepRate = 1; } + if (results === undefined) { results = []; } + + var x1 = Math.round(line.x1); + var y1 = Math.round(line.y1); + var x2 = Math.round(line.x2); + var y2 = Math.round(line.y2); + + var dx = Math.abs(x2 - x1); + var dy = Math.abs(y2 - y1); + var sx = (x1 < x2) ? 1 : -1; + var sy = (y1 < y2) ? 1 : -1; + var err = dx - dy; + + results.push({ x: x1, y: y1 }); + + var i = 1; + + while (!((x1 === x2) && (y1 === y2))) + { + var e2 = err << 1; + + if (e2 > -dy) + { + err -= dy; + x1 += sx; + } + + if (e2 < dx) + { + err += dx; + y1 += sy; + } + + if (i % stepRate === 0) + { + results.push({ x: x1, y: y1 }); + } + + i++; + } + + return results; +}; + +module.exports = BresenhamPoints; + + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Animation = __webpack_require__(146); +var Class = __webpack_require__(0); +var CustomMap = __webpack_require__(157); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(107); +var GameEvents = __webpack_require__(28); +var GetValue = __webpack_require__(6); +var Pad = __webpack_require__(158); + +/** + * @classdesc + * The Animation Manager. + * + * Animations are managed by the global Animation Manager. This is a singleton class that is + * responsible for creating and delivering animations and their corresponding data to all Game Objects. + * Unlike plugins it is owned by the Game instance, not the Scene. + * + * Sprites and other Game Objects get the data they need from the AnimationManager. + * + * @class AnimationManager + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Animations + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - A reference to the Phaser.Game instance. + */ +var AnimationManager = new Class({ + + Extends: EventEmitter, + + initialize: + + function AnimationManager (game) + { + EventEmitter.call(this); + + /** + * A reference to the Phaser.Game instance. + * + * @name Phaser.Animations.AnimationManager#game + * @type {Phaser.Game} + * @protected + * @since 3.0.0 + */ + this.game = game; + + /** + * A reference to the Texture Manager. + * + * @name Phaser.Animations.AnimationManager#textureManager + * @type {Phaser.Textures.TextureManager} + * @protected + * @since 3.0.0 + */ + this.textureManager = null; + + /** + * The global time scale of the Animation Manager. + * + * This scales the time delta between two frames, thus influencing the speed of time for the Animation Manager. + * + * @name Phaser.Animations.AnimationManager#globalTimeScale + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.globalTimeScale = 1; + + /** + * The Animations registered in the Animation Manager. + * + * This map should be modified with the {@link #add} and {@link #create} methods of the Animation Manager. + * + * @name Phaser.Animations.AnimationManager#anims + * @type {Phaser.Structs.Map.} + * @protected + * @since 3.0.0 + */ + this.anims = new CustomMap(); + + /** + * Whether the Animation Manager is paused along with all of its Animations. + * + * @name Phaser.Animations.AnimationManager#paused + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.paused = false; + + /** + * The name of this Animation Manager. + * + * @name Phaser.Animations.AnimationManager#name + * @type {string} + * @since 3.0.0 + */ + this.name = 'AnimationManager'; + + game.events.once(GameEvents.BOOT, this.boot, this); + }, + + /** + * Registers event listeners after the Game boots. + * + * @method Phaser.Animations.AnimationManager#boot + * @listens Phaser.Core.Events#DESTROY + * @since 3.0.0 + */ + boot: function () + { + this.textureManager = this.game.textures; + + this.game.events.once(GameEvents.DESTROY, this.destroy, this); + }, + + /** + * Adds an existing Animation to the Animation Manager. + * + * @method Phaser.Animations.AnimationManager#add + * @fires Phaser.Animations.Events#ADD_ANIMATION + * @since 3.0.0 + * + * @param {string} key - The key under which the Animation should be added. The Animation will be updated with it. Must be unique. + * @param {Phaser.Animations.Animation} animation - The Animation which should be added to the Animation Manager. + * + * @return {Phaser.Animations.AnimationManager} This Animation Manager. + */ + add: function (key, animation) + { + if (this.anims.has(key)) + { + console.warn('Animation key exists: ' + key); + + return; + } + + animation.key = key; + + this.anims.set(key, animation); + + this.emit(Events.ADD_ANIMATION, key, animation); + + return this; + }, + + /** + * Checks to see if the given key is already in use within the Animation Manager or not. + * + * Animations are global. Keys created in one scene can be used from any other Scene in your game. They are not Scene specific. + * + * @method Phaser.Animations.AnimationManager#exists + * @since 3.16.0 + * + * @param {string} key - The key of the Animation to check. + * + * @return {boolean} `true` if the Animation already exists in the Animation Manager, or `false` if the key is available. + */ + exists: function (key) + { + return this.anims.has(key); + }, + + /** + * Creates a new Animation and adds it to the Animation Manager. + * + * Animations are global. Once created, you can use them in any Scene in your game. They are not Scene specific. + * + * If an invalid key is given this method will return `false`. + * + * If you pass the key of an animation that already exists in the Animation Manager, that animation will be returned. + * + * A brand new animation is only created if the key is valid and not already in use. + * + * If you wish to re-use an existing key, call `AnimationManager.remove` first, then this method. + * + * @method Phaser.Animations.AnimationManager#create + * @fires Phaser.Animations.Events#ADD_ANIMATION + * @since 3.0.0 + * + * @param {Phaser.Types.Animations.Animation} config - The configuration settings for the Animation. + * + * @return {(Phaser.Animations.Animation|false)} The Animation that was created, or `false` is the key is already in use. + */ + create: function (config) + { + var key = config.key; + + var anim = false; + + if (key) + { + anim = this.get(key); + + if (!anim) + { + anim = new Animation(this, key, config); + + this.anims.set(key, anim); + + this.emit(Events.ADD_ANIMATION, key, anim); + } + } + + return anim; + }, + + /** + * Loads this Animation Manager's Animations and settings from a JSON object. + * + * @method Phaser.Animations.AnimationManager#fromJSON + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Animations.JSONAnimations|Phaser.Types.Animations.JSONAnimation)} data - The JSON object to parse. + * @param {boolean} [clearCurrentAnimations=false] - If set to `true`, the current animations will be removed (`anims.clear()`). If set to `false` (default), the animations in `data` will be added. + * + * @return {Phaser.Animations.Animation[]} An array containing all of the Animation objects that were created as a result of this call. + */ + fromJSON: function (data, clearCurrentAnimations) + { + if (clearCurrentAnimations === undefined) { clearCurrentAnimations = false; } + + if (clearCurrentAnimations) + { + this.anims.clear(); + } + + // Do we have a String (i.e. from JSON, or an Object?) + if (typeof data === 'string') + { + data = JSON.parse(data); + } + + var output = []; + + // Array of animations, or a single animation? + if (data.hasOwnProperty('anims') && Array.isArray(data.anims)) + { + for (var i = 0; i < data.anims.length; i++) + { + output.push(this.create(data.anims[i])); + } + + if (data.hasOwnProperty('globalTimeScale')) + { + this.globalTimeScale = data.globalTimeScale; + } + } + else if (data.hasOwnProperty('key') && data.type === 'frame') + { + output.push(this.create(data)); + } + + return output; + }, + + /** + * [description] + * + * @method Phaser.Animations.AnimationManager#generateFrameNames + * @since 3.0.0 + * + * @param {string} key - The key for the texture containing the animation frames. + * @param {Phaser.Types.Animations.GenerateFrameNames} [config] - The configuration object for the animation frame names. + * + * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects. + */ + generateFrameNames: function (key, config) + { + var prefix = GetValue(config, 'prefix', ''); + var start = GetValue(config, 'start', 0); + var end = GetValue(config, 'end', 0); + var suffix = GetValue(config, 'suffix', ''); + var zeroPad = GetValue(config, 'zeroPad', 0); + var out = GetValue(config, 'outputArray', []); + var frames = GetValue(config, 'frames', false); + + var texture = this.textureManager.get(key); + + if (!texture) + { + return out; + } + + var diff = (start < end) ? 1 : -1; + + // Adjust because we use i !== end in the for loop + end += diff; + + var i; + var frame; + + if (!config) + { + // Use every frame in the atlas? + frames = texture.getFrameNames(); + + for (i = 0; i < frames.length; i++) + { + out.push({ key: key, frame: frames[i] }); + } + } + else if (Array.isArray(frames)) + { + // Have they provided their own custom frame sequence array? + for (i = 0; i < frames.length; i++) + { + frame = prefix + Pad(frames[i], zeroPad, '0', 1) + suffix; + + if (texture.has(frame)) + { + out.push({ key: key, frame: frame }); + } + } + } + else + { + for (i = start; i !== end; i += diff) + { + frame = prefix + Pad(i, zeroPad, '0', 1) + suffix; + + if (texture.has(frame)) + { + out.push({ key: key, frame: frame }); + } + } + } + + return out; + }, + + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. + * + * @method Phaser.Animations.AnimationManager#generateFrameNumbers + * @since 3.0.0 + * + * @param {string} key - The key for the texture containing the animation frames. + * @param {Phaser.Types.Animations.GenerateFrameNumbers} config - The configuration object for the animation frames. + * + * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects. + */ + generateFrameNumbers: function (key, config) + { + var startFrame = GetValue(config, 'start', 0); + var endFrame = GetValue(config, 'end', -1); + var firstFrame = GetValue(config, 'first', false); + var out = GetValue(config, 'outputArray', []); + var frames = GetValue(config, 'frames', false); + + var texture = this.textureManager.get(key); + + if (!texture) + { + return out; + } + + if (firstFrame && texture.has(firstFrame)) + { + out.push({ key: key, frame: firstFrame }); + } + + var i; + + // Have they provided their own custom frame sequence array? + if (Array.isArray(frames)) + { + for (i = 0; i < frames.length; i++) + { + if (texture.has(frames[i])) + { + out.push({ key: key, frame: frames[i] }); + } + } + } + else + { + // No endFrame then see if we can get it + if (endFrame === -1) + { + endFrame = texture.frameTotal; + } + + var diff = (startFrame < endFrame) ? 1 : -1; + + // Adjust because we use i !== end in the for loop + endFrame += diff; + + for (i = startFrame; i !== endFrame; i += diff) + { + if (texture.has(i)) + { + out.push({ key: key, frame: i }); + } + } + } + + return out; + }, + + /** + * Get an Animation. + * + * @method Phaser.Animations.AnimationManager#get + * @since 3.0.0 + * + * @param {string} key - The key of the Animation to retrieve. + * + * @return {Phaser.Animations.Animation} The Animation. + */ + get: function (key) + { + return this.anims.get(key); + }, + + /** + * Load an Animation into a Game Object's Animation Component. + * + * @method Phaser.Animations.AnimationManager#load + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to load the animation into. + * @param {string} key - The key of the animation to load. + * @param {(string|integer)} [startFrame] - The name of a start frame to set on the loaded animation. + * + * @return {Phaser.GameObjects.GameObject} The Game Object with the animation loaded into it. + */ + load: function (child, key, startFrame) + { + var anim = this.get(key); + + if (anim) + { + anim.load(child, startFrame); + } + + return child; + }, + + /** + * Pause all animations. + * + * @method Phaser.Animations.AnimationManager#pauseAll + * @fires Phaser.Animations.Events#PAUSE_ALL + * @since 3.0.0 + * + * @return {Phaser.Animations.AnimationManager} This Animation Manager. + */ + pauseAll: function () + { + if (!this.paused) + { + this.paused = true; + + this.emit(Events.PAUSE_ALL); + } + + return this; + }, + + /** + * Play an animation on the given Game Objects that have an Animation Component. + * + * @method Phaser.Animations.AnimationManager#play + * @since 3.0.0 + * + * @param {string} key - The key of the animation to play on the Game Object. + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Objects to play the animation on. + * + * @return {Phaser.Animations.AnimationManager} This Animation Manager. + */ + play: function (key, child) + { + if (!Array.isArray(child)) + { + child = [ child ]; + } + + var anim = this.get(key); + + if (!anim) + { + return; + } + + for (var i = 0; i < child.length; i++) + { + child[i].anims.play(key); + } + + return this; + }, + + /** + * Remove an animation. + * + * @method Phaser.Animations.AnimationManager#remove + * @fires Phaser.Animations.Events#REMOVE_ANIMATION + * @since 3.0.0 + * + * @param {string} key - The key of the animation to remove. + * + * @return {Phaser.Animations.Animation} [description] + */ + remove: function (key) + { + var anim = this.get(key); + + if (anim) + { + this.emit(Events.REMOVE_ANIMATION, key, anim); + + this.anims.delete(key); + } + + return anim; + }, + + /** + * Resume all paused animations. + * + * @method Phaser.Animations.AnimationManager#resumeAll + * @fires Phaser.Animations.Events#RESUME_ALL + * @since 3.0.0 + * + * @return {Phaser.Animations.AnimationManager} This Animation Manager. + */ + resumeAll: function () + { + if (this.paused) + { + this.paused = false; + + this.emit(Events.RESUME_ALL); + } + + return this; + }, + + /** + * Takes an array of Game Objects that have an Animation Component and then + * starts the given animation playing on them, each one offset by the + * `stagger` amount given to this method. + * + * @method Phaser.Animations.AnimationManager#staggerPlay + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {string} key - The key of the animation to play on the Game Objects. + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} children - An array of Game Objects to play the animation on. They must have an Animation Component. + * @param {number} [stagger=0] - The amount of time, in milliseconds, to offset each play time by. + * + * @return {Phaser.Animations.AnimationManager} This Animation Manager. + */ + staggerPlay: function (key, children, stagger) + { + if (stagger === undefined) { stagger = 0; } + + if (!Array.isArray(children)) + { + children = [ children ]; + } + + var anim = this.get(key); + + if (!anim) + { + return; + } + + for (var i = 0; i < children.length; i++) + { + children[i].anims.delayedPlay(stagger * i, key); + } + + return this; + }, + + /** + * Get the animation data as javascript object by giving key, or get the data of all animations as array of objects, if key wasn't provided. + * + * @method Phaser.Animations.AnimationManager#toJSON + * @since 3.0.0 + * + * @param {string} key - [description] + * + * @return {Phaser.Types.Animations.JSONAnimations} [description] + */ + toJSON: function (key) + { + if (key !== undefined && key !== '') + { + return this.anims.get(key).toJSON(); + } + else + { + var output = { + anims: [], + globalTimeScale: this.globalTimeScale + }; + + this.anims.each(function (animationKey, animation) + { + output.anims.push(animation.toJSON()); + }); + + return output; + } + }, + + /** + * Destroy this Animation Manager and clean up animation definitions and references to other objects. + * This method should not be called directly. It will be called automatically as a response to a `destroy` event from the Phaser.Game instance. + * + * @method Phaser.Animations.AnimationManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.anims.clear(); + + this.textureManager = null; + + this.game = null; + } + +}); + +module.exports = AnimationManager; + + +/***/ }), +/* 265 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CustomMap = __webpack_require__(157); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(266); + +/** + * @classdesc + * The BaseCache is a base Cache class that can be used for storing references to any kind of data. + * + * Data can be added, retrieved and removed based on the given keys. + * + * Keys are string-based. + * + * @class BaseCache + * @memberof Phaser.Cache + * @constructor + * @since 3.0.0 + */ +var BaseCache = new Class({ + + initialize: + + function BaseCache () + { + /** + * The Map in which the cache objects are stored. + * + * You can query the Map directly or use the BaseCache methods. + * + * @name Phaser.Cache.BaseCache#entries + * @type {Phaser.Structs.Map.} + * @since 3.0.0 + */ + this.entries = new CustomMap(); + + /** + * An instance of EventEmitter used by the cache to emit related events. + * + * @name Phaser.Cache.BaseCache#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = new EventEmitter(); + }, + + /** + * Adds an item to this cache. The item is referenced by a unique string, which you are responsible + * for setting and keeping track of. The item can only be retrieved by using this string. + * + * @method Phaser.Cache.BaseCache#add + * @fires Phaser.Cache.Events#ADD + * @since 3.0.0 + * + * @param {string} key - The unique key by which the data added to the cache will be referenced. + * @param {*} data - The data to be stored in the cache. + * + * @return {Phaser.Cache.BaseCache} This BaseCache object. + */ + add: function (key, data) + { + this.entries.set(key, data); + + this.events.emit(Events.ADD, this, key, data); + + return this; + }, + + /** + * Checks if this cache contains an item matching the given key. + * This performs the same action as `BaseCache.exists`. + * + * @method Phaser.Cache.BaseCache#has + * @since 3.0.0 + * + * @param {string} key - The unique key of the item to be checked in this cache. + * + * @return {boolean} Returns `true` if the cache contains an item matching the given key, otherwise `false`. + */ + has: function (key) + { + return this.entries.has(key); + }, + + /** + * Checks if this cache contains an item matching the given key. + * This performs the same action as `BaseCache.has` and is called directly by the Loader. + * + * @method Phaser.Cache.BaseCache#exists + * @since 3.7.0 + * + * @param {string} key - The unique key of the item to be checked in this cache. + * + * @return {boolean} Returns `true` if the cache contains an item matching the given key, otherwise `false`. + */ + exists: function (key) + { + return this.entries.has(key); + }, + + /** + * Gets an item from this cache based on the given key. + * + * @method Phaser.Cache.BaseCache#get + * @since 3.0.0 + * + * @param {string} key - The unique key of the item to be retrieved from this cache. + * + * @return {*} The item in the cache, or `null` if no item matching the given key was found. + */ + get: function (key) + { + return this.entries.get(key); + }, + + /** + * Removes and item from this cache based on the given key. + * + * If an entry matching the key is found it is removed from the cache and a `remove` event emitted. + * No additional checks are done on the item removed. If other systems or parts of your game code + * are relying on this item, it is up to you to sever those relationships prior to removing the item. + * + * @method Phaser.Cache.BaseCache#remove + * @fires Phaser.Cache.Events#REMOVE + * @since 3.0.0 + * + * @param {string} key - The unique key of the item to remove from the cache. + * + * @return {Phaser.Cache.BaseCache} This BaseCache object. + */ + remove: function (key) + { + var entry = this.get(key); + + if (entry) + { + this.entries.delete(key); + + this.events.emit(Events.REMOVE, this, key, entry.data); + } + + return this; + }, + + /** + * Returns all keys in use in this cache. + * + * @method Phaser.Cache.BaseCache#getKeys + * @since 3.17.0 + * + * @return {string[]} Array containing all the keys. + */ + getKeys: function () + { + return this.entries.keys(); + }, + + /** + * Destroys this cache and all items within it. + * + * @method Phaser.Cache.BaseCache#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.entries.clear(); + this.events.removeAllListeners(); + + this.entries = null; + this.events = null; + } + +}); + +module.exports = BaseCache; + + +/***/ }), +/* 266 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Cache.Events + */ + +module.exports = { + + ADD: __webpack_require__(595), + REMOVE: __webpack_require__(596) + +}; + + +/***/ }), +/* 267 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseCache = __webpack_require__(265); +var Class = __webpack_require__(0); +var GameEvents = __webpack_require__(28); + +/** + * @classdesc + * The Cache Manager is the global cache owned and maintained by the Game instance. + * + * Various systems, such as the file Loader, rely on this cache in order to store the files + * it has loaded. The manager itself doesn't store any files, but instead owns multiple BaseCache + * instances, one per type of file. You can also add your own custom caches. + * + * @class CacheManager + * @memberof Phaser.Cache + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - A reference to the Phaser.Game instance that owns this CacheManager. + */ +var CacheManager = new Class({ + + initialize: + + function CacheManager (game) + { + /** + * A reference to the Phaser.Game instance that owns this CacheManager. + * + * @name Phaser.Cache.CacheManager#game + * @type {Phaser.Game} + * @protected + * @since 3.0.0 + */ + this.game = game; + + /** + * A Cache storing all binary files, typically added via the Loader. + * + * @name Phaser.Cache.CacheManager#binary + * @type {Phaser.Cache.BaseCache} + * @since 3.0.0 + */ + this.binary = new BaseCache(); + + /** + * A Cache storing all bitmap font data files, typically added via the Loader. + * Only the font data is stored in this cache, the textures are part of the Texture Manager. + * + * @name Phaser.Cache.CacheManager#bitmapFont + * @type {Phaser.Cache.BaseCache} + * @since 3.0.0 + */ + this.bitmapFont = new BaseCache(); + + /** + * A Cache storing all JSON data files, typically added via the Loader. + * + * @name Phaser.Cache.CacheManager#json + * @type {Phaser.Cache.BaseCache} + * @since 3.0.0 + */ + this.json = new BaseCache(); + + /** + * A Cache storing all physics data files, typically added via the Loader. + * + * @name Phaser.Cache.CacheManager#physics + * @type {Phaser.Cache.BaseCache} + * @since 3.0.0 + */ + this.physics = new BaseCache(); + + /** + * A Cache storing all shader source files, typically added via the Loader. + * + * @name Phaser.Cache.CacheManager#shader + * @type {Phaser.Cache.BaseCache} + * @since 3.0.0 + */ + this.shader = new BaseCache(); + + /** + * A Cache storing all non-streaming audio files, typically added via the Loader. + * + * @name Phaser.Cache.CacheManager#audio + * @type {Phaser.Cache.BaseCache} + * @since 3.0.0 + */ + this.audio = new BaseCache(); + + /** + * A Cache storing all text files, typically added via the Loader. + * + * @name Phaser.Cache.CacheManager#text + * @type {Phaser.Cache.BaseCache} + * @since 3.0.0 + */ + this.text = new BaseCache(); + + /** + * A Cache storing all html files, typically added via the Loader. + * + * @name Phaser.Cache.CacheManager#html + * @type {Phaser.Cache.BaseCache} + * @since 3.12.0 + */ + this.html = new BaseCache(); + + /** + * A Cache storing all WaveFront OBJ files, typically added via the Loader. + * + * @name Phaser.Cache.CacheManager#obj + * @type {Phaser.Cache.BaseCache} + * @since 3.0.0 + */ + this.obj = new BaseCache(); + + /** + * A Cache storing all tilemap data files, typically added via the Loader. + * Only the data is stored in this cache, the textures are part of the Texture Manager. + * + * @name Phaser.Cache.CacheManager#tilemap + * @type {Phaser.Cache.BaseCache} + * @since 3.0.0 + */ + this.tilemap = new BaseCache(); + + /** + * A Cache storing all xml data files, typically added via the Loader. + * + * @name Phaser.Cache.CacheManager#xml + * @type {Phaser.Cache.BaseCache} + * @since 3.0.0 + */ + this.xml = new BaseCache(); + + /** + * An object that contains your own custom BaseCache entries. + * Add to this via the `addCustom` method. + * + * @name Phaser.Cache.CacheManager#custom + * @type {Object.} + * @since 3.0.0 + */ + this.custom = {}; + + this.game.events.once(GameEvents.DESTROY, this.destroy, this); + }, + + /** + * Add your own custom Cache for storing your own files. + * The cache will be available under `Cache.custom.key`. + * The cache will only be created if the key is not already in use. + * + * @method Phaser.Cache.CacheManager#addCustom + * @since 3.0.0 + * + * @param {string} key - The unique key of your custom cache. + * + * @return {Phaser.Cache.BaseCache} A reference to the BaseCache that was created. If the key was already in use, a reference to the existing cache is returned instead. + */ + addCustom: function (key) + { + if (!this.custom.hasOwnProperty(key)) + { + this.custom[key] = new BaseCache(); + } + + return this.custom[key]; + }, + + /** + * Removes all entries from all BaseCaches and destroys all custom caches. + * + * @method Phaser.Cache.CacheManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + var keys = [ + 'binary', + 'bitmapFont', + 'json', + 'physics', + 'shader', + 'audio', + 'text', + 'html', + 'obj', + 'tilemap', + 'xml' + ]; + + for (var i = 0; i < keys.length; i++) + { + this[keys[i]].destroy(); + this[keys[i]] = null; + } + + for (var key in this.custom) + { + this.custom[key].destroy(); + } + + this.custom = null; + + this.game = null; + } + +}); + +module.exports = CacheManager; + + +/***/ }), +/* 268 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseCamera = __webpack_require__(112); +var CanvasPool = __webpack_require__(24); +var CenterOn = __webpack_require__(162); +var Clamp = __webpack_require__(22); +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var Effects = __webpack_require__(276); +var Linear = __webpack_require__(114); +var Rectangle = __webpack_require__(10); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Camera. + * + * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world, + * and can be positioned, rotated, zoomed and scrolled accordingly. + * + * A Camera consists of two elements: The viewport and the scroll values. + * + * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are + * created the same size as your game, but their position and size can be set to anything. This means if you + * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, + * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). + * + * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this + * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the + * viewport, and changing the viewport has no impact on the scrolling. + * + * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, + * allowing you to filter Game Objects out on a per-Camera basis. + * + * A Camera also has built-in special effects including Fade, Flash and Camera Shake. + * + * @class Camera + * @memberof Phaser.Cameras.Scene2D + * @constructor + * @since 3.0.0 + * + * @extends Phaser.Cameras.Scene2D.BaseCamera + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.Tint + * + * @param {number} x - The x position of the Camera, relative to the top-left of the game canvas. + * @param {number} y - The y position of the Camera, relative to the top-left of the game canvas. + * @param {number} width - The width of the Camera, in pixels. + * @param {number} height - The height of the Camera, in pixels. + */ +var Camera = new Class({ + + Extends: BaseCamera, + + Mixins: [ + Components.Flip, + Components.Tint + ], + + initialize: + + function Camera (x, y, width, height) + { + BaseCamera.call(this, x, y, width, height); + + /** + * Does this Camera allow the Game Objects it renders to receive input events? + * + * @name Phaser.Cameras.Scene2D.Camera#inputEnabled + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.inputEnabled = true; + + /** + * The Camera Fade effect handler. + * To fade this camera see the `Camera.fade` methods. + * + * @name Phaser.Cameras.Scene2D.Camera#fadeEffect + * @type {Phaser.Cameras.Scene2D.Effects.Fade} + * @since 3.5.0 + */ + this.fadeEffect = new Effects.Fade(this); + + /** + * The Camera Flash effect handler. + * To flash this camera see the `Camera.flash` method. + * + * @name Phaser.Cameras.Scene2D.Camera#flashEffect + * @type {Phaser.Cameras.Scene2D.Effects.Flash} + * @since 3.5.0 + */ + this.flashEffect = new Effects.Flash(this); + + /** + * The Camera Shake effect handler. + * To shake this camera see the `Camera.shake` method. + * + * @name Phaser.Cameras.Scene2D.Camera#shakeEffect + * @type {Phaser.Cameras.Scene2D.Effects.Shake} + * @since 3.5.0 + */ + this.shakeEffect = new Effects.Shake(this); + + /** + * The Camera Pan effect handler. + * To pan this camera see the `Camera.pan` method. + * + * @name Phaser.Cameras.Scene2D.Camera#panEffect + * @type {Phaser.Cameras.Scene2D.Effects.Pan} + * @since 3.11.0 + */ + this.panEffect = new Effects.Pan(this); + + /** + * The Camera Zoom effect handler. + * To zoom this camera see the `Camera.zoom` method. + * + * @name Phaser.Cameras.Scene2D.Camera#zoomEffect + * @type {Phaser.Cameras.Scene2D.Effects.Zoom} + * @since 3.11.0 + */ + this.zoomEffect = new Effects.Zoom(this); + + /** + * The linear interpolation value to use when following a target. + * + * Can also be set via `setLerp` or as part of the `startFollow` call. + * + * The default values of 1 means the camera will instantly snap to the target coordinates. + * A lower value, such as 0.1 means the camera will more slowly track the target, giving + * a smooth transition. You can set the horizontal and vertical values independently, and also + * adjust this value in real-time during your game. + * + * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis. + * + * @name Phaser.Cameras.Scene2D.Camera#lerp + * @type {Phaser.Math.Vector2} + * @since 3.9.0 + */ + this.lerp = new Vector2(1, 1); + + /** + * The values stored in this property are subtracted from the Camera targets position, allowing you to + * offset the camera from the actual target x/y coordinates by this amount. + * Can also be set via `setFollowOffset` or as part of the `startFollow` call. + * + * @name Phaser.Cameras.Scene2D.Camera#followOffset + * @type {Phaser.Math.Vector2} + * @since 3.9.0 + */ + this.followOffset = new Vector2(); + + /** + * The Camera dead zone. + * + * The deadzone is only used when the camera is following a target. + * + * It defines a rectangular region within which if the target is present, the camera will not scroll. + * If the target moves outside of this area, the camera will begin scrolling in order to follow it. + * + * The `lerp` values that you can set for a follower target also apply when using a deadzone. + * + * You can directly set this property to be an instance of a Rectangle. Or, you can use the + * `setDeadzone` method for a chainable approach. + * + * The rectangle you provide can have its dimensions adjusted dynamically, however, please + * note that its position is updated every frame, as it is constantly re-centered on the cameras mid point. + * + * Calling `setDeadzone` with no arguments will reset an active deadzone, as will setting this property + * to `null`. + * + * @name Phaser.Cameras.Scene2D.Camera#deadzone + * @type {?Phaser.Geom.Rectangle} + * @since 3.11.0 + */ + this.deadzone = null; + + /** + * Internal follow target reference. + * + * @name Phaser.Cameras.Scene2D.Camera#_follow + * @type {?any} + * @private + * @default null + * @since 3.0.0 + */ + this._follow = null; + + /** + * Is this Camera rendering directly to the canvas or to a texture? + * + * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough) + * + * Once enabled you can toggle it by switching this property. + * + * To properly remove a render texture you should call the `clearRenderToTexture()` method. + * + * @name Phaser.Cameras.Scene2D.Camera#renderToTexture + * @type {boolean} + * @default false + * @since 3.13.0 + */ + this.renderToTexture = false; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the HTML Canvas Element that the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only populated if Phaser is running with the Canvas Renderer. + * + * @name Phaser.Cameras.Scene2D.Camera#canvas + * @type {HTMLCanvasElement} + * @since 3.13.0 + */ + this.canvas = null; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the Rendering Context belonging to the Canvas element the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only populated if Phaser is running with the Canvas Renderer. + * + * @name Phaser.Cameras.Scene2D.Camera#context + * @type {CanvasRenderingContext2D} + * @since 3.13.0 + */ + this.context = null; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the GL Texture belonging the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only set if Phaser is running with the WebGL Renderer. + * + * @name Phaser.Cameras.Scene2D.Camera#glTexture + * @type {?WebGLTexture} + * @since 3.13.0 + */ + this.glTexture = null; + + /** + * If this Camera has been set to render to a texture then this holds a reference + * to the GL Frame Buffer belonging the Camera is drawing to. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only set if Phaser is running with the WebGL Renderer. + * + * @name Phaser.Cameras.Scene2D.Camera#framebuffer + * @type {?WebGLFramebuffer} + * @since 3.13.0 + */ + this.framebuffer = null; + + /** + * If this Camera has been set to render to a texture and to use a custom pipeline, + * then this holds a reference to the pipeline the Camera is drawing with. + * + * Enable texture rendering using the method `setRenderToTexture`. + * + * This is only set if Phaser is running with the WebGL Renderer. + * + * @name Phaser.Cameras.Scene2D.Camera#pipeline + * @type {any} + * @since 3.13.0 + */ + this.pipeline = null; + }, + + /** + * Sets the Camera to render to a texture instead of to the main canvas. + * + * The Camera will redirect all Game Objects it's asked to render to this texture. + * + * During the render sequence, the texture itself will then be rendered to the main canvas. + * + * Doing this gives you the ability to modify the texture before this happens, + * allowing for special effects such as Camera specific shaders, or post-processing + * on the texture. + * + * If running under Canvas the Camera will render to its `canvas` property. + * + * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties. + * + * If you set a camera to render to a texture then it will emit 2 events during the render loop: + * + * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. + * + * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the + * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before + * it appears in-game. + * + * You should not enable this unless you plan on actually using the texture it creates + * somehow, otherwise you're just doubling the work required to render your game. + * + * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean. + * + * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method, + * which will delete the respective textures and free-up resources. + * + * @method Phaser.Cameras.Scene2D.Camera#setRenderToTexture + * @since 3.13.0 + * + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - An optional WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + setRenderToTexture: function (pipeline) + { + var renderer = this.scene.sys.game.renderer; + + if (renderer.gl) + { + this.glTexture = renderer.createTextureFromSource(null, this.width, this.height, 0); + this.framebuffer = renderer.createFramebuffer(this.width, this.height, this.glTexture, false); + } + else + { + this.canvas = CanvasPool.create2D(this, this.width, this.height); + this.context = this.canvas.getContext('2d'); + } + + this.renderToTexture = true; + + if (pipeline) + { + this.setPipeline(pipeline); + } + + return this; + }, + + /** + * Sets the WebGL pipeline this Camera is using when rendering to a texture. + * + * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself. + * + * Call this method with no arguments to clear any previously set pipeline. + * + * @method Phaser.Cameras.Scene2D.Camera#setPipeline + * @since 3.13.0 + * + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - The WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. Or if left empty it will clear the pipeline. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + setPipeline: function (pipeline) + { + if (typeof pipeline === 'string') + { + var renderer = this.scene.sys.game.renderer; + + if (renderer.gl && renderer.hasPipeline(pipeline)) + { + this.pipeline = renderer.getPipeline(pipeline); + } + } + else + { + this.pipeline = pipeline; + } + + return this; + }, + + /** + * If this Camera was set to render to a texture, this will clear the resources it was using and + * redirect it to render back to the primary Canvas again. + * + * If you only wish to temporarily disable rendering to a texture then you can toggle the + * property `renderToTexture` instead. + * + * @method Phaser.Cameras.Scene2D.Camera#clearRenderToTexture + * @since 3.13.0 + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + clearRenderToTexture: function () + { + if (!this.scene) + { + return; + } + + var renderer = this.scene.sys.game.renderer; + + if (renderer.gl) + { + if (this.framebuffer) + { + renderer.deleteFramebuffer(this.framebuffer); + } + + if (this.glTexture) + { + renderer.deleteTexture(this.glTexture); + } + + this.framebuffer = null; + this.glTexture = null; + this.pipeline = null; + } + else + { + CanvasPool.remove(this); + + this.canvas = null; + this.context = null; + } + + this.renderToTexture = false; + + return this; + }, + + /** + * Sets the Camera dead zone. + * + * The deadzone is only used when the camera is following a target. + * + * It defines a rectangular region within which if the target is present, the camera will not scroll. + * If the target moves outside of this area, the camera will begin scrolling in order to follow it. + * + * The deadzone rectangle is re-positioned every frame so that it is centered on the mid-point + * of the camera. This allows you to use the object for additional game related checks, such as + * testing if an object is within it or not via a Rectangle.contains call. + * + * The `lerp` values that you can set for a follower target also apply when using a deadzone. + * + * Calling this method with no arguments will reset an active deadzone. + * + * @method Phaser.Cameras.Scene2D.Camera#setDeadzone + * @since 3.11.0 + * + * @param {number} [width] - The width of the deadzone rectangle in pixels. If not specified the deadzone is removed. + * @param {number} [height] - The height of the deadzone rectangle in pixels. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + setDeadzone: function (width, height) + { + if (width === undefined) + { + this.deadzone = null; + } + else + { + if (this.deadzone) + { + this.deadzone.width = width; + this.deadzone.height = height; + } + else + { + this.deadzone = new Rectangle(0, 0, width, height); + } + + if (this._follow) + { + var originX = this.width / 2; + var originY = this.height / 2; + + var fx = this._follow.x - this.followOffset.x; + var fy = this._follow.y - this.followOffset.y; + + this.midPoint.set(fx, fy); + + this.scrollX = fx - originX; + this.scrollY = fy - originY; + } + + CenterOn(this.deadzone, this.midPoint.x, this.midPoint.y); + } + + return this; + }, + + /** + * Fades the Camera in from the given color over the duration specified. + * + * @method Phaser.Cameras.Scene2D.Camera#fadeIn + * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_START + * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE + * @since 3.3.0 + * + * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + fadeIn: function (duration, red, green, blue, callback, context) + { + return this.fadeEffect.start(false, duration, red, green, blue, true, callback, context); + }, + + /** + * Fades the Camera out to the given color over the duration specified. + * This is an alias for Camera.fade that forces the fade to start, regardless of existing fades. + * + * @method Phaser.Cameras.Scene2D.Camera#fadeOut + * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_START + * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE + * @since 3.3.0 + * + * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + fadeOut: function (duration, red, green, blue, callback, context) + { + return this.fadeEffect.start(true, duration, red, green, blue, true, callback, context); + }, + + /** + * Fades the Camera from the given color to transparent over the duration specified. + * + * @method Phaser.Cameras.Scene2D.Camera#fadeFrom + * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_START + * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE + * @since 3.5.0 + * + * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. + * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + fadeFrom: function (duration, red, green, blue, force, callback, context) + { + return this.fadeEffect.start(false, duration, red, green, blue, force, callback, context); + }, + + /** + * Fades the Camera from transparent to the given color over the duration specified. + * + * @method Phaser.Cameras.Scene2D.Camera#fade + * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_START + * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE + * @since 3.0.0 + * + * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. + * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + fade: function (duration, red, green, blue, force, callback, context) + { + return this.fadeEffect.start(true, duration, red, green, blue, force, callback, context); + }, + + /** + * Flashes the Camera by setting it to the given color immediately and then fading it away again quickly over the duration specified. + * + * @method Phaser.Cameras.Scene2D.Camera#flash + * @fires Phaser.Cameras.Scene2D.Events#FLASH_START + * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE + * @since 3.0.0 + * + * @param {integer} [duration=250] - The duration of the effect in milliseconds. + * @param {integer} [red=255] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {integer} [green=255] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {integer} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. + * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + flash: function (duration, red, green, blue, force, callback, context) + { + return this.flashEffect.start(duration, red, green, blue, force, callback, context); + }, + + /** + * Shakes the Camera by the given intensity over the duration specified. + * + * @method Phaser.Cameras.Scene2D.Camera#shake + * @fires Phaser.Cameras.Scene2D.Events#SHAKE_START + * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE + * @since 3.0.0 + * + * @param {integer} [duration=100] - The duration of the effect in milliseconds. + * @param {number} [intensity=0.05] - The intensity of the shake. + * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. + * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + shake: function (duration, intensity, force, callback, context) + { + return this.shakeEffect.start(duration, intensity, force, callback, context); + }, + + /** + * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, + * over the duration and with the ease specified. + * + * @method Phaser.Cameras.Scene2D.Camera#pan + * @fires Phaser.Cameras.Scene2D.Events#PAN_START + * @fires Phaser.Cameras.Scene2D.Events#PAN_COMPLETE + * @since 3.11.0 + * + * @param {number} x - The destination x coordinate to scroll the center of the Camera viewport to. + * @param {number} y - The destination y coordinate to scroll the center of the Camera viewport to. + * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. + * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. + * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * the current camera scroll x coordinate and the current camera scroll y coordinate. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + pan: function (x, y, duration, ease, force, callback, context) + { + return this.panEffect.start(x, y, duration, ease, force, callback, context); + }, + + /** + * This effect will zoom the Camera to the given scale, over the duration and with the ease specified. + * + * @method Phaser.Cameras.Scene2D.Camera#zoomTo + * @fires Phaser.Cameras.Scene2D.Events#ZOOM_START + * @fires Phaser.Cameras.Scene2D.Events#ZOOM_COMPLETE + * @since 3.11.0 + * + * @param {number} zoom - The target Camera zoom value. + * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. + * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. + * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * the current camera scroll x coordinate and the current camera scroll y coordinate. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + zoomTo: function (zoom, duration, ease, force, callback, context) + { + return this.zoomEffect.start(zoom, duration, ease, force, callback, context); + }, + + /** + * Internal preRender step. + * + * @method Phaser.Cameras.Scene2D.Camera#preRender + * @protected + * @since 3.0.0 + * + * @param {number} resolution - The game resolution, as set in the Scale Manager. + */ + preRender: function (resolution) + { + var width = this.width; + var height = this.height; + + var halfWidth = width * 0.5; + var halfHeight = height * 0.5; + + var zoom = this.zoom * resolution; + var matrix = this.matrix; + + var originX = width * this.originX; + var originY = height * this.originY; + + var follow = this._follow; + var deadzone = this.deadzone; + + var sx = this.scrollX; + var sy = this.scrollY; + + if (deadzone) + { + CenterOn(deadzone, this.midPoint.x, this.midPoint.y); + } + + if (follow && !this.panEffect.isRunning) + { + var fx = (follow.x - this.followOffset.x); + var fy = (follow.y - this.followOffset.y); + + if (deadzone) + { + if (fx < deadzone.x) + { + sx = Linear(sx, sx - (deadzone.x - fx), this.lerp.x); + } + else if (fx > deadzone.right) + { + sx = Linear(sx, sx + (fx - deadzone.right), this.lerp.x); + } + + if (fy < deadzone.y) + { + sy = Linear(sy, sy - (deadzone.y - fy), this.lerp.y); + } + else if (fy > deadzone.bottom) + { + sy = Linear(sy, sy + (fy - deadzone.bottom), this.lerp.y); + } + } + else + { + sx = Linear(sx, fx - originX, this.lerp.x); + sy = Linear(sy, fy - originY, this.lerp.y); + } + } + + if (this.useBounds) + { + sx = this.clampX(sx); + sy = this.clampY(sy); + } + + if (this.roundPixels) + { + originX = Math.round(originX); + originY = Math.round(originY); + } + + // Values are in pixels and not impacted by zooming the Camera + this.scrollX = sx; + this.scrollY = sy; + + var midX = sx + halfWidth; + var midY = sy + halfHeight; + + // The center of the camera, in world space, so taking zoom into account + // Basically the pixel value of what it's looking at in the middle of the cam + this.midPoint.set(midX, midY); + + var displayWidth = width / zoom; + var displayHeight = height / zoom; + + this.worldView.setTo( + midX - (displayWidth / 2), + midY - (displayHeight / 2), + displayWidth, + displayHeight + ); + + matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoom, zoom); + matrix.translate(-originX, -originY); + + this.shakeEffect.preRender(); + }, + + /** + * Sets the linear interpolation value to use when following a target. + * + * The default values of 1 means the camera will instantly snap to the target coordinates. + * A lower value, such as 0.1 means the camera will more slowly track the target, giving + * a smooth transition. You can set the horizontal and vertical values independently, and also + * adjust this value in real-time during your game. + * + * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis. + * + * @method Phaser.Cameras.Scene2D.Camera#setLerp + * @since 3.9.0 + * + * @param {number} [x=1] - The amount added to the horizontal linear interpolation of the follow target. + * @param {number} [y=1] - The amount added to the vertical linear interpolation of the follow target. + * + * @return {this} This Camera instance. + */ + setLerp: function (x, y) + { + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } + + this.lerp.set(x, y); + + return this; + }, + + /** + * Sets the horizontal and vertical offset of the camera from its follow target. + * The values are subtracted from the targets position during the Cameras update step. + * + * @method Phaser.Cameras.Scene2D.Camera#setFollowOffset + * @since 3.9.0 + * + * @param {number} [x=0] - The horizontal offset from the camera follow target.x position. + * @param {number} [y=0] - The vertical offset from the camera follow target.y position. + * + * @return {this} This Camera instance. + */ + setFollowOffset: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + this.followOffset.set(x, y); + + return this; + }, + + /** + * Sets the Camera to follow a Game Object. + * + * When enabled the Camera will automatically adjust its scroll position to keep the target Game Object + * in its center. + * + * You can set the linear interpolation value used in the follow code. + * Use low lerp values (such as 0.1) to automatically smooth the camera motion. + * + * If you find you're getting a slight "jitter" effect when following an object it's probably to do with sub-pixel + * rendering of the targets position. This can be rounded by setting the `roundPixels` argument to `true` to + * force full pixel rounding rendering. Note that this can still be broken if you have specified a non-integer zoom + * value on the camera. So be sure to keep the camera zoom to integers. + * + * @method Phaser.Cameras.Scene2D.Camera#startFollow + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|object)} target - The target for the Camera to follow. + * @param {boolean} [roundPixels=false] - Round the camera position to whole integers to avoid sub-pixel rendering? + * @param {number} [lerpX=1] - A value between 0 and 1. This value specifies the amount of linear interpolation to use when horizontally tracking the target. The closer the value to 1, the faster the camera will track. + * @param {number} [lerpY=1] - A value between 0 and 1. This value specifies the amount of linear interpolation to use when vertically tracking the target. The closer the value to 1, the faster the camera will track. + * @param {number} [offsetX=0] - The horizontal offset from the camera follow target.x position. + * @param {number} [offsetY=0] - The vertical offset from the camera follow target.y position. + * + * @return {this} This Camera instance. + */ + startFollow: function (target, roundPixels, lerpX, lerpY, offsetX, offsetY) + { + if (roundPixels === undefined) { roundPixels = false; } + if (lerpX === undefined) { lerpX = 1; } + if (lerpY === undefined) { lerpY = lerpX; } + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = offsetX; } + + this._follow = target; + + this.roundPixels = roundPixels; + + lerpX = Clamp(lerpX, 0, 1); + lerpY = Clamp(lerpY, 0, 1); + + this.lerp.set(lerpX, lerpY); + + this.followOffset.set(offsetX, offsetY); + + var originX = this.width / 2; + var originY = this.height / 2; + + var fx = target.x - offsetX; + var fy = target.y - offsetY; + + this.midPoint.set(fx, fy); + + this.scrollX = fx - originX; + this.scrollY = fy - originY; + + if (this.useBounds) + { + this.scrollX = this.clampX(this.scrollX); + this.scrollY = this.clampY(this.scrollY); + } + + return this; + }, + + /** + * Stops a Camera from following a Game Object, if previously set via `Camera.startFollow`. + * + * @method Phaser.Cameras.Scene2D.Camera#stopFollow + * @since 3.0.0 + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + stopFollow: function () + { + this._follow = null; + + return this; + }, + + /** + * Resets any active FX, such as a fade, flash or shake. Useful to call after a fade in order to + * remove the fade. + * + * @method Phaser.Cameras.Scene2D.Camera#resetFX + * @since 3.0.0 + * + * @return {Phaser.Cameras.Scene2D.Camera} This Camera instance. + */ + resetFX: function () + { + this.panEffect.reset(); + this.shakeEffect.reset(); + this.flashEffect.reset(); + this.fadeEffect.reset(); + + return this; + }, + + /** + * Internal method called automatically by the Camera Manager. + * + * @method Phaser.Cameras.Scene2D.Camera#update + * @protected + * @since 3.0.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function (time, delta) + { + if (this.visible) + { + this.panEffect.update(time, delta); + this.zoomEffect.update(time, delta); + this.shakeEffect.update(time, delta); + this.flashEffect.update(time, delta); + this.fadeEffect.update(time, delta); + } + }, + + /** + * Destroys this Camera instance. You rarely need to call this directly. + * + * Called by the Camera Manager. If you wish to destroy a Camera please use `CameraManager.remove` as + * cameras are stored in a pool, ready for recycling later, and calling this directly will prevent that. + * + * @method Phaser.Cameras.Scene2D.Camera#destroy + * @fires Phaser.Cameras.Scene2D.Events#DESTROY + * @since 3.0.0 + */ + destroy: function () + { + this.clearRenderToTexture(); + + this.resetFX(); + + BaseCamera.prototype.destroy.call(this); + + this._follow = null; + + this.deadzone = null; + } + +}); + +module.exports = Camera; + + +/***/ }), +/* 269 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Color = __webpack_require__(33); + +/** + * Converts a hex string into a Phaser Color object. + * + * The hex string can supplied as `'#0033ff'` or the short-hand format of `'#03f'`; it can begin with an optional "#" or "0x", or be unprefixed. + * + * An alpha channel is _not_ supported. + * + * @function Phaser.Display.Color.HexStringToColor + * @since 3.0.0 + * + * @param {string} hex - The hex color value to convert, such as `#0033ff` or the short-hand format: `#03f`. + * + * @return {Phaser.Display.Color} A Color object populated by the values of the given string. + */ +var HexStringToColor = function (hex) +{ + var color = new Color(); + + // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") + hex = hex.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i, function (m, r, g, b) + { + return r + r + g + g + b + b; + }); + + var result = (/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i).exec(hex); + + if (result) + { + var r = parseInt(result[1], 16); + var g = parseInt(result[2], 16); + var b = parseInt(result[3], 16); + + color.setTo(r, g, b); + } + + return color; +}; + +module.exports = HexStringToColor; + + +/***/ }), +/* 270 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Given an alpha and 3 color values this will return an integer representation of it. + * + * @function Phaser.Display.Color.GetColor32 + * @since 3.0.0 + * + * @param {integer} red - The red color value. A number between 0 and 255. + * @param {integer} green - The green color value. A number between 0 and 255. + * @param {integer} blue - The blue color value. A number between 0 and 255. + * @param {integer} alpha - The alpha color value. A number between 0 and 255. + * + * @return {number} The combined color value. + */ +var GetColor32 = function (red, green, blue, alpha) +{ + return alpha << 24 | red << 16 | green << 8 | blue; +}; + +module.exports = GetColor32; + + +/***/ }), +/* 271 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts an RGB color value to HSV (hue, saturation and value). + * Conversion forumla from http://en.wikipedia.org/wiki/HSL_color_space. + * Assumes RGB values are contained in the set [0, 255] and returns h, s and v in the set [0, 1]. + * Based on code by Michael Jackson (https://github.com/mjijackson) + * + * @function Phaser.Display.Color.RGBToHSV + * @since 3.0.0 + * + * @param {integer} r - The red color value. A number between 0 and 255. + * @param {integer} g - The green color value. A number between 0 and 255. + * @param {integer} b - The blue color value. A number between 0 and 255. + * @param {(Phaser.Types.Display.HSVColorObject|Phaser.Display.Color)} [out] - An object to store the color values in. If not given an HSV Color Object will be created. + * + * @return {(Phaser.Types.Display.HSVColorObject|Phaser.Display.Color)} An object with the properties `h`, `s` and `v` set. + */ +var RGBToHSV = function (r, g, b, out) +{ + if (out === undefined) { out = { h: 0, s: 0, v: 0 }; } + + r /= 255; + g /= 255; + b /= 255; + + var min = Math.min(r, g, b); + var max = Math.max(r, g, b); + var d = max - min; + + // achromatic by default + var h = 0; + var s = (max === 0) ? 0 : d / max; + var v = max; + + if (max !== min) + { + if (max === r) + { + h = (g - b) / d + ((g < b) ? 6 : 0); + } + else if (max === g) + { + h = (b - r) / d + 2; + } + else if (max === b) + { + h = (r - g) / d + 4; + } + + h /= 6; + } + + if (out.hasOwnProperty('_h')) + { + out._h = h; + out._s = s; + out._v = v; + } + else + { + out.h = h; + out.s = s; + out.v = v; + } + + return out; +}; + +module.exports = RGBToHSV; + + +/***/ }), +/* 272 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Color = __webpack_require__(33); +var IntegerToRGB = __webpack_require__(273); + +/** + * Converts the given color value into an instance of a Color object. + * + * @function Phaser.Display.Color.IntegerToColor + * @since 3.0.0 + * + * @param {integer} input - The color value to convert into a Color object. + * + * @return {Phaser.Display.Color} A Color object. + */ +var IntegerToColor = function (input) +{ + var rgb = IntegerToRGB(input); + + return new Color(rgb.r, rgb.g, rgb.b, rgb.a); +}; + +module.exports = IntegerToColor; + + +/***/ }), +/* 273 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Return the component parts of a color as an Object with the properties alpha, red, green, blue. + * + * Alpha will only be set if it exists in the given color (0xAARRGGBB) + * + * @function Phaser.Display.Color.IntegerToRGB + * @since 3.0.0 + * + * @param {integer} input - The color value to convert into a Color object. + * + * @return {Phaser.Types.Display.ColorObject} An object with the red, green and blue values set in the r, g and b properties. + */ +var IntegerToRGB = function (color) +{ + if (color > 16777215) + { + // The color value has an alpha component + return { + a: color >>> 24, + r: color >> 16 & 0xFF, + g: color >> 8 & 0xFF, + b: color & 0xFF + }; + } + else + { + return { + a: 255, + r: color >> 16 & 0xFF, + g: color >> 8 & 0xFF, + b: color & 0xFF + }; + } +}; + +module.exports = IntegerToRGB; + + +/***/ }), +/* 274 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Color = __webpack_require__(33); + +/** + * Converts an object containing `r`, `g`, `b` and `a` properties into a Color class instance. + * + * @function Phaser.Display.Color.ObjectToColor + * @since 3.0.0 + * + * @param {Phaser.Types.Display.InputColorObject} input - An object containing `r`, `g`, `b` and `a` properties in the range 0 to 255. + * + * @return {Phaser.Display.Color} A Color object. + */ +var ObjectToColor = function (input) +{ + return new Color(input.r, input.g, input.b, input.a); +}; + +module.exports = ObjectToColor; + + +/***/ }), +/* 275 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Color = __webpack_require__(33); + +/** + * Converts a CSS 'web' string into a Phaser Color object. + * + * The web string can be in the format `'rgb(r,g,b)'` or `'rgba(r,g,b,a)'` where r/g/b are in the range [0..255] and a is in the range [0..1]. + * + * @function Phaser.Display.Color.RGBStringToColor + * @since 3.0.0 + * + * @param {string} rgb - The CSS format color string, using the `rgb` or `rgba` format. + * + * @return {Phaser.Display.Color} A Color object. + */ +var RGBStringToColor = function (rgb) +{ + var color = new Color(); + + var result = (/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/).exec(rgb.toLowerCase()); + + if (result) + { + var r = parseInt(result[1], 10); + var g = parseInt(result[2], 10); + var b = parseInt(result[3], 10); + var a = (result[4] !== undefined) ? parseFloat(result[4]) : 1; + + color.setTo(r, g, b, a * 255); + } + + return color; +}; + +module.exports = RGBStringToColor; + + +/***/ }), +/* 276 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Cameras.Scene2D.Effects + */ + +module.exports = { + + Fade: __webpack_require__(617), + Flash: __webpack_require__(618), + Pan: __webpack_require__(619), + Shake: __webpack_require__(652), + Zoom: __webpack_require__(653) + +}; + + +/***/ }), +/* 277 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Back + */ + +module.exports = { + + In: __webpack_require__(620), + Out: __webpack_require__(621), + InOut: __webpack_require__(622) + +}; + + +/***/ }), +/* 278 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(623), + Out: __webpack_require__(624), + InOut: __webpack_require__(625) + +}; + + +/***/ }), +/* 279 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(626), + Out: __webpack_require__(627), + InOut: __webpack_require__(628) + +}; + + +/***/ }), +/* 280 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(629), + Out: __webpack_require__(630), + InOut: __webpack_require__(631) + +}; + + +/***/ }), +/* 281 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(632), + Out: __webpack_require__(633), + InOut: __webpack_require__(634) + +}; + + +/***/ }), +/* 282 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(635), + Out: __webpack_require__(636), + InOut: __webpack_require__(637) + +}; + + +/***/ }), +/* 283 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Linear + */ + +module.exports = __webpack_require__(638); + + +/***/ }), +/* 284 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(639), + Out: __webpack_require__(640), + InOut: __webpack_require__(641) + +}; + + +/***/ }), +/* 285 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(642), + Out: __webpack_require__(643), + InOut: __webpack_require__(644) + +}; + + +/***/ }), +/* 286 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(645), + Out: __webpack_require__(646), + InOut: __webpack_require__(647) + +}; + + +/***/ }), +/* 287 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(648), + Out: __webpack_require__(649), + InOut: __webpack_require__(650) + +}; + + +/***/ }), +/* 288 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(651); + + +/***/ }), +/* 289 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(26); +var Device = __webpack_require__(290); +var GetFastValue = __webpack_require__(2); +var GetValue = __webpack_require__(6); +var IsPlainObject = __webpack_require__(7); +var PhaserMath = __webpack_require__(165); +var NOOP = __webpack_require__(1); +var DefaultPlugins = __webpack_require__(171); +var ValueToColor = __webpack_require__(159); + +/** + * @classdesc + * The active game configuration settings, parsed from a {@link Phaser.Types.Core.GameConfig} object. + * + * @class Config + * @memberof Phaser.Core + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.Core.GameConfig} [GameConfig] - The configuration object for your Phaser Game instance. + * + * @see Phaser.Game#config + */ +var Config = new Class({ + + initialize: + + function Config (config) + { + if (config === undefined) { config = {}; } + + var defaultBannerColor = [ + '#ff0000', + '#ffff00', + '#00ff00', + '#00ffff', + '#000000' + ]; + + var defaultBannerTextColor = '#ffffff'; + + /** + * @const {(integer|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels. + */ + this.width = GetValue(config, 'width', 1024); + + /** + * @const {(integer|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels. + */ + this.height = GetValue(config, 'height', 768); + + /** + * @const {(Phaser.Scale.ZoomType|integer)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager. + */ + this.zoom = GetValue(config, 'zoom', 1); + + /** + * @const {number} Phaser.Core.Config#resolution - The canvas device pixel resolution. Currently un-used. + */ + this.resolution = GetValue(config, 'resolution', 1); + + /** + * @const {?*} Phaser.Core.Config#parent - A parent DOM element into which the canvas created by the renderer will be injected. + */ + this.parent = GetValue(config, 'parent', undefined); + + /** + * @const {Phaser.Scale.ScaleModeType} Phaser.Core.Config#scaleMode - The scale mode as used by the Scale Manager. The default is zero, which is no scaling. + */ + this.scaleMode = GetValue(config, 'scaleMode', 0); + + /** + * @const {boolean} Phaser.Core.Config#expandParent - Is the Scale Manager allowed to adjust the CSS height property of the parent to be 100%? + */ + this.expandParent = GetValue(config, 'expandParent', true); + + /** + * @const {integer} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. + */ + this.autoRound = GetValue(config, 'autoRound', false); + + /** + * @const {Phaser.Scale.CenterType} Phaser.Core.Config#autoCenter - Automatically center the canvas within the parent? + */ + this.autoCenter = GetValue(config, 'autoCenter', 0); + + /** + * @const {integer} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed? + */ + this.resizeInterval = GetValue(config, 'resizeInterval', 500); + + /** + * @const {?(HTMLElement|string)} Phaser.Core.Config#fullscreenTarget - The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. + */ + this.fullscreenTarget = GetValue(config, 'fullscreenTarget', null); + + /** + * @const {integer} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. + */ + this.minWidth = GetValue(config, 'minWidth', 0); + + /** + * @const {integer} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. + */ + this.maxWidth = GetValue(config, 'maxWidth', 0); + + /** + * @const {integer} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. + */ + this.minHeight = GetValue(config, 'minHeight', 0); + + /** + * @const {integer} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. + */ + this.maxHeight = GetValue(config, 'maxHeight', 0); + + // Scale Manager - Anything set in here over-rides anything set above + + var scaleConfig = GetValue(config, 'scale', null); + + if (scaleConfig) + { + this.width = GetValue(scaleConfig, 'width', this.width); + this.height = GetValue(scaleConfig, 'height', this.height); + this.zoom = GetValue(scaleConfig, 'zoom', this.zoom); + this.resolution = GetValue(scaleConfig, 'resolution', this.resolution); + this.parent = GetValue(scaleConfig, 'parent', this.parent); + this.scaleMode = GetValue(scaleConfig, 'mode', this.scaleMode); + this.expandParent = GetValue(scaleConfig, 'expandParent', this.expandParent); + this.autoRound = GetValue(scaleConfig, 'autoRound', this.autoRound); + this.autoCenter = GetValue(scaleConfig, 'autoCenter', this.autoCenter); + this.resizeInterval = GetValue(scaleConfig, 'resizeInterval', this.resizeInterval); + this.fullscreenTarget = GetValue(scaleConfig, 'fullscreenTarget', this.fullscreenTarget); + this.minWidth = GetValue(scaleConfig, 'min.width', this.minWidth); + this.maxWidth = GetValue(scaleConfig, 'max.width', this.maxWidth); + this.minHeight = GetValue(scaleConfig, 'min.height', this.minHeight); + this.maxHeight = GetValue(scaleConfig, 'max.height', this.maxHeight); + } + + /** + * @const {number} Phaser.Core.Config#renderType - Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default) + */ + this.renderType = GetValue(config, 'type', CONST.AUTO); + + /** + * @const {?HTMLCanvasElement} Phaser.Core.Config#canvas - Force Phaser to use your own Canvas element instead of creating one. + */ + this.canvas = GetValue(config, 'canvas', null); + + /** + * @const {?(CanvasRenderingContext2D|WebGLRenderingContext)} Phaser.Core.Config#context - Force Phaser to use your own Canvas context instead of creating one. + */ + this.context = GetValue(config, 'context', null); + + /** + * @const {?string} Phaser.Core.Config#canvasStyle - Optional CSS attributes to be set on the canvas object created by the renderer. + */ + this.canvasStyle = GetValue(config, 'canvasStyle', null); + + /** + * @const {boolean} Phaser.Core.Config#customEnvironment - Is Phaser running under a custom (non-native web) environment? If so, set this to `true` to skip internal Feature detection. If `true` the `renderType` cannot be left as `AUTO`. + */ + this.customEnvironment = GetValue(config, 'customEnvironment', false); + + /** + * @const {?object} Phaser.Core.Config#sceneConfig - The default Scene configuration object. + */ + this.sceneConfig = GetValue(config, 'scene', null); + + /** + * @const {string[]} Phaser.Core.Config#seed - A seed which the Random Data Generator will use. If not given, a dynamic seed based on the time is used. + */ + this.seed = GetValue(config, 'seed', [ (Date.now() * Math.random()).toString() ]); + + PhaserMath.RND = new PhaserMath.RandomDataGenerator(this.seed); + + /** + * @const {string} Phaser.Core.Config#gameTitle - The title of the game. + */ + this.gameTitle = GetValue(config, 'title', ''); + + /** + * @const {string} Phaser.Core.Config#gameURL - The URL of the game. + */ + this.gameURL = GetValue(config, 'url', 'https://phaser.io'); + + /** + * @const {string} Phaser.Core.Config#gameVersion - The version of the game. + */ + this.gameVersion = GetValue(config, 'version', ''); + + /** + * @const {boolean} Phaser.Core.Config#autoFocus - If `true` the window will automatically be given focus immediately and on any future mousedown event. + */ + this.autoFocus = GetValue(config, 'autoFocus', true); + + // DOM Element Container + + /** + * @const {?boolean} Phaser.Core.Config#domCreateContainer - Should the game create a div element to act as a DOM Container? Only enable if you're using DOM Element objects. You must provide a parent object if you use this feature. + */ + this.domCreateContainer = GetValue(config, 'dom.createContainer', false); + + /** + * @const {?boolean} Phaser.Core.Config#domBehindCanvas - Should the DOM Container that is created (if `dom.createContainer` is true) be positioned behind (true) or over the top (false, the default) of the game canvas? + */ + this.domBehindCanvas = GetValue(config, 'dom.behindCanvas', false); + + // Input + + /** + * @const {boolean} Phaser.Core.Config#inputKeyboard - Enable the Keyboard Plugin. This can be disabled in games that don't need keyboard input. + */ + this.inputKeyboard = GetValue(config, 'input.keyboard', true); + + /** + * @const {*} Phaser.Core.Config#inputKeyboardEventTarget - The DOM Target to listen for keyboard events on. Defaults to `window` if not specified. + */ + this.inputKeyboardEventTarget = GetValue(config, 'input.keyboard.target', window); + + /** + * @const {?integer[]} Phaser.Core.Config#inputKeyboardCapture - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty. + */ + this.inputKeyboardCapture = GetValue(config, 'input.keyboard.capture', []); + + /** + * @const {(boolean|object)} Phaser.Core.Config#inputMouse - Enable the Mouse Plugin. This can be disabled in games that don't need mouse input. + */ + this.inputMouse = GetValue(config, 'input.mouse', true); + + /** + * @const {?*} Phaser.Core.Config#inputMouseEventTarget - The DOM Target to listen for mouse events on. Defaults to the game canvas if not specified. + */ + this.inputMouseEventTarget = GetValue(config, 'input.mouse.target', null); + + /** + * @const {boolean} Phaser.Core.Config#inputMouseCapture - Should mouse events be captured? I.e. have prevent default called on them. + */ + this.inputMouseCapture = GetValue(config, 'input.mouse.capture', true); + + /** + * @const {boolean} Phaser.Core.Config#inputTouch - Enable the Touch Plugin. This can be disabled in games that don't need touch input. + */ + this.inputTouch = GetValue(config, 'input.touch', Device.input.touch); + + /** + * @const {?*} Phaser.Core.Config#inputTouchEventTarget - The DOM Target to listen for touch events on. Defaults to the game canvas if not specified. + */ + this.inputTouchEventTarget = GetValue(config, 'input.touch.target', null); + + /** + * @const {boolean} Phaser.Core.Config#inputTouchCapture - Should touch events be captured? I.e. have prevent default called on them. + */ + this.inputTouchCapture = GetValue(config, 'input.touch.capture', true); + + /** + * @const {integer} Phaser.Core.Config#inputActivePointers - The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1. + */ + this.inputActivePointers = GetValue(config, 'input.activePointers', 1); + + /** + * @const {integer} Phaser.Core.Config#inputSmoothFactor - The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. + */ + this.inputSmoothFactor = GetValue(config, 'input.smoothFactor', 0); + + /** + * @const {boolean} Phaser.Core.Config#inputWindowEvents - Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire. + */ + this.inputWindowEvents = GetValue(config, 'input.windowEvents', true); + + /** + * @const {boolean} Phaser.Core.Config#inputGamepad - Enable the Gamepad Plugin. This can be disabled in games that don't need gamepad input. + */ + this.inputGamepad = GetValue(config, 'input.gamepad', false); + + /** + * @const {*} Phaser.Core.Config#inputGamepadEventTarget - The DOM Target to listen for gamepad events on. Defaults to `window` if not specified. + */ + this.inputGamepadEventTarget = GetValue(config, 'input.gamepad.target', window); + + /** + * @const {boolean} Phaser.Core.Config#disableContextMenu - Set to `true` to disable the right-click context menu. + */ + this.disableContextMenu = GetValue(config, 'disableContextMenu', false); + + /** + * @const {Phaser.Types.Core.AudioConfig} Phaser.Core.Config#audio - The Audio Configuration object. + */ + this.audio = GetValue(config, 'audio'); + + // If you do: { banner: false } it won't display any banner at all + + /** + * @const {boolean} Phaser.Core.Config#hideBanner - Don't write the banner line to the console.log. + */ + this.hideBanner = (GetValue(config, 'banner', null) === false); + + /** + * @const {boolean} Phaser.Core.Config#hidePhaser - Omit Phaser's name and version from the banner. + */ + this.hidePhaser = GetValue(config, 'banner.hidePhaser', false); + + /** + * @const {string} Phaser.Core.Config#bannerTextColor - The color of the banner text. + */ + this.bannerTextColor = GetValue(config, 'banner.text', defaultBannerTextColor); + + /** + * @const {string[]} Phaser.Core.Config#bannerBackgroundColor - The background colors of the banner. + */ + this.bannerBackgroundColor = GetValue(config, 'banner.background', defaultBannerColor); + + if (this.gameTitle === '' && this.hidePhaser) + { + this.hideBanner = true; + } + + /** + * @const {?Phaser.Types.Core.FPSConfig} Phaser.Core.Config#fps - The Frame Rate Configuration object, as parsed by the Timestep class. + */ + this.fps = GetValue(config, 'fps', null); + + // Renderer Settings + // These can either be in a `render` object within the Config, or specified on their own + + var renderConfig = GetValue(config, 'render', config); + + /** + * @const {boolean} Phaser.Core.Config#antialias - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. + */ + this.antialias = GetValue(renderConfig, 'antialias', true); + + /** + * @const {boolean} Phaser.Core.Config#desynchronized - When set to `true` it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details. + */ + this.desynchronized = GetValue(renderConfig, 'desynchronized', false); + + /** + * @const {boolean} Phaser.Core.Config#roundPixels - Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. + */ + this.roundPixels = GetValue(renderConfig, 'roundPixels', false); + + /** + * @const {boolean} Phaser.Core.Config#pixelArt - Prevent pixel art from becoming blurred when scaled. It will remain crisp (tells the WebGL renderer to automatically create textures using a linear filter mode). + */ + this.pixelArt = GetValue(renderConfig, 'pixelArt', this.zoom !== 1); + + if (this.pixelArt) + { + this.antialias = false; + this.roundPixels = true; + } + + /** + * @const {boolean} Phaser.Core.Config#transparent - Whether the game canvas will have a transparent background. + */ + this.transparent = GetValue(renderConfig, 'transparent', false); + + /** + * @const {boolean} Phaser.Core.Config#clearBeforeRender - Whether the game canvas will be cleared between each rendering frame. You can disable this if you have a full-screen background image or game object. + */ + this.clearBeforeRender = GetValue(renderConfig, 'clearBeforeRender', true); + + /** + * @const {boolean} Phaser.Core.Config#premultipliedAlpha - In WebGL mode, sets the drawing buffer to contain colors with pre-multiplied alpha. + */ + this.premultipliedAlpha = GetValue(renderConfig, 'premultipliedAlpha', true); + + /** + * @const {boolean} Phaser.Core.Config#failIfMajorPerformanceCaveat - Let the browser abort creating a WebGL context if it judges performance would be unacceptable. + */ + this.failIfMajorPerformanceCaveat = GetValue(renderConfig, 'failIfMajorPerformanceCaveat', false); + + /** + * @const {string} Phaser.Core.Config#powerPreference - "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. + */ + this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default'); + + /** + * @const {integer} Phaser.Core.Config#batchSize - The default WebGL Batch size. + */ + this.batchSize = GetValue(renderConfig, 'batchSize', 2000); + + /** + * @const {integer} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. + */ + this.maxLights = GetValue(renderConfig, 'maxLights', 10); + + var bgc = GetValue(config, 'backgroundColor', 0); + + /** + * @const {Phaser.Display.Color} Phaser.Core.Config#backgroundColor - The background color of the game canvas. The default is black. This value is ignored if `transparent` is set to `true`. + */ + this.backgroundColor = ValueToColor(bgc); + + if (bgc === 0 && this.transparent) + { + this.backgroundColor.alpha = 0; + } + + /** + * @const {Phaser.Types.Core.BootCallback} Phaser.Core.Config#preBoot - Called before Phaser boots. Useful for initializing anything not related to Phaser that Phaser may require while booting. + */ + this.preBoot = GetValue(config, 'callbacks.preBoot', NOOP); + + /** + * @const {Phaser.Types.Core.BootCallback} Phaser.Core.Config#postBoot - A function to run at the end of the boot sequence. At this point, all the game systems have started and plugins have been loaded. + */ + this.postBoot = GetValue(config, 'callbacks.postBoot', NOOP); + + /** + * @const {Phaser.Types.Core.PhysicsConfig} Phaser.Core.Config#physics - The Physics Configuration object. + */ + this.physics = GetValue(config, 'physics', {}); + + /** + * @const {(boolean|string)} Phaser.Core.Config#defaultPhysicsSystem - The default physics system. It will be started for each scene. Either 'arcade', 'impact' or 'matter'. + */ + this.defaultPhysicsSystem = GetValue(this.physics, 'default', false); + + /** + * @const {string} Phaser.Core.Config#loaderBaseURL - A URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'. + */ + this.loaderBaseURL = GetValue(config, 'loader.baseURL', ''); + + /** + * @const {string} Phaser.Core.Config#loaderPath - A URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'. + */ + this.loaderPath = GetValue(config, 'loader.path', ''); + + /** + * @const {integer} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). + */ + this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', 32); + + /** + * @const {(string|undefined)} Phaser.Core.Config#loaderCrossOrigin - 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. + */ + this.loaderCrossOrigin = GetValue(config, 'loader.crossOrigin', undefined); + + /** + * @const {string} Phaser.Core.Config#loaderResponseType - The response type of the XHR request, e.g. `blob`, `text`, etc. + */ + this.loaderResponseType = GetValue(config, 'loader.responseType', ''); + + /** + * @const {boolean} Phaser.Core.Config#loaderAsync - Should the XHR request use async or not? + */ + this.loaderAsync = GetValue(config, 'loader.async', true); + + /** + * @const {string} Phaser.Core.Config#loaderUser - Optional username for all XHR requests. + */ + this.loaderUser = GetValue(config, 'loader.user', ''); + + /** + * @const {string} Phaser.Core.Config#loaderPassword - Optional password for all XHR requests. + */ + this.loaderPassword = GetValue(config, 'loader.password', ''); + + /** + * @const {integer} Phaser.Core.Config#loaderTimeout - Optional XHR timeout value, in ms. + */ + this.loaderTimeout = GetValue(config, 'loader.timeout', 0); + + /* + * Allows `plugins` property to either be an array, in which case it just replaces + * the default plugins like previously, or a config object. + * + * plugins: { + * global: [ + * { key: 'TestPlugin', plugin: TestPlugin, start: true, data: { msg: 'The plugin is alive' } }, + * ], + * scene: [ + * { key: 'WireFramePlugin', plugin: WireFramePlugin, systemKey: 'wireFramePlugin', sceneKey: 'wireframe' } + * ], + * default: [], OR + * defaultMerge: [ + * 'ModPlayer' + * ] + * } + */ + + /** + * @const {any} Phaser.Core.Config#installGlobalPlugins - An array of global plugins to be installed. + */ + this.installGlobalPlugins = []; + + /** + * @const {any} Phaser.Core.Config#installScenePlugins - An array of Scene level plugins to be installed. + */ + this.installScenePlugins = []; + + var plugins = GetValue(config, 'plugins', null); + var defaultPlugins = DefaultPlugins.DefaultScene; + + if (plugins) + { + // Old 3.7 array format? + if (Array.isArray(plugins)) + { + this.defaultPlugins = plugins; + } + else if (IsPlainObject(plugins)) + { + this.installGlobalPlugins = GetFastValue(plugins, 'global', []); + this.installScenePlugins = GetFastValue(plugins, 'scene', []); + + if (Array.isArray(plugins.default)) + { + defaultPlugins = plugins.default; + } + else if (Array.isArray(plugins.defaultMerge)) + { + defaultPlugins = defaultPlugins.concat(plugins.defaultMerge); + } + } + } + + /** + * @const {any} Phaser.Core.Config#defaultPlugins - The plugins installed into every Scene (in addition to CoreScene and Global). + */ + this.defaultPlugins = defaultPlugins; + + // Default / Missing Images + var pngPrefix = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg'; + + /** + * @const {string} Phaser.Core.Config#defaultImage - A base64 encoded PNG that will be used as the default blank texture. + */ + this.defaultImage = GetValue(config, 'images.default', pngPrefix + 'AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=='); + + /** + * @const {string} Phaser.Core.Config#missingImage - A base64 encoded PNG that will be used as the default texture when a texture is assigned that is missing or not loaded. + */ + this.missingImage = GetValue(config, 'images.missing', pngPrefix + 'CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=='); + + if (window) + { + if (window.FORCE_WEBGL) + { + this.renderType = CONST.WEBGL; + } + else if (window.FORCE_CANVAS) + { + this.renderType = CONST.CANVAS; + } + } + } + +}); + +module.exports = Config; + + +/***/ }), +/* 290 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// This singleton is instantiated as soon as Phaser loads, +// before a Phaser.Game instance has even been created. +// Which means all instances of Phaser Games can share it, +// without having to re-poll the device all over again + +/** + * @namespace Phaser.Device + * @since 3.0.0 + */ + +/** + * @typedef {object} Phaser.DeviceConf + * + * @property {Phaser.Device.OS} os - The OS Device functions. + * @property {Phaser.Device.Browser} browser - The Browser Device functions. + * @property {Phaser.Device.Features} features - The Features Device functions. + * @property {Phaser.Device.Input} input - The Input Device functions. + * @property {Phaser.Device.Audio} audio - The Audio Device functions. + * @property {Phaser.Device.Video} video - The Video Device functions. + * @property {Phaser.Device.Fullscreen} fullscreen - The Fullscreen Device functions. + * @property {Phaser.Device.CanvasFeatures} canvasFeatures - The Canvas Device functions. + */ + +module.exports = { + + os: __webpack_require__(115), + browser: __webpack_require__(116), + features: __webpack_require__(164), + input: __webpack_require__(682), + audio: __webpack_require__(683), + video: __webpack_require__(684), + fullscreen: __webpack_require__(685), + canvasFeatures: __webpack_require__(291) + +}; + + +/***/ }), +/* 291 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(24); + +/** + * Determines the canvas features of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.canvasFeatures` from within any Scene. + * + * @typedef {object} Phaser.Device.CanvasFeatures + * @since 3.0.0 + * + * @property {boolean} supportInverseAlpha - Set to true if the browser supports inversed alpha. + * @property {boolean} supportNewBlendModes - Set to true if the browser supports new canvas blend modes. + */ +var CanvasFeatures = { + + supportInverseAlpha: false, + supportNewBlendModes: false + +}; + +function checkBlendMode () +{ + var pngHead = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/'; + var pngEnd = 'AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg=='; + + var magenta = new Image(); + + magenta.onload = function () + { + var yellow = new Image(); + + yellow.onload = function () + { + var canvas = CanvasPool.create(yellow, 6, 1); + var context = canvas.getContext('2d'); + + context.globalCompositeOperation = 'multiply'; + + context.drawImage(magenta, 0, 0); + context.drawImage(yellow, 2, 0); + + if (!context.getImageData(2, 0, 1, 1)) + { + return false; + } + + var data = context.getImageData(2, 0, 1, 1).data; + + CanvasPool.remove(yellow); + + CanvasFeatures.supportNewBlendModes = (data[0] === 255 && data[1] === 0 && data[2] === 0); + }; + + yellow.src = pngHead + '/wCKxvRF' + pngEnd; + }; + + magenta.src = pngHead + 'AP804Oa6' + pngEnd; + + return false; +} + +function checkInverseAlpha () +{ + var canvas = CanvasPool.create(this, 2, 1); + var context = canvas.getContext('2d'); + + context.fillStyle = 'rgba(10, 20, 30, 0.5)'; + + // Draw a single pixel + context.fillRect(0, 0, 1, 1); + + // Get the color values + var s1 = context.getImageData(0, 0, 1, 1); + + if (s1 === null) + { + return false; + } + + // Plot them to x2 + context.putImageData(s1, 1, 0); + + // Get those values + var s2 = context.getImageData(1, 0, 1, 1); + + // Compare and return + return (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]); +} + +function init () +{ + if (document !== undefined) + { + CanvasFeatures.supportNewBlendModes = checkBlendMode(); + CanvasFeatures.supportInverseAlpha = checkInverseAlpha(); + } + + return CanvasFeatures; +} + +module.exports = init(); + + +/***/ }), +/* 292 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * @function Phaser.Math.Angle.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The angle in radians. + */ +var Between = function (x1, y1, x2, y2) +{ + return Math.atan2(y2 - y1, x2 - x1); +}; + +module.exports = Between; + + +/***/ }), +/* 293 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Normalize an angle to the [0, 2pi] range. + * + * @function Phaser.Math.Angle.Normalize + * @since 3.0.0 + * + * @param {number} angle - The angle to normalize, in radians. + * + * @return {number} The normalized angle, in radians. + */ +var Normalize = function (angle) +{ + angle = angle % (2 * Math.PI); + + if (angle >= 0) + { + return angle; + } + else + { + return angle + 2 * Math.PI; + } +}; + +module.exports = Normalize; + + +/***/ }), +/* 294 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points), squared. + * + * @function Phaser.Math.Distance.Squared + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The distance between each point, squared. + */ +var DistanceSquared = function (x1, y1, x2, y2) +{ + var dx = x1 - x2; + var dy = y1 - y2; + + return dx * dx + dy * dy; +}; + +module.exports = DistanceSquared; + + +/***/ }), +/* 295 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether `a` is fuzzily greater than `b`. + * + * `a` is fuzzily greater than `b` if it is more than `b - epsilon`. + * + * @function Phaser.Math.Fuzzy.GreaterThan + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`. + */ +var GreaterThan = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return a > b - epsilon; +}; + +module.exports = GreaterThan; + + +/***/ }), +/* 296 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether `a` is fuzzily less than `b`. + * + * `a` is fuzzily less than `b` if it is less than `b + epsilon`. + * + * @function Phaser.Math.Fuzzy.LessThan + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`. + */ +var LessThan = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return a < b + epsilon; +}; + +module.exports = LessThan; + + +/***/ }), +/* 297 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(298); + +/** + * [description] + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - [description] + * @param {number} i - [description] + * + * @return {number} [description] + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), +/* 298 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the factorial of a given number for integer values greater than 0. + * + * @function Phaser.Math.Factorial + * @since 3.0.0 + * + * @param {number} value - A positive integer to calculate the factorial of. + * + * @return {number} The factorial of the given number. + */ +var Factorial = function (value) +{ + if (value === 0) + { + return 1; + } + + var res = value; + + while (--value) + { + res *= value; + } + + return res; +}; + +module.exports = Factorial; + + +/***/ }), +/* 299 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function P0 (t, p) +{ + var k = 1 - t; + + return k * k * k * p; +} + +/** + * @ignore + */ +function P1 (t, p) +{ + var k = 1 - t; + + return 3 * k * k * t * p; +} + +/** + * @ignore + */ +function P2 (t, p) +{ + return 3 * (1 - t) * t * t * p; +} + +/** + * @ignore + */ +function P3 (t, p) +{ + return t * t * t * p; +} + +/** + * A cubic bezier interpolation method. + * + * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a + * + * @function Phaser.Math.Interpolation.CubicBezier + * @since 3.0.0 + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} p0 - The start point. + * @param {number} p1 - The first control point. + * @param {number} p2 - The second control point. + * @param {number} p3 - The end point. + * + * @return {number} The interpolated value. + */ +var CubicBezierInterpolation = function (t, p0, p1, p2, p3) +{ + return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3); +}; + +module.exports = CubicBezierInterpolation; + + +/***/ }), +/* 300 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function P0 (t, p) +{ + var k = 1 - t; + + return k * k * p; +} + +/** + * @ignore + */ +function P1 (t, p) +{ + return 2 * (1 - t) * t * p; +} + +/** + * @ignore + */ +function P2 (t, p) +{ + return t * t * p; +} + +// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js + +/** + * A quadratic bezier interpolation method. + * + * @function Phaser.Math.Interpolation.QuadraticBezier + * @since 3.2.0 + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} p0 - The start point. + * @param {number} p1 - The control point. + * @param {number} p2 - The end point. + * + * @return {number} The interpolated value. + */ +var QuadraticBezierInterpolation = function (t, p0, p1, p2) +{ + return P0(t, p0) + P1(t, p1) + P2(t, p2); +}; + +module.exports = QuadraticBezierInterpolation; + + +/***/ }), +/* 301 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmoothStep = __webpack_require__(156); + +/** + * A Smooth Step interpolation method. + * + * @function Phaser.Math.Interpolation.SmoothStep + * @since 3.9.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep} + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The interpolated value. + */ +var SmoothStepInterpolation = function (t, min, max) +{ + return min + (max - min) * SmoothStep(t, 0, 1); +}; + +module.exports = SmoothStepInterpolation; + + +/***/ }), +/* 302 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the nearest power of 2 to the given `value`. + * + * @function Phaser.Math.Pow2.GetPowerOfTwo + * @since 3.0.0 + * + * @param {number} value - The value. + * + * @return {integer} The nearest power of 2 to `value`. + */ +var GetPowerOfTwo = function (value) +{ + var index = Math.log(value) / 0.6931471805599453; + + return (1 << Math.ceil(index)); +}; + +module.exports = GetPowerOfTwo; + + +/***/ }), +/* 303 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using ceil. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. + * As will `14` snap to `15`... but `16` will snap to `20`. + * + * @function Phaser.Math.Snap.Ceil + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapCeil = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.ceil(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapCeil; + + +/***/ }), +/* 304 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive. + * + * @function Phaser.Math.FloatBetween + * @since 3.0.0 + * + * @param {number} min - The lower bound for the float, inclusive. + * @param {number} max - The upper bound for the float exclusive. + * + * @return {number} A random float within the given range. + */ +var FloatBetween = function (min, max) +{ + return Math.random() * (max - min) + min; +}; + +module.exports = FloatBetween; + + +/***/ }), +/* 305 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction. + * + * @function Phaser.Math.Rotate + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} angle - The angle to be rotated by in an anticlockwise direction. + * + * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction. + */ +var Rotate = function (point, angle) +{ + var x = point.x; + var y = point.y; + + point.x = (x * Math.cos(angle)) - (y * Math.sin(angle)); + point.y = (x * Math.sin(angle)) + (y * Math.cos(angle)); + + return point; +}; + +module.exports = Rotate; + + +/***/ }), +/* 306 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. + * + * @function Phaser.Math.RoundAwayFromZero + * @since 3.0.0 + * + * @param {number} value - The number to round. + * + * @return {number} The rounded number, rounded away from zero. + */ +var RoundAwayFromZero = function (value) +{ + // "Opposite" of truncate. + return (value > 0) ? Math.ceil(value) : Math.floor(value); +}; + +module.exports = RoundAwayFromZero; + + +/***/ }), +/* 307 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(4); + +/** + * Takes the `x` and `y` coordinates and transforms them into the same space as + * defined by the position, rotation and scale values. + * + * @function Phaser.Math.TransformXY + * @since 3.0.0 + * + * @param {number} x - The x coordinate to be transformed. + * @param {number} y - The y coordinate to be transformed. + * @param {number} positionX - Horizontal position of the transform point. + * @param {number} positionY - Vertical position of the transform point. + * @param {number} rotation - Rotation of the transform point, in radians. + * @param {number} scaleX - Horizontal scale of the transform point. + * @param {number} scaleY - Vertical scale of the transform point. + * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. + * + * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. + */ +var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) +{ + if (output === undefined) { output = new Vector2(); } + + var radianSin = Math.sin(rotation); + var radianCos = Math.cos(rotation); + + // Rotate and Scale + var a = radianCos * scaleX; + var b = radianSin * scaleX; + var c = -radianSin * scaleY; + var d = radianCos * scaleY; + + // Invert + var id = 1 / ((a * d) + (c * -b)); + + output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); + output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); + + return output; +}; + +module.exports = TransformXY; + + +/***/ }), +/* 308 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A representation of a vector in 4D space. + * + * A four-component vector. + * + * @class Vector4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + * @param {number} [w] - The w component. + */ +var Vector4 = new Class({ + + initialize: + + function Vector4 (x, y, z, w) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector4#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector4#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector4#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + /** + * The w component of this Vector. + * + * @name Phaser.Math.Vector4#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.w = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; + } + }, + + /** + * Make a clone of this Vector4. + * + * @method Phaser.Math.Vector4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} A clone of this Vector4. + */ + clone: function () + { + return new Vector4(this.x, this.y, this.z, this.w); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + this.w = src.w || 0; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict quality check against each Vector's components. + * + * @method Phaser.Math.Vector4#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The vector to check equality with. + * + * @return {boolean} A boolean indicating whether the two Vectors are equal or not. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w)); + }, + + /** + * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values. + * + * @method Phaser.Math.Vector4#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components. + * @param {number} y - The y value to set for this Vector. + * @param {number} z - The z value to set for this Vector. + * @param {number} w - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + set: function (x, y, z, w) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; + } + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector4#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + this.w += v.w || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector4#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + this.w -= v.w || 0; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector4#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + scale: function (scale) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + this.w *= scale; + + return this; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector4#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return Math.sqrt(x * x + y * y + z * z + w * w); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector4#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return x * x + y * y + z * z + w * w; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector4#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + this.w = w * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector4#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4. + * + * @return {number} The dot product of this Vector and the given Vector. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector4#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + this.w = aw + t * (v.w - aw); + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector4#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + this.w *= v.w || 1; + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector4#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + this.w /= v.w || 1; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector4#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + var dw = v.w - this.w || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector4#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + var dw = v.w - this.w || 0; + + return dx * dx + dy * dy + dz * dz + dw * dw; + }, + + /** + * Negate the `x`, `y`, `z` and `w` components of this Vector. + * + * @method Phaser.Math.Vector4#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + this.w = -this.w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector4#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w; + this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector4#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + transformQuat: function (q) + { + // TODO: is this really the same as Vector3? + // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/ + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Make this Vector the zero vector (0, 0, 0, 0). + * + * @method Phaser.Math.Vector4#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector4} This Vector4. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 0; + + return this; + } + +}); + +// TODO: Check if these are required internally, if not, remove. +Vector4.prototype.sub = Vector4.prototype.subtract; +Vector4.prototype.mul = Vector4.prototype.multiply; +Vector4.prototype.div = Vector4.prototype.divide; +Vector4.prototype.dist = Vector4.prototype.distance; +Vector4.prototype.distSq = Vector4.prototype.distanceSq; +Vector4.prototype.len = Vector4.prototype.length; +Vector4.prototype.lenSq = Vector4.prototype.lengthSq; + +module.exports = Vector4; + + +/***/ }), +/* 309 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A three-dimensional matrix. + * + * Defaults to the identity matrix when instantiated. + * + * @class Matrix3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. + */ +var Matrix3 = new Class({ + + initialize: + + function Matrix3 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix3#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(9); + + if (m) + { + // Assume Matrix3 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix3. + * + * @method Phaser.Math.Matrix3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} A clone of this Matrix3. + */ + clone: function () + { + return new Matrix3(this); + }, + + /** + * This method is an alias for `Matrix3.copy`. + * + * @method Phaser.Math.Matrix3#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix3#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + copy: function (src) + { + var out = this.val; + var a = src.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Copy the values of a given Matrix4 into this Matrix3. + * + * @method Phaser.Math.Matrix3#fromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromMat4: function (m) + { + var a = m.val; + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix3#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromArray: function (a) + { + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix3#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix3#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + transpose: function () + { + var a = this.val; + var a01 = a[1]; + var a02 = a[2]; + var a12 = a[5]; + + a[1] = a[3]; + a[2] = a[6]; + a[3] = a01; + a[5] = a[7]; + a[6] = a02; + a[7] = a12; + + return this; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix3#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; + + // Calculate the determinant + var det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) + { + return null; + } + + det = 1 / det; + + a[0] = b01 * det; + a[1] = (-a22 * a01 + a02 * a21) * det; + a[2] = (a12 * a01 - a02 * a11) * det; + a[3] = b11 * det; + a[4] = (a22 * a00 - a02 * a20) * det; + a[5] = (-a12 * a00 + a02 * a10) * det; + a[6] = b21 * det; + a[7] = (-a21 * a00 + a01 * a20) * det; + a[8] = (a11 * a00 - a01 * a10) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix3#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + a[0] = (a11 * a22 - a12 * a21); + a[1] = (a02 * a21 - a01 * a22); + a[2] = (a01 * a12 - a02 * a11); + a[3] = (a12 * a20 - a10 * a22); + a[4] = (a00 * a22 - a02 * a20); + a[5] = (a02 * a10 - a00 * a12); + a[6] = (a10 * a21 - a11 * a20); + a[7] = (a01 * a20 - a00 * a21); + a[8] = (a00 * a11 - a01 * a10); + + return this; + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix3#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix3#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b = src.val; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b10 = b[3]; + var b11 = b[4]; + var b12 = b[5]; + var b20 = b[6]; + var b21 = b[7]; + var b22 = b[8]; + + a[0] = b00 * a00 + b01 * a10 + b02 * a20; + a[1] = b00 * a01 + b01 * a11 + b02 * a21; + a[2] = b00 * a02 + b01 * a12 + b02 * a22; + + a[3] = b10 * a00 + b11 * a10 + b12 * a20; + a[4] = b10 * a01 + b11 * a11 + b12 * a21; + a[5] = b10 * a02 + b11 * a12 + b12 * a22; + + a[6] = b20 * a00 + b21 * a10 + b22 * a20; + a[7] = b20 * a01 + b21 * a11 + b22 * a21; + a[8] = b20 * a02 + b21 * a12 + b22 * a22; + + return this; + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix3#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + translate: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[6] = x * a[0] + y * a[3] + a[6]; + a[7] = x * a[1] + y * a[4] + a[7]; + a[8] = x * a[2] + y * a[5] + a[8]; + + return this; + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix3#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + rotate: function (rad) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + + var s = Math.sin(rad); + var c = Math.cos(rad); + + a[0] = c * a00 + s * a10; + a[1] = c * a01 + s * a11; + a[2] = c * a02 + s * a12; + + a[3] = c * a10 - s * a00; + a[4] = c * a11 - s * a01; + a[5] = c * a12 - s * a02; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x` and `y` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix3#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + scale: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[0] = x * a[0]; + a[1] = x * a[1]; + a[2] = x * a[2]; + + a[3] = y * a[3]; + a[4] = y * a[4]; + a[5] = y * a[5]; + + return this; + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix3#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + var out = this.val; + + out[0] = 1 - (yy + zz); + out[3] = xy + wz; + out[6] = xz - wy; + + out[1] = xy - wz; + out[4] = 1 - (xx + zz); + out[7] = yz + wx; + + out[2] = xz + wy; + out[5] = yz - wx; + out[8] = 1 - (xx + yy); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - [description] + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + normalFromMat4: function (m) + { + var a = m.val; + var out = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return null; + } + + det = 1 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + + return this; + } + +}); + +module.exports = Matrix3; + + +/***/ }), +/* 310 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * @class Matrix4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. + */ +var Matrix4 = new Class({ + + initialize: + + function Matrix4 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix4#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(16); + + if (m) + { + // Assume Matrix4 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix4. + * + * @method Phaser.Math.Matrix4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} A clone of this Matrix4. + */ + clone: function () + { + return new Matrix4(this); + }, + + // TODO - Should work with basic values + + /** + * This method is an alias for `Matrix4.copy`. + * + * @method Phaser.Math.Matrix4#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + copy: function (src) + { + var out = this.val; + var a = src.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + fromArray: function (a) + { + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + out[9] = a[9]; + out[10] = a[10]; + out[11] = a[11]; + out[12] = a[12]; + out[13] = a[13]; + out[14] = a[14]; + out[15] = a[15]; + + return this; + }, + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + * + * @method Phaser.Math.Matrix4#zero + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + zero: function () + { + var out = this.val; + + out[0] = 0; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 0; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 0; + + return this; + }, + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * + * @method Phaser.Math.Matrix4#xyz + * @since 3.0.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} z - The z value. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + xyz: function (x, y, z) + { + this.identity(); + + var out = this.val; + + out[12] = x; + out[13] = y; + out[14] = z; + + return this; + }, + + /** + * Set the scaling values of this Matrix. + * + * @method Phaser.Math.Matrix4#scaling + * @since 3.0.0 + * + * @param {number} x - The x scaling value. + * @param {number} y - The y scaling value. + * @param {number} z - The z scaling value. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + scaling: function (x, y, z) + { + this.zero(); + + var out = this.val; + + out[0] = x; + out[5] = y; + out[10] = z; + out[15] = 1; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix4#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 0; + out[5] = 1; + out[6] = 0; + out[7] = 0; + out[8] = 0; + out[9] = 0; + out[10] = 1; + out[11] = 0; + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + transpose: function () + { + var a = this.val; + + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a12 = a[6]; + var a13 = a[7]; + var a23 = a[11]; + + a[1] = a[4]; + a[2] = a[8]; + a[3] = a[12]; + a[4] = a01; + a[6] = a[9]; + a[7] = a[13]; + a[8] = a02; + a[9] = a12; + a[11] = a[14]; + a[12] = a03; + a[13] = a13; + a[14] = a23; + + return this; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return null; + } + + det = 1 / det; + + a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; + a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; + a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; + a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; + a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; + a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; + a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); + a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); + a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); + a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); + a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); + a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); + a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); + a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); + a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); + a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); + a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); + a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); + a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); + a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); + a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); + a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); + + return this; + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix4#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix4#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b = src.val; + + // Cache only the current line of the second matrix + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + + a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + + a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + + a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + + a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - [description] + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = []; + var m1 = this.val; + var m2 = src.val; + + a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; + a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; + a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; + a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; + + a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; + a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; + a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; + a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; + + a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; + a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; + a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; + a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; + + a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; + a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; + a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; + a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; + + return this.fromArray(a); + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix4#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + translate: function (v) + { + var x = v.x; + var y = v.y; + var z = v.z; + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Translate this Matrix using the given values. + * + * @method Phaser.Math.Matrix4#translateXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + translateXYZ: function (x, y, z) + { + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix4#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + scale: function (v) + { + var x = v.x; + var y = v.y; + var z = v.z; + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#scaleXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + scaleXYZ: function (x, y, z) + { + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Derive a rotation matrix around the given axis. + * + * @method Phaser.Math.Matrix4#makeRotationAxis + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. + * @param {number} angle - The rotation angle in radians. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + makeRotationAxis: function (axis, angle) + { + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos(angle); + var s = Math.sin(angle); + var t = 1 - c; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var tx = t * x; + var ty = t * y; + + this.fromArray([ + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + ]); + + return this; + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + rotate: function (rad, axis) + { + var a = this.val; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var len = Math.sqrt(x * x + y * y + z * z); + + if (Math.abs(len) < EPSILON) + { + return null; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Construct the elements of the rotation matrix + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + a[0] = a00 * b00 + a10 * b01 + a20 * b02; + a[1] = a01 * b00 + a11 * b01 + a21 * b02; + a[2] = a02 * b00 + a12 * b01 + a22 * b02; + a[3] = a03 * b00 + a13 * b01 + a23 * b02; + a[4] = a00 * b10 + a10 * b11 + a20 * b12; + a[5] = a01 * b10 + a11 * b11 + a21 * b12; + a[6] = a02 * b10 + a12 * b11 + a22 * b12; + a[7] = a03 * b10 + a13 * b11 + a23 * b12; + a[8] = a00 * b20 + a10 * b21 + a20 * b22; + a[9] = a01 * b20 + a11 * b21 + a21 * b22; + a[10] = a02 * b20 + a12 * b21 + a22 * b22; + a[11] = a03 * b20 + a13 * b21 + a23 * b22; + + return this; + }, + + /** + * Rotate this matrix on its X axis. + * + * @method Phaser.Math.Matrix4#rotateX + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + rotateX: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[4] = a10 * c + a20 * s; + a[5] = a11 * c + a21 * s; + a[6] = a12 * c + a22 * s; + a[7] = a13 * c + a23 * s; + a[8] = a20 * c - a10 * s; + a[9] = a21 * c - a11 * s; + a[10] = a22 * c - a12 * s; + a[11] = a23 * c - a13 * s; + + return this; + }, + + /** + * Rotate this matrix on its Y axis. + * + * @method Phaser.Math.Matrix4#rotateY + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + rotateY: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c - a20 * s; + a[1] = a01 * c - a21 * s; + a[2] = a02 * c - a22 * s; + a[3] = a03 * c - a23 * s; + a[8] = a00 * s + a20 * c; + a[9] = a01 * s + a21 * c; + a[10] = a02 * s + a22 * c; + a[11] = a03 * s + a23 * c; + + return this; + }, + + /** + * Rotate this matrix on its Z axis. + * + * @method Phaser.Math.Matrix4#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + rotateZ: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c + a10 * s; + a[1] = a01 * c + a11 * s; + a[2] = a02 * c + a12 * s; + a[3] = a03 * c + a13 * s; + a[4] = a10 * c - a00 * s; + a[5] = a11 * c - a01 * s; + a[6] = a12 * c - a02 * s; + a[7] = a13 * c - a03 * s; + + return this; + }, + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * + * @method Phaser.Math.Matrix4#fromRotationTranslation + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. + * @param {Phaser.Math.Vector3} v - The Vector to set translation from. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var out = this.val; + + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = v.x; + out[13] = v.y; + out[14] = v.z; + out[15] = 1; + + return this; + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix4#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + fromQuat: function (q) + { + var out = this.val; + + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + out[0] = 1 - (yy + zz); + out[1] = xy + wz; + out[2] = xz - wy; + out[3] = 0; + + out[4] = xy - wz; + out[5] = 1 - (xx + zz); + out[6] = yz + wx; + out[7] = 0; + + out[8] = xz + wy; + out[9] = yz - wx; + out[10] = 1 - (xx + yy); + out[11] = 0; + + out[12] = 0; + out[13] = 0; + out[14] = 0; + out[15] = 1; + + return this; + }, + + /** + * Generate a frustum matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#frustum + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var out = this.val; + + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + out[0] = (near * 2) * rl; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (near * 2) * tb; + out[6] = 0; + out[7] = 0; + + out[8] = (right + left) * rl; + out[9] = (top + bottom) * tb; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (far * near * 2) * nf; + out[15] = 0; + + return this; + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspective + * @since 3.0.0 + * + * @param {number} fovy - Vertical field of view in radians + * @param {number} aspect - Aspect ratio. Typically viewport width /height. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var out = this.val; + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + out[0] = f / aspect; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = f; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = (far + near) * nf; + out[11] = -1; + + out[12] = 0; + out[13] = 0; + out[14] = (2 * far * near) * nf; + out[15] = 0; + + return this; + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspectiveLH + * @since 3.0.0 + * + * @param {number} width - The width of the frustum. + * @param {number} height - The height of the frustum. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + var out = this.val; + + out[0] = (2 * near) / width; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = (2 * near) / height; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = -far / (near - far); + out[11] = 1; + + out[12] = 0; + out[13] = 0; + out[14] = (near * far) / (near - far); + out[15] = 0; + + return this; + }, + + /** + * Generate an orthogonal projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#ortho + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var out = this.val; + var lr = left - right; + var bt = bottom - top; + var nf = near - far; + + // Avoid division by zero + lr = (lr === 0) ? lr : 1 / lr; + bt = (bt === 0) ? bt : 1 / bt; + nf = (nf === 0) ? nf : 1 / nf; + + out[0] = -2 * lr; + out[1] = 0; + out[2] = 0; + out[3] = 0; + + out[4] = 0; + out[5] = -2 * bt; + out[6] = 0; + out[7] = 0; + + out[8] = 0; + out[9] = 0; + out[10] = 2 * nf; + out[11] = 0; + + out[12] = (left + right) * lr; + out[13] = (top + bottom) * bt; + out[14] = (far + near) * nf; + out[15] = 1; + + return this; + }, + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * + * @method Phaser.Math.Matrix4#lookAt + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer + * @param {Phaser.Math.Vector3} center - Point the viewer is looking at + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var out = this.val; + + var eyex = eye.x; + var eyey = eye.y; + var eyez = eye.z; + + var upx = up.x; + var upy = up.y; + var upz = up.z; + + var centerx = center.x; + var centery = center.y; + var centerz = center.z; + + if (Math.abs(eyex - centerx) < EPSILON && + Math.abs(eyey - centery) < EPSILON && + Math.abs(eyez - centerz) < EPSILON) + { + return this.identity(); + } + + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + + z0 *= len; + z1 *= len; + z2 *= len; + + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + + if (!len) + { + x0 = 0; + x1 = 0; + x2 = 0; + } + else + { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + + if (!len) + { + y0 = 0; + y1 = 0; + y2 = 0; + } + else + { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + out[0] = x0; + out[1] = y0; + out[2] = z0; + out[3] = 0; + + out[4] = x1; + out[5] = y1; + out[6] = z1; + out[7] = 0; + + out[8] = x2; + out[9] = y2; + out[10] = z2; + out[11] = 0; + + out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); + out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); + out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); + out[15] = 1; + + return this; + }, + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * + * @method Phaser.Math.Matrix4#yawPitchRoll + * @since 3.0.0 + * + * @param {number} yaw - [description] + * @param {number} pitch - [description] + * @param {number} roll - [description] + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + yawPitchRoll: function (yaw, pitch, roll) + { + this.zero(); + _tempMat1.zero(); + _tempMat2.zero(); + + var m0 = this.val; + var m1 = _tempMat1.val; + var m2 = _tempMat2.val; + + // Rotate Z + var s = Math.sin(roll); + var c = Math.cos(roll); + + m0[10] = 1; + m0[15] = 1; + m0[0] = c; + m0[1] = s; + m0[4] = -s; + m0[5] = c; + + // Rotate X + s = Math.sin(pitch); + c = Math.cos(pitch); + + m1[0] = 1; + m1[15] = 1; + m1[5] = c; + m1[10] = c; + m1[9] = -s; + m1[6] = s; + + // Rotate Y + s = Math.sin(yaw); + c = Math.cos(yaw); + + m2[5] = 1; + m2[15] = 1; + m2[0] = c; + m2[2] = -s; + m2[8] = s; + m2[10] = c; + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + return this; + }, + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * + * @method Phaser.Math.Matrix4#setWorldMatrix + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. + * @param {Phaser.Math.Vector3} position - The position of the world matrix. + * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. + * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. + * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) + { + this.yawPitchRoll(rotation.y, rotation.x, rotation.z); + + _tempMat1.scaling(scale.x, scale.y, scale.z); + _tempMat2.xyz(position.x, position.y, position.z); + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + if (viewMatrix !== undefined) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix !== undefined) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + } + +}); + +var _tempMat1 = new Matrix4(); +var _tempMat2 = new Matrix4(); + +module.exports = Matrix4; + + +/***/ }), +/* 311 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); +var Vector3 = __webpack_require__(170); +var Matrix3 = __webpack_require__(309); + +var EPSILON = 0.000001; + +// Some shared 'private' arrays +var siNext = new Int8Array([ 1, 2, 0 ]); +var tmp = new Float32Array([ 0, 0, 0 ]); + +var xUnitVec3 = new Vector3(1, 0, 0); +var yUnitVec3 = new Vector3(0, 1, 0); + +var tmpvec = new Vector3(); +var tmpMat3 = new Matrix3(); + +/** + * @classdesc + * A quaternion. + * + * @class Quaternion + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + * @param {number} [w] - The w component. + */ +var Quaternion = new Class({ + + initialize: + + function Quaternion (x, y, z, w) + { + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; + } + }, + + /** + * Copy the components of a given Quaternion or Vector into this Quaternion. + * + * @method Phaser.Math.Quaternion#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z; + this.w = src.w; + + return this; + }, + + /** + * Set the components of this Quaternion. + * + * @method Phaser.Math.Quaternion#set + * @since 3.0.0 + * + * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=0] - The w component. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + set: function (x, y, z, w) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + this.w = x.w || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + this.w = w || 0; + } + + return this; + }, + + /** + * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. + * + * @method Phaser.Math.Quaternion#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z; + this.w += v.w; + + return this; + }, + + /** + * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. + * + * @method Phaser.Math.Quaternion#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + this.w -= v.w; + + return this; + }, + + /** + * Scale this Quaternion by the given value. + * + * @method Phaser.Math.Quaternion#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + scale: function (scale) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + this.w *= scale; + + return this; + }, + + /** + * Calculate the length of this Quaternion. + * + * @method Phaser.Math.Quaternion#length + * @since 3.0.0 + * + * @return {number} The length of this Quaternion. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return Math.sqrt(x * x + y * y + z * z + w * w); + }, + + /** + * Calculate the length of this Quaternion squared. + * + * @method Phaser.Math.Quaternion#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Quaternion, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return x * x + y * y + z * z + w * w; + }, + + /** + * Normalize this Quaternion. + * + * @method Phaser.Math.Quaternion#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + this.w = w * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Quaternion and the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#dot + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. + * + * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + }, + + /** + * Linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#lerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. + * @param {number} [t=0] - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + this.w = aw + t * (v.w - aw); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - [description] + * @param {Phaser.Math.Vector3} b - [description] + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotationTo: function (a, b) + { + var dot = a.x * b.x + a.y * b.y + a.z * b.z; + + if (dot < -0.999999) + { + if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) + { + tmpvec.copy(yUnitVec3).cross(a); + } + + tmpvec.normalize(); + + return this.setAxisAngle(tmpvec, Math.PI); + + } + else if (dot > 0.999999) + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + } + else + { + tmpvec.copy(a).cross(b); + + this.x = tmpvec.x; + this.y = tmpvec.y; + this.z = tmpvec.z; + this.w = 1 + dot; + + return this.normalize(); + } + }, + + /** + * Set the axes of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxes + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} view - The view axis. + * @param {Phaser.Math.Vector3} right - The right axis. + * @param {Phaser.Math.Vector3} up - The upwards axis. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxes: function (view, right, up) + { + var m = tmpMat3.val; + + m[0] = right.x; + m[3] = right.y; + m[6] = right.z; + + m[1] = up.x; + m[4] = up.y; + m[7] = up.z; + + m[2] = -view.x; + m[5] = -view.y; + m[8] = -view.z; + + return this.fromMat3(tmpMat3).normalize(); + }, + + /** + * Reset this Matrix to an identity (default) Quaternion. + * + * @method Phaser.Math.Quaternion#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + identity: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 1; + + return this; + }, + + /** + * Set the axis angle of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxisAngle + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} axis - The axis. + * @param {number} rad - The angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxisAngle: function (axis, rad) + { + rad = rad * 0.5; + + var s = Math.sin(rad); + + this.x = s * axis.x; + this.y = s * axis.y; + this.z = s * axis.z; + this.w = Math.cos(rad); + + return this; + }, + + /** + * Multiply this Quaternion by the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + multiply: function (b) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + this.x = ax * bw + aw * bx + ay * bz - az * by; + this.y = ay * bw + aw * by + az * bx - ax * bz; + this.z = az * bw + aw * bz + ax * by - ay * bx; + this.w = aw * bw - ax * bx - ay * by - az * bz; + + return this; + }, + + /** + * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#slerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. + * @param {number} t - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + slerp: function (b, t) + { + // benchmarks: http://jsperf.com/quaternion-slerp-implementations + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + // calc cosine + var cosom = ax * bx + ay * by + az * bz + aw * bw; + + // adjust signs (if necessary) + if (cosom < 0) + { + cosom = -cosom; + bx = - bx; + by = - by; + bz = - bz; + bw = - bw; + } + + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + var scale0 = 1 - t; + var scale1 = t; + + // calculate coefficients + if ((1 - cosom) > EPSILON) + { + // standard case (slerp) + var omega = Math.acos(cosom); + var sinom = Math.sin(omega); + + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } + + // calculate final values + this.x = scale0 * ax + scale1 * bx; + this.y = scale0 * ay + scale1 * by; + this.z = scale0 * az + scale1 * bz; + this.w = scale0 * aw + scale1 * bw; + + return this; + }, + + /** + * Invert this Quaternion. + * + * @method Phaser.Math.Quaternion#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + invert: function () + { + var a0 = this.x; + var a1 = this.y; + var a2 = this.z; + var a3 = this.w; + + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = (dot) ? 1 / dot : 0; + + // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 + + this.x = -a0 * invDot; + this.y = -a1 * invDot; + this.z = -a2 * invDot; + this.w = a3 * invDot; + + return this; + }, + + /** + * Convert this Quaternion into its conjugate. + * + * Sets the x, y and z components. + * + * @method Phaser.Math.Quaternion#conjugate + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + conjugate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + + return this; + }, + + /** + * Rotate this Quaternion on the X axis. + * + * @method Phaser.Math.Quaternion#rotateX + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateX: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = Math.sin(rad); + var bw = Math.cos(rad); + + this.x = ax * bw + aw * bx; + this.y = ay * bw + az * bx; + this.z = az * bw - ay * bx; + this.w = aw * bw - ax * bx; + + return this; + }, + + /** + * Rotate this Quaternion on the Y axis. + * + * @method Phaser.Math.Quaternion#rotateY + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateY: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var by = Math.sin(rad); + var bw = Math.cos(rad); + + this.x = ax * bw - az * by; + this.y = ay * bw + aw * by; + this.z = az * bw + ax * by; + this.w = aw * bw - ay * by; + + return this; + }, + + /** + * Rotate this Quaternion on the Z axis. + * + * @method Phaser.Math.Quaternion#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateZ: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bz = Math.sin(rad); + var bw = Math.cos(rad); + + this.x = ax * bw + ay * bz; + this.y = ay * bw - ax * bz; + this.z = az * bw + aw * bz; + this.w = aw * bw - az * bz; + + return this; + }, + + /** + * Create a unit (or rotation) Quaternion from its x, y, and z components. + * + * Sets the w component. + * + * @method Phaser.Math.Quaternion#calculateW + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + calculateW: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); + + return this; + }, + + /** + * Convert the given Matrix into this Quaternion. + * + * @method Phaser.Math.Quaternion#fromMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + fromMat3: function (mat) + { + // benchmarks: + // http://jsperf.com/typed-array-access-speed + // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion + + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var m = mat.val; + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if (fTrace > 0) + { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + + this.w = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; // 1/(4w) + + this.x = (m[7] - m[5]) * fRoot; + this.y = (m[2] - m[6]) * fRoot; + this.z = (m[3] - m[1]) * fRoot; + } + else + { + // |w| <= 1/2 + var i = 0; + + if (m[4] > m[0]) + { + i = 1; + } + + if (m[8] > m[i * 3 + i]) + { + i = 2; + } + + var j = siNext[i]; + var k = siNext[j]; + + // This isn't quite as clean without array access + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + tmp[i] = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; + + tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + + this.x = tmp[0]; + this.y = tmp[1]; + this.z = tmp[2]; + this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + } + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), +/* 312 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasInterpolation = __webpack_require__(313); +var CanvasPool = __webpack_require__(24); +var CONST = __webpack_require__(26); +var Features = __webpack_require__(164); + +/** + * Called automatically by Phaser.Game and responsible for creating the renderer it will use. + * + * Relies upon two webpack global flags to be defined: `WEBGL_RENDERER` and `CANVAS_RENDERER` during build time, but not at run-time. + * + * @function Phaser.Core.CreateRenderer + * @since 3.0.0 + * + * @param {Phaser.Game} game - The Phaser.Game instance on which the renderer will be set. + */ +var CreateRenderer = function (game) +{ + var config = game.config; + + if ((config.customEnvironment || config.canvas) && config.renderType === CONST.AUTO) + { + throw new Error('Must set explicit renderType in custom environment'); + } + + // Not a custom environment, didn't provide their own canvas and not headless, so determine the renderer: + if (!config.customEnvironment && !config.canvas && config.renderType !== CONST.HEADLESS) + { + if (config.renderType === CONST.CANVAS || (config.renderType !== CONST.CANVAS && !Features.webGL)) + { + if (Features.canvas) + { + // They requested Canvas and their browser supports it + config.renderType = CONST.CANVAS; + } + else + { + throw new Error('Cannot create Canvas or WebGL context, aborting.'); + } + } + else + { + // Game requested WebGL and browser says it supports it + config.renderType = CONST.WEBGL; + } + } + + // Pixel Art mode? + if (!config.antialias) + { + CanvasPool.disableSmoothing(); + } + + var baseSize = game.scale.baseSize; + + var width = baseSize.width; + var height = baseSize.height; + + // Does the game config provide its own canvas element to use? + if (config.canvas) + { + game.canvas = config.canvas; + + game.canvas.width = width; + game.canvas.height = height; + } + else + { + game.canvas = CanvasPool.create(game, width, height, config.renderType); + } + + // Does the game config provide some canvas css styles to use? + if (config.canvasStyle) + { + game.canvas.style = config.canvasStyle; + } + + // Pixel Art mode? + if (!config.antialias) + { + CanvasInterpolation.setCrisp(game.canvas); + } + + if (config.renderType === CONST.HEADLESS) + { + // Nothing more to do here + return; + } + + var CanvasRenderer; + var WebGLRenderer; + + if (true) + { + CanvasRenderer = __webpack_require__(480); + WebGLRenderer = __webpack_require__(483); + + // Let the config pick the renderer type, as both are included + if (config.renderType === CONST.WEBGL) + { + game.renderer = new WebGLRenderer(game); + } + else + { + game.renderer = new CanvasRenderer(game); + game.context = game.renderer.gameContext; + } + } + + if (false) + {} + + if (false) + {} +}; + +module.exports = CreateRenderer; + + +/***/ }), +/* 313 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Display.Canvas.CanvasInterpolation + * @since 3.0.0 + */ +var CanvasInterpolation = { + + /** + * Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit). + * + * @function Phaser.Display.Canvas.CanvasInterpolation.setCrisp + * @since 3.0.0 + * + * @param {HTMLCanvasElement} canvas - The canvas object to have the style set on. + * + * @return {HTMLCanvasElement} The canvas. + */ + setCrisp: function (canvas) + { + var types = [ 'optimizeSpeed', 'crisp-edges', '-moz-crisp-edges', '-webkit-optimize-contrast', 'optimize-contrast', 'pixelated' ]; + + types.forEach(function (type) + { + canvas.style['image-rendering'] = type; + }); + + canvas.style.msInterpolationMode = 'nearest-neighbor'; + + return canvas; + }, + + /** + * Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto'). + * + * @function Phaser.Display.Canvas.CanvasInterpolation.setBicubic + * @since 3.0.0 + * + * @param {HTMLCanvasElement} canvas - The canvas object to have the style set on. + * + * @return {HTMLCanvasElement} The canvas. + */ + setBicubic: function (canvas) + { + canvas.style['image-rendering'] = 'auto'; + canvas.style.msInterpolationMode = 'bicubic'; + + return canvas; + } + +}; + +module.exports = CanvasInterpolation; + + +/***/ }), +/* 314 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(26); + +/** + * Called automatically by Phaser.Game and responsible for creating the console.log debug header. + * + * You can customize or disable the header via the Game Config object. + * + * @function Phaser.Core.DebugHeader + * @since 3.0.0 + * + * @param {Phaser.Game} game - The Phaser.Game instance which will output this debug header. + */ +var DebugHeader = function (game) +{ + var config = game.config; + + if (config.hideBanner) + { + return; + } + + var renderType = 'WebGL'; + + if (config.renderType === CONST.CANVAS) + { + renderType = 'Canvas'; + } + else if (config.renderType === CONST.HEADLESS) + { + renderType = 'Headless'; + } + + var audioConfig = config.audio; + var deviceAudio = game.device.audio; + + var audioType; + + if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio)) + { + audioType = 'Web Audio'; + } + else if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData)) + { + audioType = 'No Audio'; + } + else + { + audioType = 'HTML5 Audio'; + } + + if (!game.device.browser.ie) + { + var c = ''; + var args = [ c ]; + + if (Array.isArray(config.bannerBackgroundColor)) + { + var lastColor; + + config.bannerBackgroundColor.forEach(function (color) + { + c = c.concat('%c '); + + args.push('background: ' + color); + + lastColor = color; + + }); + + // inject the text color + args[args.length - 1] = 'color: ' + config.bannerTextColor + '; background: ' + lastColor; + } + else + { + c = c.concat('%c '); + + args.push('color: ' + config.bannerTextColor + '; background: ' + config.bannerBackgroundColor); + } + + // URL link background color (always white) + args.push('background: #fff'); + + if (config.gameTitle) + { + c = c.concat(config.gameTitle); + + if (config.gameVersion) + { + c = c.concat(' v' + config.gameVersion); + } + + if (!config.hidePhaser) + { + c = c.concat(' / '); + } + } + + var fb = ( false) ? undefined : ''; + + if (!config.hidePhaser) + { + c = c.concat('Phaser v' + CONST.VERSION + fb + ' (' + renderType + ' | ' + audioType + ')'); + } + + c = c.concat(' %c ' + config.gameURL); + + // Inject the new string back into the args array + args[0] = c; + + console.log.apply(console, args); + } + else if (window['console']) + { + console.log('Phaser v' + CONST.VERSION + ' / https://phaser.io'); + } +}; + +module.exports = DebugHeader; + + +/***/ }), +/* 315 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetValue = __webpack_require__(6); +var NOOP = __webpack_require__(1); +var RequestAnimationFrame = __webpack_require__(316); + +// Frame Rate config +// fps: { +// min: 10, +// target: 60, +// forceSetTimeOut: false, +// deltaHistory: 10, +// panicMax: 120 +// } + +// http://www.testufo.com/#test=animation-time-graph + +/** + * @classdesc + * [description] + * + * @class TimeStep + * @memberof Phaser.Core + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - A reference to the Phaser.Game instance that owns this Time Step. + * @param {Phaser.Types.Core.FPSConfig} config + */ +var TimeStep = new Class({ + + initialize: + + function TimeStep (game, config) + { + /** + * A reference to the Phaser.Game instance. + * + * @name Phaser.Core.TimeStep#game + * @type {Phaser.Game} + * @readonly + * @since 3.0.0 + */ + this.game = game; + + /** + * [description] + * + * @name Phaser.Core.TimeStep#raf + * @type {Phaser.DOM.RequestAnimationFrame} + * @readonly + * @since 3.0.0 + */ + this.raf = new RequestAnimationFrame(); + + /** + * A flag that is set once the TimeStep has started running and toggled when it stops. + * + * @name Phaser.Core.TimeStep#started + * @type {boolean} + * @readonly + * @default false + * @since 3.0.0 + */ + this.started = false; + + /** + * A flag that is set once the TimeStep has started running and toggled when it stops. + * The difference between this value and `started` is that `running` is toggled when + * the TimeStep is sent to sleep, where-as `started` remains `true`, only changing if + * the TimeStep is actually stopped, not just paused. + * + * @name Phaser.Core.TimeStep#running + * @type {boolean} + * @readonly + * @default false + * @since 3.0.0 + */ + this.running = false; + + /** + * The minimum fps rate you want the Time Step to run at. + * + * @name Phaser.Core.TimeStep#minFps + * @type {integer} + * @default 5 + * @since 3.0.0 + */ + this.minFps = GetValue(config, 'min', 5); + + /** + * The target fps rate for the Time Step to run at. + * + * Setting this value will not actually change the speed at which the browser runs, that is beyond + * the control of Phaser. Instead, it allows you to determine performance issues and if the Time Step + * is spiraling out of control. + * + * @name Phaser.Core.TimeStep#targetFps + * @type {integer} + * @default 60 + * @since 3.0.0 + */ + this.targetFps = GetValue(config, 'target', 60); + + /** + * The minFps value in ms. + * Defaults to 200ms between frames (i.e. super slow!) + * + * @name Phaser.Core.TimeStep#_min + * @type {number} + * @private + * @since 3.0.0 + */ + this._min = 1000 / this.minFps; + + /** + * The targetFps value in ms. + * Defaults to 16.66ms between frames (i.e. normal) + * + * @name Phaser.Core.TimeStep#_target + * @type {number} + * @private + * @since 3.0.0 + */ + this._target = 1000 / this.targetFps; + + /** + * An exponential moving average of the frames per second. + * + * @name Phaser.Core.TimeStep#actualFps + * @type {integer} + * @readonly + * @default 60 + * @since 3.0.0 + */ + this.actualFps = this.targetFps; + + /** + * [description] + * + * @name Phaser.Core.TimeStep#nextFpsUpdate + * @type {integer} + * @readonly + * @default 0 + * @since 3.0.0 + */ + this.nextFpsUpdate = 0; + + /** + * The number of frames processed this second. + * + * @name Phaser.Core.TimeStep#framesThisSecond + * @type {integer} + * @readonly + * @default 0 + * @since 3.0.0 + */ + this.framesThisSecond = 0; + + /** + * A callback to be invoked each time the Time Step steps. + * + * @name Phaser.Core.TimeStep#callback + * @type {Phaser.Types.Core.TimeStepCallback} + * @default NOOP + * @since 3.0.0 + */ + this.callback = NOOP; + + /** + * You can force the Time Step to use Set Timeout instead of Request Animation Frame by setting + * the `forceSetTimeOut` property to `true` in the Game Configuration object. It cannot be changed at run-time. + * + * @name Phaser.Core.TimeStep#forceSetTimeOut + * @type {boolean} + * @readonly + * @default false + * @since 3.0.0 + */ + this.forceSetTimeOut = GetValue(config, 'forceSetTimeOut', false); + + /** + * The time, calculated at the start of the current step, as smoothed by the delta value. + * + * @name Phaser.Core.TimeStep#time + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.time = 0; + + /** + * The time at which the game started running. This value is adjusted if the game is then + * paused and resumes. + * + * @name Phaser.Core.TimeStep#startTime + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.startTime = 0; + + /** + * The time, as returned by `performance.now` of the previous step. + * + * @name Phaser.Core.TimeStep#lastTime + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.lastTime = 0; + + /** + * The current frame the game is on. This counter is incremented once every game step, regardless of how much + * time has passed and is unaffected by delta smoothing. + * + * @name Phaser.Core.TimeStep#frame + * @type {integer} + * @readonly + * @default 0 + * @since 3.0.0 + */ + this.frame = 0; + + /** + * Is the browser currently considered in focus by the Page Visibility API? + * This value is set in the `blur` method, which is called automatically by the Game instance. + * + * @name Phaser.Core.TimeStep#inFocus + * @type {boolean} + * @readonly + * @default true + * @since 3.0.0 + */ + this.inFocus = true; + + /** + * The timestamp at which the game became paused, as determined by the Page Visibility API. + * + * @name Phaser.Core.TimeStep#_pauseTime + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._pauseTime = 0; + + /** + * An internal counter to allow for the browser 'cooling down' after coming back into focus. + * + * @name Phaser.Core.TimeStep#_coolDown + * @type {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + this._coolDown = 0; + + /** + * The delta time, in ms, since the last game step. This is a clamped and smoothed average value. + * + * @name Phaser.Core.TimeStep#delta + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.delta = 0; + + /** + * Internal index of the delta history position. + * + * @name Phaser.Core.TimeStep#deltaIndex + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.deltaIndex = 0; + + /** + * Internal array holding the previous delta values, used for delta smoothing. + * + * @name Phaser.Core.TimeStep#deltaHistory + * @type {integer[]} + * @since 3.0.0 + */ + this.deltaHistory = []; + + /** + * The maximum number of delta values that are retained in order to calculate a smoothed moving average. + * + * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. + * + * @name Phaser.Core.TimeStep#deltaSmoothingMax + * @type {integer} + * @default 10 + * @since 3.0.0 + */ + this.deltaSmoothingMax = GetValue(config, 'deltaHistory', 10); + + /** + * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually + * as a result of switching tabs and regaining focus. + * + * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. + * + * @name Phaser.Core.TimeStep#panicMax + * @type {integer} + * @default 120 + * @since 3.0.0 + */ + this.panicMax = GetValue(config, 'panicMax', 120); + + /** + * The actual elapsed time in ms between one update and the next. + * + * Unlike with `delta`, no smoothing, capping, or averaging is applied to this value. + * So please be careful when using this value in math calculations. + * + * @name Phaser.Core.TimeStep#rawDelta + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.rawDelta = 0; + + /** + * The time, as returned by `performance.now` at the very start of the current step. + * This can differ from the `time` value in that it isn't calculated based on the delta value. + * + * @name Phaser.Core.TimeStep#now + * @type {number} + * @default 0 + * @since 3.18.0 + */ + this.now = 0; + }, + + /** + * Called by the Game instance when the DOM window.onBlur event triggers. + * + * @method Phaser.Core.TimeStep#blur + * @since 3.0.0 + */ + blur: function () + { + this.inFocus = false; + }, + + /** + * Called by the Game instance when the DOM window.onFocus event triggers. + * + * @method Phaser.Core.TimeStep#focus + * @since 3.0.0 + */ + focus: function () + { + this.inFocus = true; + + this.resetDelta(); + }, + + /** + * Called when the visibility API says the game is 'hidden' (tab switch out of view, etc) + * + * @method Phaser.Core.TimeStep#pause + * @since 3.0.0 + */ + pause: function () + { + this._pauseTime = window.performance.now(); + }, + + /** + * Called when the visibility API says the game is 'visible' again (tab switch back into view, etc) + * + * @method Phaser.Core.TimeStep#resume + * @since 3.0.0 + */ + resume: function () + { + this.resetDelta(); + + this.startTime += this.time - this._pauseTime; + }, + + /** + * Resets the time, lastTime, fps averages and delta history. + * Called automatically when a browser sleeps them resumes. + * + * @method Phaser.Core.TimeStep#resetDelta + * @since 3.0.0 + */ + resetDelta: function () + { + var now = window.performance.now(); + + this.time = now; + this.lastTime = now; + this.nextFpsUpdate = now + 1000; + this.framesThisSecond = 0; + + // Pre-populate smoothing array + + for (var i = 0; i < this.deltaSmoothingMax; i++) + { + this.deltaHistory[i] = Math.min(this._target, this.deltaHistory[i]); + } + + this.delta = 0; + this.deltaIndex = 0; + + this._coolDown = this.panicMax; + }, + + /** + * Starts the Time Step running, if it is not already doing so. + * Called automatically by the Game Boot process. + * + * @method Phaser.Core.TimeStep#start + * @since 3.0.0 + * + * @param {Phaser.Types.Core.TimeStepCallback} callback - The callback to be invoked each time the Time Step steps. + */ + start: function (callback) + { + if (this.started) + { + return this; + } + + this.started = true; + this.running = true; + + for (var i = 0; i < this.deltaSmoothingMax; i++) + { + this.deltaHistory[i] = this._target; + } + + this.resetDelta(); + + this.startTime = window.performance.now(); + + this.callback = callback; + + this.raf.start(this.step.bind(this), this.forceSetTimeOut); + }, + + /** + * The main step method. This is called each time the browser updates, either by Request Animation Frame, + * or by Set Timeout. It is responsible for calculating the delta values, frame totals, cool down history and more. + * You generally should never call this method directly. + * + * @method Phaser.Core.TimeStep#step + * @since 3.0.0 + */ + step: function () + { + // Because the timestamp passed in from raf represents the beginning of the main thread frame that we’re currently in, + // not the actual time now. As we want to compare this time value against Event timeStamps and the like, we need a + // more accurate one: + + var time = window.performance.now(); + + this.now = time; + + var before = time - this.lastTime; + + if (before < 0) + { + // Because, Chrome. + before = 0; + } + + this.rawDelta = before; + + var idx = this.deltaIndex; + var history = this.deltaHistory; + var max = this.deltaSmoothingMax; + + // delta time (time is in ms) + var dt = before; + + // When a browser switches tab, then comes back again, it takes around 10 frames before + // the delta time settles down so we employ a 'cooling down' period before we start + // trusting the delta values again, to avoid spikes flooding through our delta average + + if (this._coolDown > 0 || !this.inFocus) + { + this._coolDown--; + + dt = Math.min(dt, this._target); + } + + if (dt > this._min) + { + // Probably super bad start time or browser tab context loss, + // so use the last 'sane' dt value + + dt = history[idx]; + + // Clamp delta to min (in case history has become corrupted somehow) + dt = Math.min(dt, this._min); + } + + // Smooth out the delta over the previous X frames + + // add the delta to the smoothing array + history[idx] = dt; + + // adjusts the delta history array index based on the smoothing count + // this stops the array growing beyond the size of deltaSmoothingMax + this.deltaIndex++; + + if (this.deltaIndex > max) + { + this.deltaIndex = 0; + } + + // Delta Average + var avg = 0; + + // Loop the history array, adding the delta values together + + for (var i = 0; i < max; i++) + { + avg += history[i]; + } + + // Then divide by the array length to get the average delta + avg /= max; + + // Set as the world delta value + this.delta = avg; + + // Real-world timer advance + this.time += this.rawDelta; + + // Update the estimate of the frame rate, `fps`. Every second, the number + // of frames that occurred in that second are included in an exponential + // moving average of all frames per second, with an alpha of 0.25. This + // means that more recent seconds affect the estimated frame rate more than + // older seconds. + // + // When a browser window is NOT minimized, but is covered up (i.e. you're using + // another app which has spawned a window over the top of the browser), then it + // will start to throttle the raf callback time. It waits for a while, and then + // starts to drop the frame rate at 1 frame per second until it's down to just over 1fps. + // So if the game was running at 60fps, and the player opens a new window, then + // after 60 seconds (+ the 'buffer time') it'll be down to 1fps, so rafin'g at 1Hz. + // + // When they make the game visible again, the frame rate is increased at a rate of + // approx. 8fps, back up to 60fps (or the max it can obtain) + // + // There is no easy way to determine if this drop in frame rate is because the + // browser is throttling raf, or because the game is struggling with performance + // because you're asking it to do too much on the device. + + if (time > this.nextFpsUpdate) + { + // Compute the new exponential moving average with an alpha of 0.25. + this.actualFps = 0.25 * this.framesThisSecond + 0.75 * this.actualFps; + this.nextFpsUpdate = time + 1000; + this.framesThisSecond = 0; + } + + this.framesThisSecond++; + + // Interpolation - how far between what is expected and where we are? + var interpolation = avg / this._target; + + this.callback(time, avg, interpolation); + + // Shift time value over + this.lastTime = time; + + this.frame++; + }, + + /** + * Manually calls `TimeStep.step`. + * + * @method Phaser.Core.TimeStep#tick + * @since 3.0.0 + */ + tick: function () + { + this.step(); + }, + + /** + * Sends the TimeStep to sleep, stopping Request Animation Frame (or SetTimeout) and toggling the `running` flag to false. + * + * @method Phaser.Core.TimeStep#sleep + * @since 3.0.0 + */ + sleep: function () + { + if (this.running) + { + this.raf.stop(); + + this.running = false; + } + }, + + /** + * Wakes-up the TimeStep, restarting Request Animation Frame (or SetTimeout) and toggling the `running` flag to true. + * The `seamless` argument controls if the wake-up should adjust the start time or not. + * + * @method Phaser.Core.TimeStep#wake + * @since 3.0.0 + * + * @param {boolean} [seamless=false] - Adjust the startTime based on the lastTime values. + */ + wake: function (seamless) + { + if (this.running) + { + this.sleep(); + } + else if (seamless) + { + this.startTime += -this.lastTime + (this.lastTime + window.performance.now()); + } + + this.raf.start(this.step.bind(this), this.useRAF); + + this.running = true; + + this.step(); + }, + + /** + * Gets the duration which the game has been running, in seconds. + * + * @method Phaser.Core.TimeStep#getDuration + * @since 3.17.0 + * + * @return {number} The duration in seconds. + */ + getDuration: function () + { + return Math.round(this.lastTime - this.startTime) / 1000; + }, + + /** + * Gets the duration which the game has been running, in ms. + * + * @method Phaser.Core.TimeStep#getDurationMS + * @since 3.17.0 + * + * @return {number} The duration in ms. + */ + getDurationMS: function () + { + return Math.round(this.lastTime - this.startTime); + }, + + /** + * Stops the TimeStep running. + * + * @method Phaser.Core.TimeStep#stop + * @since 3.0.0 + * + * @return {Phaser.Core.TimeStep} The TimeStep object. + */ + stop: function () + { + this.running = false; + this.started = false; + + this.raf.stop(); + + return this; + }, + + /** + * Destroys the TimeStep. This will stop Request Animation Frame, stop the step, clear the callbacks and null + * any objects. + * + * @method Phaser.Core.TimeStep#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.stop(); + + this.callback = NOOP; + + this.raf = null; + this.game = null; + } + +}); + +module.exports = TimeStep; + + +/***/ }), +/* 316 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var NOOP = __webpack_require__(1); + +/** + * @classdesc + * Abstracts away the use of RAF or setTimeOut for the core game update loop. + * This is invoked automatically by the Phaser.Game instance. + * + * @class RequestAnimationFrame + * @memberof Phaser.DOM + * @constructor + * @since 3.0.0 + */ +var RequestAnimationFrame = new Class({ + + initialize: + + function RequestAnimationFrame () + { + /** + * True if RequestAnimationFrame is running, otherwise false. + * + * @name Phaser.DOM.RequestAnimationFrame#isRunning + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.isRunning = false; + + /** + * The callback to be invoked each step. + * + * @name Phaser.DOM.RequestAnimationFrame#callback + * @type {FrameRequestCallback} + * @since 3.0.0 + */ + this.callback = NOOP; + + /** + * The most recent timestamp. Either a DOMHighResTimeStamp under RAF or `Date.now` under SetTimeout. + * + * @name Phaser.DOM.RequestAnimationFrame#tick + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.tick = 0; + + /** + * True if the step is using setTimeout instead of RAF. + * + * @name Phaser.DOM.RequestAnimationFrame#isSetTimeOut + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.isSetTimeOut = false; + + /** + * The setTimeout or RAF callback ID used when canceling them. + * + * @name Phaser.DOM.RequestAnimationFrame#timeOutID + * @type {?number} + * @default null + * @since 3.0.0 + */ + this.timeOutID = null; + + /** + * The previous time the step was called. + * + * @name Phaser.DOM.RequestAnimationFrame#lastTime + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.lastTime = 0; + + var _this = this; + + /** + * The RAF step function. + * Updates the local tick value, invokes the callback and schedules another call to requestAnimationFrame. + * + * @name Phaser.DOM.RequestAnimationFrame#step + * @type {FrameRequestCallback} + * @since 3.0.0 + */ + this.step = function step () + { + // Because we cannot trust the time passed to this callback from the browser and need it kept in sync with event times + var timestamp = window.performance.now(); + + // DOMHighResTimeStamp + _this.lastTime = _this.tick; + + _this.tick = timestamp; + + _this.callback(timestamp); + + _this.timeOutID = window.requestAnimationFrame(step); + }; + + /** + * The SetTimeout step function. + * Updates the local tick value, invokes the callback and schedules another call to setTimeout. + * + * @name Phaser.DOM.RequestAnimationFrame#stepTimeout + * @type {function} + * @since 3.0.0 + */ + this.stepTimeout = function stepTimeout () + { + var d = Date.now(); + + var delay = Math.max(16 + _this.lastTime - d, 0); + + _this.lastTime = _this.tick; + + _this.tick = d; + + _this.callback(d); + + _this.timeOutID = window.setTimeout(stepTimeout, delay); + }; + }, + + /** + * Starts the requestAnimationFrame or setTimeout process running. + * + * @method Phaser.DOM.RequestAnimationFrame#start + * @since 3.0.0 + * + * @param {FrameRequestCallback} callback - The callback to invoke each step. + * @param {boolean} forceSetTimeOut - Should it use SetTimeout, even if RAF is available? + */ + start: function (callback, forceSetTimeOut) + { + if (this.isRunning) + { + return; + } + + this.callback = callback; + + this.isSetTimeOut = forceSetTimeOut; + + this.isRunning = true; + + this.timeOutID = (forceSetTimeOut) ? window.setTimeout(this.stepTimeout, 0) : window.requestAnimationFrame(this.step); + }, + + /** + * Stops the requestAnimationFrame or setTimeout from running. + * + * @method Phaser.DOM.RequestAnimationFrame#stop + * @since 3.0.0 + */ + stop: function () + { + this.isRunning = false; + + if (this.isSetTimeOut) + { + clearTimeout(this.timeOutID); + } + else + { + window.cancelAnimationFrame(this.timeOutID); + } + }, + + /** + * Stops the step from running and clears the callback reference. + * + * @method Phaser.DOM.RequestAnimationFrame#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.stop(); + + this.callback = NOOP; + } + +}); + +module.exports = RequestAnimationFrame; + + +/***/ }), +/* 317 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Events = __webpack_require__(28); + +/** + * The Visibility Handler is responsible for listening out for document level visibility change events. + * This includes `visibilitychange` if the browser supports it, and blur and focus events. It then uses + * the provided Event Emitter and fires the related events. + * + * @function Phaser.Core.VisibilityHandler + * @fires Phaser.Core.Events#BLUR + * @fires Phaser.Core.Events#FOCUS + * @fires Phaser.Core.Events#HIDDEN + * @fires Phaser.Core.Events#VISIBLE + * @since 3.0.0 + * + * @param {Phaser.Game} game - The Game instance this Visibility Handler is working on. + */ +var VisibilityHandler = function (game) +{ + var hiddenVar; + var eventEmitter = game.events; + + if (document.hidden !== undefined) + { + hiddenVar = 'visibilitychange'; + } + else + { + var vendors = [ 'webkit', 'moz', 'ms' ]; + + vendors.forEach(function (prefix) + { + if (document[prefix + 'Hidden'] !== undefined) + { + document.hidden = function () + { + return document[prefix + 'Hidden']; + }; + + hiddenVar = prefix + 'visibilitychange'; + } + + }); + } + + var onChange = function (event) + { + if (document.hidden || event.type === 'pause') + { + eventEmitter.emit(Events.HIDDEN); + } + else + { + eventEmitter.emit(Events.VISIBLE); + } + }; + + if (hiddenVar) + { + document.addEventListener(hiddenVar, onChange, false); + } + + window.onblur = function () + { + eventEmitter.emit(Events.BLUR); + }; + + window.onfocus = function () + { + eventEmitter.emit(Events.FOCUS); + }; + + // Automatically give the window focus unless config says otherwise + if (window.focus && game.config.autoFocus) + { + window.focus(); + } +}; + +module.exports = VisibilityHandler; + + +/***/ }), +/* 318 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Arne16 = __webpack_require__(319); +var CanvasPool = __webpack_require__(24); +var GetValue = __webpack_require__(6); + +/** + * [description] + * + * @function Phaser.Create.GenerateTexture + * @since 3.0.0 + * + * @param {Phaser.Types.Create.GenerateTextureConfig} config - [description] + * + * @return {HTMLCanvasElement} [description] + */ +var GenerateTexture = function (config) +{ + var data = GetValue(config, 'data', []); + var canvas = GetValue(config, 'canvas', null); + var palette = GetValue(config, 'palette', Arne16); + var pixelWidth = GetValue(config, 'pixelWidth', 1); + var pixelHeight = GetValue(config, 'pixelHeight', pixelWidth); + var resizeCanvas = GetValue(config, 'resizeCanvas', true); + var clearCanvas = GetValue(config, 'clearCanvas', true); + var preRender = GetValue(config, 'preRender', null); + var postRender = GetValue(config, 'postRender', null); + + var width = Math.floor(Math.abs(data[0].length * pixelWidth)); + var height = Math.floor(Math.abs(data.length * pixelHeight)); + + if (!canvas) + { + canvas = CanvasPool.create2D(this, width, height); + resizeCanvas = false; + clearCanvas = false; + } + + if (resizeCanvas) + { + canvas.width = width; + canvas.height = height; + } + + var ctx = canvas.getContext('2d'); + + if (clearCanvas) + { + ctx.clearRect(0, 0, width, height); + } + + // preRender Callback? + if (preRender) + { + preRender(canvas, ctx); + } + + // Draw it + for (var y = 0; y < data.length; y++) + { + var row = data[y]; + + for (var x = 0; x < row.length; x++) + { + var d = row[x]; + + if (d !== '.' && d !== ' ') + { + ctx.fillStyle = palette[d]; + ctx.fillRect(x * pixelWidth, y * pixelHeight, pixelWidth, pixelHeight); + } + } + } + + // postRender Callback? + if (postRender) + { + postRender(canvas, ctx); + } + + return canvas; +}; + +module.exports = GenerateTexture; + + +/***/ }), +/* 319 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A 16 color palette by [Arne](http://androidarts.com/palette/16pal.htm) + * + * @name Phaser.Create.Palettes.ARNE16 + * @since 3.0.0 + * + * @type {Phaser.Types.Create.Palette} + */ +module.exports = { + 0: '#000', + 1: '#9D9D9D', + 2: '#FFF', + 3: '#BE2633', + 4: '#E06F8B', + 5: '#493C2B', + 6: '#A46422', + 7: '#EB8931', + 8: '#F7E26B', + 9: '#2F484E', + A: '#44891A', + B: '#A3CE27', + C: '#1B2632', + D: '#005784', + E: '#31A2F2', + F: '#B2DCEF' +}; + + +/***/ }), +/* 320 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) + +var Class = __webpack_require__(0); +var CubicBezier = __webpack_require__(299); +var Curve = __webpack_require__(79); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A higher-order Bézier curve constructed of four points. + * + * @class CubicBezier + * @extends Phaser.Curves.Curve + * @memberof Phaser.Curves + * @constructor + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector2[])} p0 - Start point, or an array of point pairs. + * @param {Phaser.Math.Vector2} p1 - Control Point 1. + * @param {Phaser.Math.Vector2} p2 - Control Point 2. + * @param {Phaser.Math.Vector2} p3 - End Point. + */ +var CubicBezierCurve = new Class({ + + Extends: Curve, + + initialize: + + function CubicBezierCurve (p0, p1, p2, p3) + { + Curve.call(this, 'CubicBezierCurve'); + + if (Array.isArray(p0)) + { + p3 = new Vector2(p0[6], p0[7]); + p2 = new Vector2(p0[4], p0[5]); + p1 = new Vector2(p0[2], p0[3]); + p0 = new Vector2(p0[0], p0[1]); + } + + /** + * The start point of this curve. + * + * @name Phaser.Curves.CubicBezier#p0 + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.p0 = p0; + + /** + * The first control point of this curve. + * + * @name Phaser.Curves.CubicBezier#p1 + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.p1 = p1; + + /** + * The second control point of this curve. + * + * @name Phaser.Curves.CubicBezier#p2 + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.p2 = p2; + + /** + * The end point of this curve. + * + * @name Phaser.Curves.CubicBezier#p3 + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.p3 = p3; + }, + + /** + * Gets the starting point on the curve. + * + * @method Phaser.Curves.CubicBezier#getStartPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getStartPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + return out.copy(this.p0); + }, + + /** + * Returns the resolution of this curve. + * + * @method Phaser.Curves.CubicBezier#getResolution + * @since 3.0.0 + * + * @param {number} divisions - The amount of divisions used by this curve. + * + * @return {number} The resolution of the curve. + */ + getResolution: function (divisions) + { + return divisions; + }, + + /** + * Get point at relative position in curve according to length. + * + * @method Phaser.Curves.CubicBezier#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end. + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getPoint: function (t, out) + { + if (out === undefined) { out = new Vector2(); } + + var p0 = this.p0; + var p1 = this.p1; + var p2 = this.p2; + var p3 = this.p3; + + return out.set(CubicBezier(t, p0.x, p1.x, p2.x, p3.x), CubicBezier(t, p0.y, p1.y, p2.y, p3.y)); + }, + + /** + * Draws this curve to the specified graphics object. + * + * @method Phaser.Curves.CubicBezier#draw + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] + * + * @param {Phaser.GameObjects.Graphics} graphics - The graphics object this curve should be drawn to. + * @param {integer} [pointsTotal=32] - The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. + * + * @return {Phaser.GameObjects.Graphics} The graphics object this curve was drawn to. Useful for method chaining. + */ + draw: function (graphics, pointsTotal) + { + if (pointsTotal === undefined) { pointsTotal = 32; } + + var points = this.getPoints(pointsTotal); + + graphics.beginPath(); + graphics.moveTo(this.p0.x, this.p0.y); + + for (var i = 1; i < points.length; i++) + { + graphics.lineTo(points[i].x, points[i].y); + } + + graphics.strokePath(); + + // So you can chain graphics calls + return graphics; + }, + + /** + * Returns a JSON object that describes this curve. + * + * @method Phaser.Curves.CubicBezier#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Curves.JSONCurve} The JSON object containing this curve data. + */ + toJSON: function () + { + return { + type: this.type, + points: [ + this.p0.x, this.p0.y, + this.p1.x, this.p1.y, + this.p2.x, this.p2.y, + this.p3.x, this.p3.y + ] + }; + } + +}); + +/** + * Generates a curve from a JSON object. + * + * @function Phaser.Curves.CubicBezier.fromJSON + * @since 3.0.0 + * + * @param {Phaser.Types.Curves.JSONCurve} data - The JSON object containing this curve data. + * + * @return {Phaser.Curves.CubicBezier} The curve generated from the JSON object. + */ +CubicBezierCurve.fromJSON = function (data) +{ + var points = data.points; + + var p0 = new Vector2(points[0], points[1]); + var p1 = new Vector2(points[2], points[3]); + var p2 = new Vector2(points[4], points[5]); + var p3 = new Vector2(points[6], points[7]); + + return new CubicBezierCurve(p0, p1, p2, p3); +}; + +module.exports = CubicBezierCurve; + + +/***/ }), +/* 321 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) + +var Class = __webpack_require__(0); +var Curve = __webpack_require__(79); +var DegToRad = __webpack_require__(35); +var GetValue = __webpack_require__(6); +var RadToDeg = __webpack_require__(169); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * An Elliptical Curve derived from the Base Curve class. + * + * See https://en.wikipedia.org/wiki/Elliptic_curve for more details. + * + * @class Ellipse + * @extends Phaser.Curves.Curve + * @memberof Phaser.Curves + * @constructor + * @since 3.0.0 + * + * @param {(number|Phaser.Types.Curves.EllipseCurveConfig)} [x=0] - The x coordinate of the ellipse, or an Ellipse Curve configuration object. + * @param {number} [y=0] - The y coordinate of the ellipse. + * @param {number} [xRadius=0] - The horizontal radius of ellipse. + * @param {number} [yRadius=0] - The vertical radius of ellipse. + * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) + * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees. + */ +var EllipseCurve = new Class({ + + Extends: Curve, + + initialize: + + function EllipseCurve (x, y, xRadius, yRadius, startAngle, endAngle, clockwise, rotation) + { + if (typeof x === 'object') + { + var config = x; + + x = GetValue(config, 'x', 0); + y = GetValue(config, 'y', 0); + xRadius = GetValue(config, 'xRadius', 0); + yRadius = GetValue(config, 'yRadius', xRadius); + startAngle = GetValue(config, 'startAngle', 0); + endAngle = GetValue(config, 'endAngle', 360); + clockwise = GetValue(config, 'clockwise', false); + rotation = GetValue(config, 'rotation', 0); + } + else + { + if (yRadius === undefined) { yRadius = xRadius; } + if (startAngle === undefined) { startAngle = 0; } + if (endAngle === undefined) { endAngle = 360; } + if (clockwise === undefined) { clockwise = false; } + if (rotation === undefined) { rotation = 0; } + } + + Curve.call(this, 'EllipseCurve'); + + // Center point + + /** + * The center point of the ellipse. Used for calculating rotation. + * + * @name Phaser.Curves.Ellipse#p0 + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.p0 = new Vector2(x, y); + + /** + * The horizontal radius of the ellipse. + * + * @name Phaser.Curves.Ellipse#_xRadius + * @type {number} + * @private + * @since 3.0.0 + */ + this._xRadius = xRadius; + + /** + * The vertical radius of the ellipse. + * + * @name Phaser.Curves.Ellipse#_yRadius + * @type {number} + * @private + * @since 3.0.0 + */ + this._yRadius = yRadius; + + // Radians + + /** + * The starting angle of the ellipse in radians. + * + * @name Phaser.Curves.Ellipse#_startAngle + * @type {number} + * @private + * @since 3.0.0 + */ + this._startAngle = DegToRad(startAngle); + + /** + * The end angle of the ellipse in radians. + * + * @name Phaser.Curves.Ellipse#_endAngle + * @type {number} + * @private + * @since 3.0.0 + */ + this._endAngle = DegToRad(endAngle); + + /** + * Anti-clockwise direction. + * + * @name Phaser.Curves.Ellipse#_clockwise + * @type {boolean} + * @private + * @since 3.0.0 + */ + this._clockwise = clockwise; + + /** + * The rotation of the arc. + * + * @name Phaser.Curves.Ellipse#_rotation + * @type {number} + * @private + * @since 3.0.0 + */ + this._rotation = DegToRad(rotation); + }, + + /** + * Gets the starting point on the curve. + * + * @method Phaser.Curves.Ellipse#getStartPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getStartPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + return this.getPoint(0, out); + }, + + /** + * [description] + * + * @method Phaser.Curves.Ellipse#getResolution + * @since 3.0.0 + * + * @param {number} divisions - [description] + * + * @return {number} [description] + */ + getResolution: function (divisions) + { + return divisions * 2; + }, + + /** + * Get point at relative position in curve according to length. + * + * @method Phaser.Curves.Ellipse#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end. + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getPoint: function (t, out) + { + if (out === undefined) { out = new Vector2(); } + + var twoPi = Math.PI * 2; + var deltaAngle = this._endAngle - this._startAngle; + var samePoints = Math.abs(deltaAngle) < Number.EPSILON; + + // ensures that deltaAngle is 0 .. 2 PI + while (deltaAngle < 0) + { + deltaAngle += twoPi; + } + + while (deltaAngle > twoPi) + { + deltaAngle -= twoPi; + } + + if (deltaAngle < Number.EPSILON) + { + if (samePoints) + { + deltaAngle = 0; + } + else + { + deltaAngle = twoPi; + } + } + + if (this._clockwise && !samePoints) + { + if (deltaAngle === twoPi) + { + deltaAngle = - twoPi; + } + else + { + deltaAngle = deltaAngle - twoPi; + } + } + + var angle = this._startAngle + t * deltaAngle; + var x = this.p0.x + this._xRadius * Math.cos(angle); + var y = this.p0.y + this._yRadius * Math.sin(angle); + + if (this._rotation !== 0) + { + var cos = Math.cos(this._rotation); + var sin = Math.sin(this._rotation); + + var tx = x - this.p0.x; + var ty = y - this.p0.y; + + // Rotate the point about the center of the ellipse. + x = tx * cos - ty * sin + this.p0.x; + y = tx * sin + ty * cos + this.p0.y; + } + + return out.set(x, y); + }, + + /** + * Sets the horizontal radius of this curve. + * + * @method Phaser.Curves.Ellipse#setXRadius + * @since 3.0.0 + * + * @param {number} value - The horizontal radius of this curve. + * + * @return {Phaser.Curves.Ellipse} This curve object. + */ + setXRadius: function (value) + { + this.xRadius = value; + + return this; + }, + + /** + * Sets the vertical radius of this curve. + * + * @method Phaser.Curves.Ellipse#setYRadius + * @since 3.0.0 + * + * @param {number} value - The vertical radius of this curve. + * + * @return {Phaser.Curves.Ellipse} This curve object. + */ + setYRadius: function (value) + { + this.yRadius = value; + + return this; + }, + + /** + * Sets the width of this curve. + * + * @method Phaser.Curves.Ellipse#setWidth + * @since 3.0.0 + * + * @param {number} value - The width of this curve. + * + * @return {Phaser.Curves.Ellipse} This curve object. + */ + setWidth: function (value) + { + this.xRadius = value * 2; + + return this; + }, + + /** + * Sets the height of this curve. + * + * @method Phaser.Curves.Ellipse#setHeight + * @since 3.0.0 + * + * @param {number} value - The height of this curve. + * + * @return {Phaser.Curves.Ellipse} This curve object. + */ + setHeight: function (value) + { + this.yRadius = value * 2; + + return this; + }, + + /** + * Sets the start angle of this curve. + * + * @method Phaser.Curves.Ellipse#setStartAngle + * @since 3.0.0 + * + * @param {number} value - The start angle of this curve, in radians. + * + * @return {Phaser.Curves.Ellipse} This curve object. + */ + setStartAngle: function (value) + { + this.startAngle = value; + + return this; + }, + + /** + * Sets the end angle of this curve. + * + * @method Phaser.Curves.Ellipse#setEndAngle + * @since 3.0.0 + * + * @param {number} value - The end angle of this curve, in radians. + * + * @return {Phaser.Curves.Ellipse} This curve object. + */ + setEndAngle: function (value) + { + this.endAngle = value; + + return this; + }, + + /** + * Sets if this curve extends clockwise or anti-clockwise. + * + * @method Phaser.Curves.Ellipse#setClockwise + * @since 3.0.0 + * + * @param {boolean} value - The clockwise state of this curve. + * + * @return {Phaser.Curves.Ellipse} This curve object. + */ + setClockwise: function (value) + { + this.clockwise = value; + + return this; + }, + + /** + * Sets the rotation of this curve. + * + * @method Phaser.Curves.Ellipse#setRotation + * @since 3.0.0 + * + * @param {number} value - The rotation of this curve, in radians. + * + * @return {Phaser.Curves.Ellipse} This curve object. + */ + setRotation: function (value) + { + this.rotation = value; + + return this; + }, + + /** + * The x coordinate of the center of the ellipse. + * + * @name Phaser.Curves.Ellipse#x + * @type {number} + * @since 3.0.0 + */ + x: { + + get: function () + { + return this.p0.x; + }, + + set: function (value) + { + this.p0.x = value; + } + + }, + + /** + * The y coordinate of the center of the ellipse. + * + * @name Phaser.Curves.Ellipse#y + * @type {number} + * @since 3.0.0 + */ + y: { + + get: function () + { + return this.p0.y; + }, + + set: function (value) + { + this.p0.y = value; + } + + }, + + /** + * The horizontal radius of the ellipse. + * + * @name Phaser.Curves.Ellipse#xRadius + * @type {number} + * @since 3.0.0 + */ + xRadius: { + + get: function () + { + return this._xRadius; + }, + + set: function (value) + { + this._xRadius = value; + } + + }, + + /** + * The vertical radius of the ellipse. + * + * @name Phaser.Curves.Ellipse#yRadius + * @type {number} + * @since 3.0.0 + */ + yRadius: { + + get: function () + { + return this._yRadius; + }, + + set: function (value) + { + this._yRadius = value; + } + + }, + + /** + * The start angle of the ellipse in degrees. + * + * @name Phaser.Curves.Ellipse#startAngle + * @type {number} + * @since 3.0.0 + */ + startAngle: { + + get: function () + { + return RadToDeg(this._startAngle); + }, + + set: function (value) + { + this._startAngle = DegToRad(value); + } + + }, + + /** + * The end angle of the ellipse in degrees. + * + * @name Phaser.Curves.Ellipse#endAngle + * @type {number} + * @since 3.0.0 + */ + endAngle: { + + get: function () + { + return RadToDeg(this._endAngle); + }, + + set: function (value) + { + this._endAngle = DegToRad(value); + } + + }, + + /** + * `true` if the ellipse rotation is clockwise or `false` if anti-clockwise. + * + * @name Phaser.Curves.Ellipse#clockwise + * @type {boolean} + * @since 3.0.0 + */ + clockwise: { + + get: function () + { + return this._clockwise; + }, + + set: function (value) + { + this._clockwise = value; + } + + }, + + /** + * The rotation of the ellipse, relative to the center, in degrees. + * + * @name Phaser.Curves.Ellipse#angle + * @type {number} + * @since 3.14.0 + */ + angle: { + + get: function () + { + return RadToDeg(this._rotation); + }, + + set: function (value) + { + this._rotation = DegToRad(value); + } + + }, + + /** + * The rotation of the ellipse, relative to the center, in radians. + * + * @name Phaser.Curves.Ellipse#rotation + * @type {number} + * @since 3.0.0 + */ + rotation: { + + get: function () + { + return this._rotation; + }, + + set: function (value) + { + this._rotation = value; + } + + }, + + /** + * JSON serialization of the curve. + * + * @method Phaser.Curves.Ellipse#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Curves.JSONEllipseCurve} The JSON object containing this curve data. + */ + toJSON: function () + { + return { + type: this.type, + x: this.p0.x, + y: this.p0.y, + xRadius: this._xRadius, + yRadius: this._yRadius, + startAngle: RadToDeg(this._startAngle), + endAngle: RadToDeg(this._endAngle), + clockwise: this._clockwise, + rotation: RadToDeg(this._rotation) + }; + } + +}); + +/** + * Creates a curve from the provided Ellipse Curve Configuration object. + * + * @function Phaser.Curves.Ellipse.fromJSON + * @since 3.0.0 + * + * @param {Phaser.Types.Curves.JSONEllipseCurve} data - The JSON object containing this curve data. + * + * @return {Phaser.Curves.Ellipse} The ellipse curve constructed from the configuration object. + */ +EllipseCurve.fromJSON = function (data) +{ + return new EllipseCurve(data); +}; + +module.exports = EllipseCurve; + + +/***/ }), +/* 322 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) + +var Class = __webpack_require__(0); +var Curve = __webpack_require__(79); +var FromPoints = __webpack_require__(172); +var Rectangle = __webpack_require__(10); +var Vector2 = __webpack_require__(4); + +var tmpVec2 = new Vector2(); + +/** + * @classdesc + * A LineCurve is a "curve" comprising exactly two points (a line segment). + * + * @class Line + * @extends Phaser.Curves.Curve + * @memberof Phaser.Curves + * @constructor + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|number[])} p0 - The first endpoint. + * @param {Phaser.Math.Vector2} [p1] - The second endpoint. + */ +var LineCurve = new Class({ + + Extends: Curve, + + initialize: + + // vec2s or array + function LineCurve (p0, p1) + { + Curve.call(this, 'LineCurve'); + + if (Array.isArray(p0)) + { + p1 = new Vector2(p0[2], p0[3]); + p0 = new Vector2(p0[0], p0[1]); + } + + /** + * The first endpoint. + * + * @name Phaser.Curves.Line#p0 + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.p0 = p0; + + /** + * The second endpoint. + * + * @name Phaser.Curves.Line#p1 + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.p1 = p1; + }, + + /** + * Returns a Rectangle where the position and dimensions match the bounds of this Curve. + * + * @method Phaser.Curves.Line#getBounds + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} [out] - A Rectangle object to store the bounds in. If not given a new Rectangle will be created. + * + * @return {Phaser.Geom.Rectangle} A Rectangle object holding the bounds of this curve. If `out` was given it will be this object. + */ + getBounds: function (out) + { + if (out === undefined) { out = new Rectangle(); } + + return FromPoints([ this.p0, this.p1 ], out); + }, + + /** + * Gets the starting point on the curve. + * + * @method Phaser.Curves.Line#getStartPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getStartPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + return out.copy(this.p0); + }, + + /** + * Gets the resolution of the line. + * + * @method Phaser.Curves.Line#getResolution + * @since 3.0.0 + * + * @param {number} [divisions=1] - The number of divisions to consider. + * + * @return {number} The resolution. Equal to the number of divisions. + */ + getResolution: function (divisions) + { + if (divisions === undefined) { divisions = 1; } + + return divisions; + }, + + /** + * Get point at relative position in curve according to length. + * + * @method Phaser.Curves.Line#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end. + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getPoint: function (t, out) + { + if (out === undefined) { out = new Vector2(); } + + if (t === 1) + { + return out.copy(this.p1); + } + + out.copy(this.p1).subtract(this.p0).scale(t).add(this.p0); + + return out; + }, + + // Line curve is linear, so we can overwrite default getPointAt + + /** + * Gets a point at a given position on the line. + * + * @method Phaser.Curves.Line#getPointAt + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} u - The position along the curve to return. Where 0 is the start and 1 is the end. + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getPointAt: function (u, out) + { + return this.getPoint(u, out); + }, + + /** + * Gets the slope of the line as a unit vector. + * + * @method Phaser.Curves.Line#getTangent + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @return {Phaser.Math.Vector2} The tangent vector. + */ + getTangent: function () + { + var tangent = tmpVec2.copy(this.p1).subtract(this.p0); + + return tangent.normalize(); + }, + + // Override default Curve.draw because this is better than calling getPoints on a line! + + /** + * Draws this curve on the given Graphics object. + * + * The curve is drawn using `Graphics.lineBetween` so will be drawn at whatever the present Graphics line color is. + * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. + * + * @method Phaser.Curves.Line#draw + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] + * + * @param {Phaser.GameObjects.Graphics} graphics - The Graphics instance onto which this curve will be drawn. + * + * @return {Phaser.GameObjects.Graphics} The Graphics object to which the curve was drawn. + */ + draw: function (graphics) + { + graphics.lineBetween(this.p0.x, this.p0.y, this.p1.x, this.p1.y); + + // So you can chain graphics calls + return graphics; + }, + + /** + * Gets a JSON representation of the line. + * + * @method Phaser.Curves.Line#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Curves.JSONCurve} The JSON object containing this curve data. + */ + toJSON: function () + { + return { + type: this.type, + points: [ + this.p0.x, this.p0.y, + this.p1.x, this.p1.y + ] + }; + } + +}); + +/** + * Configures this line from a JSON representation. + * + * @function Phaser.Curves.Line.fromJSON + * @since 3.0.0 + * + * @param {Phaser.Types.Curves.JSONCurve} data - The JSON object containing this curve data. + * + * @return {Phaser.Curves.Line} A new LineCurve object. + */ +LineCurve.fromJSON = function (data) +{ + var points = data.points; + + var p0 = new Vector2(points[0], points[1]); + var p1 = new Vector2(points[2], points[3]); + + return new LineCurve(p0, p1); +}; + +module.exports = LineCurve; + + +/***/ }), +/* 323 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Curve = __webpack_require__(79); +var QuadraticBezierInterpolation = __webpack_require__(300); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * [description] + * + * @class QuadraticBezier + * @extends Phaser.Curves.Curve + * @memberof Phaser.Curves + * @constructor + * @since 3.2.0 + * + * @param {(Phaser.Math.Vector2|number[])} p0 - Start point, or an array of point pairs. + * @param {Phaser.Math.Vector2} p1 - Control Point 1. + * @param {Phaser.Math.Vector2} p2 - Control Point 2. + */ +var QuadraticBezier = new Class({ + + Extends: Curve, + + initialize: + + function QuadraticBezier (p0, p1, p2) + { + Curve.call(this, 'QuadraticBezier'); + + if (Array.isArray(p0)) + { + p2 = new Vector2(p0[4], p0[5]); + p1 = new Vector2(p0[2], p0[3]); + p0 = new Vector2(p0[0], p0[1]); + } + + /** + * [description] + * + * @name Phaser.Curves.QuadraticBezier#p0 + * @type {Phaser.Math.Vector2} + * @since 3.2.0 + */ + this.p0 = p0; + + /** + * [description] + * + * @name Phaser.Curves.QuadraticBezier#p1 + * @type {Phaser.Math.Vector2} + * @since 3.2.0 + */ + this.p1 = p1; + + /** + * [description] + * + * @name Phaser.Curves.QuadraticBezier#p2 + * @type {Phaser.Math.Vector2} + * @since 3.2.0 + */ + this.p2 = p2; + }, + + /** + * Gets the starting point on the curve. + * + * @method Phaser.Curves.QuadraticBezier#getStartPoint + * @since 3.2.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getStartPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + return out.copy(this.p0); + }, + + /** + * [description] + * + * @method Phaser.Curves.QuadraticBezier#getResolution + * @since 3.2.0 + * + * @param {number} divisions - [description] + * + * @return {number} [description] + */ + getResolution: function (divisions) + { + return divisions; + }, + + /** + * Get point at relative position in curve according to length. + * + * @method Phaser.Curves.QuadraticBezier#getPoint + * @since 3.2.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end. + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getPoint: function (t, out) + { + if (out === undefined) { out = new Vector2(); } + + var p0 = this.p0; + var p1 = this.p1; + var p2 = this.p2; + + return out.set( + QuadraticBezierInterpolation(t, p0.x, p1.x, p2.x), + QuadraticBezierInterpolation(t, p0.y, p1.y, p2.y) + ); + }, + + /** + * [description] + * + * @method Phaser.Curves.QuadraticBezier#draw + * @since 3.2.0 + * + * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] + * + * @param {Phaser.GameObjects.Graphics} graphics - `Graphics` object to draw onto. + * @param {integer} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. + * + * @return {Phaser.GameObjects.Graphics} `Graphics` object that was drawn to. + */ + draw: function (graphics, pointsTotal) + { + if (pointsTotal === undefined) { pointsTotal = 32; } + + var points = this.getPoints(pointsTotal); + + graphics.beginPath(); + graphics.moveTo(this.p0.x, this.p0.y); + + for (var i = 1; i < points.length; i++) + { + graphics.lineTo(points[i].x, points[i].y); + } + + graphics.strokePath(); + + // So you can chain graphics calls + return graphics; + }, + + /** + * Converts the curve into a JSON compatible object. + * + * @method Phaser.Curves.QuadraticBezier#toJSON + * @since 3.2.0 + * + * @return {Phaser.Types.Curves.JSONCurve} The JSON object containing this curve data. + */ + toJSON: function () + { + return { + type: this.type, + points: [ + this.p0.x, this.p0.y, + this.p1.x, this.p1.y, + this.p2.x, this.p2.y + ] + }; + } + +}); + +/** + * Creates a curve from a JSON object, e. g. created by `toJSON`. + * + * @function Phaser.Curves.QuadraticBezier.fromJSON + * @since 3.2.0 + * + * @param {Phaser.Types.Curves.JSONCurve} data - The JSON object containing this curve data. + * + * @return {Phaser.Curves.QuadraticBezier} The created curve instance. + */ +QuadraticBezier.fromJSON = function (data) +{ + var points = data.points; + + var p0 = new Vector2(points[0], points[1]); + var p1 = new Vector2(points[2], points[3]); + var p2 = new Vector2(points[4], points[5]); + + return new QuadraticBezier(p0, p1, p2); +}; + +module.exports = QuadraticBezier; + + +/***/ }), +/* 324 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) + +var CatmullRom = __webpack_require__(167); +var Class = __webpack_require__(0); +var Curve = __webpack_require__(79); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * [description] + * + * @class Spline + * @extends Phaser.Curves.Curve + * @memberof Phaser.Curves + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2[]} [points] - [description] + */ +var SplineCurve = new Class({ + + Extends: Curve, + + initialize: + + function SplineCurve (points) + { + if (points === undefined) { points = []; } + + Curve.call(this, 'SplineCurve'); + + /** + * [description] + * + * @name Phaser.Curves.Spline#points + * @type {Phaser.Math.Vector2[]} + * @default [] + * @since 3.0.0 + */ + this.points = []; + + this.addPoints(points); + }, + + /** + * [description] + * + * @method Phaser.Curves.Spline#addPoints + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2[]|number[]|number[][])} points - [description] + * + * @return {Phaser.Curves.Spline} This curve object. + */ + addPoints: function (points) + { + for (var i = 0; i < points.length; i++) + { + var p = new Vector2(); + + if (typeof points[i] === 'number') + { + p.x = points[i]; + p.y = points[i + 1]; + i++; + } + else if (Array.isArray(points[i])) + { + // An array of arrays? + p.x = points[i][0]; + p.y = points[i][1]; + } + else + { + p.x = points[i].x; + p.y = points[i].y; + } + + this.points.push(p); + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Curves.Spline#addPoint + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ + addPoint: function (x, y) + { + var vec = new Vector2(x, y); + + this.points.push(vec); + + return vec; + }, + + /** + * Gets the starting point on the curve. + * + * @method Phaser.Curves.Spline#getStartPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getStartPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + return out.copy(this.points[0]); + }, + + /** + * [description] + * + * @method Phaser.Curves.Spline#getResolution + * @since 3.0.0 + * + * @param {number} divisions - [description] + * + * @return {number} [description] + */ + getResolution: function (divisions) + { + return divisions * this.points.length; + }, + + /** + * Get point at relative position in curve according to length. + * + * @method Phaser.Curves.Spline#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end. + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getPoint: function (t, out) + { + if (out === undefined) { out = new Vector2(); } + + var points = this.points; + + var point = (points.length - 1) * t; + + var intPoint = Math.floor(point); + + var weight = point - intPoint; + + var p0 = points[(intPoint === 0) ? intPoint : intPoint - 1]; + var p1 = points[intPoint]; + var p2 = points[(intPoint > points.length - 2) ? points.length - 1 : intPoint + 1]; + var p3 = points[(intPoint > points.length - 3) ? points.length - 1 : intPoint + 2]; + + return out.set(CatmullRom(weight, p0.x, p1.x, p2.x, p3.x), CatmullRom(weight, p0.y, p1.y, p2.y, p3.y)); + }, + + /** + * [description] + * + * @method Phaser.Curves.Spline#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Curves.JSONCurve} The JSON object containing this curve data. + */ + toJSON: function () + { + var points = []; + + for (var i = 0; i < this.points.length; i++) + { + points.push(this.points[i].x); + points.push(this.points[i].y); + } + + return { + type: this.type, + points: points + }; + } + +}); + +/** + * [description] + * + * @function Phaser.Curves.Spline.fromJSON + * @since 3.0.0 + * + * @param {Phaser.Types.Curves.JSONCurve} data - The JSON object containing this curve data. + * + * @return {Phaser.Curves.Spline} [description] + */ +SplineCurve.fromJSON = function (data) +{ + return new SplineCurve(data.points); +}; + +module.exports = SplineCurve; + + +/***/ }), +/* 325 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A BaseShader is a small resource class that contains the data required for a WebGL Shader to be created. + * + * It contains the raw source code to the fragment and vertex shader, as well as an object that defines + * the uniforms the shader requires, if any. + * + * BaseShaders are stored in the Shader Cache, available in a Scene via `this.cache.shaders` and are referenced + * by a unique key-based string. Retrieve them via `this.cache.shaders.get(key)`. + * + * BaseShaders are created automatically by the GLSL File Loader when loading an external shader resource. + * They can also be created at runtime, allowing you to use dynamically generated shader source code. + * + * Default fragment and vertex source is used if not provided in the constructor, setting-up a basic shader, + * suitable for debug rendering. + * + * @class BaseShader + * @memberof Phaser.Display + * @constructor + * @since 3.17.0 + * + * @param {string} key - The key of this shader. Must be unique within the shader cache. + * @param {string} [fragmentSrc] - The fragment source for the shader. + * @param {string} [vertexSrc] - The vertex source for the shader. + * @param {any} [uniforms] - Optional object defining the uniforms the shader uses. + */ +var BaseShader = new Class({ + + initialize: + + function BaseShader (key, fragmentSrc, vertexSrc, uniforms) + { + if (!fragmentSrc || fragmentSrc === '') + { + fragmentSrc = [ + 'precision mediump float;', + + 'uniform vec2 resolution;', + + 'varying vec2 fragCoord;', + + 'void main () {', + ' vec2 uv = fragCoord / resolution.xy;', + ' gl_FragColor = vec4(uv.xyx, 1.0);', + '}' + ].join('\n'); + } + + if (!vertexSrc || vertexSrc === '') + { + vertexSrc = [ + 'precision mediump float;', + + 'uniform mat4 uProjectionMatrix;', + 'uniform mat4 uViewMatrix;', + 'uniform vec2 uResolution;', + + 'attribute vec2 inPosition;', + + 'varying vec2 fragCoord;', + + 'void main () {', + 'gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);', + 'fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);', + '}' + ].join('\n'); + } + + if (uniforms === undefined) { uniforms = null; } + + /** + * The key of this shader, unique within the shader cache of this Phaser game instance. + * + * @name Phaser.Display.BaseShader#key + * @type {string} + * @since 3.17.0 + */ + this.key = key; + + /** + * The source code, as a string, of the fragment shader being used. + * + * @name Phaser.Display.BaseShader#fragmentSrc + * @type {string} + * @since 3.17.0 + */ + this.fragmentSrc = fragmentSrc; + + /** + * The source code, as a string, of the vertex shader being used. + * + * @name Phaser.Display.BaseShader#vertexSrc + * @type {string} + * @since 3.17.0 + */ + this.vertexSrc = vertexSrc; + + /** + * The default uniforms for this shader. + * + * @name Phaser.Display.BaseShader#uniforms + * @type {?any} + * @since 3.17.0 + */ + this.uniforms = uniforms; + } + +}); + +module.exports = BaseShader; + + +/***/ }), +/* 326 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Color = __webpack_require__(33); + +Color.ColorToRGBA = __webpack_require__(770); +Color.ComponentToHex = __webpack_require__(327); +Color.GetColor = __webpack_require__(160); +Color.GetColor32 = __webpack_require__(270); +Color.HexStringToColor = __webpack_require__(269); +Color.HSLToColor = __webpack_require__(771); +Color.HSVColorWheel = __webpack_require__(772); +Color.HSVToRGB = __webpack_require__(161); +Color.HueToComponent = __webpack_require__(328); +Color.IntegerToColor = __webpack_require__(272); +Color.IntegerToRGB = __webpack_require__(273); +Color.Interpolate = __webpack_require__(773); +Color.ObjectToColor = __webpack_require__(274); +Color.RandomRGB = __webpack_require__(774); +Color.RGBStringToColor = __webpack_require__(275); +Color.RGBToHSV = __webpack_require__(271); +Color.RGBToString = __webpack_require__(775); +Color.ValueToColor = __webpack_require__(159); + +module.exports = Color; + + +/***/ }), +/* 327 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns a string containing a hex representation of the given color component. + * + * @function Phaser.Display.Color.ComponentToHex + * @since 3.0.0 + * + * @param {integer} color - The color channel to get the hex value for, must be a value between 0 and 255. + * + * @return {string} A string of length 2 characters, i.e. 255 = ff, 100 = 64. + */ +var ComponentToHex = function (color) +{ + var hex = color.toString(16); + + return (hex.length === 1) ? '0' + hex : hex; +}; + +module.exports = ComponentToHex; + + +/***/ }), +/* 328 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts a hue to an RGB color. + * Based on code by Michael Jackson (https://github.com/mjijackson) + * + * @function Phaser.Display.Color.HueToComponent + * @since 3.0.0 + * + * @param {number} p + * @param {number} q + * @param {number} t + * + * @return {number} The combined color value. + */ +var HueToComponent = function (p, q, t) +{ + if (t < 0) + { + t += 1; + } + + if (t > 1) + { + t -= 1; + } + + if (t < 1 / 6) + { + return p + (q - p) * 6 * t; + } + + if (t < 1 / 2) + { + return q; + } + + if (t < 2 / 3) + { + return p + (q - p) * (2 / 3 - t) * 6; + } + + return p; +}; + +module.exports = HueToComponent; + + +/***/ }), +/* 329 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var OS = __webpack_require__(115); + +/** + * @callback ContentLoadedCallback + */ + +/** + * Inspects the readyState of the document. If the document is already complete then it invokes the given callback. + * If not complete it sets up several event listeners such as `deviceready`, and once those fire, it invokes the callback. + * Called automatically by the Phaser.Game instance. Should not usually be accessed directly. + * + * @function Phaser.DOM.DOMContentLoaded + * @since 3.0.0 + * + * @param {ContentLoadedCallback} callback - The callback to be invoked when the device is ready and the DOM content is loaded. + */ +var DOMContentLoaded = function (callback) +{ + if (document.readyState === 'complete' || document.readyState === 'interactive') + { + callback(); + + return; + } + + var check = function () + { + document.removeEventListener('deviceready', check, true); + document.removeEventListener('DOMContentLoaded', check, true); + window.removeEventListener('load', check, true); + + callback(); + }; + + if (!document.body) + { + window.setTimeout(check, 20); + } + else if (OS.cordova) + { + // Ref. http://docs.phonegap.com/en/3.5.0/cordova_events_events.md.html#deviceready + document.addEventListener('deviceready', check, false); + } + else + { + document.addEventListener('DOMContentLoaded', check, true); + window.addEventListener('load', check, true); + } +}; + +module.exports = DOMContentLoaded; + + +/***/ }), +/* 330 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(173); + +/** + * Attempts to determine the screen orientation using the Orientation API. + * + * @function Phaser.DOM.GetScreenOrientation + * @since 3.16.0 + * + * @param {number} width - The width of the viewport. + * @param {number} height - The height of the viewport. + * + * @return {string} The orientation. + */ +var GetScreenOrientation = function (width, height) +{ + var screen = window.screen; + var orientation = (screen) ? screen.orientation || screen.mozOrientation || screen.msOrientation : false; + + if (orientation && typeof orientation.type === 'string') + { + // Screen Orientation API specification + return orientation.type; + } + else if (typeof orientation === 'string') + { + // moz / ms-orientation are strings + return orientation; + } + + if (screen) + { + return (screen.height > screen.width) ? CONST.PORTRAIT : CONST.LANDSCAPE; + } + else if (typeof window.orientation === 'number') + { + // This may change by device based on "natural" orientation. + return (window.orientation === 0 || window.orientation === 180) ? CONST.PORTRAIT : CONST.LANDSCAPE; + } + else if (window.matchMedia) + { + if (window.matchMedia('(orientation: portrait)').matches) + { + return CONST.PORTRAIT; + } + else if (window.matchMedia('(orientation: landscape)').matches) + { + return CONST.LANDSCAPE; + } + } + + return (height > width) ? CONST.PORTRAIT : CONST.LANDSCAPE; +}; + +module.exports = GetScreenOrientation; + + +/***/ }), +/* 331 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Scale Manager constants for centering the game canvas. + * + * @namespace Phaser.Scale.Center + * @memberof Phaser.Scale + * @since 3.16.0 + */ + +/** + * Phaser Scale Manager constants for centering the game canvas. + * + * To find out what each mode does please see [Phaser.Scale.Center]{@link Phaser.Scale.Center}. + * + * @typedef {Phaser.Scale.Center} Phaser.Scale.CenterType + * @memberof Phaser.Scale + * @since 3.16.0 + */ + +module.exports = { + + /** + * The game canvas is not centered within the parent by Phaser. + * You can still center it yourself via CSS. + * + * @name Phaser.Scale.Center.NO_CENTER + * @type {integer} + * @const + * @since 3.16.0 + */ + NO_CENTER: 0, + + /** + * The game canvas is centered both horizontally and vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + * + * @name Phaser.Scale.Center.CENTER_BOTH + * @type {integer} + * @const + * @since 3.16.0 + */ + CENTER_BOTH: 1, + + /** + * The game canvas is centered horizontally within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + * + * @name Phaser.Scale.Center.CENTER_HORIZONTALLY + * @type {integer} + * @const + * @since 3.16.0 + */ + CENTER_HORIZONTALLY: 2, + + /** + * The game canvas is centered both vertically within the parent. + * To do this, the parent has to have a bounds that can be calculated and not be empty. + * + * Centering is achieved by setting the margin left and top properties of the + * game canvas, and does not factor in any other CSS styles you may have applied. + * + * @name Phaser.Scale.Center.CENTER_VERTICALLY + * @type {integer} + * @const + * @since 3.16.0 + */ + CENTER_VERTICALLY: 3 + +}; + + +/***/ }), +/* 332 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Scale Manager constants for orientation. + * + * @namespace Phaser.Scale.Orientation + * @memberof Phaser.Scale + * @since 3.16.0 + */ + +/** + * Phaser Scale Manager constants for orientation. + * + * To find out what each mode does please see [Phaser.Scale.Orientation]{@link Phaser.Scale.Orientation}. + * + * @typedef {Phaser.Scale.Orientation} Phaser.Scale.OrientationType + * @memberof Phaser.Scale + * @since 3.16.0 + */ + +module.exports = { + + /** + * A landscape orientation. + * + * @name Phaser.Scale.Orientation.LANDSCAPE + * @type {string} + * @const + * @since 3.16.0 + */ + LANDSCAPE: 'landscape-primary', + + /** + * A portrait orientation. + * + * @name Phaser.Scale.Orientation.PORTRAIT + * @type {string} + * @const + * @since 3.16.0 + */ + PORTRAIT: 'portrait-primary' + +}; + + +/***/ }), +/* 333 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Scale Manager constants for the different scale modes available. + * + * @namespace Phaser.Scale.ScaleModes + * @memberof Phaser.Scale + * @since 3.16.0 + */ + +/** + * Phaser Scale Manager constants for the different scale modes available. + * + * To find out what each mode does please see [Phaser.Scale.ScaleModes]{@link Phaser.Scale.ScaleModes}. + * + * @typedef {Phaser.Scale.ScaleModes} Phaser.Scale.ScaleModeType + * @memberof Phaser.Scale + * @since 3.16.0 + */ + +module.exports = { + + /** + * No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it + * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need + * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. + * + * @name Phaser.Scale.ScaleModes.NONE + * @type {integer} + * @const + * @since 3.16.0 + */ + NONE: 0, + + /** + * The height is automatically adjusted based on the width. + * + * @name Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT + * @type {integer} + * @const + * @since 3.16.0 + */ + WIDTH_CONTROLS_HEIGHT: 1, + + /** + * The width is automatically adjusted based on the height. + * + * @name Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH + * @type {integer} + * @const + * @since 3.16.0 + */ + HEIGHT_CONTROLS_WIDTH: 2, + + /** + * The width and height are automatically adjusted to fit inside the given target area, + * while keeping the aspect ratio. Depending on the aspect ratio there may be some space + * inside the area which is not covered. + * + * @name Phaser.Scale.ScaleModes.FIT + * @type {integer} + * @const + * @since 3.16.0 + */ + FIT: 3, + + /** + * The width and height are automatically adjusted to make the size cover the entire target + * area while keeping the aspect ratio. This may extend further out than the target size. + * + * @name Phaser.Scale.ScaleModes.ENVELOP + * @type {integer} + * @const + * @since 3.16.0 + */ + ENVELOP: 4, + + /** + * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. + * + * @name Phaser.Scale.ScaleModes.RESIZE + * @type {integer} + * @const + * @since 3.16.0 + */ + RESIZE: 5 + +}; + + +/***/ }), +/* 334 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Scale Manager constants for zoom modes. + * + * @namespace Phaser.Scale.Zoom + * @memberof Phaser.Scale + * @since 3.16.0 + */ + +/** + * Phaser Scale Manager constants for zoom modes. + * + * To find out what each mode does please see [Phaser.Scale.Zoom]{@link Phaser.Scale.Zoom}. + * + * @typedef {Phaser.Scale.Zoom} Phaser.Scale.ZoomType + * @memberof Phaser.Scale + * @since 3.16.0 + */ + +module.exports = { + + /** + * The game canvas will not be zoomed by Phaser. + * + * @name Phaser.Scale.Zoom.NO_ZOOM + * @type {integer} + * @const + * @since 3.16.0 + */ + NO_ZOOM: 1, + + /** + * The game canvas will be 2x zoomed by Phaser. + * + * @name Phaser.Scale.Zoom.ZOOM_2X + * @type {integer} + * @const + * @since 3.16.0 + */ + ZOOM_2X: 2, + + /** + * The game canvas will be 4x zoomed by Phaser. + * + * @name Phaser.Scale.Zoom.ZOOM_4X + * @type {integer} + * @const + * @since 3.16.0 + */ + ZOOM_4X: 4, + + /** + * Calculate the zoom value based on the maximum multiplied game size that will + * fit into the parent, or browser window if no parent is set. + * + * @name Phaser.Scale.Zoom.MAX_ZOOM + * @type {integer} + * @const + * @since 3.16.0 + */ + MAX_ZOOM: -1 + +}; + + +/***/ }), +/* 335 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Attempts to get the target DOM element based on the given value, which can be either + * a string, in which case it will be looked-up by ID, or an element node. If nothing + * can be found it will return a reference to the document.body. + * + * @function Phaser.DOM.GetTarget + * @since 3.16.0 + * + * @param {HTMLElement} element - The DOM element to look-up. + */ +var GetTarget = function (element) +{ + var target; + + if (element !== '') + { + if (typeof element === 'string') + { + // Hopefully an element ID + target = document.getElementById(element); + } + else if (element && element.nodeType === 1) + { + // Quick test for a HTMLElement + target = element; + } + } + + // Fallback to the document body. Covers an invalid ID and a non HTMLElement object. + if (!target) + { + // Use the full window + target = document.body; + } + + return target; +}; + +module.exports = GetTarget; + + +/***/ }), +/* 336 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes the given data string and parses it as XML. + * First tries to use the window.DOMParser and reverts to the Microsoft.XMLDOM if that fails. + * The parsed XML object is returned, or `null` if there was an error while parsing the data. + * + * @function Phaser.DOM.ParseXML + * @since 3.0.0 + * + * @param {string} data - The XML source stored in a string. + * + * @return {?(DOMParser|ActiveXObject)} The parsed XML data, or `null` if the data could not be parsed. + */ +var ParseXML = function (data) +{ + var xml = ''; + + try + { + if (window['DOMParser']) + { + var domparser = new DOMParser(); + xml = domparser.parseFromString(data, 'text/xml'); + } + else + { + xml = new ActiveXObject('Microsoft.XMLDOM'); + xml.loadXML(data); + } + } + catch (e) + { + xml = null; + } + + if (!xml || !xml.documentElement || xml.getElementsByTagName('parsererror').length) + { + return null; + } + else + { + return xml; + } +}; + +module.exports = ParseXML; + + +/***/ }), +/* 337 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(175); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(53); +var GameEvents = __webpack_require__(28); +var Keyboard = __webpack_require__(338); +var Mouse = __webpack_require__(339); +var Pointer = __webpack_require__(340); +var Touch = __webpack_require__(341); +var TransformMatrix = __webpack_require__(32); +var TransformXY = __webpack_require__(307); + +/** + * @classdesc + * The Input Manager is responsible for handling the pointer related systems in a single Phaser Game instance. + * + * Based on the Game Config it will create handlers for mouse and touch support. + * + * Keyboard and Gamepad are plugins, handled directly by the InputPlugin class. + * + * It then manages the events, pointer creation and general hit test related operations. + * + * You rarely need to interact with the Input Manager directly, and as such, all of its properties and methods + * should be considered private. Instead, you should use the Input Plugin, which is a Scene level system, responsible + * for dealing with all input events for a Scene. + * + * @class InputManager + * @memberof Phaser.Input + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - The Game instance that owns the Input Manager. + * @param {object} config - The Input Configuration object, as set in the Game Config. + */ +var InputManager = new Class({ + + initialize: + + function InputManager (game, config) + { + /** + * The Game instance that owns the Input Manager. + * A Game only maintains on instance of the Input Manager at any time. + * + * @name Phaser.Input.InputManager#game + * @type {Phaser.Game} + * @readonly + * @since 3.0.0 + */ + this.game = game; + + /** + * A reference to the global Game Scale Manager. + * Used for all bounds checks and pointer scaling. + * + * @name Phaser.Input.InputManager#scaleManager + * @type {Phaser.Scale.ScaleManager} + * @since 3.16.0 + */ + this.scaleManager; + + /** + * The Canvas that is used for all DOM event input listeners. + * + * @name Phaser.Input.InputManager#canvas + * @type {HTMLCanvasElement} + * @since 3.0.0 + */ + this.canvas; + + /** + * The Game Configuration object, as set during the game boot. + * + * @name Phaser.Input.InputManager#config + * @type {Phaser.Core.Config} + * @since 3.0.0 + */ + this.config = config; + + /** + * If set, the Input Manager will run its update loop every frame. + * + * @name Phaser.Input.InputManager#enabled + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.enabled = true; + + /** + * The Event Emitter instance that the Input Manager uses to emit events from. + * + * @name Phaser.Input.InputManager#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = new EventEmitter(); + + /** + * Are any mouse or touch pointers currently over the game canvas? + * This is updated automatically by the canvas over and out handlers. + * + * @name Phaser.Input.InputManager#isOver + * @type {boolean} + * @readonly + * @since 3.16.0 + */ + this.isOver = true; + + /** + * The default CSS cursor to be used when interacting with your game. + * + * See the `setDefaultCursor` method for more details. + * + * @name Phaser.Input.InputManager#defaultCursor + * @type {string} + * @since 3.10.0 + */ + this.defaultCursor = ''; + + /** + * A reference to the Keyboard Manager class, if enabled via the `input.keyboard` Game Config property. + * + * @name Phaser.Input.InputManager#keyboard + * @type {?Phaser.Input.Keyboard.KeyboardManager} + * @since 3.16.0 + */ + this.keyboard = (config.inputKeyboard) ? new Keyboard(this) : null; + + /** + * A reference to the Mouse Manager class, if enabled via the `input.mouse` Game Config property. + * + * @name Phaser.Input.InputManager#mouse + * @type {?Phaser.Input.Mouse.MouseManager} + * @since 3.0.0 + */ + this.mouse = (config.inputMouse) ? new Mouse(this) : null; + + /** + * A reference to the Touch Manager class, if enabled via the `input.touch` Game Config property. + * + * @name Phaser.Input.InputManager#touch + * @type {Phaser.Input.Touch.TouchManager} + * @since 3.0.0 + */ + this.touch = (config.inputTouch) ? new Touch(this) : null; + + /** + * An array of Pointers that have been added to the game. + * The first entry is reserved for the Mouse Pointer, the rest are Touch Pointers. + * + * By default there is 1 touch pointer enabled. If you need more use the `addPointer` method to start them, + * or set the `input.activePointers` property in the Game Config. + * + * @name Phaser.Input.InputManager#pointers + * @type {Phaser.Input.Pointer[]} + * @since 3.10.0 + */ + this.pointers = []; + + /** + * The number of touch objects activated and being processed each update. + * + * You can change this by either calling `addPointer` at run-time, or by + * setting the `input.activePointers` property in the Game Config. + * + * @name Phaser.Input.InputManager#pointersTotal + * @type {integer} + * @readonly + * @since 3.10.0 + */ + this.pointersTotal = config.inputActivePointers; + + if (config.inputTouch && this.pointersTotal === 1) + { + this.pointersTotal = 2; + } + + for (var i = 0; i <= this.pointersTotal; i++) + { + var pointer = new Pointer(this, i); + + pointer.smoothFactor = config.inputSmoothFactor; + + this.pointers.push(pointer); + } + + /** + * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. + * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer` + * which will always map to the most recently interacted pointer. + * + * @name Phaser.Input.InputManager#mousePointer + * @type {?Phaser.Input.Pointer} + * @since 3.10.0 + */ + this.mousePointer = (config.inputMouse) ? this.pointers[0] : null; + + /** + * The most recently active Pointer object. + * + * If you've only 1 Pointer in your game then this will accurately be either the first finger touched, or the mouse. + * + * If your game doesn't need to support multi-touch then you can safely use this property in all of your game + * code and it will adapt to be either the mouse or the touch, based on device. + * + * @name Phaser.Input.InputManager#activePointer + * @type {Phaser.Input.Pointer} + * @since 3.0.0 + */ + this.activePointer = this.pointers[0]; + + /** + * If the top-most Scene in the Scene List receives an input it will stop input from + * propagating any lower down the scene list, i.e. if you have a UI Scene at the top + * and click something on it, that click will not then be passed down to any other + * Scene below. Disable this to have input events passed through all Scenes, all the time. + * + * @name Phaser.Input.InputManager#globalTopOnly + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.globalTopOnly = true; + + /** + * The time this Input Manager was last updated. + * This value is populated by the Game Step each frame. + * + * @name Phaser.Input.InputManager#time + * @type {number} + * @readonly + * @since 3.16.2 + */ + this.time = 0; + + /** + * A re-cycled point-like object to store hit test values in. + * + * @name Phaser.Input.InputManager#_tempPoint + * @type {{x:number, y:number}} + * @private + * @since 3.0.0 + */ + this._tempPoint = { x: 0, y: 0 }; + + /** + * A re-cycled array to store hit results in. + * + * @name Phaser.Input.InputManager#_tempHitTest + * @type {array} + * @private + * @default [] + * @since 3.0.0 + */ + this._tempHitTest = []; + + /** + * A re-cycled matrix used in hit test calculations. + * + * @name Phaser.Input.InputManager#_tempMatrix + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @private + * @since 3.4.0 + */ + this._tempMatrix = new TransformMatrix(); + + /** + * A re-cycled matrix used in hit test calculations. + * + * @name Phaser.Input.InputManager#_tempMatrix2 + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @private + * @since 3.12.0 + */ + this._tempMatrix2 = new TransformMatrix(); + + /** + * An internal private var that records Scenes aborting event processing. + * + * @name Phaser.Input.InputManager#_tempSkip + * @type {boolean} + * @private + * @since 3.18.0 + */ + this._tempSkip = false; + + /** + * An internal private array that avoids needing to create a new array on every DOM mouse event. + * + * @name Phaser.Input.InputManager#mousePointerContainer + * @type {Phaser.Input.Pointer[]} + * @private + * @since 3.18.0 + */ + this.mousePointerContainer = [ this.mousePointer ]; + + game.events.once(GameEvents.BOOT, this.boot, this); + }, + + /** + * The Boot handler is called by Phaser.Game when it first starts up. + * The renderer is available by now. + * + * @method Phaser.Input.InputManager#boot + * @protected + * @fires Phaser.Input.Events#MANAGER_BOOT + * @since 3.0.0 + */ + boot: function () + { + this.canvas = this.game.canvas; + + this.scaleManager = this.game.scale; + + this.events.emit(Events.MANAGER_BOOT); + + this.game.events.on(GameEvents.PRE_RENDER, this.preRender, this); + + this.game.events.once(GameEvents.DESTROY, this.destroy, this); + }, + + /** + * Internal canvas state change, called automatically by the Mouse Manager. + * + * @method Phaser.Input.InputManager#setCanvasOver + * @fires Phaser.Input.Events#GAME_OVER + * @private + * @since 3.16.0 + * + * @param {(MouseEvent|TouchEvent)} event - The DOM Event. + */ + setCanvasOver: function (event) + { + this.isOver = true; + + this.events.emit(Events.GAME_OVER, event); + }, + + /** + * Internal canvas state change, called automatically by the Mouse Manager. + * + * @method Phaser.Input.InputManager#setCanvasOut + * @fires Phaser.Input.Events#GAME_OUT + * @private + * @since 3.16.0 + * + * @param {(MouseEvent|TouchEvent)} event - The DOM Event. + */ + setCanvasOut: function (event) + { + this.isOver = false; + + this.events.emit(Events.GAME_OUT, event); + }, + + /** + * Internal update, called automatically by the Game Step right at the start. + * + * @method Phaser.Input.InputManager#preRender + * @private + * @since 3.18.0 + */ + preRender: function () + { + var time = this.game.loop.now; + var delta = this.game.loop.delta; + var scenes = this.game.scene.getScenes(true, true); + + this.time = time; + + this.events.emit(Events.MANAGER_UPDATE); + + for (var i = 0; i < scenes.length; i++) + { + var scene = scenes[i]; + + if (scene.sys.input && scene.sys.input.updatePoll(time, delta) && this.globalTopOnly) + { + // If the Scene returns true, it means it captured some input that no other Scene should get, so we bail out + return; + } + } + }, + + /** + * Tells the Input system to set a custom cursor. + * + * This cursor will be the default cursor used when interacting with the game canvas. + * + * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. + * + * Any valid CSS cursor value is allowed, including paths to image files, i.e.: + * + * ```javascript + * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); + * ``` + * + * Please read about the differences between browsers when it comes to the file formats and sizes they support: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property + * + * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support. + * + * @method Phaser.Input.InputManager#setDefaultCursor + * @since 3.10.0 + * + * @param {string} cursor - The CSS to be used when setting the default cursor. + */ + setDefaultCursor: function (cursor) + { + this.defaultCursor = cursor; + + if (this.canvas.style.cursor !== cursor) + { + this.canvas.style.cursor = cursor; + } + }, + + /** + * Called by the InputPlugin when processing over and out events. + * + * Tells the Input Manager to set a custom cursor during its postUpdate step. + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + * + * @method Phaser.Input.InputManager#setCursor + * @private + * @since 3.10.0 + * + * @param {Phaser.Types.Input.InteractiveObject} interactiveObject - The Interactive Object that called this method. + */ + setCursor: function (interactiveObject) + { + if (interactiveObject.cursor) + { + this.canvas.style.cursor = interactiveObject.cursor; + } + }, + + /** + * Called by the InputPlugin when processing over and out events. + * + * Tells the Input Manager to clear the hand cursor, if set, during its postUpdate step. + * + * @method Phaser.Input.InputManager#resetCursor + * @private + * @since 3.10.0 + * + * @param {Phaser.Types.Input.InteractiveObject} interactiveObject - The Interactive Object that called this method. + */ + resetCursor: function (interactiveObject) + { + if (interactiveObject.cursor) + { + this.canvas.style.cursor = this.defaultCursor; + } + }, + + /** + * Adds new Pointer objects to the Input Manager. + * + * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`. + * + * You can create more either by calling this method, or by setting the `input.activePointers` property + * in the Game Config, up to a maximum of 10 pointers. + * + * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added + * via this method. + * + * @method Phaser.Input.InputManager#addPointer + * @since 3.10.0 + * + * @param {integer} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. + * + * @return {Phaser.Input.Pointer[]} An array containing all of the new Pointer objects that were created. + */ + addPointer: function (quantity) + { + if (quantity === undefined) { quantity = 1; } + + var output = []; + + if (this.pointersTotal + quantity > 10) + { + quantity = 10 - this.pointersTotal; + } + + for (var i = 0; i < quantity; i++) + { + var id = this.pointers.length; + + var pointer = new Pointer(this, id); + + pointer.smoothFactor = this.config.inputSmoothFactor; + + this.pointers.push(pointer); + + this.pointersTotal++; + + output.push(pointer); + } + + return output; + }, + + /** + * Internal method that gets a list of all the active Input Plugins in the game + * and updates each of them in turn, in reverse order (top to bottom), to allow + * for DOM top-level event handling simulation. + * + * @method Phaser.Input.InputManager#updateInputPlugins + * @since 3.16.0 + * + * @param {integer} type - The type of event to process. + * @param {Phaser.Input.Pointer[]} pointers - An array of Pointers on which the event occurred. + */ + updateInputPlugins: function (type, pointers) + { + var scenes = this.game.scene.getScenes(true, true); + + this._tempSkip = false; + + for (var i = 0; i < scenes.length; i++) + { + var scene = scenes[i]; + + if (scene.sys.input) + { + var capture = scene.sys.input.update(type, pointers); + + if ((capture && this.globalTopOnly) || this._tempSkip) + { + // If the Scene returns true, or called stopPropagation, it means it captured some input that no other Scene should get, so we bail out + return; + } + } + } + }, + + // event.targetTouches = list of all touches on the TARGET ELEMENT (i.e. game dom element) + // event.touches = list of all touches on the ENTIRE DOCUMENT, not just the target element + // event.changedTouches = the touches that CHANGED in this event, not the total number of them + + /** + * Processes a touch start event, as passed in by the TouchManager. + * + * @method Phaser.Input.InputManager#onTouchStart + * @private + * @since 3.18.0 + * + * @param {TouchEvent} event - The native DOM Touch event. + */ + onTouchStart: function (event) + { + var pointers = this.pointers; + var changed = []; + + for (var c = 0; c < event.changedTouches.length; c++) + { + var changedTouch = event.changedTouches[c]; + + for (var i = 1; i < this.pointersTotal; i++) + { + var pointer = pointers[i]; + + if (!pointer.active) + { + pointer.touchstart(changedTouch, event); + + this.activePointer = pointer; + + changed.push(pointer); + + break; + } + } + } + + this.updateInputPlugins(CONST.TOUCH_START, changed); + }, + + /** + * Processes a touch move event, as passed in by the TouchManager. + * + * @method Phaser.Input.InputManager#onTouchMove + * @private + * @since 3.18.0 + * + * @param {TouchEvent} event - The native DOM Touch event. + */ + onTouchMove: function (event) + { + var pointers = this.pointers; + var changed = []; + + for (var c = 0; c < event.changedTouches.length; c++) + { + var changedTouch = event.changedTouches[c]; + + for (var i = 1; i < this.pointersTotal; i++) + { + var pointer = pointers[i]; + + if (pointer.active && pointer.identifier === changedTouch.identifier) + { + pointer.touchmove(changedTouch, event); + + this.activePointer = pointer; + + changed.push(pointer); + + break; + } + } + } + + this.updateInputPlugins(CONST.TOUCH_MOVE, changed); + }, + + // For touch end its a list of the touch points that have been removed from the surface + // https://developer.mozilla.org/en-US/docs/DOM/TouchList + // event.changedTouches = the touches that CHANGED in this event, not the total number of them + + /** + * Processes a touch end event, as passed in by the TouchManager. + * + * @method Phaser.Input.InputManager#onTouchEnd + * @private + * @since 3.18.0 + * + * @param {TouchEvent} event - The native DOM Touch event. + */ + onTouchEnd: function (event) + { + var pointers = this.pointers; + var changed = []; + + for (var c = 0; c < event.changedTouches.length; c++) + { + var changedTouch = event.changedTouches[c]; + + for (var i = 1; i < this.pointersTotal; i++) + { + var pointer = pointers[i]; + + if (pointer.active && pointer.identifier === changedTouch.identifier) + { + pointer.touchend(changedTouch, event); + + changed.push(pointer); + + break; + } + } + } + + this.updateInputPlugins(CONST.TOUCH_END, changed); + }, + + /** + * Processes a touch cancel event, as passed in by the TouchManager. + * + * @method Phaser.Input.InputManager#onTouchCancel + * @private + * @since 3.18.0 + * + * @param {TouchEvent} event - The native DOM Touch event. + */ + onTouchCancel: function (event) + { + var pointers = this.pointers; + var changed = []; + + for (var c = 0; c < event.changedTouches.length; c++) + { + var changedTouch = event.changedTouches[c]; + + for (var i = 1; i < this.pointersTotal; i++) + { + var pointer = pointers[i]; + + if (pointer.active && pointer.identifier === changedTouch.identifier) + { + pointer.touchcancel(changedTouch, event); + + changed.push(pointer); + + break; + } + } + } + + this.updateInputPlugins(CONST.TOUCH_CANCEL, changed); + }, + + /** + * Processes a mouse down event, as passed in by the MouseManager. + * + * @method Phaser.Input.InputManager#onMouseDown + * @private + * @since 3.18.0 + * + * @param {MouseEvent} event - The native DOM Mouse event. + */ + onMouseDown: function (event) + { + this.mousePointer.down(event); + + this.mousePointer.updateMotion(); + + this.updateInputPlugins(CONST.MOUSE_DOWN, this.mousePointerContainer); + }, + + /** + * Processes a mouse move event, as passed in by the MouseManager. + * + * @method Phaser.Input.InputManager#onMouseMove + * @private + * @since 3.18.0 + * + * @param {MouseEvent} event - The native DOM Mouse event. + */ + onMouseMove: function (event) + { + this.mousePointer.move(event); + + this.mousePointer.updateMotion(); + + this.updateInputPlugins(CONST.MOUSE_MOVE, this.mousePointerContainer); + }, + + /** + * Processes a mouse up event, as passed in by the MouseManager. + * + * @method Phaser.Input.InputManager#onMouseUp + * @private + * @since 3.18.0 + * + * @param {MouseEvent} event - The native DOM Mouse event. + */ + onMouseUp: function (event) + { + this.mousePointer.up(event); + + this.mousePointer.updateMotion(); + + this.updateInputPlugins(CONST.MOUSE_UP, this.mousePointerContainer); + }, + + /** + * Processes a mouse wheel event, as passed in by the MouseManager. + * + * @method Phaser.Input.InputManager#onMouseWheel + * @private + * @since 3.18.0 + * + * @param {WheelEvent} event - The native DOM Wheel event. + */ + onMouseWheel: function (event) + { + this.mousePointer.wheel(event); + + this.updateInputPlugins(CONST.MOUSE_WHEEL, this.mousePointerContainer); + }, + + /** + * Checks if the given Game Object should be considered as a candidate for input or not. + * + * Checks if the Game Object has an input component that is enabled, that it will render, + * and finally, if it has a parent, that the parent parent, or any ancestor, is visible or not. + * + * @method Phaser.Input.InputManager#inputCandidate + * @private + * @since 3.10.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to test. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera which is being tested against. + * + * @return {boolean} `true` if the Game Object should be considered for input, otherwise `false`. + */ + inputCandidate: function (gameObject, camera) + { + var input = gameObject.input; + + if (!input || !input.enabled || !gameObject.willRender(camera)) + { + return false; + } + + var visible = true; + var parent = gameObject.parentContainer; + + if (parent) + { + do + { + if (!parent.willRender(camera)) + { + visible = false; + break; + } + + parent = parent.parentContainer; + + } while (parent); + } + + return visible; + }, + + /** + * Performs a hit test using the given Pointer and camera, against an array of interactive Game Objects. + * + * The Game Objects are culled against the camera, and then the coordinates are translated into the local camera space + * and used to determine if they fall within the remaining Game Objects hit areas or not. + * + * If nothing is matched an empty array is returned. + * + * This method is called automatically by InputPlugin.hitTestPointer and doesn't usually need to be invoked directly. + * + * @method Phaser.Input.InputManager#hitTest + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to test against. + * @param {array} gameObjects - An array of interactive Game Objects to check. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera which is being tested against. + * @param {array} [output] - An array to store the results in. If not given, a new empty array is created. + * + * @return {array} An array of the Game Objects that were hit during this hit test. + */ + hitTest: function (pointer, gameObjects, camera, output) + { + if (output === undefined) { output = this._tempHitTest; } + + var tempPoint = this._tempPoint; + + var csx = camera.scrollX; + var csy = camera.scrollY; + + output.length = 0; + + var x = pointer.x; + var y = pointer.y; + + if (camera.resolution !== 1) + { + x += camera._x; + y += camera._y; + } + + // Stores the world point inside of tempPoint + camera.getWorldPoint(x, y, tempPoint); + + pointer.worldX = tempPoint.x; + pointer.worldY = tempPoint.y; + + var point = { x: 0, y: 0 }; + + var matrix = this._tempMatrix; + var parentMatrix = this._tempMatrix2; + + for (var i = 0; i < gameObjects.length; i++) + { + var gameObject = gameObjects[i]; + + // Checks if the Game Object can receive input (isn't being ignored by the camera, invisible, etc) + // and also checks all of its parents, if any + if (!this.inputCandidate(gameObject, camera)) + { + continue; + } + + var px = tempPoint.x + (csx * gameObject.scrollFactorX) - csx; + var py = tempPoint.y + (csy * gameObject.scrollFactorY) - csy; + + if (gameObject.parentContainer) + { + gameObject.getWorldTransformMatrix(matrix, parentMatrix); + + matrix.applyInverse(px, py, point); + } + else + { + TransformXY(px, py, gameObject.x, gameObject.y, gameObject.rotation, gameObject.scaleX, gameObject.scaleY, point); + } + + if (this.pointWithinHitArea(gameObject, point.x, point.y)) + { + output.push(gameObject); + } + } + + return output; + }, + + /** + * Checks if the given x and y coordinate are within the hit area of the Game Object. + * + * This method assumes that the coordinate values have already been translated into the space of the Game Object. + * + * If the coordinates are within the hit area they are set into the Game Objects Input `localX` and `localY` properties. + * + * @method Phaser.Input.InputManager#pointWithinHitArea + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object to check against. + * @param {number} x - The translated x coordinate for the hit test. + * @param {number} y - The translated y coordinate for the hit test. + * + * @return {boolean} `true` if the coordinates were inside the Game Objects hit area, otherwise `false`. + */ + pointWithinHitArea: function (gameObject, x, y) + { + // Normalize the origin + x += gameObject.displayOriginX; + y += gameObject.displayOriginY; + + var input = gameObject.input; + + if (input && input.hitAreaCallback(input.hitArea, x, y, gameObject)) + { + input.localX = x; + input.localY = y; + + return true; + } + else + { + return false; + } + }, + + /** + * Checks if the given x and y coordinate are within the hit area of the Interactive Object. + * + * This method assumes that the coordinate values have already been translated into the space of the Interactive Object. + * + * If the coordinates are within the hit area they are set into the Interactive Objects Input `localX` and `localY` properties. + * + * @method Phaser.Input.InputManager#pointWithinInteractiveObject + * @since 3.0.0 + * + * @param {Phaser.Types.Input.InteractiveObject} object - The Interactive Object to check against. + * @param {number} x - The translated x coordinate for the hit test. + * @param {number} y - The translated y coordinate for the hit test. + * + * @return {boolean} `true` if the coordinates were inside the Game Objects hit area, otherwise `false`. + */ + pointWithinInteractiveObject: function (object, x, y) + { + if (!object.hitArea) + { + return false; + } + + // Normalize the origin + x += object.gameObject.displayOriginX; + y += object.gameObject.displayOriginY; + + object.localX = x; + object.localY = y; + + return object.hitAreaCallback(object.hitArea, x, y, object); + }, + + /** + * Transforms the pageX and pageY values of a Pointer into the scaled coordinate space of the Input Manager. + * + * @method Phaser.Input.InputManager#transformPointer + * @since 3.10.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to transform the values for. + * @param {number} pageX - The Page X value. + * @param {number} pageY - The Page Y value. + * @param {boolean} wasMove - Are we transforming the Pointer from a move event, or an up / down event? + */ + transformPointer: function (pointer, pageX, pageY, wasMove) + { + var p0 = pointer.position; + var p1 = pointer.prevPosition; + + // Store previous position + p1.x = p0.x; + p1.y = p0.y; + + // Translate coordinates + var x = this.scaleManager.transformX(pageX); + var y = this.scaleManager.transformY(pageY); + + var a = pointer.smoothFactor; + + if (!wasMove || a === 0) + { + // Set immediately + p0.x = x; + p0.y = y; + } + else + { + // Apply smoothing + p0.x = x * a + p1.x * (1 - a); + p0.y = y * a + p1.y * (1 - a); + } + }, + + /** + * Destroys the Input Manager and all of its systems. + * + * There is no way to recover from doing this. + * + * @method Phaser.Input.InputManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.events.removeAllListeners(); + + this.game.events.off(GameEvents.PRE_RENDER); + + if (this.keyboard) + { + this.keyboard.destroy(); + } + + if (this.mouse) + { + this.mouse.destroy(); + } + + if (this.touch) + { + this.touch.destroy(); + } + + for (var i = 0; i < this.pointers.length; i++) + { + this.pointers[i].destroy(); + } + + this.pointers = []; + this._tempHitTest = []; + this._tempMatrix.destroy(); + this.canvas = null; + this.game = null; + } + +}); + +module.exports = InputManager; + + +/***/ }), +/* 338 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArrayRemove = __webpack_require__(120); +var Class = __webpack_require__(0); +var GameEvents = __webpack_require__(28); +var InputEvents = __webpack_require__(53); +var KeyCodes = __webpack_require__(121); +var NOOP = __webpack_require__(0); + +/** + * @classdesc + * The Keyboard Manager is a helper class that belongs to the global Input Manager. + * + * Its role is to listen for native DOM Keyboard Events and then store them for further processing by the Keyboard Plugin. + * + * You do not need to create this class directly, the Input Manager will create an instance of it automatically if keyboard + * input has been enabled in the Game Config. + * + * @class KeyboardManager + * @memberof Phaser.Input.Keyboard + * @constructor + * @since 3.16.0 + * + * @param {Phaser.Input.InputManager} inputManager - A reference to the Input Manager. + */ +var KeyboardManager = new Class({ + + initialize: + + function KeyboardManager (inputManager) + { + /** + * A reference to the Input Manager. + * + * @name Phaser.Input.Keyboard.KeyboardManager#manager + * @type {Phaser.Input.InputManager} + * @since 3.16.0 + */ + this.manager = inputManager; + + /** + * An internal event queue. + * + * @name Phaser.Input.Keyboard.KeyboardManager#queue + * @type {KeyboardEvent[]} + * @private + * @since 3.16.0 + */ + this.queue = []; + + /** + * A flag that controls if the non-modified keys, matching those stored in the `captures` array, + * have `preventDefault` called on them or not. + * + * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are + * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows). + * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier. + * However, if the user presses just the r key on its own, it will have its event prevented. + * + * If you wish to stop capturing the keys, for example switching out to a DOM based element, then + * you can toggle this property at run-time. + * + * @name Phaser.Input.Keyboard.KeyboardManager#preventDefault + * @type {boolean} + * @since 3.16.0 + */ + this.preventDefault = true; + + /** + * An array of Key Code values that will automatically have `preventDefault` called on them, + * as long as the `KeyboardManager.preventDefault` boolean is set to `true`. + * + * By default the array is empty. + * + * The key must be non-modified when pressed in order to be captured. + * + * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are + * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows). + * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier. + * However, if the user presses just the r key on its own, it will have its event prevented. + * + * If you wish to stop capturing the keys, for example switching out to a DOM based element, then + * you can toggle the `KeyboardManager.preventDefault` boolean at run-time. + * + * If you need more specific control, you can create Key objects and set the flag on each of those instead. + * + * This array can be populated via the Game Config by setting the `input.keyboard.capture` array, or you + * can call the `addCapture` method. See also `removeCapture` and `clearCaptures`. + * + * @name Phaser.Input.Keyboard.KeyboardManager#captures + * @type {integer[]} + * @since 3.16.0 + */ + this.captures = []; + + /** + * A boolean that controls if the Keyboard Manager is enabled or not. + * Can be toggled on the fly. + * + * @name Phaser.Input.Keyboard.KeyboardManager#enabled + * @type {boolean} + * @default false + * @since 3.16.0 + */ + this.enabled = false; + + /** + * The Keyboard Event target, as defined in the Game Config. + * Typically the window in which the game is rendering, but can be any interactive DOM element. + * + * @name Phaser.Input.Keyboard.KeyboardManager#target + * @type {any} + * @since 3.16.0 + */ + this.target; + + /** + * The Key Down Event handler. + * This function is sent the native DOM KeyEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Keyboard.KeyboardManager#onKeyDown + * @type {function} + * @since 3.16.00 + */ + this.onKeyDown = NOOP; + + /** + * The Key Up Event handler. + * This function is sent the native DOM KeyEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Keyboard.KeyboardManager#onKeyUp + * @type {function} + * @since 3.16.00 + */ + this.onKeyUp = NOOP; + + inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this); + }, + + /** + * The Keyboard Manager boot process. + * + * @method Phaser.Input.Keyboard.KeyboardManager#boot + * @private + * @since 3.16.0 + */ + boot: function () + { + var config = this.manager.config; + + this.enabled = config.inputKeyboard; + this.target = config.inputKeyboardEventTarget; + + this.addCapture(config.inputKeyboardCapture); + + if (!this.target && window) + { + this.target = window; + } + + if (this.enabled && this.target) + { + this.startListeners(); + } + + this.manager.game.events.on(GameEvents.POST_STEP, this.postUpdate, this); + }, + + /** + * Starts the Keyboard Event listeners running. + * This is called automatically and does not need to be manually invoked. + * + * @method Phaser.Input.Keyboard.KeyboardManager#startListeners + * @since 3.16.0 + */ + startListeners: function () + { + var _this = this; + + this.onKeyDown = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.queue.push(event); + + if (!_this.manager.useQueue) + { + _this.manager.events.emit(InputEvents.MANAGER_PROCESS); + } + + var modified = (event.altKey || event.ctrlKey || event.shiftKey || event.metaKey); + + if (_this.preventDefault && !modified && _this.captures.indexOf(event.keyCode) > -1) + { + event.preventDefault(); + } + }; + + this.onKeyUp = function (event) + { + if (event.defaultPrevented || !_this.enabled || !_this.manager) + { + // Do nothing if event already handled + return; + } + + _this.queue.push(event); + + if (!_this.manager.useQueue) + { + _this.manager.events.emit(InputEvents.MANAGER_PROCESS); + } + + var modified = (event.altKey || event.ctrlKey || event.shiftKey || event.metaKey); + + if (_this.preventDefault && !modified && _this.captures.indexOf(event.keyCode) > -1) + { + event.preventDefault(); + } + }; + + var target = this.target; + + if (target) + { + target.addEventListener('keydown', this.onKeyDown, false); + target.addEventListener('keyup', this.onKeyUp, false); + + this.enabled = true; + } + }, + + /** + * Stops the Key Event listeners. + * This is called automatically and does not need to be manually invoked. + * + * @method Phaser.Input.Keyboard.KeyboardManager#stopListeners + * @since 3.16.0 + */ + stopListeners: function () + { + var target = this.target; + + target.removeEventListener('keydown', this.onKeyDown, false); + target.removeEventListener('keyup', this.onKeyUp, false); + + this.enabled = false; + }, + + /** + * Clears the event queue. + * Called automatically by the Input Manager. + * + * @method Phaser.Input.Keyboard.KeyboardManager#postUpdate + * @private + * @since 3.16.0 + */ + postUpdate: function () + { + this.queue = []; + }, + + /** + * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. + * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. + * + * This `addCapture` method enables consuming keyboard event for specific keys so it doesn't bubble up to the the browser + * and cause the default browser behavior. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent + * the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one. + * + * You can pass in a single key code value, or an array of key codes, or a string: + * + * ```javascript + * this.input.keyboard.addCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.addCapture([ 62, 63, 64 ]); + * ``` + * + * Or a string: + * + * ```javascript + * this.input.keyboard.addCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * + * If there are active captures after calling this method, the `preventDefault` property is set to `true`. + * + * @method Phaser.Input.Keyboard.KeyboardManager#addCapture + * @since 3.16.0 + * + * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable capture for, preventing them reaching the browser. + */ + addCapture: function (keycode) + { + if (typeof keycode === 'string') + { + keycode = keycode.split(','); + } + + if (!Array.isArray(keycode)) + { + keycode = [ keycode ]; + } + + var captures = this.captures; + + for (var i = 0; i < keycode.length; i++) + { + var code = keycode[i]; + + if (typeof code === 'string') + { + code = KeyCodes[code.trim().toUpperCase()]; + } + + if (captures.indexOf(code) === -1) + { + captures.push(code); + } + } + + this.preventDefault = captures.length > 0; + }, + + /** + * Removes an existing key capture. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to remove + * the capture of a key, then it will remove it for any Scene in your game, not just the calling one. + * + * You can pass in a single key code value, or an array of key codes, or a string: + * + * ```javascript + * this.input.keyboard.removeCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.removeCapture([ 62, 63, 64 ]); + * ``` + * + * Or a string: + * + * ```javascript + * this.input.keyboard.removeCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * + * If there are no captures left after calling this method, the `preventDefault` property is set to `false`. + * + * @method Phaser.Input.Keyboard.KeyboardManager#removeCapture + * @since 3.16.0 + * + * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable capture for, allowing them reaching the browser again. + */ + removeCapture: function (keycode) + { + if (typeof keycode === 'string') + { + keycode = keycode.split(','); + } + + if (!Array.isArray(keycode)) + { + keycode = [ keycode ]; + } + + var captures = this.captures; + + for (var i = 0; i < keycode.length; i++) + { + var code = keycode[i]; + + if (typeof code === 'string') + { + code = KeyCodes[code.toUpperCase()]; + } + + ArrayRemove(captures, code); + } + + this.preventDefault = captures.length > 0; + }, + + /** + * Removes all keyboard captures and sets the `preventDefault` property to `false`. + * + * @method Phaser.Input.Keyboard.KeyboardManager#clearCaptures + * @since 3.16.0 + */ + clearCaptures: function () + { + this.captures = []; + + this.preventDefault = false; + }, + + /** + * Destroys this Keyboard Manager instance. + * + * @method Phaser.Input.Keyboard.KeyboardManager#destroy + * @since 3.16.0 + */ + destroy: function () + { + this.stopListeners(); + + this.clearCaptures(); + + this.queue = []; + + this.manager.game.events.off(GameEvents.POST_RENDER, this.postUpdate, this); + + this.target = null; + this.enabled = false; + this.manager = null; + } + +}); + +module.exports = KeyboardManager; + + +/***/ }), +/* 339 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Features = __webpack_require__(164); +var InputEvents = __webpack_require__(53); +var NOOP = __webpack_require__(0); + +// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent +// https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md + +/** + * @classdesc + * The Mouse Manager is a helper class that belongs to the Input Manager. + * + * Its role is to listen for native DOM Mouse Events and then pass them onto the Input Manager for further processing. + * + * You do not need to create this class directly, the Input Manager will create an instance of it automatically. + * + * @class MouseManager + * @memberof Phaser.Input.Mouse + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Input.InputManager} inputManager - A reference to the Input Manager. + */ +var MouseManager = new Class({ + + initialize: + + function MouseManager (inputManager) + { + /** + * A reference to the Input Manager. + * + * @name Phaser.Input.Mouse.MouseManager#manager + * @type {Phaser.Input.InputManager} + * @since 3.0.0 + */ + this.manager = inputManager; + + /** + * If true the DOM mouse events will have event.preventDefault applied to them, if false they will propagate fully. + * + * @name Phaser.Input.Mouse.MouseManager#capture + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.capture = true; + + /** + * A boolean that controls if the Mouse Manager is enabled or not. + * Can be toggled on the fly. + * + * @name Phaser.Input.Mouse.MouseManager#enabled + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.enabled = false; + + /** + * The Touch Event target, as defined in the Game Config. + * Typically the canvas to which the game is rendering, but can be any interactive DOM element. + * + * @name Phaser.Input.Mouse.MouseManager#target + * @type {any} + * @since 3.0.0 + */ + this.target; + + /** + * If the mouse has been pointer locked successfully this will be set to true. + * + * @name Phaser.Input.Mouse.MouseManager#locked + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.locked = false; + + /** + * The Mouse Move Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Mouse.MouseManager#onMouseMove + * @type {function} + * @since 3.10.0 + */ + this.onMouseMove = NOOP; + + /** + * The Mouse Down Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Mouse.MouseManager#onMouseDown + * @type {function} + * @since 3.10.0 + */ + this.onMouseDown = NOOP; + + /** + * The Mouse Up Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Mouse.MouseManager#onMouseUp + * @type {function} + * @since 3.10.0 + */ + this.onMouseUp = NOOP; + + /** + * The Mouse Down Event handler specifically for events on the Window. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Mouse.MouseManager#onMouseDownWindow + * @type {function} + * @since 3.17.0 + */ + this.onMouseDownWindow = NOOP; + + /** + * The Mouse Up Event handler specifically for events on the Window. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Mouse.MouseManager#onMouseUpWindow + * @type {function} + * @since 3.17.0 + */ + this.onMouseUpWindow = NOOP; + + /** + * The Mouse Over Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Mouse.MouseManager#onMouseOver + * @type {function} + * @since 3.16.0 + */ + this.onMouseOver = NOOP; + + /** + * The Mouse Out Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Mouse.MouseManager#onMouseOut + * @type {function} + * @since 3.16.0 + */ + this.onMouseOut = NOOP; + + /** + * The Mouse Wheel Event handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Mouse.MouseManager#onMouseWheel + * @type {function} + * @since 3.18.0 + */ + this.onMouseWheel = NOOP; + + /** + * Internal pointerLockChange handler. + * This function is sent the native DOM MouseEvent. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Mouse.MouseManager#pointerLockChange + * @type {function} + * @since 3.0.0 + */ + this.pointerLockChange = NOOP; + + inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this); + }, + + /** + * The Touch Manager boot process. + * + * @method Phaser.Input.Mouse.MouseManager#boot + * @private + * @since 3.0.0 + */ + boot: function () + { + var config = this.manager.config; + + this.enabled = config.inputMouse; + this.target = config.inputMouseEventTarget; + this.capture = config.inputMouseCapture; + + if (!this.target) + { + this.target = this.manager.game.canvas; + } + + if (config.disableContextMenu) + { + this.disableContextMenu(); + } + + if (this.enabled && this.target) + { + this.startListeners(); + } + }, + + /** + * Attempts to disable the context menu from appearing if you right-click on the browser. + * + * Works by listening for the `contextmenu` event and prevent defaulting it. + * + * Use this if you need to enable right-button mouse support in your game, and the browser + * menu keeps getting in the way. + * + * @method Phaser.Input.Mouse.MouseManager#disableContextMenu + * @since 3.0.0 + * + * @return {Phaser.Input.Mouse.MouseManager} This Mouse Manager instance. + */ + disableContextMenu: function () + { + document.body.addEventListener('contextmenu', function (event) + { + event.preventDefault(); + return false; + }); + + return this; + }, + + /** + * If the browser supports it, you can request that the pointer be locked to the browser window. + * + * This is classically known as 'FPS controls', where the pointer can't leave the browser until + * the user presses an exit key. + * + * If the browser successfully enters a locked state, a `POINTER_LOCK_CHANGE_EVENT` will be dispatched, + * from the games Input Manager, with an `isPointerLocked` property. + * + * It is important to note that pointer lock can only be enabled after an 'engagement gesture', + * see: https://w3c.github.io/pointerlock/#dfn-engagement-gesture. + * + * @method Phaser.Input.Mouse.MouseManager#requestPointerLock + * @since 3.0.0 + */ + requestPointerLock: function () + { + if (Features.pointerLock) + { + var element = this.target; + + element.requestPointerLock = element.requestPointerLock || element.mozRequestPointerLock || element.webkitRequestPointerLock; + + element.requestPointerLock(); + } + }, + + /** + * If the browser supports pointer lock, this will request that the pointer lock is released. If + * the browser successfully enters a locked state, a 'POINTER_LOCK_CHANGE_EVENT' will be + * dispatched - from the game's input manager - with an `isPointerLocked` property. + * + * @method Phaser.Input.Mouse.MouseManager#releasePointerLock + * @since 3.0.0 + */ + releasePointerLock: function () + { + if (Features.pointerLock) + { + document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock; + document.exitPointerLock(); + } + }, + + /** + * Starts the Mouse Event listeners running. + * This is called automatically and does not need to be manually invoked. + * + * @method Phaser.Input.Mouse.MouseManager#startListeners + * @since 3.0.0 + */ + startListeners: function () + { + var _this = this; + var canvas = this.manager.canvas; + var autoFocus = (window && window.focus && this.manager.game.config.autoFocus); + + this.onMouseMove = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.onMouseMove(event); + + if (_this.capture) + { + event.preventDefault(); + } + } + }; + + this.onMouseDown = function (event) + { + if (autoFocus) + { + window.focus(); + } + + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.onMouseDown(event); + + if (_this.capture && event.target === canvas) + { + event.preventDefault(); + } + } + }; + + this.onMouseDownWindow = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + { + // Only process the event if the target isn't the canvas + _this.manager.onMouseDown(event); + } + }; + + this.onMouseUp = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.onMouseUp(event); + + if (_this.capture && event.target === canvas) + { + event.preventDefault(); + } + } + }; + + this.onMouseUpWindow = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + { + // Only process the event if the target isn't the canvas + _this.manager.onMouseUp(event); + } + }; + + this.onMouseOver = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.setCanvasOver(event); + } + }; + + this.onMouseOut = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.setCanvasOut(event); + } + }; + + this.onMouseWheel = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.onMouseWheel(event); + } + }; + + var target = this.target; + + if (!target) + { + return; + } + + var passive = { passive: true }; + var nonPassive = { passive: false }; + + target.addEventListener('mousemove', this.onMouseMove, (this.capture) ? nonPassive : passive); + target.addEventListener('mousedown', this.onMouseDown, (this.capture) ? nonPassive : passive); + target.addEventListener('mouseup', this.onMouseUp, (this.capture) ? nonPassive : passive); + target.addEventListener('mouseover', this.onMouseOver, (this.capture) ? nonPassive : passive); + target.addEventListener('mouseout', this.onMouseOut, (this.capture) ? nonPassive : passive); + target.addEventListener('wheel', this.onMouseWheel, (this.capture) ? nonPassive : passive); + + if (window && this.manager.game.config.inputWindowEvents) + { + window.addEventListener('mousedown', this.onMouseDownWindow, nonPassive); + window.addEventListener('mouseup', this.onMouseUpWindow, nonPassive); + } + + if (Features.pointerLock) + { + this.pointerLockChange = function (event) + { + var element = _this.target; + + _this.locked = (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) ? true : false; + + _this.manager.queue.push(event); + }; + + document.addEventListener('pointerlockchange', this.pointerLockChange, true); + document.addEventListener('mozpointerlockchange', this.pointerLockChange, true); + document.addEventListener('webkitpointerlockchange', this.pointerLockChange, true); + } + + this.enabled = true; + }, + + /** + * Stops the Mouse Event listeners. + * This is called automatically and does not need to be manually invoked. + * + * @method Phaser.Input.Mouse.MouseManager#stopListeners + * @since 3.0.0 + */ + stopListeners: function () + { + var target = this.target; + + target.removeEventListener('mousemove', this.onMouseMove); + target.removeEventListener('mousedown', this.onMouseDown); + target.removeEventListener('mouseup', this.onMouseUp); + target.removeEventListener('mouseover', this.onMouseOver); + target.removeEventListener('mouseout', this.onMouseOut); + + if (window) + { + window.removeEventListener('mousedown', this.onMouseDownWindow); + window.removeEventListener('mouseup', this.onMouseUpWindow); + } + + if (Features.pointerLock) + { + document.removeEventListener('pointerlockchange', this.pointerLockChange, true); + document.removeEventListener('mozpointerlockchange', this.pointerLockChange, true); + document.removeEventListener('webkitpointerlockchange', this.pointerLockChange, true); + } + }, + + /** + * Destroys this Mouse Manager instance. + * + * @method Phaser.Input.Mouse.MouseManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.stopListeners(); + + this.target = null; + this.enabled = false; + this.manager = null; + } + +}); + +module.exports = MouseManager; + + +/***/ }), +/* 340 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Angle = __webpack_require__(292); +var Class = __webpack_require__(0); +var Distance = __webpack_require__(57); +var FuzzyEqual = __webpack_require__(166); +var SmoothStepInterpolation = __webpack_require__(301); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Pointer object encapsulates both mouse and touch input within Phaser. + * + * By default, Phaser will create 2 pointers for your game to use. If you require more, i.e. for a multi-touch + * game, then use the `InputPlugin.addPointer` method to do so, rather than instantiating this class directly, + * otherwise it won't be managed by the input system. + * + * You can reference the current active pointer via `InputPlugin.activePointer`. You can also use the properties + * `InputPlugin.pointer1` through to `pointer10`, for each pointer you have enabled in your game. + * + * The properties of this object are set by the Input Plugin during processing. This object is then sent in all + * input related events that the Input Plugin emits, so you can reference properties from it directly in your + * callbacks. + * + * @class Pointer + * @memberof Phaser.Input + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Input.InputManager} manager - A reference to the Input Manager. + * @param {integer} id - The internal ID of this Pointer. + */ +var Pointer = new Class({ + + initialize: + + function Pointer (manager, id) + { + /** + * A reference to the Input Manager. + * + * @name Phaser.Input.Pointer#manager + * @type {Phaser.Input.InputManager} + * @since 3.0.0 + */ + this.manager = manager; + + /** + * The internal ID of this Pointer. + * + * @name Phaser.Input.Pointer#id + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.id = id; + + /** + * The most recent native DOM Event this Pointer has processed. + * + * @name Phaser.Input.Pointer#event + * @type {(TouchEvent|MouseEvent)} + * @since 3.0.0 + */ + this.event; + + /** + * The DOM element the Pointer was pressed down on, taken from the DOM event. + * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element. + * + * @name Phaser.Input.Pointer#downElement + * @type {any} + * @readonly + * @since 3.16.0 + */ + this.downElement; + + /** + * The DOM element the Pointer was released on, taken from the DOM event. + * In a default set-up this will be the Canvas that Phaser is rendering to, or the Window element. + * + * @name Phaser.Input.Pointer#upElement + * @type {any} + * @readonly + * @since 3.16.0 + */ + this.upElement; + + /** + * The camera the Pointer interacted with during its last update. + * + * A Pointer can only ever interact with one camera at once, which will be the top-most camera + * in the list should multiple cameras be positioned on-top of each other. + * + * @name Phaser.Input.Pointer#camera + * @type {Phaser.Cameras.Scene2D.Camera} + * @default null + * @since 3.0.0 + */ + this.camera = null; + + /** + * A read-only property that indicates which button was pressed, or released, on the pointer + * during the most recent event. It is only set during `up` and `down` events. + * + * On Touch devices the value is always 0. + * + * Users may change the configuration of buttons on their pointing device so that if an event's button property + * is zero, it may not have been caused by the button that is physically left–most on the pointing device; + * however, it should behave as if the left button was clicked in the standard button layout. + * + * @name Phaser.Input.Pointer#button + * @type {integer} + * @readonly + * @default 0 + * @since 3.18.0 + */ + this.button = 0; + + /** + * 0: No button or un-initialized + * 1: Left button + * 2: Right button + * 4: Wheel button or middle button + * 8: 4th button (typically the "Browser Back" button) + * 16: 5th button (typically the "Browser Forward" button) + * + * For a mouse configured for left-handed use, the button actions are reversed. + * In this case, the values are read from right to left. + * + * @name Phaser.Input.Pointer#buttons + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.buttons = 0; + + /** + * The position of the Pointer in screen space. + * + * @name Phaser.Input.Pointer#position + * @type {Phaser.Math.Vector2} + * @readonly + * @since 3.0.0 + */ + this.position = new Vector2(); + + /** + * The previous position of the Pointer in screen space. + * + * The old x and y values are stored in here during the InputManager.transformPointer call. + * + * Use the properties `velocity`, `angle` and `distance` to create your own gesture recognition. + * + * @name Phaser.Input.Pointer#prevPosition + * @type {Phaser.Math.Vector2} + * @readonly + * @since 3.11.0 + */ + this.prevPosition = new Vector2(); + + /** + * An internal vector used for calculations of the pointer speed and angle. + * + * @name Phaser.Input.Pointer#midPoint + * @type {Phaser.Math.Vector2} + * @private + * @since 3.16.0 + */ + this.midPoint = new Vector2(-1, -1); + + /** + * The current velocity of the Pointer, based on its current and previous positions. + * + * This value is smoothed out each frame, according to the `motionFactor` property. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + * + * @name Phaser.Input.Pointer#velocity + * @type {Phaser.Math.Vector2} + * @readonly + * @since 3.16.0 + */ + this.velocity = new Vector2(); + + /** + * The current angle the Pointer is moving, in radians, based on its previous and current position. + * + * The angle is based on the old position facing to the current position. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + * + * @name Phaser.Input.Pointer#angle + * @type {number} + * @readonly + * @since 3.16.0 + */ + this.angle = 0; + + /** + * The distance the Pointer has moved, based on its previous and current position. + * + * This value is smoothed out each frame, according to the `motionFactor` property. + * + * This property is updated whenever the Pointer moves, regardless of any button states. In other words, + * it changes based on movement alone - a button doesn't have to be pressed first. + * + * If you need the total distance travelled since the primary buttons was pressed down, + * then use the `Pointer.getDistance` method. + * + * @name Phaser.Input.Pointer#distance + * @type {number} + * @readonly + * @since 3.16.0 + */ + this.distance = 0; + + /** + * The smoothing factor to apply to the Pointer position. + * + * Due to their nature, pointer positions are inherently noisy. While this is fine for lots of games, if you need cleaner positions + * then you can set this value to apply an automatic smoothing to the positions as they are recorded. + * + * The default value of zero means 'no smoothing'. + * Set to a small value, such as 0.2, to apply an average level of smoothing between positions. You can do this by changing this + * value directly, or by setting the `input.smoothFactor` property in the Game Config. + * + * Positions are only smoothed when the pointer moves. If the primary button on this Pointer enters an Up or Down state, then the position + * is always precise, and not smoothed. + * + * @name Phaser.Input.Pointer#smoothFactor + * @type {number} + * @default 0 + * @since 3.16.0 + */ + this.smoothFactor = 0; + + /** + * The factor applied to the motion smoothing each frame. + * + * This value is passed to the Smooth Step Interpolation that is used to calculate the velocity, + * angle and distance of the Pointer. It's applied every frame, until the midPoint reaches the current + * position of the Pointer. 0.2 provides a good average but can be increased if you need a + * quicker update and are working in a high performance environment. Never set this value to + * zero. + * + * @name Phaser.Input.Pointer#motionFactor + * @type {number} + * @default 0.2 + * @since 3.16.0 + */ + this.motionFactor = 0.2; + + /** + * The x position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * @name Phaser.Input.Pointer#worldX + * @type {number} + * @default 0 + * @since 3.10.0 + */ + this.worldX = 0; + + /** + * The y position of this Pointer, translated into the coordinate space of the most recent Camera it interacted with. + * + * @name Phaser.Input.Pointer#worldY + * @type {number} + * @default 0 + * @since 3.10.0 + */ + this.worldY = 0; + + /** + * Time when this Pointer was most recently moved (regardless of the state of its buttons, if any) + * + * @name Phaser.Input.Pointer#moveTime + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.moveTime = 0; + + /** + * X coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects. + * + * @name Phaser.Input.Pointer#downX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.downX = 0; + + /** + * Y coordinate of the Pointer when Button 1 (left button), or Touch, was pressed, used for dragging objects. + * + * @name Phaser.Input.Pointer#downY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.downY = 0; + + /** + * Time when Button 1 (left button), or Touch, was pressed, used for dragging objects. + * + * @name Phaser.Input.Pointer#downTime + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.downTime = 0; + + /** + * X coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects. + * + * @name Phaser.Input.Pointer#upX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.upX = 0; + + /** + * Y coordinate of the Pointer when Button 1 (left button), or Touch, was released, used for dragging objects. + * + * @name Phaser.Input.Pointer#upY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.upY = 0; + + /** + * Time when Button 1 (left button), or Touch, was released, used for dragging objects. + * + * @name Phaser.Input.Pointer#upTime + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.upTime = 0; + + /** + * Is the primary button down? (usually button 0, the left mouse button) + * + * @name Phaser.Input.Pointer#primaryDown + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.primaryDown = false; + + /** + * Is _any_ button on this pointer considered as being down? + * + * @name Phaser.Input.Pointer#isDown + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.isDown = false; + + /** + * Did the previous input event come from a Touch input (true) or Mouse? (false) + * + * @name Phaser.Input.Pointer#wasTouch + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.wasTouch = false; + + /** + * Did this Pointer get canceled by a touchcancel event? + * + * Note: "canceled" is the American-English spelling of "cancelled". Please don't submit PRs correcting it! + * + * @name Phaser.Input.Pointer#wasCanceled + * @type {boolean} + * @default false + * @since 3.15.0 + */ + this.wasCanceled = false; + + /** + * If the mouse is locked, the horizontal relative movement of the Pointer in pixels since last frame. + * + * @name Phaser.Input.Pointer#movementX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.movementX = 0; + + /** + * If the mouse is locked, the vertical relative movement of the Pointer in pixels since last frame. + * + * @name Phaser.Input.Pointer#movementY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.movementY = 0; + + /** + * The identifier property of the Pointer as set by the DOM event when this Pointer is started. + * + * @name Phaser.Input.Pointer#identifier + * @type {number} + * @since 3.10.0 + */ + this.identifier = 0; + + /** + * The pointerId property of the Pointer as set by the DOM event when this Pointer is started. + * The browser can and will recycle this value. + * + * @name Phaser.Input.Pointer#pointerId + * @type {number} + * @since 3.10.0 + */ + this.pointerId = null; + + /** + * An active Pointer is one that is currently pressed down on the display. + * A Mouse is always considered as active. + * + * @name Phaser.Input.Pointer#active + * @type {boolean} + * @since 3.10.0 + */ + this.active = (id === 0) ? true : false; + + /** + * Time when this Pointer was most recently updated by a DOM Event. + * + * @name Phaser.Input.Pointer#time + * @type {number} + * @since 3.16.0 + */ + this.time = 0; + + /** + * The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * + * @name Phaser.Input.Pointer#deltaX + * @type {number} + * @default 0 + * @since 3.18.0 + */ + this.deltaX = 0; + + /** + * The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. + * + * @name Phaser.Input.Pointer#deltaY + * @type {number} + * @default 0 + * @since 3.18.0 + */ + this.deltaY = 0; + + /** + * The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * + * @name Phaser.Input.Pointer#deltaZ + * @type {number} + * @default 0 + * @since 3.18.0 + */ + this.deltaZ = 0; + }, + + /** + * Takes a Camera and returns a Vector2 containing the translated position of this Pointer + * within that Camera. This can be used to convert this Pointers position into camera space. + * + * @method Phaser.Input.Pointer#positionToCamera + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the translation. + * @param {(Phaser.Math.Vector2|object)} [output] - A Vector2-like object in which to store the translated position. + * + * @return {(Phaser.Math.Vector2|object)} A Vector2 containing the translated coordinates of this Pointer, based on the given camera. + */ + positionToCamera: function (camera, output) + { + return camera.getWorldPoint(this.x, this.y, output); + }, + + /** + * Calculates the motion of this Pointer, including its velocity and angle of movement. + * This method is called automatically each frame by the Input Manager. + * + * @method Phaser.Input.Pointer#updateMotion + * @private + * @since 3.16.0 + */ + updateMotion: function () + { + var cx = this.position.x; + var cy = this.position.y; + + var mx = this.midPoint.x; + var my = this.midPoint.y; + + if (cx === mx && cy === my) + { + // Nothing to do here + return; + } + + // Moving towards our goal ... + var vx = SmoothStepInterpolation(this.motionFactor, mx, cx); + var vy = SmoothStepInterpolation(this.motionFactor, my, cy); + + if (FuzzyEqual(vx, cx, 0.1)) + { + vx = cx; + } + + if (FuzzyEqual(vy, cy, 0.1)) + { + vy = cy; + } + + this.midPoint.set(vx, vy); + + var dx = cx - vx; + var dy = cy - vy; + + this.velocity.set(dx, dy); + + this.angle = Angle(vx, vy, cx, cy); + + this.distance = Math.sqrt(dx * dx + dy * dy); + }, + + /** + * Internal method to handle a Mouse Up Event. + * + * @method Phaser.Input.Pointer#up + * @private + * @since 3.0.0 + * + * @param {MouseEvent} event - The Mouse Event to process. + */ + up: function (event) + { + if ('buttons' in event) + { + this.buttons = event.buttons; + } + + this.event = event; + + this.button = event.button; + + this.upElement = event.target; + + // Sets the local x/y properties + this.manager.transformPointer(this, event.pageX, event.pageY, false); + + // 0: Main button pressed, usually the left button or the un-initialized state + if (event.button === 0) + { + this.primaryDown = false; + this.upX = this.x; + this.upY = this.y; + this.upTime = event.timeStamp; + } + + this.isDown = false; + + this.wasTouch = false; + }, + + /** + * Internal method to handle a Mouse Down Event. + * + * @method Phaser.Input.Pointer#down + * @private + * @since 3.0.0 + * + * @param {MouseEvent} event - The Mouse Event to process. + */ + down: function (event) + { + if ('buttons' in event) + { + this.buttons = event.buttons; + } + + this.event = event; + + this.button = event.button; + + this.downElement = event.target; + + // Sets the local x/y properties + this.manager.transformPointer(this, event.pageX, event.pageY, false); + + // 0: Main button pressed, usually the left button or the un-initialized state + if (event.button === 0) + { + this.primaryDown = true; + this.downX = this.x; + this.downY = this.y; + this.downTime = event.timeStamp; + } + + this.isDown = true; + + this.wasTouch = false; + }, + + /** + * Internal method to handle a Mouse Move Event. + * + * @method Phaser.Input.Pointer#move + * @private + * @since 3.0.0 + * + * @param {MouseEvent} event - The Mouse Event to process. + */ + move: function (event) + { + if ('buttons' in event) + { + this.buttons = event.buttons; + } + + this.event = event; + + // Sets the local x/y properties + this.manager.transformPointer(this, event.pageX, event.pageY, true); + + if (this.manager.mouse.locked) + { + // Multiple DOM events may occur within one frame, but only one Phaser event will fire + this.movementX += event.movementX || event.mozMovementX || event.webkitMovementX || 0; + this.movementY += event.movementY || event.mozMovementY || event.webkitMovementY || 0; + } + + this.moveTime = event.timeStamp; + + this.wasTouch = false; + }, + + /** + * Internal method to handle a Mouse Wheel Event. + * + * @method Phaser.Input.Pointer#wheel + * @private + * @since 3.18.0 + * + * @param {WheelEvent} event - The Wheel Event to process. + */ + wheel: function (event) + { + if ('buttons' in event) + { + this.buttons = event.buttons; + } + + this.event = event; + + // Sets the local x/y properties + this.manager.transformPointer(this, event.pageX, event.pageY, false); + + this.deltaX = event.deltaX; + this.deltaY = event.deltaY; + this.deltaZ = event.deltaZ; + + this.wasTouch = false; + }, + + /** + * Internal method to handle a Touch Start Event. + * + * @method Phaser.Input.Pointer#touchstart + * @private + * @since 3.0.0 + * + * @param {Touch} touch - The Changed Touch from the Touch Event. + * @param {TouchEvent} event - The full Touch Event. + */ + touchstart: function (touch, event) + { + if (touch['pointerId']) + { + this.pointerId = touch.pointerId; + } + + this.identifier = touch.identifier; + this.target = touch.target; + this.active = true; + + this.buttons = 1; + + this.event = event; + + this.downElement = touch.target; + + // Sets the local x/y properties + this.manager.transformPointer(this, touch.pageX, touch.pageY, false); + + this.primaryDown = true; + this.downX = this.x; + this.downY = this.y; + this.downTime = touch.timeStamp; + + this.isDown = true; + + this.wasTouch = true; + this.wasCanceled = false; + + this.updateMotion(); + }, + + /** + * Internal method to handle a Touch Move Event. + * + * @method Phaser.Input.Pointer#touchmove + * @private + * @since 3.0.0 + * + * @param {Touch} touch - The Changed Touch from the Touch Event. + * @param {TouchEvent} event - The full Touch Event. + */ + touchmove: function (touch, event) + { + this.event = event; + + // Sets the local x/y properties + this.manager.transformPointer(this, touch.pageX, touch.pageY, true); + + this.moveTime = touch.timeStamp; + + this.wasTouch = true; + + this.updateMotion(); + }, + + /** + * Internal method to handle a Touch End Event. + * + * @method Phaser.Input.Pointer#touchend + * @private + * @since 3.0.0 + * + * @param {Touch} touch - The Changed Touch from the Touch Event. + * @param {TouchEvent} event - The full Touch Event. + */ + touchend: function (touch, event) + { + this.buttons = 0; + + this.event = event; + + this.upElement = touch.target; + + // Sets the local x/y properties + this.manager.transformPointer(this, touch.pageX, touch.pageY, false); + + this.primaryDown = false; + this.upX = this.x; + this.upY = this.y; + this.upTime = touch.timeStamp; + + this.isDown = false; + + this.wasTouch = true; + this.wasCanceled = false; + + this.active = false; + + this.updateMotion(); + }, + + /** + * Internal method to handle a Touch Cancel Event. + * + * @method Phaser.Input.Pointer#touchcancel + * @private + * @since 3.15.0 + * + * @param {Touch} touch - The Changed Touch from the Touch Event. + * @param {TouchEvent} event - The full Touch Event. + */ + touchcancel: function (touch, event) + { + this.buttons = 0; + + this.event = event; + + this.upElement = touch.target; + + // Sets the local x/y properties + this.manager.transformPointer(this, touch.pageX, touch.pageY, false); + + this.primaryDown = false; + this.upX = this.x; + this.upY = this.y; + this.upTime = touch.timeStamp; + + this.isDown = false; + + this.wasTouch = true; + this.wasCanceled = true; + + this.active = false; + }, + + /** + * Checks to see if any buttons are being held down on this Pointer. + * + * @method Phaser.Input.Pointer#noButtonDown + * @since 3.0.0 + * + * @return {boolean} `true` if no buttons are being held down. + */ + noButtonDown: function () + { + return (this.buttons === 0); + }, + + /** + * Checks to see if the left button is being held down on this Pointer. + * + * @method Phaser.Input.Pointer#leftButtonDown + * @since 3.0.0 + * + * @return {boolean} `true` if the left button is being held down. + */ + leftButtonDown: function () + { + return (this.buttons & 1) ? true : false; + }, + + /** + * Checks to see if the right button is being held down on this Pointer. + * + * @method Phaser.Input.Pointer#rightButtonDown + * @since 3.0.0 + * + * @return {boolean} `true` if the right button is being held down. + */ + rightButtonDown: function () + { + return (this.buttons & 2) ? true : false; + }, + + /** + * Checks to see if the middle button is being held down on this Pointer. + * + * @method Phaser.Input.Pointer#middleButtonDown + * @since 3.0.0 + * + * @return {boolean} `true` if the middle button is being held down. + */ + middleButtonDown: function () + { + return (this.buttons & 4) ? true : false; + }, + + /** + * Checks to see if the back button is being held down on this Pointer. + * + * @method Phaser.Input.Pointer#backButtonDown + * @since 3.0.0 + * + * @return {boolean} `true` if the back button is being held down. + */ + backButtonDown: function () + { + return (this.buttons & 8) ? true : false; + }, + + /** + * Checks to see if the forward button is being held down on this Pointer. + * + * @method Phaser.Input.Pointer#forwardButtonDown + * @since 3.0.0 + * + * @return {boolean} `true` if the forward button is being held down. + */ + forwardButtonDown: function () + { + return (this.buttons & 16) ? true : false; + }, + + /** + * Checks to see if the left button was just released on this Pointer. + * + * @method Phaser.Input.Pointer#leftButtonReleased + * @since 3.18.0 + * + * @return {boolean} `true` if the left button was just released. + */ + leftButtonReleased: function () + { + return (this.button === 0 && !this.isDown); + }, + + /** + * Checks to see if the right button was just released on this Pointer. + * + * @method Phaser.Input.Pointer#rightButtonReleased + * @since 3.18.0 + * + * @return {boolean} `true` if the right button was just released. + */ + rightButtonReleased: function () + { + return (this.button === 2 && !this.isDown); + }, + + /** + * Checks to see if the middle button was just released on this Pointer. + * + * @method Phaser.Input.Pointer#middleButtonReleased + * @since 3.18.0 + * + * @return {boolean} `true` if the middle button was just released. + */ + middleButtonReleased: function () + { + return (this.button === 1 && !this.isDown); + }, + + /** + * Checks to see if the back button was just released on this Pointer. + * + * @method Phaser.Input.Pointer#backButtonReleased + * @since 3.18.0 + * + * @return {boolean} `true` if the back button was just released. + */ + backButtonReleased: function () + { + return (this.button === 3 && !this.isDown); + }, + + /** + * Checks to see if the forward button was just released on this Pointer. + * + * @method Phaser.Input.Pointer#forwardButtonReleased + * @since 3.18.0 + * + * @return {boolean} `true` if the forward button was just released. + */ + forwardButtonReleased: function () + { + return (this.button === 4 && !this.isDown); + }, + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded distance, based on where + * the Pointer was when the button was released. + * + * If you wish to get the distance being travelled currently, based on the velocity of the Pointer, + * then see the `Pointer.distance` property. + * + * @method Phaser.Input.Pointer#getDistance + * @since 3.13.0 + * + * @return {number} The distance the Pointer moved. + */ + getDistance: function () + { + if (this.isDown) + { + return Distance(this.downX, this.downY, this.x, this.y); + } + else + { + return Distance(this.downX, this.downY, this.upX, this.upY); + } + }, + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * horizontal distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded horizontal distance, based on where + * the Pointer was when the button was released. + * + * @method Phaser.Input.Pointer#getDistanceX + * @since 3.16.0 + * + * @return {number} The horizontal distance the Pointer moved. + */ + getDistanceX: function () + { + if (this.isDown) + { + return Math.abs(this.downX - this.x); + } + else + { + return Math.abs(this.downX - this.upX); + } + }, + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * vertical distance between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded vertical distance, based on where + * the Pointer was when the button was released. + * + * @method Phaser.Input.Pointer#getDistanceY + * @since 3.16.0 + * + * @return {number} The vertical distance the Pointer moved. + */ + getDistanceY: function () + { + if (this.isDown) + { + return Math.abs(this.downY - this.y); + } + else + { + return Math.abs(this.downY - this.upY); + } + }, + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * duration since the button was pressed down. + * + * If no button is held down, it will return the last recorded duration, based on the time + * the Pointer button was released. + * + * @method Phaser.Input.Pointer#getDuration + * @since 3.16.0 + * + * @return {number} The duration the Pointer was held down for in milliseconds. + */ + getDuration: function () + { + if (this.isDown) + { + return (this.time - this.downTime); + } + else + { + return (this.upTime - this.downTime); + } + }, + + /** + * If the Pointer has a button pressed down at the time this method is called, it will return the + * angle between the Pointer's `downX` and `downY` values and the current position. + * + * If no button is held down, it will return the last recorded angle, based on where + * the Pointer was when the button was released. + * + * The angle is based on the old position facing to the current position. + * + * If you wish to get the current angle, based on the velocity of the Pointer, then + * see the `Pointer.angle` property. + * + * @method Phaser.Input.Pointer#getAngle + * @since 3.16.0 + * + * @return {number} The angle between the Pointer's coordinates in radians. + */ + getAngle: function () + { + if (this.isDown) + { + return Angle(this.downX, this.downY, this.x, this.y); + } + else + { + return Angle(this.downX, this.downY, this.upX, this.upY); + } + }, + + /** + * Takes the previous and current Pointer positions and then generates an array of interpolated values between + * the two. The array will be populated up to the size of the `steps` argument. + * + * ```javaScript + * var points = pointer.getInterpolatedPosition(4); + * + * // points[0] = { x: 0, y: 0 } + * // points[1] = { x: 2, y: 1 } + * // points[2] = { x: 3, y: 2 } + * // points[3] = { x: 6, y: 3 } + * ``` + * + * Use this if you need to get smoothed values between the previous and current pointer positions. DOM pointer + * events can often fire faster than the main browser loop, and this will help you avoid janky movement + * especially if you have an object following a Pointer. + * + * Note that if you provide an output array it will only be populated up to the number of steps provided. + * It will not clear any previous data that may have existed beyond the range of the steps count. + * + * Internally it uses the Smooth Step interpolation calculation. + * + * @method Phaser.Input.Pointer#getInterpolatedPosition + * @since 3.11.0 + * + * @param {integer} [steps=10] - The number of interpolation steps to use. + * @param {array} [out] - An array to store the results in. If not provided a new one will be created. + * + * @return {array} An array of interpolated values. + */ + getInterpolatedPosition: function (steps, out) + { + if (steps === undefined) { steps = 10; } + if (out === undefined) { out = []; } + + var prevX = this.prevPosition.x; + var prevY = this.prevPosition.y; + + var curX = this.position.x; + var curY = this.position.y; + + for (var i = 0; i < steps; i++) + { + var t = (1 / steps) * i; + + out[i] = { x: SmoothStepInterpolation(t, prevX, curX), y: SmoothStepInterpolation(t, prevY, curY) }; + } + + return out; + }, + + /** + * Destroys this Pointer instance and resets its external references. + * + * @method Phaser.Input.Pointer#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.camera = null; + this.manager = null; + this.position = null; + }, + + /** + * The x position of this Pointer. + * The value is in screen space. + * See `worldX` to get a camera converted position. + * + * @name Phaser.Input.Pointer#x + * @type {number} + * @since 3.0.0 + */ + x: { + + get: function () + { + return this.position.x; + }, + + set: function (value) + { + this.position.x = value; + } + + }, + + /** + * The y position of this Pointer. + * The value is in screen space. + * See `worldY` to get a camera converted position. + * + * @name Phaser.Input.Pointer#y + * @type {number} + * @since 3.0.0 + */ + y: { + + get: function () + { + return this.position.y; + }, + + set: function (value) + { + this.position.y = value; + } + + } + +}); + +module.exports = Pointer; + + +/***/ }), +/* 341 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var InputEvents = __webpack_require__(53); +var NOOP = __webpack_require__(1); + +// https://developer.mozilla.org/en-US/docs/Web/API/Touch_events +// https://patrickhlauke.github.io/touch/tests/results/ +// https://www.html5rocks.com/en/mobile/touch/ + +/** + * @classdesc + * The Touch Manager is a helper class that belongs to the Input Manager. + * + * Its role is to listen for native DOM Touch Events and then pass them onto the Input Manager for further processing. + * + * You do not need to create this class directly, the Input Manager will create an instance of it automatically. + * + * @class TouchManager + * @memberof Phaser.Input.Touch + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Input.InputManager} inputManager - A reference to the Input Manager. + */ +var TouchManager = new Class({ + + initialize: + + function TouchManager (inputManager) + { + /** + * A reference to the Input Manager. + * + * @name Phaser.Input.Touch.TouchManager#manager + * @type {Phaser.Input.InputManager} + * @since 3.0.0 + */ + this.manager = inputManager; + + /** + * If true the DOM events will have event.preventDefault applied to them, if false they will propagate fully. + * + * @name Phaser.Input.Touch.TouchManager#capture + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.capture = true; + + /** + * A boolean that controls if the Touch Manager is enabled or not. + * Can be toggled on the fly. + * + * @name Phaser.Input.Touch.TouchManager#enabled + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.enabled = false; + + /** + * The Touch Event target, as defined in the Game Config. + * Typically the canvas to which the game is rendering, but can be any interactive DOM element. + * + * @name Phaser.Input.Touch.TouchManager#target + * @type {any} + * @since 3.0.0 + */ + this.target; + + /** + * The Touch Start event handler function. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Touch.TouchManager#onTouchStart + * @type {function} + * @since 3.0.0 + */ + this.onTouchStart = NOOP; + + /** + * The Touch Start event handler function specifically for events on the Window. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Touch.TouchManager#onTouchStartWindow + * @type {function} + * @since 3.17.0 + */ + this.onTouchStartWindow = NOOP; + + /** + * The Touch Move event handler function. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Touch.TouchManager#onTouchMove + * @type {function} + * @since 3.0.0 + */ + this.onTouchMove = NOOP; + + /** + * The Touch End event handler function. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Touch.TouchManager#onTouchEnd + * @type {function} + * @since 3.0.0 + */ + this.onTouchEnd = NOOP; + + /** + * The Touch End event handler function specifically for events on the Window. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Touch.TouchManager#onTouchEndWindow + * @type {function} + * @since 3.17.0 + */ + this.onTouchEndWindow = NOOP; + + /** + * The Touch Cancel event handler function. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Touch.TouchManager#onTouchCancel + * @type {function} + * @since 3.15.0 + */ + this.onTouchCancel = NOOP; + + /** + * The Touch Cancel event handler function specifically for events on the Window. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Touch.TouchManager#onTouchCancelWindow + * @type {function} + * @since 3.18.0 + */ + this.onTouchCancelWindow = NOOP; + + /** + * The Touch Over event handler function. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Touch.TouchManager#onTouchOver + * @type {function} + * @since 3.16.0 + */ + this.onTouchOver = NOOP; + + /** + * The Touch Out event handler function. + * Initially empty and bound in the `startListeners` method. + * + * @name Phaser.Input.Touch.TouchManager#onTouchOut + * @type {function} + * @since 3.16.0 + */ + this.onTouchOut = NOOP; + + inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this); + }, + + /** + * The Touch Manager boot process. + * + * @method Phaser.Input.Touch.TouchManager#boot + * @private + * @since 3.0.0 + */ + boot: function () + { + var config = this.manager.config; + + this.enabled = config.inputTouch; + this.target = config.inputTouchEventTarget; + this.capture = config.inputTouchCapture; + + if (!this.target) + { + this.target = this.manager.game.canvas; + } + + if (this.enabled && this.target) + { + this.startListeners(); + } + }, + + /** + * Starts the Touch Event listeners running as long as an input target is set. + * + * This method is called automatically if Touch Input is enabled in the game config, + * which it is by default. However, you can call it manually should you need to + * delay input capturing until later in the game. + * + * @method Phaser.Input.Touch.TouchManager#startListeners + * @since 3.0.0 + */ + startListeners: function () + { + var _this = this; + var canvas = this.manager.canvas; + var autoFocus = (window && window.focus && this.manager.game.config.autoFocus); + + this.onTouchStart = function (event) + { + if (autoFocus) + { + window.focus(); + } + + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.onTouchStart(event); + + if (_this.capture && event.target === canvas) + { + event.preventDefault(); + } + } + }; + + this.onTouchStartWindow = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + { + // Only process the event if the target isn't the canvas + _this.manager.onTouchStart(event); + } + }; + + this.onTouchMove = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.onTouchMove(event); + + if (_this.capture) + { + event.preventDefault(); + } + } + }; + + this.onTouchEnd = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.onTouchEnd(event); + + if (_this.capture && event.target === canvas) + { + event.preventDefault(); + } + } + }; + + this.onTouchEndWindow = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + { + // Only process the event if the target isn't the canvas + _this.manager.onTouchEnd(event); + } + }; + + this.onTouchCancel = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.onTouchCancel(event); + + if (_this.capture) + { + event.preventDefault(); + } + } + }; + + this.onTouchCancelWindow = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.onTouchCancel(event); + } + }; + + this.onTouchOver = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.setCanvasOver(event); + } + }; + + this.onTouchOut = function (event) + { + if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + { + _this.manager.setCanvasOut(event); + } + }; + + var target = this.target; + + if (!target) + { + return; + } + + var passive = { passive: true }; + var nonPassive = { passive: false }; + + target.addEventListener('touchstart', this.onTouchStart, (this.capture) ? nonPassive : passive); + target.addEventListener('touchmove', this.onTouchMove, (this.capture) ? nonPassive : passive); + target.addEventListener('touchend', this.onTouchEnd, (this.capture) ? nonPassive : passive); + target.addEventListener('touchcancel', this.onTouchCancel, (this.capture) ? nonPassive : passive); + target.addEventListener('touchover', this.onTouchOver, (this.capture) ? nonPassive : passive); + target.addEventListener('touchout', this.onTouchOut, (this.capture) ? nonPassive : passive); + + if (window && this.manager.game.config.inputWindowEvents) + { + window.addEventListener('touchstart', this.onTouchStartWindow, nonPassive); + window.addEventListener('touchend', this.onTouchEndWindow, nonPassive); + window.addEventListener('touchcancel', this.onTouchCancelWindow, nonPassive); + } + + this.enabled = true; + }, + + /** + * Stops the Touch Event listeners. + * This is called automatically and does not need to be manually invoked. + * + * @method Phaser.Input.Touch.TouchManager#stopListeners + * @since 3.0.0 + */ + stopListeners: function () + { + var target = this.target; + + target.removeEventListener('touchstart', this.onTouchStart); + target.removeEventListener('touchmove', this.onTouchMove); + target.removeEventListener('touchend', this.onTouchEnd); + target.removeEventListener('touchcancel', this.onTouchCancel); + target.removeEventListener('touchover', this.onTouchOver); + target.removeEventListener('touchout', this.onTouchOut); + + if (window) + { + window.removeEventListener('touchstart', this.onTouchStartWindow); + window.removeEventListener('touchend', this.onTouchEndWindow); + } + }, + + /** + * Destroys this Touch Manager instance. + * + * @method Phaser.Input.Touch.TouchManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.stopListeners(); + + this.target = null; + this.enabled = false; + this.manager = null; + } + +}); + +module.exports = TouchManager; + + +/***/ }), +/* 342 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GameEvents = __webpack_require__(28); +var EventEmitter = __webpack_require__(11); +var FileTypesManager = __webpack_require__(8); +var GameObjectCreator = __webpack_require__(15); +var GameObjectFactory = __webpack_require__(5); +var GetFastValue = __webpack_require__(2); +var PluginCache = __webpack_require__(18); +var Remove = __webpack_require__(120); + +/** + * @classdesc + * The PluginManager is responsible for installing and adding plugins to Phaser. + * + * It is a global system and therefore belongs to the Game instance, not a specific Scene. + * + * It works in conjunction with the PluginCache. Core internal plugins automatically register themselves + * with the Cache, but it's the Plugin Manager that is responsible for injecting them into the Scenes. + * + * There are two types of plugin: + * + * 1. A Global Plugin + * 2. A Scene Plugin + * + * A Global Plugin is a plugin that lives within the Plugin Manager rather than a Scene. You can get + * access to it by calling `PluginManager.get` and providing a key. Any Scene that requests a plugin in + * this way will all get access to the same plugin instance, allowing you to use a single plugin across + * multiple Scenes. + * + * A Scene Plugin is a plugin dedicated to running within a Scene. These are different to Global Plugins + * in that their instances do not live within the Plugin Manager, but within the Scene Systems class instead. + * And that every Scene created is given its own unique instance of a Scene Plugin. Examples of core Scene + * Plugins include the Input Plugin, the Tween Plugin and the physics Plugins. + * + * You can add a plugin to Phaser in three different ways: + * + * 1. Preload it + * 2. Include it in your source code and install it via the Game Config + * 3. Include it in your source code and install it within a Scene + * + * For examples of all of these approaches please see the Phaser 3 Examples Repo `plugins` folder. + * + * For information on creating your own plugin please see the Phaser 3 Plugin Template. + * + * @class PluginManager + * @memberof Phaser.Plugins + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - The game instance that owns this Plugin Manager. + */ +var PluginManager = new Class({ + + Extends: EventEmitter, + + initialize: + + function PluginManager (game) + { + EventEmitter.call(this); + + /** + * The game instance that owns this Plugin Manager. + * + * @name Phaser.Plugins.PluginManager#game + * @type {Phaser.Game} + * @since 3.0.0 + */ + this.game = game; + + /** + * The global plugins currently running and managed by this Plugin Manager. + * A plugin must have been started at least once in order to appear in this list. + * + * @name Phaser.Plugins.PluginManager#plugins + * @type {Phaser.Types.Plugins.GlobalPlugin[]} + * @since 3.8.0 + */ + this.plugins = []; + + /** + * A list of plugin keys that should be installed into Scenes as well as the Core Plugins. + * + * @name Phaser.Plugins.PluginManager#scenePlugins + * @type {string[]} + * @since 3.8.0 + */ + this.scenePlugins = []; + + /** + * A temporary list of plugins to install when the game has booted. + * + * @name Phaser.Plugins.PluginManager#_pendingGlobal + * @private + * @type {array} + * @since 3.8.0 + */ + this._pendingGlobal = []; + + /** + * A temporary list of scene plugins to install when the game has booted. + * + * @name Phaser.Plugins.PluginManager#_pendingScene + * @private + * @type {array} + * @since 3.8.0 + */ + this._pendingScene = []; + + if (game.isBooted) + { + this.boot(); + } + else + { + game.events.once(GameEvents.BOOT, this.boot, this); + } + }, + + /** + * Run once the game has booted and installs all of the plugins configured in the Game Config. + * + * @method Phaser.Plugins.PluginManager#boot + * @protected + * @since 3.0.0 + */ + boot: function () + { + var i; + var entry; + var key; + var plugin; + var start; + var mapping; + var data; + var config = this.game.config; + + // Any plugins to install? + var list = config.installGlobalPlugins; + + // Any plugins added outside of the game config, but before the game booted? + list = list.concat(this._pendingGlobal); + + for (i = 0; i < list.length; i++) + { + entry = list[i]; + + // { key: 'TestPlugin', plugin: TestPlugin, start: true, mapping: 'test', data: { msg: 'The plugin is alive' } } + + key = GetFastValue(entry, 'key', null); + plugin = GetFastValue(entry, 'plugin', null); + start = GetFastValue(entry, 'start', false); + mapping = GetFastValue(entry, 'mapping', null); + data = GetFastValue(entry, 'data', null); + + if (key) + { + if (plugin) + { + this.install(key, plugin, start, mapping, data); + } + else + { + console.warn('Missing `plugin` for key: ' + key); + } + + } + } + + // Any scene plugins to install? + list = config.installScenePlugins; + + // Any plugins added outside of the game config, but before the game booted? + list = list.concat(this._pendingScene); + + for (i = 0; i < list.length; i++) + { + entry = list[i]; + + // { key: 'moveSpritePlugin', plugin: MoveSpritePlugin, , mapping: 'move' } + + key = GetFastValue(entry, 'key', null); + plugin = GetFastValue(entry, 'plugin', null); + mapping = GetFastValue(entry, 'mapping', null); + + if (key) + { + if (plugin) + { + this.installScenePlugin(key, plugin, mapping); + } + else + { + console.warn('Missing `plugin` for key: ' + key); + } + } + } + + this._pendingGlobal = []; + this._pendingScene = []; + + this.game.events.once(GameEvents.DESTROY, this.destroy, this); + }, + + /** + * Called by the Scene Systems class. Tells the plugin manager to install all Scene plugins into it. + * + * First it will install global references, i.e. references from the Game systems into the Scene Systems (and Scene if mapped.) + * Then it will install Core Scene Plugins followed by Scene Plugins registered with the PluginManager. + * Finally it will install any references to Global Plugins that have a Scene mapping property into the Scene itself. + * + * @method Phaser.Plugins.PluginManager#addToScene + * @protected + * @since 3.8.0 + * + * @param {Phaser.Scenes.Systems} sys - The Scene Systems class to install all the plugins in to. + * @param {array} globalPlugins - An array of global plugins to install. + * @param {array} scenePlugins - An array of scene plugins to install. + */ + addToScene: function (sys, globalPlugins, scenePlugins) + { + var i; + var pluginKey; + var pluginList; + var game = this.game; + var scene = sys.scene; + var map = sys.settings.map; + var isBooted = sys.settings.isBooted; + + // Reference the GlobalPlugins from Game into Scene.Systems + for (i = 0; i < globalPlugins.length; i++) + { + pluginKey = globalPlugins[i]; + + if (game[pluginKey]) + { + sys[pluginKey] = game[pluginKey]; + + // Scene level injection + if (map.hasOwnProperty(pluginKey)) + { + scene[map[pluginKey]] = sys[pluginKey]; + } + } + else if (pluginKey === 'game' && map.hasOwnProperty(pluginKey)) + { + scene[map[pluginKey]] = game; + } + } + + for (var s = 0; s < scenePlugins.length; s++) + { + pluginList = scenePlugins[s]; + + for (i = 0; i < pluginList.length; i++) + { + pluginKey = pluginList[i]; + + if (!PluginCache.hasCore(pluginKey)) + { + continue; + } + + var source = PluginCache.getCore(pluginKey); + + var plugin = new source.plugin(scene, this); + + sys[source.mapping] = plugin; + + // Scene level injection + if (source.custom) + { + scene[source.mapping] = plugin; + } + else if (map.hasOwnProperty(source.mapping)) + { + scene[map[source.mapping]] = plugin; + } + + // Scene is already booted, usually because this method is being called at run-time, so boot the plugin + if (isBooted) + { + plugin.boot(); + } + } + } + + // And finally, inject any 'global scene plugins' + pluginList = this.plugins; + + for (i = 0; i < pluginList.length; i++) + { + var entry = pluginList[i]; + + if (entry.mapping) + { + scene[entry.mapping] = entry.plugin; + } + } + }, + + /** + * Called by the Scene Systems class. Returns a list of plugins to be installed. + * + * @method Phaser.Plugins.PluginManager#getDefaultScenePlugins + * @protected + * @since 3.8.0 + * + * @return {string[]} A list keys of all the Scene Plugins to install. + */ + getDefaultScenePlugins: function () + { + var list = this.game.config.defaultPlugins; + + // Merge in custom Scene plugins + list = list.concat(this.scenePlugins); + + return list; + }, + + /** + * Installs a new Scene Plugin into the Plugin Manager and optionally adds it + * to the given Scene as well. A Scene Plugin added to the manager in this way + * will be automatically installed into all new Scenes using the key and mapping given. + * + * The `key` property is what the plugin is injected into Scene.Systems as. + * The `mapping` property is optional, and if specified is what the plugin is installed into + * the Scene as. For example: + * + * ```javascript + * this.plugins.installScenePlugin('powerupsPlugin', pluginCode, 'powerups'); + * + * // and from within the scene: + * this.sys.powerupsPlugin; // key value + * this.powerups; // mapping value + * ``` + * + * This method is called automatically by Phaser if you install your plugins using either the + * Game Configuration object, or by preloading them via the Loader. + * + * @method Phaser.Plugins.PluginManager#installScenePlugin + * @since 3.8.0 + * + * @param {string} key - The property key that will be used to add this plugin to Scene.Systems. + * @param {function} plugin - The plugin code. This should be the non-instantiated version. + * @param {string} [mapping] - If this plugin is injected into the Phaser.Scene class, this is the property key to use. + * @param {Phaser.Scene} [addToScene] - Optionally automatically add this plugin to the given Scene. + * @param {boolean} [fromLoader=false] - Is this being called by the Loader? + */ + installScenePlugin: function (key, plugin, mapping, addToScene, fromLoader) + { + if (fromLoader === undefined) { fromLoader = false; } + + if (typeof plugin !== 'function') + { + console.warn('Invalid Scene Plugin: ' + key); + return; + } + + if (!PluginCache.hasCore(key)) + { + // Plugin is freshly loaded + PluginCache.register(key, plugin, mapping, true); + + this.scenePlugins.push(key); + } + else if (!fromLoader && PluginCache.hasCore(key)) + { + // Plugin wasn't from the loader but already exists + console.warn('Scene Plugin key in use: ' + key); + return; + } + + if (addToScene) + { + var instance = new plugin(addToScene, this); + + addToScene.sys[key] = instance; + + if (mapping && mapping !== '') + { + addToScene[mapping] = instance; + } + + instance.boot(); + } + }, + + /** + * Installs a new Global Plugin into the Plugin Manager and optionally starts it running. + * A global plugin belongs to the Plugin Manager, rather than a specific Scene, and can be accessed + * and used by all Scenes in your game. + * + * The `key` property is what you use to access this plugin from the Plugin Manager. + * + * ```javascript + * this.plugins.install('powerupsPlugin', pluginCode); + * + * // and from within the scene: + * this.plugins.get('powerupsPlugin'); + * ``` + * + * This method is called automatically by Phaser if you install your plugins using either the + * Game Configuration object, or by preloading them via the Loader. + * + * The same plugin can be installed multiple times into the Plugin Manager by simply giving each + * instance its own unique key. + * + * @method Phaser.Plugins.PluginManager#install + * @since 3.8.0 + * + * @param {string} key - The unique handle given to this plugin within the Plugin Manager. + * @param {function} plugin - The plugin code. This should be the non-instantiated version. + * @param {boolean} [start=false] - Automatically start the plugin running? This is always `true` if you provide a mapping value. + * @param {string} [mapping] - If this plugin is injected into the Phaser.Scene class, this is the property key to use. + * @param {any} [data] - A value passed to the plugin's `init` method. + * + * @return {?Phaser.Plugins.BasePlugin} The plugin that was started, or `null` if `start` was false, or game isn't yet booted. + */ + install: function (key, plugin, start, mapping, data) + { + if (start === undefined) { start = false; } + if (mapping === undefined) { mapping = null; } + if (data === undefined) { data = null; } + + if (typeof plugin !== 'function') + { + console.warn('Invalid Plugin: ' + key); + return null; + } + + if (PluginCache.hasCustom(key)) + { + console.warn('Plugin key in use: ' + key); + return null; + } + + if (mapping !== null) + { + start = true; + } + + if (!this.game.isBooted) + { + this._pendingGlobal.push({ key: key, plugin: plugin, start: start, mapping: mapping, data: data }); + } + else + { + // Add it to the plugin store + PluginCache.registerCustom(key, plugin, mapping, data); + + if (start) + { + return this.start(key); + } + } + + return null; + }, + + /** + * Gets an index of a global plugin based on the given key. + * + * @method Phaser.Plugins.PluginManager#getIndex + * @protected + * @since 3.8.0 + * + * @param {string} key - The unique plugin key. + * + * @return {integer} The index of the plugin within the plugins array. + */ + getIndex: function (key) + { + var list = this.plugins; + + for (var i = 0; i < list.length; i++) + { + var entry = list[i]; + + if (entry.key === key) + { + return i; + } + } + + return -1; + }, + + /** + * Gets a global plugin based on the given key. + * + * @method Phaser.Plugins.PluginManager#getEntry + * @protected + * @since 3.8.0 + * + * @param {string} key - The unique plugin key. + * + * @return {Phaser.Types.Plugins.GlobalPlugin} The plugin entry. + */ + getEntry: function (key) + { + var idx = this.getIndex(key); + + if (idx !== -1) + { + return this.plugins[idx]; + } + }, + + /** + * Checks if the given global plugin, based on its key, is active or not. + * + * @method Phaser.Plugins.PluginManager#isActive + * @since 3.8.0 + * + * @param {string} key - The unique plugin key. + * + * @return {boolean} `true` if the plugin is active, otherwise `false`. + */ + isActive: function (key) + { + var entry = this.getEntry(key); + + return (entry && entry.active); + }, + + /** + * Starts a global plugin running. + * + * If the plugin was previously active then calling `start` will reset it to an active state and then + * call its `start` method. + * + * If the plugin has never been run before a new instance of it will be created within the Plugin Manager, + * its active state set and then both of its `init` and `start` methods called, in that order. + * + * If the plugin is already running under the given key then nothing happens. + * + * @method Phaser.Plugins.PluginManager#start + * @since 3.8.0 + * + * @param {string} key - The key of the plugin to start. + * @param {string} [runAs] - Run the plugin under a new key. This allows you to run one plugin multiple times. + * + * @return {?Phaser.Plugins.BasePlugin} The plugin that was started, or `null` if invalid key given or plugin is already stopped. + */ + start: function (key, runAs) + { + if (runAs === undefined) { runAs = key; } + + var entry = this.getEntry(runAs); + + // Plugin already running under this key? + if (entry && !entry.active) + { + // It exists, we just need to start it up again + entry.active = true; + entry.plugin.start(); + } + else if (!entry) + { + entry = this.createEntry(key, runAs); + } + + return (entry) ? entry.plugin : null; + }, + + /** + * Creates a new instance of a global plugin, adds an entry into the plugins array and returns it. + * + * @method Phaser.Plugins.PluginManager#createEntry + * @private + * @since 3.9.0 + * + * @param {string} key - The key of the plugin to create an instance of. + * @param {string} [runAs] - Run the plugin under a new key. This allows you to run one plugin multiple times. + * + * @return {?Phaser.Plugins.BasePlugin} The plugin that was started, or `null` if invalid key given. + */ + createEntry: function (key, runAs) + { + var entry = PluginCache.getCustom(key); + + if (entry) + { + var instance = new entry.plugin(this); + + entry = { + key: runAs, + plugin: instance, + active: true, + mapping: entry.mapping, + data: entry.data + }; + + this.plugins.push(entry); + + instance.init(entry.data); + instance.start(); + } + + return entry; + }, + + /** + * Stops a global plugin from running. + * + * If the plugin is active then its active state will be set to false and the plugins `stop` method + * will be called. + * + * If the plugin is not already running, nothing will happen. + * + * @method Phaser.Plugins.PluginManager#stop + * @since 3.8.0 + * + * @param {string} key - The key of the plugin to stop. + * + * @return {Phaser.Plugins.PluginManager} The Plugin Manager. + */ + stop: function (key) + { + var entry = this.getEntry(key); + + if (entry && entry.active) + { + entry.active = false; + entry.plugin.stop(); + } + + return this; + }, + + /** + * Gets a global plugin from the Plugin Manager based on the given key and returns it. + * + * If it cannot find an active plugin based on the key, but there is one in the Plugin Cache with the same key, + * then it will create a new instance of the cached plugin and return that. + * + * @method Phaser.Plugins.PluginManager#get + * @since 3.8.0 + * + * @param {string} key - The key of the plugin to get. + * @param {boolean} [autoStart=true] - Automatically start a new instance of the plugin if found in the cache, but not actively running. + * + * @return {?(Phaser.Plugins.BasePlugin|function)} The plugin, or `null` if no plugin was found matching the key. + */ + get: function (key, autoStart) + { + if (autoStart === undefined) { autoStart = true; } + + var entry = this.getEntry(key); + + if (entry) + { + return entry.plugin; + } + else + { + var plugin = this.getClass(key); + + if (plugin && autoStart) + { + entry = this.createEntry(key, key); + + return (entry) ? entry.plugin : null; + } + else if (plugin) + { + return plugin; + } + } + + return null; + }, + + /** + * Returns the plugin class from the cache. + * Used internally by the Plugin Manager. + * + * @method Phaser.Plugins.PluginManager#getClass + * @since 3.8.0 + * + * @param {string} key - The key of the plugin to get. + * + * @return {Phaser.Plugins.BasePlugin} A Plugin object + */ + getClass: function (key) + { + return PluginCache.getCustomClass(key); + }, + + /** + * Removes a global plugin from the Plugin Manager and Plugin Cache. + * + * It is up to you to remove all references to this plugin that you may hold within your game code. + * + * @method Phaser.Plugins.PluginManager#removeGlobalPlugin + * @since 3.8.0 + * + * @param {string} key - The key of the plugin to remove. + */ + removeGlobalPlugin: function (key) + { + var entry = this.getEntry(key); + + if (entry) + { + Remove(this.plugins, entry); + } + + PluginCache.removeCustom(key); + }, + + /** + * Removes a scene plugin from the Plugin Manager and Plugin Cache. + * + * This will not remove the plugin from any active Scenes that are already using it. + * + * It is up to you to remove all references to this plugin that you may hold within your game code. + * + * @method Phaser.Plugins.PluginManager#removeScenePlugin + * @since 3.8.0 + * + * @param {string} key - The key of the plugin to remove. + */ + removeScenePlugin: function (key) + { + Remove(this.scenePlugins, key); + + PluginCache.remove(key); + }, + + /** + * Registers a new type of Game Object with the global Game Object Factory and / or Creator. + * This is usually called from within your Plugin code and is a helpful short-cut for creating + * new Game Objects. + * + * The key is the property that will be injected into the factories and used to create the + * Game Object. For example: + * + * ```javascript + * this.plugins.registerGameObject('clown', clownFactoryCallback, clownCreatorCallback); + * // later in your game code: + * this.add.clown(); + * this.make.clown(); + * ``` + * + * The callbacks are what are called when the factories try to create a Game Object + * matching the given key. It's important to understand that the callbacks are invoked within + * the context of the GameObjectFactory. In this context there are several properties available + * to use: + * + * this.scene - A reference to the Scene that owns the GameObjectFactory. + * this.displayList - A reference to the Display List the Scene owns. + * this.updateList - A reference to the Update List the Scene owns. + * + * See the GameObjectFactory and GameObjectCreator classes for more details. + * Any public property or method listed is available from your callbacks under `this`. + * + * @method Phaser.Plugins.PluginManager#registerGameObject + * @since 3.8.0 + * + * @param {string} key - The key of the Game Object that the given callbacks will create, i.e. `image`, `sprite`. + * @param {function} [factoryCallback] - The callback to invoke when the Game Object Factory is called. + * @param {function} [creatorCallback] - The callback to invoke when the Game Object Creator is called. + */ + registerGameObject: function (key, factoryCallback, creatorCallback) + { + if (factoryCallback) + { + GameObjectFactory.register(key, factoryCallback); + } + + if (creatorCallback) + { + GameObjectCreator.register(key, creatorCallback); + } + + return this; + }, + + /** + * Registers a new file type with the global File Types Manager, making it available to all Loader + * Plugins created after this. + * + * This is usually called from within your Plugin code and is a helpful short-cut for creating + * new loader file types. + * + * The key is the property that will be injected into the Loader Plugin and used to load the + * files. For example: + * + * ```javascript + * this.plugins.registerFileType('wad', doomWadLoaderCallback); + * // later in your preload code: + * this.load.wad(); + * ``` + * + * The callback is what is called when the loader tries to load a file matching the given key. + * It's important to understand that the callback is invoked within + * the context of the LoaderPlugin. In this context there are several properties / methods available + * to use: + * + * this.addFile - A method to add the new file to the load queue. + * this.scene - The Scene that owns the Loader Plugin instance. + * + * See the LoaderPlugin class for more details. Any public property or method listed is available from + * your callback under `this`. + * + * @method Phaser.Plugins.PluginManager#registerFileType + * @since 3.8.0 + * + * @param {string} key - The key of the Game Object that the given callbacks will create, i.e. `image`, `sprite`. + * @param {function} callback - The callback to invoke when the Game Object Factory is called. + * @param {Phaser.Scene} [addToScene] - Optionally add this file type into the Loader Plugin owned by the given Scene. + */ + registerFileType: function (key, callback, addToScene) + { + FileTypesManager.register(key, callback); + + if (addToScene && addToScene.sys.load) + { + addToScene.sys.load[key] = callback; + } + }, + + /** + * Destroys this Plugin Manager and all associated plugins. + * It will iterate all plugins found and call their `destroy` methods. + * + * The PluginCache will remove all custom plugins. + * + * @method Phaser.Plugins.PluginManager#destroy + * @since 3.8.0 + */ + destroy: function () + { + for (var i = 0; i < this.plugins.length; i++) + { + this.plugins[i].plugin.destroy(); + } + + PluginCache.destroyCustomPlugins(); + + if (this.game.noReturn) + { + PluginCache.destroyCorePlugins(); + } + + this.game = null; + this.plugins = []; + this.scenePlugins = []; + } + +}); + +/* + * "Sometimes, the elegant implementation is just a function. + * Not a method. Not a class. Not a framework. Just a function." + * -- John Carmack + */ + +module.exports = PluginManager; + + +/***/ }), +/* 343 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(173); +var Class = __webpack_require__(0); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(89); +var GameEvents = __webpack_require__(28); +var GetInnerHeight = __webpack_require__(828); +var GetTarget = __webpack_require__(335); +var GetScreenOrientation = __webpack_require__(330); +var NOOP = __webpack_require__(1); +var Rectangle = __webpack_require__(10); +var Size = __webpack_require__(344); +var SnapFloor = __webpack_require__(90); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * The Scale Manager handles the scaling, resizing and alignment of the game canvas. + * + * The way scaling is handled is by setting the game canvas to a fixed size, which is defined in the + * game configuration. You also define the parent container in the game config. If no parent is given, + * it will default to using the document body. The Scale Manager will then look at the available space + * within the _parent_ and scale the canvas accordingly. Scaling is handled by setting the canvas CSS + * width and height properties, leaving the width and height of the canvas element itself untouched. + * Scaling is therefore achieved by keeping the core canvas the same size and 'stretching' + * it via its CSS properties. This gives the same result and speed as using the `transform-scale` CSS + * property, without the need for browser prefix handling. + * + * The calculations for the scale are heavily influenced by the bounding parent size, which is the computed + * dimensions of the canvas's parent. The CSS rules of the parent element play an important role in the + * operation of the Scale Manager. For example, if the parent has no defined width or height, then actions + * like auto-centering will fail to achieve the required result. The Scale Manager works in tandem with the + * CSS you set-up on the page hosting your game, rather than taking control of it. + * + * #### Parent and Display canvas containment guidelines: + * + * - Style the Parent element (of the game canvas) to control the Parent size and thus the games size and layout. + * + * - The Parent element's CSS styles should _effectively_ apply maximum (and minimum) bounding behavior. + * + * - The Parent element should _not_ apply a padding as this is not accounted for. + * If a padding is required apply it to the Parent's parent or apply a margin to the Parent. + * If you need to add a border, margin or any other CSS around your game container, then use a parent element and + * apply the CSS to this instead, otherwise you'll be constantly resizing the shape of the game container. + * + * - The Display canvas layout CSS styles (i.e. margins, size) should not be altered / specified as + * they may be updated by the Scale Manager. + * + * #### Scale Modes + * + * The way the scaling is handled is determined by the `scaleMode` property. The default is `NO_SCALE`, + * which prevents Phaser from scaling or touching the canvas, or its parent, at all. In this mode, you are + * responsible for all scaling. The other scaling modes afford you automatic scaling. + * + * If you wish to scale your game so that it always fits into the available space within the parent, you + * should use the scale mode `FIT`. Look at the documentation for other scale modes to see what options are + * available. Here is a basic config showing how to set this scale mode: + * + * ```javascript + * scale: { + * parent: 'yourgamediv', + * mode: Phaser.Scale.FIT, + * width: 800, + * height: 600 + * } + * ``` + * + * Place the `scale` config object within your game config. + * + * If you wish for the canvas to be resized directly, so that the canvas itself fills the available space + * (i.e. it isn't scaled, it's resized) then use the `RESIZE` scale mode. This will give you a 1:1 mapping + * of canvas pixels to game size. In this mode CSS isn't used to scale the canvas, it's literally adjusted + * to fill all available space within the parent. You should be extremely careful about the size of the + * canvas you're creating when doing this, as the larger the area, the more work the GPU has to do and it's + * very easy to hit fill-rate limits quickly. + * + * For complex, custom-scaling requirements, you should probably consider using the `RESIZE` scale mode, + * with your own limitations in place re: canvas dimensions and managing the scaling with the game scenes + * yourself. For the vast majority of games, however, the `FIT` mode is likely to be the most used. + * + * Please appreciate that the Scale Manager cannot perform miracles. All it does is scale your game canvas + * as best it can, based on what it can infer from its surrounding area. There are all kinds of environments + * where it's up to you to guide and help the canvas position itself, especially when built into rendering + * frameworks like React and Vue. If your page requires meta tags to prevent user scaling gestures, or such + * like, then it's up to you to ensure they are present in the html. + * + * #### Centering + * + * You can also have the game canvas automatically centered. Again, this relies heavily on the parent being + * properly configured and styled, as the centering offsets are based entirely on the available space + * within the parent element. Centering is disabled by default, or can be applied horizontally, vertically, + * or both. Here's an example: + * + * ```javascript + * scale: { + * parent: 'yourgamediv', + * autoCenter: Phaser.Scale.CENTER_BOTH, + * width: 800, + * height: 600 + * } + * ``` + * + * #### Fullscreen API + * + * If the browser supports it, you can send your game into fullscreen mode. In this mode, the game will fill + * the entire display, removing all browser UI and anything else present on the screen. It will remain in this + * mode until your game either disables it, or until the user tabs out or presses ESCape if on desktop. It's a + * great way to achieve a desktop-game like experience from the browser, but it does require a modern browser + * to handle it. Some mobile browsers also support this. + * + * @class ScaleManager + * @memberof Phaser.Scale + * @extends Phaser.Events.EventEmitter + * @constructor + * @since 3.16.0 + * + * @param {Phaser.Game} game - A reference to the Phaser.Game instance. + */ +var ScaleManager = new Class({ + + Extends: EventEmitter, + + initialize: + + function ScaleManager (game) + { + EventEmitter.call(this); + + /** + * A reference to the Phaser.Game instance. + * + * @name Phaser.Scale.ScaleManager#game + * @type {Phaser.Game} + * @readonly + * @since 3.15.0 + */ + this.game = game; + + /** + * A reference to the HTML Canvas Element that Phaser uses to render the game. + * + * @name Phaser.Scale.ScaleManager#canvas + * @type {HTMLCanvasElement} + * @since 3.16.0 + */ + this.canvas; + + /** + * The DOM bounds of the canvas element. + * + * @name Phaser.Scale.ScaleManager#canvasBounds + * @type {Phaser.Geom.Rectangle} + * @since 3.16.0 + */ + this.canvasBounds = new Rectangle(); + + /** + * The parent object of the Canvas. Often a div, or the browser window, or nothing in non-browser environments. + * + * This is set in the Game Config as the `parent` property. If undefined (or just not present), it will default + * to use the document body. If specifically set to `null` Phaser will ignore all parent operations. + * + * @name Phaser.Scale.ScaleManager#parent + * @type {?any} + * @since 3.16.0 + */ + this.parent = null; + + /** + * Is the parent element the browser window? + * + * @name Phaser.Scale.ScaleManager#parentIsWindow + * @type {boolean} + * @since 3.16.0 + */ + this.parentIsWindow = false; + + /** + * The Parent Size component. + * + * @name Phaser.Scale.ScaleManager#parentSize + * @type {Phaser.Structs.Size} + * @since 3.16.0 + */ + this.parentSize = new Size(); + + /** + * The Game Size component. + * + * The un-modified game size, as requested in the game config (the raw width / height), + * as used for world bounds, cameras, etc + * + * @name Phaser.Scale.ScaleManager#gameSize + * @type {Phaser.Structs.Size} + * @since 3.16.0 + */ + this.gameSize = new Size(); + + /** + * The Base Size component. + * + * The modified game size, which is the gameSize * resolution, used to set the canvas width and height + * (but not the CSS style) + * + * @name Phaser.Scale.ScaleManager#baseSize + * @type {Phaser.Structs.Size} + * @since 3.16.0 + */ + this.baseSize = new Size(); + + /** + * The Display Size component. + * + * The size used for the canvas style, factoring in the scale mode, parent and other values. + * + * @name Phaser.Scale.ScaleManager#displaySize + * @type {Phaser.Structs.Size} + * @since 3.16.0 + */ + this.displaySize = new Size(); + + /** + * The game scale mode. + * + * @name Phaser.Scale.ScaleManager#scaleMode + * @type {Phaser.Scale.ScaleModeType} + * @since 3.16.0 + */ + this.scaleMode = CONST.SCALE_MODE.NONE; + + /** + * The canvas resolution. + * + * This is hard-coded to a value of 1 in the 3.16 release of Phaser and will be enabled at a later date. + * + * @name Phaser.Scale.ScaleManager#resolution + * @type {number} + * @since 3.16.0 + */ + this.resolution = 1; + + /** + * The game zoom factor. + * + * This value allows you to multiply your games base size by the given zoom factor. + * This is then used when calculating the display size, even in `NO_SCALE` situations. + * If you don't want Phaser to touch the canvas style at all, this value should be 1. + * + * Can also be set to `MAX_ZOOM` in which case the zoom value will be derived based + * on the game size and available space within the parent. + * + * @name Phaser.Scale.ScaleManager#zoom + * @type {number} + * @since 3.16.0 + */ + this.zoom = 1; + + /** + * The scale factor between the baseSize and the canvasBounds. + * + * @name Phaser.Scale.ScaleManager#displayScale + * @type {Phaser.Math.Vector2} + * @since 3.16.0 + */ + this.displayScale = new Vector2(1, 1); + + /** + * If set, the canvas sizes will be automatically passed through Math.floor. + * This results in rounded pixel display values, which is important for performance on legacy + * and low powered devices, but at the cost of not achieving a 'perfect' fit in some browser windows. + * + * @name Phaser.Scale.ScaleManager#autoRound + * @type {boolean} + * @since 3.16.0 + */ + this.autoRound = false; + + /** + * Automatically center the canvas within the parent? The different centering modes are: + * + * 1. No centering. + * 2. Center both horizontally and vertically. + * 3. Center horizontally. + * 4. Center vertically. + * + * Please be aware that in order to center the game canvas, you must have specified a parent + * that has a size set, or the canvas parent is the document.body. + * + * @name Phaser.Scale.ScaleManager#autoCenter + * @type {Phaser.Scale.CenterType} + * @since 3.16.0 + */ + this.autoCenter = CONST.CENTER.NO_CENTER; + + /** + * The current device orientation. + * + * Orientation events are dispatched via the Device Orientation API, typically only on mobile browsers. + * + * @name Phaser.Scale.ScaleManager#orientation + * @type {Phaser.Scale.OrientationType} + * @since 3.16.0 + */ + this.orientation = CONST.ORIENTATION.LANDSCAPE; + + /** + * A reference to the Device.Fullscreen object. + * + * @name Phaser.Scale.ScaleManager#fullscreen + * @type {Phaser.Device.Fullscreen} + * @since 3.16.0 + */ + this.fullscreen; + + /** + * The DOM Element which is sent into fullscreen mode. + * + * @name Phaser.Scale.ScaleManager#fullscreenTarget + * @type {?any} + * @since 3.16.0 + */ + this.fullscreenTarget = null; + + /** + * Did Phaser create the fullscreen target div, or was it provided in the game config? + * + * @name Phaser.Scale.ScaleManager#_createdFullscreenTarget + * @type {boolean} + * @private + * @since 3.16.0 + */ + this._createdFullscreenTarget = false; + + /** + * Internal var that keeps track of the user, or the browser, requesting fullscreen changes. + * + * @name Phaser.Scale.ScaleManager#_requestedFullscreenChange + * @type {boolean} + * @private + * @since 3.16.2 + */ + this._requestedFullscreenChange = false; + + /** + * The dirty state of the Scale Manager. + * Set if there is a change between the parent size and the current size. + * + * @name Phaser.Scale.ScaleManager#dirty + * @type {boolean} + * @since 3.16.0 + */ + this.dirty = false; + + /** + * How many milliseconds should elapse before checking if the browser size has changed? + * + * Most modern browsers dispatch a 'resize' event, which the Scale Manager will listen for. + * However, older browsers fail to do this, or do it consistently, so we fall back to a + * more traditional 'size check' based on a time interval. You can control how often it is + * checked here. + * + * @name Phaser.Scale.ScaleManager#resizeInterval + * @type {integer} + * @since 3.16.0 + */ + this.resizeInterval = 500; + + /** + * Internal size interval tracker. + * + * @name Phaser.Scale.ScaleManager#_lastCheck + * @type {integer} + * @private + * @since 3.16.0 + */ + this._lastCheck = 0; + + /** + * Internal flag to check orientation state. + * + * @name Phaser.Scale.ScaleManager#_checkOrientation + * @type {boolean} + * @private + * @since 3.16.0 + */ + this._checkOrientation = false; + + /** + * Internal object containing our defined event listeners. + * + * @name Phaser.Scale.ScaleManager#listeners + * @type {object} + * @private + * @since 3.16.0 + */ + this.listeners = { + + orientationChange: NOOP, + windowResize: NOOP, + fullScreenChange: NOOP, + fullScreenError: NOOP + + }; + }, + + /** + * Called _before_ the canvas object is created and added to the DOM. + * + * @method Phaser.Scale.ScaleManager#preBoot + * @protected + * @listens Phaser.Core.Events#BOOT + * @since 3.16.0 + */ + preBoot: function () + { + // Parse the config to get the scaling values we need + this.parseConfig(this.game.config); + + this.game.events.once('boot', this.boot, this); + }, + + /** + * The Boot handler is called by Phaser.Game when it first starts up. + * The renderer is available by now and the canvas has been added to the DOM. + * + * @method Phaser.Scale.ScaleManager#boot + * @protected + * @fires Phaser.Scale.Events#RESIZE + * @since 3.16.0 + */ + boot: function () + { + var game = this.game; + + this.canvas = game.canvas; + + this.fullscreen = game.device.fullscreen; + + if (this.scaleMode !== CONST.SCALE_MODE.RESIZE) + { + this.displaySize.setAspectMode(this.scaleMode); + } + + if (this.scaleMode === CONST.SCALE_MODE.NONE) + { + this.resize(this.width, this.height); + } + else + { + this.getParentBounds(); + + // Only set the parent bounds if the parent has an actual size + if (this.parentSize.width > 0 && this.parentSize.height > 0) + { + this.displaySize.setParent(this.parentSize); + } + + this.refresh(); + } + + game.events.on(GameEvents.PRE_STEP, this.step, this); + + this.startListeners(); + }, + + /** + * Parses the game configuration to set-up the scale defaults. + * + * @method Phaser.Scale.ScaleManager#parseConfig + * @protected + * @since 3.16.0 + * + * @param {Phaser.Types.Core.GameConfig} config - The Game configuration object. + */ + parseConfig: function (config) + { + // Get the parent element, if any + this.getParent(config); + + // Get the size of the parent element + // This can often set a height of zero (especially for un-styled divs) + this.getParentBounds(); + + var width = config.width; + var height = config.height; + var scaleMode = config.scaleMode; + var resolution = config.resolution; + var zoom = config.zoom; + var autoRound = config.autoRound; + + // If width = '100%', or similar value + if (typeof width === 'string') + { + // If we have a parent with a height, we'll work it out from that + var parentWidth = this.parentSize.width; + + if (parentWidth === 0) + { + parentWidth = window.innerWidth; + } + + var parentScaleX = parseInt(width, 10) / 100; + + width = Math.floor(parentWidth * parentScaleX); + } + + // If height = '100%', or similar value + if (typeof height === 'string') + { + // If we have a parent with a height, we'll work it out from that + var parentHeight = this.parentSize.height; + + if (parentHeight === 0) + { + parentHeight = window.innerHeight; + } + + var parentScaleY = parseInt(height, 10) / 100; + + height = Math.floor(parentHeight * parentScaleY); + } + + // This is fixed at 1 on purpose. + // Changing it will break all user input. + // Wait for another release to solve this issue. + this.resolution = 1; + + this.scaleMode = scaleMode; + + this.autoRound = autoRound; + + this.autoCenter = config.autoCenter; + + this.resizeInterval = config.resizeInterval; + + if (autoRound) + { + width = Math.floor(width); + height = Math.floor(height); + } + + // The un-modified game size, as requested in the game config (the raw width / height) as used for world bounds, etc + this.gameSize.setSize(width, height); + + if (zoom === CONST.ZOOM.MAX_ZOOM) + { + zoom = this.getMaxZoom(); + } + + this.zoom = zoom; + + // The modified game size, which is the w/h * resolution + this.baseSize.setSize(width * resolution, height * resolution); + + if (autoRound) + { + this.baseSize.width = Math.floor(this.baseSize.width); + this.baseSize.height = Math.floor(this.baseSize.height); + } + + if (config.minWidth > 0) + { + this.displaySize.setMin(config.minWidth * zoom, config.minHeight * zoom); + } + + if (config.maxWidth > 0) + { + this.displaySize.setMax(config.maxWidth * zoom, config.maxHeight * zoom); + } + + // The size used for the canvas style, factoring in the scale mode and parent and zoom value + // We just use the w/h here as this is what sets the aspect ratio (which doesn't then change) + this.displaySize.setSize(width, height); + + this.orientation = GetScreenOrientation(width, height); + }, + + /** + * Determines the parent element of the game canvas, if any, based on the game configuration. + * + * @method Phaser.Scale.ScaleManager#getParent + * @since 3.16.0 + * + * @param {Phaser.Types.Core.GameConfig} config - The Game configuration object. + */ + getParent: function (config) + { + var parent = config.parent; + + if (parent === null) + { + // User is responsible for managing the parent + return; + } + + this.parent = GetTarget(parent); + this.parentIsWindow = (this.parent === document.body); + + if (config.expandParent && config.scaleMode !== CONST.SCALE_MODE.NONE) + { + var DOMRect = this.parent.getBoundingClientRect(); + + if (this.parentIsWindow || DOMRect.height === 0) + { + document.documentElement.style.height = '100%'; + document.body.style.height = '100%'; + + DOMRect = this.parent.getBoundingClientRect(); + + // The parent STILL has no height, clearly no CSS + // has been set on it even though we fixed the body :( + if (!this.parentIsWindow && DOMRect.height === 0) + { + this.parent.style.overflow = 'hidden'; + this.parent.style.width = '100%'; + this.parent.style.height = '100%'; + } + } + } + + // And now get the fullscreenTarget + if (config.fullscreenTarget && !this.fullscreenTarget) + { + this.fullscreenTarget = GetTarget(config.fullscreenTarget); + } + }, + + /** + * Calculates the size of the parent bounds and updates the `parentSize` component, if the canvas has a dom parent. + * + * @method Phaser.Scale.ScaleManager#getParentBounds + * @since 3.16.0 + * + * @return {boolean} `true` if the parent bounds have changed size, otherwise `false`. + */ + getParentBounds: function () + { + if (!this.parent) + { + return false; + } + + var parentSize = this.parentSize; + + // Ref. http://msdn.microsoft.com/en-us/library/hh781509(v=vs.85).aspx for getBoundingClientRect + + var DOMRect = this.parent.getBoundingClientRect(); + + if (this.parentIsWindow && this.game.device.os.iOS) + { + DOMRect.height = GetInnerHeight(true); + } + + var resolution = this.resolution; + var newWidth = DOMRect.width * resolution; + var newHeight = DOMRect.height * resolution; + + if (parentSize.width !== newWidth || parentSize.height !== newHeight) + { + parentSize.setSize(newWidth, newHeight); + + return true; + } + else + { + return false; + } + }, + + /** + * Attempts to lock the orientation of the web browser using the Screen Orientation API. + * + * This API is only available on modern mobile browsers. + * See https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation for details. + * + * @method Phaser.Scale.ScaleManager#lockOrientation + * @since 3.16.0 + * + * @param {string} orientation - The orientation you'd like to lock the browser in. Should be an API string such as 'landscape', 'landscape-primary', 'portrait', etc. + * + * @return {boolean} `true` if the orientation was successfully locked, otherwise `false`. + */ + lockOrientation: function (orientation) + { + var lock = screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation; + + if (lock) + { + return lock(orientation); + } + + return false; + }, + + /** + * This method will set the size of the Parent Size component, which is used in scaling + * and centering calculations. You only need to call this method if you have explicitly + * disabled the use of a parent in your game config, but still wish to take advantage of + * other Scale Manager features. + * + * @method Phaser.Scale.ScaleManager#setParentSize + * @fires Phaser.Scale.Events#RESIZE + * @since 3.16.0 + * + * @param {number} width - The new width of the parent. + * @param {number} height - The new height of the parent. + * + * @return {this} The Scale Manager instance. + */ + setParentSize: function (width, height) + { + this.parentSize.setSize(width, height); + + return this.refresh(); + }, + + /** + * This method will set a new size for your game. + * + * It should only be used if you're looking to change the base size of your game and are using + * one of the Scale Manager scaling modes, i.e. `FIT`. If you're using `NO_SCALE` and wish to + * change the game and canvas size directly, then please use the `resize` method instead. + * + * @method Phaser.Scale.ScaleManager#setGameSize + * @fires Phaser.Scale.Events#RESIZE + * @since 3.16.0 + * + * @param {number} width - The new width of the game. + * @param {number} height - The new height of the game. + * + * @return {this} The Scale Manager instance. + */ + setGameSize: function (width, height) + { + var autoRound = this.autoRound; + var resolution = this.resolution; + + if (autoRound) + { + width = Math.floor(width); + height = Math.floor(height); + } + + var previousWidth = this.width; + var previousHeight = this.height; + + // The un-modified game size, as requested in the game config (the raw width / height) as used for world bounds, etc + this.gameSize.resize(width, height); + + // The modified game size, which is the w/h * resolution + this.baseSize.resize(width * resolution, height * resolution); + + if (autoRound) + { + this.baseSize.width = Math.floor(this.baseSize.width); + this.baseSize.height = Math.floor(this.baseSize.height); + } + + // The size used for the canvas style, factoring in the scale mode and parent and zoom value + // We just use the w/h here as this is what sets the aspect ratio (which doesn't then change) + this.displaySize.setSize(width, height); + + this.canvas.width = this.baseSize.width; + this.canvas.height = this.baseSize.height; + + return this.refresh(previousWidth, previousHeight); + }, + + /** + * Call this to modify the size of the Phaser canvas element directly. + * You should only use this if you are using the `NO_SCALE` scale mode, + * it will update all internal components completely. + * + * If all you want to do is change the size of the parent, see the `setParentSize` method. + * + * If all you want is to change the base size of the game, but still have the Scale Manager + * manage all the scaling (i.e. you're **not** using `NO_SCALE`), then see the `setGameSize` method. + * + * This method will set the `gameSize`, `baseSize` and `displaySize` components to the given + * dimensions. It will then resize the canvas width and height to the values given, by + * directly setting the properties. Finally, if you have set the Scale Manager zoom value + * to anything other than 1 (the default), it will set the canvas CSS width and height to + * be the given size multiplied by the zoom factor (the canvas pixel size remains untouched). + * + * If you have enabled `autoCenter`, it is then passed to the `updateCenter` method and + * the margins are set, allowing the canvas to be centered based on its parent element + * alone. Finally, the `displayScale` is adjusted and the RESIZE event dispatched. + * + * @method Phaser.Scale.ScaleManager#resize + * @fires Phaser.Scale.Events#RESIZE + * @since 3.16.0 + * + * @param {number} width - The new width of the game. + * @param {number} height - The new height of the game. + * + * @return {this} The Scale Manager instance. + */ + resize: function (width, height) + { + var zoom = this.zoom; + var resolution = this.resolution; + var autoRound = this.autoRound; + + if (autoRound) + { + width = Math.floor(width); + height = Math.floor(height); + } + + var previousWidth = this.width; + var previousHeight = this.height; + + // The un-modified game size, as requested in the game config (the raw width / height) as used for world bounds, etc + this.gameSize.resize(width, height); + + // The modified game size, which is the w/h * resolution + this.baseSize.resize(width * resolution, height * resolution); + + if (autoRound) + { + this.baseSize.width = Math.floor(this.baseSize.width); + this.baseSize.height = Math.floor(this.baseSize.height); + } + + // The size used for the canvas style, factoring in the scale mode and parent and zoom value + // We just use the w/h here as this is what sets the aspect ratio (which doesn't then change) + this.displaySize.setSize((width * zoom) * resolution, (height * zoom) * resolution); + + this.canvas.width = this.baseSize.width; + this.canvas.height = this.baseSize.height; + + var style = this.canvas.style; + + var styleWidth = width * zoom; + var styleHeight = height * zoom; + + if (autoRound) + { + styleWidth = Math.floor(styleWidth); + styleHeight = Math.floor(styleHeight); + } + + if (styleWidth !== width || styleHeight !== height) + { + style.width = styleWidth + 'px'; + style.height = styleHeight + 'px'; + } + + return this.refresh(previousWidth, previousHeight); + }, + + /** + * Sets the zoom value of the Scale Manager. + * + * @method Phaser.Scale.ScaleManager#setZoom + * @fires Phaser.Scale.Events#RESIZE + * @since 3.16.0 + * + * @param {integer} value - The new zoom value of the game. + * + * @return {this} The Scale Manager instance. + */ + setZoom: function (value) + { + this.zoom = value; + + return this.refresh(); + }, + + /** + * Sets the zoom to be the maximum possible based on the _current_ parent size. + * + * @method Phaser.Scale.ScaleManager#setMaxZoom + * @fires Phaser.Scale.Events#RESIZE + * @since 3.16.0 + * + * @return {this} The Scale Manager instance. + */ + setMaxZoom: function () + { + this.zoom = this.getMaxZoom(); + + return this.refresh(); + }, + + /** + * Refreshes the internal scale values, bounds sizes and orientation checks. + * + * Once finished, dispatches the resize event. + * + * This is called automatically by the Scale Manager when the browser window size changes, + * as long as it is using a Scale Mode other than 'NONE'. + * + * @method Phaser.Scale.ScaleManager#refresh + * @fires Phaser.Scale.Events#RESIZE + * @since 3.16.0 + * + * @param {number} [previousWidth] - The previous width of the game. Only set if the gameSize has changed. + * @param {number} [previousHeight] - The previous height of the game. Only set if the gameSize has changed. + * + * @return {this} The Scale Manager instance. + */ + refresh: function (previousWidth, previousHeight) + { + if (previousWidth === undefined) { previousWidth = this.width; } + if (previousHeight === undefined) { previousHeight = this.height; } + + this.updateScale(); + this.updateBounds(); + this.updateOrientation(); + + this.displayScale.set(this.baseSize.width / this.canvasBounds.width, this.baseSize.height / this.canvasBounds.height); + + var domContainer = this.game.domContainer; + + if (domContainer) + { + this.baseSize.setCSS(domContainer); + + var canvasStyle = this.canvas.style; + var domStyle = domContainer.style; + + domStyle.transform = 'scale(' + this.displaySize.width / this.baseSize.width + ',' + this.displaySize.height / this.baseSize.height + ')'; + + domStyle.marginLeft = canvasStyle.marginLeft; + domStyle.marginTop = canvasStyle.marginTop; + } + + this.emit(Events.RESIZE, this.gameSize, this.baseSize, this.displaySize, this.resolution, previousWidth, previousHeight); + + return this; + }, + + /** + * Internal method that checks the current screen orientation, only if the internal check flag is set. + * + * If the orientation has changed it updates the orientation property and then dispatches the orientation change event. + * + * @method Phaser.Scale.ScaleManager#updateOrientation + * @fires Phaser.Scale.Events#ORIENTATION_CHANGE + * @since 3.16.0 + */ + updateOrientation: function () + { + if (this._checkOrientation) + { + this._checkOrientation = false; + + var newOrientation = GetScreenOrientation(this.width, this.height); + + if (newOrientation !== this.orientation) + { + this.orientation = newOrientation; + + this.emit(Events.ORIENTATION_CHANGE, newOrientation); + } + } + }, + + /** + * Internal method that manages updating the size components based on the scale mode. + * + * @method Phaser.Scale.ScaleManager#updateScale + * @since 3.16.0 + */ + updateScale: function () + { + var style = this.canvas.style; + + var width = this.gameSize.width; + var height = this.gameSize.height; + + var styleWidth; + var styleHeight; + + var zoom = this.zoom; + var autoRound = this.autoRound; + var resolution = 1; + + if (this.scaleMode === CONST.SCALE_MODE.NONE) + { + // No scale + this.displaySize.setSize((width * zoom) * resolution, (height * zoom) * resolution); + + styleWidth = this.displaySize.width / resolution; + styleHeight = this.displaySize.height / resolution; + + if (autoRound) + { + styleWidth = Math.floor(styleWidth); + styleHeight = Math.floor(styleHeight); + } + + if (zoom > 1) + { + style.width = styleWidth + 'px'; + style.height = styleHeight + 'px'; + } + } + else if (this.scaleMode === CONST.SCALE_MODE.RESIZE) + { + // Resize to match parent + + // This will constrain using min/max + this.displaySize.setSize(this.parentSize.width, this.parentSize.height); + + this.gameSize.setSize(this.displaySize.width, this.displaySize.height); + + this.baseSize.setSize(this.displaySize.width * resolution, this.displaySize.height * resolution); + + styleWidth = this.displaySize.width / resolution; + styleHeight = this.displaySize.height / resolution; + + if (autoRound) + { + styleWidth = Math.floor(styleWidth); + styleHeight = Math.floor(styleHeight); + } + + this.canvas.width = styleWidth; + this.canvas.height = styleHeight; + } + else + { + // All other scale modes + this.displaySize.setSize(this.parentSize.width, this.parentSize.height); + + styleWidth = this.displaySize.width / resolution; + styleHeight = this.displaySize.height / resolution; + + if (autoRound) + { + styleWidth = Math.floor(styleWidth); + styleHeight = Math.floor(styleHeight); + } + + style.width = styleWidth + 'px'; + style.height = styleHeight + 'px'; + } + + // Update the parentSize incase the canvas / style change modified it + this.getParentBounds(); + + // Finally, update the centering + this.updateCenter(); + }, + + /** + * Calculates and returns the largest possible zoom factor, based on the current + * parent and game sizes. If the parent has no dimensions (i.e. an unstyled div), + * or is smaller than the un-zoomed game, then this will return a value of 1 (no zoom) + * + * @method Phaser.Scale.ScaleManager#getMaxZoom + * @since 3.16.0 + * + * @return {integer} The maximum possible zoom factor. At a minimum this value is always at least 1. + */ + getMaxZoom: function () + { + var zoomH = SnapFloor(this.parentSize.width, this.gameSize.width, 0, true); + var zoomV = SnapFloor(this.parentSize.height, this.gameSize.height, 0, true); + + return Math.max(Math.min(zoomH, zoomV), 1); + }, + + /** + * Calculates and updates the canvas CSS style in order to center it within the + * bounds of its parent. If you have explicitly set parent to be `null` in your + * game config then this method will likely give incorrect results unless you have called the + * `setParentSize` method first. + * + * It works by modifying the canvas CSS `marginLeft` and `marginTop` properties. + * + * If they have already been set by your own style sheet, or code, this will overwrite them. + * + * To prevent the Scale Manager from centering the canvas, either do not set the + * `autoCenter` property in your game config, or make sure it is set to `NO_CENTER`. + * + * @method Phaser.Scale.ScaleManager#updateCenter + * @since 3.16.0 + */ + updateCenter: function () + { + var autoCenter = this.autoCenter; + + if (autoCenter === CONST.CENTER.NO_CENTER) + { + return; + } + + var canvas = this.canvas; + + var style = canvas.style; + + var bounds = canvas.getBoundingClientRect(); + + // var width = parseInt(canvas.style.width, 10) || canvas.width; + // var height = parseInt(canvas.style.height, 10) || canvas.height; + + var width = bounds.width; + var height = bounds.height; + + var offsetX = Math.floor((this.parentSize.width - width) / 2); + var offsetY = Math.floor((this.parentSize.height - height) / 2); + + if (autoCenter === CONST.CENTER.CENTER_HORIZONTALLY) + { + offsetY = 0; + } + else if (autoCenter === CONST.CENTER.CENTER_VERTICALLY) + { + offsetX = 0; + } + + style.marginLeft = offsetX + 'px'; + style.marginTop = offsetY + 'px'; + }, + + /** + * Updates the `canvasBounds` rectangle to match the bounding client rectangle of the + * canvas element being used to track input events. + * + * @method Phaser.Scale.ScaleManager#updateBounds + * @since 3.16.0 + */ + updateBounds: function () + { + var bounds = this.canvasBounds; + var clientRect = this.canvas.getBoundingClientRect(); + + bounds.x = clientRect.left + (window.pageXOffset || 0) - (document.documentElement.clientLeft || 0); + bounds.y = clientRect.top + (window.pageYOffset || 0) - (document.documentElement.clientTop || 0); + bounds.width = clientRect.width; + bounds.height = clientRect.height; + }, + + /** + * Transforms the pageX value into the scaled coordinate space of the Scale Manager. + * + * @method Phaser.Scale.ScaleManager#transformX + * @since 3.16.0 + * + * @param {number} pageX - The DOM pageX value. + * + * @return {number} The translated value. + */ + transformX: function (pageX) + { + return (pageX - this.canvasBounds.left) * this.displayScale.x; + }, + + /** + * Transforms the pageY value into the scaled coordinate space of the Scale Manager. + * + * @method Phaser.Scale.ScaleManager#transformY + * @since 3.16.0 + * + * @param {number} pageY - The DOM pageY value. + * + * @return {number} The translated value. + */ + transformY: function (pageY) + { + return (pageY - this.canvasBounds.top) * this.displayScale.y; + }, + + /** + * Sends a request to the browser to ask it to go in to full screen mode, using the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API Fullscreen API}. + * + * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. + * + * This method _must_ be called from a user-input gesture, such as `pointerup`. You cannot launch + * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked + * from fullscreen unless the iframe has the `allowfullscreen` attribute. + * + * On touch devices, such as Android and iOS Safari, you should always use `pointerup` and NOT `pointerdown`, + * otherwise the request will fail unless the document in which your game is embedded has already received + * some form of touch input, which you cannot guarantee. Activating fullscreen via `pointerup` circumvents + * this issue. + * + * Performing an action that navigates to another page, or opens another tab, will automatically cancel + * fullscreen mode, as will the user pressing the ESC key. To cancel fullscreen mode directly from your game, + * i.e. by clicking an icon, call the `stopFullscreen` method. + * + * A browser can only send one DOM element into fullscreen. You can control which element this is by + * setting the `fullscreenTarget` property in your game config, or changing the property in the Scale Manager. + * Note that the game canvas _must_ be a child of the target. If you do not give a target, Phaser will + * automatically create a blank `
` element and move the canvas into it, before going fullscreen. + * When it leaves fullscreen, the div will be removed. + * + * @method Phaser.Scale.ScaleManager#startFullscreen + * @fires Phaser.Scale.Events#ENTER_FULLSCREEN + * @fires Phaser.Scale.Events#FULLSCREEN_FAILED + * @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED + * @fires Phaser.Scale.Events#RESIZE + * @since 3.16.0 + * + * @param {object} [fullscreenOptions] - The FullscreenOptions dictionary is used to provide configuration options when entering full screen. + */ + startFullscreen: function (fullscreenOptions) + { + if (fullscreenOptions === undefined) { fullscreenOptions = { navigationUI: 'hide' }; } + + var fullscreen = this.fullscreen; + + if (!fullscreen.available) + { + this.emit(Events.FULLSCREEN_UNSUPPORTED); + + return; + } + + if (!fullscreen.active) + { + var fsTarget = this.getFullscreenTarget(); + + this._requestedFullscreenChange = true; + + if (typeof Promise !== 'undefined') + { + if (fullscreen.keyboard) + { + fsTarget[fullscreen.request](Element.ALLOW_KEYBOARD_INPUT) + .then(this.fullscreenSuccessHandler) + .catch(this.fullscreenErrorHandler); + } + else + { + fsTarget[fullscreen.request](fullscreenOptions) + .then(this.fullscreenSuccessHandler) + .catch(this.fullscreenErrorHandler); + } + } + else + { + if (fullscreen.keyboard) + { + fsTarget[fullscreen.request](Element.ALLOW_KEYBOARD_INPUT); + } + else + { + fsTarget[fullscreen.request](fullscreenOptions); + } + + if (fullscreen.active) + { + this.fullscreenSuccessHandler(); + } + else + { + this.fullscreenErrorHandler(); + } + } + } + }, + + /** + * The browser has successfully entered fullscreen mode. + * + * @method Phaser.Scale.ScaleManager#fullscreenSuccessHandler + * @private + * @fires Phaser.Scale.Events#ENTER_FULLSCREEN + * @fires Phaser.Scale.Events#RESIZE + * @since 3.17.0 + */ + fullscreenSuccessHandler: function () + { + this.getParentBounds(); + + this.refresh(); + + this.emit(Events.ENTER_FULLSCREEN); + }, + + /** + * The browser failed to enter fullscreen mode. + * + * @method Phaser.Scale.ScaleManager#fullscreenErrorHandler + * @private + * @fires Phaser.Scale.Events#FULLSCREEN_FAILED + * @fires Phaser.Scale.Events#RESIZE + * @since 3.17.0 + * + * @param {any} error - The DOM error event. + */ + fullscreenErrorHandler: function (error) + { + this.removeFullscreenTarget(); + + this.emit(Events.FULLSCREEN_FAILED, error); + }, + + /** + * An internal method that gets the target element that is used when entering fullscreen mode. + * + * @method Phaser.Scale.ScaleManager#getFullscreenTarget + * @since 3.16.0 + * + * @return {object} The fullscreen target element. + */ + getFullscreenTarget: function () + { + if (!this.fullscreenTarget) + { + var fsTarget = document.createElement('div'); + + fsTarget.style.margin = '0'; + fsTarget.style.padding = '0'; + fsTarget.style.width = '100%'; + fsTarget.style.height = '100%'; + + this.fullscreenTarget = fsTarget; + + this._createdFullscreenTarget = true; + } + + if (this._createdFullscreenTarget) + { + var canvasParent = this.canvas.parentNode; + + canvasParent.insertBefore(this.fullscreenTarget, this.canvas); + + this.fullscreenTarget.appendChild(this.canvas); + } + + return this.fullscreenTarget; + }, + + /** + * Removes the fullscreen target that was added to the DOM. + * + * @method Phaser.Scale.ScaleManager#removeFullscreenTarget + * @since 3.17.0 + */ + removeFullscreenTarget: function () + { + if (this._createdFullscreenTarget) + { + var fsTarget = this.fullscreenTarget; + + if (fsTarget && fsTarget.parentNode) + { + var parent = fsTarget.parentNode; + + parent.insertBefore(this.canvas, fsTarget); + + parent.removeChild(fsTarget); + } + } + }, + + /** + * Calling this method will cancel fullscreen mode, if the browser has entered it. + * + * @method Phaser.Scale.ScaleManager#stopFullscreen + * @fires Phaser.Scale.Events#LEAVE_FULLSCREEN + * @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED + * @since 3.16.0 + */ + stopFullscreen: function () + { + var fullscreen = this.fullscreen; + + if (!fullscreen.available) + { + this.emit(Events.FULLSCREEN_UNSUPPORTED); + + return false; + } + + if (fullscreen.active) + { + this._requestedFullscreenChange = true; + + document[fullscreen.cancel](); + } + + this.removeFullscreenTarget(); + + // Get the parent size again as it will have changed + this.getParentBounds(); + + this.emit(Events.LEAVE_FULLSCREEN); + + this.refresh(); + }, + + /** + * Toggles the fullscreen mode. If already in fullscreen, calling this will cancel it. + * If not in fullscreen, this will request the browser to enter fullscreen mode. + * + * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. + * + * This method _must_ be called from a user-input gesture, such as `pointerdown`. You cannot launch + * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked + * from fullscreen unless the iframe has the `allowfullscreen` attribute. + * + * @method Phaser.Scale.ScaleManager#toggleFullscreen + * @fires Phaser.Scale.Events#ENTER_FULLSCREEN + * @fires Phaser.Scale.Events#LEAVE_FULLSCREEN + * @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED + * @fires Phaser.Scale.Events#RESIZE + * @since 3.16.0 + * + * @param {object} [fullscreenOptions] - The FullscreenOptions dictionary is used to provide configuration options when entering full screen. + */ + toggleFullscreen: function (fullscreenOptions) + { + if (this.fullscreen.active) + { + this.stopFullscreen(); + } + else + { + this.startFullscreen(fullscreenOptions); + } + }, + + /** + * An internal method that starts the different DOM event listeners running. + * + * @method Phaser.Scale.ScaleManager#startListeners + * @since 3.16.0 + */ + startListeners: function () + { + var _this = this; + var listeners = this.listeners; + + listeners.orientationChange = function () + { + _this._checkOrientation = true; + _this.dirty = true; + }; + + listeners.windowResize = function () + { + _this.dirty = true; + }; + + // Only dispatched on mobile devices + window.addEventListener('orientationchange', listeners.orientationChange, false); + + window.addEventListener('resize', listeners.windowResize, false); + + if (this.fullscreen.available) + { + listeners.fullScreenChange = function (event) + { + return _this.onFullScreenChange(event); + }; + + listeners.fullScreenError = function (event) + { + return _this.onFullScreenError(event); + }; + + var vendors = [ 'webkit', 'moz', '' ]; + + vendors.forEach(function (prefix) + { + document.addEventListener(prefix + 'fullscreenchange', listeners.fullScreenChange, false); + document.addEventListener(prefix + 'fullscreenerror', listeners.fullScreenError, false); + }); + + // MS Specific + document.addEventListener('MSFullscreenChange', listeners.fullScreenChange, false); + document.addEventListener('MSFullscreenError', listeners.fullScreenError, false); + } + }, + + /** + * Triggered when a fullscreenchange event is dispatched by the DOM. + * + * @method Phaser.Scale.ScaleManager#onFullScreenChange + * @since 3.16.0 + */ + onFullScreenChange: function () + { + // They pressed ESC while in fullscreen mode + if (!this._requestedFullscreenChange) + { + this.stopFullscreen(); + } + + this._requestedFullscreenChange = false; + }, + + /** + * Triggered when a fullscreenerror event is dispatched by the DOM. + * + * @method Phaser.Scale.ScaleManager#onFullScreenError + * @since 3.16.0 + */ + onFullScreenError: function () + { + this.removeFullscreenTarget(); + }, + + /** + * Internal method, called automatically by the game step. + * Monitors the elapsed time and resize interval to see if a parent bounds check needs to take place. + * + * @method Phaser.Scale.ScaleManager#step + * @since 3.16.0 + * + * @param {number} time - The time value from the most recent Game step. Typically a high-resolution timer value, or Date.now(). + * @param {number} delta - The delta value since the last frame. This is smoothed to avoid delta spikes by the TimeStep class. + */ + step: function (time, delta) + { + if (!this.parent) + { + return; + } + + this._lastCheck += delta; + + if (this.dirty || this._lastCheck > this.resizeInterval) + { + // Returns true if the parent bounds have changed size + if (this.getParentBounds()) + { + this.refresh(); + } + + this.dirty = false; + this._lastCheck = 0; + } + }, + + /** + * Stops all DOM event listeners. + * + * @method Phaser.Scale.ScaleManager#stopListeners + * @since 3.16.0 + */ + stopListeners: function () + { + var listeners = this.listeners; + + window.removeEventListener('orientationchange', listeners.orientationChange, false); + window.removeEventListener('resize', listeners.windowResize, false); + + var vendors = [ 'webkit', 'moz', '' ]; + + vendors.forEach(function (prefix) + { + document.removeEventListener(prefix + 'fullscreenchange', listeners.fullScreenChange, false); + document.removeEventListener(prefix + 'fullscreenerror', listeners.fullScreenError, false); + }); + + // MS Specific + document.removeEventListener('MSFullscreenChange', listeners.fullScreenChange, false); + document.removeEventListener('MSFullscreenError', listeners.fullScreenError, false); + }, + + /** + * Destroys this Scale Manager, releasing all references to external resources. + * Once destroyed, the Scale Manager cannot be used again. + * + * @method Phaser.Scale.ScaleManager#destroy + * @since 3.16.0 + */ + destroy: function () + { + this.removeAllListeners(); + + this.stopListeners(); + + this.game = null; + this.canvas = null; + this.canvasBounds = null; + this.parent = null; + this.parentSize.destroy(); + this.gameSize.destroy(); + this.baseSize.destroy(); + this.displaySize.destroy(); + this.fullscreenTarget = null; + }, + + /** + * Is the browser currently in fullscreen mode or not? + * + * @name Phaser.Scale.ScaleManager#isFullscreen + * @type {boolean} + * @readonly + * @since 3.16.0 + */ + isFullscreen: { + + get: function () + { + return this.fullscreen.active; + } + + }, + + /** + * The game width. + * + * This is typically the size given in the game configuration. + * + * @name Phaser.Scale.ScaleManager#width + * @type {number} + * @readonly + * @since 3.16.0 + */ + width: { + + get: function () + { + return this.gameSize.width; + } + + }, + + /** + * The game height. + * + * This is typically the size given in the game configuration. + * + * @name Phaser.Scale.ScaleManager#height + * @type {number} + * @readonly + * @since 3.16.0 + */ + height: { + + get: function () + { + return this.gameSize.height; + } + + }, + + /** + * Is the device in a portrait orientation as reported by the Orientation API? + * This value is usually only available on mobile devices. + * + * @name Phaser.Scale.ScaleManager#isPortrait + * @type {boolean} + * @readonly + * @since 3.16.0 + */ + isPortrait: { + + get: function () + { + return (this.orientation === CONST.ORIENTATION.PORTRAIT); + } + + }, + + /** + * Is the device in a landscape orientation as reported by the Orientation API? + * This value is usually only available on mobile devices. + * + * @name Phaser.Scale.ScaleManager#isLandscape + * @type {boolean} + * @readonly + * @since 3.16.0 + */ + isLandscape: { + + get: function () + { + return (this.orientation === CONST.ORIENTATION.LANDSCAPE); + } + + }, + + /** + * Are the game dimensions portrait? (i.e. taller than they are wide) + * + * This is different to the device itself being in a portrait orientation. + * + * @name Phaser.Scale.ScaleManager#isGamePortrait + * @type {boolean} + * @readonly + * @since 3.16.0 + */ + isGamePortrait: { + + get: function () + { + return (this.height > this.width); + } + + }, + + /** + * Are the game dimensions landscape? (i.e. wider than they are tall) + * + * This is different to the device itself being in a landscape orientation. + * + * @name Phaser.Scale.ScaleManager#isGameLandscape + * @type {boolean} + * @readonly + * @since 3.16.0 + */ + isGameLandscape: { + + get: function () + { + return (this.width > this.height); + } + + } + +}); + +module.exports = ScaleManager; + + +/***/ }), +/* 344 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); +var Class = __webpack_require__(0); +var SnapFloor = __webpack_require__(90); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * The Size component allows you to set `width` and `height` properties and define the relationship between them. + * + * The component can automatically maintain the aspect ratios between the two values, and clamp them + * to a defined min-max range. You can also control the dominant axis. When dimensions are given to the Size component + * that would cause it to exceed its min-max range, the dimensions are adjusted based on the dominant axis. + * + * @class Size + * @memberof Phaser.Structs + * @constructor + * @since 3.16.0 + * + * @param {number} [width=0] - The width of the Size component. + * @param {number} [height=width] - The height of the Size component. If not given, it will use the `width`. + * @param {integer} [aspectMode=0] - The aspect mode of the Size component. Defaults to 0, no mode. + * @param {any} [parent=null] - The parent of this Size component. Can be any object with public `width` and `height` properties. Dimensions are clamped to keep them within the parent bounds where possible. + */ +var Size = new Class({ + + initialize: + + function Size (width, height, aspectMode, parent) + { + if (width === undefined) { width = 0; } + if (height === undefined) { height = width; } + if (aspectMode === undefined) { aspectMode = 0; } + if (parent === undefined) { parent = null; } + + /** + * Internal width value. + * + * @name Phaser.Structs.Size#_width + * @type {number} + * @private + * @since 3.16.0 + */ + this._width = width; + + /** + * Internal height value. + * + * @name Phaser.Structs.Size#_height + * @type {number} + * @private + * @since 3.16.0 + */ + this._height = height; + + /** + * Internal parent reference. + * + * @name Phaser.Structs.Size#_parent + * @type {any} + * @private + * @since 3.16.0 + */ + this._parent = parent; + + /** + * The aspect mode this Size component will use when calculating its dimensions. + * This property is read-only. To change it use the `setAspectMode` method. + * + * @name Phaser.Structs.Size#aspectMode + * @type {integer} + * @readonly + * @since 3.16.0 + */ + this.aspectMode = aspectMode; + + /** + * The proportional relationship between the width and height. + * + * This property is read-only and is updated automatically when either the `width` or `height` properties are changed, + * depending on the aspect mode. + * + * @name Phaser.Structs.Size#aspectRatio + * @type {number} + * @readonly + * @since 3.16.0 + */ + this.aspectRatio = (height === 0) ? 1 : width / height; + + /** + * The minimum allowed width. + * Cannot be less than zero. + * This value is read-only. To change it see the `setMin` method. + * + * @name Phaser.Structs.Size#minWidth + * @type {number} + * @readonly + * @since 3.16.0 + */ + this.minWidth = 0; + + /** + * The minimum allowed height. + * Cannot be less than zero. + * This value is read-only. To change it see the `setMin` method. + * + * @name Phaser.Structs.Size#minHeight + * @type {number} + * @readonly + * @since 3.16.0 + */ + this.minHeight = 0; + + /** + * The maximum allowed width. + * This value is read-only. To change it see the `setMax` method. + * + * @name Phaser.Structs.Size#maxWidth + * @type {number} + * @readonly + * @since 3.16.0 + */ + this.maxWidth = Number.MAX_VALUE; + + /** + * The maximum allowed height. + * This value is read-only. To change it see the `setMax` method. + * + * @name Phaser.Structs.Size#maxHeight + * @type {number} + * @readonly + * @since 3.16.0 + */ + this.maxHeight = Number.MAX_VALUE; + + /** + * A Vector2 containing the horizontal and vertical snap values, which the width and height are snapped to during resizing. + * + * By default this is disabled. + * + * This property is read-only. To change it see the `setSnap` method. + * + * @name Phaser.Structs.Size#snapTo + * @type {Phaser.Math.Vector2} + * @readonly + * @since 3.16.0 + */ + this.snapTo = new Vector2(); + }, + + /** + * Sets the aspect mode of this Size component. + * + * The aspect mode controls what happens when you modify the `width` or `height` properties, or call `setSize`. + * + * It can be a number from 0 to 4, or a Size constant: + * + * 0. NONE = Do not make the size fit the aspect ratio. Change the ratio when the size changes. + * 1. WIDTH_CONTROLS_HEIGHT = The height is automatically adjusted based on the width. + * 2. HEIGHT_CONTROLS_WIDTH = The width is automatically adjusted based on the height. + * 3. FIT = The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. + * 4. ENVELOP = The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. + * + * Calling this method automatically recalculates the `width` and the `height`, if required. + * + * @method Phaser.Structs.Size#setAspectMode + * @since 3.16.0 + * + * @param {integer} [value=0] - The aspect mode value. + * + * @return {this} This Size component instance. + */ + setAspectMode: function (value) + { + if (value === undefined) { value = 0; } + + this.aspectMode = value; + + return this.setSize(this._width, this._height); + }, + + /** + * By setting a Snap To value when this Size component is modified its dimensions will automatically + * by snapped to the nearest grid slice, using floor. For example, if you have snap value of 16, + * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored) + * + * Note that snapping takes place before adjustments by the parent, or the min / max settings. If these + * values are not multiples of the given snap values, then this can result in un-snapped dimensions. + * + * Call this method with no arguments to reset the snap values. + * + * Calling this method automatically recalculates the `width` and the `height`, if required. + * + * @method Phaser.Structs.Size#setSnap + * @since 3.16.0 + * + * @param {number} [snapWidth=0] - The amount to snap the width to. If you don't want to snap the width, pass a value of zero. + * @param {number} [snapHeight=snapWidth] - The amount to snap the height to. If not provided it will use the `snapWidth` value. If you don't want to snap the height, pass a value of zero. + * + * @return {this} This Size component instance. + */ + setSnap: function (snapWidth, snapHeight) + { + if (snapWidth === undefined) { snapWidth = 0; } + if (snapHeight === undefined) { snapHeight = snapWidth; } + + this.snapTo.set(snapWidth, snapHeight); + + return this.setSize(this._width, this._height); + }, + + /** + * Sets, or clears, the parent of this Size component. + * + * To clear the parent call this method with no arguments. + * + * The parent influences the maximum extents to which this Size compoent can expand, + * based on the aspect mode: + * + * NONE - The parent clamps both the width and height. + * WIDTH_CONTROLS_HEIGHT - The parent clamps just the width. + * HEIGHT_CONTROLS_WIDTH - The parent clamps just the height. + * FIT - The parent clamps whichever axis is required to ensure the size fits within it. + * ENVELOP - The parent is used to ensure the size fully envelops the parent. + * + * Calling this method automatically calls `setSize`. + * + * @method Phaser.Structs.Size#setParent + * @since 3.16.0 + * + * @param {any} [parent] - Sets the parent of this Size component. Don't provide a value to clear an existing parent. + * + * @return {this} This Size component instance. + */ + setParent: function (parent) + { + this._parent = parent; + + return this.setSize(this._width, this._height); + }, + + /** + * Set the minimum width and height values this Size component will allow. + * + * The minimum values can never be below zero, or greater than the maximum values. + * + * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. + * + * Note that based on the aspect mode, and if this Size component has a parent set or not, the minimums set here + * _can_ be exceed in some situations. + * + * @method Phaser.Structs.Size#setMin + * @since 3.16.0 + * + * @param {number} [width=0] - The minimum allowed width of the Size component. + * @param {number} [height=width] - The minimum allowed height of the Size component. If not given, it will use the `width`. + * + * @return {this} This Size component instance. + */ + setMin: function (width, height) + { + if (width === undefined) { width = 0; } + if (height === undefined) { height = width; } + + this.minWidth = Clamp(width, 0, this.maxWidth); + this.minHeight = Clamp(height, 0, this.maxHeight); + + return this.setSize(this._width, this._height); + }, + + /** + * Set the maximum width and height values this Size component will allow. + * + * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. + * + * Note that based on the aspect mode, and if this Size component has a parent set or not, the maximums set here + * _can_ be exceed in some situations. + * + * @method Phaser.Structs.Size#setMax + * @since 3.16.0 + * + * @param {number} [width=Number.MAX_VALUE] - The maximum allowed width of the Size component. + * @param {number} [height=width] - The maximum allowed height of the Size component. If not given, it will use the `width`. + * + * @return {this} This Size component instance. + */ + setMax: function (width, height) + { + if (width === undefined) { width = Number.MAX_VALUE; } + if (height === undefined) { height = width; } + + this.maxWidth = Clamp(width, this.minWidth, Number.MAX_VALUE); + this.maxHeight = Clamp(height, this.minHeight, Number.MAX_VALUE); + + return this.setSize(this._width, this._height); + }, + + /** + * Sets the width and height of this Size component based on the aspect mode. + * + * If the aspect mode is 'none' then calling this method will change the aspect ratio, otherwise the current + * aspect ratio is honored across all other modes. + * + * If snapTo values have been set then the given width and height are snapped first, prior to any further + * adjustment via min/max values, or a parent. + * + * If minimum and/or maximum dimensions have been specified, the values given to this method will be clamped into + * that range prior to adjustment, but may still exceed them depending on the aspect mode. + * + * If this Size component has a parent set, and the aspect mode is `fit` or `envelop`, then the given sizes will + * be clamped to the range specified by the parent. + * + * @method Phaser.Structs.Size#setSize + * @since 3.16.0 + * + * @param {number} [width=0] - The new width of the Size component. + * @param {number} [height=width] - The new height of the Size component. If not given, it will use the `width`. + * + * @return {this} This Size component instance. + */ + setSize: function (width, height) + { + if (width === undefined) { width = 0; } + if (height === undefined) { height = width; } + + switch (this.aspectMode) + { + case Size.NONE: + this._width = this.getNewWidth(SnapFloor(width, this.snapTo.x)); + this._height = this.getNewHeight(SnapFloor(height, this.snapTo.y)); + this.aspectRatio = (this._height === 0) ? 1 : this._width / this._height; + break; + + case Size.WIDTH_CONTROLS_HEIGHT: + this._width = this.getNewWidth(SnapFloor(width, this.snapTo.x)); + this._height = this.getNewHeight(this._width * (1 / this.aspectRatio), false); + break; + + case Size.HEIGHT_CONTROLS_WIDTH: + this._height = this.getNewHeight(SnapFloor(height, this.snapTo.y)); + this._width = this.getNewWidth(this._height * this.aspectRatio, false); + break; + + case Size.FIT: + this.constrain(width, height, true); + break; + + case Size.ENVELOP: + this.constrain(width, height, false); + break; + } + + return this; + }, + + /** + * Sets a new aspect ratio, overriding what was there previously. + * + * It then calls `setSize` immediately using the current dimensions. + * + * @method Phaser.Structs.Size#setAspectRatio + * @since 3.16.0 + * + * @param {number} ratio - The new aspect ratio. + * + * @return {this} This Size component instance. + */ + setAspectRatio: function (ratio) + { + this.aspectRatio = ratio; + + return this.setSize(this._width, this._height); + }, + + /** + * Sets a new width and height for this Size component and updates the aspect ratio based on them. + * + * It _doesn't_ change the `aspectMode` and still factors in size limits such as the min max and parent bounds. + * + * @method Phaser.Structs.Size#resize + * @since 3.16.0 + * + * @param {number} width - The new width of the Size component. + * @param {number} [height=width] - The new height of the Size component. If not given, it will use the `width`. + * + * @return {this} This Size component instance. + */ + resize: function (width, height) + { + this._width = this.getNewWidth(SnapFloor(width, this.snapTo.x)); + this._height = this.getNewHeight(SnapFloor(height, this.snapTo.y)); + this.aspectRatio = (this._height === 0) ? 1 : this._width / this._height; + + return this; + }, + + /** + * Takes a new width and passes it through the min/max clamp and then checks it doesn't exceed the parent width. + * + * @method Phaser.Structs.Size#getNewWidth + * @since 3.16.0 + * + * @param {number} value - The value to clamp and check. + * @param {boolean} [checkParent=true] - Check the given value against the parent, if set. + * + * @return {number} The modified width value. + */ + getNewWidth: function (value, checkParent) + { + if (checkParent === undefined) { checkParent = true; } + + value = Clamp(value, this.minWidth, this.maxWidth); + + if (checkParent && this._parent && value > this._parent.width) + { + value = Math.max(this.minWidth, this._parent.width); + } + + return value; + }, + + /** + * Takes a new height and passes it through the min/max clamp and then checks it doesn't exceed the parent height. + * + * @method Phaser.Structs.Size#getNewHeight + * @since 3.16.0 + * + * @param {number} value - The value to clamp and check. + * @param {boolean} [checkParent=true] - Check the given value against the parent, if set. + * + * @return {number} The modified height value. + */ + getNewHeight: function (value, checkParent) + { + if (checkParent === undefined) { checkParent = true; } + + value = Clamp(value, this.minHeight, this.maxHeight); + + if (checkParent && this._parent && value > this._parent.height) + { + value = Math.max(this.minHeight, this._parent.height); + } + + return value; + }, + + /** + * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. + * + * If `fit` is true there may be some space inside the target area which is not covered if its aspect ratio differs. + * If `fit` is false the size may extend further out than the target area if the aspect ratios differ. + * + * If this Size component has a parent set, then the width and height passed to this method will be clamped so + * it cannot exceed that of the parent. + * + * @method Phaser.Structs.Size#constrain + * @since 3.16.0 + * + * @param {number} [width=0] - The new width of the Size component. + * @param {number} [height] - The new height of the Size component. If not given, it will use the width value. + * @param {boolean} [fit=true] - Perform a `fit` (true) constraint, or an `envelop` (false) constraint. + * + * @return {this} This Size component instance. + */ + constrain: function (width, height, fit) + { + if (width === undefined) { width = 0; } + if (height === undefined) { height = width; } + if (fit === undefined) { fit = true; } + + width = this.getNewWidth(width); + height = this.getNewHeight(height); + + var snap = this.snapTo; + var newRatio = (height === 0) ? 1 : width / height; + + if ((fit && this.aspectRatio > newRatio) || (!fit && this.aspectRatio < newRatio)) + { + // We need to change the height to fit the width + // height = width / this.aspectRatio; + + width = SnapFloor(width, snap.x); + + height = width / this.aspectRatio; + + if (snap.y > 0) + { + height = SnapFloor(height, snap.y); + + // Reduce the width accordingly + width = height * this.aspectRatio; + } + } + else if ((fit && this.aspectRatio < newRatio) || (!fit && this.aspectRatio > newRatio)) + { + // We need to change the width to fit the height + // width = height * this.aspectRatio; + + height = SnapFloor(height, snap.y); + + width = height * this.aspectRatio; + + if (snap.x > 0) + { + width = SnapFloor(width, snap.x); + + // Reduce the height accordingly + height = width * (1 / this.aspectRatio); + } + } + + this._width = width; + this._height = height; + + return this; + }, + + /** + * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. + * + * There may be some space inside the target area which is not covered if its aspect ratio differs. + * + * If this Size component has a parent set, then the width and height passed to this method will be clamped so + * it cannot exceed that of the parent. + * + * @method Phaser.Structs.Size#fitTo + * @since 3.16.0 + * + * @param {number} [width=0] - The new width of the Size component. + * @param {number} [height] - The new height of the Size component. If not given, it will use the width value. + * + * @return {this} This Size component instance. + */ + fitTo: function (width, height) + { + return this.constrain(width, height, true); + }, + + /** + * The current `width` and `height` are adjusted so that they fully envlop the given dimensions, while keeping the aspect ratio. + * + * The size may extend further out than the target area if the aspect ratios differ. + * + * If this Size component has a parent set, then the values are clamped so that it never exceeds the parent + * on the longest axis. + * + * @method Phaser.Structs.Size#envelop + * @since 3.16.0 + * + * @param {number} [width=0] - The new width of the Size component. + * @param {number} [height] - The new height of the Size component. If not given, it will use the width value. + * + * @return {this} This Size component instance. + */ + envelop: function (width, height) + { + return this.constrain(width, height, false); + }, + + /** + * Sets the width of this Size component. + * + * Depending on the aspect mode, changing the width may also update the height and aspect ratio. + * + * @method Phaser.Structs.Size#setWidth + * @since 3.16.0 + * + * @param {number} width - The new width of the Size component. + * + * @return {this} This Size component instance. + */ + setWidth: function (value) + { + return this.setSize(value, this._height); + }, + + /** + * Sets the height of this Size component. + * + * Depending on the aspect mode, changing the height may also update the width and aspect ratio. + * + * @method Phaser.Structs.Size#setHeight + * @since 3.16.0 + * + * @param {number} height - The new height of the Size component. + * + * @return {this} This Size component instance. + */ + setHeight: function (value) + { + return this.setSize(this._width, value); + }, + + /** + * Returns a string representation of this Size component. + * + * @method Phaser.Structs.Size#toString + * @since 3.16.0 + * + * @return {string} A string representation of this Size component. + */ + toString: function () + { + return '[{ Size (width=' + this._width + ' height=' + this._height + ' aspectRatio=' + this.aspectRatio + ' aspectMode=' + this.aspectMode + ') }]'; + }, + + /** + * Sets the values of this Size component to the `element.style.width` and `height` + * properties of the given DOM Element. The properties are set as `px` values. + * + * @method Phaser.Structs.Size#setCSS + * @since 3.17.0 + * + * @param {HTMLElement} element - The DOM Element to set the CSS style on. + */ + setCSS: function (element) + { + if (element && element.style) + { + element.style.width = this._width + 'px'; + element.style.height = this._height + 'px'; + } + }, + + /** + * Copies the aspect mode, aspect ratio, width and height from this Size component + * to the given Size component. Note that the parent, if set, is not copied across. + * + * @method Phaser.Structs.Size#copy + * @since 3.16.0 + * + * @param {Phaser.Structs.Size} destination - The Size component to copy the values to. + * + * @return {Phaser.Structs.Size} The updated destination Size component. + */ + copy: function (destination) + { + destination.setAspectMode(this.aspectMode); + + destination.aspectRatio = this.aspectRatio; + + return destination.setSize(this.width, this.height); + }, + + /** + * Destroys this Size component. + * + * This clears the local properties and any parent object, if set. + * + * A destroyed Size component cannot be re-used. + * + * @method Phaser.Structs.Size#destroy + * @since 3.16.0 + */ + destroy: function () + { + this._parent = null; + this.snapTo = null; + }, + + /** + * The width of this Size component. + * + * This value is clamped to the range specified by `minWidth` and `maxWidth`, if enabled. + * + * A width can never be less than zero. + * + * Changing this value will automatically update the `height` if the aspect ratio lock is enabled. + * You can also use the `setWidth` and `getWidth` methods. + * + * @name Phaser.Structs.Size#width + * @type {number} + * @since 3.16.0 + */ + width: { + + get: function () + { + return this._width; + }, + + set: function (value) + { + this.setSize(value, this._height); + } + + }, + + /** + * The height of this Size component. + * + * This value is clamped to the range specified by `minHeight` and `maxHeight`, if enabled. + * + * A height can never be less than zero. + * + * Changing this value will automatically update the `width` if the aspect ratio lock is enabled. + * You can also use the `setHeight` and `getHeight` methods. + * + * @name Phaser.Structs.Size#height + * @type {number} + * @since 3.16.0 + */ + height: { + + get: function () + { + return this._height; + }, + + set: function (value) + { + this.setSize(this._width, value); + } + + } + +}); + +/** + * Do not make the size fit the aspect ratio. Change the ratio when the size changes. + * + * @name Phaser.Structs.Size.NONE + * @constant + * @type {integer} + * @since 3.16.0 + */ +Size.NONE = 0; + +/** + * The height is automatically adjusted based on the width. + * + * @name Phaser.Structs.Size.WIDTH_CONTROLS_HEIGHT + * @constant + * @type {integer} + * @since 3.16.0 + */ +Size.WIDTH_CONTROLS_HEIGHT = 1; + +/** + * The width is automatically adjusted based on the height. + * + * @name Phaser.Structs.Size.HEIGHT_CONTROLS_WIDTH + * @constant + * @type {integer} + * @since 3.16.0 + */ +Size.HEIGHT_CONTROLS_WIDTH = 2; + +/** + * The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. + * + * @name Phaser.Structs.Size.FIT + * @constant + * @type {integer} + * @since 3.16.0 + */ +Size.FIT = 3; + +/** + * The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. + * + * @name Phaser.Structs.Size.ENVELOP + * @constant + * @type {integer} + * @since 3.16.0 + */ +Size.ENVELOP = 4; + +module.exports = Size; + + +/***/ }), +/* 345 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(122); +var Events = __webpack_require__(19); +var GameEvents = __webpack_require__(28); +var GetValue = __webpack_require__(6); +var LoaderEvents = __webpack_require__(80); +var NOOP = __webpack_require__(1); +var Scene = __webpack_require__(346); +var Systems = __webpack_require__(176); + +/** + * @classdesc + * The Scene Manager. + * + * The Scene Manager is a Game level system, responsible for creating, processing and updating all of the + * Scenes in a Game instance. + * + * + * @class SceneManager + * @memberof Phaser.Scenes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - The Phaser.Game instance this Scene Manager belongs to. + * @param {object} sceneConfig - Scene specific configuration settings. + */ +var SceneManager = new Class({ + + initialize: + + function SceneManager (game, sceneConfig) + { + /** + * The Game that this SceneManager belongs to. + * + * @name Phaser.Scenes.SceneManager#game + * @type {Phaser.Game} + * @since 3.0.0 + */ + this.game = game; + + /** + * An object that maps the keys to the scene so we can quickly get a scene from a key without iteration. + * + * @name Phaser.Scenes.SceneManager#keys + * @type {object} + * @since 3.0.0 + */ + this.keys = {}; + + /** + * The array in which all of the scenes are kept. + * + * @name Phaser.Scenes.SceneManager#scenes + * @type {array} + * @since 3.0.0 + */ + this.scenes = []; + + /** + * Scenes pending to be added are stored in here until the manager has time to add it. + * + * @name Phaser.Scenes.SceneManager#_pending + * @type {array} + * @private + * @since 3.0.0 + */ + this._pending = []; + + /** + * An array of scenes waiting to be started once the game has booted. + * + * @name Phaser.Scenes.SceneManager#_start + * @type {array} + * @private + * @since 3.0.0 + */ + this._start = []; + + /** + * An operations queue, because we don't manipulate the scenes array during processing. + * + * @name Phaser.Scenes.SceneManager#_queue + * @type {array} + * @private + * @since 3.0.0 + */ + this._queue = []; + + /** + * Boot time data to merge. + * + * @name Phaser.Scenes.SceneManager#_data + * @type {object} + * @private + * @since 3.4.0 + */ + this._data = {}; + + /** + * Is the Scene Manager actively processing the Scenes list? + * + * @name Phaser.Scenes.SceneManager#isProcessing + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ + this.isProcessing = false; + + /** + * Has the Scene Manager properly started? + * + * @name Phaser.Scenes.SceneManager#isBooted + * @type {boolean} + * @default false + * @readonly + * @since 3.4.0 + */ + this.isBooted = false; + + /** + * Do any of the Cameras in any of the Scenes require a custom viewport? + * If not we can skip scissor tests. + * + * @name Phaser.Scenes.SceneManager#customViewports + * @type {number} + * @default 0 + * @since 3.12.0 + */ + this.customViewports = 0; + + if (sceneConfig) + { + if (!Array.isArray(sceneConfig)) + { + sceneConfig = [ sceneConfig ]; + } + + for (var i = 0; i < sceneConfig.length; i++) + { + // The i === 0 part just autostarts the first Scene given (unless it says otherwise in its config) + this._pending.push({ + key: 'default', + scene: sceneConfig[i], + autoStart: (i === 0), + data: {} + }); + } + } + + game.events.once(GameEvents.READY, this.bootQueue, this); + }, + + /** + * Internal first-time Scene boot handler. + * + * @method Phaser.Scenes.SceneManager#bootQueue + * @private + * @since 3.2.0 + */ + bootQueue: function () + { + if (this.isBooted) + { + return; + } + + var i; + var entry; + var key; + var sceneConfig; + + for (i = 0; i < this._pending.length; i++) + { + entry = this._pending[i]; + + key = entry.key; + sceneConfig = entry.scene; + + var newScene; + + if (sceneConfig instanceof Scene) + { + newScene = this.createSceneFromInstance(key, sceneConfig); + } + else if (typeof sceneConfig === 'object') + { + newScene = this.createSceneFromObject(key, sceneConfig); + } + else if (typeof sceneConfig === 'function') + { + newScene = this.createSceneFromFunction(key, sceneConfig); + } + + // Replace key in case the scene changed it + key = newScene.sys.settings.key; + + this.keys[key] = newScene; + + this.scenes.push(newScene); + + // Any data to inject? + if (this._data[key]) + { + newScene.sys.settings.data = this._data[key].data; + + if (this._data[key].autoStart) + { + entry.autoStart = true; + } + } + + if (entry.autoStart || newScene.sys.settings.active) + { + this._start.push(key); + } + } + + // Clear the pending lists + this._pending.length = 0; + + this._data = {}; + + this.isBooted = true; + + // _start might have been populated by the above + for (i = 0; i < this._start.length; i++) + { + entry = this._start[i]; + + this.start(entry); + } + + this._start.length = 0; + }, + + /** + * Process the Scene operations queue. + * + * @method Phaser.Scenes.SceneManager#processQueue + * @since 3.0.0 + */ + processQueue: function () + { + var pendingLength = this._pending.length; + var queueLength = this._queue.length; + + if (pendingLength === 0 && queueLength === 0) + { + return; + } + + var i; + var entry; + + if (pendingLength) + { + for (i = 0; i < pendingLength; i++) + { + entry = this._pending[i]; + + this.add(entry.key, entry.scene, entry.autoStart, entry.data); + } + + // _start might have been populated by this.add + for (i = 0; i < this._start.length; i++) + { + entry = this._start[i]; + + this.start(entry); + } + + // Clear the pending lists + this._start.length = 0; + this._pending.length = 0; + + return; + } + + for (i = 0; i < this._queue.length; i++) + { + entry = this._queue[i]; + + this[entry.op](entry.keyA, entry.keyB); + } + + this._queue.length = 0; + }, + + /** + * Adds a new Scene into the SceneManager. + * You must give each Scene a unique key by which you'll identify it. + * + * The `sceneConfig` can be: + * + * * A `Phaser.Scene` object, or an object that extends it. + * * A plain JavaScript object + * * A JavaScript ES6 Class that extends `Phaser.Scene` + * * A JavaScript ES5 prototype based Class + * * A JavaScript function + * + * If a function is given then a new Scene will be created by calling it. + * + * @method Phaser.Scenes.SceneManager#add + * @since 3.0.0 + * + * @param {string} key - A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`. + * @param {(Phaser.Scene|Phaser.Types.Scenes.SettingsConfig|Phaser.Types.Scenes.CreateSceneFromObjectConfig|function)} sceneConfig - The config for the Scene + * @param {boolean} [autoStart=false] - If `true` the Scene will be started immediately after being added. + * @param {object} [data] - Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`. + * + * @return {?Phaser.Scene} The added Scene, if it was added immediately, otherwise `null`. + */ + add: function (key, sceneConfig, autoStart, data) + { + if (autoStart === undefined) { autoStart = false; } + if (data === undefined) { data = {}; } + + // If processing or not booted then put scene into a holding pattern + if (this.isProcessing || !this.isBooted) + { + this._pending.push({ + key: key, + scene: sceneConfig, + autoStart: autoStart, + data: data + }); + + if (!this.isBooted) + { + this._data[key] = { data: data }; + } + + return null; + } + + key = this.getKey(key, sceneConfig); + + var newScene; + + if (sceneConfig instanceof Scene) + { + newScene = this.createSceneFromInstance(key, sceneConfig); + } + else if (typeof sceneConfig === 'object') + { + sceneConfig.key = key; + + newScene = this.createSceneFromObject(key, sceneConfig); + } + else if (typeof sceneConfig === 'function') + { + newScene = this.createSceneFromFunction(key, sceneConfig); + } + + // Any data to inject? + newScene.sys.settings.data = data; + + // Replace key in case the scene changed it + key = newScene.sys.settings.key; + + this.keys[key] = newScene; + + this.scenes.push(newScene); + + if (autoStart || newScene.sys.settings.active) + { + if (this._pending.length) + { + this._start.push(key); + } + else + { + this.start(key); + } + } + + return newScene; + }, + + /** + * Removes a Scene from the SceneManager. + * + * The Scene is removed from the local scenes array, it's key is cleared from the keys + * cache and Scene.Systems.destroy is then called on it. + * + * If the SceneManager is processing the Scenes when this method is called it will + * queue the operation for the next update sequence. + * + * @method Phaser.Scenes.SceneManager#remove + * @since 3.2.0 + * + * @param {(string|Phaser.Scene)} scene - The Scene to be removed. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + remove: function (key) + { + if (this.isProcessing) + { + this._queue.push({ op: 'remove', keyA: key, keyB: null }); + } + else + { + var sceneToRemove = this.getScene(key); + + if (!sceneToRemove || sceneToRemove.sys.isTransitioning()) + { + return this; + } + + var index = this.scenes.indexOf(sceneToRemove); + var sceneKey = sceneToRemove.sys.settings.key; + + if (index > -1) + { + delete this.keys[sceneKey]; + this.scenes.splice(index, 1); + + if (this._start.indexOf(sceneKey) > -1) + { + index = this._start.indexOf(sceneKey); + this._start.splice(index, 1); + } + + sceneToRemove.sys.destroy(); + } + } + + return this; + }, + + /** + * Boot the given Scene. + * + * @method Phaser.Scenes.SceneManager#bootScene + * @private + * @fires Phaser.Scenes.Events#TRANSITION_INIT + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to boot. + */ + bootScene: function (scene) + { + var sys = scene.sys; + var settings = sys.settings; + + if (scene.init) + { + scene.init.call(scene, settings.data); + + settings.status = CONST.INIT; + + if (settings.isTransition) + { + sys.events.emit(Events.TRANSITION_INIT, settings.transitionFrom, settings.transitionDuration); + } + } + + var loader; + + if (sys.load) + { + loader = sys.load; + + loader.reset(); + } + + if (loader && scene.preload) + { + scene.preload.call(scene); + + // Is the loader empty? + if (loader.list.size === 0) + { + this.create(scene); + } + else + { + settings.status = CONST.LOADING; + + // Start the loader going as we have something in the queue + loader.once(LoaderEvents.COMPLETE, this.loadComplete, this); + + loader.start(); + } + } + else + { + // No preload? Then there was nothing to load either + this.create(scene); + } + }, + + /** + * Handles load completion for a Scene's Loader. + * + * Starts the Scene that the Loader belongs to. + * + * @method Phaser.Scenes.SceneManager#loadComplete + * @private + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The loader that has completed loading. + */ + loadComplete: function (loader) + { + var scene = loader.scene; + + // TODO - Remove. This should *not* be handled here + // Try to unlock HTML5 sounds every time any loader completes + if (this.game.sound && this.game.sound.onBlurPausedSounds) + { + this.game.sound.unlock(); + } + + this.create(scene); + }, + + /** + * Handle payload completion for a Scene. + * + * @method Phaser.Scenes.SceneManager#payloadComplete + * @private + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The loader that has completed loading its Scene's payload. + */ + payloadComplete: function (loader) + { + this.bootScene(loader.scene); + }, + + /** + * Updates the Scenes. + * + * @method Phaser.Scenes.SceneManager#update + * @since 3.0.0 + * + * @param {number} time - Time elapsed. + * @param {number} delta - Delta time from the last update. + */ + update: function (time, delta) + { + this.processQueue(); + + this.isProcessing = true; + + // Loop through the active scenes in reverse order + for (var i = this.scenes.length - 1; i >= 0; i--) + { + var sys = this.scenes[i].sys; + + if (sys.settings.status > CONST.START && sys.settings.status <= CONST.RUNNING) + { + sys.step(time, delta); + } + } + }, + + /** + * Renders the Scenes. + * + * @method Phaser.Scenes.SceneManager#render + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer to use. + */ + render: function (renderer) + { + // Loop through the scenes in forward order + for (var i = 0; i < this.scenes.length; i++) + { + var sys = this.scenes[i].sys; + + if (sys.settings.visible && sys.settings.status >= CONST.LOADING && sys.settings.status < CONST.SLEEPING) + { + sys.render(renderer); + } + } + + this.isProcessing = false; + }, + + /** + * Calls the given Scene's {@link Phaser.Scene#create} method and updates its status. + * + * @method Phaser.Scenes.SceneManager#create + * @private + * @fires Phaser.Scenes.Events#CREATE + * @fires Phaser.Scenes.Events#TRANSITION_INIT + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to create. + */ + create: function (scene) + { + var sys = scene.sys; + var settings = sys.settings; + + if (scene.create) + { + settings.status = CONST.CREATING; + + scene.create.call(scene, settings.data); + + if (settings.status === CONST.DESTROYED) + { + return; + } + } + + if (settings.isTransition) + { + sys.events.emit(Events.TRANSITION_START, settings.transitionFrom, settings.transitionDuration); + } + + // If the Scene has an update function we'll set it now, otherwise it'll remain as NOOP + if (scene.update) + { + sys.sceneUpdate = scene.update; + } + + settings.status = CONST.RUNNING; + + sys.events.emit(Events.CREATE, scene); + }, + + /** + * Creates and initializes a Scene from a function. + * + * @method Phaser.Scenes.SceneManager#createSceneFromFunction + * @private + * @since 3.0.0 + * + * @param {string} key - The key of the Scene. + * @param {function} scene - The function to create the Scene from. + * + * @return {Phaser.Scene} The created Scene. + */ + createSceneFromFunction: function (key, scene) + { + var newScene = new scene(); + + if (newScene instanceof Scene) + { + var configKey = newScene.sys.settings.key; + + if (configKey !== '') + { + key = configKey; + } + + if (this.keys.hasOwnProperty(key)) + { + throw new Error('Cannot add a Scene with duplicate key: ' + key); + } + + return this.createSceneFromInstance(key, newScene); + } + else + { + newScene.sys = new Systems(newScene); + + newScene.sys.settings.key = key; + + newScene.sys.init(this.game); + + return newScene; + } + }, + + /** + * Creates and initializes a Scene instance. + * + * @method Phaser.Scenes.SceneManager#createSceneFromInstance + * @private + * @since 3.0.0 + * + * @param {string} key - The key of the Scene. + * @param {Phaser.Scene} newScene - The Scene instance. + * + * @return {Phaser.Scene} The created Scene. + */ + createSceneFromInstance: function (key, newScene) + { + var configKey = newScene.sys.settings.key; + + if (configKey !== '') + { + key = configKey; + } + else + { + newScene.sys.settings.key = key; + } + + newScene.sys.init(this.game); + + return newScene; + }, + + /** + * Creates and initializes a Scene from an Object definition. + * + * @method Phaser.Scenes.SceneManager#createSceneFromObject + * @private + * @since 3.0.0 + * + * @param {string} key - The key of the Scene. + * @param {(string|Phaser.Types.Scenes.SettingsConfig|Phaser.Types.Scenes.CreateSceneFromObjectConfig)} sceneConfig - The Scene config. + * + * @return {Phaser.Scene} The created Scene. + */ + createSceneFromObject: function (key, sceneConfig) + { + var newScene = new Scene(sceneConfig); + + var configKey = newScene.sys.settings.key; + + if (configKey !== '') + { + key = configKey; + } + else + { + newScene.sys.settings.key = key; + } + + newScene.sys.init(this.game); + + // Extract callbacks + + var defaults = [ 'init', 'preload', 'create', 'update', 'render' ]; + + for (var i = 0; i < defaults.length; i++) + { + var sceneCallback = GetValue(sceneConfig, defaults[i], null); + + if (sceneCallback) + { + newScene[defaults[i]] = sceneCallback; + } + } + + // Now let's move across any other functions or properties that may exist in the extend object: + + /* + scene: { + preload: preload, + create: create, + extend: { + hello: 1, + test: 'atari', + addImage: addImage + } + } + */ + + if (sceneConfig.hasOwnProperty('extend')) + { + for (var propertyKey in sceneConfig.extend) + { + var value = sceneConfig.extend[propertyKey]; + + if (propertyKey === 'data' && newScene.hasOwnProperty('data') && typeof value === 'object') + { + // Populate the DataManager + newScene.data.merge(value); + } + else if (propertyKey !== 'sys') + { + newScene[propertyKey] = value; + } + } + } + + return newScene; + }, + + /** + * Retrieves the key of a Scene from a Scene config. + * + * @method Phaser.Scenes.SceneManager#getKey + * @private + * @since 3.0.0 + * + * @param {string} key - The key to check in the Scene config. + * @param {(Phaser.Scene|Phaser.Types.Scenes.SettingsConfig|function)} sceneConfig - The Scene config. + * + * @return {string} The Scene key. + */ + getKey: function (key, sceneConfig) + { + if (!key) { key = 'default'; } + + if (typeof sceneConfig === 'function') + { + return key; + } + else if (sceneConfig instanceof Scene) + { + key = sceneConfig.sys.settings.key; + } + else if (typeof sceneConfig === 'object' && sceneConfig.hasOwnProperty('key')) + { + key = sceneConfig.key; + } + + // By this point it's either 'default' or extracted from the Scene + + if (this.keys.hasOwnProperty(key)) + { + throw new Error('Cannot add a Scene with duplicate key: ' + key); + } + else + { + return key; + } + }, + + /** + * Returns an array of all the current Scenes being managed by this Scene Manager. + * + * You can filter the output by the active state of the Scene and choose to have + * the array returned in normal or reversed order. + * + * @method Phaser.Scenes.SceneManager#getScenes + * @since 3.16.0 + * + * @param {boolean} [isActive=true] - Only include Scene's that are currently active? + * @param {boolean} [inReverse=false] - Return the array of Scenes in reverse? + * + * @return {Phaser.Scene[]} An array containing all of the Scenes in the Scene Manager. + */ + getScenes: function (isActive, inReverse) + { + if (isActive === undefined) { isActive = true; } + if (inReverse === undefined) { inReverse = false; } + + var out = []; + var scenes = this.scenes; + + for (var i = 0; i < scenes.length; i++) + { + var scene = scenes[i]; + + if (scene && (!isActive || (isActive && scene.sys.isActive()))) + { + out.push(scene); + } + } + + return (inReverse) ? out.reverse() : out; + }, + + /** + * Retrieves a Scene. + * + * @method Phaser.Scenes.SceneManager#getScene + * @since 3.0.0 + * + * @param {string|Phaser.Scene} key - The Scene to retrieve. + * + * @return {?Phaser.Scene} The Scene. + */ + getScene: function (key) + { + if (typeof key === 'string') + { + if (this.keys[key]) + { + return this.keys[key]; + } + } + else + { + for (var i = 0; i < this.scenes.length; i++) + { + if (key === this.scenes[i]) + { + return key; + } + } + } + + return null; + }, + + /** + * Determines whether a Scene is running. + * + * @method Phaser.Scenes.SceneManager#isActive + * @since 3.0.0 + * + * @param {string} key - The Scene to check. + * + * @return {boolean} Whether the Scene is running. + */ + isActive: function (key) + { + var scene = this.getScene(key); + + if (scene) + { + return scene.sys.isActive(); + } + + return null; + }, + + /** + * Determines whether a Scene is paused. + * + * @method Phaser.Scenes.SceneManager#isPaused + * @since 3.17.0 + * + * @param {string} key - The Scene to check. + * + * @return {boolean} Whether the Scene is paused. + */ + isPaused: function (key) + { + var scene = this.getScene(key); + + if (scene) + { + return scene.sys.isPaused(); + } + + return null; + }, + + /** + * Determines whether a Scene is visible. + * + * @method Phaser.Scenes.SceneManager#isVisible + * @since 3.0.0 + * + * @param {string} key - The Scene to check. + * + * @return {boolean} Whether the Scene is visible. + */ + isVisible: function (key) + { + var scene = this.getScene(key); + + if (scene) + { + return scene.sys.isVisible(); + } + + return null; + }, + + /** + * Determines whether a Scene is sleeping. + * + * @method Phaser.Scenes.SceneManager#isSleeping + * @since 3.0.0 + * + * @param {string} key - The Scene to check. + * + * @return {boolean} Whether the Scene is sleeping. + */ + isSleeping: function (key) + { + var scene = this.getScene(key); + + if (scene) + { + return scene.sys.isSleeping(); + } + + return null; + }, + + /** + * Pauses the given Scene. + * + * @method Phaser.Scenes.SceneManager#pause + * @since 3.0.0 + * + * @param {string} key - The Scene to pause. + * @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its pause event. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + pause: function (key, data) + { + var scene = this.getScene(key); + + if (scene) + { + scene.sys.pause(data); + } + + return this; + }, + + /** + * Resumes the given Scene. + * + * @method Phaser.Scenes.SceneManager#resume + * @since 3.0.0 + * + * @param {string} key - The Scene to resume. + * @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its resume event. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + resume: function (key, data) + { + var scene = this.getScene(key); + + if (scene) + { + scene.sys.resume(data); + } + + return this; + }, + + /** + * Puts the given Scene to sleep. + * + * @method Phaser.Scenes.SceneManager#sleep + * @since 3.0.0 + * + * @param {string} key - The Scene to put to sleep. + * @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its sleep event. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + sleep: function (key, data) + { + var scene = this.getScene(key); + + if (scene && !scene.sys.isTransitioning()) + { + scene.sys.sleep(data); + } + + return this; + }, + + /** + * Awakens the given Scene. + * + * @method Phaser.Scenes.SceneManager#wake + * @since 3.0.0 + * + * @param {string} key - The Scene to wake up. + * @param {object} [data] - An optional data object that will be passed to the Scene and emitted by its wake event. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + wake: function (key, data) + { + var scene = this.getScene(key); + + if (scene) + { + scene.sys.wake(data); + } + + return this; + }, + + /** + * Runs the given Scene, but does not change the state of this Scene. + * + * If the given Scene is paused, it will resume it. If sleeping, it will wake it. + * If not running at all, it will be started. + * + * Use this if you wish to open a modal Scene by calling `pause` on the current + * Scene, then `run` on the modal Scene. + * + * @method Phaser.Scenes.SceneManager#run + * @since 3.10.0 + * + * @param {string} key - The Scene to run. + * @param {object} [data] - A data object that will be passed to the Scene on start, wake, or resume. + * + * @return {Phaser.Scenes.SceneManager} This Scene Manager. + */ + run: function (key, data) + { + var scene = this.getScene(key); + + if (!scene) + { + for (var i = 0; i < this._pending.length; i++) + { + if (this._pending[i].key === key) + { + this.queueOp('start', key, data); + break; + } + } + return this; + } + + if (scene.sys.isSleeping()) + { + // Sleeping? + scene.sys.wake(data); + } + else if (scene.sys.isBooted && !scene.sys.isActive()) + { + // Paused? + scene.sys.resume(data); + } + else + { + // Not actually running? + this.start(key, data); + } + }, + + /** + * Starts the given Scene. + * + * @method Phaser.Scenes.SceneManager#start + * @since 3.0.0 + * + * @param {string} key - The Scene to start. + * @param {object} [data] - Optional data object to pass to Scene.Settings and Scene.init. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + start: function (key, data) + { + // If the Scene Manager is not running, then put the Scene into a holding pattern + if (!this.isBooted) + { + this._data[key] = { + autoStart: true, + data: data + }; + + return this; + } + + var scene = this.getScene(key); + + if (scene) + { + // If the Scene is already running (perhaps they called start from a launched sub-Scene?) + // then we close it down before starting it again. + if (scene.sys.isActive() || scene.sys.isPaused()) + { + scene.sys.shutdown(); + + scene.sys.start(data); + } + else + { + scene.sys.start(data); + + var loader; + + if (scene.sys.load) + { + loader = scene.sys.load; + } + + // Files payload? + if (loader && scene.sys.settings.hasOwnProperty('pack')) + { + loader.reset(); + + if (loader.addPack({ payload: scene.sys.settings.pack })) + { + scene.sys.settings.status = CONST.LOADING; + + loader.once(LoaderEvents.COMPLETE, this.payloadComplete, this); + + loader.start(); + + return this; + } + } + } + + this.bootScene(scene); + } + + return this; + }, + + /** + * Stops the given Scene. + * + * @method Phaser.Scenes.SceneManager#stop + * @since 3.0.0 + * + * @param {string} key - The Scene to stop. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + stop: function (key) + { + var scene = this.getScene(key); + + if (scene && !scene.sys.isTransitioning()) + { + scene.sys.shutdown(); + } + + return this; + }, + + /** + * Sleeps one one Scene and starts the other. + * + * @method Phaser.Scenes.SceneManager#switch + * @since 3.0.0 + * + * @param {string} from - The Scene to sleep. + * @param {string} to - The Scene to start. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + switch: function (from, to) + { + var sceneA = this.getScene(from); + var sceneB = this.getScene(to); + + if (sceneA && sceneB && sceneA !== sceneB) + { + this.sleep(from); + + if (this.isSleeping(to)) + { + this.wake(to); + } + else + { + this.start(to); + } + } + + return this; + }, + + /** + * Retrieves a Scene by numeric index. + * + * @method Phaser.Scenes.SceneManager#getAt + * @since 3.0.0 + * + * @param {integer} index - The index of the Scene to retrieve. + * + * @return {(Phaser.Scene|undefined)} The Scene. + */ + getAt: function (index) + { + return this.scenes[index]; + }, + + /** + * Retrieves the numeric index of a Scene. + * + * @method Phaser.Scenes.SceneManager#getIndex + * @since 3.0.0 + * + * @param {(string|Phaser.Scene)} key - The key of the Scene. + * + * @return {integer} The index of the Scene. + */ + getIndex: function (key) + { + var scene = this.getScene(key); + + return this.scenes.indexOf(scene); + }, + + /** + * Brings a Scene to the top of the Scenes list. + * + * This means it will render above all other Scenes. + * + * @method Phaser.Scenes.SceneManager#bringToTop + * @since 3.0.0 + * + * @param {(string|Phaser.Scene)} key - The Scene to move. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + bringToTop: function (key) + { + if (this.isProcessing) + { + this._queue.push({ op: 'bringToTop', keyA: key, keyB: null }); + } + else + { + var index = this.getIndex(key); + + if (index !== -1 && index < this.scenes.length) + { + var scene = this.getScene(key); + + this.scenes.splice(index, 1); + this.scenes.push(scene); + } + } + + return this; + }, + + /** + * Sends a Scene to the back of the Scenes list. + * + * This means it will render below all other Scenes. + * + * @method Phaser.Scenes.SceneManager#sendToBack + * @since 3.0.0 + * + * @param {(string|Phaser.Scene)} key - The Scene to move. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + sendToBack: function (key) + { + if (this.isProcessing) + { + this._queue.push({ op: 'sendToBack', keyA: key, keyB: null }); + } + else + { + var index = this.getIndex(key); + + if (index !== -1 && index > 0) + { + var scene = this.getScene(key); + + this.scenes.splice(index, 1); + this.scenes.unshift(scene); + } + } + + return this; + }, + + /** + * Moves a Scene down one position in the Scenes list. + * + * @method Phaser.Scenes.SceneManager#moveDown + * @since 3.0.0 + * + * @param {(string|Phaser.Scene)} key - The Scene to move. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + moveDown: function (key) + { + if (this.isProcessing) + { + this._queue.push({ op: 'moveDown', keyA: key, keyB: null }); + } + else + { + var indexA = this.getIndex(key); + + if (indexA > 0) + { + var indexB = indexA - 1; + var sceneA = this.getScene(key); + var sceneB = this.getAt(indexB); + + this.scenes[indexA] = sceneB; + this.scenes[indexB] = sceneA; + } + } + + return this; + }, + + /** + * Moves a Scene up one position in the Scenes list. + * + * @method Phaser.Scenes.SceneManager#moveUp + * @since 3.0.0 + * + * @param {(string|Phaser.Scene)} key - The Scene to move. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + moveUp: function (key) + { + if (this.isProcessing) + { + this._queue.push({ op: 'moveUp', keyA: key, keyB: null }); + } + else + { + var indexA = this.getIndex(key); + + if (indexA < this.scenes.length - 1) + { + var indexB = indexA + 1; + var sceneA = this.getScene(key); + var sceneB = this.getAt(indexB); + + this.scenes[indexA] = sceneB; + this.scenes[indexB] = sceneA; + } + } + + return this; + }, + + /** + * Moves a Scene so it is immediately above another Scene in the Scenes list. + * + * This means it will render over the top of the other Scene. + * + * @method Phaser.Scenes.SceneManager#moveAbove + * @since 3.2.0 + * + * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above. + * @param {(string|Phaser.Scene)} keyB - The Scene to be moved. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + moveAbove: function (keyA, keyB) + { + if (keyA === keyB) + { + return this; + } + + if (this.isProcessing) + { + this._queue.push({ op: 'moveAbove', keyA: keyA, keyB: keyB }); + } + else + { + var indexA = this.getIndex(keyA); + var indexB = this.getIndex(keyB); + + if (indexA !== -1 && indexB !== -1) + { + var tempScene = this.getAt(indexB); + + // Remove + this.scenes.splice(indexB, 1); + + // Add in new location + this.scenes.splice(indexA + 1, 0, tempScene); + } + } + + return this; + }, + + /** + * Moves a Scene so it is immediately below another Scene in the Scenes list. + * + * This means it will render behind the other Scene. + * + * @method Phaser.Scenes.SceneManager#moveBelow + * @since 3.2.0 + * + * @param {(string|Phaser.Scene)} keyA - The Scene that Scene B will be moved above. + * @param {(string|Phaser.Scene)} keyB - The Scene to be moved. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + moveBelow: function (keyA, keyB) + { + if (keyA === keyB) + { + return this; + } + + if (this.isProcessing) + { + this._queue.push({ op: 'moveBelow', keyA: keyA, keyB: keyB }); + } + else + { + var indexA = this.getIndex(keyA); + var indexB = this.getIndex(keyB); + + if (indexA !== -1 && indexB !== -1) + { + var tempScene = this.getAt(indexB); + + // Remove + this.scenes.splice(indexB, 1); + + if (indexA === 0) + { + this.scenes.unshift(tempScene); + } + else + { + // Add in new location + this.scenes.splice(indexA, 0, tempScene); + } + } + } + + return this; + }, + + /** + * Queue a Scene operation for the next update. + * + * @method Phaser.Scenes.SceneManager#queueOp + * @private + * @since 3.0.0 + * + * @param {string} op - The operation to perform. + * @param {(string|Phaser.Scene)} keyA - Scene A. + * @param {(string|Phaser.Scene)} [keyB] - Scene B. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + queueOp: function (op, keyA, keyB) + { + this._queue.push({ op: op, keyA: keyA, keyB: keyB }); + + return this; + }, + + /** + * Swaps the positions of two Scenes in the Scenes list. + * + * @method Phaser.Scenes.SceneManager#swapPosition + * @since 3.0.0 + * + * @param {(string|Phaser.Scene)} keyA - The first Scene to swap. + * @param {(string|Phaser.Scene)} keyB - The second Scene to swap. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + swapPosition: function (keyA, keyB) + { + if (keyA === keyB) + { + return this; + } + + if (this.isProcessing) + { + this._queue.push({ op: 'swapPosition', keyA: keyA, keyB: keyB }); + } + else + { + var indexA = this.getIndex(keyA); + var indexB = this.getIndex(keyB); + + if (indexA !== indexB && indexA !== -1 && indexB !== -1) + { + var tempScene = this.getAt(indexA); + + this.scenes[indexA] = this.scenes[indexB]; + this.scenes[indexB] = tempScene; + } + } + + return this; + }, + + /** + * Dumps debug information about each Scene to the developer console. + * + * @method Phaser.Scenes.SceneManager#dump + * @since 3.2.0 + */ + dump: function () + { + var out = []; + var map = [ 'pending', 'init', 'start', 'loading', 'creating', 'running', 'paused', 'sleeping', 'shutdown', 'destroyed' ]; + + for (var i = 0; i < this.scenes.length; i++) + { + var sys = this.scenes[i].sys; + + var key = (sys.settings.visible && (sys.settings.status === CONST.RUNNING || sys.settings.status === CONST.PAUSED)) ? '[*] ' : '[-] '; + key += sys.settings.key + ' (' + map[sys.settings.status] + ')'; + + out.push(key); + } + + console.log(out.join('\n')); + }, + + /** + * Destroy the SceneManager and all of its Scene's systems. + * + * @method Phaser.Scenes.SceneManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + for (var i = 0; i < this.scenes.length; i++) + { + var sys = this.scenes[i].sys; + + sys.destroy(); + } + + this.update = NOOP; + + this.scenes = []; + + this._pending = []; + this._start = []; + this._queue = []; + + this.game = null; + } + +}); + +module.exports = SceneManager; + + +/***/ }), +/* 346 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Systems = __webpack_require__(176); + +/** + * @classdesc + * A base Phaser.Scene class which can be extended for your own use. + * + * @class Scene + * @memberof Phaser + * @constructor + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Scenes.SettingsConfig)} config - Scene specific configuration settings. + */ +var Scene = new Class({ + + initialize: + + function Scene (config) + { + /** + * The Scene Systems. You must never overwrite this property, or all hell will break lose. + * + * @name Phaser.Scene#sys + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.sys = new Systems(this, config); + + /** + * A reference to the Phaser.Game instance. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#game + * @type {Phaser.Game} + * @since 3.0.0 + */ + this.game; + + /** + * A reference to the global Animation Manager. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#anims + * @type {Phaser.Animations.AnimationManager} + * @since 3.0.0 + */ + this.anims; + + /** + * A reference to the global Cache. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#cache + * @type {Phaser.Cache.CacheManager} + * @since 3.0.0 + */ + this.cache; + + /** + * A reference to the game level Data Manager. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#registry + * @type {Phaser.Data.DataManager} + * @since 3.0.0 + */ + this.registry; + + /** + * A reference to the Sound Manager. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + * + * @name Phaser.Scene#sound + * @type {Phaser.Sound.BaseSoundManager} + * @since 3.0.0 + */ + this.sound; + + /** + * A reference to the Texture Manager. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#textures + * @type {Phaser.Textures.TextureManager} + * @since 3.0.0 + */ + this.textures; + + /** + * A scene level Event Emitter. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events; + + /** + * A scene level Camera System. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#cameras + * @type {Phaser.Cameras.Scene2D.CameraManager} + * @since 3.0.0 + */ + this.cameras; + + /** + * A scene level Game Object Factory. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#add + * @type {Phaser.GameObjects.GameObjectFactory} + * @since 3.0.0 + */ + this.add; + + /** + * A scene level Game Object Creator. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#make + * @type {Phaser.GameObjects.GameObjectCreator} + * @since 3.0.0 + */ + this.make; + + /** + * A reference to the Scene Manager Plugin. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#scene + * @type {Phaser.Scenes.ScenePlugin} + * @since 3.0.0 + */ + this.scene; + + /** + * A scene level Game Object Display List. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#children + * @type {Phaser.GameObjects.DisplayList} + * @since 3.0.0 + */ + this.children; + + /** + * A scene level Lights Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + * + * @name Phaser.Scene#lights + * @type {Phaser.GameObjects.LightsManager} + * @since 3.0.0 + */ + this.lights; + + /** + * A scene level Data Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + * + * @name Phaser.Scene#data + * @type {Phaser.Data.DataManager} + * @since 3.0.0 + */ + this.data; + + /** + * A scene level Input Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + * + * @name Phaser.Scene#input + * @type {Phaser.Input.InputPlugin} + * @since 3.0.0 + */ + this.input; + + /** + * A scene level Loader Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + * + * @name Phaser.Scene#load + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.0.0 + */ + this.load; + + /** + * A scene level Time and Clock Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + * + * @name Phaser.Scene#time + * @type {Phaser.Time.Clock} + * @since 3.0.0 + */ + this.time; + + /** + * A scene level Tween Manager Plugin. + * This property will only be available if defined in the Scene Injection Map and the plugin is installed. + * + * @name Phaser.Scene#tweens + * @type {Phaser.Tweens.TweenManager} + * @since 3.0.0 + */ + this.tweens; + + /** + * A scene level Arcade Physics Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + * + * @name Phaser.Scene#physics + * @type {Phaser.Physics.Arcade.ArcadePhysics} + * @since 3.0.0 + */ + this.physics; + + /** + * A scene level Impact Physics Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + * + * @name Phaser.Scene#impact + * @type {Phaser.Physics.Impact.ImpactPhysics} + * @since 3.0.0 + */ + this.impact; + + /** + * A scene level Matter Physics Plugin. + * This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured. + * + * @name Phaser.Scene#matter + * @type {Phaser.Physics.Matter.MatterPhysics} + * @since 3.0.0 + */ + this.matter; + + if (false) + {} + + /** + * A reference to the global Scale Manager. + * This property will only be available if defined in the Scene Injection Map. + * + * @name Phaser.Scene#scale + * @type {Phaser.Scale.ScaleManager} + * @since 3.16.2 + */ + this.scale; + + /** + * A reference to the Plugin Manager. + * + * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install + * those plugins into Scenes as required. + * + * @name Phaser.Scene#plugins + * @type {Phaser.Plugins.PluginManager} + * @since 3.0.0 + */ + this.plugins; + }, + + /** + * Should be overridden by your own Scenes. + * This method is called once per game step while the scene is running. + * + * @method Phaser.Scene#update + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update: function () + { + } + + /** + * Can be defined on your own Scenes. + * This method is called by the Scene Manager when the scene starts, before `preload()` and `create()`. + * + * @method Phaser.Scene#init + * @since 3.0.0 + * + * @param {object} data - Any data passed via `ScenePlugin.add()` or `ScenePlugin.start()`. Same as Scene.settings.data. + */ + + /** + * Can be defined on your own Scenes. Use it to load assets. + * This method is called by the Scene Manager, after `init()` and before `create()`, only if the Scene has a LoaderPlugin. + * After this method completes, if the LoaderPlugin's queue isn't empty, the LoaderPlugin will start automatically. + * + * @method Phaser.Scene#preload + * @since 3.0.0 + */ + + /** + * Can be defined on your own Scenes. Use it to create your game objects. + * This method is called by the Scene Manager when the scene starts, after `init()` and `preload()`. + * If the LoaderPlugin started after `preload()`, then this method is called only after loading is complete. + * + * @method Phaser.Scene#create + * @since 3.0.0 + * + * @param {object} data - Any data passed via `ScenePlugin.add()` or `ScenePlugin.start()`. Same as Scene.settings.data. + */ + +}); + +module.exports = Scene; + + +/***/ }), +/* 347 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Capitalizes the first letter of a string if there is one. + * @example + * UppercaseFirst('abc'); + * // returns 'Abc' + * @example + * UppercaseFirst('the happy family'); + * // returns 'The happy family' + * @example + * UppercaseFirst(''); + * // returns '' + * + * @function Phaser.Utils.String.UppercaseFirst + * @since 3.0.0 + * + * @param {string} str - The string to capitalize. + * + * @return {string} A new string, same as the first, but with the first letter capitalized. + */ +var UppercaseFirst = function (str) +{ + return str && str[0].toUpperCase() + str.slice(1); +}; + +module.exports = UppercaseFirst; + + +/***/ }), +/* 348 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(122); +var GetValue = __webpack_require__(6); +var Merge = __webpack_require__(85); +var InjectionMap = __webpack_require__(841); + +/** + * @namespace Phaser.Scenes.Settings + */ + +var Settings = { + + /** + * Takes a Scene configuration object and returns a fully formed System Settings object. + * + * @function Phaser.Scenes.Settings.create + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Scenes.SettingsConfig)} config - The Scene configuration object used to create this Scene Settings. + * + * @return {Phaser.Types.Scenes.SettingsObject} The Scene Settings object created as a result of the config and default settings. + */ + create: function (config) + { + if (typeof config === 'string') + { + config = { key: config }; + } + else if (config === undefined) + { + // Pass the 'hasOwnProperty' checks + config = {}; + } + + return { + + status: CONST.PENDING, + + key: GetValue(config, 'key', ''), + active: GetValue(config, 'active', false), + visible: GetValue(config, 'visible', true), + + isBooted: false, + + isTransition: false, + transitionFrom: null, + transitionDuration: 0, + transitionAllowInput: true, + + // Loader payload array + + data: {}, + + pack: GetValue(config, 'pack', false), + + // Cameras + + cameras: GetValue(config, 'cameras', null), + + // Scene Property Injection Map + + map: GetValue(config, 'map', Merge(InjectionMap, GetValue(config, 'mapAdd', {}))), + + // Physics + + physics: GetValue(config, 'physics', {}), + + // Loader + + loader: GetValue(config, 'loader', {}), + + // Plugins + + plugins: GetValue(config, 'plugins', false), + + // Input + + input: GetValue(config, 'input', {}) + + }; + } + +}; + +module.exports = Settings; + + +/***/ }), +/* 349 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(24); +var CanvasTexture = __webpack_require__(842); +var Class = __webpack_require__(0); +var Color = __webpack_require__(33); +var CONST = __webpack_require__(26); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(118); +var GameEvents = __webpack_require__(28); +var GenerateTexture = __webpack_require__(318); +var GetValue = __webpack_require__(6); +var Parser = __webpack_require__(351); +var Texture = __webpack_require__(177); + +/** + * @callback EachTextureCallback + * + * @param {Phaser.Textures.Texture} texture - Each texture in Texture Manager. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + */ + +/** + * @classdesc + * Textures are managed by the global TextureManager. This is a singleton class that is + * responsible for creating and delivering Textures and their corresponding Frames to Game Objects. + * + * Sprites and other Game Objects get the texture data they need from the TextureManager. + * + * Access it via `scene.textures`. + * + * @class TextureManager + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Textures + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - The Phaser.Game instance this Texture Manager belongs to. + */ +var TextureManager = new Class({ + + Extends: EventEmitter, + + initialize: + + function TextureManager (game) + { + EventEmitter.call(this); + + /** + * The Game that this TextureManager belongs to. + * + * @name Phaser.Textures.TextureManager#game + * @type {Phaser.Game} + * @since 3.0.0 + */ + this.game = game; + + /** + * The name of this manager. + * + * @name Phaser.Textures.TextureManager#name + * @type {string} + * @since 3.0.0 + */ + this.name = 'TextureManager'; + + /** + * An object that has all of textures that Texture Manager creates. + * Textures are assigned to keys so we can access to any texture that this object has directly by key value without iteration. + * + * @name Phaser.Textures.TextureManager#list + * @type {object} + * @default {} + * @since 3.0.0 + */ + this.list = {}; + + /** + * The temporary canvas element to save an pixel data of an arbitrary texture in getPixel() and getPixelAlpha() method. + * + * @name Phaser.Textures.TextureManager#_tempCanvas + * @type {HTMLCanvasElement} + * @private + * @since 3.0.0 + */ + this._tempCanvas = CanvasPool.create2D(this, 1, 1); + + /** + * The context of the temporary canvas element made to save an pixel data in getPixel() and getPixelAlpha() method. + * + * @name Phaser.Textures.TextureManager#_tempContext + * @type {CanvasRenderingContext2D} + * @private + * @since 3.0.0 + */ + this._tempContext = this._tempCanvas.getContext('2d'); + + /** + * An counting value used for emitting 'ready' event after all of managers in game is loaded. + * + * @name Phaser.Textures.TextureManager#_pending + * @type {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + this._pending = 0; + + game.events.once(GameEvents.BOOT, this.boot, this); + }, + + /** + * The Boot Handler called by Phaser.Game when it first starts up. + * + * @method Phaser.Textures.TextureManager#boot + * @private + * @since 3.0.0 + */ + boot: function () + { + this._pending = 2; + + this.on(Events.LOAD, this.updatePending, this); + this.on(Events.ERROR, this.updatePending, this); + + this.addBase64('__DEFAULT', this.game.config.defaultImage); + this.addBase64('__MISSING', this.game.config.missingImage); + + this.game.events.once(GameEvents.DESTROY, this.destroy, this); + }, + + /** + * After 'onload' or 'onerror' invoked twice, emit 'ready' event. + * + * @method Phaser.Textures.TextureManager#updatePending + * @private + * @since 3.0.0 + */ + updatePending: function () + { + this._pending--; + + if (this._pending === 0) + { + this.off(Events.LOAD); + this.off(Events.ERROR); + + this.emit(Events.READY); + } + }, + + /** + * Checks the given texture key and throws a console.warn if the key is already in use, then returns false. + * If you wish to avoid the console.warn then use `TextureManager.exists` instead. + * + * @method Phaser.Textures.TextureManager#checkKey + * @since 3.7.0 + * + * @param {string} key - The texture key to check. + * + * @return {boolean} `true` if it's safe to use the texture key, otherwise `false`. + */ + checkKey: function (key) + { + if (this.exists(key)) + { + // eslint-disable-next-line no-console + console.error('Texture key already in use: ' + key); + + return false; + } + + return true; + }, + + /** + * Removes a Texture from the Texture Manager and destroys it. This will immediately + * clear all references to it from the Texture Manager, and if it has one, destroy its + * WebGLTexture. This will emit a `removetexture` event. + * + * Note: If you have any Game Objects still using this texture they will start throwing + * errors the next time they try to render. Make sure that removing the texture is the final + * step when clearing down to avoid this. + * + * @method Phaser.Textures.TextureManager#remove + * @fires Phaser.Textures.Events#REMOVE + * @since 3.7.0 + * + * @param {(string|Phaser.Textures.Texture)} key - The key of the Texture to remove, or a reference to it. + * + * @return {Phaser.Textures.TextureManager} The Texture Manager. + */ + remove: function (key) + { + if (typeof key === 'string') + { + if (this.exists(key)) + { + key = this.get(key); + } + else + { + console.warn('No texture found matching key: ' + key); + return this; + } + } + + // By this point key should be a Texture, if not, the following fails anyway + if (this.list.hasOwnProperty(key.key)) + { + key.destroy(); + + this.emit(Events.REMOVE, key.key); + } + + return this; + }, + + /** + * Removes a key from the Texture Manager but does not destroy the Texture that was using the key. + * + * @method Phaser.Textures.TextureManager#removeKey + * @since 3.17.0 + * + * @param {string} key - The key to remove from the texture list. + * + * @return {Phaser.Textures.TextureManager} The Texture Manager. + */ + removeKey: function (key) + { + if (this.list.hasOwnProperty(key)) + { + delete this.list[key]; + } + + return this; + }, + + /** + * Adds a new Texture to the Texture Manager created from the given Base64 encoded data. + * + * @method Phaser.Textures.TextureManager#addBase64 + * @fires Phaser.Textures.Events#ADD + * @fires Phaser.Textures.Events#ERROR + * @fires Phaser.Textures.Events#LOAD + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {*} data - The Base64 encoded data. + * + * @return {this} This Texture Manager instance. + */ + addBase64: function (key, data) + { + if (this.checkKey(key)) + { + var _this = this; + + var image = new Image(); + + image.onerror = function () + { + _this.emit(Events.ERROR, key); + }; + + image.onload = function () + { + var texture = _this.create(key, image); + + Parser.Image(texture, 0); + + _this.emit(Events.ADD, key, texture); + + _this.emit(Events.LOAD, key, texture); + }; + + image.src = data; + } + + return this; + }, + + /** + * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. + * + * You can also provide the image type and encoder options. + * + * @method Phaser.Textures.TextureManager#getBase64 + * @since 3.12.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {string} [type='image/png'] - [description] + * @param {number} [encoderOptions=0.92] - [description] + * + * @return {string} The base64 encoded data, or an empty string if the texture frame could not be found. + */ + getBase64: function (key, frame, type, encoderOptions) + { + if (type === undefined) { type = 'image/png'; } + if (encoderOptions === undefined) { encoderOptions = 0.92; } + + var data = ''; + + var textureFrame = this.getFrame(key, frame); + + if (textureFrame) + { + var cd = textureFrame.canvasData; + + var canvas = CanvasPool.create2D(this, cd.width, cd.height); + var ctx = canvas.getContext('2d'); + + ctx.drawImage( + textureFrame.source.image, + cd.x, + cd.y, + cd.width, + cd.height, + 0, + 0, + cd.width, + cd.height + ); + + data = canvas.toDataURL(type, encoderOptions); + + CanvasPool.remove(canvas); + } + + return data; + }, + + /** + * Adds a new Texture to the Texture Manager created from the given Image element. + * + * @method Phaser.Textures.TextureManager#addImage + * @fires Phaser.Textures.Events#ADD + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {HTMLImageElement} source - The source Image element. + * @param {HTMLImageElement|HTMLCanvasElement} [dataSource] - An optional data Image element. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addImage: function (key, source, dataSource) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = this.create(key, source); + + Parser.Image(texture, 0); + + if (dataSource) + { + texture.setDataSource(dataSource); + } + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + + /** + * Adds a Render Texture to the Texture Manager using the given key. + * This allows you to then use the Render Texture as a normal texture for texture based Game Objects like Sprites. + * + * @method Phaser.Textures.TextureManager#addRenderTexture + * @fires Phaser.Textures.Events#ADD + * @since 3.12.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {Phaser.GameObjects.RenderTexture} renderTexture - The source Render Texture. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addRenderTexture: function (key, renderTexture) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = this.create(key, renderTexture); + + texture.add('__BASE', 0, 0, 0, renderTexture.width, renderTexture.height); + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + + /** + * Creates a new Texture using the given config values. + * Generated textures consist of a Canvas element to which the texture data is drawn. + * See the Phaser.Create function for the more direct way to create textures. + * + * @method Phaser.Textures.TextureManager#generate + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {object} config - The configuration object needed to generate the texture. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + generate: function (key, config) + { + if (this.checkKey(key)) + { + var canvas = CanvasPool.create(this, 1, 1); + + config.canvas = canvas; + + GenerateTexture(config); + + return this.addCanvas(key, canvas); + } + else + { + return null; + } + }, + + /** + * Creates a new Texture using a blank Canvas element of the size given. + * + * Canvas elements are automatically pooled and calling this method will + * extract a free canvas from the CanvasPool, or create one if none are available. + * + * @method Phaser.Textures.TextureManager#createCanvas + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {integer} [width=256] - The width of the Canvas element. + * @param {integer} [height=256] - The height of the Canvas element. + * + * @return {?Phaser.Textures.CanvasTexture} The Canvas Texture that was created, or `null` if the key is already in use. + */ + createCanvas: function (key, width, height) + { + if (width === undefined) { width = 256; } + if (height === undefined) { height = 256; } + + if (this.checkKey(key)) + { + var canvas = CanvasPool.create(this, width, height, CONST.CANVAS, true); + + return this.addCanvas(key, canvas); + } + + return null; + }, + + /** + * Creates a new Canvas Texture object from an existing Canvas element + * and adds it to this Texture Manager, unless `skipCache` is true. + * + * @method Phaser.Textures.TextureManager#addCanvas + * @fires Phaser.Textures.Events#ADD + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {HTMLCanvasElement} source - The Canvas element to form the base of the new Texture. + * @param {boolean} [skipCache=false] - Skip adding this Texture into the Cache? + * + * @return {?Phaser.Textures.CanvasTexture} The Canvas Texture that was created, or `null` if the key is already in use. + */ + addCanvas: function (key, source, skipCache) + { + if (skipCache === undefined) { skipCache = false; } + + var texture = null; + + if (skipCache) + { + texture = new CanvasTexture(this, key, source, source.width, source.height); + } + else if (this.checkKey(key)) + { + texture = new CanvasTexture(this, key, source, source.width, source.height); + + this.list[key] = texture; + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + + /** + * Adds a new Texture Atlas to this Texture Manager. + * It can accept either JSON Array or JSON Hash formats, as exported by Texture Packer and similar software. + * + * @method Phaser.Textures.TextureManager#addAtlas + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {HTMLImageElement} source - The source Image element. + * @param {object} data - The Texture Atlas data. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addAtlas: function (key, source, data, dataSource) + { + // New Texture Packer format? + if (Array.isArray(data.textures) || Array.isArray(data.frames)) + { + return this.addAtlasJSONArray(key, source, data, dataSource); + } + else + { + return this.addAtlasJSONHash(key, source, data, dataSource); + } + }, + + /** + * Adds a Texture Atlas to this Texture Manager. + * The frame data of the atlas must be stored in an Array within the JSON. + * This is known as a JSON Array in software such as Texture Packer. + * + * @method Phaser.Textures.TextureManager#addAtlasJSONArray + * @fires Phaser.Textures.Events#ADD + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {(HTMLImageElement|HTMLImageElement[])} source - The source Image element/s. + * @param {(object|object[])} data - The Texture Atlas data/s. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addAtlasJSONArray: function (key, source, data, dataSource) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = this.create(key, source); + + // Multi-Atlas? + if (Array.isArray(data)) + { + var singleAtlasFile = (data.length === 1); // multi-pack with one atlas file for all images + + // !! Assumes the textures are in the same order in the source array as in the json data !! + for (var i = 0; i < texture.source.length; i++) + { + var atlasData = singleAtlasFile ? data[0] : data[i]; + + Parser.JSONArray(texture, i, atlasData); + } + } + else + { + Parser.JSONArray(texture, 0, data); + } + + if (dataSource) + { + texture.setDataSource(dataSource); + } + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + + /** + * Adds a Texture Atlas to this Texture Manager. + * The frame data of the atlas must be stored in an Object within the JSON. + * This is known as a JSON Hash in software such as Texture Packer. + * + * @method Phaser.Textures.TextureManager#addAtlasJSONHash + * @fires Phaser.Textures.Events#ADD + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {HTMLImageElement} source - The source Image element. + * @param {object} data - The Texture Atlas data. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addAtlasJSONHash: function (key, source, data, dataSource) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = this.create(key, source); + + if (Array.isArray(data)) + { + for (var i = 0; i < data.length; i++) + { + Parser.JSONHash(texture, i, data[i]); + } + } + else + { + Parser.JSONHash(texture, 0, data); + } + + if (dataSource) + { + texture.setDataSource(dataSource); + } + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + + /** + * Adds a Texture Atlas to this Texture Manager, where the atlas data is given + * in the XML format. + * + * @method Phaser.Textures.TextureManager#addAtlasXML + * @fires Phaser.Textures.Events#ADD + * @since 3.7.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {HTMLImageElement} source - The source Image element. + * @param {object} data - The Texture Atlas XML data. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addAtlasXML: function (key, source, data, dataSource) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = this.create(key, source); + + Parser.AtlasXML(texture, 0, data); + + if (dataSource) + { + texture.setDataSource(dataSource); + } + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + + /** + * Adds a Unity Texture Atlas to this Texture Manager. + * The data must be in the form of a Unity YAML file. + * + * @method Phaser.Textures.TextureManager#addUnityAtlas + * @fires Phaser.Textures.Events#ADD + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {HTMLImageElement} source - The source Image element. + * @param {object} data - The Texture Atlas data. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLImageElement[]|HTMLCanvasElement[]} [dataSource] - An optional data Image element. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addUnityAtlas: function (key, source, data, dataSource) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = this.create(key, source); + + Parser.UnityYAML(texture, 0, data); + + if (dataSource) + { + texture.setDataSource(dataSource); + } + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + + /** + * Adds a Sprite Sheet to this Texture Manager. + * + * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact + * same size and cannot be trimmed or rotated. + * + * @method Phaser.Textures.TextureManager#addSpriteSheet + * @fires Phaser.Textures.Events#ADD + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {HTMLImageElement} source - The source Image element. + * @param {Phaser.Types.Textures.SpriteSheetConfig} config - The configuration object for this Sprite Sheet. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addSpriteSheet: function (key, source, config) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = this.create(key, source); + + var width = texture.source[0].width; + var height = texture.source[0].height; + + Parser.SpriteSheet(texture, 0, 0, 0, width, height, config); + + this.emit(Events.ADD, key, texture); + } + + return texture; + }, + + /** + * Adds a Sprite Sheet to this Texture Manager, where the Sprite Sheet exists as a Frame within a Texture Atlas. + * + * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact + * same size and cannot be trimmed or rotated. + * + * @method Phaser.Textures.TextureManager#addSpriteSheetFromAtlas + * @fires Phaser.Textures.Events#ADD + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {Phaser.Types.Textures.SpriteSheetFromAtlasConfig} config - The configuration object for this Sprite Sheet. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + addSpriteSheetFromAtlas: function (key, config) + { + if (!this.checkKey(key)) + { + return null; + } + + var atlasKey = GetValue(config, 'atlas', null); + var atlasFrame = GetValue(config, 'frame', null); + + if (!atlasKey || !atlasFrame) + { + return; + } + + var atlas = this.get(atlasKey); + var sheet = atlas.get(atlasFrame); + + if (sheet) + { + var texture = this.create(key, sheet.source.image); + + if (sheet.trimmed) + { + // If trimmed we need to help the parser adjust + Parser.SpriteSheetFromAtlas(texture, sheet, config); + } + else + { + Parser.SpriteSheet(texture, 0, sheet.cutX, sheet.cutY, sheet.cutWidth, sheet.cutHeight, config); + } + + this.emit(Events.ADD, key, texture); + + return texture; + } + }, + + /** + * Creates a new Texture using the given source and dimensions. + * + * @method Phaser.Textures.TextureManager#create + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {HTMLImageElement} source - The source Image element. + * @param {integer} width - The width of the Texture. + * @param {integer} height - The height of the Texture. + * + * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. + */ + create: function (key, source, width, height) + { + var texture = null; + + if (this.checkKey(key)) + { + texture = new Texture(this, key, source, width, height); + + this.list[key] = texture; + } + + return texture; + }, + + /** + * Checks the given key to see if a Texture using it exists within this Texture Manager. + * + * @method Phaser.Textures.TextureManager#exists + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * + * @return {boolean} Returns `true` if a Texture matching the given key exists in this Texture Manager. + */ + exists: function (key) + { + return (this.list.hasOwnProperty(key)); + }, + + /** + * Returns a Texture from the Texture Manager that matches the given key. + * If the key is undefined it will return the `__DEFAULT` Texture. + * If the key is given, but not found, it will return the `__MISSING` Texture. + * + * @method Phaser.Textures.TextureManager#get + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * + * @return {Phaser.Textures.Texture} The Texture that was created. + */ + get: function (key) + { + if (key === undefined) { key = '__DEFAULT'; } + + if (this.list[key]) + { + return this.list[key]; + } + else + { + return this.list['__MISSING']; + } + }, + + /** + * Takes a Texture key and Frame name and returns a clone of that Frame if found. + * + * @method Phaser.Textures.TextureManager#cloneFrame + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {(string|integer)} frame - The string or index of the Frame to be cloned. + * + * @return {Phaser.Textures.Frame} A Clone of the given Frame. + */ + cloneFrame: function (key, frame) + { + if (this.list[key]) + { + return this.list[key].get(frame).clone(); + } + }, + + /** + * Takes a Texture key and Frame name and returns a reference to that Frame, if found. + * + * @method Phaser.Textures.TextureManager#getFrame + * @since 3.0.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * + * @return {Phaser.Textures.Frame} A Texture Frame object. + */ + getFrame: function (key, frame) + { + if (this.list[key]) + { + return this.list[key].get(frame); + } + }, + + /** + * Returns an array with all of the keys of all Textures in this Texture Manager. + * The output array will exclude the `__DEFAULT` and `__MISSING` keys. + * + * @method Phaser.Textures.TextureManager#getTextureKeys + * @since 3.0.0 + * + * @return {string[]} An array containing all of the Texture keys stored in this Texture Manager. + */ + getTextureKeys: function () + { + var output = []; + + for (var key in this.list) + { + if (key !== '__DEFAULT' && key !== '__MISSING') + { + output.push(key); + } + } + + return output; + }, + + /** + * Given a Texture and an `x` and `y` coordinate this method will return a new + * Color object that has been populated with the color and alpha values of the pixel + * at that location in the Texture. + * + * @method Phaser.Textures.TextureManager#getPixel + * @since 3.0.0 + * + * @param {integer} x - The x coordinate of the pixel within the Texture. + * @param {integer} y - The y coordinate of the pixel within the Texture. + * @param {string} key - The unique string-based key of the Texture. + * @param {(string|integer)} [frame] - The string or index of the Frame. + * + * @return {?Phaser.Display.Color} A Color object populated with the color values of the requested pixel, + * or `null` if the coordinates were out of bounds. + */ + getPixel: function (x, y, key, frame) + { + var textureFrame = this.getFrame(key, frame); + + if (textureFrame) + { + // Adjust for trim (if not trimmed x and y are just zero) + x -= textureFrame.x; + y -= textureFrame.y; + + var data = textureFrame.data.cut; + + x += data.x; + y += data.y; + + if (x >= data.x && x < data.r && y >= data.y && y < data.b) + { + var ctx = this._tempContext; + + ctx.clearRect(0, 0, 1, 1); + ctx.drawImage(textureFrame.source.image, x, y, 1, 1, 0, 0, 1, 1); + + var rgb = ctx.getImageData(0, 0, 1, 1); + + return new Color(rgb.data[0], rgb.data[1], rgb.data[2], rgb.data[3]); + } + } + + return null; + }, + + /** + * Given a Texture and an `x` and `y` coordinate this method will return a value between 0 and 255 + * corresponding to the alpha value of the pixel at that location in the Texture. If the coordinate + * is out of bounds it will return null. + * + * @method Phaser.Textures.TextureManager#getPixelAlpha + * @since 3.10.0 + * + * @param {integer} x - The x coordinate of the pixel within the Texture. + * @param {integer} y - The y coordinate of the pixel within the Texture. + * @param {string} key - The unique string-based key of the Texture. + * @param {(string|integer)} [frame] - The string or index of the Frame. + * + * @return {integer} A value between 0 and 255, or `null` if the coordinates were out of bounds. + */ + getPixelAlpha: function (x, y, key, frame) + { + var textureFrame = this.getFrame(key, frame); + + if (textureFrame) + { + // Adjust for trim (if not trimmed x and y are just zero) + x -= textureFrame.x; + y -= textureFrame.y; + + var data = textureFrame.data.cut; + + x += data.x; + y += data.y; + + if (x >= data.x && x < data.r && y >= data.y && y < data.b) + { + var ctx = this._tempContext; + + ctx.clearRect(0, 0, 1, 1); + ctx.drawImage(textureFrame.source.image, x, y, 1, 1, 0, 0, 1, 1); + + var rgb = ctx.getImageData(0, 0, 1, 1); + + return rgb.data[3]; + } + } + + return null; + }, + + /** + * Sets the given Game Objects `texture` and `frame` properties so that it uses + * the Texture and Frame specified in the `key` and `frame` arguments to this method. + * + * @method Phaser.Textures.TextureManager#setTexture + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the texture would be set on. + * @param {string} key - The unique string-based key of the Texture. + * @param {(string|integer)} [frame] - The string or index of the Frame. + * + * @return {Phaser.GameObjects.GameObject} The Game Object the texture was set on. + */ + setTexture: function (gameObject, key, frame) + { + if (this.list[key]) + { + gameObject.texture = this.list[key]; + gameObject.frame = gameObject.texture.get(frame); + } + + return gameObject; + }, + + /** + * Changes the key being used by a Texture to the new key provided. + * + * The old key is removed, allowing it to be re-used. + * + * Game Objects are linked to Textures by a reference to the Texture object, so + * all existing references will be retained. + * + * @method Phaser.Textures.TextureManager#renameTexture + * @since 3.12.0 + * + * @param {string} currentKey - The current string-based key of the Texture you wish to rename. + * @param {string} newKey - The new unique string-based key to use for the Texture. + * + * @return {boolean} `true` if the Texture key was successfully renamed, otherwise `false`. + */ + renameTexture: function (currentKey, newKey) + { + var texture = this.get(currentKey); + + if (texture && currentKey !== newKey) + { + texture.key = newKey; + + this.list[newKey] = texture; + + delete this.list[currentKey]; + + return true; + } + + return false; + }, + + /** + * Passes all Textures to the given callback. + * + * @method Phaser.Textures.TextureManager#each + * @since 3.0.0 + * + * @param {EachTextureCallback} callback - The callback function to be sent the Textures. + * @param {object} scope - The value to use as `this` when executing the callback. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + */ + each: function (callback, scope) + { + var args = [ null ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var texture in this.list) + { + args[0] = this.list[texture]; + + callback.apply(scope, args); + } + }, + + /** + * Destroys the Texture Manager and all Textures stored within it. + * + * @method Phaser.Textures.TextureManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + for (var texture in this.list) + { + this.list[texture].destroy(); + } + + this.list = {}; + + this.game = null; + + CanvasPool.remove(this._tempCanvas); + } + +}); + +module.exports = TextureManager; + + +/***/ }), +/* 350 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(24); +var Class = __webpack_require__(0); +var IsSizePowerOfTwo = __webpack_require__(117); +var ScaleModes = __webpack_require__(104); + +/** + * @classdesc + * A Texture Source is the encapsulation of the actual source data for a Texture. + * This is typically an Image Element, loaded from the file system or network, or a Canvas Element. + * + * A Texture can contain multiple Texture Sources, which only happens when a multi-atlas is loaded. + * + * @class TextureSource + * @memberof Phaser.Textures + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to. + * @param {(HTMLImageElement|HTMLCanvasElement)} source - The source image data. + * @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself. + * @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself. + */ +var TextureSource = new Class({ + + initialize: + + function TextureSource (texture, source, width, height) + { + var game = texture.manager.game; + + /** + * The Texture this TextureSource belongs to. + * + * @name Phaser.Textures.TextureSource#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.7.0 + */ + this.renderer = game.renderer; + + /** + * The Texture this TextureSource belongs to. + * + * @name Phaser.Textures.TextureSource#texture + * @type {Phaser.Textures.Texture} + * @since 3.0.0 + */ + this.texture = texture; + + /** + * The source of the image data. + * This is either an Image Element, a Canvas Element or a RenderTexture. + * + * @name Phaser.Textures.TextureSource#source + * @type {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture)} + * @since 3.12.0 + */ + this.source = source; + + /** + * The image data. + * This is either an Image element or a Canvas element. + * + * @name Phaser.Textures.TextureSource#image + * @type {(HTMLImageElement|HTMLCanvasElement)} + * @since 3.0.0 + */ + this.image = source; + + /** + * Currently un-used. + * + * @name Phaser.Textures.TextureSource#compressionAlgorithm + * @type {integer} + * @default null + * @since 3.0.0 + */ + this.compressionAlgorithm = null; + + /** + * The resolution of the source image. + * + * @name Phaser.Textures.TextureSource#resolution + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.resolution = 1; + + /** + * The width of the source image. If not specified in the constructor it will check + * the `naturalWidth` and then `width` properties of the source image. + * + * @name Phaser.Textures.TextureSource#width + * @type {integer} + * @since 3.0.0 + */ + this.width = width || source.naturalWidth || source.width || 0; + + /** + * The height of the source image. If not specified in the constructor it will check + * the `naturalHeight` and then `height` properties of the source image. + * + * @name Phaser.Textures.TextureSource#height + * @type {integer} + * @since 3.0.0 + */ + this.height = height || source.naturalHeight || source.height || 0; + + /** + * The Scale Mode the image will use when rendering. + * Either Linear or Nearest. + * + * @name Phaser.Textures.TextureSource#scaleMode + * @type {number} + * @since 3.0.0 + */ + this.scaleMode = ScaleModes.DEFAULT; + + /** + * Is the source image a Canvas Element? + * + * @name Phaser.Textures.TextureSource#isCanvas + * @type {boolean} + * @since 3.0.0 + */ + this.isCanvas = (source instanceof HTMLCanvasElement); + + /** + * Is the source image a Render Texture? + * + * @name Phaser.Textures.TextureSource#isRenderTexture + * @type {boolean} + * @since 3.12.0 + */ + this.isRenderTexture = (source.type === 'RenderTexture'); + + /** + * Are the source image dimensions a power of two? + * + * @name Phaser.Textures.TextureSource#isPowerOf2 + * @type {boolean} + * @since 3.0.0 + */ + this.isPowerOf2 = IsSizePowerOfTwo(this.width, this.height); + + /** + * The WebGL Texture of the source image. + * + * @name Phaser.Textures.TextureSource#glTexture + * @type {?WebGLTexture} + * @default null + * @since 3.0.0 + */ + this.glTexture = null; + + this.init(game); + }, + + /** + * Creates a WebGL Texture, if required, and sets the Texture filter mode. + * + * @method Phaser.Textures.TextureSource#init + * @since 3.0.0 + * + * @param {Phaser.Game} game - A reference to the Phaser Game instance. + */ + init: function (game) + { + if (this.renderer) + { + if (this.renderer.gl) + { + if (this.isCanvas) + { + this.glTexture = this.renderer.canvasToTexture(this.image); + } + else if (this.isRenderTexture) + { + this.image = this.source.canvas; + + this.glTexture = this.renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode); + } + else + { + this.glTexture = this.renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode); + } + } + else if (this.isRenderTexture) + { + this.image = this.source.canvas; + } + } + + if (!game.config.antialias) + { + this.setFilter(1); + } + }, + + /** + * Sets the Filter Mode for this Texture. + * + * The mode can be either Linear, the default, or Nearest. + * + * For pixel-art you should use Nearest. + * + * @method Phaser.Textures.TextureSource#setFilter + * @since 3.0.0 + * + * @param {Phaser.Textures.FilterMode} filterMode - The Filter Mode. + */ + setFilter: function (filterMode) + { + if (this.renderer.gl) + { + this.renderer.setTextureFilter(this.glTexture, filterMode); + } + }, + + /** + * If this TextureSource is backed by a Canvas and is running under WebGL, + * it updates the WebGLTexture using the canvas data. + * + * @method Phaser.Textures.TextureSource#update + * @since 3.7.0 + */ + update: function () + { + if (this.renderer.gl && this.isCanvas) + { + this.glTexture = this.renderer.canvasToTexture(this.image, this.glTexture); + + // Update all the Frames using this TextureSource + + /* + var index = this.texture.getTextureSourceIndex(this); + + var frames = this.texture.getFramesFromTextureSource(index, true); + + for (var i = 0; i < frames.length; i++) + { + frames[i].glTexture = this.glTexture; + } + */ + } + }, + + /** + * Destroys this Texture Source and nulls the references. + * + * @method Phaser.Textures.TextureSource#destroy + * @since 3.0.0 + */ + destroy: function () + { + if (this.glTexture) + { + this.renderer.deleteTexture(this.glTexture); + } + + if (this.isCanvas) + { + CanvasPool.remove(this.image); + } + + this.renderer = null; + this.texture = null; + this.source = null; + this.image = null; + this.glTexture = null; + } + +}); + +module.exports = TextureSource; + + +/***/ }), +/* 351 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Textures.Parsers + */ + +module.exports = { + + AtlasXML: __webpack_require__(843), + Canvas: __webpack_require__(844), + Image: __webpack_require__(845), + JSONArray: __webpack_require__(846), + JSONHash: __webpack_require__(847), + SpriteSheet: __webpack_require__(848), + SpriteSheetFromAtlas: __webpack_require__(849), + UnityYAML: __webpack_require__(850) + +}; + + +/***/ }), +/* 352 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var HTML5AudioSoundManager = __webpack_require__(353); +var NoAudioSoundManager = __webpack_require__(355); +var WebAudioSoundManager = __webpack_require__(357); + +/** + * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings. + * + * Be aware of https://developers.google.com/web/updates/2017/09/autoplay-policy-changes + * + * @function Phaser.Sound.SoundManagerCreator + * @since 3.0.0 + * + * @param {Phaser.Game} game - Reference to the current game instance. + */ +var SoundManagerCreator = { + + create: function (game) + { + var audioConfig = game.config.audio; + var deviceAudio = game.device.audio; + + if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData)) + { + return new NoAudioSoundManager(game); + } + + if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio)) + { + return new WebAudioSoundManager(game); + } + + return new HTML5AudioSoundManager(game); + } + +}; + +module.exports = SoundManagerCreator; + + +/***/ }), +/* 353 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseSoundManager = __webpack_require__(123); +var Class = __webpack_require__(0); +var Events = __webpack_require__(65); +var HTML5AudioSound = __webpack_require__(354); + +/** + * HTML5 Audio implementation of the Sound Manager. + * + * @class HTML5AudioSoundManager + * @extends Phaser.Sound.BaseSoundManager + * @memberof Phaser.Sound + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - Reference to the current game instance. + */ +var HTML5AudioSoundManager = new Class({ + + Extends: BaseSoundManager, + + initialize: + + function HTML5AudioSoundManager (game) + { + /** + * Flag indicating whether if there are no idle instances of HTML5 Audio tag, + * for any particular sound, if one of the used tags should be hijacked and used + * for succeeding playback or if succeeding Phaser.Sound.HTML5AudioSound#play + * call should be ignored. + * + * @name Phaser.Sound.HTML5AudioSoundManager#override + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.override = true; + + /** + * Value representing time difference, in seconds, between calling + * play method on an audio tag and when it actually starts playing. + * It is used to achieve more accurate delayed sound playback. + * + * You might need to tweak this value to get the desired results + * since audio play delay varies depending on the browser/platform. + * + * @name Phaser.Sound.HTML5AudioSoundManager#audioPlayDelay + * @type {number} + * @default 0.1 + * @since 3.0.0 + */ + this.audioPlayDelay = 0.1; + + /** + * A value by which we should offset the loop end marker of the + * looping sound to compensate for lag, caused by changing audio + * tag playback position, in order to achieve gapless looping. + * + * You might need to tweak this value to get the desired results + * since loop lag varies depending on the browser/platform. + * + * @name Phaser.Sound.HTML5AudioSoundManager#loopEndOffset + * @type {number} + * @default 0.05 + * @since 3.0.0 + */ + this.loopEndOffset = 0.05; + + /** + * An array for keeping track of all the sounds + * that were paused when game lost focus. + * + * @name Phaser.Sound.HTML5AudioSoundManager#onBlurPausedSounds + * @type {Phaser.Sound.HTML5AudioSound[]} + * @private + * @default [] + * @since 3.0.0 + */ + this.onBlurPausedSounds = []; + + this.locked = 'ontouchstart' in window; + + /** + * A queue of all actions performed on sound objects while audio was locked. + * Once the audio gets unlocked, after an explicit user interaction, + * all actions will be performed in chronological order. + * Array of object types: { sound: Phaser.Sound.HTML5AudioSound, name: string, value?: * } + * + * @name Phaser.Sound.HTML5AudioSoundManager#lockedActionsQueue + * @type {array} + * @private + * @since 3.0.0 + */ + this.lockedActionsQueue = this.locked ? [] : null; + + /** + * Property that actually holds the value of global mute + * for HTML5 Audio sound manager implementation. + * + * @name Phaser.Sound.HTML5AudioSoundManager#_mute + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._mute = false; + + /** + * Property that actually holds the value of global volume + * for HTML5 Audio sound manager implementation. + * + * @name Phaser.Sound.HTML5AudioSoundManager#_volume + * @type {boolean} + * @private + * @default 1 + * @since 3.0.0 + */ + this._volume = 1; + + BaseSoundManager.call(this, game); + }, + + /** + * Adds a new sound into the sound manager. + * + * @method Phaser.Sound.HTML5AudioSoundManager#add + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {Phaser.Sound.HTML5AudioSound} The new sound instance. + */ + add: function (key, config) + { + var sound = new HTML5AudioSound(this, key, config); + + this.sounds.push(sound); + + return sound; + }, + + /** + * Unlocks HTML5 Audio loading and playback on mobile + * devices on the initial explicit user interaction. + * + * @method Phaser.Sound.HTML5AudioSoundManager#unlock + * @since 3.0.0 + */ + unlock: function () + { + this.locked = false; + + var _this = this; + + this.game.cache.audio.entries.each(function (key, tags) + { + for (var i = 0; i < tags.length; i++) + { + if (tags[i].dataset.locked === 'true') + { + _this.locked = true; + + return false; + } + } + + return true; + }); + + if (!this.locked) + { + return; + } + + var moved = false; + + var detectMove = function () + { + moved = true; + }; + + var unlock = function () + { + if (moved) + { + moved = false; + return; + } + + document.body.removeEventListener('touchmove', detectMove); + document.body.removeEventListener('touchend', unlock); + + var lockedTags = []; + + _this.game.cache.audio.entries.each(function (key, tags) + { + for (var i = 0; i < tags.length; i++) + { + var tag = tags[i]; + + if (tag.dataset.locked === 'true') + { + lockedTags.push(tag); + } + } + + return true; + }); + + if (lockedTags.length === 0) + { + return; + } + + var lastTag = lockedTags[lockedTags.length - 1]; + + lastTag.oncanplaythrough = function () + { + lastTag.oncanplaythrough = null; + + lockedTags.forEach(function (tag) + { + tag.dataset.locked = 'false'; + }); + + _this.unlocked = true; + }; + + lockedTags.forEach(function (tag) + { + tag.load(); + }); + }; + + this.once(Events.UNLOCKED, function () + { + this.forEachActiveSound(function (sound) + { + if (sound.currentMarker === null && sound.duration === 0) + { + sound.duration = sound.tags[0].duration; + } + + sound.totalDuration = sound.tags[0].duration; + }); + + while (this.lockedActionsQueue.length) + { + var lockedAction = this.lockedActionsQueue.shift(); + + if (lockedAction.sound[lockedAction.prop].apply) + { + lockedAction.sound[lockedAction.prop].apply(lockedAction.sound, lockedAction.value || []); + } + else + { + lockedAction.sound[lockedAction.prop] = lockedAction.value; + } + } + + }, this); + + document.body.addEventListener('touchmove', detectMove, false); + document.body.addEventListener('touchend', unlock, false); + }, + + /** + * Method used internally for pausing sound manager if + * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. + * + * @method Phaser.Sound.HTML5AudioSoundManager#onBlur + * @protected + * @since 3.0.0 + */ + onBlur: function () + { + this.forEachActiveSound(function (sound) + { + if (sound.isPlaying) + { + this.onBlurPausedSounds.push(sound); + sound.onBlur(); + } + }); + }, + + /** + * Method used internally for resuming sound manager if + * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. + * + * @method Phaser.Sound.HTML5AudioSoundManager#onFocus + * @protected + * @since 3.0.0 + */ + onFocus: function () + { + this.onBlurPausedSounds.forEach(function (sound) + { + sound.onFocus(); + }); + + this.onBlurPausedSounds.length = 0; + }, + + /** + * Calls Phaser.Sound.BaseSoundManager#destroy method + * and cleans up all HTML5 Audio related stuff. + * + * @method Phaser.Sound.HTML5AudioSoundManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + BaseSoundManager.prototype.destroy.call(this); + + this.onBlurPausedSounds.length = 0; + this.onBlurPausedSounds = null; + }, + + /** + * Method used internally by Phaser.Sound.HTML5AudioSound class methods and property setters + * to check if sound manager is locked and then either perform action immediately or queue it + * to be performed once the sound manager gets unlocked. + * + * @method Phaser.Sound.HTML5AudioSoundManager#isLocked + * @protected + * @since 3.0.0 + * + * @param {Phaser.Sound.HTML5AudioSound} sound - Sound object on which to perform queued action. + * @param {string} prop - Name of the method to be called or property to be assigned a value to. + * @param {*} [value] - An optional parameter that either holds an array of arguments to be passed to the method call or value to be set to the property. + * + * @return {boolean} Whether the sound manager is locked. + */ + isLocked: function (sound, prop, value) + { + if (sound.tags[0].dataset.locked === 'true') + { + this.lockedActionsQueue.push({ + sound: sound, + prop: prop, + value: value + }); + + return true; + } + + return false; + }, + + /** + * Sets the muted state of all this Sound Manager. + * + * @method Phaser.Sound.HTML5AudioSoundManager#setMute + * @fires Phaser.Sound.Events#GLOBAL_MUTE + * @since 3.3.0 + * + * @param {boolean} value - `true` to mute all sounds, `false` to unmute them. + * + * @return {Phaser.Sound.HTML5AudioSoundManager} This Sound Manager. + */ + setMute: function (value) + { + this.mute = value; + + return this; + }, + + /** + * @name Phaser.Sound.HTML5AudioSoundManager#mute + * @type {boolean} + * @fires Phaser.Sound.Events#GLOBAL_MUTE + * @since 3.0.0 + */ + mute: { + + get: function () + { + return this._mute; + }, + + set: function (value) + { + this._mute = value; + + this.forEachActiveSound(function (sound) + { + sound.updateMute(); + }); + + this.emit(Events.GLOBAL_MUTE, this, value); + } + + }, + + /** + * Sets the volume of this Sound Manager. + * + * @method Phaser.Sound.HTML5AudioSoundManager#setVolume + * @fires Phaser.Sound.Events#GLOBAL_VOLUME + * @since 3.3.0 + * + * @param {number} value - The global volume of this Sound Manager. + * + * @return {Phaser.Sound.HTML5AudioSoundManager} This Sound Manager. + */ + setVolume: function (value) + { + this.volume = value; + + return this; + }, + + /** + * @name Phaser.Sound.HTML5AudioSoundManager#volume + * @type {number} + * @fires Phaser.Sound.Events#GLOBAL_VOLUME + * @since 3.0.0 + */ + volume: { + + get: function () + { + return this._volume; + }, + + set: function (value) + { + this._volume = value; + + this.forEachActiveSound(function (sound) + { + sound.updateVolume(); + }); + + this.emit(Events.GLOBAL_VOLUME, this, value); + } + + } + +}); + +module.exports = HTML5AudioSoundManager; + + +/***/ }), +/* 354 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseSound = __webpack_require__(124); +var Class = __webpack_require__(0); +var Events = __webpack_require__(65); + +/** + * @classdesc + * HTML5 Audio implementation of the sound. + * + * @class HTML5AudioSound + * @extends Phaser.Sound.BaseSound + * @memberof Phaser.Sound + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Sound.HTML5AudioSoundManager} manager - Reference to the current sound manager instance. + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config={}] - An optional config object containing default sound settings. + */ +var HTML5AudioSound = new Class({ + + Extends: BaseSound, + + initialize: + + function HTML5AudioSound (manager, key, config) + { + if (config === undefined) { config = {}; } + + /** + * An array containing all HTML5 Audio tags that could be used for individual + * sound's playback. Number of instances depends on the config value passed + * to the Loader#audio method call, default is 1. + * + * @name Phaser.Sound.HTML5AudioSound#tags + * @type {HTMLAudioElement[]} + * @private + * @since 3.0.0 + */ + this.tags = manager.game.cache.audio.get(key); + + if (!this.tags) + { + // eslint-disable-next-line no-console + console.warn('Audio cache entry missing: ' + key); + return; + } + + /** + * Reference to an HTML5 Audio tag used for playing sound. + * + * @name Phaser.Sound.HTML5AudioSound#audio + * @type {HTMLAudioElement} + * @private + * @default null + * @since 3.0.0 + */ + this.audio = null; + + /** + * Timestamp as generated by the Request Animation Frame or SetTimeout + * representing the time at which the delayed sound playback should start. + * Set to 0 if sound playback is not delayed. + * + * @name Phaser.Sound.HTML5AudioSound#startTime + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this.startTime = 0; + + /** + * Audio tag's playback position recorded on previous + * update method call. Set to 0 if sound is not playing. + * + * @name Phaser.Sound.HTML5AudioSound#previousTime + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this.previousTime = 0; + + this.duration = this.tags[0].duration; + + this.totalDuration = this.tags[0].duration; + + BaseSound.call(this, manager, key, config); + }, + + /** + * Play this sound, or a marked section of it. + * It always plays the sound from the start. If you want to start playback from a specific time + * you can set 'seek' setting of the config object, provided to this call, to that value. + * + * @method Phaser.Sound.HTML5AudioSound#play + * @fires Phaser.Sound.Events#PLAY + * @since 3.0.0 + * + * @param {string} [markerName=''] - If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound. + * + * @return {boolean} Whether the sound started playing successfully. + */ + play: function (markerName, config) + { + if (this.manager.isLocked(this, 'play', [ markerName, config ])) + { + return false; + } + + if (!BaseSound.prototype.play.call(this, markerName, config)) + { + return false; + } + + // \/\/\/ isPlaying = true, isPaused = false \/\/\/ + if (!this.pickAndPlayAudioTag()) + { + return false; + } + + this.emit(Events.PLAY, this); + + return true; + }, + + /** + * Pauses the sound. + * + * @method Phaser.Sound.HTML5AudioSound#pause + * @fires Phaser.Sound.Events#PAUSE + * @since 3.0.0 + * + * @return {boolean} Whether the sound was paused successfully. + */ + pause: function () + { + if (this.manager.isLocked(this, 'pause')) + { + return false; + } + + if (this.startTime > 0) + { + return false; + } + + if (!BaseSound.prototype.pause.call(this)) + { + return false; + } + + // \/\/\/ isPlaying = false, isPaused = true \/\/\/ + this.currentConfig.seek = this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0); + + this.stopAndReleaseAudioTag(); + + this.emit(Events.PAUSE, this); + + return true; + }, + + /** + * Resumes the sound. + * + * @method Phaser.Sound.HTML5AudioSound#resume + * @fires Phaser.Sound.Events#RESUME + * @since 3.0.0 + * + * @return {boolean} Whether the sound was resumed successfully. + */ + resume: function () + { + if (this.manager.isLocked(this, 'resume')) + { + return false; + } + + if (this.startTime > 0) + { + return false; + } + + if (!BaseSound.prototype.resume.call(this)) + { + return false; + } + + // \/\/\/ isPlaying = true, isPaused = false \/\/\/ + if (!this.pickAndPlayAudioTag()) + { + return false; + } + + this.emit(Events.RESUME, this); + + return true; + }, + + /** + * Stop playing this sound. + * + * @method Phaser.Sound.HTML5AudioSound#stop + * @fires Phaser.Sound.Events#STOP + * @since 3.0.0 + * + * @return {boolean} Whether the sound was stopped successfully. + */ + stop: function () + { + if (this.manager.isLocked(this, 'stop')) + { + return false; + } + + if (!BaseSound.prototype.stop.call(this)) + { + return false; + } + + // \/\/\/ isPlaying = false, isPaused = false \/\/\/ + this.stopAndReleaseAudioTag(); + + this.emit(Events.STOP, this); + + return true; + }, + + /** + * Used internally to do what the name says. + * + * @method Phaser.Sound.HTML5AudioSound#pickAndPlayAudioTag + * @private + * @since 3.0.0 + * + * @return {boolean} Whether the sound was assigned an audio tag successfully. + */ + pickAndPlayAudioTag: function () + { + if (!this.pickAudioTag()) + { + this.reset(); + return false; + } + + var seek = this.currentConfig.seek; + var delay = this.currentConfig.delay; + var offset = (this.currentMarker ? this.currentMarker.start : 0) + seek; + + this.previousTime = offset; + this.audio.currentTime = offset; + this.applyConfig(); + + if (delay === 0) + { + this.startTime = 0; + + if (this.audio.paused) + { + this.playCatchPromise(); + } + } + else + { + this.startTime = window.performance.now() + delay * 1000; + + if (!this.audio.paused) + { + this.audio.pause(); + } + } + + this.resetConfig(); + + return true; + }, + + /** + * This method performs the audio tag pooling logic. It first looks for + * unused audio tag to assign to this sound object. If there are no unused + * audio tags, based on HTML5AudioSoundManager#override property value, it + * looks for sound with most advanced playback and hijacks its audio tag or + * does nothing. + * + * @method Phaser.Sound.HTML5AudioSound#pickAudioTag + * @private + * @since 3.0.0 + * + * @return {boolean} Whether the sound was assigned an audio tag successfully. + */ + pickAudioTag: function () + { + if (this.audio) + { + return true; + } + + for (var i = 0; i < this.tags.length; i++) + { + var audio = this.tags[i]; + + if (audio.dataset.used === 'false') + { + audio.dataset.used = 'true'; + this.audio = audio; + return true; + } + } + + if (!this.manager.override) + { + return false; + } + + var otherSounds = []; + + this.manager.forEachActiveSound(function (sound) + { + if (sound.key === this.key && sound.audio) + { + otherSounds.push(sound); + } + }, this); + + otherSounds.sort(function (a1, a2) + { + if (a1.loop === a2.loop) + { + // sort by progress + return (a2.seek / a2.duration) - (a1.seek / a1.duration); + } + return a1.loop ? 1 : -1; + }); + + var selectedSound = otherSounds[0]; + + this.audio = selectedSound.audio; + + selectedSound.reset(); + selectedSound.audio = null; + selectedSound.startTime = 0; + selectedSound.previousTime = 0; + + return true; + }, + + /** + * Method used for playing audio tag and catching possible exceptions + * thrown from rejected Promise returned from play method call. + * + * @method Phaser.Sound.HTML5AudioSound#playCatchPromise + * @private + * @since 3.0.0 + */ + playCatchPromise: function () + { + var playPromise = this.audio.play(); + + if (playPromise) + { + // eslint-disable-next-line no-unused-vars + playPromise.catch(function (reason) + { + console.warn(reason); + }); + } + }, + + /** + * Used internally to do what the name says. + * + * @method Phaser.Sound.HTML5AudioSound#stopAndReleaseAudioTag + * @private + * @since 3.0.0 + */ + stopAndReleaseAudioTag: function () + { + this.audio.pause(); + this.audio.dataset.used = 'false'; + this.audio = null; + this.startTime = 0; + this.previousTime = 0; + }, + + /** + * Method used internally to reset sound state, usually when stopping sound + * or when hijacking audio tag from another sound. + * + * @method Phaser.Sound.HTML5AudioSound#reset + * @private + * @since 3.0.0 + */ + reset: function () + { + BaseSound.prototype.stop.call(this); + }, + + /** + * Method used internally by sound manager for pausing sound if + * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. + * + * @method Phaser.Sound.HTML5AudioSoundManager#onBlur + * @private + * @since 3.0.0 + */ + onBlur: function () + { + this.isPlaying = false; + this.isPaused = true; + + this.currentConfig.seek = this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0); + + this.currentConfig.delay = Math.max(0, (this.startTime - window.performance.now()) / 1000); + + this.stopAndReleaseAudioTag(); + }, + + /** + * Method used internally by sound manager for resuming sound if + * Phaser.Sound.HTML5AudioSoundManager#pauseOnBlur is set to true. + * + * @method Phaser.Sound.HTML5AudioSound#onFocus + * @private + * @since 3.0.0 + */ + onFocus: function () + { + this.isPlaying = true; + this.isPaused = false; + this.pickAndPlayAudioTag(); + }, + + /** + * Update method called automatically by sound manager on every game step. + * + * @method Phaser.Sound.HTML5AudioSound#update + * @fires Phaser.Sound.Events#COMPLETE + * @fires Phaser.Sound.Events#LOOPED + * @protected + * @since 3.0.0 + * + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time elapsed since the last frame. + */ + // eslint-disable-next-line no-unused-vars + update: function (time, delta) + { + if (!this.isPlaying) + { + return; + } + + // handling delayed playback + if (this.startTime > 0) + { + if (this.startTime < time - this.manager.audioPlayDelay) + { + this.audio.currentTime += Math.max(0, time - this.startTime) / 1000; + this.startTime = 0; + this.previousTime = this.audio.currentTime; + this.playCatchPromise(); + } + + return; + } + + // handle looping and ending + var startTime = this.currentMarker ? this.currentMarker.start : 0; + var endTime = startTime + this.duration; + var currentTime = this.audio.currentTime; + + if (this.currentConfig.loop) + { + if (currentTime >= endTime - this.manager.loopEndOffset) + { + this.audio.currentTime = startTime + Math.max(0, currentTime - endTime); + currentTime = this.audio.currentTime; + } + else if (currentTime < startTime) + { + this.audio.currentTime += startTime; + currentTime = this.audio.currentTime; + } + + if (currentTime < this.previousTime) + { + this.emit(Events.LOOPED, this); + } + } + else if (currentTime >= endTime) + { + this.reset(); + + this.stopAndReleaseAudioTag(); + + this.emit(Events.COMPLETE, this); + + return; + } + + this.previousTime = currentTime; + }, + + /** + * Calls Phaser.Sound.BaseSound#destroy method + * and cleans up all HTML5 Audio related stuff. + * + * @method Phaser.Sound.HTML5AudioSound#destroy + * @since 3.0.0 + */ + destroy: function () + { + BaseSound.prototype.destroy.call(this); + + this.tags = null; + + if (this.audio) + { + this.stopAndReleaseAudioTag(); + } + }, + + /** + * Method used internally to determine mute setting of the sound. + * + * @method Phaser.Sound.HTML5AudioSound#updateMute + * @private + * @since 3.0.0 + */ + updateMute: function () + { + if (this.audio) + { + this.audio.muted = this.currentConfig.mute || this.manager.mute; + } + }, + + /** + * Method used internally to calculate total volume of the sound. + * + * @method Phaser.Sound.HTML5AudioSound#updateVolume + * @private + * @since 3.0.0 + */ + updateVolume: function () + { + if (this.audio) + { + this.audio.volume = this.currentConfig.volume * this.manager.volume; + } + }, + + /** + * Method used internally to calculate total playback rate of the sound. + * + * @method Phaser.Sound.HTML5AudioSound#calculateRate + * @protected + * @since 3.0.0 + */ + calculateRate: function () + { + BaseSound.prototype.calculateRate.call(this); + + if (this.audio) + { + this.audio.playbackRate = this.totalRate; + } + }, + + /** + * Boolean indicating whether the sound is muted or not. + * Gets or sets the muted state of this sound. + * + * @name Phaser.Sound.HTML5AudioSound#mute + * @type {boolean} + * @default false + * @fires Phaser.Sound.Events#MUTE + * @since 3.0.0 + */ + mute: { + + get: function () + { + return this.currentConfig.mute; + }, + + set: function (value) + { + this.currentConfig.mute = value; + + if (this.manager.isLocked(this, 'mute', value)) + { + return; + } + + this.updateMute(); + + this.emit(Events.MUTE, this, value); + } + }, + + /** + * Sets the muted state of this Sound. + * + * @method Phaser.Sound.HTML5AudioSound#setMute + * @fires Phaser.Sound.Events#MUTE + * @since 3.4.0 + * + * @param {boolean} value - `true` to mute this sound, `false` to unmute it. + * + * @return {Phaser.Sound.HTML5AudioSound} This Sound instance. + */ + setMute: function (value) + { + this.mute = value; + + return this; + }, + + /** + * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume). + * + * @name Phaser.Sound.HTML5AudioSound#volume + * @type {number} + * @default 1 + * @fires Phaser.Sound.Events#VOLUME + * @since 3.0.0 + */ + volume: { + + get: function () + { + return this.currentConfig.volume; + }, + + set: function (value) + { + this.currentConfig.volume = value; + + if (this.manager.isLocked(this, 'volume', value)) + { + return; + } + + this.updateVolume(); + + this.emit(Events.VOLUME, this, value); + } + }, + + /** + * Sets the volume of this Sound. + * + * @method Phaser.Sound.HTML5AudioSound#setVolume + * @fires Phaser.Sound.Events#VOLUME + * @since 3.4.0 + * + * @param {number} value - The volume of the sound. + * + * @return {Phaser.Sound.HTML5AudioSound} This Sound instance. + */ + setVolume: function (value) + { + this.volume = value; + + return this; + }, + + /** + * Rate at which this Sound will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @name Phaser.Sound.HTML5AudioSound#rate + * @type {number} + * @default 1 + * @fires Phaser.Sound.Events#RATE + * @since 3.0.0 + */ + rate: { + + get: function () + { + return this.currentConfig.rate; + }, + + set: function (value) + { + this.currentConfig.rate = value; + + if (this.manager.isLocked(this, Events.RATE, value)) + { + return; + } + else + { + this.calculateRate(); + + this.emit(Events.RATE, this, value); + } + } + + }, + + /** + * Sets the playback rate of this Sound. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @method Phaser.Sound.HTML5AudioSound#setRate + * @fires Phaser.Sound.Events#RATE + * @since 3.3.0 + * + * @param {number} value - The playback rate at of this Sound. + * + * @return {Phaser.Sound.HTML5AudioSound} This Sound. + */ + setRate: function (value) + { + this.rate = value; + + return this; + }, + + /** + * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @name Phaser.Sound.HTML5AudioSound#detune + * @type {number} + * @default 0 + * @fires Phaser.Sound.Events#DETUNE + * @since 3.0.0 + */ + detune: { + + get: function () + { + return this.currentConfig.detune; + }, + + set: function (value) + { + this.currentConfig.detune = value; + + if (this.manager.isLocked(this, Events.DETUNE, value)) + { + return; + } + else + { + this.calculateRate(); + + this.emit(Events.DETUNE, this, value); + } + } + + }, + + /** + * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @method Phaser.Sound.HTML5AudioSound#setDetune + * @fires Phaser.Sound.Events#DETUNE + * @since 3.3.0 + * + * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @return {Phaser.Sound.HTML5AudioSound} This Sound. + */ + setDetune: function (value) + { + this.detune = value; + + return this; + }, + + /** + * Property representing the position of playback for this sound, in seconds. + * Setting it to a specific value moves current playback to that position. + * The value given is clamped to the range 0 to current marker duration. + * Setting seek of a stopped sound has no effect. + * + * @name Phaser.Sound.HTML5AudioSound#seek + * @type {number} + * @fires Phaser.Sound.Events#SEEK + * @since 3.0.0 + */ + seek: { + + get: function () + { + if (this.isPlaying) + { + return this.audio.currentTime - (this.currentMarker ? this.currentMarker.start : 0); + } + else if (this.isPaused) + { + return this.currentConfig.seek; + } + else + { + return 0; + } + }, + + set: function (value) + { + if (this.manager.isLocked(this, 'seek', value)) + { + return; + } + + if (this.startTime > 0) + { + return; + } + + if (this.isPlaying || this.isPaused) + { + value = Math.min(Math.max(0, value), this.duration); + + if (this.isPlaying) + { + this.previousTime = value; + this.audio.currentTime = value; + } + else if (this.isPaused) + { + this.currentConfig.seek = value; + } + + this.emit(Events.SEEK, this, value); + } + } + }, + + /** + * Seeks to a specific point in this sound. + * + * @method Phaser.Sound.HTML5AudioSound#setSeek + * @fires Phaser.Sound.Events#SEEK + * @since 3.4.0 + * + * @param {number} value - The point in the sound to seek to. + * + * @return {Phaser.Sound.HTML5AudioSound} This Sound instance. + */ + setSeek: function (value) + { + this.seek = value; + + return this; + }, + + /** + * Flag indicating whether or not the sound or current sound marker will loop. + * + * @name Phaser.Sound.HTML5AudioSound#loop + * @type {boolean} + * @default false + * @fires Phaser.Sound.Events#LOOP + * @since 3.0.0 + */ + loop: { + + get: function () + { + return this.currentConfig.loop; + }, + + set: function (value) + { + this.currentConfig.loop = value; + + if (this.manager.isLocked(this, 'loop', value)) + { + return; + } + + if (this.audio) + { + this.audio.loop = value; + } + + this.emit(Events.LOOP, this, value); + } + + }, + + /** + * Sets the loop state of this Sound. + * + * @method Phaser.Sound.HTML5AudioSound#setLoop + * @fires Phaser.Sound.Events#LOOP + * @since 3.4.0 + * + * @param {boolean} value - `true` to loop this sound, `false` to not loop it. + * + * @return {Phaser.Sound.HTML5AudioSound} This Sound instance. + */ + setLoop: function (value) + { + this.loop = value; + + return this; + } + +}); + +module.exports = HTML5AudioSound; + + +/***/ }), +/* 355 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseSoundManager = __webpack_require__(123); +var Class = __webpack_require__(0); +var EventEmitter = __webpack_require__(11); +var NoAudioSound = __webpack_require__(356); +var NOOP = __webpack_require__(1); + +/** + * @classdesc + * No audio implementation of the sound manager. It is used if audio has been + * disabled in the game config or the device doesn't support any audio. + * + * It represents a graceful degradation of sound manager logic that provides + * minimal functionality and prevents Phaser projects that use audio from + * breaking on devices that don't support any audio playback technologies. + * + * @class NoAudioSoundManager + * @extends Phaser.Sound.BaseSoundManager + * @memberof Phaser.Sound + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - Reference to the current game instance. + */ +var NoAudioSoundManager = new Class({ + + Extends: EventEmitter, + + initialize: + + function NoAudioSoundManager (game) + { + EventEmitter.call(this); + + this.game = game; + this.sounds = []; + this.mute = false; + this.volume = 1; + this.rate = 1; + this.detune = 0; + this.pauseOnBlur = true; + this.locked = false; + }, + + add: function (key, config) + { + var sound = new NoAudioSound(this, key, config); + + this.sounds.push(sound); + + return sound; + }, + + addAudioSprite: function (key, config) + { + var sound = this.add(key, config); + + sound.spritemap = {}; + + return sound; + }, + + // eslint-disable-next-line no-unused-vars + play: function (key, extra) + { + return false; + }, + + // eslint-disable-next-line no-unused-vars + playAudioSprite: function (key, spriteName, config) + { + return false; + }, + + remove: function (sound) + { + return BaseSoundManager.prototype.remove.call(this, sound); + }, + + removeByKey: function (key) + { + return BaseSoundManager.prototype.removeByKey.call(this, key); + }, + + pauseAll: NOOP, + resumeAll: NOOP, + stopAll: NOOP, + update: NOOP, + setRate: NOOP, + setDetune: NOOP, + setMute: NOOP, + setVolume: NOOP, + + forEachActiveSound: function (callbackfn, scope) + { + BaseSoundManager.prototype.forEachActiveSound.call(this, callbackfn, scope); + }, + + destroy: function () + { + BaseSoundManager.prototype.destroy.call(this); + } + +}); + +module.exports = NoAudioSoundManager; + + +/***/ }), +/* 356 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseSound = __webpack_require__(124); +var Class = __webpack_require__(0); +var EventEmitter = __webpack_require__(11); +var Extend = __webpack_require__(17); + +/** + * @classdesc + * No audio implementation of the sound. It is used if audio has been + * disabled in the game config or the device doesn't support any audio. + * + * It represents a graceful degradation of sound logic that provides + * minimal functionality and prevents Phaser projects that use audio from + * breaking on devices that don't support any audio playback technologies. + * + * @class NoAudioSound + * @extends Phaser.Sound.BaseSound + * @memberof Phaser.Sound + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Sound.NoAudioSoundManager} manager - Reference to the current sound manager instance. + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config={}] - An optional config object containing default sound settings. + */ +var NoAudioSound = new Class({ + + Extends: EventEmitter, + + initialize: + + function NoAudioSound (manager, key, config) + { + if (config === void 0) { config = {}; } + + EventEmitter.call(this); + + this.manager = manager; + this.key = key; + this.isPlaying = false; + this.isPaused = false; + this.totalRate = 1; + this.duration = 0; + this.totalDuration = 0; + + this.config = Extend({ + mute: false, + volume: 1, + rate: 1, + detune: 0, + seek: 0, + loop: false, + delay: 0 + }, config); + + this.currentConfig = this.config; + this.mute = false; + this.volume = 1; + this.rate = 1; + this.detune = 0; + this.seek = 0; + this.loop = false; + this.markers = {}; + this.currentMarker = null; + this.pendingRemove = false; + }, + + // eslint-disable-next-line no-unused-vars + addMarker: function (marker) + { + return false; + }, + + // eslint-disable-next-line no-unused-vars + updateMarker: function (marker) + { + return false; + }, + + // eslint-disable-next-line no-unused-vars + removeMarker: function (markerName) + { + return null; + }, + + // eslint-disable-next-line no-unused-vars + play: function (markerName, config) + { + return false; + }, + + pause: function () + { + return false; + }, + + resume: function () + { + return false; + }, + + stop: function () + { + return false; + }, + + destroy: function () + { + this.manager.remove(this); + + BaseSound.prototype.destroy.call(this); + } +}); + +module.exports = NoAudioSound; + + +/***/ }), +/* 357 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Base64ToArrayBuffer = __webpack_require__(358); +var BaseSoundManager = __webpack_require__(123); +var Class = __webpack_require__(0); +var Events = __webpack_require__(65); +var WebAudioSound = __webpack_require__(359); + +/** + * @classdesc + * Web Audio API implementation of the sound manager. + * + * @class WebAudioSoundManager + * @extends Phaser.Sound.BaseSoundManager + * @memberof Phaser.Sound + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - Reference to the current game instance. + */ +var WebAudioSoundManager = new Class({ + + Extends: BaseSoundManager, + + initialize: + + function WebAudioSoundManager (game) + { + /** + * The AudioContext being used for playback. + * + * @name Phaser.Sound.WebAudioSoundManager#context + * @type {AudioContext} + * @private + * @since 3.0.0 + */ + this.context = this.createAudioContext(game); + + /** + * Gain node responsible for controlling global muting. + * + * @name Phaser.Sound.WebAudioSoundManager#masterMuteNode + * @type {GainNode} + * @private + * @since 3.0.0 + */ + this.masterMuteNode = this.context.createGain(); + + /** + * Gain node responsible for controlling global volume. + * + * @name Phaser.Sound.WebAudioSoundManager#masterVolumeNode + * @type {GainNode} + * @private + * @since 3.0.0 + */ + this.masterVolumeNode = this.context.createGain(); + + this.masterMuteNode.connect(this.masterVolumeNode); + + this.masterVolumeNode.connect(this.context.destination); + + /** + * Destination node for connecting individual sounds to. + * + * @name Phaser.Sound.WebAudioSoundManager#destination + * @type {AudioNode} + * @private + * @since 3.0.0 + */ + this.destination = this.masterMuteNode; + + this.locked = this.context.state === 'suspended' && ('ontouchstart' in window || 'onclick' in window); + + BaseSoundManager.call(this, game); + + if (this.locked) + { + this.unlock(); + } + }, + + /** + * Method responsible for instantiating and returning AudioContext instance. + * If an instance of an AudioContext class was provided through the game config, + * that instance will be returned instead. This can come in handy if you are reloading + * a Phaser game on a page that never properly refreshes (such as in an SPA project) + * and you want to reuse already instantiated AudioContext. + * + * @method Phaser.Sound.WebAudioSoundManager#createAudioContext + * @private + * @since 3.0.0 + * + * @param {Phaser.Game} game - Reference to the current game instance. + * + * @return {AudioContext} The AudioContext instance to be used for playback. + */ + createAudioContext: function (game) + { + var audioConfig = game.config.audio; + + if (audioConfig && audioConfig.context) + { + audioConfig.context.resume(); + + return audioConfig.context; + } + + return new AudioContext(); + }, + + /** + * Adds a new sound into the sound manager. + * + * @method Phaser.Sound.WebAudioSoundManager#add + * @since 3.0.0 + * + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - An optional config object containing default sound settings. + * + * @return {Phaser.Sound.WebAudioSound} The new sound instance. + */ + add: function (key, config) + { + var sound = new WebAudioSound(this, key, config); + + this.sounds.push(sound); + + return sound; + }, + + /** + * Decode audio data into a format ready for playback via Web Audio. + * + * The audio data can be a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. + * + * The `audioKey` is the key that will be used to save the decoded audio to the audio cache. + * + * Instead of passing a single entry you can instead pass an array of `Phaser.Types.Sound.DecodeAudioConfig` + * objects as the first and only argument. + * + * Decoding is an async process, so be sure to listen for the events to know when decoding has completed. + * + * Once the audio has decoded it can be added to the Sound Manager or played via its key. + * + * @method Phaser.Sound.WebAudioSoundManager#decodeAudio + * @fires Phaser.Sound.Events#DECODED + * @fires Phaser.Sound.Events#DECODED_ALL + * @since 3.18.0 + * + * @param {(Phaser.Types.Sound.DecodeAudioConfig[]|string)} [audioKey] - The string-based key to be used to reference the decoded audio in the audio cache, or an array of audio config objects. + * @param {(ArrayBuffer|string)} [audioData] - The audio data, either a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. + */ + decodeAudio: function (audioKey, audioData) + { + var audioFiles; + + if (!Array.isArray(audioKey)) + { + audioFiles = [ { key: audioKey, data: audioData } ]; + } + else + { + audioFiles = audioKey; + } + + var cache = this.game.cache.audio; + var remaining = audioFiles.length; + + for (var i = 0; i < audioFiles.length; i++) + { + var entry = audioFiles[i]; + + var key = entry.key; + var data = entry.data; + + if (typeof data === 'string') + { + data = Base64ToArrayBuffer(data); + } + + var success = function (key, audioBuffer) + { + cache.add(key, audioBuffer); + + this.emit(Events.DECODED, key); + + remaining--; + + if (remaining === 0) + { + this.emit(Events.DECODED_ALL); + } + }.bind(this, key); + + var failure = function (key, error) + { + // eslint-disable-next-line no-console + console.error('Error decoding audio: ' + key + ' - ', error ? error.message : ''); + + remaining--; + + if (remaining === 0) + { + this.emit(Events.DECODED_ALL); + } + }.bind(this, key); + + this.context.decodeAudioData(data, success, failure); + } + }, + + /** + * Unlocks Web Audio API on the initial input event. + * + * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09). + * + * @method Phaser.Sound.WebAudioSoundManager#unlock + * @since 3.0.0 + */ + unlock: function () + { + var _this = this; + + var unlockHandler = function unlockHandler () + { + if (_this.context) + { + _this.context.resume().then(function () + { + document.body.removeEventListener('touchstart', unlockHandler); + document.body.removeEventListener('touchend', unlockHandler); + document.body.removeEventListener('click', unlockHandler); + + _this.unlocked = true; + }); + } + }; + + if (document.body) + { + document.body.addEventListener('touchstart', unlockHandler, false); + document.body.addEventListener('touchend', unlockHandler, false); + document.body.addEventListener('click', unlockHandler, false); + } + }, + + /** + * Method used internally for pausing sound manager if + * Phaser.Sound.WebAudioSoundManager#pauseOnBlur is set to true. + * + * @method Phaser.Sound.WebAudioSoundManager#onBlur + * @protected + * @since 3.0.0 + */ + onBlur: function () + { + if (!this.locked) + { + this.context.suspend(); + } + }, + + /** + * Method used internally for resuming sound manager if + * Phaser.Sound.WebAudioSoundManager#pauseOnBlur is set to true. + * + * @method Phaser.Sound.WebAudioSoundManager#onFocus + * @protected + * @since 3.0.0 + */ + onFocus: function () + { + if (!this.locked) + { + this.context.resume(); + } + }, + + /** + * Calls Phaser.Sound.BaseSoundManager#destroy method + * and cleans up all Web Audio API related stuff. + * + * @method Phaser.Sound.WebAudioSoundManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.destination = null; + this.masterVolumeNode.disconnect(); + this.masterVolumeNode = null; + this.masterMuteNode.disconnect(); + this.masterMuteNode = null; + + if (this.game.config.audio && this.game.config.audio.context) + { + this.context.suspend(); + } + else + { + var _this = this; + + this.context.close().then(function () + { + + _this.context = null; + + }); + } + + BaseSoundManager.prototype.destroy.call(this); + }, + + /** + * Sets the muted state of all this Sound Manager. + * + * @method Phaser.Sound.WebAudioSoundManager#setMute + * @fires Phaser.Sound.Events#GLOBAL_MUTE + * @since 3.3.0 + * + * @param {boolean} value - `true` to mute all sounds, `false` to unmute them. + * + * @return {Phaser.Sound.WebAudioSoundManager} This Sound Manager. + */ + setMute: function (value) + { + this.mute = value; + + return this; + }, + + /** + * @name Phaser.Sound.WebAudioSoundManager#mute + * @type {boolean} + * @fires Phaser.Sound.Events#GLOBAL_MUTE + * @since 3.0.0 + */ + mute: { + + get: function () + { + return (this.masterMuteNode.gain.value === 0); + }, + + set: function (value) + { + this.masterMuteNode.gain.setValueAtTime(value ? 0 : 1, 0); + + this.emit(Events.GLOBAL_MUTE, this, value); + } + + }, + + /** + * Sets the volume of this Sound Manager. + * + * @method Phaser.Sound.WebAudioSoundManager#setVolume + * @fires Phaser.Sound.Events#GLOBAL_VOLUME + * @since 3.3.0 + * + * @param {number} value - The global volume of this Sound Manager. + * + * @return {Phaser.Sound.WebAudioSoundManager} This Sound Manager. + */ + setVolume: function (value) + { + this.volume = value; + + return this; + }, + + /** + * @name Phaser.Sound.WebAudioSoundManager#volume + * @type {number} + * @fires Phaser.Sound.Events#GLOBAL_VOLUME + * @since 3.0.0 + */ + volume: { + + get: function () + { + return this.masterVolumeNode.gain.value; + }, + + set: function (value) + { + this.masterVolumeNode.gain.setValueAtTime(value, 0); + + this.emit(Events.GLOBAL_VOLUME, this, value); + } + + } + +}); + +module.exports = WebAudioSoundManager; + + +/***/ }), +/* 358 */ +/***/ (function(module, exports) { + +/** + * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +// Use a lookup table to find the index. +var lookup = new Uint8Array(256); + +for (var i = 0; i < chars.length; i++) +{ + lookup[chars.charCodeAt(i)] = i; +} + +/** + * Converts a base64 string, either with or without a data uri, into an Array Buffer. + * + * @function Phaser.Utils.Base64.Base64ToArrayBuffer + * @since 3.18.0 + * + * @param {string} base64 - The base64 string to be decoded. Can optionally contain a data URI header, which will be stripped out prior to decoding. + * + * @return {ArrayBuffer} An ArrayBuffer decoded from the base64 data. + */ +var Base64ToArrayBuffer = function (base64) +{ + // Is it a data uri? if so, strip the header away + base64 = base64.substr(base64.indexOf(',') + 1); + + var len = base64.length; + var bufferLength = len * 0.75; + var p = 0; + var encoded1; + var encoded2; + var encoded3; + var encoded4; + + if (base64[len - 1] === '=') + { + bufferLength--; + + if (base64[len - 2] === '=') + { + bufferLength--; + } + } + + var arrayBuffer = new ArrayBuffer(bufferLength); + var bytes = new Uint8Array(arrayBuffer); + + for (var i = 0; i < len; i += 4) + { + encoded1 = lookup[base64.charCodeAt(i)]; + encoded2 = lookup[base64.charCodeAt(i + 1)]; + encoded3 = lookup[base64.charCodeAt(i + 2)]; + encoded4 = lookup[base64.charCodeAt(i + 3)]; + + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); + } + + return arrayBuffer; +}; + +module.exports = Base64ToArrayBuffer; + + +/***/ }), +/* 359 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseSound = __webpack_require__(124); +var Class = __webpack_require__(0); +var Events = __webpack_require__(65); + +/** + * @classdesc + * Web Audio API implementation of the sound. + * + * @class WebAudioSound + * @extends Phaser.Sound.BaseSound + * @memberof Phaser.Sound + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Sound.WebAudioSoundManager} manager - Reference to the current sound manager instance. + * @param {string} key - Asset key for the sound. + * @param {Phaser.Types.Sound.SoundConfig} [config={}] - An optional config object containing default sound settings. + */ +var WebAudioSound = new Class({ + + Extends: BaseSound, + + initialize: + + function WebAudioSound (manager, key, config) + { + if (config === undefined) { config = {}; } + + /** + * Audio buffer containing decoded data of the audio asset to be played. + * + * @name Phaser.Sound.WebAudioSound#audioBuffer + * @type {AudioBuffer} + * @private + * @since 3.0.0 + */ + this.audioBuffer = manager.game.cache.audio.get(key); + + if (!this.audioBuffer) + { + // eslint-disable-next-line no-console + console.warn('Audio cache entry missing: ' + key); + return; + } + + /** + * A reference to an audio source node used for playing back audio from + * audio data stored in Phaser.Sound.WebAudioSound#audioBuffer. + * + * @name Phaser.Sound.WebAudioSound#source + * @type {AudioBufferSourceNode} + * @private + * @default null + * @since 3.0.0 + */ + this.source = null; + + /** + * A reference to a second audio source used for gapless looped playback. + * + * @name Phaser.Sound.WebAudioSound#loopSource + * @type {AudioBufferSourceNode} + * @private + * @default null + * @since 3.0.0 + */ + this.loopSource = null; + + /** + * Gain node responsible for controlling this sound's muting. + * + * @name Phaser.Sound.WebAudioSound#muteNode + * @type {GainNode} + * @private + * @since 3.0.0 + */ + this.muteNode = manager.context.createGain(); + + /** + * Gain node responsible for controlling this sound's volume. + * + * @name Phaser.Sound.WebAudioSound#volumeNode + * @type {GainNode} + * @private + * @since 3.0.0 + */ + this.volumeNode = manager.context.createGain(); + + /** + * The time at which the sound should have started playback from the beginning. + * Based on BaseAudioContext.currentTime value. + * + * @name Phaser.Sound.WebAudioSound#playTime + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this.playTime = 0; + + /** + * The time at which the sound source should have actually started playback. + * Based on BaseAudioContext.currentTime value. + * + * @name Phaser.Sound.WebAudioSound#startTime + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this.startTime = 0; + + /** + * The time at which the sound loop source should actually start playback. + * Based on BaseAudioContext.currentTime value. + * + * @name Phaser.Sound.WebAudioSound#loopTime + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this.loopTime = 0; + + /** + * An array where we keep track of all rate updates during playback. + * Array of object types: { time: number, rate: number } + * + * @name Phaser.Sound.WebAudioSound#rateUpdates + * @type {array} + * @private + * @default [] + * @since 3.0.0 + */ + this.rateUpdates = []; + + /** + * Used for keeping track when sound source playback has ended + * so its state can be updated accordingly. + * + * @name Phaser.Sound.WebAudioSound#hasEnded + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this.hasEnded = false; + + /** + * Used for keeping track when sound source has looped + * so its state can be updated accordingly. + * + * @name Phaser.Sound.WebAudioSound#hasLooped + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this.hasLooped = false; + + this.muteNode.connect(this.volumeNode); + + this.volumeNode.connect(manager.destination); + + this.duration = this.audioBuffer.duration; + + this.totalDuration = this.audioBuffer.duration; + + BaseSound.call(this, manager, key, config); + }, + + /** + * Play this sound, or a marked section of it. + * + * It always plays the sound from the start. If you want to start playback from a specific time + * you can set 'seek' setting of the config object, provided to this call, to that value. + * + * @method Phaser.Sound.WebAudioSound#play + * @fires Phaser.Sound.Events#PLAY + * @since 3.0.0 + * + * @param {string} [markerName=''] - If you want to play a marker then provide the marker name here, otherwise omit it to play the full sound. + * @param {Phaser.Types.Sound.SoundConfig} [config] - Optional sound config object to be applied to this marker or entire sound if no marker name is provided. It gets memorized for future plays of current section of the sound. + * + * @return {boolean} Whether the sound started playing successfully. + */ + play: function (markerName, config) + { + if (!BaseSound.prototype.play.call(this, markerName, config)) + { + return false; + } + + // \/\/\/ isPlaying = true, isPaused = false \/\/\/ + this.stopAndRemoveBufferSource(); + this.createAndStartBufferSource(); + + this.emit(Events.PLAY, this); + + return true; + }, + + /** + * Pauses the sound. + * + * @method Phaser.Sound.WebAudioSound#pause + * @fires Phaser.Sound.Events#PAUSE + * @since 3.0.0 + * + * @return {boolean} Whether the sound was paused successfully. + */ + pause: function () + { + if (this.manager.context.currentTime < this.startTime) + { + return false; + } + + if (!BaseSound.prototype.pause.call(this)) + { + return false; + } + + // \/\/\/ isPlaying = false, isPaused = true \/\/\/ + this.currentConfig.seek = this.getCurrentTime(); // Equivalent to setting paused time + this.stopAndRemoveBufferSource(); + + this.emit(Events.PAUSE, this); + + return true; + }, + + /** + * Resumes the sound. + * + * @method Phaser.Sound.WebAudioSound#resume + * @fires Phaser.Sound.Events#RESUME + * @since 3.0.0 + * + * @return {boolean} Whether the sound was resumed successfully. + */ + resume: function () + { + if (this.manager.context.currentTime < this.startTime) + { + return false; + } + + if (!BaseSound.prototype.resume.call(this)) + { + return false; + } + + // \/\/\/ isPlaying = true, isPaused = false \/\/\/ + this.createAndStartBufferSource(); + + this.emit(Events.RESUME, this); + + return true; + }, + + /** + * Stop playing this sound. + * + * @method Phaser.Sound.WebAudioSound#stop + * @fires Phaser.Sound.Events#STOP + * @since 3.0.0 + * + * @return {boolean} Whether the sound was stopped successfully. + */ + stop: function () + { + if (!BaseSound.prototype.stop.call(this)) + { + return false; + } + + // \/\/\/ isPlaying = false, isPaused = false \/\/\/ + this.stopAndRemoveBufferSource(); + + this.emit(Events.STOP, this); + + return true; + }, + + /** + * Used internally. + * + * @method Phaser.Sound.WebAudioSound#createAndStartBufferSource + * @private + * @since 3.0.0 + */ + createAndStartBufferSource: function () + { + var seek = this.currentConfig.seek; + var delay = this.currentConfig.delay; + var when = this.manager.context.currentTime + delay; + var offset = (this.currentMarker ? this.currentMarker.start : 0) + seek; + var duration = this.duration - seek; + + this.playTime = when - seek; + this.startTime = when; + this.source = this.createBufferSource(); + + this.applyConfig(); + + this.source.start(Math.max(0, when), Math.max(0, offset), Math.max(0, duration)); + + this.resetConfig(); + }, + + /** + * Used internally. + * + * @method Phaser.Sound.WebAudioSound#createAndStartLoopBufferSource + * @private + * @since 3.0.0 + */ + createAndStartLoopBufferSource: function () + { + var when = this.getLoopTime(); + var offset = this.currentMarker ? this.currentMarker.start : 0; + var duration = this.duration; + + this.loopTime = when; + this.loopSource = this.createBufferSource(); + this.loopSource.playbackRate.setValueAtTime(this.totalRate, 0); + this.loopSource.start(Math.max(0, when), Math.max(0, offset), Math.max(0, duration)); + }, + + /** + * Used internally. + * + * @method Phaser.Sound.WebAudioSound#createBufferSource + * @private + * @since 3.0.0 + * + * @return {AudioBufferSourceNode} + */ + createBufferSource: function () + { + var _this = this; + var source = this.manager.context.createBufferSource(); + + source.buffer = this.audioBuffer; + + source.connect(this.muteNode); + + source.onended = function (ev) + { + if (ev.target === _this.source) + { + // sound ended + if (_this.currentConfig.loop) + { + _this.hasLooped = true; + } + else + { + _this.hasEnded = true; + } + } + + // else was stopped + }; + + return source; + }, + + /** + * Used internally. + * + * @method Phaser.Sound.WebAudioSound#stopAndRemoveBufferSource + * @private + * @since 3.0.0 + */ + stopAndRemoveBufferSource: function () + { + if (this.source) + { + this.source.stop(); + this.source.disconnect(); + this.source = null; + } + + this.playTime = 0; + this.startTime = 0; + + this.stopAndRemoveLoopBufferSource(); + }, + + /** + * Used internally. + * + * @method Phaser.Sound.WebAudioSound#stopAndRemoveLoopBufferSource + * @private + * @since 3.0.0 + */ + stopAndRemoveLoopBufferSource: function () + { + if (this.loopSource) + { + this.loopSource.stop(); + this.loopSource.disconnect(); + this.loopSource = null; + } + + this.loopTime = 0; + }, + + /** + * Method used internally for applying config values to some of the sound properties. + * + * @method Phaser.Sound.WebAudioSound#applyConfig + * @protected + * @since 3.0.0 + */ + applyConfig: function () + { + this.rateUpdates.length = 0; + + this.rateUpdates.push({ + time: 0, + rate: 1 + }); + + BaseSound.prototype.applyConfig.call(this); + }, + + /** + * Update method called automatically by sound manager on every game step. + * + * @method Phaser.Sound.WebAudioSound#update + * @fires Phaser.Sound.Events#COMPLETE + * @fires Phaser.Sound.Events#LOOPED + * @protected + * @since 3.0.0 + * + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time elapsed since the last frame. + */ + // eslint-disable-next-line no-unused-vars + update: function (time, delta) + { + if (this.hasEnded) + { + this.hasEnded = false; + + BaseSound.prototype.stop.call(this); + + this.stopAndRemoveBufferSource(); + + this.emit(Events.COMPLETE, this); + } + else if (this.hasLooped) + { + this.hasLooped = false; + this.source = this.loopSource; + this.loopSource = null; + this.playTime = this.startTime = this.loopTime; + this.rateUpdates.length = 0; + + this.rateUpdates.push({ + time: 0, + rate: this.totalRate + }); + + this.createAndStartLoopBufferSource(); + + this.emit(Events.LOOPED, this); + } + }, + + /** + * Calls Phaser.Sound.BaseSound#destroy method + * and cleans up all Web Audio API related stuff. + * + * @method Phaser.Sound.WebAudioSound#destroy + * @since 3.0.0 + */ + destroy: function () + { + BaseSound.prototype.destroy.call(this); + + this.audioBuffer = null; + this.stopAndRemoveBufferSource(); + this.muteNode.disconnect(); + this.muteNode = null; + this.volumeNode.disconnect(); + this.volumeNode = null; + this.rateUpdates.length = 0; + this.rateUpdates = null; + }, + + /** + * Method used internally to calculate total playback rate of the sound. + * + * @method Phaser.Sound.WebAudioSound#calculateRate + * @protected + * @since 3.0.0 + */ + calculateRate: function () + { + BaseSound.prototype.calculateRate.call(this); + + var now = this.manager.context.currentTime; + + if (this.source && typeof this.totalRate === 'number') + { + this.source.playbackRate.setValueAtTime(this.totalRate, now); + } + + if (this.isPlaying) + { + this.rateUpdates.push({ + time: Math.max(this.startTime, now) - this.playTime, + rate: this.totalRate + }); + + if (this.loopSource) + { + this.stopAndRemoveLoopBufferSource(); + this.createAndStartLoopBufferSource(); + } + } + }, + + /** + * Method used internally for calculating current playback time of a playing sound. + * + * @method Phaser.Sound.WebAudioSound#getCurrentTime + * @private + * @since 3.0.0 + */ + getCurrentTime: function () + { + var currentTime = 0; + + for (var i = 0; i < this.rateUpdates.length; i++) + { + var nextTime = 0; + + if (i < this.rateUpdates.length - 1) + { + nextTime = this.rateUpdates[i + 1].time; + } + else + { + nextTime = this.manager.context.currentTime - this.playTime; + } + + currentTime += (nextTime - this.rateUpdates[i].time) * this.rateUpdates[i].rate; + } + + return currentTime; + }, + + /** + * Method used internally for calculating the time + * at witch the loop source should start playing. + * + * @method Phaser.Sound.WebAudioSound#getLoopTime + * @private + * @since 3.0.0 + */ + getLoopTime: function () + { + var lastRateUpdateCurrentTime = 0; + + for (var i = 0; i < this.rateUpdates.length - 1; i++) + { + lastRateUpdateCurrentTime += (this.rateUpdates[i + 1].time - this.rateUpdates[i].time) * this.rateUpdates[i].rate; + } + + var lastRateUpdate = this.rateUpdates[this.rateUpdates.length - 1]; + + return this.playTime + lastRateUpdate.time + (this.duration - lastRateUpdateCurrentTime) / lastRateUpdate.rate; + }, + + /** + * Rate at which this Sound will be played. + * Value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @name Phaser.Sound.WebAudioSound#rate + * @type {number} + * @default 1 + * @fires Phaser.Sound.Events#RATE + * @since 3.0.0 + */ + rate: { + + get: function () + { + return this.currentConfig.rate; + }, + + set: function (value) + { + this.currentConfig.rate = value; + + this.calculateRate(); + + this.emit(Events.RATE, this, value); + } + + }, + + /** + * Sets the playback rate of this Sound. + * + * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed + * and 2.0 doubles the audios playback speed. + * + * @method Phaser.Sound.WebAudioSound#setRate + * @fires Phaser.Sound.Events#RATE + * @since 3.3.0 + * + * @param {number} value - The playback rate at of this Sound. + * + * @return {Phaser.Sound.WebAudioSound} This Sound. + */ + setRate: function (value) + { + this.rate = value; + + return this; + }, + + /** + * The detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @name Phaser.Sound.WebAudioSound#detune + * @type {number} + * @default 0 + * @fires Phaser.Sound.Events#DETUNE + * @since 3.0.0 + */ + detune: { + + get: function () + { + return this.currentConfig.detune; + }, + + set: function (value) + { + this.currentConfig.detune = value; + + this.calculateRate(); + + this.emit(Events.DETUNE, this, value); + } + + }, + + /** + * Sets the detune value of this Sound, given in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). + * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @method Phaser.Sound.WebAudioSound#setDetune + * @fires Phaser.Sound.Events#DETUNE + * @since 3.3.0 + * + * @param {number} value - The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). + * + * @return {Phaser.Sound.WebAudioSound} This Sound. + */ + setDetune: function (value) + { + this.detune = value; + + return this; + }, + + /** + * Boolean indicating whether the sound is muted or not. + * Gets or sets the muted state of this sound. + * + * @name Phaser.Sound.WebAudioSound#mute + * @type {boolean} + * @default false + * @fires Phaser.Sound.Events#MUTE + * @since 3.0.0 + */ + mute: { + + get: function () + { + return (this.muteNode.gain.value === 0); + }, + + set: function (value) + { + this.currentConfig.mute = value; + this.muteNode.gain.setValueAtTime(value ? 0 : 1, 0); + + this.emit(Events.MUTE, this, value); + } + + }, + + /** + * Sets the muted state of this Sound. + * + * @method Phaser.Sound.WebAudioSound#setMute + * @fires Phaser.Sound.Events#MUTE + * @since 3.4.0 + * + * @param {boolean} value - `true` to mute this sound, `false` to unmute it. + * + * @return {Phaser.Sound.WebAudioSound} This Sound instance. + */ + setMute: function (value) + { + this.mute = value; + + return this; + }, + + /** + * Gets or sets the volume of this sound, a value between 0 (silence) and 1 (full volume). + * + * @name Phaser.Sound.WebAudioSound#volume + * @type {number} + * @default 1 + * @fires Phaser.Sound.Events#VOLUME + * @since 3.0.0 + */ + volume: { + + get: function () + { + return this.volumeNode.gain.value; + }, + + set: function (value) + { + this.currentConfig.volume = value; + this.volumeNode.gain.setValueAtTime(value, 0); + + this.emit(Events.VOLUME, this, value); + } + }, + + /** + * Sets the volume of this Sound. + * + * @method Phaser.Sound.WebAudioSound#setVolume + * @fires Phaser.Sound.Events#VOLUME + * @since 3.4.0 + * + * @param {number} value - The volume of the sound. + * + * @return {Phaser.Sound.WebAudioSound} This Sound instance. + */ + setVolume: function (value) + { + this.volume = value; + + return this; + }, + + /** + * Property representing the position of playback for this sound, in seconds. + * Setting it to a specific value moves current playback to that position. + * The value given is clamped to the range 0 to current marker duration. + * Setting seek of a stopped sound has no effect. + * + * @name Phaser.Sound.WebAudioSound#seek + * @type {number} + * @fires Phaser.Sound.Events#SEEK + * @since 3.0.0 + */ + seek: { + + get: function () + { + if (this.isPlaying) + { + if (this.manager.context.currentTime < this.startTime) + { + return this.startTime - this.playTime; + } + + return this.getCurrentTime(); + } + else if (this.isPaused) + { + return this.currentConfig.seek; + } + else + { + return 0; + } + }, + + set: function (value) + { + if (this.manager.context.currentTime < this.startTime) + { + return; + } + + if (this.isPlaying || this.isPaused) + { + value = Math.min(Math.max(0, value), this.duration); + + this.currentConfig.seek = value; + + if (this.isPlaying) + { + this.stopAndRemoveBufferSource(); + this.createAndStartBufferSource(); + } + + this.emit(Events.SEEK, this, value); + } + } + }, + + /** + * Seeks to a specific point in this sound. + * + * @method Phaser.Sound.WebAudioSound#setSeek + * @fires Phaser.Sound.Events#SEEK + * @since 3.4.0 + * + * @param {number} value - The point in the sound to seek to. + * + * @return {Phaser.Sound.WebAudioSound} This Sound instance. + */ + setSeek: function (value) + { + this.seek = value; + + return this; + }, + + /** + * Flag indicating whether or not the sound or current sound marker will loop. + * + * @name Phaser.Sound.WebAudioSound#loop + * @type {boolean} + * @default false + * @fires Phaser.Sound.Events#LOOP + * @since 3.0.0 + */ + loop: { + + get: function () + { + return this.currentConfig.loop; + }, + + set: function (value) + { + this.currentConfig.loop = value; + + if (this.isPlaying) + { + this.stopAndRemoveLoopBufferSource(); + + if (value) + { + this.createAndStartLoopBufferSource(); + } + } + + this.emit(Events.LOOP, this, value); + } + }, + + /** + * Sets the loop state of this Sound. + * + * @method Phaser.Sound.WebAudioSound#setLoop + * @fires Phaser.Sound.Events#LOOP + * @since 3.4.0 + * + * @param {boolean} value - `true` to loop this sound, `false` to not loop it. + * + * @return {Phaser.Sound.WebAudioSound} This Sound instance. + */ + setLoop: function (value) + { + this.loop = value; + + return this; + } + +}); + +module.exports = WebAudioSound; + + +/***/ }), +/* 360 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Transposes the elements of the given matrix (array of arrays). + * + * The transpose of a matrix is a new matrix whose rows are the columns of the original. + * + * @function Phaser.Utils.Array.Matrix.TransposeMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [array,$return] + * + * @param {T[][]} [array] - The array matrix to transpose. + * + * @return {T[][]} A new array matrix which is a transposed version of the given array. + */ +var TransposeMatrix = function (array) +{ + var sourceRowCount = array.length; + var sourceColCount = array[0].length; + + var result = new Array(sourceColCount); + + for (var i = 0; i < sourceColCount; i++) + { + result[i] = new Array(sourceRowCount); + + for (var j = sourceRowCount - 1; j > -1; j--) + { + result[i][j] = array[j][i]; + } + } + + return result; +}; + +module.exports = TransposeMatrix; + + +/***/ }), +/* 361 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +function swap (arr, i, j) +{ + var tmp = arr[i]; + arr[i] = arr[j]; + arr[j] = tmp; +} + +/** + * @ignore + */ +function defaultCompare (a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. + * + * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; + * The k-th element will have the (k - left + 1)th smallest value in [left, right]. + * + * The array is modified in-place. + * + * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) + * + * @function Phaser.Utils.Array.QuickSelect + * @since 3.0.0 + * + * @param {array} arr - The array to sort. + * @param {integer} k - The k-th element index. + * @param {integer} [left=0] - The index of the left part of the range. + * @param {integer} [right] - The index of the right part of the range. + * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. + */ +var QuickSelect = function (arr, k, left, right, compare) +{ + if (left === undefined) { left = 0; } + if (right === undefined) { right = arr.length - 1; } + if (compare === undefined) { compare = defaultCompare; } + + while (right > left) + { + if (right - left > 600) + { + var n = right - left + 1; + var m = k - left + 1; + var z = Math.log(n); + var s = 0.5 * Math.exp(2 * z / 3); + var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1); + var newLeft = Math.max(left, Math.floor(k - m * s / n + sd)); + var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd)); + + QuickSelect(arr, k, newLeft, newRight, compare); + } + + var t = arr[k]; + var i = left; + var j = right; + + swap(arr, left, k); + + if (compare(arr[right], t) > 0) + { + swap(arr, left, right); + } + + while (i < j) + { + swap(arr, i, j); + + i++; + j--; + + while (compare(arr[i], t) < 0) + { + i++; + } + + while (compare(arr[j], t) > 0) + { + j--; + } + } + + if (compare(arr[left], t) === 0) + { + swap(arr, left, j); + } + else + { + j++; + swap(arr, j, right); + } + + if (j <= k) + { + left = j + 1; + } + + if (k <= j) + { + right = j - 1; + } + } +}; + +module.exports = QuickSelect; + + +/***/ }), +/* 362 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetValue = __webpack_require__(6); +var Shuffle = __webpack_require__(111); + +var BuildChunk = function (a, b, qty) +{ + var out = []; + + for (var aIndex = 0; aIndex < a.length; aIndex++) + { + for (var bIndex = 0; bIndex < b.length; bIndex++) + { + for (var i = 0; i < qty; i++) + { + out.push({ a: a[aIndex], b: b[bIndex] }); + } + } + } + + return out; +}; + +/** + * Creates an array populated with a range of values, based on the given arguments and configuration object. + * + * Range ([a,b,c], [1,2,3]) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2,3], qty = 3) = + * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 + * + * Range ([a,b,c], [1,2,3], repeat x1) = + * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 + * + * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = + * Maybe if max is set then repeat goes to -1 automatically? + * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) + * + * Range ([a], [1,2,3,4,5], random = true) = + * a4, a1, a5, a2, a3 + * + * Range ([a, b], [1,2,3], random = true) = + * b3, a2, a1, b1, a3, b2 + * + * Range ([a, b, c], [1,2,3], randomB = true) = + * a3, a1, a2, b2, b3, b1, c1, c3, c2 + * + * Range ([a], [1,2,3,4,5], yoyo = true) = + * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 + * + * Range ([a, b], [1,2,3], yoyo = true) = + * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 + * + * @function Phaser.Utils.Array.Range + * @since 3.0.0 + * + * @param {array} a - The first array of range elements. + * @param {array} b - The second array of range elements. + * @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty. + * + * @return {array} An array of arranged elements. + */ +var Range = function (a, b, options) +{ + var max = GetValue(options, 'max', 0); + var qty = GetValue(options, 'qty', 1); + var random = GetValue(options, 'random', false); + var randomB = GetValue(options, 'randomB', false); + var repeat = GetValue(options, 'repeat', 0); + var yoyo = GetValue(options, 'yoyo', false); + + var out = []; + + if (randomB) + { + Shuffle(b); + } + + // Endless repeat, so limit by max + if (repeat === -1) + { + if (max === 0) + { + repeat = 0; + } + else + { + // Work out how many repeats we need + var total = (a.length * b.length) * qty; + + if (yoyo) + { + total *= 2; + } + + repeat = Math.ceil(max / total); + } + } + + for (var i = 0; i <= repeat; i++) + { + var chunk = BuildChunk(a, b, qty); + + if (random) + { + Shuffle(chunk); + } + + out = out.concat(chunk); + + if (yoyo) + { + chunk.reverse(); + + out = out.concat(chunk); + } + } + + if (max) + { + out.splice(max); + } + + return out; +}; + +module.exports = Range; + + +/***/ }), +/* 363 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetAdvancedValue = __webpack_require__(14); + +/** + * Adds an Animation component to a Sprite and populates it based on the given config. + * + * @function Phaser.GameObjects.BuildGameObjectAnimation + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Sprite} sprite - The sprite to add an Animation component to. + * @param {object} config - The animation config. + * + * @return {Phaser.GameObjects.Sprite} The updated Sprite. + */ +var BuildGameObjectAnimation = function (sprite, config) +{ + var animConfig = GetAdvancedValue(config, 'anims', null); + + if (animConfig === null) + { + return sprite; + } + + if (typeof animConfig === 'string') + { + // { anims: 'key' } + sprite.anims.play(animConfig); + } + else if (typeof animConfig === 'object') + { + // { anims: { + // key: string + // startFrame: [string|integer] + // delay: [float] + // repeat: [integer] + // repeatDelay: [float] + // yoyo: [boolean] + // play: [boolean] + // delayedPlay: [boolean] + // } + // } + + var anims = sprite.anims; + + var key = GetAdvancedValue(animConfig, 'key', undefined); + var startFrame = GetAdvancedValue(animConfig, 'startFrame', undefined); + + var delay = GetAdvancedValue(animConfig, 'delay', 0); + var repeat = GetAdvancedValue(animConfig, 'repeat', 0); + var repeatDelay = GetAdvancedValue(animConfig, 'repeatDelay', 0); + var yoyo = GetAdvancedValue(animConfig, 'yoyo', false); + + var play = GetAdvancedValue(animConfig, 'play', false); + var delayedPlay = GetAdvancedValue(animConfig, 'delayedPlay', 0); + + anims.setDelay(delay); + anims.setRepeat(repeat); + anims.setRepeatDelay(repeatDelay); + anims.setYoyo(yoyo); + + if (play) + { + anims.play(key, startFrame); + } + else if (delayedPlay > 0) + { + anims.delayedPlay(delayedPlay, key, startFrame); + } + else + { + anims.load(key); + } + } + + return sprite; +}; + +module.exports = BuildGameObjectAnimation; + + +/***/ }), +/* 364 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); + +/** + * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. + * + * @function Phaser.Geom.Rectangle.Union + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use. + * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in. + * + * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. + */ +var Union = function (rectA, rectB, out) +{ + if (out === undefined) { out = new Rectangle(); } + + // Cache vars so we can use one of the input rects as the output rect + var x = Math.min(rectA.x, rectB.x); + var y = Math.min(rectA.y, rectB.y); + var w = Math.max(rectA.right, rectB.right) - x; + var h = Math.max(rectA.bottom, rectB.bottom) - y; + + return out.setTo(x, y, w, h); +}; + +module.exports = Union; + + +/***/ }), +/* 365 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var DOMElementRender = __webpack_require__(916); +var GameObject = __webpack_require__(13); +var IsPlainObject = __webpack_require__(7); +var RemoveFromDOM = __webpack_require__(174); +var Vector4 = __webpack_require__(308); + +/** + * @classdesc + * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. + * + * In order for DOM Elements to display you have to enable them by adding the following to your game + * configuration object: + * + * ```javascript + * dom { + * createContainer: true + * } + * ``` + * + * When this is added, Phaser will automatically create a DOM Container div that is positioned over the top + * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of + * settings within the Scale Manager, the dom container is resized accordingly. + * + * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing + * Element that you wish to be placed under the control of Phaser. For example: + * + * ```javascript + * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in + * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case, + * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font. + * + * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control + * alignment and positioning of the elements next to regular game content. + * + * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the + * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other + * methods available in this class to help construct your elements. + * + * Once the element has been created you can then control it like you would any other Game Object. You can set its + * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped + * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that + * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have + * a DOM Element, then a Sprite, then another DOM Element behind it. + * + * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event + * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas + * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you + * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly. + * + * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in. + * + * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert + * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table. + * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and + * UI. The choice is up to you, just remember that you're dealing with standard HTML and CSS floating over the top + * of your game, and should treat it accordingly. + * + * @class DOMElement + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.17.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this DOM Element in the world. + * @param {number} [y=0] - The vertical position of this DOM Element in the world. + * @param {(Element|string)} [element] - An existing DOM element, or a string. If a string starting with a # it will do a `getElementById` look-up on the string (minus the hash). Without a hash, it represents the type of element to create, i.e. 'div'. + * @param {(string|any)} [style] - If a string, will be set directly as the elements `style` property value. If a plain object, will be iterated and the values transferred. In both cases the values replacing whatever CSS styles may have been previously set. + * @param {string} [innerText] - If given, will be set directly as the elements `innerText` property value, replacing whatever was there before. + */ +var DOMElement = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.Depth, + Components.Origin, + Components.ScrollFactor, + Components.Transform, + Components.Visible, + DOMElementRender + ], + + initialize: + + function DOMElement (scene, x, y, element, style, innerText) + { + GameObject.call(this, scene, 'DOMElement'); + + /** + * A reference to the parent DOM Container that the Game instance created when it started. + * + * @name Phaser.GameObjects.DOMElement#parent + * @type {Element} + * @since 3.17.0 + */ + this.parent = scene.sys.game.domContainer; + + /** + * A reference to the HTML Cache. + * + * @name Phaser.GameObjects.DOMElement#cache + * @type {Phaser.Cache.BaseCache} + * @since 3.17.0 + */ + this.cache = scene.sys.cache.html; + + /** + * The actual DOM Element that this Game Object is bound to. For example, if you've created a `
` + * then this property is a direct reference to that element within the dom. + * + * @name Phaser.GameObjects.DOMElement#node + * @type {Element} + * @since 3.17.0 + */ + this.node; + + /** + * By default a DOM Element will have its transform, display, opacity, zIndex and blend mode properties + * updated when its rendered. If, for some reason, you don't want any of these changed other than the + * CSS transform, then set this flag to `true`. When `true` only the CSS Transform is applied and it's + * up to you to keep track of and set the other properties as required. + * + * This can be handy if, for example, you've a nested DOM Element and you don't want the opacity to be + * picked-up by any of its children. + * + * @name Phaser.GameObjects.DOMElement#transformOnly + * @type {boolean} + * @since 3.17.0 + */ + this.transformOnly = false; + + /** + * The angle, in radians, by which to skew the DOM Element on the horizontal axis. + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform + * + * @name Phaser.GameObjects.DOMElement#skewX + * @type {number} + * @since 3.17.0 + */ + this.skewX = 0; + + /** + * The angle, in radians, by which to skew the DOM Element on the vertical axis. + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform + * + * @name Phaser.GameObjects.DOMElement#skewY + * @type {number} + * @since 3.17.0 + */ + this.skewY = 0; + + /** + * A Vector4 that contains the 3D rotation of this DOM Element around a fixed axis in 3D space. + * + * All values in the Vector4 are treated as degrees, unless the `rotate3dAngle` property is changed. + * + * For more details see the following MDN page: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d + * + * @name Phaser.GameObjects.DOMElement#rotate3d + * @type {Phaser.Math.Vector4} + * @since 3.17.0 + */ + this.rotate3d = new Vector4(); + + /** + * The unit that represents the 3D rotation values. By default this is `deg` for degrees, but can + * be changed to any supported unit. See this page for further details: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d + * + * @name Phaser.GameObjects.DOMElement#rotate3dAngle + * @type {string} + * @since 3.17.0 + */ + this.rotate3dAngle = 'deg'; + + /** + * The native (un-scaled) width of this Game Object. + * + * For a DOM Element this property is read-only. + * + * The property `displayWidth` holds the computed bounds of this DOM Element, factoring in scaling. + * + * @name Phaser.GameObjects.DOMElement#width + * @type {number} + * @readonly + * @since 3.17.0 + */ + this.width = 0; + + /** + * The native (un-scaled) height of this Game Object. + * + * For a DOM Element this property is read-only. + * + * The property `displayHeight` holds the computed bounds of this DOM Element, factoring in scaling. + * + * @name Phaser.GameObjects.DOMElement#height + * @type {number} + * @readonly + * @since 3.17.0 + */ + this.height = 0; + + /** + * The computed display width of this Game Object, based on the `getBoundingClientRect` DOM call. + * + * The property `width` holds the un-scaled width of this DOM Element. + * + * @name Phaser.GameObjects.DOMElement#displayWidth + * @type {number} + * @readonly + * @since 3.17.0 + */ + this.displayWidth = 0; + + /** + * The computed display height of this Game Object, based on the `getBoundingClientRect` DOM call. + * + * The property `height` holds the un-scaled height of this DOM Element. + * + * @name Phaser.GameObjects.DOMElement#displayHeight + * @type {number} + * @readonly + * @since 3.17.0 + */ + this.displayHeight = 0; + + /** + * Internal native event handler. + * + * @name Phaser.GameObjects.DOMElement#handler + * @type {number} + * @private + * @since 3.17.0 + */ + this.handler = this.dispatchNativeEvent.bind(this); + + this.setPosition(x, y); + + if (typeof element === 'string') + { + // hash? + if (element[0] === '#') + { + this.setElement(element.substr(1), style, innerText); + } + else + { + this.createElement(element, style, innerText); + } + } + else if (element) + { + this.setElement(element, style, innerText); + } + }, + + /** + * Sets the horizontal and vertical skew values of this DOM Element. + * + * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/transform + * + * @method Phaser.GameObjects.DOMElement#setSkew + * @since 3.17.0 + * + * @param {number} [x=0] - The angle, in radians, by which to skew the DOM Element on the horizontal axis. + * @param {number} [y=x] - The angle, in radians, by which to skew the DOM Element on the vertical axis. + * + * @return {this} This DOM Element instance. + */ + setSkew: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this.skewX = x; + this.skewY = y; + + return this; + }, + + /** + * Sets the perspective CSS property of the _parent DOM Container_. This determines the distance between the z=0 + * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with + * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined + * by the value of this property. + * + * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective + * + * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.** + * + * @method Phaser.GameObjects.DOMElement#setPerspective + * @since 3.17.0 + * + * @param {number} value - The perspective value, in pixels, that determines the distance between the z plane and the user. + * + * @return {this} This DOM Element instance. + */ + setPerspective: function (value) + { + this.parent.style.perspective = value + 'px'; + + return this; + }, + + /** + * The perspective CSS property value of the _parent DOM Container_. This determines the distance between the z=0 + * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with + * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined + * by the value of this property. + * + * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective + * + * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.** + * + * @name Phaser.GameObjects.DOMElement#perspective + * @type {number} + * @since 3.17.0 + */ + perspective: { + + get: function () + { + return parseFloat(this.parent.style.perspective); + }, + + set: function (value) + { + this.parent.style.perspective = value + 'px'; + } + + }, + + /** + * Adds one or more native DOM event listeners onto the underlying Element of this Game Object. + * The event is then dispatched via this Game Objects standard event emitter. + * + * For example: + * + * ```javascript + * var div = this.add.dom(x, y, element); + * + * div.addListener('click'); + * + * div.on('click', handler); + * ``` + * + * @method Phaser.GameObjects.DOMElement#addListener + * @since 3.17.0 + * + * @param {string} events - The DOM event/s to listen for. You can specify multiple events by separating them with spaces. + * + * @return {this} This DOM Element instance. + */ + addListener: function (events) + { + if (this.node) + { + events = events.split(' '); + + for (var i = 0; i < events.length; i++) + { + this.node.addEventListener(events[i], this.handler, false); + } + } + + return this; + }, + + /** + * Removes one or more native DOM event listeners from the underlying Element of this Game Object. + * + * @method Phaser.GameObjects.DOMElement#removeListener + * @since 3.17.0 + * + * @param {string} events - The DOM event/s to stop listening for. You can specify multiple events by separating them with spaces. + * + * @return {this} This DOM Element instance. + */ + removeListener: function (events) + { + if (this.node) + { + events = events.split(' '); + + for (var i = 0; i < events.length; i++) + { + this.node.removeEventListener(events[i], this.handler); + } + } + + return this; + }, + + /** + * Internal event proxy to dispatch native DOM Events via this Game Object. + * + * @method Phaser.GameObjects.DOMElement#dispatchNativeEvent + * @private + * @since 3.17.0 + * + * @param {any} event - The native DOM event. + */ + dispatchNativeEvent: function (event) + { + this.emit(event.type, event); + }, + + /** + * Creates a native DOM Element, adds it to the parent DOM Container and then binds it to this Game Object, + * so you can control it. The `tagName` should be a string and is passed to `document.createElement`: + * + * ```javascript + * this.add.dom().createElement('div'); + * ``` + * + * For more details on acceptable tag names see: https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement + * + * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText` + * value as well. Here is an example of a DOMString: + * + * ```javascript + * this.add.dom().createElement('div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * And using a style object: + * + * ```javascript + * var style = { + * 'background-color': 'lime'; + * 'width': '200px'; + * 'height': '100px'; + * 'font': '48px Arial'; + * }; + * + * this.add.dom().createElement('div', style, 'Phaser'); + * ``` + * + * If this Game Object already has an Element, it is removed from the DOM entirely first. + * Any event listeners you may have previously created will need to be re-created after this call. + * + * @method Phaser.GameObjects.DOMElement#createElement + * @since 3.17.0 + * + * @param {string} tagName - A string that specifies the type of element to be created. The nodeName of the created element is initialized with the value of tagName. Don't use qualified names (like "html:a") with this method. + * @param {(string|any)} [style] - Either a DOMString that holds the CSS styles to be applied to the created element, or an object the styles will be ready from. + * @param {string} [innerText] - A DOMString that holds the text that will be set as the innerText of the created element. + * + * @return {this} This DOM Element instance. + */ + createElement: function (tagName, style, innerText) + { + return this.setElement(document.createElement(tagName), style, innerText); + }, + + /** + * Binds a new DOM Element to this Game Object. If this Game Object already has an Element it is removed from the DOM + * entirely first. Any event listeners you may have previously created will need to be re-created on the new element. + * + * The `element` argument you pass to this method can be either a string tagName: + * + * ```javascript + *

Phaser

+ * + * this.add.dom().setElement('heading'); + * ``` + * + * Or a reference to an Element instance: + * + * ```javascript + *

Phaser

+ * + * var h1 = document.getElementById('heading'); + * + * this.add.dom().setElement(h1); + * ``` + * + * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText` + * value as well. Here is an example of a DOMString: + * + * ```javascript + * this.add.dom().setElement(h1, 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * And using a style object: + * + * ```javascript + * var style = { + * 'background-color': 'lime'; + * 'width': '200px'; + * 'height': '100px'; + * 'font': '48px Arial'; + * }; + * + * this.add.dom().setElement(h1, style, 'Phaser'); + * ``` + * + * @method Phaser.GameObjects.DOMElement#setElement + * @since 3.17.0 + * + * @param {(string|Element)} element - If a string it is passed to `getElementById()`, or it should be a reference to an existing Element. + * @param {(string|any)} [style] - Either a DOMString that holds the CSS styles to be applied to the created element, or an object the styles will be ready from. + * @param {string} [innerText] - A DOMString that holds the text that will be set as the innerText of the created element. + * + * @return {this} This DOM Element instance. + */ + setElement: function (element, style, innerText) + { + // Already got an element? Remove it first + this.removeElement(); + + var target; + + if (typeof element === 'string') + { + // hash? + if (element[0] === '#') + { + element = element.substr(1); + } + + target = document.getElementById(element); + } + else if (typeof element === 'object' && element.nodeType === 1) + { + target = element; + } + + if (!target) + { + return this; + } + + this.node = target; + + // style can be empty, a string or a plain object + if (style && IsPlainObject(style)) + { + for (var key in style) + { + target.style[key] = style[key]; + } + } + else if (typeof style === 'string') + { + target.style = style; + } + + // Add / Override the values we need + + target.style.zIndex = '0'; + target.style.display = 'inline'; + target.style.position = 'absolute'; + + // Node handler + + target.phaser = this; + + if (this.parent) + { + this.parent.appendChild(target); + } + + // InnerText + + if (innerText) + { + target.innerText = innerText; + } + + return this.updateSize(); + }, + + /** + * Takes a block of html from the HTML Cache, that has previously been preloaded into the game, and then + * creates a DOM Element from it. The loaded HTML is set as the `innerHTML` property of the created + * element. + * + * Assume the following html is stored in a file called `loginform.html`: + * + * ```html + * + * + * ``` + * + * Which is loaded into your game using the cache key 'login': + * + * ```javascript + * this.load.html('login', 'assets/loginform.html'); + * ``` + * + * You can create a DOM Element from it using the cache key: + * + * ```javascript + * this.add.dom().createFromCache('login'); + * ``` + * + * The optional `elementType` argument controls the container that is created, into which the loaded html is inserted. + * The default is a plain `div` object, but any valid tagName can be given. + * + * If this Game Object already has an Element, it is removed from the DOM entirely first. + * Any event listeners you may have previously created will need to be re-created after this call. + * + * @method Phaser.GameObjects.DOMElement#createFromCache + * @since 3.17.0 + * + * @param {string} The key of the html cache entry to use for this DOM Element. + * @param {string} [tagName='div'] - The tag name of the element into which all of the loaded html will be inserted. Defaults to a plain div tag. + * + * @return {this} This DOM Element instance. + */ + createFromCache: function (key, tagName) + { + var html = this.cache.get(key); + + if (html) + { + this.createFromHTML(html, tagName); + } + + return this; + }, + + /** + * Takes a string of html and then creates a DOM Element from it. The HTML is set as the `innerHTML` + * property of the created element. + * + * ```javascript + * let form = ` + * + * + * `; + * ``` + * + * You can create a DOM Element from it using the string: + * + * ```javascript + * this.add.dom().createFromHTML(form); + * ``` + * + * The optional `elementType` argument controls the type of container that is created, into which the html is inserted. + * The default is a plain `div` object, but any valid tagName can be given. + * + * If this Game Object already has an Element, it is removed from the DOM entirely first. + * Any event listeners you may have previously created will need to be re-created after this call. + * + * @method Phaser.GameObjects.DOMElement#createFromHTML + * @since 3.17.0 + * + * @param {string} A string of html to be set as the `innerHTML` property of the created element. + * @param {string} [tagName='div'] - The tag name of the element into which all of the html will be inserted. Defaults to a plain div tag. + * + * @return {this} This DOM Element instance. + */ + createFromHTML: function (html, tagName) + { + if (tagName === undefined) { tagName = 'div'; } + + // Already got an element? Remove it first + this.removeElement(); + + var element = document.createElement(tagName); + + this.node = element; + + element.style.zIndex = '0'; + element.style.display = 'inline'; + element.style.position = 'absolute'; + + // Node handler + + element.phaser = this; + + if (this.parent) + { + this.parent.appendChild(element); + } + + element.innerHTML = html; + + return this.updateSize(); + }, + + /** + * Removes the current DOM Element bound to this Game Object from the DOM entirely and resets the + * `node` property of this Game Object to be `null`. + * + * @method Phaser.GameObjects.DOMElement#removeElement + * @since 3.17.0 + * + * @return {this} This DOM Element instance. + */ + removeElement: function () + { + if (this.node) + { + RemoveFromDOM(this.node); + + this.node = null; + } + + return this; + }, + + /** + * Internal method that calls `getBoundingClientRect` on the `node` and then sets the bounds width + * and height into the `displayWidth` and `displayHeight` properties, and the `clientWidth` and `clientHeight` + * values into the `width` and `height` properties respectively. + * + * This is called automatically whenever a new element is created or set. + * + * @method Phaser.GameObjects.DOMElement#updateSize + * @since 3.17.0 + * + * @return {this} This DOM Element instance. + */ + updateSize: function () + { + var node = this.node; + + var nodeBounds = node.getBoundingClientRect(); + + this.width = node.clientWidth; + this.height = node.clientHeight; + + this.displayWidth = nodeBounds.width || 0; + this.displayHeight = nodeBounds.height || 0; + + return this; + }, + + /** + * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through + * them, looking for the first one that has a property matching the given key and value. It then returns this child + * if found, or `null` if not. + * + * @method Phaser.GameObjects.DOMElement#getChildByProperty + * @since 3.17.0 + * + * @param {string} property - The property to search the children for. + * @param {string} value - The value the property must strictly equal. + * + * @return {?Element} The first matching child DOM Element, or `null` if not found. + */ + getChildByProperty: function (property, value) + { + if (this.node) + { + var children = this.node.querySelectorAll('*'); + + for (var i = 0; i < children.length; i++) + { + if (children[i][property] === value) + { + return children[i]; + } + } + } + + return null; + }, + + /** + * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through + * them, looking for the first one that has a matching id. It then returns this child if found, or `null` if not. + * + * Be aware that class and id names are case-sensitive. + * + * @method Phaser.GameObjects.DOMElement#getChildByID + * @since 3.17.0 + * + * @param {string} id - The id to search the children for. + * + * @return {?Element} The first matching child DOM Element, or `null` if not found. + */ + getChildByID: function (id) + { + return this.getChildByProperty('id', id); + }, + + /** + * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through + * them, looking for the first one that has a matching name. It then returns this child if found, or `null` if not. + * + * Be aware that class and id names are case-sensitive. + * + * @method Phaser.GameObjects.DOMElement#getChildByName + * @since 3.17.0 + * + * @param {string} name - The name to search the children for. + * + * @return {?Element} The first matching child DOM Element, or `null` if not found. + */ + getChildByName: function (name) + { + return this.getChildByProperty('name', name); + }, + + /** + * Sets the `className` property of the DOM Element node and updates the internal sizes. + * + * @method Phaser.GameObjects.DOMElement#setClassName + * @since 3.17.0 + * + * @param {string} className - A string representing the class or space-separated classes of the element. + * + * @return {this} This DOM Element instance. + */ + setClassName: function (className) + { + if (this.node) + { + this.node.className = className; + + this.updateSize(); + } + + return this; + }, + + /** + * Sets the `innerText` property of the DOM Element node and updates the internal sizes. + * + * Note that only certain types of Elements can have `innerText` set on them. + * + * @method Phaser.GameObjects.DOMElement#setText + * @since 3.17.0 + * + * @param {string} text - A DOMString representing the rendered text content of the element. + * + * @return {this} This DOM Element instance. + */ + setText: function (text) + { + if (this.node) + { + this.node.innerText = text; + + this.updateSize(); + } + + return this; + }, + + /** + * Sets the `innerHTML` property of the DOM Element node and updates the internal sizes. + * + * @method Phaser.GameObjects.DOMElement#setHTML + * @since 3.17.0 + * + * @param {string} html - A DOMString of html to be set as the `innerHTML` property of the element. + * + * @return {this} This DOM Element instance. + */ + setHTML: function (html) + { + if (this.node) + { + this.node.innerHTML = html; + + this.updateSize(); + } + + return this; + }, + + /** + * Runs internal update tasks. + * + * @method Phaser.GameObjects.DOMElement#preUpdate + * @private + * @since 3.17.0 + */ + preUpdate: function () + { + var parent = this.parentContainer; + var node = this.node; + + if (node && parent && !parent.willRender()) + { + node.style.display = 'none'; + } + }, + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * + * DOMElements always return `true` as they need to still set values during the render pass, even if not visible. + * + * @method Phaser.GameObjects.DOMElement#willRender + * @since 3.17.0 + * + * @return {boolean} `true` if the Game Object should be rendered, otherwise `false`. + */ + willRender: function () + { + return true; + }, + + /** + * Handles the pre-destroy step for the DOM Element, which removes the underlying node from the DOM. + * + * @method Phaser.GameObjects.DOMElement#preDestroy + * @private + * @since 3.17.0 + */ + preDestroy: function () + { + this.removeElement(); + } + +}); + +module.exports = DOMElement; + + +/***/ }), +/* 366 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CSSBlendModes = __webpack_require__(917); +var GameObject = __webpack_require__(13); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.DOMElement#renderWebGL + * @since 3.17.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active renderer. + * @param {Phaser.GameObjects.DOMElement} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var node = src.node; + var style = node.style; + + if (!node || !style || GameObject.RENDER_MASK !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)) || (src.parentContainer && !src.parentContainer.willRender())) + { + if (node) + { + style.display = 'none'; + } + + return; + } + + var parent = src.parentContainer; + var alpha = camera.alpha * src.alpha; + + if (parent) + { + alpha *= parent.alpha; + } + + var camMatrix = renderer._tempMatrix1; + var srcMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + var dx = 0; + var dy = 0; + + var tx = '0%'; + var ty = '0%'; + + if (parentMatrix) + { + dx = (src.width * src.scaleX) * src.originX; + dy = (src.height * src.scaleY) * src.originY; + + srcMatrix.applyITRS(src.x - dx, src.y - dy, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + srcMatrix.e = src.x - dx; + srcMatrix.f = src.y - dy; + + // Multiply by the src matrix, store result in calcMatrix + camMatrix.multiply(srcMatrix, calcMatrix); + } + else + { + dx = (src.width) * src.originX; + dy = (src.height) * src.originY; + + srcMatrix.applyITRS(src.x - dx, src.y - dy, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + tx = (100 * src.originX) + '%'; + ty = (100 * src.originY) + '%'; + + srcMatrix.e -= camera.scrollX * src.scrollFactorX; + srcMatrix.f -= camera.scrollY * src.scrollFactorY; + + // Multiply by the src matrix, store result in calcMatrix + camMatrix.multiply(srcMatrix, calcMatrix); + } + + if (!src.transformOnly) + { + style.display = 'block'; + style.opacity = alpha; + style.zIndex = src._depth; + style.pointerEvents = 'auto'; + style.mixBlendMode = CSSBlendModes[src._blendMode]; + } + + // https://developer.mozilla.org/en-US/docs/Web/CSS/transform + + style.transform = + calcMatrix.getCSSMatrix() + + ' skew(' + src.skewX + 'rad, ' + src.skewY + 'rad)' + + ' rotate3d(' + src.rotate3d.x + ',' + src.rotate3d.y + ',' + src.rotate3d.z + ',' + src.rotate3d.w + src.rotate3dAngle + ')'; + + style.transformOrigin = tx + ' ' + ty; +}; + +module.exports = DOMElementCSSRenderer; + + +/***/ }), +/* 367 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var GameObject = __webpack_require__(13); +var ExternRender = __webpack_require__(921); + +/** + * @classdesc + * An Extern Game Object is a special type of Game Object that allows you to pass + * rendering off to a 3rd party. + * + * When you create an Extern and place it in the display list of a Scene, the renderer will + * process the list as usual. When it finds an Extern it will flush the current batch, + * clear down the pipeline and prepare a transform matrix which your render function can + * take advantage of, if required. + * + * The WebGL context is then left is a 'clean' state, ready for you to bind your own shaders, + * or draw to it, whatever you wish to do. Once you've finished, you should free-up any + * of your resources. The Extern will then rebind the Phaser pipeline and carry on + * rendering the display list. + * + * Although this object has lots of properties such as Alpha, Blend Mode and Tint, none of + * them are used during rendering unless you take advantage of them in your own render code. + * + * @class Extern + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.16.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + */ +var Extern = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.Depth, + Components.Flip, + Components.Origin, + Components.ScrollFactor, + Components.Size, + Components.Texture, + Components.Tint, + Components.Transform, + Components.Visible, + ExternRender + ], + + initialize: + + function Extern (scene) + { + GameObject.call(this, scene, 'Extern'); + }, + + preUpdate: function () + { + // override this! + // Arguments: time, delta + }, + + render: function () + { + // override this! + // Arguments: renderer, camera, calcMatrix + } + +}); + +module.exports = Extern; + + +/***/ }), +/* 368 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CircumferencePoint = __webpack_require__(187); +var FromPercent = __webpack_require__(86); +var MATH_CONST = __webpack_require__(23); +var Point = __webpack_require__(3); + +/** + * Returns a Point object containing the coordinates of a point on the circumference of the Ellipse + * based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point + * at 180 degrees around the circle. + * + * @function Phaser.Geom.Ellipse.GetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference point on. + * @param {number} position - A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the ellipse. + * @param {(Phaser.Geom.Point|object)} [out] - An object to store the return values in. If not given a Point object will be created. + * + * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point around the ellipse. + */ +var GetPoint = function (ellipse, position, out) +{ + if (out === undefined) { out = new Point(); } + + var angle = FromPercent(position, 0, MATH_CONST.PI2); + + return CircumferencePoint(ellipse, angle, out); +}; + +module.exports = GetPoint; + + +/***/ }), +/* 369 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Circumference = __webpack_require__(370); +var CircumferencePoint = __webpack_require__(187); +var FromPercent = __webpack_require__(86); +var MATH_CONST = __webpack_require__(23); + +/** + * Returns an array of Point objects containing the coordinates of the points around the circumference of the Ellipse, + * based on the given quantity or stepRate values. + * + * @function Phaser.Geom.Ellipse.GetPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [out,$return] + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the points from. + * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. + * @param {(array|Phaser.Geom.Point[])} [out] - An array to insert the points in to. If not provided a new array will be created. + * + * @return {(array|Phaser.Geom.Point[])} An array of Point objects pertaining to the points around the circumference of the ellipse. + */ +var GetPoints = function (ellipse, quantity, stepRate, out) +{ + if (out === undefined) { out = []; } + + // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. + if (!quantity) + { + quantity = Circumference(ellipse) / stepRate; + } + + for (var i = 0; i < quantity; i++) + { + var angle = FromPercent(i / quantity, 0, MATH_CONST.PI2); + + out.push(CircumferencePoint(ellipse, angle)); + } + + return out; +}; + +module.exports = GetPoints; + + +/***/ }), +/* 370 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the circumference of the given Ellipse. + * + * @function Phaser.Geom.Ellipse.Circumference + * @since 3.0.0 + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the circumference of. + * + * @return {number} The circumference of th Ellipse. + */ +var Circumference = function (ellipse) +{ + var rx = ellipse.width / 2; + var ry = ellipse.height / 2; + var h = Math.pow((rx - ry), 2) / Math.pow((rx + ry), 2); + + return (Math.PI * (rx + ry)) * (1 + ((3 * h) / (10 + Math.sqrt(4 - (3 * h))))); +}; + +module.exports = Circumference; + + +/***/ }), +/* 371 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Commands = __webpack_require__(186); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Graphics#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Graphics} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + * @param {CanvasRenderingContext2D} [renderTargetCtx] - The target rendering context. + * @param {boolean} allowClip - If `true` then path operations will be used instead of fill operations. + */ +var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip) +{ + var commandBuffer = src.commandBuffer; + var commandBufferLength = commandBuffer.length; + + var ctx = renderTargetCtx || renderer.currentContext; + + if (commandBufferLength === 0 || !SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + return; + } + + var lineAlpha = 1; + var fillAlpha = 1; + var lineColor = 0; + var fillColor = 0; + var lineWidth = 1; + var red = 0; + var green = 0; + var blue = 0; + + // Reset any currently active paths + ctx.beginPath(); + + for (var index = 0; index < commandBufferLength; ++index) + { + var commandID = commandBuffer[index]; + + switch (commandID) + { + case Commands.ARC: + ctx.arc( + commandBuffer[index + 1], + commandBuffer[index + 2], + commandBuffer[index + 3], + commandBuffer[index + 4], + commandBuffer[index + 5], + commandBuffer[index + 6] + ); + + // +7 because overshoot is the 7th value, not used in Canvas + index += 7; + break; + + case Commands.LINE_STYLE: + lineWidth = commandBuffer[index + 1]; + lineColor = commandBuffer[index + 2]; + lineAlpha = commandBuffer[index + 3]; + red = ((lineColor & 0xFF0000) >>> 16); + green = ((lineColor & 0xFF00) >>> 8); + blue = (lineColor & 0xFF); + ctx.strokeStyle = 'rgba(' + red + ',' + green + ',' + blue + ',' + lineAlpha + ')'; + ctx.lineWidth = lineWidth; + index += 3; + break; + + case Commands.FILL_STYLE: + fillColor = commandBuffer[index + 1]; + fillAlpha = commandBuffer[index + 2]; + red = ((fillColor & 0xFF0000) >>> 16); + green = ((fillColor & 0xFF00) >>> 8); + blue = (fillColor & 0xFF); + ctx.fillStyle = 'rgba(' + red + ',' + green + ',' + blue + ',' + fillAlpha + ')'; + index += 2; + break; + + case Commands.BEGIN_PATH: + ctx.beginPath(); + break; + + case Commands.CLOSE_PATH: + ctx.closePath(); + break; + + case Commands.FILL_PATH: + if (!allowClip) + { + ctx.fill(); + } + break; + + case Commands.STROKE_PATH: + if (!allowClip) + { + ctx.stroke(); + } + break; + + case Commands.FILL_RECT: + if (!allowClip) + { + ctx.fillRect( + commandBuffer[index + 1], + commandBuffer[index + 2], + commandBuffer[index + 3], + commandBuffer[index + 4] + ); + } + else + { + ctx.rect( + commandBuffer[index + 1], + commandBuffer[index + 2], + commandBuffer[index + 3], + commandBuffer[index + 4] + ); + } + index += 4; + break; + + case Commands.FILL_TRIANGLE: + ctx.beginPath(); + ctx.moveTo(commandBuffer[index + 1], commandBuffer[index + 2]); + ctx.lineTo(commandBuffer[index + 3], commandBuffer[index + 4]); + ctx.lineTo(commandBuffer[index + 5], commandBuffer[index + 6]); + ctx.closePath(); + if (!allowClip) + { + ctx.fill(); + } + index += 6; + break; + + case Commands.STROKE_TRIANGLE: + ctx.beginPath(); + ctx.moveTo(commandBuffer[index + 1], commandBuffer[index + 2]); + ctx.lineTo(commandBuffer[index + 3], commandBuffer[index + 4]); + ctx.lineTo(commandBuffer[index + 5], commandBuffer[index + 6]); + ctx.closePath(); + if (!allowClip) + { + ctx.stroke(); + } + index += 6; + break; + + case Commands.LINE_TO: + ctx.lineTo( + commandBuffer[index + 1], + commandBuffer[index + 2] + ); + index += 2; + break; + + case Commands.MOVE_TO: + ctx.moveTo( + commandBuffer[index + 1], + commandBuffer[index + 2] + ); + index += 2; + break; + + case Commands.LINE_FX_TO: + ctx.lineTo( + commandBuffer[index + 1], + commandBuffer[index + 2] + ); + index += 5; + break; + + case Commands.MOVE_FX_TO: + ctx.moveTo( + commandBuffer[index + 1], + commandBuffer[index + 2] + ); + index += 5; + break; + + case Commands.SAVE: + ctx.save(); + break; + + case Commands.RESTORE: + ctx.restore(); + break; + + case Commands.TRANSLATE: + ctx.translate( + commandBuffer[index + 1], + commandBuffer[index + 2] + ); + index += 2; + break; + + case Commands.SCALE: + ctx.scale( + commandBuffer[index + 1], + commandBuffer[index + 2] + ); + index += 2; + break; + + case Commands.ROTATE: + ctx.rotate( + commandBuffer[index + 1] + ); + index += 1; + break; + + case Commands.GRADIENT_FILL_STYLE: + index += 5; + break; + + case Commands.GRADIENT_LINE_STYLE: + index += 6; + break; + + case Commands.SET_TEXTURE: + index += 2; + break; + } + } + + // Restore the context saved in SetTransform + ctx.restore(); +}; + +module.exports = GraphicsCanvasRenderer; + + +/***/ }), +/* 372 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(2); + +/** + * @classdesc + * The GravityWell action applies a force on the particle to draw it towards, or repel it from, a single point. + * + * The force applied is inversely proportional to the square of the distance from the particle to the point, in accordance with Newton's law of gravity. + * + * This simulates the effect of gravity over large distances (as between planets, for example). + * + * @class GravityWell + * @memberof Phaser.GameObjects.Particles + * @constructor + * @since 3.0.0 + * + * @param {(number|Phaser.Types.GameObjects.Particles.GravityWellConfig)} [x=0] - The x coordinate of the Gravity Well, in world space. + * @param {number} [y=0] - The y coordinate of the Gravity Well, in world space. + * @param {number} [power=0] - The strength of the gravity force - larger numbers produce a stronger force. + * @param {number} [epsilon=100] - The minimum distance for which the gravity force is calculated. + * @param {number} [gravity=50] - The gravitational force of this Gravity Well. + */ +var GravityWell = new Class({ + + initialize: + + function GravityWell (x, y, power, epsilon, gravity) + { + if (typeof x === 'object') + { + var config = x; + + x = GetFastValue(config, 'x', 0); + y = GetFastValue(config, 'y', 0); + power = GetFastValue(config, 'power', 0); + epsilon = GetFastValue(config, 'epsilon', 100); + gravity = GetFastValue(config, 'gravity', 50); + } + else + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (power === undefined) { power = 0; } + if (epsilon === undefined) { epsilon = 100; } + if (gravity === undefined) { gravity = 50; } + } + + /** + * The x coordinate of the Gravity Well, in world space. + * + * @name Phaser.GameObjects.Particles.GravityWell#x + * @type {number} + * @since 3.0.0 + */ + this.x = x; + + /** + * The y coordinate of the Gravity Well, in world space. + * + * @name Phaser.GameObjects.Particles.GravityWell#y + * @type {number} + * @since 3.0.0 + */ + this.y = y; + + /** + * The active state of the Gravity Well. An inactive Gravity Well will not influence any particles. + * + * @name Phaser.GameObjects.Particles.GravityWell#active + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.active = true; + + /** + * Internal gravity value. + * + * @name Phaser.GameObjects.Particles.GravityWell#_gravity + * @type {number} + * @private + * @since 3.0.0 + */ + this._gravity = gravity; + + /** + * Internal power value. + * + * @name Phaser.GameObjects.Particles.GravityWell#_power + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._power = 0; + + /** + * Internal epsilon value. + * + * @name Phaser.GameObjects.Particles.GravityWell#_epsilon + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._epsilon = 0; + + /** + * The strength of the gravity force - larger numbers produce a stronger force. + * + * @name Phaser.GameObjects.Particles.GravityWell#power + * @type {number} + * @since 3.0.0 + */ + this.power = power; + + /** + * The minimum distance for which the gravity force is calculated. + * + * @name Phaser.GameObjects.Particles.GravityWell#epsilon + * @type {number} + * @since 3.0.0 + */ + this.epsilon = epsilon; + }, + + /** + * Takes a Particle and updates it based on the properties of this Gravity Well. + * + * @method Phaser.GameObjects.Particles.GravityWell#update + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.Particle} particle - The Particle to update. + * @param {number} delta - The delta time in ms. + * @param {number} step - The delta value divided by 1000. + */ + update: function (particle, delta) + { + var x = this.x - particle.x; + var y = this.y - particle.y; + var dSq = x * x + y * y; + + if (dSq === 0) + { + return; + } + + var d = Math.sqrt(dSq); + + if (dSq < this._epsilon) + { + dSq = this._epsilon; + } + + var factor = ((this._power * delta) / (dSq * d)) * 100; + + particle.velocityX += x * factor; + particle.velocityY += y * factor; + }, + + epsilon: { + + get: function () + { + return Math.sqrt(this._epsilon); + }, + + set: function (value) + { + this._epsilon = value * value; + } + + }, + + power: { + + get: function () + { + return this._power / this._gravity; + }, + + set: function (value) + { + this._power = value * this._gravity; + } + + }, + + gravity: { + + get: function () + { + return this._gravity; + }, + + set: function (value) + { + var pwr = this.power; + this._gravity = value; + this.power = pwr; + } + + } + +}); + +module.exports = GravityWell; + + +/***/ }), +/* 373 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var DegToRad = __webpack_require__(35); +var DistanceBetween = __webpack_require__(57); + +/** + * @classdesc + * A Particle is a simple Game Object controlled by a Particle Emitter and Manager, and rendered by the Manager. + * It uses its own lightweight physics system, and can interact only with its Emitter's bounds and zones. + * + * @class Particle + * @memberof Phaser.GameObjects.Particles + * @constructor + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - The Emitter to which this Particle belongs. + */ +var Particle = new Class({ + + initialize: + + function Particle (emitter) + { + /** + * The Emitter to which this Particle belongs. + * + * A Particle can only belong to a single Emitter and is created, updated and destroyed via it. + * + * @name Phaser.GameObjects.Particles.Particle#emitter + * @type {Phaser.GameObjects.Particles.ParticleEmitter} + * @since 3.0.0 + */ + this.emitter = emitter; + + /** + * The texture frame used to render this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#frame + * @type {Phaser.Textures.Frame} + * @default null + * @since 3.0.0 + */ + this.frame = null; + + /** + * The x coordinate of this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y coordinate of this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The x velocity of this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#velocityX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.velocityX = 0; + + /** + * The y velocity of this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#velocityY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.velocityY = 0; + + /** + * The x acceleration of this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#accelerationX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.accelerationX = 0; + + /** + * The y acceleration of this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#accelerationY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.accelerationY = 0; + + /** + * The maximum horizontal velocity this Particle can travel at. + * + * @name Phaser.GameObjects.Particles.Particle#maxVelocityX + * @type {number} + * @default 10000 + * @since 3.0.0 + */ + this.maxVelocityX = 10000; + + /** + * The maximum vertical velocity this Particle can travel at. + * + * @name Phaser.GameObjects.Particles.Particle#maxVelocityY + * @type {number} + * @default 10000 + * @since 3.0.0 + */ + this.maxVelocityY = 10000; + + /** + * The bounciness, or restitution, of this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#bounce + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.bounce = 0; + + /** + * The horizontal scale of this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#scaleX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.scaleX = 1; + + /** + * The vertical scale of this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#scaleY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.scaleY = 1; + + /** + * The alpha value of this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#alpha + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.alpha = 1; + + /** + * The angle of this Particle in degrees. + * + * @name Phaser.GameObjects.Particles.Particle#angle + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.angle = 0; + + /** + * The angle of this Particle in radians. + * + * @name Phaser.GameObjects.Particles.Particle#rotation + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.rotation = 0; + + /** + * The tint applied to this Particle. + * + * @name Phaser.GameObjects.Particles.Particle#tint + * @type {integer} + * @webglOnly + * @since 3.0.0 + */ + this.tint = 0xffffff; + + /** + * The lifespan of this Particle in ms. + * + * @name Phaser.GameObjects.Particles.Particle#life + * @type {number} + * @default 1000 + * @since 3.0.0 + */ + this.life = 1000; + + /** + * The current life of this Particle in ms. + * + * @name Phaser.GameObjects.Particles.Particle#lifeCurrent + * @type {number} + * @default 1000 + * @since 3.0.0 + */ + this.lifeCurrent = 1000; + + /** + * The delay applied to this Particle upon emission, in ms. + * + * @name Phaser.GameObjects.Particles.Particle#delayCurrent + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.delayCurrent = 0; + + /** + * The normalized lifespan T value, where 0 is the start and 1 is the end. + * + * @name Phaser.GameObjects.Particles.Particle#lifeT + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.lifeT = 0; + + /** + * The data used by the ease equation. + * + * @name Phaser.GameObjects.Particles.Particle#data + * @type {object} + * @since 3.0.0 + */ + this.data = { + tint: { min: 0xffffff, max: 0xffffff, current: 0xffffff }, + alpha: { min: 1, max: 1 }, + rotate: { min: 0, max: 0 }, + scaleX: { min: 1, max: 1 }, + scaleY: { min: 1, max: 1 } + }; + }, + + /** + * Checks to see if this Particle is alive and updating. + * + * @method Phaser.GameObjects.Particles.Particle#isAlive + * @since 3.0.0 + * + * @return {boolean} `true` if this Particle is alive and updating, otherwise `false`. + */ + isAlive: function () + { + return (this.lifeCurrent > 0); + }, + + /** + * Resets the position of this particle back to zero. + * + * @method Phaser.GameObjects.Particles.Particle#resetPosition + * @since 3.16.0 + */ + resetPosition: function () + { + this.x = 0; + this.y = 0; + }, + + /** + * Starts this Particle from the given coordinates. + * + * @method Phaser.GameObjects.Particles.Particle#fire + * @since 3.0.0 + * + * @param {number} x - The x coordinate to launch this Particle from. + * @param {number} y - The y coordinate to launch this Particle from. + */ + fire: function (x, y) + { + var emitter = this.emitter; + + this.frame = emitter.getFrame(); + + if (emitter.emitZone) + { + // Updates particle.x and particle.y during this call + emitter.emitZone.getPoint(this); + } + + if (x === undefined) + { + if (emitter.follow) + { + this.x += emitter.follow.x + emitter.followOffset.x; + } + + this.x += emitter.x.onEmit(this, 'x'); + } + else + { + this.x += x; + } + + if (y === undefined) + { + if (emitter.follow) + { + this.y += emitter.follow.y + emitter.followOffset.y; + } + + this.y += emitter.y.onEmit(this, 'y'); + } + else + { + this.y += y; + } + + this.life = emitter.lifespan.onEmit(this, 'lifespan'); + this.lifeCurrent = this.life; + this.lifeT = 0; + + var sx = emitter.speedX.onEmit(this, 'speedX'); + var sy = (emitter.speedY) ? emitter.speedY.onEmit(this, 'speedY') : sx; + + if (emitter.radial) + { + var rad = DegToRad(emitter.angle.onEmit(this, 'angle')); + + this.velocityX = Math.cos(rad) * Math.abs(sx); + this.velocityY = Math.sin(rad) * Math.abs(sy); + } + else if (emitter.moveTo) + { + var mx = emitter.moveToX.onEmit(this, 'moveToX'); + var my = (emitter.moveToY) ? emitter.moveToY.onEmit(this, 'moveToY') : mx; + + var angle = Math.atan2(my - this.y, mx - this.x); + + var speed = DistanceBetween(this.x, this.y, mx, my) / (this.life / 1000); + + // We know how many pixels we need to move, but how fast? + // var speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000); + + this.velocityX = Math.cos(angle) * speed; + this.velocityY = Math.sin(angle) * speed; + } + else + { + this.velocityX = sx; + this.velocityY = sy; + } + + if (emitter.acceleration) + { + this.accelerationX = emitter.accelerationX.onEmit(this, 'accelerationX'); + this.accelerationY = emitter.accelerationY.onEmit(this, 'accelerationY'); + } + + this.maxVelocityX = emitter.maxVelocityX.onEmit(this, 'maxVelocityX'); + this.maxVelocityY = emitter.maxVelocityY.onEmit(this, 'maxVelocityY'); + + this.delayCurrent = emitter.delay.onEmit(this, 'delay'); + + this.scaleX = emitter.scaleX.onEmit(this, 'scaleX'); + this.scaleY = (emitter.scaleY) ? emitter.scaleY.onEmit(this, 'scaleY') : this.scaleX; + + this.angle = emitter.rotate.onEmit(this, 'rotate'); + this.rotation = DegToRad(this.angle); + + this.bounce = emitter.bounce.onEmit(this, 'bounce'); + + this.alpha = emitter.alpha.onEmit(this, 'alpha'); + + this.tint = emitter.tint.onEmit(this, 'tint'); + }, + + /** + * An internal method that calculates the velocity of the Particle. + * + * @method Phaser.GameObjects.Particles.Particle#computeVelocity + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - The Emitter that is updating this Particle. + * @param {number} delta - The delta time in ms. + * @param {number} step - The delta value divided by 1000. + * @param {array} processors - Particle processors (gravity wells). + */ + computeVelocity: function (emitter, delta, step, processors) + { + var vx = this.velocityX; + var vy = this.velocityY; + + var ax = this.accelerationX; + var ay = this.accelerationY; + + var mx = this.maxVelocityX; + var my = this.maxVelocityY; + + vx += (emitter.gravityX * step); + vy += (emitter.gravityY * step); + + if (ax) + { + vx += (ax * step); + } + + if (ay) + { + vy += (ay * step); + } + + if (vx > mx) + { + vx = mx; + } + else if (vx < -mx) + { + vx = -mx; + } + + if (vy > my) + { + vy = my; + } + else if (vy < -my) + { + vy = -my; + } + + this.velocityX = vx; + this.velocityY = vy; + + // Apply any additional processors + for (var i = 0; i < processors.length; i++) + { + processors[i].update(this, delta, step); + } + }, + + /** + * Checks if this Particle is still within the bounds defined by the given Emitter. + * + * If not, and depending on the Emitter collision flags, the Particle may either stop or rebound. + * + * @method Phaser.GameObjects.Particles.Particle#checkBounds + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - The Emitter to check the bounds against. + */ + checkBounds: function (emitter) + { + var bounds = emitter.bounds; + var bounce = -this.bounce; + + if (this.x < bounds.x && emitter.collideLeft) + { + this.x = bounds.x; + this.velocityX *= bounce; + } + else if (this.x > bounds.right && emitter.collideRight) + { + this.x = bounds.right; + this.velocityX *= bounce; + } + + if (this.y < bounds.y && emitter.collideTop) + { + this.y = bounds.y; + this.velocityY *= bounce; + } + else if (this.y > bounds.bottom && emitter.collideBottom) + { + this.y = bounds.bottom; + this.velocityY *= bounce; + } + }, + + /** + * The main update method for this Particle. + * + * Updates its life values, computes the velocity and repositions the Particle. + * + * @method Phaser.GameObjects.Particles.Particle#update + * @since 3.0.0 + * + * @param {number} delta - The delta time in ms. + * @param {number} step - The delta value divided by 1000. + * @param {array} processors - An optional array of update processors. + * + * @return {boolean} Returns `true` if this Particle has now expired and should be removed, otherwise `false` if still active. + */ + update: function (delta, step, processors) + { + if (this.delayCurrent > 0) + { + this.delayCurrent -= delta; + + return false; + } + + var emitter = this.emitter; + + // How far along in life is this particle? (t = 0 to 1) + var t = 1 - (this.lifeCurrent / this.life); + + this.lifeT = t; + + this.computeVelocity(emitter, delta, step, processors); + + this.x += this.velocityX * step; + this.y += this.velocityY * step; + + if (emitter.bounds) + { + this.checkBounds(emitter); + } + + if (emitter.deathZone && emitter.deathZone.willKill(this)) + { + this.lifeCurrent = 0; + + // No need to go any further, particle has been killed + return true; + } + + this.scaleX = emitter.scaleX.onUpdate(this, 'scaleX', t, this.scaleX); + + if (emitter.scaleY) + { + this.scaleY = emitter.scaleY.onUpdate(this, 'scaleY', t, this.scaleY); + } + else + { + this.scaleY = this.scaleX; + } + + this.angle = emitter.rotate.onUpdate(this, 'rotate', t, this.angle); + this.rotation = DegToRad(this.angle); + + this.alpha = emitter.alpha.onUpdate(this, 'alpha', t, this.alpha); + + this.tint = emitter.tint.onUpdate(this, 'tint', t, this.tint); + + this.lifeCurrent -= delta; + + return (this.lifeCurrent <= 0); + } + +}); + +module.exports = Particle; + + +/***/ }), +/* 374 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(52); +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var DeathZone = __webpack_require__(375); +var EdgeZone = __webpack_require__(376); +var EmitterOp = __webpack_require__(933); +var GetFastValue = __webpack_require__(2); +var GetRandom = __webpack_require__(180); +var HasAny = __webpack_require__(377); +var HasValue = __webpack_require__(97); +var Particle = __webpack_require__(373); +var RandomZone = __webpack_require__(378); +var Rectangle = __webpack_require__(10); +var StableSort = __webpack_require__(127); +var Vector2 = __webpack_require__(4); +var Wrap = __webpack_require__(56); + +/** + * @classdesc + * A particle emitter represents a single particle stream. + * It controls a pool of {@link Phaser.GameObjects.Particles.Particle Particles} and is controlled by a {@link Phaser.GameObjects.Particles.ParticleEmitterManager Particle Emitter Manager}. + * + * @class ParticleEmitter + * @memberof Phaser.GameObjects.Particles + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.GameObjects.Particles.ParticleEmitterManager} manager - The Emitter Manager this Emitter belongs to. + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} config - Settings for this emitter. + */ +var ParticleEmitter = new Class({ + + Mixins: [ + Components.BlendMode, + Components.Mask, + Components.ScrollFactor, + Components.Visible + ], + + initialize: + + function ParticleEmitter (manager, config) + { + /** + * The Emitter Manager this Emitter belongs to. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#manager + * @type {Phaser.GameObjects.Particles.ParticleEmitterManager} + * @since 3.0.0 + */ + this.manager = manager; + + /** + * The texture assigned to particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#texture + * @type {Phaser.Textures.Texture} + * @since 3.0.0 + */ + this.texture = manager.texture; + + /** + * The texture frames assigned to particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#frames + * @type {Phaser.Textures.Frame[]} + * @since 3.0.0 + */ + this.frames = [ manager.defaultFrame ]; + + /** + * The default texture frame assigned to particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#defaultFrame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + this.defaultFrame = manager.defaultFrame; + + /** + * Names of simple configuration properties. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#configFastMap + * @type {object} + * @since 3.0.0 + */ + this.configFastMap = [ + 'active', + 'blendMode', + 'collideBottom', + 'collideLeft', + 'collideRight', + 'collideTop', + 'deathCallback', + 'deathCallbackScope', + 'emitCallback', + 'emitCallbackScope', + 'follow', + 'frequency', + 'gravityX', + 'gravityY', + 'maxParticles', + 'name', + 'on', + 'particleBringToTop', + 'particleClass', + 'radial', + 'timeScale', + 'trackVisible', + 'visible' + ]; + + /** + * Names of complex configuration properties. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#configOpMap + * @type {object} + * @since 3.0.0 + */ + this.configOpMap = [ + 'accelerationX', + 'accelerationY', + 'angle', + 'alpha', + 'bounce', + 'delay', + 'lifespan', + 'maxVelocityX', + 'maxVelocityY', + 'moveToX', + 'moveToY', + 'quantity', + 'rotate', + 'scaleX', + 'scaleY', + 'speedX', + 'speedY', + 'tint', + 'x', + 'y' + ]; + + /** + * The name of this Particle Emitter. + * + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#name + * @type {string} + * @default '' + * @since 3.0.0 + */ + this.name = ''; + + /** + * The Particle Class which will be emitted by this Emitter. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#particleClass + * @type {Phaser.GameObjects.Particles.Particle} + * @default Phaser.GameObjects.Particles.Particle + * @since 3.0.0 + */ + this.particleClass = Particle; + + /** + * The x-coordinate of the particle origin (where particles will be emitted). + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#x + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setPosition + */ + this.x = new EmitterOp(config, 'x', 0, true); + + /** + * The y-coordinate of the particle origin (where particles will be emitted). + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#y + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setPosition + */ + this.y = new EmitterOp(config, 'y', 0, true); + + /** + * A radial emitter will emit particles in all directions between angle min and max, + * using {@link Phaser.GameObjects.Particles.ParticleEmitter#speed} as the value. If set to false then this acts as a point Emitter. + * A point emitter will emit particles only in the direction derived from the speedX and speedY values. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#radial + * @type {boolean} + * @default true + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setRadial + */ + this.radial = true; + + /** + * Horizontal acceleration applied to emitted particles, in pixels per second squared. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#gravityX + * @type {number} + * @default 0 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setGravity + */ + this.gravityX = 0; + + /** + * Vertical acceleration applied to emitted particles, in pixels per second squared. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#gravityY + * @type {number} + * @default 0 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setGravity + */ + this.gravityY = 0; + + /** + * Whether accelerationX and accelerationY are non-zero. Set automatically during configuration. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#acceleration + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.acceleration = false; + + /** + * Horizontal acceleration applied to emitted particles, in pixels per second squared. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#accelerationX + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + */ + this.accelerationX = new EmitterOp(config, 'accelerationX', 0, true); + + /** + * Vertical acceleration applied to emitted particles, in pixels per second squared. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#accelerationY + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + */ + this.accelerationY = new EmitterOp(config, 'accelerationY', 0, true); + + /** + * The maximum horizontal velocity of emitted particles, in pixels per second squared. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityX + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 10000 + * @since 3.0.0 + */ + this.maxVelocityX = new EmitterOp(config, 'maxVelocityX', 10000, true); + + /** + * The maximum vertical velocity of emitted particles, in pixels per second squared. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityY + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 10000 + * @since 3.0.0 + */ + this.maxVelocityY = new EmitterOp(config, 'maxVelocityY', 10000, true); + + /** + * The initial horizontal speed of emitted particles, in pixels per second. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#speedX + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setSpeedX + */ + this.speedX = new EmitterOp(config, 'speedX', 0, true); + + /** + * The initial vertical speed of emitted particles, in pixels per second. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#speedY + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setSpeedY + */ + this.speedY = new EmitterOp(config, 'speedY', 0, true); + + /** + * Whether moveToX and moveToY are nonzero. Set automatically during configuration. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#moveTo + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.moveTo = false; + + /** + * The x-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#moveToX + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + */ + this.moveToX = new EmitterOp(config, 'moveToX', 0, true); + + /** + * The y-coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#moveToY + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + */ + this.moveToY = new EmitterOp(config, 'moveToY', 0, true); + + /** + * Whether particles will rebound when they meet the emitter bounds. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#bounce + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + */ + this.bounce = new EmitterOp(config, 'bounce', 0, true); + + /** + * The horizontal scale of emitted particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#scaleX + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 1 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setScale + * @see Phaser.GameObjects.Particles.ParticleEmitter#setScaleX + */ + this.scaleX = new EmitterOp(config, 'scaleX', 1); + + /** + * The vertical scale of emitted particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#scaleY + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 1 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setScale + * @see Phaser.GameObjects.Particles.ParticleEmitter#setScaleY + */ + this.scaleY = new EmitterOp(config, 'scaleY', 1); + + /** + * Color tint applied to emitted particles. Any alpha component (0xAA000000) is ignored. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#tint + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0xffffffff + * @since 3.0.0 + */ + this.tint = new EmitterOp(config, 'tint', 0xffffffff); + + /** + * The alpha (transparency) of emitted particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#alpha + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 1 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setAlpha + */ + this.alpha = new EmitterOp(config, 'alpha', 1); + + /** + * The lifespan of emitted particles, in ms. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#lifespan + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 1000 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setLifespan + */ + this.lifespan = new EmitterOp(config, 'lifespan', 1000, true); + + /** + * The angle of the initial velocity of emitted particles, in degrees. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#angle + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default { min: 0, max: 360 } + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setAngle + */ + this.angle = new EmitterOp(config, 'angle', { min: 0, max: 360 }, true); + + /** + * The rotation of emitted particles, in degrees. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#rotate + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + */ + this.rotate = new EmitterOp(config, 'rotate', 0); + + /** + * A function to call when a particle is emitted. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#emitCallback + * @type {?Phaser.Types.GameObjects.Particles.ParticleEmitterCallback} + * @default null + * @since 3.0.0 + */ + this.emitCallback = null; + + /** + * The calling context for {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallback}. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#emitCallbackScope + * @type {?*} + * @default null + * @since 3.0.0 + */ + this.emitCallbackScope = null; + + /** + * A function to call when a particle dies. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#deathCallback + * @type {?Phaser.Types.GameObjects.Particles.ParticleDeathCallback} + * @default null + * @since 3.0.0 + */ + this.deathCallback = null; + + /** + * The calling context for {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallback}. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#deathCallbackScope + * @type {?*} + * @default null + * @since 3.0.0 + */ + this.deathCallbackScope = null; + + /** + * Set to hard limit the amount of particle objects this emitter is allowed to create. + * 0 means unlimited. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#maxParticles + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.maxParticles = 0; + + /** + * How many particles are emitted each time particles are emitted (one explosion or one flow cycle). + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#quantity + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 1 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrequency + * @see Phaser.GameObjects.Particles.ParticleEmitter#setQuantity + */ + this.quantity = new EmitterOp(config, 'quantity', 1, true); + + /** + * How many ms to wait after emission before the particles start updating. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#delay + * @type {Phaser.GameObjects.Particles.EmitterOp} + * @default 0 + * @since 3.0.0 + */ + this.delay = new EmitterOp(config, 'delay', 0, true); + + /** + * For a flow emitter, the time interval (>= 0) between particle flow cycles in ms. + * A value of 0 means there is one particle flow cycle for each logic update (the maximum flow frequency). This is the default setting. + * For an exploding emitter, this value will be -1. + * Calling {@link Phaser.GameObjects.Particles.ParticleEmitter#flow} also puts the emitter in flow mode (frequency >= 0). + * Calling {@link Phaser.GameObjects.Particles.ParticleEmitter#explode} also puts the emitter in explode mode (frequency = -1). + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#frequency + * @type {number} + * @default 0 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrequency + */ + this.frequency = 0; + + /** + * Controls if the emitter is currently emitting a particle flow (when frequency >= 0). + * Already alive particles will continue to update until they expire. + * Controlled by {@link Phaser.GameObjects.Particles.ParticleEmitter#start} and {@link Phaser.GameObjects.Particles.ParticleEmitter#stop}. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#on + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.on = true; + + /** + * Newly emitted particles are added to the top of the particle list, i.e. rendered above those already alive. + * Set to false to send them to the back. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#particleBringToTop + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.particleBringToTop = true; + + /** + * The time rate applied to active particles, affecting lifespan, movement, and tweens. Values larger than 1 are faster than normal. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#timeScale + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.timeScale = 1; + + /** + * An object describing a shape to emit particles from. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#emitZone + * @type {?Phaser.GameObjects.Particles.Zones.EdgeZone|Phaser.GameObjects.Particles.Zones.RandomZone} + * @default null + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone + */ + this.emitZone = null; + + /** + * An object describing a shape that deactivates particles when they interact with it. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#deathZone + * @type {?Phaser.GameObjects.Particles.Zones.DeathZone} + * @default null + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setDeathZone + */ + this.deathZone = null; + + /** + * A rectangular boundary constraining particle movement. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#bounds + * @type {?Phaser.Geom.Rectangle} + * @default null + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setBounds + */ + this.bounds = null; + + /** + * Whether particles interact with the left edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#collideLeft + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.collideLeft = true; + + /** + * Whether particles interact with the right edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#collideRight + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.collideRight = true; + + /** + * Whether particles interact with the top edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#collideTop + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.collideTop = true; + + /** + * Whether particles interact with the bottom edge of the emitter {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds}. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#collideBottom + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.collideBottom = true; + + /** + * Whether this emitter updates itself and its particles. + * + * Controlled by {@link Phaser.GameObjects.Particles.ParticleEmitter#pause} + * and {@link Phaser.GameObjects.Particles.ParticleEmitter#resume}. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#active + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.active = true; + + /** + * Set this to false to hide any active particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#visible + * @type {boolean} + * @default true + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setVisible + */ + this.visible = true; + + /** + * The blend mode of this emitter's particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#blendMode + * @type {integer} + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setBlendMode + */ + this.blendMode = BlendModes.NORMAL; + + /** + * A Game Object whose position is used as the particle origin. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#follow + * @type {?Phaser.GameObjects.GameObject} + * @default null + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#startFollow + * @see Phaser.GameObjects.Particles.ParticleEmitter#stopFollow + */ + this.follow = null; + + /** + * The offset of the particle origin from the {@link Phaser.GameObjects.Particles.ParticleEmitter#follow} target. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#followOffset + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#startFollow + */ + this.followOffset = new Vector2(); + + /** + * Whether the emitter's {@link Phaser.GameObjects.Particles.ParticleEmitter#visible} state will track + * the {@link Phaser.GameObjects.Particles.ParticleEmitter#follow} target's visibility state. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#trackVisible + * @type {boolean} + * @default false + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#startFollow + */ + this.trackVisible = false; + + /** + * The current texture frame, as an index of {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#currentFrame + * @type {integer} + * @default 0 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame + */ + this.currentFrame = 0; + + /** + * Whether texture {@link Phaser.GameObjects.Particles.ParticleEmitter#frames} are selected at random. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#randomFrame + * @type {boolean} + * @default true + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame + */ + this.randomFrame = true; + + /** + * The number of consecutive particles that receive a single texture frame (per frame cycle). + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#frameQuantity + * @type {integer} + * @default 1 + * @since 3.0.0 + * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame + */ + this.frameQuantity = 1; + + /** + * Inactive particles. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#dead + * @type {Phaser.GameObjects.Particles.Particle[]} + * @private + * @since 3.0.0 + */ + this.dead = []; + + /** + * Active particles + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#alive + * @type {Phaser.GameObjects.Particles.Particle[]} + * @private + * @since 3.0.0 + */ + this.alive = []; + + /** + * The time until the next flow cycle. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#_counter + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._counter = 0; + + /** + * Counts up to {@link Phaser.GameObjects.Particles.ParticleEmitter#frameQuantity}. + * + * @name Phaser.GameObjects.Particles.ParticleEmitter#_frameCounter + * @type {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + this._frameCounter = 0; + + if (config) + { + this.fromJSON(config); + } + }, + + /** + * Merges configuration settings into the emitter's current settings. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#fromJSON + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} config - Settings for this emitter. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + fromJSON: function (config) + { + if (!config) + { + return this; + } + + // Only update properties from their current state if they exist in the given config + + var i = 0; + var key = ''; + + for (i = 0; i < this.configFastMap.length; i++) + { + key = this.configFastMap[i]; + + if (HasValue(config, key)) + { + this[key] = GetFastValue(config, key); + } + } + + for (i = 0; i < this.configOpMap.length; i++) + { + key = this.configOpMap[i]; + + if (HasValue(config, key)) + { + this[key].loadConfig(config); + } + } + + this.acceleration = (this.accelerationX.propertyValue !== 0 || this.accelerationY.propertyValue !== 0); + + this.moveTo = (this.moveToX.propertyValue !== 0 || this.moveToY.propertyValue !== 0); + + // Special 'speed' override + + if (HasValue(config, 'speed')) + { + this.speedX.loadConfig(config, 'speed'); + this.speedY = null; + } + + // If you specify speedX, speedY or moveTo then it changes the emitter from radial to a point emitter + if (HasAny(config, [ 'speedX', 'speedY' ]) || this.moveTo) + { + this.radial = false; + } + + // Special 'scale' override + + if (HasValue(config, 'scale')) + { + this.scaleX.loadConfig(config, 'scale'); + this.scaleY = null; + } + + if (HasValue(config, 'callbackScope')) + { + var callbackScope = GetFastValue(config, 'callbackScope', null); + + this.emitCallbackScope = callbackScope; + this.deathCallbackScope = callbackScope; + } + + if (HasValue(config, 'emitZone')) + { + this.setEmitZone(config.emitZone); + } + + if (HasValue(config, 'deathZone')) + { + this.setDeathZone(config.deathZone); + } + + if (HasValue(config, 'bounds')) + { + this.setBounds(config.bounds); + } + + if (HasValue(config, 'followOffset')) + { + this.followOffset.setFromObject(GetFastValue(config, 'followOffset', 0)); + } + + if (HasValue(config, 'frame')) + { + this.setFrame(config.frame); + } + + return this; + }, + + /** + * Creates a description of this emitter suitable for JSON serialization. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#toJSON + * @since 3.0.0 + * + * @param {object} [output] - An object to copy output into. + * + * @return {object} - The output object. + */ + toJSON: function (output) + { + if (output === undefined) { output = {}; } + + var i = 0; + var key = ''; + + for (i = 0; i < this.configFastMap.length; i++) + { + key = this.configFastMap[i]; + + output[key] = this[key]; + } + + for (i = 0; i < this.configOpMap.length; i++) + { + key = this.configOpMap[i]; + + if (this[key]) + { + output[key] = this[key].toJSON(); + } + } + + // special handlers + if (!this.speedY) + { + delete output.speedX; + output.speed = this.speedX.toJSON(); + } + + if (!this.scaleY) + { + delete output.scaleX; + output.scale = this.scaleX.toJSON(); + } + + return output; + }, + + /** + * Continuously moves the particle origin to follow a Game Object's position. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#startFollow + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} target - The Game Object to follow. + * @param {number} [offsetX=0] - Horizontal offset of the particle origin from the Game Object. + * @param {number} [offsetY=0] - Vertical offset of the particle origin from the Game Object. + * @param {boolean} [trackVisible=false] - Whether the emitter's visible state will track the target's visible state. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + startFollow: function (target, offsetX, offsetY, trackVisible) + { + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + if (trackVisible === undefined) { trackVisible = false; } + + this.follow = target; + this.followOffset.set(offsetX, offsetY); + this.trackVisible = trackVisible; + + return this; + }, + + /** + * Stops following a Game Object. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#stopFollow + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + stopFollow: function () + { + this.follow = null; + this.followOffset.set(0, 0); + this.trackVisible = false; + + return this; + }, + + /** + * Chooses a texture frame from {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#getFrame + * @since 3.0.0 + * + * @return {Phaser.Textures.Frame} The texture frame. + */ + getFrame: function () + { + if (this.frames.length === 1) + { + return this.defaultFrame; + } + else if (this.randomFrame) + { + return GetRandom(this.frames); + } + else + { + var frame = this.frames[this.currentFrame]; + + this._frameCounter++; + + if (this._frameCounter === this.frameQuantity) + { + this._frameCounter = 0; + this.currentFrame = Wrap(this.currentFrame + 1, 0, this._frameLength); + } + + return frame; + } + }, + + // frame: 0 + // frame: 'red' + // frame: [ 0, 1, 2, 3 ] + // frame: [ 'red', 'green', 'blue', 'pink', 'white' ] + // frame: { frames: [ 'red', 'green', 'blue', 'pink', 'white' ], [cycle: bool], [quantity: int] } + + /** + * Sets a pattern for assigning texture frames to emitted particles. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setFrame + * @since 3.0.0 + * + * @param {(array|string|integer|Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig)} frames - One or more texture frames, or a configuration object. + * @param {boolean} [pickRandom=true] - Whether frames should be assigned at random from `frames`. + * @param {integer} [quantity=1] - The number of consecutive particles that will receive each frame. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setFrame: function (frames, pickRandom, quantity) + { + if (pickRandom === undefined) { pickRandom = true; } + if (quantity === undefined) { quantity = 1; } + + this.randomFrame = pickRandom; + this.frameQuantity = quantity; + this.currentFrame = 0; + this._frameCounter = 0; + + var t = typeof (frames); + + if (Array.isArray(frames) || t === 'string' || t === 'number') + { + this.manager.setEmitterFrames(frames, this); + } + else if (t === 'object') + { + var frameConfig = frames; + + frames = GetFastValue(frameConfig, 'frames', null); + + if (frames) + { + this.manager.setEmitterFrames(frames, this); + } + + var isCycle = GetFastValue(frameConfig, 'cycle', false); + + this.randomFrame = (isCycle) ? false : true; + + this.frameQuantity = GetFastValue(frameConfig, 'quantity', quantity); + } + + this._frameLength = this.frames.length; + + if (this._frameLength === 1) + { + this.frameQuantity = 1; + this.randomFrame = false; + } + + return this; + }, + + /** + * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle movement on or off. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setRadial + * @since 3.0.0 + * + * @param {boolean} [value=true] - Radial mode (true) or point mode (true). + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setRadial: function (value) + { + if (value === undefined) { value = true; } + + this.radial = value; + + return this; + }, + + /** + * Sets the position of the emitter's particle origin. + * New particles will be emitted here. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setPosition + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} x - The x-coordinate of the particle origin. + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} y - The y-coordinate of the particle origin. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setPosition: function (x, y) + { + this.x.onChange(x); + this.y.onChange(y); + + return this; + }, + + /** + * Sets or modifies a rectangular boundary constraining the particles. + * + * To remove the boundary, set {@link Phaser.GameObjects.Particles.ParticleEmitter#bounds} to null. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setBounds + * @since 3.0.0 + * + * @param {(number|Phaser.Types.GameObjects.Particles.ParticleEmitterBounds|Phaser.Types.GameObjects.Particles.ParticleEmitterBoundsAlt)} x - The x-coordinate of the left edge of the boundary, or an object representing a rectangle. + * @param {number} y - The y-coordinate of the top edge of the boundary. + * @param {number} width - The width of the boundary. + * @param {number} height - The height of the boundary. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setBounds: function (x, y, width, height) + { + if (typeof x === 'object') + { + var obj = x; + + x = obj.x; + y = obj.y; + width = (HasValue(obj, 'w')) ? obj.w : obj.width; + height = (HasValue(obj, 'h')) ? obj.h : obj.height; + } + + if (this.bounds) + { + this.bounds.setTo(x, y, width, height); + } + else + { + this.bounds = new Rectangle(x, y, width, height); + } + + return this; + }, + + /** + * Sets the initial horizontal speed of emitted particles. + * Changes the emitter to point mode. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setSpeedX + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The speed, in pixels per second. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setSpeedX: function (value) + { + this.speedX.onChange(value); + + // If you specify speedX and Y then it changes the emitter from radial to a point emitter + this.radial = false; + + return this; + }, + + /** + * Sets the initial vertical speed of emitted particles. + * Changes the emitter to point mode. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setSpeedY + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The speed, in pixels per second. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setSpeedY: function (value) + { + if (this.speedY) + { + this.speedY.onChange(value); + + // If you specify speedX and Y then it changes the emitter from radial to a point emitter + this.radial = false; + } + + return this; + }, + + /** + * Sets the initial radial speed of emitted particles. + * Changes the emitter to radial mode. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setSpeed + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The speed, in pixels per second. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setSpeed: function (value) + { + this.speedX.onChange(value); + this.speedY = null; + + // If you specify speedX and Y then it changes the emitter from radial to a point emitter + this.radial = true; + + return this; + }, + + /** + * Sets the horizontal scale of emitted particles. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setScaleX + * @since 3.0.0 + * + * @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - The scale, relative to 1. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setScaleX: function (value) + { + this.scaleX.onChange(value); + + return this; + }, + + /** + * Sets the vertical scale of emitted particles. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setScaleY + * @since 3.0.0 + * + * @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - The scale, relative to 1. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setScaleY: function (value) + { + this.scaleY.onChange(value); + + return this; + }, + + /** + * Sets the scale of emitted particles. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setScale + * @since 3.0.0 + * + * @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - The scale, relative to 1. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setScale: function (value) + { + this.scaleX.onChange(value); + this.scaleY = null; + + return this; + }, + + /** + * Sets the horizontal gravity applied to emitted particles. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setGravityX + * @since 3.0.0 + * + * @param {number} value - Acceleration due to gravity, in pixels per second squared. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setGravityX: function (value) + { + this.gravityX = value; + + return this; + }, + + /** + * Sets the vertical gravity applied to emitted particles. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setGravityY + * @since 3.0.0 + * + * @param {number} value - Acceleration due to gravity, in pixels per second squared. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setGravityY: function (value) + { + this.gravityY = value; + + return this; + }, + + /** + * Sets the gravity applied to emitted particles. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setGravity + * @since 3.0.0 + * + * @param {number} x - Horizontal acceleration due to gravity, in pixels per second squared. + * @param {number} y - Vertical acceleration due to gravity, in pixels per second squared. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setGravity: function (x, y) + { + this.gravityX = x; + this.gravityY = y; + + return this; + }, + + /** + * Sets the opacity of emitted particles. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setAlpha + * @since 3.0.0 + * + * @param {(Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType|Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateType)} value - A value between 0 (transparent) and 1 (opaque). + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setAlpha: function (value) + { + this.alpha.onChange(value); + + return this; + }, + + /** + * Sets the angle of a {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle stream. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setEmitterAngle + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The angle of the initial velocity of emitted particles. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setEmitterAngle: function (value) + { + this.angle.onChange(value); + + return this; + }, + + /** + * Sets the angle of a {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle stream. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setAngle + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The angle of the initial velocity of emitted particles. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setAngle: function (value) + { + this.angle.onChange(value); + + return this; + }, + + /** + * Sets the lifespan of newly emitted particles. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setLifespan + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} value - The particle lifespan, in ms. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setLifespan: function (value) + { + this.lifespan.onChange(value); + + return this; + }, + + /** + * Sets the number of particles released at each flow cycle or explosion. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setQuantity + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} quantity - The number of particles to release at each flow cycle or explosion. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setQuantity: function (quantity) + { + this.quantity.onChange(quantity); + + return this; + }, + + /** + * Sets the emitter's {@link Phaser.GameObjects.Particles.ParticleEmitter#frequency} + * and {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setFrequency + * @since 3.0.0 + * + * @param {number} frequency - The time interval (>= 0) of each flow cycle, in ms; or -1 to put the emitter in explosion mode. + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} [quantity] - The number of particles to release at each flow cycle or explosion. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setFrequency: function (frequency, quantity) + { + this.frequency = frequency; + + this._counter = 0; + + if (quantity) + { + this.quantity.onChange(quantity); + } + + return this; + }, + + /** + * Sets or removes the {@link Phaser.GameObjects.Particles.ParticleEmitter#emitZone}. + * + * An {@link Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig EdgeZone} places particles on its edges. Its {@link Phaser.Types.GameObjects.Particles.EdgeZoneSource source} can be a Curve, Path, Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback getPoints} method. + * + * A {@link Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig RandomZone} places randomly within its interior. Its {@link RandomZoneSource source} can be a Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback getRandomPoint} method. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig} [zoneConfig] - An object describing the zone, or `undefined` to remove any current emit zone. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setEmitZone: function (zoneConfig) + { + if (zoneConfig === undefined) + { + this.emitZone = null; + } + else + { + // Where source = Geom like Circle, or a Path or Curve + // emitZone: { type: 'random', source: X } + // emitZone: { type: 'edge', source: X, quantity: 32, [stepRate=0], [yoyo=false], [seamless=true] } + + var type = GetFastValue(zoneConfig, 'type', 'random'); + var source = GetFastValue(zoneConfig, 'source', null); + + switch (type) + { + case 'random': + + this.emitZone = new RandomZone(source); + + break; + + case 'edge': + + var quantity = GetFastValue(zoneConfig, 'quantity', 1); + var stepRate = GetFastValue(zoneConfig, 'stepRate', 0); + var yoyo = GetFastValue(zoneConfig, 'yoyo', false); + var seamless = GetFastValue(zoneConfig, 'seamless', true); + + this.emitZone = new EdgeZone(source, quantity, stepRate, yoyo, seamless); + + break; + } + } + + return this; + }, + + /** + * Sets or removes the {@link Phaser.GameObjects.Particles.ParticleEmitter#deathZone}. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#setDeathZone + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterDeathZoneConfig} [zoneConfig] - An object describing the zone, or `undefined` to remove any current death zone. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + setDeathZone: function (zoneConfig) + { + if (zoneConfig === undefined) + { + this.deathZone = null; + } + else + { + // Where source = Geom like Circle or Rect that supports a 'contains' function + // deathZone: { type: 'onEnter', source: X } + // deathZone: { type: 'onLeave', source: X } + + var type = GetFastValue(zoneConfig, 'type', 'onEnter'); + var source = GetFastValue(zoneConfig, 'source', null); + + if (source && typeof source.contains === 'function') + { + var killOnEnter = (type === 'onEnter') ? true : false; + + this.deathZone = new DeathZone(source, killOnEnter); + } + } + + return this; + }, + + /** + * Creates inactive particles and adds them to this emitter's pool. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#reserve + * @since 3.0.0 + * + * @param {integer} particleCount - The number of particles to create. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + reserve: function (particleCount) + { + var dead = this.dead; + + for (var i = 0; i < particleCount; i++) + { + dead.push(new this.particleClass(this)); + } + + return this; + }, + + /** + * Gets the number of active (in-use) particles in this emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#getAliveParticleCount + * @since 3.0.0 + * + * @return {integer} The number of particles with `active=true`. + */ + getAliveParticleCount: function () + { + return this.alive.length; + }, + + /** + * Gets the number of inactive (available) particles in this emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#getDeadParticleCount + * @since 3.0.0 + * + * @return {integer} The number of particles with `active=false`. + */ + getDeadParticleCount: function () + { + return this.dead.length; + }, + + /** + * Gets the total number of particles in this emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#getParticleCount + * @since 3.0.0 + * + * @return {integer} The number of particles, including both alive and dead. + */ + getParticleCount: function () + { + return this.getAliveParticleCount() + this.getDeadParticleCount(); + }, + + /** + * Whether this emitter is at its limit (if set). + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#atLimit + * @since 3.0.0 + * + * @return {boolean} Returns `true` if this Emitter is at its limit, or `false` if no limit, or below the `maxParticles` level. + */ + atLimit: function () + { + return (this.maxParticles > 0 && this.getParticleCount() === this.maxParticles); + }, + + /** + * Sets a function to call for each newly emitted particle. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#onParticleEmit + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterCallback} callback - The function. + * @param {*} [context] - The calling context. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + onParticleEmit: function (callback, context) + { + if (callback === undefined) + { + // Clear any previously set callback + this.emitCallback = null; + this.emitCallbackScope = null; + } + else if (typeof callback === 'function') + { + this.emitCallback = callback; + + if (context) + { + this.emitCallbackScope = context; + } + } + + return this; + }, + + /** + * Sets a function to call for each particle death. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#onParticleDeath + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.ParticleDeathCallback} callback - The function. + * @param {*} [context] - The function's calling context. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + onParticleDeath: function (callback, context) + { + if (callback === undefined) + { + // Clear any previously set callback + this.deathCallback = null; + this.deathCallbackScope = null; + } + else if (typeof callback === 'function') + { + this.deathCallback = callback; + + if (context) + { + this.deathCallbackScope = context; + } + } + + return this; + }, + + /** + * Deactivates every particle in this emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#killAll + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + killAll: function () + { + var dead = this.dead; + var alive = this.alive; + + while (alive.length > 0) + { + dead.push(alive.pop()); + } + + return this; + }, + + /** + * Calls a function for each active particle in this emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#forEachAlive + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterCallback} callback - The function. + * @param {*} context - The function's calling context. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + forEachAlive: function (callback, context) + { + var alive = this.alive; + var length = alive.length; + + for (var index = 0; index < length; ++index) + { + // Sends the Particle and the Emitter + callback.call(context, alive[index], this); + } + + return this; + }, + + /** + * Calls a function for each inactive particle in this emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#forEachDead + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterCallback} callback - The function. + * @param {*} context - The function's calling context. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + forEachDead: function (callback, context) + { + var dead = this.dead; + var length = dead.length; + + for (var index = 0; index < length; ++index) + { + // Sends the Particle and the Emitter + callback.call(context, dead[index], this); + } + + return this; + }, + + /** + * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#on} the emitter and resets the flow counter. + * + * If this emitter is in flow mode (frequency >= 0; the default), the particle flow will start (or restart). + * + * If this emitter is in explode mode (frequency = -1), nothing will happen. + * Use {@link Phaser.GameObjects.Particles.ParticleEmitter#explode} or {@link Phaser.GameObjects.Particles.ParticleEmitter#flow} instead. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#start + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + start: function () + { + this.on = true; + + this._counter = 0; + + return this; + }, + + /** + * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#on off} the emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#stop + * @since 3.11.0 + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + stop: function () + { + this.on = false; + + return this; + }, + + /** + * {@link Phaser.GameObjects.Particles.ParticleEmitter#active Deactivates} the emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#pause + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + pause: function () + { + this.active = false; + + return this; + }, + + /** + * {@link Phaser.GameObjects.Particles.ParticleEmitter#active Activates} the emitter. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#resume + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + resume: function () + { + this.active = true; + + return this; + }, + + /** + * Sorts active particles with {@link Phaser.GameObjects.Particles.ParticleEmitter#depthSortCallback}. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#depthSort + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + depthSort: function () + { + StableSort.inplace(this.alive, this.depthSortCallback); + + return this; + }, + + /** + * Puts the emitter in flow mode (frequency >= 0) and starts (or restarts) a particle flow. + * + * To resume a flow at the current frequency and quantity, use {@link Phaser.GameObjects.Particles.ParticleEmitter#start} instead. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#flow + * @since 3.0.0 + * + * @param {number} frequency - The time interval (>= 0) of each flow cycle, in ms. + * @param {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitType} [count=1] - The number of particles to emit at each flow cycle. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter. + */ + flow: function (frequency, count) + { + if (count === undefined) { count = 1; } + + this.frequency = frequency; + + this.quantity.onChange(count); + + return this.start(); + }, + + /** + * Puts the emitter in explode mode (frequency = -1), stopping any current particle flow, and emits several particles all at once. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#explode + * @since 3.0.0 + * + * @param {integer} count - The amount of Particles to emit. + * @param {number} x - The x coordinate to emit the Particles from. + * @param {number} y - The y coordinate to emit the Particles from. + * + * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle. + */ + explode: function (count, x, y) + { + this.frequency = -1; + + return this.emitParticle(count, x, y); + }, + + /** + * Emits particles at a given position (or the emitter's current position). + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#emitParticleAt + * @since 3.0.0 + * + * @param {number} [x=this.x] - The x coordinate to emit the Particles from. + * @param {number} [y=this.x] - The y coordinate to emit the Particles from. + * @param {integer} [count=this.quantity] - The number of Particles to emit. + * + * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle. + */ + emitParticleAt: function (x, y, count) + { + return this.emitParticle(count, x, y); + }, + + /** + * Emits particles at a given position (or the emitter's current position). + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#emitParticle + * @since 3.0.0 + * + * @param {integer} [count=this.quantity] - The number of Particles to emit. + * @param {number} [x=this.x] - The x coordinate to emit the Particles from. + * @param {number} [y=this.x] - The y coordinate to emit the Particles from. + * + * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle. + * + * @see Phaser.GameObjects.Particles.Particle#fire + */ + emitParticle: function (count, x, y) + { + if (this.atLimit()) + { + return; + } + + if (count === undefined) + { + count = this.quantity.onEmit(); + } + + var dead = this.dead; + + for (var i = 0; i < count; i++) + { + var particle = dead.pop(); + + if (!particle) + { + particle = new this.particleClass(this); + } + + particle.fire(x, y); + + if (this.particleBringToTop) + { + this.alive.push(particle); + } + else + { + this.alive.unshift(particle); + } + + if (this.emitCallback) + { + this.emitCallback.call(this.emitCallbackScope, particle, this); + } + + if (this.atLimit()) + { + break; + } + } + + return particle; + }, + + /** + * Updates this emitter and its particles. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#preUpdate + * @since 3.0.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + // Scale the delta + delta *= this.timeScale; + + var step = (delta / 1000); + + if (this.trackVisible) + { + this.visible = this.follow.visible; + } + + // Any particle processors? + var processors = this.manager.getProcessors(); + + var particles = this.alive; + var dead = this.dead; + + var i = 0; + var rip = []; + var length = particles.length; + + for (i = 0; i < length; i++) + { + var particle = particles[i]; + + // update returns `true` if the particle is now dead (lifeCurrent <= 0) + if (particle.update(delta, step, processors)) + { + rip.push({ index: i, particle: particle }); + } + } + + // Move dead particles to the dead array + length = rip.length; + + if (length > 0) + { + var deathCallback = this.deathCallback; + var deathCallbackScope = this.deathCallbackScope; + + for (i = length - 1; i >= 0; i--) + { + var entry = rip[i]; + + // Remove from particles array + particles.splice(entry.index, 1); + + // Add to dead array + dead.push(entry.particle); + + // Callback + if (deathCallback) + { + deathCallback.call(deathCallbackScope, entry.particle); + } + + entry.particle.resetPosition(); + } + } + + if (!this.on) + { + return; + } + + if (this.frequency === 0) + { + this.emitParticle(); + } + else if (this.frequency > 0) + { + this._counter -= delta; + + if (this._counter <= 0) + { + this.emitParticle(); + + // counter = frequency - remained from previous delta + this._counter = (this.frequency - Math.abs(this._counter)); + } + } + }, + + /** + * Calculates the difference of two particles, for sorting them by depth. + * + * @method Phaser.GameObjects.Particles.ParticleEmitter#depthSortCallback + * @since 3.0.0 + * + * @param {object} a - The first particle. + * @param {object} b - The second particle. + * + * @return {integer} The difference of a and b's y coordinates. + */ + depthSortCallback: function (a, b) + { + return a.y - b.y; + } + +}); + +module.exports = ParticleEmitter; + + +/***/ }), +/* 375 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A Death Zone. + * + * A Death Zone is a special type of zone that will kill a Particle as soon as it either enters, or leaves, the zone. + * + * The zone consists of a `source` which could be a Geometric shape, such as a Rectangle or Ellipse, or your own + * object as long as it includes a `contains` method for which the Particles can be tested against. + * + * @class DeathZone + * @memberof Phaser.GameObjects.Particles.Zones + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.DeathZoneSource} source - An object instance that has a `contains` method that returns a boolean when given `x` and `y` arguments. + * @param {boolean} killOnEnter - Should the Particle be killed when it enters the zone? `true` or leaves it? `false` + */ +var DeathZone = new Class({ + + initialize: + + function DeathZone (source, killOnEnter) + { + /** + * An object instance that has a `contains` method that returns a boolean when given `x` and `y` arguments. + * This could be a Geometry shape, such as `Phaser.Geom.Circle`, or your own custom object. + * + * @name Phaser.GameObjects.Particles.Zones.DeathZone#source + * @type {Phaser.Types.GameObjects.Particles.DeathZoneSource} + * @since 3.0.0 + */ + this.source = source; + + /** + * Set to `true` if the Particle should be killed if it enters this zone. + * Set to `false` to kill the Particle if it leaves this zone. + * + * @name Phaser.GameObjects.Particles.Zones.DeathZone#killOnEnter + * @type {boolean} + * @since 3.0.0 + */ + this.killOnEnter = killOnEnter; + }, + + /** + * Checks if the given Particle will be killed or not by this zone. + * + * @method Phaser.GameObjects.Particles.Zones.DeathZone#willKill + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.Particle} particle - The Particle to be checked against this zone. + * + * @return {boolean} Return `true` if the Particle is to be killed, otherwise return `false`. + */ + willKill: function (particle) + { + var withinZone = this.source.contains(particle.x, particle.y); + + return (withinZone && this.killOnEnter || !withinZone && !this.killOnEnter); + } + +}); + +module.exports = DeathZone; + + +/***/ }), +/* 376 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A zone that places particles on a shape's edges. + * + * @class EdgeZone + * @memberof Phaser.GameObjects.Particles.Zones + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.EdgeZoneSource} source - An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. + * @param {integer} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + * @param {number} stepRate - The distance between each particle. When set, `quantity` is implied and should be set to 0. + * @param {boolean} [yoyo=false] - Whether particles are placed from start to end and then end to start. + * @param {boolean} [seamless=true] - Whether one endpoint will be removed if it's identical to the other. + */ +var EdgeZone = new Class({ + + initialize: + + function EdgeZone (source, quantity, stepRate, yoyo, seamless) + { + if (yoyo === undefined) { yoyo = false; } + if (seamless === undefined) { seamless = true; } + + /** + * An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. + * + * @name Phaser.GameObjects.Particles.Zones.EdgeZone#source + * @type {Phaser.Types.GameObjects.Particles.EdgeZoneSource|Phaser.Types.GameObjects.Particles.RandomZoneSource} + * @since 3.0.0 + */ + this.source = source; + + /** + * The points placed on the source edge. + * + * @name Phaser.GameObjects.Particles.Zones.EdgeZone#points + * @type {Phaser.Geom.Point[]} + * @default [] + * @since 3.0.0 + */ + this.points = []; + + /** + * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + * + * @name Phaser.GameObjects.Particles.Zones.EdgeZone#quantity + * @type {integer} + * @since 3.0.0 + */ + this.quantity = quantity; + + /** + * The distance between each particle. When set, `quantity` is implied and should be set to 0. + * + * @name Phaser.GameObjects.Particles.Zones.EdgeZone#stepRate + * @type {number} + * @since 3.0.0 + */ + this.stepRate = stepRate; + + /** + * Whether particles are placed from start to end and then end to start. + * + * @name Phaser.GameObjects.Particles.Zones.EdgeZone#yoyo + * @type {boolean} + * @since 3.0.0 + */ + this.yoyo = yoyo; + + /** + * The counter used for iterating the EdgeZone's points. + * + * @name Phaser.GameObjects.Particles.Zones.EdgeZone#counter + * @type {number} + * @default -1 + * @since 3.0.0 + */ + this.counter = -1; + + /** + * Whether one endpoint will be removed if it's identical to the other. + * + * @name Phaser.GameObjects.Particles.Zones.EdgeZone#seamless + * @type {boolean} + * @since 3.0.0 + */ + this.seamless = seamless; + + /** + * An internal count of the points belonging to this EdgeZone. + * + * @name Phaser.GameObjects.Particles.Zones.EdgeZone#_length + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._length = 0; + + /** + * An internal value used to keep track of the current iteration direction for the EdgeZone's points. + * + * 0 = forwards, 1 = backwards + * + * @name Phaser.GameObjects.Particles.Zones.EdgeZone#_direction + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._direction = 0; + + this.updateSource(); + }, + + /** + * Update the {@link Phaser.GameObjects.Particles.Zones.EdgeZone#points} from the EdgeZone's + * {@link Phaser.GameObjects.Particles.Zones.EdgeZone#source}. + * + * Also updates internal properties. + * + * @method Phaser.GameObjects.Particles.Zones.EdgeZone#updateSource + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.Zones.EdgeZone} This Edge Zone. + */ + updateSource: function () + { + this.points = this.source.getPoints(this.quantity, this.stepRate); + + // Remove ends? + if (this.seamless) + { + var a = this.points[0]; + var b = this.points[this.points.length - 1]; + + if (a.x === b.x && a.y === b.y) + { + this.points.pop(); + } + } + + var oldLength = this._length; + + this._length = this.points.length; + + // Adjust counter if we now have less points than before + if (this._length < oldLength && this.counter > this._length) + { + this.counter = this._length - 1; + } + + return this; + }, + + /** + * Change the source of the EdgeZone. + * + * @method Phaser.GameObjects.Particles.Zones.EdgeZone#changeSource + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.EdgeZoneSource} source - An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. + * + * @return {Phaser.GameObjects.Particles.Zones.EdgeZone} This Edge Zone. + */ + changeSource: function (source) + { + this.source = source; + + return this.updateSource(); + }, + + /** + * Get the next point in the Zone and set its coordinates on the given Particle. + * + * @method Phaser.GameObjects.Particles.Zones.EdgeZone#getPoint + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.Particle} particle - The Particle. + */ + getPoint: function (particle) + { + if (this._direction === 0) + { + this.counter++; + + if (this.counter >= this._length) + { + if (this.yoyo) + { + this._direction = 1; + this.counter = this._length - 1; + } + else + { + this.counter = 0; + } + } + } + else + { + this.counter--; + + if (this.counter === -1) + { + if (this.yoyo) + { + this._direction = 0; + this.counter = 0; + } + else + { + this.counter = this._length - 1; + } + } + } + + var point = this.points[this.counter]; + + if (point) + { + particle.x = point.x; + particle.y = point.y; + } + } + +}); + +module.exports = EdgeZone; + + +/***/ }), +/* 377 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Verifies that an object contains at least one of the requested keys + * + * @function Phaser.Utils.Objects.HasAny + * @since 3.0.0 + * + * @param {object} source - an object on which to check for key existence + * @param {string[]} keys - an array of keys to search the object for + * + * @return {boolean} true if the source object contains at least one of the keys, false otherwise + */ +var HasAny = function (source, keys) +{ + for (var i = 0; i < keys.length; i++) + { + if (source.hasOwnProperty(keys[i])) + { + return true; + } + } + + return false; +}; + +module.exports = HasAny; + + +/***/ }), +/* 378 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A zone that places particles randomly within a shape's area. + * + * @class RandomZone + * @memberof Phaser.GameObjects.Particles.Zones + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.RandomZoneSource} source - An object instance with a `getRandomPoint(point)` method. + */ +var RandomZone = new Class({ + + initialize: + + function RandomZone (source) + { + /** + * An object instance with a `getRandomPoint(point)` method. + * + * @name Phaser.GameObjects.Particles.Zones.RandomZone#source + * @type {Phaser.Types.GameObjects.Particles.RandomZoneSource} + * @since 3.0.0 + */ + this.source = source; + + /** + * Internal calculation vector. + * + * @name Phaser.GameObjects.Particles.Zones.RandomZone#_tempVec + * @type {Phaser.Math.Vector2} + * @private + * @since 3.0.0 + */ + this._tempVec = new Vector2(); + }, + + /** + * Get the next point in the Zone and set its coordinates on the given Particle. + * + * @method Phaser.GameObjects.Particles.Zones.RandomZone#getPoint + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.Particle} particle - The Particle. + */ + getPoint: function (particle) + { + var vec = this._tempVec; + + this.source.getRandomPoint(vec); + + particle.x = vec.x; + particle.y = vec.y; + } + +}); + +module.exports = RandomZone; + + +/***/ }), +/* 379 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var Sprite = __webpack_require__(67); + +/** + * @classdesc + * A PathFollower Game Object. + * + * A PathFollower is a Sprite Game Object with some extra helpers to allow it to follow a Path automatically. + * + * Anything you can do with a standard Sprite can be done with this PathFollower, such as animate it, tint it, + * scale it and so on. + * + * PathFollowers are bound to a single Path at any one time and can traverse the length of the Path, from start + * to finish, forwards or backwards, or from any given point on the Path to its end. They can optionally rotate + * to face the direction of the path, be offset from the path coordinates or rotate independently of the Path. + * + * @class PathFollower + * @extends Phaser.GameObjects.Sprite + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.PathFollower + * + * @param {Phaser.Scene} scene - The Scene to which this PathFollower belongs. + * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + */ +var PathFollower = new Class({ + + Extends: Sprite, + + Mixins: [ + Components.PathFollower + ], + + initialize: + + function PathFollower (scene, path, x, y, texture, frame) + { + Sprite.call(this, scene, x, y, texture, frame); + + this.path = path; + }, + + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + * + * @method Phaser.GameObjects.PathFollower#preUpdate + * @protected + * @since 3.0.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + this.anims.update(time, delta); + this.pathUpdate(time); + } + +}); + +module.exports = PathFollower; + + +/***/ }), +/* 380 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Creates and returns an RFC4122 version 4 compliant UUID. + * + * The string is in the form: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` where each `x` is replaced with a random + * hexadecimal digit from 0 to f, and `y` is replaced with a random hexadecimal digit from 8 to b. + * + * @function Phaser.Utils.String.UUID + * @since 3.12.0 + * + * @return {string} The UUID string. + */ +var UUID = function () +{ + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) + { + var r = Math.random() * 16 | 0; + var v = (c === 'x') ? r : (r & 0x3 | 0x8); + + return v.toString(16); + }); +}; + +module.exports = UUID; + + +/***/ }), +/* 381 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArcRender = __webpack_require__(953); +var Class = __webpack_require__(0); +var DegToRad = __webpack_require__(35); +var Earcut = __webpack_require__(63); +var GeomCircle = __webpack_require__(77); +var MATH_CONST = __webpack_require__(23); +var Shape = __webpack_require__(30); + +/** + * @classdesc + * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an arc shape. You can control the start and end angles of the arc, + * as well as if the angles are winding clockwise or anti-clockwise. With the default settings + * it renders as a complete circle. By changing the angles you can create other arc shapes, + * such as half-circles. + * + * Arcs also have an `iterations` property and corresponding `setIterations` method. This allows + * you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. + * + * @class Arc + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [radius=128] - The radius of the arc. + * @param {integer} [startAngle=0] - The start angle of the arc, in degrees. + * @param {integer} [endAngle=360] - The end angle of the arc, in degrees. + * @param {boolean} [anticlockwise=false] - The winding order of the start and end angles. + * @param {number} [fillColor] - The color the arc will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ +var Arc = new Class({ + + Extends: Shape, + + Mixins: [ + ArcRender + ], + + initialize: + + function Arc (scene, x, y, radius, startAngle, endAngle, anticlockwise, fillColor, fillAlpha) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (radius === undefined) { radius = 128; } + if (startAngle === undefined) { startAngle = 0; } + if (endAngle === undefined) { endAngle = 360; } + if (anticlockwise === undefined) { anticlockwise = false; } + + Shape.call(this, scene, 'Arc', new GeomCircle(0, 0, radius)); + + /** + * Private internal value. Holds the start angle in degrees. + * + * @name Phaser.GameObjects.Arc#_startAngle + * @type {integer} + * @private + * @since 3.13.0 + */ + this._startAngle = startAngle; + + /** + * Private internal value. Holds the end angle in degrees. + * + * @name Phaser.GameObjects.Arc#_endAngle + * @type {integer} + * @private + * @since 3.13.0 + */ + this._endAngle = endAngle; + + /** + * Private internal value. Holds the winding order of the start and end angles. + * + * @name Phaser.GameObjects.Arc#_anticlockwise + * @type {boolean} + * @private + * @since 3.13.0 + */ + this._anticlockwise = anticlockwise; + + /** + * Private internal value. Holds the number of iterations used when drawing the arc. + * + * @name Phaser.GameObjects.Arc#_iterations + * @type {number} + * @default 0.01 + * @private + * @since 3.13.0 + */ + this._iterations = 0.01; + + this.setPosition(x, y); + + var diameter = this.geom.radius * 2; + this.setSize(diameter, diameter); + + if (fillColor !== undefined) + { + this.setFillStyle(fillColor, fillAlpha); + } + + this.updateDisplayOrigin(); + this.updateData(); + }, + + /** + * The number of iterations used when drawing the arc. + * Increase this value for smoother arcs, at the cost of more polygons being rendered. + * Modify this value by small amounts, such as 0.01. + * + * @name Phaser.GameObjects.Arc#iterations + * @type {number} + * @default 0.01 + * @since 3.13.0 + */ + iterations: { + + get: function () + { + return this._iterations; + }, + + set: function (value) + { + this._iterations = value; + + this.updateData(); + } + + }, + + /** + * The radius of the arc. + * + * @name Phaser.GameObjects.Arc#radius + * @type {number} + * @since 3.13.0 + */ + radius: { + + get: function () + { + return this.geom.radius; + }, + + set: function (value) + { + this.geom.radius = value; + + this.setSize(value, value); + this.updateDisplayOrigin(); + this.updateData(); + } + + }, + + /** + * The start angle of the arc, in degrees. + * + * @name Phaser.GameObjects.Arc#startAngle + * @type {integer} + * @since 3.13.0 + */ + startAngle: { + + get: function () + { + return this._startAngle; + }, + + set: function (value) + { + this._startAngle = value; + + this.updateData(); + } + + }, + + /** + * The end angle of the arc, in degrees. + * + * @name Phaser.GameObjects.Arc#endAngle + * @type {integer} + * @since 3.13.0 + */ + endAngle: { + + get: function () + { + return this._endAngle; + }, + + set: function (value) + { + this._endAngle = value; + + this.updateData(); + } + + }, + + /** + * The winding order of the start and end angles. + * + * @name Phaser.GameObjects.Arc#anticlockwise + * @type {boolean} + * @since 3.13.0 + */ + anticlockwise: { + + get: function () + { + return this._anticlockwise; + }, + + set: function (value) + { + this._anticlockwise = value; + + this.updateData(); + } + + }, + + /** + * Sets the radius of the arc. + * This call can be chained. + * + * @method Phaser.GameObjects.Arc#setRadius + * @since 3.13.0 + * + * @param {number} value - The value to set the radius to. + * + * @return {this} This Game Object instance. + */ + setRadius: function (value) + { + this.radius = value; + + return this; + }, + + /** + * Sets the number of iterations used when drawing the arc. + * Increase this value for smoother arcs, at the cost of more polygons being rendered. + * Modify this value by small amounts, such as 0.01. + * This call can be chained. + * + * @method Phaser.GameObjects.Arc#setIterations + * @since 3.13.0 + * + * @param {number} value - The value to set the iterations to. + * + * @return {this} This Game Object instance. + */ + setIterations: function (value) + { + if (value === undefined) { value = 0.01; } + + this.iterations = value; + + return this; + }, + + /** + * Sets the starting angle of the arc, in degrees. + * This call can be chained. + * + * @method Phaser.GameObjects.Arc#setStartAngle + * @since 3.13.0 + * + * @param {integer} value - The value to set the starting angle to. + * + * @return {this} This Game Object instance. + */ + setStartAngle: function (angle, anticlockwise) + { + this._startAngle = angle; + + if (anticlockwise !== undefined) + { + this._anticlockwise = anticlockwise; + } + + return this.updateData(); + }, + + /** + * Sets the ending angle of the arc, in degrees. + * This call can be chained. + * + * @method Phaser.GameObjects.Arc#setEndAngle + * @since 3.13.0 + * + * @param {integer} value - The value to set the ending angle to. + * + * @return {this} This Game Object instance. + */ + setEndAngle: function (angle, anticlockwise) + { + this._endAngle = angle; + + if (anticlockwise !== undefined) + { + this._anticlockwise = anticlockwise; + } + + return this.updateData(); + }, + + /** + * Internal method that updates the data and path values. + * + * @method Phaser.GameObjects.Arc#updateData + * @private + * @since 3.13.0 + * + * @return {this} This Game Object instance. + */ + updateData: function () + { + var step = this._iterations; + var iteration = step; + + var radius = this.geom.radius; + var startAngle = DegToRad(this._startAngle); + var endAngle = DegToRad(this._endAngle); + var anticlockwise = this._anticlockwise; + + var x = radius / 2; + var y = radius / 2; + + endAngle -= startAngle; + + if (anticlockwise) + { + if (endAngle < -MATH_CONST.PI2) + { + endAngle = -MATH_CONST.PI2; + } + else if (endAngle > 0) + { + endAngle = -MATH_CONST.PI2 + endAngle % MATH_CONST.PI2; + } + } + else if (endAngle > MATH_CONST.PI2) + { + endAngle = MATH_CONST.PI2; + } + else if (endAngle < 0) + { + endAngle = MATH_CONST.PI2 + endAngle % MATH_CONST.PI2; + } + + var path = [ x + Math.cos(startAngle) * radius, y + Math.sin(startAngle) * radius ]; + + var ta; + + while (iteration < 1) + { + ta = endAngle * iteration + startAngle; + + path.push(x + Math.cos(ta) * radius, y + Math.sin(ta) * radius); + + iteration += step; + } + + ta = endAngle + startAngle; + + path.push(x + Math.cos(ta) * radius, y + Math.sin(ta) * radius); + + path.push(x + Math.cos(startAngle) * radius, y + Math.sin(startAngle) * radius); + + this.pathIndexes = Earcut(path); + this.pathData = path; + + return this; + } + +}); + +module.exports = Arc; + + +/***/ }), +/* 382 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CurveRender = __webpack_require__(956); +var Earcut = __webpack_require__(63); +var Rectangle = __webpack_require__(10); +var Shape = __webpack_require__(30); + +/** + * @classdesc + * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to + * the Curve Shape in the constructor. + * + * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + * + * @class Curve + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {Phaser.Curves.Curve} [curve] - The Curve object to use to create the Shape. + * @param {number} [fillColor] - The color the curve will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the curve will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ +var Curve = new Class({ + + Extends: Shape, + + Mixins: [ + CurveRender + ], + + initialize: + + function Curve (scene, x, y, curve, fillColor, fillAlpha) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + Shape.call(this, scene, 'Curve', curve); + + /** + * Private internal value. + * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn. + * + * @name Phaser.GameObjects.Curve#_smoothness + * @type {integer} + * @private + * @since 3.13.0 + */ + this._smoothness = 32; + + /** + * Private internal value. + * The Curve bounds rectangle. + * + * @name Phaser.GameObjects.Curve#_curveBounds + * @type {Phaser.Geom.Rectangle} + * @private + * @since 3.13.0 + */ + this._curveBounds = new Rectangle(); + + this.closePath = false; + + this.setPosition(x, y); + + if (fillColor !== undefined) + { + this.setFillStyle(fillColor, fillAlpha); + } + + this.updateData(); + }, + + /** + * The smoothness of the curve. The number of points used when rendering it. + * Increase this value for smoother curves, at the cost of more polygons being rendered. + * + * @name Phaser.GameObjects.Curve#smoothness + * @type {integer} + * @default 32 + * @since 3.13.0 + */ + smoothness: { + + get: function () + { + return this._smoothness; + }, + + set: function (value) + { + this._smoothness = value; + + this.updateData(); + } + + }, + + /** + * Sets the smoothness of the curve. The number of points used when rendering it. + * Increase this value for smoother curves, at the cost of more polygons being rendered. + * This call can be chained. + * + * @method Phaser.GameObjects.Curve#setSmoothness + * @since 3.13.0 + * + * @param {integer} value - The value to set the smoothness to. + * + * @return {this} This Game Object instance. + */ + setSmoothness: function (value) + { + this._smoothness = value; + + return this.updateData(); + }, + + /** + * Internal method that updates the data and path values. + * + * @method Phaser.GameObjects.Curve#updateData + * @private + * @since 3.13.0 + * + * @return {this} This Game Object instance. + */ + updateData: function () + { + var bounds = this._curveBounds; + var smoothness = this._smoothness; + + // Update the bounds in case the underlying data has changed + this.geom.getBounds(bounds, smoothness); + + this.setSize(bounds.width, bounds.height); + this.updateDisplayOrigin(); + + var path = []; + var points = this.geom.getPoints(smoothness); + + for (var i = 0; i < points.length; i++) + { + path.push(points[i].x, points[i].y); + } + + path.push(points[0].x, points[0].y); + + this.pathIndexes = Earcut(path); + this.pathData = path; + + return this; + } + +}); + +module.exports = Curve; + + +/***/ }), +/* 383 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Earcut = __webpack_require__(63); +var EllipseRender = __webpack_require__(959); +var GeomEllipse = __webpack_require__(92); +var Shape = __webpack_require__(30); + +/** + * @classdesc + * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. + * If the width and height match it will render as a circle. If the width is less than the height, + * it will look more like an egg shape. + * + * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + * + * @class Ellipse + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [width=128] - The width of the ellipse. An ellipse with equal width and height renders as a circle. + * @param {number} [height=128] - The height of the ellipse. An ellipse with equal width and height renders as a circle. + * @param {number} [fillColor] - The color the ellipse will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ +var Ellipse = new Class({ + + Extends: Shape, + + Mixins: [ + EllipseRender + ], + + initialize: + + function Ellipse (scene, x, y, width, height, fillColor, fillAlpha) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 128; } + if (height === undefined) { height = 128; } + + Shape.call(this, scene, 'Ellipse', new GeomEllipse(width / 2, height / 2, width, height)); + + /** + * Private internal value. + * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn. + * + * @name Phaser.GameObjects.Ellipse#_smoothness + * @type {integer} + * @private + * @since 3.13.0 + */ + this._smoothness = 64; + + this.setPosition(x, y); + + this.width = width; + this.height = height; + + if (fillColor !== undefined) + { + this.setFillStyle(fillColor, fillAlpha); + } + + this.updateDisplayOrigin(); + this.updateData(); + }, + + /** + * The smoothness of the ellipse. The number of points used when rendering it. + * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. + * + * @name Phaser.GameObjects.Ellipse#smoothness + * @type {integer} + * @default 64 + * @since 3.13.0 + */ + smoothness: { + + get: function () + { + return this._smoothness; + }, + + set: function (value) + { + this._smoothness = value; + + this.updateData(); + } + + }, + + /** + * Sets the size of the ellipse by changing the underlying geometry data, rather than scaling the object. + * This call can be chained. + * + * @method Phaser.GameObjects.Ellipse#setSize + * @since 3.13.0 + * + * @param {number} width - The width of the ellipse. + * @param {number} height - The height of the ellipse. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.geom.setSize(width, height); + + return this.updateData(); + }, + + /** + * Sets the smoothness of the ellipse. The number of points used when rendering it. + * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. + * This call can be chained. + * + * @method Phaser.GameObjects.Ellipse#setSmoothness + * @since 3.13.0 + * + * @param {integer} value - The value to set the smoothness to. + * + * @return {this} This Game Object instance. + */ + setSmoothness: function (value) + { + this._smoothness = value; + + return this.updateData(); + }, + + /** + * Internal method that updates the data and path values. + * + * @method Phaser.GameObjects.Ellipse#updateData + * @private + * @since 3.13.0 + * + * @return {this} This Game Object instance. + */ + updateData: function () + { + var path = []; + var points = this.geom.getPoints(this._smoothness); + + for (var i = 0; i < points.length; i++) + { + path.push(points[i].x, points[i].y); + } + + path.push(points[0].x, points[0].y); + + this.pathIndexes = Earcut(path); + this.pathData = path; + + return this; + } + +}); + +module.exports = Ellipse; + + +/***/ }), +/* 384 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Shape = __webpack_require__(30); +var GridRender = __webpack_require__(962); + +/** + * @classdesc + * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * A Grid Shape allows you to display a grid in your game, where you can control the size of the + * grid as well as the width and height of the grid cells. You can set a fill color for each grid + * cell as well as an alternate fill color. When the alternate fill color is set then the grid + * cells will alternate the fill colors as they render, creating a chess-board effect. You can + * also optionally have an outline fill color. If set, this draws lines between the grid cells + * in the given color. If you specify an outline color with an alpha of zero, then it will draw + * the cells spaced out, but without the lines between them. + * + * @class Grid + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [width=128] - The width of the grid. + * @param {number} [height=128] - The height of the grid. + * @param {number} [cellWidth=32] - The width of one cell in the grid. + * @param {number} [cellHeight=32] - The height of one cell in the grid. + * @param {number} [fillColor] - The color the grid cells will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * @param {number} [outlineFillColor] - The color of the lines between the grid cells. See the `setOutline` method. + * @param {number} [outlineFillAlpha] - The alpha of the lines between the grid cells. + */ +var Grid = new Class({ + + Extends: Shape, + + Mixins: [ + GridRender + ], + + initialize: + + function Grid (scene, x, y, width, height, cellWidth, cellHeight, fillColor, fillAlpha, outlineFillColor, outlineFillAlpha) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 128; } + if (height === undefined) { height = 128; } + if (cellWidth === undefined) { cellWidth = 32; } + if (cellHeight === undefined) { cellHeight = 32; } + + Shape.call(this, scene, 'Grid', null); + + /** + * The width of each grid cell. + * Must be a positive value. + * + * @name Phaser.GameObjects.Grid#cellWidth + * @type {number} + * @since 3.13.0 + */ + this.cellWidth = cellWidth; + + /** + * The height of each grid cell. + * Must be a positive value. + * + * @name Phaser.GameObjects.Grid#cellHeight + * @type {number} + * @since 3.13.0 + */ + this.cellHeight = cellHeight; + + /** + * Will the grid render its cells in the `fillColor`? + * + * @name Phaser.GameObjects.Grid#showCells + * @type {boolean} + * @since 3.13.0 + */ + this.showCells = true; + + /** + * The color of the lines between each grid cell. + * + * @name Phaser.GameObjects.Grid#outlineFillColor + * @type {number} + * @since 3.13.0 + */ + this.outlineFillColor = 0; + + /** + * The alpha value for the color of the lines between each grid cell. + * + * @name Phaser.GameObjects.Grid#outlineFillAlpha + * @type {number} + * @since 3.13.0 + */ + this.outlineFillAlpha = 0; + + /** + * Will the grid display the lines between each cell when it renders? + * + * @name Phaser.GameObjects.Grid#showOutline + * @type {boolean} + * @since 3.13.0 + */ + this.showOutline = true; + + /** + * Will the grid render the alternating cells in the `altFillColor`? + * + * @name Phaser.GameObjects.Grid#showAltCells + * @type {boolean} + * @since 3.13.0 + */ + this.showAltCells = false; + + /** + * The color the alternating grid cells will be filled with, i.e. 0xff0000 for red. + * + * @name Phaser.GameObjects.Grid#altFillColor + * @type {number} + * @since 3.13.0 + */ + this.altFillColor; + + /** + * The alpha the alternating grid cells will be filled with. + * You can also set the alpha of the overall Shape using its `alpha` property. + * + * @name Phaser.GameObjects.Grid#altFillAlpha + * @type {number} + * @since 3.13.0 + */ + this.altFillAlpha; + + this.setPosition(x, y); + this.setSize(width, height); + + if (fillColor !== undefined) + { + this.setFillStyle(fillColor, fillAlpha); + } + + if (outlineFillColor !== undefined) + { + this.setOutlineStyle(outlineFillColor, outlineFillAlpha); + } + + this.updateDisplayOrigin(); + }, + + /** + * Sets the fill color and alpha level the grid cells will use when rendering. + * + * If this method is called with no values then the grid cells will not be rendered, + * however the grid lines and alternating cells may still be. + * + * Also see the `setOutlineStyle` and `setAltFillStyle` methods. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Grid#setFillStyle + * @since 3.13.0 + * + * @param {number} [fillColor] - The color the grid cells will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha=1] - The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {this} This Game Object instance. + */ + setFillStyle: function (fillColor, fillAlpha) + { + if (fillAlpha === undefined) { fillAlpha = 1; } + + if (fillColor === undefined) + { + this.showCells = false; + } + else + { + this.fillColor = fillColor; + this.fillAlpha = fillAlpha; + this.showCells = true; + } + + return this; + }, + + /** + * Sets the fill color and alpha level that the alternating grid cells will use. + * + * If this method is called with no values then alternating grid cells will not be rendered in a different color. + * + * Also see the `setOutlineStyle` and `setFillStyle` methods. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Grid#setAltFillStyle + * @since 3.13.0 + * + * @param {number} [fillColor] - The color the alternating grid cells will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha=1] - The alpha the alternating grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {this} This Game Object instance. + */ + setAltFillStyle: function (fillColor, fillAlpha) + { + if (fillAlpha === undefined) { fillAlpha = 1; } + + if (fillColor === undefined) + { + this.showAltCells = false; + } + else + { + this.altFillColor = fillColor; + this.altFillAlpha = fillAlpha; + this.showAltCells = true; + } + + return this; + }, + + /** + * Sets the fill color and alpha level that the lines between each grid cell will use. + * + * If this method is called with no values then the grid lines will not be rendered at all, however + * the cells themselves may still be if they have colors set. + * + * Also see the `setFillStyle` and `setAltFillStyle` methods. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Grid#setOutlineStyle + * @since 3.13.0 + * + * @param {number} [fillColor] - The color the lines between the grid cells will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha=1] - The alpha the lines between the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {this} This Game Object instance. + */ + setOutlineStyle: function (fillColor, fillAlpha) + { + if (fillAlpha === undefined) { fillAlpha = 1; } + + if (fillColor === undefined) + { + this.showOutline = false; + } + else + { + this.outlineFillColor = fillColor; + this.outlineFillAlpha = fillAlpha; + this.showOutline = true; + } + + return this; + } + +}); + +module.exports = Grid; + + +/***/ }), +/* 385 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsoBoxRender = __webpack_require__(965); +var Class = __webpack_require__(0); +var Shape = __webpack_require__(30); + +/** + * @classdesc + * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set + * the color of the top, left and right faces of the rectangle respectively. You can also choose + * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting + * the `projection` property. + * + * @class IsoBox + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [size=48] - The width of the iso box in pixels. The left and right faces will be exactly half this value. + * @param {number} [height=32] - The height of the iso box. The left and right faces will be this tall. The overall height of the isobox will be this value plus half the `size` value. + * @param {number} [fillTop=0xeeeeee] - The fill color of the top face of the iso box. + * @param {number} [fillLeft=0x999999] - The fill color of the left face of the iso box. + * @param {number} [fillRight=0xcccccc] - The fill color of the right face of the iso box. + */ +var IsoBox = new Class({ + + Extends: Shape, + + Mixins: [ + IsoBoxRender + ], + + initialize: + + function IsoBox (scene, x, y, size, height, fillTop, fillLeft, fillRight) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (size === undefined) { size = 48; } + if (height === undefined) { height = 32; } + if (fillTop === undefined) { fillTop = 0xeeeeee; } + if (fillLeft === undefined) { fillLeft = 0x999999; } + if (fillRight === undefined) { fillRight = 0xcccccc; } + + Shape.call(this, scene, 'IsoBox', null); + + /** + * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. + * + * @name Phaser.GameObjects.IsoBox#projection + * @type {integer} + * @default 4 + * @since 3.13.0 + */ + this.projection = 4; + + /** + * The color used to fill in the top of the iso box. + * + * @name Phaser.GameObjects.IsoBox#fillTop + * @type {number} + * @since 3.13.0 + */ + this.fillTop = fillTop; + + /** + * The color used to fill in the left-facing side of the iso box. + * + * @name Phaser.GameObjects.IsoBox#fillLeft + * @type {number} + * @since 3.13.0 + */ + this.fillLeft = fillLeft; + + /** + * The color used to fill in the right-facing side of the iso box. + * + * @name Phaser.GameObjects.IsoBox#fillRight + * @type {number} + * @since 3.13.0 + */ + this.fillRight = fillRight; + + /** + * Controls if the top-face of the iso box be rendered. + * + * @name Phaser.GameObjects.IsoBox#showTop + * @type {boolean} + * @default true + * @since 3.13.0 + */ + this.showTop = true; + + /** + * Controls if the left-face of the iso box be rendered. + * + * @name Phaser.GameObjects.IsoBox#showLeft + * @type {boolean} + * @default true + * @since 3.13.0 + */ + this.showLeft = true; + + /** + * Controls if the right-face of the iso box be rendered. + * + * @name Phaser.GameObjects.IsoBox#showRight + * @type {boolean} + * @default true + * @since 3.13.0 + */ + this.showRight = true; + + this.isFilled = true; + + this.setPosition(x, y); + this.setSize(size, height); + + this.updateDisplayOrigin(); + }, + + /** + * Sets the projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. + * This call can be chained. + * + * @method Phaser.GameObjects.IsoBox#setProjection + * @since 3.13.0 + * + * @param {integer} value - The value to set the projection to. + * + * @return {this} This Game Object instance. + */ + setProjection: function (value) + { + this.projection = value; + + return this; + }, + + /** + * Sets which faces of the iso box will be rendered. + * This call can be chained. + * + * @method Phaser.GameObjects.IsoBox#setFaces + * @since 3.13.0 + * + * @param {boolean} [showTop=true] - Show the top-face of the iso box. + * @param {boolean} [showLeft=true] - Show the left-face of the iso box. + * @param {boolean} [showRight=true] - Show the right-face of the iso box. + * + * @return {this} This Game Object instance. + */ + setFaces: function (showTop, showLeft, showRight) + { + if (showTop === undefined) { showTop = true; } + if (showLeft === undefined) { showLeft = true; } + if (showRight === undefined) { showRight = true; } + + this.showTop = showTop; + this.showLeft = showLeft; + this.showRight = showRight; + + return this; + }, + + /** + * Sets the fill colors for each face of the iso box. + * This call can be chained. + * + * @method Phaser.GameObjects.IsoBox#setFillStyle + * @since 3.13.0 + * + * @param {number} [fillTop] - The color used to fill the top of the iso box. + * @param {number} [fillLeft] - The color used to fill in the left-facing side of the iso box. + * @param {number} [fillRight] - The color used to fill in the right-facing side of the iso box. + * + * @return {this} This Game Object instance. + */ + setFillStyle: function (fillTop, fillLeft, fillRight) + { + this.fillTop = fillTop; + this.fillLeft = fillLeft; + this.fillRight = fillRight; + + this.isFilled = true; + + return this; + } + +}); + +module.exports = IsoBox; + + +/***/ }), +/* 386 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var IsoTriangleRender = __webpack_require__(968); +var Shape = __webpack_require__(30); + +/** + * @classdesc + * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different + * fill color. You can set the color of the top, left and right faces of the triangle respectively + * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting + * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside + * down or not. + * + * @class IsoTriangle + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [size=48] - The width of the iso triangle in pixels. The left and right faces will be exactly half this value. + * @param {number} [height=32] - The height of the iso triangle. The left and right faces will be this tall. The overall height of the iso triangle will be this value plus half the `size` value. + * @param {boolean} [reversed=false] - Is the iso triangle upside down? + * @param {number} [fillTop=0xeeeeee] - The fill color of the top face of the iso triangle. + * @param {number} [fillLeft=0x999999] - The fill color of the left face of the iso triangle. + * @param {number} [fillRight=0xcccccc] - The fill color of the right face of the iso triangle. + */ +var IsoTriangle = new Class({ + + Extends: Shape, + + Mixins: [ + IsoTriangleRender + ], + + initialize: + + function IsoTriangle (scene, x, y, size, height, reversed, fillTop, fillLeft, fillRight) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (size === undefined) { size = 48; } + if (height === undefined) { height = 32; } + if (reversed === undefined) { reversed = false; } + if (fillTop === undefined) { fillTop = 0xeeeeee; } + if (fillLeft === undefined) { fillLeft = 0x999999; } + if (fillRight === undefined) { fillRight = 0xcccccc; } + + Shape.call(this, scene, 'IsoTriangle', null); + + /** + * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. + * + * @name Phaser.GameObjects.IsoTriangle#projection + * @type {integer} + * @default 4 + * @since 3.13.0 + */ + this.projection = 4; + + /** + * The color used to fill in the top of the iso triangle. This is only used if the triangle is reversed. + * + * @name Phaser.GameObjects.IsoTriangle#fillTop + * @type {number} + * @since 3.13.0 + */ + this.fillTop = fillTop; + + /** + * The color used to fill in the left-facing side of the iso triangle. + * + * @name Phaser.GameObjects.IsoTriangle#fillLeft + * @type {number} + * @since 3.13.0 + */ + this.fillLeft = fillLeft; + + /** + * The color used to fill in the right-facing side of the iso triangle. + * + * @name Phaser.GameObjects.IsoTriangle#fillRight + * @type {number} + * @since 3.13.0 + */ + this.fillRight = fillRight; + + /** + * Controls if the top-face of the iso triangle be rendered. + * + * @name Phaser.GameObjects.IsoTriangle#showTop + * @type {boolean} + * @default true + * @since 3.13.0 + */ + this.showTop = true; + + /** + * Controls if the left-face of the iso triangle be rendered. + * + * @name Phaser.GameObjects.IsoTriangle#showLeft + * @type {boolean} + * @default true + * @since 3.13.0 + */ + this.showLeft = true; + + /** + * Controls if the right-face of the iso triangle be rendered. + * + * @name Phaser.GameObjects.IsoTriangle#showRight + * @type {boolean} + * @default true + * @since 3.13.0 + */ + this.showRight = true; + + /** + * Sets if the iso triangle will be rendered upside down or not. + * + * @name Phaser.GameObjects.IsoTriangle#isReversed + * @type {boolean} + * @default false + * @since 3.13.0 + */ + this.isReversed = reversed; + + this.isFilled = true; + + this.setPosition(x, y); + this.setSize(size, height); + + this.updateDisplayOrigin(); + }, + + /** + * Sets the projection level of the iso triangle. Change this to change the 'angle' at which you are looking at the pyramid. + * This call can be chained. + * + * @method Phaser.GameObjects.IsoTriangle#setProjection + * @since 3.13.0 + * + * @param {integer} value - The value to set the projection to. + * + * @return {this} This Game Object instance. + */ + setProjection: function (value) + { + this.projection = value; + + return this; + }, + + /** + * Sets if the iso triangle will be rendered upside down or not. + * This call can be chained. + * + * @method Phaser.GameObjects.IsoTriangle#setReversed + * @since 3.13.0 + * + * @param {boolean} reversed - Sets if the iso triangle will be rendered upside down or not. + * + * @return {this} This Game Object instance. + */ + setReversed: function (reversed) + { + this.isReversed = reversed; + + return this; + }, + + /** + * Sets which faces of the iso triangle will be rendered. + * This call can be chained. + * + * @method Phaser.GameObjects.IsoTriangle#setFaces + * @since 3.13.0 + * + * @param {boolean} [showTop=true] - Show the top-face of the iso triangle (only if `reversed` is true) + * @param {boolean} [showLeft=true] - Show the left-face of the iso triangle. + * @param {boolean} [showRight=true] - Show the right-face of the iso triangle. + * + * @return {this} This Game Object instance. + */ + setFaces: function (showTop, showLeft, showRight) + { + if (showTop === undefined) { showTop = true; } + if (showLeft === undefined) { showLeft = true; } + if (showRight === undefined) { showRight = true; } + + this.showTop = showTop; + this.showLeft = showLeft; + this.showRight = showRight; + + return this; + }, + + /** + * Sets the fill colors for each face of the iso triangle. + * This call can be chained. + * + * @method Phaser.GameObjects.IsoTriangle#setFillStyle + * @since 3.13.0 + * + * @param {number} [fillTop] - The color used to fill the top of the iso triangle. + * @param {number} [fillLeft] - The color used to fill in the left-facing side of the iso triangle. + * @param {number} [fillRight] - The color used to fill in the right-facing side of the iso triangle. + * + * @return {this} This Game Object instance. + */ + setFillStyle: function (fillTop, fillLeft, fillRight) + { + this.fillTop = fillTop; + this.fillLeft = fillLeft; + this.fillRight = fillRight; + + this.isFilled = true; + + return this; + } + +}); + +module.exports = IsoTriangle; + + +/***/ }), +/* 387 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Shape = __webpack_require__(30); +var GeomLine = __webpack_require__(54); +var LineRender = __webpack_require__(971); + +/** + * @classdesc + * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only stroke colors and cannot be filled. + * + * A Line Shape allows you to draw a line between two points in your game. You can control the + * stroke color and thickness of the line. In WebGL only you can also specify a different + * thickness for the start and end of the line, allowing you to render lines that taper-off. + * + * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. + * + * Be aware that as with all Game Objects the default origin is 0.5. If you need to draw a Line + * between two points and want the x1/y1 values to match the x/y values, then set the origin to 0. + * + * @class Line + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [x1=0] - The horizontal position of the start of the line. + * @param {number} [y1=0] - The vertical position of the start of the line. + * @param {number} [x2=128] - The horizontal position of the end of the line. + * @param {number} [y2=0] - The vertical position of the end of the line. + * @param {number} [strokeColor] - The color the line will be drawn in, i.e. 0xff0000 for red. + * @param {number} [strokeAlpha] - The alpha the line will be drawn in. You can also set the alpha of the overall Shape using its `alpha` property. + */ +var Line = new Class({ + + Extends: Shape, + + Mixins: [ + LineRender + ], + + initialize: + + function Line (scene, x, y, x1, y1, x2, y2, strokeColor, strokeAlpha) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (x1 === undefined) { x1 = 0; } + if (y1 === undefined) { y1 = 0; } + if (x2 === undefined) { x2 = 128; } + if (y2 === undefined) { y2 = 0; } + + Shape.call(this, scene, 'Line', new GeomLine(x1, y1, x2, y2)); + + var width = this.geom.right - this.geom.left; + var height = this.geom.bottom - this.geom.top; + + /** + * The width (or thickness) of the line. + * See the setLineWidth method for extra details on changing this on WebGL. + * + * @name Phaser.GameObjects.Line#lineWidth + * @type {number} + * @since 3.13.0 + */ + this.lineWidth = 1; + + /** + * Private internal value. Holds the start width of the line. + * + * @name Phaser.GameObjects.Line#_startWidth + * @type {number} + * @private + * @since 3.13.0 + */ + this._startWidth = 1; + + /** + * Private internal value. Holds the end width of the line. + * + * @name Phaser.GameObjects.Line#_endWidth + * @type {number} + * @private + * @since 3.13.0 + */ + this._endWidth = 1; + + this.setPosition(x, y); + this.setSize(width, height); + + if (strokeColor !== undefined) + { + this.setStrokeStyle(1, strokeColor, strokeAlpha); + } + + this.updateDisplayOrigin(); + }, + + /** + * Sets the width of the line. + * + * When using the WebGL renderer you can have different start and end widths. + * When using the Canvas renderer only the `startWidth` value is used. The `endWidth` is ignored. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Line#setLineWidth + * @since 3.13.0 + * + * @param {number} startWidth - The start width of the line. + * @param {number} [endWidth] - The end width of the line. Only used in WebGL. + * + * @return {this} This Game Object instance. + */ + setLineWidth: function (startWidth, endWidth) + { + if (endWidth === undefined) { endWidth = startWidth; } + + this._startWidth = startWidth; + this._endWidth = endWidth; + + this.lineWidth = startWidth; + + return this; + }, + + /** + * Sets the start and end coordinates of this Line. + * + * @method Phaser.GameObjects.Line#setTo + * @since 3.13.0 + * + * @param {number} [x1=0] - The horizontal position of the start of the line. + * @param {number} [y1=0] - The vertical position of the start of the line. + * @param {number} [x2=0] - The horizontal position of the end of the line. + * @param {number} [y2=0] - The vertical position of the end of the line. + * + * @return {this} This Line object. + */ + setTo: function (x1, y1, x2, y2) + { + this.geom.setTo(x1, y1, x2, y2); + + return this; + } + +}); + +module.exports = Line; + + +/***/ }), +/* 388 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PolygonRender = __webpack_require__(974); +var Class = __webpack_require__(0); +var Earcut = __webpack_require__(63); +var GetAABB = __webpack_require__(389); +var GeomPolygon = __webpack_require__(192); +var Shape = __webpack_require__(30); +var Smooth = __webpack_require__(392); + +/** + * @classdesc + * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Polygon Shape is created by providing a list of points, which are then used to create an + * internal Polygon geometry object. The points can be set from a variety of formats: + * + * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` + * - An array of Point or Vector2 objects: `[new Phaser.Math.Vec2(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending + * on the coordinates of the points provided, the final shape may be rendered offset from its origin. + * + * @class Polygon + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {any} [points] - The points that make up the polygon. + * @param {number} [fillColor] - The color the polygon will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the polygon will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ +var Polygon = new Class({ + + Extends: Shape, + + Mixins: [ + PolygonRender + ], + + initialize: + + function Polygon (scene, x, y, points, fillColor, fillAlpha) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + Shape.call(this, scene, 'Polygon', new GeomPolygon(points)); + + var bounds = GetAABB(this.geom); + + this.setPosition(x, y); + this.setSize(bounds.width, bounds.height); + + if (fillColor !== undefined) + { + this.setFillStyle(fillColor, fillAlpha); + } + + this.updateDisplayOrigin(); + this.updateData(); + }, + + /** + * Smooths the polygon over the number of iterations specified. + * The base polygon data will be updated and replaced with the smoothed values. + * This call can be chained. + * + * @method Phaser.GameObjects.Polygon#smooth + * @since 3.13.0 + * + * @param {integer} [iterations=1] - The number of times to apply the polygon smoothing. + * + * @return {this} This Game Object instance. + */ + smooth: function (iterations) + { + if (iterations === undefined) { iterations = 1; } + + for (var i = 0; i < iterations; i++) + { + Smooth(this.geom); + } + + return this.updateData(); + }, + + /** + * Internal method that updates the data and path values. + * + * @method Phaser.GameObjects.Polygon#updateData + * @private + * @since 3.13.0 + * + * @return {this} This Game Object instance. + */ + updateData: function () + { + var path = []; + var points = this.geom.points; + + for (var i = 0; i < points.length; i++) + { + path.push(points[i].x, points[i].y); + } + + path.push(points[0].x, points[0].y); + + this.pathIndexes = Earcut(path); + this.pathData = path; + + return this; + } + +}); + +module.exports = Polygon; + + +/***/ }), +/* 389 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); + +/** + * Calculates the bounding AABB rectangle of a polygon. + * + * @function Phaser.Geom.Polygon.GetAABB + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * + * @param {Phaser.Geom.Polygon} polygon - The polygon that should be calculated. + * @param {(Phaser.Geom.Rectangle|object)} [out] - The rectangle or object that has x, y, width, and height properties to store the result. Optional. + * + * @return {(Phaser.Geom.Rectangle|object)} The resulting rectangle or object that is passed in with position and dimensions of the polygon's AABB. + */ +var GetAABB = function (polygon, out) +{ + if (out === undefined) { out = new Rectangle(); } + + var minX = Infinity; + var minY = Infinity; + var maxX = -minX; + var maxY = -minY; + var p; + + for (var i = 0; i < polygon.points.length; i++) + { + p = polygon.points[i]; + + minX = Math.min(minX, p.x); + minY = Math.min(minY, p.y); + maxX = Math.max(maxX, p.x); + maxY = Math.max(maxY, p.y); + } + + out.x = minX; + out.y = minY; + out.width = maxX - minX; + out.height = maxY - minY; + + return out; +}; + +module.exports = GetAABB; + + +/***/ }), +/* 390 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Length = __webpack_require__(55); +var Line = __webpack_require__(54); +var Perimeter = __webpack_require__(391); + +/** + * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, + * based on the given quantity or stepRate values. + * + * @function Phaser.Geom.Polygon.GetPoints + * @since 3.12.0 + * + * @param {Phaser.Geom.Polygon} polygon - The Polygon to get the points from. + * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. + * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. + * + * @return {Phaser.Geom.Point[]} An array of Point objects pertaining to the points around the perimeter of the Polygon. + */ +var GetPoints = function (polygon, quantity, stepRate, out) +{ + if (out === undefined) { out = []; } + + var points = polygon.points; + var perimeter = Perimeter(polygon); + + // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. + if (!quantity) + { + quantity = perimeter / stepRate; + } + + for (var i = 0; i < quantity; i++) + { + var position = perimeter * (i / quantity); + var accumulatedPerimeter = 0; + + for (var j = 0; j < points.length; j++) + { + var pointA = points[j]; + var pointB = points[(j + 1) % points.length]; + var line = new Line( + pointA.x, + pointA.y, + pointB.x, + pointB.y + ); + var length = Length(line); + + if (position < accumulatedPerimeter || position > accumulatedPerimeter + length) + { + accumulatedPerimeter += length; + continue; + } + + var point = line.getPoint((position - accumulatedPerimeter) / length); + out.push(point); + + break; + } + } + + return out; +}; + +module.exports = GetPoints; + + +/***/ }), +/* 391 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Length = __webpack_require__(55); +var Line = __webpack_require__(54); + +/** + * Returns the perimeter of the given Polygon. + * + * @function Phaser.Geom.Polygon.Perimeter + * @since 3.12.0 + * + * @param {Phaser.Geom.Polygon} polygon - The Polygon to get the perimeter of. + * + * @return {number} The perimeter of the Polygon. + */ +var Perimeter = function (polygon) +{ + var points = polygon.points; + var perimeter = 0; + + for (var i = 0; i < points.length; i++) + { + var pointA = points[i]; + var pointB = points[(i + 1) % points.length]; + var line = new Line( + pointA.x, + pointA.y, + pointB.x, + pointB.y + ); + + perimeter += Length(line); + } + + return perimeter; +}; + +module.exports = Perimeter; + + +/***/ }), +/* 392 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @author Igor Ognichenko + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @ignore + */ +var copy = function (out, a) +{ + out[0] = a[0]; + out[1] = a[1]; + + return out; +}; + +/** + * Takes a Polygon object and applies Chaikin's smoothing algorithm on its points. + * + * @function Phaser.Geom.Polygon.Smooth + * @since 3.13.0 + * + * @generic {Phaser.Geom.Polygon} O - [polygon,$return] + * + * @param {Phaser.Geom.Polygon} polygon - The polygon to be smoothed. The polygon will be modified in-place and returned. + * + * @return {Phaser.Geom.Polygon} The input polygon. + */ +var Smooth = function (polygon) +{ + var i; + var points = []; + var data = polygon.points; + + for (i = 0; i < data.length; i++) + { + points.push([ data[i].x, data[i].y ]); + } + + var output = []; + + if (points.length > 0) + { + output.push(copy([ 0, 0 ], points[0])); + } + + for (i = 0; i < points.length - 1; i++) + { + var p0 = points[i]; + var p1 = points[i + 1]; + var p0x = p0[0]; + var p0y = p0[1]; + var p1x = p1[0]; + var p1y = p1[1]; + + output.push([ 0.85 * p0x + 0.15 * p1x, 0.85 * p0y + 0.15 * p1y ]); + output.push([ 0.15 * p0x + 0.85 * p1x, 0.15 * p0y + 0.85 * p1y ]); + } + + if (points.length > 1) + { + output.push(copy([ 0, 0 ], points[points.length - 1])); + } + + return polygon.setTo(output); +}; + +module.exports = Smooth; + + +/***/ }), +/* 393 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GeomRectangle = __webpack_require__(10); +var Shape = __webpack_require__(30); +var RectangleRender = __webpack_require__(977); + +/** + * @classdesc + * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * You can change the size of the rectangle by changing the `width` and `height` properties. + * + * @class Rectangle + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {number} [width=128] - The width of the rectangle. + * @param {number} [height=128] - The height of the rectangle. + * @param {number} [fillColor] - The color the rectangle will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the rectangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ +var Rectangle = new Class({ + + Extends: Shape, + + Mixins: [ + RectangleRender + ], + + initialize: + + function Rectangle (scene, x, y, width, height, fillColor, fillAlpha) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 128; } + if (height === undefined) { height = 128; } + + Shape.call(this, scene, 'Rectangle', new GeomRectangle(0, 0, width, height)); + + this.setPosition(x, y); + this.setSize(width, height); + + if (fillColor !== undefined) + { + this.setFillStyle(fillColor, fillAlpha); + } + + this.updateDisplayOrigin(); + this.updateData(); + }, + + /** + * Internal method that updates the data and path values. + * + * @method Phaser.GameObjects.Rectangle#updateData + * @private + * @since 3.13.0 + * + * @return {this} This Game Object instance. + */ + updateData: function () + { + var path = []; + var rect = this.geom; + var line = this._tempLine; + + rect.getLineA(line); + + path.push(line.x1, line.y1, line.x2, line.y2); + + rect.getLineB(line); + + path.push(line.x2, line.y2); + + rect.getLineC(line); + + path.push(line.x2, line.y2); + + rect.getLineD(line); + + path.push(line.x2, line.y2); + + this.pathData = path; + + return this; + } + +}); + +module.exports = Rectangle; + + +/***/ }), +/* 394 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var StarRender = __webpack_require__(980); +var Class = __webpack_require__(0); +var Earcut = __webpack_require__(63); +var Shape = __webpack_require__(30); + +/** + * @classdesc + * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * As the name implies, the Star shape will display a star in your game. You can control several + * aspects of it including the number of points that constitute the star. The default is 5. If + * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky + * star shape. + * + * You can also control the inner and outer radius, which is how 'long' each point of the star is. + * Modify these values to create more interesting shapes. + * + * @class Star + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [points=5] - The number of points on the star. + * @param {number} [innerRadius=32] - The inner radius of the star. + * @param {number} [outerRadius=64] - The outer radius of the star. + * @param {number} [fillColor] - The color the star will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ +var Star = new Class({ + + Extends: Shape, + + Mixins: [ + StarRender + ], + + initialize: + + function Star (scene, x, y, points, innerRadius, outerRadius, fillColor, fillAlpha) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (points === undefined) { points = 5; } + if (innerRadius === undefined) { innerRadius = 32; } + if (outerRadius === undefined) { outerRadius = 64; } + + Shape.call(this, scene, 'Star', null); + + /** + * Private internal value. + * The number of points in the star. + * + * @name Phaser.GameObjects.Star#_points + * @type {integer} + * @private + * @since 3.13.0 + */ + this._points = points; + + /** + * Private internal value. + * The inner radius of the star. + * + * @name Phaser.GameObjects.Star#_innerRadius + * @type {number} + * @private + * @since 3.13.0 + */ + this._innerRadius = innerRadius; + + /** + * Private internal value. + * The outer radius of the star. + * + * @name Phaser.GameObjects.Star#_outerRadius + * @type {number} + * @private + * @since 3.13.0 + */ + this._outerRadius = outerRadius; + + this.setPosition(x, y); + this.setSize(outerRadius * 2, outerRadius * 2); + + if (fillColor !== undefined) + { + this.setFillStyle(fillColor, fillAlpha); + } + + this.updateDisplayOrigin(); + this.updateData(); + }, + + /** + * Sets the number of points that make up the Star shape. + * This call can be chained. + * + * @method Phaser.GameObjects.Star#setPoints + * @since 3.13.0 + * + * @param {integer} value - The amount of points the Star will have. + * + * @return {this} This Game Object instance. + */ + setPoints: function (value) + { + this._points = value; + + return this.updateData(); + }, + + /** + * Sets the inner radius of the Star shape. + * This call can be chained. + * + * @method Phaser.GameObjects.Star#setInnerRadius + * @since 3.13.0 + * + * @param {number} value - The amount to set the inner radius to. + * + * @return {this} This Game Object instance. + */ + setInnerRadius: function (value) + { + this._innerRadius = value; + + return this.updateData(); + }, + + /** + * Sets the outer radius of the Star shape. + * This call can be chained. + * + * @method Phaser.GameObjects.Star#setOuterRadius + * @since 3.13.0 + * + * @param {number} value - The amount to set the outer radius to. + * + * @return {this} This Game Object instance. + */ + setOuterRadius: function (value) + { + this._outerRadius = value; + + return this.updateData(); + }, + + /** + * The number of points that make up the Star shape. + * + * @name Phaser.GameObjects.Star#points + * @type {integer} + * @default 5 + * @since 3.13.0 + */ + points: { + + get: function () + { + return this._points; + }, + + set: function (value) + { + this._points = value; + + this.updateData(); + } + + }, + + /** + * The inner radius of the Star shape. + * + * @name Phaser.GameObjects.Star#innerRadius + * @type {number} + * @default 32 + * @since 3.13.0 + */ + innerRadius: { + + get: function () + { + return this._innerRadius; + }, + + set: function (value) + { + this._innerRadius = value; + + this.updateData(); + } + + }, + + /** + * The outer radius of the Star shape. + * + * @name Phaser.GameObjects.Star#outerRadius + * @type {number} + * @default 64 + * @since 3.13.0 + */ + outerRadius: { + + get: function () + { + return this._outerRadius; + }, + + set: function (value) + { + this._outerRadius = value; + + this.updateData(); + } + + }, + + /** + * Internal method that updates the data and path values. + * + * @method Phaser.GameObjects.Star#updateData + * @private + * @since 3.13.0 + * + * @return {this} This Game Object instance. + */ + updateData: function () + { + var path = []; + + var points = this._points; + var innerRadius = this._innerRadius; + var outerRadius = this._outerRadius; + + var rot = Math.PI / 2 * 3; + var step = Math.PI / points; + + // So origin 0.5 = the center of the star + var x = outerRadius; + var y = outerRadius; + + path.push(x, y + -outerRadius); + + for (var i = 0; i < points; i++) + { + path.push(x + Math.cos(rot) * outerRadius, y + Math.sin(rot) * outerRadius); + + rot += step; + + path.push(x + Math.cos(rot) * innerRadius, y + Math.sin(rot) * innerRadius); + + rot += step; + } + + path.push(x, y + -outerRadius); + + this.pathIndexes = Earcut(path); + this.pathData = path; + + return this; + } + +}); + +module.exports = Star; + + +/***/ }), +/* 395 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Shape = __webpack_require__(30); +var GeomTriangle = __webpack_require__(69); +var TriangleRender = __webpack_require__(983); + +/** + * @classdesc + * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the + * position of each point of these lines. The triangle is always closed and cannot have an open + * face. If you require that, consider using a Polygon instead. + * + * @class Triangle + * @extends Phaser.GameObjects.Shape + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [x1=0] - The horizontal position of the first point in the triangle. + * @param {number} [y1=128] - The vertical position of the first point in the triangle. + * @param {number} [x2=64] - The horizontal position of the second point in the triangle. + * @param {number} [y2=0] - The vertical position of the second point in the triangle. + * @param {number} [x3=128] - The horizontal position of the third point in the triangle. + * @param {number} [y3=128] - The vertical position of the third point in the triangle. + * @param {number} [fillColor] - The color the triangle will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + */ +var Triangle = new Class({ + + Extends: Shape, + + Mixins: [ + TriangleRender + ], + + initialize: + + function Triangle (scene, x, y, x1, y1, x2, y2, x3, y3, fillColor, fillAlpha) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (x1 === undefined) { x1 = 0; } + if (y1 === undefined) { y1 = 128; } + if (x2 === undefined) { x2 = 64; } + if (y2 === undefined) { y2 = 0; } + if (x3 === undefined) { x3 = 128; } + if (y3 === undefined) { y3 = 128; } + + Shape.call(this, scene, 'Triangle', new GeomTriangle(x1, y1, x2, y2, x3, y3)); + + var width = this.geom.right - this.geom.left; + var height = this.geom.bottom - this.geom.top; + + this.setPosition(x, y); + this.setSize(width, height); + + if (fillColor !== undefined) + { + this.setFillStyle(fillColor, fillAlpha); + } + + this.updateDisplayOrigin(); + this.updateData(); + }, + + /** + * Sets the data for the lines that make up this Triangle shape. + * + * @method Phaser.GameObjects.Triangle#setTo + * @since 3.13.0 + * + * @param {number} [x1=0] - The horizontal position of the first point in the triangle. + * @param {number} [y1=0] - The vertical position of the first point in the triangle. + * @param {number} [x2=0] - The horizontal position of the second point in the triangle. + * @param {number} [y2=0] - The vertical position of the second point in the triangle. + * @param {number} [x3=0] - The horizontal position of the third point in the triangle. + * @param {number} [y3=0] - The vertical position of the third point in the triangle. + * + * @return {this} This Game Object instance. + */ + setTo: function (x1, y1, x2, y2, x3, y3) + { + this.geom.setTo(x1, y1, x2, y2, x3, y3); + + return this.updateData(); + }, + + /** + * Internal method that updates the data and path values. + * + * @method Phaser.GameObjects.Triangle#updateData + * @private + * @since 3.13.0 + * + * @return {this} This Game Object instance. + */ + updateData: function () + { + var path = []; + var tri = this.geom; + var line = this._tempLine; + + tri.getLineA(line); + + path.push(line.x1, line.y1, line.x2, line.y2); + + tri.getLineB(line); + + path.push(line.x2, line.y2); + + tri.getLineC(line); + + path.push(line.x2, line.y2); + + this.pathData = path; + + return this; + } + +}); + +module.exports = Triangle; + + +/***/ }), +/* 396 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); +var Length = __webpack_require__(55); + +/** + * Returns a Point from around the perimeter of a Triangle. + * + * @function Phaser.Geom.Triangle.GetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the point on its perimeter from. + * @param {number} position - The position along the perimeter of the triangle. A value between 0 and 1. + * @param {(Phaser.Geom.Point|object)} [out] - An option Point, or Point-like object to store the value in. If not given a new Point will be created. + * + * @return {(Phaser.Geom.Point|object)} A Point object containing the given position from the perimeter of the triangle. + */ +var GetPoint = function (triangle, position, out) +{ + if (out === undefined) { out = new Point(); } + + var line1 = triangle.getLineA(); + var line2 = triangle.getLineB(); + var line3 = triangle.getLineC(); + + if (position <= 0 || position >= 1) + { + out.x = line1.x1; + out.y = line1.y1; + + return out; + } + + var length1 = Length(line1); + var length2 = Length(line2); + var length3 = Length(line3); + + var perimeter = length1 + length2 + length3; + + var p = perimeter * position; + var localPosition = 0; + + // Which line is it on? + + if (p < length1) + { + // Line 1 + localPosition = p / length1; + + out.x = line1.x1 + (line1.x2 - line1.x1) * localPosition; + out.y = line1.y1 + (line1.y2 - line1.y1) * localPosition; + } + else if (p > length1 + length2) + { + // Line 3 + p -= length1 + length2; + localPosition = p / length3; + + out.x = line3.x1 + (line3.x2 - line3.x1) * localPosition; + out.y = line3.y1 + (line3.y2 - line3.y1) * localPosition; + } + else + { + // Line 2 + p -= length1; + localPosition = p / length2; + + out.x = line2.x1 + (line2.x2 - line2.x1) * localPosition; + out.y = line2.y1 + (line2.y2 - line2.y1) * localPosition; + } + + return out; +}; + +module.exports = GetPoint; + + +/***/ }), +/* 397 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Length = __webpack_require__(55); +var Point = __webpack_require__(3); + +/** + * Returns an array of evenly spaced points on the perimeter of a Triangle. + * + * @function Phaser.Geom.Triangle.GetPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the points from. + * @param {integer} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. + * @param {number} stepRate - If `quantity` is 0, the distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [out] - An array to which the points should be appended. + * + * @return {(array|Phaser.Geom.Point[])} The modified `out` array, or a new array if none was provided. + */ +var GetPoints = function (triangle, quantity, stepRate, out) +{ + if (out === undefined) { out = []; } + + var line1 = triangle.getLineA(); + var line2 = triangle.getLineB(); + var line3 = triangle.getLineC(); + + var length1 = Length(line1); + var length2 = Length(line2); + var length3 = Length(line3); + + var perimeter = length1 + length2 + length3; + + // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead. + if (!quantity) + { + quantity = perimeter / stepRate; + } + + for (var i = 0; i < quantity; i++) + { + var p = perimeter * (i / quantity); + var localPosition = 0; + + var point = new Point(); + + // Which line is it on? + + if (p < length1) + { + // Line 1 + localPosition = p / length1; + + point.x = line1.x1 + (line1.x2 - line1.x1) * localPosition; + point.y = line1.y1 + (line1.y2 - line1.y1) * localPosition; + } + else if (p > length1 + length2) + { + // Line 3 + p -= length1 + length2; + localPosition = p / length3; + + point.x = line3.x1 + (line3.x2 - line3.x1) * localPosition; + point.y = line3.y1 + (line3.y2 - line3.y1) * localPosition; + } + else + { + // Line 2 + p -= length1; + localPosition = p / length2; + + point.x = line2.x1 + (line2.x2 - line2.x1) * localPosition; + point.y = line2.y1 + (line2.y2 - line2.y1) * localPosition; + } + + out.push(point); + } + + return out; +}; + +module.exports = GetPoints; + + +/***/ }), +/* 398 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sets a value in an object, allowing for dot notation to control the depth of the property. + * + * For example: + * + * ```javascript + * var data = { + * world: { + * position: { + * x: 200, + * y: 100 + * } + * } + * }; + * + * SetValue(data, 'world.position.y', 300); + * + * console.log(data.world.position.y); // 300 + * ``` + * + * @function Phaser.Utils.Objects.SetValue + * @since 3.17.0 + * + * @param {object} source - The object to set the value in. + * @param {string} key - The name of the property in the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) + * @param {any} value - The value to set into the property, if found in the source object. + * + * @return {boolean} `true` if the property key was valid and the value was set, otherwise `false`. + */ +var SetValue = function (source, key, value) +{ + if (!source || typeof source === 'number') + { + return false; + } + else if (source.hasOwnProperty(key)) + { + source[key] = value; + + return true; + } + else if (key.indexOf('.') !== -1) + { + var keys = key.split('.'); + var parent = source; + var prev = source; + + // Use for loop here so we can break early + for (var i = 0; i < keys.length; i++) + { + if (parent.hasOwnProperty(keys[i])) + { + // Yes it has a key property, let's carry on down + prev = parent; + parent = parent[keys[i]]; + } + else + { + return false; + } + } + + prev[keys[keys.length - 1]] = value; + + return true; + } + + return false; +}; + +module.exports = SetValue; + + +/***/ }), +/* 399 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Utils = __webpack_require__(9); + +/** + * @classdesc + * A 2D point light. + * + * These are typically created by a {@link Phaser.GameObjects.LightsManager}, available from within a scene via `this.lights`. + * + * Any Game Objects using the Light2D pipeline will then be affected by these Lights. + * + * They can also simply be used to represent a point light for your own purposes. + * + * @class Light + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {number} x - The horizontal position of the light. + * @param {number} y - The vertical position of the light. + * @param {number} radius - The radius of the light. + * @param {number} r - The red color of the light. A value between 0 and 1. + * @param {number} g - The green color of the light. A value between 0 and 1. + * @param {number} b - The blue color of the light. A value between 0 and 1. + * @param {number} intensity - The intensity of the light. + */ +var Light = new Class({ + + initialize: + + function Light (x, y, radius, r, g, b, intensity) + { + /** + * The horizontal position of the light. + * + * @name Phaser.GameObjects.Light#x + * @type {number} + * @since 3.0.0 + */ + this.x = x; + + /** + * The vertical position of the light. + * + * @name Phaser.GameObjects.Light#y + * @type {number} + * @since 3.0.0 + */ + this.y = y; + + /** + * The radius of the light. + * + * @name Phaser.GameObjects.Light#radius + * @type {number} + * @since 3.0.0 + */ + this.radius = radius; + + /** + * The red color of the light. A value between 0 and 1. + * + * @name Phaser.GameObjects.Light#r + * @type {number} + * @since 3.0.0 + */ + this.r = r; + + /** + * The green color of the light. A value between 0 and 1. + * + * @name Phaser.GameObjects.Light#g + * @type {number} + * @since 3.0.0 + */ + this.g = g; + + /** + * The blue color of the light. A value between 0 and 1. + * + * @name Phaser.GameObjects.Light#b + * @type {number} + * @since 3.0.0 + */ + this.b = b; + + /** + * The intensity of the light. + * + * @name Phaser.GameObjects.Light#intensity + * @type {number} + * @since 3.0.0 + */ + this.intensity = intensity; + + /** + * The horizontal scroll factor of the light. + * + * @name Phaser.GameObjects.Light#scrollFactorX + * @type {number} + * @since 3.0.0 + */ + this.scrollFactorX = 1.0; + + /** + * The vertical scroll factor of the light. + * + * @name Phaser.GameObjects.Light#scrollFactorY + * @type {number} + * @since 3.0.0 + */ + this.scrollFactorY = 1.0; + }, + + /** + * Set the properties of the light. + * + * Sets both horizontal and vertical scroll factor to 1. Use {@link Phaser.GameObjects.Light#setScrollFactor} to set + * the scroll factor. + * + * @method Phaser.GameObjects.Light#set + * @since 3.0.0 + * + * @param {number} x - The horizontal position of the light. + * @param {number} y - The vertical position of the light. + * @param {number} radius - The radius of the light. + * @param {number} r - The red color. A value between 0 and 1. + * @param {number} g - The green color. A value between 0 and 1. + * @param {number} b - The blue color. A value between 0 and 1. + * @param {number} intensity - The intensity of the light. + * + * @return {Phaser.GameObjects.Light} This Light object. + */ + set: function (x, y, radius, r, g, b, intensity) + { + this.x = x; + this.y = y; + + this.radius = radius; + + this.r = r; + this.g = g; + this.b = b; + + this.intensity = intensity; + + this.scrollFactorX = 1; + this.scrollFactorY = 1; + + return this; + }, + + /** + * Set the scroll factor of the light. + * + * @method Phaser.GameObjects.Light#setScrollFactor + * @since 3.0.0 + * + * @param {number} x - The horizontal scroll factor of the light. + * @param {number} y - The vertical scroll factor of the light. + * + * @return {Phaser.GameObjects.Light} This Light object. + */ + setScrollFactor: function (x, y) + { + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } + + this.scrollFactorX = x; + this.scrollFactorY = y; + + return this; + }, + + /** + * Set the color of the light from a single integer RGB value. + * + * @method Phaser.GameObjects.Light#setColor + * @since 3.0.0 + * + * @param {number} rgb - The integer RGB color of the light. + * + * @return {Phaser.GameObjects.Light} This Light object. + */ + setColor: function (rgb) + { + var color = Utils.getFloatsFromUintRGB(rgb); + + this.r = color[0]; + this.g = color[1]; + this.b = color[2]; + + return this; + }, + + /** + * Set the intensity of the light. + * + * @method Phaser.GameObjects.Light#setIntensity + * @since 3.0.0 + * + * @param {number} intensity - The intensity of the light. + * + * @return {Phaser.GameObjects.Light} This Light object. + */ + setIntensity: function (intensity) + { + this.intensity = intensity; + + return this; + }, + + /** + * Set the position of the light. + * + * @method Phaser.GameObjects.Light#setPosition + * @since 3.0.0 + * + * @param {number} x - The horizontal position of the light. + * @param {number} y - The vertical position of the light. + * + * @return {Phaser.GameObjects.Light} This Light object. + */ + setPosition: function (x, y) + { + this.x = x; + this.y = y; + + return this; + }, + + /** + * Set the radius of the light. + * + * @method Phaser.GameObjects.Light#setRadius + * @since 3.0.0 + * + * @param {number} radius - The radius of the light. + * + * @return {Phaser.GameObjects.Light} This Light object. + */ + setRadius: function (radius) + { + this.radius = radius; + + return this; + } + +}); + +module.exports = Light; + + +/***/ }), +/* 400 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Light = __webpack_require__(399); +var Utils = __webpack_require__(9); + +/** + * @callback LightForEach + * + * @param {Phaser.GameObjects.Light} light - The Light. + */ + +/** + * @classdesc + * Manages Lights for a Scene. + * + * Affects the rendering of Game Objects using the `Light2D` pipeline. + * + * @class LightsManager + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + */ +var LightsManager = new Class({ + + initialize: + + function LightsManager () + { + /** + * The pool of Lights. + * + * Used to recycle removed Lights for a more efficient use of memory. + * + * @name Phaser.GameObjects.LightsManager#lightPool + * @type {Phaser.GameObjects.Light[]} + * @default [] + * @since 3.0.0 + */ + this.lightPool = []; + + /** + * The Lights in the Scene. + * + * @name Phaser.GameObjects.LightsManager#lights + * @type {Phaser.GameObjects.Light[]} + * @default [] + * @since 3.0.0 + */ + this.lights = []; + + /** + * Lights that have been culled from a Camera's viewport. + * + * Lights in this list will not be rendered. + * + * @name Phaser.GameObjects.LightsManager#culledLights + * @type {Phaser.GameObjects.Light[]} + * @default [] + * @since 3.0.0 + */ + this.culledLights = []; + + /** + * The ambient color. + * + * @name Phaser.GameObjects.LightsManager#ambientColor + * @type {{ r: number, g: number, b: number }} + * @since 3.0.0 + */ + this.ambientColor = { r: 0.1, g: 0.1, b: 0.1 }; + + /** + * Whether the Lights Manager is enabled. + * + * @name Phaser.GameObjects.LightsManager#active + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.active = false; + + /** + * The maximum number of lights that a single Camera and the lights shader can process. + * Change this via the `maxLights` property in your game config, as it cannot be changed at runtime. + * + * @name Phaser.GameObjects.LightsManager#maxLights + * @type {integer} + * @readonly + * @since 3.15.0 + */ + this.maxLights = -1; + }, + + /** + * Enable the Lights Manager. + * + * @method Phaser.GameObjects.LightsManager#enable + * @since 3.0.0 + * + * @return {Phaser.GameObjects.LightsManager} This Lights Manager object. + */ + enable: function () + { + if (this.maxLights === -1) + { + this.maxLights = this.scene.sys.game.renderer.config.maxLights; + } + + this.active = true; + + return this; + }, + + /** + * Disable the Lights Manager. + * + * @method Phaser.GameObjects.LightsManager#disable + * @since 3.0.0 + * + * @return {Phaser.GameObjects.LightsManager} This Lights Manager object. + */ + disable: function () + { + this.active = false; + + return this; + }, + + /** + * Cull any Lights that aren't visible to the given Camera. + * + * Culling Lights improves performance by ensuring that only Lights within a Camera's viewport are rendered. + * + * @method Phaser.GameObjects.LightsManager#cull + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to cull Lights for. + * + * @return {Phaser.GameObjects.Light[]} The culled Lights. + */ + cull: function (camera) + { + var lights = this.lights; + var culledLights = this.culledLights; + var length = lights.length; + var cameraCenterX = camera.x + camera.width / 2.0; + var cameraCenterY = camera.y + camera.height / 2.0; + var cameraRadius = (camera.width + camera.height) / 2.0; + var point = { x: 0, y: 0 }; + var cameraMatrix = camera.matrix; + var viewportHeight = this.systems.game.config.height; + + culledLights.length = 0; + + for (var index = 0; index < length && culledLights.length < this.maxLights; index++) + { + var light = lights[index]; + + cameraMatrix.transformPoint(light.x, light.y, point); + + // We'll just use bounding spheres to test if lights should be rendered + var dx = cameraCenterX - (point.x - (camera.scrollX * light.scrollFactorX * camera.zoom)); + var dy = cameraCenterY - (viewportHeight - (point.y - (camera.scrollY * light.scrollFactorY) * camera.zoom)); + var distance = Math.sqrt(dx * dx + dy * dy); + + if (distance < light.radius + cameraRadius) + { + culledLights.push(lights[index]); + } + } + + return culledLights; + }, + + /** + * Iterate over each Light with a callback. + * + * @method Phaser.GameObjects.LightsManager#forEachLight + * @since 3.0.0 + * + * @param {LightForEach} callback - The callback that is called with each Light. + * + * @return {Phaser.GameObjects.LightsManager} This Lights Manager object. + */ + forEachLight: function (callback) + { + if (!callback) + { + return; + } + + var lights = this.lights; + var length = lights.length; + + for (var index = 0; index < length; ++index) + { + callback(lights[index]); + } + + return this; + }, + + /** + * Set the ambient light color. + * + * @method Phaser.GameObjects.LightsManager#setAmbientColor + * @since 3.0.0 + * + * @param {number} rgb - The integer RGB color of the ambient light. + * + * @return {Phaser.GameObjects.LightsManager} This Lights Manager object. + */ + setAmbientColor: function (rgb) + { + var color = Utils.getFloatsFromUintRGB(rgb); + + this.ambientColor.r = color[0]; + this.ambientColor.g = color[1]; + this.ambientColor.b = color[2]; + + return this; + }, + + /** + * Returns the maximum number of Lights allowed to appear at once. + * + * @method Phaser.GameObjects.LightsManager#getMaxVisibleLights + * @since 3.0.0 + * + * @return {integer} The maximum number of Lights allowed to appear at once. + */ + getMaxVisibleLights: function () + { + return 10; + }, + + /** + * Get the number of Lights managed by this Lights Manager. + * + * @method Phaser.GameObjects.LightsManager#getLightCount + * @since 3.0.0 + * + * @return {integer} The number of Lights managed by this Lights Manager. + */ + getLightCount: function () + { + return this.lights.length; + }, + + /** + * Add a Light. + * + * @method Phaser.GameObjects.LightsManager#addLight + * @since 3.0.0 + * + * @param {number} [x=0] - The horizontal position of the Light. + * @param {number} [y=0] - The vertical position of the Light. + * @param {number} [radius=100] - The radius of the Light. + * @param {number} [rgb=0xffffff] - The integer RGB color of the light. + * @param {number} [intensity=1] - The intensity of the Light. + * + * @return {Phaser.GameObjects.Light} The Light that was added. + */ + addLight: function (x, y, radius, rgb, intensity) + { + var color = null; + var light = null; + + x = (x === undefined) ? 0.0 : x; + y = (y === undefined) ? 0.0 : y; + rgb = (rgb === undefined) ? 0xffffff : rgb; + radius = (radius === undefined) ? 100.0 : radius; + intensity = (intensity === undefined) ? 1.0 : intensity; + + color = Utils.getFloatsFromUintRGB(rgb); + light = null; + + if (this.lightPool.length > 0) + { + light = this.lightPool.pop(); + light.set(x, y, radius, color[0], color[1], color[2], intensity); + } + else + { + light = new Light(x, y, radius, color[0], color[1], color[2], intensity); + } + + this.lights.push(light); + + return light; + }, + + /** + * Remove a Light. + * + * @method Phaser.GameObjects.LightsManager#removeLight + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Light} light - The Light to remove. + * + * @return {Phaser.GameObjects.LightsManager} This Lights Manager object. + */ + removeLight: function (light) + { + var index = this.lights.indexOf(light); + + if (index >= 0) + { + this.lightPool.push(light); + this.lights.splice(index, 1); + } + + return this; + }, + + /** + * Shut down the Lights Manager. + * + * Recycles all active Lights into the Light pool, resets ambient light color and clears the lists of Lights and + * culled Lights. + * + * @method Phaser.GameObjects.LightsManager#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + while (this.lights.length > 0) + { + this.lightPool.push(this.lights.pop()); + } + + this.ambientColor = { r: 0.1, g: 0.1, b: 0.1 }; + this.culledLights.length = 0; + this.lights.length = 0; + }, + + /** + * Destroy the Lights Manager. + * + * Cleans up all references by calling {@link Phaser.GameObjects.LightsManager#shutdown}. + * + * @method Phaser.GameObjects.LightsManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + } + +}); + +module.exports = LightsManager; + + +/***/ }), +/* 401 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Geom + */ + +module.exports = { + + Circle: __webpack_require__(1039), + Ellipse: __webpack_require__(1049), + Intersects: __webpack_require__(402), + Line: __webpack_require__(1068), + Point: __webpack_require__(1089), + Polygon: __webpack_require__(1103), + Rectangle: __webpack_require__(417), + Triangle: __webpack_require__(1133) + +}; + + +/***/ }), +/* 402 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Geom.Intersects + */ + +module.exports = { + + CircleToCircle: __webpack_require__(403), + CircleToRectangle: __webpack_require__(404), + GetCircleToCircle: __webpack_require__(1059), + GetCircleToRectangle: __webpack_require__(1060), + GetLineToCircle: __webpack_require__(196), + GetLineToRectangle: __webpack_require__(198), + GetRectangleIntersection: __webpack_require__(1061), + GetRectangleToRectangle: __webpack_require__(1062), + GetRectangleToTriangle: __webpack_require__(1063), + GetTriangleToCircle: __webpack_require__(1064), + GetTriangleToLine: __webpack_require__(409), + GetTriangleToTriangle: __webpack_require__(1065), + LineToCircle: __webpack_require__(197), + LineToLine: __webpack_require__(82), + LineToRectangle: __webpack_require__(405), + PointToLine: __webpack_require__(413), + PointToLineSegment: __webpack_require__(1066), + RectangleToRectangle: __webpack_require__(130), + RectangleToTriangle: __webpack_require__(406), + RectangleToValues: __webpack_require__(1067), + TriangleToCircle: __webpack_require__(408), + TriangleToLine: __webpack_require__(410), + TriangleToTriangle: __webpack_require__(411) + +}; + + +/***/ }), +/* 403 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DistanceBetween = __webpack_require__(57); + +/** + * Checks if two Circles intersect. + * + * @function Phaser.Geom.Intersects.CircleToCircle + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circleA - The first Circle to check for intersection. + * @param {Phaser.Geom.Circle} circleB - The second Circle to check for intersection. + * + * @return {boolean} `true` if the two Circles intersect, otherwise `false`. + */ +var CircleToCircle = function (circleA, circleB) +{ + return (DistanceBetween(circleA.x, circleA.y, circleB.x, circleB.y) <= (circleA.radius + circleB.radius)); +}; + +module.exports = CircleToCircle; + + +/***/ }), +/* 404 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks for intersection between a circle and a rectangle. + * + * @function Phaser.Geom.Intersects.CircleToRectangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The circle to be checked. + * @param {Phaser.Geom.Rectangle} rect - The rectangle to be checked. + * + * @return {boolean} `true` if the two objects intersect, otherwise `false`. + */ +var CircleToRectangle = function (circle, rect) +{ + var halfWidth = rect.width / 2; + var halfHeight = rect.height / 2; + + var cx = Math.abs(circle.x - rect.x - halfWidth); + var cy = Math.abs(circle.y - rect.y - halfHeight); + var xDist = halfWidth + circle.radius; + var yDist = halfHeight + circle.radius; + + if (cx > xDist || cy > yDist) + { + return false; + } + else if (cx <= halfWidth || cy <= halfHeight) + { + return true; + } + else + { + var xCornerDist = cx - halfWidth; + var yCornerDist = cy - halfHeight; + var xCornerDistSq = xCornerDist * xCornerDist; + var yCornerDistSq = yCornerDist * yCornerDist; + var maxCornerDistSq = circle.radius * circle.radius; + + return (xCornerDistSq + yCornerDistSq <= maxCornerDistSq); + } +}; + +module.exports = CircleToRectangle; + + +/***/ }), +/* 405 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks for intersection between the Line and a Rectangle shape, or a rectangle-like + * object, with public `x`, `y`, `right` and `bottom` properties, such as a Sprite or Body. + * + * An intersection is considered valid if: + * + * The line starts within, or ends within, the Rectangle. + * The line segment intersects one of the 4 rectangle edges. + * + * The for the purposes of this function rectangles are considered 'solid'. + * + * @function Phaser.Geom.Intersects.LineToRectangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The Line to check for intersection. + * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle to check for intersection. + * + * @return {boolean} `true` if the Line and the Rectangle intersect, `false` otherwise. + */ +var LineToRectangle = function (line, rect) +{ + var x1 = line.x1; + var y1 = line.y1; + + var x2 = line.x2; + var y2 = line.y2; + + var bx1 = rect.x; + var by1 = rect.y; + var bx2 = rect.right; + var by2 = rect.bottom; + + var t = 0; + + // If the start or end of the line is inside the rect then we assume + // collision, as rects are solid for our use-case. + + if ((x1 >= bx1 && x1 <= bx2 && y1 >= by1 && y1 <= by2) || + (x2 >= bx1 && x2 <= bx2 && y2 >= by1 && y2 <= by2)) + { + return true; + } + + if (x1 < bx1 && x2 >= bx1) + { + // Left edge + t = y1 + (y2 - y1) * (bx1 - x1) / (x2 - x1); + + if (t > by1 && t <= by2) + { + return true; + } + } + else if (x1 > bx2 && x2 <= bx2) + { + // Right edge + t = y1 + (y2 - y1) * (bx2 - x1) / (x2 - x1); + + if (t >= by1 && t <= by2) + { + return true; + } + } + + if (y1 < by1 && y2 >= by1) + { + // Top edge + t = x1 + (x2 - x1) * (by1 - y1) / (y2 - y1); + + if (t >= bx1 && t <= bx2) + { + return true; + } + } + else if (y1 > by2 && y2 <= by2) + { + // Bottom edge + t = x1 + (x2 - x1) * (by2 - y1) / (y2 - y1); + + if (t >= bx1 && t <= bx2) + { + return true; + } + } + + return false; +}; + +module.exports = LineToRectangle; + + +/***/ }), +/* 406 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var LineToLine = __webpack_require__(82); +var Contains = __webpack_require__(47); +var ContainsArray = __webpack_require__(199); +var Decompose = __webpack_require__(407); + +/** + * Checks for intersection between Rectangle shape and Triangle shape. + * + * @function Phaser.Geom.Intersects.RectangleToTriangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - Rectangle object to test. + * @param {Phaser.Geom.Triangle} triangle - Triangle object to test. + * + * @return {boolean} A value of `true` if objects intersect; otherwise `false`. + */ +var RectangleToTriangle = function (rect, triangle) +{ + // First the cheapest ones: + + if ( + triangle.left > rect.right || + triangle.right < rect.left || + triangle.top > rect.bottom || + triangle.bottom < rect.top) + { + return false; + } + + var triA = triangle.getLineA(); + var triB = triangle.getLineB(); + var triC = triangle.getLineC(); + + // Are any of the triangle points within the rectangle? + + if (Contains(rect, triA.x1, triA.y1) || Contains(rect, triA.x2, triA.y2)) + { + return true; + } + + if (Contains(rect, triB.x1, triB.y1) || Contains(rect, triB.x2, triB.y2)) + { + return true; + } + + if (Contains(rect, triC.x1, triC.y1) || Contains(rect, triC.x2, triC.y2)) + { + return true; + } + + // Cheap tests over, now to see if any of the lines intersect ... + + var rectA = rect.getLineA(); + var rectB = rect.getLineB(); + var rectC = rect.getLineC(); + var rectD = rect.getLineD(); + + if (LineToLine(triA, rectA) || LineToLine(triA, rectB) || LineToLine(triA, rectC) || LineToLine(triA, rectD)) + { + return true; + } + + if (LineToLine(triB, rectA) || LineToLine(triB, rectB) || LineToLine(triB, rectC) || LineToLine(triB, rectD)) + { + return true; + } + + if (LineToLine(triC, rectA) || LineToLine(triC, rectB) || LineToLine(triC, rectC) || LineToLine(triC, rectD)) + { + return true; + } + + // None of the lines intersect, so are any rectangle points within the triangle? + + var points = Decompose(rect); + var within = ContainsArray(triangle, points, true); + + return (within.length > 0); +}; + +module.exports = RectangleToTriangle; + + +/***/ }), +/* 407 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Create an array of points for each corner of a Rectangle + * If an array is specified, each point object will be added to the end of the array, otherwise a new array will be created. + * + * @function Phaser.Geom.Rectangle.Decompose + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle object to be decomposed. + * @param {array} [out] - If provided, each point will be added to this array. + * + * @return {array} Will return the array you specified or a new array containing the points of the Rectangle. + */ +var Decompose = function (rect, out) +{ + if (out === undefined) { out = []; } + + out.push({ x: rect.x, y: rect.y }); + out.push({ x: rect.right, y: rect.y }); + out.push({ x: rect.right, y: rect.bottom }); + out.push({ x: rect.x, y: rect.bottom }); + + return out; +}; + +module.exports = Decompose; + + +/***/ }), +/* 408 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var LineToCircle = __webpack_require__(197); +var Contains = __webpack_require__(81); + +/** + * Checks if a Triangle and a Circle intersect. + * + * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection. + * + * @function Phaser.Geom.Intersects.TriangleToCircle + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to check for intersection. + * @param {Phaser.Geom.Circle} circle - The Circle to check for intersection. + * + * @return {boolean} `true` if the Triangle and the `Circle` intersect, otherwise `false`. + */ +var TriangleToCircle = function (triangle, circle) +{ + // First the cheapest ones: + + if ( + triangle.left > circle.right || + triangle.right < circle.left || + triangle.top > circle.bottom || + triangle.bottom < circle.top) + { + return false; + } + + if (Contains(triangle, circle.x, circle.y)) + { + return true; + } + + if (LineToCircle(triangle.getLineA(), circle)) + { + return true; + } + + if (LineToCircle(triangle.getLineB(), circle)) + { + return true; + } + + if (LineToCircle(triangle.getLineC(), circle)) + { + return true; + } + + return false; +}; + +module.exports = TriangleToCircle; + + +/***/ }), +/* 409 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); +var TriangleToLine = __webpack_require__(410); +var LineToLine = __webpack_require__(82); + +/** + * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array. + * + * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". + * + * @function Phaser.Geom.Intersects.GetTriangleToLine + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to check with. + * @param {Phaser.Geom.Line} line - The Line to check with. + * @param {array} [out] - An optional array in which to store the points of intersection. + * + * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array. + */ +var GetTriangleToLine = function (triangle, line, out) +{ + if (out === undefined) { out = []; } + + if (TriangleToLine(triangle, line)) + { + var lineA = triangle.getLineA(); + var lineB = triangle.getLineB(); + var lineC = triangle.getLineC(); + + var output = [ new Point(), new Point(), new Point() ]; + + var result = [ + LineToLine(lineA, line, output[0]), + LineToLine(lineB, line, output[1]), + LineToLine(lineC, line, output[2]) + ]; + + for (var i = 0; i < 3; i++) + { + if (result[i]) { out.push(output[i]); } + } + } + + return out; +}; + +module.exports = GetTriangleToLine; + + +/***/ }), +/* 410 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Contains = __webpack_require__(81); +var LineToLine = __webpack_require__(82); + +/** + * Checks if a Triangle and a Line intersect. + * + * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". + * + * @function Phaser.Geom.Intersects.TriangleToLine + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to check with. + * @param {Phaser.Geom.Line} line - The Line to check with. + * + * @return {boolean} `true` if the Triangle and the Line intersect, otherwise `false`. + */ +var TriangleToLine = function (triangle, line) +{ + // If the Triangle contains either the start or end point of the line, it intersects + if (Contains(triangle, line.getPointA()) || Contains(triangle, line.getPointB())) + { + return true; + } + + // Now check the line against each line of the Triangle + if (LineToLine(triangle.getLineA(), line)) + { + return true; + } + + if (LineToLine(triangle.getLineB(), line)) + { + return true; + } + + if (LineToLine(triangle.getLineC(), line)) + { + return true; + } + + return false; +}; + +module.exports = TriangleToLine; + + +/***/ }), +/* 411 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ContainsArray = __webpack_require__(199); +var Decompose = __webpack_require__(412); +var LineToLine = __webpack_require__(82); + +/** + * Checks if two Triangles intersect. + * + * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid". + * + * @function Phaser.Geom.Intersects.TriangleToTriangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangleA - The first Triangle to check for intersection. + * @param {Phaser.Geom.Triangle} triangleB - The second Triangle to check for intersection. + * + * @return {boolean} `true` if the Triangles intersect, otherwise `false`. + */ +var TriangleToTriangle = function (triangleA, triangleB) +{ + // First the cheapest ones: + + if ( + triangleA.left > triangleB.right || + triangleA.right < triangleB.left || + triangleA.top > triangleB.bottom || + triangleA.bottom < triangleB.top) + { + return false; + } + + var lineAA = triangleA.getLineA(); + var lineAB = triangleA.getLineB(); + var lineAC = triangleA.getLineC(); + + var lineBA = triangleB.getLineA(); + var lineBB = triangleB.getLineB(); + var lineBC = triangleB.getLineC(); + + // Now check the lines against each line of TriangleB + if (LineToLine(lineAA, lineBA) || LineToLine(lineAA, lineBB) || LineToLine(lineAA, lineBC)) + { + return true; + } + + if (LineToLine(lineAB, lineBA) || LineToLine(lineAB, lineBB) || LineToLine(lineAB, lineBC)) + { + return true; + } + + if (LineToLine(lineAC, lineBA) || LineToLine(lineAC, lineBB) || LineToLine(lineAC, lineBC)) + { + return true; + } + + // Nope, so check to see if any of the points of triangleA are within triangleB + + var points = Decompose(triangleA); + var within = ContainsArray(triangleB, points, true); + + if (within.length > 0) + { + return true; + } + + // Finally check to see if any of the points of triangleB are within triangleA + + points = Decompose(triangleB); + within = ContainsArray(triangleA, points, true); + + if (within.length > 0) + { + return true; + } + + return false; +}; + +module.exports = TriangleToTriangle; + + +/***/ }), +/* 412 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Decomposes a Triangle into an array of its points. + * + * @function Phaser.Geom.Triangle.Decompose + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to decompose. + * @param {array} [out] - An array to store the points into. + * + * @return {array} The provided `out` array, or a new array if none was provided, with three objects with `x` and `y` properties representing each point of the Triangle appended to it. + */ +var Decompose = function (triangle, out) +{ + if (out === undefined) { out = []; } + + out.push({ x: triangle.x1, y: triangle.y1 }); + out.push({ x: triangle.x2, y: triangle.y2 }); + out.push({ x: triangle.x3, y: triangle.y3 }); + + return out; +}; + +module.exports = Decompose; + + +/***/ }), +/* 413 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if the a Point falls between the two end-points of a Line, based on the given line thickness. + * + * Assumes that the line end points are circular, not square. + * + * @function Phaser.Geom.Intersects.PointToLine + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|any)} point - The point, or point-like object to check. + * @param {Phaser.Geom.Line} line - The line segment to test for intersection on. + * @param {number} [lineThickness=1] - The line thickness. Assumes that the line end points are circular. + * + * @return {boolean} `true` if the Point falls on the Line, otherwise `false`. + */ +var PointToLine = function (point, line, lineThickness) +{ + if (lineThickness === undefined) { lineThickness = 1; } + + var x1 = line.x1; + var y1 = line.y1; + + var x2 = line.x2; + var y2 = line.y2; + + var px = point.x; + var py = point.y; + + var L2 = (((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))); + + if (L2 === 0) + { + return false; + } + + var r = (((px - x1) * (x2 - x1)) + ((py - y1) * (y2 - y1))) / L2; + + // Assume line thickness is circular + if (r < 0) + { + // Outside line1 + return (Math.sqrt(((x1 - px) * (x1 - px)) + ((y1 - py) * (y1 - py))) <= lineThickness); + } + else if ((r >= 0) && (r <= 1)) + { + // On the line segment + var s = (((y1 - py) * (x2 - x1)) - ((x1 - px) * (y2 - y1))) / L2; + + return (Math.abs(s) * Math.sqrt(L2) <= lineThickness); + } + else + { + // Outside line2 + return (Math.sqrt(((x2 - px) * (x2 - px)) + ((y2 - py) * (y2 - py))) <= lineThickness); + } +}; + +module.exports = PointToLine; + + +/***/ }), +/* 414 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(23); +var Wrap = __webpack_require__(56); +var Angle = __webpack_require__(83); + +/** + * Get the angle of the normal of the given line in radians. + * + * @function Phaser.Geom.Line.NormalAngle + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the angle of the normal of. + * + * @return {number} The angle of the normal of the line in radians. + */ +var NormalAngle = function (line) +{ + var angle = Angle(line) - MATH_CONST.TAU; + + return Wrap(angle, -Math.PI, Math.PI); +}; + +module.exports = NormalAngle; + + +/***/ }), +/* 415 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the magnitude of the point, which equivalent to the length of the line from the origin to this point. + * + * @function Phaser.Geom.Point.GetMagnitude + * @since 3.0.0 + * + * @param {Phaser.Geom.Point} point - The point to calculate the magnitude for + * + * @return {number} The resulting magnitude + */ +var GetMagnitude = function (point) +{ + return Math.sqrt((point.x * point.x) + (point.y * point.y)); +}; + +module.exports = GetMagnitude; + + +/***/ }), +/* 416 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the square of magnitude of given point.(Can be used for fast magnitude calculation of point) + * + * @function Phaser.Geom.Point.GetMagnitudeSq + * @since 3.0.0 + * + * @param {Phaser.Geom.Point} point - Returns square of the magnitude/length of given point. + * + * @return {number} Returns square of the magnitude of given point. + */ +var GetMagnitudeSq = function (point) +{ + return (point.x * point.x) + (point.y * point.y); +}; + +module.exports = GetMagnitudeSq; + + +/***/ }), +/* 417 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); + +Rectangle.Area = __webpack_require__(1108); +Rectangle.Ceil = __webpack_require__(1109); +Rectangle.CeilAll = __webpack_require__(1110); +Rectangle.CenterOn = __webpack_require__(162); +Rectangle.Clone = __webpack_require__(1111); +Rectangle.Contains = __webpack_require__(47); +Rectangle.ContainsPoint = __webpack_require__(1112); +Rectangle.ContainsRect = __webpack_require__(418); +Rectangle.CopyFrom = __webpack_require__(1113); +Rectangle.Decompose = __webpack_require__(407); +Rectangle.Equals = __webpack_require__(1114); +Rectangle.FitInside = __webpack_require__(1115); +Rectangle.FitOutside = __webpack_require__(1116); +Rectangle.Floor = __webpack_require__(1117); +Rectangle.FloorAll = __webpack_require__(1118); +Rectangle.FromPoints = __webpack_require__(172); +Rectangle.GetAspectRatio = __webpack_require__(201); +Rectangle.GetCenter = __webpack_require__(1119); +Rectangle.GetPoint = __webpack_require__(147); +Rectangle.GetPoints = __webpack_require__(249); +Rectangle.GetSize = __webpack_require__(1120); +Rectangle.Inflate = __webpack_require__(1121); +Rectangle.Intersection = __webpack_require__(1122); +Rectangle.MarchingAnts = __webpack_require__(260); +Rectangle.MergePoints = __webpack_require__(1123); +Rectangle.MergeRect = __webpack_require__(1124); +Rectangle.MergeXY = __webpack_require__(1125); +Rectangle.Offset = __webpack_require__(1126); +Rectangle.OffsetPoint = __webpack_require__(1127); +Rectangle.Overlaps = __webpack_require__(1128); +Rectangle.Perimeter = __webpack_require__(108); +Rectangle.PerimeterPoint = __webpack_require__(1129); +Rectangle.Random = __webpack_require__(150); +Rectangle.RandomOutside = __webpack_require__(1130); +Rectangle.SameDimensions = __webpack_require__(1131); +Rectangle.Scale = __webpack_require__(1132); +Rectangle.Union = __webpack_require__(364); + +module.exports = Rectangle; + + +/***/ }), +/* 418 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Tests if one rectangle fully contains another. + * + * @function Phaser.Geom.Rectangle.ContainsRect + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rectA - The first rectangle. + * @param {Phaser.Geom.Rectangle} rectB - The second rectangle. + * + * @return {boolean} True only if rectA fully contains rectB. + */ +var ContainsRect = function (rectA, rectB) +{ + // Volume check (if rectB volume > rectA then rectA cannot contain it) + if ((rectB.width * rectB.height) > (rectA.width * rectA.height)) + { + return false; + } + + return ( + (rectB.x > rectA.x && rectB.x < rectA.right) && + (rectB.right > rectA.x && rectB.right < rectA.right) && + (rectB.y > rectA.y && rectB.y < rectA.bottom) && + (rectB.bottom > rectA.y && rectB.bottom < rectA.bottom) + ); +}; + +module.exports = ContainsRect; + + +/***/ }), +/* 419 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +// The three medians (the lines drawn from the vertices to the bisectors of the opposite sides) +// meet in the centroid or center of mass (center of gravity). +// The centroid divides each median in a ratio of 2:1 + +/** + * Calculates the position of a Triangle's centroid, which is also its center of mass (center of gravity). + * + * The centroid is the point in a Triangle at which its three medians (the lines drawn from the vertices to the bisectors of the opposite sides) meet. It divides each one in a 2:1 ratio. + * + * @function Phaser.Geom.Triangle.Centroid + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to use. + * @param {(Phaser.Geom.Point|object)} [out] - An object to store the coordinates in. + * + * @return {(Phaser.Geom.Point|object)} The `out` object with modified `x` and `y` properties, or a new Point if none was provided. + */ +var Centroid = function (triangle, out) +{ + if (out === undefined) { out = new Point(); } + + out.x = (triangle.x1 + triangle.x2 + triangle.x3) / 3; + out.y = (triangle.y1 + triangle.y2 + triangle.y3) / 3; + + return out; +}; + +module.exports = Centroid; + + +/***/ }), +/* 420 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves each point (vertex) of a Triangle by a given offset, thus moving the entire Triangle by that offset. + * + * @function Phaser.Geom.Triangle.Offset + * @since 3.0.0 + * + * @generic {Phaser.Geom.Triangle} O - [triangle,$return] + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to move. + * @param {number} x - The horizontal offset (distance) by which to move each point. Can be positive or negative. + * @param {number} y - The vertical offset (distance) by which to move each point. Can be positive or negative. + * + * @return {Phaser.Geom.Triangle} The modified Triangle. + */ +var Offset = function (triangle, x, y) +{ + triangle.x1 += x; + triangle.y1 += y; + + triangle.x2 += x; + triangle.y2 += y; + + triangle.x3 += x; + triangle.y3 += y; + + return triangle; +}; + +module.exports = Offset; + + +/***/ }), +/* 421 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +// The three angle bisectors of a triangle meet in one point called the incenter. +// It is the center of the incircle, the circle inscribed in the triangle. + +function getLength (x1, y1, x2, y2) +{ + var x = x1 - x2; + var y = y1 - y2; + var magnitude = (x * x) + (y * y); + + return Math.sqrt(magnitude); +} + +/** + * Calculates the position of the incenter of a Triangle object. This is the point where its three angle bisectors meet and it's also the center of the incircle, which is the circle inscribed in the triangle. + * + * @function Phaser.Geom.Triangle.InCenter + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to find the incenter of. + * @param {Phaser.Geom.Point} [out] - An optional Point in which to store the coordinates. + * + * @return {Phaser.Geom.Point} Point (x, y) of the center pixel of the triangle. + */ +var InCenter = function (triangle, out) +{ + if (out === undefined) { out = new Point(); } + + var x1 = triangle.x1; + var y1 = triangle.y1; + + var x2 = triangle.x2; + var y2 = triangle.y2; + + var x3 = triangle.x3; + var y3 = triangle.y3; + + var d1 = getLength(x3, y3, x2, y2); + var d2 = getLength(x1, y1, x3, y3); + var d3 = getLength(x2, y2, x1, y1); + + var p = d1 + d2 + d3; + + out.x = (x1 * d1 + x2 * d2 + x3 * d3) / p; + out.y = (y1 * d1 + y2 * d2 + y3 * d3) / p; + + return out; +}; + +module.exports = InCenter; + + +/***/ }), +/* 422 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Creates a new Interactive Object. + * + * This is called automatically by the Input Manager when you enable a Game Object for input. + * + * The resulting Interactive Object is mapped to the Game Object's `input` property. + * + * @function Phaser.Input.CreateInteractiveObject + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to which this Interactive Object is bound. + * @param {any} hitArea - The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle. + * @param {Phaser.Types.Input.HitAreaCallback} hitAreaCallback - The 'contains' check callback that the hit area shape will use for all hit tests. + * + * @return {Phaser.Types.Input.InteractiveObject} The new Interactive Object. + */ +var CreateInteractiveObject = function (gameObject, hitArea, hitAreaCallback) +{ + return { + + gameObject: gameObject, + + enabled: true, + draggable: false, + dropZone: false, + cursor: false, + + target: null, + + camera: null, + + hitArea: hitArea, + hitAreaCallback: hitAreaCallback, + + // Has the dev specified their own shape, or is this bound to the texture size? + customHitArea: false, + + localX: 0, + localY: 0, + + // 0 = Not being dragged + // 1 = Being checked for dragging + // 2 = Being dragged + dragState: 0, + + dragStartX: 0, + dragStartY: 0, + dragStartXGlobal: 0, + dragStartYGlobal: 0, + + dragX: 0, + dragY: 0 + + }; +}; + +module.exports = CreateInteractiveObject; + + +/***/ }), +/* 423 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * Contains information about a specific Gamepad Axis. + * Axis objects are created automatically by the Gamepad as they are needed. + * + * @class Axis + * @memberof Phaser.Input.Gamepad + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Input.Gamepad.Gamepad} pad - A reference to the Gamepad that this Axis belongs to. + * @param {integer} index - The index of this Axis. + */ +var Axis = new Class({ + + initialize: + + function Axis (pad, index) + { + /** + * A reference to the Gamepad that this Axis belongs to. + * + * @name Phaser.Input.Gamepad.Axis#pad + * @type {Phaser.Input.Gamepad.Gamepad} + * @since 3.0.0 + */ + this.pad = pad; + + /** + * An event emitter to use to emit the axis events. + * + * @name Phaser.Input.Gamepad.Axis#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = pad.events; + + /** + * The index of this Axis. + * + * @name Phaser.Input.Gamepad.Axis#index + * @type {integer} + * @since 3.0.0 + */ + this.index = index; + + /** + * The raw axis value, between -1 and 1 with 0 being dead center. + * Use the method `getValue` to get a normalized value with the threshold applied. + * + * @name Phaser.Input.Gamepad.Axis#value + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.value = 0; + + /** + * Movement tolerance threshold below which axis values are ignored in `getValue`. + * + * @name Phaser.Input.Gamepad.Axis#threshold + * @type {number} + * @default 0.1 + * @since 3.0.0 + */ + this.threshold = 0.1; + }, + + /** + * Internal update handler for this Axis. + * Called automatically by the Gamepad as part of its update. + * + * @method Phaser.Input.Gamepad.Axis#update + * @private + * @since 3.0.0 + * + * @param {number} value - The value of the axis movement. + */ + update: function (value) + { + this.value = value; + }, + + /** + * Applies the `threshold` value to the axis and returns it. + * + * @method Phaser.Input.Gamepad.Axis#getValue + * @since 3.0.0 + * + * @return {number} The axis value, adjusted for the movement threshold. + */ + getValue: function () + { + return (Math.abs(this.value) < this.threshold) ? 0 : this.value; + }, + + /** + * Destroys this Axis instance and releases external references it holds. + * + * @method Phaser.Input.Gamepad.Axis#destroy + * @since 3.10.0 + */ + destroy: function () + { + this.pad = null; + this.events = null; + } + +}); + +module.exports = Axis; + + +/***/ }), +/* 424 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(203); + +/** + * @classdesc + * Contains information about a specific button on a Gamepad. + * Button objects are created automatically by the Gamepad as they are needed. + * + * @class Button + * @memberof Phaser.Input.Gamepad + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Input.Gamepad.Gamepad} pad - A reference to the Gamepad that this Button belongs to. + * @param {integer} index - The index of this Button. + */ +var Button = new Class({ + + initialize: + + function Button (pad, index) + { + /** + * A reference to the Gamepad that this Button belongs to. + * + * @name Phaser.Input.Gamepad.Button#pad + * @type {Phaser.Input.Gamepad.Gamepad} + * @since 3.0.0 + */ + this.pad = pad; + + /** + * An event emitter to use to emit the button events. + * + * @name Phaser.Input.Gamepad.Button#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = pad.manager; + + /** + * The index of this Button. + * + * @name Phaser.Input.Gamepad.Button#index + * @type {integer} + * @since 3.0.0 + */ + this.index = index; + + /** + * Between 0 and 1. + * + * @name Phaser.Input.Gamepad.Button#value + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.value = 0; + + /** + * Can be set for analogue buttons to enable a 'pressure' threshold, + * before a button is considered as being 'pressed'. + * + * @name Phaser.Input.Gamepad.Button#threshold + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.threshold = 1; + + /** + * Is the Button being pressed down or not? + * + * @name Phaser.Input.Gamepad.Button#pressed + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.pressed = false; + }, + + /** + * Internal update handler for this Button. + * Called automatically by the Gamepad as part of its update. + * + * @method Phaser.Input.Gamepad.Button#update + * @fires Phaser.Input.Gamepad.Events#BUTTON_DOWN + * @fires Phaser.Input.Gamepad.Events#BUTTON_UP + * @fires Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN + * @fires Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP + * @private + * @since 3.0.0 + * + * @param {number} value - The value of the button. Between 0 and 1. + */ + update: function (value) + { + this.value = value; + + var pad = this.pad; + var index = this.index; + + if (value >= this.threshold) + { + if (!this.pressed) + { + this.pressed = true; + this.events.emit(Events.BUTTON_DOWN, pad, this, value); + this.pad.emit(Events.GAMEPAD_BUTTON_DOWN, index, value, this); + } + } + else if (this.pressed) + { + this.pressed = false; + this.events.emit(Events.BUTTON_UP, pad, this, value); + this.pad.emit(Events.GAMEPAD_BUTTON_UP, index, value, this); + } + }, + + /** + * Destroys this Button instance and releases external references it holds. + * + * @method Phaser.Input.Gamepad.Button#destroy + * @since 3.10.0 + */ + destroy: function () + { + this.pad = null; + this.events = null; + } + +}); + +module.exports = Button; + + +/***/ }), +/* 425 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Axis = __webpack_require__(423); +var Button = __webpack_require__(424); +var Class = __webpack_require__(0); +var EventEmitter = __webpack_require__(11); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A single Gamepad. + * + * These are created, updated and managed by the Gamepad Plugin. + * + * @class Gamepad + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Input.Gamepad + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Input.Gamepad.GamepadPlugin} manager - A reference to the Gamepad Plugin. + * @param {Phaser.Types.Input.Gamepad.Pad} pad - The Gamepad object, as extracted from GamepadEvent. + */ +var Gamepad = new Class({ + + Extends: EventEmitter, + + initialize: + + function Gamepad (manager, pad) + { + EventEmitter.call(this); + + /** + * A reference to the Gamepad Plugin. + * + * @name Phaser.Input.Gamepad.Gamepad#manager + * @type {Phaser.Input.Gamepad.GamepadPlugin} + * @since 3.0.0 + */ + this.manager = manager; + + /** + * A reference to the native Gamepad object that is connected to the browser. + * + * @name Phaser.Input.Gamepad.Gamepad#pad + * @type {any} + * @since 3.10.0 + */ + this.pad = pad; + + /** + * A string containing some information about the controller. + * + * This is not strictly specified, but in Firefox it will contain three pieces of information + * separated by dashes (-): two 4-digit hexadecimal strings containing the USB vendor and + * product id of the controller, and the name of the controller as provided by the driver. + * In Chrome it will contain the name of the controller as provided by the driver, + * followed by vendor and product 4-digit hexadecimal strings. + * + * @name Phaser.Input.Gamepad.Gamepad#id + * @type {string} + * @since 3.0.0 + */ + this.id = pad.id; + + /** + * An integer that is unique for each Gamepad currently connected to the system. + * This can be used to distinguish multiple controllers. + * Note that disconnecting a device and then connecting a new device may reuse the previous index. + * + * @name Phaser.Input.Gamepad.Gamepad#index + * @type {number} + * @since 3.0.0 + */ + this.index = pad.index; + + var buttons = []; + + for (var i = 0; i < pad.buttons.length; i++) + { + buttons.push(new Button(this, i)); + } + + /** + * An array of Gamepad Button objects, corresponding to the different buttons available on the Gamepad. + * + * @name Phaser.Input.Gamepad.Gamepad#buttons + * @type {Phaser.Input.Gamepad.Button[]} + * @since 3.0.0 + */ + this.buttons = buttons; + + var axes = []; + + for (i = 0; i < pad.axes.length; i++) + { + axes.push(new Axis(this, i)); + } + + /** + * An array of Gamepad Axis objects, corresponding to the different axes available on the Gamepad, if any. + * + * @name Phaser.Input.Gamepad.Gamepad#axes + * @type {Phaser.Input.Gamepad.Axis[]} + * @since 3.0.0 + */ + this.axes = axes; + + /** + * The Gamepad's Haptic Actuator (Vibration / Rumble support). + * This is highly experimental and only set if both present on the device, + * and exposed by both the hardware and browser. + * + * @name Phaser.Input.Gamepad.Gamepad#vibration + * @type {GamepadHapticActuator} + * @since 3.10.0 + */ + this.vibration = pad.vibrationActuator; + + // https://w3c.github.io/gamepad/#remapping + + var _noButton = { value: 0, pressed: false }; + + /** + * A reference to the Left Button in the Left Cluster. + * + * @name Phaser.Input.Gamepad.Gamepad#_LCLeft + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._LCLeft = (buttons[14]) ? buttons[14] : _noButton; + + /** + * A reference to the Right Button in the Left Cluster. + * + * @name Phaser.Input.Gamepad.Gamepad#_LCRight + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._LCRight = (buttons[15]) ? buttons[15] : _noButton; + + /** + * A reference to the Top Button in the Left Cluster. + * + * @name Phaser.Input.Gamepad.Gamepad#_LCTop + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._LCTop = (buttons[12]) ? buttons[12] : _noButton; + + /** + * A reference to the Bottom Button in the Left Cluster. + * + * @name Phaser.Input.Gamepad.Gamepad#_LCBottom + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._LCBottom = (buttons[13]) ? buttons[13] : _noButton; + + /** + * A reference to the Left Button in the Right Cluster. + * + * @name Phaser.Input.Gamepad.Gamepad#_RCLeft + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._RCLeft = (buttons[2]) ? buttons[2] : _noButton; + + /** + * A reference to the Right Button in the Right Cluster. + * + * @name Phaser.Input.Gamepad.Gamepad#_RCRight + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._RCRight = (buttons[1]) ? buttons[1] : _noButton; + + /** + * A reference to the Top Button in the Right Cluster. + * + * @name Phaser.Input.Gamepad.Gamepad#_RCTop + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._RCTop = (buttons[3]) ? buttons[3] : _noButton; + + /** + * A reference to the Bottom Button in the Right Cluster. + * + * @name Phaser.Input.Gamepad.Gamepad#_RCBottom + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._RCBottom = (buttons[0]) ? buttons[0] : _noButton; + + /** + * A reference to the Top Left Front Button (L1 Shoulder Button) + * + * @name Phaser.Input.Gamepad.Gamepad#_FBLeftTop + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._FBLeftTop = (buttons[4]) ? buttons[4] : _noButton; + + /** + * A reference to the Bottom Left Front Button (L2 Shoulder Button) + * + * @name Phaser.Input.Gamepad.Gamepad#_FBLeftBottom + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._FBLeftBottom = (buttons[6]) ? buttons[6] : _noButton; + + /** + * A reference to the Top Right Front Button (R1 Shoulder Button) + * + * @name Phaser.Input.Gamepad.Gamepad#_FBRightTop + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._FBRightTop = (buttons[5]) ? buttons[5] : _noButton; + + /** + * A reference to the Bottom Right Front Button (R2 Shoulder Button) + * + * @name Phaser.Input.Gamepad.Gamepad#_FBRightBottom + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._FBRightBottom = (buttons[7]) ? buttons[7] : _noButton; + + var _noAxis = { value: 0 }; + + /** + * A reference to the Horizontal Axis for the Left Stick. + * + * @name Phaser.Input.Gamepad.Gamepad#_HAxisLeft + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._HAxisLeft = (axes[0]) ? axes[0] : _noAxis; + + /** + * A reference to the Vertical Axis for the Left Stick. + * + * @name Phaser.Input.Gamepad.Gamepad#_VAxisLeft + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._VAxisLeft = (axes[1]) ? axes[1] : _noAxis; + + /** + * A reference to the Horizontal Axis for the Right Stick. + * + * @name Phaser.Input.Gamepad.Gamepad#_HAxisRight + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._HAxisRight = (axes[2]) ? axes[2] : _noAxis; + + /** + * A reference to the Vertical Axis for the Right Stick. + * + * @name Phaser.Input.Gamepad.Gamepad#_VAxisRight + * @type {Phaser.Input.Gamepad.Button} + * @private + * @since 3.10.0 + */ + this._VAxisRight = (axes[3]) ? axes[3] : _noAxis; + + /** + * A Vector2 containing the most recent values from the Gamepad's left axis stick. + * This is updated automatically as part of the Gamepad.update cycle. + * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. + * The values are based on the Axis thresholds. + * If the Gamepad does not have a left axis stick, the values will always be zero. + * + * @name Phaser.Input.Gamepad.Gamepad#leftStick + * @type {Phaser.Math.Vector2} + * @since 3.10.0 + */ + this.leftStick = new Vector2(); + + /** + * A Vector2 containing the most recent values from the Gamepad's right axis stick. + * This is updated automatically as part of the Gamepad.update cycle. + * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. + * The values are based on the Axis thresholds. + * If the Gamepad does not have a right axis stick, the values will always be zero. + * + * @name Phaser.Input.Gamepad.Gamepad#rightStick + * @type {Phaser.Math.Vector2} + * @since 3.10.0 + */ + this.rightStick = new Vector2(); + }, + + /** + * Gets the total number of axis this Gamepad claims to support. + * + * @method Phaser.Input.Gamepad.Gamepad#getAxisTotal + * @since 3.10.0 + * + * @return {integer} The total number of axes this Gamepad claims to support. + */ + getAxisTotal: function () + { + return this.axes.length; + }, + + /** + * Gets the value of an axis based on the given index. + * The index must be valid within the range of axes supported by this Gamepad. + * The return value will be a float between 0 and 1. + * + * @method Phaser.Input.Gamepad.Gamepad#getAxisValue + * @since 3.10.0 + * + * @param {integer} index - The index of the axes to get the value for. + * + * @return {number} The value of the axis, between 0 and 1. + */ + getAxisValue: function (index) + { + return this.axes[index].getValue(); + }, + + /** + * Sets the threshold value of all axis on this Gamepad. + * The value is a float between 0 and 1 and is the amount below which the axis is considered as not having been moved. + * + * @method Phaser.Input.Gamepad.Gamepad#setAxisThreshold + * @since 3.10.0 + * + * @param {number} value - A value between 0 and 1. + */ + setAxisThreshold: function (value) + { + for (var i = 0; i < this.axes.length; i++) + { + this.axes[i].threshold = value; + } + }, + + /** + * Gets the total number of buttons this Gamepad claims to have. + * + * @method Phaser.Input.Gamepad.Gamepad#getButtonTotal + * @since 3.10.0 + * + * @return {integer} The total number of buttons this Gamepad claims to have. + */ + getButtonTotal: function () + { + return this.buttons.length; + }, + + /** + * Gets the value of a button based on the given index. + * The index must be valid within the range of buttons supported by this Gamepad. + * + * The return value will be either 0 or 1 for an analogue button, or a float between 0 and 1 + * for a pressure-sensitive digital button, such as the shoulder buttons on a Dual Shock. + * + * @method Phaser.Input.Gamepad.Gamepad#getButtonValue + * @since 3.10.0 + * + * @param {integer} index - The index of the button to get the value for. + * + * @return {number} The value of the button, between 0 and 1. + */ + getButtonValue: function (index) + { + return this.buttons[index].value; + }, + + /** + * Returns if the button is pressed down or not. + * The index must be valid within the range of buttons supported by this Gamepad. + * + * @method Phaser.Input.Gamepad.Gamepad#isButtonDown + * @since 3.10.0 + * + * @param {integer} index - The index of the button to get the value for. + * + * @return {boolean} `true` if the button is considered as being pressed down, otherwise `false`. + */ + isButtonDown: function (index) + { + return this.buttons[index].pressed; + }, + + /** + * Internal update handler for this Gamepad. + * Called automatically by the Gamepad Manager as part of its update. + * + * @method Phaser.Input.Gamepad.Gamepad#update + * @private + * @since 3.0.0 + */ + update: function (pad) + { + var i; + + // Sync the button values + + var localButtons = this.buttons; + var gamepadButtons = pad.buttons; + + var len = localButtons.length; + + for (i = 0; i < len; i++) + { + localButtons[i].update(gamepadButtons[i].value); + } + + // Sync the axis values + + var localAxes = this.axes; + var gamepadAxes = pad.axes; + + len = localAxes.length; + + for (i = 0; i < len; i++) + { + localAxes[i].update(gamepadAxes[i]); + } + + if (len >= 2) + { + this.leftStick.set(localAxes[0].getValue(), localAxes[1].getValue()); + + if (len >= 4) + { + this.rightStick.set(localAxes[2].getValue(), localAxes[3].getValue()); + } + } + }, + + /** + * Destroys this Gamepad instance, its buttons and axes, and releases external references it holds. + * + * @method Phaser.Input.Gamepad.Gamepad#destroy + * @since 3.10.0 + */ + destroy: function () + { + this.removeAllListeners(); + + this.manager = null; + this.pad = null; + + var i; + + for (i = 0; i < this.buttons.length; i++) + { + this.buttons[i].destroy(); + } + + for (i = 0; i < this.axes.length; i++) + { + this.axes[i].destroy(); + } + + this.buttons = []; + this.axes = []; + }, + + /** + * Is this Gamepad currently connected or not? + * + * @name Phaser.Input.Gamepad.Gamepad#connected + * @type {boolean} + * @default true + * @since 3.0.0 + */ + connected: { + + get: function () + { + return this.pad.connected; + } + + }, + + /** + * A timestamp containing the most recent time this Gamepad was updated. + * + * @name Phaser.Input.Gamepad.Gamepad#timestamp + * @type {number} + * @since 3.0.0 + */ + timestamp: { + + get: function () + { + return this.pad.timestamp; + } + + }, + + /** + * Is the Gamepad's Left button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad left button under standard Gamepad mapping. + * + * @name Phaser.Input.Gamepad.Gamepad#left + * @type {boolean} + * @since 3.10.0 + */ + left: { + + get: function () + { + return this._LCLeft.pressed; + } + + }, + + /** + * Is the Gamepad's Right button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad right button under standard Gamepad mapping. + * + * @name Phaser.Input.Gamepad.Gamepad#right + * @type {boolean} + * @since 3.10.0 + */ + right: { + + get: function () + { + return this._LCRight.pressed; + } + + }, + + /** + * Is the Gamepad's Up button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad up button under standard Gamepad mapping. + * + * @name Phaser.Input.Gamepad.Gamepad#up + * @type {boolean} + * @since 3.10.0 + */ + up: { + + get: function () + { + return this._LCTop.pressed; + } + + }, + + /** + * Is the Gamepad's Down button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad down button under standard Gamepad mapping. + * + * @name Phaser.Input.Gamepad.Gamepad#down + * @type {boolean} + * @since 3.10.0 + */ + down: { + + get: function () + { + return this._LCBottom.pressed; + } + + }, + + /** + * Is the Gamepad's bottom button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the X button. + * On an XBox controller it's the A button. + * + * @name Phaser.Input.Gamepad.Gamepad#A + * @type {boolean} + * @since 3.10.0 + */ + A: { + + get: function () + { + return this._RCBottom.pressed; + } + + }, + + /** + * Is the Gamepad's top button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Triangle button. + * On an XBox controller it's the Y button. + * + * @name Phaser.Input.Gamepad.Gamepad#Y + * @type {boolean} + * @since 3.10.0 + */ + Y: { + + get: function () + { + return this._RCTop.pressed; + } + + }, + + /** + * Is the Gamepad's left button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Square button. + * On an XBox controller it's the X button. + * + * @name Phaser.Input.Gamepad.Gamepad#X + * @type {boolean} + * @since 3.10.0 + */ + X: { + + get: function () + { + return this._RCLeft.pressed; + } + + }, + + /** + * Is the Gamepad's right button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Circle button. + * On an XBox controller it's the B button. + * + * @name Phaser.Input.Gamepad.Gamepad#B + * @type {boolean} + * @since 3.10.0 + */ + B: { + + get: function () + { + return this._RCRight.pressed; + } + + }, + + /** + * Returns the value of the Gamepad's top left shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the L1 button. + * On an XBox controller it's the LB button. + * + * @name Phaser.Input.Gamepad.Gamepad#L1 + * @type {number} + * @since 3.10.0 + */ + L1: { + + get: function () + { + return this._FBLeftTop.value; + } + + }, + + /** + * Returns the value of the Gamepad's bottom left shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the L2 button. + * On an XBox controller it's the LT button. + * + * @name Phaser.Input.Gamepad.Gamepad#L2 + * @type {number} + * @since 3.10.0 + */ + L2: { + + get: function () + { + return this._FBLeftBottom.value; + } + + }, + + /** + * Returns the value of the Gamepad's top right shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the R1 button. + * On an XBox controller it's the RB button. + * + * @name Phaser.Input.Gamepad.Gamepad#R1 + * @type {number} + * @since 3.10.0 + */ + R1: { + + get: function () + { + return this._FBRightTop.value; + } + + }, + + /** + * Returns the value of the Gamepad's bottom right shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the R2 button. + * On an XBox controller it's the RT button. + * + * @name Phaser.Input.Gamepad.Gamepad#R2 + * @type {number} + * @since 3.10.0 + */ + R2: { + + get: function () + { + return this._FBRightBottom.value; + } + + } + +}); + +module.exports = Gamepad; + + +/***/ }), +/* 426 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(132); + +/** + * @classdesc + * A generic Key object which can be passed to the Process functions (and so on) + * keycode must be an integer + * + * @class Key + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Input.Keyboard + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.KeyboardPlugin} plugin - The Keyboard Plugin instance that owns this Key object. + * @param {integer} keyCode - The keycode of this key. + */ +var Key = new Class({ + + Extends: EventEmitter, + + initialize: + + function Key (plugin, keyCode) + { + EventEmitter.call(this); + + /** + * The Keyboard Plugin instance that owns this Key object. + * + * @name Phaser.Input.Keyboard.Key#plugin + * @type {Phaser.Input.Keyboard.KeyboardPlugin} + * @since 3.17.0 + */ + this.plugin = plugin; + + /** + * The keycode of this key. + * + * @name Phaser.Input.Keyboard.Key#keyCode + * @type {integer} + * @since 3.0.0 + */ + this.keyCode = keyCode; + + /** + * The original DOM event. + * + * @name Phaser.Input.Keyboard.Key#originalEvent + * @type {KeyboardEvent} + * @since 3.0.0 + */ + this.originalEvent = undefined; + + /** + * Can this Key be processed? + * + * @name Phaser.Input.Keyboard.Key#enabled + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.enabled = true; + + /** + * The "down" state of the key. This will remain `true` for as long as the keyboard thinks this key is held down. + * + * @name Phaser.Input.Keyboard.Key#isDown + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.isDown = false; + + /** + * The "up" state of the key. This will remain `true` for as long as the keyboard thinks this key is up. + * + * @name Phaser.Input.Keyboard.Key#isUp + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.isUp = true; + + /** + * The down state of the ALT key, if pressed at the same time as this key. + * + * @name Phaser.Input.Keyboard.Key#altKey + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.altKey = false; + + /** + * The down state of the CTRL key, if pressed at the same time as this key. + * + * @name Phaser.Input.Keyboard.Key#ctrlKey + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.ctrlKey = false; + + /** + * The down state of the SHIFT key, if pressed at the same time as this key. + * + * @name Phaser.Input.Keyboard.Key#shiftKey + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.shiftKey = false; + + /** + * The down state of the Meta key, if pressed at the same time as this key. + * On a Mac the Meta Key is the Command key. On Windows keyboards, it's the Windows key. + * + * @name Phaser.Input.Keyboard.Key#metaKey + * @type {boolean} + * @default false + * @since 3.16.0 + */ + this.metaKey = false; + + /** + * The location of the modifier key. 0 for standard (or unknown), 1 for left, 2 for right, 3 for numpad. + * + * @name Phaser.Input.Keyboard.Key#location + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.location = 0; + + /** + * The timestamp when the key was last pressed down. + * + * @name Phaser.Input.Keyboard.Key#timeDown + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.timeDown = 0; + + /** + * The number of milliseconds this key was held down for in the previous down - up sequence. + * This value isn't updated every game step, only when the Key changes state. + * To get the current duration use the `getDuration` method. + * + * @name Phaser.Input.Keyboard.Key#duration + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.duration = 0; + + /** + * The timestamp when the key was last released. + * + * @name Phaser.Input.Keyboard.Key#timeUp + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.timeUp = 0; + + /** + * When a key is held down should it continuously fire the `down` event each time it repeats? + * + * By default it will emit the `down` event just once, but if you wish to receive the event + * for each repeat as well, enable this property. + * + * @name Phaser.Input.Keyboard.Key#emitOnRepeat + * @type {boolean} + * @default false + * @since 3.16.0 + */ + this.emitOnRepeat = false; + + /** + * If a key is held down this holds down the number of times the key has 'repeated'. + * + * @name Phaser.Input.Keyboard.Key#repeats + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.repeats = 0; + + /** + * True if the key has just been pressed (NOTE: requires to be reset, see justDown getter) + * + * @name Phaser.Input.Keyboard.Key#_justDown + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._justDown = false; + + /** + * True if the key has just been pressed (NOTE: requires to be reset, see justDown getter) + * + * @name Phaser.Input.Keyboard.Key#_justUp + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._justUp = false; + + /** + * Internal tick counter. + * + * @name Phaser.Input.Keyboard.Key#_tick + * @type {number} + * @private + * @since 3.11.0 + */ + this._tick = -1; + }, + + /** + * Controls if this Key will continuously emit a `down` event while being held down (true), + * or emit the event just once, on first press, and then skip future events (false). + * + * @method Phaser.Input.Keyboard.Key#setEmitOnRepeat + * @since 3.16.0 + * + * @param {boolean} value - Emit `down` events on repeated key down actions, or just once? + * + * @return {Phaser.Input.Keyboard.Key} This Key instance. + */ + setEmitOnRepeat: function (value) + { + this.emitOnRepeat = value; + + return this; + }, + + /** + * Processes the Key Down action for this Key. + * Called automatically by the Keyboard Plugin. + * + * @method Phaser.Input.Keyboard.Key#onDown + * @fires Phaser.Input.Keyboard.Events#DOWN + * @since 3.16.0 + * + * @param {KeyboardEvent} event - The native DOM Keyboard event. + */ + onDown: function (event) + { + this.originalEvent = event; + + if (!this.enabled) + { + return; + } + + this.altKey = event.altKey; + this.ctrlKey = event.ctrlKey; + this.shiftKey = event.shiftKey; + this.metaKey = event.metaKey; + this.location = event.location; + + this.repeats++; + + if (!this.isDown) + { + this.isDown = true; + this.isUp = false; + this.timeDown = event.timeStamp; + this.duration = 0; + this._justDown = true; + this._justUp = false; + + this.emit(Events.DOWN, this, event); + } + else if (this.emitOnRepeat) + { + this.emit(Events.DOWN, this, event); + } + }, + + /** + * Processes the Key Up action for this Key. + * Called automatically by the Keyboard Plugin. + * + * @method Phaser.Input.Keyboard.Key#onUp + * @fires Phaser.Input.Keyboard.Events#UP + * @since 3.16.0 + * + * @param {KeyboardEvent} event - The native DOM Keyboard event. + */ + onUp: function (event) + { + this.originalEvent = event; + + if (!this.enabled) + { + return; + } + + this.isDown = false; + this.isUp = true; + this.timeUp = event.timeStamp; + this.duration = this.timeUp - this.timeDown; + this.repeats = 0; + + this._justDown = false; + this._justUp = true; + this._tick = -1; + + this.emit(Events.UP, this, event); + }, + + /** + * Resets this Key object back to its default un-pressed state. + * + * @method Phaser.Input.Keyboard.Key#reset + * @since 3.6.0 + * + * @return {Phaser.Input.Keyboard.Key} This Key instance. + */ + reset: function () + { + this.preventDefault = true; + this.enabled = true; + this.isDown = false; + this.isUp = true; + this.altKey = false; + this.ctrlKey = false; + this.shiftKey = false; + this.metaKey = false; + this.timeDown = 0; + this.duration = 0; + this.timeUp = 0; + this.repeats = 0; + this._justDown = false; + this._justUp = false; + this._tick = -1; + + return this; + }, + + /** + * Returns the duration, in ms, that the Key has been held down for. + * + * If the key is not currently down it will return zero. + * + * The get the duration the Key was held down for in the previous up-down cycle, + * use the `Key.duration` property value instead. + * + * @method Phaser.Input.Keyboard.Key#getDuration + * @since 3.17.0 + * + * @return {number} The duration, in ms, that the Key has been held down for if currently down. + */ + getDuration: function () + { + if (this.isDown) + { + return (this.plugin.game.loop.time - this.timeDown); + } + else + { + return 0; + } + }, + + /** + * Removes any bound event handlers and removes local references. + * + * @method Phaser.Input.Keyboard.Key#destroy + * @since 3.16.0 + */ + destroy: function () + { + this.removeAllListeners(); + + this.originalEvent = null; + + this.plugin = null; + } + +}); + +module.exports = Key; + + +/***/ }), +/* 427 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(132); +var GetFastValue = __webpack_require__(2); +var ProcessKeyCombo = __webpack_require__(1172); +var ResetKeyCombo = __webpack_require__(1174); + +/** + * @classdesc + * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them + * it will emit a `keycombomatch` event from the Keyboard Manager. + * + * The keys to be listened for can be defined as: + * + * A string (i.e. 'ATARI') + * An array of either integers (key codes) or strings, or a mixture of both + * An array of objects (such as Key objects) with a public 'keyCode' property + * + * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter) + * you could pass the following array of key codes: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + * + * Or, to listen for the user entering the word PHASER: + * + * ```javascript + * this.input.keyboard.createCombo('PHASER'); + * ``` + * + * @class KeyCombo + * @memberof Phaser.Input.Keyboard + * @constructor + * @listens Phaser.Input.Keyboard.Events#ANY_KEY_DOWN + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.KeyboardPlugin} keyboardPlugin - A reference to the Keyboard Plugin. + * @param {(string|integer[]|object[])} keys - The keys that comprise this combo. + * @param {Phaser.Types.Input.Keyboard.KeyComboConfig} [config] - A Key Combo configuration object. + */ +var KeyCombo = new Class({ + + initialize: + + function KeyCombo (keyboardPlugin, keys, config) + { + if (config === undefined) { config = {}; } + + // Can't have a zero or single length combo (string or array based) + if (keys.length < 2) + { + return false; + } + + /** + * A reference to the Keyboard Manager + * + * @name Phaser.Input.Keyboard.KeyCombo#manager + * @type {Phaser.Input.Keyboard.KeyboardPlugin} + * @since 3.0.0 + */ + this.manager = keyboardPlugin; + + /** + * A flag that controls if this Key Combo is actively processing keys or not. + * + * @name Phaser.Input.Keyboard.KeyCombo#enabled + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.enabled = true; + + /** + * An array of the keycodes that comprise this combo. + * + * @name Phaser.Input.Keyboard.KeyCombo#keyCodes + * @type {array} + * @default [] + * @since 3.0.0 + */ + this.keyCodes = []; + + // if 'keys' is a string we need to get the keycode of each character in it + + for (var i = 0; i < keys.length; i++) + { + var char = keys[i]; + + if (typeof char === 'string') + { + this.keyCodes.push(char.toUpperCase().charCodeAt(0)); + } + else if (typeof char === 'number') + { + this.keyCodes.push(char); + } + else if (char.hasOwnProperty('keyCode')) + { + this.keyCodes.push(char.keyCode); + } + } + + /** + * The current keyCode the combo is waiting for. + * + * @name Phaser.Input.Keyboard.KeyCombo#current + * @type {integer} + * @since 3.0.0 + */ + this.current = this.keyCodes[0]; + + /** + * The current index of the key being waited for in the 'keys' string. + * + * @name Phaser.Input.Keyboard.KeyCombo#index + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.index = 0; + + /** + * The length of this combo (in keycodes) + * + * @name Phaser.Input.Keyboard.KeyCombo#size + * @type {number} + * @since 3.0.0 + */ + this.size = this.keyCodes.length; + + /** + * The time the previous key in the combo was matched. + * + * @name Phaser.Input.Keyboard.KeyCombo#timeLastMatched + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.timeLastMatched = 0; + + /** + * Has this Key Combo been matched yet? + * + * @name Phaser.Input.Keyboard.KeyCombo#matched + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.matched = false; + + /** + * The time the entire combo was matched. + * + * @name Phaser.Input.Keyboard.KeyCombo#timeMatched + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.timeMatched = 0; + + /** + * If they press the wrong key do we reset the combo? + * + * @name Phaser.Input.Keyboard.KeyCombo#resetOnWrongKey + * @type {boolean} + * @default 0 + * @since 3.0.0 + */ + this.resetOnWrongKey = GetFastValue(config, 'resetOnWrongKey', true); + + /** + * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. + * + * @name Phaser.Input.Keyboard.KeyCombo#maxKeyDelay + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.maxKeyDelay = GetFastValue(config, 'maxKeyDelay', 0); + + /** + * If previously matched and they press the first key of the combo again, will it reset? + * + * @name Phaser.Input.Keyboard.KeyCombo#resetOnMatch + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.resetOnMatch = GetFastValue(config, 'resetOnMatch', false); + + /** + * If the combo matches, will it delete itself? + * + * @name Phaser.Input.Keyboard.KeyCombo#deleteOnMatch + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.deleteOnMatch = GetFastValue(config, 'deleteOnMatch', false); + + var _this = this; + + var onKeyDownHandler = function (event) + { + if (_this.matched || !_this.enabled) + { + return; + } + + var matched = ProcessKeyCombo(event, _this); + + if (matched) + { + _this.manager.emit(Events.COMBO_MATCH, _this, event); + + if (_this.resetOnMatch) + { + ResetKeyCombo(_this); + } + else if (_this.deleteOnMatch) + { + _this.destroy(); + } + } + }; + + /** + * The internal Key Down handler. + * + * @name Phaser.Input.Keyboard.KeyCombo#onKeyDown + * @private + * @type {KeyboardKeydownCallback} + * @fires Phaser.Input.Keyboard.Events#COMBO_MATCH + * @since 3.0.0 + */ + this.onKeyDown = onKeyDownHandler; + + this.manager.on(Events.ANY_KEY_DOWN, this.onKeyDown); + }, + + /** + * How far complete is this combo? A value between 0 and 1. + * + * @name Phaser.Input.Keyboard.KeyCombo#progress + * @type {number} + * @readonly + * @since 3.0.0 + */ + progress: { + + get: function () + { + return this.index / this.size; + } + + }, + + /** + * Destroys this Key Combo and all of its references. + * + * @method Phaser.Input.Keyboard.KeyCombo#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.enabled = false; + this.keyCodes = []; + + this.manager.off(Events.ANY_KEY_DOWN, this.onKeyDown); + + this.manager = null; + } + +}); + +module.exports = KeyCombo; + + +/***/ }), +/* 428 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(205); + +/** + * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings + * and starts the download of it. It uses the Files own XHRSettings and merges them + * with the global XHRSettings object to set the xhr values before download. + * + * @function Phaser.Loader.XHRLoader + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - The File to download. + * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object. + * + * @return {XMLHttpRequest} The XHR object. + */ +var XHRLoader = function (file, globalXHRSettings) +{ + var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings); + + var xhr = new XMLHttpRequest(); + + xhr.open('GET', file.src, config.async, config.user, config.password); + + xhr.responseType = file.xhrSettings.responseType; + xhr.timeout = config.timeout; + + if (config.header && config.headerValue) + { + xhr.setRequestHeader(config.header, config.headerValue); + } + + if (config.requestedWith) + { + xhr.setRequestHeader('X-Requested-With', config.requestedWith); + } + + if (config.overrideMimeType) + { + xhr.overrideMimeType(config.overrideMimeType); + } + + // After a successful request, the xhr.response property will contain the requested data as a DOMString, ArrayBuffer, Blob, or Document (depending on what was set for responseType.) + + xhr.onload = file.onLoad.bind(file, xhr); + xhr.onerror = file.onError.bind(file, xhr); + xhr.onprogress = file.onProgress.bind(file); + + // This is the only standard method, the ones above are browser additions (maybe not universal?) + // xhr.onreadystatechange + + xhr.send(); + + return xhr; +}; + +module.exports = XHRLoader; + + +/***/ }), +/* 429 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(26); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var HTML5AudioFile = __webpack_require__(430); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single Audio File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. + * + * @class AudioFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {any} [urlConfig] - The absolute or relative URL to load this file from in a config object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {AudioContext} [audioContext] - The AudioContext this file will use to process itself. + */ +var AudioFile = new Class({ + + Extends: File, + + initialize: + + // URL is an object created by AudioFile.findAudioURL + function AudioFile (loader, key, urlConfig, xhrSettings, audioContext) + { + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + audioContext = GetFastValue(config, 'context', audioContext); + } + + var fileConfig = { + type: 'audio', + cache: loader.cacheManager.audio, + extension: urlConfig.type, + responseType: 'arraybuffer', + key: key, + url: urlConfig.url, + xhrSettings: xhrSettings, + config: { context: audioContext } + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.AudioFile#onProcess + * @since 3.0.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + var _this = this; + + // interesting read https://github.com/WebAudio/web-audio-api/issues/1305 + this.config.context.decodeAudioData(this.xhrLoader.response, + function (audioBuffer) + { + _this.data = audioBuffer; + + _this.onProcessComplete(); + }, + function (e) + { + // eslint-disable-next-line no-console + console.error('Error decoding audio: ' + this.key + ' - ', e ? e.message : null); + + _this.onProcessError(); + } + ); + + this.config.context = null; + } + +}); + +AudioFile.create = function (loader, key, urls, config, xhrSettings) +{ + var game = loader.systems.game; + var audioConfig = game.config.audio; + var deviceAudio = game.device.audio; + + // url may be inside key, which may be an object + if (IsPlainObject(key)) + { + urls = GetFastValue(key, 'url', []); + config = GetFastValue(key, 'config', {}); + } + + var urlConfig = AudioFile.getAudioURL(game, urls); + + if (!urlConfig) + { + return null; + } + + // https://developers.google.com/web/updates/2012/02/HTML5-audio-and-the-Web-Audio-API-are-BFFs + // var stream = GetFastValue(config, 'stream', false); + + if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio)) + { + return new AudioFile(loader, key, urlConfig, xhrSettings, game.sound.context); + } + else + { + return new HTML5AudioFile(loader, key, urlConfig, config); + } +}; + +AudioFile.getAudioURL = function (game, urls) +{ + if (!Array.isArray(urls)) + { + urls = [ urls ]; + } + + for (var i = 0; i < urls.length; i++) + { + var url = GetFastValue(urls[i], 'url', urls[i]); + + if (url.indexOf('blob:') === 0 || url.indexOf('data:') === 0) + { + return url; + } + + var audioType = url.match(/\.([a-zA-Z0-9]+)($|\?)/); + + audioType = GetFastValue(urls[i], 'type', (audioType) ? audioType[1] : '').toLowerCase(); + + if (game.device.audio[audioType]) + { + return { + url: url, + type: audioType + }; + } + } + + return null; +}; + +/** + * Adds an Audio or HTML5Audio file, or array of audio files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.audio('title', [ 'music/Title.ogg', 'music/Title.mp3', 'music/Title.m4a' ]); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Audio Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Audio Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Audio Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.audio({ + * key: 'title', + * url: [ 'music/Title.ogg', 'music/Title.mp3', 'music/Title.m4a' ] + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AudioFileConfig` for more details. + * + * The URLs can be relative or absolute. If the URLs are relative the `Loader.baseURL` and `Loader.path` values will be prepended to them. + * + * Due to different browsers supporting different audio file types you should usually provide your audio files in a variety of formats. + * ogg, mp3 and m4a are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on + * browser support. + * + * If audio has been disabled in your game, either via the game config, or lack of support from the device, then no audio will be loaded. + * + * Note: The ability to load this type of file will only be available if the Audio File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#audio + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig|Phaser.Types.Loader.FileTypes.AudioFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {(string|string[])} [urls] - The absolute or relative URL to load the audio files from. + * @param {any} [config] - An object containing an `instances` property for HTML5Audio. Defaults to 1. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('audio', function (key, urls, config, xhrSettings) +{ + var game = this.systems.game; + var audioConfig = game.config.audio; + var deviceAudio = game.device.audio; + + if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData)) + { + // Sounds are disabled, so skip loading audio + return this; + } + + var audioFile; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + audioFile = AudioFile.create(this, key[i]); + + if (audioFile) + { + this.addFile(audioFile); + } + } + } + else + { + audioFile = AudioFile.create(this, key, urls, config, xhrSettings); + + if (audioFile) + { + this.addFile(audioFile); + } + } + + return this; +}); + +module.exports = AudioFile; + + +/***/ }), +/* 430 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(80); +var File = __webpack_require__(20); +var GetFastValue = __webpack_require__(2); +var GetURL = __webpack_require__(204); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single Audio File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audio method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audio. + * + * @class HTML5AudioFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.AudioFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [urlConfig] - The absolute or relative URL to load this file from. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var HTML5AudioFile = new Class({ + + Extends: File, + + initialize: + + function HTML5AudioFile (loader, key, urlConfig, audioConfig) + { + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + audioConfig = GetFastValue(config, 'config', audioConfig); + } + + var fileConfig = { + type: 'audio', + cache: loader.cacheManager.audio, + extension: urlConfig.type, + key: key, + url: urlConfig.url, + config: audioConfig + }; + + File.call(this, loader, fileConfig); + + // New properties specific to this class + this.locked = 'ontouchstart' in window; + this.loaded = false; + this.filesLoaded = 0; + this.filesTotal = 0; + }, + + /** + * Called when the file finishes loading. + * + * @method Phaser.Loader.FileTypes.HTML5AudioFile#onLoad + * @since 3.0.0 + */ + onLoad: function () + { + if (this.loaded) + { + return; + } + + this.loaded = true; + + this.loader.nextFile(this, true); + }, + + /** + * Called if the file errors while loading. + * + * @method Phaser.Loader.FileTypes.HTML5AudioFile#onError + * @since 3.0.0 + */ + onError: function () + { + for (var i = 0; i < this.data.length; i++) + { + var audio = this.data[i]; + + audio.oncanplaythrough = null; + audio.onerror = null; + } + + this.loader.nextFile(this, false); + }, + + /** + * Called during the file load progress. Is sent a DOM ProgressEvent. + * + * @method Phaser.Loader.FileTypes.HTML5AudioFile#onProgress + * @fires Phaser.Loader.Events#FILE_PROGRESS + * @since 3.0.0 + */ + onProgress: function (event) + { + var audio = event.target; + + audio.oncanplaythrough = null; + audio.onerror = null; + + this.filesLoaded++; + + this.percentComplete = Math.min((this.filesLoaded / this.filesTotal), 1); + + this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete); + + if (this.filesLoaded === this.filesTotal) + { + this.onLoad(); + } + }, + + /** + * Called by the Loader, starts the actual file downloading. + * During the load the methods onLoad, onError and onProgress are called, based on the XHR events. + * You shouldn't normally call this method directly, it's meant to be invoked by the Loader. + * + * @method Phaser.Loader.FileTypes.HTML5AudioFile#load + * @since 3.0.0 + */ + load: function () + { + this.data = []; + + var instances = (this.config && this.config.instances) || 1; + + this.filesTotal = instances; + this.filesLoaded = 0; + this.percentComplete = 0; + + for (var i = 0; i < instances; i++) + { + var audio = new Audio(); + audio.dataset = {}; + audio.dataset.name = this.key + ('0' + i).slice(-2); + audio.dataset.used = 'false'; + + if (this.locked) + { + audio.dataset.locked = 'true'; + } + else + { + audio.dataset.locked = 'false'; + + audio.preload = 'auto'; + audio.oncanplaythrough = this.onProgress.bind(this); + audio.onerror = this.onError.bind(this); + } + + this.data.push(audio); + } + + for (i = 0; i < this.data.length; i++) + { + audio = this.data[i]; + audio.src = GetURL(this, this.loader.baseURL); + + if (!this.locked) + { + audio.load(); + } + } + + if (this.locked) + { + // This is super-dangerous but works. Race condition potential high. + // Is there another way? + setTimeout(this.onLoad.bind(this)); + } + } + +}); + +module.exports = HTML5AudioFile; + + +/***/ }), +/* 431 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#script method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#script. + * + * @class ScriptFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var ScriptFile = new Class({ + + Extends: File, + + initialize: + + function ScriptFile (loader, key, url, xhrSettings) + { + var extension = 'js'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'script', + cache: false, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.ScriptFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = document.createElement('script'); + this.data.language = 'javascript'; + this.data.type = 'text/javascript'; + this.data.defer = false; + this.data.text = this.xhrLoader.responseText; + + document.head.appendChild(this.data); + + this.onProcessComplete(); + } + +}); + +/** + * Adds a Script file, or array of Script files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.script('aliens', 'lib/aliens.js'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.script({ + * key: 'aliens', + * url: 'lib/aliens.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ScriptFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a script element + * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Script File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#script + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.ScriptFileConfig|Phaser.Types.Loader.FileTypes.ScriptFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('script', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new ScriptFile(this, key[i])); + } + } + else + { + this.addFile(new ScriptFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = ScriptFile; + + +/***/ }), +/* 432 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single Text File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. + * + * @class TextFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var TextFile = new Class({ + + Extends: File, + + initialize: + + function TextFile (loader, key, url, xhrSettings) + { + var extension = 'txt'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'text', + cache: loader.cacheManager.text, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.TextFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = this.xhrLoader.responseText; + + this.onProcessComplete(); + } + +}); + +/** + * Adds a Text file, or array of Text files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.text('story', 'files/IntroStory.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Text Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.text({ + * key: 'story', + * url: 'files/IntroStory.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.text('story', 'files/IntroStory.txt'); + * // and later in your game ... + * var data = this.cache.text.get('story'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Text Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#text + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('text', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new TextFile(this, key[i])); + } + } + else + { + this.addFile(new TextFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = TextFile; + + +/***/ }), +/* 433 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArcadeImage = __webpack_require__(434); +var ArcadeSprite = __webpack_require__(134); +var Class = __webpack_require__(0); +var CONST = __webpack_require__(50); +var PhysicsGroup = __webpack_require__(435); +var StaticPhysicsGroup = __webpack_require__(436); + +/** + * @classdesc + * The Arcade Physics Factory allows you to easily create Arcade Physics enabled Game Objects. + * Objects that are created by this Factory are automatically added to the physics world. + * + * @class Factory + * @memberof Phaser.Physics.Arcade + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics World instance. + */ +var Factory = new Class({ + + initialize: + + function Factory (world) + { + /** + * A reference to the Arcade Physics World. + * + * @name Phaser.Physics.Arcade.Factory#world + * @type {Phaser.Physics.Arcade.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * A reference to the Scene this Arcade Physics instance belongs to. + * + * @name Phaser.Physics.Arcade.Factory#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = world.scene; + + /** + * A reference to the Scene.Systems this Arcade Physics instance belongs to. + * + * @name Phaser.Physics.Arcade.Factory#sys + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.sys = world.scene.sys; + }, + + /** + * Creates a new Arcade Physics Collider object. + * + * @method Phaser.Physics.Arcade.Factory#collider + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object1 - The first object to check for collision. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object2 - The second object to check for collision. + * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {*} [callbackContext] - The scope in which to call the callbacks. + * + * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. + */ + collider: function (object1, object2, collideCallback, processCallback, callbackContext) + { + return this.world.addCollider(object1, object2, collideCallback, processCallback, callbackContext); + }, + + /** + * Creates a new Arcade Physics Collider Overlap object. + * + * @method Phaser.Physics.Arcade.Factory#overlap + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object1 - The first object to check for overlap. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object2 - The second object to check for overlap. + * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {*} [callbackContext] - The scope in which to call the callbacks. + * + * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. + */ + overlap: function (object1, object2, collideCallback, processCallback, callbackContext) + { + return this.world.addOverlap(object1, object2, collideCallback, processCallback, callbackContext); + }, + + /** + * Adds an Arcade Physics Body to the given Game Object. + * + * @method Phaser.Physics.Arcade.Factory#existing + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - A Game Object. + * @param {boolean} [isStatic=false] - Create a Static body (true) or Dynamic body (false). + * + * @return {Phaser.GameObjects.GameObject} The Game Object. + */ + existing: function (gameObject, isStatic) + { + var type = (isStatic) ? CONST.STATIC_BODY : CONST.DYNAMIC_BODY; + + this.world.enableBody(gameObject, type); + + return gameObject; + }, + + /** + * Creates a new Arcade Image object with a Static body. + * + * @method Phaser.Physics.Arcade.Factory#staticImage + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Physics.Arcade.Image} The Image object that was created. + */ + staticImage: function (x, y, key, frame) + { + var image = new ArcadeImage(this.scene, x, y, key, frame); + + this.sys.displayList.add(image); + + this.world.enableBody(image, CONST.STATIC_BODY); + + return image; + }, + + /** + * Creates a new Arcade Image object with a Dynamic body. + * + * @method Phaser.Physics.Arcade.Factory#image + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Physics.Arcade.Image} The Image object that was created. + */ + image: function (x, y, key, frame) + { + var image = new ArcadeImage(this.scene, x, y, key, frame); + + this.sys.displayList.add(image); + + this.world.enableBody(image, CONST.DYNAMIC_BODY); + + return image; + }, + + /** + * Creates a new Arcade Sprite object with a Static body. + * + * @method Phaser.Physics.Arcade.Factory#staticSprite + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created. + */ + staticSprite: function (x, y, key, frame) + { + var sprite = new ArcadeSprite(this.scene, x, y, key, frame); + + this.sys.displayList.add(sprite); + this.sys.updateList.add(sprite); + + this.world.enableBody(sprite, CONST.STATIC_BODY); + + return sprite; + }, + + /** + * Creates a new Arcade Sprite object with a Dynamic body. + * + * @method Phaser.Physics.Arcade.Factory#sprite + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created. + */ + sprite: function (x, y, key, frame) + { + var sprite = new ArcadeSprite(this.scene, x, y, key, frame); + + this.sys.displayList.add(sprite); + this.sys.updateList.add(sprite); + + this.world.enableBody(sprite, CONST.DYNAMIC_BODY); + + return sprite; + }, + + /** + * Creates a Static Physics Group object. + * All Game Objects created by this Group will automatically be static Arcade Physics objects. + * + * @method Phaser.Physics.Arcade.Factory#staticGroup + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - Settings for this group. + * + * @return {Phaser.Physics.Arcade.StaticGroup} The Static Group object that was created. + */ + staticGroup: function (children, config) + { + return this.sys.updateList.add(new StaticPhysicsGroup(this.world, this.world.scene, children, config)); + }, + + /** + * Creates a Physics Group object. + * All Game Objects created by this Group will automatically be dynamic Arcade Physics objects. + * + * @method Phaser.Physics.Arcade.Factory#group + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.Physics.Arcade.PhysicsGroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {Phaser.Types.Physics.Arcade.PhysicsGroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - Settings for this group. + * + * @return {Phaser.Physics.Arcade.Group} The Group object that was created. + */ + group: function (children, config) + { + return this.sys.updateList.add(new PhysicsGroup(this.world, this.world.scene, children, config)); + }, + + /** + * Destroys this Factory. + * + * @method Phaser.Physics.Arcade.Factory#destroy + * @since 3.5.0 + */ + destroy: function () + { + this.world = null; + this.scene = null; + this.sys = null; + } + +}); + +module.exports = Factory; + + +/***/ }), +/* 434 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(207); +var Image = __webpack_require__(95); + +/** + * @classdesc + * An Arcade Physics Image is an Image with an Arcade Physics body and related components. + * The body can be dynamic or static. + * + * The main difference between an Arcade Image and an Arcade Sprite is that you cannot animate an Arcade Image. + * + * @class Image + * @extends Phaser.GameObjects.Image + * @memberof Phaser.Physics.Arcade + * @constructor + * @since 3.0.0 + * + * @extends Phaser.Physics.Arcade.Components.Acceleration + * @extends Phaser.Physics.Arcade.Components.Angular + * @extends Phaser.Physics.Arcade.Components.Bounce + * @extends Phaser.Physics.Arcade.Components.Debug + * @extends Phaser.Physics.Arcade.Components.Drag + * @extends Phaser.Physics.Arcade.Components.Enable + * @extends Phaser.Physics.Arcade.Components.Friction + * @extends Phaser.Physics.Arcade.Components.Gravity + * @extends Phaser.Physics.Arcade.Components.Immovable + * @extends Phaser.Physics.Arcade.Components.Mass + * @extends Phaser.Physics.Arcade.Components.Size + * @extends Phaser.Physics.Arcade.Components.Velocity + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + */ +var ArcadeImage = new Class({ + + Extends: Image, + + Mixins: [ + Components.Acceleration, + Components.Angular, + Components.Bounce, + Components.Debug, + Components.Drag, + Components.Enable, + Components.Friction, + Components.Gravity, + Components.Immovable, + Components.Mass, + Components.Size, + Components.Velocity + ], + + initialize: + + function ArcadeImage (scene, x, y, texture, frame) + { + Image.call(this, scene, x, y, texture, frame); + + /** + * This Game Object's Physics Body. + * + * @name Phaser.Physics.Arcade.Image#body + * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} + * @default null + * @since 3.0.0 + */ + this.body = null; + } + +}); + +module.exports = ArcadeImage; + + +/***/ }), +/* 435 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArcadeSprite = __webpack_require__(134); +var Class = __webpack_require__(0); +var CONST = __webpack_require__(50); +var GetFastValue = __webpack_require__(2); +var Group = __webpack_require__(94); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * An Arcade Physics Group object. + * + * All Game Objects created by this Group will automatically be given dynamic Arcade Physics bodies. + * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticGroup}. + * + * @class Group + * @extends Phaser.GameObjects.Group + * @memberof Phaser.Physics.Arcade + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.World} world - The physics simulation. + * @param {Phaser.Scene} scene - The scene this group belongs to. + * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.Physics.Arcade.PhysicsGroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {Phaser.Types.Physics.Arcade.PhysicsGroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - Settings for this group. + */ +var PhysicsGroup = new Class({ + + Extends: Group, + + initialize: + + function PhysicsGroup (world, scene, children, config) + { + if (!children && !config) + { + config = { + createCallback: this.createCallbackHandler, + removeCallback: this.removeCallbackHandler + }; + } + else if (IsPlainObject(children)) + { + // children is a plain object, so swizzle them: + config = children; + children = null; + + config.createCallback = this.createCallbackHandler; + config.removeCallback = this.removeCallbackHandler; + } + else if (Array.isArray(children) && IsPlainObject(children[0])) + { + // children is an array of plain objects + config = children[0]; + + var _this = this; + + children.forEach(function (singleConfig) + { + singleConfig.createCallback = _this.createCallbackHandler; + singleConfig.removeCallback = _this.removeCallbackHandler; + }); + } + else + { + // config is not defined and children is not a plain object nor an array of plain objects + config = { + createCallback: this.createCallbackHandler, + removeCallback: this.removeCallbackHandler + }; + } + + /** + * The physics simulation. + * + * @name Phaser.Physics.Arcade.Group#world + * @type {Phaser.Physics.Arcade.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * The class to create new Group members from. + * + * This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those. + * + * @name Phaser.Physics.Arcade.Group#classType + * @type {Function} + * @default ArcadeSprite + * @since 3.0.0 + */ + config.classType = GetFastValue(config, 'classType', ArcadeSprite); + + /** + * The physics type of the Group's members. + * + * @name Phaser.Physics.Arcade.Group#physicsType + * @type {integer} + * @default Phaser.Physics.Arcade.DYNAMIC_BODY + * @since 3.0.0 + */ + this.physicsType = CONST.DYNAMIC_BODY; + + /** + * Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument. + * + * @name Phaser.Physics.Arcade.Group#defaults + * @type {Phaser.Types.Physics.Arcade.PhysicsGroupDefaults} + * @since 3.0.0 + */ + this.defaults = { + setCollideWorldBounds: GetFastValue(config, 'collideWorldBounds', false), + setAccelerationX: GetFastValue(config, 'accelerationX', 0), + setAccelerationY: GetFastValue(config, 'accelerationY', 0), + setAllowDrag: GetFastValue(config, 'allowDrag', true), + setAllowGravity: GetFastValue(config, 'allowGravity', true), + setAllowRotation: GetFastValue(config, 'allowRotation', true), + setBounceX: GetFastValue(config, 'bounceX', 0), + setBounceY: GetFastValue(config, 'bounceY', 0), + setDragX: GetFastValue(config, 'dragX', 0), + setDragY: GetFastValue(config, 'dragY', 0), + setEnable: GetFastValue(config, 'enable', true), + setGravityX: GetFastValue(config, 'gravityX', 0), + setGravityY: GetFastValue(config, 'gravityY', 0), + setFrictionX: GetFastValue(config, 'frictionX', 0), + setFrictionY: GetFastValue(config, 'frictionY', 0), + setVelocityX: GetFastValue(config, 'velocityX', 0), + setVelocityY: GetFastValue(config, 'velocityY', 0), + setAngularVelocity: GetFastValue(config, 'angularVelocity', 0), + setAngularAcceleration: GetFastValue(config, 'angularAcceleration', 0), + setAngularDrag: GetFastValue(config, 'angularDrag', 0), + setMass: GetFastValue(config, 'mass', 1), + setImmovable: GetFastValue(config, 'immovable', false) + }; + + if (Array.isArray(children)) + { + config = null; + } + + Group.call(this, scene, children, config); + }, + + /** + * Enables a Game Object's Body and assigns `defaults`. Called when a Group member is added or created. + * + * @method Phaser.Physics.Arcade.Group#createCallbackHandler + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object being added. + */ + createCallbackHandler: function (child) + { + if (!child.body) + { + this.world.enableBody(child, CONST.DYNAMIC_BODY); + } + + var body = child.body; + + for (var key in this.defaults) + { + body[key](this.defaults[key]); + } + }, + + /** + * Disables a Game Object's Body. Called when a Group member is removed. + * + * @method Phaser.Physics.Arcade.Group#removeCallbackHandler + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object being removed. + */ + removeCallbackHandler: function (child) + { + if (child.body) + { + this.world.disableBody(child); + } + }, + + /** + * Sets the velocity of each Group member. + * + * @method Phaser.Physics.Arcade.Group#setVelocity + * @since 3.0.0 + * + * @param {number} x - The horizontal velocity. + * @param {number} y - The vertical velocity. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x, y), the second (x + step, y + step), and so on. + * + * @return {Phaser.Physics.Arcade.Group} This Physics Group object. + */ + setVelocity: function (x, y, step) + { + if (step === undefined) { step = 0; } + + var items = this.getChildren(); + + for (var i = 0; i < items.length; i++) + { + items[i].body.velocity.set(x + (i * step), y + (i * step)); + } + + return this; + }, + + /** + * Sets the horizontal velocity of each Group member. + * + * @method Phaser.Physics.Arcade.Group#setVelocityX + * @since 3.0.0 + * + * @param {number} value - The velocity value. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x), the second (x + step), and so on. + * + * @return {Phaser.Physics.Arcade.Group} This Physics Group object. + */ + setVelocityX: function (value, step) + { + if (step === undefined) { step = 0; } + + var items = this.getChildren(); + + for (var i = 0; i < items.length; i++) + { + items[i].body.velocity.x = value + (i * step); + } + + return this; + }, + + /** + * Sets the vertical velocity of each Group member. + * + * @method Phaser.Physics.Arcade.Group#setVelocityY + * @since 3.0.0 + * + * @param {number} value - The velocity value. + * @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (y), the second (y + step), and so on. + * + * @return {Phaser.Physics.Arcade.Group} This Physics Group object. + */ + setVelocityY: function (value, step) + { + if (step === undefined) { step = 0; } + + var items = this.getChildren(); + + for (var i = 0; i < items.length; i++) + { + items[i].body.velocity.y = value + (i * step); + } + + return this; + } + +}); + +module.exports = PhysicsGroup; + + +/***/ }), +/* 436 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArcadeSprite = __webpack_require__(134); +var Class = __webpack_require__(0); +var CONST = __webpack_require__(50); +var GetFastValue = __webpack_require__(2); +var Group = __webpack_require__(94); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * An Arcade Physics Static Group object. + * + * All Game Objects created by this Group will automatically be given static Arcade Physics bodies. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Group}. + * + * @class StaticGroup + * @extends Phaser.GameObjects.Group + * @memberof Phaser.Physics.Arcade + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.World} world - The physics simulation. + * @param {Phaser.Scene} scene - The scene this group belongs to. + * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument. + * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - Settings for this group. + */ +var StaticPhysicsGroup = new Class({ + + Extends: Group, + + initialize: + + function StaticPhysicsGroup (world, scene, children, config) + { + if (!children && !config) + { + config = { + createCallback: this.createCallbackHandler, + removeCallback: this.removeCallbackHandler, + createMultipleCallback: this.createMultipleCallbackHandler, + classType: ArcadeSprite + }; + } + else if (IsPlainObject(children)) + { + // children is a plain object, so swizzle them: + config = children; + children = null; + + config.createCallback = this.createCallbackHandler; + config.removeCallback = this.removeCallbackHandler; + config.createMultipleCallback = this.createMultipleCallbackHandler; + config.classType = GetFastValue(config, 'classType', ArcadeSprite); + } + else if (Array.isArray(children) && IsPlainObject(children[0])) + { + // children is an array of plain objects + config = children; + children = null; + + config.forEach(function (singleConfig) + { + singleConfig.createCallback = this.createCallbackHandler; + singleConfig.removeCallback = this.removeCallbackHandler; + singleConfig.createMultipleCallback = this.createMultipleCallbackHandler; + singleConfig.classType = GetFastValue(singleConfig, 'classType', ArcadeSprite); + }); + } + + /** + * The physics simulation. + * + * @name Phaser.Physics.Arcade.StaticGroup#world + * @type {Phaser.Physics.Arcade.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * The scene this group belongs to. + * + * @name Phaser.Physics.Arcade.StaticGroup#physicsType + * @type {integer} + * @default Phaser.Physics.Arcade.STATIC_BODY + * @since 3.0.0 + */ + this.physicsType = CONST.STATIC_BODY; + + Group.call(this, scene, children, config); + }, + + /** + * Adds a static physics body to the new group member (if it lacks one) and adds it to the simulation. + * + * @method Phaser.Physics.Arcade.StaticGroup#createCallbackHandler + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The new group member. + * + * @see Phaser.Physics.Arcade.World#enableBody + */ + createCallbackHandler: function (child) + { + if (!child.body) + { + this.world.enableBody(child, CONST.STATIC_BODY); + } + }, + + /** + * Disables the group member's physics body, removing it from the simulation. + * + * @method Phaser.Physics.Arcade.StaticGroup#removeCallbackHandler + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The group member being removed. + * + * @see Phaser.Physics.Arcade.World#disableBody + */ + removeCallbackHandler: function (child) + { + if (child.body) + { + this.world.disableBody(child); + } + }, + + /** + * Refreshes the group. + * + * @method Phaser.Physics.Arcade.StaticGroup#createMultipleCallbackHandler + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject[]} entries - The newly created group members. + * + * @see Phaser.Physics.Arcade.StaticGroup#refresh + */ + createMultipleCallbackHandler: function () + { + this.refresh(); + }, + + /** + * Resets each Body to the position of its parent Game Object. + * Body sizes aren't changed (use {@link Phaser.Physics.Arcade.Components.Enable#refreshBody} for that). + * + * @method Phaser.Physics.Arcade.StaticGroup#refresh + * @since 3.0.0 + * + * @return {Phaser.Physics.Arcade.StaticGroup} This group. + * + * @see Phaser.Physics.Arcade.StaticBody#reset + */ + refresh: function () + { + var children = this.children.entries; + + for (var i = 0; i < children.length; i++) + { + children[i].body.reset(); + } + + return this; + } + +}); + +module.exports = StaticPhysicsGroup; + + +/***/ }), +/* 437 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Body = __webpack_require__(438); +var Clamp = __webpack_require__(22); +var Class = __webpack_require__(0); +var Collider = __webpack_require__(439); +var CONST = __webpack_require__(50); +var DistanceBetween = __webpack_require__(57); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(208); +var FuzzyEqual = __webpack_require__(166); +var FuzzyGreaterThan = __webpack_require__(295); +var FuzzyLessThan = __webpack_require__(296); +var GetOverlapX = __webpack_require__(440); +var GetOverlapY = __webpack_require__(441); +var GetValue = __webpack_require__(6); +var ProcessQueue = __webpack_require__(442); +var ProcessTileCallbacks = __webpack_require__(1230); +var Rectangle = __webpack_require__(10); +var RTree = __webpack_require__(443); +var SeparateTile = __webpack_require__(1231); +var SeparateX = __webpack_require__(1236); +var SeparateY = __webpack_require__(1237); +var Set = __webpack_require__(105); +var StaticBody = __webpack_require__(445); +var TileIntersectsBody = __webpack_require__(444); +var TransformMatrix = __webpack_require__(32); +var Vector2 = __webpack_require__(4); +var Wrap = __webpack_require__(56); + +/** + * @classdesc + * The Arcade Physics World. + * + * The World is responsible for creating, managing, colliding and updating all of the bodies within it. + * + * An instance of the World belongs to a Phaser.Scene and is accessed via the property `physics.world`. + * + * @class World + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Physics.Arcade + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this World instance belongs. + * @param {Phaser.Types.Physics.Arcade.ArcadeWorldConfig} config - An Arcade Physics Configuration object. + */ +var World = new Class({ + + Extends: EventEmitter, + + initialize: + + function World (scene, config) + { + EventEmitter.call(this); + + /** + * The Scene this simulation belongs to. + * + * @name Phaser.Physics.Arcade.World#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * Dynamic Bodies in this simulation. + * + * @name Phaser.Physics.Arcade.World#bodies + * @type {Phaser.Structs.Set.} + * @since 3.0.0 + */ + this.bodies = new Set(); + + /** + * Static Bodies in this simulation. + * + * @name Phaser.Physics.Arcade.World#staticBodies + * @type {Phaser.Structs.Set.} + * @since 3.0.0 + */ + this.staticBodies = new Set(); + + /** + * Static Bodies marked for deletion. + * + * @name Phaser.Physics.Arcade.World#pendingDestroy + * @type {Phaser.Structs.Set.<(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)>} + * @since 3.1.0 + */ + this.pendingDestroy = new Set(); + + /** + * This simulation's collision processors. + * + * @name Phaser.Physics.Arcade.World#colliders + * @type {Phaser.Structs.ProcessQueue.} + * @since 3.0.0 + */ + this.colliders = new ProcessQueue(); + + /** + * Acceleration of Bodies due to gravity, in pixels per second. + * + * @name Phaser.Physics.Arcade.World#gravity + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.gravity = new Vector2(GetValue(config, 'gravity.x', 0), GetValue(config, 'gravity.y', 0)); + + /** + * A boundary constraining Bodies. + * + * @name Phaser.Physics.Arcade.World#bounds + * @type {Phaser.Geom.Rectangle} + * @since 3.0.0 + */ + this.bounds = new Rectangle( + GetValue(config, 'x', 0), + GetValue(config, 'y', 0), + GetValue(config, 'width', scene.sys.scale.width), + GetValue(config, 'height', scene.sys.scale.height) + ); + + /** + * The boundary edges that Bodies can collide with. + * + * @name Phaser.Physics.Arcade.World#checkCollision + * @type {Phaser.Types.Physics.Arcade.CheckCollisionObject} + * @since 3.0.0 + */ + this.checkCollision = { + up: GetValue(config, 'checkCollision.up', true), + down: GetValue(config, 'checkCollision.down', true), + left: GetValue(config, 'checkCollision.left', true), + right: GetValue(config, 'checkCollision.right', true) + }; + + /** + * The number of physics steps to be taken per second. + * + * This property is read-only. Use the `setFPS` method to modify it at run-time. + * + * @name Phaser.Physics.Arcade.World#fps + * @readonly + * @type {number} + * @default 60 + * @since 3.10.0 + */ + this.fps = GetValue(config, 'fps', 60); + + /** + * The amount of elapsed ms since the last frame. + * + * @name Phaser.Physics.Arcade.World#_elapsed + * @private + * @type {number} + * @since 3.10.0 + */ + this._elapsed = 0; + + /** + * Internal frame time value. + * + * @name Phaser.Physics.Arcade.World#_frameTime + * @private + * @type {number} + * @since 3.10.0 + */ + this._frameTime = 1 / this.fps; + + /** + * Internal frame time ms value. + * + * @name Phaser.Physics.Arcade.World#_frameTimeMS + * @private + * @type {number} + * @since 3.10.0 + */ + this._frameTimeMS = 1000 * this._frameTime; + + /** + * The number of steps that took place in the last frame. + * + * @name Phaser.Physics.Arcade.World#stepsLastFrame + * @readonly + * @type {number} + * @since 3.10.0 + */ + this.stepsLastFrame = 0; + + /** + * Scaling factor applied to the frame rate. + * + * - 1.0 = normal speed + * - 2.0 = half speed + * - 0.5 = double speed + * + * @name Phaser.Physics.Arcade.World#timeScale + * @type {number} + * @default 1 + * @since 3.10.0 + */ + this.timeScale = GetValue(config, 'timeScale', 1); + + /** + * The maximum absolute difference of a Body's per-step velocity and its overlap with another Body that will result in separation on *each axis*. + * Larger values favor separation. + * Smaller values favor no separation. + * + * @name Phaser.Physics.Arcade.World#OVERLAP_BIAS + * @type {number} + * @default 4 + * @since 3.0.0 + */ + this.OVERLAP_BIAS = GetValue(config, 'overlapBias', 4); + + /** + * The maximum absolute value of a Body's overlap with a tile that will result in separation on *each axis*. + * Larger values favor separation. + * Smaller values favor no separation. + * The optimum value may be similar to the tile size. + * + * @name Phaser.Physics.Arcade.World#TILE_BIAS + * @type {number} + * @default 16 + * @since 3.0.0 + */ + this.TILE_BIAS = GetValue(config, 'tileBias', 16); + + /** + * Always separate overlapping Bodies horizontally before vertically. + * False (the default) means Bodies are first separated on the axis of greater gravity, or the vertical axis if neither is greater. + * + * @name Phaser.Physics.Arcade.World#forceX + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.forceX = GetValue(config, 'forceX', false); + + /** + * Whether the simulation advances with the game loop. + * + * @name Phaser.Physics.Arcade.World#isPaused + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.isPaused = GetValue(config, 'isPaused', false); + + /** + * Temporary total of colliding Bodies. + * + * @name Phaser.Physics.Arcade.World#_total + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._total = 0; + + /** + * Enables the debug display. + * + * @name Phaser.Physics.Arcade.World#drawDebug + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.drawDebug = GetValue(config, 'debug', false); + + /** + * The graphics object drawing the debug display. + * + * @name Phaser.Physics.Arcade.World#debugGraphic + * @type {Phaser.GameObjects.Graphics} + * @since 3.0.0 + */ + this.debugGraphic; + + /** + * Default debug display settings for new Bodies. + * + * @name Phaser.Physics.Arcade.World#defaults + * @type {Phaser.Types.Physics.Arcade.ArcadeWorldDefaults} + * @since 3.0.0 + */ + this.defaults = { + debugShowBody: GetValue(config, 'debugShowBody', true), + debugShowStaticBody: GetValue(config, 'debugShowStaticBody', true), + debugShowVelocity: GetValue(config, 'debugShowVelocity', true), + bodyDebugColor: GetValue(config, 'debugBodyColor', 0xff00ff), + staticBodyDebugColor: GetValue(config, 'debugStaticBodyColor', 0x0000ff), + velocityDebugColor: GetValue(config, 'debugVelocityColor', 0x00ff00) + }; + + /** + * The maximum number of items per node on the RTree. + * + * This is ignored if `useTree` is `false`. If you have a large number of bodies in + * your world then you may find search performance improves by increasing this value, + * to allow more items per node and less node division. + * + * @name Phaser.Physics.Arcade.World#maxEntries + * @type {integer} + * @default 16 + * @since 3.0.0 + */ + this.maxEntries = GetValue(config, 'maxEntries', 16); + + /** + * Should this Arcade Physics World use an RTree for Dynamic and Static Physics bodies? + * + * An RTree is a fast way of spatially sorting of all the bodies in the world. + * However, at certain limits, the cost of clearing and inserting the bodies into the + * tree every frame becomes more expensive than the search speed gains it provides. + * + * If you have a large number of dynamic bodies in your world then it may be best to + * disable the use of the RTree by setting this property to `false` in the physics config. + * + * The number it can cope with depends on browser and device, but a conservative estimate + * of around 5,000 bodies should be considered the max before disabling it. + * + * This only applies to dynamic bodies. Static bodies are always kept in an RTree, + * because they don't have to be cleared every frame, so you benefit from the + * massive search speeds all the time. + * + * @name Phaser.Physics.Arcade.World#useTree + * @type {boolean} + * @default true + * @since 3.10.0 + */ + this.useTree = GetValue(config, 'useTree', true); + + /** + * The spatial index of Dynamic Bodies. + * + * @name Phaser.Physics.Arcade.World#tree + * @type {Phaser.Structs.RTree} + * @since 3.0.0 + */ + this.tree = new RTree(this.maxEntries); + + /** + * The spatial index of Static Bodies. + * + * @name Phaser.Physics.Arcade.World#staticTree + * @type {Phaser.Structs.RTree} + * @since 3.0.0 + */ + this.staticTree = new RTree(this.maxEntries); + + /** + * Recycled input for tree searches. + * + * @name Phaser.Physics.Arcade.World#treeMinMax + * @type {Phaser.Types.Physics.Arcade.ArcadeWorldTreeMinMax} + * @since 3.0.0 + */ + this.treeMinMax = { minX: 0, minY: 0, maxX: 0, maxY: 0 }; + + /** + * A temporary Transform Matrix used by bodies for calculations without them needing their own local copy. + * + * @name Phaser.Physics.Arcade.World#_tempMatrix + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @private + * @since 3.12.0 + */ + this._tempMatrix = new TransformMatrix(); + + /** + * A temporary Transform Matrix used by bodies for calculations without them needing their own local copy. + * + * @name Phaser.Physics.Arcade.World#_tempMatrix2 + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @private + * @since 3.12.0 + */ + this._tempMatrix2 = new TransformMatrix(); + + if (this.drawDebug) + { + this.createDebugGraphic(); + } + }, + + /** + * Adds an Arcade Physics Body to a Game Object, an array of Game Objects, or the children of a Group. + * + * The difference between this and the `enableBody` method is that you can pass arrays or Groups + * to this method. + * + * You can specify if the bodies are to be Dynamic or Static. A dynamic body can move via velocity and + * acceleration. A static body remains fixed in place and as such is able to use an optimized search + * tree, making it ideal for static elements such as level objects. You can still collide and overlap + * with static bodies. + * + * Normally, rather than calling this method directly, you'd use the helper methods available in the + * Arcade Physics Factory, such as: + * + * ```javascript + * this.physics.add.image(x, y, textureKey); + * this.physics.add.sprite(x, y, textureKey); + * ``` + * + * Calling factory methods encapsulates the creation of a Game Object and the creation of its + * body at the same time. If you are creating custom classes then you can pass them to this + * method to have their bodies created. + * + * @method Phaser.Physics.Arcade.World#enable + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object - The object, or objects, on which to create the bodies. + * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + */ + enable: function (object, bodyType) + { + if (bodyType === undefined) { bodyType = CONST.DYNAMIC_BODY; } + + if (!Array.isArray(object)) + { + object = [ object ]; + } + + for (var i = 0; i < object.length; i++) + { + var entry = object[i]; + + if (entry.isParent) + { + var children = entry.getChildren(); + + for (var c = 0; c < children.length; c++) + { + var child = children[c]; + + if (child.isParent) + { + // Handle Groups nested inside of Groups + this.enable(child, bodyType); + } + else + { + this.enableBody(child, bodyType); + } + } + } + else + { + this.enableBody(entry, bodyType); + } + } + }, + + /** + * Creates an Arcade Physics Body on a single Game Object. + * + * If the Game Object already has a body, this method will simply add it back into the simulation. + * + * You can specify if the body is Dynamic or Static. A dynamic body can move via velocity and + * acceleration. A static body remains fixed in place and as such is able to use an optimized search + * tree, making it ideal for static elements such as level objects. You can still collide and overlap + * with static bodies. + * + * Normally, rather than calling this method directly, you'd use the helper methods available in the + * Arcade Physics Factory, such as: + * + * ```javascript + * this.physics.add.image(x, y, textureKey); + * this.physics.add.sprite(x, y, textureKey); + * ``` + * + * Calling factory methods encapsulates the creation of a Game Object and the creation of its + * body at the same time. If you are creating custom classes then you can pass them to this + * method to have their bodies created. + * + * @method Phaser.Physics.Arcade.World#enableBody + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} object - The Game Object on which to create the body. + * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + * + * @return {Phaser.GameObjects.GameObject} The Game Object on which the body was created. + */ + enableBody: function (object, bodyType) + { + if (bodyType === undefined) { bodyType = CONST.DYNAMIC_BODY; } + + if (!object.body) + { + if (bodyType === CONST.DYNAMIC_BODY) + { + object.body = new Body(this, object); + } + else if (bodyType === CONST.STATIC_BODY) + { + object.body = new StaticBody(this, object); + } + } + + this.add(object.body); + + return object; + }, + + /** + * Adds an existing Arcade Physics Body or StaticBody to the simulation. + * + * The body is enabled and added to the local search trees. + * + * @method Phaser.Physics.Arcade.World#add + * @since 3.10.0 + * + * @param {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body - The Body to be added to the simulation. + * + * @return {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} The Body that was added to the simulation. + */ + add: function (body) + { + if (body.physicsType === CONST.DYNAMIC_BODY) + { + this.bodies.set(body); + } + else if (body.physicsType === CONST.STATIC_BODY) + { + this.staticBodies.set(body); + + this.staticTree.insert(body); + } + + body.enable = true; + + return body; + }, + + /** + * Disables the Arcade Physics Body of a Game Object, an array of Game Objects, or the children of a Group. + * + * The difference between this and the `disableBody` method is that you can pass arrays or Groups + * to this method. + * + * The body itself is not deleted, it just has its `enable` property set to false, which + * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`. + * + * @method Phaser.Physics.Arcade.World#disable + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object - The object, or objects, on which to disable the bodies. + */ + disable: function (object) + { + if (!Array.isArray(object)) + { + object = [ object ]; + } + + for (var i = 0; i < object.length; i++) + { + var entry = object[i]; + + if (entry.isParent) + { + var children = entry.getChildren(); + + for (var c = 0; c < children.length; c++) + { + var child = children[c]; + + if (child.isParent) + { + // Handle Groups nested inside of Groups + this.disable(child); + } + else + { + this.disableBody(child.body); + } + } + } + else + { + this.disableBody(entry.body); + } + } + }, + + /** + * Disables an existing Arcade Physics Body or StaticBody and removes it from the simulation. + * + * The body is disabled and removed from the local search trees. + * + * The body itself is not deleted, it just has its `enable` property set to false, which + * means you can re-enable it again at any point by passing it to enable `World.enable` or `World.add`. + * + * @method Phaser.Physics.Arcade.World#disableBody + * @since 3.0.0 + * + * @param {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body - The Body to be disabled. + */ + disableBody: function (body) + { + this.remove(body); + + body.enable = false; + }, + + /** + * Removes an existing Arcade Physics Body or StaticBody from the simulation. + * + * The body is disabled and removed from the local search trees. + * + * The body itself is not deleted, it just has its `enabled` property set to false, which + * means you can re-enable it again at any point by passing it to enable `enable` or `add`. + * + * @method Phaser.Physics.Arcade.World#remove + * @since 3.0.0 + * + * @param {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body - The body to be removed from the simulation. + */ + remove: function (body) + { + if (body.physicsType === CONST.DYNAMIC_BODY) + { + this.tree.remove(body); + this.bodies.delete(body); + } + else if (body.physicsType === CONST.STATIC_BODY) + { + this.staticBodies.delete(body); + this.staticTree.remove(body); + } + }, + + /** + * Creates a Graphics Game Object that the world will use to render the debug display to. + * + * This is called automatically when the World is instantiated if the `debug` config property + * was set to `true`. However, you can call it at any point should you need to display the + * debug Graphic from a fixed point. + * + * You can control which objects are drawn to the Graphics object, and the colors they use, + * by setting the debug properties in the physics config. + * + * You should not typically use this in a production game. Use it to aid during debugging. + * + * @method Phaser.Physics.Arcade.World#createDebugGraphic + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Graphics} The Graphics object that was created for use by the World. + */ + createDebugGraphic: function () + { + var graphic = this.scene.sys.add.graphics({ x: 0, y: 0 }); + + graphic.setDepth(Number.MAX_VALUE); + + this.debugGraphic = graphic; + + this.drawDebug = true; + + return graphic; + }, + + /** + * Sets the position, size and properties of the World boundary. + * + * The World boundary is an invisible rectangle that defines the edges of the World. + * If a Body is set to collide with the world bounds then it will automatically stop + * when it reaches any of the edges. You can optionally set which edges of the boundary + * should be checked against. + * + * @method Phaser.Physics.Arcade.World#setBounds + * @since 3.0.0 + * + * @param {number} x - The top-left x coordinate of the boundary. + * @param {number} y - The top-left y coordinate of the boundary. + * @param {number} width - The width of the boundary. + * @param {number} height - The height of the boundary. + * @param {boolean} [checkLeft] - Should bodies check against the left edge of the boundary? + * @param {boolean} [checkRight] - Should bodies check against the right edge of the boundary? + * @param {boolean} [checkUp] - Should bodies check against the top edge of the boundary? + * @param {boolean} [checkDown] - Should bodies check against the bottom edge of the boundary? + * + * @return {Phaser.Physics.Arcade.World} This World object. + */ + setBounds: function (x, y, width, height, checkLeft, checkRight, checkUp, checkDown) + { + this.bounds.setTo(x, y, width, height); + + if (checkLeft !== undefined) + { + this.setBoundsCollision(checkLeft, checkRight, checkUp, checkDown); + } + + return this; + }, + + /** + * Enables or disables collisions on each edge of the World boundary. + * + * @method Phaser.Physics.Arcade.World#setBoundsCollision + * @since 3.0.0 + * + * @param {boolean} [left=true] - Should bodies check against the left edge of the boundary? + * @param {boolean} [right=true] - Should bodies check against the right edge of the boundary? + * @param {boolean} [up=true] - Should bodies check against the top edge of the boundary? + * @param {boolean} [down=true] - Should bodies check against the bottom edge of the boundary? + * + * @return {Phaser.Physics.Arcade.World} This World object. + */ + setBoundsCollision: function (left, right, up, down) + { + if (left === undefined) { left = true; } + if (right === undefined) { right = true; } + if (up === undefined) { up = true; } + if (down === undefined) { down = true; } + + this.checkCollision.left = left; + this.checkCollision.right = right; + this.checkCollision.up = up; + this.checkCollision.down = down; + + return this; + }, + + /** + * Pauses the simulation. + * + * A paused simulation does not update any existing bodies, or run any Colliders. + * + * However, you can still enable and disable bodies within it, or manually run collide or overlap + * checks. + * + * @method Phaser.Physics.Arcade.World#pause + * @fires Phaser.Physics.Arcade.Events#PAUSE + * @since 3.0.0 + * + * @return {Phaser.Physics.Arcade.World} This World object. + */ + pause: function () + { + this.isPaused = true; + + this.emit(Events.PAUSE); + + return this; + }, + + /** + * Resumes the simulation, if paused. + * + * @method Phaser.Physics.Arcade.World#resume + * @fires Phaser.Physics.Arcade.Events#RESUME + * @since 3.0.0 + * + * @return {Phaser.Physics.Arcade.World} This World object. + */ + resume: function () + { + this.isPaused = false; + + this.emit(Events.RESUME); + + return this; + }, + + /** + * Creates a new Collider object and adds it to the simulation. + * + * A Collider is a way to automatically perform collision checks between two objects, + * calling the collide and process callbacks if they occur. + * + * Colliders are run as part of the World update, after all of the Bodies have updated. + * + * By creating a Collider you don't need then call `World.collide` in your `update` loop, + * as it will be handled for you automatically. + * + * @method Phaser.Physics.Arcade.World#addCollider + * @since 3.0.0 + * @see Phaser.Physics.Arcade.World#collide + * + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. + * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects collide. Must return a boolean. + * @param {*} [callbackContext] - The scope in which to call the callbacks. + * + * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. + */ + addCollider: function (object1, object2, collideCallback, processCallback, callbackContext) + { + if (collideCallback === undefined) { collideCallback = null; } + if (processCallback === undefined) { processCallback = null; } + if (callbackContext === undefined) { callbackContext = collideCallback; } + + var collider = new Collider(this, false, object1, object2, collideCallback, processCallback, callbackContext); + + this.colliders.add(collider); + + return collider; + }, + + /** + * Creates a new Overlap Collider object and adds it to the simulation. + * + * A Collider is a way to automatically perform overlap checks between two objects, + * calling the collide and process callbacks if they occur. + * + * Colliders are run as part of the World update, after all of the Bodies have updated. + * + * By creating a Collider you don't need then call `World.overlap` in your `update` loop, + * as it will be handled for you automatically. + * + * @method Phaser.Physics.Arcade.World#addOverlap + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for overlap. + * @param {ArcadePhysicsCallback} [collideCallback] - The callback to invoke when the two objects overlap. + * @param {ArcadePhysicsCallback} [processCallback] - The callback to invoke when the two objects overlap. Must return a boolean. + * @param {*} [callbackContext] - The scope in which to call the callbacks. + * + * @return {Phaser.Physics.Arcade.Collider} The Collider that was created. + */ + addOverlap: function (object1, object2, collideCallback, processCallback, callbackContext) + { + if (collideCallback === undefined) { collideCallback = null; } + if (processCallback === undefined) { processCallback = null; } + if (callbackContext === undefined) { callbackContext = collideCallback; } + + var collider = new Collider(this, true, object1, object2, collideCallback, processCallback, callbackContext); + + this.colliders.add(collider); + + return collider; + }, + + /** + * Removes a Collider from the simulation so it is no longer processed. + * + * This method does not destroy the Collider. If you wish to add it back at a later stage you can call + * `World.colliders.add(Collider)`. + * + * If you no longer need the Collider you can call the `Collider.destroy` method instead, which will + * automatically clear all of its references and then remove it from the World. If you call destroy on + * a Collider you _don't_ need to pass it to this method too. + * + * @method Phaser.Physics.Arcade.World#removeCollider + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Collider} collider - The Collider to remove from the simulation. + * + * @return {Phaser.Physics.Arcade.World} This World object. + */ + removeCollider: function (collider) + { + this.colliders.remove(collider); + + return this; + }, + + /** + * Sets the frame rate to run the simulation at. + * + * The frame rate value is used to simulate a fixed update time step. This fixed + * time step allows for a straightforward implementation of a deterministic game state. + * + * This frame rate is independent of the frequency at which the game is rendering. The + * higher you set the fps, the more physics simulation steps will occur per game step. + * Conversely, the lower you set it, the less will take place. + * + * You can optionally advance the simulation directly yourself by calling the `step` method. + * + * @method Phaser.Physics.Arcade.World#setFPS + * @since 3.10.0 + * + * @param {integer} framerate - The frame rate to advance the simulation at. + * + * @return {this} This World object. + */ + setFPS: function (framerate) + { + this.fps = framerate; + this._frameTime = 1 / this.fps; + this._frameTimeMS = 1000 * this._frameTime; + + return this; + }, + + /** + * Advances the simulation based on the elapsed time and fps rate. + * + * This is called automatically by your Scene and does not need to be invoked directly. + * + * @method Phaser.Physics.Arcade.World#update + * @protected + * @fires Phaser.Physics.Arcade.Events#WORLD_STEP + * @since 3.0.0 + * + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function (time, delta) + { + if (this.isPaused || this.bodies.size === 0) + { + return; + } + + var i; + var fixedDelta = this._frameTime; + var msPerFrame = this._frameTimeMS * this.timeScale; + + this._elapsed += delta; + + // Update all active bodies + var body; + var bodies = this.bodies.entries; + + // Will a step happen this frame? + var willStep = (this._elapsed >= msPerFrame); + + for (i = 0; i < bodies.length; i++) + { + body = bodies[i]; + + if (body.enable) + { + body.preUpdate(willStep, fixedDelta); + } + } + + // We know that a step will happen this frame, so let's bundle it all together to save branching and iteration costs + if (willStep) + { + this._elapsed -= msPerFrame; + this.stepsLastFrame = 1; + + // Optionally populate our dynamic collision tree + if (this.useTree) + { + this.tree.clear(); + this.tree.load(bodies); + } + + // Process any colliders + var colliders = this.colliders.update(); + + for (i = 0; i < colliders.length; i++) + { + var collider = colliders[i]; + + if (collider.active) + { + collider.update(); + } + } + + this.emit(Events.WORLD_STEP); + } + + // Process any additional steps this frame + while (this._elapsed >= msPerFrame) + { + this._elapsed -= msPerFrame; + + this.step(fixedDelta); + } + }, + + /** + * Advances the simulation by a time increment. + * + * @method Phaser.Physics.Arcade.World#step + * @fires Phaser.Physics.Arcade.Events#WORLD_STEP + * @since 3.10.0 + * + * @param {number} delta - The delta time amount, in seconds, by which to advance the simulation. + */ + step: function (delta) + { + // Update all active bodies + var i; + var body; + var bodies = this.bodies.entries; + var len = bodies.length; + + for (i = 0; i < len; i++) + { + body = bodies[i]; + + if (body.enable) + { + body.update(delta); + } + } + + // Optionally populate our dynamic collision tree + if (this.useTree) + { + this.tree.clear(); + this.tree.load(bodies); + } + + // Process any colliders + var colliders = this.colliders.update(); + + for (i = 0; i < colliders.length; i++) + { + var collider = colliders[i]; + + if (collider.active) + { + collider.update(); + } + } + + this.emit(Events.WORLD_STEP); + + this.stepsLastFrame++; + }, + + /** + * Updates bodies, draws the debug display, and handles pending queue operations. + * + * @method Phaser.Physics.Arcade.World#postUpdate + * @since 3.0.0 + */ + postUpdate: function () + { + var i; + var body; + var bodies = this.bodies.entries; + var len = bodies.length; + + var dynamic = this.bodies; + var staticBodies = this.staticBodies; + + // We don't need to postUpdate if there wasn't a step this frame + if (this.stepsLastFrame) + { + for (i = 0; i < len; i++) + { + body = bodies[i]; + + if (body.enable) + { + body.postUpdate(); + } + } + } + + if (this.drawDebug) + { + var graphics = this.debugGraphic; + + graphics.clear(); + + for (i = 0; i < len; i++) + { + body = bodies[i]; + + if (body.willDrawDebug()) + { + body.drawDebug(graphics); + } + } + + bodies = staticBodies.entries; + len = bodies.length; + + for (i = 0; i < len; i++) + { + body = bodies[i]; + + if (body.willDrawDebug()) + { + body.drawDebug(graphics); + } + } + } + + var pending = this.pendingDestroy; + + if (pending.size > 0) + { + var dynamicTree = this.tree; + var staticTree = this.staticTree; + + bodies = pending.entries; + len = bodies.length; + + for (i = 0; i < len; i++) + { + body = bodies[i]; + + if (body.physicsType === CONST.DYNAMIC_BODY) + { + dynamicTree.remove(body); + dynamic.delete(body); + } + else if (body.physicsType === CONST.STATIC_BODY) + { + staticTree.remove(body); + staticBodies.delete(body); + } + + body.world = undefined; + body.gameObject = undefined; + } + + pending.clear(); + } + }, + + /** + * Calculates a Body's velocity and updates its position. + * + * @method Phaser.Physics.Arcade.World#updateMotion + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body - The Body to be updated. + * @param {number} delta - The delta value to be used in the motion calculations, in seconds. + */ + updateMotion: function (body, delta) + { + if (body.allowRotation) + { + this.computeAngularVelocity(body, delta); + } + + this.computeVelocity(body, delta); + }, + + /** + * Calculates a Body's angular velocity. + * + * @method Phaser.Physics.Arcade.World#computeAngularVelocity + * @since 3.10.0 + * + * @param {Phaser.Physics.Arcade.Body} body - The Body to compute the velocity for. + * @param {number} delta - The delta value to be used in the calculation, in seconds. + */ + computeAngularVelocity: function (body, delta) + { + var velocity = body.angularVelocity; + var acceleration = body.angularAcceleration; + var drag = body.angularDrag; + var max = body.maxAngular; + + if (acceleration) + { + velocity += acceleration * delta; + } + else if (body.allowDrag && drag) + { + drag *= delta; + + if (FuzzyGreaterThan(velocity - drag, 0, 0.1)) + { + velocity -= drag; + } + else if (FuzzyLessThan(velocity + drag, 0, 0.1)) + { + velocity += drag; + } + else + { + velocity = 0; + } + } + + velocity = Clamp(velocity, -max, max); + + var velocityDelta = velocity - body.angularVelocity; + + body.angularVelocity += velocityDelta; + body.rotation += (body.angularVelocity * delta); + }, + + /** + * Calculates a Body's per-axis velocity. + * + * @method Phaser.Physics.Arcade.World#computeVelocity + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body - The Body to compute the velocity for. + * @param {number} delta - The delta value to be used in the calculation, in seconds. + */ + computeVelocity: function (body, delta) + { + var velocityX = body.velocity.x; + var accelerationX = body.acceleration.x; + var dragX = body.drag.x; + var maxX = body.maxVelocity.x; + + var velocityY = body.velocity.y; + var accelerationY = body.acceleration.y; + var dragY = body.drag.y; + var maxY = body.maxVelocity.y; + + var speed = body.speed; + var maxSpeed = body.maxSpeed; + var allowDrag = body.allowDrag; + var useDamping = body.useDamping; + + if (body.allowGravity) + { + velocityX += (this.gravity.x + body.gravity.x) * delta; + velocityY += (this.gravity.y + body.gravity.y) * delta; + } + + if (accelerationX) + { + velocityX += accelerationX * delta; + } + else if (allowDrag && dragX) + { + if (useDamping) + { + // Damping based deceleration + + velocityX *= dragX; + + speed = Math.sqrt(velocityX * velocityX + velocityY * velocityY); + + if (FuzzyEqual(speed, 0, 0.001)) + { + velocityX = 0; + } + } + else + { + // Linear deceleration + dragX *= delta; + + if (FuzzyGreaterThan(velocityX - dragX, 0, 0.01)) + { + velocityX -= dragX; + } + else if (FuzzyLessThan(velocityX + dragX, 0, 0.01)) + { + velocityX += dragX; + } + else + { + velocityX = 0; + } + } + } + + if (accelerationY) + { + velocityY += accelerationY * delta; + } + else if (allowDrag && dragY) + { + if (useDamping) + { + // Damping based deceleration + velocityY *= dragY; + + speed = Math.sqrt(velocityX * velocityX + velocityY * velocityY); + + if (FuzzyEqual(speed, 0, 0.001)) + { + velocityY = 0; + } + } + else + { + // Linear deceleration + dragY *= delta; + + if (FuzzyGreaterThan(velocityY - dragY, 0, 0.01)) + { + velocityY -= dragY; + } + else if (FuzzyLessThan(velocityY + dragY, 0, 0.01)) + { + velocityY += dragY; + } + else + { + velocityY = 0; + } + } + } + + velocityX = Clamp(velocityX, -maxX, maxX); + velocityY = Clamp(velocityY, -maxY, maxY); + + body.velocity.set(velocityX, velocityY); + + if (maxSpeed > -1 && speed > maxSpeed) + { + body.velocity.normalize().scale(maxSpeed); + speed = maxSpeed; + } + + body.speed = speed; + }, + + /** + * Separates two Bodies. + * + * @method Phaser.Physics.Arcade.World#separate + * @fires Phaser.Physics.Arcade.Events#COLLIDE + * @fires Phaser.Physics.Arcade.Events#OVERLAP + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to be separated. + * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to be separated. + * @param {ArcadePhysicsCallback} [processCallback] - The process callback. + * @param {*} [callbackContext] - The context in which to invoke the callback. + * @param {boolean} [overlapOnly] - If this a collide or overlap check? + * + * @return {boolean} True if separation occurred, otherwise false. + */ + separate: function (body1, body2, processCallback, callbackContext, overlapOnly) + { + if ( + !body1.enable || + !body2.enable || + body1.checkCollision.none || + body2.checkCollision.none || + !this.intersects(body1, body2)) + { + return false; + } + + // They overlap. Is there a custom process callback? If it returns true then we can carry on, otherwise we should abort. + if (processCallback && processCallback.call(callbackContext, body1.gameObject, body2.gameObject) === false) + { + return false; + } + + // Circle vs. Circle quick bail out + if (body1.isCircle && body2.isCircle) + { + return this.separateCircle(body1, body2, overlapOnly); + } + + // We define the behavior of bodies in a collision circle and rectangle + // If a collision occurs in the corner points of the rectangle, the body behave like circles + + // Either body1 or body2 is a circle + if (body1.isCircle !== body2.isCircle) + { + var bodyRect = (body1.isCircle) ? body2 : body1; + var bodyCircle = (body1.isCircle) ? body1 : body2; + + var rect = { + x: bodyRect.x, + y: bodyRect.y, + right: bodyRect.right, + bottom: bodyRect.bottom + }; + + var circle = bodyCircle.center; + + if (circle.y < rect.y || circle.y > rect.bottom) + { + if (circle.x < rect.x || circle.x > rect.right) + { + return this.separateCircle(body1, body2, overlapOnly); + } + } + } + + var resultX = false; + var resultY = false; + + // Do we separate on x or y first? + if (this.forceX || Math.abs(this.gravity.y + body1.gravity.y) < Math.abs(this.gravity.x + body1.gravity.x)) + { + resultX = SeparateX(body1, body2, overlapOnly, this.OVERLAP_BIAS); + + // Are they still intersecting? Let's do the other axis then + if (this.intersects(body1, body2)) + { + resultY = SeparateY(body1, body2, overlapOnly, this.OVERLAP_BIAS); + } + } + else + { + resultY = SeparateY(body1, body2, overlapOnly, this.OVERLAP_BIAS); + + // Are they still intersecting? Let's do the other axis then + if (this.intersects(body1, body2)) + { + resultX = SeparateX(body1, body2, overlapOnly, this.OVERLAP_BIAS); + } + } + + var result = (resultX || resultY); + + if (result) + { + if (overlapOnly) + { + if (body1.onOverlap || body2.onOverlap) + { + this.emit(Events.OVERLAP, body1.gameObject, body2.gameObject, body1, body2); + } + } + else if (body1.onCollide || body2.onCollide) + { + this.emit(Events.COLLIDE, body1.gameObject, body2.gameObject, body1, body2); + } + } + + return result; + }, + + /** + * Separates two Bodies, when both are circular. + * + * @method Phaser.Physics.Arcade.World#separateCircle + * @fires Phaser.Physics.Arcade.Events#COLLIDE + * @fires Phaser.Physics.Arcade.Events#OVERLAP + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to be separated. + * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to be separated. + * @param {boolean} [overlapOnly] - If this a collide or overlap check? + * @param {number} [bias] - A small value added to the calculations. + * + * @return {boolean} True if separation occurred, otherwise false. + */ + separateCircle: function (body1, body2, overlapOnly, bias) + { + // Set the bounding box overlap values into the bodies themselves (hence we don't use the return values here) + GetOverlapX(body1, body2, false, bias); + GetOverlapY(body1, body2, false, bias); + + var overlap = 0; + + if (body1.isCircle !== body2.isCircle) + { + var rect = { + x: (body2.isCircle) ? body1.position.x : body2.position.x, + y: (body2.isCircle) ? body1.position.y : body2.position.y, + right: (body2.isCircle) ? body1.right : body2.right, + bottom: (body2.isCircle) ? body1.bottom : body2.bottom + }; + + var circle = { + x: (body1.isCircle) ? body1.center.x : body2.center.x, + y: (body1.isCircle) ? body1.center.y : body2.center.y, + radius: (body1.isCircle) ? body1.halfWidth : body2.halfWidth + }; + + if (circle.y < rect.y) + { + if (circle.x < rect.x) + { + overlap = DistanceBetween(circle.x, circle.y, rect.x, rect.y) - circle.radius; + } + else if (circle.x > rect.right) + { + overlap = DistanceBetween(circle.x, circle.y, rect.right, rect.y) - circle.radius; + } + } + else if (circle.y > rect.bottom) + { + if (circle.x < rect.x) + { + overlap = DistanceBetween(circle.x, circle.y, rect.x, rect.bottom) - circle.radius; + } + else if (circle.x > rect.right) + { + overlap = DistanceBetween(circle.x, circle.y, rect.right, rect.bottom) - circle.radius; + } + } + + overlap *= -1; + } + else + { + overlap = (body1.halfWidth + body2.halfWidth) - DistanceBetween(body1.center.x, body1.center.y, body2.center.x, body2.center.y); + } + + // Can't separate two immovable bodies, or a body with its own custom separation logic + if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateX || body2.customSeparateX) + { + if (overlap !== 0 && (body1.onOverlap || body2.onOverlap)) + { + this.emit(Events.OVERLAP, body1.gameObject, body2.gameObject, body1, body2); + } + + // return true if there was some overlap, otherwise false + return (overlap !== 0); + } + + var dx = body1.position.x - body2.position.x; + var dy = body1.position.y - body2.position.y; + var d = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)); + var nx = ((body2.position.x - body1.position.x) / d) || 0; + var ny = ((body2.position.y - body1.position.y) / d) || 0; + var p = 2 * (body1.velocity.x * nx + body1.velocity.y * ny - body2.velocity.x * nx - body2.velocity.y * ny) / (body1.mass + body2.mass); + + if (!body1.immovable) + { + body1.velocity.x = (body1.velocity.x - p * body1.mass * nx) * body1.bounce.x; + body1.velocity.y = (body1.velocity.y - p * body1.mass * ny) * body1.bounce.y; + } + + if (!body2.immovable) + { + body2.velocity.x = (body2.velocity.x + p * body2.mass * nx) * body2.bounce.x; + body2.velocity.y = (body2.velocity.y + p * body2.mass * ny) * body2.bounce.y; + } + + var dvx = body2.velocity.x - body1.velocity.x; + var dvy = body2.velocity.y - body1.velocity.y; + var angleCollision = Math.atan2(dvy, dvx); + + var delta = this._frameTime; + + if (!body1.immovable) + { + body1.x += (body1.velocity.x * delta) - overlap * Math.cos(angleCollision); + body1.y += (body1.velocity.y * delta) - overlap * Math.sin(angleCollision); + } + + if (!body2.immovable) + { + body2.x += (body2.velocity.x * delta) + overlap * Math.cos(angleCollision); + body2.y += (body2.velocity.y * delta) + overlap * Math.sin(angleCollision); + } + + if (body1.onCollide || body2.onCollide) + { + this.emit(Events.COLLIDE, body1.gameObject, body2.gameObject, body1, body2); + } + + return true; + }, + + /** + * Checks to see if two Bodies intersect at all. + * + * @method Phaser.Physics.Arcade.World#intersects + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body1 - The first body to check. + * @param {Phaser.Physics.Arcade.Body} body2 - The second body to check. + * + * @return {boolean} True if the two bodies intersect, otherwise false. + */ + intersects: function (body1, body2) + { + if (body1 === body2) + { + return false; + } + + if (!body1.isCircle && !body2.isCircle) + { + // Rect vs. Rect + return !( + body1.right <= body2.position.x || + body1.bottom <= body2.position.y || + body1.position.x >= body2.right || + body1.position.y >= body2.bottom + ); + } + else if (body1.isCircle) + { + if (body2.isCircle) + { + // Circle vs. Circle + return DistanceBetween(body1.center.x, body1.center.y, body2.center.x, body2.center.y) <= (body1.halfWidth + body2.halfWidth); + } + else + { + // Circle vs. Rect + return this.circleBodyIntersects(body1, body2); + } + } + else + { + // Rect vs. Circle + return this.circleBodyIntersects(body2, body1); + } + }, + + /** + * Tests if a circular Body intersects with another Body. + * + * @method Phaser.Physics.Arcade.World#circleBodyIntersects + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} circle - The circular body to test. + * @param {Phaser.Physics.Arcade.Body} body - The rectangular body to test. + * + * @return {boolean} True if the two bodies intersect, otherwise false. + */ + circleBodyIntersects: function (circle, body) + { + var x = Clamp(circle.center.x, body.left, body.right); + var y = Clamp(circle.center.y, body.top, body.bottom); + + var dx = (circle.center.x - x) * (circle.center.x - x); + var dy = (circle.center.y - y) * (circle.center.y - y); + + return (dx + dy) <= (circle.halfWidth * circle.halfWidth); + }, + + /** + * Tests if Game Objects overlap. + * + * @method Phaser.Physics.Arcade.World#overlap + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [overlapCallback] - An optional callback function that is called if the objects overlap. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. + * @param {*} [callbackContext] - The context in which to run the callbacks. + * + * @return {boolean} True if at least one Game Object overlaps another. + */ + overlap: function (object1, object2, overlapCallback, processCallback, callbackContext) + { + if (overlapCallback === undefined) { overlapCallback = null; } + if (processCallback === undefined) { processCallback = null; } + if (callbackContext === undefined) { callbackContext = overlapCallback; } + + return this.collideObjects(object1, object2, overlapCallback, processCallback, callbackContext, true); + }, + + /** + * Performs a collision check and separation between the two physics enabled objects given, which can be single + * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. + * + * If you don't require separation then use {@link #overlap} instead. + * + * If two Groups or arrays are passed, each member of one will be tested against each member of the other. + * + * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members. + * + * If **only** one Array is passed, the array is iterated and every element in it is tested against the others. + * + * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding + * objects are passed to it. + * + * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable + * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. + * The separation that stops two objects penetrating may create a new penetration against a different object. If you + * require a high level of stability please consider using an alternative physics system, such as Matter.js. + * + * @method Phaser.Physics.Arcade.World#collide + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} [callbackContext] - The context in which to run the callbacks. + * + * @return {boolean} `true` if any overlapping Game Objects were separated, otherwise `false`. + */ + collide: function (object1, object2, collideCallback, processCallback, callbackContext) + { + if (collideCallback === undefined) { collideCallback = null; } + if (processCallback === undefined) { processCallback = null; } + if (callbackContext === undefined) { callbackContext = collideCallback; } + + return this.collideObjects(object1, object2, collideCallback, processCallback, callbackContext, false); + }, + + /** + * Internal helper function. Please use Phaser.Physics.Arcade.World#collide instead. + * + * @method Phaser.Physics.Arcade.World#collideObjects + * @private + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object to check for collision. + * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {any} callbackContext - The scope in which to call the callbacks. + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + collideObjects: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly) + { + var i; + var j; + + if (object1.isParent && object1.physicsType === undefined) + { + object1 = object1.children.entries; + } + + if (object2 && object2.isParent && object2.physicsType === undefined) + { + object2 = object2.children.entries; + } + + var object1isArray = Array.isArray(object1); + var object2isArray = Array.isArray(object2); + + this._total = 0; + + if (!object1isArray && !object2isArray) + { + // Neither of them are arrays - do this first as it's the most common use-case + this.collideHandler(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); + } + else if (!object1isArray && object2isArray) + { + // Object 2 is an Array + for (i = 0; i < object2.length; i++) + { + this.collideHandler(object1, object2[i], collideCallback, processCallback, callbackContext, overlapOnly); + } + } + else if (object1isArray && !object2isArray) + { + // Object 1 is an Array + if (!object2) + { + // Special case for array vs. self + for (i = 0; i < object1.length; i++) + { + var child = object1[i]; + + for (j = i + 1; j < object1.length; j++) + { + if (i === j) + { + continue; + } + + this.collideHandler(child, object1[j], collideCallback, processCallback, callbackContext, overlapOnly); + } + } + } + else + { + for (i = 0; i < object1.length; i++) + { + this.collideHandler(object1[i], object2, collideCallback, processCallback, callbackContext, overlapOnly); + } + } + } + else + { + // They're both arrays + for (i = 0; i < object1.length; i++) + { + for (j = 0; j < object2.length; j++) + { + this.collideHandler(object1[i], object2[j], collideCallback, processCallback, callbackContext, overlapOnly); + } + } + } + + return (this._total > 0); + }, + + /** + * Internal helper function. Please use Phaser.Physics.Arcade.World#collide and Phaser.Physics.Arcade.World#overlap instead. + * + * @method Phaser.Physics.Arcade.World#collideHandler + * @private + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} callbackContext - The context in which to run the callbacks. + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + collideHandler: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly) + { + // Collide Group with Self + // Only collide valid objects + if (object2 === undefined && object1.isParent) + { + return this.collideGroupVsGroup(object1, object1, collideCallback, processCallback, callbackContext, overlapOnly); + } + + // If neither of the objects are set then bail out + if (!object1 || !object2) + { + return false; + } + + // A Body + if (object1.body) + { + if (object2.body) + { + return this.collideSpriteVsSprite(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); + } + else if (object2.isParent) + { + return this.collideSpriteVsGroup(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); + } + else if (object2.isTilemap) + { + return this.collideSpriteVsTilemapLayer(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); + } + } + + // GROUPS + else if (object1.isParent) + { + if (object2.body) + { + return this.collideSpriteVsGroup(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); + } + else if (object2.isParent) + { + return this.collideGroupVsGroup(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); + } + else if (object2.isTilemap) + { + return this.collideGroupVsTilemapLayer(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); + } + } + + // TILEMAP LAYERS + else if (object1.isTilemap) + { + if (object2.body) + { + return this.collideSpriteVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); + } + else if (object2.isParent) + { + return this.collideGroupVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); + } + } + }, + + /** + * Internal handler for Sprite vs. Sprite collisions. + * Please use Phaser.Physics.Arcade.World#collide instead. + * + * @method Phaser.Physics.Arcade.World#collideSpriteVsSprite + * @private + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} sprite1 - The first object to check for collision. + * @param {Phaser.GameObjects.GameObject} sprite2 - The second object to check for collision. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} [callbackContext] - The context in which to run the callbacks. + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + collideSpriteVsSprite: function (sprite1, sprite2, collideCallback, processCallback, callbackContext, overlapOnly) + { + if (!sprite1.body || !sprite2.body) + { + return false; + } + + if (this.separate(sprite1.body, sprite2.body, processCallback, callbackContext, overlapOnly)) + { + if (collideCallback) + { + collideCallback.call(callbackContext, sprite1, sprite2); + } + + this._total++; + } + + return true; + }, + + /** + * Internal handler for Sprite vs. Group collisions. + * Please use Phaser.Physics.Arcade.World#collide instead. + * + * @method Phaser.Physics.Arcade.World#collideSpriteVsGroup + * @private + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. + * @param {Phaser.GameObjects.Group} group - The second object to check for collision. + * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {any} callbackContext - The scope in which to call the callbacks. + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. + * + * @return {boolean} `true` if the Sprite collided with the given Group, otherwise `false`. + */ + collideSpriteVsGroup: function (sprite, group, collideCallback, processCallback, callbackContext, overlapOnly) + { + var bodyA = sprite.body; + + if (group.length === 0 || !bodyA || !bodyA.enable) + { + return; + } + + // Does sprite collide with anything? + + var i; + var len; + var bodyB; + + if (this.useTree) + { + var minMax = this.treeMinMax; + + minMax.minX = bodyA.left; + minMax.minY = bodyA.top; + minMax.maxX = bodyA.right; + minMax.maxY = bodyA.bottom; + + var results = (group.physicsType === CONST.DYNAMIC_BODY) ? this.tree.search(minMax) : this.staticTree.search(minMax); + + len = results.length; + + for (i = 0; i < len; i++) + { + bodyB = results[i]; + + if (bodyA === bodyB || !group.contains(bodyB.gameObject)) + { + // Skip if comparing against itself, or if bodyB isn't actually part of the Group + continue; + } + + if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly)) + { + if (collideCallback) + { + collideCallback.call(callbackContext, bodyA.gameObject, bodyB.gameObject); + } + + this._total++; + } + } + } + else + { + var children = group.getChildren(); + var skipIndex = group.children.entries.indexOf(sprite); + + len = children.length; + + for (i = 0; i < len; i++) + { + bodyB = children[i].body; + + if (!bodyB || i === skipIndex || !bodyB.enable) + { + continue; + } + + if (this.separate(bodyA, bodyB, processCallback, callbackContext, overlapOnly)) + { + if (collideCallback) + { + collideCallback.call(callbackContext, bodyA.gameObject, bodyB.gameObject); + } + + this._total++; + } + } + } + }, + + /** + * Internal handler for Group vs. Tilemap collisions. + * Please use Phaser.Physics.Arcade.World#collide instead. + * + * @method Phaser.Physics.Arcade.World#collideGroupVsTilemapLayer + * @private + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Group} group - The first object to check for collision. + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} [callbackContext] - The context in which to run the callbacks. + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + collideGroupVsTilemapLayer: function (group, tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly) + { + var children = group.getChildren(); + + if (children.length === 0) + { + return false; + } + + var didCollide = false; + + for (var i = 0; i < children.length; i++) + { + if (children[i].body) + { + if (this.collideSpriteVsTilemapLayer(children[i], tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly)) + { + didCollide = true; + } + } + } + + return didCollide; + }, + + /** + * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects. + * + * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for collision with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions + * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * + * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have + * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the + * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on + * dynamic maps, this method can prove very useful. + * + * @method Phaser.Physics.Arcade.World#collideTiles + * @fires Phaser.Physics.Arcade.Events#TILE_COLLIDE + * @since 3.17.0 + * + * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. + * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} [callbackContext] - The context in which to run the callbacks. + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + collideTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext) + { + if (!sprite.body.enable || tiles.length === 0) + { + return false; + } + else + { + return this.collideSpriteVsTilesHandler(sprite, tiles, collideCallback, processCallback, callbackContext, false, false); + } + }, + + /** + * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects. + * + * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap + * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * + * @method Phaser.Physics.Arcade.World#overlapTiles + * @fires Phaser.Physics.Arcade.Events#TILE_OVERLAP + * @since 3.17.0 + * + * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. + * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} [callbackContext] - The context in which to run the callbacks. + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + overlapTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext) + { + if (!sprite.body.enable || tiles.length === 0) + { + return false; + } + else + { + return this.collideSpriteVsTilesHandler(sprite, tiles, collideCallback, processCallback, callbackContext, true, false); + } + }, + + /** + * Internal handler for Sprite vs. Tilemap collisions. + * Please use Phaser.Physics.Arcade.World#collide instead. + * + * @method Phaser.Physics.Arcade.World#collideSpriteVsTilemapLayer + * @fires Phaser.Physics.Arcade.Events#TILE_COLLIDE + * @fires Phaser.Physics.Arcade.Events#TILE_OVERLAP + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} [callbackContext] - The context in which to run the callbacks. + * @param {boolean} [overlapOnly] - Whether this is a collision or overlap check. + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext, overlapOnly) + { + var body = sprite.body; + + if (!body.enable) + { + return false; + } + + var x = body.position.x; + var y = body.position.y; + var w = body.width; + var h = body.height; + + // TODO: this logic should be encapsulated within the Tilemap API at some point. + // If the maps base tile size differs from the layer's tile size, we need to adjust the + // selection area by the difference between the two. + var layerData = tilemapLayer.layer; + + if (layerData.tileWidth > layerData.baseTileWidth) + { + // The x origin of a tile is the left side, so x and width need to be adjusted. + var xDiff = (layerData.tileWidth - layerData.baseTileWidth) * tilemapLayer.scaleX; + x -= xDiff; + w += xDiff; + } + + if (layerData.tileHeight > layerData.baseTileHeight) + { + // The y origin of a tile is the bottom side, so just the height needs to be adjusted. + var yDiff = (layerData.tileHeight - layerData.baseTileHeight) * tilemapLayer.scaleY; + h += yDiff; + } + + var mapData = tilemapLayer.getTilesWithinWorldXY(x, y, w, h); + + if (mapData.length === 0) + { + return false; + } + else + { + return this.collideSpriteVsTilesHandler(sprite, mapData, collideCallback, processCallback, callbackContext, overlapOnly, true); + } + }, + + /** + * Internal handler for Sprite vs. Tilemap collisions. + * Please use Phaser.Physics.Arcade.World#collide instead. + * + * @method Phaser.Physics.Arcade.World#collideSpriteVsTilesHandler + * @fires Phaser.Physics.Arcade.Events#TILE_COLLIDE + * @fires Phaser.Physics.Arcade.Events#TILE_OVERLAP + * @private + * @since 3.17.0 + * + * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} [callbackContext] - The context in which to run the callbacks. + * @param {boolean} [overlapOnly] - Whether this is a collision or overlap check. + * @param {boolean} [isLayer] - Is this check coming from a TilemapLayer or an array of tiles? + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + collideSpriteVsTilesHandler: function (sprite, tiles, collideCallback, processCallback, callbackContext, overlapOnly, isLayer) + { + var body = sprite.body; + + var tile; + var tileWorldRect = { left: 0, right: 0, top: 0, bottom: 0 }; + var tilemapLayer; + var collision = false; + + for (var i = 0; i < tiles.length; i++) + { + tile = tiles[i]; + + tilemapLayer = tile.tilemapLayer; + + tileWorldRect.left = tilemapLayer.tileToWorldX(tile.x); + tileWorldRect.top = tilemapLayer.tileToWorldY(tile.y); + + // If the map's base tile size differs from the layer's tile size, only the top of the rect + // needs to be adjusted since its origin is (0, 1). + if (tile.baseHeight !== tile.height) + { + tileWorldRect.top -= (tile.height - tile.baseHeight) * tilemapLayer.scaleY; + } + + tileWorldRect.right = tileWorldRect.left + tile.width * tilemapLayer.scaleX; + tileWorldRect.bottom = tileWorldRect.top + tile.height * tilemapLayer.scaleY; + + if (TileIntersectsBody(tileWorldRect, body) + && (!processCallback || processCallback.call(callbackContext, sprite, tile)) + && ProcessTileCallbacks(tile, sprite) + && (overlapOnly || SeparateTile(i, body, tile, tileWorldRect, tilemapLayer, this.TILE_BIAS, isLayer))) + { + this._total++; + + collision = true; + + if (collideCallback) + { + collideCallback.call(callbackContext, sprite, tile); + } + + if (overlapOnly && body.onOverlap) + { + this.emit(Events.TILE_OVERLAP, sprite, tile, body); + } + else if (body.onCollide) + { + this.emit(Events.TILE_COLLIDE, sprite, tile, body); + } + } + } + + return collision; + }, + + /** + * Internal helper for Group vs. Group collisions. + * Please use Phaser.Physics.Arcade.World#collide instead. + * + * @method Phaser.Physics.Arcade.World#collideGroupVsGroup + * @private + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Group} group1 - The first object to check for collision. + * @param {Phaser.GameObjects.Group} group2 - The second object to check for collision. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} [callbackContext] - The context in which to run the callbacks. + * @param {boolean} overlapOnly - Whether this is a collision or overlap check. + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + collideGroupVsGroup: function (group1, group2, collideCallback, processCallback, callbackContext, overlapOnly) + { + if (group1.length === 0 || group2.length === 0) + { + return; + } + + var children = group1.getChildren(); + + for (var i = 0; i < children.length; i++) + { + this.collideSpriteVsGroup(children[i], group2, collideCallback, processCallback, callbackContext, overlapOnly); + } + }, + + /** + * Wrap an object's coordinates (or several objects' coordinates) within {@link Phaser.Physics.Arcade.World#bounds}. + * + * If the object is outside any boundary edge (left, top, right, bottom), it will be moved to the same offset from the opposite edge (the interior). + * + * @method Phaser.Physics.Arcade.World#wrap + * @since 3.3.0 + * + * @param {*} object - A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. + * @param {number} [padding=0] - An amount added to each boundary edge during the operation. + */ + wrap: function (object, padding) + { + if (object.body) + { + this.wrapObject(object, padding); + } + else if (object.getChildren) + { + this.wrapArray(object.getChildren(), padding); + } + else if (Array.isArray(object)) + { + this.wrapArray(object, padding); + } + else + { + this.wrapObject(object, padding); + } + }, + + /** + * Wrap each object's coordinates within {@link Phaser.Physics.Arcade.World#bounds}. + * + * @method Phaser.Physics.Arcade.World#wrapArray + * @since 3.3.0 + * + * @param {Array.<*>} objects - An array of objects to be wrapped. + * @param {number} [padding=0] - An amount added to the boundary. + */ + wrapArray: function (objects, padding) + { + for (var i = 0; i < objects.length; i++) + { + this.wrapObject(objects[i], padding); + } + }, + + /** + * Wrap an object's coordinates within {@link Phaser.Physics.Arcade.World#bounds}. + * + * @method Phaser.Physics.Arcade.World#wrapObject + * @since 3.3.0 + * + * @param {*} object - A Game Object, a Physics Body, or any object with `x` and `y` coordinates + * @param {number} [padding=0] - An amount added to the boundary. + */ + wrapObject: function (object, padding) + { + if (padding === undefined) { padding = 0; } + + object.x = Wrap(object.x, this.bounds.left - padding, this.bounds.right + padding); + object.y = Wrap(object.y, this.bounds.top - padding, this.bounds.bottom + padding); + }, + + /** + * Shuts down the simulation, clearing physics data and removing listeners. + * + * @method Phaser.Physics.Arcade.World#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + this.tree.clear(); + this.staticTree.clear(); + this.bodies.clear(); + this.staticBodies.clear(); + this.colliders.destroy(); + + this.removeAllListeners(); + }, + + /** + * Shuts down the simulation and disconnects it from the current scene. + * + * @method Phaser.Physics.Arcade.World#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene = null; + } + +}); + +module.exports = World; + + +/***/ }), +/* 438 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CircleContains = __webpack_require__(46); +var Class = __webpack_require__(0); +var CONST = __webpack_require__(50); +var Events = __webpack_require__(208); +var RadToDeg = __webpack_require__(169); +var Rectangle = __webpack_require__(10); +var RectangleContains = __webpack_require__(47); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Dynamic Arcade Body. + * + * Its static counterpart is {@link Phaser.Physics.Arcade.StaticBody}. + * + * @class Body + * @memberof Phaser.Physics.Arcade + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics simulation this Body belongs to. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Body belongs to. + */ +var Body = new Class({ + + initialize: + + function Body (world, gameObject) + { + var width = (gameObject.width) ? gameObject.width : 64; + var height = (gameObject.height) ? gameObject.height : 64; + + /** + * The Arcade Physics simulation this Body belongs to. + * + * @name Phaser.Physics.Arcade.Body#world + * @type {Phaser.Physics.Arcade.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * The Game Object this Body belongs to. + * + * @name Phaser.Physics.Arcade.Body#gameObject + * @type {Phaser.GameObjects.GameObject} + * @since 3.0.0 + */ + this.gameObject = gameObject; + + /** + * Transformations applied to this Body. + * + * @name Phaser.Physics.Arcade.Body#transform + * @type {object} + * @since 3.4.0 + */ + this.transform = { + x: gameObject.x, + y: gameObject.y, + rotation: gameObject.angle, + scaleX: gameObject.scaleX, + scaleY: gameObject.scaleY, + displayOriginX: gameObject.displayOriginX, + displayOriginY: gameObject.displayOriginY + }; + + /** + * Whether the Body's boundary is drawn to the debug display. + * + * @name Phaser.Physics.Arcade.Body#debugShowBody + * @type {boolean} + * @since 3.0.0 + */ + this.debugShowBody = world.defaults.debugShowBody; + + /** + * Whether the Body's velocity is drawn to the debug display. + * + * @name Phaser.Physics.Arcade.Body#debugShowVelocity + * @type {boolean} + * @since 3.0.0 + */ + this.debugShowVelocity = world.defaults.debugShowVelocity; + + /** + * The color of this Body on the debug display. + * + * @name Phaser.Physics.Arcade.Body#debugBodyColor + * @type {integer} + * @since 3.0.0 + */ + this.debugBodyColor = world.defaults.bodyDebugColor; + + /** + * Whether this Body is updated by the physics simulation. + * + * @name Phaser.Physics.Arcade.Body#enable + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.enable = true; + + /** + * Whether this Body's boundary is circular (true) or rectangular (false). + * + * @name Phaser.Physics.Arcade.Body#isCircle + * @type {boolean} + * @default false + * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#setCircle + */ + this.isCircle = false; + + /** + * If this Body is circular, this is the unscaled radius of the Body's boundary, as set by setCircle(), in source pixels. + * The true radius is equal to `halfWidth`. + * + * @name Phaser.Physics.Arcade.Body#radius + * @type {number} + * @default 0 + * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#setCircle + */ + this.radius = 0; + + /** + * The offset of this Body's position from its Game Object's position, in source pixels. + * + * @name Phaser.Physics.Arcade.Body#offset + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#setOffset + */ + this.offset = new Vector2(); + + /** + * The position of this Body within the simulation. + * + * @name Phaser.Physics.Arcade.Body#position + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.position = new Vector2(gameObject.x, gameObject.y); + + /** + * The position of this Body during the previous step. + * + * @name Phaser.Physics.Arcade.Body#prev + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.prev = new Vector2(gameObject.x, gameObject.y); + + /** + * Whether this Body's `rotation` is affected by its angular acceleration and angular velocity. + * + * @name Phaser.Physics.Arcade.Body#allowRotation + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.allowRotation = true; + + /** + * This body's rotation, in degrees, based on its angular acceleration and angular velocity. + * The Body's rotation controls the `angle` of its Game Object. + * It doesn't rotate the Body's boundary, which is always an axis-aligned rectangle or a circle. + * + * @name Phaser.Physics.Arcade.Body#rotation + * @type {number} + * @since 3.0.0 + */ + this.rotation = gameObject.angle; + + /** + * The Body's rotation, in degrees, during the previous step. + * + * @name Phaser.Physics.Arcade.Body#preRotation + * @type {number} + * @since 3.0.0 + */ + this.preRotation = gameObject.angle; + + /** + * The width of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. + * + * @name Phaser.Physics.Arcade.Body#width + * @type {number} + * @default 64 + * @since 3.0.0 + */ + this.width = width; + + /** + * The height of the Body's boundary, in pixels. + * If the Body is circular, this is also the Body's diameter. + * + * @name Phaser.Physics.Arcade.Body#height + * @type {number} + * @default 64 + * @since 3.0.0 + */ + this.height = height; + + /** + * The unscaled width of the Body, in source pixels, as set by setSize(). + * The default is the width of the Body's Game Object's texture frame. + * + * @name Phaser.Physics.Arcade.Body#sourceWidth + * @type {number} + * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#setSize + */ + this.sourceWidth = width; + + /** + * The unscaled height of the Body, in source pixels, as set by setSize(). + * The default is the height of the Body's Game Object's texture frame. + * + * @name Phaser.Physics.Arcade.Body#sourceHeight + * @type {number} + * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#setSize + */ + this.sourceHeight = height; + + if (gameObject.frame) + { + this.sourceWidth = gameObject.frame.realWidth; + this.sourceHeight = gameObject.frame.realHeight; + } + + /** + * Half the Body's width, in pixels. + * + * @name Phaser.Physics.Arcade.Body#halfWidth + * @type {number} + * @since 3.0.0 + */ + this.halfWidth = Math.abs(width / 2); + + /** + * Half the Body's height, in pixels. + * + * @name Phaser.Physics.Arcade.Body#halfHeight + * @type {number} + * @since 3.0.0 + */ + this.halfHeight = Math.abs(height / 2); + + /** + * The center of the Body's boundary. + * The midpoint of its `position` (top-left corner) and its bottom-right corner. + * + * @name Phaser.Physics.Arcade.Body#center + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.center = new Vector2(gameObject.x + this.halfWidth, gameObject.y + this.halfHeight); + + /** + * The Body's velocity, in pixels per second. + * + * @name Phaser.Physics.Arcade.Body#velocity + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.velocity = new Vector2(); + + /** + * The Body's calculated velocity, in pixels per second, at the last step. + * + * @name Phaser.Physics.Arcade.Body#newVelocity + * @type {Phaser.Math.Vector2} + * @readonly + * @since 3.0.0 + */ + this.newVelocity = new Vector2(); + + /** + * The Body's absolute maximum change in position, in pixels per step. + * + * @name Phaser.Physics.Arcade.Body#deltaMax + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.deltaMax = new Vector2(); + + /** + * The Body's change in velocity, in pixels per second squared. + * + * @name Phaser.Physics.Arcade.Body#acceleration + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.acceleration = new Vector2(); + + /** + * Whether this Body's velocity is affected by its `drag`. + * + * @name Phaser.Physics.Arcade.Body#allowDrag + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.allowDrag = true; + + /** + * Absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * + * @name Phaser.Physics.Arcade.Body#drag + * @type {(Phaser.Math.Vector2|number)} + * @since 3.0.0 + */ + this.drag = new Vector2(); + + /** + * Whether this Body's position is affected by gravity (local or world). + * + * @name Phaser.Physics.Arcade.Body#allowGravity + * @type {boolean} + * @default true + * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#gravity + * @see Phaser.Physics.Arcade.World#gravity + */ + this.allowGravity = true; + + /** + * Acceleration due to gravity (specific to this Body), in pixels per second squared. + * Total gravity is the sum of this vector and the simulation's `gravity`. + * + * @name Phaser.Physics.Arcade.Body#gravity + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + * @see Phaser.Physics.Arcade.World#gravity + */ + this.gravity = new Vector2(); + + /** + * Rebound following a collision, relative to 1. + * + * @name Phaser.Physics.Arcade.Body#bounce + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.bounce = new Vector2(); + + /** + * Rebound following a collision with the world boundary, relative to 1. + * If null, `bounce` is used instead. + * + * @name Phaser.Physics.Arcade.Body#worldBounce + * @type {?Phaser.Math.Vector2} + * @default null + * @since 3.0.0 + */ + this.worldBounce = null; + + // If true this Body will dispatch events + + /** + * Whether the simulation emits a `worldbounds` event when this Body collides with the world boundary (and `collideWorldBounds` is also true). + * + * @name Phaser.Physics.Arcade.Body#onWorldBounds + * @type {boolean} + * @default false + * @since 3.0.0 + * @see Phaser.Physics.Arcade.World#worldboundsEvent + */ + this.onWorldBounds = false; + + /** + * Whether the simulation emits a `collide` event when this Body collides with another. + * + * @name Phaser.Physics.Arcade.Body#onCollide + * @type {boolean} + * @default false + * @since 3.0.0 + * @see Phaser.Physics.Arcade.World#collideEvent + */ + this.onCollide = false; + + /** + * Whether the simulation emits an `overlap` event when this Body overlaps with another. + * + * @name Phaser.Physics.Arcade.Body#onOverlap + * @type {boolean} + * @default false + * @since 3.0.0 + * @see Phaser.Physics.Arcade.World#overlapEvent + */ + this.onOverlap = false; + + /** + * The Body's absolute maximum velocity, in pixels per second. + * The horizontal and vertical components are applied separately. + * + * @name Phaser.Physics.Arcade.Body#maxVelocity + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.maxVelocity = new Vector2(10000, 10000); + + /** + * The maximum speed this Body is allowed to reach. + * + * If not negative it limits the scalar value of speed. + * + * Any negative value means no maximum is being applied. + * + * @name Phaser.Physics.Arcade.Body#maxSpeed + * @type {number} + * @since 3.16.0 + */ + this.maxSpeed = -1; + + /** + * If this Body is `immovable` and in motion, `friction` is the proportion of this Body's motion received by the riding Body on each axis, relative to 1. + * The default value (1, 0) moves the riding Body horizontally in equal proportion to this Body and vertically not at all. + * The horizontal component (x) is applied only when two colliding Bodies are separated vertically. + * The vertical component (y) is applied only when two colliding Bodies are separated horizontally. + * + * @name Phaser.Physics.Arcade.Body#friction + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.friction = new Vector2(1, 0); + + /** + * If this Body is using `drag` for deceleration this property controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * + * @name Phaser.Physics.Arcade.Body#useDamping + * @type {boolean} + * @default false + * @since 3.10.0 + */ + this.useDamping = false; + + /** + * The rate of change of this Body's `rotation`, in degrees per second. + * + * @name Phaser.Physics.Arcade.Body#angularVelocity + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.angularVelocity = 0; + + /** + * The Body's angular acceleration (change in angular velocity), in degrees per second squared. + * + * @name Phaser.Physics.Arcade.Body#angularAcceleration + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.angularAcceleration = 0; + + /** + * Loss of angular velocity due to angular movement, in degrees per second. + * + * Angular drag is applied only when angular acceleration is zero. + * + * @name Phaser.Physics.Arcade.Body#angularDrag + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.angularDrag = 0; + + /** + * The Body's maximum angular velocity, in degrees per second. + * + * @name Phaser.Physics.Arcade.Body#maxAngular + * @type {number} + * @default 1000 + * @since 3.0.0 + */ + this.maxAngular = 1000; + + /** + * The Body's inertia, relative to a default unit (1). + * With `bounce`, this affects the exchange of momentum (velocities) during collisions. + * + * @name Phaser.Physics.Arcade.Body#mass + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.mass = 1; + + /** + * The calculated angle of this Body's velocity vector, in radians, during the last step. + * + * @name Phaser.Physics.Arcade.Body#angle + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.angle = 0; + + /** + * The calculated magnitude of the Body's velocity, in pixels per second, during the last step. + * + * @name Phaser.Physics.Arcade.Body#speed + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.speed = 0; + + /** + * The direction of the Body's velocity, as calculated during the last step. + * If the Body is moving on both axes (diagonally), this describes motion on the vertical axis only. + * + * @name Phaser.Physics.Arcade.Body#facing + * @type {integer} + * @since 3.0.0 + */ + this.facing = CONST.FACING_NONE; + + /** + * Whether this Body can be moved by collisions with another Body. + * + * @name Phaser.Physics.Arcade.Body#immovable + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.immovable = false; + + /** + * Whether the Body's position and rotation are affected by its velocity, acceleration, drag, and gravity. + * + * @name Phaser.Physics.Arcade.Body#moves + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.moves = true; + + /** + * A flag disabling the default horizontal separation of colliding bodies. + * Pass your own `collideCallback` to the collider. + * + * @name Phaser.Physics.Arcade.Body#customSeparateX + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.customSeparateX = false; + + /** + * A flag disabling the default vertical separation of colliding bodies. + * Pass your own `collideCallback` to the collider. + * + * @name Phaser.Physics.Arcade.Body#customSeparateY + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.customSeparateY = false; + + /** + * The amount of horizontal overlap (before separation), if this Body is colliding with another. + * + * @name Phaser.Physics.Arcade.Body#overlapX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.overlapX = 0; + + /** + * The amount of vertical overlap (before separation), if this Body is colliding with another. + * + * @name Phaser.Physics.Arcade.Body#overlapY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.overlapY = 0; + + /** + * The amount of overlap (before separation), if this Body is circular and colliding with another circular body. + * + * @name Phaser.Physics.Arcade.Body#overlapR + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.overlapR = 0; + + /** + * Whether this Body is overlapped with another and both are not moving. + * + * @name Phaser.Physics.Arcade.Body#embedded + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.embedded = false; + + /** + * Whether this Body interacts with the world boundary. + * + * @name Phaser.Physics.Arcade.Body#collideWorldBounds + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.collideWorldBounds = false; + + /** + * Whether this Body is checked for collisions and for which directions. + * You can set `checkCollision.none = true` to disable collision checks. + * + * @name Phaser.Physics.Arcade.Body#checkCollision + * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} + * @since 3.0.0 + */ + this.checkCollision = { none: false, up: true, down: true, left: true, right: true }; + + /** + * Whether this Body is colliding with another and in which direction. + * + * @name Phaser.Physics.Arcade.Body#touching + * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} + * @since 3.0.0 + */ + this.touching = { none: true, up: false, down: false, left: false, right: false }; + + /** + * Whether this Body was colliding with another during the last step, and in which direction. + * + * @name Phaser.Physics.Arcade.Body#wasTouching + * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} + * @since 3.0.0 + */ + this.wasTouching = { none: true, up: false, down: false, left: false, right: false }; + + /** + * Whether this Body is colliding with a tile or the world boundary. + * + * @name Phaser.Physics.Arcade.Body#blocked + * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} + * @since 3.0.0 + */ + this.blocked = { none: true, up: false, down: false, left: false, right: false }; + + /** + * Whether to automatically synchronize this Body's dimensions to the dimensions of its Game Object's visual bounds. + * + * @name Phaser.Physics.Arcade.Body#syncBounds + * @type {boolean} + * @default false + * @since 3.0.0 + * @see Phaser.GameObjects.Components.GetBounds#getBounds + */ + this.syncBounds = false; + + /** + * The Body's physics type (dynamic or static). + * + * @name Phaser.Physics.Arcade.Body#physicsType + * @type {integer} + * @readonly + * @default Phaser.Physics.Arcade.DYNAMIC_BODY + * @since 3.0.0 + */ + this.physicsType = CONST.DYNAMIC_BODY; + + /** + * Whether the Body's position needs updating from its Game Object. + * + * @name Phaser.Physics.Arcade.Body#_reset + * @type {boolean} + * @private + * @default true + * @since 3.0.0 + */ + this._reset = true; + + /** + * Cached horizontal scale of the Body's Game Object. + * + * @name Phaser.Physics.Arcade.Body#_sx + * @type {number} + * @private + * @since 3.0.0 + */ + this._sx = gameObject.scaleX; + + /** + * Cached vertical scale of the Body's Game Object. + * + * @name Phaser.Physics.Arcade.Body#_sy + * @type {number} + * @private + * @since 3.0.0 + */ + this._sy = gameObject.scaleY; + + /** + * The calculated change in the Body's horizontal position during the last step. + * + * @name Phaser.Physics.Arcade.Body#_dx + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._dx = 0; + + /** + * The calculated change in the Body's vertical position during the last step. + * + * @name Phaser.Physics.Arcade.Body#_dy + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._dy = 0; + + /** + * Stores the Game Object's bounds. + * + * @name Phaser.Physics.Arcade.Body#_bounds + * @type {Phaser.Geom.Rectangle} + * @private + * @since 3.0.0 + */ + this._bounds = new Rectangle(); + }, + + /** + * Updates the Body's `transform`, `width`, `height`, and `center` from its Game Object. + * The Body's `position` isn't changed. + * + * @method Phaser.Physics.Arcade.Body#updateBounds + * @since 3.0.0 + */ + updateBounds: function () + { + var sprite = this.gameObject; + + // Container? + + var transform = this.transform; + + if (sprite.parentContainer) + { + var matrix = sprite.getWorldTransformMatrix(this.world._tempMatrix, this.world._tempMatrix2); + + transform.x = matrix.tx; + transform.y = matrix.ty; + transform.rotation = RadToDeg(matrix.rotation); + transform.scaleX = matrix.scaleX; + transform.scaleY = matrix.scaleY; + transform.displayOriginX = sprite.displayOriginX; + transform.displayOriginY = sprite.displayOriginY; + } + else + { + transform.x = sprite.x; + transform.y = sprite.y; + transform.rotation = sprite.angle; + transform.scaleX = sprite.scaleX; + transform.scaleY = sprite.scaleY; + transform.displayOriginX = sprite.displayOriginX; + transform.displayOriginY = sprite.displayOriginY; + } + + var recalc = false; + + if (this.syncBounds) + { + var b = sprite.getBounds(this._bounds); + + this.width = b.width; + this.height = b.height; + recalc = true; + } + else + { + var asx = Math.abs(transform.scaleX); + var asy = Math.abs(transform.scaleY); + + if (this._sx !== asx || this._sy !== asy) + { + this.width = this.sourceWidth * asx; + this.height = this.sourceHeight * asy; + this._sx = asx; + this._sy = asy; + recalc = true; + } + } + + if (recalc) + { + this.halfWidth = Math.floor(this.width / 2); + this.halfHeight = Math.floor(this.height / 2); + this.updateCenter(); + } + }, + + /** + * Updates the Body's `center` from its `position`, `width`, and `height`. + * + * @method Phaser.Physics.Arcade.Body#updateCenter + * @since 3.0.0 + */ + updateCenter: function () + { + this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight); + }, + + /** + * Prepares the Body for a physics step by resetting the `wasTouching`, `touching` and `blocked` states. + * + * This method is only called if the physics world is going to run a step this frame. + * + * @method Phaser.Physics.Arcade.Body#resetFlags + * @since 3.18.0 + */ + resetFlags: function () + { + // Store and reset collision flags + this.wasTouching.none = this.touching.none; + this.wasTouching.up = this.touching.up; + this.wasTouching.down = this.touching.down; + this.wasTouching.left = this.touching.left; + this.wasTouching.right = this.touching.right; + + this.touching.none = true; + this.touching.up = false; + this.touching.down = false; + this.touching.left = false; + this.touching.right = false; + + this.blocked.none = true; + this.blocked.up = false; + this.blocked.down = false; + this.blocked.left = false; + this.blocked.right = false; + + this.overlapR = 0; + this.overlapX = 0; + this.overlapY = 0; + + this.embedded = false; + }, + + /** + * Syncs the position body position with the parent Game Object. + * + * This method is called every game frame, regardless if the world steps or not. + * + * @method Phaser.Physics.Arcade.Body#preUpdate + * @since 3.17.0 + * + * @param {boolean} willStep - Will this Body run an update as well? + * @param {number} delta - The delta time, in seconds, elapsed since the last frame. + */ + preUpdate: function (willStep, delta) + { + if (willStep) + { + this.resetFlags(); + } + + this.updateBounds(); + + var sprite = this.transform; + + this.position.x = sprite.x + sprite.scaleX * (this.offset.x - sprite.displayOriginX); + this.position.y = sprite.y + sprite.scaleY * (this.offset.y - sprite.displayOriginY); + + this.updateCenter(); + + this.rotation = sprite.rotation; + + this.preRotation = this.rotation; + + if (this._reset) + { + this.prev.x = this.position.x; + this.prev.y = this.position.y; + } + + if (willStep) + { + this.update(delta); + } + }, + + /** + * Performs a single physics step and updates the body velocity, angle, speed and other properties. + * + * This method can be called multiple times per game frame, depending on the physics step rate. + * + * The results are synced back to the Game Object in `postUpdate`. + * + * @method Phaser.Physics.Arcade.Body#update + * @fires Phaser.Physics.Arcade.Events#WORLD_BOUNDS + * @since 3.0.0 + * + * @param {number} delta - The delta time, in seconds, elapsed since the last frame. + */ + update: function (delta) + { + if (this.moves) + { + this.world.updateMotion(this, delta); + + var vx = this.velocity.x; + var vy = this.velocity.y; + + this.newVelocity.set(vx * delta, vy * delta); + + this.position.add(this.newVelocity); + + this.updateCenter(); + + this.angle = Math.atan2(vy, vx); + this.speed = Math.sqrt(vx * vx + vy * vy); + + // Now the update will throw collision checks at the Body + // And finally we'll integrate the new position back to the Sprite in postUpdate + + if (this.collideWorldBounds && this.checkWorldBounds() && this.onWorldBounds) + { + this.world.emit(Events.WORLD_BOUNDS, this, this.blocked.up, this.blocked.down, this.blocked.left, this.blocked.right); + } + } + + this._dx = this.position.x - this.prev.x; + this._dy = this.position.y - this.prev.y; + }, + + /** + * Feeds the Body results back into the parent Game Object. + * + * This method is called every game frame, regardless if the world steps or not. + * + * @method Phaser.Physics.Arcade.Body#postUpdate + * @since 3.0.0 + */ + postUpdate: function () + { + var dx = this.position.x - this.prev.x; + var dy = this.position.y - this.prev.y; + + if (this.moves) + { + var mx = this.deltaMax.x; + var my = this.deltaMax.y; + + if (mx !== 0 && dx !== 0) + { + if (dx < 0 && dx < -mx) + { + dx = -mx; + } + else if (dx > 0 && dx > mx) + { + dx = mx; + } + } + + if (my !== 0 && dy !== 0) + { + if (dy < 0 && dy < -my) + { + dy = -my; + } + else if (dy > 0 && dy > my) + { + dy = my; + } + } + + this.gameObject.x += dx; + this.gameObject.y += dy; + + this._reset = true; + } + + if (dx < 0) + { + this.facing = CONST.FACING_LEFT; + } + else if (dx > 0) + { + this.facing = CONST.FACING_RIGHT; + } + + if (dy < 0) + { + this.facing = CONST.FACING_UP; + } + else if (dy > 0) + { + this.facing = CONST.FACING_DOWN; + } + + this._dx = dx; + this._dy = dy; + + if (this.allowRotation) + { + this.gameObject.angle += this.deltaZ(); + } + + this.prev.x = this.position.x; + this.prev.y = this.position.y; + }, + + /** + * Checks for collisions between this Body and the world boundary and separates them. + * + * @method Phaser.Physics.Arcade.Body#checkWorldBounds + * @since 3.0.0 + * + * @return {boolean} True if this Body is colliding with the world boundary. + */ + checkWorldBounds: function () + { + var pos = this.position; + var bounds = this.world.bounds; + var check = this.world.checkCollision; + + var bx = (this.worldBounce) ? -this.worldBounce.x : -this.bounce.x; + var by = (this.worldBounce) ? -this.worldBounce.y : -this.bounce.y; + + if (pos.x < bounds.x && check.left) + { + pos.x = bounds.x; + this.velocity.x *= bx; + this.blocked.left = true; + this.blocked.none = false; + } + else if (this.right > bounds.right && check.right) + { + pos.x = bounds.right - this.width; + this.velocity.x *= bx; + this.blocked.right = true; + this.blocked.none = false; + } + + if (pos.y < bounds.y && check.up) + { + pos.y = bounds.y; + this.velocity.y *= by; + this.blocked.up = true; + this.blocked.none = false; + } + else if (this.bottom > bounds.bottom && check.down) + { + pos.y = bounds.bottom - this.height; + this.velocity.y *= by; + this.blocked.down = true; + this.blocked.none = false; + } + + return !this.blocked.none; + }, + + /** + * Sets the offset of the Body's position from its Game Object's position. + * + * @method Phaser.Physics.Arcade.Body#setOffset + * @since 3.0.0 + * + * @param {number} x - The horizontal offset, in source pixels. + * @param {number} [y=x] - The vertical offset, in source pixels. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setOffset: function (x, y) + { + if (y === undefined) { y = x; } + + this.offset.set(x, y); + + return this; + }, + + /** + * Sizes and positions this Body's boundary, as a rectangle. + * Modifies the Body `offset` if `center` is true (the default). + * Resets the width and height to match current frame, if no width and height provided and a frame is found. + * + * @method Phaser.Physics.Arcade.Body#setSize + * @since 3.0.0 + * + * @param {integer} [width] - The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param {integer} [height] - The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param {boolean} [center=true] - Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setSize: function (width, height, center) + { + if (center === undefined) { center = true; } + + var gameObject = this.gameObject; + + if (!width && gameObject.frame) + { + width = gameObject.frame.realWidth; + } + + if (!height && gameObject.frame) + { + height = gameObject.frame.realHeight; + } + + this.sourceWidth = width; + this.sourceHeight = height; + + this.width = this.sourceWidth * this._sx; + this.height = this.sourceHeight * this._sy; + + this.halfWidth = Math.floor(this.width / 2); + this.halfHeight = Math.floor(this.height / 2); + + this.updateCenter(); + + if (center && gameObject.getCenter) + { + var ox = gameObject.displayWidth / 2; + var oy = gameObject.displayHeight / 2; + + this.offset.set(ox - this.halfWidth, oy - this.halfHeight); + } + + this.isCircle = false; + this.radius = 0; + + return this; + }, + + /** + * Sizes and positions this Body's boundary, as a circle. + * + * @method Phaser.Physics.Arcade.Body#setCircle + * @since 3.0.0 + * + * @param {number} radius - The radius of the Body, in source pixels. + * @param {number} [offsetX] - The horizontal offset of the Body from its Game Object, in source pixels. + * @param {number} [offsetY] - The vertical offset of the Body from its Game Object, in source pixels. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setCircle: function (radius, offsetX, offsetY) + { + if (offsetX === undefined) { offsetX = this.offset.x; } + if (offsetY === undefined) { offsetY = this.offset.y; } + + if (radius > 0) + { + this.isCircle = true; + this.radius = radius; + + this.sourceWidth = radius * 2; + this.sourceHeight = radius * 2; + + this.width = this.sourceWidth * this._sx; + this.height = this.sourceHeight * this._sy; + + this.halfWidth = Math.floor(this.width / 2); + this.halfHeight = Math.floor(this.height / 2); + + this.offset.set(offsetX, offsetY); + + this.updateCenter(); + } + else + { + this.isCircle = false; + } + + return this; + }, + + /** + * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates. + * If the Body had any velocity or acceleration it is lost as a result of calling this. + * + * @method Phaser.Physics.Arcade.Body#reset + * @since 3.0.0 + * + * @param {number} x - The horizontal position to place the Game Object and Body. + * @param {number} y - The vertical position to place the Game Object and Body. + */ + reset: function (x, y) + { + this.stop(); + + var gameObject = this.gameObject; + + gameObject.setPosition(x, y); + + if (gameObject.getTopLeft) + { + gameObject.getTopLeft(this.position); + } + else + { + this.position.set(x, y); + } + + this.prev.copy(this.position); + + this.rotation = gameObject.angle; + this.preRotation = gameObject.angle; + + this.updateBounds(); + this.updateCenter(); + }, + + /** + * Sets acceleration, velocity, and speed to zero. + * + * @method Phaser.Physics.Arcade.Body#stop + * @since 3.0.0 + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + stop: function () + { + this.velocity.set(0); + this.acceleration.set(0); + this.speed = 0; + this.angularVelocity = 0; + this.angularAcceleration = 0; + + return this; + }, + + /** + * Copies the coordinates of this Body's edges into an object. + * + * @method Phaser.Physics.Arcade.Body#getBounds + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Arcade.ArcadeBodyBounds} obj - An object to copy the values into. + * + * @return {Phaser.Types.Physics.Arcade.ArcadeBodyBounds} - An object with {x, y, right, bottom}. + */ + getBounds: function (obj) + { + obj.x = this.x; + obj.y = this.y; + obj.right = this.right; + obj.bottom = this.bottom; + + return obj; + }, + + /** + * Tests if the coordinates are within this Body's boundary. + * + * @method Phaser.Physics.Arcade.Body#hitTest + * @since 3.0.0 + * + * @param {number} x - The horizontal coordinate. + * @param {number} y - The vertical coordinate. + * + * @return {boolean} True if (x, y) is within this Body. + */ + hitTest: function (x, y) + { + return (this.isCircle) ? CircleContains(this, x, y) : RectangleContains(this, x, y); + }, + + /** + * Whether this Body is touching a tile or the world boundary while moving down. + * + * @method Phaser.Physics.Arcade.Body#onFloor + * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#blocked + * + * @return {boolean} True if touching. + */ + onFloor: function () + { + return this.blocked.down; + }, + + /** + * Whether this Body is touching a tile or the world boundary while moving up. + * + * @method Phaser.Physics.Arcade.Body#onCeiling + * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#blocked + * + * @return {boolean} True if touching. + */ + onCeiling: function () + { + return this.blocked.up; + }, + + /** + * Whether this Body is touching a tile or the world boundary while moving left or right. + * + * @method Phaser.Physics.Arcade.Body#onWall + * @since 3.0.0 + * @see Phaser.Physics.Arcade.Body#blocked + * + * @return {boolean} True if touching. + */ + onWall: function () + { + return (this.blocked.left || this.blocked.right); + }, + + /** + * The absolute (non-negative) change in this Body's horizontal position from the previous step. + * + * @method Phaser.Physics.Arcade.Body#deltaAbsX + * @since 3.0.0 + * + * @return {number} The delta value. + */ + deltaAbsX: function () + { + return (this._dx > 0) ? this._dx : -this._dx; + }, + + /** + * The absolute (non-negative) change in this Body's vertical position from the previous step. + * + * @method Phaser.Physics.Arcade.Body#deltaAbsY + * @since 3.0.0 + * + * @return {number} The delta value. + */ + deltaAbsY: function () + { + return (this._dy > 0) ? this._dy : -this._dy; + }, + + /** + * The change in this Body's horizontal position from the previous step. + * This value is set during the Body's update phase. + * + * @method Phaser.Physics.Arcade.Body#deltaX + * @since 3.0.0 + * + * @return {number} The delta value. + */ + deltaX: function () + { + return this._dx; + }, + + /** + * The change in this Body's vertical position from the previous step. + * This value is set during the Body's update phase. + * + * @method Phaser.Physics.Arcade.Body#deltaY + * @since 3.0.0 + * + * @return {number} The delta value. + */ + deltaY: function () + { + return this._dy; + }, + + /** + * The change in this Body's rotation from the previous step, in degrees. + * + * @method Phaser.Physics.Arcade.Body#deltaZ + * @since 3.0.0 + * + * @return {number} The delta value. + */ + deltaZ: function () + { + return this.rotation - this.preRotation; + }, + + /** + * Disables this Body and marks it for deletion by the simulation. + * + * @method Phaser.Physics.Arcade.Body#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.enable = false; + + if (this.world) + { + this.world.pendingDestroy.set(this); + } + }, + + /** + * Draws this Body's boundary and velocity, if enabled. + * + * @method Phaser.Physics.Arcade.Body#drawDebug + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphic - The Graphics object to draw on. + */ + drawDebug: function (graphic) + { + var pos = this.position; + + var x = pos.x + this.halfWidth; + var y = pos.y + this.halfHeight; + + if (this.debugShowBody) + { + graphic.lineStyle(graphic.defaultStrokeWidth, this.debugBodyColor); + + if (this.isCircle) + { + graphic.strokeCircle(x, y, this.width / 2); + } + else + { + // Only draw the sides where checkCollision is true, similar to debugger in layer + if (this.checkCollision.up) + { + graphic.lineBetween(pos.x, pos.y, pos.x + this.width, pos.y); + } + + if (this.checkCollision.right) + { + graphic.lineBetween(pos.x + this.width, pos.y, pos.x + this.width, pos.y + this.height); + } + + if (this.checkCollision.down) + { + graphic.lineBetween(pos.x, pos.y + this.height, pos.x + this.width, pos.y + this.height); + } + + if (this.checkCollision.left) + { + graphic.lineBetween(pos.x, pos.y, pos.x, pos.y + this.height); + } + } + } + + if (this.debugShowVelocity) + { + graphic.lineStyle(graphic.defaultStrokeWidth, this.world.defaults.velocityDebugColor, 1); + graphic.lineBetween(x, y, x + this.velocity.x / 2, y + this.velocity.y / 2); + } + }, + + /** + * Whether this Body will be drawn to the debug display. + * + * @method Phaser.Physics.Arcade.Body#willDrawDebug + * @since 3.0.0 + * + * @return {boolean} True if either `debugShowBody` or `debugShowVelocity` are enabled. + */ + willDrawDebug: function () + { + return (this.debugShowBody || this.debugShowVelocity); + }, + + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Vec2 first. + * + * @method Phaser.Physics.Arcade.Body#setCollideWorldBounds + * @since 3.0.0 + * + * @param {boolean} [value=true] - `true` if this body should collide with the world bounds, otherwise `false`. + * @param {number} [bounceX] - If given this will be replace the `worldBounce.x` value. + * @param {number} [bounceY] - If given this will be replace the `worldBounce.y` value. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setCollideWorldBounds: function (value, bounceX, bounceY) + { + if (value === undefined) { value = true; } + + this.collideWorldBounds = value; + + var setBounceX = (bounceX !== undefined); + var setBounceY = (bounceY !== undefined); + + if (setBounceX || setBounceY) + { + if (!this.worldBounce) + { + this.worldBounce = new Vector2(); + } + + if (setBounceX) + { + this.worldBounce.x = bounceX; + } + + if (setBounceY) + { + this.worldBounce.y = bounceY; + } + } + + return this; + }, + + /** + * Sets the Body's velocity. + * + * @method Phaser.Physics.Arcade.Body#setVelocity + * @since 3.0.0 + * + * @param {number} x - The horizontal velocity, in pixels per second. + * @param {number} [y=x] - The vertical velocity, in pixels per second. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setVelocity: function (x, y) + { + this.velocity.set(x, y); + + x = this.velocity.x; + y = this.velocity.y; + + this.speed = Math.sqrt(x * x + y * y); + + return this; + }, + + /** + * Sets the Body's horizontal velocity. + * + * @method Phaser.Physics.Arcade.Body#setVelocityX + * @since 3.0.0 + * + * @param {number} value - The velocity, in pixels per second. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setVelocityX: function (value) + { + this.velocity.x = value; + + var x = value; + var y = this.velocity.y; + + this.speed = Math.sqrt(x * x + y * y); + + return this; + }, + + /** + * Sets the Body's vertical velocity. + * + * @method Phaser.Physics.Arcade.Body#setVelocityY + * @since 3.0.0 + * + * @param {number} value - The velocity, in pixels per second. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setVelocityY: function (value) + { + this.velocity.y = value; + + var x = this.velocity.x; + var y = value; + + this.speed = Math.sqrt(x * x + y * y); + + return this; + }, + + /** + * Sets the Body's maximum velocity. + * + * @method Phaser.Physics.Arcade.Body#setMaxVelocity + * @since 3.10.0 + * + * @param {number} x - The horizontal velocity, in pixels per second. + * @param {number} [y=x] - The vertical velocity, in pixels per second. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setMaxVelocity: function (x, y) + { + this.maxVelocity.set(x, y); + + return this; + }, + + /** + * Sets the maximum speed the Body can move. + * + * @method Phaser.Physics.Arcade.Body#setMaxSpeed + * @since 3.16.0 + * + * @param {number} value - The maximum speed value, in pixels per second. Set to a negative value to disable. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setMaxSpeed: function (value) + { + this.maxSpeed = value; + + return this; + }, + + /** + * Sets the Body's bounce. + * + * @method Phaser.Physics.Arcade.Body#setBounce + * @since 3.0.0 + * + * @param {number} x - The horizontal bounce, relative to 1. + * @param {number} y - The vertical bounce, relative to 1. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setBounce: function (x, y) + { + this.bounce.set(x, y); + + return this; + }, + + /** + * Sets the Body's horizontal bounce. + * + * @method Phaser.Physics.Arcade.Body#setBounceX + * @since 3.0.0 + * + * @param {number} value - The bounce, relative to 1. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setBounceX: function (value) + { + this.bounce.x = value; + + return this; + }, + + /** + * Sets the Body's vertical bounce. + * + * @method Phaser.Physics.Arcade.Body#setBounceY + * @since 3.0.0 + * + * @param {number} value - The bounce, relative to 1. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setBounceY: function (value) + { + this.bounce.y = value; + + return this; + }, + + /** + * Sets the Body's acceleration. + * + * @method Phaser.Physics.Arcade.Body#setAcceleration + * @since 3.0.0 + * + * @param {number} x - The horizontal component, in pixels per second squared. + * @param {number} y - The vertical component, in pixels per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setAcceleration: function (x, y) + { + this.acceleration.set(x, y); + + return this; + }, + + /** + * Sets the Body's horizontal acceleration. + * + * @method Phaser.Physics.Arcade.Body#setAccelerationX + * @since 3.0.0 + * + * @param {number} value - The acceleration, in pixels per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setAccelerationX: function (value) + { + this.acceleration.x = value; + + return this; + }, + + /** + * Sets the Body's vertical acceleration. + * + * @method Phaser.Physics.Arcade.Body#setAccelerationY + * @since 3.0.0 + * + * @param {number} value - The acceleration, in pixels per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setAccelerationY: function (value) + { + this.acceleration.y = value; + + return this; + }, + + /** + * Enables or disables drag. + * + * @method Phaser.Physics.Arcade.Body#setAllowDrag + * @since 3.9.0 + * @see Phaser.Physics.Arcade.Body#allowDrag + * + * @param {boolean} [value=true] - `true` to allow drag on this body, or `false` to disable it. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setAllowDrag: function (value) + { + if (value === undefined) { value = true; } + + this.allowDrag = value; + + return this; + }, + + /** + * Enables or disables gravity's effect on this Body. + * + * @method Phaser.Physics.Arcade.Body#setAllowGravity + * @since 3.9.0 + * @see Phaser.Physics.Arcade.Body#allowGravity + * + * @param {boolean} [value=true] - `true` to allow gravity on this body, or `false` to disable it. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setAllowGravity: function (value) + { + if (value === undefined) { value = true; } + + this.allowGravity = value; + + return this; + }, + + /** + * Enables or disables rotation. + * + * @method Phaser.Physics.Arcade.Body#setAllowRotation + * @since 3.9.0 + * @see Phaser.Physics.Arcade.Body#allowRotation + * + * @param {boolean} [value=true] - `true` to allow rotation on this body, or `false` to disable it. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setAllowRotation: function (value) + { + if (value === undefined) { value = true; } + + this.allowRotation = value; + + return this; + }, + + /** + * Sets the Body's drag. + * + * @method Phaser.Physics.Arcade.Body#setDrag + * @since 3.0.0 + * + * @param {number} x - The horizontal component, in pixels per second squared. + * @param {number} y - The vertical component, in pixels per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setDrag: function (x, y) + { + this.drag.set(x, y); + + return this; + }, + + /** + * Sets the Body's horizontal drag. + * + * @method Phaser.Physics.Arcade.Body#setDragX + * @since 3.0.0 + * + * @param {number} value - The drag, in pixels per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setDragX: function (value) + { + this.drag.x = value; + + return this; + }, + + /** + * Sets the Body's vertical drag. + * + * @method Phaser.Physics.Arcade.Body#setDragY + * @since 3.0.0 + * + * @param {number} value - The drag, in pixels per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setDragY: function (value) + { + this.drag.y = value; + + return this; + }, + + /** + * Sets the Body's gravity. + * + * @method Phaser.Physics.Arcade.Body#setGravity + * @since 3.0.0 + * + * @param {number} x - The horizontal component, in pixels per second squared. + * @param {number} y - The vertical component, in pixels per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setGravity: function (x, y) + { + this.gravity.set(x, y); + + return this; + }, + + /** + * Sets the Body's horizontal gravity. + * + * @method Phaser.Physics.Arcade.Body#setGravityX + * @since 3.0.0 + * + * @param {number} value - The gravity, in pixels per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setGravityX: function (value) + { + this.gravity.x = value; + + return this; + }, + + /** + * Sets the Body's vertical gravity. + * + * @method Phaser.Physics.Arcade.Body#setGravityY + * @since 3.0.0 + * + * @param {number} value - The gravity, in pixels per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setGravityY: function (value) + { + this.gravity.y = value; + + return this; + }, + + /** + * Sets the Body's friction. + * + * @method Phaser.Physics.Arcade.Body#setFriction + * @since 3.0.0 + * + * @param {number} x - The horizontal component, relative to 1. + * @param {number} y - The vertical component, relative to 1. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setFriction: function (x, y) + { + this.friction.set(x, y); + + return this; + }, + + /** + * Sets the Body's horizontal friction. + * + * @method Phaser.Physics.Arcade.Body#setFrictionX + * @since 3.0.0 + * + * @param {number} value - The friction value, relative to 1. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setFrictionX: function (value) + { + this.friction.x = value; + + return this; + }, + + /** + * Sets the Body's vertical friction. + * + * @method Phaser.Physics.Arcade.Body#setFrictionY + * @since 3.0.0 + * + * @param {number} value - The friction value, relative to 1. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setFrictionY: function (value) + { + this.friction.y = value; + + return this; + }, + + /** + * Sets the Body's angular velocity. + * + * @method Phaser.Physics.Arcade.Body#setAngularVelocity + * @since 3.0.0 + * + * @param {number} value - The velocity, in degrees per second. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setAngularVelocity: function (value) + { + this.angularVelocity = value; + + return this; + }, + + /** + * Sets the Body's angular acceleration. + * + * @method Phaser.Physics.Arcade.Body#setAngularAcceleration + * @since 3.0.0 + * + * @param {number} value - The acceleration, in degrees per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setAngularAcceleration: function (value) + { + this.angularAcceleration = value; + + return this; + }, + + /** + * Sets the Body's angular drag. + * + * @method Phaser.Physics.Arcade.Body#setAngularDrag + * @since 3.0.0 + * + * @param {number} value - The drag, in degrees per second squared. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setAngularDrag: function (value) + { + this.angularDrag = value; + + return this; + }, + + /** + * Sets the Body's mass. + * + * @method Phaser.Physics.Arcade.Body#setMass + * @since 3.0.0 + * + * @param {number} value - The mass value, relative to 1. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setMass: function (value) + { + this.mass = value; + + return this; + }, + + /** + * Sets the Body's `immovable` property. + * + * @method Phaser.Physics.Arcade.Body#setImmovable + * @since 3.0.0 + * + * @param {boolean} [value=true] - The value to assign to `immovable`. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setImmovable: function (value) + { + if (value === undefined) { value = true; } + + this.immovable = value; + + return this; + }, + + /** + * Sets the Body's `enable` property. + * + * @method Phaser.Physics.Arcade.Body#setEnable + * @since 3.15.0 + * + * @param {boolean} [value=true] - The value to assign to `enable`. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setEnable: function (value) + { + if (value === undefined) { value = true; } + + this.enable = value; + + return this; + }, + + /** + * The Body's horizontal position (left edge). + * + * @name Phaser.Physics.Arcade.Body#x + * @type {number} + * @since 3.0.0 + */ + x: { + + get: function () + { + return this.position.x; + }, + + set: function (value) + { + this.position.x = value; + } + + }, + + /** + * The Body's vertical position (top edge). + * + * @name Phaser.Physics.Arcade.Body#y + * @type {number} + * @since 3.0.0 + */ + y: { + + get: function () + { + return this.position.y; + }, + + set: function (value) + { + this.position.y = value; + } + + }, + + /** + * The left edge of the Body's boundary. Identical to x. + * + * @name Phaser.Physics.Arcade.Body#left + * @type {number} + * @readonly + * @since 3.0.0 + */ + left: { + + get: function () + { + return this.position.x; + } + + }, + + /** + * The right edge of the Body's boundary. + * + * @name Phaser.Physics.Arcade.Body#right + * @type {number} + * @readonly + * @since 3.0.0 + */ + right: { + + get: function () + { + return this.position.x + this.width; + } + + }, + + /** + * The top edge of the Body's boundary. Identical to y. + * + * @name Phaser.Physics.Arcade.Body#top + * @type {number} + * @readonly + * @since 3.0.0 + */ + top: { + + get: function () + { + return this.position.y; + } + + }, + + /** + * The bottom edge of this Body's boundary. + * + * @name Phaser.Physics.Arcade.Body#bottom + * @type {number} + * @readonly + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return this.position.y + this.height; + } + + } + +}); + +module.exports = Body; + + +/***/ }), +/* 439 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * An Arcade Physics Collider will automatically check for collision, or overlaps, between two objects + * every step. If a collision, or overlap, occurs it will invoke the given callbacks. + * + * @class Collider + * @memberof Phaser.Physics.Arcade + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.World} world - The Arcade physics World that will manage the collisions. + * @param {boolean} overlapOnly - Whether to check for collisions or overlap. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object to check for collision. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object2 - The second object to check for collision. + * @param {ArcadePhysicsCallback} collideCallback - The callback to invoke when the two objects collide. + * @param {ArcadePhysicsCallback} processCallback - The callback to invoke when the two objects collide. Must return a boolean. + * @param {any} callbackContext - The scope in which to call the callbacks. + */ +var Collider = new Class({ + + initialize: + + function Collider (world, overlapOnly, object1, object2, collideCallback, processCallback, callbackContext) + { + /** + * The world in which the bodies will collide. + * + * @name Phaser.Physics.Arcade.Collider#world + * @type {Phaser.Physics.Arcade.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * The name of the collider (unused by Phaser). + * + * @name Phaser.Physics.Arcade.Collider#name + * @type {string} + * @since 3.1.0 + */ + this.name = ''; + + /** + * Whether the collider is active. + * + * @name Phaser.Physics.Arcade.Collider#active + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.active = true; + + /** + * Whether to check for collisions or overlaps. + * + * @name Phaser.Physics.Arcade.Collider#overlapOnly + * @type {boolean} + * @since 3.0.0 + */ + this.overlapOnly = overlapOnly; + + /** + * The first object to check for collision. + * + * @name Phaser.Physics.Arcade.Collider#object1 + * @type {Phaser.Types.Physics.Arcade.ArcadeColliderType} + * @since 3.0.0 + */ + this.object1 = object1; + + /** + * The second object to check for collision. + * + * @name Phaser.Physics.Arcade.Collider#object2 + * @type {Phaser.Types.Physics.Arcade.ArcadeColliderType} + * @since 3.0.0 + */ + this.object2 = object2; + + /** + * The callback to invoke when the two objects collide. + * + * @name Phaser.Physics.Arcade.Collider#collideCallback + * @type {ArcadePhysicsCallback} + * @since 3.0.0 + */ + this.collideCallback = collideCallback; + + /** + * If a processCallback exists it must return true or collision checking will be skipped. + * + * @name Phaser.Physics.Arcade.Collider#processCallback + * @type {ArcadePhysicsCallback} + * @since 3.0.0 + */ + this.processCallback = processCallback; + + /** + * The context the collideCallback and processCallback will run in. + * + * @name Phaser.Physics.Arcade.Collider#callbackContext + * @type {object} + * @since 3.0.0 + */ + this.callbackContext = callbackContext; + }, + + /** + * A name for the Collider. + * + * Phaser does not use this value, it's for your own reference. + * + * @method Phaser.Physics.Arcade.Collider#setName + * @since 3.1.0 + * + * @param {string} name - The name to assign to the Collider. + * + * @return {Phaser.Physics.Arcade.Collider} This Collider instance. + */ + setName: function (name) + { + this.name = name; + + return this; + }, + + /** + * Called by World as part of its step processing, initial operation of collision checking. + * + * @method Phaser.Physics.Arcade.Collider#update + * @since 3.0.0 + */ + update: function () + { + this.world.collideObjects( + this.object1, + this.object2, + this.collideCallback, + this.processCallback, + this.callbackContext, + this.overlapOnly + ); + }, + + /** + * Removes Collider from World and disposes of its resources. + * + * @method Phaser.Physics.Arcade.Collider#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.world.removeCollider(this); + + this.active = false; + + this.world = null; + + this.object1 = null; + this.object2 = null; + + this.collideCallback = null; + this.processCallback = null; + this.callbackContext = null; + } + +}); + +module.exports = Collider; + + +/***/ }), +/* 440 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(50); + +/** + * Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties + * accordingly, including: `touching.left`, `touching.right`, `touching.none` and `overlapX'. + * + * @function Phaser.Physics.Arcade.GetOverlapX + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to separate. + * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to separate. + * @param {boolean} overlapOnly - Is this an overlap only check, or part of separation? + * @param {number} bias - A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding). + * + * @return {number} The amount of overlap. + */ +var GetOverlapX = function (body1, body2, overlapOnly, bias) +{ + var overlap = 0; + var maxOverlap = body1.deltaAbsX() + body2.deltaAbsX() + bias; + + if (body1._dx === 0 && body2._dx === 0) + { + // They overlap but neither of them are moving + body1.embedded = true; + body2.embedded = true; + } + else if (body1._dx > body2._dx) + { + // Body1 is moving right and / or Body2 is moving left + overlap = body1.right - body2.x; + + if ((overlap > maxOverlap && !overlapOnly) || body1.checkCollision.right === false || body2.checkCollision.left === false) + { + overlap = 0; + } + else + { + body1.touching.none = false; + body1.touching.right = true; + + body2.touching.none = false; + body2.touching.left = true; + + if (body2.physicsType === CONST.STATIC_BODY) + { + body1.blocked.none = false; + body1.blocked.right = true; + } + + if (body1.physicsType === CONST.STATIC_BODY) + { + body2.blocked.none = false; + body2.blocked.left = true; + } + } + } + else if (body1._dx < body2._dx) + { + // Body1 is moving left and/or Body2 is moving right + overlap = body1.x - body2.width - body2.x; + + if ((-overlap > maxOverlap && !overlapOnly) || body1.checkCollision.left === false || body2.checkCollision.right === false) + { + overlap = 0; + } + else + { + body1.touching.none = false; + body1.touching.left = true; + + body2.touching.none = false; + body2.touching.right = true; + + if (body2.physicsType === CONST.STATIC_BODY) + { + body1.blocked.none = false; + body1.blocked.left = true; + } + + if (body1.physicsType === CONST.STATIC_BODY) + { + body2.blocked.none = false; + body2.blocked.right = true; + } + } + } + + // Resets the overlapX to zero if there is no overlap, or to the actual pixel value if there is + body1.overlapX = overlap; + body2.overlapX = overlap; + + return overlap; +}; + +module.exports = GetOverlapX; + + +/***/ }), +/* 441 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(50); + +/** + * Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties + * accordingly, including: `touching.up`, `touching.down`, `touching.none` and `overlapY'. + * + * @function Phaser.Physics.Arcade.GetOverlapY + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to separate. + * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to separate. + * @param {boolean} overlapOnly - Is this an overlap only check, or part of separation? + * @param {number} bias - A value added to the delta values during collision checks. Increase it to prevent sprite tunneling(sprites passing through another instead of colliding). + * + * @return {number} The amount of overlap. + */ +var GetOverlapY = function (body1, body2, overlapOnly, bias) +{ + var overlap = 0; + var maxOverlap = body1.deltaAbsY() + body2.deltaAbsY() + bias; + + if (body1._dy === 0 && body2._dy === 0) + { + // They overlap but neither of them are moving + body1.embedded = true; + body2.embedded = true; + } + else if (body1._dy > body2._dy) + { + // Body1 is moving down and/or Body2 is moving up + overlap = body1.bottom - body2.y; + + if ((overlap > maxOverlap && !overlapOnly) || body1.checkCollision.down === false || body2.checkCollision.up === false) + { + overlap = 0; + } + else + { + body1.touching.none = false; + body1.touching.down = true; + + body2.touching.none = false; + body2.touching.up = true; + + if (body2.physicsType === CONST.STATIC_BODY) + { + body1.blocked.none = false; + body1.blocked.down = true; + } + + if (body1.physicsType === CONST.STATIC_BODY) + { + body2.blocked.none = false; + body2.blocked.up = true; + } + } + } + else if (body1._dy < body2._dy) + { + // Body1 is moving up and/or Body2 is moving down + overlap = body1.y - body2.bottom; + + if ((-overlap > maxOverlap && !overlapOnly) || body1.checkCollision.up === false || body2.checkCollision.down === false) + { + overlap = 0; + } + else + { + body1.touching.none = false; + body1.touching.up = true; + + body2.touching.none = false; + body2.touching.down = true; + + if (body2.physicsType === CONST.STATIC_BODY) + { + body1.blocked.none = false; + body1.blocked.up = true; + } + + if (body1.physicsType === CONST.STATIC_BODY) + { + body2.blocked.none = false; + body2.blocked.down = true; + } + } + } + + // Resets the overlapY to zero if there is no overlap, or to the actual pixel value if there is + body1.overlapY = overlap; + body2.overlapY = overlap; + + return overlap; +}; + +module.exports = GetOverlapY; + + +/***/ }), +/* 442 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A Process Queue maintains three internal lists. + * + * The `pending` list is a selection of items which are due to be made 'active' in the next update. + * The `active` list is a selection of items which are considered active and should be updated. + * The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update. + * + * When new items are added to a Process Queue they are put in the pending list, rather than being added + * immediately the active list. Equally, items that are removed are put into the destroy list, rather than + * being destroyed immediately. This allows the Process Queue to carefully process each item at a specific, fixed + * time, rather than at the time of the request from the API. + * + * @class ProcessQueue + * @memberof Phaser.Structs + * @constructor + * @since 3.0.0 + * + * @generic T + */ +var ProcessQueue = new Class({ + + initialize: + + function ProcessQueue () + { + /** + * The `pending` list is a selection of items which are due to be made 'active' in the next update. + * + * @genericUse {T[]} - [$type] + * + * @name Phaser.Structs.ProcessQueue#_pending + * @type {Array.<*>} + * @private + * @default [] + * @since 3.0.0 + */ + this._pending = []; + + /** + * The `active` list is a selection of items which are considered active and should be updated. + * + * @genericUse {T[]} - [$type] + * + * @name Phaser.Structs.ProcessQueue#_active + * @type {Array.<*>} + * @private + * @default [] + * @since 3.0.0 + */ + this._active = []; + + /** + * The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update. + * + * @genericUse {T[]} - [$type] + * + * @name Phaser.Structs.ProcessQueue#_destroy + * @type {Array.<*>} + * @private + * @default [] + * @since 3.0.0 + */ + this._destroy = []; + + /** + * The total number of items awaiting processing. + * + * @name Phaser.Structs.ProcessQueue#_toProcess + * @type {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + this._toProcess = 0; + }, + + /** + * Adds a new item to the Process Queue. + * The item is added to the pending list and made active in the next update. + * + * @method Phaser.Structs.ProcessQueue#add + * @since 3.0.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to add to the queue. + * + * @return {Phaser.Structs.ProcessQueue} This Process Queue object. + */ + add: function (item) + { + this._pending.push(item); + + this._toProcess++; + + return this; + }, + + /** + * Removes an item from the Process Queue. + * The item is added to the pending destroy and fully removed in the next update. + * + * @method Phaser.Structs.ProcessQueue#remove + * @since 3.0.0 + * + * @genericUse {T} - [item] + * @genericUse {Phaser.Structs.ProcessQueue.} - [$return] + * + * @param {*} item - The item to be removed from the queue. + * + * @return {Phaser.Structs.ProcessQueue} This Process Queue object. + */ + remove: function (item) + { + this._destroy.push(item); + + this._toProcess++; + + return this; + }, + + /** + * Update this queue. First it will process any items awaiting destruction, and remove them. + * + * Then it will check to see if there are any items pending insertion, and move them to an + * active state. Finally, it will return a list of active items for further processing. + * + * @method Phaser.Structs.ProcessQueue#update + * @since 3.0.0 + * + * @genericUse {T[]} - [$return] + * + * @return {Array.<*>} A list of active items. + */ + update: function () + { + if (this._toProcess === 0) + { + // Quick bail + return this._active; + } + + var list = this._destroy; + var active = this._active; + var i; + var item; + + // Clear the 'destroy' list + for (i = 0; i < list.length; i++) + { + item = list[i]; + + // Remove from the 'active' array + var idx = active.indexOf(item); + + if (idx !== -1) + { + active.splice(idx, 1); + } + } + + list.length = 0; + + // Process the pending addition list + // This stops callbacks and out of sync events from populating the active array mid-way during an update + + list = this._pending; + + for (i = 0; i < list.length; i++) + { + item = list[i]; + + this._active.push(item); + } + + list.length = 0; + + this._toProcess = 0; + + // The owner of this queue can now safely do whatever it needs to with the active list + return this._active; + }, + + /** + * Returns the current list of active items. + * + * @method Phaser.Structs.ProcessQueue#getActive + * @since 3.0.0 + * + * @genericUse {T[]} - [$return] + * + * @return {Array.<*>} A list of active items. + */ + getActive: function () + { + return this._active; + }, + + /** + * Immediately destroys this process queue, clearing all of its internal arrays and resetting the process totals. + * + * @method Phaser.Structs.ProcessQueue#destroy + * @since 3.0.0 + */ + destroy: function () + { + this._toProcess = 0; + + this._pending = []; + this._active = []; + this._destroy = []; + } + +}); + +module.exports = ProcessQueue; + + +/***/ }), +/* 443 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Vladimir Agafonkin + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var quickselect = __webpack_require__(361); + +/** + * @classdesc + * RBush is a high-performance JavaScript library for 2D spatial indexing of points and rectangles. + * It's based on an optimized R-tree data structure with bulk insertion support. + * + * Spatial index is a special data structure for points and rectangles that allows you to perform queries like + * "all items within this bounding box" very efficiently (e.g. hundreds of times faster than looping over all items). + * + * This version of RBush uses a fixed min/max accessor structure of `[ '.left', '.top', '.right', '.bottom' ]`. + * This is to avoid the eval like function creation that the original library used, which caused CSP policy violations. + * + * rbush is forked from https://github.com/mourner/rbush by Vladimir Agafonkin + * + * @class RTree + * @memberof Phaser.Structs + * @constructor + * @since 3.0.0 + */ + +function rbush (maxEntries) +{ + var format = [ '.left', '.top', '.right', '.bottom' ]; + + if (!(this instanceof rbush)) return new rbush(maxEntries, format); + + // max entries in a node is 9 by default; min node fill is 40% for best performance + this._maxEntries = Math.max(4, maxEntries || 9); + this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)); + + this.clear(); +} + +rbush.prototype = { + + all: function () + { + return this._all(this.data, []); + }, + + search: function (bbox) + { + var node = this.data, + result = [], + toBBox = this.toBBox; + + if (!intersects(bbox, node)) return result; + + var nodesToSearch = [], + i, len, child, childBBox; + + while (node) { + for (i = 0, len = node.children.length; i < len; i++) { + + child = node.children[i]; + childBBox = node.leaf ? toBBox(child) : child; + + if (intersects(bbox, childBBox)) { + if (node.leaf) result.push(child); + else if (contains(bbox, childBBox)) this._all(child, result); + else nodesToSearch.push(child); + } + } + node = nodesToSearch.pop(); + } + + return result; + }, + + collides: function (bbox) + { + var node = this.data, + toBBox = this.toBBox; + + if (!intersects(bbox, node)) return false; + + var nodesToSearch = [], + i, len, child, childBBox; + + while (node) { + for (i = 0, len = node.children.length; i < len; i++) { + + child = node.children[i]; + childBBox = node.leaf ? toBBox(child) : child; + + if (intersects(bbox, childBBox)) { + if (node.leaf || contains(bbox, childBBox)) return true; + nodesToSearch.push(child); + } + } + node = nodesToSearch.pop(); + } + + return false; + }, + + load: function (data) + { + if (!(data && data.length)) return this; + + if (data.length < this._minEntries) { + for (var i = 0, len = data.length; i < len; i++) { + this.insert(data[i]); + } + return this; + } + + // recursively build the tree with the given data from scratch using OMT algorithm + var node = this._build(data.slice(), 0, data.length - 1, 0); + + if (!this.data.children.length) { + // save as is if tree is empty + this.data = node; + + } else if (this.data.height === node.height) { + // split root if trees have the same height + this._splitRoot(this.data, node); + + } else { + if (this.data.height < node.height) { + // swap trees if inserted one is bigger + var tmpNode = this.data; + this.data = node; + node = tmpNode; + } + + // insert the small tree into the large tree at appropriate level + this._insert(node, this.data.height - node.height - 1, true); + } + + return this; + }, + + insert: function (item) + { + if (item) this._insert(item, this.data.height - 1); + return this; + }, + + clear: function () + { + this.data = createNode([]); + return this; + }, + + remove: function (item, equalsFn) + { + if (!item) return this; + + var node = this.data, + bbox = this.toBBox(item), + path = [], + indexes = [], + i, parent, index, goingUp; + + // depth-first iterative tree traversal + while (node || path.length) { + + if (!node) { // go up + node = path.pop(); + parent = path[path.length - 1]; + i = indexes.pop(); + goingUp = true; + } + + if (node.leaf) { // check current node + index = findItem(item, node.children, equalsFn); + + if (index !== -1) { + // item found, remove the item and condense tree upwards + node.children.splice(index, 1); + path.push(node); + this._condense(path); + return this; + } + } + + if (!goingUp && !node.leaf && contains(node, bbox)) { // go down + path.push(node); + indexes.push(i); + i = 0; + parent = node; + node = node.children[0]; + + } else if (parent) { // go right + i++; + node = parent.children[i]; + goingUp = false; + + } else node = null; // nothing found + } + + return this; + }, + + toBBox: function (item) { return item; }, + + compareMinX: compareNodeMinX, + compareMinY: compareNodeMinY, + + toJSON: function () { return this.data; }, + + fromJSON: function (data) + { + this.data = data; + return this; + }, + + _all: function (node, result) + { + var nodesToSearch = []; + while (node) { + if (node.leaf) result.push.apply(result, node.children); + else nodesToSearch.push.apply(nodesToSearch, node.children); + + node = nodesToSearch.pop(); + } + return result; + }, + + _build: function (items, left, right, height) + { + var N = right - left + 1, + M = this._maxEntries, + node; + + if (N <= M) { + // reached leaf level; return leaf + node = createNode(items.slice(left, right + 1)); + calcBBox(node, this.toBBox); + return node; + } + + if (!height) { + // target height of the bulk-loaded tree + height = Math.ceil(Math.log(N) / Math.log(M)); + + // target number of root entries to maximize storage utilization + M = Math.ceil(N / Math.pow(M, height - 1)); + } + + node = createNode([]); + node.leaf = false; + node.height = height; + + // split the items into M mostly square tiles + + var N2 = Math.ceil(N / M), + N1 = N2 * Math.ceil(Math.sqrt(M)), + i, j, right2, right3; + + multiSelect(items, left, right, N1, this.compareMinX); + + for (i = left; i <= right; i += N1) { + + right2 = Math.min(i + N1 - 1, right); + + multiSelect(items, i, right2, N2, this.compareMinY); + + for (j = i; j <= right2; j += N2) { + + right3 = Math.min(j + N2 - 1, right2); + + // pack each entry recursively + node.children.push(this._build(items, j, right3, height - 1)); + } + } + + calcBBox(node, this.toBBox); + + return node; + }, + + _chooseSubtree: function (bbox, node, level, path) + { + var i, len, child, targetNode, area, enlargement, minArea, minEnlargement; + + while (true) { + path.push(node); + + if (node.leaf || path.length - 1 === level) break; + + minArea = minEnlargement = Infinity; + + for (i = 0, len = node.children.length; i < len; i++) { + child = node.children[i]; + area = bboxArea(child); + enlargement = enlargedArea(bbox, child) - area; + + // choose entry with the least area enlargement + if (enlargement < minEnlargement) { + minEnlargement = enlargement; + minArea = area < minArea ? area : minArea; + targetNode = child; + + } else if (enlargement === minEnlargement) { + // otherwise choose one with the smallest area + if (area < minArea) { + minArea = area; + targetNode = child; + } + } + } + + node = targetNode || node.children[0]; + } + + return node; + }, + + _insert: function (item, level, isNode) + { + var toBBox = this.toBBox, + bbox = isNode ? item : toBBox(item), + insertPath = []; + + // find the best node for accommodating the item, saving all nodes along the path too + var node = this._chooseSubtree(bbox, this.data, level, insertPath); + + // put the item into the node + node.children.push(item); + extend(node, bbox); + + // split on node overflow; propagate upwards if necessary + while (level >= 0) { + if (insertPath[level].children.length > this._maxEntries) { + this._split(insertPath, level); + level--; + } else break; + } + + // adjust bboxes along the insertion path + this._adjustParentBBoxes(bbox, insertPath, level); + }, + + // split overflowed node into two + _split: function (insertPath, level) + { + var node = insertPath[level], + M = node.children.length, + m = this._minEntries; + + this._chooseSplitAxis(node, m, M); + + var splitIndex = this._chooseSplitIndex(node, m, M); + + var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex)); + newNode.height = node.height; + newNode.leaf = node.leaf; + + calcBBox(node, this.toBBox); + calcBBox(newNode, this.toBBox); + + if (level) insertPath[level - 1].children.push(newNode); + else this._splitRoot(node, newNode); + }, + + _splitRoot: function (node, newNode) + { + // split root node + this.data = createNode([node, newNode]); + this.data.height = node.height + 1; + this.data.leaf = false; + calcBBox(this.data, this.toBBox); + }, + + _chooseSplitIndex: function (node, m, M) + { + var i, bbox1, bbox2, overlap, area, minOverlap, minArea, index; + + minOverlap = minArea = Infinity; + + for (i = m; i <= M - m; i++) { + bbox1 = distBBox(node, 0, i, this.toBBox); + bbox2 = distBBox(node, i, M, this.toBBox); + + overlap = intersectionArea(bbox1, bbox2); + area = bboxArea(bbox1) + bboxArea(bbox2); + + // choose distribution with minimum overlap + if (overlap < minOverlap) { + minOverlap = overlap; + index = i; + + minArea = area < minArea ? area : minArea; + + } else if (overlap === minOverlap) { + // otherwise choose distribution with minimum area + if (area < minArea) { + minArea = area; + index = i; + } + } + } + + return index; + }, + + // sorts node children by the best axis for split + _chooseSplitAxis: function (node, m, M) + { + var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX, + compareMinY = node.leaf ? this.compareMinY : compareNodeMinY, + xMargin = this._allDistMargin(node, m, M, compareMinX), + yMargin = this._allDistMargin(node, m, M, compareMinY); + + // if total distributions margin value is minimal for x, sort by minX, + // otherwise it's already sorted by minY + if (xMargin < yMargin) node.children.sort(compareMinX); + }, + + // total margin of all possible split distributions where each node is at least m full + _allDistMargin: function (node, m, M, compare) + { + node.children.sort(compare); + + var toBBox = this.toBBox, + leftBBox = distBBox(node, 0, m, toBBox), + rightBBox = distBBox(node, M - m, M, toBBox), + margin = bboxMargin(leftBBox) + bboxMargin(rightBBox), + i, child; + + for (i = m; i < M - m; i++) { + child = node.children[i]; + extend(leftBBox, node.leaf ? toBBox(child) : child); + margin += bboxMargin(leftBBox); + } + + for (i = M - m - 1; i >= m; i--) { + child = node.children[i]; + extend(rightBBox, node.leaf ? toBBox(child) : child); + margin += bboxMargin(rightBBox); + } + + return margin; + }, + + _adjustParentBBoxes: function (bbox, path, level) + { + // adjust bboxes along the given tree path + for (var i = level; i >= 0; i--) { + extend(path[i], bbox); + } + }, + + _condense: function (path) + { + // go through the path, removing empty nodes and updating bboxes + for (var i = path.length - 1, siblings; i >= 0; i--) { + if (path[i].children.length === 0) { + if (i > 0) { + siblings = path[i - 1].children; + siblings.splice(siblings.indexOf(path[i]), 1); + + } else this.clear(); + + } else calcBBox(path[i], this.toBBox); + } + }, + + compareMinX: function (a, b) + { + return a.left - b.left; + }, + + compareMinY: function (a, b) + { + return a.top - b.top; + }, + + toBBox: function (a) + { + return { + minX: a.left, + minY: a.top, + maxX: a.right, + maxY: a.bottom + }; + } +}; + +function findItem (item, items, equalsFn) +{ + if (!equalsFn) return items.indexOf(item); + + for (var i = 0; i < items.length; i++) { + if (equalsFn(item, items[i])) return i; + } + return -1; +} + +// calculate node's bbox from bboxes of its children +function calcBBox (node, toBBox) +{ + distBBox(node, 0, node.children.length, toBBox, node); +} + +// min bounding rectangle of node children from k to p-1 +function distBBox (node, k, p, toBBox, destNode) +{ + if (!destNode) destNode = createNode(null); + destNode.minX = Infinity; + destNode.minY = Infinity; + destNode.maxX = -Infinity; + destNode.maxY = -Infinity; + + for (var i = k, child; i < p; i++) { + child = node.children[i]; + extend(destNode, node.leaf ? toBBox(child) : child); + } + + return destNode; +} + +function extend (a, b) +{ + a.minX = Math.min(a.minX, b.minX); + a.minY = Math.min(a.minY, b.minY); + a.maxX = Math.max(a.maxX, b.maxX); + a.maxY = Math.max(a.maxY, b.maxY); + return a; +} + +function compareNodeMinX (a, b) { return a.minX - b.minX; } +function compareNodeMinY (a, b) { return a.minY - b.minY; } + +function bboxArea (a) { return (a.maxX - a.minX) * (a.maxY - a.minY); } +function bboxMargin (a) { return (a.maxX - a.minX) + (a.maxY - a.minY); } + +function enlargedArea (a, b) +{ + return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) * + (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY)); +} + +function intersectionArea (a, b) +{ + var minX = Math.max(a.minX, b.minX), + minY = Math.max(a.minY, b.minY), + maxX = Math.min(a.maxX, b.maxX), + maxY = Math.min(a.maxY, b.maxY); + + return Math.max(0, maxX - minX) * + Math.max(0, maxY - minY); +} + +function contains (a, b) +{ + return a.minX <= b.minX && + a.minY <= b.minY && + b.maxX <= a.maxX && + b.maxY <= a.maxY; +} + +function intersects (a, b) +{ + return b.minX <= a.maxX && + b.minY <= a.maxY && + b.maxX >= a.minX && + b.maxY >= a.minY; +} + +function createNode (children) +{ + return { + children: children, + height: 1, + leaf: true, + minX: Infinity, + minY: Infinity, + maxX: -Infinity, + maxY: -Infinity + }; +} + +// sort an array so that items come in groups of n unsorted items, with groups sorted between each other; +// combines selection algorithm with binary divide & conquer approach + +function multiSelect (arr, left, right, n, compare) +{ + var stack = [left, right], + mid; + + while (stack.length) + { + right = stack.pop(); + left = stack.pop(); + + if (right - left <= n) continue; + + mid = left + Math.ceil((right - left) / n / 2) * n; + quickselect(arr, mid, left, right, compare); + + stack.push(left, mid, mid, right); + } +} + +module.exports = rbush; + +/***/ }), +/* 444 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks for intersection between the given tile rectangle-like object and an Arcade Physics body. + * + * @function Phaser.Physics.Arcade.Tilemap.TileIntersectsBody + * @since 3.0.0 + * + * @param {{ left: number, right: number, top: number, bottom: number }} tileWorldRect - A rectangle object that defines the tile placement in the world. + * @param {Phaser.Physics.Arcade.Body} body - The body to check for intersection against. + * + * @return {boolean} Returns `true` of the tile intersects with the body, otherwise `false`. + */ +var TileIntersectsBody = function (tileWorldRect, body) +{ + // Currently, all bodies are treated as rectangles when colliding with a Tile. + + return !( + body.right <= tileWorldRect.left || + body.bottom <= tileWorldRect.top || + body.position.x >= tileWorldRect.right || + body.position.y >= tileWorldRect.bottom + ); +}; + +module.exports = TileIntersectsBody; + + +/***/ }), +/* 445 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CircleContains = __webpack_require__(46); +var Class = __webpack_require__(0); +var CONST = __webpack_require__(50); +var RectangleContains = __webpack_require__(47); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Static Arcade Physics Body. + * + * A Static Body never moves, and isn't automatically synchronized with its parent Game Object. + * That means if you make any change to the parent's origin, position, or scale after creating or adding the body, you'll need to update the Body manually. + * + * A Static Body can collide with other Bodies, but is never moved by collisions. + * + * Its dynamic counterpart is {@link Phaser.Physics.Arcade.Body}. + * + * @class StaticBody + * @memberof Phaser.Physics.Arcade + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.World} world - The Arcade Physics simulation this Static Body belongs to. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object this Static Body belongs to. + */ +var StaticBody = new Class({ + + initialize: + + function StaticBody (world, gameObject) + { + var width = (gameObject.width) ? gameObject.width : 64; + var height = (gameObject.height) ? gameObject.height : 64; + + /** + * The Arcade Physics simulation this Static Body belongs to. + * + * @name Phaser.Physics.Arcade.StaticBody#world + * @type {Phaser.Physics.Arcade.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * The Game Object this Static Body belongs to. + * + * @name Phaser.Physics.Arcade.StaticBody#gameObject + * @type {Phaser.GameObjects.GameObject} + * @since 3.0.0 + */ + this.gameObject = gameObject; + + /** + * Whether the Static Body's boundary is drawn to the debug display. + * + * @name Phaser.Physics.Arcade.StaticBody#debugShowBody + * @type {boolean} + * @since 3.0.0 + */ + this.debugShowBody = world.defaults.debugShowStaticBody; + + /** + * The color of this Static Body on the debug display. + * + * @name Phaser.Physics.Arcade.StaticBody#debugBodyColor + * @type {integer} + * @since 3.0.0 + */ + this.debugBodyColor = world.defaults.staticBodyDebugColor; + + /** + * Whether this Static Body is updated by the physics simulation. + * + * @name Phaser.Physics.Arcade.StaticBody#enable + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.enable = true; + + /** + * Whether this Static Body's boundary is circular (`true`) or rectangular (`false`). + * + * @name Phaser.Physics.Arcade.StaticBody#isCircle + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.isCircle = false; + + /** + * If this Static Body is circular, this is the unscaled radius of the Static Body's boundary, as set by {@link #setCircle}, in source pixels. + * The true radius is equal to `halfWidth`. + * + * @name Phaser.Physics.Arcade.StaticBody#radius + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.radius = 0; + + /** + * The offset of this Static Body's actual position from any updated position. + * + * Unlike a dynamic Body, a Static Body does not follow its Game Object. As such, this offset is only applied when resizing the Static Body. + * + * @name Phaser.Physics.Arcade.StaticBody#offset + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.offset = new Vector2(); + + /** + * The position of this Static Body within the simulation. + * + * @name Phaser.Physics.Arcade.StaticBody#position + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.position = new Vector2(gameObject.x - gameObject.displayOriginX, gameObject.y - gameObject.displayOriginY); + + /** + * The width of the Static Body's boundary, in pixels. + * If the Static Body is circular, this is also the Static Body's diameter. + * + * @name Phaser.Physics.Arcade.StaticBody#width + * @type {number} + * @since 3.0.0 + */ + this.width = width; + + /** + * The height of the Static Body's boundary, in pixels. + * If the Static Body is circular, this is also the Static Body's diameter. + * + * @name Phaser.Physics.Arcade.StaticBody#height + * @type {number} + * @since 3.0.0 + */ + this.height = height; + + /** + * Half the Static Body's width, in pixels. + * If the Static Body is circular, this is also the Static Body's radius. + * + * @name Phaser.Physics.Arcade.StaticBody#halfWidth + * @type {number} + * @since 3.0.0 + */ + this.halfWidth = Math.abs(this.width / 2); + + /** + * Half the Static Body's height, in pixels. + * If the Static Body is circular, this is also the Static Body's radius. + * + * @name Phaser.Physics.Arcade.StaticBody#halfHeight + * @type {number} + * @since 3.0.0 + */ + this.halfHeight = Math.abs(this.height / 2); + + /** + * The center of the Static Body's boundary. + * This is the midpoint of its `position` (top-left corner) and its bottom-right corner. + * + * @name Phaser.Physics.Arcade.StaticBody#center + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.center = new Vector2(gameObject.x + this.halfWidth, gameObject.y + this.halfHeight); + + /** + * A constant zero velocity used by the Arcade Physics simulation for calculations. + * + * @name Phaser.Physics.Arcade.StaticBody#velocity + * @type {Phaser.Math.Vector2} + * @readonly + * @since 3.0.0 + */ + this.velocity = Vector2.ZERO; + + /** + * A constant `false` value expected by the Arcade Physics simulation. + * + * @name Phaser.Physics.Arcade.StaticBody#allowGravity + * @type {boolean} + * @readonly + * @default false + * @since 3.0.0 + */ + this.allowGravity = false; + + /** + * Gravitational force applied specifically to this Body. Values are in pixels per second squared. Always zero for a Static Body. + * + * @name Phaser.Physics.Arcade.StaticBody#gravity + * @type {Phaser.Math.Vector2} + * @readonly + * @since 3.0.0 + */ + this.gravity = Vector2.ZERO; + + /** + * Rebound, or restitution, following a collision, relative to 1. Always zero for a Static Body. + * + * @name Phaser.Physics.Arcade.StaticBody#bounce + * @type {Phaser.Math.Vector2} + * @readonly + * @since 3.0.0 + */ + this.bounce = Vector2.ZERO; + + // If true this Body will dispatch events + + /** + * Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary. + * Always false for a Static Body. (Static Bodies never collide with the world boundary and never trigger a `worldbounds` event.) + * + * @name Phaser.Physics.Arcade.StaticBody#onWorldBounds + * @type {boolean} + * @readonly + * @default false + * @since 3.0.0 + */ + this.onWorldBounds = false; + + /** + * Whether the simulation emits a `collide` event when this StaticBody collides with another. + * + * @name Phaser.Physics.Arcade.StaticBody#onCollide + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.onCollide = false; + + /** + * Whether the simulation emits an `overlap` event when this StaticBody overlaps with another. + * + * @name Phaser.Physics.Arcade.StaticBody#onOverlap + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.onOverlap = false; + + /** + * The StaticBody's inertia, relative to a default unit (1). With `bounce`, this affects the exchange of momentum (velocities) during collisions. + * + * @name Phaser.Physics.Arcade.StaticBody#mass + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.mass = 1; + + /** + * Whether this object can be moved by collisions with another body. + * + * @name Phaser.Physics.Arcade.StaticBody#immovable + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.immovable = true; + + /** + * A flag disabling the default horizontal separation of colliding bodies. Pass your own `collideHandler` to the collider. + * + * @name Phaser.Physics.Arcade.StaticBody#customSeparateX + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.customSeparateX = false; + + /** + * A flag disabling the default vertical separation of colliding bodies. Pass your own `collideHandler` to the collider. + * + * @name Phaser.Physics.Arcade.StaticBody#customSeparateY + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.customSeparateY = false; + + /** + * The amount of horizontal overlap (before separation), if this Body is colliding with another. + * + * @name Phaser.Physics.Arcade.StaticBody#overlapX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.overlapX = 0; + + /** + * The amount of vertical overlap (before separation), if this Body is colliding with another. + * + * @name Phaser.Physics.Arcade.StaticBody#overlapY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.overlapY = 0; + + /** + * The amount of overlap (before separation), if this StaticBody is circular and colliding with another circular body. + * + * @name Phaser.Physics.Arcade.StaticBody#overlapR + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.overlapR = 0; + + /** + * Whether this StaticBody has ever overlapped with another while both were not moving. + * + * @name Phaser.Physics.Arcade.StaticBody#embedded + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.embedded = false; + + /** + * Whether this StaticBody interacts with the world boundary. + * Always false for a Static Body. (Static Bodies never collide with the world boundary.) + * + * @name Phaser.Physics.Arcade.StaticBody#collideWorldBounds + * @type {boolean} + * @readonly + * @default false + * @since 3.0.0 + */ + this.collideWorldBounds = false; + + /** + * Whether this StaticBody is checked for collisions and for which directions. You can set `checkCollision.none = false` to disable collision checks. + * + * @name Phaser.Physics.Arcade.StaticBody#checkCollision + * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} + * @since 3.0.0 + */ + this.checkCollision = { none: false, up: true, down: true, left: true, right: true }; + + /** + * Whether this StaticBody has ever collided with another body and in which direction. + * + * @name Phaser.Physics.Arcade.StaticBody#touching + * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} + * @since 3.0.0 + */ + this.touching = { none: true, up: false, down: false, left: false, right: false }; + + /** + * Whether this StaticBody was colliding with another body during the last step or any previous step, and in which direction. + * + * @name Phaser.Physics.Arcade.StaticBody#wasTouching + * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} + * @since 3.0.0 + */ + this.wasTouching = { none: true, up: false, down: false, left: false, right: false }; + + /** + * Whether this StaticBody has ever collided with a tile or the world boundary. + * + * @name Phaser.Physics.Arcade.StaticBody#blocked + * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} + * @since 3.0.0 + */ + this.blocked = { none: true, up: false, down: false, left: false, right: false }; + + /** + * The StaticBody's physics type (static by default). + * + * @name Phaser.Physics.Arcade.StaticBody#physicsType + * @type {integer} + * @default Phaser.Physics.Arcade.STATIC_BODY + * @since 3.0.0 + */ + this.physicsType = CONST.STATIC_BODY; + + /** + * The calculated change in the Body's horizontal position during the current step. + * For a static body this is always zero. + * + * @name Phaser.Physics.Arcade.StaticBody#_dx + * @type {number} + * @private + * @default 0 + * @since 3.10.0 + */ + this._dx = 0; + + /** + * The calculated change in the Body's vertical position during the current step. + * For a static body this is always zero. + * + * @name Phaser.Physics.Arcade.StaticBody#_dy + * @type {number} + * @private + * @default 0 + * @since 3.10.0 + */ + this._dy = 0; + }, + + /** + * Changes the Game Object this Body is bound to. + * First it removes its reference from the old Game Object, then sets the new one. + * You can optionally update the position and dimensions of this Body to reflect that of the new Game Object. + * + * @method Phaser.Physics.Arcade.StaticBody#setGameObject + * @since 3.1.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The new Game Object that will own this Body. + * @param {boolean} [update=true] - Reposition and resize this Body to match the new Game Object? + * + * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. + * + * @see Phaser.Physics.Arcade.StaticBody#updateFromGameObject + */ + setGameObject: function (gameObject, update) + { + if (gameObject && gameObject !== this.gameObject) + { + // Remove this body from the old game object + this.gameObject.body = null; + + gameObject.body = this; + + // Update our reference + this.gameObject = gameObject; + } + + if (update) + { + this.updateFromGameObject(); + } + + return this; + }, + + /** + * Updates this Static Body so that its position and dimensions are updated + * based on the current Game Object it is bound to. + * + * @method Phaser.Physics.Arcade.StaticBody#updateFromGameObject + * @since 3.1.0 + * + * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. + */ + updateFromGameObject: function () + { + this.world.staticTree.remove(this); + + var gameObject = this.gameObject; + + gameObject.getTopLeft(this.position); + + this.width = gameObject.displayWidth; + this.height = gameObject.displayHeight; + + this.halfWidth = Math.abs(this.width / 2); + this.halfHeight = Math.abs(this.height / 2); + + this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight); + + this.world.staticTree.insert(this); + + return this; + }, + + /** + * Sets the offset of the body. + * + * @method Phaser.Physics.Arcade.StaticBody#setOffset + * @since 3.4.0 + * + * @param {number} x - The horizontal offset of the Body from the Game Object's center. + * @param {number} y - The vertical offset of the Body from the Game Object's center. + * + * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. + */ + setOffset: function (x, y) + { + if (y === undefined) { y = x; } + + this.world.staticTree.remove(this); + + this.position.x -= this.offset.x; + this.position.y -= this.offset.y; + + this.offset.set(x, y); + + this.position.x += this.offset.x; + this.position.y += this.offset.y; + + this.updateCenter(); + + this.world.staticTree.insert(this); + + return this; + }, + + /** + * Sets the size of the body. + * Resets the width and height to match current frame, if no width and height provided and a frame is found. + * + * @method Phaser.Physics.Arcade.StaticBody#setSize + * @since 3.0.0 + * + * @param {integer} [width] - The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param {integer} [height] - The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param {boolean} [center=true] - Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. + * + * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. + */ + setSize: function (width, height, center) + { + if (center === undefined) { center = true; } + + var gameObject = this.gameObject; + + if (!width && gameObject.frame) + { + width = gameObject.frame.realWidth; + } + + if (!height && gameObject.frame) + { + height = gameObject.frame.realHeight; + } + + this.world.staticTree.remove(this); + + this.width = width; + this.height = height; + + this.halfWidth = Math.floor(width / 2); + this.halfHeight = Math.floor(height / 2); + + if (center && gameObject.getCenter) + { + var ox = gameObject.displayWidth / 2; + var oy = gameObject.displayHeight / 2; + + this.position.x -= this.offset.x; + this.position.y -= this.offset.y; + + this.offset.set(ox - this.halfWidth, oy - this.halfHeight); + + this.position.x += this.offset.x; + this.position.y += this.offset.y; + } + + this.updateCenter(); + + this.isCircle = false; + this.radius = 0; + + this.world.staticTree.insert(this); + + return this; + }, + + /** + * Sets this Static Body to have a circular body and sets its sizes and position. + * + * @method Phaser.Physics.Arcade.StaticBody#setCircle + * @since 3.0.0 + * + * @param {number} radius - The radius of the StaticBody, in pixels. + * @param {number} [offsetX] - The horizontal offset of the StaticBody from its Game Object, in pixels. + * @param {number} [offsetY] - The vertical offset of the StaticBody from its Game Object, in pixels. + * + * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. + */ + setCircle: function (radius, offsetX, offsetY) + { + if (offsetX === undefined) { offsetX = this.offset.x; } + if (offsetY === undefined) { offsetY = this.offset.y; } + + if (radius > 0) + { + this.world.staticTree.remove(this); + + this.isCircle = true; + + this.radius = radius; + + this.width = radius * 2; + this.height = radius * 2; + + this.halfWidth = Math.floor(this.width / 2); + this.halfHeight = Math.floor(this.height / 2); + + this.offset.set(offsetX, offsetY); + + this.updateCenter(); + + this.world.staticTree.insert(this); + } + else + { + this.isCircle = false; + } + + return this; + }, + + /** + * Updates the StaticBody's `center` from its `position` and dimensions. + * + * @method Phaser.Physics.Arcade.StaticBody#updateCenter + * @since 3.0.0 + */ + updateCenter: function () + { + this.center.set(this.position.x + this.halfWidth, this.position.y + this.halfHeight); + }, + + /** + * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates. + * Similar to `updateFromGameObject`, but doesn't modify the Body's dimensions. + * + * @method Phaser.Physics.Arcade.StaticBody#reset + * @since 3.0.0 + * + * @param {number} [x] - The x coordinate to reset the body to. If not given will use the parent Game Object's coordinate. + * @param {number} [y] - The y coordinate to reset the body to. If not given will use the parent Game Object's coordinate. + */ + reset: function (x, y) + { + var gameObject = this.gameObject; + + if (x === undefined) { x = gameObject.x; } + if (y === undefined) { y = gameObject.y; } + + this.world.staticTree.remove(this); + + gameObject.setPosition(x, y); + + gameObject.getTopLeft(this.position); + + this.updateCenter(); + + this.world.staticTree.insert(this); + }, + + /** + * NOOP function. A Static Body cannot be stopped. + * + * @method Phaser.Physics.Arcade.StaticBody#stop + * @since 3.0.0 + * + * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. + */ + stop: function () + { + return this; + }, + + /** + * Returns the x and y coordinates of the top left and bottom right points of the StaticBody. + * + * @method Phaser.Physics.Arcade.StaticBody#getBounds + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Arcade.ArcadeBodyBounds} obj - The object which will hold the coordinates of the bounds. + * + * @return {Phaser.Types.Physics.Arcade.ArcadeBodyBounds} The same object that was passed with `x`, `y`, `right` and `bottom` values matching the respective values of the StaticBody. + */ + getBounds: function (obj) + { + obj.x = this.x; + obj.y = this.y; + obj.right = this.right; + obj.bottom = this.bottom; + + return obj; + }, + + /** + * Checks to see if a given x,y coordinate is colliding with this Static Body. + * + * @method Phaser.Physics.Arcade.StaticBody#hitTest + * @since 3.0.0 + * + * @param {number} x - The x coordinate to check against this body. + * @param {number} y - The y coordinate to check against this body. + * + * @return {boolean} `true` if the given coordinate lies within this body, otherwise `false`. + */ + hitTest: function (x, y) + { + return (this.isCircle) ? CircleContains(this, x, y) : RectangleContains(this, x, y); + }, + + /** + * NOOP + * + * @method Phaser.Physics.Arcade.StaticBody#postUpdate + * @since 3.12.0 + */ + postUpdate: function () + { + }, + + /** + * The absolute (non-negative) change in this StaticBody's horizontal position from the previous step. Always zero. + * + * @method Phaser.Physics.Arcade.StaticBody#deltaAbsX + * @since 3.0.0 + * + * @return {number} Always zero for a Static Body. + */ + deltaAbsX: function () + { + return 0; + }, + + /** + * The absolute (non-negative) change in this StaticBody's vertical position from the previous step. Always zero. + * + * @method Phaser.Physics.Arcade.StaticBody#deltaAbsY + * @since 3.0.0 + * + * @return {number} Always zero for a Static Body. + */ + deltaAbsY: function () + { + return 0; + }, + + /** + * The change in this StaticBody's horizontal position from the previous step. Always zero. + * + * @method Phaser.Physics.Arcade.StaticBody#deltaX + * @since 3.0.0 + * + * @return {number} The change in this StaticBody's velocity from the previous step. Always zero. + */ + deltaX: function () + { + return 0; + }, + + /** + * The change in this StaticBody's vertical position from the previous step. Always zero. + * + * @method Phaser.Physics.Arcade.StaticBody#deltaY + * @since 3.0.0 + * + * @return {number} The change in this StaticBody's velocity from the previous step. Always zero. + */ + deltaY: function () + { + return 0; + }, + + /** + * The change in this StaticBody's rotation from the previous step. Always zero. + * + * @method Phaser.Physics.Arcade.StaticBody#deltaZ + * @since 3.0.0 + * + * @return {number} The change in this StaticBody's rotation from the previous step. Always zero. + */ + deltaZ: function () + { + return 0; + }, + + /** + * Disables this Body and marks it for destruction during the next step. + * + * @method Phaser.Physics.Arcade.StaticBody#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.enable = false; + + this.world.pendingDestroy.set(this); + }, + + /** + * Draws a graphical representation of the StaticBody for visual debugging purposes. + * + * @method Phaser.Physics.Arcade.StaticBody#drawDebug + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphic - The Graphics object to use for the debug drawing of the StaticBody. + */ + drawDebug: function (graphic) + { + var pos = this.position; + + var x = pos.x + this.halfWidth; + var y = pos.y + this.halfHeight; + + if (this.debugShowBody) + { + graphic.lineStyle(graphic.defaultStrokeWidth, this.debugBodyColor, 1); + + if (this.isCircle) + { + graphic.strokeCircle(x, y, this.width / 2); + } + else + { + graphic.strokeRect(pos.x, pos.y, this.width, this.height); + } + + } + }, + + /** + * Indicates whether the StaticBody is going to be showing a debug visualization during postUpdate. + * + * @method Phaser.Physics.Arcade.StaticBody#willDrawDebug + * @since 3.0.0 + * + * @return {boolean} Whether or not the StaticBody is going to show the debug visualization during postUpdate. + */ + willDrawDebug: function () + { + return this.debugShowBody; + }, + + /** + * Sets the Mass of the StaticBody. Will set the Mass to 0.1 if the value passed is less than or equal to zero. + * + * @method Phaser.Physics.Arcade.StaticBody#setMass + * @since 3.0.0 + * + * @param {number} value - The value to set the Mass to. Values of zero or less are changed to 0.1. + * + * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. + */ + setMass: function (value) + { + if (value <= 0) + { + // Causes havoc otherwise + value = 0.1; + } + + this.mass = value; + + return this; + }, + + /** + * The x coordinate of the StaticBody. + * + * @name Phaser.Physics.Arcade.StaticBody#x + * @type {number} + * @since 3.0.0 + */ + x: { + + get: function () + { + return this.position.x; + }, + + set: function (value) + { + this.world.staticTree.remove(this); + + this.position.x = value; + + this.world.staticTree.insert(this); + } + + }, + + /** + * The y coordinate of the StaticBody. + * + * @name Phaser.Physics.Arcade.StaticBody#y + * @type {number} + * @since 3.0.0 + */ + y: { + + get: function () + { + return this.position.y; + }, + + set: function (value) + { + this.world.staticTree.remove(this); + + this.position.y = value; + + this.world.staticTree.insert(this); + } + + }, + + /** + * Returns the left-most x coordinate of the area of the StaticBody. + * + * @name Phaser.Physics.Arcade.StaticBody#left + * @type {number} + * @readonly + * @since 3.0.0 + */ + left: { + + get: function () + { + return this.position.x; + } + + }, + + /** + * The right-most x coordinate of the area of the StaticBody. + * + * @name Phaser.Physics.Arcade.StaticBody#right + * @type {number} + * @readonly + * @since 3.0.0 + */ + right: { + + get: function () + { + return this.position.x + this.width; + } + + }, + + /** + * The highest y coordinate of the area of the StaticBody. + * + * @name Phaser.Physics.Arcade.StaticBody#top + * @type {number} + * @readonly + * @since 3.0.0 + */ + top: { + + get: function () + { + return this.position.y; + } + + }, + + /** + * The lowest y coordinate of the area of the StaticBody. (y + height) + * + * @name Phaser.Physics.Arcade.StaticBody#bottom + * @type {number} + * @readonly + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return this.position.y + this.height; + } + + } + +}); + +module.exports = StaticBody; + + +/***/ }), +/* 446 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Collision Types - Determine if and how entities collide with each other. + * + * In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves, + * while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE + * collisions, both entities are moved. LITE or PASSIVE entities don't collide + * with other LITE or PASSIVE entities at all. The behavior for FIXED vs. + * FIXED collisions is undefined. + * + * @namespace Phaser.Physics.Impact.COLLIDES + * @memberof Phaser.Physics.Impact + * @since 3.0.0 + */ + +module.exports = { + + /** + * Never collides. + * + * @name Phaser.Physics.Impact.COLLIDES.NEVER + * @type {integer} + * @const + * @since 3.0.0 + */ + NEVER: 0, + + /** + * Lite collision. + * + * @name Phaser.Physics.Impact.COLLIDES.LITE + * @type {integer} + * @const + * @since 3.0.0 + */ + LITE: 1, + + /** + * Passive collision. + * + * @name Phaser.Physics.Impact.COLLIDES.PASSIVE + * @type {integer} + * @const + * @since 3.0.0 + */ + PASSIVE: 2, + + /** + * Active collision. + * + * @name Phaser.Physics.Impact.COLLIDES.ACTIVE + * @type {integer} + * @const + * @since 3.0.0 + */ + ACTIVE: 4, + + /** + * Fixed collision. + * + * @name Phaser.Physics.Impact.COLLIDES.FIXED + * @type {integer} + * @const + * @since 3.0.0 + */ + FIXED: 8 + +}; + + +/***/ }), +/* 447 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Collision Types - Determine if and how entities collide with each other. + * + * In ACTIVE vs. LITE or FIXED vs. ANY collisions, only the "weak" entity moves, + * while the other one stays fixed. In ACTIVE vs. ACTIVE and ACTIVE vs. PASSIVE + * collisions, both entities are moved. LITE or PASSIVE entities don't collide + * with other LITE or PASSIVE entities at all. The behavior for FIXED vs. + * FIXED collisions is undefined. + * + * @namespace Phaser.Physics.Impact.TYPE + * @memberof Phaser.Physics.Impact + * @since 3.0.0 + */ +module.exports = { + + /** + * Collides with nothing. + * + * @name Phaser.Physics.Impact.TYPE.NONE + * @type {integer} + * @const + * @since 3.0.0 + */ + NONE: 0, + + /** + * Type A. Collides with Type B. + * + * @name Phaser.Physics.Impact.TYPE.A + * @type {integer} + * @const + * @since 3.0.0 + */ + A: 1, + + /** + * Type B. Collides with Type A. + * + * @name Phaser.Physics.Impact.TYPE.B + * @type {integer} + * @const + * @since 3.0.0 + */ + B: 2, + + /** + * Collides with both types A and B. + * + * @name Phaser.Physics.Impact.TYPE.BOTH + * @type {integer} + * @const + * @since 3.0.0 + */ + BOTH: 3 + +}; + + +/***/ }), +/* 448 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Sleeping` module contains methods to manage the sleeping state of bodies. +* +* @class Sleeping +*/ + +var Sleeping = {}; + +module.exports = Sleeping; + +var Events = __webpack_require__(227); + +(function() { + + Sleeping._motionWakeThreshold = 0.18; + Sleeping._motionSleepThreshold = 0.08; + Sleeping._minBias = 0.9; + + /** + * Puts bodies to sleep or wakes them up depending on their motion. + * @method update + * @param {body[]} bodies + * @param {number} timeScale + */ + Sleeping.update = function(bodies, timeScale) { + var timeFactor = timeScale * timeScale * timeScale; + + // update bodies sleeping status + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i], + motion = body.speed * body.speed + body.angularSpeed * body.angularSpeed; + + // wake up bodies if they have a force applied + if (body.force.x !== 0 || body.force.y !== 0) { + Sleeping.set(body, false); + continue; + } + + var minMotion = Math.min(body.motion, motion), + maxMotion = Math.max(body.motion, motion); + + // biased average motion estimation between frames + body.motion = Sleeping._minBias * minMotion + (1 - Sleeping._minBias) * maxMotion; + + if (body.sleepThreshold > 0 && body.motion < Sleeping._motionSleepThreshold * timeFactor) { + body.sleepCounter += 1; + + if (body.sleepCounter >= body.sleepThreshold) + Sleeping.set(body, true); + } else if (body.sleepCounter > 0) { + body.sleepCounter -= 1; + } + } + }; + + /** + * Given a set of colliding pairs, wakes the sleeping bodies involved. + * @method afterCollisions + * @param {pair[]} pairs + * @param {number} timeScale + */ + Sleeping.afterCollisions = function(pairs, timeScale) { + var timeFactor = timeScale * timeScale * timeScale; + + // wake up bodies involved in collisions + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + + // don't wake inactive pairs + if (!pair.isActive) + continue; + + var collision = pair.collision, + bodyA = collision.bodyA.parent, + bodyB = collision.bodyB.parent; + + // don't wake if at least one body is static + if ((bodyA.isSleeping && bodyB.isSleeping) || bodyA.isStatic || bodyB.isStatic) + continue; + + if (bodyA.isSleeping || bodyB.isSleeping) { + var sleepingBody = (bodyA.isSleeping && !bodyA.isStatic) ? bodyA : bodyB, + movingBody = sleepingBody === bodyA ? bodyB : bodyA; + + if (!sleepingBody.isStatic && movingBody.motion > Sleeping._motionWakeThreshold * timeFactor) { + Sleeping.set(sleepingBody, false); + } + } + } + }; + + /** + * Set a body as sleeping or awake. + * @method set + * @param {body} body + * @param {boolean} isSleeping + */ + Sleeping.set = function(body, isSleeping) { + var wasSleeping = body.isSleeping; + + if (isSleeping) { + body.isSleeping = true; + body.sleepCounter = body.sleepThreshold; + + body.positionImpulse.x = 0; + body.positionImpulse.y = 0; + + body.positionPrev.x = body.position.x; + body.positionPrev.y = body.position.y; + + body.anglePrev = body.angle; + body.speed = 0; + body.angularSpeed = 0; + body.motion = 0; + + if (!wasSleeping) { + Events.trigger(body, 'sleepStart'); + } + } else { + body.isSleeping = false; + body.sleepCounter = 0; + + if (wasSleeping) { + Events.trigger(body, 'sleepEnd'); + } + } + }; + +})(); + + +/***/ }), +/* 449 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A Global Plugin is installed just once into the Game owned Plugin Manager. + * It can listen for Game events and respond to them. + * + * @class BasePlugin + * @memberof Phaser.Plugins + * @constructor + * @since 3.8.0 + * + * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. + */ +var BasePlugin = new Class({ + + initialize: + + function BasePlugin (pluginManager) + { + /** + * A handy reference to the Plugin Manager that is responsible for this plugin. + * Can be used as a route to gain access to game systems and events. + * + * @name Phaser.Plugins.BasePlugin#pluginManager + * @type {Phaser.Plugins.PluginManager} + * @protected + * @since 3.8.0 + */ + this.pluginManager = pluginManager; + + /** + * A reference to the Game instance this plugin is running under. + * + * @name Phaser.Plugins.BasePlugin#game + * @type {Phaser.Game} + * @protected + * @since 3.8.0 + */ + this.game = pluginManager.game; + + /** + * A reference to the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#scene + * @type {?Phaser.Scene} + * @protected + * @since 3.8.0 + */ + this.scene; + + /** + * A reference to the Scene Systems of the Scene that has installed this plugin. + * Only set if it's a Scene Plugin, otherwise `null`. + * This property is only set when the plugin is instantiated and added to the Scene, not before. + * You cannot use it during the `init` method, but you can during the `boot` method. + * + * @name Phaser.Plugins.BasePlugin#systems + * @type {?Phaser.Scenes.Systems} + * @protected + * @since 3.8.0 + */ + this.systems; + }, + + /** + * Called by the PluginManager when this plugin is first instantiated. + * It will never be called again on this instance. + * In here you can set-up whatever you need for this plugin to run. + * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this. + * + * @method Phaser.Plugins.BasePlugin#init + * @since 3.8.0 + * + * @param {?any} [data] - A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually). + */ + init: function () + { + }, + + /** + * Called by the PluginManager when this plugin is started. + * If a plugin is stopped, and then started again, this will get called again. + * Typically called immediately after `BasePlugin.init`. + * + * @method Phaser.Plugins.BasePlugin#start + * @since 3.8.0 + */ + start: function () + { + // Here are the game-level events you can listen to. + // At the very least you should offer a destroy handler for when the game closes down. + + // var eventEmitter = this.game.events; + + // eventEmitter.once('destroy', this.gameDestroy, this); + // eventEmitter.on('pause', this.gamePause, this); + // eventEmitter.on('resume', this.gameResume, this); + // eventEmitter.on('resize', this.gameResize, this); + // eventEmitter.on('prestep', this.gamePreStep, this); + // eventEmitter.on('step', this.gameStep, this); + // eventEmitter.on('poststep', this.gamePostStep, this); + // eventEmitter.on('prerender', this.gamePreRender, this); + // eventEmitter.on('postrender', this.gamePostRender, this); + }, + + /** + * Called by the PluginManager when this plugin is stopped. + * The game code has requested that your plugin stop doing whatever it does. + * It is now considered as 'inactive' by the PluginManager. + * Handle that process here (i.e. stop listening for events, etc) + * If the plugin is started again then `BasePlugin.start` will be called again. + * + * @method Phaser.Plugins.BasePlugin#stop + * @since 3.8.0 + */ + stop: function () + { + }, + + /** + * If this is a Scene Plugin (i.e. installed into a Scene) then this method is called when the Scene boots. + * By this point the plugin properties `scene` and `systems` will have already been set. + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + * + * @method Phaser.Plugins.BasePlugin#boot + * @since 3.8.0 + */ + boot: function () + { + // Here are the Scene events you can listen to. + // At the very least you should offer a destroy handler for when the Scene closes down. + + // var eventEmitter = this.systems.events; + + // eventEmitter.once('destroy', this.sceneDestroy, this); + // eventEmitter.on('start', this.sceneStart, this); + // eventEmitter.on('preupdate', this.scenePreUpdate, this); + // eventEmitter.on('update', this.sceneUpdate, this); + // eventEmitter.on('postupdate', this.scenePostUpdate, this); + // eventEmitter.on('pause', this.scenePause, this); + // eventEmitter.on('resume', this.sceneResume, this); + // eventEmitter.on('sleep', this.sceneSleep, this); + // eventEmitter.on('wake', this.sceneWake, this); + // eventEmitter.on('shutdown', this.sceneShutdown, this); + // eventEmitter.on('destroy', this.sceneDestroy, this); + }, + + /** + * Game instance has been destroyed. + * You must release everything in here, all references, all objects, free it all up. + * + * @method Phaser.Plugins.BasePlugin#destroy + * @since 3.8.0 + */ + destroy: function () + { + this.pluginManager = null; + this.game = null; + this.scene = null; + this.systems = null; + } + +}); + +module.exports = BasePlugin; + + +/***/ }), +/* 450 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); + +/** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does + * not change collision information. + * + * @function Phaser.Tilemaps.Components.ReplaceByIndex + * @private + * @since 3.0.0 + * + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var ReplaceByIndex = function (findIndex, newIndex, tileX, tileY, width, height, layer) +{ + var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + + for (var i = 0; i < tiles.length; i++) + { + if (tiles[i] && tiles[i].index === findIndex) + { + tiles[i].index = newIndex; + } + } +}; + +module.exports = ReplaceByIndex; + + +/***/ }), +/* 451 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsInLayerBounds = __webpack_require__(101); + +/** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * @function Phaser.Tilemaps.Components.HasTileAt + * @private + * @since 3.0.0 + * + * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {?boolean} Returns a boolean, or null if the layer given was invalid. + */ +var HasTileAt = function (tileX, tileY, layer) +{ + if (IsInLayerBounds(tileX, tileY, layer)) + { + var tile = layer.data[tileY][tileX]; + return (tile !== null && tile.index > -1); + } + else + { + return false; + } + +}; + +module.exports = HasTileAt; + + +/***/ }), +/* 452 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Tile = __webpack_require__(72); +var IsInLayerBounds = __webpack_require__(101); +var CalculateFacesAt = __webpack_require__(210); + +/** + * Removes the tile at the given tile coordinates in the specified layer and updates the layer's + * collision information. + * + * @function Phaser.Tilemaps.Components.RemoveTileAt + * @private + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate. + * @param {integer} tileY - The y coordinate. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. + */ +var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, layer) +{ + if (replaceWithNull === undefined) { replaceWithNull = false; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + + if (!IsInLayerBounds(tileX, tileY, layer)) + { + return null; + } + + var tile = layer.data[tileY][tileX]; + + if (!tile) + { + return null; + } + else + { + layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, tile.width, tile.height); + } + + // Recalculate faces only if the removed tile was a colliding tile + if (recalculateFaces && tile && tile.collides) + { + CalculateFacesAt(tileX, tileY, layer); + } + + return tile; +}; + +module.exports = RemoveTileAt; + + +/***/ }), +/* 453 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Formats = __webpack_require__(31); +var Parse2DArray = __webpack_require__(213); +var ParseCSV = __webpack_require__(454); +var ParseJSONTiled = __webpack_require__(455); +var ParseWeltmeister = __webpack_require__(466); + +/** + * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format + * is found, returns `null`. When loading from CSV or a 2D array, you should specify the tileWidth & + * tileHeight. When parsing from a map from Tiled, the tileWidth & tileHeight will be pulled from + * the map data. + * + * @function Phaser.Tilemaps.Parsers.Parse + * @since 3.0.0 + * + * @param {string} name - The name of the tilemap, used to set the name on the MapData. + * @param {integer} mapFormat - See ../Formats.js. + * @param {(integer[][]|string|object)} data - 2D array, CSV string or Tiled JSON object. + * @param {integer} tileWidth - The width of a tile in pixels. Required for 2D array and CSV, but + * ignored for Tiled JSON. + * @param {integer} tileHeight - The height of a tile in pixels. Required for 2D array and CSV, but + * ignored for Tiled JSON. + * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + * + * @return {Phaser.Tilemaps.MapData} The created `MapData` object. + */ +var Parse = function (name, mapFormat, data, tileWidth, tileHeight, insertNull) +{ + var newMap; + + switch (mapFormat) + { + case (Formats.ARRAY_2D): + newMap = Parse2DArray(name, data, tileWidth, tileHeight, insertNull); + break; + case (Formats.CSV): + newMap = ParseCSV(name, data, tileWidth, tileHeight, insertNull); + break; + case (Formats.TILED_JSON): + newMap = ParseJSONTiled(name, data, insertNull); + break; + case (Formats.WELTMEISTER): + newMap = ParseWeltmeister(name, data, insertNull); + break; + default: + console.warn('Unrecognized tilemap data format: ' + mapFormat); + newMap = null; + } + + return newMap; +}; + +module.exports = Parse; + + +/***/ }), +/* 454 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Formats = __webpack_require__(31); +var Parse2DArray = __webpack_require__(213); + +/** + * Parses a CSV string of tile indexes into a new MapData object with a single layer. + * + * @function Phaser.Tilemaps.Parsers.ParseCSV + * @since 3.0.0 + * + * @param {string} name - The name of the tilemap, used to set the name on the MapData. + * @param {string} data - CSV string of tile indexes. + * @param {integer} tileWidth - The width of a tile in pixels. + * @param {integer} tileHeight - The height of a tile in pixels. + * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + * + * @return {Phaser.Tilemaps.MapData} The resulting MapData object. + */ +var ParseCSV = function (name, data, tileWidth, tileHeight, insertNull) +{ + var array2D = data + .trim() + .split('\n') + .map(function (row) { return row.split(','); }); + + var map = Parse2DArray(name, array2D, tileWidth, tileHeight, insertNull); + map.format = Formats.CSV; + + return map; +}; + +module.exports = ParseCSV; + + +/***/ }), +/* 455 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Formats = __webpack_require__(31); +var MapData = __webpack_require__(103); +var ParseTileLayers = __webpack_require__(456); +var ParseImageLayers = __webpack_require__(458); +var ParseTilesets = __webpack_require__(459); +var ParseObjectLayers = __webpack_require__(462); +var BuildTilesetIndex = __webpack_require__(464); +var AssignTileProperties = __webpack_require__(465); + +/** + * Parses a Tiled JSON object into a new MapData object. + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled + * @since 3.0.0 + * + * @param {string} name - The name of the tilemap, used to set the name on the MapData. + * @param {object} json - The Tiled JSON object. + * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + * + * @return {?Phaser.Tilemaps.MapData} The created MapData object, or `null` if the data can't be parsed. + */ +var ParseJSONTiled = function (name, json, insertNull) +{ + if (json.orientation !== 'orthogonal') + { + console.warn('Only orthogonal map types are supported in this version of Phaser'); + return null; + } + + // Map data will consist of: layers, objects, images, tilesets, sizes + var mapData = new MapData({ + width: json.width, + height: json.height, + name: name, + tileWidth: json.tilewidth, + tileHeight: json.tileheight, + orientation: json.orientation, + format: Formats.TILED_JSON, + version: json.version, + properties: json.properties, + renderOrder: json.renderorder, + infinite: json.infinite + }); + + mapData.layers = ParseTileLayers(json, insertNull); + mapData.images = ParseImageLayers(json); + + var sets = ParseTilesets(json); + mapData.tilesets = sets.tilesets; + mapData.imageCollections = sets.imageCollections; + + mapData.objects = ParseObjectLayers(json); + + mapData.tiles = BuildTilesetIndex(mapData); + + AssignTileProperties(mapData); + + return mapData; +}; + +module.exports = ParseJSONTiled; + + +/***/ }), +/* 456 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Base64Decode = __webpack_require__(457); +var GetFastValue = __webpack_require__(2); +var LayerData = __webpack_require__(102); +var ParseGID = __webpack_require__(214); +var Tile = __webpack_require__(72); + +/** + * [description] + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseTileLayers + * @since 3.0.0 + * + * @param {object} json - [description] + * @param {boolean} insertNull - [description] + * + * @return {array} [description] + */ +var ParseTileLayers = function (json, insertNull) +{ + var infiniteMap = GetFastValue(json, 'infinite', false); + var tileLayers = []; + + for (var i = 0; i < json.layers.length; i++) + { + if (json.layers[i].type !== 'tilelayer') + { + continue; + } + + var curl = json.layers[i]; + + // Base64 decode data if necessary. NOTE: uncompressed base64 only. + if (curl.compression) + { + console.warn( + 'TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer \'' + + curl.name + '\'' + ); + continue; + } + else if (curl.encoding && curl.encoding === 'base64') + { + curl.data = Base64Decode(curl.data); + delete curl.encoding; // Allow the same map to be parsed multiple times + } + + // This is an array containing the tile indexes, one after the other. -1 = no tile, + // everything else = the tile index (starting at 1 for Tiled, 0 for CSV) If the map + // contains multiple tilesets then the indexes are relative to that which the set starts + // from. Need to set which tileset in the cache = which tileset in the JSON, if you do this + // manually it means you can use the same map data but a new tileset. + + var layerData; + var gidInfo; + var tile; + var blankTile; + + var output = []; + var x = 0; + + if (infiniteMap) + { + var layerOffsetX = GetFastValue(curl, 'startx', 0) + curl.x; + var layerOffsetY = GetFastValue(curl, 'starty', 0) + curl.y; + layerData = new LayerData({ + name: curl.name, + x: layerOffsetX, + y: layerOffsetY, + width: curl.width, + height: curl.height, + tileWidth: json.tilewidth, + tileHeight: json.tileheight, + alpha: curl.opacity, + visible: curl.visible, + properties: GetFastValue(curl, 'properties', {}) + }); + + for (var c = 0; c < curl.height; c++) + { + output.push([ null ]); + + for (var j = 0; j < curl.width; j++) + { + output[c][j] = null; + } + } + + for (c = 0, len = curl.chunks.length; c < len; c++) + { + var chunk = curl.chunks[c]; + + var offsetX = (chunk.x - layerOffsetX); + var offsetY = (chunk.y - layerOffsetY); + + var y = 0; + + for (var t = 0, len2 = chunk.data.length; t < len2; t++) + { + var newOffsetX = x + offsetX; + var newOffsetY = y + offsetY; + + gidInfo = ParseGID(chunk.data[t]); + + // index, x, y, width, height + if (gidInfo.gid > 0) + { + tile = new Tile(layerData, gidInfo.gid, newOffsetX, newOffsetY, json.tilewidth, + json.tileheight); + + // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal + // propeties into flipX, flipY and rotation + tile.rotation = gidInfo.rotation; + tile.flipX = gidInfo.flipped; + + output[newOffsetY][newOffsetX] = tile; + } + else + { + blankTile = insertNull + ? null + : new Tile(layerData, -1, newOffsetX, newOffsetY, json.tilewidth, json.tileheight); + + output[newOffsetY][newOffsetX] = blankTile; + } + + x++; + + if (x === chunk.width) + { + y++; + x = 0; + } + } + } + } + else + { + layerData = new LayerData({ + name: curl.name, + x: GetFastValue(curl, 'offsetx', 0) + curl.x, + y: GetFastValue(curl, 'offsety', 0) + curl.y, + width: curl.width, + height: curl.height, + tileWidth: json.tilewidth, + tileHeight: json.tileheight, + alpha: curl.opacity, + visible: curl.visible, + properties: GetFastValue(curl, 'properties', {}) + }); + + var row = []; + + // Loop through the data field in the JSON. + for (var k = 0, len = curl.data.length; k < len; k++) + { + gidInfo = ParseGID(curl.data[k]); + + // index, x, y, width, height + if (gidInfo.gid > 0) + { + tile = new Tile(layerData, gidInfo.gid, x, output.length, json.tilewidth, + json.tileheight); + + // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal + // propeties into flipX, flipY and rotation + tile.rotation = gidInfo.rotation; + tile.flipX = gidInfo.flipped; + + row.push(tile); + } + else + { + blankTile = insertNull + ? null + : new Tile(layerData, -1, x, output.length, json.tilewidth, json.tileheight); + row.push(blankTile); + } + + x++; + + if (x === curl.width) + { + output.push(row); + x = 0; + row = []; + } + } + } + + layerData.data = output; + + tileLayers.push(layerData); + } + + return tileLayers; +}; + +module.exports = ParseTileLayers; + + +/***/ }), +/* 457 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Decode base-64 encoded data, for example as exported by Tiled. + * + * @function Phaser.Tilemaps.Parsers.Tiled.Base64Decode + * @since 3.0.0 + * + * @param {object} data - Base-64 encoded data to decode. + * + * @return {array} Array containing the decoded bytes. + */ +var Base64Decode = function (data) +{ + var binaryString = window.atob(data); + var len = binaryString.length; + var bytes = new Array(len / 4); + + // Interpret binaryString as an array of bytes representing little-endian encoded uint32 values. + for (var i = 0; i < len; i += 4) + { + bytes[i / 4] = ( + binaryString.charCodeAt(i) | + binaryString.charCodeAt(i + 1) << 8 | + binaryString.charCodeAt(i + 2) << 16 | + binaryString.charCodeAt(i + 3) << 24 + ) >>> 0; + } + + return bytes; +}; + +module.exports = Base64Decode; + + +/***/ }), +/* 458 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetFastValue = __webpack_require__(2); + +/** + * [description] + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseImageLayers + * @since 3.0.0 + * + * @param {object} json - [description] + * + * @return {array} [description] + */ +var ParseImageLayers = function (json) +{ + var images = []; + + for (var i = 0; i < json.layers.length; i++) + { + if (json.layers[i].type !== 'imagelayer') + { + continue; + } + + var curi = json.layers[i]; + + images.push({ + name: curi.name, + image: curi.image, + x: GetFastValue(curi, 'offsetx', 0) + curi.x, + y: GetFastValue(curi, 'offsety', 0) + curi.y, + alpha: curi.opacity, + visible: curi.visible, + properties: GetFastValue(curi, 'properties', {}) + }); + } + + return images; +}; + +module.exports = ParseImageLayers; + + +/***/ }), +/* 459 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Tileset = __webpack_require__(140); +var ImageCollection = __webpack_require__(460); +var ParseObject = __webpack_require__(215); + +/** + * Tilesets and Image Collections + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseTilesets + * @since 3.0.0 + * + * @param {object} json - [description] + * + * @return {object} [description] + */ +var ParseTilesets = function (json) +{ + var tilesets = []; + var imageCollections = []; + var lastSet = null; + var stringID; + + for (var i = 0; i < json.tilesets.length; i++) + { + // name, firstgid, width, height, margin, spacing, properties + var set = json.tilesets[i]; + + if (set.source) + { + console.warn('Phaser can\'t load external tilesets. Use the Embed Tileset button and then export the map again.'); + } + else if (set.image) + { + var newSet = new Tileset(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing); + + if (json.version > 1) + { + // Tiled 1.2+ + + if (Array.isArray(set.tiles)) + { + var tiles = {}; + var props = {}; + + for (var t = 0; t < set.tiles.length; t++) + { + var tile = set.tiles[t]; + + // Convert tileproperties + if (tile.properties) + { + var newPropData = {}; + + tile.properties.forEach(function (propData) + { + newPropData[propData['name']] = propData['value']; + }); + + props[tile.id] = newPropData; + } + + // Convert objectgroup + if (tile.objectgroup) + { + tiles[tile.id] = { objectgroup: tile.objectgroup }; + + if (tile.objectgroup.objects) + { + var parsedObjects2 = tile.objectgroup.objects.map( + function (obj) { return ParseObject(obj); } + ); + + tiles[tile.id].objectgroup.objects = parsedObjects2; + } + } + + // Copy animation data + if (tile.animation) + { + if (tiles.hasOwnProperty(tile.id)) + { + tiles[tile.id].animation = tile.animation; + } + else + { + tiles[tile.id] = { animation: tile.animation }; + } + } + } + + newSet.tileData = tiles; + newSet.tileProperties = props; + } + } + else + { + // Tiled 1 + + // Properties stored per-tile in object with string indexes starting at "0" + if (set.tileproperties) + { + newSet.tileProperties = set.tileproperties; + } + + // Object & terrain shapes stored per-tile in object with string indexes starting at "0" + if (set.tiles) + { + newSet.tileData = set.tiles; + + // Parse the objects into Phaser format to match handling of other Tiled objects + for (stringID in newSet.tileData) + { + var objectGroup = newSet.tileData[stringID].objectgroup; + if (objectGroup && objectGroup.objects) + { + var parsedObjects1 = objectGroup.objects.map( + function (obj) { return ParseObject(obj); } + ); + newSet.tileData[stringID].objectgroup.objects = parsedObjects1; + } + } + } + } + + // For a normal sliced tileset the row/count/size information is computed when updated. + // This is done (again) after the image is set. + newSet.updateTileData(set.imagewidth, set.imageheight); + + tilesets.push(newSet); + } + else + { + var newCollection = new ImageCollection(set.name, set.firstgid, set.tilewidth, + set.tileheight, set.margin, set.spacing, set.properties); + + for (stringID in set.tiles) + { + var image = set.tiles[stringID].image; + var gid = set.firstgid + parseInt(stringID, 10); + newCollection.addImage(gid, image); + } + + imageCollections.push(newCollection); + } + + // We've got a new Tileset, so set the lastgid into the previous one + if (lastSet) + { + lastSet.lastgid = set.firstgid - 1; + } + + lastSet = set; + } + + return { tilesets: tilesets, imageCollections: imageCollections }; +}; + +module.exports = ParseTilesets; + + +/***/ }), +/* 460 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * An Image Collection is a special Tile Set containing multiple images, with no slicing into each image. + * + * Image Collections are normally created automatically when Tiled data is loaded. + * + * @class ImageCollection + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @param {string} name - The name of the image collection in the map data. + * @param {integer} firstgid - The first image index this image collection contains. + * @param {integer} [width=32] - Width of widest image (in pixels). + * @param {integer} [height=32] - Height of tallest image (in pixels). + * @param {integer} [margin=0] - The margin around all images in the collection (in pixels). + * @param {integer} [spacing=0] - The spacing between each image in the collection (in pixels). + * @param {object} [properties={}] - Custom Image Collection properties. + */ +var ImageCollection = new Class({ + + initialize: + + function ImageCollection (name, firstgid, width, height, margin, spacing, properties) + { + if (width === undefined || width <= 0) { width = 32; } + if (height === undefined || height <= 0) { height = 32; } + if (margin === undefined) { margin = 0; } + if (spacing === undefined) { spacing = 0; } + + /** + * The name of the Image Collection. + * + * @name Phaser.Tilemaps.ImageCollection#name + * @type {string} + * @since 3.0.0 + */ + this.name = name; + + /** + * The Tiled firstgid value. + * This is the starting index of the first image index this Image Collection contains. + * + * @name Phaser.Tilemaps.ImageCollection#firstgid + * @type {integer} + * @since 3.0.0 + */ + this.firstgid = firstgid | 0; + + /** + * The width of the widest image (in pixels). + * + * @name Phaser.Tilemaps.ImageCollection#imageWidth + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.imageWidth = width | 0; + + /** + * The height of the tallest image (in pixels). + * + * @name Phaser.Tilemaps.ImageCollection#imageHeight + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.imageHeight = height | 0; + + /** + * The margin around the images in the collection (in pixels). + * Use `setSpacing` to change. + * + * @name Phaser.Tilemaps.ImageCollection#imageMarge + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.imageMargin = margin | 0; + + /** + * The spacing between each image in the collection (in pixels). + * Use `setSpacing` to change. + * + * @name Phaser.Tilemaps.ImageCollection#imageSpacing + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.imageSpacing = spacing | 0; + + /** + * Image Collection-specific properties that are typically defined in the Tiled editor. + * + * @name Phaser.Tilemaps.ImageCollection#properties + * @type {object} + * @since 3.0.0 + */ + this.properties = properties || {}; + + /** + * The cached images that are a part of this collection. + * + * @name Phaser.Tilemaps.ImageCollection#images + * @type {array} + * @readonly + * @since 3.0.0 + */ + this.images = []; + + /** + * The total number of images in the image collection. + * + * @name Phaser.Tilemaps.ImageCollection#total + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.total = 0; + }, + + /** + * Returns true if and only if this image collection contains the given image index. + * + * @method Phaser.Tilemaps.ImageCollection#containsImageIndex + * @since 3.0.0 + * + * @param {integer} imageIndex - The image index to search for. + * + * @return {boolean} True if this Image Collection contains the given index. + */ + containsImageIndex: function (imageIndex) + { + return (imageIndex >= this.firstgid && imageIndex < (this.firstgid + this.total)); + }, + + /** + * Add an image to this Image Collection. + * + * @method Phaser.Tilemaps.ImageCollection#addImage + * @since 3.0.0 + * + * @param {integer} gid - The gid of the image in the Image Collection. + * @param {string} image - The the key of the image in the Image Collection and in the cache. + * + * @return {Phaser.Tilemaps.ImageCollection} This ImageCollection object. + */ + addImage: function (gid, image) + { + this.images.push({ gid: gid, image: image }); + this.total++; + + return this; + } + +}); + +module.exports = ImageCollection; + + +/***/ }), +/* 461 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var HasValue = __webpack_require__(97); + +/** + * Returns a new object that only contains the `keys` that were found on the object provided. + * If no `keys` are found, an empty object is returned. + * + * @function Phaser.Utils.Objects.Pick + * @since 3.18.0 + * + * @param {object} object - The object to pick the provided keys from. + * @param {array} keys - An array of properties to retrieve from the provided object. + * + * @return {object} A new object that only contains the `keys` that were found on the provided object. If no `keys` were found, an empty object will be returned. + */ +var Pick = function (object, keys) +{ + var obj = {}; + + for (var i = 0; i < keys.length; i++) + { + var key = keys[i]; + + if (HasValue(object, key)) + { + obj[key] = object[key]; + } + } + + return obj; +}; + +module.exports = Pick; + + +/***/ }), +/* 462 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetFastValue = __webpack_require__(2); +var ParseObject = __webpack_require__(215); +var ObjectLayer = __webpack_require__(463); + +/** + * Parses a Tiled JSON object into an array of ObjectLayer objects. + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseObjectLayers + * @since 3.0.0 + * + * @param {object} json - The Tiled JSON object. + * + * @return {array} An array of all object layers in the tilemap as `ObjectLayer`s. + */ +var ParseObjectLayers = function (json) +{ + var objectLayers = []; + + for (var i = 0; i < json.layers.length; i++) + { + if (json.layers[i].type !== 'objectgroup') + { + continue; + } + + var curo = json.layers[i]; + var offsetX = GetFastValue(curo, 'offsetx', 0); + var offsetY = GetFastValue(curo, 'offsety', 0); + var objects = []; + + for (var j = 0; j < curo.objects.length; j++) + { + var parsedObject = ParseObject(curo.objects[j], offsetX, offsetY); + + objects.push(parsedObject); + } + + var objectLayer = new ObjectLayer(curo); + objectLayer.objects = objects; + + objectLayers.push(objectLayer); + } + + return objectLayers; +}; + +module.exports = ParseObjectLayers; + + +/***/ }), +/* 463 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(2); + +/** + * @classdesc + * A class for representing a Tiled object layer in a map. This mirrors the structure of a Tiled + * object layer, except: + * - "x" & "y" properties are ignored since these cannot be changed in Tiled. + * - "offsetx" & "offsety" are applied to the individual object coordinates directly, so they + * are ignored as well. + * - "draworder" is ignored. + * + * @class ObjectLayer + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.Tilemaps.ObjectLayerConfig} [config] - The data for the layer from the Tiled JSON object. + */ +var ObjectLayer = new Class({ + + initialize: + + function ObjectLayer (config) + { + if (config === undefined) { config = {}; } + + /** + * The name of the Object Layer. + * + * @name Phaser.Tilemaps.ObjectLayer#name + * @type {string} + * @since 3.0.0 + */ + this.name = GetFastValue(config, 'name', 'object layer'); + + /** + * The opacity of the layer, between 0 and 1. + * + * @name Phaser.Tilemaps.ObjectLayer#opacity + * @type {number} + * @since 3.0.0 + */ + this.opacity = GetFastValue(config, 'opacity', 1); + + /** + * The custom properties defined on the Object Layer, keyed by their name. + * + * @name Phaser.Tilemaps.ObjectLayer#properties + * @type {object} + * @since 3.0.0 + */ + this.properties = GetFastValue(config, 'properties', {}); + + /** + * The type of each custom property defined on the Object Layer, keyed by its name. + * + * @name Phaser.Tilemaps.ObjectLayer#propertyTypes + * @type {object} + * @since 3.0.0 + */ + this.propertyTypes = GetFastValue(config, 'propertytypes', {}); + + /** + * The type of the layer, which should be `objectgroup`. + * + * @name Phaser.Tilemaps.ObjectLayer#type + * @type {string} + * @since 3.0.0 + */ + this.type = GetFastValue(config, 'type', 'objectgroup'); + + /** + * Whether the layer is shown (`true`) or hidden (`false`). + * + * @name Phaser.Tilemaps.ObjectLayer#visible + * @type {boolean} + * @since 3.0.0 + */ + this.visible = GetFastValue(config, 'visible', true); + + /** + * An array of all objects on this Object Layer. + * + * Each Tiled object corresponds to a JavaScript object in this array. It has an `id` (unique), + * `name` (as assigned in Tiled), `type` (as assigned in Tiled), `rotation` (in clockwise degrees), + * `properties` (if any), `visible` state (`true` if visible, `false` otherwise), + * `x` and `y` coordinates (in pixels, relative to the tilemap), and a `width` and `height` (in pixels). + * + * An object tile has a `gid` property (GID of the represented tile), a `flippedHorizontal` property, + * a `flippedVertical` property, and `flippedAntiDiagonal` property. + * The {@link http://docs.mapeditor.org/en/latest/reference/tmx-map-format/|Tiled documentation} contains + * information on flipping and rotation. + * + * Polylines have a `polyline` property, which is an array of objects corresponding to points, + * where each point has an `x` property and a `y` property. Polygons have an identically structured + * array in their `polygon` property. Text objects have a `text` property with the text's properties. + * + * Rectangles and ellipses have a `rectangle` or `ellipse` property set to `true`. + * + * @name Phaser.Tilemaps.ObjectLayer#objects + * @type {Phaser.Types.Tilemaps.TiledObject[]} + * @since 3.0.0 + */ + this.objects = GetFastValue(config, 'objects', []); + } + +}); + +module.exports = ObjectLayer; + + +/***/ }), +/* 464 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Master list of tiles -> x, y, index in tileset. + * + * @function Phaser.Tilemaps.Parsers.Tiled.BuildTilesetIndex + * @since 3.0.0 + * + * @param {Phaser.Tilemaps.MapData} mapData - [description] + * + * @return {array} [description] + */ +var BuildTilesetIndex = function (mapData) +{ + var tiles = []; + + for (var i = 0; i < mapData.tilesets.length; i++) + { + var set = mapData.tilesets[i]; + + var x = set.tileMargin; + var y = set.tileMargin; + + var count = 0; + var countX = 0; + var countY = 0; + + for (var t = set.firstgid; t < set.firstgid + set.total; t++) + { + // Can add extra properties here as needed + tiles[t] = [ x, y, i ]; + + x += set.tileWidth + set.tileSpacing; + + count++; + + if (count === set.total) + { + break; + } + + countX++; + + if (countX === set.columns) + { + x = set.tileMargin; + y += set.tileHeight + set.tileSpacing; + + countX = 0; + countY++; + + if (countY === set.rows) + { + break; + } + } + } + } + + return tiles; +}; + +module.exports = BuildTilesetIndex; + + +/***/ }), +/* 465 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(17); + +/** + * Copy properties from tileset to tiles. + * + * @function Phaser.Tilemaps.Parsers.Tiled.AssignTileProperties + * @since 3.0.0 + * + * @param {Phaser.Tilemaps.MapData} mapData - [description] + */ +var AssignTileProperties = function (mapData) +{ + var layerData; + var tile; + var sid; + var set; + var row; + + // go through each of the map data layers + for (var i = 0; i < mapData.layers.length; i++) + { + layerData = mapData.layers[i]; + + set = null; + + // rows of tiles + for (var j = 0; j < layerData.data.length; j++) + { + row = layerData.data[j]; + + // individual tiles + for (var k = 0; k < row.length; k++) + { + tile = row[k]; + + if (tile === null || tile.index < 0) + { + continue; + } + + // find the relevant tileset + sid = mapData.tiles[tile.index][2]; + set = mapData.tilesets[sid]; + + // Ensure that a tile's size matches its tileset + tile.width = set.tileWidth; + tile.height = set.tileHeight; + + // if that tile type has any properties, add them to the tile object + if (set.tileProperties && set.tileProperties[tile.index - set.firstgid]) + { + tile.properties = Extend( + tile.properties, set.tileProperties[tile.index - set.firstgid] + ); + } + } + } + } +}; + +module.exports = AssignTileProperties; + + +/***/ }), +/* 466 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Formats = __webpack_require__(31); +var MapData = __webpack_require__(103); +var ParseTileLayers = __webpack_require__(467); +var ParseTilesets = __webpack_require__(468); + +/** + * Parses a Weltmeister JSON object into a new MapData object. + * + * @function Phaser.Tilemaps.Parsers.Impact.ParseWeltmeister + * @since 3.0.0 + * + * @param {string} name - The name of the tilemap, used to set the name on the MapData. + * @param {object} json - The Weltmeister JSON object. + * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map + * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + * + * @return {?object} [description] + */ +var ParseWeltmeister = function (name, json, insertNull) +{ + if (json.layer.length === 0) + { + console.warn('No layers found in the Weltmeister map: ' + name); + return null; + } + + var width = 0; + var height = 0; + + for (var i = 0; i < json.layer.length; i++) + { + if (json.layer[i].width > width) { width = json.layer[i].width; } + if (json.layer[i].height > height) { height = json.layer[i].height; } + } + + var mapData = new MapData({ + width: width, + height: height, + name: name, + tileWidth: json.layer[0].tilesize, + tileHeight: json.layer[0].tilesize, + format: Formats.WELTMEISTER + }); + + mapData.layers = ParseTileLayers(json, insertNull); + mapData.tilesets = ParseTilesets(json); + + return mapData; +}; + +module.exports = ParseWeltmeister; + + +/***/ }), +/* 467 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var LayerData = __webpack_require__(102); +var Tile = __webpack_require__(72); + +/** + * [description] + * + * @function Phaser.Tilemaps.Parsers.Impact.ParseTileLayers + * @since 3.0.0 + * + * @param {object} json - [description] + * @param {boolean} insertNull - [description] + * + * @return {array} [description] + */ +var ParseTileLayers = function (json, insertNull) +{ + var tileLayers = []; + + for (var i = 0; i < json.layer.length; i++) + { + var layer = json.layer[i]; + + var layerData = new LayerData({ + name: layer.name, + width: layer.width, + height: layer.height, + tileWidth: layer.tilesize, + tileHeight: layer.tilesize, + visible: layer.visible === 1 + }); + + var row = []; + var tileGrid = []; + + // Loop through the data field in the JSON. This is a 2D array containing the tile indexes, + // one after the other. The indexes are relative to the tileset that contains the tile. + for (var y = 0; y < layer.data.length; y++) + { + for (var x = 0; x < layer.data[y].length; x++) + { + // In Weltmeister, 0 = no tile, but the Tilemap API expects -1 = no tile. + var index = layer.data[y][x] - 1; + + var tile; + + if (index > -1) + { + tile = new Tile(layerData, index, x, y, layer.tilesize, layer.tilesize); + } + else + { + tile = insertNull + ? null + : new Tile(layerData, -1, x, y, layer.tilesize, layer.tilesize); + } + + row.push(tile); + } + + tileGrid.push(row); + row = []; + } + + layerData.data = tileGrid; + + tileLayers.push(layerData); + } + + return tileLayers; +}; + +module.exports = ParseTileLayers; + + +/***/ }), +/* 468 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Tileset = __webpack_require__(140); + +/** + * [description] + * + * @function Phaser.Tilemaps.Parsers.Impact.ParseTilesets + * @since 3.0.0 + * + * @param {object} json - [description] + * + * @return {array} [description] + */ +var ParseTilesets = function (json) +{ + var tilesets = []; + var tilesetsNames = []; + + for (var i = 0; i < json.layer.length; i++) + { + var layer = json.layer[i]; + + // A relative filepath to the source image (within Weltmeister) is used for the name + var tilesetName = layer.tilesetName; + + // Only add unique tilesets that have a valid name. Collision layers will have a blank name. + if (tilesetName !== '' && tilesetsNames.indexOf(tilesetName) === -1) + { + tilesetsNames.push(tilesetName); + + // Tiles are stored with an ID relative to the tileset, rather than a globally unique ID + // across all tilesets. Also, tilesets in Weltmeister have no margin or padding. + tilesets.push(new Tileset(tilesetName, 0, layer.tilesize, layer.tilesize, 0, 0)); + } + } + + return tilesets; +}; + +module.exports = ParseTilesets; + + +/***/ }), +/* 469 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var DegToRad = __webpack_require__(35); +var DynamicTilemapLayer = __webpack_require__(470); +var Extend = __webpack_require__(17); +var Formats = __webpack_require__(31); +var LayerData = __webpack_require__(102); +var Rotate = __webpack_require__(305); +var SpliceOne = __webpack_require__(78); +var StaticTilemapLayer = __webpack_require__(471); +var Tile = __webpack_require__(72); +var TilemapComponents = __webpack_require__(136); +var Tileset = __webpack_require__(140); + +/** + * @callback TilemapFilterCallback + * + * @param {Phaser.GameObjects.GameObject} value - An object found in the filtered area. + * @param {number} index - The index of the object within the array. + * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found. + * + * @return {Phaser.GameObjects.GameObject} The object. + */ + +/** + * @callback TilemapFindCallback + * + * @param {Phaser.GameObjects.GameObject} value - An object found. + * @param {number} index - The index of the object within the array. + * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found. + * + * @return {boolean} `true` if the callback should be invoked, otherwise `false`. + */ + +/** + * @classdesc + * A Tilemap is a container for Tilemap data. This isn't a display object, rather, it holds data + * about the map and allows you to add tilesets and tilemap layers to it. A map can have one or + * more tilemap layers (StaticTilemapLayer or DynamicTilemapLayer), which are the display + * objects that actually render tiles. + * + * The Tilemap data be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free + * software package specifically for creating tile maps, and is available from: + * http://www.mapeditor.org + * + * A Tilemap has handy methods for getting & manipulating the tiles within a layer. You can only + * use the methods that change tiles (e.g. removeTileAt) on a DynamicTilemapLayer. + * + * Note that all Tilemaps use a base tile size to calculate dimensions from, but that a + * StaticTilemapLayer or DynamicTilemapLayer may have its own unique tile size that overrides + * it. + * + * @class Tilemap + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Tilemap belongs. + * @param {Phaser.Tilemaps.MapData} mapData - A MapData instance containing Tilemap data. + */ +var Tilemap = new Class({ + + initialize: + + function Tilemap (scene, mapData) + { + /** + * @name Phaser.Tilemaps.Tilemap#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * The base width of a tile in pixels. Note that individual layers may have a different tile + * width. + * + * @name Phaser.Tilemaps.Tilemap#tileWidth + * @type {integer} + * @since 3.0.0 + */ + this.tileWidth = mapData.tileWidth; + + /** + * The base height of a tile in pixels. Note that individual layers may have a different + * tile height. + * + * @name Phaser.Tilemaps.Tilemap#tileHeight + * @type {integer} + * @since 3.0.0 + */ + this.tileHeight = mapData.tileHeight; + + /** + * The width of the map (in tiles). + * + * @name Phaser.Tilemaps.Tilemap#width + * @type {number} + * @since 3.0.0 + */ + this.width = mapData.width; + + /** + * The height of the map (in tiles). + * + * @name Phaser.Tilemaps.Tilemap#height + * @type {number} + * @since 3.0.0 + */ + this.height = mapData.height; + + /** + * The orientation of the map data (as specified in Tiled), usually 'orthogonal'. + * + * @name Phaser.Tilemaps.Tilemap#orientation + * @type {string} + * @since 3.0.0 + */ + this.orientation = mapData.orientation; + + /** + * The render (draw) order of the map data (as specified in Tiled), usually 'right-down'. + * + * The draw orders are: + * + * right-down + * left-down + * right-up + * left-up + * + * This can be changed via the `setRenderOrder` method. + * + * @name Phaser.Tilemaps.Tilemap#renderOrder + * @type {string} + * @since 3.12.0 + */ + this.renderOrder = mapData.renderOrder; + + /** + * The format of the map data. + * + * @name Phaser.Tilemaps.Tilemap#format + * @type {number} + * @since 3.0.0 + */ + this.format = mapData.format; + + /** + * The version of the map data (as specified in Tiled, usually 1). + * + * @name Phaser.Tilemaps.Tilemap#version + * @type {number} + * @since 3.0.0 + */ + this.version = mapData.version; + + /** + * Map specific properties as specified in Tiled. + * + * @name Phaser.Tilemaps.Tilemap#properties + * @type {object} + * @since 3.0.0 + */ + this.properties = mapData.properties; + + /** + * The width of the map in pixels based on width * tileWidth. + * + * @name Phaser.Tilemaps.Tilemap#widthInPixels + * @type {number} + * @since 3.0.0 + */ + this.widthInPixels = mapData.widthInPixels; + + /** + * The height of the map in pixels based on height * tileHeight. + * + * @name Phaser.Tilemaps.Tilemap#heightInPixels + * @type {number} + * @since 3.0.0 + */ + this.heightInPixels = mapData.heightInPixels; + + /** + * + * @name Phaser.Tilemaps.Tilemap#imageCollections + * @type {Phaser.Tilemaps.ImageCollection[]} + * @since 3.0.0 + */ + this.imageCollections = mapData.imageCollections; + + /** + * An array of Tiled Image Layers. + * + * @name Phaser.Tilemaps.Tilemap#images + * @type {array} + * @since 3.0.0 + */ + this.images = mapData.images; + + /** + * An array of Tilemap layer data. + * + * @name Phaser.Tilemaps.Tilemap#layers + * @type {Phaser.Tilemaps.LayerData[]} + * @since 3.0.0 + */ + this.layers = mapData.layers; + + /** + * An array of Tilesets used in the map. + * + * @name Phaser.Tilemaps.Tilemap#tilesets + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.0.0 + */ + this.tilesets = mapData.tilesets; + + /** + * An array of ObjectLayer instances parsed from Tiled object layers. + * + * @name Phaser.Tilemaps.Tilemap#objects + * @type {Phaser.Tilemaps.ObjectLayer[]} + * @since 3.0.0 + */ + this.objects = mapData.objects; + + /** + * The index of the currently selected LayerData object. + * + * @name Phaser.Tilemaps.Tilemap#currentLayerIndex + * @type {integer} + * @since 3.0.0 + */ + this.currentLayerIndex = 0; + }, + + /** + * Sets the rendering (draw) order of the tiles in this map. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * + * Calling this method _after_ creating Static or Dynamic Tilemap Layers will **not** automatically + * update them to use the new render order. If you call this method after creating layers, use their + * own `setRenderOrder` methods to change them as needed. + * + * @method Phaser.Tilemaps.Tilemap#setRenderOrder + * @since 3.12.0 + * + * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * + * @return {this} This Tilemap object. + */ + setRenderOrder: function (renderOrder) + { + var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; + + if (typeof renderOrder === 'number') + { + renderOrder = orders[renderOrder]; + } + + if (orders.indexOf(renderOrder) > -1) + { + this.renderOrder = renderOrder; + } + + return this; + }, + + /** + * Adds an image to the map to be used as a tileset. A single map may use multiple tilesets. + * Note that the tileset name can be found in the JSON file exported from Tiled, or in the Tiled + * editor. + * + * @method Phaser.Tilemaps.Tilemap#addTilesetImage + * @since 3.0.0 + * + * @param {string} tilesetName - The name of the tileset as specified in the map data. + * @param {string} [key] - The key of the Phaser.Cache image used for this tileset. If + * `undefined` or `null` it will look for an image with a key matching the tilesetName parameter. + * @param {integer} [tileWidth] - The width of the tile (in pixels) in the Tileset Image. If not + * given it will default to the map's tileWidth value, or the tileWidth specified in the Tiled + * JSON file. + * @param {integer} [tileHeight] - The height of the tiles (in pixels) in the Tileset Image. If + * not given it will default to the map's tileHeight value, or the tileHeight specified in the + * Tiled JSON file. + * @param {integer} [tileMargin] - The margin around the tiles in the sheet (in pixels). If not + * specified, it will default to 0 or the value specified in the Tiled JSON file. + * @param {integer} [tileSpacing] - The spacing between each the tile in the sheet (in pixels). + * If not specified, it will default to 0 or the value specified in the Tiled JSON file. + * @param {integer} [gid=0] - If adding multiple tilesets to a blank map, specify the starting + * GID this set will use here. + * + * @return {?Phaser.Tilemaps.Tileset} Returns the Tileset object that was created or updated, or null if it + * failed. + */ + addTilesetImage: function (tilesetName, key, tileWidth, tileHeight, tileMargin, tileSpacing, gid) + { + if (tilesetName === undefined) { return null; } + if (key === undefined || key === null) { key = tilesetName; } + + if (!this.scene.sys.textures.exists(key)) + { + console.warn('Invalid Tileset Image: ' + key); + return null; + } + + var texture = this.scene.sys.textures.get(key); + + var index = this.getTilesetIndex(tilesetName); + + if (index === null && this.format === Formats.TILED_JSON) + { + console.warn('No data found for Tileset: ' + tilesetName); + return null; + } + + var tileset = this.tilesets[index]; + + if (tileset) + { + tileset.setTileSize(tileWidth, tileHeight); + tileset.setSpacing(tileMargin, tileSpacing); + tileset.setImage(texture); + + return tileset; + } + + if (tileWidth === undefined) { tileWidth = this.tileWidth; } + if (tileHeight === undefined) { tileHeight = this.tileHeight; } + if (tileMargin === undefined) { tileMargin = 0; } + if (tileSpacing === undefined) { tileSpacing = 0; } + if (gid === undefined) { gid = 0; } + + tileset = new Tileset(tilesetName, gid, tileWidth, tileHeight, tileMargin, tileSpacing); + + tileset.setImage(texture); + + this.tilesets.push(tileset); + + return tileset; + }, + + /** + * Turns the DynamicTilemapLayer associated with the given layer into a StaticTilemapLayer. If + * no layer specified, the map's current layer is used. This is useful if you want to manipulate + * a map at the start of a scene, but then make it non-manipulable and optimize it for speed. + * Note: the DynamicTilemapLayer passed in is destroyed, so make sure to store the value + * returned from this method if you want to manipulate the new StaticTilemapLayer. + * + * @method Phaser.Tilemaps.Tilemap#convertLayerToStatic + * @since 3.0.0 + * + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer)} [layer] - The name of the layer from Tiled, the + * index of the layer in the map, or a DynamicTilemapLayer. + * + * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer that was created, or null if it + * failed. + */ + convertLayerToStatic: function (layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + var dynamicLayer = layer.tilemapLayer; + + if (!dynamicLayer || !(dynamicLayer instanceof DynamicTilemapLayer)) + { + return null; + } + + var staticLayer = new StaticTilemapLayer( + dynamicLayer.scene, + dynamicLayer.tilemap, + dynamicLayer.layerIndex, + dynamicLayer.tileset, + dynamicLayer.x, + dynamicLayer.y + ); + + this.scene.sys.displayList.add(staticLayer); + + dynamicLayer.destroy(); + + return staticLayer; + }, + + /** + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * + * If no layer specified, the map's current layer is used. This cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#copy + * @since 3.0.0 + * + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. + */ + copy: function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'copy')) { return this; } + + if (layer !== null) + { + TilemapComponents.Copy( + srcTileX, srcTileY, + width, height, + destTileX, destTileY, + recalculateFaces, layer + ); + + return this; + } + else + { + return null; + } + }, + + /** + * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer. + * + * @method Phaser.Tilemaps.Tilemap#createBlankDynamicLayer + * @since 3.0.0 + * + * @param {string} name - The name of this layer. Must be unique within the map. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} [x=0] - The world x position where the top left of this layer will be placed. + * @param {number} [y=0] - The world y position where the top left of this layer will be placed. + * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default to the map's width. + * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default to the map's height. + * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. + * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. + * + * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer that was created, or `null` if it failed. + */ + createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.width; } + if (height === undefined) { height = this.height; } + if (tileWidth === undefined) { tileWidth = this.tileWidth; } + if (tileHeight === undefined) { tileHeight = this.tileHeight; } + + var index = this.getLayerIndex(name); + + if (index !== null) + { + console.warn('Invalid Tilemap Layer ID: ' + name); + return null; + } + + var layerData = new LayerData({ + name: name, + tileWidth: tileWidth, + tileHeight: tileHeight, + width: width, + height: height + }); + + var row; + + for (var tileY = 0; tileY < height; tileY++) + { + row = []; + + for (var tileX = 0; tileX < width; tileX++) + { + row.push(new Tile(layerData, -1, tileX, tileY, tileWidth, tileHeight, this.tileWidth, this.tileHeight)); + } + + layerData.data.push(row); + } + + this.layers.push(layerData); + + this.currentLayerIndex = this.layers.length - 1; + + var dynamicLayer = new DynamicTilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y); + + dynamicLayer.setRenderOrder(this.renderOrder); + + this.scene.sys.displayList.add(dynamicLayer); + + return dynamicLayer; + }, + + /** + * Creates a new DynamicTilemapLayer that renders the LayerData associated with the given + * `layerID`. The currently selected layer in the map is set to this new layer. + * + * The `layerID` is important. If you've created your map in Tiled then you can get this by + * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and + * look at the layers[].name value. Either way it must match. + * + * Unlike a static layer, a dynamic layer can be modified. See DynamicTilemapLayer for more + * information. + * + * @method Phaser.Tilemaps.Tilemap#createDynamicLayer + * @since 3.0.0 + * + * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} [x=0] - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. + * @param {number} [y=0] - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. + * + * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed. + */ + createDynamicLayer: function (layerID, tileset, x, y) + { + var index = this.getLayerIndex(layerID); + + if (index === null) + { + console.warn('Invalid Tilemap Layer ID: ' + layerID); + return null; + } + + var layerData = this.layers[index]; + + // Check for an associated static or dynamic tilemap layer + if (layerData.tilemapLayer) + { + console.warn('Tilemap Layer ID already exists:' + layerID); + return null; + } + + this.currentLayerIndex = index; + + // Default the x/y position to match Tiled layer offset, if it exists. + + if (x === undefined) + { + x = layerData.x; + } + + if (y === undefined) + { + y = layerData.y; + } + + var layer = new DynamicTilemapLayer(this.scene, this, index, tileset, x, y); + + layer.setRenderOrder(this.renderOrder); + + this.scene.sys.displayList.add(layer); + + return layer; + }, + + /** + * Creates a Sprite for every object matching the given gid in the map data. All properties from + * the map data objectgroup are copied into the `spriteConfig`, so you can use this as an easy + * way to configure Sprite properties from within the map editor. For example giving an object a + * property of alpha: 0.5 in the map editor will duplicate that when the Sprite is created. + * + * Custom object properties not sharing names with the Sprite's own properties are copied to the + * Sprite's {@link Phaser.GameObjects.Sprite#data data store}. + * + * @method Phaser.Tilemaps.Tilemap#createFromObjects + * @since 3.0.0 + * + * @param {string} name - The name of the object layer (from Tiled) to create Sprites from. + * @param {(integer|string)} id - Either the id (object), gid (tile object) or name (object or + * tile object) from Tiled. Ids are unique in Tiled, but a gid is shared by all tile objects + * with the same graphic. The same name can be used on multiple objects. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. + * scene.make.sprite). + * @param {Phaser.Scene} [scene=the scene the map is within] - The Scene to create the Sprites within. + * + * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. + */ + createFromObjects: function (name, id, spriteConfig, scene) + { + if (spriteConfig === undefined) { spriteConfig = {}; } + if (scene === undefined) { scene = this.scene; } + + var objectLayer = this.getObjectLayer(name); + + if (!objectLayer) + { + console.warn('Cannot create from object. Invalid objectgroup name given: ' + name); + return; + } + + var objects = objectLayer.objects; + var sprites = []; + + for (var i = 0; i < objects.length; i++) + { + var found = false; + var obj = objects[i]; + + if (obj.gid !== undefined && typeof id === 'number' && obj.gid === id || + obj.id !== undefined && typeof id === 'number' && obj.id === id || + obj.name !== undefined && typeof id === 'string' && obj.name === id) + { + found = true; + } + + if (found) + { + var config = Extend({}, spriteConfig, obj.properties); + + config.x = obj.x; + config.y = obj.y; + + var sprite = this.scene.make.sprite(config); + + sprite.name = obj.name; + + if (obj.width) { sprite.displayWidth = obj.width; } + if (obj.height) { sprite.displayHeight = obj.height; } + + // Origin is (0, 1) in Tiled, so find the offset that matches the Sprite's origin. + var offset = { + x: sprite.originX * sprite.displayWidth, + y: (sprite.originY - 1) * sprite.displayHeight + }; + + // If the object is rotated, then the origin offset also needs to be rotated. + if (obj.rotation) + { + var angle = DegToRad(obj.rotation); + Rotate(offset, angle); + sprite.rotation = angle; + } + + sprite.x += offset.x; + sprite.y += offset.y; + + if (obj.flippedHorizontal !== undefined || obj.flippedVertical !== undefined) + { + sprite.setFlip(obj.flippedHorizontal, obj.flippedVertical); + } + + if (!obj.visible) { sprite.visible = false; } + + for (var key in obj.properties) + { + if (sprite.hasOwnProperty(key)) + { + continue; + } + + sprite.setData(key, obj.properties[key]); + } + + sprites.push(sprite); + } + } + + return sprites; + }, + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * + * @method Phaser.Tilemaps.Tilemap#createFromTiles + * @since 3.0.0 + * + * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted + * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a + * one-to-one mapping with the indexes array. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). + * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.GameObjects.Sprite[]} Returns an array of Tiles, or null if the layer given was invalid. + */ + createFromTiles: function (indexes, replacements, spriteConfig, scene, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, layer); + }, + + /** + * Creates a new StaticTilemapLayer that renders the LayerData associated with the given + * `layerID`. The currently selected layer in the map is set to this new layer. + * + * The `layerID` is important. If you've created your map in Tiled then you can get this by + * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and + * look at the layers[].name value. Either way it must match. + * + * It's important to remember that a static layer cannot be modified. See StaticTilemapLayer for + * more information. + * + * @method Phaser.Tilemaps.Tilemap#createStaticLayer + * @since 3.0.0 + * + * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} [x=0] - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. + * @param {number} [y=0] - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. + * + * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer was created, or null if it failed. + */ + createStaticLayer: function (layerID, tileset, x, y) + { + var index = this.getLayerIndex(layerID); + + if (index === null) + { + console.warn('Invalid Tilemap Layer ID: ' + layerID); + return null; + } + + var layerData = this.layers[index]; + + // Check for an associated static or dynamic tilemap layer + if (layerData.tilemapLayer) + { + console.warn('Tilemap Layer ID already exists:' + layerID); + return null; + } + + this.currentLayerIndex = index; + + // Default the x/y position to match Tiled layer offset, if it exists. + if (x === undefined && this.layers[index].x) { x = this.layers[index].x; } + if (y === undefined && this.layers[index].y) { y = this.layers[index].y; } + + var layer = new StaticTilemapLayer(this.scene, this, index, tileset, x, y); + + layer.setRenderOrder(this.renderOrder); + + this.scene.sys.displayList.add(layer); + + return layer; + }, + + /** + * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any + * StaticTilemapLayers or DynamicTilemapLayers that have been linked to LayerData. + * + * @method Phaser.Tilemaps.Tilemap#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.removeAllLayers(); + this.tilesets.length = 0; + this.objects.length = 0; + this.scene = undefined; + }, + + /** + * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the + * specified index. Tiles will be set to collide if the given index is a colliding index. + * Collision information in the region will be recalculated. + * + * If no layer specified, the map's current layer is used. + * This cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#fill + * @since 3.0.0 + * + * @param {integer} index - The tile index to fill the area with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. + */ + fill: function (index, tileX, tileY, width, height, recalculateFaces, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + if (this._isStaticCall(layer, 'fill')) { return this; } + + TilemapComponents.Fill(index, tileX, tileY, width, height, recalculateFaces, layer); + + return this; + }, + + /** + * For each object in the given object layer, run the given filter callback function. Any + * objects that pass the filter test (i.e. where the callback returns true) will returned as a + * new array. Similar to Array.prototype.Filter in vanilla JS. + * + * @method Phaser.Tilemaps.Tilemap#filterObjects + * @since 3.0.0 + * + * @param {(Phaser.Tilemaps.ObjectLayer|string)} objectLayer - The name of an object layer (from Tiled) or an ObjectLayer instance. + * @param {TilemapFilterCallback} callback - The callback. Each object in the given area will be passed to this callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * + * @return {?Phaser.GameObjects.GameObject[]} An array of object that match the search, or null if the objectLayer given was invalid. + */ + filterObjects: function (objectLayer, callback, context) + { + if (typeof objectLayer === 'string') + { + var name = objectLayer; + + objectLayer = this.getObjectLayer(objectLayer); + + if (!objectLayer) + { + console.warn('No object layer found with the name: ' + name); + return null; + } + } + + return objectLayer.objects.filter(callback, context); + }, + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#filterTiles + * @since 3.0.0 + * + * @param {function} callback - The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. + */ + filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, layer); + }, + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#findByIndex + * @since 3.0.0 + * + * @param {integer} index - The tile index value to search for. + * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. + * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. + */ + findByIndex: function (findIndex, skip, reverse, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.FindByIndex(findIndex, skip, reverse, layer); + }, + + /** + * Find the first object in the given object layer that satisfies the provided testing function. + * I.e. finds the first object for which `callback` returns true. Similar to + * Array.prototype.find in vanilla JS. + * + * @method Phaser.Tilemaps.Tilemap#findObject + * @since 3.0.0 + * + * @param {(Phaser.Tilemaps.ObjectLayer|string)} objectLayer - The name of an object layer (from Tiled) or an ObjectLayer instance. + * @param {TilemapFindCallback} callback - The callback. Each object in the given area will be passed to this callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * + * @return {?Phaser.GameObjects.GameObject} An object that matches the search, or null if no object found. + */ + findObject: function (objectLayer, callback, context) + { + if (typeof objectLayer === 'string') + { + var name = objectLayer; + + objectLayer = this.getObjectLayer(objectLayer); + + if (!objectLayer) + { + console.warn('No object layer found with the name: ' + name); + return null; + } + } + + return objectLayer.objects.find(callback, context) || null; + }, + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#findTile + * @since 3.0.0 + * + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. + * + * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. + */ + findTile: function (callback, context, tileX, tileY, width, height, filteringOptions, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, layer); + }, + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#forEachTile + * @since 3.0.0 + * + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. + * + * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. + */ + forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, layer); + + return this; + }, + + /** + * Gets the image layer index based on its name. + * + * @method Phaser.Tilemaps.Tilemap#getImageIndex + * @since 3.0.0 + * + * @param {string} name - The name of the image to get. + * + * @return {integer} The index of the image in this tilemap, or null if not found. + */ + getImageIndex: function (name) + { + return this.getIndex(this.images, name); + }, + + /** + * Internally used. Returns the index of the object in one of the Tilemaps arrays whose name + * property matches the given `name`. + * + * @method Phaser.Tilemaps.Tilemap#getIndex + * @since 3.0.0 + * + * @param {array} location - The Tilemap array to search. + * @param {string} name - The name of the array element to get. + * + * @return {number} The index of the element in the array, or null if not found. + */ + getIndex: function (location, name) + { + for (var i = 0; i < location.length; i++) + { + if (location[i].name === name) + { + return i; + } + } + + return null; + }, + + /** + * Gets the LayerData from this.layers that is associated with `layer`, or null if an invalid + * `layer` is given. + * + * @method Phaser.Tilemaps.Tilemap#getLayer + * @since 3.0.0 + * + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the maps current layer index. + * + * @return {Phaser.Tilemaps.LayerData} The corresponding LayerData within this.layers. + */ + getLayer: function (layer) + { + var index = this.getLayerIndex(layer); + + return (index !== null) ? this.layers[index] : null; + }, + + /** + * Gets the ObjectLayer from this.objects that has the given `name`, or null if no ObjectLayer + * is found with that name. + * + * @method Phaser.Tilemaps.Tilemap#getObjectLayer + * @since 3.0.0 + * + * @param {string} [name] - The name of the object layer from Tiled. + * + * @return {?Phaser.Tilemaps.ObjectLayer} The corresponding ObjectLayer within this.objects or null. + */ + getObjectLayer: function (name) + { + var index = this.getIndex(this.objects, name); + + return (index !== null) ? this.objects[index] : null; + }, + + /** + * Gets the LayerData index of the given `layer` within this.layers, or null if an invalid + * `layer` is given. + * + * @method Phaser.Tilemaps.Tilemap#getLayerIndex + * @since 3.0.0 + * + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the map's current layer index. + * + * @return {integer} The LayerData index within this.layers. + */ + getLayerIndex: function (layer) + { + if (layer === undefined) + { + return this.currentLayerIndex; + } + else if (typeof layer === 'string') + { + return this.getLayerIndexByName(layer); + } + else if (typeof layer === 'number' && layer < this.layers.length) + { + return layer; + } + else if (layer instanceof StaticTilemapLayer || layer instanceof DynamicTilemapLayer) + { + return layer.layerIndex; + } + else + { + return null; + } + }, + + /** + * Gets the index of the LayerData within this.layers that has the given `name`, or null if an + * invalid `name` is given. + * + * @method Phaser.Tilemaps.Tilemap#getLayerIndexByName + * @since 3.0.0 + * + * @param {string} name - The name of the layer to get. + * + * @return {integer} The LayerData index within this.layers. + */ + getLayerIndexByName: function (name) + { + return this.getIndex(this.layers, name); + }, + + /** + * Gets a tile at the given tile coordinates from the given layer. + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#getTileAt + * @since 3.0.0 + * + * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. + */ + getTileAt: function (tileX, tileY, nonNull, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.GetTileAt(tileX, tileY, nonNull, layer); + }, + + /** + * Gets a tile at the given world coordinates from the given layer. + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#getTileAtWorldXY + * @since 3.0.0 + * + * @param {number} worldX - X position to get the tile from (given in pixels) + * @param {number} worldY - Y position to get the tile from (given in pixels) + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. + */ + getTileAtWorldXY: function (worldX, worldY, nonNull, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, layer); + }, + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#getTilesWithin + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. + */ + getTilesWithin: function (tileX, tileY, width, height, filteringOptions, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + }, + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#getTilesWithinShape + * @since 3.0.0 + * + * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. + */ + getTilesWithinShape: function (shape, filteringOptions, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, layer); + }, + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#getTilesWithinWorldXY + * @since 3.0.0 + * + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. + */ + getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, layer); + }, + + /** + * Gets the Tileset that has the given `name`, or null if an invalid `name` is given. + * + * @method Phaser.Tilemaps.Tilemap#getTileset + * @since 3.14.0 + * + * @param {string} name - The name of the Tileset to get. + * + * @return {?Phaser.Tilemaps.Tileset} The Tileset, or `null` if no matching named tileset was found. + */ + getTileset: function (name) + { + var index = this.getIndex(this.tilesets, name); + + return (index !== null) ? this.tilesets[index] : null; + }, + + /** + * Gets the index of the Tileset within this.tilesets that has the given `name`, or null if an + * invalid `name` is given. + * + * @method Phaser.Tilemaps.Tilemap#getTilesetIndex + * @since 3.0.0 + * + * @param {string} name - The name of the Tileset to get. + * + * @return {integer} The Tileset index within this.tilesets. + */ + getTilesetIndex: function (name) + { + return this.getIndex(this.tilesets, name); + }, + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#hasTileAt + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?boolean} Returns a boolean, or null if the layer given was invalid. + */ + hasTileAt: function (tileX, tileY, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.HasTileAt(tileX, tileY, layer); + }, + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#hasTileAtWorldXY + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?boolean} Returns a boolean, or null if the layer given was invalid. + */ + hasTileAtWorldXY: function (worldX, worldY, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, layer); + }, + + /** + * The LayerData object that is currently selected in the map. You can set this property using + * any type supported by setLayer. + * + * @name Phaser.Tilemaps.Tilemap#layer + * @type {Phaser.Tilemaps.LayerData} + * @since 3.0.0 + */ + layer: { + get: function () + { + return this.layers[this.currentLayerIndex]; + }, + + set: function (layer) + { + this.setLayer(layer); + } + }, + + /** + * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index + * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified + * location. If you pass in an index, only the index at the specified location will be changed. + * Collision information will be recalculated at the specified location. + * + * If no layer specified, the maps current layer is used. + * + * This cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#putTileAt + * @since 3.0.0 + * + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid or the coordinates were out of bounds. + */ + putTileAt: function (tile, tileX, tileY, recalculateFaces, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'putTileAt')) { return null; } + + if (layer === null) { return null; } + + return TilemapComponents.PutTileAt(tile, tileX, tileY, recalculateFaces, layer); + }, + + /** + * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either + * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the + * specified location. If you pass in an index, only the index at the specified location will be + * changed. Collision information will be recalculated at the specified location. + * + * If no layer specified, the maps current layer is used. This + * cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#putTileAtWorldXY + * @since 3.0.0 + * + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. + */ + putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'putTileAtWorldXY')) { return null; } + + if (layer === null) { return null; } + + return TilemapComponents.PutTileAtWorldXY(tile, worldX, worldY, recalculateFaces, camera, layer); + }, + + /** + * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified + * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, + * all attributes will be copied over to the specified location. If you pass in an index, only the + * index at the specified location will be changed. Collision information will be recalculated + * within the region tiles were changed. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#putTilesAt + * @since 3.0.0 + * + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. + */ + putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'putTilesAt')) { return this; } + + if (layer === null) { return null; } + + TilemapComponents.PutTilesAt(tilesArray, tileX, tileY, recalculateFaces, layer); + + return this; + }, + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then + * those will be used for randomly assigning new tile indexes. If an array is not provided, the + * indexes found within the region (excluding -1) will be used for randomly assigning new tile + * indexes. This method only modifies tile indexes and does not change collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#randomize + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. + */ + randomize: function (tileX, tileY, width, height, indexes, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'randomize')) { return this; } + + if (layer === null) { return null; } + + TilemapComponents.Randomize(tileX, tileY, width, height, indexes, layer); + + return this; + }, + + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#calculateFacesAt + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. + */ + calculateFacesAt: function (tileX, tileY, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.CalculateFacesAt(tileX, tileY, layer); + + return this; + }, + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#calculateFacesWithin + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. + */ + calculateFacesWithin: function (tileX, tileY, width, height, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.CalculateFacesWithin(tileX, tileY, width, height, layer); + + return this; + }, + + /** + * Removes the given TilemapLayer from this Tilemap without destroying it. + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#removeLayer + * @since 3.17.0 + * + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to be removed. + * + * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. + */ + removeLayer: function (layer) + { + var index = this.getLayerIndex(layer); + + if (index !== null) + { + SpliceOne(this.layers, index); + + if (this.currentLayerIndex === index) + { + this.currentLayerIndex = 0; + } + + return this; + } + else + { + return null; + } + }, + + /** + * Destroys the given TilemapLayer and removes it from this Tilemap. + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#destroyLayer + * @since 3.17.0 + * + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to be destroyed. + * + * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. + */ + destroyLayer: function (layer) + { + var index = this.getLayerIndex(layer); + + if (index !== null) + { + layer = this.layers[index]; + + layer.destroy(); + + SpliceOne(this.layers, index); + + if (this.currentLayerIndex === index) + { + this.currentLayerIndex = 0; + } + + return this; + } + else + { + return null; + } + }, + + /** + * Removes all layers from this Tilemap and destroys any associated StaticTilemapLayers or + * DynamicTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#removeAllLayers + * @since 3.0.0 + * + * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + */ + removeAllLayers: function () + { + var layers = this.layers; + + // Destroy any StaticTilemapLayers or DynamicTilemapLayers that are stored in LayerData + for (var i = 0; i < layers.length; i++) + { + if (layers[i].tilemapLayer) + { + layers[i].tilemapLayer.destroy(false); + } + } + + layers.length = 0; + + this.currentLayerIndex = 0; + + return this; + }, + + /** + * Removes the given Tile, or an array of Tiles, from the layer to which they belong, + * and optionally recalculates the collision information. + * + * This cannot be applied to Tiles that belong to Static Tilemap Layers. + * + * @method Phaser.Tilemaps.Tilemap#removeTile + * @since 3.17.0 + * + * @param {(Phaser.Tilemaps.Tile|Phaser.Tilemaps.Tile[])} tiles - The Tile to remove, or an array of Tiles. + * @param {integer} [replaceIndex=-1] - After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * + * @return {Phaser.Tilemaps.Tile[]} Returns an array of Tiles that were removed. + */ + removeTile: function (tiles, replaceIndex, recalculateFaces) + { + if (replaceIndex === undefined) { replaceIndex = -1; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + + var removed = []; + + if (!Array.isArray(tiles)) + { + tiles = [ tiles ]; + } + + for (var i = 0; i < tiles.length; i++) + { + var tile = tiles[i]; + + removed.push(this.removeTileAt(tile.x, tile.y, true, recalculateFaces, tile.tilemapLayer)); + + if (replaceIndex > -1) + { + this.putTileAt(replaceIndex, tile.x, tile.y, recalculateFaces, tile.tilemapLayer); + } + } + + return removed; + }, + + /** + * Removes the tile at the given tile coordinates in the specified layer and updates the layer's + * collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#removeTileAt + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile} Returns the Tile that was removed, or null if the layer given was invalid. + */ + removeTileAt: function (tileX, tileY, replaceWithNull, recalculateFaces, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'removeTileAt')) { return null; } + + if (layer === null) { return null; } + + return TilemapComponents.RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, layer); + }, + + /** + * Removes the tile at the given world coordinates in the specified layer and updates the layer's + * collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#removeTileAtWorldXY + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. + */ + removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'removeTileAtWorldXY')) { return null; } + + if (layer === null) { return null; } + + return TilemapComponents.RemoveTileAtWorldXY(worldX, worldY, replaceWithNull, recalculateFaces, camera, layer); + }, + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#renderDebug + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. + * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + renderDebug: function (graphics, styleConfig, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.RenderDebug(graphics, styleConfig, layer); + + return this; + }, + + /** + * Draws a debug representation of all layers within this Tilemap to the given Graphics object. + * + * This is helpful when you want to get a quick idea of which of your tiles are colliding and which + * have interesting faces. The tiles are drawn starting at (0, 0) in the Graphics, allowing you to + * place the debug representation wherever you want on the screen. + * + * @method Phaser.Tilemaps.Tilemap#renderDebugFull + * @since 3.17.0 + * + * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. + * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + renderDebugFull: function (graphics, styleConfig) + { + var layers = this.layers; + + // Destroy any StaticTilemapLayers or DynamicTilemapLayers that are stored in LayerData + for (var i = 0; i < layers.length; i++) + { + TilemapComponents.RenderDebug(graphics, styleConfig, layers[i]); + } + + return this; + }, + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does + * not change collision information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#replaceByIndex + * @since 3.0.0 + * + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + replaceByIndex: function (findIndex, newIndex, tileX, tileY, width, height, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'replaceByIndex')) { return this; } + + if (layer === null) { return null; } + + TilemapComponents.ReplaceByIndex(findIndex, newIndex, tileX, tileY, width, height, layer); + + return this; + }, + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#setCollision + * @since 3.0.0 + * + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + setCollision: function (indexes, collides, recalculateFaces, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.SetCollision(indexes, collides, recalculateFaces, layer); + + return this; + }, + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#setCollisionBetween + * @since 3.0.0 + * + * @param {integer} start - The first index of the tile to be set for collision. + * @param {integer} stop - The last index of the tile to be set for collision. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + setCollisionBetween: function (start, stop, collides, recalculateFaces, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, layer); + + return this; + }, + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#setCollisionByProperty + * @since 3.0.0 + * + * @param {object} properties - An object with tile properties and corresponding values that should be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + setCollisionByProperty: function (properties, collides, recalculateFaces, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, layer); + + return this; + }, + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#setCollisionByExclusion + * @since 3.0.0 + * + * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + setCollisionByExclusion: function (indexes, collides, recalculateFaces, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, layer); + + return this; + }, + + /** + * Sets collision on the tiles within a layer by checking each tile's collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tile's collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#setCollisionFromCollisionGroup + * @since 3.0.0 + * + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + setCollisionFromCollisionGroup: function (collides, recalculateFaces, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, layer); + + return this; + }, + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#setTileIndexCallback + * @since 3.0.0 + * + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {function} callback - The callback that will be invoked when the tile is collided with. + * @param {object} callbackContext - The context under which the callback is called. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + setTileIndexCallback: function (indexes, callback, callbackContext, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, layer); + + return this; + }, + + /** + * Sets a collision callback for the given rectangular area (in tile coordindates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * + * If no layer specified, the map's current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#setTileLocationCallback + * @since 3.0.0 + * + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {function} callback - The callback that will be invoked when the tile is collided with. + * @param {object} [callbackContext] - The context under which the callback is called. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, layer); + + return this; + }, + + /** + * Sets the current layer to the LayerData associated with `layer`. + * + * @method Phaser.Tilemaps.Tilemap#setLayer + * @since 3.0.0 + * + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the map's current layer index. + * + * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + */ + setLayer: function (layer) + { + var index = this.getLayerIndex(layer); + + if (index !== null) + { + this.currentLayerIndex = index; + } + + return this; + }, + + /** + * Sets the base tile size for the map. Note: this does not necessarily match the tileWidth and + * tileHeight for all layers. This also updates the base size on all tiles across all layers. + * + * @method Phaser.Tilemaps.Tilemap#setBaseTileSize + * @since 3.0.0 + * + * @param {integer} tileWidth - The width of the tiles the map uses for calculations. + * @param {integer} tileHeight - The height of the tiles the map uses for calculations. + * + * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + */ + setBaseTileSize: function (tileWidth, tileHeight) + { + this.tileWidth = tileWidth; + this.tileHeight = tileHeight; + this.widthInPixels = this.width * tileWidth; + this.heightInPixels = this.height * tileHeight; + + // Update the base tile size on all layers & tiles + for (var i = 0; i < this.layers.length; i++) + { + this.layers[i].baseTileWidth = tileWidth; + this.layers[i].baseTileHeight = tileHeight; + + var mapData = this.layers[i].data; + var mapWidth = this.layers[i].width; + var mapHeight = this.layers[i].height; + + for (var row = 0; row < mapHeight; row++) + { + for (var col = 0; col < mapWidth; col++) + { + var tile = mapData[row][col]; + + if (tile !== null) + { + tile.setSize(undefined, undefined, tileWidth, tileHeight); + } + } + } + } + + return this; + }, + + /** + * Sets the tile size for a specific `layer`. Note: this does not necessarily match the map's + * tileWidth and tileHeight for all layers. This will set the tile size for the layer and any + * tiles the layer has. + * + * @method Phaser.Tilemaps.Tilemap#setLayerTileSize + * @since 3.0.0 + * + * @param {integer} tileWidth - The width of the tiles (in pixels) in the layer. + * @param {integer} tileHeight - The height of the tiles (in pixels) in the layer. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the + * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a + * StaticTilemapLayer. If not given will default to the map's current layer index. + * + * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + */ + setLayerTileSize: function (tileWidth, tileHeight, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return this; } + + layer.tileWidth = tileWidth; + layer.tileHeight = tileHeight; + + var mapData = layer.data; + var mapWidth = layer.width; + var mapHeight = layer.height; + + for (var row = 0; row < mapHeight; row++) + { + for (var col = 0; col < mapWidth; col++) + { + var tile = mapData[row][col]; + + if (tile !== null) + { + tile.setSize(tileWidth, tileHeight); + } + } + } + + return this; + }, + + /** + * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given + * layer. It will only randomize the tiles in that area, so if they're all the same nothing will + * appear to have changed! This method only modifies tile indexes and does not change collision + * information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#shuffle + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + shuffle: function (tileX, tileY, width, height, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'shuffle')) { return this; } + + if (layer === null) { return null; } + + TilemapComponents.Shuffle(tileX, tileY, width, height, layer); + + return this; + }, + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision + * information. + * + * If no layer specified, the maps current layer is used. + * This cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#swapByIndex + * @since 3.0.0 + * + * @param {integer} tileA - First tile index. + * @param {integer} tileB - Second tile index. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + swapByIndex: function (indexA, indexB, tileX, tileY, width, height, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'swapByIndex')) { return this; } + + if (layer === null) { return null; } + + TilemapComponents.SwapByIndex(indexA, indexB, tileX, tileY, width, height, layer); + + return this; + }, + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#tileToWorldX + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?number} Returns a number, or null if the layer given was invalid. + */ + tileToWorldX: function (tileX, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.TileToWorldX(tileX, camera, layer); + }, + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#tileToWorldY + * @since 3.0.0 + * + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer + * to use. If not given the current layer is used. + * + * @return {?number} Returns a number, or null if the layer given was invalid. + */ + tileToWorldY: function (tileX, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.TileToWorldY(tileX, camera, layer); + }, + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#tileToWorldXY + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. + */ + tileToWorldXY: function (tileX, tileY, point, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, layer); + }, + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. New indexes are drawn from the given + * weightedIndexes array. An example weighted array: + * + * [ + * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 + * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 + * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 + * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 + * ] + * + * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * method only modifies tile indexes and does not change collision information. + * + * If no layer specified, the map's current layer is used. This + * cannot be applied to StaticTilemapLayers. + * + * @method Phaser.Tilemaps.Tilemap#weightedRandomize + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during + * randomization. They should be in the form: { index: 0, weight: 4 } or + * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + */ + weightedRandomize: function (tileX, tileY, width, height, weightedIndexes, layer) + { + layer = this.getLayer(layer); + + if (this._isStaticCall(layer, 'weightedRandomize')) { return this; } + + if (layer === null) { return null; } + + TilemapComponents.WeightedRandomize(tileX, tileY, width, height, weightedIndexes, layer); + + return this; + }, + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#worldToTileX + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer + * to use. If not given the current layer is used. + * + * @return {?number} Returns a number, or null if the layer given was invalid. + */ + worldToTileX: function (worldX, snapToFloor, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, layer); + }, + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#worldToTileY + * @since 3.0.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?number} Returns a number, or null if the layer given was invalid. + */ + worldToTileY: function (worldY, snapToFloor, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, layer); + }, + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * If no layer specified, the maps current layer is used. + * + * @method Phaser.Tilemaps.Tilemap#worldToTileXY + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * + * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. + */ + worldToTileXY: function (worldX, worldY, snapToFloor, point, camera, layer) + { + layer = this.getLayer(layer); + + if (layer === null) { return null; } + + return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, layer); + }, + + /** + * Used internally to check if a layer is static and prints out a warning. + * + * @method Phaser.Tilemaps.Tilemap#_isStaticCall + * @private + * @since 3.0.0 + * + * @return {boolean} + */ + _isStaticCall: function (layer, functionName) + { + if (layer.tilemapLayer instanceof StaticTilemapLayer) + { + console.warn(functionName + ': You cannot change the tiles in a static tilemap layer'); + return true; + } + else + { + return false; + } + } + +}); + +module.exports = Tilemap; + + +/***/ }), +/* 470 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var DynamicTilemapLayerRender = __webpack_require__(1289); +var GameObject = __webpack_require__(13); +var TilemapComponents = __webpack_require__(136); + +/** + * @classdesc + * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. + * + * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a + * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the + * tiles in a DynamicTilemapLayer. + * + * Use this over a Static Tilemap Layer when you need those features. + * + * @class DynamicTilemapLayer + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.ComputedSize + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. + * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. + * @param {integer} layerIndex - The index of the LayerData associated with this layer. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} [x=0] - The world x position where the top left of this layer will be placed. + * @param {number} [y=0] - The world y position where the top left of this layer will be placed. + */ +var DynamicTilemapLayer = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.ComputedSize, + Components.Depth, + Components.Flip, + Components.GetBounds, + Components.Origin, + Components.Pipeline, + Components.Transform, + Components.Visible, + Components.ScrollFactor, + DynamicTilemapLayerRender + ], + + initialize: + + function DynamicTilemapLayer (scene, tilemap, layerIndex, tileset, x, y) + { + GameObject.call(this, scene, 'DynamicTilemapLayer'); + + /** + * Used internally by physics system to perform fast type checks. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#isTilemap + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + this.isTilemap = true; + + /** + * The Tilemap that this layer is a part of. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#tilemap + * @type {Phaser.Tilemaps.Tilemap} + * @since 3.0.0 + */ + this.tilemap = tilemap; + + /** + * The index of the LayerData associated with this layer. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#layerIndex + * @type {integer} + * @since 3.0.0 + */ + this.layerIndex = layerIndex; + + /** + * The LayerData associated with this layer. LayerData can only be associated with one + * tilemap layer. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#layer + * @type {Phaser.Tilemaps.LayerData} + * @since 3.0.0 + */ + this.layer = tilemap.layers[layerIndex]; + + // Link the LayerData with this static tilemap layer + this.layer.tilemapLayer = this; + + /** + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#tileset + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.0.0 + */ + this.tileset = []; + + /** + * Used internally with the canvas render. This holds the tiles that are visible within the + * camera. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#culledTiles + * @type {array} + * @since 3.0.0 + */ + this.culledTiles = []; + + /** + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this, and toggling this flag allows + * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#skipCull + * @type {boolean} + * @since 3.11.0 + */ + this.skipCull = false; + + /** + * The total number of tiles drawn by the renderer in the last frame. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#tilesDrawn + * @type {integer} + * @readonly + * @since 3.11.0 + */ + this.tilesDrawn = 0; + + /** + * The total number of tiles in this layer. Updated every frame. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#tilesTotal + * @type {integer} + * @readonly + * @since 3.11.0 + */ + this.tilesTotal = this.layer.width * this.layer.height; + + /** + * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. + * + * See the method `setCullPadding` for more details. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#cullPaddingX + * @type {integer} + * @default 1 + * @since 3.11.0 + */ + this.cullPaddingX = 1; + + /** + * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. + * + * See the method `setCullPadding` for more details. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#cullPaddingY + * @type {integer} + * @default 1 + * @since 3.11.0 + */ + this.cullPaddingY = 1; + + /** + * The callback that is invoked when the tiles are culled. + * + * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. + * + * It will be sent 3 arguments: + * + * 1. The Phaser.Tilemaps.LayerData object for this Layer + * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. + * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. + * + * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#cullCallback + * @type {function} + * @since 3.11.0 + */ + this.cullCallback = TilemapComponents.CullTiles; + + /** + * The rendering (draw) order of the tiles in this layer. + * + * The default is 0 which is 'right-down', meaning it will draw the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * This can be changed via the `setRenderOrder` method. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#_renderOrder + * @type {integer} + * @default 0 + * @private + * @since 3.12.0 + */ + this._renderOrder = 0; + + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + * + * @name Phaser.Tilemaps.DynamicTilemapLayer#gidMap + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.14.0 + */ + this.gidMap = []; + + this.setTilesets(tileset); + this.setAlpha(this.layer.alpha); + this.setPosition(x, y); + this.setOrigin(); + this.setSize(tilemap.tileWidth * this.layer.width, tilemap.tileHeight * this.layer.height); + + this.initPipeline('TextureTintPipeline'); + }, + + /** + * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setTilesets + * @private + * @since 3.14.0 + * + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + */ + setTilesets: function (tilesets) + { + var gidMap = []; + var setList = []; + var map = this.tilemap; + + if (!Array.isArray(tilesets)) + { + tilesets = [ tilesets ]; + } + + for (var i = 0; i < tilesets.length; i++) + { + var tileset = tilesets[i]; + + if (typeof tileset === 'string') + { + tileset = map.getTileset(tileset); + } + + if (tileset) + { + setList.push(tileset); + + var s = tileset.firstgid; + + for (var t = 0; t < tileset.total; t++) + { + gidMap[s + t] = tileset; + } + } + } + + this.gidMap = gidMap; + this.tileset = setList; + }, + + /** + * Sets the rendering (draw) order of the tiles in this layer. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setRenderOrder + * @since 3.12.0 + * + * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * + * @return {this} This Tilemap Layer object. + */ + setRenderOrder: function (renderOrder) + { + var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; + + if (typeof renderOrder === 'string') + { + renderOrder = orders.indexOf(renderOrder); + } + + if (renderOrder >= 0 && renderOrder < 4) + { + this._renderOrder = renderOrder; + } + + return this; + }, + + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesAt + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate. + * @param {integer} tileY - The y coordinate. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + calculateFacesAt: function (tileX, tileY) + { + TilemapComponents.CalculateFacesAt(tileX, tileY, this.layer); + + return this; + }, + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesWithin + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + calculateFacesWithin: function (tileX, tileY, width, height) + { + TilemapComponents.CalculateFacesWithin(tileX, tileY, width, height, this.layer); + + return this; + }, + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#createFromTiles + * @since 3.0.0 + * + * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted + * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a + * one-to-one mapping with the indexes array. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. + * scene.make.sprite). + * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY + * + * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. + */ + createFromTiles: function (indexes, replacements, spriteConfig, scene, camera) + { + return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, this.layer); + }, + + /** + * Returns the tiles in the given layer that are within the cameras viewport. + * This is used internally. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#cull + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + cull: function (camera) + { + return this.cullCallback(this.layer, camera, this.culledTiles, this._renderOrder); + }, + + /** + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#copy + * @since 3.0.0 + * + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + copy: function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces) + { + TilemapComponents.Copy(srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, this.layer); + + return this; + }, + + /** + * Destroys this DynamicTilemapLayer and removes its link to the associated LayerData. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#destroy + * @since 3.0.0 + * + * @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap? + */ + destroy: function (removeFromTilemap) + { + if (removeFromTilemap === undefined) { removeFromTilemap = true; } + + // Uninstall this layer only if it is still installed on the LayerData object + if (this.layer.tilemapLayer === this) + { + this.layer.tilemapLayer = undefined; + } + + if (removeFromTilemap) + { + this.tilemap.removeLayer(this); + } + + this.tilemap = undefined; + this.layer = undefined; + this.culledTiles.length = 0; + this.cullCallback = null; + + this.gidMap = []; + this.tileset = []; + + GameObject.prototype.destroy.call(this); + }, + + /** + * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the + * specified index. Tiles will be set to collide if the given index is a colliding index. + * Collision information in the region will be recalculated. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#fill + * @since 3.0.0 + * + * @param {integer} index - The tile index to fill the area with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + fill: function (index, tileX, tileY, width, height, recalculateFaces) + { + TilemapComponents.Fill(index, tileX, tileY, width, height, recalculateFaces, this.layer); + + return this; + }, + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#filterTiles + * @since 3.0.0 + * + * @param {function} callback - The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions) + { + return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); + }, + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#findByIndex + * @since 3.0.0 + * + * @param {integer} index - The tile index value to search for. + * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. + * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the + * bottom-right. Otherwise it scans from the top-left. + * + * @return {Phaser.Tilemaps.Tile} A Tile object. + */ + findByIndex: function (findIndex, skip, reverse) + { + return TilemapComponents.FindByIndex(findIndex, skip, reverse, this.layer); + }, + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#findTile + * @since 3.0.0 + * + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {?Phaser.Tilemaps.Tile} + */ + findTile: function (callback, context, tileX, tileY, width, height, filteringOptions) + { + return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); + }, + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#forEachTile + * @since 3.0.0 + * + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions) + { + TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); + + return this; + }, + + /** + * Gets a tile at the given tile coordinates from the given layer. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAt + * @since 3.0.0 + * + * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. + */ + getTileAt: function (tileX, tileY, nonNull) + { + return TilemapComponents.GetTileAt(tileX, tileY, nonNull, this.layer); + }, + + /** + * Gets a tile at the given world coordinates from the given layer. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAtWorldXY + * @since 3.0.0 + * + * @param {number} worldX - X position to get the tile from (given in pixels) + * @param {number} worldY - Y position to get the tile from (given in pixels) + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates + * were invalid. + */ + getTileAtWorldXY: function (worldX, worldY, nonNull, camera) + { + return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, this.layer); + }, + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithin + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + getTilesWithin: function (tileX, tileY, width, height, filteringOptions) + { + return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, this.layer); + }, + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinShape + * @since 3.0.0 + * + * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + getTilesWithinShape: function (shape, filteringOptions, camera) + { + return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, this.layer); + }, + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinWorldXY + * @since 3.0.0 + * + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera) + { + return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, this.layer); + }, + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAt + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * + * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. + */ + hasTileAt: function (tileX, tileY) + { + return TilemapComponents.HasTileAt(tileX, tileY, this.layer); + }, + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAtWorldXY + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * + * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. + */ + hasTileAtWorldXY: function (worldX, worldY, camera) + { + return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, this.layer); + }, + + /** + * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index + * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified + * location. If you pass in an index, only the index at the specified location will be changed. + * Collision information will be recalculated at the specified location. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAt + * @since 3.0.0 + * + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * + * @return {Phaser.Tilemaps.Tile} A Tile object. + */ + putTileAt: function (tile, tileX, tileY, recalculateFaces) + { + return TilemapComponents.PutTileAt(tile, tileX, tileY, recalculateFaces, this.layer); + }, + + /** + * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either + * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the + * specified location. If you pass in an index, only the index at the specified location will be + * changed. Collision information will be recalculated at the specified location. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAtWorldXY + * @since 3.0.0 + * + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Tilemaps.Tile} A Tile object. + */ + putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera) + { + return TilemapComponents.PutTileAtWorldXY(tile, worldX, worldY, recalculateFaces, camera, this.layer); + }, + + /** + * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified + * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, + * all attributes will be copied over to the specified location. If you pass in an index, only the + * index at the specified location will be changed. Collision information will be recalculated + * within the region tiles were changed. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#putTilesAt + * @since 3.0.0 + * + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces) + { + TilemapComponents.PutTilesAt(tilesArray, tileX, tileY, recalculateFaces, this.layer); + + return this; + }, + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then + * those will be used for randomly assigning new tile indexes. If an array is not provided, the + * indexes found within the region (excluding -1) will be used for randomly assigning new tile + * indexes. This method only modifies tile indexes and does not change collision information. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#randomize + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + randomize: function (tileX, tileY, width, height, indexes) + { + TilemapComponents.Randomize(tileX, tileY, width, height, indexes, this.layer); + + return this; + }, + + /** + * Removes the tile at the given tile coordinates in the specified layer and updates the layer's + * collision information. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAt + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * + * @return {Phaser.Tilemaps.Tile} A Tile object. + */ + removeTileAt: function (tileX, tileY, replaceWithNull, recalculateFaces) + { + return TilemapComponents.RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, this.layer); + }, + + /** + * Removes the tile at the given world coordinates in the specified layer and updates the layer's + * collision information. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAtWorldXY + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Tilemaps.Tile} A Tile object. + */ + removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera) + { + return TilemapComponents.RemoveTileAtWorldXY(worldX, worldY, replaceWithNull, recalculateFaces, camera, this.layer); + }, + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#renderDebug + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. + * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + renderDebug: function (graphics, styleConfig) + { + TilemapComponents.RenderDebug(graphics, styleConfig, this.layer); + + return this; + }, + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does + * not change collision information. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#replaceByIndex + * @since 3.0.0 + * + * @param {integer} findIndex - The index of the tile to search for. + * @param {integer} newIndex - The index of the tile to replace it with. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + replaceByIndex: function (findIndex, newIndex, tileX, tileY, width, height) + { + TilemapComponents.ReplaceByIndex(findIndex, newIndex, tileX, tileY, width, height, this.layer); + + return this; + }, + + /** + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setSkipCull + * @since 3.11.0 + * + * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again. + * + * @return {this} This Tilemap Layer object. + */ + setSkipCull: function (value) + { + if (value === undefined) { value = true; } + + this.skipCull = value; + + return this; + }, + + /** + * When a Camera culls the tiles in this layer it does so using its view into the world, building up a + * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size + * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so + * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px + * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setCullPadding + * @since 3.11.0 + * + * @param {integer} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. + * @param {integer} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. + * + * @return {this} This Tilemap Layer object. + */ + setCullPadding: function (paddingX, paddingY) + { + if (paddingX === undefined) { paddingX = 1; } + if (paddingY === undefined) { paddingY = 1; } + + this.cullPaddingX = paddingX; + this.cullPaddingY = paddingY; + + return this; + }, + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollision + * @since 3.0.0 + * + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + setCollision: function (indexes, collides, recalculateFaces) + { + TilemapComponents.SetCollision(indexes, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionBetween + * @since 3.0.0 + * + * @param {integer} start - The first index of the tile to be set for collision. + * @param {integer} stop - The last index of the tile to be set for collision. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + setCollisionBetween: function (start, stop, collides, recalculateFaces) + { + TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByProperty + * @since 3.0.0 + * + * @param {object} properties - An object with tile properties and corresponding values that should be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + setCollisionByProperty: function (properties, collides, recalculateFaces) + { + TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByExclusion + * @since 3.0.0 + * + * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + setCollisionByExclusion: function (indexes, collides, recalculateFaces) + { + TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets collision on the tiles within a layer by checking each tiles collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tiles collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionFromCollisionGroup + * @since 3.0.0 + * + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + setCollisionFromCollisionGroup: function (collides, recalculateFaces) + { + TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileIndexCallback + * @since 3.0.0 + * + * @param {(integer|integer[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {function} callback - The callback that will be invoked when the tile is collided with. + * @param {object} callbackContext - The context under which the callback is called. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + setTileIndexCallback: function (indexes, callback, callbackContext) + { + TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, this.layer); + + return this; + }, + + /** + * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileLocationCallback + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {function} [callback] - The callback that will be invoked when the tile is collided with. + * @param {object} [callbackContext] - The context under which the callback is called. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext) + { + TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, this.layer); + + return this; + }, + + /** + * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given + * layer. It will only randomize the tiles in that area, so if they're all the same nothing will + * appear to have changed! This method only modifies tile indexes and does not change collision + * information. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#shuffle + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + shuffle: function (tileX, tileY, width, height) + { + TilemapComponents.Shuffle(tileX, tileY, width, height, this.layer); + + return this; + }, + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision + * information. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#swapByIndex + * @since 3.0.0 + * + * @param {integer} tileA - First tile index. + * @param {integer} tileB - Second tile index. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + swapByIndex: function (indexA, indexB, tileX, tileY, width, height) + { + TilemapComponents.SwapByIndex(indexA, indexB, tileX, tileY, width, height, this.layer); + + return this; + }, + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldX + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {number} + */ + tileToWorldX: function (tileX, camera) + { + return TilemapComponents.TileToWorldX(tileX, camera, this.layer); + }, + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldY + * @since 3.0.0 + * + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {number} + */ + tileToWorldY: function (tileY, camera) + { + return TilemapComponents.TileToWorldY(tileY, camera, this.layer); + }, + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldXY + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Math.Vector2} + */ + tileToWorldXY: function (tileX, tileY, point, camera) + { + return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, this.layer); + }, + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will recieve a new index. New indexes are drawn from the given + * weightedIndexes array. An example weighted array: + * + * [ + * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 + * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 + * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 + * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 + * ] + * + * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * method only modifies tile indexes and does not change collision information. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#weightedRandomize + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during + * randomization. They should be in the form: { index: 0, weight: 4 } or + * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * + * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + */ + weightedRandomize: function (tileX, tileY, width, height, weightedIndexes) + { + TilemapComponents.WeightedRandomize(tileX, tileY, width, height, weightedIndexes, this.layer); + + return this; + }, + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileX + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {number} + */ + worldToTileX: function (worldX, snapToFloor, camera) + { + return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, this.layer); + }, + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileY + * @since 3.0.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {number} + */ + worldToTileY: function (worldY, snapToFloor, camera) + { + return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, this.layer); + }, + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileXY + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Math.Vector2} + */ + worldToTileXY: function (worldX, worldY, snapToFloor, point, camera) + { + return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, this.layer); + } + +}); + +module.exports = DynamicTilemapLayer; + + +/***/ }), +/* 471 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(12); +var CONST = __webpack_require__(26); +var GameObject = __webpack_require__(13); +var StaticTilemapLayerRender = __webpack_require__(1292); +var TilemapComponents = __webpack_require__(136); +var TransformMatrix = __webpack_require__(32); +var Utils = __webpack_require__(9); + +/** + * @classdesc + * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. + * + * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile + * effects like tint or alpha, or change the tiles or tilesets the layer uses. + * + * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features. + * + * @class StaticTilemapLayer + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.ComputedSize + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * @extends Phaser.GameObjects.Components.ScrollFactor + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. + * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. + * @param {integer} layerIndex - The index of the LayerData associated with this layer. + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param {number} [x=0] - The world x position where the top left of this layer will be placed. + * @param {number} [y=0] - The world y position where the top left of this layer will be placed. + */ +var StaticTilemapLayer = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.ComputedSize, + Components.Depth, + Components.Flip, + Components.GetBounds, + Components.Origin, + Components.Pipeline, + Components.Transform, + Components.Visible, + Components.ScrollFactor, + StaticTilemapLayerRender + ], + + initialize: + + function StaticTilemapLayer (scene, tilemap, layerIndex, tileset, x, y) + { + GameObject.call(this, scene, 'StaticTilemapLayer'); + + /** + * Used internally by physics system to perform fast type checks. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#isTilemap + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + this.isTilemap = true; + + /** + * The Tilemap that this layer is a part of. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#tilemap + * @type {Phaser.Tilemaps.Tilemap} + * @since 3.0.0 + */ + this.tilemap = tilemap; + + /** + * The index of the LayerData associated with this layer. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#layerIndex + * @type {integer} + * @since 3.0.0 + */ + this.layerIndex = layerIndex; + + /** + * The LayerData associated with this layer. LayerData can only be associated with one + * tilemap layer. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#layer + * @type {Phaser.Tilemaps.LayerData} + * @since 3.0.0 + */ + this.layer = tilemap.layers[layerIndex]; + + // Link the LayerData with this static tilemap layer + this.layer.tilemapLayer = this; + + /** + * The Tileset/s associated with this layer. + * + * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#tileset + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.0.0 + */ + this.tileset = []; + + /** + * Used internally by the Canvas renderer. + * This holds the tiles that are visible within the camera in the last frame. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#culledTiles + * @type {array} + * @since 3.0.0 + */ + this.culledTiles = []; + + /** + * Canvas only. + * + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this, and toggling this flag allows + * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#skipCull + * @type {boolean} + * @since 3.12.0 + */ + this.skipCull = false; + + /** + * Canvas only. + * + * The total number of tiles drawn by the renderer in the last frame. + * + * This only works when rending with Canvas. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#tilesDrawn + * @type {integer} + * @readonly + * @since 3.12.0 + */ + this.tilesDrawn = 0; + + /** + * Canvas only. + * + * The total number of tiles in this layer. Updated every frame. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#tilesTotal + * @type {integer} + * @readonly + * @since 3.12.0 + */ + this.tilesTotal = this.layer.width * this.layer.height; + + /** + * Canvas only. + * + * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. + * + * See the method `setCullPadding` for more details. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#cullPaddingX + * @type {integer} + * @default 1 + * @since 3.12.0 + */ + this.cullPaddingX = 1; + + /** + * Canvas only. + * + * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. + * + * See the method `setCullPadding` for more details. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#cullPaddingY + * @type {integer} + * @default 1 + * @since 3.12.0 + */ + this.cullPaddingY = 1; + + /** + * Canvas only. + * + * The callback that is invoked when the tiles are culled. + * + * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. + * + * It will be sent 3 arguments: + * + * 1. The Phaser.Tilemaps.LayerData object for this Layer + * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. + * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. + * + * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#cullCallback + * @type {function} + * @since 3.12.0 + */ + this.cullCallback = TilemapComponents.CullTiles; + + /** + * A reference to the renderer. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @private + * @since 3.0.0 + */ + this.renderer = scene.sys.game.renderer; + + /** + * An array of vertex buffer objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer + * @type {WebGLBuffer[]} + * @private + * @since 3.0.0 + */ + this.vertexBuffer = []; + + /** + * An array of ArrayBuffer objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#bufferData + * @type {ArrayBuffer[]} + * @private + * @since 3.0.0 + */ + this.bufferData = []; + + /** + * An array of Float32 Array objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewF32 + * @type {Float32Array[]} + * @private + * @since 3.0.0 + */ + this.vertexViewF32 = []; + + /** + * An array of Uint32 Array objects, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewU32 + * @type {Uint32Array[]} + * @private + * @since 3.0.0 + */ + this.vertexViewU32 = []; + + /** + * An array of booleans, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single boolean. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#dirty + * @type {boolean[]} + * @private + * @since 3.0.0 + */ + this.dirty = []; + + /** + * An array of integers, used by the WebGL renderer. + * + * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single integer. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#vertexCount + * @type {integer[]} + * @private + * @since 3.0.0 + */ + this.vertexCount = []; + + /** + * The rendering (draw) order of the tiles in this layer. + * + * The default is 0 which is 'right-down', meaning it will draw the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * This can be changed via the `setRenderOrder` method. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#_renderOrder + * @type {integer} + * @default 0 + * @private + * @since 3.12.0 + */ + this._renderOrder = 0; + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#_tempMatrix + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.14.0 + */ + this._tempMatrix = new TransformMatrix(); + + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + * + * @name Phaser.Tilemaps.StaticTilemapLayer#gidMap + * @type {Phaser.Tilemaps.Tileset[]} + * @since 3.14.0 + */ + this.gidMap = []; + + this.setTilesets(tileset); + this.setAlpha(this.layer.alpha); + this.setPosition(x, y); + this.setOrigin(); + this.setSize(tilemap.tileWidth * this.layer.width, tilemap.tileHeight * this.layer.height); + + this.updateVBOData(); + + this.initPipeline('TextureTintPipeline'); + + if (scene.sys.game.config.renderType === CONST.WEBGL) + { + scene.sys.game.renderer.onContextRestored(function () + { + this.updateVBOData(); + }, this); + } + }, + + /** + * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setTilesets + * @private + * @since 3.14.0 + * + * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + */ + setTilesets: function (tilesets) + { + var gidMap = []; + var setList = []; + var map = this.tilemap; + + if (!Array.isArray(tilesets)) + { + tilesets = [ tilesets ]; + } + + for (var i = 0; i < tilesets.length; i++) + { + var tileset = tilesets[i]; + + if (typeof tileset === 'string') + { + tileset = map.getTileset(tileset); + } + + if (tileset) + { + setList.push(tileset); + + var s = tileset.firstgid; + + for (var t = 0; t < tileset.total; t++) + { + gidMap[s + t] = tileset; + } + } + } + + this.gidMap = gidMap; + this.tileset = setList; + }, + + /** + * Prepares the VBO data arrays for population by the `upload` method. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#updateVBOData + * @private + * @since 3.14.0 + * + * @return {this} This Tilemap Layer object. + */ + updateVBOData: function () + { + for (var i = 0; i < this.tileset.length; i++) + { + this.dirty[i] = true; + this.vertexCount[i] = 0; + this.vertexBuffer[i] = null; + this.bufferData[i] = null; + this.vertexViewF32[i] = null; + this.vertexViewU32[i] = null; + } + + return this; + }, + + /** + * Upload the tile data to a VBO. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#upload + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to render to. + * @param {integer} tilesetIndex - The tileset index. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + upload: function (camera, tilesetIndex) + { + var renderer = this.renderer; + var gl = renderer.gl; + + var pipeline = renderer.pipelines.TextureTintPipeline; + + if (this.dirty[tilesetIndex]) + { + var tileset = this.tileset[tilesetIndex]; + var mapWidth = this.layer.width; + var mapHeight = this.layer.height; + var width = tileset.image.source[0].width; + var height = tileset.image.source[0].height; + var mapData = this.layer.data; + var tile; + var row; + var col; + var renderOrder = this._renderOrder; + var minTileIndex = tileset.firstgid; + var maxTileIndex = tileset.firstgid + tileset.total; + + var vertexBuffer = this.vertexBuffer[tilesetIndex]; + var bufferData = this.bufferData[tilesetIndex]; + var vOffset = -1; + var bufferSize = (mapWidth * mapHeight) * pipeline.vertexSize * 6; + + this.vertexCount[tilesetIndex] = 0; + + if (bufferData === null) + { + bufferData = new ArrayBuffer(bufferSize); + + this.bufferData[tilesetIndex] = bufferData; + + this.vertexViewF32[tilesetIndex] = new Float32Array(bufferData); + this.vertexViewU32[tilesetIndex] = new Uint32Array(bufferData); + } + + if (renderOrder === 0) + { + // right-down + + for (row = 0; row < mapHeight; row++) + { + for (col = 0; col < mapWidth; col++) + { + tile = mapData[row][col]; + + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) + { + continue; + } + + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); + } + } + } + else if (renderOrder === 1) + { + // left-down + + for (row = 0; row < mapHeight; row++) + { + for (col = mapWidth - 1; col >= 0; col--) + { + tile = mapData[row][col]; + + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) + { + continue; + } + + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); + } + } + } + else if (renderOrder === 2) + { + // right-up + + for (row = mapHeight - 1; row >= 0; row--) + { + for (col = 0; col < mapWidth; col++) + { + tile = mapData[row][col]; + + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) + { + continue; + } + + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); + } + } + } + else if (renderOrder === 3) + { + // left-up + + for (row = mapHeight - 1; row >= 0; row--) + { + for (col = mapWidth - 1; col >= 0; col--) + { + tile = mapData[row][col]; + + if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) + { + continue; + } + + vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); + } + } + } + + this.dirty[tilesetIndex] = false; + + if (vertexBuffer === null) + { + vertexBuffer = renderer.createVertexBuffer(bufferData, gl.STATIC_DRAW); + + this.vertexBuffer[tilesetIndex] = vertexBuffer; + } + else + { + renderer.setVertexBuffer(vertexBuffer); + + gl.bufferSubData(gl.ARRAY_BUFFER, 0, bufferData); + } + } + + return this; + }, + + /** + * Add a single tile into the batch. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#batchTile + * @private + * @since 3.12.0 + * + * @param {integer} vOffset - The vertex offset. + * @param {any} tile - The tile being rendered. + * @param {any} tileset - The tileset being used for rendering. + * @param {integer} width - The width of the tileset image in pixels. + * @param {integer} height - The height of the tileset image in pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the layer is being rendered with. + * @param {integer} tilesetIndex - The tileset index. + * + * @return {integer} The new vOffset value. + */ + batchTile: function (vOffset, tile, tileset, width, height, camera, tilesetIndex) + { + var texCoords = tileset.getTileTextureCoordinates(tile.index); + + if (!texCoords) + { + return vOffset; + } + + var tileWidth = tileset.tileWidth; + var tileHeight = tileset.tileHeight; + + var halfTileWidth = tileWidth / 2; + var halfTileHeight = tileHeight / 2; + + var u0 = texCoords.x / width; + var v0 = texCoords.y / height; + var u1 = (texCoords.x + tileWidth) / width; + var v1 = (texCoords.y + tileHeight) / height; + + var matrix = this._tempMatrix; + + var x = -halfTileWidth; + var y = -halfTileHeight; + + if (tile.flipX) + { + tileWidth *= -1; + x += tileset.tileWidth; + } + + if (tile.flipY) + { + tileHeight *= -1; + y += tileset.tileHeight; + } + + var xw = x + tileWidth; + var yh = y + tileHeight; + + matrix.applyITRS(halfTileWidth + tile.pixelX, halfTileHeight + tile.pixelY, tile.rotation, 1, 1); + + var tint = Utils.getTintAppendFloatAlpha(0xffffff, camera.alpha * this.alpha * tile.alpha); + + var tx0 = matrix.getX(x, y); + var ty0 = matrix.getY(x, y); + + var tx1 = matrix.getX(x, yh); + var ty1 = matrix.getY(x, yh); + + var tx2 = matrix.getX(xw, yh); + var ty2 = matrix.getY(xw, yh); + + var tx3 = matrix.getX(xw, y); + var ty3 = matrix.getY(xw, y); + + if (camera.roundPixels) + { + tx0 = Math.round(tx0); + ty0 = Math.round(ty0); + + tx1 = Math.round(tx1); + ty1 = Math.round(ty1); + + tx2 = Math.round(tx2); + ty2 = Math.round(ty2); + + tx3 = Math.round(tx3); + ty3 = Math.round(ty3); + } + + var vertexViewF32 = this.vertexViewF32[tilesetIndex]; + var vertexViewU32 = this.vertexViewU32[tilesetIndex]; + + vertexViewF32[++vOffset] = tx0; + vertexViewF32[++vOffset] = ty0; + vertexViewF32[++vOffset] = u0; + vertexViewF32[++vOffset] = v0; + vertexViewF32[++vOffset] = 0; + vertexViewU32[++vOffset] = tint; + + vertexViewF32[++vOffset] = tx1; + vertexViewF32[++vOffset] = ty1; + vertexViewF32[++vOffset] = u0; + vertexViewF32[++vOffset] = v1; + vertexViewF32[++vOffset] = 0; + vertexViewU32[++vOffset] = tint; + + vertexViewF32[++vOffset] = tx2; + vertexViewF32[++vOffset] = ty2; + vertexViewF32[++vOffset] = u1; + vertexViewF32[++vOffset] = v1; + vertexViewF32[++vOffset] = 0; + vertexViewU32[++vOffset] = tint; + + vertexViewF32[++vOffset] = tx0; + vertexViewF32[++vOffset] = ty0; + vertexViewF32[++vOffset] = u0; + vertexViewF32[++vOffset] = v0; + vertexViewF32[++vOffset] = 0; + vertexViewU32[++vOffset] = tint; + + vertexViewF32[++vOffset] = tx2; + vertexViewF32[++vOffset] = ty2; + vertexViewF32[++vOffset] = u1; + vertexViewF32[++vOffset] = v1; + vertexViewF32[++vOffset] = 0; + vertexViewU32[++vOffset] = tint; + + vertexViewF32[++vOffset] = tx3; + vertexViewF32[++vOffset] = ty3; + vertexViewF32[++vOffset] = u1; + vertexViewF32[++vOffset] = v0; + vertexViewF32[++vOffset] = 0; + vertexViewU32[++vOffset] = tint; + + this.vertexCount[tilesetIndex] += 6; + + return vOffset; + }, + + /** + * Sets the rendering (draw) order of the tiles in this layer. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder + * @since 3.12.0 + * + * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * + * @return {this} This Tilemap Layer object. + */ + setRenderOrder: function (renderOrder) + { + var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; + + if (typeof renderOrder === 'string') + { + renderOrder = orders.indexOf(renderOrder); + } + + if (renderOrder >= 0 && renderOrder < 4) + { + this._renderOrder = renderOrder; + + for (var i = 0; i < this.tileset.length; i++) + { + this.dirty[i] = true; + } + } + + return this; + }, + + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesAt + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate. + * @param {integer} tileY - The y coordinate. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + calculateFacesAt: function (tileX, tileY) + { + TilemapComponents.CalculateFacesAt(tileX, tileY, this.layer); + + return this; + }, + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesWithin + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + calculateFacesWithin: function (tileX, tileY, width, height) + { + TilemapComponents.CalculateFacesWithin(tileX, tileY, width, height, this.layer); + + return this; + }, + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#createFromTiles + * @since 3.0.0 + * + * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted + * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a + * one-to-one mapping with the indexes array. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. + * scene.make.sprite). + * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY + * + * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. + */ + createFromTiles: function (indexes, replacements, spriteConfig, scene, camera) + { + return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, this.layer); + }, + + /** + * Returns the tiles in the given layer that are within the cameras viewport. + * This is used internally. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#cull + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + cull: function (camera) + { + return this.cullCallback(this.layer, camera, this.culledTiles); + }, + + /** + * Canvas only. + * + * You can control if the Cameras should cull tiles before rendering them or not. + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setSkipCull + * @since 3.12.0 + * + * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again. + * + * @return {this} This Tilemap Layer object. + */ + setSkipCull: function (value) + { + if (value === undefined) { value = true; } + + this.skipCull = value; + + return this; + }, + + /** + * Canvas only. + * + * When a Camera culls the tiles in this layer it does so using its view into the world, building up a + * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size + * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so + * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px + * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setCullPadding + * @since 3.12.0 + * + * @param {integer} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. + * @param {integer} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. + * + * @return {this} This Tilemap Layer object. + */ + setCullPadding: function (paddingX, paddingY) + { + if (paddingX === undefined) { paddingX = 1; } + if (paddingY === undefined) { paddingY = 1; } + + this.cullPaddingX = paddingX; + this.cullPaddingY = paddingY; + + return this; + }, + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#findByIndex + * @since 3.0.0 + * + * @param {integer} index - The tile index value to search for. + * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. + * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the + * bottom-right. Otherwise it scans from the top-left. + * + * @return {Phaser.Tilemaps.Tile} A Tile object. + */ + findByIndex: function (findIndex, skip, reverse) + { + return TilemapComponents.FindByIndex(findIndex, skip, reverse, this.layer); + }, + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#findTile + * @since 3.0.0 + * + * @param {function} callback - The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {?Phaser.Tilemaps.Tile} + */ + findTile: function (callback, context, tileX, tileY, width, height, filteringOptions) + { + return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); + }, + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#filterTiles + * @since 3.0.0 + * + * @param {function} callback - The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions) + { + return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); + }, + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#forEachTile + * @since 3.0.0 + * + * @param {function} callback - The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions) + { + TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); + + return this; + }, + + /** + * Gets a tile at the given tile coordinates from the given layer. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#getTileAt + * @since 3.0.0 + * + * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile + * object with an index of -1. + * + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. + */ + getTileAt: function (tileX, tileY, nonNull) + { + return TilemapComponents.GetTileAt(tileX, tileY, nonNull, this.layer); + }, + + /** + * Gets a tile at the given world coordinates from the given layer. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#getTileAtWorldXY + * @since 3.0.0 + * + * @param {number} worldX - X position to get the tile from (given in pixels) + * @param {number} worldY - Y position to get the tile from (given in pixels) + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile + * object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates + * were invalid. + */ + getTileAtWorldXY: function (worldX, worldY, nonNull, camera) + { + return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, this.layer); + }, + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithin + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + getTilesWithin: function (tileX, tileY, width, height, filteringOptions) + { + return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, this.layer); + }, + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinWorldXY + * @since 3.0.0 + * + * @param {number} worldX - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} worldY - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles high from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera) + { + return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, this.layer); + }, + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinShape + * @since 3.0.0 + * + * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + getTilesWithinShape: function (shape, filteringOptions, camera) + { + return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, this.layer); + }, + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAt + * @since 3.0.0 + * + * @param {integer} tileX - X position to get the tile from in tile coordinates. + * @param {integer} tileY - Y position to get the tile from in tile coordinates. + * + * @return {boolean} + */ + hasTileAt: function (tileX, tileY) + { + return TilemapComponents.HasTileAt(tileX, tileY, this.layer); + }, + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAtWorldXY + * @since 3.0.0 + * + * @param {number} worldX - The X coordinate of the world position. + * @param {number} worldY - The Y coordinate of the world position. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {boolean} + */ + hasTileAtWorldXY: function (worldX, worldY, camera) + { + return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, this.layer); + }, + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#renderDebug + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. + * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + renderDebug: function (graphics, styleConfig) + { + TilemapComponents.RenderDebug(graphics, styleConfig, this.layer); + + return this; + }, + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setCollision + * @since 3.0.0 + * + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear + * collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the + * update. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + setCollision: function (indexes, collides, recalculateFaces) + { + TilemapComponents.SetCollision(indexes, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionBetween + * @since 3.0.0 + * + * @param {integer} start - The first index of the tile to be set for collision. + * @param {integer} stop - The last index of the tile to be set for collision. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear + * collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the + * update. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + setCollisionBetween: function (start, stop, collides, recalculateFaces) + { + TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByProperty + * @since 3.0.0 + * + * @param {object} properties - An object with tile properties and corresponding values that should + * be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear + * collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the + * update. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + setCollisionByProperty: function (properties, collides, recalculateFaces) + { + TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByExclusion + * @since 3.0.0 + * + * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear + * collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the + * update. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + setCollisionByExclusion: function (indexes, collides, recalculateFaces) + { + TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setTileIndexCallback + * @since 3.0.0 + * + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a + * collision callback set for. + * @param {function} callback - The callback that will be invoked when the tile is collided with. + * @param {object} callbackContext - The context under which the callback is called. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + setTileIndexCallback: function (indexes, callback, callbackContext) + { + TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, this.layer); + + return this; + }, + + /** + * Sets collision on the tiles within a layer by checking each tiles collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tiles collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionFromCollisionGroup + * @since 3.0.0 + * + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear + * collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the + * update. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + setCollisionFromCollisionGroup: function (collides, recalculateFaces) + { + TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#setTileLocationCallback + * @since 3.0.0 + * + * @param {integer} tileX - The leftmost tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The topmost tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {function} callback - The callback that will be invoked when the tile is collided with. + * @param {object} [callbackContext] - The context under which the callback is called. + * + * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. + */ + setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext) + { + TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, this.layer); + + return this; + }, + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldX + * @since 3.0.0 + * + * @param {integer} tileX - The X coordinate, in tile coordinates. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. + * + * @return {number} + */ + tileToWorldX: function (tileX, camera) + { + return TilemapComponents.TileToWorldX(tileX, camera, this.layer); + }, + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldY + * @since 3.0.0 + * + * @param {integer} tileY - The Y coordinate, in tile coordinates. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. + * + * @return {number} + */ + tileToWorldY: function (tileY, camera) + { + return TilemapComponents.TileToWorldY(tileY, camera, this.layer); + }, + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldXY + * @since 3.0.0 + * + * @param {integer} tileX - The X coordinate, in tile coordinates. + * @param {integer} tileY - The Y coordinate, in tile coordinates. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given, a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. + * + * @return {Phaser.Math.Vector2} + */ + tileToWorldXY: function (tileX, tileY, point, camera) + { + return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, this.layer); + }, + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileX + * @since 3.0.0 + * + * @param {number} worldX - The X coordinate, in world pixels. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the + * nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.] + * + * @return {number} + */ + worldToTileX: function (worldX, snapToFloor, camera) + { + return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, this.layer); + }, + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileY + * @since 3.0.0 + * + * @param {number} worldY - The Y coordinate, in world pixels. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the + * nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {number} + */ + worldToTileY: function (worldY, snapToFloor, camera) + { + return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, this.layer); + }, + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileXY + * @since 3.0.0 + * + * @param {number} worldX - The X coordinate, in world pixels. + * @param {number} worldY - The Y coordinate, in world pixels. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the + * nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given, a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Math.Vector2} + */ + worldToTileXY: function (worldX, worldY, snapToFloor, point, camera) + { + return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, this.layer); + }, + + /** + * Destroys this StaticTilemapLayer and removes its link to the associated LayerData. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#destroy + * @since 3.0.0 + * + * @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap? + */ + destroy: function (removeFromTilemap) + { + if (removeFromTilemap === undefined) { removeFromTilemap = true; } + + // Uninstall this layer only if it is still installed on the LayerData object + if (this.layer.tilemapLayer === this) + { + this.layer.tilemapLayer = undefined; + } + + if (removeFromTilemap) + { + this.tilemap.removeLayer(this); + } + + this.tilemap = undefined; + this.layer = undefined; + this.culledTiles.length = 0; + this.cullCallback = null; + + for (var i = 0; i < this.tileset.length; i++) + { + this.dirty[i] = true; + this.vertexCount[i] = 0; + this.vertexBuffer[i] = null; + this.bufferData[i] = null; + this.vertexViewF32[i] = null; + this.vertexViewU32[i] = null; + } + + this.gidMap = []; + this.tileset = []; + + GameObject.prototype.destroy.call(this); + } + +}); + +module.exports = StaticTilemapLayer; + + +/***/ }), +/* 472 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(2); + +/** + * @classdesc + * A Timer Event represents a delayed function call. It's managed by a Scene's {@link Clock} and will call its function after a set amount of time has passed. The Timer Event can optionally repeat - i.e. call its function multiple times before finishing, or loop indefinitely. + * + * Because it's managed by a Clock, a Timer Event is based on game time, will be affected by its Clock's time scale, and will pause if its Clock pauses. + * + * @class TimerEvent + * @memberof Phaser.Time + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.Time.TimerEventConfig} config - The configuration for the Timer Event, including its delay and callback. + */ +var TimerEvent = new Class({ + + initialize: + + function TimerEvent (config) + { + /** + * The delay in ms at which this TimerEvent fires. + * + * @name Phaser.Time.TimerEvent#delay + * @type {number} + * @default 0 + * @readonly + * @since 3.0.0 + */ + this.delay = 0; + + /** + * The total number of times this TimerEvent will repeat before finishing. + * + * @name Phaser.Time.TimerEvent#repeat + * @type {number} + * @default 0 + * @readonly + * @since 3.0.0 + */ + this.repeat = 0; + + /** + * If repeating this contains the current repeat count. + * + * @name Phaser.Time.TimerEvent#repeatCount + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.repeatCount = 0; + + /** + * True if this TimerEvent loops, otherwise false. + * + * @name Phaser.Time.TimerEvent#loop + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ + this.loop = false; + + /** + * The callback that will be called when the TimerEvent occurs. + * + * @name Phaser.Time.TimerEvent#callback + * @type {function} + * @since 3.0.0 + */ + this.callback; + + /** + * The scope in which the callback will be called. + * + * @name Phaser.Time.TimerEvent#callbackScope + * @type {object} + * @since 3.0.0 + */ + this.callbackScope; + + /** + * Additional arguments to be passed to the callback. + * + * @name Phaser.Time.TimerEvent#args + * @type {array} + * @since 3.0.0 + */ + this.args; + + /** + * Scale the time causing this TimerEvent to update. + * + * @name Phaser.Time.TimerEvent#timeScale + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.timeScale = 1; + + /** + * Start this many MS into the elapsed (useful if you want a long duration with repeat, but for the first loop to fire quickly) + * + * @name Phaser.Time.TimerEvent#startAt + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.startAt = 0; + + /** + * The time in milliseconds which has elapsed since the Timer Event's creation. + * + * This value is local for the Timer Event and is relative to its Clock. As such, it's influenced by the Clock's time scale and paused state, the Timer Event's initial {@link #startAt} property, and the Timer Event's {@link #timeScale} and {@link #paused} state. + * + * @name Phaser.Time.TimerEvent#elapsed + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.elapsed = 0; + + /** + * Whether or not this timer is paused. + * + * @name Phaser.Time.TimerEvent#paused + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.paused = false; + + /** + * Whether the Timer Event's function has been called. + * + * When the Timer Event fires, this property will be set to `true` before the callback function is invoked and will be reset immediately afterward if the Timer Event should repeat. The value of this property does not directly influence whether the Timer Event will be removed from its Clock, but can prevent it from firing. + * + * @name Phaser.Time.TimerEvent#hasDispatched + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.hasDispatched = false; + + this.reset(config); + }, + + /** + * Completely reinitializes the Timer Event, regardless of its current state, according to a configuration object. + * + * @method Phaser.Time.TimerEvent#reset + * @since 3.0.0 + * + * @param {Phaser.Types.Time.TimerEventConfig} config - The new state for the Timer Event. + * + * @return {Phaser.Time.TimerEvent} This TimerEvent object. + */ + reset: function (config) + { + this.delay = GetFastValue(config, 'delay', 0); + + // Can also be set to -1 for an infinite loop (same as setting loop: true) + this.repeat = GetFastValue(config, 'repeat', 0); + + this.loop = GetFastValue(config, 'loop', false); + + this.callback = GetFastValue(config, 'callback', undefined); + + this.callbackScope = GetFastValue(config, 'callbackScope', this.callback); + + this.args = GetFastValue(config, 'args', []); + + this.timeScale = GetFastValue(config, 'timeScale', 1); + + this.startAt = GetFastValue(config, 'startAt', 0); + + this.paused = GetFastValue(config, 'paused', false); + + this.elapsed = this.startAt; + this.hasDispatched = false; + this.repeatCount = (this.repeat === -1 || this.loop) ? 999999999999 : this.repeat; + + return this; + }, + + /** + * Gets the progress of the current iteration, not factoring in repeats. + * + * @method Phaser.Time.TimerEvent#getProgress + * @since 3.0.0 + * + * @return {number} A number between 0 and 1 representing the current progress. + */ + getProgress: function () + { + return (this.elapsed / this.delay); + }, + + /** + * Gets the progress of the timer overall, factoring in repeats. + * + * @method Phaser.Time.TimerEvent#getOverallProgress + * @since 3.0.0 + * + * @return {number} The overall progress of the Timer Event, between 0 and 1. + */ + getOverallProgress: function () + { + if (this.repeat > 0) + { + var totalDuration = this.delay + (this.delay * this.repeat); + var totalElapsed = this.elapsed + (this.delay * (this.repeat - this.repeatCount)); + + return (totalElapsed / totalDuration); + } + else + { + return this.getProgress(); + } + }, + + /** + * Returns the number of times this Timer Event will repeat before finishing. + * + * This should not be confused with the number of times the Timer Event will fire before finishing. A return value of 0 doesn't indicate that the Timer Event has finished running - it indicates that it will not repeat after the next time it fires. + * + * @method Phaser.Time.TimerEvent#getRepeatCount + * @since 3.0.0 + * + * @return {number} How many times the Timer Event will repeat. + */ + getRepeatCount: function () + { + return this.repeatCount; + }, + + /** + * Returns the local elapsed time for the current iteration of the Timer Event. + * + * @method Phaser.Time.TimerEvent#getElapsed + * @since 3.0.0 + * + * @return {number} The local elapsed time in milliseconds. + */ + getElapsed: function () + { + return this.elapsed; + }, + + /** + * Returns the local elapsed time for the current iteration of the Timer Event in seconds. + * + * @method Phaser.Time.TimerEvent#getElapsedSeconds + * @since 3.0.0 + * + * @return {number} The local elapsed time in seconds. + */ + getElapsedSeconds: function () + { + return this.elapsed * 0.001; + }, + + /** + * Forces the Timer Event to immediately expire, thus scheduling its removal in the next frame. + * + * @method Phaser.Time.TimerEvent#remove + * @since 3.0.0 + * + * @param {boolean} [dispatchCallback] - If `true` (by default `false`), the function of the Timer Event will be called before its removal from its Clock. + */ + remove: function (dispatchCallback) + { + if (dispatchCallback === undefined) { dispatchCallback = false; } + + this.elapsed = this.delay; + + this.hasDispatched = !dispatchCallback; + + this.repeatCount = 0; + }, + + /** + * Destroys all object references in the Timer Event, i.e. its callback, scope, and arguments. + * + * Normally, this method is only called by the Clock when it shuts down. As such, it doesn't stop the Timer Event. If called manually, the Timer Event will still be updated by the Clock, but it won't do anything when it fires. + * + * @method Phaser.Time.TimerEvent#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.callback = undefined; + this.callbackScope = undefined; + this.args = []; + } + +}); + +module.exports = TimerEvent; + + +/***/ }), +/* 473 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RESERVED = __webpack_require__(1301); + +/** + * [description] + * + * @function Phaser.Tweens.Builders.GetProps + * @since 3.0.0 + * + * @param {object} config - The configuration object of the tween to get the target(s) from. + * + * @return {array} An array of all the targets the tween is operating on. + */ +var GetProps = function (config) +{ + var key; + var keys = []; + + // First see if we have a props object + + if (config.hasOwnProperty('props')) + { + for (key in config.props) + { + // Skip any property that starts with an underscore + if (key.substr(0, 1) !== '_') + { + keys.push({ key: key, value: config.props[key] }); + } + } + } + else + { + for (key in config) + { + // Skip any property that is in the ReservedProps list or that starts with an underscore + if (RESERVED.indexOf(key) === -1 && key.substr(0, 1) !== '_') + { + keys.push({ key: key, value: config[key] }); + } + } + } + + return keys; +}; + +module.exports = GetProps; + + +/***/ }), +/* 474 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetValue = __webpack_require__(6); + +/** + * Returns an array of all tweens in the given config + * + * @function Phaser.Tweens.Builders.GetTweens + * @since 3.0.0 + * + * @param {object} config - [description] + * + * @return {array} [description] + */ +var GetTweens = function (config) +{ + var tweens = GetValue(config, 'tweens', null); + + if (tweens === null) + { + return []; + } + else if (typeof tweens === 'function') + { + tweens = tweens.call(); + } + + if (!Array.isArray(tweens)) + { + tweens = [ tweens ]; + } + + return tweens; +}; + +module.exports = GetTweens; + + +/***/ }), +/* 475 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Defaults = __webpack_require__(219); +var GetAdvancedValue = __webpack_require__(14); +var GetBoolean = __webpack_require__(87); +var GetEaseFunction = __webpack_require__(96); +var GetNewValue = __webpack_require__(141); +var GetValue = __webpack_require__(6); +var GetValueOp = __webpack_require__(218); +var Tween = __webpack_require__(220); +var TweenData = __webpack_require__(221); + +/** + * Creates a new Number Tween. + * + * @function Phaser.Tweens.Builders.NumberTweenBuilder + * @since 3.0.0 + * + * @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - The owner of the new Tween. + * @param {Phaser.Types.Tweens.NumberTweenBuilderConfig} config - Configuration for the new Tween. + * @param {Phaser.Types.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults. + * + * @return {Phaser.Tweens.Tween} The new tween. + */ +var NumberTweenBuilder = function (parent, config, defaults) +{ + if (defaults === undefined) + { + defaults = Defaults; + } + + // var tween = this.tweens.addCounter({ + // from: 100, + // to: 200, + // ... (normal tween properties) + // }) + // + // Then use it in your game via: + // + // tween.getValue() + + var from = GetValue(config, 'from', 0); + var to = GetValue(config, 'to', 1); + + var targets = [ { value: from } ]; + + var delay = GetNewValue(config, 'delay', defaults.delay); + var duration = GetNewValue(config, 'duration', defaults.duration); + var easeParams = GetValue(config, 'easeParams', defaults.easeParams); + var ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), easeParams); + var hold = GetNewValue(config, 'hold', defaults.hold); + var repeat = GetNewValue(config, 'repeat', defaults.repeat); + var repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); + var yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); + + var data = []; + + var ops = GetValueOp('value', to); + + var tweenData = TweenData( + targets[0], + 'value', + ops.getEnd, + ops.getStart, + ease, + delay, + duration, + yoyo, + hold, + repeat, + repeatDelay, + false, + false + ); + + tweenData.start = from; + tweenData.current = from; + tweenData.to = to; + + data.push(tweenData); + + var tween = new Tween(parent, data, targets); + + tween.offset = GetAdvancedValue(config, 'offset', null); + tween.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); + tween.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); + tween.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); + tween.paused = GetBoolean(config, 'paused', false); + tween.useFrames = GetBoolean(config, 'useFrames', false); + + // Set the Callbacks + var scope = GetValue(config, 'callbackScope', tween); + + // Callback parameters: 0 = a reference to the Tween itself, 1 = the target/s of the Tween, ... your own params + var tweenArray = [ tween, null ]; + + var callbacks = Tween.TYPES; + + for (var i = 0; i < callbacks.length; i++) + { + var type = callbacks[i]; + + var callback = GetValue(config, type, false); + + if (callback) + { + var callbackScope = GetValue(config, type + 'Scope', scope); + var callbackParams = GetValue(config, type + 'Params', []); + + // The null is reset to be the Tween target + tween.setCallback(type, callback, tweenArray.concat(callbackParams), callbackScope); + } + } + + return tween; +}; + +module.exports = NumberTweenBuilder; + + +/***/ }), +/* 476 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clone = __webpack_require__(64); +var Defaults = __webpack_require__(219); +var GetAdvancedValue = __webpack_require__(14); +var GetBoolean = __webpack_require__(87); +var GetEaseFunction = __webpack_require__(96); +var GetNewValue = __webpack_require__(141); +var GetTargets = __webpack_require__(217); +var GetTweens = __webpack_require__(474); +var GetValue = __webpack_require__(6); +var Timeline = __webpack_require__(477); +var TweenBuilder = __webpack_require__(142); + +/** + * Builds a Timeline of Tweens based on a configuration object. + * + * @function Phaser.Tweens.Builders.TimelineBuilder + * @since 3.0.0 + * + * @param {Phaser.Tweens.TweenManager} manager - The Tween Manager to which the Timeline will belong. + * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline. + * + * @return {Phaser.Tweens.Timeline} The created Timeline. + */ +var TimelineBuilder = function (manager, config) +{ + var timeline = new Timeline(manager); + + var tweens = GetTweens(config); + + if (tweens.length === 0) + { + timeline.paused = true; + + return timeline; + } + + var defaults = Clone(Defaults); + + defaults.targets = GetTargets(config); + + // totalDuration: If specified each tween in the Timeline is given an equal portion of the totalDuration + + var totalDuration = GetAdvancedValue(config, 'totalDuration', 0); + + if (totalDuration > 0) + { + defaults.duration = Math.floor(totalDuration / tweens.length); + } + else + { + defaults.duration = GetNewValue(config, 'duration', defaults.duration); + } + + defaults.delay = GetNewValue(config, 'delay', defaults.delay); + defaults.easeParams = GetValue(config, 'easeParams', defaults.easeParams); + defaults.ease = GetEaseFunction(GetValue(config, 'ease', defaults.ease), defaults.easeParams); + defaults.hold = GetNewValue(config, 'hold', defaults.hold); + defaults.repeat = GetNewValue(config, 'repeat', defaults.repeat); + defaults.repeatDelay = GetNewValue(config, 'repeatDelay', defaults.repeatDelay); + defaults.yoyo = GetBoolean(config, 'yoyo', defaults.yoyo); + defaults.flipX = GetBoolean(config, 'flipX', defaults.flipX); + defaults.flipY = GetBoolean(config, 'flipY', defaults.flipY); + + // Create the Tweens + for (var i = 0; i < tweens.length; i++) + { + timeline.queue(TweenBuilder(timeline, tweens[i], defaults)); + } + + timeline.completeDelay = GetAdvancedValue(config, 'completeDelay', 0); + timeline.loop = Math.round(GetAdvancedValue(config, 'loop', 0)); + timeline.loopDelay = Math.round(GetAdvancedValue(config, 'loopDelay', 0)); + timeline.paused = GetBoolean(config, 'paused', false); + timeline.useFrames = GetBoolean(config, 'useFrames', false); + + // Callbacks + + var scope = GetValue(config, 'callbackScope', timeline); + + var timelineArray = [ timeline ]; + + var onStart = GetValue(config, 'onStart', false); + + // The Start of the Timeline + if (onStart) + { + var onStartScope = GetValue(config, 'onStartScope', scope); + var onStartParams = GetValue(config, 'onStartParams', []); + + timeline.setCallback('onStart', onStart, timelineArray.concat(onStartParams), onStartScope); + } + + var onUpdate = GetValue(config, 'onUpdate', false); + + // Every time the Timeline updates (regardless which Tweens are running) + if (onUpdate) + { + var onUpdateScope = GetValue(config, 'onUpdateScope', scope); + var onUpdateParams = GetValue(config, 'onUpdateParams', []); + + timeline.setCallback('onUpdate', onUpdate, timelineArray.concat(onUpdateParams), onUpdateScope); + } + + var onLoop = GetValue(config, 'onLoop', false); + + // Called when the whole Timeline loops + if (onLoop) + { + var onLoopScope = GetValue(config, 'onLoopScope', scope); + var onLoopParams = GetValue(config, 'onLoopParams', []); + + timeline.setCallback('onLoop', onLoop, timelineArray.concat(onLoopParams), onLoopScope); + } + + var onYoyo = GetValue(config, 'onYoyo', false); + + // Called when a Timeline yoyos + if (onYoyo) + { + var onYoyoScope = GetValue(config, 'onYoyoScope', scope); + var onYoyoParams = GetValue(config, 'onYoyoParams', []); + + timeline.setCallback('onYoyo', onYoyo, timelineArray.concat(null, onYoyoParams), onYoyoScope); + } + + var onComplete = GetValue(config, 'onComplete', false); + + // Called when the Timeline completes, after the completeDelay, etc. + if (onComplete) + { + var onCompleteScope = GetValue(config, 'onCompleteScope', scope); + var onCompleteParams = GetValue(config, 'onCompleteParams', []); + + timeline.setCallback('onComplete', onComplete, timelineArray.concat(onCompleteParams), onCompleteScope); + } + + return timeline; +}; + +module.exports = TimelineBuilder; + + +/***/ }), +/* 477 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(478); +var TweenBuilder = __webpack_require__(142); +var TWEEN_CONST = __webpack_require__(88); + +/** + * @classdesc + * A Timeline combines multiple Tweens into one. Its overall behavior is otherwise similar to a single Tween. + * + * The Timeline updates all of its Tweens simultaneously. Its methods allow you to easily build a sequence + * of Tweens (each one starting after the previous one) or run multiple Tweens at once during given parts of the Timeline. + * + * @class Timeline + * @memberof Phaser.Tweens + * @extends Phaser.Events.EventEmitter + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Tweens.TweenManager} manager - The Tween Manager which owns this Timeline. + */ +var Timeline = new Class({ + + Extends: EventEmitter, + + initialize: + + function Timeline (manager) + { + EventEmitter.call(this); + + /** + * The Tween Manager which owns this Timeline. + * + * @name Phaser.Tweens.Timeline#manager + * @type {Phaser.Tweens.TweenManager} + * @since 3.0.0 + */ + this.manager = manager; + + /** + * A constant value which allows this Timeline to be easily identified as one. + * + * @name Phaser.Tweens.Timeline#isTimeline + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.isTimeline = true; + + /** + * An array of Tween objects, each containing a unique property and target being tweened. + * + * @name Phaser.Tweens.Timeline#data + * @type {array} + * @default [] + * @since 3.0.0 + */ + this.data = []; + + /** + * The cached size of the data array. + * + * @name Phaser.Tweens.Timeline#totalData + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.totalData = 0; + + /** + * If true then duration, delay, etc values are all frame totals, rather than ms. + * + * @name Phaser.Tweens.Timeline#useFrames + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.useFrames = false; + + /** + * Scales the time applied to this Timeline. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. + * Value isn't used when calculating total duration of the Timeline, it's a run-time delta adjustment only. + * + * @name Phaser.Tweens.Timeline#timeScale + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.timeScale = 1; + + /** + * Loop this Timeline? Can be -1 for an infinite loop, or an integer. + * When enabled it will play through ALL Tweens again (use Tween.repeat to loop a single tween) + * + * @name Phaser.Tweens.Timeline#loop + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.loop = 0; + + /** + * Time in ms/frames before this Timeline loops. + * + * @name Phaser.Tweens.Timeline#loopDelay + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.loopDelay = 0; + + /** + * How many loops are left to run? + * + * @name Phaser.Tweens.Timeline#loopCounter + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.loopCounter = 0; + + /** + * Time in ms/frames before the 'onComplete' event fires. This never fires if loop = true (as it never completes) + * + * @name Phaser.Tweens.Timeline#completeDelay + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.completeDelay = 0; + + /** + * Countdown timer value, as used by `loopDelay` and `completeDelay`. + * + * @name Phaser.Tweens.Timeline#countdown + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.countdown = 0; + + /** + * The current state of the Timeline. + * + * @name Phaser.Tweens.Timeline#state + * @type {integer} + * @since 3.0.0 + */ + this.state = TWEEN_CONST.PENDING_ADD; + + /** + * The state of the Timeline when it was paused (used by Resume) + * + * @name Phaser.Tweens.Timeline#_pausedState + * @type {integer} + * @private + * @since 3.0.0 + */ + this._pausedState = TWEEN_CONST.PENDING_ADD; + + /** + * Does the Timeline start off paused? (if so it needs to be started with Timeline.play) + * + * @name Phaser.Tweens.Timeline#paused + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.paused = false; + + /** + * Elapsed time in ms/frames of this run through of the Timeline. + * + * @name Phaser.Tweens.Timeline#elapsed + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.elapsed = 0; + + /** + * Total elapsed time in ms/frames of the entire Timeline, including looping. + * + * @name Phaser.Tweens.Timeline#totalElapsed + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.totalElapsed = 0; + + /** + * Time in ms/frames for the whole Timeline to play through once, excluding loop amounts and loop delays. + * + * @name Phaser.Tweens.Timeline#duration + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.duration = 0; + + /** + * Value between 0 and 1. The amount of progress through the Timeline, _excluding loops_. + * + * @name Phaser.Tweens.Timeline#progress + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.progress = 0; + + /** + * Time in ms/frames for all Tweens in this Timeline to complete (including looping) + * + * @name Phaser.Tweens.Timeline#totalDuration + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.totalDuration = 0; + + /** + * Value between 0 and 1. The amount through the entire Timeline, including looping. + * + * @name Phaser.Tweens.Timeline#totalProgress + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.totalProgress = 0; + + this.callbacks = { + onComplete: null, + onLoop: null, + onStart: null, + onUpdate: null, + onYoyo: null + }; + + this.callbackScope; + }, + + /** + * Sets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + * + * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. + * + * @method Phaser.Tweens.Timeline#setTimeScale + * @since 3.0.0 + * + * @param {number} value - The time scale value to set. + * + * @return {this} This Timeline object. + */ + setTimeScale: function (value) + { + this.timeScale = value; + + return this; + }, + + /** + * Gets the value of the time scale applied to this Timeline. A value of 1 runs in real-time. + * A value of 0.5 runs 50% slower, and so on. + * + * @method Phaser.Tweens.Timeline#getTimeScale + * @since 3.0.0 + * + * @return {number} The value of the time scale applied to this Timeline. + */ + getTimeScale: function () + { + return this.timeScale; + }, + + /** + * Check whether or not the Timeline is playing. + * + * @method Phaser.Tweens.Timeline#isPlaying + * @since 3.0.0 + * + * @return {boolean} `true` if this Timeline is active, otherwise `false`. + */ + isPlaying: function () + { + return (this.state === TWEEN_CONST.ACTIVE); + }, + + /** + * Creates a new Tween, based on the given Tween Config, and adds it to this Timeline. + * + * @method Phaser.Tweens.Timeline#add + * @since 3.0.0 + * + * @param {(Phaser.Types.Tweens.TweenBuilderConfig|object)} config - The configuration object for the Tween. + * + * @return {this} This Timeline object. + */ + add: function (config) + { + return this.queue(TweenBuilder(this, config)); + }, + + /** + * Adds an existing Tween to this Timeline. + * + * @method Phaser.Tweens.Timeline#queue + * @since 3.0.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be added to this Timeline. + * + * @return {this} This Timeline object. + */ + queue: function (tween) + { + if (!this.isPlaying()) + { + tween.parent = this; + tween.parentIsTimeline = true; + + this.data.push(tween); + + this.totalData = this.data.length; + } + + return this; + }, + + /** + * Checks whether a Tween has an offset value. + * + * @method Phaser.Tweens.Timeline#hasOffset + * @since 3.0.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to check. + * + * @return {boolean} `true` if the tween has a non-null offset. + */ + hasOffset: function (tween) + { + return (tween.offset !== null); + }, + + /** + * Checks whether the offset value is a number or a directive that is relative to previous tweens. + * + * @method Phaser.Tweens.Timeline#isOffsetAbsolute + * @since 3.0.0 + * + * @param {number} value - The offset value to be evaluated. + * + * @return {boolean} `true` if the result is a number, `false` if it is a directive like " -= 1000". + */ + isOffsetAbsolute: function (value) + { + return (typeof(value) === 'number'); + }, + + /** + * Checks if the offset is a relative value rather than an absolute one. + * If the value is just a number, this returns false. + * + * @method Phaser.Tweens.Timeline#isOffsetRelative + * @since 3.0.0 + * + * @param {string} value - The offset value to be evaluated. + * + * @return {boolean} `true` if the value is relative, i.e " -= 1000". If `false`, the offset is absolute. + */ + isOffsetRelative: function (value) + { + var t = typeof(value); + + if (t === 'string') + { + var op = value[0]; + + if (op === '-' || op === '+') + { + return true; + } + } + + return false; + }, + + /** + * Parses the relative offset value, returning a positive or negative number. + * + * @method Phaser.Tweens.Timeline#getRelativeOffset + * @since 3.0.0 + * + * @param {string} value - The relative offset, in the format of '-=500', for example. The first character determines whether it will be a positive or negative number. Spacing matters here. + * @param {number} base - The value to use as the offset. + * + * @return {number} The parsed offset value. + */ + getRelativeOffset: function (value, base) + { + var op = value[0]; + var num = parseFloat(value.substr(2)); + var result = base; + + switch (op) + { + case '+': + result += num; + break; + + case '-': + result -= num; + break; + } + + // Cannot ever be < 0 + return Math.max(0, result); + }, + + /** + * Calculates the total duration of the timeline. + * + * Computes all tween durations and returns the full duration of the timeline. + * + * The resulting number is stored in the timeline, not as a return value. + * + * @method Phaser.Tweens.Timeline#calcDuration + * @since 3.0.0 + */ + calcDuration: function () + { + var prevEnd = 0; + var totalDuration = 0; + var offsetDuration = 0; + + for (var i = 0; i < this.totalData; i++) + { + var tween = this.data[i]; + + tween.init(); + + if (this.hasOffset(tween)) + { + if (this.isOffsetAbsolute(tween.offset)) + { + // An actual number, so it defines the start point from the beginning of the timeline + tween.calculatedOffset = tween.offset; + + if (tween.offset === 0) + { + offsetDuration = 0; + } + } + else if (this.isOffsetRelative(tween.offset)) + { + // A relative offset (i.e. '-=1000', so starts at 'offset' ms relative to the PREVIOUS Tweens ending time) + tween.calculatedOffset = this.getRelativeOffset(tween.offset, prevEnd); + } + } + else + { + // Sequential + tween.calculatedOffset = offsetDuration; + } + + prevEnd = tween.totalDuration + tween.calculatedOffset; + + totalDuration += tween.totalDuration; + offsetDuration += tween.totalDuration; + } + + // Excludes loop values + this.duration = totalDuration; + + this.loopCounter = (this.loop === -1) ? 999999999999 : this.loop; + + if (this.loopCounter > 0) + { + this.totalDuration = this.duration + this.completeDelay + ((this.duration + this.loopDelay) * this.loopCounter); + } + else + { + this.totalDuration = this.duration + this.completeDelay; + } + }, + + /** + * Initializes the timeline, which means all Tweens get their init() called, and the total duration will be computed. + * Returns a boolean indicating whether the timeline is auto-started or not. + * + * @method Phaser.Tweens.Timeline#init + * @since 3.0.0 + * + * @return {boolean} `true` if the Timeline is started. `false` if it is paused. + */ + init: function () + { + this.calcDuration(); + + this.progress = 0; + this.totalProgress = 0; + + if (this.paused) + { + this.state = TWEEN_CONST.PAUSED; + + return false; + } + else + { + return true; + } + }, + + /** + * Resets all of the timeline's tweens back to their initial states. + * The boolean parameter indicates whether tweens that are looping should reset as well, or not. + * + * @method Phaser.Tweens.Timeline#resetTweens + * @since 3.0.0 + * + * @param {boolean} resetFromLoop - If `true`, resets all looping tweens to their initial values. + */ + resetTweens: function (resetFromLoop) + { + for (var i = 0; i < this.totalData; i++) + { + var tween = this.data[i]; + + tween.play(resetFromLoop); + } + }, + + /** + * Sets a callback for the Timeline. + * + * @method Phaser.Tweens.Timeline#setCallback + * @since 3.0.0 + * + * @param {string} type - The internal type of callback to set. + * @param {function} callback - Timeline allows multiple tweens to be linked together to create a streaming sequence. + * @param {array} [params] - The parameters to pass to the callback. + * @param {object} [scope] - The context scope of the callback. + * + * @return {this} This Timeline object. + */ + setCallback: function (type, callback, params, scope) + { + if (Timeline.TYPES.indexOf(type) !== -1) + { + this.callbacks[type] = { func: callback, scope: scope, params: params }; + } + + return this; + }, + + /** + * Passed a Tween to the Tween Manager and requests it be made active. + * + * @method Phaser.Tweens.Timeline#makeActive + * @since 3.3.0 + * + * @param {Phaser.Tweens.Tween} tween - The tween object to make active. + * + * @return {Phaser.Tweens.TweenManager} The Timeline's Tween Manager reference. + */ + makeActive: function (tween) + { + return this.manager.makeActive(tween); + }, + + /** + * Starts playing the Timeline. + * + * @method Phaser.Tweens.Timeline#play + * @fires Phaser.Tweens.Events#TIMELINE_START + * @since 3.0.0 + */ + play: function () + { + if (this.state === TWEEN_CONST.ACTIVE) + { + return; + } + + if (this.paused) + { + this.paused = false; + + this.manager.makeActive(this); + + return; + } + else + { + this.resetTweens(false); + + this.state = TWEEN_CONST.ACTIVE; + } + + var onStart = this.callbacks.onStart; + + if (onStart) + { + onStart.func.apply(onStart.scope, onStart.params); + } + + this.emit(Events.TIMELINE_START, this); + }, + + /** + * Updates the Timeline's `state` and fires callbacks and events. + * + * @method Phaser.Tweens.Timeline#nextState + * @fires Phaser.Tweens.Events#TIMELINE_COMPLETE + * @fires Phaser.Tweens.Events#TIMELINE_LOOP + * @since 3.0.0 + * + * @see Phaser.Tweens.Timeline#update + */ + nextState: function () + { + if (this.loopCounter > 0) + { + // Reset the elapsed time + this.elapsed = 0; + this.progress = 0; + + this.loopCounter--; + + var onLoop = this.callbacks.onLoop; + + if (onLoop) + { + onLoop.func.apply(onLoop.scope, onLoop.params); + } + + this.emit(Events.TIMELINE_LOOP, this, this.loopCounter); + + this.resetTweens(true); + + if (this.loopDelay > 0) + { + this.countdown = this.loopDelay; + this.state = TWEEN_CONST.LOOP_DELAY; + } + else + { + this.state = TWEEN_CONST.ACTIVE; + } + } + else if (this.completeDelay > 0) + { + this.countdown = this.completeDelay; + this.state = TWEEN_CONST.COMPLETE_DELAY; + } + else + { + this.state = TWEEN_CONST.PENDING_REMOVE; + + var onComplete = this.callbacks.onComplete; + + if (onComplete) + { + onComplete.func.apply(onComplete.scope, onComplete.params); + } + + this.emit(Events.TIMELINE_COMPLETE, this); + } + }, + + /** + * Returns 'true' if this Timeline has finished and should be removed from the Tween Manager. + * Otherwise, returns false. + * + * @method Phaser.Tweens.Timeline#update + * @fires Phaser.Tweens.Events#TIMELINE_COMPLETE + * @fires Phaser.Tweens.Events#TIMELINE_UPDATE + * @since 3.0.0 + * + * @param {number} timestamp - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + * + * @return {boolean} Returns `true` if this Timeline has finished and should be removed from the Tween Manager. + */ + update: function (timestamp, delta) + { + if (this.state === TWEEN_CONST.PAUSED) + { + return; + } + + if (this.useFrames) + { + delta = 1 * this.manager.timeScale; + } + + delta *= this.timeScale; + + this.elapsed += delta; + this.progress = Math.min(this.elapsed / this.duration, 1); + + this.totalElapsed += delta; + this.totalProgress = Math.min(this.totalElapsed / this.totalDuration, 1); + + switch (this.state) + { + case TWEEN_CONST.ACTIVE: + + var stillRunning = this.totalData; + + for (var i = 0; i < this.totalData; i++) + { + var tween = this.data[i]; + + if (tween.update(timestamp, delta)) + { + stillRunning--; + } + } + + var onUpdate = this.callbacks.onUpdate; + + if (onUpdate) + { + onUpdate.func.apply(onUpdate.scope, onUpdate.params); + } + + this.emit(Events.TIMELINE_UPDATE, this); + + // Anything still running? If not, we're done + if (stillRunning === 0) + { + this.nextState(); + } + + break; + + case TWEEN_CONST.LOOP_DELAY: + + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.state = TWEEN_CONST.ACTIVE; + } + + break; + + case TWEEN_CONST.COMPLETE_DELAY: + + this.countdown -= delta; + + if (this.countdown <= 0) + { + this.state = TWEEN_CONST.PENDING_REMOVE; + + var onComplete = this.callbacks.onComplete; + + if (onComplete) + { + onComplete.func.apply(onComplete.scope, onComplete.params); + } + + this.emit(Events.TIMELINE_COMPLETE, this); + } + + break; + } + + return (this.state === TWEEN_CONST.PENDING_REMOVE); + }, + + /** + * Stops the Timeline immediately, whatever stage of progress it is at and flags it for removal by the TweenManager. + * + * @method Phaser.Tweens.Timeline#stop + * @since 3.0.0 + */ + stop: function () + { + this.state = TWEEN_CONST.PENDING_REMOVE; + }, + + /** + * Pauses the Timeline, retaining its internal state. + * + * Calling this on a Timeline that is already paused has no effect and fires no event. + * + * @method Phaser.Tweens.Timeline#pause + * @fires Phaser.Tweens.Events#TIMELINE_PAUSE + * @since 3.0.0 + * + * @return {this} This Timeline object. + */ + pause: function () + { + if (this.state === TWEEN_CONST.PAUSED) + { + return; + } + + this.paused = true; + + this._pausedState = this.state; + + this.state = TWEEN_CONST.PAUSED; + + this.emit(Events.TIMELINE_PAUSE, this); + + return this; + }, + + /** + * Resumes a paused Timeline from where it was when it was paused. + * + * Calling this on a Timeline that isn't paused has no effect and fires no event. + * + * @method Phaser.Tweens.Timeline#resume + * @fires Phaser.Tweens.Events#TIMELINE_RESUME + * @since 3.0.0 + * + * @return {this} This Timeline object. + */ + resume: function () + { + if (this.state === TWEEN_CONST.PAUSED) + { + this.paused = false; + + this.state = this._pausedState; + + this.emit(Events.TIMELINE_RESUME, this); + } + + return this; + }, + + /** + * Checks if any of the Tweens in this Timeline as operating on the target object. + * + * Returns `false` if no Tweens operate on the target object. + * + * @method Phaser.Tweens.Timeline#hasTarget + * @since 3.0.0 + * + * @param {object} target - The target to check all Tweens against. + * + * @return {boolean} `true` if there is at least a single Tween that operates on the target object, otherwise `false`. + */ + hasTarget: function (target) + { + for (var i = 0; i < this.data.length; i++) + { + if (this.data[i].hasTarget(target)) + { + return true; + } + } + + return false; + }, + + /** + * Stops all the Tweens in the Timeline immediately, whatever stage of progress they are at and flags + * them for removal by the TweenManager. + * + * @method Phaser.Tweens.Timeline#destroy + * @since 3.0.0 + */ + destroy: function () + { + for (var i = 0; i < this.data.length; i++) + { + this.data[i].stop(); + } + } + +}); + +Timeline.TYPES = [ 'onStart', 'onUpdate', 'onLoop', 'onComplete', 'onYoyo' ]; + +module.exports = Timeline; + + +/***/ }), +/* 478 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tweens.Events + */ + +module.exports = { + + TIMELINE_COMPLETE: __webpack_require__(1302), + TIMELINE_LOOP: __webpack_require__(1303), + TIMELINE_PAUSE: __webpack_require__(1304), + TIMELINE_RESUME: __webpack_require__(1305), + TIMELINE_START: __webpack_require__(1306), + TIMELINE_UPDATE: __webpack_require__(1307) + +}; + + +/***/ }), +/* 479 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseAnimation = __webpack_require__(146); +var Class = __webpack_require__(0); +var Events = __webpack_require__(107); + +/** + * @classdesc + * A Game Object Animation Controller. + * + * This controller lives as an instance within a Game Object, accessible as `sprite.anims`. + * + * @class Animation + * @memberof Phaser.GameObjects.Components + * @constructor + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} parent - The Game Object to which this animation controller belongs. + */ +var Animation = new Class({ + + initialize: + + function Animation (parent) + { + /** + * The Game Object to which this animation controller belongs. + * + * @name Phaser.GameObjects.Components.Animation#parent + * @type {Phaser.GameObjects.GameObject} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * A reference to the global Animation Manager. + * + * @name Phaser.GameObjects.Components.Animation#animationManager + * @type {Phaser.Animations.AnimationManager} + * @since 3.0.0 + */ + this.animationManager = parent.scene.sys.anims; + + this.animationManager.once(Events.REMOVE_ANIMATION, this.remove, this); + + /** + * Is an animation currently playing or not? + * + * @name Phaser.GameObjects.Components.Animation#isPlaying + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.isPlaying = false; + + /** + * The current Animation loaded into this Animation Controller. + * + * @name Phaser.GameObjects.Components.Animation#currentAnim + * @type {?Phaser.Animations.Animation} + * @default null + * @since 3.0.0 + */ + this.currentAnim = null; + + /** + * The current AnimationFrame being displayed by this Animation Controller. + * + * @name Phaser.GameObjects.Components.Animation#currentFrame + * @type {?Phaser.Animations.AnimationFrame} + * @default null + * @since 3.0.0 + */ + this.currentFrame = null; + + /** + * The key of the next Animation to be loaded into this Animation Controller when the current animation completes. + * + * @name Phaser.GameObjects.Components.Animation#nextAnim + * @type {?string} + * @default null + * @since 3.16.0 + */ + this.nextAnim = null; + + /** + * Time scale factor. + * + * @name Phaser.GameObjects.Components.Animation#_timeScale + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + this._timeScale = 1; + + /** + * The frame rate of playback in frames per second. + * The default is 24 if the `duration` property is `null`. + * + * @name Phaser.GameObjects.Components.Animation#frameRate + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.frameRate = 0; + + /** + * How long the animation should play for, in milliseconds. + * If the `frameRate` property has been set then it overrides this value, + * otherwise the `frameRate` is derived from `duration`. + * + * @name Phaser.GameObjects.Components.Animation#duration + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.duration = 0; + + /** + * ms per frame, not including frame specific modifiers that may be present in the Animation data. + * + * @name Phaser.GameObjects.Components.Animation#msPerFrame + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.msPerFrame = 0; + + /** + * Skip frames if the time lags, or always advanced anyway? + * + * @name Phaser.GameObjects.Components.Animation#skipMissedFrames + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.skipMissedFrames = true; + + /** + * A delay before starting playback, in milliseconds. + * + * @name Phaser.GameObjects.Components.Animation#_delay + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._delay = 0; + + /** + * Number of times to repeat the animation (-1 for infinity) + * + * @name Phaser.GameObjects.Components.Animation#_repeat + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._repeat = 0; + + /** + * Delay before the repeat starts, in milliseconds. + * + * @name Phaser.GameObjects.Components.Animation#_repeatDelay + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._repeatDelay = 0; + + /** + * Should the animation yoyo? (reverse back down to the start) before repeating? + * + * @name Phaser.GameObjects.Components.Animation#_yoyo + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._yoyo = false; + + /** + * Will the playhead move forwards (`true`) or in reverse (`false`). + * + * @name Phaser.GameObjects.Components.Animation#forward + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.forward = true; + + /** + * An Internal trigger that's play the animation in reverse mode ('true') or not ('false'), + * needed because forward can be changed by yoyo feature. + * + * @name Phaser.GameObjects.Components.Animation#_reverse + * @type {boolean} + * @default false + * @private + * @since 3.12.0 + */ + this._reverse = false; + + /** + * Internal time overflow accumulator. + * + * @name Phaser.GameObjects.Components.Animation#accumulator + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.accumulator = 0; + + /** + * The time point at which the next animation frame will change. + * + * @name Phaser.GameObjects.Components.Animation#nextTick + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.nextTick = 0; + + /** + * An internal counter keeping track of how many repeats are left to play. + * + * @name Phaser.GameObjects.Components.Animation#repeatCounter + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.repeatCounter = 0; + + /** + * An internal flag keeping track of pending repeats. + * + * @name Phaser.GameObjects.Components.Animation#pendingRepeat + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.pendingRepeat = false; + + /** + * Is the Animation paused? + * + * @name Phaser.GameObjects.Components.Animation#_paused + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._paused = false; + + /** + * Was the animation previously playing before being paused? + * + * @name Phaser.GameObjects.Components.Animation#_wasPlaying + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._wasPlaying = false; + + /** + * Internal property tracking if this Animation is waiting to stop. + * + * 0 = No + * 1 = Waiting for ms to pass + * 2 = Waiting for repeat + * 3 = Waiting for specific frame + * + * @name Phaser.GameObjects.Components.Animation#_pendingStop + * @type {integer} + * @private + * @since 3.4.0 + */ + this._pendingStop = 0; + + /** + * Internal property used by _pendingStop. + * + * @name Phaser.GameObjects.Components.Animation#_pendingStopValue + * @type {any} + * @private + * @since 3.4.0 + */ + this._pendingStopValue; + }, + + /** + * Sets an animation to be played immediately after the current one completes. + * + * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, or have the `stop` method called directly on it. + * + * An animation set to repeat forever will never enter a completed state. + * + * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` callback). + * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. + * + * Call this method with no arguments to reset the chained animation. + * + * @method Phaser.GameObjects.Components.Animation#chain + * @since 3.16.0 + * + * @param {(string|Phaser.Animations.Animation)} [key] - The string-based key of the animation to play next, as defined previously in the Animation Manager. Or an Animation instance. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + chain: function (key) + { + if (key instanceof BaseAnimation) + { + key = key.key; + } + + this.nextAnim = key; + + return this.parent; + }, + + /** + * Sets the amount of time, in milliseconds, that the animation will be delayed before starting playback. + * + * @method Phaser.GameObjects.Components.Animation#setDelay + * @since 3.4.0 + * + * @param {integer} [value=0] - The amount of time, in milliseconds, to wait before starting playback. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + setDelay: function (value) + { + if (value === undefined) { value = 0; } + + this._delay = value; + + return this.parent; + }, + + /** + * Gets the amount of time, in milliseconds that the animation will be delayed before starting playback. + * + * @method Phaser.GameObjects.Components.Animation#getDelay + * @since 3.4.0 + * + * @return {integer} The amount of time, in milliseconds, the Animation will wait before starting playback. + */ + getDelay: function () + { + return this._delay; + }, + + /** + * Waits for the specified delay, in milliseconds, then starts playback of the requested animation. + * + * @method Phaser.GameObjects.Components.Animation#delayedPlay + * @since 3.0.0 + * + * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. + * @param {string} key - The key of the animation to play. + * @param {integer} [startFrame=0] - The frame of the animation to start from. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + delayedPlay: function (delay, key, startFrame) + { + this.play(key, true, startFrame); + + this.nextTick += delay; + + return this.parent; + }, + + /** + * Returns the key of the animation currently loaded into this component. + * + * @method Phaser.GameObjects.Components.Animation#getCurrentKey + * @since 3.0.0 + * + * @return {string} The key of the Animation loaded into this component. + */ + getCurrentKey: function () + { + if (this.currentAnim) + { + return this.currentAnim.key; + } + }, + + /** + * Internal method used to load an animation into this component. + * + * @method Phaser.GameObjects.Components.Animation#load + * @protected + * @since 3.0.0 + * + * @param {string} key - The key of the animation to load. + * @param {integer} [startFrame=0] - The start frame of the animation to load. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + load: function (key, startFrame) + { + if (startFrame === undefined) { startFrame = 0; } + + if (this.isPlaying) + { + this.stop(); + } + + // Load the new animation in + this.animationManager.load(this, key, startFrame); + + return this.parent; + }, + + /** + * Pause the current animation and set the `isPlaying` property to `false`. + * You can optionally pause it at a specific frame. + * + * @method Phaser.GameObjects.Components.Animation#pause + * @since 3.0.0 + * + * @param {Phaser.Animations.AnimationFrame} [atFrame] - An optional frame to set after pausing the animation. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + pause: function (atFrame) + { + if (!this._paused) + { + this._paused = true; + this._wasPlaying = this.isPlaying; + this.isPlaying = false; + } + + if (atFrame !== undefined) + { + this.updateFrame(atFrame); + } + + return this.parent; + }, + + /** + * Resumes playback of a paused animation and sets the `isPlaying` property to `true`. + * You can optionally tell it to start playback from a specific frame. + * + * @method Phaser.GameObjects.Components.Animation#resume + * @since 3.0.0 + * + * @param {Phaser.Animations.AnimationFrame} [fromFrame] - An optional frame to set before restarting playback. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + resume: function (fromFrame) + { + if (this._paused) + { + this._paused = false; + this.isPlaying = this._wasPlaying; + } + + if (fromFrame !== undefined) + { + this.updateFrame(fromFrame); + } + + return this.parent; + }, + + /** + * `true` if the current animation is paused, otherwise `false`. + * + * @name Phaser.GameObjects.Components.Animation#isPaused + * @readonly + * @type {boolean} + * @since 3.4.0 + */ + isPaused: { + + get: function () + { + return this._paused; + } + + }, + + /** + * Plays an Animation on a Game Object that has the Animation component, such as a Sprite. + * + * Animations are stored in the global Animation Manager and are referenced by a unique string-based key. + * + * @method Phaser.GameObjects.Components.Animation#play + * @fires Phaser.GameObjects.Components.Animation#onStartEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + play: function (key, ignoreIfPlaying, startFrame) + { + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + if (startFrame === undefined) { startFrame = 0; } + + if (key instanceof BaseAnimation) + { + key = key.key; + } + + if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key) + { + return this.parent; + } + + this.forward = true; + this._reverse = false; + + return this._startAnimation(key, startFrame); + }, + + /** + * Plays an Animation (in reverse mode) on the Game Object that owns this Animation Component. + * + * @method Phaser.GameObjects.Components.Animation#playReverse + * @fires Phaser.GameObjects.Components.Animation#onStartEvent + * @since 3.12.0 + * + * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. + * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. + * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + playReverse: function (key, ignoreIfPlaying, startFrame) + { + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + if (startFrame === undefined) { startFrame = 0; } + + if (key instanceof BaseAnimation) + { + key = key.key; + } + + if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key) + { + return this.parent; + } + + this.forward = false; + this._reverse = true; + + return this._startAnimation(key, startFrame); + }, + + /** + * Load an Animation and fires 'onStartEvent' event, extracted from 'play' method. + * + * @method Phaser.GameObjects.Components.Animation#_startAnimation + * @fires Phaser.Animations.Events#START_ANIMATION_EVENT + * @fires Phaser.Animations.Events#SPRITE_START_ANIMATION_EVENT + * @fires Phaser.Animations.Events#SPRITE_START_KEY_ANIMATION_EVENT + * @since 3.12.0 + * + * @param {string} key - The string-based key of the animation to play, as defined previously in the Animation Manager. + * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + _startAnimation: function (key, startFrame) + { + this.load(key, startFrame); + + var anim = this.currentAnim; + var gameObject = this.parent; + + // Should give us 9,007,199,254,740,991 safe repeats + this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat; + + anim.getFirstTick(this); + + this.isPlaying = true; + this.pendingRepeat = false; + + if (anim.showOnStart) + { + gameObject.visible = true; + } + + var frame = this.currentFrame; + + anim.emit(Events.ANIMATION_START, anim, frame, gameObject); + + gameObject.emit(Events.SPRITE_ANIMATION_KEY_START + key, anim, frame, gameObject); + + gameObject.emit(Events.SPRITE_ANIMATION_START, anim, frame, gameObject); + + return gameObject; + }, + + /** + * Reverse the Animation that is already playing on the Game Object. + * + * @method Phaser.GameObjects.Components.Animation#reverse + * @since 3.12.0 + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + reverse: function () + { + if (this.isPlaying) + { + this._reverse = !this._reverse; + + this.forward = !this.forward; + } + + return this.parent; + }, + + /** + * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. + * If the animation has a non-zero repeat defined, `getProgress` and `getTotalProgress` will be different + * because `getProgress` doesn't include any repeats or repeat delays, whereas `getTotalProgress` does. + * + * @method Phaser.GameObjects.Components.Animation#getProgress + * @since 3.4.0 + * + * @return {number} The progress of the current animation, between 0 and 1. + */ + getProgress: function () + { + var p = this.currentFrame.progress; + + if (!this.forward) + { + p = 1 - p; + } + + return p; + }, + + /** + * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. + * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. + * + * @method Phaser.GameObjects.Components.Animation#setProgress + * @since 3.4.0 + * + * @param {number} [value=0] - The progress value, between 0 and 1. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + setProgress: function (value) + { + if (!this.forward) + { + value = 1 - value; + } + + this.setCurrentFrame(this.currentAnim.getFrameByProgress(value)); + + return this.parent; + }, + + /** + * Handle the removal of an animation from the Animation Manager. + * + * @method Phaser.GameObjects.Components.Animation#remove + * @since 3.0.0 + * + * @param {string} [key] - The key of the removed Animation. + * @param {Phaser.Animations.Animation} [animation] - The removed Animation. + */ + remove: function (key, animation) + { + if (animation === undefined) { animation = this.currentAnim; } + + if (this.isPlaying && animation.key === this.currentAnim.key) + { + this.stop(); + + this.setCurrentFrame(this.currentAnim.frames[0]); + } + }, + + /** + * Gets the number of times that the animation will repeat + * after its first iteration. For example, if returns 1, the animation will + * play a total of twice (the initial play plus 1 repeat). + * A value of -1 means the animation will repeat indefinitely. + * + * @method Phaser.GameObjects.Components.Animation#getRepeat + * @since 3.4.0 + * + * @return {integer} The number of times that the animation will repeat. + */ + getRepeat: function () + { + return this._repeat; + }, + + /** + * Sets the number of times that the animation should repeat + * after its first iteration. For example, if repeat is 1, the animation will + * play a total of twice (the initial play plus 1 repeat). + * To repeat indefinitely, use -1. repeat should always be an integer. + * + * @method Phaser.GameObjects.Components.Animation#setRepeat + * @since 3.4.0 + * + * @param {integer} value - The number of times that the animation should repeat. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + setRepeat: function (value) + { + this._repeat = value; + + this.repeatCounter = 0; + + return this.parent; + }, + + /** + * Gets the amount of delay between repeats, if any. + * + * @method Phaser.GameObjects.Components.Animation#getRepeatDelay + * @since 3.4.0 + * + * @return {number} The delay between repeats. + */ + getRepeatDelay: function () + { + return this._repeatDelay; + }, + + /** + * Sets the amount of time in seconds between repeats. + * For example, if `repeat` is 2 and `repeatDelay` is 10, the animation will play initially, + * then wait for 10 seconds before repeating, then play again, then wait another 10 seconds + * before doing its final repeat. + * + * @method Phaser.GameObjects.Components.Animation#setRepeatDelay + * @since 3.4.0 + * + * @param {number} value - The delay to wait between repeats, in seconds. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + setRepeatDelay: function (value) + { + this._repeatDelay = value; + + return this.parent; + }, + + /** + * Restarts the current animation from its beginning, optionally including its delay value. + * + * @method Phaser.GameObjects.Components.Animation#restart + * @fires Phaser.Animations.Events#RESTART_ANIMATION_EVENT + * @fires Phaser.Animations.Events#SPRITE_RESTART_ANIMATION_EVENT + * @fires Phaser.Animations.Events#SPRITE_RESTART_KEY_ANIMATION_EVENT + * @since 3.0.0 + * + * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + restart: function (includeDelay) + { + if (includeDelay === undefined) { includeDelay = false; } + + var anim = this.currentAnim; + + anim.getFirstTick(this, includeDelay); + + this.forward = true; + this.isPlaying = true; + this.pendingRepeat = false; + this._paused = false; + + // Set frame + this.updateFrame(anim.frames[0]); + + var gameObject = this.parent; + var frame = this.currentFrame; + + anim.emit(Events.ANIMATION_RESTART, anim, frame, gameObject); + + gameObject.emit(Events.SPRITE_ANIMATION_KEY_RESTART + anim.key, anim, frame, gameObject); + + gameObject.emit(Events.SPRITE_ANIMATION_RESTART, anim, frame, gameObject); + + return this.parent; + }, + + /** + * Immediately stops the current animation from playing and dispatches the `animationcomplete` event. + * + * If no animation is set, no event will be dispatched. + * + * If there is another animation queued (via the `chain` method) then it will start playing immediately. + * + * @method Phaser.GameObjects.Components.Animation#stop + * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + stop: function () + { + this._pendingStop = 0; + + this.isPlaying = false; + + var gameObject = this.parent; + var anim = this.currentAnim; + var frame = this.currentFrame; + + if (anim) + { + anim.emit(Events.ANIMATION_COMPLETE, anim, frame, gameObject); + + gameObject.emit(Events.SPRITE_ANIMATION_KEY_COMPLETE + anim.key, anim, frame, gameObject); + + gameObject.emit(Events.SPRITE_ANIMATION_COMPLETE, anim, frame, gameObject); + } + + if (this.nextAnim) + { + var key = this.nextAnim; + + this.nextAnim = null; + + this.play(key); + } + + return gameObject; + }, + + /** + * Stops the current animation from playing after the specified time delay, given in milliseconds. + * + * @method Phaser.GameObjects.Components.Animation#stopAfterDelay + * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent + * @since 3.4.0 + * + * @param {integer} delay - The number of milliseconds to wait before stopping this animation. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + stopAfterDelay: function (delay) + { + this._pendingStop = 1; + this._pendingStopValue = delay; + + return this.parent; + }, + + /** + * Stops the current animation from playing when it next repeats. + * + * @method Phaser.GameObjects.Components.Animation#stopOnRepeat + * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent + * @since 3.4.0 + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + stopOnRepeat: function () + { + this._pendingStop = 2; + + return this.parent; + }, + + /** + * Stops the current animation from playing when it next sets the given frame. + * If this frame doesn't exist within the animation it will not stop it from playing. + * + * @method Phaser.GameObjects.Components.Animation#stopOnFrame + * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent + * @since 3.4.0 + * + * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + stopOnFrame: function (frame) + { + this._pendingStop = 3; + this._pendingStopValue = frame; + + return this.parent; + }, + + /** + * Sets the Time Scale factor, allowing you to make the animation go go faster or slower than default. + * Where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. + * + * @method Phaser.GameObjects.Components.Animation#setTimeScale + * @since 3.4.0 + * + * @param {number} [value=1] - The time scale factor, where 1 is no change, 0.5 is half speed, etc. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + setTimeScale: function (value) + { + if (value === undefined) { value = 1; } + + this._timeScale = value; + + return this.parent; + }, + + /** + * Gets the Time Scale factor. + * + * @method Phaser.GameObjects.Components.Animation#getTimeScale + * @since 3.4.0 + * + * @return {number} The Time Scale value. + */ + getTimeScale: function () + { + return this._timeScale; + }, + + /** + * Returns the total number of frames in this animation. + * + * @method Phaser.GameObjects.Components.Animation#getTotalFrames + * @since 3.4.0 + * + * @return {integer} The total number of frames in this animation. + */ + getTotalFrames: function () + { + return this.currentAnim.frames.length; + }, + + /** + * The internal update loop for the Animation Component. + * + * @method Phaser.GameObjects.Components.Animation#update + * @since 3.0.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function (time, delta) + { + if (!this.currentAnim || !this.isPlaying || this.currentAnim.paused) + { + return; + } + + this.accumulator += delta * this._timeScale; + + if (this._pendingStop === 1) + { + this._pendingStopValue -= delta; + + if (this._pendingStopValue <= 0) + { + return this.currentAnim.completeAnimation(this); + } + } + + if (this.accumulator >= this.nextTick) + { + this.currentAnim.setFrame(this); + } + }, + + /** + * Sets the given Animation Frame as being the current frame + * and applies it to the parent Game Object, adjusting its size and origin as needed. + * + * @method Phaser.GameObjects.Components.Animation#setCurrentFrame + * @since 3.4.0 + * + * @param {Phaser.Animations.AnimationFrame} animationFrame - The Animation Frame to set as being current. + * + * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. + */ + setCurrentFrame: function (animationFrame) + { + var gameObject = this.parent; + + this.currentFrame = animationFrame; + + gameObject.texture = animationFrame.frame.texture; + gameObject.frame = animationFrame.frame; + + if (gameObject.isCropped) + { + gameObject.frame.updateCropUVs(gameObject._crop, gameObject.flipX, gameObject.flipY); + } + + gameObject.setSizeToFrame(); + + if (animationFrame.frame.customPivot) + { + gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY); + } + else + { + gameObject.updateDisplayOrigin(); + } + + return gameObject; + }, + + /** + * Internal frame change handler. + * + * @method Phaser.GameObjects.Components.Animation#updateFrame + * @fires Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE_EVENT + * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE_EVENT + * @private + * @since 3.0.0 + * + * @param {Phaser.Animations.AnimationFrame} animationFrame - The animation frame to change to. + */ + updateFrame: function (animationFrame) + { + var gameObject = this.setCurrentFrame(animationFrame); + + if (this.isPlaying) + { + if (animationFrame.setAlpha) + { + gameObject.alpha = animationFrame.alpha; + } + + var anim = this.currentAnim; + + gameObject.emit(Events.SPRITE_ANIMATION_KEY_UPDATE + anim.key, anim, animationFrame, gameObject); + + gameObject.emit(Events.SPRITE_ANIMATION_UPDATE, anim, animationFrame, gameObject); + + if (this._pendingStop === 3 && this._pendingStopValue === animationFrame) + { + this.currentAnim.completeAnimation(this); + } + } + }, + + /** + * Advances the animation to the next frame, regardless of the time or animation state. + * If the animation is set to repeat, or yoyo, this will still take effect. + * + * Calling this does not change the direction of the animation. I.e. if it was currently + * playing in reverse, calling this method doesn't then change the direction to forwards. + * + * @method Phaser.GameObjects.Components.Animation#nextFrame + * @since 3.16.0 + * + * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. + */ + nextFrame: function () + { + if (this.currentAnim) + { + this.currentAnim.nextFrame(this); + } + + return this.parent; + }, + + /** + * Advances the animation to the previous frame, regardless of the time or animation state. + * If the animation is set to repeat, or yoyo, this will still take effect. + * + * Calling this does not change the direction of the animation. I.e. if it was currently + * playing in forwards, calling this method doesn't then change the direction to backwards. + * + * @method Phaser.GameObjects.Components.Animation#previousFrame + * @since 3.16.0 + * + * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. + */ + previousFrame: function () + { + if (this.currentAnim) + { + this.currentAnim.previousFrame(this); + } + + return this.parent; + }, + + /** + * Sets if the current Animation will yoyo when it reaches the end. + * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. + * + * @method Phaser.GameObjects.Components.Animation#setYoyo + * @since 3.4.0 + * + * @param {boolean} [value=false] - `true` if the animation should yoyo, `false` to not. + * + * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. + */ + setYoyo: function (value) + { + if (value === undefined) { value = false; } + + this._yoyo = value; + + return this.parent; + }, + + /** + * Gets if the current Animation will yoyo when it reaches the end. + * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. + * + * @method Phaser.GameObjects.Components.Animation#getYoyo + * @since 3.4.0 + * + * @return {boolean} `true` if the animation is set to yoyo, `false` if not. + */ + getYoyo: function () + { + return this._yoyo; + }, + + /** + * Destroy this Animation component. + * + * Unregisters event listeners and cleans up its references. + * + * @method Phaser.GameObjects.Components.Animation#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.animationManager.off(Events.REMOVE_ANIMATION, this.remove, this); + + this.animationManager = null; + this.parent = null; + + this.currentAnim = null; + this.currentFrame = null; + } + +}); + +module.exports = Animation; + + +/***/ }), +/* 480 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasSnapshot = __webpack_require__(481); +var CameraEvents = __webpack_require__(48); +var Class = __webpack_require__(0); +var CONST = __webpack_require__(26); +var GetBlendModes = __webpack_require__(482); +var ScaleEvents = __webpack_require__(89); +var ScaleModes = __webpack_require__(104); +var Smoothing = __webpack_require__(113); +var TransformMatrix = __webpack_require__(32); + +/** + * @classdesc + * The Canvas Renderer is responsible for managing 2D canvas rendering contexts, including the one used by the Game's canvas. It tracks the internal state of a given context and can renderer textured Game Objects to it, taking into account alpha, blending, and scaling. + * + * @class CanvasRenderer + * @memberof Phaser.Renderer.Canvas + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - The Phaser Game instance that owns this renderer. + */ +var CanvasRenderer = new Class({ + + initialize: + + function CanvasRenderer (game) + { + /** + * The Phaser Game instance that owns this renderer. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#game + * @type {Phaser.Game} + * @since 3.0.0 + */ + this.game = game; + + /** + * A constant which allows the renderer to be easily identified as a Canvas Renderer. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#type + * @type {integer} + * @since 3.0.0 + */ + this.type = CONST.CANVAS; + + /** + * The total number of Game Objects which were rendered in a frame. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#drawCount + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.drawCount = 0; + + /** + * The width of the canvas being rendered to. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#width + * @type {integer} + * @since 3.0.0 + */ + this.width = 0; + + /** + * The height of the canvas being rendered to. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#height + * @type {integer} + * @since 3.0.0 + */ + this.height = 0; + + /** + * The local configuration settings of the CanvasRenderer. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#config + * @type {object} + * @since 3.0.0 + */ + this.config = { + clearBeforeRender: game.config.clearBeforeRender, + backgroundColor: game.config.backgroundColor, + resolution: game.config.resolution, + antialias: game.config.antialias, + roundPixels: game.config.roundPixels + }; + + /** + * The scale mode which should be used by the CanvasRenderer. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#scaleMode + * @type {integer} + * @since 3.0.0 + */ + this.scaleMode = (game.config.antialias) ? ScaleModes.LINEAR : ScaleModes.NEAREST; + + /** + * The canvas element which the Game uses. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#gameCanvas + * @type {HTMLCanvasElement} + * @since 3.0.0 + */ + this.gameCanvas = game.canvas; + + var contextOptions = { + alpha: game.config.transparent, + desynchronized: game.config.desynchronized + }; + + /** + * The canvas context used to render all Cameras in all Scenes during the game loop. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#gameContext + * @type {CanvasRenderingContext2D} + * @since 3.0.0 + */ + this.gameContext = (this.game.config.context) ? this.game.config.context : this.gameCanvas.getContext('2d', contextOptions); + + /** + * The canvas context currently used by the CanvasRenderer for all rendering operations. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#currentContext + * @type {CanvasRenderingContext2D} + * @since 3.0.0 + */ + this.currentContext = this.gameContext; + + /** + * The blend modes supported by the Canvas Renderer. + * + * This object maps the {@link Phaser.BlendModes} to canvas compositing operations. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#blendModes + * @type {array} + * @since 3.0.0 + */ + this.blendModes = GetBlendModes(); + + // image-rendering: optimizeSpeed; + // image-rendering: pixelated; + + /** + * The scale mode currently in use by the Canvas Renderer. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#currentScaleMode + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.currentScaleMode = 0; + + /** + * Details about the currently scheduled snapshot. + * + * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#snapshotState + * @type {Phaser.Types.Renderer.Snapshot.SnapshotState} + * @since 3.16.0 + */ + this.snapshotState = { + x: 0, + y: 0, + width: 1, + height: 1, + getPixel: false, + callback: null, + type: 'image/png', + encoder: 0.92 + }; + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix1 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.12.0 + */ + this._tempMatrix1 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix2 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.12.0 + */ + this._tempMatrix2 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix3 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.12.0 + */ + this._tempMatrix3 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix4 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.12.0 + */ + this._tempMatrix4 = new TransformMatrix(); + + this.init(); + }, + + /** + * Prepares the game canvas for rendering. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#init + * @since 3.0.0 + */ + init: function () + { + this.game.scale.on(ScaleEvents.RESIZE, this.onResize, this); + + var baseSize = this.game.scale.baseSize; + + this.resize(baseSize.width, baseSize.height); + }, + + /** + * The event handler that manages the `resize` event dispatched by the Scale Manager. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#onResize + * @since 3.16.0 + * + * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions. + * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + * @param {Phaser.Structs.Size} displaySize - The display Size object. The size of the canvas style width / height attributes. + * @param {number} [resolution] - The Scale Manager resolution setting. + */ + onResize: function (gameSize, baseSize) + { + // Has the underlying canvas size changed? + if (baseSize.width !== this.width || baseSize.height !== this.height) + { + this.resize(baseSize.width, baseSize.height); + } + }, + + /** + * Resize the main game canvas. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#resize + * @since 3.0.0 + * + * @param {number} [width] - The new width of the renderer. + * @param {number} [height] - The new height of the renderer. + */ + resize: function (width, height) + { + this.width = width; + this.height = height; + + // Resizing a canvas will reset imageSmoothingEnabled (and probably other properties) + if (this.scaleMode === ScaleModes.NEAREST) + { + Smoothing.disable(this.gameContext); + } + }, + + /** + * A NOOP method for handling lost context. Intentionally empty. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#onContextLost + * @since 3.0.0 + * + * @param {function} callback - Ignored parameter. + */ + onContextLost: function () + { + }, + + /** + * A NOOP method for handling restored context. Intentionally empty. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#onContextRestored + * @since 3.0.0 + * + * @param {function} callback - Ignored parameter. + */ + onContextRestored: function () + { + }, + + /** + * Resets the transformation matrix of the current context to the identity matrix, thus resetting any transformation. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#resetTransform + * @since 3.0.0 + */ + resetTransform: function () + { + this.currentContext.setTransform(1, 0, 0, 1, 0, 0); + }, + + /** + * Sets the blend mode (compositing operation) of the current context. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#setBlendMode + * @since 3.0.0 + * + * @param {string} blendMode - The new blend mode which should be used. + * + * @return {this} This CanvasRenderer object. + */ + setBlendMode: function (blendMode) + { + this.currentContext.globalCompositeOperation = blendMode; + + return this; + }, + + /** + * Changes the Canvas Rendering Context that all draw operations are performed against. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#setContext + * @since 3.12.0 + * + * @param {?CanvasRenderingContext2D} [ctx] - The new Canvas Rendering Context to draw everything to. Leave empty to reset to the Game Canvas. + * + * @return {this} The Canvas Renderer instance. + */ + setContext: function (ctx) + { + this.currentContext = (ctx) ? ctx : this.gameContext; + + return this; + }, + + /** + * Sets the global alpha of the current context. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#setAlpha + * @since 3.0.0 + * + * @param {number} alpha - The new alpha to use, where 0 is fully transparent and 1 is fully opaque. + * + * @return {this} This CanvasRenderer object. + */ + setAlpha: function (alpha) + { + this.currentContext.globalAlpha = alpha; + + return this; + }, + + /** + * Called at the start of the render loop. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#preRender + * @since 3.0.0 + */ + preRender: function () + { + var ctx = this.gameContext; + var config = this.config; + + var width = this.width; + var height = this.height; + + ctx.globalAlpha = 1; + ctx.globalCompositeOperation = 'source-over'; + ctx.setTransform(1, 0, 0, 1, 0, 0); + + if (config.clearBeforeRender) + { + ctx.clearRect(0, 0, width, height); + } + + if (!config.transparent) + { + ctx.fillStyle = config.backgroundColor.rgba; + ctx.fillRect(0, 0, width, height); + } + + ctx.save(); + + this.drawCount = 0; + }, + + /** + * Renders the Scene to the given Camera. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#render + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to render. + * @param {Phaser.GameObjects.DisplayList} children - The Game Objects within the Scene to be rendered. + * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently unused. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. + */ + render: function (scene, children, interpolationPercentage, camera) + { + var list = children.list; + var childCount = list.length; + + var cx = camera._cx; + var cy = camera._cy; + var cw = camera._cw; + var ch = camera._ch; + + var ctx = (camera.renderToTexture) ? camera.context : scene.sys.context; + + // Save context pre-clip + ctx.save(); + + if (this.game.scene.customViewports) + { + ctx.beginPath(); + ctx.rect(cx, cy, cw, ch); + ctx.clip(); + } + + this.currentContext = ctx; + + var mask = camera.mask; + + if (mask) + { + mask.preRenderCanvas(this, null, camera._maskCamera); + } + + if (!camera.transparent) + { + ctx.fillStyle = camera.backgroundColor.rgba; + ctx.fillRect(cx, cy, cw, ch); + } + + ctx.globalAlpha = camera.alpha; + + ctx.globalCompositeOperation = 'source-over'; + + this.drawCount += list.length; + + if (camera.renderToTexture) + { + camera.emit(CameraEvents.PRE_RENDER, camera); + } + + camera.matrix.copyToContext(ctx); + + for (var i = 0; i < childCount; i++) + { + var child = list[i]; + + if (!child.willRender(camera)) + { + continue; + } + + if (child.mask) + { + child.mask.preRenderCanvas(this, child, camera); + } + + child.renderCanvas(this, child, interpolationPercentage, camera); + + if (child.mask) + { + child.mask.postRenderCanvas(this, child, camera); + } + } + + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.globalCompositeOperation = 'source-over'; + ctx.globalAlpha = 1; + + camera.flashEffect.postRenderCanvas(ctx); + camera.fadeEffect.postRenderCanvas(ctx); + + camera.dirty = false; + + if (mask) + { + mask.postRenderCanvas(this); + } + + // Restore pre-clip context + ctx.restore(); + + if (camera.renderToTexture) + { + camera.emit(CameraEvents.POST_RENDER, camera); + + scene.sys.context.drawImage(camera.canvas, cx, cy); + } + }, + + /** + * Restores the game context's global settings and takes a snapshot if one is scheduled. + * + * The post-render step happens after all Cameras in all Scenes have been rendered. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#postRender + * @since 3.0.0 + */ + postRender: function () + { + var ctx = this.gameContext; + + ctx.restore(); + + var state = this.snapshotState; + + if (state.callback) + { + CanvasSnapshot(this.gameCanvas, state); + + state.callback = null; + } + }, + + /** + * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. + * + * To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets + * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshot + * @since 3.0.0 + * + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This WebGL Renderer. + */ + snapshot: function (callback, type, encoderOptions) + { + return this.snapshotArea(0, 0, this.gameCanvas.width, this.gameCanvas.height, callback, type, encoderOptions); + }, + + /** + * Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets + * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotArea + * @since 3.16.0 + * + * @param {integer} x - The x coordinate to grab from. + * @param {integer} y - The y coordinate to grab from. + * @param {integer} width - The width of the area to grab. + * @param {integer} height - The height of the area to grab. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This WebGL Renderer. + */ + snapshotArea: function (x, y, width, height, callback, type, encoderOptions) + { + var state = this.snapshotState; + + state.callback = callback; + state.type = type; + state.encoder = encoderOptions; + state.getPixel = false; + state.x = x; + state.y = y; + state.width = Math.min(width, this.gameCanvas.width); + state.height = Math.min(height, this.gameCanvas.height); + + return this; + }, + + /** + * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then + * calling this method will override it. + * + * Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for + * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, + * using less memory. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotPixel + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the pixel to get. + * @param {integer} y - The y coordinate of the pixel to get. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. + * + * @return {this} This WebGL Renderer. + */ + snapshotPixel: function (x, y, callback) + { + this.snapshotArea(x, y, 1, 1, callback); + + this.snapshotState.getPixel = true; + + return this; + }, + + /** + * Takes a Sprite Game Object, or any object that extends it, and draws it to the current context. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#batchSprite + * @since 3.12.0 + * + * @param {Phaser.GameObjects.GameObject} sprite - The texture based Game Object to draw. + * @param {Phaser.Textures.Frame} frame - The frame to draw, doesn't have to be that owned by the Game Object. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set. + */ + batchSprite: function (sprite, frame, camera, parentTransformMatrix) + { + var alpha = camera.alpha * sprite.alpha; + + if (alpha === 0) + { + // Nothing to see, so abort early + return; + } + + var ctx = this.currentContext; + + var camMatrix = this._tempMatrix1; + var spriteMatrix = this._tempMatrix2; + var calcMatrix = this._tempMatrix3; + + var cd = frame.canvasData; + + var frameX = cd.x; + var frameY = cd.y; + var frameWidth = frame.cutWidth; + var frameHeight = frame.cutHeight; + var res = frame.source.resolution; + + var x = -sprite.displayOriginX + frame.x; + var y = -sprite.displayOriginY + frame.y; + + var fx = (sprite.flipX) ? -1 : 1; + var fy = (sprite.flipY) ? -1 : 1; + + if (sprite.isCropped) + { + var crop = sprite._crop; + + if (crop.flipX !== sprite.flipX || crop.flipY !== sprite.flipY) + { + frame.updateCropUVs(crop, sprite.flipX, sprite.flipY); + } + + frameWidth = crop.cw; + frameHeight = crop.ch; + + frameX = crop.cx; + frameY = crop.cy; + + x = -sprite.displayOriginX + crop.x; + y = -sprite.displayOriginY + crop.y; + + if (fx === -1) + { + if (x >= 0) + { + x = -(x + frameWidth); + } + else if (x < 0) + { + x = (Math.abs(x) - frameWidth); + } + } + + if (fy === -1) + { + if (y >= 0) + { + y = -(y + frameHeight); + } + else if (y < 0) + { + y = (Math.abs(y) - frameHeight); + } + } + } + + spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX, sprite.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentTransformMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * sprite.scrollFactorX, -camera.scrollY * sprite.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = sprite.x; + spriteMatrix.f = sprite.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else + { + spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX; + spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + ctx.save(); + + calcMatrix.setToContext(ctx); + + ctx.scale(fx, fy); + + ctx.globalCompositeOperation = this.blendModes[sprite.blendMode]; + + ctx.globalAlpha = alpha; + + ctx.drawImage(frame.source.image, frameX, frameY, frameWidth, frameHeight, x, y, frameWidth / res, frameHeight / res); + + ctx.restore(); + }, + + /** + * Destroys all object references in the Canvas Renderer. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.gameCanvas = null; + this.gameContext = null; + + this.game = null; + } + +}); + +module.exports = CanvasRenderer; + + +/***/ }), +/* 481 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(24); +var Color = __webpack_require__(33); +var GetFastValue = __webpack_require__(2); + +/** + * Takes a snapshot of an area from the current frame displayed by a canvas. + * + * This is then copied to an Image object. When this loads, the results are sent + * to the callback provided in the Snapshot Configuration object. + * + * @function Phaser.Renderer.Snapshot.Canvas + * @since 3.0.0 + * + * @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotState} config - The snapshot configuration object. + */ +var CanvasSnapshot = function (canvas, config) +{ + var callback = GetFastValue(config, 'callback'); + var type = GetFastValue(config, 'type', 'image/png'); + var encoderOptions = GetFastValue(config, 'encoder', 0.92); + var x = Math.abs(Math.round(GetFastValue(config, 'x', 0))); + var y = Math.abs(Math.round(GetFastValue(config, 'y', 0))); + var width = GetFastValue(config, 'width', canvas.width); + var height = GetFastValue(config, 'height', canvas.height); + var getPixel = GetFastValue(config, 'getPixel', false); + + if (getPixel) + { + var context = canvas.getContext('2d'); + var imageData = context.getImageData(x, y, 1, 1); + var data = imageData.data; + + callback.call(null, new Color(data[0], data[1], data[2], data[3] / 255)); + } + else if (x !== 0 || y !== 0 || width !== canvas.width || height !== canvas.height) + { + // Area Grab + var copyCanvas = CanvasPool.createWebGL(this, width, height); + var ctx = copyCanvas.getContext('2d'); + + ctx.drawImage(canvas, x, y, width, height, 0, 0, width, height); + + var image1 = new Image(); + + image1.onerror = function () + { + callback.call(null); + + CanvasPool.remove(copyCanvas); + }; + + image1.onload = function () + { + callback.call(null, image1); + + CanvasPool.remove(copyCanvas); + }; + + image1.src = copyCanvas.toDataURL(type, encoderOptions); + } + else + { + // Full Grab + var image2 = new Image(); + + image2.onerror = function () + { + callback.call(null); + }; + + image2.onload = function () + { + callback.call(null, image2); + }; + + image2.src = canvas.toDataURL(type, encoderOptions); + } +}; + +module.exports = CanvasSnapshot; + + +/***/ }), +/* 482 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var modes = __webpack_require__(52); +var CanvasFeatures = __webpack_require__(291); + +/** + * Returns an array which maps the default blend modes to supported Canvas blend modes. + * + * If the browser doesn't support a blend mode, it will default to the normal `source-over` blend mode. + * + * @function Phaser.Renderer.Canvas.GetBlendModes + * @since 3.0.0 + * + * @return {array} Which Canvas blend mode corresponds to which default Phaser blend mode. + */ +var GetBlendModes = function () +{ + var output = []; + var useNew = CanvasFeatures.supportNewBlendModes; + var so = 'source-over'; + + output[modes.NORMAL] = so; + output[modes.ADD] = 'lighter'; + output[modes.MULTIPLY] = (useNew) ? 'multiply' : so; + output[modes.SCREEN] = (useNew) ? 'screen' : so; + output[modes.OVERLAY] = (useNew) ? 'overlay' : so; + output[modes.DARKEN] = (useNew) ? 'darken' : so; + output[modes.LIGHTEN] = (useNew) ? 'lighten' : so; + output[modes.COLOR_DODGE] = (useNew) ? 'color-dodge' : so; + output[modes.COLOR_BURN] = (useNew) ? 'color-burn' : so; + output[modes.HARD_LIGHT] = (useNew) ? 'hard-light' : so; + output[modes.SOFT_LIGHT] = (useNew) ? 'soft-light' : so; + output[modes.DIFFERENCE] = (useNew) ? 'difference' : so; + output[modes.EXCLUSION] = (useNew) ? 'exclusion' : so; + output[modes.HUE] = (useNew) ? 'hue' : so; + output[modes.SATURATION] = (useNew) ? 'saturation' : so; + output[modes.COLOR] = (useNew) ? 'color' : so; + output[modes.LUMINOSITY] = (useNew) ? 'luminosity' : so; + output[modes.ERASE] = 'destination-out'; + output[modes.SOURCE_IN] = 'source-in'; + output[modes.SOURCE_OUT] = 'source-out'; + output[modes.SOURCE_ATOP] = 'source-atop'; + output[modes.DESTINATION_OVER] = 'destination-over'; + output[modes.DESTINATION_IN] = 'destination-in'; + output[modes.DESTINATION_OUT] = 'destination-out'; + output[modes.DESTINATION_ATOP] = 'destination-atop'; + output[modes.LIGHTER] = 'lighter'; + output[modes.COPY] = 'copy'; + output[modes.XOR] = 'xor'; + + return output; +}; + +module.exports = GetBlendModes; + + +/***/ }), +/* 483 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BaseCamera = __webpack_require__(112); +var CameraEvents = __webpack_require__(48); +var Class = __webpack_require__(0); +var CONST = __webpack_require__(26); +var IsSizePowerOfTwo = __webpack_require__(117); +var ScaleEvents = __webpack_require__(89); +var SpliceOne = __webpack_require__(78); +var TextureEvents = __webpack_require__(118); +var TransformMatrix = __webpack_require__(32); +var Utils = __webpack_require__(9); +var WebGLSnapshot = __webpack_require__(484); + +// Default Pipelines +var BitmapMaskPipeline = __webpack_require__(485); +var ForwardDiffuseLightPipeline = __webpack_require__(486); +var TextureTintPipeline = __webpack_require__(226); + +/** + * @callback WebGLContextCallback + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer which owns the context. + */ + +/** + * @classdesc + * WebGLRenderer is a class that contains the needed functionality to keep the + * WebGLRenderingContext state clean. The main idea of the WebGLRenderer is to keep track of + * any context change that happens for WebGL rendering inside of Phaser. This means + * if raw webgl functions are called outside the WebGLRenderer of the Phaser WebGL + * rendering ecosystem they might pollute the current WebGLRenderingContext state producing + * unexpected behavior. It's recommended that WebGL interaction is done through + * WebGLRenderer and/or WebGLPipeline. + * + * @class WebGLRenderer + * @memberof Phaser.Renderer.WebGL + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Game} game - The Game instance which owns this WebGL Renderer. + */ +var WebGLRenderer = new Class({ + + initialize: + + function WebGLRenderer (game) + { + // eslint-disable-next-line consistent-this + var renderer = this; + + var gameConfig = game.config; + + var contextCreationConfig = { + alpha: gameConfig.transparent, + desynchronized: gameConfig.desynchronized, + depth: false, + antialias: gameConfig.antialias, + premultipliedAlpha: gameConfig.premultipliedAlpha, + stencil: true, + failIfMajorPerformanceCaveat: gameConfig.failIfMajorPerformanceCaveat, + powerPreference: gameConfig.powerPreference + }; + + /** + * The local configuration settings of this WebGL Renderer. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#config + * @type {object} + * @since 3.0.0 + */ + this.config = { + clearBeforeRender: gameConfig.clearBeforeRender, + antialias: gameConfig.antialias, + backgroundColor: gameConfig.backgroundColor, + contextCreation: contextCreationConfig, + resolution: gameConfig.resolution, + roundPixels: gameConfig.roundPixels, + maxTextures: gameConfig.maxTextures, + maxTextureSize: gameConfig.maxTextureSize, + batchSize: gameConfig.batchSize, + maxLights: gameConfig.maxLights + }; + + /** + * The Game instance which owns this WebGL Renderer. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#game + * @type {Phaser.Game} + * @since 3.0.0 + */ + this.game = game; + + /** + * A constant which allows the renderer to be easily identified as a WebGL Renderer. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#type + * @type {integer} + * @since 3.0.0 + */ + this.type = CONST.WEBGL; + + /** + * The width of the canvas being rendered to. + * This is populated in the onResize event handler. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#width + * @type {integer} + * @since 3.0.0 + */ + this.width = 0; + + /** + * The height of the canvas being rendered to. + * This is populated in the onResize event handler. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#height + * @type {integer} + * @since 3.0.0 + */ + this.height = 0; + + /** + * The canvas which this WebGL Renderer draws to. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#canvas + * @type {HTMLCanvasElement} + * @since 3.0.0 + */ + this.canvas = game.canvas; + + /** + * An array of functions to invoke if the WebGL context is lost. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#lostContextCallbacks + * @type {WebGLContextCallback[]} + * @since 3.0.0 + */ + this.lostContextCallbacks = []; + + /** + * An array of functions to invoke if the WebGL context is restored. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#restoredContextCallbacks + * @type {WebGLContextCallback[]} + * @since 3.0.0 + */ + this.restoredContextCallbacks = []; + + /** + * An array of blend modes supported by the WebGL Renderer. + * + * This array includes the default blend modes as well as any custom blend modes added through {@link #addBlendMode}. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#blendModes + * @type {array} + * @default [] + * @since 3.0.0 + */ + this.blendModes = []; + + /** + * Keeps track of any WebGLTexture created with the current WebGLRenderingContext + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#nativeTextures + * @type {array} + * @default [] + * @since 3.0.0 + */ + this.nativeTextures = []; + + /** + * Set to `true` if the WebGL context of the renderer is lost. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#contextLost + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.contextLost = false; + + /** + * This object will store all pipelines created through addPipeline + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#pipelines + * @type {object} + * @default null + * @since 3.0.0 + */ + this.pipelines = null; + + /** + * Details about the currently scheduled snapshot. + * + * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#snapshotState + * @type {Phaser.Types.Renderer.Snapshot.SnapshotState} + * @since 3.0.0 + */ + this.snapshotState = { + x: 0, + y: 0, + width: 1, + height: 1, + getPixel: false, + callback: null, + type: 'image/png', + encoder: 0.92 + }; + + // Internal Renderer State (Textures, Framebuffers, Pipelines, Buffers, etc) + + /** + * Cached value for the last texture unit that was used + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentActiveTextureUnit + * @type {integer} + * @since 3.1.0 + */ + this.currentActiveTextureUnit = 0; + + /** + * An array of the last texture handles that were bound to the WebGLRenderingContext + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentTextures + * @type {array} + * @since 3.0.0 + */ + this.currentTextures = new Array(16); + + /** + * Current framebuffer in use + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentFramebuffer + * @type {WebGLFramebuffer} + * @default null + * @since 3.0.0 + */ + this.currentFramebuffer = null; + + /** + * Current WebGLPipeline in use + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentPipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @default null + * @since 3.0.0 + */ + this.currentPipeline = null; + + /** + * Current WebGLProgram in use + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentProgram + * @type {WebGLProgram} + * @default null + * @since 3.0.0 + */ + this.currentProgram = null; + + /** + * Current WebGLBuffer (Vertex buffer) in use + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentVertexBuffer + * @type {WebGLBuffer} + * @default null + * @since 3.0.0 + */ + this.currentVertexBuffer = null; + + /** + * Current WebGLBuffer (Index buffer) in use + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentIndexBuffer + * @type {WebGLBuffer} + * @default null + * @since 3.0.0 + */ + this.currentIndexBuffer = null; + + /** + * Current blend mode in use + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentBlendMode + * @type {integer} + * @since 3.0.0 + */ + this.currentBlendMode = Infinity; + + /** + * Indicates if the the scissor state is enabled in WebGLRenderingContext + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentScissorEnabled + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.currentScissorEnabled = false; + + /** + * Stores the current scissor data + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentScissor + * @type {Uint32Array} + * @since 3.0.0 + */ + // this.currentScissor = new Uint32Array([ 0, 0, this.width, this.height ]); + this.currentScissor = null; + + /** + * Stack of scissor data + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#scissorStack + * @type {Uint32Array} + * @since 3.0.0 + */ + this.scissorStack = []; + + // Setup context lost and restore event listeners + + this.canvas.addEventListener('webglcontextlost', function (event) + { + renderer.contextLost = true; + event.preventDefault(); + + for (var index = 0; index < renderer.lostContextCallbacks.length; ++index) + { + var callback = renderer.lostContextCallbacks[index]; + callback[0].call(callback[1], renderer); + } + }, false); + + this.canvas.addEventListener('webglcontextrestored', function () + { + renderer.contextLost = false; + renderer.init(renderer.config); + for (var index = 0; index < renderer.restoredContextCallbacks.length; ++index) + { + var callback = renderer.restoredContextCallbacks[index]; + callback[0].call(callback[1], renderer); + } + }, false); + + // These are initialized post context creation + + /** + * The underlying WebGL context of the renderer. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#gl + * @type {WebGLRenderingContext} + * @default null + * @since 3.0.0 + */ + this.gl = null; + + /** + * Array of strings that indicate which WebGL extensions are supported by the browser + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#supportedExtensions + * @type {object} + * @default null + * @since 3.0.0 + */ + this.supportedExtensions = null; + + /** + * Extensions loaded into the current context + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#extensions + * @type {object} + * @default {} + * @since 3.0.0 + */ + this.extensions = {}; + + /** + * Stores the current WebGL component formats for further use + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#glFormats + * @type {array} + * @default [] + * @since 3.2.0 + */ + this.glFormats = []; + + /** + * Stores the supported WebGL texture compression formats. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#compression + * @type {array} + * @since 3.8.0 + */ + this.compression = { + ETC1: false, + PVRTC: false, + S3TC: false + }; + + /** + * Cached drawing buffer height to reduce gl calls. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#drawingBufferHeight + * @type {number} + * @readonly + * @since 3.11.0 + */ + this.drawingBufferHeight = 0; + + /** + * A blank 32x32 transparent texture, as used by the Graphics system where needed. + * This is set in the `boot` method. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#blankTexture + * @type {WebGLTexture} + * @readonly + * @since 3.12.0 + */ + this.blankTexture = null; + + /** + * A default Camera used in calls when no other camera has been provided. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#defaultCamera + * @type {Phaser.Cameras.Scene2D.BaseCamera} + * @since 3.12.0 + */ + this.defaultCamera = new BaseCamera(0, 0, 0, 0); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix1 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.12.0 + */ + this._tempMatrix1 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix2 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.12.0 + */ + this._tempMatrix2 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix3 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.12.0 + */ + this._tempMatrix3 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix4 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.12.0 + */ + this._tempMatrix4 = new TransformMatrix(); + + /** + * The total number of masks currently stacked. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#maskCount + * @type {integer} + * @since 3.17.0 + */ + this.maskCount = 0; + + /** + * The mask stack. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#maskStack + * @type {Phaser.Display.Masks.GeometryMask[]} + * @since 3.17.0 + */ + this.maskStack = []; + + /** + * Internal property that tracks the currently set mask. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentMask + * @type {any} + * @since 3.17.0 + */ + this.currentMask = { mask: null, camera: null }; + + /** + * Internal property that tracks the currently set camera mask. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#currentCameraMask + * @type {any} + * @since 3.17.0 + */ + this.currentCameraMask = { mask: null, camera: null }; + + /** + * Internal gl function mapping for uniform look-up. + * https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/uniform + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#glFuncMap + * @type {any} + * @since 3.17.0 + */ + this.glFuncMap = null; + + this.init(this.config); + }, + + /** + * Creates a new WebGLRenderingContext and initializes all internal state. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#init + * @since 3.0.0 + * + * @param {object} config - The configuration object for the renderer. + * + * @return {this} This WebGLRenderer instance. + */ + init: function (config) + { + var gl; + var game = this.game; + var canvas = this.canvas; + var clearColor = config.backgroundColor; + + // Did they provide their own context? + if (game.config.context) + { + gl = game.config.context; + } + else + { + gl = canvas.getContext('webgl', config.contextCreation) || canvas.getContext('experimental-webgl', config.contextCreation); + } + + if (!gl || gl.isContextLost()) + { + this.contextLost = true; + + throw new Error('WebGL unsupported'); + } + + this.gl = gl; + + // Set it back into the Game, so developers can access it from there too + game.context = gl; + + for (var i = 0; i <= 27; i++) + { + this.blendModes.push({ func: [ gl.ONE, gl.ONE_MINUS_SRC_ALPHA ], equation: gl.FUNC_ADD }); + } + + // ADD + this.blendModes[1].func = [ gl.ONE, gl.DST_ALPHA ]; + + // MULTIPLY + this.blendModes[2].func = [ gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA ]; + + // SCREEN + this.blendModes[3].func = [ gl.ONE, gl.ONE_MINUS_SRC_COLOR ]; + + // ERASE + this.blendModes[17] = { func: [ gl.ZERO, gl.ONE_MINUS_SRC_ALPHA ], equation: gl.FUNC_REVERSE_SUBTRACT }; + + this.glFormats[0] = gl.BYTE; + this.glFormats[1] = gl.SHORT; + this.glFormats[2] = gl.UNSIGNED_BYTE; + this.glFormats[3] = gl.UNSIGNED_SHORT; + this.glFormats[4] = gl.FLOAT; + + // Set the gl function map + this.glFuncMap = { + + mat2: { func: gl.uniformMatrix2fv, length: 1, matrix: true }, + mat3: { func: gl.uniformMatrix3fv, length: 1, matrix: true }, + mat4: { func: gl.uniformMatrix4fv, length: 1, matrix: true }, + + '1f': { func: gl.uniform1f, length: 1 }, + '1fv': { func: gl.uniform1fv, length: 1 }, + '1i': { func: gl.uniform1i, length: 1 }, + '1iv': { func: gl.uniform1iv, length: 1 }, + + '2f': { func: gl.uniform2f, length: 2 }, + '2fv': { func: gl.uniform2fv, length: 1 }, + '2i': { func: gl.uniform2i, length: 2 }, + '2iv': { func: gl.uniform2iv, length: 1 }, + + '3f': { func: gl.uniform3f, length: 3 }, + '3fv': { func: gl.uniform3fv, length: 1 }, + '3i': { func: gl.uniform3i, length: 3 }, + '3iv': { func: gl.uniform3iv, length: 1 }, + + '4f': { func: gl.uniform4f, length: 4 }, + '4fv': { func: gl.uniform4fv, length: 1 }, + '4i': { func: gl.uniform4i, length: 4 }, + '4iv': { func: gl.uniform4iv, length: 1 } + + }; + + // Load supported extensions + var exts = gl.getSupportedExtensions(); + + if (!config.maxTextures) + { + config.maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); + } + + if (!config.maxTextureSize) + { + config.maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); + } + + var extString = 'WEBGL_compressed_texture_'; + var wkExtString = 'WEBKIT_' + extString; + + this.compression.ETC1 = gl.getExtension(extString + 'etc1') || gl.getExtension(wkExtString + 'etc1'); + this.compression.PVRTC = gl.getExtension(extString + 'pvrtc') || gl.getExtension(wkExtString + 'pvrtc'); + this.compression.S3TC = gl.getExtension(extString + 's3tc') || gl.getExtension(wkExtString + 's3tc'); + + this.supportedExtensions = exts; + + // Setup initial WebGL state + gl.disable(gl.DEPTH_TEST); + gl.disable(gl.CULL_FACE); + + gl.enable(gl.BLEND); + + gl.clearColor(clearColor.redGL, clearColor.greenGL, clearColor.blueGL, clearColor.alphaGL); + + // Initialize all textures to null + for (var index = 0; index < this.currentTextures.length; ++index) + { + this.currentTextures[index] = null; + } + + // Clear previous pipelines and reload default ones + this.pipelines = {}; + + this.addPipeline('TextureTintPipeline', new TextureTintPipeline({ game: game, renderer: this })); + this.addPipeline('BitmapMaskPipeline', new BitmapMaskPipeline({ game: game, renderer: this })); + this.addPipeline('Light2D', new ForwardDiffuseLightPipeline({ game: game, renderer: this, maxLights: config.maxLights })); + + this.setBlendMode(CONST.BlendModes.NORMAL); + + game.textures.once(TextureEvents.READY, this.boot, this); + + return this; + }, + + /** + * Internal boot handler. Calls 'boot' on each pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#boot + * @private + * @since 3.11.0 + */ + boot: function () + { + for (var pipelineName in this.pipelines) + { + this.pipelines[pipelineName].boot(); + } + + var blank = this.game.textures.getFrame('__DEFAULT'); + + this.pipelines.TextureTintPipeline.currentFrame = blank; + + this.blankTexture = blank; + + var gl = this.gl; + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + gl.enable(gl.SCISSOR_TEST); + + this.setPipeline(this.pipelines.TextureTintPipeline); + + this.game.scale.on(ScaleEvents.RESIZE, this.onResize, this); + + var baseSize = this.game.scale.baseSize; + + this.resize(baseSize.width, baseSize.height, this.game.scale.resolution); + }, + + /** + * The event handler that manages the `resize` event dispatched by the Scale Manager. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#onResize + * @since 3.16.0 + * + * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions. + * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + * @param {Phaser.Structs.Size} displaySize - The display Size object. The size of the canvas style width / height attributes. + * @param {number} [resolution] - The Scale Manager resolution setting. + */ + onResize: function (gameSize, baseSize, displaySize, resolution) + { + // Has the underlying canvas size changed? + if (baseSize.width !== this.width || baseSize.height !== this.height || resolution !== this.resolution) + { + this.resize(baseSize.width, baseSize.height, resolution); + } + }, + + /** + * Resizes the drawing buffer to match that required by the Scale Manager. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#resize + * @since 3.0.0 + * + * @param {number} [width] - The new width of the renderer. + * @param {number} [height] - The new height of the renderer. + * @param {number} [resolution] - The new resolution of the renderer. + * + * @return {this} This WebGLRenderer instance. + */ + resize: function (width, height, resolution) + { + var gl = this.gl; + var pipelines = this.pipelines; + + this.width = width; + this.height = height; + this.resolution = resolution; + + gl.viewport(0, 0, width, height); + + // Update all registered pipelines + for (var pipelineName in pipelines) + { + pipelines[pipelineName].resize(width, height, resolution); + } + + this.drawingBufferHeight = gl.drawingBufferHeight; + + gl.scissor(0, (gl.drawingBufferHeight - height), width, height); + + this.defaultCamera.setSize(width, height); + + return this; + }, + + /** + * Adds a callback to be invoked when the WebGL context has been restored by the browser. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextRestored + * @since 3.0.0 + * + * @param {WebGLContextCallback} callback - The callback to be invoked on context restoration. + * @param {object} target - The context of the callback. + * + * @return {this} This WebGLRenderer instance. + */ + onContextRestored: function (callback, target) + { + this.restoredContextCallbacks.push([ callback, target ]); + + return this; + }, + + /** + * Adds a callback to be invoked when the WebGL context has been lost by the browser. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#onContextLost + * @since 3.0.0 + * + * @param {WebGLContextCallback} callback - The callback to be invoked on context loss. + * @param {object} target - The context of the callback. + * + * @return {this} This WebGLRenderer instance. + */ + onContextLost: function (callback, target) + { + this.lostContextCallbacks.push([ callback, target ]); + + return this; + }, + + /** + * Checks if a WebGL extension is supported + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#hasExtension + * @since 3.0.0 + * + * @param {string} extensionName - Name of the WebGL extension + * + * @return {boolean} `true` if the extension is supported, otherwise `false`. + */ + hasExtension: function (extensionName) + { + return this.supportedExtensions ? this.supportedExtensions.indexOf(extensionName) : false; + }, + + /** + * Loads a WebGL extension + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#getExtension + * @since 3.0.0 + * + * @param {string} extensionName - The name of the extension to load. + * + * @return {object} WebGL extension if the extension is supported + */ + getExtension: function (extensionName) + { + if (!this.hasExtension(extensionName)) { return null; } + + if (!(extensionName in this.extensions)) + { + this.extensions[extensionName] = this.gl.getExtension(extensionName); + } + + return this.extensions[extensionName]; + }, + + /** + * Flushes the current pipeline if the pipeline is bound + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#flush + * @since 3.0.0 + */ + flush: function () + { + if (this.currentPipeline) + { + this.currentPipeline.flush(); + } + }, + + /** + * Checks if a pipeline is present in the current WebGLRenderer + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#hasPipeline + * @since 3.0.0 + * + * @param {string} pipelineName - The name of the pipeline. + * + * @return {boolean} `true` if the given pipeline is loaded, otherwise `false`. + */ + hasPipeline: function (pipelineName) + { + return (pipelineName in this.pipelines); + }, + + /** + * Returns the pipeline by name if the pipeline exists + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#getPipeline + * @since 3.0.0 + * + * @param {string} pipelineName - The name of the pipeline. + * + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance, or `null` if not found. + */ + getPipeline: function (pipelineName) + { + return (this.hasPipeline(pipelineName)) ? this.pipelines[pipelineName] : null; + }, + + /** + * Removes a pipeline by name. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#removePipeline + * @since 3.0.0 + * + * @param {string} pipelineName - The name of the pipeline to be removed. + * + * @return {this} This WebGLRenderer instance. + */ + removePipeline: function (pipelineName) + { + delete this.pipelines[pipelineName]; + + return this; + }, + + /** + * Adds a pipeline instance into the collection of pipelines + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#addPipeline + * @since 3.0.0 + * + * @param {string} pipelineName - A unique string-based key for the pipeline. + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - A pipeline instance which must extend WebGLPipeline. + * + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance that was passed. + */ + addPipeline: function (pipelineName, pipelineInstance) + { + if (!this.hasPipeline(pipelineName)) + { + this.pipelines[pipelineName] = pipelineInstance; + } + else + { + console.warn('Pipeline exists: ' + pipelineName); + } + + pipelineInstance.name = pipelineName; + + this.pipelines[pipelineName].resize(this.width, this.height, this.config.resolution); + + return pipelineInstance; + }, + + /** + * Pushes a new scissor state. This is used to set nested scissor states. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#pushScissor + * @since 3.0.0 + * + * @param {integer} x - The x position of the scissor. + * @param {integer} y - The y position of the scissor. + * @param {integer} width - The width of the scissor. + * @param {integer} height - The height of the scissor. + * @param {integer} [drawingBufferHeight] - Optional drawingBufferHeight override value. + * + * @return {integer[]} An array containing the scissor values. + */ + pushScissor: function (x, y, width, height, drawingBufferHeight) + { + if (drawingBufferHeight === undefined) { drawingBufferHeight = this.drawingBufferHeight; } + + var scissorStack = this.scissorStack; + + var scissor = [ x, y, width, height ]; + + scissorStack.push(scissor); + + this.setScissor(x, y, width, height, drawingBufferHeight); + + this.currentScissor = scissor; + + return scissor; + }, + + /** + * Sets the current scissor state. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setScissor + * @since 3.0.0 + * + * @param {integer} x - The x position of the scissor. + * @param {integer} y - The y position of the scissor. + * @param {integer} width - The width of the scissor. + * @param {integer} height - The height of the scissor. + * @param {integer} [drawingBufferHeight] - Optional drawingBufferHeight override value. + */ + setScissor: function (x, y, width, height, drawingBufferHeight) + { + var gl = this.gl; + + var current = this.currentScissor; + + var setScissor = (width > 0 && height > 0); + + if (current && setScissor) + { + var cx = current[0]; + var cy = current[1]; + var cw = current[2]; + var ch = current[3]; + + setScissor = (cx !== x || cy !== y || cw !== width || ch !== height); + } + + if (setScissor) + { + this.flush(); + + // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/scissor + gl.scissor(x, (drawingBufferHeight - y - height), width, height); + } + }, + + /** + * Pops the last scissor state and sets it. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#popScissor + * @since 3.0.0 + */ + popScissor: function () + { + var scissorStack = this.scissorStack; + + // Remove the current scissor + scissorStack.pop(); + + // Reset the previous scissor + var scissor = scissorStack[scissorStack.length - 1]; + + if (scissor) + { + this.setScissor(scissor[0], scissor[1], scissor[2], scissor[3]); + } + + this.currentScissor = scissor; + }, + + /** + * Binds a WebGLPipeline and sets it as the current pipeline to be used. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setPipeline + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - The pipeline instance to be activated. + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + * + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline that was activated. + */ + setPipeline: function (pipelineInstance, gameObject) + { + if (this.currentPipeline !== pipelineInstance || + this.currentPipeline.vertexBuffer !== this.currentVertexBuffer || + this.currentPipeline.program !== this.currentProgram) + { + this.flush(); + this.currentPipeline = pipelineInstance; + this.currentPipeline.bind(); + } + + this.currentPipeline.onBind(gameObject); + + return this.currentPipeline; + }, + + /** + * Is there an active stencil mask? + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#hasActiveStencilMask + * @since 3.17.0 + * + * @return {boolean} `true` if there is an active stencil mask, otherwise `false`. + */ + hasActiveStencilMask: function () + { + var mask = this.currentMask.mask; + var camMask = this.currentCameraMask.mask; + + return ((mask && mask.isStencil) || (camMask && camMask.isStencil)); + }, + + /** + * Use this to reset the gl context to the state that Phaser requires to continue rendering. + * Calling this will: + * + * * Disable `DEPTH_TEST`, `CULL_FACE` and `STENCIL_TEST`. + * * Clear the depth buffer and stencil buffers. + * * Reset the viewport size. + * * Reset the blend mode. + * * Bind a blank texture as the active texture on texture unit zero. + * * Rebinds the given pipeline instance. + * + * You should call this having previously called `clearPipeline` and then wishing to return + * control to Phaser again. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#rebindPipeline + * @since 3.16.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipelineInstance - The pipeline instance to be activated. + */ + rebindPipeline: function (pipelineInstance) + { + var gl = this.gl; + + gl.disable(gl.DEPTH_TEST); + gl.disable(gl.CULL_FACE); + + if (this.hasActiveStencilMask()) + { + gl.clear(gl.DEPTH_BUFFER_BIT); + } + else + { + // If there wasn't a stencil mask set before this call, we can disable it safely + gl.disable(gl.STENCIL_TEST); + gl.clear(gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + } + + gl.viewport(0, 0, this.width, this.height); + + this.setBlendMode(0, true); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, this.blankTexture.glTexture); + + this.currentActiveTextureUnit = 0; + this.currentTextures[0] = this.blankTexture.glTexture; + + this.currentPipeline = pipelineInstance; + this.currentPipeline.bind(); + this.currentPipeline.onBind(); + }, + + /** + * Flushes the current WebGLPipeline being used and then clears it, along with the + * the current shader program and vertex buffer. Then resets the blend mode to NORMAL. + * Call this before jumping to your own gl context handler, and then call `rebindPipeline` when + * you wish to return control to Phaser again. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#clearPipeline + * @since 3.16.0 + */ + clearPipeline: function () + { + this.flush(); + + this.currentPipeline = null; + this.currentProgram = null; + this.currentVertexBuffer = null; + this.currentIndexBuffer = null; + + this.setBlendMode(0, true); + }, + + /** + * Sets the blend mode to the value given. + * + * If the current blend mode is different from the one given, the pipeline is flushed and the new + * blend mode is enabled. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setBlendMode + * @since 3.0.0 + * + * @param {integer} blendModeId - The blend mode to be set. Can be a `BlendModes` const or an integer value. + * @param {boolean} [force=false] - Force the blend mode to be set, regardless of the currently set blend mode. + * + * @return {boolean} `true` if the blend mode was changed as a result of this call, forcing a flush, otherwise `false`. + */ + setBlendMode: function (blendModeId, force) + { + if (force === undefined) { force = false; } + + var gl = this.gl; + var blendMode = this.blendModes[blendModeId]; + + if (force || (blendModeId !== CONST.BlendModes.SKIP_CHECK && this.currentBlendMode !== blendModeId)) + { + this.flush(); + + gl.enable(gl.BLEND); + gl.blendEquation(blendMode.equation); + + if (blendMode.func.length > 2) + { + gl.blendFuncSeparate(blendMode.func[0], blendMode.func[1], blendMode.func[2], blendMode.func[3]); + } + else + { + gl.blendFunc(blendMode.func[0], blendMode.func[1]); + } + + this.currentBlendMode = blendModeId; + + return true; + } + + return false; + }, + + /** + * Creates a new custom blend mode for the renderer. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#addBlendMode + * @since 3.0.0 + * + * @param {function} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. + * @param {function} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. + * + * @return {integer} The index of the new blend mode, used for referencing it in the future. + */ + addBlendMode: function (func, equation) + { + var index = this.blendModes.push({ func: func, equation: equation }); + + return index - 1; + }, + + /** + * Updates the function bound to a given custom blend mode. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#updateBlendMode + * @since 3.0.0 + * + * @param {integer} index - The index of the custom blend mode. + * @param {function} func - The function to use for the blend mode. + * @param {function} equation - The equation to use for the blend mode. + * + * @return {this} This WebGLRenderer instance. + */ + updateBlendMode: function (index, func, equation) + { + if (this.blendModes[index]) + { + this.blendModes[index].func = func; + + if (equation) + { + this.blendModes[index].equation = equation; + } + } + + return this; + }, + + /** + * Removes a custom blend mode from the renderer. + * Any Game Objects still using this blend mode will error, so be sure to clear them first. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#removeBlendMode + * @since 3.0.0 + * + * @param {integer} index - The index of the custom blend mode to be removed. + * + * @return {this} This WebGLRenderer instance. + */ + removeBlendMode: function (index) + { + if (index > 17 && this.blendModes[index]) + { + this.blendModes.splice(index, 1); + } + + return this; + }, + + /** + * Sets the current active texture for texture unit zero to be a blank texture. + * This only happens if there isn't a texture already in use by texture unit zero. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setBlankTexture + * @private + * @since 3.12.0 + * + * @param {boolean} [force=false] - Force a blank texture set, regardless of what's already bound? + */ + setBlankTexture: function (force) + { + if (force === undefined) { force = false; } + + if (force || this.currentActiveTextureUnit !== 0 || !this.currentTextures[0]) + { + this.setTexture2D(this.blankTexture.glTexture, 0); + } + }, + + /** + * Binds a texture at a texture unit. If a texture is already + * bound to that unit it will force a flush on the current pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setTexture2D + * @since 3.0.0 + * + * @param {WebGLTexture} texture - The WebGL texture that needs to be bound. + * @param {integer} textureUnit - The texture unit to which the texture will be bound. + * @param {boolean} [flush=true] - Will the current pipeline be flushed if this is a new texture, or not? + * + * @return {this} This WebGLRenderer instance. + */ + setTexture2D: function (texture, textureUnit, flush) + { + if (flush === undefined) { flush = true; } + + var gl = this.gl; + + if (texture !== this.currentTextures[textureUnit]) + { + if (flush) + { + this.flush(); + } + + if (this.currentActiveTextureUnit !== textureUnit) + { + gl.activeTexture(gl.TEXTURE0 + textureUnit); + + this.currentActiveTextureUnit = textureUnit; + } + + gl.bindTexture(gl.TEXTURE_2D, texture); + + this.currentTextures[textureUnit] = texture; + } + + return this; + }, + + /** + * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setFramebuffer + * @since 3.0.0 + * + * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound. + * @param {boolean} [updateScissor=false] - If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. + * + * @return {this} This WebGLRenderer instance. + */ + setFramebuffer: function (framebuffer, updateScissor) + { + if (updateScissor === undefined) { updateScissor = false; } + + var gl = this.gl; + + var width = this.width; + var height = this.height; + + if (framebuffer !== this.currentFramebuffer) + { + if (framebuffer && framebuffer.renderTexture) + { + width = framebuffer.renderTexture.width; + height = framebuffer.renderTexture.height; + } + else + { + this.flush(); + } + + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + + gl.viewport(0, 0, width, height); + + if (updateScissor) + { + if (framebuffer) + { + this.drawingBufferHeight = height; + + this.pushScissor(0, 0, width, height); + } + else + { + this.drawingBufferHeight = this.height; + + this.popScissor(); + } + } + + this.currentFramebuffer = framebuffer; + } + + return this; + }, + + /** + * Binds a program. If there was another program already bound it will force a pipeline flush. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setProgram + * @since 3.0.0 + * + * @param {WebGLProgram} program - The program that needs to be bound. + * + * @return {this} This WebGLRenderer instance. + */ + setProgram: function (program) + { + var gl = this.gl; + + if (program !== this.currentProgram) + { + this.flush(); + + gl.useProgram(program); + + this.currentProgram = program; + } + + return this; + }, + + /** + * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setVertexBuffer + * @since 3.0.0 + * + * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound. + * + * @return {this} This WebGLRenderer instance. + */ + setVertexBuffer: function (vertexBuffer) + { + var gl = this.gl; + + if (vertexBuffer !== this.currentVertexBuffer) + { + this.flush(); + + gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); + + this.currentVertexBuffer = vertexBuffer; + } + + return this; + }, + + /** + * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setIndexBuffer + * @since 3.0.0 + * + * @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound. + * + * @return {this} This WebGLRenderer instance. + */ + setIndexBuffer: function (indexBuffer) + { + var gl = this.gl; + + if (indexBuffer !== this.currentIndexBuffer) + { + this.flush(); + + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer); + + this.currentIndexBuffer = indexBuffer; + } + + return this; + }, + + /** + * Creates a texture from an image source. If the source is not valid it creates an empty texture. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#createTextureFromSource + * @since 3.0.0 + * + * @param {object} source - The source of the texture. + * @param {integer} width - The width of the texture. + * @param {integer} height - The height of the texture. + * @param {integer} scaleMode - The scale mode to be used by the texture. + * + * @return {?WebGLTexture} The WebGL Texture that was created, or `null` if it couldn't be created. + */ + createTextureFromSource: function (source, width, height, scaleMode) + { + var gl = this.gl; + var filter = gl.NEAREST; + var wrap = gl.CLAMP_TO_EDGE; + var texture = null; + + width = source ? source.width : width; + height = source ? source.height : height; + + if (IsSizePowerOfTwo(width, height)) + { + wrap = gl.REPEAT; + } + + if (scaleMode === CONST.ScaleModes.LINEAR && this.config.antialias) + { + filter = gl.LINEAR; + } + + if (!source && typeof width === 'number' && typeof height === 'number') + { + texture = this.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + } + else + { + texture = this.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, source); + } + + return texture; + }, + + /** + * A wrapper for creating a WebGLTexture. If no pixel data is passed it will create an empty texture. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#createTexture2D + * @since 3.0.0 + * + * @param {integer} mipLevel - Mip level of the texture. + * @param {integer} minFilter - Filtering of the texture. + * @param {integer} magFilter - Filtering of the texture. + * @param {integer} wrapT - Wrapping mode of the texture. + * @param {integer} wrapS - Wrapping mode of the texture. + * @param {integer} format - Which format does the texture use. + * @param {object} pixels - pixel data. + * @param {integer} width - Width of the texture in pixels. + * @param {integer} height - Height of the texture in pixels. + * @param {boolean} pma - Does the texture have premultiplied alpha? + * + * @return {WebGLTexture} The WebGLTexture that was created. + */ + createTexture2D: function (mipLevel, minFilter, magFilter, wrapT, wrapS, format, pixels, width, height, pma) + { + pma = (pma === undefined || pma === null) ? true : pma; + + var gl = this.gl; + var texture = gl.createTexture(); + + this.setTexture2D(texture, 0); + + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, magFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrapS); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrapT); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, pma); + + if (pixels === null || pixels === undefined) + { + gl.texImage2D(gl.TEXTURE_2D, mipLevel, format, width, height, 0, format, gl.UNSIGNED_BYTE, null); + } + else + { + gl.texImage2D(gl.TEXTURE_2D, mipLevel, format, format, gl.UNSIGNED_BYTE, pixels); + + width = pixels.width; + height = pixels.height; + } + + this.setTexture2D(null, 0); + + texture.isAlphaPremultiplied = pma; + texture.isRenderTexture = false; + texture.width = width; + texture.height = height; + + this.nativeTextures.push(texture); + + return texture; + }, + + /** + * Wrapper for creating WebGLFramebuffer. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#createFramebuffer + * @since 3.0.0 + * + * @param {integer} width - Width in pixels of the framebuffer + * @param {integer} height - Height in pixels of the framebuffer + * @param {WebGLTexture} renderTexture - The color texture to where the color pixels are written + * @param {boolean} addDepthStencilBuffer - Indicates if the current framebuffer support depth and stencil buffers + * + * @return {WebGLFramebuffer} Raw WebGLFramebuffer + */ + createFramebuffer: function (width, height, renderTexture, addDepthStencilBuffer) + { + var gl = this.gl; + var framebuffer = gl.createFramebuffer(); + var complete = 0; + + this.setFramebuffer(framebuffer); + + if (addDepthStencilBuffer) + { + var depthStencilBuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); + } + + renderTexture.isRenderTexture = true; + renderTexture.isAlphaPremultiplied = false; + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, renderTexture, 0); + + complete = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + + if (complete !== gl.FRAMEBUFFER_COMPLETE) + { + var errors = { + 36054: 'Incomplete Attachment', + 36055: 'Missing Attachment', + 36057: 'Incomplete Dimensions', + 36061: 'Framebuffer Unsupported' + }; + + throw new Error('Framebuffer incomplete. Framebuffer status: ' + errors[complete]); + } + + framebuffer.renderTexture = renderTexture; + + this.setFramebuffer(null); + + return framebuffer; + }, + + /** + * Wrapper for creating a WebGLProgram + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#createProgram + * @since 3.0.0 + * + * @param {string} vertexShader - Source to the vertex shader + * @param {string} fragmentShader - Source to the fragment shader + * + * @return {WebGLProgram} Raw WebGLProgram + */ + createProgram: function (vertexShader, fragmentShader) + { + var gl = this.gl; + var program = gl.createProgram(); + var vs = gl.createShader(gl.VERTEX_SHADER); + var fs = gl.createShader(gl.FRAGMENT_SHADER); + + gl.shaderSource(vs, vertexShader); + gl.shaderSource(fs, fragmentShader); + gl.compileShader(vs); + gl.compileShader(fs); + + if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS)) + { + throw new Error('Failed to compile Vertex Shader:\n' + gl.getShaderInfoLog(vs)); + } + if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) + { + throw new Error('Failed to compile Fragment Shader:\n' + gl.getShaderInfoLog(fs)); + } + + gl.attachShader(program, vs); + gl.attachShader(program, fs); + gl.linkProgram(program); + + if (!gl.getProgramParameter(program, gl.LINK_STATUS)) + { + throw new Error('Failed to link program:\n' + gl.getProgramInfoLog(program)); + } + + return program; + }, + + /** + * Wrapper for creating a vertex buffer. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#createVertexBuffer + * @since 3.0.0 + * + * @param {ArrayBuffer} initialDataOrSize - It's either ArrayBuffer or an integer indicating the size of the vbo + * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW + * + * @return {WebGLBuffer} Raw vertex buffer + */ + createVertexBuffer: function (initialDataOrSize, bufferUsage) + { + var gl = this.gl; + var vertexBuffer = gl.createBuffer(); + + this.setVertexBuffer(vertexBuffer); + + gl.bufferData(gl.ARRAY_BUFFER, initialDataOrSize, bufferUsage); + + this.setVertexBuffer(null); + + return vertexBuffer; + }, + + /** + * Wrapper for creating a vertex buffer. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#createIndexBuffer + * @since 3.0.0 + * + * @param {ArrayBuffer} initialDataOrSize - Either ArrayBuffer or an integer indicating the size of the vbo. + * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. + * + * @return {WebGLBuffer} Raw index buffer + */ + createIndexBuffer: function (initialDataOrSize, bufferUsage) + { + var gl = this.gl; + var indexBuffer = gl.createBuffer(); + + this.setIndexBuffer(indexBuffer); + + gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, initialDataOrSize, bufferUsage); + + this.setIndexBuffer(null); + + return indexBuffer; + }, + + /** + * Removes the given texture from the nativeTextures array and then deletes it from the GPU. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteTexture + * @since 3.0.0 + * + * @param {WebGLTexture} texture - The WebGL Texture to be deleted. + * + * @return {this} This WebGLRenderer instance. + */ + deleteTexture: function (texture) + { + var index = this.nativeTextures.indexOf(texture); + + if (index !== -1) + { + SpliceOne(this.nativeTextures, index); + } + + this.gl.deleteTexture(texture); + + if (this.currentTextures[0] === texture && !this.game.pendingDestroy) + { + // texture we just deleted is in use, so bind a blank texture + this.setBlankTexture(true); + } + + return this; + }, + + /** + * Deletes a WebGLFramebuffer from the GL instance. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteFramebuffer + * @since 3.0.0 + * + * @param {WebGLFramebuffer} framebuffer - The Framebuffer to be deleted. + * + * @return {this} This WebGLRenderer instance. + */ + deleteFramebuffer: function (framebuffer) + { + this.gl.deleteFramebuffer(framebuffer); + + return this; + }, + + /** + * Deletes a WebGLProgram from the GL instance. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteProgram + * @since 3.0.0 + * + * @param {WebGLProgram} program - The shader program to be deleted. + * + * @return {this} This WebGLRenderer instance. + */ + deleteProgram: function (program) + { + this.gl.deleteProgram(program); + + return this; + }, + + /** + * Deletes a WebGLBuffer from the GL instance. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteBuffer + * @since 3.0.0 + * + * @param {WebGLBuffer} vertexBuffer - The WebGLBuffer to be deleted. + * + * @return {this} This WebGLRenderer instance. + */ + deleteBuffer: function (buffer) + { + this.gl.deleteBuffer(buffer); + + return this; + }, + + /** + * Controls the pre-render operations for the given camera. + * Handles any clipping needed by the camera and renders the background color if a color is visible. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#preRenderCamera + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to pre-render. + */ + preRenderCamera: function (camera) + { + var cx = camera._cx; + var cy = camera._cy; + var cw = camera._cw; + var ch = camera._ch; + + var TextureTintPipeline = this.pipelines.TextureTintPipeline; + + var color = camera.backgroundColor; + + if (camera.renderToTexture) + { + this.flush(); + + this.pushScissor(cx, cy, cw, -ch); + + this.setFramebuffer(camera.framebuffer); + + var gl = this.gl; + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + + TextureTintPipeline.projOrtho(cx, cw + cx, cy, ch + cy, -1000, 1000); + + if (camera.mask) + { + this.currentCameraMask.mask = camera.mask; + this.currentCameraMask.camera = camera._maskCamera; + + camera.mask.preRenderWebGL(this, camera, camera._maskCamera); + } + + if (color.alphaGL > 0) + { + TextureTintPipeline.drawFillRect( + cx, cy, cw + cx, ch + cy, + Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), + color.alphaGL + ); + } + + camera.emit(CameraEvents.PRE_RENDER, camera); + } + else + { + this.pushScissor(cx, cy, cw, ch); + + if (camera.mask) + { + this.currentCameraMask.mask = camera.mask; + this.currentCameraMask.camera = camera._maskCamera; + + camera.mask.preRenderWebGL(this, camera, camera._maskCamera); + } + + if (color.alphaGL > 0) + { + TextureTintPipeline.drawFillRect( + cx, cy, cw , ch, + Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), + color.alphaGL + ); + } + } + }, + + getCurrentStencilMask: function () + { + var prev = null; + var stack = this.maskStack; + var cameraMask = this.currentCameraMask; + + if (stack.length > 0) + { + prev = stack[stack.length - 1]; + } + else if (cameraMask.mask && cameraMask.mask.isStencil) + { + prev = cameraMask; + } + + return prev; + }, + + /** + * Controls the post-render operations for the given camera. + * Renders the foreground camera effects like flash and fading. It resets the current scissor state. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#postRenderCamera + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to post-render. + */ + postRenderCamera: function (camera) + { + var TextureTintPipeline = this.pipelines.TextureTintPipeline; + + camera.flashEffect.postRenderWebGL(TextureTintPipeline, Utils.getTintFromFloats); + camera.fadeEffect.postRenderWebGL(TextureTintPipeline, Utils.getTintFromFloats); + + camera.dirty = false; + + this.popScissor(); + + if (camera.renderToTexture) + { + TextureTintPipeline.flush(); + + this.setFramebuffer(null); + + camera.emit(CameraEvents.POST_RENDER, camera); + + TextureTintPipeline.projOrtho(0, TextureTintPipeline.width, TextureTintPipeline.height, 0, -1000.0, 1000.0); + + var getTint = Utils.getTintAppendFloatAlpha; + + var pipeline = (camera.pipeline) ? camera.pipeline : TextureTintPipeline; + + pipeline.batchTexture( + camera, + camera.glTexture, + camera.width, camera.height, + camera.x, camera.y, + camera.width, camera.height, + camera.zoom, camera.zoom, + camera.rotation, + camera.flipX, !camera.flipY, + 1, 1, + 0, 0, + 0, 0, camera.width, camera.height, + getTint(camera._tintTL, camera._alphaTL), + getTint(camera._tintTR, camera._alphaTR), + getTint(camera._tintBL, camera._alphaBL), + getTint(camera._tintBR, camera._alphaBR), + (camera._isTinted && camera.tintFill), + 0, 0, + this.defaultCamera, + null + ); + + // Force clear the current texture so that items next in the batch (like Graphics) don't try and use it + this.setBlankTexture(true); + } + + if (camera.mask) + { + this.currentCameraMask.mask = null; + + camera.mask.postRenderWebGL(this, camera._maskCamera); + } + }, + + /** + * Clears the current vertex buffer and updates pipelines. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#preRender + * @since 3.0.0 + */ + preRender: function () + { + if (this.contextLost) { return; } + + var gl = this.gl; + var pipelines = this.pipelines; + + // Make sure we are bound to the main frame buffer + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + + if (this.config.clearBeforeRender) + { + var clearColor = this.config.backgroundColor; + + gl.clearColor(clearColor.redGL, clearColor.greenGL, clearColor.blueGL, clearColor.alphaGL); + + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT); + } + + gl.enable(gl.SCISSOR_TEST); + + for (var key in pipelines) + { + pipelines[key].onPreRender(); + } + + // TODO - Find a way to stop needing to create these arrays every frame + // and equally not need a huge array buffer created to hold them + + this.currentScissor = [ 0, 0, this.width, this.height ]; + this.scissorStack = [ this.currentScissor ]; + + if (this.game.scene.customViewports) + { + gl.scissor(0, (this.drawingBufferHeight - this.height), this.width, this.height); + } + + this.currentMask.mask = null; + this.currentCameraMask.mask = null; + this.maskStack.length = 0; + + this.setPipeline(this.pipelines.TextureTintPipeline); + }, + + /** + * The core render step for a Scene Camera. + * + * Iterates through the given Game Object's array and renders them with the given Camera. + * + * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked + * by the Scene Systems.render method. + * + * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#render + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to render. + * @param {Phaser.GameObjects.GameObject} children - The Game Object's within the Scene to be rendered. + * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently un-used. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. + */ + render: function (scene, children, interpolationPercentage, camera) + { + if (this.contextLost) { return; } + + var list = children.list; + var childCount = list.length; + var pipelines = this.pipelines; + + for (var key in pipelines) + { + pipelines[key].onRender(scene, camera); + } + + // Apply scissor for cam region + render background color, if not transparent + this.preRenderCamera(camera); + + var current = this.currentMask; + + for (var i = 0; i < childCount; i++) + { + var child = list[i]; + + if (!child.willRender(camera)) + { + continue; + } + + if (child.blendMode !== this.currentBlendMode) + { + this.setBlendMode(child.blendMode); + } + + var mask = child.mask; + + current = this.currentMask; + + if (current.mask && current.mask !== mask) + { + // Render out the previously set mask + current.mask.postRenderWebGL(this, current.camera); + } + + if (mask && current.mask !== mask) + { + mask.preRenderWebGL(this, child, camera); + } + + child.renderWebGL(this, child, interpolationPercentage, camera); + } + + current = this.currentMask; + + if (current.mask) + { + // Render out the previously set mask, if it was the last item in the display list + current.mask.postRenderWebGL(this, current.camera); + } + + this.setBlendMode(CONST.BlendModes.NORMAL); + + // Applies camera effects and pops the scissor, if set + this.postRenderCamera(camera); + }, + + /** + * The post-render step happens after all Cameras in all Scenes have been rendered. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#postRender + * @since 3.0.0 + */ + postRender: function () + { + if (this.contextLost) { return; } + + this.flush(); + + // Unbind custom framebuffer here + + var state = this.snapshotState; + + if (state.callback) + { + WebGLSnapshot(this.canvas, state); + + state.callback = null; + } + + var pipelines = this.pipelines; + + for (var key in pipelines) + { + pipelines[key].onPostRender(); + } + }, + + /** + * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. + * + * To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshot + * @since 3.0.0 + * + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This WebGL Renderer. + */ + snapshot: function (callback, type, encoderOptions) + { + return this.snapshotArea(0, 0, this.gl.drawingBufferWidth, this.gl.drawingBufferHeight, callback, type, encoderOptions); + }, + + /** + * Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then + * calling this method will override it. + * + * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer into an ArrayBufferView. + * It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it, + * which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process, + * which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotArea + * @since 3.16.0 + * + * @param {integer} x - The x coordinate to grab from. + * @param {integer} y - The y coordinate to grab from. + * @param {integer} width - The width of the area to grab. + * @param {integer} height - The height of the area to grab. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. + * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. + * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. + * + * @return {this} This WebGL Renderer. + */ + snapshotArea: function (x, y, width, height, callback, type, encoderOptions) + { + var state = this.snapshotState; + + state.callback = callback; + state.type = type; + state.encoder = encoderOptions; + state.getPixel = false; + state.x = x; + state.y = y; + state.width = Math.min(width, this.gl.drawingBufferWidth); + state.height = Math.min(height, this.gl.drawingBufferHeight); + + return this; + }, + + /** + * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered. + * + * To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`. + * + * Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then + * calling this method will override it. + * + * Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for + * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, + * using less memory. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotPixel + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the pixel to get. + * @param {integer} y - The y coordinate of the pixel to get. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. + * + * @return {this} This WebGL Renderer. + */ + snapshotPixel: function (x, y, callback) + { + this.snapshotArea(x, y, 1, 1, callback); + + this.snapshotState.getPixel = true; + + return this; + }, + + /** + * Creates a WebGL Texture based on the given canvas element. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#canvasToTexture + * @since 3.0.0 + * + * @param {HTMLCanvasElement} srcCanvas - The Canvas element that will be used to populate the texture. + * @param {WebGLTexture} [dstTexture] - Is this going to replace an existing texture? If so, pass it here. + * @param {boolean} [noRepeat=false] - Should this canvas never be allowed to set REPEAT? (such as for Text objects) + * + * @return {WebGLTexture} The newly created WebGL Texture. + */ + canvasToTexture: function (srcCanvas, dstTexture, noRepeat) + { + if (noRepeat === undefined) { noRepeat = false; } + + var gl = this.gl; + + if (!dstTexture) + { + var wrapping = gl.CLAMP_TO_EDGE; + + if (!noRepeat && IsSizePowerOfTwo(srcCanvas.width, srcCanvas.height)) + { + wrapping = gl.REPEAT; + } + + var filter = (this.config.antialias) ? gl.LINEAR : gl.NEAREST; + + dstTexture = this.createTexture2D(0, filter, filter, wrapping, wrapping, gl.RGBA, srcCanvas, srcCanvas.width, srcCanvas.height, true); + } + else + { + this.setTexture2D(dstTexture, 0); + + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, srcCanvas); + + dstTexture.width = srcCanvas.width; + dstTexture.height = srcCanvas.height; + + this.setTexture2D(null, 0); + } + + return dstTexture; + }, + + /** + * Sets the minification and magnification filter for a texture. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureFilter + * @since 3.0.0 + * + * @param {integer} texture - The texture to set the filter for. + * @param {integer} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. + * + * @return {this} This WebGL Renderer instance. + */ + setTextureFilter: function (texture, filter) + { + var gl = this.gl; + var glFilter = [ gl.LINEAR, gl.NEAREST ][filter]; + + this.setTexture2D(texture, 0); + + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, glFilter); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, glFilter); + + this.setTexture2D(null, 0); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat1 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {number} x - [description] + * + * @return {this} This WebGL Renderer instance. + */ + setFloat1: function (program, name, x) + { + this.setProgram(program); + + this.gl.uniform1f(this.gl.getUniformLocation(program, name), x); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat2 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {number} x - [description] + * @param {number} y - [description] + * + * @return {this} This WebGL Renderer instance. + */ + setFloat2: function (program, name, x, y) + { + this.setProgram(program); + + this.gl.uniform2f(this.gl.getUniformLocation(program, name), x, y); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat3 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} z - [description] + * + * @return {this} This WebGL Renderer instance. + */ + setFloat3: function (program, name, x, y, z) + { + this.setProgram(program); + + this.gl.uniform3f(this.gl.getUniformLocation(program, name), x, y, z); + + return this; + }, + + /** + * Sets uniform of a WebGLProgram + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat4 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {number} x - X component + * @param {number} y - Y component + * @param {number} z - Z component + * @param {number} w - W component + * + * @return {this} This WebGL Renderer instance. + */ + setFloat4: function (program, name, x, y, z, w) + { + this.setProgram(program); + + this.gl.uniform4f(this.gl.getUniformLocation(program, name), x, y, z, w); + + return this; + }, + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat1v + * @since 3.13.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGL Renderer instance. + */ + setFloat1v: function (program, name, arr) + { + this.setProgram(program); + + this.gl.uniform1fv(this.gl.getUniformLocation(program, name), arr); + + return this; + }, + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat2v + * @since 3.13.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGL Renderer instance. + */ + setFloat2v: function (program, name, arr) + { + this.setProgram(program); + + this.gl.uniform2fv(this.gl.getUniformLocation(program, name), arr); + + return this; + }, + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat3v + * @since 3.13.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGL Renderer instance. + */ + setFloat3v: function (program, name, arr) + { + this.setProgram(program); + + this.gl.uniform3fv(this.gl.getUniformLocation(program, name), arr); + + return this; + }, + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat4v + * @since 3.13.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGL Renderer instance. + */ + + setFloat4v: function (program, name, arr) + { + this.setProgram(program); + + this.gl.uniform4fv(this.gl.getUniformLocation(program, name), arr); + + return this; + }, + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt1 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {integer} x - [description] + * + * @return {this} This WebGL Renderer instance. + */ + setInt1: function (program, name, x) + { + this.setProgram(program); + + this.gl.uniform1i(this.gl.getUniformLocation(program, name), x); + + return this; + }, + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt2 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {integer} x - The new X component + * @param {integer} y - The new Y component + * + * @return {this} This WebGL Renderer instance. + */ + setInt2: function (program, name, x, y) + { + this.setProgram(program); + + this.gl.uniform2i(this.gl.getUniformLocation(program, name), x, y); + + return this; + }, + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt3 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {integer} x - The new X component + * @param {integer} y - The new Y component + * @param {integer} z - The new Z component + * + * @return {this} This WebGL Renderer instance. + */ + setInt3: function (program, name, x, y, z) + { + this.setProgram(program); + + this.gl.uniform3i(this.gl.getUniformLocation(program, name), x, y, z); + + return this; + }, + + /** + * Sets the value of a uniform variable in the given WebGLProgram. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt4 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {integer} x - X component + * @param {integer} y - Y component + * @param {integer} z - Z component + * @param {integer} w - W component + * + * @return {this} This WebGL Renderer instance. + */ + setInt4: function (program, name, x, y, z, w) + { + this.setProgram(program); + + this.gl.uniform4i(this.gl.getUniformLocation(program, name), x, y, z, w); + + return this; + }, + + /** + * Sets the value of a 2x2 matrix uniform variable in the given WebGLProgram. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix2 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false. + * @param {Float32Array} matrix - The new matrix value. + * + * @return {this} This WebGL Renderer instance. + */ + setMatrix2: function (program, name, transpose, matrix) + { + this.setProgram(program); + + this.gl.uniformMatrix2fv(this.gl.getUniformLocation(program, name), transpose, matrix); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix3 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {boolean} transpose - [description] + * @param {Float32Array} matrix - [description] + * + * @return {this} This WebGL Renderer instance. + */ + setMatrix3: function (program, name, transpose, matrix) + { + this.setProgram(program); + + this.gl.uniformMatrix3fv(this.gl.getUniformLocation(program, name), transpose, matrix); + + return this; + }, + + /** + * Sets uniform of a WebGLProgram + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix4 + * @since 3.0.0 + * + * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. + * @param {string} name - The name of the uniform to look-up and modify. + * @param {boolean} transpose - Is the matrix transposed + * @param {Float32Array} matrix - Matrix data + * + * @return {this} This WebGL Renderer instance. + */ + setMatrix4: function (program, name, transpose, matrix) + { + this.setProgram(program); + + this.gl.uniformMatrix4fv(this.gl.getUniformLocation(program, name), transpose, matrix); + + return this; + }, + + /** + * Returns the maximum number of texture units that can be used in a fragment shader. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#getMaxTextures + * @since 3.8.0 + * + * @return {integer} The maximum number of textures WebGL supports. + */ + getMaxTextures: function () + { + return this.config.maxTextures; + }, + + /** + * Returns the largest texture size (either width or height) that can be created. + * Note that VRAM may not allow a texture of any given size, it just expresses + * hardware / driver support for a given size. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#getMaxTextureSize + * @since 3.8.0 + * + * @return {integer} The maximum supported texture size. + */ + getMaxTextureSize: function () + { + return this.config.maxTextureSize; + }, + + /** + * Destroy this WebGLRenderer, cleaning up all related resources such as pipelines, native textures, etc. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#destroy + * @since 3.0.0 + */ + destroy: function () + { + // Clear-up anything that should be cleared :) + for (var key in this.pipelines) + { + this.pipelines[key].destroy(); + + delete this.pipelines[key]; + } + + for (var index = 0; index < this.nativeTextures.length; index++) + { + this.deleteTexture(this.nativeTextures[index]); + + delete this.nativeTextures[index]; + } + + delete this.gl; + delete this.game; + + this.maskStack.length = 0; + + this.contextLost = true; + this.extensions = {}; + this.nativeTextures.length = 0; + } + +}); + +module.exports = WebGLRenderer; + + +/***/ }), +/* 484 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(24); +var Color = __webpack_require__(33); +var GetFastValue = __webpack_require__(2); + +/** + * Takes a snapshot of an area from the current frame displayed by a WebGL canvas. + * + * This is then copied to an Image object. When this loads, the results are sent + * to the callback provided in the Snapshot Configuration object. + * + * @function Phaser.Renderer.Snapshot.WebGL + * @since 3.0.0 + * + * @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of. + * @param {Phaser.Types.Renderer.Snapshot.SnapshotState} config - The snapshot configuration object. + */ +var WebGLSnapshot = function (sourceCanvas, config) +{ + var gl = sourceCanvas.getContext('experimental-webgl'); + + var callback = GetFastValue(config, 'callback'); + var type = GetFastValue(config, 'type', 'image/png'); + var encoderOptions = GetFastValue(config, 'encoder', 0.92); + var x = GetFastValue(config, 'x', 0); + var y = GetFastValue(config, 'y', 0); + var width = GetFastValue(config, 'width', gl.drawingBufferWidth); + var height = GetFastValue(config, 'height', gl.drawingBufferHeight); + var getPixel = GetFastValue(config, 'getPixel', false); + + if (getPixel) + { + var pixel = new Uint8Array(4); + + gl.readPixels(x, gl.drawingBufferHeight - y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); + + callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3] / 255)); + } + else + { + var pixels = new Uint8Array(width * height * 4); + + gl.readPixels(x, gl.drawingBufferHeight - y - height, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + + var canvas = CanvasPool.createWebGL(this, width, height); + var ctx = canvas.getContext('2d'); + + var imageData = ctx.getImageData(0, 0, width, height); + + var data = imageData.data; + + for (var py = 0; py < height; py++) + { + for (var px = 0; px < width; px++) + { + var sourceIndex = ((height - py) * width + px) * 4; + var destIndex = (py * width + px) * 4; + + data[destIndex + 0] = pixels[sourceIndex + 0]; + data[destIndex + 1] = pixels[sourceIndex + 1]; + data[destIndex + 2] = pixels[sourceIndex + 2]; + data[destIndex + 3] = pixels[sourceIndex + 3]; + } + } + + ctx.putImageData(imageData, 0, 0); + + var image = new Image(); + + image.onerror = function () + { + callback.call(null); + + CanvasPool.remove(canvas); + }; + + image.onload = function () + { + callback.call(null, image); + + CanvasPool.remove(canvas); + }; + + image.src = canvas.toDataURL(type, encoderOptions); + } +}; + +module.exports = WebGLSnapshot; + + +/***/ }), +/* 485 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var ShaderSourceFS = __webpack_require__(732); +var ShaderSourceVS = __webpack_require__(733); +var WebGLPipeline = __webpack_require__(225); + +/** + * @classdesc + * BitmapMaskPipeline handles all bitmap masking rendering in WebGL. It works by using + * sampling two texture on the fragment shader and using the fragment's alpha to clip the region. + * The config properties are: + * - game: Current game instance. + * - renderer: Current WebGL renderer. + * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. + * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). + * - vertShader: Source for vertex shader as a string. + * - fragShader: Source for fragment shader as a string. + * - vertexCapacity: The amount of vertices that shall be allocated + * - vertexSize: The size of a single vertex in bytes. + * + * @class BitmapMaskPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.0.0 + * + * @param {object} config - Used for overriding shader an pipeline properties if extending this pipeline. + */ +var BitmapMaskPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function BitmapMaskPipeline (config) + { + WebGLPipeline.call(this, { + game: config.game, + renderer: config.renderer, + gl: config.renderer.gl, + topology: (config.topology ? config.topology : config.renderer.gl.TRIANGLES), + vertShader: (config.vertShader ? config.vertShader : ShaderSourceVS), + fragShader: (config.fragShader ? config.fragShader : ShaderSourceFS), + vertexCapacity: (config.vertexCapacity ? config.vertexCapacity : 3), + + vertexSize: (config.vertexSize ? config.vertexSize : + Float32Array.BYTES_PER_ELEMENT * 2), + + vertices: new Float32Array([ + -1, +1, -1, -7, +7, +1 + ]).buffer, + + attributes: [ + { + name: 'inPosition', + size: 2, + type: config.renderer.gl.FLOAT, + normalized: false, + offset: 0 + } + ] + }); + + /** + * Float32 view of the array buffer containing the pipeline's vertices. + * + * @name Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#vertexViewF32 + * @type {Float32Array} + * @since 3.0.0 + */ + this.vertexViewF32 = new Float32Array(this.vertexData); + + /** + * Size of the batch. + * + * @name Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#maxQuads + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.maxQuads = 1; + + /** + * Dirty flag to check if resolution properties need to be updated on the + * masking shader. + * + * @name Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#resolutionDirty + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.resolutionDirty = true; + }, + + /** + * Called every time the pipeline needs to be used. + * It binds all necessary resources. + * + * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#onBind + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + onBind: function () + { + WebGLPipeline.prototype.onBind.call(this); + + var renderer = this.renderer; + var program = this.program; + + if (this.resolutionDirty) + { + renderer.setFloat2(program, 'uResolution', this.width, this.height); + renderer.setInt1(program, 'uMainSampler', 0); + renderer.setInt1(program, 'uMaskSampler', 1); + this.resolutionDirty = false; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#resize + * @since 3.0.0 + * + * @param {number} width - [description] + * @param {number} height - [description] + * @param {number} resolution - [description] + * + * @return {this} This WebGLPipeline instance. + */ + resize: function (width, height, resolution) + { + WebGLPipeline.prototype.resize.call(this, width, height, resolution); + this.resolutionDirty = true; + return this; + }, + + /** + * Binds necessary resources and renders the mask to a separated framebuffer. + * The framebuffer for the masked object is also bound for further use. + * + * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#beginMask + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} mask - GameObject used as mask. + * @param {Phaser.GameObjects.GameObject} maskedObject - GameObject masked by the mask GameObject. + * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] + */ + beginMask: function (mask, maskedObject, camera) + { + var renderer = this.renderer; + var gl = this.gl; + + // The renderable Game Object that is being used for the bitmap mask + var bitmapMask = mask.bitmapMask; + + if (bitmapMask && gl) + { + renderer.flush(); + + mask.prevFramebuffer = renderer.currentFramebuffer; + + renderer.setFramebuffer(mask.mainFramebuffer); + + gl.disable(gl.STENCIL_TEST); + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + + if (renderer.currentCameraMask.mask !== mask) + { + renderer.currentMask.mask = mask; + renderer.currentMask.camera = camera; + } + } + }, + + /** + * The masked game objects framebuffer is unbound and its texture + * is bound together with the mask texture and the mask shader and + * a draw call with a single quad is processed. Here is where the + * masking effect is applied. + * + * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#endMask + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} mask - GameObject used as a mask. + */ + endMask: function (mask, camera) + { + var gl = this.gl; + var renderer = this.renderer; + + // The renderable Game Object that is being used for the bitmap mask + var bitmapMask = mask.bitmapMask; + + if (bitmapMask && gl) + { + renderer.flush(); + + // First we draw the mask to the mask fb + renderer.setFramebuffer(mask.maskFramebuffer); + + gl.clearColor(0, 0, 0, 0); + gl.clear(gl.COLOR_BUFFER_BIT); + + renderer.setBlendMode(0, true); + + bitmapMask.renderWebGL(renderer, bitmapMask, 0, camera); + + renderer.flush(); + + renderer.setFramebuffer(mask.prevFramebuffer); + + // Is there a stencil further up the stack? + var prev = renderer.getCurrentStencilMask(); + + if (prev) + { + gl.enable(gl.STENCIL_TEST); + + prev.mask.applyStencil(renderer, prev.camera, true); + } + else + { + renderer.currentMask.mask = null; + } + + // Bind bitmap mask pipeline and draw + renderer.setPipeline(this); + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(gl.TEXTURE_2D, mask.maskTexture); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, mask.mainTexture); + + gl.uniform1i(gl.getUniformLocation(this.program, 'uInvertMaskAlpha'), mask.invertAlpha); + + // Finally, draw a triangle filling the whole screen + gl.drawArrays(this.topology, 0, 3); + } + } + +}); + +module.exports = BitmapMaskPipeline; + + +/***/ }), +/* 486 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var ShaderSourceFS = __webpack_require__(734); +var TextureTintPipeline = __webpack_require__(226); + +var LIGHT_COUNT = 10; + +/** + * @classdesc + * ForwardDiffuseLightPipeline implements a forward rendering approach for 2D lights. + * This pipeline extends TextureTintPipeline so it implements all it's rendering functions + * and batching system. + * + * @class ForwardDiffuseLightPipeline + * @extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.0.0 + * + * @param {object} config - The configuration of the pipeline, same as the {@link Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline}. The fragment shader will be replaced with the lighting shader. + */ +var ForwardDiffuseLightPipeline = new Class({ + + Extends: TextureTintPipeline, + + initialize: + + function ForwardDiffuseLightPipeline (config) + { + LIGHT_COUNT = config.maxLights; + + config.fragShader = ShaderSourceFS.replace('%LIGHT_COUNT%', LIGHT_COUNT.toString()); + + TextureTintPipeline.call(this, config); + + /** + * Default normal map texture to use. + * + * @name Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#defaultNormalMap + * @type {Phaser.Texture.Frame} + * @private + * @since 3.11.0 + */ + this.defaultNormalMap; + + /** + * Inverse rotation matrix for normal map rotations. + * + * @name Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#inverseRotationMatrix + * @type {Float32Array} + * @private + * @since 3.16.0 + */ + this.inverseRotationMatrix = new Float32Array([ + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 + ]); + }, + + /** + * Called when the Game has fully booted and the Renderer has finished setting up. + * + * By this stage all Game level systems are now in place and you can perform any final + * tasks that the pipeline may need that relied on game systems such as the Texture Manager. + * + * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#boot + * @override + * @since 3.11.0 + */ + boot: function () + { + this.defaultNormalMap = this.game.textures.getFrame('__DEFAULT'); + }, + + /** + * This function binds its base class resources and this lights 2D resources. + * + * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#onBind + * @override + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + * + * @return {this} This WebGLPipeline instance. + */ + onBind: function (gameObject) + { + TextureTintPipeline.prototype.onBind.call(this); + + var renderer = this.renderer; + var program = this.program; + + this.mvpUpdate(); + + renderer.setInt1(program, 'uNormSampler', 1); + renderer.setFloat2(program, 'uResolution', this.width, this.height); + + if (gameObject) + { + this.setNormalMap(gameObject); + } + + return this; + }, + + /** + * This function sets all the needed resources for each camera pass. + * + * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#onRender + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with. + * + * @return {this} This WebGLPipeline instance. + */ + onRender: function (scene, camera) + { + this.active = false; + + var lightManager = scene.sys.lights; + + if (!lightManager || lightManager.lights.length <= 0 || !lightManager.active) + { + // Passthru + return this; + } + + var lights = lightManager.cull(camera); + var lightCount = Math.min(lights.length, LIGHT_COUNT); + + if (lightCount === 0) + { + return this; + } + + this.active = true; + + var renderer = this.renderer; + var program = this.program; + var cameraMatrix = camera.matrix; + var point = {x: 0, y: 0}; + var height = renderer.height; + var index; + + for (index = 0; index < LIGHT_COUNT; ++index) + { + // Reset lights + renderer.setFloat1(program, 'uLights[' + index + '].radius', 0); + } + + renderer.setFloat4(program, 'uCamera', camera.x, camera.y, camera.rotation, camera.zoom); + renderer.setFloat3(program, 'uAmbientLightColor', lightManager.ambientColor.r, lightManager.ambientColor.g, lightManager.ambientColor.b); + + for (index = 0; index < lightCount; ++index) + { + var light = lights[index]; + var lightName = 'uLights[' + index + '].'; + + cameraMatrix.transformPoint(light.x, light.y, point); + + renderer.setFloat2(program, lightName + 'position', point.x - (camera.scrollX * light.scrollFactorX * camera.zoom), height - (point.y - (camera.scrollY * light.scrollFactorY) * camera.zoom)); + renderer.setFloat3(program, lightName + 'color', light.r, light.g, light.b); + renderer.setFloat1(program, lightName + 'intensity', light.intensity); + renderer.setFloat1(program, lightName + 'radius', light.radius); + } + + return this; + }, + + /** + * Generic function for batching a textured quad + * + * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#batchTexture + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject + * @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad + * @param {integer} textureWidth - Real texture width + * @param {integer} textureHeight - Real texture height + * @param {number} srcX - X coordinate of the quad + * @param {number} srcY - Y coordinate of the quad + * @param {number} srcWidth - Width of the quad + * @param {number} srcHeight - Height of the quad + * @param {number} scaleX - X component of scale + * @param {number} scaleY - Y component of scale + * @param {number} rotation - Rotation of the quad + * @param {boolean} flipX - Indicates if the quad is horizontally flipped + * @param {boolean} flipY - Indicates if the quad is vertically flipped + * @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll + * @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll + * @param {number} displayOriginX - Horizontal origin in pixels + * @param {number} displayOriginY - Vertical origin in pixels + * @param {number} frameX - X coordinate of the texture frame + * @param {number} frameY - Y coordinate of the texture frame + * @param {number} frameWidth - Width of the texture frame + * @param {number} frameHeight - Height of the texture frame + * @param {integer} tintTL - Tint for top left + * @param {integer} tintTR - Tint for top right + * @param {integer} tintBL - Tint for bottom left + * @param {integer} tintBR - Tint for bottom right + * @param {number} tintEffect - The tint effect (0 for additive, 1 for replacement) + * @param {number} uOffset - Horizontal offset on texture coordinate + * @param {number} vOffset - Vertical offset on texture coordinate + * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera + * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container + */ + batchTexture: function ( + gameObject, + texture, + textureWidth, textureHeight, + srcX, srcY, + srcWidth, srcHeight, + scaleX, scaleY, + rotation, + flipX, flipY, + scrollFactorX, scrollFactorY, + displayOriginX, displayOriginY, + frameX, frameY, frameWidth, frameHeight, + tintTL, tintTR, tintBL, tintBR, tintEffect, + uOffset, vOffset, + camera, + parentTransformMatrix) + { + if (!this.active) + { + return; + } + + this.renderer.setPipeline(this); + + var normalTexture; + + if (gameObject.displayTexture) + { + normalTexture = gameObject.displayTexture.dataSource[gameObject.displayFrame.sourceIndex]; + } + else if (gameObject.texture) + { + normalTexture = gameObject.texture.dataSource[gameObject.frame.sourceIndex]; + } + else if (gameObject.tileset) + { + normalTexture = gameObject.tileset.image.dataSource[0]; + } + + if (!normalTexture) + { + console.warn('Normal map missing or invalid'); + return; + } + + this.setTexture2D(normalTexture.glTexture, 1); + this.setNormalMapRotation(rotation); + + var camMatrix = this._tempMatrix1; + var spriteMatrix = this._tempMatrix2; + var calcMatrix = this._tempMatrix3; + + var u0 = (frameX / textureWidth) + uOffset; + var v0 = (frameY / textureHeight) + vOffset; + var u1 = (frameX + frameWidth) / textureWidth + uOffset; + var v1 = (frameY + frameHeight) / textureHeight + vOffset; + + var width = srcWidth; + var height = srcHeight; + + // var x = -displayOriginX + frameX; + // var y = -displayOriginY + frameY; + + var x = -displayOriginX; + var y = -displayOriginY; + + if (gameObject.isCropped) + { + var crop = gameObject._crop; + + width = crop.width; + height = crop.height; + + srcWidth = crop.width; + srcHeight = crop.height; + + frameX = crop.x; + frameY = crop.y; + + var ox = frameX; + var oy = frameY; + + if (flipX) + { + ox = (frameWidth - crop.x - crop.width); + } + + if (flipY && !texture.isRenderTexture) + { + oy = (frameHeight - crop.y - crop.height); + } + + u0 = (ox / textureWidth) + uOffset; + v0 = (oy / textureHeight) + vOffset; + u1 = (ox + crop.width) / textureWidth + uOffset; + v1 = (oy + crop.height) / textureHeight + vOffset; + + x = -displayOriginX + frameX; + y = -displayOriginY + frameY; + } + + // Invert the flipY if this is a RenderTexture + flipY = flipY ^ (texture.isRenderTexture ? 1 : 0); + + if (flipX) + { + width *= -1; + x += srcWidth; + } + + if (flipY) + { + height *= -1; + y += srcHeight; + } + + // Do we need this? (doubt it) + // if (camera.roundPixels) + // { + // x |= 0; + // y |= 0; + // } + + var xw = x + width; + var yh = y + height; + + spriteMatrix.applyITRS(srcX, srcY, rotation, scaleX, scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentTransformMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = srcX; + spriteMatrix.f = srcY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else + { + spriteMatrix.e -= camera.scrollX * scrollFactorX; + spriteMatrix.f -= camera.scrollY * scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + if (camera.roundPixels) + { + tx0 = Math.round(tx0); + ty0 = Math.round(ty0); + + tx1 = Math.round(tx1); + ty1 = Math.round(ty1); + + tx2 = Math.round(tx2); + ty2 = Math.round(ty2); + + tx3 = Math.round(tx3); + ty3 = Math.round(ty3); + } + + this.setTexture2D(texture, 0); + + this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0); + }, + + /** + * Sets the Game Objects normal map as the active texture. + * + * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#setNormalMap + * @since 3.11.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to update. + */ + setNormalMap: function (gameObject) + { + if (!this.active || !gameObject) + { + return; + } + + var normalTexture; + + if (gameObject.texture) + { + normalTexture = gameObject.texture.dataSource[gameObject.frame.sourceIndex]; + } + + if (!normalTexture) + { + normalTexture = this.defaultNormalMap; + } + + this.setTexture2D(normalTexture.glTexture, 1); + + this.renderer.setPipeline(gameObject.defaultPipeline); + }, + + /** + * Rotates the normal map vectors inversely by the given angle. + * Only works in 2D space. + * + * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#setNormalMapRotation + * @since 3.16.0 + * + * @param {number} rotation - The angle of rotation in radians. + */ + setNormalMapRotation: function (rotation) + { + var inverseRotationMatrix = this.inverseRotationMatrix; + + if (rotation) + { + var rot = -rotation; + var c = Math.cos(rot); + var s = Math.sin(rot); + + inverseRotationMatrix[1] = s; + inverseRotationMatrix[3] = -s; + inverseRotationMatrix[0] = inverseRotationMatrix[4] = c; + } + else + { + inverseRotationMatrix[0] = inverseRotationMatrix[4] = 1; + inverseRotationMatrix[1] = inverseRotationMatrix[3] = 0; + } + + this.renderer.setMatrix3(this.program, 'uInverseRotationMatrix', false, inverseRotationMatrix); + }, + + /** + * Takes a Sprite Game Object, or any object that extends it, which has a normal texture and adds it to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#batchSprite + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Sprite} sprite - The texture-based Game Object to add to the batch. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - The transform matrix of the parent container, if set. + */ + batchSprite: function (sprite, camera, parentTransformMatrix) + { + if (!this.active) + { + return; + } + + var normalTexture = sprite.texture.dataSource[sprite.frame.sourceIndex]; + + if (normalTexture) + { + this.renderer.setPipeline(this); + + this.setTexture2D(normalTexture.glTexture, 1); + this.setNormalMapRotation(sprite.rotation); + + TextureTintPipeline.prototype.batchSprite.call(this, sprite, camera, parentTransformMatrix); + } + } + +}); + +ForwardDiffuseLightPipeline.LIGHT_COUNT = LIGHT_COUNT; + +module.exports = ForwardDiffuseLightPipeline; + + +/***/ }), +/* 487 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Implements a model view projection matrices. + * Pipelines can implement this for doing 2D and 3D rendering. + * + * @namespace Phaser.Renderer.WebGL.Pipelines.ModelViewProjection + * @since 3.0.0 + */ +var ModelViewProjection = { + + /** + * Dirty flag for checking if model matrix needs to be updated on GPU. + * + * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrixDirty + * @type {boolean} + * @since 3.0.0 + */ + modelMatrixDirty: false, + + /** + * Dirty flag for checking if view matrix needs to be updated on GPU. + * + * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrixDirty + * @type {boolean} + * @since 3.0.0 + */ + viewMatrixDirty: false, + + /** + * Dirty flag for checking if projection matrix needs to be updated on GPU. + * + * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrixDirty + * @type {boolean} + * @since 3.0.0 + */ + projectionMatrixDirty: false, + + /** + * Model matrix + * + * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrix + * @type {?Float32Array} + * @since 3.0.0 + */ + modelMatrix: null, + + /** + * View matrix + * + * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrix + * @type {?Float32Array} + * @since 3.0.0 + */ + viewMatrix: null, + + /** + * Projection matrix + * + * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrix + * @type {?Float32Array} + * @since 3.0.0 + */ + projectionMatrix: null, + + /** + * Initializes MVP matrices with an identity matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpInit + * @since 3.0.0 + */ + mvpInit: function () + { + this.modelMatrixDirty = true; + this.viewMatrixDirty = true; + this.projectionMatrixDirty = true; + + this.modelMatrix = new Float32Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ]); + + this.viewMatrix = new Float32Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ]); + + this.projectionMatrix = new Float32Array([ + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ]); + + return this; + }, + + /** + * If dirty flags are set then the matrices are uploaded to the GPU. + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpUpdate + * @since 3.0.0 + */ + mvpUpdate: function () + { + var program = this.program; + + if (this.modelMatrixDirty) + { + this.renderer.setMatrix4(program, 'uModelMatrix', false, this.modelMatrix); + this.modelMatrixDirty = false; + } + + if (this.viewMatrixDirty) + { + this.renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); + this.viewMatrixDirty = false; + } + + if (this.projectionMatrixDirty) + { + this.renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); + this.projectionMatrixDirty = false; + } + + return this; + }, + + /** + * Loads an identity matrix to the model matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelIdentity + * @since 3.0.0 + */ + modelIdentity: function () + { + var modelMatrix = this.modelMatrix; + + modelMatrix[0] = 1; + modelMatrix[1] = 0; + modelMatrix[2] = 0; + modelMatrix[3] = 0; + modelMatrix[4] = 0; + modelMatrix[5] = 1; + modelMatrix[6] = 0; + modelMatrix[7] = 0; + modelMatrix[8] = 0; + modelMatrix[9] = 0; + modelMatrix[10] = 1; + modelMatrix[11] = 0; + modelMatrix[12] = 0; + modelMatrix[13] = 0; + modelMatrix[14] = 0; + modelMatrix[15] = 1; + + this.modelMatrixDirty = true; + + return this; + }, + + /** + * Scale model matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelScale + * @since 3.0.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Model View Projection. + */ + modelScale: function (x, y, z) + { + var modelMatrix = this.modelMatrix; + + modelMatrix[0] = modelMatrix[0] * x; + modelMatrix[1] = modelMatrix[1] * x; + modelMatrix[2] = modelMatrix[2] * x; + modelMatrix[3] = modelMatrix[3] * x; + modelMatrix[4] = modelMatrix[4] * y; + modelMatrix[5] = modelMatrix[5] * y; + modelMatrix[6] = modelMatrix[6] * y; + modelMatrix[7] = modelMatrix[7] * y; + modelMatrix[8] = modelMatrix[8] * z; + modelMatrix[9] = modelMatrix[9] * z; + modelMatrix[10] = modelMatrix[10] * z; + modelMatrix[11] = modelMatrix[11] * z; + + this.modelMatrixDirty = true; + + return this; + }, + + /** + * Translate model matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelTranslate + * @since 3.0.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Model View Projection. + */ + modelTranslate: function (x, y, z) + { + var modelMatrix = this.modelMatrix; + + modelMatrix[12] = modelMatrix[0] * x + modelMatrix[4] * y + modelMatrix[8] * z + modelMatrix[12]; + modelMatrix[13] = modelMatrix[1] * x + modelMatrix[5] * y + modelMatrix[9] * z + modelMatrix[13]; + modelMatrix[14] = modelMatrix[2] * x + modelMatrix[6] * y + modelMatrix[10] * z + modelMatrix[14]; + modelMatrix[15] = modelMatrix[3] * x + modelMatrix[7] * y + modelMatrix[11] * z + modelMatrix[15]; + + this.modelMatrixDirty = true; + + return this; + }, + + /** + * Rotates the model matrix in the X axis. + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateX + * @since 3.0.0 + * + * @param {number} radians - The amount to rotate by. + * + * @return {this} This Model View Projection. + */ + modelRotateX: function (radians) + { + var modelMatrix = this.modelMatrix; + var s = Math.sin(radians); + var c = Math.cos(radians); + var a10 = modelMatrix[4]; + var a11 = modelMatrix[5]; + var a12 = modelMatrix[6]; + var a13 = modelMatrix[7]; + var a20 = modelMatrix[8]; + var a21 = modelMatrix[9]; + var a22 = modelMatrix[10]; + var a23 = modelMatrix[11]; + + modelMatrix[4] = a10 * c + a20 * s; + modelMatrix[5] = a11 * c + a21 * s; + modelMatrix[6] = a12 * c + a22 * s; + modelMatrix[7] = a13 * c + a23 * s; + modelMatrix[8] = a20 * c - a10 * s; + modelMatrix[9] = a21 * c - a11 * s; + modelMatrix[10] = a22 * c - a12 * s; + modelMatrix[11] = a23 * c - a13 * s; + + this.modelMatrixDirty = true; + + return this; + }, + + /** + * Rotates the model matrix in the Y axis. + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateY + * @since 3.0.0 + * + * @param {number} radians - The amount to rotate by. + * + * @return {this} This Model View Projection. + */ + modelRotateY: function (radians) + { + var modelMatrix = this.modelMatrix; + var s = Math.sin(radians); + var c = Math.cos(radians); + var a00 = modelMatrix[0]; + var a01 = modelMatrix[1]; + var a02 = modelMatrix[2]; + var a03 = modelMatrix[3]; + var a20 = modelMatrix[8]; + var a21 = modelMatrix[9]; + var a22 = modelMatrix[10]; + var a23 = modelMatrix[11]; + + modelMatrix[0] = a00 * c - a20 * s; + modelMatrix[1] = a01 * c - a21 * s; + modelMatrix[2] = a02 * c - a22 * s; + modelMatrix[3] = a03 * c - a23 * s; + modelMatrix[8] = a00 * s + a20 * c; + modelMatrix[9] = a01 * s + a21 * c; + modelMatrix[10] = a02 * s + a22 * c; + modelMatrix[11] = a03 * s + a23 * c; + + this.modelMatrixDirty = true; + + return this; + }, + + /** + * Rotates the model matrix in the Z axis. + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelRotateZ + * @since 3.0.0 + * + * @param {number} radians - The amount to rotate by. + * + * @return {this} This Model View Projection. + */ + modelRotateZ: function (radians) + { + var modelMatrix = this.modelMatrix; + var s = Math.sin(radians); + var c = Math.cos(radians); + var a00 = modelMatrix[0]; + var a01 = modelMatrix[1]; + var a02 = modelMatrix[2]; + var a03 = modelMatrix[3]; + var a10 = modelMatrix[4]; + var a11 = modelMatrix[5]; + var a12 = modelMatrix[6]; + var a13 = modelMatrix[7]; + + modelMatrix[0] = a00 * c + a10 * s; + modelMatrix[1] = a01 * c + a11 * s; + modelMatrix[2] = a02 * c + a12 * s; + modelMatrix[3] = a03 * c + a13 * s; + modelMatrix[4] = a10 * c - a00 * s; + modelMatrix[5] = a11 * c - a01 * s; + modelMatrix[6] = a12 * c - a02 * s; + modelMatrix[7] = a13 * c - a03 * s; + + this.modelMatrixDirty = true; + + return this; + }, + + /** + * Loads identity matrix into the view matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewIdentity + * @since 3.0.0 + * + * @return {this} This Model View Projection. + */ + viewIdentity: function () + { + var viewMatrix = this.viewMatrix; + + viewMatrix[0] = 1; + viewMatrix[1] = 0; + viewMatrix[2] = 0; + viewMatrix[3] = 0; + viewMatrix[4] = 0; + viewMatrix[5] = 1; + viewMatrix[6] = 0; + viewMatrix[7] = 0; + viewMatrix[8] = 0; + viewMatrix[9] = 0; + viewMatrix[10] = 1; + viewMatrix[11] = 0; + viewMatrix[12] = 0; + viewMatrix[13] = 0; + viewMatrix[14] = 0; + viewMatrix[15] = 1; + + this.viewMatrixDirty = true; + + return this; + }, + + /** + * Scales view matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewScale + * @since 3.0.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Model View Projection. + */ + viewScale: function (x, y, z) + { + var viewMatrix = this.viewMatrix; + + viewMatrix[0] = viewMatrix[0] * x; + viewMatrix[1] = viewMatrix[1] * x; + viewMatrix[2] = viewMatrix[2] * x; + viewMatrix[3] = viewMatrix[3] * x; + viewMatrix[4] = viewMatrix[4] * y; + viewMatrix[5] = viewMatrix[5] * y; + viewMatrix[6] = viewMatrix[6] * y; + viewMatrix[7] = viewMatrix[7] * y; + viewMatrix[8] = viewMatrix[8] * z; + viewMatrix[9] = viewMatrix[9] * z; + viewMatrix[10] = viewMatrix[10] * z; + viewMatrix[11] = viewMatrix[11] * z; + + this.viewMatrixDirty = true; + + return this; + }, + + /** + * Translates view matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewTranslate + * @since 3.0.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Model View Projection. + */ + viewTranslate: function (x, y, z) + { + var viewMatrix = this.viewMatrix; + + viewMatrix[12] = viewMatrix[0] * x + viewMatrix[4] * y + viewMatrix[8] * z + viewMatrix[12]; + viewMatrix[13] = viewMatrix[1] * x + viewMatrix[5] * y + viewMatrix[9] * z + viewMatrix[13]; + viewMatrix[14] = viewMatrix[2] * x + viewMatrix[6] * y + viewMatrix[10] * z + viewMatrix[14]; + viewMatrix[15] = viewMatrix[3] * x + viewMatrix[7] * y + viewMatrix[11] * z + viewMatrix[15]; + + this.viewMatrixDirty = true; + + return this; + }, + + /** + * Rotates view matrix in the X axis. + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateX + * @since 3.0.0 + * + * @param {number} radians - The amount to rotate by. + * + * @return {this} This Model View Projection. + */ + viewRotateX: function (radians) + { + var viewMatrix = this.viewMatrix; + var s = Math.sin(radians); + var c = Math.cos(radians); + var a10 = viewMatrix[4]; + var a11 = viewMatrix[5]; + var a12 = viewMatrix[6]; + var a13 = viewMatrix[7]; + var a20 = viewMatrix[8]; + var a21 = viewMatrix[9]; + var a22 = viewMatrix[10]; + var a23 = viewMatrix[11]; + + viewMatrix[4] = a10 * c + a20 * s; + viewMatrix[5] = a11 * c + a21 * s; + viewMatrix[6] = a12 * c + a22 * s; + viewMatrix[7] = a13 * c + a23 * s; + viewMatrix[8] = a20 * c - a10 * s; + viewMatrix[9] = a21 * c - a11 * s; + viewMatrix[10] = a22 * c - a12 * s; + viewMatrix[11] = a23 * c - a13 * s; + + this.viewMatrixDirty = true; + + return this; + }, + + /** + * Rotates view matrix in the Y axis. + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateY + * @since 3.0.0 + * + * @param {number} radians - The amount to rotate by. + * + * @return {this} This Model View Projection. + */ + viewRotateY: function (radians) + { + var viewMatrix = this.viewMatrix; + var s = Math.sin(radians); + var c = Math.cos(radians); + var a00 = viewMatrix[0]; + var a01 = viewMatrix[1]; + var a02 = viewMatrix[2]; + var a03 = viewMatrix[3]; + var a20 = viewMatrix[8]; + var a21 = viewMatrix[9]; + var a22 = viewMatrix[10]; + var a23 = viewMatrix[11]; + + viewMatrix[0] = a00 * c - a20 * s; + viewMatrix[1] = a01 * c - a21 * s; + viewMatrix[2] = a02 * c - a22 * s; + viewMatrix[3] = a03 * c - a23 * s; + viewMatrix[8] = a00 * s + a20 * c; + viewMatrix[9] = a01 * s + a21 * c; + viewMatrix[10] = a02 * s + a22 * c; + viewMatrix[11] = a03 * s + a23 * c; + + this.viewMatrixDirty = true; + + return this; + }, + + /** + * Rotates view matrix in the Z axis. + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewRotateZ + * @since 3.0.0 + * + * @param {number} radians - The amount to rotate by. + * + * @return {this} This Model View Projection. + */ + viewRotateZ: function (radians) + { + var viewMatrix = this.viewMatrix; + var s = Math.sin(radians); + var c = Math.cos(radians); + var a00 = viewMatrix[0]; + var a01 = viewMatrix[1]; + var a02 = viewMatrix[2]; + var a03 = viewMatrix[3]; + var a10 = viewMatrix[4]; + var a11 = viewMatrix[5]; + var a12 = viewMatrix[6]; + var a13 = viewMatrix[7]; + + viewMatrix[0] = a00 * c + a10 * s; + viewMatrix[1] = a01 * c + a11 * s; + viewMatrix[2] = a02 * c + a12 * s; + viewMatrix[3] = a03 * c + a13 * s; + viewMatrix[4] = a10 * c - a00 * s; + viewMatrix[5] = a11 * c - a01 * s; + viewMatrix[6] = a12 * c - a02 * s; + viewMatrix[7] = a13 * c - a03 * s; + + this.viewMatrixDirty = true; + + return this; + }, + + /** + * Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewLoad2D + * @since 3.0.0 + * + * @param {Float32Array} matrix2D - The Matrix2D. + * + * @return {this} This Model View Projection. + */ + viewLoad2D: function (matrix2D) + { + var vm = this.viewMatrix; + + vm[0] = matrix2D[0]; + vm[1] = matrix2D[1]; + vm[2] = 0.0; + vm[3] = 0.0; + vm[4] = matrix2D[2]; + vm[5] = matrix2D[3]; + vm[6] = 0.0; + vm[7] = 0.0; + vm[8] = matrix2D[4]; + vm[9] = matrix2D[5]; + vm[10] = 1.0; + vm[11] = 0.0; + vm[12] = 0.0; + vm[13] = 0.0; + vm[14] = 0.0; + vm[15] = 1.0; + + this.viewMatrixDirty = true; + + return this; + }, + + + /** + * Copies a 4x4 matrix into the view matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewLoad + * @since 3.0.0 + * + * @param {Float32Array} matrix - The Matrix2D. + * + * @return {this} This Model View Projection. + */ + viewLoad: function (matrix) + { + var vm = this.viewMatrix; + + vm[0] = matrix[0]; + vm[1] = matrix[1]; + vm[2] = matrix[2]; + vm[3] = matrix[3]; + vm[4] = matrix[4]; + vm[5] = matrix[5]; + vm[6] = matrix[6]; + vm[7] = matrix[7]; + vm[8] = matrix[8]; + vm[9] = matrix[9]; + vm[10] = matrix[10]; + vm[11] = matrix[11]; + vm[12] = matrix[12]; + vm[13] = matrix[13]; + vm[14] = matrix[14]; + vm[15] = matrix[15]; + + this.viewMatrixDirty = true; + + return this; + }, + + /** + * Loads identity matrix into the projection matrix. + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projIdentity + * @since 3.0.0 + * + * @return {this} This Model View Projection. + */ + projIdentity: function () + { + var projectionMatrix = this.projectionMatrix; + + projectionMatrix[0] = 1; + projectionMatrix[1] = 0; + projectionMatrix[2] = 0; + projectionMatrix[3] = 0; + projectionMatrix[4] = 0; + projectionMatrix[5] = 1; + projectionMatrix[6] = 0; + projectionMatrix[7] = 0; + projectionMatrix[8] = 0; + projectionMatrix[9] = 0; + projectionMatrix[10] = 1; + projectionMatrix[11] = 0; + projectionMatrix[12] = 0; + projectionMatrix[13] = 0; + projectionMatrix[14] = 0; + projectionMatrix[15] = 1; + + this.projectionMatrixDirty = true; + + return this; + }, + + /** + * Sets up an orthographic projection matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projOrtho + * @since 3.0.0 + * + * @param {number} left - The left value. + * @param {number} right - The right value. + * @param {number} bottom - The bottom value. + * @param {number} top - The top value. + * @param {number} near - The near value. + * @param {number} far - The far value. + * + * @return {this} This Model View Projection. + */ + projOrtho: function (left, right, bottom, top, near, far) + { + var projectionMatrix = this.projectionMatrix; + var leftRight = 1.0 / (left - right); + var bottomTop = 1.0 / (bottom - top); + var nearFar = 1.0 / (near - far); + + projectionMatrix[0] = -2.0 * leftRight; + projectionMatrix[1] = 0.0; + projectionMatrix[2] = 0.0; + projectionMatrix[3] = 0.0; + projectionMatrix[4] = 0.0; + projectionMatrix[5] = -2.0 * bottomTop; + projectionMatrix[6] = 0.0; + projectionMatrix[7] = 0.0; + projectionMatrix[8] = 0.0; + projectionMatrix[9] = 0.0; + projectionMatrix[10] = 2.0 * nearFar; + projectionMatrix[11] = 0.0; + projectionMatrix[12] = (left + right) * leftRight; + projectionMatrix[13] = (top + bottom) * bottomTop; + projectionMatrix[14] = (far + near) * nearFar; + projectionMatrix[15] = 1.0; + + this.projectionMatrixDirty = true; + + return this; + }, + + /** + * Sets up a perspective projection matrix + * + * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projPersp + * @since 3.0.0 + * + * @param {number} fovY - The fov value. + * @param {number} aspectRatio - The aspectRatio value. + * @param {number} near - The near value. + * @param {number} far - The far value. + * + * @return {this} This Model View Projection. + */ + projPersp: function (fovY, aspectRatio, near, far) + { + var projectionMatrix = this.projectionMatrix; + var fov = 1.0 / Math.tan(fovY / 2.0); + var nearFar = 1.0 / (near - far); + + projectionMatrix[0] = fov / aspectRatio; + projectionMatrix[1] = 0.0; + projectionMatrix[2] = 0.0; + projectionMatrix[3] = 0.0; + projectionMatrix[4] = 0.0; + projectionMatrix[5] = fov; + projectionMatrix[6] = 0.0; + projectionMatrix[7] = 0.0; + projectionMatrix[8] = 0.0; + projectionMatrix[9] = 0.0; + projectionMatrix[10] = (far + near) * nearFar; + projectionMatrix[11] = -1.0; + projectionMatrix[12] = 0.0; + projectionMatrix[13] = 0.0; + projectionMatrix[14] = (2.0 * far * near) * nearFar; + projectionMatrix[15] = 0.0; + + this.projectionMatrixDirty = true; + + return this; + } +}; + +module.exports = ModelViewProjection; + + +/***/ }), +/* 488 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Physics.Matter.Components + */ + +module.exports = { + + Bounce: __webpack_require__(1365), + Collision: __webpack_require__(1366), + Force: __webpack_require__(1367), + Friction: __webpack_require__(1368), + Gravity: __webpack_require__(1369), + Mass: __webpack_require__(1370), + Static: __webpack_require__(1371), + Sensor: __webpack_require__(1372), + SetBody: __webpack_require__(1373), + Sleep: __webpack_require__(1375), + Transform: __webpack_require__(1388), + Velocity: __webpack_require__(1389) + +}; + + +/***/ }), +/* 489 */ +/***/ (function(module, exports) { + +/** +* The `Matter.Pair` module contains methods for creating and manipulating collision pairs. +* +* @class Pair +*/ + +var Pair = {}; + +module.exports = Pair; + +(function() { + + /** + * Creates a pair. + * @method create + * @param {collision} collision + * @param {number} timestamp + * @return {pair} A new pair + */ + Pair.create = function(collision, timestamp) { + var bodyA = collision.bodyA, + bodyB = collision.bodyB; + + var pair = { + id: Pair.id(bodyA, bodyB), + bodyA: bodyA, + bodyB: bodyB, + activeContacts: [], + separation: 0, + isActive: true, + confirmedActive: true, + isSensor: bodyA.isSensor || bodyB.isSensor, + timeCreated: timestamp, + timeUpdated: timestamp, + collision: null, + inverseMass: 0, + friction: 0, + frictionStatic: 0, + restitution: 0, + slop: 0 + }; + + Pair.update(pair, collision, timestamp); + + return pair; + }; + + /** + * Updates a pair given a collision. + * @method update + * @param {pair} pair + * @param {collision} collision + * @param {number} timestamp + */ + Pair.update = function(pair, collision, timestamp) { + pair.collision = collision; + + if (collision.collided) { + var supports = collision.supports, + activeContacts = pair.activeContacts, + parentA = collision.parentA, + parentB = collision.parentB; + + pair.inverseMass = parentA.inverseMass + parentB.inverseMass; + pair.friction = Math.min(parentA.friction, parentB.friction); + pair.frictionStatic = Math.max(parentA.frictionStatic, parentB.frictionStatic); + pair.restitution = Math.max(parentA.restitution, parentB.restitution); + pair.slop = Math.max(parentA.slop, parentB.slop); + + for (var i = 0; i < supports.length; i++) { + activeContacts[i] = supports[i].contact; + } + + // optimise array size + var supportCount = supports.length; + if (supportCount < activeContacts.length) { + activeContacts.length = supportCount; + } + + pair.separation = collision.depth; + Pair.setActive(pair, true, timestamp); + } else { + if (pair.isActive === true) + Pair.setActive(pair, false, timestamp); + } + }; + + /** + * Set a pair as active or inactive. + * @method setActive + * @param {pair} pair + * @param {bool} isActive + * @param {number} timestamp + */ + Pair.setActive = function(pair, isActive, timestamp) { + if (isActive) { + pair.isActive = true; + pair.timeUpdated = timestamp; + } else { + pair.isActive = false; + pair.activeContacts.length = 0; + } + }; + + /** + * Get the id for the given pair. + * @method id + * @param {body} bodyA + * @param {body} bodyB + * @return {string} Unique pairId + */ + Pair.id = function(bodyA, bodyB) { + if (bodyA.id < bodyB.id) { + return 'A' + bodyA.id + 'B' + bodyB.id; + } else { + return 'A' + bodyB.id + 'B' + bodyA.id; + } + }; + +})(); + + +/***/ }), +/* 490 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(491); +__webpack_require__(492); +__webpack_require__(493); +__webpack_require__(494); +__webpack_require__(495); +__webpack_require__(496); +__webpack_require__(497); +__webpack_require__(498); + + +/***/ }), +/* 491 */ +/***/ (function(module, exports) { + +/** +* A polyfill for Array.forEach +* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach +*/ +if (!Array.prototype.forEach) +{ + Array.prototype.forEach = function (fun /*, thisArg */) + { + 'use strict'; + + if (this === void 0 || this === null) + { + throw new TypeError(); + } + + var t = Object(this); + var len = t.length >>> 0; + + if (typeof fun !== 'function') + { + throw new TypeError(); + } + + var thisArg = arguments.length >= 2 ? arguments[1] : void 0; + + for (var i = 0; i < len; i++) + { + if (i in t) + { + fun.call(thisArg, t[i], i, t); + } + } + }; +} + + +/***/ }), +/* 492 */ +/***/ (function(module, exports) { + +/** +* A polyfill for Array.isArray +*/ +if (!Array.isArray) +{ + Array.isArray = function (arg) + { + return Object.prototype.toString.call(arg) === '[object Array]'; + }; +} + + +/***/ }), +/* 493 */ +/***/ (function(module, exports) { + +/* Copyright 2013 Chris Wilson + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + +This monkeypatch library is intended to be included in projects that are +written to the proper AudioContext spec (instead of webkitAudioContext), +and that use the new naming and proper bits of the Web Audio API (e.g. +using BufferSourceNode.start() instead of BufferSourceNode.noteOn()), but may +have to run on systems that only support the deprecated bits. + +This library should be harmless to include if the browser supports +unprefixed "AudioContext", and/or if it supports the new names. + +The patches this library handles: +if window.AudioContext is unsupported, it will be aliased to webkitAudioContext(). +if AudioBufferSourceNode.start() is unimplemented, it will be routed to noteOn() or +noteGrainOn(), depending on parameters. + +The following aliases only take effect if the new names are not already in place: + +AudioBufferSourceNode.stop() is aliased to noteOff() +AudioContext.createGain() is aliased to createGainNode() +AudioContext.createDelay() is aliased to createDelayNode() +AudioContext.createScriptProcessor() is aliased to createJavaScriptNode() +AudioContext.createPeriodicWave() is aliased to createWaveTable() +OscillatorNode.start() is aliased to noteOn() +OscillatorNode.stop() is aliased to noteOff() +OscillatorNode.setPeriodicWave() is aliased to setWaveTable() +AudioParam.setTargetAtTime() is aliased to setTargetValueAtTime() + +This library does NOT patch the enumerated type changes, as it is +recommended in the specification that implementations support both integer +and string types for AudioPannerNode.panningModel, AudioPannerNode.distanceModel +BiquadFilterNode.type and OscillatorNode.type. + +*/ + +(function () { + + function fixSetTarget(param) { + if (!param) // if NYI, just return + return; + if (!param.setTargetAtTime) + param.setTargetAtTime = param.setTargetValueAtTime; + } + + if (window.hasOwnProperty('webkitAudioContext') && + !window.hasOwnProperty('AudioContext')) { + window.AudioContext = webkitAudioContext; + + if (!AudioContext.prototype.hasOwnProperty('createGain')) + AudioContext.prototype.createGain = AudioContext.prototype.createGainNode; + if (!AudioContext.prototype.hasOwnProperty('createDelay')) + AudioContext.prototype.createDelay = AudioContext.prototype.createDelayNode; + if (!AudioContext.prototype.hasOwnProperty('createScriptProcessor')) + AudioContext.prototype.createScriptProcessor = AudioContext.prototype.createJavaScriptNode; + if (!AudioContext.prototype.hasOwnProperty('createPeriodicWave')) + AudioContext.prototype.createPeriodicWave = AudioContext.prototype.createWaveTable; + + + AudioContext.prototype.internal_createGain = AudioContext.prototype.createGain; + AudioContext.prototype.createGain = function() { + var node = this.internal_createGain(); + fixSetTarget(node.gain); + return node; + }; + + AudioContext.prototype.internal_createDelay = AudioContext.prototype.createDelay; + AudioContext.prototype.createDelay = function(maxDelayTime) { + var node = maxDelayTime ? this.internal_createDelay(maxDelayTime) : this.internal_createDelay(); + fixSetTarget(node.delayTime); + return node; + }; + + AudioContext.prototype.internal_createBufferSource = AudioContext.prototype.createBufferSource; + AudioContext.prototype.createBufferSource = function() { + var node = this.internal_createBufferSource(); + if (!node.start) { + node.start = function ( when, offset, duration ) { + if ( offset || duration ) + this.noteGrainOn( when || 0, offset, duration ); + else + this.noteOn( when || 0 ); + }; + } else { + node.internal_start = node.start; + node.start = function( when, offset, duration ) { + if( typeof duration !== 'undefined' ) + node.internal_start( when || 0, offset, duration ); + else + node.internal_start( when || 0, offset || 0 ); + }; + } + if (!node.stop) { + node.stop = function ( when ) { + this.noteOff( when || 0 ); + }; + } else { + node.internal_stop = node.stop; + node.stop = function( when ) { + node.internal_stop( when || 0 ); + }; + } + fixSetTarget(node.playbackRate); + return node; + }; + + AudioContext.prototype.internal_createDynamicsCompressor = AudioContext.prototype.createDynamicsCompressor; + AudioContext.prototype.createDynamicsCompressor = function() { + var node = this.internal_createDynamicsCompressor(); + fixSetTarget(node.threshold); + fixSetTarget(node.knee); + fixSetTarget(node.ratio); + fixSetTarget(node.reduction); + fixSetTarget(node.attack); + fixSetTarget(node.release); + return node; + }; + + AudioContext.prototype.internal_createBiquadFilter = AudioContext.prototype.createBiquadFilter; + AudioContext.prototype.createBiquadFilter = function() { + var node = this.internal_createBiquadFilter(); + fixSetTarget(node.frequency); + fixSetTarget(node.detune); + fixSetTarget(node.Q); + fixSetTarget(node.gain); + return node; + }; + + if (AudioContext.prototype.hasOwnProperty( 'createOscillator' )) { + AudioContext.prototype.internal_createOscillator = AudioContext.prototype.createOscillator; + AudioContext.prototype.createOscillator = function() { + var node = this.internal_createOscillator(); + if (!node.start) { + node.start = function ( when ) { + this.noteOn( when || 0 ); + }; + } else { + node.internal_start = node.start; + node.start = function ( when ) { + node.internal_start( when || 0); + }; + } + if (!node.stop) { + node.stop = function ( when ) { + this.noteOff( when || 0 ); + }; + } else { + node.internal_stop = node.stop; + node.stop = function( when ) { + node.internal_stop( when || 0 ); + }; + } + if (!node.setPeriodicWave) + node.setPeriodicWave = node.setWaveTable; + fixSetTarget(node.frequency); + fixSetTarget(node.detune); + return node; + }; + } + } + + if (window.hasOwnProperty('webkitOfflineAudioContext') && + !window.hasOwnProperty('OfflineAudioContext')) { + window.OfflineAudioContext = webkitOfflineAudioContext; + } + +})(); + + +/***/ }), +/* 494 */ +/***/ (function(module, exports) { + +/** + * Also fix for the absent console in IE9 + */ +if (!window.console) +{ + window.console = {}; + window.console.log = window.console.assert = function(){}; + window.console.warn = window.console.assert = function(){}; +} + + +/***/ }), +/* 495 */ +/***/ (function(module, exports) { + +// ES6 Math.trunc - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc +if (!Math.trunc) { + Math.trunc = function trunc(x) { + return x < 0 ? Math.ceil(x) : Math.floor(x); + }; +} + + +/***/ }), +/* 496 */ +/***/ (function(module, exports) { + +/** + * performance.now + */ +(function () { + + if ('performance' in window === false) + { + window.performance = {}; + } + + // Thanks IE8 + Date.now = (Date.now || function () { + return new Date().getTime(); + }); + + if ('now' in window.performance === false) + { + var nowOffset = Date.now(); + + if (performance.timing && performance.timing.navigationStart) + { + nowOffset = performance.timing.navigationStart; + } + + window.performance.now = function now () + { + return Date.now() - nowOffset; + } + } + +})(); + + +/***/ }), +/* 497 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {// References: +// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ +// https://gist.github.com/1579671 +// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision +// https://gist.github.com/timhall/4078614 +// https://github.com/Financial-Times/polyfill-service/tree/master/polyfills/requestAnimationFrame + +// Expected to be used with Browserfiy +// Browserify automatically detects the use of `global` and passes the +// correct reference of `global`, `self`, and finally `window` + +// Date.now +if (!(Date.now && Date.prototype.getTime)) { + Date.now = function now() { + return new Date().getTime(); + }; +} + +// performance.now +if (!(global.performance && global.performance.now)) { + var startTime = Date.now(); + if (!global.performance) { + global.performance = {}; + } + global.performance.now = function () { + return Date.now() - startTime; + }; +} + +// requestAnimationFrame +var lastTime = Date.now(); +var vendors = ['ms', 'moz', 'webkit', 'o']; + +for(var x = 0; x < vendors.length && !global.requestAnimationFrame; ++x) { + global.requestAnimationFrame = global[vendors[x] + 'RequestAnimationFrame']; + global.cancelAnimationFrame = global[vendors[x] + 'CancelAnimationFrame'] || + global[vendors[x] + 'CancelRequestAnimationFrame']; +} + +if (!global.requestAnimationFrame) { + global.requestAnimationFrame = function (callback) { + if (typeof callback !== 'function') { + throw new TypeError(callback + 'is not a function'); + } + + var currentTime = Date.now(), + delay = 16 + lastTime - currentTime; + + if (delay < 0) { + delay = 0; + } + + lastTime = currentTime; + + return setTimeout(function () { + lastTime = Date.now(); + callback(performance.now()); + }, delay); + }; +} + +if (!global.cancelAnimationFrame) { + global.cancelAnimationFrame = function(id) { + clearTimeout(id); + }; +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(222))) + +/***/ }), +/* 498 */ +/***/ (function(module, exports) { + +/** +* Low-budget Float32Array knock-off, suitable for use with P2.js in IE9 +* Source: http://www.html5gamedevs.com/topic/5988-phaser-12-ie9/ +* Cameron Foale (http://www.kibibu.com) +*/ +if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'object') +{ + var CheapArray = function (fakeType) + { + var proto = new Array(); // jshint ignore:line + + window[fakeType] = function(arg) { + + if (typeof(arg) === 'number') + { + Array.call(this, arg); + + this.length = arg; + + for (var i = 0; i < this.length; i++) + { + this[i] = 0; + } + } + else + { + Array.call(this, arg.length); + + this.length = arg.length; + + for (var i = 0; i < this.length; i++) + { + this[i] = arg[i]; + } + } + }; + + window[fakeType].prototype = proto; + window[fakeType].constructor = window[fakeType]; + }; + + CheapArray('Float32Array'); // jshint ignore:line + CheapArray('Uint32Array'); // jshint ignore:line + CheapArray('Uint16Array'); // jshint ignore:line + CheapArray('Int16Array'); // jshint ignore:line + CheapArray('ArrayBuffer'); // jshint ignore:line +} + + +/***/ }), +/* 499 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueInc = __webpack_require__(34); + +/** + * Takes an array of Game Objects, or any objects that have a public `angle` property, + * and then adds the given value to each of their `angle` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `Angle(group.getChildren(), value, step)` + * + * @function Phaser.Actions.Angle + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to be added to the `angle` property. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var Angle = function (items, value, step, index, direction) +{ + return PropertyValueInc(items, 'angle', value, step, index, direction); +}; + +module.exports = Angle; + + +/***/ }), +/* 500 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of objects and passes each of them to the given callback. + * + * @function Phaser.Actions.Call + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {Phaser.Types.Actions.CallCallback} callback - The callback to be invoked. It will be passed just one argument: the item from the array. + * @param {*} context - The scope in which the callback will be invoked. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that was passed to this Action. + */ +var Call = function (items, callback, context) +{ + for (var i = 0; i < items.length; i++) + { + var item = items[i]; + + callback.call(context, item); + } + + return items; +}; + +module.exports = Call; + + +/***/ }), +/* 501 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of objects and returns the first element in the array that has properties which match + * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` + * then it would return the first item which had the property `scaleX` set to 0.5 and `alpha` set to 1. + * + * To use this with a Group: `GetFirst(group.getChildren(), compare, index)` + * + * @function Phaser.Actions.GetFirst + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action. + * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * + * @return {?(object|Phaser.GameObjects.GameObject)} The first object in the array that matches the comparison object, or `null` if no match was found. + */ +var GetFirst = function (items, compare, index) +{ + if (index === undefined) { index = 0; } + + for (var i = index; i < items.length; i++) + { + var item = items[i]; + + var match = true; + + for (var property in compare) + { + if (item[property] !== compare[property]) + { + match = false; + } + } + + if (match) + { + return item; + } + } + + return null; +}; + +module.exports = GetFirst; + + +/***/ }), +/* 502 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of objects and returns the last element in the array that has properties which match + * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` + * then it would return the last item which had the property `scaleX` set to 0.5 and `alpha` set to 1. + * + * To use this with a Group: `GetLast(group.getChildren(), compare, index)` + * + * @function Phaser.Actions.GetLast + * @since 3.3.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action. + * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * + * @return {?(object|Phaser.GameObjects.GameObject)} The last object in the array that matches the comparison object, or `null` if no match was found. + */ +var GetLast = function (items, compare, index) +{ + if (index === undefined) { index = 0; } + + for (var i = index; i < items.length; i++) + { + var item = items[i]; + + var match = true; + + for (var property in compare) + { + if (item[property] !== compare[property]) + { + match = false; + } + } + + if (match) + { + return item; + } + } + + return null; +}; + +module.exports = GetLast; + + +/***/ }), +/* 503 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var AlignIn = __webpack_require__(230); +var CONST = __webpack_require__(143); +var GetFastValue = __webpack_require__(2); +var NOOP = __webpack_require__(1); +var Zone = __webpack_require__(106); + +var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1); + +/** + * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, + * and then aligns them based on the grid configuration given to this action. + * + * @function Phaser.Actions.GridAlign + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {Phaser.Types.Actions.GridAlignConfig} options - The GridAlign Configuration object. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var GridAlign = function (items, options) +{ + if (options === undefined) { options = {}; } + + var width = GetFastValue(options, 'width', -1); + var height = GetFastValue(options, 'height', -1); + var cellWidth = GetFastValue(options, 'cellWidth', 1); + var cellHeight = GetFastValue(options, 'cellHeight', cellWidth); + var position = GetFastValue(options, 'position', CONST.TOP_LEFT); + var x = GetFastValue(options, 'x', 0); + var y = GetFastValue(options, 'y', 0); + + var cx = 0; + var cy = 0; + var w = (width * cellWidth); + var h = (height * cellHeight); + + tempZone.setPosition(x, y); + tempZone.setSize(cellWidth, cellHeight); + + for (var i = 0; i < items.length; i++) + { + AlignIn(items[i], tempZone, position); + + if (width === -1) + { + // We keep laying them out horizontally until we've done them all + cy += cellHeight; + tempZone.y += cellHeight; + + if (cy === h) + { + cy = 0; + tempZone.x += cellWidth; + tempZone.y = y; + } + } + else if (height === -1) + { + // We keep laying them out vertically until we've done them all + cx += cellWidth; + tempZone.x += cellWidth; + + if (cx === w) + { + cx = 0; + tempZone.x = x; + tempZone.y += cellHeight; + } + } + else + { + // We keep laying them out until we hit the column limit + cx += cellWidth; + tempZone.x += cellWidth; + + if (cx === w) + { + cx = 0; + cy += cellHeight; + tempZone.x = x; + tempZone.y += cellHeight; + + if (cy === h) + { + // We've hit the column limit, so return, even if there are items left + break; + } + } + } + } + + return items; +}; + +module.exports = GridAlign; + + +/***/ }), +/* 504 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Add Animation Event. + * + * This event is dispatched when a new animation is added to the global Animation Manager. + * + * This can happen either as a result of an animation instance being added to the Animation Manager, + * or the Animation Manager creating a new animation directly. + * + * @event Phaser.Animations.Events#ADD_ANIMATION + * @since 3.0.0 + * + * @param {string} key - The key of the Animation that was added to the global Animation Manager. + * @param {Phaser.Animations.Animation} animation - An instance of the newly created Animation. + */ +module.exports = 'add'; + + +/***/ }), +/* 505 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Complete Event. + * + * This event is dispatched by an Animation instance when it completes, i.e. finishes playing or is manually stopped. + * + * Be careful with the volume of events this could generate. If a group of Sprites all complete the same + * animation at the same time, this event will invoke its handler for each one of them. + * + * @event Phaser.Animations.Events#ANIMATION_COMPLETE + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. + */ +module.exports = 'complete'; + + +/***/ }), +/* 506 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Repeat Event. + * + * This event is dispatched when a currently playing animation repeats. + * + * The event is dispatched directly from the Animation object itself. Which means that listeners + * bound to this event will be invoked every time the Animation repeats, for every Game Object that may have it. + * + * @event Phaser.Animations.Events#ANIMATION_REPEAT + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that repeated. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation was on when it repeated. + */ +module.exports = 'repeat'; + + +/***/ }), +/* 507 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Restart Event. + * + * This event is dispatched by an Animation instance when it restarts. + * + * Be careful with the volume of events this could generate. If a group of Sprites all restart the same + * animation at the same time, this event will invoke its handler for each one of them. + * + * @event Phaser.Animations.Events#ANIMATION_RESTART + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that restarted playing. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. + */ +module.exports = 'restart'; + + +/***/ }), +/* 508 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Start Event. + * + * This event is dispatched by an Animation instance when it starts playing. + * + * Be careful with the volume of events this could generate. If a group of Sprites all play the same + * animation at the same time, this event will invoke its handler for each one of them. + * + * @event Phaser.Animations.Events#ANIMATION_START + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that started playing. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. + */ +module.exports = 'start'; + + +/***/ }), +/* 509 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pause All Animations Event. + * + * This event is dispatched when the global Animation Manager is told to pause. + * + * When this happens all current animations will stop updating, although it doesn't necessarily mean + * that the game has paused as well. + * + * @event Phaser.Animations.Events#PAUSE_ALL + * @since 3.0.0 + */ +module.exports = 'pauseall'; + + +/***/ }), +/* 510 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Remove Animation Event. + * + * This event is dispatched when an animation is removed from the global Animation Manager. + * + * @event Phaser.Animations.Events#REMOVE_ANIMATION + * @since 3.0.0 + * + * @param {string} key - The key of the Animation that was removed from the global Animation Manager. + * @param {Phaser.Animations.Animation} animation - An instance of the removed Animation. + */ +module.exports = 'remove'; + + +/***/ }), +/* 511 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Resume All Animations Event. + * + * This event is dispatched when the global Animation Manager resumes, having been previously paused. + * + * When this happens all current animations will continue updating again. + * + * @event Phaser.Animations.Events#RESUME_ALL + * @since 3.0.0 + */ +module.exports = 'resumeall'; + + +/***/ }), +/* 512 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sprite Animation Complete Event. + * + * This event is dispatched by a Sprite when an animation finishes playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_COMPLETE` event. + * + * @event Phaser.Animations.Events#SPRITE_ANIMATION_COMPLETE + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. + */ +module.exports = 'animationcomplete'; + + +/***/ }), +/* 513 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sprite Animation Key Complete Event. + * + * This event is dispatched by a Sprite when a specific animation finishes playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationcomplete-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationcomplete-explode`. + * + * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_COMPLETE + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. + */ +module.exports = 'animationcomplete-'; + + +/***/ }), +/* 514 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sprite Animation Key Repeat Event. + * + * This event is dispatched by a Sprite when a specific animation repeats playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrepeat-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrepeat-explode`. + * + * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. + * @param {integer} repeatCount - The number of times the Animation has repeated so far. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing. + */ +module.exports = 'animationrepeat-'; + + +/***/ }), +/* 515 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sprite Animation Key Restart Event. + * + * This event is dispatched by a Sprite when a specific animation restarts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrestart-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrestart-explode`. + * + * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. + */ +module.exports = 'animationrestart-'; + + +/***/ }), +/* 516 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sprite Animation Key Start Event. + * + * This event is dispatched by a Sprite when a specific animation starts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationstart-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationstart-explode`. + * + * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. + */ +module.exports = 'animationstart-'; + + +/***/ }), +/* 517 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sprite Animation Key Update Event. + * + * This event is dispatched by a Sprite when a specific animation playing on it updates. This happens when the animation changes frame, + * based on the animation frame rate and other factors like `timeScale` and `delay`. + * + * Listen for it on the Sprite using `sprite.on('animationupdate-key', listener)` where `key` is the key of + * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationupdate-explode`. + * + * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. + */ +module.exports = 'animationupdate-'; + + +/***/ }), +/* 518 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sprite Animation Repeat Event. + * + * This event is dispatched by a Sprite when an animation repeats playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_REPEAT` event. + * + * @event Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. + * @param {integer} repeatCount - The number of times the Animation has repeated so far. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing. + */ +module.exports = 'animationrepeat'; + + +/***/ }), +/* 519 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sprite Animation Restart Event. + * + * This event is dispatched by a Sprite when an animation restarts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_RESTART` event. + * + * @event Phaser.Animations.Events#SPRITE_ANIMATION_RESTART + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. + */ +module.exports = 'animationrestart'; + + +/***/ }), +/* 520 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sprite Animation Start Event. + * + * This event is dispatched by a Sprite when an animation starts playing on it. + * + * Listen for it on the Sprite using `sprite.on('animationstart', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_START` event. + * + * @event Phaser.Animations.Events#SPRITE_ANIMATION_START + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. + */ +module.exports = 'animationstart'; + + +/***/ }), +/* 521 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sprite Animation Update Event. + * + * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame, + * based on the animation frame rate and other factors like `timeScale` and `delay`. + * + * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` + * + * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_UPDATE` event. + * + * @event Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE + * @since 3.16.1 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. + */ +module.exports = 'animationupdate'; + + +/***/ }), +/* 522 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for calculating and setting the size of a non-Frame based Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.ComputedSize + * @since 3.0.0 + */ + +var ComputedSize = { + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#width + * @type {number} + * @since 3.0.0 + */ + width: 0, + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#height + * @type {number} + * @since 3.0.0 + */ + height: 0, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return this.scaleX * this.width; + }, + + set: function (value) + { + this.scaleX = value / this.width; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return this.scaleY * this.height; + }, + + set: function (value) + { + this.scaleY = value / this.height; + } + + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.ComputedSize#setSize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + } + +}; + +module.exports = ComputedSize; + + +/***/ }), +/* 523 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Crop + * @since 3.12.0 + */ + +var Crop = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Crop#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Crop#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + * + * @name Phaser.GameObjects.Components.Crop#isCropped + * @type {boolean} + * @since 3.11.0 + */ + isCropped: false, + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * + * @method Phaser.GameObjects.Components.Crop#setCrop + * @since 3.11.0 + * + * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param {number} [y] - The y coordinate to start the crop from. + * @param {number} [width] - The width of the crop rectangle in pixels. + * @param {number} [height] - The height of the crop rectangle in pixels. + * + * @return {this} This Game Object instance. + */ + setCrop: function (x, y, width, height) + { + if (x === undefined) + { + this.isCropped = false; + } + else if (this.frame) + { + if (typeof x === 'number') + { + this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); + } + else + { + var rect = x; + + this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); + } + + this.isCropped = true; + } + + return this; + }, + + /** + * Internal method that returns a blank, well-formed crop object for use by a Game Object. + * + * @method Phaser.GameObjects.Components.Crop#resetCropObject + * @private + * @since 3.12.0 + * + * @return {object} The crop object. + */ + resetCropObject: function () + { + return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; + } + +}; + +module.exports = Crop; + + +/***/ }), +/* 524 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for visually flipping a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Flip + * @since 3.0.0 + */ + +var Flip = { + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipX + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipX: false, + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipY + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipY: false, + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipX + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipX: function () + { + this.flipX = !this.flipX; + + return this; + }, + + /** + * Toggles the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipY + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipY: function () + { + this.flipY = !this.flipY; + + return this; + }, + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlipX + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipX: function (value) + { + this.flipX = value; + + return this; + }, + + /** + * Sets the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#setFlipY + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipY: function (value) + { + this.flipY = value; + + return this; + }, + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlip + * @since 3.0.0 + * + * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlip: function (x, y) + { + this.flipX = x; + this.flipY = y; + + return this; + }, + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + * + * @method Phaser.GameObjects.Components.Flip#resetFlip + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + resetFlip: function () + { + this.flipX = false; + this.flipY = false; + + return this; + } + +}; + +module.exports = Flip; + + +/***/ }), +/* 525 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); +var RotateAround = __webpack_require__(251); +var Vector2 = __webpack_require__(4); + +/** + * Provides methods used for obtaining the bounds of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.GetBounds + * @since 3.0.0 + */ + +var GetBounds = { + + /** + * Processes the bounds output vector before returning it. + * + * @method Phaser.GameObjects.Components.GetBounds#prepareBoundsOutput + * @private + * @since 3.18.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(Phaser.Math.Vector2|object)} output - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + */ + prepareBoundsOutput: function (output, includeParent) + { + if (includeParent === undefined) { includeParent = false; } + + if (this.rotation !== 0) + { + RotateAround(output, this.x, this.y, this.rotation); + } + + if (includeParent && this.parentContainer) + { + var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); + + parentMatrix.transformPoint(output.x, output.y, output); + } + + return output; + }, + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * + * @method Phaser.GameObjects.Components.GetBounds#getCenter + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + */ + getCenter: function (output) + { + if (output === undefined) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2); + output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2); + + return output; + }, + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * + * @method Phaser.GameObjects.Components.GetBounds#getTopLeft + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + */ + getTopLeft: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * + * @method Phaser.GameObjects.Components.GetBounds#getTopCenter + * @since 3.18.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + */ + getTopCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * + * @method Phaser.GameObjects.Components.GetBounds#getTopRight + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + */ + getTopRight: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = this.y - (this.displayHeight * this.originY); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * + * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter + * @since 3.18.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + */ + getLeftCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * + * @method Phaser.GameObjects.Components.GetBounds#getRightCenter + * @since 3.18.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + */ + getRightCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2); + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + */ + getBottomLeft: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = this.x - (this.displayWidth * this.originX); + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter + * @since 3.18.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + */ + getBottomCenter: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2); + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * + * @method Phaser.GameObjects.Components.GetBounds#getBottomRight + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created. + * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? + * + * @return {(Phaser.Math.Vector2|object)} The values stored in the output object. + */ + getBottomRight: function (output, includeParent) + { + if (!output) { output = new Vector2(); } + + output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth; + output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight; + + return this.prepareBoundsOutput(output, includeParent); + }, + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * + * @method Phaser.GameObjects.Components.GetBounds#getBounds + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [output,$return] + * + * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created. + * + * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object. + */ + getBounds: function (output) + { + if (output === undefined) { output = new Rectangle(); } + + // We can use the output object to temporarily store the x/y coords in: + + var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy; + + // Instead of doing a check if parent container is + // defined per corner we only do it once. + if (this.parentContainer) + { + var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); + + this.getTopLeft(output); + parentMatrix.transformPoint(output.x, output.y, output); + + TLx = output.x; + TLy = output.y; + + this.getTopRight(output); + parentMatrix.transformPoint(output.x, output.y, output); + + TRx = output.x; + TRy = output.y; + + this.getBottomLeft(output); + parentMatrix.transformPoint(output.x, output.y, output); + + BLx = output.x; + BLy = output.y; + + this.getBottomRight(output); + parentMatrix.transformPoint(output.x, output.y, output); + + BRx = output.x; + BRy = output.y; + } + else + { + this.getTopLeft(output); + + TLx = output.x; + TLy = output.y; + + this.getTopRight(output); + + TRx = output.x; + TRy = output.y; + + this.getBottomLeft(output); + + BLx = output.x; + BLy = output.y; + + this.getBottomRight(output); + + BRx = output.x; + BRy = output.y; + } + + output.x = Math.min(TLx, TRx, BLx, BRx); + output.y = Math.min(TLy, TRy, BLy, BRy); + output.width = Math.max(TLx, TRx, BLx, BRx) - output.x; + output.height = Math.max(TLy, TRy, BLy, BRy) - output.y; + + return output; + } + +}; + +module.exports = GetBounds; + + +/***/ }), +/* 526 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the origin of a Game Object. + * Values are normalized, given in the range 0 to 1. + * Display values contain the calculated pixel values. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Origin + * @since 3.0.0 + */ + +var Origin = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Origin#_originComponent + * @type {boolean} + * @private + * @default true + * @since 3.2.0 + */ + _originComponent: true, + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + * + * @name Phaser.GameObjects.Components.Origin#originX + * @type {number} + * @default 0.5 + * @since 3.0.0 + */ + originX: 0.5, + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + * + * @name Phaser.GameObjects.Components.Origin#originY + * @type {number} + * @default 0.5 + * @since 3.0.0 + */ + originY: 0.5, + + // private + read only + _displayOriginX: 0, + _displayOriginY: 0, + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * + * @name Phaser.GameObjects.Components.Origin#displayOriginX + * @type {number} + * @since 3.0.0 + */ + displayOriginX: { + + get: function () + { + return this._displayOriginX; + }, + + set: function (value) + { + this._displayOriginX = value; + this.originX = value / this.width; + } + + }, + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + * + * @name Phaser.GameObjects.Components.Origin#displayOriginY + * @type {number} + * @since 3.0.0 + */ + displayOriginY: { + + get: function () + { + return this._displayOriginY; + }, + + set: function (value) + { + this._displayOriginY = value; + this.originY = value / this.height; + } + + }, + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * + * @method Phaser.GameObjects.Components.Origin#setOrigin + * @since 3.0.0 + * + * @param {number} [x=0.5] - The horizontal origin value. + * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`. + * + * @return {this} This Game Object instance. + */ + setOrigin: function (x, y) + { + if (x === undefined) { x = 0.5; } + if (y === undefined) { y = x; } + + this.originX = x; + this.originY = y; + + return this.updateDisplayOrigin(); + }, + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + * + * @method Phaser.GameObjects.Components.Origin#setOriginFromFrame + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + setOriginFromFrame: function () + { + if (!this.frame || !this.frame.customPivot) + { + return this.setOrigin(); + } + else + { + this.originX = this.frame.pivotX; + this.originY = this.frame.pivotY; + } + + return this.updateDisplayOrigin(); + }, + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * + * @method Phaser.GameObjects.Components.Origin#setDisplayOrigin + * @since 3.0.0 + * + * @param {number} [x=0] - The horizontal display origin value. + * @param {number} [y=x] - The vertical display origin value. If not defined it will be set to the value of `x`. + * + * @return {this} This Game Object instance. + */ + setDisplayOrigin: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this.displayOriginX = x; + this.displayOriginY = y; + + return this; + }, + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + * + * @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + updateDisplayOrigin: function () + { + this._displayOriginX = Math.round(this.originX * this.width); + this._displayOriginY = Math.round(this.originY * this.height); + + return this; + } + +}; + +module.exports = Origin; + + +/***/ }), +/* 527 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DegToRad = __webpack_require__(35); +var GetBoolean = __webpack_require__(87); +var GetValue = __webpack_require__(6); +var TWEEN_CONST = __webpack_require__(88); +var Vector2 = __webpack_require__(4); + +/** + * Provides methods used for managing a Game Object following a Path. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.PathFollower + * @since 3.17.0 + */ + +var PathFollower = { + + /** + * The Path this PathFollower is following. It can only follow one Path at a time. + * + * @name Phaser.GameObjects.Components.PathFollower#path + * @type {Phaser.Curves.Path} + * @since 3.0.0 + */ + path: null, + + /** + * Should the PathFollower automatically rotate to point in the direction of the Path? + * + * @name Phaser.GameObjects.Components.PathFollower#rotateToPath + * @type {boolean} + * @default false + * @since 3.0.0 + */ + rotateToPath: false, + + /** + * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath) + * this value is added to the rotation value. This allows you to rotate objects to a path but control + * the angle of the rotation as well. + * + * @name Phaser.GameObjects.PathFollower#pathRotationOffset + * @type {number} + * @default 0 + * @since 3.0.0 + */ + pathRotationOffset: 0, + + /** + * An additional vector to add to the PathFollowers position, allowing you to offset it from the + * Path coordinates. + * + * @name Phaser.GameObjects.PathFollower#pathOffset + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + pathOffset: null, + + /** + * A Vector2 that stores the current point of the path the follower is on. + * + * @name Phaser.GameObjects.PathFollower#pathVector + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + pathVector: null, + + /** + * The Tween used for following the Path. + * + * @name Phaser.GameObjects.PathFollower#pathTween + * @type {Phaser.Tweens.Tween} + * @since 3.0.0 + */ + pathTween: null, + + /** + * Settings for the PathFollower. + * + * @name Phaser.GameObjects.PathFollower#pathConfig + * @type {?Phaser.Types.GameObjects.PathFollower.PathConfig} + * @default null + * @since 3.0.0 + */ + pathConfig: null, + + /** + * Records the direction of the follower so it can change direction. + * + * @name Phaser.GameObjects.PathFollower#_prevDirection + * @type {integer} + * @private + * @since 3.0.0 + */ + _prevDirection: TWEEN_CONST.PLAYING_FORWARD, + + /** + * Set the Path that this PathFollower should follow. + * + * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. + * + * @method Phaser.GameObjects.Components.PathFollower#setPath + * @since 3.0.0 + * + * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time. + * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower. + * + * @return {Phaser.GameObjects.PathFollower} This Game Object. + */ + setPath: function (path, config) + { + if (config === undefined) { config = this.pathConfig; } + + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + this.path = path; + + if (config) + { + this.startFollow(config); + } + + return this; + }, + + /** + * Set whether the PathFollower should automatically rotate to point in the direction of the Path. + * + * @method Phaser.GameObjects.Components.PathFollower#setRotateToPath + * @since 3.0.0 + * + * @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path. + * @param {number} [offset=0] - Rotation offset in degrees. + * + * @return {Phaser.GameObjects.PathFollower} This Game Object. + */ + setRotateToPath: function (value, offset) + { + if (offset === undefined) { offset = 0; } + + this.rotateToPath = value; + + this.pathRotationOffset = offset; + + return this; + }, + + /** + * Is this PathFollower actively following a Path or not? + * + * To be considered as `isFollowing` it must be currently moving on a Path, and not paused. + * + * @method Phaser.GameObjects.Components.PathFollower#isFollowing + * @since 3.0.0 + * + * @return {boolean} `true` is this PathFollower is actively following a Path, otherwise `false`. + */ + isFollowing: function () + { + var tween = this.pathTween; + + return (tween && tween.isPlaying()); + }, + + /** + * Starts this PathFollower following its given Path. + * + * @method Phaser.GameObjects.Components.PathFollower#startFollow + * @since 3.3.0 + * + * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object. + * @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1. + * + * @return {Phaser.GameObjects.PathFollower} This Game Object. + */ + startFollow: function (config, startAt) + { + if (config === undefined) { config = {}; } + if (startAt === undefined) { startAt = 0; } + + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + if (typeof config === 'number') + { + config = { duration: config }; + } + + // Override in case they've been specified in the config + config.from = GetValue(config, 'from', 0); + config.to = GetValue(config, 'to', 1); + + var positionOnPath = GetBoolean(config, 'positionOnPath', false); + + this.rotateToPath = GetBoolean(config, 'rotateToPath', false); + this.pathRotationOffset = GetValue(config, 'rotationOffset', 0); + + // This works, but it's not an ideal way of doing it as the follower jumps position + var seek = GetValue(config, 'startAt', startAt); + + if (seek) + { + config.onStart = function (tween) + { + var tweenData = tween.data[0]; + tweenData.progress = seek; + tweenData.elapsed = tweenData.duration * seek; + var v = tweenData.ease(tweenData.progress); + tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v); + tweenData.target[tweenData.key] = tweenData.current; + }; + } + + if (!this.pathOffset) + { + this.pathOffset = new Vector2(this.x, this.y); + } + + if (!this.pathVector) + { + this.pathVector = new Vector2(); + } + + this.pathTween = this.scene.sys.tweens.addCounter(config); + + // The starting point of the path, relative to this follower + this.path.getStartPoint(this.pathOffset); + + if (positionOnPath) + { + this.x = this.pathOffset.x; + this.y = this.pathOffset.y; + } + + this.pathOffset.x = this.x - this.pathOffset.x; + this.pathOffset.y = this.y - this.pathOffset.y; + + this._prevDirection = TWEEN_CONST.PLAYING_FORWARD; + + if (this.rotateToPath) + { + // Set the rotation now (in case the tween has a delay on it, etc) + var nextPoint = this.path.getPoint(0.1); + + this.rotation = Math.atan2(nextPoint.y - this.y, nextPoint.x - this.x) + DegToRad(this.pathRotationOffset); + } + + this.pathConfig = config; + + return this; + }, + + /** + * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the + * point on the Path at which you paused it. + * + * @method Phaser.GameObjects.Components.PathFollower#pauseFollow + * @since 3.3.0 + * + * @return {Phaser.GameObjects.PathFollower} This Game Object. + */ + pauseFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.pause(); + } + + return this; + }, + + /** + * Resumes a previously paused PathFollower. + * + * If the PathFollower was not paused this has no effect. + * + * @method Phaser.GameObjects.Components.PathFollower#resumeFollow + * @since 3.3.0 + * + * @return {Phaser.GameObjects.PathFollower} This Game Object. + */ + resumeFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPaused()) + { + tween.resume(); + } + + return this; + }, + + /** + * Stops this PathFollower from following the path any longer. + * + * This will invoke any 'stop' conditions that may exist on the Path, or for the follower. + * + * @method Phaser.GameObjects.Components.PathFollower#stopFollow + * @since 3.3.0 + * + * @return {Phaser.GameObjects.PathFollower} This Game Object. + */ + stopFollow: function () + { + var tween = this.pathTween; + + if (tween && tween.isPlaying()) + { + tween.stop(); + } + + return this; + }, + + /** + * Internal update handler that advances this PathFollower along the path. + * + * Called automatically by the Scene step, should not typically be called directly. + * + * @method Phaser.GameObjects.Components.PathFollower#pathUpdate + * @since 3.17.0 + */ + pathUpdate: function () + { + var tween = this.pathTween; + + if (tween) + { + var tweenData = tween.data[0]; + + if (tweenData.state !== TWEEN_CONST.PLAYING_FORWARD && tweenData.state !== TWEEN_CONST.PLAYING_BACKWARD) + { + // If delayed, etc then bail out + return; + } + + var pathVector = this.pathVector; + + this.path.getPoint(tween.getValue(), pathVector); + + pathVector.add(this.pathOffset); + + var oldX = this.x; + var oldY = this.y; + + this.setPosition(pathVector.x, pathVector.y); + + var speedX = this.x - oldX; + var speedY = this.y - oldY; + + if (speedX === 0 && speedY === 0) + { + // Bail out early + return; + } + + if (tweenData.state !== this._prevDirection) + { + // We've changed direction, so don't do a rotate this frame + this._prevDirection = tweenData.state; + + return; + } + + if (this.rotateToPath) + { + this.rotation = Math.atan2(speedY, speedX) + DegToRad(this.pathRotationOffset); + } + } + } + +}; + +module.exports = PathFollower; + + +/***/ }), +/* 528 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the size of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Size + * @since 3.0.0 + */ + +var Size = { + + /** + * A property indicating that a Game Object has this component. + * + * @name Phaser.GameObjects.Components.Size#_sizeComponent + * @type {boolean} + * @private + * @default true + * @since 3.2.0 + */ + _sizeComponent: true, + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Components.Size#width + * @type {number} + * @since 3.0.0 + */ + width: 0, + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Components.Size#height + * @type {number} + * @since 3.0.0 + */ + height: 0, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.Size#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return this.scaleX * this.frame.realWidth; + }, + + set: function (value) + { + this.scaleX = value / this.frame.realWidth; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.Size#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return this.scaleY * this.frame.realHeight; + }, + + set: function (value) + { + this.scaleY = value / this.frame.realHeight; + } + + }, + + /** + * Sets the size of this Game Object to be that of the given Frame. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.Size#setSizeToFrame + * @since 3.0.0 + * + * @param {Phaser.Textures.Frame} frame - The frame to base the size of this Game Object on. + * + * @return {this} This Game Object instance. + */ + setSizeToFrame: function (frame) + { + if (frame === undefined) { frame = this.frame; } + + this.width = frame.realWidth; + this.height = frame.realHeight; + + return this; + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.Size#setSize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Components.Size#setDisplaySize + * @since 3.0.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + } + +}; + +module.exports = Size; + + +/***/ }), +/* 529 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// bitmask flag for GameObject.renderMask +var _FLAG = 8; // 1000 + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Texture + * @since 3.0.0 + */ + +var Texture = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Texture#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.Texture#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * Internal flag. Not to be set by this Game Object. + * + * @name Phaser.GameObjects.Components.Texture#isCropped + * @type {boolean} + * @private + * @since 3.11.0 + */ + isCropped: false, + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * @method Phaser.GameObjects.Components.Texture#setTexture + * @since 3.0.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setTexture: function (key, frame) + { + this.texture = this.scene.sys.textures.get(key); + + return this.setFrame(frame); + }, + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * + * @method Phaser.GameObjects.Components.Texture#setFrame + * @since 3.0.0 + * + * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? + * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? + * + * @return {this} This Game Object instance. + */ + setFrame: function (frame, updateSize, updateOrigin) + { + if (updateSize === undefined) { updateSize = true; } + if (updateOrigin === undefined) { updateOrigin = true; } + + this.frame = this.texture.get(frame); + + if (!this.frame.cutWidth || !this.frame.cutHeight) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + if (this._sizeComponent && updateSize) + { + this.setSizeToFrame(); + } + + if (this._originComponent && updateOrigin) + { + if (this.frame.customPivot) + { + this.setOrigin(this.frame.pivotX, this.frame.pivotY); + } + else + { + this.updateDisplayOrigin(); + } + } + + return this; + } + +}; + +module.exports = Texture; + + +/***/ }), +/* 530 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// bitmask flag for GameObject.renderMask +var _FLAG = 8; // 1000 + +/** + * Provides methods used for getting and setting the texture of a Game Object. + * + * @namespace Phaser.GameObjects.Components.TextureCrop + * @since 3.0.0 + */ + +var TextureCrop = { + + /** + * The Texture this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.TextureCrop#texture + * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture} + * @since 3.0.0 + */ + texture: null, + + /** + * The Texture Frame this Game Object is using to render with. + * + * @name Phaser.GameObjects.Components.TextureCrop#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + frame: null, + + /** + * A boolean flag indicating if this Game Object is being cropped or not. + * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off. + * Equally, calling `setCrop` with no arguments will reset the crop and disable it. + * + * @name Phaser.GameObjects.Components.TextureCrop#isCropped + * @type {boolean} + * @since 3.11.0 + */ + isCropped: false, + + /** + * Applies a crop to a texture based Game Object, such as a Sprite or Image. + * + * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. + * + * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just + * changes what is shown when rendered. + * + * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. + * + * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left + * half of it, you could call `setCrop(0, 0, 400, 600)`. + * + * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop + * an area of 200x100 when applied to a Game Object that had a scale factor of 2. + * + * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. + * + * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. + * + * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow + * the renderer to skip several internal calculations. + * + * @method Phaser.GameObjects.Components.TextureCrop#setCrop + * @since 3.11.0 + * + * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. + * @param {number} [y] - The y coordinate to start the crop from. + * @param {number} [width] - The width of the crop rectangle in pixels. + * @param {number} [height] - The height of the crop rectangle in pixels. + * + * @return {this} This Game Object instance. + */ + setCrop: function (x, y, width, height) + { + if (x === undefined) + { + this.isCropped = false; + } + else if (this.frame) + { + if (typeof x === 'number') + { + this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY); + } + else + { + var rect = x; + + this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY); + } + + this.isCropped = true; + } + + return this; + }, + + /** + * Sets the texture and frame this Game Object will use to render with. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * @method Phaser.GameObjects.Components.TextureCrop#setTexture + * @since 3.0.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * + * @return {this} This Game Object instance. + */ + setTexture: function (key, frame) + { + this.texture = this.scene.sys.textures.get(key); + + return this.setFrame(frame); + }, + + /** + * Sets the frame this Game Object will use to render with. + * + * The Frame has to belong to the current Texture being used. + * + * It can be either a string or an index. + * + * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. + * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. + * + * @method Phaser.GameObjects.Components.TextureCrop#setFrame + * @since 3.0.0 + * + * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? + * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? + * + * @return {this} This Game Object instance. + */ + setFrame: function (frame, updateSize, updateOrigin) + { + if (updateSize === undefined) { updateSize = true; } + if (updateOrigin === undefined) { updateOrigin = true; } + + this.frame = this.texture.get(frame); + + if (!this.frame.cutWidth || !this.frame.cutHeight) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + if (this._sizeComponent && updateSize) + { + this.setSizeToFrame(); + } + + if (this._originComponent && updateOrigin) + { + if (this.frame.customPivot) + { + this.setOrigin(this.frame.pivotX, this.frame.pivotY); + } + else + { + this.updateDisplayOrigin(); + } + } + + if (this.isCropped) + { + this.frame.updateCropUVs(this._crop, this.flipX, this.flipY); + } + + return this; + }, + + /** + * Internal method that returns a blank, well-formed crop object for use by a Game Object. + * + * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject + * @private + * @since 3.12.0 + * + * @return {object} The crop object. + */ + resetCropObject: function () + { + return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 }; + } + +}; + +module.exports = TextureCrop; + + +/***/ }), +/* 531 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @function GetColor + * @since 3.0.0 + * @private + */ +var GetColor = function (value) +{ + return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16); +}; + +/** + * Provides methods used for setting the tint of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Tint + * @webglOnly + * @since 3.0.0 + */ + +var Tint = { + + /** + * Private internal value. Holds the top-left tint value. + * + * @name Phaser.GameObjects.Components.Tint#_tintTL + * @type {number} + * @private + * @default 16777215 + * @since 3.0.0 + */ + _tintTL: 16777215, + + /** + * Private internal value. Holds the top-right tint value. + * + * @name Phaser.GameObjects.Components.Tint#_tintTR + * @type {number} + * @private + * @default 16777215 + * @since 3.0.0 + */ + _tintTR: 16777215, + + /** + * Private internal value. Holds the bottom-left tint value. + * + * @name Phaser.GameObjects.Components.Tint#_tintBL + * @type {number} + * @private + * @default 16777215 + * @since 3.0.0 + */ + _tintBL: 16777215, + + /** + * Private internal value. Holds the bottom-right tint value. + * + * @name Phaser.GameObjects.Components.Tint#_tintBR + * @type {number} + * @private + * @default 16777215 + * @since 3.0.0 + */ + _tintBR: 16777215, + + /** + * Private internal value. Holds if the Game Object is tinted or not. + * + * @name Phaser.GameObjects.Components.Tint#_isTinted + * @type {boolean} + * @private + * @default false + * @since 3.11.0 + */ + _isTinted: false, + + /** + * Fill or additive? + * + * @name Phaser.GameObjects.Components.Tint#tintFill + * @type {boolean} + * @default false + * @since 3.11.0 + */ + tintFill: false, + + /** + * Clears all tint values associated with this Game Object. + * + * Immediately sets the color values back to 0xffffff and the tint type to 'additive', + * which results in no visible change to the texture. + * + * @method Phaser.GameObjects.Components.Tint#clearTint + * @webglOnly + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + clearTint: function () + { + this.setTint(0xffffff); + + this._isTinted = false; + + return this; + }, + + /** + * Sets an additive tint on this Game Object. + * + * The tint works by taking the pixel color values from the Game Objects texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole Game Object will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`. + * + * @method Phaser.GameObjects.Components.Tint#setTint + * @webglOnly + * @since 3.0.0 + * + * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. + * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * + * @return {this} This Game Object instance. + */ + setTint: function (topLeft, topRight, bottomLeft, bottomRight) + { + if (topLeft === undefined) { topLeft = 0xffffff; } + + if (topRight === undefined) + { + topRight = topLeft; + bottomLeft = topLeft; + bottomRight = topLeft; + } + + this._tintTL = GetColor(topLeft); + this._tintTR = GetColor(topRight); + this._tintBL = GetColor(bottomLeft); + this._tintBR = GetColor(bottomRight); + + this._isTinted = true; + + this.tintFill = false; + + return this; + }, + + /** + * Sets a fill-based tint on this Game Object. + * + * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture + * with those in the tint. You can use this for effects such as making a player flash 'white' + * if hit by something. You can provide either one color value, in which case the whole + * Game Object will be rendered in that color. Or you can provide a color per corner. The colors + * are blended together across the extent of the Game Object. + * + * To modify the tint color once set, either call this method again with new values or use the + * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight, + * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. + * + * To remove a tint call `clearTint`. + * + * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`. + * + * @method Phaser.GameObjects.Components.Tint#setTintFill + * @webglOnly + * @since 3.11.0 + * + * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. + * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * + * @return {this} This Game Object instance. + */ + setTintFill: function (topLeft, topRight, bottomLeft, bottomRight) + { + this.setTint(topLeft, topRight, bottomLeft, bottomRight); + + this.tintFill = true; + + return this; + }, + + /** + * The tint value being applied to the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Tint#tintTopLeft + * @type {integer} + * @webglOnly + * @since 3.0.0 + */ + tintTopLeft: { + + get: function () + { + return this._tintTL; + }, + + set: function (value) + { + this._tintTL = GetColor(value); + this._isTinted = true; + } + + }, + + /** + * The tint value being applied to the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Tint#tintTopRight + * @type {integer} + * @webglOnly + * @since 3.0.0 + */ + tintTopRight: { + + get: function () + { + return this._tintTR; + }, + + set: function (value) + { + this._tintTR = GetColor(value); + this._isTinted = true; + } + + }, + + /** + * The tint value being applied to the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft + * @type {integer} + * @webglOnly + * @since 3.0.0 + */ + tintBottomLeft: { + + get: function () + { + return this._tintBL; + }, + + set: function (value) + { + this._tintBL = GetColor(value); + this._isTinted = true; + } + + }, + + /** + * The tint value being applied to the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * + * @name Phaser.GameObjects.Components.Tint#tintBottomRight + * @type {integer} + * @webglOnly + * @since 3.0.0 + */ + tintBottomRight: { + + get: function () + { + return this._tintBR; + }, + + set: function (value) + { + this._tintBR = GetColor(value); + this._isTinted = true; + } + + }, + + /** + * The tint value being applied to the whole of the Game Object. + * + * @name Phaser.GameObjects.Components.Tint#tint + * @type {integer} + * @webglOnly + * @since 3.0.0 + */ + tint: { + + set: function (value) + { + this.setTint(value, value, value, value); + } + }, + + /** + * Does this Game Object have a tint applied to it or not? + * + * @name Phaser.GameObjects.Components.Tint#isTinted + * @type {boolean} + * @webglOnly + * @readonly + * @since 3.11.0 + */ + isTinted: { + + get: function () + { + return this._isTinted; + } + + } + +}; + +module.exports = Tint; + + +/***/ }), +/* 532 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`. + * + * This event is dispatched for all items that change in the Data Manager. + * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. + * + * @event Phaser.Data.Events#CHANGE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The new value of the item in the Data Manager. + * @param {any} previousValue - The previous value of the item in the Data Manager. + */ +module.exports = 'changedata'; + + +/***/ }), +/* 533 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Change Data Key Event. + * + * This event is dispatched by a Data Manager when an item in the data store is changed. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`, + * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` + * then you can listen for `sprite.data.on('changedata-gold')`. + * + * @event Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.16.1 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'changedata-'; + + +/***/ }), +/* 534 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Remove Data Event. + * + * This event is dispatched by a Data Manager when an item is removed from it. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`. + * + * @event Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'removedata'; + + +/***/ }), +/* 535 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Set Data Event. + * + * This event is dispatched by a Data Manager when a new item is added to the data store. + * + * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for + * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`. + * + * @event Phaser.Data.Events#SET_DATA + * @since 3.0.0 + * + * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. + * @param {string} key - The unique key of the data item within the Data Manager. + * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance. + */ +module.exports = 'setdata'; + + +/***/ }), +/* 536 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Destroy Event. + * + * This event is dispatched when a Game Object instance is being destroyed. + * + * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. + * + * @event Phaser.GameObjects.Events#DESTROY + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. + */ +module.exports = 'destroy'; + + +/***/ }), +/* 537 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueInc = __webpack_require__(34); + +/** + * Takes an array of Game Objects, or any objects that have a public `alpha` property, + * and then adds the given value to each of their `alpha` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncAlpha(group.getChildren(), value, step)` + * + * @function Phaser.Actions.IncAlpha + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to be added to the `alpha` property. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var IncAlpha = function (items, value, step, index, direction) +{ + return PropertyValueInc(items, 'alpha', value, step, index, direction); +}; + +module.exports = IncAlpha; + + +/***/ }), +/* 538 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueInc = __webpack_require__(34); + +/** + * Takes an array of Game Objects, or any objects that have a public `x` property, + * and then adds the given value to each of their `x` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncX(group.getChildren(), value, step)` + * + * @function Phaser.Actions.IncX + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to be added to the `x` property. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var IncX = function (items, value, step, index, direction) +{ + return PropertyValueInc(items, 'x', value, step, index, direction); +}; + +module.exports = IncX; + + +/***/ }), +/* 539 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueInc = __webpack_require__(34); + +/** + * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, + * and then adds the given value to each of them. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncXY(group.getChildren(), x, y, stepX, stepY)` + * + * @function Phaser.Actions.IncXY + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} x - The amount to be added to the `x` property. + * @param {number} [y=x] - The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value. + * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter. + * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var IncXY = function (items, x, y, stepX, stepY, index, direction) +{ + if (y === undefined || y === null) { y = x; } + + PropertyValueInc(items, 'x', x, stepX, index, direction); + + return PropertyValueInc(items, 'y', y, stepY, index, direction); +}; + +module.exports = IncXY; + + +/***/ }), +/* 540 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueInc = __webpack_require__(34); + +/** + * Takes an array of Game Objects, or any objects that have a public `y` property, + * and then adds the given value to each of their `y` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `IncY(group.getChildren(), value, step)` + * + * @function Phaser.Actions.IncY + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to be added to the `y` property. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var IncY = function (items, value, step, index, direction) +{ + return PropertyValueInc(items, 'y', value, step, index, direction); +}; + +module.exports = IncY; + + +/***/ }), +/* 541 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. + * + * @function Phaser.Actions.PlaceOnCircle + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Circle} circle - The Circle to position the Game Objects on. + * @param {number} [startAngle=0] - Optional angle to start position from, in radians. + * @param {number} [endAngle=6.28] - Optional angle to stop position at, in radians. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var PlaceOnCircle = function (items, circle, startAngle, endAngle) +{ + if (startAngle === undefined) { startAngle = 0; } + if (endAngle === undefined) { endAngle = 6.28; } + + var angle = startAngle; + var angleStep = (endAngle - startAngle) / items.length; + + for (var i = 0; i < items.length; i++) + { + items[i].x = circle.x + (circle.radius * Math.cos(angle)); + items[i].y = circle.y + (circle.radius * Math.sin(angle)); + + angle += angleStep; + } + + return items; +}; + +module.exports = PlaceOnCircle; + + +/***/ }), +/* 542 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of an Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. + * + * @function Phaser.Actions.PlaceOnEllipse + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to position the Game Objects on. + * @param {number} [startAngle=0] - Optional angle to start position from, in radians. + * @param {number} [endAngle=6.28] - Optional angle to stop position at, in radians. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var PlaceOnEllipse = function (items, ellipse, startAngle, endAngle) +{ + if (startAngle === undefined) { startAngle = 0; } + if (endAngle === undefined) { endAngle = 6.28; } + + var angle = startAngle; + var angleStep = (endAngle - startAngle) / items.length; + + var a = ellipse.width / 2; + var b = ellipse.height / 2; + + for (var i = 0; i < items.length; i++) + { + items[i].x = ellipse.x + a * Math.cos(angle); + items[i].y = ellipse.y + b * Math.sin(angle); + + angle += angleStep; + } + + return items; +}; + +module.exports = PlaceOnEllipse; + + +/***/ }), +/* 543 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetPoints = __webpack_require__(148); + +/** + * Positions an array of Game Objects on evenly spaced points of a Line. + * + * @function Phaser.Actions.PlaceOnLine + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Line} line - The Line to position the Game Objects on. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var PlaceOnLine = function (items, line) +{ + var points = GetPoints(line, items.length); + + for (var i = 0; i < items.length; i++) + { + var item = items[i]; + var point = points[i]; + + item.x = point.x; + item.y = point.y; + } + + return items; +}; + +module.exports = PlaceOnLine; + + +/***/ }), +/* 544 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MarchingAnts = __webpack_require__(260); +var RotateLeft = __webpack_require__(261); +var RotateRight = __webpack_require__(262); + +/** + * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. + * + * Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction. + * If the `shift` parameter is given you can offset where placement begins. + * + * @function Phaser.Actions.PlaceOnRectangle + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects on. + * @param {integer} [shift=1] - An optional positional offset. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var PlaceOnRectangle = function (items, rect, shift) +{ + if (shift === undefined) { shift = 0; } + + var points = MarchingAnts(rect, false, items.length); + + if (shift > 0) + { + RotateLeft(points, shift); + } + else if (shift < 0) + { + RotateRight(points, Math.abs(shift)); + } + + for (var i = 0; i < items.length; i++) + { + items[i].x = points[i].x; + items[i].y = points[i].y; + } + + return items; +}; + +module.exports = PlaceOnRectangle; + + +/***/ }), +/* 545 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BresenhamPoints = __webpack_require__(263); + +/** + * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. + * + * @function Phaser.Actions.PlaceOnTriangle + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Triangle} triangle - The Triangle to position the Game Objects on. + * @param {number} [stepRate=1] - An optional step rate, to increase or decrease the packing of the Game Objects on the lines. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var PlaceOnTriangle = function (items, triangle, stepRate) +{ + var p1 = BresenhamPoints({ x1: triangle.x1, y1: triangle.y1, x2: triangle.x2, y2: triangle.y2 }, stepRate); + var p2 = BresenhamPoints({ x1: triangle.x2, y1: triangle.y2, x2: triangle.x3, y2: triangle.y3 }, stepRate); + var p3 = BresenhamPoints({ x1: triangle.x3, y1: triangle.y3, x2: triangle.x1, y2: triangle.y1 }, stepRate); + + // Remove overlaps + p1.pop(); + p2.pop(); + p3.pop(); + + p1 = p1.concat(p2, p3); + + var step = p1.length / items.length; + var p = 0; + + for (var i = 0; i < items.length; i++) + { + var item = items[i]; + var point = p1[Math.floor(p)]; + + item.x = point.x; + item.y = point.y; + + p += step; + } + + return items; +}; + +module.exports = PlaceOnTriangle; + + +/***/ }), +/* 546 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Play an animation with the given key, starting at the given startFrame on all Game Objects in items. + * + * @function Phaser.Actions.PlayAnimation + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {string} key - The name of the animation to play. + * @param {(string|integer)} [startFrame] - The starting frame of the animation with the given key. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var PlayAnimation = function (items, key, startFrame) +{ + for (var i = 0; i < items.length; i++) + { + items[i].anims.play(key, startFrame); + } + + return items; +}; + +module.exports = PlayAnimation; + + +/***/ }), +/* 547 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Random = __webpack_require__(145); + +/** + * Takes an array of Game Objects and positions them at random locations within the Circle. + * + * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. + * + * @function Phaser.Actions.RandomCircle + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Circle} circle - The Circle to position the Game Objects within. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var RandomCircle = function (items, circle) +{ + for (var i = 0; i < items.length; i++) + { + Random(circle, items[i]); + } + + return items; +}; + +module.exports = RandomCircle; + + +/***/ }), +/* 548 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Random = __webpack_require__(152); + +/** + * Takes an array of Game Objects and positions them at random locations within the Ellipse. + * + * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. + * + * @function Phaser.Actions.RandomEllipse + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to position the Game Objects within. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var RandomEllipse = function (items, ellipse) +{ + for (var i = 0; i < items.length; i++) + { + Random(ellipse, items[i]); + } + + return items; +}; + +module.exports = RandomEllipse; + + +/***/ }), +/* 549 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Random = __webpack_require__(149); + +/** + * Takes an array of Game Objects and positions them at random locations on the Line. + * + * If you wish to pass a `Phaser.GameObjects.Line` Shape to this function, you should pass its `geom` property. + * + * @function Phaser.Actions.RandomLine + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Line} line - The Line to position the Game Objects randomly on. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var RandomLine = function (items, line) +{ + for (var i = 0; i < items.length; i++) + { + Random(line, items[i]); + } + + return items; +}; + +module.exports = RandomLine; + + +/***/ }), +/* 550 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Random = __webpack_require__(150); + +/** + * Takes an array of Game Objects and positions them at random locations within the Rectangle. + * + * @function Phaser.Actions.RandomRectangle + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects within. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var RandomRectangle = function (items, rect) +{ + for (var i = 0; i < items.length; i++) + { + Random(rect, items[i]); + } + + return items; +}; + +module.exports = RandomRectangle; + + +/***/ }), +/* 551 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Random = __webpack_require__(153); + +/** + * Takes an array of Game Objects and positions them at random locations within the Triangle. + * + * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. + * + * @function Phaser.Actions.RandomTriangle + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Triangle} triangle - The Triangle to position the Game Objects within. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var RandomTriangle = function (items, triangle) +{ + for (var i = 0; i < items.length; i++) + { + Random(triangle, items[i]); + } + + return items; +}; + +module.exports = RandomTriangle; + + +/***/ }), +/* 552 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueInc = __webpack_require__(34); + +/** + * Takes an array of Game Objects, or any objects that have a public `rotation` property, + * and then adds the given value to each of their `rotation` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `Rotate(group.getChildren(), value, step)` + * + * @function Phaser.Actions.Rotate + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to be added to the `rotation` property (in radians). + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var Rotate = function (items, value, step, index, direction) +{ + return PropertyValueInc(items, 'rotation', value, step, index, direction); +}; + +module.exports = Rotate; + + +/***/ }), +/* 553 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateAroundDistance = __webpack_require__(154); +var DistanceBetween = __webpack_require__(57); + +/** + * Rotates each item around the given point by the given angle. + * + * @function Phaser.Actions.RotateAround + * @since 3.0.0 + * @see Phaser.Math.RotateAroundDistance + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {object} point - Any object with public `x` and `y` properties. + * @param {number} angle - The angle to rotate by, in radians. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var RotateAround = function (items, point, angle) +{ + var x = point.x; + var y = point.y; + + for (var i = 0; i < items.length; i++) + { + var item = items[i]; + + RotateAroundDistance(item, x, y, angle, Math.max(1, DistanceBetween(item.x, item.y, x, y))); + } + + return items; +}; + +module.exports = RotateAround; + + +/***/ }), +/* 554 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathRotateAroundDistance = __webpack_require__(154); + +/** + * Rotates an array of Game Objects around a point by the given angle and distance. + * + * @function Phaser.Actions.RotateAroundDistance + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {object} point - Any object with public `x` and `y` properties. + * @param {number} angle - The angle to rotate by, in radians. + * @param {number} distance - The distance from the point of rotation in pixels. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var RotateAroundDistance = function (items, point, angle, distance) +{ + var x = point.x; + var y = point.y; + + // There's nothing to do + if (distance === 0) + { + return items; + } + + for (var i = 0; i < items.length; i++) + { + MathRotateAroundDistance(items[i], x, y, angle, distance); + } + + return items; +}; + +module.exports = RotateAroundDistance; + + +/***/ }), +/* 555 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueInc = __webpack_require__(34); + +/** + * Takes an array of Game Objects, or any objects that have a public `scaleX` property, + * and then adds the given value to each of their `scaleX` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `ScaleX(group.getChildren(), value, step)` + * + * @function Phaser.Actions.ScaleX + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to be added to the `scaleX` property. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var ScaleX = function (items, value, step, index, direction) +{ + return PropertyValueInc(items, 'scaleX', value, step, index, direction); +}; + +module.exports = ScaleX; + + +/***/ }), +/* 556 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueInc = __webpack_require__(34); + +/** + * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties, + * and then adds the given value to each of them. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `ScaleXY(group.getChildren(), scaleX, scaleY, stepX, stepY)` + * + * @function Phaser.Actions.ScaleXY + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} scaleX - The amount to be added to the `scaleX` property. + * @param {number} [scaleY] - The amount to be added to the `scaleY` property. If `undefined` or `null` it uses the `scaleX` value. + * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter. + * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var ScaleXY = function (items, scaleX, scaleY, stepX, stepY, index, direction) +{ + if (scaleY === undefined || scaleY === null) { scaleY = scaleX; } + + PropertyValueInc(items, 'scaleX', scaleX, stepX, index, direction); + + return PropertyValueInc(items, 'scaleY', scaleY, stepY, index, direction); +}; + +module.exports = ScaleXY; + + +/***/ }), +/* 557 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueInc = __webpack_require__(34); + +/** + * Takes an array of Game Objects, or any objects that have a public `scaleY` property, + * and then adds the given value to each of their `scaleY` properties. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `ScaleY(group.getChildren(), value, step)` + * + * @function Phaser.Actions.ScaleY + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to be added to the `scaleY` property. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var ScaleY = function (items, value, step, index, direction) +{ + return PropertyValueInc(items, 'scaleY', value, step, index, direction); +}; + +module.exports = ScaleY; + + +/***/ }), +/* 558 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public property `alpha` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetAlpha(group.getChildren(), value, step)` + * + * @function Phaser.Actions.SetAlpha + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to set the property to. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetAlpha = function (items, value, step, index, direction) +{ + return PropertyValueSet(items, 'alpha', value, step, index, direction); +}; + +module.exports = SetAlpha; + + +/***/ }), +/* 559 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public property `blendMode` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetBlendMode(group.getChildren(), value)` + * + * @function Phaser.Actions.SetBlendMode + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to set the property to. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetBlendMode = function (items, value, index, direction) +{ + return PropertyValueSet(items, 'blendMode', value, 0, index, direction); +}; + +module.exports = SetBlendMode; + + +/***/ }), +/* 560 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public property `depth` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetDepth(group.getChildren(), value, step)` + * + * @function Phaser.Actions.SetDepth + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to set the property to. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetDepth = function (items, value, step, index, direction) +{ + return PropertyValueSet(items, 'depth', value, step, index, direction); +}; + +module.exports = SetDepth; + + +/***/ }), +/* 561 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks. + * + * @see {@link Phaser.GameObjects.GameObject#setInteractive} + * + * @function Phaser.Actions.SetHitArea + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {*} hitArea - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {Phaser.Types.Input.HitAreaCallback} hitAreaCallback - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var SetHitArea = function (items, hitArea, hitAreaCallback) +{ + for (var i = 0; i < items.length; i++) + { + items[i].setInteractive(hitArea, hitAreaCallback); + } + + return items; +}; + +module.exports = SetHitArea; + + +/***/ }), +/* 562 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public properties `originX` and `originY` + * and then sets them to the given values. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetOrigin(group.getChildren(), originX, originY, stepX, stepY)` + * + * @function Phaser.Actions.SetOrigin + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} originX - The amount to set the `originX` property to. + * @param {number} [originY] - The amount to set the `originY` property to. If `undefined` or `null` it uses the `originX` value. + * @param {number} [stepX=0] - This is added to the `originX` amount, multiplied by the iteration counter. + * @param {number} [stepY=0] - This is added to the `originY` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetOrigin = function (items, originX, originY, stepX, stepY, index, direction) +{ + if (originY === undefined || originY === null) { originY = originX; } + + PropertyValueSet(items, 'originX', originX, stepX, index, direction); + + return PropertyValueSet(items, 'originY', originY, stepY, index, direction); +}; + +module.exports = SetOrigin; + + +/***/ }), +/* 563 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public property `rotation` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetRotation(group.getChildren(), value, step)` + * + * @function Phaser.Actions.SetRotation + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to set the property to. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetRotation = function (items, value, step, index, direction) +{ + return PropertyValueSet(items, 'rotation', value, step, index, direction); +}; + +module.exports = SetRotation; + + +/***/ }), +/* 564 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public properties `scaleX` and `scaleY` + * and then sets them to the given values. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetScale(group.getChildren(), scaleX, scaleY, stepX, stepY)` + * + * @function Phaser.Actions.SetScale + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} scaleX - The amount to set the `scaleX` property to. + * @param {number} [scaleY] - The amount to set the `scaleY` property to. If `undefined` or `null` it uses the `scaleX` value. + * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter. + * @param {number} [stepY=0] - This is added to the `scaleY` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetScale = function (items, scaleX, scaleY, stepX, stepY, index, direction) +{ + if (scaleY === undefined || scaleY === null) { scaleY = scaleX; } + + PropertyValueSet(items, 'scaleX', scaleX, stepX, index, direction); + + return PropertyValueSet(items, 'scaleY', scaleY, stepY, index, direction); +}; + +module.exports = SetScale; + + +/***/ }), +/* 565 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public property `scaleX` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetScaleX(group.getChildren(), value, step)` + * + * @function Phaser.Actions.SetScaleX + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to set the property to. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetScaleX = function (items, value, step, index, direction) +{ + return PropertyValueSet(items, 'scaleX', value, step, index, direction); +}; + +module.exports = SetScaleX; + + +/***/ }), +/* 566 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public property `scaleY` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetScaleY(group.getChildren(), value, step)` + * + * @function Phaser.Actions.SetScaleY + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to set the property to. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetScaleY = function (items, value, step, index, direction) +{ + return PropertyValueSet(items, 'scaleY', value, step, index, direction); +}; + +module.exports = SetScaleY; + + +/***/ }), +/* 567 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of Game Objects, or any objects that have the public method setTint() and then updates it to the given value(s). You can specify tint color per corner or provide only one color value for `topLeft` parameter, in which case whole item will be tinted with that color. + * + * @function Phaser.Actions.SetTint + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {number} topLeft - The tint being applied to top-left corner of item. If other parameters are given no value, this tint will be applied to whole item. + * @param {number} [topRight] - The tint to be applied to top-right corner of item. + * @param {number} [bottomLeft] - The tint to be applied to the bottom-left corner of item. + * @param {number} [bottomRight] - The tint to be applied to the bottom-right corner of item. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var SetTint = function (items, topLeft, topRight, bottomLeft, bottomRight) +{ + for (var i = 0; i < items.length; i++) + { + items[i].setTint(topLeft, topRight, bottomLeft, bottomRight); + } + + return items; +}; + +module.exports = SetTint; + + +/***/ }), +/* 568 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public property `visible` + * and then sets it to the given value. + * + * To use this with a Group: `SetVisible(group.getChildren(), value)` + * + * @function Phaser.Actions.SetVisible + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {boolean} value - The value to set the property to. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetVisible = function (items, value, index, direction) +{ + return PropertyValueSet(items, 'visible', value, 0, index, direction); +}; + +module.exports = SetVisible; + + +/***/ }), +/* 569 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public property `x` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetX(group.getChildren(), value, step)` + * + * @function Phaser.Actions.SetX + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to set the property to. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetX = function (items, value, step, index, direction) +{ + return PropertyValueSet(items, 'x', value, step, index, direction); +}; + +module.exports = SetX; + + +/***/ }), +/* 570 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public properties `x` and `y` + * and then sets them to the given values. + * + * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetXY(group.getChildren(), x, y, stepX, stepY)` + * + * @function Phaser.Actions.SetXY + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} x - The amount to set the `x` property to. + * @param {number} [y=x] - The amount to set the `y` property to. If `undefined` or `null` it uses the `x` value. + * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter. + * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetXY = function (items, x, y, stepX, stepY, index, direction) +{ + if (y === undefined || y === null) { y = x; } + + PropertyValueSet(items, 'x', x, stepX, index, direction); + + return PropertyValueSet(items, 'y', y, stepY, index, direction); +}; + +module.exports = SetXY; + + +/***/ }), +/* 571 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PropertyValueSet = __webpack_require__(27); + +/** + * Takes an array of Game Objects, or any objects that have the public property `y` + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `SetY(group.getChildren(), value, step)` + * + * @function Phaser.Actions.SetY + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {number} value - The amount to set the property to. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var SetY = function (items, value, step, index, direction) +{ + return PropertyValueSet(items, 'y', value, step, index, direction); +}; + +module.exports = SetY; + + +/***/ }), +/* 572 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(4); + +/** + * Iterate through the items array changing the position of each element to be that of the element that came before + * it in the array (or after it if direction = 1) + * + * The first items position is set to x/y. + * + * The final x/y coords are returned + * + * @function Phaser.Actions.ShiftPosition + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items] + * @generic {Phaser.Math.Vector2} O - [output,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {number} x - The x coordinate to place the first item in the array at. + * @param {number} y - The y coordinate to place the first item in the array at. + * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. + * @param {(Phaser.Math.Vector2|object)} [output] - An optional objec to store the final objects position in. + * + * @return {Phaser.Math.Vector2} The output vector. + */ +var ShiftPosition = function (items, x, y, direction, output) +{ + if (direction === undefined) { direction = 0; } + if (output === undefined) { output = new Vector2(); } + + var px; + var py; + + if (items.length > 1) + { + var i; + var cx; + var cy; + var cur; + + if (direction === 0) + { + // Bottom to Top + + var len = items.length - 1; + + px = items[len].x; + py = items[len].y; + + for (i = len - 1; i >= 0; i--) + { + // Current item + cur = items[i]; + + // Get current item x/y, to be passed to the next item in the list + cx = cur.x; + cy = cur.y; + + // Set current item to the previous items x/y + cur.x = px; + cur.y = py; + + // Set current as previous + px = cx; + py = cy; + } + + // Update the head item to the new x/y coordinates + items[len].x = x; + items[len].y = y; + } + else + { + // Top to Bottom + + px = items[0].x; + py = items[0].y; + + for (i = 1; i < items.length; i++) + { + // Current item + cur = items[i]; + + // Get current item x/y, to be passed to the next item in the list + cx = cur.x; + cy = cur.y; + + // Set current item to the previous items x/y + cur.x = px; + cur.y = py; + + // Set current as previous + px = cx; + py = cy; + } + + // Update the head item to the new x/y coordinates + items[0].x = x; + items[0].y = y; + } + } + else + { + px = items[0].x; + py = items[0].y; + + items[0].x = x; + items[0].y = y; + } + + // Return the final set of coordinates as they're effectively lost from the shift and may be needed + + output.x = px; + output.y = py; + + return output; +}; + +module.exports = ShiftPosition; + + +/***/ }), +/* 573 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArrayShuffle = __webpack_require__(111); + +/** + * Shuffles the array in place. The shuffled array is both modified and returned. + * + * @function Phaser.Actions.Shuffle + * @since 3.0.0 + * @see Phaser.Utils.Array.Shuffle + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var Shuffle = function (items) +{ + return ArrayShuffle(items); +}; + +module.exports = Shuffle; + + +/***/ }), +/* 574 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathSmootherStep = __webpack_require__(155); + +/** + * Smootherstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. + * + * @function Phaser.Actions.SmootherStep + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {string} property - The property of the Game Object to interpolate. + * @param {number} min - The minimum interpolation value. + * @param {number} max - The maximum interpolation value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var SmootherStep = function (items, property, min, max, inc) +{ + if (inc === undefined) { inc = false; } + + var step = Math.abs(max - min) / items.length; + var i; + + if (inc) + { + for (i = 0; i < items.length; i++) + { + items[i][property] += MathSmootherStep(i * step, min, max); + } + } + else + { + for (i = 0; i < items.length; i++) + { + items[i][property] = MathSmootherStep(i * step, min, max); + } + } + + return items; +}; + +module.exports = SmootherStep; + + +/***/ }), +/* 575 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathSmoothStep = __webpack_require__(156); + +/** + * Smoothstep is a sigmoid-like interpolation and clamping function. + * + * The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques. + * + * @function Phaser.Actions.SmoothStep + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {string} property - The property of the Game Object to interpolate. + * @param {number} min - The minimum interpolation value. + * @param {number} max - The maximum interpolation value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var SmoothStep = function (items, property, min, max, inc) +{ + if (inc === undefined) { inc = false; } + + var step = Math.abs(max - min) / items.length; + var i; + + if (inc) + { + for (i = 0; i < items.length; i++) + { + items[i][property] += MathSmoothStep(i * step, min, max); + } + } + else + { + for (i = 0; i < items.length; i++) + { + items[i][property] = MathSmoothStep(i * step, min, max); + } + } + + return items; +}; + +module.exports = SmoothStep; + + +/***/ }), +/* 576 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of Game Objects and then modifies their `property` so the value equals, or is incremented, by the + * calculated spread value. + * + * The spread value is derived from the given `min` and `max` values and the total number of items in the array. + * + * For example, to cause an array of Sprites to change in alpha from 0 to 1 you could call: + * + * ```javascript + * Phaser.Actions.Spread(itemsArray, 'alpha', 0, 1); + * ``` + * + * @function Phaser.Actions.Spread + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {string} property - The property of the Game Object to spread. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * @param {boolean} [inc=false] - Should the values be incremented? `true` or set (`false`) + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that were passed to this Action. + */ +var Spread = function (items, property, min, max, inc) +{ + if (inc === undefined) { inc = false; } + + var step = Math.abs(max - min) / items.length; + var i; + + if (inc) + { + for (i = 0; i < items.length; i++) + { + items[i][property] += i * step + min; + } + } + else + { + for (i = 0; i < items.length; i++) + { + items[i][property] = i * step + min; + } + } + + return items; +}; + +module.exports = Spread; + + +/***/ }), +/* 577 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of Game Objects and toggles the visibility of each one. + * Those previously `visible = false` will become `visible = true`, and vice versa. + * + * @function Phaser.Actions.ToggleVisible + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var ToggleVisible = function (items) +{ + for (var i = 0; i < items.length; i++) + { + items[i].visible = !items[i].visible; + } + + return items; +}; + +module.exports = ToggleVisible; + + +/***/ }), +/* 578 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author samme + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(56); + +/** + * Wrap each item's coordinates within a rectangle's area. + * + * @function Phaser.Actions.WrapInRectangle + * @since 3.0.0 + * @see Phaser.Math.Wrap + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. + * @param {Phaser.Geom.Rectangle} rect - The rectangle. + * @param {number} [padding=0] - An amount added to each side of the rectangle during the operation. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. + */ +var WrapInRectangle = function (items, rect, padding) +{ + if (padding === undefined) + { + padding = 0; + } + + for (var i = 0; i < items.length; i++) + { + var item = items[i]; + + item.x = Wrap(item.x, rect.left - padding, rect.right + padding); + item.y = Wrap(item.y, rect.top - padding, rect.bottom + padding); + } + + return items; +}; + +module.exports = WrapInRectangle; + + +/***/ }), +/* 579 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Animations + */ + +module.exports = { + + Animation: __webpack_require__(146), + AnimationFrame: __webpack_require__(246), + AnimationManager: __webpack_require__(264), + Events: __webpack_require__(107) + +}; + + +/***/ }), +/* 580 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Blur Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps + * tab, or if they simply remove focus from the browser to another app. + * + * @event Phaser.Core.Events#BLUR + * @since 3.0.0 + */ +module.exports = 'blur'; + + +/***/ }), +/* 581 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Boot Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. + * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. + * + * @event Phaser.Core.Events#BOOT + * @since 3.0.0 + */ +module.exports = 'boot'; + + +/***/ }), +/* 582 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Destroy Event. + * + * This event is dispatched when the game instance has been told to destroy itself. + * Lots of internal systems listen to this event in order to clear themselves out. + * Custom plugins and game code should also do the same. + * + * @event Phaser.Core.Events#DESTROY + * @since 3.0.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 583 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Focus Event. + * + * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded + * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. + * + * @event Phaser.Core.Events#FOCUS + * @since 3.0.0 + */ +module.exports = 'focus'; + + +/***/ }), +/* 584 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Hidden Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted. + * + * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which + * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something + * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) + * + * @event Phaser.Core.Events#HIDDEN + * @since 3.0.0 + */ +module.exports = 'hidden'; + + +/***/ }), +/* 585 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pause Event. + * + * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. + * + * @event Phaser.Core.Events#PAUSE + * @since 3.0.0 + */ +module.exports = 'pause'; + + +/***/ }), +/* 586 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Post-Render Event. + * + * This event is dispatched right at the end of the render process. + * + * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. + * Use it for any last minute post-processing before the next game step begins. + * + * @event Phaser.Core.Events#POST_RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. + */ +module.exports = 'postrender'; + + +/***/ }), +/* 587 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Post-Step Event. + * + * This event is dispatched after the Scene Manager has updated. + * Hook into it from plugins or systems that need to do things before the render starts. + * + * @event Phaser.Core.Events#POST_STEP + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'poststep'; + + +/***/ }), +/* 588 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pre-Render Event. + * + * This event is dispatched immediately before any of the Scenes have started to render. + * + * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. + * + * @event Phaser.Core.Events#PRE_RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. + */ +module.exports = 'prerender'; + + +/***/ }), +/* 589 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Pre-Step Event. + * + * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. + * Hook into it from plugins or systems that need to update before the Scene Manager does. + * + * @event Phaser.Core.Events#PRE_STEP + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'prestep'; + + +/***/ }), +/* 590 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Ready Event. + * + * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, + * and all local systems are now able to start. + * + * @event Phaser.Core.Events#READY + * @since 3.0.0 + */ +module.exports = 'ready'; + + +/***/ }), +/* 591 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Resume Event. + * + * This event is dispatched when the game loop leaves a paused state and resumes running. + * + * @event Phaser.Core.Events#RESUME + * @since 3.0.0 + */ +module.exports = 'resume'; + + +/***/ }), +/* 592 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Step Event. + * + * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. + * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. + * + * @event Phaser.Core.Events#STEP + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'step'; + + +/***/ }), +/* 593 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Visible Event. + * + * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded + * enters a visible state, previously having been hidden. + * + * Only browsers that support the Visibility API will cause this event to be emitted. + * + * @event Phaser.Core.Events#VISIBLE + * @since 3.0.0 + */ +module.exports = 'visible'; + + +/***/ }), +/* 594 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Cache + */ + +module.exports = { + + BaseCache: __webpack_require__(265), + CacheManager: __webpack_require__(267), + Events: __webpack_require__(266) + +}; + + +/***/ }), +/* 595 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Cache Add Event. + * + * This event is dispatched by any Cache that extends the BaseCache each time a new object is added to it. + * + * @event Phaser.Cache.Events#ADD + * @since 3.0.0 + * + * @param {Phaser.Cache.BaseCache} cache - The cache to which the object was added. + * @param {string} key - The key of the object added to the cache. + * @param {*} object - A reference to the object that was added to the cache. + */ +module.exports = 'add'; + + +/***/ }), +/* 596 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Cache Remove Event. + * + * This event is dispatched by any Cache that extends the BaseCache each time an object is removed from it. + * + * @event Phaser.Cache.Events#REMOVE + * @since 3.0.0 + * + * @param {Phaser.Cache.BaseCache} cache - The cache from which the object was removed. + * @param {string} key - The key of the object removed from the cache. + * @param {*} object - A reference to the object that was removed from the cache. + */ +module.exports = 'remove'; + + +/***/ }), +/* 597 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Cameras + */ + +/** + * @namespace Phaser.Types.Cameras + */ + +module.exports = { + + Controls: __webpack_require__(598), + Scene2D: __webpack_require__(601) + +}; + + +/***/ }), +/* 598 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Cameras.Controls + */ + +module.exports = { + + FixedKeyControl: __webpack_require__(599), + SmoothedKeyControl: __webpack_require__(600) + +}; + + +/***/ }), +/* 599 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetValue = __webpack_require__(6); + +/** + * @classdesc + * A Fixed Key Camera Control. + * + * This allows you to control the movement and zoom of a camera using the defined keys. + * + * ```javascript + * var camControl = new FixedKeyControl({ + * camera: this.cameras.main, + * left: cursors.left, + * right: cursors.right, + * speed: float OR { x: 0, y: 0 } + * }); + * ``` + * + * Movement is precise and has no 'smoothing' applied to it. + * + * You must call the `update` method of this controller every frame. + * + * @class FixedKeyControl + * @memberof Phaser.Cameras.Controls + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.Cameras.Controls.FixedKeyControlConfig} config - The Fixed Key Control configuration object. + */ +var FixedKeyControl = new Class({ + + initialize: + + function FixedKeyControl (config) + { + /** + * The Camera that this Control will update. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#camera + * @type {?Phaser.Cameras.Scene2D.Camera} + * @default null + * @since 3.0.0 + */ + this.camera = GetValue(config, 'camera', null); + + /** + * The Key to be pressed that will move the Camera left. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#left + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.left = GetValue(config, 'left', null); + + /** + * The Key to be pressed that will move the Camera right. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#right + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.right = GetValue(config, 'right', null); + + /** + * The Key to be pressed that will move the Camera up. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#up + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.up = GetValue(config, 'up', null); + + /** + * The Key to be pressed that will move the Camera down. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#down + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.down = GetValue(config, 'down', null); + + /** + * The Key to be pressed that will zoom the Camera in. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#zoomIn + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.zoomIn = GetValue(config, 'zoomIn', null); + + /** + * The Key to be pressed that will zoom the Camera out. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#zoomOut + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.zoomOut = GetValue(config, 'zoomOut', null); + + /** + * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#zoomSpeed + * @type {number} + * @default 0.01 + * @since 3.0.0 + */ + this.zoomSpeed = GetValue(config, 'zoomSpeed', 0.01); + + /** + * The horizontal speed the camera will move. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#speedX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.speedX = 0; + + /** + * The vertical speed the camera will move. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#speedY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.speedY = 0; + + var speed = GetValue(config, 'speed', null); + + if (typeof speed === 'number') + { + this.speedX = speed; + this.speedY = speed; + } + else + { + this.speedX = GetValue(config, 'speed.x', 0); + this.speedY = GetValue(config, 'speed.y', 0); + } + + /** + * Internal property to track the current zoom level. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#_zoom + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._zoom = 0; + + /** + * A flag controlling if the Controls will update the Camera or not. + * + * @name Phaser.Cameras.Controls.FixedKeyControl#active + * @type {boolean} + * @since 3.0.0 + */ + this.active = (this.camera !== null); + }, + + /** + * Starts the Key Control running, providing it has been linked to a camera. + * + * @method Phaser.Cameras.Controls.FixedKeyControl#start + * @since 3.0.0 + * + * @return {Phaser.Cameras.Controls.FixedKeyControl} This Key Control instance. + */ + start: function () + { + this.active = (this.camera !== null); + + return this; + }, + + /** + * Stops this Key Control from running. Call `start` to start it again. + * + * @method Phaser.Cameras.Controls.FixedKeyControl#stop + * @since 3.0.0 + * + * @return {Phaser.Cameras.Controls.FixedKeyControl} This Key Control instance. + */ + stop: function () + { + this.active = false; + + return this; + }, + + /** + * Binds this Key Control to a camera. + * + * @method Phaser.Cameras.Controls.FixedKeyControl#setCamera + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to bind this Key Control to. + * + * @return {Phaser.Cameras.Controls.FixedKeyControl} This Key Control instance. + */ + setCamera: function (camera) + { + this.camera = camera; + + return this; + }, + + /** + * Applies the results of pressing the control keys to the Camera. + * + * You must call this every step, it is not called automatically. + * + * @method Phaser.Cameras.Controls.FixedKeyControl#update + * @since 3.0.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update: function (delta) + { + if (!this.active) + { + return; + } + + if (delta === undefined) { delta = 1; } + + var cam = this.camera; + + if (this.up && this.up.isDown) + { + cam.scrollY -= ((this.speedY * delta) | 0); + } + else if (this.down && this.down.isDown) + { + cam.scrollY += ((this.speedY * delta) | 0); + } + + if (this.left && this.left.isDown) + { + cam.scrollX -= ((this.speedX * delta) | 0); + } + else if (this.right && this.right.isDown) + { + cam.scrollX += ((this.speedX * delta) | 0); + } + + // Camera zoom + + if (this.zoomIn && this.zoomIn.isDown) + { + cam.zoom -= this.zoomSpeed; + + if (cam.zoom < 0.1) + { + cam.zoom = 0.1; + } + } + else if (this.zoomOut && this.zoomOut.isDown) + { + cam.zoom += this.zoomSpeed; + } + }, + + /** + * Destroys this Key Control. + * + * @method Phaser.Cameras.Controls.FixedKeyControl#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.camera = null; + + this.left = null; + this.right = null; + this.up = null; + this.down = null; + + this.zoomIn = null; + this.zoomOut = null; + } + +}); + +module.exports = FixedKeyControl; + + +/***/ }), +/* 600 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetValue = __webpack_require__(6); + +/** + * @classdesc + * A Smoothed Key Camera Control. + * + * This allows you to control the movement and zoom of a camera using the defined keys. + * Unlike the Fixed Camera Control you can also provide physics values for acceleration, drag and maxSpeed for smoothing effects. + * + * ```javascript + * var controlConfig = { + * camera: this.cameras.main, + * left: cursors.left, + * right: cursors.right, + * up: cursors.up, + * down: cursors.down, + * zoomIn: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.Q), + * zoomOut: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.E), + * zoomSpeed: 0.02, + * acceleration: 0.06, + * drag: 0.0005, + * maxSpeed: 1.0 + * }; + * ``` + * + * You must call the `update` method of this controller every frame. + * + * @class SmoothedKeyControl + * @memberof Phaser.Cameras.Controls + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.Cameras.Controls.SmoothedKeyControlConfig} config - The Smoothed Key Control configuration object. + */ +var SmoothedKeyControl = new Class({ + + initialize: + + function SmoothedKeyControl (config) + { + /** + * The Camera that this Control will update. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#camera + * @type {?Phaser.Cameras.Scene2D.Camera} + * @default null + * @since 3.0.0 + */ + this.camera = GetValue(config, 'camera', null); + + /** + * The Key to be pressed that will move the Camera left. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#left + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.left = GetValue(config, 'left', null); + + /** + * The Key to be pressed that will move the Camera right. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#right + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.right = GetValue(config, 'right', null); + + /** + * The Key to be pressed that will move the Camera up. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#up + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.up = GetValue(config, 'up', null); + + /** + * The Key to be pressed that will move the Camera down. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#down + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.down = GetValue(config, 'down', null); + + /** + * The Key to be pressed that will zoom the Camera in. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#zoomIn + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.zoomIn = GetValue(config, 'zoomIn', null); + + /** + * The Key to be pressed that will zoom the Camera out. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#zoomOut + * @type {?Phaser.Input.Keyboard.Key} + * @default null + * @since 3.0.0 + */ + this.zoomOut = GetValue(config, 'zoomOut', null); + + /** + * The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#zoomSpeed + * @type {number} + * @default 0.01 + * @since 3.0.0 + */ + this.zoomSpeed = GetValue(config, 'zoomSpeed', 0.01); + + /** + * The horizontal acceleration the camera will move. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#accelX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.accelX = 0; + + /** + * The vertical acceleration the camera will move. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#accelY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.accelY = 0; + + var accel = GetValue(config, 'acceleration', null); + + if (typeof accel === 'number') + { + this.accelX = accel; + this.accelY = accel; + } + else + { + this.accelX = GetValue(config, 'acceleration.x', 0); + this.accelY = GetValue(config, 'acceleration.y', 0); + } + + /** + * The horizontal drag applied to the camera when it is moving. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#dragX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.dragX = 0; + + /** + * The vertical drag applied to the camera when it is moving. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#dragY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.dragY = 0; + + var drag = GetValue(config, 'drag', null); + + if (typeof drag === 'number') + { + this.dragX = drag; + this.dragY = drag; + } + else + { + this.dragX = GetValue(config, 'drag.x', 0); + this.dragY = GetValue(config, 'drag.y', 0); + } + + /** + * The maximum horizontal speed the camera will move. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#maxSpeedX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.maxSpeedX = 0; + + /** + * The maximum vertical speed the camera will move. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#maxSpeedY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.maxSpeedY = 0; + + var maxSpeed = GetValue(config, 'maxSpeed', null); + + if (typeof maxSpeed === 'number') + { + this.maxSpeedX = maxSpeed; + this.maxSpeedY = maxSpeed; + } + else + { + this.maxSpeedX = GetValue(config, 'maxSpeed.x', 0); + this.maxSpeedY = GetValue(config, 'maxSpeed.y', 0); + } + + /** + * Internal property to track the speed of the control. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#_speedX + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._speedX = 0; + + /** + * Internal property to track the speed of the control. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#_speedY + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._speedY = 0; + + /** + * Internal property to track the zoom of the control. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#_zoom + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._zoom = 0; + + /** + * A flag controlling if the Controls will update the Camera or not. + * + * @name Phaser.Cameras.Controls.SmoothedKeyControl#active + * @type {boolean} + * @since 3.0.0 + */ + this.active = (this.camera !== null); + }, + + /** + * Starts the Key Control running, providing it has been linked to a camera. + * + * @method Phaser.Cameras.Controls.SmoothedKeyControl#start + * @since 3.0.0 + * + * @return {Phaser.Cameras.Controls.SmoothedKeyControl} This Key Control instance. + */ + start: function () + { + this.active = (this.camera !== null); + + return this; + }, + + /** + * Stops this Key Control from running. Call `start` to start it again. + * + * @method Phaser.Cameras.Controls.SmoothedKeyControl#stop + * @since 3.0.0 + * + * @return {Phaser.Cameras.Controls.SmoothedKeyControl} This Key Control instance. + */ + stop: function () + { + this.active = false; + + return this; + }, + + /** + * Binds this Key Control to a camera. + * + * @method Phaser.Cameras.Controls.SmoothedKeyControl#setCamera + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to bind this Key Control to. + * + * @return {Phaser.Cameras.Controls.SmoothedKeyControl} This Key Control instance. + */ + setCamera: function (camera) + { + this.camera = camera; + + return this; + }, + + /** + * Applies the results of pressing the control keys to the Camera. + * + * You must call this every step, it is not called automatically. + * + * @method Phaser.Cameras.Controls.SmoothedKeyControl#update + * @since 3.0.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update: function (delta) + { + if (!this.active) + { + return; + } + + if (delta === undefined) { delta = 1; } + + var cam = this.camera; + + // Apply Deceleration + + if (this._speedX > 0) + { + this._speedX -= this.dragX * delta; + + if (this._speedX < 0) + { + this._speedX = 0; + } + } + else if (this._speedX < 0) + { + this._speedX += this.dragX * delta; + + if (this._speedX > 0) + { + this._speedX = 0; + } + } + + if (this._speedY > 0) + { + this._speedY -= this.dragY * delta; + + if (this._speedY < 0) + { + this._speedY = 0; + } + } + else if (this._speedY < 0) + { + this._speedY += this.dragY * delta; + + if (this._speedY > 0) + { + this._speedY = 0; + } + } + + // Check for keys + + if (this.up && this.up.isDown) + { + this._speedY += this.accelY; + + if (this._speedY > this.maxSpeedY) + { + this._speedY = this.maxSpeedY; + } + } + else if (this.down && this.down.isDown) + { + this._speedY -= this.accelY; + + if (this._speedY < -this.maxSpeedY) + { + this._speedY = -this.maxSpeedY; + } + } + + if (this.left && this.left.isDown) + { + this._speedX += this.accelX; + + if (this._speedX > this.maxSpeedX) + { + this._speedX = this.maxSpeedX; + } + } + else if (this.right && this.right.isDown) + { + this._speedX -= this.accelX; + + if (this._speedX < -this.maxSpeedX) + { + this._speedX = -this.maxSpeedX; + } + } + + // Camera zoom + + if (this.zoomIn && this.zoomIn.isDown) + { + this._zoom = -this.zoomSpeed; + } + else if (this.zoomOut && this.zoomOut.isDown) + { + this._zoom = this.zoomSpeed; + } + else + { + this._zoom = 0; + } + + // Apply to Camera + + if (this._speedX !== 0) + { + cam.scrollX -= ((this._speedX * delta) | 0); + } + + if (this._speedY !== 0) + { + cam.scrollY -= ((this._speedY * delta) | 0); + } + + if (this._zoom !== 0) + { + cam.zoom += this._zoom; + + if (cam.zoom < 0.1) + { + cam.zoom = 0.1; + } + } + }, + + /** + * Destroys this Key Control. + * + * @method Phaser.Cameras.Controls.SmoothedKeyControl#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.camera = null; + + this.left = null; + this.right = null; + this.up = null; + this.down = null; + + this.zoomIn = null; + this.zoomOut = null; + } + +}); + +module.exports = SmoothedKeyControl; + + +/***/ }), +/* 601 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Cameras.Scene2D + */ + +module.exports = { + + Camera: __webpack_require__(268), + CameraManager: __webpack_require__(654), + Effects: __webpack_require__(276), + Events: __webpack_require__(48) + +}; + + +/***/ }), +/* 602 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Destroy Camera Event. + * + * This event is dispatched by a Camera instance when it is destroyed by the Camera Manager. + * + * @event Phaser.Cameras.Scene2D.Events#DESTROY + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that was destroyed. + */ +module.exports = 'cameradestroy'; + + +/***/ }), +/* 603 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Fade In Complete Event. + * + * This event is dispatched by a Camera instance when the Fade In Effect completes. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeincomplete', listener)`. + * + * @event Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance. + */ +module.exports = 'camerafadeincomplete'; + + +/***/ }), +/* 604 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Fade In Start Event. + * + * This event is dispatched by a Camera instance when the Fade In Effect starts. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeinstart', listener)`. + * + * @event Phaser.Cameras.Scene2D.Events#FADE_IN_START + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance. + * @param {integer} duration - The duration of the effect. + * @param {integer} red - The red color channel value. + * @param {integer} green - The green color channel value. + * @param {integer} blue - The blue color channel value. + */ +module.exports = 'camerafadeinstart'; + + +/***/ }), +/* 605 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Fade Out Complete Event. + * + * This event is dispatched by a Camera instance when the Fade Out Effect completes. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeoutcomplete', listener)`. + * + * @event Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance. + */ +module.exports = 'camerafadeoutcomplete'; + + +/***/ }), +/* 606 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Fade Out Start Event. + * + * This event is dispatched by a Camera instance when the Fade Out Effect starts. + * + * Listen to it from a Camera instance using `Camera.on('camerafadeoutstart', listener)`. + * + * @event Phaser.Cameras.Scene2D.Events#FADE_OUT_START + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance. + * @param {integer} duration - The duration of the effect. + * @param {integer} red - The red color channel value. + * @param {integer} green - The green color channel value. + * @param {integer} blue - The blue color channel value. + */ +module.exports = 'camerafadeoutstart'; + + +/***/ }), +/* 607 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Flash Complete Event. + * + * This event is dispatched by a Camera instance when the Flash Effect completes. + * + * @event Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Flash} effect - A reference to the effect instance. + */ +module.exports = 'cameraflashcomplete'; + + +/***/ }), +/* 608 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Flash Start Event. + * + * This event is dispatched by a Camera instance when the Flash Effect starts. + * + * @event Phaser.Cameras.Scene2D.Events#FLASH_START + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Flash} effect - A reference to the effect instance. + * @param {integer} duration - The duration of the effect. + * @param {integer} red - The red color channel value. + * @param {integer} green - The green color channel value. + * @param {integer} blue - The blue color channel value. + */ +module.exports = 'cameraflashstart'; + + +/***/ }), +/* 609 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Pan Complete Event. + * + * This event is dispatched by a Camera instance when the Pan Effect completes. + * + * @event Phaser.Cameras.Scene2D.Events#PAN_COMPLETE + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Pan} effect - A reference to the effect instance. + */ +module.exports = 'camerapancomplete'; + + +/***/ }), +/* 610 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Pan Start Event. + * + * This event is dispatched by a Camera instance when the Pan Effect starts. + * + * @event Phaser.Cameras.Scene2D.Events#PAN_START + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Pan} effect - A reference to the effect instance. + * @param {integer} duration - The duration of the effect. + * @param {number} x - The destination scroll x coordinate. + * @param {number} y - The destination scroll y coordinate. + */ +module.exports = 'camerapanstart'; + + +/***/ }), +/* 611 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Post-Render Event. + * + * This event is dispatched by a Camera instance after is has finished rendering. + * It is only dispatched if the Camera is rendering to a texture. + * + * Listen to it from a Camera instance using: `camera.on('postrender', listener)`. + * + * @event Phaser.Cameras.Scene2D.Events#POST_RENDER + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that has finished rendering to a texture. + */ +module.exports = 'postrender'; + + +/***/ }), +/* 612 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Pre-Render Event. + * + * This event is dispatched by a Camera instance when it is about to render. + * It is only dispatched if the Camera is rendering to a texture. + * + * Listen to it from a Camera instance using: `camera.on('prerender', listener)`. + * + * @event Phaser.Cameras.Scene2D.Events#PRE_RENDER + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that is about to render to a texture. + */ +module.exports = 'prerender'; + + +/***/ }), +/* 613 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Shake Complete Event. + * + * This event is dispatched by a Camera instance when the Shake Effect completes. + * + * @event Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Shake} effect - A reference to the effect instance. + */ +module.exports = 'camerashakecomplete'; + + +/***/ }), +/* 614 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Shake Start Event. + * + * This event is dispatched by a Camera instance when the Shake Effect starts. + * + * @event Phaser.Cameras.Scene2D.Events#SHAKE_START + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Shake} effect - A reference to the effect instance. + * @param {integer} duration - The duration of the effect. + * @param {number} intensity - The intensity of the effect. + */ +module.exports = 'camerashakestart'; + + +/***/ }), +/* 615 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Zoom Complete Event. + * + * This event is dispatched by a Camera instance when the Zoom Effect completes. + * + * @event Phaser.Cameras.Scene2D.Events#ZOOM_COMPLETE + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Zoom} effect - A reference to the effect instance. + */ +module.exports = 'camerazoomcomplete'; + + +/***/ }), +/* 616 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Zoom Start Event. + * + * This event is dispatched by a Camera instance when the Zoom Effect starts. + * + * @event Phaser.Cameras.Scene2D.Events#ZOOM_START + * @since 3.3.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. + * @param {Phaser.Cameras.Scene2D.Effects.Zoom} effect - A reference to the effect instance. + * @param {integer} duration - The duration of the effect. + * @param {number} zoom - The destination zoom value. + */ +module.exports = 'camerazoomstart'; + + +/***/ }), +/* 617 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); +var Class = __webpack_require__(0); +var Events = __webpack_require__(48); + +/** + * @classdesc + * A Camera Fade effect. + * + * This effect will fade the camera viewport to the given color, over the duration specified. + * + * Only the camera viewport is faded. None of the objects it is displaying are impacted, i.e. their colors do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect, if required. + * + * @class Fade + * @memberof Phaser.Cameras.Scene2D.Effects + * @constructor + * @since 3.5.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon. + */ +var Fade = new Class({ + + initialize: + + function Fade (camera) + { + /** + * The Camera this effect belongs to. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#camera + * @type {Phaser.Cameras.Scene2D.Camera} + * @readonly + * @since 3.5.0 + */ + this.camera = camera; + + /** + * Is this effect actively running? + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#isRunning + * @type {boolean} + * @readonly + * @default false + * @since 3.5.0 + */ + this.isRunning = false; + + /** + * Has this effect finished running? + * + * This is different from `isRunning` because it remains set to `true` when the effect is over, + * until the effect is either reset or started again. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#isComplete + * @type {boolean} + * @readonly + * @default false + * @since 3.5.0 + */ + this.isComplete = false; + + /** + * The direction of the fade. + * `true` = fade out (transparent to color), `false` = fade in (color to transparent) + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#direction + * @type {boolean} + * @readonly + * @since 3.5.0 + */ + this.direction = true; + + /** + * The duration of the effect, in milliseconds. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#duration + * @type {integer} + * @readonly + * @default 0 + * @since 3.5.0 + */ + this.duration = 0; + + /** + * The value of the red color channel the camera will use for the fade effect. + * A value between 0 and 255. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#red + * @type {integer} + * @private + * @since 3.5.0 + */ + this.red = 0; + + /** + * The value of the green color channel the camera will use for the fade effect. + * A value between 0 and 255. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#green + * @type {integer} + * @private + * @since 3.5.0 + */ + this.green = 0; + + /** + * The value of the blue color channel the camera will use for the fade effect. + * A value between 0 and 255. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#blue + * @type {integer} + * @private + * @since 3.5.0 + */ + this.blue = 0; + + /** + * The value of the alpha channel used during the fade effect. + * A value between 0 and 1. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#alpha + * @type {number} + * @private + * @since 3.5.0 + */ + this.alpha = 0; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#progress + * @type {number} + * @since 3.5.0 + */ + this.progress = 0; + + /** + * Effect elapsed timer. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#_elapsed + * @type {number} + * @private + * @since 3.5.0 + */ + this._elapsed = 0; + + /** + * This callback is invoked every frame for the duration of the effect. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#_onUpdate + * @type {?Phaser.Types.Cameras.Scene2D.CameraFadeCallback} + * @private + * @default null + * @since 3.5.0 + */ + this._onUpdate; + + /** + * On Complete callback scope. + * + * @name Phaser.Cameras.Scene2D.Effects.Fade#_onUpdateScope + * @type {any} + * @private + * @since 3.5.0 + */ + this._onUpdateScope; + }, + + /** + * Fades the Camera to or from the given color over the duration specified. + * + * @method Phaser.Cameras.Scene2D.Effects.Fade#start + * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_START + * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_START + * @since 3.5.0 + * + * @param {boolean} [direction=true] - The direction of the fade. `true` = fade out (transparent to color), `false` = fade in (color to transparent) + * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. + * @param {Phaser.Types.Cameras.Scene2D.CameraFadeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started. + */ + start: function (direction, duration, red, green, blue, force, callback, context) + { + if (direction === undefined) { direction = true; } + if (duration === undefined) { duration = 1000; } + if (red === undefined) { red = 0; } + if (green === undefined) { green = 0; } + if (blue === undefined) { blue = 0; } + if (force === undefined) { force = false; } + if (callback === undefined) { callback = null; } + if (context === undefined) { context = this.camera.scene; } + + if (!force && this.isRunning) + { + return this.camera; + } + + this.isRunning = true; + this.isComplete = false; + this.duration = duration; + this.direction = direction; + this.progress = 0; + + this.red = red; + this.green = green; + this.blue = blue; + this.alpha = (direction) ? Number.MIN_VALUE : 1; + + this._elapsed = 0; + + this._onUpdate = callback; + this._onUpdateScope = context; + + var eventName = (direction) ? Events.FADE_OUT_START : Events.FADE_IN_START; + + this.camera.emit(eventName, this.camera, this, duration, red, green, blue); + + return this.camera; + }, + + /** + * The main update loop for this effect. Called automatically by the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Fade#update + * @since 3.5.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function (time, delta) + { + if (!this.isRunning) + { + return; + } + + this._elapsed += delta; + + this.progress = Clamp(this._elapsed / this.duration, 0, 1); + + if (this._onUpdate) + { + this._onUpdate.call(this._onUpdateScope, this.camera, this.progress); + } + + if (this._elapsed < this.duration) + { + this.alpha = (this.direction) ? this.progress : 1 - this.progress; + } + else + { + this.alpha = (this.direction) ? 1 : 0; + this.effectComplete(); + } + }, + + /** + * Called internally by the Canvas Renderer. + * + * @method Phaser.Cameras.Scene2D.Effects.Fade#postRenderCanvas + * @since 3.5.0 + * + * @param {CanvasRenderingContext2D} ctx - The Canvas context to render to. + * + * @return {boolean} `true` if the effect drew to the renderer, otherwise `false`. + */ + postRenderCanvas: function (ctx) + { + if (!this.isRunning && !this.isComplete) + { + return false; + } + + var camera = this.camera; + + ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')'; + ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch); + + return true; + }, + + /** + * Called internally by the WebGL Renderer. + * + * @method Phaser.Cameras.Scene2D.Effects.Fade#postRenderWebGL + * @since 3.5.0 + * + * @param {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} pipeline - The WebGL Pipeline to render to. + * @param {function} getTintFunction - A function that will return the gl safe tint colors. + * + * @return {boolean} `true` if the effect drew to the renderer, otherwise `false`. + */ + postRenderWebGL: function (pipeline, getTintFunction) + { + if (!this.isRunning && !this.isComplete) + { + return false; + } + + var camera = this.camera; + var red = this.red / 255; + var blue = this.blue / 255; + var green = this.green / 255; + + pipeline.drawFillRect( + camera._cx, camera._cy, camera._cw, camera._ch, + getTintFunction(red, green, blue, 1), + this.alpha + ); + + return true; + }, + + /** + * Called internally when the effect completes. + * + * @method Phaser.Cameras.Scene2D.Effects.Fade#effectComplete + * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE + * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE + * @since 3.5.0 + */ + effectComplete: function () + { + this._onUpdate = null; + this._onUpdateScope = null; + + this.isRunning = false; + this.isComplete = true; + + var eventName = (this.direction) ? Events.FADE_OUT_COMPLETE : Events.FADE_IN_COMPLETE; + + this.camera.emit(eventName, this.camera, this); + }, + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + * + * @method Phaser.Cameras.Scene2D.Effects.Fade#reset + * @since 3.5.0 + */ + reset: function () + { + this.isRunning = false; + this.isComplete = false; + + this._onUpdate = null; + this._onUpdateScope = null; + }, + + /** + * Destroys this effect, releasing it from the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Fade#destroy + * @since 3.5.0 + */ + destroy: function () + { + this.reset(); + + this.camera = null; + } + +}); + +module.exports = Fade; + + +/***/ }), +/* 618 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); +var Class = __webpack_require__(0); +var Events = __webpack_require__(48); + +/** + * @classdesc + * A Camera Flash effect. + * + * This effect will flash the camera viewport to the given color, over the duration specified. + * + * Only the camera viewport is flashed. None of the objects it is displaying are impacted, i.e. their colors do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect, if required. + * + * @class Flash + * @memberof Phaser.Cameras.Scene2D.Effects + * @constructor + * @since 3.5.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon. + */ +var Flash = new Class({ + + initialize: + + function Flash (camera) + { + /** + * The Camera this effect belongs to. + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#camera + * @type {Phaser.Cameras.Scene2D.Camera} + * @readonly + * @since 3.5.0 + */ + this.camera = camera; + + /** + * Is this effect actively running? + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#isRunning + * @type {boolean} + * @readonly + * @default false + * @since 3.5.0 + */ + this.isRunning = false; + + /** + * The duration of the effect, in milliseconds. + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#duration + * @type {integer} + * @readonly + * @default 0 + * @since 3.5.0 + */ + this.duration = 0; + + /** + * The value of the red color channel the camera will use for the fade effect. + * A value between 0 and 255. + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#red + * @type {integer} + * @private + * @since 3.5.0 + */ + this.red = 0; + + /** + * The value of the green color channel the camera will use for the fade effect. + * A value between 0 and 255. + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#green + * @type {integer} + * @private + * @since 3.5.0 + */ + this.green = 0; + + /** + * The value of the blue color channel the camera will use for the fade effect. + * A value between 0 and 255. + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#blue + * @type {integer} + * @private + * @since 3.5.0 + */ + this.blue = 0; + + /** + * The value of the alpha channel used during the fade effect. + * A value between 0 and 1. + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#alpha + * @type {number} + * @private + * @since 3.5.0 + */ + this.alpha = 0; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#progress + * @type {number} + * @since 3.5.0 + */ + this.progress = 0; + + /** + * Effect elapsed timer. + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#_elapsed + * @type {number} + * @private + * @since 3.5.0 + */ + this._elapsed = 0; + + /** + * This callback is invoked every frame for the duration of the effect. + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#_onUpdate + * @type {?Phaser.Types.Cameras.Scene2D.CameraFlashCallback} + * @private + * @default null + * @since 3.5.0 + */ + this._onUpdate; + + /** + * On Complete callback scope. + * + * @name Phaser.Cameras.Scene2D.Effects.Flash#_onUpdateScope + * @type {any} + * @private + * @since 3.5.0 + */ + this._onUpdateScope; + }, + + /** + * Flashes the Camera to or from the given color over the duration specified. + * + * @method Phaser.Cameras.Scene2D.Effects.Flash#start + * @fires Phaser.Cameras.Scene2D.Events#FLASH_START + * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE + * @since 3.5.0 + * + * @param {integer} [duration=250] - The duration of the effect in milliseconds. + * @param {integer} [red=255] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {integer} [green=255] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {integer} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. + * @param {Phaser.Types.Cameras.Scene2D.CameraFlashCallback} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started. + */ + start: function (duration, red, green, blue, force, callback, context) + { + if (duration === undefined) { duration = 250; } + if (red === undefined) { red = 255; } + if (green === undefined) { green = 255; } + if (blue === undefined) { blue = 255; } + if (force === undefined) { force = false; } + if (callback === undefined) { callback = null; } + if (context === undefined) { context = this.camera.scene; } + + if (!force && this.isRunning) + { + return this.camera; + } + + this.isRunning = true; + this.duration = duration; + this.progress = 0; + + this.red = red; + this.green = green; + this.blue = blue; + this.alpha = 1; + + this._elapsed = 0; + + this._onUpdate = callback; + this._onUpdateScope = context; + + this.camera.emit(Events.FLASH_START, this.camera, this, duration, red, green, blue); + + return this.camera; + }, + + /** + * The main update loop for this effect. Called automatically by the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Flash#update + * @since 3.5.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function (time, delta) + { + if (!this.isRunning) + { + return; + } + + this._elapsed += delta; + + this.progress = Clamp(this._elapsed / this.duration, 0, 1); + + if (this._onUpdate) + { + this._onUpdate.call(this._onUpdateScope, this.camera, this.progress); + } + + if (this._elapsed < this.duration) + { + this.alpha = 1 - this.progress; + } + else + { + this.effectComplete(); + } + }, + + /** + * Called internally by the Canvas Renderer. + * + * @method Phaser.Cameras.Scene2D.Effects.Flash#postRenderCanvas + * @since 3.5.0 + * + * @param {CanvasRenderingContext2D} ctx - The Canvas context to render to. + * + * @return {boolean} `true` if the effect drew to the renderer, otherwise `false`. + */ + postRenderCanvas: function (ctx) + { + if (!this.isRunning) + { + return false; + } + + var camera = this.camera; + + ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')'; + ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch); + + return true; + }, + + /** + * Called internally by the WebGL Renderer. + * + * @method Phaser.Cameras.Scene2D.Effects.Flash#postRenderWebGL + * @since 3.5.0 + * + * @param {Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline} pipeline - The WebGL Pipeline to render to. + * @param {function} getTintFunction - A function that will return the gl safe tint colors. + * + * @return {boolean} `true` if the effect drew to the renderer, otherwise `false`. + */ + postRenderWebGL: function (pipeline, getTintFunction) + { + if (!this.isRunning) + { + return false; + } + + var camera = this.camera; + var red = this.red / 255; + var blue = this.blue / 255; + var green = this.green / 255; + + pipeline.drawFillRect( + camera._cx, camera._cy, camera._cw, camera._ch, + getTintFunction(red, green, blue, 1), + this.alpha + ); + + return true; + }, + + /** + * Called internally when the effect completes. + * + * @method Phaser.Cameras.Scene2D.Effects.Flash#effectComplete + * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE + * @since 3.5.0 + */ + effectComplete: function () + { + this._onUpdate = null; + this._onUpdateScope = null; + + this.isRunning = false; + + this.camera.emit(Events.FLASH_COMPLETE, this.camera, this); + }, + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + * + * @method Phaser.Cameras.Scene2D.Effects.Flash#reset + * @since 3.5.0 + */ + reset: function () + { + this.isRunning = false; + + this._onUpdate = null; + this._onUpdateScope = null; + }, + + /** + * Destroys this effect, releasing it from the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Flash#destroy + * @since 3.5.0 + */ + destroy: function () + { + this.reset(); + + this.camera = null; + } + +}); + +module.exports = Flash; + + +/***/ }), +/* 619 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); +var Class = __webpack_require__(0); +var EaseMap = __webpack_require__(163); +var Events = __webpack_require__(48); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Camera Pan effect. + * + * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, + * over the duration and with the ease specified. + * + * Only the camera scroll is moved. None of the objects it is displaying are impacted, i.e. their positions do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect if required. + * + * @class Pan + * @memberof Phaser.Cameras.Scene2D.Effects + * @constructor + * @since 3.11.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon. + */ +var Pan = new Class({ + + initialize: + + function Pan (camera) + { + /** + * The Camera this effect belongs to. + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#camera + * @type {Phaser.Cameras.Scene2D.Camera} + * @readonly + * @since 3.11.0 + */ + this.camera = camera; + + /** + * Is this effect actively running? + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#isRunning + * @type {boolean} + * @readonly + * @default false + * @since 3.11.0 + */ + this.isRunning = false; + + /** + * The duration of the effect, in milliseconds. + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#duration + * @type {integer} + * @readonly + * @default 0 + * @since 3.11.0 + */ + this.duration = 0; + + /** + * The starting scroll coordinates to pan the camera from. + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#source + * @type {Phaser.Math.Vector2} + * @since 3.11.0 + */ + this.source = new Vector2(); + + /** + * The constantly updated value based on zoom. + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#current + * @type {Phaser.Math.Vector2} + * @since 3.11.0 + */ + this.current = new Vector2(); + + /** + * The destination scroll coordinates to pan the camera to. + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#destination + * @type {Phaser.Math.Vector2} + * @since 3.11.0 + */ + this.destination = new Vector2(); + + /** + * The ease function to use during the pan. + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#ease + * @type {function} + * @since 3.11.0 + */ + this.ease; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#progress + * @type {number} + * @since 3.11.0 + */ + this.progress = 0; + + /** + * Effect elapsed timer. + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#_elapsed + * @type {number} + * @private + * @since 3.11.0 + */ + this._elapsed = 0; + + /** + * This callback is invoked every frame for the duration of the effect. + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#_onUpdate + * @type {?Phaser.Types.Cameras.Scene2D.CameraPanCallback} + * @private + * @default null + * @since 3.11.0 + */ + this._onUpdate; + + /** + * On Complete callback scope. + * + * @name Phaser.Cameras.Scene2D.Effects.Pan#_onUpdateScope + * @type {any} + * @private + * @since 3.11.0 + */ + this._onUpdateScope; + }, + + /** + * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, + * over the duration and with the ease specified. + * + * @method Phaser.Cameras.Scene2D.Effects.Pan#start + * @fires Phaser.Cameras.Scene2D.Events#PAN_START + * @fires Phaser.Cameras.Scene2D.Events#PAN_COMPLETE + * @since 3.11.0 + * + * @param {number} x - The destination x coordinate to scroll the center of the Camera viewport to. + * @param {number} y - The destination y coordinate to scroll the center of the Camera viewport to. + * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. + * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. + * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent four arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * the current camera scroll x coordinate and the current camera scroll y coordinate. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started. + */ + start: function (x, y, duration, ease, force, callback, context) + { + if (duration === undefined) { duration = 1000; } + if (ease === undefined) { ease = EaseMap.Linear; } + if (force === undefined) { force = false; } + if (callback === undefined) { callback = null; } + if (context === undefined) { context = this.camera.scene; } + + var cam = this.camera; + + if (!force && this.isRunning) + { + return cam; + } + + this.isRunning = true; + this.duration = duration; + this.progress = 0; + + // Starting from + this.source.set(cam.scrollX, cam.scrollY); + + // Destination + this.destination.set(x, y); + + // Zoom factored version + cam.getScroll(x, y, this.current); + + // Using this ease + if (typeof ease === 'string' && EaseMap.hasOwnProperty(ease)) + { + this.ease = EaseMap[ease]; + } + else if (typeof ease === 'function') + { + this.ease = ease; + } + + this._elapsed = 0; + + this._onUpdate = callback; + this._onUpdateScope = context; + + this.camera.emit(Events.PAN_START, this.camera, this, duration, x, y); + + return cam; + }, + + /** + * The main update loop for this effect. Called automatically by the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Pan#update + * @since 3.11.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function (time, delta) + { + if (!this.isRunning) + { + return; + } + + this._elapsed += delta; + + var progress = Clamp(this._elapsed / this.duration, 0, 1); + + this.progress = progress; + + var cam = this.camera; + + if (this._elapsed < this.duration) + { + var v = this.ease(progress); + + cam.getScroll(this.destination.x, this.destination.y, this.current); + + var x = this.source.x + ((this.current.x - this.source.x) * v); + var y = this.source.y + ((this.current.y - this.source.y) * v); + + cam.setScroll(x, y); + + if (this._onUpdate) + { + this._onUpdate.call(this._onUpdateScope, cam, progress, x, y); + } + } + else + { + cam.centerOn(this.destination.x, this.destination.y); + + if (this._onUpdate) + { + this._onUpdate.call(this._onUpdateScope, cam, progress, cam.scrollX, cam.scrollY); + } + + this.effectComplete(); + } + }, + + /** + * Called internally when the effect completes. + * + * @method Phaser.Cameras.Scene2D.Effects.Pan#effectComplete + * @fires Phaser.Cameras.Scene2D.Events#PAN_COMPLETE + * @since 3.11.0 + */ + effectComplete: function () + { + this._onUpdate = null; + this._onUpdateScope = null; + + this.isRunning = false; + + this.camera.emit(Events.PAN_COMPLETE, this.camera, this); + }, + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + * + * @method Phaser.Cameras.Scene2D.Effects.Pan#reset + * @since 3.11.0 + */ + reset: function () + { + this.isRunning = false; + + this._onUpdate = null; + this._onUpdateScope = null; + }, + + /** + * Destroys this effect, releasing it from the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Pan#destroy + * @since 3.11.0 + */ + destroy: function () + { + this.reset(); + + this.camera = null; + this.source = null; + this.destination = null; + } + +}); + +module.exports = Pan; + + +/***/ }), +/* 620 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-in. + * + * @function Phaser.Math.Easing.Back.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var In = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + return v * v * ((overshoot + 1) * v - overshoot); +}; + +module.exports = In; + + +/***/ }), +/* 621 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-out. + * + * @function Phaser.Math.Easing.Back.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var Out = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + return --v * v * ((overshoot + 1) * v + overshoot) + 1; +}; + +module.exports = Out; + + +/***/ }), +/* 622 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Back ease-in/out. + * + * @function Phaser.Math.Easing.Back.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [overshoot=1.70158] - The overshoot amount. + * + * @return {number} The tweened value. + */ +var InOut = function (v, overshoot) +{ + if (overshoot === undefined) { overshoot = 1.70158; } + + var s = overshoot * 1.525; + + if ((v *= 2) < 1) + { + return 0.5 * (v * v * ((s + 1) * v - s)); + } + else + { + return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2); + } +}; + +module.exports = InOut; + + +/***/ }), +/* 623 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-in. + * + * @function Phaser.Math.Easing.Bounce.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + v = 1 - v; + + if (v < 1 / 2.75) + { + return 1 - (7.5625 * v * v); + } + else if (v < 2 / 2.75) + { + return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75); + } + else if (v < 2.5 / 2.75) + { + return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375); + } + else + { + return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375); + } +}; + +module.exports = In; + + +/***/ }), +/* 624 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-out. + * + * @function Phaser.Math.Easing.Bounce.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + if (v < 1 / 2.75) + { + return 7.5625 * v * v; + } + else if (v < 2 / 2.75) + { + return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; + } + else if (v < 2.5 / 2.75) + { + return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; + } + else + { + return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; + } +}; + +module.exports = Out; + + +/***/ }), +/* 625 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Bounce ease-in/out. + * + * @function Phaser.Math.Easing.Bounce.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + var reverse = false; + + if (v < 0.5) + { + v = 1 - (v * 2); + reverse = true; + } + else + { + v = (v * 2) - 1; + } + + if (v < 1 / 2.75) + { + v = 7.5625 * v * v; + } + else if (v < 2 / 2.75) + { + v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75; + } + else if (v < 2.5 / 2.75) + { + v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375; + } + else + { + v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375; + } + + if (reverse) + { + return (1 - v) * 0.5; + } + else + { + return v * 0.5 + 0.5; + } +}; + +module.exports = InOut; + + +/***/ }), +/* 626 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-in. + * + * @function Phaser.Math.Easing.Circular.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return 1 - Math.sqrt(1 - v * v); +}; + +module.exports = In; + + +/***/ }), +/* 627 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-out. + * + * @function Phaser.Math.Easing.Circular.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return Math.sqrt(1 - (--v * v)); +}; + +module.exports = Out; + + +/***/ }), +/* 628 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Circular ease-in/out. + * + * @function Phaser.Math.Easing.Circular.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return -0.5 * (Math.sqrt(1 - v * v) - 1); + } + else + { + return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1); + } +}; + +module.exports = InOut; + + +/***/ }), +/* 629 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-in. + * + * @function Phaser.Math.Easing.Cubic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v; +}; + +module.exports = In; + + +/***/ }), +/* 630 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-out. + * + * @function Phaser.Math.Easing.Cubic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return --v * v * v + 1; +}; + +module.exports = Out; + + +/***/ }), +/* 631 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Cubic ease-in/out. + * + * @function Phaser.Math.Easing.Cubic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v; + } + else + { + return 0.5 * ((v -= 2) * v * v + 2); + } +}; + +module.exports = InOut; + + +/***/ }), +/* 632 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-in. + * + * @function Phaser.Math.Easing.Elastic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var In = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); + } +}; + +module.exports = In; + + +/***/ }), +/* 633 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-out. + * + * @function Phaser.Math.Easing.Elastic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var Out = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1); + } +}; + +module.exports = Out; + + +/***/ }), +/* 634 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Elastic ease-in/out. + * + * @function Phaser.Math.Easing.Elastic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [amplitude=0.1] - The amplitude of the elastic ease. + * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles. + * + * @return {number} The tweened value. + */ +var InOut = function (v, amplitude, period) +{ + if (amplitude === undefined) { amplitude = 0.1; } + if (period === undefined) { period = 0.1; } + + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + var s = period / 4; + + if (amplitude < 1) + { + amplitude = 1; + } + else + { + s = period * Math.asin(1 / amplitude) / (2 * Math.PI); + } + + if ((v *= 2) < 1) + { + return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period)); + } + else + { + return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1; + } + } +}; + +module.exports = InOut; + + +/***/ }), +/* 635 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-in. + * + * @function Phaser.Math.Easing.Expo.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return Math.pow(2, 10 * (v - 1)) - 0.001; +}; + +module.exports = In; + + +/***/ }), +/* 636 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-out. + * + * @function Phaser.Math.Easing.Expo.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return 1 - Math.pow(2, -10 * v); +}; + +module.exports = Out; + + +/***/ }), +/* 637 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Exponential ease-in/out. + * + * @function Phaser.Math.Easing.Expo.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * Math.pow(2, 10 * (v - 1)); + } + else + { + return 0.5 * (2 - Math.pow(2, -10 * (v - 1))); + } +}; + +module.exports = InOut; + + +/***/ }), +/* 638 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Linear easing (no variation). + * + * @function Phaser.Math.Easing.Linear.Linear + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Linear = function (v) +{ + return v; +}; + +module.exports = Linear; + + +/***/ }), +/* 639 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-in. + * + * @function Phaser.Math.Easing.Quadratic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v; +}; + +module.exports = In; + + +/***/ }), +/* 640 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-out. + * + * @function Phaser.Math.Easing.Quadratic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return v * (2 - v); +}; + +module.exports = Out; + + +/***/ }), +/* 641 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quadratic ease-in/out. + * + * @function Phaser.Math.Easing.Quadratic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v; + } + else + { + return -0.5 * (--v * (v - 2) - 1); + } +}; + +module.exports = InOut; + + +/***/ }), +/* 642 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-in. + * + * @function Phaser.Math.Easing.Quartic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v * v; +}; + +module.exports = In; + + +/***/ }), +/* 643 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-out. + * + * @function Phaser.Math.Easing.Quartic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return 1 - (--v * v * v * v); +}; + +module.exports = Out; + + +/***/ }), +/* 644 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quartic ease-in/out. + * + * @function Phaser.Math.Easing.Quartic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v * v; + } + else + { + return -0.5 * ((v -= 2) * v * v * v - 2); + } +}; + +module.exports = InOut; + + +/***/ }), +/* 645 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-in. + * + * @function Phaser.Math.Easing.Quintic.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + return v * v * v * v * v; +}; + +module.exports = In; + + +/***/ }), +/* 646 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-out. + * + * @function Phaser.Math.Easing.Quintic.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + return --v * v * v * v * v + 1; +}; + +module.exports = Out; + + +/***/ }), +/* 647 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Quintic ease-in/out. + * + * @function Phaser.Math.Easing.Quintic.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if ((v *= 2) < 1) + { + return 0.5 * v * v * v * v * v; + } + else + { + return 0.5 * ((v -= 2) * v * v * v * v + 2); + } +}; + +module.exports = InOut; + + +/***/ }), +/* 648 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-in. + * + * @function Phaser.Math.Easing.Sine.In + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var In = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return 1 - Math.cos(v * Math.PI / 2); + } +}; + +module.exports = In; + + +/***/ }), +/* 649 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-out. + * + * @function Phaser.Math.Easing.Sine.Out + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var Out = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return Math.sin(v * Math.PI / 2); + } +}; + +module.exports = Out; + + +/***/ }), +/* 650 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sinusoidal ease-in/out. + * + * @function Phaser.Math.Easing.Sine.InOut + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * + * @return {number} The tweened value. + */ +var InOut = function (v) +{ + if (v === 0) + { + return 0; + } + else if (v === 1) + { + return 1; + } + else + { + return 0.5 * (1 - Math.cos(Math.PI * v)); + } +}; + +module.exports = InOut; + + +/***/ }), +/* 651 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Stepped easing. + * + * @function Phaser.Math.Easing.Stepped.Stepped + * @since 3.0.0 + * + * @param {number} v - The value to be tweened. + * @param {number} [steps=1] - The number of steps in the ease. + * + * @return {number} The tweened value. + */ +var Stepped = function (v, steps) +{ + if (steps === undefined) { steps = 1; } + + if (v <= 0) + { + return 0; + } + else if (v >= 1) + { + return 1; + } + else + { + return (((steps * v) | 0) + 1) * (1 / steps); + } +}; + +module.exports = Stepped; + + +/***/ }), +/* 652 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); +var Class = __webpack_require__(0); +var Events = __webpack_require__(48); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Camera Shake effect. + * + * This effect will shake the camera viewport by a random amount, bounded by the specified intensity, each frame. + * + * Only the camera viewport is moved. None of the objects it is displaying are impacted, i.e. their positions do + * not change. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect if required. + * + * @class Shake + * @memberof Phaser.Cameras.Scene2D.Effects + * @constructor + * @since 3.5.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon. + */ +var Shake = new Class({ + + initialize: + + function Shake (camera) + { + /** + * The Camera this effect belongs to. + * + * @name Phaser.Cameras.Scene2D.Effects.Shake#camera + * @type {Phaser.Cameras.Scene2D.Camera} + * @readonly + * @since 3.5.0 + */ + this.camera = camera; + + /** + * Is this effect actively running? + * + * @name Phaser.Cameras.Scene2D.Effects.Shake#isRunning + * @type {boolean} + * @readonly + * @default false + * @since 3.5.0 + */ + this.isRunning = false; + + /** + * The duration of the effect, in milliseconds. + * + * @name Phaser.Cameras.Scene2D.Effects.Shake#duration + * @type {integer} + * @readonly + * @default 0 + * @since 3.5.0 + */ + this.duration = 0; + + /** + * The intensity of the effect. Use small float values. The default when the effect starts is 0.05. + * This is a Vector2 object, allowing you to control the shake intensity independently across x and y. + * You can modify this value while the effect is active to create more varied shake effects. + * + * @name Phaser.Cameras.Scene2D.Effects.Shake#intensity + * @type {Phaser.Math.Vector2} + * @since 3.5.0 + */ + this.intensity = new Vector2(); + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + * + * @name Phaser.Cameras.Scene2D.Effects.Shake#progress + * @type {number} + * @since 3.5.0 + */ + this.progress = 0; + + /** + * Effect elapsed timer. + * + * @name Phaser.Cameras.Scene2D.Effects.Shake#_elapsed + * @type {number} + * @private + * @since 3.5.0 + */ + this._elapsed = 0; + + /** + * How much to offset the camera by horizontally. + * + * @name Phaser.Cameras.Scene2D.Effects.Shake#_offsetX + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._offsetX = 0; + + /** + * How much to offset the camera by vertically. + * + * @name Phaser.Cameras.Scene2D.Effects.Shake#_offsetY + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._offsetY = 0; + + /** + * This callback is invoked every frame for the duration of the effect. + * + * @name Phaser.Cameras.Scene2D.Effects.Shake#_onUpdate + * @type {?Phaser.Types.Cameras.Scene2D.CameraShakeCallback} + * @private + * @default null + * @since 3.5.0 + */ + this._onUpdate; + + /** + * On Complete callback scope. + * + * @name Phaser.Cameras.Scene2D.Effects.Shake#_onUpdateScope + * @type {any} + * @private + * @since 3.5.0 + */ + this._onUpdateScope; + }, + + /** + * Shakes the Camera by the given intensity over the duration specified. + * + * @method Phaser.Cameras.Scene2D.Effects.Shake#start + * @fires Phaser.Cameras.Scene2D.Events#SHAKE_START + * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE + * @since 3.5.0 + * + * @param {integer} [duration=100] - The duration of the effect in milliseconds. + * @param {number} [intensity=0.05] - The intensity of the shake. + * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. + * @param {Phaser.Types.Cameras.Scene2D.CameraShakeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started. + */ + start: function (duration, intensity, force, callback, context) + { + if (duration === undefined) { duration = 100; } + if (intensity === undefined) { intensity = 0.05; } + if (force === undefined) { force = false; } + if (callback === undefined) { callback = null; } + if (context === undefined) { context = this.camera.scene; } + + if (!force && this.isRunning) + { + return this.camera; + } + + this.isRunning = true; + this.duration = duration; + this.progress = 0; + + if (typeof intensity === 'number') + { + this.intensity.set(intensity); + } + else + { + this.intensity.set(intensity.x, intensity.y); + } + + this._elapsed = 0; + this._offsetX = 0; + this._offsetY = 0; + + this._onUpdate = callback; + this._onUpdateScope = context; + + this.camera.emit(Events.SHAKE_START, this.camera, this, duration, intensity); + + return this.camera; + }, + + /** + * The pre-render step for this effect. Called automatically by the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Shake#preRender + * @since 3.5.0 + */ + preRender: function () + { + if (this.isRunning) + { + this.camera.matrix.translate(this._offsetX, this._offsetY); + } + }, + + /** + * The main update loop for this effect. Called automatically by the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Shake#update + * @since 3.5.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function (time, delta) + { + if (!this.isRunning) + { + return; + } + + this._elapsed += delta; + + this.progress = Clamp(this._elapsed / this.duration, 0, 1); + + if (this._onUpdate) + { + this._onUpdate.call(this._onUpdateScope, this.camera, this.progress); + } + + if (this._elapsed < this.duration) + { + var intensity = this.intensity; + var width = this.camera._cw; + var height = this.camera._ch; + var zoom = this.camera.zoom; + + this._offsetX = (Math.random() * intensity.x * width * 2 - intensity.x * width) * zoom; + this._offsetY = (Math.random() * intensity.y * height * 2 - intensity.y * height) * zoom; + + if (this.camera.roundPixels) + { + this._offsetX = Math.round(this._offsetX); + this._offsetY = Math.round(this._offsetY); + } + } + else + { + this.effectComplete(); + } + }, + + /** + * Called internally when the effect completes. + * + * @method Phaser.Cameras.Scene2D.Effects.Shake#effectComplete + * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE + * @since 3.5.0 + */ + effectComplete: function () + { + this._offsetX = 0; + this._offsetY = 0; + + this._onUpdate = null; + this._onUpdateScope = null; + + this.isRunning = false; + + this.camera.emit(Events.SHAKE_COMPLETE, this.camera, this); + }, + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + * + * @method Phaser.Cameras.Scene2D.Effects.Shake#reset + * @since 3.5.0 + */ + reset: function () + { + this.isRunning = false; + + this._offsetX = 0; + this._offsetY = 0; + + this._onUpdate = null; + this._onUpdateScope = null; + }, + + /** + * Destroys this effect, releasing it from the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Shake#destroy + * @since 3.5.0 + */ + destroy: function () + { + this.reset(); + + this.camera = null; + this.intensity = null; + } + +}); + +module.exports = Shake; + + +/***/ }), +/* 653 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); +var Class = __webpack_require__(0); +var EaseMap = __webpack_require__(163); +var Events = __webpack_require__(48); + +/** + * @classdesc + * A Camera Zoom effect. + * + * This effect will zoom the Camera to the given scale, over the duration and with the ease specified. + * + * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, + * which is invoked each frame for the duration of the effect if required. + * + * @class Zoom + * @memberof Phaser.Cameras.Scene2D.Effects + * @constructor + * @since 3.11.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera this effect is acting upon. + */ +var Zoom = new Class({ + + initialize: + + function Zoom (camera) + { + /** + * The Camera this effect belongs to. + * + * @name Phaser.Cameras.Scene2D.Effects.Zoom#camera + * @type {Phaser.Cameras.Scene2D.Camera} + * @readonly + * @since 3.11.0 + */ + this.camera = camera; + + /** + * Is this effect actively running? + * + * @name Phaser.Cameras.Scene2D.Effects.Zoom#isRunning + * @type {boolean} + * @readonly + * @default false + * @since 3.11.0 + */ + this.isRunning = false; + + /** + * The duration of the effect, in milliseconds. + * + * @name Phaser.Cameras.Scene2D.Effects.Zoom#duration + * @type {integer} + * @readonly + * @default 0 + * @since 3.11.0 + */ + this.duration = 0; + + /** + * The starting zoom value; + * + * @name Phaser.Cameras.Scene2D.Effects.Zoom#source + * @type {number} + * @since 3.11.0 + */ + this.source = 1; + + /** + * The destination zoom value. + * + * @name Phaser.Cameras.Scene2D.Effects.Zoom#destination + * @type {number} + * @since 3.11.0 + */ + this.destination = 1; + + /** + * The ease function to use during the zoom. + * + * @name Phaser.Cameras.Scene2D.Effects.Zoom#ease + * @type {function} + * @since 3.11.0 + */ + this.ease; + + /** + * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. + * + * @name Phaser.Cameras.Scene2D.Effects.Zoom#progress + * @type {number} + * @since 3.11.0 + */ + this.progress = 0; + + /** + * Effect elapsed timer. + * + * @name Phaser.Cameras.Scene2D.Effects.Zoom#_elapsed + * @type {number} + * @private + * @since 3.11.0 + */ + this._elapsed = 0; + + /** + * This callback is invoked every frame for the duration of the effect. + * + * @name Phaser.Cameras.Scene2D.Effects.Zoom#_onUpdate + * @type {?Phaser.Types.Cameras.Scene2D.CameraZoomCallback} + * @private + * @default null + * @since 3.11.0 + */ + this._onUpdate; + + /** + * On Complete callback scope. + * + * @name Phaser.Cameras.Scene2D.Effects.Zoom#_onUpdateScope + * @type {any} + * @private + * @since 3.11.0 + */ + this._onUpdateScope; + }, + + /** + * This effect will zoom the Camera to the given scale, over the duration and with the ease specified. + * + * @method Phaser.Cameras.Scene2D.Effects.Zoom#start + * @fires Phaser.Cameras.Scene2D.Events#ZOOM_START + * @fires Phaser.Cameras.Scene2D.Events#ZOOM_COMPLETE + * @since 3.11.0 + * + * @param {number} zoom - The target Camera zoom value. + * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {(string|function)} [ease='Linear'] - The ease to use for the Zoom. Can be any of the Phaser Easing constants or a custom function. + * @param {boolean} [force=false] - Force the zoom effect to start immediately, even if already running. + * @param {Phaser.Types.Cameras.Scene2D.CameraZoomCallback} [callback] - This callback will be invoked every frame for the duration of the effect. + * It is sent three arguments: A reference to the camera, a progress amount between 0 and 1 indicating how complete the effect is, + * and the current camera zoom value. + * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. + * + * @return {Phaser.Cameras.Scene2D.Camera} The Camera on which the effect was started. + */ + start: function (zoom, duration, ease, force, callback, context) + { + if (duration === undefined) { duration = 1000; } + if (ease === undefined) { ease = EaseMap.Linear; } + if (force === undefined) { force = false; } + if (callback === undefined) { callback = null; } + if (context === undefined) { context = this.camera.scene; } + + var cam = this.camera; + + if (!force && this.isRunning) + { + return cam; + } + + this.isRunning = true; + this.duration = duration; + this.progress = 0; + + // Starting from + this.source = cam.zoom; + + // Zooming to + this.destination = zoom; + + // Using this ease + if (typeof ease === 'string' && EaseMap.hasOwnProperty(ease)) + { + this.ease = EaseMap[ease]; + } + else if (typeof ease === 'function') + { + this.ease = ease; + } + + this._elapsed = 0; + + this._onUpdate = callback; + this._onUpdateScope = context; + + this.camera.emit(Events.ZOOM_START, this.camera, this, duration, zoom); + + return cam; + }, + + /** + * The main update loop for this effect. Called automatically by the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Zoom#update + * @since 3.11.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function (time, delta) + { + if (!this.isRunning) + { + return; + } + + this._elapsed += delta; + + this.progress = Clamp(this._elapsed / this.duration, 0, 1); + + if (this._elapsed < this.duration) + { + this.camera.zoom = this.source + ((this.destination - this.source) * this.ease(this.progress)); + + if (this._onUpdate) + { + this._onUpdate.call(this._onUpdateScope, this.camera, this.progress, this.camera.zoom); + } + } + else + { + this.camera.zoom = this.destination; + + if (this._onUpdate) + { + this._onUpdate.call(this._onUpdateScope, this.camera, this.progress, this.destination); + } + + this.effectComplete(); + } + }, + + /** + * Called internally when the effect completes. + * + * @method Phaser.Cameras.Scene2D.Effects.Zoom#effectComplete + * @fires Phaser.Cameras.Scene2D.Events#ZOOM_COMPLETE + * @since 3.11.0 + */ + effectComplete: function () + { + this._onUpdate = null; + this._onUpdateScope = null; + + this.isRunning = false; + + this.camera.emit(Events.ZOOM_COMPLETE, this.camera, this); + }, + + /** + * Resets this camera effect. + * If it was previously running, it stops instantly without calling its onComplete callback or emitting an event. + * + * @method Phaser.Cameras.Scene2D.Effects.Zoom#reset + * @since 3.11.0 + */ + reset: function () + { + this.isRunning = false; + + this._onUpdate = null; + this._onUpdateScope = null; + }, + + /** + * Destroys this effect, releasing it from the Camera. + * + * @method Phaser.Cameras.Scene2D.Effects.Zoom#destroy + * @since 3.11.0 + */ + destroy: function () + { + this.reset(); + + this.camera = null; + } + +}); + +module.exports = Zoom; + + +/***/ }), +/* 654 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Camera = __webpack_require__(268); +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(2); +var PluginCache = __webpack_require__(18); +var RectangleContains = __webpack_require__(47); +var ScaleEvents = __webpack_require__(89); +var SceneEvents = __webpack_require__(19); + +/** + * @classdesc + * The Camera Manager is a plugin that belongs to a Scene and is responsible for managing all of the Scene Cameras. + * + * By default you can access the Camera Manager from within a Scene using `this.cameras`, although this can be changed + * in your game config. + * + * Create new Cameras using the `add` method. Or extend the Camera class with your own addition code and then add + * the new Camera in using the `addExisting` method. + * + * Cameras provide a view into your game world, and can be positioned, rotated, zoomed and scrolled accordingly. + * + * A Camera consists of two elements: The viewport and the scroll values. + * + * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are + * created the same size as your game, but their position and size can be set to anything. This means if you + * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, + * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). + * + * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this + * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the + * viewport, and changing the viewport has no impact on the scrolling. + * + * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, + * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique + * 'Game Object ignore capable' Cameras. Any Cameras beyond 31 that you create will all be given a Camera ID of + * zero, meaning that they cannot be used for Game Object exclusion. This means if you need your Camera to ignore + * Game Objects, make sure it's one of the first 31 created. + * + * A Camera also has built-in special effects including Fade, Flash, Camera Shake, Pan and Zoom. + * + * @class CameraManager + * @memberof Phaser.Cameras.Scene2D + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene that owns the Camera Manager plugin. + */ +var CameraManager = new Class({ + + initialize: + + function CameraManager (scene) + { + /** + * The Scene that owns the Camera Manager plugin. + * + * @name Phaser.Cameras.Scene2D.CameraManager#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Scene.Systems handler for the Scene that owns the Camera Manager. + * + * @name Phaser.Cameras.Scene2D.CameraManager#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * All Cameras created by, or added to, this Camera Manager, will have their `roundPixels` + * property set to match this value. By default it is set to match the value set in the + * game configuration, but can be changed at any point. Equally, individual cameras can + * also be changed as needed. + * + * @name Phaser.Cameras.Scene2D.CameraManager#roundPixels + * @type {boolean} + * @since 3.11.0 + */ + this.roundPixels = scene.sys.game.config.roundPixels; + + /** + * An Array of the Camera objects being managed by this Camera Manager. + * The Cameras are updated and rendered in the same order in which they appear in this array. + * Do not directly add or remove entries to this array. However, you can move the contents + * around the array should you wish to adjust the display order. + * + * @name Phaser.Cameras.Scene2D.CameraManager#cameras + * @type {Phaser.Cameras.Scene2D.Camera[]} + * @since 3.0.0 + */ + this.cameras = []; + + /** + * A handy reference to the 'main' camera. By default this is the first Camera the + * Camera Manager creates. You can also set it directly, or use the `makeMain` argument + * in the `add` and `addExisting` methods. It allows you to access it from your game: + * + * ```javascript + * var cam = this.cameras.main; + * ``` + * + * Also see the properties `camera1`, `camera2` and so on. + * + * @name Phaser.Cameras.Scene2D.CameraManager#main + * @type {Phaser.Cameras.Scene2D.Camera} + * @since 3.0.0 + */ + this.main; + + /** + * A default un-transformed Camera that doesn't exist on the camera list and doesn't + * count towards the total number of cameras being managed. It exists for other + * systems, as well as your own code, should they require a basic un-transformed + * camera instance from which to calculate a view matrix. + * + * @name Phaser.Cameras.Scene2D.CameraManager#default + * @type {Phaser.Cameras.Scene2D.Camera} + * @since 3.17.0 + */ + this.default; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Cameras.Scene2D.CameraManager#boot + * @private + * @listens Phaser.Scenes.Events#DESTROY + * @since 3.5.1 + */ + boot: function () + { + var sys = this.systems; + + if (sys.settings.cameras) + { + // We have cameras to create + this.fromJSON(sys.settings.cameras); + } + else + { + // Make one + this.add(); + } + + this.main = this.cameras[0]; + + // Create a default camera + this.default = new Camera(0, 0, sys.scale.width, sys.scale.height).setScene(this.scene); + + sys.game.scale.on(ScaleEvents.RESIZE, this.onResize, this); + + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Cameras.Scene2D.CameraManager#start + * @private + * @listens Phaser.Scenes.Events#UPDATE + * @listens Phaser.Scenes.Events#SHUTDOWN + * @since 3.5.0 + */ + start: function () + { + if (!this.main) + { + var sys = this.systems; + + if (sys.settings.cameras) + { + // We have cameras to create + this.fromJSON(sys.settings.cameras); + } + else + { + // Make one + this.add(); + } + + this.main = this.cameras[0]; + } + + var eventEmitter = this.systems.events; + + eventEmitter.on(SceneEvents.UPDATE, this.update, this); + eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * Adds a new Camera into the Camera Manager. The Camera Manager can support up to 31 different Cameras. + * + * Each Camera has its own viewport, which controls the size of the Camera and its position within the canvas. + * + * Use the `Camera.scrollX` and `Camera.scrollY` properties to change where the Camera is looking, or the + * Camera methods such as `centerOn`. Cameras also have built in special effects, such as fade, flash, shake, + * pan and zoom. + * + * By default Cameras are transparent and will render anything that they can see based on their `scrollX` + * and `scrollY` values. Game Objects can be set to be ignored by a Camera by using the `Camera.ignore` method. + * + * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change + * it after creation if required. + * + * See the Camera class documentation for more details. + * + * @method Phaser.Cameras.Scene2D.CameraManager#add + * @since 3.0.0 + * + * @param {integer} [x=0] - The horizontal position of the Camera viewport. + * @param {integer} [y=0] - The vertical position of the Camera viewport. + * @param {integer} [width] - The width of the Camera viewport. If not given it'll be the game config size. + * @param {integer} [height] - The height of the Camera viewport. If not given it'll be the game config size. + * @param {boolean} [makeMain=false] - Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. + * @param {string} [name=''] - The name of the Camera. + * + * @return {Phaser.Cameras.Scene2D.Camera} The newly created Camera. + */ + add: function (x, y, width, height, makeMain, name) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.scene.sys.scale.width; } + if (height === undefined) { height = this.scene.sys.scale.height; } + if (makeMain === undefined) { makeMain = false; } + if (name === undefined) { name = ''; } + + var camera = new Camera(x, y, width, height); + + camera.setName(name); + camera.setScene(this.scene); + camera.setRoundPixels(this.roundPixels); + + camera.id = this.getNextID(); + + this.cameras.push(camera); + + if (makeMain) + { + this.main = camera; + } + + return camera; + }, + + /** + * Adds an existing Camera into the Camera Manager. + * + * The Camera should either be a `Phaser.Cameras.Scene2D.Camera` instance, or a class that extends from it. + * + * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change + * it after addition if required. + * + * The Camera will be assigned an ID, which is used for Game Object exclusion and then added to the + * manager. As long as it doesn't already exist in the manager it will be added then returned. + * + * If this method returns `null` then the Camera already exists in this Camera Manager. + * + * @method Phaser.Cameras.Scene2D.CameraManager#addExisting + * @since 3.0.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to be added to the Camera Manager. + * @param {boolean} [makeMain=false] - Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. + * + * @return {?Phaser.Cameras.Scene2D.Camera} The Camera that was added to the Camera Manager, or `null` if it couldn't be added. + */ + addExisting: function (camera, makeMain) + { + if (makeMain === undefined) { makeMain = false; } + + var index = this.cameras.indexOf(camera); + + if (index === -1) + { + camera.id = this.getNextID(); + + camera.setRoundPixels(this.roundPixels); + + this.cameras.push(camera); + + if (makeMain) + { + this.main = camera; + } + + return camera; + } + + return null; + }, + + /** + * Gets the next available Camera ID number. + * + * The Camera Manager supports up to 31 unique cameras, after which the ID returned will always be zero. + * You can create additional cameras beyond 31, but they cannot be used for Game Object exclusion. + * + * @method Phaser.Cameras.Scene2D.CameraManager#getNextID + * @private + * @since 3.11.0 + * + * @return {number} The next available Camera ID, or 0 if they're all already in use. + */ + getNextID: function () + { + var cameras = this.cameras; + + var testID = 1; + + // Find the first free camera ID we can use + + for (var t = 0; t < 32; t++) + { + var found = false; + + for (var i = 0; i < cameras.length; i++) + { + var camera = cameras[i]; + + if (camera && camera.id === testID) + { + found = true; + continue; + } + } + + if (found) + { + testID = testID << 1; + } + else + { + return testID; + } + } + + return 0; + }, + + /** + * Gets the total number of Cameras in this Camera Manager. + * + * If the optional `isVisible` argument is set it will only count Cameras that are currently visible. + * + * @method Phaser.Cameras.Scene2D.CameraManager#getTotal + * @since 3.11.0 + * + * @param {boolean} [isVisible=false] - Set the `true` to only include visible Cameras in the total. + * + * @return {integer} The total number of Cameras in this Camera Manager. + */ + getTotal: function (isVisible) + { + if (isVisible === undefined) { isVisible = false; } + + var total = 0; + + var cameras = this.cameras; + + for (var i = 0; i < cameras.length; i++) + { + var camera = cameras[i]; + + if (!isVisible || (isVisible && camera.visible)) + { + total++; + } + } + + return total; + }, + + /** + * Populates this Camera Manager based on the given configuration object, or an array of config objects. + * + * See the `Phaser.Types.Cameras.Scene2D.CameraConfig` documentation for details of the object structure. + * + * @method Phaser.Cameras.Scene2D.CameraManager#fromJSON + * @since 3.0.0 + * + * @param {(Phaser.Types.Cameras.Scene2D.CameraConfig|Phaser.Types.Cameras.Scene2D.CameraConfig[])} config - A Camera configuration object, or an array of them, to be added to this Camera Manager. + * + * @return {Phaser.Cameras.Scene2D.CameraManager} This Camera Manager instance. + */ + fromJSON: function (config) + { + if (!Array.isArray(config)) + { + config = [ config ]; + } + + var gameWidth = this.scene.sys.scale.width; + var gameHeight = this.scene.sys.scale.height; + + for (var i = 0; i < config.length; i++) + { + var cameraConfig = config[i]; + + var x = GetFastValue(cameraConfig, 'x', 0); + var y = GetFastValue(cameraConfig, 'y', 0); + var width = GetFastValue(cameraConfig, 'width', gameWidth); + var height = GetFastValue(cameraConfig, 'height', gameHeight); + + var camera = this.add(x, y, width, height); + + // Direct properties + camera.name = GetFastValue(cameraConfig, 'name', ''); + camera.zoom = GetFastValue(cameraConfig, 'zoom', 1); + camera.rotation = GetFastValue(cameraConfig, 'rotation', 0); + camera.scrollX = GetFastValue(cameraConfig, 'scrollX', 0); + camera.scrollY = GetFastValue(cameraConfig, 'scrollY', 0); + camera.roundPixels = GetFastValue(cameraConfig, 'roundPixels', false); + camera.visible = GetFastValue(cameraConfig, 'visible', true); + + // Background Color + + var backgroundColor = GetFastValue(cameraConfig, 'backgroundColor', false); + + if (backgroundColor) + { + camera.setBackgroundColor(backgroundColor); + } + + // Bounds + + var boundsConfig = GetFastValue(cameraConfig, 'bounds', null); + + if (boundsConfig) + { + var bx = GetFastValue(boundsConfig, 'x', 0); + var by = GetFastValue(boundsConfig, 'y', 0); + var bwidth = GetFastValue(boundsConfig, 'width', gameWidth); + var bheight = GetFastValue(boundsConfig, 'height', gameHeight); + + camera.setBounds(bx, by, bwidth, bheight); + } + } + + return this; + }, + + /** + * Gets a Camera based on its name. + * + * Camera names are optional and don't have to be set, so this method is only of any use if you + * have given your Cameras unique names. + * + * @method Phaser.Cameras.Scene2D.CameraManager#getCamera + * @since 3.0.0 + * + * @param {string} name - The name of the Camera. + * + * @return {?Phaser.Cameras.Scene2D.Camera} The first Camera with a name matching the given string, otherwise `null`. + */ + getCamera: function (name) + { + var cameras = this.cameras; + + for (var i = 0; i < cameras.length; i++) + { + if (cameras[i].name === name) + { + return cameras[i]; + } + } + + return null; + }, + + /** + * Returns an array of all cameras below the given Pointer. + * + * The first camera in the array is the top-most camera in the camera list. + * + * @method Phaser.Cameras.Scene2D.CameraManager#getCamerasBelowPointer + * @since 3.10.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to check against. + * + * @return {Phaser.Cameras.Scene2D.Camera[]} An array of cameras below the Pointer. + */ + getCamerasBelowPointer: function (pointer) + { + var cameras = this.cameras; + + var x = pointer.x; + var y = pointer.y; + + var output = []; + + for (var i = 0; i < cameras.length; i++) + { + var camera = cameras[i]; + + if (camera.visible && camera.inputEnabled && RectangleContains(camera, x, y)) + { + // So the top-most camera is at the top of the search array + output.unshift(camera); + } + } + + return output; + }, + + /** + * Removes the given Camera, or an array of Cameras, from this Camera Manager. + * + * If found in the Camera Manager it will be immediately removed from the local cameras array. + * If also currently the 'main' camera, 'main' will be reset to be camera 0. + * + * The removed Cameras are automatically destroyed if the `runDestroy` argument is `true`, which is the default. + * If you wish to re-use the cameras then set this to `false`, but know that they will retain their references + * and internal data until destroyed or re-added to a Camera Manager. + * + * @method Phaser.Cameras.Scene2D.CameraManager#remove + * @since 3.0.0 + * + * @param {(Phaser.Cameras.Scene2D.Camera|Phaser.Cameras.Scene2D.Camera[])} camera - The Camera, or an array of Cameras, to be removed from this Camera Manager. + * @param {boolean} [runDestroy=true] - Automatically call `Camera.destroy` on each Camera removed from this Camera Manager. + * + * @return {integer} The total number of Cameras removed. + */ + remove: function (camera, runDestroy) + { + if (runDestroy === undefined) { runDestroy = true; } + + if (!Array.isArray(camera)) + { + camera = [ camera ]; + } + + var total = 0; + var cameras = this.cameras; + + for (var i = 0; i < camera.length; i++) + { + var index = cameras.indexOf(camera[i]); + + if (index !== -1) + { + if (runDestroy) + { + cameras[index].destroy(); + } + + cameras.splice(index, 1); + + total++; + } + } + + if (!this.main && cameras[0]) + { + this.main = cameras[0]; + } + + return total; + }, + + /** + * The internal render method. This is called automatically by the Scene and should not be invoked directly. + * + * It will iterate through all local cameras and render them in turn, as long as they're visible and have + * an alpha level > 0. + * + * @method Phaser.Cameras.Scene2D.CameraManager#render + * @protected + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Renderer that will render the children to this camera. + * @param {Phaser.GameObjects.GameObject[]} children - An array of renderable Game Objects. + * @param {number} interpolation - Interpolation value. Reserved for future use. + */ + render: function (renderer, children, interpolation) + { + var scene = this.scene; + var cameras = this.cameras; + + for (var i = 0; i < this.cameras.length; i++) + { + var camera = cameras[i]; + + if (camera.visible && camera.alpha > 0) + { + // Hard-coded to 1 for now + camera.preRender(1); + + renderer.render(scene, children, interpolation, camera); + } + } + }, + + /** + * Resets this Camera Manager. + * + * This will iterate through all current Cameras, destroying them all, then it will reset the + * cameras array, reset the ID counter and create 1 new single camera using the default values. + * + * @method Phaser.Cameras.Scene2D.CameraManager#resetAll + * @since 3.0.0 + * + * @return {Phaser.Cameras.Scene2D.Camera} The freshly created main Camera. + */ + resetAll: function () + { + for (var i = 0; i < this.cameras.length; i++) + { + this.cameras[i].destroy(); + } + + this.cameras = []; + + this.main = this.add(); + + return this.main; + }, + + /** + * The main update loop. Called automatically when the Scene steps. + * + * @method Phaser.Cameras.Scene2D.CameraManager#update + * @protected + * @since 3.0.0 + * + * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function (time, delta) + { + for (var i = 0; i < this.cameras.length; i++) + { + this.cameras[i].update(time, delta); + } + }, + + /** + * The event handler that manages the `resize` event dispatched by the Scale Manager. + * + * @method Phaser.Cameras.Scene2D.CameraManager#onResize + * @since 3.18.0 + * + * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions. + * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + */ + onResize: function (gameSize, baseSize, displaySize, resolution, previousWidth, previousHeight) + { + for (var i = 0; i < this.cameras.length; i++) + { + var cam = this.cameras[i]; + + // if camera is at 0x0 and was the size of the previous game size, then we can safely assume it + // should be updated to match the new game size too + + if (cam._x === 0 && cam._y === 0 && cam._width === previousWidth && cam._height === previousHeight) + { + cam.setSize(baseSize.width, baseSize.height); + } + } + }, + + /** + * Resizes all cameras to the given dimensions. + * + * @method Phaser.Cameras.Scene2D.CameraManager#resize + * @since 3.2.0 + * + * @param {number} width - The new width of the camera. + * @param {number} height - The new height of the camera. + */ + resize: function (width, height) + { + for (var i = 0; i < this.cameras.length; i++) + { + this.cameras[i].setSize(width, height); + } + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.Cameras.Scene2D.CameraManager#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + this.main = undefined; + + for (var i = 0; i < this.cameras.length; i++) + { + this.cameras[i].destroy(); + } + + this.cameras = []; + + var eventEmitter = this.systems.events; + + eventEmitter.off(SceneEvents.UPDATE, this.update, this); + eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.Cameras.Scene2D.CameraManager#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.default.destroy(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + } + +}); + +PluginCache.register('CameraManager', CameraManager, 'cameras'); + +module.exports = CameraManager; + + +/***/ }), +/* 655 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scale Manager has successfully entered fullscreen mode. + * + * @event Phaser.Scale.Events#ENTER_FULLSCREEN + * @since 3.16.1 + */ +module.exports = 'enterfullscreen'; + + +/***/ }), +/* 656 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scale Manager tried to enter fullscreen mode but failed. + * + * @event Phaser.Scale.Events#FULLSCREEN_FAILED + * @since 3.17.0 + */ +module.exports = 'fullscreenfailed'; + + +/***/ }), +/* 657 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scale Manager tried to enter fullscreen mode, but it is unsupported by the browser. + * + * @event Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED + * @since 3.16.1 + */ +module.exports = 'fullscreenunsupported'; + + +/***/ }), +/* 658 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scale Manager was in fullscreen mode, but has since left, either directly via game code, + * or via a user gestured, such as pressing the ESC key. + * + * @event Phaser.Scale.Events#LEAVE_FULLSCREEN + * @since 3.16.1 + */ +module.exports = 'leavefullscreen'; + + +/***/ }), +/* 659 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scale Manager Orientation Change Event. + * + * @event Phaser.Scale.Events#ORIENTATION_CHANGE + * @since 3.16.1 + * + * @param {string} orientation - + */ +module.exports = 'orientationchange'; + + +/***/ }), +/* 660 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scale Manager Resize Event. + * + * This event is dispatched whenever the Scale Manager detects a resize event from the browser. + * It sends three parameters to the callback, each of them being Size components. You can read + * the `width`, `height`, `aspectRatio` and other properties of these components to help with + * scaling your own game content. + * + * @event Phaser.Scale.Events#RESIZE + * @since 3.16.1 + * + * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. + * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution. + * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. + * @param {number} resolution - The current resolution. Defaults to 1 at the moment. + * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. + * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. + */ +module.exports = 'resize'; + + +/***/ }), +/* 661 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Boot Event. + * + * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.scene.events.on('boot', listener)`. + * + * @event Phaser.Scenes.Events#BOOT + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'boot'; + + +/***/ }), +/* 662 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Create Event. + * + * This event is dispatched by a Scene after it has been created by the Scene Manager. + * + * If a Scene has a `create` method then this event is emitted _after_ that has run. + * + * If there is a transition, this event will be fired after the `TRANSITION_START` event. + * + * Listen to it from a Scene using `this.scene.events.on('create', listener)`. + * + * @event Phaser.Scenes.Events#CREATE + * @since 3.17.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. + */ +module.exports = 'create'; + + +/***/ }), +/* 663 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Destroy Event. + * + * This event is dispatched by a Scene during the Scene Systems destroy process. + * + * Listen to it from a Scene using `this.scene.events.on('destroy', listener)`. + * + * You should destroy any resources that may be in use by your Scene in this event handler. + * + * @event Phaser.Scenes.Events#DESTROY + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'destroy'; + + +/***/ }), +/* 664 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pause Event. + * + * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an + * action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('pause', listener)`. + * + * @event Phaser.Scenes.Events#PAUSE + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was paused. + */ +module.exports = 'pause'; + + +/***/ }), +/* 665 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Post Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#POST_UPDATE + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'postupdate'; + + +/***/ }), +/* 666 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Pre Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#PRE_UPDATE + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'preupdate'; + + +/***/ }), +/* 667 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Ready Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. + * By this point in the process the Scene is now fully active and rendering. + * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event. + * + * Listen to it from a Scene using `this.scene.events.on('ready', listener)`. + * + * @event Phaser.Scenes.Events#READY + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was started. + */ +module.exports = 'ready'; + + +/***/ }), +/* 668 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Render Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('render', listener)`. + * + * A Scene will only render if it is visible and active. + * By the time this event is dispatched, the Scene will have already been rendered. + * + * @event Phaser.Scenes.Events#RENDER + * @since 3.0.0 + * + * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. + */ +module.exports = 'render'; + + +/***/ }), +/* 669 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Resume Event. + * + * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('resume', listener)`. + * + * @event Phaser.Scenes.Events#RESUME + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed. + */ +module.exports = 'resume'; + + +/***/ }), +/* 670 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Shutdown Event. + * + * This event is dispatched by a Scene during the Scene Systems shutdown process. + * + * Listen to it from a Scene using `this.scene.events.on('shutdown', listener)`. + * + * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding + * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not + * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. + * + * @event Phaser.Scenes.Events#SHUTDOWN + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown. + */ +module.exports = 'shutdown'; + + +/***/ }), +/* 671 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Sleep Event. + * + * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('sleep', listener)`. + * + * @event Phaser.Scenes.Events#SLEEP + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep. + */ +module.exports = 'sleep'; + + +/***/ }), +/* 672 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Start Event. + * + * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins. + * + * Listen to it from a Scene using `this.scene.events.on('start', listener)`. + * + * @event Phaser.Scenes.Events#START + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + */ +module.exports = 'start'; + + +/***/ }), +/* 673 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Complete Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration + * of the transition. + * + * Listen to it from a Scene using `this.scene.events.on('transitioncomplete', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_COMPLETE + * @since 3.5.0 + * + * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. + */ +module.exports = 'transitioncomplete'; + + +/***/ }), +/* 674 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Init Event. + * + * This event is dispatched by the Target Scene of a transition. + * + * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method, + * this event is not dispatched. + * + * Listen to it from a Scene using `this.scene.events.on('transitioninit', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_INIT + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitioninit'; + + +/***/ }), +/* 675 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Out Event. + * + * This event is dispatched by a Scene when it initiates a transition to another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('transitionout', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_OUT + * @since 3.5.0 + * + * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionout'; + + +/***/ }), +/* 676 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Start Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep. + * + * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method, + * this event is dispatched anyway. + * + * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is + * dispatched instead of this event. + * + * Listen to it from a Scene using `this.scene.events.on('transitionstart', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_START + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionstart'; + + +/***/ }), +/* 677 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Transition Wake Event. + * + * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before + * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead. + * + * Listen to it from a Scene using `this.scene.events.on('transitionwake', listener)`. + * + * The Scene Transition event flow is as follows: + * + * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event. + * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method. + * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ... + * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. + * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. + * + * @event Phaser.Scenes.Events#TRANSITION_WAKE + * @since 3.5.0 + * + * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. + * @param {number} duration - The duration of the transition in ms. + */ +module.exports = 'transitionwake'; + + +/***/ }), +/* 678 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Update Event. + * + * This event is dispatched by a Scene during the main game loop step. + * + * The event flow for a single step of a Scene is as follows: + * + * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE} + * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE} + * 3. The `Scene.update` method is called, if it exists + * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE} + * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER} + * + * Listen to it from a Scene using `this.scene.events.on('update', listener)`. + * + * A Scene will only run its step if it is active. + * + * @event Phaser.Scenes.Events#UPDATE + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'update'; + + +/***/ }), +/* 679 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Scene Systems Wake Event. + * + * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method, + * or as an action from another Scene. + * + * Listen to it from a Scene using `this.scene.events.on('wake', listener)`. + * + * @event Phaser.Scenes.Events#WAKE + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. + * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up. + */ +module.exports = 'wake'; + + +/***/ }), +/* 680 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Core + */ + +module.exports = { + + Config: __webpack_require__(289), + CreateRenderer: __webpack_require__(312), + DebugHeader: __webpack_require__(314), + Events: __webpack_require__(28), + TimeStep: __webpack_require__(315), + VisibilityHandler: __webpack_require__(317) + +}; + + +/***/ }), +/* 681 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 682 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Browser = __webpack_require__(116); + +/** + * Determines the input support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.input` from within any Scene. + * + * @typedef {object} Phaser.Device.Input + * @since 3.0.0 + * + * @property {?string} wheelType - The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll' + * @property {boolean} gamepads - Is navigator.getGamepads available? + * @property {boolean} mspointer - Is mspointer available? + * @property {boolean} touch - Is touch available? + */ +var Input = { + + gamepads: false, + mspointer: false, + touch: false, + wheelEvent: null + +}; + +function init () +{ + if ('ontouchstart' in document.documentElement || (navigator.maxTouchPoints && navigator.maxTouchPoints >= 1)) + { + Input.touch = true; + } + + if (navigator.msPointerEnabled || navigator.pointerEnabled) + { + Input.mspointer = true; + } + + if (navigator.getGamepads) + { + Input.gamepads = true; + } + + // See https://developer.mozilla.org/en-US/docs/Web/Events/wheel + if ('onwheel' in window || (Browser.ie && 'WheelEvent' in window)) + { + // DOM3 Wheel Event: FF 17+, IE 9+, Chrome 31+, Safari 7+ + Input.wheelEvent = 'wheel'; + } + else if ('onmousewheel' in window) + { + // Non-FF legacy: IE 6-9, Chrome 1-31, Safari 5-7. + Input.wheelEvent = 'mousewheel'; + } + else if (Browser.firefox && 'MouseScrollEvent' in window) + { + // FF prior to 17. This should probably be scrubbed. + Input.wheelEvent = 'DOMMouseScroll'; + } + + return Input; +} + +module.exports = init(); + + +/***/ }), +/* 683 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Browser = __webpack_require__(116); + +/** + * Determines the audio playback capabilities of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.audio` from within any Scene. + * + * @typedef {object} Phaser.Device.Audio + * @since 3.0.0 + * + * @property {boolean} audioData - Can this device play HTML Audio tags? + * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? + * @property {boolean} m4a - Can this device can play m4a files. + * @property {boolean} mp3 - Can this device play mp3 files? + * @property {boolean} ogg - Can this device play ogg files? + * @property {boolean} opus - Can this device play opus files? + * @property {boolean} wav - Can this device play wav files? + * @property {boolean} webAudio - Does this device have the Web Audio API? + * @property {boolean} webm - Can this device play webm files? + */ +var Audio = { + + audioData: false, + dolby: false, + m4a: false, + mp3: false, + ogg: false, + opus: false, + wav: false, + webAudio: false, + webm: false + +}; + +function init () +{ + Audio.audioData = !!(window['Audio']); + + Audio.webAudio = !!(window['AudioContext'] || window['webkitAudioContext']); + + var audioElement = document.createElement('audio'); + + var result = !!audioElement.canPlayType; + + try + { + if (result) + { + if (audioElement.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) + { + Audio.ogg = true; + } + + if (audioElement.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, '') || audioElement.canPlayType('audio/opus;').replace(/^no$/, '')) + { + Audio.opus = true; + } + + if (audioElement.canPlayType('audio/mpeg;').replace(/^no$/, '')) + { + Audio.mp3 = true; + } + + // Mimetypes accepted: + // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements + // bit.ly/iphoneoscodecs + if (audioElement.canPlayType('audio/wav; codecs="1"').replace(/^no$/, '')) + { + Audio.wav = true; + } + + if (audioElement.canPlayType('audio/x-m4a;') || audioElement.canPlayType('audio/aac;').replace(/^no$/, '')) + { + Audio.m4a = true; + } + + if (audioElement.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, '')) + { + Audio.webm = true; + } + + if (audioElement.canPlayType('audio/mp4;codecs="ec-3"') !== '') + { + if (Browser.edge) + { + Audio.dolby = true; + } + else if (Browser.safari && Browser.safariVersion >= 9) + { + if ((/Mac OS X (\d+)_(\d+)/).test(navigator.userAgent)) + { + var major = parseInt(RegExp.$1, 10); + var minor = parseInt(RegExp.$2, 10); + + if ((major === 10 && minor >= 11) || major > 10) + { + Audio.dolby = true; + } + } + } + } + } + } + catch (e) + { + // Nothing to do here + } + + return Audio; +} + +module.exports = init(); + + +/***/ }), +/* 684 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determines the video support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.video` from within any Scene. + * + * @typedef {object} Phaser.Device.Video + * @since 3.0.0 + * + * @property {boolean} h264Video - Can this device play h264 mp4 video files? + * @property {boolean} hlsVideo - Can this device play hls video files? + * @property {boolean} mp4Video - Can this device play h264 mp4 video files? + * @property {boolean} oggVideo - Can this device play ogg video files? + * @property {boolean} vp9Video - Can this device play vp9 video files? + * @property {boolean} webmVideo - Can this device play webm video files? + */ +var Video = { + + h264Video: false, + hlsVideo: false, + mp4Video: false, + oggVideo: false, + vp9Video: false, + webmVideo: false + +}; + +function init () +{ + var videoElement = document.createElement('video'); + var result = !!videoElement.canPlayType; + + try + { + if (result) + { + if (videoElement.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, '')) + { + Video.oggVideo = true; + } + + if (videoElement.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, '')) + { + // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 + Video.h264Video = true; + Video.mp4Video = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, '')) + { + Video.webmVideo = true; + } + + if (videoElement.canPlayType('video/webm; codecs="vp9"').replace(/^no$/, '')) + { + Video.vp9Video = true; + } + + if (videoElement.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/, '')) + { + Video.hlsVideo = true; + } + } + } + catch (e) + { + // Nothing to do + } + + return Video; +} + +module.exports = init(); + + +/***/ }), +/* 685 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determines the full screen support of the browser running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.fullscreen` from within any Scene. + * + * @typedef {object} Phaser.Device.Fullscreen + * @since 3.0.0 + * + * @property {boolean} available - Does the browser support the Full Screen API? + * @property {boolean} keyboard - Does the browser support access to the Keyboard during Full Screen mode? + * @property {string} cancel - If the browser supports the Full Screen API this holds the call you need to use to cancel it. + * @property {string} request - If the browser supports the Full Screen API this holds the call you need to use to activate it. + */ +var Fullscreen = { + + available: false, + cancel: '', + keyboard: false, + request: '' + +}; + +/** +* Checks for support of the Full Screen API. +* +* @ignore +*/ +function init () +{ + var i; + + var suffix1 = 'Fullscreen'; + var suffix2 = 'FullScreen'; + + var fs = [ + 'request' + suffix1, + 'request' + suffix2, + 'webkitRequest' + suffix1, + 'webkitRequest' + suffix2, + 'msRequest' + suffix1, + 'msRequest' + suffix2, + 'mozRequest' + suffix2, + 'mozRequest' + suffix1 + ]; + + for (i = 0; i < fs.length; i++) + { + if (document.documentElement[fs[i]]) + { + Fullscreen.available = true; + Fullscreen.request = fs[i]; + break; + } + } + + var cfs = [ + 'cancel' + suffix2, + 'exit' + suffix1, + 'webkitCancel' + suffix2, + 'webkitExit' + suffix1, + 'msCancel' + suffix2, + 'msExit' + suffix1, + 'mozCancel' + suffix2, + 'mozExit' + suffix1 + ]; + + if (Fullscreen.available) + { + for (i = 0; i < cfs.length; i++) + { + if (document[cfs[i]]) + { + Fullscreen.cancel = cfs[i]; + break; + } + } + } + + // Keyboard Input? + // Safari 5.1 says it supports fullscreen keyboard, but is lying. + if (window['Element'] && Element['ALLOW_KEYBOARD_INPUT'] && !(/ Version\/5\.1(?:\.\d+)? Safari\//).test(navigator.userAgent)) + { + Fullscreen.keyboard = true; + } + + Object.defineProperty(Fullscreen, 'active', { get: function () { return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement); } }); + + return Fullscreen; +} + +module.exports = init(); + + +/***/ }), +/* 686 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Angle + */ + +module.exports = { + + Between: __webpack_require__(292), + BetweenPoints: __webpack_require__(687), + BetweenPointsY: __webpack_require__(688), + BetweenY: __webpack_require__(689), + CounterClockwise: __webpack_require__(690), + Normalize: __webpack_require__(293), + Reverse: __webpack_require__(691), + RotateTo: __webpack_require__(692), + ShortestBetween: __webpack_require__(693), + Wrap: __webpack_require__(223), + WrapDegrees: __webpack_require__(224) + +}; + + +/***/ }), +/* 687 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * Calculates the angle of the vector from the first point to the second point. + * + * @function Phaser.Math.Angle.BetweenPoints + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} point2 - The second point. + * + * @return {number} The angle in radians. + */ +var BetweenPoints = function (point1, point2) +{ + return Math.atan2(point2.y - point1.y, point2.x - point1.x); +}; + +module.exports = BetweenPoints; + + +/***/ }), +/* 688 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y). + * + * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate + * travels down the screen. + * + * @function Phaser.Math.Angle.BetweenPointsY + * @since 3.0.0 + * + * @param {(Phaser.Geom.Point|object)} point1 - The first point. + * @param {(Phaser.Geom.Point|object)} point2 - The second point. + * + * @return {number} The angle in radians. + */ +var BetweenPointsY = function (point1, point2) +{ + return Math.atan2(point2.x - point1.x, point2.y - point1.y); +}; + +module.exports = BetweenPointsY; + + +/***/ }), +/* 689 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate + * travels down the screen. + * + * @function Phaser.Math.Angle.BetweenY + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The angle in radians. + */ +var BetweenY = function (x1, y1, x2, y2) +{ + return Math.atan2(x2 - x1, y2 - y1); +}; + +module.exports = BetweenY; + + +/***/ }), +/* 690 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(23); + +/** + * Takes an angle in Phasers default clockwise format and converts it so that + * 0 is North, 90 is West, 180 is South and 270 is East, + * therefore running counter-clockwise instead of clockwise. + * + * You can pass in the angle from a Game Object using: + * + * ```javascript + * var converted = CounterClockwise(gameobject.rotation); + * ``` + * + * All values for this function are in radians. + * + * @function Phaser.Math.Angle.CounterClockwise + * @since 3.16.0 + * + * @param {number} angle - The angle to convert, in radians. + * + * @return {number} The converted angle, in radians. + */ +var CounterClockwise = function (angle) +{ + return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); +}; + +module.exports = CounterClockwise; + + +/***/ }), +/* 691 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Normalize = __webpack_require__(293); + +/** + * Reverse the given angle. + * + * @function Phaser.Math.Angle.Reverse + * @since 3.0.0 + * + * @param {number} angle - The angle to reverse, in radians. + * + * @return {number} The reversed angle, in radians. + */ +var Reverse = function (angle) +{ + return Normalize(angle + Math.PI); +}; + +module.exports = Reverse; + + +/***/ }), +/* 692 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(23); + +/** + * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. + * + * @function Phaser.Math.Angle.RotateTo + * @since 3.0.0 + * + * @param {number} currentAngle - The current angle, in radians. + * @param {number} targetAngle - The target angle to rotate to, in radians. + * @param {number} [lerp=0.05] - The lerp value to add to the current angle. + * + * @return {number} The adjusted angle. + */ +var RotateTo = function (currentAngle, targetAngle, lerp) +{ + if (lerp === undefined) { lerp = 0.05; } + + if (currentAngle === targetAngle) + { + return currentAngle; + } + + if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp)) + { + currentAngle = targetAngle; + } + else + { + if (Math.abs(targetAngle - currentAngle) > Math.PI) + { + if (targetAngle < currentAngle) + { + targetAngle += MATH_CONST.PI2; + } + else + { + targetAngle -= MATH_CONST.PI2; + } + } + + if (targetAngle > currentAngle) + { + currentAngle += lerp; + } + else if (targetAngle < currentAngle) + { + currentAngle -= lerp; + } + } + + return currentAngle; +}; + +module.exports = RotateTo; + + +/***/ }), +/* 693 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Gets the shortest angle between `angle1` and `angle2`. + * + * Both angles must be in the range -180 to 180, which is the same clamped + * range that `sprite.angle` uses, so you can pass in two sprite angles to + * this method and get the shortest angle back between the two of them. + * + * The angle returned will be in the same range. If the returned angle is + * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's + * a clockwise rotation. + * + * TODO: Wrap the angles in this function? + * + * @function Phaser.Math.Angle.ShortestBetween + * @since 3.0.0 + * + * @param {number} angle1 - The first angle in the range -180 to 180. + * @param {number} angle2 - The second angle in the range -180 to 180. + * + * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation. + */ +var ShortestBetween = function (angle1, angle2) +{ + var difference = angle2 - angle1; + + if (difference === 0) + { + return 0; + } + + var times = Math.floor((difference - (-180)) / 360); + + return difference - (times * 360); + +}; + +module.exports = ShortestBetween; + + +/***/ }), +/* 694 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Distance + */ + +module.exports = { + + Between: __webpack_require__(57), + Power: __webpack_require__(695), + Squared: __webpack_require__(294) + +}; + + +/***/ }), +/* 695 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the distance between two sets of coordinates (points) to the power of `pow`. + * + * @function Phaser.Math.Distance.Power + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * @param {number} pow - The exponent. + * + * @return {number} The distance between each point. + */ +var DistancePower = function (x1, y1, x2, y2, pow) +{ + if (pow === undefined) { pow = 2; } + + return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow)); +}; + +module.exports = DistancePower; + + +/***/ }), +/* 696 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing + */ + +module.exports = { + + Back: __webpack_require__(277), + Bounce: __webpack_require__(278), + Circular: __webpack_require__(279), + Cubic: __webpack_require__(280), + Elastic: __webpack_require__(281), + Expo: __webpack_require__(282), + Linear: __webpack_require__(283), + Quadratic: __webpack_require__(284), + Quartic: __webpack_require__(285), + Quintic: __webpack_require__(286), + Sine: __webpack_require__(287), + Stepped: __webpack_require__(288) + +}; + + +/***/ }), +/* 697 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Fuzzy + */ + +module.exports = { + + Ceil: __webpack_require__(698), + Equal: __webpack_require__(166), + Floor: __webpack_require__(699), + GreaterThan: __webpack_require__(295), + LessThan: __webpack_require__(296) + +}; + + +/***/ }), +/* 698 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the fuzzy ceiling of the given value. + * + * @function Phaser.Math.Fuzzy.Ceil + * @since 3.0.0 + * + * @param {number} value - The value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {number} The fuzzy ceiling of the value. + */ +var Ceil = function (value, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.ceil(value - epsilon); +}; + +module.exports = Ceil; + + +/***/ }), +/* 699 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the fuzzy floor of the given value. + * + * @function Phaser.Math.Fuzzy.Floor + * @since 3.0.0 + * + * @param {number} value - The value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {number} The floor of the value. + */ +var Floor = function (value, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.floor(value + epsilon); +}; + +module.exports = Floor; + + +/***/ }), +/* 700 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Interpolation + */ + +module.exports = { + + Bezier: __webpack_require__(701), + CatmullRom: __webpack_require__(702), + CubicBezier: __webpack_require__(299), + Linear: __webpack_require__(703), + QuadraticBezier: __webpack_require__(300), + SmoothStep: __webpack_require__(301), + SmootherStep: __webpack_require__(704) + +}; + + +/***/ }), +/* 701 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bernstein = __webpack_require__(297); + +/** + * A bezier interpolation method. + * + * @function Phaser.Math.Interpolation.Bezier + * @since 3.0.0 + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {number} k - The percentage of interpolation, between 0 and 1. + * + * @return {number} The interpolated value. + */ +var BezierInterpolation = function (v, k) +{ + var b = 0; + var n = v.length - 1; + + for (var i = 0; i <= n; i++) + { + b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i); + } + + return b; +}; + +module.exports = BezierInterpolation; + + +/***/ }), +/* 702 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CatmullRom = __webpack_require__(167); + +/** + * A Catmull-Rom interpolation method. + * + * @function Phaser.Math.Interpolation.CatmullRom + * @since 3.0.0 + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {number} k - The percentage of interpolation, between 0 and 1. + * + * @return {number} The interpolated value. + */ +var CatmullRomInterpolation = function (v, k) +{ + var m = v.length - 1; + var f = m * k; + var i = Math.floor(f); + + if (v[0] === v[m]) + { + if (k < 0) + { + i = Math.floor(f = m * (1 + k)); + } + + return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]); + } + else + { + if (k < 0) + { + return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]); + } + + if (k > 1) + { + return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]); + } + + return CatmullRom(f - i, v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2]); + } +}; + +module.exports = CatmullRomInterpolation; + + +/***/ }), +/* 703 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(114); + +/** + * A linear interpolation method. + * + * @function Phaser.Math.Interpolation.Linear + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation} + * + * @param {number[]} v - The input array of values to interpolate between. + * @param {!number} k - The percentage of interpolation, between 0 and 1. + * + * @return {!number} The interpolated value. + */ +var LinearInterpolation = function (v, k) +{ + var m = v.length - 1; + var f = m * k; + var i = Math.floor(f); + + if (k < 0) + { + return Linear(v[0], v[1], f); + } + else if (k > 1) + { + return Linear(v[m], v[m - 1], m - f); + } + else + { + return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i); + } +}; + +module.exports = LinearInterpolation; + + +/***/ }), +/* 704 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SmootherStep = __webpack_require__(155); + +/** + * A Smoother Step interpolation method. + * + * @function Phaser.Math.Interpolation.SmootherStep + * @since 3.9.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} + * + * @param {number} t - The percentage of interpolation, between 0 and 1. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The interpolated value. + */ +var SmootherStepInterpolation = function (t, min, max) +{ + return min + (max - min) * SmootherStep(t, 0, 1); +}; + +module.exports = SmootherStepInterpolation; + + +/***/ }), +/* 705 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Pow2 + */ + +module.exports = { + + GetNext: __webpack_require__(302), + IsSize: __webpack_require__(117), + IsValue: __webpack_require__(706) + +}; + + +/***/ }), +/* 706 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Tests the value and returns `true` if it is a power of two. + * + * @function Phaser.Math.Pow2.IsValuePowerOfTwo + * @since 3.0.0 + * + * @param {number} value - The value to check if it's a power of two. + * + * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`. + */ +var IsValuePowerOfTwo = function (value) +{ + return (value > 0 && (value & (value - 1)) === 0); +}; + +module.exports = IsValuePowerOfTwo; + + +/***/ }), +/* 707 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Snap + */ + +module.exports = { + + Ceil: __webpack_require__(303), + Floor: __webpack_require__(90), + To: __webpack_require__(708) + +}; + + +/***/ }), +/* 708 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using rounding. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`. + * + * @function Phaser.Math.Snap.To + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapTo = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.round(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapTo; + + +/***/ }), +/* 709 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A seeded Random Data Generator. + * + * Access via `Phaser.Math.RND` which is an instance of this class pre-defined + * by Phaser. Or, create your own instance to use as you require. + * + * The `Math.RND` generator is seeded by the Game Config property value `seed`. + * If no such config property exists, a random number is used. + * + * If you create your own instance of this class you should provide a seed for it. + * If no seed is given it will use a 'random' one based on Date.now. + * + * @class RandomDataGenerator + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {(string|string[])} [seeds] - The seeds to use for the random number generator. + */ +var RandomDataGenerator = new Class({ + + initialize: + + function RandomDataGenerator (seeds) + { + if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; } + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#c + * @type {number} + * @default 1 + * @private + * @since 3.0.0 + */ + this.c = 1; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s0 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s0 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s1 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s1 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#s2 + * @type {number} + * @default 0 + * @private + * @since 3.0.0 + */ + this.s2 = 0; + + /** + * Internal var. + * + * @name Phaser.Math.RandomDataGenerator#n + * @type {number} + * @default 0 + * @private + * @since 3.2.0 + */ + this.n = 0; + + /** + * Signs to choose from. + * + * @name Phaser.Math.RandomDataGenerator#signs + * @type {number[]} + * @since 3.0.0 + */ + this.signs = [ -1, 1 ]; + + if (seeds) + { + this.init(seeds); + } + }, + + /** + * Private random helper. + * + * @method Phaser.Math.RandomDataGenerator#rnd + * @since 3.0.0 + * @private + * + * @return {number} A random number. + */ + rnd: function () + { + var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32 + + this.c = t | 0; + this.s0 = this.s1; + this.s1 = this.s2; + this.s2 = t - this.c; + + return this.s2; + }, + + /** + * Internal method that creates a seed hash. + * + * @method Phaser.Math.RandomDataGenerator#hash + * @since 3.0.0 + * @private + * + * @param {string} data - The value to hash. + * + * @return {number} The hashed value. + */ + hash: function (data) + { + var h; + var n = this.n; + + data = data.toString(); + + for (var i = 0; i < data.length; i++) + { + n += data.charCodeAt(i); + h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 0x100000000;// 2^32 + } + + this.n = n; + + return (n >>> 0) * 2.3283064365386963e-10;// 2^-32 + }, + + /** + * Initialize the state of the random data generator. + * + * @method Phaser.Math.RandomDataGenerator#init + * @since 3.0.0 + * + * @param {(string|string[])} seeds - The seeds to initialize the random data generator with. + */ + init: function (seeds) + { + if (typeof seeds === 'string') + { + this.state(seeds); + } + else + { + this.sow(seeds); + } + }, + + /** + * Reset the seed of the random data generator. + * + * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present. + * + * @method Phaser.Math.RandomDataGenerator#sow + * @since 3.0.0 + * + * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used. + */ + sow: function (seeds) + { + // Always reset to default seed + this.n = 0xefc8249d; + this.s0 = this.hash(' '); + this.s1 = this.hash(' '); + this.s2 = this.hash(' '); + this.c = 1; + + if (!seeds) + { + return; + } + + // Apply any seeds + for (var i = 0; i < seeds.length && (seeds[i] != null); i++) + { + var seed = seeds[i]; + + this.s0 -= this.hash(seed); + this.s0 += ~~(this.s0 < 0); + this.s1 -= this.hash(seed); + this.s1 += ~~(this.s1 < 0); + this.s2 -= this.hash(seed); + this.s2 += ~~(this.s2 < 0); + } + }, + + /** + * Returns a random integer between 0 and 2^32. + * + * @method Phaser.Math.RandomDataGenerator#integer + * @since 3.0.0 + * + * @return {number} A random integer between 0 and 2^32. + */ + integer: function () + { + // 2^32 + return this.rnd() * 0x100000000; + }, + + /** + * Returns a random real number between 0 and 1. + * + * @method Phaser.Math.RandomDataGenerator#frac + * @since 3.0.0 + * + * @return {number} A random real number between 0 and 1. + */ + frac: function () + { + // 2^-53 + return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16; + }, + + /** + * Returns a random real number between 0 and 2^32. + * + * @method Phaser.Math.RandomDataGenerator#real + * @since 3.0.0 + * + * @return {number} A random real number between 0 and 2^32. + */ + real: function () + { + return this.integer() + this.frac(); + }, + + /** + * Returns a random integer between and including min and max. + * + * @method Phaser.Math.RandomDataGenerator#integerInRange + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + integerInRange: function (min, max) + { + return Math.floor(this.realInRange(0, max - min + 1) + min); + }, + + /** + * Returns a random integer between and including min and max. + * This method is an alias for RandomDataGenerator.integerInRange. + * + * @method Phaser.Math.RandomDataGenerator#between + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + between: function (min, max) + { + return Math.floor(this.realInRange(0, max - min + 1) + min); + }, + + /** + * Returns a random real number between min and max. + * + * @method Phaser.Math.RandomDataGenerator#realInRange + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random number between min and max. + */ + realInRange: function (min, max) + { + return this.frac() * (max - min) + min; + }, + + /** + * Returns a random real number between -1 and 1. + * + * @method Phaser.Math.RandomDataGenerator#normal + * @since 3.0.0 + * + * @return {number} A random real number between -1 and 1. + */ + normal: function () + { + return 1 - (2 * this.frac()); + }, + + /** + * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368 + * + * @method Phaser.Math.RandomDataGenerator#uuid + * @since 3.0.0 + * + * @return {string} A valid RFC4122 version4 ID hex string + */ + uuid: function () + { + var a = ''; + var b = ''; + + for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-') + { + // eslint-disable-next-line no-empty + } + + return b; + }, + + /** + * Returns a random element from within the given array. + * + * @method Phaser.Math.RandomDataGenerator#pick + * @since 3.0.0 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} A random member of the array. + */ + pick: function (array) + { + return array[this.integerInRange(0, array.length - 1)]; + }, + + /** + * Returns a sign to be used with multiplication operator. + * + * @method Phaser.Math.RandomDataGenerator#sign + * @since 3.0.0 + * + * @return {number} -1 or +1. + */ + sign: function () + { + return this.pick(this.signs); + }, + + /** + * Returns a random element from within the given array, favoring the earlier entries. + * + * @method Phaser.Math.RandomDataGenerator#weightedPick + * @since 3.0.0 + * + * @param {array} array - The array to pick a random element from. + * + * @return {*} A random member of the array. + */ + weightedPick: function (array) + { + return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)]; + }, + + /** + * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified. + * + * @method Phaser.Math.RandomDataGenerator#timestamp + * @since 3.0.0 + * + * @param {number} min - The minimum value in the range. + * @param {number} max - The maximum value in the range. + * + * @return {number} A random timestamp between min and max. + */ + timestamp: function (min, max) + { + return this.realInRange(min || 946684800000, max || 1577862000000); + }, + + /** + * Returns a random angle between -180 and 180. + * + * @method Phaser.Math.RandomDataGenerator#angle + * @since 3.0.0 + * + * @return {number} A random number between -180 and 180. + */ + angle: function () + { + return this.integerInRange(-180, 180); + }, + + /** + * Returns a random rotation in radians, between -3.141 and 3.141 + * + * @method Phaser.Math.RandomDataGenerator#rotation + * @since 3.0.0 + * + * @return {number} A random number between -3.141 and 3.141 + */ + rotation: function () + { + return this.realInRange(-3.1415926, 3.1415926); + }, + + /** + * Gets or Sets the state of the generator. This allows you to retain the values + * that the generator is using between games, i.e. in a game save file. + * + * To seed this generator with a previously saved state you can pass it as the + * `seed` value in your game config, or call this method directly after Phaser has booted. + * + * Call this method with no parameters to return the current state. + * + * If providing a state it should match the same format that this method + * returns, which is a string with a header `!rnd` followed by the `c`, + * `s0`, `s1` and `s2` values respectively, each comma-delimited. + * + * @method Phaser.Math.RandomDataGenerator#state + * @since 3.0.0 + * + * @param {string} [state] - Generator state to be set. + * + * @return {string} The current state of the generator. + */ + state: function (state) + { + if (typeof state === 'string' && state.match(/^!rnd/)) + { + state = state.split(','); + + this.c = parseFloat(state[1]); + this.s0 = parseFloat(state[2]); + this.s1 = parseFloat(state[3]); + this.s2 = parseFloat(state[4]); + } + + return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(','); + }, + + /** + * Shuffles the given array, using the current seed. + * + * @method Phaser.Math.RandomDataGenerator#shuffle + * @since 3.7.0 + * + * @param {array} [array] - The array to be shuffled. + * + * @return {array} The shuffled array. + */ + shuffle: function (array) + { + var len = array.length - 1; + + for (var i = len; i > 0; i--) + { + var randomIndex = Math.floor(this.frac() * (i + 1)); + var itemAtIndex = array[randomIndex]; + + array[randomIndex] = array[i]; + array[i] = itemAtIndex; + } + + return array; + } + +}); + +module.exports = RandomDataGenerator; + + +/***/ }), +/* 710 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the mean average of the given values. + * + * @function Phaser.Math.Average + * @since 3.0.0 + * + * @param {number[]} values - The values to average. + * + * @return {number} The average value. + */ +var Average = function (values) +{ + var sum = 0; + + for (var i = 0; i < values.length; i++) + { + sum += (+values[i]); + } + + return sum / values.length; +}; + +module.exports = Average; + + +/***/ }), +/* 711 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Ceils to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * + * @function Phaser.Math.CeilTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {number} [place=0] - The place to round to. + * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var CeilTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.ceil(value * p) / p; +}; + +module.exports = CeilTo; + + +/***/ }), +/* 712 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the positive difference of two given numbers. + * + * @function Phaser.Math.Difference + * @since 3.0.0 + * + * @param {number} a - The first number in the calculation. + * @param {number} b - The second number in the calculation. + * + * @return {number} The positive difference of the two given numbers. + */ +var Difference = function (a, b) +{ + return Math.abs(a - b); +}; + +module.exports = Difference; + + +/***/ }), +/* 713 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Floors to some place comparative to a `base`, default is 10 for decimal place. + * + * The `place` is represented by the power applied to `base` to get that place. + * + * @function Phaser.Math.FloorTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {integer} [place=0] - The place to round to. + * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var FloorTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.floor(value * p) / p; +}; + +module.exports = FloorTo; + + +/***/ }), +/* 714 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the speed required to cover a distance in the time given. + * + * @function Phaser.Math.GetSpeed + * @since 3.0.0 + * + * @param {number} distance - The distance to travel in pixels. + * @param {integer} time - The time, in ms, to cover the distance in. + * + * @return {number} The amount you will need to increment the position by each step in order to cover the distance in the time given. + */ +var GetSpeed = function (distance, time) +{ + return (distance / time) / 1000; +}; + +module.exports = GetSpeed; + + +/***/ }), +/* 715 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check if a given value is an even number. + * + * @function Phaser.Math.IsEven + * @since 3.0.0 + * + * @param {number} value - The number to perform the check with. + * + * @return {boolean} Whether the number is even or not. + */ +var IsEven = function (value) +{ + // Use abstract equality == for "is number" test + + // eslint-disable-next-line eqeqeq + return (value == parseFloat(value)) ? !(value % 2) : void 0; +}; + +module.exports = IsEven; + + +/***/ }), +/* 716 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check if a given value is an even number using a strict type check. + * + * @function Phaser.Math.IsEvenStrict + * @since 3.0.0 + * + * @param {number} value - The number to perform the check with. + * + * @return {boolean} Whether the number is even or not. + */ +var IsEvenStrict = function (value) +{ + // Use strict equality === for "is number" test + return (value === parseFloat(value)) ? !(value % 2) : void 0; +}; + +module.exports = IsEvenStrict; + + +/***/ }), +/* 717 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Add an `amount` to a `value`, limiting the maximum result to `max`. + * + * @function Phaser.Math.MaxAdd + * @since 3.0.0 + * + * @param {number} value - The value to add to. + * @param {number} amount - The amount to add. + * @param {number} max - The maximum value to return. + * + * @return {number} The resulting value. + */ +var MaxAdd = function (value, amount, max) +{ + return Math.min(value + amount, max); +}; + +module.exports = MaxAdd; + + +/***/ }), +/* 718 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Subtract an `amount` from `value`, limiting the minimum result to `min`. + * + * @function Phaser.Math.MinSub + * @since 3.0.0 + * + * @param {number} value - The value to subtract from. + * @param {number} amount - The amount to subtract. + * @param {number} min - The minimum value to return. + * + * @return {number} The resulting value. + */ +var MinSub = function (value, amount, min) +{ + return Math.max(value - amount, min); +}; + +module.exports = MinSub; + + +/***/ }), +/* 719 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Work out what percentage `value` is of the range between `min` and `max`. + * If `max` isn't given then it will return the percentage of `value` to `min`. + * + * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again. + * + * @function Phaser.Math.Percent + * @since 3.0.0 + * + * @param {number} value - The value to determine the percentage of. + * @param {number} min - The minimum value. + * @param {number} [max] - The maximum value. + * @param {number} [upperMax] - The mid-way point in the range that represents 100%. + * + * @return {number} A value between 0 and 1 representing the percentage. + */ +var Percent = function (value, min, max, upperMax) +{ + if (max === undefined) { max = min + 1; } + + var percentage = (value - min) / (max - min); + + if (percentage > 1) + { + if (upperMax !== undefined) + { + percentage = ((upperMax - value)) / (upperMax - max); + + if (percentage < 0) + { + percentage = 0; + } + } + else + { + percentage = 1; + } + } + else if (percentage < 0) + { + percentage = 0; + } + + return percentage; +}; + +module.exports = Percent; + + +/***/ }), +/* 720 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random unit vector. + * + * Computes random values for the given vector between -1 and 1 that can be used to represent a direction. + * + * Optionally accepts a scale value to scale the resulting vector by. + * + * @function Phaser.Math.RandomXY + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for. + * @param {number} [scale=1] - The scale of the random values. + * + * @return {Phaser.Math.Vector2} The given Vector. + */ +var RandomXY = function (vector, scale) +{ + if (scale === undefined) { scale = 1; } + + var r = Math.random() * 2 * Math.PI; + + vector.x = Math.cos(r) * scale; + vector.y = Math.sin(r) * scale; + + return vector; +}; + +module.exports = RandomXY; + + +/***/ }), +/* 721 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random position vector in a spherical area, optionally defined by the given radius. + * + * @function Phaser.Math.RandomXYZ + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for. + * @param {number} [radius=1] - The radius. + * + * @return {Phaser.Math.Vector3} The given Vector. + */ +var RandomXYZ = function (vec3, radius) +{ + if (radius === undefined) { radius = 1; } + + var r = Math.random() * 2 * Math.PI; + var z = (Math.random() * 2) - 1; + var zScale = Math.sqrt(1 - z * z) * radius; + + vec3.x = Math.cos(r) * zScale; + vec3.y = Math.sin(r) * zScale; + vec3.z = z * radius; + + return vec3; +}; + +module.exports = RandomXYZ; + + +/***/ }), +/* 722 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compute a random four-dimensional vector. + * + * @function Phaser.Math.RandomXYZW + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for. + * @param {number} [scale=1] - The scale of the random values. + * + * @return {Phaser.Math.Vector4} The given Vector. + */ +var RandomXYZW = function (vec4, scale) +{ + if (scale === undefined) { scale = 1; } + + // TODO: Not spherical; should fix this for more uniform distribution + vec4.x = (Math.random() * 2 - 1) * scale; + vec4.y = (Math.random() * 2 - 1) * scale; + vec4.z = (Math.random() * 2 - 1) * scale; + vec4.w = (Math.random() * 2 - 1) * scale; + + return vec4; +}; + +module.exports = RandomXYZW; + + +/***/ }), +/* 723 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Round a value to the given precision. + * + * For example: + * + * ```javascript + * RoundTo(123.456, 0) = 123 + * RoundTo(123.456, 1) = 120 + * RoundTo(123.456, 2) = 100 + * ``` + * + * To round the decimal, i.e. to round to precision, pass in a negative `place`: + * + * ```javascript + * RoundTo(123.456789, 0) = 123 + * RoundTo(123.456789, -1) = 123.5 + * RoundTo(123.456789, -2) = 123.46 + * RoundTo(123.456789, -3) = 123.457 + * ``` + * + * @function Phaser.Math.RoundTo + * @since 3.0.0 + * + * @param {number} value - The value to round. + * @param {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * + * @return {number} The rounded value. + */ +var RoundTo = function (value, place, base) +{ + if (place === undefined) { place = 0; } + if (base === undefined) { base = 10; } + + var p = Math.pow(base, -place); + + return Math.round(value * p) / p; +}; + +module.exports = RoundTo; + + +/***/ }), +/* 724 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Generate a series of sine and cosine values. + * + * @function Phaser.Math.SinCosTableGenerator + * @since 3.0.0 + * + * @param {number} length - The number of values to generate. + * @param {number} [sinAmp=1] - The sine value amplitude. + * @param {number} [cosAmp=1] - The cosine value amplitude. + * @param {number} [frequency=1] - The frequency of the values. + * + * @return {Phaser.Types.Math.SinCosTable} The generated values. + */ +var SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency) +{ + if (sinAmp === undefined) { sinAmp = 1; } + if (cosAmp === undefined) { cosAmp = 1; } + if (frequency === undefined) { frequency = 1; } + + frequency *= Math.PI / length; + + var cos = []; + var sin = []; + + for (var c = 0; c < length; c++) + { + cosAmp -= sinAmp * frequency; + sinAmp += cosAmp * frequency; + + cos[c] = cosAmp; + sin[c] = sinAmp; + } + + return { + sin: sin, + cos: cos, + length: length + }; +}; + +module.exports = SinCosTableGenerator; + + +/***/ }), +/* 725 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if the two values are within the given `tolerance` of each other. + * + * @function Phaser.Math.Within + * @since 3.0.0 + * + * @param {number} a - The first value to use in the calculation. + * @param {number} b - The second value to use in the calculation. + * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range. + * + * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`. + */ +var Within = function (a, b, tolerance) +{ + return (Math.abs(a - b) <= tolerance); +}; + +module.exports = Within; + + +/***/ }), +/* 726 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector3 = __webpack_require__(170); +var Matrix4 = __webpack_require__(310); +var Quaternion = __webpack_require__(311); + +var tmpMat4 = new Matrix4(); +var tmpQuat = new Quaternion(); +var tmpVec3 = new Vector3(); + +/** + * Rotates a vector in place by axis angle. + * + * This is the same as transforming a point by an + * axis-angle quaternion, but it has higher precision. + * + * @function Phaser.Math.RotateVec3 + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} vec - The vector to be rotated. + * @param {Phaser.Math.Vector3} axis - The axis to rotate around. + * @param {number} radians - The angle of rotation in radians. + * + * @return {Phaser.Math.Vector3} The given vector. + */ +var RotateVec3 = function (vec, axis, radians) +{ + // Set the quaternion to our axis angle + tmpQuat.setAxisAngle(axis, radians); + + // Create a rotation matrix from the axis angle + tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0)); + + // Multiply our vector by the rotation matrix + return vec.transformMat4(tmpMat4); +}; + +module.exports = RotateVec3; + + +/***/ }), +/* 727 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Texture Add Event. + * + * This event is dispatched by the Texture Manager when a texture is added to it. + * + * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`. + * + * @event Phaser.Textures.Events#ADD + * @since 3.0.0 + * + * @param {string} key - The key of the Texture that was added to the Texture Manager. + * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was added to the Texture Manager. + */ +module.exports = 'addtexture'; + + +/***/ }), +/* 728 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Texture Load Error Event. + * + * This event is dispatched by the Texture Manager when a texture it requested to load failed. + * This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin. + * + * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`. + * + * @event Phaser.Textures.Events#ERROR + * @since 3.0.0 + * + * @param {string} key - The key of the Texture that failed to load into the Texture Manager. + */ +module.exports = 'onerror'; + + +/***/ }), +/* 729 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Texture Load Event. + * + * This event is dispatched by the Texture Manager when a texture has finished loading on it. + * This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin. + * + * Listen to this event from within a Scene using: `this.textures.on('onload', listener)`. + * + * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event. + * + * @event Phaser.Textures.Events#LOAD + * @since 3.0.0 + * + * @param {string} key - The key of the Texture that was loaded by the Texture Manager. + * @param {Phaser.Textures.Texture} texture - A reference to the Texture that was loaded by the Texture Manager. + */ +module.exports = 'onload'; + + +/***/ }), +/* 730 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This internal event signifies that the Texture Manager is now ready and the Game can continue booting. + * + * When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking + * async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game + * instance, which tells the Game to carry on booting. + * + * @event Phaser.Textures.Events#READY + * @since 3.16.1 + */ +module.exports = 'ready'; + + +/***/ }), +/* 731 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Texture Remove Event. + * + * This event is dispatched by the Texture Manager when a texture is removed from it. + * + * Listen to this event from within a Scene using: `this.textures.on('removetexture', listener)`. + * + * If you have any Game Objects still using the removed texture, they will start throwing + * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. + * + * @event Phaser.Textures.Events#REMOVE + * @since 3.0.0 + * + * @param {string} key - The key of the Texture that was removed from the Texture Manager. + */ +module.exports = 'removetexture'; + + +/***/ }), +/* 732 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_BITMAP_MASK_FS', + '', + 'precision mediump float;', + '', + 'uniform vec2 uResolution;', + 'uniform sampler2D uMainSampler;', + 'uniform sampler2D uMaskSampler;', + 'uniform bool uInvertMaskAlpha;', + '', + 'void main()', + '{', + ' vec2 uv = gl_FragCoord.xy / uResolution;', + ' vec4 mainColor = texture2D(uMainSampler, uv);', + ' vec4 maskColor = texture2D(uMaskSampler, uv);', + ' float alpha = mainColor.a;', + '', + ' if (!uInvertMaskAlpha)', + ' {', + ' alpha *= (maskColor.a);', + ' }', + ' else', + ' {', + ' alpha *= (1.0 - maskColor.a);', + ' }', + '', + ' gl_FragColor = vec4(mainColor.rgb * alpha, alpha);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 733 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_BITMAP_MASK_VS', + '', + 'precision mediump float;', + '', + 'attribute vec2 inPosition;', + '', + 'void main()', + '{', + ' gl_Position = vec4(inPosition, 0.0, 1.0);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 734 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_FORWARD_DIFFUSE_FS', + '', + 'precision mediump float;', + '', + 'struct Light', + '{', + ' vec2 position;', + ' vec3 color;', + ' float intensity;', + ' float radius;', + '};', + '', + 'const int kMaxLights = %LIGHT_COUNT%;', + '', + 'uniform vec4 uCamera; /* x, y, rotation, zoom */', + 'uniform vec2 uResolution;', + 'uniform sampler2D uMainSampler;', + 'uniform sampler2D uNormSampler;', + 'uniform vec3 uAmbientLightColor;', + 'uniform Light uLights[kMaxLights];', + 'uniform mat3 uInverseRotationMatrix;', + '', + 'varying vec2 outTexCoord;', + 'varying vec4 outTint;', + '', + 'void main()', + '{', + ' vec3 finalColor = vec3(0.0, 0.0, 0.0);', + ' vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);', + ' vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;', + ' vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));', + ' vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;', + '', + ' for (int index = 0; index < kMaxLights; ++index)', + ' {', + ' Light light = uLights[index];', + ' vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);', + ' vec3 lightNormal = normalize(lightDir);', + ' float distToSurf = length(lightDir) * uCamera.w;', + ' float diffuseFactor = max(dot(normal, lightNormal), 0.0);', + ' float radius = (light.radius / res.x * uCamera.w) * uCamera.w;', + ' float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);', + ' vec3 diffuse = light.color * diffuseFactor;', + ' finalColor += (attenuation * diffuse) * light.intensity;', + ' }', + '', + ' vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);', + ' gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);', + '', + '}', + '' +].join('\n'); + + +/***/ }), +/* 735 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_TEXTURE_TINT_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler;', + '', + 'varying vec2 outTexCoord;', + 'varying float outTintEffect;', + 'varying vec4 outTint;', + '', + 'void main()', + '{', + ' vec4 texture = texture2D(uMainSampler, outTexCoord);', + ' vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);', + ' vec4 color = texture;', + '', + ' if (outTintEffect == 0.0)', + ' {', + ' // Multiply texture tint', + ' color = texture * texel;', + ' }', + ' else if (outTintEffect == 1.0)', + ' {', + ' // Solid color + texture alpha', + ' color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);', + ' color.a = texture.a * texel.a;', + ' }', + ' else if (outTintEffect == 2.0)', + ' {', + ' // Solid color, no texture', + ' color = texel;', + ' }', + '', + ' gl_FragColor = color;', + '}', + '' +].join('\n'); + + +/***/ }), +/* 736 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_TEXTURE_TINT_VS', + '', + 'precision mediump float;', + '', + 'uniform mat4 uProjectionMatrix;', + 'uniform mat4 uViewMatrix;', + 'uniform mat4 uModelMatrix;', + '', + 'attribute vec2 inPosition;', + 'attribute vec2 inTexCoord;', + 'attribute float inTintEffect;', + 'attribute vec4 inTint;', + '', + 'varying vec2 outTexCoord;', + 'varying float outTintEffect;', + 'varying vec4 outTint;', + '', + 'void main ()', + '{', + ' gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);', + '', + ' outTexCoord = inTexCoord;', + ' outTint = inTint;', + ' outTintEffect = inTintEffect;', + '}', + '', + '' +].join('\n'); + + +/***/ }), +/* 737 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Create + */ + +module.exports = { + + GenerateTexture: __webpack_require__(318), + Palettes: __webpack_require__(738) + +}; + + +/***/ }), +/* 738 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Create.Palettes + */ + +module.exports = { + + ARNE16: __webpack_require__(319), + C64: __webpack_require__(739), + CGA: __webpack_require__(740), + JMP: __webpack_require__(741), + MSX: __webpack_require__(742) + +}; + + +/***/ }), +/* 739 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A 16 color palette inspired by the Commodore 64. + * + * @name Phaser.Create.Palettes.C64 + * @since 3.0.0 + * + * @type {Phaser.Types.Create.Palette} + */ +module.exports = { + 0: '#000', + 1: '#fff', + 2: '#8b4131', + 3: '#7bbdc5', + 4: '#8b41ac', + 5: '#6aac41', + 6: '#3931a4', + 7: '#d5de73', + 8: '#945a20', + 9: '#5a4100', + A: '#bd736a', + B: '#525252', + C: '#838383', + D: '#acee8b', + E: '#7b73de', + F: '#acacac' +}; + + +/***/ }), +/* 740 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A 16 color CGA inspired palette by [Arne](http://androidarts.com/palette/16pal.htm) + * + * @name Phaser.Create.Palettes.CGA + * @since 3.0.0 + * + * @type {Phaser.Types.Create.Palette} + */ +module.exports = { + 0: '#000', + 1: '#2234d1', + 2: '#0c7e45', + 3: '#44aacc', + 4: '#8a3622', + 5: '#5c2e78', + 6: '#aa5c3d', + 7: '#b5b5b5', + 8: '#5e606e', + 9: '#4c81fb', + A: '#6cd947', + B: '#7be2f9', + C: '#eb8a60', + D: '#e23d69', + E: '#ffd93f', + F: '#fff' +}; + + +/***/ }), +/* 741 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A 16 color JMP palette by [Arne](http://androidarts.com/palette/16pal.htm) + * + * @name Phaser.Create.Palettes.JMP + * @since 3.0.0 + * + * @type {Phaser.Types.Create.Palette} + */ +module.exports = { + 0: '#000', + 1: '#191028', + 2: '#46af45', + 3: '#a1d685', + 4: '#453e78', + 5: '#7664fe', + 6: '#833129', + 7: '#9ec2e8', + 8: '#dc534b', + 9: '#e18d79', + A: '#d6b97b', + B: '#e9d8a1', + C: '#216c4b', + D: '#d365c8', + E: '#afaab9', + F: '#f5f4eb' +}; + + +/***/ }), +/* 742 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A 16 color palette inspired by Japanese computers like the MSX. + * + * @name Phaser.Create.Palettes.MSX + * @since 3.0.0 + * + * @type {Phaser.Types.Create.Palette} + */ +module.exports = { + 0: '#000', + 1: '#191028', + 2: '#46af45', + 3: '#a1d685', + 4: '#453e78', + 5: '#7664fe', + 6: '#833129', + 7: '#9ec2e8', + 8: '#dc534b', + 9: '#e18d79', + A: '#d6b97b', + B: '#e9d8a1', + C: '#216c4b', + D: '#d365c8', + E: '#afaab9', + F: '#fff' +}; + + +/***/ }), +/* 743 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Curves + */ + +module.exports = { + Path: __webpack_require__(744), + + CubicBezier: __webpack_require__(320), + Curve: __webpack_require__(79), + Ellipse: __webpack_require__(321), + Line: __webpack_require__(322), + QuadraticBezier: __webpack_require__(323), + Spline: __webpack_require__(324) +}; + + +/***/ }), +/* 744 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) + +var Class = __webpack_require__(0); +var CubicBezierCurve = __webpack_require__(320); +var EllipseCurve = __webpack_require__(321); +var GameObjectFactory = __webpack_require__(5); +var LineCurve = __webpack_require__(322); +var MovePathTo = __webpack_require__(745); +var QuadraticBezierCurve = __webpack_require__(323); +var Rectangle = __webpack_require__(10); +var SplineCurve = __webpack_require__(324); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Path combines multiple Curves into one continuous compound curve. + * It does not matter how many Curves are in the Path or what type they are. + * + * A Curve in a Path does not have to start where the previous Curve ends - that is to say, a Path does not + * have to be an uninterrupted curve. Only the order of the Curves influences the actual points on the Path. + * + * @class Path + * @memberof Phaser.Curves + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The X coordinate of the Path's starting point or a {@link Phaser.Types.Curves.JSONPath}. + * @param {number} [y=0] - The Y coordinate of the Path's starting point. + */ +var Path = new Class({ + + initialize: + + function Path (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + /** + * The name of this Path. + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.Curves.Path#name + * @type {string} + * @default '' + * @since 3.0.0 + */ + this.name = ''; + + /** + * The list of Curves which make up this Path. + * + * @name Phaser.Curves.Path#curves + * @type {Phaser.Curves.Curve[]} + * @default [] + * @since 3.0.0 + */ + this.curves = []; + + /** + * The cached length of each Curve in the Path. + * + * Used internally by {@link #getCurveLengths}. + * + * @name Phaser.Curves.Path#cacheLengths + * @type {number[]} + * @default [] + * @since 3.0.0 + */ + this.cacheLengths = []; + + /** + * Automatically closes the path. + * + * @name Phaser.Curves.Path#autoClose + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.autoClose = false; + + /** + * The starting point of the Path. + * + * This is not necessarily equivalent to the starting point of the first Curve in the Path. In an empty Path, it's also treated as the ending point. + * + * @name Phaser.Curves.Path#startPoint + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.startPoint = new Vector2(); + + /** + * A temporary vector used to avoid object creation when adding a Curve to the Path. + * + * @name Phaser.Curves.Path#_tmpVec2A + * @type {Phaser.Math.Vector2} + * @private + * @since 3.0.0 + */ + this._tmpVec2A = new Vector2(); + + /** + * A temporary vector used to avoid object creation when adding a Curve to the Path. + * + * @name Phaser.Curves.Path#_tmpVec2B + * @type {Phaser.Math.Vector2} + * @private + * @since 3.0.0 + */ + this._tmpVec2B = new Vector2(); + + if (typeof x === 'object') + { + this.fromJSON(x); + } + else + { + this.startPoint.set(x, y); + } + }, + + /** + * Appends a Curve to the end of the Path. + * + * The Curve does not have to start where the Path ends or, for an empty Path, at its defined starting point. + * + * @method Phaser.Curves.Path#add + * @since 3.0.0 + * + * @param {Phaser.Curves.Curve} curve - The Curve to append. + * + * @return {Phaser.Curves.Path} This Path object. + */ + add: function (curve) + { + this.curves.push(curve); + + return this; + }, + + /** + * Creates a circular Ellipse Curve positioned at the end of the Path. + * + * @method Phaser.Curves.Path#circleTo + * @since 3.0.0 + * + * @param {number} radius - The radius of the circle. + * @param {boolean} [clockwise=false] - `true` to create a clockwise circle as opposed to a counter-clockwise circle. + * @param {number} [rotation=0] - The rotation of the circle in degrees. + * + * @return {Phaser.Curves.Path} This Path object. + */ + circleTo: function (radius, clockwise, rotation) + { + if (clockwise === undefined) { clockwise = false; } + + return this.ellipseTo(radius, radius, 0, 360, clockwise, rotation); + }, + + /** + * Ensures that the Path is closed. + * + * A closed Path starts and ends at the same point. If the Path is not closed, a straight Line Curve will be created from the ending point directly to the starting point. During the check, the actual starting point of the Path, i.e. the starting point of the first Curve, will be used as opposed to the Path's defined {@link startPoint}, which could differ. + * + * Calling this method on an empty Path will result in an error. + * + * @method Phaser.Curves.Path#closePath + * @since 3.0.0 + * + * @return {Phaser.Curves.Path} This Path object. + */ + closePath: function () + { + // Add a line curve if start and end of lines are not connected + var startPoint = this.curves[0].getPoint(0); + var endPoint = this.curves[this.curves.length - 1].getPoint(1); + + if (!startPoint.equals(endPoint)) + { + // This will copy a reference to the vectors, which probably isn't sensible + this.curves.push(new LineCurve(endPoint, startPoint)); + } + + return this; + }, + + /** + * Creates a cubic bezier curve starting at the previous end point and ending at p3, using p1 and p2 as control points. + * + * @method Phaser.Curves.Path#cubicBezierTo + * @since 3.0.0 + * + * @param {(number|Phaser.Math.Vector2)} x - The x coordinate of the end point. Or, if a Vec2, the p1 value. + * @param {(number|Phaser.Math.Vector2)} y - The y coordinate of the end point. Or, if a Vec2, the p2 value. + * @param {(number|Phaser.Math.Vector2)} control1X - The x coordinate of the first control point. Or, if a Vec2, the p3 value. + * @param {number} [control1Y] - The y coordinate of the first control point. Not used if vec2s are provided as the first 3 arguments. + * @param {number} [control2X] - The x coordinate of the second control point. Not used if vec2s are provided as the first 3 arguments. + * @param {number} [control2Y] - The y coordinate of the second control point. Not used if vec2s are provided as the first 3 arguments. + * + * @return {Phaser.Curves.Path} This Path object. + */ + cubicBezierTo: function (x, y, control1X, control1Y, control2X, control2Y) + { + var p0 = this.getEndPoint(); + var p1; + var p2; + var p3; + + // Assume they're all vec2s + if (x instanceof Vector2) + { + p1 = x; + p2 = y; + p3 = control1X; + } + else + { + p1 = new Vector2(control1X, control1Y); + p2 = new Vector2(control2X, control2Y); + p3 = new Vector2(x, y); + } + + return this.add(new CubicBezierCurve(p0, p1, p2, p3)); + }, + + // Creates a quadratic bezier curve starting at the previous end point and ending at p2, using p1 as a control point + + /** + * Creates a Quadratic Bezier Curve starting at the ending point of the Path. + * + * @method Phaser.Curves.Path#quadraticBezierTo + * @since 3.2.0 + * + * @param {(number|Phaser.Math.Vector2[])} x - The X coordinate of the second control point or, if it's a `Vector2`, the first control point. + * @param {number} [y] - The Y coordinate of the second control point or, if `x` is a `Vector2`, the second control point. + * @param {number} [controlX] - If `x` is not a `Vector2`, the X coordinate of the first control point. + * @param {number} [controlY] - If `x` is not a `Vector2`, the Y coordinate of the first control point. + * + * @return {Phaser.Curves.Path} This Path object. + */ + quadraticBezierTo: function (x, y, controlX, controlY) + { + var p0 = this.getEndPoint(); + var p1; + var p2; + + // Assume they're all vec2s + if (x instanceof Vector2) + { + p1 = x; + p2 = y; + } + else + { + p1 = new Vector2(controlX, controlY); + p2 = new Vector2(x, y); + } + + return this.add(new QuadraticBezierCurve(p0, p1, p2)); + }, + + /** + * Draws all Curves in the Path to a Graphics Game Object. + * + * @method Phaser.Curves.Path#draw + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.Graphics} G - [out,$return] + * + * @param {Phaser.GameObjects.Graphics} graphics - The Graphics Game Object to draw to. + * @param {integer} [pointsTotal=32] - The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing. + * + * @return {Phaser.GameObjects.Graphics} The Graphics object which was drawn to. + */ + draw: function (graphics, pointsTotal) + { + for (var i = 0; i < this.curves.length; i++) + { + var curve = this.curves[i]; + + if (!curve.active) + { + continue; + } + + curve.draw(graphics, pointsTotal); + } + + return graphics; + }, + + /** + * Creates an ellipse curve positioned at the previous end point, using the given parameters. + * + * @method Phaser.Curves.Path#ellipseTo + * @since 3.0.0 + * + * @param {number} xRadius - The horizontal radius of the ellipse. + * @param {number} yRadius - The vertical radius of the ellipse. + * @param {number} startAngle - The start angle of the ellipse, in degrees. + * @param {number} endAngle - The end angle of the ellipse, in degrees. + * @param {boolean} clockwise - Whether the ellipse should be rotated clockwise (`true`) or counter-clockwise (`false`). + * @param {number} rotation - The rotation of the ellipse, in degrees. + * + * @return {Phaser.Curves.Path} This Path object. + */ + ellipseTo: function (xRadius, yRadius, startAngle, endAngle, clockwise, rotation) + { + var ellipse = new EllipseCurve(0, 0, xRadius, yRadius, startAngle, endAngle, clockwise, rotation); + + var end = this.getEndPoint(this._tmpVec2A); + + // Calculate where to center the ellipse + var start = ellipse.getStartPoint(this._tmpVec2B); + + end.subtract(start); + + ellipse.x = end.x; + ellipse.y = end.y; + + return this.add(ellipse); + }, + + /** + * Creates a Path from a Path Configuration object. + * + * The provided object should be a {@link Phaser.Types.Curves.JSONPath}, as returned by {@link #toJSON}. Providing a malformed object may cause errors. + * + * @method Phaser.Curves.Path#fromJSON + * @since 3.0.0 + * + * @param {Phaser.Types.Curves.JSONPath} data - The JSON object containing the Path data. + * + * @return {Phaser.Curves.Path} This Path object. + */ + fromJSON: function (data) + { + // data should be an object matching the Path.toJSON object structure. + + this.curves = []; + this.cacheLengths = []; + + this.startPoint.set(data.x, data.y); + + this.autoClose = data.autoClose; + + for (var i = 0; i < data.curves.length; i++) + { + var curve = data.curves[i]; + + switch (curve.type) + { + case 'LineCurve': + this.add(LineCurve.fromJSON(curve)); + break; + + case 'EllipseCurve': + this.add(EllipseCurve.fromJSON(curve)); + break; + + case 'SplineCurve': + this.add(SplineCurve.fromJSON(curve)); + break; + + case 'CubicBezierCurve': + this.add(CubicBezierCurve.fromJSON(curve)); + break; + + case 'QuadraticBezierCurve': + this.add(QuadraticBezierCurve.fromJSON(curve)); + break; + } + } + + return this; + }, + + /** + * Returns a Rectangle with a position and size matching the bounds of this Path. + * + * @method Phaser.Curves.Path#getBounds + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in. + * @param {integer} [accuracy=16] - The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed. + * + * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. + */ + getBounds: function (out, accuracy) + { + if (out === undefined) { out = new Rectangle(); } + if (accuracy === undefined) { accuracy = 16; } + + out.x = Number.MAX_VALUE; + out.y = Number.MAX_VALUE; + + var bounds = new Rectangle(); + var maxRight = Number.MIN_SAFE_INTEGER; + var maxBottom = Number.MIN_SAFE_INTEGER; + + for (var i = 0; i < this.curves.length; i++) + { + var curve = this.curves[i]; + + if (!curve.active) + { + continue; + } + + curve.getBounds(bounds, accuracy); + + out.x = Math.min(out.x, bounds.x); + out.y = Math.min(out.y, bounds.y); + + maxRight = Math.max(maxRight, bounds.right); + maxBottom = Math.max(maxBottom, bounds.bottom); + } + + out.right = maxRight; + out.bottom = maxBottom; + + return out; + }, + + /** + * Returns an array containing the length of the Path at the end of each Curve. + * + * The result of this method will be cached to avoid recalculating it in subsequent calls. The cache is only invalidated when the {@link #curves} array changes in length, leading to potential inaccuracies if a Curve in the Path is changed, or if a Curve is removed and another is added in its place. + * + * @method Phaser.Curves.Path#getCurveLengths + * @since 3.0.0 + * + * @return {number[]} An array containing the length of the Path at the end of each one of its Curves. + */ + getCurveLengths: function () + { + // We use cache values if curves and cache array are same length + + if (this.cacheLengths.length === this.curves.length) + { + return this.cacheLengths; + } + + // Get length of sub-curve + // Push sums into cached array + + var lengths = []; + var sums = 0; + + for (var i = 0; i < this.curves.length; i++) + { + sums += this.curves[i].getLength(); + + lengths.push(sums); + } + + this.cacheLengths = lengths; + + return lengths; + }, + + /** + * Returns the ending point of the Path. + * + * A Path's ending point is equivalent to the ending point of the last Curve in the Path. For an empty Path, the ending point is at the Path's defined {@link #startPoint}. + * + * @method Phaser.Curves.Path#getEndPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Math.Vector2} [out] - The object to store the point in. + * + * @return {Phaser.Math.Vector2} The modified `out` object, or a new Vector2 if none was provided. + */ + getEndPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + if (this.curves.length > 0) + { + this.curves[this.curves.length - 1].getPoint(1, out); + } + else + { + out.copy(this.startPoint); + } + + return out; + }, + + /** + * Returns the total length of the Path. + * + * @see {@link #getCurveLengths} + * + * @method Phaser.Curves.Path#getLength + * @since 3.0.0 + * + * @return {number} The total length of the Path. + */ + getLength: function () + { + var lens = this.getCurveLengths(); + + return lens[lens.length - 1]; + }, + + // To get accurate point with reference to + // entire path distance at time t, + // following has to be done: + + // 1. Length of each sub path have to be known + // 2. Locate and identify type of curve + // 3. Get t for the curve + // 4. Return curve.getPointAt(t') + + /** + * Calculates the coordinates of the point at the given normalized location (between 0 and 1) on the Path. + * + * The location is relative to the entire Path, not to an individual Curve. A location of 0.5 is always in the middle of the Path and is thus an equal distance away from both its starting and ending points. In a Path with one Curve, it would be in the middle of the Curve; in a Path with two Curves, it could be anywhere on either one of them depending on their lengths. + * + * @method Phaser.Curves.Path#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} t - The location of the point to return, between 0 and 1. + * @param {Phaser.Math.Vector2} [out] - The object in which to store the calculated point. + * + * @return {?Phaser.Math.Vector2} The modified `out` object, or a new `Vector2` if none was provided. + */ + getPoint: function (t, out) + { + if (out === undefined) { out = new Vector2(); } + + var d = t * this.getLength(); + var curveLengths = this.getCurveLengths(); + var i = 0; + + while (i < curveLengths.length) + { + if (curveLengths[i] >= d) + { + var diff = curveLengths[i] - d; + var curve = this.curves[i]; + + var segmentLength = curve.getLength(); + var u = (segmentLength === 0) ? 0 : 1 - diff / segmentLength; + + return curve.getPointAt(u, out); + } + + i++; + } + + // loop where sum != 0, sum > d , sum+1 1 && !points[points.length - 1].equals(points[0])) + { + points.push(points[0]); + } + + return points; + }, + + /** + * [description] + * + * @method Phaser.Curves.Path#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Math.Vector2} [out] - `Vector2` instance that should be used for storing the result. If `undefined` a new `Vector2` will be created. + * + * @return {Phaser.Math.Vector2} [description] + */ + getRandomPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + return this.getPoint(Math.random(), out); + }, + + /** + * Creates a straight Line Curve from the ending point of the Path to the given coordinates. + * + * @method Phaser.Curves.Path#getSpacedPoints + * @since 3.0.0 + * + * @param {integer} [divisions=40] - The X coordinate of the line's ending point, or the line's ending point as a `Vector2`. + * + * @return {Phaser.Math.Vector2[]} [description] + */ + getSpacedPoints: function (divisions) + { + if (divisions === undefined) { divisions = 40; } + + var points = []; + + for (var i = 0; i <= divisions; i++) + { + points.push(this.getPoint(i / divisions)); + } + + if (this.autoClose) + { + points.push(points[0]); + } + + return points; + }, + + /** + * [description] + * + * @method Phaser.Curves.Path#getStartPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ + getStartPoint: function (out) + { + if (out === undefined) { out = new Vector2(); } + + return out.copy(this.startPoint); + }, + + // Creates a line curve from the previous end point to x/y + + /** + * [description] + * + * @method Phaser.Curves.Path#lineTo + * @since 3.0.0 + * + * @param {(number|Phaser.Math.Vector2)} x - [description] + * @param {number} [y] - [description] + * + * @return {Phaser.Curves.Path} [description] + */ + lineTo: function (x, y) + { + if (x instanceof Vector2) + { + this._tmpVec2B.copy(x); + } + else + { + this._tmpVec2B.set(x, y); + } + + var end = this.getEndPoint(this._tmpVec2A); + + return this.add(new LineCurve([ end.x, end.y, this._tmpVec2B.x, this._tmpVec2B.y ])); + }, + + // Creates a spline curve starting at the previous end point, using the given parameters + + /** + * [description] + * + * @method Phaser.Curves.Path#splineTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2[]} points - [description] + * + * @return {Phaser.Curves.Path} [description] + */ + splineTo: function (points) + { + points.unshift(this.getEndPoint()); + + return this.add(new SplineCurve(points)); + }, + + /** + * [description] + * + * @method Phaser.Curves.Path#moveTo + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + * + * @return {Phaser.Curves.Path} [description] + */ + moveTo: function (x, y) + { + return this.add(new MovePathTo(x, y)); + }, + + /** + * [description] + * + * @method Phaser.Curves.Path#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Curves.JSONPath} [description] + */ + toJSON: function () + { + var out = []; + + for (var i = 0; i < this.curves.length; i++) + { + out.push(this.curves[i].toJSON()); + } + + return { + type: 'Path', + x: this.startPoint.x, + y: this.startPoint.y, + autoClose: this.autoClose, + curves: out + }; + }, + + // cacheLengths must be recalculated. + + /** + * [description] + * + * @method Phaser.Curves.Path#updateArcLengths + * @since 3.0.0 + */ + updateArcLengths: function () + { + this.cacheLengths = []; + + this.getCurveLengths(); + }, + + /** + * [description] + * + * @method Phaser.Curves.Path#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.curves.length = 0; + this.cacheLengths.length = 0; + this.startPoint = undefined; + } + +}); + +/** + * Creates a new Path Object. + * + * @method Phaser.GameObjects.GameObjectFactory#path + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Path. + * @param {number} y - The vertical position of this Path. + * + * @return {Phaser.Curves.Path} The Path Object that was created. + */ +GameObjectFactory.register('path', function (x, y) +{ + return new Path(x, y); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + +module.exports = Path; + + +/***/ }), +/* 745 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A MoveTo Curve is a very simple curve consisting of only a single point. Its intended use is to move the ending point in a Path. + * + * @class MoveTo + * @memberof Phaser.Curves + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - `x` pixel coordinate. + * @param {number} [y] - `y` pixel coordinate. + */ +var MoveTo = new Class({ + + initialize: + + function MoveTo (x, y) + { + // Skip length calcs in paths + + /** + * Denotes that this Curve does not influence the bounds, points, and drawing of its parent Path. Must be `false` or some methods in the parent Path will throw errors. + * + * @name Phaser.Curves.MoveTo#active + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.active = false; + + /** + * The lone point which this curve consists of. + * + * @name Phaser.Curves.MoveTo#p0 + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.p0 = new Vector2(x, y); + }, + + /** + * Get point at relative position in curve according to length. + * + * @method Phaser.Curves.MoveTo#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} t - The position along the curve to return. Where 0 is the start and 1 is the end. + * @param {Phaser.Math.Vector2} [out] - A Vector2 object to store the result in. If not given will be created. + * + * @return {Phaser.Math.Vector2} The coordinates of the point on the curve. If an `out` object was given this will be returned. + */ + getPoint: function (t, out) + { + if (out === undefined) { out = new Vector2(); } + + return out.copy(this.p0); + }, + + /** + * Retrieves the point at given position in the curve. This will always return this curve's only point. + * + * @method Phaser.Curves.MoveTo#getPointAt + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {number} u - The position in the path to retrieve, between 0 and 1. Not used. + * @param {Phaser.Math.Vector2} [out] - An optional vector in which to store the point. + * + * @return {Phaser.Math.Vector2} The modified `out` vector, or a new `Vector2` if none was provided. + */ + getPointAt: function (u, out) + { + return this.getPoint(u, out); + }, + + /** + * Gets the resolution of this curve. + * + * @method Phaser.Curves.MoveTo#getResolution + * @since 3.0.0 + * + * @return {number} The resolution of this curve. For a MoveTo the value is always 1. + */ + getResolution: function () + { + return 1; + }, + + /** + * Gets the length of this curve. + * + * @method Phaser.Curves.MoveTo#getLength + * @since 3.0.0 + * + * @return {number} The length of this curve. For a MoveTo the value is always 0. + */ + getLength: function () + { + return 0; + }, + + /** + * Converts this curve into a JSON-serializable object. + * + * @method Phaser.Curves.MoveTo#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Curves.JSONCurve} A primitive object with the curve's type and only point. + */ + toJSON: function () + { + return { + type: 'MoveTo', + points: [ + this.p0.x, this.p0.y + ] + }; + } + +}); + +module.exports = MoveTo; + + +/***/ }), +/* 746 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Data + */ + +module.exports = { + + DataManager: __webpack_require__(109), + DataManagerPlugin: __webpack_require__(747), + Events: __webpack_require__(259) + +}; + + +/***/ }), +/* 747 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var DataManager = __webpack_require__(109); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); + +/** + * @classdesc + * The Data Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + * + * @class DataManagerPlugin + * @extends Phaser.Data.DataManager + * @memberof Phaser.Data + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that this DataManager belongs to. + */ +var DataManagerPlugin = new Class({ + + Extends: DataManager, + + initialize: + + function DataManagerPlugin (scene) + { + DataManager.call(this, scene, scene.sys.events); + + /** + * A reference to the Scene that this DataManager belongs to. + * + * @name Phaser.Data.DataManagerPlugin#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Scene's Systems. + * + * @name Phaser.Data.DataManagerPlugin#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Data.DataManagerPlugin#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.events = this.systems.events; + + this.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Data.DataManagerPlugin#start + * @private + * @since 3.5.0 + */ + start: function () + { + this.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.Data.DataManagerPlugin#shutdown + * @private + * @since 3.5.0 + */ + shutdown: function () + { + this.systems.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.Data.DataManagerPlugin#destroy + * @since 3.5.0 + */ + destroy: function () + { + DataManager.prototype.destroy.call(this); + + this.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + } + +}); + +PluginCache.register('DataManagerPlugin', DataManagerPlugin, 'data'); + +module.exports = DataManagerPlugin; + + +/***/ }), +/* 748 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Display + */ + +module.exports = { + + Align: __webpack_require__(749), + BaseShader: __webpack_require__(325), + Bounds: __webpack_require__(764), + Canvas: __webpack_require__(767), + Color: __webpack_require__(326), + Masks: __webpack_require__(776) + +}; + + +/***/ }), +/* 749 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(143); +var Extend = __webpack_require__(17); + +/** + * @namespace Phaser.Display.Align + */ + +var Align = { + + In: __webpack_require__(750), + To: __webpack_require__(751) + +}; + +// Merge in the consts +Align = Extend(false, Align, CONST); + +module.exports = Align; + + +/***/ }), +/* 750 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Display.Align.In + */ + +module.exports = { + + BottomCenter: __webpack_require__(231), + BottomLeft: __webpack_require__(232), + BottomRight: __webpack_require__(233), + Center: __webpack_require__(234), + LeftCenter: __webpack_require__(236), + QuickSet: __webpack_require__(230), + RightCenter: __webpack_require__(237), + TopCenter: __webpack_require__(238), + TopLeft: __webpack_require__(239), + TopRight: __webpack_require__(240) + +}; + + +/***/ }), +/* 751 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Display.Align.To + */ + +module.exports = { + + BottomCenter: __webpack_require__(752), + BottomLeft: __webpack_require__(753), + BottomRight: __webpack_require__(754), + LeftBottom: __webpack_require__(755), + LeftCenter: __webpack_require__(756), + LeftTop: __webpack_require__(757), + RightBottom: __webpack_require__(758), + RightCenter: __webpack_require__(759), + RightTop: __webpack_require__(760), + TopCenter: __webpack_require__(761), + TopLeft: __webpack_require__(762), + TopRight: __webpack_require__(763) + +}; + + +/***/ }), +/* 752 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetBottom = __webpack_require__(38); +var GetCenterX = __webpack_require__(73); +var SetCenterX = __webpack_require__(74); +var SetTop = __webpack_require__(45); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other. + * + * @function Phaser.Display.Align.To.BottomCenter + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var BottomCenter = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetCenterX(gameObject, GetCenterX(alignTo) + offsetX); + SetTop(gameObject, GetBottom(alignTo) + offsetY); + + return gameObject; +}; + +module.exports = BottomCenter; + + +/***/ }), +/* 753 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetBottom = __webpack_require__(38); +var GetLeft = __webpack_require__(40); +var SetLeft = __webpack_require__(41); +var SetTop = __webpack_require__(45); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other. + * + * @function Phaser.Display.Align.To.BottomLeft + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var BottomLeft = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetLeft(gameObject, GetLeft(alignTo) - offsetX); + SetTop(gameObject, GetBottom(alignTo) + offsetY); + + return gameObject; +}; + +module.exports = BottomLeft; + + +/***/ }), +/* 754 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetBottom = __webpack_require__(38); +var GetRight = __webpack_require__(42); +var SetRight = __webpack_require__(43); +var SetTop = __webpack_require__(45); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other. + * + * @function Phaser.Display.Align.To.BottomRight + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var BottomRight = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetRight(gameObject, GetRight(alignTo) + offsetX); + SetTop(gameObject, GetBottom(alignTo) + offsetY); + + return gameObject; +}; + +module.exports = BottomRight; + + +/***/ }), +/* 755 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetBottom = __webpack_require__(38); +var GetLeft = __webpack_require__(40); +var SetBottom = __webpack_require__(39); +var SetRight = __webpack_require__(43); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other. + * + * @function Phaser.Display.Align.To.LeftBottom + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var LeftBottom = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetRight(gameObject, GetLeft(alignTo) - offsetX); + SetBottom(gameObject, GetBottom(alignTo) + offsetY); + + return gameObject; +}; + +module.exports = LeftBottom; + + +/***/ }), +/* 756 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetCenterY = __webpack_require__(76); +var GetLeft = __webpack_require__(40); +var SetCenterY = __webpack_require__(75); +var SetRight = __webpack_require__(43); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the left center position of the other. + * + * @function Phaser.Display.Align.To.LeftCenter + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var LeftCenter = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetRight(gameObject, GetLeft(alignTo) - offsetX); + SetCenterY(gameObject, GetCenterY(alignTo) + offsetY); + + return gameObject; +}; + +module.exports = LeftCenter; + + +/***/ }), +/* 757 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetLeft = __webpack_require__(40); +var GetTop = __webpack_require__(44); +var SetRight = __webpack_require__(43); +var SetTop = __webpack_require__(45); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the left top position of the other. + * + * @function Phaser.Display.Align.To.LeftTop + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var LeftTop = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetRight(gameObject, GetLeft(alignTo) - offsetX); + SetTop(gameObject, GetTop(alignTo) - offsetY); + + return gameObject; +}; + +module.exports = LeftTop; + + +/***/ }), +/* 758 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetBottom = __webpack_require__(38); +var GetRight = __webpack_require__(42); +var SetBottom = __webpack_require__(39); +var SetLeft = __webpack_require__(41); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other. + * + * @function Phaser.Display.Align.To.RightBottom + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var RightBottom = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetLeft(gameObject, GetRight(alignTo) + offsetX); + SetBottom(gameObject, GetBottom(alignTo) + offsetY); + + return gameObject; +}; + +module.exports = RightBottom; + + +/***/ }), +/* 759 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetCenterY = __webpack_require__(76); +var GetRight = __webpack_require__(42); +var SetCenterY = __webpack_require__(75); +var SetLeft = __webpack_require__(41); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the right center position of the other. + * + * @function Phaser.Display.Align.To.RightCenter + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var RightCenter = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetLeft(gameObject, GetRight(alignTo) + offsetX); + SetCenterY(gameObject, GetCenterY(alignTo) + offsetY); + + return gameObject; +}; + +module.exports = RightCenter; + + +/***/ }), +/* 760 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(44); +var SetLeft = __webpack_require__(41); +var SetTop = __webpack_require__(45); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the right top position of the other. + * + * @function Phaser.Display.Align.To.RightTop + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var RightTop = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetLeft(gameObject, GetRight(alignTo) + offsetX); + SetTop(gameObject, GetTop(alignTo) - offsetY); + + return gameObject; +}; + +module.exports = RightTop; + + +/***/ }), +/* 761 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetCenterX = __webpack_require__(73); +var GetTop = __webpack_require__(44); +var SetBottom = __webpack_require__(39); +var SetCenterX = __webpack_require__(74); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the top center position of the other. + * + * @function Phaser.Display.Align.To.TopCenter + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var TopCenter = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetCenterX(gameObject, GetCenterX(alignTo) + offsetX); + SetBottom(gameObject, GetTop(alignTo) - offsetY); + + return gameObject; +}; + +module.exports = TopCenter; + + +/***/ }), +/* 762 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetLeft = __webpack_require__(40); +var GetTop = __webpack_require__(44); +var SetBottom = __webpack_require__(39); +var SetLeft = __webpack_require__(41); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the top left position of the other. + * + * @function Phaser.Display.Align.To.TopLeft + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var TopLeft = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetLeft(gameObject, GetLeft(alignTo) - offsetX); + SetBottom(gameObject, GetTop(alignTo) - offsetY); + + return gameObject; +}; + +module.exports = TopLeft; + + +/***/ }), +/* 763 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(44); +var SetBottom = __webpack_require__(39); +var SetRight = __webpack_require__(43); + +/** + * Takes given Game Object and aligns it so that it is positioned next to the top right position of the other. + * + * @function Phaser.Display.Align.To.TopRight + * @since 3.0.0 + * + * @generic {Phaser.GameObjects.GameObject} G - [gameObject,$return] + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will be positioned. + * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. + * @param {number} [offsetX=0] - Optional horizontal offset from the position. + * @param {number} [offsetY=0] - Optional vertical offset from the position. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was aligned. + */ +var TopRight = function (gameObject, alignTo, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + SetRight(gameObject, GetRight(alignTo) + offsetX); + SetBottom(gameObject, GetTop(alignTo) - offsetY); + + return gameObject; +}; + +module.exports = TopRight; + + +/***/ }), +/* 764 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Display.Bounds + */ + +module.exports = { + + CenterOn: __webpack_require__(235), + GetBottom: __webpack_require__(38), + GetCenterX: __webpack_require__(73), + GetCenterY: __webpack_require__(76), + GetLeft: __webpack_require__(40), + GetOffsetX: __webpack_require__(765), + GetOffsetY: __webpack_require__(766), + GetRight: __webpack_require__(42), + GetTop: __webpack_require__(44), + SetBottom: __webpack_require__(39), + SetCenterX: __webpack_require__(74), + SetCenterY: __webpack_require__(75), + SetLeft: __webpack_require__(41), + SetRight: __webpack_require__(43), + SetTop: __webpack_require__(45) + +}; + + +/***/ }), +/* 765 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the amount the Game Object is visually offset from its x coordinate. + * This is the same as `width * origin.x`. + * This value will only be > 0 if `origin.x` is not equal to zero. + * + * @function Phaser.Display.Bounds.GetOffsetX + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The horizontal offset of the Game Object. + */ +var GetOffsetX = function (gameObject) +{ + return gameObject.width * gameObject.originX; +}; + +module.exports = GetOffsetX; + + +/***/ }), +/* 766 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the amount the Game Object is visually offset from its y coordinate. + * This is the same as `width * origin.y`. + * This value will only be > 0 if `origin.y` is not equal to zero. + * + * @function Phaser.Display.Bounds.GetOffsetY + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to get the bounds value from. + * + * @return {number} The vertical offset of the Game Object. + */ +var GetOffsetY = function (gameObject) +{ + return gameObject.height * gameObject.originY; +}; + +module.exports = GetOffsetY; + + +/***/ }), +/* 767 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Display.Canvas + */ + +module.exports = { + + CanvasInterpolation: __webpack_require__(313), + CanvasPool: __webpack_require__(24), + Smoothing: __webpack_require__(113), + TouchAction: __webpack_require__(768), + UserSelect: __webpack_require__(769) + +}; + + +/***/ }), +/* 768 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions. + * + * @function Phaser.Display.Canvas.TouchAction + * @since 3.0.0 + * + * @param {HTMLCanvasElement} canvas - The canvas element to have the style applied to. + * @param {string} [value='none'] - The touch action value to set on the canvas. Set to `none` to disable touch actions. + * + * @return {HTMLCanvasElement} The canvas element. + */ +var TouchAction = function (canvas, value) +{ + if (value === undefined) { value = 'none'; } + + canvas.style['msTouchAction'] = value; + canvas.style['ms-touch-action'] = value; + canvas.style['touch-action'] = value; + + return canvas; +}; + +module.exports = TouchAction; + + +/***/ }), +/* 769 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sets the user-select property on the canvas style. Can be used to disable default browser selection actions. + * + * @function Phaser.Display.Canvas.UserSelect + * @since 3.0.0 + * + * @param {HTMLCanvasElement} canvas - The canvas element to have the style applied to. + * @param {string} [value='none'] - The touch callout value to set on the canvas. Set to `none` to disable touch callouts. + * + * @return {HTMLCanvasElement} The canvas element. + */ +var UserSelect = function (canvas, value) +{ + if (value === undefined) { value = 'none'; } + + var vendors = [ + '-webkit-', + '-khtml-', + '-moz-', + '-ms-', + '' + ]; + + vendors.forEach(function (vendor) + { + canvas.style[vendor + 'user-select'] = value; + }); + + canvas.style['-webkit-touch-callout'] = value; + canvas.style['-webkit-tap-highlight-color'] = 'rgba(0, 0, 0, 0)'; + + return canvas; +}; + +module.exports = UserSelect; + + +/***/ }), +/* 770 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts the given color value into an Object containing r,g,b and a properties. + * + * @function Phaser.Display.Color.ColorToRGBA + * @since 3.0.0 + * + * @param {number} color - A color value, optionally including the alpha value. + * + * @return {Phaser.Types.Display.ColorObject} An object containing the parsed color values. + */ +var ColorToRGBA = function (color) +{ + var output = { + r: color >> 16 & 0xFF, + g: color >> 8 & 0xFF, + b: color & 0xFF, + a: 255 + }; + + if (color > 16777215) + { + output.a = color >>> 24; + } + + return output; +}; + +module.exports = ColorToRGBA; + + +/***/ }), +/* 771 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Color = __webpack_require__(33); +var HueToComponent = __webpack_require__(328); + +/** + * Converts HSL (hue, saturation and lightness) values to a Phaser Color object. + * + * @function Phaser.Display.Color.HSLToColor + * @since 3.0.0 + * + * @param {number} h - The hue value in the range 0 to 1. + * @param {number} s - The saturation value in the range 0 to 1. + * @param {number} l - The lightness value in the range 0 to 1. + * + * @return {Phaser.Display.Color} A Color object created from the results of the h, s and l values. + */ +var HSLToColor = function (h, s, l) +{ + // achromatic by default + var r = l; + var g = l; + var b = l; + + if (s !== 0) + { + var q = (l < 0.5) ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + + r = HueToComponent(p, q, h + 1 / 3); + g = HueToComponent(p, q, h); + b = HueToComponent(p, q, h - 1 / 3); + } + + var color = new Color(); + + return color.setGLTo(r, g, b, 1); +}; + +module.exports = HSLToColor; + + +/***/ }), +/* 772 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var HSVToRGB = __webpack_require__(161); + +/** + * Get HSV color wheel values in an array which will be 360 elements in size. + * + * @function Phaser.Display.Color.HSVColorWheel + * @since 3.0.0 + * + * @param {number} [s=1] - The saturation, in the range 0 - 1. + * @param {number} [v=1] - The value, in the range 0 - 1. + * + * @return {Phaser.Types.Display.ColorObject[]} An array containing 360 elements, where each contains a single numeric value corresponding to the color at that point in the HSV color wheel. + */ +var HSVColorWheel = function (s, v) +{ + if (s === undefined) { s = 1; } + if (v === undefined) { v = 1; } + + var colors = []; + + for (var c = 0; c <= 359; c++) + { + colors.push(HSVToRGB(c / 359, s, v)); + } + + return colors; +}; + +module.exports = HSVColorWheel; + + +/***/ }), +/* 773 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Linear = __webpack_require__(114); + +/** + * @namespace Phaser.Display.Color.Interpolate + * @memberof Phaser.Display.Color + * @since 3.0.0 + */ + +/** + * Interpolates between the two given color ranges over the length supplied. + * + * @function Phaser.Display.Color.Interpolate.RGBWithRGB + * @memberof Phaser.Display.Color.Interpolate + * @static + * @since 3.0.0 + * + * @param {number} r1 - Red value. + * @param {number} g1 - Blue value. + * @param {number} b1 - Green value. + * @param {number} r2 - Red value. + * @param {number} g2 - Blue value. + * @param {number} b2 - Green value. + * @param {number} [length=100] - Distance to interpolate over. + * @param {number} [index=0] - Index to start from. + * + * @return {Phaser.Types.Display.ColorObject} An object containing the interpolated color values. + */ +var RGBWithRGB = function (r1, g1, b1, r2, g2, b2, length, index) +{ + if (length === undefined) { length = 100; } + if (index === undefined) { index = 0; } + + var t = index / length; + + return { + r: Linear(r1, r2, t), + g: Linear(g1, g2, t), + b: Linear(b1, b2, t) + }; +}; + +/** + * Interpolates between the two given color objects over the length supplied. + * + * @function Phaser.Display.Color.Interpolate.ColorWithColor + * @memberof Phaser.Display.Color.Interpolate + * @static + * @since 3.0.0 + * + * @param {Phaser.Display.Color} color1 - The first Color object. + * @param {Phaser.Display.Color} color2 - The second Color object. + * @param {number} [length=100] - Distance to interpolate over. + * @param {number} [index=0] - Index to start from. + * + * @return {Phaser.Types.Display.ColorObject} An object containing the interpolated color values. + */ +var ColorWithColor = function (color1, color2, length, index) +{ + if (length === undefined) { length = 100; } + if (index === undefined) { index = 0; } + + return RGBWithRGB(color1.r, color1.g, color1.b, color2.r, color2.g, color2.b, length, index); +}; + +/** + * Interpolates between the Color object and color values over the length supplied. + * + * @function Phaser.Display.Color.Interpolate.ColorWithRGB + * @memberof Phaser.Display.Color.Interpolate + * @static + * @since 3.0.0 + * + * @param {Phaser.Display.Color} color1 - The first Color object. + * @param {number} r - Red value. + * @param {number} g - Blue value. + * @param {number} b - Green value. + * @param {number} [length=100] - Distance to interpolate over. + * @param {number} [index=0] - Index to start from. + * + * @return {Phaser.Types.Display.ColorObject} An object containing the interpolated color values. + */ +var ColorWithRGB = function (color, r, g, b, length, index) +{ + if (length === undefined) { length = 100; } + if (index === undefined) { index = 0; } + + return RGBWithRGB(color.r, color.g, color.b, r, g, b, length, index); +}; + +module.exports = { + + RGBWithRGB: RGBWithRGB, + ColorWithRGB: ColorWithRGB, + ColorWithColor: ColorWithColor + +}; + + +/***/ }), +/* 774 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Between = __webpack_require__(168); +var Color = __webpack_require__(33); + +/** + * Creates a new Color object where the r, g, and b values have been set to random values + * based on the given min max values. + * + * @function Phaser.Display.Color.RandomRGB + * @since 3.0.0 + * + * @param {integer} [min=0] - The minimum value to set the random range from (between 0 and 255) + * @param {integer} [max=255] - The maximum value to set the random range from (between 0 and 255) + * + * @return {Phaser.Display.Color} A Color object. + */ +var RandomRGB = function (min, max) +{ + if (min === undefined) { min = 0; } + if (max === undefined) { max = 255; } + + return new Color(Between(min, max), Between(min, max), Between(min, max)); +}; + +module.exports = RandomRGB; + + +/***/ }), +/* 775 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ComponentToHex = __webpack_require__(327); + +/** + * Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`. + * + * @function Phaser.Display.Color.RGBToString + * @since 3.0.0 + * + * @param {integer} r - The red color value. A number between 0 and 255. + * @param {integer} g - The green color value. A number between 0 and 255. + * @param {integer} b - The blue color value. A number between 0 and 255. + * @param {integer} [a=255] - The alpha value. A number between 0 and 255. + * @param {string} [prefix=#] - The prefix of the string. Either `#` or `0x`. + * + * @return {string} A string-based representation of the color values. + */ +var RGBToString = function (r, g, b, a, prefix) +{ + if (a === undefined) { a = 255; } + if (prefix === undefined) { prefix = '#'; } + + if (prefix === '#') + { + return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1); + } + else + { + return '0x' + ComponentToHex(a) + ComponentToHex(r) + ComponentToHex(g) + ComponentToHex(b); + } +}; + +module.exports = RGBToString; + + +/***/ }), +/* 776 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Display.Masks + */ + +module.exports = { + + BitmapMask: __webpack_require__(253), + GeometryMask: __webpack_require__(254) + +}; + + +/***/ }), +/* 777 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.DOM + */ + +var Dom = { + + AddToDOM: __webpack_require__(119), + DOMContentLoaded: __webpack_require__(329), + GetScreenOrientation: __webpack_require__(330), + GetTarget: __webpack_require__(335), + ParseXML: __webpack_require__(336), + RemoveFromDOM: __webpack_require__(174), + RequestAnimationFrame: __webpack_require__(316) + +}; + +module.exports = Dom; + + +/***/ }), +/* 778 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Events + */ + +module.exports = { EventEmitter: __webpack_require__(779) }; + + +/***/ }), +/* 779 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var EE = __webpack_require__(11); +var PluginCache = __webpack_require__(18); + +/** + * @classdesc + * EventEmitter is a Scene Systems plugin compatible version of eventemitter3. + * + * @class EventEmitter + * @memberof Phaser.Events + * @constructor + * @since 3.0.0 + */ +var EventEmitter = new Class({ + + Extends: EE, + + initialize: + + function EventEmitter () + { + EE.call(this); + }, + + /** + * Removes all listeners. + * + * @method Phaser.Events.EventEmitter#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + this.removeAllListeners(); + }, + + /** + * Removes all listeners. + * + * @method Phaser.Events.EventEmitter#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.removeAllListeners(); + } + +}); + +/** + * Return an array listing the events for which the emitter has registered listeners. + * + * @method Phaser.Events.EventEmitter#eventNames + * @since 3.0.0 + * + * @return {array} + */ + +/** + * Return the listeners registered for a given event. + * + * @method Phaser.Events.EventEmitter#listeners + * @since 3.0.0 + * + * @param {(string|symbol)} event - The event name. + * + * @return {array} The registered listeners. + */ + +/** + * Return the number of listeners listening to a given event. + * + * @method Phaser.Events.EventEmitter#listenerCount + * @since 3.0.0 + * + * @param {(string|symbol)} event - The event name. + * + * @return {number} The number of listeners. + */ + +/** + * Calls each of the listeners registered for a given event. + * + * @method Phaser.Events.EventEmitter#emit + * @since 3.0.0 + * + * @param {(string|symbol)} event - The event name. + * @param {...*} [args] - Additional arguments that will be passed to the event handler. + * + * @return {boolean} `true` if the event had listeners, else `false`. + */ + +/** + * Add a listener for a given event. + * + * @method Phaser.Events.EventEmitter#on + * @since 3.0.0 + * + * @param {(string|symbol)} event - The event name. + * @param {function} fn - The listener function. + * @param {*} [context=this] - The context to invoke the listener with. + * + * @return {Phaser.Events.EventEmitter} `this`. + */ + +/** + * Add a listener for a given event. + * + * @method Phaser.Events.EventEmitter#addListener + * @since 3.0.0 + * + * @param {(string|symbol)} event - The event name. + * @param {function} fn - The listener function. + * @param {*} [context=this] - The context to invoke the listener with. + * + * @return {Phaser.Events.EventEmitter} `this`. + */ + +/** + * Add a one-time listener for a given event. + * + * @method Phaser.Events.EventEmitter#once + * @since 3.0.0 + * + * @param {(string|symbol)} event - The event name. + * @param {function} fn - The listener function. + * @param {*} [context=this] - The context to invoke the listener with. + * + * @return {Phaser.Events.EventEmitter} `this`. + */ + +/** + * Remove the listeners of a given event. + * + * @method Phaser.Events.EventEmitter#removeListener + * @since 3.0.0 + * + * @param {(string|symbol)} event - The event name. + * @param {function} [fn] - Only remove the listeners that match this function. + * @param {*} [context] - Only remove the listeners that have this context. + * @param {boolean} [once] - Only remove one-time listeners. + * + * @return {Phaser.Events.EventEmitter} `this`. + */ + +/** + * Remove the listeners of a given event. + * + * @method Phaser.Events.EventEmitter#off + * @since 3.0.0 + * + * @param {(string|symbol)} event - The event name. + * @param {function} [fn] - Only remove the listeners that match this function. + * @param {*} [context] - Only remove the listeners that have this context. + * @param {boolean} [once] - Only remove one-time listeners. + * + * @return {Phaser.Events.EventEmitter} `this`. + */ + +/** + * Remove all listeners, or those of the specified event. + * + * @method Phaser.Events.EventEmitter#removeAllListeners + * @since 3.0.0 + * + * @param {(string|symbol)} [event] - The event name. + * + * @return {Phaser.Events.EventEmitter} `this`. + */ + +PluginCache.register('EventEmitter', EventEmitter, 'events'); + +module.exports = EventEmitter; + + +/***/ }), +/* 780 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var AddToDOM = __webpack_require__(119); +var AnimationManager = __webpack_require__(264); +var CacheManager = __webpack_require__(267); +var CanvasPool = __webpack_require__(24); +var Class = __webpack_require__(0); +var Config = __webpack_require__(289); +var CreateDOMContainer = __webpack_require__(781); +var CreateRenderer = __webpack_require__(312); +var DataManager = __webpack_require__(109); +var DebugHeader = __webpack_require__(314); +var Device = __webpack_require__(290); +var DOMContentLoaded = __webpack_require__(329); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(28); +var InputManager = __webpack_require__(337); +var PluginCache = __webpack_require__(18); +var PluginManager = __webpack_require__(342); +var ScaleManager = __webpack_require__(343); +var SceneManager = __webpack_require__(345); +var TextureEvents = __webpack_require__(118); +var TextureManager = __webpack_require__(349); +var TimeStep = __webpack_require__(315); +var VisibilityHandler = __webpack_require__(317); + +if (true) +{ + var SoundManagerCreator = __webpack_require__(352); +} + +if (false) +{ var FacebookInstantGamesPlugin; } + +/** + * @classdesc + * The Phaser.Game instance is the main controller for the entire Phaser game. It is responsible + * for handling the boot process, parsing the configuration values, creating the renderer, + * and setting-up all of the global Phaser systems, such as sound and input. + * Once that is complete it will start the Scene Manager and then begin the main game loop. + * + * You should generally avoid accessing any of the systems created by Game, and instead use those + * made available to you via the Phaser.Scene Systems class instead. + * + * @class Game + * @memberof Phaser + * @constructor + * @fires Phaser.Core.Events#BLUR + * @fires Phaser.Core.Events#FOCUS + * @fires Phaser.Core.Events#HIDDEN + * @fires Phaser.Core.Events#VISIBLE + * @since 3.0.0 + * + * @param {Phaser.Types.Core.GameConfig} [GameConfig] - The configuration object for your Phaser Game instance. + */ +var Game = new Class({ + + initialize: + + function Game (config) + { + /** + * The parsed Game Configuration object. + * + * The values stored within this object are read-only and should not be changed at run-time. + * + * @name Phaser.Game#config + * @type {Phaser.Core.Config} + * @readonly + * @since 3.0.0 + */ + this.config = new Config(config); + + /** + * A reference to either the Canvas or WebGL Renderer that this Game is using. + * + * @name Phaser.Game#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.0.0 + */ + this.renderer = null; + + /** + * A reference to an HTML Div Element used as the DOM Element Container. + * + * Only set if `createDOMContainer` is `true` in the game config (by default it is `false`) and + * if you provide a parent element to insert the Phaser Game inside. + * + * See the DOM Element Game Object for more details. + * + * @name Phaser.Game#domContainer + * @type {HTMLDivElement} + * @since 3.17.0 + */ + this.domContainer = null; + + /** + * A reference to the HTML Canvas Element that Phaser uses to render the game. + * This is created automatically by Phaser unless you provide a `canvas` property + * in your Game Config. + * + * @name Phaser.Game#canvas + * @type {HTMLCanvasElement} + * @since 3.0.0 + */ + this.canvas = null; + + /** + * A reference to the Rendering Context belonging to the Canvas Element this game is rendering to. + * If the game is running under Canvas it will be a 2d Canvas Rendering Context. + * If the game is running under WebGL it will be a WebGL Rendering Context. + * This context is created automatically by Phaser unless you provide a `context` property + * in your Game Config. + * + * @name Phaser.Game#context + * @type {(CanvasRenderingContext2D|WebGLRenderingContext)} + * @since 3.0.0 + */ + this.context = null; + + /** + * A flag indicating when this Game instance has finished its boot process. + * + * @name Phaser.Game#isBooted + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + this.isBooted = false; + + /** + * A flag indicating if this Game is currently running its game step or not. + * + * @name Phaser.Game#isRunning + * @type {boolean} + * @readonly + * @since 3.0.0 + */ + this.isRunning = false; + + /** + * An Event Emitter which is used to broadcast game-level events from the global systems. + * + * @name Phaser.Game#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = new EventEmitter(); + + /** + * An instance of the Animation Manager. + * + * The Animation Manager is a global system responsible for managing all animations used within your game. + * + * @name Phaser.Game#anims + * @type {Phaser.Animations.AnimationManager} + * @since 3.0.0 + */ + this.anims = new AnimationManager(this); + + /** + * An instance of the Texture Manager. + * + * The Texture Manager is a global system responsible for managing all textures being used by your game. + * + * @name Phaser.Game#textures + * @type {Phaser.Textures.TextureManager} + * @since 3.0.0 + */ + this.textures = new TextureManager(this); + + /** + * An instance of the Cache Manager. + * + * The Cache Manager is a global system responsible for caching, accessing and releasing external game assets. + * + * @name Phaser.Game#cache + * @type {Phaser.Cache.CacheManager} + * @since 3.0.0 + */ + this.cache = new CacheManager(this); + + /** + * An instance of the Data Manager + * + * @name Phaser.Game#registry + * @type {Phaser.Data.DataManager} + * @since 3.0.0 + */ + this.registry = new DataManager(this); + + /** + * An instance of the Input Manager. + * + * The Input Manager is a global system responsible for the capture of browser-level input events. + * + * @name Phaser.Game#input + * @type {Phaser.Input.InputManager} + * @since 3.0.0 + */ + this.input = new InputManager(this, this.config); + + /** + * An instance of the Scene Manager. + * + * The Scene Manager is a global system responsible for creating, modifying and updating the Scenes in your game. + * + * @name Phaser.Game#scene + * @type {Phaser.Scenes.SceneManager} + * @since 3.0.0 + */ + this.scene = new SceneManager(this, this.config.sceneConfig); + + /** + * A reference to the Device inspector. + * + * Contains information about the device running this game, such as OS, browser vendor and feature support. + * Used by various systems to determine capabilities and code paths. + * + * @name Phaser.Game#device + * @type {Phaser.DeviceConf} + * @since 3.0.0 + */ + this.device = Device; + + /** + * An instance of the Scale Manager. + * + * The Scale Manager is a global system responsible for handling scaling of the game canvas. + * + * @name Phaser.Game#scale + * @type {Phaser.Scale.ScaleManager} + * @since 3.16.0 + */ + this.scale = new ScaleManager(this, this.config); + + /** + * An instance of the base Sound Manager. + * + * The Sound Manager is a global system responsible for the playback and updating of all audio in your game. + * + * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag. + * + * @name Phaser.Game#sound + * @type {Phaser.Sound.BaseSoundManager} + * @since 3.0.0 + */ + this.sound = null; + + if (true) + { + this.sound = SoundManagerCreator.create(this); + } + + /** + * An instance of the Time Step. + * + * The Time Step is a global system responsible for setting-up and responding to the browser frame events, processing + * them and calculating delta values. It then automatically calls the game step. + * + * @name Phaser.Game#loop + * @type {Phaser.Core.TimeStep} + * @since 3.0.0 + */ + this.loop = new TimeStep(this, this.config.fps); + + /** + * An instance of the Plugin Manager. + * + * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install + * those plugins into Scenes as required. + * + * @name Phaser.Game#plugins + * @type {Phaser.Plugins.PluginManager} + * @since 3.0.0 + */ + this.plugins = new PluginManager(this, this.config); + + if (false) + {} + + /** + * Is this Game pending destruction at the start of the next frame? + * + * @name Phaser.Game#pendingDestroy + * @type {boolean} + * @private + * @since 3.5.0 + */ + this.pendingDestroy = false; + + /** + * Remove the Canvas once the destroy is over? + * + * @name Phaser.Game#removeCanvas + * @type {boolean} + * @private + * @since 3.5.0 + */ + this.removeCanvas = false; + + /** + * Remove everything when the game is destroyed. + * You cannot create a new Phaser instance on the same web page after doing this. + * + * @name Phaser.Game#noReturn + * @type {boolean} + * @private + * @since 3.12.0 + */ + this.noReturn = false; + + /** + * Does the window the game is running in currently have focus or not? + * This is modified by the VisibilityHandler. + * + * @name Phaser.Game#hasFocus + * @type {boolean} + * @readonly + * @since 3.9.0 + */ + this.hasFocus = false; + + // Wait for the DOM Ready event, then call boot. + DOMContentLoaded(this.boot.bind(this)); + }, + + /** + * This method is called automatically when the DOM is ready. It is responsible for creating the renderer, + * displaying the Debug Header, adding the game canvas to the DOM and emitting the 'boot' event. + * It listens for a 'ready' event from the base systems and once received it will call `Game.start`. + * + * @method Phaser.Game#boot + * @protected + * @fires Phaser.Core.Events#BOOT + * @listens Phaser.Textures.Events#READY + * @since 3.0.0 + */ + boot: function () + { + if (!PluginCache.hasCore('EventEmitter')) + { + console.warn('Aborting. Core Plugins missing.'); + return; + } + + this.isBooted = true; + + this.config.preBoot(this); + + this.scale.preBoot(); + + CreateRenderer(this); + + CreateDOMContainer(this); + + DebugHeader(this); + + AddToDOM(this.canvas, this.config.parent); + + // The Texture Manager has to wait on a couple of non-blocking events before it's fully ready. + // So it will emit this internal event when done: + this.textures.once(TextureEvents.READY, this.texturesReady, this); + + this.events.emit(Events.BOOT); + }, + + /** + * Called automatically when the Texture Manager has finished setting up and preparing the + * default textures. + * + * @method Phaser.Game#texturesReady + * @private + * @fires Phaser.Game#ready + * @since 3.12.0 + */ + texturesReady: function () + { + // Start all the other systems + this.events.emit(Events.READY); + + this.start(); + }, + + /** + * Called automatically by Game.boot once all of the global systems have finished setting themselves up. + * By this point the Game is now ready to start the main loop running. + * It will also enable the Visibility Handler. + * + * @method Phaser.Game#start + * @protected + * @since 3.0.0 + */ + start: function () + { + this.isRunning = true; + + this.config.postBoot(this); + + if (this.renderer) + { + this.loop.start(this.step.bind(this)); + } + else + { + this.loop.start(this.headlessStep.bind(this)); + } + + VisibilityHandler(this); + + var eventEmitter = this.events; + + eventEmitter.on(Events.HIDDEN, this.onHidden, this); + eventEmitter.on(Events.VISIBLE, this.onVisible, this); + eventEmitter.on(Events.BLUR, this.onBlur, this); + eventEmitter.on(Events.FOCUS, this.onFocus, this); + }, + + /** + * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of + * Request Animation Frame, or Set Timeout on very old browsers.) + * + * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager. + * + * It will then render each Scene in turn, via the Renderer. This process emits `prerender` and `postrender` events. + * + * @method Phaser.Game#step + * @fires Phaser.Core.Events#PRE_STEP_EVENT + * @fires Phaser.Core.Events#STEP_EVENT + * @fires Phaser.Core.Events#POST_STEP_EVENT + * @fires Phaser.Core.Events#PRE_RENDER_EVENT + * @fires Phaser.Core.Events#POST_RENDER_EVENT + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + step: function (time, delta) + { + if (this.pendingDestroy) + { + return this.runDestroy(); + } + + var eventEmitter = this.events; + + // Global Managers like Input and Sound update in the prestep + + eventEmitter.emit(Events.PRE_STEP, time, delta); + + // This is mostly meant for user-land code and plugins + + eventEmitter.emit(Events.STEP, time, delta); + + // Update the Scene Manager and all active Scenes + + this.scene.update(time, delta); + + // Our final event before rendering starts + + eventEmitter.emit(Events.POST_STEP, time, delta); + + var renderer = this.renderer; + + // Run the Pre-render (clearing the canvas, setting background colors, etc) + + renderer.preRender(); + + eventEmitter.emit(Events.PRE_RENDER, renderer, time, delta); + + // The main render loop. Iterates all Scenes and all Cameras in those scenes, rendering to the renderer instance. + + this.scene.render(renderer); + + // The Post-Render call. Tidies up loose end, takes snapshots, etc. + + renderer.postRender(); + + // The final event before the step repeats. Your last chance to do anything to the canvas before it all starts again. + + eventEmitter.emit(Events.POST_RENDER, renderer, time, delta); + }, + + /** + * A special version of the Game Step for the HEADLESS renderer only. + * + * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of + * Request Animation Frame, or Set Timeout on very old browsers.) + * + * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager. + * + * This process emits `prerender` and `postrender` events, even though nothing actually displays. + * + * @method Phaser.Game#headlessStep + * @fires Phaser.Game#prerenderEvent + * @fires Phaser.Game#postrenderEvent + * @since 3.2.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + headlessStep: function (time, delta) + { + var eventEmitter = this.events; + + // Global Managers + + eventEmitter.emit(Events.PRE_STEP, time, delta); + + eventEmitter.emit(Events.STEP, time, delta); + + // Scenes + + this.scene.update(time, delta); + + eventEmitter.emit(Events.POST_STEP, time, delta); + + // Render + + eventEmitter.emit(Events.PRE_RENDER); + + eventEmitter.emit(Events.POST_RENDER); + }, + + /** + * Called automatically by the Visibility Handler. + * This will pause the main loop and then emit a pause event. + * + * @method Phaser.Game#onHidden + * @protected + * @fires Phaser.Core.Events#PAUSE + * @since 3.0.0 + */ + onHidden: function () + { + this.loop.pause(); + + this.events.emit(Events.PAUSE); + }, + + /** + * Called automatically by the Visibility Handler. + * This will resume the main loop and then emit a resume event. + * + * @method Phaser.Game#onVisible + * @protected + * @fires Phaser.Core.Events#RESUME + * @since 3.0.0 + */ + onVisible: function () + { + this.loop.resume(); + + this.events.emit(Events.RESUME); + }, + + /** + * Called automatically by the Visibility Handler. + * This will set the main loop into a 'blurred' state, which pauses it. + * + * @method Phaser.Game#onBlur + * @protected + * @since 3.0.0 + */ + onBlur: function () + { + this.hasFocus = false; + + this.loop.blur(); + }, + + /** + * Called automatically by the Visibility Handler. + * This will set the main loop into a 'focused' state, which resumes it. + * + * @method Phaser.Game#onFocus + * @protected + * @since 3.0.0 + */ + onFocus: function () + { + this.hasFocus = true; + + this.loop.focus(); + }, + + /** + * Returns the current game frame. + * + * When the game starts running, the frame is incremented every time Request Animation Frame, or Set Timeout, fires. + * + * @method Phaser.Game#getFrame + * @since 3.16.0 + * + * @return {number} The current game frame. + */ + getFrame: function () + { + return this.loop.frame; + }, + + /** + * Returns the time that the current game step started at, as based on `performance.now`. + * + * @method Phaser.Game#getTime + * @since 3.16.0 + * + * @return {number} The current game timestamp. + */ + getTime: function () + { + return this.loop.now; + }, + + /** + * Flags this Game instance as needing to be destroyed on the _next frame_, making this an asynchronous operation. + * + * It will wait until the current frame has completed and then call `runDestroy` internally. + * + * If you need to react to the games eventual destruction, listen for the `DESTROY` event. + * + * If you **do not** need to run Phaser again on the same web page you can set the `noReturn` argument to `true` and it will free-up + * memory being held by the core Phaser plugins. If you do need to create another game instance on the same page, leave this as `false`. + * + * @method Phaser.Game#destroy + * @fires Phaser.Core.Events#DESTROY + * @since 3.0.0 + * + * @param {boolean} removeCanvas - Set to `true` if you would like the parent canvas element removed from the DOM, or `false` to leave it in place. + * @param {boolean} [noReturn=false] - If `true` all the core Phaser plugins are destroyed. You cannot create another instance of Phaser on the same web page if you do this. + */ + destroy: function (removeCanvas, noReturn) + { + if (noReturn === undefined) { noReturn = false; } + + this.pendingDestroy = true; + + this.removeCanvas = removeCanvas; + this.noReturn = noReturn; + }, + + /** + * Destroys this Phaser.Game instance, all global systems, all sub-systems and all Scenes. + * + * @method Phaser.Game#runDestroy + * @private + * @since 3.5.0 + */ + runDestroy: function () + { + this.events.emit(Events.DESTROY); + + this.events.removeAllListeners(); + + this.scene.destroy(); + + if (this.renderer) + { + this.renderer.destroy(); + } + + if (this.removeCanvas && this.canvas) + { + CanvasPool.remove(this.canvas); + + if (this.canvas.parentNode) + { + this.canvas.parentNode.removeChild(this.canvas); + } + } + + if (this.domContainer) + { + this.domContainer.parentNode.removeChild(this.domContainer); + } + + this.loop.destroy(); + + this.pendingDestroy = false; + } + +}); + +module.exports = Game; + +/** + * "Computers are good at following instructions, but not at reading your mind." - Donald Knuth + */ + + +/***/ }), +/* 781 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var AddToDOM = __webpack_require__(119); + +var CreateDOMContainer = function (game) +{ + var config = game.config; + + if (!config.parent || !config.domCreateContainer) + { + return; + } + + // DOM Element Container + var div = document.createElement('div'); + + div.style = [ + 'display: block;', + 'width: ' + game.scale.width + 'px;', + 'height: ' + game.scale.height + 'px;', + 'padding: 0; margin: 0;', + 'position: absolute;', + 'overflow: hidden;', + 'pointer-events: none;', + 'transform: scale(1);', + 'transform-origin: left top;' + ].join(' '); + + game.domContainer = div; + + AddToDOM(div, config.parent); +}; + +module.exports = CreateDOMContainer; + + +/***/ }), +/* 782 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Plugin Boot Event. + * + * This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves. + * + * @event Phaser.Input.Events#BOOT + * @since 3.0.0 + */ +module.exports = 'boot'; + + +/***/ }), +/* 783 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Plugin Destroy Event. + * + * This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves. + * + * @event Phaser.Input.Events#DESTROY + * @since 3.0.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 784 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Drag End Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer stops dragging a Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('dragend', listener)`. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_END]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_END} event instead. + * + * @event Phaser.Input.Events#DRAG_END + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer stopped dragging. + */ +module.exports = 'dragend'; + + +/***/ }), +/* 785 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Drag Enter Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object into a Drag Target. + * + * Listen to this event from within a Scene using: `this.input.on('dragenter', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_ENTER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_ENTER} event instead. + * + * @event Phaser.Input.Events#DRAG_ENTER + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. + * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved into. + */ +module.exports = 'dragenter'; + + +/***/ }), +/* 786 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Drag Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves while dragging a Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('drag', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG} event instead. + * + * @event Phaser.Input.Events#DRAG + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. + * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. + * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space. + */ +module.exports = 'drag'; + + +/***/ }), +/* 787 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Drag Leave Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object out of a Drag Target. + * + * Listen to this event from within a Scene using: `this.input.on('dragleave', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_LEAVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_LEAVE} event instead. + * + * @event Phaser.Input.Events#DRAG_LEAVE + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. + * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has left. + */ +module.exports = 'dragleave'; + + +/***/ }), +/* 788 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Drag Over Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object over a Drag Target. + * + * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within + * the drag target, it will emit this event instead. + * + * Listen to this event from within a Scene using: `this.input.on('dragover', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_OVER} event instead. + * + * @event Phaser.Input.Events#DRAG_OVER + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. + * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved over. + */ +module.exports = 'dragover'; + + +/***/ }), +/* 789 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Drag Start Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer starts to drag any Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('dragstart', listener)`. + * + * A Pointer can only drag a single Game Object at once. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_START]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_START} event instead. + * + * @event Phaser.Input.Events#DRAG_START + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer is dragging. + */ +module.exports = 'dragstart'; + + +/***/ }), +/* 790 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Drop Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drops a Game Object on a Drag Target. + * + * Listen to this event from within a Scene using: `this.input.on('drop', listener)`. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DROP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DROP} event instead. + * + * @event Phaser.Input.Events#DROP + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The interactive Game Object that this pointer was dragging. + * @param {Phaser.GameObjects.GameObject} target - The Drag Target the `gameObject` has been dropped on. + */ +module.exports = 'drop'; + + +/***/ }), +/* 791 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Plugin Game Out Event. + * + * This event is dispatched by the Input Plugin if the active pointer leaves the game canvas and is now + * outside of it, elsewhere on the web page. + * + * Listen to this event from within a Scene using: `this.input.on('gameout', listener)`. + * + * @event Phaser.Input.Events#GAME_OUT + * @since 3.16.1 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {(MouseEvent|TouchEvent)} event - The DOM Event that triggered the canvas out. + */ +module.exports = 'gameout'; + + +/***/ }), +/* 792 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Plugin Game Over Event. + * + * This event is dispatched by the Input Plugin if the active pointer enters the game canvas and is now + * over of it, having previously been elsewhere on the web page. + * + * Listen to this event from within a Scene using: `this.input.on('gameover', listener)`. + * + * @event Phaser.Input.Events#GAME_OVER + * @since 3.16.1 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {(MouseEvent|TouchEvent)} event - The DOM Event that triggered the canvas over. + */ +module.exports = 'gameover'; + + +/***/ }), +/* 793 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Down Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down on _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectdown', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_DOWN + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was pressed down on. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'gameobjectdown'; + + +/***/ }), +/* 794 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Drag End Event. + * + * This event is dispatched by an interactive Game Object if a pointer stops dragging it. + * + * Listen to this event from a Game Object using: `gameObject.on('dragend', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive](Phaser.GameObjects.GameObject#setInteractive) for more details. + * + * @event Phaser.Input.Events#GAMEOBJECT_DRAG_END + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {number} dragX - The x coordinate where the Pointer stopped dragging the Game Object, in world space. + * @param {number} dragY - The y coordinate where the Pointer stopped dragging the Game Object, in world space. + */ +module.exports = 'dragend'; + + +/***/ }), +/* 795 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Drag Enter Event. + * + * This event is dispatched by an interactive Game Object if a pointer drags it into a drag target. + * + * Listen to this event from a Game Object using: `gameObject.on('dragenter', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * @event Phaser.Input.Events#GAMEOBJECT_DRAG_ENTER + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved into. + */ +module.exports = 'dragenter'; + + +/***/ }), +/* 796 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Drag Event. + * + * This event is dispatched by an interactive Game Object if a pointer moves while dragging it. + * + * Listen to this event from a Game Object using: `gameObject.on('drag', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * @event Phaser.Input.Events#GAMEOBJECT_DRAG + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. + * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space. + */ +module.exports = 'drag'; + + +/***/ }), +/* 797 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Drag Leave Event. + * + * This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target. + * + * Listen to this event from a Game Object using: `gameObject.on('dragleave', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * @event Phaser.Input.Events#GAMEOBJECT_DRAG_LEAVE + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has left. + */ +module.exports = 'dragleave'; + + +/***/ }), +/* 798 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Drag Over Event. + * + * This event is dispatched by an interactive Game Object if a pointer drags it over a drag target. + * + * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within + * the drag target, it will emit this event instead. + * + * Listen to this event from a Game Object using: `gameObject.on('dragover', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * @event Phaser.Input.Events#GAMEOBJECT_DRAG_OVER + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} target - The drag target that this pointer has moved over. + */ +module.exports = 'dragover'; + + +/***/ }), +/* 799 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Drag Start Event. + * + * This event is dispatched by an interactive Game Object if a pointer starts to drag it. + * + * Listen to this event from a Game Object using: `gameObject.on('dragstart', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * There are lots of useful drag related properties that are set within the Game Object when dragging occurs. + * For example, `gameObject.input.dragStartX`, `dragStartY` and so on. + * + * @event Phaser.Input.Events#GAMEOBJECT_DRAG_START + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {number} dragX - The x coordinate where the Pointer is currently dragging the Game Object, in world space. + * @param {number} dragY - The y coordinate where the Pointer is currently dragging the Game Object, in world space. + */ +module.exports = 'dragstart'; + + +/***/ }), +/* 800 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Drop Event. + * + * This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target. + * + * Listen to this event from a Game Object using: `gameObject.on('drop', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive and enabled for drag. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * @event Phaser.Input.Events#GAMEOBJECT_DROP + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} target - The Drag Target the `gameObject` has been dropped on. + */ +module.exports = 'drop'; + + +/***/ }), +/* 801 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Move Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved across _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectmove', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} + * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} + * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_MOVE + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was moved on. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'gameobjectmove'; + + +/***/ }), +/* 802 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Out Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectout', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} + * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} + * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_OUT + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer moved out of. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'gameobjectout'; + + +/***/ }), +/* 803 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Over Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectover', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} + * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} + * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_OVER + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer moved over. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'gameobjectover'; + + +/***/ }), +/* 804 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Pointer Down Event. + * + * This event is dispatched by an interactive Game Object if a pointer is pressed down on it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerdown', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_POINTER_DOWN + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'pointerdown'; + + +/***/ }), +/* 805 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Pointer Move Event. + * + * This event is dispatched by an interactive Game Object if a pointer is moved while over it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointermove', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} + * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} + * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_POINTER_MOVE + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'pointermove'; + + +/***/ }), +/* 806 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Pointer Out Event. + * + * This event is dispatched by an interactive Game Object if a pointer moves out of it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerout', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} + * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} + * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OUT + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'pointerout'; + + +/***/ }), +/* 807 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Pointer Over Event. + * + * This event is dispatched by an interactive Game Object if a pointer moves over it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerover', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} + * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} + * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OVER + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'pointerover'; + + +/***/ }), +/* 808 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Pointer Up Event. + * + * This event is dispatched by an interactive Game Object if a pointer is released while over it. + * + * Listen to this event from a Game Object using: `gameObject.on('pointerup', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_POINTER_UP + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + * @param {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'pointerup'; + + +/***/ }), +/* 809 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Pointer Wheel Event. + * + * This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it. + * + * Listen to this event from a Game Object using: `gameObject.on('wheel', listener)`. + * Note that the scope of the listener is automatically set to be the Game Object instance itself. + * + * To receive this event, the Game Object must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} + * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} + * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_POINTER_WHEEL + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * @param {number} deltaY - The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. + * @param {number} deltaZ - The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'wheel'; + + +/***/ }), +/* 810 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Up Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released while over _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectup', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_UP + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was over when released. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'gameobjectup'; + + +/***/ }), +/* 811 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Game Object Wheel Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel moved while over _any_ interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('gameobjectwheel', listener)`. + * + * To receive this event, the Game Objects must have been set as interactive. + * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. + * + * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} event instead. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} + * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} + * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#GAMEOBJECT_WHEEL + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the pointer was over when the wheel changed. + * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * @param {number} deltaY - The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. + * @param {number} deltaZ - The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * @param {Phaser.Types.Input.EventData} event - The Phaser input event. You can call `stopPropagation()` to halt it from going any further in the event flow. + */ +module.exports = 'gameobjectwheel'; + + +/***/ }), +/* 812 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Manager Boot Event. + * + * This internal event is dispatched by the Input Manager when it boots. + * + * @event Phaser.Input.Events#MANAGER_BOOT + * @since 3.0.0 + */ +module.exports = 'boot'; + + +/***/ }), +/* 813 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Manager Process Event. + * + * This internal event is dispatched by the Input Manager when not using the legacy queue system, + * and it wants the Input Plugins to update themselves. + * + * @event Phaser.Input.Events#MANAGER_PROCESS + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'process'; + + +/***/ }), +/* 814 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Manager Update Event. + * + * This internal event is dispatched by the Input Manager as part of its update step. + * + * @event Phaser.Input.Events#MANAGER_UPDATE + * @since 3.0.0 + */ +module.exports = 'update'; + + +/***/ }), +/* 815 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Down Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere. + * + * Listen to this event from within a Scene using: `this.input.on('pointerdown', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#POINTER_DOWN + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. + */ +module.exports = 'pointerdown'; + + +/***/ }), +/* 816 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Down Outside Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere outside of the game canvas. + * + * Listen to this event from within a Scene using: `this.input.on('pointerdownoutside', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} + * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} + * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#POINTER_DOWN_OUTSIDE + * @since 3.16.1 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + */ +module.exports = 'pointerdownoutside'; + + +/***/ }), +/* 817 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Move Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved anywhere. + * + * Listen to this event from within a Scene using: `this.input.on('pointermove', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} + * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} + * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#POINTER_MOVE + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. + */ +module.exports = 'pointermove'; + + +/***/ }), +/* 818 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Out Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} + * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} + * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#POINTER_OUT + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject[]} justOut - An array containing all interactive Game Objects that the pointer moved out of when the event was created. + */ +module.exports = 'pointerout'; + + +/***/ }), +/* 819 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Over Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object. + * + * Listen to this event from within a Scene using: `this.input.on('pointerover', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} + * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} + * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#POINTER_OVER + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject[]} justOver - An array containing all interactive Game Objects that the pointer moved over when the event was created. + */ +module.exports = 'pointerover'; + + +/***/ }), +/* 820 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Up Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere. + * + * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#POINTER_UP + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. + */ +module.exports = 'pointerup'; + + +/***/ }), +/* 821 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Up Outside Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere outside of the game canvas. + * + * Listen to this event from within a Scene using: `this.input.on('pointerupoutside', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} + * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} + * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#POINTER_UP_OUTSIDE + * @since 3.16.1 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + */ +module.exports = 'pointerupoutside'; + + +/***/ }), +/* 822 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pointer Wheel Input Event. + * + * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel updated. + * + * Listen to this event from within a Scene using: `this.input.on('wheel', listener)`. + * + * The event hierarchy is as follows: + * + * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} + * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} + * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} + * + * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop + * the propagation of this event. + * + * @event Phaser.Input.Events#POINTER_WHEEL + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. + * @param {Phaser.GameObjects.GameObject[]} currentlyOver - An array containing all interactive Game Objects that the pointer was over when the event was created. + * @param {number} deltaX - The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device. + * @param {number} deltaY - The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down. + * @param {number} deltaZ - The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device. + */ +module.exports = 'wheel'; + + +/***/ }), +/* 823 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Manager Pointer Lock Change Event. + * + * This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event. + * + * @event Phaser.Input.Events#POINTERLOCK_CHANGE + * @since 3.0.0 + * + * @param {Event} event - The native DOM Event. + * @param {boolean} locked - The locked state of the Mouse Pointer. + */ +module.exports = 'pointerlockchange'; + + +/***/ }), +/* 824 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Plugin Pre-Update Event. + * + * This internal event is dispatched by the Input Plugin at the start of its `preUpdate` method. + * This hook is designed specifically for input plugins, but can also be listened to from user-land code. + * + * @event Phaser.Input.Events#PRE_UPDATE + * @since 3.0.0 + */ +module.exports = 'preupdate'; + + +/***/ }), +/* 825 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Plugin Shutdown Event. + * + * This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down. + * + * @event Phaser.Input.Events#SHUTDOWN + * @since 3.0.0 + */ +module.exports = 'shutdown'; + + +/***/ }), +/* 826 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Plugin Start Event. + * + * This internal event is dispatched by the Input Plugin when it has finished setting-up, + * signalling to all of its internal systems to start. + * + * @event Phaser.Input.Events#START + * @since 3.0.0 + */ +module.exports = 'start'; + + +/***/ }), +/* 827 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Input Plugin Update Event. + * + * This internal event is dispatched by the Input Plugin at the start of its `update` method. + * This hook is designed specifically for input plugins, but can also be listened to from user-land code. + * + * @event Phaser.Input.Events#UPDATE + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ +module.exports = 'update'; + + +/***/ }), +/* 828 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Attempts to determine the document inner height across iOS and standard devices. + * Based on code by @tylerjpeterson + * + * @function Phaser.DOM.GetInnerHeight + * @since 3.16.0 + * + * @param {boolean} iOS - Is this running on iOS? + * + * @return {number} The inner height value. + */ +var GetInnerHeight = function (iOS) +{ + + if (!iOS) + { + return window.innerHeight; + } + + var axis = Math.abs(window.orientation); + + var size = { w: 0, h: 0 }; + + var ruler = document.createElement('div'); + + ruler.setAttribute('style', 'position: fixed; height: 100vh; width: 0; top: 0'); + + document.documentElement.appendChild(ruler); + + size.w = (axis === 90) ? ruler.offsetHeight : window.innerWidth; + size.h = (axis === 90) ? window.innerWidth : ruler.offsetHeight; + + document.documentElement.removeChild(ruler); + + ruler = null; + + if (Math.abs(window.orientation) !== 90) + { + return size.h; + } + else + { + return size.w; + } +}; + +module.exports = GetInnerHeight; + + +/***/ }), +/* 829 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Add File Event. + * + * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue. + * + * Listen to it from a Scene using: `this.load.on('addfile', listener)`. + * + * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. + * + * @event Phaser.Loader.Events#ADD + * @since 3.0.0 + * + * @param {string} key - The unique key of the file that was added to the Loader. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`. + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader. + */ +module.exports = 'addfile'; + + +/***/ }), +/* 830 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Complete Event. + * + * This event is dispatched when the Loader has fully processed everything in the load queue. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Listen to it from a Scene using: `this.load.on('complete', listener)`. + * + * @event Phaser.Loader.Events#COMPLETE + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + * @param {integer} totalComplete - The total number of files that successfully loaded. + * @param {integer} totalFailed - The total number of files that failed to load. + */ +module.exports = 'complete'; + + +/***/ }), +/* 831 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. + * + * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`. + * + * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. + * + * @event Phaser.Loader.Events#FILE_COMPLETE + * @since 3.0.0 + * + * @param {string} key - The key of the file that just loaded and finished processing. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. + * @param {any} data - The raw data the file contained. + */ +module.exports = 'filecomplete'; + + +/***/ }), +/* 832 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Complete Event. + * + * This event is dispatched by the Loader Plugin when any file in the queue finishes loading. + * + * It uses a special dynamic event name constructed from the key and type of the file. + * + * For example, if you have loaded an `image` with a key of `monster`, you can listen for it + * using the following: + * + * ```javascript + * this.load.on('filecomplete-image-monster', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a texture `atlas` with a key of `Level1`: + * + * ```javascript + * this.load.on('filecomplete-atlas-Level1', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`: + * + * ```javascript + * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) { + * // Your handler code + * }); + * ``` + * + * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event. + * + * @event Phaser.Loader.Events#FILE_KEY_COMPLETE + * @since 3.0.0 + * + * @param {string} key - The key of the file that just loaded and finished processing. + * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`. + * @param {any} data - The raw data the file contained. + */ +module.exports = 'filecomplete-'; + + +/***/ }), +/* 833 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Error Event. + * + * This event is dispatched by the Loader Plugin when a file fails to load. + * + * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. + * + * @event Phaser.Loader.Events#FILE_LOAD_ERROR + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + */ +module.exports = 'loaderror'; + + +/***/ }), +/* 834 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Event. + * + * This event is dispatched by the Loader Plugin when a file finishes loading, + * but _before_ it is processed and added to the internal Phaser caches. + * + * Listen to it from a Scene using: `this.load.on('load', listener)`. + * + * @event Phaser.Loader.Events#FILE_LOAD + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. + */ +module.exports = 'load'; + + +/***/ }), +/* 835 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The File Load Progress Event. + * + * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and + * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen. + * + * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. + * + * @event Phaser.Loader.Events#FILE_PROGRESS + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - A reference to the File which errored during load. + * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is. + */ +module.exports = 'fileprogress'; + + +/***/ }), +/* 836 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Post Process Event. + * + * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. + * It is dispatched before the internal lists are cleared and each File is destroyed. + * + * Use this hook to perform any last minute processing of files that can only happen once the + * Loader has completed, but prior to it emitting the `complete` event. + * + * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. + * + * @event Phaser.Loader.Events#POST_PROCESS + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'postprocess'; + + +/***/ }), +/* 837 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Progress Event. + * + * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading. + * + * Listen to it from a Scene using: `this.load.on('progress', listener)`. + * + * @event Phaser.Loader.Events#PROGRESS + * @since 3.0.0 + * + * @param {number} progress - The current progress of the load. A value between 0 and 1. + */ +module.exports = 'progress'; + + +/***/ }), +/* 838 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Loader Plugin Start Event. + * + * This event is dispatched when the Loader starts running. At this point load progress is zero. + * + * This event is dispatched even if there aren't any files in the load queue. + * + * Listen to it from a Scene using: `this.load.on('start', listener)`. + * + * @event Phaser.Loader.Events#START + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. + */ +module.exports = 'start'; + + +/***/ }), +/* 839 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetFastValue = __webpack_require__(2); +var UppercaseFirst = __webpack_require__(347); + +/** + * Builds an array of which physics plugins should be activated for the given Scene. + * + * @function Phaser.Scenes.GetPhysicsPlugins + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - The scene system to get the physics systems of. + * + * @return {array} An array of Physics systems to start for this Scene. + */ +var GetPhysicsPlugins = function (sys) +{ + var defaultSystem = sys.game.config.defaultPhysicsSystem; + var sceneSystems = GetFastValue(sys.settings, 'physics', false); + + if (!defaultSystem && !sceneSystems) + { + // No default physics system or systems in this scene + return; + } + + // Let's build the systems array + var output = []; + + if (defaultSystem) + { + output.push(UppercaseFirst(defaultSystem + 'Physics')); + } + + if (sceneSystems) + { + for (var key in sceneSystems) + { + key = UppercaseFirst(key.concat('Physics')); + + if (output.indexOf(key) === -1) + { + output.push(key); + } + } + } + + // An array of Physics systems to start for this Scene + return output; +}; + +module.exports = GetPhysicsPlugins; + + +/***/ }), +/* 840 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetFastValue = __webpack_require__(2); + +/** + * Builds an array of which plugins (not including physics plugins) should be activated for the given Scene. + * + * @function Phaser.Scenes.GetScenePlugins + * @since 3.0.0 + * + * @param {Phaser.Scenes.Systems} sys - The Scene Systems object to check for plugins. + * + * @return {array} An array of all plugins which should be activated, either the default ones or the ones configured in the Scene Systems object. + */ +var GetScenePlugins = function (sys) +{ + var defaultPlugins = sys.plugins.getDefaultScenePlugins(); + + var scenePlugins = GetFastValue(sys.settings, 'plugins', false); + + // Scene Plugins always override Default Plugins + if (Array.isArray(scenePlugins)) + { + return scenePlugins; + } + else if (defaultPlugins) + { + return defaultPlugins; + } + else + { + // No default plugins or plugins in this scene + return []; + } +}; + +module.exports = GetScenePlugins; + + +/***/ }), +/* 841 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// These properties get injected into the Scene and map to local systems +// The map value is the property that is injected into the Scene, the key is the Scene.Systems reference. +// These defaults can be modified via the Scene config object +// var config = { +// map: { +// add: 'makeStuff', +// load: 'loader' +// } +// }; + +var InjectionMap = { + + game: 'game', + + anims: 'anims', + cache: 'cache', + plugins: 'plugins', + registry: 'registry', + scale: 'scale', + sound: 'sound', + textures: 'textures', + + events: 'events', + cameras: 'cameras', + add: 'add', + make: 'make', + scenePlugin: 'scene', + displayList: 'children', + lights: 'lights', + + data: 'data', + input: 'input', + load: 'load', + time: 'time', + tweens: 'tweens', + + arcadePhysics: 'physics', + impactPhysics: 'impact', + matterPhysics: 'matter' + +}; + +if (false) +{} + +if (false) +{} + +module.exports = InjectionMap; + + +/***/ }), +/* 842 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Clamp = __webpack_require__(22); +var Color = __webpack_require__(33); +var IsSizePowerOfTwo = __webpack_require__(117); +var Texture = __webpack_require__(177); + +/** + * @classdesc + * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. + * + * You can use the properties of this texture to draw to the canvas element directly, using all of the standard + * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. + * + * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to + * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this + * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep + * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading + * texture data to it. This restriction does not apply if using the Canvas Renderer. + * + * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify + * sections of the canvas using the `add` method. + * + * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying + * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause + * graphical errors. + * + * @class CanvasTexture + * @extends Phaser.Textures.Texture + * @memberof Phaser.Textures + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Textures.CanvasTexture} manager - A reference to the Texture Manager this Texture belongs to. + * @param {string} key - The unique string-based key of this Texture. + * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture. + * @param {integer} width - The width of the canvas. + * @param {integer} height - The height of the canvas. + */ +var CanvasTexture = new Class({ + + Extends: Texture, + + initialize: + + function CanvasTexture (manager, key, source, width, height) + { + Texture.call(this, manager, key, source, width, height); + + this.add('__BASE', 0, 0, 0, width, height); + + /** + * A reference to the Texture Source of this Canvas. + * + * @name Phaser.Textures.CanvasTexture#_source + * @type {Phaser.Textures.TextureSource} + * @private + * @since 3.7.0 + */ + this._source = this.frames['__BASE'].source; + + /** + * The source Canvas Element. + * + * @name Phaser.Textures.CanvasTexture#canvas + * @readonly + * @type {HTMLCanvasElement} + * @since 3.7.0 + */ + this.canvas = this._source.image; + + /** + * The 2D Canvas Rendering Context. + * + * @name Phaser.Textures.CanvasTexture#context + * @readonly + * @type {CanvasRenderingContext2D} + * @since 3.7.0 + */ + this.context = this.canvas.getContext('2d'); + + /** + * The width of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + * + * @name Phaser.Textures.CanvasTexture#width + * @readonly + * @type {integer} + * @since 3.7.0 + */ + this.width = width; + + /** + * The height of the Canvas. + * This property is read-only, if you wish to change it use the `setSize` method. + * + * @name Phaser.Textures.CanvasTexture#height + * @readonly + * @type {integer} + * @since 3.7.0 + */ + this.height = height; + + /** + * The context image data. + * Use the `update` method to populate this when the canvas changes. + * + * @name Phaser.Textures.CanvasTexture#imageData + * @type {ImageData} + * @since 3.13.0 + */ + this.imageData = this.context.getImageData(0, 0, width, height); + + /** + * A Uint8ClampedArray view into the `buffer`. + * Use the `update` method to populate this when the canvas changes. + * Note that this is unavailable in some browsers, such as Epic Browser, due to their security restrictions. + * + * @name Phaser.Textures.CanvasTexture#data + * @type {Uint8ClampedArray} + * @since 3.13.0 + */ + this.data = null; + + if (this.imageData) + { + this.data = this.imageData.data; + } + + /** + * An Uint32Array view into the `buffer`. + * + * @name Phaser.Textures.CanvasTexture#pixels + * @type {Uint32Array} + * @since 3.13.0 + */ + this.pixels = null; + + /** + * An ArrayBuffer the same size as the context ImageData. + * + * @name Phaser.Textures.CanvasTexture#buffer + * @type {ArrayBuffer} + * @since 3.13.0 + */ + this.buffer; + + if (this.data) + { + if (this.imageData.data.buffer) + { + this.buffer = this.imageData.data.buffer; + this.pixels = new Uint32Array(this.buffer); + } + else if (window.ArrayBuffer) + { + this.buffer = new ArrayBuffer(this.imageData.data.length); + this.pixels = new Uint32Array(this.buffer); + } + else + { + this.pixels = this.imageData.data; + } + } + }, + + /** + * This re-creates the `imageData` from the current context. + * It then re-builds the ArrayBuffer, the `data` Uint8ClampedArray reference and the `pixels` Int32Array. + * + * Warning: This is a very expensive operation, so use it sparingly. + * + * @method Phaser.Textures.CanvasTexture#update + * @since 3.13.0 + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + update: function () + { + this.imageData = this.context.getImageData(0, 0, this.width, this.height); + + this.data = this.imageData.data; + + if (this.imageData.data.buffer) + { + this.buffer = this.imageData.data.buffer; + this.pixels = new Uint32Array(this.buffer); + } + else if (window.ArrayBuffer) + { + this.buffer = new ArrayBuffer(this.imageData.data.length); + this.pixels = new Uint32Array(this.buffer); + } + else + { + this.pixels = this.imageData.data; + } + + return this; + }, + + /** + * Draws the given Image or Canvas element to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * + * @method Phaser.Textures.CanvasTexture#draw + * @since 3.13.0 + * + * @param {integer} x - The x coordinate to draw the source at. + * @param {integer} y - The y coordinate to draw the source at. + * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas. + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + draw: function (x, y, source) + { + this.context.drawImage(source, x, y); + + return this.update(); + }, + + /** + * Draws the given texture frame to this CanvasTexture, then updates the internal + * ImageData buffer and arrays. + * + * @method Phaser.Textures.CanvasTexture#drawFrame + * @since 3.16.0 + * + * @param {string} key - The unique string-based key of the Texture. + * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {integer} [x=0] - The x coordinate to draw the source at. + * @param {integer} [y=0] - The y coordinate to draw the source at. + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + drawFrame: function (key, frame, x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + var textureFrame = this.manager.getFrame(key, frame); + + if (textureFrame) + { + var cd = textureFrame.canvasData; + + var width = textureFrame.cutWidth; + var height = textureFrame.cutHeight; + var res = textureFrame.source.resolution; + + this.context.drawImage( + textureFrame.source.image, + cd.x, cd.y, + width, + height, + x, y, + width / res, + height / res + ); + + return this.update(); + } + else + { + return this; + } + }, + + /** + * Sets a pixel in the CanvasTexture to the given color and alpha values. + * + * This is an expensive operation to run in large quantities, so use sparingly. + * + * @method Phaser.Textures.CanvasTexture#setPixel + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} red - The red color value. A number between 0 and 255. + * @param {integer} green - The green color value. A number between 0 and 255. + * @param {integer} blue - The blue color value. A number between 0 and 255. + * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * + * @return {this} This CanvasTexture. + */ + setPixel: function (x, y, red, green, blue, alpha) + { + if (alpha === undefined) { alpha = 255; } + + x = Math.abs(Math.floor(x)); + y = Math.abs(Math.floor(y)); + + var index = this.getIndex(x, y); + + if (index > -1) + { + var imageData = this.context.getImageData(x, y, 1, 1); + + imageData.data[0] = red; + imageData.data[1] = green; + imageData.data[2] = blue; + imageData.data[3] = alpha; + + this.context.putImageData(imageData, x, y); + } + + return this; + }, + + /** + * Puts the ImageData into the context of this CanvasTexture at the given coordinates. + * + * @method Phaser.Textures.CanvasTexture#putData + * @since 3.16.0 + * + * @param {ImageData} imageData - The ImageData to put at the given location. + * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. + * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. + * + * @return {this} This CanvasTexture. + */ + putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight) + { + if (dirtyX === undefined) { dirtyX = 0; } + if (dirtyY === undefined) { dirtyY = 0; } + if (dirtyWidth === undefined) { dirtyWidth = imageData.width; } + if (dirtyHeight === undefined) { dirtyHeight = imageData.height; } + + this.context.putImageData(imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight); + + return this; + }, + + /** + * Gets an ImageData region from this CanvasTexture from the position and size specified. + * You can write this back using `CanvasTexture.putData`, or manipulate it. + * + * @method Phaser.Textures.CanvasTexture#getData + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. + * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. + * + * @return {ImageData} The ImageData extracted from this CanvasTexture. + */ + getData: function (x, y, width, height) + { + x = Clamp(Math.floor(x), 0, this.width - 1); + y = Clamp(Math.floor(y), 0, this.height - 1); + width = Clamp(width, 1, this.width - x); + height = Clamp(height, 1, this.height - y); + + var imageData = this.context.getImageData(x, y, width, height); + + return imageData; + }, + + /** + * Get the color of a specific pixel from this texture and store it in a Color object. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * + * @method Phaser.Textures.CanvasTexture#getPixel + * @since 3.13.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created. + * + * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties. + */ + getPixel: function (x, y, out) + { + if (!out) + { + out = new Color(); + } + + var index = this.getIndex(x, y); + + if (index > -1) + { + var data = this.data; + + var r = data[index + 0]; + var g = data[index + 1]; + var b = data[index + 2]; + var a = data[index + 3]; + + out.setTo(r, g, b, a); + } + + return out; + }, + + /** + * Returns an array containing all of the pixels in the given region. + * + * If the requested region extends outside the bounds of this CanvasTexture, + * the region is truncated to fit. + * + * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, + * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. + * + * @method Phaser.Textures.CanvasTexture#getPixels + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} width - The width of the region to get. Must be an integer. + * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. + * + * @return {Phaser.Types.Textures.PixelConfig[]} An array of Pixel objects. + */ + getPixels: function (x, y, width, height) + { + if (height === undefined) { height = width; } + + x = Math.abs(Math.round(x)); + y = Math.abs(Math.round(y)); + + var left = Clamp(x, 0, this.width); + var right = Clamp(x + width, 0, this.width); + var top = Clamp(y, 0, this.height); + var bottom = Clamp(y + height, 0, this.height); + + var pixel = new Color(); + + var out = []; + + for (var py = top; py < bottom; py++) + { + var row = []; + + for (var px = left; px < right; px++) + { + pixel = this.getPixel(px, py, pixel); + + row.push({ x: px, y: py, color: pixel.color, alpha: pixel.alphaGL }); + } + + out.push(row); + } + + return out; + }, + + /** + * Returns the Image Data index for the given pixel in this CanvasTexture. + * + * The index can be used to read directly from the `this.data` array. + * + * The index points to the red value in the array. The subsequent 3 indexes + * point to green, blue and alpha respectively. + * + * @method Phaser.Textures.CanvasTexture#getIndex + * @since 3.16.0 + * + * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * + * @return {integer} + */ + getIndex: function (x, y) + { + x = Math.abs(Math.round(x)); + y = Math.abs(Math.round(y)); + + if (x < this.width && y < this.height) + { + return (x + y * this.width) * 4; + } + else + { + return -1; + } + }, + + /** + * This should be called manually if you are running under WebGL. + * It will refresh the WebGLTexture from the Canvas source. Only call this if you know that the + * canvas has changed, as there is a significant GPU texture allocation cost involved in doing so. + * + * @method Phaser.Textures.CanvasTexture#refresh + * @since 3.7.0 + * + * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. + */ + refresh: function () + { + this._source.update(); + + return this; + }, + + /** + * Gets the Canvas Element. + * + * @method Phaser.Textures.CanvasTexture#getCanvas + * @since 3.7.0 + * + * @return {HTMLCanvasElement} The Canvas DOM element this texture is using. + */ + getCanvas: function () + { + return this.canvas; + }, + + /** + * Gets the 2D Canvas Rendering Context. + * + * @method Phaser.Textures.CanvasTexture#getContext + * @since 3.7.0 + * + * @return {CanvasRenderingContext2D} The Canvas Rendering Context this texture is using. + */ + getContext: function () + { + return this.context; + }, + + /** + * Clears the given region of this Canvas Texture, resetting it back to transparent. + * If no region is given, the whole Canvas Texture is cleared. + * + * @method Phaser.Textures.CanvasTexture#clear + * @since 3.7.0 + * + * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear. + * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear. + * @param {integer} [width] - The width of the region. + * @param {integer} [height] - The height of the region. + * + * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. + */ + clear: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.width; } + if (height === undefined) { height = this.height; } + + this.context.clearRect(x, y, width, height); + + return this.update(); + }, + + /** + * Changes the size of this Canvas Texture. + * + * @method Phaser.Textures.CanvasTexture#setSize + * @since 3.7.0 + * + * @param {integer} width - The new width of the Canvas. + * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height. + * + * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + if (width !== this.width || height !== this.height) + { + // Update the Canvas + this.canvas.width = width; + this.canvas.height = height; + + // Update the Texture Source + this._source.width = width; + this._source.height = height; + this._source.isPowerOf2 = IsSizePowerOfTwo(width, height); + + // Update the Frame + this.frames['__BASE'].setSize(width, height, 0, 0); + + this.refresh(); + } + + return this; + }, + + /** + * Destroys this Texture and releases references to its sources and frames. + * + * @method Phaser.Textures.CanvasTexture#destroy + * @since 3.16.0 + */ + destroy: function () + { + Texture.prototype.destroy.call(this); + + this._source = null; + this.canvas = null; + this.context = null; + this.imageData = null; + this.data = null; + this.pixels = null; + this.buffer = null; + } + +}); + +module.exports = CanvasTexture; + + +/***/ }), +/* 843 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Parses an XML Texture Atlas object and adds all the Frames into a Texture. + * + * @function Phaser.Textures.Parsers.AtlasXML + * @memberof Phaser.Textures.Parsers + * @private + * @since 3.7.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. + * @param {integer} sourceIndex - The index of the TextureSource. + * @param {*} xml - The XML data. + * + * @return {Phaser.Textures.Texture} The Texture modified by this parser. + */ +var AtlasXML = function (texture, sourceIndex, xml) +{ + // Malformed? + if (!xml.getElementsByTagName('TextureAtlas')) + { + console.warn('Invalid Texture Atlas XML given'); + return; + } + + // Add in a __BASE entry (for the entire atlas) + var source = texture.source[sourceIndex]; + + texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height); + + // By this stage frames is a fully parsed array + var frames = xml.getElementsByTagName('SubTexture'); + + var newFrame; + + for (var i = 0; i < frames.length; i++) + { + var frame = frames[i].attributes; + + var name = frame.name.value; + var x = parseInt(frame.x.value, 10); + var y = parseInt(frame.y.value, 10); + var width = parseInt(frame.width.value, 10); + var height = parseInt(frame.height.value, 10); + + // The frame values are the exact coordinates to cut the frame out of the atlas from + newFrame = texture.add(name, sourceIndex, x, y, width, height); + + // These are the original (non-trimmed) sprite values + if (frame.frameX) + { + var frameX = Math.abs(parseInt(frame.frameX.value, 10)); + var frameY = Math.abs(parseInt(frame.frameY.value, 10)); + var frameWidth = parseInt(frame.frameWidth.value, 10); + var frameHeight = parseInt(frame.frameHeight.value, 10); + + newFrame.setTrim( + width, + height, + frameX, + frameY, + frameWidth, + frameHeight + ); + } + } + + return texture; +}; + +module.exports = AtlasXML; + + +/***/ }), +/* 844 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds a Canvas Element to a Texture. + * + * @function Phaser.Textures.Parsers.Canvas + * @memberof Phaser.Textures.Parsers + * @private + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. + * @param {integer} sourceIndex - The index of the TextureSource. + * + * @return {Phaser.Textures.Texture} The Texture modified by this parser. + */ +var Canvas = function (texture, sourceIndex) +{ + var source = texture.source[sourceIndex]; + + texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height); + + return texture; +}; + +module.exports = Canvas; + + +/***/ }), +/* 845 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds an Image Element to a Texture. + * + * @function Phaser.Textures.Parsers.Image + * @memberof Phaser.Textures.Parsers + * @private + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. + * @param {integer} sourceIndex - The index of the TextureSource. + * + * @return {Phaser.Textures.Texture} The Texture modified by this parser. + */ +var Image = function (texture, sourceIndex) +{ + var source = texture.source[sourceIndex]; + + texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height); + + return texture; +}; + +module.exports = Image; + + +/***/ }), +/* 846 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clone = __webpack_require__(64); + +/** + * Parses a Texture Atlas JSON Array and adds the Frames to the Texture. + * JSON format expected to match that defined by Texture Packer, with the frames property containing an array of Frames. + * + * @function Phaser.Textures.Parsers.JSONArray + * @memberof Phaser.Textures.Parsers + * @private + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. + * @param {integer} sourceIndex - The index of the TextureSource. + * @param {object} json - The JSON data. + * + * @return {Phaser.Textures.Texture} The Texture modified by this parser. + */ +var JSONArray = function (texture, sourceIndex, json) +{ + // Malformed? + if (!json['frames'] && !json['textures']) + { + console.warn('Invalid Texture Atlas JSON Array'); + return; + } + + // Add in a __BASE entry (for the entire atlas) + var source = texture.source[sourceIndex]; + + texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height); + + // By this stage frames is a fully parsed array + var frames = (Array.isArray(json.textures)) ? json.textures[sourceIndex].frames : json.frames; + + var newFrame; + + for (var i = 0; i < frames.length; i++) + { + var src = frames[i]; + + // The frame values are the exact coordinates to cut the frame out of the atlas from + newFrame = texture.add(src.filename, sourceIndex, src.frame.x, src.frame.y, src.frame.w, src.frame.h); + + // These are the original (non-trimmed) sprite values + if (src.trimmed) + { + newFrame.setTrim( + src.sourceSize.w, + src.sourceSize.h, + src.spriteSourceSize.x, + src.spriteSourceSize.y, + src.spriteSourceSize.w, + src.spriteSourceSize.h + ); + } + + if (src.rotated) + { + newFrame.rotated = true; + newFrame.updateUVsInverted(); + } + + if (src.anchor) + { + newFrame.customPivot = true; + newFrame.pivotX = src.anchor.x; + newFrame.pivotY = src.anchor.y; + } + + // Copy over any extra data + newFrame.customData = Clone(src); + } + + // Copy over any additional data that was in the JSON to Texture.customData + for (var dataKey in json) + { + if (dataKey === 'frames') + { + continue; + } + + if (Array.isArray(json[dataKey])) + { + texture.customData[dataKey] = json[dataKey].slice(0); + } + else + { + texture.customData[dataKey] = json[dataKey]; + } + } + + return texture; +}; + +module.exports = JSONArray; + + +/***/ }), +/* 847 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clone = __webpack_require__(64); + +/** + * Parses a Texture Atlas JSON Hash and adds the Frames to the Texture. + * JSON format expected to match that defined by Texture Packer, with the frames property containing an object of Frames. + * + * @function Phaser.Textures.Parsers.JSONHash + * @memberof Phaser.Textures.Parsers + * @private + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. + * @param {integer} sourceIndex - The index of the TextureSource. + * @param {object} json - The JSON data. + * + * @return {Phaser.Textures.Texture} The Texture modified by this parser. + */ +var JSONHash = function (texture, sourceIndex, json) +{ + // Malformed? + if (!json['frames']) + { + console.warn('Invalid Texture Atlas JSON Hash given, missing \'frames\' Object'); + return; + } + + // Add in a __BASE entry (for the entire atlas) + var source = texture.source[sourceIndex]; + + texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height); + + // By this stage frames is a fully parsed Object + var frames = json['frames']; + var newFrame; + + for (var key in frames) + { + var src = frames[key]; + + // The frame values are the exact coordinates to cut the frame out of the atlas from + newFrame = texture.add(key, sourceIndex, src.frame.x, src.frame.y, src.frame.w, src.frame.h); + + // These are the original (non-trimmed) sprite values + if (src.trimmed) + { + newFrame.setTrim( + src.sourceSize.w, + src.sourceSize.h, + src.spriteSourceSize.x, + src.spriteSourceSize.y, + src.spriteSourceSize.w, + src.spriteSourceSize.h + ); + } + + if (src.rotated) + { + newFrame.rotated = true; + newFrame.updateUVsInverted(); + } + + // Copy over any extra data + newFrame.customData = Clone(src); + } + + // Copy over any additional data that was in the JSON to Texture.customData + for (var dataKey in json) + { + if (dataKey === 'frames') + { + continue; + } + + if (Array.isArray(json[dataKey])) + { + texture.customData[dataKey] = json[dataKey].slice(0); + } + else + { + texture.customData[dataKey] = json[dataKey]; + } + } + + return texture; +}; + +module.exports = JSONHash; + + +/***/ }), +/* 848 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetFastValue = __webpack_require__(2); + +/** + * Parses a Sprite Sheet and adds the Frames to the Texture. + * + * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact + * same size and cannot be trimmed or rotated. + * + * @function Phaser.Textures.Parsers.SpriteSheet + * @memberof Phaser.Textures.Parsers + * @private + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. + * @param {integer} sourceIndex - The index of the TextureSource. + * @param {integer} x - [description] + * @param {integer} y - [description] + * @param {integer} width - [description] + * @param {integer} height - [description] + * @param {object} config - An object describing how to parse the Sprite Sheet. + * @param {number} config.frameWidth - Width in pixels of a single frame in the sprite sheet. + * @param {number} [config.frameHeight] - Height in pixels of a single frame in the sprite sheet. Defaults to frameWidth if not provided. + * @param {number} [config.startFrame=0] - [description] + * @param {number} [config.endFrame=-1] - [description] + * @param {number} [config.margin=0] - If the frames have been drawn with a margin, specify the amount here. + * @param {number} [config.spacing=0] - If the frames have been drawn with spacing between them, specify the amount here. + * + * @return {Phaser.Textures.Texture} The Texture modified by this parser. + */ +var SpriteSheet = function (texture, sourceIndex, x, y, width, height, config) +{ + var frameWidth = GetFastValue(config, 'frameWidth', null); + var frameHeight = GetFastValue(config, 'frameHeight', frameWidth); + + // If missing we can't proceed + if (frameWidth === null) + { + throw new Error('TextureManager.SpriteSheet: Invalid frameWidth given.'); + } + + // Add in a __BASE entry (for the entire atlas) + var source = texture.source[sourceIndex]; + + texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height); + + var startFrame = GetFastValue(config, 'startFrame', 0); + var endFrame = GetFastValue(config, 'endFrame', -1); + var margin = GetFastValue(config, 'margin', 0); + var spacing = GetFastValue(config, 'spacing', 0); + + var row = Math.floor((width - margin + spacing) / (frameWidth + spacing)); + var column = Math.floor((height - margin + spacing) / (frameHeight + spacing)); + var total = row * column; + + if (total === 0) + { + console.warn('SpriteSheet frame dimensions will result in zero frames.'); + } + + if (startFrame > total || startFrame < -total) + { + startFrame = 0; + } + + if (startFrame < 0) + { + // Allow negative skipframes. + startFrame = total + startFrame; + } + + if (endFrame !== -1) + { + total = startFrame + (endFrame + 1); + } + + var fx = margin; + var fy = margin; + var ax = 0; + var ay = 0; + + for (var i = 0; i < total; i++) + { + ax = 0; + ay = 0; + + var w = fx + frameWidth; + var h = fy + frameHeight; + + if (w > width) + { + ax = w - width; + } + + if (h > height) + { + ay = h - height; + } + + texture.add(i, sourceIndex, x + fx, y + fy, frameWidth - ax, frameHeight - ay); + + fx += frameWidth + spacing; + + if (fx + frameWidth > width) + { + fx = margin; + fy += frameHeight + spacing; + } + } + + return texture; +}; + +module.exports = SpriteSheet; + + +/***/ }), +/* 849 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetFastValue = __webpack_require__(2); + +/** + * Parses a Sprite Sheet and adds the Frames to the Texture, where the Sprite Sheet is stored as a frame within an Atlas. + * + * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact + * same size and cannot be trimmed or rotated. + * + * @function Phaser.Textures.Parsers.SpriteSheetFromAtlas + * @memberof Phaser.Textures.Parsers + * @private + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. + * @param {Phaser.Textures.Frame} frame - The Frame that contains the Sprite Sheet. + * @param {object} config - An object describing how to parse the Sprite Sheet. + * @param {number} config.frameWidth - Width in pixels of a single frame in the sprite sheet. + * @param {number} [config.frameHeight] - Height in pixels of a single frame in the sprite sheet. Defaults to frameWidth if not provided. + * @param {number} [config.startFrame=0] - Index of the start frame in the sprite sheet + * @param {number} [config.endFrame=-1] - Index of the end frame in the sprite sheet. -1 mean all the rest of the frames + * @param {number} [config.margin=0] - If the frames have been drawn with a margin, specify the amount here. + * @param {number} [config.spacing=0] - If the frames have been drawn with spacing between them, specify the amount here. + * + * @return {Phaser.Textures.Texture} The Texture modified by this parser. + */ +var SpriteSheetFromAtlas = function (texture, frame, config) +{ + var frameWidth = GetFastValue(config, 'frameWidth', null); + var frameHeight = GetFastValue(config, 'frameHeight', frameWidth); + + // If missing we can't proceed + if (!frameWidth) + { + throw new Error('TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.'); + } + + // Add in a __BASE entry (for the entire atlas frame) + var source = texture.source[0]; + texture.add('__BASE', 0, 0, 0, source.width, source.height); + + var startFrame = GetFastValue(config, 'startFrame', 0); + var endFrame = GetFastValue(config, 'endFrame', -1); + var margin = GetFastValue(config, 'margin', 0); + var spacing = GetFastValue(config, 'spacing', 0); + + var x = frame.cutX; + var y = frame.cutY; + + var cutWidth = frame.cutWidth; + var cutHeight = frame.cutHeight; + var sheetWidth = frame.realWidth; + var sheetHeight = frame.realHeight; + + var row = Math.floor((sheetWidth - margin + spacing) / (frameWidth + spacing)); + var column = Math.floor((sheetHeight - margin + spacing) / (frameHeight + spacing)); + var total = row * column; + + // trim offsets + + var leftPad = frame.x; + var leftWidth = frameWidth - leftPad; + + var rightWidth = frameWidth - ((sheetWidth - cutWidth) - leftPad); + + var topPad = frame.y; + var topHeight = frameHeight - topPad; + + var bottomHeight = frameHeight - ((sheetHeight - cutHeight) - topPad); + + if (startFrame > total || startFrame < -total) + { + startFrame = 0; + } + + if (startFrame < 0) + { + // Allow negative skipframes. + startFrame = total + startFrame; + } + + if (endFrame !== -1) + { + total = startFrame + (endFrame + 1); + } + + var sheetFrame; + var frameX = margin; + var frameY = margin; + var frameIndex = 0; + var sourceIndex = frame.sourceIndex; + + for (var sheetY = 0; sheetY < column; sheetY++) + { + var topRow = (sheetY === 0); + var bottomRow = (sheetY === column - 1); + + for (var sheetX = 0; sheetX < row; sheetX++) + { + var leftRow = (sheetX === 0); + var rightRow = (sheetX === row - 1); + + sheetFrame = texture.add(frameIndex, sourceIndex, x + frameX, y + frameY, frameWidth, frameHeight); + + if (leftRow || topRow || rightRow || bottomRow) + { + var destX = (leftRow) ? leftPad : 0; + var destY = (topRow) ? topPad : 0; + + var trimWidth = 0; + var trimHeight = 0; + + if (leftRow) + { + trimWidth += (frameWidth - leftWidth); + } + + if (rightRow) + { + trimWidth += (frameWidth - rightWidth); + } + + if (topRow) + { + trimHeight += (frameHeight - topHeight); + } + + if (bottomRow) + { + trimHeight += (frameHeight - bottomHeight); + } + + var destWidth = frameWidth - trimWidth; + var destHeight = frameHeight - trimHeight; + + sheetFrame.cutWidth = destWidth; + sheetFrame.cutHeight = destHeight; + + sheetFrame.setTrim(frameWidth, frameHeight, destX, destY, destWidth, destHeight); + } + + frameX += spacing; + + if (leftRow) + { + frameX += leftWidth; + } + else if (rightRow) + { + frameX += rightWidth; + } + else + { + frameX += frameWidth; + } + + frameIndex++; + } + + frameX = margin; + frameY += spacing; + + if (topRow) + { + frameY += topHeight; + } + else if (bottomRow) + { + frameY += bottomHeight; + } + else + { + frameY += frameHeight; + } + } + + return texture; +}; + +module.exports = SpriteSheetFromAtlas; + + +/***/ }), +/* 850 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var imageHeight = 0; + +/** + * @function addFrame + * @private + * @since 3.0.0 + */ +var addFrame = function (texture, sourceIndex, name, frame) +{ + // The frame values are the exact coordinates to cut the frame out of the atlas from + + var y = imageHeight - frame.y - frame.height; + + texture.add(name, sourceIndex, frame.x, y, frame.width, frame.height); + + // These are the original (non-trimmed) sprite values + /* + if (src.trimmed) + { + newFrame.setTrim( + src.sourceSize.w, + src.sourceSize.h, + src.spriteSourceSize.x, + src.spriteSourceSize.y, + src.spriteSourceSize.w, + src.spriteSourceSize.h + ); + } + */ +}; + +/** + * Parses a Unity YAML File and creates Frames in the Texture. + * For more details about Sprite Meta Data see https://docs.unity3d.com/ScriptReference/SpriteMetaData.html + * + * @function Phaser.Textures.Parsers.UnityYAML + * @memberof Phaser.Textures.Parsers + * @private + * @since 3.0.0 + * + * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. + * @param {integer} sourceIndex - The index of the TextureSource. + * @param {object} yaml - The YAML data. + * + * @return {Phaser.Textures.Texture} The Texture modified by this parser. + */ +var UnityYAML = function (texture, sourceIndex, yaml) +{ + // Add in a __BASE entry (for the entire atlas) + var source = texture.source[sourceIndex]; + + texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height); + + imageHeight = source.height; + + var data = yaml.split('\n'); + + var lineRegExp = /^[ ]*(- )*(\w+)+[: ]+(.*)/; + + var prevSprite = ''; + var currentSprite = ''; + var rect = { x: 0, y: 0, width: 0, height: 0 }; + + // var pivot = { x: 0, y: 0 }; + // var border = { x: 0, y: 0, z: 0, w: 0 }; + + for (var i = 0; i < data.length; i++) + { + var results = data[i].match(lineRegExp); + + if (!results) + { + continue; + } + + var isList = (results[1] === '- '); + var key = results[2]; + var value = results[3]; + + if (isList) + { + if (currentSprite !== prevSprite) + { + addFrame(texture, sourceIndex, currentSprite, rect); + + prevSprite = currentSprite; + } + + rect = { x: 0, y: 0, width: 0, height: 0 }; + } + + if (key === 'name') + { + // Start new list + currentSprite = value; + continue; + } + + switch (key) + { + case 'x': + case 'y': + case 'width': + case 'height': + rect[key] = parseInt(value, 10); + break; + + // case 'pivot': + // pivot = eval('var obj = ' + value); + // break; + + // case 'border': + // border = eval('var obj = ' + value); + // break; + } + } + + if (currentSprite !== prevSprite) + { + addFrame(texture, sourceIndex, currentSprite, rect); + } + + return texture; +}; + +module.exports = UnityYAML; + +/* +Example data: + +TextureImporter: + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + spriteSheet: + sprites: + - name: asteroids_0 + rect: + serializedVersion: 2 + x: 5 + y: 328 + width: 65 + height: 82 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + - name: asteroids_1 + rect: + serializedVersion: 2 + x: 80 + y: 322 + width: 53 + height: 88 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + spritePackingTag: Asteroids +*/ + + +/***/ }), +/* 851 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Complete Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they complete playback. + * + * Listen to it from a Sound instance using `Sound.on('complete', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('complete', listener); + * music.play(); + * ``` + * + * @event Phaser.Sound.Events#COMPLETE + * @since 3.16.1 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + */ +module.exports = 'complete'; + + +/***/ }), +/* 852 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Audio Data Decoded Event. + * + * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method. + * + * Listen to it from the Sound Manager in a Scene using `this.sound.on('decoded', listener)`, i.e.: + * + * ```javascript + * this.sound.on('decoded', handler); + * this.sound.decodeAudio(key, audioData); + * ``` + * + * @event Phaser.Sound.Events#DECODED + * @since 3.18.0 + * + * @param {string} key - The key of the audio file that was decoded and added to the audio cache. + */ +module.exports = 'decoded'; + + +/***/ }), +/* 853 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Audio Data Decoded All Event. + * + * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method, + * once all files passed to the method have been decoded (or errored). + * + * Use `Phaser.Sound.Events#DECODED` to listen for single sounds being decoded, and `DECODED_ALL` to + * listen for them all completing. + * + * Listen to it from the Sound Manager in a Scene using `this.sound.on('decodedall', listener)`, i.e.: + * + * ```javascript + * this.sound.once('decodedall', handler); + * this.sound.decodeAudio([ audioFiles ]); + * ``` + * + * @event Phaser.Sound.Events#DECODED_ALL + * @since 3.18.0 + */ +module.exports = 'decodedall'; + + +/***/ }), +/* 854 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Destroy Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are destroyed, either + * directly or via a Sound Manager. + * + * Listen to it from a Sound instance using `Sound.on('destroy', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('destroy', listener); + * music.destroy(); + * ``` + * + * @event Phaser.Sound.Events#DESTROY + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + */ +module.exports = 'destroy'; + + +/***/ }), +/* 855 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Detune Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their detune value changes. + * + * Listen to it from a Sound instance using `Sound.on('detune', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('detune', listener); + * music.play(); + * music.setDetune(200); + * ``` + * + * @event Phaser.Sound.Events#DETUNE + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + * @param {number} detune - The new detune value of the Sound. + */ +module.exports = 'detune'; + + +/***/ }), +/* 856 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Manager Global Detune Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `detune` property of the Sound Manager is changed, which globally + * adjusts the detuning of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('rate', listener)`. + * + * @event Phaser.Sound.Events#GLOBAL_DETUNE + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. + * @param {number} detune - The updated detune value. + */ +module.exports = 'detune'; + + +/***/ }), +/* 857 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Manager Global Mute Event. + * + * This event is dispatched by the Sound Manager when its `mute` property is changed, either directly + * or via the `setMute` method. This changes the mute state of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('mute', listener)`. + * + * @event Phaser.Sound.Events#GLOBAL_MUTE + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the sound manager that emitted the event. + * @param {boolean} mute - The mute value. `true` if the Sound Manager is now muted, otherwise `false`. + */ +module.exports = 'mute'; + + +/***/ }), +/* 858 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Manager Global Rate Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `rate` property of the Sound Manager is changed, which globally + * adjusts the playback rate of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('rate', listener)`. + * + * @event Phaser.Sound.Events#GLOBAL_RATE + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. + * @param {number} rate - The updated rate value. + */ +module.exports = 'rate'; + + +/***/ }), +/* 859 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Manager Global Volume Event. + * + * This event is dispatched by the Sound Manager when its `volume` property is changed, either directly + * or via the `setVolume` method. This changes the volume of all active sounds. + * + * Listen to it from a Scene using: `this.sound.on('volume', listener)`. + * + * @event Phaser.Sound.Events#GLOBAL_VOLUME + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the sound manager that emitted the event. + * @param {number} volume - The new global volume of the Sound Manager. + */ +module.exports = 'volume'; + + +/***/ }), +/* 860 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Loop Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed. + * + * Listen to it from a Sound instance using `Sound.on('loop', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('loop', listener); + * music.setLoop(true); + * ``` + * + * This is not to be confused with the [LOOPED]{@linkcode Phaser.Sound.Events#event:LOOPED} event, which emits each time a Sound loops during playback. + * + * @event Phaser.Sound.Events#LOOP + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + * @param {boolean} loop - The new loop value. `true` if the Sound will loop, otherwise `false`. + */ +module.exports = 'loop'; + + +/***/ }), +/* 861 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Looped Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they loop during playback. + * + * Listen to it from a Sound instance using `Sound.on('looped', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('looped', listener); + * music.setLoop(true); + * music.play(); + * ``` + * + * This is not to be confused with the [LOOP]{@linkcode Phaser.Sound.Events#event:LOOP} event, which only emits when the loop state of a Sound is changed. + * + * @event Phaser.Sound.Events#LOOPED + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + */ +module.exports = 'looped'; + + +/***/ }), +/* 862 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Mute Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their mute state changes. + * + * Listen to it from a Sound instance using `Sound.on('mute', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('mute', listener); + * music.play(); + * music.setMute(true); + * ``` + * + * @event Phaser.Sound.Events#MUTE + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + * @param {boolean} mute - The mute value. `true` if the Sound is now muted, otherwise `false`. + */ +module.exports = 'mute'; + + +/***/ }), +/* 863 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pause All Sounds Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `pauseAll` method is invoked and after all current Sounds + * have been paused. + * + * Listen to it from a Scene using: `this.sound.on('pauseall', listener)`. + * + * @event Phaser.Sound.Events#PAUSE_ALL + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. + */ +module.exports = 'pauseall'; + + +/***/ }), +/* 864 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Pause Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are paused. + * + * Listen to it from a Sound instance using `Sound.on('pause', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('pause', listener); + * music.play(); + * music.pause(); + * ``` + * + * @event Phaser.Sound.Events#PAUSE + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + */ +module.exports = 'pause'; + + +/***/ }), +/* 865 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Play Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are played. + * + * Listen to it from a Sound instance using `Sound.on('play', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('play', listener); + * music.play(); + * ``` + * + * @event Phaser.Sound.Events#PLAY + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + */ +module.exports = 'play'; + + +/***/ }), +/* 866 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Rate Change Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their rate changes. + * + * Listen to it from a Sound instance using `Sound.on('rate', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('rate', listener); + * music.play(); + * music.setRate(0.5); + * ``` + * + * @event Phaser.Sound.Events#RATE + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + * @param {number} rate - The new rate of the Sound. + */ +module.exports = 'rate'; + + +/***/ }), +/* 867 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Resume All Sounds Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `resumeAll` method is invoked and after all current Sounds + * have been resumed. + * + * Listen to it from a Scene using: `this.sound.on('resumeall', listener)`. + * + * @event Phaser.Sound.Events#RESUME_ALL + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. + */ +module.exports = 'resumeall'; + + +/***/ }), +/* 868 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Resume Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are resumed from a paused state. + * + * Listen to it from a Sound instance using `Sound.on('resume', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('resume', listener); + * music.play(); + * music.pause(); + * music.resume(); + * ``` + * + * @event Phaser.Sound.Events#RESUME + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + */ +module.exports = 'resume'; + + +/***/ }), +/* 869 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Seek Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are seeked to a new position. + * + * Listen to it from a Sound instance using `Sound.on('seek', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('seek', listener); + * music.play(); + * music.setSeek(5000); + * ``` + * + * @event Phaser.Sound.Events#SEEK + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + * @param {number} detune - The new detune value of the Sound. + */ +module.exports = 'seek'; + + +/***/ }), +/* 870 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Stop All Sounds Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched when the `stopAll` method is invoked and after all current Sounds + * have been stopped. + * + * Listen to it from a Scene using: `this.sound.on('stopall', listener)`. + * + * @event Phaser.Sound.Events#STOP_ALL + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. + */ +module.exports = 'stopall'; + + +/***/ }), +/* 871 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Stop Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are stopped. + * + * Listen to it from a Sound instance using `Sound.on('stop', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('stop', listener); + * music.play(); + * music.stop(); + * ``` + * + * @event Phaser.Sound.Events#STOP + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + */ +module.exports = 'stop'; + + +/***/ }), +/* 872 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Manager Unlocked Event. + * + * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, + * or the HTML5 Audio Manager. It is dispatched during the update loop when the Sound Manager becomes unlocked. For + * Web Audio this is on the first user gesture on the page. + * + * Listen to it from a Scene using: `this.sound.on('unlocked', listener)`. + * + * @event Phaser.Sound.Events#UNLOCKED + * @since 3.0.0 + * + * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. + */ +module.exports = 'unlocked'; + + +/***/ }), +/* 873 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Sound Volume Event. + * + * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes. + * + * Listen to it from a Sound instance using `Sound.on('volume', listener)`, i.e.: + * + * ```javascript + * var music = this.sound.add('key'); + * music.on('volume', listener); + * music.play(); + * music.setVolume(0.5); + * ``` + * + * @event Phaser.Sound.Events#VOLUME + * @since 3.0.0 + * + * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. + * @param {number} volume - The new volume of the Sound. + */ +module.exports = 'volume'; + + +/***/ }), +/* 874 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects + */ + +var GameObjects = { + + Events: __webpack_require__(110), + + DisplayList: __webpack_require__(875), + GameObjectCreator: __webpack_require__(15), + GameObjectFactory: __webpack_require__(5), + UpdateList: __webpack_require__(903), + + Components: __webpack_require__(12), + + BuildGameObject: __webpack_require__(29), + BuildGameObjectAnimation: __webpack_require__(363), + GameObject: __webpack_require__(13), + BitmapText: __webpack_require__(128), + Blitter: __webpack_require__(182), + Container: __webpack_require__(183), + DOMElement: __webpack_require__(365), + DynamicBitmapText: __webpack_require__(184), + Extern: __webpack_require__(367), + Graphics: __webpack_require__(185), + Group: __webpack_require__(94), + Image: __webpack_require__(95), + Particles: __webpack_require__(932), + PathFollower: __webpack_require__(379), + RenderTexture: __webpack_require__(189), + RetroFont: __webpack_require__(941), + Sprite: __webpack_require__(67), + Text: __webpack_require__(190), + TileSprite: __webpack_require__(191), + Zone: __webpack_require__(106), + + // Shapes + + Shape: __webpack_require__(30), + Arc: __webpack_require__(381), + Curve: __webpack_require__(382), + Ellipse: __webpack_require__(383), + Grid: __webpack_require__(384), + IsoBox: __webpack_require__(385), + IsoTriangle: __webpack_require__(386), + Line: __webpack_require__(387), + Polygon: __webpack_require__(388), + Rectangle: __webpack_require__(393), + Star: __webpack_require__(394), + Triangle: __webpack_require__(395), + + // Game Object Factories + + Factories: { + Blitter: __webpack_require__(986), + Container: __webpack_require__(987), + DOMElement: __webpack_require__(988), + DynamicBitmapText: __webpack_require__(989), + Extern: __webpack_require__(990), + Graphics: __webpack_require__(991), + Group: __webpack_require__(992), + Image: __webpack_require__(993), + Particles: __webpack_require__(994), + PathFollower: __webpack_require__(995), + RenderTexture: __webpack_require__(996), + Sprite: __webpack_require__(997), + StaticBitmapText: __webpack_require__(998), + Text: __webpack_require__(999), + TileSprite: __webpack_require__(1000), + Zone: __webpack_require__(1001), + + // Shapes + Arc: __webpack_require__(1002), + Curve: __webpack_require__(1003), + Ellipse: __webpack_require__(1004), + Grid: __webpack_require__(1005), + IsoBox: __webpack_require__(1006), + IsoTriangle: __webpack_require__(1007), + Line: __webpack_require__(1008), + Polygon: __webpack_require__(1009), + Rectangle: __webpack_require__(1010), + Star: __webpack_require__(1011), + Triangle: __webpack_require__(1012) + }, + + Creators: { + Blitter: __webpack_require__(1013), + Container: __webpack_require__(1014), + DynamicBitmapText: __webpack_require__(1015), + Graphics: __webpack_require__(1016), + Group: __webpack_require__(1017), + Image: __webpack_require__(1018), + Particles: __webpack_require__(1019), + RenderTexture: __webpack_require__(1020), + Sprite: __webpack_require__(1021), + StaticBitmapText: __webpack_require__(1022), + Text: __webpack_require__(1023), + TileSprite: __webpack_require__(1024), + Zone: __webpack_require__(1025) + } + +}; + +if (true) +{ + // WebGL only Game Objects + GameObjects.Mesh = __webpack_require__(129); + GameObjects.Quad = __webpack_require__(194); + GameObjects.Shader = __webpack_require__(195); + + GameObjects.Factories.Mesh = __webpack_require__(1032); + GameObjects.Factories.Quad = __webpack_require__(1033); + GameObjects.Factories.Shader = __webpack_require__(1034); + + GameObjects.Creators.Mesh = __webpack_require__(1035); + GameObjects.Creators.Quad = __webpack_require__(1036); + GameObjects.Creators.Shader = __webpack_require__(1037); + + GameObjects.Light = __webpack_require__(399); + + __webpack_require__(400); + __webpack_require__(1038); +} + +module.exports = GameObjects; + + +/***/ }), +/* 875 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var List = __webpack_require__(125); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var StableSort = __webpack_require__(127); + +/** + * @classdesc + * The Display List plugin. + * + * Display Lists belong to a Scene and maintain the list of Game Objects to render every frame. + * + * Some of these Game Objects may also be part of the Scene's [Update List]{@link Phaser.GameObjects.UpdateList}, for updating. + * + * @class DisplayList + * @extends Phaser.Structs.List. + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene that this Display List belongs to. + */ +var DisplayList = new Class({ + + Extends: List, + + initialize: + + function DisplayList (scene) + { + List.call(this, scene); + + /** + * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. + * + * @name Phaser.GameObjects.DisplayList#sortChildrenFlag + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.sortChildrenFlag = false; + + /** + * The Scene that this Display List belongs to. + * + * @name Phaser.GameObjects.DisplayList#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * The Scene's Systems. + * + * @name Phaser.GameObjects.DisplayList#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.DisplayList#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.DisplayList#start + * @private + * @since 3.5.0 + */ + start: function () + { + this.systems.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * Force a sort of the display list on the next call to depthSort. + * + * @method Phaser.GameObjects.DisplayList#queueDepthSort + * @since 3.0.0 + */ + queueDepthSort: function () + { + this.sortChildrenFlag = true; + }, + + /** + * Immediately sorts the display list if the flag is set. + * + * @method Phaser.GameObjects.DisplayList#depthSort + * @since 3.0.0 + */ + depthSort: function () + { + if (this.sortChildrenFlag) + { + StableSort.inplace(this.list, this.sortByDepth); + + this.sortChildrenFlag = false; + } + }, + + /** + * Compare the depth of two Game Objects. + * + * @method Phaser.GameObjects.DisplayList#sortByDepth + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} childA - The first Game Object. + * @param {Phaser.GameObjects.GameObject} childB - The second Game Object. + * + * @return {integer} The difference between the depths of each Game Object. + */ + sortByDepth: function (childA, childB) + { + return childA._depth - childB._depth; + }, + + /** + * Returns an array which contains all objects currently on the Display List. + * This is a reference to the main list array, not a copy of it, so be careful not to modify it. + * + * @method Phaser.GameObjects.DisplayList#getChildren + * @since 3.12.0 + * + * @return {Phaser.GameObjects.GameObject[]} The group members. + */ + getChildren: function () + { + return this.list; + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.GameObjects.DisplayList#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + var i = this.list.length; + + while (i--) + { + this.list[i].destroy(true); + } + + this.list.length = 0; + + this.systems.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.GameObjects.DisplayList#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + } + +}); + +PluginCache.register('DisplayList', DisplayList, 'displayList'); + +module.exports = DisplayList; + + +/***/ }), +/* 876 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.Array.Matrix + */ + +module.exports = { + + CheckMatrix: __webpack_require__(179), + MatrixToString: __webpack_require__(877), + ReverseColumns: __webpack_require__(878), + ReverseRows: __webpack_require__(879), + Rotate180: __webpack_require__(880), + RotateLeft: __webpack_require__(881), + RotateMatrix: __webpack_require__(126), + RotateRight: __webpack_require__(882), + TransposeMatrix: __webpack_require__(360) + +}; + + +/***/ }), +/* 877 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Pad = __webpack_require__(158); +var CheckMatrix = __webpack_require__(179); + +/** + * Generates a string (which you can pass to console.log) from the given Array Matrix. + * + * @function Phaser.Utils.Array.Matrix.MatrixToString + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix] + * + * @param {T[][]} [matrix] - A 2-dimensional array. + * + * @return {string} A string representing the matrix. + */ +var MatrixToString = function (matrix) +{ + var str = ''; + + if (!CheckMatrix(matrix)) + { + return str; + } + + for (var r = 0; r < matrix.length; r++) + { + for (var c = 0; c < matrix[r].length; c++) + { + var cell = matrix[r][c].toString(); + + if (cell !== 'undefined') + { + str += Pad(cell, 2); + } + else + { + str += '?'; + } + + if (c < matrix[r].length - 1) + { + str += ' |'; + } + } + + if (r < matrix.length - 1) + { + str += '\n'; + + for (var i = 0; i < matrix[r].length; i++) + { + str += '---'; + + if (i < matrix[r].length - 1) + { + str += '+'; + } + } + + str += '\n'; + } + + } + + return str; +}; + +module.exports = MatrixToString; + + +/***/ }), +/* 878 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Reverses the columns in the given Array Matrix. + * + * @function Phaser.Utils.Array.Matrix.ReverseColumns + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to reverse the columns for. + * + * @return {T[][]} The column reversed matrix. + */ +var ReverseColumns = function (matrix) +{ + return matrix.reverse(); +}; + +module.exports = ReverseColumns; + + +/***/ }), +/* 879 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Reverses the rows in the given Array Matrix. + * + * @function Phaser.Utils.Array.Matrix.ReverseRows + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to reverse the rows for. + * + * @return {T[][]} The column reversed matrix. + */ +var ReverseRows = function (matrix) +{ + for (var i = 0; i < matrix.length; i++) + { + matrix[i].reverse(); + } + + return matrix; +}; + +module.exports = ReverseRows; + + +/***/ }), +/* 880 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(126); + +/** + * Rotates the array matrix 180 degrees. + * + * @function Phaser.Utils.Array.Matrix.Rotate180 + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var Rotate180 = function (matrix) +{ + return RotateMatrix(matrix, 180); +}; + +module.exports = Rotate180; + + +/***/ }), +/* 881 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(126); + +/** + * Rotates the array matrix to the left (or 90 degrees) + * + * @function Phaser.Utils.Array.Matrix.RotateLeft + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateLeft = function (matrix) +{ + return RotateMatrix(matrix, 90); +}; + +module.exports = RotateLeft; + + +/***/ }), +/* 882 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateMatrix = __webpack_require__(126); + +/** + * Rotates the array matrix to the left (or -90 degrees) + * + * @function Phaser.Utils.Array.Matrix.RotateRight + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array to rotate. + * + * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix. + */ +var RotateRight = function (matrix) +{ + return RotateMatrix(matrix, -90); +}; + +module.exports = RotateRight; + + +/***/ }), +/* 883 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds the given item, or array of items, to the array. + * + * Each item must be unique within the array. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * + * @function Phaser.Utils.Array.Add + * @since 3.4.0 + * + * @param {array} array - The array to be added to. + * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. + * @param {integer} [limit] - Optional limit which caps the size of the array. + * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {array} The input array. + */ +var Add = function (array, item, limit, callback, context) +{ + if (context === undefined) { context = array; } + + if (limit > 0) + { + var remaining = limit - array.length; + + // There's nothing more we can do here, the array is full + if (remaining <= 0) + { + return null; + } + } + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + if (array.indexOf(item) === -1) + { + array.push(item); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to insert + + // Ensure all the items are unique + var itemLength = item.length - 1; + + while (itemLength >= 0) + { + if (array.indexOf(item[itemLength]) !== -1) + { + // Already exists in array, so remove it + item.splice(itemLength, 1); + } + + itemLength--; + } + + // Anything left? + itemLength = item.length; + + if (itemLength === 0) + { + return null; + } + + if (limit > 0 && itemLength > remaining) + { + item.splice(remaining); + + itemLength = remaining; + } + + for (var i = 0; i < itemLength; i++) + { + var entry = item[i]; + + array.push(entry); + + if (callback) + { + callback.call(context, entry); + } + } + + return item; +}; + +module.exports = Add; + + +/***/ }), +/* 884 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Adds the given item, or array of items, to the array starting at the index specified. + * + * Each item must be unique within the array. + * + * Existing elements in the array are shifted up. + * + * The array is modified in-place and returned. + * + * You can optionally specify a limit to the maximum size of the array. If the quantity of items being + * added will take the array length over this limit, it will stop adding once the limit is reached. + * + * You can optionally specify a callback to be invoked for each item successfully added to the array. + * + * @function Phaser.Utils.Array.AddAt + * @since 3.4.0 + * + * @param {array} array - The array to be added to. + * @param {any|any[]} item - The item, or array of items, to add to the array. + * @param {integer} [index=0] - The index in the array where the item will be inserted. + * @param {integer} [limit] - Optional limit which caps the size of the array. + * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {array} The input array. + */ +var AddAt = function (array, item, index, limit, callback, context) +{ + if (index === undefined) { index = 0; } + if (context === undefined) { context = array; } + + if (limit > 0) + { + var remaining = limit - array.length; + + // There's nothing more we can do here, the array is full + if (remaining <= 0) + { + return null; + } + } + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) + { + if (array.indexOf(item) === -1) + { + array.splice(index, 0, item); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } + } + + // If we got this far, we have an array of items to insert + + // Ensure all the items are unique + var itemLength = item.length - 1; + + while (itemLength >= 0) + { + if (array.indexOf(item[itemLength]) !== -1) + { + // Already exists in array, so remove it + item.pop(); + } + + itemLength--; + } + + // Anything left? + itemLength = item.length; + + if (itemLength === 0) + { + return null; + } + + // Truncate to the limit + if (limit > 0 && itemLength > remaining) + { + item.splice(remaining); + + itemLength = remaining; + } + + for (var i = itemLength - 1; i >= 0; i--) + { + var entry = item[i]; + + array.splice(index, 0, entry); + + if (callback) + { + callback.call(context, entry); + } + } + + return item; +}; + +module.exports = AddAt; + + +/***/ }), +/* 885 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given element to the top of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.BringToTop + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * + * @return {*} The element that was moved. + */ +var BringToTop = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex < array.length) + { + array.splice(currentIndex, 1); + array.push(item); + } + + return item; +}; + +module.exports = BringToTop; + + +/***/ }), +/* 886 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(66); + +/** + * Returns the total number of elements in the array which have a property matching the given value. + * + * @function Phaser.Utils.Array.CountAllMatching + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} property - The property to test on each array element. + * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {integer} [startIndex] - An optional start index to search from. + * @param {integer} [endIndex] - An optional end index to search to. + * + * @return {integer} The total number of elements with properties matching the given value. + */ +var CountAllMatching = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + var total = 0; + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (child[property] === value) + { + total++; + } + } + } + + return total; +}; + +module.exports = CountAllMatching; + + +/***/ }), +/* 887 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Passes each element in the array to the given callback. + * + * @function Phaser.Utils.Array.Each + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {function} callback - A callback to be invoked for each item in the array. + * @param {object} context - The context in which the callback is invoked. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the current array item. + * + * @return {array} The input array. + */ +var Each = function (array, callback, context) +{ + var i; + var args = [ null ]; + + for (i = 3; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = 0; i < array.length; i++) + { + args[0] = array[i]; + + callback.apply(context, args); + } + + return array; +}; + +module.exports = Each; + + +/***/ }), +/* 888 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(66); + +/** + * Passes each element in the array, between the start and end indexes, to the given callback. + * + * @function Phaser.Utils.Array.EachInRange + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {function} callback - A callback to be invoked for each item in the array. + * @param {object} context - The context in which the callback is invoked. + * @param {integer} startIndex - The start index to search from. + * @param {integer} endIndex - The end index to search to. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + * + * @return {array} The input array. + */ +var EachInRange = function (array, callback, context, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + var i; + var args = [ null ]; + + for (i = 5; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = startIndex; i < endIndex; i++) + { + args[0] = array[i]; + + callback.apply(context, args); + } + } + + return array; +}; + +module.exports = EachInRange; + + +/***/ }), +/* 889 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(66); + +/** + * Returns all elements in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return only elements that have their visible property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 elements. + * + * @function Phaser.Utils.Array.GetAll + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} [property] - The property to test on each array element. + * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {integer} [startIndex] - An optional start index to search from. + * @param {integer} [endIndex] - An optional end index to search to. + * + * @return {array} All matching elements from the array. + */ +var GetAll = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + var output = []; + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (!property || + (property && value === undefined && child.hasOwnProperty(property)) || + (property && value !== undefined && child[property] === value)) + { + output.push(child); + } + } + } + + return output; +}; + +module.exports = GetAll; + + +/***/ }), +/* 890 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(66); + +/** + * Returns the first element in the array. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return the first element that had its `visible` property set. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. + * + * @function Phaser.Utils.Array.GetFirst + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} [property] - The property to test on each array element. + * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. + * @param {integer} [startIndex=0] - An optional start index to search from. + * @param {integer} [endIndex=array.length] - An optional end index to search up to (but not included) + * + * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. + */ +var GetFirst = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var child = array[i]; + + if (!property || + (property && value === undefined && child.hasOwnProperty(property)) || + (property && value !== undefined && child[property] === value)) + { + return child; + } + } + } + + return null; +}; + +module.exports = GetFirst; + + +/***/ }), +/* 891 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element down one place in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveDown + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item - The element to move down the array. + * + * @return {array} The input array. + */ +var MoveDown = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex > 0) + { + var item2 = array[currentIndex - 1]; + + var index2 = array.indexOf(item2); + + array[currentIndex] = item2; + array[index2] = item; + } + + return array; +}; + +module.exports = MoveDown; + + +/***/ }), +/* 892 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves an element in an array to a new position within the same array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveTo + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * @param {integer} index - The new index that the element will be moved to. + * + * @return {*} The element that was moved. + */ +var MoveTo = function (array, item, index) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex === -1 || index < 0 || index >= array.length) + { + throw new Error('Supplied index out of bounds'); + } + + if (currentIndex !== index) + { + // Remove + array.splice(currentIndex, 1); + + // Add in new location + array.splice(index, 0, item); + } + + return item; +}; + +module.exports = MoveTo; + + +/***/ }), +/* 893 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given array element up one place in the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.MoveUp + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item - The element to move up the array. + * + * @return {array} The input array. + */ +var MoveUp = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex < array.length - 1) + { + // The element one above `item` in the array + var item2 = array[currentIndex + 1]; + var index2 = array.indexOf(item2); + + array[currentIndex] = item2; + array[index2] = item; + } + + return array; +}; + +module.exports = MoveUp; + + +/***/ }), +/* 894 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Create an array representing the range of numbers (usually integers), between, and inclusive of, + * the given `start` and `end` arguments. For example: + * + * `var array = numberArray(2, 4); // array = [2, 3, 4]` + * `var array = numberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * + * This is equivalent to `numberArrayStep(start, end, 1)`. + * + * You can optionally provide a prefix and / or suffix string. If given the array will contain + * strings, not integers. For example: + * + * `var array = numberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` + * `var array = numberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` + * + * @function Phaser.Utils.Array.NumberArray + * @since 3.0.0 + * + * @param {number} start - The minimum value the array starts with. + * @param {number} end - The maximum value the array contains. + * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers. + * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers. + * + * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided. + */ +var NumberArray = function (start, end, prefix, suffix) +{ + var result = []; + + for (var i = start; i <= end; i++) + { + if (prefix || suffix) + { + var key = (prefix) ? prefix + i.toString() : i.toString(); + + if (suffix) + { + key = key.concat(suffix); + } + + result.push(key); + } + else + { + result.push(i); + } + } + + return result; +}; + +module.exports = NumberArray; + + +/***/ }), +/* 895 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RoundAwayFromZero = __webpack_require__(306); + +/** + * Create an array of numbers (positive and/or negative) progressing from `start` + * up to but not including `end` by advancing by `step`. + * + * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified. + * + * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0; + * for forward compatibility make sure to pass in actual numbers. + * + * @example + * NumberArrayStep(4); + * // => [0, 1, 2, 3] + * + * NumberArrayStep(1, 5); + * // => [1, 2, 3, 4] + * + * NumberArrayStep(0, 20, 5); + * // => [0, 5, 10, 15] + * + * NumberArrayStep(0, -4, -1); + * // => [0, -1, -2, -3] + * + * NumberArrayStep(1, 4, 0); + * // => [1, 1, 1] + * + * NumberArrayStep(0); + * // => [] + * + * @function Phaser.Utils.Array.NumberArrayStep + * @since 3.0.0 + * + * @param {number} [start=0] - The start of the range. + * @param {number} [end=null] - The end of the range. + * @param {number} [step=1] - The value to increment or decrement by. + * + * @return {number[]} The array of number values. + */ +var NumberArrayStep = function (start, end, step) +{ + if (start === undefined) { start = 0; } + if (end === undefined) { end = null; } + if (step === undefined) { step = 1; } + + if (end === null) + { + end = start; + start = 0; + } + + var result = []; + + var total = Math.max(RoundAwayFromZero((end - start) / (step || 1)), 0); + + for (var i = 0; i < total; i++) + { + result.push(start); + start += step; + } + + return result; +}; + +module.exports = NumberArrayStep; + + +/***/ }), +/* 896 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(78); + +/** + * Removes the item from the given position in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. + * + * @function Phaser.Utils.Array.RemoveAt + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {integer} index - The array index to remove the item from. The index must be in bounds or it will throw an error. + * @param {function} [callback] - A callback to be invoked for the item removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {*} The item that was removed. + */ +var RemoveAt = function (array, index, callback, context) +{ + if (context === undefined) { context = array; } + + if (index < 0 || index > array.length - 1) + { + throw new Error('Index out of bounds'); + } + + var item = SpliceOne(array, index); + + if (callback) + { + callback.call(context, item); + } + + return item; +}; + +module.exports = RemoveAt; + + +/***/ }), +/* 897 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(66); + +/** + * Removes the item within the given range in the array. + * + * The array is modified in-place. + * + * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. + * + * @function Phaser.Utils.Array.RemoveBetween + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {integer} startIndex - The start index to remove from. + * @param {integer} endIndex - The end index to remove to. + * @param {function} [callback] - A callback to be invoked for the item removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {Array.<*>} An array of items that were removed. + */ +var RemoveBetween = function (array, startIndex, endIndex, callback, context) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + if (context === undefined) { context = array; } + + if (SafeRange(array, startIndex, endIndex)) + { + var size = endIndex - startIndex; + + var removed = array.splice(startIndex, size); + + if (callback) + { + for (var i = 0; i < removed.length; i++) + { + var entry = removed[i]; + + callback.call(context, entry); + } + } + + return removed; + } + else + { + return []; + } +}; + +module.exports = RemoveBetween; + + +/***/ }), +/* 898 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SpliceOne = __webpack_require__(78); + +/** + * Removes a random object from the given array and returns it. + * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index. + * + * @function Phaser.Utils.Array.RemoveRandomElement + * @since 3.0.0 + * + * @param {array} array - The array to removed a random element from. + * @param {integer} [start=0] - The array index to start the search from. + * @param {integer} [length=array.length] - Optional restriction on the number of elements to randomly select from. + * + * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. + */ +var RemoveRandomElement = function (array, start, length) +{ + if (start === undefined) { start = 0; } + if (length === undefined) { length = array.length; } + + var randomIndex = start + Math.floor(Math.random() * length); + + return SpliceOne(array, randomIndex); +}; + +module.exports = RemoveRandomElement; + + +/***/ }), +/* 899 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Replaces an element of the array with the new element. + * The new element cannot already be a member of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.Replace + * @since 3.4.0 + * + * @param {*} oldChild - The element in the array that will be replaced. + * @param {*} newChild - The element to be inserted into the array at the position of `oldChild`. + * + * @return {boolean} Returns true if the oldChild was successfully replaced, otherwise returns false. + */ +var Replace = function (array, oldChild, newChild) +{ + var index1 = array.indexOf(oldChild); + var index2 = array.indexOf(newChild); + + if (index1 !== -1 && index2 === -1) + { + array[index1] = newChild; + + return true; + } + else + { + return false; + } +}; + +module.exports = Replace; + + +/***/ }), +/* 900 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the given element to the bottom of the array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.SendToBack + * @since 3.4.0 + * + * @param {array} array - The array. + * @param {*} item - The element to move. + * + * @return {*} The element that was moved. + */ +var SendToBack = function (array, item) +{ + var currentIndex = array.indexOf(item); + + if (currentIndex !== -1 && currentIndex > 0) + { + array.splice(currentIndex, 1); + array.unshift(item); + } + + return item; +}; + +module.exports = SendToBack; + + +/***/ }), +/* 901 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SafeRange = __webpack_require__(66); + +/** + * Scans the array for elements with the given property. If found, the property is set to the `value`. + * + * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`. + * + * Optionally you can specify a start and end index. For example if the array had 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements. + * + * @function Phaser.Utils.Array.SetAll + * @since 3.4.0 + * + * @param {array} array - The array to search. + * @param {string} property - The property to test for on each array element. + * @param {*} value - The value to set the property to. + * @param {integer} [startIndex] - An optional start index to search from. + * @param {integer} [endIndex] - An optional end index to search to. + * + * @return {array} The input array. + */ +var SetAll = function (array, property, value, startIndex, endIndex) +{ + if (startIndex === undefined) { startIndex = 0; } + if (endIndex === undefined) { endIndex = array.length; } + + if (SafeRange(array, startIndex, endIndex)) + { + for (var i = startIndex; i < endIndex; i++) + { + var entry = array[i]; + + if (entry.hasOwnProperty(property)) + { + entry[property] = value; + } + } + } + + return array; +}; + +module.exports = SetAll; + + +/***/ }), +/* 902 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Swaps the position of two elements in the given array. + * The elements must exist in the same array. + * The array is modified in-place. + * + * @function Phaser.Utils.Array.Swap + * @since 3.4.0 + * + * @param {array} array - The input array. + * @param {*} item1 - The first element to swap. + * @param {*} item2 - The second element to swap. + * + * @return {array} The input array. + */ +var Swap = function (array, item1, item2) +{ + if (item1 === item2) + { + return; + } + + var index1 = array.indexOf(item1); + var index2 = array.indexOf(item2); + + if (index1 < 0 || index2 < 0) + { + throw new Error('Supplied items must be elements of the same array'); + } + + array[index1] = item2; + array[index2] = item1; + + return array; +}; + +module.exports = Swap; + + +/***/ }), +/* 903 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); + +/** + * @classdesc + * The Update List plugin. + * + * Update Lists belong to a Scene and maintain the list Game Objects to be updated every frame. + * + * Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering. + * + * @class UpdateList + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene that the Update List belongs to. + */ +var UpdateList = new Class({ + + initialize: + + function UpdateList (scene) + { + /** + * The Scene that the Update List belongs to. + * + * @name Phaser.GameObjects.UpdateList#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * The Scene's Systems. + * + * @name Phaser.GameObjects.UpdateList#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * The list of Game Objects. + * + * @name Phaser.GameObjects.UpdateList#_list + * @type {array} + * @private + * @default [] + * @since 3.0.0 + */ + this._list = []; + + /** + * Game Objects that are pending insertion into the list. + * + * @name Phaser.GameObjects.UpdateList#_pendingInsertion + * @type {array} + * @private + * @default [] + * @since 3.0.0 + */ + this._pendingInsertion = []; + + /** + * Game Objects that are pending removal from the list. + * + * @name Phaser.GameObjects.UpdateList#_pendingRemoval + * @type {array} + * @private + * @default [] + * @since 3.0.0 + */ + this._pendingRemoval = []; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.UpdateList#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.GameObjects.UpdateList#start + * @private + * @since 3.5.0 + */ + start: function () + { + var eventEmitter = this.systems.events; + + eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this); + eventEmitter.on(SceneEvents.UPDATE, this.update, this); + eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * Add a Game Object to the Update List. + * + * @method Phaser.GameObjects.UpdateList#add + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to add. + * + * @return {Phaser.GameObjects.GameObject} The added Game Object. + */ + add: function (child) + { + // Is child already in this list? + + if (this._list.indexOf(child) === -1 && this._pendingInsertion.indexOf(child) === -1) + { + this._pendingInsertion.push(child); + } + + return child; + }, + + /** + * The pre-update step. + * + * Handles Game Objects that are pending insertion to and removal from the list. + * + * @method Phaser.GameObjects.UpdateList#preUpdate + * @since 3.0.0 + */ + preUpdate: function () + { + var toRemove = this._pendingRemoval.length; + var toInsert = this._pendingInsertion.length; + + if (toRemove === 0 && toInsert === 0) + { + // Quick bail + return; + } + + var i; + var gameObject; + + // Delete old gameObjects + for (i = 0; i < toRemove; i++) + { + gameObject = this._pendingRemoval[i]; + + var index = this._list.indexOf(gameObject); + + if (index > -1) + { + this._list.splice(index, 1); + } + } + + // Move pending to active + this._list = this._list.concat(this._pendingInsertion.splice(0)); + + // Clear the lists + this._pendingRemoval.length = 0; + this._pendingInsertion.length = 0; + }, + + /** + * The update step. + * + * Pre-updates every active Game Object in the list. + * + * @method Phaser.GameObjects.UpdateList#update + * @since 3.0.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time elapsed since the last frame. + */ + update: function (time, delta) + { + for (var i = 0; i < this._list.length; i++) + { + var gameObject = this._list[i]; + + if (gameObject.active) + { + gameObject.preUpdate.call(gameObject, time, delta); + } + } + }, + + /** + * Remove a Game Object from the list. + * + * @method Phaser.GameObjects.UpdateList#remove + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to remove from the list. + * + * @return {Phaser.GameObjects.GameObject} The removed Game Object. + */ + remove: function (child) + { + var index = this._pendingRemoval.indexOf(child); + + if (index !== -1) + { + this._pendingRemoval.push(child); + } + + return child; + }, + + /** + * Remove all Game Objects from the list. + * + * @method Phaser.GameObjects.UpdateList#removeAll + * @since 3.0.0 + * + * @return {Phaser.GameObjects.UpdateList} This UpdateList. + */ + removeAll: function () + { + var i = this._list.length; + + while (i--) + { + this.remove(this._list[i]); + } + + return this; + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.GameObjects.UpdateList#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + var i = this._list.length; + + while (i--) + { + this._list[i].destroy(true); + } + + i = this._pendingRemoval.length; + + while (i--) + { + this._pendingRemoval[i].destroy(true); + } + + i = this._pendingInsertion.length; + + while (i--) + { + this._pendingInsertion[i].destroy(true); + } + + this._list.length = 0; + this._pendingRemoval.length = 0; + this._pendingInsertion.length = 0; + + var eventEmitter = this.systems.events; + + eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this); + eventEmitter.off(SceneEvents.UPDATE, this.update, this); + eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.GameObjects.UpdateList#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + }, + + /** + * The length of the list. + * + * @name Phaser.GameObjects.UpdateList#length + * @type {integer} + * @readonly + * @since 3.10.0 + */ + length: { + + get: function () + { + return this._list.length; + } + + } + +}); + +PluginCache.register('UpdateList', UpdateList, 'updateList'); + +module.exports = UpdateList; + + +/***/ }), +/* 904 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the position, width and height of a BitmapText Game Object. + * + * Returns a BitmapTextSize object that contains global and local variants of the Game Objects x and y coordinates and + * its width and height. + * + * The global position and size take into account the Game Object's position and scale. + * + * The local position and size just takes into account the font data. + * + * @function GetBitmapTextSize + * @since 3.0.0 + * @private + * + * @param {(Phaser.GameObjects.DynamicBitmapText|Phaser.GameObjects.BitmapText)} src - The BitmapText to calculate the position, width and height of. + * @param {boolean} [round] - Whether to round the results to the nearest integer. + * @param {object} [out] - Optional object to store the results in, to save constant object creation. + * + * @return {Phaser.Types.GameObjects.BitmapText.BitmapTextSize} The calculated position, width and height of the BitmapText. + */ +var GetBitmapTextSize = function (src, round, out) +{ + if (out === undefined) + { + out = { + local: { + x: 0, + y: 0, + width: 0, + height: 0 + }, + global: { + x: 0, + y: 0, + width: 0, + height: 0 + }, + lines: { + shortest: 0, + longest: 0, + lengths: null + } + }; + } + + var text = src.text; + var textLength = text.length; + + var bx = Number.MAX_VALUE; + var by = Number.MAX_VALUE; + var bw = 0; + var bh = 0; + + var chars = src.fontData.chars; + var lineHeight = src.fontData.lineHeight; + var letterSpacing = src.letterSpacing; + + var xAdvance = 0; + var yAdvance = 0; + + var charCode = 0; + + var glyph = null; + + var x = 0; + var y = 0; + + var scale = (src.fontSize / src.fontData.size); + var sx = scale * src.scaleX; + var sy = scale * src.scaleY; + + var lastGlyph = null; + var lastCharCode = 0; + var lineWidths = []; + var shortestLine = Number.MAX_VALUE; + var longestLine = 0; + var currentLine = 0; + var currentLineWidth = 0; + + for (var i = 0; i < textLength; i++) + { + charCode = text.charCodeAt(i); + + if (charCode === 10) + { + xAdvance = 0; + yAdvance += lineHeight; + lastGlyph = null; + + lineWidths[currentLine] = currentLineWidth; + + if (currentLineWidth > longestLine) + { + longestLine = currentLineWidth; + } + + if (currentLineWidth < shortestLine) + { + shortestLine = currentLineWidth; + } + + currentLine++; + currentLineWidth = 0; + continue; + } + + glyph = chars[charCode]; + + if (!glyph) + { + continue; + } + + x = xAdvance; + y = yAdvance; + + if (lastGlyph !== null) + { + var kerningOffset = glyph.kerning[lastCharCode]; + x += (kerningOffset !== undefined) ? kerningOffset : 0; + } + + if (bx > x) + { + bx = x; + } + + if (by > y) + { + by = y; + } + + var gw = x + glyph.xAdvance; + var gh = y + lineHeight; + + if (bw < gw) + { + bw = gw; + } + + if (bh < gh) + { + bh = gh; + } + + xAdvance += glyph.xAdvance + letterSpacing; + lastGlyph = glyph; + lastCharCode = charCode; + currentLineWidth = gw * scale; + } + + lineWidths[currentLine] = currentLineWidth; + + if (currentLineWidth > longestLine) + { + longestLine = currentLineWidth; + } + + if (currentLineWidth < shortestLine) + { + shortestLine = currentLineWidth; + } + + var local = out.local; + var global = out.global; + var lines = out.lines; + + local.x = bx * scale; + local.y = by * scale; + local.width = bw * scale; + local.height = bh * scale; + + global.x = (src.x - src.displayOriginX) + (bx * sx); + global.y = (src.y - src.displayOriginY) + (by * sy); + global.width = bw * sx; + global.height = bh * sy; + + lines.shortest = shortestLine; + lines.longest = longestLine; + lines.lengths = lineWidths; + + if (round) + { + local.x = Math.round(local.x); + local.y = Math.round(local.y); + local.width = Math.round(local.width); + local.height = Math.round(local.height); + + global.x = Math.round(global.x); + global.y = Math.round(global.y); + global.width = Math.round(global.width); + global.height = Math.round(global.height); + + lines.shortest = Math.round(shortestLine); + lines.longest = Math.round(longestLine); + } + + return out; +}; + +module.exports = GetBitmapTextSize; + + +/***/ }), +/* 905 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ParseXMLBitmapFont = __webpack_require__(181); + +/** + * Parse an XML Bitmap Font from an Atlas. + * + * Adds the parsed Bitmap Font data to the cache with the `fontName` key. + * + * @function ParseFromAtlas + * @since 3.0.0 + * @private + * + * @param {Phaser.Scene} scene - The Scene to parse the Bitmap Font for. + * @param {string} fontName - The key of the font to add to the Bitmap Font cache. + * @param {string} textureKey - The key of the BitmapFont's texture. + * @param {string} frameKey - The key of the BitmapFont texture's frame. + * @param {string} xmlKey - The key of the XML data of the font to parse. + * @param {integer} xSpacing - The x-axis spacing to add between each letter. + * @param {integer} ySpacing - The y-axis spacing to add to the line height. + * + * @return {boolean} Whether the parsing was successful or not. + */ +var ParseFromAtlas = function (scene, fontName, textureKey, frameKey, xmlKey, xSpacing, ySpacing) +{ + var frame = scene.sys.textures.getFrame(textureKey, frameKey); + var xml = scene.sys.cache.xml.get(xmlKey); + + if (frame && xml) + { + var data = ParseXMLBitmapFont(xml, xSpacing, ySpacing, frame); + + scene.sys.cache.bitmapFont.add(fontName, { data: data, texture: textureKey, frame: frameKey }); + + return true; + } + else + { + return false; + } +}; + +module.exports = ParseFromAtlas; + + +/***/ }), +/* 906 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(907); +} + +if (true) +{ + renderCanvas = __webpack_require__(908); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 907 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.BitmapText#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.BitmapText} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var text = src._text; + var textLength = text.length; + + if (textLength === 0) + { + return; + } + + var pipeline = this.pipeline; + + renderer.setPipeline(pipeline, src); + + var camMatrix = pipeline._tempMatrix1; + var spriteMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + var frame = src.frame; + var texture = frame.glTexture; + var textureX = frame.cutX; + var textureY = frame.cutY; + var textureWidth = texture.width; + var textureHeight = texture.height; + + var tintEffect = (src._isTinted && src.tintFill); + var tintTL = Utils.getTintAppendFloatAlpha(src._tintTL, camera.alpha * src._alphaTL); + var tintTR = Utils.getTintAppendFloatAlpha(src._tintTR, camera.alpha * src._alphaTR); + var tintBL = Utils.getTintAppendFloatAlpha(src._tintBL, camera.alpha * src._alphaBL); + var tintBR = Utils.getTintAppendFloatAlpha(src._tintBR, camera.alpha * src._alphaBR); + + pipeline.setTexture2D(texture, 0); + + var xAdvance = 0; + var yAdvance = 0; + var charCode = 0; + var lastCharCode = 0; + var letterSpacing = src._letterSpacing; + var glyph; + var glyphX = 0; + var glyphY = 0; + var glyphW = 0; + var glyphH = 0; + var lastGlyph; + + var fontData = src.fontData; + var chars = fontData.chars; + var lineHeight = fontData.lineHeight; + var scale = (src._fontSize / fontData.size); + + var align = src._align; + var currentLine = 0; + var lineOffsetX = 0; + + // Update the bounds - skipped internally if not dirty + src.getTextBounds(false); + + var lineData = src._bounds.lines; + + if (align === 1) + { + lineOffsetX = (lineData.longest - lineData.lengths[0]) / 2; + } + else if (align === 2) + { + lineOffsetX = (lineData.longest - lineData.lengths[0]); + } + + var roundPixels = camera.roundPixels; + + for (var i = 0; i < textLength; i++) + { + charCode = text.charCodeAt(i); + + // Carriage-return + if (charCode === 10) + { + currentLine++; + + if (align === 1) + { + lineOffsetX = (lineData.longest - lineData.lengths[currentLine]) / 2; + } + else if (align === 2) + { + lineOffsetX = (lineData.longest - lineData.lengths[currentLine]); + } + + xAdvance = 0; + yAdvance += lineHeight; + lastGlyph = null; + + continue; + } + + glyph = chars[charCode]; + + if (!glyph) + { + continue; + } + + glyphX = textureX + glyph.x; + glyphY = textureY + glyph.y; + + glyphW = glyph.width; + glyphH = glyph.height; + + var x = glyph.xOffset + xAdvance; + var y = glyph.yOffset + yAdvance; + + if (lastGlyph !== null) + { + var kerningOffset = glyph.kerning[lastCharCode]; + x += (kerningOffset !== undefined) ? kerningOffset : 0; + } + + xAdvance += glyph.xAdvance + letterSpacing; + lastGlyph = glyph; + lastCharCode = charCode; + + // Nothing to render or a space? Then skip to the next glyph + if (glyphW === 0 || glyphH === 0 || charCode === 32) + { + continue; + } + + x *= scale; + y *= scale; + + x -= src.displayOriginX; + y -= src.displayOriginY; + + x += lineOffsetX; + + var u0 = glyphX / textureWidth; + var v0 = glyphY / textureHeight; + var u1 = (glyphX + glyphW) / textureWidth; + var v1 = (glyphY + glyphH) / textureHeight; + + var xw = x + (glyphW * scale); + var yh = y + (glyphH * scale); + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + if (roundPixels) + { + tx0 = Math.round(tx0); + ty0 = Math.round(ty0); + + tx1 = Math.round(tx1); + ty1 = Math.round(ty1); + + tx2 = Math.round(tx2); + ty2 = Math.round(ty2); + + tx3 = Math.round(tx3); + ty3 = Math.round(ty3); + } + + pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0); + } +}; + +module.exports = BitmapTextWebGLRenderer; + + +/***/ }), +/* 908 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.BitmapText#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.BitmapText} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var BitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var text = src._text; + var textLength = text.length; + + var ctx = renderer.currentContext; + + if (textLength === 0 || !SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + return; + } + + var textureFrame = src.frame; + + var chars = src.fontData.chars; + var lineHeight = src.fontData.lineHeight; + var letterSpacing = src._letterSpacing; + + var xAdvance = 0; + var yAdvance = 0; + + var charCode = 0; + + var glyph = null; + var glyphX = 0; + var glyphY = 0; + var glyphW = 0; + var glyphH = 0; + + var x = 0; + var y = 0; + + var lastGlyph = null; + var lastCharCode = 0; + + var image = src.frame.source.image; + + var textureX = textureFrame.cutX; + var textureY = textureFrame.cutY; + + var scale = (src._fontSize / src.fontData.size); + + var align = src._align; + var currentLine = 0; + var lineOffsetX = 0; + + // Update the bounds - skipped internally if not dirty + src.getTextBounds(false); + + var lineData = src._bounds.lines; + + if (align === 1) + { + lineOffsetX = (lineData.longest - lineData.lengths[0]) / 2; + } + else if (align === 2) + { + lineOffsetX = (lineData.longest - lineData.lengths[0]); + } + + ctx.translate(-src.displayOriginX, -src.displayOriginY); + + var roundPixels = camera.roundPixels; + + for (var i = 0; i < textLength; i++) + { + charCode = text.charCodeAt(i); + + if (charCode === 10) + { + currentLine++; + + if (align === 1) + { + lineOffsetX = (lineData.longest - lineData.lengths[currentLine]) / 2; + } + else if (align === 2) + { + lineOffsetX = (lineData.longest - lineData.lengths[currentLine]); + } + + xAdvance = 0; + yAdvance += lineHeight; + lastGlyph = null; + + continue; + } + + glyph = chars[charCode]; + + if (!glyph) + { + continue; + } + + glyphX = textureX + glyph.x; + glyphY = textureY + glyph.y; + + glyphW = glyph.width; + glyphH = glyph.height; + + x = glyph.xOffset + xAdvance; + y = glyph.yOffset + yAdvance; + + if (lastGlyph !== null) + { + var kerningOffset = glyph.kerning[lastCharCode]; + x += (kerningOffset !== undefined) ? kerningOffset : 0; + } + + x *= scale; + y *= scale; + + x += lineOffsetX; + + xAdvance += glyph.xAdvance + letterSpacing; + lastGlyph = glyph; + lastCharCode = charCode; + + // Nothing to render or a space? Then skip to the next glyph + if (glyphW === 0 || glyphH === 0 || charCode === 32) + { + continue; + } + + if (roundPixels) + { + x = Math.round(x); + y = Math.round(y); + } + + ctx.save(); + + ctx.translate(x, y); + + ctx.scale(scale, scale); + + ctx.drawImage(image, glyphX, glyphY, glyphW, glyphH, 0, 0, glyphW, glyphH); + + ctx.restore(); + } + + ctx.restore(); +}; + +module.exports = BitmapTextCanvasRenderer; + + +/***/ }), +/* 909 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(910); +} + +if (true) +{ + renderCanvas = __webpack_require__(911); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 910 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Blitter#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Blitter} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var list = src.getRenderList(); + + if (list.length === 0) + { + return; + } + + var pipeline = this.pipeline; + + renderer.setPipeline(pipeline, src); + + var cameraScrollX = camera.scrollX * src.scrollFactorX; + var cameraScrollY = camera.scrollY * src.scrollFactorY; + + var calcMatrix = pipeline._tempMatrix1; + + calcMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + calcMatrix.multiplyWithOffset(parentMatrix, -cameraScrollX, -cameraScrollY); + + cameraScrollX = 0; + cameraScrollY = 0; + } + + var blitterX = src.x - cameraScrollX; + var blitterY = src.y - cameraScrollY; + var prevTextureSourceIndex = -1; + var tintEffect = false; + var alpha = camera.alpha * src.alpha; + var roundPixels = camera.roundPixels; + + for (var index = 0; index < list.length; index++) + { + var bob = list[index]; + var frame = bob.frame; + var bobAlpha = bob.alpha * alpha; + + if (bobAlpha === 0) + { + continue; + } + + var width = frame.width; + var height = frame.height; + + var x = blitterX + bob.x + frame.x; + var y = blitterY + bob.y + frame.y; + + if (bob.flipX) + { + width *= -1; + x += frame.width; + } + + if (bob.flipY) + { + height *= -1; + y += frame.height; + } + + var xw = x + width; + var yh = y + height; + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(xw, yh); + var ty1 = calcMatrix.getY(xw, yh); + + var tint = Utils.getTintAppendFloatAlpha(0xffffff, bobAlpha); + + // Bind texture only if the Texture Source is different from before + if (frame.sourceIndex !== prevTextureSourceIndex) + { + pipeline.setTexture2D(frame.glTexture, 0); + + prevTextureSourceIndex = frame.sourceIndex; + } + + if (roundPixels) + { + tx0 = Math.round(tx0); + ty0 = Math.round(ty0); + + tx1 = Math.round(tx1); + ty1 = Math.round(ty1); + } + + // TL x/y, BL x/y, BR x/y, TR x/y + if (pipeline.batchQuad(tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, 0)) + { + prevTextureSourceIndex = -1; + } + } +}; + +module.exports = BlitterWebGLRenderer; + + +/***/ }), +/* 911 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Blitter#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Blitter} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var list = src.getRenderList(); + + if (list.length === 0) + { + return; + } + + var ctx = renderer.currentContext; + + var alpha = camera.alpha * src.alpha; + + if (alpha === 0) + { + // Nothing to see, so abort early + return; + } + + // Blend Mode + ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; + + var cameraScrollX = src.x - camera.scrollX * src.scrollFactorX; + var cameraScrollY = src.y - camera.scrollY * src.scrollFactorY; + + ctx.save(); + + if (parentMatrix) + { + parentMatrix.copyToContext(ctx); + } + + var roundPixels = camera.roundPixels; + + // Render bobs + for (var i = 0; i < list.length; i++) + { + var bob = list[i]; + var flip = (bob.flipX || bob.flipY); + var frame = bob.frame; + var cd = frame.canvasData; + var dx = frame.x; + var dy = frame.y; + var fx = 1; + var fy = 1; + + var bobAlpha = bob.alpha * alpha; + + if (bobAlpha === 0) + { + continue; + } + + ctx.globalAlpha = bobAlpha; + + if (!flip) + { + if (roundPixels) + { + dx = Math.round(dx); + dy = Math.round(dy); + } + + ctx.drawImage( + frame.source.image, + cd.x, + cd.y, + cd.width, + cd.height, + dx + bob.x + cameraScrollX, + dy + bob.y + cameraScrollY, + cd.width, + cd.height + ); + } + else + { + if (bob.flipX) + { + fx = -1; + dx -= cd.width; + } + + if (bob.flipY) + { + fy = -1; + dy -= cd.height; + } + + ctx.save(); + ctx.translate(bob.x + cameraScrollX, bob.y + cameraScrollY); + ctx.scale(fx, fy); + ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, dx, dy, cd.width, cd.height); + ctx.restore(); + } + } + + ctx.restore(); +}; + +module.exports = BlitterCanvasRenderer; + + +/***/ }), +/* 912 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Frame = __webpack_require__(91); + +/** + * @classdesc + * A Bob Game Object. + * + * A Bob belongs to a Blitter Game Object. The Blitter is responsible for managing and rendering this object. + * + * A Bob has a position, alpha value and a frame from a texture that it uses to render with. You can also toggle + * the flipped and visible state of the Bob. The Frame the Bob uses to render can be changed dynamically, but it + * must be a Frame within the Texture used by the parent Blitter. + * + * Bob positions are relative to the Blitter parent. So if you move the Blitter parent, all Bob children will + * have their positions impacted by this change as well. + * + * You can manipulate Bob objects directly from your game code, but the creation and destruction of them should be + * handled via the Blitter parent. + * + * @class Bob + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Blitter} blitter - The parent Blitter object is responsible for updating this Bob. + * @param {number} x - The horizontal position of this Game Object in the world, relative to the parent Blitter position. + * @param {number} y - The vertical position of this Game Object in the world, relative to the parent Blitter position. + * @param {(string|integer)} frame - The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. + * @param {boolean} visible - Should the Bob render visible or not to start with? + */ +var Bob = new Class({ + + initialize: + + function Bob (blitter, x, y, frame, visible) + { + /** + * The Blitter object that this Bob belongs to. + * + * @name Phaser.GameObjects.Bob#parent + * @type {Phaser.GameObjects.Blitter} + * @since 3.0.0 + */ + this.parent = blitter; + + /** + * The x position of this Bob, relative to the x position of the Blitter. + * + * @name Phaser.GameObjects.Bob#x + * @type {number} + * @since 3.0.0 + */ + this.x = x; + + /** + * The y position of this Bob, relative to the y position of the Blitter. + * + * @name Phaser.GameObjects.Bob#y + * @type {number} + * @since 3.0.0 + */ + this.y = y; + + /** + * The frame that the Bob uses to render with. + * To change the frame use the `Bob.setFrame` method. + * + * @name Phaser.GameObjects.Bob#frame + * @type {Phaser.Textures.Frame} + * @protected + * @since 3.0.0 + */ + this.frame = frame; + + /** + * A blank object which can be used to store data related to this Bob in. + * + * @name Phaser.GameObjects.Bob#data + * @type {object} + * @default {} + * @since 3.0.0 + */ + this.data = {}; + + /** + * The visible state of this Bob. + * + * @name Phaser.GameObjects.Bob#_visible + * @type {boolean} + * @private + * @since 3.0.0 + */ + this._visible = visible; + + /** + * The alpha value of this Bob. + * + * @name Phaser.GameObjects.Bob#_alpha + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + this._alpha = 1; + + /** + * The horizontally flipped state of the Bob. + * A Bob that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture. + * + * @name Phaser.GameObjects.Bob#flipX + * @type {boolean} + * @since 3.0.0 + */ + this.flipX = false; + + /** + * The vertically flipped state of the Bob. + * A Bob that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture. + * + * @name Phaser.GameObjects.Bob#flipY + * @type {boolean} + * @since 3.0.0 + */ + this.flipY = false; + }, + + /** + * Changes the Texture Frame being used by this Bob. + * The frame must be part of the Texture the parent Blitter is using. + * If no value is given it will use the default frame of the Blitter parent. + * + * @method Phaser.GameObjects.Bob#setFrame + * @since 3.0.0 + * + * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The frame to be used during rendering. + * + * @return {Phaser.GameObjects.Bob} This Bob Game Object. + */ + setFrame: function (frame) + { + if (frame === undefined) + { + this.frame = this.parent.frame; + } + else if (frame instanceof Frame && frame.texture === this.parent.texture) + { + this.frame = frame; + } + else + { + this.frame = this.parent.texture.get(frame); + } + + return this; + }, + + /** + * Resets the horizontal and vertical flipped state of this Bob back to their default un-flipped state. + * + * @method Phaser.GameObjects.Bob#resetFlip + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Bob} This Bob Game Object. + */ + resetFlip: function () + { + this.flipX = false; + this.flipY = false; + + return this; + }, + + /** + * Resets this Bob. + * + * Changes the position to the values given, and optionally changes the frame. + * + * Also resets the flipX and flipY values, sets alpha back to 1 and visible to true. + * + * @method Phaser.GameObjects.Bob#reset + * @since 3.0.0 + * + * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. + * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * + * @return {Phaser.GameObjects.Bob} This Bob Game Object. + */ + reset: function (x, y, frame) + { + this.x = x; + this.y = y; + + this.flipX = false; + this.flipY = false; + + this._alpha = 1; + this._visible = true; + + this.parent.dirty = true; + + if (frame) + { + this.setFrame(frame); + } + + return this; + }, + + /** + * Sets the horizontal flipped state of this Bob. + * + * @method Phaser.GameObjects.Bob#setFlipX + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {Phaser.GameObjects.Bob} This Bob Game Object. + */ + setFlipX: function (value) + { + this.flipX = value; + + return this; + }, + + /** + * Sets the vertical flipped state of this Bob. + * + * @method Phaser.GameObjects.Bob#setFlipY + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {Phaser.GameObjects.Bob} This Bob Game Object. + */ + setFlipY: function (value) + { + this.flipY = value; + + return this; + }, + + /** + * Sets the horizontal and vertical flipped state of this Bob. + * + * @method Phaser.GameObjects.Bob#setFlip + * @since 3.0.0 + * + * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {Phaser.GameObjects.Bob} This Bob Game Object. + */ + setFlip: function (x, y) + { + this.flipX = x; + this.flipY = y; + + return this; + }, + + /** + * Sets the visibility of this Bob. + * + * An invisible Bob will skip rendering. + * + * @method Phaser.GameObjects.Bob#setVisible + * @since 3.0.0 + * + * @param {boolean} value - The visible state of the Game Object. + * + * @return {Phaser.GameObjects.Bob} This Bob Game Object. + */ + setVisible: function (value) + { + this.visible = value; + + return this; + }, + + /** + * Set the Alpha level of this Bob. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * A Bob with alpha 0 will skip rendering. + * + * @method Phaser.GameObjects.Bob#setAlpha + * @since 3.0.0 + * + * @param {number} value - The alpha value used for this Bob. Between 0 and 1. + * + * @return {Phaser.GameObjects.Bob} This Bob Game Object. + */ + setAlpha: function (value) + { + this.alpha = value; + + return this; + }, + + /** + * Destroys this Bob instance. + * Removes itself from the Blitter and clears the parent, frame and data properties. + * + * @method Phaser.GameObjects.Bob#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.parent.dirty = true; + + this.parent.children.remove(this); + + this.parent = undefined; + this.frame = undefined; + this.data = undefined; + }, + + /** + * The visible state of the Bob. + * + * An invisible Bob will skip rendering. + * + * @name Phaser.GameObjects.Bob#visible + * @type {boolean} + * @since 3.0.0 + */ + visible: { + + get: function () + { + return this._visible; + }, + + set: function (value) + { + this._visible = value; + this.parent.dirty = true; + } + + }, + + /** + * The alpha value of the Bob, between 0 and 1. + * + * A Bob with alpha 0 will skip rendering. + * + * @name Phaser.GameObjects.Bob#alpha + * @type {number} + * @since 3.0.0 + */ + alpha: { + + get: function () + { + return this._alpha; + }, + + set: function (value) + { + this._alpha = value; + this.parent.dirty = true; + } + + } + +}); + +module.exports = Bob; + + +/***/ }), +/* 913 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(914); +} + +if (true) +{ + renderCanvas = __webpack_require__(915); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 914 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Container#renderWebGL + * @since 3.4.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var ContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +{ + var children = container.list; + + if (children.length === 0) + { + return; + } + + var transformMatrix = container.localTransform; + + if (parentMatrix) + { + transformMatrix.loadIdentity(); + transformMatrix.multiply(parentMatrix); + transformMatrix.translate(container.x, container.y); + transformMatrix.rotate(container.rotation); + transformMatrix.scale(container.scaleX, container.scaleY); + } + else + { + transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); + } + + var containerHasBlendMode = (container.blendMode !== -1); + + if (!containerHasBlendMode) + { + // If Container is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = container._alpha; + var scrollFactorX = container.scrollFactorX; + var scrollFactorY = container.scrollFactorY; + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlpha = child._alpha; + var childScrollFactorX = child.scrollFactorX; + var childScrollFactorY = child.scrollFactorY; + + if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Container doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + if (child.mask) + { + child.mask.preRenderWebGL(renderer, child, camera); + } + + // Set parent values + child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); + child.setAlpha(childAlpha * alpha); + + // Render + child.renderWebGL(renderer, child, interpolationPercentage, camera, transformMatrix); + + // Restore original values + child.setAlpha(childAlpha); + child.setScrollFactor(childScrollFactorX, childScrollFactorY); + + if (child.mask) + { + child.mask.postRenderWebGL(renderer, camera); + } + } +}; + +module.exports = ContainerWebGLRenderer; + + +/***/ }), +/* 915 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Container#renderCanvas + * @since 3.4.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var ContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +{ + var children = container.list; + + if (children.length === 0) + { + return; + } + + var transformMatrix = container.localTransform; + + if (parentMatrix) + { + transformMatrix.loadIdentity(); + transformMatrix.multiply(parentMatrix); + transformMatrix.translate(container.x, container.y); + transformMatrix.rotate(container.rotation); + transformMatrix.scale(container.scaleX, container.scaleY); + } + else + { + transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); + } + + var containerHasBlendMode = (container.blendMode !== -1); + + if (!containerHasBlendMode) + { + // If Container is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = container._alpha; + var scrollFactorX = container.scrollFactorX; + var scrollFactorY = container.scrollFactorY; + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlpha = child._alpha; + var childBlendMode = child._blendMode; + var childScrollFactorX = child.scrollFactorX; + var childScrollFactorY = child.scrollFactorY; + + // Set parent values + child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); + child.setAlpha(childAlpha * alpha); + + if (containerHasBlendMode) + { + child.setBlendMode(container._blendMode); + } + + // Render + child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix); + + // Restore original values + child.setAlpha(childAlpha); + child.setScrollFactor(childScrollFactorX, childScrollFactorY); + child.setBlendMode(childBlendMode); + } +}; + +module.exports = ContainerCanvasRenderer; + + +/***/ }), +/* 916 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(366); +} + +if (true) +{ + renderCanvas = __webpack_require__(366); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 917 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Blend Modes to CSS Blend Modes Map. + * + * @name Phaser.CSSBlendModes + * @enum {string} + * @memberof Phaser + * @readonly + * @since 3.12.0 + */ + +module.exports = [ + 'normal', + 'multiply', + 'multiply', + 'screen', + 'overlay', + 'darken', + 'lighten', + 'color-dodge', + 'color-burn', + 'hard-light', + 'soft-light', + 'difference', + 'exclusion', + 'hue', + 'saturation', + 'color', + 'luminosity' +]; + + +/***/ }), +/* 918 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(919); +} + +if (true) +{ + renderCanvas = __webpack_require__(920); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 919 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.DynamicBitmapText#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.DynamicBitmapText} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var text = src.text; + var textLength = text.length; + + if (textLength === 0) + { + return; + } + + var pipeline = this.pipeline; + + renderer.setPipeline(pipeline, src); + + var crop = (src.cropWidth > 0 || src.cropHeight > 0); + + if (crop) + { + pipeline.flush(); + + renderer.pushScissor( + src.x, + src.y, + src.cropWidth * src.scaleX, + src.cropHeight * src.scaleY + ); + } + + var camMatrix = pipeline._tempMatrix1; + var spriteMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + var fontMatrix = pipeline._tempMatrix4; + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + var frame = src.frame; + var texture = frame.glTexture; + var textureX = frame.cutX; + var textureY = frame.cutY; + var textureWidth = texture.width; + var textureHeight = texture.height; + + var tintEffect = (src._isTinted && src.tintFill); + var tintTL = Utils.getTintAppendFloatAlpha(src._tintTL, camera.alpha * src._alphaTL); + var tintTR = Utils.getTintAppendFloatAlpha(src._tintTR, camera.alpha * src._alphaTR); + var tintBL = Utils.getTintAppendFloatAlpha(src._tintBL, camera.alpha * src._alphaBL); + var tintBR = Utils.getTintAppendFloatAlpha(src._tintBR, camera.alpha * src._alphaBR); + + pipeline.setTexture2D(texture, 0); + + var xAdvance = 0; + var yAdvance = 0; + var charCode = 0; + var lastCharCode = 0; + var letterSpacing = src.letterSpacing; + var glyph; + var glyphX = 0; + var glyphY = 0; + var glyphW = 0; + var glyphH = 0; + var lastGlyph; + var scrollX = src.scrollX; + var scrollY = src.scrollY; + + var fontData = src.fontData; + var chars = fontData.chars; + var lineHeight = fontData.lineHeight; + var scale = (src.fontSize / fontData.size); + var rotation = 0; + + var align = src._align; + var currentLine = 0; + var lineOffsetX = 0; + + // Update the bounds - skipped internally if not dirty + src.getTextBounds(false); + + var lineData = src._bounds.lines; + + if (align === 1) + { + lineOffsetX = (lineData.longest - lineData.lengths[0]) / 2; + } + else if (align === 2) + { + lineOffsetX = (lineData.longest - lineData.lengths[0]); + } + + var roundPixels = camera.roundPixels; + var displayCallback = src.displayCallback; + var callbackData = src.callbackData; + + for (var i = 0; i < textLength; i++) + { + charCode = text.charCodeAt(i); + + // Carriage-return + if (charCode === 10) + { + currentLine++; + + if (align === 1) + { + lineOffsetX = (lineData.longest - lineData.lengths[currentLine]) / 2; + } + else if (align === 2) + { + lineOffsetX = (lineData.longest - lineData.lengths[currentLine]); + } + + xAdvance = 0; + yAdvance += lineHeight; + lastGlyph = null; + + continue; + } + + glyph = chars[charCode]; + + if (!glyph) + { + continue; + } + + glyphX = textureX + glyph.x; + glyphY = textureY + glyph.y; + + glyphW = glyph.width; + glyphH = glyph.height; + + var x = (glyph.xOffset + xAdvance) - scrollX; + var y = (glyph.yOffset + yAdvance) - scrollY; + + if (lastGlyph !== null) + { + var kerningOffset = glyph.kerning[lastCharCode]; + x += (kerningOffset !== undefined) ? kerningOffset : 0; + } + + xAdvance += glyph.xAdvance + letterSpacing; + lastGlyph = glyph; + lastCharCode = charCode; + + // Nothing to render or a space? Then skip to the next glyph + if (glyphW === 0 || glyphH === 0 || charCode === 32) + { + continue; + } + + scale = (src.fontSize / src.fontData.size); + rotation = 0; + + if (displayCallback) + { + callbackData.color = 0; + callbackData.tint.topLeft = tintTL; + callbackData.tint.topRight = tintTR; + callbackData.tint.bottomLeft = tintBL; + callbackData.tint.bottomRight = tintBR; + callbackData.index = i; + callbackData.charCode = charCode; + callbackData.x = x; + callbackData.y = y; + callbackData.scale = scale; + callbackData.rotation = rotation; + callbackData.data = glyph.data; + + var output = displayCallback(callbackData); + + x = output.x; + y = output.y; + scale = output.scale; + rotation = output.rotation; + + if (output.color) + { + tintTL = output.color; + tintTR = output.color; + tintBL = output.color; + tintBR = output.color; + } + else + { + tintTL = output.tint.topLeft; + tintTR = output.tint.topRight; + tintBL = output.tint.bottomLeft; + tintBR = output.tint.bottomRight; + } + + tintTL = Utils.getTintAppendFloatAlpha(tintTL, camera.alpha * src._alphaTL); + tintTR = Utils.getTintAppendFloatAlpha(tintTR, camera.alpha * src._alphaTR); + tintBL = Utils.getTintAppendFloatAlpha(tintBL, camera.alpha * src._alphaBL); + tintBR = Utils.getTintAppendFloatAlpha(tintBR, camera.alpha * src._alphaBR); + } + + x *= scale; + y *= scale; + + x -= src.displayOriginX; + y -= src.displayOriginY; + + x += lineOffsetX; + + fontMatrix.applyITRS(x, y, rotation, scale, scale); + + calcMatrix.multiply(fontMatrix, spriteMatrix); + + var u0 = glyphX / textureWidth; + var v0 = glyphY / textureHeight; + var u1 = (glyphX + glyphW) / textureWidth; + var v1 = (glyphY + glyphH) / textureHeight; + + var xw = glyphW; + var yh = glyphH; + + var tx0 = spriteMatrix.e; + var ty0 = spriteMatrix.f; + + var tx1 = yh * spriteMatrix.c + spriteMatrix.e; + var ty1 = yh * spriteMatrix.d + spriteMatrix.f; + + var tx2 = xw * spriteMatrix.a + yh * spriteMatrix.c + spriteMatrix.e; + var ty2 = xw * spriteMatrix.b + yh * spriteMatrix.d + spriteMatrix.f; + + var tx3 = xw * spriteMatrix.a + spriteMatrix.e; + var ty3 = xw * spriteMatrix.b + spriteMatrix.f; + + if (roundPixels) + { + tx0 = Math.round(tx0); + ty0 = Math.round(ty0); + + tx1 = Math.round(tx1); + ty1 = Math.round(ty1); + + tx2 = Math.round(tx2); + ty2 = Math.round(ty2); + + tx3 = Math.round(tx3); + ty3 = Math.round(ty3); + } + + pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, 0); + } + + if (crop) + { + pipeline.flush(); + + renderer.popScissor(); + } +}; + +module.exports = DynamicBitmapTextWebGLRenderer; + + +/***/ }), +/* 920 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.DynamicBitmapText#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.DynamicBitmapText} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var DynamicBitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var text = src.text; + var textLength = text.length; + + var ctx = renderer.currentContext; + + if (textLength === 0 || !SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + return; + } + + var textureFrame = src.frame; + + var displayCallback = src.displayCallback; + var callbackData = src.callbackData; + + var cameraScrollX = camera.scrollX * src.scrollFactorX; + var cameraScrollY = camera.scrollY * src.scrollFactorY; + + var chars = src.fontData.chars; + var lineHeight = src.fontData.lineHeight; + + var xAdvance = 0; + var yAdvance = 0; + + var indexCount = 0; + var charCode = 0; + + var glyph = null; + var glyphX = 0; + var glyphY = 0; + var glyphW = 0; + var glyphH = 0; + + var x = 0; + var y = 0; + + var lastGlyph = null; + var lastCharCode = 0; + + var image = src.frame.source.image; + + var textureX = textureFrame.cutX; + var textureY = textureFrame.cutY; + + var rotation = 0; + var scale = (src.fontSize / src.fontData.size); + + if (src.cropWidth > 0 && src.cropHeight > 0) + { + ctx.beginPath(); + ctx.rect(0, 0, src.cropWidth, src.cropHeight); + ctx.clip(); + } + + for (var index = 0; index < textLength; ++index) + { + // Reset the scale (in case the callback changed it) + scale = (src.fontSize / src.fontData.size); + rotation = 0; + + charCode = text.charCodeAt(index); + + if (charCode === 10) + { + xAdvance = 0; + indexCount = 0; + yAdvance += lineHeight; + lastGlyph = null; + continue; + } + + glyph = chars[charCode]; + + if (!glyph) + { + continue; + } + + glyphX = textureX + glyph.x; + glyphY = textureY + glyph.y; + + glyphW = glyph.width; + glyphH = glyph.height; + + x = (indexCount + glyph.xOffset + xAdvance) - src.scrollX; + y = (glyph.yOffset + yAdvance) - src.scrollY; + + // This could be optimized so that it doesn't even bother drawing it if the x/y is out of range + + if (lastGlyph !== null) + { + var kerningOffset = glyph.kerning[lastCharCode]; + x += (kerningOffset !== undefined) ? kerningOffset : 0; + } + + if (displayCallback) + { + callbackData.index = index; + callbackData.charCode = charCode; + callbackData.x = x; + callbackData.y = y; + callbackData.scale = scale; + callbackData.rotation = rotation; + callbackData.data = glyph.data; + + var output = displayCallback(callbackData); + + x = output.x; + y = output.y; + scale = output.scale; + rotation = output.rotation; + } + + x *= scale; + y *= scale; + + x -= cameraScrollX; + y -= cameraScrollY; + + if (camera.roundPixels) + { + x = Math.round(x); + y = Math.round(y); + } + + ctx.save(); + + ctx.translate(x, y); + + ctx.rotate(rotation); + + ctx.scale(scale, scale); + + ctx.drawImage(image, glyphX, glyphY, glyphW, glyphH, 0, 0, glyphW, glyphH); + + ctx.restore(); + + xAdvance += glyph.xAdvance; + indexCount += 1; + lastGlyph = glyph; + lastCharCode = charCode; + } + + // Restore the context saved in SetTransform + ctx.restore(); +}; + +module.exports = DynamicBitmapTextCanvasRenderer; + + +/***/ }), +/* 921 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(922); +} + +if (true) +{ + renderCanvas = __webpack_require__(923); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 922 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Extern#renderWebGL + * @since 3.16.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Extern} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var ExternWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = renderer.currentPipeline; + + renderer.clearPipeline(); + + var camMatrix = renderer._tempMatrix1; + var spriteMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + // Callback + src.render.call(src, renderer, camera, calcMatrix); + + renderer.rebindPipeline(pipeline); +}; + +module.exports = ExternWebGLRenderer; + + +/***/ }), +/* 923 */ +/***/ (function(module, exports) { + + + +/***/ }), +/* 924 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(925); + + // Needed for Graphics.generateTexture + renderCanvas = __webpack_require__(371); +} + +if (true) +{ + renderCanvas = __webpack_require__(371); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 925 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Commands = __webpack_require__(186); +var Utils = __webpack_require__(9); + +// TODO: Remove the use of this +var Point = function (x, y, width) +{ + this.x = x; + this.y = y; + this.width = width; +}; + +// TODO: Remove the use of this +var Path = function (x, y, width) +{ + this.points = []; + this.pointsLength = 1; + this.points[0] = new Point(x, y, width); +}; + +var matrixStack = []; + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Graphics#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Graphics} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + if (src.commandBuffer.length === 0) + { + return; + } + + var pipeline = this.pipeline; + + renderer.setPipeline(pipeline, src); + + var camMatrix = src._tempMatrix1; + var graphicsMatrix = src._tempMatrix2; + var currentMatrix = src._tempMatrix3; + + currentMatrix.loadIdentity(); + + graphicsMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + graphicsMatrix.e = src.x; + graphicsMatrix.f = src.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(graphicsMatrix); + } + else + { + graphicsMatrix.e -= camera.scrollX * src.scrollFactorX; + graphicsMatrix.f -= camera.scrollY * src.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(graphicsMatrix); + } + + var commands = src.commandBuffer; + var alpha = camera.alpha * src.alpha; + + var lineWidth = 1; + var fillTint = pipeline.fillTint; + var strokeTint = pipeline.strokeTint; + + var tx = 0; + var ty = 0; + var ta = 0; + var iterStep = 0.01; + var PI2 = Math.PI * 2; + + var cmd; + + var path = []; + var pathIndex = 0; + var pathOpen = false; + var lastPath = null; + + var getTint = Utils.getTintAppendFloatAlphaAndSwap; + + var currentTexture = renderer.blankTexture.glTexture; + + for (var cmdIndex = 0; cmdIndex < commands.length; cmdIndex++) + { + cmd = commands[cmdIndex]; + + switch (cmd) + { + case Commands.BEGIN_PATH: + + path.length = 0; + lastPath = null; + pathOpen = true; + break; + + case Commands.CLOSE_PATH: + + pathOpen = false; + + if (lastPath && lastPath.points.length) + { + lastPath.points.push(lastPath.points[0]); + } + break; + + case Commands.FILL_PATH: + for (pathIndex = 0; pathIndex < path.length; pathIndex++) + { + pipeline.setTexture2D(currentTexture); + + pipeline.batchFillPath( + path[pathIndex].points, + currentMatrix, + camMatrix + ); + } + break; + + case Commands.STROKE_PATH: + for (pathIndex = 0; pathIndex < path.length; pathIndex++) + { + pipeline.setTexture2D(currentTexture); + + pipeline.batchStrokePath( + path[pathIndex].points, + lineWidth, + pathOpen, + currentMatrix, + camMatrix + ); + } + break; + + case Commands.LINE_STYLE: + lineWidth = commands[++cmdIndex]; + var strokeColor = commands[++cmdIndex]; + var strokeAlpha = commands[++cmdIndex] * alpha; + var strokeTintColor = getTint(strokeColor, strokeAlpha); + strokeTint.TL = strokeTintColor; + strokeTint.TR = strokeTintColor; + strokeTint.BL = strokeTintColor; + strokeTint.BR = strokeTintColor; + break; + + case Commands.FILL_STYLE: + var fillColor = commands[++cmdIndex]; + var fillAlpha = commands[++cmdIndex] * alpha; + var fillTintColor = getTint(fillColor, fillAlpha); + fillTint.TL = fillTintColor; + fillTint.TR = fillTintColor; + fillTint.BL = fillTintColor; + fillTint.BR = fillTintColor; + break; + + case Commands.GRADIENT_FILL_STYLE: + var gradientFillAlpha = commands[++cmdIndex] * alpha; + fillTint.TL = getTint(commands[++cmdIndex], gradientFillAlpha); + fillTint.TR = getTint(commands[++cmdIndex], gradientFillAlpha); + fillTint.BL = getTint(commands[++cmdIndex], gradientFillAlpha); + fillTint.BR = getTint(commands[++cmdIndex], gradientFillAlpha); + break; + + case Commands.GRADIENT_LINE_STYLE: + lineWidth = commands[++cmdIndex]; + var gradientLineAlpha = commands[++cmdIndex] * alpha; + strokeTint.TL = getTint(commands[++cmdIndex], gradientLineAlpha); + strokeTint.TR = getTint(commands[++cmdIndex], gradientLineAlpha); + strokeTint.BL = getTint(commands[++cmdIndex], gradientLineAlpha); + strokeTint.BR = getTint(commands[++cmdIndex], gradientLineAlpha); + break; + + case Commands.ARC: + var iteration = 0; + var x = commands[++cmdIndex]; + var y = commands[++cmdIndex]; + var radius = commands[++cmdIndex]; + var startAngle = commands[++cmdIndex]; + var endAngle = commands[++cmdIndex]; + var anticlockwise = commands[++cmdIndex]; + var overshoot = commands[++cmdIndex]; + + endAngle -= startAngle; + + if (anticlockwise) + { + if (endAngle < -PI2) + { + endAngle = -PI2; + } + else if (endAngle > 0) + { + endAngle = -PI2 + endAngle % PI2; + } + } + else if (endAngle > PI2) + { + endAngle = PI2; + } + else if (endAngle < 0) + { + endAngle = PI2 + endAngle % PI2; + } + + if (lastPath === null) + { + lastPath = new Path(x + Math.cos(startAngle) * radius, y + Math.sin(startAngle) * radius, lineWidth); + path.push(lastPath); + iteration += iterStep; + } + + while (iteration < 1 + overshoot) + { + ta = endAngle * iteration + startAngle; + tx = x + Math.cos(ta) * radius; + ty = y + Math.sin(ta) * radius; + + lastPath.points.push(new Point(tx, ty, lineWidth)); + + iteration += iterStep; + } + + ta = endAngle + startAngle; + tx = x + Math.cos(ta) * radius; + ty = y + Math.sin(ta) * radius; + + lastPath.points.push(new Point(tx, ty, lineWidth)); + + break; + + case Commands.FILL_RECT: + pipeline.setTexture2D(currentTexture); + pipeline.batchFillRect( + commands[++cmdIndex], + commands[++cmdIndex], + commands[++cmdIndex], + commands[++cmdIndex], + currentMatrix, + camMatrix + ); + break; + + case Commands.FILL_TRIANGLE: + pipeline.setTexture2D(currentTexture); + pipeline.batchFillTriangle( + commands[++cmdIndex], + commands[++cmdIndex], + commands[++cmdIndex], + commands[++cmdIndex], + commands[++cmdIndex], + commands[++cmdIndex], + currentMatrix, + camMatrix + ); + break; + + case Commands.STROKE_TRIANGLE: + pipeline.setTexture2D(currentTexture); + pipeline.batchStrokeTriangle( + commands[++cmdIndex], + commands[++cmdIndex], + commands[++cmdIndex], + commands[++cmdIndex], + commands[++cmdIndex], + commands[++cmdIndex], + lineWidth, + currentMatrix, + camMatrix + ); + break; + + case Commands.LINE_TO: + if (lastPath !== null) + { + lastPath.points.push(new Point(commands[++cmdIndex], commands[++cmdIndex], lineWidth)); + } + else + { + lastPath = new Path(commands[++cmdIndex], commands[++cmdIndex], lineWidth); + path.push(lastPath); + } + break; + + case Commands.MOVE_TO: + lastPath = new Path(commands[++cmdIndex], commands[++cmdIndex], lineWidth); + path.push(lastPath); + break; + + case Commands.SAVE: + matrixStack.push(currentMatrix.copyToArray()); + break; + + case Commands.RESTORE: + currentMatrix.copyFromArray(matrixStack.pop()); + break; + + case Commands.TRANSLATE: + x = commands[++cmdIndex]; + y = commands[++cmdIndex]; + currentMatrix.translate(x, y); + break; + + case Commands.SCALE: + x = commands[++cmdIndex]; + y = commands[++cmdIndex]; + currentMatrix.scale(x, y); + break; + + case Commands.ROTATE: + currentMatrix.rotate(commands[++cmdIndex]); + break; + + case Commands.SET_TEXTURE: + var frame = commands[++cmdIndex]; + var mode = commands[++cmdIndex]; + + pipeline.currentFrame = frame; + pipeline.setTexture2D(frame.glTexture, 0); + pipeline.tintEffect = mode; + + currentTexture = frame.glTexture; + + break; + + case Commands.CLEAR_TEXTURE: + pipeline.currentFrame = renderer.blankTexture; + pipeline.tintEffect = 2; + currentTexture = renderer.blankTexture.glTexture; + break; + } + } +}; + +module.exports = GraphicsWebGLRenderer; + + +/***/ }), +/* 926 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(927); +} + +if (true) +{ + renderCanvas = __webpack_require__(928); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 927 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Sprite#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Sprite} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var SpriteWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + this.pipeline.batchSprite(src, camera, parentMatrix); +}; + +module.exports = SpriteWebGLRenderer; + + +/***/ }), +/* 928 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Sprite#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Sprite} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var SpriteCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + renderer.batchSprite(src, src.frame, camera, parentMatrix); +}; + +module.exports = SpriteCanvasRenderer; + + +/***/ }), +/* 929 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(930); +} + +if (true) +{ + renderCanvas = __webpack_require__(931); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 930 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Image#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var ImageWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + this.pipeline.batchSprite(src, camera, parentMatrix); +}; + +module.exports = ImageWebGLRenderer; + + +/***/ }), +/* 931 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Image#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var ImageCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + renderer.batchSprite(src, src.frame, camera, parentMatrix); +}; + +module.exports = ImageCanvasRenderer; + + +/***/ }), +/* 932 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Particles + */ + +module.exports = { + + GravityWell: __webpack_require__(372), + Particle: __webpack_require__(373), + ParticleEmitter: __webpack_require__(374), + ParticleEmitterManager: __webpack_require__(188), + Zones: __webpack_require__(937) + +}; + + +/***/ }), +/* 933 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FloatBetween = __webpack_require__(304); +var GetEaseFunction = __webpack_require__(96); +var GetFastValue = __webpack_require__(2); +var Wrap = __webpack_require__(56); + +/** + * @classdesc + * A Particle Emitter property. + * + * Facilitates changing Particle properties as they are emitted and throughout their lifetime. + * + * @class EmitterOp + * @memberof Phaser.GameObjects.Particles + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} config - Settings for the Particle Emitter that owns this property. + * @param {string} key - The name of the property. + * @param {number} defaultValue - The default value of the property. + * @param {boolean} [emitOnly=false] - Whether the property can only be modified when a Particle is emitted. + */ +var EmitterOp = new Class({ + + initialize: + + function EmitterOp (config, key, defaultValue, emitOnly) + { + if (emitOnly === undefined) + { + emitOnly = false; + } + + /** + * The name of this property. + * + * @name Phaser.GameObjects.Particles.EmitterOp#propertyKey + * @type {string} + * @since 3.0.0 + */ + this.propertyKey = key; + + /** + * The value of this property. + * + * @name Phaser.GameObjects.Particles.EmitterOp#propertyValue + * @type {number} + * @since 3.0.0 + */ + this.propertyValue = defaultValue; + + /** + * The default value of this property. + * + * @name Phaser.GameObjects.Particles.EmitterOp#defaultValue + * @type {number} + * @since 3.0.0 + */ + this.defaultValue = defaultValue; + + /** + * The number of steps for stepped easing between {@link Phaser.GameObjects.Particles.EmitterOp#start} and + * {@link Phaser.GameObjects.Particles.EmitterOp#end} values, per emit. + * + * @name Phaser.GameObjects.Particles.EmitterOp#steps + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.steps = 0; + + /** + * The step counter for stepped easing, per emit. + * + * @name Phaser.GameObjects.Particles.EmitterOp#counter + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.counter = 0; + + /** + * The start value for this property to ease between. + * + * @name Phaser.GameObjects.Particles.EmitterOp#start + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.start = 0; + + /** + * The end value for this property to ease between. + * + * @name Phaser.GameObjects.Particles.EmitterOp#end + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.end = 0; + + /** + * The easing function to use for updating this property. + * + * @name Phaser.GameObjects.Particles.EmitterOp#ease + * @type {?function} + * @since 3.0.0 + */ + this.ease; + + /** + * Whether this property can only be modified when a Particle is emitted. + * + * Set to `true` to allow only {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} callbacks to be set and + * affect this property. + * + * Set to `false` to allow both {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} and + * {@link Phaser.GameObjects.Particles.EmitterOp#onUpdate} callbacks to be set and affect this property. + * + * @name Phaser.GameObjects.Particles.EmitterOp#emitOnly + * @type {boolean} + * @since 3.0.0 + */ + this.emitOnly = emitOnly; + + /** + * The callback to run for Particles when they are emitted from the Particle Emitter. + * + * @name Phaser.GameObjects.Particles.EmitterOp#onEmit + * @type {Phaser.Types.GameObjects.Particles.EmitterOpOnEmitCallback} + * @since 3.0.0 + */ + this.onEmit = this.defaultEmit; + + /** + * The callback to run for Particles when they are updated. + * + * @name Phaser.GameObjects.Particles.EmitterOp#onUpdate + * @type {Phaser.Types.GameObjects.Particles.EmitterOpOnUpdateCallback} + * @since 3.0.0 + */ + this.onUpdate = this.defaultUpdate; + + this.loadConfig(config); + }, + + /** + * Load the property from a Particle Emitter configuration object. + * + * Optionally accepts a new property key to use, replacing the current one. + * + * @method Phaser.GameObjects.Particles.EmitterOp#loadConfig + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig} [config] - Settings for the Particle Emitter that owns this property. + * @param {string} [newKey] - The new key to use for this property, if any. + */ + loadConfig: function (config, newKey) + { + if (config === undefined) + { + config = {}; + } + + if (newKey) + { + this.propertyKey = newKey; + } + + this.propertyValue = GetFastValue( + config, + this.propertyKey, + this.defaultValue + ); + + this.setMethods(); + + if (this.emitOnly) + { + // Reset it back again + this.onUpdate = this.defaultUpdate; + } + }, + + /** + * Build a JSON representation of this Particle Emitter property. + * + * @method Phaser.GameObjects.Particles.EmitterOp#toJSON + * @since 3.0.0 + * + * @return {object} A JSON representation of this Particle Emitter property. + */ + toJSON: function () + { + return this.propertyValue; + }, + + /** + * Change the current value of the property and update its callback methods. + * + * @method Phaser.GameObjects.Particles.EmitterOp#onChange + * @since 3.0.0 + * + * @param {number} value - The value of the property. + * + * @return {Phaser.GameObjects.Particles.EmitterOp} This Emitter Op object. + */ + onChange: function (value) + { + this.propertyValue = value; + + return this.setMethods(); + }, + + /** + * Update the {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} and + * {@link Phaser.GameObjects.Particles.EmitterOp#onUpdate} callbacks based on the type of the current + * {@link Phaser.GameObjects.Particles.EmitterOp#propertyValue}. + * + * @method Phaser.GameObjects.Particles.EmitterOp#setMethods + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Particles.EmitterOp} This Emitter Op object. + */ + setMethods: function () + { + var value = this.propertyValue; + + var t = typeof value; + + if (t === 'number') + { + // Explicit static value: + // x: 400 + + this.onEmit = this.staticValueEmit; + this.onUpdate = this.staticValueUpdate; // How? + } + else if (Array.isArray(value)) + { + // Picks a random element from the array: + // x: [ 100, 200, 300, 400 ] + + this.onEmit = this.randomStaticValueEmit; + } + else if (t === 'function') + { + // The same as setting just the onUpdate function and no onEmit (unless this op is an emitOnly one) + // Custom callback, must return a value: + + /* + x: function (particle, key, t, value) + { + return value + 50; + } + */ + + if (this.emitOnly) + { + this.onEmit = value; + } + else + { + this.onUpdate = value; + } + } + else if (t === 'object' && (this.has(value, 'random') || this.hasBoth(value, 'start', 'end') || this.hasBoth(value, 'min', 'max'))) + { + this.start = this.has(value, 'start') ? value.start : value.min; + this.end = this.has(value, 'end') ? value.end : value.max; + + var isRandom = (this.hasBoth(value, 'min', 'max') || !!value.random); + + // A random starting value (using 'min | max' instead of 'start | end' automatically implies a random value) + + // x: { start: 100, end: 400, random: true } OR { min: 100, max: 400 } OR { random: [ 100, 400 ] } + + if (isRandom) + { + var rnd = value.random; + + // x: { random: [ 100, 400 ] } = the same as doing: x: { start: 100, end: 400, random: true } + if (Array.isArray(rnd)) + { + this.start = rnd[0]; + this.end = rnd[1]; + } + + this.onEmit = this.randomRangedValueEmit; + } + + if (this.has(value, 'steps')) + { + // A stepped (per emit) range + + // x: { start: 100, end: 400, steps: 64 } + + // Increments a value stored in the emitter + + this.steps = value.steps; + this.counter = this.start; + + this.onEmit = this.steppedEmit; + } + else + { + // An eased range (defaults to Linear if not specified) + + // x: { start: 100, end: 400, [ ease: 'Linear' ] } + + var easeType = this.has(value, 'ease') ? value.ease : 'Linear'; + + this.ease = GetEaseFunction(easeType); + + if (!isRandom) + { + this.onEmit = this.easedValueEmit; + } + + // BUG: alpha, rotate, scaleX, scaleY, or tint are eased here if {min, max} is given. + // Probably this branch should exclude isRandom entirely. + + this.onUpdate = this.easeValueUpdate; + } + } + else if (t === 'object' && this.hasEither(value, 'onEmit', 'onUpdate')) + { + // Custom onEmit and onUpdate callbacks + + /* + x: { + // Called at the start of the particles life, when it is being created + onEmit: function (particle, key, t, value) + { + return value; + }, + + // Called during the particles life on each update + onUpdate: function (particle, key, t, value) + { + return value; + } + } + */ + + if (this.has(value, 'onEmit')) + { + this.onEmit = value.onEmit; + } + + if (this.has(value, 'onUpdate')) + { + this.onUpdate = value.onUpdate; + } + } + + return this; + }, + + /** + * Check whether an object has the given property. + * + * @method Phaser.GameObjects.Particles.EmitterOp#has + * @since 3.0.0 + * + * @param {object} object - The object to check. + * @param {string} key - The key of the property to look for in the object. + * + * @return {boolean} `true` if the property exists in the object, `false` otherwise. + */ + has: function (object, key) + { + return object.hasOwnProperty(key); + }, + + /** + * Check whether an object has both of the given properties. + * + * @method Phaser.GameObjects.Particles.EmitterOp#hasBoth + * @since 3.0.0 + * + * @param {object} object - The object to check. + * @param {string} key1 - The key of the first property to check the object for. + * @param {string} key2 - The key of the second property to check the object for. + * + * @return {boolean} `true` if both properties exist in the object, `false` otherwise. + */ + hasBoth: function (object, key1, key2) + { + return object.hasOwnProperty(key1) && object.hasOwnProperty(key2); + }, + + /** + * Check whether an object has at least one of the given properties. + * + * @method Phaser.GameObjects.Particles.EmitterOp#hasEither + * @since 3.0.0 + * + * @param {object} object - The object to check. + * @param {string} key1 - The key of the first property to check the object for. + * @param {string} key2 - The key of the second property to check the object for. + * + * @return {boolean} `true` if at least one of the properties exists in the object, `false` if neither exist. + */ + hasEither: function (object, key1, key2) + { + return object.hasOwnProperty(key1) || object.hasOwnProperty(key2); + }, + + /** + * The returned value sets what the property will be at the START of the particles life, on emit. + * + * @method Phaser.GameObjects.Particles.EmitterOp#defaultEmit + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.Particle} particle - The particle. + * @param {string} key - The name of the property. + * @param {number} [value] - The current value of the property. + * + * @return {number} The new value of the property. + */ + defaultEmit: function (particle, key, value) + { + return value; + }, + + /** + * The returned value updates the property for the duration of the particles life. + * + * @method Phaser.GameObjects.Particles.EmitterOp#defaultUpdate + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.Particle} particle - The particle. + * @param {string} key - The name of the property. + * @param {number} t - The T value (between 0 and 1) + * @param {number} value - The current value of the property. + * + * @return {number} The new value of the property. + */ + defaultUpdate: function (particle, key, t, value) + { + return value; + }, + + /** + * An `onEmit` callback that returns the current value of the property. + * + * @method Phaser.GameObjects.Particles.EmitterOp#staticValueEmit + * @since 3.0.0 + * + * @return {number} The current value of the property. + */ + staticValueEmit: function () + { + return this.propertyValue; + }, + + /** + * An `onUpdate` callback that returns the current value of the property. + * + * @method Phaser.GameObjects.Particles.EmitterOp#staticValueUpdate + * @since 3.0.0 + * + * @return {number} The current value of the property. + */ + staticValueUpdate: function () + { + return this.propertyValue; + }, + + /** + * An `onEmit` callback that returns a random value from the current value array. + * + * @method Phaser.GameObjects.Particles.EmitterOp#randomStaticValueEmit + * @since 3.0.0 + * + * @return {number} The new value of the property. + */ + randomStaticValueEmit: function () + { + var randomIndex = Math.floor(Math.random() * this.propertyValue.length); + + return this.propertyValue[randomIndex]; + }, + + /** + * An `onEmit` callback that returns a value between the {@link Phaser.GameObjects.Particles.EmitterOp#start} and + * {@link Phaser.GameObjects.Particles.EmitterOp#end} range. + * + * @method Phaser.GameObjects.Particles.EmitterOp#randomRangedValueEmit + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.Particle} particle - The particle. + * @param {string} key - The key of the property. + * + * @return {number} The new value of the property. + */ + randomRangedValueEmit: function (particle, key) + { + var value = FloatBetween(this.start, this.end); + + if (particle && particle.data[key]) + { + particle.data[key].min = value; + } + + return value; + }, + + /** + * An `onEmit` callback that returns a stepped value between the + * {@link Phaser.GameObjects.Particles.EmitterOp#start} and {@link Phaser.GameObjects.Particles.EmitterOp#end} + * range. + * + * @method Phaser.GameObjects.Particles.EmitterOp#steppedEmit + * @since 3.0.0 + * + * @return {number} The new value of the property. + */ + steppedEmit: function () + { + var current = this.counter; + + var next = this.counter + (this.end - this.start) / this.steps; + + this.counter = Wrap(next, this.start, this.end); + + return current; + }, + + /** + * An `onEmit` callback for an eased property. + * + * It prepares the particle for easing by {@link Phaser.GameObjects.Particles.EmitterOp#easeValueUpdate}. + * + * @method Phaser.GameObjects.Particles.EmitterOp#easedValueEmit + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.Particle} particle - The particle. + * @param {string} key - The name of the property. + * + * @return {number} {@link Phaser.GameObjects.Particles.EmitterOp#start}, as the new value of the property. + */ + easedValueEmit: function (particle, key) + { + if (particle && particle.data[key]) + { + var data = particle.data[key]; + + data.min = this.start; + data.max = this.end; + } + + return this.start; + }, + + /** + * An `onUpdate` callback that returns an eased value between the + * {@link Phaser.GameObjects.Particles.EmitterOp#start} and {@link Phaser.GameObjects.Particles.EmitterOp#end} + * range. + * + * @method Phaser.GameObjects.Particles.EmitterOp#easeValueUpdate + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Particles.Particle} particle - The particle. + * @param {string} key - The name of the property. + * @param {number} t - The T value (between 0 and 1) + * + * @return {number} The new value of the property. + */ + easeValueUpdate: function (particle, key, t) + { + var data = particle.data[key]; + + return (data.max - data.min) * this.ease(t) + data.min; + } +}); + +module.exports = EmitterOp; + + +/***/ }), +/* 934 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(935); +} + +if (true) +{ + renderCanvas = __webpack_require__(936); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 935 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Particles.EmitterManager#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Particles.ParticleEmitterManager} emitterManager - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpolationPercentage, camera, parentMatrix) +{ + var emitters = emitterManager.emitters.list; + var emittersLength = emitters.length; + + if (emittersLength === 0) + { + return; + } + + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1.copyFrom(camera.matrix); + var calcMatrix = pipeline._tempMatrix2; + var particleMatrix = pipeline._tempMatrix3; + var managerMatrix = pipeline._tempMatrix4.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY); + + camMatrix.multiply(managerMatrix); + + renderer.setPipeline(pipeline); + + var roundPixels = camera.roundPixels; + var texture = emitterManager.defaultFrame.glTexture; + var getTint = Utils.getTintAppendFloatAlphaAndSwap; + + pipeline.setTexture2D(texture, 0); + + for (var e = 0; e < emittersLength; e++) + { + var emitter = emitters[e]; + var particles = emitter.alive; + var particleCount = particles.length; + + if (!emitter.visible || particleCount === 0) + { + continue; + } + + var scrollX = camera.scrollX * emitter.scrollFactorX; + var scrollY = camera.scrollY * emitter.scrollFactorY; + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -scrollX, -scrollY); + + scrollX = 0; + scrollY = 0; + } + + if (renderer.setBlendMode(emitter.blendMode)) + { + // Rebind the texture if we've flushed + pipeline.setTexture2D(texture, 0); + } + + if (emitter.mask) + { + emitter.mask.preRenderWebGL(renderer, emitter, camera); + pipeline.setTexture2D(texture, 0); + } + + var tintEffect = 0; + + for (var i = 0; i < particleCount; i++) + { + var particle = particles[i]; + + var alpha = particle.alpha * camera.alpha; + + if (alpha <= 0) + { + continue; + } + + var frame = particle.frame; + + var x = -(frame.halfWidth); + var y = -(frame.halfHeight); + var xw = x + frame.width; + var yh = y + frame.height; + + particleMatrix.applyITRS(0, 0, particle.rotation, particle.scaleX, particle.scaleY); + + particleMatrix.e = particle.x - scrollX; + particleMatrix.f = particle.y - scrollY; + + camMatrix.multiply(particleMatrix, calcMatrix); + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + if (roundPixels) + { + tx0 = Math.round(tx0); + ty0 = Math.round(ty0); + + tx1 = Math.round(tx1); + ty1 = Math.round(ty1); + + tx2 = Math.round(tx2); + ty2 = Math.round(ty2); + + tx3 = Math.round(tx3); + ty3 = Math.round(ty3); + } + + var tint = getTint(particle.tint, alpha); + + pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, texture, 0); + } + + if (emitter.mask) + { + emitter.mask.postRenderWebGL(renderer, camera); + pipeline.setTexture2D(texture, 0); + } + } +}; + +module.exports = ParticleManagerWebGLRenderer; + + +/***/ }), +/* 936 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Particles.EmitterManager#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Particles.ParticleEmitterManager} emitterManager - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpolationPercentage, camera, parentMatrix) +{ + var emitters = emitterManager.emitters.list; + var emittersLength = emitters.length; + + if (emittersLength === 0) + { + return; + } + + var camMatrix = renderer._tempMatrix1.copyFrom(camera.matrix); + var calcMatrix = renderer._tempMatrix2; + var particleMatrix = renderer._tempMatrix3; + var managerMatrix = renderer._tempMatrix4.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY); + + camMatrix.multiply(managerMatrix); + + var roundPixels = camera.roundPixels; + + var ctx = renderer.currentContext; + + ctx.save(); + + for (var e = 0; e < emittersLength; e++) + { + var emitter = emitters[e]; + var particles = emitter.alive; + var particleCount = particles.length; + + if (!emitter.visible || particleCount === 0) + { + continue; + } + + var scrollX = camera.scrollX * emitter.scrollFactorX; + var scrollY = camera.scrollY * emitter.scrollFactorY; + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -scrollX, -scrollY); + + scrollX = 0; + scrollY = 0; + } + + ctx.globalCompositeOperation = renderer.blendModes[emitter.blendMode]; + + for (var i = 0; i < particleCount; i++) + { + var particle = particles[i]; + + var alpha = particle.alpha * camera.alpha; + + if (alpha <= 0) + { + continue; + } + + var frame = particle.frame; + var cd = frame.canvasData; + + var x = -(frame.halfWidth); + var y = -(frame.halfHeight); + + particleMatrix.applyITRS(0, 0, particle.rotation, particle.scaleX, particle.scaleY); + + particleMatrix.e = particle.x - scrollX; + particleMatrix.f = particle.y - scrollY; + + camMatrix.multiply(particleMatrix, calcMatrix); + + ctx.globalAlpha = alpha; + + ctx.save(); + + calcMatrix.copyToContext(ctx); + + if (roundPixels) + { + x = Math.round(x); + y = Math.round(y); + } + + ctx.drawImage(frame.source.image, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + + ctx.restore(); + } + } + + ctx.restore(); +}; + +module.exports = ParticleManagerCanvasRenderer; + + +/***/ }), +/* 937 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Particles.Zones + */ + +module.exports = { + + DeathZone: __webpack_require__(375), + EdgeZone: __webpack_require__(376), + RandomZone: __webpack_require__(378) + +}; + + +/***/ }), +/* 938 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(939); +} + +if (true) +{ + renderCanvas = __webpack_require__(940); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 939 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.RenderTexture#renderWebGL + * @since 3.2.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.RenderTexture} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var RenderTextureWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var frame = src.frame; + var width = frame.width; + var height = frame.height; + var getTint = Utils.getTintAppendFloatAlpha; + + this.pipeline.batchTexture( + src, + frame.glTexture, + width, height, + src.x, src.y, + width, height, + src.scaleX, src.scaleY, + src.rotation, + src.flipX, !src.flipY, + src.scrollFactorX, src.scrollFactorY, + src.displayOriginX, src.displayOriginY, + 0, 0, width, height, + getTint(src._tintTL, camera.alpha * src._alphaTL), + getTint(src._tintTR, camera.alpha * src._alphaTR), + getTint(src._tintBL, camera.alpha * src._alphaBL), + getTint(src._tintBR, camera.alpha * src._alphaBR), + (src._isTinted && src.tintFill), + 0, 0, + camera, + parentMatrix + ); + + // Force clear the current texture so that items next in the batch (like Graphics) don't try and use it + renderer.setBlankTexture(true); +}; + +module.exports = RenderTextureWebGLRenderer; + + +/***/ }), +/* 940 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.RenderTexture#renderCanvas + * @since 3.2.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.RenderTexture} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var RenderTextureCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + renderer.batchSprite(src, src.frame, camera, parentMatrix); +}; + +module.exports = RenderTextureCanvasRenderer; + + +/***/ }), +/* 941 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RETRO_FONT_CONST = __webpack_require__(942); +var Extend = __webpack_require__(17); + +/** + * @namespace Phaser.GameObjects.RetroFont + * @since 3.6.0 + */ + +var RetroFont = { Parse: __webpack_require__(943) }; + +// Merge in the consts +RetroFont = Extend(false, RetroFont, RETRO_FONT_CONST); + +module.exports = RetroFont; + + +/***/ }), +/* 942 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RETRO_FONT_CONST = { + + /** + * Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET1 + * @type {string} + * @since 3.6.0 + */ + TEXT_SET1: ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~', + + /** + * Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET2 + * @type {string} + * @since 3.6.0 + */ + TEXT_SET2: ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ', + + /** + * Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET3 + * @type {string} + * @since 3.6.0 + */ + TEXT_SET3: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ', + + /** + * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET4 + * @type {string} + * @since 3.6.0 + */ + TEXT_SET4: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789', + + /** + * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET5 + * @type {string} + * @since 3.6.0 + */ + TEXT_SET5: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() \'!?-*:0123456789', + + /** + * Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.' + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET6 + * @type {string} + * @since 3.6.0 + */ + TEXT_SET6: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.\' ', + + /** + * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39 + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET7 + * @type {string} + * @since 3.6.0 + */ + TEXT_SET7: 'AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-\'39', + + /** + * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET8 + * @type {string} + * @since 3.6.0 + */ + TEXT_SET8: '0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ', + + /** + * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?! + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET9 + * @type {string} + * @since 3.6.0 + */ + TEXT_SET9: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,\'"?!', + + /** + * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET10 + * @type {string} + * @since 3.6.0 + */ + TEXT_SET10: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + + /** + * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789 + * + * @name Phaser.GameObjects.RetroFont.TEXT_SET11 + * @since 3.6.0 + * @type {string} + */ + TEXT_SET11: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()\':;0123456789' + +}; + +module.exports = RETRO_FONT_CONST; + + +/***/ }), +/* 943 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetValue = __webpack_require__(6); + +/** + * Parses a Retro Font configuration object so you can pass it to the BitmapText constructor + * and create a BitmapText object using a fixed-width retro font. + * + * @function Phaser.GameObjects.RetroFont.Parse + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Phaser Scene. + * @param {Phaser.Types.GameObjects.BitmapText.RetroFontConfig} config - The font configuration object. + * + * @return {object} A parsed Bitmap Font data entry for the Bitmap Font cache. + */ +var ParseRetroFont = function (scene, config) +{ + var w = config.width; + var h = config.height; + var cx = Math.floor(w / 2); + var cy = Math.floor(h / 2); + var letters = GetValue(config, 'chars', ''); + + if (letters === '') + { + return; + } + + var key = GetValue(config, 'image', ''); + var offsetX = GetValue(config, 'offset.x', 0); + var offsetY = GetValue(config, 'offset.y', 0); + var spacingX = GetValue(config, 'spacing.x', 0); + var spacingY = GetValue(config, 'spacing.y', 0); + var lineSpacing = GetValue(config, 'lineSpacing', 0); + + var charsPerRow = GetValue(config, 'charsPerRow', null); + + if (charsPerRow === null) + { + charsPerRow = scene.sys.textures.getFrame(key).width / w; + + if (charsPerRow > letters.length) + { + charsPerRow = letters.length; + } + } + + var x = offsetX; + var y = offsetY; + + var data = { + retroFont: true, + font: key, + size: w, + lineHeight: h + lineSpacing, + chars: {} + }; + + var r = 0; + + for (var i = 0; i < letters.length; i++) + { + // var node = letters[i]; + + var charCode = letters.charCodeAt(i); + + data.chars[charCode] = + { + x: x, + y: y, + width: w, + height: h, + centerX: cx, + centerY: cy, + xOffset: 0, + yOffset: 0, + xAdvance: w, + data: {}, + kerning: {} + }; + + r++; + + if (r === charsPerRow) + { + r = 0; + x = offsetX; + y += h + spacingY; + } + else + { + x += w + spacingX; + } + } + + var entry = { + data: data, + frame: null, + texture: key + }; + + return entry; +}; + +module.exports = ParseRetroFont; + + +/***/ }), +/* 944 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns an object containing dimensions of the Text object. + * + * @function Phaser.GameObjects.Text.GetTextSize + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Text} text - The Text object to calculate the size from. + * @param {Phaser.Types.GameObjects.Text.TextMetrics} size - The Text metrics to use when calculating the size. + * @param {array} lines - The lines of text to calculate the size from. + * + * @return {object} An object containing dimensions of the Text object. + */ +var GetTextSize = function (text, size, lines) +{ + var canvas = text.canvas; + var context = text.context; + var style = text.style; + + var lineWidths = []; + var maxLineWidth = 0; + var drawnLines = lines.length; + + if (style.maxLines > 0 && style.maxLines < lines.length) + { + drawnLines = style.maxLines; + } + + style.syncFont(canvas, context); + + // Text Width + + for (var i = 0; i < drawnLines; i++) + { + var lineWidth = style.strokeThickness; + + lineWidth += context.measureText(lines[i]).width; + + // Adjust for wrapped text + if (style.wordWrap) + { + lineWidth -= context.measureText(' ').width; + } + + lineWidths[i] = Math.ceil(lineWidth); + maxLineWidth = Math.max(maxLineWidth, lineWidths[i]); + } + + // Text Height + + var lineHeight = size.fontSize + style.strokeThickness; + var height = lineHeight * drawnLines; + var lineSpacing = text.lineSpacing; + + // Adjust for line spacing + if (drawnLines > 1) + { + height += lineSpacing * (drawnLines - 1); + } + + return { + width: maxLineWidth, + height: height, + lines: drawnLines, + lineWidths: lineWidths, + lineSpacing: lineSpacing, + lineHeight: lineHeight + }; +}; + +module.exports = GetTextSize; + + +/***/ }), +/* 945 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(946); +} + +if (true) +{ + renderCanvas = __webpack_require__(947); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 946 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Text#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Text} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + if ((src.width === 0) || (src.height === 0)) + { + return; + } + + var frame = src.frame; + var width = frame.width; + var height = frame.height; + var getTint = Utils.getTintAppendFloatAlpha; + + this.pipeline.batchTexture( + src, + frame.glTexture, + width, height, + src.x, src.y, + width / src.style.resolution, height / src.style.resolution, + src.scaleX, src.scaleY, + src.rotation, + src.flipX, src.flipY, + src.scrollFactorX, src.scrollFactorY, + src.displayOriginX, src.displayOriginY, + 0, 0, width, height, + getTint(src._tintTL, camera.alpha * src._alphaTL), + getTint(src._tintTR, camera.alpha * src._alphaTR), + getTint(src._tintBL, camera.alpha * src._alphaBL), + getTint(src._tintBR, camera.alpha * src._alphaBR), + (src._isTinted && src.tintFill), + 0, 0, + camera, + parentMatrix + ); +}; + +module.exports = TextWebGLRenderer; + + +/***/ }), +/* 947 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Text#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Text} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var TextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + if ((src.width === 0) || (src.height === 0)) + { + return; + } + + renderer.batchSprite(src, src.frame, camera, parentMatrix); +}; + +module.exports = TextCanvasRenderer; + + +/***/ }), +/* 948 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetAdvancedValue = __webpack_require__(14); +var GetValue = __webpack_require__(6); +var MeasureText = __webpack_require__(949); + +// Key: [ Object Key, Default Value ] + +var propertyMap = { + fontFamily: [ 'fontFamily', 'Courier' ], + fontSize: [ 'fontSize', '16px' ], + fontStyle: [ 'fontStyle', '' ], + backgroundColor: [ 'backgroundColor', null ], + color: [ 'color', '#fff' ], + stroke: [ 'stroke', '#fff' ], + strokeThickness: [ 'strokeThickness', 0 ], + shadowOffsetX: [ 'shadow.offsetX', 0 ], + shadowOffsetY: [ 'shadow.offsetY', 0 ], + shadowColor: [ 'shadow.color', '#000' ], + shadowBlur: [ 'shadow.blur', 0 ], + shadowStroke: [ 'shadow.stroke', false ], + shadowFill: [ 'shadow.fill', false ], + align: [ 'align', 'left' ], + maxLines: [ 'maxLines', 0 ], + fixedWidth: [ 'fixedWidth', 0 ], + fixedHeight: [ 'fixedHeight', 0 ], + resolution: [ 'resolution', 0 ], + rtl: [ 'rtl', false ], + testString: [ 'testString', '|MÉqgy' ], + baselineX: [ 'baselineX', 1.2 ], + baselineY: [ 'baselineY', 1.4 ], + wordWrapWidth: [ 'wordWrap.width', null ], + wordWrapCallback: [ 'wordWrap.callback', null ], + wordWrapCallbackScope: [ 'wordWrap.callbackScope', null ], + wordWrapUseAdvanced: [ 'wordWrap.useAdvancedWrap', false ] +}; + +/** + * @classdesc + * A TextStyle class manages all of the style settings for a Text object. + * + * Text Game Objects create a TextStyle instance automatically, which is + * accessed via the `Text.style` property. You do not normally need to + * instantiate one yourself. + * + * @class TextStyle + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Text} text - The Text object that this TextStyle is styling. + * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The style settings to set. + */ +var TextStyle = new Class({ + + initialize: + + function TextStyle (text, style) + { + /** + * The Text object that this TextStyle is styling. + * + * @name Phaser.GameObjects.TextStyle#parent + * @type {Phaser.GameObjects.Text} + * @since 3.0.0 + */ + this.parent = text; + + /** + * The font family. + * + * @name Phaser.GameObjects.TextStyle#fontFamily + * @type {string} + * @default 'Courier' + * @since 3.0.0 + */ + this.fontFamily; + + /** + * The font size. + * + * @name Phaser.GameObjects.TextStyle#fontSize + * @type {string} + * @default '16px' + * @since 3.0.0 + */ + this.fontSize; + + /** + * The font style. + * + * @name Phaser.GameObjects.TextStyle#fontStyle + * @type {string} + * @since 3.0.0 + */ + this.fontStyle; + + /** + * The background color. + * + * @name Phaser.GameObjects.TextStyle#backgroundColor + * @type {string} + * @since 3.0.0 + */ + this.backgroundColor; + + /** + * The text fill color. + * + * @name Phaser.GameObjects.TextStyle#color + * @type {string} + * @default '#fff' + * @since 3.0.0 + */ + this.color; + + /** + * The text stroke color. + * + * @name Phaser.GameObjects.TextStyle#stroke + * @type {string} + * @default '#fff' + * @since 3.0.0 + */ + this.stroke; + + /** + * The text stroke thickness. + * + * @name Phaser.GameObjects.TextStyle#strokeThickness + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.strokeThickness; + + /** + * The horizontal shadow offset. + * + * @name Phaser.GameObjects.TextStyle#shadowOffsetX + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.shadowOffsetX; + + /** + * The vertical shadow offset. + * + * @name Phaser.GameObjects.TextStyle#shadowOffsetY + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.shadowOffsetY; + + /** + * The shadow color. + * + * @name Phaser.GameObjects.TextStyle#shadowColor + * @type {string} + * @default '#000' + * @since 3.0.0 + */ + this.shadowColor; + + /** + * The shadow blur radius. + * + * @name Phaser.GameObjects.TextStyle#shadowBlur + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.shadowBlur; + + /** + * Whether shadow stroke is enabled or not. + * + * @name Phaser.GameObjects.TextStyle#shadowStroke + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.shadowStroke; + + /** + * Whether shadow fill is enabled or not. + * + * @name Phaser.GameObjects.TextStyle#shadowFill + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.shadowFill; + + /** + * The text alignment. + * + * @name Phaser.GameObjects.TextStyle#align + * @type {string} + * @default 'left' + * @since 3.0.0 + */ + this.align; + + /** + * The maximum number of lines to draw. + * + * @name Phaser.GameObjects.TextStyle#maxLines + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.maxLines; + + /** + * The fixed width of the text. + * + * `0` means no fixed with. + * + * @name Phaser.GameObjects.TextStyle#fixedWidth + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.fixedWidth; + + /** + * The fixed height of the text. + * + * `0` means no fixed height. + * + * @name Phaser.GameObjects.TextStyle#fixedHeight + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.fixedHeight; + + /** + * The resolution the text is rendered to its internal canvas at. + * The default is 0, which means it will use the resolution set in the Game Config. + * + * @name Phaser.GameObjects.TextStyle#resolution + * @type {number} + * @default 0 + * @since 3.12.0 + */ + this.resolution; + + /** + * Whether the text should render right to left. + * + * @name Phaser.GameObjects.TextStyle#rtl + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.rtl; + + /** + * The test string to use when measuring the font. + * + * @name Phaser.GameObjects.TextStyle#testString + * @type {string} + * @default '|MÉqgy' + * @since 3.0.0 + */ + this.testString; + + /** + * The amount of horizontal padding added to the width of the text when calculating the font metrics. + * + * @name Phaser.GameObjects.TextStyle#baselineX + * @type {number} + * @default 1.2 + * @since 3.3.0 + */ + this.baselineX; + + /** + * The amount of vertical padding added to the height of the text when calculating the font metrics. + * + * @name Phaser.GameObjects.TextStyle#baselineY + * @type {number} + * @default 1.4 + * @since 3.3.0 + */ + this.baselineY; + + /** + * The font style, size and family. + * + * @name Phaser.GameObjects.TextStyle#_font + * @type {string} + * @private + * @since 3.0.0 + */ + this._font; + + // Set to defaults + user style + this.setStyle(style, false, true); + + var metrics = GetValue(style, 'metrics', false); + + // Provide optional TextMetrics in the style object to avoid the canvas look-up / scanning + // Doing this is reset if you then change the font of this TextStyle after creation + if (metrics) + { + this.metrics = { + ascent: GetValue(metrics, 'ascent', 0), + descent: GetValue(metrics, 'descent', 0), + fontSize: GetValue(metrics, 'fontSize', 0) + }; + } + else + { + this.metrics = MeasureText(this); + } + }, + + /** + * Set the text style. + * + * @example + * text.setStyle({ + * fontSize: '64px', + * fontFamily: 'Arial', + * color: '#ffffff', + * align: 'center', + * backgroundColor: '#ff00ff' + * }); + * + * @method Phaser.GameObjects.TextStyle#setStyle + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Text.TextSyle} style - The style settings to set. + * @param {boolean} [updateText=true] - Whether to update the text immediately. + * @param {boolean} [setDefaults=false] - Use the default values is not set, or the local values. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setStyle: function (style, updateText, setDefaults) + { + if (updateText === undefined) { updateText = true; } + if (setDefaults === undefined) { setDefaults = false; } + + // Avoid type mutation + if (style && style.hasOwnProperty('fontSize') && typeof style.fontSize === 'number') + { + style.fontSize = style.fontSize.toString() + 'px'; + } + + for (var key in propertyMap) + { + var value = (setDefaults) ? propertyMap[key][1] : this[key]; + + if (key === 'wordWrapCallback' || key === 'wordWrapCallbackScope') + { + // Callback & scope should be set without processing the values + this[key] = GetValue(style, propertyMap[key][0], value); + } + else + { + this[key] = GetAdvancedValue(style, propertyMap[key][0], value); + } + } + + // Allow for 'font' override + var font = GetValue(style, 'font', null); + + if (font !== null) + { + this.setFont(font, false); + } + + this._font = [ this.fontStyle, this.fontSize, this.fontFamily ].join(' ').trim(); + + // Allow for 'fill' to be used in place of 'color' + var fill = GetValue(style, 'fill', null); + + if (fill !== null) + { + this.color = fill; + } + + if (updateText) + { + return this.update(true); + } + else + { + return this.parent; + } + }, + + /** + * Synchronize the font settings to the given Canvas Rendering Context. + * + * @method Phaser.GameObjects.TextStyle#syncFont + * @since 3.0.0 + * + * @param {HTMLCanvasElement} canvas - The Canvas Element. + * @param {CanvasRenderingContext2D} context - The Canvas Rendering Context. + */ + syncFont: function (canvas, context) + { + context.font = this._font; + }, + + /** + * Synchronize the text style settings to the given Canvas Rendering Context. + * + * @method Phaser.GameObjects.TextStyle#syncStyle + * @since 3.0.0 + * + * @param {HTMLCanvasElement} canvas - The Canvas Element. + * @param {CanvasRenderingContext2D} context - The Canvas Rendering Context. + */ + syncStyle: function (canvas, context) + { + context.textBaseline = 'alphabetic'; + + context.fillStyle = this.color; + context.strokeStyle = this.stroke; + + context.lineWidth = this.strokeThickness; + context.lineCap = 'round'; + context.lineJoin = 'round'; + }, + + /** + * Synchronize the shadow settings to the given Canvas Rendering Context. + * + * @method Phaser.GameObjects.TextStyle#syncShadow + * @since 3.0.0 + * + * @param {CanvasRenderingContext2D} context - The Canvas Rendering Context. + * @param {boolean} enabled - Whether shadows are enabled or not. + */ + syncShadow: function (context, enabled) + { + if (enabled) + { + context.shadowOffsetX = this.shadowOffsetX; + context.shadowOffsetY = this.shadowOffsetY; + context.shadowColor = this.shadowColor; + context.shadowBlur = this.shadowBlur; + } + else + { + context.shadowOffsetX = 0; + context.shadowOffsetY = 0; + context.shadowColor = 0; + context.shadowBlur = 0; + } + }, + + /** + * Update the style settings for the parent Text object. + * + * @method Phaser.GameObjects.TextStyle#update + * @since 3.0.0 + * + * @param {boolean} recalculateMetrics - Whether to recalculate font and text metrics. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + update: function (recalculateMetrics) + { + if (recalculateMetrics) + { + this._font = [ this.fontStyle, this.fontSize, this.fontFamily ].join(' ').trim(); + + this.metrics = MeasureText(this); + } + + return this.parent.updateText(); + }, + + /** + * Set the font. + * + * If a string is given, the font family is set. + * + * If an object is given, the `fontFamily`, `fontSize` and `fontStyle` + * properties of that object are set. + * + * @method Phaser.GameObjects.TextStyle#setFont + * @since 3.0.0 + * + * @param {(string|object)} font - The font family or font settings to set. + * @param {boolean} [updateText=true] - Whether to update the text immediately. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setFont: function (font, updateText) + { + if (updateText === undefined) { updateText = true; } + + var fontFamily = font; + var fontSize = ''; + var fontStyle = ''; + + if (typeof font !== 'string') + { + fontFamily = GetValue(font, 'fontFamily', 'Courier'); + fontSize = GetValue(font, 'fontSize', '16px'); + fontStyle = GetValue(font, 'fontStyle', ''); + } + else + { + var fontSplit = font.split(' '); + + var i = 0; + + fontStyle = (fontSplit.length > 2) ? fontSplit[i++] : ''; + fontSize = fontSplit[i++] || '16px'; + fontFamily = fontSplit[i++] || 'Courier'; + } + + if (fontFamily !== this.fontFamily || fontSize !== this.fontSize || fontStyle !== this.fontStyle) + { + this.fontFamily = fontFamily; + this.fontSize = fontSize; + this.fontStyle = fontStyle; + + if (updateText) + { + this.update(true); + } + } + + return this.parent; + }, + + /** + * Set the font family. + * + * @method Phaser.GameObjects.TextStyle#setFontFamily + * @since 3.0.0 + * + * @param {string} family - The font family. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setFontFamily: function (family) + { + if (this.fontFamily !== family) + { + this.fontFamily = family; + + this.update(true); + } + + return this.parent; + }, + + /** + * Set the font style. + * + * @method Phaser.GameObjects.TextStyle#setFontStyle + * @since 3.0.0 + * + * @param {string} style - The font style. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setFontStyle: function (style) + { + if (this.fontStyle !== style) + { + this.fontStyle = style; + + this.update(true); + } + + return this.parent; + }, + + /** + * Set the font size. + * + * @method Phaser.GameObjects.TextStyle#setFontSize + * @since 3.0.0 + * + * @param {(number|string)} size - The font size. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setFontSize: function (size) + { + if (typeof size === 'number') + { + size = size.toString() + 'px'; + } + + if (this.fontSize !== size) + { + this.fontSize = size; + + this.update(true); + } + + return this.parent; + }, + + /** + * Set the test string to use when measuring the font. + * + * @method Phaser.GameObjects.TextStyle#setTestString + * @since 3.0.0 + * + * @param {string} string - The test string to use when measuring the font. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setTestString: function (string) + { + this.testString = string; + + return this.update(true); + }, + + /** + * Set a fixed width and height for the text. + * + * Pass in `0` for either of these parameters to disable fixed width or height respectively. + * + * @method Phaser.GameObjects.TextStyle#setFixedSize + * @since 3.0.0 + * + * @param {number} width - The fixed width to set. + * @param {number} height - The fixed height to set. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setFixedSize: function (width, height) + { + this.fixedWidth = width; + this.fixedHeight = height; + + if (width) + { + this.parent.width = width; + } + + if (height) + { + this.parent.height = height; + } + + return this.update(false); + }, + + /** + * Set the background color. + * + * @method Phaser.GameObjects.TextStyle#setBackgroundColor + * @since 3.0.0 + * + * @param {string} color - The background color. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setBackgroundColor: function (color) + { + this.backgroundColor = color; + + return this.update(false); + }, + + /** + * Set the text fill color. + * + * @method Phaser.GameObjects.TextStyle#setFill + * @since 3.0.0 + * + * @param {string} color - The text fill color. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setFill: function (color) + { + this.color = color; + + return this.update(false); + }, + + /** + * Set the text fill color. + * + * @method Phaser.GameObjects.TextStyle#setColor + * @since 3.0.0 + * + * @param {string} color - The text fill color. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setColor: function (color) + { + this.color = color; + + return this.update(false); + }, + + /** + * Set the resolution used by the Text object. + * + * By default it will be set to match the resolution set in the Game Config, + * but you can override it via this method. It allows for much clearer text on High DPI devices, + * at the cost of memory because it uses larger internal Canvas textures for the Text. + * + * Please use with caution, as the more high res Text you have, the more memory it uses up. + * + * @method Phaser.GameObjects.TextStyle#setResolution + * @since 3.12.0 + * + * @param {number} value - The resolution for this Text object to use. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setResolution: function (value) + { + this.resolution = value; + + return this.update(false); + }, + + /** + * Set the stroke settings. + * + * @method Phaser.GameObjects.TextStyle#setStroke + * @since 3.0.0 + * + * @param {string} color - The stroke color. + * @param {number} thickness - The stroke thickness. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setStroke: function (color, thickness) + { + if (thickness === undefined) { thickness = this.strokeThickness; } + + if (color === undefined && this.strokeThickness !== 0) + { + // Reset the stroke to zero (disabling it) + this.strokeThickness = 0; + + this.update(true); + } + else if (this.stroke !== color || this.strokeThickness !== thickness) + { + this.stroke = color; + this.strokeThickness = thickness; + + this.update(true); + } + + return this.parent; + }, + + /** + * Set the shadow settings. + * + * Calling this method always re-measures the parent Text object, + * so only call it when you actually change the shadow settings. + * + * @method Phaser.GameObjects.TextStyle#setShadow + * @since 3.0.0 + * + * @param {number} [x=0] - The horizontal shadow offset. + * @param {number} [y=0] - The vertical shadow offset. + * @param {string} [color='#000'] - The shadow color. + * @param {number} [blur=0] - The shadow blur radius. + * @param {boolean} [shadowStroke=false] - Whether to stroke the shadow. + * @param {boolean} [shadowFill=true] - Whether to fill the shadow. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setShadow: function (x, y, color, blur, shadowStroke, shadowFill) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (color === undefined) { color = '#000'; } + if (blur === undefined) { blur = 0; } + if (shadowStroke === undefined) { shadowStroke = false; } + if (shadowFill === undefined) { shadowFill = true; } + + this.shadowOffsetX = x; + this.shadowOffsetY = y; + this.shadowColor = color; + this.shadowBlur = blur; + this.shadowStroke = shadowStroke; + this.shadowFill = shadowFill; + + return this.update(false); + }, + + /** + * Set the shadow offset. + * + * @method Phaser.GameObjects.TextStyle#setShadowOffset + * @since 3.0.0 + * + * @param {number} [x=0] - The horizontal shadow offset. + * @param {number} [y=0] - The vertical shadow offset. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setShadowOffset: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this.shadowOffsetX = x; + this.shadowOffsetY = y; + + return this.update(false); + }, + + /** + * Set the shadow color. + * + * @method Phaser.GameObjects.TextStyle#setShadowColor + * @since 3.0.0 + * + * @param {string} [color='#000'] - The shadow color. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setShadowColor: function (color) + { + if (color === undefined) { color = '#000'; } + + this.shadowColor = color; + + return this.update(false); + }, + + /** + * Set the shadow blur radius. + * + * @method Phaser.GameObjects.TextStyle#setShadowBlur + * @since 3.0.0 + * + * @param {number} [blur=0] - The shadow blur radius. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setShadowBlur: function (blur) + { + if (blur === undefined) { blur = 0; } + + this.shadowBlur = blur; + + return this.update(false); + }, + + /** + * Enable or disable shadow stroke. + * + * @method Phaser.GameObjects.TextStyle#setShadowStroke + * @since 3.0.0 + * + * @param {boolean} enabled - Whether shadow stroke is enabled or not. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setShadowStroke: function (enabled) + { + this.shadowStroke = enabled; + + return this.update(false); + }, + + /** + * Enable or disable shadow fill. + * + * @method Phaser.GameObjects.TextStyle#setShadowFill + * @since 3.0.0 + * + * @param {boolean} enabled - Whether shadow fill is enabled or not. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setShadowFill: function (enabled) + { + this.shadowFill = enabled; + + return this.update(false); + }, + + /** + * Set the width (in pixels) to use for wrapping lines. + * + * Pass in null to remove wrapping by width. + * + * @method Phaser.GameObjects.TextStyle#setWordWrapWidth + * @since 3.0.0 + * + * @param {number} width - The maximum width of a line in pixels. Set to null to remove wrapping. + * @param {boolean} [useAdvancedWrap=false] - Whether or not to use the advanced wrapping + * algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false, + * spaces and whitespace are left as is. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setWordWrapWidth: function (width, useAdvancedWrap) + { + if (useAdvancedWrap === undefined) { useAdvancedWrap = false; } + + this.wordWrapWidth = width; + this.wordWrapUseAdvanced = useAdvancedWrap; + + return this.update(false); + }, + + /** + * Set a custom callback for wrapping lines. + * + * Pass in null to remove wrapping by callback. + * + * @method Phaser.GameObjects.TextStyle#setWordWrapCallback + * @since 3.0.0 + * + * @param {TextStyleWordWrapCallback} callback - A custom function that will be responsible for wrapping the + * text. It will receive two arguments: text (the string to wrap), textObject (this Text + * instance). It should return the wrapped lines either as an array of lines or as a string with + * newline characters in place to indicate where breaks should happen. + * @param {object} [scope=null] - The scope that will be applied when the callback is invoked. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setWordWrapCallback: function (callback, scope) + { + if (scope === undefined) { scope = null; } + + this.wordWrapCallback = callback; + this.wordWrapCallbackScope = scope; + + return this.update(false); + }, + + /** + * Set the alignment of the text in this Text object. + * + * The argument can be one of: `left`, `right`, `center` or `justify`. + * + * Alignment only works if the Text object has more than one line of text. + * + * @method Phaser.GameObjects.TextStyle#setAlign + * @since 3.0.0 + * + * @param {string} [align='left'] - The text alignment for multi-line text. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setAlign: function (align) + { + if (align === undefined) { align = 'left'; } + + this.align = align; + + return this.update(false); + }, + + /** + * Set the maximum number of lines to draw. + * + * @method Phaser.GameObjects.TextStyle#setMaxLines + * @since 3.0.0 + * + * @param {integer} [max=0] - The maximum number of lines to draw. + * + * @return {Phaser.GameObjects.Text} The parent Text object. + */ + setMaxLines: function (max) + { + if (max === undefined) { max = 0; } + + this.maxLines = max; + + return this.update(false); + }, + + /** + * Get the current text metrics. + * + * @method Phaser.GameObjects.TextStyle#getTextMetrics + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.Text.TextMetrics} The text metrics. + */ + getTextMetrics: function () + { + var metrics = this.metrics; + + return { + ascent: metrics.ascent, + descent: metrics.descent, + fontSize: metrics.fontSize + }; + }, + + /** + * Build a JSON representation of this Text Style. + * + * @method Phaser.GameObjects.TextStyle#toJSON + * @since 3.0.0 + * + * @return {object} A JSON representation of this Text Style. + */ + toJSON: function () + { + var output = {}; + + for (var key in propertyMap) + { + output[key] = this[key]; + } + + output.metrics = this.getTextMetrics(); + + return output; + }, + + /** + * Destroy this Text Style. + * + * @method Phaser.GameObjects.TextStyle#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.parent = undefined; + } + +}); + +module.exports = TextStyle; + + +/***/ }), +/* 949 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CanvasPool = __webpack_require__(24); + +/** + * Calculates the ascent, descent and fontSize of a given font style. + * + * @function Phaser.GameObjects.Text.MeasureText + * @since 3.0.0 + * + * @param {Phaser.GameObjects.TextStyle} textStyle - The TextStyle object to measure. + * + * @return {Phaser.Types.GameObjects.Text.TextMetrics} An object containing the ascent, descent and fontSize of the TextStyle. + */ +var MeasureText = function (textStyle) +{ + // @property {HTMLCanvasElement} canvas - The canvas element that the text is rendered. + var canvas = CanvasPool.create(this); + + // @property {HTMLCanvasElement} context - The context of the canvas element that the text is rendered to. + var context = canvas.getContext('2d'); + + textStyle.syncFont(canvas, context); + + var width = Math.ceil(context.measureText(textStyle.testString).width * textStyle.baselineX); + var baseline = width; + var height = 2 * baseline; + + baseline = baseline * textStyle.baselineY | 0; + + canvas.width = width; + canvas.height = height; + + context.fillStyle = '#f00'; + context.fillRect(0, 0, width, height); + + context.font = textStyle._font; + + context.textBaseline = 'alphabetic'; + context.fillStyle = '#000'; + context.fillText(textStyle.testString, 0, baseline); + + var output = { + ascent: 0, + descent: 0, + fontSize: 0 + }; + + if (!context.getImageData(0, 0, width, height)) + { + output.ascent = baseline; + output.descent = baseline + 6; + output.fontSize = output.ascent + output.descent; + + CanvasPool.remove(canvas); + + return output; + } + + var imagedata = context.getImageData(0, 0, width, height).data; + var pixels = imagedata.length; + var line = width * 4; + var i; + var j; + var idx = 0; + var stop = false; + + // ascent. scan from top to bottom until we find a non red pixel + for (i = 0; i < baseline; i++) + { + for (j = 0; j < line; j += 4) + { + if (imagedata[idx + j] !== 255) + { + stop = true; + break; + } + } + + if (!stop) + { + idx += line; + } + else + { + break; + } + } + + output.ascent = baseline - i; + + idx = pixels - line; + stop = false; + + // descent. scan from bottom to top until we find a non red pixel + for (i = height; i > baseline; i--) + { + for (j = 0; j < line; j += 4) + { + if (imagedata[idx + j] !== 255) + { + stop = true; + break; + } + } + + if (!stop) + { + idx -= line; + } + else + { + break; + } + } + + output.descent = (i - baseline); + output.fontSize = output.ascent + output.descent; + + CanvasPool.remove(canvas); + + return output; +}; + +module.exports = MeasureText; + + +/***/ }), +/* 950 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(951); +} + +if (true) +{ + renderCanvas = __webpack_require__(952); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 951 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.TileSprite#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.TileSprite} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + src.updateCanvas(); + + var getTint = Utils.getTintAppendFloatAlpha; + + this.pipeline.batchTexture( + src, + src.fillPattern, + src.displayFrame.width * src.tileScaleX, src.displayFrame.height * src.tileScaleY, + src.x, src.y, + src.width, src.height, + src.scaleX, src.scaleY, + src.rotation, + src.flipX, src.flipY, + src.scrollFactorX, src.scrollFactorY, + src.originX * src.width, src.originY * src.height, + 0, 0, src.width, src.height, + getTint(src._tintTL, camera.alpha * src._alphaTL), + getTint(src._tintTR, camera.alpha * src._alphaTR), + getTint(src._tintBL, camera.alpha * src._alphaBL), + getTint(src._tintBR, camera.alpha * src._alphaBR), + (src._isTinted && src.tintFill), + (src.tilePositionX % src.displayFrame.width) / src.displayFrame.width, + (src.tilePositionY % src.displayFrame.height) / src.displayFrame.height, + camera, + parentMatrix + ); +}; + +module.exports = TileSpriteWebGLRenderer; + + +/***/ }), +/* 952 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.TileSprite#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.TileSprite} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var TileSpriteCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + src.updateCanvas(); + + renderer.batchSprite(src, src.frame, camera, parentMatrix); +}; + +module.exports = TileSpriteCanvasRenderer; + + +/***/ }), +/* 953 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(954); +} + +if (true) +{ + renderCanvas = __webpack_require__(955); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 954 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillPathWebGL = __webpack_require__(98); +var StrokePathWebGL = __webpack_require__(68); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Arc#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Arc} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var ArcWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + var dx = src._displayOriginX; + var dy = src._displayOriginY; + + var alpha = camera.alpha * src.alpha; + + if (src.isFilled) + { + FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); + } + + if (src.isStroked) + { + StrokePathWebGL(pipeline, src, alpha, dx, dy); + } +}; + +module.exports = ArcWebGLRenderer; + + +/***/ }), +/* 955 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DegToRad = __webpack_require__(35); +var FillStyleCanvas = __webpack_require__(36); +var LineStyleCanvas = __webpack_require__(49); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Arc#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Arc} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var ArcCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + var radius = src.radius; + + ctx.beginPath(); + + ctx.arc( + (radius) - src.originX * (radius * 2), + (radius) - src.originY * (radius * 2), + radius, + DegToRad(src._startAngle), + DegToRad(src._endAngle), + src.anticlockwise + ); + + if (src.closePath) + { + ctx.closePath(); + } + + if (src.isFilled) + { + FillStyleCanvas(ctx, src); + + ctx.fill(); + } + + if (src.isStroked) + { + LineStyleCanvas(ctx, src); + + ctx.stroke(); + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = ArcCanvasRenderer; + + +/***/ }), +/* 956 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(957); +} + +if (true) +{ + renderCanvas = __webpack_require__(958); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 957 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillPathWebGL = __webpack_require__(98); +var StrokePathWebGL = __webpack_require__(68); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Curve#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Curve} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var CurveWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + var dx = src._displayOriginX + src._curveBounds.x; + var dy = src._displayOriginY + src._curveBounds.y; + + var alpha = camera.alpha * src.alpha; + + if (src.isFilled) + { + FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); + } + + if (src.isStroked) + { + StrokePathWebGL(pipeline, src, alpha, dx, dy); + } +}; + +module.exports = CurveWebGLRenderer; + + +/***/ }), +/* 958 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillStyleCanvas = __webpack_require__(36); +var LineStyleCanvas = __webpack_require__(49); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Curve#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Curve} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var CurveCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + var dx = src._displayOriginX + src._curveBounds.x; + var dy = src._displayOriginY + src._curveBounds.y; + + var path = src.pathData; + var pathLength = path.length - 1; + + var px1 = path[0] - dx; + var py1 = path[1] - dy; + + ctx.beginPath(); + + ctx.moveTo(px1, py1); + + if (!src.closePath) + { + pathLength -= 2; + } + + for (var i = 2; i < pathLength; i += 2) + { + var px2 = path[i] - dx; + var py2 = path[i + 1] - dy; + + ctx.lineTo(px2, py2); + } + + if (src.closePath) + { + ctx.closePath(); + } + + if (src.isFilled) + { + FillStyleCanvas(ctx, src); + + ctx.fill(); + } + + if (src.isStroked) + { + LineStyleCanvas(ctx, src); + + ctx.stroke(); + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = CurveCanvasRenderer; + + +/***/ }), +/* 959 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(960); +} + +if (true) +{ + renderCanvas = __webpack_require__(961); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 960 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillPathWebGL = __webpack_require__(98); +var StrokePathWebGL = __webpack_require__(68); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Ellipse#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Ellipse} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var EllipseWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + var dx = src._displayOriginX; + var dy = src._displayOriginY; + + var alpha = camera.alpha * src.alpha; + + if (src.isFilled) + { + FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); + } + + if (src.isStroked) + { + StrokePathWebGL(pipeline, src, alpha, dx, dy); + } +}; + +module.exports = EllipseWebGLRenderer; + + +/***/ }), +/* 961 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillStyleCanvas = __webpack_require__(36); +var LineStyleCanvas = __webpack_require__(49); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Ellipse#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Ellipse} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var EllipseCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + var dx = src._displayOriginX; + var dy = src._displayOriginY; + + var path = src.pathData; + var pathLength = path.length - 1; + + var px1 = path[0] - dx; + var py1 = path[1] - dy; + + ctx.beginPath(); + + ctx.moveTo(px1, py1); + + if (!src.closePath) + { + pathLength -= 2; + } + + for (var i = 2; i < pathLength; i += 2) + { + var px2 = path[i] - dx; + var py2 = path[i + 1] - dy; + + ctx.lineTo(px2, py2); + } + + ctx.closePath(); + + if (src.isFilled) + { + FillStyleCanvas(ctx, src); + + ctx.fill(); + } + + if (src.isStroked) + { + LineStyleCanvas(ctx, src); + + ctx.stroke(); + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = EllipseCanvasRenderer; + + +/***/ }), +/* 962 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(963); +} + +if (true) +{ + renderCanvas = __webpack_require__(964); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 963 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Grid#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Grid} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + calcMatrix.translate(-src._displayOriginX, -src._displayOriginY); + + var alpha = camera.alpha * src.alpha; + + // Work out the grid size + + var width = src.width; + var height = src.height; + + var cellWidth = src.cellWidth; + var cellHeight = src.cellHeight; + + var gridWidth = Math.ceil(width / cellWidth); + var gridHeight = Math.ceil(height / cellHeight); + + var cellWidthA = cellWidth; + var cellHeightA = cellHeight; + + var cellWidthB = cellWidth - ((gridWidth * cellWidth) - width); + var cellHeightB = cellHeight - ((gridHeight * cellHeight) - height); + + var fillTint; + var fillTintColor; + + var showCells = src.showCells; + var showAltCells = src.showAltCells; + var showOutline = src.showOutline; + + var x = 0; + var y = 0; + var r = 0; + var cw = 0; + var ch = 0; + + if (showOutline) + { + // To make room for the grid lines (in case alpha < 1) + cellWidthA--; + cellHeightA--; + + if (cellWidthB === cellWidth) + { + cellWidthB--; + } + + if (cellHeightB === cellHeight) + { + cellHeightB--; + } + } + + if (showCells && src.fillAlpha > 0) + { + fillTint = pipeline.fillTint; + fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + + fillTint.TL = fillTintColor; + fillTint.TR = fillTintColor; + fillTint.BL = fillTintColor; + fillTint.BR = fillTintColor; + + for (y = 0; y < gridHeight; y++) + { + if (showAltCells) + { + r = y % 2; + } + + for (x = 0; x < gridWidth; x++) + { + if (showAltCells && r) + { + r = 0; + continue; + } + + r++; + + cw = (x < gridWidth - 1) ? cellWidthA : cellWidthB; + ch = (y < gridHeight - 1) ? cellHeightA : cellHeightB; + + pipeline.setTexture2D(); + + pipeline.batchFillRect( + x * cellWidth, + y * cellHeight, + cw, + ch + ); + } + } + } + + if (showAltCells && src.altFillAlpha > 0) + { + fillTint = pipeline.fillTint; + fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.altFillColor, src.altFillAlpha * alpha); + + fillTint.TL = fillTintColor; + fillTint.TR = fillTintColor; + fillTint.BL = fillTintColor; + fillTint.BR = fillTintColor; + + for (y = 0; y < gridHeight; y++) + { + if (showAltCells) + { + r = y % 2; + } + + for (x = 0; x < gridWidth; x++) + { + if (showAltCells && !r) + { + r = 1; + continue; + } + + r = 0; + + cw = (x < gridWidth - 1) ? cellWidthA : cellWidthB; + ch = (y < gridHeight - 1) ? cellHeightA : cellHeightB; + + pipeline.setTexture2D(); + + pipeline.batchFillRect( + x * cellWidth, + y * cellHeight, + cw, + ch + ); + } + } + } + + if (showOutline && src.outlineFillAlpha > 0) + { + var strokeTint = pipeline.strokeTint; + var color = Utils.getTintAppendFloatAlphaAndSwap(src.outlineFillColor, src.outlineFillAlpha * alpha); + + strokeTint.TL = color; + strokeTint.TR = color; + strokeTint.BL = color; + strokeTint.BR = color; + + for (x = 1; x < gridWidth; x++) + { + var x1 = x * cellWidth; + + pipeline.setTexture2D(); + + pipeline.batchLine(x1, 0, x1, height, 1, 1, 1, 0, false); + } + + for (y = 1; y < gridHeight; y++) + { + var y1 = y * cellHeight; + + pipeline.setTexture2D(); + + pipeline.batchLine(0, y1, width, y1, 1, 1, 1, 0, false); + } + } +}; + +module.exports = GridWebGLRenderer; + + +/***/ }), +/* 964 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillStyleCanvas = __webpack_require__(36); +var LineStyleCanvas = __webpack_require__(49); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Grid#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Grid} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var GridCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + var dx = -src._displayOriginX; + var dy = -src._displayOriginY; + + var alpha = camera.alpha * src.alpha; + + // Work out the grid size + + var width = src.width; + var height = src.height; + + var cellWidth = src.cellWidth; + var cellHeight = src.cellHeight; + + var gridWidth = Math.ceil(width / cellWidth); + var gridHeight = Math.ceil(height / cellHeight); + + var cellWidthA = cellWidth; + var cellHeightA = cellHeight; + + var cellWidthB = cellWidth - ((gridWidth * cellWidth) - width); + var cellHeightB = cellHeight - ((gridHeight * cellHeight) - height); + + var showCells = src.showCells; + var showAltCells = src.showAltCells; + var showOutline = src.showOutline; + + var x = 0; + var y = 0; + var r = 0; + var cw = 0; + var ch = 0; + + if (showOutline) + { + // To make room for the grid lines (in case alpha < 1) + cellWidthA--; + cellHeightA--; + + if (cellWidthB === cellWidth) + { + cellWidthB--; + } + + if (cellHeightB === cellHeight) + { + cellHeightB--; + } + } + + if (showCells && src.fillAlpha > 0) + { + FillStyleCanvas(ctx, src); + + for (y = 0; y < gridHeight; y++) + { + if (showAltCells) + { + r = y % 2; + } + + for (x = 0; x < gridWidth; x++) + { + if (showAltCells && r) + { + r = 0; + continue; + } + + r++; + + cw = (x < gridWidth - 1) ? cellWidthA : cellWidthB; + ch = (y < gridHeight - 1) ? cellHeightA : cellHeightB; + + ctx.fillRect( + dx + x * cellWidth, + dy + y * cellHeight, + cw, + ch + ); + } + } + } + + if (showAltCells && src.altFillAlpha > 0) + { + FillStyleCanvas(ctx, src, src.altFillColor, src.altFillAlpha * alpha); + + for (y = 0; y < gridHeight; y++) + { + if (showAltCells) + { + r = y % 2; + } + + for (x = 0; x < gridWidth; x++) + { + if (showAltCells && !r) + { + r = 1; + continue; + } + + r = 0; + + cw = (x < gridWidth - 1) ? cellWidthA : cellWidthB; + ch = (y < gridHeight - 1) ? cellHeightA : cellHeightB; + + ctx.fillRect( + dx + x * cellWidth, + dy + y * cellHeight, + cw, + ch + ); + } + } + } + + if (showOutline && src.outlineFillAlpha > 0) + { + LineStyleCanvas(ctx, src, src.outlineFillColor, src.outlineFillAlpha * alpha); + + for (x = 1; x < gridWidth; x++) + { + var x1 = x * cellWidth; + + ctx.beginPath(); + + ctx.moveTo(x1 + dx, dy); + ctx.lineTo(x1 + dx, height + dy); + + ctx.stroke(); + } + + for (y = 1; y < gridHeight; y++) + { + var y1 = y * cellHeight; + + ctx.beginPath(); + + ctx.moveTo(dx, y1 + dy); + ctx.lineTo(dx + width, y1 + dy); + + ctx.stroke(); + } + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = GridCanvasRenderer; + + +/***/ }), +/* 965 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(966); +} + +if (true) +{ + renderCanvas = __webpack_require__(967); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 966 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.IsoBox#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.IsoBox} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + var size = src.width; + var height = src.height; + + var sizeA = size / 2; + var sizeB = size / src.projection; + + var alpha = camera.alpha * src.alpha; + + if (!src.isFilled) + { + return; + } + + var tint; + + var x0; + var y0; + + var x1; + var y1; + + var x2; + var y2; + + var x3; + var y3; + + // Top Face + + if (src.showTop) + { + tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillTop, alpha); + + x0 = calcMatrix.getX(-sizeA, -height); + y0 = calcMatrix.getY(-sizeA, -height); + + x1 = calcMatrix.getX(0, -sizeB - height); + y1 = calcMatrix.getY(0, -sizeB - height); + + x2 = calcMatrix.getX(sizeA, -height); + y2 = calcMatrix.getY(sizeA, -height); + + x3 = calcMatrix.getX(0, sizeB - height); + y3 = calcMatrix.getY(0, sizeB - height); + + pipeline.setTexture2D(); + + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + } + + // Left Face + + if (src.showLeft) + { + tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillLeft, alpha); + + x0 = calcMatrix.getX(-sizeA, 0); + y0 = calcMatrix.getY(-sizeA, 0); + + x1 = calcMatrix.getX(0, sizeB); + y1 = calcMatrix.getY(0, sizeB); + + x2 = calcMatrix.getX(0, sizeB - height); + y2 = calcMatrix.getY(0, sizeB - height); + + x3 = calcMatrix.getX(-sizeA, -height); + y3 = calcMatrix.getY(-sizeA, -height); + + pipeline.setTexture2D(); + + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + } + + // Right Face + + if (src.showRight) + { + tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillRight, alpha); + + x0 = calcMatrix.getX(sizeA, 0); + y0 = calcMatrix.getY(sizeA, 0); + + x1 = calcMatrix.getX(0, sizeB); + y1 = calcMatrix.getY(0, sizeB); + + x2 = calcMatrix.getX(0, sizeB - height); + y2 = calcMatrix.getY(0, sizeB - height); + + x3 = calcMatrix.getX(sizeA, -height); + y3 = calcMatrix.getY(sizeA, -height); + + pipeline.setTexture2D(); + + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + } +}; + +module.exports = IsoBoxWebGLRenderer; + + +/***/ }), +/* 967 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillStyleCanvas = __webpack_require__(36); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.IsoBox#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.IsoBox} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var IsoBoxCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix) && src.isFilled) + { + var size = src.width; + var height = src.height; + + var sizeA = size / 2; + var sizeB = size / src.projection; + + // Top Face + + if (src.showTop) + { + FillStyleCanvas(ctx, src, src.fillTop); + + ctx.beginPath(); + + ctx.moveTo(-sizeA, -height); + ctx.lineTo(0, -sizeB - height); + ctx.lineTo(sizeA, -height); + ctx.lineTo(sizeA, -1); + ctx.lineTo(0, sizeB - 1); + ctx.lineTo(-sizeA, -1); + ctx.lineTo(-sizeA, -height); + + ctx.fill(); + } + + // Left Face + + if (src.showLeft) + { + FillStyleCanvas(ctx, src, src.fillLeft); + + ctx.beginPath(); + + ctx.moveTo(-sizeA, 0); + ctx.lineTo(0, sizeB); + ctx.lineTo(0, sizeB - height); + ctx.lineTo(-sizeA, -height); + ctx.lineTo(-sizeA, 0); + + ctx.fill(); + } + + // Right Face + + if (src.showRight) + { + FillStyleCanvas(ctx, src, src.fillRight); + + ctx.beginPath(); + + ctx.moveTo(sizeA, 0); + ctx.lineTo(0, sizeB); + ctx.lineTo(0, sizeB - height); + ctx.lineTo(sizeA, -height); + ctx.lineTo(sizeA, 0); + + ctx.fill(); + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = IsoBoxCanvasRenderer; + + +/***/ }), +/* 968 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(969); +} + +if (true) +{ + renderCanvas = __webpack_require__(970); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 969 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.IsoTriangle#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.IsoTriangle} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + var size = src.width; + var height = src.height; + + var sizeA = size / 2; + var sizeB = size / src.projection; + + var reversed = src.isReversed; + + var alpha = camera.alpha * src.alpha; + + if (!src.isFilled) + { + return; + } + + var tint; + + var x0; + var y0; + + var x1; + var y1; + + var x2; + var y2; + + // Top Face + + if (src.showTop && reversed) + { + tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillTop, alpha); + + x0 = calcMatrix.getX(-sizeA, -height); + y0 = calcMatrix.getY(-sizeA, -height); + + x1 = calcMatrix.getX(0, -sizeB - height); + y1 = calcMatrix.getY(0, -sizeB - height); + + x2 = calcMatrix.getX(sizeA, -height); + y2 = calcMatrix.getY(sizeA, -height); + + var x3 = calcMatrix.getX(0, sizeB - height); + var y3 = calcMatrix.getY(0, sizeB - height); + + pipeline.setTexture2D(); + + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + } + + // Left Face + + if (src.showLeft) + { + tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillLeft, alpha); + + if (reversed) + { + x0 = calcMatrix.getX(-sizeA, -height); + y0 = calcMatrix.getY(-sizeA, -height); + + x1 = calcMatrix.getX(0, sizeB); + y1 = calcMatrix.getY(0, sizeB); + + x2 = calcMatrix.getX(0, sizeB - height); + y2 = calcMatrix.getY(0, sizeB - height); + } + else + { + x0 = calcMatrix.getX(-sizeA, 0); + y0 = calcMatrix.getY(-sizeA, 0); + + x1 = calcMatrix.getX(0, sizeB); + y1 = calcMatrix.getY(0, sizeB); + + x2 = calcMatrix.getX(0, sizeB - height); + y2 = calcMatrix.getY(0, sizeB - height); + } + + pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2); + } + + // Right Face + + if (src.showRight) + { + tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillRight, alpha); + + if (reversed) + { + x0 = calcMatrix.getX(sizeA, -height); + y0 = calcMatrix.getY(sizeA, -height); + + x1 = calcMatrix.getX(0, sizeB); + y1 = calcMatrix.getY(0, sizeB); + + x2 = calcMatrix.getX(0, sizeB - height); + y2 = calcMatrix.getY(0, sizeB - height); + } + else + { + x0 = calcMatrix.getX(sizeA, 0); + y0 = calcMatrix.getY(sizeA, 0); + + x1 = calcMatrix.getX(0, sizeB); + y1 = calcMatrix.getY(0, sizeB); + + x2 = calcMatrix.getX(0, sizeB - height); + y2 = calcMatrix.getY(0, sizeB - height); + } + + pipeline.setTexture2D(); + + pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2); + } +}; + +module.exports = IsoTriangleWebGLRenderer; + + +/***/ }), +/* 970 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillStyleCanvas = __webpack_require__(36); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.IsoTriangle#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.IsoTriangle} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var IsoTriangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix) && src.isFilled) + { + var size = src.width; + var height = src.height; + + var sizeA = size / 2; + var sizeB = size / src.projection; + + var reversed = src.isReversed; + + // Top Face + + if (src.showTop && reversed) + { + FillStyleCanvas(ctx, src, src.fillTop); + + ctx.beginPath(); + + ctx.moveTo(-sizeA, -height); + ctx.lineTo(0, -sizeB - height); + ctx.lineTo(sizeA, -height); + ctx.lineTo(0, sizeB - height); + + ctx.fill(); + } + + // Left Face + + if (src.showLeft) + { + FillStyleCanvas(ctx, src, src.fillLeft); + + ctx.beginPath(); + + if (reversed) + { + ctx.moveTo(-sizeA, -height); + ctx.lineTo(0, sizeB); + ctx.lineTo(0, sizeB - height); + } + else + { + ctx.moveTo(-sizeA, 0); + ctx.lineTo(0, sizeB); + ctx.lineTo(0, sizeB - height); + } + + ctx.fill(); + } + + // Right Face + + if (src.showRight) + { + FillStyleCanvas(ctx, src, src.fillRight); + + ctx.beginPath(); + + if (reversed) + { + ctx.moveTo(sizeA, -height); + ctx.lineTo(0, sizeB); + ctx.lineTo(0, sizeB - height); + } + else + { + ctx.moveTo(sizeA, 0); + ctx.lineTo(0, sizeB); + ctx.lineTo(0, sizeB - height); + } + + ctx.fill(); + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = IsoTriangleCanvasRenderer; + + +/***/ }), +/* 971 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(972); +} + +if (true) +{ + renderCanvas = __webpack_require__(973); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 972 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Line#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Line} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var LineWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + var dx = src._displayOriginX; + var dy = src._displayOriginY; + var alpha = camera.alpha * src.alpha; + + if (src.isStroked) + { + var strokeTint = pipeline.strokeTint; + var color = Utils.getTintAppendFloatAlphaAndSwap(src.strokeColor, src.strokeAlpha * alpha); + + strokeTint.TL = color; + strokeTint.TR = color; + strokeTint.BL = color; + strokeTint.BR = color; + + var startWidth = src._startWidth; + var endWidth = src._endWidth; + + pipeline.setTexture2D(); + + pipeline.batchLine( + src.geom.x1 - dx, + src.geom.y1 - dy, + src.geom.x2 - dx, + src.geom.y2 - dy, + startWidth, + endWidth, + 1, + 0, + false, + shapeMatrix, + camMatrix + ); + } +}; + +module.exports = LineWebGLRenderer; + + +/***/ }), +/* 973 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var LineStyleCanvas = __webpack_require__(49); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Line#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Line} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var LineCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + var dx = src._displayOriginX; + var dy = src._displayOriginY; + + if (src.isStroked) + { + LineStyleCanvas(ctx, src); + + ctx.beginPath(); + + ctx.moveTo(src.geom.x1 - dx, src.geom.y1 - dy); + ctx.lineTo(src.geom.x2 - dx, src.geom.y2 - dy); + + ctx.stroke(); + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = LineCanvasRenderer; + + +/***/ }), +/* 974 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(975); +} + +if (true) +{ + renderCanvas = __webpack_require__(976); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 975 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillPathWebGL = __webpack_require__(98); +var StrokePathWebGL = __webpack_require__(68); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Polygon#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Polygon} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var PolygonWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + var dx = src._displayOriginX; + var dy = src._displayOriginY; + + var alpha = camera.alpha * src.alpha; + + if (src.isFilled) + { + FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); + } + + if (src.isStroked) + { + StrokePathWebGL(pipeline, src, alpha, dx, dy); + } +}; + +module.exports = PolygonWebGLRenderer; + + +/***/ }), +/* 976 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillStyleCanvas = __webpack_require__(36); +var LineStyleCanvas = __webpack_require__(49); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Polygon#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Polygon} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var PolygonCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + var dx = src._displayOriginX; + var dy = src._displayOriginY; + + var path = src.pathData; + var pathLength = path.length - 1; + + var px1 = path[0] - dx; + var py1 = path[1] - dy; + + ctx.beginPath(); + + ctx.moveTo(px1, py1); + + if (!src.closePath) + { + pathLength -= 2; + } + + for (var i = 2; i < pathLength; i += 2) + { + var px2 = path[i] - dx; + var py2 = path[i + 1] - dy; + + ctx.lineTo(px2, py2); + } + + ctx.closePath(); + + if (src.isFilled) + { + FillStyleCanvas(ctx, src); + + ctx.fill(); + } + + if (src.isStroked) + { + LineStyleCanvas(ctx, src); + + ctx.stroke(); + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = PolygonCanvasRenderer; + + +/***/ }), +/* 977 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(978); +} + +if (true) +{ + renderCanvas = __webpack_require__(979); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 978 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var StrokePathWebGL = __webpack_require__(68); +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Rectangle#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Rectangle} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var RectangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + var dx = src._displayOriginX; + var dy = src._displayOriginY; + var alpha = camera.alpha * src.alpha; + + if (src.isFilled) + { + var fillTint = pipeline.fillTint; + var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + + fillTint.TL = fillTintColor; + fillTint.TR = fillTintColor; + fillTint.BL = fillTintColor; + fillTint.BR = fillTintColor; + + pipeline.setTexture2D(); + + pipeline.batchFillRect( + -dx, + -dy, + src.width, + src.height + ); + } + + if (src.isStroked) + { + StrokePathWebGL(pipeline, src, alpha, dx, dy); + } +}; + +module.exports = RectangleWebGLRenderer; + + +/***/ }), +/* 979 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillStyleCanvas = __webpack_require__(36); +var LineStyleCanvas = __webpack_require__(49); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Rectangle#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Rectangle} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var RectangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + var dx = src._displayOriginX; + var dy = src._displayOriginY; + + if (src.isFilled) + { + FillStyleCanvas(ctx, src); + + ctx.fillRect( + -dx, + -dy, + src.width, + src.height + ); + } + + if (src.isStroked) + { + LineStyleCanvas(ctx, src); + + ctx.beginPath(); + + ctx.rect( + -dx, + -dy, + src.width, + src.height + ); + + ctx.stroke(); + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = RectangleCanvasRenderer; + + +/***/ }), +/* 980 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(981); +} + +if (true) +{ + renderCanvas = __webpack_require__(982); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 981 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillPathWebGL = __webpack_require__(98); +var StrokePathWebGL = __webpack_require__(68); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Star#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Star} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var StarWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + var dx = src._displayOriginX; + var dy = src._displayOriginY; + + var alpha = camera.alpha * src.alpha; + + if (src.isFilled) + { + FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); + } + + if (src.isStroked) + { + StrokePathWebGL(pipeline, src, alpha, dx, dy); + } +}; + +module.exports = StarWebGLRenderer; + + +/***/ }), +/* 982 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillStyleCanvas = __webpack_require__(36); +var LineStyleCanvas = __webpack_require__(49); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Star#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Star} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var StarCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + var dx = src._displayOriginX; + var dy = src._displayOriginY; + + var path = src.pathData; + var pathLength = path.length - 1; + + var px1 = path[0] - dx; + var py1 = path[1] - dy; + + ctx.beginPath(); + + ctx.moveTo(px1, py1); + + if (!src.closePath) + { + pathLength -= 2; + } + + for (var i = 2; i < pathLength; i += 2) + { + var px2 = path[i] - dx; + var py2 = path[i + 1] - dy; + + ctx.lineTo(px2, py2); + } + + ctx.closePath(); + + if (src.isFilled) + { + FillStyleCanvas(ctx, src); + + ctx.fill(); + } + + if (src.isStroked) + { + LineStyleCanvas(ctx, src); + + ctx.stroke(); + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = StarCanvasRenderer; + + +/***/ }), +/* 983 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(984); +} + +if (true) +{ + renderCanvas = __webpack_require__(985); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 984 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var StrokePathWebGL = __webpack_require__(68); +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Triangle#renderWebGL + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Triangle} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + var camMatrix = pipeline._tempMatrix1; + var shapeMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + renderer.setPipeline(pipeline); + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + var dx = src._displayOriginX; + var dy = src._displayOriginY; + var alpha = camera.alpha * src.alpha; + + if (src.isFilled) + { + var fillTint = pipeline.fillTint; + var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + + fillTint.TL = fillTintColor; + fillTint.TR = fillTintColor; + fillTint.BL = fillTintColor; + fillTint.BR = fillTintColor; + + var x1 = src.geom.x1 - dx; + var y1 = src.geom.y1 - dy; + var x2 = src.geom.x2 - dx; + var y2 = src.geom.y2 - dy; + var x3 = src.geom.x3 - dx; + var y3 = src.geom.y3 - dy; + + pipeline.setTexture2D(); + + pipeline.batchFillTriangle( + x1, + y1, + x2, + y2, + x3, + y3, + shapeMatrix, + camMatrix + ); + } + + if (src.isStroked) + { + StrokePathWebGL(pipeline, src, alpha, dx, dy); + } +}; + +module.exports = TriangleWebGLRenderer; + + +/***/ }), +/* 985 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FillStyleCanvas = __webpack_require__(36); +var LineStyleCanvas = __webpack_require__(49); +var SetTransform = __webpack_require__(25); + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Triangle#renderCanvas + * @since 3.13.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Triangle} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var TriangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var ctx = renderer.currentContext; + + if (SetTransform(renderer, ctx, src, camera, parentMatrix)) + { + var dx = src._displayOriginX; + var dy = src._displayOriginY; + + var x1 = src.geom.x1 - dx; + var y1 = src.geom.y1 - dy; + var x2 = src.geom.x2 - dx; + var y2 = src.geom.y2 - dy; + var x3 = src.geom.x3 - dx; + var y3 = src.geom.y3 - dy; + + ctx.beginPath(); + + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.lineTo(x3, y3); + + ctx.closePath(); + + if (src.isFilled) + { + FillStyleCanvas(ctx, src); + + ctx.fill(); + } + + if (src.isStroked) + { + LineStyleCanvas(ctx, src); + + ctx.stroke(); + } + + // Restore the context saved in SetTransform + ctx.restore(); + } +}; + +module.exports = TriangleCanvasRenderer; + + +/***/ }), +/* 986 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Blitter = __webpack_require__(182); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Blitter Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Blitter Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#blitter + * @since 3.0.0 + * + * @param {number} x - The x position of the Game Object. + * @param {number} y - The y position of the Game Object. + * @param {string} key - The key of the Texture the Blitter object will use. + * @param {(string|integer)} [frame] - The default Frame children of the Blitter will use. + * + * @return {Phaser.GameObjects.Blitter} The Game Object that was created. + */ +GameObjectFactory.register('blitter', function (x, y, key, frame) +{ + return this.displayList.add(new Blitter(this.scene, x, y, key, frame)); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 987 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Container = __webpack_require__(183); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Container Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Container Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#container + * @since 3.4.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Container. + * + * @return {Phaser.GameObjects.Container} The Game Object that was created. + */ +GameObjectFactory.register('container', function (x, y, children) +{ + return this.displayList.add(new Container(this.scene, x, y, children)); +}); + + +/***/ }), +/* 988 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DOMElement = __webpack_require__(365); +var GameObjectFactory = __webpack_require__(5); + +/** + * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. + * + * In order for DOM Elements to display you have to enable them by adding the following to your game + * configuration object: + * + * ```javascript + * dom { + * createContainer: true + * } + * ``` + * + * When this is added, Phaser will automatically create a DOM Container div that is positioned over the top + * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of + * settings within the Scale Manager, the dom container is resized accordingly. + * + * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing + * Element that you wish to be placed under the control of Phaser. For example: + * + * ```javascript + * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); + * ``` + * + * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in + * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case, + * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font. + * + * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control + * alignment and positioning of the elements next to regular game content. + * + * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the + * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other + * methods available in this class to help construct your elements. + * + * Once the element has been created you can then control it like you would any other Game Object. You can set its + * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped + * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that + * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have + * a DOM Element, then a Sprite, then another DOM Element behind it. + * + * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event + * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas + * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you + * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly. + * + * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in. + * + * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert + * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table. + * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and + * UI. The choice is up to you, just remember that you're dealing with standard HTML and CSS floating over the top + * of your game, and should treat it accordingly. + * + * Note: This method will only be available if the DOM Element Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#dom + * @since 3.17.0 + * + * @param {number} x - The horizontal position of this DOM Element in the world. + * @param {number} y - The vertical position of this DOM Element in the world. + * @param {(HTMLElement|string)} [element] - An existing DOM element, or a string. If a string starting with a # it will do a `getElementById` look-up on the string (minus the hash). Without a hash, it represents the type of element to create, i.e. 'div'. + * @param {(string|any)} [style] - If a string, will be set directly as the elements `style` property value. If a plain object, will be iterated and the values transferred. In both cases the values replacing whatever CSS styles may have been previously set. + * @param {string} [innerText] - If given, will be set directly as the elements `innerText` property value, replacing whatever was there before. + * + * @return {Phaser.GameObjects.DOMElement} The Game Object that was created. + */ +GameObjectFactory.register('dom', function (x, y, element, style, innerText) +{ + var gameObject = new DOMElement(this.scene, x, y, element, style, innerText); + + this.displayList.add(gameObject); + this.updateList.add(gameObject); + + return gameObject; +}); + + +/***/ }), +/* 989 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DynamicBitmapText = __webpack_require__(184); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Dynamic Bitmap Text Game Object and adds it to the Scene. + * + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * Dynamic Bitmap Text objects are different from Static Bitmap Text in that they invoke a callback for each + * letter being rendered during the render pass. This callback allows you to manipulate the properties of + * each letter being rendered, such as its position, scale or tint, allowing you to create interesting effects + * like jiggling text, which can't be done with Static text. This means that Dynamic Text takes more processing + * time, so only use them if you require the callback ability they have. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + * + * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#dynamicBitmapText + * @since 3.0.0 + * + * @param {number} x - The x position of the Game Object. + * @param {number} y - The y position of the Game Object. + * @param {string} font - The key of the font to use from the BitmapFont cache. + * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. + * @param {number} [size] - The font size to set. + * + * @return {Phaser.GameObjects.DynamicBitmapText} The Game Object that was created. + */ +GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size) +{ + return this.displayList.add(new DynamicBitmapText(this.scene, x, y, font, text, size)); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 990 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extern = __webpack_require__(367); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Extern Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Extern Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#extern + * @since 3.16.0 + * + * @return {Phaser.GameObjects.Extern} The Game Object that was created. + */ +GameObjectFactory.register('extern', function () +{ + var extern = new Extern(this.scene); + + this.displayList.add(extern); + this.updateList.add(extern); + + return extern; +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 991 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Graphics = __webpack_require__(185); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Graphics Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Graphics Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#graphics + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Graphics.Options} [config] - The Graphics configuration. + * + * @return {Phaser.GameObjects.Graphics} The Game Object that was created. + */ +GameObjectFactory.register('graphics', function (config) +{ + return this.displayList.add(new Graphics(this.scene, config)); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 992 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Group = __webpack_require__(94); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Group Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Group Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#group + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject[]|Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupConfig[])} [children] - Game Objects to add to this Group; or the `config` argument. + * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} [config] - A Group Configuration object. + * + * @return {Phaser.GameObjects.Group} The Game Object that was created. + */ +GameObjectFactory.register('group', function (children, config) +{ + return this.updateList.add(new Group(this.scene, children, config)); +}); + + +/***/ }), +/* 993 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Image = __webpack_require__(95); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Image Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Image Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#image + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.GameObjects.Image} The Game Object that was created. + */ +GameObjectFactory.register('image', function (x, y, key, frame) +{ + return this.displayList.add(new Image(this.scene, x, y, key, frame)); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 994 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var ParticleEmitterManager = __webpack_require__(188); + +/** + * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Particles Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#particles + * @since 3.0.0 + * + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer|object)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created. + */ +GameObjectFactory.register('particles', function (key, frame, emitters) +{ + var manager = new ParticleEmitterManager(this.scene, key, frame, emitters); + + this.displayList.add(manager); + this.updateList.add(manager); + + return manager; +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 995 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var PathFollower = __webpack_require__(379); + +/** + * Creates a new PathFollower Game Object and adds it to the Scene. + * + * Note: This method will only be available if the PathFollower Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#follower + * @since 3.0.0 + * + * @param {Phaser.Curves.Path} path - The Path this PathFollower is connected to. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.GameObjects.PathFollower} The Game Object that was created. + */ +GameObjectFactory.register('follower', function (path, x, y, key, frame) +{ + var sprite = new PathFollower(this.scene, path, x, y, key, frame); + + this.displayList.add(sprite); + this.updateList.add(sprite); + + return sprite; +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 996 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var RenderTexture = __webpack_require__(189); + +/** + * Creates a new Render Texture Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. + * + * A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and + * draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic + * textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads. + * + * @method Phaser.GameObjects.GameObjectFactory#renderTexture + * @since 3.2.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {integer} [width=32] - The width of the Render Texture. + * @param {integer} [height=32] - The height of the Render Texture. + * @property {string} [key] - The texture key to make the RenderTexture from. + * @property {string} [frame] - the frame to make the RenderTexture from. + * + * @return {Phaser.GameObjects.RenderTexture} The Game Object that was created. + */ +GameObjectFactory.register('renderTexture', function (x, y, width, height, key, frame) +{ + return this.displayList.add(new RenderTexture(this.scene, x, y, width, height, key, frame)); +}); + + +/***/ }), +/* 997 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var Sprite = __webpack_require__(67); + +/** + * Creates a new Sprite Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Sprite Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#sprite + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.GameObjects.Sprite} The Game Object that was created. + */ +GameObjectFactory.register('sprite', function (x, y, key, frame) +{ + var sprite = new Sprite(this.scene, x, y, key, frame); + + this.displayList.add(sprite); + this.updateList.add(sprite); + + return sprite; +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 998 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BitmapText = __webpack_require__(128); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Bitmap Text Game Object and adds it to the Scene. + * + * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. + * + * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to + * match the font structure. + * + * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability + * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by + * processing the font texture in an image editor, applying fills and any other effects required. + * + * To create multi-line text insert \r, \n or \r\n escape codes into the text string. + * + * To create a BitmapText data files you need a 3rd party app such as: + * + * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ + * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner + * Littera (Web-based, free): http://kvazars.com/littera/ + * + * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + * + * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#bitmapText + * @since 3.0.0 + * + * @param {number} x - The x position of the Game Object. + * @param {number} y - The y position of the Game Object. + * @param {string} font - The key of the font to use from the BitmapFont cache. + * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. + * @param {number} [size] - The font size to set. + * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + * + * @return {Phaser.GameObjects.BitmapText} The Game Object that was created. + */ +GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align) +{ + return this.displayList.add(new BitmapText(this.scene, x, y, font, text, size, align)); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 999 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Text = __webpack_require__(190); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Text Game Object and adds it to the Scene. + * + * A Text Game Object. + * + * Text objects work by creating their own internal hidden Canvas and then renders text to it using + * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered + * to your game during the render pass. + * + * Because it uses the Canvas API you can take advantage of all the features this offers, such as + * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts + * loaded externally, such as Google or TypeKit Web fonts. + * + * You can only display fonts that are currently loaded and available to the browser: therefore fonts must + * be pre-loaded. Phaser does not do ths for you, so you will require the use of a 3rd party font loader, + * or have the fonts ready available in the CSS on the page in which your Phaser game resides. + * + * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts + * across mobile browsers. + * + * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being + * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the + * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of + * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text + * instead, as it benefits from batching and avoids expensive Canvas API calls. + * + * Note: This method will only be available if the Text Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#text + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {(string|string[])} text - The text this Text object will display. + * @param {object} [style] - The Text style configuration object. + * + * @return {Phaser.GameObjects.Text} The Game Object that was created. + */ +GameObjectFactory.register('text', function (x, y, text, style) +{ + return this.displayList.add(new Text(this.scene, x, y, text, style)); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 1000 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TileSprite = __webpack_require__(191); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new TileSprite Game Object and adds it to the Scene. + * + * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#tileSprite + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame. + * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.GameObjects.TileSprite} The Game Object that was created. + */ +GameObjectFactory.register('tileSprite', function (x, y, width, height, key, frame) +{ + return this.displayList.add(new TileSprite(this.scene, x, y, width, height, key, frame)); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 1001 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Zone = __webpack_require__(106); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Zone Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Zone Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#zone + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {number} width - The width of the Game Object. + * @param {number} height - The height of the Game Object. + * + * @return {Phaser.GameObjects.Zone} The Game Object that was created. + */ +GameObjectFactory.register('zone', function (x, y, width, height) +{ + return this.displayList.add(new Zone(this.scene, x, y, width, height)); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 1002 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Arc = __webpack_require__(381); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Arc Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Arc Game Object has been built into Phaser. + * + * The Arc Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an arc shape. You can control the start and end angles of the arc, + * as well as if the angles are winding clockwise or anti-clockwise. With the default settings + * it renders as a complete circle. By changing the angles you can create other arc shapes, + * such as half-circles. + * + * @method Phaser.GameObjects.GameObjectFactory#arc + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [radius=128] - The radius of the arc. + * @param {integer} [startAngle=0] - The start angle of the arc, in degrees. + * @param {integer} [endAngle=360] - The end angle of the arc, in degrees. + * @param {boolean} [anticlockwise=false] - The winding order of the start and end angles. + * @param {number} [fillColor] - The color the arc will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {Phaser.GameObjects.Arc} The Game Object that was created. + */ +GameObjectFactory.register('arc', function (x, y, radius, startAngle, endAngle, anticlockwise, fillColor, fillAlpha) +{ + return this.displayList.add(new Arc(this.scene, x, y, radius, startAngle, endAngle, anticlockwise, fillColor, fillAlpha)); +}); + +/** + * Creates a new Circle Shape Game Object and adds it to the Scene. + * + * A Circle is an Arc with no defined start and end angle, making it render as a complete circle. + * + * Note: This method will only be available if the Arc Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#circle + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [radius=128] - The radius of the circle. + * @param {number} [fillColor] - The color the circle will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the circle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {Phaser.GameObjects.Arc} The Game Object that was created. + */ +GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlpha) +{ + return this.displayList.add(new Arc(this.scene, x, y, radius, 0, 360, false, fillColor, fillAlpha)); +}); + + +/***/ }), +/* 1003 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var Curve = __webpack_require__(382); + +/** + * Creates a new Curve Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Curve Game Object has been built into Phaser. + * + * The Curve Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * To render a Curve Shape you must first create a `Phaser.Curves.Curve` object, then pass it to + * the Curve Shape in the constructor. + * + * The Curve shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + * + * @method Phaser.GameObjects.GameObjectFactory#curve + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {Phaser.Curves.Curve} [curve] - The Curve object to use to create the Shape. + * @param {number} [fillColor] - The color the curve will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the curve will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {Phaser.GameObjects.Curve} The Game Object that was created. + */ +GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) +{ + return this.displayList.add(new Curve(this.scene, x, y, curve, fillColor, fillAlpha)); +}); + + +/***/ }), +/* 1004 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Ellipse = __webpack_require__(383); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Ellipse Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Ellipse Game Object has been built into Phaser. + * + * The Ellipse Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * When it renders it displays an ellipse shape. You can control the width and height of the ellipse. + * If the width and height match it will render as a circle. If the width is less than the height, + * it will look more like an egg shape. + * + * The Ellipse shape also has a `smoothness` property and corresponding `setSmoothness` method. + * This allows you to control how smooth the shape renders in WebGL, by controlling the number of iterations + * that take place during construction. Increase and decrease the default value for smoother, or more + * jagged, shapes. + * + * @method Phaser.GameObjects.GameObjectFactory#ellipse + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [width=128] - The width of the ellipse. An ellipse with equal width and height renders as a circle. + * @param {number} [height=128] - The height of the ellipse. An ellipse with equal width and height renders as a circle. + * @param {number} [fillColor] - The color the ellipse will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the ellipse will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {Phaser.GameObjects.Ellipse} The Game Object that was created. + */ +GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, fillAlpha) +{ + return this.displayList.add(new Ellipse(this.scene, x, y, width, height, fillColor, fillAlpha)); +}); + + +/***/ }), +/* 1005 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var Grid = __webpack_require__(384); + +/** + * Creates a new Grid Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Grid Game Object has been built into Phaser. + * + * The Grid Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * A Grid Shape allows you to display a grid in your game, where you can control the size of the + * grid as well as the width and height of the grid cells. You can set a fill color for each grid + * cell as well as an alternate fill color. When the alternate fill color is set then the grid + * cells will alternate the fill colors as they render, creating a chess-board effect. You can + * also optionally have an outline fill color. If set, this draws lines between the grid cells + * in the given color. If you specify an outline color with an alpha of zero, then it will draw + * the cells spaced out, but without the lines between them. + * + * @method Phaser.GameObjects.GameObjectFactory#grid + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [width=128] - The width of the grid. + * @param {number} [height=128] - The height of the grid. + * @param {number} [cellWidth=32] - The width of one cell in the grid. + * @param {number} [cellHeight=32] - The height of one cell in the grid. + * @param {number} [fillColor] - The color the grid cells will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the grid cells will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * @param {number} [outlineFillColor] - The color of the lines between the grid cells. + * @param {number} [outlineFillAlpha] - The alpha of the lines between the grid cells. + * + * @return {Phaser.GameObjects.Grid} The Game Object that was created. + */ +GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cellHeight, fillColor, fillAlpha, outlineFillColor, outlineFillAlpha) +{ + return this.displayList.add(new Grid(this.scene, x, y, width, height, cellWidth, cellHeight, fillColor, fillAlpha, outlineFillColor, outlineFillAlpha)); +}); + + +/***/ }), +/* 1006 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var IsoBox = __webpack_require__(385); + +/** + * Creates a new IsoBox Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the IsoBox Game Object has been built into Phaser. + * + * The IsoBox Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoBox is an 'isometric' rectangle. Each face of it has a different fill color. You can set + * the color of the top, left and right faces of the rectangle respectively. You can also choose + * which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoBox from under-neath, however you can change the 'angle' by setting + * the `projection` property. + * + * @method Phaser.GameObjects.GameObjectFactory#isobox + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [size=48] - The width of the iso box in pixels. The left and right faces will be exactly half this value. + * @param {number} [height=32] - The height of the iso box. The left and right faces will be this tall. The overall height of the isobox will be this value plus half the `size` value. + * @param {number} [fillTop=0xeeeeee] - The fill color of the top face of the iso box. + * @param {number} [fillLeft=0x999999] - The fill color of the left face of the iso box. + * @param {number} [fillRight=0xcccccc] - The fill color of the right face of the iso box. + * + * @return {Phaser.GameObjects.IsoBox} The Game Object that was created. + */ +GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fillLeft, fillRight) +{ + return this.displayList.add(new IsoBox(this.scene, x, y, size, height, fillTop, fillLeft, fillRight)); +}); + + +/***/ }), +/* 1007 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var IsoTriangle = __webpack_require__(386); + +/** + * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the IsoTriangle Game Object has been built into Phaser. + * + * The IsoTriangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only fill colors and cannot be stroked. + * + * An IsoTriangle is an 'isometric' triangle. Think of it like a pyramid. Each face has a different + * fill color. You can set the color of the top, left and right faces of the triangle respectively + * You can also choose which of the faces are rendered via the `showTop`, `showLeft` and `showRight` properties. + * + * You cannot view an IsoTriangle from under-neath, however you can change the 'angle' by setting + * the `projection` property. The `reversed` property controls if the IsoTriangle is rendered upside + * down or not. + * + * @method Phaser.GameObjects.GameObjectFactory#isotriangle + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [size=48] - The width of the iso triangle in pixels. The left and right faces will be exactly half this value. + * @param {number} [height=32] - The height of the iso triangle. The left and right faces will be this tall. The overall height of the iso triangle will be this value plus half the `size` value. + * @param {boolean} [reversed=false] - Is the iso triangle upside down? + * @param {number} [fillTop=0xeeeeee] - The fill color of the top face of the iso triangle. + * @param {number} [fillLeft=0x999999] - The fill color of the left face of the iso triangle. + * @param {number} [fillRight=0xcccccc] - The fill color of the right face of the iso triangle. + * + * @return {Phaser.GameObjects.IsoTriangle} The Game Object that was created. + */ +GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed, fillTop, fillLeft, fillRight) +{ + return this.displayList.add(new IsoTriangle(this.scene, x, y, size, height, reversed, fillTop, fillLeft, fillRight)); +}); + + +/***/ }), +/* 1008 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var Line = __webpack_require__(387); + +/** + * Creates a new Line Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Line Game Object has been built into Phaser. + * + * The Line Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports only stroke colors and cannot be filled. + * + * A Line Shape allows you to draw a line between two points in your game. You can control the + * stroke color and thickness of the line. In WebGL only you can also specify a different + * thickness for the start and end of the line, allowing you to render lines that taper-off. + * + * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. + * + * @method Phaser.GameObjects.GameObjectFactory#line + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [x1=0] - The horizontal position of the start of the line. + * @param {number} [y1=0] - The vertical position of the start of the line. + * @param {number} [x2=128] - The horizontal position of the end of the line. + * @param {number} [y2=0] - The vertical position of the end of the line. + * @param {number} [strokeColor] - The color the line will be drawn in, i.e. 0xff0000 for red. + * @param {number} [strokeAlpha] - The alpha the line will be drawn in. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {Phaser.GameObjects.Line} The Game Object that was created. + */ +GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, strokeAlpha) +{ + return this.displayList.add(new Line(this.scene, x, y, x1, y1, x2, y2, strokeColor, strokeAlpha)); +}); + + +/***/ }), +/* 1009 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var Polygon = __webpack_require__(388); + +/** + * Creates a new Polygon Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Polygon Game Object has been built into Phaser. + * + * The Polygon Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Polygon Shape is created by providing a list of points, which are then used to create an + * internal Polygon geometry object. The points can be set from a variety of formats: + * + * - An array of Point or Vector2 objects: `[new Phaser.Math.Vec2(x1, y1), ...]` + * - An array of objects with public x/y properties: `[obj1, obj2, ...]` + * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` + * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` + * + * By default the `x` and `y` coordinates of this Shape refer to the center of it. However, depending + * on the coordinates of the points provided, the final shape may be rendered offset from its origin. + * + * @method Phaser.GameObjects.GameObjectFactory#polygon + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {any} [points] - The points that make up the polygon. + * @param {number} [fillColor] - The color the polygon will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the polygon will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {Phaser.GameObjects.Polygon} The Game Object that was created. + */ +GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlpha) +{ + return this.displayList.add(new Polygon(this.scene, x, y, points, fillColor, fillAlpha)); +}); + + +/***/ }), +/* 1010 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var Rectangle = __webpack_require__(393); + +/** + * Creates a new Rectangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Rectangle Game Object has been built into Phaser. + * + * The Rectangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * You can change the size of the rectangle by changing the `width` and `height` properties. + * + * @method Phaser.GameObjects.GameObjectFactory#rectangle + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [width=128] - The width of the rectangle. + * @param {number} [height=128] - The height of the rectangle. + * @param {number} [fillColor] - The color the rectangle will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the rectangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {Phaser.GameObjects.Rectangle} The Game Object that was created. + */ +GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor, fillAlpha) +{ + return this.displayList.add(new Rectangle(this.scene, x, y, width, height, fillColor, fillAlpha)); +}); + + +/***/ }), +/* 1011 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Star = __webpack_require__(394); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Star Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Star Game Object has been built into Phaser. + * + * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * As the name implies, the Star shape will display a star in your game. You can control several + * aspects of it including the number of points that constitute the star. The default is 5. If + * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky + * star shape. + * + * You can also control the inner and outer radius, which is how 'long' each point of the star is. + * Modify these values to create more interesting shapes. + * + * @method Phaser.GameObjects.GameObjectFactory#star + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [points=5] - The number of points on the star. + * @param {number} [innerRadius=32] - The inner radius of the star. + * @param {number} [outerRadius=64] - The outer radius of the star. + * @param {number} [fillColor] - The color the star will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {Phaser.GameObjects.Star} The Game Object that was created. + */ +GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRadius, fillColor, fillAlpha) +{ + return this.displayList.add(new Star(this.scene, x, y, points, innerRadius, outerRadius, fillColor, fillAlpha)); +}); + + +/***/ }), +/* 1012 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var Triangle = __webpack_require__(395); + +/** + * Creates a new Triangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Triangle Game Object has been built into Phaser. + * + * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the + * position of each point of these lines. The triangle is always closed and cannot have an open + * face. If you require that, consider using a Polygon instead. + * + * @method Phaser.GameObjects.GameObjectFactory#triangle + * @since 3.13.0 + * + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [x1=0] - The horizontal position of the first point in the triangle. + * @param {number} [y1=128] - The vertical position of the first point in the triangle. + * @param {number} [x2=64] - The horizontal position of the second point in the triangle. + * @param {number} [y2=0] - The vertical position of the second point in the triangle. + * @param {number} [x3=128] - The horizontal position of the third point in the triangle. + * @param {number} [y3=128] - The vertical position of the third point in the triangle. + * @param {number} [fillColor] - The color the triangle will be filled with, i.e. 0xff0000 for red. + * @param {number} [fillAlpha] - The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * + * @return {Phaser.GameObjects.Triangle} The Game Object that was created. + */ +GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, fillColor, fillAlpha) +{ + return this.displayList.add(new Triangle(this.scene, x, y, x1, y1, x2, y2, x3, y3, fillColor, fillAlpha)); +}); + + +/***/ }), +/* 1013 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Blitter = __webpack_require__(182); +var BuildGameObject = __webpack_require__(29); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); + +/** + * Creates a new Blitter Game Object and returns it. + * + * Note: This method will only be available if the Blitter Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#blitter + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Blitter} The Game Object that was created. + */ +GameObjectCreator.register('blitter', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var key = GetAdvancedValue(config, 'key', null); + var frame = GetAdvancedValue(config, 'frame', null); + + var blitter = new Blitter(this.scene, 0, 0, key, frame); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, blitter, config); + + return blitter; +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + + +/***/ }), +/* 1014 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(29); +var Container = __webpack_require__(183); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); + +/** + * Creates a new Container Game Object and returns it. + * + * Note: This method will only be available if the Container Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#container + * @since 3.4.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Container} The Game Object that was created. + */ +GameObjectCreator.register('container', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var x = GetAdvancedValue(config, 'x', 0); + var y = GetAdvancedValue(config, 'y', 0); + + var container = new Container(this.scene, x, y); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, container, config); + + return container; +}); + + +/***/ }), +/* 1015 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BitmapText = __webpack_require__(184); +var BuildGameObject = __webpack_require__(29); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); + +/** + * Creates a new Dynamic Bitmap Text Game Object and returns it. + * + * Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#dynamicBitmapText + * @since 3.0.0 + *² + * @param {Phaser.Types.GameObjects.BitmapText.BitmapTextConfig} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.DynamicBitmapText} The Game Object that was created. + */ +GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var font = GetAdvancedValue(config, 'font', ''); + var text = GetAdvancedValue(config, 'text', ''); + var size = GetAdvancedValue(config, 'size', false); + + var bitmapText = new BitmapText(this.scene, 0, 0, font, text, size); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, bitmapText, config); + + return bitmapText; +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + + +/***/ }), +/* 1016 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectCreator = __webpack_require__(15); +var Graphics = __webpack_require__(185); + +/** + * Creates a new Graphics Game Object and returns it. + * + * Note: This method will only be available if the Graphics Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#graphics + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Graphics} The Game Object that was created. + */ +GameObjectCreator.register('graphics', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + var graphics = new Graphics(this.scene, config); + + if (config.add) + { + this.scene.sys.displayList.add(graphics); + } + + return graphics; +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + + +/***/ }), +/* 1017 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectCreator = __webpack_require__(15); +var Group = __webpack_require__(94); + +/** + * Creates a new Group Game Object and returns it. + * + * Note: This method will only be available if the Group Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#group + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Group.GroupConfig|Phaser.Types.GameObjects.Group.GroupCreateConfig} config - The configuration object this Game Object will use to create itself. + * + * @return {Phaser.GameObjects.Group} The Game Object that was created. + */ +GameObjectCreator.register('group', function (config) +{ + return new Group(this.scene, null, config); +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + + +/***/ }), +/* 1018 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(29); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var Image = __webpack_require__(95); + +/** + * Creates a new Image Game Object and returns it. + * + * Note: This method will only be available if the Image Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#image + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Image} The Game Object that was created. + */ +GameObjectCreator.register('image', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var key = GetAdvancedValue(config, 'key', null); + var frame = GetAdvancedValue(config, 'frame', null); + + var image = new Image(this.scene, 0, 0, key, frame); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, image, config); + + return image; +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + + +/***/ }), +/* 1019 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var GetFastValue = __webpack_require__(2); +var ParticleEmitterManager = __webpack_require__(188); + +/** + * Creates a new Particle Emitter Manager Game Object and returns it. + * + * Note: This method will only be available if the Particles Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#particles + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created. + */ +GameObjectCreator.register('particles', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var key = GetAdvancedValue(config, 'key', null); + var frame = GetAdvancedValue(config, 'frame', null); + var emitters = GetFastValue(config, 'emitters', null); + + // frame is optional and can contain the emitters array or object if skipped + var manager = new ParticleEmitterManager(this.scene, key, frame, emitters); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + var add = GetFastValue(config, 'add', false); + + if (add) + { + this.displayList.add(manager); + } + + this.updateList.add(manager); + + return manager; +}); + + +/***/ }), +/* 1020 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(29); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var RenderTexture = __webpack_require__(189); + +/** + * Creates a new Render Texture Game Object and returns it. + * + * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#renderTexture + * @since 3.2.0 + * + * @param {Phaser.Types.GameObjects.RenderTexture.RenderTextureConfig} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.RenderTexture} The Game Object that was created. + */ +GameObjectCreator.register('renderTexture', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var x = GetAdvancedValue(config, 'x', 0); + var y = GetAdvancedValue(config, 'y', 0); + var width = GetAdvancedValue(config, 'width', 32); + var height = GetAdvancedValue(config, 'height', 32); + var key = GetAdvancedValue(config, 'key', undefined); + var frame = GetAdvancedValue(config, 'frame', undefined); + + var renderTexture = new RenderTexture(this.scene, x, y, width, height, key, frame); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, renderTexture, config); + + return renderTexture; +}); + + +/***/ }), +/* 1021 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(29); +var BuildGameObjectAnimation = __webpack_require__(363); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var Sprite = __webpack_require__(67); + +/** + * Creates a new Sprite Game Object and returns it. + * + * Note: This method will only be available if the Sprite Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#sprite + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Sprite} The Game Object that was created. + */ +GameObjectCreator.register('sprite', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var key = GetAdvancedValue(config, 'key', null); + var frame = GetAdvancedValue(config, 'frame', null); + + var sprite = new Sprite(this.scene, 0, 0, key, frame); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, sprite, config); + + // Sprite specific config options: + + BuildGameObjectAnimation(sprite, config); + + return sprite; +}); + + +/***/ }), +/* 1022 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BitmapText = __webpack_require__(128); +var BuildGameObject = __webpack_require__(29); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var GetValue = __webpack_require__(6); + +/** + * Creates a new Bitmap Text Game Object and returns it. + * + * Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#bitmapText + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.BitmapText.BitmapTextConfig} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.BitmapText} The Game Object that was created. + */ +GameObjectCreator.register('bitmapText', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var font = GetValue(config, 'font', ''); + var text = GetAdvancedValue(config, 'text', ''); + var size = GetAdvancedValue(config, 'size', false); + var align = GetValue(config, 'align', 0); + + var bitmapText = new BitmapText(this.scene, 0, 0, font, text, size, align); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, bitmapText, config); + + return bitmapText; +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + + +/***/ }), +/* 1023 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(29); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var Text = __webpack_require__(190); + +/** + * Creates a new Text Game Object and returns it. + * + * Note: This method will only be available if the Text Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#text + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Text} The Game Object that was created. + */ +GameObjectCreator.register('text', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + // style Object = { + // font: [ 'font', '16px Courier' ], + // backgroundColor: [ 'backgroundColor', null ], + // fill: [ 'fill', '#fff' ], + // stroke: [ 'stroke', '#fff' ], + // strokeThickness: [ 'strokeThickness', 0 ], + // shadowOffsetX: [ 'shadow.offsetX', 0 ], + // shadowOffsetY: [ 'shadow.offsetY', 0 ], + // shadowColor: [ 'shadow.color', '#000' ], + // shadowBlur: [ 'shadow.blur', 0 ], + // shadowStroke: [ 'shadow.stroke', false ], + // shadowFill: [ 'shadow.fill', false ], + // align: [ 'align', 'left' ], + // maxLines: [ 'maxLines', 0 ], + // fixedWidth: [ 'fixedWidth', false ], + // fixedHeight: [ 'fixedHeight', false ], + // rtl: [ 'rtl', false ] + // } + + var content = GetAdvancedValue(config, 'text', ''); + var style = GetAdvancedValue(config, 'style', null); + + // Padding + // { padding: 2 } + // { padding: { x: , y: }} + // { padding: { left: , top: }} + // { padding: { left: , right: , top: , bottom: }} + + var padding = GetAdvancedValue(config, 'padding', null); + + if (padding !== null) + { + style.padding = padding; + } + + var text = new Text(this.scene, 0, 0, content, style); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, text, config); + + // Text specific config options: + + text.autoRound = GetAdvancedValue(config, 'autoRound', true); + text.resolution = GetAdvancedValue(config, 'resolution', 1); + + return text; +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + + +/***/ }), +/* 1024 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(29); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var TileSprite = __webpack_require__(191); + +/** + * Creates a new TileSprite Game Object and returns it. + * + * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#tileSprite + * @since 3.0.0 + * + * @param {Phaser.Types.GameObjects.TileSprite.TileSpriteConfig} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.TileSprite} The Game Object that was created. + */ +GameObjectCreator.register('tileSprite', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var x = GetAdvancedValue(config, 'x', 0); + var y = GetAdvancedValue(config, 'y', 0); + var width = GetAdvancedValue(config, 'width', 512); + var height = GetAdvancedValue(config, 'height', 512); + var key = GetAdvancedValue(config, 'key', ''); + var frame = GetAdvancedValue(config, 'frame', ''); + + var tile = new TileSprite(this.scene, x, y, width, height, key, frame); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, tile, config); + + return tile; +}); + + +/***/ }), +/* 1025 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var Zone = __webpack_require__(106); + +/** + * Creates a new Zone Game Object and returns it. + * + * Note: This method will only be available if the Zone Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#zone + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * + * @return {Phaser.GameObjects.Zone} The Game Object that was created. + */ +GameObjectCreator.register('zone', function (config) +{ + var x = GetAdvancedValue(config, 'x', 0); + var y = GetAdvancedValue(config, 'y', 0); + var width = GetAdvancedValue(config, 'width', 1); + var height = GetAdvancedValue(config, 'height', width); + + return new Zone(this.scene, x, y, width, height); +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + + +/***/ }), +/* 1026 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(1027); +} + +if (true) +{ + renderCanvas = __webpack_require__(1028); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 1027 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Mesh#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var MeshWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + var pipeline = this.pipeline; + + renderer.setPipeline(pipeline, src); + + var camMatrix = pipeline._tempMatrix1; + var spriteMatrix = pipeline._tempMatrix2; + var calcMatrix = pipeline._tempMatrix3; + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + } + + var frame = src.frame; + var texture = frame.glTexture; + + var vertices = src.vertices; + var uvs = src.uv; + var colors = src.colors; + var alphas = src.alphas; + + var meshVerticesLength = vertices.length; + var vertexCount = Math.floor(meshVerticesLength * 0.5); + + if (pipeline.vertexCount + vertexCount > pipeline.vertexCapacity) + { + pipeline.flush(); + } + + pipeline.setTexture2D(texture, 0); + + var vertexViewF32 = pipeline.vertexViewF32; + var vertexViewU32 = pipeline.vertexViewU32; + + var vertexOffset = (pipeline.vertexCount * pipeline.vertexComponentCount) - 1; + + var colorIndex = 0; + var tintEffect = src.tintFill; + + for (var i = 0; i < meshVerticesLength; i += 2) + { + var x = vertices[i + 0]; + var y = vertices[i + 1]; + + var tx = x * calcMatrix.a + y * calcMatrix.c + calcMatrix.e; + var ty = x * calcMatrix.b + y * calcMatrix.d + calcMatrix.f; + + if (camera.roundPixels) + { + tx = Math.round(tx); + ty = Math.round(ty); + } + + vertexViewF32[++vertexOffset] = tx; + vertexViewF32[++vertexOffset] = ty; + vertexViewF32[++vertexOffset] = uvs[i + 0]; + vertexViewF32[++vertexOffset] = uvs[i + 1]; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = Utils.getTintAppendFloatAlpha(colors[colorIndex], camera.alpha * alphas[colorIndex]); + + colorIndex++; + } + + pipeline.vertexCount += vertexCount; +}; + +module.exports = MeshWebGLRenderer; + + +/***/ }), +/* 1028 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a stub function for Mesh.Render. There is no Canvas renderer for Mesh objects. + * + * @method Phaser.GameObjects.Mesh#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var MeshCanvasRenderer = function () +{ +}; + +module.exports = MeshCanvasRenderer; + + +/***/ }), +/* 1029 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(1030); +} + +if (true) +{ + renderCanvas = __webpack_require__(1031); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 1030 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Shader#renderWebGL + * @since 3.17.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Shader} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var ShaderWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + if (!src.shader) + { + return; + } + + var pipeline = renderer.currentPipeline; + + renderer.clearPipeline(); + + var camMatrix = src._tempMatrix1; + var shapeMatrix = src._tempMatrix2; + var calcMatrix = src._tempMatrix3; + + shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + shapeMatrix.e = src.x; + shapeMatrix.f = src.y; + } + else + { + shapeMatrix.e -= camera.scrollX * src.scrollFactorX; + shapeMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + camMatrix.multiply(shapeMatrix, calcMatrix); + + // Renderer size changed? + if (renderer.width !== src._rendererWidth || renderer.height !== src._rendererHeight) + { + src.projOrtho(0, renderer.width, renderer.height, 0); + } + + src.load(calcMatrix.matrix); + src.flush(); + + renderer.rebindPipeline(pipeline); +}; + +module.exports = ShaderWebGLRenderer; + + +/***/ }), +/* 1031 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a stub function for Shader.Render. There is no Canvas renderer for Shader objects. + * + * @method Phaser.GameObjects.Shader#renderCanvas + * @since 3.17.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Shader} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var ShaderCanvasRenderer = function () +{ +}; + +module.exports = ShaderCanvasRenderer; + + +/***/ }), +/* 1032 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Mesh = __webpack_require__(129); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Mesh Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#mesh + * @webglOnly + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {number[]} vertices - An array containing the vertices data for this Mesh. + * @param {number[]} uv - An array containing the uv data for this Mesh. + * @param {number[]} colors - An array containing the color data for this Mesh. + * @param {number[]} alphas - An array containing the alpha data for this Mesh. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.GameObjects.Mesh} The Game Object that was created. + */ +if (true) +{ + GameObjectFactory.register('mesh', function (x, y, vertices, uv, colors, alphas, texture, frame) + { + return this.displayList.add(new Mesh(this.scene, x, y, vertices, uv, colors, alphas, texture, frame)); + }); +} + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 1033 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Quad = __webpack_require__(194); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Quad Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#quad + * @webglOnly + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.GameObjects.Quad} The Game Object that was created. + */ +if (true) +{ + GameObjectFactory.register('quad', function (x, y, key, frame) + { + return this.displayList.add(new Quad(this.scene, x, y, key, frame)); + }); +} + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 1034 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Shader = __webpack_require__(195); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Shader Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#shader + * @webglOnly + * @since 3.17.0 + * + * @param {(string|Phaser.Display.BaseShader)} key - The key of the shader to use from the shader cache, or a BaseShader instance. + * @param {number} [x=0] - The horizontal position of this Game Object in the world. + * @param {number} [y=0] - The vertical position of this Game Object in the world. + * @param {number} [width=128] - The width of the Game Object. + * @param {number} [height=128] - The height of the Game Object. + * @param {string[]} [textures] - Optional array of texture keys to bind to the iChannel0...3 uniforms. The textures must already exist in the Texture Manager. + * + * @return {Phaser.GameObjects.Shader} The Game Object that was created. + */ +if (true) +{ + GameObjectFactory.register('shader', function (key, x, y, width, height, textures) + { + return this.displayList.add(new Shader(this.scene, key, x, y, width, height, textures)); + }); +} + + +/***/ }), +/* 1035 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(29); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var GetValue = __webpack_require__(6); +var Mesh = __webpack_require__(129); + +/** + * Creates a new Mesh Game Object and returns it. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#mesh + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Mesh} The Game Object that was created. + */ +GameObjectCreator.register('mesh', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var key = GetAdvancedValue(config, 'key', null); + var frame = GetAdvancedValue(config, 'frame', null); + var vertices = GetValue(config, 'vertices', []); + var colors = GetValue(config, 'colors', []); + var alphas = GetValue(config, 'alphas', []); + var uv = GetValue(config, 'uv', []); + + var mesh = new Mesh(this.scene, 0, 0, vertices, uv, colors, alphas, key, frame); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, mesh, config); + + return mesh; +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + + +/***/ }), +/* 1036 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(29); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var Quad = __webpack_require__(194); + +/** + * Creates a new Quad Game Object and returns it. + * + * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#quad + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Quad} The Game Object that was created. + */ +GameObjectCreator.register('quad', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var x = GetAdvancedValue(config, 'x', 0); + var y = GetAdvancedValue(config, 'y', 0); + var key = GetAdvancedValue(config, 'key', null); + var frame = GetAdvancedValue(config, 'frame', null); + + var quad = new Quad(this.scene, x, y, key, frame); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, quad, config); + + return quad; +}); + + +/***/ }), +/* 1037 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(29); +var GameObjectCreator = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(14); +var Shader = __webpack_require__(195); + +/** + * Creates a new Shader Game Object and returns it. + * + * Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#shader + * @since 3.17.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Shader} The Game Object that was created. + */ +GameObjectCreator.register('shader', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var key = GetAdvancedValue(config, 'key', null); + var x = GetAdvancedValue(config, 'x', 0); + var y = GetAdvancedValue(config, 'y', 0); + var width = GetAdvancedValue(config, 'width', 128); + var height = GetAdvancedValue(config, 'height', 128); + + var shader = new Shader(this.scene, key, x, y, width, height); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, shader, config); + + return shader; +}); + +// When registering a factory function 'this' refers to the GameObjectCreator context. + + +/***/ }), +/* 1038 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var LightsManager = __webpack_require__(400); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); + +/** + * @classdesc + * A Scene plugin that provides a {@link Phaser.GameObjects.LightsManager} for the Light2D pipeline. + * + * Available from within a Scene via `this.lights`. + * + * Add Lights using the {@link Phaser.GameObjects.LightsManager#addLight} method: + * + * ```javascript + * // Enable the Lights Manager because it is disabled by default + * this.lights.enable(); + * + * // Create a Light at [400, 300] with a radius of 200 + * this.lights.addLight(400, 300, 200); + * ``` + * + * For Game Objects to be affected by the Lights when rendered, you will need to set them to use the `Light2D` pipeline like so: + * + * ```javascript + * sprite.setPipeline('Light2D'); + * ``` + * + * @class LightsPlugin + * @extends Phaser.GameObjects.LightsManager + * @memberof Phaser.GameObjects + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene that this Lights Plugin belongs to. + */ +var LightsPlugin = new Class({ + + Extends: LightsManager, + + initialize: + + function LightsPlugin (scene) + { + /** + * A reference to the Scene that this Lights Plugin belongs to. + * + * @name Phaser.GameObjects.LightsPlugin#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Scene's systems. + * + * @name Phaser.GameObjects.LightsPlugin#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + if (!scene.sys.settings.isBooted) + { + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + } + + LightsManager.call(this); + }, + + /** + * Boot the Lights Plugin. + * + * @method Phaser.GameObjects.LightsPlugin#boot + * @since 3.0.0 + */ + boot: function () + { + var eventEmitter = this.systems.events; + + eventEmitter.on(SceneEvents.SHUTDOWN, this.shutdown, this); + eventEmitter.on(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * Destroy the Lights Plugin. + * + * Cleans up all references. + * + * @method Phaser.GameObjects.LightsPlugin#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene = undefined; + this.systems = undefined; + } + +}); + +PluginCache.register('LightsPlugin', LightsPlugin, 'lights'); + +module.exports = LightsPlugin; + + +/***/ }), +/* 1039 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Circle = __webpack_require__(77); + +Circle.Area = __webpack_require__(1040); +Circle.Circumference = __webpack_require__(243); +Circle.CircumferencePoint = __webpack_require__(144); +Circle.Clone = __webpack_require__(1041); +Circle.Contains = __webpack_require__(46); +Circle.ContainsPoint = __webpack_require__(1042); +Circle.ContainsRect = __webpack_require__(1043); +Circle.CopyFrom = __webpack_require__(1044); +Circle.Equals = __webpack_require__(1045); +Circle.GetBounds = __webpack_require__(1046); +Circle.GetPoint = __webpack_require__(241); +Circle.GetPoints = __webpack_require__(242); +Circle.Offset = __webpack_require__(1047); +Circle.OffsetPoint = __webpack_require__(1048); +Circle.Random = __webpack_require__(145); + +module.exports = Circle; + + +/***/ }), +/* 1040 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the area of the circle. + * + * @function Phaser.Geom.Circle.Area + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The Circle to get the area of. + * + * @return {number} The area of the Circle. + */ +var Area = function (circle) +{ + return (circle.radius > 0) ? Math.PI * circle.radius * circle.radius : 0; +}; + +module.exports = Area; + + +/***/ }), +/* 1041 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Circle = __webpack_require__(77); + +/** + * Creates a new Circle instance based on the values contained in the given source. + * + * @function Phaser.Geom.Circle.Clone + * @since 3.0.0 + * + * @param {(Phaser.Geom.Circle|object)} source - The Circle to be cloned. Can be an instance of a Circle or a circle-like object, with x, y and radius properties. + * + * @return {Phaser.Geom.Circle} A clone of the source Circle. + */ +var Clone = function (source) +{ + return new Circle(source.x, source.y, source.radius); +}; + +module.exports = Clone; + + +/***/ }), +/* 1042 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Contains = __webpack_require__(46); + +/** + * Check to see if the Circle contains the given Point object. + * + * @function Phaser.Geom.Circle.ContainsPoint + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The Circle to check. + * @param {(Phaser.Geom.Point|object)} point - The Point object to check if it's within the Circle or not. + * + * @return {boolean} True if the Point coordinates are within the circle, otherwise false. + */ +var ContainsPoint = function (circle, point) +{ + return Contains(circle, point.x, point.y); +}; + +module.exports = ContainsPoint; + + +/***/ }), +/* 1043 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Contains = __webpack_require__(46); + +/** + * Check to see if the Circle contains all four points of the given Rectangle object. + * + * @function Phaser.Geom.Circle.ContainsRect + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The Circle to check. + * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle object to check if it's within the Circle or not. + * + * @return {boolean} True if all of the Rectangle coordinates are within the circle, otherwise false. + */ +var ContainsRect = function (circle, rect) +{ + return ( + Contains(circle, rect.x, rect.y) && + Contains(circle, rect.right, rect.y) && + Contains(circle, rect.x, rect.bottom) && + Contains(circle, rect.right, rect.bottom) + ); +}; + +module.exports = ContainsRect; + + +/***/ }), +/* 1044 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Copies the `x`, `y` and `radius` properties from the `source` Circle + * into the given `dest` Circle, then returns the `dest` Circle. + * + * @function Phaser.Geom.Circle.CopyFrom + * @since 3.0.0 + * + * @generic {Phaser.Geom.Circle} O - [dest,$return] + * + * @param {Phaser.Geom.Circle} source - The source Circle to copy the values from. + * @param {Phaser.Geom.Circle} dest - The destination Circle to copy the values to. + * + * @return {Phaser.Geom.Circle} The destination Circle. + */ +var CopyFrom = function (source, dest) +{ + return dest.setTo(source.x, source.y, source.radius); +}; + +module.exports = CopyFrom; + + +/***/ }), +/* 1045 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compares the `x`, `y` and `radius` properties of the two given Circles. + * Returns `true` if they all match, otherwise returns `false`. + * + * @function Phaser.Geom.Circle.Equals + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The first Circle to compare. + * @param {Phaser.Geom.Circle} toCompare - The second Circle to compare. + * + * @return {boolean} `true` if the two Circles equal each other, otherwise `false`. + */ +var Equals = function (circle, toCompare) +{ + return ( + circle.x === toCompare.x && + circle.y === toCompare.y && + circle.radius === toCompare.radius + ); +}; + +module.exports = Equals; + + +/***/ }), +/* 1046 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); + +/** + * Returns the bounds of the Circle object. + * + * @function Phaser.Geom.Circle.GetBounds + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * + * @param {Phaser.Geom.Circle} circle - The Circle to get the bounds from. + * @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the circle bounds in. If not given a new Rectangle will be created. + * + * @return {(Phaser.Geom.Rectangle|object)} The Rectangle object containing the Circles bounds. + */ +var GetBounds = function (circle, out) +{ + if (out === undefined) { out = new Rectangle(); } + + out.x = circle.left; + out.y = circle.top; + out.width = circle.diameter; + out.height = circle.diameter; + + return out; +}; + +module.exports = GetBounds; + + +/***/ }), +/* 1047 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Offsets the Circle by the values given. + * + * @function Phaser.Geom.Circle.Offset + * @since 3.0.0 + * + * @generic {Phaser.Geom.Circle} O - [circle,$return] + * + * @param {Phaser.Geom.Circle} circle - The Circle to be offset (translated.) + * @param {number} x - The amount to horizontally offset the Circle by. + * @param {number} y - The amount to vertically offset the Circle by. + * + * @return {Phaser.Geom.Circle} The Circle that was offset. + */ +var Offset = function (circle, x, y) +{ + circle.x += x; + circle.y += y; + + return circle; +}; + +module.exports = Offset; + + +/***/ }), +/* 1048 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Offsets the Circle by the values given in the `x` and `y` properties of the Point object. + * + * @function Phaser.Geom.Circle.OffsetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Circle} O - [circle,$return] + * + * @param {Phaser.Geom.Circle} circle - The Circle to be offset (translated.) + * @param {(Phaser.Geom.Point|object)} point - The Point object containing the values to offset the Circle by. + * + * @return {Phaser.Geom.Circle} The Circle that was offset. + */ +var OffsetPoint = function (circle, point) +{ + circle.x += point.x; + circle.y += point.y; + + return circle; +}; + +module.exports = OffsetPoint; + + +/***/ }), +/* 1049 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Ellipse = __webpack_require__(92); + +Ellipse.Area = __webpack_require__(1050); +Ellipse.Circumference = __webpack_require__(370); +Ellipse.CircumferencePoint = __webpack_require__(187); +Ellipse.Clone = __webpack_require__(1051); +Ellipse.Contains = __webpack_require__(93); +Ellipse.ContainsPoint = __webpack_require__(1052); +Ellipse.ContainsRect = __webpack_require__(1053); +Ellipse.CopyFrom = __webpack_require__(1054); +Ellipse.Equals = __webpack_require__(1055); +Ellipse.GetBounds = __webpack_require__(1056); +Ellipse.GetPoint = __webpack_require__(368); +Ellipse.GetPoints = __webpack_require__(369); +Ellipse.Offset = __webpack_require__(1057); +Ellipse.OffsetPoint = __webpack_require__(1058); +Ellipse.Random = __webpack_require__(152); + +module.exports = Ellipse; + + +/***/ }), +/* 1050 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the area of the Ellipse. + * + * @function Phaser.Geom.Ellipse.Area + * @since 3.0.0 + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the area of. + * + * @return {number} The area of the Ellipse. + */ +var Area = function (ellipse) +{ + if (ellipse.isEmpty()) + { + return 0; + } + + // units squared + return (ellipse.getMajorRadius() * ellipse.getMinorRadius() * Math.PI); +}; + +module.exports = Area; + + +/***/ }), +/* 1051 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Ellipse = __webpack_require__(92); + +/** + * Creates a new Ellipse instance based on the values contained in the given source. + * + * @function Phaser.Geom.Ellipse.Clone + * @since 3.0.0 + * + * @param {Phaser.Geom.Ellipse} source - The Ellipse to be cloned. Can be an instance of an Ellipse or a ellipse-like object, with x, y, width and height properties. + * + * @return {Phaser.Geom.Ellipse} A clone of the source Ellipse. + */ +var Clone = function (source) +{ + return new Ellipse(source.x, source.y, source.width, source.height); +}; + +module.exports = Clone; + + +/***/ }), +/* 1052 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Contains = __webpack_require__(93); + +/** + * Check to see if the Ellipse contains the given Point object. + * + * @function Phaser.Geom.Ellipse.ContainsPoint + * @since 3.0.0 + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to check. + * @param {(Phaser.Geom.Point|object)} point - The Point object to check if it's within the Circle or not. + * + * @return {boolean} True if the Point coordinates are within the circle, otherwise false. + */ +var ContainsPoint = function (ellipse, point) +{ + return Contains(ellipse, point.x, point.y); +}; + +module.exports = ContainsPoint; + + +/***/ }), +/* 1053 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Contains = __webpack_require__(93); + +/** + * Check to see if the Ellipse contains all four points of the given Rectangle object. + * + * @function Phaser.Geom.Ellipse.ContainsRect + * @since 3.0.0 + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to check. + * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle object to check if it's within the Ellipse or not. + * + * @return {boolean} True if all of the Rectangle coordinates are within the ellipse, otherwise false. + */ +var ContainsRect = function (ellipse, rect) +{ + return ( + Contains(ellipse, rect.x, rect.y) && + Contains(ellipse, rect.right, rect.y) && + Contains(ellipse, rect.x, rect.bottom) && + Contains(ellipse, rect.right, rect.bottom) + ); +}; + +module.exports = ContainsRect; + + +/***/ }), +/* 1054 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Copies the `x`, `y`, `width` and `height` properties from the `source` Ellipse + * into the given `dest` Ellipse, then returns the `dest` Ellipse. + * + * @function Phaser.Geom.Ellipse.CopyFrom + * @since 3.0.0 + * + * @generic {Phaser.Geom.Ellipse} O - [dest,$return] + * + * @param {Phaser.Geom.Ellipse} source - The source Ellipse to copy the values from. + * @param {Phaser.Geom.Ellipse} dest - The destination Ellipse to copy the values to. + * + * @return {Phaser.Geom.Ellipse} The destination Ellipse. + */ +var CopyFrom = function (source, dest) +{ + return dest.setTo(source.x, source.y, source.width, source.height); +}; + +module.exports = CopyFrom; + + +/***/ }), +/* 1055 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compares the `x`, `y`, `width` and `height` properties of the two given Ellipses. + * Returns `true` if they all match, otherwise returns `false`. + * + * @function Phaser.Geom.Ellipse.Equals + * @since 3.0.0 + * + * @param {Phaser.Geom.Ellipse} ellipse - The first Ellipse to compare. + * @param {Phaser.Geom.Ellipse} toCompare - The second Ellipse to compare. + * + * @return {boolean} `true` if the two Ellipse equal each other, otherwise `false`. + */ +var Equals = function (ellipse, toCompare) +{ + return ( + ellipse.x === toCompare.x && + ellipse.y === toCompare.y && + ellipse.width === toCompare.width && + ellipse.height === toCompare.height + ); +}; + +module.exports = Equals; + + +/***/ }), +/* 1056 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); + +/** + * Returns the bounds of the Ellipse object. + * + * @function Phaser.Geom.Ellipse.GetBounds + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the bounds from. + * @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the ellipse bounds in. If not given a new Rectangle will be created. + * + * @return {(Phaser.Geom.Rectangle|object)} The Rectangle object containing the Ellipse bounds. + */ +var GetBounds = function (ellipse, out) +{ + if (out === undefined) { out = new Rectangle(); } + + out.x = ellipse.left; + out.y = ellipse.top; + out.width = ellipse.width; + out.height = ellipse.height; + + return out; +}; + +module.exports = GetBounds; + + +/***/ }), +/* 1057 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Offsets the Ellipse by the values given. + * + * @function Phaser.Geom.Ellipse.Offset + * @since 3.0.0 + * + * @generic {Phaser.Geom.Ellipse} O - [ellipse,$return] + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to be offset (translated.) + * @param {number} x - The amount to horizontally offset the Ellipse by. + * @param {number} y - The amount to vertically offset the Ellipse by. + * + * @return {Phaser.Geom.Ellipse} The Ellipse that was offset. + */ +var Offset = function (ellipse, x, y) +{ + ellipse.x += x; + ellipse.y += y; + + return ellipse; +}; + +module.exports = Offset; + + +/***/ }), +/* 1058 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Offsets the Ellipse by the values given in the `x` and `y` properties of the Point object. + * + * @function Phaser.Geom.Ellipse.OffsetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Ellipse} O - [ellipse,$return] + * + * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to be offset (translated.) + * @param {(Phaser.Geom.Point|object)} point - The Point object containing the values to offset the Ellipse by. + * + * @return {Phaser.Geom.Ellipse} The Ellipse that was offset. + */ +var OffsetPoint = function (ellipse, point) +{ + ellipse.x += point.x; + ellipse.y += point.y; + + return ellipse; +}; + +module.exports = OffsetPoint; + + +/***/ }), +/* 1059 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); +var CircleToCircle = __webpack_require__(403); + +/** + * Checks if two Circles intersect and returns the intersection points as a Point object array. + * + * @function Phaser.Geom.Intersects.GetCircleToCircle + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circleA - The first Circle to check for intersection. + * @param {Phaser.Geom.Circle} circleB - The second Circle to check for intersection. + * @param {array} [out] - An optional array in which to store the points of intersection. + * + * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array. + */ +var GetCircleToCircle = function (circleA, circleB, out) +{ + if (out === undefined) { out = []; } + + if (CircleToCircle(circleA, circleB)) + { + var x0 = circleA.x; + var y0 = circleA.y; + var r0 = circleA.radius; + + var x1 = circleB.x; + var y1 = circleB.y; + var r1 = circleB.radius; + + var coefficientA, coefficientB, coefficientC, lambda, x; + + if (y0 === y1) + { + x = ((r1 * r1) - (r0 * r0) - (x1 * x1) + (x0 * x0)) / (2 * (x0 - x1)); + + coefficientA = 1; + coefficientB = -2 * y1; + coefficientC = (x1 * x1) + (x * x) - (2 * x1 * x) + (y1 * y1) - (r1 * r1); + + lambda = (coefficientB * coefficientB) - (4 * coefficientA * coefficientC); + + if (lambda === 0) + { + out.push(new Point(x, (-coefficientB / (2 * coefficientA)))); + } + else if (lambda > 0) + { + out.push(new Point(x, (-coefficientB + Math.sqrt(lambda)) / (2 * coefficientA))); + out.push(new Point(x, (-coefficientB - Math.sqrt(lambda)) / (2 * coefficientA))); + } + } + else + { + var v1 = (x0 - x1) / (y0 - y1); + var n = (r1 * r1 - r0 * r0 - x1 * x1 + x0 * x0 - y1 * y1 + y0 * y0) / (2 * (y0 - y1)); + + coefficientA = (v1 * v1) + 1; + coefficientB = (2 * y0 * v1) - (2 * n * v1) - (2 * x0); + coefficientC = (x0 * x0) + (y0 * y0) + (n * n) - (r0 * r0) - (2 * y0 * n); + + lambda = (coefficientB * coefficientB) - (4 * coefficientA * coefficientC); + + if (lambda === 0) + { + x = (-coefficientB / (2 * coefficientA)); + out.push(new Point(x, (n - (x * v1)))); + } + else if (lambda > 0) + { + x = (-coefficientB + Math.sqrt(lambda)) / (2 * coefficientA); + out.push(new Point(x, (n - (x * v1)))); + x = (-coefficientB - Math.sqrt(lambda)) / (2 * coefficientA); + out.push(new Point(x, (n - (x * v1)))); + } + } + } + + return out; +}; + +module.exports = GetCircleToCircle; + + +/***/ }), +/* 1060 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetLineToCircle = __webpack_require__(196); +var CircleToRectangle = __webpack_require__(404); + +/** + * Checks for intersection between a circle and a rectangle, + * and returns the intersection points as a Point object array. + * + * @function Phaser.Geom.Intersects.GetCircleToRectangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Circle} circle - The circle to be checked. + * @param {Phaser.Geom.Rectangle} rect - The rectangle to be checked. + * @param {array} [out] - An optional array in which to store the points of intersection. + * + * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array. + */ +var GetCircleToRectangle = function (circle, rect, out) +{ + if (out === undefined) { out = []; } + + if (CircleToRectangle(circle, rect)) + { + var lineA = rect.getLineA(); + var lineB = rect.getLineB(); + var lineC = rect.getLineC(); + var lineD = rect.getLineD(); + + GetLineToCircle(lineA, circle, out); + GetLineToCircle(lineB, circle, out); + GetLineToCircle(lineC, circle, out); + GetLineToCircle(lineD, circle, out); + } + + return out; +}; + +module.exports = GetCircleToRectangle; + + +/***/ }), +/* 1061 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); +var RectangleToRectangle = __webpack_require__(130); + +/** + * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. + * + * If optional `output` parameter is omitted, new Rectangle object is created and returned. If there is intersection, it will contain intersection area. If there is no intersection, it wil be empty Rectangle (all values set to zero). + * + * If Rectangle object is passed as `output` and there is intersection, then intersection area data will be loaded into it and it will be returned. If there is no intersetion, it will be returned without any change. + * + * @function Phaser.Geom.Intersects.GetRectangleIntersection + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [output,$return] + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle object. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle object. + * @param {Phaser.Geom.Rectangle} [output] - Optional Rectangle object. If given, the intersection data will be loaded into it (in case of no intersection, it will be left unchanged). Otherwise, new Rectangle object will be created and returned with either intersection data or empty (all values set to zero), if there is no intersection. + * + * @return {Phaser.Geom.Rectangle} A rectangle object with intersection data. + */ +var GetRectangleIntersection = function (rectA, rectB, output) +{ + if (output === undefined) { output = new Rectangle(); } + + if (RectangleToRectangle(rectA, rectB)) + { + output.x = Math.max(rectA.x, rectB.x); + output.y = Math.max(rectA.y, rectB.y); + output.width = Math.min(rectA.right, rectB.right) - output.x; + output.height = Math.min(rectA.bottom, rectB.bottom) - output.y; + } + + return output; +}; + +module.exports = GetRectangleIntersection; + + +/***/ }), +/* 1062 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetLineToRectangle = __webpack_require__(198); +var RectangleToRectangle = __webpack_require__(130); + +/** + * Checks if two Rectangles intersect and returns the intersection points as a Point object array. + * + * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle. + * + * @function Phaser.Geom.Intersects.GetRectangleToRectangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to check for intersection. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to check for intersection. + * @param {array} [out] - An optional array in which to store the points of intersection. + * + * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array. + */ +var GetRectangleToRectangle = function (rectA, rectB, out) +{ + if (out === undefined) { out = []; } + + if (RectangleToRectangle(rectA, rectB)) + { + var lineA = rectA.getLineA(); + var lineB = rectA.getLineB(); + var lineC = rectA.getLineC(); + var lineD = rectA.getLineD(); + + GetLineToRectangle(lineA, rectB, out); + GetLineToRectangle(lineB, rectB, out); + GetLineToRectangle(lineC, rectB, out); + GetLineToRectangle(lineD, rectB, out); + } + + return out; +}; + +module.exports = GetRectangleToRectangle; + + +/***/ }), +/* 1063 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RectangleToTriangle = __webpack_require__(406); +var GetLineToRectangle = __webpack_require__(198); + +/** + * Checks for intersection between Rectangle shape and Triangle shape, + * and returns the intersection points as a Point object array. + * + * @function Phaser.Geom.Intersects.GetRectangleToTriangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - Rectangle object to test. + * @param {Phaser.Geom.Triangle} triangle - Triangle object to test. + * @param {array} [out] - An optional array in which to store the points of intersection. + * + * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array. + */ +var GetRectangleToTriangle = function (rect, triangle, out) +{ + if (out === undefined) { out = []; } + + if (RectangleToTriangle(rect, triangle)) + { + var lineA = triangle.getLineA(); + var lineB = triangle.getLineB(); + var lineC = triangle.getLineC(); + + GetLineToRectangle(lineA, rect, out); + GetLineToRectangle(lineB, rect, out); + GetLineToRectangle(lineC, rect, out); + } + + return out; +}; + +module.exports = GetRectangleToTriangle; + + +/***/ }), +/* 1064 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetLineToCircle = __webpack_require__(196); +var TriangleToCircle = __webpack_require__(408); + +/** + * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array. + * + * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection. + * + * @function Phaser.Geom.Intersects.GetTriangleToCircle + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to check for intersection. + * @param {Phaser.Geom.Circle} circle - The Circle to check for intersection. + * @param {array} [out] - An optional array in which to store the points of intersection. + * + * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array. + */ +var GetTriangleToCircle = function (triangle, circle, out) +{ + if (out === undefined) { out = []; } + + if (TriangleToCircle(triangle, circle)) + { + var lineA = triangle.getLineA(); + var lineB = triangle.getLineB(); + var lineC = triangle.getLineC(); + + GetLineToCircle(lineA, circle, out); + GetLineToCircle(lineB, circle, out); + GetLineToCircle(lineC, circle, out); + } + + return out; +}; + +module.exports = GetTriangleToCircle; + + +/***/ }), +/* 1065 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TriangleToTriangle = __webpack_require__(411); +var GetTriangleToLine = __webpack_require__(409); + +/** + * Checks if two Triangles intersect, and returns the intersection points as a Point object array. + * + * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid". + * + * @function Phaser.Geom.Intersects.GetTriangleToTriangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangleA - The first Triangle to check for intersection. + * @param {Phaser.Geom.Triangle} triangleB - The second Triangle to check for intersection. + * @param {array} [out] - An optional array in which to store the points of intersection. + * + * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array. + */ +var GetTriangleToTriangle = function (triangleA, triangleB, out) +{ + if (out === undefined) { out = []; } + + if (TriangleToTriangle(triangleA, triangleB)) + { + var lineA = triangleB.getLineA(); + var lineB = triangleB.getLineB(); + var lineC = triangleB.getLineC(); + + GetTriangleToLine(triangleA, lineA, out); + GetTriangleToLine(triangleA, lineB, out); + GetTriangleToLine(triangleA, lineC, out); + } + + return out; +}; + +module.exports = GetTriangleToTriangle; + + +/***/ }), +/* 1066 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PointToLine = __webpack_require__(413); + +/** + * Checks if a Point is located on the given line segment. + * + * @function Phaser.Geom.Intersects.PointToLineSegment + * @since 3.0.0 + * + * @param {Phaser.Geom.Point} point - The Point to check for intersection. + * @param {Phaser.Geom.Line} line - The line segment to check for intersection. + * + * @return {boolean} `true` if the Point is on the given line segment, otherwise `false`. + */ +var PointToLineSegment = function (point, line) +{ + if (!PointToLine(point, line)) + { + return false; + } + + var xMin = Math.min(line.x1, line.x2); + var xMax = Math.max(line.x1, line.x2); + var yMin = Math.min(line.y1, line.y2); + var yMax = Math.max(line.y1, line.y2); + + return ((point.x >= xMin && point.x <= xMax) && (point.y >= yMin && point.y <= yMax)); +}; + +module.exports = PointToLineSegment; + + +/***/ }), +/* 1067 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check if rectangle intersects with values. + * + * @function Phaser.Geom.Intersects.RectangleToValues + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The rectangle object + * @param {number} left - The x coordinate of the left of the Rectangle. + * @param {number} right - The x coordinate of the right of the Rectangle. + * @param {number} top - The y coordinate of the top of the Rectangle. + * @param {number} bottom - The y coordinate of the bottom of the Rectangle. + * @param {number} [tolerance=0] - Tolerance allowed in the calculation, expressed in pixels. + * + * @return {boolean} Returns true if there is an intersection. + */ +var RectangleToValues = function (rect, left, right, top, bottom, tolerance) +{ + if (tolerance === undefined) { tolerance = 0; } + + return !( + left > rect.right + tolerance || + right < rect.left - tolerance || + top > rect.bottom + tolerance || + bottom < rect.top - tolerance + ); +}; + +module.exports = RectangleToValues; + + +/***/ }), +/* 1068 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Line = __webpack_require__(54); + +Line.Angle = __webpack_require__(83); +Line.BresenhamPoints = __webpack_require__(263); +Line.CenterOn = __webpack_require__(1069); +Line.Clone = __webpack_require__(1070); +Line.CopyFrom = __webpack_require__(1071); +Line.Equals = __webpack_require__(1072); +Line.Extend = __webpack_require__(1073); +Line.GetMidPoint = __webpack_require__(1074); +Line.GetNearestPoint = __webpack_require__(1075); +Line.GetNormal = __webpack_require__(1076); +Line.GetPoint = __webpack_require__(250); +Line.GetPoints = __webpack_require__(148); +Line.GetShortestDistance = __webpack_require__(1077); +Line.Height = __webpack_require__(1078); +Line.Length = __webpack_require__(55); +Line.NormalAngle = __webpack_require__(414); +Line.NormalX = __webpack_require__(1079); +Line.NormalY = __webpack_require__(1080); +Line.Offset = __webpack_require__(1081); +Line.PerpSlope = __webpack_require__(1082); +Line.Random = __webpack_require__(149); +Line.ReflectAngle = __webpack_require__(1083); +Line.Rotate = __webpack_require__(1084); +Line.RotateAroundPoint = __webpack_require__(1085); +Line.RotateAroundXY = __webpack_require__(200); +Line.SetToAngle = __webpack_require__(1086); +Line.Slope = __webpack_require__(1087); +Line.Width = __webpack_require__(1088); + +module.exports = Line; + + +/***/ }), +/* 1069 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + + +/** + * Center a line on the given coordinates. + * + * @function Phaser.Geom.Line.CenterOn + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to center. + * @param {number} x - The horizontal coordinate to center the line on. + * @param {number} y - The vertical coordinate to center the line on. + * + * @return {Phaser.Geom.Line} The centered line. + */ +var CenterOn = function (line, x, y) +{ + var tx = x - ((line.x1 + line.x2) / 2); + var ty = y - ((line.y1 + line.y2) / 2); + + line.x1 += tx; + line.y1 += ty; + + line.x2 += tx; + line.y2 += ty; + + return line; +}; + +module.exports = CenterOn; + + +/***/ }), +/* 1070 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Line = __webpack_require__(54); + +/** + * Clone the given line. + * + * @function Phaser.Geom.Line.Clone + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} source - The source line to clone. + * + * @return {Phaser.Geom.Line} The cloned line. + */ +var Clone = function (source) +{ + return new Line(source.x1, source.y1, source.x2, source.y2); +}; + +module.exports = Clone; + + +/***/ }), +/* 1071 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Copy the values of one line to a destination line. + * + * @function Phaser.Geom.Line.CopyFrom + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [dest,$return] + * + * @param {Phaser.Geom.Line} source - The source line to copy the values from. + * @param {Phaser.Geom.Line} dest - The destination line to copy the values to. + * + * @return {Phaser.Geom.Line} The destination line. + */ +var CopyFrom = function (source, dest) +{ + return dest.setTo(source.x1, source.y1, source.x2, source.y2); +}; + +module.exports = CopyFrom; + + +/***/ }), +/* 1072 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compare two lines for strict equality. + * + * @function Phaser.Geom.Line.Equals + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The first line to compare. + * @param {Phaser.Geom.Line} toCompare - The second line to compare. + * + * @return {boolean} Whether the two lines are equal. + */ +var Equals = function (line, toCompare) +{ + return ( + line.x1 === toCompare.x1 && + line.y1 === toCompare.y1 && + line.x2 === toCompare.x2 && + line.y2 === toCompare.y2 + ); +}; + +module.exports = Equals; + + +/***/ }), +/* 1073 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Length = __webpack_require__(55); + +/** + * Extends the start and end points of a Line by the given amounts. + * + * The amounts can be positive or negative. Positive points will increase the length of the line, + * while negative ones will decrease it. + * + * If no `right` value is provided it will extend the length of the line equally in both directions. + * + * Pass a value of zero to leave the start or end point unchanged. + * + * @function Phaser.Geom.Line.Extend + * @since 3.16.0 + * + * @param {Phaser.Geom.Line} line - The line instance to extend. + * @param {number} left - The amount to extend the start of the line by. + * @param {number} [right] - The amount to extend the end of the line by. If not given it will be set to the `left` value. + * + * @return {Phaser.Geom.Line} The modified Line instance. + */ +var Extend = function (line, left, right) +{ + if (right === undefined) { right = left; } + + var length = Length(line); + + var slopX = line.x2 - line.x1; + var slopY = line.y2 - line.y1; + + if (left) + { + line.x1 = line.x1 - slopX / length * left; + line.y1 = line.y1 - slopY / length * left; + } + + if (right) + { + line.x2 = line.x2 + slopX / length * right; + line.y2 = line.y2 + slopY / length * right; + } + + return line; +}; + +module.exports = Extend; + + +/***/ }), +/* 1074 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Get the midpoint of the given line. + * + * @function Phaser.Geom.Line.GetMidPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Line} line - The line to get the midpoint of. + * @param {(Phaser.Geom.Point|object)} [out] - An optional point object to store the midpoint in. + * + * @return {(Phaser.Geom.Point|object)} The midpoint of the Line. + */ +var GetMidPoint = function (line, out) +{ + if (out === undefined) { out = new Point(); } + + out.x = (line.x1 + line.x2) / 2; + out.y = (line.y1 + line.y2) / 2; + + return out; +}; + +module.exports = GetMidPoint; + + +/***/ }), +/* 1075 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Get the nearest point on a line perpendicular to the given point. + * + * @function Phaser.Geom.Line.GetNearestPoint + * @since 3.16.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Line} line - The line to get the nearest point on. + * @param {(Phaser.Geom.Point|object)} point - The point to get the nearest point to. + * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the nearest point on the line. + * + * @return {(Phaser.Geom.Point|object)} The nearest point on the line. + */ +var GetNearestPoint = function (line, point, out) +{ + if (out === undefined) { out = new Point(); } + + var x1 = line.x1; + var y1 = line.y1; + + var x2 = line.x2; + var y2 = line.y2; + + var L2 = (((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))); + + if (L2 === 0) + { + return out; + } + + var r = (((point.x - x1) * (x2 - x1)) + ((point.y - y1) * (y2 - y1))) / L2; + + out.x = x1 + (r * (x2 - x1)); + out.y = y1 + (r * (y2 - y1)); + + return out; +}; + +module.exports = GetNearestPoint; + + +/***/ }), +/* 1076 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(23); +var Angle = __webpack_require__(83); +var Point = __webpack_require__(3); + +/** + * Calculate the normal of the given line. + * + * The normal of a line is a vector that points perpendicular from it. + * + * @function Phaser.Geom.Line.GetNormal + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Line} line - The line to calculate the normal of. + * @param {(Phaser.Geom.Point|object)} [out] - An optional point object to store the normal in. + * + * @return {(Phaser.Geom.Point|object)} The normal of the Line. + */ +var GetNormal = function (line, out) +{ + if (out === undefined) { out = new Point(); } + + var a = Angle(line) - MATH_CONST.TAU; + + out.x = Math.cos(a); + out.y = Math.sin(a); + + return out; +}; + +module.exports = GetNormal; + + +/***/ }), +/* 1077 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Get the shortest distance from a Line to the given Point. + * + * @function Phaser.Geom.Line.GetShortestDistance + * @since 3.16.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Line} line - The line to get the distance from. + * @param {(Phaser.Geom.Point|object)} point - The point to get the shortest distance to. + * + * @return {number} The shortest distance from the line to the point. + */ +var GetShortestDistance = function (line, point) +{ + var x1 = line.x1; + var y1 = line.y1; + + var x2 = line.x2; + var y2 = line.y2; + + var L2 = (((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))); + + if (L2 === 0) + { + return false; + } + + var s = (((y1 - point.y) * (x2 - x1)) - ((x1 - point.x) * (y2 - y1))) / L2; + + return Math.abs(s) * Math.sqrt(L2); +}; + +module.exports = GetShortestDistance; + + +/***/ }), +/* 1078 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the height of the given line. + * + * @function Phaser.Geom.Line.Height + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the height of. + * + * @return {number} The height of the line. + */ +var Height = function (line) +{ + return Math.abs(line.y1 - line.y2); +}; + +module.exports = Height; + + +/***/ }), +/* 1079 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(23); +var Angle = __webpack_require__(83); + +/** + * [description] + * + * @function Phaser.Geom.Line.NormalX + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The Line object to get the normal value from. + * + * @return {number} [description] + */ +var NormalX = function (line) +{ + return Math.cos(Angle(line) - MATH_CONST.TAU); +}; + +module.exports = NormalX; + + +/***/ }), +/* 1080 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(23); +var Angle = __webpack_require__(83); + +/** + * The Y value of the normal of the given line. + * The normal of a line is a vector that points perpendicular from it. + * + * @function Phaser.Geom.Line.NormalY + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the normal of. + * + * @return {number} The Y value of the normal of the Line. + */ +var NormalY = function (line) +{ + return Math.sin(Angle(line) - MATH_CONST.TAU); +}; + +module.exports = NormalY; + + +/***/ }), +/* 1081 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Offset a line by the given amount. + * + * @function Phaser.Geom.Line.Offset + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} line - The line to offset. + * @param {number} x - The horizontal offset to add to the line. + * @param {number} y - The vertical offset to add to the line. + * + * @return {Phaser.Geom.Line} The offset line. + */ +var Offset = function (line, x, y) +{ + line.x1 += x; + line.y1 += y; + + line.x2 += x; + line.y2 += y; + + return line; +}; + +module.exports = Offset; + + +/***/ }), +/* 1082 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the perpendicular slope of the given line. + * + * @function Phaser.Geom.Line.PerpSlope + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the perpendicular slope of. + * + * @return {number} The perpendicular slope of the line. + */ +var PerpSlope = function (line) +{ + return -((line.x2 - line.x1) / (line.y2 - line.y1)); +}; + +module.exports = PerpSlope; + + +/***/ }), +/* 1083 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Angle = __webpack_require__(83); +var NormalAngle = __webpack_require__(414); + +/** + * Calculate the reflected angle between two lines. + * + * This is the outgoing angle based on the angle of Line 1 and the normalAngle of Line 2. + * + * @function Phaser.Geom.Line.ReflectAngle + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} lineA - The first line. + * @param {Phaser.Geom.Line} lineB - The second line. + * + * @return {number} The reflected angle between each line. + */ +var ReflectAngle = function (lineA, lineB) +{ + return (2 * NormalAngle(lineB) - Math.PI - Angle(lineA)); +}; + +module.exports = ReflectAngle; + + +/***/ }), +/* 1084 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateAroundXY = __webpack_require__(200); + +/** + * Rotate a line around its midpoint by the given angle in radians. + * + * @function Phaser.Geom.Line.Rotate + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} line - The line to rotate. + * @param {number} angle - The angle of rotation in radians. + * + * @return {Phaser.Geom.Line} The rotated line. + */ +var Rotate = function (line, angle) +{ + var x = (line.x1 + line.x2) / 2; + var y = (line.y1 + line.y2) / 2; + + return RotateAroundXY(line, x, y, angle); +}; + +module.exports = Rotate; + + +/***/ }), +/* 1085 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateAroundXY = __webpack_require__(200); + +/** + * Rotate a line around a point by the given angle in radians. + * + * @function Phaser.Geom.Line.RotateAroundPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} line - The line to rotate. + * @param {(Phaser.Geom.Point|object)} point - The point to rotate the line around. + * @param {number} angle - The angle of rotation in radians. + * + * @return {Phaser.Geom.Line} The rotated line. + */ +var RotateAroundPoint = function (line, point, angle) +{ + return RotateAroundXY(line, point.x, point.y, angle); +}; + +module.exports = RotateAroundPoint; + + +/***/ }), +/* 1086 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Set a line to a given position, angle and length. + * + * @function Phaser.Geom.Line.SetToAngle + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} line - The line to set. + * @param {number} x - The horizontal start position of the line. + * @param {number} y - The vertical start position of the line. + * @param {number} angle - The angle of the line in radians. + * @param {number} length - The length of the line. + * + * @return {Phaser.Geom.Line} The updated line. + */ +var SetToAngle = function (line, x, y, angle, length) +{ + line.x1 = x; + line.y1 = y; + + line.x2 = x + (Math.cos(angle) * length); + line.y2 = y + (Math.sin(angle) * length); + + return line; +}; + +module.exports = SetToAngle; + + +/***/ }), +/* 1087 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the slope of the given line. + * + * @function Phaser.Geom.Line.Slope + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the slope of. + * + * @return {number} The slope of the line. + */ +var Slope = function (line) +{ + return (line.y2 - line.y1) / (line.x2 - line.x1); +}; + +module.exports = Slope; + + +/***/ }), +/* 1088 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate the width of the given line. + * + * @function Phaser.Geom.Line.Width + * @since 3.0.0 + * + * @param {Phaser.Geom.Line} line - The line to calculate the width of. + * + * @return {number} The width of the line. + */ +var Width = function (line) +{ + return Math.abs(line.x1 - line.x2); +}; + +module.exports = Width; + + +/***/ }), +/* 1089 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +Point.Ceil = __webpack_require__(1090); +Point.Clone = __webpack_require__(1091); +Point.CopyFrom = __webpack_require__(1092); +Point.Equals = __webpack_require__(1093); +Point.Floor = __webpack_require__(1094); +Point.GetCentroid = __webpack_require__(1095); +Point.GetMagnitude = __webpack_require__(415); +Point.GetMagnitudeSq = __webpack_require__(416); +Point.GetRectangleFromPoints = __webpack_require__(1096); +Point.Interpolate = __webpack_require__(1097); +Point.Invert = __webpack_require__(1098); +Point.Negative = __webpack_require__(1099); +Point.Project = __webpack_require__(1100); +Point.ProjectUnit = __webpack_require__(1101); +Point.SetMagnitude = __webpack_require__(1102); + +module.exports = Point; + + +/***/ }), +/* 1090 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Apply `Math.ceil()` to each coordinate of the given Point. + * + * @function Phaser.Geom.Point.Ceil + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} point - The Point to ceil. + * + * @return {Phaser.Geom.Point} The Point with `Math.ceil()` applied to its coordinates. + */ +var Ceil = function (point) +{ + return point.setTo(Math.ceil(point.x), Math.ceil(point.y)); +}; + +module.exports = Ceil; + + +/***/ }), +/* 1091 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Clone the given Point. + * + * @function Phaser.Geom.Point.Clone + * @since 3.0.0 + * + * @param {Phaser.Geom.Point} source - The source Point to clone. + * + * @return {Phaser.Geom.Point} The cloned Point. + */ +var Clone = function (source) +{ + return new Point(source.x, source.y); +}; + +module.exports = Clone; + + +/***/ }), +/* 1092 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Copy the values of one Point to a destination Point. + * + * @function Phaser.Geom.Point.CopyFrom + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [dest,$return] + * + * @param {Phaser.Geom.Point} source - The source Point to copy the values from. + * @param {Phaser.Geom.Point} dest - The destination Point to copy the values to. + * + * @return {Phaser.Geom.Point} The destination Point. + */ +var CopyFrom = function (source, dest) +{ + return dest.setTo(source.x, source.y); +}; + +module.exports = CopyFrom; + + +/***/ }), +/* 1093 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A comparison of two `Point` objects to see if they are equal. + * + * @function Phaser.Geom.Point.Equals + * @since 3.0.0 + * + * @param {Phaser.Geom.Point} point - The original `Point` to compare against. + * @param {Phaser.Geom.Point} toCompare - The second `Point` to compare. + * + * @return {boolean} Returns true if the both `Point` objects are equal. + */ +var Equals = function (point, toCompare) +{ + return (point.x === toCompare.x && point.y === toCompare.y); +}; + +module.exports = Equals; + + +/***/ }), +/* 1094 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Apply `Math.ceil()` to each coordinate of the given Point. + * + * @function Phaser.Geom.Point.Floor + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} point - The Point to floor. + * + * @return {Phaser.Geom.Point} The Point with `Math.floor()` applied to its coordinates. + */ +var Floor = function (point) +{ + return point.setTo(Math.floor(point.x), Math.floor(point.y)); +}; + +module.exports = Floor; + + +/***/ }), +/* 1095 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Get the centroid or geometric center of a plane figure (the arithmetic mean position of all the points in the figure). + * Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin. + * + * @function Phaser.Geom.Point.GetCentroid + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Point[]} points - [description] + * @param {Phaser.Geom.Point} [out] - [description] + * + * @return {Phaser.Geom.Point} [description] + */ +var GetCentroid = function (points, out) +{ + if (out === undefined) { out = new Point(); } + + if (!Array.isArray(points)) + { + throw new Error('GetCentroid points argument must be an array'); + } + + var len = points.length; + + if (len < 1) + { + throw new Error('GetCentroid points array must not be empty'); + } + else if (len === 1) + { + out.x = points[0].x; + out.y = points[0].y; + } + else + { + for (var i = 0; i < len; i++) + { + out.x += points[i].x; + out.y += points[i].y; + } + + out.x /= len; + out.y /= len; + } + + return out; +}; + +module.exports = GetCentroid; + + +/***/ }), +/* 1096 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); + +/** + * Calculates the Axis Aligned Bounding Box (or aabb) from an array of points. + * + * @function Phaser.Geom.Point.GetRectangleFromPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [out,$return] + * + * @param {Phaser.Geom.Point[]} points - [description] + * @param {Phaser.Geom.Rectangle} [out] - [description] + * + * @return {Phaser.Geom.Rectangle} [description] + */ +var GetRectangleFromPoints = function (points, out) +{ + if (out === undefined) { out = new Rectangle(); } + + var xMax = Number.NEGATIVE_INFINITY; + var xMin = Number.POSITIVE_INFINITY; + var yMax = Number.NEGATIVE_INFINITY; + var yMin = Number.POSITIVE_INFINITY; + + for (var i = 0; i < points.length; i++) + { + var point = points[i]; + + if (point.x > xMax) + { + xMax = point.x; + } + + if (point.x < xMin) + { + xMin = point.x; + } + + if (point.y > yMax) + { + yMax = point.y; + } + + if (point.y < yMin) + { + yMin = point.y; + } + } + + out.x = xMin; + out.y = yMin; + out.width = xMax - xMin; + out.height = yMax - yMin; + + return out; +}; + +module.exports = GetRectangleFromPoints; + + +/***/ }), +/* 1097 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * [description] + * + * @function Phaser.Geom.Point.Interpolate + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Point} pointA - The starting `Point` for the interpolation. + * @param {Phaser.Geom.Point} pointB - The target `Point` for the interpolation. + * @param {number} [t=0] - The amount to interpolate between the two points. Generally, a value between 0 (returns the starting `Point`) and 1 (returns the target `Point`). If omitted, 0 is used. + * @param {(Phaser.Geom.Point|object)} [out] - An optional `Point` object whose `x` and `y` values will be set to the result of the interpolation (can also be any object with `x` and `y` properties). If omitted, a new `Point` created and returned. + * + * @return {(Phaser.Geom.Point|object)} Either the object from the `out` argument with the properties `x` and `y` set to the result of the interpolation or a newly created `Point` object. + */ +var Interpolate = function (pointA, pointB, t, out) +{ + if (t === undefined) { t = 0; } + if (out === undefined) { out = new Point(); } + + out.x = pointA.x + ((pointB.x - pointA.x) * t); + out.y = pointA.y + ((pointB.y - pointA.y) * t); + + return out; +}; + +module.exports = Interpolate; + + +/***/ }), +/* 1098 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Swaps the X and the Y coordinate of a point. + * + * @function Phaser.Geom.Point.Invert + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} point - The Point to modify. + * + * @return {Phaser.Geom.Point} The modified `point`. + */ +var Invert = function (point) +{ + return point.setTo(point.y, point.x); +}; + +module.exports = Invert; + + +/***/ }), +/* 1099 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Inverts a Point's coordinates. + * + * @function Phaser.Geom.Point.Negative + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Point} point - The Point to invert. + * @param {Phaser.Geom.Point} [out] - The Point to return the inverted coordinates in. + * + * @return {Phaser.Geom.Point} The modified `out` Point, or a new Point if none was provided. + */ +var Negative = function (point, out) +{ + if (out === undefined) { out = new Point(); } + + return out.setTo(-point.x, -point.y); +}; + +module.exports = Negative; + + +/***/ }), +/* 1100 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); +var GetMagnitudeSq = __webpack_require__(416); + +/** + * [description] + * + * @function Phaser.Geom.Point.Project + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Point} pointA - [description] + * @param {Phaser.Geom.Point} pointB - [description] + * @param {Phaser.Geom.Point} [out] - [description] + * + * @return {Phaser.Geom.Point} [description] + */ +var Project = function (pointA, pointB, out) +{ + if (out === undefined) { out = new Point(); } + + var dot = ((pointA.x * pointB.x) + (pointA.y * pointB.y)); + var amt = dot / GetMagnitudeSq(pointB); + + if (amt !== 0) + { + out.x = amt * pointB.x; + out.y = amt * pointB.y; + } + + return out; +}; + +module.exports = Project; + + +/***/ }), +/* 1101 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * [description] + * + * @function Phaser.Geom.Point.ProjectUnit + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Point} pointA - [description] + * @param {Phaser.Geom.Point} pointB - [description] + * @param {Phaser.Geom.Point} [out] - [description] + * + * @return {Phaser.Geom.Point} [description] + */ +var ProjectUnit = function (pointA, pointB, out) +{ + if (out === undefined) { out = new Point(); } + + var amt = ((pointA.x * pointB.x) + (pointA.y * pointB.y)); + + if (amt !== 0) + { + out.x = amt * pointB.x; + out.y = amt * pointB.y; + } + + return out; +}; + +module.exports = ProjectUnit; + + +/***/ }), +/* 1102 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetMagnitude = __webpack_require__(415); + +/** + * Changes the magnitude (length) of a two-dimensional vector without changing its direction. + * + * @function Phaser.Geom.Point.SetMagnitude + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} point - The Point to treat as the end point of the vector. + * @param {number} magnitude - The new magnitude of the vector. + * + * @return {Phaser.Geom.Point} The modified Point. + */ +var SetMagnitude = function (point, magnitude) +{ + if (point.x !== 0 || point.y !== 0) + { + var m = GetMagnitude(point); + + point.x /= m; + point.y /= m; + } + + point.x *= magnitude; + point.y *= magnitude; + + return point; +}; + +module.exports = SetMagnitude; + + +/***/ }), +/* 1103 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Polygon = __webpack_require__(192); + +Polygon.Clone = __webpack_require__(1104); +Polygon.Contains = __webpack_require__(193); +Polygon.ContainsPoint = __webpack_require__(1105); +Polygon.GetAABB = __webpack_require__(389); +Polygon.GetNumberArray = __webpack_require__(1106); +Polygon.GetPoints = __webpack_require__(390); +Polygon.Perimeter = __webpack_require__(391); +Polygon.Reverse = __webpack_require__(1107); +Polygon.Smooth = __webpack_require__(392); + +module.exports = Polygon; + + +/***/ }), +/* 1104 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Polygon = __webpack_require__(192); + +/** + * Create a new polygon which is a copy of the specified polygon + * + * @function Phaser.Geom.Polygon.Clone + * @since 3.0.0 + * + * @param {Phaser.Geom.Polygon} polygon - The polygon to create a clone of + * + * @return {Phaser.Geom.Polygon} A new separate Polygon cloned from the specified polygon, based on the same points. + */ +var Clone = function (polygon) +{ + return new Polygon(polygon.points); +}; + +module.exports = Clone; + + +/***/ }), +/* 1105 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Contains = __webpack_require__(193); + +/** + * [description] + * + * @function Phaser.Geom.Polygon.ContainsPoint + * @since 3.0.0 + * + * @param {Phaser.Geom.Polygon} polygon - [description] + * @param {Phaser.Geom.Point} point - [description] + * + * @return {boolean} [description] + */ +var ContainsPoint = function (polygon, point) +{ + return Contains(polygon, point.x, point.y); +}; + +module.exports = ContainsPoint; + + +/***/ }), +/* 1106 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Export the points as an array of flat numbers, following the sequence [ x,y, x,y, x,y ] + +/** + * Stores all of the points of a Polygon into a flat array of numbers following the sequence [ x,y, x,y, x,y ], + * i.e. each point of the Polygon, in the order it's defined, corresponds to two elements of the resultant + * array for the point's X and Y coordinate. + * + * @function Phaser.Geom.Polygon.GetNumberArray + * @since 3.0.0 + * + * @generic {number[]} O - [output,$return] + * + * @param {Phaser.Geom.Polygon} polygon - The Polygon whose points to export. + * @param {(array|number[])} [output] - An array to which the points' coordinates should be appended. + * + * @return {(array|number[])} The modified `output` array, or a new array if none was given. + */ +var GetNumberArray = function (polygon, output) +{ + if (output === undefined) { output = []; } + + for (var i = 0; i < polygon.points.length; i++) + { + output.push(polygon.points[i].x); + output.push(polygon.points[i].y); + } + + return output; +}; + +module.exports = GetNumberArray; + + +/***/ }), +/* 1107 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Reverses the order of the points of a Polygon. + * + * @function Phaser.Geom.Polygon.Reverse + * @since 3.0.0 + * + * @generic {Phaser.Geom.Polygon} O - [polygon,$return] + * + * @param {Phaser.Geom.Polygon} polygon - The Polygon to modify. + * + * @return {Phaser.Geom.Polygon} The modified Polygon. + */ +var Reverse = function (polygon) +{ + polygon.points.reverse(); + + return polygon; +}; + +module.exports = Reverse; + + +/***/ }), +/* 1108 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the area of the given Rectangle object. + * + * @function Phaser.Geom.Rectangle.Area + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The rectangle to calculate the area of. + * + * @return {number} The area of the Rectangle object. + */ +var Area = function (rect) +{ + return rect.width * rect.height; +}; + +module.exports = Area; + + +/***/ }), +/* 1109 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rounds a Rectangle's position up to the smallest integer greater than or equal to each current coordinate. + * + * @function Phaser.Geom.Rectangle.Ceil + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [rect,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. + * + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. + */ +var Ceil = function (rect) +{ + rect.x = Math.ceil(rect.x); + rect.y = Math.ceil(rect.y); + + return rect; +}; + +module.exports = Ceil; + + +/***/ }), +/* 1110 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rounds a Rectangle's position and size up to the smallest integer greater than or equal to each respective value. + * + * @function Phaser.Geom.Rectangle.CeilAll + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [rect,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to modify. + * + * @return {Phaser.Geom.Rectangle} The modified Rectangle. + */ +var CeilAll = function (rect) +{ + rect.x = Math.ceil(rect.x); + rect.y = Math.ceil(rect.y); + rect.width = Math.ceil(rect.width); + rect.height = Math.ceil(rect.height); + + return rect; +}; + +module.exports = CeilAll; + + +/***/ }), +/* 1111 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); + +/** + * Creates a new Rectangle which is identical to the given one. + * + * @function Phaser.Geom.Rectangle.Clone + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} source - The Rectangle to clone. + * + * @return {Phaser.Geom.Rectangle} The newly created Rectangle, which is separate from the given one. + */ +var Clone = function (source) +{ + return new Rectangle(source.x, source.y, source.width, source.height); +}; + +module.exports = Clone; + + +/***/ }), +/* 1112 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Contains = __webpack_require__(47); + +/** + * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. + * + * @function Phaser.Geom.Rectangle.ContainsPoint + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle object. + * @param {Phaser.Geom.Point} point - The point object to be checked. Can be a Phaser Point object or any object with x and y values. + * + * @return {boolean} A value of true if the Rectangle object contains the specified point, otherwise false. + */ +var ContainsPoint = function (rect, point) +{ + return Contains(rect, point.x, point.y); +}; + +module.exports = ContainsPoint; + + +/***/ }), +/* 1113 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Copy the values of one Rectangle to a destination Rectangle. + * + * @function Phaser.Geom.Rectangle.CopyFrom + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [dest,$return] + * + * @param {Phaser.Geom.Rectangle} source - The source Rectangle to copy the values from. + * @param {Phaser.Geom.Rectangle} dest - The destination Rectangle to copy the values to. + * + * @return {Phaser.Geom.Rectangle} The destination Rectangle. + */ +var CopyFrom = function (source, dest) +{ + return dest.setTo(source.x, source.y, source.width, source.height); +}; + +module.exports = CopyFrom; + + +/***/ }), +/* 1114 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Compares the `x`, `y`, `width` and `height` properties of two rectangles. + * + * @function Phaser.Geom.Rectangle.Equals + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rect - Rectangle A + * @param {Phaser.Geom.Rectangle} toCompare - Rectangle B + * + * @return {boolean} `true` if the rectangles' properties are an exact match, otherwise `false`. + */ +var Equals = function (rect, toCompare) +{ + return ( + rect.x === toCompare.x && + rect.y === toCompare.y && + rect.width === toCompare.width && + rect.height === toCompare.height + ); +}; + +module.exports = Equals; + + +/***/ }), +/* 1115 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetAspectRatio = __webpack_require__(201); + +/** + * Adjusts the target rectangle, changing its width, height and position, + * so that it fits inside the area of the source rectangle, while maintaining its original + * aspect ratio. + * + * Unlike the `FitOutside` function, there may be some space inside the source area not covered. + * + * @function Phaser.Geom.Rectangle.FitInside + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [target,$return] + * + * @param {Phaser.Geom.Rectangle} target - The target rectangle to adjust. + * @param {Phaser.Geom.Rectangle} source - The source rectangle to envlope the target in. + * + * @return {Phaser.Geom.Rectangle} The modified target rectangle instance. + */ +var FitInside = function (target, source) +{ + var ratio = GetAspectRatio(target); + + if (ratio < GetAspectRatio(source)) + { + // Taller than Wide + target.setSize(source.height * ratio, source.height); + } + else + { + // Wider than Tall + target.setSize(source.width, source.width / ratio); + } + + return target.setPosition( + source.centerX - (target.width / 2), + source.centerY - (target.height / 2) + ); +}; + +module.exports = FitInside; + + +/***/ }), +/* 1116 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetAspectRatio = __webpack_require__(201); + +/** + * Adjusts the target rectangle, changing its width, height and position, + * so that it fully covers the area of the source rectangle, while maintaining its original + * aspect ratio. + * + * Unlike the `FitInside` function, the target rectangle may extend further out than the source. + * + * @function Phaser.Geom.Rectangle.FitOutside + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [target,$return] + * + * @param {Phaser.Geom.Rectangle} target - The target rectangle to adjust. + * @param {Phaser.Geom.Rectangle} source - The source rectangle to envlope the target in. + * + * @return {Phaser.Geom.Rectangle} The modified target rectangle instance. + */ +var FitOutside = function (target, source) +{ + var ratio = GetAspectRatio(target); + + if (ratio > GetAspectRatio(source)) + { + // Wider than Tall + target.setSize(source.height * ratio, source.height); + } + else + { + // Taller than Wide + target.setSize(source.width, source.width / ratio); + } + + return target.setPosition( + source.centerX - target.width / 2, + source.centerY - target.height / 2 + ); +}; + +module.exports = FitOutside; + + +/***/ }), +/* 1117 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rounds down (floors) the top left X and Y co-ordinates of the given Rectangle to the largest integer less than or equal to them + * + * @function Phaser.Geom.Rectangle.Floor + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [rect,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The rectangle to floor the top left X and Y co-ordinates of + * + * @return {Phaser.Geom.Rectangle} The rectangle that was passed to this function with its co-ordinates floored. + */ +var Floor = function (rect) +{ + rect.x = Math.floor(rect.x); + rect.y = Math.floor(rect.y); + + return rect; +}; + +module.exports = Floor; + + +/***/ }), +/* 1118 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rounds a Rectangle's position and size down to the largest integer less than or equal to each current coordinate or dimension. + * + * @function Phaser.Geom.Rectangle.FloorAll + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [rect,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. + * + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. + */ +var FloorAll = function (rect) +{ + rect.x = Math.floor(rect.x); + rect.y = Math.floor(rect.y); + rect.width = Math.floor(rect.width); + rect.height = Math.floor(rect.height); + + return rect; +}; + +module.exports = FloorAll; + + +/***/ }), +/* 1119 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +/** + * Returns the center of a Rectangle as a Point. + * + * @function Phaser.Geom.Rectangle.GetCenter + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the center of. + * @param {(Phaser.Geom.Point|object)} [out] - Optional point-like object to update with the center coordinates. + * + * @return {(Phaser.Geom.Point|object)} The modified `out` object, or a new Point if none was provided. + */ +var GetCenter = function (rect, out) +{ + if (out === undefined) { out = new Point(); } + + out.x = rect.centerX; + out.y = rect.centerY; + + return out; +}; + +module.exports = GetCenter; + + +/***/ }), +/* 1120 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); + +// The size of the Rectangle object, expressed as a Point object +// with the values of the width and height properties. + +/** + * [description] + * + * @function Phaser.Geom.Rectangle.GetSize + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rect - [description] + * @param {(Phaser.Geom.Point|object)} [out] - [description] + * + * @return {(Phaser.Geom.Point|object)} [description] + */ +var GetSize = function (rect, out) +{ + if (out === undefined) { out = new Point(); } + + out.x = rect.width; + out.y = rect.height; + + return out; +}; + +module.exports = GetSize; + + +/***/ }), +/* 1121 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CenterOn = __webpack_require__(162); + + +/** + * Increases the size of a Rectangle by a specified amount. + * + * The center of the Rectangle stays the same. The amounts are added to each side, so the actual increase in width or height is two times bigger than the respective argument. + * + * @function Phaser.Geom.Rectangle.Inflate + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [rect,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to inflate. + * @param {number} x - How many pixels the left and the right side should be moved by horizontally. + * @param {number} y - How many pixels the top and the bottom side should be moved by vertically. + * + * @return {Phaser.Geom.Rectangle} The inflated Rectangle. + */ +var Inflate = function (rect, x, y) +{ + var cx = rect.centerX; + var cy = rect.centerY; + + rect.setSize(rect.width + (x * 2), rect.height + (y * 2)); + + return CenterOn(rect, cx, cy); +}; + +module.exports = Inflate; + + +/***/ }), +/* 1122 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = __webpack_require__(10); +var Intersects = __webpack_require__(130); + +/** + * Takes two Rectangles and first checks to see if they intersect. + * If they intersect it will return the area of intersection in the `out` Rectangle. + * If they do not intersect, the `out` Rectangle will have a width and height of zero. + * + * @function Phaser.Geom.Rectangle.Intersection + * @since 3.11.0 + * + * @generic {Phaser.Geom.Rectangle} O - [rect,$return] + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to get the intersection from. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to get the intersection from. + * @param {Phaser.Geom.Rectangle} [out] - A Rectangle to store the intersection results in. + * + * @return {Phaser.Geom.Rectangle} The intersection result. If the width and height are zero, no intersection occurred. + */ +var Intersection = function (rectA, rectB, out) +{ + if (out === undefined) { out = new Rectangle(); } + + if (Intersects(rectA, rectB)) + { + out.x = Math.max(rectA.x, rectB.x); + out.y = Math.max(rectA.y, rectB.y); + out.width = Math.min(rectA.right, rectB.right) - out.x; + out.height = Math.min(rectA.bottom, rectB.bottom) - out.y; + } + else + { + out.setEmpty(); + } + + return out; +}; + +module.exports = Intersection; + + +/***/ }), +/* 1123 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Merges a Rectangle with a list of points by repositioning and/or resizing it such that all points are located on or within its bounds. + * + * @function Phaser.Geom.Rectangle.MergePoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [target,$return] + * + * @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged. + * @param {Phaser.Geom.Point[]} points - An array of Points (or any object with public `x` and `y` properties) which should be merged with the Rectangle. + * + * @return {Phaser.Geom.Rectangle} The modified Rectangle. + */ +var MergePoints = function (target, points) +{ + var minX = target.x; + var maxX = target.right; + var minY = target.y; + var maxY = target.bottom; + + for (var i = 0; i < points.length; i++) + { + minX = Math.min(minX, points[i].x); + maxX = Math.max(maxX, points[i].x); + minY = Math.min(minY, points[i].y); + maxY = Math.max(maxY, points[i].y); + } + + target.x = minX; + target.y = minY; + target.width = maxX - minX; + target.height = maxY - minY; + + return target; +}; + +module.exports = MergePoints; + + +/***/ }), +/* 1124 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Merges source rectangle into target rectangle and returns target +// Neither rect should have negative widths or heights + +/** + * Merges the source rectangle into the target rectangle and returns the target. + * Neither rectangle should have a negative width or height. + * + * @function Phaser.Geom.Rectangle.MergeRect + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [target,$return] + * + * @param {Phaser.Geom.Rectangle} target - Target rectangle. Will be modified to include source rectangle. + * @param {Phaser.Geom.Rectangle} source - Rectangle that will be merged into target rectangle. + * + * @return {Phaser.Geom.Rectangle} Modified target rectangle that contains source rectangle. + */ +var MergeRect = function (target, source) +{ + var minX = Math.min(target.x, source.x); + var maxX = Math.max(target.right, source.right); + + target.x = minX; + target.width = maxX - minX; + + var minY = Math.min(target.y, source.y); + var maxY = Math.max(target.bottom, source.bottom); + + target.y = minY; + target.height = maxY - minY; + + return target; +}; + +module.exports = MergeRect; + + +/***/ }), +/* 1125 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Merges a Rectangle with a point by repositioning and/or resizing it so that the point is on or within its bounds. + * + * @function Phaser.Geom.Rectangle.MergeXY + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [target,$return] + * + * @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged and modified. + * @param {number} x - The X coordinate of the point which should be merged. + * @param {number} y - The Y coordinate of the point which should be merged. + * + * @return {Phaser.Geom.Rectangle} The modified `target` Rectangle. + */ +var MergeXY = function (target, x, y) +{ + var minX = Math.min(target.x, x); + var maxX = Math.max(target.right, x); + + target.x = minX; + target.width = maxX - minX; + + var minY = Math.min(target.y, y); + var maxY = Math.max(target.bottom, y); + + target.y = minY; + target.height = maxY - minY; + + return target; +}; + +module.exports = MergeXY; + + +/***/ }), +/* 1126 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Nudges (translates) the top left corner of a Rectangle by a given offset. + * + * @function Phaser.Geom.Rectangle.Offset + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [rect,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. + * @param {number} x - The distance to move the Rectangle horizontally. + * @param {number} y - The distance to move the Rectangle vertically. + * + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. + */ +var Offset = function (rect, x, y) +{ + rect.x += x; + rect.y += y; + + return rect; +}; + +module.exports = Offset; + + +/***/ }), +/* 1127 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Nudges (translates) the top-left corner of a Rectangle by the coordinates of a point (translation vector). + * + * @function Phaser.Geom.Rectangle.OffsetPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [rect,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust. + * @param {(Phaser.Geom.Point|Phaser.Math.Vector2)} point - The point whose coordinates should be used as an offset. + * + * @return {Phaser.Geom.Rectangle} The adjusted Rectangle. + */ +var OffsetPoint = function (rect, point) +{ + rect.x += point.x; + rect.y += point.y; + + return rect; +}; + +module.exports = OffsetPoint; + + +/***/ }), +/* 1128 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if two Rectangles overlap. If a Rectangle is within another Rectangle, the two will be considered overlapping. Thus, the Rectangles are treated as "solid". + * + * @function Phaser.Geom.Rectangle.Overlaps + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to check. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to check. + * + * @return {boolean} `true` if the two Rectangles overlap, `false` otherwise. + */ +var Overlaps = function (rectA, rectB) +{ + return ( + rectA.x < rectB.right && + rectA.right > rectB.x && + rectA.y < rectB.bottom && + rectA.bottom > rectB.y + ); +}; + +module.exports = Overlaps; + + +/***/ }), +/* 1129 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Point = __webpack_require__(3); +var DegToRad = __webpack_require__(35); + +/** + * [description] + * + * @function Phaser.Geom.Rectangle.PerimeterPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} rectangle - [description] + * @param {integer} angle - [description] + * @param {Phaser.Geom.Point} [out] - [description] + * + * @return {Phaser.Geom.Point} [description] + */ +var PerimeterPoint = function (rectangle, angle, out) +{ + if (out === undefined) { out = new Point(); } + + angle = DegToRad(angle); + + var s = Math.sin(angle); + var c = Math.cos(angle); + + var dx = (c > 0) ? rectangle.width / 2 : rectangle.width / -2; + var dy = (s > 0) ? rectangle.height / 2 : rectangle.height / -2; + + if (Math.abs(dx * s) < Math.abs(dy * c)) + { + dy = (dx * s) / c; + } + else + { + dx = (dy * c) / s; + } + + out.x = dx + rectangle.centerX; + out.y = dy + rectangle.centerY; + + return out; +}; + +module.exports = PerimeterPoint; + + +/***/ }), +/* 1130 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Between = __webpack_require__(168); +var ContainsRect = __webpack_require__(418); +var Point = __webpack_require__(3); + +/** + * Calculates a random point that lies within the `outer` Rectangle, but outside of the `inner` Rectangle. + * The inner Rectangle must be fully contained within the outer rectangle. + * + * @function Phaser.Geom.Rectangle.RandomOutside + * @since 3.10.0 + * + * @generic {Phaser.Geom.Point} O - [out,$return] + * + * @param {Phaser.Geom.Rectangle} outer - The outer Rectangle to get the random point within. + * @param {Phaser.Geom.Rectangle} inner - The inner Rectangle to exclude from the returned point. + * @param {Phaser.Geom.Point} [out] - A Point, or Point-like object to store the result in. If not specified, a new Point will be created. + * + * @return {Phaser.Geom.Point} A Point object containing the random values in its `x` and `y` properties. + */ +var RandomOutside = function (outer, inner, out) +{ + if (out === undefined) { out = new Point(); } + + if (ContainsRect(outer, inner)) + { + // Pick a random quadrant + // + // The quadrants don't extend the full widths / heights of the outer rect to give + // us a better uniformed distribution, otherwise you get clumping in the corners where + // the 4 quads would overlap + + switch (Between(0, 3)) + { + case 0: // Top + out.x = outer.x + (Math.random() * (inner.right - outer.x)); + out.y = outer.y + (Math.random() * (inner.top - outer.y)); + break; + + case 1: // Bottom + out.x = inner.x + (Math.random() * (outer.right - inner.x)); + out.y = inner.bottom + (Math.random() * (outer.bottom - inner.bottom)); + break; + + case 2: // Left + out.x = outer.x + (Math.random() * (inner.x - outer.x)); + out.y = inner.y + (Math.random() * (outer.bottom - inner.y)); + break; + + case 3: // Right + out.x = inner.right + (Math.random() * (outer.right - inner.right)); + out.y = outer.y + (Math.random() * (inner.bottom - outer.y)); + break; + } + } + + return out; +}; + +module.exports = RandomOutside; + + +/***/ }), +/* 1131 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determines if the two objects (either Rectangles or Rectangle-like) have the same width and height values under strict equality. + * + * @function Phaser.Geom.Rectangle.SameDimensions + * @since 3.15.0 + * + * @param {Phaser.Geom.Rectangle} rect - The first Rectangle object. + * @param {Phaser.Geom.Rectangle} toCompare - The second Rectangle object. + * + * @return {boolean} `true` if the objects have equivalent values for the `width` and `height` properties, otherwise `false`. + */ +var SameDimensions = function (rect, toCompare) +{ + return (rect.width === toCompare.width && rect.height === toCompare.height); +}; + +module.exports = SameDimensions; + + +/***/ }), +/* 1132 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Scales the width and height of this Rectangle by the given amounts. + +/** + * Scales the width and height of this Rectangle by the given amounts. + * + * @function Phaser.Geom.Rectangle.Scale + * @since 3.0.0 + * + * @generic {Phaser.Geom.Rectangle} O - [rect,$return] + * + * @param {Phaser.Geom.Rectangle} rect - The `Rectangle` object that will be scaled by the specified amount(s). + * @param {number} x - The factor by which to scale the rectangle horizontally. + * @param {number} y - The amount by which to scale the rectangle vertically. If this is not specified, the rectangle will be scaled by the factor `x` in both directions. + * + * @return {Phaser.Geom.Rectangle} The rectangle object with updated `width` and `height` properties as calculated from the scaling factor(s). + */ +var Scale = function (rect, x, y) +{ + if (y === undefined) { y = x; } + + rect.width *= x; + rect.height *= y; + + return rect; +}; + +module.exports = Scale; + + +/***/ }), +/* 1133 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Triangle = __webpack_require__(69); + +Triangle.Area = __webpack_require__(1134); +Triangle.BuildEquilateral = __webpack_require__(1135); +Triangle.BuildFromPolygon = __webpack_require__(1136); +Triangle.BuildRight = __webpack_require__(1137); +Triangle.CenterOn = __webpack_require__(1138); +Triangle.Centroid = __webpack_require__(419); +Triangle.CircumCenter = __webpack_require__(1139); +Triangle.CircumCircle = __webpack_require__(1140); +Triangle.Clone = __webpack_require__(1141); +Triangle.Contains = __webpack_require__(81); +Triangle.ContainsArray = __webpack_require__(199); +Triangle.ContainsPoint = __webpack_require__(1142); +Triangle.CopyFrom = __webpack_require__(1143); +Triangle.Decompose = __webpack_require__(412); +Triangle.Equals = __webpack_require__(1144); +Triangle.GetPoint = __webpack_require__(396); +Triangle.GetPoints = __webpack_require__(397); +Triangle.InCenter = __webpack_require__(421); +Triangle.Perimeter = __webpack_require__(1145); +Triangle.Offset = __webpack_require__(420); +Triangle.Random = __webpack_require__(153); +Triangle.Rotate = __webpack_require__(1146); +Triangle.RotateAroundPoint = __webpack_require__(1147); +Triangle.RotateAroundXY = __webpack_require__(202); + +module.exports = Triangle; + + +/***/ }), +/* 1134 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// The 2D area of a triangle. The area value is always non-negative. + +/** + * Returns the area of a Triangle. + * + * @function Phaser.Geom.Triangle.Area + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to use. + * + * @return {number} The area of the Triangle, always non-negative. + */ +var Area = function (triangle) +{ + var x1 = triangle.x1; + var y1 = triangle.y1; + + var x2 = triangle.x2; + var y2 = triangle.y2; + + var x3 = triangle.x3; + var y3 = triangle.y3; + + return Math.abs(((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1)) / 2); +}; + +module.exports = Area; + + +/***/ }), +/* 1135 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Triangle = __webpack_require__(69); + +/** + * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). + * The x/y specifies the top-middle of the triangle (x1/y1) and length is the length of each side. + * + * @function Phaser.Geom.Triangle.BuildEquilateral + * @since 3.0.0 + * + * @param {number} x - x coordinate of the top point of the triangle. + * @param {number} y - y coordinate of the top point of the triangle. + * @param {number} length - Length of each side of the triangle. + * + * @return {Phaser.Geom.Triangle} The Triangle object of the given size. + */ +var BuildEquilateral = function (x, y, length) +{ + var height = length * (Math.sqrt(3) / 2); + + var x1 = x; + var y1 = y; + + var x2 = x + (length / 2); + var y2 = y + height; + + var x3 = x - (length / 2); + var y3 = y + height; + + return new Triangle(x1, y1, x2, y2, x3, y3); +}; + +module.exports = BuildEquilateral; + + +/***/ }), +/* 1136 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var EarCut = __webpack_require__(63); +var Triangle = __webpack_require__(69); + +/** + * [description] + * + * @function Phaser.Geom.Triangle.BuildFromPolygon + * @since 3.0.0 + * + * @generic {Phaser.Geom.Triangle[]} O - [out,$return] + * + * @param {array} data - A flat array of vertice coordinates like [x0,y0, x1,y1, x2,y2, ...] + * @param {array} [holes=null] - An array of hole indices if any (e.g. [5, 8] for a 12-vertice input would mean one hole with vertices 5–7 and another with 8–11). + * @param {number} [scaleX=1] - [description] + * @param {number} [scaleY=1] - [description] + * @param {(array|Phaser.Geom.Triangle[])} [out] - [description] + * + * @return {(array|Phaser.Geom.Triangle[])} [description] + */ +var BuildFromPolygon = function (data, holes, scaleX, scaleY, out) +{ + if (holes === undefined) { holes = null; } + if (scaleX === undefined) { scaleX = 1; } + if (scaleY === undefined) { scaleY = 1; } + if (out === undefined) { out = []; } + + var tris = EarCut(data, holes); + + var a; + var b; + var c; + + var x1; + var y1; + + var x2; + var y2; + + var x3; + var y3; + + for (var i = 0; i < tris.length; i += 3) + { + a = tris[i]; + b = tris[i + 1]; + c = tris[i + 2]; + + x1 = data[a * 2] * scaleX; + y1 = data[(a * 2) + 1] * scaleY; + + x2 = data[b * 2] * scaleX; + y2 = data[(b * 2) + 1] * scaleY; + + x3 = data[c * 2] * scaleX; + y3 = data[(c * 2) + 1] * scaleY; + + out.push(new Triangle(x1, y1, x2, y2, x3, y3)); + } + + return out; +}; + +module.exports = BuildFromPolygon; + + +/***/ }), +/* 1137 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Triangle = __webpack_require__(69); + +// Builds a right triangle, with one 90 degree angle and two acute angles +// The x/y is the coordinate of the 90 degree angle (and will map to x1/y1 in the resulting Triangle) +// w/h can be positive or negative and represent the length of each side + +/** + * Builds a right triangle, i.e. one which has a 90-degree angle and two acute angles. + * + * @function Phaser.Geom.Triangle.BuildRight + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the right angle, which will also be the first X coordinate of the constructed Triangle. + * @param {number} y - The Y coordinate of the right angle, which will also be the first Y coordinate of the constructed Triangle. + * @param {number} width - The length of the side which is to the left or to the right of the right angle. + * @param {number} height - The length of the side which is above or below the right angle. + * + * @return {Phaser.Geom.Triangle} The constructed right Triangle. + */ +var BuildRight = function (x, y, width, height) +{ + if (height === undefined) { height = width; } + + // 90 degree angle + var x1 = x; + var y1 = y; + + var x2 = x; + var y2 = y - height; + + var x3 = x + width; + var y3 = y; + + return new Triangle(x1, y1, x2, y2, x3, y3); +}; + +module.exports = BuildRight; + + +/***/ }), +/* 1138 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Centroid = __webpack_require__(419); +var Offset = __webpack_require__(420); + +/** + * @callback CenterFunction + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to return the center coordinates of. + * + * @return {Phaser.Math.Vector2} The center point of the Triangle according to the function. + */ + +/** + * Positions the Triangle so that it is centered on the given coordinates. + * + * @function Phaser.Geom.Triangle.CenterOn + * @since 3.0.0 + * + * @generic {Phaser.Geom.Triangle} O - [triangle,$return] + * + * @param {Phaser.Geom.Triangle} triangle - The triangle to be positioned. + * @param {number} x - The horizontal coordinate to center on. + * @param {number} y - The vertical coordinate to center on. + * @param {CenterFunction} [centerFunc] - The function used to center the triangle. Defaults to Centroid centering. + * + * @return {Phaser.Geom.Triangle} The Triangle that was centered. + */ +var CenterOn = function (triangle, x, y, centerFunc) +{ + if (centerFunc === undefined) { centerFunc = Centroid; } + + // Get the center of the triangle + var center = centerFunc(triangle); + + // Difference + var diffX = x - center.x; + var diffY = y - center.y; + + return Offset(triangle, diffX, diffY); +}; + +module.exports = CenterOn; + + +/***/ }), +/* 1139 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(4); + +// Adapted from http://bjornharrtell.github.io/jsts/doc/api/jsts_geom_Triangle.js.html + +/** + * Computes the determinant of a 2x2 matrix. Uses standard double-precision arithmetic, so is susceptible to round-off error. + * + * @function det + * @private + * @since 3.0.0 + * + * @param {number} m00 - The [0,0] entry of the matrix. + * @param {number} m01 - The [0,1] entry of the matrix. + * @param {number} m10 - The [1,0] entry of the matrix. + * @param {number} m11 - The [1,1] entry of the matrix. + * + * @return {number} the determinant. + */ +function det (m00, m01, m10, m11) +{ + return (m00 * m11) - (m01 * m10); +} + +/** + * Computes the circumcentre of a triangle. The circumcentre is the centre of + * the circumcircle, the smallest circle which encloses the triangle. It is also + * the common intersection point of the perpendicular bisectors of the sides of + * the triangle, and is the only point which has equal distance to all three + * vertices of the triangle. + * + * @function Phaser.Geom.Triangle.CircumCenter + * @since 3.0.0 + * + * @generic {Phaser.Math.Vector2} O - [out,$return] + * + * @param {Phaser.Geom.Triangle} triangle - [description] + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ +var CircumCenter = function (triangle, out) +{ + if (out === undefined) { out = new Vector2(); } + + var cx = triangle.x3; + var cy = triangle.y3; + + var ax = triangle.x1 - cx; + var ay = triangle.y1 - cy; + + var bx = triangle.x2 - cx; + var by = triangle.y2 - cy; + + var denom = 2 * det(ax, ay, bx, by); + var numx = det(ay, ax * ax + ay * ay, by, bx * bx + by * by); + var numy = det(ax, ax * ax + ay * ay, bx, bx * bx + by * by); + + out.x = cx - numx / denom; + out.y = cy + numy / denom; + + return out; +}; + +module.exports = CircumCenter; + + +/***/ }), +/* 1140 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Circle = __webpack_require__(77); + +// Adapted from https://gist.github.com/mutoo/5617691 + +/** + * Finds the circumscribed circle (circumcircle) of a Triangle object. The circumcircle is the circle which touches all of the triangle's vertices. + * + * @function Phaser.Geom.Triangle.CircumCircle + * @since 3.0.0 + * + * @generic {Phaser.Geom.Circle} O - [out,$return] + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to use as input. + * @param {Phaser.Geom.Circle} [out] - An optional Circle to store the result in. + * + * @return {Phaser.Geom.Circle} The updated `out` Circle, or a new Circle if none was provided. + */ +var CircumCircle = function (triangle, out) +{ + if (out === undefined) { out = new Circle(); } + + // A + var x1 = triangle.x1; + var y1 = triangle.y1; + + // B + var x2 = triangle.x2; + var y2 = triangle.y2; + + // C + var x3 = triangle.x3; + var y3 = triangle.y3; + + var A = x2 - x1; + var B = y2 - y1; + var C = x3 - x1; + var D = y3 - y1; + var E = A * (x1 + x2) + B * (y1 + y2); + var F = C * (x1 + x3) + D * (y1 + y3); + var G = 2 * (A * (y3 - y2) - B * (x3 - x2)); + + var dx; + var dy; + + // If the points of the triangle are collinear, then just find the + // extremes and use the midpoint as the center of the circumcircle. + + if (Math.abs(G) < 0.000001) + { + var minX = Math.min(x1, x2, x3); + var minY = Math.min(y1, y2, y3); + dx = (Math.max(x1, x2, x3) - minX) * 0.5; + dy = (Math.max(y1, y2, y3) - minY) * 0.5; + + out.x = minX + dx; + out.y = minY + dy; + out.radius = Math.sqrt(dx * dx + dy * dy); + } + else + { + out.x = (D * E - B * F) / G; + out.y = (A * F - C * E) / G; + dx = out.x - x1; + dy = out.y - y1; + out.radius = Math.sqrt(dx * dx + dy * dy); + } + + return out; +}; + +module.exports = CircumCircle; + + +/***/ }), +/* 1141 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Triangle = __webpack_require__(69); + +/** + * Clones a Triangle object. + * + * @function Phaser.Geom.Triangle.Clone + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} source - The Triangle to clone. + * + * @return {Phaser.Geom.Triangle} A new Triangle identical to the given one but separate from it. + */ +var Clone = function (source) +{ + return new Triangle(source.x1, source.y1, source.x2, source.y2, source.x3, source.y3); +}; + +module.exports = Clone; + + +/***/ }), +/* 1142 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Contains = __webpack_require__(81); + +/** + * Tests if a triangle contains a point. + * + * @function Phaser.Geom.Triangle.ContainsPoint + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The triangle. + * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|any)} point - The point to test, or any point-like object with public `x` and `y` properties. + * + * @return {boolean} `true` if the point is within the triangle, otherwise `false`. + */ +var ContainsPoint = function (triangle, point) +{ + return Contains(triangle, point.x, point.y); +}; + +module.exports = ContainsPoint; + + +/***/ }), +/* 1143 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Copy the values of one Triangle to a destination Triangle. + * + * @function Phaser.Geom.Triangle.CopyFrom + * @since 3.0.0 + * + * @generic {Phaser.Geom.Triangle} O - [dest,$return] + * + * @param {Phaser.Geom.Triangle} source - The source Triangle to copy the values from. + * @param {Phaser.Geom.Triangle} dest - The destination Triangle to copy the values to. + * + * @return {Phaser.Geom.Triangle} The destination Triangle. + */ +var CopyFrom = function (source, dest) +{ + return dest.setTo(source.x1, source.y1, source.x2, source.y2, source.x3, source.y3); +}; + +module.exports = CopyFrom; + + +/***/ }), +/* 1144 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns true if two triangles have the same coordinates. + * + * @function Phaser.Geom.Triangle.Equals + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The first triangle to check. + * @param {Phaser.Geom.Triangle} toCompare - The second triangle to check. + * + * @return {boolean} `true` if the two given triangles have the exact same coordinates, otherwise `false`. + */ +var Equals = function (triangle, toCompare) +{ + return ( + triangle.x1 === toCompare.x1 && + triangle.y1 === toCompare.y1 && + triangle.x2 === toCompare.x2 && + triangle.y2 === toCompare.y2 && + triangle.x3 === toCompare.x3 && + triangle.y3 === toCompare.y3 + ); +}; + +module.exports = Equals; + + +/***/ }), +/* 1145 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Length = __webpack_require__(55); + +// The 2D area of a triangle. The area value is always non-negative. + +/** + * Gets the length of the perimeter of the given triangle. + * + * @function Phaser.Geom.Triangle.Perimeter + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - [description] + * + * @return {number} [description] + */ +var Perimeter = function (triangle) +{ + var line1 = triangle.getLineA(); + var line2 = triangle.getLineB(); + var line3 = triangle.getLineC(); + + return (Length(line1) + Length(line2) + Length(line3)); +}; + +module.exports = Perimeter; + + +/***/ }), +/* 1146 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateAroundXY = __webpack_require__(202); +var InCenter = __webpack_require__(421); + +/** + * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet. + * + * @function Phaser.Geom.Triangle.Rotate + * @since 3.0.0 + * + * @generic {Phaser.Geom.Triangle} O - [triangle,$return] + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to rotate. + * @param {number} angle - The angle by which to rotate the Triangle, in radians. + * + * @return {Phaser.Geom.Triangle} The rotated Triangle. + */ +var Rotate = function (triangle, angle) +{ + var point = InCenter(triangle); + + return RotateAroundXY(triangle, point.x, point.y, angle); +}; + +module.exports = Rotate; + + +/***/ }), +/* 1147 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateAroundXY = __webpack_require__(202); + +/** + * Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties. + * + * @function Phaser.Geom.Triangle.RotateAroundPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Triangle} O - [triangle,$return] + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to rotate. + * @param {Phaser.Geom.Point} point - The Point to rotate the Triangle about. + * @param {number} angle - The angle by which to rotate the Triangle, in radians. + * + * @return {Phaser.Geom.Triangle} The rotated Triangle. + */ +var RotateAroundPoint = function (triangle, point, angle) +{ + return RotateAroundXY(triangle, point.x, point.y, angle); +}; + +module.exports = RotateAroundPoint; + + +/***/ }), +/* 1148 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(175); +var Extend = __webpack_require__(17); + +/** + * @namespace Phaser.Input + */ + +var Input = { + + CreateInteractiveObject: __webpack_require__(422), + Events: __webpack_require__(53), + Gamepad: __webpack_require__(1149), + InputManager: __webpack_require__(337), + InputPlugin: __webpack_require__(1161), + InputPluginCache: __webpack_require__(131), + Keyboard: __webpack_require__(1163), + Mouse: __webpack_require__(1180), + Pointer: __webpack_require__(340), + Touch: __webpack_require__(1181) + +}; + +// Merge in the consts +Input = Extend(false, Input, CONST); + +module.exports = Input; + + +/***/ }), +/* 1149 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Input.Gamepad + */ + +module.exports = { + + Axis: __webpack_require__(423), + Button: __webpack_require__(424), + Events: __webpack_require__(203), + Gamepad: __webpack_require__(425), + GamepadPlugin: __webpack_require__(1156), + + Configs: __webpack_require__(1157) +}; + + +/***/ }), +/* 1150 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Gamepad Button Down Event. + * + * This event is dispatched by the Gamepad Plugin when a button has been pressed on any active Gamepad. + * + * Listen to this event from within a Scene using: `this.input.gamepad.on('down', listener)`. + * + * You can also listen for a DOWN event from a Gamepad instance. See the [GAMEPAD_BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_DOWN} event for details. + * + * @event Phaser.Input.Gamepad.Events#BUTTON_DOWN + * @since 3.10.0 + * + * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was pressed. + * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. + * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. + */ +module.exports = 'down'; + + +/***/ }), +/* 1151 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Gamepad Button Up Event. + * + * This event is dispatched by the Gamepad Plugin when a button has been released on any active Gamepad. + * + * Listen to this event from within a Scene using: `this.input.gamepad.on('up', listener)`. + * + * You can also listen for an UP event from a Gamepad instance. See the [GAMEPAD_BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_UP} event for details. + * + * @event Phaser.Input.Gamepad.Events#BUTTON_UP + * @since 3.10.0 + * + * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was released. + * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. + * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. + */ +module.exports = 'up'; + + +/***/ }), +/* 1152 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Gamepad Connected Event. + * + * This event is dispatched by the Gamepad Plugin when a Gamepad has been connected. + * + * Listen to this event from within a Scene using: `this.input.gamepad.once('connected', listener)`. + * + * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, + * this is for security reasons. However, it may also trust the page already, in which case you won't get the + * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads + * already connected. + * + * @event Phaser.Input.Gamepad.Events#CONNECTED + * @since 3.0.0 + * + * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was connected. + * @param {Event} event - The native DOM Event that triggered the connection. + */ +module.exports = 'connected'; + + +/***/ }), +/* 1153 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Gamepad Disconnected Event. + * + * This event is dispatched by the Gamepad Plugin when a Gamepad has been disconnected. + * + * Listen to this event from within a Scene using: `this.input.gamepad.once('disconnected', listener)`. + * + * @event Phaser.Input.Gamepad.Events#DISCONNECTED + * @since 3.0.0 + * + * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was disconnected. + * @param {Event} event - The native DOM Event that triggered the disconnection. + */ +module.exports = 'disconnected'; + + +/***/ }), +/* 1154 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Gamepad Button Down Event. + * + * This event is dispatched by a Gamepad instance when a button has been pressed on it. + * + * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: + * `this.input.gamepad.pad1.on('down', listener)`. + * + * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. + * + * You can also listen for a DOWN event from the Gamepad Plugin. See the [BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_DOWN} event for details. + * + * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN + * @since 3.10.0 + * + * @param {integer} index - The index of the button that was pressed. + * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. + * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. + */ +module.exports = 'down'; + + +/***/ }), +/* 1155 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Gamepad Button Up Event. + * + * This event is dispatched by a Gamepad instance when a button has been released on it. + * + * Listen to this event from a Gamepad instance. Once way to get this is from the `pad1`, `pad2`, etc properties on the Gamepad Plugin: + * `this.input.gamepad.pad1.on('up', listener)`. + * + * Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'. + * + * You can also listen for an UP event from the Gamepad Plugin. See the [BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_UP} event for details. + * + * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP + * @since 3.10.0 + * + * @param {integer} index - The index of the button that was released. + * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. + * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. + */ +module.exports = 'up'; + + +/***/ }), +/* 1156 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(203); +var Gamepad = __webpack_require__(425); +var GetValue = __webpack_require__(6); +var InputPluginCache = __webpack_require__(131); +var InputEvents = __webpack_require__(53); + +/** + * @classdesc + * The Gamepad Plugin is an input plugin that belongs to the Scene-owned Input system. + * + * Its role is to listen for native DOM Gamepad Events and then process them. + * + * You do not need to create this class directly, the Input system will create an instance of it automatically. + * + * You can access it from within a Scene using `this.input.gamepad`. + * + * To listen for a gamepad being connected: + * + * ```javascript + * this.input.gamepad.once('connected', function (pad) { + * // 'pad' is a reference to the gamepad that was just connected + * }); + * ``` + * + * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, + * this is for security reasons. However, it may also trust the page already, in which case you won't get the + * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads + * already connected. + * + * Once you have received the connected event, or polled the gamepads and found them enabled, you can access + * them via the built-in properties `GamepadPlugin.pad1` to `pad4`, for up to 4 game pads. With a reference + * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on + * the `Gamepad` class for more details. + * + * For more information about Gamepad support in browsers see the following resources: + * + * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API + * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API + * https://www.smashingmagazine.com/2015/11/gamepad-api-in-web-games/ + * http://html5gamepad.com/ + * + * @class GamepadPlugin + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Input.Gamepad + * @constructor + * @since 3.10.0 + * + * @param {Phaser.Input.InputPlugin} sceneInputPlugin - A reference to the Scene Input Plugin that the KeyboardPlugin belongs to. + */ +var GamepadPlugin = new Class({ + + Extends: EventEmitter, + + initialize: + + function GamepadPlugin (sceneInputPlugin) + { + EventEmitter.call(this); + + /** + * A reference to the Scene that this Input Plugin is responsible for. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#scene + * @type {Phaser.Scene} + * @since 3.10.0 + */ + this.scene = sceneInputPlugin.scene; + + /** + * A reference to the Scene Systems Settings. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#settings + * @type {Phaser.Types.Scenes.SettingsObject} + * @since 3.10.0 + */ + this.settings = this.scene.sys.settings; + + /** + * A reference to the Scene Input Plugin that created this Keyboard Plugin. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#sceneInputPlugin + * @type {Phaser.Input.InputPlugin} + * @since 3.10.0 + */ + this.sceneInputPlugin = sceneInputPlugin; + + /** + * A boolean that controls if the Gamepad Manager is enabled or not. + * Can be toggled on the fly. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#enabled + * @type {boolean} + * @default true + * @since 3.10.0 + */ + this.enabled = true; + + /** + * The Gamepad Event target, as defined in the Game Config. + * Typically the browser window, but can be any interactive DOM element. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#target + * @type {any} + * @since 3.10.0 + */ + this.target; + + /** + * An array of the connected Gamepads. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#gamepads + * @type {Phaser.Input.Gamepad.Gamepad[]} + * @default [] + * @since 3.10.0 + */ + this.gamepads = []; + + /** + * An internal event queue. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#queue + * @type {GamepadEvent[]} + * @private + * @since 3.10.0 + */ + this.queue = []; + + /** + * Internal event handler. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#onGamepadHandler + * @type {function} + * @private + * @since 3.10.0 + */ + this.onGamepadHandler; + + /** + * Internal Gamepad reference. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#_pad1 + * @type {Phaser.Input.Gamepad.Gamepad} + * @private + * @since 3.10.0 + */ + this._pad1; + + /** + * Internal Gamepad reference. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#_pad2 + * @type {Phaser.Input.Gamepad.Gamepad} + * @private + * @since 3.10.0 + */ + this._pad2; + + /** + * Internal Gamepad reference. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#_pad3 + * @type {Phaser.Input.Gamepad.Gamepad} + * @private + * @since 3.10.0 + */ + this._pad3; + + /** + * Internal Gamepad reference. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#_pad4 + * @type {Phaser.Input.Gamepad.Gamepad} + * @private + * @since 3.10.0 + */ + this._pad4; + + sceneInputPlugin.pluginEvents.once(InputEvents.BOOT, this.boot, this); + sceneInputPlugin.pluginEvents.on(InputEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#boot + * @private + * @since 3.10.0 + */ + boot: function () + { + var game = this.scene.sys.game; + var settings = this.settings.input; + var config = game.config; + + this.enabled = GetValue(settings, 'gamepad', config.inputGamepad) && game.device.input.gamepads; + this.target = GetValue(settings, 'gamepad.target', config.inputGamepadEventTarget); + + this.sceneInputPlugin.pluginEvents.once(InputEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#start + * @private + * @since 3.10.0 + */ + start: function () + { + if (this.enabled) + { + this.startListeners(); + } + + this.sceneInputPlugin.pluginEvents.once(InputEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#isActive + * @since 3.10.0 + * + * @return {boolean} `true` if the plugin and the Scene it belongs to is active. + */ + isActive: function () + { + return (this.enabled && this.scene.sys.isActive()); + }, + + /** + * Starts the Gamepad Event listeners running. + * This is called automatically and does not need to be manually invoked. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#startListeners + * @private + * @since 3.10.0 + */ + startListeners: function () + { + var _this = this; + var target = this.target; + + var handler = function (event) + { + // console.log(event); + + if (event.defaultPrevented || !_this.isActive()) + { + // Do nothing if event already handled + return; + } + + _this.refreshPads(); + + _this.queue.push(event); + }; + + this.onGamepadHandler = handler; + + target.addEventListener('gamepadconnected', handler, false); + target.addEventListener('gamepaddisconnected', handler, false); + + // FF also supports gamepadbuttondown, gamepadbuttonup and gamepadaxismove but + // nothing else does, and we can get those values via the gamepads anyway, so we will + // until more browsers support this + + // Finally, listen for an update event from the Input Plugin + this.sceneInputPlugin.pluginEvents.on(InputEvents.UPDATE, this.update, this); + }, + + /** + * Stops the Gamepad Event listeners. + * This is called automatically and does not need to be manually invoked. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#stopListeners + * @private + * @since 3.10.0 + */ + stopListeners: function () + { + this.target.removeEventListener('gamepadconnected', this.onGamepadHandler); + this.target.removeEventListener('gamepaddisconnected', this.onGamepadHandler); + + this.sceneInputPlugin.pluginEvents.off(InputEvents.UPDATE, this.update); + }, + + /** + * Disconnects all current Gamepads. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#disconnectAll + * @since 3.10.0 + */ + disconnectAll: function () + { + for (var i = 0; i < this.gamepads.length; i++) + { + this.gamepads.connected = false; + } + }, + + /** + * Refreshes the list of connected Gamepads. + * + * This is called automatically when a gamepad is connected or disconnected, + * and during the update loop. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#refreshPads + * @private + * @since 3.10.0 + */ + refreshPads: function () + { + var connectedPads = navigator.getGamepads(); + + if (!connectedPads) + { + this.disconnectAll(); + } + else + { + var currentPads = this.gamepads; + + for (var i = 0; i < connectedPads.length; i++) + { + var livePad = connectedPads[i]; + + // Because sometimes they're null (yes, really) + if (!livePad) + { + continue; + } + + var id = livePad.id; + var index = livePad.index; + var currentPad = currentPads[index]; + + if (!currentPad) + { + // A new Gamepad, not currently stored locally + var newPad = new Gamepad(this, livePad); + + currentPads[index] = newPad; + + if (!this._pad1) + { + this._pad1 = newPad; + } + else if (!this._pad2) + { + this._pad2 = newPad; + } + else if (!this._pad3) + { + this._pad3 = newPad; + } + else if (!this._pad4) + { + this._pad4 = newPad; + } + } + else if (currentPad.id !== id) + { + // A new Gamepad with a different vendor string, but it has got the same index as an old one + currentPad.destroy(); + + currentPads[index] = new Gamepad(this, livePad); + } + else + { + // If neither of these, it's a pad we've already got, so update it + currentPad.update(livePad); + } + } + } + }, + + /** + * Returns an array of all currently connected Gamepads. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#getAll + * @since 3.10.0 + * + * @return {Phaser.Input.Gamepad.Gamepad[]} An array of all currently connected Gamepads. + */ + getAll: function () + { + var out = []; + var pads = this.gamepads; + + for (var i = 0; i < pads.length; i++) + { + if (pads[i]) + { + out.push(pads[i]); + } + } + + return out; + }, + + /** + * Looks-up a single Gamepad based on the given index value. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#getPad + * @since 3.10.0 + * + * @param {number} index - The index of the Gamepad to get. + * + * @return {Phaser.Input.Gamepad.Gamepad} The Gamepad matching the given index, or undefined if none were found. + */ + getPad: function (index) + { + var pads = this.gamepads; + + for (var i = 0; i < pads.length; i++) + { + if (pads[i] && pads[i].index === index) + { + return pads[i]; + } + } + }, + + /** + * The internal update loop. Refreshes all connected gamepads and processes their events. + * + * Called automatically by the Input Manager, invoked from the Game step. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#update + * @private + * @fires Phaser.Input.Gamepad.Events#CONNECTED + * @fires Phaser.Input.Gamepad.Events#DISCONNECTED + * @since 3.10.0 + */ + update: function () + { + if (!this.enabled) + { + return; + } + + this.refreshPads(); + + var len = this.queue.length; + + if (len === 0) + { + return; + } + + var queue = this.queue.splice(0, len); + + // Process the event queue, dispatching all of the events that have stored up + for (var i = 0; i < len; i++) + { + var event = queue[i]; + var pad = this.getPad(event.gamepad.index); + + if (event.type === 'gamepadconnected') + { + this.emit(Events.CONNECTED, pad, event); + } + else if (event.type === 'gamepaddisconnected') + { + this.emit(Events.DISCONNECTED, pad, event); + } + } + }, + + /** + * Shuts the Gamepad Plugin down. + * All this does is remove any listeners bound to it. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#shutdown + * @private + * @since 3.10.0 + */ + shutdown: function () + { + this.stopListeners(); + + this.disconnectAll(); + + this.removeAllListeners(); + }, + + /** + * Destroys this Gamepad Plugin, disconnecting all Gamepads and releasing internal references. + * + * @method Phaser.Input.Gamepad.GamepadPlugin#destroy + * @private + * @since 3.10.0 + */ + destroy: function () + { + this.shutdown(); + + for (var i = 0; i < this.gamepads.length; i++) + { + if (this.gamepads[i]) + { + this.gamepads[i].destroy(); + } + } + + this.gamepads = []; + + this.scene = null; + this.settings = null; + this.sceneInputPlugin = null; + this.target = null; + }, + + /** + * The total number of connected game pads. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#total + * @type {integer} + * @since 3.10.0 + */ + total: { + + get: function () + { + return this.gamepads.length; + } + + }, + + /** + * A reference to the first connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#pad1 + * @type {Phaser.Input.Gamepad.Gamepad} + * @since 3.10.0 + */ + pad1: { + + get: function () + { + return this._pad1; + } + + }, + + /** + * A reference to the second connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#pad2 + * @type {Phaser.Input.Gamepad.Gamepad} + * @since 3.10.0 + */ + pad2: { + + get: function () + { + return this._pad2; + } + + }, + + /** + * A reference to the third connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#pad3 + * @type {Phaser.Input.Gamepad.Gamepad} + * @since 3.10.0 + */ + pad3: { + + get: function () + { + return this._pad3; + } + + }, + + /** + * A reference to the fourth connected Gamepad. + * + * This will be undefined if either no pads are connected, or the browser + * has not yet issued a gamepadconnect, which can happen even if a Gamepad + * is plugged in, but hasn't yet had any buttons pressed on it. + * + * @name Phaser.Input.Gamepad.GamepadPlugin#pad4 + * @type {Phaser.Input.Gamepad.Gamepad} + * @since 3.10.0 + */ + pad4: { + + get: function () + { + return this._pad4; + } + + } + +}); + +/** + * An instance of the Gamepad Plugin class, if enabled via the `input.gamepad` Scene or Game Config property. + * Use this to create access Gamepads connected to the browser and respond to gamepad buttons. + * + * @name Phaser.Input.InputPlugin#gamepad + * @type {?Phaser.Input.Gamepad.GamepadPlugin} + * @since 3.10.0 + */ +InputPluginCache.register('GamepadPlugin', GamepadPlugin, 'gamepad', 'gamepad', 'inputGamepad'); + +module.exports = GamepadPlugin; + + +/***/ }), +/* 1157 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Input.Gamepad.Configs + */ + +module.exports = { + + DUALSHOCK_4: __webpack_require__(1158), + SNES_USB: __webpack_require__(1159), + XBOX_360: __webpack_require__(1160) + +}; + + +/***/ }), +/* 1158 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * PlayStation DualShock 4 Gamepad Configuration. + * Sony PlayStation DualShock 4 (v2) wireless controller + * + * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4 + * @type {object} + * @since 3.0.0 + */ +module.exports = { + + UP: 12, + DOWN: 13, + LEFT: 14, + RIGHT: 15, + + SHARE: 8, + OPTIONS: 9, + PS: 16, + TOUCHBAR: 17, + + X: 0, + CIRCLE: 1, + SQUARE: 2, + TRIANGLE: 3, + + L1: 4, + R1: 5, + L2: 6, + R2: 7, + L3: 10, + R3: 11, + + LEFT_STICK_H: 0, + LEFT_STICK_V: 1, + RIGHT_STICK_H: 2, + RIGHT_STICK_V: 3 + +}; + + +/***/ }), +/* 1159 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Tatar SNES USB Controller Gamepad Configuration. + * USB Gamepad (STANDARD GAMEPAD Vendor: 0079 Product: 0011) + * + * @name Phaser.Input.Gamepad.Configs.SNES_USB + * @type {object} + * @since 3.0.0 + */ +module.exports = { + + UP: 12, + DOWN: 13, + LEFT: 14, + RIGHT: 15, + + SELECT: 8, + START: 9, + + B: 0, + A: 1, + Y: 2, + X: 3, + + LEFT_SHOULDER: 4, + RIGHT_SHOULDER: 5 + +}; + + +/***/ }), +/* 1160 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * XBox 360 Gamepad Configuration. + * + * @name Phaser.Input.Gamepad.Configs.XBOX_360 + * @type {object} + * @since 3.0.0 + */ +module.exports = { + + UP: 12, + DOWN: 13, + LEFT: 14, + RIGHT: 15, + + MENU: 16, + + A: 0, + B: 1, + X: 2, + Y: 3, + + LB: 4, + RB: 5, + + LT: 6, + RT: 7, + + BACK: 8, + START: 9, + + LS: 10, + RS: 11, + + LEFT_STICK_H: 0, + LEFT_STICK_V: 1, + RIGHT_STICK_H: 2, + RIGHT_STICK_V: 3 + +}; + + +/***/ }), +/* 1161 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Circle = __webpack_require__(77); +var CircleContains = __webpack_require__(46); +var Class = __webpack_require__(0); +var CONST = __webpack_require__(175); +var CreateInteractiveObject = __webpack_require__(422); +var CreatePixelPerfectHandler = __webpack_require__(1162); +var DistanceBetween = __webpack_require__(57); +var Ellipse = __webpack_require__(92); +var EllipseContains = __webpack_require__(93); +var Events = __webpack_require__(53); +var EventEmitter = __webpack_require__(11); +var GetFastValue = __webpack_require__(2); +var InputPluginCache = __webpack_require__(131); +var IsPlainObject = __webpack_require__(7); +var PluginCache = __webpack_require__(18); +var Rectangle = __webpack_require__(10); +var RectangleContains = __webpack_require__(47); +var SceneEvents = __webpack_require__(19); +var Triangle = __webpack_require__(69); +var TriangleContains = __webpack_require__(81); + +/** + * @classdesc + * The Input Plugin belongs to a Scene and handles all input related events and operations for it. + * + * You can access it from within a Scene using `this.input`. + * + * It emits events directly. For example, you can do: + * + * ```javascript + * this.input.on('pointerdown', callback, context); + * ``` + * + * To listen for a pointer down event anywhere on the game canvas. + * + * Game Objects can be enabled for input by calling their `setInteractive` method. After which they + * will directly emit input events: + * + * ```javascript + * var sprite = this.add.sprite(x, y, texture); + * sprite.setInteractive(); + * sprite.on('pointerdown', callback, context); + * ``` + * + * There are lots of game configuration options available relating to input. + * See the [Input Config object]{@linkcode Phaser.Types.Core.InputConfig} for more details, including how to deal with Phaser + * listening for input events outside of the canvas, how to set a default number of pointers, input + * capture settings and more. + * + * Please also see the Input examples and tutorials for further information. + * + * @class InputPlugin + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Input + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that this Input Plugin is responsible for. + */ +var InputPlugin = new Class({ + + Extends: EventEmitter, + + initialize: + + function InputPlugin (scene) + { + EventEmitter.call(this); + + /** + * A reference to the Scene that this Input Plugin is responsible for. + * + * @name Phaser.Input.InputPlugin#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Scene Systems class. + * + * @name Phaser.Input.InputPlugin#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * A reference to the Scene Systems Settings. + * + * @name Phaser.Input.InputPlugin#settings + * @type {Phaser.Types.Scenes.SettingsObject} + * @since 3.5.0 + */ + this.settings = scene.sys.settings; + + /** + * A reference to the Game Input Manager. + * + * @name Phaser.Input.InputPlugin#manager + * @type {Phaser.Input.InputManager} + * @since 3.0.0 + */ + this.manager = scene.sys.game.input; + + /** + * Internal event queue used for plugins only. + * + * @name Phaser.Input.InputPlugin#pluginEvents + * @type {Phaser.Events.EventEmitter} + * @private + * @since 3.10.0 + */ + this.pluginEvents = new EventEmitter(); + + /** + * If `true` this Input Plugin will process DOM input events. + * + * @name Phaser.Input.InputPlugin#enabled + * @type {boolean} + * @default true + * @since 3.5.0 + */ + this.enabled = true; + + /** + * A reference to the Scene Display List. This property is set during the `boot` method. + * + * @name Phaser.Input.InputPlugin#displayList + * @type {Phaser.GameObjects.DisplayList} + * @since 3.0.0 + */ + this.displayList; + + /** + * A reference to the Scene Cameras Manager. This property is set during the `boot` method. + * + * @name Phaser.Input.InputPlugin#cameras + * @type {Phaser.Cameras.Scene2D.CameraManager} + * @since 3.0.0 + */ + this.cameras; + + // Inject the available input plugins into this class + InputPluginCache.install(this); + + /** + * A reference to the Mouse Manager. + * + * This property is only set if Mouse support has been enabled in your Game Configuration file. + * + * If you just wish to get access to the mouse pointer, use the `mousePointer` property instead. + * + * @name Phaser.Input.InputPlugin#mouse + * @type {?Phaser.Input.Mouse.MouseManager} + * @since 3.0.0 + */ + this.mouse = this.manager.mouse; + + /** + * When set to `true` (the default) the Input Plugin will emulate DOM behavior by only emitting events from + * the top-most Game Objects in the Display List. + * + * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one. + * + * @name Phaser.Input.InputPlugin#topOnly + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.topOnly = true; + + /** + * How often should the Pointers be checked? + * + * The value is a time, given in ms, and is the time that must have elapsed between game steps before + * the Pointers will be polled again. When a pointer is polled it runs a hit test to see which Game + * Objects are currently below it, or being interacted with it. + * + * Pointers will *always* be checked if they have been moved by the user, or press or released. + * + * This property only controls how often they will be polled if they have not been updated. + * You should set this if you want to have Game Objects constantly check against the pointers, even + * if the pointer didn't itself move. + * + * Set to 0 to poll constantly. Set to -1 to only poll on user movement. + * + * @name Phaser.Input.InputPlugin#pollRate + * @type {integer} + * @default -1 + * @since 3.0.0 + */ + this.pollRate = -1; + + /** + * Internal poll timer value. + * + * @name Phaser.Input.InputPlugin#_pollTimer + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._pollTimer = 0; + + var _eventData = { cancelled: false }; + + /** + * Internal event propagation callback container. + * + * @name Phaser.Input.InputPlugin#_eventContainer + * @type {Phaser.Types.Input.EventData} + * @private + * @since 3.13.0 + */ + this._eventContainer = { + stopPropagation: function () + { + _eventData.cancelled = true; + } + }; + + /** + * Internal event propagation data object. + * + * @name Phaser.Input.InputPlugin#_eventData + * @type {object} + * @private + * @since 3.13.0 + */ + this._eventData = _eventData; + + /** + * The distance, in pixels, a pointer has to move while being held down, before it thinks it is being dragged. + * + * @name Phaser.Input.InputPlugin#dragDistanceThreshold + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.dragDistanceThreshold = 0; + + /** + * The amount of time, in ms, a pointer has to be held down before it thinks it is dragging. + * + * @name Phaser.Input.InputPlugin#dragTimeThreshold + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.dragTimeThreshold = 0; + + /** + * Used to temporarily store the results of the Hit Test + * + * @name Phaser.Input.InputPlugin#_temp + * @type {array} + * @private + * @default [] + * @since 3.0.0 + */ + this._temp = []; + + /** + * Used to temporarily store the results of the Hit Test dropZones + * + * @name Phaser.Input.InputPlugin#_tempZones + * @type {array} + * @private + * @default [] + * @since 3.0.0 + */ + this._tempZones = []; + + /** + * A list of all Game Objects that have been set to be interactive in the Scene this Input Plugin is managing. + * + * @name Phaser.Input.InputPlugin#_list + * @type {Phaser.GameObjects.GameObject[]} + * @private + * @default [] + * @since 3.0.0 + */ + this._list = []; + + /** + * Objects waiting to be inserted to the list on the next call to 'begin'. + * + * @name Phaser.Input.InputPlugin#_pendingInsertion + * @type {Phaser.GameObjects.GameObject[]} + * @private + * @default [] + * @since 3.0.0 + */ + this._pendingInsertion = []; + + /** + * Objects waiting to be removed from the list on the next call to 'begin'. + * + * @name Phaser.Input.InputPlugin#_pendingRemoval + * @type {Phaser.GameObjects.GameObject[]} + * @private + * @default [] + * @since 3.0.0 + */ + this._pendingRemoval = []; + + /** + * A list of all Game Objects that have been enabled for dragging. + * + * @name Phaser.Input.InputPlugin#_draggable + * @type {Phaser.GameObjects.GameObject[]} + * @private + * @default [] + * @since 3.0.0 + */ + this._draggable = []; + + /** + * A list of all Interactive Objects currently considered as being 'draggable' by any pointer, indexed by pointer ID. + * + * @name Phaser.Input.InputPlugin#_drag + * @type {{0:Array,1:Array,2:Array,3:Array,4:Array,5:Array,6:Array,7:Array,8:Array,9:Array,10:Array}} + * @private + * @since 3.0.0 + */ + this._drag = { 0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [] }; + + /** + * A array containing the dragStates, for this Scene, index by the Pointer ID. + * + * @name Phaser.Input.InputPlugin#_dragState + * @type {integer[]} + * @private + * @since 3.16.0 + */ + this._dragState = []; + + /** + * A list of all Interactive Objects currently considered as being 'over' by any pointer, indexed by pointer ID. + * + * @name Phaser.Input.InputPlugin#_over + * @type {{0:Array,1:Array,2:Array,3:Array,4:Array,5:Array,6:Array,7:Array,8:Array,9:Array,10:Array}} + * @private + * @since 3.0.0 + */ + this._over = { 0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [] }; + + /** + * A list of valid DOM event types. + * + * @name Phaser.Input.InputPlugin#_validTypes + * @type {string[]} + * @private + * @since 3.0.0 + */ + this._validTypes = [ 'onDown', 'onUp', 'onOver', 'onOut', 'onMove', 'onDragStart', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragLeave', 'onDragOver', 'onDrop' ]; + + /** + * Internal property that tracks frame event state. + * + * @name Phaser.Input.InputPlugin#_updatedThisFrame + * @type {boolean} + * @private + * @since 3.18.0 + */ + this._updatedThisFrame = false; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Input.InputPlugin#boot + * @fires Phaser.Input.Events#BOOT + * @private + * @since 3.5.1 + */ + boot: function () + { + this.cameras = this.systems.cameras; + + this.displayList = this.systems.displayList; + + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + + // Registered input plugins listen for this + this.pluginEvents.emit(Events.BOOT); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Input.InputPlugin#start + * @fires Phaser.Input.Events#START + * @private + * @since 3.5.0 + */ + start: function () + { + var eventEmitter = this.systems.events; + + eventEmitter.on(SceneEvents.TRANSITION_START, this.transitionIn, this); + eventEmitter.on(SceneEvents.TRANSITION_OUT, this.transitionOut, this); + eventEmitter.on(SceneEvents.TRANSITION_COMPLETE, this.transitionComplete, this); + eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this); + eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); + + this.manager.events.on(Events.GAME_OUT, this.onGameOut, this); + this.manager.events.on(Events.GAME_OVER, this.onGameOver, this); + + this.enabled = true; + + // Populate the pointer drag states + this._dragState = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; + + // Registered input plugins listen for this + this.pluginEvents.emit(Events.START); + }, + + /** + * Game Over handler. + * + * @method Phaser.Input.InputPlugin#onGameOver + * @fires Phaser.Input.Events#GAME_OVER + * @private + * @since 3.16.2 + */ + onGameOver: function (event) + { + if (this.isActive()) + { + this.emit(Events.GAME_OVER, event.timeStamp, event); + } + }, + + /** + * Game Out handler. + * + * @method Phaser.Input.InputPlugin#onGameOut + * @fires Phaser.Input.Events#GAME_OUT + * @private + * @since 3.16.2 + */ + onGameOut: function (event) + { + if (this.isActive()) + { + this.emit(Events.GAME_OUT, event.timeStamp, event); + } + }, + + /** + * The pre-update handler is responsible for checking the pending removal and insertion lists and + * deleting old Game Objects. + * + * @method Phaser.Input.InputPlugin#preUpdate + * @private + * @fires Phaser.Input.Events#PRE_UPDATE + * @since 3.0.0 + */ + preUpdate: function () + { + // Registered input plugins listen for this + this.pluginEvents.emit(Events.PRE_UPDATE); + + var removeList = this._pendingRemoval; + var insertList = this._pendingInsertion; + + var toRemove = removeList.length; + var toInsert = insertList.length; + + if (toRemove === 0 && toInsert === 0) + { + // Quick bail + return; + } + + var current = this._list; + + // Delete old gameObjects + for (var i = 0; i < toRemove; i++) + { + var gameObject = removeList[i]; + + var index = current.indexOf(gameObject); + + if (index > -1) + { + current.splice(index, 1); + + this.clear(gameObject, true); + } + } + + // Clear the removal list + removeList.length = 0; + this._pendingRemoval.length = 0; + + // Move pendingInsertion to list (also clears pendingInsertion at the same time) + this._list = current.concat(insertList.splice(0)); + }, + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + * + * @method Phaser.Input.InputPlugin#isActive + * @since 3.10.0 + * + * @return {boolean} `true` if the plugin and the Scene it belongs to is active. + */ + isActive: function () + { + return (this.enabled && this.scene.sys.isActive()); + }, + + /** + * This is called automatically by the Input Manager. + * It emits events for plugins to listen to and also handles polling updates, if enabled. + * + * @method Phaser.Input.InputPlugin#updatePoll + * @since 3.18.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + * + * @return {boolean} `true` if the plugin and the Scene it belongs to is active. + */ + updatePoll: function (time, delta) + { + if (!this.isActive()) + { + return false; + } + + // So the Gamepad and Keyboard update, regardless + this.pluginEvents.emit(Events.UPDATE, time, delta); + + // Nothing else? Let's leave + if (this._list.length === 0 || this._updatedThisFrame) + { + this._updatedThisFrame = false; + + return false; + } + + var rate = this.pollRate; + + if (rate === -1) + { + return false; + } + else if (rate > 0) + { + this._pollTimer -= delta; + + if (this._pollTimer < 0) + { + // Discard timer diff, we're ready to poll again + this._pollTimer = this.pollRate; + } + else + { + // Not enough time has elapsed since the last poll, so abort now + return false; + } + } + + // We got this far? Then we should poll for movement + var manager = this.manager; + + var pointers = manager.pointers; + var pointersTotal = manager.pointersTotal; + var captured = false; + + for (var i = 0; i < pointersTotal; i++) + { + var total = 0; + var pointer = pointers[i]; + + // Always reset this array + this._tempZones = []; + + // _temp contains a hit tested and camera culled list of IO objects + this._temp = this.hitTestPointer(pointer); + + this.sortGameObjects(this._temp); + this.sortGameObjects(this._tempZones); + + if (this.topOnly) + { + // Only the top-most one counts now, so safely ignore the rest + if (this._temp.length) + { + this._temp.splice(1); + } + + if (this._tempZones.length) + { + this._tempZones.splice(1); + } + } + + total += this.processOverOutEvents(pointer); + + this.processDragThresholdEvent(pointer); + + if (total > 0) + { + // We interacted with an event in this Scene, so block any Scenes below us from doing the same this frame + captured = true; + } + } + + return captured; + }, + + /** + * This method is called when a DOM Event is received by the Input Manager. It handles dispatching the events + * to relevant input enabled Game Objects in this scene. + * + * @method Phaser.Input.InputPlugin#update + * @private + * @fires Phaser.Input.Events#UPDATE + * @since 3.0.0 + * + * @param {integer} type - The type of event to process. + * @param {Phaser.Input.Pointer[]} pointers - An array of Pointers on which the event occurred. + * + * @return {boolean} `true` if this Scene has captured the input events from all other Scenes, otherwise `false`. + */ + update: function (type, pointers) + { + if (!this.isActive()) + { + return false; + } + + var pointersTotal = pointers.length; + var captured = false; + + for (var i = 0; i < pointersTotal; i++) + { + var total = 0; + var pointer = pointers[i]; + + // Always reset this array + this._tempZones = []; + + // _temp contains a hit tested and camera culled list of IO objects + this._temp = this.hitTestPointer(pointer); + + this.sortGameObjects(this._temp); + this.sortGameObjects(this._tempZones); + + if (this.topOnly) + { + // Only the top-most one counts now, so safely ignore the rest + if (this._temp.length) + { + this._temp.splice(1); + } + + if (this._tempZones.length) + { + this._tempZones.splice(1); + } + } + + switch (type) + { + case CONST.MOUSE_DOWN: + total += this.processDragDownEvent(pointer); + total += this.processDownEvents(pointer); + total += this.processOverOutEvents(pointer); + break; + + case CONST.MOUSE_UP: + total += this.processDragUpEvent(pointer); + total += this.processUpEvents(pointer); + total += this.processOverOutEvents(pointer); + break; + + case CONST.TOUCH_START: + total += this.processDragDownEvent(pointer); + total += this.processDownEvents(pointer); + total += this.processOverEvents(pointer); + break; + + case CONST.TOUCH_END: + case CONST.TOUCH_CANCEL: + total += this.processDragUpEvent(pointer); + total += this.processUpEvents(pointer); + total += this.processOutEvents(pointer); + break; + + case CONST.MOUSE_MOVE: + case CONST.TOUCH_MOVE: + total += this.processDragMoveEvent(pointer); + total += this.processMoveEvents(pointer); + total += this.processOverOutEvents(pointer); + break; + + case CONST.MOUSE_WHEEL: + total += this.processWheelEvent(pointer); + break; + } + + if (total > 0) + { + // We interacted with an event in this Scene, so block any Scenes below us from doing the same this frame + captured = true; + } + } + + this._updatedThisFrame = true; + + return captured; + }, + + /** + * Clears a Game Object so it no longer has an Interactive Object associated with it. + * The Game Object is then queued for removal from the Input Plugin on the next update. + * + * @method Phaser.Input.InputPlugin#clear + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will have its Interactive Object removed. + * @param {boolean} [skipQueue=false] - Skip adding this Game Object into the removal queue? + * + * @return {Phaser.GameObjects.GameObject} The Game Object that had its Interactive Object removed. + */ + clear: function (gameObject, skipQueue) + { + if (skipQueue === undefined) { skipQueue = false; } + + var input = gameObject.input; + + // If GameObject.input already cleared from higher class + if (!input) + { + return; + } + + if (!skipQueue) + { + this.queueForRemoval(gameObject); + } + + input.gameObject = undefined; + input.target = undefined; + input.hitArea = undefined; + input.hitAreaCallback = undefined; + input.callbackContext = undefined; + + this.manager.resetCursor(input); + + gameObject.input = null; + + // Clear from _draggable, _drag and _over + var index = this._draggable.indexOf(gameObject); + + if (index > -1) + { + this._draggable.splice(index, 1); + } + + index = this._drag[0].indexOf(gameObject); + + if (index > -1) + { + this._drag[0].splice(index, 1); + } + + index = this._over[0].indexOf(gameObject); + + if (index > -1) + { + this._over[0].splice(index, 1); + } + + return gameObject; + }, + + /** + * Disables Input on a single Game Object. + * + * An input disabled Game Object still retains its Interactive Object component and can be re-enabled + * at any time, by passing it to `InputPlugin.enable`. + * + * @method Phaser.Input.InputPlugin#disable + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to have its input system disabled. + */ + disable: function (gameObject) + { + gameObject.input.enabled = false; + }, + + /** + * Enable a Game Object for interaction. + * + * If the Game Object already has an Interactive Object component, it is enabled and returned. + * + * Otherwise, a new Interactive Object component is created and assigned to the Game Object's `input` property. + * + * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area + * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced + * input detection. + * + * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If + * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific + * shape for it to use. + * + * You can also provide an Input Configuration Object as the only argument to this method. + * + * @method Phaser.Input.InputPlugin#enable + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to be enabled for input. + * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The 'contains' function to invoke to check if the pointer is within the hit area. + * @param {boolean} [dropZone=false] - Is this Game Object a drop zone or not? + * + * @return {Phaser.Input.InputPlugin} This Input Plugin. + */ + enable: function (gameObject, shape, callback, dropZone) + { + if (dropZone === undefined) { dropZone = false; } + + if (gameObject.input) + { + // If it is already has an InteractiveObject then just enable it and return + gameObject.input.enabled = true; + } + else + { + // Create an InteractiveObject and enable it + this.setHitArea(gameObject, shape, callback); + } + + if (gameObject.input && dropZone && !gameObject.input.dropZone) + { + gameObject.input.dropZone = dropZone; + } + + return this; + }, + + /** + * Takes the given Pointer and performs a hit test against it, to see which interactive Game Objects + * it is currently above. + * + * The hit test is performed against which-ever Camera the Pointer is over. If it is over multiple + * cameras, it starts checking the camera at the top of the camera list, and if nothing is found, iterates down the list. + * + * @method Phaser.Input.InputPlugin#hitTestPointer + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to check against the Game Objects. + * + * @return {Phaser.GameObjects.GameObject[]} An array of all the interactive Game Objects the Pointer was above. + */ + hitTestPointer: function (pointer) + { + var cameras = this.cameras.getCamerasBelowPointer(pointer); + + for (var c = 0; c < cameras.length; c++) + { + var camera = cameras[c]; + + // Get a list of all objects that can be seen by the camera below the pointer in the scene and store in 'over' array. + // All objects in this array are input enabled, as checked by the hitTest method, so we don't need to check later on as well. + var over = this.manager.hitTest(pointer, this._list, camera); + + // Filter out the drop zones + for (var i = 0; i < over.length; i++) + { + var obj = over[i]; + + if (obj.input.dropZone) + { + this._tempZones.push(obj); + } + } + + if (over.length > 0) + { + pointer.camera = camera; + + return over; + } + } + + // If we got this far then there were no Game Objects below the pointer, but it was still over + // a camera, so set that the top-most one into the pointer + + pointer.camera = cameras[0]; + + return []; + }, + + /** + * An internal method that handles the Pointer down event. + * + * @method Phaser.Input.InputPlugin#processDownEvents + * @private + * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_DOWN + * @fires Phaser.Input.Events#GAMEOBJECT_DOWN + * @fires Phaser.Input.Events#POINTER_DOWN + * @fires Phaser.Input.Events#POINTER_DOWN_OUTSIDE + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer being tested. + * + * @return {integer} The total number of objects interacted with. + */ + processDownEvents: function (pointer) + { + var total = 0; + var currentlyOver = this._temp; + + var _eventData = this._eventData; + var _eventContainer = this._eventContainer; + + _eventData.cancelled = false; + + var aborted = false; + + // Go through all objects the pointer was over and fire their events / callbacks + for (var i = 0; i < currentlyOver.length; i++) + { + var gameObject = currentlyOver[i]; + + if (!gameObject.input) + { + continue; + } + + total++; + + gameObject.emit(Events.GAMEOBJECT_POINTER_DOWN, pointer, gameObject.input.localX, gameObject.input.localY, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + + this.emit(Events.GAMEOBJECT_DOWN, pointer, gameObject, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + } + + // If they released outside the canvas, but pressed down inside it, we'll still dispatch the event. + if (!aborted) + { + if (pointer.downElement === this.manager.game.canvas) + { + this.emit(Events.POINTER_DOWN, pointer, currentlyOver); + } + else + { + this.emit(Events.POINTER_DOWN_OUTSIDE, pointer); + } + } + + return total; + }, + + /** + * Returns the drag state of the given Pointer for this Input Plugin. + * + * The state will be one of the following: + * + * 0 = Not dragging anything + * 1 = Primary button down and objects below, so collect a draglist + * 2 = Pointer being checked if meets drag criteria + * 3 = Pointer meets criteria, notify the draglist + * 4 = Pointer actively dragging the draglist and has moved + * 5 = Pointer actively dragging but has been released, notify draglist + * + * @method Phaser.Input.InputPlugin#getDragState + * @since 3.16.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to get the drag state for. + * + * @return {integer} The drag state of the given Pointer. + */ + getDragState: function (pointer) + { + return this._dragState[pointer.id]; + }, + + /** + * Sets the drag state of the given Pointer for this Input Plugin. + * + * The state must be one of the following values: + * + * 0 = Not dragging anything + * 1 = Primary button down and objects below, so collect a draglist + * 2 = Pointer being checked if meets drag criteria + * 3 = Pointer meets criteria, notify the draglist + * 4 = Pointer actively dragging the draglist and has moved + * 5 = Pointer actively dragging but has been released, notify draglist + * + * @method Phaser.Input.InputPlugin#setDragState + * @since 3.16.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to set the drag state for. + * @param {integer} state - The drag state value. An integer between 0 and 5. + */ + setDragState: function (pointer, state) + { + this._dragState[pointer.id] = state; + }, + + /** + * Checks to see if a Pointer is ready to drag the objects below it, based on either a distance + * or time threshold. + * + * @method Phaser.Input.InputPlugin#processDragThresholdEvent + * @private + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to check the drag thresholds on. + * @param {number} time - The current time. + */ + processDragThresholdEvent: function (pointer, time) + { + var passed = false; + var timeThreshold = this.dragTimeThreshold; + var distanceThreshold = this.dragDistanceThreshold; + + if (distanceThreshold > 0 && DistanceBetween(pointer.x, pointer.y, pointer.downX, pointer.downY) >= distanceThreshold) + { + // It has moved far enough to be considered a drag + passed = true; + } + else if (timeThreshold > 0 && (time >= pointer.downTime + timeThreshold)) + { + // It has been held down long enough to be considered a drag + passed = true; + } + + if (passed) + { + this.setDragState(pointer, 3); + + return this.processDragStartList(pointer); + } + }, + + /** + * Processes the drag list for the given pointer and dispatches the start events for each object on it. + * + * @method Phaser.Input.InputPlugin#processDragStartList + * @private + * @fires Phaser.Input.Events#DRAG_START + * @fires Phaser.Input.Events#GAMEOBJECT_DRAG_START + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. + * + * @return {integer} The number of items that DRAG_START was called on. + */ + processDragStartList: function (pointer) + { + // 3 = Pointer meets criteria and is freshly down, notify the draglist + if (this.getDragState(pointer) !== 3) + { + return 0; + } + + var list = this._drag[pointer.id]; + + for (var i = 0; i < list.length; i++) + { + var gameObject = list[i]; + + var input = gameObject.input; + + input.dragState = 2; + + input.dragStartX = gameObject.x; + input.dragStartY = gameObject.y; + + input.dragStartXGlobal = pointer.x; + input.dragStartYGlobal = pointer.y; + + input.dragX = input.dragStartXGlobal - input.dragStartX; + input.dragY = input.dragStartYGlobal - input.dragStartY; + + gameObject.emit(Events.GAMEOBJECT_DRAG_START, pointer, input.dragX, input.dragY); + + this.emit(Events.DRAG_START, pointer, gameObject); + } + + this.setDragState(pointer, 4); + + return list.length; + }, + + /** + * Processes a 'drag down' event for the given pointer. Checks the pointer state, builds-up the drag list + * and prepares them all for interaction. + * + * @method Phaser.Input.InputPlugin#processDragDownEvent + * @private + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. + * + * @return {integer} The number of items that were collected on the drag list. + */ + processDragDownEvent: function (pointer) + { + var currentlyOver = this._temp; + + if (this._draggable.length === 0 || currentlyOver.length === 0 || !pointer.primaryDown || this.getDragState(pointer) !== 0) + { + // There are no draggable items, no over items or the pointer isn't down, so let's not even bother going further + return 0; + } + + // 1 = Primary button down and objects below, so collect a draglist + this.setDragState(pointer, 1); + + // Get draggable objects, sort them, pick the top (or all) and store them somewhere + var draglist = []; + + for (var i = 0; i < currentlyOver.length; i++) + { + var gameObject = currentlyOver[i]; + + if (gameObject.input.draggable && (gameObject.input.dragState === 0)) + { + draglist.push(gameObject); + } + } + + if (draglist.length === 0) + { + this.setDragState(pointer, 0); + + return 0; + } + else if (draglist.length > 1) + { + this.sortGameObjects(draglist); + + if (this.topOnly) + { + draglist.splice(1); + } + } + + // draglist now contains all potential candidates for dragging + this._drag[pointer.id] = draglist; + + if (this.dragDistanceThreshold === 0 || this.dragTimeThreshold === 0) + { + // No drag criteria, so snap immediately to mode 3 + this.setDragState(pointer, 3); + + return this.processDragStartList(pointer); + } + else + { + // Check the distance / time on the next event + this.setDragState(pointer, 2); + + return 0; + } + }, + + /** + * Processes a 'drag move' event for the given pointer. + * + * @method Phaser.Input.InputPlugin#processDragMoveEvent + * @private + * @fires Phaser.Input.Events#DRAG_ENTER + * @fires Phaser.Input.Events#DRAG + * @fires Phaser.Input.Events#DRAG_LEAVE + * @fires Phaser.Input.Events#DRAG_OVER + * @fires Phaser.Input.Events#GAMEOBJECT_DRAG_ENTER + * @fires Phaser.Input.Events#GAMEOBJECT_DRAG + * @fires Phaser.Input.Events#GAMEOBJECT_DRAG_LEAVE + * @fires Phaser.Input.Events#GAMEOBJECT_DRAG_OVER + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. + * + * @return {integer} The number of items that were updated by this drag event. + */ + processDragMoveEvent: function (pointer) + { + if (this.getDragState(pointer) !== 4) + { + return 0; + } + + // 4 = Pointer actively dragging the draglist and has moved + var dropZones = this._tempZones; + + var list = this._drag[pointer.id]; + + for (var i = 0; i < list.length; i++) + { + var gameObject = list[i]; + + var input = gameObject.input; + + var target = input.target; + + // If this GO has a target then let's check it + if (target) + { + var index = dropZones.indexOf(target); + + // Got a target, are we still over it? + if (index === 0) + { + // We're still over it, and it's still the top of the display list, phew ... + gameObject.emit(Events.GAMEOBJECT_DRAG_OVER, pointer, target); + + this.emit(Events.DRAG_OVER, pointer, gameObject, target); + } + else if (index > 0) + { + // Still over it but it's no longer top of the display list (targets must always be at the top) + gameObject.emit(Events.GAMEOBJECT_DRAG_LEAVE, pointer, target); + + this.emit(Events.DRAG_LEAVE, pointer, gameObject, target); + + input.target = dropZones[0]; + + target = input.target; + + gameObject.emit(Events.GAMEOBJECT_DRAG_ENTER, pointer, target); + + this.emit(Events.DRAG_ENTER, pointer, gameObject, target); + } + else + { + // Nope, we've moved on (or the target has!), leave the old target + gameObject.emit(Events.GAMEOBJECT_DRAG_LEAVE, pointer, target); + + this.emit(Events.DRAG_LEAVE, pointer, gameObject, target); + + // Anything new to replace it? + // Yup! + if (dropZones[0]) + { + input.target = dropZones[0]; + + target = input.target; + + gameObject.emit(Events.GAMEOBJECT_DRAG_ENTER, pointer, target); + + this.emit(Events.DRAG_ENTER, pointer, gameObject, target); + } + else + { + // Nope + input.target = null; + } + } + } + else if (!target && dropZones[0]) + { + input.target = dropZones[0]; + + target = input.target; + + gameObject.emit(Events.GAMEOBJECT_DRAG_ENTER, pointer, target); + + this.emit(Events.DRAG_ENTER, pointer, gameObject, target); + } + + var dragX; + var dragY; + + if (!gameObject.parentContainer) + { + dragX = pointer.x - input.dragX; + dragY = pointer.y - input.dragY; + } + else + { + var dx = pointer.x - input.dragStartXGlobal; + var dy = pointer.y - input.dragStartYGlobal; + + var rotation = gameObject.getParentRotation(); + + var dxRotated = dx * Math.cos(rotation) + dy * Math.sin(rotation); + var dyRotated = dy * Math.cos(rotation) - dx * Math.sin(rotation); + + dragX = dxRotated + input.dragStartX; + dragY = dyRotated + input.dragStartY; + } + + gameObject.emit(Events.GAMEOBJECT_DRAG, pointer, dragX, dragY); + + this.emit(Events.DRAG, pointer, gameObject, dragX, dragY); + } + + return list.length; + }, + + /** + * Processes a 'drag down' event for the given pointer. Checks the pointer state, builds-up the drag list + * and prepares them all for interaction. + * + * @method Phaser.Input.InputPlugin#processDragUpEvent + * @fires Phaser.Input.Events#DRAG_END + * @fires Phaser.Input.Events#DROP + * @fires Phaser.Input.Events#GAMEOBJECT_DRAG_END + * @fires Phaser.Input.Events#GAMEOBJECT_DROP + * @private + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. + * + * @return {integer} The number of items that were updated by this drag event. + */ + processDragUpEvent: function (pointer) + { + // 5 = Pointer was actively dragging but has been released, notify draglist + var list = this._drag[pointer.id]; + + for (var i = 0; i < list.length; i++) + { + var gameObject = list[i]; + + var input = gameObject.input; + + if (input && input.dragState === 2) + { + input.dragState = 0; + + input.dragX = input.localX - gameObject.displayOriginX; + input.dragY = input.localY - gameObject.displayOriginY; + + var dropped = false; + + var target = input.target; + + if (target) + { + gameObject.emit(Events.GAMEOBJECT_DROP, pointer, target); + + this.emit(Events.DROP, pointer, gameObject, target); + + input.target = null; + + dropped = true; + } + + // And finally the dragend event + + if (gameObject.input) + { + gameObject.emit(Events.GAMEOBJECT_DRAG_END, pointer, input.dragX, input.dragY, dropped); + + this.emit(Events.DRAG_END, pointer, gameObject, dropped); + } + } + } + + this.setDragState(pointer, 0); + + list.splice(0); + + return 0; + }, + + /** + * An internal method that handles the Pointer movement event. + * + * @method Phaser.Input.InputPlugin#processMoveEvents + * @private + * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_MOVE + * @fires Phaser.Input.Events#GAMEOBJECT_MOVE + * @fires Phaser.Input.Events#POINTER_MOVE + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. + * + * @return {integer} The total number of objects interacted with. + */ + processMoveEvents: function (pointer) + { + var total = 0; + var currentlyOver = this._temp; + + var _eventData = this._eventData; + var _eventContainer = this._eventContainer; + + _eventData.cancelled = false; + + var aborted = false; + + // Go through all objects the pointer was over and fire their events / callbacks + for (var i = 0; i < currentlyOver.length; i++) + { + var gameObject = currentlyOver[i]; + + if (!gameObject.input) + { + continue; + } + + total++; + + gameObject.emit(Events.GAMEOBJECT_POINTER_MOVE, pointer, gameObject.input.localX, gameObject.input.localY, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + + this.emit(Events.GAMEOBJECT_MOVE, pointer, gameObject, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + + if (this.topOnly) + { + break; + } + } + + if (!aborted) + { + this.emit(Events.POINTER_MOVE, pointer, currentlyOver); + } + + return total; + }, + + /** + * An internal method that handles a mouse wheel event. + * + * @method Phaser.Input.InputPlugin#processWheelEvent + * @private + * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_WHEEL + * @fires Phaser.Input.Events#GAMEOBJECT_WHEEL + * @fires Phaser.Input.Events#POINTER_WHEEL + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. + * + * @return {integer} The total number of objects interacted with. + */ + processWheelEvent: function (pointer) + { + var total = 0; + var currentlyOver = this._temp; + + var _eventData = this._eventData; + var _eventContainer = this._eventContainer; + + _eventData.cancelled = false; + + var aborted = false; + + var dx = pointer.deltaX; + var dy = pointer.deltaY; + var dz = pointer.deltaZ; + + // Go through all objects the pointer was over and fire their events / callbacks + for (var i = 0; i < currentlyOver.length; i++) + { + var gameObject = currentlyOver[i]; + + if (!gameObject.input) + { + continue; + } + + total++; + + gameObject.emit(Events.GAMEOBJECT_POINTER_WHEEL, pointer, dx, dy, dz, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + + this.emit(Events.GAMEOBJECT_WHEEL, pointer, gameObject, dx, dy, dz, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + } + + if (!aborted) + { + this.emit(Events.POINTER_WHEEL, pointer, currentlyOver, dx, dy, dz); + } + + return total; + }, + + /** + * An internal method that handles the Pointer over events. + * This is called when a touch input hits the canvas, having previously been off of it. + * + * @method Phaser.Input.InputPlugin#processOverEvents + * @private + * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_OVER + * @fires Phaser.Input.Events#GAMEOBJECT_OVER + * @fires Phaser.Input.Events#POINTER_OVER + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. + * + * @return {integer} The total number of objects interacted with. + */ + processOverEvents: function (pointer) + { + var currentlyOver = this._temp; + + var totalInteracted = 0; + + var total = currentlyOver.length; + + var justOver = []; + + if (total > 0) + { + var manager = this.manager; + + var _eventData = this._eventData; + var _eventContainer = this._eventContainer; + + _eventData.cancelled = false; + + var aborted = false; + + for (var i = 0; i < total; i++) + { + var gameObject = currentlyOver[i]; + + if (!gameObject.input) + { + continue; + } + + justOver.push(gameObject); + + manager.setCursor(gameObject.input); + + gameObject.emit(Events.GAMEOBJECT_POINTER_OVER, pointer, gameObject.input.localX, gameObject.input.localY, _eventContainer); + + totalInteracted++; + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + + this.emit(Events.GAMEOBJECT_OVER, pointer, gameObject, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + } + + if (!aborted) + { + this.emit(Events.POINTER_OVER, pointer, justOver); + } + } + + // Then sort it into display list order + this._over[pointer.id] = justOver; + + return totalInteracted; + }, + + /** + * An internal method that handles the Pointer out events. + * This is called when a touch input leaves the canvas, as it can never be 'over' in this case. + * + * @method Phaser.Input.InputPlugin#processOutEvents + * @private + * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_OUT + * @fires Phaser.Input.Events#GAMEOBJECT_OUT + * @fires Phaser.Input.Events#POINTER_OUT + * @since 3.18.0 + * + * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. + * + * @return {integer} The total number of objects interacted with. + */ + processOutEvents: function (pointer) + { + var previouslyOver = this._over[pointer.id]; + + var totalInteracted = 0; + + var total = previouslyOver.length; + + if (total > 0) + { + var manager = this.manager; + + var _eventData = this._eventData; + var _eventContainer = this._eventContainer; + + _eventData.cancelled = false; + + var aborted = false; + + this.sortGameObjects(previouslyOver); + + for (var i = 0; i < total; i++) + { + var gameObject = previouslyOver[i]; + + // Call onOut for everything in the previouslyOver array + for (i = 0; i < total; i++) + { + gameObject = previouslyOver[i]; + + if (!gameObject.input) + { + continue; + } + + manager.resetCursor(gameObject.input); + + gameObject.emit(Events.GAMEOBJECT_POINTER_OUT, pointer, _eventContainer); + + totalInteracted++; + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + + this.emit(Events.GAMEOBJECT_OUT, pointer, gameObject, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + } + + if (!aborted) + { + this.emit(Events.POINTER_OUT, pointer, previouslyOver); + } + } + + this._over[pointer.id] = []; + } + + return totalInteracted; + }, + + /** + * An internal method that handles the Pointer over and out events. + * + * @method Phaser.Input.InputPlugin#processOverOutEvents + * @private + * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_OVER + * @fires Phaser.Input.Events#GAMEOBJECT_OVER + * @fires Phaser.Input.Events#POINTER_OVER + * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_OUT + * @fires Phaser.Input.Events#GAMEOBJECT_OUT + * @fires Phaser.Input.Events#POINTER_OUT + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. + * + * @return {integer} The total number of objects interacted with. + */ + processOverOutEvents: function (pointer) + { + var currentlyOver = this._temp; + + var i; + var gameObject; + var justOut = []; + var justOver = []; + var stillOver = []; + var previouslyOver = this._over[pointer.id]; + var currentlyDragging = this._drag[pointer.id]; + + var manager = this.manager; + + // Go through all objects the pointer was previously over, and see if it still is. + // Splits the previouslyOver array into two parts: justOut and stillOver + + for (i = 0; i < previouslyOver.length; i++) + { + gameObject = previouslyOver[i]; + + if (currentlyOver.indexOf(gameObject) === -1 && currentlyDragging.indexOf(gameObject) === -1) + { + // Not in the currentlyOver array, so must be outside of this object now + justOut.push(gameObject); + } + else + { + // In the currentlyOver array + stillOver.push(gameObject); + } + } + + // Go through all objects the pointer is currently over (the hit test results) + // and if not in the previouslyOver array we know it's a new entry, so add to justOver + for (i = 0; i < currentlyOver.length; i++) + { + gameObject = currentlyOver[i]; + + // Is this newly over? + + if (previouslyOver.indexOf(gameObject) === -1) + { + justOver.push(gameObject); + } + } + + // By this point the arrays are filled, so now we can process what happened... + + // Process the Just Out objects + var total = justOut.length; + + var totalInteracted = 0; + + var _eventData = this._eventData; + var _eventContainer = this._eventContainer; + + _eventData.cancelled = false; + + var aborted = false; + + if (total > 0) + { + this.sortGameObjects(justOut); + + // Call onOut for everything in the justOut array + for (i = 0; i < total; i++) + { + gameObject = justOut[i]; + + if (!gameObject.input) + { + continue; + } + + // Reset cursor before we emit the event, in case they want to change it during the event + manager.resetCursor(gameObject.input); + + gameObject.emit(Events.GAMEOBJECT_POINTER_OUT, pointer, _eventContainer); + + totalInteracted++; + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + + this.emit(Events.GAMEOBJECT_OUT, pointer, gameObject, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + } + + if (!aborted) + { + this.emit(Events.POINTER_OUT, pointer, justOut); + } + } + + // Process the Just Over objects + total = justOver.length; + + _eventData.cancelled = false; + + aborted = false; + + if (total > 0) + { + this.sortGameObjects(justOver); + + // Call onOver for everything in the justOver array + for (i = 0; i < total; i++) + { + gameObject = justOver[i]; + + if (!gameObject.input) + { + continue; + } + + // Set cursor before we emit the event, in case they want to change it during the event + manager.setCursor(gameObject.input); + + gameObject.emit(Events.GAMEOBJECT_POINTER_OVER, pointer, gameObject.input.localX, gameObject.input.localY, _eventContainer); + + totalInteracted++; + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + + this.emit(Events.GAMEOBJECT_OVER, pointer, gameObject, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + } + + if (!aborted) + { + this.emit(Events.POINTER_OVER, pointer, justOver); + } + } + + // Add the contents of justOver to the previously over array + previouslyOver = stillOver.concat(justOver); + + // Then sort it into display list order + this._over[pointer.id] = this.sortGameObjects(previouslyOver); + + return totalInteracted; + }, + + /** + * An internal method that handles the Pointer up events. + * + * @method Phaser.Input.InputPlugin#processUpEvents + * @private + * @fires Phaser.Input.Events#GAMEOBJECT_POINTER_UP + * @fires Phaser.Input.Events#GAMEOBJECT_UP + * @fires Phaser.Input.Events#POINTER_UP + * @fires Phaser.Input.Events#POINTER_UP_OUTSIDE + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. + * + * @return {integer} The total number of objects interacted with. + */ + processUpEvents: function (pointer) + { + var currentlyOver = this._temp; + + var _eventData = this._eventData; + var _eventContainer = this._eventContainer; + + _eventData.cancelled = false; + + var aborted = false; + + // Go through all objects the pointer was over and fire their events / callbacks + for (var i = 0; i < currentlyOver.length; i++) + { + var gameObject = currentlyOver[i]; + + if (!gameObject.input) + { + continue; + } + + gameObject.emit(Events.GAMEOBJECT_POINTER_UP, pointer, gameObject.input.localX, gameObject.input.localY, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + + this.emit(Events.GAMEOBJECT_UP, pointer, gameObject, _eventContainer); + + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } + } + + // If they released outside the canvas, but pressed down inside it, we'll still dispatch the event. + if (!aborted) + { + if (pointer.upElement === this.manager.game.canvas) + { + this.emit(Events.POINTER_UP, pointer, currentlyOver); + } + else + { + this.emit(Events.POINTER_UP_OUTSIDE, pointer); + } + } + + return currentlyOver.length; + }, + + /** + * Queues a Game Object for insertion into this Input Plugin on the next update. + * + * @method Phaser.Input.InputPlugin#queueForInsertion + * @private + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to add. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + queueForInsertion: function (child) + { + if (this._pendingInsertion.indexOf(child) === -1 && this._list.indexOf(child) === -1) + { + this._pendingInsertion.push(child); + } + + return this; + }, + + /** + * Queues a Game Object for removal from this Input Plugin on the next update. + * + * @method Phaser.Input.InputPlugin#queueForRemoval + * @private + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} child - The Game Object to remove. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + queueForRemoval: function (child) + { + this._pendingRemoval.push(child); + + return this; + }, + + /** + * Sets the draggable state of the given array of Game Objects. + * + * They can either be set to be draggable, or can have their draggable state removed by passing `false`. + * + * A Game Object will not fire drag events unless it has been specifically enabled for drag. + * + * @method Phaser.Input.InputPlugin#setDraggable + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to change the draggable state on. + * @param {boolean} [value=true] - Set to `true` if the Game Objects should be made draggable, `false` if they should be unset. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setDraggable: function (gameObjects, value) + { + if (value === undefined) { value = true; } + + if (!Array.isArray(gameObjects)) + { + gameObjects = [ gameObjects ]; + } + + for (var i = 0; i < gameObjects.length; i++) + { + var gameObject = gameObjects[i]; + + gameObject.input.draggable = value; + + var index = this._draggable.indexOf(gameObject); + + if (value && index === -1) + { + this._draggable.push(gameObject); + } + else if (!value && index > -1) + { + this._draggable.splice(index, 1); + } + } + + return this; + }, + + /** + * Creates a function that can be passed to `setInteractive`, `enable` or `setHitArea` that will handle + * pixel-perfect input detection on an Image or Sprite based Game Object, or any custom class that extends them. + * + * The following will create a sprite that is clickable on any pixel that has an alpha value >= 1. + * + * ```javascript + * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect()); + * ``` + * + * The following will create a sprite that is clickable on any pixel that has an alpha value >= 150. + * + * ```javascript + * this.add.sprite(x, y, key).setInteractive(this.input.makePixelPerfect(150)); + * ``` + * + * Once you have made an Interactive Object pixel perfect it impacts all input related events for it: down, up, + * dragstart, drag, etc. + * + * As a pointer interacts with the Game Object it will constantly poll the texture, extracting a single pixel from + * the given coordinates and checking its color values. This is an expensive process, so should only be enabled on + * Game Objects that really need it. + * + * You cannot make non-texture based Game Objects pixel perfect. So this will not work on Graphics, BitmapText, + * Render Textures, Text, Tilemaps, Containers or Particles. + * + * @method Phaser.Input.InputPlugin#makePixelPerfect + * @since 3.10.0 + * + * @param {integer} [alphaTolerance=1] - The alpha level that the pixel should be above to be included as a successful interaction. + * + * @return {function} A Pixel Perfect Handler for use as a hitArea shape callback. + */ + makePixelPerfect: function (alphaTolerance) + { + if (alphaTolerance === undefined) { alphaTolerance = 1; } + + var textureManager = this.systems.textures; + + return CreatePixelPerfectHandler(textureManager, alphaTolerance); + }, + + /** + * Sets the hit area for the given array of Game Objects. + * + * A hit area is typically one of the geometric shapes Phaser provides, such as a `Phaser.Geom.Rectangle` + * or `Phaser.Geom.Circle`. However, it can be any object as long as it works with the provided callback. + * + * If no hit area is provided a Rectangle is created based on the size of the Game Object, if possible + * to calculate. + * + * The hit area callback is the function that takes an `x` and `y` coordinate and returns a boolean if + * those values fall within the area of the shape or not. All of the Phaser geometry objects provide this, + * such as `Phaser.Geom.Rectangle.Contains`. + * + * @method Phaser.Input.InputPlugin#setHitArea + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set the hit area on. + * @param {(Phaser.Types.Input.InputConfiguration|any)} [shape] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The 'contains' function to invoke to check if the pointer is within the hit area. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setHitArea: function (gameObjects, shape, callback) + { + if (shape === undefined) + { + return this.setHitAreaFromTexture(gameObjects); + } + + if (!Array.isArray(gameObjects)) + { + gameObjects = [ gameObjects ]; + } + + var draggable = false; + var dropZone = false; + var cursor = false; + var useHandCursor = false; + var pixelPerfect = false; + + // Config object? + if (IsPlainObject(shape)) + { + var config = shape; + + shape = GetFastValue(config, 'hitArea', null); + callback = GetFastValue(config, 'hitAreaCallback', null); + draggable = GetFastValue(config, 'draggable', false); + dropZone = GetFastValue(config, 'dropZone', false); + cursor = GetFastValue(config, 'cursor', false); + useHandCursor = GetFastValue(config, 'useHandCursor', false); + + pixelPerfect = GetFastValue(config, 'pixelPerfect', false); + var alphaTolerance = GetFastValue(config, 'alphaTolerance', 1); + + if (pixelPerfect) + { + shape = {}; + callback = this.makePixelPerfect(alphaTolerance); + } + + // Still no hitArea or callback? + if (!shape || !callback) + { + this.setHitAreaFromTexture(gameObjects); + } + } + else if (typeof shape === 'function' && !callback) + { + callback = shape; + shape = {}; + } + + for (var i = 0; i < gameObjects.length; i++) + { + var gameObject = gameObjects[i]; + + if (pixelPerfect && gameObject.type === 'Container') + { + console.warn('Cannot pixelPerfect test a Container. Use a custom callback.'); + continue; + } + + var io = (!gameObject.input) ? CreateInteractiveObject(gameObject, shape, callback) : gameObject.input; + + io.customHitArea = true; + io.dropZone = dropZone; + io.cursor = (useHandCursor) ? 'pointer' : cursor; + + gameObject.input = io; + + if (draggable) + { + this.setDraggable(gameObject); + } + + this.queueForInsertion(gameObject); + } + + return this; + }, + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Circle` shape, using + * the given coordinates and radius to control its position and size. + * + * @method Phaser.Input.InputPlugin#setHitAreaCircle + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a circle hit area. + * @param {number} x - The center of the circle. + * @param {number} y - The center of the circle. + * @param {number} radius - The radius of the circle. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Circle.Contains. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setHitAreaCircle: function (gameObjects, x, y, radius, callback) + { + if (callback === undefined) { callback = CircleContains; } + + var shape = new Circle(x, y, radius); + + return this.setHitArea(gameObjects, shape, callback); + }, + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Ellipse` shape, using + * the given coordinates and dimensions to control its position and size. + * + * @method Phaser.Input.InputPlugin#setHitAreaEllipse + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area. + * @param {number} x - The center of the ellipse. + * @param {number} y - The center of the ellipse. + * @param {number} width - The width of the ellipse. + * @param {number} height - The height of the ellipse. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Ellipse.Contains. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setHitAreaEllipse: function (gameObjects, x, y, width, height, callback) + { + if (callback === undefined) { callback = EllipseContains; } + + var shape = new Ellipse(x, y, width, height); + + return this.setHitArea(gameObjects, shape, callback); + }, + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using + * the Game Objects texture frame to define the position and size of the hit area. + * + * @method Phaser.Input.InputPlugin#setHitAreaFromTexture + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Rectangle.Contains. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setHitAreaFromTexture: function (gameObjects, callback) + { + if (callback === undefined) { callback = RectangleContains; } + + if (!Array.isArray(gameObjects)) + { + gameObjects = [ gameObjects ]; + } + + for (var i = 0; i < gameObjects.length; i++) + { + var gameObject = gameObjects[i]; + + var frame = gameObject.frame; + + var width = 0; + var height = 0; + + if (gameObject.width) + { + width = gameObject.width; + height = gameObject.height; + } + else if (frame) + { + width = frame.realWidth; + height = frame.realHeight; + } + + if (gameObject.type === 'Container' && (width === 0 || height === 0)) + { + console.warn('Container.setInteractive must specify a Shape or call setSize() first'); + continue; + } + + if (width !== 0 && height !== 0) + { + gameObject.input = CreateInteractiveObject(gameObject, new Rectangle(0, 0, width, height), callback); + + this.queueForInsertion(gameObject); + } + } + + return this; + }, + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Rectangle` shape, using + * the given coordinates and dimensions to control its position and size. + * + * @method Phaser.Input.InputPlugin#setHitAreaRectangle + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a rectangular hit area. + * @param {number} x - The top-left of the rectangle. + * @param {number} y - The top-left of the rectangle. + * @param {number} width - The width of the rectangle. + * @param {number} height - The height of the rectangle. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Rectangle.Contains. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setHitAreaRectangle: function (gameObjects, x, y, width, height, callback) + { + if (callback === undefined) { callback = RectangleContains; } + + var shape = new Rectangle(x, y, width, height); + + return this.setHitArea(gameObjects, shape, callback); + }, + + /** + * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Triangle` shape, using + * the given coordinates to control the position of its points. + * + * @method Phaser.Input.InputPlugin#setHitAreaTriangle + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a triangular hit area. + * @param {number} x1 - The x coordinate of the first point of the triangle. + * @param {number} y1 - The y coordinate of the first point of the triangle. + * @param {number} x2 - The x coordinate of the second point of the triangle. + * @param {number} y2 - The y coordinate of the second point of the triangle. + * @param {number} x3 - The x coordinate of the third point of the triangle. + * @param {number} y3 - The y coordinate of the third point of the triangle. + * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The hit area callback. If undefined it uses Triangle.Contains. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setHitAreaTriangle: function (gameObjects, x1, y1, x2, y2, x3, y3, callback) + { + if (callback === undefined) { callback = TriangleContains; } + + var shape = new Triangle(x1, y1, x2, y2, x3, y3); + + return this.setHitArea(gameObjects, shape, callback); + }, + + /** + * Sets the Pointers to always poll. + * + * When a pointer is polled it runs a hit test to see which Game Objects are currently below it, + * or being interacted with it, regardless if the Pointer has actually moved or not. + * + * You should enable this if you want objects in your game to fire over / out events, and the objects + * are constantly moving, but the pointer may not have. Polling every frame has additional computation + * costs, especially if there are a large number of interactive objects in your game. + * + * @method Phaser.Input.InputPlugin#setPollAlways + * @since 3.0.0 + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setPollAlways: function () + { + return this.setPollRate(0); + }, + + /** + * Sets the Pointers to only poll when they are moved or updated. + * + * When a pointer is polled it runs a hit test to see which Game Objects are currently below it, + * or being interacted with it. + * + * @method Phaser.Input.InputPlugin#setPollOnMove + * @since 3.0.0 + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setPollOnMove: function () + { + return this.setPollRate(-1); + }, + + /** + * Sets the poll rate value. This is the amount of time that should have elapsed before a pointer + * will be polled again. See the `setPollAlways` and `setPollOnMove` methods. + * + * @method Phaser.Input.InputPlugin#setPollRate + * @since 3.0.0 + * + * @param {number} value - The amount of time, in ms, that should elapsed before re-polling the pointers. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setPollRate: function (value) + { + this.pollRate = value; + this._pollTimer = 0; + + return this; + }, + + /** + * When set to `true` the global Input Manager will emulate DOM behavior by only emitting events from + * the top-most Scene in the Scene List. By default, if a Scene receives an input event it will then stop the event + * from flowing down to any Scenes below it in the Scene list. To disable this behavior call this method with `false`. + * + * @method Phaser.Input.InputPlugin#setGlobalTopOnly + * @since 3.0.0 + * + * @param {boolean} value - Set to `true` to stop processing input events on the Scene that receives it, or `false` to let the event continue down the Scene list. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setGlobalTopOnly: function (value) + { + this.manager.globalTopOnly = value; + + return this; + }, + + /** + * When set to `true` this Input Plugin will emulate DOM behavior by only emitting events from + * the top-most Game Objects in the Display List. + * + * If set to `false` it will emit events from all Game Objects below a Pointer, not just the top one. + * + * @method Phaser.Input.InputPlugin#setTopOnly + * @since 3.0.0 + * + * @param {boolean} value - `true` to only include the top-most Game Object, or `false` to include all Game Objects in a hit test. + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + setTopOnly: function (value) + { + this.topOnly = value; + + return this; + }, + + /** + * Given an array of Game Objects, sort the array and return it, so that the objects are in depth index order + * with the lowest at the bottom. + * + * @method Phaser.Input.InputPlugin#sortGameObjects + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to be sorted. + * + * @return {Phaser.GameObjects.GameObject[]} The sorted array of Game Objects. + */ + sortGameObjects: function (gameObjects) + { + if (gameObjects.length < 2) + { + return gameObjects; + } + + this.scene.sys.depthSort(); + + return gameObjects.sort(this.sortHandlerGO.bind(this)); + }, + + /** + * Return the child lowest down the display list (with the smallest index) + * Will iterate through all parent containers, if present. + * + * @method Phaser.Input.InputPlugin#sortHandlerGO + * @private + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} childA - The first Game Object to compare. + * @param {Phaser.GameObjects.GameObject} childB - The second Game Object to compare. + * + * @return {integer} Returns either a negative or positive integer, or zero if they match. + */ + sortHandlerGO: function (childA, childB) + { + if (!childA.parentContainer && !childB.parentContainer) + { + // Quick bail out when neither child has a container + return this.displayList.getIndex(childB) - this.displayList.getIndex(childA); + } + else if (childA.parentContainer === childB.parentContainer) + { + // Quick bail out when both children have the same container + return childB.parentContainer.getIndex(childB) - childA.parentContainer.getIndex(childA); + } + else if (childA.parentContainer === childB) + { + // Quick bail out when childA is a child of childB + return -1; + } + else if (childB.parentContainer === childA) + { + // Quick bail out when childA is a child of childB + return 1; + } + else + { + // Container index check + var listA = childA.getIndexList(); + var listB = childB.getIndexList(); + var len = Math.min(listA.length, listB.length); + + for (var i = 0; i < len; i++) + { + var indexA = listA[i]; + var indexB = listB[i]; + + if (indexA === indexB) + { + // Go to the next level down + continue; + } + else + { + // Non-matching parents, so return + return indexB - indexA; + } + } + } + + // Technically this shouldn't happen, but ... + return 0; + }, + + /** + * This method should be called from within an input event handler, such as `pointerdown`. + * + * When called, it stops the Input Manager from allowing _this specific event_ to be processed by any other Scene + * not yet handled in the scene list. + * + * @method Phaser.Input.InputPlugin#stopPropagation + * @since 3.0.0 + * + * @return {Phaser.Input.InputPlugin} This InputPlugin object. + */ + stopPropagation: function () + { + this.manager._tempSkip = true; + + return this; + }, + + /** + * Adds new Pointer objects to the Input Manager. + * + * By default Phaser creates 2 pointer objects: `mousePointer` and `pointer1`. + * + * You can create more either by calling this method, or by setting the `input.activePointers` property + * in the Game Config, up to a maximum of 10 pointers. + * + * The first 10 pointers are available via the `InputPlugin.pointerX` properties, once they have been added + * via this method. + * + * @method Phaser.Input.InputPlugin#addPointer + * @since 3.10.0 + * + * @param {integer} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. + * + * @return {Phaser.Input.Pointer[]} An array containing all of the new Pointer objects that were created. + */ + addPointer: function (quantity) + { + return this.manager.addPointer(quantity); + }, + + /** + * Tells the Input system to set a custom cursor. + * + * This cursor will be the default cursor used when interacting with the game canvas. + * + * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. + * + * Any valid CSS cursor value is allowed, including paths to image files, i.e.: + * + * ```javascript + * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); + * ``` + * + * Please read about the differences between browsers when it comes to the file formats and sizes they support: + * + * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor + * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_User_Interface/Using_URL_values_for_the_cursor_property + * + * It's up to you to pick a suitable cursor format that works across the range of browsers you need to support. + * + * @method Phaser.Input.InputPlugin#setDefaultCursor + * @since 3.10.0 + * + * @param {string} cursor - The CSS to be used when setting the default cursor. + * + * @return {Phaser.Input.InputPlugin} This Input instance. + */ + setDefaultCursor: function (cursor) + { + this.manager.setDefaultCursor(cursor); + + return this; + }, + + /** + * The Scene that owns this plugin is transitioning in. + * + * @method Phaser.Input.InputPlugin#transitionIn + * @private + * @since 3.5.0 + */ + transitionIn: function () + { + this.enabled = this.settings.transitionAllowInput; + }, + + /** + * The Scene that owns this plugin has finished transitioning in. + * + * @method Phaser.Input.InputPlugin#transitionComplete + * @private + * @since 3.5.0 + */ + transitionComplete: function () + { + if (!this.settings.transitionAllowInput) + { + this.enabled = true; + } + }, + + /** + * The Scene that owns this plugin is transitioning out. + * + * @method Phaser.Input.InputPlugin#transitionOut + * @private + * @since 3.5.0 + */ + transitionOut: function () + { + this.enabled = this.settings.transitionAllowInput; + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.Input.InputPlugin#shutdown + * @fires Phaser.Input.Events#SHUTDOWN + * @private + * @since 3.0.0 + */ + shutdown: function () + { + // Registered input plugins listen for this + this.pluginEvents.emit(Events.SHUTDOWN); + + this._temp.length = 0; + this._list.length = 0; + this._draggable.length = 0; + this._pendingRemoval.length = 0; + this._pendingInsertion.length = 0; + this._dragState.length = 0; + + for (var i = 0; i < 10; i++) + { + this._drag[i] = []; + this._over[i] = []; + } + + this.removeAllListeners(); + + var eventEmitter = this.systems.events; + + eventEmitter.off(SceneEvents.TRANSITION_START, this.transitionIn, this); + eventEmitter.off(SceneEvents.TRANSITION_OUT, this.transitionOut, this); + eventEmitter.off(SceneEvents.TRANSITION_COMPLETE, this.transitionComplete, this); + eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this); + + this.manager.events.off(Events.GAME_OUT, this.onGameOut, this); + this.manager.events.off(Events.GAME_OVER, this.onGameOver, this); + + eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.Input.InputPlugin#destroy + * @fires Phaser.Input.Events#DESTROY + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + // Registered input plugins listen for this + this.pluginEvents.emit(Events.DESTROY); + + this.pluginEvents.removeAllListeners(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.cameras = null; + this.manager = null; + this.events = null; + this.mouse = null; + }, + + /** + * The x coordinates of the ActivePointer based on the first camera in the camera list. + * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch. + * + * @name Phaser.Input.InputPlugin#x + * @type {number} + * @readonly + * @since 3.0.0 + */ + x: { + + get: function () + { + return this.manager.activePointer.x; + } + + }, + + /** + * The y coordinates of the ActivePointer based on the first camera in the camera list. + * This is only safe to use if your game has just 1 non-transformed camera and doesn't use multi-touch. + * + * @name Phaser.Input.InputPlugin#y + * @type {number} + * @readonly + * @since 3.0.0 + */ + y: { + + get: function () + { + return this.manager.activePointer.y; + } + + }, + + /** + * Are any mouse or touch pointers currently over the game canvas? + * + * @name Phaser.Input.InputPlugin#isOver + * @type {boolean} + * @readonly + * @since 3.16.0 + */ + isOver: { + + get: function () + { + return this.manager.isOver; + } + + }, + + /** + * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. + * If you are supporting both desktop and touch devices then do not use this property, instead use `activePointer` + * which will always map to the most recently interacted pointer. + * + * @name Phaser.Input.InputPlugin#mousePointer + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + mousePointer: { + + get: function () + { + return this.manager.mousePointer; + } + + }, + + /** + * The current active input Pointer. + * + * @name Phaser.Input.InputPlugin#activePointer + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.0.0 + */ + activePointer: { + + get: function () + { + return this.manager.activePointer; + } + + }, + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + * + * @name Phaser.Input.InputPlugin#pointer1 + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + pointer1: { + + get: function () + { + return this.manager.pointers[1]; + } + + }, + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + * + * @name Phaser.Input.InputPlugin#pointer2 + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + pointer2: { + + get: function () + { + return this.manager.pointers[2]; + } + + }, + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + * + * @name Phaser.Input.InputPlugin#pointer3 + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + pointer3: { + + get: function () + { + return this.manager.pointers[3]; + } + + }, + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + * + * @name Phaser.Input.InputPlugin#pointer4 + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + pointer4: { + + get: function () + { + return this.manager.pointers[4]; + } + + }, + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + * + * @name Phaser.Input.InputPlugin#pointer5 + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + pointer5: { + + get: function () + { + return this.manager.pointers[5]; + } + + }, + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + * + * @name Phaser.Input.InputPlugin#pointer6 + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + pointer6: { + + get: function () + { + return this.manager.pointers[6]; + } + + }, + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + * + * @name Phaser.Input.InputPlugin#pointer7 + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + pointer7: { + + get: function () + { + return this.manager.pointers[7]; + } + + }, + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + * + * @name Phaser.Input.InputPlugin#pointer8 + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + pointer8: { + + get: function () + { + return this.manager.pointers[8]; + } + + }, + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + * + * @name Phaser.Input.InputPlugin#pointer9 + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + pointer9: { + + get: function () + { + return this.manager.pointers[9]; + } + + }, + + /** + * A touch-based Pointer object. + * This will be `undefined` by default unless you add a new Pointer using `addPointer`. + * + * @name Phaser.Input.InputPlugin#pointer10 + * @type {Phaser.Input.Pointer} + * @readonly + * @since 3.10.0 + */ + pointer10: { + + get: function () + { + return this.manager.pointers[10]; + } + + } + +}); + +PluginCache.register('InputPlugin', InputPlugin, 'input'); + +module.exports = InputPlugin; + + +/***/ }), +/* 1162 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Creates a new Pixel Perfect Handler function. + * + * Access via `InputPlugin.makePixelPerfect` rather than calling it directly. + * + * @function Phaser.Input.CreatePixelPerfectHandler + * @since 3.10.0 + * + * @param {Phaser.Textures.TextureManager} textureManager - A reference to the Texture Manager. + * @param {integer} alphaTolerance - The alpha level that the pixel should be above to be included as a successful interaction. + * + * @return {function} The new Pixel Perfect Handler function. + */ +var CreatePixelPerfectHandler = function (textureManager, alphaTolerance) +{ + return function (hitArea, x, y, gameObject) + { + var alpha = textureManager.getPixelAlpha(x, y, gameObject.texture.key, gameObject.frame.name); + + return (alpha && alpha >= alphaTolerance); + }; +}; + +module.exports = CreatePixelPerfectHandler; + + +/***/ }), +/* 1163 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Input.Keyboard + */ + +module.exports = { + + Events: __webpack_require__(132), + + KeyboardManager: __webpack_require__(338), + KeyboardPlugin: __webpack_require__(1171), + + Key: __webpack_require__(426), + KeyCodes: __webpack_require__(121), + + KeyCombo: __webpack_require__(427), + + JustDown: __webpack_require__(1176), + JustUp: __webpack_require__(1177), + DownDuration: __webpack_require__(1178), + UpDuration: __webpack_require__(1179) + +}; + + +/***/ }), +/* 1164 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Global Key Down Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. + * + * Listen to this event from within a Scene using: `this.input.keyboard.on('keydown', listener)`. + * + * You can also listen for a specific key being pressed. See [Keyboard.Events.KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_DOWN} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. + * + * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. + * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * There are others. So, please check your extensions if you find you have specific keys that don't work. + * + * @event Phaser.Input.Keyboard.Events#ANY_KEY_DOWN + * @since 3.0.0 + * + * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc. + */ +module.exports = 'keydown'; + + +/***/ }), +/* 1165 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Global Key Up Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. + * + * Listen to this event from within a Scene using: `this.input.keyboard.on('keyup', listener)`. + * + * You can also listen for a specific key being released. See [Keyboard.Events.KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:KEY_UP} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. + * + * @event Phaser.Input.Keyboard.Events#ANY_KEY_UP + * @since 3.0.0 + * + * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc. + */ +module.exports = 'keyup'; + + +/***/ }), +/* 1166 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Key Combo Match Event. + * + * This event is dispatched by the Keyboard Plugin when a [Key Combo]{@link Phaser.Input.Keyboard.KeyCombo} is matched. + * + * Listen for this event from the Key Plugin after a combo has been created: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + * + * @event Phaser.Input.Keyboard.Events#COMBO_MATCH + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.KeyCombo} keycombo - The Key Combo object that was matched. + * @param {KeyboardEvent} event - The native DOM Keyboard Event of the final key in the combo. You can inspect this to learn more about any modifiers, etc. + */ +module.exports = 'keycombomatch'; + + +/***/ }), +/* 1167 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Key Down Event. + * + * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is pressed. + * + * Listen for this event from the Key object instance directly: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * + * spaceBar.on('down', listener) + * ``` + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. + * + * @event Phaser.Input.Keyboard.Events#DOWN + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.Key} key - The Key object that was pressed. + * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc. + */ +module.exports = 'down'; + + +/***/ }), +/* 1168 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Key Down Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down. + * + * Unlike the `ANY_KEY_DOWN` event, this one has a special dynamic event name. For example, to listen for the `A` key being pressed + * use the following from within a Scene: `this.input.keyboard.on('keydown-A', listener)`. You can replace the `-A` part of the event + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * `this.input.keyboard.on('keydown-SPACE', listener)`. + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:DOWN} for details. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * Read [this article on ghosting]{@link http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/} for details. + * + * Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. + * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * There are others. So, please check your extensions if you find you have specific keys that don't work. + * + * @event Phaser.Input.Keyboard.Events#KEY_DOWN + * @since 3.0.0 + * + * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc. + */ +module.exports = 'keydown-'; + + +/***/ }), +/* 1169 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Key Up Event. + * + * This event is dispatched by the Keyboard Plugin when any key on the keyboard is released. + * + * Unlike the `ANY_KEY_UP` event, this one has a special dynamic event name. For example, to listen for the `A` key being released + * use the following from within a Scene: `this.input.keyboard.on('keyup-A', listener)`. You can replace the `-A` part of the event + * name with any valid [Key Code string]{@link Phaser.Input.Keyboard.KeyCodes}. For example, this will listen for the space bar: + * `this.input.keyboard.on('keyup-SPACE', listener)`. + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. + * + * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. + * + * @event Phaser.Input.Keyboard.Events#KEY_UP + * @since 3.0.0 + * + * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc. + */ +module.exports = 'keyup-'; + + +/***/ }), +/* 1170 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Key Up Event. + * + * This event is dispatched by a [Key]{@link Phaser.Input.Keyboard.Key} object when it is released. + * + * Listen for this event from the Key object instance directly: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * + * spaceBar.on('up', listener) + * ``` + * + * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. + * + * @event Phaser.Input.Keyboard.Events#UP + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.Key} key - The Key object that was released. + * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc. + */ +module.exports = 'up'; + + +/***/ }), +/* 1171 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(132); +var GameEvents = __webpack_require__(28); +var GetValue = __webpack_require__(6); +var InputEvents = __webpack_require__(53); +var InputPluginCache = __webpack_require__(131); +var Key = __webpack_require__(426); +var KeyCodes = __webpack_require__(121); +var KeyCombo = __webpack_require__(427); +var KeyMap = __webpack_require__(1175); +var SnapFloor = __webpack_require__(90); + +/** + * @classdesc + * The Keyboard Plugin is an input plugin that belongs to the Scene-owned Input system. + * + * Its role is to listen for native DOM Keyboard Events and then process them. + * + * You do not need to create this class directly, the Input system will create an instance of it automatically. + * + * You can access it from within a Scene using `this.input.keyboard`. For example, you can do: + * + * ```javascript + * this.input.keyboard.on('keydown', callback, context); + * ``` + * + * Or, to listen for a specific key: + * + * ```javascript + * this.input.keyboard.on('keydown-A', callback, context); + * ``` + * + * You can also create Key objects, which you can then poll in your game loop: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * ``` + * + * If you have multiple parallel Scenes, each trying to get keyboard input, be sure to disable capture on them to stop them from + * stealing input from another Scene in the list. You can do this with `this.input.keyboard.enabled = false` within the + * Scene to stop all input, or `this.input.keyboard.preventDefault = false` to stop a Scene halting input on another Scene. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details. + * + * Also please be aware that certain browser extensions can disable or override Phaser keyboard handling. + * For example the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * And there are others. So, please check your extensions before opening Phaser issues about keys that don't work. + * + * @class KeyboardPlugin + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Input.Keyboard + * @constructor + * @since 3.10.0 + * + * @param {Phaser.Input.InputPlugin} sceneInputPlugin - A reference to the Scene Input Plugin that the KeyboardPlugin belongs to. + */ +var KeyboardPlugin = new Class({ + + Extends: EventEmitter, + + initialize: + + function KeyboardPlugin (sceneInputPlugin) + { + EventEmitter.call(this); + + /** + * A reference to the core game, so we can listen for visibility events. + * + * @name Phaser.Input.Keyboard.KeyboardPlugin#game + * @type {Phaser.Game} + * @since 3.16.0 + */ + this.game = sceneInputPlugin.systems.game; + + /** + * A reference to the Scene that this Input Plugin is responsible for. + * + * @name Phaser.Input.Keyboard.KeyboardPlugin#scene + * @type {Phaser.Scene} + * @since 3.10.0 + */ + this.scene = sceneInputPlugin.scene; + + /** + * A reference to the Scene Systems Settings. + * + * @name Phaser.Input.Keyboard.KeyboardPlugin#settings + * @type {Phaser.Types.Scenes.SettingsObject} + * @since 3.10.0 + */ + this.settings = this.scene.sys.settings; + + /** + * A reference to the Scene Input Plugin that created this Keyboard Plugin. + * + * @name Phaser.Input.Keyboard.KeyboardPlugin#sceneInputPlugin + * @type {Phaser.Input.InputPlugin} + * @since 3.10.0 + */ + this.sceneInputPlugin = sceneInputPlugin; + + /** + * A reference to the global Keyboard Manager. + * + * @name Phaser.Input.Keyboard.KeyboardPlugin#manager + * @type {Phaser.Input.InputPlugin} + * @since 3.16.0 + */ + this.manager = sceneInputPlugin.manager.keyboard; + + /** + * A boolean that controls if this Keyboard Plugin is enabled or not. + * Can be toggled on the fly. + * + * @name Phaser.Input.Keyboard.KeyboardPlugin#enabled + * @type {boolean} + * @default true + * @since 3.10.0 + */ + this.enabled = true; + + /** + * An array of Key objects to process. + * + * @name Phaser.Input.Keyboard.KeyboardPlugin#keys + * @type {Phaser.Input.Keyboard.Key[]} + * @since 3.10.0 + */ + this.keys = []; + + /** + * An array of KeyCombo objects to process. + * + * @name Phaser.Input.Keyboard.KeyboardPlugin#combos + * @type {Phaser.Input.Keyboard.KeyCombo[]} + * @since 3.10.0 + */ + this.combos = []; + + sceneInputPlugin.pluginEvents.once(InputEvents.BOOT, this.boot, this); + sceneInputPlugin.pluginEvents.on(InputEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#boot + * @private + * @since 3.10.0 + */ + boot: function () + { + var settings = this.settings.input; + + this.enabled = GetValue(settings, 'keyboard', true); + + var captures = GetValue(settings, 'keyboard.capture', null); + + if (captures) + { + this.addCaptures(captures); + } + + this.sceneInputPlugin.pluginEvents.once(InputEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#start + * @private + * @since 3.10.0 + */ + start: function () + { + if (this.sceneInputPlugin.manager.useQueue) + { + this.sceneInputPlugin.pluginEvents.on(InputEvents.UPDATE, this.update, this); + } + else + { + this.sceneInputPlugin.manager.events.on(InputEvents.MANAGER_PROCESS, this.update, this); + } + + this.sceneInputPlugin.pluginEvents.once(InputEvents.SHUTDOWN, this.shutdown, this); + + this.game.events.on(GameEvents.BLUR, this.resetKeys, this); + }, + + /** + * Checks to see if both this plugin and the Scene to which it belongs is active. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#isActive + * @since 3.10.0 + * + * @return {boolean} `true` if the plugin and the Scene it belongs to is active. + */ + isActive: function () + { + return (this.enabled && this.scene.sys.isActive()); + }, + + /** + * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. + * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. + * + * This `addCapture` method enables consuming keyboard events for specific keys, so they don't bubble up the browser + * and cause the default behaviors. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent + * the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one. + * + * You can pass a single key code value: + * + * ```javascript + * this.input.keyboard.addCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.addCapture([ 62, 63, 64 ]); + * ``` + * + * Or, a comma-delimited string: + * + * ```javascript + * this.input.keyboard.addCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#addCapture + * @since 3.16.0 + * + * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable event capture for. + * + * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object. + */ + addCapture: function (keycode) + { + this.manager.addCapture(keycode); + + return this; + }, + + /** + * Removes an existing key capture. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to remove + * the capture of a key, then it will remove it for any Scene in your game, not just the calling one. + * + * You can pass a single key code value: + * + * ```javascript + * this.input.keyboard.removeCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.removeCapture([ 62, 63, 64 ]); + * ``` + * + * Or, a comma-delimited string: + * + * ```javascript + * this.input.keyboard.removeCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#removeCapture + * @since 3.16.0 + * + * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable event capture for. + * + * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object. + */ + removeCapture: function (keycode) + { + this.manager.removeCapture(keycode); + + return this; + }, + + /** + * Returns an array that contains all of the keyboard captures currently enabled. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#getCaptures + * @since 3.16.0 + * + * @return {integer[]} An array of all the currently capturing key codes. + */ + getCaptures: function () + { + return this.manager.captures; + }, + + /** + * Allows Phaser to prevent any key captures you may have defined from bubbling up the browser. + * You can use this to re-enable event capturing if you had paused it via `disableGlobalCapture`. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#enableGlobalCapture + * @since 3.16.0 + * + * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object. + */ + enableGlobalCapture: function () + { + this.manager.preventDefault = true; + + return this; + }, + + /** + * Disables Phaser from preventing any key captures you may have defined, without actually removing them. + * You can use this to temporarily disable event capturing if, for example, you swap to a DOM element. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#disableGlobalCapture + * @since 3.16.0 + * + * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object. + */ + disableGlobalCapture: function () + { + this.manager.preventDefault = false; + + return this; + }, + + /** + * Removes all keyboard captures. + * + * Note that this is a global change. It will clear all event captures across your game, not just for this specific Scene. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#clearCaptures + * @since 3.16.0 + * + * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object. + */ + clearCaptures: function () + { + this.manager.clearCaptures(); + + return this; + }, + + /** + * Creates and returns an object containing 4 hotkeys for Up, Down, Left and Right, and also Space Bar and shift. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#createCursorKeys + * @since 3.10.0 + * + * @return {Phaser.Types.Input.Keyboard.CursorKeys} An object containing the properties: `up`, `down`, `left`, `right`, `space` and `shift`. + */ + createCursorKeys: function () + { + return this.addKeys({ + up: KeyCodes.UP, + down: KeyCodes.DOWN, + left: KeyCodes.LEFT, + right: KeyCodes.RIGHT, + space: KeyCodes.SPACE, + shift: KeyCodes.SHIFT + }); + }, + + /** + * A practical way to create an object containing user selected hotkeys. + * + * For example: + * + * ```javascript + * this.input.keyboard.addKeys({ 'up': Phaser.Input.Keyboard.KeyCodes.W, 'down': Phaser.Input.Keyboard.KeyCodes.S }); + * ``` + * + * would return an object containing the properties (`up` and `down`) mapped to W and S {@link Phaser.Input.Keyboard.Key} objects. + * + * You can also pass in a comma-separated string: + * + * ```javascript + * this.input.keyboard.addKeys('W,S,A,D'); + * ``` + * + * Which will return an object with the properties W, S, A and D mapped to the relevant Key objects. + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#addKeys + * @since 3.10.0 + * + * @param {(object|string)} keys - An object containing Key Codes, or a comma-separated string. + * @param {boolean} [enableCapture=true] - Automatically call `preventDefault` on the native DOM browser event for the key codes being added. + * @param {boolean} [emitOnRepeat=false] - Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). + * + * @return {object} An object containing Key objects mapped to the input properties. + */ + addKeys: function (keys, enableCapture, emitOnRepeat) + { + if (enableCapture === undefined) { enableCapture = true; } + if (emitOnRepeat === undefined) { emitOnRepeat = false; } + + var output = {}; + + if (typeof keys === 'string') + { + keys = keys.split(','); + + for (var i = 0; i < keys.length; i++) + { + var currentKey = keys[i].trim(); + + if (currentKey) + { + output[currentKey] = this.addKey(currentKey, enableCapture, emitOnRepeat); + } + } + } + else + { + for (var key in keys) + { + output[key] = this.addKey(keys[key], enableCapture, emitOnRepeat); + } + } + + return output; + }, + + /** + * Adds a Key object to this Keyboard Plugin. + * + * The given argument can be either an existing Key object, a string, such as `A` or `SPACE`, or a key code value. + * + * If a Key object is given, and one already exists matching the same key code, the existing one is replaced with the new one. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#addKey + * @since 3.10.0 + * + * @param {(Phaser.Input.Keyboard.Key|string|integer)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param {boolean} [enableCapture=true] - Automatically call `preventDefault` on the native DOM browser event for the key codes being added. + * @param {boolean} [emitOnRepeat=false] - Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). + * + * @return {Phaser.Input.Keyboard.Key} The newly created Key object, or a reference to it if it already existed in the keys array. + */ + addKey: function (key, enableCapture, emitOnRepeat) + { + if (enableCapture === undefined) { enableCapture = true; } + if (emitOnRepeat === undefined) { emitOnRepeat = false; } + + var keys = this.keys; + + if (key instanceof Key) + { + var idx = keys.indexOf(key); + + if (idx > -1) + { + keys[idx] = key; + } + else + { + keys[key.keyCode] = key; + } + + if (enableCapture) + { + this.addCapture(key.keyCode); + } + + key.setEmitOnRepeat(emitOnRepeat); + + return key; + } + + if (typeof key === 'string') + { + key = KeyCodes[key.toUpperCase()]; + } + + if (!keys[key]) + { + keys[key] = new Key(this, key); + + if (enableCapture) + { + this.addCapture(key); + } + + keys[key].setEmitOnRepeat(emitOnRepeat); + } + + return keys[key]; + }, + + /** + * Removes a Key object from this Keyboard Plugin. + * + * The given argument can be either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#removeKey + * @since 3.10.0 + * + * @param {(Phaser.Input.Keyboard.Key|string|integer)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param {boolean} [destroy=false] - Call `Key.destroy` on the removed Key object? + * + * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object. + */ + removeKey: function (key, destroy) + { + if (destroy === undefined) { destroy = false; } + + var keys = this.keys; + var ref; + + if (key instanceof Key) + { + var idx = keys.indexOf(key); + + if (idx > -1) + { + ref = this.keys[idx]; + + this.keys[idx] = undefined; + } + } + else if (typeof key === 'string') + { + key = KeyCodes[key.toUpperCase()]; + } + + if (keys[key]) + { + ref = keys[key]; + + keys[key] = undefined; + } + + if (ref) + { + ref.plugin = null; + + if (destroy) + { + ref.destroy(); + } + } + + return this; + }, + + /** + * Creates a new KeyCombo. + * + * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them + * it will emit a `keycombomatch` event from this Keyboard Plugin. + * + * The keys to be listened for can be defined as: + * + * A string (i.e. 'ATARI') + * An array of either integers (key codes) or strings, or a mixture of both + * An array of objects (such as Key objects) with a public 'keyCode' property + * + * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter) + * you could pass the following array of key codes: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + * + * Or, to listen for the user entering the word PHASER: + * + * ```javascript + * this.input.keyboard.createCombo('PHASER'); + * ``` + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#createCombo + * @since 3.10.0 + * + * @param {(string|integer[]|object[])} keys - The keys that comprise this combo. + * @param {Phaser.Types.Input.Keyboard.KeyComboConfig} [config] - A Key Combo configuration object. + * + * @return {Phaser.Input.Keyboard.KeyCombo} The new KeyCombo object. + */ + createCombo: function (keys, config) + { + return new KeyCombo(this, keys, config); + }, + + /** + * Checks if the given Key object is currently being held down. + * + * The difference between this method and checking the `Key.isDown` property directly is that you can provide + * a duration to this method. For example, if you wanted a key press to fire a bullet, but you only wanted + * it to be able to fire every 100ms, then you can call this method with a `duration` of 100 and it + * will only return `true` every 100ms. + * + * If the Keyboard Plugin has been disabled, this method will always return `false`. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#checkDown + * @since 3.11.0 + * + * @param {Phaser.Input.Keyboard.Key} key - A Key object. + * @param {number} [duration=0] - The duration which must have elapsed before this Key is considered as being down. + * + * @return {boolean} `true` if the Key is down within the duration specified, otherwise `false`. + */ + checkDown: function (key, duration) + { + if (this.enabled && key.isDown) + { + var t = SnapFloor(this.time - key.timeDown, duration); + + if (t > key._tick) + { + key._tick = t; + + return true; + } + } + + return false; + }, + + /** + * Internal update handler called by the Input Plugin, which is in turn invoked by the Game step. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#update + * @private + * @since 3.10.0 + */ + update: function () + { + var queue = this.manager.queue; + var len = queue.length; + + if (!this.isActive() || len === 0) + { + return; + } + + var keys = this.keys; + + // Process the event queue, dispatching all of the events that have stored up + for (var i = 0; i < len; i++) + { + var event = queue[i]; + var code = event.keyCode; + var key = keys[code]; + var repeat = false; + + // Override the default functions (it's too late for the browser to use them anyway, so we may as well) + if (event.cancelled === undefined) + { + // Event allowed to flow across all handlers in this Scene, and any other Scene in the Scene list + event.cancelled = 0; + + // Won't reach any more local (Scene level) handlers + event.stopImmediatePropagation = function () + { + event.cancelled = 1; + }; + + // Won't reach any more handlers in any Scene further down the Scene list + event.stopPropagation = function () + { + event.cancelled = -1; + }; + } + + if (event.cancelled === -1) + { + // This event has been stopped from broadcasting to any other Scene, so abort. + continue; + } + + if (event.type === 'keydown') + { + // Key specific callback first + if (key) + { + repeat = key.isDown; + + key.onDown(event); + } + + if (!event.cancelled && (!key || !repeat)) + { + if (KeyMap[code]) + { + this.emit(Events.KEY_DOWN + KeyMap[code], event); + + // Deprecated, kept in for compatibility with 3.15 + // To be removed by 3.20. + this.emit('keydown_' + KeyMap[code], event); + } + + if (!event.cancelled) + { + this.emit(Events.ANY_KEY_DOWN, event); + } + } + } + else + { + // Key specific callback first + if (key) + { + key.onUp(event); + } + + if (!event.cancelled) + { + if (KeyMap[code]) + { + this.emit(Events.KEY_UP + KeyMap[code], event); + + // Deprecated, kept in for compatibility with 3.15 + // To be removed by 3.20. + this.emit('keyup_' + KeyMap[code], event); + } + + if (!event.cancelled) + { + this.emit(Events.ANY_KEY_UP, event); + } + } + } + + // Reset the cancel state for other Scenes to use + if (event.cancelled === 1) + { + event.cancelled = 0; + } + } + }, + + /** + * Resets all Key objects created by _this_ Keyboard Plugin back to their default un-pressed states. + * This can only reset keys created via the `addKey`, `addKeys` or `createCursorKeys` methods. + * If you have created a Key object directly you'll need to reset it yourself. + * + * This method is called automatically when the Keyboard Plugin shuts down, but can be + * invoked directly at any time you require. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#resetKeys + * @since 3.15.0 + * + * @return {Phaser.Input.Keyboard.KeyboardPlugin} This KeyboardPlugin object. + */ + resetKeys: function () + { + var keys = this.keys; + + for (var i = 0; i < keys.length; i++) + { + // Because it's a sparsely populated array + if (keys[i]) + { + keys[i].reset(); + } + } + + return this; + }, + + /** + * Shuts this Keyboard Plugin down. This performs the following tasks: + * + * 1 - Resets all keys created by this Keyboard plugin. + * 2 - Stops and removes the keyboard event listeners. + * 3 - Clears out any pending requests in the queue, without processing them. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#shutdown + * @private + * @since 3.10.0 + */ + shutdown: function () + { + this.resetKeys(); + + if (this.sceneInputPlugin.manager.useQueue) + { + this.sceneInputPlugin.pluginEvents.off(InputEvents.UPDATE, this.update, this); + } + else + { + this.sceneInputPlugin.manager.events.off(InputEvents.MANAGER_PROCESS, this.update, this); + } + + this.game.events.off(GameEvents.BLUR, this.resetKeys); + + this.removeAllListeners(); + + this.queue = []; + }, + + /** + * Destroys this Keyboard Plugin instance and all references it holds, plus clears out local arrays. + * + * @method Phaser.Input.Keyboard.KeyboardPlugin#destroy + * @private + * @since 3.10.0 + */ + destroy: function () + { + this.shutdown(); + + var keys = this.keys; + + for (var i = 0; i < keys.length; i++) + { + // Because it's a sparsely populated array + if (keys[i]) + { + keys[i].destroy(); + } + } + + this.keys = []; + this.combos = []; + this.queue = []; + + this.scene = null; + this.settings = null; + this.sceneInputPlugin = null; + this.manager = null; + }, + + /** + * Internal time value. + * + * @name Phaser.Input.Keyboard.KeyboardPlugin#time + * @type {number} + * @private + * @since 3.11.0 + */ + time: { + + get: function () + { + return this.sceneInputPlugin.manager.time; + } + + } + +}); + +/** + * An instance of the Keyboard Plugin class, if enabled via the `input.keyboard` Scene or Game Config property. + * Use this to create Key objects and listen for keyboard specific events. + * + * @name Phaser.Input.InputPlugin#keyboard + * @type {?Phaser.Input.Keyboard.KeyboardPlugin} + * @since 3.10.0 + */ +InputPluginCache.register('KeyboardPlugin', KeyboardPlugin, 'keyboard', 'keyboard', 'inputKeyboard'); + +module.exports = KeyboardPlugin; + + +/***/ }), +/* 1172 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var AdvanceKeyCombo = __webpack_require__(1173); + +/** + * Used internally by the KeyCombo class. + * + * @function Phaser.Input.Keyboard.KeyCombo.ProcessKeyCombo + * @private + * @since 3.0.0 + * + * @param {KeyboardEvent} event - The native Keyboard Event. + * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to be processed. + * + * @return {boolean} `true` if the combo was matched, otherwise `false`. + */ +var ProcessKeyCombo = function (event, combo) +{ + if (combo.matched) + { + return true; + } + + var comboMatched = false; + var keyMatched = false; + + if (event.keyCode === combo.current) + { + // Key was correct + + if (combo.index > 0 && combo.maxKeyDelay > 0) + { + // We have to check to see if the delay between + // the new key and the old one was too long (if enabled) + + var timeLimit = combo.timeLastMatched + combo.maxKeyDelay; + + // Check if they pressed it in time or not + if (event.timeStamp <= timeLimit) + { + keyMatched = true; + comboMatched = AdvanceKeyCombo(event, combo); + } + } + else + { + keyMatched = true; + + // We don't check the time for the first key pressed, so just advance it + comboMatched = AdvanceKeyCombo(event, combo); + } + } + + if (!keyMatched && combo.resetOnWrongKey) + { + // Wrong key was pressed + combo.index = 0; + combo.current = combo.keyCodes[0]; + } + + if (comboMatched) + { + combo.timeLastMatched = event.timeStamp; + combo.matched = true; + combo.timeMatched = event.timeStamp; + } + + return comboMatched; +}; + +module.exports = ProcessKeyCombo; + + +/***/ }), +/* 1173 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Used internally by the KeyCombo class. + * Return `true` if it reached the end of the combo, `false` if not. + * + * @function Phaser.Input.Keyboard.KeyCombo.AdvanceKeyCombo + * @private + * @since 3.0.0 + * + * @param {KeyboardEvent} event - The native Keyboard Event. + * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to advance. + * + * @return {boolean} `true` if it reached the end of the combo, `false` if not. + */ +var AdvanceKeyCombo = function (event, combo) +{ + combo.timeLastMatched = event.timeStamp; + combo.index++; + + if (combo.index === combo.size) + { + return true; + } + else + { + combo.current = combo.keyCodes[combo.index]; + return false; + } +}; + +module.exports = AdvanceKeyCombo; + + +/***/ }), +/* 1174 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Used internally by the KeyCombo class. + * + * @function Phaser.Input.Keyboard.KeyCombo.ResetKeyCombo + * @private + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo to reset. + * + * @return {Phaser.Input.Keyboard.KeyCombo} The KeyCombo. + */ +var ResetKeyCombo = function (combo) +{ + combo.current = combo.keyCodes[0]; + combo.index = 0; + combo.timeLastMatched = 0; + combo.matched = false; + combo.timeMatched = 0; + + return combo; +}; + +module.exports = ResetKeyCombo; + + +/***/ }), +/* 1175 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var KeyCodes = __webpack_require__(121); + +var KeyMap = {}; + +for (var key in KeyCodes) +{ + KeyMap[KeyCodes[key]] = key; +} + +module.exports = KeyMap; + + +/***/ }), +/* 1176 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The justDown value allows you to test if this Key has just been pressed down or not. + * + * When you check this value it will return `true` if the Key is down, otherwise `false`. + * + * You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. + * This allows you to use it in situations where you want to check if this key is down without using an event, such as in a core game loop. + * + * @function Phaser.Input.Keyboard.JustDown + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.Key} key - The Key to check to see if it's just down or not. + * + * @return {boolean} `true` if the Key was just pressed, otherwise `false`. + */ +var JustDown = function (key) +{ + if (key._justDown) + { + key._justDown = false; + + return true; + } + else + { + return false; + } +}; + +module.exports = JustDown; + + +/***/ }), +/* 1177 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The justUp value allows you to test if this Key has just been released or not. + * + * When you check this value it will return `true` if the Key is up, otherwise `false`. + * + * You can only call JustUp once per key release. It will only return `true` once, until the Key is pressed down and released again. + * This allows you to use it in situations where you want to check if this key is up without using an event, such as in a core game loop. + * + * @function Phaser.Input.Keyboard.JustUp + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.Key} key - The Key to check to see if it's just up or not. + * + * @return {boolean} `true` if the Key was just released, otherwise `false`. + */ +var JustUp = function (key) +{ + if (key._justUp) + { + key._justUp = false; + + return true; + } + else + { + return false; + } +}; + +module.exports = JustUp; + + +/***/ }), +/* 1178 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns `true` if the Key was pressed down within the `duration` value given, based on the current + * game clock time. Or `false` if it either isn't down, or was pressed down longer ago than the given duration. + * + * @function Phaser.Input.Keyboard.DownDuration + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.Key} key - The Key object to test. + * @param {integer} [duration=50] - The duration, in ms, within which the key must have been pressed down. + * + * @return {boolean} `true` if the Key was pressed down within `duration` ms ago, otherwise `false`. + */ +var DownDuration = function (key, duration) +{ + if (duration === undefined) { duration = 50; } + + var current = key.plugin.game.loop.time - key.timeDown; + + return (key.isDown && current < duration); +}; + +module.exports = DownDuration; + + +/***/ }), +/* 1179 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns `true` if the Key was released within the `duration` value given, based on the current + * game clock time. Or returns `false` if it either isn't up, or was released longer ago than the given duration. + * + * @function Phaser.Input.Keyboard.UpDuration + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.Key} key - The Key object to test. + * @param {integer} [duration=50] - The duration, in ms, within which the key must have been released. + * + * @return {boolean} `true` if the Key was released within `duration` ms ago, otherwise `false`. + */ +var UpDuration = function (key, duration) +{ + if (duration === undefined) { duration = 50; } + + var current = key.plugin.game.loop.time - key.timeUp; + + return (key.isUp && current < duration); +}; + +module.exports = UpDuration; + + +/***/ }), +/* 1180 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Input.Mouse + */ + +/* eslint-disable */ +module.exports = { + + MouseManager: __webpack_require__(339) + +}; +/* eslint-enable */ + + +/***/ }), +/* 1181 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Input.Touch + */ + +/* eslint-disable */ +module.exports = { + + TouchManager: __webpack_require__(341) + +}; +/* eslint-enable */ + + +/***/ }), +/* 1182 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(16); +var Extend = __webpack_require__(17); + +/** + * @namespace Phaser.Loader + */ + +var Loader = { + + Events: __webpack_require__(80), + + FileTypes: __webpack_require__(1183), + + File: __webpack_require__(20), + FileTypesManager: __webpack_require__(8), + GetURL: __webpack_require__(204), + LoaderPlugin: __webpack_require__(1206), + MergeXHRSettings: __webpack_require__(205), + MultiFile: __webpack_require__(59), + XHRLoader: __webpack_require__(428), + XHRSettings: __webpack_require__(133) + +}; + +// Merge in the consts +Loader = Extend(false, Loader, CONST); + +module.exports = Loader; + + +/***/ }), +/* 1183 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Loader.FileTypes + */ + +module.exports = { + + AnimationJSONFile: __webpack_require__(1184), + AtlasJSONFile: __webpack_require__(1185), + AtlasXMLFile: __webpack_require__(1186), + AudioFile: __webpack_require__(429), + AudioSpriteFile: __webpack_require__(1187), + BinaryFile: __webpack_require__(1188), + BitmapFontFile: __webpack_require__(1189), + CSSFile: __webpack_require__(1190), + GLSLFile: __webpack_require__(1191), + HTML5AudioFile: __webpack_require__(430), + HTMLFile: __webpack_require__(1192), + HTMLTextureFile: __webpack_require__(1193), + ImageFile: __webpack_require__(70), + JSONFile: __webpack_require__(58), + MultiAtlasFile: __webpack_require__(1194), + MultiScriptFile: __webpack_require__(1195), + PackFile: __webpack_require__(1196), + PluginFile: __webpack_require__(1197), + SceneFile: __webpack_require__(1198), + ScenePluginFile: __webpack_require__(1199), + ScriptFile: __webpack_require__(431), + SpriteSheetFile: __webpack_require__(1200), + SVGFile: __webpack_require__(1201), + TextFile: __webpack_require__(432), + TilemapCSVFile: __webpack_require__(1202), + TilemapImpactFile: __webpack_require__(1203), + TilemapJSONFile: __webpack_require__(1204), + UnityAtlasFile: __webpack_require__(1205), + XMLFile: __webpack_require__(206) + +}; + + +/***/ }), +/* 1184 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var JSONFile = __webpack_require__(58); +var LoaderEvents = __webpack_require__(80); + +/** + * @classdesc + * A single Animation JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#animation method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#animation. + * + * @class AnimationJSONFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var AnimationJSONFile = new Class({ + + Extends: JSONFile, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function AnimationJSONFile (loader, key, url, xhrSettings, dataKey) + { + JSONFile.call(this, loader, key, url, xhrSettings, dataKey); + + this.type = 'animationJSON'; + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.AnimationJSONFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + // We need to hook into this event: + this.loader.once(LoaderEvents.POST_PROCESS, this.onLoadComplete, this); + + // But the rest is the same as a normal JSON file + JSONFile.prototype.onProcess.call(this); + }, + + /** + * Called at the end of the load process, after the Loader has finished all files in its queue. + * + * @method Phaser.Loader.FileTypes.AnimationJSONFile#onLoadComplete + * @since 3.7.0 + */ + onLoadComplete: function () + { + this.loader.systems.anims.fromJSON(this.data); + + this.pendingDestroy(); + } + +}); + +/** + * Adds an Animation JSON Data file, or array of Animation JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.animation('baddieAnims', 'files/BaddieAnims.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.animation({ + * key: 'baddieAnims', + * url: 'files/BaddieAnims.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading it will automatically be passed to the global Animation Managers `fromJSON` method. + * This will parse all of the JSON data and create animation data from it. This process happens at the very end + * of the Loader, once every other file in the load queue has finished. The reason for this is to allow you to load + * both animation data and the images it relies upon in the same load call. + * + * Once the animation data has been parsed you will be able to play animations using that data. + * Please see the Animation Manager `fromJSON` method for more details about the format and playback. + * + * You can also access the raw animation data from its Cache using its key: + * + * ```javascript + * this.load.animation('baddieAnims', 'files/BaddieAnims.json'); + * // and later in your game ... + * var data = this.cache.json.get('baddieAnims'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And if you only wanted to create animations from the `boss` data, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#animation + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {string} [dataKey] - When the Animation JSON file loads only this property will be stored in the Cache and used to create animation data. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('animation', function (key, url, dataKey, xhrSettings) +{ + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.addFile(new AnimationJSONFile(this, key[i])); + } + } + else + { + this.addFile(new AnimationJSONFile(this, key, url, xhrSettings, dataKey)); + } + + return this; +}); + +module.exports = AnimationJSONFile; + + +/***/ }), +/* 1185 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var ImageFile = __webpack_require__(70); +var IsPlainObject = __webpack_require__(7); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(59); + +/** + * @classdesc + * A single JSON based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. + * + * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm + * + * @class AtlasJSONFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ +var AtlasJSONFile = new Class({ + + Extends: MultiFile, + + initialize: + + function AtlasJSONFile (loader, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) + { + var image; + var data; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + image = new ImageFile(loader, { + key: key, + url: GetFastValue(config, 'textureURL'), + extension: GetFastValue(config, 'textureExtension', 'png'), + normalMap: GetFastValue(config, 'normalMap'), + xhrSettings: GetFastValue(config, 'textureXhrSettings') + }); + + data = new JSONFile(loader, { + key: key, + url: GetFastValue(config, 'atlasURL'), + extension: GetFastValue(config, 'atlasExtension', 'json'), + xhrSettings: GetFastValue(config, 'atlasXhrSettings') + }); + } + else + { + image = new ImageFile(loader, key, textureURL, textureXhrSettings); + data = new JSONFile(loader, key, atlasURL, atlasXhrSettings); + } + + if (image.linkFile) + { + // Image has a normal map + MultiFile.call(this, loader, 'atlasjson', key, [ image, data, image.linkFile ]); + } + else + { + MultiFile.call(this, loader, 'atlasjson', key, [ image, data ]); + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.AtlasJSONFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var image = this.files[0]; + var json = this.files[1]; + var normalMap = (this.files[2]) ? this.files[2].data : null; + + this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap); + + json.addToCache(); + + this.complete = true; + } + } + +}); + +/** + * Adds a JSON based Texture Atlas, or array of atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in a JSON file, using either the JSON Hash or JSON Array format. + * These files are created by software such as Texture Packer, Shoebox and Adobe Flash / Animate. + * If you are using Texture Packer and have enabled multi-atlas support, then please use the Phaser Multi Atlas loader + * instead of this one. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.atlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * atlasURL: 'images/MainMenu.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig` for more details. + * + * Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); + * // and later in your game ... + * this.add.image(x, y, 'mainmenu', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.atlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.json'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.atlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * normalMap: 'images/MainMenu-n.png', + * atlasURL: 'images/MainMenu.json' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Atlas JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#atlas + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig|Phaser.Types.Loader.FileTypes.AtlasJSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('atlas', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) +{ + var multifile; + + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new AtlasJSONFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new AtlasJSONFile(this, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = AtlasJSONFile; + + +/***/ }), +/* 1186 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var ImageFile = __webpack_require__(70); +var IsPlainObject = __webpack_require__(7); +var MultiFile = __webpack_require__(59); +var XMLFile = __webpack_require__(206); + +/** + * @classdesc + * A single XML based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlasXML method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlasXML. + * + * @class AtlasXMLFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas xml file. Used in replacement of the Loaders default XHR Settings. + */ +var AtlasXMLFile = new Class({ + + Extends: MultiFile, + + initialize: + + function AtlasXMLFile (loader, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) + { + var image; + var data; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + image = new ImageFile(loader, { + key: key, + url: GetFastValue(config, 'textureURL'), + extension: GetFastValue(config, 'textureExtension', 'png'), + normalMap: GetFastValue(config, 'normalMap'), + xhrSettings: GetFastValue(config, 'textureXhrSettings') + }); + + data = new XMLFile(loader, { + key: key, + url: GetFastValue(config, 'atlasURL'), + extension: GetFastValue(config, 'atlasExtension', 'xml'), + xhrSettings: GetFastValue(config, 'atlasXhrSettings') + }); + } + else + { + image = new ImageFile(loader, key, textureURL, textureXhrSettings); + data = new XMLFile(loader, key, atlasURL, atlasXhrSettings); + } + + if (image.linkFile) + { + // Image has a normal map + MultiFile.call(this, loader, 'atlasxml', key, [ image, data, image.linkFile ]); + } + else + { + MultiFile.call(this, loader, 'atlasxml', key, [ image, data ]); + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.AtlasXMLFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var image = this.files[0]; + var xml = this.files[1]; + var normalMap = (this.files[2]) ? this.files[2].data : null; + + this.loader.textureManager.addAtlasXML(image.key, image.data, xml.data, normalMap); + + xml.addToCache(); + + this.complete = true; + } + } + +}); + +/** + * Adds an XML based Texture Atlas, or array of atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.atlasXML('mainmenu', 'images/MainMenu.png', 'images/MainMenu.xml'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in an XML file format. + * These files are created by software such as Shoebox and Adobe Flash / Animate. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.atlasXML({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * atlasURL: 'images/MainMenu.xml' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig` for more details. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.atlasXML('mainmenu', 'images/MainMenu.png', 'images/MainMenu.xml'); + * // and later in your game ... + * this.add.image(x, y, 'mainmenu', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.atlasXML('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.xml'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.atlasXML({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * normalMap: 'images/MainMenu-n.png', + * atlasURL: 'images/MainMenu.xml' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Atlas XML File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#atlasXML + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.7.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig|Phaser.Types.Loader.FileTypes.AtlasXMLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas xml file. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('atlasXML', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) +{ + var multifile; + + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new AtlasXMLFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new AtlasXMLFile(this, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = AtlasXMLFile; + + +/***/ }), +/* 1187 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var AudioFile = __webpack_require__(429); +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(59); + +/** + * @classdesc + * An Audio Sprite File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#audioSprite method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audioSprite. + * + * @class AudioSpriteFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} jsonURL - The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead. + * @param {{(string|string[])}} [audioURL] - The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file. + * @param {any} [audioConfig] - The audio configuration options. + * @param {Phaser.Types.Loader.XHRSettingsObject} [audioXhrSettings] - An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + */ +var AudioSpriteFile = new Class({ + + Extends: MultiFile, + + initialize: + + function AudioSpriteFile (loader, key, jsonURL, audioURL, audioConfig, audioXhrSettings, jsonXhrSettings) + { + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + jsonURL = GetFastValue(config, 'jsonURL'); + audioURL = GetFastValue(config, 'audioURL'); + audioConfig = GetFastValue(config, 'audioConfig'); + audioXhrSettings = GetFastValue(config, 'audioXhrSettings'); + jsonXhrSettings = GetFastValue(config, 'jsonXhrSettings'); + } + + var data; + + // No url? then we're going to do a json load and parse it from that + if (!audioURL) + { + data = new JSONFile(loader, key, jsonURL, jsonXhrSettings); + + MultiFile.call(this, loader, 'audiosprite', key, [ data ]); + + this.config.resourceLoad = true; + this.config.audioConfig = audioConfig; + this.config.audioXhrSettings = audioXhrSettings; + } + else + { + var audio = AudioFile.create(loader, key, audioURL, audioConfig, audioXhrSettings); + + if (audio) + { + data = new JSONFile(loader, key, jsonURL, jsonXhrSettings); + + MultiFile.call(this, loader, 'audiosprite', key, [ audio, data ]); + + this.config.resourceLoad = false; + } + } + }, + + /** + * Called by each File when it finishes loading. + * + * @method Phaser.Loader.FileTypes.AudioSpriteFile#onFileComplete + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has completed processing. + */ + onFileComplete: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.pending--; + + if (this.config.resourceLoad && file.type === 'json' && file.data.hasOwnProperty('resources')) + { + // Inspect the data for the files to now load + var urls = file.data.resources; + + var audioConfig = GetFastValue(this.config, 'audioConfig'); + var audioXhrSettings = GetFastValue(this.config, 'audioXhrSettings'); + + var audio = AudioFile.create(this.loader, file.key, urls, audioConfig, audioXhrSettings); + + if (audio) + { + this.addToMultiFile(audio); + + this.loader.addFile(audio); + } + } + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.AudioSpriteFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var fileA = this.files[0]; + var fileB = this.files[1]; + + fileA.addToCache(); + fileB.addToCache(); + + this.complete = true; + } + } + +}); + +/** + * Adds a JSON based Audio Sprite, or array of audio sprites, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.audioSprite('kyobi', 'kyobi.json', [ + * 'kyobi.ogg', + * 'kyobi.mp3', + * 'kyobi.m4a' + * ]); + * } + * ``` + * + * Audio Sprites are a combination of audio files and a JSON configuration. + * The JSON follows the format of that created by https://github.com/tonistiigi/audiosprite + * + * If the JSON file includes a 'resource' object then you can let Phaser parse it and load the audio + * files automatically based on its content. To do this exclude the audio URLs from the load: + * + * ```javascript + * function preload () + * { + * this.load.audioSprite('kyobi', 'kyobi.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * The key must be a unique String. It is used to add the file to the global Audio Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Audio Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Audio Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.audioSprite({ + * key: 'kyobi', + * jsonURL: 'audio/Kyobi.json', + * audioURL: [ + * 'audio/Kyobi.ogg', + * 'audio/Kyobi.mp3', + * 'audio/Kyobi.m4a' + * ] + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig` for more details. + * + * Instead of passing a URL for the audio JSON data you can also pass in a well formed JSON object instead. + * + * Once the audio has finished loading you can use it create an Audio Sprite by referencing its key: + * + * ```javascript + * this.load.audioSprite('kyobi', 'kyobi.json'); + * // and later in your game ... + * var music = this.sound.addAudioSprite('kyobi'); + * music.play('title'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * Due to different browsers supporting different audio file types you should usually provide your audio files in a variety of formats. + * ogg, mp3 and m4a are the most common. If you provide an array of URLs then the Loader will determine which _one_ file to load based on + * browser support. + * + * If audio has been disabled in your game, either via the game config, or lack of support from the device, then no audio will be loaded. + * + * Note: The ability to load this type of file will only be available if the Audio Sprite File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#audioSprite + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig|Phaser.Types.Loader.FileTypes.AudioSpriteFileConfig[])} key - The key to use for this file, or a file configuration object, or an array of objects. + * @param {string} jsonURL - The absolute or relative URL to load the json file from. Or a well formed JSON object to use instead. + * @param {(string|string[])} [audioURL] - The absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file. + * @param {any} [audioConfig] - The audio configuration options. + * @param {Phaser.Types.Loader.XHRSettingsObject} [audioXhrSettings] - An XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader. + */ +FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audioConfig, audioXhrSettings, jsonXhrSettings) +{ + var game = this.systems.game; + var gameAudioConfig = game.config.audio; + var deviceAudio = game.device.audio; + + if ((gameAudioConfig && gameAudioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData)) + { + // Sounds are disabled, so skip loading audio + return this; + } + + var multifile; + + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new AudioSpriteFile(this, key[i]); + + if (multifile.files) + { + this.addFile(multifile.files); + } + } + } + else + { + multifile = new AudioSpriteFile(this, key, jsonURL, audioURL, audioConfig, audioXhrSettings, jsonXhrSettings); + + if (multifile.files) + { + this.addFile(multifile.files); + } + } + + return this; +}); + + +/***/ }), +/* 1188 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single Binary File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#binary method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#binary. + * + * @class BinaryFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.BinaryFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.bin`, i.e. if `key` was "alien" then the URL will be "alien.bin". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {any} [dataType] - Optional type to cast the binary file to once loaded. For example, `Uint8Array`. + */ +var BinaryFile = new Class({ + + Extends: File, + + initialize: + + function BinaryFile (loader, key, url, xhrSettings, dataType) + { + var extension = 'bin'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataType = GetFastValue(config, 'dataType', dataType); + } + + var fileConfig = { + type: 'binary', + cache: loader.cacheManager.binary, + extension: extension, + responseType: 'arraybuffer', + key: key, + url: url, + xhrSettings: xhrSettings, + config: { dataType: dataType } + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.BinaryFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + var ctor = this.config.dataType; + + this.data = (ctor) ? new ctor(this.xhrLoader.response) : this.xhrLoader.response; + + this.onProcessComplete(); + } + +}); + +/** + * Adds a Binary file, or array of Binary files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.binary('doom', 'files/Doom.wad'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Binary Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Binary Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Binary Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.binary({ + * key: 'doom', + * url: 'files/Doom.wad', + * dataType: Uint8Array + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.BinaryFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.binary('doom', 'files/Doom.wad'); + * // and later in your game ... + * var data = this.cache.binary.get('doom'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Data` the final key will be `LEVEL1.Data` and + * this is what you would use to retrieve the text from the Binary Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "doom" + * and no URL is given then the Loader will set the URL to be "doom.bin". It will always add `.bin` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Binary File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#binary + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.BinaryFileConfig|Phaser.Types.Loader.FileTypes.BinaryFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.bin`, i.e. if `key` was "alien" then the URL will be "alien.bin". + * @param {any} [dataType] - Optional type to cast the binary file to once loaded. For example, `Uint8Array`. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('binary', function (key, url, dataType, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new BinaryFile(this, key[i])); + } + } + else + { + this.addFile(new BinaryFile(this, key, url, xhrSettings, dataType)); + } + + return this; +}); + +module.exports = BinaryFile; + + +/***/ }), +/* 1189 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var ImageFile = __webpack_require__(70); +var IsPlainObject = __webpack_require__(7); +var MultiFile = __webpack_require__(59); +var ParseXMLBitmapFont = __webpack_require__(181); +var XMLFile = __webpack_require__(206); + +/** + * @classdesc + * A single Bitmap Font based File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#bitmapFont method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#bitmapFont. + * + * @class BitmapFontFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.BitmapFontFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the font image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {string} [fontDataURL] - The absolute or relative URL to load the font xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [fontDataXhrSettings] - An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings. + */ +var BitmapFontFile = new Class({ + + Extends: MultiFile, + + initialize: + + function BitmapFontFile (loader, key, textureURL, fontDataURL, textureXhrSettings, fontDataXhrSettings) + { + var image; + var data; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + image = new ImageFile(loader, { + key: key, + url: GetFastValue(config, 'textureURL'), + extension: GetFastValue(config, 'textureExtension', 'png'), + normalMap: GetFastValue(config, 'normalMap'), + xhrSettings: GetFastValue(config, 'textureXhrSettings') + }); + + data = new XMLFile(loader, { + key: key, + url: GetFastValue(config, 'fontDataURL'), + extension: GetFastValue(config, 'fontDataExtension', 'xml'), + xhrSettings: GetFastValue(config, 'fontDataXhrSettings') + }); + } + else + { + image = new ImageFile(loader, key, textureURL, textureXhrSettings); + data = new XMLFile(loader, key, fontDataURL, fontDataXhrSettings); + } + + if (image.linkFile) + { + // Image has a normal map + MultiFile.call(this, loader, 'bitmapfont', key, [ image, data, image.linkFile ]); + } + else + { + MultiFile.call(this, loader, 'bitmapfont', key, [ image, data ]); + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.BitmapFontFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var image = this.files[0]; + var xml = this.files[1]; + + image.addToCache(); + xml.addToCache(); + + this.loader.cacheManager.bitmapFont.add(image.key, { data: ParseXMLBitmapFont(xml.data), texture: image.key, frame: null }); + + this.complete = true; + } + } + +}); + +/** + * Adds an XML based Bitmap Font, or array of fonts, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + + * ```javascript + * function preload () + * { + * this.load.bitmapFont('goldenFont', 'images/GoldFont.png', 'images/GoldFont.xml'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the font data to be provided in an XML file format. + * These files are created by software such as the [Angelcode Bitmap Font Generator](http://www.angelcode.com/products/bmfont/), + * [Littera](http://kvazars.com/littera/) or [Glyph Designer](https://71squared.com/glyphdesigner) + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.bitmapFont({ + * key: 'goldenFont', + * textureURL: 'images/GoldFont.png', + * fontDataURL: 'images/GoldFont.xml' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.BitmapFontFileConfig` for more details. + * + * Once the atlas has finished loading you can use key of it when creating a Bitmap Text Game Object: + * + * ```javascript + * this.load.bitmapFont('goldenFont', 'images/GoldFont.png', 'images/GoldFont.xml'); + * // and later in your game ... + * this.add.bitmapText(x, y, 'goldenFont', 'Hello World'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use when creating a Bitmap Text object. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.bitmapFont('goldenFont', [ 'images/GoldFont.png', 'images/GoldFont-n.png' ], 'images/GoldFont.xml'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.bitmapFont({ + * key: 'goldenFont', + * textureURL: 'images/GoldFont.png', + * normalMap: 'images/GoldFont-n.png', + * fontDataURL: 'images/GoldFont.xml' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Bitmap Font File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#bitmapFont + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.BitmapFontFileConfig|Phaser.Types.Loader.FileTypes.BitmapFontFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the font image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {string} [fontDataURL] - The absolute or relative URL to load the font xml data file from. If undefined or `null` it will be set to `.xml`, i.e. if `key` was "alien" then the URL will be "alien.xml". + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the font image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [fontDataXhrSettings] - An XHR Settings configuration object for the font data xml file. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('bitmapFont', function (key, textureURL, fontDataURL, textureXhrSettings, fontDataXhrSettings) +{ + var multifile; + + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new BitmapFontFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new BitmapFontFile(this, key, textureURL, fontDataURL, textureXhrSettings, fontDataXhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = BitmapFontFile; + + +/***/ }), +/* 1190 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single CSS File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#css method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#css. + * + * @class CSSFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.17.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.CSSFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var CSSFile = new Class({ + + Extends: File, + + initialize: + + function CSSFile (loader, key, url, xhrSettings) + { + var extension = 'css'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'script', + cache: false, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.CSSFile#onProcess + * @since 3.17.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = document.createElement('style'); + this.data.defer = false; + this.data.innerHTML = this.xhrLoader.responseText; + + document.head.appendChild(this.data); + + this.onProcessComplete(); + } + +}); + +/** + * Adds a CSS file, or array of CSS files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.css('headers', 'styles/headers.css'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.css({ + * key: 'headers', + * url: 'styles/headers.css' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.CSSFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a style DOM element + * via `document.createElement('style')`. It will have its `defer` property set to false and then the + * resulting element will be appended to `document.head`. The CSS styles are then applied to the current document. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.css". It will always add `.css` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the CSS File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#css + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.17.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.CSSFileConfig|Phaser.Types.Loader.FileTypes.CSSFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.css`, i.e. if `key` was "alien" then the URL will be "alien.css". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('css', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new CSSFile(this, key[i])); + } + } + else + { + this.addFile(new CSSFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = CSSFile; + + +/***/ }), +/* 1191 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); +var Shader = __webpack_require__(325); + +/** + * @classdesc + * A single GLSL File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#glsl method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#glsl. + * + * @class GLSLFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.GLSLFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {string} [shaderType='fragment'] - The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var GLSLFile = new Class({ + + Extends: File, + + initialize: + + function GLSLFile (loader, key, url, shaderType, xhrSettings) + { + var extension = 'glsl'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + shaderType = GetFastValue(config, 'shaderType', 'fragment'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + else if (shaderType === undefined) + { + shaderType = 'fragment'; + } + + var fileConfig = { + type: 'glsl', + cache: loader.cacheManager.shader, + extension: extension, + responseType: 'text', + key: key, + url: url, + config: { + shaderType: shaderType + }, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.GLSLFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = this.xhrLoader.responseText; + + this.onProcessComplete(); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.GLSLFile#addToCache + * @since 3.17.0 + */ + addToCache: function () + { + var data = this.data.split('\n'); + + // Check to see if this is a shader bundle, or raw glsl file. + var block = this.extractBlock(data, 0); + + if (block) + { + while (block) + { + var key = this.getShaderName(block.header); + var shaderType = this.getShaderType(block.header); + var uniforms = this.getShaderUniforms(block.header); + var shaderSrc = block.shader; + + if (this.cache.has(key)) + { + var shader = this.cache.get(key); + + if (shaderType === 'fragment') + { + shader.fragmentSrc = shaderSrc; + } + else + { + shader.vertexSrc = shaderSrc; + } + + if (!shader.uniforms) + { + shader.uniforms = uniforms; + } + } + else if (shaderType === 'fragment') + { + this.cache.add(key, new Shader(key, shaderSrc, '', uniforms)); + } + else + { + this.cache.add(key, new Shader(key, '', shaderSrc, uniforms)); + } + + block = this.extractBlock(data, block.offset); + } + } + else if (this.config.shaderType === 'fragment') + { + // Single shader + this.cache.add(this.key, new Shader(this.key, this.data)); + } + else + { + this.cache.add(this.key, new Shader(this.key, '', this.data)); + } + + this.pendingDestroy(); + }, + + /** + * Returns the name of the shader from the header block. + * + * @method Phaser.Loader.FileTypes.GLSLFile#getShaderName + * @since 3.17.0 + * + * @param {string[]} headerSource - The header data. + * + * @return {string} The shader name. + */ + getShaderName: function (headerSource) + { + for (var i = 0; i < headerSource.length; i++) + { + var line = headerSource[i].trim(); + + if (line.substring(0, 5) === 'name:') + { + return line.substring(5).trim(); + } + } + + return this.key; + }, + + /** + * Returns the type of the shader from the header block. + * + * @method Phaser.Loader.FileTypes.GLSLFile#getShaderType + * @since 3.17.0 + * + * @param {string[]} headerSource - The header data. + * + * @return {string} The shader type. Either 'fragment' or 'vertex'. + */ + getShaderType: function (headerSource) + { + for (var i = 0; i < headerSource.length; i++) + { + var line = headerSource[i].trim(); + + if (line.substring(0, 5) === 'type:') + { + return line.substring(5).trim(); + } + } + + return this.config.shaderType; + }, + + /** + * Returns the shader uniforms from the header block. + * + * @method Phaser.Loader.FileTypes.GLSLFile#getShaderUniforms + * @since 3.17.0 + * + * @param {string[]} headerSource - The header data. + * + * @return {any} The shader uniforms object. + */ + getShaderUniforms: function (headerSource) + { + var uniforms = {}; + + for (var i = 0; i < headerSource.length; i++) + { + var line = headerSource[i].trim(); + + if (line.substring(0, 8) === 'uniform.') + { + var pos = line.indexOf(':'); + + if (pos) + { + var key = line.substring(8, pos); + + try + { + uniforms[key] = JSON.parse(line.substring(pos + 1)); + } + catch (e) + { + console.warn('Invalid uniform JSON: ' + key); + } + } + } + } + + return uniforms; + }, + + /** + * Processes the shader file and extracts the relevant data. + * + * @method Phaser.Loader.FileTypes.GLSLFile#extractBlock + * @private + * @since 3.17.0 + * + * @param {string[]} data - The array of shader data to process. + * @param {integer} offset - The offset to start processing from. + * + * @return {any} The processed shader block, or null. + */ + extractBlock: function (data, offset) + { + var headerStart = -1; + var headerEnd = -1; + var blockEnd = -1; + var headerOpen = false; + var captureSource = false; + var headerSource = []; + var shaderSource = []; + + for (var i = offset; i < data.length; i++) + { + var line = data[i].trim(); + + if (line === '---') + { + if (headerStart === -1) + { + headerStart = i; + headerOpen = true; + } + else if (headerOpen) + { + headerEnd = i; + headerOpen = false; + captureSource = true; + } + else + { + // We've hit another --- delimeter, break out + captureSource = false; + break; + } + } + else if (headerOpen) + { + headerSource.push(line); + } + else if (captureSource) + { + shaderSource.push(line); + blockEnd = i; + } + } + + if (!headerOpen && headerEnd !== -1) + { + return { header: headerSource, shader: shaderSource.join('\n'), offset: blockEnd }; + } + else + { + return null; + } + } + +}); + +/** + * Adds a GLSL file, or array of GLSL files, to the current load queue. + * In Phaser 3 GLSL files are just plain Text files at the current moment in time. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.glsl('plasma', 'shaders/Plasma.glsl'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Shader Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Shader Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Shader Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.glsl({ + * key: 'plasma', + * shaderType: 'fragment', + * url: 'shaders/Plasma.glsl' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.GLSLFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.glsl('plasma', 'shaders/Plasma.glsl'); + * // and later in your game ... + * var data = this.cache.shader.get('plasma'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `FX.` and the key was `Plasma` the final key will be `FX.Plasma` and + * this is what you would use to retrieve the text from the Shader Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "plasma" + * and no URL is given then the Loader will set the URL to be "plasma.glsl". It will always add `.glsl` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the GLSL File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#glsl + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.GLSLFileConfig|Phaser.Types.Loader.FileTypes.GLSLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.glsl`, i.e. if `key` was "alien" then the URL will be "alien.glsl". + * @param {string} [shaderType='fragment'] - The type of shader. Either `fragment` for a fragment shader, or `vertex` for a vertex shader. This is ignored if you load a shader bundle. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('glsl', function (key, url, shaderType, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new GLSLFile(this, key[i])); + } + } + else + { + this.addFile(new GLSLFile(this, key, url, shaderType, xhrSettings)); + } + + return this; +}); + +module.exports = GLSLFile; + + +/***/ }), +/* 1192 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single HTML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#html method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#html. + * + * @class HTMLFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.12.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.HTMLFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var HTMLFile = new Class({ + + Extends: File, + + initialize: + + function HTMLFile (loader, key, url, xhrSettings) + { + var extension = 'html'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'text', + cache: loader.cacheManager.html, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.HTMLFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = this.xhrLoader.responseText; + + this.onProcessComplete(); + } + +}); + +/** + * Adds an HTML file, or array of HTML files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.html('story', 'files/LoginForm.html'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global HTML Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the HTML Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the HTML Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.html({ + * key: 'login', + * url: 'files/LoginForm.html' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.HTMLFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.html('login', 'files/LoginForm.html'); + * // and later in your game ... + * var data = this.cache.html.get('login'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the html from the HTML Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.html". It will always add `.html` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the HTML File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#html + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.12.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.HTMLFileConfig|Phaser.Types.Loader.FileTypes.HTMLFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('html', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new HTMLFile(this, key[i])); + } + } + else + { + this.addFile(new HTMLFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = HTMLFile; + + +/***/ }), +/* 1193 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single HTML File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#htmlTexture method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#htmlTexture. + * + * @class HTMLTextureFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.12.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {integer} [width] - The width of the texture the HTML will be rendered to. + * @param {integer} [height] - The height of the texture the HTML will be rendered to. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var HTMLTextureFile = new Class({ + + Extends: File, + + initialize: + + function HTMLTextureFile (loader, key, url, width, height, xhrSettings) + { + if (width === undefined) { width = 512; } + if (height === undefined) { height = 512; } + + var extension = 'html'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + width = GetFastValue(config, 'width', width); + height = GetFastValue(config, 'height', height); + } + + var fileConfig = { + type: 'html', + cache: loader.textureManager, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: { + width: width, + height: height + } + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.HTMLTextureFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + var w = this.config.width; + var h = this.config.height; + + var data = []; + + data.push(''); + data.push(''); + data.push(''); + data.push(this.xhrLoader.responseText); + data.push(''); + data.push(''); + data.push(''); + + var svg = [ data.join('\n') ]; + var _this = this; + + try + { + var blob = new window.Blob(svg, { type: 'image/svg+xml;charset=utf-8' }); + } + catch (e) + { + _this.state = CONST.FILE_ERRORED; + + _this.onProcessComplete(); + + return; + } + + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + this.data.onload = function () + { + File.revokeObjectURL(_this.data); + + _this.onProcessComplete(); + }; + + this.data.onerror = function () + { + File.revokeObjectURL(_this.data); + + _this.onProcessError(); + }; + + File.createObjectURL(this.data, blob, 'image/svg+xml'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.HTMLTextureFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } + +}); + +/** + * Adds an HTML File, or array of HTML Files, to the current load queue. When the files are loaded they + * will be rendered to textures and stored in the Texture Manager. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.htmlTexture('instructions', 'content/intro.html', 256, 512); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.htmlTexture({ + * key: 'instructions', + * url: 'content/intro.html', + * width: 256, + * height: 512 + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.htmlTexture('instructions', 'content/intro.html', 256, 512); + * // and later in your game ... + * this.add.image(x, y, 'instructions'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.html". It will always add `.html` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * The width and height are the size of the texture to which the HTML will be rendered. It's not possible to determine these + * automatically, so you will need to provide them, either as arguments or in the file config object. + * When the HTML file has loaded a new SVG element is created with a size and viewbox set to the width and height given. + * The SVG file has a body tag added to it, with the HTML file contents included. It then calls `window.Blob` on the SVG, + * and if successful is added to the Texture Manager, otherwise it fails processing. The overall quality of the rendered + * HTML depends on your browser, and some of them may not even support the svg / blob process used. Be aware that there are + * limitations on what HTML can be inside an SVG. You can find out more details in this + * [Mozilla MDN entry](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas). + * + * Note: The ability to load this type of file will only be available if the HTMLTextureFile File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#htmlTexture + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.12.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param {integer} [width=512] - The width of the texture the HTML will be rendered to. + * @param {integer} [height=512] - The height of the texture the HTML will be rendered to. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('htmlTexture', function (key, url, width, height, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new HTMLTextureFile(this, key[i])); + } + } + else + { + this.addFile(new HTMLTextureFile(this, key, url, width, height, xhrSettings)); + } + + return this; +}); + +module.exports = HTMLTextureFile; + + +/***/ }), +/* 1194 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var ImageFile = __webpack_require__(70); +var IsPlainObject = __webpack_require__(7); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(59); + +/** + * @classdesc + * A single Multi Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#multiatlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#multiatlas. + * + * @class MultiAtlasFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager. + * @param {string} [atlasURL] - The absolute or relative URL to load the multi atlas json file from. + * @param {string} [path] - Optional path to use when loading the textures defined in the atlas data. + * @param {string} [baseURL] - Optional Base URL to use when loading the textures defined in the atlas data. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas json file. + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture files. + */ +var MultiAtlasFile = new Class({ + + Extends: MultiFile, + + initialize: + + function MultiAtlasFile (loader, key, atlasURL, path, baseURL, atlasXhrSettings, textureXhrSettings) + { + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + atlasURL = GetFastValue(config, 'url'); + atlasXhrSettings = GetFastValue(config, 'xhrSettings'); + path = GetFastValue(config, 'path'); + baseURL = GetFastValue(config, 'baseURL'); + textureXhrSettings = GetFastValue(config, 'textureXhrSettings'); + } + + var data = new JSONFile(loader, key, atlasURL, atlasXhrSettings); + + MultiFile.call(this, loader, 'multiatlas', key, [ data ]); + + this.config.path = path; + this.config.baseURL = baseURL; + this.config.textureXhrSettings = textureXhrSettings; + }, + + /** + * Called by each File when it finishes loading. + * + * @method Phaser.Loader.FileTypes.MultiAtlasFile#onFileComplete + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has completed processing. + */ + onFileComplete: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.pending--; + + if (file.type === 'json' && file.data.hasOwnProperty('textures')) + { + // Inspect the data for the files to now load + var textures = file.data.textures; + + var config = this.config; + var loader = this.loader; + + var currentBaseURL = loader.baseURL; + var currentPath = loader.path; + var currentPrefix = loader.prefix; + + var baseURL = GetFastValue(config, 'baseURL', currentBaseURL); + var path = GetFastValue(config, 'path', currentPath); + var prefix = GetFastValue(config, 'prefix', currentPrefix); + var textureXhrSettings = GetFastValue(config, 'textureXhrSettings'); + + loader.setBaseURL(baseURL); + loader.setPath(path); + loader.setPrefix(prefix); + + for (var i = 0; i < textures.length; i++) + { + // "image": "texture-packer-multi-atlas-0.png", + var textureURL = textures[i].image; + + var key = '_MA_' + textureURL; + + var image = new ImageFile(loader, key, textureURL, textureXhrSettings); + + this.addToMultiFile(image); + + loader.addFile(image); + + // "normalMap": "texture-packer-multi-atlas-0_n.png", + if (textures[i].normalMap) + { + var normalMap = new ImageFile(loader, key, textures[i].normalMap, textureXhrSettings); + + normalMap.type = 'normalMap'; + + image.setLink(normalMap); + + this.addToMultiFile(normalMap); + + loader.addFile(normalMap); + } + } + + // Reset the loader settings + loader.setBaseURL(currentBaseURL); + loader.setPath(currentPath); + loader.setPrefix(currentPrefix); + } + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.MultiAtlasFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var fileJSON = this.files[0]; + + fileJSON.addToCache(); + + var data = []; + var images = []; + var normalMaps = []; + + for (var i = 1; i < this.files.length; i++) + { + var file = this.files[i]; + + if (file.type === 'normalMap') + { + continue; + } + + var key = file.key.substr(4); + var image = file.data; + + // Now we need to find out which json entry this mapped to + for (var t = 0; t < fileJSON.data.textures.length; t++) + { + var item = fileJSON.data.textures[t]; + + if (item.image === key) + { + images.push(image); + + data.push(item); + + if (file.linkFile) + { + normalMaps.push(file.linkFile.data); + } + + break; + } + } + } + + if (normalMaps.length === 0) + { + normalMaps = undefined; + } + + this.loader.textureManager.addAtlasJSONArray(this.key, images, data, normalMaps); + + this.complete = true; + + for (i = 0; i < this.files.length; i++) + { + this.files[i].pendingDestroy(); + } + } + } + +}); + +/** + * Adds a Multi Texture Atlas, or array of multi atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.multiatlas('level1', 'images/Level1.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in a JSON file as exported from the application Texture Packer, + * version 4.6.3 or above, where you have made sure to use the Phaser 3 Export option. + * + * The way it works internally is that you provide a URL to the JSON file. Phaser then loads this JSON, parses it and + * extracts which texture files it also needs to load to complete the process. If the JSON also defines normal maps, + * Phaser will load those as well. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.multiatlas({ + * key: 'level1', + * atlasURL: 'images/Level1.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig` for more details. + * + * Instead of passing a URL for the atlas JSON data you can also pass in a well formed JSON object instead. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.multiatlas('level1', 'images/Level1.json'); + * // and later in your game ... + * this.add.image(x, y, 'level1', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Multi Atlas File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#multiatlas + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.7.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig|Phaser.Types.Loader.FileTypes.MultiAtlasFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {string} [path] - Optional path to use when loading the textures defined in the atlas data. + * @param {string} [baseURL] - Optional Base URL to use when loading the textures defined in the atlas data. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('multiatlas', function (key, atlasURL, path, baseURL, atlasXhrSettings) +{ + var multifile; + + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new MultiAtlasFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new MultiAtlasFile(this, key, atlasURL, path, baseURL, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = MultiAtlasFile; + + +/***/ }), +/* 1195 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); +var MultiFile = __webpack_require__(59); +var ScriptFile = __webpack_require__(431); + +/** + * @classdesc + * A Multi Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#scripts method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scripts. + * + * @class MultiScriptFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.17.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.MultiScriptFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string[]} [url] - An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object for the script files. Used in replacement of the Loaders default XHR Settings. + */ +var MultiScriptFile = new Class({ + + Extends: MultiFile, + + initialize: + + function MultiScriptFile (loader, key, url, xhrSettings) + { + var extension = 'js'; + var files = []; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + if (!Array.isArray(url)) + { + url = [ url ]; + } + + for (var i = 0; i < url.length; i++) + { + var scriptFile = new ScriptFile(loader, { + key: key + '_' + i.toString(), + url: url[i], + extension: extension, + xhrSettings: xhrSettings + }); + + // Override the default onProcess function + scriptFile.onProcess = function () + { + this.onProcessComplete(); + }; + + files.push(scriptFile); + } + + MultiFile.call(this, loader, 'scripts', key, files); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.MultiScriptFile#addToCache + * @since 3.17.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + for (var i = 0; i < this.files.length; i++) + { + var file = this.files[i]; + + file.data = document.createElement('script'); + file.data.language = 'javascript'; + file.data.type = 'text/javascript'; + file.data.defer = false; + file.data.text = file.xhrLoader.responseText; + + document.head.appendChild(file.data); + } + + this.complete = true; + } + } + +}); + +/** + * Adds an array of Script files to the current load queue. + * + * The difference between this and the `ScriptFile` file type is that you give an array of scripts to this method, + * and the scripts are then processed _exactly_ in that order. This allows you to load a bunch of scripts that + * may have dependancies on each other without worrying about the async nature of traditional script loading. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.scripts('PostProcess', [ + * 'libs/shaders/CopyShader.js', + * 'libs/postprocessing/EffectComposer.js', + * 'libs/postprocessing/RenderPass.js', + * 'libs/postprocessing/MaskPass.js', + * 'libs/postprocessing/ShaderPass.js', + * 'libs/postprocessing/AfterimagePass.js' + * ]); + * } + * ``` + * + * In the code above the script files will all be loaded in parallel but only processed (i.e. invoked) in the exact + * order given in the array. + * + * The files are **not** loaded right away. They are added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the files are queued + * it means you cannot use the files immediately after calling this method, but must wait for the files to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.scripts({ + * key: 'PostProcess', + * url: [ + * 'libs/shaders/CopyShader.js', + * 'libs/postprocessing/EffectComposer.js', + * 'libs/postprocessing/RenderPass.js', + * 'libs/postprocessing/MaskPass.js', + * 'libs/postprocessing/ShaderPass.js', + * 'libs/postprocessing/AfterimagePass.js' + * ] + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.MultiScriptFileConfig` for more details. + * + * Once all the files have finished loading they will automatically be converted into a script element + * via `document.createElement('script')`. They will have their language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. This is done in the exact order the files are specified in the url array. + * + * The URLs can be relative or absolute. If the URLs are relative the `Loader.baseURL` and `Loader.path` values will be prepended to them. + * + * Note: The ability to load this type of file will only be available if the MultiScript File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#scripts + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.17.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.MultiScriptFileConfig|Phaser.Types.Loader.FileTypes.MultiScriptFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string[]} [url] - An array of absolute or relative URLs to load the script files from. They are processed in the order given in the array. + * @param {string} [extension='js'] - The default file extension to use if no url is provided. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for these files. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('scripts', function (key, url, xhrSettings) +{ + var multifile; + + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new MultiScriptFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new MultiScriptFile(this, key, url, xhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = MultiScriptFile; + + +/***/ }), +/* 1196 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var FileTypesManager = __webpack_require__(8); +var JSONFile = __webpack_require__(58); + +/** + * @classdesc + * A single JSON Pack File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#pack method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#pack. + * + * @class PackFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.PackFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var PackFile = new Class({ + + Extends: JSONFile, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function PackFile (loader, key, url, xhrSettings, dataKey) + { + JSONFile.call(this, loader, key, url, xhrSettings, dataKey); + + this.type = 'packfile'; + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.PackFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; + + this.data = JSON.parse(this.xhrLoader.responseText); + } + + // Let's pass the pack file data over to the Loader ... + this.loader.addPack(this.data, this.config); + + this.onProcessComplete(); + } + +}); + +/** + * Adds a JSON File Pack, or array of packs, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.pack('level1', 'data/Level1Files.json'); + * } + * ``` + * + * A File Pack is a JSON file (or object) that contains details about other files that should be added into the Loader. + * Here is a small example: + * + * ```json + * { + * "test1": { + * "files": [ + * { + * "type": "image", + * "key": "taikodrummaster", + * "url": "assets/pics/taikodrummaster.jpg" + * }, + * { + * "type": "image", + * "key": "sukasuka-chtholly", + * "url": "assets/pics/sukasuka-chtholly.png" + * } + * ] + * }, + * "meta": { + * "generated": "1401380327373", + * "app": "Phaser 3 Asset Packer", + * "url": "https://phaser.io", + * "version": "1.0", + * "copyright": "Photon Storm Ltd. 2018" + * } + * } + * ``` + * + * The pack can be split into sections. In the example above you'll see a section called `test1. You can tell + * the `load.pack` method to parse only a particular section of a pack. The pack is stored in the JSON Cache, + * so you can pass it to the Loader to process additional sections as needed in your game, or you can just load + * them all at once without specifying anything. + * + * The pack file can contain an entry for any type of file that Phaser can load. The object structures exactly + * match that of the file type configs, and all properties available within the file type configs can be used + * in the pack file too. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.pack({ + * key: 'level1', + * url: 'data/Level1Files.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.PackFileConfig` for more details. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the Pack File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#pack + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.7.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.PackFileConfig|Phaser.Types.Loader.FileTypes.PackFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('pack', function (key, url, packKey, xhrSettings) +{ + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.addFile(new PackFile(this, key[i])); + } + } + else + { + this.addFile(new PackFile(this, key, url, xhrSettings, packKey)); + } + + return this; +}); + +module.exports = PackFile; + + +/***/ }), +/* 1197 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single Plugin Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#plugin method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#plugin. + * + * @class PluginFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.PluginFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {boolean} [start=false] - Automatically start the plugin after loading? + * @param {string} [mapping] - If this plugin is to be injected into the Scene, this is the property key used. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var PluginFile = new Class({ + + Extends: File, + + initialize: + + function PluginFile (loader, key, url, start, mapping, xhrSettings) + { + var extension = 'js'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + start = GetFastValue(config, 'start'); + mapping = GetFastValue(config, 'mapping'); + } + + var fileConfig = { + type: 'plugin', + cache: false, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: { + start: start, + mapping: mapping + } + }; + + File.call(this, loader, fileConfig); + + // If the url variable refers to a class, add the plugin directly + if (typeof url === 'function') + { + this.data = url; + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.PluginFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + var pluginManager = this.loader.systems.plugins; + var config = this.config; + + var start = GetFastValue(config, 'start', false); + var mapping = GetFastValue(config, 'mapping', null); + + if (this.state === CONST.FILE_POPULATED) + { + pluginManager.install(this.key, this.data, start, mapping); + } + else + { + // Plugin added via a js file + this.state = CONST.FILE_PROCESSING; + + this.data = document.createElement('script'); + this.data.language = 'javascript'; + this.data.type = 'text/javascript'; + this.data.defer = false; + this.data.text = this.xhrLoader.responseText; + + document.head.appendChild(this.data); + + var plugin = pluginManager.install(this.key, window[this.key], start, mapping); + + if (start || mapping) + { + // Install into the current Scene Systems and Scene + this.loader.systems[mapping] = plugin; + this.loader.scene[mapping] = plugin; + } + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a Plugin Script file, or array of plugin files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.plugin('modplayer', 'plugins/ModPlayer.js'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.plugin({ + * key: 'modplayer', + * url: 'plugins/ModPlayer.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.PluginFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a script element + * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. It will then be passed to the Phaser PluginCache.register method. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Plugin File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#plugin + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.PluginFileConfig|Phaser.Types.Loader.FileTypes.PluginFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {(string|function)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". Or, a plugin function. + * @param {boolean} [start] - Automatically start the plugin after loading? + * @param {string} [mapping] - If this plugin is to be injected into the Scene, this is the property key used. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('plugin', function (key, url, start, mapping, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new PluginFile(this, key[i])); + } + } + else + { + this.addFile(new PluginFile(this, key, url, start, mapping, xhrSettings)); + } + + return this; +}); + +module.exports = PluginFile; + + +/***/ }), +/* 1198 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * An external Scene JavaScript File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#sceneFile method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#sceneFile. + * + * @class SceneFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.16.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.SceneFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var SceneFile = new Class({ + + Extends: File, + + initialize: + + function SceneFile (loader, key, url, xhrSettings) + { + var extension = 'js'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'text', + cache: loader.cacheManager.text, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.SceneFile#onProcess + * @since 3.16.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = this.xhrLoader.responseText; + + this.onProcessComplete(); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.SceneFile#addToCache + * @since 3.16.0 + */ + addToCache: function () + { + var code = this.data.concat('(function(){\n' + 'return new ' + this.key + '();\n' + '}).call(this);'); + + this.loader.sceneManager.add(this.key, eval(code)); + + this.complete = true; + } + +}); + +/** + * Adds an external Scene file, or array of Scene files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.sceneFile('Level1', 'src/Level1.js'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Scene Manager upon a successful load. + * + * For a Scene File it's vitally important that the key matches the class name in the JavaScript file. + * + * For example here is the source file: + * + * ```javascript + * class ExternalScene extends Phaser.Scene { + * + * constructor () + * { + * super('myScene'); + * } + * + * } + * ``` + * + * Because the class is called `ExternalScene` that is the exact same key you must use when loading it: + * + * ```javascript + * function preload () + * { + * this.load.sceneFile('ExternalScene', 'src/yourScene.js'); + * } + * ``` + * + * The key that is used within the Scene Manager can either be set to the same, or you can override it in the Scene + * constructor, as we've done in the example above, where the Scene key was changed to `myScene`. + * + * The key should be unique both in terms of files being loaded and Scenes already present in the Scene Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Scene Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.sceneFile({ + * key: 'Level1', + * url: 'src/Level1.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SceneFileConfig` for more details. + * + * Once the file has finished loading it will be added to the Scene Manager. + * + * ```javascript + * this.load.sceneFile('Level1', 'src/Level1.js'); + * // and later in your game ... + * this.scene.start('Level1'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `WORLD1.` and the key was `Story` the final key will be `WORLD1.Story` and + * this is what you would use to retrieve the text from the Scene Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Scene File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#sceneFile + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.16.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.SceneFileConfig|Phaser.Types.Loader.FileTypes.SceneFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('sceneFile', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new SceneFile(this, key[i])); + } + } + else + { + this.addFile(new SceneFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = SceneFile; + + +/***/ }), +/* 1199 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single Scene Plugin Script File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#scenePlugin method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#scenePlugin. + * + * @class ScenePluginFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.8.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.ScenePluginFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". + * @param {string} [systemKey] - If this plugin is to be added to Scene.Systems, this is the property key for it. + * @param {string} [sceneKey] - If this plugin is to be added to the Scene, this is the property key for it. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var ScenePluginFile = new Class({ + + Extends: File, + + initialize: + + function ScenePluginFile (loader, key, url, systemKey, sceneKey, xhrSettings) + { + var extension = 'js'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + systemKey = GetFastValue(config, 'systemKey'); + sceneKey = GetFastValue(config, 'sceneKey'); + } + + var fileConfig = { + type: 'scenePlugin', + cache: false, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: { + systemKey: systemKey, + sceneKey: sceneKey + } + }; + + File.call(this, loader, fileConfig); + + // If the url variable refers to a class, add the plugin directly + if (typeof url === 'function') + { + this.data = url; + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.ScenePluginFile#onProcess + * @since 3.8.0 + */ + onProcess: function () + { + var pluginManager = this.loader.systems.plugins; + var config = this.config; + + var key = this.key; + var systemKey = GetFastValue(config, 'systemKey', key); + var sceneKey = GetFastValue(config, 'sceneKey', key); + + if (this.state === CONST.FILE_POPULATED) + { + pluginManager.installScenePlugin(systemKey, this.data, sceneKey, this.loader.scene, true); + } + else + { + // Plugin added via a js file + this.state = CONST.FILE_PROCESSING; + + this.data = document.createElement('script'); + this.data.language = 'javascript'; + this.data.type = 'text/javascript'; + this.data.defer = false; + this.data.text = this.xhrLoader.responseText; + + document.head.appendChild(this.data); + + pluginManager.installScenePlugin(systemKey, window[this.key], sceneKey, this.loader.scene, true); + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a Scene Plugin Script file, or array of plugin files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.scenePlugin('ModPlayer', 'plugins/ModPlayer.js', 'modPlayer', 'mods'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String and not already in-use by another file in the Loader. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.scenePlugin({ + * key: 'modplayer', + * url: 'plugins/ModPlayer.js' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.ScenePluginFileConfig` for more details. + * + * Once the file has finished loading it will automatically be converted into a script element + * via `document.createElement('script')`. It will have its language set to JavaScript, `defer` set to + * false and then the resulting element will be appended to `document.head`. Any code then in the + * script will be executed. It will then be passed to the Phaser PluginCache.register method. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.js". It will always add `.js` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Script File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#scenePlugin + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.8.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.ScenePluginFileConfig|Phaser.Types.Loader.FileTypes.ScenePluginFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {(string|function)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.js`, i.e. if `key` was "alien" then the URL will be "alien.js". Or, set to a plugin function. + * @param {string} [systemKey] - If this plugin is to be added to Scene.Systems, this is the property key for it. + * @param {string} [sceneKey] - If this plugin is to be added to the Scene, this is the property key for it. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('scenePlugin', function (key, url, systemKey, sceneKey, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new ScenePluginFile(this, key[i])); + } + } + else + { + this.addFile(new ScenePluginFile(this, key, url, systemKey, sceneKey, xhrSettings)); + } + + return this; +}); + +module.exports = ScenePluginFile; + + +/***/ }), +/* 1200 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var ImageFile = __webpack_require__(70); + +/** + * @classdesc + * A single Sprite Sheet Image File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#spritesheet method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spritesheet. + * + * @class SpriteSheetFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var SpriteSheetFile = new Class({ + + Extends: ImageFile, + + initialize: + + function SpriteSheetFile (loader, key, url, frameConfig, xhrSettings) + { + ImageFile.call(this, loader, key, url, xhrSettings, frameConfig); + + this.type = 'spritesheet'; + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.SpriteSheetFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture = this.cache.addSpriteSheet(this.key, this.data, this.config); + + this.pendingDestroy(texture); + } + +}); + +/** + * Adds a Sprite Sheet Image, or array of Sprite Sheet Images, to the current load queue. + * + * The term 'Sprite Sheet' in Phaser means a fixed-size sheet. Where every frame in the sheet is the exact same size, + * and you reference those frames using numbers, not frame names. This is not the same thing as a Texture Atlas, where + * the frames are packed in a way where they take up the least amount of space, and are referenced by their names, + * not numbers. Some articles and software use the term 'Sprite Sheet' to mean Texture Atlas, so please be aware of + * what sort of file you're actually trying to load. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 }); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.spritesheet({ + * key: 'bot', + * url: 'images/robot.png', + * frameConfig: { + * frameWidth: 32, + * frameHeight: 38, + * startFrame: 0, + * endFrame: 8 + * } + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.spritesheet('bot', 'images/robot.png', { frameWidth: 32, frameHeight: 38 }); + * // and later in your game ... + * this.add.image(x, y, 'bot', 0); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `PLAYER.` and the key was `Running` the final key will be `PLAYER.Running` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.spritesheet('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ], { frameWidth: 256, frameHeight: 80 }); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.spritesheet({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png', + * frameConfig: { + * frameWidth: 256, + * frameHeight: 80 + * } + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Sprite Sheet File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#spritesheet + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig|Phaser.Types.Loader.FileTypes.SpriteSheetFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. At a minimum it should have a `frameWidth` property. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('spritesheet', function (key, url, frameConfig, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new SpriteSheetFile(this, key[i])); + } + } + else + { + this.addFile(new SpriteSheetFile(this, key, url, frameConfig, xhrSettings)); + } + + return this; +}); + +module.exports = SpriteSheetFile; + + +/***/ }), +/* 1201 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single SVG File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#svg method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#svg. + * + * @class SVGFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.SVGFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was "alien" then the URL will be "alien.svg". + * @param {Phaser.Types.Loader.FileTypes.SVGSizeConfig} [svgConfig] - The svg size configuration object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var SVGFile = new Class({ + + Extends: File, + + initialize: + + function SVGFile (loader, key, url, svgConfig, xhrSettings) + { + var extension = 'svg'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + svgConfig = GetFastValue(config, 'svgConfig', {}); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'svg', + cache: loader.textureManager, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: { + width: GetFastValue(svgConfig, 'width'), + height: GetFastValue(svgConfig, 'height'), + scale: GetFastValue(svgConfig, 'scale') + } + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.SVGFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + var text = this.xhrLoader.responseText; + var svg = [ text ]; + var width = this.config.width; + var height = this.config.height; + var scale = this.config.scale; + + resize: if (width && height || scale) + { + var xml = null; + var parser = new DOMParser(); + xml = parser.parseFromString(text, 'text/xml'); + var svgXML = xml.getElementsByTagName('svg')[0]; + + var hasViewBox = svgXML.hasAttribute('viewBox'); + var svgWidth = parseFloat(svgXML.getAttribute('width')); + var svgHeight = parseFloat(svgXML.getAttribute('height')); + + if (!hasViewBox && svgWidth && svgHeight) + { + // If there's no viewBox attribute, set one + svgXML.setAttribute('viewBox', '0 0 ' + svgWidth + ' ' + svgHeight); + } + else if (hasViewBox && !svgWidth && !svgHeight) + { + // Get the w/h from the viewbox + var viewBox = svgXML.getAttribute('viewBox').split(/\s+|,/); + + svgWidth = viewBox[2]; + svgHeight = viewBox[3]; + } + + if (scale) + { + if (svgWidth && svgHeight) + { + width = svgWidth * scale; + height = svgHeight * scale; + } + else + { + break resize; + } + } + + svgXML.setAttribute('width', width.toString() + 'px'); + svgXML.setAttribute('height', height.toString() + 'px'); + + svg = [ (new XMLSerializer()).serializeToString(svgXML) ]; + } + + try + { + var blob = new window.Blob(svg, { type: 'image/svg+xml;charset=utf-8' }); + } + catch (e) + { + this.onProcessError(); + + return; + } + + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + var _this = this; + var retry = false; + + this.data.onload = function () + { + if (!retry) + { + File.revokeObjectURL(_this.data); + } + + _this.onProcessComplete(); + }; + + this.data.onerror = function () + { + // Safari 8 re-try + if (!retry) + { + retry = true; + + File.revokeObjectURL(_this.data); + + _this.data.src = 'data:image/svg+xml,' + encodeURIComponent(svg.join('')); + } + else + { + _this.onProcessError(); + } + }; + + File.createObjectURL(this.data, blob, 'image/svg+xml'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.SVGFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } + +}); + +/** + * Adds an SVG File, or array of SVG Files, to the current load queue. When the files are loaded they + * will be rendered to bitmap textures and stored in the Texture Manager. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.SVGFileConfig` for more details. + * + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: + * + * ```javascript + * this.load.svg('morty', 'images/Morty.svg'); + * // and later in your game ... + * this.add.image(x, y, 'morty'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.html". It will always add `.html` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can optionally pass an SVG Resize Configuration object when you load an SVG file. By default the SVG will be rendered to a texture + * at the same size defined in the SVG file attributes. However, this isn't always desirable. You may wish to resize the SVG (either down + * or up) to improve texture clarity, or reduce texture memory consumption. You can either specify an exact width and height to resize + * the SVG to: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg', { width: 300, height: 600 }); + * } + * ``` + * + * Or when using a configuration object: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg', + * svgConfig: { + * width: 300, + * height: 600 + * } + * }); + * ``` + * + * Alternatively, you can just provide a scale factor instead: + * + * ```javascript + * function preload () + * { + * this.load.svg('morty', 'images/Morty.svg', { scale: 2.5 }); + * } + * ``` + * + * Or when using a configuration object: + * + * ```javascript + * this.load.svg({ + * key: 'morty', + * url: 'images/Morty.svg', + * svgConfig: { + * scale: 2.5 + * } + * }); + * ``` + * + * If scale, width and height values are all given, the scale has priority and the width and height values are ignored. + * + * Note: The ability to load this type of file will only be available if the SVG File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#svg + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.SVGFileConfig|Phaser.Types.Loader.FileTypes.SVGFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.svg`, i.e. if `key` was "alien" then the URL will be "alien.svg". + * @param {Phaser.Types.Loader.FileTypes.SVGSizeConfig} [svgConfig] - The svg size configuration object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('svg', function (key, url, svgConfig, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new SVGFile(this, key[i])); + } + } + else + { + this.addFile(new SVGFile(this, key, url, svgConfig, xhrSettings)); + } + + return this; +}); + +module.exports = SVGFile; + + + +/***/ }), +/* 1202 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var File = __webpack_require__(20); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); +var TILEMAP_FORMATS = __webpack_require__(31); + +/** + * @classdesc + * A single Tilemap CSV File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapCSV method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapCSV. + * + * @class TilemapCSVFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.csv`, i.e. if `key` was "alien" then the URL will be "alien.csv". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var TilemapCSVFile = new Class({ + + Extends: File, + + initialize: + + function TilemapCSVFile (loader, key, url, xhrSettings) + { + var extension = 'csv'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + } + + var fileConfig = { + type: 'tilemapCSV', + cache: loader.cacheManager.tilemap, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + + this.tilemapFormat = TILEMAP_FORMATS.CSV; + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.TilemapCSVFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = this.xhrLoader.responseText; + + this.onProcessComplete(); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.TilemapCSVFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var tiledata = { format: this.tilemapFormat, data: this.data }; + + this.cache.add(this.key, tiledata); + + this.pendingDestroy(tiledata); + } + +}); + +/** + * Adds a CSV Tilemap file, or array of CSV files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.tilemapCSV('level1', 'maps/Level1.csv'); + * } + * ``` + * + * Tilemap CSV data can be created in a text editor, or a 3rd party app that exports as CSV. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.tilemapCSV({ + * key: 'level1', + * url: 'maps/Level1.csv' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.tilemapCSV('level1', 'maps/Level1.csv'); + * // and later in your game ... + * var map = this.make.tilemap({ key: 'level1' }); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Tilemap Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "level" + * and no URL is given then the Loader will set the URL to be "level.csv". It will always add `.csv` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Tilemap CSV File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#tilemapCSV + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig|Phaser.Types.Loader.FileTypes.TilemapCSVFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.csv`, i.e. if `key` was "alien" then the URL will be "alien.csv". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('tilemapCSV', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new TilemapCSVFile(this, key[i])); + } + } + else + { + this.addFile(new TilemapCSVFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = TilemapCSVFile; + + +/***/ }), +/* 1203 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var JSONFile = __webpack_require__(58); +var TILEMAP_FORMATS = __webpack_require__(31); + +/** + * @classdesc + * A single Impact.js Tilemap JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapImpact method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapImpact. + * + * @class TilemapImpactFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var TilemapImpactFile = new Class({ + + Extends: JSONFile, + + initialize: + + function TilemapImpactFile (loader, key, url, xhrSettings) + { + JSONFile.call(this, loader, key, url, xhrSettings); + + this.type = 'tilemapJSON'; + + this.cache = loader.cacheManager.tilemap; + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.TilemapImpactFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var tiledata = { format: TILEMAP_FORMATS.WELTMEISTER, data: this.data }; + + this.cache.add(this.key, tiledata); + + this.pendingDestroy(tiledata); + } + +}); + +/** + * Adds an Impact.js Tilemap file, or array of map files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.tilemapImpact('level1', 'maps/Level1.json'); + * } + * ``` + * + * Impact Tilemap data is created the Impact.js Map Editor called Weltmeister. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.tilemapImpact({ + * key: 'level1', + * url: 'maps/Level1.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.tilemapImpact('level1', 'maps/Level1.json'); + * // and later in your game ... + * var map = this.make.tilemap({ key: 'level1' }); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Tilemap Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "level" + * and no URL is given then the Loader will set the URL to be "level.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Tilemap Impact File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#tilemapImpact + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.7.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig|Phaser.Types.Loader.FileTypes.TilemapImpactFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('tilemapImpact', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new TilemapImpactFile(this, key[i])); + } + } + else + { + this.addFile(new TilemapImpactFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = TilemapImpactFile; + + +/***/ }), +/* 1204 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var JSONFile = __webpack_require__(58); +var TILEMAP_FORMATS = __webpack_require__(31); + +/** + * @classdesc + * A single Tiled Tilemap JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#tilemapTiledJSON method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#tilemapTiledJSON. + * + * @class TilemapJSONFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var TilemapJSONFile = new Class({ + + Extends: JSONFile, + + initialize: + + function TilemapJSONFile (loader, key, url, xhrSettings) + { + JSONFile.call(this, loader, key, url, xhrSettings); + + this.type = 'tilemapJSON'; + + this.cache = loader.cacheManager.tilemap; + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.TilemapJSONFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var tiledata = { format: TILEMAP_FORMATS.TILED_JSON, data: this.data }; + + this.cache.add(this.key, tiledata); + + this.pendingDestroy(tiledata); + } + +}); + +/** + * Adds a Tiled JSON Tilemap file, or array of map files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.tilemapTiledJSON('level1', 'maps/Level1.json'); + * } + * ``` + * + * The Tilemap data is created using the Tiled Map Editor and selecting JSON as the export format. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Tilemap Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Tilemap Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.tilemapTiledJSON({ + * key: 'level1', + * url: 'maps/Level1.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.tilemapTiledJSON('level1', 'maps/Level1.json'); + * // and later in your game ... + * var map = this.make.tilemap({ key: 'level1' }); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Tilemap Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "level" + * and no URL is given then the Loader will set the URL to be "level.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Tilemap JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#tilemapTiledJSON + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig|Phaser.Types.Loader.FileTypes.TilemapJSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('tilemapTiledJSON', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new TilemapJSONFile(this, key[i])); + } + } + else + { + this.addFile(new TilemapJSONFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = TilemapJSONFile; + + +/***/ }), +/* 1205 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var ImageFile = __webpack_require__(70); +var IsPlainObject = __webpack_require__(7); +var MultiFile = __webpack_require__(59); +var TextFile = __webpack_require__(432); + +/** + * @classdesc + * A single text file based Unity Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#unityAtlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#unityAtlas. + * + * @class UnityAtlasFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + */ +var UnityAtlasFile = new Class({ + + Extends: MultiFile, + + initialize: + + function UnityAtlasFile (loader, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) + { + var image; + var data; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + image = new ImageFile(loader, { + key: key, + url: GetFastValue(config, 'textureURL'), + extension: GetFastValue(config, 'textureExtension', 'png'), + normalMap: GetFastValue(config, 'normalMap'), + xhrSettings: GetFastValue(config, 'textureXhrSettings') + }); + + data = new TextFile(loader, { + key: key, + url: GetFastValue(config, 'atlasURL'), + extension: GetFastValue(config, 'atlasExtension', 'txt'), + xhrSettings: GetFastValue(config, 'atlasXhrSettings') + }); + } + else + { + image = new ImageFile(loader, key, textureURL, textureXhrSettings); + data = new TextFile(loader, key, atlasURL, atlasXhrSettings); + } + + if (image.linkFile) + { + // Image has a normal map + MultiFile.call(this, loader, 'unityatlas', key, [ image, data, image.linkFile ]); + } + else + { + MultiFile.call(this, loader, 'unityatlas', key, [ image, data ]); + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.UnityAtlasFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var image = this.files[0]; + var text = this.files[1]; + var normalMap = (this.files[2]) ? this.files[2].data : null; + + this.loader.textureManager.addUnityAtlas(image.key, image.data, text.data, normalMap); + + text.addToCache(); + + this.complete = true; + } + } + +}); + +/** + * Adds a Unity YAML based Texture Atlas, or array of atlases, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * Phaser expects the atlas data to be provided in a YAML formatted text file as exported from Unity. + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.unityAtlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * atlasURL: 'images/MainMenu.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig` for more details. + * + * Once the atlas has finished loading you can use frames from it as textures for a Game Object by referencing its key: + * + * ```javascript + * this.load.unityAtlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json'); + * // and later in your game ... + * this.add.image(x, y, 'mainmenu', 'background'); + * ``` + * + * To get a list of all available frames within an atlas please consult your Texture Atlas software. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: + * + * ```javascript + * this.load.unityAtlas('mainmenu', [ 'images/MainMenu.png', 'images/MainMenu-n.png' ], 'images/MainMenu.txt'); + * ``` + * + * Or, if you are using a config object use the `normalMap` property: + * + * ```javascript + * this.load.unityAtlas({ + * key: 'mainmenu', + * textureURL: 'images/MainMenu.png', + * normalMap: 'images/MainMenu-n.png', + * atlasURL: 'images/MainMenu.txt' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Unity Atlas File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#unityAtlas + * @fires Phaser.Loader.LoaderPlugin#addFileEvent + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig|Phaser.Types.Loader.FileTypes.UnityAtlasFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings. + * + * @return {Phaser.Loader.LoaderPlugin} The Loader instance. + */ +FileTypesManager.register('unityAtlas', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) +{ + var multifile; + + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new UnityAtlasFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new UnityAtlasFile(this, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = UnityAtlasFile; + + +/***/ }), +/* 1206 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(16); +var CustomSet = __webpack_require__(105); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(80); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var XHRSettings = __webpack_require__(133); + +/** + * @classdesc + * The Loader handles loading all external content such as Images, Sounds, Texture Atlases and data files. + * You typically interact with it via `this.load` in your Scene. Scenes can have a `preload` method, which is always + * called before the Scenes `create` method, allowing you to preload assets that the Scene may need. + * + * If you call any `this.load` methods from outside of `Scene.preload` then you need to start the Loader going + * yourself by calling `Loader.start()`. It's only automatically started during the Scene preload. + * + * The Loader uses a combination of tag loading (eg. Audio elements) and XHR and provides progress and completion events. + * Files are loaded in parallel by default. The amount of concurrent connections can be controlled in your Game Configuration. + * + * Once the Loader has started loading you are still able to add files to it. These can be injected as a result of a loader + * event, the type of file being loaded (such as a pack file) or other external events. As long as the Loader hasn't finished + * simply adding a new file to it, while running, will ensure it's added into the current queue. + * + * Every Scene has its own instance of the Loader and they are bound to the Scene in which they are created. However, + * assets loaded by the Loader are placed into global game-level caches. For example, loading an XML file will place that + * file inside `Game.cache.xml`, which is accessible from every Scene in your game, no matter who was responsible + * for loading it. The same is true of Textures. A texture loaded in one Scene is instantly available to all other Scenes + * in your game. + * + * The Loader works by using custom File Types. These are stored in the FileTypesManager, which injects them into the Loader + * when it's instantiated. You can create your own custom file types by extending either the File or MultiFile classes. + * See those files for more details. + * + * @class LoaderPlugin + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Loader + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene which owns this Loader instance. + */ +var LoaderPlugin = new Class({ + + Extends: EventEmitter, + + initialize: + + function LoaderPlugin (scene) + { + EventEmitter.call(this); + + var gameConfig = scene.sys.game.config; + var sceneConfig = scene.sys.settings.loader; + + /** + * The Scene which owns this Loader instance. + * + * @name Phaser.Loader.LoaderPlugin#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Scene Systems. + * + * @name Phaser.Loader.LoaderPlugin#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * A reference to the global Cache Manager. + * + * @name Phaser.Loader.LoaderPlugin#cacheManager + * @type {Phaser.Cache.CacheManager} + * @since 3.7.0 + */ + this.cacheManager = scene.sys.cache; + + /** + * A reference to the global Texture Manager. + * + * @name Phaser.Loader.LoaderPlugin#textureManager + * @type {Phaser.Textures.TextureManager} + * @since 3.7.0 + */ + this.textureManager = scene.sys.textures; + + /** + * A reference to the global Scene Manager. + * + * @name Phaser.Loader.LoaderPlugin#sceneManager + * @type {Phaser.Scenes.SceneManager} + * @protected + * @since 3.16.0 + */ + this.sceneManager = scene.sys.game.scene; + + // Inject the available filetypes into the Loader + FileTypesManager.install(this); + + /** + * An optional prefix that is automatically prepended to the start of every file key. + * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`. + * You can set this directly, or call `Loader.setPrefix()`. It will then affect every file added to the Loader + * from that point on. It does _not_ change any file already in the load queue. + * + * @name Phaser.Loader.LoaderPlugin#prefix + * @type {string} + * @default '' + * @since 3.7.0 + */ + this.prefix = ''; + + /** + * The value of `path`, if set, is placed before any _relative_ file path given. For example: + * + * ```javascript + * this.load.path = "images/sprites/"; + * this.load.image("ball", "ball.png"); + * this.load.image("tree", "level1/oaktree.png"); + * this.load.image("boom", "http://server.com/explode.png"); + * ``` + * + * Would load the `ball` file from `images/sprites/ball.png` and the tree from + * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL + * given as it's an absolute URL. + * + * Please note that the path is added before the filename but *after* the baseURL (if set.) + * + * If you set this property directly then it _must_ end with a "/". Alternatively, call `setPath()` and it'll do it for you. + * + * @name Phaser.Loader.LoaderPlugin#path + * @type {string} + * @default '' + * @since 3.0.0 + */ + this.path = ''; + + /** + * If you want to append a URL before the path of any asset you can set this here. + * + * Useful if allowing the asset base url to be configured outside of the game code. + * + * If you set this property directly then it _must_ end with a "/". Alternatively, call `setBaseURL()` and it'll do it for you. + * + * @name Phaser.Loader.LoaderPlugin#baseURL + * @type {string} + * @default '' + * @since 3.0.0 + */ + this.baseURL = ''; + + this.setBaseURL(GetFastValue(sceneConfig, 'baseURL', gameConfig.loaderBaseURL)); + + this.setPath(GetFastValue(sceneConfig, 'path', gameConfig.loaderPath)); + + this.setPrefix(GetFastValue(sceneConfig, 'prefix', gameConfig.loaderPrefix)); + + /** + * The number of concurrent / parallel resources to try and fetch at once. + * + * Old browsers limit 6 requests per domain; modern ones, especially those with HTTP/2 don't limit it at all. + * + * The default is 32 but you can change this in your Game Config, or by changing this property before the Loader starts. + * + * @name Phaser.Loader.LoaderPlugin#maxParallelDownloads + * @type {integer} + * @since 3.0.0 + */ + this.maxParallelDownloads = GetFastValue(sceneConfig, 'maxParallelDownloads', gameConfig.loaderMaxParallelDownloads); + + /** + * xhr specific global settings (can be overridden on a per-file basis) + * + * @name Phaser.Loader.LoaderPlugin#xhr + * @type {Phaser.Types.Loader.XHRSettingsObject} + * @since 3.0.0 + */ + this.xhr = XHRSettings( + GetFastValue(sceneConfig, 'responseType', gameConfig.loaderResponseType), + GetFastValue(sceneConfig, 'async', gameConfig.loaderAsync), + GetFastValue(sceneConfig, 'user', gameConfig.loaderUser), + GetFastValue(sceneConfig, 'password', gameConfig.loaderPassword), + GetFastValue(sceneConfig, 'timeout', gameConfig.loaderTimeout) + ); + + /** + * The crossOrigin value applied to loaded images. Very often this needs to be set to 'anonymous'. + * + * @name Phaser.Loader.LoaderPlugin#crossOrigin + * @type {string} + * @since 3.0.0 + */ + this.crossOrigin = GetFastValue(sceneConfig, 'crossOrigin', gameConfig.loaderCrossOrigin); + + /** + * The total number of files to load. It may not always be accurate because you may add to the Loader during the process + * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. + * + * @name Phaser.Loader.LoaderPlugin#totalToLoad + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.totalToLoad = 0; + + /** + * The progress of the current load queue, as a float value between 0 and 1. + * This is updated automatically as files complete loading. + * Note that it is possible for this value to go down again if you add content to the current load queue during a load. + * + * @name Phaser.Loader.LoaderPlugin#progress + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.progress = 0; + + /** + * Files are placed in this Set when they're added to the Loader via `addFile`. + * + * They are moved to the `inflight` Set when they start loading, and assuming a successful + * load, to the `queue` Set for further processing. + * + * By the end of the load process this Set will be empty. + * + * @name Phaser.Loader.LoaderPlugin#list + * @type {Phaser.Structs.Set.} + * @since 3.0.0 + */ + this.list = new CustomSet(); + + /** + * Files are stored in this Set while they're in the process of being loaded. + * + * Upon a successful load they are moved to the `queue` Set. + * + * By the end of the load process this Set will be empty. + * + * @name Phaser.Loader.LoaderPlugin#inflight + * @type {Phaser.Structs.Set.} + * @since 3.0.0 + */ + this.inflight = new CustomSet(); + + /** + * Files are stored in this Set while they're being processed. + * + * If the process is successful they are moved to their final destination, which could be + * a Cache or the Texture Manager. + * + * At the end of the load process this Set will be empty. + * + * @name Phaser.Loader.LoaderPlugin#queue + * @type {Phaser.Structs.Set.} + * @since 3.0.0 + */ + this.queue = new CustomSet(); + + /** + * A temporary Set in which files are stored after processing, + * awaiting destruction at the end of the load process. + * + * @name Phaser.Loader.LoaderPlugin#_deleteQueue + * @type {Phaser.Structs.Set.} + * @private + * @since 3.7.0 + */ + this._deleteQueue = new CustomSet(); + + /** + * The total number of files that failed to load during the most recent load. + * This value is reset when you call `Loader.start`. + * + * @name Phaser.Loader.LoaderPlugin#totalFailed + * @type {integer} + * @default 0 + * @since 3.7.0 + */ + this.totalFailed = 0; + + /** + * The total number of files that successfully loaded during the most recent load. + * This value is reset when you call `Loader.start`. + * + * @name Phaser.Loader.LoaderPlugin#totalComplete + * @type {integer} + * @default 0 + * @since 3.7.0 + */ + this.totalComplete = 0; + + /** + * The current state of the Loader. + * + * @name Phaser.Loader.LoaderPlugin#state + * @type {integer} + * @readonly + * @since 3.0.0 + */ + this.state = CONST.LOADER_IDLE; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.pluginStart, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Loader.LoaderPlugin#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Loader.LoaderPlugin#pluginStart + * @private + * @since 3.5.1 + */ + pluginStart: function () + { + this.systems.events.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * If you want to append a URL before the path of any asset you can set this here. + * + * Useful if allowing the asset base url to be configured outside of the game code. + * + * Once a base URL is set it will affect every file loaded by the Loader from that point on. It does _not_ change any + * file _already_ being loaded. To reset it, call this method with no arguments. + * + * @method Phaser.Loader.LoaderPlugin#setBaseURL + * @since 3.0.0 + * + * @param {string} [url] - The URL to use. Leave empty to reset. + * + * @return {Phaser.Loader.LoaderPlugin} This Loader object. + */ + setBaseURL: function (url) + { + if (url === undefined) { url = ''; } + + if (url !== '' && url.substr(-1) !== '/') + { + url = url.concat('/'); + } + + this.baseURL = url; + + return this; + }, + + /** + * The value of `path`, if set, is placed before any _relative_ file path given. For example: + * + * ```javascript + * this.load.setPath("images/sprites/"); + * this.load.image("ball", "ball.png"); + * this.load.image("tree", "level1/oaktree.png"); + * this.load.image("boom", "http://server.com/explode.png"); + * ``` + * + * Would load the `ball` file from `images/sprites/ball.png` and the tree from + * `images/sprites/level1/oaktree.png` but the file `boom` would load from the URL + * given as it's an absolute URL. + * + * Please note that the path is added before the filename but *after* the baseURL (if set.) + * + * Once a path is set it will then affect every file added to the Loader from that point on. It does _not_ change any + * file _already_ in the load queue. To reset it, call this method with no arguments. + * + * @method Phaser.Loader.LoaderPlugin#setPath + * @since 3.0.0 + * + * @param {string} [path] - The path to use. Leave empty to reset. + * + * @return {Phaser.Loader.LoaderPlugin} This Loader object. + */ + setPath: function (path) + { + if (path === undefined) { path = ''; } + + if (path !== '' && path.substr(-1) !== '/') + { + path = path.concat('/'); + } + + this.path = path; + + return this; + }, + + /** + * An optional prefix that is automatically prepended to the start of every file key. + * + * If prefix was `MENU.` and you load an image with the key 'Background' the resulting key would be `MENU.Background`. + * + * Once a prefix is set it will then affect every file added to the Loader from that point on. It does _not_ change any + * file _already_ in the load queue. To reset it, call this method with no arguments. + * + * @method Phaser.Loader.LoaderPlugin#setPrefix + * @since 3.7.0 + * + * @param {string} [prefix] - The prefix to use. Leave empty to reset. + * + * @return {Phaser.Loader.LoaderPlugin} This Loader object. + */ + setPrefix: function (prefix) + { + if (prefix === undefined) { prefix = ''; } + + this.prefix = prefix; + + return this; + }, + + /** + * Sets the Cross Origin Resource Sharing value used when loading files. + * + * Files can override this value on a per-file basis by specifying an alternative `crossOrigin` value in their file config. + * + * Once CORs is set it will then affect every file loaded by the Loader from that point on, as long as they don't have + * their own CORs setting. To reset it, call this method with no arguments. + * + * For more details about CORs see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS + * + * @method Phaser.Loader.LoaderPlugin#setCORS + * @since 3.0.0 + * + * @param {string} [crossOrigin] - The value to use for the `crossOrigin` property in the load request. + * + * @return {Phaser.Loader.LoaderPlugin} This Loader object. + */ + setCORS: function (crossOrigin) + { + this.crossOrigin = crossOrigin; + + return this; + }, + + /** + * Adds a file, or array of files, into the load queue. + * + * The file must be an instance of `Phaser.Loader.File`, or a class that extends it. The Loader will check that the key + * used by the file won't conflict with any other key either in the loader, the inflight queue or the target cache. + * If allowed it will then add the file into the pending list, read for the load to start. Or, if the load has already + * started, ready for the next batch of files to be pulled from the list to the inflight queue. + * + * You should not normally call this method directly, but rather use one of the Loader methods like `image` or `atlas`, + * however you can call this as long as the file given to it is well formed. + * + * @method Phaser.Loader.LoaderPlugin#addFile + * @fires Phaser.Loader.Events#ADD + * @since 3.0.0 + * + * @param {(Phaser.Loader.File|Phaser.Loader.File[])} file - The file, or array of files, to be added to the load queue. + */ + addFile: function (file) + { + if (!Array.isArray(file)) + { + file = [ file ]; + } + + for (var i = 0; i < file.length; i++) + { + var item = file[i]; + + // Does the file already exist in the cache or texture manager? + // Or will it conflict with a file already in the queue or inflight? + if (!this.keyExists(item)) + { + this.list.set(item); + + this.emit(Events.ADD, item.key, item.type, this, item); + + if (this.isLoading()) + { + this.totalToLoad++; + this.updateProgress(); + } + } + } + }, + + /** + * Checks the key and type of the given file to see if it will conflict with anything already + * in a Cache, the Texture Manager, or the list or inflight queues. + * + * @method Phaser.Loader.LoaderPlugin#keyExists + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The file to check the key of. + * + * @return {boolean} `true` if adding this file will cause a cache or queue conflict, otherwise `false`. + */ + keyExists: function (file) + { + var keyConflict = file.hasCacheConflict(); + + if (!keyConflict) + { + this.list.iterate(function (item) + { + if (item.type === file.type && item.key === file.key) + { + keyConflict = true; + + return false; + } + + }); + } + + if (!keyConflict && this.isLoading()) + { + this.inflight.iterate(function (item) + { + if (item.type === file.type && item.key === file.key) + { + keyConflict = true; + + return false; + } + + }); + + this.queue.iterate(function (item) + { + if (item.type === file.type && item.key === file.key) + { + keyConflict = true; + + return false; + } + + }); + } + + return keyConflict; + }, + + /** + * Takes a well formed, fully parsed pack file object and adds its entries into the load queue. Usually you do not call + * this method directly, but instead use `Loader.pack` and supply a path to a JSON file that holds the + * pack data. However, if you've got the data prepared you can pass it to this method. + * + * You can also provide an optional key. If you do then it will only add the entries from that part of the pack into + * to the load queue. If not specified it will add all entries it finds. For more details about the pack file format + * see the `LoaderPlugin.pack` method. + * + * @method Phaser.Loader.LoaderPlugin#addPack + * @since 3.7.0 + * + * @param {any} data - The Pack File data to be parsed and each entry of it to added to the load queue. + * @param {string} [packKey] - An optional key to use from the pack file data. + * + * @return {boolean} `true` if any files were added to the queue, otherwise `false`. + */ + addPack: function (pack, packKey) + { + // if no packKey provided we'll add everything to the queue + if (packKey && pack.hasOwnProperty(packKey)) + { + pack = { packKey: pack[packKey] }; + } + + var total = 0; + + // Store the loader settings in case this pack replaces them + var currentBaseURL = this.baseURL; + var currentPath = this.path; + var currentPrefix = this.prefix; + + // Here we go ... + for (var key in pack) + { + var config = pack[key]; + + // Any meta data to process? + var baseURL = GetFastValue(config, 'baseURL', currentBaseURL); + var path = GetFastValue(config, 'path', currentPath); + var prefix = GetFastValue(config, 'prefix', currentPrefix); + var files = GetFastValue(config, 'files', null); + var defaultType = GetFastValue(config, 'defaultType', 'void'); + + if (Array.isArray(files)) + { + this.setBaseURL(baseURL); + this.setPath(path); + this.setPrefix(prefix); + + for (var i = 0; i < files.length; i++) + { + var file = files[i]; + var type = (file.hasOwnProperty('type')) ? file.type : defaultType; + + if (this[type]) + { + this[type](file); + total++; + } + } + } + } + + // Reset the loader settings + this.setBaseURL(currentBaseURL); + this.setPath(currentPath); + this.setPrefix(currentPrefix); + + return (total > 0); + }, + + /** + * Is the Loader actively loading, or processing loaded files? + * + * @method Phaser.Loader.LoaderPlugin#isLoading + * @since 3.0.0 + * + * @return {boolean} `true` if the Loader is busy loading or processing, otherwise `false`. + */ + isLoading: function () + { + return (this.state === CONST.LOADER_LOADING || this.state === CONST.LOADER_PROCESSING); + }, + + /** + * Is the Loader ready to start a new load? + * + * @method Phaser.Loader.LoaderPlugin#isReady + * @since 3.0.0 + * + * @return {boolean} `true` if the Loader is ready to start a new load, otherwise `false`. + */ + isReady: function () + { + return (this.state === CONST.LOADER_IDLE || this.state === CONST.LOADER_COMPLETE); + }, + + /** + * Starts the Loader running. This will reset the progress and totals and then emit a `start` event. + * If there is nothing in the queue the Loader will immediately complete, otherwise it will start + * loading the first batch of files. + * + * The Loader is started automatically if the queue is populated within your Scenes `preload` method. + * + * However, outside of this, you need to call this method to start it. + * + * If the Loader is already running this method will simply return. + * + * @method Phaser.Loader.LoaderPlugin#start + * @fires Phaser.Loader.Events#START + * @since 3.0.0 + */ + start: function () + { + if (!this.isReady()) + { + return; + } + + this.progress = 0; + + this.totalFailed = 0; + this.totalComplete = 0; + this.totalToLoad = this.list.size; + + this.emit(Events.START, this); + + if (this.list.size === 0) + { + this.loadComplete(); + } + else + { + this.state = CONST.LOADER_LOADING; + + this.inflight.clear(); + this.queue.clear(); + + this.updateProgress(); + + this.checkLoadQueue(); + + this.systems.events.on(SceneEvents.UPDATE, this.update, this); + } + }, + + /** + * Called automatically during the load process. + * It updates the `progress` value and then emits a progress event, which you can use to + * display a loading bar in your game. + * + * @method Phaser.Loader.LoaderPlugin#updateProgress + * @fires Phaser.Loader.Events#PROGRESS + * @since 3.0.0 + */ + updateProgress: function () + { + this.progress = 1 - ((this.list.size + this.inflight.size) / this.totalToLoad); + + this.emit(Events.PROGRESS, this.progress); + }, + + /** + * Called automatically during the load process. + * + * @method Phaser.Loader.LoaderPlugin#update + * @since 3.10.0 + */ + update: function () + { + if (this.state === CONST.LOADER_LOADING && this.list.size > 0 && this.inflight.size < this.maxParallelDownloads) + { + this.checkLoadQueue(); + } + }, + + /** + * An internal method called by the Loader. + * + * It will check to see if there are any more files in the pending list that need loading, and if so it will move + * them from the list Set into the inflight Set, set their CORs flag and start them loading. + * + * It will carrying on doing this for each file in the pending list until it runs out, or hits the max allowed parallel downloads. + * + * @method Phaser.Loader.LoaderPlugin#checkLoadQueue + * @private + * @since 3.7.0 + */ + checkLoadQueue: function () + { + this.list.each(function (file) + { + if (file.state === CONST.FILE_POPULATED || (file.state === CONST.FILE_PENDING && this.inflight.size < this.maxParallelDownloads)) + { + this.inflight.set(file); + + this.list.delete(file); + + // If the file doesn't have its own crossOrigin set, we'll use the Loaders (which is undefined by default) + if (!file.crossOrigin) + { + file.crossOrigin = this.crossOrigin; + } + + file.load(); + } + + if (this.inflight.size === this.maxParallelDownloads) + { + // Tells the Set iterator to abort + return false; + } + + }, this); + }, + + /** + * An internal method called automatically by the XHRLoader belong to a File. + * + * This method will remove the given file from the inflight Set and update the load progress. + * If the file was successful its `onProcess` method is called, otherwise it is added to the delete queue. + * + * @method Phaser.Loader.LoaderPlugin#nextFile + * @fires Phaser.Loader.Events#FILE_LOAD + * @fires Phaser.Loader.Events#FILE_LOAD_ERROR + * @since 3.0.0 + * + * @param {Phaser.Loader.File} file - The File that just finished loading, or errored during load. + * @param {boolean} success - `true` if the file loaded successfully, otherwise `false`. + */ + nextFile: function (file, success) + { + // Has the game been destroyed during load? If so, bail out now. + if (!this.inflight) + { + return; + } + + this.inflight.delete(file); + + this.updateProgress(); + + if (success) + { + this.totalComplete++; + + this.queue.set(file); + + this.emit(Events.FILE_LOAD, file); + + file.onProcess(); + } + else + { + this.totalFailed++; + + this._deleteQueue.set(file); + + this.emit(Events.FILE_LOAD_ERROR, file); + + this.fileProcessComplete(file); + } + }, + + /** + * An internal method that is called automatically by the File when it has finished processing. + * + * If the process was successful, and the File isn't part of a MultiFile, its `addToCache` method is called. + * + * It this then removed from the queue. If there are no more files to load `loadComplete` is called. + * + * @method Phaser.Loader.LoaderPlugin#fileProcessComplete + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The file that has finished processing. + */ + fileProcessComplete: function (file) + { + // Has the game been destroyed during load? If so, bail out now. + if (!this.scene || !this.systems || !this.systems.game || this.systems.game.pendingDestroy) + { + return; + } + + // This file has failed, so move it to the failed Set + if (file.state === CONST.FILE_ERRORED) + { + if (file.multiFile) + { + file.multiFile.onFileFailed(file); + } + } + else if (file.state === CONST.FILE_COMPLETE) + { + if (file.multiFile) + { + if (file.multiFile.isReadyToProcess()) + { + // If we got here then all files the link file needs are ready to add to the cache + file.multiFile.addToCache(); + } + } + else + { + // If we got here, then the file processed, so let it add itself to its cache + file.addToCache(); + } + } + + // Remove it from the queue + this.queue.delete(file); + + // Nothing left to do? + + if (this.list.size === 0 && this.inflight.size === 0 && this.queue.size === 0) + { + this.loadComplete(); + } + }, + + /** + * Called at the end when the load queue is exhausted and all files have either loaded or errored. + * By this point every loaded file will now be in its associated cache and ready for use. + * + * Also clears down the Sets, puts progress to 1 and clears the deletion queue. + * + * @method Phaser.Loader.LoaderPlugin#loadComplete + * @fires Phaser.Loader.Events#COMPLETE + * @fires Phaser.Loader.Events#POST_PROCESS + * @since 3.7.0 + */ + loadComplete: function () + { + this.emit(Events.POST_PROCESS, this); + + this.list.clear(); + this.inflight.clear(); + this.queue.clear(); + + this.progress = 1; + + this.state = CONST.LOADER_COMPLETE; + + this.systems.events.off(SceneEvents.UPDATE, this.update, this); + + // Call 'destroy' on each file ready for deletion + this._deleteQueue.iterateLocal('destroy'); + + this._deleteQueue.clear(); + + this.emit(Events.COMPLETE, this, this.totalComplete, this.totalFailed); + }, + + /** + * Adds a File into the pending-deletion queue. + * + * @method Phaser.Loader.LoaderPlugin#flagForRemoval + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File to be queued for deletion when the Loader completes. + */ + flagForRemoval: function (file) + { + this._deleteQueue.set(file); + }, + + /** + * Converts the given JSON data into a file that the browser then prompts you to download so you can save it locally. + * + * The data must be well formed JSON and ready-parsed, not a JavaScript object. + * + * @method Phaser.Loader.LoaderPlugin#saveJSON + * @since 3.0.0 + * + * @param {*} data - The JSON data, ready parsed. + * @param {string} [filename=file.json] - The name to save the JSON file as. + * + * @return {Phaser.Loader.LoaderPlugin} This Loader plugin. + */ + saveJSON: function (data, filename) + { + return this.save(JSON.stringify(data), filename); + }, + + /** + * Causes the browser to save the given data as a file to its default Downloads folder. + * + * Creates a DOM level anchor link, assigns it as being a `download` anchor, sets the href + * to be an ObjectURL based on the given data, and then invokes a click event. + * + * @method Phaser.Loader.LoaderPlugin#save + * @since 3.0.0 + * + * @param {*} data - The data to be saved. Will be passed through URL.createObjectURL. + * @param {string} [filename=file.json] - The filename to save the file as. + * @param {string} [filetype=application/json] - The file type to use when saving the file. Defaults to JSON. + * + * @return {Phaser.Loader.LoaderPlugin} This Loader plugin. + */ + save: function (data, filename, filetype) + { + if (filename === undefined) { filename = 'file.json'; } + if (filetype === undefined) { filetype = 'application/json'; } + + var blob = new Blob([ data ], { type: filetype }); + + var url = URL.createObjectURL(blob); + + var a = document.createElement('a'); + + a.download = filename; + a.textContent = 'Download ' + filename; + a.href = url; + a.click(); + + return this; + }, + + /** + * Resets the Loader. + * + * This will clear all lists and reset the base URL, path and prefix. + * + * Warning: If the Loader is currently downloading files, or has files in its queue, they will be aborted. + * + * @method Phaser.Loader.LoaderPlugin#reset + * @since 3.0.0 + */ + reset: function () + { + this.list.clear(); + this.inflight.clear(); + this.queue.clear(); + + var gameConfig = this.systems.game.config; + var sceneConfig = this.systems.settings.loader; + + this.setBaseURL(GetFastValue(sceneConfig, 'baseURL', gameConfig.loaderBaseURL)); + this.setPath(GetFastValue(sceneConfig, 'path', gameConfig.loaderPath)); + this.setPrefix(GetFastValue(sceneConfig, 'prefix', gameConfig.loaderPrefix)); + + this.state = CONST.LOADER_IDLE; + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.Loader.LoaderPlugin#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + this.reset(); + + this.state = CONST.LOADER_SHUTDOWN; + + this.systems.events.off(SceneEvents.UPDATE, this.update, this); + this.systems.events.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.Loader.LoaderPlugin#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.state = CONST.LOADER_DESTROYED; + + this.systems.events.off(SceneEvents.UPDATE, this.update, this); + this.systems.events.off(SceneEvents.START, this.pluginStart, this); + + this.list = null; + this.inflight = null; + this.queue = null; + + this.scene = null; + this.systems = null; + this.textureManager = null; + this.cacheManager = null; + this.sceneManager = null; + } + +}); + +PluginCache.register('Loader', LoaderPlugin, 'load'); + +module.exports = LoaderPlugin; + + +/***/ }), +/* 1207 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(50); +var Extend = __webpack_require__(17); + +/** + * @callback ArcadePhysicsCallback + * + * @param {Phaser.GameObjects.GameObject} object1 - The first Body to separate. + * @param {Phaser.GameObjects.GameObject} object2 - The second Body to separate. + */ + +/** + * @namespace Phaser.Physics.Arcade + */ + +var Arcade = { + + ArcadePhysics: __webpack_require__(1208), + Body: __webpack_require__(438), + Collider: __webpack_require__(439), + Components: __webpack_require__(207), + Events: __webpack_require__(208), + Factory: __webpack_require__(433), + Group: __webpack_require__(435), + Image: __webpack_require__(434), + Sprite: __webpack_require__(134), + StaticBody: __webpack_require__(445), + StaticGroup: __webpack_require__(436), + World: __webpack_require__(437) + +}; + +// Merge in the consts +Arcade = Extend(false, Arcade, CONST); + +module.exports = Arcade; + + +/***/ }), +/* 1208 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var DegToRad = __webpack_require__(35); +var DistanceBetween = __webpack_require__(57); +var DistanceSquared = __webpack_require__(294); +var Factory = __webpack_require__(433); +var GetFastValue = __webpack_require__(2); +var Merge = __webpack_require__(85); +var OverlapRect = __webpack_require__(1221); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var Vector2 = __webpack_require__(4); +var World = __webpack_require__(437); + +/** + * @classdesc + * The Arcade Physics Plugin belongs to a Scene and sets up and manages the Scene's physics simulation. + * It also holds some useful methods for moving and rotating Arcade Physics Bodies. + * + * You can access it from within a Scene using `this.physics`. + * + * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable + * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. + * The separation that stops two objects penetrating may create a new penetration against a different object. If you + * require a high level of stability please consider using an alternative physics system, such as Matter.js. + * + * @class ArcadePhysics + * @memberof Phaser.Physics.Arcade + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene that this Plugin belongs to. + */ +var ArcadePhysics = new Class({ + + initialize: + + function ArcadePhysics (scene) + { + /** + * The Scene that this Plugin belongs to. + * + * @name Phaser.Physics.Arcade.ArcadePhysics#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * The Scene's Systems. + * + * @name Phaser.Physics.Arcade.ArcadePhysics#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * A configuration object. Union of the `physics.arcade.*` properties of the GameConfig and SceneConfig objects. + * + * @name Phaser.Physics.Arcade.ArcadePhysics#config + * @type {object} + * @since 3.0.0 + */ + this.config = this.getConfig(); + + /** + * The physics simulation. + * + * @name Phaser.Physics.Arcade.ArcadePhysics#world + * @type {Phaser.Physics.Arcade.World} + * @since 3.0.0 + */ + this.world; + + /** + * An object holding the Arcade Physics factory methods. + * + * @name Phaser.Physics.Arcade.ArcadePhysics#add + * @type {Phaser.Physics.Arcade.Factory} + * @since 3.0.0 + */ + this.add; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.world = new World(this.scene, this.config); + this.add = new Factory(this.world); + + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#start + * @private + * @since 3.5.0 + */ + start: function () + { + if (!this.world) + { + this.world = new World(this.scene, this.config); + this.add = new Factory(this.world); + } + + var eventEmitter = this.systems.events; + + eventEmitter.on(SceneEvents.UPDATE, this.world.update, this.world); + eventEmitter.on(SceneEvents.POST_UPDATE, this.world.postUpdate, this.world); + eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * Creates the physics configuration for the current Scene. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#getConfig + * @since 3.0.0 + * + * @return {object} The physics configuration. + */ + getConfig: function () + { + var gameConfig = this.systems.game.config.physics; + var sceneConfig = this.systems.settings.physics; + + var config = Merge( + GetFastValue(sceneConfig, 'arcade', {}), + GetFastValue(gameConfig, 'arcade', {}) + ); + + return config; + }, + + /** + * Tests if Game Objects overlap. See {@link Phaser.Physics.Arcade.World#overlap} + * + * @method Phaser.Physics.Arcade.ArcadePhysics#overlap + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {*} [callbackContext] - The context in which to run the callbacks. + * + * @return {boolean} True if at least one Game Object overlaps another. + * + * @see Phaser.Physics.Arcade.World#overlap + */ + overlap: function (object1, object2, overlapCallback, processCallback, callbackContext) + { + if (overlapCallback === undefined) { overlapCallback = null; } + if (processCallback === undefined) { processCallback = null; } + if (callbackContext === undefined) { callbackContext = overlapCallback; } + + return this.world.collideObjects(object1, object2, overlapCallback, processCallback, callbackContext, true); + }, + + /** + * Performs a collision check and separation between the two physics enabled objects given, which can be single + * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. + * + * If you don't require separation then use {@link #overlap} instead. + * + * If two Groups or arrays are passed, each member of one will be tested against each member of the other. + * + * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members. + * + * If **only** one Array is passed, the array is iterated and every element in it is tested against the others. + * + * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding + * objects are passed to it. + * + * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable + * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. + * The separation that stops two objects penetrating may create a new penetration against a different object. If you + * require a high level of stability please consider using an alternative physics system, such as Matter.js. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#collide + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} object1 - The first object or array of objects to check. + * @param {Phaser.Types.Physics.Arcade.ArcadeColliderType} [object2] - The second object or array of objects to check, or `undefined`. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {*} [callbackContext] - The context in which to run the callbacks. + * + * @return {boolean} True if any overlapping Game Objects were separated, otherwise false. + * + * @see Phaser.Physics.Arcade.World#collide + */ + collide: function (object1, object2, collideCallback, processCallback, callbackContext) + { + if (collideCallback === undefined) { collideCallback = null; } + if (processCallback === undefined) { processCallback = null; } + if (callbackContext === undefined) { callbackContext = collideCallback; } + + return this.world.collideObjects(object1, object2, collideCallback, processCallback, callbackContext, false); + }, + + /** + * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects. + * + * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for collision with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions + * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * + * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have + * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the + * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on + * dynamic maps, this method can prove very useful. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#collideTiles + * @fires Phaser.Physics.Arcade.Events#TILE_COLLIDE + * @since 3.17.0 + * + * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. + * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} [callbackContext] - The context in which to run the callbacks. + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + collideTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext) + { + return this.world.collideTiles(sprite, tiles, collideCallback, processCallback, callbackContext); + }, + + /** + * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects. + * + * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform + * tile filtering and culling for you, as well as handle the interesting face collision automatically. + * + * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without + * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap + * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, + * you should filter them before passing them to this method. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#overlapTiles + * @fires Phaser.Physics.Arcade.Events#TILE_OVERLAP + * @since 3.17.0 + * + * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. + * @param {Phaser.Tilemaps.Tile[]} tiles - An array of Tiles to check for collision against. + * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects overlap. + * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} [callbackContext] - The context in which to run the callbacks. + * + * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. + */ + overlapTiles: function (sprite, tiles, collideCallback, processCallback, callbackContext) + { + return this.world.overlapTiles(sprite, tiles, collideCallback, processCallback, callbackContext); + }, + + /** + * Pauses the simulation. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#pause + * @since 3.0.0 + * + * @return {Phaser.Physics.Arcade.World} The simulation. + */ + pause: function () + { + return this.world.pause(); + }, + + /** + * Resumes the simulation (if paused). + * + * @method Phaser.Physics.Arcade.ArcadePhysics#resume + * @since 3.0.0 + * + * @return {Phaser.Physics.Arcade.World} The simulation. + */ + resume: function () + { + return this.world.resume(); + }, + + /** + * Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared) + * + * You must give a maximum speed value, beyond which the game object won't go any faster. + * + * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course. + * Note: The game object doesn't stop moving once it reaches the destination coordinates. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#accelerateTo + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - Any Game Object with an Arcade Physics body. + * @param {number} x - The x coordinate to accelerate towards. + * @param {number} y - The y coordinate to accelerate towards. + * @param {number} [speed=60] - The acceleration (change in speed) in pixels per second squared. + * @param {number} [xSpeedMax=500] - The maximum x velocity the game object can reach. + * @param {number} [ySpeedMax=500] - The maximum y velocity the game object can reach. + * + * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity. + */ + accelerateTo: function (gameObject, x, y, speed, xSpeedMax, ySpeedMax) + { + if (speed === undefined) { speed = 60; } + + var angle = Math.atan2(y - gameObject.y, x - gameObject.x); + + gameObject.body.acceleration.setToPolar(angle, speed); + + if (xSpeedMax !== undefined && ySpeedMax !== undefined) + { + gameObject.body.maxVelocity.set(xSpeedMax, ySpeedMax); + } + + return angle; + }, + + /** + * Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared) + * + * You must give a maximum speed value, beyond which the game object won't go any faster. + * + * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course. + * Note: The game object doesn't stop moving once it reaches the destination coordinates. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#accelerateToObject + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - Any Game Object with an Arcade Physics body. + * @param {Phaser.GameObjects.GameObject} destination - The Game Object to move towards. Can be any object but must have visible x/y properties. + * @param {number} [speed=60] - The acceleration (change in speed) in pixels per second squared. + * @param {number} [xSpeedMax=500] - The maximum x velocity the game object can reach. + * @param {number} [ySpeedMax=500] - The maximum y velocity the game object can reach. + * + * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity. + */ + accelerateToObject: function (gameObject, destination, speed, xSpeedMax, ySpeedMax) + { + return this.accelerateTo(gameObject, destination.x, destination.y, speed, xSpeedMax, ySpeedMax); + }, + + /** + * Finds the Dynamic Body closest to a source point or object. + * + * If two or more bodies are the exact same distance from the source point, only the first body + * is returned. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#closest + * @since 3.0.0 + * + * @param {any} source - Any object with public `x` and `y` properties, such as a Game Object or Geometry object. + * + * @return {Phaser.Physics.Arcade.Body} The closest Dynamic Body to the given source point. + */ + closest: function (source) + { + var bodies = this.world.bodies; + + var min = Number.MAX_VALUE; + var closest = null; + var x = source.x; + var y = source.y; + + bodies.iterate(function (target) + { + var distance = DistanceSquared(x, y, target.x, target.y); + + if (distance < min) + { + closest = target; + min = distance; + } + + }); + + return closest; + }, + + /** + * Finds the Dynamic Body farthest from a source point or object. + * + * If two or more bodies are the exact same distance from the source point, only the first body + * is returned. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#furthest + * @since 3.0.0 + * + * @param {any} source - Any object with public `x` and `y` properties, such as a Game Object or Geometry object. + * + * @return {Phaser.Physics.Arcade.Body} The Dynamic Body furthest away from the given source point. + */ + furthest: function (source) + { + var bodies = this.world.bodies; + + var max = -1; + var farthest = null; + var x = source.x; + var y = source.y; + + bodies.iterate(function (target) + { + var distance = DistanceSquared(x, y, target.x, target.y); + + if (distance > max) + { + farthest = target; + max = distance; + } + + }); + + return farthest; + }, + + /** + * Move the given display object towards the x/y coordinates at a steady velocity. + * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds. + * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. + * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. + * Note: The display object doesn't stop moving once it reaches the destination coordinates. + * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) + * + * @method Phaser.Physics.Arcade.ArcadePhysics#moveTo + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - Any Game Object with an Arcade Physics body. + * @param {number} x - The x coordinate to move towards. + * @param {number} y - The y coordinate to move towards. + * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec) + * @param {number} [maxTime=0] - Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms. + * + * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity. + */ + moveTo: function (gameObject, x, y, speed, maxTime) + { + if (speed === undefined) { speed = 60; } + if (maxTime === undefined) { maxTime = 0; } + + var angle = Math.atan2(y - gameObject.y, x - gameObject.x); + + if (maxTime > 0) + { + // We know how many pixels we need to move, but how fast? + speed = DistanceBetween(gameObject.x, gameObject.y, x, y) / (maxTime / 1000); + } + + gameObject.body.velocity.setToPolar(angle, speed); + + return angle; + }, + + /** + * Move the given display object towards the destination object at a steady velocity. + * If you specify a maxTime then it will adjust the speed (overwriting what you set) so it arrives at the destination in that number of seconds. + * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. + * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. + * Note: The display object doesn't stop moving once it reaches the destination coordinates. + * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) + * + * @method Phaser.Physics.Arcade.ArcadePhysics#moveToObject + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - Any Game Object with an Arcade Physics body. + * @param {object} destination - Any object with public `x` and `y` properties, such as a Game Object or Geometry object. + * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec) + * @param {number} [maxTime=0] - Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms. + * + * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity. + */ + moveToObject: function (gameObject, destination, speed, maxTime) + { + return this.moveTo(gameObject, destination.x, destination.y, speed, maxTime); + }, + + /** + * Given the angle (in degrees) and speed calculate the velocity and return it as a vector, or set it to the given vector object. + * One way to use this is: velocityFromAngle(angle, 200, sprite.body.velocity) which will set the values directly to the sprite's velocity and not create a new vector object. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#velocityFromAngle + * @since 3.0.0 + * + * @param {number} angle - The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) + * @param {number} [speed=60] - The speed it will move, in pixels per second squared. + * @param {Phaser.Math.Vector2} [vec2] - The Vector2 in which the x and y properties will be set to the calculated velocity. + * + * @return {Phaser.Math.Vector2} The Vector2 that stores the velocity. + */ + velocityFromAngle: function (angle, speed, vec2) + { + if (speed === undefined) { speed = 60; } + if (vec2 === undefined) { vec2 = new Vector2(); } + + return vec2.setToPolar(DegToRad(angle), speed); + }, + + /** + * Given the rotation (in radians) and speed calculate the velocity and return it as a vector, or set it to the given vector object. + * One way to use this is: velocityFromRotation(rotation, 200, sprite.body.velocity) which will set the values directly to the sprite's velocity and not create a new vector object. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#velocityFromRotation + * @since 3.0.0 + * + * @param {number} rotation - The angle in radians. + * @param {number} [speed=60] - The speed it will move, in pixels per second squared + * @param {Phaser.Math.Vector2} [vec2] - The Vector2 in which the x and y properties will be set to the calculated velocity. + * + * @return {Phaser.Math.Vector2} The Vector2 that stores the velocity. + */ + velocityFromRotation: function (rotation, speed, vec2) + { + if (speed === undefined) { speed = 60; } + if (vec2 === undefined) { vec2 = new Vector2(); } + + return vec2.setToPolar(rotation, speed); + }, + + /** + * This method will search the given rectangular area and return an array of all physics bodies that + * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. + * + * A body only has to intersect with the search area to be considered, it doesn't have to be fully + * contained within it. + * + * If Arcade Physics is set to use the RTree (which it is by default) then the search for is extremely fast, + * otherwise the search is O(N) for Dynamic Bodies. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#overlapRect + * @since 3.17.0 + * + * @param {number} x - The top-left x coordinate of the area to search within. + * @param {number} y - The top-left y coordinate of the area to search within. + * @param {number} width - The width of the area to search within. + * @param {number} height - The height of the area to search within. + * @param {boolean} [includeDynamic=true] - Should the search include Dynamic Bodies? + * @param {boolean} [includeStatic=false] - Should the search include Static Bodies? + * + * @return {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[])} An array of bodies that overlap with the given area. + */ + overlapRect: function (x, y, width, height, includeDynamic, includeStatic) + { + return OverlapRect(this.world, x, y, width, height, includeDynamic, includeStatic); + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + if (!this.world) + { + // Already destroyed + return; + } + + var eventEmitter = this.systems.events; + + eventEmitter.off(SceneEvents.UPDATE, this.world.update, this.world); + eventEmitter.off(SceneEvents.POST_UPDATE, this.world.postUpdate, this.world); + eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); + + this.add.destroy(); + this.world.destroy(); + + this.add = null; + this.world = null; + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.Physics.Arcade.ArcadePhysics#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + } + +}); + +PluginCache.register('ArcadePhysics', ArcadePhysics, 'arcadePhysics'); + +module.exports = ArcadePhysics; + + +/***/ }), +/* 1209 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the acceleration properties of an Arcade Physics Body. + * + * @namespace Phaser.Physics.Arcade.Components.Acceleration + * @since 3.0.0 + */ +var Acceleration = { + + /** + * Sets the body's horizontal and vertical acceleration. If the vertical acceleration value is not provided, the vertical acceleration is set to the same value as the horizontal acceleration. + * + * @method Phaser.Physics.Arcade.Components.Acceleration#setAcceleration + * @since 3.0.0 + * + * @param {number} x - The horizontal acceleration + * @param {number} [y=x] - The vertical acceleration + * + * @return {this} This Game Object. + */ + setAcceleration: function (x, y) + { + this.body.acceleration.set(x, y); + + return this; + }, + + /** + * Sets the body's horizontal acceleration. + * + * @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationX + * @since 3.0.0 + * + * @param {number} value - The horizontal acceleration + * + * @return {this} This Game Object. + */ + setAccelerationX: function (value) + { + this.body.acceleration.x = value; + + return this; + }, + + /** + * Sets the body's vertical acceleration. + * + * @method Phaser.Physics.Arcade.Components.Acceleration#setAccelerationY + * @since 3.0.0 + * + * @param {number} value - The vertical acceleration + * + * @return {this} This Game Object. + */ + setAccelerationY: function (value) + { + this.body.acceleration.y = value; + + return this; + } + +}; + +module.exports = Acceleration; + + +/***/ }), +/* 1210 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the angular acceleration properties of an Arcade Physics Body. + * + * @namespace Phaser.Physics.Arcade.Components.Angular + * @since 3.0.0 + */ +var Angular = { + + /** + * Sets the angular velocity of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * + * @method Phaser.Physics.Arcade.Components.Angular#setAngularVelocity + * @since 3.0.0 + * + * @param {number} value - The amount of angular velocity. + * + * @return {this} This Game Object. + */ + setAngularVelocity: function (value) + { + this.body.angularVelocity = value; + + return this; + }, + + /** + * Sets the angular acceleration of the body. + * + * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. + * However, they can have angular motion, which is passed on to the Game Object bound to the body, + * causing them to visually rotate, even though the body remains axis-aligned. + * + * @method Phaser.Physics.Arcade.Components.Angular#setAngularAcceleration + * @since 3.0.0 + * + * @param {number} value - The amount of angular acceleration. + * + * @return {this} This Game Object. + */ + setAngularAcceleration: function (value) + { + this.body.angularAcceleration = value; + + return this; + }, + + /** + * Sets the angular drag of the body. Drag is applied to the current velocity, providing a form of deceleration. + * + * @method Phaser.Physics.Arcade.Components.Angular#setAngularDrag + * @since 3.0.0 + * + * @param {number} value - The amount of drag. + * + * @return {this} This Game Object. + */ + setAngularDrag: function (value) + { + this.body.angularDrag = value; + + return this; + } + +}; + +module.exports = Angular; + + +/***/ }), +/* 1211 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the bounce properties of an Arcade Physics Body. + * + * @namespace Phaser.Physics.Arcade.Components.Bounce + * @since 3.0.0 + */ +var Bounce = { + + /** + * Sets the bounce values of this body. + * + * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. + * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. + * + * @method Phaser.Physics.Arcade.Components.Bounce#setBounce + * @since 3.0.0 + * + * @param {number} x - The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + * @param {number} [y=x] - The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. + * + * @return {this} This Game Object. + */ + setBounce: function (x, y) + { + this.body.bounce.set(x, y); + + return this; + }, + + /** + * Sets the horizontal bounce value for this body. + * + * @method Phaser.Physics.Arcade.Components.Bounce#setBounceX + * @since 3.0.0 + * + * @param {number} value - The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. + * + * @return {this} This Game Object. + */ + setBounceX: function (value) + { + this.body.bounce.x = value; + + return this; + }, + + /** + * Sets the vertical bounce value for this body. + * + * @method Phaser.Physics.Arcade.Components.Bounce#setBounceY + * @since 3.0.0 + * + * @param {number} value - The amount of vertical bounce to apply on collision. A float, typically between 0 and 1. + * + * @return {this} This Game Object. + */ + setBounceY: function (value) + { + this.body.bounce.y = value; + + return this; + }, + + /** + * Sets whether this Body collides with the world boundary. + * + * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Vec2 first. + * + * @method Phaser.Physics.Arcade.Components.Bounce#setCollideWorldBounds + * @since 3.0.0 + * + * @param {boolean} [value=true] - `true` if this body should collide with the world bounds, otherwise `false`. + * @param {number} [bounceX] - If given this will be replace the `worldBounce.x` value. + * @param {number} [bounceY] - If given this will be replace the `worldBounce.y` value. + * + * @return {this} This Game Object. + */ + setCollideWorldBounds: function (value, bounceX, bounceY) + { + this.body.setCollideWorldBounds(value, bounceX, bounceY); + + return this; + } + +}; + +module.exports = Bounce; + + +/***/ }), +/* 1212 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the debug properties of an Arcade Physics Body. + * + * @namespace Phaser.Physics.Arcade.Components.Debug + * @since 3.0.0 + */ +var Debug = { + + /** + * Sets the debug values of this body. + * + * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. + * Note that there is a performance cost in drawing debug displays. It should never be used in production. + * + * @method Phaser.Physics.Arcade.Components.Debug#setDebug + * @since 3.0.0 + * + * @param {boolean} showBody - Set to `true` to have this body render its outline to the debug display. + * @param {boolean} showVelocity - Set to `true` to have this body render a velocity marker to the debug display. + * @param {number} bodyColor - The color of the body outline when rendered to the debug display. + * + * @return {this} This Game Object. + */ + setDebug: function (showBody, showVelocity, bodyColor) + { + this.debugShowBody = showBody; + this.debugShowVelocity = showVelocity; + this.debugBodyColor = bodyColor; + + return this; + }, + + /** + * Sets the color of the body outline when it renders to the debug display. + * + * @method Phaser.Physics.Arcade.Components.Debug#setDebugBodyColor + * @since 3.0.0 + * + * @param {number} value - The color of the body outline when rendered to the debug display. + * + * @return {this} This Game Object. + */ + setDebugBodyColor: function (value) + { + this.body.debugBodyColor = value; + + return this; + }, + + /** + * Set to `true` to have this body render its outline to the debug display. + * + * @name Phaser.Physics.Arcade.Components.Debug#debugShowBody + * @type {boolean} + * @since 3.0.0 + */ + debugShowBody: { + + get: function () + { + return this.body.debugShowBody; + }, + + set: function (value) + { + this.body.debugShowBody = value; + } + + }, + + /** + * Set to `true` to have this body render a velocity marker to the debug display. + * + * @name Phaser.Physics.Arcade.Components.Debug#debugShowVelocity + * @type {boolean} + * @since 3.0.0 + */ + debugShowVelocity: { + + get: function () + { + return this.body.debugShowVelocity; + }, + + set: function (value) + { + this.body.debugShowVelocity = value; + } + + }, + + /** + * The color of the body outline when it renders to the debug display. + * + * @name Phaser.Physics.Arcade.Components.Debug#debugBodyColor + * @type {number} + * @since 3.0.0 + */ + debugBodyColor: { + + get: function () + { + return this.body.debugBodyColor; + }, + + set: function (value) + { + this.body.debugBodyColor = value; + } + + } + +}; + +module.exports = Debug; + + +/***/ }), +/* 1213 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the drag properties of an Arcade Physics Body. + * + * @namespace Phaser.Physics.Arcade.Components.Drag + * @since 3.0.0 + */ +var Drag = { + + /** + * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * + * @method Phaser.Physics.Arcade.Components.Drag#setDrag + * @since 3.0.0 + * + * @param {number} x - The amount of horizontal drag to apply. + * @param {number} [y=x] - The amount of vertical drag to apply. + * + * @return {this} This Game Object. + */ + setDrag: function (x, y) + { + this.body.drag.set(x, y); + + return this; + }, + + /** + * Sets the body's horizontal drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * + * @method Phaser.Physics.Arcade.Components.Drag#setDragX + * @since 3.0.0 + * + * @param {number} value - The amount of horizontal drag to apply. + * + * @return {this} This Game Object. + */ + setDragX: function (value) + { + this.body.drag.x = value; + + return this; + }, + + /** + * Sets the body's vertical drag. + * + * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. + * It is the absolute loss of velocity due to movement, in pixels per second squared. + * The x and y components are applied separately. + * + * When `useDamping` is true, this is 1 minus the damping factor. + * A value of 1 means the Body loses no velocity. + * A value of 0.95 means the Body loses 5% of its velocity per step. + * A value of 0.5 means the Body loses 50% of its velocity per step. + * + * Drag is applied only when `acceleration` is zero. + * + * @method Phaser.Physics.Arcade.Components.Drag#setDragY + * @since 3.0.0 + * + * @param {number} value - The amount of vertical drag to apply. + * + * @return {this} This Game Object. + */ + setDragY: function (value) + { + this.body.drag.y = value; + + return this; + }, + + /** + * If this Body is using `drag` for deceleration this function controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * + * @method Phaser.Physics.Arcade.Components.Drag#setDamping + * @since 3.10.0 + * + * @param {boolean} value - `true` to use damping for deceleration, or `false` to use linear deceleration. + * + * @return {this} This Game Object. + */ + setDamping: function (value) + { + this.body.useDamping = value; + + return this; + } + +}; + +module.exports = Drag; + + +/***/ }), +/* 1214 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the enable properties of an Arcade Physics Body. + * + * @namespace Phaser.Physics.Arcade.Components.Enable + * @since 3.0.0 + */ +var Enable = { + + /** + * Enables this Game Object's Body. + * + * @method Phaser.Physics.Arcade.Components.Enable#enableBody + * @since 3.0.0 + * + * @param {boolean} reset - Also reset the Body and place it at (x, y). + * @param {number} x - The horizontal position to place the Game Object and Body. + * @param {number} y - The horizontal position to place the Game Object and Body. + * @param {boolean} enableGameObject - Also activate this Game Object. + * @param {boolean} showGameObject - Also show this Game Object. + * + * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.Body#enable + * @see Phaser.Physics.Arcade.StaticBody#enable + * @see Phaser.Physics.Arcade.Body#reset + * @see Phaser.Physics.Arcade.StaticBody#reset + * @see Phaser.GameObjects.GameObject#active + * @see Phaser.GameObjects.GameObject#visible + */ + enableBody: function (reset, x, y, enableGameObject, showGameObject) + { + if (reset) + { + this.body.reset(x, y); + } + + if (enableGameObject) + { + this.body.gameObject.active = true; + } + + if (showGameObject) + { + this.body.gameObject.visible = true; + } + + this.body.enable = true; + + return this; + }, + + /** + * Stops and disables this Game Object's Body. + * + * @method Phaser.Physics.Arcade.Components.Enable#disableBody + * @since 3.0.0 + * + * @param {boolean} [disableGameObject=false] - Also deactivate this Game Object. + * @param {boolean} [hideGameObject=false] - Also hide this Game Object. + * + * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.Body#enable + * @see Phaser.Physics.Arcade.StaticBody#enable + * @see Phaser.GameObjects.GameObject#active + * @see Phaser.GameObjects.GameObject#visible + */ + disableBody: function (disableGameObject, hideGameObject) + { + if (disableGameObject === undefined) { disableGameObject = false; } + if (hideGameObject === undefined) { hideGameObject = false; } + + this.body.stop(); + + this.body.enable = false; + + if (disableGameObject) + { + this.body.gameObject.active = false; + } + + if (hideGameObject) + { + this.body.gameObject.visible = false; + } + + return this; + }, + + /** + * Syncs the Body's position and size with its parent Game Object. + * You don't need to call this for Dynamic Bodies, as it happens automatically. + * But for Static bodies it's a useful way of modifying the position of a Static Body + * in the Physics World, based on its Game Object. + * + * @method Phaser.Physics.Arcade.Components.Enable#refreshBody + * @since 3.1.0 + * + * @return {this} This Game Object. + * + * @see Phaser.Physics.Arcade.StaticBody#updateFromGameObject + */ + refreshBody: function () + { + this.body.updateFromGameObject(); + + return this; + } + +}; + +module.exports = Enable; + + +/***/ }), +/* 1215 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. The higher than friction, the faster the body will slow down once force stops being applied to it. + * + * @namespace Phaser.Physics.Arcade.Components.Friction + * @since 3.0.0 + */ +var Friction = { + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * + * @method Phaser.Physics.Arcade.Components.Friction#setFriction + * @since 3.0.0 + * + * @param {number} x - The amount of horizontal friction to apply. + * @param {number} [y=x] - The amount of vertical friction to apply. + * + * @return {this} This Game Object. + */ + setFriction: function (x, y) + { + this.body.friction.set(x, y); + + return this; + }, + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving horizontally in the X axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * + * @method Phaser.Physics.Arcade.Components.Friction#setFrictionX + * @since 3.0.0 + * + * @param {number} x - The amount of friction to apply. + * + * @return {this} This Game Object. + */ + setFrictionX: function (x) + { + this.body.friction.x = x; + + return this; + }, + + /** + * Sets the friction (e.g. the amount of velocity reduced over time) of the physics body when moving vertically in the Y axis. + * The higher than friction, the faster the body will slow down once force stops being applied to it. + * + * @method Phaser.Physics.Arcade.Components.Friction#setFrictionY + * @since 3.0.0 + * + * @param {number} x - The amount of friction to apply. + * + * @return {this} This Game Object. + */ + setFrictionY: function (y) + { + this.body.friction.y = y; + + return this; + } + +}; + +module.exports = Friction; + + +/***/ }), +/* 1216 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods for setting the gravity properties of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.Physics.Arcade.Components.Gravity + * @since 3.0.0 + */ +var Gravity = { + + /** + * Set the X and Y values of the gravitational pull to act upon this Arcade Physics Game Object. Values can be positive or negative. Larger values result in a stronger effect. + * + * If only one value is provided, this value will be used for both the X and Y axis. + * + * @method Phaser.Physics.Arcade.Components.Gravity#setGravity + * @since 3.0.0 + * + * @param {number} x - The gravitational force to be applied to the X-axis. + * @param {number} [y=x] - The gravitational force to be applied to the Y-axis. If this is not specified, the X value will be used. + * + * @return {this} This Game Object. + */ + setGravity: function (x, y) + { + this.body.gravity.set(x, y); + + return this; + }, + + /** + * Set the gravitational force to be applied to the X axis. Value can be positive or negative. Larger values result in a stronger effect. + * + * @method Phaser.Physics.Arcade.Components.Gravity#setGravityX + * @since 3.0.0 + * + * @param {number} x - The gravitational force to be applied to the X-axis. + * + * @return {this} This Game Object. + */ + setGravityX: function (x) + { + this.body.gravity.x = x; + + return this; + }, + + /** + * Set the gravitational force to be applied to the Y axis. Value can be positive or negative. Larger values result in a stronger effect. + * + * @method Phaser.Physics.Arcade.Components.Gravity#setGravityY + * @since 3.0.0 + * + * @param {number} y - The gravitational force to be applied to the Y-axis. + * + * @return {this} This Game Object. + */ + setGravityY: function (y) + { + this.body.gravity.y = y; + + return this; + } + +}; + +module.exports = Gravity; + + +/***/ }), +/* 1217 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the immovable properties of an Arcade Physics Body. + * + * @namespace Phaser.Physics.Arcade.Components.Immovable + * @since 3.0.0 + */ +var Immovable = { + + /** + * Sets Whether this Body can be moved by collisions with another Body. + * + * @method Phaser.Physics.Arcade.Components.Immovable#setImmovable + * @since 3.0.0 + * + * @param {boolean} [value=true] - Sets if this body can be moved by collisions with another Body. + * + * @return {this} This Game Object. + */ + setImmovable: function (value) + { + if (value === undefined) { value = true; } + + this.body.immovable = value; + + return this; + } + +}; + +module.exports = Immovable; + + +/***/ }), +/* 1218 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the mass properties of an Arcade Physics Body. + * + * @namespace Phaser.Physics.Arcade.Components.Mass + * @since 3.0.0 + */ +var Mass = { + + /** + * Sets the mass of the physics body + * + * @method Phaser.Physics.Arcade.Components.Mass#setMass + * @since 3.0.0 + * + * @param {number} value - New value for the mass of the body. + * + * @return {this} This Game Object. + */ + setMass: function (value) + { + this.body.mass = value; + + return this; + } + +}; + +module.exports = Mass; + + +/***/ }), +/* 1219 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods for setting the size of an Arcade Physics Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.Physics.Arcade.Components.Size + * @since 3.0.0 + */ +var Size = { + + /** + * Sets the body offset. This allows you to adjust the difference between the center of the body + * and the x and y coordinates of the parent Game Object. + * + * @method Phaser.Physics.Arcade.Components.Size#setOffset + * @since 3.0.0 + * + * @param {number} x - The amount to offset the body from the parent Game Object along the x-axis. + * @param {number} [y=x] - The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis. + * + * @return {this} This Game Object. + */ + setOffset: function (x, y) + { + this.body.setOffset(x, y); + + return this; + }, + + /** + * Sets the size of this physics body. Setting the size does not adjust the dimensions + * of the parent Game Object. + * + * @method Phaser.Physics.Arcade.Components.Size#setSize + * @since 3.0.0 + * + * @param {number} width - The new width of the physics body, in pixels. + * @param {number} height - The new height of the physics body, in pixels. + * @param {boolean} [center=true] - Should the body be re-positioned so its center aligns with the parent Game Object? + * + * @return {this} This Game Object. + */ + setSize: function (width, height, center) + { + this.body.setSize(width, height, center); + + return this; + }, + + /** + * Sets this physics body to use a circle for collision instead of a rectangle. + * + * @method Phaser.Physics.Arcade.Components.Size#setCircle + * @since 3.0.0 + * + * @param {number} radius - The radius of the physics body, in pixels. + * @param {number} [offsetX] - The amount to offset the body from the parent Game Object along the x-axis. + * @param {number} [offsetY] - The amount to offset the body from the parent Game Object along the y-axis. + * + * @return {this} This Game Object. + */ + setCircle: function (radius, offsetX, offsetY) + { + this.body.setCircle(radius, offsetX, offsetY); + + return this; + } + +}; + +module.exports = Size; + + +/***/ }), +/* 1220 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods for modifying the velocity of an Arcade Physics body. + * + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.Physics.Arcade.Components.Velocity + * @since 3.0.0 + */ +var Velocity = { + + /** + * Sets the velocity of the Body. + * + * @method Phaser.Physics.Arcade.Components.Velocity#setVelocity + * @since 3.0.0 + * + * @param {number} x - The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left. + * @param {number} [y=x] - The vertical velocity of the body. Positive values move the body down, while negative values move it up. + * + * @return {this} This Game Object. + */ + setVelocity: function (x, y) + { + this.body.setVelocity(x, y); + + return this; + }, + + /** + * Sets the horizontal component of the body's velocity. + * + * Positive values move the body to the right, while negative values move it to the left. + * + * @method Phaser.Physics.Arcade.Components.Velocity#setVelocityX + * @since 3.0.0 + * + * @param {number} x - The new horizontal velocity. + * + * @return {this} This Game Object. + */ + setVelocityX: function (x) + { + this.body.setVelocityX(x); + + return this; + }, + + /** + * Sets the vertical component of the body's velocity. + * + * Positive values move the body down, while negative values move it up. + * + * @method Phaser.Physics.Arcade.Components.Velocity#setVelocityY + * @since 3.0.0 + * + * @param {number} y - The new vertical velocity of the body. + * + * @return {this} This Game Object. + */ + setVelocityY: function (y) + { + this.body.setVelocityY(y); + + return this; + }, + + /** + * Sets the maximum velocity of the body. + * + * @method Phaser.Physics.Arcade.Components.Velocity#setMaxVelocity + * @since 3.0.0 + * + * @param {number} x - The new maximum horizontal velocity. + * @param {number} [y=x] - The new maximum vertical velocity. + * + * @return {this} This Game Object. + */ + setMaxVelocity: function (x, y) + { + this.body.maxVelocity.set(x, y); + + return this; + } + +}; + +module.exports = Velocity; + + +/***/ }), +/* 1221 */ +/***/ (function(module, exports) { + +/** + * This method will search the given rectangular area and return an array of all physics bodies that + * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. + * + * A body only has to intersect with the search area to be considered, it doesn't have to be fully + * contained within it. + * + * If Arcade Physics is set to use the RTree (which it is by default) then the search for is extremely fast, + * otherwise the search is O(N) for Dynamic Bodies. + * + * @function Phaser.Physics.Arcade.Components.OverlapRect + * @since 3.17.0 + * + * @param {number} x - The top-left x coordinate of the area to search within. + * @param {number} y - The top-left y coordinate of the area to search within. + * @param {number} width - The width of the area to search within. + * @param {number} height - The height of the area to search within. + * @param {boolean} [includeDynamic=true] - Should the search include Dynamic Bodies? + * @param {boolean} [includeStatic=false] - Should the search include Static Bodies? + * + * @return {(Phaser.Physics.Arcade.Body[]|Phaser.Physics.Arcade.StaticBody[])} An array of bodies that overlap with the given area. + */ +var OverlapRect = function (world, x, y, width, height, includeDynamic, includeStatic) +{ + if (includeDynamic === undefined) { includeDynamic = true; } + if (includeStatic === undefined) { includeStatic = false; } + + var dynamicBodies = []; + var staticBodies = []; + + var minMax = world.treeMinMax; + + minMax.minX = x; + minMax.minY = y; + minMax.maxX = x + width; + minMax.maxY = y + height; + + if (includeStatic) + { + staticBodies = world.staticTree.search(minMax); + } + + if (includeDynamic && world.useTree) + { + dynamicBodies = world.tree.search(minMax); + } + else if (includeDynamic) + { + var bodies = world.bodies; + + var fakeBody = + { + position: { + x: x, + y: y + }, + left: x, + top: y, + right: x + width, + bottom: y + height, + isCircle: false + }; + + var intersects = world.intersects; + + bodies.iterate(function (target) + { + if (intersects(target, fakeBody)) + { + dynamicBodies.push(target); + } + + }); + } + + return staticBodies.concat(dynamicBodies); +}; + +module.exports = OverlapRect; + + +/***/ }), +/* 1222 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Arcade Physics World Collide Event. + * + * This event is dispatched by an Arcade Physics World instance if two bodies collide _and_ at least + * one of them has their [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('collide', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + * + * @event Phaser.Physics.Arcade.Events#COLLIDE + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the collision. This is the parent of `body1`. + * @param {Phaser.GameObjects.GameObject} gameObject2 - The second Game Object involved in the collision. This is the parent of `body2`. + * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body1 - The first Physics Body involved in the collision. + * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body2 - The second Physics Body involved in the collision. + */ +module.exports = 'collide'; + + +/***/ }), +/* 1223 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Arcade Physics World Overlap Event. + * + * This event is dispatched by an Arcade Physics World instance if two bodies overlap _and_ at least + * one of them has their [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. + * + * It provides an alternative means to handling overlap events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('overlap', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + * + * @event Phaser.Physics.Arcade.Events#OVERLAP + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the overlap. This is the parent of `body1`. + * @param {Phaser.GameObjects.GameObject} gameObject2 - The second Game Object involved in the overlap. This is the parent of `body2`. + * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body1 - The first Physics Body involved in the overlap. + * @param {Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody} body2 - The second Physics Body involved in the overlap. + */ +module.exports = 'overlap'; + + +/***/ }), +/* 1224 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Arcade Physics World Pause Event. + * + * This event is dispatched by an Arcade Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`. + * + * @event Phaser.Physics.Arcade.Events#PAUSE + * @since 3.0.0 + */ +module.exports = 'pause'; + + +/***/ }), +/* 1225 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Arcade Physics World Resume Event. + * + * This event is dispatched by an Arcade Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`. + * + * @event Phaser.Physics.Arcade.Events#RESUME + * @since 3.0.0 + */ +module.exports = 'resume'; + + +/***/ }), +/* 1226 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Arcade Physics Tile Collide Event. + * + * This event is dispatched by an Arcade Physics World instance if a body collides with a Tile _and_ + * has its [onCollide]{@link Phaser.Physics.Arcade.Body#onCollide} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('tilecollide', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + * + * @event Phaser.Physics.Arcade.Events#TILE_COLLIDE + * @since 3.16.1 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the collision. This is the parent of `body`. + * @param {Phaser.Tilemaps.Tile} tile - The tile the body collided with. + * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body of the Game Object involved in the collision. + */ +module.exports = 'tilecollide'; + + +/***/ }), +/* 1227 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Arcade Physics Tile Overlap Event. + * + * This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile _and_ + * has its [onOverlap]{@link Phaser.Physics.Arcade.Body#onOverlap} property set to `true`. + * + * It provides an alternative means to handling overlap events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('tileoverlap', listener)`. + * + * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. + * + * @event Phaser.Physics.Arcade.Events#TILE_OVERLAP + * @since 3.16.1 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the overlap. This is the parent of `body`. + * @param {Phaser.Tilemaps.Tile} tile - The tile the body overlapped. + * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body of the Game Object involved in the overlap. + */ +module.exports = 'tileoverlap'; + + +/***/ }), +/* 1228 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Arcade Physics World Bounds Event. + * + * This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds _and_ + * it has its [onWorldBounds]{@link Phaser.Physics.Arcade.Body#onWorldBounds} property set to `true`. + * + * It provides an alternative means to handling collide events rather than using the callback approach. + * + * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`. + * + * @event Phaser.Physics.Arcade.Events#WORLD_BOUNDS + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body that hit the world bounds. + * @param {boolean} up - Is the Body blocked up? I.e. collided with the top of the world bounds. + * @param {boolean} down - Is the Body blocked down? I.e. collided with the bottom of the world bounds. + * @param {boolean} left - Is the Body blocked left? I.e. collided with the left of the world bounds. + * @param {boolean} right - Is the Body blocked right? I.e. collided with the right of the world bounds. + */ +module.exports = 'worldbounds'; + + +/***/ }), +/* 1229 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Arcade Physics World Step Event. + * + * This event is dispatched by an Arcade Physics World instance whenever a physics step is run. + * It is emitted _after_ the bodies and colliders have been updated. + * + * In high framerate settings this can be multiple times per game frame. + * + * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. + * + * @event Phaser.Physics.Arcade.Events#WORLD_STEP + * @since 3.18.0 + */ +module.exports = 'worldstep'; + + +/***/ }), +/* 1230 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A function to process the collision callbacks between a single tile and an Arcade Physics enabled Game Object. + * + * @function Phaser.Physics.Arcade.Tilemap.ProcessTileCallbacks + * @since 3.0.0 + * + * @param {Phaser.Tilemaps.Tile} tile - The Tile to process. + * @param {Phaser.GameObjects.Sprite} sprite - The Game Object to process with the Tile. + * + * @return {boolean} The result of the callback, `true` for further processing, or `false` to skip this pair. + */ +var ProcessTileCallbacks = function (tile, sprite) +{ + // Tile callbacks take priority over layer level callbacks + if (tile.collisionCallback) + { + return !tile.collisionCallback.call(tile.collisionCallbackContext, sprite, tile); + } + else if (tile.layer.callbacks[tile.index]) + { + return !tile.layer.callbacks[tile.index].callback.call( + tile.layer.callbacks[tile.index].callbackContext, sprite, tile + ); + } + + return true; +}; + +module.exports = ProcessTileCallbacks; + + +/***/ }), +/* 1231 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TileCheckX = __webpack_require__(1232); +var TileCheckY = __webpack_require__(1234); +var TileIntersectsBody = __webpack_require__(444); + +/** + * The core separation function to separate a physics body and a tile. + * + * @function Phaser.Physics.Arcade.Tilemap.SeparateTile + * @since 3.0.0 + * + * @param {number} i - The index of the tile within the map data. + * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. + * @param {Phaser.Tilemaps.Tile} tile - The tile to collide against. + * @param {Phaser.Geom.Rectangle} tileWorldRect - A rectangle-like object defining the dimensions of the tile. + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemapLayer to collide against. + * @param {number} tileBias - The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param {boolean} isLayer - Is this check coming from a TilemapLayer or an array of tiles? + * + * @return {boolean} `true` if the body was separated, otherwise `false`. + */ +var SeparateTile = function (i, body, tile, tileWorldRect, tilemapLayer, tileBias, isLayer) +{ + var tileLeft = tileWorldRect.left; + var tileTop = tileWorldRect.top; + var tileRight = tileWorldRect.right; + var tileBottom = tileWorldRect.bottom; + var faceHorizontal = tile.faceLeft || tile.faceRight; + var faceVertical = tile.faceTop || tile.faceBottom; + + if (!isLayer) + { + faceHorizontal = true; + faceVertical = true; + } + + // We don't need to go any further if this tile doesn't actually have any colliding faces. This + // could happen if the tile was meant to be collided with re: a callback, but otherwise isn't + // needed for separation. + if (!faceHorizontal && !faceVertical) + { + return false; + } + + var ox = 0; + var oy = 0; + var minX = 0; + var minY = 1; + + if (body.deltaAbsX() > body.deltaAbsY()) + { + // Moving faster horizontally, check X axis first + minX = -1; + } + else if (body.deltaAbsX() < body.deltaAbsY()) + { + // Moving faster vertically, check Y axis first + minY = -1; + } + + if (body.deltaX() !== 0 && body.deltaY() !== 0 && faceHorizontal && faceVertical) + { + // We only need do this if both axes have colliding faces AND we're moving in both + // directions + minX = Math.min(Math.abs(body.position.x - tileRight), Math.abs(body.right - tileLeft)); + minY = Math.min(Math.abs(body.position.y - tileBottom), Math.abs(body.bottom - tileTop)); + } + + if (minX < minY) + { + if (faceHorizontal) + { + ox = TileCheckX(body, tile, tileLeft, tileRight, tileBias, isLayer); + + // That's horizontal done, check if we still intersects? If not then we can return now + if (ox !== 0 && !TileIntersectsBody(tileWorldRect, body)) + { + return true; + } + } + + if (faceVertical) + { + oy = TileCheckY(body, tile, tileTop, tileBottom, tileBias, isLayer); + } + } + else + { + if (faceVertical) + { + oy = TileCheckY(body, tile, tileTop, tileBottom, tileBias, isLayer); + + // That's vertical done, check if we still intersects? If not then we can return now + if (oy !== 0 && !TileIntersectsBody(tileWorldRect, body)) + { + return true; + } + } + + if (faceHorizontal) + { + ox = TileCheckX(body, tile, tileLeft, tileRight, tileBias, isLayer); + } + } + + return (ox !== 0 || oy !== 0); +}; + +module.exports = SeparateTile; + + +/***/ }), +/* 1232 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ProcessTileSeparationX = __webpack_require__(1233); + +/** + * Check the body against the given tile on the X axis. + * Used internally by the SeparateTile function. + * + * @function Phaser.Physics.Arcade.Tilemap.TileCheckX + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. + * @param {Phaser.Tilemaps.Tile} tile - The tile to check. + * @param {number} tileLeft - The left position of the tile within the tile world. + * @param {number} tileRight - The right position of the tile within the tile world. + * @param {number} tileBias - The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param {boolean} isLayer - Is this check coming from a TilemapLayer or an array of tiles? + * + * @return {number} The amount of separation that occurred. + */ +var TileCheckX = function (body, tile, tileLeft, tileRight, tileBias, isLayer) +{ + var ox = 0; + + var faceLeft = tile.faceLeft; + var faceRight = tile.faceRight; + var collideLeft = tile.collideLeft; + var collideRight = tile.collideRight; + + if (!isLayer) + { + faceLeft = true; + faceRight = true; + collideLeft = true; + collideRight = true; + } + + if (body.deltaX() < 0 && !body.blocked.left && collideRight && body.checkCollision.left) + { + // Body is moving LEFT + if (faceRight && body.x < tileRight) + { + ox = body.x - tileRight; + + if (ox < -tileBias) + { + ox = 0; + } + } + } + else if (body.deltaX() > 0 && !body.blocked.right && collideLeft && body.checkCollision.right) + { + // Body is moving RIGHT + if (faceLeft && body.right > tileLeft) + { + ox = body.right - tileLeft; + + if (ox > tileBias) + { + ox = 0; + } + } + } + + if (ox !== 0) + { + if (body.customSeparateX) + { + body.overlapX = ox; + } + else + { + ProcessTileSeparationX(body, ox); + } + } + + return ox; +}; + +module.exports = TileCheckX; + + +/***/ }), +/* 1233 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Internal function to process the separation of a physics body from a tile. + * + * @function Phaser.Physics.Arcade.Tilemap.ProcessTileSeparationX + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. + * @param {number} x - The x separation amount. + */ +var ProcessTileSeparationX = function (body, x) +{ + if (x < 0) + { + body.blocked.none = false; + body.blocked.left = true; + } + else if (x > 0) + { + body.blocked.none = false; + body.blocked.right = true; + } + + body.position.x -= x; + + if (body.bounce.x === 0) + { + body.velocity.x = 0; + } + else + { + body.velocity.x = -body.velocity.x * body.bounce.x; + } +}; + +module.exports = ProcessTileSeparationX; + + +/***/ }), +/* 1234 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ProcessTileSeparationY = __webpack_require__(1235); + +/** + * Check the body against the given tile on the Y axis. + * Used internally by the SeparateTile function. + * + * @function Phaser.Physics.Arcade.Tilemap.TileCheckY + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. + * @param {Phaser.Tilemaps.Tile} tile - The tile to check. + * @param {number} tileTop - The top position of the tile within the tile world. + * @param {number} tileBottom - The bottom position of the tile within the tile world. + * @param {number} tileBias - The tile bias value. Populated by the `World.TILE_BIAS` constant. + * @param {boolean} isLayer - Is this check coming from a TilemapLayer or an array of tiles? + * + * @return {number} The amount of separation that occurred. + */ +var TileCheckY = function (body, tile, tileTop, tileBottom, tileBias, isLayer) +{ + var oy = 0; + + var faceTop = tile.faceTop; + var faceBottom = tile.faceBottom; + var collideUp = tile.collideUp; + var collideDown = tile.collideDown; + + if (!isLayer) + { + faceTop = true; + faceBottom = true; + collideUp = true; + collideDown = true; + } + + if (body.deltaY() < 0 && !body.blocked.up && collideDown && body.checkCollision.up) + { + // Body is moving UP + if (faceBottom && body.y < tileBottom) + { + oy = body.y - tileBottom; + + if (oy < -tileBias) + { + oy = 0; + } + } + } + else if (body.deltaY() > 0 && !body.blocked.down && collideUp && body.checkCollision.down) + { + // Body is moving DOWN + if (faceTop && body.bottom > tileTop) + { + oy = body.bottom - tileTop; + + if (oy > tileBias) + { + oy = 0; + } + } + } + + if (oy !== 0) + { + if (body.customSeparateY) + { + body.overlapY = oy; + } + else + { + ProcessTileSeparationY(body, oy); + } + } + + return oy; +}; + +module.exports = TileCheckY; + + +/***/ }), +/* 1235 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Internal function to process the separation of a physics body from a tile. + * + * @function Phaser.Physics.Arcade.Tilemap.ProcessTileSeparationY + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. + * @param {number} y - The y separation amount. + */ +var ProcessTileSeparationY = function (body, y) +{ + if (y < 0) + { + body.blocked.none = false; + body.blocked.up = true; + } + else if (y > 0) + { + body.blocked.none = false; + body.blocked.down = true; + } + + body.position.y -= y; + + if (body.bounce.y === 0) + { + body.velocity.y = 0; + } + else + { + body.velocity.y = -body.velocity.y * body.bounce.y; + } +}; + +module.exports = ProcessTileSeparationY; + + +/***/ }), +/* 1236 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetOverlapX = __webpack_require__(440); + +/** + * Separates two overlapping bodies on the X-axis (horizontally). + * + * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection. + * + * The bodies won't be separated if there is no horizontal overlap between them, if they are static, or if either one uses custom logic for its separation. + * + * @function Phaser.Physics.Arcade.SeparateX + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to separate. + * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to separate. + * @param {boolean} overlapOnly - If `true`, the bodies will only have their overlap data set and no separation will take place. + * @param {number} bias - A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. + * + * @return {boolean} `true` if the two bodies overlap horizontally, otherwise `false`. + */ +var SeparateX = function (body1, body2, overlapOnly, bias) +{ + var overlap = GetOverlapX(body1, body2, overlapOnly, bias); + + // Can't separate two immovable bodies, or a body with its own custom separation logic + if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateX || body2.customSeparateX) + { + // return true if there was some overlap, otherwise false + return (overlap !== 0) || (body1.embedded && body2.embedded); + } + + // Adjust their positions and velocities accordingly (if there was any overlap) + var v1 = body1.velocity.x; + var v2 = body2.velocity.x; + + if (!body1.immovable && !body2.immovable) + { + overlap *= 0.5; + + body1.x -= overlap; + body2.x += overlap; + + var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); + var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); + var avg = (nv1 + nv2) * 0.5; + + nv1 -= avg; + nv2 -= avg; + + body1.velocity.x = avg + nv1 * body1.bounce.x; + body2.velocity.x = avg + nv2 * body2.bounce.x; + } + else if (!body1.immovable) + { + body1.x -= overlap; + body1.velocity.x = v2 - v1 * body1.bounce.x; + + // This is special case code that handles things like vertically moving platforms you can ride + if (body2.moves) + { + body1.y += (body2.y - body2.prev.y) * body2.friction.y; + } + } + else + { + body2.x += overlap; + body2.velocity.x = v1 - v2 * body2.bounce.x; + + // This is special case code that handles things like vertically moving platforms you can ride + if (body1.moves) + { + body2.y += (body1.y - body1.prev.y) * body1.friction.y; + } + } + + // If we got this far then there WAS overlap, and separation is complete, so return true + return true; +}; + +module.exports = SeparateX; + + +/***/ }), +/* 1237 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetOverlapY = __webpack_require__(441); + +/** + * Separates two overlapping bodies on the Y-axis (vertically). + * + * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection. + * + * The bodies won't be separated if there is no vertical overlap between them, if they are static, or if either one uses custom logic for its separation. + * + * @function Phaser.Physics.Arcade.SeparateY + * @since 3.0.0 + * + * @param {Phaser.Physics.Arcade.Body} body1 - The first Body to separate. + * @param {Phaser.Physics.Arcade.Body} body2 - The second Body to separate. + * @param {boolean} overlapOnly - If `true`, the bodies will only have their overlap data set and no separation will take place. + * @param {number} bias - A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. + * + * @return {boolean} `true` if the two bodies overlap vertically, otherwise `false`. + */ +var SeparateY = function (body1, body2, overlapOnly, bias) +{ + var overlap = GetOverlapY(body1, body2, overlapOnly, bias); + + // Can't separate two immovable bodies, or a body with its own custom separation logic + if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateY || body2.customSeparateY) + { + // return true if there was some overlap, otherwise false + return (overlap !== 0) || (body1.embedded && body2.embedded); + } + + // Adjust their positions and velocities accordingly (if there was any overlap) + var v1 = body1.velocity.y; + var v2 = body2.velocity.y; + + if (!body1.immovable && !body2.immovable) + { + overlap *= 0.5; + + body1.y -= overlap; + body2.y += overlap; + + var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); + var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); + var avg = (nv1 + nv2) * 0.5; + + nv1 -= avg; + nv2 -= avg; + + body1.velocity.y = avg + nv1 * body1.bounce.y; + body2.velocity.y = avg + nv2 * body2.bounce.y; + } + else if (!body1.immovable) + { + body1.y -= overlap; + body1.velocity.y = v2 - v1 * body1.bounce.y; + + // This is special case code that handles things like horizontal moving platforms you can ride + if (body2.moves) + { + body1.x += (body2.x - body2.prev.x) * body2.friction.x; + } + } + else + { + body2.y += overlap; + body2.velocity.y = v1 - v2 * body2.bounce.y; + + // This is special case code that handles things like horizontal moving platforms you can ride + if (body1.moves) + { + body2.x += (body1.x - body1.prev.x) * body1.friction.x; + } + } + + // If we got this far then there WAS overlap, and separation is complete, so return true + return true; +}; + +module.exports = SeparateY; + + +/***/ }), +/* 1238 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Physics.Impact.Events + */ + +module.exports = { + + COLLIDE: __webpack_require__(1343), + PAUSE: __webpack_require__(1344), + RESUME: __webpack_require__(1345) + +}; + + +/***/ }), +/* 1239 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Physics.Impact.Components + */ + +module.exports = { + + Acceleration: __webpack_require__(1347), + BodyScale: __webpack_require__(1348), + BodyType: __webpack_require__(1349), + Bounce: __webpack_require__(1350), + CheckAgainst: __webpack_require__(1351), + Collides: __webpack_require__(1352), + Debug: __webpack_require__(1353), + Friction: __webpack_require__(1354), + Gravity: __webpack_require__(1355), + Offset: __webpack_require__(1356), + SetGameObject: __webpack_require__(1357), + Velocity: __webpack_require__(1358) + +}; + + +/***/ }), +/* 1240 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Axes` module contains methods for creating and manipulating sets of axes. +* +* @class Axes +*/ + +var Axes = {}; + +module.exports = Axes; + +var Vector = __webpack_require__(99); +var Common = __webpack_require__(37); + +(function() { + + /** + * Creates a new set of axes from the given vertices. + * @method fromVertices + * @param {vertices} vertices + * @return {axes} A new axes from the given vertices + */ + Axes.fromVertices = function(vertices) { + var axes = {}; + + // find the unique axes, using edge normal gradients + for (var i = 0; i < vertices.length; i++) { + var j = (i + 1) % vertices.length, + normal = Vector.normalise({ + x: vertices[j].y - vertices[i].y, + y: vertices[i].x - vertices[j].x + }), + gradient = (normal.y === 0) ? Infinity : (normal.x / normal.y); + + // limit precision + gradient = gradient.toFixed(3).toString(); + axes[gradient] = normal; + } + + return Common.values(axes); + }; + + /** + * Rotates a set of axes by the given angle. + * @method rotate + * @param {axes} axes + * @param {number} angle + */ + Axes.rotate = function(axes, angle) { + if (angle === 0) + return; + + var cos = Math.cos(angle), + sin = Math.sin(angle); + + for (var i = 0; i < axes.length; i++) { + var axis = axes[i], + xx; + xx = axis.x * cos - axis.y * sin; + axis.y = axis.x * sin + axis.y * cos; + axis.x = xx; + } + }; + +})(); + + +/***/ }), +/* 1241 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Physics.Matter.Events + */ + +module.exports = { + + AFTER_UPDATE: __webpack_require__(1376), + BEFORE_UPDATE: __webpack_require__(1377), + COLLISION_ACTIVE: __webpack_require__(1378), + COLLISION_END: __webpack_require__(1379), + COLLISION_START: __webpack_require__(1380), + DRAG_END: __webpack_require__(1381), + DRAG: __webpack_require__(1382), + DRAG_START: __webpack_require__(1383), + PAUSE: __webpack_require__(1384), + RESUME: __webpack_require__(1385), + SLEEP_END: __webpack_require__(1386), + SLEEP_START: __webpack_require__(1387) + +}; + + +/***/ }), +/* 1242 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bodies = __webpack_require__(135); +var Body = __webpack_require__(60); +var Class = __webpack_require__(0); +var Components = __webpack_require__(488); +var GetFastValue = __webpack_require__(2); +var HasValue = __webpack_require__(97); +var Vertices = __webpack_require__(84); + +/** + * @classdesc + * A wrapper around a Tile that provides access to a corresponding Matter body. A tile can only + * have one Matter body associated with it. You can either pass in an existing Matter body for + * the tile or allow the constructor to create the corresponding body for you. If the Tile has a + * collision group (defined in Tiled), those shapes will be used to create the body. If not, the + * tile's rectangle bounding box will be used. + * + * The corresponding body will be accessible on the Tile itself via Tile.physics.matterBody. + * + * Note: not all Tiled collision shapes are supported. See + * Phaser.Physics.Matter.TileBody#setFromTileCollision for more information. + * + * @class TileBody + * @memberof Phaser.Physics.Matter + * @constructor + * @since 3.0.0 + * + * @extends Phaser.Physics.Matter.Components.Bounce + * @extends Phaser.Physics.Matter.Components.Collision + * @extends Phaser.Physics.Matter.Components.Friction + * @extends Phaser.Physics.Matter.Components.Gravity + * @extends Phaser.Physics.Matter.Components.Mass + * @extends Phaser.Physics.Matter.Components.Sensor + * @extends Phaser.Physics.Matter.Components.Sleep + * @extends Phaser.Physics.Matter.Components.Static + * + * @param {Phaser.Physics.Matter.World} world - [description] + * @param {Phaser.Tilemaps.Tile} tile - The target tile that should have a Matter body. + * @param {Phaser.Types.Physics.Matter.MatterTileOptions} [options] - Options to be used when creating the Matter body. + */ +var MatterTileBody = new Class({ + + Mixins: [ + Components.Bounce, + Components.Collision, + Components.Friction, + Components.Gravity, + Components.Mass, + Components.Sensor, + Components.Sleep, + Components.Static + ], + + initialize: + + function MatterTileBody (world, tile, options) + { + /** + * The tile object the body is associated with. + * + * @name Phaser.Physics.Matter.TileBody#tile + * @type {Phaser.Tilemaps.Tile} + * @since 3.0.0 + */ + this.tile = tile; + + /** + * The Matter world the body exists within. + * + * @name Phaser.Physics.Matter.TileBody#world + * @type {Phaser.Physics.Matter.World} + * @since 3.0.0 + */ + this.world = world; + + // Install a reference to 'this' on the tile and ensure there can only be one matter body + // associated with the tile + if (tile.physics.matterBody) + { + tile.physics.matterBody.destroy(); + } + + tile.physics.matterBody = this; + + // Set the body either from an existing body (if provided), the shapes in the tileset + // collision layer (if it exists) or a rectangle matching the tile. + var body = GetFastValue(options, 'body', null); + + var addToWorld = GetFastValue(options, 'addToWorld', true); + + if (!body) + { + var collisionGroup = tile.getCollisionGroup(); + var collisionObjects = GetFastValue(collisionGroup, 'objects', []); + + if (collisionObjects.length > 0) + { + this.setFromTileCollision(options); + } + else + { + this.setFromTileRectangle(options); + } + } + else + { + this.setBody(body, addToWorld); + } + }, + + /** + * Sets the current body to a rectangle that matches the bounds of the tile. + * + * @method Phaser.Physics.Matter.TileBody#setFromTileRectangle + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Matter.MatterBodyTileOptions} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. + * + * @return {Phaser.Physics.Matter.TileBody} This TileBody object. + */ + setFromTileRectangle: function (options) + { + if (options === undefined) { options = {}; } + if (!HasValue(options, 'isStatic')) { options.isStatic = true; } + if (!HasValue(options, 'addToWorld')) { options.addToWorld = true; } + + var bounds = this.tile.getBounds(); + var cx = bounds.x + (bounds.width / 2); + var cy = bounds.y + (bounds.height / 2); + var body = Bodies.rectangle(cx, cy, bounds.width, bounds.height, options); + + this.setBody(body, options.addToWorld); + + return this; + }, + + /** + * Sets the current body from the collision group associated with the Tile. This is typically + * set up in Tiled's collision editor. + * + * Note: Matter doesn't support all shapes from Tiled. Rectangles and polygons are directly + * supported. Ellipses are converted into circle bodies. Polylines are treated as if they are + * closed polygons. If a tile has multiple shapes, a multi-part body will be created. Concave + * shapes are supported if poly-decomp library is included. Decomposition is not guaranteed to + * work for complex shapes (e.g. holes), so it's often best to manually decompose a concave + * polygon into multiple convex polygons yourself. + * + * @method Phaser.Physics.Matter.TileBody#setFromTileCollision + * @since 3.0.0 + * + * @param {Phaser.Types.Physics.Matter.MatterBodyTileOptions} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts. + * + * @return {Phaser.Physics.Matter.TileBody} This TileBody object. + */ + setFromTileCollision: function (options) + { + if (options === undefined) { options = {}; } + if (!HasValue(options, 'isStatic')) { options.isStatic = true; } + if (!HasValue(options, 'addToWorld')) { options.addToWorld = true; } + + var sx = this.tile.tilemapLayer.scaleX; + var sy = this.tile.tilemapLayer.scaleY; + var tileX = this.tile.getLeft(); + var tileY = this.tile.getTop(); + var collisionGroup = this.tile.getCollisionGroup(); + var collisionObjects = GetFastValue(collisionGroup, 'objects', []); + + var parts = []; + + for (var i = 0; i < collisionObjects.length; i++) + { + var object = collisionObjects[i]; + var ox = tileX + (object.x * sx); + var oy = tileY + (object.y * sy); + var ow = object.width * sx; + var oh = object.height * sy; + var body = null; + + if (object.rectangle) + { + body = Bodies.rectangle(ox + ow / 2, oy + oh / 2, ow, oh, options); + } + else if (object.ellipse) + { + body = Bodies.circle(ox + ow / 2, oy + oh / 2, ow / 2, options); + } + else if (object.polygon || object.polyline) + { + // Polygons and polylines are both treated as closed polygons + var originalPoints = object.polygon ? object.polygon : object.polyline; + + var points = originalPoints.map(function (p) + { + return { x: p.x * sx, y: p.y * sy }; + }); + + var vertices = Vertices.create(points); + + // Points are relative to the object's origin (first point placed in Tiled), but + // matter expects points to be relative to the center of mass. This only applies to + // convex shapes. When a concave shape is decomposed, multiple parts are created and + // the individual parts are positioned relative to (ox, oy). + // + // Update: 8th January 2019 - the latest version of Matter needs the Vertices adjusted, + // regardless if convex or concave. + + var center = Vertices.centre(vertices); + + ox += center.x; + oy += center.y; + + body = Bodies.fromVertices(ox, oy, vertices, options); + } + + if (body) + { + parts.push(body); + } + } + + if (parts.length === 1) + { + this.setBody(parts[0], options.addToWorld); + } + else if (parts.length > 1) + { + options.parts = parts; + this.setBody(Body.create(options), options.addToWorld); + } + + return this; + }, + + /** + * Sets the current body to the given body. This will remove the previous body, if one already + * exists. + * + * @method Phaser.Physics.Matter.TileBody#setBody + * @since 3.0.0 + * + * @param {MatterJS.Body} body - The new Matter body to use. + * @param {boolean} [addToWorld=true] - Whether or not to add the body to the Matter world. + * + * @return {Phaser.Physics.Matter.TileBody} This TileBody object. + */ + setBody: function (body, addToWorld) + { + if (addToWorld === undefined) { addToWorld = true; } + + if (this.body) + { + this.removeBody(); + } + + this.body = body; + this.body.gameObject = this; + + if (addToWorld) + { + this.world.add(this.body); + } + + return this; + }, + + /** + * Removes the current body from the TileBody and from the Matter world + * + * @method Phaser.Physics.Matter.TileBody#removeBody + * @since 3.0.0 + * + * @return {Phaser.Physics.Matter.TileBody} This TileBody object. + */ + removeBody: function () + { + if (this.body) + { + this.world.remove(this.body); + this.body.gameObject = undefined; + this.body = undefined; + } + + return this; + }, + + /** + * Removes the current body from the tile and the world. + * + * @method Phaser.Physics.Matter.TileBody#destroy + * @since 3.0.0 + * + * @return {Phaser.Physics.Matter.TileBody} This TileBody object. + */ + destroy: function () + { + this.removeBody(); + this.tile.physics.matterBody = undefined; + } + +}); + +module.exports = MatterTileBody; + + +/***/ }), +/* 1243 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Detector` module contains methods for detecting collisions given a set of pairs. +* +* @class Detector +*/ + +// TODO: speculative contacts + +var Detector = {}; + +module.exports = Detector; + +var SAT = __webpack_require__(1244); +var Pair = __webpack_require__(489); +var Bounds = __webpack_require__(100); + +(function() { + + /** + * Finds all collisions given a list of pairs. + * @method collisions + * @param {pair[]} broadphasePairs + * @param {engine} engine + * @return {array} collisions + */ + Detector.collisions = function(broadphasePairs, engine) { + var collisions = [], + pairsTable = engine.pairs.table; + + // @if DEBUG + var metrics = engine.metrics; + // @endif + + for (var i = 0; i < broadphasePairs.length; i++) { + var bodyA = broadphasePairs[i][0], + bodyB = broadphasePairs[i][1]; + + if ((bodyA.isStatic || bodyA.isSleeping) && (bodyB.isStatic || bodyB.isSleeping)) + continue; + + if (!Detector.canCollide(bodyA.collisionFilter, bodyB.collisionFilter)) + continue; + + // @if DEBUG + metrics.midphaseTests += 1; + // @endif + + // mid phase + if (Bounds.overlaps(bodyA.bounds, bodyB.bounds)) { + for (var j = bodyA.parts.length > 1 ? 1 : 0; j < bodyA.parts.length; j++) { + var partA = bodyA.parts[j]; + + for (var k = bodyB.parts.length > 1 ? 1 : 0; k < bodyB.parts.length; k++) { + var partB = bodyB.parts[k]; + + if ((partA === bodyA && partB === bodyB) || Bounds.overlaps(partA.bounds, partB.bounds)) { + // find a previous collision we could reuse + var pairId = Pair.id(partA, partB), + pair = pairsTable[pairId], + previousCollision; + + if (pair && pair.isActive) { + previousCollision = pair.collision; + } else { + previousCollision = null; + } + + // narrow phase + var collision = SAT.collides(partA, partB, previousCollision); + + // @if DEBUG + metrics.narrowphaseTests += 1; + if (collision.reused) + metrics.narrowReuseCount += 1; + // @endif + + if (collision.collided) { + collisions.push(collision); + // @if DEBUG + metrics.narrowDetections += 1; + // @endif + } + } + } + } + } + } + + return collisions; + }; + + /** + * Returns `true` if both supplied collision filters will allow a collision to occur. + * See `body.collisionFilter` for more information. + * @method canCollide + * @param {} filterA + * @param {} filterB + * @return {bool} `true` if collision can occur + */ + Detector.canCollide = function(filterA, filterB) { + if (filterA.group === filterB.group && filterA.group !== 0) + return filterA.group > 0; + + return (filterA.mask & filterB.category) !== 0 && (filterB.mask & filterA.category) !== 0; + }; + +})(); + + +/***/ }), +/* 1244 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.SAT` module contains methods for detecting collisions using the Separating Axis Theorem. +* +* @class SAT +*/ + +// TODO: true circles and curves + +var SAT = {}; + +module.exports = SAT; + +var Vertices = __webpack_require__(84); +var Vector = __webpack_require__(99); + +(function() { + + /** + * Detect collision between two bodies using the Separating Axis Theorem. + * @method collides + * @param {body} bodyA + * @param {body} bodyB + * @param {collision} previousCollision + * @return {collision} collision + */ + SAT.collides = function(bodyA, bodyB, previousCollision) { + var overlapAB, + overlapBA, + minOverlap, + collision, + canReusePrevCol = false; + + if (previousCollision) { + // estimate total motion + var parentA = bodyA.parent, + parentB = bodyB.parent, + motion = parentA.speed * parentA.speed + parentA.angularSpeed * parentA.angularSpeed + + parentB.speed * parentB.speed + parentB.angularSpeed * parentB.angularSpeed; + + // we may be able to (partially) reuse collision result + // but only safe if collision was resting + canReusePrevCol = previousCollision && previousCollision.collided && motion < 0.2; + + // reuse collision object + collision = previousCollision; + } else { + collision = { collided: false, bodyA: bodyA, bodyB: bodyB }; + } + + if (previousCollision && canReusePrevCol) { + // if we can reuse the collision result + // we only need to test the previously found axis + var axisBodyA = collision.axisBody, + axisBodyB = axisBodyA === bodyA ? bodyB : bodyA, + axes = [axisBodyA.axes[previousCollision.axisNumber]]; + + minOverlap = SAT._overlapAxes(axisBodyA.vertices, axisBodyB.vertices, axes); + collision.reused = true; + + if (minOverlap.overlap <= 0) { + collision.collided = false; + return collision; + } + } else { + // if we can't reuse a result, perform a full SAT test + + overlapAB = SAT._overlapAxes(bodyA.vertices, bodyB.vertices, bodyA.axes); + + if (overlapAB.overlap <= 0) { + collision.collided = false; + return collision; + } + + overlapBA = SAT._overlapAxes(bodyB.vertices, bodyA.vertices, bodyB.axes); + + if (overlapBA.overlap <= 0) { + collision.collided = false; + return collision; + } + + if (overlapAB.overlap < overlapBA.overlap) { + minOverlap = overlapAB; + collision.axisBody = bodyA; + } else { + minOverlap = overlapBA; + collision.axisBody = bodyB; + } + + // important for reuse later + collision.axisNumber = minOverlap.axisNumber; + } + + collision.bodyA = bodyA.id < bodyB.id ? bodyA : bodyB; + collision.bodyB = bodyA.id < bodyB.id ? bodyB : bodyA; + collision.collided = true; + collision.depth = minOverlap.overlap; + collision.parentA = collision.bodyA.parent; + collision.parentB = collision.bodyB.parent; + + bodyA = collision.bodyA; + bodyB = collision.bodyB; + + // ensure normal is facing away from bodyA + if (Vector.dot(minOverlap.axis, Vector.sub(bodyB.position, bodyA.position)) < 0) { + collision.normal = { + x: minOverlap.axis.x, + y: minOverlap.axis.y + }; + } else { + collision.normal = { + x: -minOverlap.axis.x, + y: -minOverlap.axis.y + }; + } + + collision.tangent = Vector.perp(collision.normal); + + collision.penetration = collision.penetration || {}; + collision.penetration.x = collision.normal.x * collision.depth; + collision.penetration.y = collision.normal.y * collision.depth; + + // find support points, there is always either exactly one or two + var verticesB = SAT._findSupports(bodyA, bodyB, collision.normal), + supports = []; + + // find the supports from bodyB that are inside bodyA + if (Vertices.contains(bodyA.vertices, verticesB[0])) + supports.push(verticesB[0]); + + if (Vertices.contains(bodyA.vertices, verticesB[1])) + supports.push(verticesB[1]); + + // find the supports from bodyA that are inside bodyB + if (supports.length < 2) { + var verticesA = SAT._findSupports(bodyB, bodyA, Vector.neg(collision.normal)); + + if (Vertices.contains(bodyB.vertices, verticesA[0])) + supports.push(verticesA[0]); + + if (supports.length < 2 && Vertices.contains(bodyB.vertices, verticesA[1])) + supports.push(verticesA[1]); + } + + // account for the edge case of overlapping but no vertex containment + if (supports.length < 1) + supports = [verticesB[0]]; + + collision.supports = supports; + + return collision; + }; + + /** + * Find the overlap between two sets of vertices. + * @method _overlapAxes + * @private + * @param {} verticesA + * @param {} verticesB + * @param {} axes + * @return result + */ + SAT._overlapAxes = function(verticesA, verticesB, axes) { + var projectionA = Vector._temp[0], + projectionB = Vector._temp[1], + result = { overlap: Number.MAX_VALUE }, + overlap, + axis; + + for (var i = 0; i < axes.length; i++) { + axis = axes[i]; + + SAT._projectToAxis(projectionA, verticesA, axis); + SAT._projectToAxis(projectionB, verticesB, axis); + + overlap = Math.min(projectionA.max - projectionB.min, projectionB.max - projectionA.min); + + if (overlap <= 0) { + result.overlap = overlap; + return result; + } + + if (overlap < result.overlap) { + result.overlap = overlap; + result.axis = axis; + result.axisNumber = i; + } + } + + return result; + }; + + /** + * Projects vertices on an axis and returns an interval. + * @method _projectToAxis + * @private + * @param {} projection + * @param {} vertices + * @param {} axis + */ + SAT._projectToAxis = function(projection, vertices, axis) { + var min = Vector.dot(vertices[0], axis), + max = min; + + for (var i = 1; i < vertices.length; i += 1) { + var dot = Vector.dot(vertices[i], axis); + + if (dot > max) { + max = dot; + } else if (dot < min) { + min = dot; + } + } + + projection.min = min; + projection.max = max; + }; + + /** + * Finds supporting vertices given two bodies along a given direction using hill-climbing. + * @method _findSupports + * @private + * @param {} bodyA + * @param {} bodyB + * @param {} normal + * @return [vector] + */ + SAT._findSupports = function(bodyA, bodyB, normal) { + var nearestDistance = Number.MAX_VALUE, + vertexToBody = Vector._temp[0], + vertices = bodyB.vertices, + bodyAPosition = bodyA.position, + distance, + vertex, + vertexA, + vertexB; + + // find closest vertex on bodyB + for (var i = 0; i < vertices.length; i++) { + vertex = vertices[i]; + vertexToBody.x = vertex.x - bodyAPosition.x; + vertexToBody.y = vertex.y - bodyAPosition.y; + distance = -Vector.dot(normal, vertexToBody); + + if (distance < nearestDistance) { + nearestDistance = distance; + vertexA = vertex; + } + } + + // find next closest vertex using the two connected to it + var prevIndex = vertexA.index - 1 >= 0 ? vertexA.index - 1 : vertices.length - 1; + vertex = vertices[prevIndex]; + vertexToBody.x = vertex.x - bodyAPosition.x; + vertexToBody.y = vertex.y - bodyAPosition.y; + nearestDistance = -Vector.dot(normal, vertexToBody); + vertexB = vertex; + + var nextIndex = (vertexA.index + 1) % vertices.length; + vertex = vertices[nextIndex]; + vertexToBody.x = vertex.x - bodyAPosition.x; + vertexToBody.y = vertex.y - bodyAPosition.y; + distance = -Vector.dot(normal, vertexToBody); + if (distance < nearestDistance) { + vertexB = vertex; + } + + return [vertexA, vertexB]; + }; + +})(); + + +/***/ }), +/* 1245 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Matter = __webpack_require__(1332); + +Matter.Body = __webpack_require__(60); +Matter.Composite = __webpack_require__(209); +Matter.World = __webpack_require__(1247); + +Matter.Detector = __webpack_require__(1243); +Matter.Grid = __webpack_require__(1333); +Matter.Pairs = __webpack_require__(1334); +Matter.Pair = __webpack_require__(489); +Matter.Query = __webpack_require__(1391); +Matter.Resolver = __webpack_require__(1335); +Matter.SAT = __webpack_require__(1244); + +Matter.Constraint = __webpack_require__(228); + +Matter.Common = __webpack_require__(37); +Matter.Engine = __webpack_require__(1336); +Matter.Events = __webpack_require__(227); +Matter.Sleeping = __webpack_require__(448); +Matter.Plugin = __webpack_require__(1246); + +Matter.Bodies = __webpack_require__(135); +Matter.Composites = __webpack_require__(1329); + +Matter.Axes = __webpack_require__(1240); +Matter.Bounds = __webpack_require__(100); +Matter.Svg = __webpack_require__(1393); +Matter.Vector = __webpack_require__(99); +Matter.Vertices = __webpack_require__(84); + +// aliases + +Matter.World.add = Matter.Composite.add; +Matter.World.remove = Matter.Composite.remove; +Matter.World.addComposite = Matter.Composite.addComposite; +Matter.World.addBody = Matter.Composite.addBody; +Matter.World.addConstraint = Matter.Composite.addConstraint; +Matter.World.clear = Matter.Composite.clear; + +module.exports = Matter; + + +/***/ }), +/* 1246 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Plugin` module contains functions for registering and installing plugins on modules. +* +* @class Plugin +*/ + +var Plugin = {}; + +module.exports = Plugin; + +var Common = __webpack_require__(37); + +(function() { + + Plugin._registry = {}; + + /** + * Registers a plugin object so it can be resolved later by name. + * @method register + * @param plugin {} The plugin to register. + * @return {object} The plugin. + */ + Plugin.register = function(plugin) { + if (!Plugin.isPlugin(plugin)) { + Common.warn('Plugin.register:', Plugin.toString(plugin), 'does not implement all required fields.'); + } + + if (plugin.name in Plugin._registry) { + var registered = Plugin._registry[plugin.name], + pluginVersion = Plugin.versionParse(plugin.version).number, + registeredVersion = Plugin.versionParse(registered.version).number; + + if (pluginVersion > registeredVersion) { + Common.warn('Plugin.register:', Plugin.toString(registered), 'was upgraded to', Plugin.toString(plugin)); + Plugin._registry[plugin.name] = plugin; + } else if (pluginVersion < registeredVersion) { + Common.warn('Plugin.register:', Plugin.toString(registered), 'can not be downgraded to', Plugin.toString(plugin)); + } else if (plugin !== registered) { + Common.warn('Plugin.register:', Plugin.toString(plugin), 'is already registered to different plugin object'); + } + } else { + Plugin._registry[plugin.name] = plugin; + } + + return plugin; + }; + + /** + * Resolves a dependency to a plugin object from the registry if it exists. + * The `dependency` may contain a version, but only the name matters when resolving. + * @method resolve + * @param dependency {string} The dependency. + * @return {object} The plugin if resolved, otherwise `undefined`. + */ + Plugin.resolve = function(dependency) { + return Plugin._registry[Plugin.dependencyParse(dependency).name]; + }; + + /** + * Returns a pretty printed plugin name and version. + * @method toString + * @param plugin {} The plugin. + * @return {string} Pretty printed plugin name and version. + */ + Plugin.toString = function(plugin) { + return typeof plugin === 'string' ? plugin : (plugin.name || 'anonymous') + '@' + (plugin.version || plugin.range || '0.0.0'); + }; + + /** + * Returns `true` if the object meets the minimum standard to be considered a plugin. + * This means it must define the following properties: + * - `name` + * - `version` + * - `install` + * @method isPlugin + * @param obj {} The obj to test. + * @return {boolean} `true` if the object can be considered a plugin otherwise `false`. + */ + Plugin.isPlugin = function(obj) { + return obj && obj.name && obj.version && obj.install; + }; + + /** + * Returns `true` if a plugin with the given `name` been installed on `module`. + * @method isUsed + * @param module {} The module. + * @param name {string} The plugin name. + * @return {boolean} `true` if a plugin with the given `name` been installed on `module`, otherwise `false`. + */ + Plugin.isUsed = function(module, name) { + return module.used.indexOf(name) > -1; + }; + + /** + * Returns `true` if `plugin.for` is applicable to `module` by comparing against `module.name` and `module.version`. + * If `plugin.for` is not specified then it is assumed to be applicable. + * The value of `plugin.for` is a string of the format `'module-name'` or `'module-name@version'`. + * @method isFor + * @param plugin {} The plugin. + * @param module {} The module. + * @return {boolean} `true` if `plugin.for` is applicable to `module`, otherwise `false`. + */ + Plugin.isFor = function(plugin, module) { + var parsed = plugin.for && Plugin.dependencyParse(plugin.for); + return !plugin.for || (module.name === parsed.name && Plugin.versionSatisfies(module.version, parsed.range)); + }; + + /** + * Installs the plugins by calling `plugin.install` on each plugin specified in `plugins` if passed, otherwise `module.uses`. + * For installing plugins on `Matter` see the convenience function `Matter.use`. + * Plugins may be specified either by their name or a reference to the plugin object. + * Plugins themselves may specify further dependencies, but each plugin is installed only once. + * Order is important, a topological sort is performed to find the best resulting order of installation. + * This sorting attempts to satisfy every dependency's requested ordering, but may not be exact in all cases. + * This function logs the resulting status of each dependency in the console, along with any warnings. + * - A green tick ✅ indicates a dependency was resolved and installed. + * - An orange diamond 🔶 indicates a dependency was resolved but a warning was thrown for it or one if its dependencies. + * - A red cross ❌ indicates a dependency could not be resolved. + * Avoid calling this function multiple times on the same module unless you intend to manually control installation order. + * @method use + * @param module {} The module install plugins on. + * @param [plugins=module.uses] {} The plugins to install on module (optional, defaults to `module.uses`). + */ + Plugin.use = function(module, plugins) { + module.uses = (module.uses || []).concat(plugins || []); + + if (module.uses.length === 0) { + Common.warn('Plugin.use:', Plugin.toString(module), 'does not specify any dependencies to install.'); + return; + } + + var dependencies = Plugin.dependencies(module), + sortedDependencies = Common.topologicalSort(dependencies), + status = []; + + for (var i = 0; i < sortedDependencies.length; i += 1) { + if (sortedDependencies[i] === module.name) { + continue; + } + + var plugin = Plugin.resolve(sortedDependencies[i]); + + if (!plugin) { + status.push('❌ ' + sortedDependencies[i]); + continue; + } + + if (Plugin.isUsed(module, plugin.name)) { + continue; + } + + if (!Plugin.isFor(plugin, module)) { + Common.warn('Plugin.use:', Plugin.toString(plugin), 'is for', plugin.for, 'but installed on', Plugin.toString(module) + '.'); + plugin._warned = true; + } + + if (plugin.install) { + plugin.install(module); + } else { + Common.warn('Plugin.use:', Plugin.toString(plugin), 'does not specify an install function.'); + plugin._warned = true; + } + + if (plugin._warned) { + status.push('🔶 ' + Plugin.toString(plugin)); + delete plugin._warned; + } else { + status.push('✅ ' + Plugin.toString(plugin)); + } + + module.used.push(plugin.name); + } + + if (status.length > 0 && !plugin.silent) { + Common.info(status.join(' ')); + } + }; + + /** + * Recursively finds all of a module's dependencies and returns a flat dependency graph. + * @method dependencies + * @param module {} The module. + * @return {object} A dependency graph. + */ + Plugin.dependencies = function(module, tracked) { + var parsedBase = Plugin.dependencyParse(module), + name = parsedBase.name; + + tracked = tracked || {}; + + if (name in tracked) { + return; + } + + module = Plugin.resolve(module) || module; + + tracked[name] = Common.map(module.uses || [], function(dependency) { + if (Plugin.isPlugin(dependency)) { + Plugin.register(dependency); + } + + var parsed = Plugin.dependencyParse(dependency), + resolved = Plugin.resolve(dependency); + + if (resolved && !Plugin.versionSatisfies(resolved.version, parsed.range)) { + Common.warn( + 'Plugin.dependencies:', Plugin.toString(resolved), 'does not satisfy', + Plugin.toString(parsed), 'used by', Plugin.toString(parsedBase) + '.' + ); + + resolved._warned = true; + module._warned = true; + } else if (!resolved) { + Common.warn( + 'Plugin.dependencies:', Plugin.toString(dependency), 'used by', + Plugin.toString(parsedBase), 'could not be resolved.' + ); + + module._warned = true; + } + + return parsed.name; + }); + + for (var i = 0; i < tracked[name].length; i += 1) { + Plugin.dependencies(tracked[name][i], tracked); + } + + return tracked; + }; + + /** + * Parses a dependency string into its components. + * The `dependency` is a string of the format `'module-name'` or `'module-name@version'`. + * See documentation for `Plugin.versionParse` for a description of the format. + * This function can also handle dependencies that are already resolved (e.g. a module object). + * @method dependencyParse + * @param dependency {string} The dependency of the format `'module-name'` or `'module-name@version'`. + * @return {object} The dependency parsed into its components. + */ + Plugin.dependencyParse = function(dependency) { + if (Common.isString(dependency)) { + var pattern = /^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/; + + if (!pattern.test(dependency)) { + Common.warn('Plugin.dependencyParse:', dependency, 'is not a valid dependency string.'); + } + + return { + name: dependency.split('@')[0], + range: dependency.split('@')[1] || '*' + }; + } + + return { + name: dependency.name, + range: dependency.range || dependency.version + }; + }; + + /** + * Parses a version string into its components. + * Versions are strictly of the format `x.y.z` (as in [semver](http://semver.org/)). + * Versions may optionally have a prerelease tag in the format `x.y.z-alpha`. + * Ranges are a strict subset of [npm ranges](https://docs.npmjs.com/misc/semver#advanced-range-syntax). + * Only the following range types are supported: + * - Tilde ranges e.g. `~1.2.3` + * - Caret ranges e.g. `^1.2.3` + * - Exact version e.g. `1.2.3` + * - Any version `*` + * @method versionParse + * @param range {string} The version string. + * @return {object} The version range parsed into its components. + */ + Plugin.versionParse = function(range) { + var pattern = /^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/; + + if (!pattern.test(range)) { + Common.warn('Plugin.versionParse:', range, 'is not a valid version or range.'); + } + + var identifiers = range.split('-'); + range = identifiers[0]; + + var isRange = isNaN(Number(range[0])), + version = isRange ? range.substr(1) : range, + parts = Common.map(version.split('.'), function(part) { + return Number(part); + }); + + return { + isRange: isRange, + version: version, + range: range, + operator: isRange ? range[0] : '', + parts: parts, + prerelease: identifiers[1], + number: parts[0] * 1e8 + parts[1] * 1e4 + parts[2] + }; + }; + + /** + * Returns `true` if `version` satisfies the given `range`. + * See documentation for `Plugin.versionParse` for a description of the format. + * If a version or range is not specified, then any version (`*`) is assumed to satisfy. + * @method versionSatisfies + * @param version {string} The version string. + * @param range {string} The range string. + * @return {boolean} `true` if `version` satisfies `range`, otherwise `false`. + */ + Plugin.versionSatisfies = function(version, range) { + range = range || '*'; + + var rangeParsed = Plugin.versionParse(range), + rangeParts = rangeParsed.parts, + versionParsed = Plugin.versionParse(version), + versionParts = versionParsed.parts; + + if (rangeParsed.isRange) { + if (rangeParsed.operator === '*' || version === '*') { + return true; + } + + if (rangeParsed.operator === '~') { + return versionParts[0] === rangeParts[0] && versionParts[1] === rangeParts[1] && versionParts[2] >= rangeParts[2]; + } + + if (rangeParsed.operator === '^') { + if (rangeParts[0] > 0) { + return versionParts[0] === rangeParts[0] && versionParsed.number >= rangeParsed.number; + } + + if (rangeParts[1] > 0) { + return versionParts[1] === rangeParts[1] && versionParts[2] >= rangeParts[2]; + } + + return versionParts[2] === rangeParts[2]; + } + } + + return version === range || version === '*'; + }; + +})(); + + +/***/ }), +/* 1247 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.World` module contains methods for creating and manipulating the world composite. +* A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. +* A `Matter.World` has a few additional properties including `gravity` and `bounds`. +* It is important to use the functions in the `Matter.Composite` module to modify the world composite, rather than directly modifying its properties. +* There are also a few methods here that alias those in `Matter.Composite` for easier readability. +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class World +* @extends Composite +*/ + +var World = {}; + +module.exports = World; + +var Composite = __webpack_require__(209); +var Constraint = __webpack_require__(228); +var Common = __webpack_require__(37); + +(function() { + + /** + * Creates a new world composite. The options parameter is an object that specifies any properties you wish to override the defaults. + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @constructor + * @param {} options + * @return {world} A new world + */ + World.create = function(options) { + var composite = Composite.create(); + + var defaults = { + label: 'World', + gravity: { + x: 0, + y: 1, + scale: 0.001 + }, + bounds: { + min: { x: -Infinity, y: -Infinity }, + max: { x: Infinity, y: Infinity } + } + }; + + return Common.extend(composite, defaults, options); + }; + + /* + * + * Properties Documentation + * + */ + + /** + * The gravity to apply on the world. + * + * @property gravity + * @type object + */ + + /** + * The gravity x component. + * + * @property gravity.x + * @type object + * @default 0 + */ + + /** + * The gravity y component. + * + * @property gravity.y + * @type object + * @default 1 + */ + + /** + * The gravity scale factor. + * + * @property gravity.scale + * @type object + * @default 0.001 + */ + + /** + * A `Bounds` object that defines the world bounds for collision detection. + * + * @property bounds + * @type bounds + * @default { min: { x: -Infinity, y: -Infinity }, max: { x: Infinity, y: Infinity } } + */ + + // World is a Composite body + // see src/module/Outro.js for these aliases: + + /** + * An alias for Composite.add + * @method add + * @param {world} world + * @param {} object + * @return {composite} The original world with the objects added + */ + + /** + * An alias for Composite.remove + * @method remove + * @param {world} world + * @param {} object + * @param {boolean} [deep=false] + * @return {composite} The original world with the objects removed + */ + + /** + * An alias for Composite.clear + * @method clear + * @param {world} world + * @param {boolean} keepStatic + */ + + /** + * An alias for Composite.addComposite + * @method addComposite + * @param {world} world + * @param {composite} composite + * @return {world} The original world with the objects from composite added + */ + + /** + * An alias for Composite.addBody + * @method addBody + * @param {world} world + * @param {body} body + * @return {world} The original world with the body added + */ + + /** + * An alias for Composite.addConstraint + * @method addConstraint + * @param {world} world + * @param {constraint} constraint + * @return {world} The original world with the constraint added + */ + +})(); + + +/***/ }), +/* 1248 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Plugins + */ + +module.exports = { + + BasePlugin: __webpack_require__(449), + DefaultPlugins: __webpack_require__(171), + PluginCache: __webpack_require__(18), + PluginManager: __webpack_require__(342), + ScenePlugin: __webpack_require__(1249) + +}; + + +/***/ }), +/* 1249 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* @author Richard Davey +* @copyright 2019 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/ + +var BasePlugin = __webpack_require__(449); +var Class = __webpack_require__(0); +var SceneEvents = __webpack_require__(19); + +/** + * @classdesc + * A Scene Level Plugin is installed into every Scene and belongs to that Scene. + * It can listen for Scene events and respond to them. + * It can map itself to a Scene property, or into the Scene Systems, or both. + * + * @class ScenePlugin + * @memberof Phaser.Plugins + * @extends Phaser.Plugins.BasePlugin + * @constructor + * @since 3.8.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin. + * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager. + */ +var ScenePlugin = new Class({ + + Extends: BasePlugin, + + initialize: + + function ScenePlugin (scene, pluginManager) + { + BasePlugin.call(this, pluginManager); + + this.scene = scene; + this.systems = scene.sys; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + }, + + /** + * This method is called when the Scene boots. It is only ever called once. + * + * By this point the plugin properties `scene` and `systems` will have already been set. + * + * In here you can listen for Scene events and set-up whatever you need for this plugin to run. + * Here are the Scene events you can listen to: + * + * start + * ready + * preupdate + * update + * postupdate + * resize + * pause + * resume + * sleep + * wake + * transitioninit + * transitionstart + * transitioncomplete + * transitionout + * shutdown + * destroy + * + * At the very least you should offer a destroy handler for when the Scene closes down, i.e: + * + * ```javascript + * var eventEmitter = this.systems.events; + * eventEmitter.once('destroy', this.sceneDestroy, this); + * ``` + * + * @method Phaser.Plugins.ScenePlugin#boot + * @since 3.8.0 + */ + boot: function () + { + } + +}); + +module.exports = ScenePlugin; + + +/***/ }), +/* 1250 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(17); +var CONST = __webpack_require__(173); + +/** + * @namespace Phaser.Scale + * + * @borrows Phaser.Scale.Center.NO_CENTER as NO_CENTER + * @borrows Phaser.Scale.Center.CENTER_BOTH as CENTER_BOTH + * @borrows Phaser.Scale.Center.CENTER_HORIZONTALLY as CENTER_HORIZONTALLY + * @borrows Phaser.Scale.Center.CENTER_VERTICALLY as CENTER_VERTICALLY + * + * @borrows Phaser.Scale.Orientation.LANDSCAPE as LANDSCAPE + * @borrows Phaser.Scale.Orientation.PORTRAIT as PORTRAIT + * + * @borrows Phaser.Scale.ScaleModes.NONE as NONE + * @borrows Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT as WIDTH_CONTROLS_HEIGHT + * @borrows Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH as HEIGHT_CONTROLS_WIDTH + * @borrows Phaser.Scale.ScaleModes.FIT as FIT + * @borrows Phaser.Scale.ScaleModes.ENVELOP as ENVELOP + * @borrows Phaser.Scale.ScaleModes.RESIZE as RESIZE + * + * @borrows Phaser.Scale.Zoom.NO_ZOOM as NO_ZOOM + * @borrows Phaser.Scale.Zoom.ZOOM_2X as ZOOM_2X + * @borrows Phaser.Scale.Zoom.ZOOM_4X as ZOOM_4X + * @borrows Phaser.Scale.Zoom.MAX_ZOOM as MAX_ZOOM + */ + +var Scale = { + + Center: __webpack_require__(331), + Events: __webpack_require__(89), + Orientation: __webpack_require__(332), + ScaleManager: __webpack_require__(343), + ScaleModes: __webpack_require__(333), + Zoom: __webpack_require__(334) + +}; + +Scale = Extend(false, Scale, CONST.CENTER); +Scale = Extend(false, Scale, CONST.ORIENTATION); +Scale = Extend(false, Scale, CONST.SCALE_MODE); +Scale = Extend(false, Scale, CONST.ZOOM); + +module.exports = Scale; + + +/***/ }), +/* 1251 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(122); +var Extend = __webpack_require__(17); + +/** + * @namespace Phaser.Scenes + */ + +var Scene = { + + Events: __webpack_require__(19), + SceneManager: __webpack_require__(345), + ScenePlugin: __webpack_require__(1252), + Settings: __webpack_require__(348), + Systems: __webpack_require__(176) + +}; + +// Merge in the consts +Scene = Extend(false, Scene, CONST); + +module.exports = Scene; + + +/***/ }), +/* 1252 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); +var Class = __webpack_require__(0); +var Events = __webpack_require__(19); +var GetFastValue = __webpack_require__(2); +var PluginCache = __webpack_require__(18); + +/** + * @classdesc + * A proxy class to the Global Scene Manager. + * + * @class ScenePlugin + * @memberof Phaser.Scenes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene that this ScenePlugin belongs to. + */ +var ScenePlugin = new Class({ + + initialize: + + function ScenePlugin (scene) + { + /** + * The Scene that this ScenePlugin belongs to. + * + * @name Phaser.Scenes.ScenePlugin#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * The Scene Systems instance of the Scene that this ScenePlugin belongs to. + * + * @name Phaser.Scenes.ScenePlugin#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * The settings of the Scene this ScenePlugin belongs to. + * + * @name Phaser.Scenes.ScenePlugin#settings + * @type {Phaser.Types.Scenes.SettingsObject} + * @since 3.0.0 + */ + this.settings = scene.sys.settings; + + /** + * The key of the Scene this ScenePlugin belongs to. + * + * @name Phaser.Scenes.ScenePlugin#key + * @type {string} + * @since 3.0.0 + */ + this.key = scene.sys.settings.key; + + /** + * The Game's SceneManager. + * + * @name Phaser.Scenes.ScenePlugin#manager + * @type {Phaser.Scenes.SceneManager} + * @since 3.0.0 + */ + this.manager = scene.sys.game.scene; + + /** + * If this Scene is currently transitioning to another, this holds + * the current percentage of the transition progress, between 0 and 1. + * + * @name Phaser.Scenes.ScenePlugin#transitionProgress + * @type {number} + * @since 3.5.0 + */ + this.transitionProgress = 0; + + /** + * Transition elapsed timer. + * + * @name Phaser.Scenes.ScenePlugin#_elapsed + * @type {integer} + * @private + * @since 3.5.0 + */ + this._elapsed = 0; + + /** + * Transition elapsed timer. + * + * @name Phaser.Scenes.ScenePlugin#_target + * @type {?Phaser.Scenes.Scene} + * @private + * @since 3.5.0 + */ + this._target = null; + + /** + * Transition duration. + * + * @name Phaser.Scenes.ScenePlugin#_duration + * @type {integer} + * @private + * @since 3.5.0 + */ + this._duration = 0; + + /** + * Transition callback. + * + * @name Phaser.Scenes.ScenePlugin#_onUpdate + * @type {function} + * @private + * @since 3.5.0 + */ + this._onUpdate; + + /** + * Transition callback scope. + * + * @name Phaser.Scenes.ScenePlugin#_onUpdateScope + * @type {object} + * @private + * @since 3.5.0 + */ + this._onUpdateScope; + + /** + * Will this Scene sleep (true) after the transition, or stop (false) + * + * @name Phaser.Scenes.ScenePlugin#_willSleep + * @type {boolean} + * @private + * @since 3.5.0 + */ + this._willSleep = false; + + /** + * Will this Scene be removed from the Scene Manager after the transition completes? + * + * @name Phaser.Scenes.ScenePlugin#_willRemove + * @type {boolean} + * @private + * @since 3.5.0 + */ + this._willRemove = false; + + scene.sys.events.once(Events.BOOT, this.boot, this); + scene.sys.events.on(Events.START, this.pluginStart, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Scenes.ScenePlugin#boot + * @private + * @since 3.0.0 + */ + boot: function () + { + this.systems.events.once(Events.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Scenes.ScenePlugin#pluginStart + * @private + * @since 3.5.0 + */ + pluginStart: function () + { + this._target = null; + + this.systems.events.once(Events.SHUTDOWN, this.shutdown, this); + }, + + /** + * Shutdown this Scene and run the given one. + * + * @method Phaser.Scenes.ScenePlugin#start + * @since 3.0.0 + * + * @param {string} [key] - The Scene to start. + * @param {object} [data] - The Scene data. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + start: function (key, data) + { + if (key === undefined) { key = this.key; } + + this.manager.queueOp('stop', this.key); + this.manager.queueOp('start', key, data); + + return this; + }, + + /** + * Restarts this Scene. + * + * @method Phaser.Scenes.ScenePlugin#restart + * @since 3.4.0 + * + * @param {object} [data] - The Scene data. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + restart: function (data) + { + var key = this.key; + + this.manager.queueOp('stop', key); + this.manager.queueOp('start', key, data); + + return this; + }, + + /** + * This will start a transition from the current Scene to the target Scene given. + * + * The transition will last for the duration specified in milliseconds. + * + * You can have the target Scene moved above or below this one in the display list. + * + * You can specify an update callback. This callback will be invoked _every frame_ for the duration + * of the transition. + * + * This Scene can either be sent to sleep at the end of the transition, or stopped. The default is to stop. + * + * There are also 5 transition related events: This scene will emit the event `transitionout` when + * the transition begins, which is typically the frame after calling this method. + * + * The target Scene will emit the event `transitioninit` when that Scene's `init` method is called. + * It will then emit the event `transitionstart` when its `create` method is called. + * If the Scene was sleeping and has been woken up, it will emit the event `transitionwake` instead of these two, + * as the Scenes `init` and `create` methods are not invoked when a Scene wakes up. + * + * When the duration of the transition has elapsed it will emit the event `transitioncomplete`. + * These events are cleared of all listeners when the Scene shuts down, but not if it is sent to sleep. + * + * It's important to understand that the duration of the transition begins the moment you call this method. + * If the Scene you are transitioning to includes delayed processes, such as waiting for files to load, the + * time still counts down even while that is happening. If the game itself pauses, or something else causes + * this Scenes update loop to stop, then the transition will also pause for that duration. There are + * checks in place to prevent you accidentally stopping a transitioning Scene but if you've got code to + * override this understand that until the target Scene completes it might never be unlocked for input events. + * + * @method Phaser.Scenes.ScenePlugin#transition + * @fires Phaser.Scenes.Events#TRANSITION_OUT + * @since 3.5.0 + * + * @param {Phaser.Types.Scenes.SceneTransitionConfig} config - The transition configuration object. + * + * @return {boolean} `true` is the transition was started, otherwise `false`. + */ + transition: function (config) + { + if (config === undefined) { config = {}; } + + var key = GetFastValue(config, 'target', false); + + var target = this.manager.getScene(key); + + if (!key || !this.checkValidTransition(target)) + { + return false; + } + + var duration = GetFastValue(config, 'duration', 1000); + + this._elapsed = 0; + this._target = target; + this._duration = duration; + this._willSleep = GetFastValue(config, 'sleep', false); + this._willRemove = GetFastValue(config, 'remove', false); + + var callback = GetFastValue(config, 'onUpdate', null); + + if (callback) + { + this._onUpdate = callback; + this._onUpdateScope = GetFastValue(config, 'onUpdateScope', this.scene); + } + + var allowInput = GetFastValue(config, 'allowInput', false); + + this.settings.transitionAllowInput = allowInput; + + var targetSettings = target.sys.settings; + + targetSettings.isTransition = true; + targetSettings.transitionFrom = this.scene; + targetSettings.transitionDuration = duration; + targetSettings.transitionAllowInput = allowInput; + + if (GetFastValue(config, 'moveAbove', false)) + { + this.manager.moveAbove(this.key, key); + } + else if (GetFastValue(config, 'moveBelow', false)) + { + this.manager.moveBelow(this.key, key); + } + + if (target.sys.isSleeping()) + { + target.sys.wake(); + } + else + { + this.manager.start(key, GetFastValue(config, 'data')); + } + + this.systems.events.emit(Events.TRANSITION_OUT, target, duration); + + this.systems.events.on(Events.UPDATE, this.step, this); + + return true; + }, + + /** + * Checks to see if this Scene can transition to the target Scene or not. + * + * @method Phaser.Scenes.ScenePlugin#checkValidTransition + * @private + * @since 3.5.0 + * + * @param {Phaser.Scene} target - The Scene to test against. + * + * @return {boolean} `true` if this Scene can transition, otherwise `false`. + */ + checkValidTransition: function (target) + { + // Not a valid target if it doesn't exist, isn't active or is already transitioning in or out + if (!target || target.sys.isActive() || target.sys.isTransitioning() || target === this.scene || this.systems.isTransitioning()) + { + return false; + } + + return true; + }, + + /** + * A single game step. This is only called if the parent Scene is transitioning + * out to another Scene. + * + * @method Phaser.Scenes.ScenePlugin#step + * @private + * @since 3.5.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + step: function (time, delta) + { + this._elapsed += delta; + + this.transitionProgress = Clamp(this._elapsed / this._duration, 0, 1); + + if (this._onUpdate) + { + this._onUpdate.call(this._onUpdateScope, this.transitionProgress); + } + + if (this._elapsed >= this._duration) + { + this.transitionComplete(); + } + }, + + /** + * Called by `step` when the transition out of this scene to another is over. + * + * @method Phaser.Scenes.ScenePlugin#transitionComplete + * @private + * @fires Phaser.Scenes.Events#TRANSITION_COMPLETE + * @since 3.5.0 + */ + transitionComplete: function () + { + var targetSys = this._target.sys; + var targetSettings = this._target.sys.settings; + + // Stop the step + this.systems.events.off(Events.UPDATE, this.step, this); + + // Notify target scene + targetSys.events.emit(Events.TRANSITION_COMPLETE, this.scene); + + // Clear target scene settings + targetSettings.isTransition = false; + targetSettings.transitionFrom = null; + + // Clear local settings + this._duration = 0; + this._target = null; + this._onUpdate = null; + this._onUpdateScope = null; + + // Now everything is clear we can handle what happens to this Scene + if (this._willRemove) + { + this.manager.remove(this.key); + } + else if (this._willSleep) + { + this.systems.sleep(); + } + else + { + this.manager.stop(this.key); + } + }, + + /** + * Add the Scene into the Scene Manager and start it if 'autoStart' is true or the Scene config 'active' property is set. + * + * @method Phaser.Scenes.ScenePlugin#add + * @since 3.0.0 + * + * @param {string} key - The Scene key. + * @param {(Phaser.Scene|Phaser.Types.Scenes.SettingsConfig|Phaser.Types.Scenes.CreateSceneFromObjectConfig|function)} sceneConfig - The config for the Scene. + * @param {boolean} autoStart - Whether to start the Scene after it's added. + * @param {object} [data] - Optional data object. This will be set as Scene.settings.data and passed to `Scene.init`. + * + * @return {Phaser.Scene} An instance of the Scene that was added to the Scene Manager. + */ + add: function (key, sceneConfig, autoStart, data) + { + return this.manager.add(key, sceneConfig, autoStart, data); + }, + + /** + * Launch the given Scene and run it in parallel with this one. + * + * @method Phaser.Scenes.ScenePlugin#launch + * @since 3.0.0 + * + * @param {string} key - The Scene to launch. + * @param {object} [data] - The Scene data. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + launch: function (key, data) + { + if (key && key !== this.key) + { + this.manager.queueOp('start', key, data); + } + + return this; + }, + + /** + * Runs the given Scene, but does not change the state of this Scene. + * + * If the given Scene is paused, it will resume it. If sleeping, it will wake it. + * If not running at all, it will be started. + * + * Use this if you wish to open a modal Scene by calling `pause` on the current + * Scene, then `run` on the modal Scene. + * + * @method Phaser.Scenes.ScenePlugin#run + * @since 3.10.0 + * + * @param {string} key - The Scene to run. + * @param {object} [data] - A data object that will be passed to the Scene and emitted in its ready, wake, or resume events. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + run: function (key, data) + { + if (key && key !== this.key) + { + this.manager.queueOp('run', key, data); + } + + return this; + }, + + /** + * Pause the Scene - this stops the update step from happening but it still renders. + * + * @method Phaser.Scenes.ScenePlugin#pause + * @since 3.0.0 + * + * @param {string} [key] - The Scene to pause. + * @param {object} [data] - An optional data object that will be passed to the Scene and emitted in its pause event. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + pause: function (key, data) + { + if (key === undefined) { key = this.key; } + + this.manager.queueOp('pause', key, data); + + return this; + }, + + /** + * Resume the Scene - starts the update loop again. + * + * @method Phaser.Scenes.ScenePlugin#resume + * @since 3.0.0 + * + * @param {string} [key] - The Scene to resume. + * @param {object} [data] - An optional data object that will be passed to the Scene and emitted in its resume event. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + resume: function (key, data) + { + if (key === undefined) { key = this.key; } + + this.manager.queueOp('resume', key, data); + + return this; + }, + + /** + * Makes the Scene sleep (no update, no render) but doesn't shutdown. + * + * @method Phaser.Scenes.ScenePlugin#sleep + * @since 3.0.0 + * + * @param {string} [key] - The Scene to put to sleep. + * @param {object} [data] - An optional data object that will be passed to the Scene and emitted in its sleep event. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + sleep: function (key, data) + { + if (key === undefined) { key = this.key; } + + this.manager.queueOp('sleep', key, data); + + return this; + }, + + /** + * Makes the Scene wake-up (starts update and render) + * + * @method Phaser.Scenes.ScenePlugin#wake + * @since 3.0.0 + * + * @param {string} [key] - The Scene to wake up. + * @param {object} [data] - An optional data object that will be passed to the Scene and emitted in its wake event. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + wake: function (key, data) + { + if (key === undefined) { key = this.key; } + + this.manager.queueOp('wake', key, data); + + return this; + }, + + /** + * Makes this Scene sleep then starts the Scene given. + * + * No checks are made to see if an instance of the given Scene is already running. + * Because Scenes in Phaser are non-exclusive, you are allowed to run multiple + * instances of them _at the same time_. This means, calling this function + * may launch another instance of the requested Scene if it's already running. + * + * @method Phaser.Scenes.ScenePlugin#switch + * @since 3.0.0 + * + * @param {string} key - The Scene to start. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + switch: function (key) + { + if (key !== this.key) + { + this.manager.queueOp('switch', this.key, key); + } + + return this; + }, + + /** + * Shutdown the Scene, clearing display list, timers, etc. + * + * @method Phaser.Scenes.ScenePlugin#stop + * @since 3.0.0 + * + * @param {string} [key] - The Scene to stop. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + stop: function (key) + { + if (key === undefined) { key = this.key; } + + this.manager.queueOp('stop', key); + + return this; + }, + + /** + * Sets the active state of the given Scene. + * + * @method Phaser.Scenes.ScenePlugin#setActive + * @since 3.0.0 + * + * @param {boolean} value - If `true` the Scene will be resumed. If `false` it will be paused. + * @param {string} [key] - The Scene to set the active state of. + * @param {object} [data] - An optional data object that will be passed to the Scene and emitted with its events. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + setActive: function (value, key, data) + { + if (key === undefined) { key = this.key; } + + var scene = this.manager.getScene(key); + + if (scene) + { + scene.sys.setActive(value, data); + } + + return this; + }, + + /** + * Sets the visible state of the given Scene. + * + * @method Phaser.Scenes.ScenePlugin#setVisible + * @since 3.0.0 + * + * @param {boolean} value - The visible value. + * @param {string} [key] - The Scene to set the visible state for. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + setVisible: function (value, key) + { + if (key === undefined) { key = this.key; } + + var scene = this.manager.getScene(key); + + if (scene) + { + scene.sys.setVisible(value); + } + + return this; + }, + + /** + * Checks if the given Scene is sleeping or not? + * + * @method Phaser.Scenes.ScenePlugin#isSleeping + * @since 3.0.0 + * + * @param {string} [key] - The Scene to check. + * + * @return {boolean} Whether the Scene is sleeping. + */ + isSleeping: function (key) + { + if (key === undefined) { key = this.key; } + + return this.manager.isSleeping(key); + }, + + /** + * Checks if the given Scene is running or not? + * + * @method Phaser.Scenes.ScenePlugin#isActive + * @since 3.0.0 + * + * @param {string} [key] - The Scene to check. + * + * @return {boolean} Whether the Scene is running. + */ + isActive: function (key) + { + if (key === undefined) { key = this.key; } + + return this.manager.isActive(key); + }, + + /** + * Checks if the given Scene is paused or not? + * + * @method Phaser.Scenes.ScenePlugin#isPaused + * @since 3.17.0 + * + * @param {string} [key] - The Scene to check. + * + * @return {boolean} Whether the Scene is paused. + */ + isPaused: function (key) + { + if (key === undefined) { key = this.key; } + + return this.manager.isPaused(key); + }, + + /** + * Checks if the given Scene is visible or not? + * + * @method Phaser.Scenes.ScenePlugin#isVisible + * @since 3.0.0 + * + * @param {string} [key] - The Scene to check. + * + * @return {boolean} Whether the Scene is visible. + */ + isVisible: function (key) + { + if (key === undefined) { key = this.key; } + + return this.manager.isVisible(key); + }, + + /** + * Swaps the position of two scenes in the Scenes list. + * + * This controls the order in which they are rendered and updated. + * + * @method Phaser.Scenes.ScenePlugin#swapPosition + * @since 3.2.0 + * + * @param {string} keyA - The first Scene to swap. + * @param {string} [keyB] - The second Scene to swap. If none is given it defaults to this Scene. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + swapPosition: function (keyA, keyB) + { + if (keyB === undefined) { keyB = this.key; } + + if (keyA !== keyB) + { + this.manager.swapPosition(keyA, keyB); + } + + return this; + }, + + /** + * Swaps the position of two scenes in the Scenes list, so that Scene B is directly above Scene A. + * + * This controls the order in which they are rendered and updated. + * + * @method Phaser.Scenes.ScenePlugin#moveAbove + * @since 3.2.0 + * + * @param {string} keyA - The Scene that Scene B will be moved to be above. + * @param {string} [keyB] - The Scene to be moved. If none is given it defaults to this Scene. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + moveAbove: function (keyA, keyB) + { + if (keyB === undefined) { keyB = this.key; } + + if (keyA !== keyB) + { + this.manager.moveAbove(keyA, keyB); + } + + return this; + }, + + /** + * Swaps the position of two scenes in the Scenes list, so that Scene B is directly below Scene A. + * + * This controls the order in which they are rendered and updated. + * + * @method Phaser.Scenes.ScenePlugin#moveBelow + * @since 3.2.0 + * + * @param {string} keyA - The Scene that Scene B will be moved to be below. + * @param {string} [keyB] - The Scene to be moved. If none is given it defaults to this Scene. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + moveBelow: function (keyA, keyB) + { + if (keyB === undefined) { keyB = this.key; } + + if (keyA !== keyB) + { + this.manager.moveBelow(keyA, keyB); + } + + return this; + }, + + /** + * Removes a Scene from the SceneManager. + * + * The Scene is removed from the local scenes array, it's key is cleared from the keys + * cache and Scene.Systems.destroy is then called on it. + * + * If the SceneManager is processing the Scenes when this method is called it wil + * queue the operation for the next update sequence. + * + * @method Phaser.Scenes.ScenePlugin#remove + * @since 3.2.0 + * + * @param {(string|Phaser.Scene)} [key] - The Scene to be removed. + * + * @return {Phaser.Scenes.SceneManager} This SceneManager. + */ + remove: function (key) + { + if (key === undefined) { key = this.key; } + + this.manager.remove(key); + + return this; + }, + + /** + * Moves a Scene up one position in the Scenes list. + * + * @method Phaser.Scenes.ScenePlugin#moveUp + * @since 3.0.0 + * + * @param {string} [key] - The Scene to move. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + moveUp: function (key) + { + if (key === undefined) { key = this.key; } + + this.manager.moveUp(key); + + return this; + }, + + /** + * Moves a Scene down one position in the Scenes list. + * + * @method Phaser.Scenes.ScenePlugin#moveDown + * @since 3.0.0 + * + * @param {string} [key] - The Scene to move. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + moveDown: function (key) + { + if (key === undefined) { key = this.key; } + + this.manager.moveDown(key); + + return this; + }, + + /** + * Brings a Scene to the top of the Scenes list. + * + * This means it will render above all other Scenes. + * + * @method Phaser.Scenes.ScenePlugin#bringToTop + * @since 3.0.0 + * + * @param {string} [key] - The Scene to move. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + bringToTop: function (key) + { + if (key === undefined) { key = this.key; } + + this.manager.bringToTop(key); + + return this; + }, + + /** + * Sends a Scene to the back of the Scenes list. + * + * This means it will render below all other Scenes. + * + * @method Phaser.Scenes.ScenePlugin#sendToBack + * @since 3.0.0 + * + * @param {string} [key] - The Scene to move. + * + * @return {Phaser.Scenes.ScenePlugin} This ScenePlugin object. + */ + sendToBack: function (key) + { + if (key === undefined) { key = this.key; } + + this.manager.sendToBack(key); + + return this; + }, + + /** + * Retrieve a Scene. + * + * @method Phaser.Scenes.ScenePlugin#get + * @since 3.0.0 + * + * @param {string} key - The Scene to retrieve. + * + * @return {Phaser.Scene} The Scene. + */ + get: function (key) + { + return this.manager.getScene(key); + }, + + /** + * Retrieves the numeric index of a Scene in the Scenes list. + * + * @method Phaser.Scenes.ScenePlugin#getIndex + * @since 3.7.0 + * + * @param {(string|Phaser.Scene)} [key] - The Scene to get the index of. + * + * @return {integer} The index of the Scene. + */ + getIndex: function (key) + { + if (key === undefined) { key = this.key; } + + return this.manager.getIndex(key); + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.Scenes.ScenePlugin#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + var eventEmitter = this.systems.events; + + eventEmitter.off(Events.SHUTDOWN, this.shutdown, this); + eventEmitter.off(Events.POST_UPDATE, this.step, this); + eventEmitter.off(Events.TRANSITION_OUT); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.Scenes.ScenePlugin#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene.sys.events.off(Events.START, this.start, this); + + this.scene = null; + this.systems = null; + this.settings = null; + this.manager = null; + } + +}); + +PluginCache.register('ScenePlugin', ScenePlugin, 'scenePlugin'); + +module.exports = ScenePlugin; + + +/***/ }), +/* 1253 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Structs + */ + +module.exports = { + + List: __webpack_require__(125), + Map: __webpack_require__(157), + ProcessQueue: __webpack_require__(442), + RTree: __webpack_require__(443), + Set: __webpack_require__(105), + Size: __webpack_require__(344) + +}; + + +/***/ }), +/* 1254 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(17); +var FilterMode = __webpack_require__(1255); + +/** + * @namespace Phaser.Textures + */ + +/** + * Linear filter type. + * + * @name Phaser.Textures.LINEAR + * @type {integer} + * @const + * @since 3.0.0 + */ + +/** + * Nearest Neighbor filter type. + * + * @name Phaser.Textures.NEAREST + * @type {integer} + * @const + * @since 3.0.0 + */ + +var Textures = { + + Events: __webpack_require__(118), + FilterMode: FilterMode, + Frame: __webpack_require__(91), + Parsers: __webpack_require__(351), + Texture: __webpack_require__(177), + TextureManager: __webpack_require__(349), + TextureSource: __webpack_require__(350) + +}; + +Textures = Extend(false, Textures, FilterMode); + +module.exports = Textures; + + +/***/ }), +/* 1255 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Filter Types. + * + * @namespace Phaser.Textures.FilterMode + * @memberof Phaser.Textures + * @since 3.0.0 + */ +var CONST = { + + /** + * Linear filter type. + * + * @name Phaser.Textures.FilterMode.LINEAR + * @type {integer} + * @const + * @since 3.0.0 + */ + LINEAR: 0, + + /** + * Nearest neighbor filter type. + * + * @name Phaser.Textures.FilterMode.NEAREST + * @type {integer} + * @const + * @since 3.0.0 + */ + NEAREST: 1 + +}; + +module.exports = CONST; + + +/***/ }), +/* 1256 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tilemaps + */ + +module.exports = { + + Components: __webpack_require__(136), + Parsers: __webpack_require__(1286), + + Formats: __webpack_require__(31), + ImageCollection: __webpack_require__(460), + ParseToTilemap: __webpack_require__(216), + Tile: __webpack_require__(72), + Tilemap: __webpack_require__(469), + TilemapCreator: __webpack_require__(1295), + TilemapFactory: __webpack_require__(1296), + Tileset: __webpack_require__(140), + + LayerData: __webpack_require__(102), + MapData: __webpack_require__(103), + ObjectLayer: __webpack_require__(463), + + DynamicTilemapLayer: __webpack_require__(470), + StaticTilemapLayer: __webpack_require__(471) + +}; + + +/***/ }), +/* 1257 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); +var CalculateFacesWithin = __webpack_require__(51); + +/** + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * + * @function Phaser.Tilemaps.Components.Copy + * @private + * @since 3.0.0 + * + * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {integer} width - The width of the area to copy, in tiles, not pixels. + * @param {integer} height - The height of the area to copy, in tiles, not pixels. + * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var Copy = function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer) +{ + if (srcTileX < 0) { srcTileX = 0; } + if (srcTileY < 0) { srcTileY = 0; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + + var srcTiles = GetTilesWithin(srcTileX, srcTileY, width, height, null, layer); + + var offsetX = destTileX - srcTileX; + var offsetY = destTileY - srcTileY; + + for (var i = 0; i < srcTiles.length; i++) + { + var tileX = srcTiles[i].x + offsetX; + var tileY = srcTiles[i].y + offsetY; + if (tileX >= 0 && tileX < layer.width && tileY >= 0 && tileY < layer.height) + { + if (layer.data[tileY][tileX]) + { + layer.data[tileY][tileX].copy(srcTiles[i]); + } + } + } + + if (recalculateFaces) + { + // Recalculate the faces within the destination area and neighboring tiles + CalculateFacesWithin(destTileX - 1, destTileY - 1, width + 2, height + 2, layer); + } +}; + +module.exports = Copy; + + +/***/ }), +/* 1258 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TileToWorldX = __webpack_require__(138); +var TileToWorldY = __webpack_require__(139); +var GetTilesWithin = __webpack_require__(21); +var ReplaceByIndex = __webpack_require__(450); + +/** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * + * @function Phaser.Tilemaps.Components.CreateFromTiles + * @private + * @since 3.0.0 + * + * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). + * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. + */ +var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, camera, layer) +{ + if (spriteConfig === undefined) { spriteConfig = {}; } + + if (!Array.isArray(indexes)) { indexes = [ indexes ]; } + + var tilemapLayer = layer.tilemapLayer; + if (scene === undefined) { scene = tilemapLayer.scene; } + if (camera === undefined) { camera = scene.cameras.main; } + + var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); + var sprites = []; + var i; + + for (i = 0; i < tiles.length; i++) + { + var tile = tiles[i]; + + if (indexes.indexOf(tile.index) !== -1) + { + spriteConfig.x = TileToWorldX(tile.x, camera, layer); + spriteConfig.y = TileToWorldY(tile.y, camera, layer); + + var sprite = scene.make.sprite(spriteConfig); + sprites.push(sprite); + } + } + + if (typeof replacements === 'number') + { + // Assume 1 replacement for all types of tile given + for (i = 0; i < indexes.length; i++) + { + ReplaceByIndex(indexes[i], replacements, 0, 0, layer.width, layer.height, layer); + } + } + else if (Array.isArray(replacements)) + { + // Assume 1 to 1 mapping with indexes array + for (i = 0; i < indexes.length; i++) + { + ReplaceByIndex(indexes[i], replacements[i], 0, 0, layer.width, layer.height, layer); + } + } + + return sprites; +}; + +module.exports = CreateFromTiles; + + +/***/ }), +/* 1259 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SnapFloor = __webpack_require__(90); +var SnapCeil = __webpack_require__(303); + +/** + * Returns the tiles in the given layer that are within the camera's viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.CullTiles + * @private + * @since 3.0.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var CullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemap = layer.tilemapLayer.tilemap; + var tilemapLayer = layer.tilemapLayer; + + var mapData = layer.data; + var mapWidth = layer.width; + var mapHeight = layer.height; + + // We need to use the tile sizes defined for the map as a whole, not the layer, + // in order to calculate the bounds correctly. As different sized tiles may be + // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. + var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); + var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); + + var drawLeft = 0; + var drawRight = mapWidth; + var drawTop = 0; + var drawBottom = mapHeight; + + if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1) + { + // Camera world view bounds, snapped for scaled tile size + // Cull Padding values are given in tiles, not pixels + + var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; + var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; + var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY; + var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY; + + drawLeft = Math.max(0, boundsLeft); + drawRight = Math.min(mapWidth, boundsRight); + drawTop = Math.max(0, boundsTop); + drawBottom = Math.min(mapHeight, boundsBottom); + } + + var x; + var y; + var tile; + + if (renderOrder === 0) + { + // right-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 1) + { + // left-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 2) + { + // right-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 3) + { + // left-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + + tilemapLayer.tilesDrawn = outputArray.length; + tilemapLayer.tilesTotal = mapWidth * mapHeight; + + return outputArray; +}; + +module.exports = CullTiles; + + +/***/ }), +/* 1260 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); +var CalculateFacesWithin = __webpack_require__(51); +var SetTileCollision = __webpack_require__(71); + +/** + * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the + * specified index. Tiles will be set to collide if the given index is a colliding index. + * Collision information in the region will be recalculated. + * + * @function Phaser.Tilemaps.Components.Fill + * @private + * @since 3.0.0 + * + * @param {integer} index - The tile index to fill the area with. + * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} width - How many tiles wide from the `tileX` index the area will be. + * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} layer - The tile layer to use. If not given the current layer is used. + */ +var Fill = function (index, tileX, tileY, width, height, recalculateFaces, layer) +{ + var doesIndexCollide = (layer.collideIndexes.indexOf(index) !== -1); + + var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + + for (var i = 0; i < tiles.length; i++) + { + tiles[i].index = index; + + SetTileCollision(tiles[i], doesIndexCollide); + } + + if (recalculateFaces) + { + // Recalculate the faces within the area and neighboring tiles + CalculateFacesWithin(tileX - 1, tileY - 1, width + 2, height + 2, layer); + } +}; + +module.exports = Fill; + + +/***/ }), +/* 1261 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); + +/** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * + * @function Phaser.Tilemaps.Components.FilterTiles + * @private + * @since 3.0.0 + * + * @param {function} callback - The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile[]} The filtered array of Tiles. + */ +var FilterTiles = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) +{ + var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + + return tiles.filter(callback, context); +}; + +module.exports = FilterTiles; + + + +/***/ }), +/* 1262 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * + * @function Phaser.Tilemaps.Components.FindByIndex + * @private + * @since 3.0.0 + * + * @param {integer} index - The tile index value to search for. + * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. + * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the + * bottom-right. Otherwise it scans from the top-left. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {?Phaser.Tilemaps.Tile} The first (or n skipped) tile with the matching index. + */ +var FindByIndex = function (findIndex, skip, reverse, layer) +{ + if (skip === undefined) { skip = 0; } + if (reverse === undefined) { reverse = false; } + + var count = 0; + var tx; + var ty; + var tile; + + if (reverse) + { + for (ty = layer.height - 1; ty >= 0; ty--) + { + for (tx = layer.width - 1; tx >= 0; tx--) + { + tile = layer.data[ty][tx]; + if (tile && tile.index === findIndex) + { + if (count === skip) + { + return tile; + } + else + { + count += 1; + } + } + } + } + } + else + { + for (ty = 0; ty < layer.height; ty++) + { + for (tx = 0; tx < layer.width; tx++) + { + tile = layer.data[ty][tx]; + if (tile && tile.index === findIndex) + { + if (count === skip) + { + return tile; + } + else + { + count += 1; + } + } + } + } + } + + return null; +}; + +module.exports = FindByIndex; + + +/***/ }), +/* 1263 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); + +/** + * @callback FindTileCallback + * + * @param {Phaser.Tilemaps.Tile} value - The Tile. + * @param {integer} index - The index of the tile. + * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. + * + * @return {boolean} Return `true` if the callback should run, otherwise `false`. + */ + +/** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * + * @function Phaser.Tilemaps.Components.FindTile + * @private + * @since 3.0.0 + * + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {?Phaser.Tilemaps.Tile} A Tile that matches the search, or null if no Tile found + */ +var FindTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) +{ + var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + return tiles.find(callback, context) || null; +}; + +module.exports = FindTile; + + +/***/ }), +/* 1264 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); + +/** + * @callback EachTileCallback + * + * @param {Phaser.Tilemaps.Tile} value - The Tile. + * @param {integer} index - The index of the tile. + * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. + */ + +/** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * + * @function Phaser.Tilemaps.Components.ForEachTile + * @private + * @since 3.0.0 + * + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var ForEachTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) +{ + var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + + tiles.forEach(callback, context); +}; + +module.exports = ForEachTile; + + +/***/ }), +/* 1265 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTileAt = __webpack_require__(137); +var WorldToTileX = __webpack_require__(61); +var WorldToTileY = __webpack_require__(62); + +/** + * Gets a tile at the given world coordinates from the given layer. + * + * @function Phaser.Tilemaps.Components.GetTileAtWorldXY + * @private + * @since 3.0.0 + * + * @param {number} worldX - X position to get the tile from (given in pixels) + * @param {number} worldY - Y position to get the tile from (given in pixels) + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates + * were invalid. + */ +var GetTileAtWorldXY = function (worldX, worldY, nonNull, camera, layer) +{ + var tileX = WorldToTileX(worldX, true, camera, layer); + var tileY = WorldToTileY(worldY, true, camera, layer); + + return GetTileAt(tileX, tileY, nonNull, layer); +}; + +module.exports = GetTileAtWorldXY; + + +/***/ }), +/* 1266 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Geom = __webpack_require__(401); +var GetTilesWithin = __webpack_require__(21); +var Intersects = __webpack_require__(402); +var NOOP = __webpack_require__(1); +var TileToWorldX = __webpack_require__(138); +var TileToWorldY = __webpack_require__(139); +var WorldToTileX = __webpack_require__(61); +var WorldToTileY = __webpack_require__(62); + +var TriangleToRectangle = function (triangle, rect) +{ + return Intersects.RectangleToTriangle(rect, triangle); +}; + +// Note: Could possibly be optimized by copying the shape and shifting it into tilemapLayer +// coordinates instead of shifting the tiles. + +/** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * + * @function Phaser.Tilemaps.Components.GetTilesWithinShape + * @private + * @since 3.0.0 + * + * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates + * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. + */ +var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) +{ + if (shape === undefined) { return []; } + + // intersectTest is a function with parameters: shape, rect + var intersectTest = NOOP; + if (shape instanceof Geom.Circle) { intersectTest = Intersects.CircleToRectangle; } + else if (shape instanceof Geom.Rectangle) { intersectTest = Intersects.RectangleToRectangle; } + else if (shape instanceof Geom.Triangle) { intersectTest = TriangleToRectangle; } + else if (shape instanceof Geom.Line) { intersectTest = Intersects.LineToRectangle; } + + // Top left corner of the shapes's bounding box, rounded down to include partial tiles + var xStart = WorldToTileX(shape.left, true, camera, layer); + var yStart = WorldToTileY(shape.top, true, camera, layer); + + // Bottom right corner of the shapes's bounding box, rounded up to include partial tiles + var xEnd = Math.ceil(WorldToTileX(shape.right, false, camera, layer)); + var yEnd = Math.ceil(WorldToTileY(shape.bottom, false, camera, layer)); + + // Tiles within bounding rectangle of shape. Bounds are forced to be at least 1 x 1 tile in size + // to grab tiles for shapes that don't have a height or width (e.g. a horizontal line). + var width = Math.max(xEnd - xStart, 1); + var height = Math.max(yEnd - yStart, 1); + var tiles = GetTilesWithin(xStart, yStart, width, height, filteringOptions, layer); + + var tileWidth = layer.tileWidth; + var tileHeight = layer.tileHeight; + if (layer.tilemapLayer) + { + tileWidth *= layer.tilemapLayer.scaleX; + tileHeight *= layer.tilemapLayer.scaleY; + } + + var results = []; + var tileRect = new Geom.Rectangle(0, 0, tileWidth, tileHeight); + for (var i = 0; i < tiles.length; i++) + { + var tile = tiles[i]; + tileRect.x = TileToWorldX(tile.x, camera, layer); + tileRect.y = TileToWorldY(tile.y, camera, layer); + if (intersectTest(shape, tileRect)) + { + results.push(tile); + } + } + + return results; +}; + +module.exports = GetTilesWithinShape; + + +/***/ }), +/* 1267 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); +var WorldToTileX = __webpack_require__(61); +var WorldToTileY = __webpack_require__(62); + +/** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * + * @function Phaser.Tilemaps.Components.GetTilesWithinWorldXY + * @private + * @since 3.0.0 + * + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. + * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. + * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. + * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. + */ +var GetTilesWithinWorldXY = function (worldX, worldY, width, height, filteringOptions, camera, layer) +{ + // Top left corner of the rect, rounded down to include partial tiles + var xStart = WorldToTileX(worldX, true, camera, layer); + var yStart = WorldToTileY(worldY, true, camera, layer); + + // Bottom right corner of the rect, rounded up to include partial tiles + var xEnd = Math.ceil(WorldToTileX(worldX + width, false, camera, layer)); + var yEnd = Math.ceil(WorldToTileY(worldY + height, false, camera, layer)); + + return GetTilesWithin(xStart, yStart, xEnd - xStart, yEnd - yStart, filteringOptions, layer); +}; + +module.exports = GetTilesWithinWorldXY; + + +/***/ }), +/* 1268 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var HasTileAt = __webpack_require__(451); +var WorldToTileX = __webpack_require__(61); +var WorldToTileY = __webpack_require__(62); + +/** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * @function Phaser.Tilemaps.Components.HasTileAtWorldXY + * @private + * @since 3.0.0 + * + * @param {number} worldX - The X coordinate of the world position. + * @param {number} worldY - The Y coordinate of the world position. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {?boolean} Returns a boolean, or null if the layer given was invalid. + */ +var HasTileAtWorldXY = function (worldX, worldY, camera, layer) +{ + var tileX = WorldToTileX(worldX, true, camera, layer); + var tileY = WorldToTileY(worldY, true, camera, layer); + + return HasTileAt(tileX, tileY, layer); +}; + +module.exports = HasTileAtWorldXY; + + +/***/ }), +/* 1269 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PutTileAt = __webpack_require__(211); +var WorldToTileX = __webpack_require__(61); +var WorldToTileY = __webpack_require__(62); + +/** + * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either + * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the + * specified location. If you pass in an index, only the index at the specified location will be + * changed. Collision information will be recalculated at the specified location. + * + * @function Phaser.Tilemaps.Components.PutTileAtWorldXY + * @private + * @since 3.0.0 + * + * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. + */ +var PutTileAtWorldXY = function (tile, worldX, worldY, recalculateFaces, camera, layer) +{ + var tileX = WorldToTileX(worldX, true, camera, layer); + var tileY = WorldToTileY(worldY, true, camera, layer); + return PutTileAt(tile, tileX, tileY, recalculateFaces, layer); +}; + +module.exports = PutTileAtWorldXY; + + +/***/ }), +/* 1270 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CalculateFacesWithin = __webpack_require__(51); +var PutTileAt = __webpack_require__(211); + +/** + * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified + * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, + * all attributes will be copied over to the specified location. If you pass in an index, only the + * index at the specified location will be changed. Collision information will be recalculated + * within the region tiles were changed. + * + * @function Phaser.Tilemaps.Components.PutTilesAt + * @private + * @since 3.0.0 + * + * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var PutTilesAt = function (tilesArray, tileX, tileY, recalculateFaces, layer) +{ + if (!Array.isArray(tilesArray)) { return null; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + + // Force the input array to be a 2D array + if (!Array.isArray(tilesArray[0])) + { + tilesArray = [ tilesArray ]; + } + + var height = tilesArray.length; + var width = tilesArray[0].length; + + for (var ty = 0; ty < height; ty++) + { + for (var tx = 0; tx < width; tx++) + { + var tile = tilesArray[ty][tx]; + PutTileAt(tile, tileX + tx, tileY + ty, false, layer); + } + } + + if (recalculateFaces) + { + // Recalculate the faces within the destination area and neighboring tiles + CalculateFacesWithin(tileX - 1, tileY - 1, width + 2, height + 2, layer); + } +}; + +module.exports = PutTilesAt; + + + +/***/ }), +/* 1271 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); +var GetRandom = __webpack_require__(180); + +/** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then + * those will be used for randomly assigning new tile indexes. If an array is not provided, the + * indexes found within the region (excluding -1) will be used for randomly assigning new tile + * indexes. This method only modifies tile indexes and does not change collision information. + * + * @function Phaser.Tilemaps.Components.Randomize + * @private + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var Randomize = function (tileX, tileY, width, height, indexes, layer) +{ + var i; + var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + + // If no indicies are given, then find all the unique indexes within the specified region + if (indexes === undefined) + { + indexes = []; + for (i = 0; i < tiles.length; i++) + { + if (indexes.indexOf(tiles[i].index) === -1) + { + indexes.push(tiles[i].index); + } + } + } + + for (i = 0; i < tiles.length; i++) + { + tiles[i].index = GetRandom(indexes); + } +}; + +module.exports = Randomize; + + +/***/ }), +/* 1272 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RemoveTileAt = __webpack_require__(452); +var WorldToTileX = __webpack_require__(61); +var WorldToTileY = __webpack_require__(62); + +/** + * Removes the tile at the given world coordinates in the specified layer and updates the layer's + * collision information. + * + * @function Phaser.Tilemaps.Components.RemoveTileAtWorldXY + * @private + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. + */ +var RemoveTileAtWorldXY = function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer) +{ + var tileX = WorldToTileX(worldX, true, camera, layer); + var tileY = WorldToTileY(worldY, true, camera, layer); + return RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, layer); +}; + +module.exports = RemoveTileAtWorldXY; + + +/***/ }), +/* 1273 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); +var Color = __webpack_require__(326); + +var defaultTileColor = new Color(105, 210, 231, 150); +var defaultCollidingTileColor = new Color(243, 134, 48, 200); +var defaultFaceColor = new Color(40, 39, 37, 150); + +/** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * + * @function Phaser.Tilemaps.Components.RenderDebug + * @private + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. + * @param {object} styleConfig - An object specifying the colors to use for the debug drawing. + * @param {?Phaser.Display.Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at + * non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. + * @param {?Phaser.Display.Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled + * rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. + * @param {?Phaser.Display.Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting + * tile faces. If set to null, interesting tile faces will not be drawn. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var RenderDebug = function (graphics, styleConfig, layer) +{ + if (styleConfig === undefined) { styleConfig = {}; } + + // Default colors without needlessly creating Color objects + var tileColor = (styleConfig.tileColor !== undefined) ? styleConfig.tileColor : defaultTileColor; + var collidingTileColor = (styleConfig.collidingTileColor !== undefined) ? styleConfig.collidingTileColor : defaultCollidingTileColor; + var faceColor = (styleConfig.faceColor !== undefined) ? styleConfig.faceColor : defaultFaceColor; + + var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); + + graphics.translate(layer.tilemapLayer.x, layer.tilemapLayer.y); + graphics.scale(layer.tilemapLayer.scaleX, layer.tilemapLayer.scaleY); + + for (var i = 0; i < tiles.length; i++) + { + var tile = tiles[i]; + + var tw = tile.width; + var th = tile.height; + var x = tile.pixelX; + var y = tile.pixelY; + + var color = tile.collides ? collidingTileColor : tileColor; + + if (color !== null) + { + graphics.fillStyle(color.color, color.alpha / 255); + graphics.fillRect(x, y, tw, th); + } + + // Inset the face line to prevent neighboring tile's lines from overlapping + x += 1; + y += 1; + tw -= 2; + th -= 2; + + if (faceColor !== null) + { + graphics.lineStyle(1, faceColor.color, faceColor.alpha / 255); + + if (tile.faceTop) { graphics.lineBetween(x, y, x + tw, y); } + if (tile.faceRight) { graphics.lineBetween(x + tw, y, x + tw, y + th); } + if (tile.faceBottom) { graphics.lineBetween(x, y + th, x + tw, y + th); } + if (tile.faceLeft) { graphics.lineBetween(x, y, x, y + th); } + } + } +}; + +module.exports = RenderDebug; + + +/***/ }), +/* 1274 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SetTileCollision = __webpack_require__(71); +var CalculateFacesWithin = __webpack_require__(51); +var SetLayerCollisionIndex = __webpack_require__(212); + +/** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * + * @function Phaser.Tilemaps.Components.SetCollision + * @private + * @since 3.0.0 + * + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var SetCollision = function (indexes, collides, recalculateFaces, layer) +{ + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + if (!Array.isArray(indexes)) { indexes = [ indexes ]; } + + // Update the array of colliding indexes + for (var i = 0; i < indexes.length; i++) + { + SetLayerCollisionIndex(indexes[i], collides, layer); + } + + // Update the tiles + for (var ty = 0; ty < layer.height; ty++) + { + for (var tx = 0; tx < layer.width; tx++) + { + var tile = layer.data[ty][tx]; + + if (tile && indexes.indexOf(tile.index) !== -1) + { + SetTileCollision(tile, collides); + } + } + } + + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } +}; + +module.exports = SetCollision; + + +/***/ }), +/* 1275 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SetTileCollision = __webpack_require__(71); +var CalculateFacesWithin = __webpack_require__(51); +var SetLayerCollisionIndex = __webpack_require__(212); + +/** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * + * @function Phaser.Tilemaps.Components.SetCollisionBetween + * @private + * @since 3.0.0 + * + * @param {integer} start - The first index of the tile to be set for collision. + * @param {integer} stop - The last index of the tile to be set for collision. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var SetCollisionBetween = function (start, stop, collides, recalculateFaces, layer) +{ + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + + if (start > stop) { return; } + + // Update the array of colliding indexes + for (var index = start; index <= stop; index++) + { + SetLayerCollisionIndex(index, collides, layer); + } + + // Update the tiles + for (var ty = 0; ty < layer.height; ty++) + { + for (var tx = 0; tx < layer.width; tx++) + { + var tile = layer.data[ty][tx]; + if (tile) + { + if (tile.index >= start && tile.index <= stop) + { + SetTileCollision(tile, collides); + } + } + } + } + + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } +}; + +module.exports = SetCollisionBetween; + + +/***/ }), +/* 1276 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SetTileCollision = __webpack_require__(71); +var CalculateFacesWithin = __webpack_require__(51); +var SetLayerCollisionIndex = __webpack_require__(212); + +/** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). + * + * @function Phaser.Tilemaps.Components.SetCollisionByExclusion + * @private + * @since 3.0.0 + * + * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, layer) +{ + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + if (!Array.isArray(indexes)) { indexes = [ indexes ]; } + + // Note: this only updates layer.collideIndexes for tile indexes found currently in the layer + for (var ty = 0; ty < layer.height; ty++) + { + for (var tx = 0; tx < layer.width; tx++) + { + var tile = layer.data[ty][tx]; + if (tile && indexes.indexOf(tile.index) === -1) + { + SetTileCollision(tile, collides); + SetLayerCollisionIndex(tile.index, collides, layer); + } + } + } + + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } +}; + +module.exports = SetCollisionByExclusion; + + +/***/ }), +/* 1277 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SetTileCollision = __webpack_require__(71); +var CalculateFacesWithin = __webpack_require__(51); +var HasValue = __webpack_require__(97); + +/** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * + * @function Phaser.Tilemaps.Components.SetCollisionByProperty + * @private + * @since 3.0.0 + * + * @param {object} properties - An object with tile properties and corresponding values that should be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var SetCollisionByProperty = function (properties, collides, recalculateFaces, layer) +{ + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + + for (var ty = 0; ty < layer.height; ty++) + { + for (var tx = 0; tx < layer.width; tx++) + { + var tile = layer.data[ty][tx]; + + if (!tile) { continue; } + + for (var property in properties) + { + if (!HasValue(tile.properties, property)) { continue; } + + var values = properties[property]; + if (!Array.isArray(values)) + { + values = [ values ]; + } + + for (var i = 0; i < values.length; i++) + { + if (tile.properties[property] === values[i]) + { + SetTileCollision(tile, collides); + } + } + } + } + } + + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } +}; + +module.exports = SetCollisionByProperty; + + +/***/ }), +/* 1278 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SetTileCollision = __webpack_require__(71); +var CalculateFacesWithin = __webpack_require__(51); + +/** + * Sets collision on the tiles within a layer by checking each tile's collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tile's collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * + * @function Phaser.Tilemaps.Components.SetCollisionFromCollisionGroup + * @private + * @since 3.0.0 + * + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer) +{ + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + + for (var ty = 0; ty < layer.height; ty++) + { + for (var tx = 0; tx < layer.width; tx++) + { + var tile = layer.data[ty][tx]; + + if (!tile) { continue; } + + var collisionGroup = tile.getCollisionGroup(); + + // It's possible in Tiled to have a collision group without any shapes, e.g. create a + // shape and then delete the shape. + if (collisionGroup && collisionGroup.objects && collisionGroup.objects.length > 0) + { + SetTileCollision(tile, collides); + } + } + } + + if (recalculateFaces) + { + CalculateFacesWithin(0, 0, layer.width, layer.height, layer); + } +}; + +module.exports = SetCollisionFromCollisionGroup; + + +/***/ }), +/* 1279 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * + * @function Phaser.Tilemaps.Components.SetTileIndexCallback + * @private + * @since 3.0.0 + * + * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {function} callback - The callback that will be invoked when the tile is collided with. + * @param {object} callbackContext - The context under which the callback is called. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var SetTileIndexCallback = function (indexes, callback, callbackContext, layer) +{ + if (typeof indexes === 'number') + { + layer.callbacks[indexes] = (callback !== null) + ? { callback: callback, callbackContext: callbackContext } + : undefined; + } + else + { + for (var i = 0, len = indexes.length; i < len; i++) + { + layer.callbacks[indexes[i]] = (callback !== null) + ? { callback: callback, callbackContext: callbackContext } + : undefined; + } + } +}; + +module.exports = SetTileIndexCallback; + + +/***/ }), +/* 1280 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); + +/** + * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * + * @function Phaser.Tilemaps.Components.SetTileLocationCallback + * @private + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {function} callback - The callback that will be invoked when the tile is collided with. + * @param {object} callbackContext - The context under which the callback is called. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var SetTileLocationCallback = function (tileX, tileY, width, height, callback, callbackContext, layer) +{ + var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + + for (var i = 0; i < tiles.length; i++) + { + tiles[i].setCollisionCallback(callback, callbackContext); + } + +}; + +module.exports = SetTileLocationCallback; + + +/***/ }), +/* 1281 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); +var ShuffleArray = __webpack_require__(111); + +/** + * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given + * layer. It will only randomize the tiles in that area, so if they're all the same nothing will + * appear to have changed! This method only modifies tile indexes and does not change collision + * information. + * + * @function Phaser.Tilemaps.Components.Shuffle + * @private + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var Shuffle = function (tileX, tileY, width, height, layer) +{ + var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + + var indexes = tiles.map(function (tile) { return tile.index; }); + ShuffleArray(indexes); + + for (var i = 0; i < tiles.length; i++) + { + tiles[i].index = indexes[i]; + } +}; + +module.exports = Shuffle; + + +/***/ }), +/* 1282 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); + +/** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision + * information. + * + * @function Phaser.Tilemaps.Components.SwapByIndex + * @private + * @since 3.0.0 + * + * @param {integer} tileA - First tile index. + * @param {integer} tileB - Second tile index. + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var SwapByIndex = function (indexA, indexB, tileX, tileY, width, height, layer) +{ + var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + for (var i = 0; i < tiles.length; i++) + { + if (tiles[i]) + { + if (tiles[i].index === indexA) + { + tiles[i].index = indexB; + } + else if (tiles[i].index === indexB) + { + tiles[i].index = indexA; + } + } + } +}; + +module.exports = SwapByIndex; + + +/***/ }), +/* 1283 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TileToWorldX = __webpack_require__(138); +var TileToWorldY = __webpack_require__(139); +var Vector2 = __webpack_require__(4); + +/** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.TileToWorldXY + * @private + * @since 3.0.0 + * + * @param {integer} tileX - The x coordinate, in tiles, not pixels. + * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var TileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (point === undefined) { point = new Vector2(0, 0); } + + point.x = TileToWorldX(tileX, camera, layer); + point.y = TileToWorldY(tileY, camera, layer); + + return point; +}; + +module.exports = TileToWorldXY; + + +/***/ }), +/* 1284 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(21); + +/** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. New indexes are drawn from the given + * weightedIndexes array. An example weighted array: + * + * [ + * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 + * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 + * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 + * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 + * ] + * + * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * method only modifies tile indexes and does not change collision information. + * + * @function Phaser.Tilemaps.Components.WeightedRandomize + * @private + * @since 3.0.0 + * + * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. + * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during + * randomization. They should be in the form: { index: 0, weight: 4 } or + * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + */ +var WeightedRandomize = function (tileX, tileY, width, height, weightedIndexes, layer) +{ + if (weightedIndexes === undefined) { return; } + + var i; + var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + + var weightTotal = 0; + for (i = 0; i < weightedIndexes.length; i++) + { + weightTotal += weightedIndexes[i].weight; + } + + if (weightTotal <= 0) { return; } + + for (i = 0; i < tiles.length; i++) + { + var rand = Math.random() * weightTotal; + var sum = 0; + var randomIndex = -1; + for (var j = 0; j < weightedIndexes.length; j++) + { + sum += weightedIndexes[j].weight; + if (rand <= sum) + { + var chosen = weightedIndexes[j].index; + randomIndex = Array.isArray(chosen) + ? chosen[Math.floor(Math.random() * chosen.length)] + : chosen; + break; + } + } + + tiles[i].index = randomIndex; + } +}; + +module.exports = WeightedRandomize; + + +/***/ }), +/* 1285 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var WorldToTileX = __webpack_require__(61); +var WorldToTileY = __webpack_require__(62); +var Vector2 = __webpack_require__(4); + +/** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.WorldToTileXY + * @private + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var WorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (point === undefined) { point = new Vector2(0, 0); } + + point.x = WorldToTileX(worldX, snapToFloor, camera, layer); + point.y = WorldToTileY(worldY, snapToFloor, camera, layer); + + return point; +}; + +module.exports = WorldToTileXY; + + +/***/ }), +/* 1286 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tilemaps.Parsers + */ + +module.exports = { + + Parse: __webpack_require__(453), + Parse2DArray: __webpack_require__(213), + ParseCSV: __webpack_require__(454), + + Impact: __webpack_require__(1287), + Tiled: __webpack_require__(1288) + +}; + + +/***/ }), +/* 1287 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tilemaps.Parsers.Impact + */ + +module.exports = { + + ParseTileLayers: __webpack_require__(467), + ParseTilesets: __webpack_require__(468), + ParseWeltmeister: __webpack_require__(466) + +}; + + +/***/ }), +/* 1288 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tilemaps.Parsers.Tiled + */ + +module.exports = { + + AssignTileProperties: __webpack_require__(465), + Base64Decode: __webpack_require__(457), + BuildTilesetIndex: __webpack_require__(464), + ParseGID: __webpack_require__(214), + ParseImageLayers: __webpack_require__(458), + ParseJSONTiled: __webpack_require__(455), + ParseObject: __webpack_require__(215), + ParseObjectLayers: __webpack_require__(462), + ParseTileLayers: __webpack_require__(456), + ParseTilesets: __webpack_require__(459) + +}; + + +/***/ }), +/* 1289 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(1290); +} + +if (true) +{ + renderCanvas = __webpack_require__(1291); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 1290 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = __webpack_require__(9); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.Tilemaps.DynamicTilemapLayer} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera) +{ + src.cull(camera); + + var renderTiles = src.culledTiles; + var tileCount = renderTiles.length; + var alpha = camera.alpha * src.alpha; + + if (tileCount === 0 || alpha <= 0) + { + return; + } + + var gidMap = src.gidMap; + var pipeline = src.pipeline; + + var getTint = Utils.getTintAppendFloatAlpha; + + var scrollFactorX = src.scrollFactorX; + var scrollFactorY = src.scrollFactorY; + + var x = src.x; + var y = src.y; + + var sx = src.scaleX; + var sy = src.scaleY; + + var tilesets = src.tileset; + + // Loop through each tileset in this layer, drawing just the tiles that are in that set each time + // Doing it this way around allows us to batch tiles using the same tileset + for (var c = 0; c < tilesets.length; c++) + { + var currentSet = tilesets[c]; + var texture = currentSet.glTexture; + + for (var i = 0; i < tileCount; i++) + { + var tile = renderTiles[i]; + + var tileset = gidMap[tile.index]; + + if (tileset !== currentSet) + { + // Skip tiles that aren't in this set + continue; + } + + var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + + if (tileTexCoords === null) + { + continue; + } + + var frameWidth = tile.width; + var frameHeight = tile.height; + + var frameX = tileTexCoords.x; + var frameY = tileTexCoords.y; + + var tw = tile.width * 0.5; + var th = tile.height * 0.5; + + var tint = getTint(tile.tint, alpha * tile.alpha); + + pipeline.batchTexture( + src, + texture, + texture.width, texture.height, + x + ((tw + tile.pixelX) * sx), y + ((th + tile.pixelY) * sy), + tile.width, tile.height, + sx, sy, + tile.rotation, + tile.flipX, tile.flipY, + scrollFactorX, scrollFactorY, + tw, th, + frameX, frameY, frameWidth, frameHeight, + tint, tint, tint, tint, false, + 0, 0, + camera, + null, + true + ); + } + } +}; + +module.exports = DynamicTilemapLayerWebGLRenderer; + + +/***/ }), +/* 1291 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.Tilemaps.DynamicTilemapLayer#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.Tilemaps.DynamicTilemapLayer} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + src.cull(camera); + + var renderTiles = src.culledTiles; + var tileCount = renderTiles.length; + + if (tileCount === 0) + { + return; + } + + var camMatrix = renderer._tempMatrix1; + var layerMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + layerMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + var ctx = renderer.currentContext; + var gidMap = src.gidMap; + + ctx.save(); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + layerMatrix.e = src.x; + layerMatrix.f = src.y; + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(layerMatrix, calcMatrix); + + calcMatrix.copyToContext(ctx); + } + else + { + layerMatrix.e -= camera.scrollX * src.scrollFactorX; + layerMatrix.f -= camera.scrollY * src.scrollFactorY; + + layerMatrix.copyToContext(ctx); + } + + var alpha = camera.alpha * src.alpha; + + for (var i = 0; i < tileCount; i++) + { + var tile = renderTiles[i]; + + var tileset = gidMap[tile.index]; + + if (!tileset) + { + continue; + } + + var image = tileset.image.getSourceImage(); + var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + + if (tileTexCoords) + { + var halfWidth = tile.width / 2; + var halfHeight = tile.height / 2; + + ctx.save(); + + ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); + + if (tile.rotation !== 0) + { + ctx.rotate(tile.rotation); + } + + if (tile.flipX || tile.flipY) + { + ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); + } + + ctx.globalAlpha = alpha * tile.alpha; + + ctx.drawImage( + image, + tileTexCoords.x, tileTexCoords.y, + tile.width, tile.height, + -halfWidth, -halfHeight, + tile.width, tile.height + ); + + ctx.restore(); + } + } + + ctx.restore(); +}; + +module.exports = DynamicTilemapLayerCanvasRenderer; + + +/***/ }), +/* 1292 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(1293); +} + +if (true) +{ + renderCanvas = __webpack_require__(1294); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 1293 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * A Static Tilemap Layer renders immediately and does not use any batching. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.Tilemaps.StaticTilemapLayer} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var StaticTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera) +{ + var tilesets = src.tileset; + + var pipeline = src.pipeline; + var pipelineVertexBuffer = pipeline.vertexBuffer; + + renderer.setPipeline(pipeline); + + pipeline.modelIdentity(); + pipeline.modelTranslate(src.x - (camera.scrollX * src.scrollFactorX), src.y - (camera.scrollY * src.scrollFactorY), 0); + pipeline.modelScale(src.scaleX, src.scaleY, 1); + pipeline.viewLoad2D(camera.matrix.matrix); + + for (var i = 0; i < tilesets.length; i++) + { + src.upload(camera, i); + + if (src.vertexCount[i] > 0) + { + if (renderer.currentPipeline && renderer.currentPipeline.vertexCount > 0) + { + renderer.flush(); + } + + pipeline.vertexBuffer = src.vertexBuffer[i]; + + renderer.setPipeline(pipeline); + + renderer.setTexture2D(tilesets[i].glTexture, 0); + + renderer.gl.drawArrays(pipeline.topology, 0, src.vertexCount[i]); + } + } + + // Restore the pipeline + pipeline.vertexBuffer = pipelineVertexBuffer; + + pipeline.viewIdentity(); + pipeline.modelIdentity(); +}; + +module.exports = StaticTilemapLayerWebGLRenderer; + + +/***/ }), +/* 1294 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.Tilemaps.StaticTilemapLayer#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.Tilemaps.StaticTilemapLayer} src - The Game Object being rendered in this call. + * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +{ + src.cull(camera); + + var renderTiles = src.culledTiles; + var tileCount = renderTiles.length; + + if (tileCount === 0) + { + return; + } + + var camMatrix = renderer._tempMatrix1; + var layerMatrix = renderer._tempMatrix2; + var calcMatrix = renderer._tempMatrix3; + + layerMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + var ctx = renderer.currentContext; + var gidMap = src.gidMap; + + ctx.save(); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + layerMatrix.e = src.x; + layerMatrix.f = src.y; + + camMatrix.multiply(layerMatrix, calcMatrix); + + calcMatrix.copyToContext(ctx); + } + else + { + // Undo the camera scroll + layerMatrix.e -= camera.scrollX * src.scrollFactorX; + layerMatrix.f -= camera.scrollY * src.scrollFactorY; + + layerMatrix.copyToContext(ctx); + } + + var alpha = camera.alpha * src.alpha; + + ctx.globalAlpha = camera.alpha * src.alpha; + + for (var i = 0; i < tileCount; i++) + { + var tile = renderTiles[i]; + + var tileset = gidMap[tile.index]; + + if (!tileset) + { + continue; + } + + var image = tileset.image.getSourceImage(); + var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + + if (tileTexCoords) + { + var tileWidth = tileset.tileWidth; + var tileHeight = tileset.tileHeight; + var halfWidth = tileWidth / 2; + var halfHeight = tileHeight / 2; + + ctx.save(); + + ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); + + if (tile.rotation !== 0) + { + ctx.rotate(tile.rotation); + } + + if (tile.flipX || tile.flipY) + { + ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); + } + + ctx.globalAlpha = alpha * tile.alpha; + + ctx.drawImage( + image, + tileTexCoords.x, tileTexCoords.y, + tileWidth, tileHeight, + -halfWidth, -halfHeight, + tileWidth, tileHeight + ); + + ctx.restore(); + } + } + + ctx.restore(); +}; + +module.exports = StaticTilemapLayerCanvasRenderer; + + +/***/ }), +/* 1295 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectCreator = __webpack_require__(15); +var ParseToTilemap = __webpack_require__(216); + +/** + * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. + * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing + * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map + * data. For an empty map, you should specify tileWidth, tileHeight, width & height. + * + * @method Phaser.GameObjects.GameObjectCreator#tilemap + * @since 3.0.0 + * + * @param {Phaser.Types.Tilemaps.TilemapConfig} [config] - The config options for the Tilemap. + * + * @return {Phaser.Tilemaps.Tilemap} + */ +GameObjectCreator.register('tilemap', function (config) +{ + // Defaults are applied in ParseToTilemap + var c = (config !== undefined) ? config : {}; + + return ParseToTilemap( + this.scene, + c.key, + c.tileWidth, + c.tileHeight, + c.width, + c.height, + c.data, + c.insertNull + ); +}); + + +/***/ }), +/* 1296 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = __webpack_require__(5); +var ParseToTilemap = __webpack_require__(216); + +/** + * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. + * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing + * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map + * data. For an empty map, you should specify tileWidth, tileHeight, width & height. + * + * @method Phaser.GameObjects.GameObjectFactory#tilemap + * @since 3.0.0 + * + * @param {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data. + * @param {integer} [tileWidth=32] - The width of a tile in pixels. Pass in `null` to leave as the + * default. + * @param {integer} [tileHeight=32] - The height of a tile in pixels. Pass in `null` to leave as the + * default. + * @param {integer} [width=10] - The width of the map in tiles. Pass in `null` to leave as the + * default. + * @param {integer} [height=10] - The height of the map in tiles. Pass in `null` to leave as the + * default. + * @param {integer[][]} [data] - Instead of loading from the cache, you can also load directly from + * a 2D array of tile indexes. Pass in `null` for no data. + * @param {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, in the + * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. + * + * @return {Phaser.Tilemaps.Tilemap} + */ +GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, width, height, data, insertNull) +{ + // Allow users to specify null to indicate that they want the default value, since null is + // shorter & more legible than undefined. Convert null to undefined to allow ParseToTilemap + // defaults to take effect. + + if (key === null) { key = undefined; } + if (tileWidth === null) { tileWidth = undefined; } + if (tileHeight === null) { tileHeight = undefined; } + if (width === null) { width = undefined; } + if (height === null) { height = undefined; } + + return ParseToTilemap(this.scene, key, tileWidth, tileHeight, width, height, data, insertNull); +}); + +// When registering a factory function 'this' refers to the GameObjectFactory context. +// +// There are several properties available to use: +// +// this.scene - a reference to the Scene that owns the GameObjectFactory +// this.displayList - a reference to the Display List the Scene owns +// this.updateList - a reference to the Update List the Scene owns + + +/***/ }), +/* 1297 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Time + */ + +module.exports = { + + Clock: __webpack_require__(1298), + TimerEvent: __webpack_require__(472) + +}; + + +/***/ }), +/* 1298 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var TimerEvent = __webpack_require__(472); + +/** + * @classdesc + * The Clock is a Scene plugin which creates and updates Timer Events for its Scene. + * + * @class Clock + * @memberof Phaser.Time + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene which owns this Clock. + */ +var Clock = new Class({ + + initialize: + + function Clock (scene) + { + /** + * The Scene which owns this Clock. + * + * @name Phaser.Time.Clock#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * The Scene Systems object of the Scene which owns this Clock. + * + * @name Phaser.Time.Clock#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * The current time of the Clock, in milliseconds. + * + * If accessed externally, this is equivalent to the `time` parameter normally passed to a Scene's `update` method. + * + * @name Phaser.Time.Clock#now + * @type {number} + * @since 3.0.0 + */ + this.now = 0; + + // Scale the delta time coming into the Clock by this factor + // which then influences anything using this Clock for calculations, like TimerEvents + + /** + * The scale of the Clock's time delta. + * + * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Clock and anything which uses it, such as its Timer Events. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing the Clock. + * + * @name Phaser.Time.Clock#timeScale + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.timeScale = 1; + + /** + * Whether the Clock is paused (`true`) or active (`false`). + * + * When paused, the Clock will not update any of its Timer Events, thus freezing time. + * + * @name Phaser.Time.Clock#paused + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.paused = false; + + /** + * An array of all Timer Events whose delays haven't expired - these are actively updating Timer Events. + * + * @name Phaser.Time.Clock#_active + * @type {Phaser.Time.TimerEvent[]} + * @private + * @default [] + * @since 3.0.0 + */ + this._active = []; + + /** + * An array of all Timer Events which will be added to the Clock at the start of the frame. + * + * @name Phaser.Time.Clock#_pendingInsertion + * @type {Phaser.Time.TimerEvent[]} + * @private + * @default [] + * @since 3.0.0 + */ + this._pendingInsertion = []; + + /** + * An array of all Timer Events which will be removed from the Clock at the start of the frame. + * + * @name Phaser.Time.Clock#_pendingRemoval + * @type {Phaser.Time.TimerEvent[]} + * @private + * @default [] + * @since 3.0.0 + */ + this._pendingRemoval = []; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Time.Clock#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + // Sync with the TimeStep + this.now = this.systems.game.loop.time; + + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Time.Clock#start + * @private + * @since 3.5.0 + */ + start: function () + { + var eventEmitter = this.systems.events; + + eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this); + eventEmitter.on(SceneEvents.UPDATE, this.update, this); + eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * Creates a Timer Event and adds it to the Clock at the start of the frame. + * + * @method Phaser.Time.Clock#addEvent + * @since 3.0.0 + * + * @param {Phaser.Types.Time.TimerEventConfig} config - The configuration for the Timer Event. + * + * @return {Phaser.Time.TimerEvent} The Timer Event which was created. + */ + addEvent: function (config) + { + var event = new TimerEvent(config); + + this._pendingInsertion.push(event); + + return event; + }, + + /** + * Creates a Timer Event and adds it to the Clock at the start of the frame. + * + * This is a shortcut for {@link #addEvent} which can be shorter and is compatible with the syntax of the GreenSock Animation Platform (GSAP). + * + * @method Phaser.Time.Clock#delayedCall + * @since 3.0.0 + * + * @param {number} delay - The delay of the function call, in milliseconds. + * @param {function} callback - The function to call after the delay expires. + * @param {Array.<*>} args - The arguments to call the function with. + * @param {*} callbackScope - The scope (`this` object) to call the function with. + * + * @return {Phaser.Time.TimerEvent} The Timer Event which was created. + */ + delayedCall: function (delay, callback, args, callbackScope) + { + return this.addEvent({ delay: delay, callback: callback, args: args, callbackScope: callbackScope }); + }, + + /** + * Clears and recreates the array of pending Timer Events. + * + * @method Phaser.Time.Clock#clearPendingEvents + * @since 3.0.0 + * + * @return {Phaser.Time.Clock} This Clock object. + */ + clearPendingEvents: function () + { + this._pendingInsertion = []; + + return this; + }, + + /** + * Schedules all active Timer Events for removal at the start of the frame. + * + * @method Phaser.Time.Clock#removeAllEvents + * @since 3.0.0 + * + * @return {Phaser.Time.Clock} This Clock object. + */ + removeAllEvents: function () + { + this._pendingRemoval = this._pendingRemoval.concat(this._active); + + return this; + }, + + /** + * Updates the arrays of active and pending Timer Events. Called at the start of the frame. + * + * @method Phaser.Time.Clock#preUpdate + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + preUpdate: function () + { + var toRemove = this._pendingRemoval.length; + var toInsert = this._pendingInsertion.length; + + if (toRemove === 0 && toInsert === 0) + { + // Quick bail + return; + } + + var i; + var event; + + // Delete old events + for (i = 0; i < toRemove; i++) + { + event = this._pendingRemoval[i]; + + var index = this._active.indexOf(event); + + if (index > -1) + { + this._active.splice(index, 1); + } + + // Pool them? + event.destroy(); + } + + for (i = 0; i < toInsert; i++) + { + event = this._pendingInsertion[i]; + + this._active.push(event); + } + + // Clear the lists + this._pendingRemoval.length = 0; + this._pendingInsertion.length = 0; + }, + + /** + * Updates the Clock's internal time and all of its Timer Events. + * + * @method Phaser.Time.Clock#update + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update: function (time, delta) + { + this.now = time; + + if (this.paused) + { + return; + } + + delta *= this.timeScale; + + for (var i = 0; i < this._active.length; i++) + { + var event = this._active[i]; + + if (event.paused) + { + continue; + } + + // Use delta time to increase elapsed. + // Avoids needing to adjust for pause / resume. + // Automatically smoothed by TimeStep class. + // In testing accurate to +- 1ms! + event.elapsed += delta * event.timeScale; + + if (event.elapsed >= event.delay) + { + var remainder = event.elapsed - event.delay; + + // Limit it, in case it's checked in the callback + event.elapsed = event.delay; + + // Process the event + if (!event.hasDispatched && event.callback) + { + event.hasDispatched = true; + event.callback.apply(event.callbackScope, event.args); + } + + if (event.repeatCount > 0) + { + event.repeatCount--; + + event.elapsed = remainder; + event.hasDispatched = false; + } + else + { + this._pendingRemoval.push(event); + } + } + } + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.Time.Clock#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + var i; + + for (i = 0; i < this._pendingInsertion.length; i++) + { + this._pendingInsertion[i].destroy(); + } + + for (i = 0; i < this._active.length; i++) + { + this._active[i].destroy(); + } + + for (i = 0; i < this._pendingRemoval.length; i++) + { + this._pendingRemoval[i].destroy(); + } + + this._active.length = 0; + this._pendingRemoval.length = 0; + this._pendingInsertion.length = 0; + + var eventEmitter = this.systems.events; + + eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this); + eventEmitter.off(SceneEvents.UPDATE, this.update, this); + eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.Time.Clock#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + } + +}); + +PluginCache.register('Clock', Clock, 'time'); + +module.exports = Clock; + + +/***/ }), +/* 1299 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(88); +var Extend = __webpack_require__(17); + +/** + * @namespace Phaser.Tweens + */ + +var Tweens = { + + Builders: __webpack_require__(1300), + Events: __webpack_require__(478), + + TweenManager: __webpack_require__(1308), + Tween: __webpack_require__(220), + TweenData: __webpack_require__(221), + Timeline: __webpack_require__(477) + +}; + +// Merge in the consts +Tweens = Extend(false, Tweens, CONST); + +module.exports = Tweens; + + +/***/ }), +/* 1300 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tweens.Builders + */ + +module.exports = { + + GetBoolean: __webpack_require__(87), + GetEaseFunction: __webpack_require__(96), + GetNewValue: __webpack_require__(141), + GetProps: __webpack_require__(473), + GetTargets: __webpack_require__(217), + GetTweens: __webpack_require__(474), + GetValueOp: __webpack_require__(218), + NumberTweenBuilder: __webpack_require__(475), + TimelineBuilder: __webpack_require__(476), + TweenBuilder: __webpack_require__(142) + +}; + + +/***/ }), +/* 1301 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// RESERVED properties that a Tween config object uses + +// completeDelay: The time the tween will wait before the onComplete event is dispatched once it has completed +// delay: The time the tween will wait before it first starts +// duration: The duration of the tween +// ease: The ease function used by the tween +// easeParams: The parameters to go with the ease function (if any) +// flipX: flip X the GameObject on tween end +// flipY: flip Y the GameObject on tween end// hold: The time the tween will pause before running a yoyo +// hold: The time the tween will pause before running a yoyo +// loop: The time the tween will pause before starting either a yoyo or returning to the start for a repeat +// loopDelay: +// offset: Used when the Tween is part of a Timeline +// paused: Does the tween start in a paused state, or playing? +// props: The properties being tweened by the tween +// repeat: The number of times the tween will repeat itself (a value of 1 means the tween will play twice, as it repeated once) +// repeatDelay: The time the tween will pause for before starting a repeat. The tween holds in the start state. +// targets: The targets the tween is updating. +// useFrames: Use frames or milliseconds? +// yoyo: boolean - Does the tween reverse itself (yoyo) when it reaches the end? + +module.exports = [ + 'callbackScope', + 'completeDelay', + 'delay', + 'duration', + 'ease', + 'easeParams', + 'flipX', + 'flipY', + 'hold', + 'loop', + 'loopDelay', + 'offset', + 'onComplete', + 'onCompleteParams', + 'onCompleteScope', + 'onLoop', + 'onLoopParams', + 'onLoopScope', + 'onRepeat', + 'onRepeatParams', + 'onRepeatScope', + 'onStart', + 'onStartParams', + 'onStartScope', + 'onUpdate', + 'onUpdateParams', + 'onUpdateScope', + 'onYoyo', + 'onYoyoParams', + 'onYoyoScope', + 'paused', + 'props', + 'repeat', + 'repeatDelay', + 'targets', + 'useFrames', + 'yoyo' +]; + + +/***/ }), +/* 1302 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Timeline Complete Event. + * + * This event is dispatched by a Tween Timeline when it completes playback. + * + * Listen to it from a Timeline instance using `Timeline.on('complete', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('complete', listener); + * timeline.play(); + * ``` + * + * @event Phaser.Tweens.Events#TIMELINE_COMPLETE + * @since 3.0.0 + * + * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. + */ +module.exports = 'complete'; + + +/***/ }), +/* 1303 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Timeline Loop Event. + * + * This event is dispatched by a Tween Timeline every time it loops. + * + * Listen to it from a Timeline instance using `Timeline.on('loop', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * loop: 4, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('loop', listener); + * timeline.play(); + * ``` + * + * @event Phaser.Tweens.Events#TIMELINE_LOOP + * @since 3.0.0 + * + * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. + * @param {integer} loopCount - The number of loops left before this Timeline completes. + */ +module.exports = 'loop'; + + +/***/ }), +/* 1304 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Timeline Pause Event. + * + * This event is dispatched by a Tween Timeline when it is paused. + * + * Listen to it from a Timeline instance using `Timeline.on('pause', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('pause', listener); + * // At some point later ... + * timeline.pause(); + * ``` + * + * @event Phaser.Tweens.Events#TIMELINE_PAUSE + * @since 3.0.0 + * + * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. + */ +module.exports = 'pause'; + + +/***/ }), +/* 1305 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Timeline Resume Event. + * + * This event is dispatched by a Tween Timeline when it is resumed from a paused state. + * + * Listen to it from a Timeline instance using `Timeline.on('resume', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('resume', listener); + * // At some point later ... + * timeline.resume(); + * ``` + * + * @event Phaser.Tweens.Events#TIMELINE_RESUME + * @since 3.0.0 + * + * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. + */ +module.exports = 'resume'; + + +/***/ }), +/* 1306 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Timeline Start Event. + * + * This event is dispatched by a Tween Timeline when it starts. + * + * Listen to it from a Timeline instance using `Timeline.on('start', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('start', listener); + * timeline.play(); + * ``` + * + * @event Phaser.Tweens.Events#TIMELINE_START + * @since 3.0.0 + * + * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. + */ +module.exports = 'start'; + + +/***/ }), +/* 1307 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Timeline Update Event. + * + * This event is dispatched by a Tween Timeline every time it updates, which can happen a lot of times per second, + * so be careful about listening to this event unless you absolutely require it. + * + * Listen to it from a Timeline instance using `Timeline.on('update', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('update', listener); + * timeline.play(); + * ``` + * + * @event Phaser.Tweens.Events#TIMELINE_UPDATE + * @since 3.0.0 + * + * @param {Phaser.Tweens.Timeline} timeline - A reference to the Timeline instance that emitted the event. + */ +module.exports = 'update'; + + +/***/ }), +/* 1308 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArrayRemove = __webpack_require__(120); +var Class = __webpack_require__(0); +var NumberTweenBuilder = __webpack_require__(475); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var TimelineBuilder = __webpack_require__(476); +var TWEEN_CONST = __webpack_require__(88); +var TweenBuilder = __webpack_require__(142); + +/** + * @classdesc + * The Tween Manager is a default Scene Plugin which controls and updates Tweens and Timelines. + * + * @class TweenManager + * @memberof Phaser.Tweens + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene which owns this Tween Manager. + */ +var TweenManager = new Class({ + + initialize: + + function TweenManager (scene) + { + /** + * The Scene which owns this Tween Manager. + * + * @name Phaser.Tweens.TweenManager#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * The Systems object of the Scene which owns this Tween Manager. + * + * @name Phaser.Tweens.TweenManager#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * The time scale of the Tween Manager. + * + * This value scales the time delta between two frames, thus influencing the speed of time for all Tweens owned by this Tween Manager. + * + * @name Phaser.Tweens.TweenManager#timeScale + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.timeScale = 1; + + /** + * An array of Tweens and Timelines which will be added to the Tween Manager at the start of the frame. + * + * @name Phaser.Tweens.TweenManager#_add + * @type {array} + * @private + * @since 3.0.0 + */ + this._add = []; + + /** + * An array of Tweens and Timelines pending to be later added to the Tween Manager. + * + * @name Phaser.Tweens.TweenManager#_pending + * @type {array} + * @private + * @since 3.0.0 + */ + this._pending = []; + + /** + * An array of Tweens and Timelines which are still incomplete and are actively processed by the Tween Manager. + * + * @name Phaser.Tweens.TweenManager#_active + * @type {array} + * @private + * @since 3.0.0 + */ + this._active = []; + + /** + * An array of Tweens and Timelines which will be removed from the Tween Manager at the start of the frame. + * + * @name Phaser.Tweens.TweenManager#_destroy + * @type {array} + * @private + * @since 3.0.0 + */ + this._destroy = []; + + /** + * The number of Tweens and Timelines which need to be processed by the Tween Manager at the start of the frame. + * + * @name Phaser.Tweens.TweenManager#_toProcess + * @type {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + this._toProcess = 0; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Tweens.TweenManager#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Tweens.TweenManager#start + * @private + * @since 3.5.0 + */ + start: function () + { + var eventEmitter = this.systems.events; + + eventEmitter.on(SceneEvents.PRE_UPDATE, this.preUpdate, this); + eventEmitter.on(SceneEvents.UPDATE, this.update, this); + eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); + + this.timeScale = 1; + }, + + /** + * Create a Tween Timeline and return it, but do NOT add it to the active or pending Tween lists. + * + * @method Phaser.Tweens.TweenManager#createTimeline + * @since 3.0.0 + * + * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline and its Tweens. + * + * @return {Phaser.Tweens.Timeline} The created Timeline object. + */ + createTimeline: function (config) + { + return TimelineBuilder(this, config); + }, + + /** + * Create a Tween Timeline and add it to the active Tween list/ + * + * @method Phaser.Tweens.TweenManager#timeline + * @since 3.0.0 + * + * @param {Phaser.Types.Tweens.TimelineBuilderConfig} config - The configuration object for the Timeline and its Tweens. + * + * @return {Phaser.Tweens.Timeline} The created Timeline object. + */ + timeline: function (config) + { + var timeline = TimelineBuilder(this, config); + + if (!timeline.paused) + { + this._add.push(timeline); + + this._toProcess++; + } + + return timeline; + }, + + /** + * Create a Tween and return it, but do NOT add it to the active or pending Tween lists. + * + * @method Phaser.Tweens.TweenManager#create + * @since 3.0.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The configuration object for the Tween. + * + * @return {Phaser.Tweens.Tween} The created Tween object. + */ + create: function (config) + { + return TweenBuilder(this, config); + }, + + /** + * Create a Tween and add it to the active Tween list. + * + * @method Phaser.Tweens.TweenManager#add + * @since 3.0.0 + * + * @param {Phaser.Types.Tweens.TweenBuilderConfig|object} config - The configuration object for the Tween. + * + * @return {Phaser.Tweens.Tween} The created Tween. + */ + add: function (config) + { + var tween = TweenBuilder(this, config); + + this._add.push(tween); + + this._toProcess++; + + return tween; + }, + + /** + * Add an existing tween into the active Tween list. + * + * @method Phaser.Tweens.TweenManager#existing + * @since 3.0.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to add. + * + * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + */ + existing: function (tween) + { + this._add.push(tween); + + this._toProcess++; + + return this; + }, + + /** + * Create a Number Tween and add it to the active Tween list. + * + * @method Phaser.Tweens.TweenManager#addCounter + * @since 3.0.0 + * + * @param {Phaser.Types.Tweens.NumberTweenBuilderConfig} config - The configuration object for the Number Tween. + * + * @return {Phaser.Tweens.Tween} The created Number Tween. + */ + addCounter: function (config) + { + var tween = NumberTweenBuilder(this, config); + + this._add.push(tween); + + this._toProcess++; + + return tween; + }, + + /** + * Updates the Tween Manager's internal lists at the start of the frame. + * + * This method will return immediately if no changes have been indicated. + * + * @method Phaser.Tweens.TweenManager#preUpdate + * @since 3.0.0 + */ + preUpdate: function () + { + if (this._toProcess === 0) + { + // Quick bail + return; + } + + var list = this._destroy; + var active = this._active; + var pending = this._pending; + var i; + var tween; + + // Clear the 'destroy' list + for (i = 0; i < list.length; i++) + { + tween = list[i]; + + // Remove from the 'active' array + var idx = active.indexOf(tween); + + if (idx === -1) + { + // Not in the active array, is it in pending instead? + idx = pending.indexOf(tween); + + if (idx > -1) + { + tween.state = TWEEN_CONST.REMOVED; + pending.splice(idx, 1); + } + } + else + { + tween.state = TWEEN_CONST.REMOVED; + active.splice(idx, 1); + } + } + + list.length = 0; + + // Process the addition list + // This stops callbacks and out of sync events from populating the active array mid-way during the update + + list = this._add; + + for (i = 0; i < list.length; i++) + { + tween = list[i]; + + if (tween.state === TWEEN_CONST.PENDING_ADD) + { + // Return true if the Tween should be started right away, otherwise false + if (tween.init()) + { + tween.play(); + + this._active.push(tween); + } + else + { + this._pending.push(tween); + } + } + } + + list.length = 0; + + this._toProcess = 0; + }, + + /** + * Updates all Tweens and Timelines of the Tween Manager. + * + * @method Phaser.Tweens.TweenManager#update + * @since 3.0.0 + * + * @param {number} timestamp - The current time in milliseconds. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update: function (timestamp, delta) + { + // Process active tweens + var list = this._active; + var tween; + + // Scale the delta + delta *= this.timeScale; + + for (var i = 0; i < list.length; i++) + { + tween = list[i]; + + // If Tween.update returns 'true' then it means it has completed, + // so move it to the destroy list + if (tween.update(timestamp, delta)) + { + this._destroy.push(tween); + this._toProcess++; + } + } + }, + + /** + * Removes the given tween from the Tween Manager, regardless of its state (pending or active). + * + * @method Phaser.Tweens.TweenManager#remove + * @since 3.17.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to be removed. + * + * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + */ + remove: function (tween) + { + ArrayRemove(this._add, tween); + ArrayRemove(this._pending, tween); + ArrayRemove(this._active, tween); + ArrayRemove(this._destroy, tween); + + tween.state = TWEEN_CONST.REMOVED; + + return this; + }, + + /** + * Checks if a Tween or Timeline is active and adds it to the Tween Manager at the start of the frame if it isn't. + * + * @method Phaser.Tweens.TweenManager#makeActive + * @since 3.0.0 + * + * @param {Phaser.Tweens.Tween} tween - The Tween to check. + * + * @return {Phaser.Tweens.TweenManager} This Tween Manager object. + */ + makeActive: function (tween) + { + if (this._add.indexOf(tween) !== -1 || this._active.indexOf(tween) !== -1) + { + return this; + } + + var idx = this._pending.indexOf(tween); + + if (idx !== -1) + { + this._pending.splice(idx, 1); + } + + this._add.push(tween); + + tween.state = TWEEN_CONST.PENDING_ADD; + + this._toProcess++; + + return this; + }, + + /** + * Passes all Tweens to the given callback. + * + * @method Phaser.Tweens.TweenManager#each + * @since 3.0.0 + * + * @param {function} callback - The function to call. + * @param {object} [scope] - The scope (`this` object) to call the function with. + * @param {...*} [args] - The arguments to pass into the function. Its first argument will always be the Tween currently being iterated. + */ + each: function (callback, scope) + { + var args = [ null ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var texture in this.list) + { + args[0] = this.list[texture]; + + callback.apply(scope, args); + } + }, + + /** + * Returns an array of all active Tweens and Timelines in the Tween Manager. + * + * @method Phaser.Tweens.TweenManager#getAllTweens + * @since 3.0.0 + * + * @return {Phaser.Tweens.Tween[]} A new array containing references to all active Tweens and Timelines. + */ + getAllTweens: function () + { + var list = this._active; + var output = []; + + for (var i = 0; i < list.length; i++) + { + output.push(list[i]); + } + + return output; + }, + + /** + * Returns the scale of the time delta for all Tweens and Timelines owned by this Tween Manager. + * + * @method Phaser.Tweens.TweenManager#getGlobalTimeScale + * @since 3.0.0 + * + * @return {number} The scale of the time delta, usually 1. + */ + getGlobalTimeScale: function () + { + return this.timeScale; + }, + + /** + * Returns an array of all Tweens or Timelines in the Tween Manager which affect the given target or array of targets. + * + * @method Phaser.Tweens.TweenManager#getTweensOf + * @since 3.0.0 + * + * @param {(object|array)} target - The target to look for. Provide an array to look for multiple targets. + * + * @return {Phaser.Tweens.Tween[]} A new array containing all Tweens and Timelines which affect the given target(s). + */ + getTweensOf: function (target) + { + var list = this._active; + var tween; + var output = []; + var i; + + if (Array.isArray(target)) + { + for (i = 0; i < list.length; i++) + { + tween = list[i]; + + for (var t = 0; t < target.length; t++) + { + if (tween.hasTarget(target[t])) + { + output.push(tween); + } + } + } + } + else + { + for (i = 0; i < list.length; i++) + { + tween = list[i]; + + if (tween.hasTarget(target)) + { + output.push(tween); + } + } + } + + return output; + }, + + /** + * Checks if the given object is being affected by a playing Tween. + * + * @method Phaser.Tweens.TweenManager#isTweening + * @since 3.0.0 + * + * @param {object} target - target Phaser.Tweens.Tween object + * + * @return {boolean} returns if target tween object is active or not + */ + isTweening: function (target) + { + var list = this._active; + var tween; + + for (var i = 0; i < list.length; i++) + { + tween = list[i]; + + if (tween.hasTarget(target) && tween.isPlaying()) + { + return true; + } + } + + return false; + }, + + /** + * Stops all Tweens in this Tween Manager. They will be removed at the start of the frame. + * + * @method Phaser.Tweens.TweenManager#killAll + * @since 3.0.0 + * + * @return {Phaser.Tweens.TweenManager} This Tween Manager. + */ + killAll: function () + { + var tweens = this.getAllTweens(); + + for (var i = 0; i < tweens.length; i++) + { + tweens[i].stop(); + } + + return this; + }, + + /** + * Stops all Tweens which affect the given target or array of targets. The Tweens will be removed from the Tween Manager at the start of the frame. + * + * @see {@link #getTweensOf} + * + * @method Phaser.Tweens.TweenManager#killTweensOf + * @since 3.0.0 + * + * @param {(object|array)} target - The target to look for. Provide an array to look for multiple targets. + * + * @return {Phaser.Tweens.TweenManager} This Tween Manager. + */ + killTweensOf: function (target) + { + var tweens = this.getTweensOf(target); + + for (var i = 0; i < tweens.length; i++) + { + tweens[i].stop(); + } + + return this; + }, + + /** + * Pauses all Tweens in this Tween Manager. + * + * @method Phaser.Tweens.TweenManager#pauseAll + * @since 3.0.0 + * + * @return {Phaser.Tweens.TweenManager} This Tween Manager. + */ + pauseAll: function () + { + var list = this._active; + + for (var i = 0; i < list.length; i++) + { + list[i].pause(); + } + + return this; + }, + + /** + * Resumes all Tweens in this Tween Manager. + * + * @method Phaser.Tweens.TweenManager#resumeAll + * @since 3.0.0 + * + * @return {Phaser.Tweens.TweenManager} This Tween Manager. + */ + resumeAll: function () + { + var list = this._active; + + for (var i = 0; i < list.length; i++) + { + list[i].resume(); + } + + return this; + }, + + /** + * Sets a new scale of the time delta for this Tween Manager. + * + * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Tween Manager and all Tweens it owns. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing all Tweens. + * + * @method Phaser.Tweens.TweenManager#setGlobalTimeScale + * @since 3.0.0 + * + * @param {number} value - The new scale of the time delta, where 1 is the normal speed. + * + * @return {Phaser.Tweens.TweenManager} This Tween Manager. + */ + setGlobalTimeScale: function (value) + { + this.timeScale = value; + + return this; + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.Tweens.TweenManager#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + this.killAll(); + + this._add = []; + this._pending = []; + this._active = []; + this._destroy = []; + + this._toProcess = 0; + + var eventEmitter = this.systems.events; + + eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this); + eventEmitter.off(SceneEvents.UPDATE, this.update, this); + eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.Tweens.TweenManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + } + +}); + +PluginCache.register('TweenManager', TweenManager, 'tweens'); + +module.exports = TweenManager; + + +/***/ }), +/* 1309 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils + */ + +module.exports = { + + Array: __webpack_require__(178), + Base64: __webpack_require__(1310), + Objects: __webpack_require__(1312), + String: __webpack_require__(1316) + +}; + + +/***/ }), +/* 1310 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.Base64 + */ + +module.exports = { + + ArrayBufferToBase64: __webpack_require__(1311), + Base64ToArrayBuffer: __webpack_require__(358) + +}; + + +/***/ }), +/* 1311 */ +/***/ (function(module, exports) { + +/** + * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +/** + * Converts an ArrayBuffer into a base64 string. + * + * The resulting string can optionally be a data uri if the `mediaType` argument is provided. + * + * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs for more details. + * + * @function Phaser.Utils.Base64.ArrayBufferToBase64 + * @since 3.18.0 + * + * @param {ArrayBuffer} arrayBuffer - The Array Buffer to encode. + * @param {string} [mediaType] - An optional media type, i.e. `audio/ogg` or `image/jpeg`. If included the resulting string will be a data URI. + * + * @return {string} The base64 encoded Array Buffer. + */ +var ArrayBufferToBase64 = function (arrayBuffer, mediaType) +{ + var bytes = new Uint8Array(arrayBuffer); + var len = bytes.length; + + var base64 = (mediaType) ? 'data:' + mediaType + ';base64,' : ''; + + for (var i = 0; i < len; i += 3) + { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + + if ((len % 3) === 2) + { + base64 = base64.substring(0, base64.length - 1) + '='; + } + else if (len % 3 === 1) + { + base64 = base64.substring(0, base64.length - 2) + '=='; + } + + return base64; +}; + +module.exports = ArrayBufferToBase64; + + +/***/ }), +/* 1312 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.Objects + */ + +module.exports = { + + Clone: __webpack_require__(64), + Extend: __webpack_require__(17), + GetAdvancedValue: __webpack_require__(14), + GetFastValue: __webpack_require__(2), + GetMinMaxValue: __webpack_require__(1313), + GetValue: __webpack_require__(6), + HasAll: __webpack_require__(1314), + HasAny: __webpack_require__(377), + HasValue: __webpack_require__(97), + IsPlainObject: __webpack_require__(7), + Merge: __webpack_require__(85), + MergeRight: __webpack_require__(1315), + Pick: __webpack_require__(461), + SetValue: __webpack_require__(398) + +}; + + +/***/ }), +/* 1313 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetValue = __webpack_require__(6); +var Clamp = __webpack_require__(22); + +/** + * Retrieves and clamps a numerical value from an object. + * + * @function Phaser.Utils.Objects.GetMinMaxValue + * @since 3.0.0 + * + * @param {object} source - The object to retrieve the value from. + * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`). + * @param {number} min - The minimum value which can be returned. + * @param {number} max - The maximum value which can be returned. + * @param {number} defaultValue - The value to return if the property doesn't exist. It's also constrained to the given bounds. + * + * @return {number} The clamped value from the `source` object. + */ +var GetMinMaxValue = function (source, key, min, max, defaultValue) +{ + if (defaultValue === undefined) { defaultValue = min; } + + var value = GetValue(source, key, defaultValue); + + return Clamp(value, min, max); +}; + +module.exports = GetMinMaxValue; + + +/***/ }), +/* 1314 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Verifies that an object contains all requested keys + * + * @function Phaser.Utils.Objects.HasAll + * @since 3.0.0 + * + * @param {object} source - an object on which to check for key existence + * @param {string[]} keys - an array of keys to ensure the source object contains + * + * @return {boolean} true if the source object contains all keys, false otherwise. + */ +var HasAll = function (source, keys) +{ + for (var i = 0; i < keys.length; i++) + { + if (!source.hasOwnProperty(keys[i])) + { + return false; + } + } + + return true; +}; + +module.exports = HasAll; + + +/***/ }), +/* 1315 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clone = __webpack_require__(64); + +/** + * Creates a new Object using all values from obj1. + * + * Then scans obj2. If a property is found in obj2 that *also* exists in obj1, the value from obj2 is used, otherwise the property is skipped. + * + * @function Phaser.Utils.Objects.MergeRight + * @since 3.0.0 + * + * @param {object} obj1 - The first object to merge. + * @param {object} obj2 - The second object to merge. Keys from this object which also exist in `obj1` will be copied to `obj1`. + * + * @return {object} The merged object. `obj1` and `obj2` are not modified. + */ +var MergeRight = function (obj1, obj2) +{ + var clone = Clone(obj1); + + for (var key in obj2) + { + if (clone.hasOwnProperty(key)) + { + clone[key] = obj2[key]; + } + } + + return clone; +}; + +module.exports = MergeRight; + + +/***/ }), +/* 1316 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Utils.String + */ + +module.exports = { + + Format: __webpack_require__(1317), + Pad: __webpack_require__(158), + Reverse: __webpack_require__(1318), + UppercaseFirst: __webpack_require__(347), + UUID: __webpack_require__(380) + +}; + + +/***/ }), +/* 1317 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes a string and replaces instances of markers with values in the given array. + * The markers take the form of `%1`, `%2`, etc. I.e.: + * + * `Format("The %1 is worth %2 gold", [ 'Sword', 500 ])` + * + * @function Phaser.Utils.String.Format + * @since 3.0.0 + * + * @param {string} string - The string containing the replacement markers. + * @param {array} values - An array containing values that will replace the markers. If no value exists an empty string is inserted instead. + * + * @return {string} The string containing replaced values. + */ +var Format = function (string, values) +{ + return string.replace(/%([0-9]+)/g, function (s, n) + { + return values[Number(n) - 1]; + }); +}; + +module.exports = Format; + + +/***/ }), +/* 1318 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes the given string and reverses it, returning the reversed string. + * For example if given the string `Atari 520ST` it would return `TS025 iratA`. + * + * @function Phaser.Utils.String.Reverse + * @since 3.0.0 + * + * @param {string} string - The string to be reversed. + * + * @return {string} The reversed string. + */ +var Reverse = function (string) +{ + return string.split('').reverse().join(''); +}; + +module.exports = Reverse; + + +/***/ }), +/* 1319 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Sound + */ + +module.exports = { + + SoundManagerCreator: __webpack_require__(352), + + Events: __webpack_require__(65), + + BaseSound: __webpack_require__(124), + BaseSoundManager: __webpack_require__(123), + + WebAudioSound: __webpack_require__(359), + WebAudioSoundManager: __webpack_require__(357), + + HTML5AudioSound: __webpack_require__(354), + HTML5AudioSoundManager: __webpack_require__(353), + + NoAudioSound: __webpack_require__(356), + NoAudioSoundManager: __webpack_require__(355) + +}; + + +/***/ }), +/* 1320 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var COLLIDES = __webpack_require__(446); +var GetVelocity = __webpack_require__(1341); +var TYPE = __webpack_require__(447); +var UpdateMotion = __webpack_require__(1342); + +/** + * @callback Phaser.Types.Physics.Impact.BodyUpdateCallback + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body} body - [description] + */ + +/** + * @classdesc + * An Impact.js compatible physics body. + * This re-creates the properties you'd get on an Entity and the math needed to update them. + * + * @class Body + * @memberof Phaser.Physics.Impact + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.World} world - [description] + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} [sx=16] - [description] + * @param {number} [sy=16] - [description] + */ +var Body = new Class({ + + initialize: + + function Body (world, x, y, sx, sy) + { + if (sx === undefined) { sx = 16; } + if (sy === undefined) { sy = sx; } + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#world + * @type {Phaser.Physics.Impact.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#gameObject + * @type {Phaser.GameObjects.GameObject} + * @default null + * @since 3.0.0 + */ + this.gameObject = null; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#enabled + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.enabled = true; + + /** + * The ImpactBody, ImpactSprite or ImpactImage object that owns this Body, if any. + * + * @name Phaser.Physics.Impact.Body#parent + * @type {?(Phaser.Physics.Impact.ImpactBody|Phaser.Physics.Impact.ImpactImage|Phaser.Physics.Impact.ImpactSprite)} + * @since 3.0.0 + */ + this.parent; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#id + * @type {integer} + * @since 3.0.0 + */ + this.id = world.getNextID(); + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#name + * @type {string} + * @default '' + * @since 3.0.0 + */ + this.name = ''; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#size + * @type {Phaser.Types.Math.Vector2Like} + * @since 3.0.0 + */ + this.size = { x: sx, y: sy }; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#offset + * @type {Phaser.Types.Math.Vector2Like} + * @since 3.0.0 + */ + this.offset = { x: 0, y: 0 }; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#pos + * @type {Phaser.Types.Math.Vector2Like} + * @since 3.0.0 + */ + this.pos = { x: x, y: y }; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#last + * @type {Phaser.Types.Math.Vector2Like} + * @since 3.0.0 + */ + this.last = { x: x, y: y }; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#vel + * @type {Phaser.Types.Math.Vector2Like} + * @since 3.0.0 + */ + this.vel = { x: 0, y: 0 }; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#accel + * @type {Phaser.Types.Math.Vector2Like} + * @since 3.0.0 + */ + this.accel = { x: 0, y: 0 }; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#friction + * @type {Phaser.Types.Math.Vector2Like} + * @since 3.0.0 + */ + this.friction = { x: 0, y: 0 }; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#maxVel + * @type {Phaser.Types.Math.Vector2Like} + * @since 3.0.0 + */ + this.maxVel = { x: world.defaults.maxVelocityX, y: world.defaults.maxVelocityY }; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#standing + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.standing = false; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#gravityFactor + * @type {number} + * @since 3.0.0 + */ + this.gravityFactor = world.defaults.gravityFactor; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#bounciness + * @type {number} + * @since 3.0.0 + */ + this.bounciness = world.defaults.bounciness; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#minBounceVelocity + * @type {number} + * @since 3.0.0 + */ + this.minBounceVelocity = world.defaults.minBounceVelocity; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#accelGround + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.accelGround = 0; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#accelAir + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.accelAir = 0; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#jumpSpeed + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.jumpSpeed = 0; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#type + * @type {Phaser.Physics.Impact.TYPE} + * @since 3.0.0 + */ + this.type = TYPE.NONE; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#checkAgainst + * @type {Phaser.Physics.Impact.TYPE} + * @since 3.0.0 + */ + this.checkAgainst = TYPE.NONE; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#collides + * @type {Phaser.Physics.Impact.COLLIDES} + * @since 3.0.0 + */ + this.collides = COLLIDES.NEVER; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#debugShowBody + * @type {boolean} + * @since 3.0.0 + */ + this.debugShowBody = world.defaults.debugShowBody; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#debugShowVelocity + * @type {boolean} + * @since 3.0.0 + */ + this.debugShowVelocity = world.defaults.debugShowVelocity; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#debugBodyColor + * @type {integer} + * @since 3.0.0 + */ + this.debugBodyColor = world.defaults.bodyDebugColor; + + /** + * [description] + * + * @name Phaser.Physics.Impact.Body#updateCallback + * @type {?Phaser.Types.Physics.Impact.BodyUpdateCallback} + * @since 3.0.0 + */ + this.updateCallback; + + /** + * min 44 deg, max 136 deg + * + * @name Phaser.Physics.Impact.Body#slopeStanding + * @type {{ min: number, max: number }} + * @since 3.0.0 + */ + this.slopeStanding = { min: 0.767944870877505, max: 2.3736477827122884 }; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Body#reset + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + */ + reset: function (x, y) + { + this.pos = { x: x, y: y }; + this.last = { x: x, y: y }; + this.vel = { x: 0, y: 0 }; + this.accel = { x: 0, y: 0 }; + this.friction = { x: 0, y: 0 }; + this.maxVel = { x: 100, y: 100 }; + + this.standing = false; + + this.gravityFactor = 1; + this.bounciness = 0; + this.minBounceVelocity = 40; + + this.accelGround = 0; + this.accelAir = 0; + this.jumpSpeed = 0; + + this.type = TYPE.NONE; + this.checkAgainst = TYPE.NONE; + this.collides = COLLIDES.NEVER; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Body#update + * @since 3.0.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update: function (delta) + { + var pos = this.pos; + + this.last.x = pos.x; + this.last.y = pos.y; + + this.vel.y += this.world.gravity * delta * this.gravityFactor; + + this.vel.x = GetVelocity(delta, this.vel.x, this.accel.x, this.friction.x, this.maxVel.x); + this.vel.y = GetVelocity(delta, this.vel.y, this.accel.y, this.friction.y, this.maxVel.y); + + var mx = this.vel.x * delta; + var my = this.vel.y * delta; + + var res = this.world.collisionMap.trace(pos.x, pos.y, mx, my, this.size.x, this.size.y); + + if (this.handleMovementTrace(res)) + { + UpdateMotion(this, res); + } + + var go = this.gameObject; + + if (go) + { + go.x = (pos.x - this.offset.x) + go.displayOriginX * go.scaleX; + go.y = (pos.y - this.offset.y) + go.displayOriginY * go.scaleY; + } + + if (this.updateCallback) + { + this.updateCallback(this); + } + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Body#drawDebug + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphic - [description] + */ + drawDebug: function (graphic) + { + var pos = this.pos; + + if (this.debugShowBody) + { + graphic.lineStyle(1, this.debugBodyColor, 1); + graphic.strokeRect(pos.x, pos.y, this.size.x, this.size.y); + } + + if (this.debugShowVelocity) + { + var x = pos.x + this.size.x / 2; + var y = pos.y + this.size.y / 2; + + graphic.lineStyle(1, this.world.defaults.velocityDebugColor, 1); + graphic.lineBetween(x, y, x + this.vel.x, y + this.vel.y); + } + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Body#willDrawDebug + * @since 3.0.0 + * + * @return {boolean} [description] + */ + willDrawDebug: function () + { + return (this.debugShowBody || this.debugShowVelocity); + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Body#skipHash + * @since 3.0.0 + * + * @return {boolean} [description] + */ + skipHash: function () + { + return (!this.enabled || (this.type === 0 && this.checkAgainst === 0 && this.collides === 0)); + }, + + /** + * Determines whether the body collides with the `other` one or not. + * + * @method Phaser.Physics.Impact.Body#touches + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body} other - [description] + * + * @return {boolean} [description] + */ + touches: function (other) + { + return !( + this.pos.x >= other.pos.x + other.size.x || + this.pos.x + this.size.x <= other.pos.x || + this.pos.y >= other.pos.y + other.size.y || + this.pos.y + this.size.y <= other.pos.y + ); + }, + + /** + * Reset the size and position of the physics body. + * + * @method Phaser.Physics.Impact.Body#resetSize + * @since 3.0.0 + * + * @param {number} x - The x coordinate to position the body. + * @param {number} y - The y coordinate to position the body. + * @param {number} width - The width of the body. + * @param {number} height - The height of the body. + * + * @return {Phaser.Physics.Impact.Body} This Body object. + */ + resetSize: function (x, y, width, height) + { + this.pos.x = x; + this.pos.y = y; + this.size.x = width; + this.size.y = height; + + return this; + }, + + /** + * Export this body object to JSON. + * + * @method Phaser.Physics.Impact.Body#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Physics.Impact.JSONImpactBody} JSON representation of this body object. + */ + toJSON: function () + { + var output = { + name: this.name, + size: { x: this.size.x, y: this.size.y }, + pos: { x: this.pos.x, y: this.pos.y }, + vel: { x: this.vel.x, y: this.vel.y }, + accel: { x: this.accel.x, y: this.accel.y }, + friction: { x: this.friction.x, y: this.friction.y }, + maxVel: { x: this.maxVel.x, y: this.maxVel.y }, + gravityFactor: this.gravityFactor, + bounciness: this.bounciness, + minBounceVelocity: this.minBounceVelocity, + type: this.type, + checkAgainst: this.checkAgainst, + collides: this.collides + }; + + return output; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Body#fromJSON + * @todo Code it! + * @since 3.0.0 + * + * @param {object} config - [description] + */ + fromJSON: function () + { + }, + + /** + * Can be overridden by user code + * + * @method Phaser.Physics.Impact.Body#check + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body} other - [description] + */ + check: function () + { + }, + + /** + * Can be overridden by user code + * + * @method Phaser.Physics.Impact.Body#collideWith + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body} other - [description] + * @param {string} axis - [description] + */ + collideWith: function (other, axis) + { + if (this.parent && this.parent._collideCallback) + { + this.parent._collideCallback.call(this.parent._callbackScope, this, other, axis); + } + }, + + /** + * Can be overridden by user code but must return a boolean. + * + * @method Phaser.Physics.Impact.Body#handleMovementTrace + * @since 3.0.0 + * + * @param {number} res - [description] + * + * @return {boolean} [description] + */ + handleMovementTrace: function () + { + return true; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Body#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.world.remove(this); + + this.enabled = false; + + this.world = null; + + this.gameObject = null; + + this.parent = null; + } + +}); + +module.exports = Body; + + +/***/ }), +/* 1321 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var DefaultDefs = __webpack_require__(1346); + +/** + * @classdesc + * [description] + * + * @class CollisionMap + * @memberof Phaser.Physics.Impact + * @constructor + * @since 3.0.0 + * + * @param {integer} [tilesize=32] - [description] + * @param {array} [data] - [description] + */ +var CollisionMap = new Class({ + + initialize: + + function CollisionMap (tilesize, data) + { + if (tilesize === undefined) { tilesize = 32; } + + /** + * [description] + * + * @name Phaser.Physics.Impact.CollisionMap#tilesize + * @type {integer} + * @default 32 + * @since 3.0.0 + */ + this.tilesize = tilesize; + + /** + * [description] + * + * @name Phaser.Physics.Impact.CollisionMap#data + * @type {array} + * @since 3.0.0 + */ + this.data = (Array.isArray(data)) ? data : []; + + /** + * [description] + * + * @name Phaser.Physics.Impact.CollisionMap#width + * @type {number} + * @since 3.0.0 + */ + this.width = (Array.isArray(data)) ? data[0].length : 0; + + /** + * [description] + * + * @name Phaser.Physics.Impact.CollisionMap#height + * @type {number} + * @since 3.0.0 + */ + this.height = (Array.isArray(data)) ? data.length : 0; + + /** + * [description] + * + * @name Phaser.Physics.Impact.CollisionMap#lastSlope + * @type {integer} + * @default 55 + * @since 3.0.0 + */ + this.lastSlope = 55; + + /** + * [description] + * + * @name Phaser.Physics.Impact.CollisionMap#tiledef + * @type {object} + * @since 3.0.0 + */ + this.tiledef = DefaultDefs; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.CollisionMap#trace + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} vx - [description] + * @param {number} vy - [description] + * @param {number} objectWidth - [description] + * @param {number} objectHeight - [description] + * + * @return {boolean} [description] + */ + trace: function (x, y, vx, vy, objectWidth, objectHeight) + { + // Set up the trace-result + var res = { + collision: { x: false, y: false, slope: false }, + pos: { x: x + vx, y: y + vy }, + tile: { x: 0, y: 0 } + }; + + if (!this.data) + { + return res; + } + + var steps = Math.ceil(Math.max(Math.abs(vx), Math.abs(vy)) / this.tilesize); + + if (steps > 1) + { + var sx = vx / steps; + var sy = vy / steps; + + for (var i = 0; i < steps && (sx || sy); i++) + { + this.step(res, x, y, sx, sy, objectWidth, objectHeight, vx, vy, i); + + x = res.pos.x; + y = res.pos.y; + + if (res.collision.x) + { + sx = 0; + vx = 0; + } + + if (res.collision.y) + { + sy = 0; + vy = 0; + } + + if (res.collision.slope) + { + break; + } + } + } + else + { + this.step(res, x, y, vx, vy, objectWidth, objectHeight, vx, vy, 0); + } + + return res; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.CollisionMap#step + * @since 3.0.0 + * + * @param {object} res - [description] + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} vx - [description] + * @param {number} vy - [description] + * @param {number} width - [description] + * @param {number} height - [description] + * @param {number} rvx - [description] + * @param {number} rvy - [description] + * @param {number} step - [description] + */ + step: function (res, x, y, vx, vy, width, height, rvx, rvy, step) + { + var t = 0; + var tileX; + var tileY; + var tilesize = this.tilesize; + var mapWidth = this.width; + var mapHeight = this.height; + + // Horizontal + if (vx) + { + var pxOffsetX = (vx > 0 ? width : 0); + var tileOffsetX = (vx < 0 ? tilesize : 0); + + var firstTileY = Math.max(Math.floor(y / tilesize), 0); + var lastTileY = Math.min(Math.ceil((y + height) / tilesize), mapHeight); + + tileX = Math.floor((res.pos.x + pxOffsetX) / tilesize); + + var prevTileX = Math.floor((x + pxOffsetX) / tilesize); + + if (step > 0 || tileX === prevTileX || prevTileX < 0 || prevTileX >= mapWidth) + { + prevTileX = -1; + } + + if (tileX >= 0 && tileX < mapWidth) + { + for (tileY = firstTileY; tileY < lastTileY; tileY++) + { + if (prevTileX !== -1) + { + t = this.data[tileY][prevTileX]; + + if (t > 1 && t <= this.lastSlope && this.checkDef(res, t, x, y, rvx, rvy, width, height, prevTileX, tileY)) + { + break; + } + } + + t = this.data[tileY][tileX]; + + if (t === 1 || t > this.lastSlope || (t > 1 && this.checkDef(res, t, x, y, rvx, rvy, width, height, tileX, tileY))) + { + if (t > 1 && t <= this.lastSlope && res.collision.slope) + { + break; + } + + res.collision.x = true; + res.tile.x = t; + res.pos.x = (tileX * tilesize) - pxOffsetX + tileOffsetX; + x = res.pos.x; + rvx = 0; + + break; + } + } + } + } + + // Vertical + if (vy) + { + var pxOffsetY = (vy > 0 ? height : 0); + var tileOffsetY = (vy < 0 ? tilesize : 0); + + var firstTileX = Math.max(Math.floor(res.pos.x / tilesize), 0); + var lastTileX = Math.min(Math.ceil((res.pos.x + width) / tilesize), mapWidth); + + tileY = Math.floor((res.pos.y + pxOffsetY) / tilesize); + + var prevTileY = Math.floor((y + pxOffsetY) / tilesize); + + if (step > 0 || tileY === prevTileY || prevTileY < 0 || prevTileY >= mapHeight) + { + prevTileY = -1; + } + + if (tileY >= 0 && tileY < mapHeight) + { + for (tileX = firstTileX; tileX < lastTileX; tileX++) + { + if (prevTileY !== -1) + { + t = this.data[prevTileY][tileX]; + + if (t > 1 && t <= this.lastSlope && this.checkDef(res, t, x, y, rvx, rvy, width, height, tileX, prevTileY)) + { + break; + } + } + + t = this.data[tileY][tileX]; + + if (t === 1 || t > this.lastSlope || (t > 1 && this.checkDef(res, t, x, y, rvx, rvy, width, height, tileX, tileY))) + { + if (t > 1 && t <= this.lastSlope && res.collision.slope) + { + break; + } + + res.collision.y = true; + res.tile.y = t; + res.pos.y = tileY * tilesize - pxOffsetY + tileOffsetY; + + break; + } + } + } + } + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.CollisionMap#checkDef + * @since 3.0.0 + * + * @param {object} res - [description] + * @param {number} t - [description] + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} vx - [description] + * @param {number} vy - [description] + * @param {number} width - [description] + * @param {number} height - [description] + * @param {number} tileX - [description] + * @param {number} tileY - [description] + * + * @return {boolean} [description] + */ + checkDef: function (res, t, x, y, vx, vy, width, height, tileX, tileY) + { + var def = this.tiledef[t]; + + if (!def) + { + return false; + } + + var tilesize = this.tilesize; + + var lx = (tileX + def[0]) * tilesize; + var ly = (tileY + def[1]) * tilesize; + var lvx = (def[2] - def[0]) * tilesize; + var lvy = (def[3] - def[1]) * tilesize; + var solid = def[4]; + + var tx = x + vx + (lvy < 0 ? width : 0) - lx; + var ty = y + vy + (lvx > 0 ? height : 0) - ly; + + if (lvx * ty - lvy * tx > 0) + { + if (vx * -lvy + vy * lvx < 0) + { + return solid; + } + + var length = Math.sqrt(lvx * lvx + lvy * lvy); + var nx = lvy / length; + var ny = -lvx / length; + + var proj = tx * nx + ty * ny; + var px = nx * proj; + var py = ny * proj; + + if (px * px + py * py >= vx * vx + vy * vy) + { + return solid || (lvx * (ty - vy) - lvy * (tx - vx) < 0.5); + } + + res.pos.x = x + vx - px; + res.pos.y = y + vy - py; + res.collision.slope = { x: lvx, y: lvy, nx: nx, ny: ny }; + + return true; + } + + return false; + } + +}); + +module.exports = CollisionMap; + + +/***/ }), +/* 1322 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var ImpactBody = __webpack_require__(1323); +var ImpactImage = __webpack_require__(1324); +var ImpactSprite = __webpack_require__(1325); + +/** + * @classdesc + * The Impact Physics Factory allows you to easily create Impact Physics enabled Game Objects. + * Objects that are created by this Factory are automatically added to the physics world. + * + * @class Factory + * @memberof Phaser.Physics.Impact + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.World} world - A reference to the Impact Physics world. + */ +var Factory = new Class({ + + initialize: + + function Factory (world) + { + /** + * A reference to the Impact Physics world. + * + * @name Phaser.Physics.Impact.Factory#world + * @type {Phaser.Physics.Impact.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * A reference to the Scene.Systems this Impact Physics instance belongs to. + * + * @name Phaser.Physics.Impact.Factory#sys + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.sys = world.scene.sys; + }, + + /** + * Creates a new ImpactBody object and adds it to the physics simulation. + * + * @method Phaser.Physics.Impact.Factory#body + * @since 3.0.0 + * + * @param {number} x - The horizontal position of the body in the physics world. + * @param {number} y - The vertical position of the body in the physics world. + * @param {number} width - The width of the body. + * @param {number} height - The height of the body. + * + * @return {Phaser.Physics.Impact.ImpactBody} The ImpactBody object that was created. + */ + body: function (x, y, width, height) + { + return new ImpactBody(this.world, x, y, width, height); + }, + + /** + * Adds an Impact Physics Body to the given Game Object. + * + * @method Phaser.Physics.Impact.Factory#existing + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to receive the physics body. + * + * @return {Phaser.GameObjects.GameObject} The Game Object. + */ + existing: function (gameObject) + { + var x = gameObject.x - gameObject.frame.centerX; + var y = gameObject.y - gameObject.frame.centerY; + var w = gameObject.width; + var h = gameObject.height; + + gameObject.body = this.world.create(x, y, w, h); + + gameObject.body.parent = gameObject; + gameObject.body.gameObject = gameObject; + + return gameObject; + }, + + /** + * Creates a new ImpactImage object and adds it to the physics world. + * + * @method Phaser.Physics.Impact.Factory#image + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Physics.Impact.ImpactImage} The ImpactImage object that was created. + */ + image: function (x, y, key, frame) + { + var image = new ImpactImage(this.world, x, y, key, frame); + + this.sys.displayList.add(image); + + return image; + }, + + /** + * Creates a new ImpactSprite object and adds it to the physics world. + * + * @method Phaser.Physics.Impact.Factory#sprite + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * + * @return {Phaser.Physics.Impact.ImpactSprite} The ImpactSprite object that was created. + */ + sprite: function (x, y, key, frame) + { + var sprite = new ImpactSprite(this.world, x, y, key, frame); + + this.sys.displayList.add(sprite); + this.sys.updateList.add(sprite); + + return sprite; + }, + + /** + * Destroys this Factory. + * + * @method Phaser.Physics.Impact.Factory#destroy + * @since 3.5.0 + */ + destroy: function () + { + this.world = null; + this.sys = null; + } + +}); + +module.exports = Factory; + + +/***/ }), +/* 1323 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(1239); + +/** + * @classdesc + * [description] + * + * @class ImpactBody + * @memberof Phaser.Physics.Impact + * @constructor + * @since 3.0.0 + * + * @extends Phaser.Physics.Impact.Components.Acceleration + * @extends Phaser.Physics.Impact.Components.BodyScale + * @extends Phaser.Physics.Impact.Components.BodyType + * @extends Phaser.Physics.Impact.Components.Bounce + * @extends Phaser.Physics.Impact.Components.CheckAgainst + * @extends Phaser.Physics.Impact.Components.Collides + * @extends Phaser.Physics.Impact.Components.Debug + * @extends Phaser.Physics.Impact.Components.Friction + * @extends Phaser.Physics.Impact.Components.Gravity + * @extends Phaser.Physics.Impact.Components.Offset + * @extends Phaser.Physics.Impact.Components.SetGameObject + * @extends Phaser.Physics.Impact.Components.Velocity + * + * @param {Phaser.Physics.Impact.World} world - [description] + * @param {number} x - x - The horizontal position of this physics body in the world. + * @param {number} y - y - The vertical position of this physics body in the world. + * @param {number} width - The width of the physics body in the world. + * @param {number} height - [description] + */ +var ImpactBody = new Class({ + + Mixins: [ + Components.Acceleration, + Components.BodyScale, + Components.BodyType, + Components.Bounce, + Components.CheckAgainst, + Components.Collides, + Components.Debug, + Components.Friction, + Components.Gravity, + Components.Offset, + Components.SetGameObject, + Components.Velocity + ], + + initialize: + + function ImpactBody (world, x, y, width, height) + { + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactBody#body + * @type {Phaser.Physics.Impact.Body} + * @since 3.0.0 + */ + this.body = world.create(x, y, width, height); + + this.body.parent = this; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactBody#size + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.size = this.body.size; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactBody#offset + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.offset = this.body.offset; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactBody#vel + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.vel = this.body.vel; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactBody#accel + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.accel = this.body.accel; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactBody#friction + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.friction = this.body.friction; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactBody#maxVel + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.maxVel = this.body.maxVel; + } + +}); + +module.exports = ImpactBody; + + +/***/ }), +/* 1324 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(1239); +var Image = __webpack_require__(95); + +/** + * @classdesc + * An Impact Physics Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + * + * @class ImpactImage + * @extends Phaser.GameObjects.Image + * @memberof Phaser.Physics.Impact + * @constructor + * @since 3.0.0 + * + * @extends Phaser.Physics.Impact.Components.Acceleration + * @extends Phaser.Physics.Impact.Components.BodyScale + * @extends Phaser.Physics.Impact.Components.BodyType + * @extends Phaser.Physics.Impact.Components.Bounce + * @extends Phaser.Physics.Impact.Components.CheckAgainst + * @extends Phaser.Physics.Impact.Components.Collides + * @extends Phaser.Physics.Impact.Components.Debug + * @extends Phaser.Physics.Impact.Components.Friction + * @extends Phaser.Physics.Impact.Components.Gravity + * @extends Phaser.Physics.Impact.Components.Offset + * @extends Phaser.Physics.Impact.Components.SetGameObject + * @extends Phaser.Physics.Impact.Components.Velocity + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Physics.Impact.World} world - The physics world of the Impact physics system. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + */ +var ImpactImage = new Class({ + + Extends: Image, + + Mixins: [ + Components.Acceleration, + Components.BodyScale, + Components.BodyType, + Components.Bounce, + Components.CheckAgainst, + Components.Collides, + Components.Debug, + Components.Friction, + Components.Gravity, + Components.Offset, + Components.SetGameObject, + Components.Velocity + ], + + initialize: + + function ImpactImage (world, x, y, texture, frame) + { + Image.call(this, world.scene, x, y, texture, frame); + + /** + * The Physics Body linked to an ImpactImage. + * + * @name Phaser.Physics.Impact.ImpactImage#body + * @type {Phaser.Physics.Impact.Body} + * @since 3.0.0 + */ + this.body = world.create(x - this.frame.centerX, y - this.frame.centerY, this.width, this.height); + + this.body.parent = this; + this.body.gameObject = this; + + /** + * The size of the physics Body. + * + * @name Phaser.Physics.Impact.ImpactImage#size + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.size = this.body.size; + + /** + * The X and Y offset of the Body from the left and top of the Image. + * + * @name Phaser.Physics.Impact.ImpactImage#offset + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.offset = this.body.offset; + + /** + * The velocity, or rate of change the Body's position. Measured in pixels per second. + * + * @name Phaser.Physics.Impact.ImpactImage#vel + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.vel = this.body.vel; + + /** + * The acceleration is the rate of change of the velocity. Measured in pixels per second squared. + * + * @name Phaser.Physics.Impact.ImpactImage#accel + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.accel = this.body.accel; + + /** + * Friction between colliding bodies. + * + * @name Phaser.Physics.Impact.ImpactImage#friction + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.friction = this.body.friction; + + /** + * The maximum velocity of the body. + * + * @name Phaser.Physics.Impact.ImpactImage#maxVel + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.maxVel = this.body.maxVel; + } + +}); + +module.exports = ImpactImage; + + +/***/ }), +/* 1325 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(1239); +var Sprite = __webpack_require__(67); + +/** + * @classdesc + * An Impact Physics Sprite Game Object. + * + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + * + * @class ImpactSprite + * @extends Phaser.GameObjects.Sprite + * @memberof Phaser.Physics.Impact + * @constructor + * @since 3.0.0 + * + * @extends Phaser.Physics.Impact.Components.Acceleration + * @extends Phaser.Physics.Impact.Components.BodyScale + * @extends Phaser.Physics.Impact.Components.BodyType + * @extends Phaser.Physics.Impact.Components.Bounce + * @extends Phaser.Physics.Impact.Components.CheckAgainst + * @extends Phaser.Physics.Impact.Components.Collides + * @extends Phaser.Physics.Impact.Components.Debug + * @extends Phaser.Physics.Impact.Components.Friction + * @extends Phaser.Physics.Impact.Components.Gravity + * @extends Phaser.Physics.Impact.Components.Offset + * @extends Phaser.Physics.Impact.Components.SetGameObject + * @extends Phaser.Physics.Impact.Components.Velocity + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Physics.Impact.World} world - [description] + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + */ +var ImpactSprite = new Class({ + + Extends: Sprite, + + Mixins: [ + Components.Acceleration, + Components.BodyScale, + Components.BodyType, + Components.Bounce, + Components.CheckAgainst, + Components.Collides, + Components.Debug, + Components.Friction, + Components.Gravity, + Components.Offset, + Components.SetGameObject, + Components.Velocity + ], + + initialize: + + function ImpactSprite (world, x, y, texture, frame) + { + Sprite.call(this, world.scene, x, y, texture, frame); + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactSprite#body + * @type {Phaser.Physics.Impact.Body} + * @since 3.0.0 + */ + this.body = world.create(x - this.frame.centerX, y - this.frame.centerY, this.width, this.height); + + this.body.parent = this; + this.body.gameObject = this; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactSprite#size + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.size = this.body.size; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactSprite#offset + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.offset = this.body.offset; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactSprite#vel + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.vel = this.body.vel; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactSprite#accel + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.accel = this.body.accel; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactSprite#friction + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.friction = this.body.friction; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactSprite#maxVel + * @type {{x: number, y: number}} + * @since 3.0.0 + */ + this.maxVel = this.body.maxVel; + } + +}); + +module.exports = ImpactSprite; + + +/***/ }), +/* 1326 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Body = __webpack_require__(1320); +var Class = __webpack_require__(0); +var COLLIDES = __webpack_require__(446); +var CollisionMap = __webpack_require__(1321); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(1238); +var GetFastValue = __webpack_require__(2); +var HasValue = __webpack_require__(97); +var Set = __webpack_require__(105); +var Solver = __webpack_require__(1360); +var TILEMAP_FORMATS = __webpack_require__(31); +var TYPE = __webpack_require__(447); + +/** + * @classdesc + * [description] + * + * @class World + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Physics.Impact + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Impact World instance belongs. + * @param {Phaser.Types.Physics.Impact.WorldConfig} config - [description] + */ +var World = new Class({ + + Extends: EventEmitter, + + initialize: + + function World (scene, config) + { + EventEmitter.call(this); + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#bodies + * @type {Phaser.Structs.Set.} + * @since 3.0.0 + */ + this.bodies = new Set(); + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#gravity + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.gravity = GetFastValue(config, 'gravity', 0); + + /** + * Spatial hash cell dimensions + * + * @name Phaser.Physics.Impact.World#cellSize + * @type {integer} + * @default 64 + * @since 3.0.0 + */ + this.cellSize = GetFastValue(config, 'cellSize', 64); + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#collisionMap + * @type {Phaser.Physics.Impact.CollisionMap} + * @since 3.0.0 + */ + this.collisionMap = new CollisionMap(); + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#timeScale + * @type {number} + * @default 1 + * @since 3.0.0 + */ + this.timeScale = GetFastValue(config, 'timeScale', 1); + + /** + * Impacts maximum time step is 20 fps. + * + * @name Phaser.Physics.Impact.World#maxStep + * @type {number} + * @default 0.05 + * @since 3.0.0 + */ + this.maxStep = GetFastValue(config, 'maxStep', 0.05); + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#enabled + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.enabled = true; + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#drawDebug + * @type {boolean} + * @since 3.0.0 + */ + this.drawDebug = GetFastValue(config, 'debug', false); + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#debugGraphic + * @type {Phaser.GameObjects.Graphics} + * @since 3.0.0 + */ + this.debugGraphic; + + var _maxVelocity = GetFastValue(config, 'maxVelocity', 100); + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#defaults + * @type {Phaser.Types.Physics.Impact.WorldDefaults} + * @since 3.0.0 + */ + this.defaults = { + debugShowBody: GetFastValue(config, 'debugShowBody', true), + debugShowVelocity: GetFastValue(config, 'debugShowVelocity', true), + bodyDebugColor: GetFastValue(config, 'debugBodyColor', 0xff00ff), + velocityDebugColor: GetFastValue(config, 'debugVelocityColor', 0x00ff00), + maxVelocityX: GetFastValue(config, 'maxVelocityX', _maxVelocity), + maxVelocityY: GetFastValue(config, 'maxVelocityY', _maxVelocity), + minBounceVelocity: GetFastValue(config, 'minBounceVelocity', 40), + gravityFactor: GetFastValue(config, 'gravityFactor', 1), + bounciness: GetFastValue(config, 'bounciness', 0) + }; + + /** + * An object containing the 4 wall bodies that bound the physics world. + * + * @name Phaser.Physics.Impact.World#walls + * @type {Phaser.Types.Physics.Impact.WorldWalls} + * @since 3.0.0 + */ + this.walls = { left: null, right: null, top: null, bottom: null }; + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#delta + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.delta = 0; + + /** + * [description] + * + * @name Phaser.Physics.Impact.World#_lastId + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + this._lastId = 0; + + if (GetFastValue(config, 'setBounds', false)) + { + var boundsConfig = config['setBounds']; + + if (typeof boundsConfig === 'boolean') + { + this.setBounds(); + } + else + { + var x = GetFastValue(boundsConfig, 'x', 0); + var y = GetFastValue(boundsConfig, 'y', 0); + var width = GetFastValue(boundsConfig, 'width', scene.sys.scale.width); + var height = GetFastValue(boundsConfig, 'height', scene.sys.scale.height); + var thickness = GetFastValue(boundsConfig, 'thickness', 64); + var left = GetFastValue(boundsConfig, 'left', true); + var right = GetFastValue(boundsConfig, 'right', true); + var top = GetFastValue(boundsConfig, 'top', true); + var bottom = GetFastValue(boundsConfig, 'bottom', true); + + this.setBounds(x, y, width, height, thickness, left, right, top, bottom); + } + } + + if (this.drawDebug) + { + this.createDebugGraphic(); + } + }, + + /** + * Sets the collision map for the world either from a Weltmeister JSON level in the cache or from + * a 2D array. If loading from a Weltmeister level, the map must have a layer called "collision". + * + * @method Phaser.Physics.Impact.World#setCollisionMap + * @since 3.0.0 + * + * @param {(string|integer[][])} key - Either a string key that corresponds to a Weltmeister level + * in the cache, or a 2D array of collision IDs. + * @param {integer} tileSize - The size of a tile. This is optional if loading from a Weltmeister + * level in the cache. + * + * @return {?Phaser.Physics.Impact.CollisionMap} The newly created CollisionMap, or null if the method failed to + * create the CollisionMap. + */ + setCollisionMap: function (key, tileSize) + { + if (typeof key === 'string') + { + var tilemapData = this.scene.cache.tilemap.get(key); + + if (!tilemapData || tilemapData.format !== TILEMAP_FORMATS.WELTMEISTER) + { + console.warn('The specified key does not correspond to a Weltmeister tilemap: ' + key); + return null; + } + + var layers = tilemapData.data.layer; + var collisionLayer; + for (var i = 0; i < layers.length; i++) + { + if (layers[i].name === 'collision') + { + collisionLayer = layers[i]; + break; + } + } + + if (tileSize === undefined) { tileSize = collisionLayer.tilesize; } + + this.collisionMap = new CollisionMap(tileSize, collisionLayer.data); + } + else if (Array.isArray(key)) + { + this.collisionMap = new CollisionMap(tileSize, key); + } + else + { + console.warn('Invalid Weltmeister collision map data: ' + key); + } + + return this.collisionMap; + }, + + /** + * Sets the collision map for the world from a tilemap layer. Only tiles that are marked as + * colliding will be used. You can specify the mapping from tiles to slope IDs in a couple of + * ways. The easiest is to use Tiled and the slopeTileProperty option. Alternatively, you can + * manually create a slopeMap that stores the mapping between tile indices and slope IDs. + * + * @method Phaser.Physics.Impact.World#setCollisionMapFromTilemapLayer + * @since 3.0.0 + * + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemap layer to use. + * @param {Phaser.Types.Physics.Impact.CollisionOptions} [options] - Options for controlling the mapping from tiles to slope IDs. + * + * @return {Phaser.Physics.Impact.CollisionMap} The newly created CollisionMap. + */ + setCollisionMapFromTilemapLayer: function (tilemapLayer, options) + { + if (options === undefined) { options = {}; } + var slopeProperty = GetFastValue(options, 'slopeProperty', null); + var slopeMap = GetFastValue(options, 'slopeMap', null); + var collidingSlope = GetFastValue(options, 'defaultCollidingSlope', null); + var nonCollidingSlope = GetFastValue(options, 'defaultNonCollidingSlope', 0); + + var layerData = tilemapLayer.layer; + var tileSize = layerData.baseTileWidth; + var collisionData = []; + + for (var ty = 0; ty < layerData.height; ty++) + { + collisionData[ty] = []; + + for (var tx = 0; tx < layerData.width; tx++) + { + var tile = layerData.data[ty][tx]; + + if (tile && tile.collides) + { + if (slopeProperty !== null && HasValue(tile.properties, slopeProperty)) + { + collisionData[ty][tx] = parseInt(tile.properties[slopeProperty], 10); + } + else if (slopeMap !== null && HasValue(slopeMap, tile.index)) + { + collisionData[ty][tx] = slopeMap[tile.index]; + } + else if (collidingSlope !== null) + { + collisionData[ty][tx] = collidingSlope; + } + else + { + collisionData[ty][tx] = tile.index; + } + } + else + { + collisionData[ty][tx] = nonCollidingSlope; + } + } + } + + this.collisionMap = new CollisionMap(tileSize, collisionData); + + return this.collisionMap; + }, + + /** + * Sets the bounds of the Physics world to match the given world pixel dimensions. + * You can optionally set which 'walls' to create: left, right, top or bottom. + * If none of the walls are given it will default to use the walls settings it had previously. + * I.e. if you previously told it to not have the left or right walls, and you then adjust the world size + * the newly created bounds will also not have the left and right walls. + * Explicitly state them in the parameters to override this. + * + * @method Phaser.Physics.Impact.World#setBounds + * @since 3.0.0 + * + * @param {number} [x] - The x coordinate of the top-left corner of the bounds. + * @param {number} [y] - The y coordinate of the top-left corner of the bounds. + * @param {number} [width] - The width of the bounds. + * @param {number} [height] - The height of the bounds. + * @param {number} [thickness=64] - [description] + * @param {boolean} [left=true] - If true will create the left bounds wall. + * @param {boolean} [right=true] - If true will create the right bounds wall. + * @param {boolean} [top=true] - If true will create the top bounds wall. + * @param {boolean} [bottom=true] - If true will create the bottom bounds wall. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setBounds: function (x, y, width, height, thickness, left, right, top, bottom) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.scene.sys.scale.width; } + if (height === undefined) { height = this.scene.sys.scale.height; } + if (thickness === undefined) { thickness = 64; } + if (left === undefined) { left = true; } + if (right === undefined) { right = true; } + if (top === undefined) { top = true; } + if (bottom === undefined) { bottom = true; } + + this.updateWall(left, 'left', x - thickness, y, thickness, height); + this.updateWall(right, 'right', x + width, y, thickness, height); + this.updateWall(top, 'top', x, y - thickness, width, thickness); + this.updateWall(bottom, 'bottom', x, y + height, width, thickness); + + return this; + }, + + /** + * position = 'left', 'right', 'top' or 'bottom' + * + * @method Phaser.Physics.Impact.World#updateWall + * @since 3.0.0 + * + * @param {boolean} add - [description] + * @param {string} position - [description] + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} width - [description] + * @param {number} height - [description] + */ + updateWall: function (add, position, x, y, width, height) + { + var wall = this.walls[position]; + + if (add) + { + if (wall) + { + wall.resetSize(x, y, width, height); + } + else + { + this.walls[position] = this.create(x, y, width, height); + this.walls[position].name = position; + this.walls[position].gravityFactor = 0; + this.walls[position].collides = COLLIDES.FIXED; + } + } + else + { + if (wall) + { + this.bodies.remove(wall); + } + + this.walls[position] = null; + } + }, + + /** + * Creates a Graphics Game Object used for debug display and enables the world for debug drawing. + * + * @method Phaser.Physics.Impact.World#createDebugGraphic + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Graphics} The Graphics object created that will have the debug visuals drawn to it. + */ + createDebugGraphic: function () + { + var graphic = this.scene.sys.add.graphics({ x: 0, y: 0 }); + + graphic.setDepth(Number.MAX_VALUE); + + this.debugGraphic = graphic; + + this.drawDebug = true; + + return graphic; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#getNextID + * @since 3.0.0 + * + * @return {integer} [description] + */ + getNextID: function () + { + return this._lastId++; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#create + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} sizeX - [description] + * @param {number} sizeY - [description] + * + * @return {Phaser.Physics.Impact.Body} The Body that was added to this World. + */ + create: function (x, y, sizeX, sizeY) + { + var body = new Body(this, x, y, sizeX, sizeY); + + this.bodies.set(body); + + return body; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#remove + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body} object - The Body to remove from this World. + */ + remove: function (object) + { + this.bodies.delete(object); + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#pause + * @fires Phaser.Physics.Impact.Events#PAUSE + * @since 3.0.0 + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + pause: function () + { + this.enabled = false; + + this.emit(Events.PAUSE); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#resume + * @fires Phaser.Physics.Impact.Events#RESUME + * @since 3.0.0 + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + resume: function () + { + this.enabled = true; + + this.emit(Events.RESUME); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#update + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update: function (time, delta) + { + if (!this.enabled || this.bodies.size === 0) + { + return; + } + + // Impact uses a divided delta value that is clamped to the maxStep (20fps) maximum + + var clampedDelta = Math.min(delta / 1000, this.maxStep) * this.timeScale; + + this.delta = clampedDelta; + + // Update all active bodies + + var i; + var body; + var bodies = this.bodies.entries; + var len = bodies.length; + var hash = {}; + var size = this.cellSize; + + for (i = 0; i < len; i++) + { + body = bodies[i]; + + if (body.enabled) + { + body.update(clampedDelta); + } + } + + // Run collision against them all now they're in the new positions from the update + + for (i = 0; i < len; i++) + { + body = bodies[i]; + + if (body && !body.skipHash()) + { + this.checkHash(body, hash, size); + } + } + + if (this.drawDebug) + { + var graphics = this.debugGraphic; + + graphics.clear(); + + for (i = 0; i < len; i++) + { + body = bodies[i]; + + if (body && body.willDrawDebug()) + { + body.drawDebug(graphics); + } + } + } + }, + + /** + * Check the body against the spatial hash. + * + * @method Phaser.Physics.Impact.World#checkHash + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body} body - [description] + * @param {object} hash - [description] + * @param {number} size - [description] + */ + checkHash: function (body, hash, size) + { + var checked = {}; + + var xmin = Math.floor(body.pos.x / size); + var ymin = Math.floor(body.pos.y / size); + var xmax = Math.floor((body.pos.x + body.size.x) / size) + 1; + var ymax = Math.floor((body.pos.y + body.size.y) / size) + 1; + + for (var x = xmin; x < xmax; x++) + { + for (var y = ymin; y < ymax; y++) + { + if (!hash[x]) + { + hash[x] = {}; + hash[x][y] = [ body ]; + } + else if (!hash[x][y]) + { + hash[x][y] = [ body ]; + } + else + { + var cell = hash[x][y]; + + for (var c = 0; c < cell.length; c++) + { + if (body.touches(cell[c]) && !checked[cell[c].id]) + { + checked[cell[c].id] = true; + + this.checkBodies(body, cell[c]); + } + } + + cell.push(body); + } + } + } + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#checkBodies + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body} bodyA - [description] + * @param {Phaser.Physics.Impact.Body} bodyB - [description] + */ + checkBodies: function (bodyA, bodyB) + { + // 2 fixed bodies won't do anything + if (bodyA.collides === COLLIDES.FIXED && bodyB.collides === COLLIDES.FIXED) + { + return; + } + + // bitwise checks + if (bodyA.checkAgainst & bodyB.type) + { + bodyA.check(bodyB); + } + + if (bodyB.checkAgainst & bodyA.type) + { + bodyB.check(bodyA); + } + + if (bodyA.collides && bodyB.collides && bodyA.collides + bodyB.collides > COLLIDES.ACTIVE) + { + Solver(this, bodyA, bodyB); + } + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setCollidesNever + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the collides value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setCollidesNever: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].collides = COLLIDES.NEVER; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setLite + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the collides value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setLite: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].collides = COLLIDES.LITE; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setPassive + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the collides value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setPassive: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].collides = COLLIDES.PASSIVE; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setActive + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the collides value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setActive: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].collides = COLLIDES.ACTIVE; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setFixed + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the collides value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setFixed: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].collides = COLLIDES.FIXED; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setTypeNone + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setTypeNone: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].type = TYPE.NONE; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setTypeA + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setTypeA: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].type = TYPE.A; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setTypeB + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setTypeB: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].type = TYPE.B; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setAvsB + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setAvsB: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].type = TYPE.A; + bodies[i].checkAgainst = TYPE.B; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setBvsA + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setBvsA: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].type = TYPE.B; + bodies[i].checkAgainst = TYPE.A; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setCheckAgainstNone + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setCheckAgainstNone: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].checkAgainst = TYPE.NONE; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setCheckAgainstA + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setCheckAgainstA: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].checkAgainst = TYPE.A; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#setCheckAgainstB + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body[]} bodies - An Array of Impact Bodies to set the type value on. + * + * @return {Phaser.Physics.Impact.World} This World object. + */ + setCheckAgainstB: function (bodies) + { + for (var i = 0; i < bodies.length; i++) + { + bodies[i].checkAgainst = TYPE.B; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + this.removeAllListeners(); + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.World#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.removeAllListeners(); + + this.scene = null; + + this.bodies.clear(); + + this.bodies = null; + + this.collisionMap = null; + } + +}); + +module.exports = World; + + +/***/ }), +/* 1327 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bodies = __webpack_require__(135); +var Body = __webpack_require__(60); +var Class = __webpack_require__(0); +var Composites = __webpack_require__(1329); +var Constraint = __webpack_require__(228); +var MatterGameObject = __webpack_require__(1364); +var MatterImage = __webpack_require__(1330); +var MatterSprite = __webpack_require__(1331); +var MatterTileBody = __webpack_require__(1242); +var PointerConstraint = __webpack_require__(1390); +var Vertices = __webpack_require__(84); + +/** + * @classdesc + * The Matter Factory can create different types of bodies and them to a physics world. + * + * @class Factory + * @memberof Phaser.Physics.Matter + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Physics.Matter.World} world - The Matter World which this Factory adds to. + */ +var Factory = new Class({ + + initialize: + + function Factory (world) + { + /** + * The Matter World which this Factory adds to. + * + * @name Phaser.Physics.Matter.Factory#world + * @type {Phaser.Physics.Matter.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * The Scene which this Factory's Matter World belongs to. + * + * @name Phaser.Physics.Matter.Factory#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = world.scene; + + /** + * A reference to the Scene.Systems this Matter Physics instance belongs to. + * + * @name Phaser.Physics.Matter.Factory#sys + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.sys = world.scene.sys; + }, + + /** + * Creates a new rigid rectangular Body and adds it to the World. + * + * @method Phaser.Physics.Matter.Factory#rectangle + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the center of the Body. + * @param {number} y - The Y coordinate of the center of the Body. + * @param {number} width - The width of the Body. + * @param {number} height - The height of the Body. + * @param {object} options - An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + * + * @return {MatterJS.Body} A Matter JS Body. + */ + rectangle: function (x, y, width, height, options) + { + var body = Bodies.rectangle(x, y, width, height, options); + + this.world.add(body); + + return body; + }, + + /** + * Creates a new rigid trapezoidal Body and adds it to the World. + * + * @method Phaser.Physics.Matter.Factory#trapezoid + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the center of the Body. + * @param {number} y - The Y coordinate of the center of the Body. + * @param {number} width - The width of the trapezoid of the Body. + * @param {number} height - The height of the trapezoid of the Body. + * @param {number} slope - The slope of the trapezoid. 0 creates a rectangle, while 1 creates a triangle. Positive values make the top side shorter, while negative values make the bottom side shorter. + * @param {object} options - An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + * + * @return {MatterJS.Body} A Matter JS Body. + */ + trapezoid: function (x, y, width, height, slope, options) + { + var body = Bodies.trapezoid(x, y, width, height, slope, options); + + this.world.add(body); + + return body; + }, + + /** + * Creates a new rigid circular Body and adds it to the World. + * + * @method Phaser.Physics.Matter.Factory#circle + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the center of the Body. + * @param {number} y - The Y coordinate of the center of the Body. + * @param {number} radius - The radius of the circle. + * @param {object} [options] - An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + * @param {number} [maxSides] - The maximum amount of sides to use for the polygon which will approximate this circle. + * + * @return {MatterJS.Body} A Matter JS Body. + */ + circle: function (x, y, radius, options, maxSides) + { + var body = Bodies.circle(x, y, radius, options, maxSides); + + this.world.add(body); + + return body; + }, + + /** + * Creates a new rigid polygonal Body and adds it to the World. + * + * @method Phaser.Physics.Matter.Factory#polygon + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the center of the Body. + * @param {number} y - The Y coordinate of the center of the Body. + * @param {number} sides - The number of sides the polygon will have. + * @param {number} radius - The "radius" of the polygon, i.e. the distance from its center to any vertex. This is also the radius of its circumcircle. + * @param {object} options - An object of properties to set on the Body. You can also specify a `chamfer` property to automatically adjust the body. + * + * @return {MatterJS.Body} A Matter JS Body. + */ + polygon: function (x, y, sides, radius, options) + { + var body = Bodies.polygon(x, y, sides, radius, options); + + this.world.add(body); + + return body; + }, + + /** + * Creates a body using the supplied vertices (or an array containing multiple sets of vertices) and adds it to the World. + * If the vertices are convex, they will pass through as supplied. Otherwise, if the vertices are concave, they will be decomposed. Note that this process is not guaranteed to support complex sets of vertices, e.g. ones with holes. + * + * @method Phaser.Physics.Matter.Factory#fromVertices + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the center of the Body. + * @param {number} y - The Y coordinate of the center of the Body. + * @param {(string|array)} vertexSets - [description] + * @param {object} [options] - [description] + * @param {boolean} [flagInternal=false] - Flag internal edges (coincident part edges) + * @param {number} [removeCollinear=0.01] - Whether Matter.js will discard collinear edges (to improve performance). + * @param {number} [minimumArea=10] - During decomposition discard parts that have an area less than this. + * + * @return {MatterJS.Body} A Matter JS Body. + */ + fromVertices: function (x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea) + { + if (typeof vertexSets === 'string') + { + vertexSets = Vertices.fromPath(vertexSets); + } + + var body = Bodies.fromVertices(x, y, vertexSets, options, flagInternal, removeCollinear, minimumArea); + + this.world.add(body); + + return body; + }, + + /** + * Create a new composite containing Matter Image objects created in a grid arrangement. + * This function uses the body bounds to prevent overlaps. + * + * @method Phaser.Physics.Matter.Factory#imageStack + * @since 3.0.0 + * + * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} frame - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param {number} x - The horizontal position of this composite in the world. + * @param {number} y - The vertical position of this composite in the world. + * @param {number} columns - The number of columns in the grid. + * @param {number} rows - The number of rows in the grid. + * @param {number} [columnGap=0] - The distance between each column. + * @param {number} [rowGap=0] - The distance between each row. + * @param {object} [options] - [description] + * + * @return {MatterJS.Composite} A Matter JS Composite Stack. + */ + imageStack: function (key, frame, x, y, columns, rows, columnGap, rowGap, options) + { + if (columnGap === undefined) { columnGap = 0; } + if (rowGap === undefined) { rowGap = 0; } + if (options === undefined) { options = {}; } + + var world = this.world; + var displayList = this.sys.displayList; + + options.addToWorld = false; + + var stack = Composites.stack(x, y, columns, rows, columnGap, rowGap, function (x, y) + { + var image = new MatterImage(world, x, y, key, frame, options); + + displayList.add(image); + + return image.body; + }); + + world.add(stack); + + return stack; + }, + + /** + * Create a new composite containing bodies created in the callback in a grid arrangement. + * This function uses the body bounds to prevent overlaps. + * + * @method Phaser.Physics.Matter.Factory#stack + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this composite in the world. + * @param {number} y - The vertical position of this composite in the world. + * @param {number} columns - The number of columns in the grid. + * @param {number} rows - The number of rows in the grid. + * @param {number} columnGap - The distance between each column. + * @param {number} rowGap - The distance between each row. + * @param {function} callback - The callback that creates the stack. + * + * @return {MatterJS.Composite} A new composite containing objects created in the callback. + */ + stack: function (x, y, columns, rows, columnGap, rowGap, callback) + { + var stack = Composites.stack(x, y, columns, rows, columnGap, rowGap, callback); + + this.world.add(stack); + + return stack; + }, + + /** + * Create a new composite containing bodies created in the callback in a pyramid arrangement. + * This function uses the body bounds to prevent overlaps. + * + * @method Phaser.Physics.Matter.Factory#pyramid + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this composite in the world. + * @param {number} y - The vertical position of this composite in the world. + * @param {number} columns - The number of columns in the pyramid. + * @param {number} rows - The number of rows in the pyramid. + * @param {number} columnGap - The distance between each column. + * @param {number} rowGap - The distance between each row. + * @param {function} callback - The callback function to be invoked. + * + * @return {MatterJS.Composite} A Matter JS Composite pyramid. + */ + pyramid: function (x, y, columns, rows, columnGap, rowGap, callback) + { + var stack = Composites.pyramid(x, y, columns, rows, columnGap, rowGap, callback); + + this.world.add(stack); + + return stack; + }, + + /** + * Chains all bodies in the given composite together using constraints. + * + * @method Phaser.Physics.Matter.Factory#chain + * @since 3.0.0 + * + * @param {MatterJS.Composite} composite - [description] + * @param {number} xOffsetA - [description] + * @param {number} yOffsetA - [description] + * @param {number} xOffsetB - [description] + * @param {number} yOffsetB - [description] + * @param {object} options - [description] + * + * @return {MatterJS.Composite} A new composite containing objects chained together with constraints. + */ + chain: function (composite, xOffsetA, yOffsetA, xOffsetB, yOffsetB, options) + { + return Composites.chain(composite, xOffsetA, yOffsetA, xOffsetB, yOffsetB, options); + }, + + /** + * Connects bodies in the composite with constraints in a grid pattern, with optional cross braces. + * + * @method Phaser.Physics.Matter.Factory#mesh + * @since 3.0.0 + * + * @param {MatterJS.Composite} composite - [description] + * @param {number} columns - [description] + * @param {number} rows - [description] + * @param {boolean} crossBrace - [description] + * @param {object} options - [description] + * + * @return {MatterJS.Composite} The composite containing objects meshed together with constraints. + */ + mesh: function (composite, columns, rows, crossBrace, options) + { + return Composites.mesh(composite, columns, rows, crossBrace, options); + }, + + /** + * Creates a composite with a Newton's Cradle setup of bodies and constraints. + * + * @method Phaser.Physics.Matter.Factory#newtonsCradle + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} number - [description] + * @param {number} size - [description] + * @param {number} length - [description] + * + * @return {MatterJS.Composite} A new composite newtonsCradle body. + */ + newtonsCradle: function (x, y, number, size, length) + { + var composite = Composites.newtonsCradle(x, y, number, size, length); + + this.world.add(composite); + + return composite; + }, + + /** + * Creates a composite with simple car setup of bodies and constraints. + * + * @method Phaser.Physics.Matter.Factory#car + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} width - [description] + * @param {number} height - [description] + * @param {number} wheelSize - [description] + * + * @return {MatterJS.Composite} A new composite car body. + */ + car: function (x, y, width, height, wheelSize) + { + var composite = Composites.car(x, y, width, height, wheelSize); + + this.world.add(composite); + + return composite; + }, + + /** + * Creates a simple soft body like object. + * + * @method Phaser.Physics.Matter.Factory#softBody + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this composite in the world. + * @param {number} y - The vertical position of this composite in the world. + * @param {number} columns - The number of columns in the Composite. + * @param {number} rows - The number of rows in the Composite. + * @param {number} columnGap - The distance between each column. + * @param {number} rowGap - The distance between each row. + * @param {boolean} crossBrace - [description] + * @param {number} particleRadius - The radius of this circlular composite. + * @param {object} particleOptions - [description] + * @param {object} constraintOptions - [description] + * + * @return {MatterJS.Composite} A new composite simple soft body. + */ + softBody: function (x, y, columns, rows, columnGap, rowGap, crossBrace, particleRadius, particleOptions, constraintOptions) + { + var composite = Composites.softBody(x, y, columns, rows, columnGap, rowGap, crossBrace, particleRadius, particleOptions, constraintOptions); + + this.world.add(composite); + + return composite; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Factory#joint + * @since 3.0.0 + * + * @param {MatterJS.Body} bodyA - [description] + * @param {MatterJS.Body} bodyB - [description] + * @param {number} length - [description] + * @param {number} [stiffness=1] - [description] + * @param {object} [options={}] - [description] + * + * @return {MatterJS.Constraint} A Matter JS Constraint. + */ + joint: function (bodyA, bodyB, length, stiffness, options) + { + return this.constraint(bodyA, bodyB, length, stiffness, options); + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Factory#spring + * @since 3.0.0 + * + * @param {MatterJS.Body} bodyA - The first possible `Body` that this constraint is attached to. + * @param {MatterJS.Body} bodyB - The second possible `Body` that this constraint is attached to. + * @param {number} length - A Number that specifies the target resting length of the constraint. It is calculated automatically in `Constraint.create` from initial positions of the `constraint.bodyA` and `constraint.bodyB` + * @param {number} [stiffness=1] - A Number that specifies the stiffness of the constraint, i.e. the rate at which it returns to its resting `constraint.length`. A value of `1` means the constraint should be very stiff. A value of `0.2` means the constraint acts as a soft spring. + * @param {object} [options={}] - [description] + * + * @return {MatterJS.Constraint} A Matter JS Constraint. + */ + spring: function (bodyA, bodyB, length, stiffness, options) + { + return this.constraint(bodyA, bodyB, length, stiffness, options); + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Factory#constraint + * @since 3.0.0 + * + * @param {MatterJS.Body} bodyA - [description] + * @param {MatterJS.Body} bodyB - [description] + * @param {number} [length] - [description] + * @param {number} [stiffness=1] - [description] + * @param {object} [options={}] - [description] + * + * @return {MatterJS.Constraint} A Matter JS Constraint. + */ + constraint: function (bodyA, bodyB, length, stiffness, options) + { + if (stiffness === undefined) { stiffness = 1; } + if (options === undefined) { options = {}; } + + options.bodyA = (bodyA.type === 'body') ? bodyA : bodyA.body; + options.bodyB = (bodyB.type === 'body') ? bodyB : bodyB.body; + + if (length) + { + options.length = length; + } + + options.stiffness = stiffness; + + var constraint = Constraint.create(options); + + this.world.add(constraint); + + return constraint; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Factory#worldConstraint + * @since 3.0.0 + * + * @param {MatterJS.Body} bodyB - [description] + * @param {number} length - [description] + * @param {number} [stiffness=1] - [description] + * @param {object} [options={}] - [description] + * + * @return {MatterJS.Constraint} A Matter JS Constraint. + */ + worldConstraint: function (bodyB, length, stiffness, options) + { + if (stiffness === undefined) { stiffness = 1; } + if (options === undefined) { options = {}; } + + options.bodyB = (bodyB.type === 'body') ? bodyB : bodyB.body; + options.length = length; + options.stiffness = stiffness; + + var constraint = Constraint.create(options); + + this.world.add(constraint); + + return constraint; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Factory#mouseSpring + * @since 3.0.0 + * + * @param {object} options - [description] + * + * @return {MatterJS.Constraint} A Matter JS Constraint. + */ + mouseSpring: function (options) + { + return this.pointerConstraint(options); + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Factory#pointerConstraint + * @since 3.0.0 + * + * @param {object} options - [description] + * + * @return {MatterJS.Constraint} A Matter JS Constraint. + */ + pointerConstraint: function (options) + { + if (options === undefined) { options = {}; } + + if (!options.hasOwnProperty('render')) + { + options.render = { visible: false }; + } + + var pointerConstraint = new PointerConstraint(this.scene, this.world, options); + + this.world.add(pointerConstraint.constraint); + + return pointerConstraint; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Factory#image + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param {object} [options={}] - [description] + * + * @return {Phaser.Physics.Matter.Image} [description] + */ + image: function (x, y, key, frame, options) + { + var image = new MatterImage(this.world, x, y, key, frame, options); + + this.sys.displayList.add(image); + + return image; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Factory#tileBody + * @since 3.0.0 + * + * @param {Phaser.Tilemaps.Tile} tile - [description] + * @param {object} options - [description] + * + * @return {Phaser.Physics.Matter.TileBody} [description] + */ + tileBody: function (tile, options) + { + var tileBody = new MatterTileBody(this.world, tile, options); + + return tileBody; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Factory#sprite + * @since 3.0.0 + * + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param {object} [options={}] - [description] + * + * @return {Phaser.Physics.Matter.Sprite} [description] + */ + sprite: function (x, y, key, frame, options) + { + var sprite = new MatterSprite(this.world, x, y, key, frame, options); + + this.sys.displayList.add(sprite); + this.sys.updateList.add(sprite); + + return sprite; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Factory#gameObject + * @since 3.3.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to inject the Matter Body in to. + * @param {(object|MatterJS.Body)} options - A Matter Body configuration object, or an instance of a Matter Body. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that had the Matter Body injected into it. + */ + gameObject: function (gameObject, options) + { + return MatterGameObject(this.world, gameObject, options); + }, + + /** + * Instantly sets the linear velocity of the given body. Position, angle, force etc. are unchanged. + * + * See also `force`. + * + * @method Phaser.Physics.Matter.Factory#velocity + * @since 3.18.0 + * + * @param {MatterJS.Body} body - The Matter Body to set the velocity on. + * @param {Phaser.Types.Math.Vector2Like} velocity - The velocity to set. An object with public `x` and `y` components. + * + * @return {MatterJS.Body} The Matter body. + */ + velocity: function (body, velocity) + { + Body.setVelocity(body, velocity); + + return body; + }, + + /** + * Instantly sets the angular velocity of the given body. Position, angle, force etc. are unchanged. + * + * See also `force`. + * + * @method Phaser.Physics.Matter.Factory#angularVelocity + * @since 3.18.0 + * + * @param {MatterJS.Body} body - The Matter Body to set the velocity on. + * @param {number} velocity - The angular velocity to set. + * + * @return {MatterJS.Body} The Matter body. + */ + angularVelocity: function (body, velocity) + { + Body.setAngularVelocity(body, velocity); + + return body; + }, + + /** + * Applies a force to a body from a given world-space position, including resulting torque. + * + * @method Phaser.Physics.Matter.Factory#force + * @since 3.18.0 + * + * @param {MatterJS.Body} body - The Matter Body to set the force on. + * @param {Phaser.Types.Math.Vector2Like} position - The world position to apply the force from. An object with public `x` and `y` components. + * @param {Phaser.Types.Math.Vector2Like} force - The force to set. An object with public `x` and `y` components. + * + * @return {MatterJS.Body} The Matter body. + */ + force: function (body, position, force) + { + Body.applyForce(body, position, force); + + return body; + }, + + /** + * Destroys this Factory. + * + * @method Phaser.Physics.Matter.Factory#destroy + * @since 3.5.0 + */ + destroy: function () + { + this.world = null; + this.scene = null; + this.sys = null; + } + +}); + +module.exports = Factory; + + +/***/ }), +/* 1328 */ +/***/ (function(module, exports) { + +/** + * @author Stefan Hedman (http://steffe.se) + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// v0.3.0 + +module.exports = { + decomp: polygonDecomp, + quickDecomp: polygonQuickDecomp, + isSimple: polygonIsSimple, + removeCollinearPoints: polygonRemoveCollinearPoints, + removeDuplicatePoints: polygonRemoveDuplicatePoints, + makeCCW: polygonMakeCCW +}; + +/** + * Compute the intersection between two lines. + * @static + * @method lineInt + * @param {Array} l1 Line vector 1 + * @param {Array} l2 Line vector 2 + * @param {Number} precision Precision to use when checking if the lines are parallel + * @return {Array} The intersection point. + */ +function lineInt(l1,l2,precision){ + precision = precision || 0; + var i = [0,0]; // point + var a1, b1, c1, a2, b2, c2, det; // scalars + a1 = l1[1][1] - l1[0][1]; + b1 = l1[0][0] - l1[1][0]; + c1 = a1 * l1[0][0] + b1 * l1[0][1]; + a2 = l2[1][1] - l2[0][1]; + b2 = l2[0][0] - l2[1][0]; + c2 = a2 * l2[0][0] + b2 * l2[0][1]; + det = a1 * b2 - a2*b1; + if (!scalar_eq(det, 0, precision)) { // lines are not parallel + i[0] = (b2 * c1 - b1 * c2) / det; + i[1] = (a1 * c2 - a2 * c1) / det; + } + return i; +} + +/** + * Checks if two line segments intersects. + * @method segmentsIntersect + * @param {Array} p1 The start vertex of the first line segment. + * @param {Array} p2 The end vertex of the first line segment. + * @param {Array} q1 The start vertex of the second line segment. + * @param {Array} q2 The end vertex of the second line segment. + * @return {Boolean} True if the two line segments intersect + */ +function lineSegmentsIntersect(p1, p2, q1, q2){ + var dx = p2[0] - p1[0]; + var dy = p2[1] - p1[1]; + var da = q2[0] - q1[0]; + var db = q2[1] - q1[1]; + + // segments are parallel + if((da*dy - db*dx) === 0){ + return false; + } + + var s = (dx * (q1[1] - p1[1]) + dy * (p1[0] - q1[0])) / (da * dy - db * dx); + var t = (da * (p1[1] - q1[1]) + db * (q1[0] - p1[0])) / (db * dx - da * dy); + + return (s>=0 && s<=1 && t>=0 && t<=1); +} + +/** + * Get the area of a triangle spanned by the three given points. Note that the area will be negative if the points are not given in counter-clockwise order. + * @static + * @method area + * @param {Array} a + * @param {Array} b + * @param {Array} c + * @return {Number} + */ +function triangleArea(a,b,c){ + return (((b[0] - a[0])*(c[1] - a[1]))-((c[0] - a[0])*(b[1] - a[1]))); +} + +function isLeft(a,b,c){ + return triangleArea(a,b,c) > 0; +} + +function isLeftOn(a,b,c) { + return triangleArea(a, b, c) >= 0; +} + +function isRight(a,b,c) { + return triangleArea(a, b, c) < 0; +} + +function isRightOn(a,b,c) { + return triangleArea(a, b, c) <= 0; +} + +var tmpPoint1 = [], + tmpPoint2 = []; + +/** + * Check if three points are collinear + * @method collinear + * @param {Array} a + * @param {Array} b + * @param {Array} c + * @param {Number} [thresholdAngle=0] Threshold angle to use when comparing the vectors. The function will return true if the angle between the resulting vectors is less than this value. Use zero for max precision. + * @return {Boolean} + */ +function collinear(a,b,c,thresholdAngle) { + if(!thresholdAngle){ + return triangleArea(a, b, c) === 0; + } else { + var ab = tmpPoint1, + bc = tmpPoint2; + + ab[0] = b[0]-a[0]; + ab[1] = b[1]-a[1]; + bc[0] = c[0]-b[0]; + bc[1] = c[1]-b[1]; + + var dot = ab[0]*bc[0] + ab[1]*bc[1], + magA = Math.sqrt(ab[0]*ab[0] + ab[1]*ab[1]), + magB = Math.sqrt(bc[0]*bc[0] + bc[1]*bc[1]), + angle = Math.acos(dot/(magA*magB)); + return angle < thresholdAngle; + } +} + +function sqdist(a,b){ + var dx = b[0] - a[0]; + var dy = b[1] - a[1]; + return dx * dx + dy * dy; +} + +/** + * Get a vertex at position i. It does not matter if i is out of bounds, this function will just cycle. + * @method at + * @param {Number} i + * @return {Array} + */ +function polygonAt(polygon, i){ + var s = polygon.length; + return polygon[i < 0 ? i % s + s : i % s]; +} + +/** + * Clear the polygon data + * @method clear + * @return {Array} + */ +function polygonClear(polygon){ + polygon.length = 0; +} + +/** + * Append points "from" to "to"-1 from an other polygon "poly" onto this one. + * @method append + * @param {Polygon} poly The polygon to get points from. + * @param {Number} from The vertex index in "poly". + * @param {Number} to The end vertex index in "poly". Note that this vertex is NOT included when appending. + * @return {Array} + */ +function polygonAppend(polygon, poly, from, to){ + for(var i=from; i v[br][0])) { + br = i; + } + } + + // reverse poly if clockwise + if (!isLeft(polygonAt(polygon, br - 1), polygonAt(polygon, br), polygonAt(polygon, br + 1))) { + polygonReverse(polygon); + return true; + } else { + return false; + } +} + +/** + * Reverse the vertices in the polygon + * @method reverse + */ +function polygonReverse(polygon){ + var tmp = []; + var N = polygon.length; + for(var i=0; i!==N; i++){ + tmp.push(polygon.pop()); + } + for(var i=0; i!==N; i++){ + polygon[i] = tmp[i]; + } +} + +/** + * Check if a point in the polygon is a reflex point + * @method isReflex + * @param {Number} i + * @return {Boolean} + */ +function polygonIsReflex(polygon, i){ + return isRight(polygonAt(polygon, i - 1), polygonAt(polygon, i), polygonAt(polygon, i + 1)); +} + +var tmpLine1=[], + tmpLine2=[]; + +/** + * Check if two vertices in the polygon can see each other + * @method canSee + * @param {Number} a Vertex index 1 + * @param {Number} b Vertex index 2 + * @return {Boolean} + */ +function polygonCanSee(polygon, a,b) { + var p, dist, l1=tmpLine1, l2=tmpLine2; + + if (isLeftOn(polygonAt(polygon, a + 1), polygonAt(polygon, a), polygonAt(polygon, b)) && isRightOn(polygonAt(polygon, a - 1), polygonAt(polygon, a), polygonAt(polygon, b))) { + return false; + } + dist = sqdist(polygonAt(polygon, a), polygonAt(polygon, b)); + for (var i = 0; i !== polygon.length; ++i) { // for each edge + if ((i + 1) % polygon.length === a || i === a){ // ignore incident edges + continue; + } + if (isLeftOn(polygonAt(polygon, a), polygonAt(polygon, b), polygonAt(polygon, i + 1)) && isRightOn(polygonAt(polygon, a), polygonAt(polygon, b), polygonAt(polygon, i))) { // if diag intersects an edge + l1[0] = polygonAt(polygon, a); + l1[1] = polygonAt(polygon, b); + l2[0] = polygonAt(polygon, i); + l2[1] = polygonAt(polygon, i + 1); + p = lineInt(l1,l2); + if (sqdist(polygonAt(polygon, a), p) < dist) { // if edge is blocking visibility to b + return false; + } + } + } + + return true; +} + +/** + * Check if two vertices in the polygon can see each other + * @method canSee2 + * @param {Number} a Vertex index 1 + * @param {Number} b Vertex index 2 + * @return {Boolean} + */ +function polygonCanSee2(polygon, a,b) { + // for each edge + for (var i = 0; i !== polygon.length; ++i) { + // ignore incident edges + if (i === a || i === b || (i + 1) % polygon.length === a || (i + 1) % polygon.length === b){ + continue; + } + if( lineSegmentsIntersect(polygonAt(polygon, a), polygonAt(polygon, b), polygonAt(polygon, i), polygonAt(polygon, i+1)) ){ + return false; + } + } + return true; +} + +/** + * Copy the polygon from vertex i to vertex j. + * @method copy + * @param {Number} i + * @param {Number} j + * @param {Polygon} [targetPoly] Optional target polygon to save in. + * @return {Polygon} The resulting copy. + */ +function polygonCopy(polygon, i,j,targetPoly){ + var p = targetPoly || []; + polygonClear(p); + if (i < j) { + // Insert all vertices from i to j + for(var k=i; k<=j; k++){ + p.push(polygon[k]); + } + + } else { + + // Insert vertices 0 to j + for(var k=0; k<=j; k++){ + p.push(polygon[k]); + } + + // Insert vertices i to end + for(var k=i; k 0){ + return polygonSlice(polygon, edges); + } else { + return [polygon]; + } +} + +/** + * Slices the polygon given one or more cut edges. If given one, this function will return two polygons (false on failure). If many, an array of polygons. + * @method slice + * @param {Array} cutEdges A list of edges, as returned by .getCutEdges() + * @return {Array} + */ +function polygonSlice(polygon, cutEdges){ + if(cutEdges.length === 0){ + return [polygon]; + } + if(cutEdges instanceof Array && cutEdges.length && cutEdges[0] instanceof Array && cutEdges[0].length===2 && cutEdges[0][0] instanceof Array){ + + var polys = [polygon]; + + for(var i=0; i maxlevel){ + console.warn("quickDecomp: max level ("+maxlevel+") reached."); + return result; + } + + for (var i = 0; i < polygon.length; ++i) { + if (polygonIsReflex(poly, i)) { + reflexVertices.push(poly[i]); + upperDist = lowerDist = Number.MAX_VALUE; + + + for (var j = 0; j < polygon.length; ++j) { + if (isLeft(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j)) && isRightOn(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j - 1))) { // if line intersects with an edge + p = getIntersectionPoint(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j), polygonAt(poly, j - 1)); // find the point of intersection + if (isRight(polygonAt(poly, i + 1), polygonAt(poly, i), p)) { // make sure it's inside the poly + d = sqdist(poly[i], p); + if (d < lowerDist) { // keep only the closest intersection + lowerDist = d; + lowerInt = p; + lowerIndex = j; + } + } + } + if (isLeft(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j + 1)) && isRightOn(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j))) { + p = getIntersectionPoint(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j), polygonAt(poly, j + 1)); + if (isLeft(polygonAt(poly, i - 1), polygonAt(poly, i), p)) { + d = sqdist(poly[i], p); + if (d < upperDist) { + upperDist = d; + upperInt = p; + upperIndex = j; + } + } + } + } + + // if there are no vertices to connect to, choose a point in the middle + if (lowerIndex === (upperIndex + 1) % polygon.length) { + //console.log("Case 1: Vertex("+i+"), lowerIndex("+lowerIndex+"), upperIndex("+upperIndex+"), poly.size("+polygon.length+")"); + p[0] = (lowerInt[0] + upperInt[0]) / 2; + p[1] = (lowerInt[1] + upperInt[1]) / 2; + steinerPoints.push(p); + + if (i < upperIndex) { + //lowerPoly.insert(lowerPoly.end(), poly.begin() + i, poly.begin() + upperIndex + 1); + polygonAppend(lowerPoly, poly, i, upperIndex+1); + lowerPoly.push(p); + upperPoly.push(p); + if (lowerIndex !== 0){ + //upperPoly.insert(upperPoly.end(), poly.begin() + lowerIndex, poly.end()); + polygonAppend(upperPoly, poly,lowerIndex,poly.length); + } + //upperPoly.insert(upperPoly.end(), poly.begin(), poly.begin() + i + 1); + polygonAppend(upperPoly, poly,0,i+1); + } else { + if (i !== 0){ + //lowerPoly.insert(lowerPoly.end(), poly.begin() + i, poly.end()); + polygonAppend(lowerPoly, poly,i,poly.length); + } + //lowerPoly.insert(lowerPoly.end(), poly.begin(), poly.begin() + upperIndex + 1); + polygonAppend(lowerPoly, poly,0,upperIndex+1); + lowerPoly.push(p); + upperPoly.push(p); + //upperPoly.insert(upperPoly.end(), poly.begin() + lowerIndex, poly.begin() + i + 1); + polygonAppend(upperPoly, poly,lowerIndex,i+1); + } + } else { + // connect to the closest point within the triangle + //console.log("Case 2: Vertex("+i+"), closestIndex("+closestIndex+"), poly.size("+polygon.length+")\n"); + + if (lowerIndex > upperIndex) { + upperIndex += polygon.length; + } + closestDist = Number.MAX_VALUE; + + if(upperIndex < lowerIndex){ + return result; + } + + for (var j = lowerIndex; j <= upperIndex; ++j) { + if ( + isLeftOn(polygonAt(poly, i - 1), polygonAt(poly, i), polygonAt(poly, j)) && + isRightOn(polygonAt(poly, i + 1), polygonAt(poly, i), polygonAt(poly, j)) + ) { + d = sqdist(polygonAt(poly, i), polygonAt(poly, j)); + if (d < closestDist && polygonCanSee2(poly, i, j)) { + closestDist = d; + closestIndex = j % polygon.length; + } + } + } + + if (i < closestIndex) { + polygonAppend(lowerPoly, poly,i,closestIndex+1); + if (closestIndex !== 0){ + polygonAppend(upperPoly, poly,closestIndex,v.length); + } + polygonAppend(upperPoly, poly,0,i+1); + } else { + if (i !== 0){ + polygonAppend(lowerPoly, poly,i,v.length); + } + polygonAppend(lowerPoly, poly,0,closestIndex+1); + polygonAppend(upperPoly, poly,closestIndex,i+1); + } + } + + // solve smallest poly first + if (lowerPoly.length < upperPoly.length) { + polygonQuickDecomp(lowerPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level); + polygonQuickDecomp(upperPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level); + } else { + polygonQuickDecomp(upperPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level); + polygonQuickDecomp(lowerPoly,result,reflexVertices,steinerPoints,delta,maxlevel,level); + } + + return result; + } + } + result.push(polygon); + + return result; +} + +/** + * Remove collinear points in the polygon. + * @method removeCollinearPoints + * @param {Number} [precision] The threshold angle to use when determining whether two edges are collinear. Use zero for finest precision. + * @return {Number} The number of points removed + */ +function polygonRemoveCollinearPoints(polygon, precision){ + var num = 0; + for(var i=polygon.length-1; polygon.length>3 && i>=0; --i){ + if(collinear(polygonAt(polygon, i-1),polygonAt(polygon, i),polygonAt(polygon, i+1),precision)){ + // Remove the middle point + polygon.splice(i%polygon.length,1); + num++; + } + } + return num; +} + +/** + * Remove duplicate points in the polygon. + * @method removeDuplicatePoints + * @param {Number} [precision] The threshold to use when determining whether two points are the same. Use zero for best precision. + */ +function polygonRemoveDuplicatePoints(polygon, precision){ + for(var i=polygon.length-1; i>=1; --i){ + var pi = polygon[i]; + for(var j=i-1; j>=0; --j){ + if(points_eq(pi, polygon[j], precision)){ + polygon.splice(i,1); + continue; + } + } + } +} + +/** + * Check if two scalars are equal + * @static + * @method eq + * @param {Number} a + * @param {Number} b + * @param {Number} [precision] + * @return {Boolean} + */ +function scalar_eq(a,b,precision){ + precision = precision || 0; + return Math.abs(a-b) <= precision; +} + +/** + * Check if two points are equal + * @static + * @method points_eq + * @param {Array} a + * @param {Array} b + * @param {Number} [precision] + * @return {Boolean} + */ +function points_eq(a,b,precision){ + return scalar_eq(a[0],b[0],precision) && scalar_eq(a[1],b[1],precision); +} + + +/***/ }), +/* 1329 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Composites` module contains factory methods for creating composite bodies +* with commonly used configurations (such as stacks and chains). +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Composites +*/ + +var Composites = {}; + +module.exports = Composites; + +var Composite = __webpack_require__(209); +var Constraint = __webpack_require__(228); +var Common = __webpack_require__(37); +var Body = __webpack_require__(60); +var Bodies = __webpack_require__(135); + +(function() { + + /** + * Create a new composite containing bodies created in the callback in a grid arrangement. + * This function uses the body's bounds to prevent overlaps. + * @method stack + * @param {number} xx + * @param {number} yy + * @param {number} columns + * @param {number} rows + * @param {number} columnGap + * @param {number} rowGap + * @param {function} callback + * @return {composite} A new composite containing objects created in the callback + */ + Composites.stack = function(xx, yy, columns, rows, columnGap, rowGap, callback) { + var stack = Composite.create({ label: 'Stack' }), + x = xx, + y = yy, + lastBody, + i = 0; + + for (var row = 0; row < rows; row++) { + var maxHeight = 0; + + for (var column = 0; column < columns; column++) { + var body = callback(x, y, column, row, lastBody, i); + + if (body) { + var bodyHeight = body.bounds.max.y - body.bounds.min.y, + bodyWidth = body.bounds.max.x - body.bounds.min.x; + + if (bodyHeight > maxHeight) + maxHeight = bodyHeight; + + Body.translate(body, { x: bodyWidth * 0.5, y: bodyHeight * 0.5 }); + + x = body.bounds.max.x + columnGap; + + Composite.addBody(stack, body); + + lastBody = body; + i += 1; + } else { + x += columnGap; + } + } + + y += maxHeight + rowGap; + x = xx; + } + + return stack; + }; + + /** + * Chains all bodies in the given composite together using constraints. + * @method chain + * @param {composite} composite + * @param {number} xOffsetA + * @param {number} yOffsetA + * @param {number} xOffsetB + * @param {number} yOffsetB + * @param {object} options + * @return {composite} A new composite containing objects chained together with constraints + */ + Composites.chain = function(composite, xOffsetA, yOffsetA, xOffsetB, yOffsetB, options) { + var bodies = composite.bodies; + + for (var i = 1; i < bodies.length; i++) { + var bodyA = bodies[i - 1], + bodyB = bodies[i], + bodyAHeight = bodyA.bounds.max.y - bodyA.bounds.min.y, + bodyAWidth = bodyA.bounds.max.x - bodyA.bounds.min.x, + bodyBHeight = bodyB.bounds.max.y - bodyB.bounds.min.y, + bodyBWidth = bodyB.bounds.max.x - bodyB.bounds.min.x; + + var defaults = { + bodyA: bodyA, + pointA: { x: bodyAWidth * xOffsetA, y: bodyAHeight * yOffsetA }, + bodyB: bodyB, + pointB: { x: bodyBWidth * xOffsetB, y: bodyBHeight * yOffsetB } + }; + + var constraint = Common.extend(defaults, options); + + Composite.addConstraint(composite, Constraint.create(constraint)); + } + + composite.label += ' Chain'; + + return composite; + }; + + /** + * Connects bodies in the composite with constraints in a grid pattern, with optional cross braces. + * @method mesh + * @param {composite} composite + * @param {number} columns + * @param {number} rows + * @param {boolean} crossBrace + * @param {object} options + * @return {composite} The composite containing objects meshed together with constraints + */ + Composites.mesh = function(composite, columns, rows, crossBrace, options) { + var bodies = composite.bodies, + row, + col, + bodyA, + bodyB, + bodyC; + + for (row = 0; row < rows; row++) { + for (col = 1; col < columns; col++) { + bodyA = bodies[(col - 1) + (row * columns)]; + bodyB = bodies[col + (row * columns)]; + Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyA, bodyB: bodyB }, options))); + } + + if (row > 0) { + for (col = 0; col < columns; col++) { + bodyA = bodies[col + ((row - 1) * columns)]; + bodyB = bodies[col + (row * columns)]; + Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyA, bodyB: bodyB }, options))); + + if (crossBrace && col > 0) { + bodyC = bodies[(col - 1) + ((row - 1) * columns)]; + Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyC, bodyB: bodyB }, options))); + } + + if (crossBrace && col < columns - 1) { + bodyC = bodies[(col + 1) + ((row - 1) * columns)]; + Composite.addConstraint(composite, Constraint.create(Common.extend({ bodyA: bodyC, bodyB: bodyB }, options))); + } + } + } + } + + composite.label += ' Mesh'; + + return composite; + }; + + /** + * Create a new composite containing bodies created in the callback in a pyramid arrangement. + * This function uses the body's bounds to prevent overlaps. + * @method pyramid + * @param {number} xx + * @param {number} yy + * @param {number} columns + * @param {number} rows + * @param {number} columnGap + * @param {number} rowGap + * @param {function} callback + * @return {composite} A new composite containing objects created in the callback + */ + Composites.pyramid = function(xx, yy, columns, rows, columnGap, rowGap, callback) { + return Composites.stack(xx, yy, columns, rows, columnGap, rowGap, function(x, y, column, row, lastBody, i) { + var actualRows = Math.min(rows, Math.ceil(columns / 2)), + lastBodyWidth = lastBody ? lastBody.bounds.max.x - lastBody.bounds.min.x : 0; + + if (row > actualRows) + return; + + // reverse row order + row = actualRows - row; + + var start = row, + end = columns - 1 - row; + + if (column < start || column > end) + return; + + // retroactively fix the first body's position, since width was unknown + if (i === 1) { + Body.translate(lastBody, { x: (column + (columns % 2 === 1 ? 1 : -1)) * lastBodyWidth, y: 0 }); + } + + var xOffset = lastBody ? column * lastBodyWidth : 0; + + return callback(xx + xOffset + column * columnGap, y, column, row, lastBody, i); + }); + }; + + /** + * Creates a composite with a Newton's Cradle setup of bodies and constraints. + * @method newtonsCradle + * @param {number} xx + * @param {number} yy + * @param {number} number + * @param {number} size + * @param {number} length + * @return {composite} A new composite newtonsCradle body + */ + Composites.newtonsCradle = function(xx, yy, number, size, length) { + var newtonsCradle = Composite.create({ label: 'Newtons Cradle' }); + + for (var i = 0; i < number; i++) { + var separation = 1.9, + circle = Bodies.circle(xx + i * (size * separation), yy + length, size, + { inertia: Infinity, restitution: 1, friction: 0, frictionAir: 0.0001, slop: 1 }), + constraint = Constraint.create({ pointA: { x: xx + i * (size * separation), y: yy }, bodyB: circle }); + + Composite.addBody(newtonsCradle, circle); + Composite.addConstraint(newtonsCradle, constraint); + } + + return newtonsCradle; + }; + + /** + * Creates a composite with simple car setup of bodies and constraints. + * @method car + * @param {number} xx + * @param {number} yy + * @param {number} width + * @param {number} height + * @param {number} wheelSize + * @return {composite} A new composite car body + */ + Composites.car = function(xx, yy, width, height, wheelSize) { + var group = Body.nextGroup(true), + wheelBase = 20, + wheelAOffset = -width * 0.5 + wheelBase, + wheelBOffset = width * 0.5 - wheelBase, + wheelYOffset = 0; + + var car = Composite.create({ label: 'Car' }), + body = Bodies.rectangle(xx, yy, width, height, { + collisionFilter: { + group: group + }, + chamfer: { + radius: height * 0.5 + }, + density: 0.0002 + }); + + var wheelA = Bodies.circle(xx + wheelAOffset, yy + wheelYOffset, wheelSize, { + collisionFilter: { + group: group + }, + friction: 0.8 + }); + + var wheelB = Bodies.circle(xx + wheelBOffset, yy + wheelYOffset, wheelSize, { + collisionFilter: { + group: group + }, + friction: 0.8 + }); + + var axelA = Constraint.create({ + bodyB: body, + pointB: { x: wheelAOffset, y: wheelYOffset }, + bodyA: wheelA, + stiffness: 1, + length: 0 + }); + + var axelB = Constraint.create({ + bodyB: body, + pointB: { x: wheelBOffset, y: wheelYOffset }, + bodyA: wheelB, + stiffness: 1, + length: 0 + }); + + Composite.addBody(car, body); + Composite.addBody(car, wheelA); + Composite.addBody(car, wheelB); + Composite.addConstraint(car, axelA); + Composite.addConstraint(car, axelB); + + return car; + }; + + /** + * Creates a simple soft body like object. + * @method softBody + * @param {number} xx + * @param {number} yy + * @param {number} columns + * @param {number} rows + * @param {number} columnGap + * @param {number} rowGap + * @param {boolean} crossBrace + * @param {number} particleRadius + * @param {} particleOptions + * @param {} constraintOptions + * @return {composite} A new composite softBody + */ + Composites.softBody = function(xx, yy, columns, rows, columnGap, rowGap, crossBrace, particleRadius, particleOptions, constraintOptions) { + particleOptions = Common.extend({ inertia: Infinity }, particleOptions); + constraintOptions = Common.extend({ stiffness: 0.2, render: { type: 'line', anchors: false } }, constraintOptions); + + var softBody = Composites.stack(xx, yy, columns, rows, columnGap, rowGap, function(x, y) { + return Bodies.circle(x, y, particleRadius, particleOptions); + }); + + Composites.mesh(softBody, columns, rows, crossBrace, constraintOptions); + + softBody.label = 'Soft Body'; + + return softBody; + }; + +})(); + + +/***/ }), +/* 1330 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Components = __webpack_require__(488); +var GameObject = __webpack_require__(13); +var GetFastValue = __webpack_require__(2); +var Image = __webpack_require__(95); +var Pipeline = __webpack_require__(151); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Matter Physics Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + * + * @class Image + * @extends Phaser.GameObjects.Image + * @memberof Phaser.Physics.Matter + * @constructor + * @since 3.0.0 + * + * @extends Phaser.Physics.Matter.Components.Bounce + * @extends Phaser.Physics.Matter.Components.Collision + * @extends Phaser.Physics.Matter.Components.Force + * @extends Phaser.Physics.Matter.Components.Friction + * @extends Phaser.Physics.Matter.Components.Gravity + * @extends Phaser.Physics.Matter.Components.Mass + * @extends Phaser.Physics.Matter.Components.Sensor + * @extends Phaser.Physics.Matter.Components.SetBody + * @extends Phaser.Physics.Matter.Components.Sleep + * @extends Phaser.Physics.Matter.Components.Static + * @extends Phaser.Physics.Matter.Components.Transform + * @extends Phaser.Physics.Matter.Components.Velocity + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Physics.Matter.World} world - [description] + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {object} [options={}] - Matter.js configuration object. + */ +var MatterImage = new Class({ + + Extends: Image, + + Mixins: [ + Components.Bounce, + Components.Collision, + Components.Force, + Components.Friction, + Components.Gravity, + Components.Mass, + Components.Sensor, + Components.SetBody, + Components.Sleep, + Components.Static, + Components.Transform, + Components.Velocity, + Pipeline + ], + + initialize: + + function MatterImage (world, x, y, texture, frame, options) + { + GameObject.call(this, world.scene, 'Image'); + + this.setTexture(texture, frame); + this.setSizeToFrame(); + this.setOrigin(); + + /** + * [description] + * + * @name Phaser.Physics.Matter.Image#world + * @type {Phaser.Physics.Matter.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * [description] + * + * @name Phaser.Physics.Matter.Image#_tempVec2 + * @type {Phaser.Math.Vector2} + * @private + * @since 3.0.0 + */ + this._tempVec2 = new Vector2(x, y); + + var shape = GetFastValue(options, 'shape', null); + + if (shape) + { + this.setBody(shape, options); + } + else + { + this.setRectangle(this.width, this.height, options); + } + + this.setPosition(x, y); + + this.initPipeline('TextureTintPipeline'); + } + +}); + +module.exports = MatterImage; + + +/***/ }), +/* 1331 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var AnimationComponent = __webpack_require__(479); +var Class = __webpack_require__(0); +var Components = __webpack_require__(488); +var GameObject = __webpack_require__(13); +var GetFastValue = __webpack_require__(2); +var Pipeline = __webpack_require__(151); +var Sprite = __webpack_require__(67); +var Vector2 = __webpack_require__(4); + +/** + * @classdesc + * A Matter Physics Sprite Game Object. + * + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + * + * @class Sprite + * @extends Phaser.GameObjects.Sprite + * @memberof Phaser.Physics.Matter + * @constructor + * @since 3.0.0 + * + * @extends Phaser.Physics.Matter.Components.Bounce + * @extends Phaser.Physics.Matter.Components.Collision + * @extends Phaser.Physics.Matter.Components.Force + * @extends Phaser.Physics.Matter.Components.Friction + * @extends Phaser.Physics.Matter.Components.Gravity + * @extends Phaser.Physics.Matter.Components.Mass + * @extends Phaser.Physics.Matter.Components.Sensor + * @extends Phaser.Physics.Matter.Components.SetBody + * @extends Phaser.Physics.Matter.Components.Sleep + * @extends Phaser.Physics.Matter.Components.Static + * @extends Phaser.Physics.Matter.Components.Transform + * @extends Phaser.Physics.Matter.Components.Velocity + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Physics.Matter.World} world - [description] + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {object} [options={}] - Matter.js configuration object. + */ +var MatterSprite = new Class({ + + Extends: Sprite, + + Mixins: [ + Components.Bounce, + Components.Collision, + Components.Force, + Components.Friction, + Components.Gravity, + Components.Mass, + Components.Sensor, + Components.SetBody, + Components.Sleep, + Components.Static, + Components.Transform, + Components.Velocity, + Pipeline + ], + + initialize: + + function MatterSprite (world, x, y, texture, frame, options) + { + GameObject.call(this, world.scene, 'Sprite'); + + this.anims = new AnimationComponent(this); + + this.setTexture(texture, frame); + this.setSizeToFrame(); + this.setOrigin(); + + /** + * [description] + * + * @name Phaser.Physics.Matter.Sprite#world + * @type {Phaser.Physics.Matter.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * [description] + * + * @name Phaser.Physics.Matter.Sprite#_tempVec2 + * @type {Phaser.Math.Vector2} + * @private + * @since 3.0.0 + */ + this._tempVec2 = new Vector2(x, y); + + var shape = GetFastValue(options, 'shape', null); + + if (shape) + { + this.setBody(shape, options); + } + else + { + this.setRectangle(this.width, this.height, options); + } + + this.setPosition(x, y); + + this.initPipeline('TextureTintPipeline'); + } + +}); + +module.exports = MatterSprite; + + +/***/ }), +/* 1332 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter` module is the top level namespace. It also includes a function for installing plugins on top of the library. +* +* @class Matter +*/ + +var Matter = {}; + +module.exports = Matter; + +var Plugin = __webpack_require__(1246); +var Common = __webpack_require__(37); + +(function() { + + /** + * The library name. + * @property name + * @readOnly + * @type {String} + */ + Matter.name = 'matter-js'; + + /** + * The library version. + * @property version + * @readOnly + * @type {String} + */ + Matter.version = '0.14.2'; + + /** + * A list of plugin dependencies to be installed. These are normally set and installed through `Matter.use`. + * Alternatively you may set `Matter.uses` manually and install them by calling `Plugin.use(Matter)`. + * @property uses + * @type {Array} + */ + Matter.uses = []; + + /** + * The plugins that have been installed through `Matter.Plugin.install`. Read only. + * @property used + * @readOnly + * @type {Array} + */ + Matter.used = []; + + /** + * Installs the given plugins on the `Matter` namespace. + * This is a short-hand for `Plugin.use`, see it for more information. + * Call this function once at the start of your code, with all of the plugins you wish to install as arguments. + * Avoid calling this function multiple times unless you intend to manually control installation order. + * @method use + * @param ...plugin {Function} The plugin(s) to install on `base` (multi-argument). + */ + Matter.use = function() { + Plugin.use(Matter, Array.prototype.slice.call(arguments)); + }; + + /** + * Chains a function to excute before the original function on the given `path` relative to `Matter`. + * See also docs for `Common.chain`. + * @method before + * @param {string} path The path relative to `Matter` + * @param {function} func The function to chain before the original + * @return {function} The chained function that replaced the original + */ + Matter.before = function(path, func) { + path = path.replace(/^Matter./, ''); + return Common.chainPathBefore(Matter, path, func); + }; + + /** + * Chains a function to excute after the original function on the given `path` relative to `Matter`. + * See also docs for `Common.chain`. + * @method after + * @param {string} path The path relative to `Matter` + * @param {function} func The function to chain after the original + * @return {function} The chained function that replaced the original + */ + Matter.after = function(path, func) { + path = path.replace(/^Matter./, ''); + return Common.chainPathAfter(Matter, path, func); + }; + +})(); + + +/***/ }), +/* 1333 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Grid` module contains methods for creating and manipulating collision broadphase grid structures. +* +* @class Grid +*/ + +var Grid = {}; + +module.exports = Grid; + +var Pair = __webpack_require__(489); +var Detector = __webpack_require__(1243); +var Common = __webpack_require__(37); + +(function() { + + /** + * Creates a new grid. + * @method create + * @param {} options + * @return {grid} A new grid + */ + Grid.create = function(options) { + var defaults = { + controller: Grid, + detector: Detector.collisions, + buckets: {}, + pairs: {}, + pairsList: [], + bucketWidth: 48, + bucketHeight: 48 + }; + + return Common.extend(defaults, options); + }; + + /** + * The width of a single grid bucket. + * + * @property bucketWidth + * @type number + * @default 48 + */ + + /** + * The height of a single grid bucket. + * + * @property bucketHeight + * @type number + * @default 48 + */ + + /** + * Updates the grid. + * @method update + * @param {grid} grid + * @param {body[]} bodies + * @param {engine} engine + * @param {boolean} forceUpdate + */ + Grid.update = function(grid, bodies, engine, forceUpdate) { + var i, col, row, + world = engine.world, + buckets = grid.buckets, + bucket, + bucketId, + gridChanged = false; + + // @if DEBUG + var metrics = engine.metrics; + metrics.broadphaseTests = 0; + // @endif + + for (i = 0; i < bodies.length; i++) { + var body = bodies[i]; + + if (body.isSleeping && !forceUpdate) + continue; + + // don't update out of world bodies + if (body.bounds.max.x < world.bounds.min.x || body.bounds.min.x > world.bounds.max.x + || body.bounds.max.y < world.bounds.min.y || body.bounds.min.y > world.bounds.max.y) + continue; + + var newRegion = Grid._getRegion(grid, body); + + // if the body has changed grid region + if (!body.region || newRegion.id !== body.region.id || forceUpdate) { + + // @if DEBUG + metrics.broadphaseTests += 1; + // @endif + + if (!body.region || forceUpdate) + body.region = newRegion; + + var union = Grid._regionUnion(newRegion, body.region); + + // update grid buckets affected by region change + // iterate over the union of both regions + for (col = union.startCol; col <= union.endCol; col++) { + for (row = union.startRow; row <= union.endRow; row++) { + bucketId = Grid._getBucketId(col, row); + bucket = buckets[bucketId]; + + var isInsideNewRegion = (col >= newRegion.startCol && col <= newRegion.endCol + && row >= newRegion.startRow && row <= newRegion.endRow); + + var isInsideOldRegion = (col >= body.region.startCol && col <= body.region.endCol + && row >= body.region.startRow && row <= body.region.endRow); + + // remove from old region buckets + if (!isInsideNewRegion && isInsideOldRegion) { + if (isInsideOldRegion) { + if (bucket) + Grid._bucketRemoveBody(grid, bucket, body); + } + } + + // add to new region buckets + if (body.region === newRegion || (isInsideNewRegion && !isInsideOldRegion) || forceUpdate) { + if (!bucket) + bucket = Grid._createBucket(buckets, bucketId); + Grid._bucketAddBody(grid, bucket, body); + } + } + } + + // set the new region + body.region = newRegion; + + // flag changes so we can update pairs + gridChanged = true; + } + } + + // update pairs list only if pairs changed (i.e. a body changed region) + if (gridChanged) + grid.pairsList = Grid._createActivePairsList(grid); + }; + + /** + * Clears the grid. + * @method clear + * @param {grid} grid + */ + Grid.clear = function(grid) { + grid.buckets = {}; + grid.pairs = {}; + grid.pairsList = []; + }; + + /** + * Finds the union of two regions. + * @method _regionUnion + * @private + * @param {} regionA + * @param {} regionB + * @return {} region + */ + Grid._regionUnion = function(regionA, regionB) { + var startCol = Math.min(regionA.startCol, regionB.startCol), + endCol = Math.max(regionA.endCol, regionB.endCol), + startRow = Math.min(regionA.startRow, regionB.startRow), + endRow = Math.max(regionA.endRow, regionB.endRow); + + return Grid._createRegion(startCol, endCol, startRow, endRow); + }; + + /** + * Gets the region a given body falls in for a given grid. + * @method _getRegion + * @private + * @param {} grid + * @param {} body + * @return {} region + */ + Grid._getRegion = function(grid, body) { + var bounds = body.bounds, + startCol = Math.floor(bounds.min.x / grid.bucketWidth), + endCol = Math.floor(bounds.max.x / grid.bucketWidth), + startRow = Math.floor(bounds.min.y / grid.bucketHeight), + endRow = Math.floor(bounds.max.y / grid.bucketHeight); + + return Grid._createRegion(startCol, endCol, startRow, endRow); + }; + + /** + * Creates a region. + * @method _createRegion + * @private + * @param {} startCol + * @param {} endCol + * @param {} startRow + * @param {} endRow + * @return {} region + */ + Grid._createRegion = function(startCol, endCol, startRow, endRow) { + return { + id: startCol + ',' + endCol + ',' + startRow + ',' + endRow, + startCol: startCol, + endCol: endCol, + startRow: startRow, + endRow: endRow + }; + }; + + /** + * Gets the bucket id at the given position. + * @method _getBucketId + * @private + * @param {} column + * @param {} row + * @return {string} bucket id + */ + Grid._getBucketId = function(column, row) { + return 'C' + column + 'R' + row; + }; + + /** + * Creates a bucket. + * @method _createBucket + * @private + * @param {} buckets + * @param {} bucketId + * @return {} bucket + */ + Grid._createBucket = function(buckets, bucketId) { + var bucket = buckets[bucketId] = []; + return bucket; + }; + + /** + * Adds a body to a bucket. + * @method _bucketAddBody + * @private + * @param {} grid + * @param {} bucket + * @param {} body + */ + Grid._bucketAddBody = function(grid, bucket, body) { + // add new pairs + for (var i = 0; i < bucket.length; i++) { + var bodyB = bucket[i]; + + if (body.id === bodyB.id || (body.isStatic && bodyB.isStatic)) + continue; + + // keep track of the number of buckets the pair exists in + // important for Grid.update to work + var pairId = Pair.id(body, bodyB), + pair = grid.pairs[pairId]; + + if (pair) { + pair[2] += 1; + } else { + grid.pairs[pairId] = [body, bodyB, 1]; + } + } + + // add to bodies (after pairs, otherwise pairs with self) + bucket.push(body); + }; + + /** + * Removes a body from a bucket. + * @method _bucketRemoveBody + * @private + * @param {} grid + * @param {} bucket + * @param {} body + */ + Grid._bucketRemoveBody = function(grid, bucket, body) { + // remove from bucket + bucket.splice(Common.indexOf(bucket, body), 1); + + // update pair counts + for (var i = 0; i < bucket.length; i++) { + // keep track of the number of buckets the pair exists in + // important for _createActivePairsList to work + var bodyB = bucket[i], + pairId = Pair.id(body, bodyB), + pair = grid.pairs[pairId]; + + if (pair) + pair[2] -= 1; + } + }; + + /** + * Generates a list of the active pairs in the grid. + * @method _createActivePairsList + * @private + * @param {} grid + * @return [] pairs + */ + Grid._createActivePairsList = function(grid) { + var pairKeys, + pair, + pairs = []; + + // grid.pairs is used as a hashmap + pairKeys = Common.keys(grid.pairs); + + // iterate over grid.pairs + for (var k = 0; k < pairKeys.length; k++) { + pair = grid.pairs[pairKeys[k]]; + + // if pair exists in at least one bucket + // it is a pair that needs further collision testing so push it + if (pair[2] > 0) { + pairs.push(pair); + } else { + delete grid.pairs[pairKeys[k]]; + } + } + + return pairs; + }; + +})(); + + +/***/ }), +/* 1334 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Pairs` module contains methods for creating and manipulating collision pair sets. +* +* @class Pairs +*/ + +var Pairs = {}; + +module.exports = Pairs; + +var Pair = __webpack_require__(489); +var Common = __webpack_require__(37); + +(function() { + + Pairs._pairMaxIdleLife = 1000; + + /** + * Creates a new pairs structure. + * @method create + * @param {object} options + * @return {pairs} A new pairs structure + */ + Pairs.create = function(options) { + return Common.extend({ + table: {}, + list: [], + collisionStart: [], + collisionActive: [], + collisionEnd: [] + }, options); + }; + + /** + * Updates pairs given a list of collisions. + * @method update + * @param {object} pairs + * @param {collision[]} collisions + * @param {number} timestamp + */ + Pairs.update = function(pairs, collisions, timestamp) { + var pairsList = pairs.list, + pairsTable = pairs.table, + collisionStart = pairs.collisionStart, + collisionEnd = pairs.collisionEnd, + collisionActive = pairs.collisionActive, + collision, + pairId, + pair, + i; + + // clear collision state arrays, but maintain old reference + collisionStart.length = 0; + collisionEnd.length = 0; + collisionActive.length = 0; + + for (i = 0; i < pairsList.length; i++) { + pairsList[i].confirmedActive = false; + } + + for (i = 0; i < collisions.length; i++) { + collision = collisions[i]; + + if (collision.collided) { + pairId = Pair.id(collision.bodyA, collision.bodyB); + + pair = pairsTable[pairId]; + + if (pair) { + // pair already exists (but may or may not be active) + if (pair.isActive) { + // pair exists and is active + collisionActive.push(pair); + } else { + // pair exists but was inactive, so a collision has just started again + collisionStart.push(pair); + } + + // update the pair + Pair.update(pair, collision, timestamp); + pair.confirmedActive = true; + } else { + // pair did not exist, create a new pair + pair = Pair.create(collision, timestamp); + pairsTable[pairId] = pair; + + // push the new pair + collisionStart.push(pair); + pairsList.push(pair); + } + } + } + + // deactivate previously active pairs that are now inactive + for (i = 0; i < pairsList.length; i++) { + pair = pairsList[i]; + if (pair.isActive && !pair.confirmedActive) { + Pair.setActive(pair, false, timestamp); + collisionEnd.push(pair); + } + } + }; + + /** + * Finds and removes pairs that have been inactive for a set amount of time. + * @method removeOld + * @param {object} pairs + * @param {number} timestamp + */ + Pairs.removeOld = function(pairs, timestamp) { + var pairsList = pairs.list, + pairsTable = pairs.table, + indexesToRemove = [], + pair, + collision, + pairIndex, + i; + + for (i = 0; i < pairsList.length; i++) { + pair = pairsList[i]; + collision = pair.collision; + + // never remove sleeping pairs + if (collision.bodyA.isSleeping || collision.bodyB.isSleeping) { + pair.timeUpdated = timestamp; + continue; + } + + // if pair is inactive for too long, mark it to be removed + if (timestamp - pair.timeUpdated > Pairs._pairMaxIdleLife) { + indexesToRemove.push(i); + } + } + + // remove marked pairs + for (i = 0; i < indexesToRemove.length; i++) { + pairIndex = indexesToRemove[i] - i; + pair = pairsList[pairIndex]; + delete pairsTable[pair.id]; + pairsList.splice(pairIndex, 1); + } + }; + + /** + * Clears the given pairs structure. + * @method clear + * @param {pairs} pairs + * @return {pairs} pairs + */ + Pairs.clear = function(pairs) { + pairs.table = {}; + pairs.list.length = 0; + pairs.collisionStart.length = 0; + pairs.collisionActive.length = 0; + pairs.collisionEnd.length = 0; + return pairs; + }; + +})(); + + +/***/ }), +/* 1335 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Resolver` module contains methods for resolving collision pairs. +* +* @class Resolver +*/ + +var Resolver = {}; + +module.exports = Resolver; + +var Vertices = __webpack_require__(84); +var Vector = __webpack_require__(99); +var Common = __webpack_require__(37); +var Bounds = __webpack_require__(100); + +(function() { + + Resolver._restingThresh = 4; + Resolver._restingThreshTangent = 6; + Resolver._positionDampen = 0.9; + Resolver._positionWarming = 0.8; + Resolver._frictionNormalMultiplier = 5; + + /** + * Prepare pairs for position solving. + * @method preSolvePosition + * @param {pair[]} pairs + */ + Resolver.preSolvePosition = function(pairs) { + var i, + pair, + activeCount; + + // find total contacts on each body + for (i = 0; i < pairs.length; i++) { + pair = pairs[i]; + + if (!pair.isActive) + continue; + + activeCount = pair.activeContacts.length; + pair.collision.parentA.totalContacts += activeCount; + pair.collision.parentB.totalContacts += activeCount; + } + }; + + /** + * Find a solution for pair positions. + * @method solvePosition + * @param {pair[]} pairs + * @param {body[]} bodies + * @param {number} timeScale + */ + Resolver.solvePosition = function(pairs, bodies, timeScale) { + var i, + normalX, + normalY, + pair, + collision, + bodyA, + bodyB, + normal, + separation, + penetration, + positionImpulseA, + positionImpulseB, + contactShare, + bodyBtoAX, + bodyBtoAY, + positionImpulse, + impulseCoefficient = timeScale * Resolver._positionDampen; + + for (i = 0; i < bodies.length; i++) { + var body = bodies[i]; + body.previousPositionImpulse.x = body.positionImpulse.x; + body.previousPositionImpulse.y = body.positionImpulse.y; + } + + // find impulses required to resolve penetration + for (i = 0; i < pairs.length; i++) { + pair = pairs[i]; + + if (!pair.isActive || pair.isSensor) + continue; + + collision = pair.collision; + bodyA = collision.parentA; + bodyB = collision.parentB; + normal = collision.normal; + + positionImpulseA = bodyA.previousPositionImpulse; + positionImpulseB = bodyB.previousPositionImpulse; + + penetration = collision.penetration; + + bodyBtoAX = positionImpulseB.x - positionImpulseA.x + penetration.x; + bodyBtoAY = positionImpulseB.y - positionImpulseA.y + penetration.y; + + normalX = normal.x; + normalY = normal.y; + + separation = normalX * bodyBtoAX + normalY * bodyBtoAY; + pair.separation = separation; + + positionImpulse = (separation - pair.slop) * impulseCoefficient; + + if (bodyA.isStatic || bodyB.isStatic) + positionImpulse *= 2; + + if (!(bodyA.isStatic || bodyA.isSleeping)) { + contactShare = positionImpulse / bodyA.totalContacts; + bodyA.positionImpulse.x += normalX * contactShare; + bodyA.positionImpulse.y += normalY * contactShare; + } + + if (!(bodyB.isStatic || bodyB.isSleeping)) { + contactShare = positionImpulse / bodyB.totalContacts; + bodyB.positionImpulse.x -= normalX * contactShare; + bodyB.positionImpulse.y -= normalY * contactShare; + } + } + }; + + /** + * Apply position resolution. + * @method postSolvePosition + * @param {body[]} bodies + */ + Resolver.postSolvePosition = function(bodies) { + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i]; + + // reset contact count + body.totalContacts = 0; + + if (body.positionImpulse.x !== 0 || body.positionImpulse.y !== 0) { + // update body geometry + for (var j = 0; j < body.parts.length; j++) { + var part = body.parts[j]; + Vertices.translate(part.vertices, body.positionImpulse); + Bounds.update(part.bounds, part.vertices, body.velocity); + part.position.x += body.positionImpulse.x; + part.position.y += body.positionImpulse.y; + } + + // move the body without changing velocity + body.positionPrev.x += body.positionImpulse.x; + body.positionPrev.y += body.positionImpulse.y; + + if (Vector.dot(body.positionImpulse, body.velocity) < 0) { + // reset cached impulse if the body has velocity along it + body.positionImpulse.x = 0; + body.positionImpulse.y = 0; + } else { + // warm the next iteration + body.positionImpulse.x *= Resolver._positionWarming; + body.positionImpulse.y *= Resolver._positionWarming; + } + } + } + }; + + /** + * Prepare pairs for velocity solving. + * @method preSolveVelocity + * @param {pair[]} pairs + */ + Resolver.preSolveVelocity = function(pairs) { + var i, + j, + pair, + contacts, + collision, + bodyA, + bodyB, + normal, + tangent, + contact, + contactVertex, + normalImpulse, + tangentImpulse, + offset, + impulse = Vector._temp[0], + tempA = Vector._temp[1]; + + for (i = 0; i < pairs.length; i++) { + pair = pairs[i]; + + if (!pair.isActive || pair.isSensor) + continue; + + contacts = pair.activeContacts; + collision = pair.collision; + bodyA = collision.parentA; + bodyB = collision.parentB; + normal = collision.normal; + tangent = collision.tangent; + + // resolve each contact + for (j = 0; j < contacts.length; j++) { + contact = contacts[j]; + contactVertex = contact.vertex; + normalImpulse = contact.normalImpulse; + tangentImpulse = contact.tangentImpulse; + + if (normalImpulse !== 0 || tangentImpulse !== 0) { + // total impulse from contact + impulse.x = (normal.x * normalImpulse) + (tangent.x * tangentImpulse); + impulse.y = (normal.y * normalImpulse) + (tangent.y * tangentImpulse); + + // apply impulse from contact + if (!(bodyA.isStatic || bodyA.isSleeping)) { + offset = Vector.sub(contactVertex, bodyA.position, tempA); + bodyA.positionPrev.x += impulse.x * bodyA.inverseMass; + bodyA.positionPrev.y += impulse.y * bodyA.inverseMass; + bodyA.anglePrev += Vector.cross(offset, impulse) * bodyA.inverseInertia; + } + + if (!(bodyB.isStatic || bodyB.isSleeping)) { + offset = Vector.sub(contactVertex, bodyB.position, tempA); + bodyB.positionPrev.x -= impulse.x * bodyB.inverseMass; + bodyB.positionPrev.y -= impulse.y * bodyB.inverseMass; + bodyB.anglePrev -= Vector.cross(offset, impulse) * bodyB.inverseInertia; + } + } + } + } + }; + + /** + * Find a solution for pair velocities. + * @method solveVelocity + * @param {pair[]} pairs + * @param {number} timeScale + */ + Resolver.solveVelocity = function(pairs, timeScale) { + var timeScaleSquared = timeScale * timeScale, + impulse = Vector._temp[0], + tempA = Vector._temp[1], + tempB = Vector._temp[2], + tempC = Vector._temp[3], + tempD = Vector._temp[4], + tempE = Vector._temp[5]; + + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + + if (!pair.isActive || pair.isSensor) + continue; + + var collision = pair.collision, + bodyA = collision.parentA, + bodyB = collision.parentB, + normal = collision.normal, + tangent = collision.tangent, + contacts = pair.activeContacts, + contactShare = 1 / contacts.length; + + // update body velocities + bodyA.velocity.x = bodyA.position.x - bodyA.positionPrev.x; + bodyA.velocity.y = bodyA.position.y - bodyA.positionPrev.y; + bodyB.velocity.x = bodyB.position.x - bodyB.positionPrev.x; + bodyB.velocity.y = bodyB.position.y - bodyB.positionPrev.y; + bodyA.angularVelocity = bodyA.angle - bodyA.anglePrev; + bodyB.angularVelocity = bodyB.angle - bodyB.anglePrev; + + // resolve each contact + for (var j = 0; j < contacts.length; j++) { + var contact = contacts[j], + contactVertex = contact.vertex, + offsetA = Vector.sub(contactVertex, bodyA.position, tempA), + offsetB = Vector.sub(contactVertex, bodyB.position, tempB), + velocityPointA = Vector.add(bodyA.velocity, Vector.mult(Vector.perp(offsetA), bodyA.angularVelocity), tempC), + velocityPointB = Vector.add(bodyB.velocity, Vector.mult(Vector.perp(offsetB), bodyB.angularVelocity), tempD), + relativeVelocity = Vector.sub(velocityPointA, velocityPointB, tempE), + normalVelocity = Vector.dot(normal, relativeVelocity); + + var tangentVelocity = Vector.dot(tangent, relativeVelocity), + tangentSpeed = Math.abs(tangentVelocity), + tangentVelocityDirection = Common.sign(tangentVelocity); + + // raw impulses + var normalImpulse = (1 + pair.restitution) * normalVelocity, + normalForce = Common.clamp(pair.separation + normalVelocity, 0, 1) * Resolver._frictionNormalMultiplier; + + // coulomb friction + var tangentImpulse = tangentVelocity, + maxFriction = Infinity; + + if (tangentSpeed > pair.friction * pair.frictionStatic * normalForce * timeScaleSquared) { + maxFriction = tangentSpeed; + tangentImpulse = Common.clamp( + pair.friction * tangentVelocityDirection * timeScaleSquared, + -maxFriction, maxFriction + ); + } + + // modify impulses accounting for mass, inertia and offset + var oAcN = Vector.cross(offsetA, normal), + oBcN = Vector.cross(offsetB, normal), + share = contactShare / (bodyA.inverseMass + bodyB.inverseMass + bodyA.inverseInertia * oAcN * oAcN + bodyB.inverseInertia * oBcN * oBcN); + + normalImpulse *= share; + tangentImpulse *= share; + + // handle high velocity and resting collisions separately + if (normalVelocity < 0 && normalVelocity * normalVelocity > Resolver._restingThresh * timeScaleSquared) { + // high normal velocity so clear cached contact normal impulse + contact.normalImpulse = 0; + } else { + // solve resting collision constraints using Erin Catto's method (GDC08) + // impulse constraint tends to 0 + var contactNormalImpulse = contact.normalImpulse; + contact.normalImpulse = Math.min(contact.normalImpulse + normalImpulse, 0); + normalImpulse = contact.normalImpulse - contactNormalImpulse; + } + + // handle high velocity and resting collisions separately + if (tangentVelocity * tangentVelocity > Resolver._restingThreshTangent * timeScaleSquared) { + // high tangent velocity so clear cached contact tangent impulse + contact.tangentImpulse = 0; + } else { + // solve resting collision constraints using Erin Catto's method (GDC08) + // tangent impulse tends to -tangentSpeed or +tangentSpeed + var contactTangentImpulse = contact.tangentImpulse; + contact.tangentImpulse = Common.clamp(contact.tangentImpulse + tangentImpulse, -maxFriction, maxFriction); + tangentImpulse = contact.tangentImpulse - contactTangentImpulse; + } + + // total impulse from contact + impulse.x = (normal.x * normalImpulse) + (tangent.x * tangentImpulse); + impulse.y = (normal.y * normalImpulse) + (tangent.y * tangentImpulse); + + // apply impulse from contact + if (!(bodyA.isStatic || bodyA.isSleeping)) { + bodyA.positionPrev.x += impulse.x * bodyA.inverseMass; + bodyA.positionPrev.y += impulse.y * bodyA.inverseMass; + bodyA.anglePrev += Vector.cross(offsetA, impulse) * bodyA.inverseInertia; + } + + if (!(bodyB.isStatic || bodyB.isSleeping)) { + bodyB.positionPrev.x -= impulse.x * bodyB.inverseMass; + bodyB.positionPrev.y -= impulse.y * bodyB.inverseMass; + bodyB.anglePrev -= Vector.cross(offsetB, impulse) * bodyB.inverseInertia; + } + } + } + }; + +})(); + + +/***/ }), +/* 1336 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Engine` module contains methods for creating and manipulating engines. +* An engine is a controller that manages updating the simulation of the world. +* See `Matter.Runner` for an optional game loop utility. +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Engine +*/ + +var Engine = {}; + +module.exports = Engine; + +var World = __webpack_require__(1247); +var Sleeping = __webpack_require__(448); +var Resolver = __webpack_require__(1335); +var Pairs = __webpack_require__(1334); +var Metrics = __webpack_require__(1392); +var Grid = __webpack_require__(1333); +var Events = __webpack_require__(227); +var Composite = __webpack_require__(209); +var Constraint = __webpack_require__(228); +var Common = __webpack_require__(37); +var Body = __webpack_require__(60); + +(function() { + + /** + * Creates a new engine. The options parameter is an object that specifies any properties you wish to override the defaults. + * All properties have default values, and many are pre-calculated automatically based on other properties. + * See the properties section below for detailed information on what you can pass via the `options` object. + * @method create + * @param {object} [options] + * @return {engine} engine + */ + Engine.create = function(element, options) { + // options may be passed as the first (and only) argument + options = Common.isElement(element) ? options : element; + element = Common.isElement(element) ? element : null; + options = options || {}; + + if (element || options.render) { + Common.warn('Engine.create: engine.render is deprecated (see docs)'); + } + + var defaults = { + positionIterations: 6, + velocityIterations: 4, + constraintIterations: 2, + enableSleeping: false, + events: [], + plugin: {}, + timing: { + timestamp: 0, + timeScale: 1 + }, + broadphase: { + controller: Grid + } + }; + + var engine = Common.extend(defaults, options); + + // @deprecated + if (element || engine.render) { + var renderDefaults = { + element: element, + controller: Render + }; + + engine.render = Common.extend(renderDefaults, engine.render); + } + + // @deprecated + if (engine.render && engine.render.controller) { + engine.render = engine.render.controller.create(engine.render); + } + + // @deprecated + if (engine.render) { + engine.render.engine = engine; + } + + engine.world = options.world || World.create(engine.world); + engine.pairs = Pairs.create(); + engine.broadphase = engine.broadphase.controller.create(engine.broadphase); + engine.metrics = engine.metrics || { extended: false }; + + // @if DEBUG + engine.metrics = Metrics.create(engine.metrics); + // @endif + + return engine; + }; + + /** + * Moves the simulation forward in time by `delta` ms. + * The `correction` argument is an optional `Number` that specifies the time correction factor to apply to the update. + * This can help improve the accuracy of the simulation in cases where `delta` is changing between updates. + * The value of `correction` is defined as `delta / lastDelta`, i.e. the percentage change of `delta` over the last step. + * Therefore the value is always `1` (no correction) when `delta` constant (or when no correction is desired, which is the default). + * See the paper on Time Corrected Verlet for more information. + * + * Triggers `beforeUpdate` and `afterUpdate` events. + * Triggers `collisionStart`, `collisionActive` and `collisionEnd` events. + * @method update + * @param {engine} engine + * @param {number} [delta=16.666] + * @param {number} [correction=1] + */ + Engine.update = function(engine, delta, correction) { + delta = delta || 1000 / 60; + correction = correction || 1; + + var world = engine.world, + timing = engine.timing, + broadphase = engine.broadphase, + broadphasePairs = [], + i; + + // increment timestamp + timing.timestamp += delta * timing.timeScale; + + // create an event object + var event = { + timestamp: timing.timestamp + }; + + Events.trigger(engine, 'beforeUpdate', event); + + // get lists of all bodies and constraints, no matter what composites they are in + var allBodies = Composite.allBodies(world), + allConstraints = Composite.allConstraints(world); + + // @if DEBUG + // reset metrics logging + Metrics.reset(engine.metrics); + // @endif + + // if sleeping enabled, call the sleeping controller + if (engine.enableSleeping) + Sleeping.update(allBodies, timing.timeScale); + + // applies gravity to all bodies + Engine._bodiesApplyGravity(allBodies, world.gravity); + + // update all body position and rotation by integration + Engine._bodiesUpdate(allBodies, delta, timing.timeScale, correction, world.bounds); + + // update all constraints (first pass) + Constraint.preSolveAll(allBodies); + for (i = 0; i < engine.constraintIterations; i++) { + Constraint.solveAll(allConstraints, timing.timeScale); + } + Constraint.postSolveAll(allBodies); + + // broadphase pass: find potential collision pairs + if (broadphase.controller) { + // if world is dirty, we must flush the whole grid + if (world.isModified) + broadphase.controller.clear(broadphase); + + // update the grid buckets based on current bodies + broadphase.controller.update(broadphase, allBodies, engine, world.isModified); + broadphasePairs = broadphase.pairsList; + } else { + // if no broadphase set, we just pass all bodies + broadphasePairs = allBodies; + } + + // clear all composite modified flags + if (world.isModified) { + Composite.setModified(world, false, false, true); + } + + // narrowphase pass: find actual collisions, then create or update collision pairs + var collisions = broadphase.detector(broadphasePairs, engine); + + // update collision pairs + var pairs = engine.pairs, + timestamp = timing.timestamp; + Pairs.update(pairs, collisions, timestamp); + Pairs.removeOld(pairs, timestamp); + + // wake up bodies involved in collisions + if (engine.enableSleeping) + Sleeping.afterCollisions(pairs.list, timing.timeScale); + + // trigger collision events + if (pairs.collisionStart.length > 0) + Events.trigger(engine, 'collisionStart', { pairs: pairs.collisionStart }); + + // iteratively resolve position between collisions + Resolver.preSolvePosition(pairs.list); + for (i = 0; i < engine.positionIterations; i++) { + Resolver.solvePosition(pairs.list, allBodies, timing.timeScale); + } + Resolver.postSolvePosition(allBodies); + + // update all constraints (second pass) + Constraint.preSolveAll(allBodies); + for (i = 0; i < engine.constraintIterations; i++) { + Constraint.solveAll(allConstraints, timing.timeScale); + } + Constraint.postSolveAll(allBodies); + + // iteratively resolve velocity between collisions + Resolver.preSolveVelocity(pairs.list); + for (i = 0; i < engine.velocityIterations; i++) { + Resolver.solveVelocity(pairs.list, timing.timeScale); + } + + // trigger collision events + if (pairs.collisionActive.length > 0) + Events.trigger(engine, 'collisionActive', { pairs: pairs.collisionActive }); + + if (pairs.collisionEnd.length > 0) + Events.trigger(engine, 'collisionEnd', { pairs: pairs.collisionEnd }); + + // @if DEBUG + // update metrics log + Metrics.update(engine.metrics, engine); + // @endif + + // clear force buffers + Engine._bodiesClearForces(allBodies); + + Events.trigger(engine, 'afterUpdate', event); + + return engine; + }; + + /** + * Merges two engines by keeping the configuration of `engineA` but replacing the world with the one from `engineB`. + * @method merge + * @param {engine} engineA + * @param {engine} engineB + */ + Engine.merge = function(engineA, engineB) { + Common.extend(engineA, engineB); + + if (engineB.world) { + engineA.world = engineB.world; + + Engine.clear(engineA); + + var bodies = Composite.allBodies(engineA.world); + + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i]; + Sleeping.set(body, false); + body.id = Common.nextId(); + } + } + }; + + /** + * Clears the engine including the world, pairs and broadphase. + * @method clear + * @param {engine} engine + */ + Engine.clear = function(engine) { + var world = engine.world; + + Pairs.clear(engine.pairs); + + var broadphase = engine.broadphase; + if (broadphase.controller) { + var bodies = Composite.allBodies(world); + broadphase.controller.clear(broadphase); + broadphase.controller.update(broadphase, bodies, engine, true); + } + }; + + /** + * Zeroes the `body.force` and `body.torque` force buffers. + * @method _bodiesClearForces + * @private + * @param {body[]} bodies + */ + Engine._bodiesClearForces = function(bodies) { + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i]; + + // reset force buffers + body.force.x = 0; + body.force.y = 0; + body.torque = 0; + } + }; + + /** + * Applys a mass dependant force to all given bodies. + * @method _bodiesApplyGravity + * @private + * @param {body[]} bodies + * @param {vector} gravity + */ + Engine._bodiesApplyGravity = function(bodies, gravity) { + var gravityScale = typeof gravity.scale !== 'undefined' ? gravity.scale : 0.001; + + if ((gravity.x === 0 && gravity.y === 0) || gravityScale === 0) { + return; + } + + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i]; + + if (body.ignoreGravity || body.isStatic || body.isSleeping) + continue; + + // apply gravity + body.force.y += body.mass * gravity.y * gravityScale; + body.force.x += body.mass * gravity.x * gravityScale; + } + }; + + /** + * Applys `Body.update` to all given `bodies`. + * @method _bodiesUpdate + * @private + * @param {body[]} bodies + * @param {number} deltaTime + * The amount of time elapsed between updates + * @param {number} timeScale + * @param {number} correction + * The Verlet correction factor (deltaTime / lastDeltaTime) + * @param {bounds} worldBounds + */ + Engine._bodiesUpdate = function(bodies, deltaTime, timeScale, correction, worldBounds) { + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i]; + + if (body.isStatic || body.isSleeping) + continue; + + Body.update(body, deltaTime, timeScale, correction); + } + }; + + /** + * An alias for `Runner.run`, see `Matter.Runner` for more information. + * @method run + * @param {engine} engine + */ + + /** + * Fired just before an update + * + * @event beforeUpdate + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /** + * Fired after engine update and all collision events + * + * @event afterUpdate + * @param {} event An event object + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /** + * Fired after engine update, provides a list of all pairs that have started to collide in the current tick (if any) + * + * @event collisionStart + * @param {} event An event object + * @param {} event.pairs List of affected pairs + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /** + * Fired after engine update, provides a list of all pairs that are colliding in the current tick (if any) + * + * @event collisionActive + * @param {} event An event object + * @param {} event.pairs List of affected pairs + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /** + * Fired after engine update, provides a list of all pairs that have ended collision in the current tick (if any) + * + * @event collisionEnd + * @param {} event An event object + * @param {} event.pairs List of affected pairs + * @param {number} event.timestamp The engine.timing.timestamp of the event + * @param {} event.source The source object of the event + * @param {} event.name The name of the event + */ + + /* + * + * Properties Documentation + * + */ + + /** + * An integer `Number` that specifies the number of position iterations to perform each update. + * The higher the value, the higher quality the simulation will be at the expense of performance. + * + * @property positionIterations + * @type number + * @default 6 + */ + + /** + * An integer `Number` that specifies the number of velocity iterations to perform each update. + * The higher the value, the higher quality the simulation will be at the expense of performance. + * + * @property velocityIterations + * @type number + * @default 4 + */ + + /** + * An integer `Number` that specifies the number of constraint iterations to perform each update. + * The higher the value, the higher quality the simulation will be at the expense of performance. + * The default value of `2` is usually very adequate. + * + * @property constraintIterations + * @type number + * @default 2 + */ + + /** + * A flag that specifies whether the engine should allow sleeping via the `Matter.Sleeping` module. + * Sleeping can improve stability and performance, but often at the expense of accuracy. + * + * @property enableSleeping + * @type boolean + * @default false + */ + + /** + * An `Object` containing properties regarding the timing systems of the engine. + * + * @property timing + * @type object + */ + + /** + * A `Number` that specifies the global scaling factor of time for all bodies. + * A value of `0` freezes the simulation. + * A value of `0.1` gives a slow-motion effect. + * A value of `1.2` gives a speed-up effect. + * + * @property timing.timeScale + * @type number + * @default 1 + */ + + /** + * A `Number` that specifies the current simulation-time in milliseconds starting from `0`. + * It is incremented on every `Engine.update` by the given `delta` argument. + * + * @property timing.timestamp + * @type number + * @default 0 + */ + + /** + * An instance of a `Render` controller. The default value is a `Matter.Render` instance created by `Engine.create`. + * One may also develop a custom renderer module based on `Matter.Render` and pass an instance of it to `Engine.create` via `options.render`. + * + * A minimal custom renderer object must define at least three functions: `create`, `clear` and `world` (see `Matter.Render`). + * It is also possible to instead pass the _module_ reference via `options.render.controller` and `Engine.create` will instantiate one for you. + * + * @property render + * @type render + * @deprecated see Demo.js for an example of creating a renderer + * @default a Matter.Render instance + */ + + /** + * An instance of a broadphase controller. The default value is a `Matter.Grid` instance created by `Engine.create`. + * + * @property broadphase + * @type grid + * @default a Matter.Grid instance + */ + + /** + * A `World` composite object that will contain all simulated bodies and constraints. + * + * @property world + * @type world + * @default a Matter.World instance + */ + + /** + * An object reserved for storing plugin-specific properties. + * + * @property plugin + * @type {} + */ + +})(); + + +/***/ }), +/* 1337 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bodies = __webpack_require__(135); +var Body = __webpack_require__(60); +var Class = __webpack_require__(0); +var Common = __webpack_require__(37); +var Composite = __webpack_require__(209); +var Engine = __webpack_require__(1336); +var EventEmitter = __webpack_require__(11); +var Events = __webpack_require__(1241); +var GetFastValue = __webpack_require__(2); +var GetValue = __webpack_require__(6); +var MatterBody = __webpack_require__(60); +var MatterEvents = __webpack_require__(227); +var MatterTileBody = __webpack_require__(1242); +var MatterWorld = __webpack_require__(1247); +var Vector = __webpack_require__(99); + +/** + * @classdesc + * [description] + * + * @class World + * @extends Phaser.Events.EventEmitter + * @memberof Phaser.Physics.Matter + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - The Scene to which this Matter World instance belongs. + * @param {Phaser.Types.Physics.Matter.MatterWorldConfig} config - The Matter World configuration object. + */ +var World = new Class({ + + Extends: EventEmitter, + + initialize: + + function World (scene, config) + { + EventEmitter.call(this); + + /** + * The Scene to which this Matter World instance belongs. + * + * @name Phaser.Physics.Matter.World#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * An instance of the MatterJS Engine. + * + * @name Phaser.Physics.Matter.World#engine + * @type {MatterJS.Engine} + * @since 3.0.0 + */ + this.engine = Engine.create(config); + + /** + * A `World` composite object that will contain all simulated bodies and constraints. + * + * @name Phaser.Physics.Matter.World#localWorld + * @type {MatterJS.World} + * @since 3.0.0 + */ + this.localWorld = this.engine.world; + + var gravity = GetValue(config, 'gravity', null); + + if (gravity) + { + this.setGravity(gravity.x, gravity.y, gravity.scale); + } + + /** + * An object containing the 4 wall bodies that bound the physics world. + * + * @name Phaser.Physics.Matter.World#walls + * @type {object} + * @since 3.0.0 + */ + this.walls = { left: null, right: null, top: null, bottom: null }; + + if (GetFastValue(config, 'setBounds', false)) + { + var boundsConfig = config['setBounds']; + + if (typeof boundsConfig === 'boolean') + { + this.setBounds(); + } + else + { + var x = GetFastValue(boundsConfig, 'x', 0); + var y = GetFastValue(boundsConfig, 'y', 0); + var width = GetFastValue(boundsConfig, 'width', scene.sys.scale.width); + var height = GetFastValue(boundsConfig, 'height', scene.sys.scale.height); + var thickness = GetFastValue(boundsConfig, 'thickness', 64); + var left = GetFastValue(boundsConfig, 'left', true); + var right = GetFastValue(boundsConfig, 'right', true); + var top = GetFastValue(boundsConfig, 'top', true); + var bottom = GetFastValue(boundsConfig, 'bottom', true); + + this.setBounds(x, y, width, height, thickness, left, right, top, bottom); + } + } + + /** + * A flag that toggles if the world is enabled or not. + * + * @name Phaser.Physics.Matter.World#enabled + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.enabled = GetValue(config, 'enabled', true); + + /** + * The correction argument is an optional Number that specifies the time correction factor to apply to the update. + * This can help improve the accuracy of the simulation in cases where delta is changing between updates. + * The value of correction is defined as delta / lastDelta, i.e. the percentage change of delta over the last step. + * Therefore the value is always 1 (no correction) when delta constant (or when no correction is desired, which is the default). + * See the paper on Time Corrected Verlet for more information. + * + * @name Phaser.Physics.Matter.World#correction + * @type {number} + * @default 1 + * @since 3.4.0 + */ + this.correction = GetValue(config, 'correction', 1); + + /** + * This function is called every time the core game loop steps, which is bound to the + * Request Animation Frame frequency unless otherwise modified. + * + * The function is passed two values: `time` and `delta`, both of which come from the game step values. + * + * It must return a number. This number is used as the delta value passed to Matter.Engine.update. + * + * You can override this function with your own to define your own timestep. + * + * If you need to update the Engine multiple times in a single game step then call + * `World.update` as many times as required. Each call will trigger the `getDelta` function. + * If you wish to have full control over when the Engine updates then see the property `autoUpdate`. + * + * You can also adjust the number of iterations that Engine.update performs. + * Use the Scene Matter Physics config object to set the following properties: + * + * positionIterations (defaults to 6) + * velocityIterations (defaults to 4) + * constraintIterations (defaults to 2) + * + * Adjusting these values can help performance in certain situations, depending on the physics requirements + * of your game. + * + * @name Phaser.Physics.Matter.World#getDelta + * @type {function} + * @since 3.4.0 + */ + this.getDelta = GetValue(config, 'getDelta', this.update60Hz); + + /** + * Automatically call Engine.update every time the game steps. + * If you disable this then you are responsible for calling `World.step` directly from your game. + * If you call `set60Hz` or `set30Hz` then `autoUpdate` is reset to `true`. + * + * @name Phaser.Physics.Matter.World#autoUpdate + * @type {boolean} + * @default true + * @since 3.4.0 + */ + this.autoUpdate = GetValue(config, 'autoUpdate', true); + + /** + * A flag that controls if the debug graphics will be drawn to or not. + * + * @name Phaser.Physics.Matter.World#drawDebug + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.drawDebug = GetValue(config, 'debug', false); + + /** + * An instance of the Graphics object the debug bodies are drawn to, if enabled. + * + * @name Phaser.Physics.Matter.World#debugGraphic + * @type {Phaser.GameObjects.Graphics} + * @since 3.0.0 + */ + this.debugGraphic; + + /** + * The default configuration values. + * + * @name Phaser.Physics.Matter.World#defaults + * @type {object} + * @since 3.0.0 + */ + this.defaults = { + debugShowBody: GetFastValue(config, 'debugShowBody', true), + debugShowStaticBody: GetFastValue(config, 'debugShowStaticBody', true), + debugShowVelocity: GetFastValue(config, 'debugShowVelocity', true), + bodyDebugColor: GetFastValue(config, 'debugBodyColor', 0xff00ff), + bodyDebugFillColor: GetFastValue(config, 'debugBodyFillColor', 0xe3a7e3), + staticBodyDebugColor: GetFastValue(config, 'debugStaticBodyColor', 0x0000ff), + velocityDebugColor: GetFastValue(config, 'debugVelocityColor', 0x00ff00), + debugShowJoint: GetFastValue(config, 'debugShowJoint', true), + jointDebugColor: GetFastValue(config, 'debugJointColor', 0x000000), + debugWireframes: GetFastValue(config, 'debugWireframes', true), + debugShowInternalEdges: GetFastValue(config, 'debugShowInternalEdges', false), + debugShowConvexHulls: GetFastValue(config, 'debugShowConvexHulls', false), + debugConvexHullColor: GetFastValue(config, 'debugConvexHullColor', 0xaaaaaa), + debugShowSleeping: GetFastValue(config, 'debugShowSleeping', false) + }; + + if (this.drawDebug) + { + this.createDebugGraphic(); + } + + this.setEventsProxy(); + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.World#setEventsProxy + * @since 3.0.0 + */ + setEventsProxy: function () + { + var _this = this; + var engine = this.engine; + + MatterEvents.on(engine, 'beforeUpdate', function (event) + { + _this.emit(Events.BEFORE_UPDATE, event); + }); + + MatterEvents.on(engine, 'afterUpdate', function (event) + { + _this.emit(Events.AFTER_UPDATE, event); + }); + + MatterEvents.on(engine, 'collisionStart', function (event) + { + var pairs = event.pairs; + var bodyA; + var bodyB; + + if (pairs.length > 0) + { + bodyA = pairs[0].bodyA; + bodyB = pairs[0].bodyB; + } + + _this.emit(Events.COLLISION_START, event, bodyA, bodyB); + }); + + MatterEvents.on(engine, 'collisionActive', function (event) + { + var pairs = event.pairs; + var bodyA; + var bodyB; + + if (pairs.length > 0) + { + bodyA = pairs[0].bodyA; + bodyB = pairs[0].bodyB; + } + + _this.emit(Events.COLLISION_ACTIVE, event, bodyA, bodyB); + }); + + MatterEvents.on(engine, 'collisionEnd', function (event) + { + var pairs = event.pairs; + var bodyA; + var bodyB; + + if (pairs.length > 0) + { + bodyA = pairs[0].bodyA; + bodyB = pairs[0].bodyB; + } + + _this.emit(Events.COLLISION_END, event, bodyA, bodyB); + }); + }, + + /** + * Sets the bounds of the Physics world to match the given world pixel dimensions. + * You can optionally set which 'walls' to create: left, right, top or bottom. + * If none of the walls are given it will default to use the walls settings it had previously. + * I.e. if you previously told it to not have the left or right walls, and you then adjust the world size + * the newly created bounds will also not have the left and right walls. + * Explicitly state them in the parameters to override this. + * + * @method Phaser.Physics.Matter.World#setBounds + * @since 3.0.0 + * + * @param {number} [x=0] - The x coordinate of the top-left corner of the bounds. + * @param {number} [y=0] - The y coordinate of the top-left corner of the bounds. + * @param {number} [width] - The width of the bounds. + * @param {number} [height] - The height of the bounds. + * @param {number} [thickness=128] - The thickness of each wall, in pixels. + * @param {boolean} [left=true] - If true will create the left bounds wall. + * @param {boolean} [right=true] - If true will create the right bounds wall. + * @param {boolean} [top=true] - If true will create the top bounds wall. + * @param {boolean} [bottom=true] - If true will create the bottom bounds wall. + * + * @return {Phaser.Physics.Matter.World} This Matter World object. + */ + setBounds: function (x, y, width, height, thickness, left, right, top, bottom) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.scene.sys.scale.width; } + if (height === undefined) { height = this.scene.sys.scale.height; } + if (thickness === undefined) { thickness = 128; } + if (left === undefined) { left = true; } + if (right === undefined) { right = true; } + if (top === undefined) { top = true; } + if (bottom === undefined) { bottom = true; } + + this.updateWall(left, 'left', x - thickness, y - thickness, thickness, height + (thickness * 2)); + this.updateWall(right, 'right', x + width, y - thickness, thickness, height + (thickness * 2)); + this.updateWall(top, 'top', x, y - thickness, width, thickness); + this.updateWall(bottom, 'bottom', x, y + height, width, thickness); + + return this; + }, + + // position = 'left', 'right', 'top' or 'bottom' + /** + * [description] + * + * @method Phaser.Physics.Matter.World#updateWall + * @since 3.0.0 + * + * @param {boolean} add - [description] + * @param {string} position - [description] + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} width - [description] + * @param {number} height - [description] + */ + updateWall: function (add, position, x, y, width, height) + { + var wall = this.walls[position]; + + if (add) + { + if (wall) + { + MatterWorld.remove(this.localWorld, wall); + } + + // adjust center + x += (width / 2); + y += (height / 2); + + this.walls[position] = this.create(x, y, width, height, { isStatic: true, friction: 0, frictionStatic: 0 }); + } + else + { + if (wall) + { + MatterWorld.remove(this.localWorld, wall); + } + + this.walls[position] = null; + } + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.World#createDebugGraphic + * @since 3.0.0 + * + * @return {Phaser.GameObjects.Graphics} [description] + */ + createDebugGraphic: function () + { + var graphic = this.scene.sys.add.graphics({ x: 0, y: 0 }); + + graphic.setDepth(Number.MAX_VALUE); + + this.debugGraphic = graphic; + + this.drawDebug = true; + + return graphic; + }, + + /** + * Sets the world's gravity and gravity scale to 0. + * + * @method Phaser.Physics.Matter.World#disableGravity + * @since 3.0.0 + * + * @return {Phaser.Physics.Matter.World} This Matter World object. + */ + disableGravity: function () + { + this.localWorld.gravity.x = 0; + this.localWorld.gravity.y = 0; + this.localWorld.gravity.scale = 0; + + return this; + }, + + /** + * Sets the world's gravity + * + * @method Phaser.Physics.Matter.World#setGravity + * @since 3.0.0 + * + * @param {number} [x=0] - The world gravity x component. + * @param {number} [y=1] - The world gravity y component. + * @param {number} [scale] - [description] + * + * @return {Phaser.Physics.Matter.World} This Matter World object. + */ + setGravity: function (x, y, scale) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 1; } + + this.localWorld.gravity.x = x; + this.localWorld.gravity.y = y; + + if (scale !== undefined) + { + this.localWorld.gravity.scale = scale; + } + + return this; + }, + + /** + * Creates a rectangle Matter body and adds it to the world. + * + * @method Phaser.Physics.Matter.World#create + * @since 3.0.0 + * + * @param {number} x - The horizontal position of the body in the world. + * @param {number} y - The vertical position of the body in the world. + * @param {number} width - The width of the body. + * @param {number} height - The height of the body. + * @param {object} options - Optional Matter configuration object. + * + * @return {MatterJS.Body} The Matter.js body that was created. + */ + create: function (x, y, width, height, options) + { + var body = Bodies.rectangle(x, y, width, height, options); + + MatterWorld.add(this.localWorld, body); + + return body; + }, + + /** + * Adds an object to the world. + * + * @method Phaser.Physics.Matter.World#add + * @since 3.0.0 + * + * @param {(object|object[])} object - Can be single or an array, and can be a body, composite or constraint + * + * @return {Phaser.Physics.Matter.World} This Matter World object. + */ + add: function (object) + { + MatterWorld.add(this.localWorld, object); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.World#remove + * @since 3.0.0 + * + * @param {object} object - The object to be removed from the world. + * @param {boolean} deep - [description] + * + * @return {Phaser.Physics.Matter.World} This Matter World object. + */ + remove: function (object, deep) + { + var body = (object.body) ? object.body : object; + + Composite.remove(this.localWorld, body, deep); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.World#removeConstraint + * @since 3.0.0 + * + * @param {MatterJS.Constraint} constraint - [description] + * @param {boolean} deep - [description] + * + * @return {Phaser.Physics.Matter.World} This Matter World object. + */ + removeConstraint: function (constraint, deep) + { + Composite.remove(this.localWorld, constraint, deep); + + return this; + }, + + /** + * Adds MatterTileBody instances for all the colliding tiles within the given tilemap layer. Set + * the appropriate tiles in your layer to collide before calling this method! + * + * @method Phaser.Physics.Matter.World#convertTilemapLayer + * @since 3.0.0 + * + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - + * An array of tiles. + * @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@ee Phaser.Physics.Matter.TileBody} + * + * @return {Phaser.Physics.Matter.World} This Matter World object. + */ + convertTilemapLayer: function (tilemapLayer, options) + { + var layerData = tilemapLayer.layer; + var tiles = tilemapLayer.getTilesWithin(0, 0, layerData.width, layerData.height, { isColliding: true }); + + this.convertTiles(tiles, options); + + return this; + }, + + /** + * Adds MatterTileBody instances for the given tiles. This adds bodies regardless of whether the + * tiles are set to collide or not. + * + * @method Phaser.Physics.Matter.World#convertTiles + * @since 3.0.0 + * + * @param {Phaser.Tilemaps.Tile[]} tiles - An array of tiles. + * @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@see Phaser.Physics.Matter.TileBody} + * + * @return {Phaser.Physics.Matter.World} This Matter World object. + */ + convertTiles: function (tiles, options) + { + if (tiles.length === 0) + { + return this; + } + + for (var i = 0; i < tiles.length; i++) + { + new MatterTileBody(this, tiles[i], options); + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.World#nextGroup + * @since 3.0.0 + * + * @param {boolean} isNonColliding - [description] + * + * @return {number} [description] + */ + nextGroup: function (isNonColliding) + { + return MatterBody.nextGroup(isNonColliding); + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.World#nextCategory + * @since 3.0.0 + * + * @return {number} Returns the next unique category bitfield. + */ + nextCategory: function () + { + return MatterBody.nextCategory(); + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.World#pause + * @fires Phaser.Physics.Matter.Events#PAUSE + * @since 3.0.0 + * + * @return {Phaser.Physics.Matter.World} This Matter World object. + */ + pause: function () + { + this.enabled = false; + + this.emit(Events.PAUSE); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.World#resume + * @fires Phaser.Physics.Matter.Events#RESUME + * @since 3.0.0 + * + * @return {Phaser.Physics.Matter.World} This Matter World object. + */ + resume: function () + { + this.enabled = true; + + this.emit(Events.RESUME); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.World#update + * @since 3.0.0 + * + * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + */ + update: function (time, delta) + { + if (this.enabled && this.autoUpdate) + { + Engine.update(this.engine, this.getDelta(time, delta), this.correction); + } + }, + + /** + * Manually advances the physics simulation by one iteration. + * + * You can optionally pass in the `delta` and `correction` values to be used by Engine.update. + * If undefined they use the Matter defaults of 60Hz and no correction. + * + * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`. + * + * It also ignores any custom `getDelta` functions, as you should be passing the delta + * value in to this call. + * + * You can adjust the number of iterations that Engine.update performs internally. + * Use the Scene Matter Physics config object to set the following properties: + * + * positionIterations (defaults to 6) + * velocityIterations (defaults to 4) + * constraintIterations (defaults to 2) + * + * Adjusting these values can help performance in certain situations, depending on the physics requirements + * of your game. + * + * @method Phaser.Physics.Matter.World#step + * @since 3.4.0 + * + * @param {number} [delta=16.666] - [description] + * @param {number} [correction=1] - [description] + */ + step: function (delta, correction) + { + Engine.update(this.engine, delta, correction); + }, + + /** + * Runs the Matter Engine.update at a fixed timestep of 60Hz. + * + * @method Phaser.Physics.Matter.World#update60Hz + * @since 3.4.0 + * + * @return {number} The delta value to be passed to Engine.update. + */ + update60Hz: function () + { + return 1000 / 60; + }, + + /** + * Runs the Matter Engine.update at a fixed timestep of 30Hz. + * + * @method Phaser.Physics.Matter.World#update30Hz + * @since 3.4.0 + * + * @return {number} The delta value to be passed to Engine.update. + */ + update30Hz: function () + { + return 1000 / 30; + }, + + /** + * Handles the rendering of bodies and debug information to the debug Graphics object, if enabled. + * + * @method Phaser.Physics.Matter.World#postUpdate + * @private + * @since 3.0.0 + */ + postUpdate: function () + { + if (!this.drawDebug) + { + return; + } + + this.debugGraphic.clear(); + + var bodies = Composite.allBodies(this.localWorld); + + if (this.defaults.debugWireframes) + { + if (this.defaults.debugShowConvexHulls) + { + this.renderConvexHulls(bodies); + } + + this.renderWireframes(bodies); + } + else + { + this.renderBodies(bodies); + } + + if (this.defaults.debugShowJoint) + { + this.renderJoints(); + } + }, + + /** + * Renders the debug convex hulls from the given array of bodies. + * + * @method Phaser.Physics.Matter.World#renderConvexHulls + * @private + * @since 3.14.0 + * + * @param {array} bodies - An array of bodies from the localWorld. + */ + renderConvexHulls: function (bodies) + { + var graphics = this.debugGraphic; + + graphics.lineStyle(1, this.defaults.debugConvexHullColor); + + graphics.beginPath(); + + for (var i = 0; i < bodies.length; i++) + { + var body = bodies[i]; + + if (!body.render.visible || body.parts.length === 1) + { + continue; + } + + graphics.moveTo(body.vertices[0].x, body.vertices[0].y); + + for (var j = 1; j < body.vertices.length; j++) + { + graphics.lineTo(body.vertices[j].x, body.vertices[j].y); + } + + graphics.lineTo(body.vertices[0].x, body.vertices[0].y); + } + + graphics.strokePath(); + }, + + /** + * Renders the wireframes of the given array of bodies. + * + * @method Phaser.Physics.Matter.World#renderWireframes + * @private + * @since 3.14.0 + * + * @param {array} bodies - An array of bodies from the localWorld. + */ + renderWireframes: function (bodies) + { + var graphics = this.debugGraphic; + var showInternalEdges = this.defaults.debugShowInternalEdges; + + graphics.lineStyle(1, this.defaults.bodyDebugColor); + + graphics.beginPath(); + + for (var i = 0; i < bodies.length; i++) + { + var body = bodies[i]; + + if (!body.render.visible) + { + continue; + } + + for (var k = (body.parts.length > 1) ? 1 : 0; k < body.parts.length; k++) + { + var part = body.parts[k]; + + var vertLength = part.vertices.length; + + graphics.moveTo(part.vertices[0].x, part.vertices[0].y); + + for (var j = 1; j < vertLength; j++) + { + if (!part.vertices[j - 1].isInternal || showInternalEdges) + { + graphics.lineTo(part.vertices[j].x, part.vertices[j].y); + } + else + { + graphics.moveTo(part.vertices[j].x, part.vertices[j].y); + } + + if (part.vertices[j].isInternal && !showInternalEdges) + { + graphics.moveTo(part.vertices[(j + 1) % vertLength].x, part.vertices[(j + 1) % vertLength].y); + } + } + + graphics.lineTo(part.vertices[0].x, part.vertices[0].y); + } + } + + graphics.strokePath(); + }, + + /** + * Renders the array of bodies. + * + * @method Phaser.Physics.Matter.World#renderBodies + * @private + * @since 3.14.0 + * + * @param {array} bodies - An array of bodies from the localWorld. + */ + renderBodies: function (bodies) + { + var graphics = this.debugGraphic; + + var showInternalEdges = this.defaults.debugShowInternalEdges || !this.defaults.debugWireframes; + var showSleeping = this.defaults.debugShowSleeping; + var wireframes = this.defaults.debugWireframes; + + var body; + var part; + var i; + var k; + + for (i = 0; i < bodies.length; i++) + { + body = bodies[i]; + + if (!body.render.visible) + { + continue; + } + + // Handle compound parts + for (k = body.parts.length > 1 ? 1 : 0; k < body.parts.length; k++) + { + part = body.parts[k]; + + if (!part.render.visible) + { + continue; + } + + if (showSleeping && body.isSleeping) + { + graphics.lineStyle(1, this.defaults.bodyDebugColor, 0.5 * part.render.opacity); + graphics.fillStyle(this.defaults.bodyDebugColor, 0.5 * part.render.opacity); + } + else + { + graphics.lineStyle(1, this.defaults.bodyDebugColor, part.render.opacity); + graphics.fillStyle(this.defaults.bodyDebugColor, part.render.opacity); + } + + // Part polygon + if (part.circleRadius) + { + graphics.beginPath(); + graphics.arc(part.position.x, part.position.y, part.circleRadius, 0, 2 * Math.PI); + } + else + { + graphics.beginPath(); + graphics.moveTo(part.vertices[0].x, part.vertices[0].y); + + var vertLength = part.vertices.length; + + for (var j = 1; j < vertLength; j++) + { + if (!part.vertices[j - 1].isInternal || showInternalEdges) + { + graphics.lineTo(part.vertices[j].x, part.vertices[j].y); + } + else + { + graphics.moveTo(part.vertices[j].x, part.vertices[j].y); + } + + if (part.vertices[j].isInternal && !showInternalEdges) + { + graphics.moveTo(part.vertices[(j + 1) % part.vertices.length].x, part.vertices[(j + 1) % part.vertices.length].y); + } + } + + graphics.lineTo(part.vertices[0].x, part.vertices[0].y); + + graphics.closePath(); + } + + if (!wireframes) + { + graphics.fillPath(); + } + else + { + graphics.strokePath(); + } + } + } + }, + + /** + * Renders world constraints. + * + * @method Phaser.Physics.Matter.World#renderJoints + * @private + * @since 3.14.0 + */ + renderJoints: function () + { + var graphics = this.debugGraphic; + + graphics.lineStyle(2, this.defaults.jointDebugColor); + + // Render constraints + var constraints = Composite.allConstraints(this.localWorld); + + for (var i = 0; i < constraints.length; i++) + { + var constraint = constraints[i]; + + if (!constraint.render.visible || !constraint.pointA || !constraint.pointB) + { + continue; + } + + if (constraint.render.lineWidth) + { + graphics.lineStyle(constraint.render.lineWidth, Common.colorToNumber(constraint.render.strokeStyle)); + } + + var bodyA = constraint.bodyA; + var bodyB = constraint.bodyB; + var start; + var end; + + if (bodyA) + { + start = Vector.add(bodyA.position, constraint.pointA); + } + else + { + start = constraint.pointA; + } + + if (constraint.render.type === 'pin') + { + graphics.beginPath(); + graphics.arc(start.x, start.y, 3, 0, 2 * Math.PI); + graphics.closePath(); + } + else + { + if (bodyB) + { + end = Vector.add(bodyB.position, constraint.pointB); + } + else + { + end = constraint.pointB; + } + + graphics.beginPath(); + graphics.moveTo(start.x, start.y); + + if (constraint.render.type === 'spring') + { + var delta = Vector.sub(end, start); + var normal = Vector.perp(Vector.normalise(delta)); + var coils = Math.ceil(Common.clamp(constraint.length / 5, 12, 20)); + var offset; + + for (var j = 1; j < coils; j += 1) + { + offset = (j % 2 === 0) ? 1 : -1; + + graphics.lineTo( + start.x + delta.x * (j / coils) + normal.x * offset * 4, + start.y + delta.y * (j / coils) + normal.y * offset * 4 + ); + } + } + + graphics.lineTo(end.x, end.y); + } + + if (constraint.render.lineWidth) + { + graphics.strokePath(); + } + + if (constraint.render.anchors) + { + graphics.fillStyle(Common.colorToNumber(constraint.render.strokeStyle)); + graphics.beginPath(); + graphics.arc(start.x, start.y, 6, 0, 2 * Math.PI); + graphics.arc(end.x, end.y, 6, 0, 2 * Math.PI); + graphics.closePath(); + graphics.fillPath(); + } + } + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.World#fromPath + * @since 3.0.0 + * + * @param {string} path - [description] + * @param {array} points - [description] + * + * @return {array} [description] + */ + fromPath: function (path, points) + { + if (points === undefined) { points = []; } + + // var pathPattern = /L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig; + + // eslint-disable-next-line no-useless-escape + var pathPattern = /L?\s*([\-\d\.e]+)[\s,]*([\-\d\.e]+)*/ig; + + path.replace(pathPattern, function (match, x, y) + { + points.push({ x: parseFloat(x), y: parseFloat(y) }); + }); + + return points; + }, + + /** + * Resets the internal collision IDs that Matter.JS uses for Body collision groups. + * + * You should call this before destroying your game if you need to restart the game + * again on the same page, without first reloading the page. Or, if you wish to + * consistently destroy a Scene that contains Matter.js and then run it again + * later in the same game. + * + * @method Phaser.Physics.Matter.World#resetCollisionIDs + * @since 3.17.0 + */ + resetCollisionIDs: function () + { + Body._nextCollidingGroupId = 1; + Body._nextNonCollidingGroupId = -1; + Body._nextCategory = 0x0001; + + return this; + }, + + /** + * Will remove all Matter physics event listeners and clear the matter physics world, + * engine and any debug graphics, if any. + * + * @method Phaser.Physics.Matter.World#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + MatterEvents.off(this.engine); + + this.removeAllListeners(); + + MatterWorld.clear(this.localWorld, false); + + Engine.clear(this.engine); + + if (this.drawDebug) + { + this.debugGraphic.destroy(); + } + }, + + /** + * Will remove all Matter physics event listeners and clear the matter physics world, + * engine and any debug graphics, if any. + * + * After destroying the world it cannot be re-used again. + * + * @method Phaser.Physics.Matter.World#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + } + +}); + +module.exports = World; + + +/***/ }), +/* 1338 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +__webpack_require__(490); + +var CONST = __webpack_require__(26); +var Extend = __webpack_require__(17); + +/** + * @namespace Phaser + */ + +var Phaser = { + + Actions: __webpack_require__(229), + Animations: __webpack_require__(579), + BlendModes: __webpack_require__(52), + Cache: __webpack_require__(594), + Cameras: __webpack_require__(597), + Core: __webpack_require__(680), + Class: __webpack_require__(0), + Create: __webpack_require__(737), + Curves: __webpack_require__(743), + Data: __webpack_require__(746), + Display: __webpack_require__(748), + DOM: __webpack_require__(777), + Events: __webpack_require__(778), + Game: __webpack_require__(780), + GameObjects: __webpack_require__(874), + Geom: __webpack_require__(401), + Input: __webpack_require__(1148), + Loader: __webpack_require__(1182), + Math: __webpack_require__(165), + Physics: __webpack_require__(1339), + Plugins: __webpack_require__(1248), + Renderer: __webpack_require__(1397), + Scale: __webpack_require__(1250), + ScaleModes: __webpack_require__(104), + Scene: __webpack_require__(346), + Scenes: __webpack_require__(1251), + Structs: __webpack_require__(1253), + Textures: __webpack_require__(1254), + Tilemaps: __webpack_require__(1256), + Time: __webpack_require__(1297), + Tweens: __webpack_require__(1299), + Utils: __webpack_require__(1309) + +}; + +// Merge in the optional plugins + +if (true) +{ + Phaser.Sound = __webpack_require__(1319); +} + +if (false) +{} + +if (false) +{} + +// Merge in the consts + +Phaser = Extend(false, Phaser, CONST); + +/** + * The root types namespace. + * + * @namespace Phaser.Types + * @since 3.17.0 + */ + +// Export it + +module.exports = Phaser; + +global.Phaser = Phaser; + +/* + * "Documentation is like pizza: when it is good, it is very, very good; + * and when it is bad, it is better than nothing." + * -- Dick Brandon + */ + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(222))) + +/***/ }), +/* 1339 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Physics + */ + +/** + * @namespace Phaser.Types.Physics + */ + +module.exports = { + + Arcade: __webpack_require__(1207), + Impact: __webpack_require__(1340), + Matter: __webpack_require__(1363) + +}; + + +/***/ }), +/* 1340 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * An Impact.js compatible physics world, body and solver, for those who are used + * to the Impact way of defining and controlling physics bodies. Also works with + * the new Loader support for Weltmeister map data. + * + * World updated to run off the Phaser main loop. + * Body extended to support additional setter functions. + * + * To create the map data you'll need Weltmeister, which comes with Impact + * and can be purchased from http://impactjs.com + * + * My thanks to Dominic Szablewski for his permission to support Impact in Phaser. + * + * @namespace Phaser.Physics.Impact + */ +module.exports = { + + Body: __webpack_require__(1320), + Events: __webpack_require__(1238), + COLLIDES: __webpack_require__(446), + CollisionMap: __webpack_require__(1321), + Factory: __webpack_require__(1322), + Image: __webpack_require__(1324), + ImpactBody: __webpack_require__(1323), + ImpactPhysics: __webpack_require__(1359), + Sprite: __webpack_require__(1325), + TYPE: __webpack_require__(447), + World: __webpack_require__(1326) + +}; + + +/***/ }), +/* 1341 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(22); + +/** + * [description] + * + * @function Phaser.Physics.Impact.GetVelocity + * @since 3.0.0 + * + * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. + * @param {number} vel - [description] + * @param {number} accel - [description] + * @param {number} friction - [description] + * @param {number} max - [description] + * + * @return {number} [description] + */ +var GetVelocity = function (delta, vel, accel, friction, max) +{ + if (accel) + { + return Clamp(vel + accel * delta, -max, max); + } + else if (friction) + { + var frictionDelta = friction * delta; + + if (vel - frictionDelta > 0) + { + return vel - frictionDelta; + } + else if (vel + frictionDelta < 0) + { + return vel + frictionDelta; + } + else + { + return 0; + } + } + + return Clamp(vel, -max, max); +}; + +module.exports = GetVelocity; + + +/***/ }), +/* 1342 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Set up the trace-result + * var res = { + * collision: {x: false, y: false, slope: false}, + * pos: {x: x, y: y}, + * tile: {x: 0, y: 0} + * }; + * + * @function Phaser.Physics.Impact.UpdateMotion + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body} body - [description] + * @param {object} res - [description] + */ +var UpdateMotion = function (body, res) +{ + body.standing = false; + + // Y + if (res.collision.y) + { + if (body.bounciness > 0 && Math.abs(body.vel.y) > body.minBounceVelocity) + { + body.vel.y *= -body.bounciness; + } + else + { + if (body.vel.y > 0) + { + body.standing = true; + } + + body.vel.y = 0; + } + } + + // X + if (res.collision.x) + { + if (body.bounciness > 0 && Math.abs(body.vel.x) > body.minBounceVelocity) + { + body.vel.x *= -body.bounciness; + } + else + { + body.vel.x = 0; + } + } + + // SLOPE + if (res.collision.slope) + { + var s = res.collision.slope; + + if (body.bounciness > 0) + { + var proj = body.vel.x * s.nx + body.vel.y * s.ny; + + body.vel.x = (body.vel.x - s.nx * proj * 2) * body.bounciness; + body.vel.y = (body.vel.y - s.ny * proj * 2) * body.bounciness; + } + else + { + var lengthSquared = s.x * s.x + s.y * s.y; + var dot = (body.vel.x * s.x + body.vel.y * s.y) / lengthSquared; + + body.vel.x = s.x * dot; + body.vel.y = s.y * dot; + + var angle = Math.atan2(s.x, s.y); + + if (angle > body.slopeStanding.min && angle < body.slopeStanding.max) + { + body.standing = true; + } + } + } + + body.pos.x = res.pos.x; + body.pos.y = res.pos.y; +}; + +module.exports = UpdateMotion; + + +/***/ }), +/* 1343 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Physics World Collide Event. + * + * This event is dispatched by an Impact Physics World instance if two bodies collide. + * + * Listen to it from a Scene using: `this.impact.world.on('collide', listener)`. + * + * @event Phaser.Physics.Impact.Events#COLLIDE + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.Body} bodyA - The first body involved in the collision. + * @param {Phaser.Physics.Impact.Body} bodyB - The second body involved in the collision. + * @param {string} axis - The collision axis. Either `x` or `y`. + */ +module.exports = 'collide'; + + +/***/ }), +/* 1344 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Physics World Pause Event. + * + * This event is dispatched by an Impact Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.impact.world.on('pause', listener)`. + * + * @event Phaser.Physics.Impact.Events#PAUSE + * @since 3.0.0 + */ +module.exports = 'pause'; + + +/***/ }), +/* 1345 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Physics World Resume Event. + * + * This event is dispatched by an Impact Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.impact.world.on('resume', listener)`. + * + * @event Phaser.Physics.Impact.Events#RESUME + * @since 3.0.0 + */ +module.exports = 'resume'; + + +/***/ }), +/* 1346 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var H = 0.5; +var N = 1 / 3; +var M = 2 / 3; + +// Tile ID to Slope defs. +// First 4 elements = line data, final = solid or non-solid behind the line + +module.exports = { + + 2: [ 0, 1, 1, 0, true ], + 3: [ 0, 1, 1, H, true ], + 4: [ 0, H, 1, 0, true ], + 5: [ 0, 1, 1, M, true ], + 6: [ 0, M, 1, N, true ], + 7: [ 0, N, 1, 0, true ], + 8: [ H, 1, 0, 0, true ], + 9: [ 1, 0, H, 1, true ], + 10: [ H, 1, 1, 0, true ], + 11: [ 0, 0, H, 1, true ], + 12: [ 0, 0, 1, 0, false ], + 13: [ 1, 1, 0, 0, true ], + 14: [ 1, H, 0, 0, true ], + 15: [ 1, 1, 0, H, true ], + 16: [ 1, N, 0, 0, true ], + 17: [ 1, M, 0, N, true ], + 18: [ 1, 1, 0, M, true ], + 19: [ 1, 1, H, 0, true ], + 20: [ H, 0, 0, 1, true ], + 21: [ 0, 1, H, 0, true ], + 22: [ H, 0, 1, 1, true ], + 23: [ 1, 1, 0, 1, false ], + 24: [ 0, 0, 1, 1, true ], + 25: [ 0, 0, 1, H, true ], + 26: [ 0, H, 1, 1, true ], + 27: [ 0, 0, 1, N, true ], + 28: [ 0, N, 1, M, true ], + 29: [ 0, M, 1, 1, true ], + 30: [ N, 1, 0, 0, true ], + 31: [ 1, 0, M, 1, true ], + 32: [ M, 1, 1, 0, true ], + 33: [ 0, 0, N, 1, true ], + 34: [ 1, 0, 1, 1, false ], + 35: [ 1, 0, 0, 1, true ], + 36: [ 1, H, 0, 1, true ], + 37: [ 1, 0, 0, H, true ], + 38: [ 1, M, 0, 1, true ], + 39: [ 1, N, 0, M, true ], + 40: [ 1, 0, 0, N, true ], + 41: [ M, 1, N, 0, true ], + 42: [ M, 0, N, 1, true ], + 43: [ N, 1, M, 0, true ], + 44: [ N, 0, M, 1, true ], + 45: [ 0, 1, 0, 0, false ], + 52: [ 1, 1, M, 0, true ], + 53: [ N, 0, 0, 1, true ], + 54: [ 0, 1, N, 0, true ], + 55: [ M, 0, 1, 1, true ] + +}; + + +/***/ }), +/* 1347 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Acceleration component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.Acceleration + * @since 3.0.0 + */ +var Acceleration = { + + /** + * Sets the horizontal acceleration of this body. + * + * @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationX + * @since 3.0.0 + * + * @param {number} x - The amount of acceleration to apply. + * + * @return {this} This Game Object. + */ + setAccelerationX: function (x) + { + this.accel.x = x; + + return this; + }, + + /** + * Sets the vertical acceleration of this body. + * + * @method Phaser.Physics.Impact.Components.Acceleration#setAccelerationY + * @since 3.0.0 + * + * @param {number} y - The amount of acceleration to apply. + * + * @return {this} This Game Object. + */ + setAccelerationY: function (y) + { + this.accel.y = y; + + return this; + }, + + /** + * Sets the horizontal and vertical acceleration of this body. + * + * @method Phaser.Physics.Impact.Components.Acceleration#setAcceleration + * @since 3.0.0 + * + * @param {number} x - The amount of horizontal acceleration to apply. + * @param {number} y - The amount of vertical acceleration to apply. + * + * @return {this} This Game Object. + */ + setAcceleration: function (x, y) + { + this.accel.x = x; + this.accel.y = y; + + return this; + } + +}; + +module.exports = Acceleration; + + +/***/ }), +/* 1348 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Body Scale component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.BodyScale + * @since 3.0.0 + */ +var BodyScale = { + + /** + * Sets the size of the physics body. + * + * @method Phaser.Physics.Impact.Components.BodyScale#setBodySize + * @since 3.0.0 + * + * @param {number} width - The width of the body in pixels. + * @param {number} [height=width] - The height of the body in pixels. + * + * @return {this} This Game Object. + */ + setBodySize: function (width, height) + { + if (height === undefined) { height = width; } + + this.body.size.x = Math.round(width); + this.body.size.y = Math.round(height); + + return this; + }, + + /** + * Sets the scale of the physics body. + * + * @method Phaser.Physics.Impact.Components.BodyScale#setBodyScale + * @since 3.0.0 + * + * @param {number} scaleX - The horizontal scale of the body. + * @param {number} [scaleY] - The vertical scale of the body. If not given, will use the horizontal scale value. + * + * @return {this} This Game Object. + */ + setBodyScale: function (scaleX, scaleY) + { + if (scaleY === undefined) { scaleY = scaleX; } + + var gameObject = this.body.gameObject; + + if (gameObject) + { + gameObject.setScale(scaleX, scaleY); + + return this.setBodySize(gameObject.width * gameObject.scaleX, gameObject.height * gameObject.scaleY); + } + else + { + return this.setBodySize(this.body.size.x * scaleX, this.body.size.y * scaleY); + } + } + +}; + +module.exports = BodyScale; + + +/***/ }), +/* 1349 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TYPE = __webpack_require__(447); + +/** + * The Impact Body Type component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.BodyType + * @since 3.0.0 + */ +var BodyType = { + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.BodyType#getBodyType + * @since 3.0.0 + * + * @return {number} [description] + */ + getBodyType: function () + { + return this.body.type; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.BodyType#setTypeNone + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setTypeNone: function () + { + this.body.type = TYPE.NONE; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.BodyType#setTypeA + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setTypeA: function () + { + this.body.type = TYPE.A; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.BodyType#setTypeB + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setTypeB: function () + { + this.body.type = TYPE.B; + + return this; + } + +}; + +module.exports = BodyType; + + +/***/ }), +/* 1350 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Bounce component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.Bounce + * @since 3.0.0 + */ +var Bounce = { + + /** + * Sets the impact physics bounce, or restitution, value. + * + * @method Phaser.Physics.Impact.Components.Bounce#setBounce + * @since 3.0.0 + * + * @param {number} value - A value between 0 (no rebound) and 1 (full rebound) + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setBounce: function (value) + { + this.body.bounciness = value; + + return this; + }, + + /** + * Sets the minimum velocity the body is allowed to be moving to be considered for rebound. + * + * @method Phaser.Physics.Impact.Components.Bounce#setMinBounceVelocity + * @since 3.0.0 + * + * @param {number} value - The minimum allowed velocity. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setMinBounceVelocity: function (value) + { + this.body.minBounceVelocity = value; + + return this; + }, + + /** + * The bounce, or restitution, value of this body. + * A value between 0 (no rebound) and 1 (full rebound) + * + * @name Phaser.Physics.Impact.Components.Bounce#bounce + * @type {number} + * @since 3.0.0 + */ + bounce: { + + get: function () + { + return this.body.bounciness; + }, + + set: function (value) + { + this.body.bounciness = value; + } + + } + +}; + +module.exports = Bounce; + + +/***/ }), +/* 1351 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TYPE = __webpack_require__(447); + +/** + * The Impact Check Against component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.CheckAgainst + * @since 3.0.0 + */ +var CheckAgainst = { + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.CheckAgainst#setAvsB + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setAvsB: function () + { + this.setTypeA(); + + return this.setCheckAgainstB(); + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.CheckAgainst#setBvsA + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setBvsA: function () + { + this.setTypeB(); + + return this.setCheckAgainstA(); + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstNone + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setCheckAgainstNone: function () + { + this.body.checkAgainst = TYPE.NONE; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstA + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setCheckAgainstA: function () + { + this.body.checkAgainst = TYPE.A; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.CheckAgainst#setCheckAgainstB + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setCheckAgainstB: function () + { + this.body.checkAgainst = TYPE.B; + + return this; + }, + + /** + * [description] + * + * @name Phaser.Physics.Impact.Components.CheckAgainst#checkAgainst + * @type {number} + * @since 3.0.0 + */ + checkAgainst: { + + get: function () + { + return this.body.checkAgainst; + }, + + set: function (value) + { + this.body.checkAgainst = value; + } + + } + +}; + +module.exports = CheckAgainst; + + +/***/ }), +/* 1352 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var COLLIDES = __webpack_require__(446); + +/** + * @callback CollideCallback + * + * @param {Phaser.Physics.Impact.Body} body - [description] + * @param {Phaser.Physics.Impact.Body} other - [description] + * @param {string} axis - [description] + */ + +/** + * The Impact Collides component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.Collides + * @since 3.0.0 + */ +var Collides = { + + _collideCallback: null, + _callbackScope: null, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Collides#setCollideCallback + * @since 3.0.0 + * + * @param {CollideCallback} callback - [description] + * @param {*} scope - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setCollideCallback: function (callback, scope) + { + this._collideCallback = callback; + + if (scope) + { + this._callbackScope = scope; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Collides#setCollidesNever + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setCollidesNever: function () + { + this.body.collides = COLLIDES.NEVER; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Collides#setLiteCollision + * @since 3.6.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setLiteCollision: function () + { + this.body.collides = COLLIDES.LITE; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Collides#setPassiveCollision + * @since 3.6.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setPassiveCollision: function () + { + this.body.collides = COLLIDES.PASSIVE; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Collides#setActiveCollision + * @since 3.6.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setActiveCollision: function () + { + this.body.collides = COLLIDES.ACTIVE; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Collides#setFixedCollision + * @since 3.6.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setFixedCollision: function () + { + this.body.collides = COLLIDES.FIXED; + + return this; + }, + + /** + * [description] + * + * @name Phaser.Physics.Impact.Components.Collides#collides + * @type {number} + * @since 3.0.0 + */ + collides: { + + get: function () + { + return this.body.collides; + }, + + set: function (value) + { + this.body.collides = value; + } + + } + +}; + +module.exports = Collides; + + +/***/ }), +/* 1353 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Debug component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.Debug + * @since 3.0.0 + */ +var Debug = { + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Debug#setDebug + * @since 3.0.0 + * + * @param {boolean} showBody - [description] + * @param {boolean} showVelocity - [description] + * @param {number} bodyColor - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setDebug: function (showBody, showVelocity, bodyColor) + { + this.debugShowBody = showBody; + this.debugShowVelocity = showVelocity; + this.debugBodyColor = bodyColor; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Debug#setDebugBodyColor + * @since 3.0.0 + * + * @param {number} value - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setDebugBodyColor: function (value) + { + this.body.debugBodyColor = value; + + return this; + }, + + /** + * [description] + * + * @name Phaser.Physics.Impact.Components.Debug#debugShowBody + * @type {boolean} + * @since 3.0.0 + */ + debugShowBody: { + + get: function () + { + return this.body.debugShowBody; + }, + + set: function (value) + { + this.body.debugShowBody = value; + } + + }, + + /** + * [description] + * + * @name Phaser.Physics.Impact.Components.Debug#debugShowVelocity + * @type {boolean} + * @since 3.0.0 + */ + debugShowVelocity: { + + get: function () + { + return this.body.debugShowVelocity; + }, + + set: function (value) + { + this.body.debugShowVelocity = value; + } + + }, + + /** + * [description] + * + * @name Phaser.Physics.Impact.Components.Debug#debugBodyColor + * @type {number} + * @since 3.0.0 + */ + debugBodyColor: { + + get: function () + { + return this.body.debugBodyColor; + }, + + set: function (value) + { + this.body.debugBodyColor = value; + } + + } + +}; + +module.exports = Debug; + + +/***/ }), +/* 1354 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Friction component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.Friction + * @since 3.0.0 + */ +var Friction = { + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Friction#setFrictionX + * @since 3.0.0 + * + * @param {number} x - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setFrictionX: function (x) + { + this.friction.x = x; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Friction#setFrictionY + * @since 3.0.0 + * + * @param {number} y - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setFrictionY: function (y) + { + this.friction.y = y; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Friction#setFriction + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setFriction: function (x, y) + { + this.friction.x = x; + this.friction.y = y; + + return this; + } + +}; + +module.exports = Friction; + + +/***/ }), +/* 1355 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Gravity component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.Gravity + * @since 3.0.0 + */ +var Gravity = { + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Gravity#setGravity + * @since 3.0.0 + * + * @param {number} value - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setGravity: function (value) + { + this.body.gravityFactor = value; + + return this; + }, + + /** + * [description] + * + * @name Phaser.Physics.Impact.Components.Gravity#gravity + * @type {number} + * @since 3.0.0 + */ + gravity: { + + get: function () + { + return this.body.gravityFactor; + }, + + set: function (value) + { + this.body.gravityFactor = value; + } + + } + +}; + +module.exports = Gravity; + + +/***/ }), +/* 1356 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Offset component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.Offset + * @since 3.0.0 + */ +var Offset = { + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.Offset#setOffset + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + * @param {number} [width] - [description] + * @param {number} [height] - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setOffset: function (x, y, width, height) + { + this.body.offset.x = x; + this.body.offset.y = y; + + if (width) + { + this.setBodySize(width, height); + } + + return this; + } + +}; + +module.exports = Offset; + + +/***/ }), +/* 1357 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Set Game Object component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.SetGameObject + * @since 3.0.0 + */ +var SetGameObject = { + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.SetGameObject#setGameObject + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - [description] + * @param {boolean} [sync=true] - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setGameObject: function (gameObject, sync) + { + if (sync === undefined) { sync = true; } + + if (gameObject) + { + this.body.gameObject = gameObject; + + if (sync) + { + this.syncGameObject(); + } + } + else + { + this.body.gameObject = null; + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.Components.SetGameObject#syncGameObject + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + syncGameObject: function () + { + var gameObject = this.body.gameObject; + + if (gameObject) + { + this.setBodySize(gameObject.width * gameObject.scaleX, gameObject.height * gameObject.scaleY); + } + + return this; + } + +}; + +module.exports = SetGameObject; + + +/***/ }), +/* 1358 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Impact Velocity component. + * Should be applied as a mixin. + * + * @namespace Phaser.Physics.Impact.Components.Velocity + * @since 3.0.0 + */ +var Velocity = { + + /** + * Sets the horizontal velocity of the physics body. + * + * @method Phaser.Physics.Impact.Components.Velocity#setVelocityX + * @since 3.0.0 + * + * @param {number} x - The horizontal velocity value. + * + * @return {this} This Game Object. + */ + setVelocityX: function (x) + { + this.vel.x = x; + + return this; + }, + + /** + * Sets the vertical velocity of the physics body. + * + * @method Phaser.Physics.Impact.Components.Velocity#setVelocityY + * @since 3.0.0 + * + * @param {number} y - The vertical velocity value. + * + * @return {this} This Game Object. + */ + setVelocityY: function (y) + { + this.vel.y = y; + + return this; + }, + + /** + * Sets the horizontal and vertical velocities of the physics body. + * + * @method Phaser.Physics.Impact.Components.Velocity#setVelocity + * @since 3.0.0 + * + * @param {number} x - The horizontal velocity value. + * @param {number} [y=x] - The vertical velocity value. If not given, defaults to the horizontal value. + * + * @return {this} This Game Object. + */ + setVelocity: function (x, y) + { + if (y === undefined) { y = x; } + + this.vel.x = x; + this.vel.y = y; + + return this; + }, + + /** + * Sets the maximum velocity this body can travel at. + * + * @method Phaser.Physics.Impact.Components.Velocity#setMaxVelocity + * @since 3.0.0 + * + * @param {number} x - The maximum allowed horizontal velocity. + * @param {number} [y=x] - The maximum allowed vertical velocity. If not given, defaults to the horizontal value. + * + * @return {this} This Game Object. + */ + setMaxVelocity: function (x, y) + { + if (y === undefined) { y = x; } + + this.maxVel.x = x; + this.maxVel.y = y; + + return this; + } + +}; + +module.exports = Velocity; + + +/***/ }), +/* 1359 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Factory = __webpack_require__(1322); +var GetFastValue = __webpack_require__(2); +var Merge = __webpack_require__(85); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var World = __webpack_require__(1326); + +/** + * @classdesc + * [description] + * + * @class ImpactPhysics + * @memberof Phaser.Physics.Impact + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - [description] + */ +var ImpactPhysics = new Class({ + + initialize: + + function ImpactPhysics (scene) + { + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactPhysics#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactPhysics#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactPhysics#config + * @type {object} + * @since 3.0.0 + */ + this.config = this.getConfig(); + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactPhysics#world + * @type {Phaser.Physics.Impact.World} + * @since 3.0.0 + */ + this.world; + + /** + * [description] + * + * @name Phaser.Physics.Impact.ImpactPhysics#add + * @type {Phaser.Physics.Impact.Factory} + * @since 3.0.0 + */ + this.add; + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Physics.Impact.ImpactPhysics#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.world = new World(this.scene, this.config); + this.add = new Factory(this.world); + + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Physics.Impact.ImpactPhysics#start + * @private + * @since 3.5.0 + */ + start: function () + { + if (!this.world) + { + this.world = new World(this.scene, this.config); + this.add = new Factory(this.world); + } + + var eventEmitter = this.systems.events; + + eventEmitter.on(SceneEvents.UPDATE, this.world.update, this.world); + eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.ImpactPhysics#getConfig + * @since 3.0.0 + * + * @return {object} [description] + */ + getConfig: function () + { + var gameConfig = this.systems.game.config.physics; + var sceneConfig = this.systems.settings.physics; + + var config = Merge( + GetFastValue(sceneConfig, 'impact', {}), + GetFastValue(gameConfig, 'impact', {}) + ); + + return config; + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.ImpactPhysics#pause + * @since 3.0.0 + * + * @return {Phaser.Physics.Impact.World} The Impact World object. + */ + pause: function () + { + return this.world.pause(); + }, + + /** + * [description] + * + * @method Phaser.Physics.Impact.ImpactPhysics#resume + * @since 3.0.0 + * + * @return {Phaser.Physics.Impact.World} The Impact World object. + */ + resume: function () + { + return this.world.resume(); + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.Physics.Impact.ImpactPhysics#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + var eventEmitter = this.systems.events; + + eventEmitter.off(SceneEvents.UPDATE, this.world.update, this.world); + eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); + + this.add.destroy(); + this.world.destroy(); + + this.add = null; + this.world = null; + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.Physics.Impact.ImpactPhysics#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + } + +}); + +PluginCache.register('ImpactPhysics', ImpactPhysics, 'impactPhysics'); + +module.exports = ImpactPhysics; + + +/***/ }), +/* 1360 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var COLLIDES = __webpack_require__(446); +var Events = __webpack_require__(1238); +var SeparateX = __webpack_require__(1361); +var SeparateY = __webpack_require__(1362); + +/** + * Impact Physics Solver + * + * @function Phaser.Physics.Impact.Solver + * @fires Phaser.Physics.Impact.Events#COLLIDE + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.World} world - The Impact simulation to run the solver in. + * @param {Phaser.Physics.Impact.Body} bodyA - The first body in the collision. + * @param {Phaser.Physics.Impact.Body} bodyB - The second body in the collision. + */ +var Solver = function (world, bodyA, bodyB) +{ + var weak = null; + + if (bodyA.collides === COLLIDES.LITE || bodyB.collides === COLLIDES.FIXED) + { + weak = bodyA; + } + else if (bodyB.collides === COLLIDES.LITE || bodyA.collides === COLLIDES.FIXED) + { + weak = bodyB; + } + + if (bodyA.last.x + bodyA.size.x > bodyB.last.x && bodyA.last.x < bodyB.last.x + bodyB.size.x) + { + if (bodyA.last.y < bodyB.last.y) + { + SeparateY(world, bodyA, bodyB, weak); + } + else + { + SeparateY(world, bodyB, bodyA, weak); + } + + bodyA.collideWith(bodyB, 'y'); + bodyB.collideWith(bodyA, 'y'); + + world.emit(Events.COLLIDE, bodyA, bodyB, 'y'); + } + else if (bodyA.last.y + bodyA.size.y > bodyB.last.y && bodyA.last.y < bodyB.last.y + bodyB.size.y) + { + if (bodyA.last.x < bodyB.last.x) + { + SeparateX(world, bodyA, bodyB, weak); + } + else + { + SeparateX(world, bodyB, bodyA, weak); + } + + bodyA.collideWith(bodyB, 'x'); + bodyB.collideWith(bodyA, 'x'); + + world.emit(Events.COLLIDE, bodyA, bodyB, 'x'); + } +}; + +module.exports = Solver; + + +/***/ }), +/* 1361 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * [description] + * + * @function Phaser.Physics.Impact.SeparateX + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.World} world - [description] + * @param {Phaser.Physics.Impact.Body} left - [description] + * @param {Phaser.Physics.Impact.Body} right - [description] + * @param {Phaser.Physics.Impact.Body} [weak] - [description] + */ +var SeparateX = function (world, left, right, weak) +{ + var nudge = left.pos.x + left.size.x - right.pos.x; + + // We have a weak entity, so just move this one + if (weak) + { + var strong = (left === weak) ? right : left; + + weak.vel.x = -weak.vel.x * weak.bounciness + strong.vel.x; + + var resWeak = world.collisionMap.trace(weak.pos.x, weak.pos.y, weak === left ? -nudge : nudge, 0, weak.size.x, weak.size.y); + + weak.pos.x = resWeak.pos.x; + } + else + { + var v2 = (left.vel.x - right.vel.x) / 2; + + left.vel.x = -v2; + right.vel.x = v2; + + var resLeft = world.collisionMap.trace(left.pos.x, left.pos.y, -nudge / 2, 0, left.size.x, left.size.y); + + left.pos.x = Math.floor(resLeft.pos.x); + + var resRight = world.collisionMap.trace(right.pos.x, right.pos.y, nudge / 2, 0, right.size.x, right.size.y); + + right.pos.x = Math.ceil(resRight.pos.x); + } +}; + +module.exports = SeparateX; + + +/***/ }), +/* 1362 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * [description] + * + * @function Phaser.Physics.Impact.SeparateY + * @since 3.0.0 + * + * @param {Phaser.Physics.Impact.World} world - [description] + * @param {Phaser.Physics.Impact.Body} top - [description] + * @param {Phaser.Physics.Impact.Body} bottom - [description] + * @param {Phaser.Physics.Impact.Body} [weak] - [description] + */ +var SeparateY = function (world, top, bottom, weak) +{ + var nudge = (top.pos.y + top.size.y - bottom.pos.y); + var nudgeX; + var resTop; + + if (weak) + { + var strong = (top === weak) ? bottom : top; + + weak.vel.y = -weak.vel.y * weak.bounciness + strong.vel.y; + + // Riding on a platform? + nudgeX = 0; + + if (weak === top && Math.abs(weak.vel.y - strong.vel.y) < weak.minBounceVelocity) + { + weak.standing = true; + nudgeX = strong.vel.x * world.delta; + } + + var resWeak = world.collisionMap.trace(weak.pos.x, weak.pos.y, nudgeX, weak === top ? -nudge : nudge, weak.size.x, weak.size.y); + + weak.pos.y = resWeak.pos.y; + weak.pos.x = resWeak.pos.x; + } + else if (world.gravity && (bottom.standing || top.vel.y > 0)) + { + resTop = world.collisionMap.trace(top.pos.x, top.pos.y, 0, -(top.pos.y + top.size.y - bottom.pos.y), top.size.x, top.size.y); + + top.pos.y = resTop.pos.y; + + if (top.bounciness > 0 && top.vel.y > top.minBounceVelocity) + { + top.vel.y *= -top.bounciness; + } + else + { + top.standing = true; + top.vel.y = 0; + } + } + else + { + var v2 = (top.vel.y - bottom.vel.y) / 2; + + top.vel.y = -v2; + bottom.vel.y = v2; + + nudgeX = bottom.vel.x * world.delta; + + resTop = world.collisionMap.trace(top.pos.x, top.pos.y, nudgeX, -nudge / 2, top.size.x, top.size.y); + + top.pos.y = resTop.pos.y; + + var resBottom = world.collisionMap.trace(bottom.pos.x, bottom.pos.y, 0, nudge / 2, bottom.size.x, bottom.size.y); + + bottom.pos.y = resBottom.pos.y; + } +}; + +module.exports = SeparateY; + + +/***/ }), +/* 1363 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Physics.Matter + */ + +module.exports = { + + Factory: __webpack_require__(1327), + Image: __webpack_require__(1330), + Matter: __webpack_require__(1245), + MatterPhysics: __webpack_require__(1394), + PolyDecomp: __webpack_require__(1328), + Sprite: __webpack_require__(1331), + TileBody: __webpack_require__(1242), + World: __webpack_require__(1337) + +}; + +/** + * @namespace MatterJS + */ + +/** + * @classdesc + * The `Matter.Body` module contains methods for creating and manipulating body models. + * A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`. + * Factories for commonly used body configurations (such as rectangles, circles and other polygons) can be found in the module `Matter.Bodies`. + * + * @class MatterJS.Body + * @since 3.0.0 + */ + +/** + * @classdesc + * The `Matter.Bodies` module contains factory methods for creating rigid body models + * with commonly used body configurations (such as rectangles, circles and other polygons). + * + * @class MatterJS.Bodies + * @since 3.18.0 + */ + +/** + * @classdesc + * The `Matter.Composite` module contains methods for creating and manipulating composite bodies. + * A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure. + * It is important to use the functions in this module to modify composites, rather than directly modifying their properties. + * Note that the `Matter.World` object is also a type of `Matter.Composite` and as such all composite methods here can also operate on a `Matter.World`. + * + * @class MatterJS.Composite + * @since 3.0.0 + */ + +/** + * @classdesc + * The `Matter.World` module contains methods for creating and manipulating the world composite. + * A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. + * A `Matter.World` has a few additional properties including `gravity` and `bounds`. + * It is important to use the functions in the `Matter.Composite` module to modify the world composite, rather than directly modifying its properties. + * There are also a few methods here that alias those in `Matter.Composite` for easier readability. + * + * @class MatterJS.World + * @extends MatterJS.Composite + * @since 3.0.0 + */ + +/** + * @classdesc + * The `Matter.Constraint` module contains methods for creating and manipulating constraints. + * Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position). + * The stiffness of constraints can be modified to create springs or elastic. + * + * @class MatterJS.Constraint + * @since 3.0.0 + */ + +/** + * @classdesc + * The `Matter.Engine` module contains methods for creating and manipulating engines. + * An engine is a controller that manages updating the simulation of the world. + * + * @class MatterJS.Engine + * @since 3.0.0 + */ + +/** + * @classdesc + * The `Matter.Vertices` module contains methods for creating and manipulating sets of vertices. + * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. + * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). + * + * @class MatterJS.Vertices + * @since 3.0.0 + */ + + +/***/ }), +/* 1364 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Components = __webpack_require__(488); +var GetFastValue = __webpack_require__(2); +var Vector2 = __webpack_require__(4); + +/** + * Internal function to check if the object has a getter or setter. + * + * @function hasGetterOrSetter + * @private + * + * @param {object} def - The object to check. + * + * @return {boolean} True if it has a getter or setter, otherwise false. + */ +function hasGetterOrSetter (def) +{ + return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function'); +} + +/** + * [description] + * + * @function Phaser.Physics.Matter.MatterGameObject + * @since 3.3.0 + * + * @param {Phaser.Physics.Matter.World} world - The Matter world to add the body to. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that will have the Matter body applied to it. + * @param {(object|MatterJS.Body)} options - A Matter Body configuration object, or an instance of a Matter Body. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that was created with the Matter body. + */ +var MatterGameObject = function (world, gameObject, options) +{ + if (options === undefined) { options = {}; } + + var x = gameObject.x; + var y = gameObject.y; + + // Temp body pos to avoid body null checks + gameObject.body = { + temp: true, + position: { + x: x, + y: y + } + }; + + var mixins = [ + Components.Bounce, + Components.Collision, + Components.Force, + Components.Friction, + Components.Gravity, + Components.Mass, + Components.Sensor, + Components.SetBody, + Components.Sleep, + Components.Static, + Components.Transform, + Components.Velocity + ]; + + // First let's inject all of the components into the Game Object + mixins.forEach(function (mixin) + { + for (var key in mixin) + { + if (hasGetterOrSetter(mixin[key])) + { + Object.defineProperty(gameObject, key, { + get: mixin[key].get, + set: mixin[key].set + }); + } + else + { + Object.defineProperty(gameObject, key, {value: mixin[key]}); + } + } + + }); + + gameObject.world = world; + + gameObject._tempVec2 = new Vector2(x, y); + + if (options.hasOwnProperty('type') && options.type === 'body') + { + gameObject.setExistingBody(options, true); + } + else + { + var shape = GetFastValue(options, 'shape', null); + + if (!shape) + { + shape = 'rectangle'; + } + + gameObject.setBody(shape, options); + } + + return gameObject; +}; + +module.exports = MatterGameObject; + + +/***/ }), +/* 1365 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A component to set restitution on objects. + * + * @namespace Phaser.Physics.Matter.Components.Bounce + * @since 3.0.0 + */ +var Bounce = { + + /** + * Sets the restitution on the physics object. + * + * @method Phaser.Physics.Matter.Components.Bounce#setBounce + * @since 3.0.0 + * + * @param {number} value - A Number that defines the restitution (elasticity) of the body. The value is always positive and is in the range (0, 1). A value of 0 means collisions may be perfectly inelastic and no bouncing may occur. A value of 0.8 means the body may bounce back with approximately 80% of its kinetic energy. Note that collision response is based on pairs of bodies, and that restitution values are combined with the following formula: `Math.max(bodyA.restitution, bodyB.restitution)` + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setBounce: function (value) + { + this.body.restitution = value; + + return this; + } + +}; + +module.exports = Bounce; + + +/***/ }), +/* 1366 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Contains methods for changing the collision filter of a Matter Body. Should be used as a mixin and not called directly. + * + * @namespace Phaser.Physics.Matter.Components.Collision + * @since 3.0.0 + */ +var Collision = { + + /** + * Sets the collision category of this Game Object's Matter Body. This number must be a power of two between 2^0 (= 1) and 2^31. Two bodies with different collision groups (see {@link #setCollisionGroup}) will only collide if their collision categories are included in their collision masks (see {@link #setCollidesWith}). + * + * @method Phaser.Physics.Matter.Components.Collision#setCollisionCategory + * @since 3.0.0 + * + * @param {number} value - Unique category bitfield. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setCollisionCategory: function (value) + { + this.body.collisionFilter.category = value; + + return this; + }, + + /** + * Sets the collision group of this Game Object's Matter Body. If this is zero or two Matter Bodies have different values, they will collide according to the usual rules (see {@link #setCollisionCategory} and {@link #setCollisionGroup}). If two Matter Bodies have the same positive value, they will always collide; if they have the same negative value, they will never collide. + * + * @method Phaser.Physics.Matter.Components.Collision#setCollisionGroup + * @since 3.0.0 + * + * @param {number} value - Unique group index. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setCollisionGroup: function (value) + { + this.body.collisionFilter.group = value; + + return this; + }, + + /** + * Sets the collision mask for this Game Object's Matter Body. Two Matter Bodies with different collision groups will only collide if each one includes the other's category in its mask based on a bitwise AND, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` are both true. + * + * @method Phaser.Physics.Matter.Components.Collision#setCollidesWith + * @since 3.0.0 + * + * @param {(number|number[])} categories - A unique category bitfield, or an array of them. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setCollidesWith: function (categories) + { + var flags = 0; + + if (!Array.isArray(categories)) + { + flags = categories; + } + else + { + for (var i = 0; i < categories.length; i++) + { + flags |= categories[i]; + } + } + + this.body.collisionFilter.mask = flags; + + return this; + } + +}; + +module.exports = Collision; + + +/***/ }), +/* 1367 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Body = __webpack_require__(60); + +/** + * A component to apply force to Matter.js bodies. + * + * @namespace Phaser.Physics.Matter.Components.Force + * @since 3.0.0 + */ +var Force = { + + // force = vec2 / point + + /** + * Applies a force to a body. + * + * @method Phaser.Physics.Matter.Components.Force#applyForce + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} force - A Vector that specifies the force to apply. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + applyForce: function (force) + { + this._tempVec2.set(this.body.position.x, this.body.position.y); + + Body.applyForce(this.body, this._tempVec2, force); + + return this; + }, + + /** + * Applies a force to a body from a given position. + * + * @method Phaser.Physics.Matter.Components.Force#applyForceFrom + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} position - The position in which the force comes from. + * @param {Phaser.Math.Vector2} force - A Vector that specifies the force to apply. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + applyForceFrom: function (position, force) + { + Body.applyForce(this.body, position, force); + + return this; + }, + + /** + * Apply thrust to the forward position of the body. + * + * @method Phaser.Physics.Matter.Components.Force#thrust + * @since 3.0.0 + * + * @param {number} speed - A speed value to be applied to a directional force. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + thrust: function (speed) + { + var angle = this.body.angle; + + this._tempVec2.set(speed * Math.cos(angle), speed * Math.sin(angle)); + + Body.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2); + + return this; + }, + + /** + * Apply thrust to the left position of the body. + * + * @method Phaser.Physics.Matter.Components.Force#thrustLeft + * @since 3.0.0 + * + * @param {number} speed - A speed value to be applied to a directional force. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + thrustLeft: function (speed) + { + var angle = this.body.angle - Math.PI / 2; + + this._tempVec2.set(speed * Math.cos(angle), speed * Math.sin(angle)); + + Body.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2); + + return this; + }, + + /** + * Apply thrust to the right position of the body. + * + * @method Phaser.Physics.Matter.Components.Force#thrustRight + * @since 3.0.0 + * + * @param {number} speed - A speed value to be applied to a directional force. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + thrustRight: function (speed) + { + var angle = this.body.angle + Math.PI / 2; + + this._tempVec2.set(speed * Math.cos(angle), speed * Math.sin(angle)); + + Body.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2); + + return this; + }, + + /** + * Apply thrust to the back position of the body. + * + * @method Phaser.Physics.Matter.Components.Force#thrustBack + * @since 3.0.0 + * + * @param {number} speed - A speed value to be applied to a directional force. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + thrustBack: function (speed) + { + var angle = this.body.angle - Math.PI; + + this._tempVec2.set(speed * Math.cos(angle), speed * Math.sin(angle)); + + Body.applyForce(this.body, { x: this.body.position.x, y: this.body.position.y }, this._tempVec2); + + return this; + } + +}; + +module.exports = Force; + + +/***/ }), +/* 1368 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Contains methods for changing the friction of a Game Object's Matter Body. Should be used a mixin, not called directly. + * + * @namespace Phaser.Physics.Matter.Components.Friction + * @since 3.0.0 + */ +var Friction = { + + /** + * Sets new friction values for this Game Object's Matter Body. + * + * @method Phaser.Physics.Matter.Components.Friction#setFriction + * @since 3.0.0 + * + * @param {number} value - The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied. + * @param {number} [air] - If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance. + * @param {number} [fstatic] - If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setFriction: function (value, air, fstatic) + { + this.body.friction = value; + + if (air !== undefined) + { + this.body.frictionAir = air; + } + + if (fstatic !== undefined) + { + this.body.frictionStatic = fstatic; + } + + return this; + }, + + /** + * Sets a new air resistance for this Game Object's Matter Body. A value of 0 means the Body will never slow as it moves through space. The higher the value, the faster a Body slows when moving through space. + * + * @method Phaser.Physics.Matter.Components.Friction#setFrictionAir + * @since 3.0.0 + * + * @param {number} value - The new air resistance for the Body. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setFrictionAir: function (value) + { + this.body.frictionAir = value; + + return this; + }, + + /** + * Sets a new static friction for this Game Object's Matter Body. A value of 0 means the Body will never "stick" when it is nearly stationary. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. + * + * @method Phaser.Physics.Matter.Components.Friction#setFrictionStatic + * @since 3.0.0 + * + * @param {number} value - The new static friction for the Body. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setFrictionStatic: function (value) + { + this.body.frictionStatic = value; + + return this; + } + +}; + +module.exports = Friction; + + +/***/ }), +/* 1369 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A component to manipulate world gravity for Matter.js bodies. + * + * @namespace Phaser.Physics.Matter.Components.Gravity + * @since 3.0.0 + */ +var Gravity = { + + /** + * A togglable function for ignoring world gravity in real-time on the current body. + * + * @method Phaser.Physics.Matter.Components.Gravity#setIgnoreGravity + * @since 3.0.0 + * + * @param {boolean} value - Set to true to ignore the effect of world gravity, or false to not ignore it. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setIgnoreGravity: function (value) + { + this.body.ignoreGravity = value; + + return this; + } + +}; + +module.exports = Gravity; + + +/***/ }), +/* 1370 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Body = __webpack_require__(60); +var Vector2 = __webpack_require__(4); + +/** + * Allows accessing the mass, density, and center of mass of a Matter-enabled Game Object. Should be used as a mixin and not directly. + * + * @namespace Phaser.Physics.Matter.Components.Mass + * @since 3.0.0 + */ +var Mass = { + + /** + * Sets the mass of the Game Object's Matter Body. + * + * @method Phaser.Physics.Matter.Components.Mass#setMass + * @since 3.0.0 + * + * @param {number} value - The new mass of the body. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setMass: function (value) + { + Body.setMass(this.body, value); + + return this; + }, + + /** + * Sets density of the body. + * + * @method Phaser.Physics.Matter.Components.Mass#setDensity + * @since 3.0.0 + * + * @param {number} value - The new density of the body. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setDensity: function (value) + { + Body.setDensity(this.body, value); + + return this; + }, + + /** + * The body's center of mass. + * + * @name Phaser.Physics.Matter.Components.Mass#centerOfMass + * @type {Phaser.Math.Vector2} + * @readonly + * @since 3.10.0 + * + * @return {Phaser.Math.Vector2} The center of mass. + */ + centerOfMass: { + + get: function () + { + return new Vector2(this.body.render.sprite.xOffset * this.width, this.body.render.sprite.yOffset * this.height); + } + } + +}; + +module.exports = Mass; + + +/***/ }), +/* 1371 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Body = __webpack_require__(60); + +/** + * [description] + * + * @namespace Phaser.Physics.Matter.Components.Static + * @since 3.0.0 + */ +var Static = { + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Static#setStatic + * @since 3.0.0 + * + * @param {boolean} value - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setStatic: function (value) + { + Body.setStatic(this.body, value); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Static#isStatic + * @since 3.0.0 + * + * @return {boolean} [description] + */ + isStatic: function () + { + return this.body.isStatic; + } + +}; + +module.exports = Static; + + +/***/ }), +/* 1372 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * [description] + * + * @namespace Phaser.Physics.Matter.Components.Sensor + * @since 3.0.0 + */ +var Sensor = { + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Sensor#setSensor + * @since 3.0.0 + * + * @param {boolean} value - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setSensor: function (value) + { + this.body.isSensor = value; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Sensor#isSensor + * @since 3.0.0 + * + * @return {boolean} [description] + */ + isSensor: function () + { + return this.body.isSensor; + } + +}; + +module.exports = Sensor; + + +/***/ }), +/* 1373 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bodies = __webpack_require__(135); +var Body = __webpack_require__(60); +var GetFastValue = __webpack_require__(2); +var PhysicsEditorParser = __webpack_require__(1374); +var Vertices = __webpack_require__(84); + +/** + * [description] + * + * @namespace Phaser.Physics.Matter.Components.SetBody + * @since 3.0.0 + */ +var SetBody = { + + // Calling any of these methods resets previous properties you may have set on the body, including plugins, mass, etc + + /** + * Set the body on a Game Object to a rectangle. + * + * @method Phaser.Physics.Matter.Components.SetBody#setRectangle + * @since 3.0.0 + * + * @param {number} width - Width of the rectangle. + * @param {number} height - Height of the rectangle. + * @param {object} options - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setRectangle: function (width, height, options) + { + return this.setBody({ type: 'rectangle', width: width, height: height }, options); + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.SetBody#setCircle + * @since 3.0.0 + * + * @param {number} radius - [description] + * @param {object} options - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setCircle: function (radius, options) + { + return this.setBody({ type: 'circle', radius: radius }, options); + }, + + /** + * Set the body on the Game Object to a polygon shape. + * + * @method Phaser.Physics.Matter.Components.SetBody#setPolygon + * @since 3.0.0 + * + * @param {number} radius - The radius of the polygon. + * @param {number} sides - The amount of sides creating the polygon. + * @param {object} options - A matterjs config object. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setPolygon: function (radius, sides, options) + { + return this.setBody({ type: 'polygon', sides: sides, radius: radius }, options); + }, + + /** + * Creates a new matterjs trapezoid body. + * + * @method Phaser.Physics.Matter.Components.SetBody#setTrapezoid + * @since 3.0.0 + * + * @param {number} width - The width of the trapezoid. + * @param {number} height - The height of the trapezoid. + * @param {number} slope - The angle of slope for the trapezoid. + * @param {object} options - A matterjs config object for the body. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setTrapezoid: function (width, height, slope, options) + { + return this.setBody({ type: 'trapezoid', width: width, height: height, slope: slope }, options); + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.SetBody#setExistingBody + * @since 3.0.0 + * + * @param {MatterJS.Body} body - [description] + * @param {boolean} [addToWorld=true] - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setExistingBody: function (body, addToWorld) + { + if (addToWorld === undefined) + { + addToWorld = true; + } + + if (this.body) + { + this.world.remove(this.body); + } + + this.body = body; + + for (var i = 0; i < body.parts.length; i++) + { + body.parts[i].gameObject = this; + } + + var _this = this; + + body.destroy = function destroy () + { + _this.world.remove(_this.body); + _this.body.gameObject = null; + }; + + if (addToWorld) + { + this.world.add(body); + } + + if (this._originComponent) + { + this.setOrigin(body.render.sprite.xOffset, body.render.sprite.yOffset); + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.SetBody#setBody + * @since 3.0.0 + * + * @param {object} config - [description] + * @param {object} options - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setBody: function (config, options) + { + if (!config) + { + return this; + } + + var body; + + // Allow them to do: shape: 'circle' instead of shape: { type: 'circle' } + if (typeof config === 'string') + { + // Using defaults + config = { type: config }; + } + + var shapeType = GetFastValue(config, 'type', 'rectangle'); + var bodyX = GetFastValue(config, 'x', this._tempVec2.x); + var bodyY = GetFastValue(config, 'y', this._tempVec2.y); + var bodyWidth = GetFastValue(config, 'width', this.width); + var bodyHeight = GetFastValue(config, 'height', this.height); + + switch (shapeType) + { + case 'rectangle': + body = Bodies.rectangle(bodyX, bodyY, bodyWidth, bodyHeight, options); + break; + + case 'circle': + var radius = GetFastValue(config, 'radius', Math.max(bodyWidth, bodyHeight) / 2); + var maxSides = GetFastValue(config, 'maxSides', 25); + body = Bodies.circle(bodyX, bodyY, radius, options, maxSides); + break; + + case 'trapezoid': + var slope = GetFastValue(config, 'slope', 0.5); + body = Bodies.trapezoid(bodyX, bodyY, bodyWidth, bodyHeight, slope, options); + break; + + case 'polygon': + var sides = GetFastValue(config, 'sides', 5); + var pRadius = GetFastValue(config, 'radius', Math.max(bodyWidth, bodyHeight) / 2); + body = Bodies.polygon(bodyX, bodyY, sides, pRadius, options); + break; + + case 'fromVertices': + case 'fromVerts': + + var verts = GetFastValue(config, 'verts', null); + + if (verts) + { + // Has the verts array come from Vertices.fromPath, or is it raw? + if (typeof verts === 'string') + { + verts = Vertices.fromPath(verts); + } + + if (this.body && !this.body.hasOwnProperty('temp')) + { + Body.setVertices(this.body, verts); + + body = this.body; + } + else + { + var flagInternal = GetFastValue(config, 'flagInternal', false); + var removeCollinear = GetFastValue(config, 'removeCollinear', 0.01); + var minimumArea = GetFastValue(config, 'minimumArea', 10); + + body = Bodies.fromVertices(bodyX, bodyY, verts, options, flagInternal, removeCollinear, minimumArea); + } + } + + break; + + case 'fromPhysicsEditor': + body = PhysicsEditorParser.parseBody(bodyX, bodyY, bodyWidth, bodyHeight, config); + break; + } + + if (body) + { + this.setExistingBody(body, config.addToWorld); + } + + return this; + } + +}; + +module.exports = SetBody; + + +/***/ }), +/* 1374 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Joachim Grill + * @copyright 2018 CodeAndWeb GmbH + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bodies = __webpack_require__(135); +var Body = __webpack_require__(60); +var Bounds = __webpack_require__(100); +var Common = __webpack_require__(37); +var GetFastValue = __webpack_require__(2); +var Vector = __webpack_require__(99); +var Vertices = __webpack_require__(84); + +/** + * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file + * created and exported with PhysicsEditor (https://www.codeandweb.com/physicseditor). + * + * @namespace Phaser.Physics.Matter.PhysicsEditorParser + * @since 3.10.0 + */ +var PhysicsEditorParser = { + + /** + * Parses a body element exported by PhysicsEditor. + * + * @function Phaser.Physics.Matter.PhysicsEditorParser.parseBody + * @since 3.10.0 + * + * @param {number} x - x position. + * @param {number} y - y position. + * @param {number} w - width. + * @param {number} h - height. + * @param {object} config - body configuration and fixture (child body) definitions. + * + * @return {object} A matter body, consisting of several parts (child bodies) + */ + parseBody: function (x, y, w, h, config) + { + var fixtureConfigs = GetFastValue(config, 'fixtures', []); + var fixtures = []; + + for (var fc = 0; fc < fixtureConfigs.length; fc++) + { + var fixtureParts = this.parseFixture(fixtureConfigs[fc]); + + for (var i = 0; i < fixtureParts.length; i++) + { + fixtures.push(fixtureParts[i]); + } + } + + var matterConfig = Common.extend({}, false, config); + + delete matterConfig.fixtures; + delete matterConfig.type; + + var body = Body.create(matterConfig); + + Body.setParts(body, fixtures); + body.render.sprite.xOffset = body.position.x / w; + body.render.sprite.yOffset = body.position.y / h; + Body.setPosition(body, { x: x, y: y }); + + return body; + }, + + + /** + * Parses an element of the "fixtures" list exported by PhysicsEditor + * + * @function Phaser.Physics.Matter.PhysicsEditorParser.parseFixture + * @since 3.10.0 + * + * @param {object} fixtureConfig - the fixture object to parse + * + * @return {object[]} - A list of matter bodies + */ + parseFixture: function (fixtureConfig) + { + var matterConfig = Common.extend({}, false, fixtureConfig); + + delete matterConfig.circle; + delete matterConfig.vertices; + + var fixtures; + + if (fixtureConfig.circle) + { + var x = GetFastValue(fixtureConfig.circle, 'x'); + var y = GetFastValue(fixtureConfig.circle, 'y'); + var r = GetFastValue(fixtureConfig.circle, 'radius'); + fixtures = [ Bodies.circle(x, y, r, matterConfig) ]; + } + else if (fixtureConfig.vertices) + { + fixtures = this.parseVertices(fixtureConfig.vertices, matterConfig); + } + + return fixtures; + }, + + /** + * Parses the "vertices" lists exported by PhysicsEditor. + * + * @function Phaser.Physics.Matter.PhysicsEditorParser.parseVertices + * @since 3.10.0 + * + * @param {object} vertexSets - The vertex lists to parse. + * @param {object} options - Matter body options. + * + * @return {object[]} - A list of matter bodies. + */ + parseVertices: function (vertexSets, options) + { + var i, j, k, v, z; + var parts = []; + + options = options || {}; + + for (v = 0; v < vertexSets.length; v += 1) + { + parts.push(Body.create(Common.extend({ + position: Vertices.centre(vertexSets[v]), + vertices: vertexSets[v] + }, options))); + } + + // flag coincident part edges + var coincidentMaxDist = 5; + + for (i = 0; i < parts.length; i++) + { + var partA = parts[i]; + + for (j = i + 1; j < parts.length; j++) + { + var partB = parts[j]; + + if (Bounds.overlaps(partA.bounds, partB.bounds)) + { + var pav = partA.vertices, + pbv = partB.vertices; + + // iterate vertices of both parts + for (k = 0; k < partA.vertices.length; k++) + { + for (z = 0; z < partB.vertices.length; z++) + { + // find distances between the vertices + var da = Vector.magnitudeSquared(Vector.sub(pav[(k + 1) % pav.length], pbv[z])), + db = Vector.magnitudeSquared(Vector.sub(pav[k], pbv[(z + 1) % pbv.length])); + + // if both vertices are very close, consider the edge concident (internal) + if (da < coincidentMaxDist && db < coincidentMaxDist) + { + pav[k].isInternal = true; + pbv[z].isInternal = true; + } + } + } + + } + } + } + + return parts; + } +}; + +module.exports = PhysicsEditorParser; + + +/***/ }), +/* 1375 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Events = __webpack_require__(1241); +var MatterEvents = __webpack_require__(227); + +/** + * [description] + * + * @namespace Phaser.Physics.Matter.Components.Sleep + * @since 3.0.0 + */ +var Sleep = { + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Sleep#setSleepThreshold + * @since 3.0.0 + * + * @param {number} [value=60] - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setSleepThreshold: function (value) + { + if (value === undefined) { value = 60; } + + this.body.sleepThreshold = value; + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Sleep#setSleepEvents + * @since 3.0.0 + * + * @param {boolean} start - [description] + * @param {boolean} end - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setSleepEvents: function (start, end) + { + this.setSleepStartEvent(start); + this.setSleepEndEvent(end); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Sleep#setSleepStartEvent + * @since 3.0.0 + * + * @param {boolean} value - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setSleepStartEvent: function (value) + { + if (value) + { + var world = this.world; + + MatterEvents.on(this.body, 'sleepStart', function (event) + { + world.emit(Events.SLEEP_START, event, this); + }); + } + else + { + MatterEvents.off(this.body, 'sleepStart'); + } + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Sleep#setSleepEndEvent + * @since 3.0.0 + * + * @param {boolean} value - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setSleepEndEvent: function (value) + { + if (value) + { + var world = this.world; + + MatterEvents.on(this.body, 'sleepEnd', function (event) + { + world.emit(Events.SLEEP_END, event, this); + }); + } + else + { + MatterEvents.off(this.body, 'sleepEnd'); + } + + return this; + } + +}; + +module.exports = Sleep; + + +/***/ }), +/* 1376 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @typedef {object} Phaser.Physics.Matter.Events.AfterUpdateEvent + * + * @property {number} timestamp - The Matter Engine `timing.timestamp` value for the event. + * @property {any} source - The source object of the event. + * @property {string} name - The name of the event. + */ + +/** + * The Matter Physics After Update Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved. + * + * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`. + * + * @event Phaser.Physics.Matter.Events#AFTER_UPDATE + * @since 3.0.0 + * + * @param {Phaser.Physics.Matter.Events.AfterUpdateEvent} event - The Update Event object. + */ +module.exports = 'afterupdate'; + + +/***/ }), +/* 1377 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @typedef {object} Phaser.Physics.Matter.Events.BeforeUpdateEvent + * + * @property {number} timestamp - The Matter Engine `timing.timestamp` value for the event. + * @property {any} source - The source object of the event. + * @property {string} name - The name of the event. + */ + +/** + * The Matter Physics Before Update Event. + * + * This event is dispatched by a Matter Physics World instance right before all the collision processing takes place. + * + * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`. + * + * @event Phaser.Physics.Matter.Events#BEFORE_UPDATE + * @since 3.0.0 + * + * @param {Phaser.Physics.Matter.Events.BeforeUpdateEvent} event - The Update Event object. + */ +module.exports = 'beforeupdate'; + + +/***/ }), +/* 1378 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @typedef {object} Phaser.Physics.Matter.Events.CollisionActiveEvent + * + * @property {array} pairs - A list of all affected pairs in the collision. + * @property {number} timestamp - The Matter Engine `timing.timestamp` value for the event. + * @property {any} source - The source object of the event. + * @property {string} name - The name of the event. + */ + +/** + * The Matter Physics Collision Active Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that are colliding in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`. + * + * @event Phaser.Physics.Matter.Events#COLLISION_ACTIVE + * @since 3.0.0 + * + * @param {Phaser.Physics.Matter.Events.CollisionActiveEvent} event - The Collision Event object. + * @param {MatterJS.Body} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. + * @param {MatterJS.Body} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. + */ +module.exports = 'collisionactive'; + + +/***/ }), +/* 1379 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @typedef {object} Phaser.Physics.Matter.Events.CollisionEndEvent + * + * @property {array} pairs - A list of all affected pairs in the collision. + * @property {number} timestamp - The Matter Engine `timing.timestamp` value for the event. + * @property {any} source - The source object of the event. + * @property {string} name - The name of the event. + */ + +/** + * The Matter Physics Collision End Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that have finished colliding in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`. + * + * @event Phaser.Physics.Matter.Events#COLLISION_END + * @since 3.0.0 + * + * @param {Phaser.Physics.Matter.Events.CollisionEndEvent} event - The Collision Event object. + * @param {MatterJS.Body} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. + * @param {MatterJS.Body} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. + */ +module.exports = 'collisionend'; + + +/***/ }), +/* 1380 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @typedef {object} Phaser.Physics.Matter.Events.CollisionStartEvent + * + * @property {array} pairs - A list of all affected pairs in the collision. + * @property {number} timestamp - The Matter Engine `timing.timestamp` value for the event. + * @property {any} source - The source object of the event. + * @property {string} name - The name of the event. + */ + +/** + * The Matter Physics Collision Start Event. + * + * This event is dispatched by a Matter Physics World instance after the engine has updated. + * It provides a list of all pairs that have started to collide in the current tick (if any). + * + * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`. + * + * @event Phaser.Physics.Matter.Events#COLLISION_START + * @since 3.0.0 + * + * @param {Phaser.Physics.Matter.Events.CollisionStartEvent} event - The Collision Event object. + * @param {MatterJS.Body} bodyA - The first body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. + * @param {MatterJS.Body} bodyB - The second body of the first colliding pair. The `event.pairs` array may contain more colliding bodies. + */ +module.exports = 'collisionstart'; + + +/***/ }), +/* 1381 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Matter Physics Drag End Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * stops dragging a body. + * + * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`. + * + * @event Phaser.Physics.Matter.Events#DRAG_END + * @since 3.16.2 + * + * @param {MatterJS.Body} body - The Body that has stopped being dragged. This is a Matter Body, not a Phaser Game Object. + * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that was dragging the body. + */ +module.exports = 'dragend'; + + +/***/ }), +/* 1382 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Matter Physics Drag Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * is actively dragging a body. It is emitted each time the pointer moves. + * + * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`. + * + * @event Phaser.Physics.Matter.Events#DRAG + * @since 3.16.2 + * + * @param {MatterJS.Body} body - The Body that is being dragged. This is a Matter Body, not a Phaser Game Object. + * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body. + */ +module.exports = 'drag'; + + +/***/ }), +/* 1383 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Matter Physics Drag Start Event. + * + * This event is dispatched by a Matter Physics World instance when a Pointer Constraint + * starts dragging a body. + * + * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. + * + * @event Phaser.Physics.Matter.Events#DRAG_START + * @since 3.16.2 + * + * @param {MatterJS.Body} body - The Body that has started being dragged. This is a Matter Body, not a Phaser Game Object. + * @param {MatterJS.Body} part - The part of the body that was clicked on. + * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body. + */ +module.exports = 'dragstart'; + + +/***/ }), +/* 1384 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Matter Physics World Pause Event. + * + * This event is dispatched by an Matter Physics World instance when it is paused. + * + * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`. + * + * @event Phaser.Physics.Matter.Events#PAUSE + * @since 3.0.0 + */ +module.exports = 'pause'; + + +/***/ }), +/* 1385 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Matter Physics World Resume Event. + * + * This event is dispatched by an Matter Physics World instance when it resumes from a paused state. + * + * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`. + * + * @event Phaser.Physics.Matter.Events#RESUME + * @since 3.0.0 + */ +module.exports = 'resume'; + + +/***/ }), +/* 1386 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @typedef {object} Phaser.Physics.Matter.Events.SleepEndEvent + * + * @property {any} source - The source object of the event. + * @property {string} name - The name of the event. + */ + +/** + * The Matter Physics Sleep End Event. + * + * This event is dispatched by a Matter Physics World instance when a Body stop sleeping. + * + * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`. + * + * @event Phaser.Physics.Matter.Events#SLEEP_END + * @since 3.0.0 + * + * @param {Phaser.Physics.Matter.Events.SleepEndEvent} event - The Sleep Event object. + * @param {MatterJS.Body} body - The body that has stopped sleeping. + */ +module.exports = 'sleepend'; + + +/***/ }), +/* 1387 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @typedef {object} Phaser.Physics.Matter.Events.SleepStartEvent + * + * @property {any} source - The source object of the event. + * @property {string} name - The name of the event. + */ + +/** + * The Matter Physics Sleep Start Event. + * + * This event is dispatched by a Matter Physics World instance when a Body goes to sleep. + * + * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`. + * + * @event Phaser.Physics.Matter.Events#SLEEP_START + * @since 3.0.0 + * + * @param {Phaser.Physics.Matter.Events.SleepStartEvent} event - The Sleep Event object. + * @param {MatterJS.Body} body - The body that has gone to sleep. + */ +module.exports = 'sleepstart'; + + +/***/ }), +/* 1388 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Body = __webpack_require__(60); +var MATH_CONST = __webpack_require__(23); +var WrapAngle = __webpack_require__(223); +var WrapAngleDegrees = __webpack_require__(224); + +// global bitmask flag for GameObject.renderMask (used by Scale) +var _FLAG = 4; // 0100 + +// Transform Component + +/** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + * + * @namespace Phaser.Physics.Matter.Components.Transform + * @since 3.0.0 + */ +var Transform = { + + /** + * The x position of this Game Object. + * + * @name Phaser.Physics.Matter.Components.Transform#x + * @type {number} + * @since 3.0.0 + */ + x: { + + get: function () + { + return this.body.position.x; + }, + + set: function (value) + { + this._tempVec2.set(value, this.y); + + Body.setPosition(this.body, this._tempVec2); + } + + }, + + /** + * The y position of this Game Object. + * + * @name Phaser.Physics.Matter.Components.Transform#y + * @type {number} + * @since 3.0.0 + */ + y: { + + get: function () + { + return this.body.position.y; + }, + + set: function (value) + { + this._tempVec2.set(this.x, value); + + Body.setPosition(this.body, this._tempVec2); + } + + }, + + /** + * The horizontal scale of this Game Object. + * + * @name Phaser.Physics.Matter.Components.Transform#scaleX + * @type {number} + * @since 3.0.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + var factorX = 1 / this._scaleX; + var factorY = 1 / this._scaleY; + + this._scaleX = value; + + if (this._scaleX === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + // Reset Matter scale back to 1 (sigh) + Body.scale(this.body, factorX, factorY); + + Body.scale(this.body, value, this._scaleY); + } + + }, + + /** + * The vertical scale of this Game Object. + * + * @name Phaser.Physics.Matter.Components.Transform#scaleY + * @type {number} + * @since 3.0.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + var factorX = 1 / this._scaleX; + var factorY = 1 / this._scaleY; + + this._scaleY = value; + + if (this._scaleY === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + + Body.scale(this.body, factorX, factorY); + + Body.scale(this.body, this._scaleX, value); + } + + }, + + /** + * Use `angle` to set or get rotation of the physics body associated to this GameObject. Unlike rotation, when using set the value can be in degrees, which will be converted to radians internally. + * + * @name Phaser.Physics.Matter.Components.Transform#angle + * @type {number} + * @since 3.0.0 + */ + angle: { + + get: function () + { + return WrapAngleDegrees(this.body.angle * MATH_CONST.RAD_TO_DEG); + }, + + set: function (value) + { + // value is in degrees + this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; + } + }, + + /** + * Use `rotation` to set or get the rotation of the physics body associated with this GameObject. The value when set must be in radians. + * + * @name Phaser.Physics.Matter.Components.Transform#rotation + * @type {number} + * @since 3.0.0 + */ + rotation: { + + get: function () + { + return this.body.angle; + }, + + set: function (value) + { + // value is in radians + this._rotation = WrapAngle(value); + + Body.setAngle(this.body, this._rotation); + } + }, + + /** + * Sets the position of the physics body along x and y axes. Both the parameters to this function are optional and if not passed any they default to 0. + * + * @method Phaser.Physics.Matter.Components.Transform#setPosition + * @since 3.0.0 + * + * @param {number} [x=0] - The horizontal position of the body. + * @param {number} [y=x] - The vertical position of the body. + * + * @return {this} This Game Object. + */ + setPosition: function (x, y) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + + this._tempVec2.set(x, y); + + Body.setPosition(this.body, this._tempVec2); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Transform#setRotation + * @since 3.0.0 + * + * @param {number} [radians=0] - [description] + * + * @return {this} This Game Object. + */ + setRotation: function (radians) + { + if (radians === undefined) { radians = 0; } + + this._rotation = WrapAngle(radians); + + Body.setAngle(this.body, radians); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Transform#setFixedRotation + * @since 3.0.0 + * + * @return {this} This Game Object. + */ + setFixedRotation: function () + { + Body.setInertia(this.body, Infinity); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Transform#setAngle + * @since 3.0.0 + * + * @param {number} [degrees=0] - [description] + * + * @return {this} This Game Object. + */ + setAngle: function (degrees) + { + if (degrees === undefined) { degrees = 0; } + + this.angle = degrees; + + Body.setAngle(this.body, this.rotation); + + return this; + }, + + /** + * Sets the scale of this Game Object. + * + * @method Phaser.Physics.Matter.Components.Transform#setScale + * @since 3.0.0 + * + * @param {number} [x=1] - The horizontal scale of this Game Object. + * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the x value. + * @param {Phaser.Math.Vector2} [point] - The point (Vector2) from which scaling will occur. + * + * @return {this} This Game Object. + */ + setScale: function (x, y, point) + { + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } + + var factorX = 1 / this._scaleX; + var factorY = 1 / this._scaleY; + + this._scaleX = x; + this._scaleY = y; + + Body.scale(this.body, factorX, factorY, point); + + Body.scale(this.body, x, y, point); + + return this; + } + +}; + +module.exports = Transform; + + +/***/ }), +/* 1389 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Body = __webpack_require__(60); + +/** + * [description] + * + * @namespace Phaser.Physics.Matter.Components.Velocity + * @since 3.0.0 + */ +var Velocity = { + + /** + * [description] + * + * @method Phaser.Physics.Matter.Components.Velocity#setAngularVelocity + * @since 3.0.0 + * + * @param {number} value - [description] + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setAngularVelocity: function (value) + { + Body.setAngularVelocity(this.body, value); + + return this; + }, + + /** + * Sets the horizontal velocity of the physics body. + * + * @method Phaser.Physics.Matter.Components.Velocity#setVelocityX + * @since 3.0.0 + * + * @param {number} x - The horizontal velocity value. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setVelocityX: function (x) + { + this._tempVec2.set(x, this.body.velocity.y); + + Body.setVelocity(this.body, this._tempVec2); + + return this; + }, + + /** + * Sets vertical velocity of the physics body. + * + * @method Phaser.Physics.Matter.Components.Velocity#setVelocityY + * @since 3.0.0 + * + * @param {number} y - The vertical velocity value. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setVelocityY: function (y) + { + this._tempVec2.set(this.body.velocity.x, y); + + Body.setVelocity(this.body, this._tempVec2); + + return this; + }, + + /** + * Sets both the horizontal and vertical velocity of the physics body. + * + * @method Phaser.Physics.Matter.Components.Velocity#setVelocity + * @since 3.0.0 + * + * @param {number} x - The horizontal velocity value. + * @param {number} [y=x] - The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the `x` value. + * + * @return {Phaser.GameObjects.GameObject} This Game Object. + */ + setVelocity: function (x, y) + { + this._tempVec2.set(x, y); + + Body.setVelocity(this.body, this._tempVec2); + + return this; + } + +}; + +module.exports = Velocity; + + +/***/ }), +/* 1390 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Bounds = __webpack_require__(100); +var Class = __webpack_require__(0); +var Composite = __webpack_require__(209); +var Constraint = __webpack_require__(228); +var Detector = __webpack_require__(1243); +var Events = __webpack_require__(1241); +var InputEvents = __webpack_require__(53); +var Merge = __webpack_require__(85); +var Sleeping = __webpack_require__(448); +var Vector2 = __webpack_require__(4); +var Vertices = __webpack_require__(84); + +/** + * @classdesc + * A Pointer Constraint is a special type of constraint that allows you to click + * and drag bodies in a Matter World. It monitors the active Pointers in a Scene, + * and when one is pressed down it checks to see if that hit any part of any active + * body in the world. If it did, and the body has input enabled, it will begin to + * drag it until either released, or you stop it via the `stopDrag` method. + * + * You can adjust the stiffness, length and other properties of the constraint via + * the `options` object on creation. + * + * @class PointerConstraint + * @memberof Phaser.Physics.Matter + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene to which this Pointer Constraint belongs. + * @param {Phaser.Physics.Matter.World} world - A reference to the Matter World instance to which this Constraint belongs. + * @param {object} [options] - A Constraint configuration object. + */ +var PointerConstraint = new Class({ + + initialize: + + function PointerConstraint (scene, world, options) + { + if (options === undefined) { options = {}; } + + // Defaults + var defaults = { + label: 'Pointer Constraint', + pointA: { x: 0, y: 0 }, + pointB: { x: 0, y: 0 }, + damping: 0, + length: 0.01, + stiffness: 0.1, + angularStiffness: 1, + collisionFilter: { + category: 0x0001, + mask: 0xFFFFFFFF, + group: 0 + } + }; + + /** + * A reference to the Scene to which this Pointer Constraint belongs. + * This is the same Scene as the Matter World instance. + * + * @name Phaser.Physics.Matter.PointerConstraint#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * A reference to the Matter World instance to which this Constraint belongs. + * + * @name Phaser.Physics.Matter.PointerConstraint#world + * @type {Phaser.Physics.Matter.World} + * @since 3.0.0 + */ + this.world = world; + + /** + * The Camera the Pointer was interacting with when the input + * down event was processed. + * + * @name Phaser.Physics.Matter.PointerConstraint#camera + * @type {Phaser.Cameras.Scene2D.Camera} + * @since 3.0.0 + */ + this.camera = null; + + /** + * A reference to the Input Pointer that activated this Constraint. + * This is set in the `onDown` handler. + * + * @name Phaser.Physics.Matter.PointerConstraint#pointer + * @type {Phaser.Input.Pointer} + * @default null + * @since 3.0.0 + */ + this.pointer = null; + + /** + * Is this Constraint active or not? + * + * An active constraint will be processed each update. An inactive one will be skipped. + * Use this to toggle a Pointer Constraint on and off. + * + * @name Phaser.Physics.Matter.PointerConstraint#active + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.active = true; + + /** + * The internal transformed position. + * + * @name Phaser.Physics.Matter.PointerConstraint#position + * @type {Phaser.Math.Vector2} + * @since 3.0.0 + */ + this.position = new Vector2(); + + /** + * The body that is currently being dragged, if any. + * + * @name Phaser.Physics.Matter.PointerConstraint#body + * @type {?MatterJS.Body} + * @since 3.16.2 + */ + this.body = null; + + /** + * The part of the body that was clicked on to start the drag. + * + * @name Phaser.Physics.Matter.PointerConstraint#part + * @type {?MatterJS.Body} + * @since 3.16.2 + */ + this.part = null; + + /** + * The native Matter Constraint that is used to attach to bodies. + * + * @name Phaser.Physics.Matter.PointerConstraint#constraint + * @type {object} + * @since 3.0.0 + */ + this.constraint = Constraint.create(Merge(options, defaults)); + + this.world.on(Events.BEFORE_UPDATE, this.update, this); + + scene.sys.input.on(InputEvents.POINTER_DOWN, this.onDown, this); + }, + + /** + * A Pointer has been pressed down onto the Scene. + * + * If this Constraint doesn't have an active Pointer then a hit test is + * run against all active bodies in the world. If one is found it is bound + * to this constraint and the drag begins. + * + * @method Phaser.Physics.Matter.PointerConstraint#onDown + * @fires Phaser.Physics.Matter.Events#DRAG_START + * @since 3.0.0 + * + * @param {Phaser.Input.Pointer} pointer - A reference to the Pointer that was pressed. + */ + onDown: function (pointer) + { + if (!this.pointer) + { + if (this.getBody(pointer)) + { + this.pointer = pointer; + + this.camera = pointer.camera; + } + } + }, + + /** + * Scans all active bodies in the current Matter World to see if any of them + * are hit by the Pointer. The _first one_ found to hit is set as the active contraint + * body. + * + * @method Phaser.Physics.Matter.PointerConstraint#getBody + * @since 3.16.2 + * + * @return {boolean} `true` if a body was found and set, otherwise `false`. + */ + getBody: function (pointer) + { + var pos = this.position; + var constraint = this.constraint; + + pointer.camera.getWorldPoint(pointer.x, pointer.y, pos); + + var bodies = Composite.allBodies(this.world.localWorld); + + for (var i = 0; i < bodies.length; i++) + { + var body = bodies[i]; + + if (!body.ignorePointer && + Bounds.contains(body.bounds, pos) && + Detector.canCollide(body.collisionFilter, constraint.collisionFilter)) + { + if (this.hitTestBody(body, pos)) + { + this.world.emit(Events.DRAG_START, this.body, this.part, this); + + return true; + } + } + } + + return false; + }, + + /** + * Scans the current body to determine if a part of it was clicked on. + * If a part is found the body is set as the `constraint.bodyB` property, + * as well as the `body` property of this class. The part is also set. + * + * @method Phaser.Physics.Matter.PointerConstraint#hitTestBody + * @since 3.16.2 + * + * @param {MatterJS.Body} body - The Matter Body to check. + * @param {Phaser.Math.Vector2} position - A translated hit test position. + * + * @return {boolean} `true` if a part of the body was hit, otherwise `false`. + */ + hitTestBody: function (body, position) + { + var constraint = this.constraint; + + var start = (body.parts.length > 1) ? 1 : 0; + + for (var i = start; i < body.parts.length; i++) + { + var part = body.parts[i]; + + if (Vertices.contains(part.vertices, position)) + { + constraint.bodyB = body; + + constraint.pointA.x = position.x; + constraint.pointA.y = position.y; + + constraint.pointB.x = position.x - body.position.x; + constraint.pointB.y = position.y - body.position.y; + + constraint.angleB = body.angle; + + Sleeping.set(body, false); + + this.part = part; + this.body = body; + + return true; + } + } + + return false; + }, + + /** + * Internal update handler. Called in the Matter BEFORE_UPDATE step. + * + * @method Phaser.Physics.Matter.PointerConstraint#update + * @fires Phaser.Physics.Matter.Events#DRAG + * @since 3.0.0 + */ + update: function () + { + var body = this.body; + var pointer = this.pointer; + + if (!this.active || !pointer || !body) + { + return; + } + + if (pointer.isDown) + { + var pos = this.position; + var constraint = this.constraint; + + this.camera.getWorldPoint(pointer.x, pointer.y, pos); + + Sleeping.set(body, false); + + constraint.pointA.x = pos.x; + constraint.pointA.y = pos.y; + + this.world.emit(Events.DRAG, body, this); + } + else + { + // Pointer has been released since the last world step + this.stopDrag(); + } + }, + + /** + * Stops the Pointer Constraint from dragging the body any further. + * + * This is called automatically if the Pointer is released while actively + * dragging a body. Or, you can call it manually to release a body from a + * constraint without having to first release the pointer. + * + * @method Phaser.Physics.Matter.PointerConstraint#stopDrag + * @fires Phaser.Physics.Matter.Events#DRAG_END + * @since 3.16.2 + */ + stopDrag: function () + { + var body = this.body; + var constraint = this.constraint; + + if (body) + { + this.world.emit(Events.DRAG_END, body, this); + + this.pointer = null; + this.body = null; + this.part = null; + + constraint.bodyB = null; + } + }, + + /** + * Destroys this Pointer Constraint instance and all of its references. + * + * @method Phaser.Physics.Matter.PointerConstraint#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.world.removeConstraint(this.constraint); + + this.pointer = null; + this.constraint = null; + this.body = null; + this.part = null; + + this.world.off(Events.BEFORE_UPDATE, this.update); + + this.scene.sys.input.off(InputEvents.POINTER_DOWN, this.onDown, this); + } + +}); + +module.exports = PointerConstraint; + + +/***/ }), +/* 1391 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Query` module contains methods for performing collision queries. +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Query +*/ + +var Query = {}; + +module.exports = Query; + +var Vector = __webpack_require__(99); +var SAT = __webpack_require__(1244); +var Bounds = __webpack_require__(100); +var Bodies = __webpack_require__(135); +var Vertices = __webpack_require__(84); + +(function() { + + /** + * Returns a list of collisions between `body` and `bodies`. + * @method collides + * @param {body} body + * @param {body[]} bodies + * @return {object[]} Collisions + */ + Query.collides = function(body, bodies) { + var collisions = []; + + for (var i = 0; i < bodies.length; i++) { + var bodyA = bodies[i]; + + if (Bounds.overlaps(bodyA.bounds, body.bounds)) { + for (var j = bodyA.parts.length === 1 ? 0 : 1; j < bodyA.parts.length; j++) { + var part = bodyA.parts[j]; + + if (Bounds.overlaps(part.bounds, body.bounds)) { + var collision = SAT.collides(part, body); + + if (collision.collided) { + collisions.push(collision); + break; + } + } + } + } + } + + return collisions; + }; + + /** + * Casts a ray segment against a set of bodies and returns all collisions, ray width is optional. Intersection points are not provided. + * @method ray + * @param {body[]} bodies + * @param {vector} startPoint + * @param {vector} endPoint + * @param {number} [rayWidth] + * @return {object[]} Collisions + */ + Query.ray = function(bodies, startPoint, endPoint, rayWidth) { + rayWidth = rayWidth || 1e-100; + + var rayAngle = Vector.angle(startPoint, endPoint), + rayLength = Vector.magnitude(Vector.sub(startPoint, endPoint)), + rayX = (endPoint.x + startPoint.x) * 0.5, + rayY = (endPoint.y + startPoint.y) * 0.5, + ray = Bodies.rectangle(rayX, rayY, rayLength, rayWidth, { angle: rayAngle }), + collisions = Query.collides(ray, bodies); + + for (var i = 0; i < collisions.length; i += 1) { + var collision = collisions[i]; + collision.body = collision.bodyB = collision.bodyA; + } + + return collisions; + }; + + /** + * Returns all bodies whose bounds are inside (or outside if set) the given set of bounds, from the given set of bodies. + * @method region + * @param {body[]} bodies + * @param {bounds} bounds + * @param {bool} [outside=false] + * @return {body[]} The bodies matching the query + */ + Query.region = function(bodies, bounds, outside) { + var result = []; + + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i], + overlaps = Bounds.overlaps(body.bounds, bounds); + if ((overlaps && !outside) || (!overlaps && outside)) + result.push(body); + } + + return result; + }; + + /** + * Returns all bodies whose vertices contain the given point, from the given set of bodies. + * @method point + * @param {body[]} bodies + * @param {vector} point + * @return {body[]} The bodies matching the query + */ + Query.point = function(bodies, point) { + var result = []; + + for (var i = 0; i < bodies.length; i++) { + var body = bodies[i]; + + if (Bounds.contains(body.bounds, point)) { + for (var j = body.parts.length === 1 ? 0 : 1; j < body.parts.length; j++) { + var part = body.parts[j]; + + if (Bounds.contains(part.bounds, point) + && Vertices.contains(part.vertices, point)) { + result.push(body); + break; + } + } + } + } + + return result; + }; + +})(); + + +/***/ }), +/* 1392 */ +/***/ (function(module, exports, __webpack_require__) { + +// @if DEBUG +/** +* _Internal Class_, not generally used outside of the engine's internals. +* +*/ + +var Metrics = {}; + +module.exports = Metrics; + +var Composite = __webpack_require__(209); +var Common = __webpack_require__(37); + +(function() { + + /** + * Creates a new metrics. + * @method create + * @private + * @return {metrics} A new metrics + */ + Metrics.create = function(options) { + var defaults = { + extended: false, + narrowDetections: 0, + narrowphaseTests: 0, + narrowReuse: 0, + narrowReuseCount: 0, + midphaseTests: 0, + broadphaseTests: 0, + narrowEff: 0.0001, + midEff: 0.0001, + broadEff: 0.0001, + collisions: 0, + buckets: 0, + bodies: 0, + pairs: 0 + }; + + return Common.extend(defaults, false, options); + }; + + /** + * Resets metrics. + * @method reset + * @private + * @param {metrics} metrics + */ + Metrics.reset = function(metrics) { + if (metrics.extended) { + metrics.narrowDetections = 0; + metrics.narrowphaseTests = 0; + metrics.narrowReuse = 0; + metrics.narrowReuseCount = 0; + metrics.midphaseTests = 0; + metrics.broadphaseTests = 0; + metrics.narrowEff = 0; + metrics.midEff = 0; + metrics.broadEff = 0; + metrics.collisions = 0; + metrics.buckets = 0; + metrics.pairs = 0; + metrics.bodies = 0; + } + }; + + /** + * Updates metrics. + * @method update + * @private + * @param {metrics} metrics + * @param {engine} engine + */ + Metrics.update = function(metrics, engine) { + if (metrics.extended) { + var world = engine.world, + bodies = Composite.allBodies(world); + + metrics.collisions = metrics.narrowDetections; + metrics.pairs = engine.pairs.list.length; + metrics.bodies = bodies.length; + metrics.midEff = (metrics.narrowDetections / (metrics.midphaseTests || 1)).toFixed(2); + metrics.narrowEff = (metrics.narrowDetections / (metrics.narrowphaseTests || 1)).toFixed(2); + metrics.broadEff = (1 - (metrics.broadphaseTests / (bodies.length || 1))).toFixed(2); + metrics.narrowReuse = (metrics.narrowReuseCount / (metrics.narrowphaseTests || 1)).toFixed(2); + //var broadphase = engine.broadphase[engine.broadphase.current]; + //if (broadphase.instance) + // metrics.buckets = Common.keys(broadphase.instance.buckets).length; + } + }; + +})(); +// @endif + + +/***/ }), +/* 1393 */ +/***/ (function(module, exports, __webpack_require__) { + +/** +* The `Matter.Svg` module contains methods for converting SVG images into an array of vector points. +* +* To use this module you also need the SVGPathSeg polyfill: https://github.com/progers/pathseg +* +* See the included usage [examples](https://github.com/liabru/matter-js/tree/master/examples). +* +* @class Svg +*/ + +var Svg = {}; + +module.exports = Svg; + +var Bounds = __webpack_require__(100); +var Common = __webpack_require__(37); + +(function() { + + /** + * Converts an SVG path into an array of vector points. + * If the input path forms a concave shape, you must decompose the result into convex parts before use. + * See `Bodies.fromVertices` which provides support for this. + * Note that this function is not guaranteed to support complex paths (such as those with holes). + * You must load the `pathseg.js` polyfill on newer browsers. + * @method pathToVertices + * @param {SVGPathElement} path + * @param {Number} [sampleLength=15] + * @return {Vector[]} points + */ + Svg.pathToVertices = function(path, sampleLength) { + if (typeof window !== 'undefined' && !('SVGPathSeg' in window)) { + Common.warn('Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.'); + } + + // https://github.com/wout/svg.topoly.js/blob/master/svg.topoly.js + var i, il, total, point, segment, segments, + segmentsQueue, lastSegment, + lastPoint, segmentIndex, points = [], + lx, ly, length = 0, x = 0, y = 0; + + sampleLength = sampleLength || 15; + + var addPoint = function(px, py, pathSegType) { + // all odd-numbered path types are relative except PATHSEG_CLOSEPATH (1) + var isRelative = pathSegType % 2 === 1 && pathSegType > 1; + + // when the last point doesn't equal the current point add the current point + if (!lastPoint || px != lastPoint.x || py != lastPoint.y) { + if (lastPoint && isRelative) { + lx = lastPoint.x; + ly = lastPoint.y; + } else { + lx = 0; + ly = 0; + } + + var point = { + x: lx + px, + y: ly + py + }; + + // set last point + if (isRelative || !lastPoint) { + lastPoint = point; + } + + points.push(point); + + x = lx + px; + y = ly + py; + } + }; + + var addSegmentPoint = function(segment) { + var segType = segment.pathSegTypeAsLetter.toUpperCase(); + + // skip path ends + if (segType === 'Z') + return; + + // map segment to x and y + switch (segType) { + + case 'M': + case 'L': + case 'T': + case 'C': + case 'S': + case 'Q': + x = segment.x; + y = segment.y; + break; + case 'H': + x = segment.x; + break; + case 'V': + y = segment.y; + break; + } + + addPoint(x, y, segment.pathSegType); + }; + + // ensure path is absolute + Svg._svgPathToAbsolute(path); + + // get total length + total = path.getTotalLength(); + + // queue segments + segments = []; + for (i = 0; i < path.pathSegList.numberOfItems; i += 1) + segments.push(path.pathSegList.getItem(i)); + + segmentsQueue = segments.concat(); + + // sample through path + while (length < total) { + // get segment at position + segmentIndex = path.getPathSegAtLength(length); + segment = segments[segmentIndex]; + + // new segment + if (segment != lastSegment) { + while (segmentsQueue.length && segmentsQueue[0] != segment) + addSegmentPoint(segmentsQueue.shift()); + + lastSegment = segment; + } + + // add points in between when curving + // TODO: adaptive sampling + switch (segment.pathSegTypeAsLetter.toUpperCase()) { + + case 'C': + case 'T': + case 'S': + case 'Q': + case 'A': + point = path.getPointAtLength(length); + addPoint(point.x, point.y, 0); + break; + + } + + // increment by sample value + length += sampleLength; + } + + // add remaining segments not passed by sampling + for (i = 0, il = segmentsQueue.length; i < il; ++i) + addSegmentPoint(segmentsQueue[i]); + + return points; + }; + + Svg._svgPathToAbsolute = function(path) { + // http://phrogz.net/convert-svg-path-to-all-absolute-commands + // Copyright (c) Gavin Kistner + // http://phrogz.net/js/_ReuseLicense.txt + // Modifications: tidy formatting and naming + var x0, y0, x1, y1, x2, y2, segs = path.pathSegList, + x = 0, y = 0, len = segs.numberOfItems; + + for (var i = 0; i < len; ++i) { + var seg = segs.getItem(i), + segType = seg.pathSegTypeAsLetter; + + if (/[MLHVCSQTA]/.test(segType)) { + if ('x' in seg) x = seg.x; + if ('y' in seg) y = seg.y; + } else { + if ('x1' in seg) x1 = x + seg.x1; + if ('x2' in seg) x2 = x + seg.x2; + if ('y1' in seg) y1 = y + seg.y1; + if ('y2' in seg) y2 = y + seg.y2; + if ('x' in seg) x += seg.x; + if ('y' in seg) y += seg.y; + + switch (segType) { + + case 'm': + segs.replaceItem(path.createSVGPathSegMovetoAbs(x, y), i); + break; + case 'l': + segs.replaceItem(path.createSVGPathSegLinetoAbs(x, y), i); + break; + case 'h': + segs.replaceItem(path.createSVGPathSegLinetoHorizontalAbs(x), i); + break; + case 'v': + segs.replaceItem(path.createSVGPathSegLinetoVerticalAbs(y), i); + break; + case 'c': + segs.replaceItem(path.createSVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2), i); + break; + case 's': + segs.replaceItem(path.createSVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2), i); + break; + case 'q': + segs.replaceItem(path.createSVGPathSegCurvetoQuadraticAbs(x, y, x1, y1), i); + break; + case 't': + segs.replaceItem(path.createSVGPathSegCurvetoQuadraticSmoothAbs(x, y), i); + break; + case 'a': + segs.replaceItem(path.createSVGPathSegArcAbs(x, y, seg.r1, seg.r2, seg.angle, seg.largeArcFlag, seg.sweepFlag), i); + break; + case 'z': + case 'Z': + x = x0; + y = y0; + break; + + } + } + + if (segType == 'M' || segType == 'm') { + x0 = x; + y0 = y; + } + } + }; + +})(); + +/***/ }), +/* 1394 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Body = __webpack_require__(60); +var Bodies = __webpack_require__(135); +var Class = __webpack_require__(0); +var Factory = __webpack_require__(1327); +var GetFastValue = __webpack_require__(2); +var GetValue = __webpack_require__(6); +var MatterAttractors = __webpack_require__(1395); +var MatterLib = __webpack_require__(1332); +var MatterWrap = __webpack_require__(1396); +var Merge = __webpack_require__(85); +var Plugin = __webpack_require__(1246); +var PluginCache = __webpack_require__(18); +var SceneEvents = __webpack_require__(19); +var World = __webpack_require__(1337); +var Vertices = __webpack_require__(84); + +/** + * @classdesc + * [description] + * + * @class MatterPhysics + * @memberof Phaser.Physics.Matter + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - [description] + */ +var MatterPhysics = new Class({ + + initialize: + + function MatterPhysics (scene) + { + /** + * [description] + * + * @name Phaser.Physics.Matter.MatterPhysics#scene + * @type {Phaser.Scene} + * @since 3.0.0 + */ + this.scene = scene; + + /** + * [description] + * + * @name Phaser.Physics.Matter.MatterPhysics#systems + * @type {Phaser.Scenes.Systems} + * @since 3.0.0 + */ + this.systems = scene.sys; + + /** + * [description] + * + * @name Phaser.Physics.Matter.MatterPhysics#config + * @type {object} + * @since 3.0.0 + */ + this.config = this.getConfig(); + + /** + * [description] + * + * @name Phaser.Physics.Matter.MatterPhysics#world + * @type {Phaser.Physics.Matter.World} + * @since 3.0.0 + */ + this.world; + + /** + * [description] + * + * @name Phaser.Physics.Matter.MatterPhysics#add + * @type {Phaser.Physics.Matter.Factory} + * @since 3.0.0 + */ + this.add; + + /** + * A reference to the `Matter.Vertices` module which contains methods for creating and manipulating sets of vertices. + * A set of vertices is an array of `Matter.Vector` with additional indexing properties inserted by `Vertices.create`. + * A `Matter.Body` maintains a set of vertices to represent the shape of the object (its convex hull). + * + * @name Phaser.Physics.Matter.MatterPhysics#verts + * @type {MatterJS.Vertices} + * @since 3.14.0 + */ + this.verts = Vertices; + + /** + * A reference to the `Matter.Body` module which contains methods for creating and manipulating body models. + * + * @name Phaser.Physics.Matter.MatterPhysics#body + * @type {MatterJS.Body} + * @since 3.18.0 + */ + this.body = Body; + + /** + * A reference to the `Matter.Bodies` module which contains methods for creating bodies. + * + * @name Phaser.Physics.Matter.MatterPhysics#bodies + * @type {MatterJS.Bodies} + * @since 3.18.0 + */ + this.bodies = Bodies; + + // Matter plugins + + if (GetValue(this.config, 'plugins.attractors', false)) + { + Plugin.register(MatterAttractors); + Plugin.use(MatterLib, MatterAttractors); + } + + if (GetValue(this.config, 'plugins.wrap', false)) + { + Plugin.register(MatterWrap); + Plugin.use(MatterLib, MatterWrap); + } + + scene.sys.events.once(SceneEvents.BOOT, this.boot, this); + scene.sys.events.on(SceneEvents.START, this.start, this); + }, + + /** + * This method is called automatically, only once, when the Scene is first created. + * Do not invoke it directly. + * + * @method Phaser.Physics.Matter.MatterPhysics#boot + * @private + * @since 3.5.1 + */ + boot: function () + { + this.world = new World(this.scene, this.config); + this.add = new Factory(this.world); + + this.systems.events.once(SceneEvents.DESTROY, this.destroy, this); + }, + + /** + * This method is called automatically by the Scene when it is starting up. + * It is responsible for creating local systems, properties and listening for Scene events. + * Do not invoke it directly. + * + * @method Phaser.Physics.Matter.MatterPhysics#start + * @private + * @since 3.5.0 + */ + start: function () + { + if (!this.world) + { + this.world = new World(this.scene, this.config); + this.add = new Factory(this.world); + } + + var eventEmitter = this.systems.events; + + eventEmitter.on(SceneEvents.UPDATE, this.world.update, this.world); + eventEmitter.on(SceneEvents.POST_UPDATE, this.world.postUpdate, this.world); + eventEmitter.once(SceneEvents.SHUTDOWN, this.shutdown, this); + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.MatterPhysics#getConfig + * @since 3.0.0 + * + * @return {object} [description] + */ + getConfig: function () + { + var gameConfig = this.systems.game.config.physics; + var sceneConfig = this.systems.settings.physics; + + var config = Merge( + GetFastValue(sceneConfig, 'matter', {}), + GetFastValue(gameConfig, 'matter', {}) + ); + + return config; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.MatterPhysics#enableAttractorPlugin + * @since 3.0.0 + * + * @return {Phaser.Physics.Matter.MatterPhysics} This Matter Physics instance. + */ + enableAttractorPlugin: function () + { + Plugin.register(MatterAttractors); + Plugin.use(MatterLib, MatterAttractors); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.MatterPhysics#enableWrapPlugin + * @since 3.0.0 + * + * @return {Phaser.Physics.Matter.MatterPhysics} This Matter Physics instance. + */ + enableWrapPlugin: function () + { + Plugin.register(MatterWrap); + Plugin.use(MatterLib, MatterWrap); + + return this; + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.MatterPhysics#pause + * @since 3.0.0 + * + * @return {Phaser.Physics.Matter.World} The Matter World object. + */ + pause: function () + { + return this.world.pause(); + }, + + /** + * [description] + * + * @method Phaser.Physics.Matter.MatterPhysics#resume + * @since 3.0.0 + * + * @return {Phaser.Physics.Matter.World} The Matter World object. + */ + resume: function () + { + return this.world.resume(); + }, + + /** + * Sets the Matter Engine to run at fixed timestep of 60Hz and enables `autoUpdate`. + * If you have set a custom `getDelta` function then this will override it. + * + * @method Phaser.Physics.Matter.MatterPhysics#set60Hz + * @since 3.4.0 + * + * @return {Phaser.Physics.Matter.MatterPhysics} This Matter Physics instance. + */ + set60Hz: function () + { + this.world.getDelta = this.world.update60Hz; + this.world.autoUpdate = true; + + return this; + }, + + /** + * Sets the Matter Engine to run at fixed timestep of 30Hz and enables `autoUpdate`. + * If you have set a custom `getDelta` function then this will override it. + * + * @method Phaser.Physics.Matter.MatterPhysics#set30Hz + * @since 3.4.0 + * + * @return {Phaser.Physics.Matter.MatterPhysics} This Matter Physics instance. + */ + set30Hz: function () + { + this.world.getDelta = this.world.update30Hz; + this.world.autoUpdate = true; + + return this; + }, + + /** + * Manually advances the physics simulation by one iteration. + * + * You can optionally pass in the `delta` and `correction` values to be used by Engine.update. + * If undefined they use the Matter defaults of 60Hz and no correction. + * + * Calling `step` directly bypasses any checks of `enabled` or `autoUpdate`. + * + * It also ignores any custom `getDelta` functions, as you should be passing the delta + * value in to this call. + * + * You can adjust the number of iterations that Engine.update performs internally. + * Use the Scene Matter Physics config object to set the following properties: + * + * positionIterations (defaults to 6) + * velocityIterations (defaults to 4) + * constraintIterations (defaults to 2) + * + * Adjusting these values can help performance in certain situations, depending on the physics requirements + * of your game. + * + * @method Phaser.Physics.Matter.MatterPhysics#step + * @since 3.4.0 + * + * @param {number} [delta=16.666] - [description] + * @param {number} [correction=1] - [description] + */ + step: function (delta, correction) + { + this.world.step(delta, correction); + }, + + /** + * The Scene that owns this plugin is shutting down. + * We need to kill and reset all internal properties as well as stop listening to Scene events. + * + * @method Phaser.Physics.Matter.MatterPhysics#shutdown + * @private + * @since 3.0.0 + */ + shutdown: function () + { + var eventEmitter = this.systems.events; + + eventEmitter.off(SceneEvents.UPDATE, this.world.update, this.world); + eventEmitter.off(SceneEvents.POST_UPDATE, this.world.postUpdate, this.world); + eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); + + this.add.destroy(); + this.world.destroy(); + + this.add = null; + this.world = null; + }, + + /** + * The Scene that owns this plugin is being destroyed. + * We need to shutdown and then kill off all external references. + * + * @method Phaser.Physics.Matter.MatterPhysics#destroy + * @private + * @since 3.0.0 + */ + destroy: function () + { + this.shutdown(); + + this.scene.sys.events.off(SceneEvents.START, this.start, this); + + this.scene = null; + this.systems = null; + } + +}); + +PluginCache.register('MatterPhysics', MatterPhysics, 'matterPhysics'); + +module.exports = MatterPhysics; + + +/***/ }), +/* 1395 */ +/***/ (function(module, exports, __webpack_require__) { + +var Matter = __webpack_require__(1245); + +/** + * An attractors plugin for matter.js. + * See the readme for usage and examples. + * @module MatterAttractors + */ +var MatterAttractors = { + // plugin meta + name: 'matter-attractors', // PLUGIN_NAME + version: '0.1.7', // PLUGIN_VERSION + for: 'matter-js@^0.13.1', + silent: true, // no console log please + + // installs the plugin where `base` is `Matter` + // you should not need to call this directly. + install: function(base) { + base.after('Body.create', function() { + MatterAttractors.Body.init(this); + }); + + base.before('Engine.update', function(engine) { + MatterAttractors.Engine.update(engine); + }); + }, + + Body: { + /** + * Initialises the `body` to support attractors. + * This is called automatically by the plugin. + * @function MatterAttractors.Body.init + * @param {Matter.Body} body The body to init. + * @returns {void} No return value. + */ + init: function(body) { + body.plugin.attractors = body.plugin.attractors || []; + } + }, + + Engine: { + /** + * Applies all attractors for all bodies in the `engine`. + * This is called automatically by the plugin. + * @function MatterAttractors.Engine.update + * @param {Matter.Engine} engine The engine to update. + * @returns {void} No return value. + */ + update: function(engine) { + var world = engine.world, + bodies = Matter.Composite.allBodies(world); + + for (var i = 0; i < bodies.length; i += 1) { + var bodyA = bodies[i], + attractors = bodyA.plugin.attractors; + + if (attractors && attractors.length > 0) { + for (var j = i + 1; j < bodies.length; j += 1) { + var bodyB = bodies[j]; + + for (var k = 0; k < attractors.length; k += 1) { + var attractor = attractors[k], + forceVector = attractor; + + if (Matter.Common.isFunction(attractor)) { + forceVector = attractor(bodyA, bodyB); + } + + if (forceVector) { + Matter.Body.applyForce(bodyB, bodyB.position, forceVector); + } + } + } + } + } + } + }, + + /** + * Defines some useful common attractor functions that can be used + * by pushing them to your body's `body.plugin.attractors` array. + * @namespace MatterAttractors.Attractors + * @property {number} gravityConstant The gravitational constant used by the gravity attractor. + */ + Attractors: { + gravityConstant: 0.001, + + /** + * An attractor function that applies Newton's law of gravitation. + * Use this by pushing `MatterAttractors.Attractors.gravity` to your body's `body.plugin.attractors` array. + * The gravitational constant defaults to `0.001` which you can change + * at `MatterAttractors.Attractors.gravityConstant`. + * @function MatterAttractors.Attractors.gravity + * @param {Matter.Body} bodyA The first body. + * @param {Matter.Body} bodyB The second body. + * @returns {void} No return value. + */ + gravity: function(bodyA, bodyB) { + // use Newton's law of gravitation + var bToA = Matter.Vector.sub(bodyB.position, bodyA.position), + distanceSq = Matter.Vector.magnitudeSquared(bToA) || 0.0001, + normal = Matter.Vector.normalise(bToA), + magnitude = -MatterAttractors.Attractors.gravityConstant * (bodyA.mass * bodyB.mass / distanceSq), + force = Matter.Vector.mult(normal, magnitude); + + // to apply forces to both bodies + Matter.Body.applyForce(bodyA, bodyA.position, Matter.Vector.neg(force)); + Matter.Body.applyForce(bodyB, bodyB.position, force); + } + } +}; + +module.exports = MatterAttractors; + +/** + * @namespace Matter.Body + * @see http://brm.io/matter-js/docs/classes/Body.html + */ + +/** + * This plugin adds a new property `body.plugin.attractors` to instances of `Matter.Body`. + * This is an array of callback functions that will be called automatically + * for every pair of bodies, on every engine update. + * @property {Function[]} body.plugin.attractors + * @memberof Matter.Body + */ + +/** + * An attractor function calculates the force to be applied + * to `bodyB`, it should either: + * - return the force vector to be applied to `bodyB` + * - or apply the force to the body(s) itself + * @callback AttractorFunction + * @param {Matter.Body} bodyA + * @param {Matter.Body} bodyB + * @returns {(Vector|undefined)} a force vector (optional) + */ + + +/***/ }), +/* 1396 */ +/***/ (function(module, exports, __webpack_require__) { + +var Matter = __webpack_require__(1245); + +/** + * A coordinate wrapping plugin for matter.js. + * See the readme for usage and examples. + * @module MatterWrap + */ +var MatterWrap = { + // plugin meta + name: 'matter-wrap', // PLUGIN_NAME + version: '0.1.4', // PLUGIN_VERSION + for: 'matter-js@^0.13.1', + silent: true, // no console log please + + // installs the plugin where `base` is `Matter` + // you should not need to call this directly. + install: function(base) { + base.after('Engine.update', function() { + MatterWrap.Engine.update(this); + }); + }, + + Engine: { + /** + * Updates the engine by wrapping bodies and composites inside `engine.world`. + * This is called automatically by the plugin. + * @function MatterWrap.Engine.update + * @param {Matter.Engine} engine The engine to update. + * @returns {void} No return value. + */ + update: function(engine) { + var world = engine.world, + bodies = Matter.Composite.allBodies(world), + composites = Matter.Composite.allComposites(world); + + for (var i = 0; i < bodies.length; i += 1) { + var body = bodies[i]; + + if (body.plugin.wrap) { + MatterWrap.Body.wrap(body, body.plugin.wrap); + } + } + + for (i = 0; i < composites.length; i += 1) { + var composite = composites[i]; + + if (composite.plugin.wrap) { + MatterWrap.Composite.wrap(composite, composite.plugin.wrap); + } + } + } + }, + + Bounds: { + /** + * Returns a translation vector that wraps the `objectBounds` inside the `bounds`. + * @function MatterWrap.Bounds.wrap + * @param {Matter.Bounds} objectBounds The bounds of the object to wrap inside the bounds. + * @param {Matter.Bounds} bounds The bounds to wrap the body inside. + * @returns {?Matter.Vector} A translation vector (only if wrapping is required). + */ + wrap: function(objectBounds, bounds) { + var x = null, + y = null; + + if (typeof bounds.min.x !== 'undefined' && typeof bounds.max.x !== 'undefined') { + if (objectBounds.min.x > bounds.max.x) { + x = bounds.min.x - objectBounds.max.x; + } else if (objectBounds.max.x < bounds.min.x) { + x = bounds.max.x - objectBounds.min.x; + } + } + + if (typeof bounds.min.y !== 'undefined' && typeof bounds.max.y !== 'undefined') { + if (objectBounds.min.y > bounds.max.y) { + y = bounds.min.y - objectBounds.max.y; + } else if (objectBounds.max.y < bounds.min.y) { + y = bounds.max.y - objectBounds.min.y; + } + } + + if (x !== null || y !== null) { + return { + x: x || 0, + y: y || 0 + }; + } + } + }, + + Body: { + /** + * Wraps the `body` position such that it always stays within the given bounds. + * Upon crossing a boundary the body will appear on the opposite side of the bounds, + * while maintaining its velocity. + * This is called automatically by the plugin. + * @function MatterWrap.Body.wrap + * @param {Matter.Body} body The body to wrap. + * @param {Matter.Bounds} bounds The bounds to wrap the body inside. + * @returns {?Matter.Vector} The translation vector that was applied (only if wrapping was required). + */ + wrap: function(body, bounds) { + var translation = MatterWrap.Bounds.wrap(body.bounds, bounds); + + if (translation) { + Matter.Body.translate(body, translation); + } + + return translation; + } + }, + + Composite: { + /** + * Returns the union of the bounds of all of the composite's bodies + * (not accounting for constraints). + * @function MatterWrap.Composite.bounds + * @param {Matter.Composite} composite The composite. + * @returns {Matter.Bounds} The composite bounds. + */ + bounds: function(composite) { + var bodies = Matter.Composite.allBodies(composite), + vertices = []; + + for (var i = 0; i < bodies.length; i += 1) { + var body = bodies[i]; + vertices.push(body.bounds.min, body.bounds.max); + } + + return Matter.Bounds.create(vertices); + }, + + /** + * Wraps the `composite` position such that it always stays within the given bounds. + * Upon crossing a boundary the composite will appear on the opposite side of the bounds, + * while maintaining its velocity. + * This is called automatically by the plugin. + * @function MatterWrap.Composite.wrap + * @param {Matter.Composite} composite The composite to wrap. + * @param {Matter.Bounds} bounds The bounds to wrap the composite inside. + * @returns {?Matter.Vector} The translation vector that was applied (only if wrapping was required). + */ + wrap: function(composite, bounds) { + var translation = MatterWrap.Bounds.wrap( + MatterWrap.Composite.bounds(composite), + bounds + ); + + if (translation) { + Matter.Composite.translate(composite, translation); + } + + return translation; + } + } +}; + +module.exports = MatterWrap; + +/** + * @namespace Matter.Body + * @see http://brm.io/matter-js/docs/classes/Body.html + */ + +/** + * This plugin adds a new property `body.plugin.wrap` to instances of `Matter.Body`. + * This is a `Matter.Bounds` instance that specifies the wrapping region. + * @property {Matter.Bounds} body.plugin.wrap + * @memberof Matter.Body + */ + +/** + * This plugin adds a new property `composite.plugin.wrap` to instances of `Matter.Composite`. + * This is a `Matter.Bounds` instance that specifies the wrapping region. + * @property {Matter.Bounds} composite.plugin.wrap + * @memberof Matter.Composite + */ + +/***/ }), +/* 1397 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Renderer + */ + +/** + * @namespace Phaser.Types.Renderer + */ + +module.exports = { + + Canvas: __webpack_require__(1398), + Snapshot: __webpack_require__(1399), + WebGL: __webpack_require__(1400) + +}; + + +/***/ }), +/* 1398 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Renderer.Canvas + */ + +module.exports = { + + CanvasRenderer: __webpack_require__(480), + GetBlendModes: __webpack_require__(482), + SetTransform: __webpack_require__(25) + +}; + + +/***/ }), +/* 1399 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Renderer.Snapshot + */ + +module.exports = { + + Canvas: __webpack_require__(481), + WebGL: __webpack_require__(484) + +}; + + +/***/ }), +/* 1400 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Renderer.WebGL + */ + +module.exports = { + + Utils: __webpack_require__(9), + WebGLPipeline: __webpack_require__(225), + WebGLRenderer: __webpack_require__(483), + Pipelines: __webpack_require__(1401), + + // Constants + BYTE: 0, + SHORT: 1, + UNSIGNED_BYTE: 2, + UNSIGNED_SHORT: 3, + FLOAT: 4 + +}; + + +/***/ }), +/* 1401 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2019 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Renderer.WebGL.Pipelines + */ + +module.exports = { + + BitmapMaskPipeline: __webpack_require__(485), + ForwardDiffuseLightPipeline: __webpack_require__(486), + TextureTintPipeline: __webpack_require__(226), + ModelViewProjection: __webpack_require__(487) + +}; + + +/***/ }) +/******/ ]); +}); \ No newline at end of file diff --git a/Phaser/Demos/out/AnimationBase.js b/Phaser/Demos/out/AnimationBase.js index 29dbf27a..1dea681a 100644 --- a/Phaser/Demos/out/AnimationBase.js +++ b/Phaser/Demos/out/AnimationBase.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -11,22 +14,21 @@ var __extends = (this && this.__extends) || (function () { })(); var AnimationBase = /** @class */ (function (_super) { __extends(AnimationBase, _super); - function AnimationBase(game) { - var _this = _super.call(this, game) || this; + function AnimationBase() { + var _this = _super.call(this, "AnimationBase") || this; _this._isTouched = false; - _this._resources.push("resource/progress_bar/progress_bar_ske.json", "resource/progress_bar/progress_bar_tex.json", "resource/progress_bar/progress_bar_tex.png"); return _this; } - AnimationBase.prototype._onStart = function () { - var factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/progress_bar/progress_bar_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/progress_bar/progress_bar_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/progress_bar/progress_bar_tex.png", true).base); - // - this._armatureDisplay = factory.buildArmatureDisplay("progress_bar"); - this._armatureDisplay.x = 0.0; - this._armatureDisplay.y = 0.0; - this.addChild(this._armatureDisplay); - // Add animation event listener. + AnimationBase.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("progress_bar", "resource/progress_bar/progress_bar_tex.png", "resource/progress_bar/progress_bar_tex.json", "resource/progress_bar/progress_bar_ske.json"); + }; + AnimationBase.prototype.create = function () { + var _this = this; + _super.prototype.create.call(this); + this._armatureDisplay = this.add.armature("progress_bar", "progress_bar"); + this._armatureDisplay.x = this.cameras.main.centerX; + this._armatureDisplay.y = this.cameras.main.centerY; this._armatureDisplay.addDBEventListener(dragonBones.EventObject.START, this._animationEventHandler, this); this._armatureDisplay.addDBEventListener(dragonBones.EventObject.LOOP_COMPLETE, this._animationEventHandler, this); this._armatureDisplay.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); @@ -36,15 +38,13 @@ var AnimationBase = /** @class */ (function (_super) { this._armatureDisplay.addDBEventListener(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); this._armatureDisplay.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._animationEventHandler, this); this._armatureDisplay.animation.play("idle"); - // - this.inputEnabled = true; - this.events.onInputDown.add(this._inputDown, this); - this.events.onInputUp.add(this._inputUp, this); - // + this.input.enabled = true; + this.input.on('pointerdown', function () { return _this._inputDown(); }); + this.input.on('pointerup', function () { return _this._inputUp(); }); this.createText("Touch to control animation play progress."); }; AnimationBase.prototype._inputDown = function () { - var progress = Math.min(Math.max((this.game.input.x - this.x + 300.0) / 600.0, 0.0), 1.0); + var progress = Phaser.Math.Clamp((this.input.x - this._armatureDisplay.x + 300.0) / 600.0, 0.0, 1.0); this._isTouched = true; this._armatureDisplay.animation.gotoAndStopByProgress("idle", progress); }; @@ -54,7 +54,7 @@ var AnimationBase = /** @class */ (function (_super) { }; AnimationBase.prototype.update = function () { if (this._isTouched) { - var progress = Math.min(Math.max((this.game.input.x - this.x + 300.0) / 600.0, 0.0), 1.0); + var progress = Phaser.Math.Clamp((this.input.x - this._armatureDisplay.x + 300.0) / 600.0, 0.0, 1.0); var animationState = this._armatureDisplay.animation.getState("idle"); animationState.currentTime = animationState.totalTime * progress; } diff --git a/Phaser/Demos/out/AnimationBaseTest.js b/Phaser/Demos/out/AnimationBaseTest.js deleted file mode 100644 index 63eabee3..00000000 --- a/Phaser/Demos/out/AnimationBaseTest.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var AnimationBaseTest = (function (_super) { - __extends(AnimationBaseTest, _super); - function AnimationBaseTest(game) { - var _this = _super.call(this, game) || this; - _this._isTouched = false; - _this._resources.push("resource/assets/animation_base_test_ske.json", "resource/assets/animation_base_test_tex.json", "resource/assets/animation_base_test_tex.png"); - return _this; - } - AnimationBaseTest.prototype._onStart = function () { - var factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/assets/animation_base_test_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/assets/animation_base_test_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/assets/animation_base_test_tex.png", true).base); - // - this._armatureDisplay = factory.buildArmatureDisplay("progressBar"); - this._armatureDisplay.x = this.stageWidth * 0.5; - this._armatureDisplay.y = this.stageHeight * 0.5; - this._armatureDisplay.scale.x = this._armatureDisplay.scale.x = this.stageWidth >= 300 ? 1 : this.stageWidth / 330; - this.addChild(this._armatureDisplay); - // Test animation event - this._armatureDisplay.addDBEventListener(dragonBones.EventObject.START, this._animationEventHandler, this); - this._armatureDisplay.addDBEventListener(dragonBones.EventObject.LOOP_COMPLETE, this._animationEventHandler, this); - this._armatureDisplay.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); - this._armatureDisplay.addDBEventListener(dragonBones.EventObject.FADE_IN, this._animationEventHandler, this); - this._armatureDisplay.addDBEventListener(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); - this._armatureDisplay.addDBEventListener(dragonBones.EventObject.FADE_OUT, this._animationEventHandler, this); - this._armatureDisplay.addDBEventListener(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); - this._armatureDisplay.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._animationEventHandler, this); - this._armatureDisplay.animation.play("idle", 1); - // Test animation config. - // const animaitonConfig = this._armatureDisplay.animation.animationConfig; - // animaitonConfig.name = "test"; // Animation state name. - // animaitonConfig.animation = "idle"; // Animation name. - // animaitonConfig.playTimes = 1; // Play one time. - // animaitonConfig.playTimes = 3; // Play several times. - // animaitonConfig.playTimes = 0; // Loop play. - // animaitonConfig.timeScale = 1.0; // Play speed. - // animaitonConfig.timeScale = -1.0; // Reverse play. - // animaitonConfig.position = 1.0; // Goto and play. - // animaitonConfig.duration = 0.0; // Goto and stop. - // animaitonConfig.duration = 3.0; // Interval play. - // this._armatureDisplay.animation.playConfig(animaitonConfig); - // - this.inputEnabled = true; - this.events.onInputDown.add(this._inputDown, this); - this.events.onInputUp.add(this._inputUp, this); - // - this.createText("Click to control animation play progress."); - }; - AnimationBaseTest.prototype._inputDown = function () { - var progress = Math.min(Math.max((this.game.input.x - this._armatureDisplay.x + 300 * this._armatureDisplay.scale.x) / 600 * this._armatureDisplay.scale.x, 0), 1); - this._isTouched = true; - this._armatureDisplay.animation.gotoAndStopByProgress("idle", progress); - }; - AnimationBaseTest.prototype._inputUp = function () { - this._isTouched = false; - this._armatureDisplay.animation.play(); - }; - AnimationBaseTest.prototype.update = function () { - if (this._isTouched) { - var progress = Math.min(Math.max((this.game.input.x - this._armatureDisplay.x + 300 * this._armatureDisplay.scale.x) / 600 * this._armatureDisplay.scale.x, 0), 1); - var animationState = this._armatureDisplay.animation.getState("idle"); - animationState.currentTime = animationState.totalTime * progress; - } - }; - AnimationBaseTest.prototype._animationEventHandler = function (event) { - console.log(event.animationState.name, event.type, event.name || ""); - }; - return AnimationBaseTest; -}(BaseTest)); diff --git a/Phaser/Demos/out/AnimationLayer.js b/Phaser/Demos/out/AnimationLayer.js index c86ab94d..c04a7b5f 100644 --- a/Phaser/Demos/out/AnimationLayer.js +++ b/Phaser/Demos/out/AnimationLayer.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -11,21 +14,20 @@ var __extends = (this && this.__extends) || (function () { })(); var AnimationLayer = /** @class */ (function (_super) { __extends(AnimationLayer, _super); - function AnimationLayer(game) { - var _this = _super.call(this, game) || this; - _this._resources.push("resource/mecha_1004d/mecha_1004d_ske.json", "resource/mecha_1004d/mecha_1004d_tex.json", "resource/mecha_1004d/mecha_1004d_tex.png"); - return _this; + function AnimationLayer() { + return _super.call(this, "AnimationLayer") || this; } - AnimationLayer.prototype._onStart = function () { - var factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1004d/mecha_1004d_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/mecha_1004d/mecha_1004d_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/mecha_1004d/mecha_1004d_tex.png", true).base); - this._armatureDisplay = factory.buildArmatureDisplay("mecha_1004d"); + AnimationLayer.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("mecha_1004d", "resource/mecha_1004d/mecha_1004d_tex.png", "resource/mecha_1004d/mecha_1004d_tex.json", "resource/mecha_1004d/mecha_1004d_ske.json"); + }; + AnimationLayer.prototype.create = function () { + _super.prototype.create.call(this); + this._armatureDisplay = this.add.armature("mecha_1004d", "mecha_1004d"); this._armatureDisplay.addDBEventListener(dragonBones.EventObject.LOOP_COMPLETE, this._animationEventHandler, this); this._armatureDisplay.animation.play("walk"); - this._armatureDisplay.x = 0.0; - this._armatureDisplay.y = 100.0; - this.addChild(this._armatureDisplay); + this._armatureDisplay.x = this.cameras.main.centerX; + this._armatureDisplay.y = this.cameras.main.centerY + 100.0; }; AnimationLayer.prototype._animationEventHandler = function (event) { var attackState = this._armatureDisplay.animation.getState("attack_01"); diff --git a/Phaser/Demos/out/BaseDemo.js b/Phaser/Demos/out/BaseDemo.js index 47dd218d..5150414a 100644 --- a/Phaser/Demos/out/BaseDemo.js +++ b/Phaser/Demos/out/BaseDemo.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -11,69 +14,21 @@ var __extends = (this && this.__extends) || (function () { })(); var BaseDemo = /** @class */ (function (_super) { __extends(BaseDemo, _super); - function BaseDemo(game) { - var _this = _super.call(this, game, 0.0, 0.0) || this; - _this._resources = []; - _this._resources.push(BaseDemo.BACKGROUND_URL); - setTimeout(function () { - _this.x = _this.stageWidth * 0.5; - _this.y = _this.stageHeight * 0.5; - _this._loadResources(); - }, 10); - return _this; + function BaseDemo() { + return _super !== null && _super.apply(this, arguments) || this; } - BaseDemo.prototype._loadResources = function () { - var _this = this; - var loadCount = 0; - for (var _i = 0, _a = this._resources; _i < _a.length; _i++) { - var resource = _a[_i]; - if (resource.indexOf("dbbin") > 0) { - this.game.load.binary(resource, resource); - } - else if (resource.indexOf("png") > 0) { - this.game.load.image(resource, resource); - } - else { - this.game.load.json(resource, resource); - } - loadCount++; - } - this.game.load.onFileComplete.add(function () { - loadCount--; - if (loadCount === 0) { - var texture = new PIXI.Texture(_this.game.cache.getImage(BaseDemo.BACKGROUND_URL, true).base); - _this._background = new Phaser.Sprite(_this.game, 0.0, 0.0, texture); - _this._background.x = -_this._background.texture.width * 0.5; - _this._background.y = -_this._background.texture.height * 0.5; - _this.addChild(_this._background); - // - _this._onStart(); - } - }); - this.game.load.start(); + BaseDemo.prototype.preload = function () { + this.load.image(BaseDemo.BACKGROUND_URL, BaseDemo.BACKGROUND_URL); + }; + BaseDemo.prototype.create = function () { + this.add.image(0, 0, BaseDemo.BACKGROUND_URL); }; - BaseDemo.prototype.createText = function (string) { - var style = { font: "14px", fill: "#FFFFFF", align: "center" }; - var text = this.game.add.text(0.0, 0.0, string, style); - text.x = -text.width * 0.5; - text.y = this.stageHeight * 0.5 - 100; - this.addChild(text); + BaseDemo.prototype.createText = function (str) { + var style = { fontSize: 18, color: "#FFFFFF", align: "center" }; + var text = this.add.text(this.cameras.main.centerX, this.cameras.main.height - 100, str, style); + text.setOrigin(.5, .5); return text; }; - Object.defineProperty(BaseDemo.prototype, "stageWidth", { - get: function () { - return this.game.width; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(BaseDemo.prototype, "stageHeight", { - get: function () { - return this.game.height; - }, - enumerable: true, - configurable: true - }); BaseDemo.BACKGROUND_URL = "resource/background.png"; return BaseDemo; -}(Phaser.Sprite)); +}(Phaser.Scene)); diff --git a/Phaser/Demos/out/BaseTest.js b/Phaser/Demos/out/BaseTest.js deleted file mode 100644 index c5022781..00000000 --- a/Phaser/Demos/out/BaseTest.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var BaseTest = (function (_super) { - __extends(BaseTest, _super); - function BaseTest(game) { - var _this = _super.call(this, game, 0.0, 0.0) || this; - _this._resources = []; - _this._background = new Phaser.Graphics(_this.game); - _this._background.beginFill(0x666666); - _this._background.drawRect(0.0, 0.0, _this.stageWidth, _this.stageHeight); - _this.addChild(_this._background); - setTimeout(function () { - _this._loadResources(); - }, 10); - return _this; - } - BaseTest.prototype._loadResources = function () { - var _this = this; - var loadCount = 0; - for (var _i = 0, _a = this._resources; _i < _a.length; _i++) { - var resource = _a[_i]; - if (resource.indexOf("dbbin") > 0) { - this.game.load.binary(resource, resource); - } - else if (resource.indexOf("png") > 0) { - this.game.load.image(resource, resource); - } - else { - this.game.load.json(resource, resource); - } - loadCount++; - } - this.game.load.onFileComplete.add(function () { - loadCount--; - if (loadCount === 0) { - _this._onStart(); - } - }); - this.game.load.start(); - }; - BaseTest.prototype.createText = function (string) { - var style = { font: "14px", fill: "#FFFFFF", align: "center" }; - var text = this.game.add.text(0.0, 0.0, string, style); - text.x = (this.stageWidth - text.width) * 0.5; - text.y = this.stageHeight - 60; - this.addChild(text); - return text; - }; - Object.defineProperty(BaseTest.prototype, "stageWidth", { - get: function () { - return this.game.width; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(BaseTest.prototype, "stageHeight", { - get: function () { - return this.game.height; - }, - enumerable: true, - configurable: true - }); - return BaseTest; -}(Phaser.Sprite)); diff --git a/Phaser/Demos/out/BoneOffset.js b/Phaser/Demos/out/BoneOffset.js index 4611ae58..d98b649c 100644 --- a/Phaser/Demos/out/BoneOffset.js +++ b/Phaser/Demos/out/BoneOffset.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -11,22 +14,21 @@ var __extends = (this && this.__extends) || (function () { })(); var BoneOffset = /** @class */ (function (_super) { __extends(BoneOffset, _super); - function BoneOffset(game) { - var _this = _super.call(this, game) || this; - _this._resources.push("resource/bullet_01/bullet_01_ske.json", "resource/bullet_01/bullet_01_tex.json", "resource/bullet_01/bullet_01_tex.png"); - return _this; + function BoneOffset() { + return _super.call(this, "BoneOffset") || this; } - BoneOffset.prototype._onStart = function () { - var factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/bullet_01/bullet_01_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/bullet_01/bullet_01_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/bullet_01/bullet_01_tex.png", true).base); + BoneOffset.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("bullet_01", "resource/bullet_01/bullet_01_tex.png", "resource/bullet_01/bullet_01_tex.json", "resource/bullet_01/bullet_01_ske.json"); + }; + BoneOffset.prototype.create = function () { + _super.prototype.create.call(this); for (var i = 0; i < 100; ++i) { - var armatureDisplay = factory.buildArmatureDisplay("bullet_01"); + var armatureDisplay = this.add.armature("bullet_01", "bullet_01"); armatureDisplay.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationHandler, this); - armatureDisplay.x = 0.0; - armatureDisplay.y = 0.0; - this.addChild(armatureDisplay); - // + armatureDisplay.x = 0; + armatureDisplay.y = 0; + this.cameras.main.centerOn(armatureDisplay.x, armatureDisplay.y); this._moveTo(armatureDisplay); } }; @@ -36,8 +38,9 @@ var BoneOffset = /** @class */ (function (_super) { BoneOffset.prototype._moveTo = function (armatureDisplay) { var fromX = armatureDisplay.x; var fromY = armatureDisplay.y; - var toX = Math.random() * this.stageWidth - this.stageWidth * 0.5; - var toY = Math.random() * this.stageHeight - this.stageHeight * 0.5; + var camera = this.cameras.main; + var toX = Math.random() * camera.width - camera.centerX; + var toY = Math.random() * camera.height - camera.centerY; var dX = toX - fromX; var dY = toY - fromY; var rootSlot = armatureDisplay.armature.getBone("root"); diff --git a/Phaser/Demos/out/BoundingBox.js b/Phaser/Demos/out/BoundingBox.js index e30b5b26..8782d9e0 100644 --- a/Phaser/Demos/out/BoundingBox.js +++ b/Phaser/Demos/out/BoundingBox.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -11,34 +14,35 @@ var __extends = (this && this.__extends) || (function () { })(); var BoundingBox = /** @class */ (function (_super) { __extends(BoundingBox, _super); - function BoundingBox(game) { - var _this = _super.call(this, game) || this; - _this._helpPointA = new Phaser.Point(); - _this._helpPointB = new Phaser.Point(); - _this._helpPointC = new Phaser.Point(); - _this._resources.push("resource/mecha_2903/mecha_2903_ske.json", "resource/mecha_2903/mecha_2903_tex.json", "resource/mecha_2903/mecha_2903_tex.png", "resource/bounding_box_tester/bounding_box_tester_ske.json", "resource/bounding_box_tester/bounding_box_tester_tex.json", "resource/bounding_box_tester/bounding_box_tester_tex.png"); + function BoundingBox() { + var _this = _super.call(this, "BoundingBox") || this; + _this._helpPointA = new Phaser.Math.Vector2(); + _this._helpPointB = new Phaser.Math.Vector2(); + _this._helpPointC = new Phaser.Math.Vector2(); + _this._helperMatrix = new Phaser.GameObjects.Components.TransformMatrix(); return _this; } - BoundingBox.prototype._onStart = function () { - var factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_2903/mecha_2903_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/mecha_2903/mecha_2903_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/mecha_2903/mecha_2903_tex.png", true).base); - factory.parseDragonBonesData(this.game.cache.getItem("resource/bounding_box_tester/bounding_box_tester_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/bounding_box_tester/bounding_box_tester_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/bounding_box_tester/bounding_box_tester_tex.png", true).base); - // - this._armatureDisplay = factory.buildArmatureDisplay("mecha_2903d"); - this._boundingBoxTester = factory.buildArmatureDisplay("tester"); + BoundingBox.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("mecha_2903d", "resource/mecha_2903/mecha_2903_tex.png", "resource/mecha_2903/mecha_2903_tex.json", "resource/mecha_2903/mecha_2903_ske.json"); + this.load.dragonbone("tester", "resource/bounding_box_tester/bounding_box_tester_tex.png", "resource/bounding_box_tester/bounding_box_tester_tex.json", "resource/bounding_box_tester/bounding_box_tester_ske.json"); + }; + BoundingBox.prototype.create = function () { + _super.prototype.create.call(this); + this._armatureDisplay = this.add.armature("mecha_2903d", "mecha_2903d"); + this._boundingBoxTester = this.add.armature("tester", "tester"); this._targetA = this._boundingBoxTester.armature.getSlot("target_a").display; this._targetB = this._boundingBoxTester.armature.getSlot("target_b").display; this._line = this._boundingBoxTester.armature.getBone("line"); this._pointA = this._boundingBoxTester.armature.getBone("point_a"); this._pointB = this._boundingBoxTester.armature.getBone("point_b"); - // + var cx = this.cameras.main.centerX; + var cy = this.cameras.main.centerY; this._armatureDisplay.debugDraw = true; - this._armatureDisplay.x = 0.0; - this._armatureDisplay.y = 100.0; - this._boundingBoxTester.x = 0.0; - this._boundingBoxTester.y = 200.0; + this._armatureDisplay.x = cx; + this._armatureDisplay.y = cy + 100.0; + this._boundingBoxTester.x = cx; + this._boundingBoxTester.y = cy + 200.0; this._targetA.armature.inheritAnimation = false; this._targetB.armature.inheritAnimation = false; this._line.offsetMode = 2 /* Override */; @@ -46,24 +50,22 @@ var BoundingBox = /** @class */ (function (_super) { this._pointB.offsetMode = 2 /* Override */; this._armatureDisplay.animation.play("walk"); this._boundingBoxTester.animation.play("0"); - // - this.addChild(this._armatureDisplay); - this.addChild(this._boundingBoxTester); - // - this.inputEnabled = true; - DragHelper.getInstance().enableDrag(this._targetA); - DragHelper.getInstance().enableDrag(this._targetB); - // + var bA = this._targetA.getAt(0); + var bB = this._targetB.getAt(0); + this._targetA.setSize(bA.displayWidth, bA.displayHeight); + DragHelper.getInstance().enableDrag(this, this._targetA); + this._targetB.setSize(bB.displayWidth, bB.displayHeight); + DragHelper.getInstance().enableDrag(this, this._targetB); this.createText("Touch to drag bounding box tester."); }; - BoundingBox.prototype.update = function () { - if (!this._armatureDisplay) { + BoundingBox.prototype.update = function (time, delta) { + if (!this._armatureDisplay) return; - } - this._helpPointA.set(this._targetA.x, this._targetA.y); - this._helpPointB.set(this._targetB.x, this._targetB.y); - this._helpPointA.copyFrom(this._armatureDisplay.toLocal(this._helpPointA, this._boundingBoxTester)); - this._helpPointB.copyFrom(this._armatureDisplay.toLocal(this._helpPointB, this._boundingBoxTester)); + this._boundingBoxTester.getWorldTransformMatrix(this._helperMatrix); + this._helperMatrix.transformPoint(this._targetA.x, this._targetA.y, this._helpPointA); + this._helperMatrix.transformPoint(this._targetB.x, this._targetB.y, this._helpPointB); + this._armatureDisplay.localTransform.transformPoint(this._helpPointA.x, this._helpPointA.y, this._helpPointA); + this._armatureDisplay.localTransform.transformPoint(this._helpPointB.x, this._helpPointB.y, this._helpPointB); var containsSlotA = this._armatureDisplay.armature.containsPoint(this._helpPointA.x, this._helpPointA.y); var containsSlotB = this._armatureDisplay.armature.containsPoint(this._helpPointB.x, this._helpPointB.y); var intersectsSlots = this._armatureDisplay.armature.intersectsSegment(this._helpPointA.x, this._helpPointA.y, this._helpPointB.x, this._helpPointB.y, this._helpPointA, this._helpPointB, this._helpPointC); @@ -94,8 +96,12 @@ var BoundingBox = /** @class */ (function (_super) { this._boundingBoxTester.animation.fadeIn(animationName, 0.2).resetToPose = false; } if (intersectsSlots) { - this._helpPointA.copyFrom(this._boundingBoxTester.toLocal(this._helpPointA, this._armatureDisplay)); - this._helpPointB.copyFrom(this._boundingBoxTester.toLocal(this._helpPointB, this._armatureDisplay)); + console.log("INSECT"); + this._armatureDisplay.getWorldTransformMatrix(this._helperMatrix); + this._helperMatrix.transformPoint(this._helpPointA.x, this._helpPointA.y, this._helpPointA); + this._helperMatrix.transformPoint(this._helpPointB.x, this._helpPointB.y, this._helpPointB); + this._boundingBoxTester.localTransform.transformPoint(this._helpPointA.x, this._helpPointA.y, this._helpPointA); + this._boundingBoxTester.localTransform.transformPoint(this._helpPointB.x, this._helpPointB.y, this._helpPointB); this._pointA.visible = true; this._pointB.visible = true; this._pointA.offset.x = this._helpPointA.x; diff --git a/Phaser/Demos/out/CoreElement.js b/Phaser/Demos/out/CoreElement.js index e76dd8e8..5d028086 100644 --- a/Phaser/Demos/out/CoreElement.js +++ b/Phaser/Demos/out/CoreElement.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -13,39 +16,34 @@ var coreElement; (function (coreElement) { var Game = /** @class */ (function (_super) { __extends(Game, _super); - function Game(game) { - var _this = _super.call(this, game) || this; + function Game() { + var _this = _super.call(this, "CoreElement") || this; _this._left = false; _this._right = false; _this._bullets = []; - _this._resources.push("resource/mecha_1502b/mecha_1502b_ske.json", "resource/mecha_1502b/mecha_1502b_tex.json", "resource/mecha_1502b/mecha_1502b_tex.png", "resource/skin_1502b/skin_1502b_ske.json", "resource/skin_1502b/skin_1502b_tex.json", "resource/skin_1502b/skin_1502b_tex.png", "resource/weapon_1000/weapon_1000_ske.json", "resource/weapon_1000/weapon_1000_tex.json", "resource/weapon_1000/weapon_1000_tex.png"); return _this; } - Game.prototype._onStart = function () { - Game.GROUND = this.stageHeight * 0.5 - 150.0; + Game.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("mecha_1502b", "resource/mecha_1502b/mecha_1502b_tex.png", "resource/mecha_1502b/mecha_1502b_tex.json", "resource/mecha_1502b/mecha_1502b_ske.json"); + this.load.dragonbone("skin_1502b", "resource/skin_1502b/skin_1502b_tex.png", "resource/skin_1502b/skin_1502b_tex.json", "resource/skin_1502b/skin_1502b_ske.json"); + this.load.dragonbone("weapon_1000", "resource/weapon_1000/weapon_1000_tex.png", "resource/weapon_1000/weapon_1000_tex.json", "resource/weapon_1000/weapon_1000_ske.json"); + }; + Game.prototype.create = function () { + var _this = this; + _super.prototype.create.call(this); + Game.GROUND = this.cameras.main.height - 150.0; Game.instance = this; - // - this.inputEnabled = true; - this.events.onInputDown.add(this._inputDown, this); - this.events.onInputUp.add(this._inputUp, this); + this.input.on('pointerdown', function () { return _this._inputDown(); }); + this.input.on('pointerup', function () { return _this._inputUp(); }); document.addEventListener("keydown", this._keyHandler); document.addEventListener("keyup", this._keyHandler); - // this.createText("Press W/A/S/D to move. Press Q/E/SPACE to switch weapons and skin. Touch to aim and fire."); - // - var factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1502b/mecha_1502b_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/mecha_1502b/mecha_1502b_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/mecha_1502b/mecha_1502b_tex.png", true).base); - factory.parseDragonBonesData(this.game.cache.getItem("resource/skin_1502b/skin_1502b_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/skin_1502b/skin_1502b_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/skin_1502b/skin_1502b_tex.png", true).base); - factory.parseDragonBonesData(this.game.cache.getItem("resource/weapon_1000/weapon_1000_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/weapon_1000/weapon_1000_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/weapon_1000/weapon_1000_tex.png", true).base); - // - this._player = new Mecha(); + this._player = new Mecha(this); }; - Game.prototype.update = function () { + Game.prototype.update = function (time, delta) { if (this._player) { - this._player.aim(this.game.input.x - this.x, this.game.input.y - this.y); + this._player.aim(this.input.x, this.input.y); this._player.update(); } var i = this._bullets.length; @@ -124,7 +122,7 @@ var coreElement; }(BaseDemo)); coreElement.Game = Game; var Mecha = /** @class */ (function () { - function Mecha() { + function Mecha(scene) { this._isJumpingA = false; this._isSquating = false; this._isAttackingA = false; @@ -141,21 +139,24 @@ var coreElement; this._aimState = null; this._walkState = null; this._attackState = null; - this._target = new PIXI.Point(); - this._helpPoint = new PIXI.Point(); - this._armatureDisplay = dragonBones.PhaserFactory.factory.buildArmatureDisplay("mecha_1502b"); - this._armatureDisplay.x = 0.0; + this._target = new Phaser.Math.Vector2(); + this._helpPoint = new Phaser.Math.Vector2(); + this._helperMatrix = new Phaser.GameObjects.Components.TransformMatrix(); + this.scene = scene; + this.scene.add.dragonBones("skin_1502b"); + this.scene.add.dragonBones("weapon_1000"); + this._armatureDisplay = this.scene.add.armature("mecha_1502b", "mecha_1502b"); + this._armatureDisplay.x = this.scene.cameras.main.centerX; this._armatureDisplay.y = Game.GROUND; this._armature = this._armatureDisplay.armature; - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); + this._armature.eventDispatcher.addDBEventListener(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); + this._armature.eventDispatcher.addDBEventListener(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); + this._armature.eventDispatcher.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); // Get weapon childArmature. this._weaponL = this._armature.getSlot("weapon_l").childArmature; this._weaponR = this._armature.getSlot("weapon_r").childArmature; - this._weaponL.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); - this._weaponR.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); - Game.instance.addChild(this._armatureDisplay); + this._weaponL.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); this._updateAnimation(); } Mecha.prototype.move = function (dir) { @@ -187,29 +188,39 @@ var coreElement; this._isAttackingA = isAttacking; }; Mecha.prototype.switchWeaponL = function () { - this._weaponL.eventDispatcher.removeEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.eventDispatcher.removeDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); this._weaponLIndex++; this._weaponLIndex %= Mecha.WEAPON_L_LIST.length; var weaponName = Mecha.WEAPON_L_LIST[this._weaponLIndex]; - this._weaponL = dragonBones.PhaserFactory.factory.buildArmature(weaponName); + if (weaponName === "weapon_1502b_l" || weaponName === "weapon_1502b_r") { + this._weaponL = this.scene.dragonbone.factory.buildArmature(weaponName, "mecha_1502b"); + } + else { + this._weaponL = this.scene.dragonbone.factory.buildArmature(weaponName, "weapon_1000"); + } this._armature.getSlot("weapon_l").childArmature = this._weaponL; - this._weaponL.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); }; Mecha.prototype.switchWeaponR = function () { - this._weaponR.eventDispatcher.removeEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.eventDispatcher.removeDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); this._weaponRIndex++; this._weaponRIndex %= Mecha.WEAPON_R_LIST.length; var weaponName = Mecha.WEAPON_R_LIST[this._weaponRIndex]; - this._weaponR = dragonBones.PhaserFactory.factory.buildArmature(weaponName); + if (weaponName === "weapon_1502b_l" || weaponName === "weapon_1502b_r") { + this._weaponR = this.scene.dragonbone.factory.buildArmature(weaponName, "mecha_1502b"); + } + else { + this._weaponR = this.scene.dragonbone.factory.buildArmature(weaponName, "weapon_1000"); + } this._armature.getSlot("weapon_r").childArmature = this._weaponR; - this._weaponR.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); }; Mecha.prototype.switchSkin = function () { this._skinIndex++; this._skinIndex %= Mecha.SKINS.length; var skinName = Mecha.SKINS[this._skinIndex]; - var skinData = dragonBones.PhaserFactory.factory.getArmatureData(skinName).defaultSkin; - dragonBones.PhaserFactory.factory.replaceSkin(this._armature, skinData, false, ["weapon_l", "weapon_r"]); + var skinData = this.scene.dragonbone.factory.getArmatureData(skinName).defaultSkin; + this.scene.dragonbone.factory.replaceSkin(this._armature, skinData, false, ["weapon_l", "weapon_r"]); }; Mecha.prototype.aim = function (x, y) { this._target.x = x; @@ -252,17 +263,13 @@ var coreElement; }; Mecha.prototype._frameEventHandler = function (event) { if (event.name === "fire") { - this._helpPoint.x = event.bone.global.x; - this._helpPoint.y = event.bone.global.y; - var globalPoint = event.armature.display.toGlobal(this._helpPoint); - this._helpPoint.x = globalPoint.x - Game.instance.x; - this._helpPoint.y = globalPoint.y - Game.instance.y; + event.armature.display.getWorldTransformMatrix(this._helperMatrix).transformPoint(event.bone.global.x, event.bone.global.y, this._helpPoint); this._fire(this._helpPoint); } }; Mecha.prototype._fire = function (firePoint) { var radian = this._faceDir < 0 ? Math.PI - this._aimRadian : this._aimRadian; - var bullet = new Bullet("bullet_01", "fire_effect_01", radian + Math.random() * 0.02 - 0.01, 40, firePoint); + var bullet = new Bullet(this.scene, "bullet_01", "fire_effect_01", radian + Math.random() * 0.02 - 0.01, 40, firePoint); Game.instance.addBullet(bullet); }; Mecha.prototype._updateAnimation = function () { @@ -302,11 +309,13 @@ var coreElement; Mecha.prototype._updatePosition = function () { if (this._speedX !== 0.0) { this._armatureDisplay.x += this._speedX; - if (this._armatureDisplay.x < -Game.instance.stageWidth * 0.5) { - this._armatureDisplay.x = -Game.instance.stageWidth * 0.5; + var sw = this.scene.cameras.main.width; + var border = 20; + if (this._armatureDisplay.x < border) { + this._armatureDisplay.x = border; } - else if (this._armatureDisplay.x > Game.instance.stageWidth * 0.5) { - this._armatureDisplay.x = Game.instance.stageWidth * 0.5; + else if (this._armatureDisplay.x > sw - border) { + this._armatureDisplay.x = sw - border; } } if (this._speedY !== 0.0) { @@ -330,7 +339,7 @@ var coreElement; this._updateAnimation(); } } - var aimOffsetY = this._armature.getBone("chest").global.y * this._armatureDisplay.scale.y; + var aimOffsetY = this._armature.getBone("chest").global.y * this._armatureDisplay.scaleX; if (this._faceDir > 0) { this._aimRadian = Math.atan2(this._target.y - this._armatureDisplay.y - aimOffsetY, this._target.x - this._armatureDisplay.x); } @@ -383,43 +392,40 @@ var coreElement; return Mecha; }()); var Bullet = /** @class */ (function () { - function Bullet(armatureName, effectArmatureName, radian, speed, position) { + function Bullet(scene, armatureName, effectArmatureName, radian, speed, position) { this._speedX = 0.0; this._speedY = 0.0; this._effecDisplay = null; this._speedX = Math.cos(radian) * speed; this._speedY = Math.sin(radian) * speed; - this._armatureDisplay = dragonBones.PhaserFactory.factory.buildArmatureDisplay(armatureName); + this.scene = scene; + this._armatureDisplay = this.scene.add.armature(armatureName, "mecha_1502b"); this._armatureDisplay.x = position.x + Math.random() * 2 - 1; this._armatureDisplay.y = position.y + Math.random() * 2 - 1; this._armatureDisplay.rotation = radian; if (effectArmatureName !== null) { - this._effecDisplay = dragonBones.PhaserFactory.factory.buildArmatureDisplay(effectArmatureName); + this._effecDisplay = this.scene.add.armature(effectArmatureName, "mecha_1502b"); this._effecDisplay.rotation = radian; this._effecDisplay.x = this._armatureDisplay.x; this._effecDisplay.y = this._armatureDisplay.y; - this._effecDisplay.scale.x = 1.0 + Math.random() * 1.0; - this._effecDisplay.scale.y = 1.0 + Math.random() * 0.5; + this._effecDisplay.scaleX = 1.0 + Math.random() * 1.0; + this._effecDisplay.scaleY = 1.0 + Math.random() * 0.5; if (Math.random() < 0.5) { - this._effecDisplay.scale.y *= -1.0; + this._effecDisplay.scaleY *= -1.0; } - Game.instance.addChild(this._effecDisplay); this._effecDisplay.animation.play("idle"); } - Game.instance.addChild(this._armatureDisplay); this._armatureDisplay.animation.play("idle"); } Bullet.prototype.update = function () { this._armatureDisplay.x += this._speedX; this._armatureDisplay.y += this._speedY; - if (this._armatureDisplay.x < -Game.instance.stageWidth * 0.5 - 100.0 || this._armatureDisplay.x > Game.instance.stageWidth * 0.5 + 100.0 || - this._armatureDisplay.y < -Game.instance.stageHeight * 0.5 - 100.0 || this._armatureDisplay.y > Game.instance.stageHeight * 0.5 + 100.0) { - Game.instance.removeChild(this._armatureDisplay); - this._armatureDisplay.dispose(); - if (this._effecDisplay !== null) { - Game.instance.removeChild(this._effecDisplay); - this._effecDisplay.dispose(); - } + var cx = this.scene.cameras.main.width, cy = this.scene.cameras.main.height; + if (this._armatureDisplay.x < -cx - 100.0 || this._armatureDisplay.x > cx + 100.0 || + this._armatureDisplay.y < -cy * 0.5 - 100.0 || this._armatureDisplay.y > cy + 100.0) { + this._armatureDisplay.destroy(); + if (this._effecDisplay !== null) + this._effecDisplay.destroy(); return true; } return false; diff --git a/Phaser/Demos/out/DragHelper.js b/Phaser/Demos/out/DragHelper.js index 722783d3..83fece3e 100644 --- a/Phaser/Demos/out/DragHelper.js +++ b/Phaser/Demos/out/DragHelper.js @@ -1,33 +1,36 @@ "use strict"; var DragHelper = /** @class */ (function () { function DragHelper() { - this._helpPoint = new Phaser.Point(); - this._dragOffset = new Phaser.Point(); + this._helpPoint = new Phaser.Math.Vector2(); + this._dragOffset = new Phaser.Math.Vector2(); this._dragDisplayObject = null; } DragHelper.getInstance = function () { return DragHelper._instance; }; - DragHelper.prototype.enableDrag = function (displayObject) { - displayObject.inputEnabled = true; - displayObject.input.enableDrag(); - displayObject.events.onDragStart.add(this._dragStartHandler, this); - displayObject.events.onDragStop.add(this._dragStopHandler, this); + DragHelper.prototype.enableDrag = function (scene, displayObject) { + var _this = this; + scene.input.enable(displayObject); + scene.input.setDraggable(displayObject, true); + displayObject.on("dragstart", function (a, b, c) { _this._dragStartHandler(displayObject, a, b, c); }, this); + displayObject.on("dragend", this._dragStopHandler, this); }; - DragHelper.prototype.disableDrag = function (displayObject) { - displayObject.events.onDragStart.remove(this._dragStartHandler, this); - displayObject.events.onDragStop.remove(this._dragStopHandler, this); + DragHelper.prototype.disableDrag = function (scene, displayObject) { + scene.input.setDraggable(displayObject, false); + scene.input.disable(displayObject); + displayObject.off("dragstart", this._dragStartHandler, this); + displayObject.off("dragend", this._dragStopHandler, this); }; - DragHelper.prototype._dragStartHandler = function (displayObject, pointer) { + DragHelper.prototype._dragStartHandler = function (displayObject, pointer, dragX, dragY) { if (this._dragDisplayObject) { return; } this._dragDisplayObject = displayObject; - var armatureDisplay = this._dragDisplayObject.parent; + var armatureDisplay = this._dragDisplayObject.parentContainer; var bone = armatureDisplay.armature.getBoneByDisplay(this._dragDisplayObject); if (bone) { - this._helpPoint.x = pointer.clientX; - this._helpPoint.y = pointer.clientY; + this._helpPoint.x = pointer.x; + this._helpPoint.y = pointer.y; if (bone.offsetMode !== 2 /* Override */) { bone.offsetMode = 2 /* Override */; bone.offset.x = bone.global.x; @@ -35,25 +38,25 @@ var DragHelper = /** @class */ (function () { } this._dragOffset.x = bone.offset.x - this._helpPoint.x; this._dragOffset.y = bone.offset.y - this._helpPoint.y; - displayObject.events.onDragUpdate.add(this._dragHandler, this); + displayObject.on("pointermove", this._dragHandler, this); } }; - DragHelper.prototype._dragStopHandler = function (displayObject, pointer) { + DragHelper.prototype._dragStopHandler = function (pointer, dragX, dragY, dropped) { if (!this._dragDisplayObject) { return; } - displayObject.events.onDragUpdate.remove(this._dragHandler, this); + this._dragDisplayObject.off("pointermove", this._dragHandler, this); this._dragDisplayObject = null; }; - DragHelper.prototype._dragHandler = function (displayObject, pointer) { + DragHelper.prototype._dragHandler = function (pointer, localX, localY) { if (!this._dragDisplayObject) { return; } - var armatureDisplay = this._dragDisplayObject.parent; + var armatureDisplay = this._dragDisplayObject.parentContainer; var bone = armatureDisplay.armature.getBoneByDisplay(this._dragDisplayObject); if (bone) { - this._helpPoint.x = pointer.clientX; - this._helpPoint.y = pointer.clientY; + this._helpPoint.x = pointer.x; + this._helpPoint.y = pointer.y; bone.offset.x = this._helpPoint.x + this._dragOffset.x; bone.offset.y = this._helpPoint.y + this._dragOffset.y; bone.invalidUpdate(); diff --git a/Phaser/Demos/out/DragonBonesEvent.js b/Phaser/Demos/out/DragonBonesEvent.js index 4f0ac28e..589b5d0f 100644 --- a/Phaser/Demos/out/DragonBonesEvent.js +++ b/Phaser/Demos/out/DragonBonesEvent.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -11,34 +14,29 @@ var __extends = (this && this.__extends) || (function () { })(); var DragonBonesEvent = /** @class */ (function (_super) { __extends(DragonBonesEvent, _super); - function DragonBonesEvent(game) { - var _this = _super.call(this, game) || this; - _this._resources.push("resource/mecha_1004d/mecha_1004d_ske.json", "resource/mecha_1004d/mecha_1004d_tex.json", "resource/mecha_1004d/mecha_1004d_tex.png"); - return _this; + function DragonBonesEvent() { + return _super.call(this, "DragonBonesEvent") || this; } - DragonBonesEvent.prototype._onStart = function () { + DragonBonesEvent.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("mecha_1004d", "resource/mecha_1004d/mecha_1004d_tex.png", "resource/mecha_1004d/mecha_1004d_tex.json", "resource/mecha_1004d/mecha_1004d_ske.json"); + }; + DragonBonesEvent.prototype.create = function () { var _this = this; - var factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1004d/mecha_1004d_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/mecha_1004d/mecha_1004d_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/mecha_1004d/mecha_1004d_tex.png", true).base); - factory.soundEventManager.addDBEventListener(dragonBones.EventObject.SOUND_EVENT, this._soundEventHandler, this); - this._armatureDisplay = factory.buildArmatureDisplay("mecha_1004d"); + _super.prototype.create.call(this); + this._armatureDisplay = this.add.armature("mecha_1004d", "mecha_1004d"); this._armatureDisplay.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); this._armatureDisplay.animation.play("walk"); - this._armatureDisplay.x = 0.0; - this._armatureDisplay.y = 100.0; - this.addChild(this._armatureDisplay); + this._armatureDisplay.x = this.cameras.main.centerX; + this._armatureDisplay.y = this.cameras.main.centerY + 100.0; // - this.inputEnabled = true; - this.events.onInputDown.add(function () { + this.input.enabled = true; + this.input.on('pointerdown', function () { _this._armatureDisplay.animation.fadeIn("skill_03", 0.2); - }, this); + }); // this.createText("Touch to play animation."); }; - DragonBonesEvent.prototype._soundEventHandler = function (event) { - console.log(event.name); - }; DragonBonesEvent.prototype._animationEventHandler = function (event) { if (event.animationState.name === "skill_03") { this._armatureDisplay.animation.fadeIn("walk", 0.2); diff --git a/Phaser/Demos/out/HelloDragonBones.js b/Phaser/Demos/out/HelloDragonBones.js index bc3be91c..2b03b3cb 100644 --- a/Phaser/Demos/out/HelloDragonBones.js +++ b/Phaser/Demos/out/HelloDragonBones.js @@ -1,50 +1,32 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -/** - * How to use - * 1. Load data. - * - * 2. Parse data. - * factory.parseDragonBonesData(); - * factory.parseTextureAtlasData(); - * - * 3. Build armature. - * armatureDisplay = factory.buildArmatureDisplay("armatureName"); - * - * 4. Play animation. - * armatureDisplay.animation.play("animationName"); - * - * 5. Add armature to stage. - * addChild(armatureDisplay); - */ var HelloDragonBones = /** @class */ (function (_super) { __extends(HelloDragonBones, _super); - function HelloDragonBones(game) { - var _this = _super.call(this, game) || this; - _this._resources.push( - // "resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.json", - "resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin", "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json", "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png"); - return _this; + function HelloDragonBones() { + return _super.call(this, "HelloDragonBones") || this; } - HelloDragonBones.prototype._onStart = function () { - var factory = dragonBones.PhaserFactory.factory; - // factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.json", Phaser.Cache.JSON).data); - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin", Phaser.Cache.BINARY)); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png", true).base); - var armatureDisplay = factory.buildArmatureDisplay("mecha_1002_101d", "mecha_1002_101d_show"); + HelloDragonBones.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("mecha_1002_101d_show", "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png", "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json", "resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin", null, null, { responseType: "arraybuffer" }); + }; + HelloDragonBones.prototype.create = function () { + _super.prototype.create.call(this); + var armatureDisplay = this.add.armature("mecha_1002_101d", "mecha_1002_101d_show"); armatureDisplay.animation.play("idle"); - armatureDisplay.x = 0.0; - armatureDisplay.y = 200.0; - this.addChild(armatureDisplay); + armatureDisplay.x = this.cameras.main.centerX; + armatureDisplay.y = this.cameras.main.centerY + 200; }; return HelloDragonBones; }(BaseDemo)); diff --git a/Phaser/Demos/out/InverseKinematics.js b/Phaser/Demos/out/InverseKinematics.js index c74e1f94..2b3e9324 100644 --- a/Phaser/Demos/out/InverseKinematics.js +++ b/Phaser/Demos/out/InverseKinematics.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -11,24 +14,23 @@ var __extends = (this && this.__extends) || (function () { })(); var InverseKinematics = /** @class */ (function (_super) { __extends(InverseKinematics, _super); - function InverseKinematics(game) { - var _this = _super.call(this, game) || this; + function InverseKinematics() { + var _this = _super.call(this, "IKDemo") || this; _this._faceDir = 0; _this._aimRadian = 0.0; _this._offsetRotation = 0.0; - _this._target = new Phaser.Point(); - _this._resources.push("resource/mecha_1406/mecha_1406_ske.json", "resource/mecha_1406/mecha_1406_tex.json", "resource/mecha_1406/mecha_1406_tex.png", "resource/floor_board/floor_board_ske.json", "resource/floor_board/floor_board_tex.json", "resource/floor_board/floor_board_tex.png"); + _this._target = new Phaser.Math.Vector2(); return _this; } - InverseKinematics.prototype._onStart = function () { - var factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1406/mecha_1406_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/mecha_1406/mecha_1406_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/mecha_1406/mecha_1406_tex.png", true).base); - factory.parseDragonBonesData(this.game.cache.getItem("resource/floor_board/floor_board_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/floor_board/floor_board_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/floor_board/floor_board_tex.png", true).base); - // - this._armatureDisplay = factory.buildArmatureDisplay("mecha_1406"); - this._floorBoard = factory.buildArmatureDisplay("floor_board"); + InverseKinematics.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("mecha_1406", "resource/mecha_1406/mecha_1406_tex.png", "resource/mecha_1406/mecha_1406_tex.json", "resource/mecha_1406/mecha_1406_ske.json"); + this.load.dragonbone("floor_board", "resource/floor_board/floor_board_tex.png", "resource/floor_board/floor_board_tex.json", "resource/floor_board/floor_board_ske.json"); + }; + InverseKinematics.prototype.create = function () { + _super.prototype.create.call(this); + this._armatureDisplay = this.add.armature("mecha_1406", "mecha_1406"); + this._floorBoard = this.add.armature("floor_board", "floor_board"); // this._chestBone = this._armatureDisplay.armature.getBone("chest"); this._leftFootBone = this._armatureDisplay.armature.getBone("foot_l"); @@ -43,28 +45,26 @@ var InverseKinematics = /** @class */ (function (_super) { // this._floorBoard.animation.play("idle"); this._floorBoard.armature.getSlot("player").display = this._armatureDisplay; - this._floorBoard.x = 0.0; - this._floorBoard.y = 50.0; - this.addChild(this._floorBoard); + this._floorBoard.x = this.cameras.main.centerX; + this._floorBoard.y = this.cameras.main.centerY + 50.0; // - this.inputEnabled = true; - DragHelper.getInstance().enableDrag(this._floorBoard.armature.getSlot("circle").display); + DragHelper.getInstance().enableDrag(this, this._floorBoard.armature.getSlot("circle").display); // - this.createText("Touch to drag circle to modify IK bones."); + this.createText("Touch and drag the red circle to modify the IK bones."); }; - InverseKinematics.prototype.update = function () { + InverseKinematics.prototype.update = function (time, delta) { if (!this._floorBoard) { return; } - this._target.x = this.game.input.x - this.x; - this._target.y = this.game.input.y - this.y; + this._target.x = this.input.x - this.cameras.main.centerX; + this._target.y = this.input.y - this.cameras.main.centerY; this._updateAim(); this._updateFoot(); }; InverseKinematics.prototype._updateAim = function () { var positionX = this._floorBoard.x; var positionY = this._floorBoard.y; - var aimOffsetY = this._chestBone.global.y * this._floorBoard.scale.y; + var aimOffsetY = this._chestBone.global.y * this._floorBoard.scaleY; this._faceDir = this._target.x > 0.0 ? 1 : -1; this._armatureDisplay.armature.flipX = this._faceDir < 0; if (this._faceDir > 0) { diff --git a/Phaser/Demos/out/PerformanceTest.js b/Phaser/Demos/out/PerformanceTest.js index c637651b..d58958c9 100644 --- a/Phaser/Demos/out/PerformanceTest.js +++ b/Phaser/Demos/out/PerformanceTest.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -11,15 +14,34 @@ var __extends = (this && this.__extends) || (function () { })(); var PerformanceTest = /** @class */ (function (_super) { __extends(PerformanceTest, _super); - function PerformanceTest(game) { - var _this = _super.call(this, game) || this; + function PerformanceTest() { + var _this = _super.call(this, "PerformanceText") || this; _this._addingArmature = false; _this._removingArmature = false; _this._armatures = []; - _this._resources.push("resource/mecha_1406/mecha_1406_ske.dbbin", "resource/mecha_1406/mecha_1406_tex.json", "resource/mecha_1406/mecha_1406_tex.png"); return _this; } - PerformanceTest.prototype.update = function () { + PerformanceTest.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("mecha_1406", "resource/mecha_1406/mecha_1406_tex.png", "resource/mecha_1406/mecha_1406_tex.json", "resource/mecha_1406/mecha_1406_ske.dbbin", null, null, { responseType: "arraybuffer" }); + }; + PerformanceTest.prototype.create = function () { + var _this = this; + _super.prototype.create.call(this); + this.input.enabled = true; + this.input.on("pointerdown", function (p) { return _this._inputDown(p); }); + this.input.on("pointerup", function () { return _this._inputUp(); }); + this._text = this.createText("--"); + this._text.y = this.cameras.main.height - 80; + this._perfText = this.createText("--"); + this._perfText.y = this._text.y + this._text.height + 10; + for (var i = 0; i < 300; ++i) { + this._addArmature(); + } + this._resetPosition(); + this._updateText(); + }; + PerformanceTest.prototype.update = function (time, delta) { if (this._addingArmature) { for (var i = 0; i < 10; ++i) { this._addArmature(); @@ -34,21 +56,11 @@ var PerformanceTest = /** @class */ (function (_super) { this._resetPosition(); this._updateText(); } + var game = this.scene.systems.game; + this._perfText.setText("FPS:" + game.loop.actualFps.toFixed(1) + " (" + game.loop.minFps + "-" + game.loop.targetFps + ")"); }; - PerformanceTest.prototype._onStart = function () { - this.inputEnabled = true; - this.events.onInputDown.add(this._inputDown, this); - this.events.onInputUp.add(this._inputUp, this); - // - this._text = this.createText(""); - for (var i = 0; i < 300; ++i) { - this._addArmature(); - } - this._resetPosition(); - this._updateText(); - }; - PerformanceTest.prototype._inputDown = function (target, pointer) { - var touchRight = pointer.x > this.stageWidth * 0.5; + PerformanceTest.prototype._inputDown = function (pointer) { + var touchRight = pointer.x > this.cameras.main.centerX; this._addingArmature = touchRight; this._removingArmature = !touchRight; }; @@ -57,16 +69,10 @@ var PerformanceTest = /** @class */ (function (_super) { this._removingArmature = false; }; PerformanceTest.prototype._addArmature = function () { - var factory = dragonBones.PhaserFactory.factory; - if (this._armatures.length === 0) { - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1406/mecha_1406_ske.dbbin", Phaser.Cache.BINARY)); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/mecha_1406/mecha_1406_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/mecha_1406/mecha_1406_tex.png", true).base); - } - var armatureDisplay = factory.buildArmatureDisplay("mecha_1406"); + var armatureDisplay = this.add.armature("mecha_1406", "mecha_1406"); armatureDisplay.armature.cacheFrameRate = 24; armatureDisplay.animation.play("walk"); - armatureDisplay.scale.x = armatureDisplay.scale.y = 0.5; - this.addChild(armatureDisplay); + armatureDisplay.setScale(.5); this._armatures.push(armatureDisplay); }; PerformanceTest.prototype._removeArmature = function () { @@ -74,10 +80,9 @@ var PerformanceTest = /** @class */ (function (_super) { return; } var armatureDisplay = this._armatures.pop(); - this.removeChild(armatureDisplay); - armatureDisplay.dispose(); + armatureDisplay.destroy(); if (this._armatures.length === 0) { - dragonBones.PhaserFactory.factory.clear(true); + this.dragonbone.factory.clear(true); dragonBones.BaseObject.clearPool(); } }; @@ -90,23 +95,21 @@ var PerformanceTest = /** @class */ (function (_super) { var paddingT = 200; var paddingB = 100; var gapping = 90; - var stageWidth = this.stageWidth - paddingH * 2; + var stageHeight = this.cameras.main.height; + var stageWidth = this.cameras.main.width - paddingH * 2; var columnCount = Math.floor(stageWidth / gapping); - var paddingHModify = (this.stageWidth - columnCount * gapping) * 0.5; + var paddingHModify = (stageWidth - columnCount * gapping); var dX = stageWidth / columnCount; - var dY = (this.stageHeight - paddingT - paddingB) / Math.ceil(armatureCount / columnCount); + var dY = (stageHeight - paddingT - paddingB) / Math.ceil(armatureCount / columnCount); for (var i = 0, l = armatureCount; i < l; ++i) { var armatureDisplay = this._armatures[i]; var lineY = Math.floor(i / columnCount); - armatureDisplay.x = (i % columnCount) * dX + paddingHModify - this.stageWidth * 0.5; - armatureDisplay.y = lineY * dY + paddingT - this.stageHeight * 0.5; + armatureDisplay.x = (i % columnCount) * dX + paddingHModify + paddingH * .5; + armatureDisplay.y = lineY * dY + paddingT; } }; PerformanceTest.prototype._updateText = function () { - this._text.text = "Count: " + this._armatures.length + ". Touch screen left to decrease count / right to increase count."; - this._text.x = -this._text.width * 0.5; - this._text.y = this.stageHeight * 0.5 - 100; - this.addChild(this._text); + this._text.setText("Count: " + this._armatures.length + ". Touch screen left to decrease count / right to increase count."); }; return PerformanceTest; }(BaseDemo)); diff --git a/Phaser/Demos/out/ReplaceAnimation.js b/Phaser/Demos/out/ReplaceAnimation.js index b9fe22d1..eac83903 100644 --- a/Phaser/Demos/out/ReplaceAnimation.js +++ b/Phaser/Demos/out/ReplaceAnimation.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -11,42 +14,39 @@ var __extends = (this && this.__extends) || (function () { })(); var ReplaceAnimation = /** @class */ (function (_super) { __extends(ReplaceAnimation, _super); - function ReplaceAnimation(game) { - var _this = _super.call(this, game) || this; - _this._resources.push("resource/mecha_2903/mecha_2903_ske.json", "resource/mecha_2903/mecha_2903_tex.json", "resource/mecha_2903/mecha_2903_tex.png"); - return _this; + function ReplaceAnimation() { + return _super.call(this, "ReplaceAnimation") || this; } - ReplaceAnimation.prototype._onStart = function () { + ReplaceAnimation.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("mecha_2903", "resource/mecha_2903/mecha_2903_tex.png", "resource/mecha_2903/mecha_2903_tex.json", "resource/mecha_2903/mecha_2903_ske.json"); + }; + ReplaceAnimation.prototype.create = function () { var _this = this; - var factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_2903/mecha_2903_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/mecha_2903/mecha_2903_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/mecha_2903/mecha_2903_tex.png", true).base); - this._armatureDisplayA = factory.buildArmatureDisplay("mecha_2903"); - this._armatureDisplayB = factory.buildArmatureDisplay("mecha_2903b"); - this._armatureDisplayC = factory.buildArmatureDisplay("mecha_2903c"); - this._armatureDisplayD = factory.buildArmatureDisplay("mecha_2903d"); + _super.prototype.create.call(this); + this._armatureDisplayA = this.add.armature("mecha_2903", "mecha_2903"); + this._armatureDisplayB = this.add.armature("mecha_2903b", "mecha_2903"); + this._armatureDisplayC = this.add.armature("mecha_2903c", "mecha_2903"); + this._armatureDisplayD = this.add.armature("mecha_2903d", "mecha_2903"); + var factory = this.dragonbone.factory; var sourceArmatureData = factory.getArmatureData("mecha_2903d"); factory.replaceAnimation(this._armatureDisplayA.armature, sourceArmatureData); factory.replaceAnimation(this._armatureDisplayB.armature, sourceArmatureData); factory.replaceAnimation(this._armatureDisplayC.armature, sourceArmatureData); - this.addChild(this._armatureDisplayD); - this.addChild(this._armatureDisplayA); - this.addChild(this._armatureDisplayB); - this.addChild(this._armatureDisplayC); - this._armatureDisplayA.x = 0.0 - 350.0; - this._armatureDisplayA.y = 0.0 + 150.0; - this._armatureDisplayB.x = 0.0; - this._armatureDisplayB.y = 0.0 + 150.0; - this._armatureDisplayC.x = 0.0 + 350.0; - this._armatureDisplayC.y = 0.0 + 150.0; - this._armatureDisplayD.x = 0.0; - this._armatureDisplayD.y = 0.0 - 50.0; - // - this.inputEnabled = true; - this.events.onInputDown.add(function () { + var cx = this.cameras.main.centerX; + var cy = this.cameras.main.centerY; + this._armatureDisplayA.x = cx - 350.0; + this._armatureDisplayA.y = cy + 150.0; + this._armatureDisplayB.x = cx; + this._armatureDisplayB.y = cy + 150.0; + this._armatureDisplayC.x = cx + 350.0; + this._armatureDisplayC.y = cy + 150.0; + this._armatureDisplayD.x = cx; + this._armatureDisplayD.y = cy - 50.0; + this.input.enabled = true; + this.input.on('pointerdown', function () { _this._changeAnimation(); }); - // this.createText("Touch to change animation."); }; ReplaceAnimation.prototype._changeAnimation = function () { diff --git a/Phaser/Demos/out/ReplaceSlotDisplay.js b/Phaser/Demos/out/ReplaceSlotDisplay.js index 4ea0a46e..684c7502 100644 --- a/Phaser/Demos/out/ReplaceSlotDisplay.js +++ b/Phaser/Demos/out/ReplaceSlotDisplay.js @@ -1,8 +1,11 @@ "use strict"; var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } @@ -11,50 +14,48 @@ var __extends = (this && this.__extends) || (function () { })(); var ReplaceSlotDisplay = /** @class */ (function (_super) { __extends(ReplaceSlotDisplay, _super); - function ReplaceSlotDisplay(game) { - var _this = _super.call(this, game) || this; + function ReplaceSlotDisplay() { + var _this = _super.call(this, "ReplaceSlotDisplay") || this; _this._leftWeaponIndex = 0; _this._rightWeaponIndex = 0; - _this._factory = dragonBones.PhaserFactory.factory; - _this._resources.push("resource/mecha_1004d_show/mecha_1004d_show_ske.json", "resource/mecha_1004d_show/mecha_1004d_show_tex.json", "resource/mecha_1004d_show/mecha_1004d_show_tex.png", "resource/weapon_1004_show/weapon_1004_show_ske.json", "resource/weapon_1004_show/weapon_1004_show_tex.json", "resource/weapon_1004_show/weapon_1004_show_tex.png"); + _this._factory = null; return _this; } - ReplaceSlotDisplay.prototype._onStart = function () { + ReplaceSlotDisplay.prototype.preload = function () { + _super.prototype.preload.call(this); + this.load.dragonbone("mecha_1004d", "resource/mecha_1004d_show/mecha_1004d_show_tex.png", "resource/mecha_1004d_show/mecha_1004d_show_tex.json", "resource/mecha_1004d_show/mecha_1004d_show_ske.json"); + this.load.dragonbone("weapon_1004", "resource/weapon_1004_show/weapon_1004_show_tex.png", "resource/weapon_1004_show/weapon_1004_show_tex.json", "resource/weapon_1004_show/weapon_1004_show_ske.json"); + }; + ReplaceSlotDisplay.prototype.create = function () { var _this = this; - this._factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1004d_show/mecha_1004d_show_ske.json", Phaser.Cache.JSON).data); - this._factory.parseTextureAtlasData(this.game.cache.getItem("resource/mecha_1004d_show/mecha_1004d_show_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/mecha_1004d_show/mecha_1004d_show_tex.png", true).base); - this._factory.parseDragonBonesData(this.game.cache.getItem("resource/weapon_1004_show/weapon_1004_show_ske.json", Phaser.Cache.JSON).data); - this._factory.parseTextureAtlasData(this.game.cache.getItem("resource/weapon_1004_show/weapon_1004_show_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/weapon_1004_show/weapon_1004_show_tex.png", true).base); - // - this._armatureDisplay = this._factory.buildArmatureDisplay("mecha_1004d"); + _super.prototype.create.call(this); + this._factory = this.dragonbone.factory; + this._armatureDisplay = this.add.armature("mecha_1004d", "mecha_1004d"); this._armatureDisplay.animation.play(); + // Dragonbones data will be finded only when add.armature called, this makes replaceSlotDisplay work + this.add.armature("weapon", "weapon_1004"); // - this._armatureDisplay.x = 100.0; - this._armatureDisplay.y = 200.0; - this.addChild(this._armatureDisplay); + this._armatureDisplay.x = this.cameras.main.centerX + 100.0; + this._armatureDisplay.y = this.cameras.main.centerY + 200.0; // - this.inputEnabled = true; - this.events.onInputDown.add(function () { - var localX = _this.game.input.x - _this.x; - if (localX < -150.0) { + this.input.on('pointerdown', function () { + var localX = _this.input.x - _this._armatureDisplay.x; + if (localX < -150.0) _this._replaceDisplay(-1); - } - else if (localX > 150.0) { + else if (localX > 150.0) _this._replaceDisplay(1); - } - else { + else _this._replaceDisplay(0); - } - }, this); + }); // - this.createText("Touch screen left / center / right to relace slot display."); + this.createText("Touch screen left / center / right to replace slot display."); }; ReplaceSlotDisplay.prototype._replaceDisplay = function (type) { if (type === -1) { this._rightWeaponIndex++; this._rightWeaponIndex %= ReplaceSlotDisplay.WEAPON_RIGHT_LIST.length; var displayName = ReplaceSlotDisplay.WEAPON_RIGHT_LIST[this._rightWeaponIndex]; - this._factory.replaceSlotDisplay("weapon_1004_show", "weapon", "weapon_r", displayName, this._armatureDisplay.armature.getSlot("weapon_hand_r")); + this._factory.replaceSlotDisplay("weapon_1004", "weapon", "weapon_r", displayName, this._armatureDisplay.armature.getSlot("weapon_hand_r")); } else if (type === 1) { this._leftWeaponIndex++; @@ -68,10 +69,12 @@ var ReplaceSlotDisplay = /** @class */ (function (_super) { } else { if (!this._logoText) { - var style = { font: "14px", fill: "#FFFFFF", align: "center" }; - this._logoText = this.game.add.text(0.0, 0.0, "Core Element", style); - this._logoText.pivot.x = this._logoText.width * 0.5; - this._logoText.pivot.y = this._logoText.height * 0.5; + // mix skew component into Text class (also if you want to use some customized display object you must mix skew component into it, too) + dragonBones.phaser.util.extendSkew(Phaser.GameObjects.Text); + var style = { fontSize: 30, color: "#FFFFFF", align: "center" }; + this._logoText = this.add.text(0.0, 0.0, "Core Element", style); + this._logoText.setPipeline("PhaserTextureTintPipeline"); // and use this customized pipeline to support skew + this._logoText.setOrigin(.5, .5); } logoSlot.display = this._logoText; } diff --git a/Phaser/Demos/out/SetBoneOffset.js b/Phaser/Demos/out/SetBoneOffset.js deleted file mode 100644 index 1d477d7c..00000000 --- a/Phaser/Demos/out/SetBoneOffset.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var SetBoneOffset = (function (_super) { - __extends(SetBoneOffset, _super); - function SetBoneOffset(game) { - var _this = _super.call(this, game) || this; - _this._resources.push("resource/assets/effect_ske.json", "resource/assets/effect_tex.json", "resource/assets/effect_tex.png"); - return _this; - } - SetBoneOffset.prototype._onStart = function () { - var factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/assets/effect_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData(this.game.cache.getItem("resource/assets/effect_tex.json", Phaser.Cache.JSON).data, this.game.cache.getImage("resource/assets/effect_tex.png", true).base); - for (var i = 0; i < 100; ++i) { - var armatureDisplay = factory.buildArmatureDisplay("effect"); - armatureDisplay.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationHandler, this); - this._moveTo(armatureDisplay); - this.addChild(armatureDisplay); - } - }; - SetBoneOffset.prototype._animationHandler = function (event) { - this._moveTo(event.armature.display); - }; - SetBoneOffset.prototype._moveTo = function (armatureDisplay) { - var fromX = Math.random() * this.stageWidth; - var fromY = Math.random() * this.stageHeight; - var toX = Math.random() * this.stageWidth; - var toY = Math.random() * this.stageHeight; - var dX = toX - fromX; - var dY = toY - fromY; - var rootSlot = armatureDisplay.armature.getBone("root"); - var effectSlot = armatureDisplay.armature.getBone("effect"); - // Modify root and effect bone offset. - rootSlot.offset.scaleX = Math.sqrt(dX * dX + dY * dY) / 100; // Effect translate distance is 100 px. - rootSlot.offset.rotation = Math.atan2(dY, dX); - rootSlot.offset.skew = Math.random() * Math.PI - Math.PI * 0.5; // Random skew. - effectSlot.offset.scaleX = 0.5 + Math.random() * 0.5; // Random scale. - effectSlot.offset.scaleY = 0.5 + Math.random() * 0.5; - // Update root and effect bone. - rootSlot.invalidUpdate(); - effectSlot.invalidUpdate(); - // - armatureDisplay.x = fromX; - armatureDisplay.y = fromY; - armatureDisplay.animation.timeScale = 0.5 + Math.random() * 1.0; // Random animation speed. - armatureDisplay.animation.play("idle", 1); - }; - return SetBoneOffset; -}(BaseTest)); diff --git a/Phaser/Demos/package.json b/Phaser/Demos/package.json index 9c7e3af7..7464f96c 100644 --- a/Phaser/Demos/package.json +++ b/Phaser/Demos/package.json @@ -3,7 +3,8 @@ "version": "5.6.2", "main": "", "scripts": { - "start": "tsc & copyfiles -u 3 -s ../2.x/out/* libs/dragonBones/ & anywhere", + "start": "tsc & npm run copyVer3 & anywhere", + "copyVer3": "copyfiles -u 3 ../3.x/out/* libs/dragonBones/", "upgradeA": "cd .. & cd 2.x & npm run build & cd .. & cd Demos", "upgradeB": "copyfiles -u 3 ../2.x/out/* libs/dragonBones/", "upgrade": "npm run upgradeA & npm run upgradeB", @@ -14,4 +15,4 @@ "copyfiles": "^1.2.0", "typescript": "^2.4.2" } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/AnimationBase.ts b/Phaser/Demos/src/AnimationBase.ts index f027eae6..25b7171c 100644 --- a/Phaser/Demos/src/AnimationBase.ts +++ b/Phaser/Demos/src/AnimationBase.ts @@ -1,29 +1,27 @@ class AnimationBase extends BaseDemo { - private _armatureDisplay: dragonBones.PhaserArmatureDisplay; + private _armatureDisplay: dragonBones.phaser.display.ArmatureDisplay; - public constructor(game: Phaser.Game) { - super(game); + public constructor() { + super("AnimationBase"); + } + + preload(): void { + super.preload(); - this._resources.push( - "resource/progress_bar/progress_bar_ske.json", + this.load.dragonbone( + "progress_bar", + "resource/progress_bar/progress_bar_tex.png", "resource/progress_bar/progress_bar_tex.json", - "resource/progress_bar/progress_bar_tex.png" + "resource/progress_bar/progress_bar_ske.json" ); } - protected _onStart(): void { - const factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/progress_bar/progress_bar_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/progress_bar/progress_bar_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/progress_bar/progress_bar_tex.png", true) as any).base - ); - // - this._armatureDisplay = factory.buildArmatureDisplay("progress_bar"); - this._armatureDisplay.x = 0.0; - this._armatureDisplay.y = 0.0; - this.addChild(this._armatureDisplay); - // Add animation event listener. + create(): void { + super.create(); + + this._armatureDisplay = this.add.armature("progress_bar", "progress_bar"); + this._armatureDisplay.x = this.cameras.main.centerX; + this._armatureDisplay.y = this.cameras.main.centerY; this._armatureDisplay.addDBEventListener(dragonBones.EventObject.START, this._animationEventHandler, this); this._armatureDisplay.addDBEventListener(dragonBones.EventObject.LOOP_COMPLETE, this._animationEventHandler, this); this._armatureDisplay.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); @@ -33,18 +31,18 @@ class AnimationBase extends BaseDemo { this._armatureDisplay.addDBEventListener(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); this._armatureDisplay.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._animationEventHandler, this); this._armatureDisplay.animation.play("idle"); - // - this.inputEnabled = true; - this.events.onInputDown.add(this._inputDown, this); - this.events.onInputUp.add(this._inputUp, this); - // + + this.input.enabled = true; + this.input.on('pointerdown', () => this._inputDown()); + this.input.on('pointerup', () => this._inputUp()); + this.createText("Touch to control animation play progress."); } private _isTouched: boolean = false; private _inputDown(): void { - const progress = Math.min(Math.max((this.game.input.x - this.x + 300.0) / 600.0, 0.0), 1.0); + const progress = Phaser.Math.Clamp((this.input.x - this._armatureDisplay.x + 300.0) / 600.0, 0.0, 1.0); this._isTouched = true; this._armatureDisplay.animation.gotoAndStopByProgress("idle", progress); } @@ -56,7 +54,7 @@ class AnimationBase extends BaseDemo { public update(): void { if (this._isTouched) { - const progress = Math.min(Math.max((this.game.input.x - this.x + 300.0) / 600.0, 0.0), 1.0); + const progress = Phaser.Math.Clamp((this.input.x - this._armatureDisplay.x + 300.0) / 600.0, 0.0, 1.0); const animationState = this._armatureDisplay.animation.getState("idle"); animationState.currentTime = animationState.totalTime * progress; } @@ -65,4 +63,4 @@ class AnimationBase extends BaseDemo { private _animationEventHandler(event: dragonBones.EventObject): void { console.log(event.animationState.name, event.type, event.name); } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/AnimationLayer.ts b/Phaser/Demos/src/AnimationLayer.ts index 92740c40..50be25a6 100644 --- a/Phaser/Demos/src/AnimationLayer.ts +++ b/Phaser/Demos/src/AnimationLayer.ts @@ -1,31 +1,28 @@ class AnimationLayer extends BaseDemo { - private _armatureDisplay: dragonBones.PhaserArmatureDisplay; + private _armatureDisplay: dragonBones.phaser.display.ArmatureDisplay; - public constructor(game: Phaser.Game) { - super(game); + public constructor() { + super("AnimationLayer"); + } - this._resources.push( - "resource/mecha_1004d/mecha_1004d_ske.json", + preload(): void { + super.preload(); + this.load.dragonbone( + "mecha_1004d", + "resource/mecha_1004d/mecha_1004d_tex.png", "resource/mecha_1004d/mecha_1004d_tex.json", - "resource/mecha_1004d/mecha_1004d_tex.png" + "resource/mecha_1004d/mecha_1004d_ske.json" ); } - protected _onStart(): void { - const factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1004d/mecha_1004d_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/mecha_1004d/mecha_1004d_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/mecha_1004d/mecha_1004d_tex.png", true) as any).base - ); - - this._armatureDisplay = factory.buildArmatureDisplay("mecha_1004d"); + create(): void { + super.create(); + this._armatureDisplay = this.add.armature("mecha_1004d", "mecha_1004d"); this._armatureDisplay.addDBEventListener(dragonBones.EventObject.LOOP_COMPLETE, this._animationEventHandler, this); this._armatureDisplay.animation.play("walk"); - this._armatureDisplay.x = 0.0; - this._armatureDisplay.y = 100.0; - this.addChild(this._armatureDisplay); + this._armatureDisplay.x = this.cameras.main.centerX; + this._armatureDisplay.y = this.cameras.main.centerY + 100.0; } private _animationEventHandler(event: dragonBones.EventObject): void { @@ -39,4 +36,4 @@ class AnimationLayer extends BaseDemo { attackState.addBoneMask("effect_r"); } } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/BaseDemo.ts b/Phaser/Demos/src/BaseDemo.ts index 5b5e365c..5dc13aff 100644 --- a/Phaser/Demos/src/BaseDemo.ts +++ b/Phaser/Demos/src/BaseDemo.ts @@ -1,68 +1,20 @@ -abstract class BaseDemo extends Phaser.Sprite { - private static BACKGROUND_URL: string = "resource/background.png"; - private _background: Phaser.Sprite; - protected readonly _resources: string[] = []; - - public constructor(game: Phaser.Game) { - super(game, 0.0, 0.0); - - this._resources.push(BaseDemo.BACKGROUND_URL); +class BaseDemo extends Phaser.Scene { - setTimeout(() => { - this.x = this.stageWidth * 0.5; - this.y = this.stageHeight * 0.5; - this._loadResources(); - }, 10); + private static BACKGROUND_URL: string = "resource/background.png"; + + preload(): void { + this.load.image(BaseDemo.BACKGROUND_URL, BaseDemo.BACKGROUND_URL); } - protected abstract _onStart(): void; - - protected _loadResources(): void { - let loadCount = 0; - for (const resource of this._resources) { - if (resource.indexOf("dbbin") > 0) { - this.game.load.binary(resource, resource); - } - else if (resource.indexOf("png") > 0) { - this.game.load.image(resource, resource); - } - else { - this.game.load.json(resource, resource); - } - loadCount++; - } - - this.game.load.onFileComplete.add(() => { - loadCount--; - if (loadCount === 0) { - const texture = new PIXI.Texture((this.game.cache.getImage(BaseDemo.BACKGROUND_URL, true) as any).base); - this._background = new Phaser.Sprite(this.game, 0.0, 0.0, texture); - this._background.x = -this._background.texture.width * 0.5; - this._background.y = -this._background.texture.height * 0.5; - this.addChild(this._background); - // - this._onStart(); - } - }); - this.game.load.start(); + create(): void { + this.add.image(0, 0, BaseDemo.BACKGROUND_URL); } - public createText(string: string): Phaser.Text { - const style = { font: "14px", fill: "#FFFFFF", align: "center" }; - const text = this.game.add.text(0.0, 0.0, string, style); - text.x = - text.width * 0.5; - text.y = this.stageHeight * 0.5 - 100; - this.addChild(text); - + public createText(str: string): Phaser.GameObjects.Text { + const style = { fontSize: 18, color: "#FFFFFF", align: "center" }; + const text = this.add.text(this.cameras.main.centerX, this.cameras.main.height - 100, str, style); + text.setOrigin(.5, .5); return text; } - - public get stageWidth(): number { - return this.game.width; - } - - public get stageHeight(): number { - return this.game.height; - } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/BoneOffset.ts b/Phaser/Demos/src/BoneOffset.ts index ee8a589f..bc065112 100644 --- a/Phaser/Demos/src/BoneOffset.ts +++ b/Phaser/Demos/src/BoneOffset.ts @@ -1,29 +1,28 @@ class BoneOffset extends BaseDemo { - public constructor(game: Phaser.Game) { - super(game); + public constructor() { + super("BoneOffset"); + } - this._resources.push( - "resource/bullet_01/bullet_01_ske.json", + preload(): void { + super.preload(); + this.load.dragonbone( + "bullet_01", + "resource/bullet_01/bullet_01_tex.png", "resource/bullet_01/bullet_01_tex.json", - "resource/bullet_01/bullet_01_tex.png" + "resource/bullet_01/bullet_01_ske.json", ); } - protected _onStart(): void { - const factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/bullet_01/bullet_01_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/bullet_01/bullet_01_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/bullet_01/bullet_01_tex.png", true) as any).base - ); + create(): void { + super.create(); for (let i = 0; i < 100; ++i) { - const armatureDisplay = factory.buildArmatureDisplay("bullet_01"); + const armatureDisplay = this.add.armature("bullet_01", "bullet_01"); armatureDisplay.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationHandler, this); - armatureDisplay.x = 0.0; - armatureDisplay.y = 0.0; - this.addChild(armatureDisplay); - // + armatureDisplay.x = 0; + armatureDisplay.y = 0; + this.cameras.main.centerOn(armatureDisplay.x, armatureDisplay.y); + this._moveTo(armatureDisplay); } } @@ -32,11 +31,12 @@ class BoneOffset extends BaseDemo { this._moveTo(event.armature.display); } - private _moveTo(armatureDisplay: dragonBones.PhaserArmatureDisplay): void { + private _moveTo(armatureDisplay: dragonBones.phaser.display.ArmatureDisplay): void { const fromX = armatureDisplay.x; const fromY = armatureDisplay.y; - const toX = Math.random() * this.stageWidth - this.stageWidth * 0.5; - const toY = Math.random() * this.stageHeight - this.stageHeight * 0.5; + const camera = this.cameras.main; + const toX = Math.random() * camera.width - camera.centerX; + const toY = Math.random() * camera.height - camera.centerY; const dX = toX - fromX; const dY = toY - fromY; const rootSlot = armatureDisplay.armature.getBone("root"); @@ -56,4 +56,4 @@ class BoneOffset extends BaseDemo { armatureDisplay.animation.timeScale = 0.5 + Math.random() * 1.0; // Random animation speed. armatureDisplay.animation.play("idle", 1); } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/BoundingBox.ts b/Phaser/Demos/src/BoundingBox.ts index ef2c73de..725ead2a 100644 --- a/Phaser/Demos/src/BoundingBox.ts +++ b/Phaser/Demos/src/BoundingBox.ts @@ -1,55 +1,56 @@ class BoundingBox extends BaseDemo { - private readonly _helpPointA: Phaser.Point = new Phaser.Point(); - private readonly _helpPointB: Phaser.Point = new Phaser.Point(); - private readonly _helpPointC: Phaser.Point = new Phaser.Point(); - - private _armatureDisplay: dragonBones.PhaserArmatureDisplay; - private _boundingBoxTester: dragonBones.PhaserArmatureDisplay; - private _targetA: dragonBones.PhaserArmatureDisplay; - private _targetB: dragonBones.PhaserArmatureDisplay; + private readonly _helpPointA: Phaser.Math.Vector2 = new Phaser.Math.Vector2(); + private readonly _helpPointB: Phaser.Math.Vector2 = new Phaser.Math.Vector2(); + private readonly _helpPointC: Phaser.Math.Vector2 = new Phaser.Math.Vector2(); + private _helperMatrix: Phaser.GameObjects.Components.TransformMatrix = new Phaser.GameObjects.Components.TransformMatrix(); + + private _armatureDisplay: dragonBones.phaser.display.ArmatureDisplay; + private _boundingBoxTester: dragonBones.phaser.display.ArmatureDisplay; + private _targetA: dragonBones.phaser.display.ArmatureDisplay; + private _targetB: dragonBones.phaser.display.ArmatureDisplay; private _line: dragonBones.Bone; private _pointA: dragonBones.Bone; private _pointB: dragonBones.Bone; - public constructor(game: Phaser.Game) { - super(game); + public constructor() { + super("BoundingBox"); + } - this._resources.push( - "resource/mecha_2903/mecha_2903_ske.json", - "resource/mecha_2903/mecha_2903_tex.json", + preload(): void { + super.preload(); + this.load.dragonbone( + "mecha_2903d", "resource/mecha_2903/mecha_2903_tex.png", - "resource/bounding_box_tester/bounding_box_tester_ske.json", + "resource/mecha_2903/mecha_2903_tex.json", + "resource/mecha_2903/mecha_2903_ske.json" + ); + this.load.dragonbone( + "tester", + "resource/bounding_box_tester/bounding_box_tester_tex.png", "resource/bounding_box_tester/bounding_box_tester_tex.json", - "resource/bounding_box_tester/bounding_box_tester_tex.png" + "resource/bounding_box_tester/bounding_box_tester_ske.json" ); } - protected _onStart(): void { - const factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_2903/mecha_2903_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/mecha_2903/mecha_2903_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/mecha_2903/mecha_2903_tex.png", true) as any).base - ); - factory.parseDragonBonesData(this.game.cache.getItem("resource/bounding_box_tester/bounding_box_tester_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/bounding_box_tester/bounding_box_tester_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/bounding_box_tester/bounding_box_tester_tex.png", true) as any).base - ); - // - this._armatureDisplay = factory.buildArmatureDisplay("mecha_2903d"); - this._boundingBoxTester = factory.buildArmatureDisplay("tester"); + create(): void { + super.create(); + + this._armatureDisplay = this.add.armature("mecha_2903d", "mecha_2903d"); + this._boundingBoxTester = this.add.armature("tester", "tester"); this._targetA = this._boundingBoxTester.armature.getSlot("target_a").display; this._targetB = this._boundingBoxTester.armature.getSlot("target_b").display; this._line = this._boundingBoxTester.armature.getBone("line"); this._pointA = this._boundingBoxTester.armature.getBone("point_a"); this._pointB = this._boundingBoxTester.armature.getBone("point_b"); - // + + const cx = this.cameras.main.centerX; + const cy = this.cameras.main.centerY; + this._armatureDisplay.debugDraw = true; - this._armatureDisplay.x = 0.0; - this._armatureDisplay.y = 100.0; - this._boundingBoxTester.x = 0.0; - this._boundingBoxTester.y = 200.0; + this._armatureDisplay.x = cx; + this._armatureDisplay.y = cy + 100.0; + this._boundingBoxTester.x = cx; + this._boundingBoxTester.y = cy + 200.0; this._targetA.armature.inheritAnimation = false; this._targetB.armature.inheritAnimation = false; this._line.offsetMode = dragonBones.OffsetMode.Override; @@ -57,26 +58,26 @@ class BoundingBox extends BaseDemo { this._pointB.offsetMode = dragonBones.OffsetMode.Override; this._armatureDisplay.animation.play("walk"); this._boundingBoxTester.animation.play("0"); - // - this.addChild(this._armatureDisplay); - this.addChild(this._boundingBoxTester); - // - this.inputEnabled = true; - DragHelper.getInstance().enableDrag(this._targetA); - DragHelper.getInstance().enableDrag(this._targetB); - // + + const bA = this._targetA.getAt(0) as Phaser.GameObjects.Image; + const bB = this._targetB.getAt(0) as Phaser.GameObjects.Image; + this._targetA.setSize(bA.displayWidth, bA.displayHeight); + DragHelper.getInstance().enableDrag(this, this._targetA); + this._targetB.setSize(bB.displayWidth, bB.displayHeight); + DragHelper.getInstance().enableDrag(this, this._targetB); + this.createText("Touch to drag bounding box tester."); } - public update(): void { - if (!this._armatureDisplay) { + update(time: number, delta: number): void { + if (!this._armatureDisplay) return; - } - this._helpPointA.set(this._targetA.x, this._targetA.y); - this._helpPointB.set(this._targetB.x, this._targetB.y); - this._helpPointA.copyFrom(this._armatureDisplay.toLocal(this._helpPointA, this._boundingBoxTester) as any); - this._helpPointB.copyFrom(this._armatureDisplay.toLocal(this._helpPointB, this._boundingBoxTester) as any); + this._boundingBoxTester.getWorldTransformMatrix(this._helperMatrix); + this._helperMatrix.transformPoint(this._targetA.x, this._targetA.y, this._helpPointA); + this._helperMatrix.transformPoint(this._targetB.x, this._targetB.y, this._helpPointB); + this._armatureDisplay.localTransform.transformPoint(this._helpPointA.x, this._helpPointA.y, this._helpPointA); + this._armatureDisplay.localTransform.transformPoint(this._helpPointB.x, this._helpPointB.y, this._helpPointB); const containsSlotA = this._armatureDisplay.armature.containsPoint(this._helpPointA.x, this._helpPointA.y); const containsSlotB = this._armatureDisplay.armature.containsPoint(this._helpPointB.x, this._helpPointB.y); @@ -113,8 +114,12 @@ class BoundingBox extends BaseDemo { } if (intersectsSlots) { - this._helpPointA.copyFrom(this._boundingBoxTester.toLocal(this._helpPointA, this._armatureDisplay) as any); - this._helpPointB.copyFrom(this._boundingBoxTester.toLocal(this._helpPointB, this._armatureDisplay) as any); + console.log("INSECT"); + this._armatureDisplay.getWorldTransformMatrix(this._helperMatrix); + this._helperMatrix.transformPoint(this._helpPointA.x, this._helpPointA.y, this._helpPointA); + this._helperMatrix.transformPoint(this._helpPointB.x, this._helpPointB.y, this._helpPointB); + this._boundingBoxTester.localTransform.transformPoint(this._helpPointA.x, this._helpPointA.y, this._helpPointA); + this._boundingBoxTester.localTransform.transformPoint(this._helpPointB.x, this._helpPointB.y, this._helpPointB); this._pointA.visible = true; this._pointB.visible = true; @@ -133,4 +138,4 @@ class BoundingBox extends BaseDemo { } } } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/CoreElement.ts b/Phaser/Demos/src/CoreElement.ts index fb8ede3d..7d50f552 100644 --- a/Phaser/Demos/src/CoreElement.ts +++ b/Phaser/Demos/src/CoreElement.ts @@ -1,6 +1,6 @@ namespace coreElement { - type PointType = PIXI.Point; - type ArmatureDisplayType = dragonBones.PhaserArmatureDisplay; + type PointType = Phaser.Math.Vector2; + type ArmatureDisplayType = dragonBones.phaser.display.ArmatureDisplay; type EventType = dragonBones.EventObject; export class Game extends BaseDemo { @@ -11,59 +11,39 @@ namespace coreElement { private _left: boolean = false; private _right: boolean = false; private _player: Mecha; - private readonly _bullets: Array = []; - - public constructor(game: Phaser.Game) { - super(game); - - this._resources.push( - "resource/mecha_1502b/mecha_1502b_ske.json", - "resource/mecha_1502b/mecha_1502b_tex.json", - "resource/mecha_1502b/mecha_1502b_tex.png", - "resource/skin_1502b/skin_1502b_ske.json", - "resource/skin_1502b/skin_1502b_tex.json", - "resource/skin_1502b/skin_1502b_tex.png", - "resource/weapon_1000/weapon_1000_ske.json", - "resource/weapon_1000/weapon_1000_tex.json", - "resource/weapon_1000/weapon_1000_tex.png" - ); + private readonly _bullets: Bullet[] = []; + + public constructor() { + super("CoreElement"); + } + + preload(): void { + super.preload(); + + this.load.dragonbone("mecha_1502b", "resource/mecha_1502b/mecha_1502b_tex.png", "resource/mecha_1502b/mecha_1502b_tex.json", "resource/mecha_1502b/mecha_1502b_ske.json"); + this.load.dragonbone("skin_1502b", "resource/skin_1502b/skin_1502b_tex.png", "resource/skin_1502b/skin_1502b_tex.json", "resource/skin_1502b/skin_1502b_ske.json"); + this.load.dragonbone("weapon_1000", "resource/weapon_1000/weapon_1000_tex.png", "resource/weapon_1000/weapon_1000_tex.json", "resource/weapon_1000/weapon_1000_ske.json"); } - protected _onStart(): void { - Game.GROUND = this.stageHeight * 0.5 - 150.0; + create(): void { + super.create(); + + Game.GROUND = this.cameras.main.height - 150.0; Game.instance = this; - // - this.inputEnabled = true; - this.events.onInputDown.add(this._inputDown, this); - this.events.onInputUp.add(this._inputUp, this); + + this.input.on('pointerdown', () => this._inputDown()); + this.input.on('pointerup', () => this._inputUp()); document.addEventListener("keydown", this._keyHandler); document.addEventListener("keyup", this._keyHandler); - // + this.createText("Press W/A/S/D to move. Press Q/E/SPACE to switch weapons and skin. Touch to aim and fire."); - // - const factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1502b/mecha_1502b_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/mecha_1502b/mecha_1502b_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/mecha_1502b/mecha_1502b_tex.png", true) as any).base - ); - factory.parseDragonBonesData(this.game.cache.getItem("resource/skin_1502b/skin_1502b_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/skin_1502b/skin_1502b_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/skin_1502b/skin_1502b_tex.png", true) as any).base - ); - factory.parseDragonBonesData(this.game.cache.getItem("resource/weapon_1000/weapon_1000_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/weapon_1000/weapon_1000_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/weapon_1000/weapon_1000_tex.png", true) as any).base - ); - // - this._player = new Mecha(); + + this._player = new Mecha(this); } - public update(): void { + update(time: number, delta: number): void { if (this._player) { - this._player.aim(this.game.input.x - this.x, this.game.input.y - this.y); + this._player.aim(this.input.x, this.input.y); this._player.update(); } @@ -159,9 +139,9 @@ namespace coreElement { private static readonly NORMAL_ANIMATION_GROUP: string = "normal"; private static readonly AIM_ANIMATION_GROUP: string = "aim"; private static readonly ATTACK_ANIMATION_GROUP: string = "attack"; - private static readonly WEAPON_L_LIST: Array = ["weapon_1502b_l", "weapon_1005", "weapon_1005b", "weapon_1005c", "weapon_1005d", "weapon_1005e"]; - private static readonly WEAPON_R_LIST: Array = ["weapon_1502b_r", "weapon_1005", "weapon_1005b", "weapon_1005c", "weapon_1005d"]; - private static readonly SKINS: Array = ["mecha_1502b", "skin_a", "skin_b", "skin_c"]; + private static readonly WEAPON_L_LIST: string[] = ["weapon_1502b_l", "weapon_1005", "weapon_1005b", "weapon_1005c", "weapon_1005d", "weapon_1005e"]; + private static readonly WEAPON_R_LIST: string[] = ["weapon_1502b_r", "weapon_1005", "weapon_1005b", "weapon_1005c", "weapon_1005d"]; + private static readonly SKINS: string[] = ["mecha_1502b", "skin_a", "skin_b", "skin_c"]; private _isJumpingA: boolean = false; private _isSquating: boolean = false; @@ -180,28 +160,34 @@ namespace coreElement { private _armatureDisplay: ArmatureDisplayType; private _weaponL: dragonBones.Armature; private _weaponR: dragonBones.Armature; - private _aimState: dragonBones.AnimationState | null = null; - private _walkState: dragonBones.AnimationState | null = null; - private _attackState: dragonBones.AnimationState | null = null; - private readonly _target: PointType = new PIXI.Point(); - private readonly _helpPoint: PointType = new PIXI.Point(); - - public constructor() { - this._armatureDisplay = dragonBones.PhaserFactory.factory.buildArmatureDisplay("mecha_1502b"); - this._armatureDisplay.x = 0.0; + private _aimState: dragonBones.AnimationState = null; + private _walkState: dragonBones.AnimationState = null; + private _attackState: dragonBones.AnimationState = null; + private readonly _target: PointType = new Phaser.Math.Vector2(); + private readonly _helpPoint: PointType = new Phaser.Math.Vector2(); + private _helperMatrix: Phaser.GameObjects.Components.TransformMatrix = new Phaser.GameObjects.Components.TransformMatrix(); + + private scene: Phaser.Scene; + + public constructor(scene: Phaser.Scene) { + this.scene = scene; + + this.scene.add.dragonBones("skin_1502b"); + this.scene.add.dragonBones("weapon_1000"); + this._armatureDisplay = this.scene.add.armature("mecha_1502b", "mecha_1502b"); + this._armatureDisplay.x = this.scene.cameras.main.centerX; this._armatureDisplay.y = Game.GROUND; this._armature = this._armatureDisplay.armature; - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); + this._armature.eventDispatcher.addDBEventListener(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); + this._armature.eventDispatcher.addDBEventListener(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); + this._armature.eventDispatcher.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); // Get weapon childArmature. this._weaponL = this._armature.getSlot("weapon_l").childArmature; this._weaponR = this._armature.getSlot("weapon_r").childArmature; - this._weaponL.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); - this._weaponR.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); - Game.instance.addChild(this._armatureDisplay); this._updateAnimation(); } @@ -246,33 +232,41 @@ namespace coreElement { } public switchWeaponL(): void { - this._weaponL.eventDispatcher.removeEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.eventDispatcher.removeDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); this._weaponLIndex++; this._weaponLIndex %= Mecha.WEAPON_L_LIST.length; const weaponName = Mecha.WEAPON_L_LIST[this._weaponLIndex]; - this._weaponL = dragonBones.PhaserFactory.factory.buildArmature(weaponName); + if (weaponName === "weapon_1502b_l" || weaponName === "weapon_1502b_r") { + this._weaponL = this.scene.dragonbone.factory.buildArmature(weaponName, "mecha_1502b"); + } else { + this._weaponL = this.scene.dragonbone.factory.buildArmature(weaponName, "weapon_1000"); + } this._armature.getSlot("weapon_l").childArmature = this._weaponL; - this._weaponL.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); } public switchWeaponR(): void { - this._weaponR.eventDispatcher.removeEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.eventDispatcher.removeDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); this._weaponRIndex++; this._weaponRIndex %= Mecha.WEAPON_R_LIST.length; const weaponName = Mecha.WEAPON_R_LIST[this._weaponRIndex]; - this._weaponR = dragonBones.PhaserFactory.factory.buildArmature(weaponName); + if (weaponName === "weapon_1502b_l" || weaponName === "weapon_1502b_r") { + this._weaponR = this.scene.dragonbone.factory.buildArmature(weaponName, "mecha_1502b"); + } else { + this._weaponR = this.scene.dragonbone.factory.buildArmature(weaponName, "weapon_1000"); + } this._armature.getSlot("weapon_r").childArmature = this._weaponR; - this._weaponR.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.eventDispatcher.addDBEventListener(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); } public switchSkin(): void { this._skinIndex++; this._skinIndex %= Mecha.SKINS.length; const skinName = Mecha.SKINS[this._skinIndex]; - const skinData = dragonBones.PhaserFactory.factory.getArmatureData(skinName).defaultSkin; - dragonBones.PhaserFactory.factory.replaceSkin(this._armature, skinData, false, ["weapon_l", "weapon_r"]); + const skinData = this.scene.dragonbone.factory.getArmatureData(skinName).defaultSkin; + this.scene.dragonbone.factory.replaceSkin(this._armature, skinData, false, ["weapon_l", "weapon_r"]); } public aim(x: number, y: number): void { @@ -326,19 +320,14 @@ namespace coreElement { private _frameEventHandler(event: EventType): void { if (event.name === "fire") { - this._helpPoint.x = event.bone.global.x; - this._helpPoint.y = event.bone.global.y; - const globalPoint = (event.armature.display as ArmatureDisplayType).toGlobal(this._helpPoint); - this._helpPoint.x = globalPoint.x - Game.instance.x; - this._helpPoint.y = globalPoint.y - Game.instance.y; - + event.armature.display.getWorldTransformMatrix(this._helperMatrix).transformPoint(event.bone.global.x, event.bone.global.y, this._helpPoint); this._fire(this._helpPoint); } } private _fire(firePoint: PointType): void { const radian = this._faceDir < 0 ? Math.PI - this._aimRadian : this._aimRadian; - const bullet = new Bullet("bullet_01", "fire_effect_01", radian + Math.random() * 0.02 - 0.01, 40, firePoint); + const bullet = new Bullet(this.scene, "bullet_01", "fire_effect_01", radian + Math.random() * 0.02 - 0.01, 40, firePoint); Game.instance.addBullet(bullet); } @@ -396,11 +385,15 @@ namespace coreElement { private _updatePosition(): void { if (this._speedX !== 0.0) { this._armatureDisplay.x += this._speedX; - if (this._armatureDisplay.x < -Game.instance.stageWidth * 0.5) { - this._armatureDisplay.x = -Game.instance.stageWidth * 0.5; + + const sw = this.scene.cameras.main.width; + const border = 20; + + if (this._armatureDisplay.x < border) { + this._armatureDisplay.x = border; } - else if (this._armatureDisplay.x > Game.instance.stageWidth * 0.5) { - this._armatureDisplay.x = Game.instance.stageWidth * 0.5; + else if (this._armatureDisplay.x > sw - border) { + this._armatureDisplay.x = sw - border; } } @@ -436,7 +429,7 @@ namespace coreElement { } } - const aimOffsetY = this._armature.getBone("chest").global.y * this._armatureDisplay.scale.y; + const aimOffsetY = this._armature.getBone("chest").global.y * this._armatureDisplay.scaleX; if (this._faceDir > 0) { this._aimRadian = Math.atan2(this._target.y - this._armatureDisplay.y - aimOffsetY, this._target.x - this._armatureDisplay.x); } @@ -498,36 +491,34 @@ namespace coreElement { class Bullet { private _speedX: number = 0.0; private _speedY: number = 0.0; + private scene: Phaser.Scene; private _armatureDisplay: ArmatureDisplayType; - private _effecDisplay: ArmatureDisplayType | null = null; + private _effecDisplay: ArmatureDisplayType = null; - public constructor(armatureName: string, effectArmatureName: string | null, radian: number, speed: number, position: PointType) { + public constructor(scene: Phaser.Scene, armatureName: string, effectArmatureName: string, radian: number, speed: number, position: PointType) { this._speedX = Math.cos(radian) * speed; this._speedY = Math.sin(radian) * speed; + this.scene = scene; - this._armatureDisplay = dragonBones.PhaserFactory.factory.buildArmatureDisplay(armatureName); + this._armatureDisplay = this.scene.add.armature(armatureName, "mecha_1502b"); this._armatureDisplay.x = position.x + Math.random() * 2 - 1; this._armatureDisplay.y = position.y + Math.random() * 2 - 1; this._armatureDisplay.rotation = radian; if (effectArmatureName !== null) { - this._effecDisplay = dragonBones.PhaserFactory.factory.buildArmatureDisplay(effectArmatureName); + this._effecDisplay = this.scene.add.armature(effectArmatureName, "mecha_1502b"); this._effecDisplay.rotation = radian; this._effecDisplay.x = this._armatureDisplay.x; this._effecDisplay.y = this._armatureDisplay.y; - this._effecDisplay.scale.x = 1.0 + Math.random() * 1.0; - this._effecDisplay.scale.y = 1.0 + Math.random() * 0.5; + this._effecDisplay.scaleX = 1.0 + Math.random() * 1.0; + this._effecDisplay.scaleY = 1.0 + Math.random() * 0.5; if (Math.random() < 0.5) { - this._effecDisplay.scale.y *= -1.0; + this._effecDisplay.scaleY *= -1.0; } - - Game.instance.addChild(this._effecDisplay); this._effecDisplay.animation.play("idle"); } - - Game.instance.addChild(this._armatureDisplay); this._armatureDisplay.animation.play("idle"); } @@ -535,17 +526,15 @@ namespace coreElement { this._armatureDisplay.x += this._speedX; this._armatureDisplay.y += this._speedY; + const cx = this.scene.cameras.main.width, cy = this.scene.cameras.main.height; if ( - this._armatureDisplay.x < -Game.instance.stageWidth * 0.5 - 100.0 || this._armatureDisplay.x > Game.instance.stageWidth * 0.5 + 100.0 || - this._armatureDisplay.y < -Game.instance.stageHeight * 0.5 - 100.0 || this._armatureDisplay.y > Game.instance.stageHeight * 0.5 + 100.0 + this._armatureDisplay.x < -cx - 100.0 || this._armatureDisplay.x > cx + 100.0 || + this._armatureDisplay.y < -cy * 0.5 - 100.0 || this._armatureDisplay.y > cy + 100.0 ) { - Game.instance.removeChild(this._armatureDisplay); - this._armatureDisplay.dispose(); + this._armatureDisplay.destroy(); - if (this._effecDisplay !== null) { - Game.instance.removeChild(this._effecDisplay); - this._effecDisplay.dispose(); - } + if (this._effecDisplay !== null) + this._effecDisplay.destroy(); return true; } @@ -553,4 +542,4 @@ namespace coreElement { return false; } } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/DragHelper.ts b/Phaser/Demos/src/DragHelper.ts index b3df7c47..b55c88ef 100644 --- a/Phaser/Demos/src/DragHelper.ts +++ b/Phaser/Demos/src/DragHelper.ts @@ -4,35 +4,37 @@ class DragHelper { return DragHelper._instance; } - private readonly _helpPoint: Phaser.Point = new Phaser.Point(); - private readonly _dragOffset: Phaser.Point = new Phaser.Point(); - private _dragDisplayObject: Phaser.Sprite | null = null; + private readonly _helpPoint: Phaser.Math.Vector2 = new Phaser.Math.Vector2(); + private readonly _dragOffset: Phaser.Math.Vector2 = new Phaser.Math.Vector2(); + private _dragDisplayObject: Phaser.GameObjects.GameObject = null; - public enableDrag(displayObject: Phaser.Sprite): void { - displayObject.inputEnabled = true; - displayObject.input.enableDrag(); - displayObject.events.onDragStart.add(this._dragStartHandler, this); - displayObject.events.onDragStop.add(this._dragStopHandler, this); + public enableDrag(scene: Phaser.Scene, displayObject: Phaser.GameObjects.GameObject): void { + scene.input.enable(displayObject); + scene.input.setDraggable(displayObject, true); + displayObject.on("dragstart", (a, b, c) => { this._dragStartHandler(displayObject, a, b, c); }, this); + displayObject.on("dragend", this._dragStopHandler, this); } - public disableDrag(displayObject: Phaser.Sprite): void { - displayObject.events.onDragStart.remove(this._dragStartHandler, this); - displayObject.events.onDragStop.remove(this._dragStopHandler, this); + public disableDrag(scene: Phaser.Scene, displayObject: Phaser.GameObjects.Sprite): void { + scene.input.setDraggable(displayObject, false); + scene.input.disable(displayObject); + displayObject.off("dragstart", this._dragStartHandler, this); + displayObject.off("dragend", this._dragStopHandler, this); } - private _dragStartHandler(displayObject: Phaser.Sprite, pointer: Phaser.Pointer): void { + private _dragStartHandler(displayObject: Phaser.GameObjects.GameObject, pointer: Phaser.Input.Pointer, dragX: number, dragY: number): void { if (this._dragDisplayObject) { return; } this._dragDisplayObject = displayObject; - const armatureDisplay = this._dragDisplayObject.parent as dragonBones.PhaserArmatureDisplay; + const armatureDisplay = this._dragDisplayObject.parentContainer as dragonBones.phaser.display.ArmatureDisplay; const bone = armatureDisplay.armature.getBoneByDisplay(this._dragDisplayObject); if (bone) { - this._helpPoint.x = pointer.clientX; - this._helpPoint.y = pointer.clientY; + this._helpPoint.x = pointer.x; + this._helpPoint.y = pointer.y; if (bone.offsetMode !== dragonBones.OffsetMode.Override) { bone.offsetMode = dragonBones.OffsetMode.Override; @@ -43,33 +45,33 @@ class DragHelper { this._dragOffset.x = bone.offset.x - this._helpPoint.x; this._dragOffset.y = bone.offset.y - this._helpPoint.y; - displayObject.events.onDragUpdate.add(this._dragHandler, this); + displayObject.on("pointermove", this._dragHandler, this); } } - private _dragStopHandler(displayObject: Phaser.Sprite, pointer: Phaser.Pointer): void { + private _dragStopHandler(pointer: Phaser.Input.Pointer, dragX: number, dragY: number, dropped: boolean): void { if (!this._dragDisplayObject) { return; } - displayObject.events.onDragUpdate.remove(this._dragHandler, this); + this._dragDisplayObject.off("pointermove", this._dragHandler, this); this._dragDisplayObject = null; } - private _dragHandler(displayObject: Phaser.Sprite, pointer: Phaser.Pointer): void { + private _dragHandler(pointer: Phaser.Input.Pointer, localX: number, localY: number): void { if (!this._dragDisplayObject) { return; } - const armatureDisplay = this._dragDisplayObject.parent as dragonBones.PhaserArmatureDisplay; + const armatureDisplay = this._dragDisplayObject.parentContainer as dragonBones.phaser.display.ArmatureDisplay; const bone = armatureDisplay.armature.getBoneByDisplay(this._dragDisplayObject); if (bone) { - this._helpPoint.x = pointer.clientX; - this._helpPoint.y = pointer.clientY; + this._helpPoint.x = pointer.x; + this._helpPoint.y = pointer.y; bone.offset.x = this._helpPoint.x + this._dragOffset.x; bone.offset.y = this._helpPoint.y + this._dragOffset.y; bone.invalidUpdate(); } } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/DragonBonesEvent.ts b/Phaser/Demos/src/DragonBonesEvent.ts index 4a8a2e26..92f73c0f 100644 --- a/Phaser/Demos/src/DragonBonesEvent.ts +++ b/Phaser/Demos/src/DragonBonesEvent.ts @@ -1,48 +1,42 @@ class DragonBonesEvent extends BaseDemo { - private _armatureDisplay: dragonBones.PhaserArmatureDisplay; + private _armatureDisplay: dragonBones.phaser.display.ArmatureDisplay; - public constructor(game: Phaser.Game) { - super(game); + public constructor() { + super("DragonBonesEvent"); + } + + preload(): void { + super.preload(); - this._resources.push( - "resource/mecha_1004d/mecha_1004d_ske.json", + this.load.dragonbone( + "mecha_1004d", + "resource/mecha_1004d/mecha_1004d_tex.png", "resource/mecha_1004d/mecha_1004d_tex.json", - "resource/mecha_1004d/mecha_1004d_tex.png" + "resource/mecha_1004d/mecha_1004d_ske.json" ); } - protected _onStart(): void { - const factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1004d/mecha_1004d_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/mecha_1004d/mecha_1004d_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/mecha_1004d/mecha_1004d_tex.png", true) as any).base - ); - factory.soundEventManager.addDBEventListener(dragonBones.EventObject.SOUND_EVENT, this._soundEventHandler, this); + create(): void { + super.create(); - this._armatureDisplay = factory.buildArmatureDisplay("mecha_1004d"); + this._armatureDisplay = this.add.armature("mecha_1004d", "mecha_1004d"); this._armatureDisplay.addDBEventListener(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); this._armatureDisplay.animation.play("walk"); - this._armatureDisplay.x = 0.0; - this._armatureDisplay.y = 100.0; - this.addChild(this._armatureDisplay); + this._armatureDisplay.x = this.cameras.main.centerX; + this._armatureDisplay.y = this.cameras.main.centerY + 100.0; // - this.inputEnabled = true; - this.events.onInputDown.add(() => { + this.input.enabled = true; + this.input.on('pointerdown', () => { this._armatureDisplay.animation.fadeIn("skill_03", 0.2); - }, this); + }); // this.createText("Touch to play animation."); } - private _soundEventHandler(event: dragonBones.EventObject): void { - console.log(event.name); - } - private _animationEventHandler(event: dragonBones.EventObject): void { if (event.animationState.name === "skill_03") { this._armatureDisplay.animation.fadeIn("walk", 0.2); } } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/HelloDragonBones.ts b/Phaser/Demos/src/HelloDragonBones.ts index ab3fbd71..370e4182 100644 --- a/Phaser/Demos/src/HelloDragonBones.ts +++ b/Phaser/Demos/src/HelloDragonBones.ts @@ -1,46 +1,30 @@ -/** - * How to use - * 1. Load data. - * - * 2. Parse data. - * factory.parseDragonBonesData(); - * factory.parseTextureAtlasData(); - * - * 3. Build armature. - * armatureDisplay = factory.buildArmatureDisplay("armatureName"); - * - * 4. Play animation. - * armatureDisplay.animation.play("animationName"); - * - * 5. Add armature to stage. - * addChild(armatureDisplay); - */ class HelloDragonBones extends BaseDemo { - public constructor(game: Phaser.Game) { - super(game); - this._resources.push( - // "resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.json", - "resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin", + public constructor() { + super("HelloDragonBones"); + } + + preload(): void { + super.preload(); + + this.load.dragonbone( + "mecha_1002_101d_show", + "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png", "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json", - "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png" + "resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin", + null, + null, + { responseType: "arraybuffer" } ); } - protected _onStart(): void { - const factory = dragonBones.PhaserFactory.factory; - // factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.json", Phaser.Cache.JSON).data); - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin", Phaser.Cache.BINARY)); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png", true) as any).base - ); + create(): void { + super.create(); - const armatureDisplay = factory.buildArmatureDisplay("mecha_1002_101d", "mecha_1002_101d_show"); + const armatureDisplay = this.add.armature("mecha_1002_101d", "mecha_1002_101d_show"); armatureDisplay.animation.play("idle"); - armatureDisplay.x = 0.0; - armatureDisplay.y = 200.0; - this.addChild(armatureDisplay); + armatureDisplay.x = this.cameras.main.centerX; + armatureDisplay.y = this.cameras.main.centerY + 200; } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/InverseKinematics.ts b/Phaser/Demos/src/InverseKinematics.ts index 1479a0fb..391aa65e 100644 --- a/Phaser/Demos/src/InverseKinematics.ts +++ b/Phaser/Demos/src/InverseKinematics.ts @@ -2,9 +2,9 @@ class InverseKinematics extends BaseDemo { private _faceDir: number = 0; private _aimRadian: number = 0.0; private _offsetRotation: number = 0.0; - private readonly _target: Phaser.Point = new Phaser.Point(); - private _armatureDisplay: dragonBones.PhaserArmatureDisplay; - private _floorBoard: dragonBones.PhaserArmatureDisplay; + private readonly _target: Phaser.Math.Vector2 = new Phaser.Math.Vector2(); + private _armatureDisplay: dragonBones.phaser.display.ArmatureDisplay; + private _floorBoard: dragonBones.phaser.display.ArmatureDisplay; private _chestBone: dragonBones.Bone; private _leftFootBone: dragonBones.Bone; private _rightFootBone: dragonBones.Bone; @@ -12,34 +12,32 @@ class InverseKinematics extends BaseDemo { private _floorBoardBone: dragonBones.Bone; private _aimState: dragonBones.AnimationState; - public constructor(game: Phaser.Game) { - super(game); + public constructor() { + super("IKDemo"); + } - this._resources.push( - "resource/mecha_1406/mecha_1406_ske.json", - "resource/mecha_1406/mecha_1406_tex.json", + preload(): void { + super.preload(); + + this.load.dragonbone( + "mecha_1406", "resource/mecha_1406/mecha_1406_tex.png", - "resource/floor_board/floor_board_ske.json", + "resource/mecha_1406/mecha_1406_tex.json", + "resource/mecha_1406/mecha_1406_ske.json" + ); + this.load.dragonbone( + "floor_board", + "resource/floor_board/floor_board_tex.png", "resource/floor_board/floor_board_tex.json", - "resource/floor_board/floor_board_tex.png" + "resource/floor_board/floor_board_ske.json" ); } - protected _onStart(): void { - const factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1406/mecha_1406_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/mecha_1406/mecha_1406_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/mecha_1406/mecha_1406_tex.png", true) as any).base - ); - factory.parseDragonBonesData(this.game.cache.getItem("resource/floor_board/floor_board_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/floor_board/floor_board_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/floor_board/floor_board_tex.png", true) as any).base - ); - // - this._armatureDisplay = factory.buildArmatureDisplay("mecha_1406"); - this._floorBoard = factory.buildArmatureDisplay("floor_board"); + create(): void { + super.create(); + + this._armatureDisplay = this.add.armature("mecha_1406", "mecha_1406"); + this._floorBoard = this.add.armature("floor_board", "floor_board"); // this._chestBone = this._armatureDisplay.armature.getBone("chest"); this._leftFootBone = this._armatureDisplay.armature.getBone("foot_l"); @@ -54,23 +52,21 @@ class InverseKinematics extends BaseDemo { // this._floorBoard.animation.play("idle"); this._floorBoard.armature.getSlot("player").display = this._armatureDisplay; - this._floorBoard.x = 0.0; - this._floorBoard.y = 50.0; - this.addChild(this._floorBoard); + this._floorBoard.x = this.cameras.main.centerX; + this._floorBoard.y = this.cameras.main.centerY + 50.0; // - this.inputEnabled = true; - DragHelper.getInstance().enableDrag(this._floorBoard.armature.getSlot("circle").display); + DragHelper.getInstance().enableDrag(this, this._floorBoard.armature.getSlot("circle").display); // - this.createText("Touch to drag circle to modify IK bones."); + this.createText("Touch and drag the red circle to modify the IK bones."); } - public update(): void { + update(time: number, delta: number): void { if (!this._floorBoard) { return; } - this._target.x = this.game.input.x - this.x; - this._target.y = this.game.input.y - this.y; + this._target.x = this.input.x - this.cameras.main.centerX; + this._target.y = this.input.y - this.cameras.main.centerY; this._updateAim(); this._updateFoot(); @@ -79,7 +75,7 @@ class InverseKinematics extends BaseDemo { private _updateAim(): void { const positionX = this._floorBoard.x; const positionY = this._floorBoard.y; - const aimOffsetY = this._chestBone.global.y * this._floorBoard.scale.y; + const aimOffsetY = this._chestBone.global.y * this._floorBoard.scaleY; this._faceDir = this._target.x > 0.0 ? 1 : -1; this._armatureDisplay.armature.flipX = this._faceDir < 0; @@ -125,4 +121,4 @@ class InverseKinematics extends BaseDemo { this._rightFootBone.offset.rotation = this._offsetRotation * this._faceDir; this._rightFootBone.invalidUpdate(); } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/PerformanceTest.ts b/Phaser/Demos/src/PerformanceTest.ts index 6c9b4cba..398a18dd 100644 --- a/Phaser/Demos/src/PerformanceTest.ts +++ b/Phaser/Demos/src/PerformanceTest.ts @@ -1,20 +1,49 @@ class PerformanceTest extends BaseDemo { private _addingArmature: boolean = false; private _removingArmature: boolean = false; - private readonly _armatures: Array = []; - private _text: Phaser.Text; + private readonly _armatures: Array = []; + private _text: Phaser.GameObjects.Text; + private _perfText: Phaser.GameObjects.Text; - public constructor(game: Phaser.Game) { - super(game); + public constructor() { + super("PerformanceText"); + } - this._resources.push( - "resource/mecha_1406/mecha_1406_ske.dbbin", + preload(): void { + super.preload(); + + this.load.dragonbone( + "mecha_1406", + "resource/mecha_1406/mecha_1406_tex.png", "resource/mecha_1406/mecha_1406_tex.json", - "resource/mecha_1406/mecha_1406_tex.png" + "resource/mecha_1406/mecha_1406_ske.dbbin", + null, + null, + { responseType: "arraybuffer" } ); } - public update(): void { + create(): void { + super.create(); + + this.input.enabled = true; + this.input.on("pointerdown", p => this._inputDown(p)); + this.input.on("pointerup", () => this._inputUp()); + + this._text = this.createText("--"); + this._text.y = this.cameras.main.height - 80; + this._perfText = this.createText("--"); + this._perfText.y = this._text.y + this._text.height + 10; + + for (let i = 0; i < 300; ++i) { + this._addArmature(); + } + + this._resetPosition(); + this._updateText(); + } + + update(time: number, delta: number): void { if (this._addingArmature) { for (let i = 0; i < 10; ++i) { this._addArmature(); @@ -32,25 +61,13 @@ class PerformanceTest extends BaseDemo { this._resetPosition(); this._updateText(); } - } - - protected _onStart(): void { - this.inputEnabled = true; - this.events.onInputDown.add(this._inputDown, this); - this.events.onInputUp.add(this._inputUp, this); - // - this._text = this.createText(""); - for (let i = 0; i < 300; ++i) { - this._addArmature(); - } - - this._resetPosition(); - this._updateText(); + const game = this.scene.systems.game; + this._perfText.setText(`FPS:${game.loop.actualFps.toFixed(1)} (${game.loop.minFps}-${game.loop.targetFps})`); } - private _inputDown(target: any, pointer: Phaser.Pointer): void { - const touchRight = pointer.x > this.stageWidth * 0.5; + private _inputDown(pointer: Phaser.Input.Pointer): void { + const touchRight = pointer.x > this.cameras.main.centerX; this._addingArmature = touchRight; this._removingArmature = !touchRight; } @@ -61,20 +78,10 @@ class PerformanceTest extends BaseDemo { } private _addArmature(): void { - const factory = dragonBones.PhaserFactory.factory; - if (this._armatures.length === 0) { - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1406/mecha_1406_ske.dbbin", Phaser.Cache.BINARY)); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/mecha_1406/mecha_1406_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/mecha_1406/mecha_1406_tex.png", true) as any).base - ); - } - - const armatureDisplay = factory.buildArmatureDisplay("mecha_1406"); + const armatureDisplay = this.add.armature("mecha_1406", "mecha_1406"); armatureDisplay.armature.cacheFrameRate = 24; armatureDisplay.animation.play("walk"); - armatureDisplay.scale.x = armatureDisplay.scale.y = 0.5; - this.addChild(armatureDisplay); + armatureDisplay.setScale(.5); this._armatures.push(armatureDisplay); } @@ -85,11 +92,10 @@ class PerformanceTest extends BaseDemo { } const armatureDisplay = this._armatures.pop(); - this.removeChild(armatureDisplay); - armatureDisplay.dispose(); + armatureDisplay.destroy(); if (this._armatures.length === 0) { - dragonBones.PhaserFactory.factory.clear(true); + this.dragonbone.factory.clear(true); dragonBones.BaseObject.clearPool(); } } @@ -104,24 +110,22 @@ class PerformanceTest extends BaseDemo { const paddingT = 200; const paddingB = 100; const gapping = 90; - const stageWidth = this.stageWidth - paddingH * 2; + const stageHeight = this.cameras.main.height; + const stageWidth = this.cameras.main.width - paddingH * 2; const columnCount = Math.floor(stageWidth / gapping); - const paddingHModify = (this.stageWidth - columnCount * gapping) * 0.5; + const paddingHModify = (stageWidth - columnCount * gapping); const dX = stageWidth / columnCount; - const dY = (this.stageHeight - paddingT - paddingB) / Math.ceil(armatureCount / columnCount); + const dY = (stageHeight - paddingT - paddingB) / Math.ceil(armatureCount / columnCount); for (let i = 0, l = armatureCount; i < l; ++i) { const armatureDisplay = this._armatures[i]; const lineY = Math.floor(i / columnCount); - armatureDisplay.x = (i % columnCount) * dX + paddingHModify - this.stageWidth * 0.5; - armatureDisplay.y = lineY * dY + paddingT - this.stageHeight * 0.5; + armatureDisplay.x = (i % columnCount) * dX + paddingHModify + paddingH * .5; + armatureDisplay.y = lineY * dY + paddingT; } } private _updateText(): void { - this._text.text = "Count: " + this._armatures.length + ". Touch screen left to decrease count / right to increase count."; - this._text.x = - this._text.width * 0.5; - this._text.y = this.stageHeight * 0.5 - 100; - this.addChild(this._text); + this._text.setText("Count: " + this._armatures.length + ". Touch screen left to decrease count / right to increase count."); } } \ No newline at end of file diff --git a/Phaser/Demos/src/ReplaceAnimation.ts b/Phaser/Demos/src/ReplaceAnimation.ts index 3e3e7f68..86288a6c 100644 --- a/Phaser/Demos/src/ReplaceAnimation.ts +++ b/Phaser/Demos/src/ReplaceAnimation.ts @@ -1,56 +1,55 @@ class ReplaceAnimation extends BaseDemo { - private _armatureDisplayA: dragonBones.PhaserArmatureDisplay; - private _armatureDisplayB: dragonBones.PhaserArmatureDisplay; - private _armatureDisplayC: dragonBones.PhaserArmatureDisplay; - private _armatureDisplayD: dragonBones.PhaserArmatureDisplay; + private _armatureDisplayA: dragonBones.phaser.display.ArmatureDisplay; + private _armatureDisplayB: dragonBones.phaser.display.ArmatureDisplay; + private _armatureDisplayC: dragonBones.phaser.display.ArmatureDisplay; + private _armatureDisplayD: dragonBones.phaser.display.ArmatureDisplay; - public constructor(game: Phaser.Game) { - super(game); + public constructor() { + super("ReplaceAnimation"); + } + + preload(): void { + super.preload(); - this._resources.push( - "resource/mecha_2903/mecha_2903_ske.json", + this.load.dragonbone( + "mecha_2903", + "resource/mecha_2903/mecha_2903_tex.png", "resource/mecha_2903/mecha_2903_tex.json", - "resource/mecha_2903/mecha_2903_tex.png" + "resource/mecha_2903/mecha_2903_ske.json" ); } - protected _onStart(): void { - const factory = dragonBones.PhaserFactory.factory; - factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_2903/mecha_2903_ske.json", Phaser.Cache.JSON).data); - factory.parseTextureAtlasData( - this.game.cache.getItem("resource/mecha_2903/mecha_2903_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/mecha_2903/mecha_2903_tex.png", true) as any).base - ); + create(): void { + super.create(); - this._armatureDisplayA = factory.buildArmatureDisplay("mecha_2903"); - this._armatureDisplayB = factory.buildArmatureDisplay("mecha_2903b"); - this._armatureDisplayC = factory.buildArmatureDisplay("mecha_2903c"); - this._armatureDisplayD = factory.buildArmatureDisplay("mecha_2903d"); + this._armatureDisplayA = this.add.armature("mecha_2903", "mecha_2903"); + this._armatureDisplayB = this.add.armature("mecha_2903b", "mecha_2903"); + this._armatureDisplayC = this.add.armature("mecha_2903c", "mecha_2903"); + this._armatureDisplayD = this.add.armature("mecha_2903d", "mecha_2903"); + const factory = this.dragonbone.factory; const sourceArmatureData = factory.getArmatureData("mecha_2903d"); factory.replaceAnimation(this._armatureDisplayA.armature, sourceArmatureData); factory.replaceAnimation(this._armatureDisplayB.armature, sourceArmatureData); factory.replaceAnimation(this._armatureDisplayC.armature, sourceArmatureData); - this.addChild(this._armatureDisplayD); - this.addChild(this._armatureDisplayA); - this.addChild(this._armatureDisplayB); - this.addChild(this._armatureDisplayC); + const cx = this.cameras.main.centerX; + const cy = this.cameras.main.centerY; - this._armatureDisplayA.x = 0.0 - 350.0; - this._armatureDisplayA.y = 0.0 + 150.0; - this._armatureDisplayB.x = 0.0; - this._armatureDisplayB.y = 0.0 + 150.0; - this._armatureDisplayC.x = 0.0 + 350.0; - this._armatureDisplayC.y = 0.0 + 150.0; - this._armatureDisplayD.x = 0.0; - this._armatureDisplayD.y = 0.0 - 50.0; - // - this.inputEnabled = true; - this.events.onInputDown.add(() => { + this._armatureDisplayA.x = cx - 350.0; + this._armatureDisplayA.y = cy + 150.0; + this._armatureDisplayB.x = cx; + this._armatureDisplayB.y = cy + 150.0; + this._armatureDisplayC.x = cx + 350.0; + this._armatureDisplayC.y = cy + 150.0; + this._armatureDisplayD.x = cx; + this._armatureDisplayD.y = cy - 50.0; + + this.input.enabled = true; + this.input.on('pointerdown', () => { this._changeAnimation(); }); - // + this.createText("Touch to change animation."); } @@ -71,4 +70,4 @@ class ReplaceAnimation extends BaseDemo { this._armatureDisplayB.animation.play(animationName); this._armatureDisplayC.animation.play(animationName); } -} \ No newline at end of file +} diff --git a/Phaser/Demos/src/ReplaceSlotDisplay.ts b/Phaser/Demos/src/ReplaceSlotDisplay.ts index d2d156eb..280a9508 100644 --- a/Phaser/Demos/src/ReplaceSlotDisplay.ts +++ b/Phaser/Demos/src/ReplaceSlotDisplay.ts @@ -3,57 +3,55 @@ class ReplaceSlotDisplay extends BaseDemo { private _leftWeaponIndex: number = 0; private _rightWeaponIndex: number = 0; - private readonly _factory: dragonBones.PhaserFactory = dragonBones.PhaserFactory.factory; - private _armatureDisplay: dragonBones.PhaserArmatureDisplay; - private _logoText: Phaser.Text; + private _factory: dragonBones.phaser.Factory = null; + private _armatureDisplay: dragonBones.phaser.display.ArmatureDisplay; + private _logoText: Phaser.GameObjects.Text; - public constructor(game: Phaser.Game) { - super(game); + public constructor() { + super("ReplaceSlotDisplay"); + } - this._resources.push( - "resource/mecha_1004d_show/mecha_1004d_show_ske.json", - "resource/mecha_1004d_show/mecha_1004d_show_tex.json", + preload(): void { + super.preload(); + + this.load.dragonbone( + "mecha_1004d", "resource/mecha_1004d_show/mecha_1004d_show_tex.png", - "resource/weapon_1004_show/weapon_1004_show_ske.json", + "resource/mecha_1004d_show/mecha_1004d_show_tex.json", + "resource/mecha_1004d_show/mecha_1004d_show_ske.json" + ); + this.load.dragonbone( + "weapon_1004", + "resource/weapon_1004_show/weapon_1004_show_tex.png", "resource/weapon_1004_show/weapon_1004_show_tex.json", - "resource/weapon_1004_show/weapon_1004_show_tex.png" + "resource/weapon_1004_show/weapon_1004_show_ske.json" ); } - protected _onStart(): void { - this._factory.parseDragonBonesData(this.game.cache.getItem("resource/mecha_1004d_show/mecha_1004d_show_ske.json", Phaser.Cache.JSON).data); - this._factory.parseTextureAtlasData( - this.game.cache.getItem("resource/mecha_1004d_show/mecha_1004d_show_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/mecha_1004d_show/mecha_1004d_show_tex.png", true) as any).base - ); - this._factory.parseDragonBonesData(this.game.cache.getItem("resource/weapon_1004_show/weapon_1004_show_ske.json", Phaser.Cache.JSON).data); - this._factory.parseTextureAtlasData( - this.game.cache.getItem("resource/weapon_1004_show/weapon_1004_show_tex.json", Phaser.Cache.JSON).data, - (this.game.cache.getImage("resource/weapon_1004_show/weapon_1004_show_tex.png", true) as any).base - ); - // - this._armatureDisplay = this._factory.buildArmatureDisplay("mecha_1004d"); + create(): void { + super.create(); + + this._factory = this.dragonbone.factory; + + this._armatureDisplay = this.add.armature("mecha_1004d", "mecha_1004d"); this._armatureDisplay.animation.play(); + + this.add.armature("weapon", "weapon_1004"); // - this._armatureDisplay.x = 100.0; - this._armatureDisplay.y = 200.0; - this.addChild(this._armatureDisplay); + this._armatureDisplay.x = this.cameras.main.centerX + 100.0; + this._armatureDisplay.y = this.cameras.main.centerY + 200.0; // - this.inputEnabled = true; - this.events.onInputDown.add(() => { - const localX = this.game.input.x - this.x; - if (localX < -150.0) { + this.input.on('pointerdown', () => { + const localX = this.input.x - this._armatureDisplay.x; + if (localX < -150.0) this._replaceDisplay(-1); - } - else if (localX > 150.0) { + else if (localX > 150.0) this._replaceDisplay(1); - } - else { + else this._replaceDisplay(0); - } - }, this); + }); // - this.createText("Touch screen left / center / right to relace slot display."); + this.createText("Touch screen left / center / right to replace slot display."); } private _replaceDisplay(type: number): void { @@ -61,7 +59,7 @@ class ReplaceSlotDisplay extends BaseDemo { this._rightWeaponIndex++; this._rightWeaponIndex %= ReplaceSlotDisplay.WEAPON_RIGHT_LIST.length; const displayName = ReplaceSlotDisplay.WEAPON_RIGHT_LIST[this._rightWeaponIndex]; - this._factory.replaceSlotDisplay("weapon_1004_show", "weapon", "weapon_r", displayName, this._armatureDisplay.armature.getSlot("weapon_hand_r")); + this._factory.replaceSlotDisplay("weapon_1004", "weapon", "weapon_r", displayName, this._armatureDisplay.armature.getSlot("weapon_hand_r")); } else if (type === 1) { this._leftWeaponIndex++; @@ -75,13 +73,18 @@ class ReplaceSlotDisplay extends BaseDemo { } else { if (!this._logoText) { - const style = { font: "14px", fill: "#FFFFFF", align: "center" }; - this._logoText = this.game.add.text(0.0, 0.0, "Core Element", style); - this._logoText.pivot.x = this._logoText.width * 0.5; - this._logoText.pivot.y = this._logoText.height * 0.5; + // mix skew component into Text class (also if you want to use some customized display object you must mix skew component into it, too) + dragonBones.phaser.util.extendSkew(Phaser.GameObjects.Text); + + const style = { fontSize: 30, color: "#FFFFFF", align: "center" }; + this._logoText = this.add.text(0.0, 0.0, "Core Element", style); + + this._logoText.setPipeline("PhaserTextureTintPipeline"); // and use this customized pipeline to support skew + + this._logoText.setOrigin(.5, .5); } logoSlot.display = this._logoText; } } } -} \ No newline at end of file +} diff --git a/Phaser/Demos/tsconfig.json b/Phaser/Demos/tsconfig.json index c2fc9e25..3a6c6001 100644 --- a/Phaser/Demos/tsconfig.json +++ b/Phaser/Demos/tsconfig.json @@ -4,7 +4,6 @@ "sourceMap": false, "declaration": false, "alwaysStrict": true, - "noImplicitAny": true, "noImplicitThis": true, "noUnusedLocals": true, "noUnusedParameters": false, diff --git a/Phaser/README.md b/Phaser/README.md index 5e108e8f..61d16cc9 100644 --- a/Phaser/README.md +++ b/Phaser/README.md @@ -1,6 +1,14 @@ # DragonBones Phaser library -## [Demos](./Demos/) -* [Hello DragonBones](./Demos/src/HelloDragonBones.ts) +**1. Phaser version matched: v3.12.0+** -## [Phaser website](https://phaser.io) \ No newline at end of file +**2. Known issues:** + 1. use external db bone and attach to a slot will cause rotation problem when the armature is flipped. + 2. bounding box and debug graphics are not implemented yet, but soon they will be added. + 3. mesh is not suppoted yet, which means you cannot use some advanced features yet. this needs Phaser official to support mesh.indices. + +# Demos + +1. [List](./Demos/) + +2. [Hello DragonBones](./Demos/src/HelloDragonBones.ts) diff --git a/Pixi/4.x/README.md b/Pixi/4.x/README.md index faf460de..a1daccd7 100644 --- a/Pixi/4.x/README.md +++ b/Pixi/4.x/README.md @@ -1,4 +1,7 @@ ## How to build +* Clone or download [DragonBonesJS](https://github.com/DragonBones/DragonBonesJS/). +* Install [Node.JS](https://nodejs.org/). +* Open `DragonBonesJS/Pixi/4.x/` in command. * $ `npm install` * $ `npm run build` diff --git a/Pixi/4.x/libs/.gitkeep b/Pixi/4.x/libs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Pixi/4.x/out/dragonBones.d.ts b/Pixi/4.x/out/dragonBones.d.ts index 981baec4..c5be2a57 100644 --- a/Pixi/4.x/out/dragonBones.d.ts +++ b/Pixi/4.x/out/dragonBones.d.ts @@ -1,15 +1,3 @@ -declare namespace dragonBones { - /** - * @internal - * @private - */ - const webAssemblyModule: { - HEAP16: Int16Array; - _malloc(byteSize: number): number; - _free(pointer: number): void; - setDataBinary(data: DragonBonesData, binaryPointer: number, intBytesLength: number, floatBytesLength: number, frameIntBytesLength: number, frameFloatBytesLength: number, frameBytesLength: number, timelineBytesLength: number): void; - }; -} /** * The MIT License (MIT) * @@ -34,17 +22,17 @@ declare namespace dragonBones { */ declare namespace dragonBones { /** - * @internal + * @private */ const enum BinaryOffset { WeigthBoneCount = 0, WeigthFloatOffset = 1, WeigthBoneIndices = 2, - MeshVertexCount = 0, - MeshTriangleCount = 1, - MeshFloatOffset = 2, - MeshWeightOffset = 3, - MeshVertexIndices = 4, + GeometryVertexCount = 0, + GeometryTriangleCount = 1, + GeometryFloatOffset = 2, + GeometryWeightOffset = 3, + GeometryVertexIndices = 4, TimelineScale = 0, TimelineOffset = 1, TimelineKeyFrameCount = 2, @@ -60,12 +48,9 @@ declare namespace dragonBones { DeformValueCount = 2, DeformValueOffset = 3, DeformFloatOffset = 4, - PathVertexCount = 0, - PathFloatOffset = 2, - PathWeightOffset = 3, } /** - * @internal + * @private */ const enum ArmatureType { Armature = 0, @@ -73,7 +58,7 @@ declare namespace dragonBones { Stage = 2, } /** - * @internal + * @private */ const enum BoneType { Bone = 0, @@ -105,7 +90,7 @@ declare namespace dragonBones { Polygon = 2, } /** - * @internal + * @private */ const enum ActionType { Play = 0, @@ -113,7 +98,7 @@ declare namespace dragonBones { Sound = 11, } /** - * @internal + * @private */ const enum BlendMode { Normal = 0, @@ -132,7 +117,7 @@ declare namespace dragonBones { Subtract = 13, } /** - * @internal + * @private */ const enum TweenType { None = 0, @@ -143,7 +128,7 @@ declare namespace dragonBones { QuadInOut = 5, } /** - * @internal + * @private */ const enum TimelineType { Action = 0, @@ -153,12 +138,16 @@ declare namespace dragonBones { BoneRotate = 12, BoneScale = 13, Surface = 50, + BoneAlpha = 60, SlotDisplay = 20, SlotColor = 21, SlotDeform = 22, + SlotZIndex = 23, + SlotAlpha = 24, IKConstraint = 30, - AnimationTime = 40, + AnimationProgress = 40, AnimationWeight = 41, + AnimationParameter = 42, } /** * - Offset mode. @@ -186,15 +175,6 @@ declare namespace dragonBones { * @language zh_CN */ const enum AnimationFadeOutMode { - /** - * - Do not fade out of any animation states. - * @language en_US - */ - /** - * - 不淡出任何的动画状态。 - * @language zh_CN - */ - None = 0, /** * - Fade out the animation states of the same layer. * @language en_US @@ -241,19 +221,45 @@ declare namespace dragonBones { */ Single = 5, } + /** + * @private + */ + const enum AnimationBlendType { + None = 0, + E1D = 1, + } + /** + * @private + */ + const enum AnimationBlendMode { + Additive = 0, + Override = 1, + } + /** + * @private + */ const enum ConstraintType { IK = 0, Path = 1, } + /** + * @private + */ const enum PositionMode { Fixed = 0, Percent = 1, } + /** + * @private + */ const enum SpacingMode { Length = 0, Fixed = 1, Percent = 2, } + /** + * @private + */ const enum RotateMode { Tangent = 0, Chain = 1, @@ -273,7 +279,6 @@ declare namespace dragonBones { static yDown: boolean; static debug: boolean; static debugDraw: boolean; - static webAssembly: boolean; private readonly _clock; private readonly _events; private readonly _objects; @@ -287,6 +292,9 @@ declare namespace dragonBones { } } declare var __extends: any; +declare var exports: any; +declare var module: any; +declare var define: any; /** * The MIT License (MIT) * @@ -776,7 +784,7 @@ declare namespace dragonBones { */ declare namespace dragonBones { /** - * @internal + * @private */ class ColorTransform { alphaMultiplier: number; @@ -1054,18 +1062,6 @@ declare namespace dragonBones { */ readonly strings: Array; protected _onClear(): void; - /** - * @internal - */ - addInt(value: number): void; - /** - * @internal - */ - addFloat(value: number): void; - /** - * @internal - */ - addString(value: string): void; /** * - Get the custom int number. * @version DragonBones 5.0 @@ -1101,7 +1097,7 @@ declare namespace dragonBones { getString(index?: number): string; } /** - * @internal + * @private */ class ActionData extends BaseObject { static toString(): string; @@ -1195,14 +1191,6 @@ declare namespace dragonBones { * @private */ stage: ArmatureData | null; - /** - * @internal - */ - readonly frameIndices: Array; - /** - * @internal - */ - readonly cachedFrames: Array; /** * - All armature data names. * @version DragonBones 3.0 @@ -1218,43 +1206,11 @@ declare namespace dragonBones { * @private */ readonly armatures: Map; - /** - * @internal - */ - binary: ArrayBuffer; - /** - * @internal - */ - intArray: Int16Array; - /** - * @internal - */ - floatArray: Float32Array; - /** - * @internal - */ - frameIntArray: Int16Array; - /** - * @internal - */ - frameFloatArray: Float32Array; - /** - * @internal - */ - frameArray: Int16Array; - /** - * @internal - */ - timelineArray: Uint16Array; /** * @private */ userData: UserData | null; protected _onClear(): void; - /** - * @internal - */ - addArmature(value: ArmatureData): void; /** * - Get a specific armature data. * @param armatureName - The armature data name. @@ -1268,17 +1224,6 @@ declare namespace dragonBones { * @language zh_CN */ getArmature(armatureName: string): ArmatureData | null; - /** - * - Deprecated, please refer to {@link #dragonBones.BaseFactory#removeDragonBonesData()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #dragonBones.BaseFactory#removeDragonBonesData()}。 - * @deprecated - * @language zh_CN - */ - dispose(): void; } } /** @@ -1436,46 +1381,6 @@ declare namespace dragonBones { */ parent: DragonBonesData; protected _onClear(): void; - /** - * @internal - */ - sortBones(): void; - /** - * @internal - */ - cacheFrames(frameRate: number): void; - /** - * @internal - */ - setCacheFrame(globalTransformMatrix: Matrix, transform: Transform): number; - /** - * @internal - */ - getCacheFrame(globalTransformMatrix: Matrix, transform: Transform, arrayOffset: number): void; - /** - * @internal - */ - addBone(value: BoneData): void; - /** - * @internal - */ - addSlot(value: SlotData): void; - /** - * @internal - */ - addConstraint(value: ConstraintData): void; - /** - * @internal - */ - addSkin(value: SkinData): void; - /** - * @internal - */ - addAnimation(value: AnimationData): void; - /** - * @internal - */ - addAction(value: ActionData, isDefault: boolean): void; /** * - Get a specific done data. * @param boneName - The bone name. @@ -1580,6 +1485,10 @@ declare namespace dragonBones { * @language zh_CN */ length: number; + /** + * @private + */ + alpha: number; /** * - The bone name. * @version DragonBones 3.0 @@ -1612,16 +1521,6 @@ declare namespace dragonBones { parent: BoneData | null; protected _onClear(): void; } - /** - * @internal - */ - class SurfaceData extends BoneData { - static toString(): string; - segmentX: number; - segmentY: number; - readonly vertices: Array; - protected _onClear(): void; - } /** * - The slot data. * @version DragonBones 3.0 @@ -1633,14 +1532,6 @@ declare namespace dragonBones { * @language zh_CN */ class SlotData extends BaseObject { - /** - * @internal - */ - static readonly DEFAULT_COLOR: ColorTransform; - /** - * @internal - */ - static createColor(): ColorTransform; static toString(): string; /** * @private @@ -1654,6 +1545,14 @@ declare namespace dragonBones { * @private */ zOrder: number; + /** + * @private + */ + zIndex: number; + /** + * @private + */ + alpha: number; /** * - The slot name. * @version DragonBones 3.0 @@ -1711,7 +1610,7 @@ declare namespace dragonBones { */ declare namespace dragonBones { /** - * @internal + * @private */ abstract class ConstraintData extends BaseObject { order: number; @@ -1722,35 +1621,6 @@ declare namespace dragonBones { bone: BoneData | null; protected _onClear(): void; } - /** - * @internal - */ - class IKConstraintData extends ConstraintData { - static toString(): string; - scaleEnabled: boolean; - bendPositive: boolean; - weight: number; - protected _onClear(): void; - } - /** - * @internal - */ - class PathConstraintData extends ConstraintData { - static toString(): string; - pathSlot: SlotData; - pathDisplayData: PathDisplayData; - bones: Array; - positionMode: PositionMode; - spacingMode: SpacingMode; - rotateMode: RotateMode; - position: number; - spacing: number; - rotateOffset: number; - rotateMix: number; - translateMix: number; - protected _onClear(): void; - AddBone(value: BoneData): void; - } } /** * The MIT License (MIT) @@ -1776,7 +1646,7 @@ declare namespace dragonBones { */ declare namespace dragonBones { /** - * @internal + * @private */ class CanvasData extends BaseObject { static toString(): string; @@ -1844,10 +1714,6 @@ declare namespace dragonBones { */ parent: ArmatureData; protected _onClear(): void; - /** - * @internal - */ - addDisplay(slotName: string, value: DisplayData | null): void; /** * @private */ @@ -1882,19 +1748,21 @@ declare namespace dragonBones { */ declare namespace dragonBones { /** - * @internal + * @private */ - class VerticesData { + class GeometryData { isShared: boolean; inheritDeform: boolean; offset: number; data: DragonBonesData; weight: WeightData | null; clear(): void; - shareFrom(value: VerticesData): void; + shareFrom(value: GeometryData): void; + readonly vertexCount: number; + readonly triangleCount: number; } /** - * @internal + * @private */ abstract class DisplayData extends BaseObject { type: DisplayType; @@ -1905,7 +1773,7 @@ declare namespace dragonBones { protected _onClear(): void; } /** - * @internal + * @private */ class ImageDisplayData extends DisplayData { static toString(): string; @@ -1914,7 +1782,7 @@ declare namespace dragonBones { protected _onClear(): void; } /** - * @internal + * @private */ class ArmatureDisplayData extends DisplayData { static toString(): string; @@ -1928,16 +1796,16 @@ declare namespace dragonBones { addAction(value: ActionData): void; } /** - * @internal + * @private */ class MeshDisplayData extends DisplayData { static toString(): string; - readonly vertices: VerticesData; + readonly geometry: GeometryData; texture: TextureData | null; protected _onClear(): void; } /** - * @internal + * @private */ class BoundingBoxDisplayData extends DisplayData { static toString(): string; @@ -1945,18 +1813,18 @@ declare namespace dragonBones { protected _onClear(): void; } /** - * @internal + * @private */ class PathDisplayData extends DisplayData { static toString(): string; closed: boolean; constantSpeed: boolean; - readonly vertices: VerticesData; + readonly geometry: GeometryData; readonly curveLengths: Array; protected _onClear(): void; } /** - * @internal + * @private */ class WeightData extends BaseObject { static toString(): string; @@ -2255,20 +2123,9 @@ declare namespace dragonBones { class AnimationData extends BaseObject { static toString(): string; /** - * - FrameIntArray. - * @internal - */ - frameIntOffset: number; - /** - * - FrameFloatArray. - * @internal - */ - frameFloatOffset: number; - /** - * - FrameArray. - * @internal + * @private */ - frameOffset: number; + blendType: AnimationBlendType; /** * - The frame count of the animation. * @version DragonBones 3.0 @@ -2340,10 +2197,6 @@ declare namespace dragonBones { * @private */ readonly boneTimelines: Map>; - /** - * @private - */ - readonly surfaceTimelines: Map>; /** * @private */ @@ -2377,26 +2230,18 @@ declare namespace dragonBones { */ parent: ArmatureData; protected _onClear(): void; - /** - * @internal - */ - cacheFrames(frameRate: number): void; - /** - * @private - */ - addBoneTimeline(bone: BoneData, timeline: TimelineData): void; /** * @private */ - addSurfaceTimeline(surface: SurfaceData, timeline: TimelineData): void; + addBoneTimeline(timelineName: string, timeline: TimelineData): void; /** * @private */ - addSlotTimeline(slot: SlotData, timeline: TimelineData): void; + addSlotTimeline(timelineName: string, timeline: TimelineData): void; /** * @private */ - addConstraintTimeline(constraint: ConstraintData, timeline: TimelineData): void; + addConstraintTimeline(timelineName: string, timeline: TimelineData): void; /** * @private */ @@ -2405,10 +2250,6 @@ declare namespace dragonBones { * @private */ getBoneTimelines(timelineName: string): Array | null; - /** - * @private - */ - getSurfaceTimelines(timelineName: string): Array | null; /** * @private */ @@ -2431,7 +2272,7 @@ declare namespace dragonBones { getSlotCachedFrameIndices(slotName: string): Array | null; } /** - * @internal + * @private */ class TimelineData extends BaseObject { static toString(): string; @@ -2520,7 +2361,7 @@ declare namespace dragonBones { /** * @private */ - additiveBlending: boolean; + additive: boolean; /** * - Whether the animation state has control over the display property of the slots. * Sometimes blend a animation state does not want it to control the display properties of the slots, @@ -2723,18 +2564,6 @@ declare namespace dragonBones { * @private */ copyFrom(value: AnimationConfig): void; - /** - * @private - */ - containsBoneMask(boneName: string): boolean; - /** - * @private - */ - addBoneMask(armature: Armature, boneName: string, recursive?: boolean): void; - /** - * @private - */ - removeBoneMask(armature: Armature, boneName: string, recursive?: boolean): void; } } /** @@ -2818,21 +2647,13 @@ declare namespace dragonBones { * @private */ copyFrom(value: TextureAtlasData): void; - /** - * @internal - */ - abstract createTexture(): TextureData; - /** - * @internal - */ - addTexture(value: TextureData): void; /** * @private */ getTexture(textureName: string): TextureData | null; } /** - * @internal + * @private */ abstract class TextureData extends BaseObject { static createRectangle(): Rectangle; @@ -2881,18 +2702,6 @@ declare namespace dragonBones { * @language zh_CN */ interface IArmatureProxy extends IEventDispatcher { - /** - * @internal - */ - dbInit(armature: Armature): void; - /** - * @internal - */ - dbClear(): void; - /** - * @internal - */ - dbUpdate(): void; /** * - Dispose the instance and the Armature instance. (The Armature instance will return to the object pool) * @example @@ -3001,64 +2810,20 @@ declare namespace dragonBones { * @private */ userData: any; - private _lockUpdate; private _slotsDirty; private _zOrderDirty; private _flipX; private _flipY; - /** - * @internal - */ - _cacheFrameIndex: number; + private _alpha; private readonly _bones; private readonly _slots; - /** - * @internal - */ - readonly _constraints: Array; private readonly _actions; - /** - * @internal - */ - _armatureData: ArmatureData; private _animation; private _proxy; private _display; - /** - * @internal - */ - _replaceTextureAtlasData: TextureAtlasData | null; private _replacedTexture; - /** - * @internal - */ - _dragonBones: DragonBones; private _clock; - /** - * @internal - */ - _parent: Slot | null; protected _onClear(): void; - /** - * @internal - */ - _sortZOrder(slotIndices: Array | Int16Array | null, offset: number): void; - /** - * @internal - */ - _addBone(value: Bone): void; - /** - * @internal - */ - _addSlot(value: Slot): void; - /** - * @internal - */ - _addConstraint(value: Constraint): void; - /** - * @internal - */ - _bufferAction(action: EventObject, append: boolean): void; /** * - Dispose the armature. (Return to the object pool) * @example @@ -3080,10 +2845,6 @@ declare namespace dragonBones { * @language zh_CN */ dispose(): void; - /** - * @internal - */ - init(armatureData: ArmatureData, proxy: IArmatureProxy, display: any, dragonBones: DragonBones): void; /** * @inheritDoc */ @@ -3391,55 +3152,6 @@ declare namespace dragonBones { * @language zh_CN */ readonly parent: Slot | null; - /** - * @deprecated - * @private - */ - replaceTexture(texture: any): void; - /** - * - Deprecated, please refer to {@link #eventDispatcher}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #eventDispatcher}。 - * @deprecated - * @language zh_CN - */ - hasEventListener(type: EventStringType): boolean; - /** - * - Deprecated, please refer to {@link #eventDispatcher}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #eventDispatcher}。 - * @deprecated - * @language zh_CN - */ - addEventListener(type: EventStringType, listener: Function, target: any): void; - /** - * - Deprecated, please refer to {@link #eventDispatcher}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #eventDispatcher}。 - * @deprecated - * @language zh_CN - */ - removeEventListener(type: EventStringType, listener: Function, target: any): void; - /** - * - Deprecated, please refer to {@link #cacheFrameRate}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #cacheFrameRate}。 - * @deprecated - * @language zh_CN - */ - enableAnimationCache(frameRate: number): void; /** * - Deprecated, please refer to {@link #display}. * @deprecated @@ -3538,10 +3250,6 @@ declare namespace dragonBones { */ userData: any; protected _globalDirty: boolean; - /** - * @internal - */ - _armature: Armature; /** */ protected _onClear(): void; @@ -3639,55 +3347,15 @@ declare namespace dragonBones { * @language zh_CN */ offsetMode: OffsetMode; - /** - * @internal - */ - readonly animationPose: Transform; - /** - * @internal - */ - _transformDirty: boolean; - /** - * @internal - */ - _childrenTransformDirty: boolean; protected _localDirty: boolean; - /** - * @internal - */ - _hasConstraint: boolean; protected _visible: boolean; protected _cachedFrameIndex: number; - /** - * @internal - */ - readonly _blendState: BlendState; - /** - * @internal - */ - _boneData: BoneData; /** * @private */ protected _parent: Bone | null; - /** - * @internal - */ - _cachedFrameIndices: Array | null; protected _onClear(): void; protected _updateGlobalTransformMatrix(isCache: boolean): void; - /** - * @internal - */ - init(boneData: BoneData, armatureValue: Armature): void; - /** - * @internal - */ - update(cacheFrameIndex: number): void; - /** - * @internal - */ - updateByConstraint(): void; /** * - Forces the bone to update the transform in the next frame. * When the bone is not animated or its animation state is finished, the bone will not continue to update, @@ -3775,39 +3443,6 @@ declare namespace dragonBones { * @language zh_CN */ readonly parent: Bone | null; - /** - * - Deprecated, please refer to {@link dragonBones.Armature#getBones()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.Armature#getBones()}。 - * @deprecated - * @language zh_CN - */ - getBones(): Array; - /** - * - Deprecated, please refer to {@link dragonBones.Armature#getSlots()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.Armature#getSlots()}。 - * @deprecated - * @language zh_CN - */ - getSlots(): Array; - /** - * - Deprecated, please refer to {@link dragonBones.Armature#getSlot()}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.Armature#getSlot()}。 - * @deprecated - * @language zh_CN - */ - readonly slot: Slot | null; } } /** @@ -3833,41 +3468,6 @@ declare namespace dragonBones { * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ declare namespace dragonBones { - /** - * @internal - */ - class Surface extends Bone { - static toString(): string; - private _dX; - private _dY; - private _k; - private _kX; - private _kY; - readonly _vertices: Array; - readonly _deformVertices: Array; - /** - * - x1, y1, x2, y2, x3, y3, x4, y4, d1X, d1Y, d2X, d2Y - */ - private readonly _hullCache; - /** - * - Inside [flag, a, b, c, d, tx, ty], Outside [flag, a, b, c, d, tx, ty] - */ - private readonly _matrixCahce; - protected _onClear(): void; - private _getAffineTransform(x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown); - private _updateVertices(); - protected _updateGlobalTransformMatrix(isCache: boolean): void; - _getGlobalTransformMatrix(x: number, y: number): Matrix; - /** - * @internal - * @private - */ - init(surfaceData: SurfaceData, armatureValue: Armature): void; - /** - * @internal - */ - update(cacheFrameIndex: number): void; - } } /** * The MIT License (MIT) @@ -3892,6 +3492,22 @@ declare namespace dragonBones { * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ declare namespace dragonBones { + /** + * @private + */ + class DisplayFrame extends BaseObject { + static toString(): string; + rawDisplayData: DisplayData | null; + displayData: DisplayData | null; + textureData: TextureData | null; + display: any | Armature | null; + readonly deformVertices: Array; + protected _onClear(): void; + updateDeformVertices(): void; + getGeometryData(): GeometryData | null; + getBoundingBox(): BoundingBoxData | null; + getTextureData(): TextureData | null; + } /** * - The slot attached to the armature, controls the display status and properties of the display object. * A bone can contain multiple slots. @@ -3936,66 +3552,30 @@ declare namespace dragonBones { * @language zh_CN */ displayController: string | null; + protected _displayDataDirty: boolean; protected _displayDirty: boolean; - protected _zOrderDirty: boolean; + protected _geometryDirty: boolean; + protected _textureDirty: boolean; protected _visibleDirty: boolean; protected _blendModeDirty: boolean; - /** - * @internal - */ - _colorDirty: boolean; + protected _zOrderDirty: boolean; protected _transformDirty: boolean; protected _visible: boolean; protected _blendMode: BlendMode; protected _displayIndex: number; protected _animationDisplayIndex: number; - /** - * @internal - */ - _zOrder: number; protected _cachedFrameIndex: number; - /** - * @internal - */ - _pivotX: number; - /** - * @internal - */ - _pivotY: number; protected readonly _localMatrix: Matrix; - /** - * @internal - */ - readonly _colorTransform: ColorTransform; - protected readonly _displayDatas: Array; - protected readonly _displayList: Array; - /** - * @internal - */ - _slotData: SlotData; - protected _rawDisplayDatas: Array | null; - /** - * @internal - */ - _displayData: DisplayData | null; protected _boundingBoxData: BoundingBoxData | null; protected _textureData: TextureData | null; - /** - * @internal - */ - _deformVertices: DeformVertices | null; protected _rawDisplay: any; protected _meshDisplay: any; - protected _display: any; + protected _display: any | null; protected _childArmature: Armature | null; /** * @private */ protected _parent: Bone; - /** - * @internal - */ - _cachedFrameIndices: Array | null; protected _onClear(): void; protected abstract _initDisplay(value: any, isRetain: boolean): void; protected abstract _disposeDisplay(value: any, isRelease: boolean): void; @@ -4004,59 +3584,47 @@ declare namespace dragonBones { protected abstract _replaceDisplay(value: any): void; protected abstract _removeDisplay(): void; protected abstract _updateZOrder(): void; - /** - * @internal - */ - abstract _updateVisible(): void; protected abstract _updateBlendMode(): void; protected abstract _updateColor(): void; protected abstract _updateFrame(): void; protected abstract _updateMesh(): void; - /** - * @internal - */ - abstract _updateGlueMesh(): void; protected abstract _updateTransform(): void; protected abstract _identityTransform(): void; - /** - * - Support default skin data. - */ - protected _getDefaultRawDisplayData(displayIndex: number): DisplayData | null; + protected _hasDisplay(display: any): boolean; protected _updateDisplayData(): void; protected _updateDisplay(): void; protected _updateGlobalTransformMatrix(isCache: boolean): void; /** - * @internal - */ - _setDisplayIndex(value: number, isAnimation?: boolean): boolean; - /** - * @internal + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US */ - _setZorder(value: number): boolean; /** - * @internal + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN */ - _setColor(value: ColorTransform): boolean; + invalidUpdate(): void; /** - * @internal + * @private */ - _setDisplayList(value: Array | null): boolean; + updateTransformAndMatrix(): void; /** - * @internal + * @private */ - init(slotData: SlotData, armatureValue: Armature, rawDisplay: any, meshDisplay: any): void; + replaceRawDisplayData(displayData: DisplayData | null, index?: number): void; /** - * @internal + * @private */ - update(cacheFrameIndex: number): void; + replaceDisplayData(displayData: DisplayData | null, index?: number): void; /** * @private */ - updateTransformAndMatrix(): void; + replaceTextureData(textureData: TextureData | null, index?: number): void; /** * @private */ - replaceDisplayData(value: DisplayData | null, displayIndex?: number): void; + replaceDisplay(value: any | Armature | null, index?: number): void; /** * - Check whether a specific point is inside a custom bounding box in the slot. * The coordinate system of the point is the inner coordinate system of the armature. @@ -4117,16 +3685,9 @@ declare namespace dragonBones { y: number; } | null): number; /** - * - Forces the slot to update the state of the display object in the next frame. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 强制插槽在下一帧更新显示对象的状态。 - * @version DragonBones 4.5 - * @language zh_CN + * @private */ - invalidUpdate(): void; + getDisplayFrameAt(index: number): DisplayFrame; /** * - The visible of slot's display object. * @default true @@ -4140,6 +3701,10 @@ declare namespace dragonBones { * @language zh_CN */ visible: boolean; + /** + * @private + */ + displayFrameCount: number; /** * - The index of the display object displayed in the display list. * @example @@ -4200,14 +3765,6 @@ declare namespace dragonBones { * @language zh_CN */ readonly slotData: SlotData; - /** - * @private - */ - rawDisplayDatas: Array | null; - /** - * @private - */ - readonly displayData: DisplayData | null; /** * - The custom bounding box data for the slot at current time. * @version DragonBones 5.0 @@ -4253,9 +3810,9 @@ declare namespace dragonBones { * @example *
          *     let slot = armature.getSlot("weapon");
-         * let prevChildArmature = slot.childArmature;
-         * if (prevChildArmature) {
-         * prevChildArmature.dispose();
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
          *     }
          *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
          * 
@@ -4268,9 +3825,9 @@ declare namespace dragonBones { * @example *
          *     let slot = armature.getSlot("weapon");
-         * let prevChildArmature = slot.childArmature;
-         * if (prevChildArmature) {
-         * prevChildArmature.dispose();
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
          *     }
          *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
          * 
@@ -4336,125 +3893,6 @@ declare namespace dragonBones { * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ declare namespace dragonBones { - /** - * @internal - */ - abstract class Constraint extends BaseObject { - protected static readonly _helpMatrix: Matrix; - protected static readonly _helpTransform: Transform; - protected static readonly _helpPoint: Point; - /** - * - For timeline state. - * @internal - */ - _constraintData: ConstraintData; - protected _armature: Armature; - /** - * - For sort bones. - * @internal - */ - _target: Bone; - /** - * - For sort bones. - * @internal - */ - _root: Bone; - protected _bone: Bone | null; - protected _onClear(): void; - abstract init(constraintData: ConstraintData, armature: Armature): void; - abstract update(): void; - abstract invalidUpdate(): void; - readonly name: string; - } - /** - * @internal - */ - class IKConstraint extends Constraint { - static toString(): string; - private _scaleEnabled; - /** - * - For timeline state. - * @internal - */ - _bendPositive: boolean; - /** - * - For timeline state. - * @internal - */ - _weight: number; - protected _onClear(): void; - private _computeA(); - private _computeB(); - init(constraintData: ConstraintData, armature: Armature): void; - update(): void; - invalidUpdate(): void; - } - /** - * @internal - */ - class PathConstraint extends Constraint { - dirty: boolean; - pathOffset: number; - position: number; - spacing: number; - rotateOffset: number; - rotateMix: number; - translateMix: number; - private _pathSlot; - private _bones; - private _spaces; - private _positions; - private _curves; - private _boneLengths; - private _pathGlobalVertices; - private _segments; - static toString(): string; - protected _onClear(): void; - protected _updatePathVertices(verticesData: VerticesData): void; - protected _computeVertices(start: number, count: number, offset: number, out: Array): void; - protected _computeBezierCurve(pathDisplayDta: PathDisplayData, spaceCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): void; - private addCurvePosition(t, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, offset, tangents); - init(constraintData: ConstraintData, armature: Armature): void; - update(): void; - invalidUpdate(): void; - } -} -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -declare namespace dragonBones { - /** - * @internal - */ - class DeformVertices extends BaseObject { - static toString(): string; - verticesDirty: boolean; - readonly vertices: Array; - readonly bones: Array; - verticesData: VerticesData | null; - protected _onClear(): void; - init(verticesDataValue: VerticesData | null, armature: Armature): void; - isBonesUpdate(): boolean; - } } /** * The MIT License (MIT) @@ -4679,17 +4117,6 @@ declare namespace dragonBones { * @inheritDoc */ clock: WorldClock | null; - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#clock}。 - * @deprecated - * @language zh_CN - */ - static readonly clock: WorldClock; } } /** @@ -4744,25 +4171,20 @@ declare namespace dragonBones { * @language zh_CN */ timeScale: number; - private _lockUpdate; + /** + * Update bones and slots cachedFrameIndices. + */ private _animationDirty; private _inheritTimeScale; private readonly _animationNames; private readonly _animationStates; private readonly _animations; + private readonly _blendStates; private _armature; private _animationConfig; private _lastAnimationState; protected _onClear(): void; private _fadeOut(animationConfig); - /** - * @internal - */ - init(armature: Armature): void; - /** - * @internal - */ - advanceTime(passedTime: number): void; /** * - Clear all animations states. * @see dragonBones.AnimationState @@ -4983,6 +4405,7 @@ declare namespace dragonBones { /** * - Get a specific animation state. * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) * @example *
          *     armature.animation.play("walk");
@@ -4993,8 +4416,9 @@ declare namespace dragonBones {
          * @language en_US
          */
         /**
-         * - 获取指定的动画状态
+         * - 获取指定的动画状态。
          * @param animationName - 动画状态名称。
+         * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1)
          * @example
          * 
          *     armature.animation.play("walk");
@@ -5004,7 +4428,7 @@ declare namespace dragonBones {
          * @version DragonBones 3.0
          * @language zh_CN
          */
-        getState(animationName: string): AnimationState | null;
+        getState(animationName: string, layer?: number): AnimationState | null;
         /**
          * - Check whether a specific animation data is included.
          * @param animationName - The name of animation data.
@@ -5030,7 +4454,7 @@ declare namespace dragonBones {
          * @version DragonBones 5.1
          * @language zh_CN
          */
-        getStates(): Array;
+        getStates(): ReadonlyArray;
         /**
          * - Check whether there is an animation state is playing
          * @see dragonBones.AnimationState
@@ -5080,7 +4504,7 @@ declare namespace dragonBones {
          * @version DragonBones 4.5
          * @language zh_CN
          */
-        readonly animationNames: Array;
+        readonly animationNames: ReadonlyArray;
         /**
          * - All animation data.
          * @version DragonBones 4.5
@@ -5118,50 +4542,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly lastAnimationState: AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #play()} {@link #fadeIn()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #play()} {@link #fadeIn()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        gotoAndPlay(animationName: string, fadeInTime?: number, duration?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode, pauseFadeOut?: boolean, pauseFadeIn?: boolean): AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #gotoAndStopByTime()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #gotoAndStopByTime()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        gotoAndStop(animationName: string, time?: number): AnimationState | null;
-        /**
-         * - Deprecated, please refer to {@link #animationNames}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #animationNames}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly animationList: Array;
-        /**
-         * - Deprecated, please refer to {@link #animationNames}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #animationNames}。
-         * @deprecated
-         * @language zh_CN
-         */
-        readonly animationDataList: Array;
     }
 }
 /**
@@ -5210,7 +4590,7 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        additiveBlending: boolean;
+        additive: boolean;
         /**
          * - Whether the animation state has control over the display object properties of the slots.
          * Sometimes blend a animation state does not want it to control the display object properties of the slots,
@@ -5243,6 +4623,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         resetToPose: boolean;
+        /**
+         * @private
+         */
+        blendType: AnimationBlendType;
         /**
          * - The play times. [0: Loop play, [1~N]: Play N times]
          * @version DragonBones 3.0
@@ -5289,18 +4673,21 @@ declare namespace dragonBones {
          */
         timeScale: number;
         /**
-         * - The blend weight.
-         * @default 1.0
-         * @version DragonBones 5.0
-         * @language en_US
+         * @private
          */
+        parameterX: number;
         /**
-         * - 混合权重。
-         * @default 1.0
-         * @version DragonBones 5.0
-         * @language zh_CN
+         * @private
          */
-        weight: number;
+        parameterY: number;
+        /**
+         * @private
+         */
+        positionX: number;
+        /**
+         * @private
+         */
+        positionY: number;
         /**
          * - The auto fade out time when the animation state play completed.
          * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds)
@@ -5349,77 +4736,26 @@ declare namespace dragonBones {
          */
         group: string;
         private _timelineDirty;
-        /**
-         * - xx: Play Enabled, Fade Play Enabled
-         * @internal
-         */
-        _playheadState: number;
-        /**
-         * -1: Fade in, 0: Fade complete, 1: Fade out;
-         * @internal
-         */
-        _fadeState: number;
-        /**
-         * -1: Fade start, 0: Fading, 1: Fade complete;
-         * @internal
-         */
-        _subFadeState: number;
-        /**
-         * @internal
-         */
-        _position: number;
-        /**
-         * @internal
-         */
-        _duration: number;
+        private _weight;
         private _fadeTime;
         private _time;
-        /**
-         * @internal
-         */
-        _fadeProgress: number;
-        /**
-         * @internal
-         */
-        _weightResult: number;
-        /**
-         * @internal
-         */
-        readonly _blendState: BlendState;
         private readonly _boneMask;
         private readonly _boneTimelines;
-        private readonly _surfaceTimelines;
+        private readonly _boneBlendTimelines;
         private readonly _slotTimelines;
+        private readonly _slotBlendTimelines;
         private readonly _constraintTimelines;
         private readonly _animationTimelines;
         private readonly _poseTimelines;
-        private readonly _bonePoses;
-        /**
-         * @internal
-         */
-        _animationData: AnimationData;
+        private _animationData;
         private _armature;
-        /**
-         * @internal
-         */
-        _actionTimeline: ActionTimelineState;
         private _zOrderTimeline;
-        /**
-         * @internal
-         */
-        _parent: AnimationState;
+        private _activeChildA;
+        private _activeChildB;
         protected _onClear(): void;
         private _updateTimelines();
         private _updateBoneAndSlotTimelines();
         private _advanceFadeTime(passedTime);
-        /**
-         * @internal
-         */
-        init(armature: Armature, animationData: AnimationData, animationConfig: AnimationConfig): void;
-        /**
-         * @internal
-         */
-        advanceTime(passedTime: number, cacheFrameRate: number): void;
         /**
          * - Continue play.
          * @version DragonBones 3.0
@@ -5511,6 +4847,10 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         removeAllBoneMask(): void;
+        /**
+         * @private
+         */
+        addState(animationState: AnimationState, timelineDatas?: TimelineData[] | null): void;
         /**
          * - Whether the animation state is fading in.
          * @version DragonBones 5.1
@@ -5599,12 +4939,25 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         currentTime: number;
+        /**
+         * - The blend weight.
+         * @default 1.0
+         * @version DragonBones 5.0
+         * @language en_US
+         */
+        /**
+         * - 混合权重。
+         * @default 1.0
+         * @version DragonBones 5.0
+         * @language zh_CN
+         */
         /**
          * - The animation data.
          * @see dragonBones.AnimationData
          * @version DragonBones 3.0
          * @language en_US
          */
+        weight: number;
         /**
          * - 动画数据。
          * @see dragonBones.AnimationData
@@ -5613,31 +4966,6 @@ declare namespace dragonBones {
          */
         readonly animationData: AnimationData;
     }
-    /**
-     * @internal
-     */
-    class BonePose extends BaseObject {
-        static toString(): string;
-        readonly current: Transform;
-        readonly delta: Transform;
-        readonly result: Transform;
-        protected _onClear(): void;
-    }
-    /**
-     * @internal
-     */
-    class BlendState {
-        dirty: boolean;
-        layer: number;
-        leftWeight: number;
-        layerWeight: number;
-        blendWeight: number;
-        /**
-         * -1: First blending, 0: No blending, 1: Blending.
-         */
-        update(weight: number, p_layer: number): number;
-        clear(): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -5662,93 +4990,6 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
-    /**
-     * @internal
-     */
-    const enum TweenState {
-        None = 0,
-        Once = 1,
-        Always = 2,
-    }
-    /**
-     * @internal
-     */
-    abstract class TimelineState extends BaseObject {
-        /**
-         * -1: start, 0: play, 1: complete;
-         */
-        playState: number;
-        currentPlayTimes: number;
-        currentTime: number;
-        protected _tweenState: TweenState;
-        protected _frameRate: number;
-        protected _frameValueOffset: number;
-        protected _frameCount: number;
-        protected _frameOffset: number;
-        protected _frameIndex: number;
-        protected _frameRateR: number;
-        protected _position: number;
-        protected _duration: number;
-        protected _timeScale: number;
-        protected _timeOffset: number;
-        protected _dragonBonesData: DragonBonesData;
-        protected _animationData: AnimationData;
-        protected _timelineData: TimelineData | null;
-        protected _armature: Armature;
-        protected _animationState: AnimationState;
-        protected _actionTimeline: TimelineState;
-        protected _frameArray: Array | Int16Array;
-        protected _frameIntArray: Array | Int16Array;
-        protected _frameFloatArray: Array | Int16Array;
-        protected _timelineArray: Array | Uint16Array;
-        protected _frameIndices: Array;
-        protected _onClear(): void;
-        protected abstract _onArriveAtFrame(): void;
-        protected abstract _onUpdateFrame(): void;
-        protected _setCurrentTime(passedTime: number): boolean;
-        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        fadeOut(): void;
-        update(passedTime: number): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class TweenTimelineState extends TimelineState {
-        private static _getEasingValue(tweenType, progress, easing);
-        private static _getEasingCurveValue(progress, samples, count, offset);
-        protected _tweenType: TweenType;
-        protected _curveCount: number;
-        protected _framePosition: number;
-        protected _frameDurationR: number;
-        protected _tweenProgress: number;
-        protected _tweenEasing: number;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class BoneTimelineState extends TweenTimelineState {
-        bone: Bone;
-        bonePose: BonePose;
-        protected _onClear(): void;
-        blend(state: number): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class SlotTimelineState extends TweenTimelineState {
-        slot: Slot;
-        protected _onClear(): void;
-    }
-    /**
-     * @internal
-     */
-    abstract class ConstraintTimelineState extends TweenTimelineState {
-        constraint: Constraint;
-        protected _onClear(): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -5773,144 +5014,6 @@ declare namespace dragonBones {
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 declare namespace dragonBones {
-    /**
-     * @internal
-     */
-    class ActionTimelineState extends TimelineState {
-        static toString(): string;
-        private _onCrossFrame(frameIndex);
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        update(passedTime: number): void;
-        setCurrentTime(value: number): void;
-    }
-    /**
-     * @internal
-     */
-    class ZOrderTimelineState extends TimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneAllTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        fadeOut(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneTranslateTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneRotateTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        fadeOut(): void;
-    }
-    /**
-     * @internal
-     */
-    class BoneScaleTimelineState extends BoneTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class SurfaceTimelineState extends TweenTimelineState {
-        static toString(): string;
-        surface: Surface;
-        private _frameFloatOffset;
-        private _valueCount;
-        private _deformCount;
-        private _valueOffset;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        blend(state: number): void;
-    }
-    /**
-     * @internal
-     */
-    class SlotDislayTimelineState extends SlotTimelineState {
-        static toString(): string;
-        protected _onArriveAtFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class SlotColorTimelineState extends SlotTimelineState {
-        static toString(): string;
-        private _dirty;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        fadeOut(): void;
-        update(passedTime: number): void;
-    }
-    /**
-     * @internal
-     */
-    class DeformTimelineState extends SlotTimelineState {
-        static toString(): string;
-        vertexOffset: number;
-        private _dirty;
-        private _frameFloatOffset;
-        private _valueCount;
-        private _deformCount;
-        private _valueOffset;
-        private readonly _current;
-        private readonly _delta;
-        private readonly _result;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
-        fadeOut(): void;
-        update(passedTime: number): void;
-    }
-    /**
-     * @internal
-     */
-    class IKConstraintTimelineState extends ConstraintTimelineState {
-        static toString(): string;
-        private _current;
-        private _delta;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-    }
-    /**
-     * @internal
-     */
-    class AnimationTimelineState extends TweenTimelineState {
-        static toString(): string;
-        animationState: AnimationState;
-        private readonly _floats;
-        protected _onClear(): void;
-        protected _onArriveAtFrame(): void;
-        protected _onUpdateFrame(): void;
-        blend(state: number): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -6046,11 +5149,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         static readonly SOUND_EVENT: string;
-        /**
-         * @internal
-         * @private
-         */
-        static actionDataToInstance(data: ActionData, instance: EventObject, armature: Armature): void;
         static toString(): string;
         /**
          * - If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds)
@@ -6264,39 +5362,6 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void;
-        /**
-         * - Deprecated, please refer to {@link #hasDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #hasDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        hasEvent(type: EventStringType): boolean;
-        /**
-         * - Deprecated, please refer to {@link #addDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #addDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        addEvent(type: EventStringType, listener: Function, thisObject: any): void;
-        /**
-         * - Deprecated, please refer to {@link #removeDBEventListener()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #removeDBEventListener()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        removeEvent(type: EventStringType, listener: Function, thisObject: any): void;
     }
 }
 /**
@@ -6323,7 +5388,7 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     abstract class DataParser {
         protected static readonly DATA_VERSION_2_3: string;
@@ -6332,6 +5397,7 @@ declare namespace dragonBones {
         protected static readonly DATA_VERSION_4_5: string;
         protected static readonly DATA_VERSION_5_0: string;
         protected static readonly DATA_VERSION_5_5: string;
+        protected static readonly DATA_VERSION_5_6: string;
         protected static readonly DATA_VERSION: string;
         protected static readonly DATA_VERSIONS: Array;
         protected static readonly TEXTURE_ATLAS: string;
@@ -6348,18 +5414,19 @@ declare namespace dragonBones {
         protected static readonly DRADON_BONES: string;
         protected static readonly USER_DATA: string;
         protected static readonly ARMATURE: string;
+        protected static readonly CANVAS: string;
         protected static readonly BONE: string;
         protected static readonly SURFACE: string;
         protected static readonly SLOT: string;
         protected static readonly CONSTRAINT: string;
-        protected static readonly IK: string;
-        protected static readonly PATH_CONSTRAINT: string;
         protected static readonly SKIN: string;
         protected static readonly DISPLAY: string;
+        protected static readonly FRAME: string;
+        protected static readonly IK: string;
+        protected static readonly PATH_CONSTRAINT: string;
         protected static readonly ANIMATION: string;
-        protected static readonly Z_ORDER: string;
+        protected static readonly TIMELINE: string;
         protected static readonly FFD: string;
-        protected static readonly FRAME: string;
         protected static readonly TRANSLATE_FRAME: string;
         protected static readonly ROTATE_FRAME: string;
         protected static readonly SCALE_FRAME: string;
@@ -6371,7 +5438,6 @@ declare namespace dragonBones {
         protected static readonly INTS: string;
         protected static readonly FLOATS: string;
         protected static readonly STRINGS: string;
-        protected static readonly CANVAS: string;
         protected static readonly TRANSFORM: string;
         protected static readonly PIVOT: string;
         protected static readonly AABB: string;
@@ -6389,6 +5455,8 @@ declare namespace dragonBones {
         protected static readonly PATH: string;
         protected static readonly LENGTH: string;
         protected static readonly DISPLAY_INDEX: string;
+        protected static readonly Z_ORDER: string;
+        protected static readonly Z_INDEX: string;
         protected static readonly BLEND_MODE: string;
         protected static readonly INHERIT_TRANSLATION: string;
         protected static readonly INHERIT_ROTATION: string;
@@ -6401,6 +5469,7 @@ declare namespace dragonBones {
         protected static readonly BEND_POSITIVE: string;
         protected static readonly CHAIN: string;
         protected static readonly WEIGHT: string;
+        protected static readonly BLEND_TYPE: string;
         protected static readonly FADE_IN_TIME: string;
         protected static readonly PLAY_TIMES: string;
         protected static readonly SCALE: string;
@@ -6424,6 +5493,7 @@ declare namespace dragonBones {
         protected static readonly VALUE: string;
         protected static readonly ROTATE: string;
         protected static readonly SKEW: string;
+        protected static readonly ALPHA: string;
         protected static readonly ALPHA_OFFSET: string;
         protected static readonly RED_OFFSET: string;
         protected static readonly GREEN_OFFSET: string;
@@ -6438,8 +5508,6 @@ declare namespace dragonBones {
         protected static readonly WEIGHTS: string;
         protected static readonly SLOT_POSE: string;
         protected static readonly BONE_POSE: string;
-        protected static readonly GLUE_WEIGHTS: string;
-        protected static readonly GLUE_MESHES: string;
         protected static readonly BONES: string;
         protected static readonly POSITION_MODE: string;
         protected static readonly SPACING_MODE: string;
@@ -6457,37 +5525,16 @@ declare namespace dragonBones {
         protected static readonly DEFAULT_NAME: string;
         protected static _getArmatureType(value: string): ArmatureType;
         protected static _getBoneType(value: string): BoneType;
-        protected static _getDisplayType(value: string): DisplayType;
-        protected static _getBoundingBoxType(value: string): BoundingBoxType;
-        protected static _getActionType(value: string): ActionType;
-        protected static _getBlendMode(value: string): BlendMode;
         protected static _getPositionMode(value: string): PositionMode;
         protected static _getSpacingMode(value: string): SpacingMode;
         protected static _getRotateMode(value: string): RotateMode;
+        protected static _getDisplayType(value: string): DisplayType;
+        protected static _getBoundingBoxType(value: string): BoundingBoxType;
+        protected static _getBlendMode(value: string): BlendMode;
+        protected static _getAnimationBlendType(value: string): AnimationBlendType;
+        protected static _getActionType(value: string): ActionType;
         abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null;
         abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static parseDragonBonesData(rawData: any): DragonBonesData | null;
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static parseTextureAtlasData(rawData: any, scale?: number): any;
     }
 }
 /**
@@ -6514,7 +5561,15 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
+     */
+    const enum FrameValueType {
+        Step = 0,
+        Int = 1,
+        Float = 2,
+    }
+    /**
+     * @private
      */
     class ObjectDataParser extends DataParser {
         protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean;
@@ -6525,16 +5580,19 @@ declare namespace dragonBones {
         protected _data: DragonBonesData;
         protected _armature: ArmatureData;
         protected _bone: BoneData;
-        protected _surface: SurfaceData;
+        protected _geometry: GeometryData;
         protected _slot: SlotData;
         protected _skin: SkinData;
         protected _mesh: MeshDisplayData;
         protected _animation: AnimationData;
         protected _timeline: TimelineData;
         protected _rawTextureAtlases: Array | null;
+        private _frameValueType;
         private _defaultColorOffset;
         private _prevClockwise;
         private _prevRotation;
+        private _frameDefaultValue;
+        private _frameValueScale;
         private readonly _helpMatrixA;
         private readonly _helpMatrixB;
         private readonly _helpTransform;
@@ -6547,6 +5605,7 @@ declare namespace dragonBones {
         private readonly _frameFloatArray;
         private readonly _frameArray;
         private readonly _timelineArray;
+        private readonly _colorArray;
         private readonly _cacheRawMeshes;
         private readonly _cacheMeshes;
         private readonly _actionFrames;
@@ -6568,30 +5627,31 @@ declare namespace dragonBones {
         protected _parsePath(rawData: any, display: PathDisplayData): void;
         protected _parsePivot(rawData: any, display: ImageDisplayData): void;
         protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;
-        protected _parseMeshGlue(rawData: any, mesh: MeshDisplayData): void;
         protected _parseBoundingBox(rawData: any): BoundingBoxData | null;
         protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData;
         protected _parseAnimation(rawData: any): AnimationData;
-        protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, type: TimelineType, addIntOffset: boolean, addFloatOffset: boolean, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number): TimelineData | null;
+        protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, timelineType: TimelineType, frameValueType: FrameValueType, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number, timeline?: TimelineData | null): TimelineData | null;
         protected _parseBoneTimeline(rawData: any): void;
         protected _parseSlotTimeline(rawData: any): void;
         protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseSingleValueFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseDoubleValueFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number;
         protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseSurfaceFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseSlotFFDFrame(rawData: any, frameStart: number, frameCount: number): number;
+        protected _parseSlotDeformFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number;
-        protected _parseAnimationFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array;
+        protected _parseDeformFrame(rawData: any, frameStart: number, frameCount: number): number;
         protected _parseTransform(rawData: any, transform: Transform, scale: number): void;
         protected _parseColorTransform(rawData: any, color: ColorTransform): void;
+        protected _parseGeometry(rawData: any, geometry: GeometryData): void;
         protected _parseArray(rawData: any): void;
         protected _modifyArray(): void;
         parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;
@@ -6610,7 +5670,7 @@ declare namespace dragonBones {
         static getInstance(): ObjectDataParser;
     }
     /**
-     * @internal
+     * @private
      */
     class ActionFrame {
         frameStart: number;
@@ -6641,25 +5701,19 @@ declare namespace dragonBones {
  */
 declare namespace dragonBones {
     /**
-     * @internal
+     * @private
      */
     class BinaryDataParser extends ObjectDataParser {
         private _binaryOffset;
         private _binary;
         private _intArrayBuffer;
-        private _floatArrayBuffer;
-        private _frameIntArrayBuffer;
-        private _frameFloatArrayBuffer;
         private _frameArrayBuffer;
         private _timelineArrayBuffer;
         private _inRange(a, min, max);
         private _decodeUTF8(data);
-        private _getUTF16Key(value);
         private _parseBinaryTimeline(type, offset, timelineData?);
-        private _parseVertices(rawData, vertices);
-        protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;
-        protected _parsePath(rawData: any, path: PathDisplayData): void;
         protected _parseAnimation(rawData: any): AnimationData;
+        protected _parseGeometry(rawData: any, geometry: GeometryData): void;
         protected _parseArray(rawData: any): void;
         parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;
         private static _binaryDataParserInstance;
@@ -6752,8 +5806,8 @@ declare namespace dragonBones {
          */
         protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void;
         protected _buildConstraints(dataPackage: BuildArmaturePackage, armature: Armature): void;
-        protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, slot: Slot, displayData: DisplayData): Armature | null;
-        protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, rawDisplayData: DisplayData | null, slot: Slot): any;
+        protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, _slot: Slot, displayData: ArmatureDisplayData): Armature | null;
+        protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, slot: Slot): any;
         protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData;
         protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature;
         protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;
@@ -6814,9 +5868,20 @@ declare namespace dragonBones {
          */
         parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData;
         /**
-         * @private
+         * - Update texture atlases.
+         * @param textureAtlases - The texture atlas objects.
+         * @param name - The texture atlas name.
+         * @version DragonBones 5.7
+         * @language en_US
          */
-        updateTextureAtlasData(name: string, textureAtlases: Array): void;
+        /**
+         * - 更新贴图集对象。
+         * @param textureAtlases - 多个贴图集对象。
+         * @param name - 贴图集名称。
+         * @version DragonBones 5.7
+         * @language zh_CN
+         */
+        updateTextureAtlases(textureAtlases: Array, name: string): void;
         /**
          * - Get a specific DragonBonesData instance.
          * @param name - The DragonBonesData instance cache name.
@@ -7021,7 +6086,7 @@ declare namespace dragonBones {
         /**
          * @private
          */
-        replaceDisplay(slot: Slot, displayData: DisplayData, displayIndex?: number): void;
+        replaceDisplay(slot: Slot, displayData: DisplayData | null, displayIndex?: number): void;
         /**
          * - Replaces the current display data for a particular slot with a specific display data.
          * Specify display data with "dragonBonesName/armatureName/slotName/displayName".
@@ -7162,31 +6227,9 @@ declare namespace dragonBones {
          * @private
          */
         readonly dragonBones: DragonBones;
-        /**
-         * - Deprecated, please refer to {@link #replaceSkin}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceSkin}。
-         * @deprecated
-         * @language zh_CN
-         */
-        changeSkin(armature: Armature, skin: SkinData, exclude?: Array | null): boolean;
-        /**
-         * - Deprecated, please refer to {@link #replaceAnimation}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceAnimation}。
-         * @deprecated
-         * @language zh_CN
-         */
-        copyAnimationsToArmature(toArmature: Armature, fromArmatreName: string, fromSkinName?: string, fromDragonBonesDataName?: string, replaceOriginalAnimation?: boolean): boolean;
     }
     /**
-     * @internal
+     * @private
      */
     class BuildArmaturePackage {
         dataName: string;
@@ -7249,14 +6292,6 @@ declare namespace dragonBones {
          */
         renderTexture: PIXI.BaseTexture | null;
     }
-    /**
-     * @internal
-     */
-    class PixiTextureData extends TextureData {
-        static toString(): string;
-        renderTexture: PIXI.Texture | null;
-        protected _onClear(): void;
-    }
 }
 /**
  * The MIT License (MIT)
@@ -7336,18 +6371,6 @@ declare namespace dragonBones {
          * @inheritDoc
          */
         readonly animation: Animation;
-        /**
-         * @inheritDoc
-         */
-        hasEvent(type: EventStringType): boolean;
-        /**
-         * @inheritDoc
-         */
-        addEvent(type: EventStringType, listener: (event: EventObject) => void, target: any): void;
-        /**
-         * @inheritDoc
-         */
-        removeEvent(type: EventStringType, listener: (event: EventObject) => void, target: any): void;
     }
 }
 /**
@@ -7395,18 +6418,10 @@ declare namespace dragonBones {
         protected _replaceDisplay(value: any): void;
         protected _removeDisplay(): void;
         protected _updateZOrder(): void;
-        /**
-         * @internal
-         */
-        _updateVisible(): void;
         protected _updateBlendMode(): void;
         protected _updateColor(): void;
         protected _updateFrame(): void;
         protected _updateMesh(): void;
-        /**
-         * @internal
-         */
-        _updateGlueMesh(): void;
         protected _updateTransform(): void;
         protected _updateTransformV3(): void;
         protected _updateTransformV4(): void;
@@ -7450,7 +6465,6 @@ declare namespace dragonBones {
         private static _dragonBonesInstance;
         private static _factory;
         private static _clockHandler(passedTime);
-        private static _createDragonBones();
         /**
          * - A global factory instance that can be used directly.
          * @version DragonBones 4.7
@@ -7468,7 +6482,7 @@ declare namespace dragonBones {
         constructor(dataParser?: DataParser | null);
         protected _buildTextureAtlasData(textureAtlasData: PixiTextureAtlasData | null, textureAtlas: PIXI.BaseTexture | null): PixiTextureAtlasData;
         protected _buildArmature(dataPackage: BuildArmaturePackage): Armature;
-        protected _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;
+        protected _buildSlot(_dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;
         /**
          * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it.
          * The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update.
@@ -7476,6 +6490,8 @@ declare namespace dragonBones {
          * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature)
          * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data)
          * @returns The armature display container.
+         * @see dragonBones.IArmatureProxy
+         * @see dragonBones.BaseFactory#buildArmature
          * @version DragonBones 4.5
          * @example
          * 
@@ -7490,6 +6506,8 @@ declare namespace dragonBones {
          * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架)
          * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。 (如果未设置,则使用默认的皮肤数据)
          * @returns 骨架的显示容器。
+         * @see dragonBones.IArmatureProxy
+         * @see dragonBones.BaseFactory#buildArmature
          * @version DragonBones 4.5
          * @example
          * 
@@ -7526,16 +6544,5 @@ declare namespace dragonBones {
          * @language zh_CN
          */
         readonly soundEventManager: PixiArmatureDisplay;
-        /**
-         * - Deprecated, please refer to {@link #clock}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        static readonly clock: WorldClock;
     }
 }
diff --git a/Pixi/4.x/out/dragonBones.js b/Pixi/4.x/out/dragonBones.js
index b6984d28..08764887 100644
--- a/Pixi/4.x/out/dragonBones.js
+++ b/Pixi/4.x/out/dragonBones.js
@@ -9,9 +9,6 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
-var dragonBones;
-(function (dragonBones) {
-})(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
  *
@@ -96,20 +93,15 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        DragonBones.VERSION = "5.6.300";
+        DragonBones.VERSION = "5.7.000";
         DragonBones.yDown = true;
         DragonBones.debug = false;
         DragonBones.debugDraw = false;
-        DragonBones.webAssembly = false;
         return DragonBones;
     }());
     dragonBones.DragonBones = DragonBones;
 })(dragonBones || (dragonBones = {}));
 //
-if (typeof global === "undefined") {
-    var global = window;
-}
-//
 if (!console.warn) {
     console.warn = function () { };
 }
@@ -134,6 +126,22 @@ var __extends = function (t, e) {
     }
     r.prototype = e.prototype, t.prototype = new r();
 };
+//
+if (typeof global === "undefined" && typeof window !== "undefined") {
+    var global = window;
+}
+if (typeof exports === "object" && typeof module === "object") {
+    module.exports = dragonBones;
+}
+else if (typeof define === "function" && define["amd"]) {
+    define(["dragonBones"], function () { return dragonBones; });
+}
+else if (typeof exports === "object") {
+    exports = dragonBones;
+}
+else if (typeof global !== "undefined") {
+    global.dragonBones = dragonBones;
+}
 /**
  * The MIT License (MIT)
  *
@@ -796,7 +804,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ColorTransform = /** @class */ (function () {
         function ColorTransform(alphaMultiplier, redMultiplier, greenMultiplier, blueMultiplier, alphaOffset, redOffset, greenOffset, blueOffset) {
@@ -1128,7 +1136,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.UserData = UserData;
     /**
-     * @internal
+     * @private
      */
     var ActionData = /** @class */ (function (_super) {
         __extends(ActionData, _super);
@@ -1252,6 +1260,7 @@ var dragonBones;
             this.frameFloatArray = null; //
             this.frameArray = null; //
             this.timelineArray = null; //
+            this.colorArray = null; //
             this.userData = null;
         };
         /**
@@ -1281,20 +1290,6 @@ var dragonBones;
         DragonBonesData.prototype.getArmature = function (armatureName) {
             return armatureName in this.armatures ? this.armatures[armatureName] : null;
         };
-        /**
-         * - Deprecated, please refer to {@link #dragonBones.BaseFactory#removeDragonBonesData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #dragonBones.BaseFactory#removeDragonBonesData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DragonBonesData.prototype.dispose = function () {
-            console.warn("已废弃");
-            this.returnToPool();
-        };
         return DragonBonesData;
     }(dragonBones.BaseObject));
     dragonBones.DragonBonesData = DragonBonesData;
@@ -1736,6 +1731,7 @@ var dragonBones;
             this.inheritReflection = false;
             this.type = 0 /* Bone */;
             this.length = 0.0;
+            this.alpha = 1.0;
             this.name = "";
             this.transform.identity();
             this.userData = null;
@@ -1751,7 +1747,7 @@ var dragonBones;
         __extends(SurfaceData, _super);
         function SurfaceData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = [];
+            _this.geometry = new dragonBones.GeometryData();
             return _this;
         }
         SurfaceData.toString = function () {
@@ -1762,7 +1758,7 @@ var dragonBones;
             this.type = 1 /* Surface */;
             this.segmentX = 0;
             this.segmentY = 0;
-            this.vertices.length = 0;
+            this.geometry.clear();
         };
         return SurfaceData;
     }(BoneData));
@@ -1807,6 +1803,8 @@ var dragonBones;
             this.blendMode = 0 /* Normal */;
             this.displayIndex = 0;
             this.zOrder = 0;
+            this.zIndex = 0;
+            this.alpha = 1.0;
             this.name = "";
             this.color = null; //
             this.userData = null;
@@ -1845,7 +1843,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ConstraintData = /** @class */ (function (_super) {
         __extends(ConstraintData, _super);
@@ -1942,7 +1940,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var CanvasData = /** @class */ (function (_super) {
         __extends(CanvasData, _super);
@@ -2092,13 +2090,13 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
-    var VerticesData = /** @class */ (function () {
-        function VerticesData() {
+    var GeometryData = /** @class */ (function () {
+        function GeometryData() {
             this.weight = null; // Initial value.
         }
-        VerticesData.prototype.clear = function () {
+        GeometryData.prototype.clear = function () {
             if (!this.isShared && this.weight !== null) {
                 this.weight.returnToPool();
             }
@@ -2108,16 +2106,32 @@ var dragonBones;
             this.data = null;
             this.weight = null;
         };
-        VerticesData.prototype.shareFrom = function (value) {
+        GeometryData.prototype.shareFrom = function (value) {
             this.isShared = true;
             this.offset = value.offset;
             this.weight = value.weight;
         };
-        return VerticesData;
+        Object.defineProperty(GeometryData.prototype, "vertexCount", {
+            get: function () {
+                var intArray = this.data.intArray;
+                return intArray[this.offset + 0 /* GeometryVertexCount */];
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(GeometryData.prototype, "triangleCount", {
+            get: function () {
+                var intArray = this.data.intArray;
+                return intArray[this.offset + 1 /* GeometryTriangleCount */];
+            },
+            enumerable: true,
+            configurable: true
+        });
+        return GeometryData;
     }());
-    dragonBones.VerticesData = VerticesData;
+    dragonBones.GeometryData = GeometryData;
     /**
-     * @internal
+     * @private
      */
     var DisplayData = /** @class */ (function (_super) {
         __extends(DisplayData, _super);
@@ -2136,7 +2150,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.DisplayData = DisplayData;
     /**
-     * @internal
+     * @private
      */
     var ImageDisplayData = /** @class */ (function (_super) {
         __extends(ImageDisplayData, _super);
@@ -2158,7 +2172,7 @@ var dragonBones;
     }(DisplayData));
     dragonBones.ImageDisplayData = ImageDisplayData;
     /**
-     * @internal
+     * @private
      */
     var ArmatureDisplayData = /** @class */ (function (_super) {
         __extends(ArmatureDisplayData, _super);
@@ -2191,13 +2205,13 @@ var dragonBones;
     }(DisplayData));
     dragonBones.ArmatureDisplayData = ArmatureDisplayData;
     /**
-     * @internal
+     * @private
      */
     var MeshDisplayData = /** @class */ (function (_super) {
         __extends(MeshDisplayData, _super);
         function MeshDisplayData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = new VerticesData();
+            _this.geometry = new GeometryData();
             return _this;
         }
         MeshDisplayData.toString = function () {
@@ -2206,14 +2220,14 @@ var dragonBones;
         MeshDisplayData.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
             this.type = 2 /* Mesh */;
-            this.vertices.clear();
+            this.geometry.clear();
             this.texture = null;
         };
         return MeshDisplayData;
     }(DisplayData));
     dragonBones.MeshDisplayData = MeshDisplayData;
     /**
-     * @internal
+     * @private
      */
     var BoundingBoxDisplayData = /** @class */ (function (_super) {
         __extends(BoundingBoxDisplayData, _super);
@@ -2237,13 +2251,13 @@ var dragonBones;
     }(DisplayData));
     dragonBones.BoundingBoxDisplayData = BoundingBoxDisplayData;
     /**
-     * @internal
+     * @private
      */
     var PathDisplayData = /** @class */ (function (_super) {
         __extends(PathDisplayData, _super);
         function PathDisplayData() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.vertices = new VerticesData();
+            _this.geometry = new GeometryData();
             _this.curveLengths = [];
             return _this;
         }
@@ -2255,14 +2269,14 @@ var dragonBones;
             this.type = 4 /* Path */;
             this.closed = false;
             this.constantSpeed = false;
-            this.vertices.clear();
+            this.geometry.clear();
             this.curveLengths.length = 0;
         };
         return PathDisplayData;
     }(DisplayData));
     dragonBones.PathDisplayData = PathDisplayData;
     /**
-     * @internal
+     * @private
      */
     var WeightData = /** @class */ (function (_super) {
         __extends(WeightData, _super);
@@ -2910,10 +2924,6 @@ var dragonBones;
              * @private
              */
             _this.boneTimelines = {};
-            /**
-             * @private
-             */
-            _this.surfaceTimelines = {};
             /**
              * @private
              */
@@ -2955,30 +2965,23 @@ var dragonBones;
                 }
                 delete this.boneTimelines[k];
             }
-            for (var k in this.surfaceTimelines) {
-                for (var _b = 0, _c = this.surfaceTimelines[k]; _b < _c.length; _b++) {
-                    var timeline = _c[_b];
-                    timeline.returnToPool();
-                }
-                delete this.surfaceTimelines[k];
-            }
             for (var k in this.slotTimelines) {
-                for (var _d = 0, _e = this.slotTimelines[k]; _d < _e.length; _d++) {
-                    var timeline = _e[_d];
+                for (var _b = 0, _c = this.slotTimelines[k]; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
                     timeline.returnToPool();
                 }
                 delete this.slotTimelines[k];
             }
             for (var k in this.constraintTimelines) {
-                for (var _f = 0, _g = this.constraintTimelines[k]; _f < _g.length; _f++) {
-                    var timeline = _g[_f];
+                for (var _d = 0, _e = this.constraintTimelines[k]; _d < _e.length; _d++) {
+                    var timeline = _e[_d];
                     timeline.returnToPool();
                 }
                 delete this.constraintTimelines[k];
             }
             for (var k in this.animationTimelines) {
-                for (var _h = 0, _j = this.animationTimelines[k]; _h < _j.length; _h++) {
-                    var timeline = _j[_h];
+                for (var _f = 0, _g = this.animationTimelines[k]; _f < _g.length; _f++) {
+                    var timeline = _g[_f];
                     timeline.returnToPool();
                 }
                 delete this.animationTimelines[k];
@@ -2998,6 +3001,7 @@ var dragonBones;
             this.frameIntOffset = 0;
             this.frameFloatOffset = 0;
             this.frameOffset = 0;
+            this.blendType = 0 /* None */;
             this.frameCount = 0;
             this.playTimes = 0;
             this.duration = 0.0;
@@ -3007,7 +3011,6 @@ var dragonBones;
             this.name = "";
             this.cachedFrames.length = 0;
             // this.boneTimelines.clear();
-            // this.surfaceTimelines.clear();
             // this.slotTimelines.clear();
             // this.constraintTimelines.clear();
             // this.animationTimelines.clear();
@@ -3050,17 +3053,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addBoneTimeline = function (bone, timeline) {
-            var timelines = bone.name in this.boneTimelines ? this.boneTimelines[bone.name] : (this.boneTimelines[bone.name] = []);
-            if (timelines.indexOf(timeline) < 0) {
-                timelines.push(timeline);
-            }
-        };
-        /**
-         * @private
-         */
-        AnimationData.prototype.addSurfaceTimeline = function (surface, timeline) {
-            var timelines = surface.name in this.surfaceTimelines ? this.surfaceTimelines[surface.name] : (this.surfaceTimelines[surface.name] = []);
+        AnimationData.prototype.addBoneTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : (this.boneTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3068,8 +3062,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addSlotTimeline = function (slot, timeline) {
-            var timelines = slot.name in this.slotTimelines ? this.slotTimelines[slot.name] : (this.slotTimelines[slot.name] = []);
+        AnimationData.prototype.addSlotTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : (this.slotTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3077,8 +3071,8 @@ var dragonBones;
         /**
          * @private
          */
-        AnimationData.prototype.addConstraintTimeline = function (constraint, timeline) {
-            var timelines = constraint.name in this.constraintTimelines ? this.constraintTimelines[constraint.name] : (this.constraintTimelines[constraint.name] = []);
+        AnimationData.prototype.addConstraintTimeline = function (timelineName, timeline) {
+            var timelines = timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : (this.constraintTimelines[timelineName] = []);
             if (timelines.indexOf(timeline) < 0) {
                 timelines.push(timeline);
             }
@@ -3098,12 +3092,6 @@ var dragonBones;
         AnimationData.prototype.getBoneTimelines = function (timelineName) {
             return timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : null;
         };
-        /**
-         * @private
-         */
-        AnimationData.prototype.getSurfaceTimelines = function (timelineName) {
-            return timelineName in this.surfaceTimelines ? this.surfaceTimelines[timelineName] : null;
-        };
         /**
          * @private
          */
@@ -3138,7 +3126,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.AnimationData = AnimationData;
     /**
-     * @internal
+     * @private
      */
     var TimelineData = /** @class */ (function (_super) {
         __extends(TimelineData, _super);
@@ -3156,6 +3144,25 @@ var dragonBones;
         return TimelineData;
     }(dragonBones.BaseObject));
     dragonBones.TimelineData = TimelineData;
+    /**
+     * @internal
+     */
+    var AnimationTimelineData = /** @class */ (function (_super) {
+        __extends(AnimationTimelineData, _super);
+        function AnimationTimelineData() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationTimelineData.toString = function () {
+            return "[class dragonBones.AnimationTimelineData]";
+        };
+        AnimationTimelineData.prototype._onClear = function () {
+            _super.prototype._onClear.call(this);
+            this.x = 0.0;
+            this.y = 0.0;
+        };
+        return AnimationTimelineData;
+    }(TimelineData));
+    dragonBones.AnimationTimelineData = AnimationTimelineData;
 })(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
@@ -3216,7 +3223,7 @@ var dragonBones;
             this.fadeOutTweenType = 1 /* Line */;
             this.fadeOutTime = -1.0;
             this.actionEnabled = true;
-            this.additiveBlending = false;
+            this.additive = false;
             this.displayControl = true;
             this.pauseFadeIn = true;
             this.resetToPose = true;
@@ -3249,7 +3256,7 @@ var dragonBones;
             this.autoFadeOutTime = value.autoFadeOutTime;
             this.fadeOutTweenType = value.fadeOutTweenType;
             this.actionEnabled = value.actionEnabled;
-            this.additiveBlending = value.additiveBlending;
+            this.additive = value.additive;
             this.displayControl = value.displayControl;
             this.pauseFadeIn = value.pauseFadeIn;
             this.resetToPose = value.resetToPose;
@@ -3270,68 +3277,6 @@ var dragonBones;
                 this.boneMask[i] = value.boneMask[i];
             }
         };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.containsBoneMask = function (boneName) {
-            return this.boneMask.length === 0 || this.boneMask.indexOf(boneName) >= 0;
-        };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.addBoneMask = function (armature, boneName, recursive) {
-            if (recursive === void 0) { recursive = true; }
-            var currentBone = armature.getBone(boneName);
-            if (currentBone === null) {
-                return;
-            }
-            if (this.boneMask.indexOf(boneName) < 0) {
-                this.boneMask.push(boneName);
-            }
-            if (recursive) {
-                for (var _i = 0, _a = armature.getBones(); _i < _a.length; _i++) {
-                    var bone = _a[_i];
-                    if (this.boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) {
-                        this.boneMask.push(bone.name);
-                    }
-                }
-            }
-        };
-        /**
-         * @private
-         */
-        AnimationConfig.prototype.removeBoneMask = function (armature, boneName, recursive) {
-            if (recursive === void 0) { recursive = true; }
-            var index = this.boneMask.indexOf(boneName);
-            if (index >= 0) {
-                this.boneMask.splice(index, 1);
-            }
-            if (recursive) {
-                var currentBone = armature.getBone(boneName);
-                if (currentBone !== null) {
-                    if (this.boneMask.length > 0) {
-                        for (var _i = 0, _a = armature.getBones(); _i < _a.length; _i++) {
-                            var bone = _a[_i];
-                            var index_1 = this.boneMask.indexOf(bone.name);
-                            if (index_1 >= 0 && currentBone.contains(bone)) {
-                                this.boneMask.splice(index_1, 1);
-                            }
-                        }
-                    }
-                    else {
-                        for (var _b = 0, _c = armature.getBones(); _b < _c.length; _b++) {
-                            var bone = _c[_b];
-                            if (bone === currentBone) {
-                                continue;
-                            }
-                            if (!currentBone.contains(bone)) {
-                                this.boneMask.push(bone.name);
-                            }
-                        }
-                    }
-                }
-            }
-        };
         return AnimationConfig;
     }(dragonBones.BaseObject));
     dragonBones.AnimationConfig = AnimationConfig;
@@ -3435,7 +3380,7 @@ var dragonBones;
     }(dragonBones.BaseObject));
     dragonBones.TextureAtlasData = TextureAtlasData;
     /**
-     * @internal
+     * @private
      */
     var TextureData = /** @class */ (function (_super) {
         __extends(TextureData, _super);
@@ -3540,7 +3485,7 @@ var dragonBones;
             return "[class dragonBones.Armature]";
         };
         Armature._onSortSlots = function (a, b) {
-            return a._zOrder > b._zOrder ? 1 : -1;
+            return a._zIndex * 1000 + a._zOrder > b._zIndex * 1000 + b._zOrder ? 1 : -1;
         };
         Armature.prototype._onClear = function () {
             if (this._clock !== null) {
@@ -3576,9 +3521,13 @@ var dragonBones;
             this._lockUpdate = false;
             this._slotsDirty = true;
             this._zOrderDirty = false;
+            this._zIndexDirty = false;
+            this._alphaDirty = true;
             this._flipX = false;
             this._flipY = false;
             this._cacheFrameIndex = -1;
+            this._alpha = 1.0;
+            this._globalAlpha = 1.0;
             this._bones.length = 0;
             this._slots.length = 0;
             this._constraints.length = 0;
@@ -3608,7 +3557,7 @@ var dragonBones;
                     var slotData = slotDatas[slotIndex];
                     var slot = this.getSlot(slotData.name);
                     if (slot !== null) {
-                        slot._setZorder(i);
+                        slot._setZOrder(i);
                     }
                 }
                 this._slotsDirty = true;
@@ -3701,6 +3650,7 @@ var dragonBones;
             if (this._lockUpdate) {
                 return;
             }
+            this._lockUpdate = true;
             if (this._armatureData === null) {
                 console.warn("The armature has been disposed.");
                 return;
@@ -3713,9 +3663,28 @@ var dragonBones;
             // Update animation.
             this._animation.advanceTime(passedTime);
             // Sort slots.
-            if (this._slotsDirty) {
-                this._slotsDirty = false;
+            if (this._slotsDirty || this._zIndexDirty) {
                 this._slots.sort(Armature._onSortSlots);
+                if (this._zIndexDirty) {
+                    for (var i = 0, l = this._slots.length; i < l; ++i) {
+                        this._slots[i]._setZOrder(i); // 
+                    }
+                }
+                this._slotsDirty = false;
+                this._zIndexDirty = false;
+            }
+            // Update alpha.
+            if (this._alphaDirty) {
+                this._alphaDirty = false;
+                this._globalAlpha = this._alpha * (this._parent !== null ? this._parent._globalAlpha : 1.0);
+                for (var _i = 0, _a = this._bones; _i < _a.length; _i++) {
+                    var bone = _a[_i];
+                    bone._updateAlpha();
+                }
+                for (var _b = 0, _c = this._slots; _b < _c.length; _b++) {
+                    var slot = _c[_b];
+                    slot._updateAlpha();
+                }
             }
             // Update bones and slots.
             if (this._cacheFrameIndex < 0 || this._cacheFrameIndex !== prevCacheFrameIndex) {
@@ -3729,9 +3698,8 @@ var dragonBones;
             }
             // Do actions.
             if (this._actions.length > 0) {
-                this._lockUpdate = true;
-                for (var _i = 0, _a = this._actions; _i < _a.length; _i++) {
-                    var action = _a[_i];
+                for (var _d = 0, _e = this._actions; _d < _e.length; _d++) {
+                    var action = _e[_d];
                     var actionData = action.actionData;
                     if (actionData !== null) {
                         if (actionData.type === 0 /* Play */) {
@@ -3742,8 +3710,8 @@ var dragonBones;
                                 }
                             }
                             else if (action.bone !== null) {
-                                for (var _b = 0, _c = this.getSlots(); _b < _c.length; _b++) {
-                                    var slot = _c[_b];
+                                for (var _f = 0, _g = this.getSlots(); _f < _g.length; _f++) {
+                                    var slot = _g[_f];
                                     if (slot.parent === action.bone) {
                                         var childArmature = slot.childArmature;
                                         if (childArmature !== null) {
@@ -3760,8 +3728,8 @@ var dragonBones;
                     action.returnToPool();
                 }
                 this._actions.length = 0;
-                this._lockUpdate = false;
             }
+            this._lockUpdate = false;
             this._proxy.dbUpdate();
         };
         /**
@@ -4334,69 +4302,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * @deprecated
-         * @private
-         */
-        Armature.prototype.replaceTexture = function (texture) {
-            this.replacedTexture = texture;
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.hasEventListener = function (type) {
-            console.warn("Deprecated.");
-            return this._proxy.hasDBEventListener(type);
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.addEventListener = function (type, listener, target) {
-            console.warn("Deprecated.");
-            this._proxy.addDBEventListener(type, listener, target);
-        };
-        /**
-         * - Deprecated, please refer to {@link #eventDispatcher}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #eventDispatcher}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.removeEventListener = function (type, listener, target) {
-            console.warn("Deprecated.");
-            this._proxy.removeDBEventListener(type, listener, target);
-        };
-        /**
-         * - Deprecated, please refer to {@link #cacheFrameRate}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #cacheFrameRate}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Armature.prototype.enableAnimationCache = function (frameRate) {
-            console.warn("Deprecated.");
-            this.cacheFrameRate = frameRate;
-        };
         /**
          * - Deprecated, please refer to {@link #display}.
          * @deprecated
@@ -4502,6 +4407,8 @@ var dragonBones;
             this.origin = null;
             this.userData = null;
             this._globalDirty = false;
+            this._alpha = 1.0;
+            this._globalAlpha = 1.0;
             this._armature = null; //
         };
         /**
@@ -4608,10 +4515,6 @@ var dragonBones;
              * @internal
              */
             _this.animationPose = new dragonBones.Transform();
-            /**
-             * @internal
-             */
-            _this._blendState = new dragonBones.BlendState();
             return _this;
         }
         Bone.toString = function () {
@@ -4627,7 +4530,6 @@ var dragonBones;
             this._hasConstraint = false;
             this._visible = true;
             this._cachedFrameIndex = -1;
-            this._blendState.clear();
             this._boneData = null; //
             this._parent = null; //
             this._cachedFrameIndices = null;
@@ -4672,39 +4574,61 @@ var dragonBones;
                 global.copyFrom(offset);
             }
             if (inherit) {
-                var parentMatrix = parent._boneData.type === 0 /* Bone */ ? parent.globalTransformMatrix : parent._getGlobalTransformMatrix(global.x, global.y);
-                if (boneData.inheritScale) {
-                    if (!boneData.inheritRotation) {
-                        parent.updateGlobalTransform();
-                        if (flipX && flipY) {
-                            rotation = global.rotation - (parent.global.rotation + Math.PI);
-                        }
-                        else if (flipX) {
-                            rotation = global.rotation + parent.global.rotation + Math.PI;
-                        }
-                        else if (flipY) {
-                            rotation = global.rotation + parent.global.rotation;
+                var isSurface = parent._boneData.type === 1 /* Surface */;
+                var surfaceBone = isSurface ? parent._bone : null;
+                var parentMatrix = isSurface ? parent._getGlobalTransformMatrix(global.x, global.y) : parent.globalTransformMatrix;
+                if (boneData.inheritScale && (!isSurface || surfaceBone !== null)) {
+                    if (isSurface) {
+                        if (boneData.inheritRotation) {
+                            global.rotation += parent.global.rotation;
+                        }
+                        surfaceBone.updateGlobalTransform();
+                        global.scaleX *= surfaceBone.global.scaleX;
+                        global.scaleY *= surfaceBone.global.scaleY;
+                        parentMatrix.transformPoint(global.x, global.y, global);
+                        global.toMatrix(globalTransformMatrix);
+                        if (boneData.inheritTranslation) {
+                            global.x = globalTransformMatrix.tx;
+                            global.y = globalTransformMatrix.ty;
                         }
                         else {
-                            rotation = global.rotation - parent.global.rotation;
+                            globalTransformMatrix.tx = global.x;
+                            globalTransformMatrix.ty = global.y;
                         }
-                        global.rotation = rotation;
-                    }
-                    global.toMatrix(globalTransformMatrix);
-                    globalTransformMatrix.concat(parentMatrix);
-                    if (boneData.inheritTranslation) {
-                        global.x = globalTransformMatrix.tx;
-                        global.y = globalTransformMatrix.ty;
                     }
                     else {
-                        globalTransformMatrix.tx = global.x;
-                        globalTransformMatrix.ty = global.y;
-                    }
-                    if (isCache) {
-                        global.fromMatrix(globalTransformMatrix);
-                    }
-                    else {
-                        this._globalDirty = true;
+                        if (!boneData.inheritRotation) {
+                            parent.updateGlobalTransform();
+                            if (flipX && flipY) {
+                                rotation = global.rotation - (parent.global.rotation + Math.PI);
+                            }
+                            else if (flipX) {
+                                rotation = global.rotation + parent.global.rotation + Math.PI;
+                            }
+                            else if (flipY) {
+                                rotation = global.rotation + parent.global.rotation;
+                            }
+                            else {
+                                rotation = global.rotation - parent.global.rotation;
+                            }
+                            global.rotation = rotation;
+                        }
+                        global.toMatrix(globalTransformMatrix);
+                        globalTransformMatrix.concat(parentMatrix);
+                        if (boneData.inheritTranslation) {
+                            global.x = globalTransformMatrix.tx;
+                            global.y = globalTransformMatrix.ty;
+                        }
+                        else {
+                            globalTransformMatrix.tx = global.x;
+                            globalTransformMatrix.ty = global.y;
+                        }
+                        if (isCache) {
+                            global.fromMatrix(globalTransformMatrix);
+                        }
+                        else {
+                            this._globalDirty = true;
+                        }
                     }
                 }
                 else {
@@ -4781,6 +4705,17 @@ var dragonBones;
                 global.toMatrix(globalTransformMatrix);
             }
         };
+        /**
+         * @internal
+         */
+        Bone.prototype._updateAlpha = function () {
+            if (this._parent !== null) {
+                this._globalAlpha = this._alpha * this._parent._globalAlpha;
+            }
+            else {
+                this._globalAlpha = this._alpha * this._armature._globalAlpha;
+            }
+        };
         /**
          * @internal
          */
@@ -4790,6 +4725,7 @@ var dragonBones;
             }
             this._boneData = boneData;
             this._armature = armatureValue;
+            this._alpha = this._boneData.alpha;
             if (this._boneData.parent !== null) {
                 this._parent = this._armature.getBone(this._boneData.parent.name);
             }
@@ -4801,7 +4737,6 @@ var dragonBones;
          * @internal
          */
         Bone.prototype.update = function (cacheFrameIndex) {
-            this._blendState.dirty = false;
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
                 if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) {
@@ -5019,72 +4954,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getBones()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getBones()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Bone.prototype.getBones = function () {
-            console.warn("Deprecated.");
-            var bones = new Array();
-            for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) {
-                var bone = _a[_i];
-                if (bone.parent === this) {
-                    bones.push(bone);
-                }
-            }
-            return bones;
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.Armature#getSlots()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.Armature#getSlots()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Bone.prototype.getSlots = function () {
-            console.warn("Deprecated.");
-            var slots = new Array();
-            for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) {
-                var slot = _a[_i];
-                if (slot.parent === this) {
-                    slots.push(slot);
-                }
-            }
-            return slots;
-        };
-        Object.defineProperty(Bone.prototype, "slot", {
-            /**
-             * - Deprecated, please refer to {@link dragonBones.Armature#getSlot()}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link dragonBones.Armature#getSlot()}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) {
-                    var slot = _a[_i];
-                    if (slot.parent === this) {
-                        return slot;
-                    }
-                }
-                return null;
-            },
-            enumerable: true,
-            configurable: true
-        });
         return Bone;
     }(dragonBones.TransformObject));
     dragonBones.Bone = Bone;
@@ -5146,6 +5015,7 @@ var dragonBones;
             this._deformVertices.length = 0;
             this._matrixCahce.length = 0;
             this._hullCache.length = 0;
+            this._bone = null;
         };
         Surface.prototype._getAffineTransform = function (x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown) {
             var dabX = bX - aX;
@@ -5164,35 +5034,43 @@ var dragonBones;
             transform.y = matrix.ty = aY - (matrix.b * x + matrix.d * y);
         };
         Surface.prototype._updateVertices = function () {
-            var originalVertices = this._boneData.vertices;
+            var data = this._armature.armatureData.parent;
+            var geometry = this._boneData.geometry;
+            var intArray = data.intArray;
+            var floatArray = data.floatArray;
+            var vertexCount = intArray[geometry.offset + 0 /* GeometryVertexCount */];
+            var verticesOffset = intArray[geometry.offset + 2 /* GeometryFloatOffset */];
             var vertices = this._vertices;
             var animationVertices = this._deformVertices;
             if (this._parent !== null) {
                 if (this._parent._boneData.type === 1 /* Surface */) {
-                    for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                        var x = originalVertices[i] + animationVertices[i];
-                        var y = originalVertices[i + 1] + animationVertices[i];
+                    for (var i = 0, l = vertexCount; i < l; ++i) {
+                        var iD = i * 2;
+                        var x = floatArray[verticesOffset + iD] + animationVertices[iD];
+                        var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                         var matrix = this._parent._getGlobalTransformMatrix(x, y);
                         //
-                        vertices[i] = matrix.a * x + matrix.c * y + matrix.tx;
-                        vertices[i + 1] = matrix.b * x + matrix.d * y + matrix.ty;
+                        vertices[iD] = matrix.a * x + matrix.c * y + matrix.tx;
+                        vertices[iD + 1] = matrix.b * x + matrix.d * y + matrix.ty;
                     }
                 }
                 else {
                     var parentMatrix = this._parent.globalTransformMatrix;
-                    for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                        var x = originalVertices[i] + animationVertices[i];
-                        var y = originalVertices[i + 1] + animationVertices[i + 1];
+                    for (var i = 0, l = vertexCount; i < l; ++i) {
+                        var iD = i * 2;
+                        var x = floatArray[verticesOffset + iD] + animationVertices[iD];
+                        var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                         //
-                        vertices[i] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx;
-                        vertices[i + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty;
+                        vertices[iD] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx;
+                        vertices[iD + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty;
                     }
                 }
             }
             else {
-                for (var i = 0, l = originalVertices.length; i < l; i += 2) {
-                    vertices[i] = originalVertices[i] + animationVertices[i];
-                    vertices[i + 1] = originalVertices[i + 1] + animationVertices[i + 1];
+                for (var i = 0, l = vertexCount; i < l; ++i) {
+                    var iD = i * 2;
+                    vertices[iD] = floatArray[verticesOffset + iD] + animationVertices[iD];
+                    vertices[iD + 1] = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1];
                 }
             }
         };
@@ -5222,17 +5100,17 @@ var dragonBones;
             var bY = rbY + (rcY - rbY) * 0.5;
             var cX = rdX + (rcX - rdX) * 0.5;
             var cY = rdY + (rcY - rdY) * 0.5;
-            //
-            this._globalDirty = false;
+            // TODO interpolation
             this._getAffineTransform(0.0, 0.0, lA, lA, aX, aY, bX, bY, cX, cY, this.global, this.globalTransformMatrix, false);
+            this._globalDirty = false;
         };
         Surface.prototype._getGlobalTransformMatrix = function (x, y) {
+            var lA = 200.0;
             var lB = 1000.0;
             if (x < -lB || lB < x || y < -lB || lB < y) {
                 return this.globalTransformMatrix;
             }
             var isDown = false;
-            var lA = 200.0;
             var surfaceData = this._boneData;
             var segmentX = surfaceData.segmentX;
             var segmentY = surfaceData.segmentY;
@@ -5244,6 +5122,7 @@ var dragonBones;
             var matrixIndex = 0;
             var pX = indexX * dX - lA;
             var pY = indexY * dY - lA;
+            //
             var matrices = this._matrixCahce;
             var helpMatrix = Surface._helpMatrix;
             if (x < -lA) {
@@ -5252,8 +5131,8 @@ var dragonBones;
                 }
                 // Left.
                 isDown = y > this._kX * (x + lA) + pY;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX * 2 + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + segmentY + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5284,8 +5163,8 @@ var dragonBones;
                 }
                 // Right.
                 isDown = y > this._kX * (x - lB) + pY;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5316,8 +5195,8 @@ var dragonBones;
                 }
                 // Up.
                 isDown = y > this._kY * (x - pX - dX) - lB;
-                matrixIndex = (segmentX * (segmentY + 1) + indexX * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5348,8 +5227,8 @@ var dragonBones;
                 }
                 // Down
                 isDown = y > this._kY * (x - pX - dX) + lA;
-                matrixIndex = ((segmentX * (segmentY + 1) + segmentX + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                matrixIndex = ((segmentX * segmentY + segmentX + segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5377,7 +5256,7 @@ var dragonBones;
             else {
                 isDown = y > this._k * (x - pX - dX) + pY;
                 matrixIndex = ((segmentX * indexY + indexX) * 2 + (isDown ? 1 : 0)) * 7;
-                if (this._matrixCahce[matrixIndex] > 0.0) {
+                if (matrices[matrixIndex] > 0.0) {
                     helpMatrix.copyFromArray(matrices, matrixIndex + 1);
                 }
                 else {
@@ -5411,7 +5290,7 @@ var dragonBones;
             _super.prototype.init.call(this, surfaceData, armatureValue);
             var segmentX = surfaceData.segmentX;
             var segmentY = surfaceData.segmentY;
-            var vertexCount = surfaceData.vertices.length;
+            var vertexCount = this._armature.armatureData.parent.intArray[surfaceData.geometry.offset + 0 /* GeometryVertexCount */];
             var lB = 1000.0;
             var lA = 200.0;
             //
@@ -5420,19 +5299,26 @@ var dragonBones;
             this._k = -this._dY / this._dX;
             this._kX = -this._dY / (lB - lA);
             this._kY = -(lB - lA) / this._dX;
-            this._vertices.length = vertexCount;
-            this._deformVertices.length = vertexCount;
+            this._vertices.length = vertexCount * 2;
+            this._deformVertices.length = vertexCount * 2;
             this._matrixCahce.length = (segmentX * segmentY + segmentX * 2 + segmentY * 2) * 2 * 7;
             this._hullCache.length = 10;
-            for (var i = 0; i < vertexCount; ++i) {
+            for (var i = 0; i < vertexCount * 2; ++i) {
                 this._deformVertices[i] = 0.0;
             }
+            if (this._parent !== null) {
+                if (this._parent.boneData.type === 0 /* Bone */) {
+                    this._bone = this._parent;
+                }
+                else {
+                    this._bone = this._parent._bone;
+                }
+            }
         };
         /**
          * @internal
          */
         Surface.prototype.update = function (cacheFrameIndex) {
-            this._blendState.dirty = false;
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
                 if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) {
@@ -5561,6 +5447,105 @@ var dragonBones;
  */
 var dragonBones;
 (function (dragonBones) {
+    /**
+     * @private
+     */
+    var DisplayFrame = /** @class */ (function (_super) {
+        __extends(DisplayFrame, _super);
+        function DisplayFrame() {
+            var _this = _super !== null && _super.apply(this, arguments) || this;
+            _this.deformVertices = [];
+            return _this;
+        }
+        DisplayFrame.toString = function () {
+            return "[class dragonBones.DisplayFrame]";
+        };
+        DisplayFrame.prototype._onClear = function () {
+            this.rawDisplayData = null;
+            this.displayData = null;
+            this.textureData = null;
+            this.display = null;
+            this.deformVertices.length = 0;
+        };
+        DisplayFrame.prototype.updateDeformVertices = function () {
+            if (this.rawDisplayData === null || this.deformVertices.length !== 0) {
+                return;
+            }
+            var rawGeometryData;
+            if (this.rawDisplayData.type === 2 /* Mesh */) {
+                rawGeometryData = this.rawDisplayData.geometry;
+            }
+            else if (this.rawDisplayData.type === 4 /* Path */) {
+                rawGeometryData = this.rawDisplayData.geometry;
+            }
+            else {
+                return;
+            }
+            var vertexCount = 0;
+            if (rawGeometryData.weight !== null) {
+                vertexCount = rawGeometryData.weight.count * 2;
+            }
+            else {
+                vertexCount = rawGeometryData.data.intArray[rawGeometryData.offset + 0 /* GeometryVertexCount */] * 2;
+            }
+            this.deformVertices.length = vertexCount;
+            for (var i = 0, l = this.deformVertices.length; i < l; ++i) {
+                this.deformVertices[i] = 0.0;
+            }
+        };
+        DisplayFrame.prototype.getGeometryData = function () {
+            if (this.displayData !== null) {
+                if (this.displayData.type === 2 /* Mesh */) {
+                    return this.displayData.geometry;
+                }
+                if (this.displayData.type === 4 /* Path */) {
+                    return this.displayData.geometry;
+                }
+            }
+            if (this.rawDisplayData !== null) {
+                if (this.rawDisplayData.type === 2 /* Mesh */) {
+                    return this.rawDisplayData.geometry;
+                }
+                if (this.rawDisplayData.type === 4 /* Path */) {
+                    return this.rawDisplayData.geometry;
+                }
+            }
+            return null;
+        };
+        DisplayFrame.prototype.getBoundingBox = function () {
+            if (this.displayData !== null && this.displayData.type === 3 /* BoundingBox */) {
+                return this.displayData.boundingBox;
+            }
+            if (this.rawDisplayData !== null && this.rawDisplayData.type === 3 /* BoundingBox */) {
+                return this.rawDisplayData.boundingBox;
+            }
+            return null;
+        };
+        DisplayFrame.prototype.getTextureData = function () {
+            if (this.displayData !== null) {
+                if (this.displayData.type === 0 /* Image */) {
+                    return this.displayData.texture;
+                }
+                if (this.displayData.type === 2 /* Mesh */) {
+                    return this.displayData.texture;
+                }
+            }
+            if (this.textureData !== null) {
+                return this.textureData;
+            }
+            if (this.rawDisplayData !== null) {
+                if (this.rawDisplayData.type === 0 /* Image */) {
+                    return this.rawDisplayData.texture;
+                }
+                if (this.rawDisplayData.type === 2 /* Mesh */) {
+                    return this.rawDisplayData.texture;
+                }
+            }
+            return null;
+        };
+        return DisplayFrame;
+    }(dragonBones.BaseObject));
+    dragonBones.DisplayFrame = DisplayFrame;
     /**
      * - The slot attached to the armature, controls the display status and properties of the display object.
      * A bone can contain multiple slots.
@@ -5594,25 +5579,30 @@ var dragonBones;
              * @internal
              */
             _this._colorTransform = new dragonBones.ColorTransform();
-            _this._displayDatas = [];
-            _this._displayList = [];
             /**
              * @internal
              */
-            _this._deformVertices = null;
+            _this._displayFrames = [];
+            /**
+             * @internal
+             */
+            _this._geometryBones = [];
             _this._rawDisplay = null; // Initial value.
             _this._meshDisplay = null; // Initial value.
+            _this._display = null;
             return _this;
         }
         Slot.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
             var disposeDisplayList = [];
-            for (var _i = 0, _a = this._displayList; _i < _a.length; _i++) {
-                var eachDisplay = _a[_i];
-                if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                    disposeDisplayList.indexOf(eachDisplay) < 0) {
-                    disposeDisplayList.push(eachDisplay);
+            for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                var dispayFrame = _a[_i];
+                var display = dispayFrame.display;
+                if (display !== this._rawDisplay && display !== this._meshDisplay &&
+                    disposeDisplayList.indexOf(display) < 0) {
+                    disposeDisplayList.push(display);
                 }
+                dispayFrame.returnToPool();
             }
             for (var _b = 0, disposeDisplayList_1 = disposeDisplayList; _b < disposeDisplayList_1.length; _b++) {
                 var eachDisplay = disposeDisplayList_1[_b];
@@ -5623,9 +5613,6 @@ var dragonBones;
                     this._disposeDisplay(eachDisplay, true);
                 }
             }
-            if (this._deformVertices !== null) {
-                this._deformVertices.returnToPool();
-            }
             if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) {
                 this._disposeDisplay(this._meshDisplay, false);
             }
@@ -5633,29 +5620,34 @@ var dragonBones;
                 this._disposeDisplay(this._rawDisplay, false);
             }
             this.displayController = null;
+            this._displayDataDirty = false;
             this._displayDirty = false;
-            this._zOrderDirty = false;
+            this._geometryDirty = false;
+            this._textureDirty = false;
+            this._visibleDirty = false;
             this._blendModeDirty = false;
+            this._zOrderDirty = false;
             this._colorDirty = false;
+            this._verticesDirty = false;
             this._transformDirty = false;
             this._visible = true;
             this._blendMode = 0 /* Normal */;
             this._displayIndex = -1;
             this._animationDisplayIndex = -1;
             this._zOrder = 0;
+            this._zIndex = 0;
             this._cachedFrameIndex = -1;
             this._pivotX = 0.0;
             this._pivotY = 0.0;
             this._localMatrix.identity();
             this._colorTransform.identity();
-            this._displayList.length = 0;
-            this._displayDatas.length = 0;
+            this._displayFrames.length = 0;
+            this._geometryBones.length = 0;
             this._slotData = null; //
-            this._rawDisplayDatas = null;
-            this._displayData = null;
+            this._displayFrame = null;
+            this._geometryData = null;
             this._boundingBoxData = null;
             this._textureData = null;
-            this._deformVertices = null;
             this._rawDisplay = null;
             this._meshDisplay = null;
             this._display = null;
@@ -5663,73 +5655,60 @@ var dragonBones;
             this._parent = null; //
             this._cachedFrameIndices = null;
         };
+        Slot.prototype._hasDisplay = function (display) {
+            for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                var displayFrame = _a[_i];
+                if (displayFrame.display === display) {
+                    return true;
+                }
+            }
+            return false;
+        };
         /**
-         * - Support default skin data.
+         * @internal
          */
-        Slot.prototype._getDefaultRawDisplayData = function (displayIndex) {
-            var defaultSkin = this._armature._armatureData.defaultSkin;
-            if (defaultSkin !== null) {
-                var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name);
-                if (defaultRawDisplayDatas !== null) {
-                    return displayIndex < defaultRawDisplayDatas.length ? defaultRawDisplayDatas[displayIndex] : null;
+        Slot.prototype._isBonesUpdate = function () {
+            for (var _i = 0, _a = this._geometryBones; _i < _a.length; _i++) {
+                var bone = _a[_i];
+                if (bone !== null && bone._childrenTransformDirty) {
+                    return true;
                 }
             }
-            return null;
+            return false;
+        };
+        /**
+         * @internal
+         */
+        Slot.prototype._updateAlpha = function () {
+            var globalAlpha = this._alpha * this._parent._globalAlpha;
+            if (this._globalAlpha !== globalAlpha) {
+                this._globalAlpha = globalAlpha;
+                this._colorDirty = true;
+            }
         };
         Slot.prototype._updateDisplayData = function () {
-            var prevDisplayData = this._displayData;
-            var prevVerticesData = this._deformVertices !== null ? this._deformVertices.verticesData : null;
+            var prevDisplayFrame = this._displayFrame;
+            var prevGeometryData = this._geometryData;
             var prevTextureData = this._textureData;
             var rawDisplayData = null;
-            var currentVerticesData = null;
-            this._displayData = null;
+            var displayData = null;
+            this._displayFrame = null;
+            this._geometryData = null;
             this._boundingBoxData = null;
             this._textureData = null;
-            if (this._displayIndex >= 0) {
-                if (this._rawDisplayDatas !== null) {
-                    rawDisplayData = this._displayIndex < this._rawDisplayDatas.length ? this._rawDisplayDatas[this._displayIndex] : null;
-                }
-                if (rawDisplayData === null) {
-                    rawDisplayData = this._getDefaultRawDisplayData(this._displayIndex);
-                }
-                if (this._displayIndex < this._displayDatas.length) {
-                    this._displayData = this._displayDatas[this._displayIndex];
-                }
-            }
-            if (this._displayData !== null) {
-                if (this._displayData.type === 2 /* Mesh */) {
-                    currentVerticesData = this._displayData.vertices;
-                }
-                else if (this._displayData.type === 4 /* Path */) {
-                    currentVerticesData = this._displayData.vertices;
-                }
-                else if (rawDisplayData !== null) {
-                    if (rawDisplayData.type === 2 /* Mesh */) {
-                        currentVerticesData = rawDisplayData.vertices;
-                    }
-                    else if (rawDisplayData.type === 4 /* Path */) {
-                        currentVerticesData = rawDisplayData.vertices;
-                    }
-                }
-                if (this._displayData.type === 3 /* BoundingBox */) {
-                    this._boundingBoxData = this._displayData.boundingBox;
-                }
-                else if (rawDisplayData !== null) {
-                    if (rawDisplayData.type === 3 /* BoundingBox */) {
-                        this._boundingBoxData = rawDisplayData.boundingBox;
-                    }
-                }
-                if (this._displayData.type === 0 /* Image */) {
-                    this._textureData = this._displayData.texture;
-                }
-                else if (this._displayData.type === 2 /* Mesh */) {
-                    this._textureData = this._displayData.texture;
-                }
-            }
-            if (this._displayData !== prevDisplayData || currentVerticesData !== prevVerticesData || this._textureData !== prevTextureData) {
+            if (this._displayIndex >= 0 && this._displayIndex < this._displayFrames.length) {
+                this._displayFrame = this._displayFrames[this._displayIndex];
+                rawDisplayData = this._displayFrame.rawDisplayData;
+                displayData = this._displayFrame.displayData;
+                this._geometryData = this._displayFrame.getGeometryData();
+                this._boundingBoxData = this._displayFrame.getBoundingBox();
+                this._textureData = this._displayFrame.getTextureData();
+            }
+            if (this._displayFrame !== prevDisplayFrame ||
+                this._geometryData !== prevGeometryData || this._textureData !== prevTextureData) {
                 // Update pivot offset.
-                if (currentVerticesData === null && this._textureData !== null) {
-                    var imageDisplayData = this._displayData;
+                if (this._geometryData === null && this._textureData !== null) {
+                    var imageDisplayData = ((displayData !== null && displayData.type === 0 /* Image */) ? displayData : rawDisplayData); //
                     var scale = this._textureData.parent.scale * this._armature._armatureData.scale;
                     var frame = this._textureData.frame;
                     this._pivotX = imageDisplayData.pivot.x;
@@ -5748,13 +5727,13 @@ var dragonBones;
                         this._pivotY += frame.y * scale;
                     }
                     // Update replace pivot. TODO
-                    if (this._displayData !== null && rawDisplayData !== null && this._displayData !== rawDisplayData) {
+                    if (rawDisplayData !== null && imageDisplayData !== rawDisplayData) {
                         rawDisplayData.transform.toMatrix(Slot._helpMatrix);
                         Slot._helpMatrix.invert();
                         Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint);
                         this._pivotX -= Slot._helpPoint.x;
                         this._pivotY -= Slot._helpPoint.y;
-                        this._displayData.transform.toMatrix(Slot._helpMatrix);
+                        imageDisplayData.transform.toMatrix(Slot._helpMatrix);
                         Slot._helpMatrix.invert();
                         Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint);
                         this._pivotX += Slot._helpPoint.x;
@@ -5772,23 +5751,38 @@ var dragonBones;
                 if (rawDisplayData !== null) {
                     this.origin = rawDisplayData.transform;
                 }
-                else if (this._displayData !== null) {
-                    this.origin = this._displayData.transform;
+                else if (displayData !== null) {
+                    this.origin = displayData.transform;
                 }
                 else {
                     this.origin = null;
                 }
-                // Update vertices.
-                if (currentVerticesData !== prevVerticesData) {
-                    if (this._deformVertices === null) {
-                        this._deformVertices = dragonBones.BaseObject.borrowObject(dragonBones.DeformVertices);
-                    }
-                    this._deformVertices.init(currentVerticesData, this._armature);
+                // TODO remove slot offset.
+                if (this.origin !== null) {
+                    this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix);
                 }
-                else if (this._deformVertices !== null && this._textureData !== prevTextureData) {
-                    this._deformVertices.verticesDirty = true;
+                else {
+                    this.global.copyFrom(this.offset).toMatrix(this._localMatrix);
+                }
+                // Update geometry.
+                if (this._geometryData !== prevGeometryData) {
+                    this._geometryDirty = true;
+                    this._verticesDirty = true;
+                    if (this._geometryData !== null) {
+                        this._geometryBones.length = 0;
+                        if (this._geometryData.weight !== null) {
+                            for (var i = 0, l = this._geometryData.weight.bones.length; i < l; ++i) {
+                                var bone = this._armature.getBone(this._geometryData.weight.bones[i].name);
+                                this._geometryBones.push(bone);
+                            }
+                        }
+                    }
+                    else {
+                        this._geometryBones.length = 0;
+                        this._geometryData = null;
+                    }
                 }
-                this._displayDirty = true;
+                this._textureDirty = this._textureData !== prevTextureData;
                 this._transformDirty = true;
             }
         };
@@ -5796,8 +5790,8 @@ var dragonBones;
             var prevDisplay = this._display !== null ? this._display : this._rawDisplay;
             var prevChildArmature = this._childArmature;
             // Update display and child armature.
-            if (this._displayIndex >= 0 && this._displayIndex < this._displayList.length) {
-                this._display = this._displayList[this._displayIndex];
+            if (this._displayFrame !== null) {
+                this._display = this._displayFrame.display;
                 if (this._display !== null && this._display instanceof dragonBones.Armature) {
                     this._childArmature = this._display;
                     this._display = this._childArmature.display;
@@ -5813,16 +5807,14 @@ var dragonBones;
             // Update display.
             var currentDisplay = this._display !== null ? this._display : this._rawDisplay;
             if (currentDisplay !== prevDisplay) {
-                this._onUpdateDisplay();
-                this._replaceDisplay(prevDisplay);
-                this._transformDirty = true;
+                this._textureDirty = true;
                 this._visibleDirty = true;
                 this._blendModeDirty = true;
+                // this._zOrderDirty = true;
                 this._colorDirty = true;
-            }
-            // Update frame.
-            if (currentDisplay === this._rawDisplay || currentDisplay === this._meshDisplay) {
-                this._updateFrame();
+                this._transformDirty = true;
+                this._onUpdateDisplay();
+                this._replaceDisplay(prevDisplay);
             }
             // Update child armature.
             if (this._childArmature !== prevChildArmature) {
@@ -5844,31 +5836,25 @@ var dragonBones;
                             }
                         }
                         // Child armature action.
-                        var actions = null;
-                        if (this._displayData !== null && this._displayData.type === 1 /* Armature */) {
-                            actions = this._displayData.actions;
-                        }
-                        else if (this._displayIndex >= 0 && this._rawDisplayDatas !== null) {
-                            var rawDisplayData = this._displayIndex < this._rawDisplayDatas.length ? this._rawDisplayDatas[this._displayIndex] : null;
-                            if (rawDisplayData === null) {
-                                rawDisplayData = this._getDefaultRawDisplayData(this._displayIndex);
+                        if (this._displayFrame !== null) {
+                            var actions = null;
+                            var displayData = this._displayFrame.displayData !== null ? this._displayFrame.displayData : this._displayFrame.rawDisplayData;
+                            if (displayData !== null && displayData.type === 1 /* Armature */) {
+                                actions = displayData.actions;
                             }
-                            if (rawDisplayData !== null && rawDisplayData.type === 1 /* Armature */) {
-                                actions = rawDisplayData.actions;
+                            if (actions !== null && actions.length > 0) {
+                                for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
+                                    var action = actions_1[_i];
+                                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                                    dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature);
+                                    eventObject.slot = this;
+                                    this._armature._bufferAction(eventObject, false);
+                                }
                             }
-                        }
-                        if (actions !== null && actions.length > 0) {
-                            for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
-                                var action = actions_1[_i];
-                                var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                                dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature);
-                                eventObject.slot = this;
-                                this._armature._bufferAction(eventObject, false);
+                            else {
+                                this._childArmature.animation.play();
                             }
                         }
-                        else {
-                            this._childArmature.animation.play();
-                        }
                     }
                 }
             }
@@ -5891,24 +5877,23 @@ var dragonBones;
             if (isAnimation === void 0) { isAnimation = false; }
             if (isAnimation) {
                 if (this._animationDisplayIndex === value) {
-                    return false;
+                    return;
                 }
                 this._animationDisplayIndex = value;
             }
             if (this._displayIndex === value) {
-                return false;
+                return;
             }
-            this._displayIndex = value;
-            this._displayDirty = true;
-            this._updateDisplayData();
-            return this._displayDirty;
+            this._displayIndex = value < this._displayFrames.length ? value : this._displayFrames.length - 1;
+            this._displayDataDirty = true;
+            this._displayDirty = this._displayIndex < 0 || this._display !== this._displayFrames[this._displayIndex].display;
         };
         /**
          * @internal
          */
-        Slot.prototype._setZorder = function (value) {
+        Slot.prototype._setZOrder = function (value) {
             if (this._zOrder === value) {
-                //return false;
+                // return false;
             }
             this._zOrder = value;
             this._zOrderDirty = true;
@@ -5919,37 +5904,7 @@ var dragonBones;
          */
         Slot.prototype._setColor = function (value) {
             this._colorTransform.copyFrom(value);
-            this._colorDirty = true;
-            return this._colorDirty;
-        };
-        /**
-         * @internal
-         */
-        Slot.prototype._setDisplayList = function (value) {
-            if (value !== null && value.length > 0) {
-                if (this._displayList.length !== value.length) {
-                    this._displayList.length = value.length;
-                }
-                for (var i = 0, l = value.length; i < l; ++i) {
-                    var eachDisplay = value[i];
-                    if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                        !(eachDisplay instanceof dragonBones.Armature) && this._displayList.indexOf(eachDisplay) < 0) {
-                        this._initDisplay(eachDisplay, true);
-                    }
-                    this._displayList[i] = eachDisplay;
-                }
-            }
-            else if (this._displayList.length > 0) {
-                this._displayList.length = 0;
-            }
-            if (this._displayIndex >= 0 && this._displayIndex < this._displayList.length) {
-                this._displayDirty = this._display !== this._displayList[this._displayIndex];
-            }
-            else {
-                this._displayDirty = this._display !== null;
-            }
-            this._updateDisplayData();
-            return this._displayDirty;
+            return this._colorDirty = true;
         };
         /**
          * @internal
@@ -5959,18 +5914,17 @@ var dragonBones;
                 return;
             }
             this._slotData = slotData;
-            //
-            this._visibleDirty = true;
-            this._blendModeDirty = true;
-            this._colorDirty = true;
+            this._colorDirty = true; //
+            this._blendModeDirty = true; //
             this._blendMode = this._slotData.blendMode;
             this._zOrder = this._slotData.zOrder;
+            this._zIndex = this._slotData.zIndex;
+            this._alpha = this._slotData.alpha;
             this._colorTransform.copyFrom(this._slotData.color);
             this._rawDisplay = rawDisplay;
             this._meshDisplay = meshDisplay;
             //
             this._armature = armatureValue;
-            //
             var slotParent = this._armature.getBone(this._slotData.parent.name);
             if (slotParent !== null) {
                 this._parent = slotParent;
@@ -5991,22 +5945,52 @@ var dragonBones;
          * @internal
          */
         Slot.prototype.update = function (cacheFrameIndex) {
+            if (this._displayDataDirty) {
+                this._updateDisplayData();
+                this._displayDataDirty = false;
+            }
             if (this._displayDirty) {
-                this._displayDirty = false;
                 this._updateDisplay();
-                // TODO remove slot offset.
-                if (this._transformDirty) {
-                    if (this.origin !== null) {
-                        this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix);
-                    }
-                    else {
-                        this.global.copyFrom(this.offset).toMatrix(this._localMatrix);
-                    }
+                this._displayDirty = false;
+            }
+            if (this._geometryDirty || this._textureDirty) {
+                if (this._display === null || this._display === this._rawDisplay || this._display === this._meshDisplay) {
+                    this._updateFrame();
                 }
+                this._geometryDirty = false;
+                this._textureDirty = false;
+            }
+            if (this._display === null) {
+                return;
+            }
+            if (this._visibleDirty) {
+                this._updateVisible();
+                this._visibleDirty = false;
+            }
+            if (this._blendModeDirty) {
+                this._updateBlendMode();
+                this._blendModeDirty = false;
+            }
+            if (this._colorDirty) {
+                this._updateColor();
+                this._colorDirty = false;
             }
             if (this._zOrderDirty) {
-                this._zOrderDirty = false;
                 this._updateZOrder();
+                this._zOrderDirty = false;
+            }
+            if (this._geometryData !== null && this._display === this._meshDisplay) {
+                var isSkinned = this._geometryData.weight !== null;
+                var isSurface = this._parent._boneData.type !== 0 /* Bone */;
+                if (this._verticesDirty ||
+                    (isSkinned && this._isBonesUpdate()) ||
+                    (isSurface && this._parent._childrenTransformDirty)) {
+                    this._updateMesh();
+                    this._verticesDirty = false;
+                }
+                if (isSkinned || isSurface) {
+                    return;
+                }
             }
             if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) {
                 var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex];
@@ -6035,36 +6019,7 @@ var dragonBones;
                 this._transformDirty = true;
                 this._cachedFrameIndex = -1;
             }
-            if (this._display === null) {
-                return;
-            }
-            if (this._visibleDirty) {
-                this._visibleDirty = false;
-                this._updateVisible();
-            }
-            if (this._blendModeDirty) {
-                this._blendModeDirty = false;
-                this._updateBlendMode();
-            }
-            if (this._colorDirty) {
-                this._colorDirty = false;
-                this._updateColor();
-            }
-            if (this._deformVertices !== null && this._deformVertices.verticesData !== null && this._display === this._meshDisplay) {
-                var isSkinned = this._deformVertices.verticesData.weight !== null;
-                var isSurface = this._parent._boneData.type !== 0 /* Bone */;
-                if (this._deformVertices.verticesDirty ||
-                    (isSkinned && this._deformVertices.isBonesUpdate()) ||
-                    (isSurface && this._parent._childrenTransformDirty)) {
-                    this._deformVertices.verticesDirty = false;
-                    this._updateMesh();
-                }
-                if (isSkinned || isSurface) {
-                    return;
-                }
-            }
             if (this._transformDirty) {
-                this._transformDirty = false;
                 if (this._cachedFrameIndex < 0) {
                     var isCache = cacheFrameIndex >= 0;
                     this._updateGlobalTransformMatrix(isCache);
@@ -6076,63 +6031,160 @@ var dragonBones;
                     this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex);
                 }
                 this._updateTransform();
+                this._transformDirty = false;
             }
         };
+        /**
+         * - Forces the slot to update the state of the display object in the next frame.
+         * @version DragonBones 4.5
+         * @language en_US
+         */
+        /**
+         * - 强制插槽在下一帧更新显示对象的状态。
+         * @version DragonBones 4.5
+         * @language zh_CN
+         */
+        Slot.prototype.invalidUpdate = function () {
+            this._displayDataDirty = true;
+            this._displayDirty = true;
+            //
+            this._transformDirty = true;
+        };
         /**
          * @private
          */
         Slot.prototype.updateTransformAndMatrix = function () {
             if (this._transformDirty) {
-                this._transformDirty = false;
                 this._updateGlobalTransformMatrix(false);
+                this._transformDirty = false;
             }
         };
         /**
          * @private
          */
-        Slot.prototype.replaceDisplayData = function (value, displayIndex) {
-            if (displayIndex === void 0) { displayIndex = -1; }
-            if (displayIndex < 0) {
-                if (this._displayIndex < 0) {
-                    displayIndex = 0;
-                }
-                else {
-                    displayIndex = this._displayIndex;
-                }
+        Slot.prototype.replaceRawDisplayData = function (displayData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
             }
-            if (this._displayDatas.length <= displayIndex) {
-                this._displayDatas.length = displayIndex + 1;
-                for (var i = 0, l = this._displayDatas.length; i < l; ++i) {
-                    if (!this._displayDatas[i]) {
-                        this._displayDatas[i] = null;
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.rawDisplayData !== displayData) {
+                displayFrame.deformVertices.length = 0;
+                displayFrame.rawDisplayData = displayData;
+                if (displayFrame.rawDisplayData === null) {
+                    var defaultSkin = this._armature._armatureData.defaultSkin;
+                    if (defaultSkin !== null) {
+                        var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name);
+                        if (defaultRawDisplayDatas !== null && index < defaultRawDisplayDatas.length) {
+                            displayFrame.rawDisplayData = defaultRawDisplayDatas[index];
+                        }
                     }
                 }
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
             }
-            this._displayDatas[displayIndex] = value;
         };
         /**
-         * - Check whether a specific point is inside a custom bounding box in the slot.
-         * The coordinate system of the point is the inner coordinate system of the armature.
-         * Custom bounding boxes need to be customized in Dragonbones Pro.
-         * @param x - The horizontal coordinate of the point.
-         * @param y - The vertical coordinate of the point.
-         * @version DragonBones 5.0
-         * @language en_US
+         * @private
          */
+        Slot.prototype.replaceDisplayData = function (displayData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.displayData !== displayData && displayFrame.rawDisplayData !== displayData) {
+                displayFrame.displayData = displayData;
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
+            }
+        };
         /**
-         * - 检查特定点是否在插槽的自定义边界框内。
-         * 点的坐标系为骨架内坐标系。
-         * 自定义边界框需要在 DragonBones Pro 中自定义。
-         * @param x - 点的水平坐标。
-         * @param y - 点的垂直坐标。
-         * @version DragonBones 5.0
-         * @language zh_CN
+         * @private
          */
-        Slot.prototype.containsPoint = function (x, y) {
-            if (this._boundingBoxData === null) {
-                return false;
+        Slot.prototype.replaceTextureData = function (textureData, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
             }
-            this.updateTransformAndMatrix();
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.textureData !== textureData) {
+                displayFrame.textureData = textureData;
+                if (index === this._displayIndex) {
+                    this._displayDataDirty = true;
+                }
+            }
+        };
+        /**
+         * @private
+         */
+        Slot.prototype.replaceDisplay = function (value, index) {
+            if (index === void 0) { index = -1; }
+            if (index < 0) {
+                index = this._displayIndex < 0 ? 0 : this._displayIndex;
+            }
+            else if (index >= this._displayFrames.length) {
+                return;
+            }
+            var displayFrame = this._displayFrames[index];
+            if (displayFrame.display !== value) {
+                var prevDisplay = displayFrame.display;
+                displayFrame.display = value;
+                if (prevDisplay !== null &&
+                    prevDisplay !== this._rawDisplay && prevDisplay !== this._meshDisplay &&
+                    !this._hasDisplay(prevDisplay)) {
+                    if (prevDisplay instanceof dragonBones.Armature) {
+                        // (eachDisplay as Armature).dispose();
+                    }
+                    else {
+                        this._disposeDisplay(prevDisplay, true);
+                    }
+                }
+                if (value !== null &&
+                    value !== this._rawDisplay && value !== this._meshDisplay &&
+                    !this._hasDisplay(prevDisplay) &&
+                    !(value instanceof dragonBones.Armature)) {
+                    this._initDisplay(value, true);
+                }
+                if (index === this._displayIndex) {
+                    this._displayDirty = true;
+                }
+            }
+        };
+        /**
+         * - Check whether a specific point is inside a custom bounding box in the slot.
+         * The coordinate system of the point is the inner coordinate system of the armature.
+         * Custom bounding boxes need to be customized in Dragonbones Pro.
+         * @param x - The horizontal coordinate of the point.
+         * @param y - The vertical coordinate of the point.
+         * @version DragonBones 5.0
+         * @language en_US
+         */
+        /**
+         * - 检查特定点是否在插槽的自定义边界框内。
+         * 点的坐标系为骨架内坐标系。
+         * 自定义边界框需要在 DragonBones Pro 中自定义。
+         * @param x - 点的水平坐标。
+         * @param y - 点的垂直坐标。
+         * @version DragonBones 5.0
+         * @language zh_CN
+         */
+        Slot.prototype.containsPoint = function (x, y) {
+            if (this._boundingBoxData === null) {
+                return false;
+            }
+            this.updateTransformAndMatrix();
             Slot._helpMatrix.copyFrom(this.globalTransformMatrix);
             Slot._helpMatrix.invert();
             Slot._helpMatrix.transformPoint(x, y, Slot._helpPoint);
@@ -6216,18 +6268,10 @@ var dragonBones;
             return intersectionCount;
         };
         /**
-         * - Forces the slot to update the state of the display object in the next frame.
-         * @version DragonBones 4.5
-         * @language en_US
-         */
-        /**
-         * - 强制插槽在下一帧更新显示对象的状态。
-         * @version DragonBones 4.5
-         * @language zh_CN
+         * @private
          */
-        Slot.prototype.invalidUpdate = function () {
-            this._displayDirty = true;
-            this._transformDirty = true;
+        Slot.prototype.getDisplayFrameAt = function (index) {
+            return this._displayFrames[index];
         };
         Object.defineProperty(Slot.prototype, "visible", {
             /**
@@ -6255,6 +6299,32 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Slot.prototype, "displayFrameCount", {
+            /**
+             * @private
+             */
+            get: function () {
+                return this._displayFrames.length;
+            },
+            set: function (value) {
+                var prevCount = this._displayFrames.length;
+                if (prevCount < value) {
+                    this._displayFrames.length = value;
+                    for (var i = prevCount; i < value; ++i) {
+                        this._displayFrames[i] = dragonBones.BaseObject.borrowObject(DisplayFrame);
+                    }
+                }
+                else if (prevCount > value) {
+                    for (var i = prevCount - 1; i < value; --i) {
+                        this.replaceDisplay(null, i);
+                        this._displayFrames[i].returnToPool();
+                    }
+                    this._displayFrames.length = value;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(Slot.prototype, "displayIndex", {
             /**
              * - The index of the display object displayed in the display list.
@@ -6282,9 +6352,8 @@ var dragonBones;
                 return this._displayIndex;
             },
             set: function (value) {
-                if (this._setDisplayIndex(value)) {
-                    this.update(-1);
-                }
+                this._setDisplayIndex(value);
+                this.update(-1);
             },
             enumerable: true,
             configurable: true
@@ -6320,31 +6389,19 @@ var dragonBones;
              * @language zh_CN
              */
             get: function () {
-                return this._displayList.concat();
+                var displays = new Array();
+                for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) {
+                    var displayFrame = _a[_i];
+                    displays.push(displayFrame.display);
+                }
+                return displays;
             },
             set: function (value) {
-                var backupDisplayList = this._displayList.concat(); // Copy.
-                var disposeDisplayList = new Array();
-                if (this._setDisplayList(value)) {
-                    this.update(-1);
-                }
-                // Release replaced displays.
-                for (var _i = 0, backupDisplayList_1 = backupDisplayList; _i < backupDisplayList_1.length; _i++) {
-                    var eachDisplay = backupDisplayList_1[_i];
-                    if (eachDisplay !== null && eachDisplay !== this._rawDisplay && eachDisplay !== this._meshDisplay &&
-                        this._displayList.indexOf(eachDisplay) < 0 &&
-                        disposeDisplayList.indexOf(eachDisplay) < 0) {
-                        disposeDisplayList.push(eachDisplay);
-                    }
-                }
-                for (var _a = 0, disposeDisplayList_2 = disposeDisplayList; _a < disposeDisplayList_2.length; _a++) {
-                    var eachDisplay = disposeDisplayList_2[_a];
-                    if (eachDisplay instanceof dragonBones.Armature) {
-                        // (eachDisplay as Armature).dispose();
-                    }
-                    else {
-                        this._disposeDisplay(eachDisplay, true);
-                    }
+                this.displayFrameCount = value.length;
+                var index = 0;
+                for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {
+                    var eachDisplay = value_1[_i];
+                    this.replaceDisplay(eachDisplay, index++);
                 }
             },
             enumerable: true,
@@ -6369,46 +6426,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Slot.prototype, "rawDisplayDatas", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this._rawDisplayDatas;
-            },
-            set: function (value) {
-                if (this._rawDisplayDatas === value) {
-                    return;
-                }
-                this._displayDirty = true;
-                this._rawDisplayDatas = value;
-                if (this._rawDisplayDatas !== null) {
-                    this._displayDatas.length = this._rawDisplayDatas.length;
-                    for (var i = 0, l = this._displayDatas.length; i < l; ++i) {
-                        var rawDisplayData = this._rawDisplayDatas[i];
-                        if (rawDisplayData === null) {
-                            rawDisplayData = this._getDefaultRawDisplayData(i);
-                        }
-                        this._displayDatas[i] = rawDisplayData;
-                    }
-                }
-                else {
-                    this._displayDatas.length = 0;
-                }
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Slot.prototype, "displayData", {
-            /**
-             * @private
-             */
-            get: function () {
-                return this._displayData;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(Slot.prototype, "boundingBoxData", {
             /**
              * - The custom bounding box data for the slot at current time.
@@ -6474,21 +6491,11 @@ var dragonBones;
                 if (this._display === value) {
                     return;
                 }
-                var displayListLength = this._displayList.length;
-                if (this._displayIndex < 0 && displayListLength === 0) {
+                if (this._displayFrames.length === 0) {
+                    this.displayFrameCount = 1;
                     this._displayIndex = 0;
                 }
-                if (this._displayIndex < 0) {
-                    return;
-                }
-                else {
-                    var replaceDisplayList = this.displayList; // Copy.
-                    if (displayListLength <= this._displayIndex) {
-                        replaceDisplayList.length = this._displayIndex + 1;
-                    }
-                    replaceDisplayList[this._displayIndex] = value;
-                    this.displayList = replaceDisplayList;
-                }
+                this.replaceDisplay(value, this._displayIndex);
             },
             enumerable: true,
             configurable: true
@@ -6499,9 +6506,9 @@ var dragonBones;
              * @example
              * 
              *     let slot = armature.getSlot("weapon");
-             * let prevChildArmature = slot.childArmature;
-             * if (prevChildArmature) {
-             * prevChildArmature.dispose();
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
              *     }
              *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
              * 
@@ -6514,9 +6521,9 @@ var dragonBones; * @example *
              *     let slot = armature.getSlot("weapon");
-             * let prevChildArmature = slot.childArmature;
-             * if (prevChildArmature) {
-             * prevChildArmature.dispose();
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
              *     }
              *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
              * 
@@ -6811,8 +6818,8 @@ var dragonBones; var intArray = dragonBonesData.intArray; var floatArray = dragonBonesData.floatArray; var pathOffset = verticesData.offset; - var pathVertexCount = intArray[pathOffset + 0 /* PathVertexCount */]; - var pathVertexOffset = intArray[pathOffset + 2 /* PathFloatOffset */]; + var pathVertexCount = intArray[pathOffset + 0 /* GeometryVertexCount */]; + var pathVertexOffset = intArray[pathOffset + 2 /* GeometryFloatOffset */]; this._pathGlobalVertices.length = pathVertexCount * 2; var weightData = verticesData.weight; //没有骨骼约束我,那节点只受自己的Bone控制 @@ -6832,7 +6839,7 @@ var dragonBones; return; } //有骨骼约束我,那我的节点受骨骼权重控制 - var bones = this._pathSlot._deformVertices.bones; + var bones = this._pathSlot._geometryBones; var weightBoneCount = weightData.bones.length; var weightOffset = weightData.offset; var floatOffset = intArray[weightOffset + 1 /* WeigthFloatOffset */]; @@ -6870,7 +6877,7 @@ var dragonBones; //计算当前的骨骼在曲线上的位置 var armature = this._armature; var intArray = armature.armatureData.parent.intArray; - var vertexCount = intArray[pathDisplayDta.vertices.offset + 0 /* PathVertexCount */]; + var vertexCount = intArray[pathDisplayDta.geometry.offset + 0 /* GeometryVertexCount */]; var positions = this._positions; var spaces = this._spaces; var isClosed = pathDisplayDta.closed; @@ -7127,7 +7134,7 @@ var dragonBones; this._constraintData = constraintData; this._armature = armature; var data = constraintData; - this.pathOffset = data.pathDisplayData.vertices.offset; + this.pathOffset = data.pathDisplayData.geometry.offset; // this.position = data.position; this.spacing = data.spacing; @@ -7151,24 +7158,21 @@ var dragonBones; }; PathConstraint.prototype.update = function () { var pathSlot = this._pathSlot; - if (pathSlot._deformVertices === null || - pathSlot._deformVertices.verticesData === null || - pathSlot._deformVertices.verticesData.offset !== this.pathOffset) { + if (pathSlot._geometryData === null || + pathSlot._geometryData.offset !== this.pathOffset) { return; } var constraintData = this._constraintData; - var pathDisplayData = pathSlot._displayData; // TODO // //曲线节点数据改变:父亲bone改变,权重bones改变,变形顶点改变 var isPathVerticeDirty = false; - var deformVertices = pathSlot._deformVertices; if (this._root._childrenTransformDirty) { - this._updatePathVertices(pathDisplayData.vertices); + this._updatePathVertices(pathSlot._geometryData); isPathVerticeDirty = true; } - else if (deformVertices !== null && (deformVertices.verticesDirty || deformVertices.isBonesUpdate())) { - this._updatePathVertices(pathDisplayData.vertices); - deformVertices.verticesDirty = false; + else if (pathSlot._verticesDirty || pathSlot._isBonesUpdate()) { + this._updatePathVertices(pathSlot._geometryData); + pathSlot._verticesDirty = false; isPathVerticeDirty = true; } if (!isPathVerticeDirty && !this.dirty) { @@ -7211,7 +7215,7 @@ var dragonBones; } } // - this._computeBezierCurve(pathDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); + this._computeBezierCurve(pathSlot._displayFrame.rawDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); //根据新的节点数据重新采样 var positions = this._positions; var rotateOffset = this.rotateOffset; @@ -7313,94 +7317,6 @@ var dragonBones; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ var dragonBones; -(function (dragonBones) { - /** - * @internal - */ - var DeformVertices = /** @class */ (function (_super) { - __extends(DeformVertices, _super); - function DeformVertices() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.vertices = []; - _this.bones = []; - return _this; - } - DeformVertices.toString = function () { - return "[class dragonBones.DeformVertices]"; - }; - DeformVertices.prototype._onClear = function () { - this.verticesDirty = false; - this.vertices.length = 0; - this.bones.length = 0; - this.verticesData = null; - }; - DeformVertices.prototype.init = function (verticesDataValue, armature) { - this.verticesData = verticesDataValue; - if (this.verticesData !== null) { - var vertexCount = 0; - if (this.verticesData.weight !== null) { - vertexCount = this.verticesData.weight.count * 2; - } - else { - vertexCount = this.verticesData.data.intArray[this.verticesData.offset + 0 /* MeshVertexCount */] * 2; - } - this.verticesDirty = true; - this.vertices.length = vertexCount; - this.bones.length = 0; - // - for (var i = 0, l = this.vertices.length; i < l; ++i) { - this.vertices[i] = 0.0; - } - if (this.verticesData.weight !== null) { - for (var i = 0, l = this.verticesData.weight.bones.length; i < l; ++i) { - var bone = armature.getBone(this.verticesData.weight.bones[i].name); - this.bones.push(bone); - } - } - } - else { - this.verticesDirty = false; - this.vertices.length = 0; - this.bones.length = 0; - this.verticesData = null; - } - }; - DeformVertices.prototype.isBonesUpdate = function () { - for (var _i = 0, _a = this.bones; _i < _a.length; _i++) { - var bone = _a[_i]; - if (bone !== null && bone._childrenTransformDirty) { - return true; - } - } - return false; - }; - return DeformVertices; - }(dragonBones.BaseObject)); - dragonBones.DeformVertices = DeformVertices; -})(dragonBones || (dragonBones = {})); -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -var dragonBones; (function (dragonBones) { /** * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. @@ -7623,17 +7539,6 @@ var dragonBones; enumerable: true, configurable: true }); - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#clock}。 - * @deprecated - * @language zh_CN - */ - WorldClock.clock = new WorldClock(); return WorldClock; }()); dragonBones.WorldClock = WorldClock; @@ -7683,6 +7588,7 @@ var dragonBones; _this._animationNames = []; _this._animationStates = []; _this._animations = {}; + _this._blendStates = {}; _this._animationConfig = null; // Initial value. return _this; } @@ -7697,11 +7603,17 @@ var dragonBones; for (var k in this._animations) { delete this._animations[k]; } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].returnToPool(); + } + delete this._blendStates[k]; + } if (this._animationConfig !== null) { this._animationConfig.returnToPool(); } this.timeScale = 1.0; - this._lockUpdate = false; this._animationDirty = false; this._inheritTimeScale = 1.0; this._animationNames.length = 0; @@ -7756,8 +7668,7 @@ var dragonBones; animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); } break; - case 0 /* None */: - case 5 /* Single */: + case 5 /* Single */: // TODO default: break; } @@ -7788,6 +7699,12 @@ var dragonBones; if (this._inheritTimeScale !== 1.0) { passedTime *= this._inheritTimeScale; } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].reset(); + } + } var animationStateCount = this._animationStates.length; if (animationStateCount === 1) { var animationState = this._animationStates[0]; @@ -7797,7 +7714,7 @@ var dragonBones; this._lastAnimationState = null; } else { - var animationData = animationState._animationData; + var animationData = animationState.animationData; var cacheFrameRate = animationData.cacheFrameRate; if (this._animationDirty && cacheFrameRate > 0.0) { this._animationDirty = false; @@ -7807,14 +7724,12 @@ var dragonBones; } for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { var slot = _c[_b]; - var rawDisplayDatas = slot.rawDisplayDatas; - if (rawDisplayDatas !== null && rawDisplayDatas.length > 0) { - var rawDsplayData = rawDisplayDatas[0]; - if (rawDsplayData !== null) { - if (rawDsplayData.parent === this._armature.armatureData.defaultSkin) { - slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); - continue; - } + if (slot.displayFrameCount > 0) { + var rawDisplayData = slot.getDisplayFrameAt(0).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.parent === this._armature.armatureData.defaultSkin) { + slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); + continue; } } slot._cachedFrameIndices = null; @@ -7934,7 +7849,9 @@ var dragonBones; if (animationConfig.fadeOutMode === 5 /* Single */) { for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { var animationState_1 = _a[_i]; - if (animationState_1._animationData === animationData) { + if (animationState_1._fadeState < 1 && + animationState_1.layer === animationConfig.layer && + animationState_1.animationData === animationData) { return animationState_1; } } @@ -7951,7 +7868,7 @@ var dragonBones; if (animationConfig.timeScale <= -100.0) { animationConfig.timeScale = 1.0 / animationData.scale; } - if (animationData.frameCount > 1) { + if (animationData.frameCount > 0) { if (animationConfig.position < 0.0) { animationConfig.position %= animationData.duration; animationConfig.position = animationData.duration - animationConfig.position; @@ -7980,6 +7897,7 @@ var dragonBones; animationConfig.duration = -1.0; } this._fadeOut(animationConfig); + // var animationState = dragonBones.BaseObject.borrowObject(dragonBones.AnimationState); animationState.init(this._armature, animationData, animationConfig); this._animationDirty = true; @@ -8005,7 +7923,6 @@ var dragonBones; else { this._animationStates.push(animationState); } - // Child armature play same name animation. for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { var slot = _c[_b]; var childArmature = slot.childArmature; @@ -8015,28 +7932,28 @@ var dragonBones; childArmature.animation.fadeIn(animationName); // } } - var isLocked = false; for (var k in animationData.animationTimelines) { - if (!this._lockUpdate) { - isLocked = true; - this._lockUpdate = true; - } - var childAnimatiionState = this.fadeIn(k, animationConfig.fadeInTime, 1, animationState.layer, null, 0 /* None */); - if (childAnimatiionState !== null) { - childAnimatiionState.resetToPose = false; - childAnimatiionState._parent = animationState; - childAnimatiionState.stop(); + var childAnimationState = this.fadeIn(k, 0.0, 1, animationState.layer, "", 5 /* Single */); + if (childAnimationState === null) { + continue; } - } - if (isLocked) { - this._lockUpdate = false; - } - if (!this._lockUpdate) { - if (animationConfig.fadeInTime <= 0.0) { - this._armature.advanceTime(0.0); + var timelines = animationData.animationTimelines[k]; + childAnimationState.actionEnabled = false; + childAnimationState.resetToPose = false; + childAnimationState.stop(); + animationState.addState(childAnimationState, timelines); + // + var index = this._animationStates.indexOf(animationState); + var childIndex = this._animationStates.indexOf(childAnimationState); + if (childIndex < index) { + this._animationStates.splice(index, 1); + this._animationStates.splice(childIndex, 0, animationState); } - this._lastAnimationState = animationState; } + // if (!this._armature._lockUpdate && animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. + // this._armature.advanceTime(0.0); + // } + this._lastAnimationState = animationState; return animationState; }; /** @@ -8196,7 +8113,7 @@ var dragonBones; this._animationConfig.animation = animationName; var animationData = animationName in this._animations ? this._animations[animationName] : null; if (animationData !== null) { - this._animationConfig.position = animationData.duration * frame / animationData.frameCount; + this._animationConfig.position = animationData.frameCount > 0 ? animationData.duration * frame / animationData.frameCount : 0.0; } return this.playConfig(this._animationConfig); }; @@ -8304,9 +8221,24 @@ var dragonBones; } return animationState; }; + /** + * @internal + */ + Animation.prototype.getBlendState = function (type, name, target) { + if (!(type in this._blendStates)) { + this._blendStates[type] = {}; + } + var blendStates = this._blendStates[type]; + if (!(name in blendStates)) { + var blendState = blendStates[name] = dragonBones.BaseObject.borrowObject(dragonBones.BlendState); + blendState.target = target; + } + return blendStates[name]; + }; /** * - Get a specific animation state. * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) * @example *
          *     armature.animation.play("walk");
@@ -8317,8 +8249,9 @@ var dragonBones;
          * @language en_US
          */
         /**
-         * - 获取指定的动画状态
+         * - 获取指定的动画状态。
          * @param animationName - 动画状态名称。
+         * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1)
          * @example
          * 
          *     armature.animation.play("walk");
@@ -8328,11 +8261,12 @@ var dragonBones;
          * @version DragonBones 3.0
          * @language zh_CN
          */
-        Animation.prototype.getState = function (animationName) {
+        Animation.prototype.getState = function (animationName, layer) {
+            if (layer === void 0) { layer = -1; }
             var i = this._animationStates.length;
             while (i--) {
                 var animationState = this._animationStates[i];
-                if (animationState.name === animationName) {
+                if (animationState.name === animationName && (layer < 0 || animationState.layer === layer)) {
                     return animationState;
                 }
             }
@@ -8523,99 +8457,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link #play()} {@link #fadeIn()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #play()} {@link #fadeIn()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Animation.prototype.gotoAndPlay = function (animationName, fadeInTime, duration, playTimes, layer, group, fadeOutMode, pauseFadeOut, pauseFadeIn) {
-            if (fadeInTime === void 0) { fadeInTime = -1; }
-            if (duration === void 0) { duration = -1; }
-            if (playTimes === void 0) { playTimes = -1; }
-            if (layer === void 0) { layer = 0; }
-            if (group === void 0) { group = null; }
-            if (fadeOutMode === void 0) { fadeOutMode = 3 /* SameLayerAndGroup */; }
-            if (pauseFadeOut === void 0) { pauseFadeOut = true; }
-            if (pauseFadeIn === void 0) { pauseFadeIn = true; }
-            console.warn("Deprecated.");
-            // tslint:disable-next-line:no-unused-expression
-            pauseFadeOut;
-            // tslint:disable-next-line:no-unused-expression
-            pauseFadeIn;
-            this._animationConfig.clear();
-            this._animationConfig.resetToPose = true;
-            this._animationConfig.fadeOutMode = fadeOutMode;
-            this._animationConfig.playTimes = playTimes;
-            this._animationConfig.layer = layer;
-            this._animationConfig.fadeInTime = fadeInTime;
-            this._animationConfig.animation = animationName;
-            this._animationConfig.group = group !== null ? group : "";
-            var animationData = this._animations[animationName];
-            if (animationData && duration > 0.0) {
-                this._animationConfig.timeScale = animationData.duration / duration;
-            }
-            return this.playConfig(this._animationConfig);
-        };
-        /**
-         * - Deprecated, please refer to {@link #gotoAndStopByTime()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #gotoAndStopByTime()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        Animation.prototype.gotoAndStop = function (animationName, time) {
-            if (time === void 0) { time = 0; }
-            console.warn("Deprecated.");
-            return this.gotoAndStopByTime(animationName, time);
-        };
-        Object.defineProperty(Animation.prototype, "animationList", {
-            /**
-             * - Deprecated, please refer to {@link #animationNames}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #animationNames}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                return this._animationNames;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Animation.prototype, "animationDataList", {
-            /**
-             * - Deprecated, please refer to {@link #animationNames}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #animationNames}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                console.warn("Deprecated.");
-                var list = [];
-                for (var i = 0, l = this._animationNames.length; i < l; ++i) {
-                    list.push(this._animations[this._animationNames[i]]);
-                }
-                return list;
-            },
-            enumerable: true,
-            configurable: true
-        });
         return Animation;
     }(dragonBones.BaseObject));
     dragonBones.Animation = Animation;
@@ -8662,27 +8503,19 @@ var dragonBones;
         __extends(AnimationState, _super);
         function AnimationState() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
-            /**
-             * @internal
-             */
-            _this._blendState = new BlendState();
             _this._boneMask = [];
             _this._boneTimelines = [];
-            _this._surfaceTimelines = [];
+            _this._boneBlendTimelines = [];
             _this._slotTimelines = [];
+            _this._slotBlendTimelines = [];
             _this._constraintTimelines = [];
             _this._animationTimelines = [];
             _this._poseTimelines = [];
-            _this._bonePoses = {};
             /**
              * @internal
              */
             _this._actionTimeline = null; // Initial value.
             _this._zOrderTimeline = null; // Initial value.
-            /**
-             * @internal
-             */
-            _this._parent = null; // Initial value.
             return _this;
         }
         AnimationState.toString = function () {
@@ -8693,7 +8526,7 @@ var dragonBones;
                 var timeline = _a[_i];
                 timeline.returnToPool();
             }
-            for (var _b = 0, _c = this._surfaceTimelines; _b < _c.length; _b++) {
+            for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
                 var timeline = _c[_b];
                 timeline.returnToPool();
             }
@@ -8701,17 +8534,23 @@ var dragonBones;
                 var timeline = _e[_d];
                 timeline.returnToPool();
             }
-            for (var _f = 0, _g = this._constraintTimelines; _f < _g.length; _f++) {
+            for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) {
                 var timeline = _g[_f];
                 timeline.returnToPool();
             }
-            for (var _h = 0, _j = this._animationTimelines; _h < _j.length; _h++) {
+            for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) {
                 var timeline = _j[_h];
                 timeline.returnToPool();
             }
-            for (var k in this._bonePoses) {
-                this._bonePoses[k].returnToPool();
-                delete this._bonePoses[k];
+            for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) {
+                var timeline = _l[_k];
+                var animationState = timeline.target;
+                if (animationState._parent === this) {
+                    animationState._fadeState = 1;
+                    animationState._subFadeState = 1;
+                    animationState._parent = null;
+                }
+                timeline.returnToPool();
             }
             if (this._actionTimeline !== null) {
                 this._actionTimeline.returnToPool();
@@ -8720,13 +8559,18 @@ var dragonBones;
                 this._zOrderTimeline.returnToPool();
             }
             this.actionEnabled = false;
-            this.additiveBlending = false;
+            this.additive = false;
             this.displayControl = false;
             this.resetToPose = false;
+            this.blendType = 0 /* None */;
             this.playTimes = 1;
             this.layer = 0;
             this.timeScale = 1.0;
-            this.weight = 1.0;
+            this._weight = 1.0;
+            this.parameterX = 0.0;
+            this.parameterY = 0.0;
+            this.positionX = 0.0;
+            this.positionY = 0.0;
             this.autoFadeOutTime = 0.0;
             this.fadeTotalTime = 0.0;
             this.name = "";
@@ -8741,11 +8585,11 @@ var dragonBones;
             this._time = 0.0;
             this._fadeProgress = 0.0;
             this._weightResult = 0.0;
-            this._blendState.clear();
             this._boneMask.length = 0;
             this._boneTimelines.length = 0;
-            this._surfaceTimelines.length = 0;
+            this._boneBlendTimelines.length = 0;
             this._slotTimelines.length = 0;
+            this._slotBlendTimelines.length = 0;
             this._constraintTimelines.length = 0;
             this._animationTimelines.length = 0;
             this._poseTimelines.length = 0;
@@ -8754,7 +8598,9 @@ var dragonBones;
             this._armature = null; //
             this._actionTimeline = null; //
             this._zOrderTimeline = null;
-            this._parent = null; //
+            this._activeChildA = null;
+            this._activeChildB = null;
+            this._parent = null;
         };
         AnimationState.prototype._updateTimelines = function () {
             {
@@ -8767,7 +8613,7 @@ var dragonBones;
                             switch (timelineData.type) {
                                 case 30 /* IKConstraint */: {
                                     var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState);
-                                    timeline.constraint = constraint;
+                                    timeline.target = constraint;
                                     timeline.init(this._armature, this, timelineData);
                                     this._constraintTimelines.push(timeline);
                                     break;
@@ -8779,53 +8625,37 @@ var dragonBones;
                     }
                     else if (this.resetToPose) {
                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState);
-                        timeline.constraint = constraint;
+                        timeline.target = constraint;
                         timeline.init(this._armature, this, null);
                         this._constraintTimelines.push(timeline);
                         this._poseTimelines.push(timeline);
                     }
                 }
             }
-            {
-                for (var _c = 0, _d = this._armature.animation.getStates(); _c < _d.length; _c++) {
-                    var animationState = _d[_c];
-                    if (animationState._parent !== this) {
-                        continue;
-                    }
-                    var timelineDatas = this._animationData.getAnimationTimelines(animationState.name);
-                    if (timelineDatas === null) {
-                        continue;
-                    }
-                    for (var _e = 0, timelineDatas_2 = timelineDatas; _e < timelineDatas_2.length; _e++) {
-                        var timelineData = timelineDatas_2[_e];
-                        switch (timelineData.type) {
-                            case 40 /* AnimationTime */: {
-                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineState);
-                                timeline.animationState = animationState;
-                                timeline.init(this._armature, this, timelineData);
-                                this._animationTimelines.push(timeline);
-                                break;
-                            }
-                            default:
-                                break;
-                        }
-                    }
-                }
-            }
         };
         AnimationState.prototype._updateBoneAndSlotTimelines = function () {
             {
                 var boneTimelines = {};
+                // Create bone timelines map.
                 for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) {
                     var timeline = _a[_i];
-                    var timelineName = timeline.bone.name;
+                    var timelineName = timeline.target.target.name;
                     if (!(timelineName in boneTimelines)) {
                         boneTimelines[timelineName] = [];
                     }
                     boneTimelines[timelineName].push(timeline);
                 }
-                for (var _b = 0, _c = this._armature.getBones(); _b < _c.length; _b++) {
-                    var bone = _c[_b];
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
+                    var timelineName = timeline.target.target.name;
+                    if (!(timelineName in boneTimelines)) {
+                        boneTimelines[timelineName] = [];
+                    }
+                    boneTimelines[timelineName].push(timeline);
+                }
+                //
+                for (var _d = 0, _e = this._armature.getBones(); _d < _e.length; _d++) {
+                    var bone = _e[_d];
                     var timelineName = bone.name;
                     if (!this.containsBoneMask(timelineName)) {
                         continue;
@@ -8833,70 +8663,53 @@ var dragonBones;
                     if (timelineName in boneTimelines) {
                         delete boneTimelines[timelineName];
                     }
-                    else if (bone._boneData.type === 0 /* Bone */) {
+                    else {
                         var timelineDatas = this._animationData.getBoneTimelines(timelineName);
-                        var bonePose = timelineName in this._bonePoses ? this._bonePoses[timelineName] : (this._bonePoses[timelineName] = dragonBones.BaseObject.borrowObject(BonePose));
+                        var blendState = this._armature.animation.getBlendState(BlendState.BONE_TRANSFORM, bone.name, bone);
                         if (timelineDatas !== null) {
-                            for (var _d = 0, timelineDatas_3 = timelineDatas; _d < timelineDatas_3.length; _d++) {
-                                var timelineData = timelineDatas_3[_d];
+                            for (var _f = 0, timelineDatas_2 = timelineDatas; _f < timelineDatas_2.length; _f++) {
+                                var timelineData = timelineDatas_2[_f];
                                 switch (timelineData.type) {
                                     case 10 /* BoneAll */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 11 /* BoneTranslate */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneTranslateTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 12 /* BoneRotate */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneRotateTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
                                     case 13 /* BoneScale */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneScaleTimelineState);
-                                        timeline.bone = bone;
-                                        timeline.bonePose = bonePose;
+                                        timeline.target = blendState;
                                         timeline.init(this._armature, this, timelineData);
                                         this._boneTimelines.push(timeline);
                                         break;
                                     }
-                                    default:
+                                    case 60 /* BoneAlpha */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.BONE_ALPHA, bone.name, bone);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._boneBlendTimelines.push(timeline);
                                         break;
-                                }
-                            }
-                        }
-                        else if (this.resetToPose) {
-                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
-                            timeline.bone = bone;
-                            timeline.bonePose = bonePose;
-                            timeline.init(this._armature, this, null);
-                            this._boneTimelines.push(timeline);
-                            this._poseTimelines.push(timeline);
-                        }
-                    }
-                    else if (bone._boneData.type === 1 /* Surface */) {
-                        var timelineDatas = this._animationData.getSurfaceTimelines(timelineName);
-                        if (timelineDatas !== null) {
-                            for (var _e = 0, timelineDatas_4 = timelineDatas; _e < timelineDatas_4.length; _e++) {
-                                var timelineData = timelineDatas_4[_e];
-                                switch (timelineData.type) {
+                                    }
                                     case 50 /* Surface */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
-                                        timeline.surface = bone;
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone);
                                         timeline.init(this._armature, this, timelineData);
-                                        this._surfaceTimelines.push(timeline);
+                                        this._boneBlendTimelines.push(timeline);
                                         break;
                                     }
                                     default:
@@ -8905,41 +8718,67 @@ var dragonBones;
                             }
                         }
                         else if (this.resetToPose) {
-                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
-                            timeline.surface = bone;
-                            timeline.init(this._armature, this, null);
-                            this._surfaceTimelines.push(timeline);
-                            this._poseTimelines.push(timeline);
+                            if (bone._boneData.type === 0 /* Bone */) {
+                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState);
+                                timeline.target = blendState;
+                                timeline.init(this._armature, this, null);
+                                this._boneTimelines.push(timeline);
+                                this._poseTimelines.push(timeline);
+                            }
+                            else {
+                                var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState);
+                                timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone);
+                                timeline.init(this._armature, this, null);
+                                this._boneBlendTimelines.push(timeline);
+                                this._poseTimelines.push(timeline);
+                            }
                         }
                     }
                 }
                 for (var k in boneTimelines) {
-                    for (var _f = 0, _g = boneTimelines[k]; _f < _g.length; _f++) {
-                        var timeline = _g[_f];
-                        this._boneTimelines.splice(this._boneTimelines.indexOf(timeline), 1);
-                        timeline.returnToPool();
+                    for (var _g = 0, _h = boneTimelines[k]; _g < _h.length; _g++) {
+                        var timeline = _h[_g];
+                        var index = this._boneTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._boneTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
+                        index = this._boneBlendTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._boneBlendTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
                     }
                 }
             }
             {
                 var slotTimelines = {};
                 var ffdFlags = [];
-                for (var _h = 0, _j = this._slotTimelines; _h < _j.length; _h++) {
-                    var timeline = _j[_h];
-                    var timelineName = timeline.slot.name;
+                // Create slot timelines map.
+                for (var _j = 0, _k = this._slotTimelines; _j < _k.length; _j++) {
+                    var timeline = _k[_j];
+                    var timelineName = timeline.target.name;
                     if (!(timelineName in slotTimelines)) {
                         slotTimelines[timelineName] = [];
                     }
                     slotTimelines[timelineName].push(timeline);
                 }
-                for (var _k = 0, _l = this._armature.getSlots(); _k < _l.length; _k++) {
-                    var slot = _l[_k];
+                for (var _l = 0, _m = this._slotBlendTimelines; _l < _m.length; _l++) {
+                    var timeline = _m[_l];
+                    var timelineName = timeline.target.target.name;
+                    if (!(timelineName in slotTimelines)) {
+                        slotTimelines[timelineName] = [];
+                    }
+                    slotTimelines[timelineName].push(timeline);
+                }
+                //
+                for (var _o = 0, _p = this._armature.getSlots(); _o < _p.length; _o++) {
+                    var slot = _p[_o];
                     var boneName = slot.parent.name;
                     if (!this.containsBoneMask(boneName)) {
                         continue;
                     }
                     var timelineName = slot.name;
-                    var timelineDatas = this._animationData.getSlotTimelines(timelineName);
                     if (timelineName in slotTimelines) {
                         delete slotTimelines[timelineName];
                     }
@@ -8947,21 +8786,29 @@ var dragonBones;
                         var displayIndexFlag = false;
                         var colorFlag = false;
                         ffdFlags.length = 0;
+                        var timelineDatas = this._animationData.getSlotTimelines(timelineName);
                         if (timelineDatas !== null) {
-                            for (var _m = 0, timelineDatas_5 = timelineDatas; _m < timelineDatas_5.length; _m++) {
-                                var timelineData = timelineDatas_5[_m];
+                            for (var _q = 0, timelineDatas_3 = timelineDatas; _q < timelineDatas_3.length; _q++) {
+                                var timelineData = timelineDatas_3[_q];
                                 switch (timelineData.type) {
                                     case 20 /* SlotDisplay */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDislayTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = slot;
                                         timeline.init(this._armature, this, timelineData);
                                         this._slotTimelines.push(timeline);
                                         displayIndexFlag = true;
                                         break;
                                     }
+                                    case 23 /* SlotZIndex */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotZIndexTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_Z_INDEX, slot.name, slot);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._slotBlendTimelines.push(timeline);
+                                        break;
+                                    }
                                     case 21 /* SlotColor */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = slot;
                                         timeline.init(this._armature, this, timelineData);
                                         this._slotTimelines.push(timeline);
                                         colorFlag = true;
@@ -8969,10 +8816,22 @@ var dragonBones;
                                     }
                                     case 22 /* SlotDeform */: {
                                         var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
-                                        timeline.slot = slot;
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot);
                                         timeline.init(this._armature, this, timelineData);
-                                        this._slotTimelines.push(timeline);
-                                        ffdFlags.push(timeline.vertexOffset);
+                                        if (timeline.target !== null) {
+                                            this._slotBlendTimelines.push(timeline);
+                                            ffdFlags.push(timeline.geometryOffset);
+                                        }
+                                        else {
+                                            timeline.returnToPool();
+                                        }
+                                        break;
+                                    }
+                                    case 24 /* SlotAlpha */: {
+                                        var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState);
+                                        timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_ALPHA, slot.name, slot);
+                                        timeline.init(this._armature, this, timelineData);
+                                        this._slotBlendTimelines.push(timeline);
                                         break;
                                     }
                                     default:
@@ -8983,42 +8842,50 @@ var dragonBones;
                         if (this.resetToPose) {
                             if (!displayIndexFlag) {
                                 var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDislayTimelineState);
-                                timeline.slot = slot;
+                                timeline.target = slot;
                                 timeline.init(this._armature, this, null);
                                 this._slotTimelines.push(timeline);
                                 this._poseTimelines.push(timeline);
                             }
                             if (!colorFlag) {
                                 var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState);
-                                timeline.slot = slot;
+                                timeline.target = slot;
                                 timeline.init(this._armature, this, null);
                                 this._slotTimelines.push(timeline);
                                 this._poseTimelines.push(timeline);
                             }
-                            if (slot.rawDisplayDatas !== null) {
-                                for (var _o = 0, _p = slot.rawDisplayDatas; _o < _p.length; _o++) {
-                                    var displayData = _p[_o];
-                                    if (displayData !== null && displayData.type === 2 /* Mesh */) {
-                                        var meshOffset = displayData.vertices.offset;
-                                        if (ffdFlags.indexOf(meshOffset) < 0) {
-                                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
-                                            timeline.vertexOffset = meshOffset; //
-                                            timeline.slot = slot;
-                                            timeline.init(this._armature, this, null);
-                                            this._slotTimelines.push(timeline);
-                                            this._poseTimelines.push(timeline);
-                                        }
-                                    }
+                            for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                                var displayFrame = slot.getDisplayFrameAt(i);
+                                if (displayFrame.deformVertices.length === 0) {
+                                    continue;
+                                }
+                                var geometryData = displayFrame.getGeometryData();
+                                if (geometryData !== null && ffdFlags.indexOf(geometryData.offset) < 0) {
+                                    var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState);
+                                    timeline.geometryOffset = geometryData.offset; //
+                                    timeline.displayFrame = displayFrame; //
+                                    timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot);
+                                    timeline.init(this._armature, this, null);
+                                    this._slotBlendTimelines.push(timeline);
+                                    this._poseTimelines.push(timeline);
                                 }
                             }
                         }
                     }
                 }
                 for (var k in slotTimelines) {
-                    for (var _q = 0, _r = slotTimelines[k]; _q < _r.length; _q++) {
-                        var timeline = _r[_q];
-                        this._slotTimelines.splice(this._slotTimelines.indexOf(timeline), 1);
-                        timeline.returnToPool();
+                    for (var _r = 0, _s = slotTimelines[k]; _r < _s.length; _r++) {
+                        var timeline = _s[_r];
+                        var index = this._slotTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._slotTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
+                        index = this._slotBlendTimelines.indexOf(timeline);
+                        if (index >= 0) {
+                            this._slotBlendTimelines.splice(index, 1);
+                            timeline.returnToPool();
+                        }
                     }
                 }
             }
@@ -9027,13 +8894,16 @@ var dragonBones;
             var isFadeOut = this._fadeState > 0;
             if (this._subFadeState < 0) {
                 this._subFadeState = 0;
-                var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN;
-                if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
-                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                    eventObject.type = eventType;
-                    eventObject.armature = this._armature;
-                    eventObject.animationState = this;
-                    this._armature._dragonBones.bufferEvent(eventObject);
+                var eventActive = this._parent === null && this.actionEnabled;
+                if (eventActive) {
+                    var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN;
+                    if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
+                        var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                        eventObject.type = eventType;
+                        eventObject.armature = this._armature;
+                        eventObject.animationState = this;
+                        this._armature._dragonBones.bufferEvent(eventObject);
+                    }
                 }
             }
             if (passedTime < 0.0) {
@@ -9055,13 +8925,16 @@ var dragonBones;
                     this._playheadState |= 1; // x1
                     this._fadeState = 0;
                 }
-                var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE;
-                if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
-                    var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
-                    eventObject.type = eventType;
-                    eventObject.armature = this._armature;
-                    eventObject.animationState = this;
-                    this._armature._dragonBones.bufferEvent(eventObject);
+                var eventActive = this._parent === null && this.actionEnabled;
+                if (eventActive) {
+                    var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE;
+                    if (this._armature.eventDispatcher.hasDBEventListener(eventType)) {
+                        var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
+                        eventObject.type = eventType;
+                        eventObject.armature = this._armature;
+                        eventObject.animationState = this;
+                        this._armature._dragonBones.bufferEvent(eventObject);
+                    }
                 }
             }
         };
@@ -9076,17 +8949,19 @@ var dragonBones;
             this._animationData = animationData;
             //
             this.resetToPose = animationConfig.resetToPose;
-            this.additiveBlending = animationConfig.additiveBlending;
+            this.additive = animationConfig.additive;
             this.displayControl = animationConfig.displayControl;
             this.actionEnabled = animationConfig.actionEnabled;
+            this.blendType = animationData.blendType;
             this.layer = animationConfig.layer;
             this.playTimes = animationConfig.playTimes;
             this.timeScale = animationConfig.timeScale;
             this.fadeTotalTime = animationConfig.fadeInTime;
             this.autoFadeOutTime = animationConfig.autoFadeOutTime;
-            this.weight = animationConfig.weight;
             this.name = animationConfig.name.length > 0 ? animationConfig.name : animationConfig.animation;
             this.group = animationConfig.group;
+            //
+            this._weight = animationConfig.weight;
             if (animationConfig.pauseFadeIn) {
                 this._playheadState = 2; // 10
             }
@@ -9140,7 +9015,6 @@ var dragonBones;
          * @internal
          */
         AnimationState.prototype.advanceTime = function (passedTime, cacheFrameRate) {
-            this._blendState.dirty = false;
             // Update fade time.
             if (this._fadeState !== 0 || this._subFadeState !== 0) {
                 this._advanceFadeTime(passedTime);
@@ -9160,19 +9034,20 @@ var dragonBones;
                 this._timelineDirty = 0;
                 this._updateBoneAndSlotTimelines();
             }
-            if (this.weight === 0.0) {
-                return;
-            }
+            var isBlendDirty = this._fadeState !== 0 || this._subFadeState === 0;
             var isCacheEnabled = this._fadeState === 0 && cacheFrameRate > 0.0;
             var isUpdateTimeline = true;
             var isUpdateBoneTimeline = true;
             var time = this._time;
-            this._weightResult = this.weight * this._fadeProgress;
+            this._weightResult = this._weight * this._fadeProgress;
             if (this._parent !== null) {
-                this._weightResult *= this._parent._weightResult / this._parent._fadeProgress;
+                this._weightResult *= this._parent._weightResult;
             }
             if (this._actionTimeline.playState <= 0) {
-                this._actionTimeline.update(time); // Update main timeline.
+                this._actionTimeline.update(time);
+            }
+            if (this._weight === 0.0) {
+                return;
             }
             if (isCacheEnabled) {
                 var internval = cacheFrameRate * 2.0;
@@ -9198,57 +9073,117 @@ var dragonBones;
                 }
             }
             if (isUpdateTimeline) {
+                var isBlend = false;
+                var prevTarget = null; //
                 if (isUpdateBoneTimeline) {
                     for (var i = 0, l = this._boneTimelines.length; i < l; ++i) {
                         var timeline = this._boneTimelines[i];
                         if (timeline.playState <= 0) {
                             timeline.update(time);
                         }
-                        if (i === l - 1 || timeline.bone !== this._boneTimelines[i + 1].bone) {
-                            var state = timeline.bone._blendState.update(this._weightResult, this.layer);
-                            if (state !== 0) {
-                                timeline.blend(state);
+                        if (timeline.target !== prevTarget) {
+                            var blendState = timeline.target;
+                            isBlend = blendState.update(this);
+                            prevTarget = blendState;
+                            if (blendState.dirty === 1) {
+                                var pose = blendState.target.animationPose;
+                                pose.x = 0.0;
+                                pose.y = 0.0;
+                                pose.rotation = 0.0;
+                                pose.skew = 0.0;
+                                pose.scaleX = 1.0;
+                                pose.scaleY = 1.0;
                             }
                         }
+                        if (isBlend) {
+                            timeline.blend(isBlendDirty);
+                        }
                     }
                 }
-                for (var i = 0, l = this._surfaceTimelines.length; i < l; ++i) {
-                    var timeline = this._surfaceTimelines[i];
-                    var state = timeline.surface._blendState.update(this._weightResult, this.layer);
+                for (var i = 0, l = this._boneBlendTimelines.length; i < l; ++i) {
+                    var timeline = this._boneBlendTimelines[i];
                     if (timeline.playState <= 0) {
                         timeline.update(time);
                     }
-                    if (state !== 0) {
-                        timeline.blend(state);
+                    if (timeline.target.update(this)) {
+                        timeline.blend(isBlendDirty);
                     }
                 }
                 if (this.displayControl) {
                     for (var i = 0, l = this._slotTimelines.length; i < l; ++i) {
                         var timeline = this._slotTimelines[i];
-                        var displayController = timeline.slot.displayController;
-                        if (displayController === null ||
-                            displayController === this.name ||
-                            displayController === this.group) {
-                            if (timeline.playState <= 0) {
+                        if (timeline.playState <= 0) {
+                            var slot = timeline.target;
+                            var displayController = slot.displayController;
+                            if (displayController === null ||
+                                displayController === this.name ||
+                                displayController === this.group) {
                                 timeline.update(time);
                             }
                         }
                     }
                 }
-                for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) {
-                    var timeline = this._constraintTimelines[i];
+                for (var i = 0, l = this._slotBlendTimelines.length; i < l; ++i) {
+                    var timeline = this._slotBlendTimelines[i];
                     if (timeline.playState <= 0) {
+                        var blendState = timeline.target;
                         timeline.update(time);
+                        if (blendState.update(this)) {
+                            timeline.blend(isBlendDirty);
+                        }
                     }
                 }
-                for (var i = 0, l = this._animationTimelines.length; i < l; ++i) {
-                    var timeline = this._animationTimelines[i];
-                    var state = timeline.animationState._blendState.update(this._weightResult, this.layer);
+                for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) {
+                    var timeline = this._constraintTimelines[i];
                     if (timeline.playState <= 0) {
                         timeline.update(time);
                     }
-                    if (state !== 0) {
-                        timeline.blend(state);
+                }
+                if (this._animationTimelines.length > 0) {
+                    var dL = 100.0;
+                    var dR = 100.0;
+                    var leftState = null;
+                    var rightState = null;
+                    for (var i = 0, l = this._animationTimelines.length; i < l; ++i) {
+                        var timeline = this._animationTimelines[i];
+                        if (timeline.playState <= 0) {
+                            timeline.update(time);
+                        }
+                        if (this.blendType === 1 /* E1D */) {
+                            var animationState = timeline.target;
+                            var d = this.parameterX - animationState.positionX;
+                            if (d >= 0.0) {
+                                if (d < dL) {
+                                    dL = d;
+                                    leftState = animationState;
+                                }
+                            }
+                            else {
+                                if (-d < dR) {
+                                    dR = -d;
+                                    rightState = animationState;
+                                }
+                            }
+                        }
+                    }
+                    if (leftState !== null) {
+                        if (this._activeChildA !== leftState) {
+                            if (this._activeChildA !== null) {
+                                this._activeChildA.weight = 0.0;
+                            }
+                            this._activeChildA = leftState;
+                            this._activeChildA.activeTimeline();
+                        }
+                        if (this._activeChildB !== rightState) {
+                            if (this._activeChildB !== null) {
+                                this._activeChildB.weight = 0.0;
+                            }
+                            this._activeChildB = rightState;
+                        }
+                        leftState.weight = dR / (dL + dR);
+                        if (rightState) {
+                            rightState.weight = 1.0 - leftState.weight;
+                        }
                     }
                 }
             }
@@ -9258,19 +9193,36 @@ var dragonBones;
                     if (this._poseTimelines.length > 0) {
                         for (var _i = 0, _a = this._poseTimelines; _i < _a.length; _i++) {
                             var timeline = _a[_i];
-                            if (timeline instanceof dragonBones.BoneTimelineState) {
-                                this._boneTimelines.splice(this._boneTimelines.indexOf(timeline), 1);
+                            var index = this._boneTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._boneTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.SurfaceTimelineState) {
-                                this._surfaceTimelines.splice(this._surfaceTimelines.indexOf(timeline), 1);
+                            index = this._boneBlendTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._boneBlendTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.SlotTimelineState) {
-                                this._slotTimelines.splice(this._slotTimelines.indexOf(timeline), 1);
+                            index = this._slotTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._slotTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            else if (timeline instanceof dragonBones.ConstraintTimelineState) {
-                                this._constraintTimelines.splice(this._constraintTimelines.indexOf(timeline), 1);
+                            index = this._slotBlendTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._slotBlendTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
+                            }
+                            index = this._constraintTimelines.indexOf(timeline);
+                            if (index >= 0) {
+                                this._constraintTimelines.splice(index, 1);
+                                timeline.returnToPool();
+                                continue;
                             }
-                            timeline.returnToPool();
                         }
                         this._poseTimelines.length = 0;
                     }
@@ -9345,7 +9297,7 @@ var dragonBones;
                     var timeline = _a[_i];
                     timeline.fadeOut();
                 }
-                for (var _b = 0, _c = this._surfaceTimelines; _b < _c.length; _b++) {
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
                     var timeline = _c[_b];
                     timeline.fadeOut();
                 }
@@ -9353,15 +9305,21 @@ var dragonBones;
                     var timeline = _e[_d];
                     timeline.fadeOut();
                 }
-                for (var _f = 0, _g = this._constraintTimelines; _f < _g.length; _f++) {
+                for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) {
                     var timeline = _g[_f];
                     timeline.fadeOut();
                 }
-                for (var _h = 0, _j = this._animationTimelines; _h < _j.length; _h++) {
+                for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) {
                     var timeline = _j[_h];
-                    timeline.animationState.fadeOut(fadeOutTime, pausePlayhead);
                     timeline.fadeOut();
                 }
+                for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) {
+                    var timeline = _l[_k];
+                    timeline.fadeOut();
+                    //
+                    var animaitonState = timeline.target;
+                    animaitonState.fadeOut(999999.0, true);
+                }
             }
             this.displayControl = false; //
             this.fadeTotalTime = this._fadeProgress > 0.000001 ? fadeOutTime / this._fadeProgress : 0.0;
@@ -9442,9 +9400,9 @@ var dragonBones;
                     if (this._boneMask.length > 0) {
                         for (var _i = 0, bones_1 = bones; _i < bones_1.length; _i++) {
                             var bone = bones_1[_i];
-                            var index_2 = this._boneMask.indexOf(bone.name);
-                            if (index_2 >= 0 && currentBone.contains(bone)) {
-                                this._boneMask.splice(index_2, 1);
+                            var index_1 = this._boneMask.indexOf(bone.name);
+                            if (index_1 >= 0 && currentBone.contains(bone)) {
+                                this._boneMask.splice(index_1, 1);
                             }
                         }
                     }
@@ -9477,6 +9435,63 @@ var dragonBones;
             this._boneMask.length = 0;
             this._timelineDirty = 1;
         };
+        /**
+         * @private
+         */
+        AnimationState.prototype.addState = function (animationState, timelineDatas) {
+            if (timelineDatas === void 0) { timelineDatas = null; }
+            if (timelineDatas !== null) {
+                for (var _i = 0, timelineDatas_4 = timelineDatas; _i < timelineDatas_4.length; _i++) {
+                    var timelineData = timelineDatas_4[_i];
+                    switch (timelineData.type) {
+                        case 40 /* AnimationProgress */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationProgressTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            if (this.blendType !== 0 /* None */) {
+                                var animaitonTimelineData = timelineData;
+                                animationState.positionX = animaitonTimelineData.x;
+                                animationState.positionY = animaitonTimelineData.y;
+                                animationState.weight = 0.0;
+                            }
+                            animationState._parent = this;
+                            this.resetToPose = false;
+                            break;
+                        }
+                        case 41 /* AnimationWeight */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationWeightTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            break;
+                        }
+                        case 42 /* AnimationParameter */: {
+                            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationParametersTimelineState);
+                            timeline.target = animationState;
+                            timeline.init(this._armature, this, timelineData);
+                            this._animationTimelines.push(timeline);
+                            break;
+                        }
+                        default:
+                            break;
+                    }
+                }
+            }
+            if (animationState._parent === null) {
+                animationState._parent = this;
+            }
+        };
+        /**
+         * @internal
+         */
+        AnimationState.prototype.activeTimeline = function () {
+            for (var _i = 0, _a = this._slotTimelines; _i < _a.length; _i++) {
+                var timeline = _a[_i];
+                timeline.dirty = true;
+                timeline.currentTime = -1.0;
+            }
+        };
         Object.defineProperty(AnimationState.prototype, "isFadeIn", {
             /**
              * - Whether the animation state is fading in.
@@ -9618,8 +9633,9 @@ var dragonBones;
                         value += this._duration;
                     }
                 }
-                if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 && value === this._duration) {
-                    value = this._duration - 0.000001;
+                if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 &&
+                    value === this._duration && this._parent === null) {
+                    value = this._duration - 0.000001; // 
                 }
                 if (this._time === value) {
                     return;
@@ -9641,13 +9657,50 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(AnimationState.prototype, "animationData", {
+        Object.defineProperty(AnimationState.prototype, "weight", {
+            /**
+             * - The blend weight.
+             * @default 1.0
+             * @version DragonBones 5.0
+             * @language en_US
+             */
+            /**
+             * - 混合权重。
+             * @default 1.0
+             * @version DragonBones 5.0
+             * @language zh_CN
+             */
             /**
              * - The animation data.
              * @see dragonBones.AnimationData
              * @version DragonBones 3.0
              * @language en_US
              */
+            get: function () {
+                return this._weight;
+            },
+            set: function (value) {
+                if (this._weight === value) {
+                    return;
+                }
+                this._weight = value;
+                for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) {
+                    var timeline = _a[_i];
+                    timeline.dirty = true;
+                }
+                for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) {
+                    var timeline = _c[_b];
+                    timeline.dirty = true;
+                }
+                for (var _d = 0, _e = this._slotBlendTimelines; _d < _e.length; _d++) {
+                    var timeline = _e[_d];
+                    timeline.dirty = true;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(AnimationState.prototype, "animationData", {
             /**
              * - 动画数据。
              * @see dragonBones.AnimationData
@@ -9666,74 +9719,65 @@ var dragonBones;
     /**
      * @internal
      */
-    var BonePose = /** @class */ (function (_super) {
-        __extends(BonePose, _super);
-        function BonePose() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this.current = new dragonBones.Transform();
-            _this.delta = new dragonBones.Transform();
-            _this.result = new dragonBones.Transform();
-            return _this;
+    var BlendState = /** @class */ (function (_super) {
+        __extends(BlendState, _super);
+        function BlendState() {
+            return _super !== null && _super.apply(this, arguments) || this;
         }
-        BonePose.toString = function () {
-            return "[class dragonBones.BonePose]";
+        BlendState.toString = function () {
+            return "[class dragonBones.BlendState]";
         };
-        BonePose.prototype._onClear = function () {
-            this.current.identity();
-            this.delta.identity();
-            this.result.identity();
+        BlendState.prototype._onClear = function () {
+            this.reset();
+            this.target = null;
         };
-        return BonePose;
-    }(dragonBones.BaseObject));
-    dragonBones.BonePose = BonePose;
-    /**
-     * @internal
-     */
-    var BlendState = /** @class */ (function () {
-        function BlendState() {
-        }
-        /**
-         * -1: First blending, 0: No blending, 1: Blending.
-         */
-        BlendState.prototype.update = function (weight, p_layer) {
-            if (this.dirty) {
+        BlendState.prototype.update = function (animationState) {
+            var animationLayer = animationState.layer;
+            var animationWeight = animationState._weightResult;
+            if (this.dirty > 0) {
                 if (this.leftWeight > 0.0) {
-                    if (this.layer !== p_layer) {
+                    if (this.layer !== animationLayer) {
                         if (this.layerWeight >= this.leftWeight) {
+                            this.dirty++;
+                            this.layer = animationLayer;
                             this.leftWeight = 0.0;
-                            return 0;
-                        }
-                        else {
-                            this.layer = p_layer;
-                            this.leftWeight -= this.layerWeight;
-                            this.layerWeight = 0.0;
+                            this.blendWeight = 0.0;
+                            return false;
                         }
+                        this.layer = animationLayer;
+                        this.leftWeight -= this.layerWeight;
+                        this.layerWeight = 0.0;
                     }
+                    animationWeight *= this.leftWeight;
+                    this.dirty++;
+                    this.blendWeight = animationWeight;
+                    this.layerWeight += this.blendWeight;
+                    return true;
                 }
-                else {
-                    return 0;
-                }
-                weight *= this.leftWeight;
-                this.layerWeight += weight;
-                this.blendWeight = weight;
-                return 2;
+                return false;
             }
-            this.dirty = true;
-            this.layer = p_layer;
-            this.layerWeight = weight;
+            this.dirty++;
+            this.layer = animationLayer;
             this.leftWeight = 1.0;
-            this.blendWeight = weight;
-            return 1;
+            this.blendWeight = animationWeight;
+            this.layerWeight = animationWeight;
+            return true;
         };
-        BlendState.prototype.clear = function () {
-            this.dirty = false;
+        BlendState.prototype.reset = function () {
+            this.dirty = 0;
             this.layer = 0;
             this.leftWeight = 0.0;
             this.layerWeight = 0.0;
             this.blendWeight = 0.0;
         };
+        BlendState.BONE_TRANSFORM = "boneTransform";
+        BlendState.BONE_ALPHA = "boneAlpha";
+        BlendState.SURFACE = "surface";
+        BlendState.SLOT_DEFORM = "slotDeform";
+        BlendState.SLOT_ALPHA = "slotAlpha";
+        BlendState.SLOT_Z_INDEX = "slotZIndex";
         return BlendState;
-    }());
+    }(dragonBones.BaseObject));
     dragonBones.BlendState = BlendState;
 })(dragonBones || (dragonBones = {}));
 /**
@@ -9769,29 +9813,30 @@ var dragonBones;
             return _super !== null && _super.apply(this, arguments) || this;
         }
         TimelineState.prototype._onClear = function () {
+            this.dirty = false;
             this.playState = -1;
             this.currentPlayTimes = -1;
             this.currentTime = -1.0;
-            this._tweenState = 0 /* None */;
-            this._frameRate = 0;
+            this.target = null;
+            this._isTween = false;
+            this._valueOffset = 0;
             this._frameValueOffset = 0;
-            this._frameCount = 0;
             this._frameOffset = 0;
+            this._frameRate = 0;
+            this._frameCount = 0;
             this._frameIndex = -1;
             this._frameRateR = 0.0;
             this._position = 0.0;
             this._duration = 0.0;
             this._timeScale = 1.0;
             this._timeOffset = 0.0;
-            this._dragonBonesData = null; //
             this._animationData = null; //
             this._timelineData = null; //
             this._armature = null; //
             this._animationState = null; //
             this._actionTimeline = null; //
             this._frameArray = null; //
-            this._frameIntArray = null; //
-            this._frameFloatArray = null; //
+            this._valueArray = null; //
             this._timelineArray = null; //
             this._frameIndices = null; //
         };
@@ -9862,25 +9907,27 @@ var dragonBones;
             if (this === this._actionTimeline) {
                 this._actionTimeline = null; //
             }
-            this._animationData = this._animationState._animationData;
+            this._animationData = this._animationState.animationData;
+            //
             this._frameRate = this._animationData.parent.frameRate;
             this._frameRateR = 1.0 / this._frameRate;
             this._position = this._animationState._position;
             this._duration = this._animationState._duration;
-            this._dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data.
             if (this._timelineData !== null) {
-                this._frameIntArray = this._dragonBonesData.frameIntArray;
-                this._frameFloatArray = this._dragonBonesData.frameFloatArray;
-                this._frameArray = this._dragonBonesData.frameArray;
-                this._timelineArray = this._dragonBonesData.timelineArray;
-                this._frameIndices = this._dragonBonesData.frameIndices;
+                var dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data.
+                this._frameArray = dragonBonesData.frameArray;
+                this._timelineArray = dragonBonesData.timelineArray;
+                this._frameIndices = dragonBonesData.frameIndices;
+                //
                 this._frameCount = this._timelineArray[this._timelineData.offset + 2 /* TimelineKeyFrameCount */];
                 this._frameValueOffset = this._timelineArray[this._timelineData.offset + 4 /* TimelineFrameValueOffset */];
                 this._timeScale = 100.0 / this._timelineArray[this._timelineData.offset + 0 /* TimelineScale */];
                 this._timeOffset = this._timelineArray[this._timelineData.offset + 1 /* TimelineOffset */] * 0.01;
             }
         };
-        TimelineState.prototype.fadeOut = function () { };
+        TimelineState.prototype.fadeOut = function () {
+            this.dirty = false;
+        };
         TimelineState.prototype.update = function (passedTime) {
             if (this._setCurrentTime(passedTime)) {
                 if (this._frameCount > 1) {
@@ -9899,11 +9946,13 @@ var dragonBones;
                     }
                     this._onArriveAtFrame();
                 }
-                if (this._tweenState !== 0 /* None */) {
+                if (this._isTween || this.dirty) {
                     this._onUpdateFrame();
                 }
             }
         };
+        TimelineState.prototype.blend = function (_isDirty) {
+        };
         return TimelineState;
     }(dragonBones.BaseObject));
     dragonBones.TimelineState = TimelineState;
@@ -9937,10 +9986,19 @@ var dragonBones;
             else if (progress >= 1.0) {
                 return 1.0;
             }
+            var isOmited = count > 0;
             var segmentCount = count + 1; // + 2 - 1
             var valueIndex = Math.floor(progress * segmentCount);
-            var fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1];
-            var toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex];
+            var fromValue = 0.0;
+            var toValue = 0.0;
+            if (isOmited) {
+                fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1];
+                toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex];
+            }
+            else {
+                fromValue = samples[offset + valueIndex - 1];
+                toValue = samples[offset + valueIndex];
+            }
             return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001;
         };
         TweenTimelineState.prototype._onClear = function () {
@@ -9949,21 +10007,27 @@ var dragonBones;
             this._curveCount = 0;
             this._framePosition = 0.0;
             this._frameDurationR = 0.0;
-            this._tweenProgress = 0.0;
             this._tweenEasing = 0.0;
+            this._tweenProgress = 0.0;
+            this._valueScale = 1.0;
         };
         TweenTimelineState.prototype._onArriveAtFrame = function () {
             if (this._frameCount > 1 &&
                 (this._frameIndex !== this._frameCount - 1 ||
                     this._animationState.playTimes === 0 ||
                     this._animationState.currentPlayTimes < this._animationState.playTimes - 1)) {
-                this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */]; // TODO recode ture tween type.
-                this._tweenState = this._tweenType === 0 /* None */ ? 1 /* Once */ : 2 /* Always */;
-                if (this._tweenType === 2 /* Curve */) {
-                    this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */];
+                this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */];
+                this._isTween = this._tweenType !== 0 /* None */;
+                if (this._isTween) {
+                    if (this._tweenType === 2 /* Curve */) {
+                        this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */];
+                    }
+                    else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) {
+                        this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01;
+                    }
                 }
-                else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) {
-                    this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01;
+                else {
+                    this.dirty = true;
                 }
                 this._framePosition = this._frameArray[this._frameOffset] * this._frameRateR;
                 if (this._frameIndex === this._frameCount - 1) {
@@ -9981,11 +10045,13 @@ var dragonBones;
                 }
             }
             else {
-                this._tweenState = 1 /* Once */;
+                this.dirty = true;
+                this._isTween = false;
             }
         };
         TweenTimelineState.prototype._onUpdateFrame = function () {
-            if (this._tweenState === 2 /* Always */) {
+            if (this._isTween) {
+                this.dirty = true;
                 this._tweenProgress = (this.currentTime - this._framePosition) * this._frameDurationR;
                 if (this._tweenType === 2 /* Curve */) {
                     this._tweenProgress = TweenTimelineState._getEasingCurveValue(this._tweenProgress, this._frameArray, this._curveCount, this._frameOffset + 3 /* FrameCurveSamples */);
@@ -9994,9 +10060,6 @@ var dragonBones;
                     this._tweenProgress = TweenTimelineState._getEasingValue(this._tweenType, this._tweenProgress, this._tweenEasing);
                 }
             }
-            else {
-                this._tweenProgress = 0.0;
-            }
         };
         return TweenTimelineState;
     }(TimelineState));
@@ -10004,92 +10067,207 @@ var dragonBones;
     /**
      * @internal
      */
-    var BoneTimelineState = /** @class */ (function (_super) {
-        __extends(BoneTimelineState, _super);
-        function BoneTimelineState() {
+    var SingleValueTimelineState = /** @class */ (function (_super) {
+        __extends(SingleValueTimelineState, _super);
+        function SingleValueTimelineState() {
             return _super !== null && _super.apply(this, arguments) || this;
         }
-        BoneTimelineState.prototype._onClear = function () {
+        SingleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.bone = null; //
-            this.bonePose = null; //
-        };
-        BoneTimelineState.prototype.blend = function (state) {
-            var blendWeight = this.bone._blendState.blendWeight;
-            var animationPose = this.bone.animationPose;
-            var result = this.bonePose.result;
-            if (state === 2) {
-                animationPose.x += result.x * blendWeight;
-                animationPose.y += result.y * blendWeight;
-                animationPose.rotation += result.rotation * blendWeight;
-                animationPose.skew += result.skew * blendWeight;
-                animationPose.scaleX += (result.scaleX - 1.0) * blendWeight;
-                animationPose.scaleY += (result.scaleY - 1.0) * blendWeight;
-            }
-            else if (blendWeight !== 1.0) {
-                animationPose.x = result.x * blendWeight;
-                animationPose.y = result.y * blendWeight;
-                animationPose.rotation = result.rotation * blendWeight;
-                animationPose.skew = result.skew * blendWeight;
-                animationPose.scaleX = (result.scaleX - 1.0) * blendWeight + 1.0;
-                animationPose.scaleY = (result.scaleY - 1.0) * blendWeight + 1.0;
+            this._current = 0.0;
+            this._difference = 0.0;
+            this._result = 0.0;
+        };
+        SingleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + 1;
+                    if (valueScale === 1.0) {
+                        this._current = valueArray[valueOffset];
+                        this._difference = valueArray[nextValueOffset] - this._current;
+                    }
+                    else {
+                        this._current = valueArray[valueOffset] * valueScale;
+                        this._difference = valueArray[nextValueOffset] * valueScale - this._current;
+                    }
+                }
+                else {
+                    this._result = valueArray[valueOffset] * valueScale;
+                }
             }
             else {
-                animationPose.x = result.x;
-                animationPose.y = result.y;
-                animationPose.rotation = result.rotation;
-                animationPose.skew = result.skew;
-                animationPose.scaleX = result.scaleX;
-                animationPose.scaleY = result.scaleY;
+                this._result = 0.0;
             }
-            if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                this.bone._transformDirty = true;
+        };
+        SingleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                this._result = this._current + this._difference * this._tweenProgress;
             }
         };
-        return BoneTimelineState;
+        return SingleValueTimelineState;
     }(TweenTimelineState));
-    dragonBones.BoneTimelineState = BoneTimelineState;
+    dragonBones.SingleValueTimelineState = SingleValueTimelineState;
     /**
      * @internal
      */
-    var SlotTimelineState = /** @class */ (function (_super) {
-        __extends(SlotTimelineState, _super);
-        function SlotTimelineState() {
+    var DoubleValueTimelineState = /** @class */ (function (_super) {
+        __extends(DoubleValueTimelineState, _super);
+        function DoubleValueTimelineState() {
             return _super !== null && _super.apply(this, arguments) || this;
         }
-        SlotTimelineState.prototype._onClear = function () {
+        DoubleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.slot = null; //
+            this._currentA = 0.0;
+            this._currentB = 0.0;
+            this._differenceA = 0.0;
+            this._differenceB = 0.0;
+            this._resultA = 0.0;
+            this._resultB = 0.0;
+        };
+        DoubleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * 2;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + 2;
+                    if (valueScale === 1.0) {
+                        this._currentA = valueArray[valueOffset];
+                        this._currentB = valueArray[valueOffset + 1];
+                        this._differenceA = valueArray[nextValueOffset] - this._currentA;
+                        this._differenceB = valueArray[nextValueOffset + 1] - this._currentB;
+                    }
+                    else {
+                        this._currentA = valueArray[valueOffset] * valueScale;
+                        this._currentB = valueArray[valueOffset + 1] * valueScale;
+                        this._differenceA = valueArray[nextValueOffset] * valueScale - this._currentA;
+                        this._differenceB = valueArray[nextValueOffset + 1] * valueScale - this._currentB;
+                    }
+                }
+                else {
+                    this._resultA = valueArray[valueOffset] * valueScale;
+                    this._resultB = valueArray[valueOffset + 1] * valueScale;
+                }
+            }
+            else {
+                this._resultA = 0.0;
+                this._resultB = 0.0;
+            }
+        };
+        DoubleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                this._resultA = this._currentA + this._differenceA * this._tweenProgress;
+                this._resultB = this._currentB + this._differenceB * this._tweenProgress;
+            }
         };
-        return SlotTimelineState;
+        return DoubleValueTimelineState;
     }(TweenTimelineState));
-    dragonBones.SlotTimelineState = SlotTimelineState;
+    dragonBones.DoubleValueTimelineState = DoubleValueTimelineState;
     /**
      * @internal
      */
-    var ConstraintTimelineState = /** @class */ (function (_super) {
-        __extends(ConstraintTimelineState, _super);
-        function ConstraintTimelineState() {
-            return _super !== null && _super.apply(this, arguments) || this;
+    var MutilpleValueTimelineState = /** @class */ (function (_super) {
+        __extends(MutilpleValueTimelineState, _super);
+        function MutilpleValueTimelineState() {
+            var _this = _super !== null && _super.apply(this, arguments) || this;
+            _this._rd = [];
+            return _this;
         }
-        ConstraintTimelineState.prototype._onClear = function () {
+        MutilpleValueTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.constraint = null; //
+            this._valueCount = 0;
+            this._rd.length = 0;
         };
-        return ConstraintTimelineState;
-    }(TweenTimelineState));
-    dragonBones.ConstraintTimelineState = ConstraintTimelineState;
-})(dragonBones || (dragonBones = {}));
-/**
- * The MIT License (MIT)
- *
- * Copyright (c) 2012-2018 DragonBones team and other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- * the Software, and to permit persons to whom the Software is furnished to do so,
+        MutilpleValueTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            var valueCount = this._valueCount;
+            var rd = this._rd;
+            if (this._timelineData !== null) {
+                var valueScale = this._valueScale;
+                var valueArray = this._valueArray;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount;
+                if (this._isTween) {
+                    var nextValueOffset = this._frameIndex === this._frameCount - 1 ?
+                        this._valueOffset + this._frameValueOffset :
+                        valueOffset + valueCount;
+                    if (valueScale === 1.0) {
+                        for (var i = 0; i < valueCount; ++i) {
+                            rd[valueCount + i] = valueArray[nextValueOffset + i] - valueArray[valueOffset + i];
+                        }
+                    }
+                    else {
+                        for (var i = 0; i < valueCount; ++i) {
+                            rd[valueCount + i] = (valueArray[nextValueOffset + i] - valueArray[valueOffset + i]) * valueScale;
+                        }
+                    }
+                }
+                else if (valueScale === 1.0) {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i];
+                    }
+                }
+                else {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] * valueScale;
+                    }
+                }
+            }
+            else {
+                for (var i = 0; i < valueCount; ++i) {
+                    rd[i] = 0.0;
+                }
+            }
+        };
+        MutilpleValueTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            if (this._isTween) {
+                var valueCount = this._valueCount;
+                var valueScale = this._valueScale;
+                var tweenProgress = this._tweenProgress;
+                var valueArray = this._valueArray;
+                var rd = this._rd;
+                //
+                var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount;
+                if (valueScale === 1.0) {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] + rd[valueCount + i] * tweenProgress;
+                    }
+                }
+                else {
+                    for (var i = 0; i < valueCount; ++i) {
+                        rd[i] = valueArray[valueOffset + i] * valueScale + rd[valueCount + i] * tweenProgress;
+                    }
+                }
+            }
+        };
+        return MutilpleValueTimelineState;
+    }(TweenTimelineState));
+    dragonBones.MutilpleValueTimelineState = MutilpleValueTimelineState;
+})(dragonBones || (dragonBones = {}));
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2012-2018 DragonBones team and other contributors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
  * subject to the following conditions:
  *
  * The above copyright notice and this permission notice shall be included in all
@@ -10153,6 +10331,7 @@ var dragonBones;
             var prevPlayTimes = this.currentPlayTimes;
             var prevTime = this.currentTime;
             if (this._setCurrentTime(passedTime)) {
+                var eventActive = this._animationState._parent === null && this._animationState.actionEnabled;
                 var eventDispatcher = this._armature.eventDispatcher;
                 if (prevState < 0) {
                     if (this.playState !== prevState) {
@@ -10160,7 +10339,7 @@ var dragonBones;
                             this._armature._sortZOrder(null, 0);
                         }
                         prevPlayTimes = this.currentPlayTimes;
-                        if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) {
+                        if (eventActive && eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) {
                             var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
                             eventObject.type = dragonBones.EventObject.START;
                             eventObject.armature = this._armature;
@@ -10175,7 +10354,7 @@ var dragonBones;
                 var isReverse = this._animationState.timeScale < 0.0;
                 var loopCompleteEvent = null;
                 var completeEvent = null;
-                if (this.currentPlayTimes !== prevPlayTimes) {
+                if (eventActive && this.currentPlayTimes !== prevPlayTimes) {
                     if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.LOOP_COMPLETE)) {
                         loopCompleteEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject);
                         loopCompleteEvent.type = dragonBones.EventObject.LOOP_COMPLETE;
@@ -10265,7 +10444,8 @@ var dragonBones;
                                     // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem
                                     var framePosition = this._frameArray[frameOffset] / this._frameRate;
                                     if (this._position <= framePosition &&
-                                        framePosition <= this._position + this._duration) {
+                                        framePosition <= this._position + this._duration //
+                                    ) {
                                         this._onCrossFrame(crossedFrameIndex);
                                     }
                                     if (loopCompleteEvent !== null && crossedFrameIndex === 0) {
@@ -10354,78 +10534,57 @@ var dragonBones;
         };
         BoneAllTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 6; // ...(timeline value offset)|xxxxxx|xxxxxx|(Value offset)xxxxx|(Next offset)xxxxx|xxxxxx|xxxxxx|...
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = frameFloatArray[valueOffset++] * scale;
-                current.y = frameFloatArray[valueOffset++] * scale;
-                current.rotation = frameFloatArray[valueOffset++];
-                current.skew = frameFloatArray[valueOffset++];
-                current.scaleX = frameFloatArray[valueOffset++];
-                current.scaleY = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 6
-                    }
-                    delta.x = frameFloatArray[valueOffset++] * scale - current.x;
-                    delta.y = frameFloatArray[valueOffset++] * scale - current.y;
-                    delta.rotation = frameFloatArray[valueOffset++] - current.rotation;
-                    delta.skew = frameFloatArray[valueOffset++] - current.skew;
-                    delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX;
-                    delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY;
-                }
-                else {
-                    delta.x = 0.0;
-                    delta.y = 0.0;
-                    delta.rotation = 0.0;
-                    delta.skew = 0.0;
-                    delta.scaleX = 0.0;
-                    delta.scaleY = 0.0;
-                }
+            if (this._isTween && this._frameIndex === this._frameCount - 1) {
+                this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]);
+                this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]);
             }
-            else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = 0.0;
-                current.y = 0.0;
-                current.rotation = 0.0;
-                current.skew = 0.0;
-                current.scaleX = 1.0;
-                current.scaleY = 1.0;
-                delta.x = 0.0;
-                delta.y = 0.0;
-                delta.rotation = 0.0;
-                delta.skew = 0.0;
-                delta.scaleX = 0.0;
-                delta.scaleY = 0.0;
-            }
-        };
-        BoneAllTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            result.x = current.x + delta.x * this._tweenProgress;
-            result.y = current.y + delta.y * this._tweenProgress;
-            result.rotation = current.rotation + delta.rotation * this._tweenProgress;
-            result.skew = current.skew + delta.skew * this._tweenProgress;
-            result.scaleX = current.scaleX + delta.scaleX * this._tweenProgress;
-            result.scaleY = current.scaleY + delta.scaleY * this._tweenProgress;
+            if (this._timelineData === null) {
+                this._rd[4] = 1.0;
+                this._rd[5] = 1.0;
+            }
+        };
+        BoneAllTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueCount = 6;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
         };
         BoneAllTimelineState.prototype.fadeOut = function () {
-            var result = this.bonePose.result;
-            result.rotation = dragonBones.Transform.normalizeRadian(result.rotation);
-            result.skew = dragonBones.Transform.normalizeRadian(result.skew);
+            this.dirty = false;
+            this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]);
+            this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]);
+        };
+        BoneAllTimelineState.prototype.blend = function (isDirty) {
+            var valueScale = this._armature.armatureData.scale;
+            var rd = this._rd;
+            //
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.x += rd[0] * blendWeight * valueScale;
+                result.y += rd[1] * blendWeight * valueScale;
+                result.rotation += rd[2] * blendWeight;
+                result.skew += rd[3] * blendWeight;
+                result.scaleX += (rd[4] - 1.0) * blendWeight;
+                result.scaleY += (rd[5] - 1.0) * blendWeight;
+            }
+            else {
+                result.x = rd[0] * blendWeight * valueScale;
+                result.y = rd[1] * blendWeight * valueScale;
+                result.rotation = rd[2] * blendWeight;
+                result.skew = rd[3] * blendWeight;
+                result.scaleX = (rd[4] - 1.0) * blendWeight + 1.0; // 
+                result.scaleY = (rd[5] - 1.0) * blendWeight + 1.0; //
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         };
         return BoneAllTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.MutilpleValueTimelineState));
     dragonBones.BoneAllTimelineState = BoneAllTimelineState;
     /**
      * @internal
@@ -10438,51 +10597,36 @@ var dragonBones;
         BoneTranslateTimelineState.toString = function () {
             return "[class dragonBones.BoneTranslateTimelineState]";
         };
-        BoneTranslateTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = frameFloatArray[valueOffset++] * scale;
-                current.y = frameFloatArray[valueOffset++] * scale;
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    delta.x = frameFloatArray[valueOffset++] * scale - current.x;
-                    delta.y = frameFloatArray[valueOffset++] * scale - current.y;
-                }
-                else {
-                    delta.x = 0.0;
-                    delta.y = 0.0;
-                }
+        BoneTranslateTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueScale = this._armature.armatureData.scale;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
+        };
+        BoneTranslateTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.x += this._resultA * blendWeight;
+                result.y += this._resultB * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.x = this._resultA * blendWeight;
+                result.y = this._resultB * blendWeight;
             }
             else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.x = 0.0;
-                current.y = 0.0;
-                delta.x = 0.0;
-                delta.y = 0.0;
+                result.x = this._resultA;
+                result.y = this._resultB;
             }
-        };
-        BoneTranslateTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
             }
-            result.x = (current.x + delta.x * this._tweenProgress);
-            result.y = (current.y + delta.y * this._tweenProgress);
         };
         return BoneTranslateTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneTranslateTimelineState = BoneTranslateTimelineState;
     /**
      * @internal
@@ -10497,56 +10641,45 @@ var dragonBones;
         };
         BoneRotateTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.rotation = frameFloatArray[valueOffset++];
-                current.skew = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                        delta.rotation = dragonBones.Transform.normalizeRadian(frameFloatArray[valueOffset++] - current.rotation);
-                    }
-                    else {
-                        delta.rotation = frameFloatArray[valueOffset++] - current.rotation;
-                    }
-                    delta.skew = frameFloatArray[valueOffset++] - current.skew;
-                }
-                else {
-                    delta.rotation = 0.0;
-                    delta.skew = 0.0;
-                }
-            }
-            else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.rotation = 0.0;
-                current.skew = 0.0;
-                delta.rotation = 0.0;
-                delta.skew = 0.0;
+            if (this._isTween && this._frameIndex === this._frameCount - 1) {
+                this._differenceA = dragonBones.Transform.normalizeRadian(this._differenceA);
+                this._differenceB = dragonBones.Transform.normalizeRadian(this._differenceB);
             }
         };
-        BoneRotateTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            result.rotation = current.rotation + delta.rotation * this._tweenProgress;
-            result.skew = current.skew + delta.skew * this._tweenProgress;
+        BoneRotateTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
         };
         BoneRotateTimelineState.prototype.fadeOut = function () {
-            var result = this.bonePose.result;
-            result.rotation = dragonBones.Transform.normalizeRadian(result.rotation);
-            result.skew = dragonBones.Transform.normalizeRadian(result.skew);
+            this.dirty = false;
+            this._resultA = dragonBones.Transform.normalizeRadian(this._resultA);
+            this._resultB = dragonBones.Transform.normalizeRadian(this._resultB);
+        };
+        BoneRotateTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.rotation += this._resultA * blendWeight;
+                result.skew += this._resultB * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.rotation = this._resultA * blendWeight;
+                result.skew = this._resultB * blendWeight;
+            }
+            else {
+                result.rotation = this._resultA;
+                result.skew = this._resultB;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
+            }
         };
         return BoneRotateTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneRotateTimelineState = BoneRotateTimelineState;
     /**
      * @internal
@@ -10561,48 +10694,40 @@ var dragonBones;
         };
         BoneScaleTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameFloatArray = this._frameFloatArray;
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.scaleX = frameFloatArray[valueOffset++];
-                current.scaleY = frameFloatArray[valueOffset++];
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX;
-                    delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY;
-                }
-                else {
-                    delta.scaleX = 0.0;
-                    delta.scaleY = 0.0;
-                }
+            if (this._timelineData === null) {
+                this._resultA = 1.0;
+                this._resultB = 1.0;
+            }
+        };
+        BoneScaleTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameFloatOffset;
+            this._valueArray = this._animationData.parent.parent.frameFloatArray;
+        };
+        BoneScaleTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var bone = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = bone.animationPose;
+            if (blendState.dirty > 1) {
+                result.scaleX += (this._resultA - 1.0) * blendWeight;
+                result.scaleY += (this._resultB - 1.0) * blendWeight;
+            }
+            else if (blendWeight !== 1.0) {
+                result.scaleX = (this._resultA - 1.0) * blendWeight + 1.0;
+                result.scaleY = (this._resultB - 1.0) * blendWeight + 1.0;
             }
             else {
-                var current = this.bonePose.current;
-                var delta = this.bonePose.delta;
-                current.scaleX = 1.0;
-                current.scaleY = 1.0;
-                delta.scaleX = 0.0;
-                delta.scaleY = 0.0;
+                result.scaleX = this._resultA;
+                result.scaleY = this._resultB;
             }
-        };
-        BoneScaleTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            var current = this.bonePose.current;
-            var delta = this.bonePose.delta;
-            var result = this.bonePose.result;
-            this.bone._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                bone._transformDirty = true;
             }
-            result.scaleX = current.scaleX + delta.scaleX * this._tweenProgress;
-            result.scaleY = current.scaleY + delta.scaleY * this._tweenProgress;
         };
         return BoneScaleTimelineState;
-    }(dragonBones.BoneTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.BoneScaleTimelineState = BoneScaleTimelineState;
     /**
      * @internal
@@ -10610,116 +10735,123 @@ var dragonBones;
     var SurfaceTimelineState = /** @class */ (function (_super) {
         __extends(SurfaceTimelineState, _super);
         function SurfaceTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._current = [];
-            _this._delta = [];
-            _this._result = [];
-            return _this;
+            return _super !== null && _super.apply(this, arguments) || this;
         }
         SurfaceTimelineState.toString = function () {
             return "[class dragonBones.SurfaceTimelineState]";
         };
         SurfaceTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.surface = null;
-            this._frameFloatOffset = 0;
-            this._valueCount = 0;
             this._deformCount = 0;
-            this._valueOffset = 0;
-            this._current.length = 0;
-            this._delta.length = 0;
-            this._result.length = 0;
+            this._deformOffset = 0;
+            this._sameValueOffset = 0;
         };
-        SurfaceTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
+        SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * this._valueCount;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                if (this._tweenState === 2 /* Always */) {
-                    var nextValueOffset = valueOffset + this._valueCount;
-                    if (this._frameIndex === this._frameCount - 1) {
-                        nextValueOffset = this._animationData.frameFloatOffset + this._frameValueOffset;
+                var dragonBonesData = this._animationData.parent.parent;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
+                this._valueOffset = this._animationData.frameFloatOffset;
+                this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
+                this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */];
+                this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
+                this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
+                this._valueScale = this._armature.armatureData.scale;
+                this._valueArray = dragonBonesData.frameFloatArray;
+                this._rd.length = this._valueCount * 2;
+            }
+            else {
+                this._deformCount = this.target.target._deformVertices.length;
+            }
+        };
+        SurfaceTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var surface = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = surface._deformVertices;
+            var valueArray = this._valueArray;
+            if (valueArray !== null) {
+                var valueCount = this._valueCount;
+                var deformOffset = this._deformOffset;
+                var sameValueOffset = this._sameValueOffset;
+                var rd = this._rd;
+                for (var i = 0; i < this._deformCount; ++i) {
+                    var value = 0.0;
+                    if (i < deformOffset) {
+                        value = valueArray[sameValueOffset + i];
+                    }
+                    else if (i < deformOffset + valueCount) {
+                        value = rd[i - deformOffset];
+                    }
+                    else {
+                        value = valueArray[sameValueOffset + i - valueCount];
                     }
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._delta[i] = frameFloatArray[nextValueOffset + i] * scale - (this._current[i] = frameFloatArray[valueOffset + i] * scale);
+                    if (blendState.dirty > 1) {
+                        result[i] += value * blendWeight;
                     }
-                }
-                else {
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._current[i] = frameFloatArray[valueOffset + i] * scale;
+                    else {
+                        result[i] = value * blendWeight;
                     }
                 }
             }
-            else {
-                for (var i = 0; i < this._valueCount; ++i) {
-                    this._current[i] = 0.0;
+            else if (blendState.dirty === 1) {
+                for (var i = 0; i < this._deformCount; ++i) {
+                    result[i] = 0.0;
                 }
             }
-        };
-        SurfaceTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            this.surface._transformDirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                surface._transformDirty = true;
             }
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._result[i] = this._current[i] + this._delta[i] * this._tweenProgress;
+        };
+        return SurfaceTimelineState;
+    }(dragonBones.MutilpleValueTimelineState));
+    dragonBones.SurfaceTimelineState = SurfaceTimelineState;
+    /**
+     * @internal
+     */
+    var AlphaTimelineState = /** @class */ (function (_super) {
+        __extends(AlphaTimelineState, _super);
+        function AlphaTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AlphaTimelineState.toString = function () {
+            return "[class dragonBones.AlphaTimelineState]";
+        };
+        AlphaTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData === null) {
+                this._result = 1.0;
             }
         };
-        SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) {
+        AlphaTimelineState.prototype.init = function (armature, animationState, timelineData) {
             _super.prototype.init.call(this, armature, animationState, timelineData);
-            if (this._timelineData !== null) {
-                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
-                this._deformCount = this._frameIntArray[frameIntOffset + 1 /* DeformCount */];
-                this._valueCount = this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
-                this._valueOffset = this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
-                this._frameFloatOffset = this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
-            }
-            else {
-                this._deformCount = this.surface._deformVertices.length;
-                this._valueCount = this._deformCount;
-                this._valueOffset = 0;
-                this._frameFloatOffset = 0;
-            }
-            this._current.length = this._valueCount;
-            this._delta.length = this._valueCount;
-            this._result.length = this._valueCount;
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._delta[i] = 0.0;
-            }
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.01;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
-        SurfaceTimelineState.prototype.blend = function (state) {
-            var blendWeight = this.surface._blendState.blendWeight;
-            var result = this.surface._deformVertices;
-            for (var i = 0; i < this._deformCount; ++i) {
-                var value = 0.0;
-                if (i < this._valueOffset) {
-                    value = this._frameFloatArray[this._frameFloatOffset + i];
-                }
-                else if (i < this._valueOffset + this._valueCount) {
-                    value = this._result[i - this._valueOffset];
-                }
-                else {
-                    value = this._frameFloatArray[this._frameFloatOffset + i - this._valueCount];
-                }
-                if (state === 2) {
-                    result[i] += value * blendWeight;
-                }
-                else if (blendWeight !== 1.0) {
-                    result[i] = value * blendWeight;
-                }
-                else {
-                    result[i] = value;
+        AlphaTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var alphaTarget = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            if (blendState.dirty > 1) {
+                alphaTarget._alpha += this._result * blendWeight;
+                if (alphaTarget._alpha > 1.0) {
+                    alphaTarget._alpha = 1.0;
                 }
             }
-            if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                this.surface._transformDirty = true;
+            else {
+                alphaTarget._alpha = this._result * blendWeight;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                this._armature._alphaDirty = true;
             }
         };
-        return SurfaceTimelineState;
-    }(dragonBones.TweenTimelineState));
-    dragonBones.SurfaceTimelineState = SurfaceTimelineState;
+        return AlphaTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AlphaTimelineState = AlphaTimelineState;
     /**
      * @internal
      */
@@ -10733,14 +10865,17 @@ var dragonBones;
         };
         SlotDislayTimelineState.prototype._onArriveAtFrame = function () {
             if (this.playState >= 0) {
-                var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : this.slot._slotData.displayIndex;
-                if (this.slot.displayIndex !== displayIndex) {
-                    this.slot._setDisplayIndex(displayIndex, true);
+                var slot = this.target;
+                var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : slot._slotData.displayIndex;
+                if (slot.displayIndex !== displayIndex) {
+                    slot._setDisplayIndex(displayIndex, true);
                 }
             }
         };
+        SlotDislayTimelineState.prototype._onUpdateFrame = function () {
+        };
         return SlotDislayTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.TimelineState));
     dragonBones.SlotDislayTimelineState = SlotDislayTimelineState;
     /**
      * @internal
@@ -10750,91 +10885,97 @@ var dragonBones;
         function SlotColorTimelineState() {
             var _this = _super !== null && _super.apply(this, arguments) || this;
             _this._current = [0, 0, 0, 0, 0, 0, 0, 0];
-            _this._delta = [0, 0, 0, 0, 0, 0, 0, 0];
+            _this._difference = [0, 0, 0, 0, 0, 0, 0, 0];
             _this._result = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
             return _this;
         }
         SlotColorTimelineState.toString = function () {
             return "[class dragonBones.SlotColorTimelineState]";
         };
-        SlotColorTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this._dirty = false;
-        };
         SlotColorTimelineState.prototype._onArriveAtFrame = function () {
             _super.prototype._onArriveAtFrame.call(this);
             if (this._timelineData !== null) {
-                var intArray = this._dragonBonesData.intArray;
-                var frameIntArray = this._frameIntArray;
-                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 1; // ...(timeline value offset)|x|x|(Value offset)|(Next offset)|x|x|...
+                var dragonBonesData = this._animationData.parent.parent;
+                var colorArray = dragonBonesData.colorArray;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex;
                 var colorOffset = frameIntArray[valueOffset];
                 if (colorOffset < 0) {
-                    colorOffset += 65536; // Fixed out of bouds bug. 
-                }
-                this._current[0] = intArray[colorOffset++];
-                this._current[1] = intArray[colorOffset++];
-                this._current[2] = intArray[colorOffset++];
-                this._current[3] = intArray[colorOffset++];
-                this._current[4] = intArray[colorOffset++];
-                this._current[5] = intArray[colorOffset++];
-                this._current[6] = intArray[colorOffset++];
-                this._current[7] = intArray[colorOffset++];
-                if (this._tweenState === 2 /* Always */) {
+                    colorOffset += 65536; // Fixed out of bounds bug. 
+                }
+                if (this._isTween) {
+                    this._current[0] = colorArray[colorOffset++];
+                    this._current[1] = colorArray[colorOffset++];
+                    this._current[2] = colorArray[colorOffset++];
+                    this._current[3] = colorArray[colorOffset++];
+                    this._current[4] = colorArray[colorOffset++];
+                    this._current[5] = colorArray[colorOffset++];
+                    this._current[6] = colorArray[colorOffset++];
+                    this._current[7] = colorArray[colorOffset++];
                     if (this._frameIndex === this._frameCount - 1) {
                         colorOffset = frameIntArray[this._animationData.frameIntOffset + this._frameValueOffset];
                     }
                     else {
-                        colorOffset = frameIntArray[valueOffset + 1 * 1];
+                        colorOffset = frameIntArray[valueOffset + 1];
                     }
                     if (colorOffset < 0) {
-                        colorOffset += 65536; // Fixed out of bouds bug. 
+                        colorOffset += 65536; // Fixed out of bounds bug. 
                     }
-                    this._delta[0] = intArray[colorOffset++] - this._current[0];
-                    this._delta[1] = intArray[colorOffset++] - this._current[1];
-                    this._delta[2] = intArray[colorOffset++] - this._current[2];
-                    this._delta[3] = intArray[colorOffset++] - this._current[3];
-                    this._delta[4] = intArray[colorOffset++] - this._current[4];
-                    this._delta[5] = intArray[colorOffset++] - this._current[5];
-                    this._delta[6] = intArray[colorOffset++] - this._current[6];
-                    this._delta[7] = intArray[colorOffset++] - this._current[7];
+                    this._difference[0] = colorArray[colorOffset++] - this._current[0];
+                    this._difference[1] = colorArray[colorOffset++] - this._current[1];
+                    this._difference[2] = colorArray[colorOffset++] - this._current[2];
+                    this._difference[3] = colorArray[colorOffset++] - this._current[3];
+                    this._difference[4] = colorArray[colorOffset++] - this._current[4];
+                    this._difference[5] = colorArray[colorOffset++] - this._current[5];
+                    this._difference[6] = colorArray[colorOffset++] - this._current[6];
+                    this._difference[7] = colorArray[colorOffset++] - this._current[7];
+                }
+                else {
+                    this._result[0] = colorArray[colorOffset++] * 0.01;
+                    this._result[1] = colorArray[colorOffset++] * 0.01;
+                    this._result[2] = colorArray[colorOffset++] * 0.01;
+                    this._result[3] = colorArray[colorOffset++] * 0.01;
+                    this._result[4] = colorArray[colorOffset++];
+                    this._result[5] = colorArray[colorOffset++];
+                    this._result[6] = colorArray[colorOffset++];
+                    this._result[7] = colorArray[colorOffset++];
                 }
             }
             else {
-                var color = this.slot._slotData.color;
-                this._current[0] = color.alphaMultiplier * 100.0;
-                this._current[1] = color.redMultiplier * 100.0;
-                this._current[2] = color.greenMultiplier * 100.0;
-                this._current[3] = color.blueMultiplier * 100.0;
-                this._current[4] = color.alphaOffset;
-                this._current[5] = color.redOffset;
-                this._current[6] = color.greenOffset;
-                this._current[7] = color.blueOffset;
+                var slot = this.target;
+                var color = slot.slotData.color;
+                this._result[0] = color.alphaMultiplier;
+                this._result[1] = color.redMultiplier;
+                this._result[2] = color.greenMultiplier;
+                this._result[3] = color.blueMultiplier;
+                this._result[4] = color.alphaOffset;
+                this._result[5] = color.redOffset;
+                this._result[6] = color.greenOffset;
+                this._result[7] = color.blueOffset;
             }
         };
         SlotColorTimelineState.prototype._onUpdateFrame = function () {
             _super.prototype._onUpdateFrame.call(this);
-            this._dirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            this._result[0] = (this._current[0] + this._delta[0] * this._tweenProgress) * 0.01;
-            this._result[1] = (this._current[1] + this._delta[1] * this._tweenProgress) * 0.01;
-            this._result[2] = (this._current[2] + this._delta[2] * this._tweenProgress) * 0.01;
-            this._result[3] = (this._current[3] + this._delta[3] * this._tweenProgress) * 0.01;
-            this._result[4] = this._current[4] + this._delta[4] * this._tweenProgress;
-            this._result[5] = this._current[5] + this._delta[5] * this._tweenProgress;
-            this._result[6] = this._current[6] + this._delta[6] * this._tweenProgress;
-            this._result[7] = this._current[7] + this._delta[7] * this._tweenProgress;
+            if (this._isTween) {
+                this._result[0] = (this._current[0] + this._difference[0] * this._tweenProgress) * 0.01;
+                this._result[1] = (this._current[1] + this._difference[1] * this._tweenProgress) * 0.01;
+                this._result[2] = (this._current[2] + this._difference[2] * this._tweenProgress) * 0.01;
+                this._result[3] = (this._current[3] + this._difference[3] * this._tweenProgress) * 0.01;
+                this._result[4] = this._current[4] + this._difference[4] * this._tweenProgress;
+                this._result[5] = this._current[5] + this._difference[5] * this._tweenProgress;
+                this._result[6] = this._current[6] + this._difference[6] * this._tweenProgress;
+                this._result[7] = this._current[7] + this._difference[7] * this._tweenProgress;
+            }
         };
         SlotColorTimelineState.prototype.fadeOut = function () {
-            this._tweenState = 0 /* None */;
-            this._dirty = false;
+            this._isTween = false;
         };
         SlotColorTimelineState.prototype.update = function (passedTime) {
             _super.prototype.update.call(this, passedTime);
             // Fade animation.
-            if (this._tweenState !== 0 /* None */ || this._dirty) {
-                var result = this.slot._colorTransform;
+            if (this._isTween || this.dirty) {
+                var slot = this.target;
+                var result = slot._colorTransform;
                 if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
                     if (result.alphaMultiplier !== this._result[0] ||
                         result.redMultiplier !== this._result[1] ||
@@ -10853,11 +10994,11 @@ var dragonBones;
                         result.redOffset += (this._result[5] - result.redOffset) * fadeProgress;
                         result.greenOffset += (this._result[6] - result.greenOffset) * fadeProgress;
                         result.blueOffset += (this._result[7] - result.blueOffset) * fadeProgress;
-                        this.slot._colorDirty = true;
+                        slot._colorDirty = true;
                     }
                 }
-                else if (this._dirty) {
-                    this._dirty = false;
+                else if (this.dirty) {
+                    this.dirty = false;
                     if (result.alphaMultiplier !== this._result[0] ||
                         result.redMultiplier !== this._result[1] ||
                         result.greenMultiplier !== this._result[2] ||
@@ -10874,152 +11015,159 @@ var dragonBones;
                         result.redOffset = this._result[5];
                         result.greenOffset = this._result[6];
                         result.blueOffset = this._result[7];
-                        this.slot._colorDirty = true;
+                        slot._colorDirty = true;
                     }
                 }
             }
         };
         return SlotColorTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.TweenTimelineState));
     dragonBones.SlotColorTimelineState = SlotColorTimelineState;
+    /**
+     * @internal
+     */
+    var SlotZIndexTimelineState = /** @class */ (function (_super) {
+        __extends(SlotZIndexTimelineState, _super);
+        function SlotZIndexTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        SlotZIndexTimelineState.toString = function () {
+            return "[class dragonBones.SlotZIndexTimelineState]";
+        };
+        SlotZIndexTimelineState.prototype._onArriveAtFrame = function () {
+            _super.prototype._onArriveAtFrame.call(this);
+            if (this._timelineData === null) {
+                var blendState = this.target;
+                var slot = blendState.target;
+                this._result = slot.slotData.zIndex;
+            }
+        };
+        SlotZIndexTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        SlotZIndexTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var slot = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            if (blendState.dirty > 1) {
+                slot._zIndex += this._result * blendWeight;
+            }
+            else {
+                slot._zIndex = this._result * blendWeight;
+            }
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                this._armature._zIndexDirty = true;
+            }
+        };
+        return SlotZIndexTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.SlotZIndexTimelineState = SlotZIndexTimelineState;
     /**
      * @internal
      */
     var DeformTimelineState = /** @class */ (function (_super) {
         __extends(DeformTimelineState, _super);
         function DeformTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._current = [];
-            _this._delta = [];
-            _this._result = [];
-            return _this;
+            return _super !== null && _super.apply(this, arguments) || this;
         }
         DeformTimelineState.toString = function () {
             return "[class dragonBones.DeformTimelineState]";
         };
         DeformTimelineState.prototype._onClear = function () {
             _super.prototype._onClear.call(this);
-            this.vertexOffset = 0;
-            this._dirty = false;
-            this._frameFloatOffset = 0;
-            this._valueCount = 0;
+            this.geometryOffset = 0;
+            this.displayFrame = null;
             this._deformCount = 0;
-            this._valueOffset = 0;
-            this._current.length = 0;
-            this._delta.length = 0;
-            this._result.length = 0;
+            this._deformOffset = 0;
+            this._sameValueOffset = 0;
         };
-        DeformTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
+        DeformTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameFloatOffset + this._frameValueOffset + this._frameIndex * this._valueCount;
-                var scale = this._armature._armatureData.scale;
-                var frameFloatArray = this._frameFloatArray;
-                if (this._tweenState === 2 /* Always */) {
-                    var nextValueOffset = valueOffset + this._valueCount;
-                    if (this._frameIndex === this._frameCount - 1) {
-                        nextValueOffset = this._animationData.frameFloatOffset + this._frameValueOffset;
+                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
+                var dragonBonesData = this._animationData.parent.parent;
+                var frameIntArray = dragonBonesData.frameIntArray;
+                var slot = this.target.target;
+                this.geometryOffset = frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */];
+                if (this.geometryOffset < 0) {
+                    this.geometryOffset += 65536; // Fixed out of bounds bug. 
+                }
+                for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                    var displayFrame = slot.getDisplayFrameAt(i);
+                    var geometryData = displayFrame.getGeometryData();
+                    if (geometryData === null) {
+                        continue;
                     }
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._delta[i] = frameFloatArray[nextValueOffset + i] * scale - (this._current[i] = frameFloatArray[valueOffset + i] * scale);
+                    if (geometryData.offset === this.geometryOffset) {
+                        this.displayFrame = displayFrame;
+                        this.displayFrame.updateDeformVertices();
+                        break;
                     }
                 }
-                else {
-                    for (var i = 0; i < this._valueCount; ++i) {
-                        this._current[i] = frameFloatArray[valueOffset + i] * scale;
-                    }
+                if (this.displayFrame === null) {
+                    this.returnToPool(); //
+                    return;
                 }
+                this._valueOffset = this._animationData.frameFloatOffset;
+                this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
+                this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */];
+                this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
+                this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
+                this._valueScale = this._armature.armatureData.scale;
+                this._valueArray = dragonBonesData.frameFloatArray;
+                this._rd.length = this._valueCount * 2;
             }
             else {
-                for (var i = 0; i < this._valueCount; ++i) {
-                    this._current[i] = 0.0;
+                this._deformCount = this.displayFrame.deformVertices.length;
+            }
+        };
+        DeformTimelineState.prototype.blend = function (isDirty) {
+            var blendState = this.target;
+            var slot = blendState.target;
+            var blendWeight = blendState.blendWeight;
+            var result = this.displayFrame.deformVertices;
+            var valueArray = this._valueArray;
+            if (valueArray !== null) {
+                var valueCount = this._valueCount;
+                var deformOffset = this._deformOffset;
+                var sameValueOffset = this._sameValueOffset;
+                var rd = this._rd;
+                for (var i = 0; i < this._deformCount; ++i) {
+                    var value = 0.0;
+                    if (i < deformOffset) {
+                        value = valueArray[sameValueOffset + i];
+                    }
+                    else if (i < deformOffset + valueCount) {
+                        value = rd[i - deformOffset];
+                    }
+                    else {
+                        value = valueArray[sameValueOffset + i - valueCount];
+                    }
+                    if (blendState.dirty > 1) {
+                        result[i] += value * blendWeight;
+                    }
+                    else {
+                        result[i] = value * blendWeight;
+                    }
                 }
             }
-        };
-        DeformTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            this._dirty = true;
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._result[i] = this._current[i] + this._delta[i] * this._tweenProgress;
-            }
-        };
-        DeformTimelineState.prototype.init = function (armature, animationState, timelineData) {
-            _super.prototype.init.call(this, armature, animationState, timelineData);
-            if (this._timelineData !== null) {
-                var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */];
-                this.vertexOffset = this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */];
-                if (this.vertexOffset < 0) {
-                    this.vertexOffset += 65536; // Fixed out of bouds bug. 
+            else if (blendState.dirty === 1) {
+                for (var i = 0; i < this._deformCount; ++i) {
+                    result[i] = 0.0;
                 }
-                this._deformCount = this._frameIntArray[frameIntOffset + 1 /* DeformCount */];
-                this._valueCount = this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */];
-                this._valueOffset = this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */];
-                this._frameFloatOffset = this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset;
             }
-            else {
-                var deformVertices = this.slot._deformVertices;
-                this._deformCount = deformVertices !== null ? deformVertices.vertices.length : 0;
-                this._valueCount = this._deformCount;
-                this._valueOffset = 0;
-                this._frameFloatOffset = 0;
-            }
-            this._current.length = this._valueCount;
-            this._delta.length = this._valueCount;
-            this._result.length = this._valueCount;
-            for (var i = 0; i < this._valueCount; ++i) {
-                this._delta[i] = 0.0;
-            }
-        };
-        DeformTimelineState.prototype.fadeOut = function () {
-            this._tweenState = 0 /* None */;
-            this._dirty = false;
-        };
-        DeformTimelineState.prototype.update = function (passedTime) {
-            var deformVertices = this.slot._deformVertices;
-            if (deformVertices === null || deformVertices.verticesData === null || deformVertices.verticesData.offset !== this.vertexOffset) {
-                return;
-            }
-            _super.prototype.update.call(this, passedTime);
-            // Fade animation.
-            if (this._tweenState !== 0 /* None */ || this._dirty) {
-                var result = deformVertices.vertices;
-                if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) {
-                    var fadeProgress = Math.pow(this._animationState._fadeProgress, 2);
-                    for (var i = 0; i < this._deformCount; ++i) {
-                        if (i < this._valueOffset) {
-                            result[i] += (this._frameFloatArray[this._frameFloatOffset + i] - result[i]) * fadeProgress;
-                        }
-                        else if (i < this._valueOffset + this._valueCount) {
-                            result[i] += (this._result[i - this._valueOffset] - result[i]) * fadeProgress;
-                        }
-                        else {
-                            result[i] += (this._frameFloatArray[this._frameFloatOffset + i - this._valueCount] - result[i]) * fadeProgress;
-                        }
-                    }
-                    deformVertices.verticesDirty = true;
-                }
-                else if (this._dirty) {
-                    this._dirty = false;
-                    for (var i = 0; i < this._deformCount; ++i) {
-                        if (i < this._valueOffset) {
-                            result[i] = this._frameFloatArray[this._frameFloatOffset + i];
-                        }
-                        else if (i < this._valueOffset + this._valueCount) {
-                            result[i] = this._result[i - this._valueOffset];
-                        }
-                        else {
-                            result[i] = this._frameFloatArray[this._frameFloatOffset + i - this._valueCount];
-                        }
-                    }
-                    deformVertices.verticesDirty = true;
+            if (isDirty || this.dirty) {
+                this.dirty = false;
+                if (slot._geometryData === this.displayFrame.getGeometryData()) {
+                    slot._verticesDirty = true;
                 }
             }
         };
         return DeformTimelineState;
-    }(dragonBones.SlotTimelineState));
+    }(dragonBones.MutilpleValueTimelineState));
     dragonBones.DeformTimelineState = DeformTimelineState;
     /**
      * @internal
@@ -11032,115 +11180,115 @@ var dragonBones;
         IKConstraintTimelineState.toString = function () {
             return "[class dragonBones.IKConstraintTimelineState]";
         };
-        IKConstraintTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this._current = 0.0;
-            this._delta = 0.0;
-        };
-        IKConstraintTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            var ikConstraint = this.constraint;
+        IKConstraintTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var ikConstraint = this.target;
             if (this._timelineData !== null) {
-                var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 2;
-                var frameIntArray = this._frameIntArray;
-                var bendPositive = frameIntArray[valueOffset++] !== 0;
-                this._current = frameIntArray[valueOffset++] * 0.01;
-                if (this._tweenState === 2 /* Always */) {
-                    if (this._frameIndex === this._frameCount - 1) {
-                        valueOffset = this._animationData.frameIntOffset + this._frameValueOffset; // + 0 * 2
-                    }
-                    this._delta = frameIntArray[valueOffset + 1] * 0.01 - this._current;
-                }
-                else {
-                    this._delta = 0.0;
-                }
-                ikConstraint._bendPositive = bendPositive;
+                ikConstraint._bendPositive = this._currentA > 0.0;
+                ikConstraint._weight = this._currentB;
             }
             else {
                 var ikConstraintData = ikConstraint._constraintData;
-                this._current = ikConstraintData.weight;
-                this._delta = 0.0;
                 ikConstraint._bendPositive = ikConstraintData.bendPositive;
+                ikConstraint._weight = ikConstraintData.weight;
             }
             ikConstraint.invalidUpdate();
+            this.dirty = false;
         };
-        IKConstraintTimelineState.prototype._onUpdateFrame = function () {
-            _super.prototype._onUpdateFrame.call(this);
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
-            }
-            var ikConstraint = this.constraint;
-            ikConstraint._weight = this._current + this._delta * this._tweenProgress;
-            ikConstraint.invalidUpdate();
-            // TODO fade update.
+        IKConstraintTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.01;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
         return IKConstraintTimelineState;
-    }(dragonBones.ConstraintTimelineState));
+    }(dragonBones.DoubleValueTimelineState));
     dragonBones.IKConstraintTimelineState = IKConstraintTimelineState;
     /**
      * @internal
      */
-    var AnimationTimelineState = /** @class */ (function (_super) {
-        __extends(AnimationTimelineState, _super);
-        function AnimationTimelineState() {
-            var _this = _super !== null && _super.apply(this, arguments) || this;
-            _this._floats = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
-            return _this;
+    var AnimationProgressTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationProgressTimelineState, _super);
+        function AnimationProgressTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
         }
-        AnimationTimelineState.toString = function () {
-            return "[class dragonBones.AnimationTimelineState]";
-        };
-        AnimationTimelineState.prototype._onClear = function () {
-            _super.prototype._onClear.call(this);
-            this.animationState = null;
+        AnimationProgressTimelineState.toString = function () {
+            return "[class dragonBones.AnimationProgressTimelineState]";
         };
-        AnimationTimelineState.prototype._onArriveAtFrame = function () {
-            _super.prototype._onArriveAtFrame.call(this);
-            if (this._timelineData === null) {
-                return;
-            }
-            var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex * 2;
-            var frameRateR = 1.0 / this.animationState._animationData.parent.frameRate;
-            var frameIntArray = this._frameIntArray;
-            this._floats[0] = frameIntArray[valueOffset++] * frameRateR;
-            this._floats[3] = frameIntArray[valueOffset++] * 0.01;
-            if (this._tweenState === 2 /* Always */) {
-                if (this._frameIndex === this._frameCount - 1) {
-                    valueOffset = this._animationData.frameIntOffset + this._frameValueOffset; // + 0 * 2
-                }
-                this._floats[1] = frameIntArray[valueOffset++] * frameRateR - this._floats[0];
-                this._floats[4] = frameIntArray[valueOffset++] * 0.01 - this._floats[3];
-            }
-            else {
-                this._floats[1] = 0.0;
-                this._floats[4] = 0.0;
+        AnimationProgressTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.currentTime = this._result * animationState.totalTime;
             }
+            this.dirty = false;
+        };
+        AnimationProgressTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
         };
-        AnimationTimelineState.prototype._onUpdateFrame = function () {
+        return AnimationProgressTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AnimationProgressTimelineState = AnimationProgressTimelineState;
+    /**
+     * @internal
+     */
+    var AnimationWeightTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationWeightTimelineState, _super);
+        function AnimationWeightTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationWeightTimelineState.toString = function () {
+            return "[class dragonBones.AnimationWeightTimelineState]";
+        };
+        AnimationWeightTimelineState.prototype._onUpdateFrame = function () {
             _super.prototype._onUpdateFrame.call(this);
-            if (this._tweenState !== 2 /* Always */) {
-                this._tweenState = 0 /* None */;
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.weight = this._result;
             }
-            if (this._floats[0] >= 0.0) {
-                this._floats[2] = this._floats[0] + this._floats[1] * this._tweenProgress;
-            }
-            this._floats[5] = this._floats[3] + this._floats[4] * this._tweenProgress;
+            this.dirty = false;
         };
-        AnimationTimelineState.prototype.blend = function (state) {
-            var animationState = this.animationState;
-            var blendWeight = animationState._blendState.blendWeight;
-            if (state === 2) {
-                animationState.weight += this._floats[5] * blendWeight;
-                animationState.currentTime += this._floats[2] * blendWeight;
-            }
-            else {
-                animationState.weight = this._floats[5] * blendWeight;
-                animationState.currentTime = this._floats[2] * blendWeight;
+        AnimationWeightTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        return AnimationWeightTimelineState;
+    }(dragonBones.SingleValueTimelineState));
+    dragonBones.AnimationWeightTimelineState = AnimationWeightTimelineState;
+    /**
+     * @internal
+     */
+    var AnimationParametersTimelineState = /** @class */ (function (_super) {
+        __extends(AnimationParametersTimelineState, _super);
+        function AnimationParametersTimelineState() {
+            return _super !== null && _super.apply(this, arguments) || this;
+        }
+        AnimationParametersTimelineState.toString = function () {
+            return "[class dragonBones.AnimationParametersTimelineState]";
+        };
+        AnimationParametersTimelineState.prototype._onUpdateFrame = function () {
+            _super.prototype._onUpdateFrame.call(this);
+            var animationState = this.target;
+            if (animationState._parent !== null) {
+                animationState.parameterX = this._resultA;
+                animationState.parameterY = this._resultB;
             }
+            this.dirty = false;
         };
-        return AnimationTimelineState;
-    }(dragonBones.TweenTimelineState));
-    dragonBones.AnimationTimelineState = AnimationTimelineState;
+        AnimationParametersTimelineState.prototype.init = function (armature, animationState, timelineData) {
+            _super.prototype.init.call(this, armature, animationState, timelineData);
+            this._valueOffset = this._animationData.frameIntOffset;
+            this._valueScale = 0.0001;
+            this._valueArray = this._animationData.parent.parent.frameIntArray;
+        };
+        return AnimationParametersTimelineState;
+    }(dragonBones.DoubleValueTimelineState));
+    dragonBones.AnimationParametersTimelineState = AnimationParametersTimelineState;
 })(dragonBones || (dragonBones = {}));
 /**
  * The MIT License (MIT)
@@ -11346,7 +11494,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var DataParser = /** @class */ (function () {
         function DataParser() {
@@ -11373,6 +11521,40 @@ var dragonBones;
                     return 0 /* Bone */;
             }
         };
+        DataParser._getPositionMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "percent":
+                    return 1 /* Percent */;
+                case "fixed":
+                    return 0 /* Fixed */;
+                default:
+                    return 1 /* Percent */;
+            }
+        };
+        DataParser._getSpacingMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "length":
+                    return 0 /* Length */;
+                case "percent":
+                    return 2 /* Percent */;
+                case "fixed":
+                    return 1 /* Fixed */;
+                default:
+                    return 0 /* Length */;
+            }
+        };
+        DataParser._getRotateMode = function (value) {
+            switch (value.toLocaleLowerCase()) {
+                case "tangent":
+                    return 0 /* Tangent */;
+                case "chain":
+                    return 1 /* Chain */;
+                case "chainscale":
+                    return 2 /* ChainScale */;
+                default:
+                    return 0 /* Tangent */;
+            }
+        };
         DataParser._getDisplayType = function (value) {
             switch (value.toLowerCase()) {
                 case "image":
@@ -11401,18 +11583,6 @@ var dragonBones;
                     return 0 /* Rectangle */;
             }
         };
-        DataParser._getActionType = function (value) {
-            switch (value.toLowerCase()) {
-                case "play":
-                    return 0 /* Play */;
-                case "frame":
-                    return 10 /* Frame */;
-                case "sound":
-                    return 11 /* Sound */;
-                default:
-                    return 0 /* Play */;
-            }
-        };
         DataParser._getBlendMode = function (value) {
             switch (value.toLowerCase()) {
                 case "normal":
@@ -11447,93 +11617,27 @@ var dragonBones;
                     return 0 /* Normal */;
             }
         };
-        DataParser._getPositionMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "percent":
-                    return 1 /* Percent */;
-                case "fixed":
-                    return 0 /* Fixed */;
-                default:
-                    return 1 /* Percent */;
-            }
-        };
-        DataParser._getSpacingMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "length":
-                    return 0 /* Length */;
-                case "percent":
-                    return 2 /* Percent */;
-                case "fixed":
-                    return 1 /* Fixed */;
+        DataParser._getAnimationBlendType = function (value) {
+            switch (value.toLowerCase()) {
+                case "none":
+                    return 0 /* None */;
+                case "1d":
+                    return 1 /* E1D */;
                 default:
-                    return 0 /* Length */;
+                    return 0 /* None */;
             }
         };
-        DataParser._getRotateMode = function (value) {
-            switch (value.toLocaleLowerCase()) {
-                case "tangent":
-                    return 0 /* Tangent */;
-                case "chain":
-                    return 1 /* Chain */;
-                case "chainscale":
-                    return 2 /* ChainScale */;
+        DataParser._getActionType = function (value) {
+            switch (value.toLowerCase()) {
+                case "play":
+                    return 0 /* Play */;
+                case "frame":
+                    return 10 /* Frame */;
+                case "sound":
+                    return 11 /* Sound */;
                 default:
-                    return 0 /* Tangent */;
-            }
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DataParser.parseDragonBonesData = function (rawData) {
-            console.warn("Deprecated.");
-            if (rawData instanceof ArrayBuffer) {
-                return dragonBones.BinaryDataParser.getInstance().parseDragonBonesData(rawData);
-            }
-            else {
-                return dragonBones.ObjectDataParser.getInstance().parseDragonBonesData(rawData);
-            }
-        };
-        /**
-         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。
-         * @deprecated
-         * @language zh_CN
-         */
-        DataParser.parseTextureAtlasData = function (rawData, scale) {
-            if (scale === void 0) { scale = 1; }
-            console.warn("已废弃");
-            var textureAtlasData = {};
-            var subTextureList = rawData[DataParser.SUB_TEXTURE];
-            for (var i = 0, len = subTextureList.length; i < len; i++) {
-                var subTextureObject = subTextureList[i];
-                var subTextureName = subTextureObject[DataParser.NAME];
-                var subTextureRegion = new dragonBones.Rectangle();
-                var subTextureFrame = null;
-                subTextureRegion.x = subTextureObject[DataParser.X] / scale;
-                subTextureRegion.y = subTextureObject[DataParser.Y] / scale;
-                subTextureRegion.width = subTextureObject[DataParser.WIDTH] / scale;
-                subTextureRegion.height = subTextureObject[DataParser.HEIGHT] / scale;
-                if (DataParser.FRAME_WIDTH in subTextureObject) {
-                    subTextureFrame = new dragonBones.Rectangle();
-                    subTextureFrame.x = subTextureObject[DataParser.FRAME_X] / scale;
-                    subTextureFrame.y = subTextureObject[DataParser.FRAME_Y] / scale;
-                    subTextureFrame.width = subTextureObject[DataParser.FRAME_WIDTH] / scale;
-                    subTextureFrame.height = subTextureObject[DataParser.FRAME_HEIGHT] / scale;
-                }
-                textureAtlasData[subTextureName] = { region: subTextureRegion, frame: subTextureFrame, rotated: false };
+                    return 0 /* Play */;
             }
-            return textureAtlasData;
         };
         DataParser.DATA_VERSION_2_3 = "2.3";
         DataParser.DATA_VERSION_3_0 = "3.0";
@@ -11541,12 +11645,14 @@ var dragonBones;
         DataParser.DATA_VERSION_4_5 = "4.5";
         DataParser.DATA_VERSION_5_0 = "5.0";
         DataParser.DATA_VERSION_5_5 = "5.5";
-        DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_5;
+        DataParser.DATA_VERSION_5_6 = "5.6";
+        DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_6;
         DataParser.DATA_VERSIONS = [
             DataParser.DATA_VERSION_4_0,
             DataParser.DATA_VERSION_4_5,
             DataParser.DATA_VERSION_5_0,
-            DataParser.DATA_VERSION_5_5
+            DataParser.DATA_VERSION_5_5,
+            DataParser.DATA_VERSION_5_6
         ];
         DataParser.TEXTURE_ATLAS = "textureAtlas";
         DataParser.SUB_TEXTURE = "SubTexture";
@@ -11562,18 +11668,19 @@ var dragonBones;
         DataParser.DRADON_BONES = "dragonBones";
         DataParser.USER_DATA = "userData";
         DataParser.ARMATURE = "armature";
+        DataParser.CANVAS = "canvas";
         DataParser.BONE = "bone";
         DataParser.SURFACE = "surface";
         DataParser.SLOT = "slot";
         DataParser.CONSTRAINT = "constraint";
+        DataParser.SKIN = "skin";
+        DataParser.DISPLAY = "display";
+        DataParser.FRAME = "frame";
         DataParser.IK = "ik";
         DataParser.PATH_CONSTRAINT = "path";
-        DataParser.SKIN = "skin";
-        DataParser.DISPLAY = "display";
         DataParser.ANIMATION = "animation";
-        DataParser.Z_ORDER = "zOrder";
+        DataParser.TIMELINE = "timeline";
         DataParser.FFD = "ffd";
-        DataParser.FRAME = "frame";
         DataParser.TRANSLATE_FRAME = "translateFrame";
         DataParser.ROTATE_FRAME = "rotateFrame";
         DataParser.SCALE_FRAME = "scaleFrame";
@@ -11585,7 +11692,6 @@ var dragonBones;
         DataParser.INTS = "ints";
         DataParser.FLOATS = "floats";
         DataParser.STRINGS = "strings";
-        DataParser.CANVAS = "canvas";
         DataParser.TRANSFORM = "transform";
         DataParser.PIVOT = "pivot";
         DataParser.AABB = "aabb";
@@ -11603,6 +11709,8 @@ var dragonBones;
         DataParser.PATH = "path";
         DataParser.LENGTH = "length";
         DataParser.DISPLAY_INDEX = "displayIndex";
+        DataParser.Z_ORDER = "zOrder";
+        DataParser.Z_INDEX = "zIndex";
         DataParser.BLEND_MODE = "blendMode";
         DataParser.INHERIT_TRANSLATION = "inheritTranslation";
         DataParser.INHERIT_ROTATION = "inheritRotation";
@@ -11615,6 +11723,7 @@ var dragonBones;
         DataParser.BEND_POSITIVE = "bendPositive";
         DataParser.CHAIN = "chain";
         DataParser.WEIGHT = "weight";
+        DataParser.BLEND_TYPE = "blendType";
         DataParser.FADE_IN_TIME = "fadeInTime";
         DataParser.PLAY_TIMES = "playTimes";
         DataParser.SCALE = "scale";
@@ -11638,6 +11747,7 @@ var dragonBones;
         DataParser.VALUE = "value";
         DataParser.ROTATE = "rotate";
         DataParser.SKEW = "skew";
+        DataParser.ALPHA = "alpha";
         DataParser.ALPHA_OFFSET = "aO";
         DataParser.RED_OFFSET = "rO";
         DataParser.GREEN_OFFSET = "gO";
@@ -11652,8 +11762,6 @@ var dragonBones;
         DataParser.WEIGHTS = "weights";
         DataParser.SLOT_POSE = "slotPose";
         DataParser.BONE_POSE = "bonePose";
-        DataParser.GLUE_WEIGHTS = "glueWeights";
-        DataParser.GLUE_MESHES = "glueMeshes";
         DataParser.BONES = "bones";
         DataParser.POSITION_MODE = "positionMode";
         DataParser.SPACING_MODE = "spacingMode";
@@ -11698,7 +11806,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var ObjectDataParser = /** @class */ (function (_super) {
         __extends(ObjectDataParser, _super);
@@ -11709,16 +11817,19 @@ var dragonBones;
             _this._data = null; //
             _this._armature = null; //
             _this._bone = null; //
-            _this._surface = null; //
+            _this._geometry = null; //
             _this._slot = null; //
             _this._skin = null; //
             _this._mesh = null; //
             _this._animation = null; //
             _this._timeline = null; //
             _this._rawTextureAtlases = null;
+            _this._frameValueType = 0 /* Step */;
             _this._defaultColorOffset = -1;
             _this._prevClockwise = 0;
             _this._prevRotation = 0.0;
+            _this._frameDefaultValue = 0.0;
+            _this._frameValueScale = 1.0;
             _this._helpMatrixA = new dragonBones.Matrix();
             _this._helpMatrixB = new dragonBones.Matrix();
             _this._helpTransform = new dragonBones.Transform();
@@ -11731,6 +11842,7 @@ var dragonBones;
             _this._frameFloatArray = [];
             _this._frameArray = [];
             _this._timelineArray = [];
+            _this._colorArray = [];
             _this._cacheRawMeshes = [];
             _this._cacheMeshes = [];
             _this._actionFrames = [];
@@ -11781,13 +11893,6 @@ var dragonBones;
                 var value = rawData[key];
                 var type = typeof value;
                 if (type === "string") {
-                    if (dragonBones.DragonBones.webAssembly) {
-                        for (var i = 0, l = value.length; i < l; ++i) {
-                            if (value.charCodeAt(i) > 255) {
-                                return encodeURI(value);
-                            }
-                        }
-                    }
                     return value;
                 }
                 return String(value);
@@ -11807,34 +11912,68 @@ var dragonBones;
         };
         ObjectDataParser.prototype._samplingEasingCurve = function (curve, samples) {
             var curveCount = curve.length;
-            var stepIndex = -2;
-            for (var i = 0, l = samples.length; i < l; ++i) {
-                var t = (i + 1) / (l + 1); // float
-                while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) {
-                    stepIndex += 6;
-                }
-                var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount;
-                var x1 = isInCurve ? curve[stepIndex] : 0.0;
-                var y1 = isInCurve ? curve[stepIndex + 1] : 0.0;
-                var x2 = curve[stepIndex + 2];
-                var y2 = curve[stepIndex + 3];
-                var x3 = curve[stepIndex + 4];
-                var y3 = curve[stepIndex + 5];
-                var x4 = isInCurve ? curve[stepIndex + 6] : 1.0;
-                var y4 = isInCurve ? curve[stepIndex + 7] : 1.0;
-                var lower = 0.0;
-                var higher = 1.0;
-                while (higher - lower > 0.0001) {
-                    var percentage = (higher + lower) * 0.5;
-                    this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
-                    if (t - this._helpPoint.x > 0.0) {
-                        lower = percentage;
+            if (curveCount % 3 === 1) {
+                var stepIndex = -2;
+                for (var i = 0, l = samples.length; i < l; ++i) {
+                    var t = (i + 1) / (l + 1); // float
+                    while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) {
+                        stepIndex += 6;
+                    }
+                    var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount;
+                    var x1 = isInCurve ? curve[stepIndex] : 0.0;
+                    var y1 = isInCurve ? curve[stepIndex + 1] : 0.0;
+                    var x2 = curve[stepIndex + 2];
+                    var y2 = curve[stepIndex + 3];
+                    var x3 = curve[stepIndex + 4];
+                    var y3 = curve[stepIndex + 5];
+                    var x4 = isInCurve ? curve[stepIndex + 6] : 1.0;
+                    var y4 = isInCurve ? curve[stepIndex + 7] : 1.0;
+                    var lower = 0.0;
+                    var higher = 1.0;
+                    while (higher - lower > 0.0001) {
+                        var percentage = (higher + lower) * 0.5;
+                        this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
+                        if (t - this._helpPoint.x > 0.0) {
+                            lower = percentage;
+                        }
+                        else {
+                            higher = percentage;
+                        }
                     }
-                    else {
-                        higher = percentage;
+                    samples[i] = this._helpPoint.y;
+                }
+                return true;
+            }
+            else {
+                var stepIndex = 0;
+                for (var i = 0, l = samples.length; i < l; ++i) {
+                    var t = (i + 1) / (l + 1); // float
+                    while (curve[stepIndex + 6] < t) {
+                        stepIndex += 6;
+                    }
+                    var x1 = curve[stepIndex];
+                    var y1 = curve[stepIndex + 1];
+                    var x2 = curve[stepIndex + 2];
+                    var y2 = curve[stepIndex + 3];
+                    var x3 = curve[stepIndex + 4];
+                    var y3 = curve[stepIndex + 5];
+                    var x4 = curve[stepIndex + 6];
+                    var y4 = curve[stepIndex + 7];
+                    var lower = 0.0;
+                    var higher = 1.0;
+                    while (higher - lower > 0.0001) {
+                        var percentage = (higher + lower) * 0.5;
+                        this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint);
+                        if (t - this._helpPoint.x > 0.0) {
+                            lower = percentage;
+                        }
+                        else {
+                            higher = percentage;
+                        }
                     }
+                    samples[i] = this._helpPoint.y;
                 }
-                samples[i] = this._helpPoint.y;
+                return false;
             }
         };
         ObjectDataParser.prototype._parseActionDataInFrame = function (rawData, frameStart, bone, slot) {
@@ -11855,7 +11994,7 @@ var dragonBones;
             }
         };
         ObjectDataParser.prototype._mergeActionFrame = function (rawData, frameStart, type, bone, slot) {
-            var actionOffset = dragonBones.DragonBones.webAssembly ? this._armature.actions.size() : this._armature.actions.length;
+            var actionOffset = this._armature.actions.length;
             var actions = this._parseActionData(rawData, type, bone, slot);
             var frameIndex = 0;
             var frame = null;
@@ -11883,7 +12022,7 @@ var dragonBones;
             if (frame === null) {
                 frame = new ActionFrame();
                 frame.frameStart = frameStart;
-                this._actionFrames.splice(frameIndex + 1, 0, frame);
+                this._actionFrames.splice(frameIndex, 0, frame);
             }
             for (var i = 0; i < actions.length; ++i) {
                 frame.actions.push(actionOffset + i);
@@ -11992,13 +12131,6 @@ var dragonBones;
                     }
                 }
             }
-            for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) {
-                var rawMeshData = this._cacheRawMeshes[i];
-                if (!(dragonBones.DataParser.GLUE_WEIGHTS in rawMeshData) || !(dragonBones.DataParser.GLUE_MESHES in rawMeshData)) {
-                    continue;
-                }
-                this._parseMeshGlue(rawMeshData, this._cacheMeshes[i]);
-            }
             for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) {
                 var rawData_1 = this._cacheRawMeshes[i];
                 var shareName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SHARE, "");
@@ -12014,7 +12146,7 @@ var dragonBones;
                     continue; // Error.
                 }
                 var mesh = this._cacheMeshes[i];
-                mesh.vertices.shareFrom(shareMesh.vertices);
+                mesh.geometry.shareFrom(shareMesh.geometry);
             }
             if (dragonBones.DataParser.ANIMATION in rawData) {
                 var rawAnimations = rawData[dragonBones.DataParser.ANIMATION];
@@ -12065,7 +12197,6 @@ var dragonBones;
         };
         ObjectDataParser.prototype._parseBone = function (rawData) {
             var type = 0 /* Bone */;
-            var scale = this._armature.scale;
             if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") {
                 type = dragonBones.DataParser._getBoneType(rawData[dragonBones.DataParser.TYPE]);
             }
@@ -12073,12 +12204,14 @@ var dragonBones;
                 type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Bone */);
             }
             if (type === 0 /* Bone */) {
+                var scale = this._armature.scale;
                 var bone = dragonBones.BaseObject.borrowObject(dragonBones.BoneData);
                 bone.inheritTranslation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_TRANSLATION, true);
                 bone.inheritRotation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_ROTATION, true);
                 bone.inheritScale = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_SCALE, true);
                 bone.inheritReflection = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_REFLECTION, true);
                 bone.length = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.LENGTH, 0) * scale;
+                bone.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
                 bone.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
                 if (dragonBones.DataParser.TRANSFORM in rawData) {
                     this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], bone.transform, scale);
@@ -12086,21 +12219,11 @@ var dragonBones;
                 return bone;
             }
             var surface = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceData);
+            surface.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
             surface.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             surface.segmentX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_X, 0);
             surface.segmentY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_Y, 0);
-            surface.vertices.length = (surface.segmentX + 1) * (surface.segmentY + 1) * 2;
-            if (dragonBones.DataParser.VERTICES in rawData) {
-                var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-                for (var i = 0, l = surface.vertices.length; i < l; ++i) {
-                    if (i < rawVertices.length) {
-                        surface.vertices[i] = rawVertices[i] * scale;
-                    }
-                    else {
-                        surface.vertices[i] = 0.0;
-                    }
-                }
-            }
+            this._parseGeometry(rawData, surface.geometry);
             return surface;
         };
         ObjectDataParser.prototype._parseIKConstraint = function (rawData) {
@@ -12112,6 +12235,7 @@ var dragonBones;
             if (target === null) {
                 return null;
             }
+            var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0);
             var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintData);
             constraint.scaleEnabled = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.SCALE, false);
             constraint.bendPositive = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true);
@@ -12119,7 +12243,6 @@ var dragonBones;
             constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             constraint.type = 0 /* IK */;
             constraint.target = target;
-            var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0);
             if (chain > 0 && bone.parent !== null) {
                 constraint.root = bone.parent;
                 constraint.bone = bone;
@@ -12179,6 +12302,8 @@ var dragonBones;
             var slot = dragonBones.BaseObject.borrowObject(dragonBones.SlotData);
             slot.displayIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0);
             slot.zOrder = zOrder;
+            slot.zIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Z_INDEX, 0);
+            slot.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0);
             slot.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "");
             slot.parent = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.PARENT, "")); //
             if (dragonBones.DataParser.BLEND_MODE in rawData && typeof rawData[dragonBones.DataParser.BLEND_MODE] === "string") {
@@ -12245,13 +12370,14 @@ var dragonBones;
                 type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, type);
             }
             switch (type) {
-                case 0 /* Image */:
+                case 0 /* Image */: {
                     var imageDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ImageDisplayData);
                     imageDisplay.name = name;
                     imageDisplay.path = path.length > 0 ? path : name;
                     this._parsePivot(rawData, imageDisplay);
                     break;
-                case 1 /* Armature */:
+                }
+                case 1 /* Armature */: {
                     var armatureDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureDisplayData);
                     armatureDisplay.name = name;
                     armatureDisplay.path = path.length > 0 ? path : name;
@@ -12274,25 +12400,23 @@ var dragonBones;
                         }
                     }
                     break;
-                case 2 /* Mesh */:
+                }
+                case 2 /* Mesh */: {
                     var meshDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.MeshDisplayData);
-                    meshDisplay.vertices.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true);
+                    meshDisplay.geometry.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true);
                     meshDisplay.name = name;
                     meshDisplay.path = path.length > 0 ? path : name;
-                    meshDisplay.vertices.data = this._data;
                     if (dragonBones.DataParser.SHARE in rawData) {
+                        meshDisplay.geometry.data = this._data;
                         this._cacheRawMeshes.push(rawData);
                         this._cacheMeshes.push(meshDisplay);
                     }
                     else {
                         this._parseMesh(rawData, meshDisplay);
                     }
-                    if ((dragonBones.DataParser.GLUE_WEIGHTS in rawData) && (dragonBones.DataParser.GLUE_MESHES in rawData)) {
-                        this._cacheRawMeshes.push(rawData);
-                        this._cacheMeshes.push(meshDisplay);
-                    }
                     break;
-                case 3 /* BoundingBox */:
+                }
+                case 3 /* BoundingBox */: {
                     var boundingBox = this._parseBoundingBox(rawData);
                     if (boundingBox !== null) {
                         var boundingBoxDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.BoundingBoxDisplayData);
@@ -12301,20 +12425,21 @@ var dragonBones;
                         boundingBoxDisplay.boundingBox = boundingBox;
                     }
                     break;
-                case 4 /* Path */:
+                }
+                case 4 /* Path */: {
                     var rawCurveLengths = rawData[dragonBones.DataParser.LENGTHS];
                     var pathDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.PathDisplayData);
                     pathDisplay.closed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CLOSED, false);
                     pathDisplay.constantSpeed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CONSTANT_SPEED, false);
                     pathDisplay.name = name;
                     pathDisplay.path = path.length > 0 ? path : name;
-                    pathDisplay.vertices.data = this._data;
                     pathDisplay.curveLengths.length = rawCurveLengths.length;
                     for (var i = 0, l = rawCurveLengths.length; i < l; ++i) {
                         pathDisplay.curveLengths[i] = rawCurveLengths[i];
                     }
                     this._parsePath(rawData, pathDisplay);
                     break;
+                }
             }
             if (display !== null && dragonBones.DataParser.TRANSFORM in rawData) {
                 this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], display.transform, this._armature.scale);
@@ -12322,58 +12447,7 @@ var dragonBones;
             return display;
         };
         ObjectDataParser.prototype._parsePath = function (rawData, display) {
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var vertexCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VERTEX_COUNT, 0); // uint
-            var vertexOffset = this._floatArray.length;
-            var pathOffset = this._intArray.length;
-            display.vertices.offset = pathOffset;
-            this._intArray.length += 1 + 1;
-            this._intArray[pathOffset + 0 /* PathVertexCount */] = vertexCount;
-            this._intArray[pathOffset + 2 /* PathFloatOffset */] = vertexOffset;
-            if (!(dragonBones.DataParser.WEIGHTS in rawData)) {
-                this._floatArray.length += rawVertices.length;
-                for (var i = 0, l = rawVertices.length; i < l; ++i) {
-                    this._floatArray[vertexOffset + i] = rawVertices[i];
-                }
-            }
-            else {
-                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
-                var rawBones = rawData[dragonBones.DataParser.BONES];
-                var weightBoneCount = rawBones.length;
-                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
-                var weightOffset = this._intArray.length;
-                var floatOffset = this._floatArray.length;
-                var sortedBones = this._armature.sortedBones;
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                weight.count = weightCount;
-                weight.offset = weightOffset;
-                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
-                //
-                this._intArray[weightOffset + 0 /* WeigthBoneCount */] = weightBoneCount;
-                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
-                for (var i = 0; i < weightBoneCount; i++) {
-                    var rawBoneIndex = rawBones[i];
-                    var bone = this._rawBones[rawBoneIndex];
-                    weight.addBone(bone);
-                    this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
-                }
-                this._floatArray.length += weightCount * 3;
-                for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) {
-                    var boneCount = rawWeights[iW++];
-                    this._intArray[iB++] = boneCount;
-                    for (var j = 0; j < boneCount; j++) {
-                        var boneIndex = rawWeights[iW++];
-                        var boneWeight = rawWeights[iW++];
-                        var x = rawVertices[iV++];
-                        var y = rawVertices[iV++];
-                        this._intArray[iB++] = rawBones.indexOf(boneIndex);
-                        this._floatArray[iF++] = boneWeight;
-                        this._floatArray[iF++] = x;
-                        this._floatArray[iF++] = y;
-                    }
-                }
-                display.vertices.weight = weight;
-            }
+            this._parseGeometry(rawData, display.geometry);
         };
         ObjectDataParser.prototype._parsePivot = function (rawData, display) {
             if (dragonBones.DataParser.PIVOT in rawData) {
@@ -12387,93 +12461,15 @@ var dragonBones;
             }
         };
         ObjectDataParser.prototype._parseMesh = function (rawData, mesh) {
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var rawUVs = rawData[dragonBones.DataParser.UVS];
-            var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES];
-            var vertexCount = Math.floor(rawVertices.length / 2); // uint
-            var triangleCount = Math.floor(rawTriangles.length / 3); // uint
-            var vertexOffset = this._floatArray.length;
-            var uvOffset = vertexOffset + vertexCount * 2;
-            var meshOffset = this._intArray.length;
-            var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; // Cache pose data.
-            mesh.vertices.offset = meshOffset;
-            this._intArray.length += 1 + 1 + 1 + 1 + triangleCount * 3;
-            this._intArray[meshOffset + 0 /* MeshVertexCount */] = vertexCount;
-            this._intArray[meshOffset + 1 /* MeshTriangleCount */] = triangleCount;
-            this._intArray[meshOffset + 2 /* MeshFloatOffset */] = vertexOffset;
-            for (var i = 0, l = triangleCount * 3; i < l; ++i) {
-                this._intArray[meshOffset + 4 /* MeshVertexIndices */ + i] = rawTriangles[i];
-            }
-            this._floatArray.length += vertexCount * 2 + vertexCount * 2;
-            for (var i = 0, l = vertexCount * 2; i < l; ++i) {
-                this._floatArray[vertexOffset + i] = rawVertices[i];
-                this._floatArray[uvOffset + i] = rawUVs[i];
-            }
+            this._parseGeometry(rawData, mesh.geometry);
             if (dragonBones.DataParser.WEIGHTS in rawData) {
-                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
                 var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE];
                 var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE];
-                var sortedBones = this._armature.sortedBones;
-                var weightBoneIndices = new Array();
-                var weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint
-                var floatOffset = this._floatArray.length;
-                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
-                var weightOffset = this._intArray.length;
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                weight.count = weightCount;
-                weight.offset = weightOffset;
-                weightBoneIndices.length = weightBoneCount;
-                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
-                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
-                for (var i = 0; i < weightBoneCount; ++i) {
-                    var rawBoneIndex = rawBonePoses[i * 7]; // uint
-                    var bone = this._rawBones[rawBoneIndex];
-                    weight.addBone(bone);
-                    weightBoneIndices[i] = rawBoneIndex;
-                    this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
-                }
-                this._floatArray.length += weightCount * 3;
-                this._helpMatrixA.copyFromArray(rawSlotPose, 0);
-                for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) {
-                    var iD = i * 2;
-                    var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint
-                    var x = this._floatArray[vertexOffset + iD];
-                    var y = this._floatArray[vertexOffset + iD + 1];
-                    this._helpMatrixA.transformPoint(x, y, this._helpPoint);
-                    x = this._helpPoint.x;
-                    y = this._helpPoint.y;
-                    for (var j = 0; j < vertexBoneCount; ++j) {
-                        var rawBoneIndex = rawWeights[iW++]; // uint
-                        var boneIndex = weightBoneIndices.indexOf(rawBoneIndex);
-                        this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1);
-                        this._helpMatrixB.invert();
-                        this._helpMatrixB.transformPoint(x, y, this._helpPoint);
-                        this._intArray[iB++] = boneIndex;
-                        this._floatArray[iV++] = rawWeights[iW++];
-                        this._floatArray[iV++] = this._helpPoint.x;
-                        this._floatArray[iV++] = this._helpPoint.y;
-                    }
-                }
-                mesh.vertices.weight = weight;
+                var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name;
                 this._weightSlotPose[meshName] = rawSlotPose;
                 this._weightBonePoses[meshName] = rawBonePoses;
             }
         };
-        ObjectDataParser.prototype._parseMeshGlue = function (rawData, mesh) {
-            rawData;
-            mesh;
-            // const rawWeights = rawData[DataParser.GLUE_WEIGHTS] as Array;
-            // const rawMeshes = rawData[DataParser.GLUE_MESHES] as Array;
-            // mesh.glue = BaseObject.borrowObject(GlueData);
-            // mesh.glue.weights.length = rawWeights.length;
-            // for (let i = 0, l = rawWeights.length; i < l; ++i) {
-            //     mesh.glue.weights[i] = rawWeights[i];
-            // }
-            // for (let i = 0, l = rawMeshes.length; i < l; i += 3) {
-            //     const glueMesh = this._armature.getMesh(rawMeshes[i], rawMeshes[i + 1], rawMeshes[i + 2]);
-            //     mesh.glue.addMesh(glueMesh);
-            // }
-        };
         ObjectDataParser.prototype._parseBoundingBox = function (rawData) {
             var boundingBox = null;
             var type = 0 /* Rectangle */;
@@ -12509,23 +12505,12 @@ var dragonBones;
                 var scale = this._armature.scale;
                 var rawVertices = rawData[dragonBones.DataParser.VERTICES];
                 var vertices = polygonBoundingBox.vertices;
-                if (dragonBones.DragonBones.webAssembly) {
-                    vertices.resize(rawVertices.length, 0.0);
-                }
-                else {
-                    vertices.length = rawVertices.length;
-                }
+                vertices.length = rawVertices.length;
                 for (var i = 0, l = rawVertices.length; i < l; i += 2) {
                     var x = rawVertices[i] * scale;
                     var y = rawVertices[i + 1] * scale;
-                    if (dragonBones.DragonBones.webAssembly) {
-                        vertices.set(i, x);
-                        vertices.set(i + 1, y);
-                    }
-                    else {
-                        vertices[i] = x;
-                        vertices[i + 1] = y;
-                    }
+                    vertices[i] = x;
+                    vertices[i + 1] = y;
                     // AABB.
                     if (i === 0) {
                         polygonBoundingBox.x = x;
@@ -12558,7 +12543,8 @@ var dragonBones;
         };
         ObjectDataParser.prototype._parseAnimation = function (rawData) {
             var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData);
-            animation.frameCount = Math.max(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 1), 1);
+            animation.blendType = dragonBones.DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, ""));
+            animation.frameCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0);
             animation.playTimes = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1);
             animation.duration = animation.frameCount / this._armature.frameRate; // float
             animation.fadeInTime = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0);
@@ -12583,7 +12569,7 @@ var dragonBones;
                 }
             }
             if (dragonBones.DataParser.Z_ORDER in rawData) {
-                this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, false, false, 0, this._parseZOrderFrame);
+                this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, 0 /* Step */, 0, this._parseZOrderFrame);
             }
             if (dragonBones.DataParser.BONE in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.BONE];
@@ -12592,33 +12578,17 @@ var dragonBones;
                     this._parseBoneTimeline(rawTimeline);
                 }
             }
-            if (dragonBones.DataParser.SURFACE in rawData) {
-                var rawTimelines = rawData[dragonBones.DataParser.SURFACE];
-                for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) {
-                    var rawTimeline = rawTimelines_2[_a];
-                    var surfaceName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
-                    this._surface = this._armature.getBone(surfaceName);
-                    if (this._surface === null) {
-                        continue;
-                    }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 50 /* Surface */, false, true, 0, this._parseSurfaceFrame);
-                    if (timeline !== null) {
-                        this._animation.addSurfaceTimeline(this._surface, timeline);
-                    }
-                    this._surface = null; //
-                }
-            }
             if (dragonBones.DataParser.SLOT in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.SLOT];
-                for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) {
-                    var rawTimeline = rawTimelines_3[_b];
+                for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) {
+                    var rawTimeline = rawTimelines_2[_a];
                     this._parseSlotTimeline(rawTimeline);
                 }
             }
             if (dragonBones.DataParser.FFD in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.FFD];
-                for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) {
-                    var rawTimeline = rawTimelines_4[_c];
+                for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) {
+                    var rawTimeline = rawTimelines_3[_b];
                     var skinName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME);
                     var slotName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SLOT, "");
                     var displayName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
@@ -12630,9 +12600,9 @@ var dragonBones;
                     if (this._slot === null || this._mesh === null) {
                         continue;
                     }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, false, true, 0, this._parseSlotFFDFrame);
+                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, 2 /* Float */, 0, this._parseSlotDeformFrame);
                     if (timeline !== null) {
-                        this._animation.addSlotTimeline(this._slot, timeline);
+                        this._animation.addSlotTimeline(slotName, timeline);
                     }
                     this._slot = null; //
                     this._mesh = null; //
@@ -12640,38 +12610,184 @@ var dragonBones;
             }
             if (dragonBones.DataParser.IK in rawData) {
                 var rawTimelines = rawData[dragonBones.DataParser.IK];
-                for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) {
-                    var rawTimeline = rawTimelines_5[_d];
+                for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) {
+                    var rawTimeline = rawTimelines_4[_c];
                     var constraintName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
                     var constraint = this._armature.getConstraint(constraintName);
                     if (constraint === null) {
                         continue;
                     }
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, true, false, 2, this._parseIKConstraintFrame);
+                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, 1 /* Int */, 2, this._parseIKConstraintFrame);
                     if (timeline !== null) {
-                        this._animation.addConstraintTimeline(constraint, timeline);
+                        this._animation.addConstraintTimeline(constraintName, timeline);
                     }
                 }
             }
-            if (dragonBones.DataParser.ANIMATION in rawData) {
-                var rawTimelines = rawData[dragonBones.DataParser.ANIMATION];
-                for (var _e = 0, rawTimelines_6 = rawTimelines; _e < rawTimelines_6.length; _e++) {
-                    var rawTimeline = rawTimelines_6[_e];
-                    var animationName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
-                    var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 40 /* AnimationTime */, true, false, 2, this._parseAnimationFrame);
+            if (this._actionFrames.length > 0) {
+                this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, 0 /* Step */, 0, this._parseActionFrame);
+                this._actionFrames.length = 0;
+            }
+            if (dragonBones.DataParser.TIMELINE in rawData) {
+                var rawTimelines = rawData[dragonBones.DataParser.TIMELINE];
+                for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) {
+                    var rawTimeline = rawTimelines_5[_d];
+                    var timelineType = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */);
+                    var timelineName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
+                    var timeline = null;
+                    switch (timelineType) {
+                        case 0 /* Action */:
+                            // TODO
+                            break;
+                        case 20 /* SlotDisplay */: // TODO
+                        case 23 /* SlotZIndex */:
+                        case 60 /* BoneAlpha */:
+                        case 24 /* SlotAlpha */:
+                        case 40 /* AnimationProgress */:
+                        case 41 /* AnimationWeight */:
+                            if (timelineType === 20 /* SlotDisplay */) {
+                                this._frameValueType = 0 /* Step */;
+                                this._frameValueScale = 1.0;
+                            }
+                            else {
+                                this._frameValueType = 1 /* Int */;
+                                if (timelineType === 23 /* SlotZIndex */) {
+                                    this._frameValueScale = 1.0;
+                                }
+                                else if (timelineType === 40 /* AnimationProgress */ ||
+                                    timelineType === 41 /* AnimationWeight */) {
+                                    this._frameValueScale = 10000.0;
+                                }
+                                else {
+                                    this._frameValueScale = 100.0;
+                                }
+                            }
+                            if (timelineType === 60 /* BoneAlpha */ ||
+                                timelineType === 24 /* SlotAlpha */ ||
+                                timelineType === 41 /* AnimationWeight */) {
+                                this._frameDefaultValue = 1.0;
+                            }
+                            else {
+                                this._frameDefaultValue = 0.0;
+                            }
+                            if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) {
+                                timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData);
+                                var animaitonTimeline = timeline;
+                                animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0);
+                                animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0);
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 1, this._parseSingleValueFrame, timeline);
+                            break;
+                        case 11 /* BoneTranslate */:
+                        case 12 /* BoneRotate */:
+                        case 13 /* BoneScale */:
+                        case 30 /* IKConstraint */:
+                        case 42 /* AnimationParameter */:
+                            if (timelineType === 30 /* IKConstraint */ ||
+                                timelineType === 42 /* AnimationParameter */) {
+                                this._frameValueType = 1 /* Int */;
+                                if (timelineType === 42 /* AnimationParameter */) {
+                                    this._frameValueScale = 10000.0;
+                                }
+                                else {
+                                    this._frameValueScale = 100.0;
+                                }
+                            }
+                            else {
+                                if (timelineType === 12 /* BoneRotate */) {
+                                    this._frameValueScale = dragonBones.Transform.DEG_RAD;
+                                }
+                                else {
+                                    this._frameValueScale = 1.0;
+                                }
+                                this._frameValueType = 2 /* Float */;
+                            }
+                            if (timelineType === 13 /* BoneScale */ ||
+                                timelineType === 30 /* IKConstraint */) {
+                                this._frameDefaultValue = 1.0;
+                            }
+                            else {
+                                this._frameDefaultValue = 0.0;
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 2, this._parseDoubleValueFrame);
+                            break;
+                        case 1 /* ZOrder */:
+                            // TODO
+                            break;
+                        case 50 /* Surface */: {
+                            var surface = this._armature.getBone(timelineName);
+                            if (surface === null) {
+                                continue;
+                            }
+                            this._geometry = surface.geometry;
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame);
+                            this._geometry = null; //
+                            break;
+                        }
+                        case 22 /* SlotDeform */: {
+                            this._geometry = null; //
+                            for (var skinName in this._armature.skins) {
+                                var skin = this._armature.skins[skinName];
+                                for (var slontName in skin.displays) {
+                                    var displays = skin.displays[slontName];
+                                    for (var _e = 0, displays_1 = displays; _e < displays_1.length; _e++) {
+                                        var display = displays_1[_e];
+                                        if (display !== null && display.name === timelineName) {
+                                            this._geometry = display.geometry;
+                                            break;
+                                        }
+                                    }
+                                }
+                            }
+                            if (this._geometry === null) {
+                                continue;
+                            }
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame);
+                            this._geometry = null; //
+                            break;
+                        }
+                        case 21 /* SlotColor */:
+                            timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 1 /* Int */, 1, this._parseSlotColorFrame);
+                            break;
+                    }
                     if (timeline !== null) {
-                        this._animation.addAnimationTimeline(animationName, timeline);
+                        switch (timelineType) {
+                            case 0 /* Action */:
+                                // TODO
+                                break;
+                            case 1 /* ZOrder */:
+                                // TODO
+                                break;
+                            case 11 /* BoneTranslate */:
+                            case 12 /* BoneRotate */:
+                            case 13 /* BoneScale */:
+                            case 50 /* Surface */:
+                            case 60 /* BoneAlpha */:
+                                this._animation.addBoneTimeline(timelineName, timeline);
+                                break;
+                            case 20 /* SlotDisplay */:
+                            case 21 /* SlotColor */:
+                            case 22 /* SlotDeform */:
+                            case 23 /* SlotZIndex */:
+                            case 24 /* SlotAlpha */:
+                                this._animation.addSlotTimeline(timelineName, timeline);
+                                break;
+                            case 30 /* IKConstraint */:
+                                this._animation.addConstraintTimeline(timelineName, timeline);
+                                break;
+                            case 40 /* AnimationProgress */:
+                            case 41 /* AnimationWeight */:
+                            case 42 /* AnimationParameter */:
+                                this._animation.addAnimationTimeline(timelineName, timeline);
+                                break;
+                        }
                     }
                 }
             }
-            if (this._actionFrames.length > 0) {
-                this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, false, false, 0, this._parseActionFrame);
-                this._actionFrames.length = 0;
-            }
             this._animation = null; //
             return animation;
         };
-        ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, type, addIntOffset, addFloatOffset, frameValueCount, frameParser) {
+        ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, timelineType, frameValueType, frameValueCount, frameParser, timeline) {
+            if (timeline === void 0) { timeline = null; }
             if (rawData !== null && framesKey.length > 0 && framesKey in rawData) {
                 rawFrames = rawData[framesKey];
             }
@@ -12684,8 +12800,14 @@ var dragonBones;
             }
             var frameIntArrayLength = this._frameIntArray.length;
             var frameFloatArrayLength = this._frameFloatArray.length;
-            var timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
             var timelineOffset = this._timelineArray.length;
+            if (timeline === null) {
+                timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
+            }
+            timeline.type = timelineType;
+            timeline.offset = timelineOffset;
+            this._frameValueType = frameValueType;
+            this._timeline = timeline;
             this._timelineArray.length += 1 + 1 + 1 + 1 + 1 + keyFrameCount;
             if (rawData !== null) {
                 this._timelineArray[timelineOffset + 0 /* TimelineScale */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0) * 100);
@@ -12697,18 +12819,17 @@ var dragonBones;
             }
             this._timelineArray[timelineOffset + 2 /* TimelineKeyFrameCount */] = keyFrameCount;
             this._timelineArray[timelineOffset + 3 /* TimelineFrameValueCount */] = frameValueCount;
-            if (addIntOffset) {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset;
-            }
-            else if (addFloatOffset) {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset;
-            }
-            else {
-                this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0;
+            switch (this._frameValueType) {
+                case 0 /* Step */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0;
+                    break;
+                case 1 /* Int */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset;
+                    break;
+                case 2 /* Float */:
+                    this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset;
+                    break;
             }
-            this._timeline = timeline;
-            timeline.type = type;
-            timeline.offset = timelineOffset;
             if (keyFrameCount === 1) {
                 timeline.frameIndicesOffset = -1;
                 this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + 0] = frameParser.call(this, rawFrames[0], 0, 0) - this._animation.frameOffset;
@@ -12716,15 +12837,8 @@ var dragonBones;
             else {
                 var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation.
                 var frameIndices = this._data.frameIndices;
-                var frameIndicesOffset = 0;
-                if (dragonBones.DragonBones.webAssembly) {
-                    frameIndicesOffset = frameIndices.size();
-                    frameIndices.resize(frameIndicesOffset + totalFrameCount, 0);
-                }
-                else {
-                    frameIndicesOffset = frameIndices.length;
-                    frameIndices.length += totalFrameCount;
-                }
+                var frameIndicesOffset = frameIndices.length;
+                frameIndices.length += totalFrameCount;
                 timeline.frameIndicesOffset = frameIndicesOffset;
                 for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) {
                     if (frameStart + frameCount <= i && iK < keyFrameCount) {
@@ -12744,12 +12858,7 @@ var dragonBones;
                         this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + iK] = frameParser.call(this, rawFrame, frameStart, frameCount) - this._animation.frameOffset;
                         iK++;
                     }
-                    if (dragonBones.DragonBones.webAssembly) {
-                        frameIndices.set(frameIndicesOffset + i, iK - 1);
-                    }
-                    else {
-                        frameIndices[frameIndicesOffset + i] = iK - 1;
-                    }
+                    frameIndices[frameIndicesOffset + i] = iK - 1;
                 }
             }
             this._timeline = null; //
@@ -12763,27 +12872,33 @@ var dragonBones;
             this._bone = bone;
             this._slot = this._armature.getSlot(this._bone.name);
             if (dragonBones.DataParser.TRANSLATE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, false, true, 2, this._parseBoneTranslateFrame);
+                this._frameDefaultValue = 0.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, 2 /* Float */, 2, this._parseDoubleValueFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.ROTATE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, false, true, 2, this._parseBoneRotateFrame);
+                this._frameDefaultValue = 0.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, 2 /* Float */, 2, this._parseBoneRotateFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.SCALE_FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, false, true, 2, this._parseBoneScaleFrame);
+                this._frameDefaultValue = 1.0;
+                this._frameValueScale = 1.0;
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, 2 /* Float */, 2, this._parseBoneScaleFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             if (dragonBones.DataParser.FRAME in rawData) {
-                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, false, true, 6, this._parseBoneAllFrame);
+                var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, 2 /* Float */, 6, this._parseBoneAllFrame);
                 if (timeline !== null) {
-                    this._animation.addBoneTimeline(bone, timeline);
+                    this._animation.addBoneTimeline(bone.name, timeline);
                 }
             }
             this._bone = null; //
@@ -12794,27 +12909,26 @@ var dragonBones;
             if (slot === null) {
                 return;
             }
-            this._slot = slot;
-            // Display timeline.
             var displayTimeline = null;
+            var colorTimeline = null;
+            this._slot = slot;
             if (dragonBones.DataParser.DISPLAY_FRAME in rawData) {
-                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, false, false, 0, this._parseSlotDisplayFrame);
+                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame);
             }
             else {
-                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, false, false, 0, this._parseSlotDisplayFrame);
-            }
-            if (displayTimeline !== null) {
-                this._animation.addSlotTimeline(slot, displayTimeline);
+                displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame);
             }
-            var colorTimeline = null;
             if (dragonBones.DataParser.COLOR_FRAME in rawData) {
-                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, true, false, 1, this._parseSlotColorFrame);
+                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame);
             }
             else {
-                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, true, false, 1, this._parseSlotColorFrame);
+                colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame);
+            }
+            if (displayTimeline !== null) {
+                this._animation.addSlotTimeline(slot.name, displayTimeline);
             }
             if (colorTimeline !== null) {
-                this._animation.addSlotTimeline(slot, colorTimeline);
+                this._animation.addSlotTimeline(slot.name, colorTimeline);
             }
             this._slot = null; //
         };
@@ -12834,10 +12948,10 @@ var dragonBones;
                 if (dragonBones.DataParser.CURVE in rawData) {
                     var sampleCount = frameCount + 1;
                     this._helpArray.length = sampleCount;
-                    this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray);
+                    var isOmited = this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray);
                     this._frameArray.length += 1 + 1 + this._helpArray.length;
                     this._frameArray[frameOffset + 1 /* FrameTweenType */] = 2 /* Curve */;
-                    this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = sampleCount;
+                    this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = isOmited ? sampleCount : -sampleCount;
                     for (var i = 0; i < sampleCount; ++i) {
                         this._frameArray[frameOffset + 3 /* FrameCurveSamples */ + i] = Math.round(this._helpArray[i] * 10000.0);
                     }
@@ -12879,6 +12993,61 @@ var dragonBones;
             }
             return frameOffset;
         };
+        ObjectDataParser.prototype._parseSingleValueFrame = function (rawData, frameStart, frameCount) {
+            var frameOffset = 0;
+            switch (this._frameValueType) {
+                case 0: {
+                    frameOffset = this._parseFrame(rawData, frameStart, frameCount);
+                    this._frameArray.length += 1;
+                    this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue);
+                    break;
+                }
+                case 1: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameIntArray.length;
+                    this._frameIntArray.length += 1;
+                    this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale);
+                    break;
+                }
+                case 2: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameFloatArray.length;
+                    this._frameFloatArray.length += 1;
+                    this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale;
+                    break;
+                }
+            }
+            return frameOffset;
+        };
+        ObjectDataParser.prototype._parseDoubleValueFrame = function (rawData, frameStart, frameCount) {
+            var frameOffset = 0;
+            switch (this._frameValueType) {
+                case 0: {
+                    frameOffset = this._parseFrame(rawData, frameStart, frameCount);
+                    this._frameArray.length += 2;
+                    this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue);
+                    this._frameArray[frameOffset + 2] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue);
+                    break;
+                }
+                case 1: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameIntArray.length;
+                    this._frameIntArray.length += 2;
+                    this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale);
+                    this._frameIntArray[frameValueOffset + 1] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale);
+                    break;
+                }
+                case 2: {
+                    frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+                    var frameValueOffset = this._frameFloatArray.length;
+                    this._frameFloatArray.length += 2;
+                    this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale;
+                    this._frameFloatArray[frameValueOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale;
+                    break;
+                }
+            }
+            return frameOffset;
+        };
         ObjectDataParser.prototype._parseActionFrame = function (frame, frameStart, frameCount) {
             // tslint:disable-next-line:no-unused-expression
             frameCount;
@@ -13011,43 +13180,6 @@ var dragonBones;
             this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0);
             return frameOffset;
         };
-        ObjectDataParser.prototype._parseSurfaceFrame = function (rawData, frameStart, frameCount) {
-            var frameFloatOffset = this._frameFloatArray.length;
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
-            var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
-            var vertexCount = this._surface.vertices.length / 2; // uint
-            var x = 0.0;
-            var y = 0.0;
-            this._frameFloatArray.length += vertexCount * 2;
-            for (var i = 0; i < vertexCount * 2; i += 2) {
-                if (i < offset || i - offset >= rawVertices.length) {
-                    x = 0.0;
-                }
-                else {
-                    x = rawVertices[i - offset];
-                }
-                if (i + 1 < offset || i + 1 - offset >= rawVertices.length) {
-                    y = 0.0;
-                }
-                else {
-                    y = rawVertices[i + 1 - offset];
-                }
-                this._frameFloatArray[frameFloatOffset + i] = x;
-                this._frameFloatArray[frameFloatOffset + i + 1] = y;
-            }
-            if (frameStart === 0) {
-                var frameIntOffset = this._frameIntArray.length;
-                this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
-                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = 0; // 
-                this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
-                this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
-                this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
-                this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset;
-                this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset;
-            }
-            return frameOffset;
-        };
         ObjectDataParser.prototype._parseSlotDisplayFrame = function (rawData, frameStart, frameCount) {
             var frameOffset = this._parseFrame(rawData, frameStart, frameCount);
             this._frameArray.length += 1;
@@ -13069,32 +13201,32 @@ var dragonBones;
                     // tslint:disable-next-line:no-unused-expression
                     k;
                     this._parseColorTransform(rawColor, this._helpColorTransform);
-                    colorOffset = this._intArray.length;
-                    this._intArray.length += 8;
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset);
-                    this._intArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset);
+                    colorOffset = this._colorArray.length;
+                    this._colorArray.length += 8;
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset);
+                    this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset);
                     colorOffset -= 8;
                     break;
                 }
             }
             if (colorOffset < 0) {
                 if (this._defaultColorOffset < 0) {
-                    this._defaultColorOffset = colorOffset = this._intArray.length;
-                    this._intArray.length += 8;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 100;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
-                    this._intArray[colorOffset++] = 0;
+                    this._defaultColorOffset = colorOffset = this._colorArray.length;
+                    this._colorArray.length += 8;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 100;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
+                    this._colorArray[colorOffset++] = 0;
                 }
                 colorOffset = this._defaultColorOffset;
             }
@@ -13103,14 +13235,14 @@ var dragonBones;
             this._frameIntArray[frameIntOffset] = colorOffset;
             return frameOffset;
         };
-        ObjectDataParser.prototype._parseSlotFFDFrame = function (rawData, frameStart, frameCount) {
+        ObjectDataParser.prototype._parseSlotDeformFrame = function (rawData, frameStart, frameCount) {
             var frameFloatOffset = this._frameFloatArray.length;
             var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
             var rawVertices = dragonBones.DataParser.VERTICES in rawData ? rawData[dragonBones.DataParser.VERTICES] : null;
             var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
-            var vertexCount = this._intArray[this._mesh.vertices.offset + 0 /* MeshVertexCount */];
+            var vertexCount = this._intArray[this._mesh.geometry.offset + 0 /* GeometryVertexCount */];
             var meshName = this._mesh.parent.name + "_" + this._slot.name + "_" + this._mesh.name;
-            var weight = this._mesh.vertices.weight;
+            var weight = this._mesh.geometry.weight;
             var x = 0.0;
             var y = 0.0;
             var iB = 0;
@@ -13166,28 +13298,20 @@ var dragonBones;
             if (frameStart === 0) {
                 var frameIntOffset = this._frameIntArray.length;
                 this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
-                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.vertices.offset;
+                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.geometry.offset;
                 this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
                 this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
                 this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
                 this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset;
                 this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset;
-            }
-            return frameOffset;
-        };
-        ObjectDataParser.prototype._parseIKConstraintFrame = function (rawData, frameStart, frameCount) {
-            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
-            var frameIntOffset = this._frameIntArray.length;
-            this._frameIntArray.length += 2;
-            this._frameIntArray[frameIntOffset++] = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true) ? 1 : 0;
-            this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0);
+            }
             return frameOffset;
         };
-        ObjectDataParser.prototype._parseAnimationFrame = function (rawData, frameStart, frameCount) {
+        ObjectDataParser.prototype._parseIKConstraintFrame = function (rawData, frameStart, frameCount) {
             var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
             var frameIntOffset = this._frameIntArray.length;
             this._frameIntArray.length += 2;
-            this._frameIntArray[frameIntOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, 0);
+            this._frameIntArray[frameIntOffset++] = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true) ? 1 : 0;
             this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0);
             return frameOffset;
         };
@@ -13269,6 +13393,57 @@ var dragonBones;
             }
             return actions;
         };
+        ObjectDataParser.prototype._parseDeformFrame = function (rawData, frameStart, frameCount) {
+            var frameFloatOffset = this._frameFloatArray.length;
+            var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount);
+            var rawVertices = dragonBones.DataParser.VERTICES in rawData ?
+                rawData[dragonBones.DataParser.VERTICES] :
+                (dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : null);
+            var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint
+            var vertexCount = this._intArray[this._geometry.offset + 0 /* GeometryVertexCount */];
+            var weight = this._geometry.weight;
+            var x = 0.0;
+            var y = 0.0;
+            if (weight !== null) {
+                // TODO
+            }
+            else {
+                this._frameFloatArray.length += vertexCount * 2;
+                for (var i = 0; i < vertexCount * 2; i += 2) {
+                    if (rawVertices !== null) {
+                        if (i < offset || i - offset >= rawVertices.length) {
+                            x = 0.0;
+                        }
+                        else {
+                            x = rawVertices[i - offset];
+                        }
+                        if (i + 1 < offset || i + 1 - offset >= rawVertices.length) {
+                            y = 0.0;
+                        }
+                        else {
+                            y = rawVertices[i + 1 - offset];
+                        }
+                    }
+                    else {
+                        x = 0.0;
+                        y = 0.0;
+                    }
+                    this._frameFloatArray[frameFloatOffset + i] = x;
+                    this._frameFloatArray[frameFloatOffset + i + 1] = y;
+                }
+            }
+            if (frameStart === 0) {
+                var frameIntOffset = this._frameIntArray.length;
+                this._frameIntArray.length += 1 + 1 + 1 + 1 + 1;
+                this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._geometry.offset;
+                this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset;
+                this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset;
+                this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0;
+                this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset;
+                this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset;
+            }
+            return frameOffset;
+        };
         ObjectDataParser.prototype._parseTransform = function (rawData, transform, scale) {
             transform.x = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0) * scale;
             transform.y = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0) * scale;
@@ -13293,6 +13468,120 @@ var dragonBones;
             color.greenOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_OFFSET, 0);
             color.blueOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_OFFSET, 0);
         };
+        ObjectDataParser.prototype._parseGeometry = function (rawData, geometry) {
+            var rawVertices = rawData[dragonBones.DataParser.VERTICES];
+            var vertexCount = Math.floor(rawVertices.length / 2); // uint
+            var triangleCount = 0;
+            var geometryOffset = this._intArray.length;
+            var verticesOffset = this._floatArray.length;
+            //
+            geometry.offset = geometryOffset;
+            geometry.data = this._data;
+            //
+            this._intArray.length += 1 + 1 + 1 + 1;
+            this._intArray[geometryOffset + 0 /* GeometryVertexCount */] = vertexCount;
+            this._intArray[geometryOffset + 2 /* GeometryFloatOffset */] = verticesOffset;
+            this._intArray[geometryOffset + 3 /* GeometryWeightOffset */] = -1; //
+            // 
+            this._floatArray.length += vertexCount * 2;
+            for (var i = 0, l = vertexCount * 2; i < l; ++i) {
+                this._floatArray[verticesOffset + i] = rawVertices[i];
+            }
+            if (dragonBones.DataParser.TRIANGLES in rawData) {
+                var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES];
+                triangleCount = Math.floor(rawTriangles.length / 3); // uint
+                //
+                this._intArray.length += triangleCount * 3;
+                for (var i = 0, l = triangleCount * 3; i < l; ++i) {
+                    this._intArray[geometryOffset + 4 /* GeometryVertexIndices */ + i] = rawTriangles[i];
+                }
+            }
+            // Fill triangle count.
+            this._intArray[geometryOffset + 1 /* GeometryTriangleCount */] = triangleCount;
+            if (dragonBones.DataParser.UVS in rawData) {
+                var rawUVs = rawData[dragonBones.DataParser.UVS];
+                var uvOffset = verticesOffset + vertexCount * 2;
+                this._floatArray.length += vertexCount * 2;
+                for (var i = 0, l = vertexCount * 2; i < l; ++i) {
+                    this._floatArray[uvOffset + i] = rawUVs[i];
+                }
+            }
+            if (dragonBones.DataParser.WEIGHTS in rawData) {
+                var rawWeights = rawData[dragonBones.DataParser.WEIGHTS];
+                var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint
+                var weightOffset = this._intArray.length;
+                var floatOffset = this._floatArray.length;
+                var weightBoneCount = 0;
+                var sortedBones = this._armature.sortedBones;
+                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
+                weight.count = weightCount;
+                weight.offset = weightOffset;
+                this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount;
+                this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset;
+                if (dragonBones.DataParser.BONE_POSE in rawData) {
+                    var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE];
+                    var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE];
+                    var weightBoneIndices = new Array();
+                    weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint
+                    weightBoneIndices.length = weightBoneCount;
+                    for (var i = 0; i < weightBoneCount; ++i) {
+                        var rawBoneIndex = rawBonePoses[i * 7]; // uint
+                        var bone = this._rawBones[rawBoneIndex];
+                        weight.addBone(bone);
+                        weightBoneIndices[i] = rawBoneIndex;
+                        this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
+                    }
+                    this._floatArray.length += weightCount * 3;
+                    this._helpMatrixA.copyFromArray(rawSlotPose, 0);
+                    for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) {
+                        var iD = i * 2;
+                        var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint
+                        var x = this._floatArray[verticesOffset + iD];
+                        var y = this._floatArray[verticesOffset + iD + 1];
+                        this._helpMatrixA.transformPoint(x, y, this._helpPoint);
+                        x = this._helpPoint.x;
+                        y = this._helpPoint.y;
+                        for (var j = 0; j < vertexBoneCount; ++j) {
+                            var rawBoneIndex = rawWeights[iW++]; // uint
+                            var boneIndex = weightBoneIndices.indexOf(rawBoneIndex);
+                            this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1);
+                            this._helpMatrixB.invert();
+                            this._helpMatrixB.transformPoint(x, y, this._helpPoint);
+                            this._intArray[iB++] = boneIndex;
+                            this._floatArray[iV++] = rawWeights[iW++];
+                            this._floatArray[iV++] = this._helpPoint.x;
+                            this._floatArray[iV++] = this._helpPoint.y;
+                        }
+                    }
+                }
+                else {
+                    var rawBones = rawData[dragonBones.DataParser.BONES];
+                    weightBoneCount = rawBones.length;
+                    for (var i = 0; i < weightBoneCount; i++) {
+                        var rawBoneIndex = rawBones[i];
+                        var bone = this._rawBones[rawBoneIndex];
+                        weight.addBone(bone);
+                        this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone);
+                    }
+                    this._floatArray.length += weightCount * 3;
+                    for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) {
+                        var vertexBoneCount = rawWeights[iW++];
+                        this._intArray[iB++] = vertexBoneCount;
+                        for (var j = 0; j < vertexBoneCount; j++) {
+                            var boneIndex = rawWeights[iW++];
+                            var boneWeight = rawWeights[iW++];
+                            var x = rawVertices[iV++];
+                            var y = rawVertices[iV++];
+                            this._intArray[iB++] = rawBones.indexOf(boneIndex);
+                            this._floatArray[iF++] = boneWeight;
+                            this._floatArray[iF++] = x;
+                            this._floatArray[iF++] = y;
+                        }
+                    }
+                }
+                geometry.weight = weight;
+            }
+        };
         ObjectDataParser.prototype._parseArray = function (rawData) {
             // tslint:disable-next-line:no-unused-expression
             rawData;
@@ -13302,6 +13591,7 @@ var dragonBones;
             this._frameFloatArray.length = 0;
             this._frameArray.length = 0;
             this._timelineArray.length = 0;
+            this._colorArray.length = 0;
         };
         ObjectDataParser.prototype._modifyArray = function () {
             // Align.
@@ -13317,76 +13607,55 @@ var dragonBones;
             if ((this._timelineArray.length % Uint16Array.BYTES_PER_ELEMENT) !== 0) {
                 this._timelineArray.push(0);
             }
+            if ((this._timelineArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) {
+                this._colorArray.push(0);
+            }
             var l1 = this._intArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l2 = this._floatArray.length * Float32Array.BYTES_PER_ELEMENT;
             var l3 = this._frameIntArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l4 = this._frameFloatArray.length * Float32Array.BYTES_PER_ELEMENT;
             var l5 = this._frameArray.length * Int16Array.BYTES_PER_ELEMENT;
             var l6 = this._timelineArray.length * Uint16Array.BYTES_PER_ELEMENT;
-            var lTotal = l1 + l2 + l3 + l4 + l5 + l6;
-            if (dragonBones.DragonBones.webAssembly) {
-                var shareBuffer = dragonBones.webAssemblyModule.HEAP16.buffer;
-                var bufferPointer = dragonBones.webAssemblyModule._malloc(lTotal);
-                var intArray = new Int16Array(shareBuffer, bufferPointer, this._intArray.length);
-                var floatArray = new Float32Array(shareBuffer, bufferPointer + l1, this._floatArray.length);
-                var frameIntArray = new Int16Array(shareBuffer, bufferPointer + l1 + l2, this._frameIntArray.length);
-                var frameFloatArray = new Float32Array(shareBuffer, bufferPointer + l1 + l2 + l3, this._frameFloatArray.length);
-                var frameArray = new Int16Array(shareBuffer, bufferPointer + l1 + l2 + l3 + l4, this._frameArray.length);
-                var timelineArray = new Uint16Array(shareBuffer, bufferPointer + l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
-                for (var i = 0, l = this._intArray.length; i < l; ++i) {
-                    intArray[i] = this._intArray[i];
-                }
-                for (var i = 0, l = this._floatArray.length; i < l; ++i) {
-                    floatArray[i] = this._floatArray[i];
-                }
-                for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
-                    frameIntArray[i] = this._frameIntArray[i];
-                }
-                for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
-                    frameFloatArray[i] = this._frameFloatArray[i];
-                }
-                for (var i = 0, l = this._frameArray.length; i < l; ++i) {
-                    frameArray[i] = this._frameArray[i];
-                }
-                for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
-                    timelineArray[i] = this._timelineArray[i];
-                }
-                dragonBones.webAssemblyModule.setDataBinary(this._data, bufferPointer, l1, l2, l3, l4, l5, l6);
-            }
-            else {
-                var binary = new ArrayBuffer(lTotal);
-                var intArray = new Int16Array(binary, 0, this._intArray.length);
-                var floatArray = new Float32Array(binary, l1, this._floatArray.length);
-                var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length);
-                var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length);
-                var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length);
-                var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
-                for (var i = 0, l = this._intArray.length; i < l; ++i) {
-                    intArray[i] = this._intArray[i];
-                }
-                for (var i = 0, l = this._floatArray.length; i < l; ++i) {
-                    floatArray[i] = this._floatArray[i];
-                }
-                for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
-                    frameIntArray[i] = this._frameIntArray[i];
-                }
-                for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
-                    frameFloatArray[i] = this._frameFloatArray[i];
-                }
-                for (var i = 0, l = this._frameArray.length; i < l; ++i) {
-                    frameArray[i] = this._frameArray[i];
-                }
-                for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
-                    timelineArray[i] = this._timelineArray[i];
-                }
-                this._data.binary = binary;
-                this._data.intArray = intArray;
-                this._data.floatArray = floatArray;
-                this._data.frameIntArray = frameIntArray;
-                this._data.frameFloatArray = frameFloatArray;
-                this._data.frameArray = frameArray;
-                this._data.timelineArray = timelineArray;
-            }
+            var l7 = this._colorArray.length * Int16Array.BYTES_PER_ELEMENT;
+            var lTotal = l1 + l2 + l3 + l4 + l5 + l6 + l7;
+            //
+            var binary = new ArrayBuffer(lTotal);
+            var intArray = new Int16Array(binary, 0, this._intArray.length);
+            var floatArray = new Float32Array(binary, l1, this._floatArray.length);
+            var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length);
+            var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length);
+            var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length);
+            var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length);
+            var colorArray = new Int16Array(binary, l1 + l2 + l3 + l4 + l5 + l6, this._colorArray.length);
+            for (var i = 0, l = this._intArray.length; i < l; ++i) {
+                intArray[i] = this._intArray[i];
+            }
+            for (var i = 0, l = this._floatArray.length; i < l; ++i) {
+                floatArray[i] = this._floatArray[i];
+            }
+            for (var i = 0, l = this._frameIntArray.length; i < l; ++i) {
+                frameIntArray[i] = this._frameIntArray[i];
+            }
+            for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) {
+                frameFloatArray[i] = this._frameFloatArray[i];
+            }
+            for (var i = 0, l = this._frameArray.length; i < l; ++i) {
+                frameArray[i] = this._frameArray[i];
+            }
+            for (var i = 0, l = this._timelineArray.length; i < l; ++i) {
+                timelineArray[i] = this._timelineArray[i];
+            }
+            for (var i = 0, l = this._colorArray.length; i < l; ++i) {
+                colorArray[i] = this._colorArray[i];
+            }
+            this._data.binary = binary;
+            this._data.intArray = intArray;
+            this._data.floatArray = floatArray;
+            this._data.frameIntArray = frameIntArray;
+            this._data.frameFloatArray = frameFloatArray;
+            this._data.frameArray = frameArray;
+            this._data.timelineArray = timelineArray;
+            this._data.colorArray = colorArray;
             this._defaultColorOffset = -1;
         };
         ObjectDataParser.prototype.parseDragonBonesData = function (rawData, scale) {
@@ -13459,6 +13728,8 @@ var dragonBones;
                 var rawTextures = rawData[dragonBones.DataParser.SUB_TEXTURE];
                 for (var i = 0, l = rawTextures.length; i < l; ++i) {
                     var rawTexture = rawTextures[i];
+                    var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0);
+                    var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0);
                     var textureData = textureAtlasData.createTexture();
                     textureData.rotated = ObjectDataParser._getBoolean(rawTexture, dragonBones.DataParser.ROTATED, false);
                     textureData.name = ObjectDataParser._getString(rawTexture, dragonBones.DataParser.NAME, "");
@@ -13466,8 +13737,6 @@ var dragonBones;
                     textureData.region.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.Y, 0.0);
                     textureData.region.width = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.WIDTH, 0.0);
                     textureData.region.height = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.HEIGHT, 0.0);
-                    var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0);
-                    var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0);
                     if (frameWidth > 0.0 && frameHeight > 0.0) {
                         textureData.frame = dragonBones.TextureData.createRectangle();
                         textureData.frame.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_X, 0.0);
@@ -13501,7 +13770,7 @@ var dragonBones;
     }(dragonBones.DataParser));
     dragonBones.ObjectDataParser = ObjectDataParser;
     /**
-     * @internal
+     * @private
      */
     var ActionFrame = /** @class */ (function () {
         function ActionFrame() {
@@ -13537,7 +13806,7 @@ var dragonBones;
 var dragonBones;
 (function (dragonBones) {
     /**
-     * @internal
+     * @private
      */
     var BinaryDataParser = /** @class */ (function (_super) {
         __extends(BinaryDataParser, _super);
@@ -13640,14 +13909,6 @@ var dragonBones;
             }
             return result;
         };
-        BinaryDataParser.prototype._getUTF16Key = function (value) {
-            for (var i = 0, l = value.length; i < l; ++i) {
-                if (value.charCodeAt(i) > 255) {
-                    return encodeURI(value);
-                }
-            }
-            return value;
-        };
         BinaryDataParser.prototype._parseBinaryTimeline = function (type, offset, timelineData) {
             if (timelineData === void 0) { timelineData = null; }
             var timeline = timelineData !== null ? timelineData : dragonBones.BaseObject.borrowObject(dragonBones.TimelineData);
@@ -13662,14 +13923,8 @@ var dragonBones;
                 var frameIndicesOffset = 0;
                 var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation.
                 var frameIndices = this._data.frameIndices;
-                if (dragonBones.DragonBones.webAssembly) {
-                    frameIndicesOffset = frameIndices.size();
-                    frameIndices.resize(frameIndicesOffset + totalFrameCount, 0);
-                }
-                else {
-                    frameIndicesOffset = frameIndices.length;
-                    frameIndices.length += totalFrameCount;
-                }
+                frameIndicesOffset = frameIndices.length;
+                frameIndices.length += totalFrameCount;
                 timeline.frameIndicesOffset = frameIndicesOffset;
                 for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) {
                     if (frameStart + frameCount <= i && iK < keyFrameCount) {
@@ -13682,49 +13937,16 @@ var dragonBones;
                         }
                         iK++;
                     }
-                    if (dragonBones.DragonBones.webAssembly) {
-                        frameIndices.set(frameIndicesOffset + i, iK - 1);
-                    }
-                    else {
-                        frameIndices[frameIndicesOffset + i] = iK - 1;
-                    }
+                    frameIndices[frameIndicesOffset + i] = iK - 1;
                 }
             }
             this._timeline = null; //
             return timeline;
         };
-        BinaryDataParser.prototype._parseVertices = function (rawData, vertices) {
-            vertices.offset = rawData[dragonBones.DataParser.OFFSET];
-            var weightOffset = this._intArrayBuffer[vertices.offset + 3 /* MeshWeightOffset */];
-            if (weightOffset >= 0) {
-                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
-                var vertexCount = this._intArrayBuffer[vertices.offset + 0 /* MeshVertexCount */];
-                var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */];
-                weight.offset = weightOffset;
-                for (var i = 0; i < boneCount; ++i) {
-                    var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i];
-                    weight.addBone(this._rawBones[boneIndex]);
-                }
-                var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount;
-                var weightCount = 0;
-                for (var i = 0, l = vertexCount; i < l; ++i) {
-                    var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++];
-                    weightCount += vertexBoneCount;
-                    boneIndicesOffset += vertexBoneCount;
-                }
-                weight.count = weightCount;
-                vertices.weight = weight;
-            }
-        };
-        BinaryDataParser.prototype._parseMesh = function (rawData, mesh) {
-            this._parseVertices(rawData, mesh.vertices);
-        };
-        BinaryDataParser.prototype._parsePath = function (rawData, path) {
-            this._parseVertices(rawData, path.vertices);
-        };
         BinaryDataParser.prototype._parseAnimation = function (rawData) {
             var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData);
-            animation.frameCount = Math.max(dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 1), 1);
+            animation.blendType = dragonBones.DataParser._getAnimationBlendType(dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, ""));
+            animation.frameCount = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0);
             animation.playTimes = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1);
             animation.duration = animation.frameCount / this._armature.frameRate; // float
             animation.fadeInTime = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0);
@@ -13749,9 +13971,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.BONE];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var bone = this._armature.getBone(k);
                     if (bone === null) {
                         continue;
@@ -13760,26 +13979,7 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addBoneTimeline(bone, timeline);
-                    }
-                }
-            }
-            if (dragonBones.DataParser.SURFACE in rawData) {
-                var rawTimeliness = rawData[dragonBones.DataParser.SURFACE];
-                for (var k in rawTimeliness) {
-                    var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
-                    var surface = this._armature.getBone(k);
-                    if (surface === null) {
-                        continue;
-                    }
-                    for (var i = 0, l = rawTimelines.length; i < l; i += 2) {
-                        var timelineType = rawTimelines[i];
-                        var timelineOffset = rawTimelines[i + 1];
-                        var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addSurfaceTimeline(surface, timeline);
+                        this._animation.addBoneTimeline(bone.name, timeline);
                     }
                 }
             }
@@ -13787,9 +13987,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.SLOT];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var slot = this._armature.getSlot(k);
                     if (slot === null) {
                         continue;
@@ -13798,7 +13995,7 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addSlotTimeline(slot, timeline);
+                        this._animation.addSlotTimeline(slot.name, timeline);
                     }
                 }
             }
@@ -13806,9 +14003,6 @@ var dragonBones;
                 var rawTimeliness = rawData[dragonBones.DataParser.CONSTRAINT];
                 for (var k in rawTimeliness) {
                     var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
                     var constraint = this._armature.getConstraint(k);
                     if (constraint === null) {
                         continue;
@@ -13817,28 +14011,86 @@ var dragonBones;
                         var timelineType = rawTimelines[i];
                         var timelineOffset = rawTimelines[i + 1];
                         var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addConstraintTimeline(constraint, timeline);
-                    }
-                }
-            }
-            if (dragonBones.DataParser.ANIMATION in rawData) {
-                var rawTimeliness = rawData[dragonBones.DataParser.ANIMATION];
-                for (var k in rawTimeliness) {
-                    var rawTimelines = rawTimeliness[k];
-                    if (dragonBones.DragonBones.webAssembly) {
-                        k = this._getUTF16Key(k);
-                    }
-                    for (var i = 0, l = rawTimelines.length; i < l; i += 2) {
-                        var timelineType = rawTimelines[i];
-                        var timelineOffset = rawTimelines[i + 1];
-                        var timeline = this._parseBinaryTimeline(timelineType, timelineOffset);
-                        this._animation.addAnimationTimeline(k, timeline);
+                        this._animation.addConstraintTimeline(constraint.name, timeline);
+                    }
+                }
+            }
+            if (dragonBones.DataParser.TIMELINE in rawData) {
+                var rawTimelines = rawData[dragonBones.DataParser.TIMELINE];
+                for (var _i = 0, rawTimelines_6 = rawTimelines; _i < rawTimelines_6.length; _i++) {
+                    var rawTimeline = rawTimelines_6[_i];
+                    var timelineOffset = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.OFFSET, 0);
+                    if (timelineOffset >= 0) {
+                        var timelineType = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */);
+                        var timelineName = dragonBones.ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, "");
+                        var timeline = null;
+                        if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) {
+                            timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData);
+                            var animaitonTimeline = timeline;
+                            animaitonTimeline.x = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0);
+                            animaitonTimeline.y = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0);
+                        }
+                        timeline = this._parseBinaryTimeline(timelineType, timelineOffset, timeline);
+                        switch (timelineType) {
+                            case 0 /* Action */:
+                                // TODO
+                                break;
+                            case 1 /* ZOrder */:
+                                // TODO
+                                break;
+                            case 11 /* BoneTranslate */:
+                            case 12 /* BoneRotate */:
+                            case 13 /* BoneScale */:
+                            case 50 /* Surface */:
+                            case 60 /* BoneAlpha */:
+                                this._animation.addBoneTimeline(timelineName, timeline);
+                                break;
+                            case 20 /* SlotDisplay */:
+                            case 21 /* SlotColor */:
+                            case 22 /* SlotDeform */:
+                            case 23 /* SlotZIndex */:
+                            case 24 /* SlotAlpha */:
+                                this._animation.addSlotTimeline(timelineName, timeline);
+                                break;
+                            case 30 /* IKConstraint */:
+                                this._animation.addConstraintTimeline(timelineName, timeline);
+                                break;
+                            case 40 /* AnimationProgress */:
+                            case 41 /* AnimationWeight */:
+                            case 42 /* AnimationParameter */:
+                                this._animation.addAnimationTimeline(timelineName, timeline);
+                                break;
+                        }
                     }
                 }
             }
             this._animation = null;
             return animation;
         };
+        BinaryDataParser.prototype._parseGeometry = function (rawData, geometry) {
+            geometry.offset = rawData[dragonBones.DataParser.OFFSET];
+            geometry.data = this._data;
+            var weightOffset = this._intArrayBuffer[geometry.offset + 3 /* GeometryWeightOffset */];
+            if (weightOffset >= 0) {
+                var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData);
+                var vertexCount = this._intArrayBuffer[geometry.offset + 0 /* GeometryVertexCount */];
+                var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */];
+                weight.offset = weightOffset;
+                for (var i = 0; i < boneCount; ++i) {
+                    var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i];
+                    weight.addBone(this._rawBones[boneIndex]);
+                }
+                var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount;
+                var weightCount = 0;
+                for (var i = 0, l = vertexCount; i < l; ++i) {
+                    var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++];
+                    weightCount += vertexBoneCount;
+                    boneIndicesOffset += vertexBoneCount;
+                }
+                weight.count = weightCount;
+                geometry.weight = weight;
+            }
+        };
         BinaryDataParser.prototype._parseArray = function (rawData) {
             var offsets = rawData[dragonBones.DataParser.OFFSET];
             var l1 = offsets[1];
@@ -13847,37 +14099,22 @@ var dragonBones;
             var l4 = offsets[7];
             var l5 = offsets[9];
             var l6 = offsets[11];
+            var l7 = offsets.length > 12 ? offsets[13] : 0; // Color.
             var intArray = new Int16Array(this._binary, this._binaryOffset + offsets[0], l1 / Int16Array.BYTES_PER_ELEMENT);
             var floatArray = new Float32Array(this._binary, this._binaryOffset + offsets[2], l2 / Float32Array.BYTES_PER_ELEMENT);
             var frameIntArray = new Int16Array(this._binary, this._binaryOffset + offsets[4], l3 / Int16Array.BYTES_PER_ELEMENT);
             var frameFloatArray = new Float32Array(this._binary, this._binaryOffset + offsets[6], l4 / Float32Array.BYTES_PER_ELEMENT);
             var frameArray = new Int16Array(this._binary, this._binaryOffset + offsets[8], l5 / Int16Array.BYTES_PER_ELEMENT);
             var timelineArray = new Uint16Array(this._binary, this._binaryOffset + offsets[10], l6 / Uint16Array.BYTES_PER_ELEMENT);
-            if (dragonBones.DragonBones.webAssembly) {
-                var lTotal = l1 + l2 + l3 + l4 + l5 + l6;
-                var bufferPointer = dragonBones.webAssemblyModule._malloc(lTotal);
-                var rawArray = new Uint8Array(this._binary, this._binaryOffset, lTotal / Uint8Array.BYTES_PER_ELEMENT);
-                var copyArray = new Uint8Array(dragonBones.webAssemblyModule.HEAP16.buffer, bufferPointer, rawArray.length);
-                for (var i = 0, l = rawArray.length; i < l; ++i) {
-                    copyArray[i] = rawArray[i];
-                }
-                dragonBones.webAssemblyModule.setDataBinary(this._data, bufferPointer, l1, l2, l3, l4, l5, l6);
-                this._intArrayBuffer = intArray;
-                this._floatArrayBuffer = floatArray;
-                this._frameIntArrayBuffer = frameIntArray;
-                this._frameFloatArrayBuffer = frameFloatArray;
-                this._frameArrayBuffer = frameArray;
-                this._timelineArrayBuffer = timelineArray;
-            }
-            else {
-                this._data.binary = this._binary;
-                this._data.intArray = this._intArrayBuffer = intArray;
-                this._data.floatArray = this._floatArrayBuffer = floatArray;
-                this._data.frameIntArray = this._frameIntArrayBuffer = frameIntArray;
-                this._data.frameFloatArray = this._frameFloatArrayBuffer = frameFloatArray;
-                this._data.frameArray = this._frameArrayBuffer = frameArray;
-                this._data.timelineArray = this._timelineArrayBuffer = timelineArray;
-            }
+            var colorArray = l7 > 0 ? new Int16Array(this._binary, this._binaryOffset + offsets[12], l7 / Int16Array.BYTES_PER_ELEMENT) : intArray; // Color.
+            this._data.binary = this._binary;
+            this._data.intArray = this._intArrayBuffer = intArray;
+            this._data.floatArray = floatArray;
+            this._data.frameIntArray = frameIntArray;
+            this._data.frameFloatArray = frameFloatArray;
+            this._data.frameArray = this._frameArrayBuffer = frameArray;
+            this._data.timelineArray = this._timelineArrayBuffer = timelineArray;
+            this._data.colorArray = colorArray;
         };
         BinaryDataParser.prototype.parseDragonBonesData = function (rawData, scale) {
             if (scale === void 0) { scale = 1; }
@@ -14101,20 +14338,23 @@ var dragonBones;
                 var slotData = _a[_i];
                 var displayDatas = slotData.name in skinSlots ? skinSlots[slotData.name] : null;
                 var slot = this._buildSlot(dataPackage, slotData, armature);
-                slot.rawDisplayDatas = displayDatas;
                 if (displayDatas !== null) {
-                    var displayList = new Array();
-                    // for (const displayData of displays) 
-                    for (var i = 0, l = dragonBones.DragonBones.webAssembly ? displayDatas.size() : displayDatas.length; i < l; ++i) {
-                        var displayData = dragonBones.DragonBones.webAssembly ? displayDatas.get(i) : displayDatas[i];
+                    slot.displayFrameCount = displayDatas.length;
+                    for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                        var displayData = displayDatas[i];
+                        slot.replaceRawDisplayData(displayData, i);
                         if (displayData !== null) {
-                            displayList.push(this._getSlotDisplay(dataPackage, displayData, null, slot));
+                            if (dataPackage.textureAtlasName.length > 0) {
+                                var textureData = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
+                                slot.replaceTextureData(textureData, i);
+                            }
+                            var display = this._getSlotDisplay(dataPackage, displayData, slot);
+                            slot.replaceDisplay(display, i);
                         }
                         else {
-                            displayList.push(null);
+                            slot.replaceDisplay(null);
                         }
                     }
-                    slot._setDisplayList(displayList);
                 }
                 slot._setDisplayIndex(slotData.displayIndex, true);
             }
@@ -14143,12 +14383,10 @@ var dragonBones;
                 }
             }
         };
-        BaseFactory.prototype._buildChildArmature = function (dataPackage, slot, displayData) {
-            // tslint:disable-next-line:no-unused-expression
-            slot;
+        BaseFactory.prototype._buildChildArmature = function (dataPackage, _slot, displayData) {
             return this.buildArmature(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage !== null ? dataPackage.textureAtlasName : "");
         };
-        BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, rawDisplayData, slot) {
+        BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, slot) {
             var dataName = dataPackage !== null ? dataPackage.dataName : displayData.parent.parent.parent.name;
             var display = null;
             switch (displayData.type) {
@@ -14157,15 +14395,7 @@ var dragonBones;
                     if (imageDisplayData.texture === null) {
                         imageDisplayData.texture = this._getTextureData(dataName, displayData.path);
                     }
-                    else if (dataPackage !== null && dataPackage.textureAtlasName.length > 0) {
-                        imageDisplayData.texture = this._getTextureData(dataPackage.textureAtlasName, displayData.path);
-                    }
-                    if (rawDisplayData !== null && rawDisplayData.type === 2 /* Mesh */ && this._isSupportMesh()) {
-                        display = slot.meshDisplay;
-                    }
-                    else {
-                        display = slot.rawDisplay;
-                    }
+                    display = slot.rawDisplay;
                     break;
                 }
                 case 2 /* Mesh */: {
@@ -14173,9 +14403,6 @@ var dragonBones;
                     if (meshDisplayData.texture === null) {
                         meshDisplayData.texture = this._getTextureData(dataName, meshDisplayData.path);
                     }
-                    else if (dataPackage !== null && dataPackage.textureAtlasName.length > 0) {
-                        meshDisplayData.texture = this._getTextureData(dataPackage.textureAtlasName, meshDisplayData.path);
-                    }
                     if (this._isSupportMesh()) {
                         display = slot.meshDisplay;
                     }
@@ -14186,7 +14413,7 @@ var dragonBones;
                 }
                 case 1 /* Armature */: {
                     var armatureDisplayData = displayData;
-                    var childArmature = this._buildChildArmature(dataPackage, slot, displayData);
+                    var childArmature = this._buildChildArmature(dataPackage, slot, armatureDisplayData);
                     if (childArmature !== null) {
                         childArmature.inheritAnimation = armatureDisplayData.inheritAnimation;
                         if (!childArmature.inheritAnimation) {
@@ -14300,9 +14527,20 @@ var dragonBones;
             return textureAtlasData;
         };
         /**
-         * @private
+         * - Update texture atlases.
+         * @param textureAtlases - The texture atlas objects.
+         * @param name - The texture atlas name.
+         * @version DragonBones 5.7
+         * @language en_US
          */
-        BaseFactory.prototype.updateTextureAtlasData = function (name, textureAtlases) {
+        /**
+         * - 更新贴图集对象。
+         * @param textureAtlases - 多个贴图集对象。
+         * @param name - 贴图集名称。
+         * @version DragonBones 5.7
+         * @language zh_CN
+         */
+        BaseFactory.prototype.updateTextureAtlases = function (textureAtlases, name) {
             var textureAtlasDatas = this.getTextureAtlasData(name);
             if (textureAtlasDatas !== null) {
                 for (var i = 0, l = textureAtlasDatas.length; i < l; ++i) {
@@ -14608,36 +14846,20 @@ var dragonBones;
                 displayIndex = 0;
             }
             slot.replaceDisplayData(displayData, displayIndex);
-            var displayList = slot.displayList; // Copy.
-            if (displayList.length <= displayIndex) {
-                displayList.length = displayIndex + 1;
-                for (var i = 0, l = displayList.length; i < l; ++i) {
-                    if (!displayList[i]) {
-                        displayList[i] = null;
-                    }
-                }
-            }
             if (displayData !== null) {
-                var rawDisplayDatas = slot.rawDisplayDatas;
-                var rawDisplayData = null;
-                if (rawDisplayDatas) {
-                    if (dragonBones.DragonBones.webAssembly) {
-                        if (displayIndex < rawDisplayDatas.size()) {
-                            rawDisplayData = rawDisplayDatas.get(displayIndex);
-                        }
-                    }
-                    else {
-                        if (displayIndex < rawDisplayDatas.length) {
-                            rawDisplayData = rawDisplayDatas[displayIndex];
-                        }
+                var display = this._getSlotDisplay(null, displayData, slot);
+                if (displayData.type === 0 /* Image */) {
+                    var rawDisplayData = slot.getDisplayFrameAt(displayIndex).rawDisplayData;
+                    if (rawDisplayData !== null &&
+                        rawDisplayData.type === 2 /* Mesh */) {
+                        display = slot.meshDisplay;
                     }
                 }
-                displayList[displayIndex] = this._getSlotDisplay(null, displayData, rawDisplayData, slot);
+                slot.replaceDisplay(display, displayIndex);
             }
             else {
-                displayList[displayIndex] = null;
+                slot.replaceDisplay(null, displayIndex);
             }
-            slot.displayList = displayList;
         };
         /**
          * - Replaces the current display data for a particular slot with a specific display data.
@@ -14676,13 +14898,10 @@ var dragonBones;
         BaseFactory.prototype.replaceSlotDisplay = function (dragonBonesName, armatureName, slotName, displayName, slot, displayIndex) {
             if (displayIndex === void 0) { displayIndex = -1; }
             var armatureData = this.getArmatureData(armatureName, dragonBonesName || "");
-            if (!armatureData || !armatureData.defaultSkin) {
+            if (armatureData === null || armatureData.defaultSkin === null) {
                 return false;
             }
             var displayData = armatureData.defaultSkin.getDisplay(slotName, displayName);
-            if (!displayData) {
-                return false;
-            }
             this.replaceDisplay(slot, displayData, displayIndex);
             return true;
         };
@@ -14694,15 +14913,14 @@ var dragonBones;
             if (!armatureData || !armatureData.defaultSkin) {
                 return false;
             }
-            var displays = armatureData.defaultSkin.getDisplays(slotName);
-            if (!displays) {
+            var displayDatas = armatureData.defaultSkin.getDisplays(slotName);
+            if (!displayDatas) {
                 return false;
             }
-            var displayIndex = 0;
-            // for (const displayData of displays) 
-            for (var i = 0, l = dragonBones.DragonBones.webAssembly ? displays.size() : displays.length; i < l; ++i) {
-                var displayData = dragonBones.DragonBones.webAssembly ? displays.get(i) : displays[i];
-                this.replaceDisplay(slot, displayData, displayIndex++);
+            slot.displayFrameCount = displayDatas.length;
+            for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                var displayData = displayDatas[i];
+                this.replaceDisplay(slot, displayData, i);
             }
             return true;
         };
@@ -14754,34 +14972,30 @@ var dragonBones;
                 if (exclude !== null && exclude.indexOf(slot.name) >= 0) {
                     continue;
                 }
-                var displays = skin.getDisplays(slot.name);
-                if (!displays) {
+                var displayDatas = skin.getDisplays(slot.name);
+                if (displayDatas === null) {
                     if (defaultSkin !== null && skin !== defaultSkin) {
-                        displays = defaultSkin.getDisplays(slot.name);
+                        displayDatas = defaultSkin.getDisplays(slot.name);
                     }
-                    if (!displays) {
+                    if (displayDatas === null) {
                         if (isOverride) {
-                            slot.rawDisplayDatas = null;
-                            slot.displayList = []; //
+                            slot.displayFrameCount = 0;
                         }
                         continue;
                     }
                 }
-                var displayCount = dragonBones.DragonBones.webAssembly ? displays.size() : displays.length;
-                var displayList = slot.displayList; // Copy.
-                displayList.length = displayCount; // Modify displayList length.
-                for (var i = 0, l = displayCount; i < l; ++i) {
-                    var displayData = dragonBones.DragonBones.webAssembly ? displays.get(i) : displays[i];
+                slot.displayFrameCount = displayDatas.length;
+                for (var i = 0, l = slot.displayFrameCount; i < l; ++i) {
+                    var displayData = displayDatas[i];
+                    slot.replaceRawDisplayData(displayData, i);
                     if (displayData !== null) {
-                        displayList[i] = this._getSlotDisplay(null, displayData, null, slot);
+                        slot.replaceDisplay(this._getSlotDisplay(null, displayData, slot), i);
                     }
                     else {
-                        displayList[i] = null;
+                        slot.replaceDisplay(null, i);
                     }
                 }
                 success = true;
-                slot.rawDisplayDatas = displays;
-                slot.displayList = displayList;
             }
             return success;
         };
@@ -14850,8 +15064,8 @@ var dragonBones;
                     var display = _c[_b];
                     if (display instanceof dragonBones.Armature) {
                         var displayDatas = skinData.getDisplays(slot.name);
-                        if (displayDatas !== null && index < (dragonBones.DragonBones.webAssembly ? displayDatas.size() : displayDatas.length)) {
-                            var displayData = dragonBones.DragonBones.webAssembly ? displayDatas.get(index) : displayDatas[index];
+                        if (displayDatas !== null && index < displayDatas.length) {
+                            var displayData = displayDatas[index];
                             if (displayData !== null && displayData.type === 1 /* Armature */) {
                                 var childArmatureData = this.getArmatureData(displayData.path, displayData.parent.parent.parent.name);
                                 if (childArmatureData) {
@@ -14904,49 +15118,13 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * - Deprecated, please refer to {@link #replaceSkin}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceSkin}。
-         * @deprecated
-         * @language zh_CN
-         */
-        BaseFactory.prototype.changeSkin = function (armature, skin, exclude) {
-            if (exclude === void 0) { exclude = null; }
-            return this.replaceSkin(armature, skin, false, exclude);
-        };
-        /**
-         * - Deprecated, please refer to {@link #replaceAnimation}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #replaceAnimation}。
-         * @deprecated
-         * @language zh_CN
-         */
-        BaseFactory.prototype.copyAnimationsToArmature = function (toArmature, fromArmatreName, fromSkinName, fromDragonBonesDataName, replaceOriginalAnimation) {
-            if (fromSkinName === void 0) { fromSkinName = ""; }
-            if (fromDragonBonesDataName === void 0) { fromDragonBonesDataName = ""; }
-            if (replaceOriginalAnimation === void 0) { replaceOriginalAnimation = true; }
-            // tslint:disable-next-line:no-unused-expression
-            fromSkinName;
-            var armatureData = this.getArmatureData(fromArmatreName, fromDragonBonesDataName);
-            if (!armatureData) {
-                return false;
-            }
-            return this.replaceAnimation(toArmature, armatureData, replaceOriginalAnimation);
-        };
         BaseFactory._objectParser = null;
         BaseFactory._binaryParser = null;
         return BaseFactory;
     }());
     dragonBones.BaseFactory = BaseFactory;
     /**
-     * @internal
+     * @private
      */
     var BuildArmaturePackage = /** @class */ (function () {
         function BuildArmaturePackage() {
@@ -15037,8 +15215,7 @@ var dragonBones;
                 if (this._renderTexture !== null) {
                     for (var k in this.textures) {
                         var textureData = this.textures[k];
-                        textureData.renderTexture = new PIXI.Texture(this._renderTexture, textureData.region, // No need to set frame.
-                        textureData.region, new PIXI.Rectangle(0, 0, textureData.region.width, textureData.region.height), textureData.rotated // .d.ts bug
+                        textureData.renderTexture = new PIXI.Texture(this._renderTexture, new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height), new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height), new PIXI.Rectangle(0, 0, textureData.region.width, textureData.region.height), textureData.rotated // .d.ts bug
                         );
                     }
                 }
@@ -15287,24 +15464,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        /**
-         * @inheritDoc
-         */
-        PixiArmatureDisplay.prototype.hasEvent = function (type) {
-            return this.hasDBEventListener(type);
-        };
-        /**
-         * @inheritDoc
-         */
-        PixiArmatureDisplay.prototype.addEvent = function (type, listener, target) {
-            this.addDBEventListener(type, listener, target);
-        };
-        /**
-         * @inheritDoc
-         */
-        PixiArmatureDisplay.prototype.removeEvent = function (type, listener, target) {
-            this.removeDBEventListener(type, listener, target);
-        };
         return PixiArmatureDisplay;
     }(PIXI.Sprite));
     dragonBones.PixiArmatureDisplay = PixiArmatureDisplay;
@@ -15439,7 +15598,8 @@ var dragonBones;
             // TODO child armature.
         };
         PixiSlot.prototype._updateColor = function () {
-            this._renderDisplay.alpha = this._colorTransform.alphaMultiplier;
+            var alpha = this._colorTransform.alphaMultiplier * this._globalAlpha;
+            this._renderDisplay.alpha = alpha;
             if (this._renderDisplay instanceof PIXI.Sprite || this._renderDisplay instanceof PIXI.mesh.Mesh) {
                 var color = (Math.round(this._colorTransform.redMultiplier * 0xFF) << 16) + (Math.round(this._colorTransform.greenMultiplier * 0xFF) << 8) + Math.round(this._colorTransform.blueMultiplier * 0xFF);
                 this._renderDisplay.tint = color;
@@ -15447,11 +15607,10 @@ var dragonBones;
             // TODO child armature.
         };
         PixiSlot.prototype._updateFrame = function () {
-            var currentVerticesData = (this._deformVertices !== null && this._display === this._meshDisplay) ? this._deformVertices.verticesData : null;
             var currentTextureData = this._textureData;
             if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) {
                 var currentTextureAtlasData = currentTextureData.parent;
-                if (this._armature.replacedTexture !== null && this._rawDisplayDatas !== null && this._rawDisplayDatas.indexOf(this._displayData) >= 0) {
+                if (this._armature.replacedTexture !== null) {
                     if (this._armature._replaceTextureAtlasData === null) {
                         currentTextureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.PixiTextureAtlasData);
                         currentTextureAtlasData.copyFrom(currentTextureData.parent);
@@ -15465,47 +15624,52 @@ var dragonBones;
                 }
                 var renderTexture = currentTextureData.renderTexture;
                 if (renderTexture !== null) {
-                    if (currentVerticesData !== null) {
-                        var data = currentVerticesData.data;
+                    if (this._geometryData !== null) {
+                        var data = this._geometryData.data;
                         var intArray = data.intArray;
                         var floatArray = data.floatArray;
-                        var vertexCount = intArray[currentVerticesData.offset + 0 /* MeshVertexCount */];
-                        var triangleCount = intArray[currentVerticesData.offset + 1 /* MeshTriangleCount */];
-                        var vertexOffset = intArray[currentVerticesData.offset + 2 /* MeshFloatOffset */];
+                        var vertexCount = intArray[this._geometryData.offset + 0 /* GeometryVertexCount */];
+                        var triangleCount = intArray[this._geometryData.offset + 1 /* GeometryTriangleCount */];
+                        var vertexOffset = intArray[this._geometryData.offset + 2 /* GeometryFloatOffset */];
                         if (vertexOffset < 0) {
                             vertexOffset += 65536; // Fixed out of bouds bug. 
                         }
                         var uvOffset = vertexOffset + vertexCount * 2;
                         var scale = this._armature._armatureData.scale;
                         var meshDisplay = this._renderDisplay;
-                        var textureAtlasWidth = currentTextureAtlasData.width > 0.0 ? currentTextureAtlasData.width : renderTexture.width;
-                        var textureAtlasHeight = currentTextureAtlasData.height > 0.0 ? currentTextureAtlasData.height : renderTexture.height;
+                        var textureAtlasWidth = currentTextureAtlasData.width > 0.0 ? currentTextureAtlasData.width : renderTexture.baseTexture.width;
+                        var textureAtlasHeight = currentTextureAtlasData.height > 0.0 ? currentTextureAtlasData.height : renderTexture.baseTexture.height;
+                        var region = currentTextureData.region;
                         meshDisplay.vertices = new Float32Array(vertexCount * 2);
                         meshDisplay.uvs = new Float32Array(vertexCount * 2);
                         meshDisplay.indices = new Uint16Array(triangleCount * 3);
                         for (var i = 0, l = vertexCount * 2; i < l; ++i) {
                             meshDisplay.vertices[i] = floatArray[vertexOffset + i] * scale;
-                            meshDisplay.uvs[i] = floatArray[uvOffset + i];
                         }
                         for (var i = 0; i < triangleCount * 3; ++i) {
-                            meshDisplay.indices[i] = intArray[currentVerticesData.offset + 4 /* MeshVertexIndices */ + i];
+                            meshDisplay.indices[i] = intArray[this._geometryData.offset + 4 /* GeometryVertexIndices */ + i];
                         }
-                        for (var i = 0, l = meshDisplay.uvs.length; i < l; i += 2) {
-                            var u = meshDisplay.uvs[i];
-                            var v = meshDisplay.uvs[i + 1];
+                        for (var i = 0, l = vertexCount * 2; i < l; i += 2) {
+                            var u = floatArray[uvOffset + i];
+                            var v = floatArray[uvOffset + i + 1];
                             if (currentTextureData.rotated) {
-                                meshDisplay.uvs[i] = (currentTextureData.region.x + (1.0 - v) * currentTextureData.region.width) / textureAtlasWidth;
-                                meshDisplay.uvs[i + 1] = (currentTextureData.region.y + u * currentTextureData.region.height) / textureAtlasHeight;
+                                meshDisplay.uvs[i] = (region.x + (1.0 - v) * region.width) / textureAtlasWidth;
+                                meshDisplay.uvs[i + 1] = (region.y + u * region.height) / textureAtlasHeight;
                             }
                             else {
-                                meshDisplay.uvs[i] = (currentTextureData.region.x + u * currentTextureData.region.width) / textureAtlasWidth;
-                                meshDisplay.uvs[i + 1] = (currentTextureData.region.y + v * currentTextureData.region.height) / textureAtlasHeight;
+                                meshDisplay.uvs[i] = (region.x + u * region.width) / textureAtlasWidth;
+                                meshDisplay.uvs[i + 1] = (region.y + v * region.height) / textureAtlasHeight;
                             }
                         }
                         this._textureScale = 1.0;
                         meshDisplay.texture = renderTexture;
                         meshDisplay.dirty++;
                         meshDisplay.indexDirty++;
+                        var isSkinned = this._geometryData.weight !== null;
+                        var isSurface = this._parent._boneData.type !== 0 /* Bone */;
+                        if (isSkinned || isSurface) {
+                            this._identityTransform();
+                        }
                     }
                     else {
                         this._textureScale = currentTextureData.parent.scale * this._armature._armatureData.scale;
@@ -15516,7 +15680,7 @@ var dragonBones;
                     return;
                 }
             }
-            if (currentVerticesData !== null) {
+            if (this._geometryData !== null) {
                 var meshDisplay = this._renderDisplay;
                 meshDisplay.texture = null;
                 meshDisplay.x = 0.0;
@@ -15533,17 +15697,17 @@ var dragonBones;
         };
         PixiSlot.prototype._updateMesh = function () {
             var scale = this._armature._armatureData.scale;
-            var deformVertices = this._deformVertices.vertices;
-            var bones = this._deformVertices.bones;
-            var verticesData = this._deformVertices.verticesData;
-            var weightData = verticesData.weight;
-            var hasDeform = deformVertices.length > 0 && verticesData.inheritDeform;
+            var deformVertices = this._displayFrame.deformVertices;
+            var bones = this._geometryBones;
+            var geometryData = this._geometryData;
+            var weightData = geometryData.weight;
+            var hasDeform = deformVertices.length > 0 && geometryData.inheritDeform;
             var meshDisplay = this._renderDisplay;
             if (weightData !== null) {
-                var data = verticesData.data;
+                var data = geometryData.data;
                 var intArray = data.intArray;
                 var floatArray = data.floatArray;
-                var vertexCount = intArray[verticesData.offset + 0 /* MeshVertexCount */];
+                var vertexCount = intArray[geometryData.offset + 0 /* GeometryVertexCount */];
                 var weightFloatOffset = intArray[weightData.offset + 1 /* WeigthFloatOffset */];
                 if (weightFloatOffset < 0) {
                     weightFloatOffset += 65536; // Fixed out of bouds bug. 
@@ -15571,19 +15735,23 @@ var dragonBones;
                     meshDisplay.vertices[iD++] = yG;
                 }
             }
-            else if (hasDeform) {
+            else {
                 var isSurface = this._parent._boneData.type !== 0 /* Bone */;
-                var data = verticesData.data;
+                var data = geometryData.data;
                 var intArray = data.intArray;
                 var floatArray = data.floatArray;
-                var vertexCount = intArray[verticesData.offset + 0 /* MeshVertexCount */];
-                var vertexOffset = intArray[verticesData.offset + 2 /* MeshFloatOffset */];
+                var vertexCount = intArray[geometryData.offset + 0 /* GeometryVertexCount */];
+                var vertexOffset = intArray[geometryData.offset + 2 /* GeometryFloatOffset */];
                 if (vertexOffset < 0) {
                     vertexOffset += 65536; // Fixed out of bouds bug. 
                 }
                 for (var i = 0, l = vertexCount * 2; i < l; i += 2) {
-                    var x = floatArray[vertexOffset + i] * scale + deformVertices[i];
-                    var y = floatArray[vertexOffset + i + 1] * scale + deformVertices[i + 1];
+                    var x = floatArray[vertexOffset + i] * scale;
+                    var y = floatArray[vertexOffset + i + 1] * scale;
+                    if (hasDeform) {
+                        x += deformVertices[i];
+                        y += deformVertices[i + 1];
+                    }
                     if (isSurface) {
                         var matrix = this._parent._getGlobalTransformMatrix(x, y);
                         meshDisplay.vertices[i] = matrix.a * x + matrix.c * y + matrix.tx;
@@ -15596,12 +15764,6 @@ var dragonBones;
                 }
             }
         };
-        /**
-         * @internal
-         */
-        PixiSlot.prototype._updateGlueMesh = function () {
-            // TODO
-        };
         PixiSlot.prototype._updateTransform = function () {
             throw new Error();
         };
@@ -15685,19 +15847,15 @@ var dragonBones;
             if (dataParser === void 0) { dataParser = null; }
             var _this = _super.call(this, dataParser) || this;
             if (PixiFactory._dragonBonesInstance === null) {
-                PixiFactory._dragonBonesInstance = PixiFactory._createDragonBones();
+                var eventManager = new dragonBones.PixiArmatureDisplay();
+                PixiFactory._dragonBonesInstance = new dragonBones.DragonBones(eventManager);
+                PIXI.ticker.shared.add(PixiFactory._clockHandler, PixiFactory);
             }
             _this._dragonBones = PixiFactory._dragonBonesInstance;
             return _this;
         }
         PixiFactory._clockHandler = function (passedTime) {
-            PixiFactory._dragonBonesInstance.advanceTime(PIXI.ticker.shared.elapsedMS * passedTime * 0.001);
-        };
-        PixiFactory._createDragonBones = function () {
-            var eventManager = new dragonBones.PixiArmatureDisplay();
-            var dragonBonesInstance = new dragonBones.DragonBones(eventManager);
-            PIXI.ticker.shared.add(PixiFactory._clockHandler, PixiFactory);
-            return dragonBonesInstance;
+            this._dragonBonesInstance.advanceTime(PIXI.ticker.shared.elapsedMS * passedTime * 0.001);
         };
         Object.defineProperty(PixiFactory, "factory", {
             /**
@@ -15734,11 +15892,7 @@ var dragonBones;
             armature.init(dataPackage.armature, armatureDisplay, armatureDisplay, this._dragonBones);
             return armature;
         };
-        PixiFactory.prototype._buildSlot = function (dataPackage, slotData, armature) {
-            // tslint:disable-next-line:no-unused-expression
-            dataPackage;
-            // tslint:disable-next-line:no-unused-expression
-            armature;
+        PixiFactory.prototype._buildSlot = function (_dataPackage, slotData, armature) {
             var slot = dragonBones.BaseObject.borrowObject(dragonBones.PixiSlot);
             slot.init(slotData, armature, new PIXI.Sprite(), new PIXI.mesh.Mesh(null, null, null, null, PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES));
             return slot;
@@ -15750,6 +15904,8 @@ var dragonBones;
          * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature)
          * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data)
          * @returns The armature display container.
+         * @see dragonBones.IArmatureProxy
+         * @see dragonBones.BaseFactory#buildArmature
          * @version DragonBones 4.5
          * @example
          * 
@@ -15764,6 +15920,8 @@ var dragonBones;
          * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架)
          * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。 (如果未设置,则使用默认的皮肤数据)
          * @returns 骨架的显示容器。
+         * @see dragonBones.IArmatureProxy
+         * @see dragonBones.BaseFactory#buildArmature
          * @version DragonBones 4.5
          * @example
          * 
@@ -15823,23 +15981,6 @@ var dragonBones;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(PixiFactory, "clock", {
-            /**
-             * - Deprecated, please refer to {@link #clock}.
-             * @deprecated
-             * @language en_US
-             */
-            /**
-             * - 已废弃,请参考 {@link #clock}。
-             * @deprecated
-             * @language zh_CN
-             */
-            get: function () {
-                return PixiFactory.factory.clock;
-            },
-            enumerable: true,
-            configurable: true
-        });
         PixiFactory._dragonBonesInstance = null;
         PixiFactory._factory = null;
         return PixiFactory;
diff --git a/Pixi/4.x/out/dragonBones.min.js b/Pixi/4.x/out/dragonBones.min.js
index 0e096c7b..83d4dd82 100644
--- a/Pixi/4.x/out/dragonBones.min.js
+++ b/Pixi/4.x/out/dragonBones.min.js
@@ -1 +1 @@
-"use strict";var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(e,a){t(e,a);function r(){this.constructor=e}e.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}();var dragonBones;(function(t){})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(a){this._clock=new t.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=a;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var a=0,r=this._objects;a0){for(var n=0;na){i.length=a}t._maxCountMap[r]=a}else{t._defaultMaxCount=a;for(var r in t._poolsMap){var i=t._poolsMap[r];if(i.length>a){i.length=a}if(r in t._maxCountMap){t._maxCountMap[r]=a}}}};t.clearPool=function(e){if(e===void 0){e=null}if(e!==null){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){r.length=0}}else{for(var i in t._poolsMap){var r=t._poolsMap[i];r.length=0}}};t.borrowObject=function(e){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){var i=r.pop();i._isInPool=false;return i}var n=new e;n._onClear();return n};t.prototype.returnToPool=function(){this._onClear();t._returnObject(this)};t._hashCode=0;t._defaultMaxCount=3e3;t._maxCountMap={};t._poolsMap={};return t}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var f=l+t.width;var u=h+t.height;var _=a*l+i*h+s;var c=r*l+n*h+o;var m=a*f+i*h+s;var p=r*f+n*h+o;var d=a*f+i*u+s;var v=r*f+n*u+o;var y=a*l+i*u+s;var g=r*l+n*u+o;var D=0;if(_>m){D=_;_=m;m=D}if(d>y){D=d;d=y;y=D}t.x=Math.floor(_y?m:y)-t.x);if(c>p){D=c;c=p;p=D}if(v>g){D=v;v=g;g=D}t.y=Math.floor(cg?p:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}t.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};t.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};t.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};t.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};t.prototype.fromMatrix=function(e){var a=this.scaleX,r=this.scaleY;var i=t.PI_Q;this.x=e.tx;this.y=e.ty;this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);this.scaleX=this.rotation>-i&&this.rotation-i&&n=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(r>=0&&this.scaleY<0){this.scaleY=-this.scaleY;n=n-Math.PI}this.skew=n-this.rotation;return this};t.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};t.PI=Math.PI;t.PI_D=Math.PI*2;t.PI_H=Math.PI/2;t.PI_Q=Math.PI/4;t.RAD_DEG=180/Math.PI;t.DEG_RAD=Math.PI/180;return t}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.ints=[];e.floats=[];e.strings=[];return e}e.toString=function(){return"[class dragonBones.UserData]"};e.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};e.prototype.addInt=function(t){this.ints.push(t)};e.prototype.addFloat=function(t){this.floats.push(t)};e.prototype.addString=function(t){this.strings.push(t)};e.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};a.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};a.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};a.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};a.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};a.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};a.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};a.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};a.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};a.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return a}(t.BaseObject);t.ArmatureData=e;var a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.transform=new t.Transform;a.userData=null;return a}a.toString=function(){return"[class dragonBones.BoneData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.name="";this.transform.identity();this.userData=null;this.parent=null};return a}(t.BaseObject);t.BoneData=a;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.SurfaceData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.vertices.length=0};return e}(a);t.SurfaceData=r;var i=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}a.createColor=function(){return new t.ColorTransform};a.toString=function(){return"[class dragonBones.SlotData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.name="";this.color=null;this.userData=null;this.parent=null};a.DEFAULT_COLOR=new t.ColorTransform;return a}(t.BaseObject);t.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.order=0;this.name="";this.type=0;this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.scaleEnabled=false;this.bendPositive=false;this.weight=1};return e}(e);t.IKConstraintData=a;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.bones=[];return e}e.toString=function(){return"[class dragonBones.PathConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.pathSlot=null;this.pathDisplayData=null;this.bones.length=0;this.positionMode=0;this.spacingMode=1;this.rotateMode=1;this.position=0;this.spacing=0;this.rotateOffset=0;this.rotateMix=0;this.translateMix=0};e.prototype.AddBone=function(t){this.bones.push(t)};return e}(e);t.PathConstraintData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.displays={};return e}e.toString=function(){return"[class dragonBones.SkinData]"};e.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};e.rectangleIntersectsSegment=function(t,a,r,i,n,s,o,l,h,f,u){if(h===void 0){h=null}if(f===void 0){f=null}if(u===void 0){u=null}var _=t>n&&ts&&an&&rs&&i=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=this.width*.5;var h=this.height*.5;var f=e.rectangleIntersectsSegment(t,a,r,i,-l,-h,l,h,n,s,o);return f};return e}(e);t.RectangleBoundingBoxData=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.EllipseData]"};e.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,f){if(l===void 0){l=null}if(h===void 0){h=null}if(f===void 0){f=null}var u=s/o;var _=u*u;e*=u;r*=u;var c=a-t;var m=r-e;var p=Math.sqrt(c*c+m*m);var d=c/p;var v=m/p;var y=(i-t)*d+(n-e)*v;var g=y*y;var D=t*t+e*e;var b=s*s;var T=b-D+g;var A=0;if(T>=0){var P=Math.sqrt(T);var S=y-P;var O=y+P;var x=S<0?-1:S<=p?0:1;var B=O<0?-1:O<=p?0:1;var M=x*B;if(M<0){return-1}else if(M===0){if(x===-1){A=2;a=t+O*d;r=(e+O*v)/u;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(f!==null){f.x=Math.atan2(r/b*_,a/b);f.y=f.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*v)/u;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(f!==null){f.x=Math.atan2(e/b*_,t/b);f.y=f.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*v)/u;if(f!==null){f.x=Math.atan2(l.y/b*_,l.x/b)}}if(h!==null){h.x=t+O*d;h.y=(e+O*v)/u;if(f!==null){f.y=Math.atan2(h.y/b*_,h.x/b)}}}}}return A};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};e.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=e.ellipseIntersectsSegment(t,a,r,i,0,0,this.width*.5,this.height*.5,n,s,o);return l};return e}(e);t.EllipseBoundingBoxData=r;var i=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};e.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var f=e-r;var u=t*r-e*a;var _=0;var c=i[l-2];var m=i[l-1];var p=0;var d=0;var v=0;var y=0;var g=0;var D=0;for(var b=0;b=c&&B<=T||B>=T&&B<=c)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var M=(u*S-f*O)/x;if((M>=m&&M<=A||M>=A&&M<=m)&&(f===0||M>=e&&M<=r||M>=r&&M<=e)){if(s!==null){var E=B-t;if(E<0){E=-E}if(_===0){p=E;d=E;v=B;y=M;g=B;D=M;if(o!==null){o.x=Math.atan2(A-m,T-c)-Math.PI*.5;o.y=o.x}}else{if(Ed){d=E;g=B;D=M;if(o!==null){o.y=Math.atan2(A-m,T-c)-Math.PI*.5}}}_++}else{v=B;y=M;g=B;D=M;_++;if(o!==null){o.x=Math.atan2(A-m,T-c)-Math.PI*.5;o.y=o.x}break}}}c=T;m=A}if(_===1){if(n!==null){n.x=v;n.y=y}if(s!==null){s.x=v;s.y=y}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=v;n.y=y}if(s!==null){s.x=g;s.y=D}}return _};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};e.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;a=0};e.prototype.addBoneMask=function(t,e,a){if(a===void 0){a=true}var r=t.getBone(e);if(r===null){return}if(this.boneMask.indexOf(e)<0){this.boneMask.push(e)}if(a){for(var i=0,n=t.getBones();i=0){this.boneMask.splice(r,1)}if(a){var i=t.getBone(e);if(i!==null){if(this.boneMask.length>0){for(var n=0,s=t.getBones();n=0&&i.contains(o)){this.boneMask.splice(l,1)}}}else{for(var h=0,f=t.getBones();he._zOrder?1:-1};a.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZorder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};a.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};a.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};a.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};a.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};a.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};a.prototype.init=function(e,a,r,i){if(this._armatureData!==null){return}this._armatureData=e;this._animation=t.BaseObject.borrowObject(t.Animation);this._proxy=a;this._display=r;this._dragonBones=i;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};a.prototype.advanceTime=function(t){if(this._lockUpdate){return}if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty){this._slotsDirty=false;this._slots.sort(a._onSortSlots)}if(this._cacheFrameIndex<0||this._cacheFrameIndex!==e){var r=0,i=0;for(r=0,i=this._bones.length;r0){this._lockUpdate=true;for(var n=0,s=this._actions;n0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var T=o?i.y-e:i.x-t;if(T<0){T=-T}if(d===null||Th){h=T;_=n.x;c=n.y;v=D;if(s!==null){p=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=f;i.y=u;if(s!==null){s.x=m}}if(v!==null&&n!==null){n.x=_;n.y=c;if(s!==null){s.y=p}}return d};a.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};a.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};a.prototype.invalidUpdate=function(){this._transformDirty=true};a.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(a.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=n){return this.globalTransformMatrix}i=a>this._kX*(t+n)+d;m=((o*(l+1)+o*2+l+c)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=c*(h+2);var D=this._hullCache[4];var b=this._hullCache[5];var T=this._hullCache[2]-(l-c)*D;var A=this._hullCache[3]-(l-c)*b;var P=this._vertices;if(i){this._getAffineTransform(-n,d+u,r-n,u,P[g+h+2],P[g+h+3],T+D,A+b,P[g],P[g+1],e._helpTransform,y,true)}else{this._getAffineTransform(-r,d,r-n,u,T,A,P[g],P[g+1],T+D,A+b,e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else if(t>=n){if(a<-n||a>=n){return this.globalTransformMatrix}i=a>this._kX*(t-r)+d;m=((o*(l+1)+o+c)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=(c+1)*(h+2)-2;var D=this._hullCache[4];var b=this._hullCache[5];var T=this._hullCache[0]+c*D;var A=this._hullCache[1]+c*b;var P=this._vertices;if(i){this._getAffineTransform(r,d+u,r-n,u,T+D,A+b,P[g+h+2],P[g+h+3],T,A,e._helpTransform,y,true)}else{this._getAffineTransform(n,d,r-n,u,P[g],P[g+1],T,A,P[g+h+2],P[g+h+3],e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else if(a<-n){if(t<-n||t>=n){return this.globalTransformMatrix}i=a>this._kY*(t-p-f)-r;m=(o*(l+1)+_*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=_*2;var D=this._hullCache[10];var b=this._hullCache[11];var T=this._hullCache[8]+_*D;var A=this._hullCache[9]+_*b;var P=this._vertices;if(i){this._getAffineTransform(p+f,-n,f,r-n,P[g+2],P[g+3],P[g],P[g+1],T+D,A+b,e._helpTransform,y,true)}else{this._getAffineTransform(p,-r,f,r-n,T,A,T+D,A+b,P[g],P[g+1],e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else if(a>=n){if(t<-n||t>=n){return this.globalTransformMatrix}i=a>this._kY*(t-p-f)+n;m=((o*(l+1)+o+l+c)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=l*(h+2)+_*2;var D=this._hullCache[10];var b=this._hullCache[11];var T=this._hullCache[6]-(o-_)*D;var A=this._hullCache[7]-(o-_)*b;var P=this._vertices;if(i){this._getAffineTransform(p+f,r,f,r-n,T+D,A+b,T,A,P[g+2],P[g+3],e._helpTransform,y,true)}else{this._getAffineTransform(p,n,f,r-n,P[g],P[g+1],P[g+2],P[g+3],T,A,e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}else{i=a>this._k*(t-p-f)+d;m=((o*c+_)*2+(i?1:0))*7;if(this._matrixCahce[m]>0){y.copyFromArray(v,m+1)}else{var g=_*2+c*(h+2);var P=this._vertices;if(i){this._getAffineTransform(p+f,d+u,f,u,P[g+h+4],P[g+h+5],P[g+h+2],P[g+h+3],P[g+2],P[g+3],e._helpTransform,y,true)}else{this._getAffineTransform(p,d,f,u,P[g],P[g+1],P[g+2],P[g+3],P[g+h+2],P[g+h+3],e._helpTransform,y,false)}v[m]=1;v[m+1]=y.a;v[m+2]=y.b;v[m+3]=y.c;v[m+4]=y.d;v[m+5]=y.tx;v[m+6]=y.ty}}return y};e.prototype.init=function(e,a){if(this._boneData!==null){return}t.prototype.init.call(this,e,a);var r=e.segmentX;var i=e.segmentY;var n=e.vertices.length;var s=1e3;var o=200;this._dX=o*2/r;this._dY=o*2/i;this._k=-this._dY/this._dX;this._kX=-this._dY/(s-o);this._kY=-(s-o)/this._dX;this._vertices.length=n;this._deformVertices.length=n;this._matrixCahce.length=(r*i+r*2+i*2)*2*7;this._hullCache.length=10;for(var l=0;l=0&&this._cachedFrameIndices!==null){var a=this._cachedFrameIndices[t];if(a>=0&&this._cachedFrameIndex===a){this._transformDirty=false}else if(a>=0){this._transformDirty=true;this._cachedFrameIndex=a}else{if(this._hasConstraint){for(var r=0,i=this._armature._constraints;r=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var s=0,o=this._armature._constraints;s=0;if(this._localDirty){this._updateGlobalTransformMatrix(f)}if(f&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var u=1e3;var _=200;var c=2*this.global.x;var m=2*this.global.y;var p=e._helpPoint;this.globalTransformMatrix.transformPoint(u,-_,p);this._hullCache[0]=p.x;this._hullCache[1]=p.y;this._hullCache[2]=c-p.x;this._hullCache[3]=m-p.y;this.globalTransformMatrix.transformPoint(0,this._dY,p,true);this._hullCache[4]=p.x;this._hullCache[5]=p.y;this.globalTransformMatrix.transformPoint(_,u,p);this._hullCache[6]=p.x;this._hullCache[7]=p.y;this._hullCache[8]=c-p.x;this._hullCache[9]=m-p.y;this.globalTransformMatrix.transformPoint(this._dX,0,p,true);this._hullCache[10]=p.x;this._hullCache[11]=p.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return e}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a._localMatrix=new t.Matrix;a._colorTransform=new t.ColorTransform;a._displayDatas=[];a._displayList=[];a._deformVertices=null;a._rawDisplay=null;a._meshDisplay=null;return a}a.prototype._onClear=function(){e.prototype._onClear.call(this);var a=[];for(var r=0,i=this._displayList;r=0){if(this._rawDisplayDatas!==null){n=this._displayIndex=0&&this._displayIndex=0&&this._rawDisplayDatas!==null){var s=this._displayIndex0){for(var o=0,l=n;o0){if(this._displayList.length!==e.length){this._displayList.length=e.length}for(var a=0,r=e.length;a0){this._displayList.length=0}if(this._displayIndex>=0&&this._displayIndex=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._display===null){return}if(this._visibleDirty){this._visibleDirty=false;this._updateVisible()}if(this._blendModeDirty){this._blendModeDirty=false;this._updateBlendMode()}if(this._colorDirty){this._colorDirty=false;this._updateColor()}if(this._deformVertices!==null&&this._deformVertices.verticesData!==null&&this._display===this._meshDisplay){var a=this._deformVertices.verticesData.weight!==null;var r=this._parent._boneData.type!==0;if(this._deformVertices.verticesDirty||a&&this._deformVertices.isBonesUpdate()||r&&this._parent._childrenTransformDirty){this._deformVertices.verticesDirty=false;this._updateMesh()}if(a||r){return}}if(this._transformDirty){this._transformDirty=false;if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform()}};a.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._transformDirty=false;this._updateGlobalTransformMatrix(false)}};a.prototype.replaceDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){if(this._displayIndex<0){e=0}else{e=this._displayIndex}}if(this._displayDatas.length<=e){this._displayDatas.length=e+1;for(var a=0,r=this._displayDatas.length;a0){if(l===1||l===2){if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n);if(s!==null){s.x=n.x;s.y=n.y}}else if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}else{if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}if(o!==null){this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),a._helpPoint,true);o.x=Math.atan2(a._helpPoint.y,a._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),a._helpPoint,true);o.y=Math.atan2(a._helpPoint.y,a._helpPoint.x)}}return l};a.prototype.invalidUpdate=function(){this._displayDirty=true;this._transformDirty=true};Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"displayIndex",{get:function(){return this._displayIndex},set:function(t){if(this._setDisplayIndex(t)){this.update(-1)}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"name",{get:function(){return this._slotData.name},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"displayList",{get:function(){return this._displayList.concat()},set:function(e){var a=this._displayList.concat();var r=new Array;if(this._setDisplayList(e)){this.update(-1)}for(var i=0,n=a;id){continue}var T=0;for(;;D++){var A=v[D];if(p>A){continue}if(D===0){T=p/A}else{var P=v[D-1];T=(p-P)/(A-P)}break}if(D!==m){m=D;if(f&&D===c){this._computeVertices(_-4,4,0,u);this._computeVertices(0,4,4,u)}else{this._computeVertices(D*6+2,8,0,u)}}this.addCurvePosition(T,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],l,g,a)}return}if(f){_+=2;u.length=o;this._computeVertices(2,_-4,0,u);this._computeVertices(0,2,_-4,u);u[_-2]=u[0];u[_-1]=u[1]}else{c--;_-=4;u.length=_;this._computeVertices(2,_,0,u)}var S=new Array(c);d=0;var O=u[0],x=u[1],B=0,M=0,E=0,I=0,w=0,C=0;var F,R,N,k,j,L,U,Y;for(var y=0,V=2;yd){continue}for(;;D++){var z=S[D];if(W>z)continue;if(D===0)W/=z;else{var K=S[D-1];W=(W-K)/(z-K)}break}if(D!==m){m=D;var Z=D*6;O=u[Z];x=u[Z+1];B=u[Z+2];M=u[Z+3];E=u[Z+4];I=u[Z+5];w=u[Z+6];C=u[Z+7];F=(O-B*2+E)*.03;R=(x-M*2+I)*.03;N=((B-E)*3-O+w)*.006;k=((M-I)*3-x+C)*.006;j=F*2+N;L=R*2+k;U=(B-O)*.3+F+N*.16666667;Y=(M-x)*.3+R+k*.16666667;G=Math.sqrt(U*U+Y*Y);X[0]=G;for(Z=1;Z<8;Z++){U+=j;Y+=L;j+=N;L+=k;G+=Math.sqrt(U*U+Y*Y);X[Z]=G}U+=j;Y+=L;G+=Math.sqrt(U*U+Y*Y);X[8]=G;U+=j+N;Y+=L+k;G+=Math.sqrt(U*U+Y*Y);X[9]=G;H=0}W*=G;for(;;H++){var q=X[H];if(W>q)continue;if(H===0)W/=q;else{var K=X[H-1];W=H+(W-K)/(q-K)}break}this.addCurvePosition(W*.1,O,x,B,M,E,I,w,C,l,g,a)}};a.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,f,u){if(t===0){h[f]=e;h[f+1]=a;h[f+2]=0;return}if(t===1){h[f]=o;h[f+1]=l;h[f+2]=0;return}var _=1-t;var c=_*_;var m=t*t;var p=c*_;var d=c*t*3;var v=_*m*3;var y=t*m;var g=p*e+d*r+v*n+y*o;var D=p*a+d*i+v*s+y*l;h[f]=g;h[f+1]=D;if(u){h[f+2]=Math.atan2(D-(p*a+d*i+v*s),g-(p*e+d*r+v*n))}else{h[f+2]=0}};a.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.vertices.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD}}var E=this.rotateMix;var I=this.translateMix;for(var v=0,w=3;v0){var k=b.a,j=b.b,L=b.c,U=b.d,Y=void 0,V=void 0,X=void 0;if(_){Y=S[w-1]}else{Y=Math.atan2(F,C)}Y-=Math.atan2(j,k);if(M){V=Math.cos(Y);X=Math.sin(Y);var G=g._boneData.length;x+=(G*(V*k-X*j)-C)*E;B+=(G*(X*k+V*j)-F)*E}else{Y+=O}if(Y>t.Transform.PI){Y-=t.Transform.PI_D}else if(Y<-t.Transform.PI){Y+=t.Transform.PI_D}Y*=E;V=Math.cos(Y);X=Math.sin(Y);b.a=V*k-X*j;b.b=X*k+V*j;b.c=V*L-X*U;b.d=X*L+V*U}g.global.fromMatrix(b)}this.dirty=false};a.prototype.invalidUpdate=function(){};return a}(e);t.PathConstraint=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];e.bones=[];return e}e.toString=function(){return"[class dragonBones.DeformVertices]"};e.prototype._onClear=function(){this.verticesDirty=false;this.vertices.length=0;this.bones.length=0;this.verticesData=null};e.prototype.init=function(t,e){this.verticesData=t;if(this.verticesData!==null){var a=0;if(this.verticesData.weight!==null){a=this.verticesData.weight.count*2}else{a=this.verticesData.data.intArray[this.verticesData.offset+0]*2}this.verticesDirty=true;this.vertices.length=a;this.bones.length=0;for(var r=0,i=this.vertices.length;r0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&a._subFadeState>0){this._armature._dragonBones.bufferObject(a);this._animationStates.length=0;this._lastAnimationState=null}else{var r=a._animationData;var i=r.cacheFrameRate;if(this._animationDirty&&i>0){this._animationDirty=false;for(var n=0,s=this._armature.getBones();n0){var _=u[0];if(_!==null){if(_.parent===this._armature.armatureData.defaultSkin){f._cachedFrameIndices=r.getSlotCachedFrameIndices(f.name);continue}}}f._cachedFrameIndices=null}}a.advanceTime(t,i)}}else if(e>1){for(var c=0,m=0;c0&&a._subFadeState>0){m++;this._armature._dragonBones.bufferObject(a);this._animationDirty=true;if(this._lastAnimationState===a){this._lastAnimationState=null}}else{if(m>0){this._animationStates[c-m]=a}a.advanceTime(t,0)}if(c===e-1&&m>0){this._animationStates.length-=m;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};a.prototype.reset=function(){for(var t=0,e=this._animationStates;t1){if(e.position<0){e.position%=r.duration;e.position=r.duration-e.position}else if(e.position===r.duration){e.position-=1e-6}else if(e.position>r.duration){e.position%=r.duration}if(e.duration>0&&e.position+e.duration>r.duration){e.duration=r.duration-e.position}if(e.playTimes<0){e.playTimes=r.playTimes}}else{e.playTimes=1;e.position=0;if(e.duration>0){e.duration=0}}if(e.duration===0){e.duration=-1}this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);o.init(this._armature,r,e);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var l=false;for(var h=0,f=this._animationStates.length;hthis._animationStates[h].layer){l=true;this._animationStates.splice(h,0,o);break}else if(h!==f-1&&o.layer>this._animationStates[h+1].layer){l=true;this._animationStates.splice(h+1,0,o);break}}if(!l){this._animationStates.push(o)}}else{this._animationStates.push(o)}for(var u=0,_=this._armature.getSlots();u<_.length;u++){var c=_[u];var m=c.childArmature;if(m!==null&&m.inheritAnimation&&m.animation.hasAnimation(a)&&m.animation.getState(a)===null){m.animation.fadeIn(a)}}var p=false;for(var d in r.animationTimelines){if(!this._lockUpdate){p=true;this._lockUpdate=true}var v=this.fadeIn(d,e.fadeInTime,1,o.layer,null,0);if(v!==null){v.resetToPose=false;v._parent=o;v.stop()}}if(p){this._lockUpdate=false}if(!this._lockUpdate){if(e.fadeInTime<=0){this._armature.advanceTime(0)}this._lastAnimationState=o}return o};a.prototype.play=function(t,e){if(t===void 0){t=null}if(e===void 0){e=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t!==null?t:"";if(t!==null&&t.length>0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};a.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*e/r.frameCount}return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};a.prototype.getState=function(t){var e=this._animationStates.length;while(e--){var a=this._animationStates[e];if(a.name===t){return a}}return null};a.prototype.hasAnimation=function(t){return t in this._animations};a.prototype.getStates=function(){return this._animationStates};Object.defineProperty(a.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});a.prototype.gotoAndPlay=function(t,e,a,r,i,n,s,o,l){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=-1}if(i===void 0){i=0}if(n===void 0){n=null}if(s===void 0){s=3}if(o===void 0){o=true}if(l===void 0){l=true}console.warn("Deprecated.");o;l;this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.fadeOutMode=s;this._animationConfig.playTimes=r;this._animationConfig.layer=i;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=n!==null?n:"";var h=this._animations[t];if(h&&a>0){this._animationConfig.timeScale=h.duration/a}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStop=function(t,e){if(e===void 0){e=0}console.warn("Deprecated.");return this.gotoAndStopByTime(t,e)};Object.defineProperty(a.prototype,"animationList",{get:function(){console.warn("Deprecated.");return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationDataList",{get:function(){console.warn("Deprecated.");var t=[];for(var e=0,a=this._animationNames.length;e0;if(this._subFadeState<0){this._subFadeState=0;var r=a?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=t.BaseObject.borrowObject(t.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}if(e<0){e=-e}this._fadeTime+=e;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=a?0:1}else if(this._fadeTime>0){this._fadeProgress=a?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=a?1:0}if(this._subFadeState>0){if(!a){this._playheadState|=1;this._fadeState=0}var r=a?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=t.BaseObject.borrowObject(t.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}};i.prototype.init=function(e,a,r){if(this._armature!==null){return}this._armature=e;this._animationData=a;this.resetToPose=r.resetToPose;this.additiveBlending=r.additiveBlending;this.displayControl=r.displayControl;this.actionEnabled=r.actionEnabled;this.layer=r.layer;this.playTimes=r.playTimes;this.timeScale=r.timeScale;this.fadeTotalTime=r.fadeInTime;this.autoFadeOutTime=r.autoFadeOutTime;this.weight=r.weight;this.name=r.name.length>0?r.name:r.animation;this.group=r.group;if(r.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(r.duration<0){this._position=0;this._duration=this._animationData.duration;if(r.position!==0){if(this.timeScale>=0){this._time=r.position}else{this._time=r.position-this._duration}}else{this._time=0}}else{this._position=r.position;this._duration=r.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(r.boneMask.length>0){this._boneMask.length=r.boneMask.length;for(var i=0,n=this._boneMask.length;i0;var i=true;var n=true;var s=this._time;this._weightResult=this.weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult/this._parent._fadeProgress}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(r){var o=a*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*a);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){if(n){for(var h=0,f=this._boneTimelines.length;h0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var m=0,p=this._poseTimelines;m0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};i.prototype.play=function(){this._playheadState=3};i.prototype.stop=function(){this._playheadState&=1};i.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};i.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};i.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,f=i;h0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.leftWeight=0;return 0}else{this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}}}else{return 0}t*=this.leftWeight;this.layerWeight+=t;this.blendWeight=t;return 2}this.dirty=true;this.layer=e;this.layerWeight=t;this.leftWeight=1;this.blendWeight=t;return 1};t.prototype.clear=function(){this.dirty=false;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};return t}();t.BlendState=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.playState=-1;this.currentPlayTimes=-1;this.currentTime=-1;this._tweenState=0;this._frameRate=0;this._frameValueOffset=0;this._frameCount=0;this._frameOffset=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._dragonBonesData=null;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._frameIntArray=null;this._frameFloatArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this._duration+1e-6}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState._animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;this._dragonBonesData=this._animationData.parent.parent;if(this._timelineData!==null){this._frameIntArray=this._dragonBonesData.frameIntArray;this._frameFloatArray=this._dragonBonesData.frameFloatArray;this._frameArray=this._dragonBonesData.frameArray;this._timelineArray=this._dragonBonesData.timelineArray;this._frameIndices=this._dragonBonesData.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._tweenState!==0){this._onUpdateFrame()}}};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a+1;var n=Math.floor(t*i);var s=n===0?0:e[r+n-1];var o=n===i-1?1e4:e[r+n];return(s+(o-s)*(t*i-n))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenProgress=0;this._tweenEasing=0};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this._tweenState=1}};e.prototype._onUpdateFrame=function(){if(this._tweenState===2){this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}else{this._tweenProgress=0}};return e}(e);t.TweenTimelineState=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.bone=null;this.bonePose=null};e.prototype.blend=function(t){var e=this.bone._blendState.blendWeight;var a=this.bone.animationPose;var r=this.bonePose.result;if(t===2){a.x+=r.x*e;a.y+=r.y*e;a.rotation+=r.rotation*e;a.skew+=r.skew*e;a.scaleX+=(r.scaleX-1)*e;a.scaleY+=(r.scaleY-1)*e}else if(e!==1){a.x=r.x*e;a.y=r.y*e;a.rotation=r.rotation*e;a.skew=r.skew*e;a.scaleX=(r.scaleX-1)*e+1;a.scaleY=(r.scaleY-1)*e+1}else{a.x=r.x;a.y=r.y;a.rotation=r.rotation;a.skew=r.skew;a.scaleX=r.scaleX;a.scaleY=r.scaleY}if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){this.bone._transformDirty=true}};return e}(a);t.BoneTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.slot=null};return e}(a);t.SlotTimelineState=i;var n=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.constraint=null};return e}(a);t.ConstraintTimelineState=n})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.ActionTimelineState]"};a.prototype._onCrossFrame=function(e){var a=this._armature.eventDispatcher;if(this._animationState.actionEnabled){var r=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+e];var i=this._frameArray[r+1];var n=this._animationData.parent.actions;for(var s=0;s0){if(n.hasDBEventListener(t.EventObject.COMPLETE)){h=t.BaseObject.borrowObject(t.EventObject);h.type=t.EventObject.COMPLETE;h.armature=this._armature;h.animationState=this._animationState}}}if(this._frameCount>1){var f=this._timelineData;var u=Math.floor(this.currentTime*this._frameRate);var _=this._frameIndices[f.frameIndicesOffset+u];if(this._frameIndex!==_){var c=this._frameIndex;this._frameIndex=_;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[f.offset+5+this._frameIndex];if(o){if(c<0){var m=Math.floor(i*this._frameRate);c=this._frameIndices[f.frameIndicesOffset+m];if(this.currentPlayTimes===r){if(c===_){c=-1}}}while(c>=0){var p=this._animationData.frameOffset+this._timelineArray[f.offset+5+c];var d=this._frameArray[p]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(c)}if(l!==null&&c===0){this._armature._dragonBones.bufferEvent(l);l=null}if(c>0){c--}else{c=this._frameCount-1}if(c===_){break}}}else{if(c<0){var m=Math.floor(i*this._frameRate);c=this._frameIndices[f.frameIndicesOffset+m];var p=this._animationData.frameOffset+this._timelineArray[f.offset+5+c];var d=this._frameArray[p]/this._frameRate;if(this.currentPlayTimes===r){if(i<=d){if(c>0){c--}else{c=this._frameCount-1}}else if(c===_){c=-1}}}while(c>=0){if(c=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.ZOrderTimelineState=a;var r=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*6;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.x=r[t++]*a;i.y=r[t++]*a;i.rotation=r[t++];i.skew=r[t++];i.scaleX=r[t++];i.scaleY=r[t++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){t=this._animationData.frameFloatOffset+this._frameValueOffset}n.x=r[t++]*a-i.x;n.y=r[t++]*a-i.y;n.rotation=r[t++]-i.rotation;n.skew=r[t++]-i.skew;n.scaleX=r[t++]-i.scaleX;n.scaleY=r[t++]-i.scaleY}else{n.x=0;n.y=0;n.rotation=0;n.skew=0;n.scaleX=0;n.scaleY=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.x=0;i.y=0;i.rotation=0;i.skew=0;i.scaleX=1;i.scaleY=1;n.x=0;n.y=0;n.rotation=0;n.skew=0;n.scaleX=0;n.scaleY=0}};a.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.x=t.x+a.x*this._tweenProgress;r.y=t.y+a.y*this._tweenProgress;r.rotation=t.rotation+a.rotation*this._tweenProgress;r.skew=t.skew+a.skew*this._tweenProgress;r.scaleX=t.scaleX+a.scaleX*this._tweenProgress;r.scaleY=t.scaleY+a.scaleY*this._tweenProgress};a.prototype.fadeOut=function(){var e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation);e.skew=t.Transform.normalizeRadian(e.skew)};return a}(t.BoneTimelineState);t.BoneAllTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.x=r[e++]*a;i.y=r[e++]*a;if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){e=this._animationData.frameFloatOffset+this._frameValueOffset}n.x=r[e++]*a-i.x;n.y=r[e++]*a-i.y}else{n.x=0;n.y=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.x=0;i.y=0;n.x=0;n.y=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.x=e.x+a.x*this._tweenProgress;r.y=e.y+a.y*this._tweenProgress};return e}(t.BoneTimelineState);t.BoneTranslateTimelineState=i;var n=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var a=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var r=this._frameFloatArray;var i=this.bonePose.current;var n=this.bonePose.delta;i.rotation=r[a++];i.skew=r[a++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){a=this._animationData.frameFloatOffset+this._frameValueOffset;n.rotation=t.Transform.normalizeRadian(r[a++]-i.rotation)}else{n.rotation=r[a++]-i.rotation}n.skew=r[a++]-i.skew}else{n.rotation=0;n.skew=0}}else{var i=this.bonePose.current;var n=this.bonePose.delta;i.rotation=0;i.skew=0;n.rotation=0;n.skew=0}};a.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.rotation=t.rotation+a.rotation*this._tweenProgress;r.skew=t.skew+a.skew*this._tweenProgress};a.prototype.fadeOut=function(){var e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation);e.skew=t.Transform.normalizeRadian(e.skew)};return a}(t.BoneTimelineState);t.BoneRotateTimelineState=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var a=this._frameFloatArray;var r=this.bonePose.current;var i=this.bonePose.delta;r.scaleX=a[e++];r.scaleY=a[e++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){e=this._animationData.frameFloatOffset+this._frameValueOffset}i.scaleX=a[e++]-r.scaleX;i.scaleY=a[e++]-r.scaleY}else{i.scaleX=0;i.scaleY=0}}else{var r=this.bonePose.current;var i=this.bonePose.delta;r.scaleX=1;r.scaleY=1;i.scaleX=0;i.scaleY=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current;var a=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.scaleX=e.scaleX+a.scaleX*this._tweenProgress;r.scaleY=e.scaleY+a.scaleY*this._tweenProgress};return e}(t.BoneTimelineState);t.BoneScaleTimelineState=s;var o=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[];e._delta=[];e._result=[];return e}e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.surface=null;this._frameFloatOffset=0;this._valueCount=0;this._deformCount=0;this._valueOffset=0;this._current.length=0;this._delta.length=0;this._result.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;if(this._tweenState===2){var i=e+this._valueCount;if(this._frameIndex===this._frameCount-1){i=this._animationData.frameFloatOffset+this._frameValueOffset}for(var n=0;n=0){var t=this._timelineData!==null?this._frameArray[this._frameOffset+1]:this.slot._slotData.displayIndex;if(this.slot.displayIndex!==t){this.slot._setDisplayIndex(t,true)}}};return e}(t.SlotTimelineState);t.SlotDislayTimelineState=l;var h=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[0,0,0,0,0,0,0,0];e._delta=[0,0,0,0,0,0,0,0];e._result=[0,0,0,0,0,0,0,0];return e}e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._dirty=false};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._dragonBonesData.intArray;var a=this._frameIntArray;var r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex*1;var i=a[r];if(i<0){i+=65536}this._current[0]=e[i++];this._current[1]=e[i++];this._current[2]=e[i++];this._current[3]=e[i++];this._current[4]=e[i++];this._current[5]=e[i++];this._current[6]=e[i++];this._current[7]=e[i++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){i=a[this._animationData.frameIntOffset+this._frameValueOffset]}else{i=a[r+1*1]}if(i<0){i+=65536}this._delta[0]=e[i++]-this._current[0];this._delta[1]=e[i++]-this._current[1];this._delta[2]=e[i++]-this._current[2];this._delta[3]=e[i++]-this._current[3];this._delta[4]=e[i++]-this._current[4];this._delta[5]=e[i++]-this._current[5];this._delta[6]=e[i++]-this._current[6];this._delta[7]=e[i++]-this._current[7]}}else{var n=this.slot._slotData.color;this._current[0]=n.alphaMultiplier*100;this._current[1]=n.redMultiplier*100;this._current[2]=n.greenMultiplier*100;this._current[3]=n.blueMultiplier*100;this._current[4]=n.alphaOffset;this._current[5]=n.redOffset;this._current[6]=n.greenOffset;this._current[7]=n.blueOffset}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);this._dirty=true;if(this._tweenState!==2){this._tweenState=0}this._result[0]=(this._current[0]+this._delta[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._delta[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._delta[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._delta[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._delta[4]*this._tweenProgress;this._result[5]=this._current[5]+this._delta[5]*this._tweenProgress;this._result[6]=this._current[6]+this._delta[6]*this._tweenProgress;this._result[7]=this._current[7]+this._delta[7]*this._tweenProgress};e.prototype.fadeOut=function(){this._tweenState=0;this._dirty=false};e.prototype.update=function(e){t.prototype.update.call(this,e);if(this._tweenState!==0||this._dirty){var a=this.slot._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);a.alphaMultiplier+=(this._result[0]-a.alphaMultiplier)*r;a.redMultiplier+=(this._result[1]-a.redMultiplier)*r;a.greenMultiplier+=(this._result[2]-a.greenMultiplier)*r;a.blueMultiplier+=(this._result[3]-a.blueMultiplier)*r;a.alphaOffset+=(this._result[4]-a.alphaOffset)*r;a.redOffset+=(this._result[5]-a.redOffset)*r;a.greenOffset+=(this._result[6]-a.greenOffset)*r;a.blueOffset+=(this._result[7]-a.blueOffset)*r;this.slot._colorDirty=true}}else if(this._dirty){this._dirty=false;if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){a.alphaMultiplier=this._result[0];a.redMultiplier=this._result[1];a.greenMultiplier=this._result[2];a.blueMultiplier=this._result[3];a.alphaOffset=this._result[4];a.redOffset=this._result[5];a.greenOffset=this._result[6];a.blueOffset=this._result[7];this.slot._colorDirty=true}}}};return e}(t.SlotTimelineState);t.SlotColorTimelineState=h;var f=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[];e._delta=[];e._result=[];return e}e.toString=function(){return"[class dragonBones.DeformTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.vertexOffset=0;this._dirty=false;this._frameFloatOffset=0;this._valueCount=0;this._deformCount=0;this._valueOffset=0;this._current.length=0;this._delta.length=0;this._result.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount;var a=this._armature._armatureData.scale;var r=this._frameFloatArray;if(this._tweenState===2){var i=e+this._valueCount;if(this._frameIndex===this._frameCount-1){i=this._animationData.frameFloatOffset+this._frameValueOffset}for(var n=0;n=0){this._floats[2]=this._floats[0]+this._floats[1]*this._tweenProgress}this._floats[5]=this._floats[3]+this._floats[4]*this._tweenProgress};e.prototype.blend=function(t){var e=this.animationState;var a=e._blendState.blendWeight;if(t===2){e.weight+=this._floats[5]*a;e.currentTime+=this._floats[2]*a}else{e.weight=this._floats[5]*a;e.currentTime=this._floats[2]*a}};return e}(t.TweenTimelineState);t.AnimationTimelineState=_})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.actionDataToInstance=function(t,a,r){if(t.type===0){a.type=e.FRAME_EVENT}else{a.type=t.type===10?e.FRAME_EVENT:e.SOUND_EVENT}a.name=t.name;a.armature=r;a.actionData=t;a.data=t.data;if(t.bone!==null){a.bone=r.getBone(t.bone.name)}if(t.slot!==null){a.slot=r.getSlot(t.slot.name)}};e.toString=function(){return"[class dragonBones.EventObject]"};e.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};e.START="start";e.LOOP_COMPLETE="loopComplete";e.COMPLETE="complete";e.FADE_IN="fadeIn";e.FADE_IN_COMPLETE="fadeInComplete";e.FADE_OUT="fadeOut";e.FADE_OUT_COMPLETE="fadeOutComplete";e.FRAME_EVENT="frameEvent";e.SOUND_EVENT="soundEvent";return e}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(){}e._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};e._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};e._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};e._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};e._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};e._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};e._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};e._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};e._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};e.parseDragonBonesData=function(e){console.warn("Deprecated.");if(e instanceof ArrayBuffer){return t.BinaryDataParser.getInstance().parseDragonBonesData(e)}else{return t.ObjectDataParser.getInstance().parseDragonBonesData(e)}};e.parseTextureAtlasData=function(a,r){if(r===void 0){r=1}console.warn("已废弃");var i={};var n=a[e.SUB_TEXTURE];for(var s=0,o=n.length;s255){return encodeURI(i)}}}return i}return String(i)}return r};r.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var f=1-l;var u=f*f;var _=l*l;var c=f*u;var m=3*l*u;var p=3*f*_;var d=l*_;h.x=c*t+m*a+p*i+d*s;h.y=c*e+m*r+p*n+d*o};r.prototype._samplingEasingCurve=function(t,e){var a=t.length;var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var y=(v+d)*.5;this._getCurvePoint(l,h,f,u,_,c,m,p,y,this._helpPoint);if(s-this._helpPoint.x>0){d=y}else{v=y}}e[i]=this._helpPoint.y}};r.prototype._parseActionDataInFrame=function(e,a,r,i){if(t.DataParser.EVENT in e){this._mergeActionFrame(e[t.DataParser.EVENT],a,10,r,i)}if(t.DataParser.SOUND in e){this._mergeActionFrame(e[t.DataParser.SOUND],a,11,r,i)}if(t.DataParser.ACTION in e){this._mergeActionFrame(e[t.DataParser.ACTION],a,0,r,i)}if(t.DataParser.EVENTS in e){this._mergeActionFrame(e[t.DataParser.EVENTS],a,10,r,i)}if(t.DataParser.ACTIONS in e){this._mergeActionFrame(e[t.DataParser.ACTIONS],a,0,r,i)}};r.prototype._mergeActionFrame=function(e,r,i,n,s){var o=t.DragonBones.webAssembly?this._armature.actions.size():this._armature.actions.length;var l=this._parseActionData(e,i,n,s);var h=0;var f=null;for(var u=0,_=l;u<_.length;u++){var c=_[u];this._armature.addAction(c,false)}if(this._actionFrames.length===0){f=new a;f.frameStart=0;this._actionFrames.push(f);f=null}for(var m=0,p=this._actionFrames;mr){break}h++}if(f===null){f=new a;f.frameStart=r;this._actionFrames.splice(h+1,0,f)}for(var v=0;v0){var m=i.getBone(_);if(m!==null){c.parent=m}else{if(!(_ in this._cacheBones)){this._cacheBones[_]=[]}this._cacheBones[_].push(c)}}if(c.name in this._cacheBones){for(var p=0,d=this._cacheBones[c.name];p0&&a.parent!==null){n.root=a.parent;n.bone=a}else{n.root=a;n.bone=null}return n};r.prototype._parsePathConstraint=function(e){var a=this._armature.getSlot(r._getString(e,t.DataParser.TARGET,""));if(a===null){return null}var i=this._armature.defaultSkin;if(i===null){return null}var n=i.getDisplay(a.name,r._getString(e,t.DataParser.TARGET_DISPLAY,a.name));if(n===null||!(n instanceof t.PathDisplayData)){return null}var s=e[t.DataParser.BONES];if(s===null||s.length===0){return null}var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=r._getString(e,t.DataParser.NAME,"");o.type=1;o.pathSlot=a;o.pathDisplayData=n;o.target=a.parent;o.positionMode=t.DataParser._getPositionMode(r._getString(e,t.DataParser.POSITION_MODE,""));o.spacingMode=t.DataParser._getSpacingMode(r._getString(e,t.DataParser.SPACING_MODE,""));o.rotateMode=t.DataParser._getRotateMode(r._getString(e,t.DataParser.ROTATE_MODE,""));o.position=r._getNumber(e,t.DataParser.POSITION,0);o.spacing=r._getNumber(e,t.DataParser.SPACING,0);o.rotateOffset=r._getNumber(e,t.DataParser.ROTATE_OFFSET,0);o.rotateMix=r._getNumber(e,t.DataParser.ROTATE_MIX,1);o.translateMix=r._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var l=0,h=s;l0?i:a;this._parsePivot(e,o);break;case 1:var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);l.name=a;l.path=i.length>0?i:a;l.inheritAnimation=true;if(t.DataParser.ACTIONS in e){var h=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);for(var f=0,u=h;f0?i:a;d.vertices.data=this._data;if(t.DataParser.SHARE in e){this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}else{this._parseMesh(e,d)}if(t.DataParser.GLUE_WEIGHTS in e&&t.DataParser.GLUE_MESHES in e){this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}break;case 3:var v=this._parseBoundingBox(e);if(v!==null){var y=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);y.name=a;y.path=i.length>0?i:a;y.boundingBox=v}break;case 4:var g=e[t.DataParser.LENGTHS];var D=s=t.BaseObject.borrowObject(t.PathDisplayData);D.closed=r._getBoolean(e,t.DataParser.CLOSED,false);D.constantSpeed=r._getBoolean(e,t.DataParser.CONSTANT_SPEED,false);D.name=a;D.path=i.length>0?i:a;D.vertices.data=this._data;D.curveLengths.length=g.length;for(var b=0,T=g.length;ba.width){a.width=l}if(ha.height){a.height=h}}}a.width-=a.x;a.height-=a.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return a};r.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);a.frameCount=Math.max(r._getNumber(e,t.DataParser.DURATION,1),1);a.playTimes=r._getNumber(e,t.DataParser.PLAY_TIMES,1);a.duration=a.frameCount/this._armature.frameRate;a.fadeInTime=r._getNumber(e,t.DataParser.FADE_IN_TIME,0);a.scale=r._getNumber(e,t.DataParser.SCALE,1);a.name=r._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME);if(a.name.length===0){a.name=t.DataParser.DEFAULT_NAME}a.frameIntOffset=this._frameIntArray.length;a.frameFloatOffset=this._frameFloatArray.length;a.frameOffset=this._frameArray.length;this._animation=a;if(t.DataParser.FRAME in e){var i=e[t.DataParser.FRAME];var n=i.length;if(n>0){for(var s=0,o=0;s0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,false,false,0,this._parseActionFrame);this._actionFrames.length=0}this._animation=null;return a};r.prototype._parseTimeline=function(e,i,n,s,o,l,h,f){if(e!==null&&n.length>0&&n in e){i=e[n]}if(i===null){return null}var u=i.length;if(u===0){return null}var _=this._frameIntArray.length;var c=this._frameFloatArray.length;var m=t.BaseObject.borrowObject(t.TimelineData);var p=this._timelineArray.length;this._timelineArray.length+=1+1+1+1+1+u;if(e!==null){this._timelineArray[p+0]=Math.round(r._getNumber(e,t.DataParser.SCALE,1)*100);this._timelineArray[p+1]=Math.round(r._getNumber(e,t.DataParser.OFFSET,0)*100)}else{this._timelineArray[p+0]=100;this._timelineArray[p+1]=0}this._timelineArray[p+2]=u;this._timelineArray[p+3]=h;if(o){this._timelineArray[p+4]=_-this._animation.frameIntOffset}else if(l){this._timelineArray[p+4]=c-this._animation.frameFloatOffset}else{this._timelineArray[p+4]=0}this._timeline=m;m.type=s;m.offset=p;if(u===1){m.frameIndicesOffset=-1;this._timelineArray[p+5+0]=f.call(this,i[0],0,0)-this._animation.frameOffset}else{var d=this._animation.frameCount+1;var v=this._data.frameIndices;var y=0;if(t.DragonBones.webAssembly){y=v.size();v.resize(y+d,0)}else{y=v.length;v.length+=d}m.frameIndicesOffset=y;for(var g=0,D=0,b=0,T=0;g0){if(t.DataParser.CURVE in e){var s=i+1;this._helpArray.length=s;this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[n+1]=2;this._frameArray[n+2]=s;for(var o=0;o0){var s=this._armature.sortedSlots.length;var o=new Array(s-n.length/2);var l=new Array(s);for(var h=0;h0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.TWEEN_ROTATE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[o++]=this._helpTransform.x;this._frameFloatArray[o++]=this._helpTransform.y;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=this._helpTransform.skew;this._frameFloatArray[o++]=this._helpTransform.scaleX;this._frameFloatArray[o++]=this._helpTransform.scaleY;this._parseActionDataInFrame(e,a,this._bone,this._slot);return s};r.prototype._parseBoneTranslateFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,0);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,0);return n};r.prototype._parseBoneRotateFrame=function(e,a,i){var n=r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;if(a!==0){if(this._prevClockwise===0){n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation)}else{if(this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.CLOCK_WISE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD;return s};r.prototype._parseBoneScaleFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,1);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,1);return n};r.prototype._parseSurfaceFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=e[t.DataParser.VERTICES];var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._surface.vertices.length/2;var f=0;var u=0;this._frameFloatArray.length+=h*2;for(var _=0;_=o.length){f=0}else{f=o[_-l]}if(_+1=o.length){u=0}else{u=o[_+1-l]}this._frameFloatArray[n+_]=f;this._frameFloatArray[n+_+1]=u}if(a===0){var c=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[c+0]=0;this._frameIntArray[c+1]=this._frameFloatArray.length-n;this._frameIntArray[c+2]=this._frameFloatArray.length-n;this._frameIntArray[c+3]=0;this._frameIntArray[c+4]=n-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=c-this._animation.frameIntOffset}return s};r.prototype._parseSlotDisplayFrame=function(e,a,i){var n=this._parseFrame(e,a,i);this._frameArray.length+=1;if(t.DataParser.VALUE in e){this._frameArray[n+1]=r._getNumber(e,t.DataParser.VALUE,0)}else{this._frameArray[n+1]=r._getNumber(e,t.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(e,a,this._slot.parent,this._slot);return n};r.prototype._parseSlotColorFrame=function(e,a,r){var i=this._parseTweenFrame(e,a,r);var n=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){o;this._parseColorTransform(s,this._helpColorTransform);n=this._intArray.length;this._intArray.length+=8;this._intArray[n++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.redMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.alphaOffset);this._intArray[n++]=Math.round(this._helpColorTransform.redOffset);this._intArray[n++]=Math.round(this._helpColorTransform.greenOffset);this._intArray[n++]=Math.round(this._helpColorTransform.blueOffset);n-=8;break}}if(n<0){if(this._defaultColorOffset<0){this._defaultColorOffset=n=this._intArray.length;this._intArray.length+=8;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=0;this._intArray[n++]=0;this._intArray[n++]=0;this._intArray[n++]=0}n=this._defaultColorOffset}var l=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[l]=n;return i};r.prototype._parseSlotFFDFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null;var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._intArray[this._mesh.vertices.offset+0];var f=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var u=this._mesh.vertices.weight;var _=0;var c=0;var m=0;var p=0;if(u!==null){var d=this._weightSlotPose[f];this._helpMatrixA.copyFromArray(d,0);this._frameFloatArray.length+=u.count*2;m=u.offset+2+u.bones.length}else{this._frameFloatArray.length+=h*2}for(var v=0;v=o.length){_=0}else{_=o[v-l]}if(v+1=o.length){c=0}else{c=o[v+1-l]}}if(u!==null){var y=this._weightBonePoses[f];var g=this._intArray[m++];this._helpMatrixA.transformPoint(_,c,this._helpPoint,true);_=this._helpPoint.x;c=this._helpPoint.y;for(var D=0;D=0||t.DataParser.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);s.version=i;s.name=r._getString(e,t.DataParser.NAME,"");s.frameRate=r._getNumber(e,t.DataParser.FRAME_RATE,24);if(s.frameRate===0){s.frameRate=24}if(t.DataParser.ARMATURE in e){this._data=s;this._parseArray(e);var o=e[t.DataParser.ARMATURE];for(var l=0,h=o;l0){s.stage=s.getArmature(s.armatureNames[0])}this._data=null}if(t.DataParser.TEXTURE_ATLAS in e){this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]}return s}else{console.assert(false,"Nonsupport data version: "+i+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};r.prototype.parseTextureAtlasData=function(e,a,i){if(i===void 0){i=1}console.assert(e!==undefined);if(e===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(n,a,i);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}a.width=r._getNumber(e,t.DataParser.WIDTH,0);a.height=r._getNumber(e,t.DataParser.HEIGHT,0);a.scale=i===1?1/r._getNumber(e,t.DataParser.SCALE,1):i;a.name=r._getString(e,t.DataParser.NAME,"");a.imagePath=r._getString(e,t.DataParser.IMAGE_PATH,"");if(t.DataParser.SUB_TEXTURE in e){var s=e[t.DataParser.SUB_TEXTURE];for(var o=0,l=s.length;o0&&_>0){f.frame=t.TextureData.createRectangle();f.frame.x=r._getNumber(h,t.DataParser.FRAME_X,0);f.frame.y=r._getNumber(h,t.DataParser.FRAME_Y,0);f.frame.width=u;f.frame.height=_}a.addTexture(f)}}return true};r.getInstance=function(){if(r._objectDataParserInstance===null){r._objectDataParserInstance=new r}return r._objectDataParserInstance};r._objectDataParserInstance=null;return r}(t.DataParser);t.ObjectDataParser=e;var a=function(){function t(){this.frameStart=0;this.actions=[]}return t}();t.ActionFrame=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.prototype._inRange=function(t,e,a){return e<=t&&t<=a};a.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var f=0;while(t.length>i){var u=t[i++];if(u===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(u,0,127)){s=u}else{if(this._inRange(u,194,223)){l=1;f=128;o=u-192}else if(this._inRange(u,224,239)){l=2;f=2048;o=u-224}else if(this._inRange(u,240,244)){l=3;f=65536;o=u-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(u,128,191)){o=0;l=0;h=0;f=0;i--;s=u}else{h+=1;o=o+(u-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var c=f;o=0;l=0;h=0;f=0;if(this._inRange(_,c,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=u}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};a.prototype._getUTF16Key=function(t){for(var e=0,a=t.length;e255){return encodeURI(t)}}return t};a.prototype._parseBinaryTimeline=function(e,a,r){if(r===void 0){r=null}var i=r!==null?r:t.BaseObject.borrowObject(t.TimelineData);i.type=e;i.offset=a;this._timeline=i;var n=this._timelineArrayBuffer[i.offset+2];if(n===1){i.frameIndicesOffset=-1}else{var s=0;var o=this._animation.frameCount+1;var l=this._data.frameIndices;if(t.DragonBones.webAssembly){s=l.size();l.resize(s+o,0)}else{s=l.length;l.length+=o}i.frameIndicesOffset=s;for(var h=0,f=0,u=0,_=0;h=0){var i=t.BaseObject.borrowObject(t.WeightData);var n=this._intArrayBuffer[a.offset+0];var s=this._intArrayBuffer[r+0];i.offset=r;for(var o=0;o0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};e.prototype._buildBones=function(e,a){for(var r=0,i=e.armature.sortedBones;r0){o.texture=this._getTextureData(e.textureAtlasName,a.path)}if(r!==null&&r.type===2&&this._isSupportMesh()){s=i.meshDisplay}else{s=i.rawDisplay}break}case 2:{var l=a;if(l.texture===null){l.texture=this._getTextureData(n,l.path)}else if(e!==null&&e.textureAtlasName.length>0){l.texture=this._getTextureData(e.textureAtlasName,l.path)}if(this._isSupportMesh()){s=i.meshDisplay}else{s=i.rawDisplay}break}case 1:{var h=a;var f=this._buildChildArmature(e,i,a);if(f!==null){f.inheritAnimation=h.inheritAnimation;if(!f.inheritAnimation){var u=h.actions.length>0?h.actions:f.armatureData.defaultActions;if(u.length>0){for(var _=0,c=u;_=0){continue}var f=a.getDisplays(h.name);if(!f){if(s!==null&&a!==s){f=s.getDisplays(h.name)}if(!f){if(r){h.rawDisplayDatas=null;h.displayList=[]}continue}}var u=t.DragonBones.webAssembly?f.size():f.length;var _=h.displayList;_.length=u;for(var c=0,m=u;c=0&&this._display!==null&&a!==null){var r=a.parent;if(this._armature.replacedTexture!==null&&this._rawDisplayDatas!==null&&this._rawDisplayDatas.indexOf(this._displayData)>=0){if(this._armature._replaceTextureAtlasData===null){r=t.BaseObject.borrowObject(t.PixiTextureAtlasData);r.copyFrom(a.parent);r.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=r}else{r=this._armature._replaceTextureAtlasData}a=r.getTexture(a.name)}var i=a.renderTexture;if(i!==null){if(e!==null){var n=e.data;var s=n.intArray;var o=n.floatArray;var l=s[e.offset+0];var h=s[e.offset+1];var f=s[e.offset+2];if(f<0){f+=65536}var u=f+l*2;var _=this._armature._armatureData.scale;var c=this._renderDisplay;var m=r.width>0?r.width:i.width;var p=r.height>0?r.height:i.height;c.vertices=new Float32Array(l*2);c.uvs=new Float32Array(l*2);c.indices=new Uint16Array(h*3);for(var d=0,v=l*2;d0&&r.inheritDeform;var s=this._renderDisplay;if(i!==null){var o=r.data;var l=o.intArray;var h=o.floatArray;var f=l[r.offset+0];var u=l[i.offset+1];if(u<0){u+=65536}for(var _=0,c=0,m=i.offset+2+a.length,p=u,d=0;_0){for(var a=0,r=this._objects;a0){for(var n=0;na){i.length=a}t._maxCountMap[r]=a}else{t._defaultMaxCount=a;for(var r in t._poolsMap){var i=t._poolsMap[r];if(i.length>a){i.length=a}if(r in t._maxCountMap){t._maxCountMap[r]=a}}}};t.clearPool=function(e){if(e===void 0){e=null}if(e!==null){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){r.length=0}}else{for(var i in t._poolsMap){var r=t._poolsMap[i];r.length=0}}};t.borrowObject=function(e){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){var i=r.pop();i._isInPool=false;return i}var n=new e;n._onClear();return n};t.prototype.returnToPool=function(){this._onClear();t._returnObject(this)};t._hashCode=0;t._defaultMaxCount=3e3;t._maxCountMap={};t._poolsMap={};return t}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var u=l+t.width;var f=h+t.height;var _=a*l+i*h+s;var m=r*l+n*h+o;var p=a*u+i*h+s;var c=r*u+n*h+o;var d=a*u+i*f+s;var y=r*u+n*f+o;var v=a*l+i*f+s;var g=r*l+n*f+o;var D=0;if(_>p){D=_;_=p;p=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_v?p:v)-t.x);if(m>c){D=m;m=c;c=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(mg?c:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}t.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};t.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};t.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};t.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};t.prototype.fromMatrix=function(e){var a=this.scaleX,r=this.scaleY;var i=t.PI_Q;this.x=e.tx;this.y=e.ty;this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);this.scaleX=this.rotation>-i&&this.rotation-i&&n=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(r>=0&&this.scaleY<0){this.scaleY=-this.scaleY;n=n-Math.PI}this.skew=n-this.rotation;return this};t.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};t.PI=Math.PI;t.PI_D=Math.PI*2;t.PI_H=Math.PI/2;t.PI_Q=Math.PI/4;t.RAD_DEG=180/Math.PI;t.DEG_RAD=Math.PI/180;return t}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.ints=[];e.floats=[];e.strings=[];return e}e.toString=function(){return"[class dragonBones.UserData]"};e.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};e.prototype.addInt=function(t){this.ints.push(t)};e.prototype.addFloat=function(t){this.floats.push(t)};e.prototype.addString=function(t){this.strings.push(t)};e.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};a.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};a.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};a.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};a.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};a.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};a.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};a.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};a.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};a.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return a}(t.BaseObject);t.ArmatureData=e;var a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.transform=new t.Transform;a.userData=null;return a}a.toString=function(){return"[class dragonBones.BoneData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return a}(t.BaseObject);t.BoneData=a;var r=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.geometry=new t.GeometryData;return a}a.toString=function(){return"[class dragonBones.SurfaceData]"};a.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return a}(a);t.SurfaceData=r;var i=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}a.createColor=function(){return new t.ColorTransform};a.toString=function(){return"[class dragonBones.SlotData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.zIndex=0;this.alpha=1;this.name="";this.color=null;this.userData=null;this.parent=null};a.DEFAULT_COLOR=new t.ColorTransform;return a}(t.BaseObject);t.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.order=0;this.name="";this.type=0;this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.scaleEnabled=false;this.bendPositive=false;this.weight=1};return e}(e);t.IKConstraintData=a;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.bones=[];return e}e.toString=function(){return"[class dragonBones.PathConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.pathSlot=null;this.pathDisplayData=null;this.bones.length=0;this.positionMode=0;this.spacingMode=1;this.rotateMode=1;this.position=0;this.spacing=0;this.rotateOffset=0;this.rotateMix=0;this.translateMix=0};e.prototype.AddBone=function(t){this.bones.push(t)};return e}(e);t.PathConstraintData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.displays={};return e}e.toString=function(){return"[class dragonBones.SkinData]"};e.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};e.rectangleIntersectsSegment=function(t,a,r,i,n,s,o,l,h,u,f){if(h===void 0){h=null}if(u===void 0){u=null}if(f===void 0){f=null}var _=t>n&&ts&&an&&rs&&i=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=this.width*.5;var h=this.height*.5;var u=e.rectangleIntersectsSegment(t,a,r,i,-l,-h,l,h,n,s,o);return u};return e}(e);t.RectangleBoundingBoxData=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.EllipseData]"};e.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=s/o;var _=f*f;e*=f;r*=f;var m=a-t;var p=r-e;var c=Math.sqrt(m*m+p*p);var d=m/c;var y=p/c;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var T=s*s;var b=T-D+g;var A=0;if(b>=0){var P=Math.sqrt(b);var S=v-P;var O=v+P;var x=S<0?-1:S<=c?0:1;var B=O<0?-1:O<=c?0:1;var E=x*B;if(E<0){return-1}else if(E===0){if(x===-1){A=2;a=t+O*d;r=(e+O*y)/f;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,a/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*y)/f;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.x=Math.atan2(e/T*_,t/T);u.y=u.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+O*d;h.y=(e+O*y)/f;if(u!==null){u.y=Math.atan2(h.y/T*_,h.x/T)}}}}}return A};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};e.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};e.prototype.intersectsSegment=function(t,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=e.ellipseIntersectsSegment(t,a,r,i,0,0,this.width*.5,this.height*.5,n,s,o);return l};return e}(e);t.EllipseBoundingBoxData=r;var i=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};e.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var u=e-r;var f=t*r-e*a;var _=0;var m=i[l-2];var p=i[l-1];var c=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var T=0;T=m&&B<=b||B>=b&&B<=m)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var E=(f*S-u*O)/x;if((E>=p&&E<=A||E>=A&&E<=p)&&(u===0||E>=e&&E<=r||E>=r&&E<=e)){if(s!==null){var M=B-t;if(M<0){M=-M}if(_===0){c=M;d=M;y=B;v=E;g=B;D=E;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}}else{if(Md){d=M;g=B;D=E;if(o!==null){o.y=Math.atan2(A-p,b-m)-Math.PI*.5}}}_++}else{y=B;v=E;g=B;D=E;_++;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}break}}}m=b;p=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};e.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;ae._zIndex*1e3+e._zOrder?1:-1};a.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};a.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};a.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};a.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};a.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};a.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};a.prototype.init=function(e,a,r,i){if(this._armatureData!==null){return}this._armatureData=e;this._animation=t.BaseObject.borrowObject(t.Animation);this._proxy=a;this._display=r;this._dragonBones=i;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};a.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty||this._zIndexDirty){this._slots.sort(a._onSortSlots);if(this._zIndexDirty){for(var r=0,i=this._slots.length;r0){for(var f=0,_=this._actions;f<_.length;f++){var m=_[f];var p=m.actionData;if(p!==null){if(p.type===0){if(m.slot!==null){var c=m.slot.childArmature;if(c!==null){c.animation.fadeIn(p.name)}}else if(m.bone!==null){for(var d=0,y=this.getSlots();d0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var b=o?i.y-e:i.x-t;if(b<0){b=-b}if(d===null||bh){h=b;_=n.x;m=n.y;y=D;if(s!==null){c=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=u;i.y=f;if(s!==null){s.x=p}}if(y!==null&&n!==null){n.x=_;n.y=m;if(s!==null){s.y=c}}return d};a.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};a.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};a.prototype.invalidUpdate=function(){this._transformDirty=true};a.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(a.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=r){return this.globalTransformMatrix}n=a>this._kX*(t+r)+d;p=((o*l+o+l+l+m)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=m*(h+2);var D=this._hullCache[4];var T=this._hullCache[5];var b=this._hullCache[2]-(l-m)*D;var A=this._hullCache[3]-(l-m)*T;var P=this._vertices;if(n){this._getAffineTransform(-r,d+f,i-r,f,P[g+h+2],P[g+h+3],b+D,A+T,P[g],P[g+1],e._helpTransform,v,true)}else{this._getAffineTransform(-i,d,i-r,f,b,A,P[g],P[g+1],b+D,A+T,e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(t>=r){if(a<-r||a>=r){return this.globalTransformMatrix}n=a>this._kX*(t-i)+d;p=((o*l+o+m)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=(m+1)*(h+2)-2;var D=this._hullCache[4];var T=this._hullCache[5];var b=this._hullCache[0]+m*D;var A=this._hullCache[1]+m*T;var P=this._vertices;if(n){this._getAffineTransform(i,d+f,i-r,f,b+D,A+T,P[g+h+2],P[g+h+3],b,A,e._helpTransform,v,true)}else{this._getAffineTransform(r,d,i-r,f,P[g],P[g+1],b,A,P[g+h+2],P[g+h+3],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(a<-r){if(t<-r||t>=r){return this.globalTransformMatrix}n=a>this._kY*(t-c-u)-i;p=((o*l+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=_*2;var D=this._hullCache[10];var T=this._hullCache[11];var b=this._hullCache[8]+_*D;var A=this._hullCache[9]+_*T;var P=this._vertices;if(n){this._getAffineTransform(c+u,-r,u,i-r,P[g+2],P[g+3],P[g],P[g+1],b+D,A+T,e._helpTransform,v,true)}else{this._getAffineTransform(c,-i,u,i-r,b,A,b+D,A+T,P[g],P[g+1],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else if(a>=r){if(t<-r||t>=r){return this.globalTransformMatrix}n=a>this._kY*(t-c-u)+r;p=((o*l+o+l+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=l*(h+2)+_*2;var D=this._hullCache[10];var T=this._hullCache[11];var b=this._hullCache[6]-(o-_)*D;var A=this._hullCache[7]-(o-_)*T;var P=this._vertices;if(n){this._getAffineTransform(c+u,i,u,i-r,b+D,A+T,b,A,P[g+2],P[g+3],e._helpTransform,v,true)}else{this._getAffineTransform(c,r,u,i-r,P[g],P[g+1],P[g+2],P[g+3],b,A,e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}else{n=a>this._k*(t-c-u)+d;p=((o*m+_)*2+(n?1:0))*7;if(y[p]>0){v.copyFromArray(y,p+1)}else{var g=_*2+m*(h+2);var P=this._vertices;if(n){this._getAffineTransform(c+u,d+f,u,f,P[g+h+4],P[g+h+5],P[g+h+2],P[g+h+3],P[g+2],P[g+3],e._helpTransform,v,true)}else{this._getAffineTransform(c,d,u,f,P[g],P[g+1],P[g+2],P[g+3],P[g+h+2],P[g+h+3],e._helpTransform,v,false)}y[p]=1;y[p+1]=v.a;y[p+2]=v.b;y[p+3]=v.c;y[p+4]=v.d;y[p+5]=v.tx;y[p+6]=v.ty}}return v};e.prototype.init=function(e,a){if(this._boneData!==null){return}t.prototype.init.call(this,e,a);var r=e.segmentX;var i=e.segmentY;var n=this._armature.armatureData.parent.intArray[e.geometry.offset+0];var s=1e3;var o=200;this._dX=o*2/r;this._dY=o*2/i;this._k=-this._dY/this._dX;this._kX=-this._dY/(s-o);this._kY=-(s-o)/this._dX;this._vertices.length=n*2;this._deformVertices.length=n*2;this._matrixCahce.length=(r*i+r*2+i*2)*2*7;this._hullCache.length=10;for(var l=0;l=0&&this._cachedFrameIndices!==null){var a=this._cachedFrameIndices[t];if(a>=0&&this._cachedFrameIndex===a){this._transformDirty=false}else if(a>=0){this._transformDirty=true;this._cachedFrameIndex=a}else{if(this._hasConstraint){for(var r=0,i=this._armature._constraints;r=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var s=0,o=this._armature._constraints;s=0;if(this._localDirty){this._updateGlobalTransformMatrix(u)}if(u&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var f=1e3;var _=200;var m=2*this.global.x;var p=2*this.global.y;var c=e._helpPoint;this.globalTransformMatrix.transformPoint(f,-_,c);this._hullCache[0]=c.x;this._hullCache[1]=c.y;this._hullCache[2]=m-c.x;this._hullCache[3]=p-c.y;this.globalTransformMatrix.transformPoint(0,this._dY,c,true);this._hullCache[4]=c.x;this._hullCache[5]=c.y;this.globalTransformMatrix.transformPoint(_,f,c);this._hullCache[6]=c.x;this._hullCache[7]=c.y;this._hullCache[8]=m-c.x;this._hullCache[9]=p-c.y;this.globalTransformMatrix.transformPoint(this._dX,0,c,true);this._hullCache[10]=c.x;this._hullCache[11]=c.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return e}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.deformVertices=[];return e}e.toString=function(){return"[class dragonBones.DisplayFrame]"};e.prototype._onClear=function(){this.rawDisplayData=null;this.displayData=null;this.textureData=null;this.display=null;this.deformVertices.length=0};e.prototype.updateDeformVertices=function(){if(this.rawDisplayData===null||this.deformVertices.length!==0){return}var t;if(this.rawDisplayData.type===2){t=this.rawDisplayData.geometry}else if(this.rawDisplayData.type===4){t=this.rawDisplayData.geometry}else{return}var e=0;if(t.weight!==null){e=t.weight.count*2}else{e=t.data.intArray[t.offset+0]*2}this.deformVertices.length=e;for(var a=0,r=this.deformVertices.length;a=0&&this._displayIndex0){for(var o=0,l=n;o=0&&this._cachedFrameIndices!==null){var r=this._cachedFrameIndices[t];if(r>=0&&this._cachedFrameIndex===r){this._transformDirty=false}else if(r>=0){this._transformDirty=true;this._cachedFrameIndex=r}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._transformDirty){if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform();this._transformDirty=false}};r.prototype.invalidUpdate=function(){this._displayDataDirty=true;this._displayDirty=true;this._transformDirty=true};r.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._updateGlobalTransformMatrix(false);this._transformDirty=false}};r.prototype.replaceRawDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.rawDisplayData!==t){a.deformVertices.length=0;a.rawDisplayData=t;if(a.rawDisplayData===null){var r=this._armature._armatureData.defaultSkin;if(r!==null){var i=r.getDisplays(this._slotData.name);if(i!==null&&e=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.displayData!==t&&a.rawDisplayData!==t){a.displayData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};r.prototype.replaceTextureData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.textureData!==t){a.textureData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};r.prototype.replaceDisplay=function(e,a){if(a===void 0){a=-1}if(a<0){a=this._displayIndex<0?0:this._displayIndex}else if(a>=this._displayFrames.length){return}var r=this._displayFrames[a];if(r.display!==e){var i=r.display;r.display=e;if(i!==null&&i!==this._rawDisplay&&i!==this._meshDisplay&&!this._hasDisplay(i)){if(i instanceof t.Armature){}else{this._disposeDisplay(i,true)}}if(e!==null&&e!==this._rawDisplay&&e!==this._meshDisplay&&!this._hasDisplay(i)&&!(e instanceof t.Armature)){this._initDisplay(e,true)}if(a===this._displayIndex){this._displayDirty=true}}};r.prototype.containsPoint=function(t,e){if(this._boundingBoxData===null){return false}this.updateTransformAndMatrix();r._helpMatrix.copyFrom(this.globalTransformMatrix);r._helpMatrix.invert();r._helpMatrix.transformPoint(t,e,r._helpPoint);return this._boundingBoxData.containsPoint(r._helpPoint.x,r._helpPoint.y)};r.prototype.intersectsSegment=function(t,e,a,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(this._boundingBoxData===null){return 0}this.updateTransformAndMatrix();r._helpMatrix.copyFrom(this.globalTransformMatrix);r._helpMatrix.invert();r._helpMatrix.transformPoint(t,e,r._helpPoint);t=r._helpPoint.x;e=r._helpPoint.y;r._helpMatrix.transformPoint(a,i,r._helpPoint);a=r._helpPoint.x;i=r._helpPoint.y;var l=this._boundingBoxData.intersectsSegment(t,e,a,i,n,s,o);if(l>0){if(l===1||l===2){if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n);if(s!==null){s.x=n.x;s.y=n.y}}else if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}else{if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}if(o!==null){this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),r._helpPoint,true);o.x=Math.atan2(r._helpPoint.y,r._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),r._helpPoint,true);o.y=Math.atan2(r._helpPoint.y,r._helpPoint.x)}}return l};r.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]};Object.defineProperty(r.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(a){var r=this._displayFrames.length;if(ra){for(var i=r-1;id){continue}var b=0;for(;;D++){var A=y[D];if(c>A){continue}if(D===0){b=c/A}else{var P=y[D-1];b=(c-P)/(A-P)}break}if(D!==p){p=D;if(u&&D===m){this._computeVertices(_-4,4,0,f);this._computeVertices(0,4,4,f)}else{this._computeVertices(D*6+2,8,0,f)}}this.addCurvePosition(b,f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],l,g,a)}return}if(u){_+=2;f.length=o;this._computeVertices(2,_-4,0,f);this._computeVertices(0,2,_-4,f);f[_-2]=f[0];f[_-1]=f[1]}else{m--;_-=4;f.length=_;this._computeVertices(2,_,0,f)}var S=new Array(m);d=0;var O=f[0],x=f[1],B=0,E=0,M=0,I=0,F=0,C=0;var w,N,R,k,j,L,V,Y;for(var v=0,X=2;vd){continue}for(;;D++){var W=S[D];if(z>W)continue;if(D===0)z/=W;else{var K=S[D-1];z=(z-K)/(W-K)}break}if(D!==p){p=D;var Z=D*6;O=f[Z];x=f[Z+1];B=f[Z+2];E=f[Z+3];M=f[Z+4];I=f[Z+5];F=f[Z+6];C=f[Z+7];w=(O-B*2+M)*.03;N=(x-E*2+I)*.03;R=((B-M)*3-O+F)*.006;k=((E-I)*3-x+C)*.006;j=w*2+R;L=N*2+k;V=(B-O)*.3+w+R*.16666667;Y=(E-x)*.3+N+k*.16666667;G=Math.sqrt(V*V+Y*Y);U[0]=G;for(Z=1;Z<8;Z++){V+=j;Y+=L;j+=R;L+=k;G+=Math.sqrt(V*V+Y*Y);U[Z]=G}V+=j;Y+=L;G+=Math.sqrt(V*V+Y*Y);U[8]=G;V+=j+R;Y+=L+k;G+=Math.sqrt(V*V+Y*Y);U[9]=G;H=0}z*=G;for(;;H++){var q=U[H];if(z>q)continue;if(H===0)z/=q;else{var K=U[H-1];z=H+(z-K)/(q-K)}break}this.addCurvePosition(z*.1,O,x,B,E,M,I,F,C,l,g,a)}};a.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,u,f){if(t===0){h[u]=e;h[u+1]=a;h[u+2]=0;return}if(t===1){h[u]=o;h[u+1]=l;h[u+2]=0;return}var _=1-t;var m=_*_;var p=t*t;var c=m*_;var d=m*t*3;var y=_*p*3;var v=t*p;var g=c*e+d*r+y*n+v*o;var D=c*a+d*i+y*s+v*l;h[u]=g;h[u+1]=D;if(f){h[u+2]=Math.atan2(D-(c*a+d*i+y*s),g-(c*e+d*r+y*n))}else{h[u+2]=0}};a.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?t.Transform.DEG_RAD:-t.Transform.DEG_RAD}}var B=this.rotateMix;var E=this.translateMix;for(var c=0,M=3;c0){var N=g.a,R=g.b,k=g.c,j=g.d,L=void 0,V=void 0,Y=void 0;if(u){L=A[M-1]}else{L=Math.atan2(F,I)}L-=Math.atan2(R,N);if(x){V=Math.cos(L);Y=Math.sin(L);var X=y._boneData.length;S+=(X*(V*N-Y*R)-I)*B;O+=(X*(Y*N+V*R)-F)*B}else{L+=P}if(L>t.Transform.PI){L-=t.Transform.PI_D}else if(L<-t.Transform.PI){L+=t.Transform.PI_D}L*=B;V=Math.cos(L);Y=Math.sin(L);g.a=V*N-Y*R;g.b=Y*N+V*R;g.c=V*k-Y*j;g.d=Y*k+V*j}y.global.fromMatrix(g)}this.dirty=false};a.prototype.invalidUpdate=function(){};return a}(e);t.PathConstraint=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=0}this.time=0;this.timeScale=1;this._systemTime=0;this._animatebles=[];this._clock=null;this.time=t;this._systemTime=(new Date).getTime()*.001}t.prototype.advanceTime=function(t){if(t!==t){t=0}var e=Date.now()*.001;if(t<0){t=e-this._systemTime}this._systemTime=e;if(this.timeScale!==1){t*=this.timeScale}if(t===0){return}if(t<0){this.time-=t}else{this.time+=t}var a=0,r=0,i=this._animatebles.length;for(;a0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&n._subFadeState>0){this._armature._dragonBones.bufferObject(n);this._animationStates.length=0;this._lastAnimationState=null}else{var s=n.animationData;var o=s.cacheFrameRate;if(this._animationDirty&&o>0){this._animationDirty=false;for(var l=0,h=this._armature.getBones();l0){var p=m.getDisplayFrameAt(0).rawDisplayData;if(p!==null&&p.parent===this._armature.armatureData.defaultSkin){m._cachedFrameIndices=s.getSlotCachedFrameIndices(m.name);continue}}m._cachedFrameIndices=null}}n.advanceTime(t,o)}}else if(i>1){for(var c=0,d=0;c0&&n._subFadeState>0){d++;this._armature._dragonBones.bufferObject(n);this._animationDirty=true;if(this._lastAnimationState===n){this._lastAnimationState=null}}else{if(d>0){this._animationStates[c-d]=n}n.advanceTime(t,0)}if(c===i-1&&d>0){this._animationStates.length-=d;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};a.prototype.reset=function(){for(var t=0,e=this._animationStates;t0){if(e.position<0){e.position%=r.duration;e.position=r.duration-e.position}else if(e.position===r.duration){e.position-=1e-6}else if(e.position>r.duration){e.position%=r.duration}if(e.duration>0&&e.position+e.duration>r.duration){e.duration=r.duration-e.position}if(e.playTimes<0){e.playTimes=r.playTimes}}else{e.playTimes=1;e.position=0;if(e.duration>0){e.duration=0}}if(e.duration===0){e.duration=-1}this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);o.init(this._armature,r,e);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var l=false;for(var h=0,u=this._animationStates.length;hthis._animationStates[h].layer){l=true;this._animationStates.splice(h,0,o);break}else if(h!==u-1&&o.layer>this._animationStates[h+1].layer){l=true;this._animationStates.splice(h+1,0,o);break}}if(!l){this._animationStates.push(o)}}else{this._animationStates.push(o)}for(var f=0,_=this._armature.getSlots();f<_.length;f++){var m=_[f];var p=m.childArmature;if(p!==null&&p.inheritAnimation&&p.animation.hasAnimation(a)&&p.animation.getState(a)===null){p.animation.fadeIn(a)}}for(var c in r.animationTimelines){var d=this.fadeIn(c,0,1,o.layer,"",5);if(d===null){continue}var y=r.animationTimelines[c];d.actionEnabled=false;d.resetToPose=false;d.stop();o.addState(d,y);var v=this._animationStates.indexOf(o);var g=this._animationStates.indexOf(d);if(g0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};a.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.frameCount>0?r.duration*e/r.frameCount:0}return this.playConfig(this._animationConfig)};a.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};a.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};a.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};a.prototype.getBlendState=function(e,a,r){if(!(e in this._blendStates)){this._blendStates[e]={}}var i=this._blendStates[e];if(!(a in i)){var n=i[a]=t.BaseObject.borrowObject(t.BlendState);n.target=r}return i[a]};a.prototype.getState=function(t,e){if(e===void 0){e=-1}var a=this._animationStates.length;while(a--){var r=this._animationStates[a];if(r.name===t&&(e<0||r.layer===e)){return r}}return null};a.prototype.hasAnimation=function(t){return t in this._animations};a.prototype.getStates=function(){return this._animationStates};Object.defineProperty(a.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});return a}(t.BaseObject);t.Animation=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var t=e!==null&&e.apply(this,arguments)||this;t._boneMask=[];t._boneTimelines=[];t._boneBlendTimelines=[];t._slotTimelines=[];t._slotBlendTimelines=[];t._constraintTimelines=[];t._animationTimelines=[];t._poseTimelines=[];t._actionTimeline=null;t._zOrderTimeline=null;return t}r.toString=function(){return"[class dragonBones.AnimationState]"};r.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0){this._boneTimelines.splice(D,1);n.returnToPool()}D=this._boneBlendTimelines.indexOf(n);if(D>=0){this._boneBlendTimelines.splice(D,1);n.returnToPool()}}}}{var T={};var b=[];for(var A=0,P=this._slotTimelines;A=0){this._slotTimelines.splice(D,1);n.returnToPool()}D=this._slotBlendTimelines.indexOf(n);if(D>=0){this._slotBlendTimelines.splice(D,1);n.returnToPool()}}}}};r.prototype._advanceFadeTime=function(e){var a=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var r=this._parent===null&&this.actionEnabled;if(r){var i=a?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(i)){var n=t.BaseObject.borrowObject(t.EventObject);n.type=i;n.armature=this._armature;n.animationState=this;this._armature._dragonBones.bufferEvent(n)}}}if(e<0){e=-e}this._fadeTime+=e;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=a?0:1}else if(this._fadeTime>0){this._fadeProgress=a?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=a?1:0}if(this._subFadeState>0){if(!a){this._playheadState|=1;this._fadeState=0}var r=this._parent===null&&this.actionEnabled;if(r){var i=a?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(i)){var n=t.BaseObject.borrowObject(t.EventObject);n.type=i;n.armature=this._armature;n.animationState=this;this._armature._dragonBones.bufferEvent(n)}}}};r.prototype.init=function(e,a,r){if(this._armature!==null){return}this._armature=e;this._animationData=a;this.resetToPose=r.resetToPose;this.additive=r.additive;this.displayControl=r.displayControl;this.actionEnabled=r.actionEnabled;this.blendType=a.blendType;this.layer=r.layer;this.playTimes=r.playTimes;this.timeScale=r.timeScale;this.fadeTotalTime=r.fadeInTime;this.autoFadeOutTime=r.autoFadeOutTime;this.name=r.name.length>0?r.name:r.animation;this.group=r.group;this._weight=r.weight;if(r.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(r.duration<0){this._position=0;this._duration=this._animationData.duration;if(r.position!==0){if(this.timeScale>=0){this._time=r.position}else{this._time=r.position-this._duration}}else{this._time=0}}else{this._position=r.position;this._duration=r.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(r.boneMask.length>0){this._boneMask.length=r.boneMask.length;for(var i=0,n=this._boneMask.length;i0;var i=true;var n=true;var s=this._time;this._weightResult=this._weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(this._weight===0){return}if(r){var o=e*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*e);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){var h=false;var u=null;if(n){for(var f=0,_=this._boneTimelines.length;f<_;++f){var m=this._boneTimelines[f];if(m.playState<=0){m.update(s)}if(m.target!==u){var p=m.target;h=p.update(this);u=p;if(p.dirty===1){var c=p.target.animationPose;c.x=0;c.y=0;c.rotation=0;c.skew=0;c.scaleX=1;c.scaleY=1}}if(h){m.blend(a)}}}for(var f=0,_=this._boneBlendTimelines.length;f<_;++f){var m=this._boneBlendTimelines[f];if(m.playState<=0){m.update(s)}if(m.target.update(this)){m.blend(a)}}if(this.displayControl){for(var f=0,_=this._slotTimelines.length;f<_;++f){var m=this._slotTimelines[f];if(m.playState<=0){var d=m.target;var y=d.displayController;if(y===null||y===this.name||y===this.group){m.update(s)}}}}for(var f=0,_=this._slotBlendTimelines.length;f<_;++f){var m=this._slotBlendTimelines[f];if(m.playState<=0){var p=m.target;m.update(s);if(p.update(this)){m.blend(a)}}}for(var f=0,_=this._constraintTimelines.length;f<_;++f){var m=this._constraintTimelines[f];if(m.playState<=0){m.update(s)}}if(this._animationTimelines.length>0){var v=100;var g=100;var D=null;var T=null;for(var f=0,_=this._animationTimelines.length;f<_;++f){var m=this._animationTimelines[f];if(m.playState<=0){m.update(s)}if(this.blendType===1){var b=m.target;var A=this.parameterX-b.positionX;if(A>=0){if(A0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var P=0,S=this._poseTimelines;P=0){this._boneTimelines.splice(O,1);m.returnToPool();continue}O=this._boneBlendTimelines.indexOf(m);if(O>=0){this._boneBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._slotTimelines.indexOf(m);if(O>=0){this._slotTimelines.splice(O,1);m.returnToPool();continue}O=this._slotBlendTimelines.indexOf(m);if(O>=0){this._slotBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._constraintTimelines.indexOf(m);if(O>=0){this._constraintTimelines.splice(O,1);m.returnToPool();continue}}this._poseTimelines.length=0}}if(this._actionTimeline.playState>0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};r.prototype.play=function(){this._playheadState=3};r.prototype.stop=function(){this._playheadState&=1};r.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};r.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};r.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,u=i;h0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&this._parent===null){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.dirty++;this.layer=e;this.leftWeight=0;this.blendWeight=0;return false}this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}a*=this.leftWeight;this.dirty++;this.blendWeight=a;this.layerWeight+=this.blendWeight;return true}return false}this.dirty++;this.layer=e;this.leftWeight=1;this.blendWeight=a;this.layerWeight=a;return true};e.prototype.reset=function(){this.dirty=0;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};e.BONE_TRANSFORM="boneTransform";e.BONE_ALPHA="boneAlpha";e.SURFACE="surface";e.SLOT_DEFORM="slotDeform";e.SLOT_ALPHA="slotAlpha";e.SLOT_Z_INDEX="slotZIndex";return e}(t.BaseObject);t.BlendState=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.dirty=false;this.playState=-1;this.currentPlayTimes=-1;this.currentTime=-1;this.target=null;this._isTween=false;this._valueOffset=0;this._frameValueOffset=0;this._frameOffset=0;this._frameRate=0;this._frameCount=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._valueArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this._duration+1e-6}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState.animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;if(this._timelineData!==null){var r=this._animationData.parent.parent;this._frameArray=r.frameArray;this._timelineArray=r.timelineArray;this._frameIndices=r.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){this.dirty=false};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._isTween||this.dirty){this._onUpdateFrame()}}};e.prototype.blend=function(t){};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a>0;var n=a+1;var s=Math.floor(t*n);var o=0;var l=0;if(i){o=s===0?0:e[r+s-1];l=s===n-1?1e4:e[r+s]}else{o=e[r+s-1];l=e[r+s]}return(o+(l-o)*(t*n-s))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenEasing=0;this._tweenProgress=0;this._valueScale=1};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this.dirty=true;this._isTween=false}};e.prototype._onUpdateFrame=function(){if(this._isTween){this.dirty=true;this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}};return e}(e);t.TweenTimelineState=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._current=0;this._difference=0;this._result=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._valueScale;var a=this._valueArray;var r=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var i=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:r+1;if(e===1){this._current=a[r];this._difference=a[i]-this._current}else{this._current=a[r]*e;this._difference=a[i]*e-this._current}}else{this._result=a[r]*e}}else{this._result=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._result=this._current+this._difference*this._tweenProgress}};return e}(a);t.SingleValueTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._currentA=0;this._currentB=0;this._differenceA=0;this._differenceB=0;this._resultA=0;this._resultB=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._valueScale;var a=this._valueArray;var r=this._valueOffset+this._frameValueOffset+this._frameIndex*2;if(this._isTween){var i=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:r+2;if(e===1){this._currentA=a[r];this._currentB=a[r+1];this._differenceA=a[i]-this._currentA;this._differenceB=a[i+1]-this._currentB}else{this._currentA=a[r]*e;this._currentB=a[r+1]*e;this._differenceA=a[i]*e-this._currentA;this._differenceB=a[i+1]*e-this._currentB}}else{this._resultA=a[r]*e;this._resultB=a[r+1]*e}}else{this._resultA=0;this._resultB=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._resultA=this._currentA+this._differenceA*this._tweenProgress;this._resultB=this._currentB+this._differenceB*this._tweenProgress}};return e}(a);t.DoubleValueTimelineState=i;var n=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._rd=[];return e}e.prototype._onClear=function(){t.prototype._onClear.call(this);this._valueCount=0;this._rd.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);var e=this._valueCount;var a=this._rd;if(this._timelineData!==null){var r=this._valueScale;var i=this._valueArray;var n=this._valueOffset+this._frameValueOffset+this._frameIndex*e;if(this._isTween){var s=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:n+e;if(r===1){for(var o=0;o0){if(s.hasDBEventListener(t.EventObject.COMPLETE)){u=t.BaseObject.borrowObject(t.EventObject);u.type=t.EventObject.COMPLETE;u.armature=this._armature;u.animationState=this._animationState}}}if(this._frameCount>1){var f=this._timelineData;var _=Math.floor(this.currentTime*this._frameRate);var m=this._frameIndices[f.frameIndicesOffset+_];if(this._frameIndex!==m){var p=this._frameIndex;this._frameIndex=m;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[f.offset+5+this._frameIndex];if(l){if(p<0){var c=Math.floor(i*this._frameRate);p=this._frameIndices[f.frameIndicesOffset+c];if(this.currentPlayTimes===r){if(p===m){p=-1}}}while(p>=0){var d=this._animationData.frameOffset+this._timelineArray[f.offset+5+p];var y=this._frameArray[d]/this._frameRate;if(this._position<=y&&y<=this._position+this._duration){this._onCrossFrame(p)}if(h!==null&&p===0){this._armature._dragonBones.bufferEvent(h);h=null}if(p>0){p--}else{p=this._frameCount-1}if(p===m){break}}}else{if(p<0){var c=Math.floor(i*this._frameRate);p=this._frameIndices[f.frameIndicesOffset+c];var d=this._animationData.frameOffset+this._timelineArray[f.offset+5+p];var y=this._frameArray[d]/this._frameRate;if(this.currentPlayTimes===r){if(i<=y){if(p>0){p--}else{p=this._frameCount-1}}else if(p===m){p=-1}}}while(p>=0){if(p=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.ZOrderTimelineState=a;var r=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._rd[2]=t.Transform.normalizeRadian(this._rd[2]);this._rd[3]=t.Transform.normalizeRadian(this._rd[3])}if(this._timelineData===null){this._rd[4]=1;this._rd[5]=1}};a.prototype.init=function(t,a,r){e.prototype.init.call(this,t,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=6;this._valueArray=this._animationData.parent.parent.frameFloatArray};a.prototype.fadeOut=function(){this.dirty=false;this._rd[2]=t.Transform.normalizeRadian(this._rd[2]);this._rd[3]=t.Transform.normalizeRadian(this._rd[3])};a.prototype.blend=function(t){var e=this._armature.armatureData.scale;var a=this._rd;var r=this.target;var i=r.target;var n=r.blendWeight;var s=i.animationPose;if(r.dirty>1){s.x+=a[0]*n*e;s.y+=a[1]*n*e;s.rotation+=a[2]*n;s.skew+=a[3]*n;s.scaleX+=(a[4]-1)*n;s.scaleY+=(a[5]-1)*n}else{s.x=a[0]*n*e;s.y=a[1]*n*e;s.rotation=a[2]*n;s.skew=a[3]*n;s.scaleX=(a[4]-1)*n+1;s.scaleY=(a[5]-1)*n+1}if(t||this.dirty){this.dirty=false;i._transformDirty=true}};return a}(t.MutilpleValueTimelineState);t.BoneAllTimelineState=r;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=this._animationData.parent.parent.frameFloatArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.x+=this._resultA*r;i.y+=this._resultB*r}else if(r!==1){i.x=this._resultA*r;i.y=this._resultB*r}else{i.x=this._resultA;i.y=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return e}(t.DoubleValueTimelineState);t.BoneTranslateTimelineState=i;var n=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};a.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._differenceA=t.Transform.normalizeRadian(this._differenceA);this._differenceB=t.Transform.normalizeRadian(this._differenceB)}};a.prototype.init=function(t,a,r){e.prototype.init.call(this,t,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};a.prototype.fadeOut=function(){this.dirty=false;this._resultA=t.Transform.normalizeRadian(this._resultA);this._resultB=t.Transform.normalizeRadian(this._resultB)};a.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.rotation+=this._resultA*r;i.skew+=this._resultB*r}else if(r!==1){i.rotation=this._resultA*r;i.skew=this._resultB*r}else{i.rotation=this._resultA;i.skew=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return a}(t.DoubleValueTimelineState);t.BoneRotateTimelineState=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){this._resultA=1;this._resultB=1}};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.scaleX+=(this._resultA-1)*r;i.scaleY+=(this._resultB-1)*r}else if(r!==1){i.scaleX=(this._resultA-1)*r+1;i.scaleY=(this._resultB-1)*r+1}else{i.scaleX=this._resultA;i.scaleY=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return e}(t.DoubleValueTimelineState);t.BoneScaleTimelineState=s;var o=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);if(this._timelineData!==null){var i=this._animationData.parent.parent;var n=i.frameIntArray;var s=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=n[s+2];this._deformCount=n[s+1];this._deformOffset=n[s+3];this._sameValueOffset=n[s+4]+this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=i.frameFloatArray;this._rd.length=this._valueCount*2}else{this._deformCount=this.target.target._deformVertices.length}};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a._deformVertices;var n=this._valueArray;if(n!==null){var s=this._valueCount;var o=this._deformOffset;var l=this._sameValueOffset;var h=this._rd;for(var u=0;u1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u1){a._alpha+=this._result*r;if(a._alpha>1){a._alpha=1}}else{a._alpha=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._alphaDirty=true}};return e}(t.SingleValueTimelineState);t.AlphaTimelineState=l;var h=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotDislayTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target;var e=this._timelineData!==null?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;if(t.displayIndex!==e){t._setDisplayIndex(e,true)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.SlotDislayTimelineState=h;var u=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[0,0,0,0,0,0,0,0];e._difference=[0,0,0,0,0,0,0,0];e._result=[0,0,0,0,0,0,0,0];return e}e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.parent.parent;var a=e.colorArray;var r=e.frameIntArray;var i=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex;var n=r[i];if(n<0){n+=65536}if(this._isTween){this._current[0]=a[n++];this._current[1]=a[n++];this._current[2]=a[n++];this._current[3]=a[n++];this._current[4]=a[n++];this._current[5]=a[n++];this._current[6]=a[n++];this._current[7]=a[n++];if(this._frameIndex===this._frameCount-1){n=r[this._animationData.frameIntOffset+this._frameValueOffset]}else{n=r[i+1]}if(n<0){n+=65536}this._difference[0]=a[n++]-this._current[0];this._difference[1]=a[n++]-this._current[1];this._difference[2]=a[n++]-this._current[2];this._difference[3]=a[n++]-this._current[3];this._difference[4]=a[n++]-this._current[4];this._difference[5]=a[n++]-this._current[5];this._difference[6]=a[n++]-this._current[6];this._difference[7]=a[n++]-this._current[7]}else{this._result[0]=a[n++]*.01;this._result[1]=a[n++]*.01;this._result[2]=a[n++]*.01;this._result[3]=a[n++]*.01;this._result[4]=a[n++];this._result[5]=a[n++];this._result[6]=a[n++];this._result[7]=a[n++]}}else{var s=this.target;var o=s.slotData.color;this._result[0]=o.alphaMultiplier;this._result[1]=o.redMultiplier;this._result[2]=o.greenMultiplier;this._result[3]=o.blueMultiplier;this._result[4]=o.alphaOffset;this._result[5]=o.redOffset;this._result[6]=o.greenOffset;this._result[7]=o.blueOffset}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._isTween){this._result[0]=(this._current[0]+this._difference[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._difference[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._difference[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._difference[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress;this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress;this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress;this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress}};e.prototype.fadeOut=function(){this._isTween=false};e.prototype.update=function(e){t.prototype.update.call(this,e);if(this._isTween||this.dirty){var a=this.target;var r=a._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(r.alphaMultiplier!==this._result[0]||r.redMultiplier!==this._result[1]||r.greenMultiplier!==this._result[2]||r.blueMultiplier!==this._result[3]||r.alphaOffset!==this._result[4]||r.redOffset!==this._result[5]||r.greenOffset!==this._result[6]||r.blueOffset!==this._result[7]){var i=Math.pow(this._animationState._fadeProgress,4);r.alphaMultiplier+=(this._result[0]-r.alphaMultiplier)*i;r.redMultiplier+=(this._result[1]-r.redMultiplier)*i;r.greenMultiplier+=(this._result[2]-r.greenMultiplier)*i;r.blueMultiplier+=(this._result[3]-r.blueMultiplier)*i;r.alphaOffset+=(this._result[4]-r.alphaOffset)*i;r.redOffset+=(this._result[5]-r.redOffset)*i;r.greenOffset+=(this._result[6]-r.greenOffset)*i;r.blueOffset+=(this._result[7]-r.blueOffset)*i;a._colorDirty=true}}else if(this.dirty){this.dirty=false;if(r.alphaMultiplier!==this._result[0]||r.redMultiplier!==this._result[1]||r.greenMultiplier!==this._result[2]||r.blueMultiplier!==this._result[3]||r.alphaOffset!==this._result[4]||r.redOffset!==this._result[5]||r.greenOffset!==this._result[6]||r.blueOffset!==this._result[7]){r.alphaMultiplier=this._result[0];r.redMultiplier=this._result[1];r.greenMultiplier=this._result[2];r.blueMultiplier=this._result[3];r.alphaOffset=this._result[4];r.redOffset=this._result[5];r.greenOffset=this._result[6];r.blueOffset=this._result[7];a._colorDirty=true}}}};return e}(t.TweenTimelineState);t.SlotColorTimelineState=u;var f=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){var e=this.target;var a=e.target;this._result=a.slotData.zIndex}};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueArray=this._animationData.parent.parent.frameIntArray};e.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;if(e.dirty>1){a._zIndex+=this._result*r}else{a._zIndex=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._zIndexDirty=true}};return e}(t.SingleValueTimelineState);t.SlotZIndexTimelineState=f;var _=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.DeformTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.geometryOffset=0;this.displayFrame=null;this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);if(this._timelineData!==null){var i=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];var n=this._animationData.parent.parent;var s=n.frameIntArray;var o=this.target.target;this.geometryOffset=s[i+0];if(this.geometryOffset<0){this.geometryOffset+=65536}for(var l=0,h=o.displayFrameCount;l1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u0;e._weight=this._currentB}else{var a=e._constraintData;e._bendPositive=a.bendPositive;e._weight=a.weight}e.invalidUpdate();this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=.01;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.DoubleValueTimelineState);t.IKConstraintTimelineState=m;var p=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.currentTime=this._result*e.totalTime}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.SingleValueTimelineState);t.AnimationProgressTimelineState=p;var c=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.weight=this._result}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.SingleValueTimelineState);t.AnimationWeightTimelineState=c;var d=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.target;if(e._parent!==null){e.parameterX=this._resultA;e.parameterY=this._resultB}this.dirty=false};e.prototype.init=function(e,a,r){t.prototype.init.call(this,e,a,r);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return e}(t.DoubleValueTimelineState);t.AnimationParametersTimelineState=d})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.actionDataToInstance=function(t,a,r){if(t.type===0){a.type=e.FRAME_EVENT}else{a.type=t.type===10?e.FRAME_EVENT:e.SOUND_EVENT}a.name=t.name;a.armature=r;a.actionData=t;a.data=t.data;if(t.bone!==null){a.bone=r.getBone(t.bone.name)}if(t.slot!==null){a.slot=r.getSlot(t.slot.name)}};e.toString=function(){return"[class dragonBones.EventObject]"};e.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};e.START="start";e.LOOP_COMPLETE="loopComplete";e.COMPLETE="complete";e.FADE_IN="fadeIn";e.FADE_IN_COMPLETE="fadeInComplete";e.FADE_OUT="fadeOut";e.FADE_OUT_COMPLETE="fadeOutComplete";e.FRAME_EVENT="frameEvent";e.SOUND_EVENT="soundEvent";return e}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(){}t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}};t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};t.DATA_VERSION_2_3="2.3";t.DATA_VERSION_3_0="3.0";t.DATA_VERSION_4_0="4.0";t.DATA_VERSION_4_5="4.5";t.DATA_VERSION_5_0="5.0";t.DATA_VERSION_5_5="5.5";t.DATA_VERSION_5_6="5.6";t.DATA_VERSION=t.DATA_VERSION_5_6;t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6];t.TEXTURE_ATLAS="textureAtlas";t.SUB_TEXTURE="SubTexture";t.FORMAT="format";t.IMAGE_PATH="imagePath";t.WIDTH="width";t.HEIGHT="height";t.ROTATED="rotated";t.FRAME_X="frameX";t.FRAME_Y="frameY";t.FRAME_WIDTH="frameWidth";t.FRAME_HEIGHT="frameHeight";t.DRADON_BONES="dragonBones";t.USER_DATA="userData";t.ARMATURE="armature";t.CANVAS="canvas";t.BONE="bone";t.SURFACE="surface";t.SLOT="slot";t.CONSTRAINT="constraint";t.SKIN="skin";t.DISPLAY="display";t.FRAME="frame";t.IK="ik";t.PATH_CONSTRAINT="path";t.ANIMATION="animation";t.TIMELINE="timeline";t.FFD="ffd";t.TRANSLATE_FRAME="translateFrame";t.ROTATE_FRAME="rotateFrame";t.SCALE_FRAME="scaleFrame";t.DISPLAY_FRAME="displayFrame";t.COLOR_FRAME="colorFrame";t.DEFAULT_ACTIONS="defaultActions";t.ACTIONS="actions";t.EVENTS="events";t.INTS="ints";t.FLOATS="floats";t.STRINGS="strings";t.TRANSFORM="transform";t.PIVOT="pivot";t.AABB="aabb";t.COLOR="color";t.VERSION="version";t.COMPATIBLE_VERSION="compatibleVersion";t.FRAME_RATE="frameRate";t.TYPE="type";t.SUB_TYPE="subType";t.NAME="name";t.PARENT="parent";t.TARGET="target";t.STAGE="stage";t.SHARE="share";t.PATH="path";t.LENGTH="length";t.DISPLAY_INDEX="displayIndex";t.Z_ORDER="zOrder";t.Z_INDEX="zIndex";t.BLEND_MODE="blendMode";t.INHERIT_TRANSLATION="inheritTranslation";t.INHERIT_ROTATION="inheritRotation";t.INHERIT_SCALE="inheritScale";t.INHERIT_REFLECTION="inheritReflection";t.INHERIT_ANIMATION="inheritAnimation";t.INHERIT_DEFORM="inheritDeform";t.SEGMENT_X="segmentX";t.SEGMENT_Y="segmentY";t.BEND_POSITIVE="bendPositive";t.CHAIN="chain";t.WEIGHT="weight";t.BLEND_TYPE="blendType";t.FADE_IN_TIME="fadeInTime";t.PLAY_TIMES="playTimes";t.SCALE="scale";t.OFFSET="offset";t.POSITION="position";t.DURATION="duration";t.TWEEN_EASING="tweenEasing";t.TWEEN_ROTATE="tweenRotate";t.TWEEN_SCALE="tweenScale";t.CLOCK_WISE="clockwise";t.CURVE="curve";t.SOUND="sound";t.EVENT="event";t.ACTION="action";t.X="x";t.Y="y";t.SKEW_X="skX";t.SKEW_Y="skY";t.SCALE_X="scX";t.SCALE_Y="scY";t.VALUE="value";t.ROTATE="rotate";t.SKEW="skew";t.ALPHA="alpha";t.ALPHA_OFFSET="aO";t.RED_OFFSET="rO";t.GREEN_OFFSET="gO";t.BLUE_OFFSET="bO";t.ALPHA_MULTIPLIER="aM";t.RED_MULTIPLIER="rM";t.GREEN_MULTIPLIER="gM";t.BLUE_MULTIPLIER="bM";t.UVS="uvs";t.VERTICES="vertices";t.TRIANGLES="triangles";t.WEIGHTS="weights";t.SLOT_POSE="slotPose";t.BONE_POSE="bonePose";t.BONES="bones";t.POSITION_MODE="positionMode";t.SPACING_MODE="spacingMode";t.ROTATE_MODE="rotateMode";t.SPACING="spacing";t.ROTATE_OFFSET="rotateOffset";t.ROTATE_MIX="rotateMix";t.TRANSLATE_MIX="translateMix";t.TARGET_DISPLAY="targetDisplay";t.CLOSED="closed";t.CONSTANT_SPEED="constantSpeed";t.VERTEX_COUNT="vertexCount";t.LENGTHS="lengths";t.GOTO_AND_PLAY="gotoAndPlay";t.DEFAULT_NAME="default";return t}();t.DataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var a=e!==null&&e.apply(this,arguments)||this;a._rawTextureAtlasIndex=0;a._rawBones=[];a._data=null;a._armature=null;a._bone=null;a._geometry=null;a._slot=null;a._skin=null;a._mesh=null;a._animation=null;a._timeline=null;a._rawTextureAtlases=null;a._frameValueType=0;a._defaultColorOffset=-1;a._prevClockwise=0;a._prevRotation=0;a._frameDefaultValue=0;a._frameValueScale=1;a._helpMatrixA=new t.Matrix;a._helpMatrixB=new t.Matrix;a._helpTransform=new t.Transform;a._helpColorTransform=new t.ColorTransform;a._helpPoint=new t.Point;a._helpArray=[];a._intArray=[];a._floatArray=[];a._frameIntArray=[];a._frameFloatArray=[];a._frameArray=[];a._timelineArray=[];a._colorArray=[];a._cacheRawMeshes=[];a._cacheMeshes=[];a._actionFrames=[];a._weightSlotPose={};a._weightBonePoses={};a._cacheBones={};a._slotChildActions={};return a}r._getBoolean=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="boolean"){return r}else if(i==="string"){switch(r){case"0":case"NaN":case"":case"false":case"null":case"undefined":return false;default:return true}}else{return!!r}}return a};r._getNumber=function(t,e,a){if(e in t){var r=t[e];if(r===null||r==="NaN"){return a}return+r||0}return a};r._getString=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="string"){return r}return String(r)}return a};r.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var u=1-l;var f=u*u;var _=l*l;var m=u*f;var p=3*l*f;var c=3*u*_;var d=l*_;h.x=m*t+p*a+c*i+d*s;h.y=m*e+p*r+c*n+d*o};r.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3===1){var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return true}else{var r=0;for(var i=0,n=e.length;i1e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return false}};r.prototype._parseActionDataInFrame=function(e,a,r,i){if(t.DataParser.EVENT in e){this._mergeActionFrame(e[t.DataParser.EVENT],a,10,r,i)}if(t.DataParser.SOUND in e){this._mergeActionFrame(e[t.DataParser.SOUND],a,11,r,i)}if(t.DataParser.ACTION in e){this._mergeActionFrame(e[t.DataParser.ACTION],a,0,r,i)}if(t.DataParser.EVENTS in e){this._mergeActionFrame(e[t.DataParser.EVENTS],a,10,r,i)}if(t.DataParser.ACTIONS in e){this._mergeActionFrame(e[t.DataParser.ACTIONS],a,0,r,i)}};r.prototype._mergeActionFrame=function(t,e,r,i,n){var s=this._armature.actions.length;var o=this._parseActionData(t,r,i,n);var l=0;var h=null;for(var u=0,f=o;ue){break}l++}if(h===null){h=new a;h.frameStart=e;this._actionFrames.splice(l,0,h)}for(var d=0;d0){var p=i.getBone(_);if(p!==null){m.parent=p}else{if(!(_ in this._cacheBones)){this._cacheBones[_]=[]}this._cacheBones[_].push(m)}}if(m.name in this._cacheBones){for(var c=0,d=this._cacheBones[m.name];c0&&a.parent!==null){s.root=a.parent;s.bone=a}else{s.root=a;s.bone=null}return s};r.prototype._parsePathConstraint=function(e){var a=this._armature.getSlot(r._getString(e,t.DataParser.TARGET,""));if(a===null){return null}var i=this._armature.defaultSkin;if(i===null){return null}var n=i.getDisplay(a.name,r._getString(e,t.DataParser.TARGET_DISPLAY,a.name));if(n===null||!(n instanceof t.PathDisplayData)){return null}var s=e[t.DataParser.BONES];if(s===null||s.length===0){return null}var o=t.BaseObject.borrowObject(t.PathConstraintData);o.name=r._getString(e,t.DataParser.NAME,"");o.type=1;o.pathSlot=a;o.pathDisplayData=n;o.target=a.parent;o.positionMode=t.DataParser._getPositionMode(r._getString(e,t.DataParser.POSITION_MODE,""));o.spacingMode=t.DataParser._getSpacingMode(r._getString(e,t.DataParser.SPACING_MODE,""));o.rotateMode=t.DataParser._getRotateMode(r._getString(e,t.DataParser.ROTATE_MODE,""));o.position=r._getNumber(e,t.DataParser.POSITION,0);o.spacing=r._getNumber(e,t.DataParser.SPACING,0);o.rotateOffset=r._getNumber(e,t.DataParser.ROTATE_OFFSET,0);o.rotateMix=r._getNumber(e,t.DataParser.ROTATE_MIX,1);o.translateMix=r._getNumber(e,t.DataParser.TRANSLATE_MIX,1);for(var l=0,h=s;l0?i:a;this._parsePivot(e,o);break}case 1:{var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);l.name=a;l.path=i.length>0?i:a;l.inheritAnimation=true;if(t.DataParser.ACTIONS in e){var h=this._parseActionData(e[t.DataParser.ACTIONS],0,null,null);for(var u=0,f=h;u0?i:a;if(t.DataParser.SHARE in e){d.geometry.data=this._data;this._cacheRawMeshes.push(e);this._cacheMeshes.push(d)}else{this._parseMesh(e,d)}break}case 3:{var y=this._parseBoundingBox(e);if(y!==null){var v=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);v.name=a;v.path=i.length>0?i:a;v.boundingBox=y}break}case 4:{var g=e[t.DataParser.LENGTHS];var D=s=t.BaseObject.borrowObject(t.PathDisplayData);D.closed=r._getBoolean(e,t.DataParser.CLOSED,false);D.constantSpeed=r._getBoolean(e,t.DataParser.CONSTANT_SPEED,false);D.name=a;D.path=i.length>0?i:a;D.curveLengths.length=g.length;for(var T=0,b=g.length;Ta.width){a.width=l}if(ha.height){a.height=h}}}a.width-=a.x;a.height-=a.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return a};r.prototype._parseAnimation=function(e){var a=t.BaseObject.borrowObject(t.AnimationData);a.blendType=t.DataParser._getAnimationBlendType(r._getString(e,t.DataParser.BLEND_TYPE,""));a.frameCount=r._getNumber(e,t.DataParser.DURATION,0);a.playTimes=r._getNumber(e,t.DataParser.PLAY_TIMES,1);a.duration=a.frameCount/this._armature.frameRate;a.fadeInTime=r._getNumber(e,t.DataParser.FADE_IN_TIME,0);a.scale=r._getNumber(e,t.DataParser.SCALE,1);a.name=r._getString(e,t.DataParser.NAME,t.DataParser.DEFAULT_NAME);if(a.name.length===0){a.name=t.DataParser.DEFAULT_NAME}a.frameIntOffset=this._frameIntArray.length;a.frameFloatOffset=this._frameFloatArray.length;a.frameOffset=this._frameArray.length;this._animation=a;if(t.DataParser.FRAME in e){var i=e[t.DataParser.FRAME];var n=i.length;if(n>0){for(var s=0,o=0;s0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame);this._actionFrames.length=0}if(t.DataParser.TIMELINE in e){var h=e[t.DataParser.TIMELINE];for(var S=0,O=h;S0&&n in e){i=e[n]}if(i===null){return null}var f=i.length;if(f===0){return null}var _=this._frameIntArray.length;var m=this._frameFloatArray.length;var p=this._timelineArray.length;if(u===null){u=t.BaseObject.borrowObject(t.TimelineData)}u.type=s;u.offset=p;this._frameValueType=o;this._timeline=u;this._timelineArray.length+=1+1+1+1+1+f;if(e!==null){this._timelineArray[p+0]=Math.round(r._getNumber(e,t.DataParser.SCALE,1)*100);this._timelineArray[p+1]=Math.round(r._getNumber(e,t.DataParser.OFFSET,0)*100)}else{this._timelineArray[p+0]=100;this._timelineArray[p+1]=0}this._timelineArray[p+2]=f;this._timelineArray[p+3]=l;switch(this._frameValueType){case 0:this._timelineArray[p+4]=0;break;case 1:this._timelineArray[p+4]=_-this._animation.frameIntOffset;break;case 2:this._timelineArray[p+4]=m-this._animation.frameFloatOffset;break}if(f===1){u.frameIndicesOffset=-1;this._timelineArray[p+5+0]=h.call(this,i[0],0,0)-this._animation.frameOffset}else{var c=this._animation.frameCount+1;var d=this._data.frameIndices;var y=d.length;d.length+=c;u.frameIndicesOffset=y;for(var v=0,g=0,D=0,T=0;v0){if(t.DataParser.CURVE in e){var s=i+1;this._helpArray.length=s;var o=this._samplingEasingCurve(e[t.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[n+1]=2;this._frameArray[n+2]=o?s:-s;for(var l=0;l0){var s=this._armature.sortedSlots.length;var o=new Array(s-n.length/2);var l=new Array(s);for(var h=0;h0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.TWEEN_ROTATE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[o++]=this._helpTransform.x;this._frameFloatArray[o++]=this._helpTransform.y;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=this._helpTransform.skew;this._frameFloatArray[o++]=this._helpTransform.scaleX;this._frameFloatArray[o++]=this._helpTransform.scaleY;this._parseActionDataInFrame(e,a,this._bone,this._slot);return s};r.prototype._parseBoneTranslateFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,0);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,0);return n};r.prototype._parseBoneRotateFrame=function(e,a,i){var n=r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD;if(a!==0){if(this._prevClockwise===0){n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation)}else{if(this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,t.DataParser.CLOCK_WISE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,a,i);var o=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD;return s};r.prototype._parseBoneScaleFrame=function(e,a,i){var n=this._parseTweenFrame(e,a,i);var s=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.X,1);this._frameFloatArray[s++]=r._getNumber(e,t.DataParser.Y,1);return n};r.prototype._parseSlotDisplayFrame=function(e,a,i){var n=this._parseFrame(e,a,i);this._frameArray.length+=1;if(t.DataParser.VALUE in e){this._frameArray[n+1]=r._getNumber(e,t.DataParser.VALUE,0)}else{this._frameArray[n+1]=r._getNumber(e,t.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(e,a,this._slot.parent,this._slot);return n};r.prototype._parseSlotColorFrame=function(e,a,r){var i=this._parseTweenFrame(e,a,r);var n=-1;if(t.DataParser.VALUE in e||t.DataParser.COLOR in e){var s=t.DataParser.VALUE in e?e[t.DataParser.VALUE]:e[t.DataParser.COLOR];for(var o in s){o;this._parseColorTransform(s,this._helpColorTransform);n=this._colorArray.length;this._colorArray.length+=8;this._colorArray[n++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.redMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._colorArray[n++]=Math.round(this._helpColorTransform.alphaOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.redOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.greenOffset);this._colorArray[n++]=Math.round(this._helpColorTransform.blueOffset);n-=8;break}}if(n<0){if(this._defaultColorOffset<0){this._defaultColorOffset=n=this._colorArray.length;this._colorArray.length+=8;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=100;this._colorArray[n++]=0;this._colorArray[n++]=0;this._colorArray[n++]=0;this._colorArray[n++]=0}n=this._defaultColorOffset}var l=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[l]=n;return i};r.prototype._parseSlotDeformFrame=function(e,a,i){var n=this._frameFloatArray.length;var s=this._parseTweenFrame(e,a,i);var o=t.DataParser.VERTICES in e?e[t.DataParser.VERTICES]:null;var l=r._getNumber(e,t.DataParser.OFFSET,0);var h=this._intArray[this._mesh.geometry.offset+0];var u=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var f=this._mesh.geometry.weight;var _=0;var m=0;var p=0;var c=0;if(f!==null){var d=this._weightSlotPose[u];this._helpMatrixA.copyFromArray(d,0);this._frameFloatArray.length+=f.count*2;p=f.offset+2+f.bones.length}else{this._frameFloatArray.length+=h*2}for(var y=0;y=o.length){_=0}else{_=o[y-l]}if(y+1=o.length){m=0}else{m=o[y+1-l]}}if(f!==null){var v=this._weightBonePoses[u];var g=this._intArray[p++];this._helpMatrixA.transformPoint(_,m,this._helpPoint,true);_=this._helpPoint.x;m=this._helpPoint.y;for(var D=0;D=o.length){f=0}else{f=o[m-l]}if(m+1=o.length){_=0}else{_=o[m+1-l]}}else{f=0;_=0}this._frameFloatArray[n+m]=f;this._frameFloatArray[n+m+1]=_}}if(a===0){var p=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[p+0]=this._geometry.offset;this._frameIntArray[p+1]=this._frameFloatArray.length-n;this._frameIntArray[p+2]=this._frameFloatArray.length-n;this._frameIntArray[p+3]=0;this._frameIntArray[p+4]=n-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=p-this._animation.frameIntOffset}return s};r.prototype._parseTransform=function(e,a,i){a.x=r._getNumber(e,t.DataParser.X,0)*i;a.y=r._getNumber(e,t.DataParser.Y,0)*i;if(t.DataParser.ROTATE in e||t.DataParser.SKEW in e){a.rotation=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.ROTATE,0)*t.Transform.DEG_RAD);a.skew=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW,0)*t.Transform.DEG_RAD)}else if(t.DataParser.SKEW_X in e||t.DataParser.SKEW_Y in e){a.rotation=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW_Y,0)*t.Transform.DEG_RAD);a.skew=t.Transform.normalizeRadian(r._getNumber(e,t.DataParser.SKEW_X,0)*t.Transform.DEG_RAD)-a.rotation}a.scaleX=r._getNumber(e,t.DataParser.SCALE_X,1);a.scaleY=r._getNumber(e,t.DataParser.SCALE_Y,1)};r.prototype._parseColorTransform=function(e,a){a.alphaMultiplier=r._getNumber(e,t.DataParser.ALPHA_MULTIPLIER,100)*.01;a.redMultiplier=r._getNumber(e,t.DataParser.RED_MULTIPLIER,100)*.01;a.greenMultiplier=r._getNumber(e,t.DataParser.GREEN_MULTIPLIER,100)*.01;a.blueMultiplier=r._getNumber(e,t.DataParser.BLUE_MULTIPLIER,100)*.01;a.alphaOffset=r._getNumber(e,t.DataParser.ALPHA_OFFSET,0);a.redOffset=r._getNumber(e,t.DataParser.RED_OFFSET,0);a.greenOffset=r._getNumber(e,t.DataParser.GREEN_OFFSET,0);a.blueOffset=r._getNumber(e,t.DataParser.BLUE_OFFSET,0)};r.prototype._parseGeometry=function(e,a){var r=e[t.DataParser.VERTICES];var i=Math.floor(r.length/2);var n=0;var s=this._intArray.length;var o=this._floatArray.length;a.offset=s;a.data=this._data;this._intArray.length+=1+1+1+1;this._intArray[s+0]=i;this._intArray[s+2]=o;this._intArray[s+3]=-1;this._floatArray.length+=i*2;for(var l=0,h=i*2;l=0||t.DataParser.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);s.version=i;s.name=r._getString(e,t.DataParser.NAME,"");s.frameRate=r._getNumber(e,t.DataParser.FRAME_RATE,24);if(s.frameRate===0){s.frameRate=24}if(t.DataParser.ARMATURE in e){this._data=s;this._parseArray(e);var o=e[t.DataParser.ARMATURE];for(var l=0,h=o;l0){s.stage=s.getArmature(s.armatureNames[0])}this._data=null}if(t.DataParser.TEXTURE_ATLAS in e){this._rawTextureAtlases=e[t.DataParser.TEXTURE_ATLAS]}return s}else{console.assert(false,"Nonsupport data version: "+i+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};r.prototype.parseTextureAtlasData=function(e,a,i){if(i===void 0){i=1}console.assert(e!==undefined);if(e===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(n,a,i);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}a.width=r._getNumber(e,t.DataParser.WIDTH,0);a.height=r._getNumber(e,t.DataParser.HEIGHT,0);a.scale=i===1?1/r._getNumber(e,t.DataParser.SCALE,1):i;a.name=r._getString(e,t.DataParser.NAME,"");a.imagePath=r._getString(e,t.DataParser.IMAGE_PATH,"");if(t.DataParser.SUB_TEXTURE in e){var s=e[t.DataParser.SUB_TEXTURE];for(var o=0,l=s.length;o0&&f>0){_.frame=t.TextureData.createRectangle();_.frame.x=r._getNumber(h,t.DataParser.FRAME_X,0);_.frame.y=r._getNumber(h,t.DataParser.FRAME_Y,0);_.frame.width=u;_.frame.height=f}a.addTexture(_)}}return true};r.getInstance=function(){if(r._objectDataParserInstance===null){r._objectDataParserInstance=new r}return r._objectDataParserInstance};r._objectDataParserInstance=null;return r}(t.DataParser);t.ObjectDataParser=e;var a=function(){function t(){this.frameStart=0;this.actions=[]}return t}();t.ActionFrame=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){return e!==null&&e.apply(this,arguments)||this}a.prototype._inRange=function(t,e,a){return e<=t&&t<=a};a.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var u=0;while(t.length>i){var f=t[i++];if(f===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(f,0,127)){s=f}else{if(this._inRange(f,194,223)){l=1;u=128;o=f-192}else if(this._inRange(f,224,239)){l=2;u=2048;o=f-224}else if(this._inRange(f,240,244)){l=3;u=65536;o=f-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(f,128,191)){o=0;l=0;h=0;u=0;i--;s=f}else{h+=1;o=o+(f-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var m=u;o=0;l=0;h=0;u=0;if(this._inRange(_,m,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=f}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};a.prototype._parseBinaryTimeline=function(e,a,r){if(r===void 0){r=null}var i=r!==null?r:t.BaseObject.borrowObject(t.TimelineData);i.type=e;i.offset=a;this._timeline=i;var n=this._timelineArrayBuffer[i.offset+2];if(n===1){i.frameIndicesOffset=-1}else{var s=0;var o=this._animation.frameCount+1;var l=this._data.frameIndices;s=l.length;l.length+=o;i.frameIndicesOffset=s;for(var h=0,u=0,f=0,_=0;h=0){var u=t.ObjectDataParser._getNumber(y,t.DataParser.TYPE,0);var v=t.ObjectDataParser._getString(y,t.DataParser.NAME,"");var _=null;if(u===40&&a.blendType!==0){_=t.BaseObject.borrowObject(t.AnimationTimelineData);var g=_;g.x=t.ObjectDataParser._getNumber(y,t.DataParser.X,0);g.y=t.ObjectDataParser._getNumber(y,t.DataParser.Y,0)}_=this._parseBinaryTimeline(u,f,_);switch(u){case 0:break;case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(v,_);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(v,_);break;case 30:this._animation.addConstraintTimeline(v,_);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(v,_);break}}}}this._animation=null;return a};a.prototype._parseGeometry=function(e,a){a.offset=e[t.DataParser.OFFSET];a.data=this._data;var r=this._intArrayBuffer[a.offset+3];if(r>=0){var i=t.BaseObject.borrowObject(t.WeightData);var n=this._intArrayBuffer[a.offset+0];var s=this._intArrayBuffer[r+0];i.offset=r;for(var o=0;o12?a[13]:0;var u=new Int16Array(this._binary,this._binaryOffset+a[0],r/Int16Array.BYTES_PER_ELEMENT);var f=new Float32Array(this._binary,this._binaryOffset+a[2],i/Float32Array.BYTES_PER_ELEMENT);var _=new Int16Array(this._binary,this._binaryOffset+a[4],n/Int16Array.BYTES_PER_ELEMENT);var m=new Float32Array(this._binary,this._binaryOffset+a[6],s/Float32Array.BYTES_PER_ELEMENT);var p=new Int16Array(this._binary,this._binaryOffset+a[8],o/Int16Array.BYTES_PER_ELEMENT);var c=new Uint16Array(this._binary,this._binaryOffset+a[10],l/Uint16Array.BYTES_PER_ELEMENT);var d=h>0?new Int16Array(this._binary,this._binaryOffset+a[12],h/Int16Array.BYTES_PER_ELEMENT):u;this._data.binary=this._binary;this._data.intArray=this._intArrayBuffer=u;this._data.floatArray=f;this._data.frameIntArray=_;this._data.frameFloatArray=m;this._data.frameArray=this._frameArrayBuffer=p;this._data.timelineArray=this._timelineArrayBuffer=c;this._data.colorArray=d};a.prototype.parseDragonBonesData=function(t,a){if(a===void 0){a=1}console.assert(t!==null&&t!==undefined&&t instanceof ArrayBuffer,"Data error.");var r=new Uint8Array(t,0,8);if(r[0]!=="D".charCodeAt(0)||r[1]!=="B".charCodeAt(0)||r[2]!=="D".charCodeAt(0)||r[3]!=="T".charCodeAt(0)){console.assert(false,"Nonsupport data.");return null}var i=new Uint32Array(t,8,1)[0];var n=new Uint8Array(t,8+4,i);var s=this._decodeUTF8(n);var o=JSON.parse(s);this._binaryOffset=8+4+i;this._binary=t;return e.prototype.parseDragonBonesData.call(this,o,a)};a.getInstance=function(){if(a._binaryDataParserInstance===null){a._binaryDataParserInstance=new a}return a._binaryDataParserInstance};a._binaryDataParserInstance=null;return a}(t.ObjectDataParser);t.BinaryDataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(a){if(a===void 0){a=null}this.autoSearch=false;this._dragonBonesDataMap={};this._textureAtlasDataMap={};this._dragonBones=null;this._dataParser=null;if(e._objectParser===null){e._objectParser=new t.ObjectDataParser}if(e._binaryParser===null){e._binaryParser=new t.BinaryDataParser}this._dataParser=a!==null?a:e._objectParser}e.prototype._isSupportMesh=function(){return true};e.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap){for(var a=0,r=this._textureAtlasDataMap[t];a0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};e.prototype._buildBones=function(e,a){for(var r=0,i=e.armature.sortedBones;r0){var c=this._getTextureData(t.textureAtlasName,p.path);f.replaceTextureData(c,_)}var d=this._getSlotDisplay(t,p,f);f.replaceDisplay(d,_)}else{f.replaceDisplay(null)}}}f._setDisplayIndex(h.displayIndex,true)}};e.prototype._buildConstraints=function(e,a){var r=e.armature.constraints;for(var i in r){var n=r[i];switch(n.type){case 0:var s=t.BaseObject.borrowObject(t.IKConstraint);s.init(n,a);a._addConstraint(s);break;case 1:var o=t.BaseObject.borrowObject(t.PathConstraint);o.init(n,a);a._addConstraint(o);break;default:var l=t.BaseObject.borrowObject(t.IKConstraint);l.init(n,a);a._addConstraint(l);break}}};e.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,t!==null?t.dataName:"","",t!==null?t.textureAtlasName:"")};e.prototype._getSlotDisplay=function(e,a,r){var i=e!==null?e.dataName:a.parent.parent.parent.name;var n=null;switch(a.type){case 0:{var s=a;if(s.texture===null){s.texture=this._getTextureData(i,a.path)}n=r.rawDisplay;break}case 2:{var o=a;if(o.texture===null){o.texture=this._getTextureData(i,o.path)}if(this._isSupportMesh()){n=r.meshDisplay}else{n=r.rawDisplay}break}case 1:{var l=a;var h=this._buildChildArmature(e,r,l);if(h!==null){h.inheritAnimation=l.inheritAnimation;if(!h.inheritAnimation){var u=l.actions.length>0?l.actions:h.armatureData.defaultActions;if(u.length>0){for(var f=0,_=u;f<_.length;f++){var m=_[f];var p=t.BaseObject.borrowObject(t.EventObject);t.EventObject.actionDataToInstance(m,p,r.armature);p.slot=r;r.armature._bufferAction(p,false)}}else{h.animation.play()}}l.armature=h.armatureData}n=h;break}case 3:break;default:break}return n};e.prototype.parseDragonBonesData=function(t,a,r){if(a===void 0){a=null}if(r===void 0){r=1}var i=t instanceof ArrayBuffer?e._binaryParser:this._dataParser;var n=i.parseDragonBonesData(t,r);while(true){var s=this._buildTextureAtlasData(null,null);if(i.parseTextureAtlasData(null,s,r)){this.addTextureAtlasData(s,a)}else{s.returnToPool();break}}if(n!==null){this.addDragonBonesData(n,a)}return n};e.prototype.parseTextureAtlasData=function(t,e,a,r){if(a===void 0){a=null}if(r===void 0){r=1}var i=this._buildTextureAtlasData(null,null);this._dataParser.parseTextureAtlasData(t,i,r);this._buildTextureAtlasData(i,e||null);this.addTextureAtlasData(i,a);return i};e.prototype.updateTextureAtlases=function(t,e){var a=this.getTextureAtlasData(e);if(a!==null){for(var r=0,i=a.length;r=0){continue}var h=e.getDisplays(l.name);if(h===null){if(n!==null&&e!==n){h=n.getDisplays(l.name)}if(h===null){if(a){l.displayFrameCount=0}continue}}l.displayFrameCount=h.length;for(var u=0,f=l.displayFrameCount;u=0&&this._display!==null&&e!==null){var a=e.parent;if(this._armature.replacedTexture!==null){if(this._armature._replaceTextureAtlasData===null){a=t.BaseObject.borrowObject(t.PixiTextureAtlasData);a.copyFrom(e.parent);a.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=a}else{a=this._armature._replaceTextureAtlasData}e=a.getTexture(e.name)}var r=e.renderTexture;if(r!==null){if(this._geometryData!==null){var i=this._geometryData.data;var n=i.intArray;var s=i.floatArray;var o=n[this._geometryData.offset+0];var l=n[this._geometryData.offset+1];var h=n[this._geometryData.offset+2];if(h<0){h+=65536}var u=h+o*2;var f=this._armature._armatureData.scale;var _=this._renderDisplay;var m=a.width>0?a.width:r.baseTexture.width;var p=a.height>0?a.height:r.baseTexture.height;var c=e.region;_.vertices=new Float32Array(o*2);_.uvs=new Float32Array(o*2);_.indices=new Uint16Array(l*3);for(var d=0,y=o*2;d0&&r.inheritDeform;var s=this._renderDisplay;if(i!==null){var o=r.data;var l=o.intArray;var h=o.floatArray;var u=l[r.offset+0];var f=l[i.offset+1];if(f<0){f+=65536}for(var _=0,m=0,p=i.offset+2+a.length,c=f,d=0;_ void, target: any): void {
-            this.addDBEventListener(type, listener, target);
-        }
-        /**
-         * @inheritDoc
-         */
-        public removeEvent(type: EventStringType, listener: (event: EventObject) => void, target: any): void {
-            this.removeDBEventListener(type, listener, target);
-        }
     }
 }
\ No newline at end of file
diff --git a/Pixi/4.x/src/dragonBones/pixi/PixiFactory.ts b/Pixi/4.x/src/dragonBones/pixi/PixiFactory.ts
index 0acb26ca..43713b45 100644
--- a/Pixi/4.x/src/dragonBones/pixi/PixiFactory.ts
+++ b/Pixi/4.x/src/dragonBones/pixi/PixiFactory.ts
@@ -36,15 +36,7 @@ namespace dragonBones {
         private static _dragonBonesInstance: DragonBones = null as any;
         private static _factory: PixiFactory = null as any;
         private static _clockHandler(passedTime: number): void {
-            PixiFactory._dragonBonesInstance.advanceTime(PIXI.ticker.shared.elapsedMS * passedTime * 0.001);
-        }
-
-        private static _createDragonBones(): DragonBones {
-            const eventManager = new PixiArmatureDisplay();
-            const dragonBonesInstance = new DragonBones(eventManager);
-            PIXI.ticker.shared.add(PixiFactory._clockHandler, PixiFactory);
-
-            return dragonBonesInstance;
+            this._dragonBonesInstance.advanceTime(PIXI.ticker.shared.elapsedMS * passedTime * 0.001);
         }
         /**
          * - A global factory instance that can be used directly.
@@ -70,7 +62,9 @@ namespace dragonBones {
             super(dataParser);
 
             if (PixiFactory._dragonBonesInstance === null) {
-                PixiFactory._dragonBonesInstance = PixiFactory._createDragonBones();
+                const eventManager = new PixiArmatureDisplay();
+                PixiFactory._dragonBonesInstance = new DragonBones(eventManager);
+                PIXI.ticker.shared.add(PixiFactory._clockHandler, PixiFactory);
             }
 
             this._dragonBones = PixiFactory._dragonBonesInstance;
@@ -99,14 +93,8 @@ namespace dragonBones {
             return armature;
         }
 
-        protected _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot {
-            // tslint:disable-next-line:no-unused-expression
-            dataPackage;
-            // tslint:disable-next-line:no-unused-expression
-            armature;
-            
+        protected _buildSlot(_dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot {
             const slot = BaseObject.borrowObject(PixiSlot);
-
             slot.init(
                 slotData, armature,
                 new PIXI.Sprite(), new PIXI.mesh.Mesh(null as any, null as any, null as any, null as any, PIXI.mesh.Mesh.DRAW_MODES.TRIANGLES)
@@ -121,6 +109,8 @@ namespace dragonBones {
          * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature)
          * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data)
          * @returns The armature display container.
+         * @see dragonBones.IArmatureProxy
+         * @see dragonBones.BaseFactory#buildArmature
          * @version DragonBones 4.5
          * @example
          * 
@@ -135,6 +125,8 @@ namespace dragonBones {
          * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架)
          * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。 (如果未设置,则使用默认的皮肤数据)
          * @returns 骨架的显示容器。
+         * @see dragonBones.IArmatureProxy
+         * @see dragonBones.BaseFactory#buildArmature
          * @version DragonBones 4.5
          * @example
          * 
@@ -189,19 +181,5 @@ namespace dragonBones {
         public get soundEventManager(): PixiArmatureDisplay {
             return this._dragonBones.eventManager as PixiArmatureDisplay;
         }
-
-        /**
-         * - Deprecated, please refer to {@link #clock}.
-         * @deprecated
-         * @language en_US
-         */
-        /**
-         * - 已废弃,请参考 {@link #clock}。
-         * @deprecated
-         * @language zh_CN
-         */
-        public static get clock(): WorldClock {
-            return PixiFactory.factory.clock;
-        }
     }
 }
\ No newline at end of file
diff --git a/Pixi/4.x/src/dragonBones/pixi/PixiSlot.ts b/Pixi/4.x/src/dragonBones/pixi/PixiSlot.ts
index 39a94994..e3105f49 100644
--- a/Pixi/4.x/src/dragonBones/pixi/PixiSlot.ts
+++ b/Pixi/4.x/src/dragonBones/pixi/PixiSlot.ts
@@ -148,7 +148,9 @@ namespace dragonBones {
         }
 
         protected _updateColor(): void {
-            this._renderDisplay.alpha = this._colorTransform.alphaMultiplier;
+            const alpha = this._colorTransform.alphaMultiplier * this._globalAlpha;
+            this._renderDisplay.alpha = alpha;
+
             if (this._renderDisplay instanceof PIXI.Sprite || this._renderDisplay instanceof PIXI.mesh.Mesh) {
                 const color = (Math.round(this._colorTransform.redMultiplier * 0xFF) << 16) + (Math.round(this._colorTransform.greenMultiplier * 0xFF) << 8) + Math.round(this._colorTransform.blueMultiplier * 0xFF);
                 this._renderDisplay.tint = color;
@@ -157,12 +159,12 @@ namespace dragonBones {
         }
 
         protected _updateFrame(): void {
-            const currentVerticesData = (this._deformVertices !== null && this._display === this._meshDisplay) ? this._deformVertices.verticesData : null;
             let currentTextureData = this._textureData as (PixiTextureData | null);
 
             if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) {
                 let currentTextureAtlasData = currentTextureData.parent as PixiTextureAtlasData;
-                if (this._armature.replacedTexture !== null && this._rawDisplayDatas !== null && this._rawDisplayDatas.indexOf(this._displayData) >= 0) { // Update replaced texture atlas.
+
+                if (this._armature.replacedTexture !== null) { // Update replaced texture atlas.
                     if (this._armature._replaceTextureAtlasData === null) {
                         currentTextureAtlasData = BaseObject.borrowObject(PixiTextureAtlasData);
                         currentTextureAtlasData.copyFrom(currentTextureData.parent);
@@ -178,13 +180,13 @@ namespace dragonBones {
 
                 const renderTexture = currentTextureData.renderTexture;
                 if (renderTexture !== null) {
-                    if (currentVerticesData !== null) { // Mesh.
-                        const data = currentVerticesData.data;
+                    if (this._geometryData !== null) { // Mesh.
+                        const data = this._geometryData.data;
                         const intArray = data.intArray;
                         const floatArray = data.floatArray;
-                        const vertexCount = intArray[currentVerticesData.offset + BinaryOffset.MeshVertexCount];
-                        const triangleCount = intArray[currentVerticesData.offset + BinaryOffset.MeshTriangleCount];
-                        let vertexOffset = intArray[currentVerticesData.offset + BinaryOffset.MeshFloatOffset];
+                        const vertexCount = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexCount];
+                        const triangleCount = intArray[this._geometryData.offset + BinaryOffset.GeometryTriangleCount];
+                        let vertexOffset = intArray[this._geometryData.offset + BinaryOffset.GeometryFloatOffset];
 
                         if (vertexOffset < 0) {
                             vertexOffset += 65536; // Fixed out of bouds bug. 
@@ -194,31 +196,32 @@ namespace dragonBones {
                         const scale = this._armature._armatureData.scale;
 
                         const meshDisplay = this._renderDisplay as PIXI.mesh.Mesh;
-                        const textureAtlasWidth = currentTextureAtlasData.width > 0.0 ? currentTextureAtlasData.width : renderTexture.width;
-                        const textureAtlasHeight = currentTextureAtlasData.height > 0.0 ? currentTextureAtlasData.height : renderTexture.height;
+                        const textureAtlasWidth = currentTextureAtlasData.width > 0.0 ? currentTextureAtlasData.width : renderTexture.baseTexture.width;
+                        const textureAtlasHeight = currentTextureAtlasData.height > 0.0 ? currentTextureAtlasData.height : renderTexture.baseTexture.height;
+                        const region = currentTextureData.region;
 
                         meshDisplay.vertices = new Float32Array(vertexCount * 2) as any;
                         meshDisplay.uvs = new Float32Array(vertexCount * 2) as any;
                         meshDisplay.indices = new Uint16Array(triangleCount * 3) as any;
                         for (let i = 0, l = vertexCount * 2; i < l; ++i) {
                             meshDisplay.vertices[i] = floatArray[vertexOffset + i] * scale;
-                            meshDisplay.uvs[i] = floatArray[uvOffset + i];
                         }
 
                         for (let i = 0; i < triangleCount * 3; ++i) {
-                            meshDisplay.indices[i] = intArray[currentVerticesData.offset + BinaryOffset.MeshVertexIndices + i];
+                            meshDisplay.indices[i] = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexIndices + i];
                         }
 
-                        for (let i = 0, l = meshDisplay.uvs.length; i < l; i += 2) {
-                            const u = meshDisplay.uvs[i];
-                            const v = meshDisplay.uvs[i + 1];
+                        for (let i = 0, l = vertexCount * 2; i < l; i += 2) {
+                            const u = floatArray[uvOffset + i];
+                            const v = floatArray[uvOffset + i + 1];
+
                             if (currentTextureData.rotated) {
-                                meshDisplay.uvs[i] = (currentTextureData.region.x + (1.0 - v) * currentTextureData.region.width) / textureAtlasWidth;
-                                meshDisplay.uvs[i + 1] = (currentTextureData.region.y + u * currentTextureData.region.height) / textureAtlasHeight;
+                                meshDisplay.uvs[i] = (region.x + (1.0 - v) * region.width) / textureAtlasWidth;
+                                meshDisplay.uvs[i + 1] = (region.y + u * region.height) / textureAtlasHeight;
                             }
                             else {
-                                meshDisplay.uvs[i] = (currentTextureData.region.x + u * currentTextureData.region.width) / textureAtlasWidth;
-                                meshDisplay.uvs[i + 1] = (currentTextureData.region.y + v * currentTextureData.region.height) / textureAtlasHeight;
+                                meshDisplay.uvs[i] = (region.x + u * region.width) / textureAtlasWidth;
+                                meshDisplay.uvs[i + 1] = (region.y + v * region.height) / textureAtlasHeight;
                             }
                         }
 
@@ -226,6 +229,12 @@ namespace dragonBones {
                         meshDisplay.texture = renderTexture as any;
                         meshDisplay.dirty++;
                         meshDisplay.indexDirty++;
+
+                        const isSkinned = this._geometryData.weight !== null;
+                        const isSurface = this._parent._boneData.type !== BoneType.Bone;
+                        if (isSkinned || isSurface) {
+                            this._identityTransform();
+                        }
                     }
                     else { // Normal texture.
                         this._textureScale = currentTextureData.parent.scale * this._armature._armatureData.scale;
@@ -239,7 +248,7 @@ namespace dragonBones {
                 }
             }
 
-            if (currentVerticesData !== null) {
+            if (this._geometryData !== null) {
                 const meshDisplay = this._renderDisplay as PIXI.mesh.Mesh;
                 meshDisplay.texture = null as any;
                 meshDisplay.x = 0.0;
@@ -257,19 +266,19 @@ namespace dragonBones {
 
         protected _updateMesh(): void {
             const scale = this._armature._armatureData.scale;
-            const deformVertices = (this._deformVertices as DeformVertices).vertices;
-            const bones = (this._deformVertices as DeformVertices).bones;
-            const verticesData = (this._deformVertices as DeformVertices).verticesData as VerticesData;
-            const weightData = verticesData.weight;
+            const deformVertices = (this._displayFrame as DisplayFrame).deformVertices;
+            const bones = this._geometryBones;
+            const geometryData = this._geometryData as GeometryData;
+            const weightData = geometryData.weight;
 
-            const hasDeform = deformVertices.length > 0 && verticesData.inheritDeform;
+            const hasDeform = deformVertices.length > 0 && geometryData.inheritDeform;
             const meshDisplay = this._renderDisplay as PIXI.mesh.Mesh;
 
             if (weightData !== null) {
-                const data = verticesData.data;
+                const data = geometryData.data;
                 const intArray = data.intArray;
                 const floatArray = data.floatArray;
-                const vertexCount = intArray[verticesData.offset + BinaryOffset.MeshVertexCount];
+                const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount];
                 let weightFloatOffset = intArray[weightData.offset + BinaryOffset.WeigthFloatOffset];
 
                 if (weightFloatOffset < 0) {
@@ -308,21 +317,26 @@ namespace dragonBones {
                     meshDisplay.vertices[iD++] = yG;
                 }
             }
-            else if (hasDeform) {
+            else {
                 const isSurface = this._parent._boneData.type !== BoneType.Bone;
-                const data = verticesData.data;
+                const data = geometryData.data;
                 const intArray = data.intArray;
                 const floatArray = data.floatArray;
-                const vertexCount = intArray[verticesData.offset + BinaryOffset.MeshVertexCount];
-                let vertexOffset = intArray[verticesData.offset + BinaryOffset.MeshFloatOffset];
+                const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount];
+                let vertexOffset = intArray[geometryData.offset + BinaryOffset.GeometryFloatOffset];
 
                 if (vertexOffset < 0) {
                     vertexOffset += 65536; // Fixed out of bouds bug. 
                 }
 
                 for (let i = 0, l = vertexCount * 2; i < l; i += 2) {
-                    const x = floatArray[vertexOffset + i] * scale + deformVertices[i];
-                    const y = floatArray[vertexOffset + i + 1] * scale + deformVertices[i + 1];
+                    let x = floatArray[vertexOffset + i] * scale;
+                    let y = floatArray[vertexOffset + i + 1] * scale;
+
+                    if (hasDeform) {
+                        x += deformVertices[i];
+                        y += deformVertices[i + 1];
+                    }
 
                     if (isSurface) {
                         const matrix = (this._parent as Surface)._getGlobalTransformMatrix(x, y);
@@ -336,12 +350,6 @@ namespace dragonBones {
                 }
             }
         }
-        /**
-         * @internal
-         */
-        public _updateGlueMesh(): void {
-            // TODO
-        }
 
         protected _updateTransform(): void {
             throw new Error();
diff --git a/Pixi/4.x/src/dragonBones/pixi/PixiTextureAtlasData.ts b/Pixi/4.x/src/dragonBones/pixi/PixiTextureAtlasData.ts
index 310bac2e..80ddb09a 100644
--- a/Pixi/4.x/src/dragonBones/pixi/PixiTextureAtlasData.ts
+++ b/Pixi/4.x/src/dragonBones/pixi/PixiTextureAtlasData.ts
@@ -80,8 +80,8 @@ namespace dragonBones {
 
                     textureData.renderTexture = new PIXI.Texture(
                         this._renderTexture,
-                        textureData.region as PIXI.Rectangle, // No need to set frame.
-                        textureData.region as PIXI.Rectangle,
+                        new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height),
+                        new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height),
                         new PIXI.Rectangle(0, 0, textureData.region.width, textureData.region.height),
                         textureData.rotated as any // .d.ts bug
                     );
diff --git a/Pixi/4.x/tsconfig.json b/Pixi/4.x/tsconfig.json
index 2d3e0dc9..3696ad38 100644
--- a/Pixi/4.x/tsconfig.json
+++ b/Pixi/4.x/tsconfig.json
@@ -3,6 +3,7 @@
 		"watch": false,
 		"sourceMap": false,
 		"declaration": true,
+        "stripInternal": true,
 		"alwaysStrict": true,
 		"noImplicitAny": true,
 		"noImplicitThis": true,
@@ -25,7 +26,6 @@
 	],
 	"files": [
 		"./libs/pixi.js.d.ts",
-		"../../DragonBones/src/dragonBones/modules.ts",
 
 		"../../DragonBones/src/dragonBones/core/DragonBones.ts",
 		"../../DragonBones/src/dragonBones/core/BaseObject.ts",
@@ -55,7 +55,6 @@
 		"../../DragonBones/src/dragonBones/armature/Surface.ts",
 		"../../DragonBones/src/dragonBones/armature/Slot.ts",
 		"../../DragonBones/src/dragonBones/armature/Constraint.ts",
-		"../../DragonBones/src/dragonBones/armature/DeformVertices.ts",
 
 		"../../DragonBones/src/dragonBones/animation/IAnimatable.ts",
 		"../../DragonBones/src/dragonBones/animation/WorldClock.ts",
diff --git a/Pixi/5.x/README.md b/Pixi/5.x/README.md
new file mode 100644
index 00000000..9a4a5937
--- /dev/null
+++ b/Pixi/5.x/README.md
@@ -0,0 +1,23 @@
+## How to build
+* Clone or download [DragonBonesJS](https://github.com/DragonBones/DragonBonesJS/).
+* Install [Node.JS](https://nodejs.org/).
+* Open `DragonBonesJS/Pixi/5.x/` in command.
+* $ `npm install`
+* $ `npm run build`
+
+## Make sure project structure like this:
+```
+Your project
+    |-- libs
+        |-- pixi.js-legacy.d.ts
+    |-- node_modules
+        |-- ...
+    |-- out
+        |-- ...
+    |-- src
+        |-- ...
+    |-- ...
+```
+
+## Pixi declaration
+Compiled from PIXI Github
diff --git a/Pixi/5.x/libs/pixi.js-legacy.d.ts b/Pixi/5.x/libs/pixi.js-legacy.d.ts
new file mode 100644
index 00000000..6558877e
--- /dev/null
+++ b/Pixi/5.x/libs/pixi.js-legacy.d.ts
@@ -0,0 +1,23416 @@
+/**
+ * @namespace PIXI
+ */
+declare namespace PIXI {
+    /**
+     * String of the current PIXI version.
+     *
+     * @static
+     * @constant
+     * @memberof PIXI
+     * @name VERSION
+     * @type {string}
+     */
+    var VERSION: string;
+    /**
+     * This namespace contains WebGL-only display filters that can be applied
+     * to DisplayObjects using the {@link PIXI.DisplayObject#filters filters} property.
+     *
+     * Since PixiJS only had a handful of built-in filters, additional filters
+     * can be downloaded {@link https://github.com/pixijs/pixi-filters here} from the
+     * PixiJS Filters repository.
+     *
+     * All filters must extend {@link PIXI.Filter}.
+     *
+     * @example
+     * // Create a new application
+     * const app = new PIXI.Application();
+     *
+     * // Draw a green rectangle
+     * const rect = new PIXI.Graphics()
+     *     .beginFill(0x00ff00)
+     *     .drawRect(40, 40, 200, 200);
+     *
+     * // Add a blur filter
+     * rect.filters = [new PIXI.filters.BlurFilter()];
+     *
+     * // Display rectangle
+     * app.stage.addChild(rect);
+     * document.body.appendChild(app.view);
+     * @namespace PIXI.filters
+     */
+    namespace filters {
+        /**
+         * @class BlurXFilter
+         * @memberof PIXI.filters
+         * @deprecated since 5.0.0
+         * @see PIXI.filters.BlurFilterPass
+         */
+        class BlurXFilter {
+        }
+        /**
+         * @class BlurYFilter
+         * @memberof PIXI.filters
+         * @deprecated since 5.0.0
+         * @see PIXI.filters.BlurFilterPass
+         */
+        class BlurYFilter {
+        }
+        /**
+         * Simplest filter - applies alpha.
+         *
+         * Use this instead of Container's alpha property to avoid visual layering of individual elements.
+         * AlphaFilter applies alpha evenly across the entire display object and any opaque elements it contains.
+         * If elements are not opaque, they will blend with each other anyway.
+         *
+         * Very handy if you want to use common features of all filters:
+         *
+         * 1. Assign a blendMode to this filter, blend all elements inside display object with background.
+         *
+         * 2. To use clipping in display coordinates, assign a filterArea to the same container that has this filter.
+         *
+         * @class
+         * @extends PIXI.Filter
+         * @memberof PIXI.filters
+         */
+        class AlphaFilter extends PIXI.Filter {
+            constructor(alpha?: number);
+            /**
+             * Coefficient for alpha multiplication
+             *
+             * @member {number}
+             * @default 1
+             */
+            alpha: number;
+            /**
+             * The padding of the filter. Some filters require extra space to breath such as a blur.
+             * Increasing this will add extra width and height to the bounds of the object that the
+             * filter is applied to.
+             *
+             * @member {number} PIXI.Filter#padding
+             */
+            padding: number;
+            /**
+             * The resolution of the filter. Setting this to be lower will lower the quality but
+             * increase the performance of the filter.
+             *
+             * @member {number} PIXI.Filter#resolution
+             */
+            resolution: number;
+            /**
+             * If enabled is true the filter is applied, if false it will not.
+             *
+             * @member {boolean} PIXI.Filter#enabled
+             */
+            enabled: boolean;
+            /**
+             * If enabled, PixiJS will fit the filter area into boundaries for better performance.
+             * Switch it off if it does not work for specific shader.
+             *
+             * @member {boolean} PIXI.Filter#autoFit
+             */
+            autoFit: boolean;
+            /**
+             * Legacy filters use position and uvs from attributes
+             * @member {boolean} PIXI.Filter#legacy
+             * @readonly
+             */
+            readonly legacy: boolean;
+            /**
+             * The WebGL state the filter requires to render
+             * @member {PIXI.State} PIXI.Filter#state
+             */
+            state: PIXI.State;
+            /**
+             * Applies the filter
+             *
+             * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
+             * @param {PIXI.RenderTexture} input - The input render target.
+             * @param {PIXI.RenderTexture} output - The target to output to.
+             * @param {boolean} clear - Should the output be cleared before rendering to it
+             * @param {object} [currentState] - It's current state of filter.
+             *        There are some useful properties in the currentState :
+             *        target, filters, sourceFrame, destinationFrame, renderTarget, resolution
+             */
+            apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clear: boolean, currentState?: any): void;
+            /**
+             * Sets the blendmode of the filter
+             *
+             * @member {number}
+             * @default PIXI.BLEND_MODES.NORMAL
+             */
+            blendMode: number;
+            /**
+             * Shader uniform values, shortcut for `uniformGroup.uniforms`
+             * @readonly
+             * @member {object}
+             */
+            readonly uniforms: any;
+        }
+        /**
+         * The BlurFilter applies a Gaussian blur to an object.
+         *
+         * The strength of the blur can be set for the x-axis and y-axis separately.
+         *
+         * @class
+         * @extends PIXI.Filter
+         * @memberof PIXI.filters
+         */
+        class BlurFilter extends PIXI.Filter {
+            constructor(strength?: number, quality?: number, resolution?: number, kernelSize?: number);
+            /**
+             * Applies the filter.
+             *
+             * @param {PIXI.systems.FilterSystem} filterManager - The manager.
+             * @param {PIXI.RenderTexture} input - The input target.
+             * @param {PIXI.RenderTexture} output - The output target.
+             */
+            apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture): void;
+            /**
+             * Sets the strength of both the blurX and blurY properties simultaneously
+             *
+             * @member {number}
+             * @default 2
+             */
+            blur: number;
+            /**
+             * Sets the number of passes for blur. More passes means higher quaility bluring.
+             *
+             * @member {number}
+             * @default 1
+             */
+            quality: number;
+            /**
+             * Sets the strength of the blurX property
+             *
+             * @member {number}
+             * @default 2
+             */
+            blurX: number;
+            /**
+             * Sets the strength of the blurY property
+             *
+             * @member {number}
+             * @default 2
+             */
+            blurY: number;
+            /**
+             * Sets the blendmode of the filter
+             *
+             * @member {number}
+             * @default PIXI.BLEND_MODES.NORMAL
+             */
+            blendMode: number;
+            /**
+             * If set to true the edge of the target will be clamped
+             *
+             * @member {bool}
+             * @default false
+             */
+            repeatEdgePixels: boolean;
+            /**
+             * The padding of the filter. Some filters require extra space to breath such as a blur.
+             * Increasing this will add extra width and height to the bounds of the object that the
+             * filter is applied to.
+             *
+             * @member {number} PIXI.Filter#padding
+             */
+            padding: number;
+            /**
+             * The resolution of the filter. Setting this to be lower will lower the quality but
+             * increase the performance of the filter.
+             *
+             * @member {number} PIXI.Filter#resolution
+             */
+            resolution: number;
+            /**
+             * If enabled is true the filter is applied, if false it will not.
+             *
+             * @member {boolean} PIXI.Filter#enabled
+             */
+            enabled: boolean;
+            /**
+             * If enabled, PixiJS will fit the filter area into boundaries for better performance.
+             * Switch it off if it does not work for specific shader.
+             *
+             * @member {boolean} PIXI.Filter#autoFit
+             */
+            autoFit: boolean;
+            /**
+             * Legacy filters use position and uvs from attributes
+             * @member {boolean} PIXI.Filter#legacy
+             * @readonly
+             */
+            readonly legacy: boolean;
+            /**
+             * The WebGL state the filter requires to render
+             * @member {PIXI.State} PIXI.Filter#state
+             */
+            state: PIXI.State;
+            /**
+             * Shader uniform values, shortcut for `uniformGroup.uniforms`
+             * @readonly
+             * @member {object}
+             */
+            readonly uniforms: any;
+        }
+        /**
+         * The BlurFilterPass applies a horizontal or vertical Gaussian blur to an object.
+         *
+         * @class
+         * @extends PIXI.Filter
+         * @memberof PIXI.filters
+         */
+        class BlurFilterPass extends PIXI.Filter {
+            constructor(horizontal: boolean, strength: number, quality: number, resolution: number, kernelSize?: number);
+            /**
+             * Sets the strength of both the blur.
+             *
+             * @member {number}
+             * @default 16
+             */
+            blur: number;
+            /**
+             * Sets the quality of the blur by modifying the number of passes. More passes means higher
+             * quaility bluring but the lower the performance.
+             *
+             * @member {number}
+             * @default 4
+             */
+            quality: number;
+            /**
+             * The padding of the filter. Some filters require extra space to breath such as a blur.
+             * Increasing this will add extra width and height to the bounds of the object that the
+             * filter is applied to.
+             *
+             * @member {number} PIXI.Filter#padding
+             */
+            padding: number;
+            /**
+             * The resolution of the filter. Setting this to be lower will lower the quality but
+             * increase the performance of the filter.
+             *
+             * @member {number} PIXI.Filter#resolution
+             */
+            resolution: number;
+            /**
+             * If enabled is true the filter is applied, if false it will not.
+             *
+             * @member {boolean} PIXI.Filter#enabled
+             */
+            enabled: boolean;
+            /**
+             * If enabled, PixiJS will fit the filter area into boundaries for better performance.
+             * Switch it off if it does not work for specific shader.
+             *
+             * @member {boolean} PIXI.Filter#autoFit
+             */
+            autoFit: boolean;
+            /**
+             * Legacy filters use position and uvs from attributes
+             * @member {boolean} PIXI.Filter#legacy
+             * @readonly
+             */
+            readonly legacy: boolean;
+            /**
+             * The WebGL state the filter requires to render
+             * @member {PIXI.State} PIXI.Filter#state
+             */
+            state: PIXI.State;
+            /**
+             * Applies the filter
+             *
+             * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
+             * @param {PIXI.RenderTexture} input - The input render target.
+             * @param {PIXI.RenderTexture} output - The target to output to.
+             * @param {boolean} clear - Should the output be cleared before rendering to it
+             * @param {object} [currentState] - It's current state of filter.
+             *        There are some useful properties in the currentState :
+             *        target, filters, sourceFrame, destinationFrame, renderTarget, resolution
+             */
+            apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clear: boolean, currentState?: any): void;
+            /**
+             * Sets the blendmode of the filter
+             *
+             * @member {number}
+             * @default PIXI.BLEND_MODES.NORMAL
+             */
+            blendMode: number;
+            /**
+             * Shader uniform values, shortcut for `uniformGroup.uniforms`
+             * @readonly
+             * @member {object}
+             */
+            readonly uniforms: any;
+        }
+        /**
+         * The ColorMatrixFilter class lets you apply a 5x4 matrix transformation on the RGBA
+         * color and alpha values of every pixel on your displayObject to produce a result
+         * with a new set of RGBA color and alpha values. It's pretty powerful!
+         *
+         * ```js
+         *  let colorMatrix = new PIXI.filters.ColorMatrixFilter();
+         *  container.filters = [colorMatrix];
+         *  colorMatrix.contrast(2);
+         * ```
+         * @author Clément Chenebault 
+         * @class
+         * @extends PIXI.Filter
+         * @memberof PIXI.filters
+         */
+        class ColorMatrixFilter extends PIXI.Filter {
+            constructor();
+            /**
+             * Transforms current matrix and set the new one
+             *
+             * @param {number[]} matrix - 5x4 matrix
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            _loadMatrix(matrix: number[], multiply: boolean): void;
+            /**
+             * Adjusts brightness
+             *
+             * @param {number} b - value of the brigthness (0-1, where 0 is black)
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            brightness(b: number, multiply: boolean): void;
+            /**
+             * Set the matrices in grey scales
+             *
+             * @param {number} scale - value of the grey (0-1, where 0 is black)
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            greyscale(scale: number, multiply: boolean): void;
+            /**
+             * Set the black and white matrice.
+             *
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            blackAndWhite(multiply: boolean): void;
+            /**
+             * Set the hue property of the color
+             *
+             * @param {number} rotation - in degrees
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            hue(rotation: number, multiply: boolean): void;
+            /**
+             * Set the contrast matrix, increase the separation between dark and bright
+             * Increase contrast : shadows darker and highlights brighter
+             * Decrease contrast : bring the shadows up and the highlights down
+             *
+             * @param {number} amount - value of the contrast (0-1)
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            contrast(amount: number, multiply: boolean): void;
+            /**
+             * Set the saturation matrix, increase the separation between colors
+             * Increase saturation : increase contrast, brightness, and sharpness
+             *
+             * @param {number} amount - The saturation amount (0-1)
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            saturate(amount: number, multiply: boolean): void;
+            /**
+             * Desaturate image (remove color)
+             *
+             * Call the saturate function
+             *
+             */
+            desaturate(): void;
+            /**
+             * Negative image (inverse of classic rgb matrix)
+             *
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            negative(multiply: boolean): void;
+            /**
+             * Sepia image
+             *
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            sepia(multiply: boolean): void;
+            /**
+             * Color motion picture process invented in 1916 (thanks Dominic Szablewski)
+             *
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            technicolor(multiply: boolean): void;
+            /**
+             * Polaroid filter
+             *
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            polaroid(multiply: boolean): void;
+            /**
+             * Filter who transforms : Red -> Blue and Blue -> Red
+             *
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            toBGR(multiply: boolean): void;
+            /**
+             * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)
+             *
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            kodachrome(multiply: boolean): void;
+            /**
+             * Brown delicious browni filter (thanks Dominic Szablewski)
+             *
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            browni(multiply: boolean): void;
+            /**
+             * Vintage filter (thanks Dominic Szablewski)
+             *
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            vintage(multiply: boolean): void;
+            /**
+             * We don't know exactly what it does, kind of gradient map, but funny to play with!
+             *
+             * @param {number} desaturation - Tone values.
+             * @param {number} toned - Tone values.
+             * @param {string} lightColor - Tone values, example: `0xFFE580`
+             * @param {string} darkColor - Tone values, example: `0xFFE580`
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            colorTone(desaturation: number, toned: number, lightColor: string, darkColor: string, multiply: boolean): void;
+            /**
+             * Night effect
+             *
+             * @param {number} intensity - The intensity of the night effect.
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            night(intensity: number, multiply: boolean): void;
+            /**
+             * Predator effect
+             *
+             * Erase the current matrix by setting a new indepent one
+             *
+             * @param {number} amount - how much the predator feels his future victim
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            predator(amount: number, multiply: boolean): void;
+            /**
+             * LSD effect
+             *
+             * Multiply the current matrix
+             *
+             * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,
+             *  just set the current matrix with @param matrix
+             */
+            lsd(multiply: boolean): void;
+            /**
+             * Erase the current matrix by setting the default one
+             *
+             */
+            reset(): void;
+            /**
+             * The matrix of the color matrix filter
+             *
+             * @member {number[]}
+             * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]
+             */
+            matrix: number[];
+            /**
+             * The opacity value to use when mixing the original and resultant colors.
+             *
+             * When the value is 0, the original color is used without modification.
+             * When the value is 1, the result color is used.
+             * When in the range (0, 1) the color is interpolated between the original and result by this amount.
+             *
+             * @member {number}
+             * @default 1
+             */
+            alpha: number;
+            /**
+             * The padding of the filter. Some filters require extra space to breath such as a blur.
+             * Increasing this will add extra width and height to the bounds of the object that the
+             * filter is applied to.
+             *
+             * @member {number} PIXI.Filter#padding
+             */
+            padding: number;
+            /**
+             * The resolution of the filter. Setting this to be lower will lower the quality but
+             * increase the performance of the filter.
+             *
+             * @member {number} PIXI.Filter#resolution
+             */
+            resolution: number;
+            /**
+             * If enabled is true the filter is applied, if false it will not.
+             *
+             * @member {boolean} PIXI.Filter#enabled
+             */
+            enabled: boolean;
+            /**
+             * If enabled, PixiJS will fit the filter area into boundaries for better performance.
+             * Switch it off if it does not work for specific shader.
+             *
+             * @member {boolean} PIXI.Filter#autoFit
+             */
+            autoFit: boolean;
+            /**
+             * Legacy filters use position and uvs from attributes
+             * @member {boolean} PIXI.Filter#legacy
+             * @readonly
+             */
+            readonly legacy: boolean;
+            /**
+             * The WebGL state the filter requires to render
+             * @member {PIXI.State} PIXI.Filter#state
+             */
+            state: PIXI.State;
+            /**
+             * Applies the filter
+             *
+             * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
+             * @param {PIXI.RenderTexture} input - The input render target.
+             * @param {PIXI.RenderTexture} output - The target to output to.
+             * @param {boolean} clear - Should the output be cleared before rendering to it
+             * @param {object} [currentState] - It's current state of filter.
+             *        There are some useful properties in the currentState :
+             *        target, filters, sourceFrame, destinationFrame, renderTarget, resolution
+             */
+            apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clear: boolean, currentState?: any): void;
+            /**
+             * Sets the blendmode of the filter
+             *
+             * @member {number}
+             * @default PIXI.BLEND_MODES.NORMAL
+             */
+            blendMode: number;
+            /**
+             * Shader uniform values, shortcut for `uniformGroup.uniforms`
+             * @readonly
+             * @member {object}
+             */
+            readonly uniforms: any;
+        }
+        /**
+         * The DisplacementFilter class uses the pixel values from the specified texture
+         * (called the displacement map) to perform a displacement of an object.
+         *
+         * You can use this filter to apply all manor of crazy warping effects.
+         * Currently the `r` property of the texture is used to offset the `x`
+         * and the `g` property of the texture is used to offset the `y`.
+         *
+         * The way it works is it uses the values of the displacement map to look up the
+         * correct pixels to output. This means it's not technically moving the original.
+         * Instead, it's starting at the output and asking "which pixel from the original goes here".
+         * For example, if a displacement map pixel has `red = 1` and the filter scale is `20`,
+         * this filter will output the pixel approximately 20 pixels to the right of the original.
+         *
+         * @class
+         * @extends PIXI.Filter
+         * @memberof PIXI.filters
+         */
+        class DisplacementFilter extends PIXI.Filter {
+            constructor(sprite: PIXI.Sprite, scale?: number);
+            /**
+             * scaleX, scaleY for displacements
+             * @member {PIXI.Point} PIXI.filters.DisplacementFilter#scale
+             */
+            scale: PIXI.Point;
+            /**
+             * Applies the filter.
+             *
+             * @param {PIXI.systems.FilterSystem} filterManager - The manager.
+             * @param {PIXI.RenderTexture} input - The input target.
+             * @param {PIXI.RenderTexture} output - The output target.
+             * @param {boolean} clear - Should the output be cleared before rendering to it.
+             */
+            apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clear: boolean): void;
+            /**
+             * The texture used for the displacement map. Must be power of 2 sized texture.
+             *
+             * @member {PIXI.Texture}
+             */
+            map: PIXI.Texture;
+            /**
+             * The padding of the filter. Some filters require extra space to breath such as a blur.
+             * Increasing this will add extra width and height to the bounds of the object that the
+             * filter is applied to.
+             *
+             * @member {number} PIXI.Filter#padding
+             */
+            padding: number;
+            /**
+             * The resolution of the filter. Setting this to be lower will lower the quality but
+             * increase the performance of the filter.
+             *
+             * @member {number} PIXI.Filter#resolution
+             */
+            resolution: number;
+            /**
+             * If enabled is true the filter is applied, if false it will not.
+             *
+             * @member {boolean} PIXI.Filter#enabled
+             */
+            enabled: boolean;
+            /**
+             * If enabled, PixiJS will fit the filter area into boundaries for better performance.
+             * Switch it off if it does not work for specific shader.
+             *
+             * @member {boolean} PIXI.Filter#autoFit
+             */
+            autoFit: boolean;
+            /**
+             * Legacy filters use position and uvs from attributes
+             * @member {boolean} PIXI.Filter#legacy
+             * @readonly
+             */
+            readonly legacy: boolean;
+            /**
+             * The WebGL state the filter requires to render
+             * @member {PIXI.State} PIXI.Filter#state
+             */
+            state: PIXI.State;
+            /**
+             * Sets the blendmode of the filter
+             *
+             * @member {number}
+             * @default PIXI.BLEND_MODES.NORMAL
+             */
+            blendMode: number;
+            /**
+             * Shader uniform values, shortcut for `uniformGroup.uniforms`
+             * @readonly
+             * @member {object}
+             */
+            readonly uniforms: any;
+        }
+        /**
+         * Basic FXAA (Fast Approximate Anti-Aliasing) implementation based on the code on geeks3d.com
+         * with the modification that the texture2DLod stuff was removed since it is unsupported by WebGL.
+         *
+         * @see https://github.com/mitsuhiko/webgl-meincraft
+         *
+         * @class
+         * @extends PIXI.Filter
+         * @memberof PIXI.filters
+         *
+         */
+        class FXAAFilter extends PIXI.Filter {
+            constructor();
+            /**
+             * The padding of the filter. Some filters require extra space to breath such as a blur.
+             * Increasing this will add extra width and height to the bounds of the object that the
+             * filter is applied to.
+             *
+             * @member {number} PIXI.Filter#padding
+             */
+            padding: number;
+            /**
+             * The resolution of the filter. Setting this to be lower will lower the quality but
+             * increase the performance of the filter.
+             *
+             * @member {number} PIXI.Filter#resolution
+             */
+            resolution: number;
+            /**
+             * If enabled is true the filter is applied, if false it will not.
+             *
+             * @member {boolean} PIXI.Filter#enabled
+             */
+            enabled: boolean;
+            /**
+             * If enabled, PixiJS will fit the filter area into boundaries for better performance.
+             * Switch it off if it does not work for specific shader.
+             *
+             * @member {boolean} PIXI.Filter#autoFit
+             */
+            autoFit: boolean;
+            /**
+             * Legacy filters use position and uvs from attributes
+             * @member {boolean} PIXI.Filter#legacy
+             * @readonly
+             */
+            readonly legacy: boolean;
+            /**
+             * The WebGL state the filter requires to render
+             * @member {PIXI.State} PIXI.Filter#state
+             */
+            state: PIXI.State;
+            /**
+             * Applies the filter
+             *
+             * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
+             * @param {PIXI.RenderTexture} input - The input render target.
+             * @param {PIXI.RenderTexture} output - The target to output to.
+             * @param {boolean} clear - Should the output be cleared before rendering to it
+             * @param {object} [currentState] - It's current state of filter.
+             *        There are some useful properties in the currentState :
+             *        target, filters, sourceFrame, destinationFrame, renderTarget, resolution
+             */
+            apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clear: boolean, currentState?: any): void;
+            /**
+             * Sets the blendmode of the filter
+             *
+             * @member {number}
+             * @default PIXI.BLEND_MODES.NORMAL
+             */
+            blendMode: number;
+            /**
+             * Shader uniform values, shortcut for `uniformGroup.uniforms`
+             * @readonly
+             * @member {object}
+             */
+            readonly uniforms: any;
+        }
+        /**
+         * A Noise effect filter.
+         *
+         * @class
+         * @extends PIXI.Filter
+         * @memberof PIXI.filters
+         */
+        class NoiseFilter extends PIXI.Filter {
+            constructor(noise?: number, seed?: number);
+            /**
+             * The amount of noise to apply, this value should be in the range (0, 1].
+             *
+             * @member {number}
+             * @default 0.5
+             */
+            noise: number;
+            /**
+             * A seed value to apply to the random noise generation. `Math.random()` is a good value to use.
+             *
+             * @member {number}
+             */
+            seed: number;
+            /**
+             * The padding of the filter. Some filters require extra space to breath such as a blur.
+             * Increasing this will add extra width and height to the bounds of the object that the
+             * filter is applied to.
+             *
+             * @member {number} PIXI.Filter#padding
+             */
+            padding: number;
+            /**
+             * The resolution of the filter. Setting this to be lower will lower the quality but
+             * increase the performance of the filter.
+             *
+             * @member {number} PIXI.Filter#resolution
+             */
+            resolution: number;
+            /**
+             * If enabled is true the filter is applied, if false it will not.
+             *
+             * @member {boolean} PIXI.Filter#enabled
+             */
+            enabled: boolean;
+            /**
+             * If enabled, PixiJS will fit the filter area into boundaries for better performance.
+             * Switch it off if it does not work for specific shader.
+             *
+             * @member {boolean} PIXI.Filter#autoFit
+             */
+            autoFit: boolean;
+            /**
+             * Legacy filters use position and uvs from attributes
+             * @member {boolean} PIXI.Filter#legacy
+             * @readonly
+             */
+            readonly legacy: boolean;
+            /**
+             * The WebGL state the filter requires to render
+             * @member {PIXI.State} PIXI.Filter#state
+             */
+            state: PIXI.State;
+            /**
+             * Applies the filter
+             *
+             * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
+             * @param {PIXI.RenderTexture} input - The input render target.
+             * @param {PIXI.RenderTexture} output - The target to output to.
+             * @param {boolean} clear - Should the output be cleared before rendering to it
+             * @param {object} [currentState] - It's current state of filter.
+             *        There are some useful properties in the currentState :
+             *        target, filters, sourceFrame, destinationFrame, renderTarget, resolution
+             */
+            apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clear: boolean, currentState?: any): void;
+            /**
+             * Sets the blendmode of the filter
+             *
+             * @member {number}
+             * @default PIXI.BLEND_MODES.NORMAL
+             */
+            blendMode: number;
+            /**
+             * Shader uniform values, shortcut for `uniformGroup.uniforms`
+             * @readonly
+             * @member {object}
+             */
+            readonly uniforms: any;
+        }
+    }
+    /**
+     * Deprecations (backward compatibilities) are automatically applied for browser bundles
+     * in the UMD module format. If using Webpack or Rollup, you'll need to apply these
+     * deprecations manually by doing something like this:
+     * @example
+     * import * as PIXI from 'pixi.js';
+     * PIXI.useDeprecated(); // MUST be bound to namespace
+     * @memberof PIXI
+     * @function useDeprecated
+     */
+    function useDeprecated(): void;
+    /**
+     * @constant {RegExp|string} SVG_SIZE
+     * @memberof PIXI
+     * @see PIXI.resources.SVGResource.SVG_SIZE
+     * @deprecated since 5.0.0
+     */
+    var SVG_SIZE: RegExp | string;
+    /**
+     * @class PIXI.TransformStatic
+     * @deprecated since 5.0.0
+     * @see PIXI.Transform
+     */
+    class TransformStatic {
+    }
+    /**
+     * @class PIXI.TransformBase
+     * @deprecated since 5.0.0
+     * @see PIXI.Transform
+     */
+    class TransformBase {
+    }
+    /**
+     * Constants that specify the transform type.
+     *
+     * @static
+     * @constant
+     * @name TRANSFORM_MODE
+     * @memberof PIXI
+     * @enum {number}
+     * @deprecated since 5.0.0
+     * @property {number} STATIC
+     * @property {number} DYNAMIC
+     */
+    enum TRANSFORM_MODE {
+        STATIC,
+        DYNAMIC
+    }
+    /**
+     * @class PIXI.WebGLRenderer
+     * @see PIXI.Renderer
+     * @deprecated since 5.0.0
+     */
+    class WebGLRenderer {
+    }
+    /**
+     * @class PIXI.CanvasRenderTarget
+     * @see PIXI.utils.CanvasRenderTarget
+     * @deprecated since 5.0.0
+     */
+    class CanvasRenderTarget {
+    }
+    /**
+     * @memberof PIXI
+     * @name loader
+     * @type {PIXI.Loader}
+     * @see PIXI.Loader.shared
+     * @deprecated since 5.0.0
+     */
+    var loader: PIXI.Loader;
+    /**
+     * @class PIXI.FilterManager
+     * @see PIXI.systems.FilterSystem
+     * @deprecated since 5.0.0
+     */
+    class FilterManager {
+        /**
+         * @method PIXI.FilterManager#getRenderTarget
+         * @deprecated since 5.0.0
+         * @see PIXI.systems.FilterSystem#getFilterTexture
+         */
+        getRenderTarget(): void;
+        /**
+         * @method PIXI.FilterManager#returnRenderTarget
+         * @deprecated since 5.0.0
+         * @see PIXI.systems.FilterSystem#returnFilterTexture
+         */
+        returnRenderTarget(): void;
+    }
+    /**
+     * This namespace has been removed. All classes previous nested
+     * under this namespace have been moved to the top-level `PIXI` object.
+     * @namespace PIXI.extras
+     * @deprecated since 5.0.0
+     */
+    namespace extras {
+        /**
+         * @class PIXI.extras.TilingSprite
+         * @see PIXI.TilingSprite
+         * @deprecated since 5.0.0
+         */
+        class TilingSprite {
+        }
+        /**
+         * @class PIXI.extras.TilingSpriteRenderer
+         * @see PIXI.TilingSpriteRenderer
+         * @deprecated since 5.0.0
+         */
+        class TilingSpriteRenderer {
+        }
+        /**
+         * @class PIXI.extras.AnimatedSprite
+         * @see PIXI.AnimatedSprite
+         * @deprecated since 5.0.0
+         */
+        class AnimatedSprite {
+        }
+        /**
+         * @class PIXI.extras.BitmapText
+         * @see PIXI.BitmapText
+         * @deprecated since 5.0.0
+         */
+        class BitmapText {
+        }
+    }
+    /**
+     * All classes on this namespace have moved to the high-level `PIXI` object.
+     * @namespace PIXI.mesh
+     * @deprecated since 5.0.0
+     */
+    namespace mesh {
+        /**
+         * @class PIXI.mesh.Mesh
+         * @see PIXI.SimpleMesh
+         * @deprecated since 5.0.0
+         */
+        class Mesh {
+        }
+        /**
+         * @class PIXI.mesh.NineSlicePlane
+         * @see PIXI.NineSlicePlane
+         * @deprecated since 5.0.0
+         */
+        class NineSlicePlane {
+        }
+        /**
+         * @class PIXI.mesh.Plane
+         * @see PIXI.SimplePlane
+         * @deprecated since 5.0.0
+         */
+        class Plane {
+        }
+        /**
+         * @class PIXI.mesh.Rope
+         * @see PIXI.SimpleRope
+         * @deprecated since 5.0.0
+         */
+        class Rope {
+        }
+        /**
+         * @class PIXI.mesh.RawMesh
+         * @see PIXI.Mesh
+         * @deprecated since 5.0.0
+         */
+        class RawMesh {
+        }
+        /**
+         * @class PIXI.mesh.CanvasMeshRenderer
+         * @see PIXI.CanvasMeshRenderer
+         * @deprecated since 5.0.0
+         */
+        class CanvasMeshRenderer {
+        }
+        /**
+         * @class PIXI.mesh.MeshRenderer
+         * @see PIXI.MeshRenderer
+         * @deprecated since 5.0.0
+         */
+        class MeshRenderer {
+        }
+    }
+    /**
+     * This namespace has been removed and items have been moved to
+     * the top-level `PIXI` object.
+     * @namespace PIXI.particles
+     * @deprecated since 5.0.0
+     */
+    namespace particles {
+        /**
+         * @class PIXI.particles.ParticleContainer
+         * @deprecated since 5.0.0
+         * @see PIXI.ParticleContainer
+         */
+        class ParticleContainer {
+        }
+        /**
+         * @class PIXI.particles.ParticleRenderer
+         * @deprecated since 5.0.0
+         * @see PIXI.ParticleRenderer
+         */
+        class ParticleRenderer {
+        }
+    }
+    /**
+     * This namespace has been removed and items have been moved to
+     * the top-level `PIXI` object.
+     * @namespace PIXI.ticker
+     * @deprecated since 5.0.0
+     */
+    namespace ticker {
+        /**
+         * @class PIXI.ticker.Ticker
+         * @deprecated since 5.0.0
+         * @see PIXI.Ticker
+         */
+        class Ticker {
+        }
+        /**
+         * @name PIXI.ticker.shared
+         * @type {PIXI.Ticker}
+         * @deprecated since 5.0.0
+         * @see PIXI.Ticker.shared
+         */
+        var shared: PIXI.Ticker;
+    }
+    /**
+     * All classes on this namespace have moved to the high-level `PIXI` object.
+     * @namespace PIXI.loaders
+     * @deprecated since 5.0.0
+     */
+    namespace loaders {
+        /**
+         * @class PIXI.loaders.Loader
+         * @see PIXI.Loader
+         * @deprecated since 5.0.0
+         */
+        class Loader {
+            /**
+             * @function PIXI.loaders.Loader.addPixiMiddleware
+             * @see PIXI.Loader.registerPlugin
+             * @deprecated since 5.0.0
+             * @param {function} middleware
+             */
+            static addPixiMiddleware(middleware: (...params: any[]) => any): void;
+        }
+        /**
+         * @class PIXI.loaders.Resource
+         * @see PIXI.LoaderResource
+         * @deprecated since 5.0.0
+         */
+        class Resource {
+        }
+        /**
+         * @function PIXI.loaders.bitmapFontParser
+         * @see PIXI.BitmapFontLoader.use
+         * @deprecated since 5.0.0
+         */
+        function bitmapFontParser(): void;
+        /**
+         * @function PIXI.loaders.parseBitmapFontData
+         * @see PIXI.BitmapFontLoader.parse
+         * @deprecated since 5.0.0
+         */
+        function parseBitmapFontData(): void;
+        /**
+         * @function PIXI.loaders.spritesheetParser
+         * @see PIXI.SpritesheetLoader.use
+         * @deprecated since 5.0.0
+         */
+        function spritesheetParser(): void;
+        /**
+         * @function PIXI.loaders.getResourcePath
+         * @see PIXI.SpritesheetLoader.getResourcePath
+         * @deprecated since 5.0.0
+         */
+        function getResourcePath(): void;
+    }
+    /**
+     * This namespace contains an accessibility plugin for allowing interaction via the keyboard.
+     *
+     * Do not instantiate this plugin directly. It is available from the `renderer.plugins` property.
+     * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.
+     * @namespace PIXI.accessibility
+     */
+    namespace accessibility {
+        /**
+         * The Accessibility manager recreates the ability to tab and have content read by screen readers.
+         * This is very important as it can possibly help people with disabilities access PixiJS content.
+         *
+         * A DisplayObject can be made accessible just like it can be made interactive. This manager will map the
+         * events as if the mouse was being used, minimizing the effort required to implement.
+         *
+         * An instance of this class is automatically created by default, and can be found at `renderer.plugins.accessibility`
+         *
+         * @class
+         * @memberof PIXI.accessibility
+         */
+        class AccessibilityManager {
+            constructor(renderer: PIXI.CanvasRenderer | PIXI.Renderer);
+            /**
+             * Setting this to true will visually show the divs.
+             *
+             * @type {boolean}
+             */
+            debug: boolean;
+            /**
+             * The renderer this accessibility manager works for.
+             *
+             * @member {PIXI.AbstractRenderer} PIXI.accessibility.AccessibilityManager#renderer
+             */
+            renderer: PIXI.AbstractRenderer;
+            /**
+             * A flag
+             * @type {boolean}
+             * @readonly
+             */
+            readonly isActive: boolean;
+            /**
+             * A flag
+             * @type {boolean}
+             * @readonly
+             */
+            readonly isMobileAccessibility: boolean;
+            /**
+             * Adjust the hit area based on the bounds of a display object
+             *
+             * @param {Rectangle} hitArea - Bounds of the child
+             */
+            capHitArea(hitArea: Rectangle): void;
+            /**
+             * Destroys the accessibility manager
+             *
+             */
+            destroy(): void;
+        }
+    }
+    /**
+     * Convenience class to create a new PIXI application.
+     *
+     * This class automatically creates the renderer, ticker and root container.
+     *
+     * @example
+     * // Create the application
+     * const app = new PIXI.Application();
+     *
+     * // Add the view to the DOM
+     * document.body.appendChild(app.view);
+     *
+     * // ex, add display objects
+     * app.stage.addChild(PIXI.Sprite.from('something.png'));
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Application {
+        constructor(options?: {
+            autoStart?: boolean;
+            width?: number;
+            height?: number;
+            view?: HTMLCanvasElement;
+            transparent?: boolean;
+            autoDensity?: boolean;
+            antialias?: boolean;
+            preserveDrawingBuffer?: boolean;
+            resolution?: number;
+            forceCanvas?: boolean;
+            backgroundColor?: number;
+            clearBeforeRender?: boolean;
+            forceFXAA?: boolean;
+            powerPreference?: string;
+            sharedTicker?: boolean;
+            sharedLoader?: boolean;
+            resizeTo?: Window | HTMLElement;
+        });
+        /**
+         * WebGL renderer if available, otherwise CanvasRenderer.
+         * @member {PIXI.Renderer|PIXI.CanvasRenderer} PIXI.Application#renderer
+         */
+        renderer: PIXI.Renderer | PIXI.CanvasRenderer;
+        /**
+         * The root display container that's rendered.
+         * @member {PIXI.Container} PIXI.Application#stage
+         */
+        stage: PIXI.Container;
+        /**
+         * Register a middleware plugin for the application
+         * @static
+         * @param {PIXI.Application.Plugin} plugin - Plugin being installed
+         */
+        static registerPlugin(plugin: PIXI.Application.Plugin): void;
+        /**
+         * Render the current stage.
+         */
+        render(): void;
+        /**
+         * Reference to the renderer's canvas element.
+         * @member {HTMLCanvasElement}
+         * @readonly
+         */
+        readonly view: HTMLCanvasElement;
+        /**
+         * Reference to the renderer's screen rectangle. Its safe to use as `filterArea` or `hitArea` for the whole screen.
+         * @member {PIXI.Rectangle}
+         * @readonly
+         */
+        readonly screen: PIXI.Rectangle;
+        /**
+         * Destroy and don't use after this.
+         * @param {Boolean} [removeView=false] Automatically remove canvas from DOM.
+         * @param {object|boolean} [stageOptions] - Options parameter. A boolean will act as if all options
+         *  have been set to that value
+         * @param {boolean} [stageOptions.children=false] - if set to true, all the children will have their destroy
+         *  method called as well. 'stageOptions' will be passed on to those calls.
+         * @param {boolean} [stageOptions.texture=false] - Only used for child Sprites if stageOptions.children is set
+         *  to true. Should it destroy the texture of the child sprite
+         * @param {boolean} [stageOptions.baseTexture=false] - Only used for child Sprites if stageOptions.children is set
+         *  to true. Should it destroy the base texture of the child sprite
+         */
+        destroy(removeView?: boolean, stageOptions?: {
+            children?: boolean;
+            texture?: boolean;
+            baseTexture?: boolean;
+        }): void;
+        /**
+         * The element or window to resize the application to.
+         * @type {Window|HTMLElement}
+         * @name resizeTo
+         * @memberof PIXI.Application#
+         */
+        resizeTo: Window | HTMLElement;
+        /**
+         * If `resizeTo` is set, calling this function
+         * will resize to the width and height of that element.
+         * @method PIXI.Application#resize
+         */
+        resize(): void;
+        /**
+         * Loader instance to help with asset loading.
+         * @name PIXI.Application#loader
+         * @type {PIXI.Loader}
+         * @readonly
+         */
+        readonly loader: PIXI.Loader;
+        /**
+         * Convenience method for stopping the render.
+         *
+         * @method PIXI.Application#stop
+         */
+        stop(): void;
+        /**
+         * Convenience method for starting the render.
+         *
+         * @method PIXI.Application#start
+         */
+        start(): void;
+        /**
+         * Ticker for doing render updates.
+         *
+         * @type {PIXI.Ticker}
+         * @name ticker
+         * @memberof PIXI.Application#
+         * @default PIXI.Ticker.shared
+         */
+        ticker: PIXI.Ticker;
+    }
+    module Application {
+        /**
+         * @memberof PIXI.Application
+         * @typedef {object} Plugin
+         * @property {function} init - Called when Application is constructed, scoped to Application instance.
+         *  Passes in `options` as the only argument, which are Application constructor options.
+         * @property {function} destroy - Called when destroying Application, scoped to Application instance
+         */
+        type Plugin = {
+            init: (...params: any[]) => any;
+            destroy: (...params: any[]) => any;
+        };
+    }
+    /**
+     * Renderer dedicated to drawing and batching graphics objects.
+     *
+     * @class
+     * @protected
+     * @memberof PIXI
+     */
+    class CanvasGraphicsRenderer {
+        constructor(renderer: PIXI.CanvasRenderer);
+        /**
+         * Renders a Graphics object to a canvas.
+         *
+         * @param {PIXI.Graphics} graphics - the actual graphics object to render
+         */
+        render(graphics: PIXI.Graphics): void;
+        /**
+         * Updates the tint of a graphics object
+         *
+         * @protected
+         * @param {PIXI.Graphics} graphics - the graphics that will have its tint updated
+         */
+        protected updateGraphicsTint(graphics: PIXI.Graphics): void;
+        /**
+         * destroy graphics object
+         *
+         */
+        destroy(): void;
+    }
+    /**
+     * Renderer dedicated to meshes.
+     *
+     * @class
+     * @protected
+     * @memberof PIXI
+     */
+    class CanvasMeshRenderer {
+        constructor(renderer: PIXI.CanvasRenderer);
+        /**
+         * Renders the Mesh
+         *
+         * @param {PIXI.Mesh} mesh - the Mesh to render
+         */
+        render(mesh: PIXI.Mesh): void;
+        /**
+         * destroy the the renderer.
+         *
+         */
+        destroy(): void;
+    }
+    /**
+     * The CanvasRenderer draws the scene and all its content onto a 2d canvas.
+     *
+     * This renderer should be used for browsers that do not support WebGL.
+     * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything!
+     *
+     * @class
+     * @memberof PIXI
+     * @extends PIXI.AbstractRenderer
+     */
+    class CanvasRenderer extends PIXI.AbstractRenderer {
+        constructor(options?: {
+            width?: number;
+            height?: number;
+            view?: HTMLCanvasElement;
+            transparent?: boolean;
+            autoDensity?: boolean;
+            antialias?: boolean;
+            resolution?: number;
+            preserveDrawingBuffer?: boolean;
+            clearBeforeRender?: boolean;
+            backgroundColor?: number;
+        });
+        /**
+         * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture
+         *
+         * @member {PIXI.extract.CanvasExtract} extract
+         * @memberof PIXI.CanvasRenderer#
+         * @see PIXI.extract.CanvasExtract
+         */
+        extract: PIXI.extract.CanvasExtract;
+        /**
+         * The root canvas 2d context that everything is drawn with.
+         *
+         * @member {CanvasRenderingContext2D} PIXI.CanvasRenderer#rootContext
+         */
+        rootContext: CanvasRenderingContext2D;
+        /**
+         * The currently active canvas 2d context (could change with renderTextures)
+         *
+         * @member {CanvasRenderingContext2D} PIXI.CanvasRenderer#context
+         */
+        context: CanvasRenderingContext2D;
+        /**
+         * Boolean flag controlling canvas refresh.
+         *
+         * @member {boolean} PIXI.CanvasRenderer#refresh
+         */
+        refresh: boolean;
+        /**
+         * Instance of a CanvasMaskManager, handles masking when using the canvas renderer.
+         *
+         * @member {PIXI.CanvasMaskManager} PIXI.CanvasRenderer#maskManager
+         */
+        maskManager: PIXI.CanvasMaskManager;
+        /**
+         * The canvas property used to set the canvas smoothing property.
+         *
+         * @member {string} PIXI.CanvasRenderer#smoothProperty
+         */
+        smoothProperty: string;
+        /**
+         * Tracks the blend modes useful for this renderer.
+         *
+         * @member {object} PIXI.CanvasRenderer#blendModes
+         */
+        blendModes: {
+            [key: number]: string;
+        };
+        /**
+         * Renders the object to this canvas view
+         *
+         * @param {PIXI.DisplayObject} displayObject - The object to be rendered
+         * @param {PIXI.RenderTexture} [renderTexture] - A render texture to be rendered to.
+         *  If unset, it will render to the root context.
+         * @param {boolean} [clear=false] - Whether to clear the canvas before drawing
+         * @param {PIXI.Matrix} [transform] - A transformation to be applied
+         * @param {boolean} [skipUpdateTransform=false] - Whether to skip the update transform
+         */
+        render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Matrix, skipUpdateTransform?: boolean): void;
+        /**
+         * Clear the canvas of renderer.
+         *
+         * @param {string} [clearColor] - Clear the canvas with this color, except the canvas is transparent.
+         */
+        clear(clearColor?: string): void;
+        /**
+         * Sets the blend mode of the renderer.
+         *
+         * @param {number} blendMode - See {@link PIXI.BLEND_MODES} for valid values.
+         * @param {boolean} [readyForOuterBlend=false] - Some blendModes are dangerous, they affect outer space of sprite.
+         * Pass `true` only if you are ready to use them.
+         */
+        setBlendMode(blendMode: number, readyForOuterBlend?: boolean): void;
+        /**
+         * Removes everything from the renderer and optionally removes the Canvas DOM element.
+         *
+         * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.
+         */
+        destroy(removeView?: boolean): void;
+        /**
+         * Resizes the canvas view to the specified width and height.
+         *
+         * @extends PIXI.AbstractRenderer#resize
+         *
+         * @param {number} screenWidth - the new width of the screen
+         * @param {number} screenHeight - the new height of the screen
+         */
+        resize(screenWidth: number, screenHeight: number): void;
+        /**
+         * Checks if blend mode has changed.
+         */
+        invalidateBlendMode(): void;
+        /**
+         * Collection of installed plugins. These are included by default in PIXI, but can be excluded
+         * by creating a custom build. Consult the README for more information about creating custom
+         * builds and excluding plugins.
+         * @name PIXI.CanvasRenderer#plugins
+         * @type {object}
+         * @readonly
+         * @property {PIXI.accessibility.AccessibilityManager} accessibility Support tabbing interactive elements.
+         * @property {PIXI.extract.CanvasExtract} extract Extract image data from renderer.
+         * @property {PIXI.interaction.InteractionManager} interaction Handles mouse, touch and pointer events.
+         * @property {PIXI.prepare.CanvasPrepare} prepare Pre-render display objects.
+         */
+        readonly plugins: {
+            accessibility: PIXI.accessibility.AccessibilityManager;
+            extract: PIXI.extract.CanvasExtract;
+            interaction: PIXI.interaction.InteractionManager;
+            prepare: PIXI.prepare.CanvasPrepare;
+        };
+        /**
+         * Adds a plugin to the renderer.
+         *
+         * @method
+         * @param {string} pluginName - The name of the plugin.
+         * @param {Function} ctor - The constructor function or class for the plugin.
+         */
+        static registerPlugin(pluginName: string, ctor: (...params: any[]) => any): void;
+        /**
+         * @deprecated since 5.0.0
+         * @member {boolean} PIXI.AbstractRenderer#autoResize
+         * @see PIXI.AbstractRenderer#autoDensity
+         */
+        autoResize: boolean;
+        /**
+         * The supplied constructor options.
+         *
+         * @member {Object} PIXI.AbstractRenderer#options
+         * @readOnly
+         */
+        readonly options: any;
+        /**
+         * The type of the renderer.
+         *
+         * @member {number} PIXI.AbstractRenderer#type
+         * @default PIXI.RENDERER_TYPE.UNKNOWN
+         * @see PIXI.RENDERER_TYPE
+         */
+        type: number;
+        /**
+         * Measurements of the screen. (0, 0, screenWidth, screenHeight).
+         *
+         * Its safe to use as filterArea or hitArea for the whole stage.
+         *
+         * @member {PIXI.Rectangle} PIXI.AbstractRenderer#screen
+         */
+        screen: PIXI.Rectangle;
+        /**
+         * The canvas element that everything is drawn to.
+         *
+         * @member {HTMLCanvasElement} PIXI.AbstractRenderer#view
+         */
+        view: HTMLCanvasElement;
+        /**
+         * The resolution / device pixel ratio of the renderer.
+         *
+         * @member {number} PIXI.AbstractRenderer#resolution
+         * @default 1
+         */
+        resolution: number;
+        /**
+         * Whether the render view is transparent.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#transparent
+         */
+        transparent: boolean;
+        /**
+         * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#autoDensity
+         */
+        autoDensity: boolean;
+        /**
+         * The value of the preserveDrawingBuffer flag affects whether or not the contents of
+         * the stencil buffer is retained after rendering.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#preserveDrawingBuffer
+         */
+        preserveDrawingBuffer: boolean;
+        /**
+         * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
+         * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every
+         * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect
+         * to clear the canvas every frame. Disable this by setting this to false. For example, if
+         * your game has a canvas filling background image you often don't need this set.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#clearBeforeRender
+         * @default
+         */
+        clearBeforeRender: boolean;
+        /**
+         * The background color as a number.
+         *
+         * @member {number} PIXI.AbstractRenderer#_backgroundColor
+         * @protected
+         */
+        protected _backgroundColor: number;
+        /**
+         * The background color as an [R, G, B] array.
+         *
+         * @member {number[]} PIXI.AbstractRenderer#_backgroundColorRgba
+         * @protected
+         */
+        protected _backgroundColorRgba: number[];
+        /**
+         * The background color as a string.
+         *
+         * @member {string} PIXI.AbstractRenderer#_backgroundColorString
+         * @protected
+         */
+        protected _backgroundColorString: string;
+        /**
+         * This temporary display object used as the parent of the currently being rendered item.
+         *
+         * @member {PIXI.DisplayObject} PIXI.AbstractRenderer#_tempDisplayObjectParent
+         * @protected
+         */
+        protected _tempDisplayObjectParent: PIXI.DisplayObject;
+        /**
+         * The last root object that the renderer tried to render.
+         *
+         * @member {PIXI.DisplayObject} PIXI.AbstractRenderer#_lastObjectRendered
+         * @protected
+         */
+        protected _lastObjectRendered: PIXI.DisplayObject;
+        /**
+         * Initialize the plugins.
+         *
+         * @protected
+         * @param {object} staticMap - The dictionary of statically saved plugins.
+         */
+        protected initPlugins(staticMap: any): void;
+        /**
+         * Same as view.width, actual number of pixels in the canvas by horizontal.
+         *
+         * @member {number}
+         * @readonly
+         * @default 800
+         */
+        readonly width: number;
+        /**
+         * Same as view.height, actual number of pixels in the canvas by vertical.
+         *
+         * @member {number}
+         * @readonly
+         * @default 600
+         */
+        readonly height: number;
+        /**
+         * Useful function that returns a texture of the display object that can then be used to create sprites
+         * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.
+         *
+         * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from.
+         * @param {number} scaleMode - Should be one of the scaleMode consts.
+         * @param {number} resolution - The resolution / device pixel ratio of the texture being generated.
+         * @param {PIXI.Rectangle} [region] - The region of the displayObject, that shall be rendered,
+         *        if no region is specified, defaults to the local bounds of the displayObject.
+         * @return {PIXI.Texture} A texture of the graphics object.
+         */
+        generateTexture(displayObject: PIXI.DisplayObject, scaleMode: number, resolution: number, region?: PIXI.Rectangle): PIXI.Texture;
+        /**
+         * The background color to fill if not transparent
+         *
+         * @member {number}
+         */
+        backgroundColor: number;
+    }
+    /**
+     * Utility methods for Sprite/Texture tinting.
+     *
+     * Tinting with the CanvasRenderer involves creating a new canvas to use as a texture,
+     * so be aware of the performance implications.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class CanvasTinter {
+        constructor();
+        /**
+         * Basically this method just needs a sprite and a color and tints the sprite with the given color.
+         *
+         * @memberof PIXI.CanvasTinter
+         * @param {PIXI.Sprite} sprite - the sprite to tint
+         * @param {number} color - the color to use to tint the sprite with
+         * @return {HTMLCanvasElement} The tinted canvas
+         */
+        static getTintedCanvas(sprite: PIXI.Sprite, color: number): HTMLCanvasElement;
+        /**
+         * Tint a texture using the 'multiply' operation.
+         *
+         * @memberof PIXI.CanvasTinter
+         * @param {PIXI.Texture} texture - the texture to tint
+         * @param {number} color - the color to use to tint the sprite with
+         * @param {HTMLCanvasElement} canvas - the current canvas
+         */
+        static tintWithMultiply(texture: PIXI.Texture, color: number, canvas: HTMLCanvasElement): void;
+        /**
+         * Tint a texture using the 'overlay' operation.
+         *
+         * @memberof PIXI.CanvasTinter
+         * @param {PIXI.Texture} texture - the texture to tint
+         * @param {number} color - the color to use to tint the sprite with
+         * @param {HTMLCanvasElement} canvas - the current canvas
+         */
+        static tintWithOverlay(texture: PIXI.Texture, color: number, canvas: HTMLCanvasElement): void;
+        /**
+         * Tint a texture pixel per pixel.
+         *
+         * @memberof PIXI.CanvasTinter
+         * @param {PIXI.Texture} texture - the texture to tint
+         * @param {number} color - the color to use to tint the sprite with
+         * @param {HTMLCanvasElement} canvas - the current canvas
+         */
+        static tintWithPerPixel(texture: PIXI.Texture, color: number, canvas: HTMLCanvasElement): void;
+        /**
+         * Rounds the specified color according to the CanvasTinter.cacheStepsPerColorChannel.
+         *
+         * @memberof PIXI.CanvasTinter
+         * @param {number} color - the color to round, should be a hex color
+         * @return {number} The rounded color.
+         */
+        static roundColor(color: number): number;
+        /**
+         * Number of steps which will be used as a cap when rounding colors.
+         *
+         * @memberof PIXI.CanvasTinter
+         * @type {number}
+         */
+        static cacheStepsPerColorChannel: number;
+        /**
+         * Tint cache boolean flag.
+         *
+         * @memberof PIXI.CanvasTinter
+         * @type {boolean}
+         */
+        static convertTintToImage: boolean;
+        /**
+         * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.
+         *
+         * @memberof PIXI.CanvasTinter
+         * @type {boolean}
+         */
+        static canUseMultiply: boolean;
+        /**
+         * The tinting method that will be used.
+         *
+         * @memberof PIXI.CanvasTinter
+         * @type {Function}
+         */
+        static tintMethod(): void;
+    }
+    /**
+     * A set of functions used to handle masking.
+     *
+     * Sprite masking is not supported on the CanvasRenderer.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class CanvasMaskManager {
+        constructor(renderer: PIXI.CanvasRenderer);
+        /**
+         * This method adds it to the current stack of masks.
+         *
+         * @param {object} maskData - the maskData that will be pushed
+         */
+        pushMask(maskData: any): void;
+        /**
+         * Renders a PIXI.Graphics shape.
+         *
+         * @param {PIXI.Graphics} graphics - The object to render.
+         */
+        renderGraphicsShape(graphics: PIXI.Graphics): void;
+        /**
+         * Restores the current drawing context to the state it was before the mask was applied.
+         *
+         * @param {PIXI.CanvasRenderer} renderer - The renderer context to use.
+         */
+        popMask(renderer: PIXI.CanvasRenderer): void;
+        /**
+         * Destroys this canvas mask manager.
+         *
+         */
+        destroy(): void;
+    }
+    /**
+     * Types that can be passed to drawImage
+     * @typedef {HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap} ICanvasImageSource
+     * @memberof PIXI
+     */
+    type ICanvasImageSource = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap;
+    /**
+     * Renderer dedicated to drawing and batching sprites.
+     *
+     * @class
+     * @protected
+     * @memberof PIXI
+     */
+    class CanvasSpriteRenderer {
+        constructor(renderer: PIXI.Renderer);
+        /**
+         * Renders the sprite object.
+         *
+         * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch
+         */
+        render(sprite: PIXI.Sprite): void;
+        /**
+         * destroy the sprite object.
+         *
+         */
+        destroy(): void;
+    }
+    /**
+     * Different types of environments for WebGL.
+     *
+     * @static
+     * @memberof PIXI
+     * @name ENV
+     * @enum {number}
+     * @property {number} WEBGL_LEGACY - Used for older v1 WebGL devices. PixiJS will aim to ensure compatibility
+     *  with older / less advanced devices. If you experience unexplained flickering prefer this environment.
+     * @property {number} WEBGL - Version 1 of WebGL
+     * @property {number} WEBGL2 - Version 2 of WebGL
+     */
+    enum ENV {
+        WEBGL_LEGACY,
+        WEBGL,
+        WEBGL2
+    }
+    /**
+     * Constant to identify the Renderer Type.
+     *
+     * @static
+     * @memberof PIXI
+     * @name RENDERER_TYPE
+     * @enum {number}
+     * @property {number} UNKNOWN - Unknown render type.
+     * @property {number} WEBGL - WebGL render type.
+     * @property {number} CANVAS - Canvas render type.
+     */
+    enum RENDERER_TYPE {
+        UNKNOWN,
+        WEBGL,
+        CANVAS
+    }
+    /**
+     * Various blend modes supported by PIXI.
+     *
+     * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.
+     * Anything else will silently act like NORMAL.
+     *
+     * @memberof PIXI
+     * @name BLEND_MODES
+     * @enum {number}
+     * @property {number} NORMAL
+     * @property {number} ADD
+     * @property {number} MULTIPLY
+     * @property {number} SCREEN
+     * @property {number} OVERLAY
+     * @property {number} DARKEN
+     * @property {number} LIGHTEN
+     * @property {number} COLOR_DODGE
+     * @property {number} COLOR_BURN
+     * @property {number} HARD_LIGHT
+     * @property {number} SOFT_LIGHT
+     * @property {number} DIFFERENCE
+     * @property {number} EXCLUSION
+     * @property {number} HUE
+     * @property {number} SATURATION
+     * @property {number} COLOR
+     * @property {number} LUMINOSITY
+     * @property {number} NORMAL_NPM
+     * @property {number} ADD_NPM
+     * @property {number} SCREEN_NPM
+     * @property {number} NONE
+     * @property {number} SRC_IN
+     * @property {number} SRC_OUT
+     * @property {number} SRC_ATOP
+     * @property {number} DST_OVER
+     * @property {number} DST_IN
+     * @property {number} DST_OUT
+     * @property {number} DST_ATOP
+     * @property {number} SUBTRACT
+     * @property {number} SRC_OVER
+     * @property {number} ERASE
+     */
+    enum BLEND_MODES {
+        NORMAL,
+        ADD,
+        MULTIPLY,
+        SCREEN,
+        OVERLAY,
+        DARKEN,
+        LIGHTEN,
+        COLOR_DODGE,
+        COLOR_BURN,
+        HARD_LIGHT,
+        SOFT_LIGHT,
+        DIFFERENCE,
+        EXCLUSION,
+        HUE,
+        SATURATION,
+        COLOR,
+        LUMINOSITY,
+        NORMAL_NPM,
+        ADD_NPM,
+        SCREEN_NPM,
+        NONE,
+        SRC_IN,
+        SRC_OUT,
+        SRC_ATOP,
+        DST_OVER,
+        DST_IN,
+        DST_OUT,
+        DST_ATOP,
+        SUBTRACT,
+        SRC_OVER,
+        ERASE
+    }
+    /**
+     * Various webgl draw modes. These can be used to specify which GL drawMode to use
+     * under certain situations and renderers.
+     *
+     * @memberof PIXI
+     * @static
+     * @name DRAW_MODES
+     * @enum {number}
+     * @property {number} POINTS
+     * @property {number} LINES
+     * @property {number} LINE_LOOP
+     * @property {number} LINE_STRIP
+     * @property {number} TRIANGLES
+     * @property {number} TRIANGLE_STRIP
+     * @property {number} TRIANGLE_FAN
+     */
+    enum DRAW_MODES {
+        POINTS,
+        LINES,
+        LINE_LOOP,
+        LINE_STRIP,
+        TRIANGLES,
+        TRIANGLE_STRIP,
+        TRIANGLE_FAN
+    }
+    /**
+     * Various GL texture/resources formats.
+     *
+     * @memberof PIXI
+     * @static
+     * @name FORMATS
+     * @enum {number}
+     * @property {number} RGBA=6408
+     * @property {number} RGB=6407
+     * @property {number} ALPHA=6406
+     * @property {number} LUMINANCE=6409
+     * @property {number} LUMINANCE_ALPHA=6410
+     * @property {number} DEPTH_COMPONENT=6402
+     * @property {number} DEPTH_STENCIL=34041
+     */
+    enum FORMATS {
+        RGBA,
+        RGB,
+        ALPHA,
+        LUMINANCE,
+        LUMINANCE_ALPHA,
+        DEPTH_COMPONENT,
+        DEPTH_STENCIL
+    }
+    /**
+     * Various GL target types.
+     *
+     * @memberof PIXI
+     * @static
+     * @name TARGETS
+     * @enum {number}
+     * @property {number} TEXTURE_2D=3553
+     * @property {number} TEXTURE_CUBE_MAP=34067
+     * @property {number} TEXTURE_2D_ARRAY=35866
+     * @property {number} TEXTURE_CUBE_MAP_POSITIVE_X=34069
+     * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_X=34070
+     * @property {number} TEXTURE_CUBE_MAP_POSITIVE_Y=34071
+     * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_Y=34072
+     * @property {number} TEXTURE_CUBE_MAP_POSITIVE_Z=34073
+     * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_Z=34074
+     */
+    enum TARGETS {
+        TEXTURE_2D,
+        TEXTURE_CUBE_MAP,
+        TEXTURE_2D_ARRAY,
+        TEXTURE_CUBE_MAP_POSITIVE_X,
+        TEXTURE_CUBE_MAP_NEGATIVE_X,
+        TEXTURE_CUBE_MAP_POSITIVE_Y,
+        TEXTURE_CUBE_MAP_NEGATIVE_Y,
+        TEXTURE_CUBE_MAP_POSITIVE_Z,
+        TEXTURE_CUBE_MAP_NEGATIVE_Z
+    }
+    /**
+     * Various GL data format types.
+     *
+     * @memberof PIXI
+     * @static
+     * @name TYPES
+     * @enum {number}
+     * @property {number} UNSIGNED_BYTE=5121
+     * @property {number} UNSIGNED_SHORT=5123
+     * @property {number} UNSIGNED_SHORT_5_6_5=33635
+     * @property {number} UNSIGNED_SHORT_4_4_4_4=32819
+     * @property {number} UNSIGNED_SHORT_5_5_5_1=32820
+     * @property {number} FLOAT=5126
+     * @property {number} HALF_FLOAT=36193
+     */
+    enum TYPES {
+        UNSIGNED_BYTE,
+        UNSIGNED_SHORT,
+        UNSIGNED_SHORT_5_6_5,
+        UNSIGNED_SHORT_4_4_4_4,
+        UNSIGNED_SHORT_5_5_5_1,
+        FLOAT,
+        HALF_FLOAT
+    }
+    /**
+     * The scale modes that are supported by pixi.
+     *
+     * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations.
+     * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.
+     *
+     * @memberof PIXI
+     * @static
+     * @name SCALE_MODES
+     * @enum {number}
+     * @property {number} LINEAR Smooth scaling
+     * @property {number} NEAREST Pixelating scaling
+     */
+    enum SCALE_MODES {
+        LINEAR,
+        NEAREST
+    }
+    /**
+     * The wrap modes that are supported by pixi.
+     *
+     * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wrapping mode of future operations.
+     * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.
+     * If the texture is non power of two then clamp will be used regardless as WebGL can
+     * only use REPEAT if the texture is po2.
+     *
+     * This property only affects WebGL.
+     *
+     * @name WRAP_MODES
+     * @memberof PIXI
+     * @static
+     * @enum {number}
+     * @property {number} CLAMP - The textures uvs are clamped
+     * @property {number} REPEAT - The texture uvs tile and repeat
+     * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring
+     */
+    enum WRAP_MODES {
+        CLAMP,
+        REPEAT,
+        MIRRORED_REPEAT
+    }
+    /**
+     * Mipmap filtering modes that are supported by pixi.
+     *
+     * The {@link PIXI.settings.MIPMAP_TEXTURES} affects default texture filtering.
+     * Mipmaps are generated for a baseTexture if its `mipmap` field is `ON`,
+     * or its `POW2` and texture dimensions are powers of 2.
+     * Due to platform restriction, `ON` option will work like `POW2` for webgl-1.
+     *
+     * This property only affects WebGL.
+     *
+     * @name MIPMAP_MODES
+     * @memberof PIXI
+     * @static
+     * @enum {number}
+     * @property {number} OFF - No mipmaps
+     * @property {number} POW2 - Generate mipmaps if texture dimensions are pow2
+     * @property {number} ON - Always generate mipmaps
+     */
+    enum MIPMAP_MODES {
+        OFF,
+        POW2,
+        ON
+    }
+    /**
+     * The gc modes that are supported by pixi.
+     *
+     * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for PixiJS textures is AUTO
+     * If set to GC_MODE, the renderer will occasionally check textures usage. If they are not
+     * used for a specified period of time they will be removed from the GPU. They will of course
+     * be uploaded again when they are required. This is a silent behind the scenes process that
+     * should ensure that the GPU does not  get filled up.
+     *
+     * Handy for mobile devices!
+     * This property only affects WebGL.
+     *
+     * @name GC_MODES
+     * @enum {number}
+     * @static
+     * @memberof PIXI
+     * @property {number} AUTO - Garbage collection will happen periodically automatically
+     * @property {number} MANUAL - Garbage collection will need to be called manually
+     */
+    enum GC_MODES {
+        AUTO,
+        MANUAL
+    }
+    /**
+     * Constants that specify float precision in shaders.
+     *
+     * @name PRECISION
+     * @memberof PIXI
+     * @static
+     * @enum {string}
+     * @constant
+     * @property {string} LOW='lowp'
+     * @property {string} MEDIUM='mediump'
+     * @property {string} HIGH='highp'
+     */
+    const enum PRECISION {
+        LOW,
+        MEDIUM,
+        HIGH
+    }
+    /**
+     * The AbstractRenderer is the base for a PixiJS Renderer. It is extended by the {@link PIXI.CanvasRenderer}
+     * and {@link PIXI.Renderer} which can be used for rendering a PixiJS scene.
+     *
+     * @abstract
+     * @class
+     * @extends PIXI.utils.EventEmitter
+     * @memberof PIXI
+     */
+    class AbstractRenderer extends PIXI.utils.EventEmitter {
+        constructor(system: string, options?: {
+            width?: number;
+            height?: number;
+            view?: HTMLCanvasElement;
+            transparent?: boolean;
+            autoDensity?: boolean;
+            antialias?: boolean;
+            resolution?: number;
+            preserveDrawingBuffer?: boolean;
+            clearBeforeRender?: boolean;
+            backgroundColor?: number;
+        });
+        /**
+         * @deprecated since 5.0.0
+         * @member {boolean} PIXI.AbstractRenderer#autoResize
+         * @see PIXI.AbstractRenderer#autoDensity
+         */
+        autoResize: boolean;
+        /**
+         * The supplied constructor options.
+         *
+         * @member {Object} PIXI.AbstractRenderer#options
+         * @readOnly
+         */
+        readonly options: any;
+        /**
+         * The type of the renderer.
+         *
+         * @member {number} PIXI.AbstractRenderer#type
+         * @default PIXI.RENDERER_TYPE.UNKNOWN
+         * @see PIXI.RENDERER_TYPE
+         */
+        type: number;
+        /**
+         * Measurements of the screen. (0, 0, screenWidth, screenHeight).
+         *
+         * Its safe to use as filterArea or hitArea for the whole stage.
+         *
+         * @member {PIXI.Rectangle} PIXI.AbstractRenderer#screen
+         */
+        screen: PIXI.Rectangle;
+        /**
+         * The canvas element that everything is drawn to.
+         *
+         * @member {HTMLCanvasElement} PIXI.AbstractRenderer#view
+         */
+        view: HTMLCanvasElement;
+        /**
+         * The resolution / device pixel ratio of the renderer.
+         *
+         * @member {number} PIXI.AbstractRenderer#resolution
+         * @default 1
+         */
+        resolution: number;
+        /**
+         * Whether the render view is transparent.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#transparent
+         */
+        transparent: boolean;
+        /**
+         * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#autoDensity
+         */
+        autoDensity: boolean;
+        /**
+         * The value of the preserveDrawingBuffer flag affects whether or not the contents of
+         * the stencil buffer is retained after rendering.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#preserveDrawingBuffer
+         */
+        preserveDrawingBuffer: boolean;
+        /**
+         * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
+         * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every
+         * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect
+         * to clear the canvas every frame. Disable this by setting this to false. For example, if
+         * your game has a canvas filling background image you often don't need this set.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#clearBeforeRender
+         * @default
+         */
+        clearBeforeRender: boolean;
+        /**
+         * The background color as a number.
+         *
+         * @member {number} PIXI.AbstractRenderer#_backgroundColor
+         * @protected
+         */
+        protected _backgroundColor: number;
+        /**
+         * The background color as an [R, G, B] array.
+         *
+         * @member {number[]} PIXI.AbstractRenderer#_backgroundColorRgba
+         * @protected
+         */
+        protected _backgroundColorRgba: number[];
+        /**
+         * The background color as a string.
+         *
+         * @member {string} PIXI.AbstractRenderer#_backgroundColorString
+         * @protected
+         */
+        protected _backgroundColorString: string;
+        /**
+         * This temporary display object used as the parent of the currently being rendered item.
+         *
+         * @member {PIXI.DisplayObject} PIXI.AbstractRenderer#_tempDisplayObjectParent
+         * @protected
+         */
+        protected _tempDisplayObjectParent: PIXI.DisplayObject;
+        /**
+         * The last root object that the renderer tried to render.
+         *
+         * @member {PIXI.DisplayObject} PIXI.AbstractRenderer#_lastObjectRendered
+         * @protected
+         */
+        protected _lastObjectRendered: PIXI.DisplayObject;
+        /**
+         * Collection of plugins.
+         * @readonly
+         * @member {object} PIXI.AbstractRenderer#plugins
+         */
+        readonly plugins: any;
+        /**
+         * Initialize the plugins.
+         *
+         * @protected
+         * @param {object} staticMap - The dictionary of statically saved plugins.
+         */
+        protected initPlugins(staticMap: any): void;
+        /**
+         * Same as view.width, actual number of pixels in the canvas by horizontal.
+         *
+         * @member {number}
+         * @readonly
+         * @default 800
+         */
+        readonly width: number;
+        /**
+         * Same as view.height, actual number of pixels in the canvas by vertical.
+         *
+         * @member {number}
+         * @readonly
+         * @default 600
+         */
+        readonly height: number;
+        /**
+         * Resizes the screen and canvas to the specified width and height.
+         * Canvas dimensions are multiplied by resolution.
+         *
+         * @param {number} screenWidth - The new width of the screen.
+         * @param {number} screenHeight - The new height of the screen.
+         */
+        resize(screenWidth: number, screenHeight: number): void;
+        /**
+         * Useful function that returns a texture of the display object that can then be used to create sprites
+         * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.
+         *
+         * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from.
+         * @param {number} scaleMode - Should be one of the scaleMode consts.
+         * @param {number} resolution - The resolution / device pixel ratio of the texture being generated.
+         * @param {PIXI.Rectangle} [region] - The region of the displayObject, that shall be rendered,
+         *        if no region is specified, defaults to the local bounds of the displayObject.
+         * @return {PIXI.Texture} A texture of the graphics object.
+         */
+        generateTexture(displayObject: PIXI.DisplayObject, scaleMode: number, resolution: number, region?: PIXI.Rectangle): PIXI.Texture;
+        /**
+         * Removes everything from the renderer and optionally removes the Canvas DOM element.
+         *
+         * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.
+         */
+        destroy(removeView?: boolean): void;
+        /**
+         * The background color to fill if not transparent
+         *
+         * @member {number}
+         */
+        backgroundColor: number;
+    }
+    /**
+     * This helper function will automatically detect which renderer you should be using.
+     * WebGL is the preferred renderer as it is a lot faster. If WebGL is not supported by
+     * the browser then this function will return a canvas renderer
+     *
+     * @memberof PIXI
+     * @function autoDetectRenderer
+     * @param {object} [options] - The optional renderer parameters
+     * @param {number} [options.width=800] - the width of the renderers view
+     * @param {number} [options.height=600] - the height of the renderers view
+     * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional
+     * @param {boolean} [options.transparent=false] - If the render view is transparent, default false
+     * @param {boolean} [options.autoDensity=false] - Resizes renderer view in CSS pixels to allow for
+     *   resolutions other than 1
+     * @param {boolean} [options.antialias=false] - sets antialias
+     * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you
+     *  need to call toDataUrl on the webgl context
+     * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area
+     *  (shown if not transparent).
+     * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or
+     *   not before the new render pass.
+     * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2
+     * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present, this
+     *   option only is available when using **pixi.js-legacy** or **@pixi/canvas-renderer** modules, otherwise
+     *   it is ignored.
+     * @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native.
+     *  FXAA is faster, but may not always look as great **webgl only**
+     * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance"
+     *  for devices with dual graphics card **webgl only**
+     * @return {PIXI.Renderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer
+     */
+    function autoDetectRenderer(options?: {
+        width?: number;
+        height?: number;
+        view?: HTMLCanvasElement;
+        transparent?: boolean;
+        autoDensity?: boolean;
+        antialias?: boolean;
+        preserveDrawingBuffer?: boolean;
+        backgroundColor?: number;
+        clearBeforeRender?: boolean;
+        resolution?: number;
+        forceCanvas?: boolean;
+        forceFXAA?: boolean;
+        powerPreference?: string;
+    }): PIXI.Renderer | PIXI.CanvasRenderer;
+    /**
+     * Used by the BatchRenderer
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class BatchBuffer {
+        constructor(size: number);
+        /**
+         * View on the vertices as a Float32Array for positions
+         *
+         * @member {Float32Array} PIXI.BatchBuffer#float32View
+         */
+        float32View: Float32Array;
+        /**
+         * View on the vertices as a Uint32Array for uvs
+         *
+         * @member {Float32Array} PIXI.BatchBuffer#uint32View
+         */
+        uint32View: Float32Array;
+        /**
+         * Destroys the buffer.
+         *
+         */
+        destroy(): void;
+    }
+    /**
+     * Used by the batcher to draw batches.
+     * Each one of these contains all information required to draw a bound geometry.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class BatchDrawCall {
+        constructor();
+    }
+    /**
+     * Geometry used to batch standard PIXI content (e.g. Mesh, Sprite, Graphics objects).
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class BatchGeometry {
+        constructor(_static?: boolean);
+        /**
+         * Buffer used for position, color, texture IDs
+         *
+         * @member {PIXI.Buffer} PIXI.BatchGeometry#_buffer
+         * @protected
+         */
+        protected _buffer: PIXI.Buffer;
+        /**
+         * Index buffer data
+         *
+         * @member {PIXI.Buffer} PIXI.BatchGeometry#_indexBuffer
+         * @protected
+         */
+        protected _indexBuffer: PIXI.Buffer;
+    }
+    /**
+     * Renderer dedicated to drawing and batching sprites.
+     *
+     * @class
+     * @protected
+     * @memberof PIXI
+     * @extends PIXI.ObjectRenderer
+     */
+    class BatchRenderer extends PIXI.ObjectRenderer {
+        constructor(renderer: PIXI.Renderer);
+        /**
+         * Number of values sent in the vertex buffer.
+         * aVertexPosition(2), aTextureCoord(1), aColor(1), aTextureId(1) = 5
+         *
+         * @member {number} PIXI.BatchRenderer#vertSize
+         */
+        vertSize: number;
+        /**
+         * The size of the vertex information in bytes.
+         *
+         * @member {number} PIXI.BatchRenderer#vertByteSize
+         */
+        vertByteSize: number;
+        /**
+         * The number of images in the SpriteRenderer before it flushes.
+         *
+         * @member {number} PIXI.BatchRenderer#size
+         */
+        size: number;
+        /**
+         * Holds the defualt indices of the geometry (quads) to draw
+         *
+         * @member {Uint16Array}
+         */
+        onlySprites: Uint16Array;
+        /**
+         * The default shaders that is used if a sprite doesn't have a more specific one.
+         * there is a shader for each number of textures that can be rendered.
+         * These shaders will also be generated on the fly as required.
+         * @member {PIXI.Shader[]} PIXI.BatchRenderer#shader
+         */
+        shader: PIXI.Shader[];
+        /**
+         * Sets up the renderer context and necessary buffers.
+         */
+        contextChange(): void;
+        /**
+         * Called before the renderer starts rendering.
+         *
+         */
+        onPrerender(): void;
+        /**
+         * Renders the sprite object.
+         *
+         * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch
+         */
+        render(sprite: PIXI.Sprite): void;
+        /**
+         * Renders the content and empties the current batch.
+         *
+         */
+        flush(): void;
+        /**
+         * Starts a new sprite batch.
+         */
+        start(): void;
+        /**
+         * Stops and flushes the current batch.
+         *
+         */
+        stop(): void;
+        /**
+         * Destroys the SpriteRenderer.
+         *
+         */
+        destroy(): void;
+        /**
+         * The renderer this manager works for.
+         *
+         * @member {PIXI.Renderer} PIXI.System#renderer
+         */
+        renderer: PIXI.Renderer;
+    }
+    /**
+     * Base for a common object renderer that can be used as a system renderer plugin.
+     *
+     * @class
+     * @extends PIXI.System
+     * @memberof PIXI
+     */
+    class ObjectRenderer extends PIXI.System {
+        /**
+         * Starts the renderer and sets the shader
+         *
+         */
+        start(): void;
+        /**
+         * Stops the renderer
+         *
+         */
+        stop(): void;
+        /**
+         * Stub method for rendering content and emptying the current batch.
+         *
+         */
+        flush(): void;
+        /**
+         * Renders an object
+         *
+         * @param {PIXI.DisplayObject} object - The object to render.
+         */
+        render(object: PIXI.DisplayObject): void;
+        /**
+         * The renderer this manager works for.
+         *
+         * @member {PIXI.Renderer} PIXI.System#renderer
+         */
+        renderer: PIXI.Renderer;
+        /**
+         * Generic method called when there is a WebGL context change.
+         *
+         * @param {WebGLRenderingContext} gl new webgl context
+         */
+        contextChange(gl: WebGLRenderingContext): void;
+        /**
+         * Generic destroy methods to be overridden by the subclass
+         */
+        destroy(): void;
+    }
+    /**
+     * Filter is a special type of WebGL shader that is applied to the screen.
+     *
+     * {@link http://pixijs.io/examples/#/filters/blur-filter.js Example} of the
+     * {@link PIXI.filters.BlurFilter BlurFilter}.
+     *
+     * ### Usage
+     * Filters can be applied to any DisplayObject or Container.
+     * PixiJS' `FilterSystem` renders the container into temporary Framebuffer,
+     * then filter renders it to the screen.
+     * Multiple filters can be added to the `filters` array property and stacked on each other.
+     *
+     * ```
+     * const filter = new PIXI.Filter(myShaderVert, myShaderFrag, { myUniform: 0.5 });
+     * const container = new PIXI.Container();
+     * container.filters = [filter];
+     * ```
+     *
+     * ### Previous Version Differences
+     *
+     * In PixiJS **v3**, a filter was always applied to _whole screen_.
+     *
+     * In PixiJS **v4**, a filter can be applied _only part of the screen_.
+     * Developers had to create a set of uniforms to deal with coordinates.
+     *
+     * In PixiJS **v5** combines _both approaches_.
+     * Developers can use normal coordinates of v3 and then allow filter to use partial Framebuffers,
+     * bringing those extra uniforms into account.
+     *
+     * Also be aware that we have changed default vertex shader, please consult
+     * {@link https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters Wiki}.
+     *
+     * ### Built-in Uniforms
+     *
+     * PixiJS viewport uses screen (CSS) coordinates, `(0, 0, renderer.screen.width, renderer.screen.height)`,
+     * and `projectionMatrix` uniform maps it to the gl viewport.
+     *
+     * **uSampler**
+     *
+     * The most important uniform is the input texture that container was rendered into.
+     * _Important note: as with all Framebuffers in PixiJS, both input and output are
+     * premultiplied by alpha._
+     *
+     * By default, input normalized coordinates are passed to fragment shader with `vTextureCoord`.
+     * Use it to sample the input.
+     *
+     * ```
+     * const fragment = `
+     * varying vec2 vTextureCoord;
+     * uniform sampler2D uSampler;
+     * void main(void)
+     * {
+     *    gl_FragColor = texture2D(uSampler, vTextureCoord);
+     * }
+     * `;
+     *
+     * const myFilter = new PIXI.Filter(null, fragment);
+     * ```
+     *
+     * This filter is just one uniform less than {@link PIXI.filters.AlphaFilter AlphaFilter}.
+     *
+     * **outputFrame**
+     *
+     * The `outputFrame` holds the rectangle where filter is applied in screen (CSS) coordinates.
+     * It's the same as `renderer.screen` for a fullscreen filter.
+     * Only a part of  `outputFrame.zw` size of temporary Framebuffer is used,
+     * `(0, 0, outputFrame.width, outputFrame.height)`,
+     *
+     * Filters uses this quad to normalized (0-1) space, its passed into `aVertexPosition` attribute.
+     * To calculate vertex position in screen space using normalized (0-1) space:
+     *
+     * ```
+     * vec4 filterVertexPosition( void )
+     * {
+     *     vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
+     *     return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
+     * }
+     * ```
+     *
+     * **inputSize**
+     *
+     * Temporary framebuffer is different, it can be either the size of screen, either power-of-two.
+     * The `inputSize.xy` are size of temporary framebuffer that holds input.
+     * The `inputSize.zw` is inverted, it's a shortcut to evade division inside the shader.
+     *
+     * Set `inputSize.xy = outputFrame.zw` for a fullscreen filter.
+     *
+     * To calculate input normalized coordinate, you have to map it to filter normalized space.
+     * Multiply by `outputFrame.zw` to get input coordinate.
+     * Divide by `inputSize.xy` to get input normalized coordinate.
+     *
+     * ```
+     * vec2 filterTextureCoord( void )
+     * {
+     *     return aVertexPosition * (outputFrame.zw * inputSize.zw); // same as /inputSize.xy
+     * }
+     * ```
+     * **resolution**
+     *
+     * The `resolution` is the ratio of screen (CSS) pixels to real pixels.
+     *
+     * **inputPixel**
+     *
+     * `inputPixel.xy` is the size of framebuffer in real pixels, same as `inputSize.xy * resolution`
+     * `inputPixel.zw` is inverted `inputPixel.xy`.
+     *
+     * It's handy for filters that use neighbour pixels, like {@link PIXI.filters.FXAAFilter FXAAFilter}.
+     *
+     * **inputClamp**
+     *
+     * If you try to get info from outside of used part of Framebuffer - you'll get undefined behaviour.
+     * For displacements, coordinates has to be clamped.
+     *
+     * The `inputClamp.xy` is left-top pixel center, you may ignore it, because we use left-top part of Framebuffer
+     * `inputClamp.zw` is bottom-right pixel center.
+     *
+     * ```
+     * vec4 color = texture2D(uSampler, clamp(modifigedTextureCoord, inputClamp.xy, inputClamp.zw))
+     * ```
+     * OR
+     * ```
+     * vec4 color = texture2D(uSampler, min(modifigedTextureCoord, inputClamp.zw))
+     * ```
+     *
+     * ### Additional Information
+     *
+     * Complete documentation on Filter usage is located in the
+     * {@link https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters Wiki}.
+     *
+     * Since PixiJS only had a handful of built-in filters, additional filters can be downloaded
+     * {@link https://github.com/pixijs/pixi-filters here} from the PixiJS Filters repository.
+     *
+     * @class
+     * @memberof PIXI
+     * @extends PIXI.Shader
+     */
+    class Filter extends PIXI.Shader {
+        constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: any);
+        /**
+         * The padding of the filter. Some filters require extra space to breath such as a blur.
+         * Increasing this will add extra width and height to the bounds of the object that the
+         * filter is applied to.
+         *
+         * @member {number} PIXI.Filter#padding
+         */
+        padding: number;
+        /**
+         * The resolution of the filter. Setting this to be lower will lower the quality but
+         * increase the performance of the filter.
+         *
+         * @member {number} PIXI.Filter#resolution
+         */
+        resolution: number;
+        /**
+         * If enabled is true the filter is applied, if false it will not.
+         *
+         * @member {boolean} PIXI.Filter#enabled
+         */
+        enabled: boolean;
+        /**
+         * If enabled, PixiJS will fit the filter area into boundaries for better performance.
+         * Switch it off if it does not work for specific shader.
+         *
+         * @member {boolean} PIXI.Filter#autoFit
+         */
+        autoFit: boolean;
+        /**
+         * Legacy filters use position and uvs from attributes
+         * @member {boolean} PIXI.Filter#legacy
+         * @readonly
+         */
+        readonly legacy: boolean;
+        /**
+         * The WebGL state the filter requires to render
+         * @member {PIXI.State} PIXI.Filter#state
+         */
+        state: PIXI.State;
+        /**
+         * Applies the filter
+         *
+         * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
+         * @param {PIXI.RenderTexture} input - The input render target.
+         * @param {PIXI.RenderTexture} output - The target to output to.
+         * @param {boolean} clear - Should the output be cleared before rendering to it
+         * @param {object} [currentState] - It's current state of filter.
+         *        There are some useful properties in the currentState :
+         *        target, filters, sourceFrame, destinationFrame, renderTarget, resolution
+         */
+        apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clear: boolean, currentState?: any): void;
+        /**
+         * Sets the blendmode of the filter
+         *
+         * @member {number}
+         * @default PIXI.BLEND_MODES.NORMAL
+         */
+        blendMode: number;
+        /**
+         * The default vertex shader source
+         *
+         * @static
+         * @type {string}
+         * @constant
+         */
+        static readonly defaultVertexSrc: string;
+        /**
+         * The default fragment shader source
+         *
+         * @static
+         * @type {string}
+         * @constant
+         */
+        static readonly defaultFragmentSrc: string;
+        /**
+         * Used for caching shader IDs
+         *
+         * @static
+         * @type {object}
+         * @protected
+         */
+        protected static SOURCE_KEY_MAP: any;
+        /**
+         * Shader uniform values, shortcut for `uniformGroup.uniforms`
+         * @readonly
+         * @member {object}
+         */
+        readonly uniforms: any;
+    }
+    /**
+     * This handles a Sprite acting as a mask, as opposed to a Graphic.
+     *
+     * WebGL only.
+     *
+     * @class
+     * @extends PIXI.Filter
+     * @memberof PIXI
+     */
+    class SpriteMaskFilter extends PIXI.Filter {
+        constructor(sprite: PIXI.Sprite);
+        /**
+         * Sprite mask
+         * @member {PIXI.Sprite} PIXI.SpriteMaskFilter#maskSprite
+         */
+        maskSprite: PIXI.Sprite;
+        /**
+         * Mask matrix
+         * @member {PIXI.Matrix} PIXI.SpriteMaskFilter#maskMatrix
+         */
+        maskMatrix: PIXI.Matrix;
+        /**
+         * Applies the filter
+         *
+         * @param {PIXI.systems.FilterSystem} filterManager - The renderer to retrieve the filter from
+         * @param {PIXI.RenderTexture} input - The input render target.
+         * @param {PIXI.RenderTexture} output - The target to output to.
+         * @param {boolean} clear - Should the output be cleared before rendering to it.
+         */
+        apply(filterManager: PIXI.systems.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clear: boolean): void;
+        /**
+         * The padding of the filter. Some filters require extra space to breath such as a blur.
+         * Increasing this will add extra width and height to the bounds of the object that the
+         * filter is applied to.
+         *
+         * @member {number} PIXI.Filter#padding
+         */
+        padding: number;
+        /**
+         * The resolution of the filter. Setting this to be lower will lower the quality but
+         * increase the performance of the filter.
+         *
+         * @member {number} PIXI.Filter#resolution
+         */
+        resolution: number;
+        /**
+         * If enabled is true the filter is applied, if false it will not.
+         *
+         * @member {boolean} PIXI.Filter#enabled
+         */
+        enabled: boolean;
+        /**
+         * If enabled, PixiJS will fit the filter area into boundaries for better performance.
+         * Switch it off if it does not work for specific shader.
+         *
+         * @member {boolean} PIXI.Filter#autoFit
+         */
+        autoFit: boolean;
+        /**
+         * Legacy filters use position and uvs from attributes
+         * @member {boolean} PIXI.Filter#legacy
+         * @readonly
+         */
+        readonly legacy: boolean;
+        /**
+         * The WebGL state the filter requires to render
+         * @member {PIXI.State} PIXI.Filter#state
+         */
+        state: PIXI.State;
+        /**
+         * Sets the blendmode of the filter
+         *
+         * @member {number}
+         * @default PIXI.BLEND_MODES.NORMAL
+         */
+        blendMode: number;
+        /**
+         * Shader uniform values, shortcut for `uniformGroup.uniforms`
+         * @readonly
+         * @member {object}
+         */
+        readonly uniforms: any;
+    }
+    /**
+     * Default vertex shader
+     * @memberof PIXI
+     * @member {string} defaultVertex
+     */
+    var defaultVertex: string;
+    /**
+     * Default filter vertex shader
+     * @memberof PIXI
+     * @member {string} defaultFilterVertex
+     */
+    var defaultFilterVertex: string;
+    /**
+     * Frame buffer used by the BaseRenderTexture
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Framebuffer {
+        constructor(width: number, height: number);
+        /**
+         * Reference to the colorTexture.
+         *
+         * @member {PIXI.Texture[]}
+         * @readonly
+         */
+        readonly colorTexture: PIXI.Texture[];
+        /**
+         * Add texture to the colorTexture array
+         *
+         * @param {number} [index=0] - Index of the array to add the texture to
+         * @param {PIXI.Texture} [texture] - Texture to add to the array
+         */
+        addColorTexture(index?: number, texture?: PIXI.Texture): void;
+        /**
+         * Add a depth texture to the frame buffer
+         *
+         * @param {PIXI.Texture} [texture] - Texture to add
+         */
+        addDepthTexture(texture?: PIXI.Texture): void;
+        /**
+         * Enable depth on the frame buffer
+         */
+        enableDepth(): void;
+        /**
+         * Enable stencil on the frame buffer
+         */
+        enableStencil(): void;
+        /**
+         * Resize the frame buffer
+         *
+         * @param {number} width - Width of the frame buffer to resize to
+         * @param {number} height - Height of the frame buffer to resize to
+         */
+        resize(width: number, height: number): void;
+        /**
+         * disposes WebGL resources that are connected to this geometry
+         */
+        dispose(): void;
+    }
+    /**
+     * Holds the information for a single attribute structure required to render geometry.
+     *
+     * This does not contain the actual data, but instead has a buffer id that maps to a {@link PIXI.Buffer}
+     * This can include anything from positions, uvs, normals, colors etc.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Attribute {
+        constructor(buffer: string, size?: number, normalized?: boolean, type?: number, stride?: number, start?: number);
+        /**
+         * Destroys the Attribute.
+         */
+        destroy(): void;
+        /**
+         * Helper function that creates an Attribute based on the information provided
+         *
+         * @static
+         * @param {string} buffer  the id of the buffer that this attribute will look for
+         * @param {Number} [size=2] the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
+         * @param {Number} [stride=0] How far apart (in floats) the start of each value is. (used for interleaving data)
+         * @param {Number} [start=0] How far into the array to start reading values (used for interleaving data)
+         * @param {Boolean} [normalized=false] should the data be normalized.
+         *
+         * @returns {PIXI.Attribute} A new {@link PIXI.Attribute} based on the information provided
+         */
+        static from(buffer: string, size?: number, stride?: number, start?: number, normalized?: boolean): PIXI.Attribute;
+    }
+    /**
+     * A wrapper for data so that it can be used and uploaded by WebGL
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Buffer {
+        constructor(data: ArrayBuffer | SharedArrayBuffer | ArrayBufferView, _static?: boolean, index?: boolean);
+        /**
+         * The data in the buffer, as a typed array
+         *
+         * @member {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} PIXI.Buffer#data
+         */
+        data: ArrayBuffer | SharedArrayBuffer | ArrayBufferView;
+        /**
+         * flags this buffer as requiring an upload to the GPU
+         * @param {ArrayBuffer|SharedArrayBuffer|ArrayBufferView} [data] the data to update in the buffer.
+         */
+        update(data?: ArrayBuffer | SharedArrayBuffer | ArrayBufferView): void;
+        /**
+         * disposes WebGL resources that are connected to this geometry
+         */
+        dispose(): void;
+        /**
+         * Destroys the buffer
+         */
+        destroy(): void;
+        /**
+         * Helper function that creates a buffer based on an array or TypedArray
+         *
+         * @static
+         * @param {ArrayBufferView | number[]} data the TypedArray that the buffer will store. If this is a regular Array it will be converted to a Float32Array.
+         * @return {PIXI.Buffer} A new Buffer based on the data provided.
+         */
+        static from(data: ArrayBufferView | number[]): PIXI.Buffer;
+    }
+    /**
+     * The Geometry represents a model. It consists of two components:
+     * - GeometryStyle - The structure of the model such as the attributes layout
+     * - GeometryData - the data of the model - this consists of buffers.
+     * This can include anything from positions, uvs, normals, colors etc.
+     *
+     * Geometry can be defined without passing in a style or data if required (thats how I prefer!)
+     *
+     * ```js
+     * let geometry = new PIXI.Geometry();
+     *
+     * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);
+     * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1],2)
+     * geometry.addIndex([0,1,2,1,3,2])
+     *
+     * ```
+     * @class
+     * @memberof PIXI
+     */
+    class Geometry {
+        constructor(buffers?: PIXI.Buffer[], attributes?: any);
+        /**
+         * A map of renderer IDs to webgl VAOs
+         *
+         * @protected
+         * @type {object}
+         */
+        protected glVertexArrayObjects: any;
+        /**
+         * Count of existing (not destroyed) meshes that reference this geometry
+         * @member {boolean} PIXI.Geometry#refCount
+         */
+        refCount: boolean;
+        /**
+         *
+         * Adds an attribute to the geometry
+         *
+         * @param {String} id - the name of the attribute (matching up to a shader)
+         * @param {PIXI.Buffer} [buffer] the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.
+         * @param {Number} [size=0] the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
+         * @param {Boolean} [normalized=false] should the data be normalized.
+         * @param {Number} [type=PIXI.TYPES.FLOAT] what type of number is the attribute. Check {PIXI.TYPES} to see the ones available
+         * @param {Number} [stride=0] How far apart (in floats) the start of each value is. (used for interleaving data)
+         * @param {Number} [start=0] How far into the array to start reading values (used for interleaving data)
+         *
+         * @return {PIXI.Geometry} returns self, useful for chaining.
+         */
+        addAttribute(id: string, buffer?: PIXI.Buffer, size?: number, normalized?: boolean, type?: number, stride?: number, start?: number): PIXI.Geometry;
+        /**
+         * returns the requested attribute
+         *
+         * @param {String} id  the name of the attribute required
+         * @return {PIXI.Attribute} the attribute requested.
+         */
+        getAttribute(id: string): PIXI.Attribute;
+        /**
+         * returns the requested buffer
+         *
+         * @param {String} id  the name of the buffer required
+         * @return {PIXI.Buffer} the buffer requested.
+         */
+        getBuffer(id: string): PIXI.Buffer;
+        /**
+         *
+         * Adds an index buffer to the geometry
+         * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.
+         *
+         * @param {PIXI.Buffer} [buffer] the buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.
+         * @return {PIXI.Geometry} returns self, useful for chaining.
+         */
+        addIndex(buffer?: PIXI.Buffer): PIXI.Geometry;
+        /**
+         * returns the index buffer
+         *
+         * @return {PIXI.Buffer} the index buffer.
+         */
+        getIndex(): PIXI.Buffer;
+        /**
+         * this function modifies the structure so that all current attributes become interleaved into a single buffer
+         * This can be useful if your model remains static as it offers a little performance boost
+         *
+         * @return {PIXI.Geometry} returns self, useful for chaining.
+         */
+        interleave(): PIXI.Geometry;
+        /**
+         * disposes WebGL resources that are connected to this geometry
+         */
+        dispose(): void;
+        /**
+         * Destroys the geometry.
+         */
+        destroy(): void;
+        /**
+         * returns a clone of the geometry
+         *
+         * @returns {PIXI.Geometry} a new clone of this geometry
+         */
+        clone(): PIXI.Geometry;
+        /**
+         * merges an array of geometries into a new single one
+         * geometry attribute styles must match for this operation to work
+         *
+         * @param {PIXI.Geometry[]} geometries array of geometries to merge
+         * @returns {PIXI.Geometry} shiny new geometry!
+         */
+        static merge(geometries: PIXI.Geometry[]): PIXI.Geometry;
+    }
+    /**
+     * The Renderer draws the scene and all its content onto a WebGL enabled canvas.
+     *
+     * This renderer should be used for browsers that support WebGL.
+     *
+     * This renderer works by automatically managing WebGLBatchesm, so no need for Sprite Batches or Sprite Clouds.
+     * Don't forget to add the view to your DOM or you will not see anything!
+     *
+     * @class
+     * @memberof PIXI
+     * @extends PIXI.AbstractRenderer
+     */
+    class Renderer extends PIXI.AbstractRenderer {
+        constructor(options?: {
+            width?: number;
+            height?: number;
+            view?: HTMLCanvasElement;
+            transparent?: boolean;
+            autoDensity?: boolean;
+            antialias?: boolean;
+            forceFXAA?: boolean;
+            resolution?: number;
+            clearBeforeRender?: boolean;
+            preserveDrawingBuffer?: boolean;
+            backgroundColor?: number;
+            powerPreference?: string;
+            context?: any;
+        });
+        /**
+         * The type of this renderer as a standardized const
+         *
+         * @member {number} PIXI.Renderer#type
+         * @see PIXI.RENDERER_TYPE
+         */
+        type: number;
+        /**
+         * Global uniforms
+         * @member {PIXI.UniformGroup} PIXI.Renderer#globalUniforms
+         */
+        globalUniforms: PIXI.UniformGroup;
+        /**
+         * Mask system instance
+         * @member {PIXI.systems.MaskSystem} mask
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly mask: PIXI.systems.MaskSystem;
+        /**
+         * Context system instance
+         * @member {PIXI.systems.ContextSystem} context
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly context: PIXI.systems.ContextSystem;
+        /**
+         * State system instance
+         * @member {PIXI.systems.StateSystem} state
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly state: PIXI.systems.StateSystem;
+        /**
+         * Shader system instance
+         * @member {PIXI.systems.ShaderSystem} shader
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly shader: PIXI.systems.ShaderSystem;
+        /**
+         * Texture system instance
+         * @member {PIXI.systems.TextureSystem} texture
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly texture: PIXI.systems.TextureSystem;
+        /**
+         * Geometry system instance
+         * @member {PIXI.systems.GeometrySystem} geometry
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly geometry: PIXI.systems.GeometrySystem;
+        /**
+         * Framebuffer system instance
+         * @member {PIXI.systems.FramebufferSystem} framebuffer
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly framebuffer: PIXI.systems.FramebufferSystem;
+        /**
+         * Stencil system instance
+         * @member {PIXI.systems.StencilSystem} stencil
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly stencil: PIXI.systems.StencilSystem;
+        /**
+         * Projection system instance
+         * @member {PIXI.systems.ProjectionSystem} projection
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly projection: PIXI.systems.ProjectionSystem;
+        /**
+         * Texture garbage collector system instance
+         * @member {PIXI.systems.TextureGCSystem} textureGC
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly textureGC: PIXI.systems.TextureGCSystem;
+        /**
+         * Filter system instance
+         * @member {PIXI.systems.FilterSystem} filter
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly filter: PIXI.systems.FilterSystem;
+        /**
+         * RenderTexture system instance
+         * @member {PIXI.systems.RenderTextureSystem} renderTexture
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly renderTexture: PIXI.systems.RenderTextureSystem;
+        /**
+         * Batch system instance
+         * @member {PIXI.systems.BatchSystem} batch
+         * @memberof PIXI.Renderer#
+         * @readonly
+         */
+        readonly batch: PIXI.systems.BatchSystem;
+        /**
+         * Flag if we are rendering to the screen vs renderTexture
+         * @member {boolean} PIXI.Renderer#renderingToScreen
+         * @readonly
+         * @default true
+         */
+        readonly renderingToScreen: boolean;
+        /**
+         * Add a new system to the renderer.
+         * @param {Function} ClassRef - Class reference
+         * @param {string} [name] - Property name for system, if not specified
+         *        will use a static `name` property on the class itself. This
+         *        name will be assigned as s property on the Renderer so make
+         *        sure it doesn't collide with properties on Renderer.
+         * @return {PIXI.Renderer} Return instance of renderer
+         */
+        addSystem(ClassRef: (...params: any[]) => any, name?: string): PIXI.Renderer;
+        /**
+         * Renders the object to its WebGL view
+         *
+         * @param {PIXI.DisplayObject} displayObject - The object to be rendered.
+         * @param {PIXI.RenderTexture} [renderTexture] - The render texture to render to.
+         * @param {boolean} [clear=true] - Should the canvas be cleared before the new render.
+         * @param {PIXI.Matrix} [transform] - A transform to apply to the render texture before rendering.
+         * @param {boolean} [skipUpdateTransform=false] - Should we skip the update transform pass?
+         */
+        render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Matrix, skipUpdateTransform?: boolean): void;
+        /**
+         * Resizes the WebGL view to the specified width and height.
+         *
+         * @param {number} screenWidth - The new width of the screen.
+         * @param {number} screenHeight - The new height of the screen.
+         */
+        resize(screenWidth: number, screenHeight: number): void;
+        /**
+         * Resets the WebGL state so you can render things however you fancy!
+         *
+         * @return {PIXI.Renderer} Returns itself.
+         */
+        reset(): PIXI.Renderer;
+        /**
+         * Clear the frame buffer
+         */
+        clear(): void;
+        /**
+         * Removes everything from the renderer (event listeners, spritebatch, etc...)
+         *
+         * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.
+         *  See: https://github.com/pixijs/pixi.js/issues/2233
+         */
+        destroy(removeView?: boolean): void;
+        /**
+         * Collection of installed plugins. These are included by default in PIXI, but can be excluded
+         * by creating a custom build. Consult the README for more information about creating custom
+         * builds and excluding plugins.
+         * @name PIXI.Renderer#plugins
+         * @type {object}
+         * @readonly
+         * @property {PIXI.accessibility.AccessibilityManager} accessibility Support tabbing interactive elements.
+         * @property {PIXI.extract.Extract} extract Extract image data from renderer.
+         * @property {PIXI.interaction.InteractionManager} interaction Handles mouse, touch and pointer events.
+         * @property {PIXI.prepare.Prepare} prepare Pre-render display objects.
+         */
+        readonly plugins: {
+            accessibility: PIXI.accessibility.AccessibilityManager;
+            extract: PIXI.extract.Extract;
+            interaction: PIXI.interaction.InteractionManager;
+            prepare: PIXI.prepare.Prepare;
+        };
+        /**
+         * Adds a plugin to the renderer.
+         *
+         * @method
+         * @param {string} pluginName - The name of the plugin.
+         * @param {Function} ctor - The constructor function or class for the plugin.
+         */
+        static registerPlugin(pluginName: string, ctor: (...params: any[]) => any): void;
+        /**
+         * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture
+         *
+         * @member {PIXI.extract.Extract} extract
+         * @memberof PIXI.Renderer#
+         * @see PIXI.extract.Extract
+         */
+        extract: PIXI.extract.Extract;
+        /**
+         * @deprecated since 5.0.0
+         * @member {boolean} PIXI.AbstractRenderer#autoResize
+         * @see PIXI.AbstractRenderer#autoDensity
+         */
+        autoResize: boolean;
+        /**
+         * The supplied constructor options.
+         *
+         * @member {Object} PIXI.AbstractRenderer#options
+         * @readOnly
+         */
+        readonly options: any;
+        /**
+         * Measurements of the screen. (0, 0, screenWidth, screenHeight).
+         *
+         * Its safe to use as filterArea or hitArea for the whole stage.
+         *
+         * @member {PIXI.Rectangle} PIXI.AbstractRenderer#screen
+         */
+        screen: PIXI.Rectangle;
+        /**
+         * The canvas element that everything is drawn to.
+         *
+         * @member {HTMLCanvasElement} PIXI.AbstractRenderer#view
+         */
+        view: HTMLCanvasElement;
+        /**
+         * The resolution / device pixel ratio of the renderer.
+         *
+         * @member {number} PIXI.AbstractRenderer#resolution
+         * @default 1
+         */
+        resolution: number;
+        /**
+         * Whether the render view is transparent.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#transparent
+         */
+        transparent: boolean;
+        /**
+         * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#autoDensity
+         */
+        autoDensity: boolean;
+        /**
+         * The value of the preserveDrawingBuffer flag affects whether or not the contents of
+         * the stencil buffer is retained after rendering.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#preserveDrawingBuffer
+         */
+        preserveDrawingBuffer: boolean;
+        /**
+         * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.
+         * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every
+         * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect
+         * to clear the canvas every frame. Disable this by setting this to false. For example, if
+         * your game has a canvas filling background image you often don't need this set.
+         *
+         * @member {boolean} PIXI.AbstractRenderer#clearBeforeRender
+         * @default
+         */
+        clearBeforeRender: boolean;
+        /**
+         * The background color as a number.
+         *
+         * @member {number} PIXI.AbstractRenderer#_backgroundColor
+         * @protected
+         */
+        protected _backgroundColor: number;
+        /**
+         * The background color as an [R, G, B] array.
+         *
+         * @member {number[]} PIXI.AbstractRenderer#_backgroundColorRgba
+         * @protected
+         */
+        protected _backgroundColorRgba: number[];
+        /**
+         * The background color as a string.
+         *
+         * @member {string} PIXI.AbstractRenderer#_backgroundColorString
+         * @protected
+         */
+        protected _backgroundColorString: string;
+        /**
+         * This temporary display object used as the parent of the currently being rendered item.
+         *
+         * @member {PIXI.DisplayObject} PIXI.AbstractRenderer#_tempDisplayObjectParent
+         * @protected
+         */
+        protected _tempDisplayObjectParent: PIXI.DisplayObject;
+        /**
+         * The last root object that the renderer tried to render.
+         *
+         * @member {PIXI.DisplayObject} PIXI.AbstractRenderer#_lastObjectRendered
+         * @protected
+         */
+        protected _lastObjectRendered: PIXI.DisplayObject;
+        /**
+         * Initialize the plugins.
+         *
+         * @protected
+         * @param {object} staticMap - The dictionary of statically saved plugins.
+         */
+        protected initPlugins(staticMap: any): void;
+        /**
+         * Same as view.width, actual number of pixels in the canvas by horizontal.
+         *
+         * @member {number}
+         * @readonly
+         * @default 800
+         */
+        readonly width: number;
+        /**
+         * Same as view.height, actual number of pixels in the canvas by vertical.
+         *
+         * @member {number}
+         * @readonly
+         * @default 600
+         */
+        readonly height: number;
+        /**
+         * Useful function that returns a texture of the display object that can then be used to create sprites
+         * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.
+         *
+         * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from.
+         * @param {number} scaleMode - Should be one of the scaleMode consts.
+         * @param {number} resolution - The resolution / device pixel ratio of the texture being generated.
+         * @param {PIXI.Rectangle} [region] - The region of the displayObject, that shall be rendered,
+         *        if no region is specified, defaults to the local bounds of the displayObject.
+         * @return {PIXI.Texture} A texture of the graphics object.
+         */
+        generateTexture(displayObject: PIXI.DisplayObject, scaleMode: number, resolution: number, region?: PIXI.Rectangle): PIXI.Texture;
+        /**
+         * The background color to fill if not transparent
+         *
+         * @member {number}
+         */
+        backgroundColor: number;
+    }
+    /**
+     * A BaseRenderTexture is a special texture that allows any PixiJS display object to be rendered to it.
+     *
+     * __Hint__: All DisplayObjects (i.e. Sprites) that render to a BaseRenderTexture should be preloaded
+     * otherwise black rectangles will be drawn instead.
+     *
+     * A BaseRenderTexture takes a snapshot of any Display Object given to its render method. The position
+     * and rotation of the given Display Objects is ignored. For example:
+     *
+     * ```js
+     * let renderer = PIXI.autoDetectRenderer();
+     * let baseRenderTexture = new PIXI.BaseRenderTexture(800, 600);
+     * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);
+     * let sprite = PIXI.Sprite.from("spinObj_01.png");
+     *
+     * sprite.position.x = 800/2;
+     * sprite.position.y = 600/2;
+     * sprite.anchor.x = 0.5;
+     * sprite.anchor.y = 0.5;
+     *
+     * renderer.render(sprite, renderTexture);
+     * ```
+     *
+     * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0
+     * you can clear the transform
+     *
+     * ```js
+     *
+     * sprite.setTransform()
+     *
+     * let baseRenderTexture = new PIXI.BaseRenderTexture(100, 100);
+     * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);
+     *
+     * renderer.render(sprite, renderTexture);  // Renders to center of RenderTexture
+     * ```
+     *
+     * @class
+     * @extends PIXI.BaseTexture
+     * @memberof PIXI
+     */
+    class BaseRenderTexture extends PIXI.BaseTexture {
+        constructor(options?: {
+            width?: number;
+            height?: number;
+            scaleMode?: PIXI.SCALE_MODES;
+            resolution?: number;
+        });
+        /**
+         * A reference to the canvas render target (we only need one as this can be shared across renderers)
+         *
+         * @protected
+         * @member {object} PIXI.BaseRenderTexture#_canvasRenderTarget
+         */
+        protected _canvasRenderTarget: any;
+        /**
+         * The data structure for the stencil masks.
+         *
+         * @member {PIXI.Graphics[]} PIXI.BaseRenderTexture#stencilMaskStack
+         */
+        stencilMaskStack: PIXI.Graphics[];
+        /**
+         * The data structure for the filters.
+         *
+         * @member {PIXI.Graphics[]} PIXI.BaseRenderTexture#filterStack
+         */
+        filterStack: PIXI.Graphics[];
+        /**
+         * Resizes the BaseRenderTexture.
+         *
+         * @param {number} width - The width to resize to.
+         * @param {number} height - The height to resize to.
+         */
+        resize(width: number, height: number): void;
+        /**
+         * Frees the texture and framebuffer from WebGL memory without destroying this texture object.
+         * This means you can still use the texture later which will upload it to GPU
+         * memory again.
+         *
+         * @fires PIXI.BaseTexture#dispose
+         */
+        dispose(): void;
+        /**
+         * Destroys this texture.
+         *
+         */
+        destroy(): void;
+        /**
+         * @method loadSource
+         * @memberof PIXI.BaseTexture#
+         * @deprecated since 5.0.0
+         */
+        loadSource(): void;
+        /**
+         * @name PIXI.BaseTexture#hasLoaded
+         * @type {boolean}
+         * @deprecated since 5.0.0
+         * @readonly
+         * @see PIXI.BaseTexture#valid
+         */
+        readonly hasLoaded: boolean;
+        /**
+         * @name PIXI.BaseTexture#imageUrl
+         * @type {string}
+         * @deprecated since 5.0.0
+         * @readonly
+         * @see PIXI.resource.ImageResource#url
+         */
+        readonly imageUrl: string;
+        /**
+         * Get the drawable source, such as HTMLCanvasElement or HTMLImageElement suitable
+         * for rendering with CanvasRenderer. Provided by **@pixi/canvas-renderer** package.
+         * @method getDrawableSource
+         * @memberof PIXI.BaseTexture#
+         * @return {PIXI.ICanvasImageSource} Source to render with CanvasRenderer
+         */
+        getDrawableSource(): PIXI.ICanvasImageSource;
+        /**
+         * The width of the base texture set when the image has loaded
+         *
+         * @readonly
+         * @member {number} PIXI.BaseTexture#width
+         */
+        readonly width: number;
+        /**
+         * The height of the base texture set when the image has loaded
+         *
+         * @readonly
+         * @member {number} PIXI.BaseTexture#height
+         */
+        readonly height: number;
+        /**
+         * The resolution / device pixel ratio of the texture
+         *
+         * @member {number} PIXI.BaseTexture#resolution
+         * @default PIXI.settings.RESOLUTION
+         */
+        resolution: number;
+        /**
+         * Mipmap mode of the texture, affects downscaled images
+         *
+         * @member {PIXI.MIPMAP_MODES} PIXI.BaseTexture#mipmap
+         * @default PIXI.settings.MIPMAP_TEXTURES
+         */
+        mipmap: PIXI.MIPMAP_MODES;
+        /**
+         * How the texture wraps
+         * @member {number} PIXI.BaseTexture#wrapMode
+         */
+        wrapMode: number;
+        /**
+         * The scale mode to apply when scaling this texture
+         *
+         * @member {PIXI.SCALE_MODES} PIXI.BaseTexture#scaleMode
+         * @default PIXI.settings.SCALE_MODE
+         */
+        scaleMode: PIXI.SCALE_MODES;
+        /**
+         * The pixel format of the texture
+         *
+         * @member {PIXI.FORMATS} PIXI.BaseTexture#format
+         * @default PIXI.FORMATS.RGBA
+         */
+        format: PIXI.FORMATS;
+        /**
+         * The type of resource data
+         *
+         * @member {PIXI.TYPES} PIXI.BaseTexture#type
+         * @default PIXI.TYPES.UNSIGNED_BYTE
+         */
+        type: PIXI.TYPES;
+        /**
+         * The target type
+         *
+         * @member {PIXI.TARGETS} PIXI.BaseTexture#target
+         * @default PIXI.TARGETS.TEXTURE_2D
+         */
+        target: PIXI.TARGETS;
+        /**
+         * Set to true to enable pre-multiplied alpha
+         *
+         * @member {boolean} PIXI.BaseTexture#premultiplyAlpha
+         * @default true
+         */
+        premultiplyAlpha: boolean;
+        /**
+         * Global unique identifier for this BaseTexture
+         *
+         * @member {string} PIXI.BaseTexture#uid
+         * @protected
+         */
+        protected uid: string;
+        /**
+         * Used by automatic texture Garbage Collection, stores last GC tick when it was bound
+         *
+         * @member {number} PIXI.BaseTexture#touched
+         * @protected
+         */
+        protected touched: number;
+        /**
+         * Whether or not the texture is a power of two, try to use power of two textures as much
+         * as you can
+         *
+         * @readonly
+         * @member {boolean} PIXI.BaseTexture#isPowerOfTwo
+         * @default false
+         */
+        readonly isPowerOfTwo: boolean;
+        /**
+         * Used by TextureSystem to only update texture to the GPU when needed.
+         *
+         * @protected
+         * @member {number} PIXI.BaseTexture#dirtyId
+         */
+        protected dirtyId: number;
+        /**
+         * Used by TextureSystem to only update texture style when needed.
+         *
+         * @protected
+         * @member {number} PIXI.BaseTexture#dirtyStyleId
+         */
+        protected dirtyStyleId: number;
+        /**
+         * Currently default cache ID.
+         *
+         * @member {string} PIXI.BaseTexture#cacheId
+         */
+        cacheId: string;
+        /**
+         * Generally speaking means when resource is loaded.
+         * @readonly
+         * @member {boolean} PIXI.BaseTexture#valid
+         */
+        readonly valid: boolean;
+        /**
+         * The collection of alternative cache ids, since some BaseTextures
+         * can have more than one ID, short name and longer full URL
+         *
+         * @member {Array} PIXI.BaseTexture#textureCacheIds
+         * @readonly
+         */
+        readonly textureCacheIds: string[];
+        /**
+         * Flag if BaseTexture has been destroyed.
+         *
+         * @member {boolean} PIXI.BaseTexture#destroyed
+         * @readonly
+         */
+        readonly destroyed: boolean;
+        /**
+         * The resource used by this BaseTexture, there can only
+         * be one resource per BaseTexture, but textures can share
+         * resources.
+         *
+         * @member {PIXI.resources.Resource} PIXI.BaseTexture#resource
+         * @readonly
+         */
+        readonly resource: PIXI.resources.Resource;
+        /**
+         * Number of the texture batch, used by multi-texture renderers
+         *
+         * @member {number} PIXI.BaseTexture#_batchEnabled
+         */
+        _batchEnabled: number;
+        /**
+         * Pixel width of the source of this texture
+         *
+         * @readonly
+         * @member {number}
+         */
+        readonly realWidth: number;
+        /**
+         * Pixel height of the source of this texture
+         *
+         * @readonly
+         * @member {number}
+         */
+        readonly realHeight: number;
+        /**
+         * Changes style options of BaseTexture
+         *
+         * @param {PIXI.SCALE_MODES} [scaleMode] - Pixi scalemode
+         * @param {PIXI.MIPMAP_MODES} [mipmap] - enable mipmaps
+         * @returns {BaseTexture} this
+         */
+        setStyle(scaleMode?: PIXI.SCALE_MODES, mipmap?: PIXI.MIPMAP_MODES): BaseTexture;
+        /**
+         * Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.
+         *
+         * @param {number} width Visual width
+         * @param {number} height Visual height
+         * @param {number} [resolution] Optionally set resolution
+         * @returns {BaseTexture} this
+         */
+        setSize(width: number, height: number, resolution?: number): BaseTexture;
+        /**
+         * Sets real size of baseTexture, preserves current resolution.
+         *
+         * @param {number} realWidth Full rendered width
+         * @param {number} realHeight Full rendered height
+         * @param {number} [resolution] Optionally set resolution
+         * @returns {BaseTexture} this
+         */
+        setRealSize(realWidth: number, realHeight: number, resolution?: number): BaseTexture;
+        /**
+         * Changes resolution
+         *
+         * @param {number} [resolution] res
+         * @returns {BaseTexture} this
+         */
+        setResolution(resolution?: number): BaseTexture;
+        /**
+         * Sets the resource if it wasn't set. Throws error if resource already present
+         *
+         * @param {PIXI.resources.Resource} resource - that is managing this BaseTexture
+         * @returns {BaseTexture} this
+         */
+        setResource(resource: PIXI.resources.Resource): BaseTexture;
+        /**
+         * Invalidates the object. Texture becomes valid if width and height are greater than zero.
+         */
+        update(): void;
+    }
+    /**
+     * A RenderTexture is a special texture that allows any PixiJS display object to be rendered to it.
+     *
+     * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded
+     * otherwise black rectangles will be drawn instead.
+     *
+     * A RenderTexture takes a snapshot of any Display Object given to its render method. For example:
+     *
+     * ```js
+     * let renderer = PIXI.autoDetectRenderer();
+     * let renderTexture = PIXI.RenderTexture.create(800, 600);
+     * let sprite = PIXI.Sprite.from("spinObj_01.png");
+     *
+     * sprite.position.x = 800/2;
+     * sprite.position.y = 600/2;
+     * sprite.anchor.x = 0.5;
+     * sprite.anchor.y = 0.5;
+     *
+     * renderer.render(sprite, renderTexture);
+     * ```
+     *
+     * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0
+     * you can clear the transform
+     *
+     * ```js
+     *
+     * sprite.setTransform()
+     *
+     * let renderTexture = new PIXI.RenderTexture.create(100, 100);
+     *
+     * renderer.render(sprite, renderTexture);  // Renders to center of RenderTexture
+     * ```
+     *
+     * @class
+     * @extends PIXI.Texture
+     * @memberof PIXI
+     */
+    class RenderTexture extends PIXI.Texture {
+        constructor(baseRenderTexture: PIXI.BaseRenderTexture, frame?: PIXI.Rectangle);
+        /**
+         * @name PIXI.RenderTexture#sourceFrame
+         * @type {PIXI.Rectangle}
+         * @deprecated since 5.0.0
+         * @readonly
+         */
+        readonly sourceFrame: PIXI.Rectangle;
+        /**
+         * @name PIXI.RenderTexture#size
+         * @type {PIXI.Rectangle}
+         * @deprecated since 5.0.0
+         * @readonly
+         */
+        readonly size: PIXI.Rectangle;
+        /**
+         * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
+         *
+         * @member {boolean} PIXI.RenderTexture#valid
+         */
+        valid: boolean;
+        /**
+         * FilterSystem temporary storage
+         * @protected
+         * @member {PIXI.Rectangle} PIXI.RenderTexture#filterFrame
+         */
+        protected filterFrame: PIXI.Rectangle;
+        /**
+         * The key for pooled texture of FilterSystem
+         * @protected
+         * @member {string} PIXI.RenderTexture#filterPoolKey
+         */
+        protected filterPoolKey: string;
+        /**
+         * Resizes the RenderTexture.
+         *
+         * @param {number} width - The width to resize to.
+         * @param {number} height - The height to resize to.
+         * @param {boolean} [resizeBaseTexture=true] - Should the baseTexture.width and height values be resized as well?
+         */
+        resize(width: number, height: number, resizeBaseTexture?: boolean): void;
+        /**
+         * A short hand way of creating a render texture.
+         *
+         * @param {object} [options] - Options
+         * @param {number} [options.width=100] - The width of the render texture
+         * @param {number} [options.height=100] - The height of the render texture
+         * @param {number} [options.scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values
+         * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the texture being generated
+         * @return {PIXI.RenderTexture} The new render texture
+         */
+        static create(options?: {
+            width?: number;
+            height?: number;
+            scaleMode?: number;
+            resolution?: number;
+        }): PIXI.RenderTexture;
+        /**
+         * Does this Texture have any frame data assigned to it?
+         *
+         * @member {boolean} PIXI.Texture#noFrame
+         */
+        noFrame: boolean;
+        /**
+         * The base texture that this texture uses.
+         *
+         * @member {PIXI.BaseTexture} PIXI.Texture#baseTexture
+         */
+        baseTexture: PIXI.BaseTexture;
+        /**
+         * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
+         * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
+         *
+         * @member {PIXI.Rectangle} PIXI.Texture#_frame
+         */
+        _frame: PIXI.Rectangle;
+        /**
+         * This is the trimmed area of original texture, before it was put in atlas
+         * Please call `updateUvs()` after you change coordinates of `trim` manually.
+         *
+         * @member {PIXI.Rectangle} PIXI.Texture#trim
+         */
+        trim: PIXI.Rectangle;
+        /**
+         * This will let a renderer know that a texture has been updated (used mainly for WebGL uv updates)
+         *
+         * @member {boolean} PIXI.Texture#requiresUpdate
+         */
+        requiresUpdate: boolean;
+        /**
+         * The WebGL UV data cache. Can be used as quad UV
+         *
+         * @member {PIXI.TextureUvs} PIXI.Texture#_uvs
+         * @protected
+         */
+        protected _uvs: PIXI.TextureUvs;
+        /**
+         * Default TextureMatrix instance for this texture
+         * By default that object is not created because its heavy
+         *
+         * @member {PIXI.TextureMatrix} PIXI.Texture#uvMatrix
+         */
+        uvMatrix: PIXI.TextureMatrix;
+        /**
+         * This is the area of original texture, before it was put in atlas
+         *
+         * @member {PIXI.Rectangle} PIXI.Texture#orig
+         */
+        orig: PIXI.Rectangle;
+        /**
+         * Anchor point that is used as default if sprite is created with this texture.
+         * Changing the `defaultAnchor` at a later point of time will not update Sprite's anchor point.
+         * @member {PIXI.Point} PIXI.Texture#defaultAnchor
+         * @default {0,0}
+         */
+        defaultAnchor: PIXI.Point;
+        /**
+         * Update ID is observed by sprites and TextureMatrix instances.
+         * Call updateUvs() to increment it.
+         *
+         * @member {number} PIXI.Texture#_updateID
+         * @protected
+         */
+        protected _updateID: number;
+        /**
+         * The ids under which this Texture has been added to the texture cache. This is
+         * automatically set as long as Texture.addToCache is used, but may not be set if a
+         * Texture is added directly to the TextureCache array.
+         *
+         * @member {string[]} PIXI.Texture#textureCacheIds
+         */
+        textureCacheIds: string[];
+        /**
+         * Updates this texture on the gpu.
+         *
+         */
+        update(): void;
+        /**
+         * Called when the base texture is updated
+         *
+         * @protected
+         * @param {PIXI.BaseTexture} baseTexture - The base texture.
+         */
+        protected onBaseTextureUpdated(baseTexture: PIXI.BaseTexture): void;
+        /**
+         * Destroys this texture
+         *
+         * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well
+         */
+        destroy(destroyBase?: boolean): void;
+        /**
+         * Creates a new texture object that acts the same as this one.
+         *
+         * @return {PIXI.Texture} The new texture
+         */
+        clone(): PIXI.Texture;
+        /**
+         * Updates the internal WebGL UV cache. Use it after you change `frame` or `trim` of the texture.
+         * Call it after changing the frame
+         */
+        updateUvs(): void;
+        /**
+         * The frame specifies the region of the base texture that this texture uses.
+         * Please call `updateUvs()` after you change coordinates of `frame` manually.
+         *
+         * @member {PIXI.Rectangle}
+         */
+        frame: PIXI.Rectangle;
+        /**
+         * Indicates whether the texture is rotated inside the atlas
+         * set to 2 to compensate for texture packer rotation
+         * set to 6 to compensate for spine packer rotation
+         * can be used to rotate or mirror sprites
+         * See {@link PIXI.GroupD8} for explanation
+         *
+         * @member {number}
+         */
+        rotate: number;
+        /**
+         * The width of the Texture in pixels.
+         *
+         * @member {number}
+         */
+        width: number;
+        /**
+         * The height of the Texture in pixels.
+         *
+         * @member {number}
+         */
+        height: number;
+    }
+    /**
+     * Helper class to create a WebGL Program
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class GLProgram {
+        constructor(program: WebGLProgram, uniformData: any);
+        /**
+         * The shader program
+         *
+         * @member {WebGLProgram} PIXI.GLProgram#program
+         */
+        program: WebGLProgram;
+        /**
+         * holds the uniform data which contains uniform locations
+         * and current uniform values used for caching and preventing unneeded GPU commands
+         * @member {Object} PIXI.GLProgram#uniformData
+         */
+        uniformData: any;
+        /**
+         * uniformGroups holds the various upload functions for the shader. Each uniform group
+         * and program have a unique upload function generated.
+         * @member {Object} PIXI.GLProgram#uniformGroups
+         */
+        uniformGroups: any;
+        /**
+         * Destroys this program
+         */
+        destroy(): void;
+    }
+    /**
+     * Helper class to create a shader program.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Program {
+        constructor(vertexSrc?: string, fragmentSrc?: string, name?: string);
+        /**
+         * The vertex shader.
+         *
+         * @member {string} PIXI.Program#vertexSrc
+         */
+        vertexSrc: string;
+        /**
+         * The fragment shader.
+         *
+         * @member {string} PIXI.Program#fragmentSrc
+         */
+        fragmentSrc: string;
+        /**
+         * Extracts the data for a buy creating a small test program
+         * or reading the src directly.
+         * @protected
+         *
+         * @param {string} [vertexSrc] - The source of the vertex shader.
+         * @param {string} [fragmentSrc] - The source of the fragment shader.
+         */
+        protected extractData(vertexSrc?: string, fragmentSrc?: string): void;
+        /**
+         * The default vertex shader source
+         *
+         * @static
+         * @constant
+         * @member {string}
+         */
+        static defaultVertexSrc: string;
+        /**
+         * The default fragment shader source
+         *
+         * @static
+         * @constant
+         * @member {string}
+         */
+        static defaultFragmentSrc: string;
+        /**
+         * A short hand function to create a program based of a vertex and fragment shader
+         * this method will also check to see if there is a cached program.
+         *
+         * @param {string} [vertexSrc] - The source of the vertex shader.
+         * @param {string} [fragmentSrc] - The source of the fragment shader.
+         * @param {object} [uniforms] - Custom uniforms to use to augment the built-in ones.
+         *
+         * @returns {PIXI.Program} an shiny new Pixi shader!
+         */
+        static from(vertexSrc?: string, fragmentSrc?: string, uniforms?: any): PIXI.Program;
+    }
+    /**
+     * A helper class for shaders
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Shader {
+        constructor(program?: PIXI.Program, uniforms?: any);
+        /**
+         * Shader uniform values, shortcut for `uniformGroup.uniforms`
+         * @readonly
+         * @member {object}
+         */
+        readonly uniforms: any;
+        /**
+         * A short hand function to create a shader based of a vertex and fragment shader
+         *
+         * @param {string} [vertexSrc] - The source of the vertex shader.
+         * @param {string} [fragmentSrc] - The source of the fragment shader.
+         * @param {object} [uniforms] - Custom uniforms to use to augment the built-in ones.
+         *
+         * @returns {PIXI.Shader} an shiny new Pixi shader!
+         */
+        static from(vertexSrc?: string, fragmentSrc?: string, uniforms?: any): PIXI.Shader;
+    }
+    /**
+     * Uniform group holds uniform map and some ID's for work
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class UniformGroup {
+        constructor(uniforms?: any, _static?: boolean);
+        /**
+         * uniform values
+         * @member {object}
+         * @readonly
+         */
+        readonly uniforms: any;
+        /**
+         * Its a group and not a single uniforms
+         * @member {boolean}
+         * @readonly
+         * @default true
+         */
+        readonly group: boolean;
+        /**
+         * dirty version
+         * @protected
+         * @member {number}
+         */
+        protected dirtyId: number;
+        /**
+         * unique id
+         * @protected
+         * @member {number}
+         */
+        protected id: number;
+        /**
+         * Uniforms wont be changed after creation
+         * @member {boolean}
+         */
+        static: boolean;
+    }
+    /**
+     * This is a WebGL state, and is is passed The WebGL StateManager.
+     *
+     * Each mesh rendered may require WebGL to be in a different state.
+     * For example you may want different blend mode or to enable polygon offsets
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class State {
+        constructor();
+        /**
+         * Activates blending of the computed fragment color values
+         *
+         * @member {boolean}
+         */
+        blend: boolean;
+        /**
+         * Activates adding an offset to depth values of polygon's fragments
+         *
+         * @member {boolean}
+         * @default false
+         */
+        offsets: boolean;
+        /**
+         * Activates culling of polygons.
+         *
+         * @member {boolean}
+         * @default false
+         */
+        culling: boolean;
+        /**
+         * Activates depth comparisons and updates to the depth buffer.
+         *
+         * @member {boolean}
+         * @default false
+         */
+        depthTest: boolean;
+        /**
+         * Specifies whether or not front or back-facing polygons can be culled.
+         * @member {boolean}
+         * @default false
+         */
+        clockwiseFrontFace: boolean;
+        /**
+         * The blend mode to be applied when this state is set. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
+         * Setting this mode to anything other than NO_BLEND will automatically switch blending on.
+         *
+         * @member {boolean}
+         * @default PIXI.BLEND_MODES.NORMAL
+         * @see PIXI.BLEND_MODES
+         */
+        blendMode: boolean;
+        /**
+         * The polygon offset. Setting this property to anything other than 0 will automatically enable polygon offset fill.
+         *
+         * @member {number}
+         * @default 0
+         */
+        polygonOffset: number;
+    }
+    /**
+     * System is a base class used for extending systems used by the {@link PIXI.Renderer}
+     *
+     * @see PIXI.Renderer#addSystem
+     * @class
+     * @memberof PIXI
+     */
+    class System {
+        constructor(renderer: PIXI.Renderer);
+        /**
+         * The renderer this manager works for.
+         *
+         * @member {PIXI.Renderer} PIXI.System#renderer
+         */
+        renderer: PIXI.Renderer;
+        /**
+         * Generic method called when there is a WebGL context change.
+         *
+         * @param {WebGLRenderingContext} gl new webgl context
+         */
+        contextChange(gl: WebGLRenderingContext): void;
+        /**
+         * Generic destroy methods to be overridden by the subclass
+         */
+        destroy(): void;
+    }
+    /**
+     * Systems are individual components to the Renderer pipeline.
+     * @namespace PIXI.systems
+     */
+    namespace systems {
+        /**
+         * System plugin to the renderer to manage batching.
+         *
+         * @class
+         * @extends PIXI.System
+         * @memberof PIXI.systems
+         */
+        class BatchSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * An empty renderer.
+             *
+             * @member {PIXI.ObjectRenderer} PIXI.systems.BatchSystem#emptyRenderer
+             */
+            emptyRenderer: PIXI.ObjectRenderer;
+            /**
+             * The currently active ObjectRenderer.
+             *
+             * @member {PIXI.ObjectRenderer} PIXI.systems.BatchSystem#currentRenderer
+             */
+            currentRenderer: PIXI.ObjectRenderer;
+            /**
+             * Changes the current renderer to the one given in parameter
+             *
+             * @param {PIXI.ObjectRenderer} objectRenderer - The object renderer to use.
+             */
+            setObjectRenderer(objectRenderer: PIXI.ObjectRenderer): void;
+            /**
+             * This should be called if you wish to do some custom rendering
+             * It will basically render anything that may be batched up such as sprites
+             */
+            flush(): void;
+            /**
+             * Reset the system to an empty renderer
+             */
+            reset(): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic method called when there is a WebGL context change.
+             *
+             * @param {WebGLRenderingContext} gl new webgl context
+             */
+            contextChange(gl: WebGLRenderingContext): void;
+            /**
+             * Generic destroy methods to be overridden by the subclass
+             */
+            destroy(): void;
+        }
+        /**
+         * System plugin to the renderer to manage the context.
+         *
+         * @class
+         * @extends PIXI.System
+         * @memberof PIXI.systems
+         */
+        class ContextSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * Either 1 or 2 to reflect the WebGL version being used
+             * @member {number} PIXI.systems.ContextSystem#webGLVersion
+             * @readonly
+             */
+            readonly webGLVersion: number;
+            /**
+             * Extensions being used
+             * @member {object} PIXI.systems.ContextSystem#extensions
+             * @readonly
+             * @property {WEBGL_draw_buffers} drawBuffers - WebGL v1 extension
+             * @property {WEBGL_depth_texture} depthTexture - WebGL v1 extension
+             * @property {OES_texture_float} floatTexture - WebGL v1 extension
+             * @property {WEBGL_lose_context} loseContext - WebGL v1 extension
+             * @property {OES_vertex_array_object} vertexArrayObject - WebGL v1 extension
+             */
+            readonly extensions: {
+                drawBuffers: WEBGL_draw_buffers;
+                depthTexture: WEBGL_depth_texture;
+                floatTexture: OES_texture_float;
+                loseContext: WEBGL_lose_context;
+                vertexArrayObject: OES_vertex_array_object;
+            };
+            /**
+             * `true` if the context is lost
+             * @member {boolean}
+             * @readonly
+             */
+            readonly isLost: boolean;
+            /**
+             * Handle the context change event
+             * @param {WebGLRenderingContext} gl new webgl context
+             */
+            contextChange(gl: WebGLRenderingContext): void;
+            /**
+             * Initialize the context
+             *
+             * @protected
+             * @param {WebGLRenderingContext} gl - WebGL context
+             */
+            protected initFromContext(gl: WebGLRenderingContext): void;
+            /**
+             * Initialize from context options
+             *
+             * @protected
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext
+             * @param {object} options - context attributes
+             */
+            protected initFromOptions(options: any): void;
+            /**
+             * Helper class to create a WebGL Context
+             *
+             * @param canvas {HTMLCanvasElement} the canvas element that we will get the context from
+             * @param options {object} An options object that gets passed in to the canvas element containing the context attributes
+             * @see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext
+             * @return {WebGLRenderingContext} the WebGL context
+             */
+            createContext(canvas: HTMLCanvasElement, options: any): WebGLRenderingContext;
+            /**
+             * Auto-populate the extensions
+             *
+             * @protected
+             */
+            protected getExtensions(): void;
+            /**
+             * Handles a lost webgl context
+             *
+             * @protected
+             * @param {WebGLContextEvent} event - The context lost event.
+             */
+            protected handleContextLost(event: WebGLContextEvent): void;
+            /**
+             * Handles a restored webgl context
+             *
+             * @protected
+             */
+            protected handleContextRestored(): void;
+            /**
+             * Handle the post-render runner event
+             *
+             * @protected
+             */
+            protected postrender(): void;
+            /**
+             * Validate context
+             *
+             * @protected
+             * @param {WebGLRenderingContext} gl - Render context
+             */
+            protected validateContext(gl: WebGLRenderingContext): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic destroy methods to be overridden by the subclass
+             */
+            destroy(): void;
+        }
+        /**
+         * System plugin to the renderer to manage the filters.
+         *
+         * @class
+         * @memberof PIXI.systems
+         * @extends PIXI.System
+         */
+        class FilterSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * @method PIXI.systems.FilterSystem#calculateScreenSpaceMatrix
+             * @deprecated since 5.0.0
+             * @param {PIXI.Matrix} outputMatrix - the matrix to output to.
+             * @return {PIXI.Matrix} The mapped matrix.
+             */
+            calculateScreenSpaceMatrix(outputMatrix: PIXI.Matrix): PIXI.Matrix;
+            /**
+             * @method PIXI.systems.FilterSystem#calculateNormalizedScreenSpaceMatrix
+             * @deprecated since 5.0.0
+             * @param {PIXI.Matrix} outputMatrix - The matrix to output to.
+             * @return {PIXI.Matrix} The mapped matrix.
+             */
+            calculateNormalizedScreenSpaceMatrix(outputMatrix: PIXI.Matrix): PIXI.Matrix;
+            /**
+             * List of filters for the FilterSystem
+             * @member {Object[]} PIXI.systems.FilterSystem#defaultFilterStack
+             * @readonly
+             */
+            readonly defaultFilterStack: any[];
+            /**
+             * stores a bunch of PO2 textures used for filtering
+             * @member {Object} PIXI.systems.FilterSystem#texturePool
+             */
+            texturePool: any;
+            /**
+             * a pool for storing filter states, save us creating new ones each tick
+             * @member {Object[]} PIXI.systems.FilterSystem#statePool
+             */
+            statePool: any[];
+            /**
+             * A very simple geometry used when drawing a filter effect to the screen
+             * @member {PIXI.Quad} PIXI.systems.FilterSystem#quad
+             */
+            quad: PIXI.Quad;
+            /**
+             * Quad UVs
+             * @member {PIXI.QuadUv} PIXI.systems.FilterSystem#quadUv
+             */
+            quadUv: PIXI.QuadUv;
+            /**
+             * Temporary rect for maths
+             * @type {PIXI.Rectangle}
+             */
+            tempRect: PIXI.Rectangle;
+            /**
+             * Active state
+             * @member {object} PIXI.systems.FilterSystem#activeState
+             */
+            activeState: any;
+            /**
+             * This uniform group is attached to filter uniforms when used
+             * @member {PIXI.UniformGroup} PIXI.systems.FilterSystem#globalUniforms
+             * @property {PIXI.Rectangle} outputFrame
+             * @property {Float32Array} inputSize
+             * @property {Float32Array} inputPixel
+             * @property {Float32Array} inputClamp
+             * @property {Number} resolution
+             * @property {Float32Array} filterArea
+             * @property {Fload32Array} filterClamp
+             */
+            globalUniforms: PIXI.UniformGroup;
+            /**
+             * Adds a new filter to the System.
+             *
+             * @param {PIXI.DisplayObject} target - The target of the filter to render.
+             * @param {PIXI.Filter[]} filters - The filters to apply.
+             */
+            push(target: PIXI.DisplayObject, filters: PIXI.Filter[]): void;
+            /**
+             * Pops off the filter and applies it.
+             *
+             */
+            pop(): void;
+            /**
+             * Draws a filter.
+             *
+             * @param {PIXI.Filter} filter - The filter to draw.
+             * @param {PIXI.RenderTexture} input - The input render target.
+             * @param {PIXI.RenderTexture} output - The target to output to.
+             * @param {boolean} clear - Should the output be cleared before rendering to it
+             */
+            applyFilter(filter: PIXI.Filter, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clear: boolean): void;
+            /**
+             * Multiply _input normalized coordinates_ to this matrix to get _sprite texture normalized coordinates_.
+             *
+             * Use `outputMatrix * vTextureCoord` in the shader.
+             *
+             * @param {PIXI.Matrix} outputMatrix - The matrix to output to.
+             * @param {PIXI.Sprite} sprite - The sprite to map to.
+             * @return {PIXI.Matrix} The mapped matrix.
+             */
+            calculateSpriteMatrix(outputMatrix: PIXI.Matrix, sprite: PIXI.Sprite): PIXI.Matrix;
+            /**
+             * Destroys this Filter System.
+             *
+             * @param {boolean} [contextLost=false] context was lost, do not free shaders
+             *
+             */
+            destroy(contextLost?: boolean): void;
+            /**
+             * Gets a Power-of-Two render texture or fullScreen texture
+             *
+             * TODO move to a separate class could be on renderer?
+             *
+             * @protected
+             * @param {number} minWidth - The minimum width of the render texture in real pixels.
+             * @param {number} minHeight - The minimum height of the render texture in real pixels.
+             * @param {number} [resolution=1] - The resolution of the render texture.
+             * @return {PIXI.RenderTexture} The new render texture.
+             */
+            protected getOptimalFilterTexture(minWidth: number, minHeight: number, resolution?: number): PIXI.RenderTexture;
+            /**
+             * Gets extra render texture to use inside current filter
+             *
+             * @param {number} resolution resolution of the renderTexture
+             * @returns {PIXI.RenderTexture}
+             */
+            getFilterTexture(resolution: number): PIXI.RenderTexture;
+            /**
+             * Frees a render texture back into the pool.
+             *
+             * @param {PIXI.RenderTexture} renderTexture - The renderTarget to free
+             */
+            returnFilterTexture(renderTexture: PIXI.RenderTexture): void;
+            /**
+             * Empties the texture pool.
+             *
+             */
+            emptyPool(): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic method called when there is a WebGL context change.
+             *
+             * @param {WebGLRenderingContext} gl new webgl context
+             */
+            contextChange(gl: WebGLRenderingContext): void;
+        }
+        /**
+         * System plugin to the renderer to manage framebuffers.
+         *
+         * @class
+         * @extends PIXI.System
+         * @memberof PIXI.systems
+         */
+        class FramebufferSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * A list of managed framebuffers
+             * @member {PIXI.Framebuffer[]} PIXI.systems.FramebufferSystem#managedFramebuffers
+             * @readonly
+             */
+            readonly managedFramebuffers: PIXI.Framebuffer[];
+            /**
+             * Framebuffer value that shows that we don't know what is bound
+             * @member {Framebuffer} PIXI.systems.FramebufferSystem#unknownFramebuffer
+             * @readonly
+             */
+            readonly unknownFramebuffer: Framebuffer;
+            /**
+             * Sets up the renderer context and necessary buffers.
+             */
+            contextChange(): void;
+            /**
+             * Bind a framebuffer
+             *
+             * @param {PIXI.Framebuffer} framebuffer
+             * @param {PIXI.Rectangle} [frame] frame, default is framebuffer size
+             */
+            bind(framebuffer: PIXI.Framebuffer, frame?: PIXI.Rectangle): void;
+            /**
+             * Set the WebGLRenderingContext's viewport.
+             *
+             * @param {Number} x - X position of viewport
+             * @param {Number} y - Y position of viewport
+             * @param {Number} width - Width of viewport
+             * @param {Number} height - Height of viewport
+             */
+            setViewport(x: number, y: number, width: number, height: number): void;
+            /**
+             * Get the size of the current width and height. Returns object with `width` and `height` values.
+             *
+             * @member {object}
+             * @readonly
+             */
+            readonly size: any;
+            /**
+             * Clear the color of the context
+             *
+             * @param {Number} r - Red value from 0 to 1
+             * @param {Number} g - Green value from 0 to 1
+             * @param {Number} b - Blue value from 0 to 1
+             * @param {Number} a - Alpha value from 0 to 1
+             */
+            clear(r: number, g: number, b: number, a: number): void;
+            /**
+             * Initialize framebuffer
+             *
+             * @protected
+             * @param {PIXI.Framebuffer} framebuffer
+             */
+            protected initFramebuffer(framebuffer: PIXI.Framebuffer): void;
+            /**
+             * Resize the framebuffer
+             *
+             * @protected
+             * @param {PIXI.Framebuffer} framebuffer
+             */
+            protected resizeFramebuffer(framebuffer: PIXI.Framebuffer): void;
+            /**
+             * Update the framebuffer
+             *
+             * @protected
+             * @param {PIXI.Framebuffer} framebuffer
+             */
+            protected updateFramebuffer(framebuffer: PIXI.Framebuffer): void;
+            /**
+             * Disposes framebuffer
+             * @param {PIXI.Framebuffer} framebuffer framebuffer that has to be disposed of
+             * @param {boolean} [contextLost=false] If context was lost, we suppress all delete function calls
+             */
+            disposeFramebuffer(framebuffer: PIXI.Framebuffer, contextLost?: boolean): void;
+            /**
+             * Disposes all framebuffers, but not textures bound to them
+             * @param {boolean} [contextLost=false] If context was lost, we suppress all delete function calls
+             */
+            disposeAll(contextLost?: boolean): void;
+            /**
+             * resets framebuffer stored state, binds screen framebuffer
+             *
+             * should be called before renderTexture reset()
+             */
+            reset(): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic destroy methods to be overridden by the subclass
+             */
+            destroy(): void;
+        }
+        /**
+         * System plugin to the renderer to manage geometry.
+         *
+         * @class
+         * @extends PIXI.System
+         * @memberof PIXI.systems
+         */
+        class GeometrySystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * `true` if we has `*_vertex_array_object` extension
+             * @member {boolean} PIXI.systems.GeometrySystem#hasVao
+             * @readonly
+             */
+            readonly hasVao: boolean;
+            /**
+             * `true` if has `ANGLE_instanced_arrays` extension
+             * @member {boolean} PIXI.systems.GeometrySystem#hasInstance
+             * @readonly
+             */
+            readonly hasInstance: boolean;
+            /**
+             * A cache of currently bound buffer,
+             * contains only two members with keys ARRAY_BUFFER and ELEMENT_ARRAY_BUFFER
+             * @member {Object.} PIXI.systems.GeometrySystem#boundBuffers
+             * @readonly
+             */
+            readonly boundBuffers: {
+                [key: number]: PIXI.Buffer;
+            };
+            /**
+             * Cache for all geometries by id, used in case renderer gets destroyed or for profiling
+             * @member {object} PIXI.systems.GeometrySystem#managedGeometries
+             * @readonly
+             */
+            readonly managedGeometries: any;
+            /**
+             * Cache for all buffers by id, used in case renderer gets destroyed or for profiling
+             * @member {object} PIXI.systems.GeometrySystem#managedBuffers
+             * @readonly
+             */
+            readonly managedBuffers: any;
+            /**
+             * Sets up the renderer context and necessary buffers.
+             */
+            contextChange(): void;
+            /**
+             * Binds geometry so that is can be drawn. Creating a Vao if required
+             * @protected
+             * @param {PIXI.Geometry} geometry instance of geometry to bind
+             * @param {PIXI.Shader} shader instance of shader to bind
+             */
+            protected bind(geometry: PIXI.Geometry, shader: PIXI.Shader): void;
+            /**
+             * Reset and unbind any active VAO and geometry
+             */
+            reset(): void;
+            /**
+             * Update buffers
+             * @protected
+             */
+            protected updateBuffers(): void;
+            /**
+             * Check compability between a geometry and a program
+             * @protected
+             * @param {PIXI.Geometry} geometry - Geometry instance
+             * @param {PIXI.Program} program - Program instance
+             */
+            protected checkCompatibility(geometry: PIXI.Geometry, program: PIXI.Program): void;
+            /**
+             * Takes a geometry and program and generates a unique signature for them.
+             *
+             * @param {PIXI.Geometry} geometry to get signature from
+             * @param {PIXI.Program} program to test geometry against
+             * @returns {String} Unique signature of the geometry and program
+             * @protected
+             */
+            protected getSignature(geometry: PIXI.Geometry, program: PIXI.Program): string;
+            /**
+             * Creates or gets Vao with the same structure as the geometry and stores it on the geometry.
+             * If vao is created, it is bound automatically.
+             *
+             * @protected
+             * @param {PIXI.Geometry} geometry - Instance of geometry to to generate Vao for
+             * @param {PIXI.Program} program - Instance of program
+             */
+            protected initGeometryVao(geometry: PIXI.Geometry, program: PIXI.Program): void;
+            /**
+             * Disposes buffer
+             * @param {PIXI.Buffer} buffer buffer with data
+             * @param {boolean} [contextLost=false] If context was lost, we suppress deleteVertexArray
+             */
+            disposeBuffer(buffer: PIXI.Buffer, contextLost?: boolean): void;
+            /**
+             * Disposes geometry
+             * @param {PIXI.Geometry} geometry Geometry with buffers. Only VAO will be disposed
+             * @param {boolean} [contextLost=false] If context was lost, we suppress deleteVertexArray
+             */
+            disposeGeometry(geometry: PIXI.Geometry, contextLost?: boolean): void;
+            /**
+             * dispose all WebGL resources of all managed geometries and buffers
+             * @param {boolean} [contextLost=false] If context was lost, we suppress `gl.delete` calls
+             */
+            disposeAll(contextLost?: boolean): void;
+            /**
+             * Activate vertex array object
+             *
+             * @protected
+             * @param {PIXI.Geometry} geometry - Geometry instance
+             * @param {PIXI.Program} program - Shader program instance
+             */
+            protected activateVao(geometry: PIXI.Geometry, program: PIXI.Program): void;
+            /**
+             * Draw the geometry
+             *
+             * @param {Number} type - the type primitive to render
+             * @param {Number} [size] - the number of elements to be rendered
+             * @param {Number} [start] - Starting index
+             * @param {Number} [instanceCount] - the number of instances of the set of elements to execute
+             */
+            draw(type: number, size?: number, start?: number, instanceCount?: number): void;
+            /**
+             * Unbind/reset everything
+             * @protected
+             */
+            protected unbind(): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic destroy methods to be overridden by the subclass
+             */
+            destroy(): void;
+        }
+        /**
+         * System plugin to the renderer to manage masks.
+         *
+         * @class
+         * @extends PIXI.System
+         * @memberof PIXI.systems
+         */
+        class MaskSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * `true` if current pushed masked is scissor
+             * @member {boolean} PIXI.systems.MaskSystem#scissor
+             * @readonly
+             */
+            readonly scissor: boolean;
+            /**
+             * Mask data
+             * @member {PIXI.Graphics} PIXI.systems.MaskSystem#scissorData
+             * @readonly
+             */
+            readonly scissorData: PIXI.Graphics;
+            /**
+             * Target to mask
+             * @member {PIXI.DisplayObject} PIXI.systems.MaskSystem#scissorRenderTarget
+             * @readonly
+             */
+            readonly scissorRenderTarget: PIXI.DisplayObject;
+            /**
+             * Enable scissor
+             * @member {boolean} PIXI.systems.MaskSystem#enableScissor
+             * @readonly
+             */
+            readonly enableScissor: boolean;
+            /**
+             * Pool of used sprite mask filters
+             * @member {PIXI.SpriteMaskFilter[]} PIXI.systems.MaskSystem#alphaMaskPool
+             * @readonly
+             */
+            readonly alphaMaskPool: PIXI.SpriteMaskFilter[];
+            /**
+             * Current index of alpha mask pool
+             * @member {number} PIXI.systems.MaskSystem#alphaMaskIndex
+             * @default 0
+             * @readonly
+             */
+            readonly alphaMaskIndex: number;
+            /**
+             * Applies the Mask and adds it to the current filter stack.
+             *
+             * @param {PIXI.DisplayObject} target - Display Object to push the mask to
+             * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.
+             */
+            push(target: PIXI.DisplayObject, maskData: PIXI.Sprite | PIXI.Graphics): void;
+            /**
+             * Removes the last mask from the mask stack and doesn't return it.
+             *
+             * @param {PIXI.DisplayObject} target - Display Object to pop the mask from
+             * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.
+             */
+            pop(target: PIXI.DisplayObject, maskData: PIXI.Sprite | PIXI.Graphics): void;
+            /**
+             * Applies the Mask and adds it to the current filter stack.
+             *
+             * @param {PIXI.RenderTexture} target - Display Object to push the sprite mask to
+             * @param {PIXI.Sprite} maskData - Sprite to be used as the mask
+             */
+            pushSpriteMask(target: PIXI.RenderTexture, maskData: PIXI.Sprite): void;
+            /**
+             * Removes the last filter from the filter stack and doesn't return it.
+             *
+             */
+            popSpriteMask(): void;
+            /**
+             * Applies the Mask and adds it to the current filter stack.
+             *
+             * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.
+             */
+            pushStencilMask(maskData: PIXI.Sprite | PIXI.Graphics): void;
+            /**
+             * Removes the last filter from the filter stack and doesn't return it.
+             *
+             */
+            popStencilMask(): void;
+            /**
+             *
+             * @param {PIXI.DisplayObject} target - Display Object to push the mask to
+             * @param {PIXI.Graphics} maskData - The masking data.
+             */
+            pushScissorMask(target: PIXI.DisplayObject, maskData: PIXI.Graphics): void;
+            /**
+             * Pop scissor mask
+             *
+             */
+            popScissorMask(): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic method called when there is a WebGL context change.
+             *
+             * @param {WebGLRenderingContext} gl new webgl context
+             */
+            contextChange(gl: WebGLRenderingContext): void;
+            /**
+             * Generic destroy methods to be overridden by the subclass
+             */
+            destroy(): void;
+        }
+        /**
+         * System plugin to the renderer to manage stencils (used for masks).
+         *
+         * @class
+         * @extends PIXI.System
+         * @memberof PIXI.systems
+         */
+        class StencilSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * The mask stack
+             * @member {PIXI.Graphics[]} PIXI.systems.StencilSystem#stencilMaskStack
+             */
+            stencilMaskStack: PIXI.Graphics[];
+            /**
+             * Changes the mask stack that is used by this System.
+             *
+             * @param {PIXI.Graphics[]} stencilMaskStack - The mask stack
+             */
+            setMaskStack(stencilMaskStack: PIXI.Graphics[]): void;
+            /**
+             * Applies the Mask and adds it to the current stencil stack. @alvin
+             *
+             * @param {PIXI.Graphics} graphics - The mask
+             */
+            pushStencil(graphics: PIXI.Graphics): void;
+            /**
+             * Removes the last mask from the stencil stack. @alvin
+             */
+            popStencil(): void;
+            /**
+             * Destroys the mask stack.
+             *
+             */
+            destroy(): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic method called when there is a WebGL context change.
+             *
+             * @param {WebGLRenderingContext} gl new webgl context
+             */
+            contextChange(gl: WebGLRenderingContext): void;
+        }
+        /**
+         * System plugin to the renderer to manage the projection matrix.
+         *
+         * @class
+         * @extends PIXI.System
+         * @memberof PIXI.systems
+         */
+        class ProjectionSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * Destination frame
+             * @member {PIXI.Rectangle} PIXI.systems.ProjectionSystem#destinationFrame
+             * @readonly
+             */
+            readonly destinationFrame: PIXI.Rectangle;
+            /**
+             * Source frame
+             * @member {PIXI.Rectangle} PIXI.systems.ProjectionSystem#sourceFrame
+             * @readonly
+             */
+            readonly sourceFrame: PIXI.Rectangle;
+            /**
+             * Default destination frame
+             * @member {PIXI.Rectangle} PIXI.systems.ProjectionSystem#defaultFrame
+             * @readonly
+             */
+            readonly defaultFrame: PIXI.Rectangle;
+            /**
+             * Project matrix
+             * @member {PIXI.Matrix} PIXI.systems.ProjectionSystem#projectionMatrix
+             * @readonly
+             */
+            readonly projectionMatrix: PIXI.Matrix;
+            /**
+             * A transform that will be appended to the projection matrix
+             * if null, nothing will be applied
+             * @member {PIXI.Matrix} PIXI.systems.ProjectionSystem#transform
+             */
+            transform: PIXI.Matrix;
+            /**
+             * Updates the projection matrix based on a projection frame (which is a rectangle)
+             *
+             * @param {PIXI.Rectangle} destinationFrame - The destination frame.
+             * @param {PIXI.Rectangle} sourceFrame - The source frame.
+             * @param {Number} resolution - Resolution
+             * @param {boolean} root - If is root
+             */
+            update(destinationFrame: PIXI.Rectangle, sourceFrame: PIXI.Rectangle, resolution: number, root: boolean): void;
+            /**
+             * Updates the projection matrix based on a projection frame (which is a rectangle)
+             *
+             * @param {PIXI.Rectangle} destinationFrame - The destination frame.
+             * @param {PIXI.Rectangle} sourceFrame - The source frame.
+             * @param {Number} resolution - Resolution
+             * @param {boolean} root - If is root
+             */
+            calculateProjection(destinationFrame: PIXI.Rectangle, sourceFrame: PIXI.Rectangle, resolution: number, root: boolean): void;
+            /**
+             * Sets the transform of the active render target to the given matrix
+             *
+             * @param {PIXI.Matrix} matrix - The transformation matrix
+             */
+            setTransform(matrix: PIXI.Matrix): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic method called when there is a WebGL context change.
+             *
+             * @param {WebGLRenderingContext} gl new webgl context
+             */
+            contextChange(gl: WebGLRenderingContext): void;
+            /**
+             * Generic destroy methods to be overridden by the subclass
+             */
+            destroy(): void;
+        }
+        /**
+         * System plugin to the renderer to manage render textures.
+         *
+         * Should be added after FramebufferSystem
+         *
+         * @class
+         * @extends PIXI.System
+         * @memberof PIXI.systems
+         */
+        class RenderTextureSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * The clear background color as rgba
+             * @member {number[]} PIXI.systems.RenderTextureSystem#clearColor
+             */
+            clearColor: number[];
+            /**
+             * List of masks for the StencilSystem
+             * @member {PIXI.Graphics[]} PIXI.systems.RenderTextureSystem#defaultMaskStack
+             * @readonly
+             */
+            readonly defaultMaskStack: PIXI.Graphics[];
+            /**
+             * Render texture
+             * @member {PIXI.RenderTexture} PIXI.systems.RenderTextureSystem#current
+             * @readonly
+             */
+            readonly current: PIXI.RenderTexture;
+            /**
+             * Source frame
+             * @member {PIXI.Rectangle} PIXI.systems.RenderTextureSystem#sourceFrame
+             * @readonly
+             */
+            readonly sourceFrame: PIXI.Rectangle;
+            /**
+             * Destination frame
+             * @member {PIXI.Rectangle} PIXI.systems.RenderTextureSystem#destinationFrame
+             * @readonly
+             */
+            readonly destinationFrame: PIXI.Rectangle;
+            /**
+             * Bind the current render texture
+             * @param {PIXI.RenderTexture} renderTexture
+             * @param {PIXI.Rectangle} sourceFrame
+             * @param {PIXI.Rectangle} destinationFrame
+             */
+            bind(renderTexture: PIXI.RenderTexture, sourceFrame: PIXI.Rectangle, destinationFrame: PIXI.Rectangle): void;
+            /**
+             * Erases the render texture and fills the drawing area with a colour
+             *
+             * @param {number[]} [clearColor] - The color as rgba, default to use the renderer backgroundColor
+             * @return {PIXI.Renderer} Returns itself.
+             */
+            clear(clearColor?: number[]): PIXI.Renderer;
+            /**
+             * Resets renderTexture state
+             */
+            reset(): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic method called when there is a WebGL context change.
+             *
+             * @param {WebGLRenderingContext} gl new webgl context
+             */
+            contextChange(gl: WebGLRenderingContext): void;
+            /**
+             * Generic destroy methods to be overridden by the subclass
+             */
+            destroy(): void;
+        }
+        /**
+         * System plugin to the renderer to manage shaders.
+         *
+         * @class
+         * @memberof PIXI.systems
+         * @extends PIXI.System
+         */
+        class ShaderSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * The current WebGL rendering context
+             *
+             * @member {WebGLRenderingContext} PIXI.systems.ShaderSystem#gl
+             */
+            gl: WebGLRenderingContext;
+            /**
+             * Changes the current shader to the one given in parameter
+             *
+             * @param {PIXI.Shader} shader - the new shader
+             * @param {boolean} dontSync - false if the shader should automatically sync its uniforms.
+             * @returns {PIXI.GLProgram} the glProgram that belongs to the shader.
+             */
+            bind(shader: PIXI.Shader, dontSync: boolean): PIXI.GLProgram;
+            /**
+             * Uploads the uniforms values to the currently bound shader.
+             *
+             * @param {object} uniforms - the uniforms values that be applied to the current shader
+             */
+            setUniforms(uniforms: any): void;
+            /**
+             * Returns the underlying GLShade rof the currently bound shader.
+             * This can be handy for when you to have a little more control over the setting of your uniforms.
+             *
+             * @return {PIXI.GLProgram} the glProgram for the currently bound Shader for this context
+             */
+            getglProgram(): PIXI.GLProgram;
+            /**
+             * Resets ShaderSystem state, does not affect WebGL state
+             */
+            reset(): void;
+            /**
+             * Destroys this System and removes all its textures
+             */
+            destroy(): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic method called when there is a WebGL context change.
+             *
+             * @param {WebGLRenderingContext} gl new webgl context
+             */
+            contextChange(gl: WebGLRenderingContext): void;
+        }
+        /**
+         * System plugin to the renderer to manage WebGL state machines.
+         *
+         * @class
+         * @extends PIXI.System
+         * @memberof PIXI.systems
+         */
+        class StateSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * GL context
+             * @member {WebGLRenderingContext} PIXI.systems.StateSystem#gl
+             * @readonly
+             */
+            readonly gl: WebGLRenderingContext;
+            /**
+             * State ID
+             * @member {number} PIXI.systems.StateSystem#stateId
+             * @readonly
+             */
+            readonly stateId: number;
+            /**
+             * Polygon offset
+             * @member {number} PIXI.systems.StateSystem#polygonOffset
+             * @readonly
+             */
+            readonly polygonOffset: number;
+            /**
+             * Blend mode
+             * @member {number} PIXI.systems.StateSystem#blendMode
+             * @default PIXI.BLEND_MODES.NONE
+             * @readonly
+             */
+            readonly blendMode: number;
+            /**
+             * Whether current blend equation is different
+             * @member {boolean} PIXI.systems.StateSystem#_blendEq
+             * @protected
+             */
+            protected _blendEq: boolean;
+            /**
+             * Collection of calls
+             * @member {function[]} PIXI.systems.StateSystem#map
+             * @readonly
+             */
+            readonly map: ((...params: any[]) => any)[];
+            /**
+             * Collection of check calls
+             * @member {function[]} PIXI.systems.StateSystem#checks
+             * @readonly
+             */
+            readonly checks: ((...params: any[]) => any)[];
+            /**
+             * Default WebGL State
+             * @member {PIXI.State} PIXI.systems.StateSystem#defaultState
+             * @readonly
+             */
+            readonly defaultState: PIXI.State;
+            /**
+             * Sets the current state
+             *
+             * @param {*} state - The state to set.
+             */
+            setState(state: any): void;
+            /**
+             * Sets the state, when previous state is unknown
+             *
+             * @param {*} state - The state to set
+             */
+            forceState(state: any): void;
+            /**
+             * Enables or disabled blending.
+             *
+             * @param {boolean} value - Turn on or off webgl blending.
+             */
+            setBlend(value: boolean): void;
+            /**
+             * Enables or disable polygon offset fill
+             *
+             * @param {boolean} value - Turn on or off webgl polygon offset testing.
+             */
+            setOffset(value: boolean): void;
+            /**
+             * Sets whether to enable or disable depth test.
+             *
+             * @param {boolean} value - Turn on or off webgl depth testing.
+             */
+            setDepthTest(value: boolean): void;
+            /**
+             * Sets whether to enable or disable cull face.
+             *
+             * @param {boolean} value - Turn on or off webgl cull face.
+             */
+            setCullFace(value: boolean): void;
+            /**
+             * Sets the gl front face.
+             *
+             * @param {boolean} value - true is clockwise and false is counter-clockwise
+             */
+            setFrontFace(value: boolean): void;
+            /**
+             * Sets the blend mode.
+             *
+             * @param {number} value - The blend mode to set to.
+             */
+            setBlendMode(value: number): void;
+            /**
+             * Sets the polygon offset.
+             *
+             * @param {number} value - the polygon offset
+             * @param {number} scale - the polygon offset scale
+             */
+            setPolygonOffset(value: number, scale: number): void;
+            /**
+             * Resets all the logic and disables the vaos
+             */
+            reset(): void;
+            /**
+             * checks to see which updates should be checked based on which settings have been activated.
+             * For example, if blend is enabled then we should check the blend modes each time the state is changed
+             * or if polygon fill is activated then we need to check if the polygon offset changes.
+             * The idea is that we only check what we have too.
+             *
+             * @param {Function} func  the checking function to add or remove
+             * @param {boolean} value  should the check function be added or removed.
+             */
+            updateCheck(func: (...params: any[]) => any, value: boolean): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic method called when there is a WebGL context change.
+             *
+             * @param {WebGLRenderingContext} gl new webgl context
+             */
+            contextChange(gl: WebGLRenderingContext): void;
+            /**
+             * Generic destroy methods to be overridden by the subclass
+             */
+            destroy(): void;
+        }
+        /**
+         * System plugin to the renderer to manage texture garbage collection on the GPU,
+         * ensuring that it does not get clogged up with textures that are no longer being used.
+         *
+         * @class
+         * @memberof PIXI.systems
+         * @extends PIXI.System
+         */
+        class TextureGCSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * Count
+             * @member {number} PIXI.systems.TextureGCSystem#count
+             * @readonly
+             */
+            readonly count: number;
+            /**
+             * Check count
+             * @member {number} PIXI.systems.TextureGCSystem#checkCount
+             * @readonly
+             */
+            readonly checkCount: number;
+            /**
+             * Maximum idle time, in seconds
+             * @member {number} PIXI.systems.TextureGCSystem#maxIdle
+             * @see PIXI.settings.GC_MAX_IDLE
+             */
+            maxIdle: number;
+            /**
+             * Maximum number of itesm to check
+             * @member {number} PIXI.systems.TextureGCSystem#checkCountMax
+             * @see PIXI.settings.GC_MAX_CHECK_COUNT
+             */
+            checkCountMax: number;
+            /**
+             * Current garabage collection mode
+             * @member {PIXI.GC_MODES} PIXI.systems.TextureGCSystem#mode
+             * @see PIXI.settings.GC_MODE
+             */
+            mode: PIXI.GC_MODES;
+            /**
+             * Checks to see when the last time a texture was used
+             * if the texture has not been used for a specified amount of time it will be removed from the GPU
+             */
+            postrender(): void;
+            /**
+             * Checks to see when the last time a texture was used
+             * if the texture has not been used for a specified amount of time it will be removed from the GPU
+             */
+            run(): void;
+            /**
+             * Removes all the textures within the specified displayObject and its children from the GPU
+             *
+             * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from.
+             */
+            unload(displayObject: PIXI.DisplayObject): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic method called when there is a WebGL context change.
+             *
+             * @param {WebGLRenderingContext} gl new webgl context
+             */
+            contextChange(gl: WebGLRenderingContext): void;
+            /**
+             * Generic destroy methods to be overridden by the subclass
+             */
+            destroy(): void;
+        }
+        /**
+         * System plugin to the renderer to manage textures.
+         *
+         * @class
+         * @extends PIXI.System
+         * @memberof PIXI.systems
+         */
+        class TextureSystem extends PIXI.System {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * Bound textures
+             * @member {PIXI.BaseTexture[]} PIXI.systems.TextureSystem#boundTextures
+             * @readonly
+             */
+            readonly boundTextures: PIXI.BaseTexture[];
+            /**
+             * Current location
+             * @member {number} PIXI.systems.TextureSystem#currentLocation
+             * @readonly
+             */
+            readonly currentLocation: number;
+            /**
+             * List of managed textures
+             * @member {PIXI.BaseTexture[]} PIXI.systems.TextureSystem#managedTextures
+             * @readonly
+             */
+            readonly managedTextures: PIXI.BaseTexture[];
+            /**
+             * BaseTexture value that shows that we don't know what is bound
+             * @member {PIXI.BaseTexture} PIXI.systems.TextureSystem#unknownTexture
+             * @readonly
+             */
+            readonly unknownTexture: PIXI.BaseTexture;
+            /**
+             * Sets up the renderer context and necessary buffers.
+             */
+            contextChange(): void;
+            /**
+             * Bind a texture to a specific location
+             *
+             * If you want to unbind something, please use `unbind(texture)` instead of `bind(null, textureLocation)`
+             *
+             * @param {PIXI.Texture|PIXI.BaseTexture} texture - Texture to bind
+             * @param {number} [location=0] - Location to bind at
+             */
+            bind(texture: PIXI.Texture | PIXI.BaseTexture, location?: number): void;
+            /**
+             * Resets texture location and bound textures
+             *
+             * Actual `bind(null, i)` calls will be performed at next `unbind()` call
+             */
+            reset(): void;
+            /**
+             * Unbind a texture
+             * @param {PIXI.Texture|PIXI.BaseTexture} texture - Texture to bind
+             */
+            unbind(texture: PIXI.Texture | PIXI.BaseTexture): void;
+            /**
+             * The renderer this manager works for.
+             *
+             * @member {PIXI.Renderer} PIXI.System#renderer
+             */
+            renderer: PIXI.Renderer;
+            /**
+             * Generic destroy methods to be overridden by the subclass
+             */
+            destroy(): void;
+        }
+    }
+    /**
+     * A Texture stores the information that represents an image.
+     * All textures have a base texture, which contains information about the source.
+     * Therefore you can have many textures all using a single BaseTexture
+     *
+     * @class
+     * @extends PIXI.utils.EventEmitter
+     * @memberof PIXI
+     * @param {PIXI.resources.Resource|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} [resource=null]
+     *        The current resource to use, for things that aren't Resource objects, will be converted
+     *        into a Resource.
+     * @param {Object} [options] - Collection of options
+     * @param {PIXI.MIPMAP_MODES} [options.mipmap=PIXI.settings.MIPMAP_TEXTURES] - If mipmapping is enabled for texture
+     * @param {PIXI.WRAP_MODES} [options.wrapMode=PIXI.settings.WRAP_MODE] - Wrap mode for textures
+     * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.settings.SCALE_MODE] - Default scale mode, linear, nearest
+     * @param {PIXI.FORMATS} [options.format=PIXI.FORMATS.RGBA] - GL format type
+     * @param {PIXI.TYPES} [options.type=PIXI.TYPES.UNSIGNED_BYTE] - GL data type
+     * @param {PIXI.TARGETS} [options.target=PIXI.TARGETS.TEXTURE_2D] - GL texture target
+     * @param {boolean} [options.premultiplyAlpha=true] - Pre multiply the image alpha
+     * @param {number} [options.width=0] - Width of the texture
+     * @param {number} [options.height=0] - Height of the texture
+     * @param {object} [options.resourceOptions] - Optional resource options,
+     *        see {@link PIXI.resources.autoDetectResource autoDetectResource}
+     */
+    class BaseTexture extends PIXI.utils.EventEmitter {
+        constructor(resource?: PIXI.resources.Resource | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, options?: {
+            mipmap?: PIXI.MIPMAP_MODES;
+            wrapMode?: PIXI.WRAP_MODES;
+            scaleMode?: PIXI.SCALE_MODES;
+            format?: PIXI.FORMATS;
+            type?: PIXI.TYPES;
+            target?: PIXI.TARGETS;
+            premultiplyAlpha?: boolean;
+            width?: number;
+            height?: number;
+            resourceOptions?: any;
+        });
+        /**
+         * @method loadSource
+         * @memberof PIXI.BaseTexture#
+         * @deprecated since 5.0.0
+         */
+        loadSource(): void;
+        /**
+         * @name PIXI.BaseTexture#hasLoaded
+         * @type {boolean}
+         * @deprecated since 5.0.0
+         * @readonly
+         * @see PIXI.BaseTexture#valid
+         */
+        readonly hasLoaded: boolean;
+        /**
+         * @name PIXI.BaseTexture#imageUrl
+         * @type {string}
+         * @deprecated since 5.0.0
+         * @readonly
+         * @see PIXI.resource.ImageResource#url
+         */
+        readonly imageUrl: string;
+        /**
+         * @method fromImage
+         * @static
+         * @memberof PIXI.BaseTexture
+         * @deprecated since 5.0.0
+         * @see PIXI.BaseTexture.from
+         */
+        static fromImage(): void;
+        /**
+         * @method fromCanvas
+         * @static
+         * @memberof PIXI.BaseTexture
+         * @deprecated since 5.0.0
+         * @see PIXI.BaseTexture.from
+         */
+        static fromCanvas(): void;
+        /**
+         * @method fromSVG
+         * @static
+         * @memberof PIXI.BaseTexture
+         * @deprecated since 5.0.0
+         * @see PIXI.BaseTexture.from
+         */
+        static fromSVG(): void;
+        /**
+         * Get the drawable source, such as HTMLCanvasElement or HTMLImageElement suitable
+         * for rendering with CanvasRenderer. Provided by **@pixi/canvas-renderer** package.
+         * @method getDrawableSource
+         * @memberof PIXI.BaseTexture#
+         * @return {PIXI.ICanvasImageSource} Source to render with CanvasRenderer
+         */
+        getDrawableSource(): PIXI.ICanvasImageSource;
+        /**
+         * The width of the base texture set when the image has loaded
+         *
+         * @readonly
+         * @member {number} PIXI.BaseTexture#width
+         */
+        readonly width: number;
+        /**
+         * The height of the base texture set when the image has loaded
+         *
+         * @readonly
+         * @member {number} PIXI.BaseTexture#height
+         */
+        readonly height: number;
+        /**
+         * The resolution / device pixel ratio of the texture
+         *
+         * @member {number} PIXI.BaseTexture#resolution
+         * @default PIXI.settings.RESOLUTION
+         */
+        resolution: number;
+        /**
+         * Mipmap mode of the texture, affects downscaled images
+         *
+         * @member {PIXI.MIPMAP_MODES} PIXI.BaseTexture#mipmap
+         * @default PIXI.settings.MIPMAP_TEXTURES
+         */
+        mipmap: PIXI.MIPMAP_MODES;
+        /**
+         * How the texture wraps
+         * @member {number} PIXI.BaseTexture#wrapMode
+         */
+        wrapMode: number;
+        /**
+         * The scale mode to apply when scaling this texture
+         *
+         * @member {PIXI.SCALE_MODES} PIXI.BaseTexture#scaleMode
+         * @default PIXI.settings.SCALE_MODE
+         */
+        scaleMode: PIXI.SCALE_MODES;
+        /**
+         * The pixel format of the texture
+         *
+         * @member {PIXI.FORMATS} PIXI.BaseTexture#format
+         * @default PIXI.FORMATS.RGBA
+         */
+        format: PIXI.FORMATS;
+        /**
+         * The type of resource data
+         *
+         * @member {PIXI.TYPES} PIXI.BaseTexture#type
+         * @default PIXI.TYPES.UNSIGNED_BYTE
+         */
+        type: PIXI.TYPES;
+        /**
+         * The target type
+         *
+         * @member {PIXI.TARGETS} PIXI.BaseTexture#target
+         * @default PIXI.TARGETS.TEXTURE_2D
+         */
+        target: PIXI.TARGETS;
+        /**
+         * Set to true to enable pre-multiplied alpha
+         *
+         * @member {boolean} PIXI.BaseTexture#premultiplyAlpha
+         * @default true
+         */
+        premultiplyAlpha: boolean;
+        /**
+         * Global unique identifier for this BaseTexture
+         *
+         * @member {string} PIXI.BaseTexture#uid
+         * @protected
+         */
+        protected uid: string;
+        /**
+         * Used by automatic texture Garbage Collection, stores last GC tick when it was bound
+         *
+         * @member {number} PIXI.BaseTexture#touched
+         * @protected
+         */
+        protected touched: number;
+        /**
+         * Whether or not the texture is a power of two, try to use power of two textures as much
+         * as you can
+         *
+         * @readonly
+         * @member {boolean} PIXI.BaseTexture#isPowerOfTwo
+         * @default false
+         */
+        readonly isPowerOfTwo: boolean;
+        /**
+         * Used by TextureSystem to only update texture to the GPU when needed.
+         *
+         * @protected
+         * @member {number} PIXI.BaseTexture#dirtyId
+         */
+        protected dirtyId: number;
+        /**
+         * Used by TextureSystem to only update texture style when needed.
+         *
+         * @protected
+         * @member {number} PIXI.BaseTexture#dirtyStyleId
+         */
+        protected dirtyStyleId: number;
+        /**
+         * Currently default cache ID.
+         *
+         * @member {string} PIXI.BaseTexture#cacheId
+         */
+        cacheId: string;
+        /**
+         * Generally speaking means when resource is loaded.
+         * @readonly
+         * @member {boolean} PIXI.BaseTexture#valid
+         */
+        readonly valid: boolean;
+        /**
+         * The collection of alternative cache ids, since some BaseTextures
+         * can have more than one ID, short name and longer full URL
+         *
+         * @member {Array} PIXI.BaseTexture#textureCacheIds
+         * @readonly
+         */
+        readonly textureCacheIds: string[];
+        /**
+         * Flag if BaseTexture has been destroyed.
+         *
+         * @member {boolean} PIXI.BaseTexture#destroyed
+         * @readonly
+         */
+        readonly destroyed: boolean;
+        /**
+         * The resource used by this BaseTexture, there can only
+         * be one resource per BaseTexture, but textures can share
+         * resources.
+         *
+         * @member {PIXI.resources.Resource} PIXI.BaseTexture#resource
+         * @readonly
+         */
+        readonly resource: PIXI.resources.Resource;
+        /**
+         * Number of the texture batch, used by multi-texture renderers
+         *
+         * @member {number} PIXI.BaseTexture#_batchEnabled
+         */
+        _batchEnabled: number;
+        /**
+         * Pixel width of the source of this texture
+         *
+         * @readonly
+         * @member {number}
+         */
+        readonly realWidth: number;
+        /**
+         * Pixel height of the source of this texture
+         *
+         * @readonly
+         * @member {number}
+         */
+        readonly realHeight: number;
+        /**
+         * Changes style options of BaseTexture
+         *
+         * @param {PIXI.SCALE_MODES} [scaleMode] - Pixi scalemode
+         * @param {PIXI.MIPMAP_MODES} [mipmap] - enable mipmaps
+         * @returns {BaseTexture} this
+         */
+        setStyle(scaleMode?: PIXI.SCALE_MODES, mipmap?: PIXI.MIPMAP_MODES): BaseTexture;
+        /**
+         * Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.
+         *
+         * @param {number} width Visual width
+         * @param {number} height Visual height
+         * @param {number} [resolution] Optionally set resolution
+         * @returns {BaseTexture} this
+         */
+        setSize(width: number, height: number, resolution?: number): BaseTexture;
+        /**
+         * Sets real size of baseTexture, preserves current resolution.
+         *
+         * @param {number} realWidth Full rendered width
+         * @param {number} realHeight Full rendered height
+         * @param {number} [resolution] Optionally set resolution
+         * @returns {BaseTexture} this
+         */
+        setRealSize(realWidth: number, realHeight: number, resolution?: number): BaseTexture;
+        /**
+         * Changes resolution
+         *
+         * @param {number} [resolution] res
+         * @returns {BaseTexture} this
+         */
+        setResolution(resolution?: number): BaseTexture;
+        /**
+         * Sets the resource if it wasn't set. Throws error if resource already present
+         *
+         * @param {PIXI.resources.Resource} resource - that is managing this BaseTexture
+         * @returns {BaseTexture} this
+         */
+        setResource(resource: PIXI.resources.Resource): BaseTexture;
+        /**
+         * Invalidates the object. Texture becomes valid if width and height are greater than zero.
+         */
+        update(): void;
+        /**
+         * Destroys this base texture.
+         * The method stops if resource doesn't want this texture to be destroyed.
+         * Removes texture from all caches.
+         */
+        destroy(): void;
+        /**
+         * Frees the texture from WebGL memory without destroying this texture object.
+         * This means you can still use the texture later which will upload it to GPU
+         * memory again.
+         *
+         * @fires PIXI.BaseTexture#dispose
+         */
+        dispose(): void;
+        /**
+         * Helper function that creates a base texture based on the source you provide.
+         * The source can be - image url, image element, canvas element. If the
+         * source is an image url or an image element and not in the base texture
+         * cache, it will be created and loaded.
+         *
+         * @static
+         * @param {string|HTMLImageElement|HTMLCanvasElement|SVGElement|HTMLVideoElement} source - The
+         *        source to create base texture from.
+         * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options.
+         * @returns {PIXI.BaseTexture} The new base texture.
+         */
+        static from(source: string | HTMLImageElement | HTMLCanvasElement | SVGElement | HTMLVideoElement, options?: any): PIXI.BaseTexture;
+        /**
+         * Create a new BaseTexture with a BufferResource from a Float32Array.
+         * RGBA values are floats from 0 to 1.
+         * @static
+         * @param {Float32Array|Uint8Array} buffer The optional array to use, if no data
+         *        is provided, a new Float32Array is created.
+         * @param {number} width - Width of the resource
+         * @param {number} height - Height of the resource
+         * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options.
+         * @return {PIXI.BaseTexture} The resulting new BaseTexture
+         */
+        static fromBuffer(buffer: Float32Array | Uint8Array, width: number, height: number, options?: any): PIXI.BaseTexture;
+        /**
+         * Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.
+         *
+         * @static
+         * @param {PIXI.BaseTexture} baseTexture - The BaseTexture to add to the cache.
+         * @param {string} id - The id that the BaseTexture will be stored against.
+         */
+        static addToCache(baseTexture: PIXI.BaseTexture, id: string): void;
+        /**
+         * Remove a BaseTexture from the global BaseTextureCache.
+         *
+         * @static
+         * @param {string|PIXI.BaseTexture} baseTexture - id of a BaseTexture to be removed, or a BaseTexture instance itself.
+         * @return {PIXI.BaseTexture|null} The BaseTexture that was removed.
+         */
+        static removeFromCache(baseTexture: string | PIXI.BaseTexture): PIXI.BaseTexture | null;
+        /**
+         * Global number of the texture batch, used by multi-texture renderers
+         *
+         * @static
+         * @member {number}
+         */
+        static _globalBatch: number;
+    }
+    /**
+     * A Texture that depends on six other resources.
+     *
+     * @class
+     * @extends PIXI.BaseTexture
+     * @memberof PIXI
+     */
+    class CubeTexture extends PIXI.BaseTexture {
+        static from(resources: string|HTMLImageElement|HTMLCanvasElement|SVGElement|HTMLVideoElement, options?: any): BaseTexture;
+        /**
+         * Generate a new CubeTexture.
+         * @static
+         * @param {string[]|PIXI.resources.Resource[]} resources - Collection of 6 URLs or resources
+         * @param {object} [options] - Optional options passed to the resources being loaded.
+         *        See {@PIXI.resources.autoDetectResource autoDetectResource} for more info
+         *        on the options available to each resource.
+         * @returns {PIXI.CubeTexture} new cube texture
+         */
+        static from(resources: string[] | PIXI.resources.Resource[], options?: any): PIXI.CubeTexture;
+        /**
+         * @method loadSource
+         * @memberof PIXI.BaseTexture#
+         * @deprecated since 5.0.0
+         */
+        loadSource(): void;
+        /**
+         * @name PIXI.BaseTexture#hasLoaded
+         * @type {boolean}
+         * @deprecated since 5.0.0
+         * @readonly
+         * @see PIXI.BaseTexture#valid
+         */
+        readonly hasLoaded: boolean;
+        /**
+         * @name PIXI.BaseTexture#imageUrl
+         * @type {string}
+         * @deprecated since 5.0.0
+         * @readonly
+         * @see PIXI.resource.ImageResource#url
+         */
+        readonly imageUrl: string;
+        /**
+         * Get the drawable source, such as HTMLCanvasElement or HTMLImageElement suitable
+         * for rendering with CanvasRenderer. Provided by **@pixi/canvas-renderer** package.
+         * @method getDrawableSource
+         * @memberof PIXI.BaseTexture#
+         * @return {PIXI.ICanvasImageSource} Source to render with CanvasRenderer
+         */
+        getDrawableSource(): PIXI.ICanvasImageSource;
+        /**
+         * The width of the base texture set when the image has loaded
+         *
+         * @readonly
+         * @member {number} PIXI.BaseTexture#width
+         */
+        readonly width: number;
+        /**
+         * The height of the base texture set when the image has loaded
+         *
+         * @readonly
+         * @member {number} PIXI.BaseTexture#height
+         */
+        readonly height: number;
+        /**
+         * The resolution / device pixel ratio of the texture
+         *
+         * @member {number} PIXI.BaseTexture#resolution
+         * @default PIXI.settings.RESOLUTION
+         */
+        resolution: number;
+        /**
+         * Mipmap mode of the texture, affects downscaled images
+         *
+         * @member {PIXI.MIPMAP_MODES} PIXI.BaseTexture#mipmap
+         * @default PIXI.settings.MIPMAP_TEXTURES
+         */
+        mipmap: PIXI.MIPMAP_MODES;
+        /**
+         * How the texture wraps
+         * @member {number} PIXI.BaseTexture#wrapMode
+         */
+        wrapMode: number;
+        /**
+         * The scale mode to apply when scaling this texture
+         *
+         * @member {PIXI.SCALE_MODES} PIXI.BaseTexture#scaleMode
+         * @default PIXI.settings.SCALE_MODE
+         */
+        scaleMode: PIXI.SCALE_MODES;
+        /**
+         * The pixel format of the texture
+         *
+         * @member {PIXI.FORMATS} PIXI.BaseTexture#format
+         * @default PIXI.FORMATS.RGBA
+         */
+        format: PIXI.FORMATS;
+        /**
+         * The type of resource data
+         *
+         * @member {PIXI.TYPES} PIXI.BaseTexture#type
+         * @default PIXI.TYPES.UNSIGNED_BYTE
+         */
+        type: PIXI.TYPES;
+        /**
+         * The target type
+         *
+         * @member {PIXI.TARGETS} PIXI.BaseTexture#target
+         * @default PIXI.TARGETS.TEXTURE_2D
+         */
+        target: PIXI.TARGETS;
+        /**
+         * Set to true to enable pre-multiplied alpha
+         *
+         * @member {boolean} PIXI.BaseTexture#premultiplyAlpha
+         * @default true
+         */
+        premultiplyAlpha: boolean;
+        /**
+         * Global unique identifier for this BaseTexture
+         *
+         * @member {string} PIXI.BaseTexture#uid
+         * @protected
+         */
+        protected uid: string;
+        /**
+         * Used by automatic texture Garbage Collection, stores last GC tick when it was bound
+         *
+         * @member {number} PIXI.BaseTexture#touched
+         * @protected
+         */
+        protected touched: number;
+        /**
+         * Whether or not the texture is a power of two, try to use power of two textures as much
+         * as you can
+         *
+         * @readonly
+         * @member {boolean} PIXI.BaseTexture#isPowerOfTwo
+         * @default false
+         */
+        readonly isPowerOfTwo: boolean;
+        /**
+         * Used by TextureSystem to only update texture to the GPU when needed.
+         *
+         * @protected
+         * @member {number} PIXI.BaseTexture#dirtyId
+         */
+        protected dirtyId: number;
+        /**
+         * Used by TextureSystem to only update texture style when needed.
+         *
+         * @protected
+         * @member {number} PIXI.BaseTexture#dirtyStyleId
+         */
+        protected dirtyStyleId: number;
+        /**
+         * Currently default cache ID.
+         *
+         * @member {string} PIXI.BaseTexture#cacheId
+         */
+        cacheId: string;
+        /**
+         * Generally speaking means when resource is loaded.
+         * @readonly
+         * @member {boolean} PIXI.BaseTexture#valid
+         */
+        readonly valid: boolean;
+        /**
+         * The collection of alternative cache ids, since some BaseTextures
+         * can have more than one ID, short name and longer full URL
+         *
+         * @member {Array} PIXI.BaseTexture#textureCacheIds
+         * @readonly
+         */
+        readonly textureCacheIds: string[];
+        /**
+         * Flag if BaseTexture has been destroyed.
+         *
+         * @member {boolean} PIXI.BaseTexture#destroyed
+         * @readonly
+         */
+        readonly destroyed: boolean;
+        /**
+         * The resource used by this BaseTexture, there can only
+         * be one resource per BaseTexture, but textures can share
+         * resources.
+         *
+         * @member {PIXI.resources.Resource} PIXI.BaseTexture#resource
+         * @readonly
+         */
+        readonly resource: PIXI.resources.Resource;
+        /**
+         * Number of the texture batch, used by multi-texture renderers
+         *
+         * @member {number} PIXI.BaseTexture#_batchEnabled
+         */
+        _batchEnabled: number;
+        /**
+         * Pixel width of the source of this texture
+         *
+         * @readonly
+         * @member {number}
+         */
+        readonly realWidth: number;
+        /**
+         * Pixel height of the source of this texture
+         *
+         * @readonly
+         * @member {number}
+         */
+        readonly realHeight: number;
+        /**
+         * Changes style options of BaseTexture
+         *
+         * @param {PIXI.SCALE_MODES} [scaleMode] - Pixi scalemode
+         * @param {PIXI.MIPMAP_MODES} [mipmap] - enable mipmaps
+         * @returns {BaseTexture} this
+         */
+        setStyle(scaleMode?: PIXI.SCALE_MODES, mipmap?: PIXI.MIPMAP_MODES): BaseTexture;
+        /**
+         * Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.
+         *
+         * @param {number} width Visual width
+         * @param {number} height Visual height
+         * @param {number} [resolution] Optionally set resolution
+         * @returns {BaseTexture} this
+         */
+        setSize(width: number, height: number, resolution?: number): BaseTexture;
+        /**
+         * Sets real size of baseTexture, preserves current resolution.
+         *
+         * @param {number} realWidth Full rendered width
+         * @param {number} realHeight Full rendered height
+         * @param {number} [resolution] Optionally set resolution
+         * @returns {BaseTexture} this
+         */
+        setRealSize(realWidth: number, realHeight: number, resolution?: number): BaseTexture;
+        /**
+         * Changes resolution
+         *
+         * @param {number} [resolution] res
+         * @returns {BaseTexture} this
+         */
+        setResolution(resolution?: number): BaseTexture;
+        /**
+         * Sets the resource if it wasn't set. Throws error if resource already present
+         *
+         * @param {PIXI.resources.Resource} resource - that is managing this BaseTexture
+         * @returns {BaseTexture} this
+         */
+        setResource(resource: PIXI.resources.Resource): BaseTexture;
+        /**
+         * Invalidates the object. Texture becomes valid if width and height are greater than zero.
+         */
+        update(): void;
+        /**
+         * Destroys this base texture.
+         * The method stops if resource doesn't want this texture to be destroyed.
+         * Removes texture from all caches.
+         */
+        destroy(): void;
+        /**
+         * Frees the texture from WebGL memory without destroying this texture object.
+         * This means you can still use the texture later which will upload it to GPU
+         * memory again.
+         *
+         * @fires PIXI.BaseTexture#dispose
+         */
+        dispose(): void;
+    }
+    /**
+     * Internal texture for WebGL context
+     * @class
+     * @memberof PIXI
+     */
+    class GLTexture {
+        constructor();
+        /**
+         * The WebGL texture
+         * @member {WebGLTexture} PIXI.GLTexture#texture
+         */
+        texture: WebGLTexture;
+        /**
+         * Texture contents dirty flag
+         * @member {number} PIXI.GLTexture#dirtyId
+         */
+        dirtyId: number;
+        /**
+         * Texture style dirty flag
+         * @member {number} PIXI.GLTexture#dirtyStyleId
+         */
+        dirtyStyleId: number;
+        /**
+         * Whether mip levels has to be generated
+         * @member {boolean} PIXI.GLTexture#mipmap
+         */
+        mipmap: boolean;
+        /**
+         * WrapMode copied from baseTexture
+         * @member {number} PIXI.GLTexture#wrapMode
+         */
+        wrapMode: number;
+    }
+    /**
+     * Collection of base resource types supported by PixiJS.
+     *
+     * Resources are used by {@link PIXI.BaseTexture} to handle different media types
+     * such as images, video, SVG graphics, etc. In most use-cases, you should not
+     * instantiate the resources directly. The easy thing is to use
+     * {@link PIXI.BaseTexture.from}.
+     * @example
+     * const baseTexture = PIXI.BaseTexture.from('path/to/image.jpg');
+     * @namespace PIXI.resources
+     */
+    namespace resources {
+        /**
+         * A resource that contains a number of sources.
+         *
+         * @class
+         * @extends PIXI.resources.Resource
+         * @memberof PIXI.resources
+         * @param {number|Array<*>} source - Number of items in array or the collection
+         *        of image URLs to use. Can also be resources, image elements, canvas, etc.
+         * @param {object} [options] Options to apply to {@link PIXI.resources.autoDetectResource}
+         * @param {number} [options.width] - Width of the resource
+         * @param {number} [options.height] - Height of the resource
+         */
+        class ArrayResource extends PIXI.resources.Resource {
+            constructor(source: number | any[], options?: {
+                width?: number;
+                height?: number;
+            });
+            /**
+             * Collection of resources.
+             * @member {Array} PIXI.resources.ArrayResource#items
+             * @readonly
+             */
+            readonly items: PIXI.BaseTexture[];
+            /**
+             * Dirty IDs for each part
+             * @member {Array} PIXI.resources.ArrayResource#itemDirtyIds
+             * @readonly
+             */
+            readonly itemDirtyIds: number[];
+            /**
+             * Number of elements in array
+             *
+             * @member {number} PIXI.resources.ArrayResource#length
+             * @readonly
+             */
+            readonly length: number;
+            /**
+             * Set a resource by ID
+             *
+             * @param {PIXI.resources.Resource} resource
+             * @param {number} index - Zero-based index of resource to set
+             * @return {PIXI.resources.ArrayResource} Instance for chaining
+             */
+            addResourceAt(resource: PIXI.resources.Resource, index: number): PIXI.resources.ArrayResource;
+            /**
+             * Upload the resources to the GPU.
+             * @param {PIXI.Renderer} renderer
+             * @param {PIXI.BaseTexture} texture
+             * @param {PIXI.GLTexture} glTexture
+             * @returns {boolean} whether texture was uploaded
+             */
+            upload(renderer: PIXI.Renderer, texture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Internal width of the resource
+             * @member {number} PIXI.resources.Resource#_width
+             * @protected
+             */
+            protected _width: number;
+            /**
+             * Internal height of the resource
+             * @member {number} PIXI.resources.Resource#_height
+             * @protected
+             */
+            protected _height: number;
+            /**
+             * If resource has been destroyed
+             * @member {boolean} PIXI.resources.Resource#destroyed
+             * @readonly
+             * @default false
+             */
+            readonly destroyed: boolean;
+            /**
+             * `true` if resource is created by BaseTexture
+             * useful for doing cleanup with BaseTexture destroy
+             * and not cleaning up resources that were created
+             * externally.
+             * @member {boolean} PIXI.resources.Resource#internal
+             * @protected
+             */
+            protected internal: boolean;
+            /**
+             * Bind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            bind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Unbind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            unbind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Trigger a resize event
+             */
+            resize(): void;
+            /**
+             * Has been validated
+             * @readonly
+             * @member {boolean}
+             */
+            readonly valid: boolean;
+            /**
+             * Has been updated trigger event
+             */
+            update(): void;
+            /**
+             * This can be overridden to start preloading a resource
+             * or do any other prepare step.
+             * @protected
+             * @return {Promise} Handle the validate event
+             */
+            protected load(): Promise;
+            /**
+             * The width of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly width: number;
+            /**
+             * The height of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly height: number;
+            /**
+             * Set the style, optional to override
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} `true` is success
+             */
+            style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Clean up anything, this happens when destroying is ready.
+             *
+             * @protected
+             */
+            protected dispose(): void;
+            /**
+             * Call when destroying resource, unbind any BaseTexture object
+             * before calling this method, as reference counts are maintained
+             * internally.
+             */
+            destroy(): void;
+        }
+        /**
+         * Collection of installed resource types, class must extend {@link PIXI.resources.Resource}.
+         * @example
+         * class CustomResource extends PIXI.resources.Resource {
+         *   // MUST have source, options constructor signature
+         *   // for auto-detected resources to be created.
+         *   constructor(source, options) {
+         *     super();
+         *   }
+         *   upload(renderer, baseTexture, glTexture) {
+         *     // upload with GL
+         *     return true;
+         *   }
+         *   // used to auto-detect resource
+         *   static test(source, extension) {
+         *     return extension === 'xyz'|| source instanceof SomeClass;
+         *   }
+         * }
+         * // Install the new resource type
+         * PIXI.resources.INSTALLED.push(CustomResource);
+         *
+         * @name PIXI.resources.INSTALLED
+         * @type {Array<*>}
+         * @static
+         * @readonly
+         */
+        var INSTALLED: any[];
+        /**
+         * Create a resource element from a single source element. This
+         * auto-detects which type of resource to create. All resources that
+         * are auto-detectable must have a static `test` method and a constructor
+         * with the arguments `(source, options?)`. Currently, the supported
+         * resources for auto-detection include:
+         *  - {@link PIXI.resources.ImageResource}
+         *  - {@link PIXI.resources.CanvasResource}
+         *  - {@link PIXI.resources.VideoResource}
+         *  - {@link PIXI.resources.SVGResource}
+         *  - {@link PIXI.resources.BufferResource}
+         * @static
+         * @function PIXI.resources.autoDetectResource
+         * @param {string|*} source - Resource source, this can be the URL to the resource,
+         *        a typed-array (for BufferResource), HTMLVideoElement, SVG data-uri
+         *        or any other resource that can be auto-detected. If not resource is
+         *        detected, it's assumed to be an ImageResource.
+         * @param {object} [options] - Pass-through options to use for Resource
+         * @param {number} [options.width] - BufferResource's width
+         * @param {number} [options.height] - BufferResource's height
+         * @param {boolean} [options.autoLoad=true] - Image, SVG and Video flag to start loading
+         * @param {number} [options.scale=1] - SVG source scale
+         * @param {boolean} [options.createBitmap=true] - Image option to create Bitmap object
+         * @param {boolean} [options.crossorigin=true] - Image and Video option to set crossOrigin
+         * @param {boolean} [options.autoPlay=true] - Video option to start playing video immediately
+         * @param {number} [options.updateFPS=0] - Video option to update how many times a second the
+         *        texture should be updated from the video. Leave at 0 to update at every render
+         * @return {PIXI.resources.Resource} The created resource.
+         */
+        function autoDetectResource(source: string | any, options?: {
+            width?: number;
+            height?: number;
+            autoLoad?: boolean;
+            scale?: number;
+            createBitmap?: boolean;
+            crossorigin?: boolean;
+            autoPlay?: boolean;
+            updateFPS?: number;
+        }): PIXI.resources.Resource;
+        /**
+         * Base for all the image/canvas resources
+         * @class
+         * @extends PIXI.resources.Resource
+         * @memberof PIXI.resources
+         */
+        class BaseImageResource extends PIXI.resources.Resource {
+            constructor(source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement);
+            /**
+             * The source element
+             * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
+             * @readonly
+             */
+            readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
+            /**
+             * Set cross origin based detecting the url and the crossorigin
+             * @protected
+             * @param {HTMLElement} element - Element to apply crossOrigin
+             * @param {string} url - URL to check
+             * @param {boolean|string} [crossorigin=true] - Cross origin value to use
+             */
+            protected static crossOrigin(element: HTMLElement, url: string, crossorigin?: boolean | string): void;
+            /**
+             * Upload the texture to the GPU.
+             * @param {PIXI.Renderer} renderer Upload to the renderer
+             * @param {PIXI.BaseTexture} baseTexture Reference to parent texture
+             * @param {PIXI.GLTexture} glTexture
+             * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] (optional)
+             * @returns {boolean} true is success
+             */
+            upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement): boolean;
+            /**
+             * Internal width of the resource
+             * @member {number} PIXI.resources.Resource#_width
+             * @protected
+             */
+            protected _width: number;
+            /**
+             * Internal height of the resource
+             * @member {number} PIXI.resources.Resource#_height
+             * @protected
+             */
+            protected _height: number;
+            /**
+             * If resource has been destroyed
+             * @member {boolean} PIXI.resources.Resource#destroyed
+             * @readonly
+             * @default false
+             */
+            readonly destroyed: boolean;
+            /**
+             * `true` if resource is created by BaseTexture
+             * useful for doing cleanup with BaseTexture destroy
+             * and not cleaning up resources that were created
+             * externally.
+             * @member {boolean} PIXI.resources.Resource#internal
+             * @protected
+             */
+            protected internal: boolean;
+            /**
+             * Bind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            bind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Unbind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            unbind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Trigger a resize event
+             */
+            resize(): void;
+            /**
+             * Has been validated
+             * @readonly
+             * @member {boolean}
+             */
+            readonly valid: boolean;
+            /**
+             * Has been updated trigger event
+             */
+            update(): void;
+            /**
+             * This can be overridden to start preloading a resource
+             * or do any other prepare step.
+             * @protected
+             * @return {Promise} Handle the validate event
+             */
+            protected load(): Promise;
+            /**
+             * The width of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly width: number;
+            /**
+             * The height of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly height: number;
+            /**
+             * Set the style, optional to override
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} `true` is success
+             */
+            style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Clean up anything, this happens when destroying is ready.
+             *
+             * @protected
+             */
+            protected dispose(): void;
+            /**
+             * Call when destroying resource, unbind any BaseTexture object
+             * before calling this method, as reference counts are maintained
+             * internally.
+             */
+            destroy(): void;
+        }
+        /**
+         * Buffer resource with data of typed array.
+         * @class
+         * @extends PIXI.resources.Resource
+         * @memberof PIXI.resources
+         */
+        class BufferResource extends PIXI.resources.Resource {
+            constructor(source: Float32Array | Uint8Array | Uint32Array, options: {
+                width: number;
+                height: number;
+            });
+            /**
+             * Source array
+             * Cannot be ClampedUint8Array because it cant be uploaded to WebGL
+             *
+             * @member {Float32Array|Uint8Array|Uint32Array} PIXI.resources.BufferResource#data
+             */
+            data: Float32Array | Uint8Array | Uint32Array;
+            /**
+             * Upload the texture to the GPU.
+             * @param {PIXI.Renderer} renderer Upload to the renderer
+             * @param {PIXI.BaseTexture} baseTexture Reference to parent texture
+             * @param {PIXI.GLTexture} glTexture glTexture
+             * @returns {boolean} true is success
+             */
+            upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Used to auto-detect the type of resource.
+             *
+             * @static
+             * @param {*} source - The source object
+             * @return {boolean} `true` if 
+             */
+            static test(source: any): boolean;
+            /**
+             * Internal width of the resource
+             * @member {number} PIXI.resources.Resource#_width
+             * @protected
+             */
+            protected _width: number;
+            /**
+             * Internal height of the resource
+             * @member {number} PIXI.resources.Resource#_height
+             * @protected
+             */
+            protected _height: number;
+            /**
+             * If resource has been destroyed
+             * @member {boolean} PIXI.resources.Resource#destroyed
+             * @readonly
+             * @default false
+             */
+            readonly destroyed: boolean;
+            /**
+             * `true` if resource is created by BaseTexture
+             * useful for doing cleanup with BaseTexture destroy
+             * and not cleaning up resources that were created
+             * externally.
+             * @member {boolean} PIXI.resources.Resource#internal
+             * @protected
+             */
+            protected internal: boolean;
+            /**
+             * Bind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            bind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Unbind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            unbind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Trigger a resize event
+             */
+            resize(): void;
+            /**
+             * Has been validated
+             * @readonly
+             * @member {boolean}
+             */
+            readonly valid: boolean;
+            /**
+             * Has been updated trigger event
+             */
+            update(): void;
+            /**
+             * This can be overridden to start preloading a resource
+             * or do any other prepare step.
+             * @protected
+             * @return {Promise} Handle the validate event
+             */
+            protected load(): Promise;
+            /**
+             * The width of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly width: number;
+            /**
+             * The height of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly height: number;
+            /**
+             * Set the style, optional to override
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} `true` is success
+             */
+            style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Clean up anything, this happens when destroying is ready.
+             *
+             * @protected
+             */
+            protected dispose(): void;
+            /**
+             * Call when destroying resource, unbind any BaseTexture object
+             * before calling this method, as reference counts are maintained
+             * internally.
+             */
+            destroy(): void;
+        }
+        /**
+         * Resource type for HTMLCanvasElement.
+         * @class
+         * @extends PIXI.resources.BaseImageResource
+         * @memberof PIXI.resources
+         * @param {HTMLCanvasElement} source - Canvas element to use
+         */
+        class CanvasResource extends PIXI.resources.BaseImageResource {
+            constructor(source: HTMLCanvasElement);
+            /**
+             * Used to auto-detect the type of resource.
+             *
+             * @static
+             * @param {*} source - The source object
+             * @return {boolean} `true` if 
+             */
+            static test(source: any): boolean;
+            /**
+             * The source element
+             * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
+             * @readonly
+             */
+            readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
+            /**
+             * Upload the texture to the GPU.
+             * @param {PIXI.Renderer} renderer Upload to the renderer
+             * @param {PIXI.BaseTexture} baseTexture Reference to parent texture
+             * @param {PIXI.GLTexture} glTexture
+             * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] (optional)
+             * @returns {boolean} true is success
+             */
+            upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement): boolean;
+            /**
+             * Clean up anything, this happens when destroying is ready.
+             *
+             * @protected
+             */
+            protected dispose(): void;
+            /**
+             * Internal width of the resource
+             * @member {number} PIXI.resources.Resource#_width
+             * @protected
+             */
+            protected _width: number;
+            /**
+             * Internal height of the resource
+             * @member {number} PIXI.resources.Resource#_height
+             * @protected
+             */
+            protected _height: number;
+            /**
+             * If resource has been destroyed
+             * @member {boolean} PIXI.resources.Resource#destroyed
+             * @readonly
+             * @default false
+             */
+            readonly destroyed: boolean;
+            /**
+             * `true` if resource is created by BaseTexture
+             * useful for doing cleanup with BaseTexture destroy
+             * and not cleaning up resources that were created
+             * externally.
+             * @member {boolean} PIXI.resources.Resource#internal
+             * @protected
+             */
+            protected internal: boolean;
+            /**
+             * Bind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            bind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Unbind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            unbind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Trigger a resize event
+             */
+            resize(): void;
+            /**
+             * Has been validated
+             * @readonly
+             * @member {boolean}
+             */
+            readonly valid: boolean;
+            /**
+             * Has been updated trigger event
+             */
+            update(): void;
+            /**
+             * This can be overridden to start preloading a resource
+             * or do any other prepare step.
+             * @protected
+             * @return {Promise} Handle the validate event
+             */
+            protected load(): Promise;
+            /**
+             * The width of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly width: number;
+            /**
+             * The height of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly height: number;
+            /**
+             * Set the style, optional to override
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} `true` is success
+             */
+            style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Call when destroying resource, unbind any BaseTexture object
+             * before calling this method, as reference counts are maintained
+             * internally.
+             */
+            destroy(): void;
+        }
+        /**
+         * Resource for a CubeTexture which contains six resources.
+         *
+         * @class
+         * @extends PIXI.resources.ArrayResource
+         * @memberof PIXI.resources
+         * @param {Array} [source] Collection of URLs or resources
+         *        to use as the sides of the cube.
+         * @param {object} [options] - ImageResource options
+         * @param {number} [options.width] - Width of resource
+         * @param {number} [options.height] - Height of resource
+         */
+        class CubeResource extends PIXI.resources.ArrayResource {
+            constructor(source?: (string | PIXI.resources.Resource)[], options?: {
+                width?: number;
+                height?: number;
+            });
+            /**
+             * Upload the resource
+             *
+             * @returns {boolean} true is success
+             */
+            upload(): boolean;
+            /**
+             * Number of texture sides to store for CubeResources
+             *
+             * @name PIXI.resources.CubeResource.SIDES
+             * @static
+             * @member {number}
+             * @default 6
+             */
+            static SIDES: number;
+            /**
+             * Collection of resources.
+             * @member {Array} PIXI.resources.ArrayResource#items
+             * @readonly
+             */
+            readonly items: PIXI.BaseTexture[];
+            /**
+             * Dirty IDs for each part
+             * @member {Array} PIXI.resources.ArrayResource#itemDirtyIds
+             * @readonly
+             */
+            readonly itemDirtyIds: number[];
+            /**
+             * Number of elements in array
+             *
+             * @member {number} PIXI.resources.ArrayResource#length
+             * @readonly
+             */
+            readonly length: number;
+            /**
+             * Clean up anything, this happens when destroying is ready.
+             *
+             * @protected
+             */
+            protected dispose(): void;
+            /**
+             * Set a resource by ID
+             *
+             * @param {PIXI.resources.Resource} resource
+             * @param {number} index - Zero-based index of resource to set
+             * @return {PIXI.resources.ArrayResource} Instance for chaining
+             */
+            addResourceAt(resource: PIXI.resources.Resource, index: number): PIXI.resources.ArrayResource;
+            /**
+             * Bind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            bind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Unbind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            unbind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * This can be overridden to start preloading a resource
+             * or do any other prepare step.
+             * @protected
+             * @return {Promise} Handle the validate event
+             */
+            protected load(): Promise;
+            /**
+             * Internal width of the resource
+             * @member {number} PIXI.resources.Resource#_width
+             * @protected
+             */
+            protected _width: number;
+            /**
+             * Internal height of the resource
+             * @member {number} PIXI.resources.Resource#_height
+             * @protected
+             */
+            protected _height: number;
+            /**
+             * If resource has been destroyed
+             * @member {boolean} PIXI.resources.Resource#destroyed
+             * @readonly
+             * @default false
+             */
+            readonly destroyed: boolean;
+            /**
+             * `true` if resource is created by BaseTexture
+             * useful for doing cleanup with BaseTexture destroy
+             * and not cleaning up resources that were created
+             * externally.
+             * @member {boolean} PIXI.resources.Resource#internal
+             * @protected
+             */
+            protected internal: boolean;
+            /**
+             * Trigger a resize event
+             */
+            resize(): void;
+            /**
+             * Has been validated
+             * @readonly
+             * @member {boolean}
+             */
+            readonly valid: boolean;
+            /**
+             * Has been updated trigger event
+             */
+            update(): void;
+            /**
+             * The width of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly width: number;
+            /**
+             * The height of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly height: number;
+            /**
+             * Set the style, optional to override
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} `true` is success
+             */
+            style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Call when destroying resource, unbind any BaseTexture object
+             * before calling this method, as reference counts are maintained
+             * internally.
+             */
+            destroy(): void;
+        }
+        /**
+         * Resource type for DepthTexture.
+         * @class
+         * @extends PIXI.resources.BufferResource
+         * @memberof PIXI.resources
+         */
+        class DepthResource extends PIXI.resources.BufferResource {
+            /**
+             * Upload the texture to the GPU.
+             * @param {PIXI.Renderer} renderer Upload to the renderer
+             * @param {PIXI.BaseTexture} baseTexture Reference to parent texture
+             * @param {PIXI.GLTexture} glTexture glTexture
+             * @returns {boolean} true is success
+             */
+            upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Source array
+             * Cannot be ClampedUint8Array because it cant be uploaded to WebGL
+             *
+             * @member {Float32Array|Uint8Array|Uint32Array} PIXI.resources.BufferResource#data
+             */
+            data: Float32Array | Uint8Array | Uint32Array;
+            /**
+             * Clean up anything, this happens when destroying is ready.
+             *
+             * @protected
+             */
+            protected dispose(): void;
+            /**
+             * Internal width of the resource
+             * @member {number} PIXI.resources.Resource#_width
+             * @protected
+             */
+            protected _width: number;
+            /**
+             * Internal height of the resource
+             * @member {number} PIXI.resources.Resource#_height
+             * @protected
+             */
+            protected _height: number;
+            /**
+             * If resource has been destroyed
+             * @member {boolean} PIXI.resources.Resource#destroyed
+             * @readonly
+             * @default false
+             */
+            readonly destroyed: boolean;
+            /**
+             * `true` if resource is created by BaseTexture
+             * useful for doing cleanup with BaseTexture destroy
+             * and not cleaning up resources that were created
+             * externally.
+             * @member {boolean} PIXI.resources.Resource#internal
+             * @protected
+             */
+            protected internal: boolean;
+            /**
+             * Bind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            bind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Unbind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            unbind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Trigger a resize event
+             */
+            resize(): void;
+            /**
+             * Has been validated
+             * @readonly
+             * @member {boolean}
+             */
+            readonly valid: boolean;
+            /**
+             * Has been updated trigger event
+             */
+            update(): void;
+            /**
+             * This can be overridden to start preloading a resource
+             * or do any other prepare step.
+             * @protected
+             * @return {Promise} Handle the validate event
+             */
+            protected load(): Promise;
+            /**
+             * The width of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly width: number;
+            /**
+             * The height of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly height: number;
+            /**
+             * Set the style, optional to override
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} `true` is success
+             */
+            style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Call when destroying resource, unbind any BaseTexture object
+             * before calling this method, as reference counts are maintained
+             * internally.
+             */
+            destroy(): void;
+        }
+        /**
+         * Resource type for HTMLImageElement.
+         * @class
+         * @extends PIXI.resources.BaseImageResource
+         * @memberof PIXI.resources
+         */
+        class ImageResource extends PIXI.resources.BaseImageResource {
+            constructor(source: HTMLImageElement | string);
+            /**
+             * URL of the image source
+             * @member {string} PIXI.resources.ImageResource#url
+             */
+            url: string;
+            /**
+             * If the image should be disposed after upload
+             * @member {boolean} PIXI.resources.ImageResource#preserveBitmap
+             * @default false
+             */
+            preserveBitmap: boolean;
+            /**
+             * If capable, convert the image using createImageBitmap API
+             * @member {boolean} PIXI.resources.ImageResource#createBitmap
+             * @default PIXI.settings.CREATE_IMAGE_BITMAP
+             */
+            createBitmap: boolean;
+            /**
+             * Controls texture premultiplyAlpha field
+             * Copies from options
+             * @member {boolean|null} PIXI.resources.ImageResource#premultiplyAlpha
+             * @readonly
+             */
+            readonly premultiplyAlpha: boolean | null;
+            /**
+             * The ImageBitmap element created for HTMLImageElement
+             * @member {ImageBitmap} PIXI.resources.ImageResource#bitmap
+             * @default null
+             */
+            bitmap: ImageBitmap;
+            /**
+             * returns a promise when image will be loaded and processed
+             *
+             * @param {boolean} [createBitmap=true] whether process image into bitmap
+             * @returns {Promise}
+             */
+            load(createBitmap?: boolean): Promise;
+            /**
+             * Called when we need to convert image into BitmapImage.
+             * Can be called multiple times, real promise is cached inside.
+             *
+             * @returns {Promise} cached promise to fill that bitmap
+             */
+            process(): Promise;
+            /**
+             * Upload the image resource to GPU.
+             *
+             * @param {PIXI.Renderer} renderer - Renderer to upload to
+             * @param {PIXI.BaseTexture} baseTexture - BaseTexture for this resource
+             * @param {PIXI.GLTexture} glTexture - GLTexture to use
+             * @returns {boolean} true is success
+             */
+            upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * The source element
+             * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
+             * @readonly
+             */
+            readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
+            /**
+             * Clean up anything, this happens when destroying is ready.
+             *
+             * @protected
+             */
+            protected dispose(): void;
+            /**
+             * Internal width of the resource
+             * @member {number} PIXI.resources.Resource#_width
+             * @protected
+             */
+            protected _width: number;
+            /**
+             * Internal height of the resource
+             * @member {number} PIXI.resources.Resource#_height
+             * @protected
+             */
+            protected _height: number;
+            /**
+             * If resource has been destroyed
+             * @member {boolean} PIXI.resources.Resource#destroyed
+             * @readonly
+             * @default false
+             */
+            readonly destroyed: boolean;
+            /**
+             * `true` if resource is created by BaseTexture
+             * useful for doing cleanup with BaseTexture destroy
+             * and not cleaning up resources that were created
+             * externally.
+             * @member {boolean} PIXI.resources.Resource#internal
+             * @protected
+             */
+            protected internal: boolean;
+            /**
+             * Bind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            bind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Unbind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            unbind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Trigger a resize event
+             */
+            resize(): void;
+            /**
+             * Has been validated
+             * @readonly
+             * @member {boolean}
+             */
+            readonly valid: boolean;
+            /**
+             * Has been updated trigger event
+             */
+            update(): void;
+            /**
+             * The width of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly width: number;
+            /**
+             * The height of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly height: number;
+            /**
+             * Set the style, optional to override
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} `true` is success
+             */
+            style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Call when destroying resource, unbind any BaseTexture object
+             * before calling this method, as reference counts are maintained
+             * internally.
+             */
+            destroy(): void;
+        }
+        /**
+         * Base resource class for textures that manages validation and uploading, depending on its type.
+         *
+         * Uploading of a base texture to the GPU is required.
+         *
+         * @class
+         * @memberof PIXI.resources
+         */
+        class Resource {
+            constructor(width?: number, height?: number);
+            /**
+             * Internal width of the resource
+             * @member {number} PIXI.resources.Resource#_width
+             * @protected
+             */
+            protected _width: number;
+            /**
+             * Internal height of the resource
+             * @member {number} PIXI.resources.Resource#_height
+             * @protected
+             */
+            protected _height: number;
+            /**
+             * If resource has been destroyed
+             * @member {boolean} PIXI.resources.Resource#destroyed
+             * @readonly
+             * @default false
+             */
+            readonly destroyed: boolean;
+            /**
+             * `true` if resource is created by BaseTexture
+             * useful for doing cleanup with BaseTexture destroy
+             * and not cleaning up resources that were created
+             * externally.
+             * @member {boolean} PIXI.resources.Resource#internal
+             * @protected
+             */
+            protected internal: boolean;
+            /**
+             * Bind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            bind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Unbind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            unbind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Trigger a resize event
+             */
+            resize(): void;
+            /**
+             * Has been validated
+             * @readonly
+             * @member {boolean}
+             */
+            readonly valid: boolean;
+            /**
+             * Has been updated trigger event
+             */
+            update(): void;
+            /**
+             * This can be overridden to start preloading a resource
+             * or do any other prepare step.
+             * @protected
+             * @return {Promise} Handle the validate event
+             */
+            protected load(): Promise;
+            /**
+             * The width of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly width: number;
+            /**
+             * The height of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly height: number;
+            /**
+             * Uploads the texture or returns false if it cant for some reason. Override this.
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} true is success
+             */
+            upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Set the style, optional to override
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} `true` is success
+             */
+            style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Clean up anything, this happens when destroying is ready.
+             *
+             * @protected
+             */
+            protected dispose(): void;
+            /**
+             * Call when destroying resource, unbind any BaseTexture object
+             * before calling this method, as reference counts are maintained
+             * internally.
+             */
+            destroy(): void;
+        }
+        /**
+         * Resource type for SVG elements and graphics.
+         * @class
+         * @extends PIXI.resources.BaseImageResource
+         * @memberof PIXI.resources
+         * @param {string} source - Base64 encoded SVG element or URL for SVG file.
+         * @param {object} [options] - Options to use
+         * @param {number} [options.scale=1] Scale to apply to SVG.
+         * @param {boolean} [options.autoLoad=true] Start loading right away.
+         */
+        class SVGResource extends PIXI.resources.BaseImageResource {
+            constructor(source: string, options?: {
+                scale?: number;
+                autoLoad?: boolean;
+            });
+            /**
+             * Base64 encoded SVG element or URL for SVG file
+             * @readonly
+             * @member {string} PIXI.resources.SVGResource#svg
+             */
+            readonly svg: string;
+            /**
+             * The source scale to apply to render
+             * @readonly
+             * @member {number} PIXI.resources.SVGResource#scale
+             */
+            readonly scale: number;
+            /**
+             * Reads an SVG string from data URI and then calls `_loadString`.
+             *
+             * @param {string} dataUri - The data uri to load from.
+             */
+            _loadDataUri(dataUri: string): void;
+            /**
+             * Get size from an svg string using regexp.
+             *
+             * @method
+             * @param {string} svgString - a serialized svg element
+             * @return {PIXI.resources.SVGResource.Size} image extension
+             */
+            static getSize(svgString: string): PIXI.resources.SVGResource.Size;
+            /**
+             * Used to auto-detect the type of resource.
+             *
+             * @static
+             * @param {*} source - The source object
+             * @param {string} extension - The extension of source, if set
+             */
+            static test(source: any, extension: string): void;
+            /**
+             * RegExp for SVG size.
+             *
+             * @static
+             * @constant {RegExp|string} SVG_SIZE
+             * @memberof PIXI.resources.SVGResource
+             * @example <svg width="100" height="100"></svg>
+             */
+            static readonly SVG_SIZE: RegExp | string;
+            /**
+             * The source element
+             * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
+             * @readonly
+             */
+            readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
+            /**
+             * Upload the texture to the GPU.
+             * @param {PIXI.Renderer} renderer Upload to the renderer
+             * @param {PIXI.BaseTexture} baseTexture Reference to parent texture
+             * @param {PIXI.GLTexture} glTexture
+             * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] (optional)
+             * @returns {boolean} true is success
+             */
+            upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement): boolean;
+            /**
+             * Clean up anything, this happens when destroying is ready.
+             *
+             * @protected
+             */
+            protected dispose(): void;
+            /**
+             * Internal width of the resource
+             * @member {number} PIXI.resources.Resource#_width
+             * @protected
+             */
+            protected _width: number;
+            /**
+             * Internal height of the resource
+             * @member {number} PIXI.resources.Resource#_height
+             * @protected
+             */
+            protected _height: number;
+            /**
+             * If resource has been destroyed
+             * @member {boolean} PIXI.resources.Resource#destroyed
+             * @readonly
+             * @default false
+             */
+            readonly destroyed: boolean;
+            /**
+             * `true` if resource is created by BaseTexture
+             * useful for doing cleanup with BaseTexture destroy
+             * and not cleaning up resources that were created
+             * externally.
+             * @member {boolean} PIXI.resources.Resource#internal
+             * @protected
+             */
+            protected internal: boolean;
+            /**
+             * Bind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            bind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Unbind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            unbind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Trigger a resize event
+             */
+            resize(): void;
+            /**
+             * Has been validated
+             * @readonly
+             * @member {boolean}
+             */
+            readonly valid: boolean;
+            /**
+             * Has been updated trigger event
+             */
+            update(): void;
+            /**
+             * This can be overridden to start preloading a resource
+             * or do any other prepare step.
+             * @protected
+             * @return {Promise} Handle the validate event
+             */
+            protected load(): Promise;
+            /**
+             * The width of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly width: number;
+            /**
+             * The height of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly height: number;
+            /**
+             * Set the style, optional to override
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} `true` is success
+             */
+            style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Call when destroying resource, unbind any BaseTexture object
+             * before calling this method, as reference counts are maintained
+             * internally.
+             */
+            destroy(): void;
+        }
+        module SVGResource {
+            /**
+             * Typedef for Size object.
+             *
+             * @memberof PIXI.resources.SVGResource
+             * @typedef {object} Size
+             * @property {number} width - Width component
+             * @property {number} height - Height component
+             */
+            type Size = {
+                width: number;
+                height: number;
+            };
+        }
+        /**
+         * Resource type for HTMLVideoElement.
+         * @class
+         * @extends PIXI.resources.BaseImageResource
+         * @memberof PIXI.resources
+         * @param {HTMLVideoElement|object|string|Array} source - Video element to use.
+         * @param {object} [options] - Options to use
+         * @param {boolean} [options.autoLoad=true] - Start loading the video immediately
+         * @param {boolean} [options.autoPlay=true] - Start playing video immediately
+         * @param {number} [options.updateFPS=0] - How many times a second to update the texture from the video.
+         * Leave at 0 to update at every render.
+         * @param {boolean} [options.crossorigin=true] - Load image using cross origin
+         */
+        class VideoResource extends PIXI.resources.BaseImageResource {
+            constructor(source: HTMLVideoElement | any | string | (string | any)[], options?: {
+                autoLoad?: boolean;
+                autoPlay?: boolean;
+                updateFPS?: number;
+                crossorigin?: boolean;
+            });
+            /**
+             * When set to true will automatically play videos used by this texture once
+             * they are loaded. If false, it will not modify the playing state.
+             *
+             * @member {boolean} PIXI.resources.VideoResource#autoPlay
+             * @default true
+             */
+            autoPlay: boolean;
+            /**
+             * Trigger updating of the texture
+             *
+             * @param {number} [deltaTime=0] - time delta since last tick
+             */
+            update(deltaTime?: number): void;
+            /**
+             * Start preloading the video resource.
+             *
+             * @protected
+             * @return {Promise} Handle the validate event
+             */
+            protected load(): Promise;
+            /**
+             * Should the base texture automatically update itself, set to true by default
+             *
+             * @member {boolean}
+             */
+            autoUpdate: boolean;
+            /**
+             * How many times a second to update the texture from the video. Leave at 0 to update at every render.
+             * A lower fps can help performance, as updating the texture at 60fps on a 30ps video may not be efficient.
+             *
+             * @member {number}
+             */
+            updateFPS: number;
+            /**
+             * Used to auto-detect the type of resource.
+             *
+             * @static
+             * @param {*} source - The source object
+             * @param {string} extension - The extension of source, if set
+             * @return {boolean} `true` if video source
+             */
+            static test(source: any, extension: string): boolean;
+            /**
+             * List of common video file extensions supported by VideoResource.
+             * @constant
+             * @member {Array}
+             * @static
+             * @readonly
+             */
+            static readonly TYPES: string[];
+            /**
+             * The source element
+             * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} PIXI.resources.BaseImageResource#source
+             * @readonly
+             */
+            readonly source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement;
+            /**
+             * Upload the texture to the GPU.
+             * @param {PIXI.Renderer} renderer Upload to the renderer
+             * @param {PIXI.BaseTexture} baseTexture Reference to parent texture
+             * @param {PIXI.GLTexture} glTexture
+             * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] (optional)
+             * @returns {boolean} true is success
+             */
+            upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture, source?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | SVGElement): boolean;
+            /**
+             * Clean up anything, this happens when destroying is ready.
+             *
+             * @protected
+             */
+            protected dispose(): void;
+            /**
+             * Internal width of the resource
+             * @member {number} PIXI.resources.Resource#_width
+             * @protected
+             */
+            protected _width: number;
+            /**
+             * Internal height of the resource
+             * @member {number} PIXI.resources.Resource#_height
+             * @protected
+             */
+            protected _height: number;
+            /**
+             * If resource has been destroyed
+             * @member {boolean} PIXI.resources.Resource#destroyed
+             * @readonly
+             * @default false
+             */
+            readonly destroyed: boolean;
+            /**
+             * `true` if resource is created by BaseTexture
+             * useful for doing cleanup with BaseTexture destroy
+             * and not cleaning up resources that were created
+             * externally.
+             * @member {boolean} PIXI.resources.Resource#internal
+             * @protected
+             */
+            protected internal: boolean;
+            /**
+             * Bind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            bind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Unbind to a parent BaseTexture
+             *
+             * @param {PIXI.BaseTexture} baseTexture - Parent texture
+             */
+            unbind(baseTexture: PIXI.BaseTexture): void;
+            /**
+             * Trigger a resize event
+             */
+            resize(): void;
+            /**
+             * Has been validated
+             * @readonly
+             * @member {boolean}
+             */
+            readonly valid: boolean;
+            /**
+             * The width of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly width: number;
+            /**
+             * The height of the resource.
+             *
+             * @member {number}
+             * @readonly
+             */
+            readonly height: number;
+            /**
+             * Set the style, optional to override
+             *
+             * @param {PIXI.Renderer} renderer - yeah, renderer!
+             * @param {PIXI.BaseTexture} baseTexture - the texture
+             * @param {PIXI.GLTexture} glTexture - texture instance for this webgl context
+             * @returns {boolean} `true` is success
+             */
+            style(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture, glTexture: PIXI.GLTexture): boolean;
+            /**
+             * Call when destroying resource, unbind any BaseTexture object
+             * before calling this method, as reference counts are maintained
+             * internally.
+             */
+            destroy(): void;
+        }
+    }
+    /**
+     * A texture stores the information that represents an image or part of an image.
+     *
+     * It cannot be added to the display list directly; instead use it as the texture for a Sprite.
+     * If no frame is provided for a texture, then the whole image is used.
+     *
+     * You can directly create a texture from an image and then reuse it multiple times like this :
+     *
+     * ```js
+     * let texture = PIXI.Texture.from('assets/image.png');
+     * let sprite1 = new PIXI.Sprite(texture);
+     * let sprite2 = new PIXI.Sprite(texture);
+     * ```
+     *
+     * Textures made from SVGs, loaded or not, cannot be used before the file finishes processing.
+     * You can check for this by checking the sprite's _textureID property.
+     * ```js
+     * var texture = PIXI.Texture.from('assets/image.svg');
+     * var sprite1 = new PIXI.Sprite(texture);
+     * //sprite1._textureID should not be undefined if the texture has finished processing the SVG file
+     * ```
+     * You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068.
+     *
+     * @class
+     * @extends PIXI.utils.EventEmitter
+     * @memberof PIXI
+     */
+    class Texture extends PIXI.utils.EventEmitter {
+        constructor(baseTexture: PIXI.BaseTexture, frame?: PIXI.Rectangle, orig?: PIXI.Rectangle, trim?: PIXI.Rectangle, rotate?: number, anchor?: PIXI.Point);
+        /**
+         * @deprecated since 5.0.0
+         * @method PIXI.Texture.fromImage
+         * @see PIXI.Texture.from
+         * @return {PIXI.Texture}
+         */
+        static fromImage(): PIXI.Texture;
+        /**
+         * @deprecated since 5.0.0
+         * @method PIXI.Texture.fromSVG
+         * @see PIXI.Texture.from
+         * @return {PIXI.Texture}
+         */
+        static fromSVG(): PIXI.Texture;
+        /**
+         * @deprecated since 5.0.0
+         * @method PIXI.Texture.fromCanvas
+         * @see PIXI.Texture.from
+         * @return {PIXI.Texture}
+         */
+        static fromCanvas(): PIXI.Texture;
+        /**
+         * @deprecated since 5.0.0
+         * @method PIXI.Texture.fromVideo
+         * @see PIXI.Texture.from
+         * @return {PIXI.Texture}
+         */
+        static fromVideo(): PIXI.Texture;
+        /**
+         * @deprecated since 5.0.0
+         * @method PIXI.Texture.fromFrame
+         * @see PIXI.Texture.from
+         * @return {PIXI.Texture}
+         */
+        static fromFrame(): PIXI.Texture;
+        /**
+         * Does this Texture have any frame data assigned to it?
+         *
+         * @member {boolean} PIXI.Texture#noFrame
+         */
+        noFrame: boolean;
+        /**
+         * The base texture that this texture uses.
+         *
+         * @member {PIXI.BaseTexture} PIXI.Texture#baseTexture
+         */
+        baseTexture: PIXI.BaseTexture;
+        /**
+         * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
+         * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
+         *
+         * @member {PIXI.Rectangle} PIXI.Texture#_frame
+         */
+        _frame: PIXI.Rectangle;
+        /**
+         * This is the trimmed area of original texture, before it was put in atlas
+         * Please call `updateUvs()` after you change coordinates of `trim` manually.
+         *
+         * @member {PIXI.Rectangle} PIXI.Texture#trim
+         */
+        trim: PIXI.Rectangle;
+        /**
+         * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
+         *
+         * @member {boolean} PIXI.Texture#valid
+         */
+        valid: boolean;
+        /**
+         * This will let a renderer know that a texture has been updated (used mainly for WebGL uv updates)
+         *
+         * @member {boolean} PIXI.Texture#requiresUpdate
+         */
+        requiresUpdate: boolean;
+        /**
+         * The WebGL UV data cache. Can be used as quad UV
+         *
+         * @member {PIXI.TextureUvs} PIXI.Texture#_uvs
+         * @protected
+         */
+        protected _uvs: PIXI.TextureUvs;
+        /**
+         * Default TextureMatrix instance for this texture
+         * By default that object is not created because its heavy
+         *
+         * @member {PIXI.TextureMatrix} PIXI.Texture#uvMatrix
+         */
+        uvMatrix: PIXI.TextureMatrix;
+        /**
+         * This is the area of original texture, before it was put in atlas
+         *
+         * @member {PIXI.Rectangle} PIXI.Texture#orig
+         */
+        orig: PIXI.Rectangle;
+        /**
+         * Anchor point that is used as default if sprite is created with this texture.
+         * Changing the `defaultAnchor` at a later point of time will not update Sprite's anchor point.
+         * @member {PIXI.Point} PIXI.Texture#defaultAnchor
+         * @default {0,0}
+         */
+        defaultAnchor: PIXI.Point;
+        /**
+         * Update ID is observed by sprites and TextureMatrix instances.
+         * Call updateUvs() to increment it.
+         *
+         * @member {number} PIXI.Texture#_updateID
+         * @protected
+         */
+        protected _updateID: number;
+        /**
+         * The ids under which this Texture has been added to the texture cache. This is
+         * automatically set as long as Texture.addToCache is used, but may not be set if a
+         * Texture is added directly to the TextureCache array.
+         *
+         * @member {string[]} PIXI.Texture#textureCacheIds
+         */
+        textureCacheIds: string[];
+        /**
+         * Updates this texture on the gpu.
+         *
+         */
+        update(): void;
+        /**
+         * Called when the base texture is updated
+         *
+         * @protected
+         * @param {PIXI.BaseTexture} baseTexture - The base texture.
+         */
+        protected onBaseTextureUpdated(baseTexture: PIXI.BaseTexture): void;
+        /**
+         * Destroys this texture
+         *
+         * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well
+         */
+        destroy(destroyBase?: boolean): void;
+        /**
+         * Creates a new texture object that acts the same as this one.
+         *
+         * @return {PIXI.Texture} The new texture
+         */
+        clone(): PIXI.Texture;
+        /**
+         * Updates the internal WebGL UV cache. Use it after you change `frame` or `trim` of the texture.
+         * Call it after changing the frame
+         */
+        updateUvs(): void;
+        /**
+         * Helper function that creates a new Texture based on the source you provide.
+         * The source can be - frame id, image url, video url, canvas element, video element, base texture
+         *
+         * @static
+         * @param {number|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture} source
+         *        Source to create texture from
+         * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options.
+         * @return {PIXI.Texture} The newly created texture
+         */
+        static from(source: number | string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | PIXI.BaseTexture, options?: any): PIXI.Texture;
+        /**
+         * Create a new Texture with a BufferResource from a Float32Array.
+         * RGBA values are floats from 0 to 1.
+         * @static
+         * @param {Float32Array|Uint8Array} buffer The optional array to use, if no data
+         *        is provided, a new Float32Array is created.
+         * @param {number} width - Width of the resource
+         * @param {number} height - Height of the resource
+         * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options.
+         * @return {PIXI.Texture} The resulting new BaseTexture
+         */
+        static fromBuffer(buffer: Float32Array | Uint8Array, width: number, height: number, options?: any): PIXI.Texture;
+        /**
+         * Create a texture from a source and add to the cache.
+         *
+         * @static
+         * @param {HTMLImageElement|HTMLCanvasElement} source - The input source.
+         * @param {String} imageUrl - File name of texture, for cache and resolving resolution.
+         * @param {String} [name] - Human readable name for the texture cache. If no name is
+         *        specified, only `imageUrl` will be used as the cache ID.
+         * @return {PIXI.Texture} Output texture
+         */
+        static fromLoader(source: HTMLImageElement | HTMLCanvasElement, imageUrl: string, name?: string): PIXI.Texture;
+        /**
+         * Adds a Texture to the global TextureCache. This cache is shared across the whole PIXI object.
+         *
+         * @static
+         * @param {PIXI.Texture} texture - The Texture to add to the cache.
+         * @param {string} id - The id that the Texture will be stored against.
+         */
+        static addToCache(texture: PIXI.Texture, id: string): void;
+        /**
+         * Remove a Texture from the global TextureCache.
+         *
+         * @static
+         * @param {string|PIXI.Texture} texture - id of a Texture to be removed, or a Texture instance itself
+         * @return {PIXI.Texture|null} The Texture that was removed
+         */
+        static removeFromCache(texture: string | PIXI.Texture): PIXI.Texture | null;
+        /**
+         * The frame specifies the region of the base texture that this texture uses.
+         * Please call `updateUvs()` after you change coordinates of `frame` manually.
+         *
+         * @member {PIXI.Rectangle}
+         */
+        frame: PIXI.Rectangle;
+        /**
+         * Indicates whether the texture is rotated inside the atlas
+         * set to 2 to compensate for texture packer rotation
+         * set to 6 to compensate for spine packer rotation
+         * can be used to rotate or mirror sprites
+         * See {@link PIXI.GroupD8} for explanation
+         *
+         * @member {number}
+         */
+        rotate: number;
+        /**
+         * The width of the Texture in pixels.
+         *
+         * @member {number}
+         */
+        width: number;
+        /**
+         * The height of the Texture in pixels.
+         *
+         * @member {number}
+         */
+        height: number;
+        /**
+         * An empty texture, used often to not have to create multiple empty textures.
+         * Can not be destroyed.
+         *
+         * @static
+         * @constant
+         * @member {PIXI.Texture}
+         */
+        static EMPTY: PIXI.Texture;
+        /**
+         * A white texture of 10x10 size, used for graphics and other things
+         * Can not be destroyed.
+         *
+         * @static
+         * @constant
+         * @member {PIXI.Texture}
+         */
+        static WHITE: PIXI.Texture;
+    }
+    /**
+     * Class controls uv mapping from Texture normal space to BaseTexture normal space.
+     *
+     * Takes `trim` and `rotate` into account. May contain clamp settings for Meshes and TilingSprite.
+     *
+     * Can be used in Texture `uvMatrix` field, or separately, you can use different clamp settings on the same texture.
+     * If you want to add support for texture region of certain feature or filter, that's what you're looking for.
+     *
+     * Takes track of Texture changes through `_lastTextureID` private field.
+     * Use `update()` method call to track it from outside.
+     *
+     * @see PIXI.Texture
+     * @see PIXI.Mesh
+     * @see PIXI.TilingSprite
+     * @class
+     * @memberof PIXI
+     */
+    class TextureMatrix {
+        constructor(texture: PIXI.Texture, clampMargin?: number);
+        /**
+         * Tracks Texture frame changes
+         * @member {number} PIXI.TextureMatrix#_updateID
+         * @protected
+         */
+        protected _updateID: number;
+        /**
+         * Changes frame clamping
+         * Works with TilingSprite and Mesh
+         * Change to 1.5 if you texture has repeated right and bottom lines, that leads to smoother borders
+         *
+         * @default 0
+         * @member {number} PIXI.TextureMatrix#clampOffset
+         */
+        clampOffset: number;
+        /**
+         * Changes frame clamping
+         * Works with TilingSprite and Mesh
+         * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas
+         *
+         * @default 0.5
+         * @member {number} PIXI.TextureMatrix#clampMargin
+         */
+        clampMargin: number;
+        /**
+         * If texture size is the same as baseTexture
+         * @member {boolean} PIXI.TextureMatrix#isSimple
+         * @default false
+         * @readonly
+         */
+        readonly isSimple: boolean;
+        /**
+         * texture property
+         * @member {PIXI.Texture}
+         */
+        texture: PIXI.Texture;
+        /**
+         * Multiplies uvs array to transform
+         * @param {Float32Array} uvs mesh uvs
+         * @param {Float32Array} [out=uvs] output
+         * @returns {Float32Array} output
+         */
+        multiplyUvs(uvs: Float32Array, out?: Float32Array): Float32Array;
+        /**
+         * updates matrices if texture was changed
+         * @param {boolean} [forceUpdate=false] if true, matrices will be updated any case
+         * @returns {boolean} whether or not it was updated
+         */
+        update(forceUpdate?: boolean): boolean;
+    }
+    /**
+     * A standard object to store the Uvs of a texture
+     *
+     * @class
+     * @protected
+     * @memberof PIXI
+     */
+    class TextureUvs {
+        constructor();
+        /**
+         * Sets the texture Uvs based on the given frame information.
+         *
+         * @protected
+         * @param {PIXI.Rectangle} frame - The frame of the texture
+         * @param {PIXI.Rectangle} baseFrame - The base frame of the texture
+         * @param {number} rotate - Rotation of frame, see {@link PIXI.GroupD8}
+         */
+        protected set(frame: PIXI.Rectangle, baseFrame: PIXI.Rectangle, rotate: number): void;
+    }
+    /**
+     * Helper class to create a quad
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Quad {
+        constructor();
+    }
+    /**
+     * Helper class to create a quad with uvs like in v4
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class QuadUv {
+        constructor();
+        /**
+         * An array of vertices
+         *
+         * @member {Float32Array} PIXI.QuadUv#vertices
+         */
+        vertices: Float32Array;
+        /**
+         * The Uvs of the quad
+         *
+         * @member {Float32Array} PIXI.QuadUv#uvs
+         */
+        uvs: Float32Array;
+        /**
+         * Maps two Rectangle to the quad.
+         *
+         * @param {PIXI.Rectangle} targetTextureFrame - the first rectangle
+         * @param {PIXI.Rectangle} destinationFrame - the second rectangle
+         * @return {PIXI.Quad} Returns itself.
+         */
+        map(targetTextureFrame: PIXI.Rectangle, destinationFrame: PIXI.Rectangle): PIXI.Quad;
+        /**
+         * legacy upload method, just marks buffers dirty
+         * @returns {PIXI.QuadUv} Returns itself.
+         */
+        invalidate(): PIXI.QuadUv;
+    }
+    /**
+     * 'Builder' pattern for bounds rectangles.
+     *
+     * This could be called an Axis-Aligned Bounding Box.
+     * It is not an actual shape. It is a mutable thing; no 'EMPTY' or those kind of problems.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Bounds {
+        constructor();
+        /**
+         * @member {number} PIXI.Bounds#minX
+         * @default 0
+         */
+        minX: number;
+        /**
+         * @member {number} PIXI.Bounds#minY
+         * @default 0
+         */
+        minY: number;
+        /**
+         * @member {number} PIXI.Bounds#maxX
+         * @default 0
+         */
+        maxX: number;
+        /**
+         * @member {number} PIXI.Bounds#maxY
+         * @default 0
+         */
+        maxY: number;
+        /**
+         * Checks if bounds are empty.
+         *
+         * @return {boolean} True if empty.
+         */
+        isEmpty(): boolean;
+        /**
+         * Clears the bounds and resets.
+         *
+         */
+        clear(): void;
+        /**
+         * Can return Rectangle.EMPTY constant, either construct new rectangle, either use your rectangle
+         * It is not guaranteed that it will return tempRect
+         *
+         * @param {PIXI.Rectangle} rect - temporary object will be used if AABB is not empty
+         * @returns {PIXI.Rectangle} A rectangle of the bounds
+         */
+        getRectangle(rect: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * This function should be inlined when its possible.
+         *
+         * @param {PIXI.Point} point - The point to add.
+         */
+        addPoint(point: PIXI.Point): void;
+        /**
+         * Adds a quad, not transformed
+         *
+         * @param {Float32Array} vertices - The verts to add.
+         */
+        addQuad(vertices: Float32Array): void;
+        /**
+         * Adds sprite frame, transformed.
+         *
+         * @param {PIXI.Transform} transform - TODO
+         * @param {number} x0 - TODO
+         * @param {number} y0 - TODO
+         * @param {number} x1 - TODO
+         * @param {number} y1 - TODO
+         */
+        addFrame(transform: PIXI.Transform, x0: number, y0: number, x1: number, y1: number): void;
+        /**
+         * Adds screen vertices from array
+         *
+         * @param {Float32Array} vertexData - calculated vertices
+         * @param {number} beginOffset - begin offset
+         * @param {number} endOffset - end offset, excluded
+         */
+        addVertexData(vertexData: Float32Array, beginOffset: number, endOffset: number): void;
+        /**
+         * Add an array of mesh vertices
+         *
+         * @param {PIXI.Transform} transform - mesh transform
+         * @param {Float32Array} vertices - mesh coordinates in array
+         * @param {number} beginOffset - begin offset
+         * @param {number} endOffset - end offset, excluded
+         */
+        addVertices(transform: PIXI.Transform, vertices: Float32Array, beginOffset: number, endOffset: number): void;
+        /**
+         * Adds other Bounds
+         *
+         * @param {PIXI.Bounds} bounds - TODO
+         */
+        addBounds(bounds: PIXI.Bounds): void;
+        /**
+         * Adds other Bounds, masked with Bounds
+         *
+         * @param {PIXI.Bounds} bounds - TODO
+         * @param {PIXI.Bounds} mask - TODO
+         */
+        addBoundsMask(bounds: PIXI.Bounds, mask: PIXI.Bounds): void;
+        /**
+         * Adds other Bounds, masked with Rectangle
+         *
+         * @param {PIXI.Bounds} bounds - TODO
+         * @param {PIXI.Rectangle} area - TODO
+         */
+        addBoundsArea(bounds: PIXI.Bounds, area: PIXI.Rectangle): void;
+    }
+    /**
+     * A Container represents a collection of display objects.
+     *
+     * It is the base class of all display objects that act as a container for other objects (like Sprites).
+     *
+     *```js
+     * let container = new PIXI.Container();
+     * container.addChild(sprite);
+     * ```
+     *
+     * @class
+     * @extends PIXI.DisplayObject
+     * @memberof PIXI
+     */
+    class Container extends PIXI.DisplayObject {
+        constructor();
+        /**
+         * @method PIXI.Container#renderWebGL
+         * @deprecated since 5.0.0
+         * @see PIXI.Container#render
+         * @param {PIXI.Renderer} renderer Instance of renderer
+         */
+        renderWebGL(renderer: PIXI.Renderer): void;
+        /**
+         * @method PIXI.Container#renderAdvancedWebGL
+         * @deprecated since 5.0.0
+         * @see PIXI.Container#renderAdvanced
+         * @param {PIXI.Renderer} renderer Instance of renderer
+         */
+        renderAdvancedWebGL(renderer: PIXI.Renderer): void;
+        /**
+         * To be overridden by the subclass
+         * @method _renderCanvas
+         * @memberof PIXI.Container#
+         * @protected
+         * @param {PIXI.CanvasRenderer} renderer - The renderer
+         */
+        protected _renderCanvas(renderer: PIXI.CanvasRenderer): void;
+        /**
+         * Renders the object using the Canvas renderer
+         * @method renderCanvas
+         * @memberof PIXI.Container#
+         * @param {PIXI.CanvasRenderer} renderer - The renderer
+         */
+        renderCanvas(renderer: PIXI.CanvasRenderer): void;
+        /**
+         * Renders the object using the Canvas renderer
+         * @method renderCanvas
+         * @memberof PIXI.Container#
+         * @param {PIXI.CanvasRenderer} renderer - The renderer
+         */
+        renderCanvas(renderer: PIXI.CanvasRenderer): void;
+        /**
+         * The array of children of this container.
+         *
+         * @member {PIXI.DisplayObject[]} PIXI.Container#children
+         * @readonly
+         */
+        readonly children: PIXI.DisplayObject[];
+        /**
+         * If set to true, the container will sort its children by zIndex value
+         * when updateTransform() is called, or manually if sortChildren() is called.
+         *
+         * This actually changes the order of elements in the array, so should be treated
+         * as a basic solution that is not performant compared to other solutions,
+         * such as @link https://github.com/pixijs/pixi-display
+         *
+         * Also be aware of that this may not work nicely with the addChildAt() function,
+         * as the zIndex sorting may cause the child to automatically sorted to another position.
+         *
+         * @see PIXI.settings.SORTABLE_CHILDREN
+         *
+         * @member {boolean} PIXI.Container#sortableChildren
+         */
+        sortableChildren: boolean;
+        /**
+         * Should children be sorted by zIndex at the next updateTransform call.
+         * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
+         *
+         * @member {boolean} PIXI.Container#sortDirty
+         */
+        sortDirty: boolean;
+        /**
+         * Overridable method that can be used by Container subclasses whenever the children array is modified
+         *
+         * @protected
+         */
+        protected onChildrenChange(): void;
+        /**
+         * Adds one or more children to the container.
+         *
+         * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
+         *
+         * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container
+         * @return {PIXI.DisplayObject} The first child that was added.
+         */
+        addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject;
+        /**
+         * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
+         *
+         * @param {PIXI.DisplayObject} child - The child to add
+         * @param {number} index - The index to place the child in
+         * @return {PIXI.DisplayObject} The child that was added.
+         */
+        addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject;
+        /**
+         * Swaps the position of 2 Display Objects within this container.
+         *
+         * @param {PIXI.DisplayObject} child - First display object to swap
+         * @param {PIXI.DisplayObject} child2 - Second display object to swap
+         */
+        swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
+        /**
+         * Returns the index position of a child DisplayObject instance
+         *
+         * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
+         * @return {number} The index position of the child display object to identify
+         */
+        getChildIndex(child: PIXI.DisplayObject): number;
+        /**
+         * Changes the position of an existing child in the display object container
+         *
+         * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
+         * @param {number} index - The resulting index number for the child display object
+         */
+        setChildIndex(child: PIXI.DisplayObject, index: number): void;
+        /**
+         * Returns the child at the specified index
+         *
+         * @param {number} index - The index to get the child at
+         * @return {PIXI.DisplayObject} The child at the given index, if any.
+         */
+        getChildAt(index: number): PIXI.DisplayObject;
+        /**
+         * Removes one or more children from the container.
+         *
+         * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove
+         * @return {PIXI.DisplayObject} The first child that was removed.
+         */
+        removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject;
+        /**
+         * Removes a child from the specified index position.
+         *
+         * @param {number} index - The index to get the child from
+         * @return {PIXI.DisplayObject} The child that was removed.
+         */
+        removeChildAt(index: number): PIXI.DisplayObject;
+        /**
+         * Removes all children from this container that are within the begin and end indexes.
+         *
+         * @param {number} [beginIndex=0] - The beginning position.
+         * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
+         * @returns {DisplayObject[]} List of removed children
+         */
+        removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[];
+        /**
+         * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
+         */
+        sortChildren(): void;
+        /**
+         * Updates the transform on all children of this container for rendering
+         */
+        updateTransform(): void;
+        /**
+         * Recalculates the bounds of the container.
+         *
+         */
+        calculateBounds(): void;
+        /**
+         * Recalculates the bounds of the object. Override this to
+         * calculate the bounds of the specific object (not including children).
+         *
+         * @protected
+         */
+        protected _calculateBounds(): void;
+        /**
+         * Renders the object using the WebGL renderer
+         *
+         * @param {PIXI.Renderer} renderer - The renderer
+         */
+        render(renderer: PIXI.Renderer): void;
+        /**
+         * Render the object using the WebGL renderer and advanced features.
+         *
+         * @protected
+         * @param {PIXI.Renderer} renderer - The renderer
+         */
+        protected renderAdvanced(renderer: PIXI.Renderer): void;
+        /**
+         * To be overridden by the subclasses.
+         *
+         * @protected
+         * @param {PIXI.Renderer} renderer - The renderer
+         */
+        protected _render(renderer: PIXI.Renderer): void;
+        /**
+         * Removes all internal references and listeners as well as removes children from the display list.
+         * Do not use a Container after calling `destroy`.
+         *
+         * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options
+         *  have been set to that value
+         * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy
+         *  method called as well. 'options' will be passed on to those calls.
+         * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true
+         *  Should it destroy the texture of the child sprite
+         * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true
+         *  Should it destroy the base texture of the child sprite
+         */
+        destroy(options?: {
+            children?: boolean;
+            texture?: boolean;
+            baseTexture?: boolean;
+        }): void;
+        /**
+         * The width of the Container, setting this will actually modify the scale to achieve the value set
+         *
+         * @member {number}
+         */
+        width: number;
+        /**
+         * The height of the Container, setting this will actually modify the scale to achieve the value set
+         *
+         * @member {number}
+         */
+        height: number;
+        /**
+         * Determines if the children to the displayObject can be clicked/touched
+         * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
+         *
+         * @member {boolean}
+         * @memberof PIXI.Container#
+         */
+        interactiveChildren: boolean;
+        /**
+         * Returns the display object in the container.
+         *
+         * @method getChildByName
+         * @memberof PIXI.Container#
+         * @param {string} name - Instance name.
+         * @return {PIXI.DisplayObject} The child with the specified name.
+         */
+        getChildByName(name: string): PIXI.DisplayObject;
+        /**
+         *  Flag for if the object is accessible. If true AccessibilityManager will overlay a
+         *   shadow div with attributes set
+         *
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessible: boolean;
+        /**
+         * Sets the title attribute of the shadow div
+         * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
+         *
+         * @member {?string}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessibleTitle: string;
+        /**
+         * Sets the aria-label attribute of the shadow div
+         *
+         * @member {string}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessibleHint: string;
+        /**
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         * @todo Needs docs.
+         */
+        _accessibleActive: boolean;
+        /**
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         * @todo Needs docs.
+         */
+        _accessibleDiv: boolean;
+        /**
+         * World transform and local transform of this object.
+         * This will become read-only later, please do not assign anything there unless you know what are you doing.
+         *
+         * @member {PIXI.Transform} PIXI.DisplayObject#transform
+         */
+        transform: PIXI.Transform;
+        /**
+         * The opacity of the object.
+         *
+         * @member {number} PIXI.DisplayObject#alpha
+         */
+        alpha: number;
+        /**
+         * The visibility of the object. If false the object will not be drawn, and
+         * the updateTransform function will not be called.
+         *
+         * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
+         *
+         * @member {boolean} PIXI.DisplayObject#visible
+         */
+        visible: boolean;
+        /**
+         * Can this object be rendered, if false the object will not be drawn but the updateTransform
+         * methods will still be called.
+         *
+         * Only affects recursive calls from parent. You can ask for bounds manually.
+         *
+         * @member {boolean} PIXI.DisplayObject#renderable
+         */
+        renderable: boolean;
+        /**
+         * The display object container that contains this display object.
+         *
+         * @member {PIXI.Container} PIXI.DisplayObject#parent
+         * @readonly
+         */
+        readonly parent: PIXI.Container;
+        /**
+         * The multiplied alpha of the displayObject.
+         *
+         * @member {number} PIXI.DisplayObject#worldAlpha
+         * @readonly
+         */
+        readonly worldAlpha: number;
+        /**
+         * Which index in the children array the display component was before the previous zIndex sort.
+         * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
+         *
+         * @member {number} PIXI.DisplayObject#_lastSortedIndex
+         * @protected
+         */
+        protected _lastSortedIndex: number;
+        /**
+         * The zIndex of the displayObject.
+         * A higher value will mean it will be rendered on top of other displayObjects within the same container.
+         *
+         * @member {number} PIXI.DisplayObject#_zIndex
+         * @protected
+         */
+        protected _zIndex: number;
+        /**
+         * The area the filter is applied to. This is used as more of an optimization
+         * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
+         *
+         * Also works as an interaction mask.
+         *
+         * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
+         */
+        filterArea: PIXI.Rectangle;
+        /**
+         * Sets the filters for the displayObject.
+         * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
+         * To remove filters simply set this property to `'null'`.
+         *
+         * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
+         */
+        filters: PIXI.Filter[];
+        /**
+         * The bounds object, this is used to calculate and store the bounds of the displayObject.
+         *
+         * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
+         * @protected
+         */
+        protected _bounds: PIXI.Bounds;
+        /**
+         * The original, cached mask of the object.
+         *
+         * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask
+         * @protected
+         */
+        protected _mask: PIXI.Graphics | PIXI.Sprite;
+        /**
+         * If the object has been destroyed via destroy(). If true, it should not be used.
+         *
+         * @member {boolean} PIXI.DisplayObject#_destroyed
+         * @protected
+         */
+        protected _destroyed: boolean;
+        /**
+         * used to fast check if a sprite is.. a sprite!
+         * @member {boolean} PIXI.DisplayObject#isSprite
+         */
+        isSprite: boolean;
+        /**
+         * @protected
+         * @member {PIXI.DisplayObject}
+         */
+        protected _tempDisplayObjectParent: PIXI.DisplayObject;
+        /**
+         * Recursively updates transform of all objects from the root to this one
+         * internal function for toLocal()
+         */
+        _recursivePostUpdateTransform(): void;
+        /**
+         * Retrieves the bounds of the displayObject as a rectangle object.
+         *
+         * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
+         *  being updated. This means the calculation returned MAY be out of date BUT will give you a
+         *  nice performance boost.
+         * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
+         * @return {PIXI.Rectangle} The rectangular bounding area.
+         */
+        getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * Retrieves the local bounds of the displayObject as a rectangle object.
+         *
+         * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
+         * @return {PIXI.Rectangle} The rectangular bounding area.
+         */
+        getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * Calculates the global position of the display object.
+         *
+         * @param {PIXI.IPoint} position - The world origin to calculate from.
+         * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional
+         *  (otherwise will create a new Point).
+         * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
+         * @return {PIXI.IPoint} A point object representing the position of this object.
+         */
+        toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint;
+        /**
+         * Calculates the local position of the display object relative to another point.
+         *
+         * @param {PIXI.IPoint} position - The world origin to calculate from.
+         * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
+         * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional
+         *  (otherwise will create a new Point).
+         * @param {boolean} [skipUpdate=false] - Should we skip the update transform
+         * @return {PIXI.IPoint} A point object representing the position of this object
+         */
+        toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint;
+        /**
+         * Set the parent Container of this DisplayObject.
+         *
+         * @param {PIXI.Container} container - The Container to add this DisplayObject to.
+         * @return {PIXI.Container} The Container that this DisplayObject was added to.
+         */
+        setParent(container: PIXI.Container): PIXI.Container;
+        /**
+         * Convenience function to set the position, scale, skew and pivot at once.
+         *
+         * @param {number} [x=0] - The X position
+         * @param {number} [y=0] - The Y position
+         * @param {number} [scaleX=1] - The X scale value
+         * @param {number} [scaleY=1] - The Y scale value
+         * @param {number} [rotation=0] - The rotation
+         * @param {number} [skewX=0] - The X skew value
+         * @param {number} [skewY=0] - The Y skew value
+         * @param {number} [pivotX=0] - The X pivot value
+         * @param {number} [pivotY=0] - The Y pivot value
+         * @return {PIXI.DisplayObject} The DisplayObject instance
+         */
+        setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
+        /**
+         * The position of the displayObject on the x axis relative to the local coordinates of the parent.
+         * An alias to position.x
+         *
+         * @member {number}
+         */
+        x: number;
+        /**
+         * The position of the displayObject on the y axis relative to the local coordinates of the parent.
+         * An alias to position.y
+         *
+         * @member {number}
+         */
+        y: number;
+        /**
+         * Current transform of the object based on world (parent) factors.
+         *
+         * @member {PIXI.Matrix}
+         * @readonly
+         */
+        readonly worldTransform: PIXI.Matrix;
+        /**
+         * Current transform of the object based on local factors: position, scale, other stuff.
+         *
+         * @member {PIXI.Matrix}
+         * @readonly
+         */
+        readonly localTransform: PIXI.Matrix;
+        /**
+         * The coordinate of the object relative to the local coordinates of the parent.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        position: PIXI.IPoint;
+        /**
+         * The scale factor of the object.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        scale: PIXI.IPoint;
+        /**
+         * The pivot point of the displayObject that it rotates around.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        pivot: PIXI.IPoint;
+        /**
+         * The skew factor for the object in radians.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.ObservablePoint}
+         */
+        skew: PIXI.ObservablePoint;
+        /**
+         * The rotation of the object in radians.
+         * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
+         *
+         * @member {number}
+         */
+        rotation: number;
+        /**
+         * The angle of the object in degrees.
+         * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
+         *
+         * @member {number}
+         */
+        angle: number;
+        /**
+         * The zIndex of the displayObject.
+         * If a container has the sortableChildren property set to true, children will be automatically
+         * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
+         * and thus rendered on top of other displayObjects within the same container.
+         *
+         * @member {number}
+         */
+        zIndex: number;
+        /**
+         * Indicates if the object is globally visible.
+         *
+         * @member {boolean}
+         * @readonly
+         */
+        readonly worldVisible: boolean;
+        /**
+         * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
+         * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
+         * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
+         * utilities shape clipping. To remove a mask, set this property to `null`.
+         *
+         * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
+         * @example
+         * const graphics = new PIXI.Graphics();
+         * graphics.beginFill(0xFF3300);
+         * graphics.drawRect(50, 250, 100, 100);
+         * graphics.endFill();
+         *
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.mask = graphics;
+         * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
+         *
+         * @member {PIXI.Graphics|PIXI.Sprite}
+         */
+        mask: PIXI.Graphics | PIXI.Sprite;
+        /**
+         * Enable interaction events for the DisplayObject. Touch, pointer and mouse
+         * events will not be emitted unless `interactive` is set to `true`.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.on('tap', (event) => {
+         *    //handle event
+         * });
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        interactive: boolean;
+        /**
+         * Interaction shape. Children will be hit first, then this shape will be checked.
+         * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
+         * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle}
+         * @memberof PIXI.DisplayObject#
+         */
+        hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle;
+        /**
+         * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
+         * Setting this changes the 'cursor' property to `'pointer'`.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.buttonMode = true;
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        buttonMode: boolean;
+        /**
+         * This defines what cursor mode is used when the mouse cursor
+         * is hovered over the displayObject.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.cursor = 'wait';
+         * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
+         *
+         * @member {string}
+         * @memberof PIXI.DisplayObject#
+         */
+        cursor: string;
+        /**
+         * Set this to true if you want this display object to be cached as a bitmap.
+         * This basically takes a snap shot of the display object as it is at that moment. It can
+         * provide a performance benefit for complex static displayObjects.
+         * To remove simply set this property to `false`
+         *
+         * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
+         * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
+         *
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        cacheAsBitmap: boolean;
+        /**
+         * The instance name of the object.
+         *
+         * @memberof PIXI.DisplayObject#
+         * @member {string} name
+         */
+        name: string;
+        /**
+         * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
+         *
+         * @method getGlobalPosition
+         * @memberof PIXI.DisplayObject#
+         * @param {Point} point - The point to write the global value to. If null a new point will be returned
+         * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from
+         *  being updated. This means the calculation returned MAY be out of date BUT will give you a
+         *  nice performance boost.
+         * @return {Point} The updated point.
+         */
+        getGlobalPosition(point: Point, skipUpdate: boolean): Point;
+    }
+    /**
+     * The base class for all objects that are rendered on the screen.
+     *
+     * This is an abstract class and should not be used on its own; rather it should be extended.
+     *
+     * @class
+     * @extends PIXI.utils.EventEmitter
+     * @memberof PIXI
+     */
+    class DisplayObject extends PIXI.utils.EventEmitter {
+        constructor();
+        /**
+         * @method PIXI.DisplayObject#renderWebGL
+         * @deprecated since 5.0.0
+         * @see PIXI.DisplayObject#render
+         * @param {PIXI.Renderer} renderer Instance of renderer
+         */
+        renderWebGL(renderer: PIXI.Renderer): void;
+        /**
+         *  Flag for if the object is accessible. If true AccessibilityManager will overlay a
+         *   shadow div with attributes set
+         *
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessible: boolean;
+        /**
+         * Sets the title attribute of the shadow div
+         * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
+         *
+         * @member {?string}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessibleTitle: string;
+        /**
+         * Sets the aria-label attribute of the shadow div
+         *
+         * @member {string}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessibleHint: string;
+        /**
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         * @todo Needs docs.
+         */
+        _accessibleActive: boolean;
+        /**
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         * @todo Needs docs.
+         */
+        _accessibleDiv: boolean;
+        /**
+         * Mixes all enumerable properties and methods from a source object to DisplayObject.
+         *
+         * @param {object} source The source of properties and methods to mix in.
+         */
+        static mixin(source: any): void;
+        /**
+         * World transform and local transform of this object.
+         * This will become read-only later, please do not assign anything there unless you know what are you doing.
+         *
+         * @member {PIXI.Transform} PIXI.DisplayObject#transform
+         */
+        transform: PIXI.Transform;
+        /**
+         * The opacity of the object.
+         *
+         * @member {number} PIXI.DisplayObject#alpha
+         */
+        alpha: number;
+        /**
+         * The visibility of the object. If false the object will not be drawn, and
+         * the updateTransform function will not be called.
+         *
+         * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
+         *
+         * @member {boolean} PIXI.DisplayObject#visible
+         */
+        visible: boolean;
+        /**
+         * Can this object be rendered, if false the object will not be drawn but the updateTransform
+         * methods will still be called.
+         *
+         * Only affects recursive calls from parent. You can ask for bounds manually.
+         *
+         * @member {boolean} PIXI.DisplayObject#renderable
+         */
+        renderable: boolean;
+        /**
+         * The display object container that contains this display object.
+         *
+         * @member {PIXI.Container} PIXI.DisplayObject#parent
+         * @readonly
+         */
+        readonly parent: PIXI.Container;
+        /**
+         * The multiplied alpha of the displayObject.
+         *
+         * @member {number} PIXI.DisplayObject#worldAlpha
+         * @readonly
+         */
+        readonly worldAlpha: number;
+        /**
+         * Which index in the children array the display component was before the previous zIndex sort.
+         * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
+         *
+         * @member {number} PIXI.DisplayObject#_lastSortedIndex
+         * @protected
+         */
+        protected _lastSortedIndex: number;
+        /**
+         * The zIndex of the displayObject.
+         * A higher value will mean it will be rendered on top of other displayObjects within the same container.
+         *
+         * @member {number} PIXI.DisplayObject#_zIndex
+         * @protected
+         */
+        protected _zIndex: number;
+        /**
+         * The area the filter is applied to. This is used as more of an optimization
+         * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
+         *
+         * Also works as an interaction mask.
+         *
+         * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
+         */
+        filterArea: PIXI.Rectangle;
+        /**
+         * Sets the filters for the displayObject.
+         * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
+         * To remove filters simply set this property to `'null'`.
+         *
+         * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
+         */
+        filters: PIXI.Filter[];
+        /**
+         * The bounds object, this is used to calculate and store the bounds of the displayObject.
+         *
+         * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
+         * @protected
+         */
+        protected _bounds: PIXI.Bounds;
+        /**
+         * The original, cached mask of the object.
+         *
+         * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask
+         * @protected
+         */
+        protected _mask: PIXI.Graphics | PIXI.Sprite;
+        /**
+         * If the object has been destroyed via destroy(). If true, it should not be used.
+         *
+         * @member {boolean} PIXI.DisplayObject#_destroyed
+         * @protected
+         */
+        protected _destroyed: boolean;
+        /**
+         * used to fast check if a sprite is.. a sprite!
+         * @member {boolean} PIXI.DisplayObject#isSprite
+         */
+        isSprite: boolean;
+        /**
+         * @protected
+         * @member {PIXI.DisplayObject}
+         */
+        protected _tempDisplayObjectParent: PIXI.DisplayObject;
+        /**
+         * Updates the object transform for rendering.
+         *
+         * TODO - Optimization pass!
+         */
+        updateTransform(): void;
+        /**
+         * Recursively updates transform of all objects from the root to this one
+         * internal function for toLocal()
+         */
+        _recursivePostUpdateTransform(): void;
+        /**
+         * Retrieves the bounds of the displayObject as a rectangle object.
+         *
+         * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
+         *  being updated. This means the calculation returned MAY be out of date BUT will give you a
+         *  nice performance boost.
+         * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
+         * @return {PIXI.Rectangle} The rectangular bounding area.
+         */
+        getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * Retrieves the local bounds of the displayObject as a rectangle object.
+         *
+         * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
+         * @return {PIXI.Rectangle} The rectangular bounding area.
+         */
+        getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * Calculates the global position of the display object.
+         *
+         * @param {PIXI.IPoint} position - The world origin to calculate from.
+         * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional
+         *  (otherwise will create a new Point).
+         * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
+         * @return {PIXI.IPoint} A point object representing the position of this object.
+         */
+        toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint;
+        /**
+         * Calculates the local position of the display object relative to another point.
+         *
+         * @param {PIXI.IPoint} position - The world origin to calculate from.
+         * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
+         * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional
+         *  (otherwise will create a new Point).
+         * @param {boolean} [skipUpdate=false] - Should we skip the update transform
+         * @return {PIXI.IPoint} A point object representing the position of this object
+         */
+        toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint;
+        /**
+         * Renders the object using the WebGL renderer.
+         *
+         * @param {PIXI.Renderer} renderer - The renderer.
+         */
+        render(renderer: PIXI.Renderer): void;
+        /**
+         * Set the parent Container of this DisplayObject.
+         *
+         * @param {PIXI.Container} container - The Container to add this DisplayObject to.
+         * @return {PIXI.Container} The Container that this DisplayObject was added to.
+         */
+        setParent(container: PIXI.Container): PIXI.Container;
+        /**
+         * Convenience function to set the position, scale, skew and pivot at once.
+         *
+         * @param {number} [x=0] - The X position
+         * @param {number} [y=0] - The Y position
+         * @param {number} [scaleX=1] - The X scale value
+         * @param {number} [scaleY=1] - The Y scale value
+         * @param {number} [rotation=0] - The rotation
+         * @param {number} [skewX=0] - The X skew value
+         * @param {number} [skewY=0] - The Y skew value
+         * @param {number} [pivotX=0] - The X pivot value
+         * @param {number} [pivotY=0] - The Y pivot value
+         * @return {PIXI.DisplayObject} The DisplayObject instance
+         */
+        setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
+        /**
+         * Base destroy method for generic display objects. This will automatically
+         * remove the display object from its parent Container as well as remove
+         * all current event listeners and internal references. Do not use a DisplayObject
+         * after calling `destroy()`.
+         *
+         */
+        destroy(): void;
+        /**
+         * The position of the displayObject on the x axis relative to the local coordinates of the parent.
+         * An alias to position.x
+         *
+         * @member {number}
+         */
+        x: number;
+        /**
+         * The position of the displayObject on the y axis relative to the local coordinates of the parent.
+         * An alias to position.y
+         *
+         * @member {number}
+         */
+        y: number;
+        /**
+         * Current transform of the object based on world (parent) factors.
+         *
+         * @member {PIXI.Matrix}
+         * @readonly
+         */
+        readonly worldTransform: PIXI.Matrix;
+        /**
+         * Current transform of the object based on local factors: position, scale, other stuff.
+         *
+         * @member {PIXI.Matrix}
+         * @readonly
+         */
+        readonly localTransform: PIXI.Matrix;
+        /**
+         * The coordinate of the object relative to the local coordinates of the parent.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        position: PIXI.IPoint;
+        /**
+         * The scale factor of the object.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        scale: PIXI.IPoint;
+        /**
+         * The pivot point of the displayObject that it rotates around.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        pivot: PIXI.IPoint;
+        /**
+         * The skew factor for the object in radians.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.ObservablePoint}
+         */
+        skew: PIXI.ObservablePoint;
+        /**
+         * The rotation of the object in radians.
+         * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
+         *
+         * @member {number}
+         */
+        rotation: number;
+        /**
+         * The angle of the object in degrees.
+         * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
+         *
+         * @member {number}
+         */
+        angle: number;
+        /**
+         * The zIndex of the displayObject.
+         * If a container has the sortableChildren property set to true, children will be automatically
+         * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
+         * and thus rendered on top of other displayObjects within the same container.
+         *
+         * @member {number}
+         */
+        zIndex: number;
+        /**
+         * Indicates if the object is globally visible.
+         *
+         * @member {boolean}
+         * @readonly
+         */
+        readonly worldVisible: boolean;
+        /**
+         * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
+         * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
+         * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
+         * utilities shape clipping. To remove a mask, set this property to `null`.
+         *
+         * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
+         * @example
+         * const graphics = new PIXI.Graphics();
+         * graphics.beginFill(0xFF3300);
+         * graphics.drawRect(50, 250, 100, 100);
+         * graphics.endFill();
+         *
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.mask = graphics;
+         * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
+         *
+         * @member {PIXI.Graphics|PIXI.Sprite}
+         */
+        mask: PIXI.Graphics | PIXI.Sprite;
+        /**
+         * Enable interaction events for the DisplayObject. Touch, pointer and mouse
+         * events will not be emitted unless `interactive` is set to `true`.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.on('tap', (event) => {
+         *    //handle event
+         * });
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        interactive: boolean;
+        /**
+         * Interaction shape. Children will be hit first, then this shape will be checked.
+         * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
+         * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle}
+         * @memberof PIXI.DisplayObject#
+         */
+        hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle;
+        /**
+         * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
+         * Setting this changes the 'cursor' property to `'pointer'`.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.buttonMode = true;
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        buttonMode: boolean;
+        /**
+         * This defines what cursor mode is used when the mouse cursor
+         * is hovered over the displayObject.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.cursor = 'wait';
+         * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
+         *
+         * @member {string}
+         * @memberof PIXI.DisplayObject#
+         */
+        cursor: string;
+        /**
+         * Set this to true if you want this display object to be cached as a bitmap.
+         * This basically takes a snap shot of the display object as it is at that moment. It can
+         * provide a performance benefit for complex static displayObjects.
+         * To remove simply set this property to `false`
+         *
+         * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
+         * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
+         *
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        cacheAsBitmap: boolean;
+        /**
+         * The instance name of the object.
+         *
+         * @memberof PIXI.DisplayObject#
+         * @member {string} name
+         */
+        name: string;
+        /**
+         * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
+         *
+         * @method getGlobalPosition
+         * @memberof PIXI.DisplayObject#
+         * @param {Point} point - The point to write the global value to. If null a new point will be returned
+         * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from
+         *  being updated. This means the calculation returned MAY be out of date BUT will give you a
+         *  nice performance boost.
+         * @return {Point} The updated point.
+         */
+        getGlobalPosition(point: Point, skipUpdate: boolean): Point;
+    }
+    /**
+     * This namespace provides renderer-specific plugins for exporting content from a renderer.
+     * For instance, these plugins can be used for saving an Image, Canvas element or for exporting the raw image data (pixels).
+     *
+     * Do not instantiate these plugins directly. It is available from the `renderer.plugins` property.
+     * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.
+     * @example
+     * // Create a new app (will auto-add extract plugin to renderer)
+     * const app = new PIXI.Application();
+     *
+     * // Draw a red circle
+     * const graphics = new PIXI.Graphics()
+     *     .beginFill(0xFF0000)
+     *     .drawCircle(0, 0, 50);
+     *
+     * // Render the graphics as an HTMLImageElement
+     * const image = app.renderer.plugins.extract.image(graphics);
+     * document.body.appendChild(image);
+     * @namespace PIXI.extract
+     */
+    namespace extract {
+        /**
+         * @class PIXI.extract.WebGLExtract
+         * @deprecated since 5.0.0
+         * @see PIXI.extract.Extract
+         */
+        class WebGLExtract {
+        }
+        /**
+         * The extract manager provides functionality to export content from the renderers.
+         *
+         * An instance of this class is automatically created by default, and can be found at `renderer.plugins.extract`
+         *
+         * @class
+         * @memberof PIXI.extract
+         */
+        class CanvasExtract {
+            constructor(renderer: PIXI.CanvasRenderer);
+            /**
+             * Will return a HTML Image of the target
+             *
+             * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
+             *  to convert. If left empty will use the main renderer
+             * @param {string} [format] - Image format, e.g. "image/jpeg" or "image/webp".
+             * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.
+             * @return {HTMLImageElement} HTML Image of the target
+             */
+            image(target: PIXI.DisplayObject | PIXI.RenderTexture, format?: string, quality?: number): HTMLImageElement;
+            /**
+             * Will return a a base64 encoded string of this target. It works by calling
+             *  `CanvasExtract.getCanvas` and then running toDataURL on that.
+             *
+             * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
+             *  to convert. If left empty will use the main renderer
+             * @param {string} [format] - Image format, e.g. "image/jpeg" or "image/webp".
+             * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.
+             * @return {string} A base64 encoded string of the texture.
+             */
+            base64(target: PIXI.DisplayObject | PIXI.RenderTexture, format?: string, quality?: number): string;
+            /**
+             * Creates a Canvas element, renders this target to it and then returns it.
+             *
+             * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
+             *  to convert. If left empty will use the main renderer
+             * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.
+             */
+            canvas(target: PIXI.DisplayObject | PIXI.RenderTexture): HTMLCanvasElement;
+            /**
+             * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA
+             * order, with integer values between 0 and 255 (included).
+             *
+             * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
+             *  to convert. If left empty will use the main renderer
+             * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture
+             */
+            pixels(target: PIXI.DisplayObject | PIXI.RenderTexture): Uint8ClampedArray;
+            /**
+             * Destroys the extract
+             *
+             */
+            destroy(): void;
+        }
+        /**
+         * The extract manager provides functionality to export content from the renderers.
+         *
+         * An instance of this class is automatically created by default, and can be found at `renderer.plugins.extract`
+         *
+         * @class
+         * @memberof PIXI.extract
+         */
+        class Extract {
+            constructor(renderer: PIXI.Renderer);
+            /**
+             * Will return a HTML Image of the target
+             *
+             * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
+             *  to convert. If left empty will use the main renderer
+             * @param {string} [format] - Image format, e.g. "image/jpeg" or "image/webp".
+             * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.
+             * @return {HTMLImageElement} HTML Image of the target
+             */
+            image(target: PIXI.DisplayObject | PIXI.RenderTexture, format?: string, quality?: number): HTMLImageElement;
+            /**
+             * Will return a a base64 encoded string of this target. It works by calling
+             *  `Extract.getCanvas` and then running toDataURL on that.
+             *
+             * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
+             *  to convert. If left empty will use the main renderer
+             * @param {string} [format] - Image format, e.g. "image/jpeg" or "image/webp".
+             * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.
+             * @return {string} A base64 encoded string of the texture.
+             */
+            base64(target: PIXI.DisplayObject | PIXI.RenderTexture, format?: string, quality?: number): string;
+            /**
+             * Creates a Canvas element, renders this target to it and then returns it.
+             *
+             * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
+             *  to convert. If left empty will use the main renderer
+             * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.
+             */
+            canvas(target: PIXI.DisplayObject | PIXI.RenderTexture): HTMLCanvasElement;
+            /**
+             * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA
+             * order, with integer values between 0 and 255 (included).
+             *
+             * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture
+             *  to convert. If left empty will use the main renderer
+             * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture
+             */
+            pixels(target: PIXI.DisplayObject | PIXI.RenderTexture): Uint8ClampedArray;
+            /**
+             * Destroys the extract
+             *
+             */
+            destroy(): void;
+        }
+    }
+    /**
+     * Graphics curves resolution settings. If `adaptive` flag is set to `true`,
+     * the resolution is calculated based on the curve's length to ensure better visual quality.
+     * Adaptive draw works with `bezierCurveTo` and `quadraticCurveTo`.
+     *
+     * @static
+     * @constant
+     * @memberof PIXI
+     * @name GRAPHICS_CURVES
+     * @type {object}
+     * @property {boolean} adaptive=false - flag indicating if the resolution should be adaptive
+     * @property {number} maxLength=10 - maximal length of a single segment of the curve (if adaptive = false, ignored)
+     * @property {number} minSegments=8 - minimal number of segments in the curve (if adaptive = false, ignored)
+     * @property {number} maxSegments=2048 - maximal number of segments in the curve (if adaptive = false, ignored)
+     */
+    var GRAPHICS_CURVES: {
+        adaptive: boolean;
+        maxLength: number;
+        minSegments: number;
+        maxSegments: number;
+    };
+    /**
+     * The Graphics class contains methods used to draw primitive shapes such as lines, circles and
+     * rectangles to the display, and to color and fill them.
+     *
+     * Note that because Graphics can share a GraphicsGeometry with other instances,
+     * it is necessary to call `destroy()` to properly dereference the underlying
+     * GraphicsGeometry and avoid a memory leak. Alternatively, keep using the same
+     * Graphics instance and call `clear()` between redraws.
+     *
+     * @class
+     * @extends PIXI.Container
+     * @memberof PIXI
+     */
+    class Graphics extends PIXI.Container {
+        constructor(geometry?: PIXI.GraphicsGeometry);
+        /**
+         * Generates a canvas texture. Only available with **pixi.js-legacy** bundle
+         * or the **@pixi/canvas-graphics** package.
+         * @method generateCanvasTexture
+         * @memberof PIXI.Graphics#
+         * @param {number} scaleMode - The scale mode of the texture.
+         * @param {number} resolution - The resolution of the texture.
+         * @return {PIXI.Texture} The new texture.
+         */
+        generateCanvasTexture(scaleMode: number, resolution: number): PIXI.Texture;
+        /**
+         * Includes vertex positions, face indices, normals, colors, UVs, and
+         * custom attributes within buffers, reducing the cost of passing all
+         * this data to the GPU. Can be shared between multiple Mesh or Graphics objects.
+         * @member {PIXI.GraphicsGeometry} PIXI.Graphics#geometry
+         * @readonly
+         */
+        readonly geometry: PIXI.GraphicsGeometry;
+        /**
+         * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.
+         * Can be shared between multiple Graphics objects.
+         * @member {PIXI.Shader} PIXI.Graphics#shader
+         */
+        shader: PIXI.Shader;
+        /**
+         * Represents the WebGL state the Graphics required to render, excludes shader and geometry. E.g.,
+         * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.
+         * @member {PIXI.State} PIXI.Graphics#state
+         */
+        state: PIXI.State;
+        /**
+         * Current fill style
+         *
+         * @member {PIXI.FillStyle} PIXI.Graphics#_fillStyle
+         * @protected
+         */
+        protected _fillStyle: PIXI.FillStyle;
+        /**
+         * Current line style
+         *
+         * @member {PIXI.LineStyle} PIXI.Graphics#_lineStyle
+         * @protected
+         */
+        protected _lineStyle: PIXI.LineStyle;
+        /**
+         * Current shape transform matrix.
+         *
+         * @member {PIXI.Matrix} PIXI.Graphics#_matrix
+         * @protected
+         */
+        protected _matrix: PIXI.Matrix;
+        /**
+         * Current hole mode is enabled.
+         *
+         * @member {boolean} PIXI.Graphics#_holeMode
+         * @default false
+         * @protected
+         */
+        protected _holeMode: boolean;
+        /**
+         * Current path
+         *
+         * @member {PIXI.Polygon} PIXI.Graphics#currentPath
+         * @protected
+         */
+        protected currentPath: PIXI.Polygon;
+        /**
+         * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.
+         * This is useful if your graphics element does not change often, as it will speed up the rendering
+         * of the object in exchange for taking up texture memory. It is also useful if you need the graphics
+         * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if
+         * you are constantly redrawing the graphics element.
+         *
+         * @name cacheAsBitmap
+         * @member {boolean}
+         * @memberof PIXI.Graphics#
+         * @default false
+         */
+        cacheAsBitmap: boolean;
+        /**
+         * A collections of batches! These can be drawn by the renderer batch system.
+         *
+         * @protected
+         * @member {object[]} PIXI.Graphics#batches
+         */
+        protected batches: any[];
+        /**
+         * Update dirty for limiting calculating tints for batches.
+         *
+         * @protected
+         * @member {number} PIXI.Graphics#batchTint
+         * @default -1
+         */
+        protected batchTint: number;
+        /**
+         * Copy of the object vertex data.
+         *
+         * @protected
+         * @member {Float32Array} PIXI.Graphics#vertexData
+         */
+        protected vertexData: Float32Array;
+        /**
+         * Creates a new Graphics object with the same values as this one.
+         * Note that the only the properties of the object are cloned, not its transform (position,scale,etc)
+         *
+         * @return {PIXI.Graphics} A clone of the graphics object
+         */
+        clone(): PIXI.Graphics;
+        /**
+         * The blend mode to be applied to the graphic shape. Apply a value of
+         * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
+         *
+         * @member {number}
+         * @default PIXI.BLEND_MODES.NORMAL;
+         * @see PIXI.BLEND_MODES
+         */
+        blendMode: number;
+        /**
+         * The tint applied to the graphic shape. This is a hex value. A value of
+         * 0xFFFFFF will remove any tint effect.
+         *
+         * @member {number}
+         * @default 0xFFFFFF
+         */
+        tint: number;
+        /**
+         * The current fill style.
+         *
+         * @member {PIXI.FillStyle}
+         * @readonly
+         */
+        readonly fill: PIXI.FillStyle;
+        /**
+         * The current line style.
+         *
+         * @member {PIXI.LineStyle}
+         * @readonly
+         */
+        readonly line: PIXI.LineStyle;
+        /**
+         * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()
+         * method or the drawCircle() method.
+         *
+         * @param {number} [width=0] - width of the line to draw, will update the objects stored style
+         * @param {number} [color=0] - color of the line to draw, will update the objects stored style
+         * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style
+         * @param {number} [alignment=1] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)
+         * @param {boolean} [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        lineStyle(width?: number, color?: number, alpha?: number, alignment?: number, native?: boolean): PIXI.Graphics;
+        /**
+         * Like line style but support texture for line fill.
+         *
+         * @param {number} [width=0] - width of the line to draw, will update the objects stored style
+         * @param {PIXI.Texture} [texture=PIXI.Texture.WHITE] - Texture to use
+         * @param {number} [color=0] - color of the line to draw, will update the objects stored style
+         * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style
+         * @param {PIXI.Matrix} [matrix=null] Texture matrix to transform texture
+         * @param {number} [alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)
+         * @param {boolean} [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        lineTextureStyle(width?: number, texture?: PIXI.Texture, color?: number, alpha?: number, matrix?: PIXI.Matrix, alignment?: number, native?: boolean): PIXI.Graphics;
+        /**
+         * Start a polygon object internally
+         * @protected
+         */
+        protected startPoly(): void;
+        /**
+         * Finish the polygon object.
+         * @protected
+         */
+        protected finishPoly(): void;
+        /**
+         * Moves the current drawing position to x, y.
+         *
+         * @param {number} x - the X coordinate to move to
+         * @param {number} y - the Y coordinate to move to
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        moveTo(x: number, y: number): PIXI.Graphics;
+        /**
+         * Draws a line using the current line style from the current drawing position to (x, y);
+         * The current drawing position is then set to (x, y).
+         *
+         * @param {number} x - the X coordinate to draw to
+         * @param {number} y - the Y coordinate to draw to
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        lineTo(x: number, y: number): PIXI.Graphics;
+        /**
+         * Initialize the curve
+         *
+         * @protected
+         * @param {number} [x=0]
+         * @param {number} [y=0]
+         */
+        protected _initCurve(x?: number, y?: number): void;
+        /**
+         * Calculate the points for a quadratic bezier curve and then draws it.
+         * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
+         *
+         * @param {number} cpX - Control point x
+         * @param {number} cpY - Control point y
+         * @param {number} toX - Destination point x
+         * @param {number} toY - Destination point y
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): PIXI.Graphics;
+        /**
+         * Calculate the points for a bezier curve and then draws it.
+         *
+         * @param {number} cpX - Control point x
+         * @param {number} cpY - Control point y
+         * @param {number} cpX2 - Second Control point x
+         * @param {number} cpY2 - Second Control point y
+         * @param {number} toX - Destination point x
+         * @param {number} toY - Destination point y
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): PIXI.Graphics;
+        /**
+         * The arcTo() method creates an arc/curve between two tangents on the canvas.
+         *
+         * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google!
+         *
+         * @param {number} x1 - The x-coordinate of the beginning of the arc
+         * @param {number} y1 - The y-coordinate of the beginning of the arc
+         * @param {number} x2 - The x-coordinate of the end of the arc
+         * @param {number} y2 - The y-coordinate of the end of the arc
+         * @param {number} radius - The radius of the arc
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): PIXI.Graphics;
+        /**
+         * The arc method creates an arc/curve (used to create circles, or parts of circles).
+         *
+         * @param {number} cx - The x-coordinate of the center of the circle
+         * @param {number} cy - The y-coordinate of the center of the circle
+         * @param {number} radius - The radius of the circle
+         * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position
+         *  of the arc's circle)
+         * @param {number} endAngle - The ending angle, in radians
+         * @param {boolean} [anticlockwise=false] - Specifies whether the drawing should be
+         *  counter-clockwise or clockwise. False is default, and indicates clockwise, while true
+         *  indicates counter-clockwise.
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): PIXI.Graphics;
+        /**
+         * Specifies a simple one-color fill that subsequent calls to other Graphics methods
+         * (such as lineTo() or drawCircle()) use when drawing.
+         *
+         * @param {number} [color=0] - the color of the fill
+         * @param {number} [alpha=1] - the alpha of the fill
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        beginFill(color?: number, alpha?: number): PIXI.Graphics;
+        /**
+         * Begin the texture fill
+         *
+         * @param {PIXI.Texture} [texture=PIXI.Texture.WHITE] - Texture to fill
+         * @param {number} [color=0xffffff] - Background to fill behind texture
+         * @param {number} [alpha=1] - Alpha of fill
+         * @param {PIXI.Matrix} [matrix=null] - Transform matrix
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        beginTextureFill(texture?: PIXI.Texture, color?: number, alpha?: number, matrix?: PIXI.Matrix): PIXI.Graphics;
+        /**
+         * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.
+         *
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        endFill(): PIXI.Graphics;
+        /**
+         * Draws a rectangle shape.
+         *
+         * @param {number} x - The X coord of the top-left of the rectangle
+         * @param {number} y - The Y coord of the top-left of the rectangle
+         * @param {number} width - The width of the rectangle
+         * @param {number} height - The height of the rectangle
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        drawRect(x: number, y: number, width: number, height: number): PIXI.Graphics;
+        /**
+         * Draw a rectangle shape with rounded/beveled corners.
+         *
+         * @param {number} x - The X coord of the top-left of the rectangle
+         * @param {number} y - The Y coord of the top-left of the rectangle
+         * @param {number} width - The width of the rectangle
+         * @param {number} height - The height of the rectangle
+         * @param {number} radius - Radius of the rectangle corners
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): PIXI.Graphics;
+        /**
+         * Draws a circle.
+         *
+         * @param {number} x - The X coordinate of the center of the circle
+         * @param {number} y - The Y coordinate of the center of the circle
+         * @param {number} radius - The radius of the circle
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        drawCircle(x: number, y: number, radius: number): PIXI.Graphics;
+        /**
+         * Draws an ellipse.
+         *
+         * @param {number} x - The X coordinate of the center of the ellipse
+         * @param {number} y - The Y coordinate of the center of the ellipse
+         * @param {number} width - The half width of the ellipse
+         * @param {number} height - The half height of the ellipse
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        drawEllipse(x: number, y: number, width: number, height: number): PIXI.Graphics;
+        /**
+         * Draws a polygon using the given path.
+         *
+         * @param {number[]|PIXI.Point[]|PIXI.Polygon} path - The path data used to construct the polygon.
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        drawPolygon(path: number[] | PIXI.Point[] | PIXI.Polygon): PIXI.Graphics;
+        /**
+         * Draw any shape.
+         *
+         * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - Shape to draw
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        drawShape(shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle): PIXI.Graphics;
+        /**
+         * Draw a star shape with an arbitrary number of points.
+         *
+         * @param {number} x - Center X position of the star
+         * @param {number} y - Center Y position of the star
+         * @param {number} points - The number of points of the star, must be > 1
+         * @param {number} radius - The outer radius of the star
+         * @param {number} [innerRadius] - The inner radius between points, default half `radius`
+         * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        drawStar(x: number, y: number, points: number, radius: number, innerRadius?: number, rotation?: number): PIXI.Graphics;
+        /**
+         * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
+         *
+         * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+         */
+        clear(): PIXI.Graphics;
+        /**
+         * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and
+         * masked with gl.scissor.
+         *
+         * @returns {boolean} True if only 1 rect.
+         */
+        isFastRect(): boolean;
+        /**
+         * Renders the object using the WebGL renderer
+         *
+         * @protected
+         * @param {PIXI.Renderer} renderer - The renderer
+         */
+        protected _render(renderer: PIXI.Renderer): void;
+        /**
+         * Retrieves the bounds of the graphic shape as a rectangle object
+         *
+         * @protected
+         */
+        protected _calculateBounds(): void;
+        /**
+         * Tests if a point is inside this graphics object
+         *
+         * @param {PIXI.Point} point - the point to test
+         * @return {boolean} the result of the test
+         */
+        containsPoint(point: PIXI.Point): boolean;
+        /**
+         * Recalcuate the tint by applying tin to batches using Graphics tint.
+         * @protected
+         */
+        protected calculateTints(): void;
+        /**
+         * If there's a transform update or a change to the shape of the
+         * geometry, recaculate the vertices.
+         * @protected
+         */
+        protected calculateVertices(): void;
+        /**
+         * Closes the current path.
+         *
+         * @return {PIXI.Graphics} Returns itself.
+         */
+        closePath(): PIXI.Graphics;
+        /**
+         * Apply a matrix to the positional data.
+         *
+         * @param {PIXI.Matrix} matrix - Matrix to use for transform current shape.
+         * @return {PIXI.Graphics} Returns itself.
+         */
+        setMatrix(matrix: PIXI.Matrix): PIXI.Graphics;
+        /**
+         * Begin adding holes to the last draw shape
+         * IMPORTANT: holes must be fully inside a shape to work
+         * Also weirdness ensues if holes overlap!
+         * Ellipses, Circles, Rectangles and Rounded Rectangles cannot be holes or host for holes in CanvasRenderer,
+         * please use `moveTo` `lineTo`, `quadraticCurveTo` if you rely on pixi-legacy bundle.
+         * @return {PIXI.Graphics} Returns itself.
+         */
+        beginHole(): PIXI.Graphics;
+        /**
+         * End adding holes to the last draw shape
+         * @return {PIXI.Graphics} Returns itself.
+         */
+        endHole(): PIXI.Graphics;
+        /**
+         * Destroys the Graphics object.
+         *
+         * @param {object|boolean} [options] - Options parameter. A boolean will act as if all
+         *  options have been set to that value
+         * @param {boolean} [options.children=false] - if set to true, all the children will have
+         *  their destroy method called as well. 'options' will be passed on to those calls.
+         * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true
+         *  Should it destroy the texture of the child sprite
+         * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true
+         *  Should it destroy the base texture of the child sprite
+         */
+        destroy(options?: {
+            children?: boolean;
+            texture?: boolean;
+            baseTexture?: boolean;
+        }): void;
+        /**
+         * @method PIXI.Container#renderWebGL
+         * @deprecated since 5.0.0
+         * @see PIXI.Container#render
+         * @param {PIXI.Renderer} renderer Instance of renderer
+         */
+        renderWebGL(renderer: PIXI.Renderer): void;
+        /**
+         * @method PIXI.Container#renderAdvancedWebGL
+         * @deprecated since 5.0.0
+         * @see PIXI.Container#renderAdvanced
+         * @param {PIXI.Renderer} renderer Instance of renderer
+         */
+        renderAdvancedWebGL(renderer: PIXI.Renderer): void;
+        /**
+         * Renders the object using the Canvas renderer
+         * @method renderCanvas
+         * @memberof PIXI.Container#
+         * @param {PIXI.CanvasRenderer} renderer - The renderer
+         */
+        renderCanvas(renderer: PIXI.CanvasRenderer): void;
+        /**
+         * The array of children of this container.
+         *
+         * @member {PIXI.DisplayObject[]} PIXI.Container#children
+         * @readonly
+         */
+        readonly children: PIXI.DisplayObject[];
+        /**
+         * If set to true, the container will sort its children by zIndex value
+         * when updateTransform() is called, or manually if sortChildren() is called.
+         *
+         * This actually changes the order of elements in the array, so should be treated
+         * as a basic solution that is not performant compared to other solutions,
+         * such as @link https://github.com/pixijs/pixi-display
+         *
+         * Also be aware of that this may not work nicely with the addChildAt() function,
+         * as the zIndex sorting may cause the child to automatically sorted to another position.
+         *
+         * @see PIXI.settings.SORTABLE_CHILDREN
+         *
+         * @member {boolean} PIXI.Container#sortableChildren
+         */
+        sortableChildren: boolean;
+        /**
+         * Should children be sorted by zIndex at the next updateTransform call.
+         * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
+         *
+         * @member {boolean} PIXI.Container#sortDirty
+         */
+        sortDirty: boolean;
+        /**
+         * Overridable method that can be used by Container subclasses whenever the children array is modified
+         *
+         * @protected
+         */
+        protected onChildrenChange(): void;
+        /**
+         * Adds one or more children to the container.
+         *
+         * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
+         *
+         * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container
+         * @return {PIXI.DisplayObject} The first child that was added.
+         */
+        addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject;
+        /**
+         * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
+         *
+         * @param {PIXI.DisplayObject} child - The child to add
+         * @param {number} index - The index to place the child in
+         * @return {PIXI.DisplayObject} The child that was added.
+         */
+        addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject;
+        /**
+         * Swaps the position of 2 Display Objects within this container.
+         *
+         * @param {PIXI.DisplayObject} child - First display object to swap
+         * @param {PIXI.DisplayObject} child2 - Second display object to swap
+         */
+        swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
+        /**
+         * Returns the index position of a child DisplayObject instance
+         *
+         * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
+         * @return {number} The index position of the child display object to identify
+         */
+        getChildIndex(child: PIXI.DisplayObject): number;
+        /**
+         * Changes the position of an existing child in the display object container
+         *
+         * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
+         * @param {number} index - The resulting index number for the child display object
+         */
+        setChildIndex(child: PIXI.DisplayObject, index: number): void;
+        /**
+         * Returns the child at the specified index
+         *
+         * @param {number} index - The index to get the child at
+         * @return {PIXI.DisplayObject} The child at the given index, if any.
+         */
+        getChildAt(index: number): PIXI.DisplayObject;
+        /**
+         * Removes one or more children from the container.
+         *
+         * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove
+         * @return {PIXI.DisplayObject} The first child that was removed.
+         */
+        removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject;
+        /**
+         * Removes a child from the specified index position.
+         *
+         * @param {number} index - The index to get the child from
+         * @return {PIXI.DisplayObject} The child that was removed.
+         */
+        removeChildAt(index: number): PIXI.DisplayObject;
+        /**
+         * Removes all children from this container that are within the begin and end indexes.
+         *
+         * @param {number} [beginIndex=0] - The beginning position.
+         * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
+         * @returns {DisplayObject[]} List of removed children
+         */
+        removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[];
+        /**
+         * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
+         */
+        sortChildren(): void;
+        /**
+         * Updates the transform on all children of this container for rendering
+         */
+        updateTransform(): void;
+        /**
+         * Recalculates the bounds of the container.
+         *
+         */
+        calculateBounds(): void;
+        /**
+         * Renders the object using the WebGL renderer
+         *
+         * @param {PIXI.Renderer} renderer - The renderer
+         */
+        render(renderer: PIXI.Renderer): void;
+        /**
+         * Render the object using the WebGL renderer and advanced features.
+         *
+         * @protected
+         * @param {PIXI.Renderer} renderer - The renderer
+         */
+        protected renderAdvanced(renderer: PIXI.Renderer): void;
+        /**
+         * The width of the Container, setting this will actually modify the scale to achieve the value set
+         *
+         * @member {number}
+         */
+        width: number;
+        /**
+         * The height of the Container, setting this will actually modify the scale to achieve the value set
+         *
+         * @member {number}
+         */
+        height: number;
+        /**
+         * Determines if the children to the displayObject can be clicked/touched
+         * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
+         *
+         * @member {boolean}
+         * @memberof PIXI.Container#
+         */
+        interactiveChildren: boolean;
+        /**
+         * Returns the display object in the container.
+         *
+         * @method getChildByName
+         * @memberof PIXI.Container#
+         * @param {string} name - Instance name.
+         * @return {PIXI.DisplayObject} The child with the specified name.
+         */
+        getChildByName(name: string): PIXI.DisplayObject;
+        /**
+         *  Flag for if the object is accessible. If true AccessibilityManager will overlay a
+         *   shadow div with attributes set
+         *
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessible: boolean;
+        /**
+         * Sets the title attribute of the shadow div
+         * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
+         *
+         * @member {?string}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessibleTitle: string;
+        /**
+         * Sets the aria-label attribute of the shadow div
+         *
+         * @member {string}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessibleHint: string;
+        /**
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         * @todo Needs docs.
+         */
+        _accessibleActive: boolean;
+        /**
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         * @todo Needs docs.
+         */
+        _accessibleDiv: boolean;
+        /**
+         * World transform and local transform of this object.
+         * This will become read-only later, please do not assign anything there unless you know what are you doing.
+         *
+         * @member {PIXI.Transform} PIXI.DisplayObject#transform
+         */
+        transform: PIXI.Transform;
+        /**
+         * The opacity of the object.
+         *
+         * @member {number} PIXI.DisplayObject#alpha
+         */
+        alpha: number;
+        /**
+         * The visibility of the object. If false the object will not be drawn, and
+         * the updateTransform function will not be called.
+         *
+         * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
+         *
+         * @member {boolean} PIXI.DisplayObject#visible
+         */
+        visible: boolean;
+        /**
+         * Can this object be rendered, if false the object will not be drawn but the updateTransform
+         * methods will still be called.
+         *
+         * Only affects recursive calls from parent. You can ask for bounds manually.
+         *
+         * @member {boolean} PIXI.DisplayObject#renderable
+         */
+        renderable: boolean;
+        /**
+         * The display object container that contains this display object.
+         *
+         * @member {PIXI.Container} PIXI.DisplayObject#parent
+         * @readonly
+         */
+        readonly parent: PIXI.Container;
+        /**
+         * The multiplied alpha of the displayObject.
+         *
+         * @member {number} PIXI.DisplayObject#worldAlpha
+         * @readonly
+         */
+        readonly worldAlpha: number;
+        /**
+         * Which index in the children array the display component was before the previous zIndex sort.
+         * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
+         *
+         * @member {number} PIXI.DisplayObject#_lastSortedIndex
+         * @protected
+         */
+        protected _lastSortedIndex: number;
+        /**
+         * The zIndex of the displayObject.
+         * A higher value will mean it will be rendered on top of other displayObjects within the same container.
+         *
+         * @member {number} PIXI.DisplayObject#_zIndex
+         * @protected
+         */
+        protected _zIndex: number;
+        /**
+         * The area the filter is applied to. This is used as more of an optimization
+         * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
+         *
+         * Also works as an interaction mask.
+         *
+         * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
+         */
+        filterArea: PIXI.Rectangle;
+        /**
+         * Sets the filters for the displayObject.
+         * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
+         * To remove filters simply set this property to `'null'`.
+         *
+         * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
+         */
+        filters: PIXI.Filter[];
+        /**
+         * The bounds object, this is used to calculate and store the bounds of the displayObject.
+         *
+         * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
+         * @protected
+         */
+        protected _bounds: PIXI.Bounds;
+        /**
+         * The original, cached mask of the object.
+         *
+         * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask
+         * @protected
+         */
+        protected _mask: PIXI.Graphics | PIXI.Sprite;
+        /**
+         * If the object has been destroyed via destroy(). If true, it should not be used.
+         *
+         * @member {boolean} PIXI.DisplayObject#_destroyed
+         * @protected
+         */
+        protected _destroyed: boolean;
+        /**
+         * used to fast check if a sprite is.. a sprite!
+         * @member {boolean} PIXI.DisplayObject#isSprite
+         */
+        isSprite: boolean;
+        /**
+         * @protected
+         * @member {PIXI.DisplayObject}
+         */
+        protected _tempDisplayObjectParent: PIXI.DisplayObject;
+        /**
+         * Recursively updates transform of all objects from the root to this one
+         * internal function for toLocal()
+         */
+        _recursivePostUpdateTransform(): void;
+        /**
+         * Retrieves the bounds of the displayObject as a rectangle object.
+         *
+         * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
+         *  being updated. This means the calculation returned MAY be out of date BUT will give you a
+         *  nice performance boost.
+         * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
+         * @return {PIXI.Rectangle} The rectangular bounding area.
+         */
+        getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * Retrieves the local bounds of the displayObject as a rectangle object.
+         *
+         * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
+         * @return {PIXI.Rectangle} The rectangular bounding area.
+         */
+        getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * Calculates the global position of the display object.
+         *
+         * @param {PIXI.IPoint} position - The world origin to calculate from.
+         * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional
+         *  (otherwise will create a new Point).
+         * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
+         * @return {PIXI.IPoint} A point object representing the position of this object.
+         */
+        toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint;
+        /**
+         * Calculates the local position of the display object relative to another point.
+         *
+         * @param {PIXI.IPoint} position - The world origin to calculate from.
+         * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
+         * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional
+         *  (otherwise will create a new Point).
+         * @param {boolean} [skipUpdate=false] - Should we skip the update transform
+         * @return {PIXI.IPoint} A point object representing the position of this object
+         */
+        toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint;
+        /**
+         * Set the parent Container of this DisplayObject.
+         *
+         * @param {PIXI.Container} container - The Container to add this DisplayObject to.
+         * @return {PIXI.Container} The Container that this DisplayObject was added to.
+         */
+        setParent(container: PIXI.Container): PIXI.Container;
+        /**
+         * Convenience function to set the position, scale, skew and pivot at once.
+         *
+         * @param {number} [x=0] - The X position
+         * @param {number} [y=0] - The Y position
+         * @param {number} [scaleX=1] - The X scale value
+         * @param {number} [scaleY=1] - The Y scale value
+         * @param {number} [rotation=0] - The rotation
+         * @param {number} [skewX=0] - The X skew value
+         * @param {number} [skewY=0] - The Y skew value
+         * @param {number} [pivotX=0] - The X pivot value
+         * @param {number} [pivotY=0] - The Y pivot value
+         * @return {PIXI.DisplayObject} The DisplayObject instance
+         */
+        setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
+        /**
+         * The position of the displayObject on the x axis relative to the local coordinates of the parent.
+         * An alias to position.x
+         *
+         * @member {number}
+         */
+        x: number;
+        /**
+         * The position of the displayObject on the y axis relative to the local coordinates of the parent.
+         * An alias to position.y
+         *
+         * @member {number}
+         */
+        y: number;
+        /**
+         * Current transform of the object based on world (parent) factors.
+         *
+         * @member {PIXI.Matrix}
+         * @readonly
+         */
+        readonly worldTransform: PIXI.Matrix;
+        /**
+         * Current transform of the object based on local factors: position, scale, other stuff.
+         *
+         * @member {PIXI.Matrix}
+         * @readonly
+         */
+        readonly localTransform: PIXI.Matrix;
+        /**
+         * The coordinate of the object relative to the local coordinates of the parent.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        position: PIXI.IPoint;
+        /**
+         * The scale factor of the object.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        scale: PIXI.IPoint;
+        /**
+         * The pivot point of the displayObject that it rotates around.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        pivot: PIXI.IPoint;
+        /**
+         * The skew factor for the object in radians.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.ObservablePoint}
+         */
+        skew: PIXI.ObservablePoint;
+        /**
+         * The rotation of the object in radians.
+         * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
+         *
+         * @member {number}
+         */
+        rotation: number;
+        /**
+         * The angle of the object in degrees.
+         * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
+         *
+         * @member {number}
+         */
+        angle: number;
+        /**
+         * The zIndex of the displayObject.
+         * If a container has the sortableChildren property set to true, children will be automatically
+         * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
+         * and thus rendered on top of other displayObjects within the same container.
+         *
+         * @member {number}
+         */
+        zIndex: number;
+        /**
+         * Indicates if the object is globally visible.
+         *
+         * @member {boolean}
+         * @readonly
+         */
+        readonly worldVisible: boolean;
+        /**
+         * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
+         * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
+         * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
+         * utilities shape clipping. To remove a mask, set this property to `null`.
+         *
+         * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
+         * @example
+         * const graphics = new PIXI.Graphics();
+         * graphics.beginFill(0xFF3300);
+         * graphics.drawRect(50, 250, 100, 100);
+         * graphics.endFill();
+         *
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.mask = graphics;
+         * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
+         *
+         * @member {PIXI.Graphics|PIXI.Sprite}
+         */
+        mask: PIXI.Graphics | PIXI.Sprite;
+        /**
+         * Enable interaction events for the DisplayObject. Touch, pointer and mouse
+         * events will not be emitted unless `interactive` is set to `true`.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.on('tap', (event) => {
+         *    //handle event
+         * });
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        interactive: boolean;
+        /**
+         * Interaction shape. Children will be hit first, then this shape will be checked.
+         * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
+         * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle}
+         * @memberof PIXI.DisplayObject#
+         */
+        hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle;
+        /**
+         * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
+         * Setting this changes the 'cursor' property to `'pointer'`.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.buttonMode = true;
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        buttonMode: boolean;
+        /**
+         * This defines what cursor mode is used when the mouse cursor
+         * is hovered over the displayObject.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.cursor = 'wait';
+         * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
+         *
+         * @member {string}
+         * @memberof PIXI.DisplayObject#
+         */
+        cursor: string;
+        /**
+         * The instance name of the object.
+         *
+         * @memberof PIXI.DisplayObject#
+         * @member {string} name
+         */
+        name: string;
+        /**
+         * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
+         *
+         * @method getGlobalPosition
+         * @memberof PIXI.DisplayObject#
+         * @param {Point} point - The point to write the global value to. If null a new point will be returned
+         * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from
+         *  being updated. This means the calculation returned MAY be out of date BUT will give you a
+         *  nice performance boost.
+         * @return {Point} The updated point.
+         */
+        getGlobalPosition(point: Point, skipUpdate: boolean): Point;
+    }
+    /**
+     * A class to contain data useful for Graphics objects
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class GraphicsData {
+        constructor(shape: PIXI.Circle | PIXI.Rectangle | PIXI.Ellipse | PIXI.Polygon, fillStyle?: PIXI.FillStyle, lineStyle?: PIXI.LineStyle, matrix?: PIXI.Matrix);
+        /**
+         * The shape object to draw.
+         * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} PIXI.GraphicsData#shape
+         */
+        shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle;
+        /**
+         * The style of the line.
+         * @member {PIXI.LineStyle} PIXI.GraphicsData#lineStyle
+         */
+        lineStyle: PIXI.LineStyle;
+        /**
+         * The style of the fill.
+         * @member {PIXI.FillStyle} PIXI.GraphicsData#fillStyle
+         */
+        fillStyle: PIXI.FillStyle;
+        /**
+         * The transform matrix.
+         * @member {PIXI.Matrix} PIXI.GraphicsData#matrix
+         */
+        matrix: PIXI.Matrix;
+        /**
+         * The type of the shape, see the Const.Shapes file for all the existing types,
+         * @member {number} PIXI.GraphicsData#type
+         */
+        type: number;
+        /**
+         * The collection of points.
+         * @member {number[]} PIXI.GraphicsData#points
+         */
+        points: number[];
+        /**
+         * The collection of holes.
+         * @member {PIXI.GraphicsData[]} PIXI.GraphicsData#holes
+         */
+        holes: PIXI.GraphicsData[];
+        /**
+         * Creates a new GraphicsData object with the same values as this one.
+         *
+         * @return {PIXI.GraphicsData} Cloned GraphicsData object
+         */
+        clone(): PIXI.GraphicsData;
+        /**
+         * Destroys the Graphics data.
+         */
+        destroy(): void;
+    }
+    /**
+     * The Graphics class contains methods used to draw primitive shapes such as lines, circles and
+     * rectangles to the display, and to color and fill them.
+     *
+     * GraphicsGeometry is designed to not be continually updating the geometry since it's expensive
+     * to re-tesselate using **earcut**. Consider using {@link PIXI.Mesh} for this use-case, it's much faster.
+     *
+     * @class
+     * @extends PIXI.BatchGeometry
+     * @memberof PIXI
+     */
+    class GraphicsGeometry extends PIXI.BatchGeometry {
+        constructor();
+        /**
+         * An array of points to draw
+         *
+         * @member {PIXI.Point[]} PIXI.GraphicsGeometry#points
+         * @protected
+         */
+        protected points: PIXI.Point[];
+        /**
+         * The collection of colors
+         *
+         * @member {number[]} PIXI.GraphicsGeometry#colors
+         * @protected
+         */
+        protected colors: number[];
+        /**
+         * The UVs collection
+         *
+         * @member {number[]} PIXI.GraphicsGeometry#uvs
+         * @protected
+         */
+        protected uvs: number[];
+        /**
+         * The indices of the vertices
+         *
+         * @member {number[]} PIXI.GraphicsGeometry#indices
+         * @protected
+         */
+        protected indices: number[];
+        /**
+         * Reference to the texture IDs.
+         *
+         * @member {number[]} PIXI.GraphicsGeometry#textureIds
+         * @protected
+         */
+        protected textureIds: number[];
+        /**
+         * The collection of drawn shapes.
+         *
+         * @member {PIXI.GraphicsData[]} PIXI.GraphicsGeometry#graphicsData
+         * @protected
+         */
+        protected graphicsData: PIXI.GraphicsData[];
+        /**
+         * Used to detect if the graphics object has changed. If this is set to true then the graphics
+         * object will be recalculated.
+         *
+         * @member {number} PIXI.GraphicsGeometry#dirty
+         * @protected
+         */
+        protected dirty: number;
+        /**
+         * Batches need to regenerated if the geometry is updated.
+         *
+         * @member {number} PIXI.GraphicsGeometry#batchDirty
+         * @protected
+         */
+        protected batchDirty: number;
+        /**
+         * Used to check if the cache is dirty.
+         *
+         * @member {number} PIXI.GraphicsGeometry#cacheDirty
+         * @protected
+         */
+        protected cacheDirty: number;
+        /**
+         * Used to detect if we clear the graphics WebGL data.
+         *
+         * @member {number} PIXI.GraphicsGeometry#clearDirty
+         * @default 0
+         * @protected
+         */
+        protected clearDirty: number;
+        /**
+         * List of current draw calls drived from the batches.
+         *
+         * @member {object[]} PIXI.GraphicsGeometry#drawCalls
+         * @protected
+         */
+        protected drawCalls: any[];
+        /**
+         * Intermediate abstract format sent to batch system.
+         * Can be converted to drawCalls or to batchable objects.
+         *
+         * @member {object[]} PIXI.GraphicsGeometry#batches
+         * @protected
+         */
+        protected batches: any[];
+        /**
+         * Index of the current last shape in the stack of calls.
+         *
+         * @member {number} PIXI.GraphicsGeometry#shapeIndex
+         * @protected
+         */
+        protected shapeIndex: number;
+        /**
+         * Cached bounds.
+         *
+         * @member {PIXI.Bounds} PIXI.GraphicsGeometry#_bounds
+         * @protected
+         */
+        protected _bounds: PIXI.Bounds;
+        /**
+         * The bounds dirty flag.
+         *
+         * @member {number} PIXI.GraphicsGeometry#boundsDirty
+         * @protected
+         */
+        protected boundsDirty: number;
+        /**
+         * Padding to add to the bounds.
+         *
+         * @member {number} PIXI.GraphicsGeometry#boundsPadding
+         * @default 0
+         */
+        boundsPadding: number;
+        /**
+         * Get the current bounds of the graphic geometry.
+         *
+         * @member {PIXI.Bounds}
+         * @readonly
+         */
+        readonly bounds: PIXI.Bounds;
+        /**
+         * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.
+         *
+         * @return {PIXI.GraphicsGeometry} This GraphicsGeometry object. Good for chaining method calls
+         */
+        clear(): PIXI.GraphicsGeometry;
+        /**
+         * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
+         *
+         * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.
+         * @param {PIXI.FillStyle} fillStyle - Defines style of the fill.
+         * @param {PIXI.LineStyle} lineStyle - Defines style of the lines.
+         * @param {PIXI.Matrix} matrix - Transform applied to the points of the shape.
+         * @return {PIXI.GraphicsGeometry} Returns geometry for chaining.
+         */
+        drawShape(shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle, fillStyle: PIXI.FillStyle, lineStyle: PIXI.LineStyle, matrix: PIXI.Matrix): PIXI.GraphicsGeometry;
+        /**
+         * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.
+         *
+         * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.
+         * @param {PIXI.Matrix} matrix - Transform applied to the points of the shape.
+         * @return {PIXI.GraphicsGeometry} Returns geometry for chaining.
+         */
+        drawHole(shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle, matrix: PIXI.Matrix): PIXI.GraphicsGeometry;
+        /**
+         * Destroys the Graphics object.
+         *
+         * @param {object|boolean} [options] - Options parameter. A boolean will act as if all
+         *  options have been set to that value
+         * @param {boolean} [options.children=false] - if set to true, all the children will have
+         *  their destroy method called as well. 'options' will be passed on to those calls.
+         * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true
+         *  Should it destroy the texture of the child sprite
+         * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true
+         *  Should it destroy the base texture of the child sprite
+         */
+        destroy(options?: {
+            children?: boolean;
+            texture?: boolean;
+            baseTexture?: boolean;
+        }): void;
+        /**
+         * Check to see if a point is contained within this geometry.
+         *
+         * @param {PIXI.Point} point - Point to check if it's contained.
+         * @return {Boolean} `true` if the point is contained within geometry.
+         */
+        containsPoint(point: PIXI.Point): boolean;
+        /**
+         * Generates intermediate batch data. Either gets converted to drawCalls
+         * or used to convert to batch objects directly by the Graphics object.
+         * @protected
+         */
+        protected updateBatches(): void;
+        /**
+         * Checks to see if this graphics geometry can be batched.
+         * Currently it needs to be small enough and not contain any native lines.
+         * @protected
+         */
+        protected isBatchable(): void;
+        /**
+         * Converts intermediate batches data to drawCalls.
+         * @protected
+         */
+        protected buildDrawCalls(): void;
+        /**
+         * Process the holes data.
+         *
+         * @param {PIXI.GraphicsData[]} holes - Holes to render
+         * @protected
+         */
+        protected processHoles(holes: PIXI.GraphicsData[]): void;
+        /**
+         * Update the local bounds of the object. Expensive to use performance-wise.
+         * @protected
+         */
+        protected calculateBounds(): void;
+        /**
+         * Transform points using matrix.
+         *
+         * @protected
+         * @param {number[]} points - Points to transform
+         * @param {PIXI.Matrix} matrix - Transform matrix
+         */
+        protected transformPoints(points: number[], matrix: PIXI.Matrix): void;
+        /**
+         * Add colors.
+         *
+         * @protected
+         * @param {number[]} colors - List of colors to add to
+         * @param {number} color - Color to add
+         * @param {number} alpha - Alpha to use
+         * @param {number} size - Number of colors to add
+         */
+        protected addColors(colors: number[], color: number, alpha: number, size: number): void;
+        /**
+         * Add texture id that the shader/fragment wants to use.
+         *
+         * @protected
+         * @param {number[]} textureIds
+         * @param {number} id
+         * @param {number} size
+         */
+        protected addTextureIds(textureIds: number[], id: number, size: number): void;
+        /**
+         * Generates the UVs for a shape.
+         *
+         * @protected
+         * @param {number[]} verts - Vertices
+         * @param {number[]} uvs - UVs
+         * @param {PIXI.Texture} texture - Reference to Texture
+         * @param {number} start - Index buffer start index.
+         * @param {number} size - The size/length for index buffer.
+         * @param {PIXI.Matrix} [matrix] - Optional transform for all points.
+         */
+        protected addUvs(verts: number[], uvs: number[], texture: PIXI.Texture, start: number, size: number, matrix?: PIXI.Matrix): void;
+        /**
+         * Modify uvs array according to position of texture region
+         * Does not work with rotated or trimmed textures
+         * @param {number} uvs array
+         * @param {PIXI.Texture} texture region
+         * @param {number} start starting index for uvs
+         * @param {number} size how many points to adjust
+         */
+        adjustUvs(uvs: number, texture: PIXI.Texture, start: number, size: number): void;
+        /**
+         * The maximum number of points to consider an object "batchable",
+         * able to be batched by the renderer's batch system.
+         *
+         * @memberof PIXI.GraphicsGeometry
+         * @static
+         * @member {number} BATCHABLE_SIZE
+         * @default 100
+         */
+        static BATCHABLE_SIZE: number;
+        /**
+         * Buffer used for position, color, texture IDs
+         *
+         * @member {PIXI.Buffer} PIXI.BatchGeometry#_buffer
+         * @protected
+         */
+        protected _buffer: PIXI.Buffer;
+        /**
+         * Index buffer data
+         *
+         * @member {PIXI.Buffer} PIXI.BatchGeometry#_indexBuffer
+         * @protected
+         */
+        protected _indexBuffer: PIXI.Buffer;
+    }
+    /**
+     * Fill style object for Graphics.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class FillStyle {
+        constructor();
+        /**
+         * Clones the object
+         *
+         * @return {PIXI.FillStyle}
+         */
+        clone(): PIXI.FillStyle;
+        /**
+         * Reset
+         */
+        reset(): void;
+        /**
+         * The hex color value used when coloring the Graphics object.
+         *
+         * @member {number} PIXI.FillStyle#color
+         * @default 1
+         */
+        color: number;
+        /**
+         * The alpha value used when filling the Graphics object.
+         *
+         * @member {number} PIXI.FillStyle#alpha
+         * @default 1
+         */
+        alpha: number;
+        /**
+         * The texture to be used for the fill.
+         *
+         * @member {string} PIXI.FillStyle#texture
+         * @default 0
+         */
+        texture: string;
+        /**
+         * The transform aplpied to the texture.
+         *
+         * @member {string} PIXI.FillStyle#matrix
+         * @default 0
+         */
+        matrix: string;
+        /**
+         * If the current fill is visible.
+         *
+         * @member {boolean} PIXI.FillStyle#visible
+         * @default false
+         */
+        visible: boolean;
+        /**
+         * Destroy and don't use after this
+         */
+        destroy(): void;
+    }
+    /**
+     * Represents the line style for Graphics.
+     * @memberof PIXI
+     * @class
+     * @extends PIXI.FillStyle
+     */
+    class LineStyle extends PIXI.FillStyle {
+        /**
+         * Clones the object
+         *
+         * @return {PIXI.LineStyle}
+         */
+        clone(): PIXI.LineStyle;
+        /**
+         * Reset the line style to default.
+         */
+        reset(): void;
+        /**
+         * The width (thickness) of any lines drawn.
+         *
+         * @member {number} PIXI.LineStyle#width
+         * @default 0
+         */
+        width: number;
+        /**
+         * The alignment of any lines drawn (0.5 = middle, 1 = outter, 0 = inner).
+         *
+         * @member {number} PIXI.LineStyle#alignment
+         * @default 0
+         */
+        alignment: number;
+        /**
+         * If true the lines will be draw using LINES instead of TRIANGLE_STRIP
+         *
+         * @member {boolean} PIXI.LineStyle#native
+         * @default false
+         */
+        native: boolean;
+        /**
+         * The hex color value used when coloring the Graphics object.
+         *
+         * @member {number} PIXI.FillStyle#color
+         * @default 1
+         */
+        color: number;
+        /**
+         * The alpha value used when filling the Graphics object.
+         *
+         * @member {number} PIXI.FillStyle#alpha
+         * @default 1
+         */
+        alpha: number;
+        /**
+         * The texture to be used for the fill.
+         *
+         * @member {string} PIXI.FillStyle#texture
+         * @default 0
+         */
+        texture: string;
+        /**
+         * The transform aplpied to the texture.
+         *
+         * @member {string} PIXI.FillStyle#matrix
+         * @default 0
+         */
+        matrix: string;
+        /**
+         * If the current fill is visible.
+         *
+         * @member {boolean} PIXI.FillStyle#visible
+         * @default false
+         */
+        visible: boolean;
+        /**
+         * Destroy and don't use after this
+         */
+        destroy(): void;
+    }
+    /**
+     * Draw a star shape with an arbitrary number of points.
+     *
+     * @class
+     * @extends PIXI.Polygon
+     * @memberof PIXI
+     * @param {number} x - Center X position of the star
+     * @param {number} y - Center Y position of the star
+     * @param {number} points - The number of points of the star, must be > 1
+     * @param {number} radius - The outer radius of the star
+     * @param {number} [innerRadius] - The inner radius between points, default half `radius`
+     * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical
+     * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls
+     */
+    class Star extends PIXI.Polygon {
+        constructor(x: number, y: number, points: number, radius: number, innerRadius?: number, rotation?: number);
+        /**
+         * An array of the points of this polygon
+         *
+         * @member {number[]} PIXI.Polygon#points
+         */
+        points: number[];
+        /**
+         * The type of the object, mainly used to avoid `instanceof` checks
+         *
+         * @member {number} PIXI.Polygon#type
+         * @readOnly
+         * @default PIXI.SHAPES.POLY
+         * @see PIXI.SHAPES
+         */
+        readonly type: number;
+        /**
+         * `false` after moveTo, `true` after `closePath`. In all other cases it is `true`.
+         * @member {boolean} PIXI.Polygon#closeStroke
+         * @default true
+         */
+        closeStroke: boolean;
+        /**
+         * Creates a clone of this polygon
+         *
+         * @return {PIXI.Polygon} a copy of the polygon
+         */
+        clone(): PIXI.Polygon;
+        /**
+         * Checks whether the x and y coordinates passed to this function are contained within this polygon
+         *
+         * @param {number} x - The X coordinate of the point to test
+         * @param {number} y - The Y coordinate of the point to test
+         * @return {boolean} Whether the x/y coordinates are within this polygon
+         */
+        contains(x: number, y: number): boolean;
+    }
+    /**
+     * This namespace contains a renderer plugin for handling mouse, pointer, and touch events.
+     *
+     * Do not instantiate this plugin directly. It is available from the `renderer.plugins` property.
+     * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.
+     * @namespace PIXI.interaction
+     */
+    namespace interaction {
+        /**
+         * Holds all information related to an Interaction event
+         *
+         * @class
+         * @memberof PIXI.interaction
+         */
+        class InteractionData {
+            constructor();
+            /**
+             * This point stores the global coords of where the touch/mouse event happened
+             *
+             * @member {PIXI.Point} PIXI.interaction.InteractionData#global
+             */
+            global: PIXI.Point;
+            /**
+             * The target Sprite that was interacted with
+             *
+             * @member {PIXI.Sprite} PIXI.interaction.InteractionData#target
+             */
+            target: PIXI.Sprite;
+            /**
+             * When passed to an event handler, this will be the original DOM Event that was captured
+             *
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent
+             * @member {MouseEvent|TouchEvent|PointerEvent} PIXI.interaction.InteractionData#originalEvent
+             */
+            originalEvent: MouseEvent | TouchEvent | PointerEvent;
+            /**
+             * Unique identifier for this interaction
+             *
+             * @member {number} PIXI.interaction.InteractionData#identifier
+             */
+            identifier: number;
+            /**
+             * Indicates whether or not the pointer device that created the event is the primary pointer.
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary
+             * @type {Boolean}
+             */
+            isPrimary: boolean;
+            /**
+             * Indicates which button was pressed on the mouse or pointer device to trigger the event.
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
+             * @type {number}
+             */
+            button: number;
+            /**
+             * Indicates which buttons are pressed on the mouse or pointer device when the event is triggered.
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
+             * @type {number}
+             */
+            buttons: number;
+            /**
+             * The width of the pointer's contact along the x-axis, measured in CSS pixels.
+             * radiusX of TouchEvents will be represented by this value.
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width
+             * @type {number}
+             */
+            width: number;
+            /**
+             * The height of the pointer's contact along the y-axis, measured in CSS pixels.
+             * radiusY of TouchEvents will be represented by this value.
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height
+             * @type {number}
+             */
+            height: number;
+            /**
+             * The angle, in degrees, between the pointer device and the screen.
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX
+             * @type {number}
+             */
+            tiltX: number;
+            /**
+             * The angle, in degrees, between the pointer device and the screen.
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY
+             * @type {number}
+             */
+            tiltY: number;
+            /**
+             * The type of pointer that triggered the event.
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType
+             * @type {string}
+             */
+            pointerType: string;
+            /**
+             * Pressure applied by the pointing device during the event. A Touch's force property
+             * will be represented by this value.
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure
+             * @type {number}
+             */
+            pressure: number;
+            /**
+             * From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle
+             * @type {number}
+             */
+            rotationAngle: number;
+            /**
+             * Twist of a stylus pointer.
+             * @see https://w3c.github.io/pointerevents/#pointerevent-interface
+             * @type {number}
+             */
+            twist: number;
+            /**
+             * Barrel pressure on a stylus pointer.
+             * @see https://w3c.github.io/pointerevents/#pointerevent-interface
+             * @type {number}
+             */
+            tangentialPressure: number;
+            /**
+             * The unique identifier of the pointer. It will be the same as `identifier`.
+             * @readonly
+             * @member {number}
+             * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId
+             */
+            readonly pointerId: number;
+            /**
+             * This will return the local coordinates of the specified displayObject for this InteractionData
+             *
+             * @param {PIXI.DisplayObject} displayObject - The DisplayObject that you would like the local
+             *  coords off
+             * @param {PIXI.Point} [point] - A Point object in which to store the value, optional (otherwise
+             *  will create a new point)
+             * @param {PIXI.Point} [globalPos] - A Point object containing your custom global coords, optional
+             *  (otherwise will use the current global coords)
+             * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative
+             *  to the DisplayObject
+             */
+            getLocalPosition(displayObject: PIXI.DisplayObject, point?: PIXI.Point, globalPos?: PIXI.Point): PIXI.Point;
+            /**
+             * Copies properties from normalized event data.
+             *
+             * @param {Touch|MouseEvent|PointerEvent} event The normalized event data
+             */
+            copyEvent(event: Touch | MouseEvent | PointerEvent): void;
+            /**
+             * Resets the data for pooling.
+             */
+            reset(): void;
+        }
+        /**
+         * Event class that mimics native DOM events.
+         *
+         * @class
+         * @memberof PIXI.interaction
+         */
+        class InteractionEvent {
+            constructor();
+            /**
+             * Whether this event will continue propagating in the tree
+             *
+             * @member {boolean} PIXI.interaction.InteractionEvent#stopped
+             */
+            stopped: boolean;
+            /**
+             * The object which caused this event to be dispatched.
+             * For listener callback see {@link PIXI.interaction.InteractionEvent.currentTarget}.
+             *
+             * @member {PIXI.DisplayObject} PIXI.interaction.InteractionEvent#target
+             */
+            target: PIXI.DisplayObject;
+            /**
+             * The object whose event listener’s callback is currently being invoked.
+             *
+             * @member {PIXI.DisplayObject} PIXI.interaction.InteractionEvent#currentTarget
+             */
+            currentTarget: PIXI.DisplayObject;
+            /**
+             * Type of the event
+             *
+             * @member {string} PIXI.interaction.InteractionEvent#type
+             */
+            type: string;
+            /**
+             * InteractionData related to this event
+             *
+             * @member {PIXI.interaction.InteractionData} PIXI.interaction.InteractionEvent#data
+             */
+            data: PIXI.interaction.InteractionData;
+            /**
+             * Prevents event from reaching any objects other than the current object.
+             *
+             */
+            stopPropagation(): void;
+            /**
+             * Resets the event.
+             */
+            reset(): void;
+        }
+        /**
+         * The interaction manager deals with mouse, touch and pointer events.
+         *
+         * Any DisplayObject can be interactive if its `interactive` property is set to true.
+         *
+         * This manager also supports multitouch.
+         *
+         * An instance of this class is automatically created by default, and can be found at `renderer.plugins.interaction`
+         *
+         * @class
+         * @extends PIXI.utils.EventEmitter
+         * @memberof PIXI.interaction
+         */
+        class InteractionManager extends PIXI.utils.EventEmitter {
+            constructor(renderer: PIXI.CanvasRenderer | PIXI.Renderer, options?: {
+                autoPreventDefault?: boolean;
+                interactionFrequency?: number;
+            });
+            /**
+             * The renderer this interaction manager works for.
+             *
+             * @member {PIXI.AbstractRenderer} PIXI.interaction.InteractionManager#renderer
+             */
+            renderer: PIXI.AbstractRenderer;
+            /**
+             * Should default browser actions automatically be prevented.
+             * Does not apply to pointer events for backwards compatibility
+             * preventDefault on pointer events stops mouse events from firing
+             * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.
+             *
+             * @member {boolean} PIXI.interaction.InteractionManager#autoPreventDefault
+             * @default true
+             */
+            autoPreventDefault: boolean;
+            /**
+             * Frequency in milliseconds that the mousemove, mouseover & mouseout interaction events will be checked.
+             *
+             * @member {number} PIXI.interaction.InteractionManager#interactionFrequency
+             * @default 10
+             */
+            interactionFrequency: number;
+            /**
+             * The mouse data
+             *
+             * @member {PIXI.interaction.InteractionData} PIXI.interaction.InteractionManager#mouse
+             */
+            mouse: PIXI.interaction.InteractionData;
+            /**
+             * An event data object to handle all the event tracking/dispatching
+             *
+             * @member {object} PIXI.interaction.InteractionManager#eventData
+             */
+            eventData: any;
+            /**
+             * The DOM element to bind to.
+             *
+             * @protected
+             * @member {HTMLElement} PIXI.interaction.InteractionManager#interactionDOMElement
+             */
+            protected interactionDOMElement: HTMLElement;
+            /**
+             * This property determines if mousemove and touchmove events are fired only when the cursor
+             * is over the object.
+             * Setting to true will make things work more in line with how the DOM version works.
+             * Setting to false can make things easier for things like dragging
+             * It is currently set to false as this is how PixiJS used to work. This will be set to true in
+             * future versions of pixi.
+             *
+             * @member {boolean} PIXI.interaction.InteractionManager#moveWhenInside
+             * @default false
+             */
+            moveWhenInside: boolean;
+            /**
+             * Have events been attached to the dom element?
+             *
+             * @protected
+             * @member {boolean} PIXI.interaction.InteractionManager#eventsAdded
+             */
+            protected eventsAdded: boolean;
+            /**
+             * Is the mouse hovering over the renderer?
+             *
+             * @protected
+             * @member {boolean} PIXI.interaction.InteractionManager#mouseOverRenderer
+             */
+            protected mouseOverRenderer: boolean;
+            /**
+             * Does the device support touch events
+             * https://www.w3.org/TR/touch-events/
+             *
+             * @readonly
+             * @member {boolean} PIXI.interaction.InteractionManager#supportsTouchEvents
+             */
+            readonly supportsTouchEvents: boolean;
+            /**
+             * Does the device support pointer events
+             * https://www.w3.org/Submission/pointer-events/
+             *
+             * @readonly
+             * @member {boolean} PIXI.interaction.InteractionManager#supportsPointerEvents
+             */
+            readonly supportsPointerEvents: boolean;
+            /**
+             * Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor
+             * values, objects are handled as dictionaries of CSS values for interactionDOMElement,
+             * and functions are called instead of changing the CSS.
+             * Default CSS cursor values are provided for 'default' and 'pointer' modes.
+             * @member {Object.} PIXI.interaction.InteractionManager#cursorStyles
+             */
+            cursorStyles: {
+                [key: string]: any;
+            };
+            /**
+             * The mode of the cursor that is being used.
+             * The value of this is a key from the cursorStyles dictionary.
+             *
+             * @member {string} PIXI.interaction.InteractionManager#currentCursorMode
+             */
+            currentCursorMode: string;
+            /**
+             * The current resolution / device pixel ratio.
+             *
+             * @member {number} PIXI.interaction.InteractionManager#resolution
+             * @default 1
+             */
+            resolution: number;
+            /**
+             * Hit tests a point against the display tree, returning the first interactive object that is hit.
+             *
+             * @param {PIXI.Point} globalPoint - A point to hit test with, in global space.
+             * @param {PIXI.Container} [root] - The root display object to start from. If omitted, defaults
+             * to the last rendered root of the associated renderer.
+             * @return {PIXI.DisplayObject} The hit display object, if any.
+             */
+            hitTest(globalPoint: PIXI.Point, root?: PIXI.Container): PIXI.DisplayObject;
+            /**
+             * Sets the DOM element which will receive mouse/touch events. This is useful for when you have
+             * other DOM elements on top of the renderers Canvas element. With this you'll be bale to delegate
+             * another DOM element to receive those events.
+             *
+             * @param {HTMLCanvasElement} element - the DOM element which will receive mouse and touch events.
+             * @param {number} [resolution=1] - The resolution / device pixel ratio of the new element (relative to the canvas).
+             */
+            setTargetElement(element: HTMLCanvasElement, resolution?: number): void;
+            /**
+             * Updates the state of interactive objects.
+             * Invoked by a throttled ticker update from {@link PIXI.Ticker.system}.
+             *
+             * @param {number} deltaTime - time delta since last tick
+             */
+            update(deltaTime: number): void;
+            /**
+             * Sets the current cursor mode, handling any callbacks or CSS style changes.
+             *
+             * @param {string} mode - cursor mode, a key from the cursorStyles dictionary
+             */
+            setCursorMode(mode: string): void;
+            /**
+             * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The
+             * resulting value is stored in the point. This takes into account the fact that the DOM
+             * element could be scaled and positioned anywhere on the screen.
+             *
+             * @param  {PIXI.Point} point - the point that the result will be stored in
+             * @param  {number} x - the x coord of the position to map
+             * @param  {number} y - the y coord of the position to map
+             */
+            mapPositionToPoint(point: PIXI.Point, x: number, y: number): void;
+            /**
+             * This function is provides a neat way of crawling through the scene graph and running a
+             * specified function on all interactive objects it finds. It will also take care of hit
+             * testing the interactive objects and passes the hit across in the function.
+             *
+             * @protected
+             * @param {PIXI.interaction.InteractionEvent} interactionEvent - event containing the point that
+             *  is tested for collision
+             * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the displayObject
+             *  that will be hit test (recursively crawls its children)
+             * @param {Function} [func] - the function that will be called on each interactive object. The
+             *  interactionEvent, displayObject and hit will be passed to the function
+             * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point
+             * @param {boolean} [interactive] - Whether the displayObject is interactive
+             * @return {boolean} returns true if the displayObject hit the point
+             */
+            protected processInteractive(interactionEvent: PIXI.interaction.InteractionEvent, displayObject: PIXI.Container | PIXI.Sprite | PIXI.TilingSprite, func?: (...params: any[]) => any, hitTest?: boolean, interactive?: boolean): boolean;
+            /**
+             * Destroys the interaction manager
+             *
+             */
+            destroy(): void;
+        }
+    }
+    /**
+     * Application plugin for supporting loader option. Installing the LoaderPlugin
+     * is not necessary if using **pixi.js** or **pixi.js-legacy**.
+     * @example
+     * import {AppLoaderPlugin} from '@pixi/loaders';
+     * import {Application} from '@pixi/app';
+     * Application.registerPlugin(AppLoaderPlugin);
+     * @class
+     * @memberof PIXI
+     */
+    class AppLoaderPlugin {
+    }
+    /**
+     * Reference to **{@link https://github.com/englercj/resource-loader
+     * resource-loader}**'s Resource class.
+     * @see http://englercj.github.io/resource-loader/Resource.html
+     * @class LoaderResource
+     * @memberof PIXI
+     */
+    class LoaderResource {
+    }
+    /**
+     * Plugin to be installed for handling specific Loader resources.
+     *
+     * @memberof PIXI
+     * @typedef ILoaderPlugin
+     * @property {function} [add] - Function to call immediate after registering plugin.
+     * @property {PIXI.Loader.loaderMiddleware} [pre] - Middleware function to run before load, the
+     *           arguments for this are `(resource, next)`
+     * @property {PIXI.Loader.loaderMiddleware} [use] - Middleware function to run after load, the
+     *           arguments for this are `(resource, next)`
+     */
+    type ILoaderPlugin = {
+        add?: (...params: any[]) => any;
+        pre?: PIXI.Loader.loaderMiddleware;
+        use?: PIXI.Loader.loaderMiddleware;
+    };
+    module Loader {
+        /**
+         * @memberof PIXI.Loader
+         * @callback loaderMiddleware
+         * @param {PIXI.LoaderResource} resource
+         * @param {function} next
+         */
+        type loaderMiddleware = (resource: PIXI.LoaderResource, next: (...params: any[]) => any) => void;
+    }
+    /**
+     * The new loader, extends Resource Loader by Chad Engler: https://github.com/englercj/resource-loader
+     *
+     * ```js
+     * const loader = PIXI.Loader.shared; // PixiJS exposes a premade instance for you to use.
+     * //or
+     * const loader = new PIXI.Loader(); // you can also create your own if you want
+     *
+     * const sprites = {};
+     *
+     * // Chainable `add` to enqueue a resource
+     * loader.add('bunny', 'data/bunny.png')
+     *       .add('spaceship', 'assets/spritesheet.json');
+     * loader.add('scoreFont', 'assets/score.fnt');
+     *
+     * // Chainable `pre` to add a middleware that runs for each resource, *before* loading that resource.
+     * // This is useful to implement custom caching modules (using filesystem, indexeddb, memory, etc).
+     * loader.pre(cachingMiddleware);
+     *
+     * // Chainable `use` to add a middleware that runs for each resource, *after* loading that resource.
+     * // This is useful to implement custom parsing modules (like spritesheet parsers, spine parser, etc).
+     * loader.use(parsingMiddleware);
+     *
+     * // The `load` method loads the queue of resources, and calls the passed in callback called once all
+     * // resources have loaded.
+     * loader.load((loader, resources) => {
+     *     // resources is an object where the key is the name of the resource loaded and the value is the resource object.
+     *     // They have a couple default properties:
+     *     // - `url`: The URL that the resource was loaded from
+     *     // - `error`: The error that happened when trying to load (if any)
+     *     // - `data`: The raw data that was loaded
+     *     // also may contain other properties based on the middleware that runs.
+     *     sprites.bunny = new PIXI.TilingSprite(resources.bunny.texture);
+     *     sprites.spaceship = new PIXI.TilingSprite(resources.spaceship.texture);
+     *     sprites.scoreFont = new PIXI.TilingSprite(resources.scoreFont.texture);
+     * });
+     *
+     * // throughout the process multiple signals can be dispatched.
+     * loader.onProgress.add(() => {}); // called once per loaded/errored file
+     * loader.onError.add(() => {}); // called once per errored file
+     * loader.onLoad.add(() => {}); // called once per loaded file
+     * loader.onComplete.add(() => {}); // called once when the queued resources all load.
+     * ```
+     *
+     * @see https://github.com/englercj/resource-loader
+     *
+     * @class Loader
+     * @memberof PIXI
+     * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.
+     * @param {number} [concurrency=10] - The number of resources to load concurrently.
+     */
+    class Loader {
+        constructor(baseUrl?: string, concurrency?: number);
+        /**
+         * A premade instance of the loader that can be used to load resources.
+         * @name shared
+         * @type {PIXI.Loader}
+         * @static
+         * @memberof PIXI.Loader
+         */
+        static shared: PIXI.Loader;
+        /**
+         * Adds a Loader plugin for the global shared loader and all
+         * new Loader instances created.
+         *
+         * @static
+         * @method registerPlugin
+         * @memberof PIXI.Loader
+         * @param {PIXI.ILoaderPlugin} plugin - The plugin to add
+         * @return {PIXI.Loader} Reference to PIXI.Loader for chaining
+         */
+        static registerPlugin(plugin: PIXI.ILoaderPlugin): PIXI.Loader;
+    }
+    interface TextureLoader extends PIXI.ILoaderPlugin {
+    }
+    /**
+     * Loader plugin for handling Texture resources.
+     * @class
+     * @memberof PIXI
+     * @implements PIXI.ILoaderPlugin
+     */
+    class TextureLoader implements PIXI.ILoaderPlugin {
+        /**
+         * Called after a resource is loaded.
+         * @see PIXI.Loader.loaderMiddleware
+         * @param {PIXI.LoaderResource} resource
+         * @param {function} next
+         */
+        static use(resource: PIXI.LoaderResource, next: (...params: any[]) => any): void;
+    }
+    /**
+     * Two Pi.
+     *
+     * @static
+     * @constant {number} PI_2
+     * @memberof PIXI
+     */
+    var PI_2: number;
+    /**
+     * Conversion factor for converting radians to degrees.
+     *
+     * @static
+     * @constant {number} RAD_TO_DEG
+     * @memberof PIXI
+     */
+    var RAD_TO_DEG: number;
+    /**
+     * Conversion factor for converting degrees to radians.
+     *
+     * @static
+     * @constant {number} DEG_TO_RAD
+     * @memberof PIXI
+     */
+    var DEG_TO_RAD: number;
+    /**
+     * Constants that identify shapes, mainly to prevent `instanceof` calls.
+     *
+     * @static
+     * @constant
+     * @name SHAPES
+     * @memberof PIXI
+     * @type {object}
+     * @property {number} POLY Polygon
+     * @property {number} RECT Rectangle
+     * @property {number} CIRC Circle
+     * @property {number} ELIP Ellipse
+     * @property {number} RREC Rounded Rectangle
+     */
+    var SHAPES: {
+        POLY: number;
+        RECT: number;
+        CIRC: number;
+        ELIP: number;
+        RREC: number;
+    };
+    /**
+     * Implements Dihedral Group D_8, see [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html},
+     * D8 is the same but with diagonals. Used for texture rotations.
+     *
+     * Vector xX(i), xY(i) is U-axis of sprite with rotation i
+     * Vector yY(i), yY(i) is V-axis of sprite with rotation i
+     * Rotations: 0 grad (0), 90 grad (2), 180 grad (4), 270 grad (6)
+     * Mirrors: vertical (8), main diagonal (10), horizontal (12), reverse diagonal (14)
+     * This is the small part of gameofbombs.com portal system. It works.
+     *
+     * @author Ivan @ivanpopelyshev
+     * @class
+     * @memberof PIXI
+     */
+    class GroupD8 {
+        constructor();
+        /**
+         * Adds 180 degrees to rotation. Commutative operation.
+         *
+         * @memberof PIXI.GroupD8
+         * @param {number} rotation - The number to rotate.
+         * @returns {number} rotated number
+         */
+        static rotate180(rotation: number): number;
+        /**
+         * Direction of main vector can be horizontal, vertical or diagonal.
+         * Some objects work with vertical directions different.
+         *
+         * @memberof PIXI.GroupD8
+         * @param {number} rotation - The number to check.
+         * @returns {boolean} Whether or not the direction is vertical
+         */
+        static isVertical(rotation: number): boolean;
+        /**
+         * @memberof PIXI.GroupD8
+         * @param {number} dx - TODO
+         * @param {number} dy - TODO
+         *
+         * @return {number} TODO
+         */
+        static byDirection(dx: number, dy: number): number;
+        /**
+         * Helps sprite to compensate texture packer rotation.
+         *
+         * @memberof PIXI.GroupD8
+         * @param {PIXI.Matrix} matrix - sprite world matrix
+         * @param {number} rotation - The rotation factor to use.
+         * @param {number} tx - sprite anchoring
+         * @param {number} ty - sprite anchoring
+         */
+        static matrixAppendRotationInv(matrix: PIXI.Matrix, rotation: number, tx: number, ty: number): void;
+    }
+    /**
+     * The PixiJS Matrix as a class makes it a lot faster.
+     *
+     * Here is a representation of it:
+     * ```js
+     * | a | c | tx|
+     * | b | d | ty|
+     * | 0 | 0 | 1 |
+     * ```
+     * @class
+     * @memberof PIXI
+     */
+    class Matrix {
+        constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
+        /**
+         * @method PIXI.Matrix#copy
+         * @deprecated since 5.0.0
+         * @see PIXI.Matrix#copyTo
+         */
+        copy(): void;
+        /**
+         * @member {number} PIXI.Matrix#a
+         * @default 1
+         */
+        a: number;
+        /**
+         * @member {number} PIXI.Matrix#b
+         * @default 0
+         */
+        b: number;
+        /**
+         * @member {number} PIXI.Matrix#c
+         * @default 0
+         */
+        c: number;
+        /**
+         * @member {number} PIXI.Matrix#d
+         * @default 1
+         */
+        d: number;
+        /**
+         * @member {number} PIXI.Matrix#tx
+         * @default 0
+         */
+        tx: number;
+        /**
+         * @member {number} PIXI.Matrix#ty
+         * @default 0
+         */
+        ty: number;
+        /**
+         * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:
+         *
+         * a = array[0]
+         * b = array[1]
+         * c = array[3]
+         * d = array[4]
+         * tx = array[2]
+         * ty = array[5]
+         *
+         * @param {number[]} array - The array that the matrix will be populated from.
+         */
+        fromArray(array: number[]): void;
+        /**
+         * sets the matrix properties
+         *
+         * @param {number} a - Matrix component
+         * @param {number} b - Matrix component
+         * @param {number} c - Matrix component
+         * @param {number} d - Matrix component
+         * @param {number} tx - Matrix component
+         * @param {number} ty - Matrix component
+         *
+         * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
+         */
+        set(a: number, b: number, c: number, d: number, tx: number, ty: number): PIXI.Matrix;
+        /**
+         * Creates an array from the current Matrix object.
+         *
+         * @param {boolean} transpose - Whether we need to transpose the matrix or not
+         * @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out
+         * @return {number[]} the newly created array which contains the matrix
+         */
+        toArray(transpose: boolean, out?: Float32Array): number[];
+        /**
+         * Get a new position with the current transformation applied.
+         * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)
+         *
+         * @param {PIXI.Point} pos - The origin
+         * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)
+         * @return {PIXI.Point} The new point, transformed through this matrix
+         */
+        apply(pos: PIXI.Point, newPos?: PIXI.Point): PIXI.Point;
+        /**
+         * Get a new position with the inverse of the current transformation applied.
+         * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)
+         *
+         * @param {PIXI.Point} pos - The origin
+         * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)
+         * @return {PIXI.Point} The new point, inverse-transformed through this matrix
+         */
+        applyInverse(pos: PIXI.Point, newPos?: PIXI.Point): PIXI.Point;
+        /**
+         * Translates the matrix on the x and y.
+         *
+         * @param {number} x How much to translate x by
+         * @param {number} y How much to translate y by
+         * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
+         */
+        translate(x: number, y: number): PIXI.Matrix;
+        /**
+         * Applies a scale transformation to the matrix.
+         *
+         * @param {number} x The amount to scale horizontally
+         * @param {number} y The amount to scale vertically
+         * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
+         */
+        scale(x: number, y: number): PIXI.Matrix;
+        /**
+         * Applies a rotation transformation to the matrix.
+         *
+         * @param {number} angle - The angle in radians.
+         * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
+         */
+        rotate(angle: number): PIXI.Matrix;
+        /**
+         * Appends the given Matrix to this Matrix.
+         *
+         * @param {PIXI.Matrix} matrix - The matrix to append.
+         * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
+         */
+        append(matrix: PIXI.Matrix): PIXI.Matrix;
+        /**
+         * Sets the matrix based on all the available properties
+         *
+         * @param {number} x - Position on the x axis
+         * @param {number} y - Position on the y axis
+         * @param {number} pivotX - Pivot on the x axis
+         * @param {number} pivotY - Pivot on the y axis
+         * @param {number} scaleX - Scale on the x axis
+         * @param {number} scaleY - Scale on the y axis
+         * @param {number} rotation - Rotation in radians
+         * @param {number} skewX - Skew on the x axis
+         * @param {number} skewY - Skew on the y axis
+         * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
+         */
+        setTransform(x: number, y: number, pivotX: number, pivotY: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number): PIXI.Matrix;
+        /**
+         * Prepends the given Matrix to this Matrix.
+         *
+         * @param {PIXI.Matrix} matrix - The matrix to prepend
+         * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
+         */
+        prepend(matrix: PIXI.Matrix): PIXI.Matrix;
+        /**
+         * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.
+         *
+         * @param {PIXI.Transform} transform - The transform to apply the properties to.
+         * @return {PIXI.Transform} The transform with the newly applied properties
+         */
+        decompose(transform: PIXI.Transform): PIXI.Transform;
+        /**
+         * Inverts this matrix
+         *
+         * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
+         */
+        invert(): PIXI.Matrix;
+        /**
+         * Resets this Matrix to an identity (default) matrix.
+         *
+         * @return {PIXI.Matrix} This matrix. Good for chaining method calls.
+         */
+        identity(): PIXI.Matrix;
+        /**
+         * Creates a new Matrix object with the same values as this one.
+         *
+         * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls.
+         */
+        clone(): PIXI.Matrix;
+        /**
+         * Changes the values of the given matrix to be the same as the ones in this matrix
+         *
+         * @param {PIXI.Matrix} matrix - The matrix to copy to.
+         * @return {PIXI.Matrix} The matrix given in parameter with its values updated.
+         */
+        copyTo(matrix: PIXI.Matrix): PIXI.Matrix;
+        /**
+         * Changes the values of the matrix to be the same as the ones in given matrix
+         *
+         * @param {PIXI.Matrix} matrix - The matrix to copy from.
+         * @return {PIXI.Matrix} this
+         */
+        copyFrom(matrix: PIXI.Matrix): PIXI.Matrix;
+        /**
+         * A default (identity) matrix
+         *
+         * @static
+         * @const
+         * @member {PIXI.Matrix}
+         */
+        static IDENTITY: PIXI.Matrix;
+        /**
+         * A temp matrix
+         *
+         * @static
+         * @const
+         * @member {PIXI.Matrix}
+         */
+        static TEMP_MATRIX: PIXI.Matrix;
+    }
+    /**
+     * A number, or a string containing a number.
+     * @memberof PIXI
+     * @typedef {(PIXI.Point|PIXI.ObservablePoint)} IPoint
+     */
+    type IPoint = PIXI.Point | PIXI.ObservablePoint;
+    /**
+     * The Point object represents a location in a two-dimensional coordinate system, where x represents
+     * the horizontal axis and y represents the vertical axis.
+     *
+     * An ObservablePoint is a point that triggers a callback when the point's position is changed.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class ObservablePoint {
+        constructor(cb: (...params: any[]) => any, scope: any, x?: number, y?: number);
+        /**
+         * @method PIXI.ObservablePoint#copy
+         * @deprecated since 5.0.0
+         * @see PIXI.ObservablePoint#copyFrom
+         */
+        copy(): void;
+        /**
+         * Creates a clone of this point.
+         * The callback and scope params can be overidden otherwise they will default
+         * to the clone object's values.
+         *
+         * @override
+         * @param {Function} [cb=null] - callback when changed
+         * @param {object} [scope=null] - owner of callback
+         * @return {PIXI.ObservablePoint} a copy of the point
+         */
+        clone(cb?: (...params: any[]) => any, scope?: any): PIXI.ObservablePoint;
+        /**
+         * Sets the point to a new x and y position.
+         * If y is omitted, both x and y will be set to x.
+         *
+         * @param {number} [x=0] - position of the point on the x axis
+         * @param {number} [y=0] - position of the point on the y axis
+         */
+        set(x?: number, y?: number): void;
+        /**
+         * Copies x and y from the given point
+         *
+         * @param {PIXI.IPoint} p - The point to copy from.
+         * @returns {PIXI.IPoint} Returns itself.
+         */
+        copyFrom(p: PIXI.IPoint): PIXI.IPoint;
+        /**
+         * Copies x and y into the given point
+         *
+         * @param {PIXI.IPoint} p - The point to copy.
+         * @returns {PIXI.IPoint} Given point with values updated
+         */
+        copyTo(p: PIXI.IPoint): PIXI.IPoint;
+        /**
+         * Returns true if the given point is equal to this point
+         *
+         * @param {PIXI.IPoint} p - The point to check
+         * @returns {boolean} Whether the given point equal to this point
+         */
+        equals(p: PIXI.IPoint): boolean;
+        /**
+         * The position of the displayObject on the x axis relative to the local coordinates of the parent.
+         *
+         * @member {number}
+         */
+        x: number;
+        /**
+         * The position of the displayObject on the x axis relative to the local coordinates of the parent.
+         *
+         * @member {number}
+         */
+        y: number;
+    }
+    /**
+     * The Point object represents a location in a two-dimensional coordinate system, where x represents
+     * the horizontal axis and y represents the vertical axis.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Point {
+        constructor(x?: number, y?: number);
+        /**
+         * @method PIXI.Point#copy
+         * @deprecated since 5.0.0
+         * @see PIXI.Point#copyFrom
+         */
+        copy(): void;
+        /**
+         * @member {number} PIXI.Point#x
+         * @default 0
+         */
+        x: number;
+        /**
+         * @member {number} PIXI.Point#y
+         * @default 0
+         */
+        y: number;
+        /**
+         * Creates a clone of this point
+         *
+         * @return {PIXI.Point} a copy of the point
+         */
+        clone(): PIXI.Point;
+        /**
+         * Copies x and y from the given point
+         *
+         * @param {PIXI.IPoint} p - The point to copy from
+         * @returns {PIXI.IPoint} Returns itself.
+         */
+        copyFrom(p: PIXI.IPoint): PIXI.IPoint;
+        /**
+         * Copies x and y into the given point
+         *
+         * @param {PIXI.IPoint} p - The point to copy.
+         * @returns {PIXI.IPoint} Given point with values updated
+         */
+        copyTo(p: PIXI.IPoint): PIXI.IPoint;
+        /**
+         * Returns true if the given point is equal to this point
+         *
+         * @param {PIXI.IPoint} p - The point to check
+         * @returns {boolean} Whether the given point equal to this point
+         */
+        equals(p: PIXI.IPoint): boolean;
+        /**
+         * Sets the point to a new x and y position.
+         * If y is omitted, both x and y will be set to x.
+         *
+         * @param {number} [x=0] - position of the point on the x axis
+         * @param {number} [y=0] - position of the point on the y axis
+         */
+        set(x?: number, y?: number): void;
+    }
+    /**
+     * The Circle object is used to help draw graphics and can also be used to specify a hit area for displayObjects.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Circle {
+        constructor(x?: number, y?: number, radius?: number);
+        /**
+         * @member {number} PIXI.Circle#x
+         * @default 0
+         */
+        x: number;
+        /**
+         * @member {number} PIXI.Circle#y
+         * @default 0
+         */
+        y: number;
+        /**
+         * @member {number} PIXI.Circle#radius
+         * @default 0
+         */
+        radius: number;
+        /**
+         * The type of the object, mainly used to avoid `instanceof` checks
+         *
+         * @member {number} PIXI.Circle#type
+         * @readOnly
+         * @default PIXI.SHAPES.CIRC
+         * @see PIXI.SHAPES
+         */
+        readonly type: number;
+        /**
+         * Creates a clone of this Circle instance
+         *
+         * @return {PIXI.Circle} a copy of the Circle
+         */
+        clone(): PIXI.Circle;
+        /**
+         * Checks whether the x and y coordinates given are contained within this circle
+         *
+         * @param {number} x - The X coordinate of the point to test
+         * @param {number} y - The Y coordinate of the point to test
+         * @return {boolean} Whether the x/y coordinates are within this Circle
+         */
+        contains(x: number, y: number): boolean;
+        /**
+         * Returns the framing rectangle of the circle as a Rectangle object
+         *
+         * @return {PIXI.Rectangle} the framing rectangle
+         */
+        getBounds(): PIXI.Rectangle;
+    }
+    /**
+     * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for displayObjects.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Ellipse {
+        constructor(x?: number, y?: number, halfWidth?: number, halfHeight?: number);
+        /**
+         * @member {number} PIXI.Ellipse#x
+         * @default 0
+         */
+        x: number;
+        /**
+         * @member {number} PIXI.Ellipse#y
+         * @default 0
+         */
+        y: number;
+        /**
+         * @member {number} PIXI.Ellipse#width
+         * @default 0
+         */
+        width: number;
+        /**
+         * @member {number} PIXI.Ellipse#height
+         * @default 0
+         */
+        height: number;
+        /**
+         * The type of the object, mainly used to avoid `instanceof` checks
+         *
+         * @member {number} PIXI.Ellipse#type
+         * @readOnly
+         * @default PIXI.SHAPES.ELIP
+         * @see PIXI.SHAPES
+         */
+        readonly type: number;
+        /**
+         * Creates a clone of this Ellipse instance
+         *
+         * @return {PIXI.Ellipse} a copy of the ellipse
+         */
+        clone(): PIXI.Ellipse;
+        /**
+         * Checks whether the x and y coordinates given are contained within this ellipse
+         *
+         * @param {number} x - The X coordinate of the point to test
+         * @param {number} y - The Y coordinate of the point to test
+         * @return {boolean} Whether the x/y coords are within this ellipse
+         */
+        contains(x: number, y: number): boolean;
+        /**
+         * Returns the framing rectangle of the ellipse as a Rectangle object
+         *
+         * @return {PIXI.Rectangle} the framing rectangle
+         */
+        getBounds(): PIXI.Rectangle;
+    }
+    /**
+     * A class to define a shape via user defined co-orinates.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Polygon {
+        constructor(...points: (PIXI.Point[] | number[])[]);
+        /**
+         * An array of the points of this polygon
+         *
+         * @member {number[]} PIXI.Polygon#points
+         */
+        points: number[];
+        /**
+         * The type of the object, mainly used to avoid `instanceof` checks
+         *
+         * @member {number} PIXI.Polygon#type
+         * @readOnly
+         * @default PIXI.SHAPES.POLY
+         * @see PIXI.SHAPES
+         */
+        readonly type: number;
+        /**
+         * `false` after moveTo, `true` after `closePath`. In all other cases it is `true`.
+         * @member {boolean} PIXI.Polygon#closeStroke
+         * @default true
+         */
+        closeStroke: boolean;
+        /**
+         * Creates a clone of this polygon
+         *
+         * @return {PIXI.Polygon} a copy of the polygon
+         */
+        clone(): PIXI.Polygon;
+        /**
+         * Checks whether the x and y coordinates passed to this function are contained within this polygon
+         *
+         * @param {number} x - The X coordinate of the point to test
+         * @param {number} y - The Y coordinate of the point to test
+         * @return {boolean} Whether the x/y coordinates are within this polygon
+         */
+        contains(x: number, y: number): boolean;
+    }
+    /**
+     * Rectangle object is an area defined by its position, as indicated by its top-left corner
+     * point (x, y) and by its width and its height.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Rectangle {
+        constructor(x?: number, y?: number, width?: number, height?: number);
+        /**
+         * @method PIXI.Rectangle#copy
+         * @deprecated since 5.0.0
+         * @see PIXI.Rectangle#copyFrom
+         */
+        copy(): void;
+        /**
+         * @member {number} PIXI.Rectangle#x
+         * @default 0
+         */
+        x: number;
+        /**
+         * @member {number} PIXI.Rectangle#y
+         * @default 0
+         */
+        y: number;
+        /**
+         * @member {number} PIXI.Rectangle#width
+         * @default 0
+         */
+        width: number;
+        /**
+         * @member {number} PIXI.Rectangle#height
+         * @default 0
+         */
+        height: number;
+        /**
+         * The type of the object, mainly used to avoid `instanceof` checks
+         *
+         * @member {number} PIXI.Rectangle#type
+         * @readOnly
+         * @default PIXI.SHAPES.RECT
+         * @see PIXI.SHAPES
+         */
+        readonly type: number;
+        /**
+         * returns the left edge of the rectangle
+         *
+         * @member {number}
+         */
+        left: number;
+        /**
+         * returns the right edge of the rectangle
+         *
+         * @member {number}
+         */
+        right: number;
+        /**
+         * returns the top edge of the rectangle
+         *
+         * @member {number}
+         */
+        top: number;
+        /**
+         * returns the bottom edge of the rectangle
+         *
+         * @member {number}
+         */
+        bottom: number;
+        /**
+         * A constant empty rectangle.
+         *
+         * @static
+         * @constant
+         * @member {PIXI.Rectangle}
+         */
+        static EMPTY: PIXI.Rectangle;
+        /**
+         * Creates a clone of this Rectangle
+         *
+         * @return {PIXI.Rectangle} a copy of the rectangle
+         */
+        clone(): PIXI.Rectangle;
+        /**
+         * Copies another rectangle to this one.
+         *
+         * @param {PIXI.Rectangle} rectangle - The rectangle to copy from.
+         * @return {PIXI.Rectangle} Returns itself.
+         */
+        copyFrom(rectangle: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * Copies this rectangle to another one.
+         *
+         * @param {PIXI.Rectangle} rectangle - The rectangle to copy to.
+         * @return {PIXI.Rectangle} Returns given parameter.
+         */
+        copyTo(rectangle: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * Checks whether the x and y coordinates given are contained within this Rectangle
+         *
+         * @param {number} x - The X coordinate of the point to test
+         * @param {number} y - The Y coordinate of the point to test
+         * @return {boolean} Whether the x/y coordinates are within this Rectangle
+         */
+        contains(x: number, y: number): boolean;
+        /**
+         * Pads the rectangle making it grow in all directions.
+         *
+         * @param {number} paddingX - The horizontal padding amount.
+         * @param {number} paddingY - The vertical padding amount.
+         */
+        pad(paddingX: number, paddingY: number): void;
+        /**
+         * Fits this rectangle around the passed one.
+         *
+         * @param {PIXI.Rectangle} rectangle - The rectangle to fit.
+         */
+        fit(rectangle: PIXI.Rectangle): void;
+        /**
+         * Enlarges rectangle that way its corners lie on grid
+         *
+         * @param {number} [resolution=1] resolution
+         * @param {number} [eps=0.001] precision
+         */
+        ceil(resolution?: number, eps?: number): void;
+        /**
+         * Enlarges this rectangle to include the passed rectangle.
+         *
+         * @param {PIXI.Rectangle} rectangle - The rectangle to include.
+         */
+        enlarge(rectangle: PIXI.Rectangle): void;
+    }
+    /**
+     * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its
+     * top-left corner point (x, y) and by its width and its height and its radius.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class RoundedRectangle {
+        constructor(x?: number, y?: number, width?: number, height?: number, radius?: number);
+        /**
+         * @member {number} PIXI.RoundedRectangle#x
+         * @default 0
+         */
+        x: number;
+        /**
+         * @member {number} PIXI.RoundedRectangle#y
+         * @default 0
+         */
+        y: number;
+        /**
+         * @member {number} PIXI.RoundedRectangle#width
+         * @default 0
+         */
+        width: number;
+        /**
+         * @member {number} PIXI.RoundedRectangle#height
+         * @default 0
+         */
+        height: number;
+        /**
+         * @member {number} PIXI.RoundedRectangle#radius
+         * @default 20
+         */
+        radius: number;
+        /**
+         * The type of the object, mainly used to avoid `instanceof` checks
+         *
+         * @member {number} PIXI.RoundedRectangle#type
+         * @readonly
+         * @default PIXI.SHAPES.RREC
+         * @see PIXI.SHAPES
+         */
+        readonly type: number;
+        /**
+         * Creates a clone of this Rounded Rectangle
+         *
+         * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle
+         */
+        clone(): PIXI.RoundedRectangle;
+        /**
+         * Checks whether the x and y coordinates given are contained within this Rounded Rectangle
+         *
+         * @param {number} x - The X coordinate of the point to test
+         * @param {number} y - The Y coordinate of the point to test
+         * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle
+         */
+        contains(x: number, y: number): boolean;
+    }
+    /**
+     * Transform that takes care about its versions
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class Transform {
+        constructor();
+        /**
+         * The global matrix transform. It can be swapped temporarily by some functions like getLocalBounds()
+         *
+         * @member {PIXI.Matrix} PIXI.Transform#worldTransform
+         */
+        worldTransform: PIXI.Matrix;
+        /**
+         * The local matrix transform
+         *
+         * @member {PIXI.Matrix} PIXI.Transform#localTransform
+         */
+        localTransform: PIXI.Matrix;
+        /**
+         * The coordinate of the object relative to the local coordinates of the parent.
+         *
+         * @member {PIXI.ObservablePoint} PIXI.Transform#position
+         */
+        position: PIXI.ObservablePoint;
+        /**
+         * The scale factor of the object.
+         *
+         * @member {PIXI.ObservablePoint} PIXI.Transform#scale
+         */
+        scale: PIXI.ObservablePoint;
+        /**
+         * The pivot point of the displayObject that it rotates around.
+         *
+         * @member {PIXI.ObservablePoint} PIXI.Transform#pivot
+         */
+        pivot: PIXI.ObservablePoint;
+        /**
+         * The skew amount, on the x and y axis.
+         *
+         * @member {PIXI.ObservablePoint} PIXI.Transform#skew
+         */
+        skew: PIXI.ObservablePoint;
+        /**
+         * Updates only local matrix
+         */
+        updateLocalTransform(): void;
+        /**
+         * Updates the values of the object and applies the parent's transform.
+         *
+         * @param {PIXI.Transform} parentTransform - The transform of the parent of this object
+         */
+        updateTransform(parentTransform: PIXI.Transform): void;
+        /**
+         * Decomposes a matrix and sets the transforms properties based on it.
+         *
+         * @param {PIXI.Matrix} matrix - The matrix to decompose
+         */
+        setFromMatrix(matrix: PIXI.Matrix): void;
+        /**
+         * The rotation of the object in radians.
+         *
+         * @member {number}
+         */
+        rotation: number;
+    }
+    /**
+     * Base mesh class.
+     *
+     * This class empowers you to have maximum flexibility to render any kind of WebGL visuals you can think of.
+     * This class assumes a certain level of WebGL knowledge.
+     * If you know a bit this should abstract enough away to make you life easier!
+     *
+     * Pretty much ALL WebGL can be broken down into the following:
+     * - Geometry - The structure and data for the mesh. This can include anything from positions, uvs, normals, colors etc..
+     * - Shader - This is the shader that PixiJS will render the geometry with (attributes in the shader must match the geometry)
+     * - State - This is the state of WebGL required to render the mesh.
+     *
+     * Through a combination of the above elements you can render anything you want, 2D or 3D!
+     *
+     * @class
+     * @extends PIXI.Container
+     * @memberof PIXI
+     */
+    class Mesh extends PIXI.Container {
+        constructor(geometry: PIXI.Geometry, shader: PIXI.Shader | PIXI.MeshMaterial, state?: PIXI.State, drawMode?: number);
+        /**
+         * Renders the object using the Canvas renderer
+         *
+         * @protected
+         * @method _renderCanvas
+         * @memberof PIXI.Mesh#
+         * @param {PIXI.CanvasRenderer} renderer - The canvas renderer.
+         */
+        protected _renderCanvas(renderer: PIXI.CanvasRenderer): void;
+        /**
+         * Includes vertex positions, face indices, normals, colors, UVs, and
+         * custom attributes within buffers, reducing the cost of passing all
+         * this data to the GPU. Can be shared between multiple Mesh objects.
+         * @member {PIXI.Geometry} PIXI.Mesh#geometry
+         * @readonly
+         */
+        readonly geometry: PIXI.Geometry;
+        /**
+         * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.
+         * Can be shared between multiple Mesh objects.
+         * @member {PIXI.Shader|PIXI.MeshMaterial} PIXI.Mesh#shader
+         */
+        shader: PIXI.Shader | PIXI.MeshMaterial;
+        /**
+         * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g.,
+         * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.
+         * @member {PIXI.State} PIXI.Mesh#state
+         */
+        state: PIXI.State;
+        /**
+         * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants.
+         *
+         * @member {number} PIXI.Mesh#drawMode
+         * @see PIXI.DRAW_MODES
+         */
+        drawMode: number;
+        /**
+         * Typically the index of the IndexBuffer where to start drawing.
+         * @member {number} PIXI.Mesh#start
+         * @default 0
+         */
+        start: number;
+        /**
+         * How much of the geometry to draw, by default `0` renders everything.
+         * @member {number} PIXI.Mesh#size
+         * @default 0
+         */
+        size: number;
+        /**
+         * To change mesh uv's, change its uvBuffer data and increment its _updateID.
+         * @member {PIXI.Buffer}
+         * @readonly
+         */
+        readonly uvBuffer: PIXI.Buffer;
+        /**
+         * To change mesh vertices, change its uvBuffer data and increment its _updateID.
+         * Incrementing _updateID is optional because most of Mesh objects do it anyway.
+         * @member {PIXI.Buffer}
+         * @readonly
+         */
+        readonly verticesBuffer: PIXI.Buffer;
+        /**
+         * Alias for {@link PIXI.Mesh#shader}.
+         * @member {PIXI.Shader|PIXI.MeshMaterial}
+         */
+        material: PIXI.Shader | PIXI.MeshMaterial;
+        /**
+         * The blend mode to be applied to the Mesh. Apply a value of
+         * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
+         *
+         * @member {number}
+         * @default PIXI.BLEND_MODES.NORMAL;
+         * @see PIXI.BLEND_MODES
+         */
+        blendMode: number;
+        /**
+         * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
+         * Advantages can include sharper image quality (like text) and faster rendering on canvas.
+         * The main disadvantage is movement of objects may appear less smooth.
+         * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
+         *
+         * @member {boolean}
+         * @default false
+         */
+        roundPixels: boolean;
+        /**
+         * The multiply tint applied to the Mesh. This is a hex value. A value of
+         * `0xFFFFFF` will remove any tint effect.
+         *
+         * @member {number}
+         * @default 0xFFFFFF
+         */
+        tint: number;
+        /**
+         * The texture that the Mesh uses.
+         *
+         * @member {PIXI.Texture}
+         */
+        texture: PIXI.Texture;
+        /**
+         * Standard renderer draw.
+         * @protected
+         */
+        protected _render(): void;
+        /**
+         * Standard non-batching way of rendering.
+         * @protected
+         * @param {PIXI.Renderer} renderer - Instance to renderer.
+         */
+        protected _renderDefault(renderer: PIXI.Renderer): void;
+        /**
+         * Rendering by using the Batch system.
+         * @protected
+         * @param {PIXI.Renderer} renderer - Instance to renderer.
+         */
+        protected _renderToBatch(renderer: PIXI.Renderer): void;
+        /**
+         * Updates vertexData field based on transform and vertices
+         */
+        calculateVertices(): void;
+        /**
+         * Updates uv field based on from geometry uv's or batchUvs
+         */
+        calculateUvs(): void;
+        /**
+         * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.
+         * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.
+         *
+         * @protected
+         */
+        protected _calculateBounds(): void;
+        /**
+         * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.
+         *
+         * @param {PIXI.Point} point the point to test
+         * @return {boolean} the result of the test
+         */
+        containsPoint(point: PIXI.Point): boolean;
+        /**
+         * Destroys the Mesh object.
+         *
+         * @param {object|boolean} [options] - Options parameter. A boolean will act as if all
+         *  options have been set to that value
+         * @param {boolean} [options.children=false] - if set to true, all the children will have
+         *  their destroy method called as well. 'options' will be passed on to those calls.
+         */
+        destroy(options?: {
+            children?: boolean;
+        }): void;
+        /**
+         * The maximum number of vertices to consider batchable. Generally, the complexity
+         * of the geometry.
+         * @memberof PIXI.Mesh
+         * @static
+         * @member {number} BATCHABLE_SIZE
+         */
+        static BATCHABLE_SIZE: number;
+        /**
+         * @method PIXI.Container#renderWebGL
+         * @deprecated since 5.0.0
+         * @see PIXI.Container#render
+         * @param {PIXI.Renderer} renderer Instance of renderer
+         */
+        renderWebGL(renderer: PIXI.Renderer): void;
+        /**
+         * @method PIXI.Container#renderAdvancedWebGL
+         * @deprecated since 5.0.0
+         * @see PIXI.Container#renderAdvanced
+         * @param {PIXI.Renderer} renderer Instance of renderer
+         */
+        renderAdvancedWebGL(renderer: PIXI.Renderer): void;
+        /**
+         * Renders the object using the Canvas renderer
+         * @method renderCanvas
+         * @memberof PIXI.Container#
+         * @param {PIXI.CanvasRenderer} renderer - The renderer
+         */
+        renderCanvas(renderer: PIXI.CanvasRenderer): void;
+        /**
+         * The array of children of this container.
+         *
+         * @member {PIXI.DisplayObject[]} PIXI.Container#children
+         * @readonly
+         */
+        readonly children: PIXI.DisplayObject[];
+        /**
+         * If set to true, the container will sort its children by zIndex value
+         * when updateTransform() is called, or manually if sortChildren() is called.
+         *
+         * This actually changes the order of elements in the array, so should be treated
+         * as a basic solution that is not performant compared to other solutions,
+         * such as @link https://github.com/pixijs/pixi-display
+         *
+         * Also be aware of that this may not work nicely with the addChildAt() function,
+         * as the zIndex sorting may cause the child to automatically sorted to another position.
+         *
+         * @see PIXI.settings.SORTABLE_CHILDREN
+         *
+         * @member {boolean} PIXI.Container#sortableChildren
+         */
+        sortableChildren: boolean;
+        /**
+         * Should children be sorted by zIndex at the next updateTransform call.
+         * Will get automatically set to true if a new child is added, or if a child's zIndex changes.
+         *
+         * @member {boolean} PIXI.Container#sortDirty
+         */
+        sortDirty: boolean;
+        /**
+         * Overridable method that can be used by Container subclasses whenever the children array is modified
+         *
+         * @protected
+         */
+        protected onChildrenChange(): void;
+        /**
+         * Adds one or more children to the container.
+         *
+         * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
+         *
+         * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container
+         * @return {PIXI.DisplayObject} The first child that was added.
+         */
+        addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject;
+        /**
+         * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
+         *
+         * @param {PIXI.DisplayObject} child - The child to add
+         * @param {number} index - The index to place the child in
+         * @return {PIXI.DisplayObject} The child that was added.
+         */
+        addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject;
+        /**
+         * Swaps the position of 2 Display Objects within this container.
+         *
+         * @param {PIXI.DisplayObject} child - First display object to swap
+         * @param {PIXI.DisplayObject} child2 - Second display object to swap
+         */
+        swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void;
+        /**
+         * Returns the index position of a child DisplayObject instance
+         *
+         * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify
+         * @return {number} The index position of the child display object to identify
+         */
+        getChildIndex(child: PIXI.DisplayObject): number;
+        /**
+         * Changes the position of an existing child in the display object container
+         *
+         * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number
+         * @param {number} index - The resulting index number for the child display object
+         */
+        setChildIndex(child: PIXI.DisplayObject, index: number): void;
+        /**
+         * Returns the child at the specified index
+         *
+         * @param {number} index - The index to get the child at
+         * @return {PIXI.DisplayObject} The child at the given index, if any.
+         */
+        getChildAt(index: number): PIXI.DisplayObject;
+        /**
+         * Removes one or more children from the container.
+         *
+         * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove
+         * @return {PIXI.DisplayObject} The first child that was removed.
+         */
+        removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject;
+        /**
+         * Removes a child from the specified index position.
+         *
+         * @param {number} index - The index to get the child from
+         * @return {PIXI.DisplayObject} The child that was removed.
+         */
+        removeChildAt(index: number): PIXI.DisplayObject;
+        /**
+         * Removes all children from this container that are within the begin and end indexes.
+         *
+         * @param {number} [beginIndex=0] - The beginning position.
+         * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
+         * @returns {DisplayObject[]} List of removed children
+         */
+        removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[];
+        /**
+         * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex.
+         */
+        sortChildren(): void;
+        /**
+         * Updates the transform on all children of this container for rendering
+         */
+        updateTransform(): void;
+        /**
+         * Recalculates the bounds of the container.
+         *
+         */
+        calculateBounds(): void;
+        /**
+         * Renders the object using the WebGL renderer
+         *
+         * @param {PIXI.Renderer} renderer - The renderer
+         */
+        render(renderer: PIXI.Renderer): void;
+        /**
+         * Render the object using the WebGL renderer and advanced features.
+         *
+         * @protected
+         * @param {PIXI.Renderer} renderer - The renderer
+         */
+        protected renderAdvanced(renderer: PIXI.Renderer): void;
+        /**
+         * The width of the Container, setting this will actually modify the scale to achieve the value set
+         *
+         * @member {number}
+         */
+        width: number;
+        /**
+         * The height of the Container, setting this will actually modify the scale to achieve the value set
+         *
+         * @member {number}
+         */
+        height: number;
+        /**
+         * Determines if the children to the displayObject can be clicked/touched
+         * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
+         *
+         * @member {boolean}
+         * @memberof PIXI.Container#
+         */
+        interactiveChildren: boolean;
+        /**
+         * Returns the display object in the container.
+         *
+         * @method getChildByName
+         * @memberof PIXI.Container#
+         * @param {string} name - Instance name.
+         * @return {PIXI.DisplayObject} The child with the specified name.
+         */
+        getChildByName(name: string): PIXI.DisplayObject;
+        /**
+         *  Flag for if the object is accessible. If true AccessibilityManager will overlay a
+         *   shadow div with attributes set
+         *
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessible: boolean;
+        /**
+         * Sets the title attribute of the shadow div
+         * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'
+         *
+         * @member {?string}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessibleTitle: string;
+        /**
+         * Sets the aria-label attribute of the shadow div
+         *
+         * @member {string}
+         * @memberof PIXI.DisplayObject#
+         */
+        accessibleHint: string;
+        /**
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         * @todo Needs docs.
+         */
+        _accessibleActive: boolean;
+        /**
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         * @todo Needs docs.
+         */
+        _accessibleDiv: boolean;
+        /**
+         * World transform and local transform of this object.
+         * This will become read-only later, please do not assign anything there unless you know what are you doing.
+         *
+         * @member {PIXI.Transform} PIXI.DisplayObject#transform
+         */
+        transform: PIXI.Transform;
+        /**
+         * The opacity of the object.
+         *
+         * @member {number} PIXI.DisplayObject#alpha
+         */
+        alpha: number;
+        /**
+         * The visibility of the object. If false the object will not be drawn, and
+         * the updateTransform function will not be called.
+         *
+         * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
+         *
+         * @member {boolean} PIXI.DisplayObject#visible
+         */
+        visible: boolean;
+        /**
+         * Can this object be rendered, if false the object will not be drawn but the updateTransform
+         * methods will still be called.
+         *
+         * Only affects recursive calls from parent. You can ask for bounds manually.
+         *
+         * @member {boolean} PIXI.DisplayObject#renderable
+         */
+        renderable: boolean;
+        /**
+         * The display object container that contains this display object.
+         *
+         * @member {PIXI.Container} PIXI.DisplayObject#parent
+         * @readonly
+         */
+        readonly parent: PIXI.Container;
+        /**
+         * The multiplied alpha of the displayObject.
+         *
+         * @member {number} PIXI.DisplayObject#worldAlpha
+         * @readonly
+         */
+        readonly worldAlpha: number;
+        /**
+         * Which index in the children array the display component was before the previous zIndex sort.
+         * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.
+         *
+         * @member {number} PIXI.DisplayObject#_lastSortedIndex
+         * @protected
+         */
+        protected _lastSortedIndex: number;
+        /**
+         * The zIndex of the displayObject.
+         * A higher value will mean it will be rendered on top of other displayObjects within the same container.
+         *
+         * @member {number} PIXI.DisplayObject#_zIndex
+         * @protected
+         */
+        protected _zIndex: number;
+        /**
+         * The area the filter is applied to. This is used as more of an optimization
+         * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.
+         *
+         * Also works as an interaction mask.
+         *
+         * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea
+         */
+        filterArea: PIXI.Rectangle;
+        /**
+         * Sets the filters for the displayObject.
+         * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.
+         * To remove filters simply set this property to `'null'`.
+         *
+         * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters
+         */
+        filters: PIXI.Filter[];
+        /**
+         * The bounds object, this is used to calculate and store the bounds of the displayObject.
+         *
+         * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds
+         * @protected
+         */
+        protected _bounds: PIXI.Bounds;
+        /**
+         * The original, cached mask of the object.
+         *
+         * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask
+         * @protected
+         */
+        protected _mask: PIXI.Graphics | PIXI.Sprite;
+        /**
+         * If the object has been destroyed via destroy(). If true, it should not be used.
+         *
+         * @member {boolean} PIXI.DisplayObject#_destroyed
+         * @protected
+         */
+        protected _destroyed: boolean;
+        /**
+         * used to fast check if a sprite is.. a sprite!
+         * @member {boolean} PIXI.DisplayObject#isSprite
+         */
+        isSprite: boolean;
+        /**
+         * @protected
+         * @member {PIXI.DisplayObject}
+         */
+        protected _tempDisplayObjectParent: PIXI.DisplayObject;
+        /**
+         * Recursively updates transform of all objects from the root to this one
+         * internal function for toLocal()
+         */
+        _recursivePostUpdateTransform(): void;
+        /**
+         * Retrieves the bounds of the displayObject as a rectangle object.
+         *
+         * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from
+         *  being updated. This means the calculation returned MAY be out of date BUT will give you a
+         *  nice performance boost.
+         * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
+         * @return {PIXI.Rectangle} The rectangular bounding area.
+         */
+        getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * Retrieves the local bounds of the displayObject as a rectangle object.
+         *
+         * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation.
+         * @return {PIXI.Rectangle} The rectangular bounding area.
+         */
+        getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle;
+        /**
+         * Calculates the global position of the display object.
+         *
+         * @param {PIXI.IPoint} position - The world origin to calculate from.
+         * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional
+         *  (otherwise will create a new Point).
+         * @param {boolean} [skipUpdate=false] - Should we skip the update transform.
+         * @return {PIXI.IPoint} A point object representing the position of this object.
+         */
+        toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint;
+        /**
+         * Calculates the local position of the display object relative to another point.
+         *
+         * @param {PIXI.IPoint} position - The world origin to calculate from.
+         * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from.
+         * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional
+         *  (otherwise will create a new Point).
+         * @param {boolean} [skipUpdate=false] - Should we skip the update transform
+         * @return {PIXI.IPoint} A point object representing the position of this object
+         */
+        toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint;
+        /**
+         * Set the parent Container of this DisplayObject.
+         *
+         * @param {PIXI.Container} container - The Container to add this DisplayObject to.
+         * @return {PIXI.Container} The Container that this DisplayObject was added to.
+         */
+        setParent(container: PIXI.Container): PIXI.Container;
+        /**
+         * Convenience function to set the position, scale, skew and pivot at once.
+         *
+         * @param {number} [x=0] - The X position
+         * @param {number} [y=0] - The Y position
+         * @param {number} [scaleX=1] - The X scale value
+         * @param {number} [scaleY=1] - The Y scale value
+         * @param {number} [rotation=0] - The rotation
+         * @param {number} [skewX=0] - The X skew value
+         * @param {number} [skewY=0] - The Y skew value
+         * @param {number} [pivotX=0] - The X pivot value
+         * @param {number} [pivotY=0] - The Y pivot value
+         * @return {PIXI.DisplayObject} The DisplayObject instance
+         */
+        setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject;
+        /**
+         * The position of the displayObject on the x axis relative to the local coordinates of the parent.
+         * An alias to position.x
+         *
+         * @member {number}
+         */
+        x: number;
+        /**
+         * The position of the displayObject on the y axis relative to the local coordinates of the parent.
+         * An alias to position.y
+         *
+         * @member {number}
+         */
+        y: number;
+        /**
+         * Current transform of the object based on world (parent) factors.
+         *
+         * @member {PIXI.Matrix}
+         * @readonly
+         */
+        readonly worldTransform: PIXI.Matrix;
+        /**
+         * Current transform of the object based on local factors: position, scale, other stuff.
+         *
+         * @member {PIXI.Matrix}
+         * @readonly
+         */
+        readonly localTransform: PIXI.Matrix;
+        /**
+         * The coordinate of the object relative to the local coordinates of the parent.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        position: PIXI.IPoint;
+        /**
+         * The scale factor of the object.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        scale: PIXI.IPoint;
+        /**
+         * The pivot point of the displayObject that it rotates around.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.IPoint}
+         */
+        pivot: PIXI.IPoint;
+        /**
+         * The skew factor for the object in radians.
+         * Assignment by value since pixi-v4.
+         *
+         * @member {PIXI.ObservablePoint}
+         */
+        skew: PIXI.ObservablePoint;
+        /**
+         * The rotation of the object in radians.
+         * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
+         *
+         * @member {number}
+         */
+        rotation: number;
+        /**
+         * The angle of the object in degrees.
+         * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
+         *
+         * @member {number}
+         */
+        angle: number;
+        /**
+         * The zIndex of the displayObject.
+         * If a container has the sortableChildren property set to true, children will be automatically
+         * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,
+         * and thus rendered on top of other displayObjects within the same container.
+         *
+         * @member {number}
+         */
+        zIndex: number;
+        /**
+         * Indicates if the object is globally visible.
+         *
+         * @member {boolean}
+         * @readonly
+         */
+        readonly worldVisible: boolean;
+        /**
+         * Sets a mask for the displayObject. A mask is an object that limits the visibility of an
+         * object to the shape of the mask applied to it. In PixiJS a regular mask must be a
+         * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it
+         * utilities shape clipping. To remove a mask, set this property to `null`.
+         *
+         * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
+         * @example
+         * const graphics = new PIXI.Graphics();
+         * graphics.beginFill(0xFF3300);
+         * graphics.drawRect(50, 250, 100, 100);
+         * graphics.endFill();
+         *
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.mask = graphics;
+         * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.
+         *
+         * @member {PIXI.Graphics|PIXI.Sprite}
+         */
+        mask: PIXI.Graphics | PIXI.Sprite;
+        /**
+         * Enable interaction events for the DisplayObject. Touch, pointer and mouse
+         * events will not be emitted unless `interactive` is set to `true`.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.on('tap', (event) => {
+         *    //handle event
+         * });
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        interactive: boolean;
+        /**
+         * Interaction shape. Children will be hit first, then this shape will be checked.
+         * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);
+         * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle}
+         * @memberof PIXI.DisplayObject#
+         */
+        hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle;
+        /**
+         * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive
+         * Setting this changes the 'cursor' property to `'pointer'`.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.buttonMode = true;
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        buttonMode: boolean;
+        /**
+         * This defines what cursor mode is used when the mouse cursor
+         * is hovered over the displayObject.
+         *
+         * @example
+         * const sprite = new PIXI.Sprite(texture);
+         * sprite.interactive = true;
+         * sprite.cursor = 'wait';
+         * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor
+         *
+         * @member {string}
+         * @memberof PIXI.DisplayObject#
+         */
+        cursor: string;
+        /**
+         * Set this to true if you want this display object to be cached as a bitmap.
+         * This basically takes a snap shot of the display object as it is at that moment. It can
+         * provide a performance benefit for complex static displayObjects.
+         * To remove simply set this property to `false`
+         *
+         * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true
+         * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
+         *
+         * @member {boolean}
+         * @memberof PIXI.DisplayObject#
+         */
+        cacheAsBitmap: boolean;
+        /**
+         * The instance name of the object.
+         *
+         * @memberof PIXI.DisplayObject#
+         * @member {string} name
+         */
+        name: string;
+        /**
+         * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
+         *
+         * @method getGlobalPosition
+         * @memberof PIXI.DisplayObject#
+         * @param {Point} point - The point to write the global value to. If null a new point will be returned
+         * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from
+         *  being updated. This means the calculation returned MAY be out of date BUT will give you a
+         *  nice performance boost.
+         * @return {Point} The updated point.
+         */
+        getGlobalPosition(point: Point, skipUpdate: boolean): Point;
+    }
+    /**
+     * Class controls cache for UV mapping from Texture normal space to BaseTexture normal space.
+     *
+     * @class
+     * @memberof PIXI
+     */
+    class MeshBatchUvs {
+        constructor(uvBuffer: PIXI.Buffer, uvMatrix: PIXI.TextureMatrix);
+        /**
+         * Buffer with normalized UV's
+         * @member {PIXI.Buffer} PIXI.MeshBatchUvs#uvBuffer
+         */
+        uvBuffer: PIXI.Buffer;
+        /**
+         * Material UV matrix
+         * @member {PIXI.TextureMatrix} PIXI.MeshBatchUvs#uvMatrix
+         */
+        uvMatrix: PIXI.TextureMatrix;
+        /**
+         * UV Buffer data
+         * @member {Float32Array} PIXI.MeshBatchUvs#data
+         * @readonly
+         */
+        readonly data: Float32Array;
+        /**
+         * updates
+         *
+         * @param {boolean} forceUpdate - force the update
+         */
+        update(forceUpdate: boolean): void;
+    }
+    /**
+     * Standard 2D geometry used in PixiJS.
+     *
+     * Geometry can be defined without passing in a style or data if required.
+     *
+     * ```js
+     * const geometry = new PIXI.Geometry();
+     *
+     * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);
+     * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1], 2);
+     * geometry.addIndex([0,1,2,1,3,2]);
+     *
+     * ```
+     * @class
+     * @memberof PIXI
+     * @extends PIXI.Geometry
+     */
+    class MeshGeometry extends PIXI.Geometry {
+        constructor(vertices: Float32Array | number[], uvs: Float32Array | number[], index: Uint16Array | number[]);
+        /**
+         * A map of renderer IDs to webgl VAOs
+         *
+         * @protected
+         * @type {object}
+         */
+        protected glVertexArrayObjects: any;
+        /**
+         * Count of existing (not destroyed) meshes that reference this geometry
+         * @member {boolean} PIXI.Geometry#refCount
+         */
+        refCount: boolean;
+        /**
+         *
+         * Adds an attribute to the geometry
+         *
+         * @param {String} id - the name of the attribute (matching up to a shader)
+         * @param {PIXI.Buffer} [buffer] the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.
+         * @param {Number} [size=0] the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
+         * @param {Boolean} [normalized=false] should the data be normalized.
+         * @param {Number} [type=PIXI.TYPES.FLOAT] what type of number is the attribute. Check {PIXI.TYPES} to see the ones available
+         * @param {Number} [stride=0] How far apart (in floats) the start of each value is. (used for interleaving data)
+         * @param {Number} [start=0] How far into the array to start reading values (used for interleaving data)
+         *
+         * @return {PIXI.Geometry} returns self, useful for chaining.
+         */
+        addAttribute(id: string, buffer?: PIXI.Buffer, size?: number, normalized?: boolean, type?: number, stride?: number, start?: number): PIXI.Geometry;
+        /**
+         * returns the requested attribute
+         *
+         * @param {String} id  the name of the attribute required
+         * @return {PIXI.Attribute} the attribute requested.
+         */
+        getAttribute(id: string): PIXI.Attribute;
+        /**
+         * returns the requested buffer
+         *
+         * @param {String} id  the name of the buffer required
+         * @return {PIXI.Buffer} the buffer requested.
+         */
+        getBuffer(id: string): PIXI.Buffer;
+        /**
+         *
+         * Adds an index buffer to the geometry
+         * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.
+         *
+         * @param {PIXI.Buffer} [buffer] the buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.
+         * @return {PIXI.Geometry} returns self, useful for chaining.
+         */
+        addIndex(buffer?: PIXI.Buffer): PIXI.Geometry;
+        /**
+         * returns the index buffer
+         *
+         * @return {PIXI.Buffer} the index buffer.
+         */
+        getIndex(): PIXI.Buffer;
+        /**
+         * this function modifies the structure so that all current attributes become interleaved into a single buffer
+         * This can be useful if your model remains static as it offers a little performance boost
+         *
+         * @return {PIXI.Geometry} returns self, useful for chaining.
+         */
+        interleave(): PIXI.Geometry;
+        /**
+         * disposes WebGL resources that are connected to this geometry
+         */
+        dispose(): void;
+        /**
+         * Destroys the geometry.
+         */
+        destroy(): void;
+        /**
+         * returns a clone of the geometry
+         *
+         * @returns {PIXI.Geometry} a new clone of this geometry
+         */
+        clone(): PIXI.Geometry;
+    }
+    /**
+     * Slightly opinionated default shader for PixiJS 2D objects.
+     * @class
+     * @memberof PIXI
+     * @extends PIXI.Shader
+     */
+    class MeshMaterial extends PIXI.Shader {
+        constructor(uSampler: PIXI.Texture, options?: {
+            alpha?: number;
+            tint?: number;
+            pluginName?: string;
+            program?: PIXI.Program;
+            uniforms?: any;
+        });
+        /**
+         * Renders the mesh using the Canvas renderer
+         *
+         * @protected
+         * @method render
+         * @memberof PIXI.MeshMaterial#
+         * @param {PIXI.CanvasRenderer} renderer - The canvas renderer.
+         * @param {PIXI.Mesh} mesh - Mesh to render.
+         */
+        protected render(renderer: PIXI.CanvasRenderer, mesh: PIXI.Mesh): void;
+        /**
+         * TextureMatrix instance for this Mesh, used to track Texture changes
+         *
+         * @member {PIXI.TextureMatrix} PIXI.MeshMaterial#uvMatrix
+         * @readonly
+         */
+        readonly uvMatrix: PIXI.TextureMatrix;
+        /**
+         * `true` if shader can be batch with the renderer's batch system.
+         * @member {boolean} PIXI.MeshMaterial#batchable
+         * @default true
+         */
+        batchable: boolean;
+        /**
+         * Renderer plugin for batching
+         *
+         * @member {string} PIXI.MeshMaterial#pluginName
+         * @default 'batch'
+         */
+        pluginName: string;
+        /**
+         * Reference to the texture being rendered.
+         * @member {PIXI.Texture}
+         */
+        texture: PIXI.Texture;
+        /**
+         * This gets automatically set by the object using this.
+         *
+         * @default 1
+         * @member {number}
+         */
+        alpha: number;
+        /**
+         * Multiply tint for the material.
+         * @member {number}
+         * @default 0xFFFFFF
+         */
+        tint: number;
+        /**
+         * Gets called automatically by the Mesh. Intended to be overridden for custom
+         * MeshMaterial objects.
+         */
+        update(): void;
+        /**
+         * Shader uniform values, shortcut for `uniformGroup.uniforms`
+         * @readonly
+         * @member {object}
+         */
+        readonly uniforms: any;
+    }
+    /**
+     * RopeGeometry allows you to draw a geometry across several points and then manipulate these points.
+     *
+     * ```js
+     * for (let i = 0; i < 20; i++) {
+     *     points.push(new PIXI.Point(i * 50, 0));
+     * };
+     * const rope = new PIXI.RopeGeometry(100, points);
+     * ```
+     *
+     * @class
+     * @extends PIXI.MeshGeometry
+     * @memberof PIXI
+     *
+     */
+    class RopeGeometry extends PIXI.MeshGeometry {
+        constructor(width?: number, points?: PIXI.Point[]);
+        /**
+         * An array of points that determine the rope
+         * @member {PIXI.Point[]} PIXI.RopeGeometry#points
+         */
+        points: PIXI.Point[];
+        /**
+         * The width (i.e., thickness) of the rope.
+         * @member {number} PIXI.RopeGeometry#width
+         * @readOnly
+         */
+        readonly width: number;
+        /**
+         * refreshes vertices of Rope mesh
+         */
+        updateVertices(): void;
+        /**
+         * A map of renderer IDs to webgl VAOs
+         *
+         * @protected
+         * @type {object}
+         */
+        protected glVertexArrayObjects: any;
+        /**
+         * Count of existing (not destroyed) meshes that reference this geometry
+         * @member {boolean} PIXI.Geometry#refCount
+         */
+        refCount: boolean;
+        /**
+         *
+         * Adds an attribute to the geometry
+         *
+         * @param {String} id - the name of the attribute (matching up to a shader)
+         * @param {PIXI.Buffer} [buffer] the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.
+         * @param {Number} [size=0] the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2
+         * @param {Boolean} [normalized=false] should the data be normalized.
+         * @param {Number} [type=PIXI.TYPES.FLOAT] what type of number is the attribute. Check {PIXI.TYPES} to see the ones available
+         * @param {Number} [stride=0] How far apart (in floats) the start of each value is. (used for interleaving data)
+         * @param {Number} [start=0] How far into the array to start reading values (used for interleaving data)
+         *
+         * @return {PIXI.Geometry} returns self, useful for chaining.
+         */
+        addAttribute(id: string, buffer?: PIXI.Buffer, size?: number, normalized?: boolean, type?: number, stride?: number, start?: number): PIXI.Geometry;
+        /**
+         * returns the requested attribute
+         *
+         * @param {String} id  the name of the attribute required
+         * @return {PIXI.Attribute} the attribute requested.
+         */
+        getAttribute(id: string): PIXI.Attribute;
+        /**
+         * returns the requested buffer
+         *
+         * @param {String} id  the name of the buffer required
+         * @return {PIXI.Buffer} the buffer requested.
+         */
+        getBuffer(id: string): PIXI.Buffer;
+        /**
+         *
+         * Adds an index buffer to the geometry
+         * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.
+         *
+         * @param {PIXI.Buffer} [buffer] the buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.
+         * @return {PIXI.Geometry} returns self, useful for chaining.
+         */
+        addIndex(buffer?: PIXI.Buffer): PIXI.Geometry;
+        /**
+         * returns the index buffer
+         *
+         * @return {PIXI.Buffer} the index buffer.
+         */
+        getIndex(): PIXI.Buffer;
+        /**
+         * this function modifies the structure so that all current attributes become interleaved into a single buffer
+         * This can be useful if your model remains static as it offers a little performance boost
+         *
+         * @return {PIXI.Geometry} returns self, useful for chaining.
+         */
+        interleave(): PIXI.Geometry;
+        /**
+         * disposes WebGL resources that are connected to this geometry
+         */
+        dispose(): void;
+        /**
+         * Destroys the geometry.
+         */
+        destroy(): void;
+        /**
+         * returns a clone of the geometry
+         *
+         * @returns {PIXI.Geometry} a new clone of this geometry
+         */
+        clone(): PIXI.Geometry;
+    }
+    /**
+     * The NineSlicePlane allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful
+     * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically
+     *
+     *```js
+     * let Plane9 = new PIXI.NineSlicePlane(PIXI.Texture.from('BoxWithRoundedCorners.png'), 15, 15, 15, 15);
+     *  ```
+     * 
+     *      A                          B
+     *    +---+----------------------+---+
+     *  C | 1 |          2           | 3 |
+     *    +---+----------------------+---+
+     *    |   |                      |   |
+     *    | 4 |          5           | 6 |
+     *    |   |                      |   |
+     *    +---+----------------------+---+
+     *  D | 7 |          8           | 9 |
+     *    +---+----------------------+---+
+    
+     *  When changing this objects width and/or height:
+     *     areas 1 3 7 and 9 will remain unscaled.
+     *     areas 2 and 8 will be stretched horizontally
+     *     areas 4 and 6 will be stretched vertically
+     *     area 5 will be stretched both horizontally and vertically
+     * 
+ * + * @class + * @extends PIXI.SimplePlane + * @memberof PIXI + * + */ + class NineSlicePlane extends PIXI.SimplePlane { + constructor(texture: PIXI.Texture, leftWidth?: number, topHeight?: number, rightWidth?: number, bottomHeight?: number); + /** + * Cached tint value so we can tell when the tint is changed. + * @memberof PIXI.NineSlicePlane# + * @member {number} _cachedTint + * @protected + */ + protected _cachedTint: number; + /** + * Cached tinted texture. + * @memberof PIXI.NineSlicePlane# + * @member {HTMLCanvasElement} _tintedCanvas + * @protected + */ + protected _tintedCanvas: HTMLCanvasElement; + /** + * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane + * + * @member {number} PIXI.NineSlicePlane#_width + * @override + */ + _width: number; + /** + * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane + * + * @member {number} PIXI.NineSlicePlane#_height + * @override + */ + _height: number; + /** + * Updates the horizontal vertices. + * + */ + updateHorizontalVertices(): void; + /** + * Updates the vertical vertices. + * + */ + updateVerticalVertices(): void; + /** + * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane + * + * @member {number} + */ + width: number; + /** + * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane + * + * @member {number} + */ + height: number; + /** + * The width of the left column + * + * @member {number} + */ + leftWidth: number; + /** + * The width of the right column + * + * @member {number} + */ + rightWidth: number; + /** + * The height of the top row + * + * @member {number} + */ + topHeight: number; + /** + * The height of the bottom row + * + * @member {number} + */ + bottomHeight: number; + /** + * Refreshes NineSlicePlane coords. All of them. + */ + _refresh(): void; + /** + * Method used for overrides, to do something in case texture frame was changed. + * Meshes based on plane can override it and change more details based on texture. + */ + textureUpdated(): void; + /** + * Includes vertex positions, face indices, normals, colors, UVs, and + * custom attributes within buffers, reducing the cost of passing all + * this data to the GPU. Can be shared between multiple Mesh objects. + * @member {PIXI.Geometry} PIXI.Mesh#geometry + * @readonly + */ + readonly geometry: PIXI.Geometry; + /** + * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. + * Can be shared between multiple Mesh objects. + * @member {PIXI.Shader|PIXI.MeshMaterial} PIXI.Mesh#shader + */ + shader: PIXI.Shader | PIXI.MeshMaterial; + /** + * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g., + * blend mode, culling, depth testing, direction of rendering triangles, backface, etc. + * @member {PIXI.State} PIXI.Mesh#state + */ + state: PIXI.State; + /** + * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants. + * + * @member {number} PIXI.Mesh#drawMode + * @see PIXI.DRAW_MODES + */ + drawMode: number; + /** + * Typically the index of the IndexBuffer where to start drawing. + * @member {number} PIXI.Mesh#start + * @default 0 + */ + start: number; + /** + * How much of the geometry to draw, by default `0` renders everything. + * @member {number} PIXI.Mesh#size + * @default 0 + */ + size: number; + /** + * To change mesh uv's, change its uvBuffer data and increment its _updateID. + * @member {PIXI.Buffer} + * @readonly + */ + readonly uvBuffer: PIXI.Buffer; + /** + * To change mesh vertices, change its uvBuffer data and increment its _updateID. + * Incrementing _updateID is optional because most of Mesh objects do it anyway. + * @member {PIXI.Buffer} + * @readonly + */ + readonly verticesBuffer: PIXI.Buffer; + /** + * Alias for {@link PIXI.Mesh#shader}. + * @member {PIXI.Shader|PIXI.MeshMaterial} + */ + material: PIXI.Shader | PIXI.MeshMaterial; + /** + * The blend mode to be applied to the Mesh. Apply a value of + * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. + * + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES + */ + blendMode: number; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * To set the global default, change {@link PIXI.settings.ROUND_PIXELS} + * + * @member {boolean} + * @default false + */ + roundPixels: boolean; + /** + * The multiply tint applied to the Mesh. This is a hex value. A value of + * `0xFFFFFF` will remove any tint effect. + * + * @member {number} + * @default 0xFFFFFF + */ + tint: number; + /** + * The texture that the Mesh uses. + * + * @member {PIXI.Texture} + */ + texture: PIXI.Texture; + /** + * Standard renderer draw. + * @protected + */ + protected _render(): void; + /** + * Standard non-batching way of rendering. + * @protected + * @param {PIXI.Renderer} renderer - Instance to renderer. + */ + protected _renderDefault(renderer: PIXI.Renderer): void; + /** + * Rendering by using the Batch system. + * @protected + * @param {PIXI.Renderer} renderer - Instance to renderer. + */ + protected _renderToBatch(renderer: PIXI.Renderer): void; + /** + * Updates vertexData field based on transform and vertices + */ + calculateVertices(): void; + /** + * Updates uv field based on from geometry uv's or batchUvs + */ + calculateUvs(): void; + /** + * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. + * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly. + * + * @protected + */ + protected _calculateBounds(): void; + /** + * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES. + * + * @param {PIXI.Point} point the point to test + * @return {boolean} the result of the test + */ + containsPoint(point: PIXI.Point): boolean; + /** + * Destroys the Mesh object. + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all + * options have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have + * their destroy method called as well. 'options' will be passed on to those calls. + */ + destroy(options?: { + children?: boolean; + }): void; + /** + * @method PIXI.Container#renderWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#render + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderWebGL(renderer: PIXI.Renderer): void; + /** + * @method PIXI.Container#renderAdvancedWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#renderAdvanced + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderAdvancedWebGL(renderer: PIXI.Renderer): void; + /** + * Renders the object using the Canvas renderer + * @method renderCanvas + * @memberof PIXI.Container# + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} PIXI.Container#children + * @readonly + */ + readonly children: PIXI.DisplayObject[]; + /** + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @see PIXI.settings.SORTABLE_CHILDREN + * + * @member {boolean} PIXI.Container#sortableChildren + */ + sortableChildren: boolean; + /** + * Should children be sorted by zIndex at the next updateTransform call. + * Will get automatically set to true if a new child is added, or if a child's zIndex changes. + * + * @member {boolean} PIXI.Container#sortDirty + */ + sortDirty: boolean; + /** + * Overridable method that can be used by Container subclasses whenever the children array is modified + * + * @protected + */ + protected onChildrenChange(): void; + /** + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. + */ + addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject; + /** + * Swaps the position of 2 Display Objects within this container. + * + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap + */ + swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void; + /** + * Returns the index position of a child DisplayObject instance + * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify + */ + getChildIndex(child: PIXI.DisplayObject): number; + /** + * Changes the position of an existing child in the display object container + * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object + */ + setChildIndex(child: PIXI.DisplayObject, index: number): void; + /** + * Returns the child at the specified index + * + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. + */ + getChildAt(index: number): PIXI.DisplayObject; + /** + * Removes one or more children from the container. + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. + */ + removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Removes a child from the specified index position. + * + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. + */ + removeChildAt(index: number): PIXI.DisplayObject; + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; + /** + * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex. + */ + sortChildren(): void; + /** + * Updates the transform on all children of this container for rendering + */ + updateTransform(): void; + /** + * Recalculates the bounds of the container. + * + */ + calculateBounds(): void; + /** + * Renders the object using the WebGL renderer + * + * @param {PIXI.Renderer} renderer - The renderer + */ + render(renderer: PIXI.Renderer): void; + /** + * Render the object using the WebGL renderer and advanced features. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected renderAdvanced(renderer: PIXI.Renderer): void; + /** + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows PixiJS to bypass a recursive `hitTest` function + * + * @member {boolean} + * @memberof PIXI.Container# + */ + interactiveChildren: boolean; + /** + * Returns the display object in the container. + * + * @method getChildByName + * @memberof PIXI.Container# + * @param {string} name - Instance name. + * @return {PIXI.DisplayObject} The child with the specified name. + */ + getChildByName(name: string): PIXI.DisplayObject; + /** + * Flag for if the object is accessible. If true AccessibilityManager will overlay a + * shadow div with attributes set + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + accessible: boolean; + /** + * Sets the title attribute of the shadow div + * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]' + * + * @member {?string} + * @memberof PIXI.DisplayObject# + */ + accessibleTitle: string; + /** + * Sets the aria-label attribute of the shadow div + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + accessibleHint: string; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleActive: boolean; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleDiv: boolean; + /** + * World transform and local transform of this object. + * This will become read-only later, please do not assign anything there unless you know what are you doing. + * + * @member {PIXI.Transform} PIXI.DisplayObject#transform + */ + transform: PIXI.Transform; + /** + * The opacity of the object. + * + * @member {number} PIXI.DisplayObject#alpha + */ + alpha: number; + /** + * The visibility of the object. If false the object will not be drawn, and + * the updateTransform function will not be called. + * + * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually. + * + * @member {boolean} PIXI.DisplayObject#visible + */ + visible: boolean; + /** + * Can this object be rendered, if false the object will not be drawn but the updateTransform + * methods will still be called. + * + * Only affects recursive calls from parent. You can ask for bounds manually. + * + * @member {boolean} PIXI.DisplayObject#renderable + */ + renderable: boolean; + /** + * The display object container that contains this display object. + * + * @member {PIXI.Container} PIXI.DisplayObject#parent + * @readonly + */ + readonly parent: PIXI.Container; + /** + * The multiplied alpha of the displayObject. + * + * @member {number} PIXI.DisplayObject#worldAlpha + * @readonly + */ + readonly worldAlpha: number; + /** + * Which index in the children array the display component was before the previous zIndex sort. + * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider. + * + * @member {number} PIXI.DisplayObject#_lastSortedIndex + * @protected + */ + protected _lastSortedIndex: number; + /** + * The zIndex of the displayObject. + * A higher value will mean it will be rendered on top of other displayObjects within the same container. + * + * @member {number} PIXI.DisplayObject#_zIndex + * @protected + */ + protected _zIndex: number; + /** + * The area the filter is applied to. This is used as more of an optimization + * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. + * + * Also works as an interaction mask. + * + * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea + */ + filterArea: PIXI.Rectangle; + /** + * Sets the filters for the displayObject. + * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * To remove filters simply set this property to `'null'`. + * + * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters + */ + filters: PIXI.Filter[]; + /** + * The bounds object, this is used to calculate and store the bounds of the displayObject. + * + * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds + * @protected + */ + protected _bounds: PIXI.Bounds; + /** + * The original, cached mask of the object. + * + * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask + * @protected + */ + protected _mask: PIXI.Graphics | PIXI.Sprite; + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} PIXI.DisplayObject#_destroyed + * @protected + */ + protected _destroyed: boolean; + /** + * used to fast check if a sprite is.. a sprite! + * @member {boolean} PIXI.DisplayObject#isSprite + */ + isSprite: boolean; + /** + * @protected + * @member {PIXI.DisplayObject} + */ + protected _tempDisplayObjectParent: PIXI.DisplayObject; + /** + * Recursively updates transform of all objects from the root to this one + * internal function for toLocal() + */ + _recursivePostUpdateTransform(): void; + /** + * Retrieves the bounds of the displayObject as a rectangle object. + * + * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Retrieves the local bounds of the displayObject as a rectangle object. + * + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Calculates the global position of the display object. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform. + * @return {PIXI.IPoint} A point object representing the position of this object. + */ + toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Calculates the local position of the display object relative to another point. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform + * @return {PIXI.IPoint} A point object representing the position of this object + */ + toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Set the parent Container of this DisplayObject. + * + * @param {PIXI.Container} container - The Container to add this DisplayObject to. + * @return {PIXI.Container} The Container that this DisplayObject was added to. + */ + setParent(container: PIXI.Container): PIXI.Container; + /** + * Convenience function to set the position, scale, skew and pivot at once. + * + * @param {number} [x=0] - The X position + * @param {number} [y=0] - The Y position + * @param {number} [scaleX=1] - The X scale value + * @param {number} [scaleY=1] - The Y scale value + * @param {number} [rotation=0] - The rotation + * @param {number} [skewX=0] - The X skew value + * @param {number} [skewY=0] - The Y skew value + * @param {number} [pivotX=0] - The X pivot value + * @param {number} [pivotY=0] - The Y pivot value + * @return {PIXI.DisplayObject} The DisplayObject instance + */ + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject; + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * An alias to position.x + * + * @member {number} + */ + x: number; + /** + * The position of the displayObject on the y axis relative to the local coordinates of the parent. + * An alias to position.y + * + * @member {number} + */ + y: number; + /** + * Current transform of the object based on world (parent) factors. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly worldTransform: PIXI.Matrix; + /** + * Current transform of the object based on local factors: position, scale, other stuff. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly localTransform: PIXI.Matrix; + /** + * The coordinate of the object relative to the local coordinates of the parent. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + position: PIXI.IPoint; + /** + * The scale factor of the object. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + scale: PIXI.IPoint; + /** + * The pivot point of the displayObject that it rotates around. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + pivot: PIXI.IPoint; + /** + * The skew factor for the object in radians. + * Assignment by value since pixi-v4. + * + * @member {PIXI.ObservablePoint} + */ + skew: PIXI.ObservablePoint; + /** + * The rotation of the object in radians. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + rotation: number; + /** + * The angle of the object in degrees. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + angle: number; + /** + * The zIndex of the displayObject. + * If a container has the sortableChildren property set to true, children will be automatically + * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, + * and thus rendered on top of other displayObjects within the same container. + * + * @member {number} + */ + zIndex: number; + /** + * Indicates if the object is globally visible. + * + * @member {boolean} + * @readonly + */ + readonly worldVisible: boolean; + /** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an + * object to the shape of the mask applied to it. In PixiJS a regular mask must be a + * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it + * utilities shape clipping. To remove a mask, set this property to `null`. + * + * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. + * @example + * const graphics = new PIXI.Graphics(); + * graphics.beginFill(0xFF3300); + * graphics.drawRect(50, 250, 100, 100); + * graphics.endFill(); + * + * const sprite = new PIXI.Sprite(texture); + * sprite.mask = graphics; + * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * + * @member {PIXI.Graphics|PIXI.Sprite} + */ + mask: PIXI.Graphics | PIXI.Sprite; + /** + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + interactive: boolean; + /** + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# + */ + hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle; + /** + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + buttonMode: boolean; + /** + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + cursor: string; + /** + * Set this to true if you want this display object to be cached as a bitmap. + * This basically takes a snap shot of the display object as it is at that moment. It can + * provide a performance benefit for complex static displayObjects. + * To remove simply set this property to `false` + * + * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + cacheAsBitmap: boolean; + /** + * The instance name of the object. + * + * @memberof PIXI.DisplayObject# + * @member {string} name + */ + name: string; + /** + * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot. + * + * @method getGlobalPosition + * @memberof PIXI.DisplayObject# + * @param {Point} point - The point to write the global value to. If null a new point will be returned + * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @return {Point} The updated point. + */ + getGlobalPosition(point: Point, skipUpdate: boolean): Point; + } + /** + * The Simple Mesh class mimics Mesh in PixiJS v4, providing easy-to-use constructor arguments. + * For more robust customization, use {@link PIXI.Mesh}. + * + * @class + * @extends PIXI.Mesh + * @memberof PIXI + */ + class SimpleMesh extends PIXI.Mesh { + constructor(texture?: PIXI.Texture, vertices?: Float32Array, uvs?: Float32Array, indices?: Uint16Array, drawMode?: number); + /** + * Triangles in canvas mode are automatically antialiased, use this value to force triangles + * to overlap a bit with each other. To set the global default, set {@link PIXI.settings.MESH_CANVAS_PADDING} + * + * @see PIXI.settings.MESH_CANVAS_PADDING + * @member {number} canvasPadding + * @memberof PIXI.SimpleMesh# + * @default 0 + */ + canvasPadding: number; + /** + * upload vertices buffer each frame + * @member {boolean} PIXI.SimpleMesh#autoUpdate + */ + autoUpdate: boolean; + /** + * Collection of vertices data. + * @member {Float32Array} + */ + vertices: Float32Array; + /** + * Includes vertex positions, face indices, normals, colors, UVs, and + * custom attributes within buffers, reducing the cost of passing all + * this data to the GPU. Can be shared between multiple Mesh objects. + * @member {PIXI.Geometry} PIXI.Mesh#geometry + * @readonly + */ + readonly geometry: PIXI.Geometry; + /** + * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. + * Can be shared between multiple Mesh objects. + * @member {PIXI.Shader|PIXI.MeshMaterial} PIXI.Mesh#shader + */ + shader: PIXI.Shader | PIXI.MeshMaterial; + /** + * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g., + * blend mode, culling, depth testing, direction of rendering triangles, backface, etc. + * @member {PIXI.State} PIXI.Mesh#state + */ + state: PIXI.State; + /** + * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants. + * + * @member {number} PIXI.Mesh#drawMode + * @see PIXI.DRAW_MODES + */ + drawMode: number; + /** + * Typically the index of the IndexBuffer where to start drawing. + * @member {number} PIXI.Mesh#start + * @default 0 + */ + start: number; + /** + * How much of the geometry to draw, by default `0` renders everything. + * @member {number} PIXI.Mesh#size + * @default 0 + */ + size: number; + /** + * To change mesh uv's, change its uvBuffer data and increment its _updateID. + * @member {PIXI.Buffer} + * @readonly + */ + readonly uvBuffer: PIXI.Buffer; + /** + * To change mesh vertices, change its uvBuffer data and increment its _updateID. + * Incrementing _updateID is optional because most of Mesh objects do it anyway. + * @member {PIXI.Buffer} + * @readonly + */ + readonly verticesBuffer: PIXI.Buffer; + /** + * Alias for {@link PIXI.Mesh#shader}. + * @member {PIXI.Shader|PIXI.MeshMaterial} + */ + material: PIXI.Shader | PIXI.MeshMaterial; + /** + * The blend mode to be applied to the Mesh. Apply a value of + * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. + * + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES + */ + blendMode: number; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * To set the global default, change {@link PIXI.settings.ROUND_PIXELS} + * + * @member {boolean} + * @default false + */ + roundPixels: boolean; + /** + * The multiply tint applied to the Mesh. This is a hex value. A value of + * `0xFFFFFF` will remove any tint effect. + * + * @member {number} + * @default 0xFFFFFF + */ + tint: number; + /** + * The texture that the Mesh uses. + * + * @member {PIXI.Texture} + */ + texture: PIXI.Texture; + /** + * Standard renderer draw. + * @protected + */ + protected _render(): void; + /** + * Standard non-batching way of rendering. + * @protected + * @param {PIXI.Renderer} renderer - Instance to renderer. + */ + protected _renderDefault(renderer: PIXI.Renderer): void; + /** + * Rendering by using the Batch system. + * @protected + * @param {PIXI.Renderer} renderer - Instance to renderer. + */ + protected _renderToBatch(renderer: PIXI.Renderer): void; + /** + * Updates vertexData field based on transform and vertices + */ + calculateVertices(): void; + /** + * Updates uv field based on from geometry uv's or batchUvs + */ + calculateUvs(): void; + /** + * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. + * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly. + * + * @protected + */ + protected _calculateBounds(): void; + /** + * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES. + * + * @param {PIXI.Point} point the point to test + * @return {boolean} the result of the test + */ + containsPoint(point: PIXI.Point): boolean; + /** + * Destroys the Mesh object. + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all + * options have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have + * their destroy method called as well. 'options' will be passed on to those calls. + */ + destroy(options?: { + children?: boolean; + }): void; + /** + * @method PIXI.Container#renderWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#render + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderWebGL(renderer: PIXI.Renderer): void; + /** + * @method PIXI.Container#renderAdvancedWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#renderAdvanced + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderAdvancedWebGL(renderer: PIXI.Renderer): void; + /** + * Renders the object using the Canvas renderer + * @method renderCanvas + * @memberof PIXI.Container# + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} PIXI.Container#children + * @readonly + */ + readonly children: PIXI.DisplayObject[]; + /** + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @see PIXI.settings.SORTABLE_CHILDREN + * + * @member {boolean} PIXI.Container#sortableChildren + */ + sortableChildren: boolean; + /** + * Should children be sorted by zIndex at the next updateTransform call. + * Will get automatically set to true if a new child is added, or if a child's zIndex changes. + * + * @member {boolean} PIXI.Container#sortDirty + */ + sortDirty: boolean; + /** + * Overridable method that can be used by Container subclasses whenever the children array is modified + * + * @protected + */ + protected onChildrenChange(): void; + /** + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. + */ + addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject; + /** + * Swaps the position of 2 Display Objects within this container. + * + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap + */ + swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void; + /** + * Returns the index position of a child DisplayObject instance + * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify + */ + getChildIndex(child: PIXI.DisplayObject): number; + /** + * Changes the position of an existing child in the display object container + * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object + */ + setChildIndex(child: PIXI.DisplayObject, index: number): void; + /** + * Returns the child at the specified index + * + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. + */ + getChildAt(index: number): PIXI.DisplayObject; + /** + * Removes one or more children from the container. + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. + */ + removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Removes a child from the specified index position. + * + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. + */ + removeChildAt(index: number): PIXI.DisplayObject; + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; + /** + * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex. + */ + sortChildren(): void; + /** + * Updates the transform on all children of this container for rendering + */ + updateTransform(): void; + /** + * Recalculates the bounds of the container. + * + */ + calculateBounds(): void; + /** + * Renders the object using the WebGL renderer + * + * @param {PIXI.Renderer} renderer - The renderer + */ + render(renderer: PIXI.Renderer): void; + /** + * Render the object using the WebGL renderer and advanced features. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected renderAdvanced(renderer: PIXI.Renderer): void; + /** + * The width of the Container, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + width: number; + /** + * The height of the Container, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + height: number; + /** + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows PixiJS to bypass a recursive `hitTest` function + * + * @member {boolean} + * @memberof PIXI.Container# + */ + interactiveChildren: boolean; + /** + * Returns the display object in the container. + * + * @method getChildByName + * @memberof PIXI.Container# + * @param {string} name - Instance name. + * @return {PIXI.DisplayObject} The child with the specified name. + */ + getChildByName(name: string): PIXI.DisplayObject; + /** + * Flag for if the object is accessible. If true AccessibilityManager will overlay a + * shadow div with attributes set + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + accessible: boolean; + /** + * Sets the title attribute of the shadow div + * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]' + * + * @member {?string} + * @memberof PIXI.DisplayObject# + */ + accessibleTitle: string; + /** + * Sets the aria-label attribute of the shadow div + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + accessibleHint: string; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleActive: boolean; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleDiv: boolean; + /** + * World transform and local transform of this object. + * This will become read-only later, please do not assign anything there unless you know what are you doing. + * + * @member {PIXI.Transform} PIXI.DisplayObject#transform + */ + transform: PIXI.Transform; + /** + * The opacity of the object. + * + * @member {number} PIXI.DisplayObject#alpha + */ + alpha: number; + /** + * The visibility of the object. If false the object will not be drawn, and + * the updateTransform function will not be called. + * + * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually. + * + * @member {boolean} PIXI.DisplayObject#visible + */ + visible: boolean; + /** + * Can this object be rendered, if false the object will not be drawn but the updateTransform + * methods will still be called. + * + * Only affects recursive calls from parent. You can ask for bounds manually. + * + * @member {boolean} PIXI.DisplayObject#renderable + */ + renderable: boolean; + /** + * The display object container that contains this display object. + * + * @member {PIXI.Container} PIXI.DisplayObject#parent + * @readonly + */ + readonly parent: PIXI.Container; + /** + * The multiplied alpha of the displayObject. + * + * @member {number} PIXI.DisplayObject#worldAlpha + * @readonly + */ + readonly worldAlpha: number; + /** + * Which index in the children array the display component was before the previous zIndex sort. + * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider. + * + * @member {number} PIXI.DisplayObject#_lastSortedIndex + * @protected + */ + protected _lastSortedIndex: number; + /** + * The zIndex of the displayObject. + * A higher value will mean it will be rendered on top of other displayObjects within the same container. + * + * @member {number} PIXI.DisplayObject#_zIndex + * @protected + */ + protected _zIndex: number; + /** + * The area the filter is applied to. This is used as more of an optimization + * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. + * + * Also works as an interaction mask. + * + * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea + */ + filterArea: PIXI.Rectangle; + /** + * Sets the filters for the displayObject. + * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * To remove filters simply set this property to `'null'`. + * + * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters + */ + filters: PIXI.Filter[]; + /** + * The bounds object, this is used to calculate and store the bounds of the displayObject. + * + * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds + * @protected + */ + protected _bounds: PIXI.Bounds; + /** + * The original, cached mask of the object. + * + * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask + * @protected + */ + protected _mask: PIXI.Graphics | PIXI.Sprite; + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} PIXI.DisplayObject#_destroyed + * @protected + */ + protected _destroyed: boolean; + /** + * used to fast check if a sprite is.. a sprite! + * @member {boolean} PIXI.DisplayObject#isSprite + */ + isSprite: boolean; + /** + * @protected + * @member {PIXI.DisplayObject} + */ + protected _tempDisplayObjectParent: PIXI.DisplayObject; + /** + * Recursively updates transform of all objects from the root to this one + * internal function for toLocal() + */ + _recursivePostUpdateTransform(): void; + /** + * Retrieves the bounds of the displayObject as a rectangle object. + * + * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Retrieves the local bounds of the displayObject as a rectangle object. + * + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Calculates the global position of the display object. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform. + * @return {PIXI.IPoint} A point object representing the position of this object. + */ + toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Calculates the local position of the display object relative to another point. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform + * @return {PIXI.IPoint} A point object representing the position of this object + */ + toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Set the parent Container of this DisplayObject. + * + * @param {PIXI.Container} container - The Container to add this DisplayObject to. + * @return {PIXI.Container} The Container that this DisplayObject was added to. + */ + setParent(container: PIXI.Container): PIXI.Container; + /** + * Convenience function to set the position, scale, skew and pivot at once. + * + * @param {number} [x=0] - The X position + * @param {number} [y=0] - The Y position + * @param {number} [scaleX=1] - The X scale value + * @param {number} [scaleY=1] - The Y scale value + * @param {number} [rotation=0] - The rotation + * @param {number} [skewX=0] - The X skew value + * @param {number} [skewY=0] - The Y skew value + * @param {number} [pivotX=0] - The X pivot value + * @param {number} [pivotY=0] - The Y pivot value + * @return {PIXI.DisplayObject} The DisplayObject instance + */ + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject; + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * An alias to position.x + * + * @member {number} + */ + x: number; + /** + * The position of the displayObject on the y axis relative to the local coordinates of the parent. + * An alias to position.y + * + * @member {number} + */ + y: number; + /** + * Current transform of the object based on world (parent) factors. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly worldTransform: PIXI.Matrix; + /** + * Current transform of the object based on local factors: position, scale, other stuff. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly localTransform: PIXI.Matrix; + /** + * The coordinate of the object relative to the local coordinates of the parent. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + position: PIXI.IPoint; + /** + * The scale factor of the object. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + scale: PIXI.IPoint; + /** + * The pivot point of the displayObject that it rotates around. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + pivot: PIXI.IPoint; + /** + * The skew factor for the object in radians. + * Assignment by value since pixi-v4. + * + * @member {PIXI.ObservablePoint} + */ + skew: PIXI.ObservablePoint; + /** + * The rotation of the object in radians. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + rotation: number; + /** + * The angle of the object in degrees. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + angle: number; + /** + * The zIndex of the displayObject. + * If a container has the sortableChildren property set to true, children will be automatically + * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, + * and thus rendered on top of other displayObjects within the same container. + * + * @member {number} + */ + zIndex: number; + /** + * Indicates if the object is globally visible. + * + * @member {boolean} + * @readonly + */ + readonly worldVisible: boolean; + /** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an + * object to the shape of the mask applied to it. In PixiJS a regular mask must be a + * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it + * utilities shape clipping. To remove a mask, set this property to `null`. + * + * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. + * @example + * const graphics = new PIXI.Graphics(); + * graphics.beginFill(0xFF3300); + * graphics.drawRect(50, 250, 100, 100); + * graphics.endFill(); + * + * const sprite = new PIXI.Sprite(texture); + * sprite.mask = graphics; + * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * + * @member {PIXI.Graphics|PIXI.Sprite} + */ + mask: PIXI.Graphics | PIXI.Sprite; + /** + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + interactive: boolean; + /** + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# + */ + hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle; + /** + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + buttonMode: boolean; + /** + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + cursor: string; + /** + * Set this to true if you want this display object to be cached as a bitmap. + * This basically takes a snap shot of the display object as it is at that moment. It can + * provide a performance benefit for complex static displayObjects. + * To remove simply set this property to `false` + * + * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + cacheAsBitmap: boolean; + /** + * The instance name of the object. + * + * @memberof PIXI.DisplayObject# + * @member {string} name + */ + name: string; + /** + * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot. + * + * @method getGlobalPosition + * @memberof PIXI.DisplayObject# + * @param {Point} point - The point to write the global value to. If null a new point will be returned + * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @return {Point} The updated point. + */ + getGlobalPosition(point: Point, skipUpdate: boolean): Point; + } + /** + * The SimplePlane allows you to draw a texture across several points and then manipulate these points + * + *```js + * for (let i = 0; i < 20; i++) { + * points.push(new PIXI.Point(i * 50, 0)); + * }; + * let SimplePlane = new PIXI.SimplePlane(PIXI.Texture.from("snake.png"), points); + * ``` + * + * @class + * @extends PIXI.Mesh + * @memberof PIXI + * + */ + class SimplePlane extends PIXI.Mesh { + constructor(texture: PIXI.Texture, verticesX: number, verticesY: number); + /** + * Method used for overrides, to do something in case texture frame was changed. + * Meshes based on plane can override it and change more details based on texture. + */ + textureUpdated(): void; + /** + * Includes vertex positions, face indices, normals, colors, UVs, and + * custom attributes within buffers, reducing the cost of passing all + * this data to the GPU. Can be shared between multiple Mesh objects. + * @member {PIXI.Geometry} PIXI.Mesh#geometry + * @readonly + */ + readonly geometry: PIXI.Geometry; + /** + * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. + * Can be shared between multiple Mesh objects. + * @member {PIXI.Shader|PIXI.MeshMaterial} PIXI.Mesh#shader + */ + shader: PIXI.Shader | PIXI.MeshMaterial; + /** + * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g., + * blend mode, culling, depth testing, direction of rendering triangles, backface, etc. + * @member {PIXI.State} PIXI.Mesh#state + */ + state: PIXI.State; + /** + * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants. + * + * @member {number} PIXI.Mesh#drawMode + * @see PIXI.DRAW_MODES + */ + drawMode: number; + /** + * Typically the index of the IndexBuffer where to start drawing. + * @member {number} PIXI.Mesh#start + * @default 0 + */ + start: number; + /** + * How much of the geometry to draw, by default `0` renders everything. + * @member {number} PIXI.Mesh#size + * @default 0 + */ + size: number; + /** + * To change mesh uv's, change its uvBuffer data and increment its _updateID. + * @member {PIXI.Buffer} + * @readonly + */ + readonly uvBuffer: PIXI.Buffer; + /** + * To change mesh vertices, change its uvBuffer data and increment its _updateID. + * Incrementing _updateID is optional because most of Mesh objects do it anyway. + * @member {PIXI.Buffer} + * @readonly + */ + readonly verticesBuffer: PIXI.Buffer; + /** + * Alias for {@link PIXI.Mesh#shader}. + * @member {PIXI.Shader|PIXI.MeshMaterial} + */ + material: PIXI.Shader | PIXI.MeshMaterial; + /** + * The blend mode to be applied to the Mesh. Apply a value of + * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. + * + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES + */ + blendMode: number; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * To set the global default, change {@link PIXI.settings.ROUND_PIXELS} + * + * @member {boolean} + * @default false + */ + roundPixels: boolean; + /** + * The multiply tint applied to the Mesh. This is a hex value. A value of + * `0xFFFFFF` will remove any tint effect. + * + * @member {number} + * @default 0xFFFFFF + */ + tint: number; + /** + * The texture that the Mesh uses. + * + * @member {PIXI.Texture} + */ + texture: PIXI.Texture; + /** + * Standard renderer draw. + * @protected + */ + protected _render(): void; + /** + * Standard non-batching way of rendering. + * @protected + * @param {PIXI.Renderer} renderer - Instance to renderer. + */ + protected _renderDefault(renderer: PIXI.Renderer): void; + /** + * Rendering by using the Batch system. + * @protected + * @param {PIXI.Renderer} renderer - Instance to renderer. + */ + protected _renderToBatch(renderer: PIXI.Renderer): void; + /** + * Updates vertexData field based on transform and vertices + */ + calculateVertices(): void; + /** + * Updates uv field based on from geometry uv's or batchUvs + */ + calculateUvs(): void; + /** + * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. + * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly. + * + * @protected + */ + protected _calculateBounds(): void; + /** + * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES. + * + * @param {PIXI.Point} point the point to test + * @return {boolean} the result of the test + */ + containsPoint(point: PIXI.Point): boolean; + /** + * Destroys the Mesh object. + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all + * options have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have + * their destroy method called as well. 'options' will be passed on to those calls. + */ + destroy(options?: { + children?: boolean; + }): void; + /** + * @method PIXI.Container#renderWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#render + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderWebGL(renderer: PIXI.Renderer): void; + /** + * @method PIXI.Container#renderAdvancedWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#renderAdvanced + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderAdvancedWebGL(renderer: PIXI.Renderer): void; + /** + * Renders the object using the Canvas renderer + * @method renderCanvas + * @memberof PIXI.Container# + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} PIXI.Container#children + * @readonly + */ + readonly children: PIXI.DisplayObject[]; + /** + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @see PIXI.settings.SORTABLE_CHILDREN + * + * @member {boolean} PIXI.Container#sortableChildren + */ + sortableChildren: boolean; + /** + * Should children be sorted by zIndex at the next updateTransform call. + * Will get automatically set to true if a new child is added, or if a child's zIndex changes. + * + * @member {boolean} PIXI.Container#sortDirty + */ + sortDirty: boolean; + /** + * Overridable method that can be used by Container subclasses whenever the children array is modified + * + * @protected + */ + protected onChildrenChange(): void; + /** + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. + */ + addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject; + /** + * Swaps the position of 2 Display Objects within this container. + * + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap + */ + swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void; + /** + * Returns the index position of a child DisplayObject instance + * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify + */ + getChildIndex(child: PIXI.DisplayObject): number; + /** + * Changes the position of an existing child in the display object container + * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object + */ + setChildIndex(child: PIXI.DisplayObject, index: number): void; + /** + * Returns the child at the specified index + * + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. + */ + getChildAt(index: number): PIXI.DisplayObject; + /** + * Removes one or more children from the container. + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. + */ + removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Removes a child from the specified index position. + * + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. + */ + removeChildAt(index: number): PIXI.DisplayObject; + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; + /** + * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex. + */ + sortChildren(): void; + /** + * Updates the transform on all children of this container for rendering + */ + updateTransform(): void; + /** + * Recalculates the bounds of the container. + * + */ + calculateBounds(): void; + /** + * Renders the object using the WebGL renderer + * + * @param {PIXI.Renderer} renderer - The renderer + */ + render(renderer: PIXI.Renderer): void; + /** + * Render the object using the WebGL renderer and advanced features. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected renderAdvanced(renderer: PIXI.Renderer): void; + /** + * The width of the Container, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + width: number; + /** + * The height of the Container, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + height: number; + /** + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows PixiJS to bypass a recursive `hitTest` function + * + * @member {boolean} + * @memberof PIXI.Container# + */ + interactiveChildren: boolean; + /** + * Returns the display object in the container. + * + * @method getChildByName + * @memberof PIXI.Container# + * @param {string} name - Instance name. + * @return {PIXI.DisplayObject} The child with the specified name. + */ + getChildByName(name: string): PIXI.DisplayObject; + /** + * Flag for if the object is accessible. If true AccessibilityManager will overlay a + * shadow div with attributes set + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + accessible: boolean; + /** + * Sets the title attribute of the shadow div + * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]' + * + * @member {?string} + * @memberof PIXI.DisplayObject# + */ + accessibleTitle: string; + /** + * Sets the aria-label attribute of the shadow div + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + accessibleHint: string; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleActive: boolean; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleDiv: boolean; + /** + * World transform and local transform of this object. + * This will become read-only later, please do not assign anything there unless you know what are you doing. + * + * @member {PIXI.Transform} PIXI.DisplayObject#transform + */ + transform: PIXI.Transform; + /** + * The opacity of the object. + * + * @member {number} PIXI.DisplayObject#alpha + */ + alpha: number; + /** + * The visibility of the object. If false the object will not be drawn, and + * the updateTransform function will not be called. + * + * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually. + * + * @member {boolean} PIXI.DisplayObject#visible + */ + visible: boolean; + /** + * Can this object be rendered, if false the object will not be drawn but the updateTransform + * methods will still be called. + * + * Only affects recursive calls from parent. You can ask for bounds manually. + * + * @member {boolean} PIXI.DisplayObject#renderable + */ + renderable: boolean; + /** + * The display object container that contains this display object. + * + * @member {PIXI.Container} PIXI.DisplayObject#parent + * @readonly + */ + readonly parent: PIXI.Container; + /** + * The multiplied alpha of the displayObject. + * + * @member {number} PIXI.DisplayObject#worldAlpha + * @readonly + */ + readonly worldAlpha: number; + /** + * Which index in the children array the display component was before the previous zIndex sort. + * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider. + * + * @member {number} PIXI.DisplayObject#_lastSortedIndex + * @protected + */ + protected _lastSortedIndex: number; + /** + * The zIndex of the displayObject. + * A higher value will mean it will be rendered on top of other displayObjects within the same container. + * + * @member {number} PIXI.DisplayObject#_zIndex + * @protected + */ + protected _zIndex: number; + /** + * The area the filter is applied to. This is used as more of an optimization + * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. + * + * Also works as an interaction mask. + * + * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea + */ + filterArea: PIXI.Rectangle; + /** + * Sets the filters for the displayObject. + * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * To remove filters simply set this property to `'null'`. + * + * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters + */ + filters: PIXI.Filter[]; + /** + * The bounds object, this is used to calculate and store the bounds of the displayObject. + * + * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds + * @protected + */ + protected _bounds: PIXI.Bounds; + /** + * The original, cached mask of the object. + * + * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask + * @protected + */ + protected _mask: PIXI.Graphics | PIXI.Sprite; + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} PIXI.DisplayObject#_destroyed + * @protected + */ + protected _destroyed: boolean; + /** + * used to fast check if a sprite is.. a sprite! + * @member {boolean} PIXI.DisplayObject#isSprite + */ + isSprite: boolean; + /** + * @protected + * @member {PIXI.DisplayObject} + */ + protected _tempDisplayObjectParent: PIXI.DisplayObject; + /** + * Recursively updates transform of all objects from the root to this one + * internal function for toLocal() + */ + _recursivePostUpdateTransform(): void; + /** + * Retrieves the bounds of the displayObject as a rectangle object. + * + * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Retrieves the local bounds of the displayObject as a rectangle object. + * + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Calculates the global position of the display object. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform. + * @return {PIXI.IPoint} A point object representing the position of this object. + */ + toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Calculates the local position of the display object relative to another point. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform + * @return {PIXI.IPoint} A point object representing the position of this object + */ + toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Set the parent Container of this DisplayObject. + * + * @param {PIXI.Container} container - The Container to add this DisplayObject to. + * @return {PIXI.Container} The Container that this DisplayObject was added to. + */ + setParent(container: PIXI.Container): PIXI.Container; + /** + * Convenience function to set the position, scale, skew and pivot at once. + * + * @param {number} [x=0] - The X position + * @param {number} [y=0] - The Y position + * @param {number} [scaleX=1] - The X scale value + * @param {number} [scaleY=1] - The Y scale value + * @param {number} [rotation=0] - The rotation + * @param {number} [skewX=0] - The X skew value + * @param {number} [skewY=0] - The Y skew value + * @param {number} [pivotX=0] - The X pivot value + * @param {number} [pivotY=0] - The Y pivot value + * @return {PIXI.DisplayObject} The DisplayObject instance + */ + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject; + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * An alias to position.x + * + * @member {number} + */ + x: number; + /** + * The position of the displayObject on the y axis relative to the local coordinates of the parent. + * An alias to position.y + * + * @member {number} + */ + y: number; + /** + * Current transform of the object based on world (parent) factors. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly worldTransform: PIXI.Matrix; + /** + * Current transform of the object based on local factors: position, scale, other stuff. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly localTransform: PIXI.Matrix; + /** + * The coordinate of the object relative to the local coordinates of the parent. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + position: PIXI.IPoint; + /** + * The scale factor of the object. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + scale: PIXI.IPoint; + /** + * The pivot point of the displayObject that it rotates around. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + pivot: PIXI.IPoint; + /** + * The skew factor for the object in radians. + * Assignment by value since pixi-v4. + * + * @member {PIXI.ObservablePoint} + */ + skew: PIXI.ObservablePoint; + /** + * The rotation of the object in radians. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + rotation: number; + /** + * The angle of the object in degrees. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + angle: number; + /** + * The zIndex of the displayObject. + * If a container has the sortableChildren property set to true, children will be automatically + * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, + * and thus rendered on top of other displayObjects within the same container. + * + * @member {number} + */ + zIndex: number; + /** + * Indicates if the object is globally visible. + * + * @member {boolean} + * @readonly + */ + readonly worldVisible: boolean; + /** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an + * object to the shape of the mask applied to it. In PixiJS a regular mask must be a + * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it + * utilities shape clipping. To remove a mask, set this property to `null`. + * + * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. + * @example + * const graphics = new PIXI.Graphics(); + * graphics.beginFill(0xFF3300); + * graphics.drawRect(50, 250, 100, 100); + * graphics.endFill(); + * + * const sprite = new PIXI.Sprite(texture); + * sprite.mask = graphics; + * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * + * @member {PIXI.Graphics|PIXI.Sprite} + */ + mask: PIXI.Graphics | PIXI.Sprite; + /** + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + interactive: boolean; + /** + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# + */ + hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle; + /** + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + buttonMode: boolean; + /** + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + cursor: string; + /** + * Set this to true if you want this display object to be cached as a bitmap. + * This basically takes a snap shot of the display object as it is at that moment. It can + * provide a performance benefit for complex static displayObjects. + * To remove simply set this property to `false` + * + * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + cacheAsBitmap: boolean; + /** + * The instance name of the object. + * + * @memberof PIXI.DisplayObject# + * @member {string} name + */ + name: string; + /** + * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot. + * + * @method getGlobalPosition + * @memberof PIXI.DisplayObject# + * @param {Point} point - The point to write the global value to. If null a new point will be returned + * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @return {Point} The updated point. + */ + getGlobalPosition(point: Point, skipUpdate: boolean): Point; + } + /** + * The rope allows you to draw a texture across several points and then manipulate these points + * + *```js + * for (let i = 0; i < 20; i++) { + * points.push(new PIXI.Point(i * 50, 0)); + * }; + * let rope = new PIXI.Rope(PIXI.Texture.from("snake.png"), points); + * ``` + * + * @class + * @extends PIXI.Mesh + * @memberof PIXI + * + */ + class SimpleRope extends PIXI.Mesh { + constructor(texture: PIXI.Texture, points: PIXI.Point[]); + /** + * re-calculate vertices by rope points each frame + * + * @member {boolean} PIXI.SimpleRope#autoUpdate + */ + autoUpdate: boolean; + /** + * Includes vertex positions, face indices, normals, colors, UVs, and + * custom attributes within buffers, reducing the cost of passing all + * this data to the GPU. Can be shared between multiple Mesh objects. + * @member {PIXI.Geometry} PIXI.Mesh#geometry + * @readonly + */ + readonly geometry: PIXI.Geometry; + /** + * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. + * Can be shared between multiple Mesh objects. + * @member {PIXI.Shader|PIXI.MeshMaterial} PIXI.Mesh#shader + */ + shader: PIXI.Shader | PIXI.MeshMaterial; + /** + * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g., + * blend mode, culling, depth testing, direction of rendering triangles, backface, etc. + * @member {PIXI.State} PIXI.Mesh#state + */ + state: PIXI.State; + /** + * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants. + * + * @member {number} PIXI.Mesh#drawMode + * @see PIXI.DRAW_MODES + */ + drawMode: number; + /** + * Typically the index of the IndexBuffer where to start drawing. + * @member {number} PIXI.Mesh#start + * @default 0 + */ + start: number; + /** + * How much of the geometry to draw, by default `0` renders everything. + * @member {number} PIXI.Mesh#size + * @default 0 + */ + size: number; + /** + * To change mesh uv's, change its uvBuffer data and increment its _updateID. + * @member {PIXI.Buffer} + * @readonly + */ + readonly uvBuffer: PIXI.Buffer; + /** + * To change mesh vertices, change its uvBuffer data and increment its _updateID. + * Incrementing _updateID is optional because most of Mesh objects do it anyway. + * @member {PIXI.Buffer} + * @readonly + */ + readonly verticesBuffer: PIXI.Buffer; + /** + * Alias for {@link PIXI.Mesh#shader}. + * @member {PIXI.Shader|PIXI.MeshMaterial} + */ + material: PIXI.Shader | PIXI.MeshMaterial; + /** + * The blend mode to be applied to the Mesh. Apply a value of + * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. + * + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES + */ + blendMode: number; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * To set the global default, change {@link PIXI.settings.ROUND_PIXELS} + * + * @member {boolean} + * @default false + */ + roundPixels: boolean; + /** + * The multiply tint applied to the Mesh. This is a hex value. A value of + * `0xFFFFFF` will remove any tint effect. + * + * @member {number} + * @default 0xFFFFFF + */ + tint: number; + /** + * The texture that the Mesh uses. + * + * @member {PIXI.Texture} + */ + texture: PIXI.Texture; + /** + * Standard renderer draw. + * @protected + */ + protected _render(): void; + /** + * Standard non-batching way of rendering. + * @protected + * @param {PIXI.Renderer} renderer - Instance to renderer. + */ + protected _renderDefault(renderer: PIXI.Renderer): void; + /** + * Rendering by using the Batch system. + * @protected + * @param {PIXI.Renderer} renderer - Instance to renderer. + */ + protected _renderToBatch(renderer: PIXI.Renderer): void; + /** + * Updates vertexData field based on transform and vertices + */ + calculateVertices(): void; + /** + * Updates uv field based on from geometry uv's or batchUvs + */ + calculateUvs(): void; + /** + * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account. + * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly. + * + * @protected + */ + protected _calculateBounds(): void; + /** + * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES. + * + * @param {PIXI.Point} point the point to test + * @return {boolean} the result of the test + */ + containsPoint(point: PIXI.Point): boolean; + /** + * Destroys the Mesh object. + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all + * options have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have + * their destroy method called as well. 'options' will be passed on to those calls. + */ + destroy(options?: { + children?: boolean; + }): void; + /** + * @method PIXI.Container#renderWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#render + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderWebGL(renderer: PIXI.Renderer): void; + /** + * @method PIXI.Container#renderAdvancedWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#renderAdvanced + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderAdvancedWebGL(renderer: PIXI.Renderer): void; + /** + * Renders the object using the Canvas renderer + * @method renderCanvas + * @memberof PIXI.Container# + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} PIXI.Container#children + * @readonly + */ + readonly children: PIXI.DisplayObject[]; + /** + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @see PIXI.settings.SORTABLE_CHILDREN + * + * @member {boolean} PIXI.Container#sortableChildren + */ + sortableChildren: boolean; + /** + * Should children be sorted by zIndex at the next updateTransform call. + * Will get automatically set to true if a new child is added, or if a child's zIndex changes. + * + * @member {boolean} PIXI.Container#sortDirty + */ + sortDirty: boolean; + /** + * Overridable method that can be used by Container subclasses whenever the children array is modified + * + * @protected + */ + protected onChildrenChange(): void; + /** + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. + */ + addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject; + /** + * Swaps the position of 2 Display Objects within this container. + * + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap + */ + swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void; + /** + * Returns the index position of a child DisplayObject instance + * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify + */ + getChildIndex(child: PIXI.DisplayObject): number; + /** + * Changes the position of an existing child in the display object container + * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object + */ + setChildIndex(child: PIXI.DisplayObject, index: number): void; + /** + * Returns the child at the specified index + * + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. + */ + getChildAt(index: number): PIXI.DisplayObject; + /** + * Removes one or more children from the container. + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. + */ + removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Removes a child from the specified index position. + * + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. + */ + removeChildAt(index: number): PIXI.DisplayObject; + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; + /** + * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex. + */ + sortChildren(): void; + /** + * Updates the transform on all children of this container for rendering + */ + updateTransform(): void; + /** + * Recalculates the bounds of the container. + * + */ + calculateBounds(): void; + /** + * Renders the object using the WebGL renderer + * + * @param {PIXI.Renderer} renderer - The renderer + */ + render(renderer: PIXI.Renderer): void; + /** + * Render the object using the WebGL renderer and advanced features. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected renderAdvanced(renderer: PIXI.Renderer): void; + /** + * The width of the Container, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + width: number; + /** + * The height of the Container, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + height: number; + /** + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows PixiJS to bypass a recursive `hitTest` function + * + * @member {boolean} + * @memberof PIXI.Container# + */ + interactiveChildren: boolean; + /** + * Returns the display object in the container. + * + * @method getChildByName + * @memberof PIXI.Container# + * @param {string} name - Instance name. + * @return {PIXI.DisplayObject} The child with the specified name. + */ + getChildByName(name: string): PIXI.DisplayObject; + /** + * Flag for if the object is accessible. If true AccessibilityManager will overlay a + * shadow div with attributes set + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + accessible: boolean; + /** + * Sets the title attribute of the shadow div + * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]' + * + * @member {?string} + * @memberof PIXI.DisplayObject# + */ + accessibleTitle: string; + /** + * Sets the aria-label attribute of the shadow div + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + accessibleHint: string; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleActive: boolean; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleDiv: boolean; + /** + * World transform and local transform of this object. + * This will become read-only later, please do not assign anything there unless you know what are you doing. + * + * @member {PIXI.Transform} PIXI.DisplayObject#transform + */ + transform: PIXI.Transform; + /** + * The opacity of the object. + * + * @member {number} PIXI.DisplayObject#alpha + */ + alpha: number; + /** + * The visibility of the object. If false the object will not be drawn, and + * the updateTransform function will not be called. + * + * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually. + * + * @member {boolean} PIXI.DisplayObject#visible + */ + visible: boolean; + /** + * Can this object be rendered, if false the object will not be drawn but the updateTransform + * methods will still be called. + * + * Only affects recursive calls from parent. You can ask for bounds manually. + * + * @member {boolean} PIXI.DisplayObject#renderable + */ + renderable: boolean; + /** + * The display object container that contains this display object. + * + * @member {PIXI.Container} PIXI.DisplayObject#parent + * @readonly + */ + readonly parent: PIXI.Container; + /** + * The multiplied alpha of the displayObject. + * + * @member {number} PIXI.DisplayObject#worldAlpha + * @readonly + */ + readonly worldAlpha: number; + /** + * Which index in the children array the display component was before the previous zIndex sort. + * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider. + * + * @member {number} PIXI.DisplayObject#_lastSortedIndex + * @protected + */ + protected _lastSortedIndex: number; + /** + * The zIndex of the displayObject. + * A higher value will mean it will be rendered on top of other displayObjects within the same container. + * + * @member {number} PIXI.DisplayObject#_zIndex + * @protected + */ + protected _zIndex: number; + /** + * The area the filter is applied to. This is used as more of an optimization + * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. + * + * Also works as an interaction mask. + * + * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea + */ + filterArea: PIXI.Rectangle; + /** + * Sets the filters for the displayObject. + * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * To remove filters simply set this property to `'null'`. + * + * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters + */ + filters: PIXI.Filter[]; + /** + * The bounds object, this is used to calculate and store the bounds of the displayObject. + * + * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds + * @protected + */ + protected _bounds: PIXI.Bounds; + /** + * The original, cached mask of the object. + * + * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask + * @protected + */ + protected _mask: PIXI.Graphics | PIXI.Sprite; + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} PIXI.DisplayObject#_destroyed + * @protected + */ + protected _destroyed: boolean; + /** + * used to fast check if a sprite is.. a sprite! + * @member {boolean} PIXI.DisplayObject#isSprite + */ + isSprite: boolean; + /** + * @protected + * @member {PIXI.DisplayObject} + */ + protected _tempDisplayObjectParent: PIXI.DisplayObject; + /** + * Recursively updates transform of all objects from the root to this one + * internal function for toLocal() + */ + _recursivePostUpdateTransform(): void; + /** + * Retrieves the bounds of the displayObject as a rectangle object. + * + * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Retrieves the local bounds of the displayObject as a rectangle object. + * + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Calculates the global position of the display object. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform. + * @return {PIXI.IPoint} A point object representing the position of this object. + */ + toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Calculates the local position of the display object relative to another point. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform + * @return {PIXI.IPoint} A point object representing the position of this object + */ + toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Set the parent Container of this DisplayObject. + * + * @param {PIXI.Container} container - The Container to add this DisplayObject to. + * @return {PIXI.Container} The Container that this DisplayObject was added to. + */ + setParent(container: PIXI.Container): PIXI.Container; + /** + * Convenience function to set the position, scale, skew and pivot at once. + * + * @param {number} [x=0] - The X position + * @param {number} [y=0] - The Y position + * @param {number} [scaleX=1] - The X scale value + * @param {number} [scaleY=1] - The Y scale value + * @param {number} [rotation=0] - The rotation + * @param {number} [skewX=0] - The X skew value + * @param {number} [skewY=0] - The Y skew value + * @param {number} [pivotX=0] - The X pivot value + * @param {number} [pivotY=0] - The Y pivot value + * @return {PIXI.DisplayObject} The DisplayObject instance + */ + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject; + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * An alias to position.x + * + * @member {number} + */ + x: number; + /** + * The position of the displayObject on the y axis relative to the local coordinates of the parent. + * An alias to position.y + * + * @member {number} + */ + y: number; + /** + * Current transform of the object based on world (parent) factors. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly worldTransform: PIXI.Matrix; + /** + * Current transform of the object based on local factors: position, scale, other stuff. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly localTransform: PIXI.Matrix; + /** + * The coordinate of the object relative to the local coordinates of the parent. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + position: PIXI.IPoint; + /** + * The scale factor of the object. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + scale: PIXI.IPoint; + /** + * The pivot point of the displayObject that it rotates around. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + pivot: PIXI.IPoint; + /** + * The skew factor for the object in radians. + * Assignment by value since pixi-v4. + * + * @member {PIXI.ObservablePoint} + */ + skew: PIXI.ObservablePoint; + /** + * The rotation of the object in radians. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + rotation: number; + /** + * The angle of the object in degrees. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + angle: number; + /** + * The zIndex of the displayObject. + * If a container has the sortableChildren property set to true, children will be automatically + * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, + * and thus rendered on top of other displayObjects within the same container. + * + * @member {number} + */ + zIndex: number; + /** + * Indicates if the object is globally visible. + * + * @member {boolean} + * @readonly + */ + readonly worldVisible: boolean; + /** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an + * object to the shape of the mask applied to it. In PixiJS a regular mask must be a + * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it + * utilities shape clipping. To remove a mask, set this property to `null`. + * + * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. + * @example + * const graphics = new PIXI.Graphics(); + * graphics.beginFill(0xFF3300); + * graphics.drawRect(50, 250, 100, 100); + * graphics.endFill(); + * + * const sprite = new PIXI.Sprite(texture); + * sprite.mask = graphics; + * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * + * @member {PIXI.Graphics|PIXI.Sprite} + */ + mask: PIXI.Graphics | PIXI.Sprite; + /** + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + interactive: boolean; + /** + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# + */ + hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle; + /** + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + buttonMode: boolean; + /** + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + cursor: string; + /** + * Set this to true if you want this display object to be cached as a bitmap. + * This basically takes a snap shot of the display object as it is at that moment. It can + * provide a performance benefit for complex static displayObjects. + * To remove simply set this property to `false` + * + * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + cacheAsBitmap: boolean; + /** + * The instance name of the object. + * + * @memberof PIXI.DisplayObject# + * @member {string} name + */ + name: string; + /** + * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot. + * + * @method getGlobalPosition + * @memberof PIXI.DisplayObject# + * @param {Point} point - The point to write the global value to. If null a new point will be returned + * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @return {Point} The updated point. + */ + getGlobalPosition(point: Point, skipUpdate: boolean): Point; + } + /** + * The ParticleContainer class is a really fast version of the Container built solely for speed, + * so use when you need a lot of sprites or particles. + * + * The tradeoff of the ParticleContainer is that most advanced functionality will not work. + * ParticleContainer implements the basic object transform (position, scale, rotation) + * and some advanced functionality like tint (as of v4.5.6). + * + * Other more advanced functionality like masking, children, filters, etc will not work on sprites in this batch. + * + * It's extremely easy to use: + * ```js + * let container = new ParticleContainer(); + * + * for (let i = 0; i < 100; ++i) + * { + * let sprite = new PIXI.Sprite.from("myImage.png"); + * container.addChild(sprite); + * } + * ``` + * + * And here you have a hundred sprites that will be rendered at the speed of light. + * + * @class + * @extends PIXI.Container + * @memberof PIXI + */ + class ParticleContainer extends PIXI.Container { + constructor(maxSize?: number, properties?: { + vertices?: boolean; + position?: boolean; + rotation?: boolean; + uvs?: boolean; + tint?: boolean; + }, batchSize?: number, autoResize?: boolean); + /** + * @member {boolean} PIXI.ParticleContainer#interactiveChildren + * + */ + interactiveChildren: boolean; + /** + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` + * to reset the blend mode. + * + * @member {number} PIXI.ParticleContainer#blendMode + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES + */ + blendMode: number; + /** + * If true, container allocates more batches in case there are more than `maxSize` particles. + * @member {boolean} PIXI.ParticleContainer#autoResize + * @default false + */ + autoResize: boolean; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * Default to true here as performance is usually the priority for particles. + * + * @member {boolean} PIXI.ParticleContainer#roundPixels + * @default true + */ + roundPixels: boolean; + /** + * The texture used to render the children. + * + * @readonly + * @member {BaseTexture} PIXI.ParticleContainer#baseTexture + */ + readonly baseTexture: BaseTexture; + /** + * Sets the private properties array to dynamic / static based on the passed properties object + * + * @param {object} properties - The properties to be uploaded + */ + setProperties(properties: any): void; + /** + * The tint applied to the container. This is a hex value. + * A value of 0xFFFFFF will remove any tint effect. + ** IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * @member {number} + * @default 0xFFFFFF + */ + tint: number; + /** + * Destroys the container + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their + * destroy method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true + * Should it destroy the texture of the child sprite + * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true + * Should it destroy the base texture of the child sprite + */ + destroy(options?: { + children?: boolean; + texture?: boolean; + baseTexture?: boolean; + }): void; + /** + * @method PIXI.Container#renderWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#render + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderWebGL(renderer: PIXI.Renderer): void; + /** + * @method PIXI.Container#renderAdvancedWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#renderAdvanced + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderAdvancedWebGL(renderer: PIXI.Renderer): void; + /** + * To be overridden by the subclass + * @method _renderCanvas + * @memberof PIXI.Container# + * @protected + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + protected _renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} PIXI.Container#children + * @readonly + */ + readonly children: PIXI.DisplayObject[]; + /** + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @see PIXI.settings.SORTABLE_CHILDREN + * + * @member {boolean} PIXI.Container#sortableChildren + */ + sortableChildren: boolean; + /** + * Should children be sorted by zIndex at the next updateTransform call. + * Will get automatically set to true if a new child is added, or if a child's zIndex changes. + * + * @member {boolean} PIXI.Container#sortDirty + */ + sortDirty: boolean; + /** + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. + */ + addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject; + /** + * Swaps the position of 2 Display Objects within this container. + * + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap + */ + swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void; + /** + * Returns the index position of a child DisplayObject instance + * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify + */ + getChildIndex(child: PIXI.DisplayObject): number; + /** + * Changes the position of an existing child in the display object container + * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object + */ + setChildIndex(child: PIXI.DisplayObject, index: number): void; + /** + * Returns the child at the specified index + * + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. + */ + getChildAt(index: number): PIXI.DisplayObject; + /** + * Removes one or more children from the container. + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. + */ + removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Removes a child from the specified index position. + * + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. + */ + removeChildAt(index: number): PIXI.DisplayObject; + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; + /** + * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex. + */ + sortChildren(): void; + /** + * Recalculates the bounds of the container. + * + */ + calculateBounds(): void; + /** + * Recalculates the bounds of the object. Override this to + * calculate the bounds of the specific object (not including children). + * + * @protected + */ + protected _calculateBounds(): void; + /** + * Render the object using the WebGL renderer and advanced features. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected renderAdvanced(renderer: PIXI.Renderer): void; + /** + * To be overridden by the subclasses. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected _render(renderer: PIXI.Renderer): void; + /** + * The width of the Container, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + width: number; + /** + * The height of the Container, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + height: number; + /** + * Returns the display object in the container. + * + * @method getChildByName + * @memberof PIXI.Container# + * @param {string} name - Instance name. + * @return {PIXI.DisplayObject} The child with the specified name. + */ + getChildByName(name: string): PIXI.DisplayObject; + /** + * Flag for if the object is accessible. If true AccessibilityManager will overlay a + * shadow div with attributes set + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + accessible: boolean; + /** + * Sets the title attribute of the shadow div + * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]' + * + * @member {?string} + * @memberof PIXI.DisplayObject# + */ + accessibleTitle: string; + /** + * Sets the aria-label attribute of the shadow div + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + accessibleHint: string; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleActive: boolean; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleDiv: boolean; + /** + * World transform and local transform of this object. + * This will become read-only later, please do not assign anything there unless you know what are you doing. + * + * @member {PIXI.Transform} PIXI.DisplayObject#transform + */ + transform: PIXI.Transform; + /** + * The opacity of the object. + * + * @member {number} PIXI.DisplayObject#alpha + */ + alpha: number; + /** + * The visibility of the object. If false the object will not be drawn, and + * the updateTransform function will not be called. + * + * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually. + * + * @member {boolean} PIXI.DisplayObject#visible + */ + visible: boolean; + /** + * Can this object be rendered, if false the object will not be drawn but the updateTransform + * methods will still be called. + * + * Only affects recursive calls from parent. You can ask for bounds manually. + * + * @member {boolean} PIXI.DisplayObject#renderable + */ + renderable: boolean; + /** + * The display object container that contains this display object. + * + * @member {PIXI.Container} PIXI.DisplayObject#parent + * @readonly + */ + readonly parent: PIXI.Container; + /** + * The multiplied alpha of the displayObject. + * + * @member {number} PIXI.DisplayObject#worldAlpha + * @readonly + */ + readonly worldAlpha: number; + /** + * Which index in the children array the display component was before the previous zIndex sort. + * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider. + * + * @member {number} PIXI.DisplayObject#_lastSortedIndex + * @protected + */ + protected _lastSortedIndex: number; + /** + * The zIndex of the displayObject. + * A higher value will mean it will be rendered on top of other displayObjects within the same container. + * + * @member {number} PIXI.DisplayObject#_zIndex + * @protected + */ + protected _zIndex: number; + /** + * The area the filter is applied to. This is used as more of an optimization + * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. + * + * Also works as an interaction mask. + * + * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea + */ + filterArea: PIXI.Rectangle; + /** + * Sets the filters for the displayObject. + * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * To remove filters simply set this property to `'null'`. + * + * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters + */ + filters: PIXI.Filter[]; + /** + * The bounds object, this is used to calculate and store the bounds of the displayObject. + * + * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds + * @protected + */ + protected _bounds: PIXI.Bounds; + /** + * The original, cached mask of the object. + * + * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask + * @protected + */ + protected _mask: PIXI.Graphics | PIXI.Sprite; + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} PIXI.DisplayObject#_destroyed + * @protected + */ + protected _destroyed: boolean; + /** + * used to fast check if a sprite is.. a sprite! + * @member {boolean} PIXI.DisplayObject#isSprite + */ + isSprite: boolean; + /** + * @protected + * @member {PIXI.DisplayObject} + */ + protected _tempDisplayObjectParent: PIXI.DisplayObject; + /** + * Recursively updates transform of all objects from the root to this one + * internal function for toLocal() + */ + _recursivePostUpdateTransform(): void; + /** + * Retrieves the bounds of the displayObject as a rectangle object. + * + * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Retrieves the local bounds of the displayObject as a rectangle object. + * + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Calculates the global position of the display object. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform. + * @return {PIXI.IPoint} A point object representing the position of this object. + */ + toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Calculates the local position of the display object relative to another point. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform + * @return {PIXI.IPoint} A point object representing the position of this object + */ + toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Set the parent Container of this DisplayObject. + * + * @param {PIXI.Container} container - The Container to add this DisplayObject to. + * @return {PIXI.Container} The Container that this DisplayObject was added to. + */ + setParent(container: PIXI.Container): PIXI.Container; + /** + * Convenience function to set the position, scale, skew and pivot at once. + * + * @param {number} [x=0] - The X position + * @param {number} [y=0] - The Y position + * @param {number} [scaleX=1] - The X scale value + * @param {number} [scaleY=1] - The Y scale value + * @param {number} [rotation=0] - The rotation + * @param {number} [skewX=0] - The X skew value + * @param {number} [skewY=0] - The Y skew value + * @param {number} [pivotX=0] - The X pivot value + * @param {number} [pivotY=0] - The Y pivot value + * @return {PIXI.DisplayObject} The DisplayObject instance + */ + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject; + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * An alias to position.x + * + * @member {number} + */ + x: number; + /** + * The position of the displayObject on the y axis relative to the local coordinates of the parent. + * An alias to position.y + * + * @member {number} + */ + y: number; + /** + * Current transform of the object based on world (parent) factors. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly worldTransform: PIXI.Matrix; + /** + * Current transform of the object based on local factors: position, scale, other stuff. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly localTransform: PIXI.Matrix; + /** + * The coordinate of the object relative to the local coordinates of the parent. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + position: PIXI.IPoint; + /** + * The scale factor of the object. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + scale: PIXI.IPoint; + /** + * The pivot point of the displayObject that it rotates around. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + pivot: PIXI.IPoint; + /** + * The skew factor for the object in radians. + * Assignment by value since pixi-v4. + * + * @member {PIXI.ObservablePoint} + */ + skew: PIXI.ObservablePoint; + /** + * The rotation of the object in radians. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + rotation: number; + /** + * The angle of the object in degrees. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + angle: number; + /** + * The zIndex of the displayObject. + * If a container has the sortableChildren property set to true, children will be automatically + * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, + * and thus rendered on top of other displayObjects within the same container. + * + * @member {number} + */ + zIndex: number; + /** + * Indicates if the object is globally visible. + * + * @member {boolean} + * @readonly + */ + readonly worldVisible: boolean; + /** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an + * object to the shape of the mask applied to it. In PixiJS a regular mask must be a + * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it + * utilities shape clipping. To remove a mask, set this property to `null`. + * + * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. + * @example + * const graphics = new PIXI.Graphics(); + * graphics.beginFill(0xFF3300); + * graphics.drawRect(50, 250, 100, 100); + * graphics.endFill(); + * + * const sprite = new PIXI.Sprite(texture); + * sprite.mask = graphics; + * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * + * @member {PIXI.Graphics|PIXI.Sprite} + */ + mask: PIXI.Graphics | PIXI.Sprite; + /** + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + interactive: boolean; + /** + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# + */ + hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle; + /** + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + buttonMode: boolean; + /** + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + cursor: string; + /** + * Set this to true if you want this display object to be cached as a bitmap. + * This basically takes a snap shot of the display object as it is at that moment. It can + * provide a performance benefit for complex static displayObjects. + * To remove simply set this property to `false` + * + * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + cacheAsBitmap: boolean; + /** + * The instance name of the object. + * + * @memberof PIXI.DisplayObject# + * @member {string} name + */ + name: string; + /** + * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot. + * + * @method getGlobalPosition + * @memberof PIXI.DisplayObject# + * @param {Point} point - The point to write the global value to. If null a new point will be returned + * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @return {Point} The updated point. + */ + getGlobalPosition(point: Point, skipUpdate: boolean): Point; + } + /** + * Renderer for Particles that is designer for speed over feature set. + * + * @class + * @memberof PIXI + */ + class ParticleRenderer { + constructor(renderer: PIXI.Renderer); + /** + * The default shader that is used if a sprite doesn't have a more specific one. + * + * @member {PIXI.Shader} PIXI.ParticleRenderer#shader + */ + shader: PIXI.Shader; + /** + * Renders the particle container object. + * + * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer + */ + render(container: PIXI.ParticleContainer): void; + /** + * Uploads the vertices. + * + * @param {PIXI.DisplayObject[]} children - the array of display objects to render + * @param {number} startIndex - the index to start from in the children array + * @param {number} amount - the amount of children that will have their vertices uploaded + * @param {number[]} array - The vertices to upload. + * @param {number} stride - Stride to use for iteration. + * @param {number} offset - Offset to start at. + */ + uploadVertices(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; + /** + * Uploads the position. + * + * @param {PIXI.DisplayObject[]} children - the array of display objects to render + * @param {number} startIndex - the index to start from in the children array + * @param {number} amount - the amount of children that will have their positions uploaded + * @param {number[]} array - The vertices to upload. + * @param {number} stride - Stride to use for iteration. + * @param {number} offset - Offset to start at. + */ + uploadPosition(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; + /** + * Uploads the rotiation. + * + * @param {PIXI.DisplayObject[]} children - the array of display objects to render + * @param {number} startIndex - the index to start from in the children array + * @param {number} amount - the amount of children that will have their rotation uploaded + * @param {number[]} array - The vertices to upload. + * @param {number} stride - Stride to use for iteration. + * @param {number} offset - Offset to start at. + */ + uploadRotation(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; + /** + * Uploads the Uvs + * + * @param {PIXI.DisplayObject[]} children - the array of display objects to render + * @param {number} startIndex - the index to start from in the children array + * @param {number} amount - the amount of children that will have their rotation uploaded + * @param {number[]} array - The vertices to upload. + * @param {number} stride - Stride to use for iteration. + * @param {number} offset - Offset to start at. + */ + uploadUvs(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; + /** + * Uploads the tint. + * + * @param {PIXI.DisplayObject[]} children - the array of display objects to render + * @param {number} startIndex - the index to start from in the children array + * @param {number} amount - the amount of children that will have their rotation uploaded + * @param {number[]} array - The vertices to upload. + * @param {number} stride - Stride to use for iteration. + * @param {number} offset - Offset to start at. + */ + uploadTint(children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; + /** + * Destroys the ParticleRenderer. + */ + destroy(): void; + } + /** + * The prepare namespace provides renderer-specific plugins for pre-rendering DisplayObjects. These plugins are useful for + * asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed. + * + * Do not instantiate these plugins directly. It is available from the `renderer.plugins` property. + * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}. + * @example + * // Create a new application + * const app = new PIXI.Application(); + * document.body.appendChild(app.view); + * + * // Don't start rendering right away + * app.stop(); + * + * // create a display object + * const rect = new PIXI.Graphics() + * .beginFill(0x00ff00) + * .drawRect(40, 40, 200, 200); + * + * // Add to the stage + * app.stage.addChild(rect); + * + * // Don't start rendering until the graphic is uploaded to the GPU + * app.renderer.plugins.prepare.upload(app.stage, () => { + * app.start(); + * }); + * @namespace PIXI.prepare + */ + namespace prepare { + /** + * @class PIXI.prepare.WebGLPrepare + * @deprecated since 5.0.0 + * @see PIXI.prepare.Prepare + */ + class WebGLPrepare { + } + /** + * The prepare manager provides functionality to upload content to the GPU. + * + * This cannot be done directly for Canvas like in WebGL, but the effect can be achieved by drawing + * textures to an offline canvas. This draw call will force the texture to be moved onto the GPU. + * + * An instance of this class is automatically created by default, and can be found at `renderer.plugins.prepare` + * + * @class + * @extends PIXI.prepare.BasePrepare + * @memberof PIXI.prepare + */ + class CanvasPrepare extends PIXI.prepare.BasePrepare { + constructor(renderer: PIXI.CanvasRenderer); + /** + * Destroys the plugin, don't use after this. + * + */ + destroy(): void; + /** + * The limiter to be used to control how quickly items are prepared. + * @type {PIXI.prepare.CountLimiter|PIXI.prepare.TimeLimiter} + */ + limiter: PIXI.prepare.CountLimiter | PIXI.prepare.TimeLimiter; + /** + * Reference to the renderer. + * @type {PIXI.AbstractRenderer} + * @protected + */ + protected renderer: PIXI.AbstractRenderer; + /** + * The only real difference between CanvasPrepare and Prepare is what they pass + * to upload hooks. That different parameter is stored here. + * @type {PIXI.prepare.CanvasPrepare|PIXI.Renderer} + * @protected + */ + protected uploadHookHelper: PIXI.prepare.CanvasPrepare | PIXI.Renderer; + /** + * Upload all the textures and graphics to the GPU. + * + * @param {Function|PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} item - + * Either the container or display object to search for items to upload, the items to upload themselves, + * or the callback function, if items have been added using `prepare.add`. + * @param {Function} [done] - Optional callback when all queued uploads have completed + */ + upload(item: ((...params: any[]) => any) | PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text, done?: (...params: any[]) => any): void; + /** + * Adds hooks for finding items. + * + * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array` + * function must return `true` if it was able to add item to the queue. + * @return {PIXI.prepare.BasePrepare} Instance of plugin for chaining. + */ + registerFindHook(addHook: (...params: any[]) => any): PIXI.prepare.BasePrepare; + /** + * Adds hooks for uploading items. + * + * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and + * function must return `true` if it was able to handle upload of item. + * @return {PIXI.prepare.BasePrepare} Instance of plugin for chaining. + */ + registerUploadHook(uploadHook: (...params: any[]) => any): PIXI.prepare.BasePrepare; + /** + * Manually add an item to the uploading queue. + * + * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to + * add to the queue + * @return {PIXI.prepare.BasePrepare} Instance of plugin for chaining. + */ + add(item: PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text | any): PIXI.prepare.BasePrepare; + } + /** + * The prepare manager provides functionality to upload content to the GPU. + * + * BasePrepare handles basic queuing functionality and is extended by + * {@link PIXI.prepare.Prepare} and {@link PIXI.prepare.CanvasPrepare} + * to provide preparation capabilities specific to their respective renderers. + * + * @example + * // Create a sprite + * const sprite = new PIXI.Sprite.from('something.png'); + * + * // Load object into GPU + * app.renderer.plugins.prepare.upload(sprite, () => { + * + * //Texture(s) has been uploaded to GPU + * app.stage.addChild(sprite); + * + * }) + * + * @abstract + * @class + * @memberof PIXI.prepare + */ + class BasePrepare { + constructor(renderer: PIXI.AbstractRenderer); + /** + * The limiter to be used to control how quickly items are prepared. + * @type {PIXI.prepare.CountLimiter|PIXI.prepare.TimeLimiter} + */ + limiter: PIXI.prepare.CountLimiter | PIXI.prepare.TimeLimiter; + /** + * Reference to the renderer. + * @type {PIXI.AbstractRenderer} + * @protected + */ + protected renderer: PIXI.AbstractRenderer; + /** + * The only real difference between CanvasPrepare and Prepare is what they pass + * to upload hooks. That different parameter is stored here. + * @type {PIXI.prepare.CanvasPrepare|PIXI.Renderer} + * @protected + */ + protected uploadHookHelper: PIXI.prepare.CanvasPrepare | PIXI.Renderer; + /** + * Upload all the textures and graphics to the GPU. + * + * @param {Function|PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} item - + * Either the container or display object to search for items to upload, the items to upload themselves, + * or the callback function, if items have been added using `prepare.add`. + * @param {Function} [done] - Optional callback when all queued uploads have completed + */ + upload(item: ((...params: any[]) => any) | PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text, done?: (...params: any[]) => any): void; + /** + * Adds hooks for finding items. + * + * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array` + * function must return `true` if it was able to add item to the queue. + * @return {PIXI.prepare.BasePrepare} Instance of plugin for chaining. + */ + registerFindHook(addHook: (...params: any[]) => any): PIXI.prepare.BasePrepare; + /** + * Adds hooks for uploading items. + * + * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and + * function must return `true` if it was able to handle upload of item. + * @return {PIXI.prepare.BasePrepare} Instance of plugin for chaining. + */ + registerUploadHook(uploadHook: (...params: any[]) => any): PIXI.prepare.BasePrepare; + /** + * Manually add an item to the uploading queue. + * + * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to + * add to the queue + * @return {PIXI.prepare.BasePrepare} Instance of plugin for chaining. + */ + add(item: PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text | any): PIXI.prepare.BasePrepare; + /** + * Destroys the plugin, don't use after this. + * + */ + destroy(): void; + } + /** + * CountLimiter limits the number of items handled by a {@link PIXI.prepare.BasePrepare} to a specified + * number of items per frame. + * + * @class + * @memberof PIXI.prepare + */ + class CountLimiter { + constructor(maxItemsPerFrame: number); + /** + * Resets any counting properties to start fresh on a new frame. + */ + beginFrame(): void; + /** + * Checks to see if another item can be uploaded. This should only be called once per item. + * @return {boolean} If the item is allowed to be uploaded. + */ + allowedToUpload(): boolean; + } + /** + * The prepare manager provides functionality to upload content to the GPU. + * + * An instance of this class is automatically created by default, and can be found at `renderer.plugins.prepare` + * + * @class + * @extends PIXI.prepare.BasePrepare + * @memberof PIXI.prepare + */ + class Prepare extends PIXI.prepare.BasePrepare { + constructor(renderer: PIXI.Renderer); + /** + * The limiter to be used to control how quickly items are prepared. + * @type {PIXI.prepare.CountLimiter|PIXI.prepare.TimeLimiter} + */ + limiter: PIXI.prepare.CountLimiter | PIXI.prepare.TimeLimiter; + /** + * Reference to the renderer. + * @type {PIXI.AbstractRenderer} + * @protected + */ + protected renderer: PIXI.AbstractRenderer; + /** + * The only real difference between CanvasPrepare and Prepare is what they pass + * to upload hooks. That different parameter is stored here. + * @type {PIXI.prepare.CanvasPrepare|PIXI.Renderer} + * @protected + */ + protected uploadHookHelper: PIXI.prepare.CanvasPrepare | PIXI.Renderer; + /** + * Upload all the textures and graphics to the GPU. + * + * @param {Function|PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} item - + * Either the container or display object to search for items to upload, the items to upload themselves, + * or the callback function, if items have been added using `prepare.add`. + * @param {Function} [done] - Optional callback when all queued uploads have completed + */ + upload(item: ((...params: any[]) => any) | PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text, done?: (...params: any[]) => any): void; + /** + * Adds hooks for finding items. + * + * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array` + * function must return `true` if it was able to add item to the queue. + * @return {PIXI.prepare.BasePrepare} Instance of plugin for chaining. + */ + registerFindHook(addHook: (...params: any[]) => any): PIXI.prepare.BasePrepare; + /** + * Adds hooks for uploading items. + * + * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and + * function must return `true` if it was able to handle upload of item. + * @return {PIXI.prepare.BasePrepare} Instance of plugin for chaining. + */ + registerUploadHook(uploadHook: (...params: any[]) => any): PIXI.prepare.BasePrepare; + /** + * Manually add an item to the uploading queue. + * + * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to + * add to the queue + * @return {PIXI.prepare.BasePrepare} Instance of plugin for chaining. + */ + add(item: PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text | any): PIXI.prepare.BasePrepare; + /** + * Destroys the plugin, don't use after this. + * + */ + destroy(): void; + } + /** + * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified + * number of milliseconds per frame. + * + * @class + * @memberof PIXI.prepare + */ + class TimeLimiter { + constructor(maxMilliseconds: number); + /** + * Resets any counting properties to start fresh on a new frame. + */ + beginFrame(): void; + /** + * Checks to see if another item can be uploaded. This should only be called once per item. + * @return {boolean} If the item is allowed to be uploaded. + */ + allowedToUpload(): boolean; + } + } + /** + * A Runner is a highly performant and simple alternative to signals. Best used in situations + * where events are dispatched to many objects at high frequency (say every frame!) + * + * + * like a signal.. + * ``` + * const myObject = { + * loaded: new PIXI.Runner('loaded') + * } + * + * const listener = { + * loaded: function(){ + * // thin + * } + * } + * + * myObject.update.add(listener); + * + * myObject.loaded.emit(); + * ``` + * + * Or for handling calling the same function on many items + * ``` + * const myGame = { + * update: new PIXI.Runner('update') + * } + * + * const gameObject = { + * update: function(time){ + * // update my gamey state + * } + * } + * + * myGame.update.add(gameObject1); + * + * myGame.update.emit(time); + * ``` + * @class + * @memberof PIXI + */ + class Runner { + constructor(name: string); + /** + * Dispatch/Broadcast Runner to all listeners added to the queue. + * @param {...any} params - optional parameters to pass to each listener + */ + emit(...params: any[]): void; + /** + * Add a listener to the Runner + * + * Runners do not need to have scope or functions passed to them. + * All that is required is to pass the listening object and ensure that it has contains a function that has the same name + * as the name provided to the Runner when it was created. + * + * Eg A listener passed to this Runner will require a 'complete' function. + * + * ``` + * const complete = new PIXI.Runner('complete'); + * ``` + * + * The scope used will be the object itself. + * + * @param {any} item - The object that will be listening. + */ + add(item: any): void; + /** + * Remove a single listener from the dispatch queue. + * @param {any} item - The listenr that you would like to remove. + */ + remove(item: any): void; + /** + * Check to see if the listener is already in the Runner + * @param {any} item - The listener that you would like to check. + */ + contains(item: any): void; + /** + * Remove all listeners from the Runner + */ + removeAll(): void; + /** + * Remove all references, don't use after this. + */ + destroy(): void; + /** + * `true` if there are no this Runner contains no listeners + * + * @member {boolean} + * @readonly + */ + readonly empty: boolean; + /** + * The name of the runner. + * + * @member {string} + * @readonly + */ + readonly name: string; + /** + * Alias for `emit` + * @memberof PIXI.Runner# + * @method dispatch + * @see PIXI.Runner#emit + */ + dispatch(): void; + /** + * Alias for `emit` + * @memberof PIXI.Runner# + * @method run + * @see PIXI.Runner#emit + */ + run(): void; + } + /** + * User's customizable globals for overriding the default PIXI settings, such + * as a renderer's default resolution, framerate, float precision, etc. + * @example + * // Use the native window resolution as the default resolution + * // will support high-density displays when rendering + * PIXI.settings.RESOLUTION = window.devicePixelRatio. + * + * // Disable interpolation when scaling, will make texture be pixelated + * PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST; + * @namespace PIXI.settings + */ + namespace settings { + /** + * Default transform type. + * + * @static + * @deprecated since 5.0.0 + * @memberof PIXI.settings + * @type {PIXI.TRANSFORM_MODE} + * @default PIXI.TRANSFORM_MODE.STATIC + */ + var TRANSFORM_MODE: PIXI.TRANSFORM_MODE; + /** + * Default `canvasPadding` for canvas-based Mesh rendering. + * + * @see PIXI.Mesh2d#canvasPadding + * @static + * @name MESH_CANVAS_PADDING + * @memberof PIXI.settings + * @type {number} + * @default 0 + */ + var MESH_CANVAS_PADDING: number; + /** + * The maximum support for using WebGL. If a device does not + * support WebGL version, for instance WebGL 2, it will still + * attempt to fallback support to WebGL 1. If you want to + * explicitly remove feature support to target a more stable + * baseline, prefer a lower environment. + * + * Due to {@link https://bugs.chromium.org/p/chromium/issues/detail?id=934823|bug in chromium} + * we disable webgl2 by default for all non-apple mobile devices. + * + * @static + * @name PREFER_ENV + * @memberof PIXI.settings + * @type {number} + * @default PIXI.ENV.WEBGL2 + */ + var PREFER_ENV: number; + /** + * Sets the default value for the container property 'sortableChildren'. + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @static + * @constant + * @name SORTABLE_CHILDREN + * @memberof PIXI.settings + * @type {boolean} + * @default false + */ + var SORTABLE_CHILDREN: boolean; + /** + * Default number of uploads per frame using prepare plugin. + * + * @static + * @memberof PIXI.settings + * @name UPLOADS_PER_FRAME + * @type {number} + * @default 4 + */ + var UPLOADS_PER_FRAME: number; + /** + * If set to true WebGL will attempt make textures mimpaped by default. + * Mipmapping will only succeed if the base texture uploaded has power of two dimensions. + * + * @static + * @name MIPMAP_TEXTURES + * @memberof PIXI.settings + * @type {PIXI.MIPMAP_MODES} + * @default PIXI.MIPMAP_MODES.POW2 + */ + var MIPMAP_TEXTURES: PIXI.MIPMAP_MODES; + /** + * Default resolution / device pixel ratio of the renderer. + * + * @static + * @name RESOLUTION + * @memberof PIXI.settings + * @type {number} + * @default 1 + */ + var RESOLUTION: number; + /** + * Default filter resolution. + * + * @static + * @name FILTER_RESOLUTION + * @memberof PIXI.settings + * @type {number} + * @default 1 + */ + var FILTER_RESOLUTION: number; + /** + * The maximum textures that this device supports. + * + * @static + * @name SPRITE_MAX_TEXTURES + * @memberof PIXI.settings + * @type {number} + * @default 32 + */ + var SPRITE_MAX_TEXTURES: number; + /** + * The default sprite batch size. + * + * The default aims to balance desktop and mobile devices. + * + * @static + * @name SPRITE_BATCH_SIZE + * @memberof PIXI.settings + * @type {number} + * @default 4096 + */ + var SPRITE_BATCH_SIZE: number; + /** + * The default render options if none are supplied to {@link PIXI.Renderer} + * or {@link PIXI.CanvasRenderer}. + * + * @static + * @name RENDER_OPTIONS + * @memberof PIXI.settings + * @type {object} + * @property {HTMLCanvasElement} view=null + * @property {number} resolution=1 + * @property {boolean} antialias=false + * @property {boolean} forceFXAA=false + * @property {boolean} autoDensity=false + * @property {boolean} transparent=false + * @property {number} backgroundColor=0x000000 + * @property {boolean} clearBeforeRender=true + * @property {boolean} preserveDrawingBuffer=false + * @property {number} width=800 + * @property {number} height=600 + * @property {boolean} legacy=false + */ + var RENDER_OPTIONS: { + view: HTMLCanvasElement; + resolution: number; + antialias: boolean; + forceFXAA: boolean; + autoDensity: boolean; + transparent: boolean; + backgroundColor: number; + clearBeforeRender: boolean; + preserveDrawingBuffer: boolean; + width: number; + height: number; + legacy: boolean; + }; + /** + * Default Garbage Collection mode. + * + * @static + * @name GC_MODE + * @memberof PIXI.settings + * @type {PIXI.GC_MODES} + * @default PIXI.GC_MODES.AUTO + */ + var GC_MODE: PIXI.GC_MODES; + /** + * Default Garbage Collection max idle. + * + * @static + * @name GC_MAX_IDLE + * @memberof PIXI.settings + * @type {number} + * @default 3600 + */ + var GC_MAX_IDLE: number; + /** + * Default Garbage Collection maximum check count. + * + * @static + * @name GC_MAX_CHECK_COUNT + * @memberof PIXI.settings + * @type {number} + * @default 600 + */ + var GC_MAX_CHECK_COUNT: number; + /** + * Default wrap modes that are supported by pixi. + * + * @static + * @name WRAP_MODE + * @memberof PIXI.settings + * @type {PIXI.WRAP_MODES} + * @default PIXI.WRAP_MODES.CLAMP + */ + var WRAP_MODE: PIXI.WRAP_MODES; + /** + * Default scale mode for textures. + * + * @static + * @name SCALE_MODE + * @memberof PIXI.settings + * @type {PIXI.SCALE_MODES} + * @default PIXI.SCALE_MODES.LINEAR + */ + var SCALE_MODE: PIXI.SCALE_MODES; + /** + * Default specify float precision in vertex shader. + * + * @static + * @name PRECISION_VERTEX + * @memberof PIXI.settings + * @type {PIXI.PRECISION} + * @default PIXI.PRECISION.HIGH + */ + var PRECISION_VERTEX: PIXI.PRECISION; + /** + * Default specify float precision in fragment shader. + * iOS is best set at highp due to https://github.com/pixijs/pixi.js/issues/3742 + * + * @static + * @name PRECISION_FRAGMENT + * @memberof PIXI.settings + * @type {PIXI.PRECISION} + * @default PIXI.PRECISION.MEDIUM + */ + var PRECISION_FRAGMENT: PIXI.PRECISION; + /** + * Can we upload the same buffer in a single frame? + * + * @static + * @name CAN_UPLOAD_SAME_BUFFER + * @memberof PIXI.settings + * @type {boolean} + */ + var CAN_UPLOAD_SAME_BUFFER: boolean; + /** + * Enables bitmap creation before image load + * + * @static + * @name CREATE_IMAGE_BITMAP + * @memberof PIXI.settings + * @type {boolean} + * @default true + */ + var CREATE_IMAGE_BITMAP: boolean; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * + * @static + * @constant + * @memberof PIXI.settings + * @type {boolean} + * @default false + */ + var ROUND_PIXELS: boolean; + /** + * Target frames per millisecond. + * + * @static + * @name TARGET_FPMS + * @memberof PIXI.settings + * @type {number} + * @default 0.06 + */ + var TARGET_FPMS: number; + /** + * The prefix that denotes a URL is for a retina asset. + * + * @static + * @name RETINA_PREFIX + * @memberof PIXI.settings + * @type {RegExp} + * @default /@([0-9\.]+)x/ + * @example `@2x` + */ + var RETINA_PREFIX: RegExp; + } + /** + * The Sprite object is the base for all textured objects that are rendered to the screen + * + * A sprite can be created directly from an image like this: + * + * ```js + * let sprite = new PIXI.Sprite.from('assets/image.png'); + * ``` + * + * The more efficient way to create sprites is using a {@link PIXI.Spritesheet}, + * as swapping base textures when rendering to the screen is inefficient. + * + * ```js + * PIXI.Loader.shared.add("assets/spritesheet.json").load(setup); + * + * function setup() { + * let sheet = PIXI.Loader.shared.resources["assets/spritesheet.json"].spritesheet; + * let sprite = new PIXI.Sprite(sheet.textures["image.png"]); + * ... + * } + * ``` + * + * @class + * @extends PIXI.Container + * @memberof PIXI + */ + class Sprite extends PIXI.Container { + constructor(texture: PIXI.Texture); + /** + * @deprecated since 5.0.0 + * @see PIXI.Sprite.from + * @method PIXI.Sprite.fromImage + * @return {PIXI.Sprite} + */ + static fromImage(): PIXI.Sprite; + /** + * @deprecated since 5.0.0 + * @method PIXI.Sprite.fromSVG + * @see PIXI.Sprite.from + * @return {PIXI.Sprite} + */ + static fromSVG(): PIXI.Sprite; + /** + * @deprecated since 5.0.0 + * @method PIXI.Sprite.fromCanvas + * @see PIXI.Sprite.from + * @return {PIXI.Sprite} + */ + static fromCanvas(): PIXI.Sprite; + /** + * @deprecated since 5.0.0 + * @method PIXI.Sprite.fromVideo + * @see PIXI.Sprite.from + * @return {PIXI.Sprite} + */ + static fromVideo(): PIXI.Sprite; + /** + * @deprecated since 5.0.0 + * @method PIXI.Sprite.fromFrame + * @see PIXI.Sprite.from + * @return {PIXI.Sprite} + */ + static fromFrame(): PIXI.Sprite; + /** + * Cached tinted texture. + * @memberof PIXI.Sprite# + * @member {HTMLCanvasElement} _tintedCanvas + * @protected + */ + protected _tintedCanvas: HTMLCanvasElement; + /** + * Cached tint value so we can tell when the tint is changed. + * @memberof PIXI.Sprite# + * @member {number} _cachedTint + * @protected + */ + protected _cachedTint: number; + /** + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. + * + * @member {number} PIXI.Sprite#blendMode + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES + */ + blendMode: number; + /** + * The shader that will be used to render the sprite. Set to null to remove a current shader. + * + * @member {PIXI.Filter|PIXI.Shader} PIXI.Sprite#shader + */ + shader: PIXI.Filter | PIXI.Shader; + /** + * Plugin that is responsible for rendering this element. + * Allows to customize the rendering process without overriding '_render' & '_renderCanvas' methods. + * + * @member {string} PIXI.Sprite#pluginName + * @default 'sprite' + */ + pluginName: string; + /** + * used to fast check if a sprite is.. a sprite! + * @member {boolean} PIXI.Sprite#isSprite + */ + isSprite: boolean; + /** + * calculates worldTransform * vertices, store it in vertexData + */ + calculateVertices(): void; + /** + * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData + * This is used to ensure that the true width and height of a trimmed texture is respected + */ + calculateTrimmedVertices(): void; + /** + * + * Renders the object using the WebGL renderer + * + * @protected + * @param {PIXI.Renderer} renderer - The webgl renderer to use. + */ + protected _render(renderer: PIXI.Renderer): void; + /** + * Updates the bounds of the sprite. + * + * @protected + */ + protected _calculateBounds(): void; + /** + * Gets the local bounds of the sprite object. + * + * @param {PIXI.Rectangle} rect - The output rectangle. + * @return {PIXI.Rectangle} The bounds. + */ + getLocalBounds(rect: PIXI.Rectangle): PIXI.Rectangle; + /** + * Tests if a point is inside this sprite + * + * @param {PIXI.Point} point - the point to test + * @return {boolean} the result of the test + */ + containsPoint(point: PIXI.Point): boolean; + /** + * Destroys this sprite and optionally its texture and children + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well + * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well + */ + destroy(options?: { + children?: boolean; + texture?: boolean; + baseTexture?: boolean; + }): void; + /** + * Helper function that creates a new sprite based on the source you provide. + * The source can be - frame id, image url, video url, canvas element, video element, base texture + * + * @static + * @param {number|string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from + * @param {object} [options] See {@link PIXI.BaseTexture}'s constructor for options. + * @return {PIXI.Sprite} The newly created sprite + */ + static from(source: number | string | PIXI.Texture | HTMLCanvasElement | HTMLVideoElement, options?: any): PIXI.Sprite; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * To set the global default, change {@link PIXI.settings.ROUND_PIXELS} + * + * @member {boolean} + * @default false + */ + roundPixels: boolean; + /** + * The width of the sprite, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + width: number; + /** + * The height of the sprite, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + height: number; + /** + * The anchor sets the origin point of the text. The default value is taken from the {@link PIXI.Texture|Texture} + * and passed to the constructor. + * + * The default is `(0,0)`, this means the text's origin is the top left. + * + * Setting the anchor to `(0.5,0.5)` means the text's origin is centered. + * + * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner. + * + * If you pass only single parameter, it will set both x and y to the same value as shown in the example below. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5). + * + * @member {PIXI.ObservablePoint} + */ + anchor: PIXI.ObservablePoint; + /** + * The tint applied to the sprite. This is a hex value. + * A value of 0xFFFFFF will remove any tint effect. + * + * @member {number} + * @default 0xFFFFFF + */ + tint: number; + /** + * The texture that the sprite is using + * + * @member {PIXI.Texture} + */ + texture: PIXI.Texture; + /** + * @method PIXI.Container#renderWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#render + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderWebGL(renderer: PIXI.Renderer): void; + /** + * @method PIXI.Container#renderAdvancedWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#renderAdvanced + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderAdvancedWebGL(renderer: PIXI.Renderer): void; + /** + * Renders the object using the Canvas renderer + * @method renderCanvas + * @memberof PIXI.Container# + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} PIXI.Container#children + * @readonly + */ + readonly children: PIXI.DisplayObject[]; + /** + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @see PIXI.settings.SORTABLE_CHILDREN + * + * @member {boolean} PIXI.Container#sortableChildren + */ + sortableChildren: boolean; + /** + * Should children be sorted by zIndex at the next updateTransform call. + * Will get automatically set to true if a new child is added, or if a child's zIndex changes. + * + * @member {boolean} PIXI.Container#sortDirty + */ + sortDirty: boolean; + /** + * Overridable method that can be used by Container subclasses whenever the children array is modified + * + * @protected + */ + protected onChildrenChange(): void; + /** + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. + */ + addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject; + /** + * Swaps the position of 2 Display Objects within this container. + * + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap + */ + swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void; + /** + * Returns the index position of a child DisplayObject instance + * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify + */ + getChildIndex(child: PIXI.DisplayObject): number; + /** + * Changes the position of an existing child in the display object container + * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object + */ + setChildIndex(child: PIXI.DisplayObject, index: number): void; + /** + * Returns the child at the specified index + * + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. + */ + getChildAt(index: number): PIXI.DisplayObject; + /** + * Removes one or more children from the container. + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. + */ + removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Removes a child from the specified index position. + * + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. + */ + removeChildAt(index: number): PIXI.DisplayObject; + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; + /** + * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex. + */ + sortChildren(): void; + /** + * Updates the transform on all children of this container for rendering + */ + updateTransform(): void; + /** + * Recalculates the bounds of the container. + * + */ + calculateBounds(): void; + /** + * Renders the object using the WebGL renderer + * + * @param {PIXI.Renderer} renderer - The renderer + */ + render(renderer: PIXI.Renderer): void; + /** + * Render the object using the WebGL renderer and advanced features. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected renderAdvanced(renderer: PIXI.Renderer): void; + /** + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows PixiJS to bypass a recursive `hitTest` function + * + * @member {boolean} + * @memberof PIXI.Container# + */ + interactiveChildren: boolean; + /** + * Returns the display object in the container. + * + * @method getChildByName + * @memberof PIXI.Container# + * @param {string} name - Instance name. + * @return {PIXI.DisplayObject} The child with the specified name. + */ + getChildByName(name: string): PIXI.DisplayObject; + /** + * Flag for if the object is accessible. If true AccessibilityManager will overlay a + * shadow div with attributes set + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + accessible: boolean; + /** + * Sets the title attribute of the shadow div + * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]' + * + * @member {?string} + * @memberof PIXI.DisplayObject# + */ + accessibleTitle: string; + /** + * Sets the aria-label attribute of the shadow div + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + accessibleHint: string; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleActive: boolean; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleDiv: boolean; + /** + * World transform and local transform of this object. + * This will become read-only later, please do not assign anything there unless you know what are you doing. + * + * @member {PIXI.Transform} PIXI.DisplayObject#transform + */ + transform: PIXI.Transform; + /** + * The opacity of the object. + * + * @member {number} PIXI.DisplayObject#alpha + */ + alpha: number; + /** + * The visibility of the object. If false the object will not be drawn, and + * the updateTransform function will not be called. + * + * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually. + * + * @member {boolean} PIXI.DisplayObject#visible + */ + visible: boolean; + /** + * Can this object be rendered, if false the object will not be drawn but the updateTransform + * methods will still be called. + * + * Only affects recursive calls from parent. You can ask for bounds manually. + * + * @member {boolean} PIXI.DisplayObject#renderable + */ + renderable: boolean; + /** + * The display object container that contains this display object. + * + * @member {PIXI.Container} PIXI.DisplayObject#parent + * @readonly + */ + readonly parent: PIXI.Container; + /** + * The multiplied alpha of the displayObject. + * + * @member {number} PIXI.DisplayObject#worldAlpha + * @readonly + */ + readonly worldAlpha: number; + /** + * Which index in the children array the display component was before the previous zIndex sort. + * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider. + * + * @member {number} PIXI.DisplayObject#_lastSortedIndex + * @protected + */ + protected _lastSortedIndex: number; + /** + * The zIndex of the displayObject. + * A higher value will mean it will be rendered on top of other displayObjects within the same container. + * + * @member {number} PIXI.DisplayObject#_zIndex + * @protected + */ + protected _zIndex: number; + /** + * The area the filter is applied to. This is used as more of an optimization + * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. + * + * Also works as an interaction mask. + * + * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea + */ + filterArea: PIXI.Rectangle; + /** + * Sets the filters for the displayObject. + * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * To remove filters simply set this property to `'null'`. + * + * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters + */ + filters: PIXI.Filter[]; + /** + * The bounds object, this is used to calculate and store the bounds of the displayObject. + * + * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds + * @protected + */ + protected _bounds: PIXI.Bounds; + /** + * The original, cached mask of the object. + * + * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask + * @protected + */ + protected _mask: PIXI.Graphics | PIXI.Sprite; + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} PIXI.DisplayObject#_destroyed + * @protected + */ + protected _destroyed: boolean; + /** + * @protected + * @member {PIXI.DisplayObject} + */ + protected _tempDisplayObjectParent: PIXI.DisplayObject; + /** + * Recursively updates transform of all objects from the root to this one + * internal function for toLocal() + */ + _recursivePostUpdateTransform(): void; + /** + * Retrieves the bounds of the displayObject as a rectangle object. + * + * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Calculates the global position of the display object. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform. + * @return {PIXI.IPoint} A point object representing the position of this object. + */ + toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Calculates the local position of the display object relative to another point. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform + * @return {PIXI.IPoint} A point object representing the position of this object + */ + toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Set the parent Container of this DisplayObject. + * + * @param {PIXI.Container} container - The Container to add this DisplayObject to. + * @return {PIXI.Container} The Container that this DisplayObject was added to. + */ + setParent(container: PIXI.Container): PIXI.Container; + /** + * Convenience function to set the position, scale, skew and pivot at once. + * + * @param {number} [x=0] - The X position + * @param {number} [y=0] - The Y position + * @param {number} [scaleX=1] - The X scale value + * @param {number} [scaleY=1] - The Y scale value + * @param {number} [rotation=0] - The rotation + * @param {number} [skewX=0] - The X skew value + * @param {number} [skewY=0] - The Y skew value + * @param {number} [pivotX=0] - The X pivot value + * @param {number} [pivotY=0] - The Y pivot value + * @return {PIXI.DisplayObject} The DisplayObject instance + */ + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject; + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * An alias to position.x + * + * @member {number} + */ + x: number; + /** + * The position of the displayObject on the y axis relative to the local coordinates of the parent. + * An alias to position.y + * + * @member {number} + */ + y: number; + /** + * Current transform of the object based on world (parent) factors. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly worldTransform: PIXI.Matrix; + /** + * Current transform of the object based on local factors: position, scale, other stuff. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly localTransform: PIXI.Matrix; + /** + * The coordinate of the object relative to the local coordinates of the parent. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + position: PIXI.IPoint; + /** + * The scale factor of the object. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + scale: PIXI.IPoint; + /** + * The pivot point of the displayObject that it rotates around. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + pivot: PIXI.IPoint; + /** + * The skew factor for the object in radians. + * Assignment by value since pixi-v4. + * + * @member {PIXI.ObservablePoint} + */ + skew: PIXI.ObservablePoint; + /** + * The rotation of the object in radians. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + rotation: number; + /** + * The angle of the object in degrees. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + angle: number; + /** + * The zIndex of the displayObject. + * If a container has the sortableChildren property set to true, children will be automatically + * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, + * and thus rendered on top of other displayObjects within the same container. + * + * @member {number} + */ + zIndex: number; + /** + * Indicates if the object is globally visible. + * + * @member {boolean} + * @readonly + */ + readonly worldVisible: boolean; + /** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an + * object to the shape of the mask applied to it. In PixiJS a regular mask must be a + * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it + * utilities shape clipping. To remove a mask, set this property to `null`. + * + * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. + * @example + * const graphics = new PIXI.Graphics(); + * graphics.beginFill(0xFF3300); + * graphics.drawRect(50, 250, 100, 100); + * graphics.endFill(); + * + * const sprite = new PIXI.Sprite(texture); + * sprite.mask = graphics; + * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * + * @member {PIXI.Graphics|PIXI.Sprite} + */ + mask: PIXI.Graphics | PIXI.Sprite; + /** + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + interactive: boolean; + /** + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# + */ + hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle; + /** + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + buttonMode: boolean; + /** + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + cursor: string; + /** + * Set this to true if you want this display object to be cached as a bitmap. + * This basically takes a snap shot of the display object as it is at that moment. It can + * provide a performance benefit for complex static displayObjects. + * To remove simply set this property to `false` + * + * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + cacheAsBitmap: boolean; + /** + * The instance name of the object. + * + * @memberof PIXI.DisplayObject# + * @member {string} name + */ + name: string; + /** + * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot. + * + * @method getGlobalPosition + * @memberof PIXI.DisplayObject# + * @param {Point} point - The point to write the global value to. If null a new point will be returned + * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @return {Point} The updated point. + */ + getGlobalPosition(point: Point, skipUpdate: boolean): Point; + } + module AnimatedSprite { + /** + * @memberof PIXI.AnimatedSprite + * @typedef {object} FrameObject + * @type {object} + * @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame + * @property {number} time - the duration of the frame in ms + */ + type FrameObject = { + texture: PIXI.Texture; + time: number; + }; + } + /** + * An AnimatedSprite is a simple way to display an animation depicted by a list of textures. + * + * ```js + * let alienImages = ["image_sequence_01.png","image_sequence_02.png","image_sequence_03.png","image_sequence_04.png"]; + * let textureArray = []; + * + * for (let i=0; i < 4; i++) + * { + * let texture = PIXI.Texture.from(alienImages[i]); + * textureArray.push(texture); + * }; + * + * let animatedSprite = new PIXI.AnimatedSprite(textureArray); + * ``` + * + * The more efficient and simpler way to create an animated sprite is using a {@link PIXI.Spritesheet} + * containing the animation definitions: + * + * ```js + * PIXI.Loader.shared.add("assets/spritesheet.json").load(setup); + * + * function setup() { + * let sheet = PIXI.Loader.shared.resources["assets/spritesheet.json"].spritesheet; + * animatedSprite = new PIXI.AnimatedSprite(sheet.animations["image_sequence"]); + * ... + * } + * ``` + * + * @class + * @extends PIXI.Sprite + * @memberof PIXI + */ + class AnimatedSprite extends PIXI.Sprite { + constructor(textures: PIXI.Texture[] | PIXI.AnimatedSprite.FrameObject[], autoUpdate?: boolean); + /** + * The speed that the AnimatedSprite will play at. Higher is faster, lower is slower. + * + * @member {number} PIXI.AnimatedSprite#animationSpeed + * @default 1 + */ + animationSpeed: number; + /** + * Whether or not the animate sprite repeats after playing. + * + * @member {boolean} PIXI.AnimatedSprite#loop + * @default true + */ + loop: boolean; + /** + * Update anchor to [Texture's defaultAnchor]{@link PIXI.Texture#defaultAnchor} when frame changes. + * + * Useful with [sprite sheet animations]{@link PIXI.Spritesheet#animations} created with tools. + * Changing anchor for each frame allows to pin sprite origin to certain moving feature + * of the frame (e.g. left foot). + * + * Note: Enabling this will override any previously set `anchor` on each frame change. + * + * @member {boolean} PIXI.AnimatedSprite#updateAnchor + * @default false + */ + updateAnchor: boolean; + /** + * Function to call when an AnimatedSprite finishes playing. + * + * @member {Function} PIXI.AnimatedSprite#onComplete + */ + onComplete: (...params: any[]) => any; + /** + * Function to call when an AnimatedSprite changes which texture is being rendered. + * + * @member {Function} PIXI.AnimatedSprite#onFrameChange + */ + onFrameChange: (...params: any[]) => any; + /** + * Function to call when `loop` is true, and an AnimatedSprite is played and loops around to start again. + * + * @member {Function} PIXI.AnimatedSprite#onLoop + */ + onLoop: (...params: any[]) => any; + /** + * Indicates if the AnimatedSprite is currently playing. + * + * @member {boolean} PIXI.AnimatedSprite#playing + * @readonly + */ + readonly playing: boolean; + /** + * Stops the AnimatedSprite. + * + */ + stop(): void; + /** + * Plays the AnimatedSprite. + * + */ + play(): void; + /** + * Stops the AnimatedSprite and goes to a specific frame. + * + * @param {number} frameNumber - Frame index to stop at. + */ + gotoAndStop(frameNumber: number): void; + /** + * Goes to a specific frame and begins playing the AnimatedSprite. + * + * @param {number} frameNumber - Frame index to start at. + */ + gotoAndPlay(frameNumber: number): void; + /** + * Stops the AnimatedSprite and destroys it. + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value. + * @param {boolean} [options.children=false] - If set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well. + * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well. + */ + destroy(options?: { + children?: boolean; + texture?: boolean; + baseTexture?: boolean; + }): void; + /** + * A short hand way of creating an AnimatedSprite from an array of frame ids. + * + * @static + * @param {string[]} frames - The array of frames ids the AnimatedSprite will use as its texture frames. + * @return {AnimatedSprite} The new animated sprite with the specified frames. + */ + static fromFrames(frames: string[]): AnimatedSprite; + /** + * A short hand way of creating an AnimatedSprite from an array of image ids. + * + * @static + * @param {string[]} images - The array of image urls the AnimatedSprite will use as its texture frames. + * @return {AnimatedSprite} The new animate sprite with the specified images as frames. + */ + static fromImages(images: string[]): AnimatedSprite; + /** + * The total number of frames in the AnimatedSprite. This is the same as number of textures + * assigned to the AnimatedSprite. + * + * @readonly + * @member {number} + * @default 0 + */ + readonly totalFrames: number; + /** + * The array of textures used for this AnimatedSprite. + * + * @member {PIXI.Texture[]} + */ + textures: PIXI.Texture[]; + /** + * The AnimatedSprites current frame index. + * + * @member {number} + * @readonly + */ + readonly currentFrame: number; + /** + * Cached tinted texture. + * @memberof PIXI.Sprite# + * @member {HTMLCanvasElement} _tintedCanvas + * @protected + */ + protected _tintedCanvas: HTMLCanvasElement; + /** + * Cached tint value so we can tell when the tint is changed. + * @memberof PIXI.Sprite# + * @member {number} _cachedTint + * @protected + */ + protected _cachedTint: number; + /** + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. + * + * @member {number} PIXI.Sprite#blendMode + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES + */ + blendMode: number; + /** + * The shader that will be used to render the sprite. Set to null to remove a current shader. + * + * @member {PIXI.Filter|PIXI.Shader} PIXI.Sprite#shader + */ + shader: PIXI.Filter | PIXI.Shader; + /** + * Plugin that is responsible for rendering this element. + * Allows to customize the rendering process without overriding '_render' & '_renderCanvas' methods. + * + * @member {string} PIXI.Sprite#pluginName + * @default 'sprite' + */ + pluginName: string; + /** + * used to fast check if a sprite is.. a sprite! + * @member {boolean} PIXI.Sprite#isSprite + */ + isSprite: boolean; + /** + * calculates worldTransform * vertices, store it in vertexData + */ + calculateVertices(): void; + /** + * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData + * This is used to ensure that the true width and height of a trimmed texture is respected + */ + calculateTrimmedVertices(): void; + /** + * + * Renders the object using the WebGL renderer + * + * @protected + * @param {PIXI.Renderer} renderer - The webgl renderer to use. + */ + protected _render(renderer: PIXI.Renderer): void; + /** + * Updates the bounds of the sprite. + * + * @protected + */ + protected _calculateBounds(): void; + /** + * Gets the local bounds of the sprite object. + * + * @param {PIXI.Rectangle} rect - The output rectangle. + * @return {PIXI.Rectangle} The bounds. + */ + getLocalBounds(rect: PIXI.Rectangle): PIXI.Rectangle; + /** + * Tests if a point is inside this sprite + * + * @param {PIXI.Point} point - the point to test + * @return {boolean} the result of the test + */ + containsPoint(point: PIXI.Point): boolean; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * To set the global default, change {@link PIXI.settings.ROUND_PIXELS} + * + * @member {boolean} + * @default false + */ + roundPixels: boolean; + /** + * The width of the sprite, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + width: number; + /** + * The height of the sprite, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + height: number; + /** + * The anchor sets the origin point of the text. The default value is taken from the {@link PIXI.Texture|Texture} + * and passed to the constructor. + * + * The default is `(0,0)`, this means the text's origin is the top left. + * + * Setting the anchor to `(0.5,0.5)` means the text's origin is centered. + * + * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner. + * + * If you pass only single parameter, it will set both x and y to the same value as shown in the example below. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5). + * + * @member {PIXI.ObservablePoint} + */ + anchor: PIXI.ObservablePoint; + /** + * The tint applied to the sprite. This is a hex value. + * A value of 0xFFFFFF will remove any tint effect. + * + * @member {number} + * @default 0xFFFFFF + */ + tint: number; + /** + * The texture that the sprite is using + * + * @member {PIXI.Texture} + */ + texture: PIXI.Texture; + /** + * @method PIXI.Container#renderWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#render + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderWebGL(renderer: PIXI.Renderer): void; + /** + * @method PIXI.Container#renderAdvancedWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#renderAdvanced + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderAdvancedWebGL(renderer: PIXI.Renderer): void; + /** + * Renders the object using the Canvas renderer + * @method renderCanvas + * @memberof PIXI.Container# + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} PIXI.Container#children + * @readonly + */ + readonly children: PIXI.DisplayObject[]; + /** + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @see PIXI.settings.SORTABLE_CHILDREN + * + * @member {boolean} PIXI.Container#sortableChildren + */ + sortableChildren: boolean; + /** + * Should children be sorted by zIndex at the next updateTransform call. + * Will get automatically set to true if a new child is added, or if a child's zIndex changes. + * + * @member {boolean} PIXI.Container#sortDirty + */ + sortDirty: boolean; + /** + * Overridable method that can be used by Container subclasses whenever the children array is modified + * + * @protected + */ + protected onChildrenChange(): void; + /** + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. + */ + addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject; + /** + * Swaps the position of 2 Display Objects within this container. + * + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap + */ + swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void; + /** + * Returns the index position of a child DisplayObject instance + * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify + */ + getChildIndex(child: PIXI.DisplayObject): number; + /** + * Changes the position of an existing child in the display object container + * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object + */ + setChildIndex(child: PIXI.DisplayObject, index: number): void; + /** + * Returns the child at the specified index + * + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. + */ + getChildAt(index: number): PIXI.DisplayObject; + /** + * Removes one or more children from the container. + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. + */ + removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Removes a child from the specified index position. + * + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. + */ + removeChildAt(index: number): PIXI.DisplayObject; + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; + /** + * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex. + */ + sortChildren(): void; + /** + * Updates the transform on all children of this container for rendering + */ + updateTransform(): void; + /** + * Recalculates the bounds of the container. + * + */ + calculateBounds(): void; + /** + * Renders the object using the WebGL renderer + * + * @param {PIXI.Renderer} renderer - The renderer + */ + render(renderer: PIXI.Renderer): void; + /** + * Render the object using the WebGL renderer and advanced features. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected renderAdvanced(renderer: PIXI.Renderer): void; + /** + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows PixiJS to bypass a recursive `hitTest` function + * + * @member {boolean} + * @memberof PIXI.Container# + */ + interactiveChildren: boolean; + /** + * Returns the display object in the container. + * + * @method getChildByName + * @memberof PIXI.Container# + * @param {string} name - Instance name. + * @return {PIXI.DisplayObject} The child with the specified name. + */ + getChildByName(name: string): PIXI.DisplayObject; + /** + * Flag for if the object is accessible. If true AccessibilityManager will overlay a + * shadow div with attributes set + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + accessible: boolean; + /** + * Sets the title attribute of the shadow div + * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]' + * + * @member {?string} + * @memberof PIXI.DisplayObject# + */ + accessibleTitle: string; + /** + * Sets the aria-label attribute of the shadow div + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + accessibleHint: string; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleActive: boolean; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleDiv: boolean; + /** + * World transform and local transform of this object. + * This will become read-only later, please do not assign anything there unless you know what are you doing. + * + * @member {PIXI.Transform} PIXI.DisplayObject#transform + */ + transform: PIXI.Transform; + /** + * The opacity of the object. + * + * @member {number} PIXI.DisplayObject#alpha + */ + alpha: number; + /** + * The visibility of the object. If false the object will not be drawn, and + * the updateTransform function will not be called. + * + * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually. + * + * @member {boolean} PIXI.DisplayObject#visible + */ + visible: boolean; + /** + * Can this object be rendered, if false the object will not be drawn but the updateTransform + * methods will still be called. + * + * Only affects recursive calls from parent. You can ask for bounds manually. + * + * @member {boolean} PIXI.DisplayObject#renderable + */ + renderable: boolean; + /** + * The display object container that contains this display object. + * + * @member {PIXI.Container} PIXI.DisplayObject#parent + * @readonly + */ + readonly parent: PIXI.Container; + /** + * The multiplied alpha of the displayObject. + * + * @member {number} PIXI.DisplayObject#worldAlpha + * @readonly + */ + readonly worldAlpha: number; + /** + * Which index in the children array the display component was before the previous zIndex sort. + * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider. + * + * @member {number} PIXI.DisplayObject#_lastSortedIndex + * @protected + */ + protected _lastSortedIndex: number; + /** + * The zIndex of the displayObject. + * A higher value will mean it will be rendered on top of other displayObjects within the same container. + * + * @member {number} PIXI.DisplayObject#_zIndex + * @protected + */ + protected _zIndex: number; + /** + * The area the filter is applied to. This is used as more of an optimization + * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. + * + * Also works as an interaction mask. + * + * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea + */ + filterArea: PIXI.Rectangle; + /** + * Sets the filters for the displayObject. + * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * To remove filters simply set this property to `'null'`. + * + * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters + */ + filters: PIXI.Filter[]; + /** + * The bounds object, this is used to calculate and store the bounds of the displayObject. + * + * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds + * @protected + */ + protected _bounds: PIXI.Bounds; + /** + * The original, cached mask of the object. + * + * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask + * @protected + */ + protected _mask: PIXI.Graphics | PIXI.Sprite; + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} PIXI.DisplayObject#_destroyed + * @protected + */ + protected _destroyed: boolean; + /** + * @protected + * @member {PIXI.DisplayObject} + */ + protected _tempDisplayObjectParent: PIXI.DisplayObject; + /** + * Recursively updates transform of all objects from the root to this one + * internal function for toLocal() + */ + _recursivePostUpdateTransform(): void; + /** + * Retrieves the bounds of the displayObject as a rectangle object. + * + * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Calculates the global position of the display object. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform. + * @return {PIXI.IPoint} A point object representing the position of this object. + */ + toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Calculates the local position of the display object relative to another point. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform + * @return {PIXI.IPoint} A point object representing the position of this object + */ + toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Set the parent Container of this DisplayObject. + * + * @param {PIXI.Container} container - The Container to add this DisplayObject to. + * @return {PIXI.Container} The Container that this DisplayObject was added to. + */ + setParent(container: PIXI.Container): PIXI.Container; + /** + * Convenience function to set the position, scale, skew and pivot at once. + * + * @param {number} [x=0] - The X position + * @param {number} [y=0] - The Y position + * @param {number} [scaleX=1] - The X scale value + * @param {number} [scaleY=1] - The Y scale value + * @param {number} [rotation=0] - The rotation + * @param {number} [skewX=0] - The X skew value + * @param {number} [skewY=0] - The Y skew value + * @param {number} [pivotX=0] - The X pivot value + * @param {number} [pivotY=0] - The Y pivot value + * @return {PIXI.DisplayObject} The DisplayObject instance + */ + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject; + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * An alias to position.x + * + * @member {number} + */ + x: number; + /** + * The position of the displayObject on the y axis relative to the local coordinates of the parent. + * An alias to position.y + * + * @member {number} + */ + y: number; + /** + * Current transform of the object based on world (parent) factors. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly worldTransform: PIXI.Matrix; + /** + * Current transform of the object based on local factors: position, scale, other stuff. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly localTransform: PIXI.Matrix; + /** + * The coordinate of the object relative to the local coordinates of the parent. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + position: PIXI.IPoint; + /** + * The scale factor of the object. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + scale: PIXI.IPoint; + /** + * The pivot point of the displayObject that it rotates around. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + pivot: PIXI.IPoint; + /** + * The skew factor for the object in radians. + * Assignment by value since pixi-v4. + * + * @member {PIXI.ObservablePoint} + */ + skew: PIXI.ObservablePoint; + /** + * The rotation of the object in radians. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + rotation: number; + /** + * The angle of the object in degrees. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + angle: number; + /** + * The zIndex of the displayObject. + * If a container has the sortableChildren property set to true, children will be automatically + * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, + * and thus rendered on top of other displayObjects within the same container. + * + * @member {number} + */ + zIndex: number; + /** + * Indicates if the object is globally visible. + * + * @member {boolean} + * @readonly + */ + readonly worldVisible: boolean; + /** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an + * object to the shape of the mask applied to it. In PixiJS a regular mask must be a + * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it + * utilities shape clipping. To remove a mask, set this property to `null`. + * + * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. + * @example + * const graphics = new PIXI.Graphics(); + * graphics.beginFill(0xFF3300); + * graphics.drawRect(50, 250, 100, 100); + * graphics.endFill(); + * + * const sprite = new PIXI.Sprite(texture); + * sprite.mask = graphics; + * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * + * @member {PIXI.Graphics|PIXI.Sprite} + */ + mask: PIXI.Graphics | PIXI.Sprite; + /** + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + interactive: boolean; + /** + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# + */ + hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle; + /** + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + buttonMode: boolean; + /** + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + cursor: string; + /** + * Set this to true if you want this display object to be cached as a bitmap. + * This basically takes a snap shot of the display object as it is at that moment. It can + * provide a performance benefit for complex static displayObjects. + * To remove simply set this property to `false` + * + * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + cacheAsBitmap: boolean; + /** + * The instance name of the object. + * + * @memberof PIXI.DisplayObject# + * @member {string} name + */ + name: string; + /** + * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot. + * + * @method getGlobalPosition + * @memberof PIXI.DisplayObject# + * @param {Point} point - The point to write the global value to. If null a new point will be returned + * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @return {Point} The updated point. + */ + getGlobalPosition(point: Point, skipUpdate: boolean): Point; + } + /** + * A tiling sprite is a fast way of rendering a tiling image + * + * @class + * @extends PIXI.Sprite + * @memberof PIXI + */ + class TilingSprite extends PIXI.Sprite { + static from(source: number | string | PIXI.Texture | HTMLCanvasElement | HTMLVideoElement, options?: any): PIXI.Sprite; + static fromFrame(): PIXI.Sprite; + static fromImage(): PIXI.Sprite; + constructor(texture: PIXI.Texture, width?: number, height?: number); + /** + * Renders the object using the Canvas renderer + * + * @protected + * @function _renderCanvas + * @memberof PIXI.TilingSprite# + * @param {PIXI.CanvasRenderer} renderer - a reference to the canvas renderer + */ + protected _renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * Tile transform + * + * @member {PIXI.Transform} PIXI.TilingSprite#tileTransform + */ + tileTransform: PIXI.Transform; + /** + * matrix that is applied to UV to get the coords in Texture normalized space to coords in BaseTexture space + * + * @member {PIXI.TextureMatrix} PIXI.TilingSprite#uvMatrix + */ + uvMatrix: PIXI.TextureMatrix; + /** + * Plugin that is responsible for rendering this element. + * Allows to customize the rendering process without overriding '_render' method. + * + * @member {string} PIXI.TilingSprite#pluginName + * @default 'tilingSprite' + */ + pluginName: string; + /** + * Whether or not anchor affects uvs + * + * @member {boolean} PIXI.TilingSprite#uvRespectAnchor + * @default false + */ + uvRespectAnchor: boolean; + /** + * Changes frame clamping in corresponding textureTransform, shortcut + * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas + * + * @default 0.5 + * @member {number} + */ + clampMargin: number; + /** + * The scaling of the image that is being tiled + * + * @member {PIXI.ObservablePoint} + */ + tileScale: PIXI.ObservablePoint; + /** + * The offset of the image that is being tiled + * + * @member {PIXI.ObservablePoint} + */ + tilePosition: PIXI.ObservablePoint; + /** + * Renders the object using the WebGL renderer + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected _render(renderer: PIXI.Renderer): void; + /** + * Updates the bounds of the tiling sprite. + * + * @protected + */ + protected _calculateBounds(): void; + /** + * Gets the local bounds of the sprite object. + * + * @param {PIXI.Rectangle} rect - The output rectangle. + * @return {PIXI.Rectangle} The bounds. + */ + getLocalBounds(rect: PIXI.Rectangle): PIXI.Rectangle; + /** + * Checks if a point is inside this tiling sprite. + * + * @param {PIXI.Point} point - the point to check + * @return {boolean} Whether or not the sprite contains the point. + */ + containsPoint(point: PIXI.Point): boolean; + /** + * Destroys this sprite and optionally its texture and children + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well + * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well + */ + destroy(options?: { + children?: boolean; + texture?: boolean; + baseTexture?: boolean; + }): void; + /** + * Helper function that creates a new tiling sprite based on the source you provide. + * The source can be - frame id, image url, video url, canvas element, video element, base texture + * + * @static + * @param {number|string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from + * @param {number} width - the width of the tiling sprite + * @param {number} height - the height of the tiling sprite + * @return {PIXI.TilingSprite} The newly created texture + */ + static from(source: number | string | PIXI.Texture | HTMLCanvasElement | HTMLVideoElement, width: number, height: number): PIXI.TilingSprite; + /** + * Helper function that creates a tiling sprite that will use a texture from the TextureCache based on the frameId + * The frame ids are created when a Texture packer file has been loaded + * + * @static + * @param {string} frameId - The frame Id of the texture in the cache + * @param {number} width - the width of the tiling sprite + * @param {number} height - the height of the tiling sprite + * @return {PIXI.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId + */ + static fromFrame(frameId: string, width: number, height: number): PIXI.TilingSprite; + /** + * Helper function that creates a sprite that will contain a texture based on an image url + * If the image is not in the texture cache it will be loaded + * + * @static + * @param {string} imageId - The image url of the texture + * @param {number} width - the width of the tiling sprite + * @param {number} height - the height of the tiling sprite + * @param {Object} [options] - See {@link PIXI.BaseTexture}'s constructor for options. + * @return {PIXI.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id + */ + static fromImage(imageId: string, width: number, height: number, options?: any): PIXI.TilingSprite; + /** + * The width of the sprite, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + width: number; + /** + * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + height: number; + /** + * Cached tinted texture. + * @memberof PIXI.Sprite# + * @member {HTMLCanvasElement} _tintedCanvas + * @protected + */ + protected _tintedCanvas: HTMLCanvasElement; + /** + * Cached tint value so we can tell when the tint is changed. + * @memberof PIXI.Sprite# + * @member {number} _cachedTint + * @protected + */ + protected _cachedTint: number; + /** + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. + * + * @member {number} PIXI.Sprite#blendMode + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES + */ + blendMode: number; + /** + * The shader that will be used to render the sprite. Set to null to remove a current shader. + * + * @member {PIXI.Filter|PIXI.Shader} PIXI.Sprite#shader + */ + shader: PIXI.Filter | PIXI.Shader; + /** + * used to fast check if a sprite is.. a sprite! + * @member {boolean} PIXI.Sprite#isSprite + */ + isSprite: boolean; + /** + * calculates worldTransform * vertices, store it in vertexData + */ + calculateVertices(): void; + /** + * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData + * This is used to ensure that the true width and height of a trimmed texture is respected + */ + calculateTrimmedVertices(): void; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * To set the global default, change {@link PIXI.settings.ROUND_PIXELS} + * + * @member {boolean} + * @default false + */ + roundPixels: boolean; + /** + * The anchor sets the origin point of the text. The default value is taken from the {@link PIXI.Texture|Texture} + * and passed to the constructor. + * + * The default is `(0,0)`, this means the text's origin is the top left. + * + * Setting the anchor to `(0.5,0.5)` means the text's origin is centered. + * + * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner. + * + * If you pass only single parameter, it will set both x and y to the same value as shown in the example below. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5). + * + * @member {PIXI.ObservablePoint} + */ + anchor: PIXI.ObservablePoint; + /** + * The tint applied to the sprite. This is a hex value. + * A value of 0xFFFFFF will remove any tint effect. + * + * @member {number} + * @default 0xFFFFFF + */ + tint: number; + /** + * The texture that the sprite is using + * + * @member {PIXI.Texture} + */ + texture: PIXI.Texture; + /** + * @method PIXI.Container#renderWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#render + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderWebGL(renderer: PIXI.Renderer): void; + /** + * @method PIXI.Container#renderAdvancedWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#renderAdvanced + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderAdvancedWebGL(renderer: PIXI.Renderer): void; + /** + * Renders the object using the Canvas renderer + * @method renderCanvas + * @memberof PIXI.Container# + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} PIXI.Container#children + * @readonly + */ + readonly children: PIXI.DisplayObject[]; + /** + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @see PIXI.settings.SORTABLE_CHILDREN + * + * @member {boolean} PIXI.Container#sortableChildren + */ + sortableChildren: boolean; + /** + * Should children be sorted by zIndex at the next updateTransform call. + * Will get automatically set to true if a new child is added, or if a child's zIndex changes. + * + * @member {boolean} PIXI.Container#sortDirty + */ + sortDirty: boolean; + /** + * Overridable method that can be used by Container subclasses whenever the children array is modified + * + * @protected + */ + protected onChildrenChange(): void; + /** + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. + */ + addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject; + /** + * Swaps the position of 2 Display Objects within this container. + * + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap + */ + swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void; + /** + * Returns the index position of a child DisplayObject instance + * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify + */ + getChildIndex(child: PIXI.DisplayObject): number; + /** + * Changes the position of an existing child in the display object container + * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object + */ + setChildIndex(child: PIXI.DisplayObject, index: number): void; + /** + * Returns the child at the specified index + * + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. + */ + getChildAt(index: number): PIXI.DisplayObject; + /** + * Removes one or more children from the container. + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. + */ + removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Removes a child from the specified index position. + * + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. + */ + removeChildAt(index: number): PIXI.DisplayObject; + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; + /** + * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex. + */ + sortChildren(): void; + /** + * Updates the transform on all children of this container for rendering + */ + updateTransform(): void; + /** + * Recalculates the bounds of the container. + * + */ + calculateBounds(): void; + /** + * Renders the object using the WebGL renderer + * + * @param {PIXI.Renderer} renderer - The renderer + */ + render(renderer: PIXI.Renderer): void; + /** + * Render the object using the WebGL renderer and advanced features. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected renderAdvanced(renderer: PIXI.Renderer): void; + /** + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows PixiJS to bypass a recursive `hitTest` function + * + * @member {boolean} + * @memberof PIXI.Container# + */ + interactiveChildren: boolean; + /** + * Returns the display object in the container. + * + * @method getChildByName + * @memberof PIXI.Container# + * @param {string} name - Instance name. + * @return {PIXI.DisplayObject} The child with the specified name. + */ + getChildByName(name: string): PIXI.DisplayObject; + /** + * Flag for if the object is accessible. If true AccessibilityManager will overlay a + * shadow div with attributes set + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + accessible: boolean; + /** + * Sets the title attribute of the shadow div + * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]' + * + * @member {?string} + * @memberof PIXI.DisplayObject# + */ + accessibleTitle: string; + /** + * Sets the aria-label attribute of the shadow div + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + accessibleHint: string; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleActive: boolean; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleDiv: boolean; + /** + * World transform and local transform of this object. + * This will become read-only later, please do not assign anything there unless you know what are you doing. + * + * @member {PIXI.Transform} PIXI.DisplayObject#transform + */ + transform: PIXI.Transform; + /** + * The opacity of the object. + * + * @member {number} PIXI.DisplayObject#alpha + */ + alpha: number; + /** + * The visibility of the object. If false the object will not be drawn, and + * the updateTransform function will not be called. + * + * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually. + * + * @member {boolean} PIXI.DisplayObject#visible + */ + visible: boolean; + /** + * Can this object be rendered, if false the object will not be drawn but the updateTransform + * methods will still be called. + * + * Only affects recursive calls from parent. You can ask for bounds manually. + * + * @member {boolean} PIXI.DisplayObject#renderable + */ + renderable: boolean; + /** + * The display object container that contains this display object. + * + * @member {PIXI.Container} PIXI.DisplayObject#parent + * @readonly + */ + readonly parent: PIXI.Container; + /** + * The multiplied alpha of the displayObject. + * + * @member {number} PIXI.DisplayObject#worldAlpha + * @readonly + */ + readonly worldAlpha: number; + /** + * Which index in the children array the display component was before the previous zIndex sort. + * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider. + * + * @member {number} PIXI.DisplayObject#_lastSortedIndex + * @protected + */ + protected _lastSortedIndex: number; + /** + * The zIndex of the displayObject. + * A higher value will mean it will be rendered on top of other displayObjects within the same container. + * + * @member {number} PIXI.DisplayObject#_zIndex + * @protected + */ + protected _zIndex: number; + /** + * The area the filter is applied to. This is used as more of an optimization + * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. + * + * Also works as an interaction mask. + * + * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea + */ + filterArea: PIXI.Rectangle; + /** + * Sets the filters for the displayObject. + * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * To remove filters simply set this property to `'null'`. + * + * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters + */ + filters: PIXI.Filter[]; + /** + * The bounds object, this is used to calculate and store the bounds of the displayObject. + * + * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds + * @protected + */ + protected _bounds: PIXI.Bounds; + /** + * The original, cached mask of the object. + * + * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask + * @protected + */ + protected _mask: PIXI.Graphics | PIXI.Sprite; + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} PIXI.DisplayObject#_destroyed + * @protected + */ + protected _destroyed: boolean; + /** + * @protected + * @member {PIXI.DisplayObject} + */ + protected _tempDisplayObjectParent: PIXI.DisplayObject; + /** + * Recursively updates transform of all objects from the root to this one + * internal function for toLocal() + */ + _recursivePostUpdateTransform(): void; + /** + * Retrieves the bounds of the displayObject as a rectangle object. + * + * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Calculates the global position of the display object. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform. + * @return {PIXI.IPoint} A point object representing the position of this object. + */ + toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Calculates the local position of the display object relative to another point. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform + * @return {PIXI.IPoint} A point object representing the position of this object + */ + toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Set the parent Container of this DisplayObject. + * + * @param {PIXI.Container} container - The Container to add this DisplayObject to. + * @return {PIXI.Container} The Container that this DisplayObject was added to. + */ + setParent(container: PIXI.Container): PIXI.Container; + /** + * Convenience function to set the position, scale, skew and pivot at once. + * + * @param {number} [x=0] - The X position + * @param {number} [y=0] - The Y position + * @param {number} [scaleX=1] - The X scale value + * @param {number} [scaleY=1] - The Y scale value + * @param {number} [rotation=0] - The rotation + * @param {number} [skewX=0] - The X skew value + * @param {number} [skewY=0] - The Y skew value + * @param {number} [pivotX=0] - The X pivot value + * @param {number} [pivotY=0] - The Y pivot value + * @return {PIXI.DisplayObject} The DisplayObject instance + */ + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject; + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * An alias to position.x + * + * @member {number} + */ + x: number; + /** + * The position of the displayObject on the y axis relative to the local coordinates of the parent. + * An alias to position.y + * + * @member {number} + */ + y: number; + /** + * Current transform of the object based on world (parent) factors. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly worldTransform: PIXI.Matrix; + /** + * Current transform of the object based on local factors: position, scale, other stuff. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly localTransform: PIXI.Matrix; + /** + * The coordinate of the object relative to the local coordinates of the parent. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + position: PIXI.IPoint; + /** + * The scale factor of the object. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + scale: PIXI.IPoint; + /** + * The pivot point of the displayObject that it rotates around. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + pivot: PIXI.IPoint; + /** + * The skew factor for the object in radians. + * Assignment by value since pixi-v4. + * + * @member {PIXI.ObservablePoint} + */ + skew: PIXI.ObservablePoint; + /** + * The rotation of the object in radians. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + rotation: number; + /** + * The angle of the object in degrees. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + angle: number; + /** + * The zIndex of the displayObject. + * If a container has the sortableChildren property set to true, children will be automatically + * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, + * and thus rendered on top of other displayObjects within the same container. + * + * @member {number} + */ + zIndex: number; + /** + * Indicates if the object is globally visible. + * + * @member {boolean} + * @readonly + */ + readonly worldVisible: boolean; + /** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an + * object to the shape of the mask applied to it. In PixiJS a regular mask must be a + * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it + * utilities shape clipping. To remove a mask, set this property to `null`. + * + * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. + * @example + * const graphics = new PIXI.Graphics(); + * graphics.beginFill(0xFF3300); + * graphics.drawRect(50, 250, 100, 100); + * graphics.endFill(); + * + * const sprite = new PIXI.Sprite(texture); + * sprite.mask = graphics; + * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * + * @member {PIXI.Graphics|PIXI.Sprite} + */ + mask: PIXI.Graphics | PIXI.Sprite; + /** + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + interactive: boolean; + /** + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# + */ + hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle; + /** + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + buttonMode: boolean; + /** + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + cursor: string; + /** + * Set this to true if you want this display object to be cached as a bitmap. + * This basically takes a snap shot of the display object as it is at that moment. It can + * provide a performance benefit for complex static displayObjects. + * To remove simply set this property to `false` + * + * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + cacheAsBitmap: boolean; + /** + * The instance name of the object. + * + * @memberof PIXI.DisplayObject# + * @member {string} name + */ + name: string; + /** + * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot. + * + * @method getGlobalPosition + * @memberof PIXI.DisplayObject# + * @param {Point} point - The point to write the global value to. If null a new point will be returned + * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @return {Point} The updated point. + */ + getGlobalPosition(point: Point, skipUpdate: boolean): Point; + } + /** + * WebGL renderer plugin for tiling sprites + * + * @class + * @memberof PIXI + * @extends PIXI.ObjectRenderer + */ + class TilingSpriteRenderer extends PIXI.ObjectRenderer { + constructor(renderer: Renderer); + /** + * + * @param {PIXI.TilingSprite} ts tilingSprite to be rendered + */ + render(ts: PIXI.TilingSprite): void; + /** + * Starts the renderer and sets the shader + * + */ + start(): void; + /** + * Stops the renderer + * + */ + stop(): void; + /** + * Stub method for rendering content and emptying the current batch. + * + */ + flush(): void; + /** + * The renderer this manager works for. + * + * @member {PIXI.Renderer} PIXI.System#renderer + */ + renderer: PIXI.Renderer; + /** + * Generic method called when there is a WebGL context change. + * + * @param {WebGLRenderingContext} gl new webgl context + */ + contextChange(gl: WebGLRenderingContext): void; + /** + * Generic destroy methods to be overridden by the subclass + */ + destroy(): void; + } + /** + * Utility class for maintaining reference to a collection + * of Textures on a single Spritesheet. + * + * To access a sprite sheet from your code pass its JSON data file to Pixi's loader: + * + * ```js + * PIXI.Loader.shared.add("images/spritesheet.json").load(setup); + * + * function setup() { + * let sheet = PIXI.Loader.shared.resources["images/spritesheet.json"].spritesheet; + * ... + * } + * ``` + * With the `sheet.textures` you can create Sprite objects,`sheet.animations` can be used to create an AnimatedSprite. + * + * Sprite sheets can be packed using tools like {@link https://codeandweb.com/texturepacker|TexturePacker}, + * {@link https://renderhjs.net/shoebox/|Shoebox} or {@link https://github.com/krzysztof-o/spritesheet.js|Spritesheet.js}. + * Default anchor points (see {@link PIXI.Texture#defaultAnchor}) and grouping of animation sprites are currently only + * supported by TexturePacker. + * + * @class + * @memberof PIXI + */ + class Spritesheet { + constructor(baseTexture: PIXI.BaseTexture, data: any, resolutionFilename?: string); + /** + * The maximum number of Textures to build per process. + * + * @type {number} + * @default 1000 + */ + static BATCH_SIZE: number; + /** + * Reference to ths source texture + * @type {PIXI.BaseTexture} + */ + baseTexture: PIXI.BaseTexture; + /** + * A map containing all textures of the sprite sheet. + * Can be used to create a {@link PIXI.Sprite|Sprite}: + * ```js + * new PIXI.Sprite(sheet.textures["image.png"]); + * ``` + * @member {Object} PIXI.Spritesheet#textures + */ + textures: any; + /** + * A map containing the textures for each animation. + * Can be used to create an {@link PIXI.AnimatedSprite|AnimatedSprite}: + * ```js + * new PIXI.AnimatedSprite(sheet.animations["anim_name"]) + * ``` + * @member {Object} PIXI.Spritesheet#animations + */ + animations: any; + /** + * Reference to the original JSON data. + * @type {Object} + */ + data: any; + /** + * The resolution of the spritesheet. + * @type {number} + */ + resolution: number; + /** + * Parser spritesheet from loaded data. This is done asynchronously + * to prevent creating too many Texture within a single process. + * + * @param {Function} callback - Callback when complete returns + * a map of the Textures for this spritesheet. + */ + parse(callback: (...params: any[]) => any): void; + /** + * Destroy Spritesheet and don't use after this. + * + * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well + */ + destroy(destroyBase?: boolean): void; + } + interface SpritesheetLoader extends PIXI.ILoaderPlugin { + } + /** + * {@link PIXI.Loader Loader} middleware for loading texture atlases that have been created with + * TexturePacker or similar JSON-based spritesheet. + * + * This middleware automatically generates Texture resources. + * + * @class + * @memberof PIXI + * @implements PIXI.ILoaderPlugin + */ + class SpritesheetLoader implements PIXI.ILoaderPlugin { + /** + * Called after a resource is loaded. + * @see PIXI.Loader.loaderMiddleware + * @param {PIXI.LoaderResource} resource + * @param {function} next + */ + static use(resource: PIXI.LoaderResource, next: (...params: any[]) => any): void; + /** + * Get the spritesheets root path + * @param {PIXI.LoaderResource} resource - Resource to check path + * @param {string} baseUrl - Base root url + */ + static getResourcePath(resource: PIXI.LoaderResource, baseUrl: string): void; + } + /** + * Constants that define the type of gradient on text. + * + * @static + * @constant + * @name TEXT_GRADIENT + * @memberof PIXI + * @type {object} + * @property {number} LINEAR_VERTICAL Vertical gradient + * @property {number} LINEAR_HORIZONTAL Linear gradient + */ + var TEXT_GRADIENT: { + LINEAR_VERTICAL: number; + LINEAR_HORIZONTAL: number; + }; + /** + * A Text Object will create a line or multiple lines of text. + * + * The text is created using the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API). + * + * The primary advantage of this class over BitmapText is that you have great control over the style of the next, + * which you can change at runtime. + * + * The primary disadvantages is that each piece of text has it's own texture, which can use more memory. + * When text changes, this texture has to be re-generated and re-uploaded to the GPU, taking up time. + * + * To split a line you can use '\n' in your text string, or, on the `style` object, + * change its `wordWrap` property to true and and give the `wordWrapWidth` property a value. + * + * A Text can be created directly from a string and a style object, + * which can be generated [here](https://pixijs.io/pixi-text-style). + * + * ```js + * let text = new PIXI.Text('This is a PixiJS text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'}); + * ``` + * + * @class + * @extends PIXI.Sprite + * @memberof PIXI + */ + class Text extends PIXI.Sprite { + constructor(text: string, style?: any | PIXI.TextStyle, canvas?: HTMLCanvasElement); + /** + * The canvas element that everything is drawn to + * + * @member {HTMLCanvasElement} PIXI.Text#canvas + */ + canvas: HTMLCanvasElement; + /** + * The canvas 2d context that everything is drawn with + * @member {CanvasRenderingContext2D} PIXI.Text#context + */ + context: CanvasRenderingContext2D; + /** + * The resolution / device pixel ratio of the canvas. + * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually. + * @member {number} PIXI.Text#_resolution + * @default 1 + */ + _resolution: number; + /** + * Renders the object using the WebGL renderer + * + * @param {PIXI.Renderer} renderer - The renderer + */ + render(renderer: PIXI.Renderer): void; + /** + * Gets the local bounds of the text object. + * + * @param {Rectangle} rect - The output rectangle. + * @return {Rectangle} The bounds. + */ + getLocalBounds(rect: Rectangle): Rectangle; + /** + * calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. + * @protected + */ + protected _calculateBounds(): void; + /** + * Destroys this text object. + * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as + * the majority of the time the texture will not be shared with any other Sprites. + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their + * destroy method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well + * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well + */ + destroy(options?: { + children?: boolean; + texture?: boolean; + baseTexture?: boolean; + }): void; + /** + * The width of the Text, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + width: number; + /** + * The height of the Text, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + height: number; + /** + * Set the style of the text. Set up an event listener to listen for changes on the style + * object and mark the text as dirty. + * + * @member {object|PIXI.TextStyle} + */ + style: any | PIXI.TextStyle; + /** + * Set the copy for the text object. To split a line you can use '\n'. + * + * @member {string} + */ + text: string; + /** + * The resolution / device pixel ratio of the canvas. + * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually. + * @member {number} + * @default 1 + */ + resolution: number; + /** + * Cached tinted texture. + * @memberof PIXI.Sprite# + * @member {HTMLCanvasElement} _tintedCanvas + * @protected + */ + protected _tintedCanvas: HTMLCanvasElement; + /** + * Cached tint value so we can tell when the tint is changed. + * @memberof PIXI.Sprite# + * @member {number} _cachedTint + * @protected + */ + protected _cachedTint: number; + /** + * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. + * + * @member {number} PIXI.Sprite#blendMode + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES + */ + blendMode: number; + /** + * The shader that will be used to render the sprite. Set to null to remove a current shader. + * + * @member {PIXI.Filter|PIXI.Shader} PIXI.Sprite#shader + */ + shader: PIXI.Filter | PIXI.Shader; + /** + * Plugin that is responsible for rendering this element. + * Allows to customize the rendering process without overriding '_render' & '_renderCanvas' methods. + * + * @member {string} PIXI.Sprite#pluginName + * @default 'sprite' + */ + pluginName: string; + /** + * used to fast check if a sprite is.. a sprite! + * @member {boolean} PIXI.Sprite#isSprite + */ + isSprite: boolean; + /** + * calculates worldTransform * vertices, store it in vertexData + */ + calculateVertices(): void; + /** + * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData + * This is used to ensure that the true width and height of a trimmed texture is respected + */ + calculateTrimmedVertices(): void; + /** + * + * Renders the object using the WebGL renderer + * + * @protected + * @param {PIXI.Renderer} renderer - The webgl renderer to use. + */ + protected _render(renderer: PIXI.Renderer): void; + /** + * Tests if a point is inside this sprite + * + * @param {PIXI.Point} point - the point to test + * @return {boolean} the result of the test + */ + containsPoint(point: PIXI.Point): boolean; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * To set the global default, change {@link PIXI.settings.ROUND_PIXELS} + * + * @member {boolean} + * @default false + */ + roundPixels: boolean; + /** + * The anchor sets the origin point of the text. The default value is taken from the {@link PIXI.Texture|Texture} + * and passed to the constructor. + * + * The default is `(0,0)`, this means the text's origin is the top left. + * + * Setting the anchor to `(0.5,0.5)` means the text's origin is centered. + * + * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner. + * + * If you pass only single parameter, it will set both x and y to the same value as shown in the example below. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5). + * + * @member {PIXI.ObservablePoint} + */ + anchor: PIXI.ObservablePoint; + /** + * The tint applied to the sprite. This is a hex value. + * A value of 0xFFFFFF will remove any tint effect. + * + * @member {number} + * @default 0xFFFFFF + */ + tint: number; + /** + * The texture that the sprite is using + * + * @member {PIXI.Texture} + */ + texture: PIXI.Texture; + /** + * @method PIXI.Container#renderWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#render + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderWebGL(renderer: PIXI.Renderer): void; + /** + * @method PIXI.Container#renderAdvancedWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#renderAdvanced + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderAdvancedWebGL(renderer: PIXI.Renderer): void; + /** + * Renders the object using the Canvas renderer + * @method renderCanvas + * @memberof PIXI.Container# + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} PIXI.Container#children + * @readonly + */ + readonly children: PIXI.DisplayObject[]; + /** + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @see PIXI.settings.SORTABLE_CHILDREN + * + * @member {boolean} PIXI.Container#sortableChildren + */ + sortableChildren: boolean; + /** + * Should children be sorted by zIndex at the next updateTransform call. + * Will get automatically set to true if a new child is added, or if a child's zIndex changes. + * + * @member {boolean} PIXI.Container#sortDirty + */ + sortDirty: boolean; + /** + * Overridable method that can be used by Container subclasses whenever the children array is modified + * + * @protected + */ + protected onChildrenChange(): void; + /** + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. + */ + addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject; + /** + * Swaps the position of 2 Display Objects within this container. + * + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap + */ + swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void; + /** + * Returns the index position of a child DisplayObject instance + * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify + */ + getChildIndex(child: PIXI.DisplayObject): number; + /** + * Changes the position of an existing child in the display object container + * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object + */ + setChildIndex(child: PIXI.DisplayObject, index: number): void; + /** + * Returns the child at the specified index + * + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. + */ + getChildAt(index: number): PIXI.DisplayObject; + /** + * Removes one or more children from the container. + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. + */ + removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Removes a child from the specified index position. + * + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. + */ + removeChildAt(index: number): PIXI.DisplayObject; + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; + /** + * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex. + */ + sortChildren(): void; + /** + * Updates the transform on all children of this container for rendering + */ + updateTransform(): void; + /** + * Recalculates the bounds of the container. + * + */ + calculateBounds(): void; + /** + * Render the object using the WebGL renderer and advanced features. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected renderAdvanced(renderer: PIXI.Renderer): void; + /** + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows PixiJS to bypass a recursive `hitTest` function + * + * @member {boolean} + * @memberof PIXI.Container# + */ + interactiveChildren: boolean; + /** + * Returns the display object in the container. + * + * @method getChildByName + * @memberof PIXI.Container# + * @param {string} name - Instance name. + * @return {PIXI.DisplayObject} The child with the specified name. + */ + getChildByName(name: string): PIXI.DisplayObject; + /** + * Flag for if the object is accessible. If true AccessibilityManager will overlay a + * shadow div with attributes set + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + accessible: boolean; + /** + * Sets the title attribute of the shadow div + * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]' + * + * @member {?string} + * @memberof PIXI.DisplayObject# + */ + accessibleTitle: string; + /** + * Sets the aria-label attribute of the shadow div + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + accessibleHint: string; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleActive: boolean; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleDiv: boolean; + /** + * World transform and local transform of this object. + * This will become read-only later, please do not assign anything there unless you know what are you doing. + * + * @member {PIXI.Transform} PIXI.DisplayObject#transform + */ + transform: PIXI.Transform; + /** + * The opacity of the object. + * + * @member {number} PIXI.DisplayObject#alpha + */ + alpha: number; + /** + * The visibility of the object. If false the object will not be drawn, and + * the updateTransform function will not be called. + * + * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually. + * + * @member {boolean} PIXI.DisplayObject#visible + */ + visible: boolean; + /** + * Can this object be rendered, if false the object will not be drawn but the updateTransform + * methods will still be called. + * + * Only affects recursive calls from parent. You can ask for bounds manually. + * + * @member {boolean} PIXI.DisplayObject#renderable + */ + renderable: boolean; + /** + * The display object container that contains this display object. + * + * @member {PIXI.Container} PIXI.DisplayObject#parent + * @readonly + */ + readonly parent: PIXI.Container; + /** + * The multiplied alpha of the displayObject. + * + * @member {number} PIXI.DisplayObject#worldAlpha + * @readonly + */ + readonly worldAlpha: number; + /** + * Which index in the children array the display component was before the previous zIndex sort. + * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider. + * + * @member {number} PIXI.DisplayObject#_lastSortedIndex + * @protected + */ + protected _lastSortedIndex: number; + /** + * The zIndex of the displayObject. + * A higher value will mean it will be rendered on top of other displayObjects within the same container. + * + * @member {number} PIXI.DisplayObject#_zIndex + * @protected + */ + protected _zIndex: number; + /** + * The area the filter is applied to. This is used as more of an optimization + * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. + * + * Also works as an interaction mask. + * + * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea + */ + filterArea: PIXI.Rectangle; + /** + * Sets the filters for the displayObject. + * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * To remove filters simply set this property to `'null'`. + * + * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters + */ + filters: PIXI.Filter[]; + /** + * The bounds object, this is used to calculate and store the bounds of the displayObject. + * + * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds + * @protected + */ + protected _bounds: PIXI.Bounds; + /** + * The original, cached mask of the object. + * + * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask + * @protected + */ + protected _mask: PIXI.Graphics | PIXI.Sprite; + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} PIXI.DisplayObject#_destroyed + * @protected + */ + protected _destroyed: boolean; + /** + * @protected + * @member {PIXI.DisplayObject} + */ + protected _tempDisplayObjectParent: PIXI.DisplayObject; + /** + * Recursively updates transform of all objects from the root to this one + * internal function for toLocal() + */ + _recursivePostUpdateTransform(): void; + /** + * Retrieves the bounds of the displayObject as a rectangle object. + * + * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Calculates the global position of the display object. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform. + * @return {PIXI.IPoint} A point object representing the position of this object. + */ + toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Calculates the local position of the display object relative to another point. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform + * @return {PIXI.IPoint} A point object representing the position of this object + */ + toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Set the parent Container of this DisplayObject. + * + * @param {PIXI.Container} container - The Container to add this DisplayObject to. + * @return {PIXI.Container} The Container that this DisplayObject was added to. + */ + setParent(container: PIXI.Container): PIXI.Container; + /** + * Convenience function to set the position, scale, skew and pivot at once. + * + * @param {number} [x=0] - The X position + * @param {number} [y=0] - The Y position + * @param {number} [scaleX=1] - The X scale value + * @param {number} [scaleY=1] - The Y scale value + * @param {number} [rotation=0] - The rotation + * @param {number} [skewX=0] - The X skew value + * @param {number} [skewY=0] - The Y skew value + * @param {number} [pivotX=0] - The X pivot value + * @param {number} [pivotY=0] - The Y pivot value + * @return {PIXI.DisplayObject} The DisplayObject instance + */ + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject; + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * An alias to position.x + * + * @member {number} + */ + x: number; + /** + * The position of the displayObject on the y axis relative to the local coordinates of the parent. + * An alias to position.y + * + * @member {number} + */ + y: number; + /** + * Current transform of the object based on world (parent) factors. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly worldTransform: PIXI.Matrix; + /** + * Current transform of the object based on local factors: position, scale, other stuff. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly localTransform: PIXI.Matrix; + /** + * The coordinate of the object relative to the local coordinates of the parent. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + position: PIXI.IPoint; + /** + * The scale factor of the object. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + scale: PIXI.IPoint; + /** + * The pivot point of the displayObject that it rotates around. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + pivot: PIXI.IPoint; + /** + * The skew factor for the object in radians. + * Assignment by value since pixi-v4. + * + * @member {PIXI.ObservablePoint} + */ + skew: PIXI.ObservablePoint; + /** + * The rotation of the object in radians. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + rotation: number; + /** + * The angle of the object in degrees. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + angle: number; + /** + * The zIndex of the displayObject. + * If a container has the sortableChildren property set to true, children will be automatically + * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, + * and thus rendered on top of other displayObjects within the same container. + * + * @member {number} + */ + zIndex: number; + /** + * Indicates if the object is globally visible. + * + * @member {boolean} + * @readonly + */ + readonly worldVisible: boolean; + /** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an + * object to the shape of the mask applied to it. In PixiJS a regular mask must be a + * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it + * utilities shape clipping. To remove a mask, set this property to `null`. + * + * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. + * @example + * const graphics = new PIXI.Graphics(); + * graphics.beginFill(0xFF3300); + * graphics.drawRect(50, 250, 100, 100); + * graphics.endFill(); + * + * const sprite = new PIXI.Sprite(texture); + * sprite.mask = graphics; + * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * + * @member {PIXI.Graphics|PIXI.Sprite} + */ + mask: PIXI.Graphics | PIXI.Sprite; + /** + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + interactive: boolean; + /** + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# + */ + hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle; + /** + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + buttonMode: boolean; + /** + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + cursor: string; + /** + * Set this to true if you want this display object to be cached as a bitmap. + * This basically takes a snap shot of the display object as it is at that moment. It can + * provide a performance benefit for complex static displayObjects. + * To remove simply set this property to `false` + * + * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + cacheAsBitmap: boolean; + /** + * The instance name of the object. + * + * @memberof PIXI.DisplayObject# + * @member {string} name + */ + name: string; + /** + * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot. + * + * @method getGlobalPosition + * @memberof PIXI.DisplayObject# + * @param {Point} point - The point to write the global value to. If null a new point will be returned + * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @return {Point} The updated point. + */ + getGlobalPosition(point: Point, skipUpdate: boolean): Point; + } + /** + * A number, or a string containing a number. + * + * @memberof PIXI + * @typedef IFontMetrics + * @property {number} ascent - Font ascent + * @property {number} descent - Font descent + * @property {number} fontSize - Font size + */ + type IFontMetrics = { + ascent: number; + descent: number; + fontSize: number; + }; + /** + * The TextMetrics object represents the measurement of a block of text with a specified style. + * + * ```js + * let style = new PIXI.TextStyle({fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'}) + * let textMetrics = PIXI.TextMetrics.measureText('Your text', style) + * ``` + * + * @class + * @memberof PIXI + */ + class TextMetrics { + constructor(text: string, style: PIXI.TextStyle, width: number, height: number, lines: string[], lineWidths: number[], lineHeight: number, maxLineWidth: number, fontProperties: any); + /** + * Measures the supplied string of text and returns a Rectangle. + * + * @param {string} text - the text to measure. + * @param {PIXI.TextStyle} style - the text style to use for measuring + * @param {boolean} [wordWrap] - optional override for if word-wrap should be applied to the text. + * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring. + * @return {PIXI.TextMetrics} measured width and height of the text. + */ + static measureText(text: string, style: PIXI.TextStyle, wordWrap?: boolean, canvas?: HTMLCanvasElement): PIXI.TextMetrics; + /** + * Calculates the ascent, descent and fontSize of a given font-style + * + * @static + * @param {string} font - String representing the style of the font + * @return {PIXI.IFontMetrics} Font properties object + */ + static measureFont(font: string): PIXI.IFontMetrics; + /** + * Clear font metrics in metrics cache. + * + * @static + * @param {string} [font] - font name. If font name not set then clear cache for all fonts. + */ + static clearMetrics(font?: string): void; + /** + * String used for calculate font metrics. + * These characters are all tall to help calculate the height required for text. + * + * @static + * @memberof PIXI.TextMetrics + * @name METRICS_STRING + * @type {string} + * @default |ÉqÅ + */ + static METRICS_STRING: string; + /** + * Baseline symbol for calculate font metrics. + * + * @static + * @memberof PIXI.TextMetrics + * @name BASELINE_SYMBOL + * @type {string} + * @default M + */ + static BASELINE_SYMBOL: string; + /** + * Baseline multiplier for calculate font metrics. + * + * @static + * @memberof PIXI.TextMetrics + * @name BASELINE_MULTIPLIER + * @type {number} + * @default 1.4 + */ + static BASELINE_MULTIPLIER: number; + } + /** + * A TextStyle Object contains information to decorate a Text objects. + * + * An instance can be shared between multiple Text objects; then changing the style will update all text objects using it. + * + * A tool can be used to generate a text style [here](https://pixijs.io/pixi-text-style). + * + * @class + * @memberof PIXI + */ + class TextStyle { + constructor(style?: { + align?: string; + breakWords?: boolean; + dropShadow?: boolean; + dropShadowAlpha?: number; + dropShadowAngle?: number; + dropShadowBlur?: number; + dropShadowColor?: string | number; + dropShadowDistance?: number; + fill?: string | string[] | number | number[] | CanvasGradient | CanvasPattern; + fillGradientType?: number; + fillGradientStops?: number[]; + fontFamily?: string | string[]; + fontSize?: number | string; + fontStyle?: string; + fontVariant?: string; + fontWeight?: string; + leading?: number; + letterSpacing?: number; + lineHeight?: number; + lineJoin?: string; + miterLimit?: number; + padding?: number; + stroke?: string | number; + strokeThickness?: number; + trim?: boolean; + textBaseline?: string; + whiteSpace?: boolean; + wordWrap?: boolean; + wordWrapWidth?: number; + }); + /** + * Creates a new TextStyle object with the same values as this one. + * Note that the only the properties of the object are cloned. + * + * @return {PIXI.TextStyle} New cloned TextStyle object + */ + clone(): PIXI.TextStyle; + /** + * Resets all properties to the defaults specified in TextStyle.prototype._default + */ + reset(): void; + /** + * Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text + * + * @member {string} + */ + align: string; + /** + * Indicates if lines can be wrapped within words, it needs wordWrap to be set to true + * + * @member {boolean} + */ + breakWords: boolean; + /** + * Set a drop shadow for the text + * + * @member {boolean} + */ + dropShadow: boolean; + /** + * Set alpha for the drop shadow + * + * @member {number} + */ + dropShadowAlpha: number; + /** + * Set a angle of the drop shadow + * + * @member {number} + */ + dropShadowAngle: number; + /** + * Set a shadow blur radius + * + * @member {number} + */ + dropShadowBlur: number; + /** + * A fill style to be used on the dropshadow e.g 'red', '#00FF00' + * + * @member {string|number} + */ + dropShadowColor: string | number; + /** + * Set a distance of the drop shadow + * + * @member {number} + */ + dropShadowDistance: number; + /** + * A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'. + * Can be an array to create a gradient eg ['#000000','#FFFFFF'] + * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN} + * + * @member {string|string[]|number|number[]|CanvasGradient|CanvasPattern} + */ + fill: string | string[] | number | number[] | CanvasGradient | CanvasPattern; + /** + * If fill is an array of colours to create a gradient, this can change the type/direction of the gradient. + * See {@link PIXI.TEXT_GRADIENT} + * + * @member {number} + */ + fillGradientType: number; + /** + * If fill is an array of colours to create a gradient, this array can set the stop points + * (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them. + * + * @member {number[]} + */ + fillGradientStops: number[]; + /** + * The font family + * + * @member {string|string[]} + */ + fontFamily: string | string[]; + /** + * The font size + * (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em') + * + * @member {number|string} + */ + fontSize: number | string; + /** + * The font style + * ('normal', 'italic' or 'oblique') + * + * @member {string} + */ + fontStyle: string; + /** + * The font variant + * ('normal' or 'small-caps') + * + * @member {string} + */ + fontVariant: string; + /** + * The font weight + * ('normal', 'bold', 'bolder', 'lighter' and '100', '200', '300', '400', '500', '600', '700', 800' or '900') + * + * @member {string} + */ + fontWeight: string; + /** + * The amount of spacing between letters, default is 0 + * + * @member {number} + */ + letterSpacing: number; + /** + * The line height, a number that represents the vertical space that a letter uses + * + * @member {number} + */ + lineHeight: number; + /** + * The space between lines + * + * @member {number} + */ + leading: number; + /** + * The lineJoin property sets the type of corner created, it can resolve spiked text issues. + * Default is 'miter' (creates a sharp corner). + * + * @member {string} + */ + lineJoin: string; + /** + * The miter limit to use when using the 'miter' lineJoin mode + * This can reduce or increase the spikiness of rendered text. + * + * @member {number} + */ + miterLimit: number; + /** + * Occasionally some fonts are cropped. Adding some padding will prevent this from happening + * by adding padding to all sides of the text. + * + * @member {number} + */ + padding: number; + /** + * A canvas fillstyle that will be used on the text stroke + * e.g 'blue', '#FCFF00' + * + * @member {string|number} + */ + stroke: string | number; + /** + * A number that represents the thickness of the stroke. + * Default is 0 (no stroke) + * + * @member {number} + */ + strokeThickness: number; + /** + * The baseline of the text that is rendered. + * + * @member {string} + */ + textBaseline: string; + /** + * Trim transparent borders + * + * @member {boolean} + */ + trim: boolean; + /** + * How newlines and spaces should be handled. + * Default is 'pre' (preserve, preserve). + * + * value | New lines | Spaces + * --- | --- | --- + * 'normal' | Collapse | Collapse + * 'pre' | Preserve | Preserve + * 'pre-line' | Preserve | Collapse + * + * @member {string} + */ + whiteSpace: string; + /** + * Indicates if word wrap should be used + * + * @member {boolean} + */ + wordWrap: boolean; + /** + * The width at which text will wrap, it needs wordWrap to be set to true + * + * @member {number} + */ + wordWrapWidth: number; + /** + * Generates a font style string to use for `TextMetrics.measureFont()`. + * + * @return {string} Font style string, for passing to `TextMetrics.measureFont()` + */ + toFontString(): string; + } + interface BitmapFontLoader extends PIXI.ILoaderPlugin { + } + /** + * {@link PIXI.Loader Loader} middleware for loading + * bitmap-based fonts suitable for using with {@link PIXI.BitmapText}. + * @class + * @memberof PIXI + * @implements PIXI.ILoaderPlugin + */ + class BitmapFontLoader implements PIXI.ILoaderPlugin { + /** + * Register a BitmapText font from loader resource. + * + * @param {PIXI.LoaderResource} resource - Loader resource. + * @param {PIXI.Texture} texture - Reference to texture. + */ + static parse(resource: PIXI.LoaderResource, texture: PIXI.Texture): void; + /** + * Called when the plugin is installed. + * + * @see PIXI.Loader.registerPlugin + */ + static add(): void; + /** + * Called after a resource is loaded. + * @see PIXI.Loader.loaderMiddleware + * @param {PIXI.LoaderResource} resource + * @param {function} next + */ + static use(resource: PIXI.LoaderResource, next: (...params: any[]) => any): void; + } + /** + * A BitmapText object will create a line or multiple lines of text using bitmap font. + * + * The primary advantage of this class over Text is that all of your textures are pre-generated and loading, + * meaning that rendering is fast, and changing text has no performance implications. + * + * The primary disadvantage is that you need to preload the bitmap font assets, and thus the styling is set in stone. + * Supporting character sets other than latin, such as CJK languages, may be impractical due to the number of characters. + * + * To split a line you can use '\n', '\r' or '\r\n' in your string. + * + * You can generate the fnt files using + * http://www.angelcode.com/products/bmfont/ for Windows or + * http://www.bmglyph.com/ for Mac. + * + * A BitmapText can only be created when the font is loaded. + * + * ```js + * // in this case the font is in a file called 'desyrel.fnt' + * let bitmapText = new PIXI.BitmapText("text using a fancy font!", {font: "35px Desyrel", align: "right"}); + * ``` + * + * @class + * @extends PIXI.Container + * @memberof PIXI + */ + class BitmapText extends PIXI.Container { + constructor(text: string, style: { + font: { + name?: string; + size?: number; + }; + align?: string; + tint?: number; + }); + /** + * The dirty state of this object. + * + * @member {boolean} PIXI.BitmapText#dirty + */ + dirty: boolean; + /** + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. + * Advantages can include sharper image quality (like text) and faster rendering on canvas. + * The main disadvantage is movement of objects may appear less smooth. + * To set the global default, change {@link PIXI.settings.ROUND_PIXELS} + * + * @member {boolean} PIXI.BitmapText#roundPixels + * @default false + */ + roundPixels: boolean; + /** + * Validates text before calling parent's getLocalBounds + * + * @return {PIXI.Rectangle} The rectangular bounding area + */ + getLocalBounds(): PIXI.Rectangle; + /** + * The tint of the BitmapText object. + * + * @member {number} + */ + tint: number; + /** + * The alignment of the BitmapText object. + * + * @member {string} + * @default 'left' + */ + align: string; + /** + * The anchor sets the origin point of the text. + * + * The default is `(0,0)`, this means the text's origin is the top left. + * + * Setting the anchor to `(0.5,0.5)` means the text's origin is centered. + * + * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner. + * + * @member {PIXI.Point | number} + */ + anchor: PIXI.Point | number; + /** + * The font descriptor of the BitmapText object. + * + * @member {object} + */ + font: any; + /** + * The text of the BitmapText object. + * + * @member {string} + */ + text: string; + /** + * The max width of this bitmap text in pixels. If the text provided is longer than the + * value provided, line breaks will be automatically inserted in the last whitespace. + * Disable by setting the value to 0. + * + * @member {number} + */ + maxWidth: number; + /** + * The max line height. This is useful when trying to use the total height of the Text, + * i.e. when trying to vertically align. + * + * @member {number} + * @readonly + */ + readonly maxLineHeight: number; + /** + * The width of the overall text, different from fontSize, + * which is defined in the style object. + * + * @member {number} + * @readonly + */ + readonly textWidth: number; + /** + * Additional space between characters. + * + * @member {number} + */ + letterSpacing: number; + /** + * The height of the overall text, different from fontSize, + * which is defined in the style object. + * + * @member {number} + * @readonly + */ + readonly textHeight: number; + /** + * Register a bitmap font with data and a texture. + * + * @static + * @param {XMLDocument} xml - The XML document data. + * @param {Object.|PIXI.Texture|PIXI.Texture[]} textures - List of textures for each page. + * If providing an object, the key is the `` element's `file` attribute in the FNT file. + * @return {Object} Result font object with font, size, lineHeight and char fields. + */ + static registerFont(xml: XMLDocument, textures: { + [key: string]: PIXI.Texture; + } | PIXI.Texture | PIXI.Texture[]): any; + /** + * @method PIXI.Container#renderWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#render + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderWebGL(renderer: PIXI.Renderer): void; + /** + * @method PIXI.Container#renderAdvancedWebGL + * @deprecated since 5.0.0 + * @see PIXI.Container#renderAdvanced + * @param {PIXI.Renderer} renderer Instance of renderer + */ + renderAdvancedWebGL(renderer: PIXI.Renderer): void; + /** + * To be overridden by the subclass + * @method _renderCanvas + * @memberof PIXI.Container# + * @protected + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + protected _renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * Renders the object using the Canvas renderer + * @method renderCanvas + * @memberof PIXI.Container# + * @param {PIXI.CanvasRenderer} renderer - The renderer + */ + renderCanvas(renderer: PIXI.CanvasRenderer): void; + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} PIXI.Container#children + * @readonly + */ + readonly children: PIXI.DisplayObject[]; + /** + * If set to true, the container will sort its children by zIndex value + * when updateTransform() is called, or manually if sortChildren() is called. + * + * This actually changes the order of elements in the array, so should be treated + * as a basic solution that is not performant compared to other solutions, + * such as @link https://github.com/pixijs/pixi-display + * + * Also be aware of that this may not work nicely with the addChildAt() function, + * as the zIndex sorting may cause the child to automatically sorted to another position. + * + * @see PIXI.settings.SORTABLE_CHILDREN + * + * @member {boolean} PIXI.Container#sortableChildren + */ + sortableChildren: boolean; + /** + * Should children be sorted by zIndex at the next updateTransform call. + * Will get automatically set to true if a new child is added, or if a child's zIndex changes. + * + * @member {boolean} PIXI.Container#sortDirty + */ + sortDirty: boolean; + /** + * Overridable method that can be used by Container subclasses whenever the children array is modified + * + * @protected + */ + protected onChildrenChange(): void; + /** + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + addChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown + * + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. + */ + addChildAt(child: PIXI.DisplayObject, index: number): PIXI.DisplayObject; + /** + * Swaps the position of 2 Display Objects within this container. + * + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap + */ + swapChildren(child: PIXI.DisplayObject, child2: PIXI.DisplayObject): void; + /** + * Returns the index position of a child DisplayObject instance + * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify + */ + getChildIndex(child: PIXI.DisplayObject): number; + /** + * Changes the position of an existing child in the display object container + * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object + */ + setChildIndex(child: PIXI.DisplayObject, index: number): void; + /** + * Returns the child at the specified index + * + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. + */ + getChildAt(index: number): PIXI.DisplayObject; + /** + * Removes one or more children from the container. + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. + */ + removeChild(...child: PIXI.DisplayObject[]): PIXI.DisplayObject; + /** + * Removes a child from the specified index position. + * + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. + */ + removeChildAt(index: number): PIXI.DisplayObject; + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject[]; + /** + * Sorts children by zIndex. Previous order is mantained for 2 children with the same zIndex. + */ + sortChildren(): void; + /** + * Recalculates the bounds of the container. + * + */ + calculateBounds(): void; + /** + * Recalculates the bounds of the object. Override this to + * calculate the bounds of the specific object (not including children). + * + * @protected + */ + protected _calculateBounds(): void; + /** + * Renders the object using the WebGL renderer + * + * @param {PIXI.Renderer} renderer - The renderer + */ + render(renderer: PIXI.Renderer): void; + /** + * Render the object using the WebGL renderer and advanced features. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected renderAdvanced(renderer: PIXI.Renderer): void; + /** + * To be overridden by the subclasses. + * + * @protected + * @param {PIXI.Renderer} renderer - The renderer + */ + protected _render(renderer: PIXI.Renderer): void; + /** + * Removes all internal references and listeners as well as removes children from the display list. + * Do not use a Container after calling `destroy`. + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true + * Should it destroy the texture of the child sprite + * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true + * Should it destroy the base texture of the child sprite + */ + destroy(options?: { + children?: boolean; + texture?: boolean; + baseTexture?: boolean; + }): void; + /** + * The width of the Container, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + width: number; + /** + * The height of the Container, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ + height: number; + /** + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows PixiJS to bypass a recursive `hitTest` function + * + * @member {boolean} + * @memberof PIXI.Container# + */ + interactiveChildren: boolean; + /** + * Returns the display object in the container. + * + * @method getChildByName + * @memberof PIXI.Container# + * @param {string} name - Instance name. + * @return {PIXI.DisplayObject} The child with the specified name. + */ + getChildByName(name: string): PIXI.DisplayObject; + /** + * Flag for if the object is accessible. If true AccessibilityManager will overlay a + * shadow div with attributes set + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + accessible: boolean; + /** + * Sets the title attribute of the shadow div + * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]' + * + * @member {?string} + * @memberof PIXI.DisplayObject# + */ + accessibleTitle: string; + /** + * Sets the aria-label attribute of the shadow div + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + accessibleHint: string; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleActive: boolean; + /** + * @member {boolean} + * @memberof PIXI.DisplayObject# + * @todo Needs docs. + */ + _accessibleDiv: boolean; + /** + * World transform and local transform of this object. + * This will become read-only later, please do not assign anything there unless you know what are you doing. + * + * @member {PIXI.Transform} PIXI.DisplayObject#transform + */ + transform: PIXI.Transform; + /** + * The opacity of the object. + * + * @member {number} PIXI.DisplayObject#alpha + */ + alpha: number; + /** + * The visibility of the object. If false the object will not be drawn, and + * the updateTransform function will not be called. + * + * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually. + * + * @member {boolean} PIXI.DisplayObject#visible + */ + visible: boolean; + /** + * Can this object be rendered, if false the object will not be drawn but the updateTransform + * methods will still be called. + * + * Only affects recursive calls from parent. You can ask for bounds manually. + * + * @member {boolean} PIXI.DisplayObject#renderable + */ + renderable: boolean; + /** + * The display object container that contains this display object. + * + * @member {PIXI.Container} PIXI.DisplayObject#parent + * @readonly + */ + readonly parent: PIXI.Container; + /** + * The multiplied alpha of the displayObject. + * + * @member {number} PIXI.DisplayObject#worldAlpha + * @readonly + */ + readonly worldAlpha: number; + /** + * Which index in the children array the display component was before the previous zIndex sort. + * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider. + * + * @member {number} PIXI.DisplayObject#_lastSortedIndex + * @protected + */ + protected _lastSortedIndex: number; + /** + * The zIndex of the displayObject. + * A higher value will mean it will be rendered on top of other displayObjects within the same container. + * + * @member {number} PIXI.DisplayObject#_zIndex + * @protected + */ + protected _zIndex: number; + /** + * The area the filter is applied to. This is used as more of an optimization + * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. + * + * Also works as an interaction mask. + * + * @member {?PIXI.Rectangle} PIXI.DisplayObject#filterArea + */ + filterArea: PIXI.Rectangle; + /** + * Sets the filters for the displayObject. + * * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. + * To remove filters simply set this property to `'null'`. + * + * @member {?PIXI.Filter[]} PIXI.DisplayObject#filters + */ + filters: PIXI.Filter[]; + /** + * The bounds object, this is used to calculate and store the bounds of the displayObject. + * + * @member {PIXI.Bounds} PIXI.DisplayObject#_bounds + * @protected + */ + protected _bounds: PIXI.Bounds; + /** + * The original, cached mask of the object. + * + * @member {PIXI.Graphics|PIXI.Sprite} PIXI.DisplayObject#_mask + * @protected + */ + protected _mask: PIXI.Graphics | PIXI.Sprite; + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} PIXI.DisplayObject#_destroyed + * @protected + */ + protected _destroyed: boolean; + /** + * used to fast check if a sprite is.. a sprite! + * @member {boolean} PIXI.DisplayObject#isSprite + */ + isSprite: boolean; + /** + * @protected + * @member {PIXI.DisplayObject} + */ + protected _tempDisplayObjectParent: PIXI.DisplayObject; + /** + * Recursively updates transform of all objects from the root to this one + * internal function for toLocal() + */ + _recursivePostUpdateTransform(): void; + /** + * Retrieves the bounds of the displayObject as a rectangle object. + * + * @param {boolean} [skipUpdate] - Setting to `true` will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation. + * @return {PIXI.Rectangle} The rectangular bounding area. + */ + getBounds(skipUpdate?: boolean, rect?: PIXI.Rectangle): PIXI.Rectangle; + /** + * Calculates the global position of the display object. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform. + * @return {PIXI.IPoint} A point object representing the position of this object. + */ + toGlobal(position: PIXI.IPoint, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Calculates the local position of the display object relative to another point. + * + * @param {PIXI.IPoint} position - The world origin to calculate from. + * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from. + * @param {PIXI.IPoint} [point] - A Point object in which to store the value, optional + * (otherwise will create a new Point). + * @param {boolean} [skipUpdate=false] - Should we skip the update transform + * @return {PIXI.IPoint} A point object representing the position of this object + */ + toLocal(position: PIXI.IPoint, from?: PIXI.DisplayObject, point?: PIXI.IPoint, skipUpdate?: boolean): PIXI.IPoint; + /** + * Set the parent Container of this DisplayObject. + * + * @param {PIXI.Container} container - The Container to add this DisplayObject to. + * @return {PIXI.Container} The Container that this DisplayObject was added to. + */ + setParent(container: PIXI.Container): PIXI.Container; + /** + * Convenience function to set the position, scale, skew and pivot at once. + * + * @param {number} [x=0] - The X position + * @param {number} [y=0] - The Y position + * @param {number} [scaleX=1] - The X scale value + * @param {number} [scaleY=1] - The Y scale value + * @param {number} [rotation=0] - The rotation + * @param {number} [skewX=0] - The X skew value + * @param {number} [skewY=0] - The Y skew value + * @param {number} [pivotX=0] - The X pivot value + * @param {number} [pivotY=0] - The Y pivot value + * @return {PIXI.DisplayObject} The DisplayObject instance + */ + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): PIXI.DisplayObject; + /** + * The position of the displayObject on the x axis relative to the local coordinates of the parent. + * An alias to position.x + * + * @member {number} + */ + x: number; + /** + * The position of the displayObject on the y axis relative to the local coordinates of the parent. + * An alias to position.y + * + * @member {number} + */ + y: number; + /** + * Current transform of the object based on world (parent) factors. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly worldTransform: PIXI.Matrix; + /** + * Current transform of the object based on local factors: position, scale, other stuff. + * + * @member {PIXI.Matrix} + * @readonly + */ + readonly localTransform: PIXI.Matrix; + /** + * The coordinate of the object relative to the local coordinates of the parent. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + position: PIXI.IPoint; + /** + * The scale factor of the object. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + scale: PIXI.IPoint; + /** + * The pivot point of the displayObject that it rotates around. + * Assignment by value since pixi-v4. + * + * @member {PIXI.IPoint} + */ + pivot: PIXI.IPoint; + /** + * The skew factor for the object in radians. + * Assignment by value since pixi-v4. + * + * @member {PIXI.ObservablePoint} + */ + skew: PIXI.ObservablePoint; + /** + * The rotation of the object in radians. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + rotation: number; + /** + * The angle of the object in degrees. + * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. + * + * @member {number} + */ + angle: number; + /** + * The zIndex of the displayObject. + * If a container has the sortableChildren property set to true, children will be automatically + * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, + * and thus rendered on top of other displayObjects within the same container. + * + * @member {number} + */ + zIndex: number; + /** + * Indicates if the object is globally visible. + * + * @member {boolean} + * @readonly + */ + readonly worldVisible: boolean; + /** + * Sets a mask for the displayObject. A mask is an object that limits the visibility of an + * object to the shape of the mask applied to it. In PixiJS a regular mask must be a + * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it + * utilities shape clipping. To remove a mask, set this property to `null`. + * + * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask. + * @example + * const graphics = new PIXI.Graphics(); + * graphics.beginFill(0xFF3300); + * graphics.drawRect(50, 250, 100, 100); + * graphics.endFill(); + * + * const sprite = new PIXI.Sprite(texture); + * sprite.mask = graphics; + * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * + * @member {PIXI.Graphics|PIXI.Sprite} + */ + mask: PIXI.Graphics | PIXI.Sprite; + /** + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + interactive: boolean; + /** + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# + */ + hitArea: PIXI.Rectangle | PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.RoundedRectangle; + /** + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + buttonMode: boolean; + /** + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. + * + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# + */ + cursor: string; + /** + * Set this to true if you want this display object to be cached as a bitmap. + * This basically takes a snap shot of the display object as it is at that moment. It can + * provide a performance benefit for complex static displayObjects. + * To remove simply set this property to `false` + * + * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * + * @member {boolean} + * @memberof PIXI.DisplayObject# + */ + cacheAsBitmap: boolean; + /** + * The instance name of the object. + * + * @memberof PIXI.DisplayObject# + * @member {string} name + */ + name: string; + /** + * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot. + * + * @method getGlobalPosition + * @memberof PIXI.DisplayObject# + * @param {Point} point - The point to write the global value to. If null a new point will be returned + * @param {boolean} skipUpdate - Setting to true will stop the transforms of the scene graph from + * being updated. This means the calculation returned MAY be out of date BUT will give you a + * nice performance boost. + * @return {Point} The updated point. + */ + getGlobalPosition(point: Point, skipUpdate: boolean): Point; + } + /** + * Represents the update priorities used by internal PIXI classes when registered with + * the {@link PIXI.Ticker} object. Higher priority items are updated first and lower + * priority items, such as render, should go later. + * + * @static + * @constant + * @name UPDATE_PRIORITY + * @memberof PIXI + * @type {object} + * @property {number} INTERACTION=50 Highest priority, used for {@link PIXI.interaction.InteractionManager} + * @property {number} HIGH=25 High priority updating, {@link PIXI.VideoBaseTexture} and {@link PIXI.AnimatedSprite} + * @property {number} NORMAL=0 Default priority for ticker events, see {@link PIXI.Ticker#add}. + * @property {number} LOW=-25 Low priority used for {@link PIXI.Application} rendering. + * @property {number} UTILITY=-50 Lowest priority used for {@link PIXI.prepare.BasePrepare} utility. + */ + var UPDATE_PRIORITY: { + INTERACTION: number; + HIGH: number; + NORMAL: number; + LOW: number; + UTILITY: number; + }; + /** + * A Ticker class that runs an update loop that other objects listen to. + * + * This class is composed around listeners meant for execution on the next requested animation frame. + * Animation frames are requested only when necessary, e.g. When the ticker is started and the emitter has listeners. + * + * @class + * @memberof PIXI + */ + class Ticker { + constructor(); + /** + * Whether or not this ticker should invoke the method + * {@link PIXI.Ticker#start} automatically + * when a listener is added. + * + * @member {boolean} PIXI.Ticker#autoStart + * @default false + */ + autoStart: boolean; + /** + * Scalar time value from last frame to this frame. + * This value is capped by setting {@link PIXI.Ticker#minFPS} + * and is scaled with {@link PIXI.Ticker#speed}. + * **Note:** The cap may be exceeded by scaling. + * + * @member {number} PIXI.Ticker#deltaTime + * @default 1 + */ + deltaTime: number; + /** + * Scaler time elapsed in milliseconds from last frame to this frame. + * This value is capped by setting {@link PIXI.Ticker#minFPS} + * and is scaled with {@link PIXI.Ticker#speed}. + * **Note:** The cap may be exceeded by scaling. + * If the platform supports DOMHighResTimeStamp, + * this value will have a precision of 1 µs. + * Defaults to target frame time + * + * @member {number} PIXI.Ticker#deltaMS + * @default 16.66 + */ + deltaMS: number; + /** + * Time elapsed in milliseconds from last frame to this frame. + * Opposed to what the scalar {@link PIXI.Ticker#deltaTime} + * is based, this value is neither capped nor scaled. + * If the platform supports DOMHighResTimeStamp, + * this value will have a precision of 1 µs. + * Defaults to target frame time + * + * @member {number} PIXI.Ticker#elapsedMS + * @default 16.66 + */ + elapsedMS: number; + /** + * The last time {@link PIXI.Ticker#update} was invoked. + * This value is also reset internally outside of invoking + * update, but only when a new animation frame is requested. + * If the platform supports DOMHighResTimeStamp, + * this value will have a precision of 1 µs. + * + * @member {number} PIXI.Ticker#lastTime + * @default -1 + */ + lastTime: number; + /** + * Factor of current {@link PIXI.Ticker#deltaTime}. + * @example + * // Scales ticker.deltaTime to what would be + * // the equivalent of approximately 120 FPS + * ticker.speed = 2; + * + * @member {number} PIXI.Ticker#speed + * @default 1 + */ + speed: number; + /** + * Whether or not this ticker has been started. + * `true` if {@link PIXI.Ticker#start} has been called. + * `false` if {@link PIXI.Ticker#stop} has been called. + * While `false`, this value may change to `true` in the + * event of {@link PIXI.Ticker#autoStart} being `true` + * and a listener is added. + * + * @member {boolean} PIXI.Ticker#started + * @default false + */ + started: boolean; + /** + * Register a handler for tick events. Calls continuously unless + * it is removed or the ticker is stopped. + * + * @param {Function} fn - The listener function to be added for updates + * @param {*} [context] - The listener context + * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting + * @returns {PIXI.Ticker} This instance of a ticker + */ + add(fn: (...params: any[]) => any, context?: any, priority?: number): PIXI.Ticker; + /** + * Add a handler for the tick event which is only execute once. + * + * @param {Function} fn - The listener function to be added for one update + * @param {*} [context] - The listener context + * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting + * @returns {PIXI.Ticker} This instance of a ticker + */ + addOnce(fn: (...params: any[]) => any, context?: any, priority?: number): PIXI.Ticker; + /** + * Removes any handlers matching the function and context parameters. + * If no handlers are left after removing, then it cancels the animation frame. + * + * @param {Function} fn - The listener function to be removed + * @param {*} [context] - The listener context to be removed + * @returns {PIXI.Ticker} This instance of a ticker + */ + remove(fn: (...params: any[]) => any, context?: any): PIXI.Ticker; + /** + * Starts the ticker. If the ticker has listeners + * a new animation frame is requested at this point. + */ + start(): void; + /** + * Stops the ticker. If the ticker has requested + * an animation frame it is canceled at this point. + */ + stop(): void; + /** + * Destroy the ticker and don't use after this. Calling + * this method removes all references to internal events. + */ + destroy(): void; + /** + * Triggers an update. An update entails setting the + * current {@link PIXI.Ticker#elapsedMS}, + * the current {@link PIXI.Ticker#deltaTime}, + * invoking all listeners with current deltaTime, + * and then finally setting {@link PIXI.Ticker#lastTime} + * with the value of currentTime that was provided. + * This method will be called automatically by animation + * frame callbacks if the ticker instance has been started + * and listeners are added. + * + * @param {number} [currentTime=performance.now()] - the current time of execution + */ + update(currentTime?: number): void; + /** + * The frames per second at which this ticker is running. + * The default is approximately 60 in most modern browsers. + * **Note:** This does not factor in the value of + * {@link PIXI.Ticker#speed}, which is specific + * to scaling {@link PIXI.Ticker#deltaTime}. + * + * @member {number} + * @readonly + */ + readonly FPS: number; + /** + * Manages the maximum amount of milliseconds allowed to + * elapse between invoking {@link PIXI.Ticker#update}. + * This value is used to cap {@link PIXI.Ticker#deltaTime}, + * but does not effect the measured value of {@link PIXI.Ticker#FPS}. + * When setting this property it is clamped to a value between + * `0` and `PIXI.settings.TARGET_FPMS * 1000`. + * + * @member {number} + * @default 10 + */ + minFPS: number; + /** + * Manages the minimum amount of milliseconds allowed to + * elapse between invoking {@link PIXI.Ticker#update}. + * This will effect the measured value of {@link PIXI.Ticker#FPS}. + * When setting this property it is clamped to a value between + * `1` and `TARGET_FPMS * 1000`. + * + * @member {number} + * @default 60 + */ + maxFPS: number; + /** + * The shared ticker instance used by {@link PIXI.AnimatedSprite} and by + * {@link PIXI.VideoResource} to update animation frames / video textures. + * + * It may also be used by {@link PIXI.Application} if created with the `sharedTicker` option property set to true. + * + * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance. + * Please follow the examples for usage, including how to opt-out of auto-starting the shared ticker. + * + * @example + * let ticker = PIXI.Ticker.shared; + * // Set this to prevent starting this ticker when listeners are added. + * // By default this is true only for the PIXI.Ticker.shared instance. + * ticker.autoStart = false; + * // FYI, call this to ensure the ticker is stopped. It should be stopped + * // if you have not attempted to render anything yet. + * ticker.stop(); + * // Call this when you are ready for a running shared ticker. + * ticker.start(); + * + * @example + * // You may use the shared ticker to render... + * let renderer = PIXI.autoDetectRenderer(); + * let stage = new PIXI.Container(); + * document.body.appendChild(renderer.view); + * ticker.add(function (time) { + * renderer.render(stage); + * }); + * + * @example + * // Or you can just update it manually. + * ticker.autoStart = false; + * ticker.stop(); + * function animate(time) { + * ticker.update(time); + * renderer.render(stage); + * requestAnimationFrame(animate); + * } + * animate(performance.now()); + * + * @member {PIXI.Ticker} + * @static + */ + static shared: PIXI.Ticker; + /** + * The system ticker instance used by {@link PIXI.interaction.InteractionManager} and by + * {@link PIXI.BasePrepare} for core timing functionality that shouldn't usually need to be paused, + * unlike the `shared` ticker which drives visual animations and rendering which may want to be paused. + * + * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance. + * + * @member {PIXI.Ticker} + * @static + */ + static system: PIXI.Ticker; + } + /** + * Middleware for for Application Ticker. + * + * @example + * import {TickerPlugin} from '@pixi/ticker'; + * import {Application} from '@pixi/app'; + * Application.registerPlugin(TickerPlugin); + * + * @class + * @memberof PIXI + */ + class TickerPlugin { + } + /** + * Regexp for data URI. + * Based on: {@link https://github.com/ragingwind/data-uri-regex} + * + * @static + * @constant {RegExp|string} DATA_URI + * @memberof PIXI + * @example data:image/png;base64 + */ + var DATA_URI: RegExp | string; + /** + * Generalized convenience utilities for PIXI. + * @example + * // Extend PIXI's internal Event Emitter. + * class MyEmitter extends PIXI.utils.EventEmitter { + * constructor() { + * super(); + * console.log("Emitter created!"); + * } + * } + * + * // Get info on current device + * console.log(PIXI.utils.isMobile); + * + * // Convert hex color to string + * console.log(PIXI.utils.hex2string(0xff00ff)); // returns: "#ff00ff" + * @namespace PIXI.utils + */ + namespace utils { + /** + * @function PIXI.utils.getSvgSize + * @see PIXI.resources.SVGResource.getSize + * @deprecated since 5.0.0 + */ + function getSvgSize(): void; + /** + * @namespace PIXI.utils.mixins + * @deprecated since 5.0.0 + */ + namespace mixins { + /** + * @memberof PIXI.utils.mixins + * @function mixin + * @deprecated since 5.0.0 + */ + function mixin(): void; + /** + * @memberof PIXI.utils.mixins + * @function delayMixin + * @deprecated since 5.0.0 + */ + function delayMixin(): void; + /** + * @memberof PIXI.utils.mixins + * @function performMixins + * @deprecated since 5.0.0 + */ + function performMixins(): void; + } + /** + * Skips the hello message of renderers that are created after this is run. + * + * @function skipHello + * @memberof PIXI.utils + */ + function skipHello(): void; + /** + * Logs out the version and renderer information for this running instance of PIXI. + * If you don't want to see this message you can run `PIXI.utils.skipHello()` before + * creating your renderer. Keep in mind that doing that will forever makes you a jerk face. + * + * @static + * @function sayHello + * @memberof PIXI.utils + * @param {string} type - The string renderer type to log. + */ + function sayHello(type: string): void; + /** + * Helper for checking for WebGL support. + * + * @memberof PIXI.utils + * @function isWebGLSupported + * @return {boolean} Is WebGL supported. + */ + function isWebGLSupported(): boolean; + /** + * Converts a hexadecimal color number to an [R, G, B] array of normalized floats (numbers from 0.0 to 1.0). + * + * @example + * PIXI.utils.hex2rgb(0xffffff); // returns [1, 1, 1] + * @memberof PIXI.utils + * @function hex2rgb + * @param {number} hex - The hexadecimal number to convert + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one + * @return {number[]} An array representing the [R, G, B] of the color where all values are floats. + */ + function hex2rgb(hex: number, out?: number[]): number[]; + /** + * Converts a hexadecimal color number to a string. + * + * @example + * PIXI.utils.hex2string(0xffffff); // returns "#ffffff" + * @memberof PIXI.utils + * @function hex2string + * @param {number} hex - Number in hex (e.g., `0xffffff`) + * @return {string} The string color (e.g., `"#ffffff"`). + */ + function hex2string(hex: number): string; + /** + * Converts a hexadecimal string to a hexadecimal color number. + * + * @example + * PIXI.utils.string2hex("#ffffff"); // returns 0xffffff + * @memberof PIXI.utils + * @function string2hex + * @param {string} The string color (e.g., `"#ffffff"`) + * @return {number} Number in hexadecimal. + */ + function string2hex(The: string): number; + /** + * Converts a color as an [R, G, B] array of normalized floats to a hexadecimal number. + * + * @example + * PIXI.utils.rgb2hex([1, 1, 1]); // returns 0xffffff + * @memberof PIXI.utils + * @function rgb2hex + * @param {number[]} rgb - Array of numbers where all values are normalized floats from 0.0 to 1.0. + * @return {number} Number in hexadecimal. + */ + function rgb2hex(rgb: number[]): number; + /** + * maps premultiply flag and blendMode to adjusted blendMode + * @memberof PIXI.utils + * @const premultiplyBlendMode + * @type {Array} + */ + var premultiplyBlendMode: number[][]; + /** + * changes blendMode according to texture format + * + * @memberof PIXI.utils + * @function correctBlendMode + * @param {number} blendMode supposed blend mode + * @param {boolean} premultiplied whether source is premultiplied + * @returns {number} true blend mode for this texture + */ + function correctBlendMode(blendMode: number, premultiplied: boolean): number; + /** + * combines rgb and alpha to out array + * + * @memberof PIXI.utils + * @function premultiplyRgba + * @param {Float32Array|number[]} rgb input rgb + * @param {number} alpha alpha param + * @param {Float32Array} [out] output + * @param {boolean} [premultiply=true] do premultiply it + * @returns {Float32Array} vec4 rgba + */ + function premultiplyRgba(rgb: Float32Array | number[], alpha: number, out?: Float32Array, premultiply?: boolean): Float32Array; + /** + * premultiplies tint + * + * @memberof PIXI.utils + * @function premultiplyTint + * @param {number} tint integer RGB + * @param {number} alpha floating point alpha (0.0-1.0) + * @returns {number} tint multiplied by alpha + */ + function premultiplyTint(tint: number, alpha: number): number; + /** + * converts integer tint and float alpha to vec4 form, premultiplies by default + * + * @memberof PIXI.utils + * @function premultiplyTintToRgba + * @param {number} tint input tint + * @param {number} alpha alpha param + * @param {Float32Array} [out] output + * @param {boolean} [premultiply=true] do premultiply it + * @returns {Float32Array} vec4 rgba + */ + function premultiplyTintToRgba(tint: number, alpha: number, out?: Float32Array, premultiply?: boolean): Float32Array; + /** + * Rounds to next power of two. + * + * @function isPow2 + * @memberof PIXI.utils + * @param {number} v input value + * @return {number} + */ + function isPow2(v: number): number; + /** + * Rounds to next power of two. + * + * @function isPow2 + * @memberof PIXI.utils + * @param {number} v input value + * @return {number} + */ + function isPow2(v: number): number; + /** + * Computes ceil of log base 2 + * + * @function log2 + * @memberof PIXI.utils + * @param {number} v input value + * @return {number} logarithm base 2 + */ + function log2(v: number): number; + /** + * Remove items from a javascript array without generating garbage + * + * @function removeItems + * @memberof PIXI.utils + * @param {Array} arr Array to remove elements from + * @param {number} startIdx starting index + * @param {number} removeCount how many to remove + */ + function removeItems(arr: any[], startIdx: number, removeCount: number): void; + /** + * Returns sign of number + * + * @memberof PIXI.utils + * @function sign + * @param {number} n - the number to check the sign of + * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive + */ + function sign(n: number): number; + /** + * Gets the next unique identifier + * + * @memberof PIXI.utils + * @function uid + * @return {number} The next unique identifier to use. + */ + function uid(): number; + /** + * A simple JS library that detects mobile devices. + * + * @see {@link https://github.com/kaimallea/isMobile} + * + * @memberof PIXI.utils + * @name isMobile + * @type {Object} + * @property {boolean} any - `true` if current platform is tablet or phone device + * @property {boolean} tablet - `true` if current platform large-screen tablet device + * @property {boolean} phone - `true` if current platform small-screen phone device + * @property {object} apple + * @property {boolean} apple.device - `true` if any Apple device + * @property {boolean} apple.tablet - `true` if any Apple iPad + * @property {boolean} apple.phone - `true` if any Apple iPhone + * @property {boolean} apple.ipod - `true` if any iPod + * @property {object} android + * @property {boolean} android.device - `true` if any Android device + * @property {boolean} android.tablet - `true` if any Android tablet + * @property {boolean} android.phone - `true` if any Android phone + * @property {object} amazon + * @property {boolean} amazon.device - `true` if any Silk device + * @property {boolean} amazon.tablet - `true` if any Silk tablet + * @property {boolean} amazon.phone - `true` if any Silk phone + * @property {object} windows + * @property {boolean} windows.device - `true` if any Windows device + * @property {boolean} windows.tablet - `true` if any Windows tablet + * @property {boolean} windows.phone - `true` if any Windows phone + */ + var isMobile: { + any: boolean; + tablet: boolean; + phone: boolean; + apple: { + device: boolean; + tablet: boolean; + phone: boolean; + ipod: boolean; + }; + android: { + device: boolean; + tablet: boolean; + phone: boolean; + }; + amazon: { + device: boolean; + tablet: boolean; + phone: boolean; + }; + windows: { + device: boolean; + tablet: boolean; + phone: boolean; + }; + }; + /** + * A high performance event emitter + * + * @see {@link https://github.com/primus/eventemitter3} + * + * @memberof PIXI.utils + * @class EventEmitter + * @type {EventEmitter} + */ + class EventEmitter { + } + /** + * A polygon triangulation library + * + * @see {@link https://github.com/mapbox/earcut} + * + * @memberof PIXI.utils + * @function earcut + * @param {number[]} vertices - A flat array of vertex coordinates + * @param {number[]} [holes] - An array of hole indices + * @param {number} [dimensions=2] The number of coordinates per vertex in the input array + * @return {number[]} Triangulated polygon + */ + function earcut(vertices: number[], holes?: number[], dimensions?: number): number[]; + /** + * Node.js compatible URL utilities. + * + * @see https://www.npmjs.com/package/url + * + * @memberof PIXI.utils + * @name url + * @type {object} + */ + var url: any; + /** + * Helper for warning developers about deprecated features & settings. + * A stack track for warnings is given; useful for tracking-down where + * deprecated methods/properties/classes are being used within the code. + * + * @memberof PIXI.utils + * @function deprecation + * @param {string} version - The version where the feature became deprecated + * @param {string} message - Message should include what is deprecated, where, and the new solution + * @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack + * this is mostly to ignore internal deprecation calls. + */ + function deprecation(version: string, message: string, ignoreDepth?: number): void; + /** + * @todo Describe property usage + * + * @static + * @name ProgramCache + * @memberof PIXI.utils + * @type {Object} + */ + var ProgramCache: any; + /** + * @todo Describe property usage + * + * @static + * @name TextureCache + * @memberof PIXI.utils + * @type {Object} + */ + var TextureCache: any; + /** + * @todo Describe property usage + * + * @static + * @name BaseTextureCache + * @memberof PIXI.utils + * @type {Object} + */ + var BaseTextureCache: any; + /** + * Destroys all texture in the cache + * + * @memberof PIXI.utils + * @function destroyTextureCache + */ + function destroyTextureCache(): void; + /** + * Removes all textures from cache, but does not destroy them + * + * @memberof PIXI.utils + * @function clearTextureCache + */ + function clearTextureCache(): void; + /** + * Creates a Canvas element of the given size to be used as a target for rendering to. + * + * @class + * @memberof PIXI.utils + */ + class CanvasRenderTarget { + constructor(width: number, height: number, resolution?: number); + /** + * The Canvas object that belongs to this CanvasRenderTarget. + * + * @member {HTMLCanvasElement} PIXI.utils.CanvasRenderTarget#canvas + */ + canvas: HTMLCanvasElement; + /** + * A CanvasRenderingContext2D object representing a two-dimensional rendering context. + * + * @member {CanvasRenderingContext2D} PIXI.utils.CanvasRenderTarget#context + */ + context: CanvasRenderingContext2D; + /** + * Resizes the canvas to the specified width and height. + * + * @param {number} width - the new width of the canvas + * @param {number} height - the new height of the canvas + */ + resize(width: number, height: number): void; + /** + * Destroys this canvas. + * + */ + destroy(): void; + /** + * The width of the canvas buffer in pixels. + * + * @member {number} + */ + width: number; + /** + * The height of the canvas buffer in pixels. + * + * @member {number} + */ + height: number; + } + /** + * Trim transparent borders from a canvas + * + * @memberof PIXI.utils + * @function trimCanvas + * @param {HTMLCanvasElement} canvas - the canvas to trim + * @returns {object} Trim data + */ + function trimCanvas(canvas: HTMLCanvasElement): any; + /** + * Typedef for decomposeDataUri return object. + * + * @memberof PIXI.utils + * @typedef {object} DecomposedDataUri + * @property {string} mediaType Media type, eg. `image` + * @property {string} subType Sub type, eg. `png` + * @property {string} encoding Data encoding, eg. `base64` + * @property {string} data The actual data + */ + type DecomposedDataUri = { + mediaType: string; + subType: string; + encoding: string; + data: string; + }; + /** + * Split a data URI into components. Returns undefined if + * parameter `dataUri` is not a valid data URI. + * + * @memberof PIXI.utils + * @function decomposeDataUri + * @param {string} dataUri - the data URI to check + * @return {PIXI.utils.DecomposedDataUri|undefined} The decomposed data uri or undefined + */ + function decomposeDataUri(dataUri: string): PIXI.utils.DecomposedDataUri | undefined; + /** + * get the resolution / device pixel ratio of an asset by looking for the prefix + * used by spritesheets and image urls + * + * @memberof PIXI.utils + * @function getResolutionOfUrl + * @param {string} url - the image path + * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set. + * @return {number} resolution / device pixel ratio of an asset + */ + function getResolutionOfUrl(url: string, defaultValue?: number): number; + } +} + +/** + * @interface SharedArrayBuffer + */ +declare interface SharedArrayBuffer { +} + + +declare namespace PIXI { + namespace utils { +// https://github.com/primus/eventemitter3 + export interface EventEmitter { + /** + * Return an array listing the events for which the emitter has registered listeners. + * + * @returns {(string | symbol)[]} + */ + eventNames(): Array<(string | symbol)>; + + /** + * Return the listeners registered for a given event. + * + * @param {(string | symbol)} event The event name. + * @returns {Function[]} + */ + //tslint:disable-next-line:ban-types forbidden-types + listeners(event: string | symbol): Array; + + /** + * Return the number of listeners listening to a given event. + * + * @param {(string | symbol)} event The event name. + * @returns {number} + */ + listenerCount(event: string | symbol): number; + + /** + * Calls each of the listeners registered for a given event. + * + * @param {(string | symbol)} event The event name. + * @param {...*} args Arguments that are passed to registered listeners + * @returns {boolean} `true` if the event had listeners, else `false`. + */ + emit(event: string | symbol, ...args: any[]): boolean; + + /** + * Add a listener for a given event. + * + * @param {(string | symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + */ + //tslint:disable-next-line:ban-types forbidden-types + on(event: string | symbol, fn: Function, context?: any): this; + + /** + * Add a one-time listener for a given event. + * + * @param {(string | symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + */ + //tslint:disable-next-line:ban-types forbidden-types + once(event: string | symbol, fn: Function, context?: any): this; + + /** + * Remove the listeners of a given event. + * + * @param {(string | symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + */ + //tslint:disable-next-line:ban-types forbidden-types + removeListener(event: string | symbol, fn?: Function, context?: any, once?: boolean): this; + + /** + * Remove all listeners, or those of the specified event. + * + * @param {(string | symbol)} event The event name. + * @returns {EventEmitter} `this`. + */ + removeAllListeners(event?: string | symbol): this; + + /** + * Alias method for `removeListener` + */ + //tslint:disable-next-line:ban-types forbidden-types + off(event: string | symbol, fn?: Function, context?: any, once?: boolean): this; + + /** + * Alias method for `on` + */ + //tslint:disable-next-line:ban-types forbidden-types + addListener(event: string | symbol, fn: Function, context?: any): this; + } + } + + namespace interaction { + type InteractionPointerEvents = "pointerdown" | "pointercancel" | "pointerup" | "pointertap" | "pointerupoutside" | "pointermove" | "pointerover" | "pointerout"; + type InteractionTouchEvents = "touchstart" | "touchcancel" | "touchend" | "touchendoutside" | "touchmove" | "tap"; + type InteractionMouseEvents = "rightdown" | "mousedown" | "rightup" | "mouseup" | "rightclick" | "click" | "rightupoutside" | "mouseupoutside" | "mousemove" | "mouseover" | "mouseout" | "mouseover"; + type InteractionPixiEvents = "added" | "removed"; + type InteractionEventTypes = InteractionPointerEvents | InteractionTouchEvents | InteractionMouseEvents | InteractionPixiEvents; + } + + export interface DisplayObject { + on(event: interaction.InteractionEventTypes, fn: (event: interaction.InteractionEvent) => void, context?: any): this; + once(event: interaction.InteractionEventTypes, fn: (event: interaction.InteractionEvent) => void, context?: any): this; + removeListener(event: interaction.InteractionEventTypes, fn?: (event: interaction.InteractionEvent) => void, context?: any): this; + removeAllListeners(event?: interaction.InteractionEventTypes): this; + off(event: interaction.InteractionEventTypes, fn?: (event: interaction.InteractionEvent) => void, context?: any): this; + addListener(event: interaction.InteractionEventTypes, fn: (event: interaction.InteractionEvent) => void, context?: any): this; + } + + export interface Container { + once(event: "added" | "removed", fn: (displayObject: DisplayObject) => void, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types + once(event: string, fn: Function, context?: any): this; + on(event: "added" | "removed", fn: (displayObject: DisplayObject) => void, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types + on(event: string, fn: Function, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types + off(event: "added" | "removed" | string, fn?: Function, context?: any): this; + } +} + +declare namespace PIXI { + export interface Loader extends utils.EventEmitter { + baseUrl: string; + progress: number; + loading: boolean; + defaultQueryString: string; + resources: IResourceDictionary; + concurrency: number; + + add(...params: any[]): this; + //tslint:disable-next-line:ban-types forbidden-types + add(name: string, url: string, options?: ILoaderOptions, cb?: Function): this; + //tslint:disable-next-line:ban-types forbidden-types + add(obj: string | any | any[], options?: ILoaderOptions, cb?: Function): this; + + //tslint:disable-next-line:ban-types forbidden-types + pre(fn: Function): this; + //tslint:disable-next-line:ban-types forbidden-types + use(fn: Function): this; + reset(): this; + //tslint:disable-next-line:ban-types forbidden-types + load(cb?: Function): this; + + destroy(): void; + + // depreciation + + on(event: "complete", fn: (loader: Loader, object: any) => void, context?: any): this; + on(event: "error", fn: (error: Error, loader: Loader, resource: LoaderResource) => void, context?: any): this; + on(event: "load" | "progress", fn: (loader: Loader, resource: LoaderResource) => void, context?: any): this; + on(event: "start", fn: (loader: Loader) => void, context?: any): this; + + once(event: "complete", fn: (loader: Loader, object: any) => void, context?: any): this; + once(event: "error", fn: (error: Error, loader: Loader, resource: LoaderResource) => void, context?: any): this; + once(event: "load" | "progress", fn: (loader: Loader, resource: LoaderResource) => void, context?: any): this; + once(event: "start", fn: (loader: Loader) => void, context?: any): this; + //tslint:disable-next-line:ban-types forbidden-types + off(event: "complete" | "error" | "load" | "progress" | "start" | string, fn?: Function, context?: any): this; + + } + + export interface IResourceDictionary { + [index: string]: LoaderResource; + } + + export interface ITextureDictionary { + [index: string]: Texture; + } + + export interface ILoaderOptions { + crossOrigin?: boolean | string; + loadType?: number; + xhrType?: string; + metaData?: { + loadElement?: HTMLImageElement | HTMLAudioElement | HTMLVideoElement; + skipSource?: boolean; + mimeType?: string | string[]; + }; + } + + export interface LoaderResource { + name: string; + url: string; + extension: string; + data: any; + crossOrigin: boolean | string; + loadType: number; + xhrType: string; + metadata: any; + error: Error; + xhr: XMLHttpRequest | null; + children: LoaderResource[]; + type: number; + progressChunk: number; + isDataUrl: boolean; + isComplete: boolean; + isLoading: boolean; + complete(): void; + abort(message?: string): void; + //tslint:disable-next-line:ban-types forbidden-types + load(cb?: Function): void; + texture: Texture; + spineAtlas: any; + spineData: any; + spritesheet?: Spritesheet; + textures?: ITextureDictionary; + } + + namespace LoaderResource { + function setExtensionLoadType(extname: string, loadType: number): void; + function setExtensionXhrType(extname: string, xhrType: string): void; + + export enum STATUS_FLAGS { + NONE = 0, + DATA_URL = (1 << 0), + COMPLETE = (1 << 1), + LOADING = (1 << 2), + } + + export enum TYPE { + UNKNOWN = 0, + JSON = 1, + XML = 2, + IMAGE = 3, + AUDIO = 4, + VIDEO = 5, + TEXT = 6, + } + + export enum LOAD_TYPE { + + /** Uses XMLHttpRequest to load the resource. */ + XHR = 1, + /** Uses an `Image` object to load the resource. */ + IMAGE = 2, + /** Uses an `Audio` object to load the resource. */ + AUDIO = 3, + /** Uses a `Video` object to load the resource. */ + VIDEO = 4, + } + + export enum XHR_RESPONSE_TYPE { + /** string */ + DEFAULT = 'text', + /** ArrayBuffer */ + BUFFER = 'arraybuffer', + /** Blob */ + BLOB = 'blob', + /** Document */ + DOCUMENT = 'document', + /** Object */ + JSON = 'json', + /** String */ + TEXT = 'text', + } + + let EMPTY_GIF: string; + } +} + +declare module "pixi.js-legacy" { + export = PIXI; +} \ No newline at end of file diff --git a/Pixi/5.x/out/dragonBones.d.ts b/Pixi/5.x/out/dragonBones.d.ts new file mode 100644 index 00000000..04fb4422 --- /dev/null +++ b/Pixi/5.x/out/dragonBones.d.ts @@ -0,0 +1,6556 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + const enum BinaryOffset { + WeigthBoneCount = 0, + WeigthFloatOffset = 1, + WeigthBoneIndices = 2, + GeometryVertexCount = 0, + GeometryTriangleCount = 1, + GeometryFloatOffset = 2, + GeometryWeightOffset = 3, + GeometryVertexIndices = 4, + TimelineScale = 0, + TimelineOffset = 1, + TimelineKeyFrameCount = 2, + TimelineFrameValueCount = 3, + TimelineFrameValueOffset = 4, + TimelineFrameOffset = 5, + FramePosition = 0, + FrameTweenType = 1, + FrameTweenEasingOrCurveSampleCount = 2, + FrameCurveSamples = 3, + DeformVertexOffset = 0, + DeformCount = 1, + DeformValueCount = 2, + DeformValueOffset = 3, + DeformFloatOffset = 4 + } + /** + * @private + */ + const enum ArmatureType { + Armature = 0, + MovieClip = 1, + Stage = 2 + } + /** + * @private + */ + const enum BoneType { + Bone = 0, + Surface = 1 + } + /** + * @private + */ + const enum DisplayType { + Image = 0, + Armature = 1, + Mesh = 2, + BoundingBox = 3, + Path = 4 + } + /** + * - Bounding box type. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框类型。 + * @version DragonBones 5.0 + * @language zh_CN + */ + const enum BoundingBoxType { + Rectangle = 0, + Ellipse = 1, + Polygon = 2 + } + /** + * @private + */ + const enum ActionType { + Play = 0, + Frame = 10, + Sound = 11 + } + /** + * @private + */ + const enum BlendMode { + Normal = 0, + Add = 1, + Alpha = 2, + Darken = 3, + Difference = 4, + Erase = 5, + HardLight = 6, + Invert = 7, + Layer = 8, + Lighten = 9, + Multiply = 10, + Overlay = 11, + Screen = 12, + Subtract = 13 + } + /** + * @private + */ + const enum TweenType { + None = 0, + Line = 1, + Curve = 2, + QuadIn = 3, + QuadOut = 4, + QuadInOut = 5 + } + /** + * @private + */ + const enum TimelineType { + Action = 0, + ZOrder = 1, + BoneAll = 10, + BoneTranslate = 11, + BoneRotate = 12, + BoneScale = 13, + Surface = 50, + BoneAlpha = 60, + SlotDisplay = 20, + SlotColor = 21, + SlotDeform = 22, + SlotZIndex = 23, + SlotAlpha = 24, + IKConstraint = 30, + AnimationProgress = 40, + AnimationWeight = 41, + AnimationParameter = 42 + } + /** + * - Offset mode. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 偏移模式。 + * @version DragonBones 5.5 + * @language zh_CN + */ + const enum OffsetMode { + None = 0, + Additive = 1, + Override = 2 + } + /** + * - Animation fade out mode. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出模式。 + * @version DragonBones 4.5 + * @language zh_CN + */ + const enum AnimationFadeOutMode { + /** + * - Fade out the animation states of the same layer. + * @language en_US + */ + /** + * - 淡出同层的动画状态。 + * @language zh_CN + */ + SameLayer = 1, + /** + * - Fade out the animation states of the same group. + * @language en_US + */ + /** + * - 淡出同组的动画状态。 + * @language zh_CN + */ + SameGroup = 2, + /** + * - Fade out the animation states of the same layer and group. + * @language en_US + */ + /** + * - 淡出同层并且同组的动画状态。 + * @language zh_CN + */ + SameLayerAndGroup = 3, + /** + * - Fade out of all animation states. + * @language en_US + */ + /** + * - 淡出所有的动画状态。 + * @language zh_CN + */ + All = 4, + /** + * - Does not replace the animation state with the same name. + * @language en_US + */ + /** + * - 不替换同名的动画状态。 + * @language zh_CN + */ + Single = 5 + } + /** + * @private + */ + const enum AnimationBlendType { + None = 0, + E1D = 1 + } + /** + * @private + */ + const enum AnimationBlendMode { + Additive = 0, + Override = 1 + } + /** + * @private + */ + const enum ConstraintType { + IK = 0, + Path = 1 + } + /** + * @private + */ + const enum PositionMode { + Fixed = 0, + Percent = 1 + } + /** + * @private + */ + const enum SpacingMode { + Length = 0, + Fixed = 1, + Percent = 2 + } + /** + * @private + */ + const enum RotateMode { + Tangent = 0, + Chain = 1, + ChainScale = 2 + } + /** + * @private + */ + interface Map { + [key: string]: T; + } + /** + * @private + */ + class DragonBones { + static readonly VERSION: string; + static yDown: boolean; + static debug: boolean; + static debugDraw: boolean; + private readonly _clock; + private readonly _events; + private readonly _objects; + private _eventManager; + constructor(eventManager: IEventDispatcher); + advanceTime(passedTime: number): void; + bufferEvent(value: EventObject): void; + bufferObject(object: BaseObject): void; + readonly clock: WorldClock; + readonly eventManager: IEventDispatcher; + } +} +declare var __extends: any; +declare var exports: any; +declare var module: any; +declare var define: any; +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The BaseObject is the base class for all objects in the DragonBones framework. + * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 基础对象,通常 DragonBones 的对象都继承自该类。 + * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。 + * @version DragonBones 4.5 + * @language zh_CN + */ + abstract class BaseObject { + private static _hashCode; + private static _defaultMaxCount; + private static readonly _maxCountMap; + private static readonly _poolsMap; + private static _returnObject; + static toString(): string; + /** + * - Set the maximum cache count of the specify object pool. + * @param objectConstructor - The specify class. (Set all object pools max cache count if not set) + * @param maxCount - Max count. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 设置特定对象池的最大缓存数量。 + * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量) + * @param maxCount - 最大缓存数量。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static setMaxCount(objectConstructor: (typeof BaseObject) | null, maxCount: number): void; + /** + * - Clear the cached instances of a specify object pool. + * @param objectConstructor - Specify class. (Clear all cached instances if not set) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除特定对象池的缓存实例。 + * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例) + * @version DragonBones 4.5 + * @language zh_CN + */ + static clearPool(objectConstructor?: (typeof BaseObject) | null): void; + /** + * - Get an instance of the specify class from object pool. + * @param objectConstructor - The specify class. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从对象池中获取特定类的实例。 + * @param objectConstructor - 特定的类。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static borrowObject(objectConstructor: { + new (): T; + }): T; + /** + * - A unique identification number assigned to the object. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分配给此实例的唯一标识号。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly hashCode: number; + private _isInPool; + protected abstract _onClear(): void; + /** + * - Clear the object and return it back to object pool。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除该实例的所有数据并将其返还对象池。 + * @version DragonBones 4.5 + * @language zh_CN + */ + returnToPool(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - 2D Transform matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 转换矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Matrix { + /** + * - The value that affects the positioning of pixels along the x axis when scaling or rotating an image. + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 缩放或旋转图像时影响像素沿 x 轴定位的值。 + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + a: number; + /** + * - The value that affects the positioning of pixels along the y axis when rotating or skewing an image. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转或倾斜图像时影响像素沿 y 轴定位的值。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + b: number; + /** + * - The value that affects the positioning of pixels along the x axis when rotating or skewing an image. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转或倾斜图像时影响像素沿 x 轴定位的值。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + c: number; + /** + * - The value that affects the positioning of pixels along the y axis when scaling or rotating an image. + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 缩放或旋转图像时影响像素沿 y 轴定位的值。 + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + d: number; + /** + * - The distance by which to translate each point along the x axis. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 沿 x 轴平移每个点的距离。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + tx: number; + /** + * - The distance by which to translate each point along the y axis. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 沿 y 轴平移每个点的距离。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + ty: number; + /** + * @private + */ + constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number); + toString(): string; + /** + * @private + */ + copyFrom(value: Matrix): Matrix; + /** + * @private + */ + copyFromArray(value: Array, offset?: number): Matrix; + /** + * - Convert to unit matrix. + * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为单位矩阵。 + * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + identity(): Matrix; + /** + * - Multiplies the current matrix with another matrix. + * @param value - The matrix that needs to be multiplied. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将当前矩阵与另一个矩阵相乘。 + * @param value - 需要相乘的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + concat(value: Matrix): Matrix; + /** + * - Convert to inverse matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为逆矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + invert(): Matrix; + /** + * - Apply a matrix transformation to a specific point. + * @param x - X coordinate. + * @param y - Y coordinate. + * @param result - The point after the transformation is applied. + * @param delta - Whether to ignore tx, ty's conversion to point. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将矩阵转换应用于特定点。 + * @param x - 横坐标。 + * @param y - 纵坐标。 + * @param result - 应用转换之后的点。 + * @param delta - 是否忽略 tx,ty 对点的转换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + transformPoint(x: number, y: number, result: { + x: number; + y: number; + }, delta?: boolean): void; + /** + * @private + */ + transformRectangle(rectangle: { + x: number; + y: number; + width: number; + height: number; + }, delta?: boolean): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - 2D Transform. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 变换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Transform { + /** + * @private + */ + static readonly PI: number; + /** + * @private + */ + static readonly PI_D: number; + /** + * @private + */ + static readonly PI_H: number; + /** + * @private + */ + static readonly PI_Q: number; + /** + * @private + */ + static readonly RAD_DEG: number; + /** + * @private + */ + static readonly DEG_RAD: number; + /** + * @private + */ + static normalizeRadian(value: number): number; + /** + * - Horizontal translate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 水平位移。 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - Vertical translate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 垂直位移。 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - Skew. (In radians) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 倾斜。 (以弧度为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + skew: number; + /** + * - rotation. (In radians) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 旋转。 (以弧度为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + rotation: number; + /** + * - Horizontal Scaling. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 水平缩放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + scaleX: number; + /** + * - Vertical scaling. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 垂直缩放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + scaleY: number; + /** + * @private + */ + constructor(x?: number, y?: number, skew?: number, rotation?: number, scaleX?: number, scaleY?: number); + toString(): string; + /** + * @private + */ + copyFrom(value: Transform): Transform; + /** + * @private + */ + identity(): Transform; + /** + * @private + */ + add(value: Transform): Transform; + /** + * @private + */ + minus(value: Transform): Transform; + /** + * @private + */ + fromMatrix(matrix: Matrix): Transform; + /** + * @private + */ + toMatrix(matrix: Matrix): Transform; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class ColorTransform { + alphaMultiplier: number; + redMultiplier: number; + greenMultiplier: number; + blueMultiplier: number; + alphaOffset: number; + redOffset: number; + greenOffset: number; + blueOffset: number; + constructor(alphaMultiplier?: number, redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaOffset?: number, redOffset?: number, greenOffset?: number, blueOffset?: number); + copyFrom(value: ColorTransform): void; + identity(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The Point object represents a location in a two-dimensional coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Point 对象表示二维坐标系统中的某个位置。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Point { + /** + * - The horizontal coordinate. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 该点的水平坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - The vertical coordinate. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 该点的垂直坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @param x - The horizontal coordinate. + * @param y - The vertical coordinate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。 + * @param x - 该对象的x属性值,默认为 0.0。 + * @param y - 该对象的y属性值,默认为 0.0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(x?: number, y?: number); + /** + * @private + */ + copyFrom(value: Point): void; + /** + * @private + */ + clear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its + * width and its height.
+ * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of + * one property has no effect on the others. However, the right and bottom properties are integrally related to those + * four properties. For example, if you change the value of the right property, the value of the width property changes; + * if you change the bottom property, the value of the height property changes. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
+ * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 + * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width + * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class Rectangle { + /** + * - The x coordinate of the top-left corner of the rectangle. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形左上角的 x 坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + x: number; + /** + * - The y coordinate of the top-left corner of the rectangle. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形左上角的 y 坐标。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + y: number; + /** + * - The width of the rectangle, in pixels. + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 矩形的宽度(以像素为单位)。 + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + width: number; + /** + * - 矩形的高度(以像素为单位)。 + * @default 0.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - The height of the rectangle, in pixels. + * @default 0.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + height: number; + /** + * @private + */ + constructor(x?: number, y?: number, width?: number, height?: number); + /** + * @private + */ + copyFrom(value: Rectangle): void; + /** + * @private + */ + clear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The user custom data. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 用户自定义数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + class UserData extends BaseObject { + static toString(): string; + /** + * - The custom int numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly ints: Array; + /** + * - The custom float numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly floats: Array; + /** + * - The custom strings. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly strings: Array; + protected _onClear(): void; + /** + * - Get the custom int number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getInt(index?: number): number; + /** + * - Get the custom float number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getFloat(index?: number): number; + /** + * - Get the custom string. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + getString(index?: number): string; + } + /** + * @private + */ + class ActionData extends BaseObject { + static toString(): string; + type: ActionType; + name: string; + bone: BoneData | null; + slot: SlotData | null; + data: UserData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The DragonBones data. + * A DragonBones data contains multiple armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据。 + * 一个龙骨数据包含多个骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + class DragonBonesData extends BaseObject { + static toString(): string; + /** + * @private + */ + autoSearch: boolean; + /** + * - The animation frame rate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画帧频。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameRate: number; + /** + * - The data version. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 数据版本。 + * @version DragonBones 3.0 + * @language zh_CN + */ + version: string; + /** + * - The DragonBones data name. + * The name is consistent with the DragonBones project name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据名称。 + * 该名称与龙骨项目名保持一致。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + stage: ArmatureData | null; + /** + * - All armature data names. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly armatureNames: Array; + /** + * @private + */ + readonly armatures: Map; + /** + * @private + */ + userData: UserData | null; + protected _onClear(): void; + /** + * - Get a specific armature data. + * @param armatureName - The armature data name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param armatureName - 骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getArmature(armatureName: string): ArmatureData | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The armature data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class ArmatureData extends BaseObject { + static toString(): string; + /** + * @private + */ + type: ArmatureType; + /** + * - The animation frame rate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画帧率。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameRate: number; + /** + * @private + */ + cacheFrameRate: number; + /** + * @private + */ + scale: number; + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly aabb: Rectangle; + /** + * - The names of all the animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的动画数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animationNames: Array; + /** + * @private + */ + readonly sortedBones: Array; + /** + * @private + */ + readonly sortedSlots: Array; + /** + * @private + */ + readonly defaultActions: Array; + /** + * @private + */ + readonly actions: Array; + /** + * @private + */ + readonly bones: Map; + /** + * @private + */ + readonly slots: Map; + /** + * @private + */ + readonly constraints: Map; + /** + * @private + */ + readonly skins: Map; + /** + * @private + */ + readonly animations: Map; + /** + * - The default skin data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 默认插槽数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + defaultSkin: SkinData | null; + /** + * - The default animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 默认动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + defaultAnimation: AnimationData | null; + /** + * @private + */ + canvas: CanvasData | null; + /** + * @private + */ + userData: UserData | null; + /** + * @private + */ + parent: DragonBonesData; + protected _onClear(): void; + /** + * - Get a specific done data. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼数据。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getBone(boneName: string): BoneData | null; + /** + * - Get a specific slot data. + * @param slotName - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽数据。 + * @param slotName - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlot(slotName: string): SlotData | null; + /** + * @private + */ + getConstraint(constraintName: string): ConstraintData | null; + /** + * - Get a specific skin data. + * @param skinName - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定皮肤数据。 + * @param skinName - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getSkin(skinName: string): SkinData | null; + /** + * @private + */ + getMesh(skinName: string, slotName: string, meshName: string): MeshDisplayData | null; + /** + * - Get a specific animation data. + * @param animationName - The animation animationName. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的动画数据。 + * @param animationName - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + getAnimation(animationName: string): AnimationData | null; + } + /** + * - The bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class BoneData extends BaseObject { + static toString(): string; + /** + * @private + */ + inheritTranslation: boolean; + /** + * @private + */ + inheritRotation: boolean; + /** + * @private + */ + inheritScale: boolean; + /** + * @private + */ + inheritReflection: boolean; + /** + * @private + */ + type: BoneType; + /** + * - The bone length. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼长度。 + * @version DragonBones 3.0 + * @language zh_CN + */ + length: number; + /** + * @private + */ + alpha: number; + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly transform: Transform; + /** + * @private + */ + userData: UserData | null; + /** + * - The parent bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 父骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + parent: BoneData | null; + protected _onClear(): void; + } + /** + * - The slot data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class SlotData extends BaseObject { + static toString(): string; + /** + * @private + */ + blendMode: BlendMode; + /** + * @private + */ + displayIndex: number; + /** + * @private + */ + zOrder: number; + /** + * @private + */ + zIndex: number; + /** + * @private + */ + alpha: number; + /** + * - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + color: ColorTransform; + /** + * @private + */ + userData: UserData | null; + /** + * - The parent bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 父骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + parent: BoneData; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + abstract class ConstraintData extends BaseObject { + order: number; + name: string; + type: ConstraintType; + target: BoneData; + root: BoneData; + bone: BoneData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class CanvasData extends BaseObject { + static toString(): string; + hasBackground: boolean; + color: number; + x: number; + y: number; + width: number; + height: number; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The skin data, typically a armature data instance contains at least one skinData. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class SkinData extends BaseObject { + static toString(): string; + /** + * - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly displays: Map>; + /** + * @private + */ + parent: ArmatureData; + protected _onClear(): void; + /** + * @private + */ + getDisplay(slotName: string, displayName: string): DisplayData | null; + /** + * @private + */ + getDisplays(slotName: string): Array | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class GeometryData { + isShared: boolean; + inheritDeform: boolean; + offset: number; + data: DragonBonesData; + weight: WeightData | null; + clear(): void; + shareFrom(value: GeometryData): void; + readonly vertexCount: number; + readonly triangleCount: number; + } + /** + * @private + */ + abstract class DisplayData extends BaseObject { + type: DisplayType; + name: string; + path: string; + readonly transform: Transform; + parent: SkinData; + protected _onClear(): void; + } + /** + * @private + */ + class ImageDisplayData extends DisplayData { + static toString(): string; + readonly pivot: Point; + texture: TextureData | null; + protected _onClear(): void; + } + /** + * @private + */ + class ArmatureDisplayData extends DisplayData { + static toString(): string; + inheritAnimation: boolean; + readonly actions: Array; + armature: ArmatureData | null; + protected _onClear(): void; + /** + * @private + */ + addAction(value: ActionData): void; + } + /** + * @private + */ + class MeshDisplayData extends DisplayData { + static toString(): string; + readonly geometry: GeometryData; + texture: TextureData | null; + protected _onClear(): void; + } + /** + * @private + */ + class BoundingBoxDisplayData extends DisplayData { + static toString(): string; + boundingBox: BoundingBoxData | null; + protected _onClear(): void; + } + /** + * @private + */ + class PathDisplayData extends DisplayData { + static toString(): string; + closed: boolean; + constantSpeed: boolean; + readonly geometry: GeometryData; + readonly curveLengths: Array; + protected _onClear(): void; + } + /** + * @private + */ + class WeightData extends BaseObject { + static toString(): string; + count: number; + offset: number; + readonly bones: Array; + protected _onClear(): void; + addBone(value: BoneData): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The base class of bounding box data. + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框数据基类。 + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract class BoundingBoxData extends BaseObject { + /** + * - The bounding box type. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框类型。 + * @version DragonBones 5.0 + * @language zh_CN + */ + type: BoundingBoxType; + /** + * @private + */ + color: number; + /** + * @private + */ + width: number; + /** + * @private + */ + height: number; + protected _onClear(): void; + /** + * - Check whether the bounding box contains a specific point. (Local coordinate system) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查边界框是否包含特定点。(本地坐标系) + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract containsPoint(pX: number, pY: number): boolean; + /** + * - Check whether the bounding box intersects a specific segment. (Local coordinate system) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查边界框是否与特定线段相交。(本地坐标系) + * @version DragonBones 5.0 + * @language zh_CN + */ + abstract intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA: { + x: number; + y: number; + } | null, intersectionPointB: { + x: number; + y: number; + } | null, normalRadians: { + x: number; + y: number; + } | null): number; + } + /** + * - The rectangle bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 矩形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class RectangleBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * - Compute the bit code for a point (x, y) using the clip rectangle + */ + private static _computeOutCode; + /** + * @private + */ + static rectangleIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xMin: number, yMin: number, xMax: number, yMax: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } + /** + * - The ellipse bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 椭圆边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class EllipseBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * @private + */ + static ellipseIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xC: number, yC: number, widthH: number, heightH: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } + /** + * - The polygon bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + class PolygonBoundingBoxData extends BoundingBoxData { + static toString(): string; + /** + * @private + */ + static polygonIntersectsSegment(xA: number, yA: number, xB: number, yB: number, vertices: Array, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + /** + * @private + */ + x: number; + /** + * @private + */ + y: number; + /** + * - The polygon vertices. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形顶点。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly vertices: Array; + protected _onClear(): void; + /** + * @inheritDoc + */ + containsPoint(pX: number, pY: number): boolean; + /** + * @inheritDoc + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class AnimationData extends BaseObject { + static toString(): string; + /** + * @private + */ + blendType: AnimationBlendType; + /** + * - The frame count of the animation. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的帧数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + frameCount: number; + /** + * - The play times of the animation. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The duration of the animation. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的持续时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + duration: number; + /** + * @private + */ + scale: number; + /** + * - The fade in time of the animation. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画的淡入时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + fadeInTime: number; + /** + * @private + */ + cacheFrameRate: number; + /** + * - The animation name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * @private + */ + readonly cachedFrames: Array; + /** + * @private + */ + readonly boneTimelines: Map>; + /** + * @private + */ + readonly slotTimelines: Map>; + /** + * @private + */ + readonly constraintTimelines: Map>; + /** + * @private + */ + readonly animationTimelines: Map>; + /** + * @private + */ + readonly boneCachedFrameIndices: Map>; + /** + * @private + */ + readonly slotCachedFrameIndices: Map>; + /** + * @private + */ + actionTimeline: TimelineData | null; + /** + * @private + */ + zOrderTimeline: TimelineData | null; + /** + * @private + */ + parent: ArmatureData; + protected _onClear(): void; + /** + * @private + */ + addBoneTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addSlotTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addConstraintTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + addAnimationTimeline(timelineName: string, timeline: TimelineData): void; + /** + * @private + */ + getBoneTimelines(timelineName: string): Array | null; + /** + * @private + */ + getSlotTimelines(timelineName: string): Array | null; + /** + * @private + */ + getConstraintTimelines(timelineName: string): Array | null; + /** + * @private + */ + getAnimationTimelines(timelineName: string): Array | null; + /** + * @private + */ + getBoneCachedFrameIndices(boneName: string): Array | null; + /** + * @private + */ + getSlotCachedFrameIndices(slotName: string): Array | null; + } + /** + * @private + */ + class TimelineData extends BaseObject { + static toString(): string; + type: TimelineType; + offset: number; + frameIndicesOffset: number; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation config is used to describe all the information needed to play an animation state. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画配置用来描述播放一个动画状态所需要的全部信息。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + class AnimationConfig extends BaseObject { + static toString(): string; + /** + * @private + */ + pauseFadeOut: boolean; + /** + * - Fade out the pattern of other animation states when the animation state is fade in. + * This property is typically used to specify the substitution of multiple animation states blend. + * @default dragonBones.AnimationFadeOutMode.All + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 淡入动画状态时淡出其他动画状态的模式。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @default dragonBones.AnimationFadeOutMode.All + * @version DragonBones 5.0 + * @language zh_CN + */ + fadeOutMode: AnimationFadeOutMode; + /** + * @private + */ + fadeOutTweenType: TweenType; + /** + * @private + */ + fadeOutTime: number; + /** + * @private + */ + pauseFadeIn: boolean; + /** + * @private + */ + actionEnabled: boolean; + /** + * @private + */ + additive: boolean; + /** + * - Whether the animation state has control over the display property of the slots. + * Sometimes blend a animation state does not want it to control the display properties of the slots, + * especially if other animation state are controlling the display properties of the slots. + * @default true + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态是否对插槽的显示对象属性有控制权。 + * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, + * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 + * @default true + * @version DragonBones 5.0 + * @language zh_CN + */ + displayControl: boolean; + /** + * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. + * This property should usually be set to false when blend multiple animation states. + * @default true + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 + * 通常在混合多个动画状态时应该将该属性设置为 false。 + * @default true + * @version DragonBones 5.1 + * @language zh_CN + */ + resetToPose: boolean; + /** + * @private + */ + fadeInTweenType: TweenType; + /** + * - The play times. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The blend layer. + * High layer animation state will get the blend weight first. + * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合图层。 + * 图层高的动画状态会优先获取混合权重。 + * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + layer: number; + /** + * - The start time of play. (In seconds) + * @default 0.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 播放的开始时间。 (以秒为单位) + * @default 0.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + position: number; + /** + * - The duration of play. + * [-1: Use the default value of the animation data, 0: Stop play, (0~N]: The duration] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 播放的持续时间。 + * [-1: 使用动画数据默认值, 0: 动画停止, (0~N]: 持续时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + duration: number; + /** + * - The play speed. + * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. + * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度。 + * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 + * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + weight: number; + /** + * - The fade in time. + * [-1: Use the default value of the animation data, [0~N]: The fade in time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 淡入时间。 + * [-1: 使用动画数据默认值, [0~N]: 淡入时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + fadeInTime: number; + /** + * - The auto fade out time when the animation state play completed. + * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态播放完成后的自动淡出时间。 + * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + autoFadeOutTime: number; + /** + * - The name of the animation state. (Can be different from the name of the animation data) + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态名称。 (可以不同于动画数据) + * @version DragonBones 5.0 + * @language zh_CN + */ + name: string; + /** + * - The animation data name. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画数据名称。 + * @version DragonBones 5.0 + * @language zh_CN + */ + animation: string; + /** + * - The blend group name of the animation state. + * This property is typically used to specify the substitution of multiple animation states blend. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合组名称。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + group: string; + /** + * @private + */ + readonly boneMask: Array; + protected _onClear(): void; + /** + * @private + */ + clear(): void; + /** + * @private + */ + copyFrom(value: AnimationConfig): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class TextureAtlasData extends BaseObject { + /** + * @private + */ + autoSearch: boolean; + /** + * @private + */ + width: number; + /** + * @private + */ + height: number; + /** + * @private + */ + scale: number; + /** + * - The texture atlas name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + name: string; + /** + * - The image path of the texture atlas. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集图片路径。 + * @version DragonBones 3.0 + * @language zh_CN + */ + imagePath: string; + /** + * @private + */ + readonly textures: Map; + protected _onClear(): void; + /** + * @private + */ + copyFrom(value: TextureAtlasData): void; + /** + * @private + */ + getTexture(textureName: string): TextureData | null; + } + /** + * @private + */ + abstract class TextureData extends BaseObject { + static createRectangle(): Rectangle; + rotated: boolean; + name: string; + readonly region: Rectangle; + parent: TextureAtlasData; + frame: Rectangle | null; + protected _onClear(): void; + copyFrom(value: TextureData): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The armature proxy interface, the docking engine needs to implement it concretely. + * @see dragonBones.Armature + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 骨架代理接口,对接的引擎需要对其进行具体实现。 + * @see dragonBones.Armature + * @version DragonBones 5.0 + * @language zh_CN + */ + interface IArmatureProxy extends IEventDispatcher { + /** + * - Dispose the instance and the Armature instance. (The Armature instance will return to the object pool) + * @example + *
+         *     removeChild(armatureDisplay);
+         *     armatureDisplay.dispose();
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 释放该实例和骨架。 (骨架会回收到对象池) + * @example + *
+         *     removeChild(armatureDisplay);
+         *     armatureDisplay.dispose();
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + dispose(disposeProxy: boolean): void; + /** + * - The armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly armature: Armature; + /** + * - The animation player. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animation: Animation; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Armature is the core of the skeleton animation system. + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架是骨骼动画系统的核心。 + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + class Armature extends BaseObject implements IAnimatable { + static toString(): string; + private static _onSortSlots; + /** + * - Whether to inherit the animation control of the parent armature. + * True to try to have the child armature play an animation with the same name when the parent armature play the animation. + * @default true + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 是否继承父骨架的动画控制。 + * 如果该值为 true,当父骨架播放动画时,会尝试让子骨架播放同名动画。 + * @default true + * @version DragonBones 4.5 + * @language zh_CN + */ + inheritAnimation: boolean; + /** + * @private + */ + userData: any; + private _slotsDirty; + private _zOrderDirty; + private _flipX; + private _flipY; + private _alpha; + private readonly _bones; + private readonly _slots; + private readonly _actions; + private _animation; + private _proxy; + private _display; + private _replacedTexture; + private _clock; + protected _onClear(): void; + /** + * - Dispose the armature. (Return to the object pool) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 释放骨架。 (回收到对象池) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + dispose(): void; + /** + * @inheritDoc + */ + advanceTime(passedTime: number): void; + /** + * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. + * @param boneName - The bone name. (If not set, all bones will be update) + * @param updateSlot - Whether to update the bone's slots. (Default: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 + * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) + * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + invalidUpdate(boneName?: string | null, updateSlot?: boolean): void; + /** + * - Check whether a specific point is inside a custom bounding box in a slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在某个插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + containsPoint(x: number, y: number): Slot | null; + /** + * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 + * @version DragonBones 5.0 + * @language zh_CN + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): Slot | null; + /** + * - Get a specific bone. + * @param name - The bone name. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼。 + * @param name - 骨骼名称。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBone(name: string): Bone | null; + /** + * - Get a specific bone by the display. + * @param display - The display object. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的骨骼。 + * @param display - 显示对象。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBoneByDisplay(display: any): Bone | null; + /** + * - Get a specific slot. + * @param name - The slot name. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽。 + * @param name - 插槽名称。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlot(name: string): Slot | null; + /** + * - Get a specific slot by the display. + * @param display - The display object. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的插槽。 + * @param display - 显示对象。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlotByDisplay(display: any): Slot | null; + /** + * - Get all bones. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + getBones(): Array; + /** + * - Get all slots. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的插槽。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + getSlots(): Array; + /** + * - Whether to flip the armature horizontally. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架水平翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + flipX: boolean; + /** + * - Whether to flip the armature vertically. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架垂直翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + flipY: boolean; + /** + * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. + * There is a certain amount of memory overhead to improve performance by caching animation data in memory. + * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. + * When the animation cache is turned on, some features will fail, such as the offset property of bone. + * @example + *
+         *     armature.cacheFrameRate = 24;
+         * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 + * @example + *
+         *     armature.cacheFrameRate = 24;
+         * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language zh_CN + */ + cacheFrameRate: number; + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - The armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly armatureData: ArmatureData; + /** + * - The animation player. + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animation: Animation; + /** + * @pivate + */ + readonly proxy: IArmatureProxy; + /** + * - The EventDispatcher instance of the armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架的 EventDispatcher 实例。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly eventDispatcher: IEventDispatcher; + /** + * - The display container. + * The display of the slot is displayed as the parent. + * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 显示容器实例。 + * 插槽的显示对象都会以此显示容器为父级。 + * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly display: any; + /** + * @private + */ + replacedTexture: any; + /** + * @inheritDoc + */ + clock: WorldClock | null; + /** + * - Get the parent slot which the armature belongs to. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架所属的父插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly parent: Slot | null; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + getDisplay(): any; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The base class of the transform object. + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 变换对象的基类。 + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language zh_CN + */ + abstract class TransformObject extends BaseObject { + protected static readonly _helpMatrix: Matrix; + protected static readonly _helpTransform: Transform; + protected static readonly _helpPoint: Point; + /** + * - A matrix relative to the armature coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly globalTransformMatrix: Matrix; + /** + * - A transform relative to the armature coordinate system. + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的变换。 + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly global: Transform; + /** + * - The offset transform relative to the armature or the parent bone coordinate system. + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架或父骨骼坐标系的偏移变换。 + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly offset: Transform; + /** + * @private + */ + origin: Transform | null; + /** + * @private + */ + userData: any; + protected _globalDirty: boolean; + /** + */ + protected _onClear(): void; + /** + * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, + * some engines do not rely on these attributes to update rendering, such as Egret. + * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 + * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + updateGlobalTransform(): void; + /** + * - The armature to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的骨架。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly armature: Armature; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Bone is one of the most important logical units in the armature animation system, + * and is responsible for the realization of translate, rotation, scaling in the animations. + * A armature can contain multiple bones. + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 + * 一个骨架中可以包含多个骨骼。 + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + class Bone extends TransformObject { + static toString(): string; + /** + * - The offset mode. + * @see #offset + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 偏移模式。 + * @see #offset + * @version DragonBones 5.5 + * @language zh_CN + */ + offsetMode: OffsetMode; + protected _localDirty: boolean; + protected _visible: boolean; + protected _cachedFrameIndex: number; + /** + * @private + */ + protected _parent: Bone | null; + protected _onClear(): void; + protected _updateGlobalTransformMatrix(isCache: boolean): void; + /** + * - Forces the bone to update the transform in the next frame. + * When the bone is not animated or its animation state is finished, the bone will not continue to update, + * and when the skeleton must be updated for some reason, the method needs to be called explicitly. + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制骨骼在下一帧更新变换。 + * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + invalidUpdate(): void; + /** + * - Check whether the bone contains a specific bone. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查该骨骼是否包含特定的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + contains(value: Bone): boolean; + /** + * - The bone data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly boneData: BoneData; + /** + * - The visible of all slots in the bone. + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 此骨骼所有插槽的可见。 + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language zh_CN + */ + visible: boolean; + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly parent: Bone | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class DisplayFrame extends BaseObject { + static toString(): string; + rawDisplayData: DisplayData | null; + displayData: DisplayData | null; + textureData: TextureData | null; + display: any | Armature | null; + readonly deformVertices: Array; + protected _onClear(): void; + updateDeformVertices(): void; + getGeometryData(): GeometryData | null; + getBoundingBox(): BoundingBoxData | null; + getTextureData(): TextureData | null; + } + /** + * - The slot attached to the armature, controls the display status and properties of the display object. + * A bone can contain multiple slots. + * A slot can contain multiple display objects, displaying only one of the display objects at a time, + * but you can toggle the display object into frame animation while the animation is playing. + * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, + * and a custom other display object. + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class Slot extends TransformObject { + /** + * - Displays the animated state or mixed group name controlled by the object, set to null to be controlled by all animation states. + * @default null + * @see dragonBones.AnimationState#displayControl + * @see dragonBones.AnimationState#name + * @see dragonBones.AnimationState#group + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 显示对象受到控制的动画状态或混合组名称,设置为 null 则表示受所有的动画状态控制。 + * @default null + * @see dragonBones.AnimationState#displayControl + * @see dragonBones.AnimationState#name + * @see dragonBones.AnimationState#group + * @version DragonBones 4.5 + * @language zh_CN + */ + displayController: string | null; + protected _displayDataDirty: boolean; + protected _displayDirty: boolean; + protected _geometryDirty: boolean; + protected _textureDirty: boolean; + protected _visibleDirty: boolean; + protected _blendModeDirty: boolean; + protected _zOrderDirty: boolean; + protected _transformDirty: boolean; + protected _visible: boolean; + protected _blendMode: BlendMode; + protected _displayIndex: number; + protected _animationDisplayIndex: number; + protected _cachedFrameIndex: number; + protected readonly _localMatrix: Matrix; + protected _boundingBoxData: BoundingBoxData | null; + protected _textureData: TextureData | null; + protected _rawDisplay: any; + protected _meshDisplay: any; + protected _display: any | null; + protected _childArmature: Armature | null; + /** + * @private + */ + protected _parent: Bone; + protected _onClear(): void; + protected abstract _initDisplay(value: any, isRetain: boolean): void; + protected abstract _disposeDisplay(value: any, isRelease: boolean): void; + protected abstract _onUpdateDisplay(): void; + protected abstract _addDisplay(): void; + protected abstract _replaceDisplay(value: any): void; + protected abstract _removeDisplay(): void; + protected abstract _updateZOrder(): void; + protected abstract _updateBlendMode(): void; + protected abstract _updateColor(): void; + protected abstract _updateFrame(): void; + protected abstract _updateMesh(): void; + protected abstract _updateTransform(): void; + protected abstract _identityTransform(): void; + protected _hasDisplay(display: any): boolean; + protected _updateDisplayData(): void; + protected _updateDisplay(): void; + protected _updateGlobalTransformMatrix(isCache: boolean): void; + /** + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + invalidUpdate(): void; + /** + * @private + */ + updateTransformAndMatrix(): void; + /** + * @private + */ + replaceRawDisplayData(displayData: DisplayData | null, index?: number): void; + /** + * @private + */ + replaceDisplayData(displayData: DisplayData | null, index?: number): void; + /** + * @private + */ + replaceTextureData(textureData: TextureData | null, index?: number): void; + /** + * @private + */ + replaceDisplay(value: any | Armature | null, index?: number): void; + /** + * - Check whether a specific point is inside a custom bounding box in the slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + containsPoint(x: number, y: number): boolean; + /** + * - Check whether a specific segment intersects a custom bounding box for the slot. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] + * @version DragonBones 5.0 + * @language zh_CN + */ + intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: { + x: number; + y: number; + } | null, intersectionPointB?: { + x: number; + y: number; + } | null, normalRadians?: { + x: number; + y: number; + } | null): number; + /** + * @private + */ + getDisplayFrameAt(index: number): DisplayFrame; + /** + * - The visible of slot's display object. + * @default true + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 插槽的显示对象的可见。 + * @default true + * @version DragonBones 5.6 + * @language zh_CN + */ + visible: boolean; + /** + * @private + */ + displayFrameCount: number; + /** + * - The index of the display object displayed in the display list. + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     slot.displayIndex = 3;
+         *     slot.displayController = "none";
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 此时显示的显示对象在显示列表中的索引。 + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     slot.displayIndex = 3;
+         *     slot.displayController = "none";
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + displayIndex: number; + /** + * - The slot name. + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly name: string; + /** + * - Contains a display list of display objects or child armatures. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + * @language zh_CN + */ + displayList: Array; + /** + * - The slot data. + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 插槽数据。 + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly slotData: SlotData; + /** + * - The custom bounding box data for the slot at current time. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 插槽此时的自定义包围盒数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly boundingBoxData: BoundingBoxData | null; + /** + * @private + */ + readonly rawDisplay: any; + /** + * @private + */ + readonly meshDisplay: any; + /** + * - The display object that the slot displays at this time. + * @example + *
+         *     let slot = armature.getSlot("text");
+         *     slot.display = new yourEngine.TextField();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的显示对象。 + * @example + *
+         *     let slot = armature.getSlot("text");
+         *     slot.display = new yourEngine.TextField();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + display: any; + /** + * - The child armature that the slot displayed at current time. + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
+         *     }
+         *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的子骨架。 + * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     let prevChildArmature = slot.childArmature;
+         *     if (prevChildArmature) {
+         *         prevChildArmature.dispose();
+         *     }
+         *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + childArmature: Armature | null; + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly parent: Bone; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + getDisplay(): any; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + setDisplay(value: any): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Play animation interface. (Both Armature and Wordclock implement the interface) + * Any instance that implements the interface can be added to the Worldclock instance and advance time by Worldclock instance uniformly. + * @see dragonBones.WorldClock + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放动画接口。 (Armature 和 WordClock 都实现了该接口) + * 任何实现了此接口的实例都可以添加到 WorldClock 实例中,由 WorldClock 实例统一更新时间。 + * @see dragonBones.WorldClock + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + interface IAnimatable { + /** + * - Advance time. + * @param passedTime - Passed time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 更新时间。 + * @param passedTime - 前进的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + advanceTime(passedTime: number): void; + /** + * - The Wordclock instance to which the current belongs. + * @example + *
+         *     armature.clock = factory.clock; // Add armature to clock.
+         *     armature.clock = null; // Remove armature from clock.
+         * 
+ * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 当前所属的 WordClock 实例。 + * @example + *
+         *     armature.clock = factory.clock; // 将骨架添加到时钟。
+         *     armature.clock = null; // 将骨架从时钟移除。
+         * 
+ * @version DragonBones 5.0 + * @language zh_CN + */ + clock: WorldClock | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + class WorldClock implements IAnimatable { + /** + * - Current time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + time: number; + /** + * - The play speed, used to control animation speed-shift play. + * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度,用于控制动画变速播放。 + * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + private _systemTime; + private readonly _animatebles; + private _clock; + /** + * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. + * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 + * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(time?: number); + /** + * - Advance time for all IAnimatable instances. + * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 为所有的 IAnimatable 实例更新时间。 + * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + advanceTime(passedTime: number): void; + /** + * - Check whether contains a specific instance of IAnimatable. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + contains(value: IAnimatable): boolean; + /** + * - Add IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + add(value: IAnimatable): void; + /** + * - Removes a specified IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + remove(value: IAnimatable): void; + /** + * - Clear all IAnimatable instances. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + clear(): void; + /** + * @inheritDoc + */ + clock: WorldClock | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation player is used to play the animation data and manage the animation states. + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器用来播放动画数据和管理动画状态。 + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + class Animation extends BaseObject { + static toString(): string; + /** + * - The play speed of all animations. [0: Stop, (0~1): Slow, 1: Normal, (1~N): Fast] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有动画的播放速度。 [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * Update bones and slots cachedFrameIndices. + */ + private _animationDirty; + private _inheritTimeScale; + private readonly _animationNames; + private readonly _animationStates; + private readonly _animations; + private readonly _blendStates; + private _armature; + private _animationConfig; + private _lastAnimationState; + protected _onClear(): void; + private _fadeOut; + /** + * - Clear all animations states. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除所有的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + reset(): void; + /** + * - Pause a specific animation state. + * @param animationName - The name of animation state. (If not set, it will pause all animations) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停指定动画状态的播放。 + * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + stop(animationName?: string | null): void; + /** + * - Play animation with a specific animation config. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @param animationConfig - The animation config. + * @returns The playing animation state. + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 通过指定的动画配置来播放动画。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @param animationConfig - 动画配置。 + * @returns 播放的动画状态。 + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + playConfig(animationConfig: AnimationConfig): AnimationState | null; + /** + * - Play a specific animation. + * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) + * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放指定动画。 + * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + play(animationName?: string | null, playTimes?: number): AnimationState | null; + /** + * - Fade in a specific animation. + * @param animationName - The name of animation data. + * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) + * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) + * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) + * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 淡入播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) + * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) + * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + fadeIn(animationName: string, fadeInTime?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode): AnimationState | null; + /** + * - Play a specific animation from the specific time. + * @param animationName - The name of animation data. + * @param time - The start time point of playing. (In seconds) + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定时间开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param time - 播放开始的时间。 (以秒为单位) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByTime(animationName: string, time?: number, playTimes?: number): AnimationState | null; + /** + * - Play a specific animation from the specific frame. + * @param animationName - The name of animation data. + * @param frame - The start frame of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定帧开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param frame - 播放开始的帧数。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByFrame(animationName: string, frame?: number, playTimes?: number): AnimationState | null; + /** + * - Play a specific animation from the specific progress. + * @param animationName - The name of animation data. + * @param progress - The start progress value of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定进度开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param progress - 开始播放的进度。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndPlayByProgress(animationName: string, progress?: number, playTimes?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific time. + * @param animationName - The name of animation data. + * @param time - The stop time. (In seconds) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定时间停止指定动画播放 + * @param animationName - 动画数据名称。 + * @param time - 停止的时间。 (以秒为单位) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByTime(animationName: string, time?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific frame. + * @param animationName - The name of animation data. + * @param frame - The stop frame. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定帧停止指定动画的播放 + * @param animationName - 动画数据名称。 + * @param frame - 停止的帧数。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByFrame(animationName: string, frame?: number): AnimationState | null; + /** + * - Stop a specific animation at the specific progress. + * @param animationName - The name of animation data. + * @param progress - The stop progress value. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定的进度停止指定的动画播放。 + * @param animationName - 动画数据名称。 + * @param progress - 停止进度。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + gotoAndStopByProgress(animationName: string, progress?: number): AnimationState | null; + /** + * - Get a specific animation state. + * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取指定的动画状态。 + * @param animationName - 动画状态名称。 + * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + getState(animationName: string, layer?: number): AnimationState | null; + /** + * - Check whether a specific animation data is included. + * @param animationName - The name of animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含指定的动画数据 + * @param animationName - 动画数据名称。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + hasAnimation(animationName: string): boolean; + /** + * - Get all the animation states. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取所有的动画状态 + * @version DragonBones 5.1 + * @language zh_CN + */ + getStates(): ReadonlyArray; + /** + * - Check whether there is an animation state is playing + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否有动画状态正在播放 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isPlaying: boolean; + /** + * - Check whether all the animation states' playing were finished. + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否所有的动画状态均已播放完毕。 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isCompleted: boolean; + /** + * - The name of the last playing animation state. + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态名称 + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly lastAnimationName: string; + /** + * - The name of all animation data + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有动画数据的名称 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly animationNames: ReadonlyArray; + /** + * - All animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有的动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + animations: Map; + /** + * - An AnimationConfig instance that can be used quickly. + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 一个可以快速使用的动画配置实例。 + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language zh_CN + */ + readonly animationConfig: AnimationConfig; + /** + * - The last playing animation state + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly lastAnimationState: AnimationState | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The animation state is generated when the animation data is played. + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画状态由播放动画数据时产生。 + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + class AnimationState extends BaseObject { + static toString(): string; + /** + * @private + */ + actionEnabled: boolean; + /** + * @private + */ + additive: boolean; + /** + * - Whether the animation state has control over the display object properties of the slots. + * Sometimes blend a animation state does not want it to control the display object properties of the slots, + * especially if other animation state are controlling the display object properties of the slots. + * @default true + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态是否对插槽的显示对象属性有控制权。 + * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, + * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 + * @default true + * @version DragonBones 5.0 + * @language zh_CN + */ + displayControl: boolean; + /** + * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. + * This property should usually be set to false when blend multiple animation states. + * @default true + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 + * 通常在混合多个动画状态时应该将该属性设置为 false。 + * @default true + * @version DragonBones 5.1 + * @language zh_CN + */ + resetToPose: boolean; + /** + * @private + */ + blendType: AnimationBlendType; + /** + * - The play times. [0: Loop play, [1~N]: Play N times] + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] + * @version DragonBones 3.0 + * @language zh_CN + */ + playTimes: number; + /** + * - The blend layer. + * High layer animation state will get the blend weight first. + * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合图层。 + * 图层高的动画状态会优先获取混合权重。 + * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + layer: number; + /** + * - The play speed. + * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. + * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度。 + * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 + * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + timeScale: number; + /** + * @private + */ + parameterX: number; + /** + * @private + */ + parameterY: number; + /** + * @private + */ + positionX: number; + /** + * @private + */ + positionY: number; + /** + * - The auto fade out time when the animation state play completed. + * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) + * @default -1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态播放完成后的自动淡出时间。 + * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) + * @default -1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + autoFadeOutTime: number; + /** + * @private + */ + fadeTotalTime: number; + /** + * - The name of the animation state. (Can be different from the name of the animation data) + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画状态名称。 (可以不同于动画数据) + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + name: string; + /** + * - The blend group name of the animation state. + * This property is typically used to specify the substitution of multiple animation states blend. + * @readonly + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合组名称。 + * 该属性通常用来指定多个动画状态混合时的相互替换关系。 + * @readonly + * @version DragonBones 5.0 + * @language zh_CN + */ + group: string; + private _timelineDirty; + private _weight; + private _fadeTime; + private _time; + private readonly _boneMask; + private readonly _boneTimelines; + private readonly _boneBlendTimelines; + private readonly _slotTimelines; + private readonly _slotBlendTimelines; + private readonly _constraintTimelines; + private readonly _animationTimelines; + private readonly _poseTimelines; + private _animationData; + private _armature; + private _zOrderTimeline; + private _activeChildA; + private _activeChildB; + protected _onClear(): void; + private _updateTimelines; + private _updateBoneAndSlotTimelines; + private _advanceFadeTime; + /** + * - Continue play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 继续播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + play(): void; + /** + * - Stop play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + stop(): void; + /** + * - Fade out the animation state. + * @param fadeOutTime - The fade out time. (In seconds) + * @param pausePlayhead - Whether to pause the animation playing when fade out. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 淡出动画状态。 + * @param fadeOutTime - 淡出时间。 (以秒为单位) + * @param pausePlayhead - 淡出时是否暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + fadeOut(fadeOutTime: number, pausePlayhead?: boolean): void; + /** + * - Check if a specific bone mask is included. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + containsBoneMask(boneName: string): boolean; + /** + * - Add a specific bone mask. + * @param boneName - The bone name. + * @param recursive - Whether or not to add a mask to the bone's sub-bone. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加特定的骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + addBoneMask(boneName: string, recursive?: boolean): void; + /** + * - Remove the mask of a specific bone. + * @param boneName - The bone name. + * @param recursive - Whether to remove the bone's sub-bone mask. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除特定骨骼的遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + removeBoneMask(boneName: string, recursive?: boolean): void; + /** + * - Remove all bone masks. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + removeAllBoneMask(): void; + /** + * @private + */ + addState(animationState: AnimationState, timelineDatas?: TimelineData[] | null): void; + /** + * - Whether the animation state is fading in. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡入。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeIn: boolean; + /** + * - Whether the animation state is fading out. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡出。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeOut: boolean; + /** + * - Whether the animation state is fade completed. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否淡入或淡出完毕。 + * @version DragonBones 5.1 + * @language zh_CN + */ + readonly isFadeComplete: boolean; + /** + * - Whether the animation state is playing. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否正在播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isPlaying: boolean; + /** + * - Whether the animation state is play completed. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否播放完毕。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly isCompleted: boolean; + /** + * - The times has been played. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 已经循环播放的次数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly currentPlayTimes: number; + /** + * - The total time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 总播放时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly totalTime: number; + /** + * - The time is currently playing. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前播放的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + currentTime: number; + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + /** + * - The animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + weight: number; + /** + * - 动画数据。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + readonly animationData: AnimationData; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The properties of the object carry basic information about an event, + * which are passed as parameter or parameter's parameter to event listeners when an event occurs. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 + * @version DragonBones 4.5 + * @language zh_CN + */ + class EventObject extends BaseObject { + /** + * - Animation start play. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画开始播放。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly START: string; + /** + * - Animation loop play complete once. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画循环播放完成一次。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly LOOP_COMPLETE: string; + /** + * - Animation play complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画播放完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly COMPLETE: string; + /** + * - Animation fade in start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_IN: string; + /** + * - Animation fade in complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_IN_COMPLETE: string; + /** + * - Animation fade out start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_OUT: string; + /** + * - Animation fade out complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FADE_OUT_COMPLETE: string; + /** + * - Animation frame event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly FRAME_EVENT: string; + /** + * - Animation frame sound event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧声音事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + static readonly SOUND_EVENT: string; + static toString(): string; + /** + * - If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 如果是帧事件,此值用来描述该事件在动画时间轴中所处的时间。(以秒为单位) + * @version DragonBones 4.5 + * @language zh_CN + */ + time: number; + /** + * - The event type。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件类型。 + * @version DragonBones 4.5 + * @language zh_CN + */ + type: EventStringType; + /** + * - The event name. (The frame event name or the frame sound name) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件名称。 (帧事件的名称或帧声音的名称) + * @version DragonBones 4.5 + * @language zh_CN + */ + name: string; + /** + * - The armature that dispatch the event. + * @see dragonBones.Armature + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的骨架。 + * @see dragonBones.Armature + * @version DragonBones 4.5 + * @language zh_CN + */ + armature: Armature; + /** + * - The bone that dispatch the event. + * @see dragonBones.Bone + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 4.5 + * @language zh_CN + */ + bone: Bone | null; + /** + * - The slot that dispatch the event. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + slot: Slot | null; + /** + * - The animation state that dispatch the event. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 发出该事件的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + animationState: AnimationState; + /** + * @private + */ + actionData: ActionData | null; + /** + * @private + */ + /** + * - The custom data. + * @see dragonBones.CustomData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义数据。 + * @see dragonBones.CustomData + * @version DragonBones 5.0 + * @language zh_CN + */ + data: UserData | null; + protected _onClear(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + type EventStringType = string | "start" | "loopComplete" | "complete" | "fadeIn" | "fadeInComplete" | "fadeOut" | "fadeOutComplete" | "frameEvent" | "soundEvent"; + /** + * - The event dispatcher interface. + * Dragonbones event dispatch usually relies on docking engine to implement, which defines the event method to be implemented when docking the engine. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件派发接口。 + * DragonBones 的事件派发通常依赖于对接的引擎来实现,该接口定义了对接引擎时需要实现的事件方法。 + * @version DragonBones 4.5 + * @language zh_CN + */ + interface IEventDispatcher { + /** + * - Checks whether the object has any listeners registered for a specific type of event。 + * @param type - Event type. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 检查是否为特定的事件类型注册了任何侦听器。 + * @param type - 事件类型。 + * @version DragonBones 4.5 + * @language zh_CN + */ + hasDBEventListener(type: EventStringType): boolean; + /** + * - Dispatches an event into the event flow. + * @param type - Event type. + * @param eventObject - Event object. + * @see dragonBones.EventObject + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分派特定的事件到事件流中。 + * @param type - 事件类型。 + * @param eventObject - 事件数据。 + * @see dragonBones.EventObject + * @version DragonBones 4.5 + * @language zh_CN + */ + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + /** + * - Add an event listener object so that the listener receives notification of an event. + * @param type - Event type. + * @param listener - Event listener. + * @param thisObject - The listener function's "this". + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 添加特定事件类型的事件侦听器,以使侦听器能够接收事件通知。 + * @param type - 事件类型。 + * @param listener - 事件侦听器。 + * @param thisObject - 侦听函数绑定的 this 对象。 + * @version DragonBones 4.5 + * @language zh_CN + */ + addDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; + /** + * - Removes a listener from the object. + * @param type - Event type. + * @param listener - Event listener. + * @param thisObject - The listener function's "this". + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 删除特定事件类型的侦听器。 + * @param type - 事件类型。 + * @param listener - 事件侦听器。 + * @param thisObject - 侦听函数绑定的 this 对象。 + * @version DragonBones 4.5 + * @language zh_CN + */ + removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + abstract class DataParser { + protected static readonly DATA_VERSION_2_3: string; + protected static readonly DATA_VERSION_3_0: string; + protected static readonly DATA_VERSION_4_0: string; + protected static readonly DATA_VERSION_4_5: string; + protected static readonly DATA_VERSION_5_0: string; + protected static readonly DATA_VERSION_5_5: string; + protected static readonly DATA_VERSION_5_6: string; + protected static readonly DATA_VERSION: string; + protected static readonly DATA_VERSIONS: Array; + protected static readonly TEXTURE_ATLAS: string; + protected static readonly SUB_TEXTURE: string; + protected static readonly FORMAT: string; + protected static readonly IMAGE_PATH: string; + protected static readonly WIDTH: string; + protected static readonly HEIGHT: string; + protected static readonly ROTATED: string; + protected static readonly FRAME_X: string; + protected static readonly FRAME_Y: string; + protected static readonly FRAME_WIDTH: string; + protected static readonly FRAME_HEIGHT: string; + protected static readonly DRADON_BONES: string; + protected static readonly USER_DATA: string; + protected static readonly ARMATURE: string; + protected static readonly CANVAS: string; + protected static readonly BONE: string; + protected static readonly SURFACE: string; + protected static readonly SLOT: string; + protected static readonly CONSTRAINT: string; + protected static readonly SKIN: string; + protected static readonly DISPLAY: string; + protected static readonly FRAME: string; + protected static readonly IK: string; + protected static readonly PATH_CONSTRAINT: string; + protected static readonly ANIMATION: string; + protected static readonly TIMELINE: string; + protected static readonly FFD: string; + protected static readonly TRANSLATE_FRAME: string; + protected static readonly ROTATE_FRAME: string; + protected static readonly SCALE_FRAME: string; + protected static readonly DISPLAY_FRAME: string; + protected static readonly COLOR_FRAME: string; + protected static readonly DEFAULT_ACTIONS: string; + protected static readonly ACTIONS: string; + protected static readonly EVENTS: string; + protected static readonly INTS: string; + protected static readonly FLOATS: string; + protected static readonly STRINGS: string; + protected static readonly TRANSFORM: string; + protected static readonly PIVOT: string; + protected static readonly AABB: string; + protected static readonly COLOR: string; + protected static readonly VERSION: string; + protected static readonly COMPATIBLE_VERSION: string; + protected static readonly FRAME_RATE: string; + protected static readonly TYPE: string; + protected static readonly SUB_TYPE: string; + protected static readonly NAME: string; + protected static readonly PARENT: string; + protected static readonly TARGET: string; + protected static readonly STAGE: string; + protected static readonly SHARE: string; + protected static readonly PATH: string; + protected static readonly LENGTH: string; + protected static readonly DISPLAY_INDEX: string; + protected static readonly Z_ORDER: string; + protected static readonly Z_INDEX: string; + protected static readonly BLEND_MODE: string; + protected static readonly INHERIT_TRANSLATION: string; + protected static readonly INHERIT_ROTATION: string; + protected static readonly INHERIT_SCALE: string; + protected static readonly INHERIT_REFLECTION: string; + protected static readonly INHERIT_ANIMATION: string; + protected static readonly INHERIT_DEFORM: string; + protected static readonly SEGMENT_X: string; + protected static readonly SEGMENT_Y: string; + protected static readonly BEND_POSITIVE: string; + protected static readonly CHAIN: string; + protected static readonly WEIGHT: string; + protected static readonly BLEND_TYPE: string; + protected static readonly FADE_IN_TIME: string; + protected static readonly PLAY_TIMES: string; + protected static readonly SCALE: string; + protected static readonly OFFSET: string; + protected static readonly POSITION: string; + protected static readonly DURATION: string; + protected static readonly TWEEN_EASING: string; + protected static readonly TWEEN_ROTATE: string; + protected static readonly TWEEN_SCALE: string; + protected static readonly CLOCK_WISE: string; + protected static readonly CURVE: string; + protected static readonly SOUND: string; + protected static readonly EVENT: string; + protected static readonly ACTION: string; + protected static readonly X: string; + protected static readonly Y: string; + protected static readonly SKEW_X: string; + protected static readonly SKEW_Y: string; + protected static readonly SCALE_X: string; + protected static readonly SCALE_Y: string; + protected static readonly VALUE: string; + protected static readonly ROTATE: string; + protected static readonly SKEW: string; + protected static readonly ALPHA: string; + protected static readonly ALPHA_OFFSET: string; + protected static readonly RED_OFFSET: string; + protected static readonly GREEN_OFFSET: string; + protected static readonly BLUE_OFFSET: string; + protected static readonly ALPHA_MULTIPLIER: string; + protected static readonly RED_MULTIPLIER: string; + protected static readonly GREEN_MULTIPLIER: string; + protected static readonly BLUE_MULTIPLIER: string; + protected static readonly UVS: string; + protected static readonly VERTICES: string; + protected static readonly TRIANGLES: string; + protected static readonly WEIGHTS: string; + protected static readonly SLOT_POSE: string; + protected static readonly BONE_POSE: string; + protected static readonly BONES: string; + protected static readonly POSITION_MODE: string; + protected static readonly SPACING_MODE: string; + protected static readonly ROTATE_MODE: string; + protected static readonly SPACING: string; + protected static readonly ROTATE_OFFSET: string; + protected static readonly ROTATE_MIX: string; + protected static readonly TRANSLATE_MIX: string; + protected static readonly TARGET_DISPLAY: string; + protected static readonly CLOSED: string; + protected static readonly CONSTANT_SPEED: string; + protected static readonly VERTEX_COUNT: string; + protected static readonly LENGTHS: string; + protected static readonly GOTO_AND_PLAY: string; + protected static readonly DEFAULT_NAME: string; + protected static _getArmatureType(value: string): ArmatureType; + protected static _getBoneType(value: string): BoneType; + protected static _getPositionMode(value: string): PositionMode; + protected static _getSpacingMode(value: string): SpacingMode; + protected static _getRotateMode(value: string): RotateMode; + protected static _getDisplayType(value: string): DisplayType; + protected static _getBoundingBoxType(value: string): BoundingBoxType; + protected static _getBlendMode(value: string): BlendMode; + protected static _getAnimationBlendType(value: string): AnimationBlendType; + protected static _getActionType(value: string): ActionType; + abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null; + abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + const enum FrameValueType { + Step = 0, + Int = 1, + Float = 2 + } + /** + * @private + */ + class ObjectDataParser extends DataParser { + protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean; + protected static _getNumber(rawData: any, key: string, defaultValue: number): number; + protected static _getString(rawData: any, key: string, defaultValue: string): string; + protected _rawTextureAtlasIndex: number; + protected readonly _rawBones: Array; + protected _data: DragonBonesData; + protected _armature: ArmatureData; + protected _bone: BoneData; + protected _geometry: GeometryData; + protected _slot: SlotData; + protected _skin: SkinData; + protected _mesh: MeshDisplayData; + protected _animation: AnimationData; + protected _timeline: TimelineData; + protected _rawTextureAtlases: Array | null; + private _frameValueType; + private _defaultColorOffset; + private _prevClockwise; + private _prevRotation; + private _frameDefaultValue; + private _frameValueScale; + private readonly _helpMatrixA; + private readonly _helpMatrixB; + private readonly _helpTransform; + private readonly _helpColorTransform; + private readonly _helpPoint; + private readonly _helpArray; + private readonly _intArray; + private readonly _floatArray; + private readonly _frameIntArray; + private readonly _frameFloatArray; + private readonly _frameArray; + private readonly _timelineArray; + private readonly _colorArray; + private readonly _cacheRawMeshes; + private readonly _cacheMeshes; + private readonly _actionFrames; + private readonly _weightSlotPose; + private readonly _weightBonePoses; + private readonly _cacheBones; + private readonly _slotChildActions; + private _getCurvePoint; + private _samplingEasingCurve; + private _parseActionDataInFrame; + private _mergeActionFrame; + protected _parseArmature(rawData: any, scale: number): ArmatureData; + protected _parseBone(rawData: any): BoneData; + protected _parseIKConstraint(rawData: any): ConstraintData | null; + protected _parsePathConstraint(rawData: any): ConstraintData | null; + protected _parseSlot(rawData: any, zOrder: number): SlotData; + protected _parseSkin(rawData: any): SkinData; + protected _parseDisplay(rawData: any): DisplayData | null; + protected _parsePath(rawData: any, display: PathDisplayData): void; + protected _parsePivot(rawData: any, display: ImageDisplayData): void; + protected _parseMesh(rawData: any, mesh: MeshDisplayData): void; + protected _parseBoundingBox(rawData: any): BoundingBoxData | null; + protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData; + protected _parseAnimation(rawData: any): AnimationData; + protected _parseTimeline(rawData: any, rawFrames: Array | null, framesKey: string, timelineType: TimelineType, frameValueType: FrameValueType, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number, timeline?: TimelineData | null): TimelineData | null; + protected _parseBoneTimeline(rawData: any): void; + protected _parseSlotTimeline(rawData: any): void; + protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSingleValueFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseDoubleValueFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number; + protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseSlotDeformFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array; + protected _parseDeformFrame(rawData: any, frameStart: number, frameCount: number): number; + protected _parseTransform(rawData: any, transform: Transform, scale: number): void; + protected _parseColorTransform(rawData: any, color: ColorTransform): void; + protected _parseGeometry(rawData: any, geometry: GeometryData): void; + protected _parseArray(rawData: any): void; + protected _modifyArray(): void; + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null; + parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale?: number): boolean; + private static _objectDataParserInstance; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + static getInstance(): ObjectDataParser; + } + /** + * @private + */ + class ActionFrame { + frameStart: number; + readonly actions: Array; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @private + */ + class BinaryDataParser extends ObjectDataParser { + private _binaryOffset; + private _binary; + private _intArrayBuffer; + private _frameArrayBuffer; + private _timelineArrayBuffer; + private _inRange; + private _decodeUTF8; + private _parseBinaryTimeline; + protected _parseAnimation(rawData: any): AnimationData; + protected _parseGeometry(rawData: any, geometry: GeometryData): void; + protected _parseArray(rawData: any): void; + parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null; + private static _binaryDataParserInstance; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + static getInstance(): BinaryDataParser; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) + * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. + * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) + * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 + * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + abstract class BaseFactory { + protected static _objectParser: ObjectDataParser; + protected static _binaryParser: BinaryDataParser; + /** + * @private + */ + autoSearch: boolean; + protected readonly _dragonBonesDataMap: Map; + protected readonly _textureAtlasDataMap: Map>; + protected _dragonBones: DragonBones; + protected _dataParser: DataParser; + /** + * - Create a factory instance. (typically only one global factory instance is required) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) + * @version DragonBones 3.0 + * @language zh_CN + */ + constructor(dataParser?: DataParser | null); + protected _isSupportMesh(): boolean; + protected _getTextureData(textureAtlasName: string, textureName: string): TextureData | null; + protected _fillBuildArmaturePackage(dataPackage: BuildArmaturePackage, dragonBonesName: string, armatureName: string, skinName: string, textureAtlasName: string): boolean; + protected _buildBones(dataPackage: BuildArmaturePackage, armature: Armature): void; + /** + * @private + */ + protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void; + protected _buildConstraints(dataPackage: BuildArmaturePackage, armature: Armature): void; + protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, _slot: Slot, displayData: ArmatureDisplayData): Armature | null; + protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, slot: Slot): any; + protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData; + protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature; + protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot; + /** + * - Parse the raw data to a DragonBonesData instance and cache it to the factory. + * @param rawData - The raw data. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for all armatures. (Default: 1.0) + * @returns DragonBonesData instance + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 + * @param rawData - 原始数据。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) + * @returns DragonBonesData 实例 + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language zh_CN + */ + parseDragonBonesData(rawData: any, name?: string | null, scale?: number): DragonBonesData | null; + /** + * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. + * @param rawData - The raw texture atlas data. + * @param textureAtlas - The texture atlas object. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for the map set. (Default: 1.0) + * @returns TextureAtlasData instance + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 + * @param rawData - 原始贴图集数据。 + * @param textureAtlas - 贴图集对象。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) + * @returns TextureAtlasData 实例 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language zh_CN + */ + parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData; + /** + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN + */ + updateTextureAtlases(textureAtlases: Array, name: string): void; + /** + * - Get a specific DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @returns DragonBonesData instance + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 DragonBonesData 实例。 + * @param name - DragonBonesData 实例的缓存名称。 + * @returns DragonBonesData 实例 + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + getDragonBonesData(name: string): DragonBonesData | null; + /** + * - Cache a DragonBonesData instance to the factory. + * @param data - The DragonBonesData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 DragonBonesData 实例缓存到工厂中。 + * @param data - DragonBonesData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + addDragonBonesData(data: DragonBonesData, name?: string | null): void; + /** + * - Remove a DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @param disposeData - Whether to dispose data. (Default: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 DragonBonesData 实例。 + * @param name - DragonBonesData 实例缓存名称。 + * @param disposeData - 是否释放数据。 (默认: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + removeDragonBonesData(name: string, disposeData?: boolean): void; + /** + * - Get a list of specific TextureAtlasData instances. + * @param name - The TextureAtlasData cahce name. + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 TextureAtlasData 实例列表。 + * @param name - TextureAtlasData 实例缓存名称。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + getTextureAtlasData(name: string): Array | null; + /** + * - Cache a TextureAtlasData instance to the factory. + * @param data - The TextureAtlasData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 TextureAtlasData 实例缓存到工厂中。 + * @param data - TextureAtlasData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + addTextureAtlasData(data: TextureAtlasData, name?: string | null): void; + /** + * - Remove a TextureAtlasData instance. + * @param name - The TextureAtlasData instance cache name. + * @param disposeData - Whether to dispose data. + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 TextureAtlasData 实例。 + * @param name - TextureAtlasData 实例的缓存名称。 + * @param disposeData - 是否释放数据。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + removeTextureAtlasData(name: string, disposeData?: boolean): void; + /** + * - Get a specific armature data. + * @param name - The armature data name. + * @param dragonBonesName - The cached name for DragonbonesData instance. + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param name - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language zh_CN + */ + getArmatureData(name: string, dragonBonesName?: string): ArmatureData | null; + /** + * - Clear all cached DragonBonesData instances and TextureAtlasData instances. + * @param disposeData - Whether to dispose data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 + * @param disposeData - 是否释放数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + clear(disposeData?: boolean): void; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. + * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature. + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 + * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架。 + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + buildArmature(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): Armature | null; + /** + * @private + */ + replaceDisplay(slot: Slot, displayData: DisplayData | null, displayIndex?: number): void; + /** + * - Replaces the current display data for a particular slot with a specific display data. + * Specify display data with "dragonBonesName/armatureName/slotName/displayName". + * @param dragonBonesName - The DragonBonesData instance cache name. + * @param armatureName - The armature data name. + * @param slotName - The slot data name. + * @param displayName - The display data name. + * @param slot - The slot. + * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 + * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @param armatureName - 骨架数据名称。 + * @param slotName - 插槽数据名称。 + * @param displayName - 显示对象数据名称。 + * @param slot - 插槽。 + * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + replaceSlotDisplay(dragonBonesName: string, armatureName: string, slotName: string, displayName: string, slot: Slot, displayIndex?: number): boolean; + /** + * @private + */ + replaceSlotDisplayList(dragonBonesName: string | null, armatureName: string, slotName: string, slot: Slot): boolean; + /** + * - Share specific skin data with specific armature. + * @param armature - The armature. + * @param skin - The skin data. + * @param isOverride - Whether it completely override the original skin. (Default: false) + * @param exclude - A list of slot names that do not need to be replace. + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 将特定的皮肤数据共享给特定的骨架使用。 + * @param armature - 骨架。 + * @param skin - 皮肤数据。 + * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) + * @param exclude - 不需要被替换的插槽名称列表。 + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language zh_CN + */ + replaceSkin(armature: Armature, skin: SkinData, isOverride?: boolean, exclude?: Array | null): boolean; + /** + * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. + * This enables you to make a armature template so that other armature without animations can share it's animations. + * @param armature - The armtaure. + * @param armatureData - The armature data. + * @param isOverride - Whether to completely overwrite the original animation. (Default: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 + * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 + * @param armature - 骨架。 + * @param armatureData - 骨架数据。 + * @param isOverride - 是否完全覆盖原来的动画。(默认: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language zh_CN + */ + replaceAnimation(armature: Armature, armatureData: ArmatureData, isOverride?: boolean): boolean; + /** + * @private + */ + getAllDragonBonesData(): Map; + /** + * @private + */ + getAllTextureAtlasData(): Map>; + /** + * - An Worldclock instance updated by engine. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 由引擎驱动的 WorldClock 实例。 + * @version DragonBones 5.7 + * @language zh_CN + */ + readonly clock: WorldClock; + /** + * @private + */ + readonly dragonBones: DragonBones; + } + /** + * @private + */ + class BuildArmaturePackage { + dataName: string; + textureAtlasName: string; + data: DragonBonesData; + armature: ArmatureData; + skin: SkinData | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The PixiJS texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class PixiTextureAtlasData extends TextureAtlasData { + static toString(): string; + private _renderTexture; + protected _onClear(): void; + /** + * @inheritDoc + */ + createTexture(): TextureData; + /** + * - The PixiJS texture. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 贴图。 + * @version DragonBones 3.0 + * @language zh_CN + */ + renderTexture: PIXI.BaseTexture | null; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * @inheritDoc + */ + class PixiArmatureDisplay extends PIXI.Sprite implements IArmatureProxy { + /** + * @private + */ + debugDraw: boolean; + private _debugDraw; + private _armature; + private _debugDrawer; + /** + * @inheritDoc + */ + dbInit(armature: Armature): void; + /** + * @inheritDoc + */ + dbClear(): void; + /** + * @inheritDoc + */ + dbUpdate(): void; + /** + * @inheritDoc + */ + dispose(disposeProxy?: boolean): void; + /** + * @inheritDoc + */ + destroy(): void; + /** + * @private + */ + dispatchDBEvent(type: EventStringType, eventObject: EventObject): void; + /** + * @inheritDoc + */ + hasDBEventListener(type: EventStringType): boolean; + /** + * @inheritDoc + */ + addDBEventListener(type: EventStringType, listener: (event: EventObject) => void, target: any): void; + /** + * @inheritDoc + */ + removeDBEventListener(type: EventStringType, listener: (event: EventObject) => void, target: any): void; + /** + * @inheritDoc + */ + readonly armature: Armature; + /** + * @inheritDoc + */ + readonly animation: Animation; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The PixiJS slot. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 插槽。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class PixiSlot extends Slot { + static toString(): string; + private _textureScale; + private _renderDisplay; + protected _onClear(): void; + protected _initDisplay(value: any, isRetain: boolean): void; + protected _disposeDisplay(value: any, isRelease: boolean): void; + protected _onUpdateDisplay(): void; + protected _addDisplay(): void; + protected _replaceDisplay(value: any): void; + protected _removeDisplay(): void; + protected _updateZOrder(): void; + protected _updateBlendMode(): void; + protected _updateColor(): void; + protected _updateFrame(): void; + protected _updateMesh(): void; + protected _updateTransform(): void; + protected _updateTransformV3(): void; + protected _updateTransformV4(): void; + protected _identityTransform(): void; + } +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +declare namespace dragonBones { + /** + * - The PixiJS factory. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 工厂。 + * @version DragonBones 3.0 + * @language zh_CN + */ + class PixiFactory extends BaseFactory { + private static _dragonBonesInstance; + private static _factory; + private static _clockHandler; + static advanceTime(passedTime: number): void; + static useSharedTicker: boolean; + /** + * - A global factory instance that can be used directly. + * @version DragonBones 4.7 + * @language en_US + */ + /** + * - 一个可以直接使用的全局工厂实例。 + * @version DragonBones 4.7 + * @language zh_CN + */ + static readonly factory: PixiFactory; + /** + * - 一个获取全局工厂实例(单例)的方法, 和get factory相比, 优点是可以传参数。 + * @version DragonBones 4.7 + * @language zh_CN + */ + static newInstance(useSharedTicker?: boolean): PixiFactory; + /** + * @inheritDoc + */ + constructor(dataParser?: DataParser | null, useSharedTicker?: boolean); + protected _buildTextureAtlasData(textureAtlasData: PixiTextureAtlasData | null, textureAtlas: PIXI.BaseTexture | null): PixiTextureAtlasData; + protected _buildArmature(dataPackage: BuildArmaturePackage): Armature; + protected _buildSlot(_dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it. + * The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature display container. + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + *
+         *     let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
+         * 
+ * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架,并用 {@link #clock} 更新该骨架。 + * 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。 (如果未设置,则使用默认的皮肤数据) + * @returns 骨架的显示容器。 + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + *
+         *     let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
+         * 
+ * @language zh_CN + */ + buildArmatureDisplay(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): PixiArmatureDisplay | null; + /** + * - Create the display object with the specified texture. + * @param textureName - The texture data name. + * @param textureAtlasName - The texture atlas data name (Of not set, all texture atlas data will be searched) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建带有指定贴图的显示对象。 + * @param textureName - 贴图数据名称。 + * @param textureAtlasName - 贴图集数据名称。 (如果未设置,将检索所有的贴图集数据) + * @version DragonBones 3.0 + * @language zh_CN + */ + getTextureDisplay(textureName: string, textureAtlasName?: string | null): PIXI.Sprite | null; + /** + * - A global sound event manager. + * Sound events can be listened to uniformly from the manager. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 全局声音事件管理器。 + * 声音事件可以从该管理器统一侦听。 + * @version DragonBones 4.5 + * @language zh_CN + */ + readonly soundEventManager: PixiArmatureDisplay; + } +} diff --git a/Pixi/5.x/out/dragonBones.js b/Pixi/5.x/out/dragonBones.js new file mode 100644 index 00000000..248583de --- /dev/null +++ b/Pixi/5.x/out/dragonBones.js @@ -0,0 +1,16037 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DragonBones = /** @class */ (function () { + function DragonBones(eventManager) { + this._clock = new dragonBones.WorldClock(); + this._events = []; + this._objects = []; + this._eventManager = null; + this._eventManager = eventManager; + console.info("DragonBones: " + DragonBones.VERSION + "\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/"); + } + DragonBones.prototype.advanceTime = function (passedTime) { + if (this._objects.length > 0) { + for (var _i = 0, _a = this._objects; _i < _a.length; _i++) { + var object = _a[_i]; + object.returnToPool(); + } + this._objects.length = 0; + } + this._clock.advanceTime(passedTime); + if (this._events.length > 0) { + for (var i = 0; i < this._events.length; ++i) { + var eventObject = this._events[i]; + var armature = eventObject.armature; + if (armature._armatureData !== null) { // May be armature disposed before advanceTime. + armature.eventDispatcher.dispatchDBEvent(eventObject.type, eventObject); + if (eventObject.type === dragonBones.EventObject.SOUND_EVENT) { + this._eventManager.dispatchDBEvent(eventObject.type, eventObject); + } + } + this.bufferObject(eventObject); + } + this._events.length = 0; + } + }; + DragonBones.prototype.bufferEvent = function (value) { + if (this._events.indexOf(value) < 0) { + this._events.push(value); + } + }; + DragonBones.prototype.bufferObject = function (object) { + if (this._objects.indexOf(object) < 0) { + this._objects.push(object); + } + }; + Object.defineProperty(DragonBones.prototype, "clock", { + get: function () { + return this._clock; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragonBones.prototype, "eventManager", { + get: function () { + return this._eventManager; + }, + enumerable: true, + configurable: true + }); + DragonBones.VERSION = "5.7.000"; + DragonBones.yDown = true; + DragonBones.debug = false; + DragonBones.debugDraw = false; + return DragonBones; + }()); + dragonBones.DragonBones = DragonBones; +})(dragonBones || (dragonBones = {})); +// +if (!console.warn) { + console.warn = function () { }; +} +if (!console.assert) { + console.assert = function () { }; +} +// +if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; +} +// Weixin can not support typescript extends. +var __extends = function (t, e) { + function r() { + this.constructor = t; + } + for (var i in e) { + if (e.hasOwnProperty(i)) { + t[i] = e[i]; + } + } + r.prototype = e.prototype, t.prototype = new r(); +}; +// +if (typeof global === "undefined" && typeof window !== "undefined") { + var global = window; +} +if (typeof exports === "object" && typeof module === "object") { + module.exports = dragonBones; +} +else if (typeof define === "function" && define["amd"]) { + define(["dragonBones"], function () { return dragonBones; }); +} +else if (typeof exports === "object") { + exports = dragonBones; +} +else if (typeof global !== "undefined") { + global.dragonBones = dragonBones; +} +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The BaseObject is the base class for all objects in the DragonBones framework. + * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 基础对象,通常 DragonBones 的对象都继承自该类。 + * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。 + * @version DragonBones 4.5 + * @language zh_CN + */ + var BaseObject = /** @class */ (function () { + function BaseObject() { + /** + * - A unique identification number assigned to the object. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 分配给此实例的唯一标识号。 + * @version DragonBones 4.5 + * @language zh_CN + */ + this.hashCode = BaseObject._hashCode++; + this._isInPool = false; + } + BaseObject._returnObject = function (object) { + var classType = String(object.constructor); + var maxCount = classType in BaseObject._maxCountMap ? BaseObject._maxCountMap[classType] : BaseObject._defaultMaxCount; + var pool = BaseObject._poolsMap[classType] = BaseObject._poolsMap[classType] || []; + if (pool.length < maxCount) { + if (!object._isInPool) { + object._isInPool = true; + pool.push(object); + } + else { + console.warn("The object is already in the pool."); + } + } + else { + } + }; + BaseObject.toString = function () { + throw new Error(); + }; + /** + * - Set the maximum cache count of the specify object pool. + * @param objectConstructor - The specify class. (Set all object pools max cache count if not set) + * @param maxCount - Max count. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 设置特定对象池的最大缓存数量。 + * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量) + * @param maxCount - 最大缓存数量。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.setMaxCount = function (objectConstructor, maxCount) { + if (maxCount < 0 || maxCount !== maxCount) { // isNaN + maxCount = 0; + } + if (objectConstructor !== null) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > maxCount) { + pool.length = maxCount; + } + BaseObject._maxCountMap[classType] = maxCount; + } + else { + BaseObject._defaultMaxCount = maxCount; + for (var classType in BaseObject._poolsMap) { + var pool = BaseObject._poolsMap[classType]; + if (pool.length > maxCount) { + pool.length = maxCount; + } + if (classType in BaseObject._maxCountMap) { + BaseObject._maxCountMap[classType] = maxCount; + } + } + } + }; + /** + * - Clear the cached instances of a specify object pool. + * @param objectConstructor - Specify class. (Clear all cached instances if not set) + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除特定对象池的缓存实例。 + * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例) + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.clearPool = function (objectConstructor) { + if (objectConstructor === void 0) { objectConstructor = null; } + if (objectConstructor !== null) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > 0) { + pool.length = 0; + } + } + else { + for (var k in BaseObject._poolsMap) { + var pool = BaseObject._poolsMap[k]; + pool.length = 0; + } + } + }; + /** + * - Get an instance of the specify class from object pool. + * @param objectConstructor - The specify class. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从对象池中获取特定类的实例。 + * @param objectConstructor - 特定的类。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.borrowObject = function (objectConstructor) { + var classType = String(objectConstructor); + var pool = classType in BaseObject._poolsMap ? BaseObject._poolsMap[classType] : null; + if (pool !== null && pool.length > 0) { + var object_1 = pool.pop(); + object_1._isInPool = false; + return object_1; + } + var object = new objectConstructor(); + object._onClear(); + return object; + }; + /** + * - Clear the object and return it back to object pool。 + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除该实例的所有数据并将其返还对象池。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseObject.prototype.returnToPool = function () { + this._onClear(); + BaseObject._returnObject(this); + }; + BaseObject._hashCode = 0; + BaseObject._defaultMaxCount = 3000; + BaseObject._maxCountMap = {}; + BaseObject._poolsMap = {}; + return BaseObject; + }()); + dragonBones.BaseObject = BaseObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - 2D Transform matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 转换矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Matrix = /** @class */ (function () { + /** + * @private + */ + function Matrix(a, b, c, d, tx, ty) { + if (a === void 0) { a = 1.0; } + if (b === void 0) { b = 0.0; } + if (c === void 0) { c = 0.0; } + if (d === void 0) { d = 1.0; } + if (tx === void 0) { tx = 0.0; } + if (ty === void 0) { ty = 0.0; } + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.tx = tx; + this.ty = ty; + } + Matrix.prototype.toString = function () { + return "[object dragonBones.Matrix] a:" + this.a + " b:" + this.b + " c:" + this.c + " d:" + this.d + " tx:" + this.tx + " ty:" + this.ty; + }; + /** + * @private + */ + Matrix.prototype.copyFrom = function (value) { + this.a = value.a; + this.b = value.b; + this.c = value.c; + this.d = value.d; + this.tx = value.tx; + this.ty = value.ty; + return this; + }; + /** + * @private + */ + Matrix.prototype.copyFromArray = function (value, offset) { + if (offset === void 0) { offset = 0; } + this.a = value[offset]; + this.b = value[offset + 1]; + this.c = value[offset + 2]; + this.d = value[offset + 3]; + this.tx = value[offset + 4]; + this.ty = value[offset + 5]; + return this; + }; + /** + * - Convert to unit matrix. + * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为单位矩阵。 + * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.identity = function () { + this.a = this.d = 1.0; + this.b = this.c = 0.0; + this.tx = this.ty = 0.0; + return this; + }; + /** + * - Multiplies the current matrix with another matrix. + * @param value - The matrix that needs to be multiplied. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将当前矩阵与另一个矩阵相乘。 + * @param value - 需要相乘的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.concat = function (value) { + var aA = this.a * value.a; + var bA = 0.0; + var cA = 0.0; + var dA = this.d * value.d; + var txA = this.tx * value.a + value.tx; + var tyA = this.ty * value.d + value.ty; + if (this.b !== 0.0 || this.c !== 0.0) { + aA += this.b * value.c; + bA += this.b * value.d; + cA += this.c * value.a; + dA += this.c * value.b; + } + if (value.b !== 0.0 || value.c !== 0.0) { + bA += this.a * value.b; + cA += this.d * value.c; + txA += this.ty * value.c; + tyA += this.tx * value.b; + } + this.a = aA; + this.b = bA; + this.c = cA; + this.d = dA; + this.tx = txA; + this.ty = tyA; + return this; + }; + /** + * - Convert to inverse matrix. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 转换为逆矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.invert = function () { + var aA = this.a; + var bA = this.b; + var cA = this.c; + var dA = this.d; + var txA = this.tx; + var tyA = this.ty; + if (bA === 0.0 && cA === 0.0) { + this.b = this.c = 0.0; + if (aA === 0.0 || dA === 0.0) { + this.a = this.b = this.tx = this.ty = 0.0; + } + else { + aA = this.a = 1.0 / aA; + dA = this.d = 1.0 / dA; + this.tx = -aA * txA; + this.ty = -dA * tyA; + } + return this; + } + var determinant = aA * dA - bA * cA; + if (determinant === 0.0) { + this.a = this.d = 1.0; + this.b = this.c = 0.0; + this.tx = this.ty = 0.0; + return this; + } + determinant = 1.0 / determinant; + var k = this.a = dA * determinant; + bA = this.b = -bA * determinant; + cA = this.c = -cA * determinant; + dA = this.d = aA * determinant; + this.tx = -(k * txA + cA * tyA); + this.ty = -(bA * txA + dA * tyA); + return this; + }; + /** + * - Apply a matrix transformation to a specific point. + * @param x - X coordinate. + * @param y - Y coordinate. + * @param result - The point after the transformation is applied. + * @param delta - Whether to ignore tx, ty's conversion to point. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将矩阵转换应用于特定点。 + * @param x - 横坐标。 + * @param y - 纵坐标。 + * @param result - 应用转换之后的点。 + * @param delta - 是否忽略 tx,ty 对点的转换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + Matrix.prototype.transformPoint = function (x, y, result, delta) { + if (delta === void 0) { delta = false; } + result.x = this.a * x + this.c * y; + result.y = this.b * x + this.d * y; + if (!delta) { + result.x += this.tx; + result.y += this.ty; + } + }; + /** + * @private + */ + Matrix.prototype.transformRectangle = function (rectangle, delta) { + if (delta === void 0) { delta = false; } + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + var tx = delta ? 0.0 : this.tx; + var ty = delta ? 0.0 : this.ty; + var x = rectangle.x; + var y = rectangle.y; + var xMax = x + rectangle.width; + var yMax = y + rectangle.height; + var x0 = a * x + c * y + tx; + var y0 = b * x + d * y + ty; + var x1 = a * xMax + c * y + tx; + var y1 = b * xMax + d * y + ty; + var x2 = a * xMax + c * yMax + tx; + var y2 = b * xMax + d * yMax + ty; + var x3 = a * x + c * yMax + tx; + var y3 = b * x + d * yMax + ty; + var tmp = 0.0; + if (x0 > x1) { + tmp = x0; + x0 = x1; + x1 = tmp; + } + if (x2 > x3) { + tmp = x2; + x2 = x3; + x3 = tmp; + } + rectangle.x = Math.floor(x0 < x2 ? x0 : x2); + rectangle.width = Math.ceil((x1 > x3 ? x1 : x3) - rectangle.x); + if (y0 > y1) { + tmp = y0; + y0 = y1; + y1 = tmp; + } + if (y2 > y3) { + tmp = y2; + y2 = y3; + y3 = tmp; + } + rectangle.y = Math.floor(y0 < y2 ? y0 : y2); + rectangle.height = Math.ceil((y1 > y3 ? y1 : y3) - rectangle.y); + }; + return Matrix; + }()); + dragonBones.Matrix = Matrix; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - 2D Transform. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 2D 变换。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Transform = /** @class */ (function () { + /** + * @private + */ + function Transform(x, y, skew, rotation, scaleX, scaleY) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (skew === void 0) { skew = 0.0; } + if (rotation === void 0) { rotation = 0.0; } + if (scaleX === void 0) { scaleX = 1.0; } + if (scaleY === void 0) { scaleY = 1.0; } + this.x = x; + this.y = y; + this.skew = skew; + this.rotation = rotation; + this.scaleX = scaleX; + this.scaleY = scaleY; + } + /** + * @private + */ + Transform.normalizeRadian = function (value) { + value = (value + Math.PI) % (Math.PI * 2.0); + value += value > 0.0 ? -Math.PI : Math.PI; + return value; + }; + Transform.prototype.toString = function () { + return "[object dragonBones.Transform] x:" + this.x + " y:" + this.y + " skewX:" + this.skew * 180.0 / Math.PI + " skewY:" + this.rotation * 180.0 / Math.PI + " scaleX:" + this.scaleX + " scaleY:" + this.scaleY; + }; + /** + * @private + */ + Transform.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + this.skew = value.skew; + this.rotation = value.rotation; + this.scaleX = value.scaleX; + this.scaleY = value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.identity = function () { + this.x = this.y = 0.0; + this.skew = this.rotation = 0.0; + this.scaleX = this.scaleY = 1.0; + return this; + }; + /** + * @private + */ + Transform.prototype.add = function (value) { + this.x += value.x; + this.y += value.y; + this.skew += value.skew; + this.rotation += value.rotation; + this.scaleX *= value.scaleX; + this.scaleY *= value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.minus = function (value) { + this.x -= value.x; + this.y -= value.y; + this.skew -= value.skew; + this.rotation -= value.rotation; + this.scaleX /= value.scaleX; + this.scaleY /= value.scaleY; + return this; + }; + /** + * @private + */ + Transform.prototype.fromMatrix = function (matrix) { + var backupScaleX = this.scaleX, backupScaleY = this.scaleY; + var PI_Q = Transform.PI_Q; + this.x = matrix.tx; + this.y = matrix.ty; + this.rotation = Math.atan(matrix.b / matrix.a); + var skewX = Math.atan(-matrix.c / matrix.d); + this.scaleX = (this.rotation > -PI_Q && this.rotation < PI_Q) ? matrix.a / Math.cos(this.rotation) : matrix.b / Math.sin(this.rotation); + this.scaleY = (skewX > -PI_Q && skewX < PI_Q) ? matrix.d / Math.cos(skewX) : -matrix.c / Math.sin(skewX); + if (backupScaleX >= 0.0 && this.scaleX < 0.0) { + this.scaleX = -this.scaleX; + this.rotation = this.rotation - Math.PI; + } + if (backupScaleY >= 0.0 && this.scaleY < 0.0) { + this.scaleY = -this.scaleY; + skewX = skewX - Math.PI; + } + this.skew = skewX - this.rotation; + return this; + }; + /** + * @private + */ + Transform.prototype.toMatrix = function (matrix) { + if (this.rotation === 0.0) { + matrix.a = 1.0; + matrix.b = 0.0; + } + else { + matrix.a = Math.cos(this.rotation); + matrix.b = Math.sin(this.rotation); + } + if (this.skew === 0.0) { + matrix.c = -matrix.b; + matrix.d = matrix.a; + } + else { + matrix.c = -Math.sin(this.skew + this.rotation); + matrix.d = Math.cos(this.skew + this.rotation); + } + if (this.scaleX !== 1.0) { + matrix.a *= this.scaleX; + matrix.b *= this.scaleX; + } + if (this.scaleY !== 1.0) { + matrix.c *= this.scaleY; + matrix.d *= this.scaleY; + } + matrix.tx = this.x; + matrix.ty = this.y; + return this; + }; + /** + * @private + */ + Transform.PI = Math.PI; + /** + * @private + */ + Transform.PI_D = Math.PI * 2.0; + /** + * @private + */ + Transform.PI_H = Math.PI / 2.0; + /** + * @private + */ + Transform.PI_Q = Math.PI / 4.0; + /** + * @private + */ + Transform.RAD_DEG = 180.0 / Math.PI; + /** + * @private + */ + Transform.DEG_RAD = Math.PI / 180.0; + return Transform; + }()); + dragonBones.Transform = Transform; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ColorTransform = /** @class */ (function () { + function ColorTransform(alphaMultiplier, redMultiplier, greenMultiplier, blueMultiplier, alphaOffset, redOffset, greenOffset, blueOffset) { + if (alphaMultiplier === void 0) { alphaMultiplier = 1.0; } + if (redMultiplier === void 0) { redMultiplier = 1.0; } + if (greenMultiplier === void 0) { greenMultiplier = 1.0; } + if (blueMultiplier === void 0) { blueMultiplier = 1.0; } + if (alphaOffset === void 0) { alphaOffset = 0; } + if (redOffset === void 0) { redOffset = 0; } + if (greenOffset === void 0) { greenOffset = 0; } + if (blueOffset === void 0) { blueOffset = 0; } + this.alphaMultiplier = alphaMultiplier; + this.redMultiplier = redMultiplier; + this.greenMultiplier = greenMultiplier; + this.blueMultiplier = blueMultiplier; + this.alphaOffset = alphaOffset; + this.redOffset = redOffset; + this.greenOffset = greenOffset; + this.blueOffset = blueOffset; + } + ColorTransform.prototype.copyFrom = function (value) { + this.alphaMultiplier = value.alphaMultiplier; + this.redMultiplier = value.redMultiplier; + this.greenMultiplier = value.greenMultiplier; + this.blueMultiplier = value.blueMultiplier; + this.alphaOffset = value.alphaOffset; + this.redOffset = value.redOffset; + this.greenOffset = value.greenOffset; + this.blueOffset = value.blueOffset; + }; + ColorTransform.prototype.identity = function () { + this.alphaMultiplier = this.redMultiplier = this.greenMultiplier = this.blueMultiplier = 1.0; + this.alphaOffset = this.redOffset = this.greenOffset = this.blueOffset = 0; + }; + return ColorTransform; + }()); + dragonBones.ColorTransform = ColorTransform; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The Point object represents a location in a two-dimensional coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Point 对象表示二维坐标系统中的某个位置。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Point = /** @class */ (function () { + /** + * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0). + * @param x - The horizontal coordinate. + * @param y - The vertical coordinate. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。 + * @param x - 该对象的x属性值,默认为 0.0。 + * @param y - 该对象的y属性值,默认为 0.0。 + * @version DragonBones 3.0 + * @language zh_CN + */ + function Point(x, y) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + this.x = x; + this.y = y; + } + /** + * @private + */ + Point.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + }; + /** + * @private + */ + Point.prototype.clear = function () { + this.x = this.y = 0.0; + }; + return Point; + }()); + dragonBones.Point = Point; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its + * width and its height.
+ * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of + * one property has no effect on the others. However, the right and bottom properties are integrally related to those + * four properties. For example, if you change the value of the right property, the value of the width property changes; + * if you change the bottom property, the value of the height property changes. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
+ * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 + * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width + * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var Rectangle = /** @class */ (function () { + /** + * @private + */ + function Rectangle(x, y, width, height) { + if (x === void 0) { x = 0.0; } + if (y === void 0) { y = 0.0; } + if (width === void 0) { width = 0.0; } + if (height === void 0) { height = 0.0; } + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + /** + * @private + */ + Rectangle.prototype.copyFrom = function (value) { + this.x = value.x; + this.y = value.y; + this.width = value.width; + this.height = value.height; + }; + /** + * @private + */ + Rectangle.prototype.clear = function () { + this.x = this.y = 0.0; + this.width = this.height = 0.0; + }; + return Rectangle; + }()); + dragonBones.Rectangle = Rectangle; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The user custom data. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 用户自定义数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + var UserData = /** @class */ (function (_super) { + __extends(UserData, _super); + function UserData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - The custom int numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.ints = []; + /** + * - The custom float numbers. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.floats = []; + /** + * - The custom strings. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + _this.strings = []; + return _this; + } + UserData.toString = function () { + return "[class dragonBones.UserData]"; + }; + UserData.prototype._onClear = function () { + this.ints.length = 0; + this.floats.length = 0; + this.strings.length = 0; + }; + /** + * @internal + */ + UserData.prototype.addInt = function (value) { + this.ints.push(value); + }; + /** + * @internal + */ + UserData.prototype.addFloat = function (value) { + this.floats.push(value); + }; + /** + * @internal + */ + UserData.prototype.addString = function (value) { + this.strings.push(value); + }; + /** + * - Get the custom int number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义整数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getInt = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.ints.length ? this.ints[index] : 0; + }; + /** + * - Get the custom float number. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义浮点数。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getFloat = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.floats.length ? this.floats[index] : 0.0; + }; + /** + * - Get the custom string. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 获取自定义字符串。 + * @version DragonBones 5.0 + * @language zh_CN + */ + UserData.prototype.getString = function (index) { + if (index === void 0) { index = 0; } + return index >= 0 && index < this.strings.length ? this.strings[index] : ""; + }; + return UserData; + }(dragonBones.BaseObject)); + dragonBones.UserData = UserData; + /** + * @private + */ + var ActionData = /** @class */ (function (_super) { + __extends(ActionData, _super); + function ActionData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.data = null; // + return _this; + } + ActionData.toString = function () { + return "[class dragonBones.ActionData]"; + }; + ActionData.prototype._onClear = function () { + if (this.data !== null) { + this.data.returnToPool(); + } + this.type = 0 /* Play */; + this.name = ""; + this.bone = null; + this.slot = null; + this.data = null; + }; + return ActionData; + }(dragonBones.BaseObject)); + dragonBones.ActionData = ActionData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The DragonBones data. + * A DragonBones data contains multiple armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 龙骨数据。 + * 一个龙骨数据包含多个骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + var DragonBonesData = /** @class */ (function (_super) { + __extends(DragonBonesData, _super); + function DragonBonesData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @internal + */ + _this.frameIndices = []; + /** + * @internal + */ + _this.cachedFrames = []; + /** + * - All armature data names. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.armatureNames = []; + /** + * @private + */ + _this.armatures = {}; + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + DragonBonesData.toString = function () { + return "[class dragonBones.DragonBonesData]"; + }; + DragonBonesData.prototype._onClear = function () { + for (var k in this.armatures) { + this.armatures[k].returnToPool(); + delete this.armatures[k]; + } + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.autoSearch = false; + this.frameRate = 0; + this.version = ""; + this.name = ""; + this.stage = null; + this.frameIndices.length = 0; + this.cachedFrames.length = 0; + this.armatureNames.length = 0; + //this.armatures.clear(); + this.binary = null; // + this.intArray = null; // + this.floatArray = null; // + this.frameIntArray = null; // + this.frameFloatArray = null; // + this.frameArray = null; // + this.timelineArray = null; // + this.colorArray = null; // + this.userData = null; + }; + /** + * @internal + */ + DragonBonesData.prototype.addArmature = function (value) { + if (value.name in this.armatures) { + console.warn("Same armature: " + value.name); + return; + } + value.parent = this; + this.armatures[value.name] = value; + this.armatureNames.push(value.name); + }; + /** + * - Get a specific armature data. + * @param armatureName - The armature data name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param armatureName - 骨架数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + DragonBonesData.prototype.getArmature = function (armatureName) { + return armatureName in this.armatures ? this.armatures[armatureName] : null; + }; + return DragonBonesData; + }(dragonBones.BaseObject)); + dragonBones.DragonBonesData = DragonBonesData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The armature data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var ArmatureData = /** @class */ (function (_super) { + __extends(ArmatureData, _super); + function ArmatureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.aabb = new dragonBones.Rectangle(); + /** + * - The names of all the animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所有的动画数据名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.animationNames = []; + /** + * @private + */ + _this.sortedBones = []; + /** + * @private + */ + _this.sortedSlots = []; + /** + * @private + */ + _this.defaultActions = []; + /** + * @private + */ + _this.actions = []; + /** + * @private + */ + _this.bones = {}; + /** + * @private + */ + _this.slots = {}; + /** + * @private + */ + _this.constraints = {}; + /** + * @private + */ + _this.skins = {}; + /** + * @private + */ + _this.animations = {}; + /** + * @private + */ + _this.canvas = null; // Initial value. + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + ArmatureData.toString = function () { + return "[class dragonBones.ArmatureData]"; + }; + ArmatureData.prototype._onClear = function () { + for (var _i = 0, _a = this.defaultActions; _i < _a.length; _i++) { + var action = _a[_i]; + action.returnToPool(); + } + for (var _b = 0, _c = this.actions; _b < _c.length; _b++) { + var action = _c[_b]; + action.returnToPool(); + } + for (var k in this.bones) { + this.bones[k].returnToPool(); + delete this.bones[k]; + } + for (var k in this.slots) { + this.slots[k].returnToPool(); + delete this.slots[k]; + } + for (var k in this.constraints) { + this.constraints[k].returnToPool(); + delete this.constraints[k]; + } + for (var k in this.skins) { + this.skins[k].returnToPool(); + delete this.skins[k]; + } + for (var k in this.animations) { + this.animations[k].returnToPool(); + delete this.animations[k]; + } + if (this.canvas !== null) { + this.canvas.returnToPool(); + } + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.type = 0 /* Armature */; + this.frameRate = 0; + this.cacheFrameRate = 0; + this.scale = 1.0; + this.name = ""; + this.aabb.clear(); + this.animationNames.length = 0; + this.sortedBones.length = 0; + this.sortedSlots.length = 0; + this.defaultActions.length = 0; + this.actions.length = 0; + // this.bones.clear(); + // this.slots.clear(); + // this.constraints.clear(); + // this.skins.clear(); + // this.animations.clear(); + this.defaultSkin = null; + this.defaultAnimation = null; + this.canvas = null; + this.userData = null; + this.parent = null; // + }; + /** + * @internal + */ + ArmatureData.prototype.sortBones = function () { + var total = this.sortedBones.length; + if (total <= 0) { + return; + } + var sortHelper = this.sortedBones.concat(); + var index = 0; + var count = 0; + this.sortedBones.length = 0; + while (count < total) { + var bone = sortHelper[index++]; + if (index >= total) { + index = 0; + } + if (this.sortedBones.indexOf(bone) >= 0) { + continue; + } + var flag = false; + for (var k in this.constraints) { // Wait constraint. + var constraint = this.constraints[k]; + if (constraint.root === bone && this.sortedBones.indexOf(constraint.target) < 0) { + flag = true; + break; + } + } + if (flag) { + continue; + } + if (bone.parent !== null && this.sortedBones.indexOf(bone.parent) < 0) { // Wait parent. + continue; + } + this.sortedBones.push(bone); + count++; + } + }; + /** + * @internal + */ + ArmatureData.prototype.cacheFrames = function (frameRate) { + if (this.cacheFrameRate > 0) { // TODO clear cache. + return; + } + this.cacheFrameRate = frameRate; + for (var k in this.animations) { + this.animations[k].cacheFrames(this.cacheFrameRate); + } + }; + /** + * @internal + */ + ArmatureData.prototype.setCacheFrame = function (globalTransformMatrix, transform) { + var dataArray = this.parent.cachedFrames; + var arrayOffset = dataArray.length; + dataArray.length += 10; + dataArray[arrayOffset] = globalTransformMatrix.a; + dataArray[arrayOffset + 1] = globalTransformMatrix.b; + dataArray[arrayOffset + 2] = globalTransformMatrix.c; + dataArray[arrayOffset + 3] = globalTransformMatrix.d; + dataArray[arrayOffset + 4] = globalTransformMatrix.tx; + dataArray[arrayOffset + 5] = globalTransformMatrix.ty; + dataArray[arrayOffset + 6] = transform.rotation; + dataArray[arrayOffset + 7] = transform.skew; + dataArray[arrayOffset + 8] = transform.scaleX; + dataArray[arrayOffset + 9] = transform.scaleY; + return arrayOffset; + }; + /** + * @internal + */ + ArmatureData.prototype.getCacheFrame = function (globalTransformMatrix, transform, arrayOffset) { + var dataArray = this.parent.cachedFrames; + globalTransformMatrix.a = dataArray[arrayOffset]; + globalTransformMatrix.b = dataArray[arrayOffset + 1]; + globalTransformMatrix.c = dataArray[arrayOffset + 2]; + globalTransformMatrix.d = dataArray[arrayOffset + 3]; + globalTransformMatrix.tx = dataArray[arrayOffset + 4]; + globalTransformMatrix.ty = dataArray[arrayOffset + 5]; + transform.rotation = dataArray[arrayOffset + 6]; + transform.skew = dataArray[arrayOffset + 7]; + transform.scaleX = dataArray[arrayOffset + 8]; + transform.scaleY = dataArray[arrayOffset + 9]; + transform.x = globalTransformMatrix.tx; + transform.y = globalTransformMatrix.ty; + }; + /** + * @internal + */ + ArmatureData.prototype.addBone = function (value) { + if (value.name in this.bones) { + console.warn("Same bone: " + value.name); + return; + } + this.bones[value.name] = value; + this.sortedBones.push(value); + }; + /** + * @internal + */ + ArmatureData.prototype.addSlot = function (value) { + if (value.name in this.slots) { + console.warn("Same slot: " + value.name); + return; + } + this.slots[value.name] = value; + this.sortedSlots.push(value); + }; + /** + * @internal + */ + ArmatureData.prototype.addConstraint = function (value) { + if (value.name in this.constraints) { + console.warn("Same constraint: " + value.name); + return; + } + this.constraints[value.name] = value; + }; + /** + * @internal + */ + ArmatureData.prototype.addSkin = function (value) { + if (value.name in this.skins) { + console.warn("Same skin: " + value.name); + return; + } + value.parent = this; + this.skins[value.name] = value; + if (this.defaultSkin === null) { + this.defaultSkin = value; + } + if (value.name === "default") { + this.defaultSkin = value; + } + }; + /** + * @internal + */ + ArmatureData.prototype.addAnimation = function (value) { + if (value.name in this.animations) { + console.warn("Same animation: " + value.name); + return; + } + value.parent = this; + this.animations[value.name] = value; + this.animationNames.push(value.name); + if (this.defaultAnimation === null) { + this.defaultAnimation = value; + } + }; + /** + * @internal + */ + ArmatureData.prototype.addAction = function (value, isDefault) { + if (isDefault) { + this.defaultActions.push(value); + } + else { + this.actions.push(value); + } + }; + /** + * - Get a specific done data. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼数据。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getBone = function (boneName) { + return boneName in this.bones ? this.bones[boneName] : null; + }; + /** + * - Get a specific slot data. + * @param slotName - The slot name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽数据。 + * @param slotName - 插槽名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getSlot = function (slotName) { + return slotName in this.slots ? this.slots[slotName] : null; + }; + /** + * @private + */ + ArmatureData.prototype.getConstraint = function (constraintName) { + return constraintName in this.constraints ? this.constraints[constraintName] : null; + }; + /** + * - Get a specific skin data. + * @param skinName - The skin name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定皮肤数据。 + * @param skinName - 皮肤名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getSkin = function (skinName) { + return skinName in this.skins ? this.skins[skinName] : null; + }; + /** + * @private + */ + ArmatureData.prototype.getMesh = function (skinName, slotName, meshName) { + var skin = this.getSkin(skinName); + if (skin === null) { + return null; + } + return skin.getDisplay(slotName, meshName); + }; + /** + * - Get a specific animation data. + * @param animationName - The animation animationName. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的动画数据。 + * @param animationName - 动画名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + ArmatureData.prototype.getAnimation = function (animationName) { + return animationName in this.animations ? this.animations[animationName] : null; + }; + return ArmatureData; + }(dragonBones.BaseObject)); + dragonBones.ArmatureData = ArmatureData; + /** + * - The bone data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var BoneData = /** @class */ (function (_super) { + __extends(BoneData, _super); + function BoneData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.transform = new dragonBones.Transform(); + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + BoneData.toString = function () { + return "[class dragonBones.BoneData]"; + }; + BoneData.prototype._onClear = function () { + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.inheritTranslation = false; + this.inheritRotation = false; + this.inheritScale = false; + this.inheritReflection = false; + this.type = 0 /* Bone */; + this.length = 0.0; + this.alpha = 1.0; + this.name = ""; + this.transform.identity(); + this.userData = null; + this.parent = null; + }; + return BoneData; + }(dragonBones.BaseObject)); + dragonBones.BoneData = BoneData; + /** + * @internal + */ + var SurfaceData = /** @class */ (function (_super) { + __extends(SurfaceData, _super); + function SurfaceData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new dragonBones.GeometryData(); + return _this; + } + SurfaceData.toString = function () { + return "[class dragonBones.SurfaceData]"; + }; + SurfaceData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 1 /* Surface */; + this.segmentX = 0; + this.segmentY = 0; + this.geometry.clear(); + }; + return SurfaceData; + }(BoneData)); + dragonBones.SurfaceData = SurfaceData; + /** + * - The slot data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var SlotData = /** @class */ (function (_super) { + __extends(SlotData, _super); + function SlotData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.color = null; // Initial value. + /** + * @private + */ + _this.userData = null; // Initial value. + return _this; + } + /** + * @internal + */ + SlotData.createColor = function () { + return new dragonBones.ColorTransform(); + }; + SlotData.toString = function () { + return "[class dragonBones.SlotData]"; + }; + SlotData.prototype._onClear = function () { + if (this.userData !== null) { + this.userData.returnToPool(); + } + this.blendMode = 0 /* Normal */; + this.displayIndex = 0; + this.zOrder = 0; + this.zIndex = 0; + this.alpha = 1.0; + this.name = ""; + this.color = null; // + this.userData = null; + this.parent = null; // + }; + /** + * @internal + */ + SlotData.DEFAULT_COLOR = new dragonBones.ColorTransform(); + return SlotData; + }(dragonBones.BaseObject)); + dragonBones.SlotData = SlotData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ConstraintData = /** @class */ (function (_super) { + __extends(ConstraintData, _super); + function ConstraintData() { + return _super !== null && _super.apply(this, arguments) || this; + } + ConstraintData.prototype._onClear = function () { + this.order = 0; + this.name = ""; + this.type = 0 /* IK */; + this.target = null; // + this.root = null; // + this.bone = null; + }; + return ConstraintData; + }(dragonBones.BaseObject)); + dragonBones.ConstraintData = ConstraintData; + /** + * @internal + */ + var IKConstraintData = /** @class */ (function (_super) { + __extends(IKConstraintData, _super); + function IKConstraintData() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraintData.toString = function () { + return "[class dragonBones.IKConstraintData]"; + }; + IKConstraintData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.scaleEnabled = false; + this.bendPositive = false; + this.weight = 1.0; + }; + return IKConstraintData; + }(ConstraintData)); + dragonBones.IKConstraintData = IKConstraintData; + /** + * @internal + */ + var PathConstraintData = /** @class */ (function (_super) { + __extends(PathConstraintData, _super); + function PathConstraintData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.bones = []; + return _this; + } + PathConstraintData.toString = function () { + return "[class dragonBones.PathConstraintData]"; + }; + PathConstraintData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.pathSlot = null; + this.pathDisplayData = null; + this.bones.length = 0; + this.positionMode = 0 /* Fixed */; + this.spacingMode = 1 /* Fixed */; + this.rotateMode = 1 /* Chain */; + this.position = 0.0; + this.spacing = 0.0; + this.rotateOffset = 0.0; + this.rotateMix = 0.0; + this.translateMix = 0.0; + }; + PathConstraintData.prototype.AddBone = function (value) { + this.bones.push(value); + }; + return PathConstraintData; + }(ConstraintData)); + dragonBones.PathConstraintData = PathConstraintData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var CanvasData = /** @class */ (function (_super) { + __extends(CanvasData, _super); + function CanvasData() { + return _super !== null && _super.apply(this, arguments) || this; + } + CanvasData.toString = function () { + return "[class dragonBones.CanvasData]"; + }; + CanvasData.prototype._onClear = function () { + this.hasBackground = false; + this.color = 0x000000; + this.x = 0; + this.y = 0; + this.width = 0; + this.height = 0; + }; + return CanvasData; + }(dragonBones.BaseObject)); + dragonBones.CanvasData = CanvasData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The skin data, typically a armature data instance contains at least one skinData. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var SkinData = /** @class */ (function (_super) { + __extends(SkinData, _super); + function SkinData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.displays = {}; + return _this; + } + SkinData.toString = function () { + return "[class dragonBones.SkinData]"; + }; + SkinData.prototype._onClear = function () { + for (var k in this.displays) { + var slotDisplays = this.displays[k]; + for (var _i = 0, slotDisplays_1 = slotDisplays; _i < slotDisplays_1.length; _i++) { + var display = slotDisplays_1[_i]; + if (display !== null) { + display.returnToPool(); + } + } + delete this.displays[k]; + } + this.name = ""; + // this.displays.clear(); + this.parent = null; // + }; + /** + * @internal + */ + SkinData.prototype.addDisplay = function (slotName, value) { + if (!(slotName in this.displays)) { + this.displays[slotName] = []; + } + if (value !== null) { + value.parent = this; + } + var slotDisplays = this.displays[slotName]; // TODO clear prev + slotDisplays.push(value); + }; + /** + * @private + */ + SkinData.prototype.getDisplay = function (slotName, displayName) { + var slotDisplays = this.getDisplays(slotName); + if (slotDisplays !== null) { + for (var _i = 0, slotDisplays_2 = slotDisplays; _i < slotDisplays_2.length; _i++) { + var display = slotDisplays_2[_i]; + if (display !== null && display.name === displayName) { + return display; + } + } + } + return null; + }; + /** + * @private + */ + SkinData.prototype.getDisplays = function (slotName) { + if (!(slotName in this.displays)) { + return null; + } + return this.displays[slotName]; + }; + return SkinData; + }(dragonBones.BaseObject)); + dragonBones.SkinData = SkinData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var GeometryData = /** @class */ (function () { + function GeometryData() { + this.weight = null; // Initial value. + } + GeometryData.prototype.clear = function () { + if (!this.isShared && this.weight !== null) { + this.weight.returnToPool(); + } + this.isShared = false; + this.inheritDeform = false; + this.offset = 0; + this.data = null; + this.weight = null; + }; + GeometryData.prototype.shareFrom = function (value) { + this.isShared = true; + this.offset = value.offset; + this.weight = value.weight; + }; + Object.defineProperty(GeometryData.prototype, "vertexCount", { + get: function () { + var intArray = this.data.intArray; + return intArray[this.offset + 0 /* GeometryVertexCount */]; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GeometryData.prototype, "triangleCount", { + get: function () { + var intArray = this.data.intArray; + return intArray[this.offset + 1 /* GeometryTriangleCount */]; + }, + enumerable: true, + configurable: true + }); + return GeometryData; + }()); + dragonBones.GeometryData = GeometryData; + /** + * @private + */ + var DisplayData = /** @class */ (function (_super) { + __extends(DisplayData, _super); + function DisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.transform = new dragonBones.Transform(); + return _this; + } + DisplayData.prototype._onClear = function () { + this.name = ""; + this.path = ""; + this.transform.identity(); + this.parent = null; // + }; + return DisplayData; + }(dragonBones.BaseObject)); + dragonBones.DisplayData = DisplayData; + /** + * @private + */ + var ImageDisplayData = /** @class */ (function (_super) { + __extends(ImageDisplayData, _super); + function ImageDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.pivot = new dragonBones.Point(); + return _this; + } + ImageDisplayData.toString = function () { + return "[class dragonBones.ImageDisplayData]"; + }; + ImageDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 0 /* Image */; + this.pivot.clear(); + this.texture = null; + }; + return ImageDisplayData; + }(DisplayData)); + dragonBones.ImageDisplayData = ImageDisplayData; + /** + * @private + */ + var ArmatureDisplayData = /** @class */ (function (_super) { + __extends(ArmatureDisplayData, _super); + function ArmatureDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.actions = []; + return _this; + } + ArmatureDisplayData.toString = function () { + return "[class dragonBones.ArmatureDisplayData]"; + }; + ArmatureDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + for (var _i = 0, _a = this.actions; _i < _a.length; _i++) { + var action = _a[_i]; + action.returnToPool(); + } + this.type = 1 /* Armature */; + this.inheritAnimation = false; + this.actions.length = 0; + this.armature = null; + }; + /** + * @private + */ + ArmatureDisplayData.prototype.addAction = function (value) { + this.actions.push(value); + }; + return ArmatureDisplayData; + }(DisplayData)); + dragonBones.ArmatureDisplayData = ArmatureDisplayData; + /** + * @private + */ + var MeshDisplayData = /** @class */ (function (_super) { + __extends(MeshDisplayData, _super); + function MeshDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new GeometryData(); + return _this; + } + MeshDisplayData.toString = function () { + return "[class dragonBones.MeshDisplayData]"; + }; + MeshDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 2 /* Mesh */; + this.geometry.clear(); + this.texture = null; + }; + return MeshDisplayData; + }(DisplayData)); + dragonBones.MeshDisplayData = MeshDisplayData; + /** + * @private + */ + var BoundingBoxDisplayData = /** @class */ (function (_super) { + __extends(BoundingBoxDisplayData, _super); + function BoundingBoxDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.boundingBox = null; // Initial value. + return _this; + } + BoundingBoxDisplayData.toString = function () { + return "[class dragonBones.BoundingBoxDisplayData]"; + }; + BoundingBoxDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this.boundingBox !== null) { + this.boundingBox.returnToPool(); + } + this.type = 3 /* BoundingBox */; + this.boundingBox = null; + }; + return BoundingBoxDisplayData; + }(DisplayData)); + dragonBones.BoundingBoxDisplayData = BoundingBoxDisplayData; + /** + * @private + */ + var PathDisplayData = /** @class */ (function (_super) { + __extends(PathDisplayData, _super); + function PathDisplayData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.geometry = new GeometryData(); + _this.curveLengths = []; + return _this; + } + PathDisplayData.toString = function () { + return "[class dragonBones.PathDisplayData]"; + }; + PathDisplayData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 4 /* Path */; + this.closed = false; + this.constantSpeed = false; + this.geometry.clear(); + this.curveLengths.length = 0; + }; + return PathDisplayData; + }(DisplayData)); + dragonBones.PathDisplayData = PathDisplayData; + /** + * @private + */ + var WeightData = /** @class */ (function (_super) { + __extends(WeightData, _super); + function WeightData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.bones = []; + return _this; + } + WeightData.toString = function () { + return "[class dragonBones.WeightData]"; + }; + WeightData.prototype._onClear = function () { + this.count = 0; + this.offset = 0; + this.bones.length = 0; + }; + WeightData.prototype.addBone = function (value) { + this.bones.push(value); + }; + return WeightData; + }(dragonBones.BaseObject)); + dragonBones.WeightData = WeightData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The base class of bounding box data. + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 边界框数据基类。 + * @see dragonBones.RectangleData + * @see dragonBones.EllipseData + * @see dragonBones.PolygonData + * @version DragonBones 5.0 + * @language zh_CN + */ + var BoundingBoxData = /** @class */ (function (_super) { + __extends(BoundingBoxData, _super); + function BoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoundingBoxData.prototype._onClear = function () { + this.color = 0x000000; + this.width = 0.0; + this.height = 0.0; + }; + return BoundingBoxData; + }(dragonBones.BaseObject)); + dragonBones.BoundingBoxData = BoundingBoxData; + /** + * - The rectangle bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 矩形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var RectangleBoundingBoxData = /** @class */ (function (_super) { + __extends(RectangleBoundingBoxData, _super); + function RectangleBoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + RectangleBoundingBoxData.toString = function () { + return "[class dragonBones.RectangleBoundingBoxData]"; + }; + /** + * - Compute the bit code for a point (x, y) using the clip rectangle + */ + RectangleBoundingBoxData._computeOutCode = function (x, y, xMin, yMin, xMax, yMax) { + var code = 0 /* InSide */; // initialised as being inside of [[clip window]] + if (x < xMin) { // to the left of clip window + code |= 1 /* Left */; + } + else if (x > xMax) { // to the right of clip window + code |= 2 /* Right */; + } + if (y < yMin) { // below the clip window + code |= 4 /* Top */; + } + else if (y > yMax) { // above the clip window + code |= 8 /* Bottom */; + } + return code; + }; + /** + * @private + */ + RectangleBoundingBoxData.rectangleIntersectsSegment = function (xA, yA, xB, yB, xMin, yMin, xMax, yMax, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var inSideA = xA > xMin && xA < xMax && yA > yMin && yA < yMax; + var inSideB = xB > xMin && xB < xMax && yB > yMin && yB < yMax; + if (inSideA && inSideB) { + return -1; + } + var intersectionCount = 0; + var outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax); + var outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax); + while (true) { + if ((outcode0 | outcode1) === 0) { // Bitwise OR is 0. Trivially accept and get out of loop + intersectionCount = 2; + break; + } + else if ((outcode0 & outcode1) !== 0) { // Bitwise AND is not 0. Trivially reject and get out of loop + break; + } + // failed both tests, so calculate the line segment to clip + // from an outside point to an intersection with clip edge + var x = 0.0; + var y = 0.0; + var normalRadian = 0.0; + // At least one endpoint is outside the clip rectangle; pick it. + var outcodeOut = outcode0 !== 0 ? outcode0 : outcode1; + // Now find the intersection point; + if ((outcodeOut & 4 /* Top */) !== 0) { // point is above the clip rectangle + x = xA + (xB - xA) * (yMin - yA) / (yB - yA); + y = yMin; + if (normalRadians !== null) { + normalRadian = -Math.PI * 0.5; + } + } + else if ((outcodeOut & 8 /* Bottom */) !== 0) { // point is below the clip rectangle + x = xA + (xB - xA) * (yMax - yA) / (yB - yA); + y = yMax; + if (normalRadians !== null) { + normalRadian = Math.PI * 0.5; + } + } + else if ((outcodeOut & 2 /* Right */) !== 0) { // point is to the right of clip rectangle + y = yA + (yB - yA) * (xMax - xA) / (xB - xA); + x = xMax; + if (normalRadians !== null) { + normalRadian = 0; + } + } + else if ((outcodeOut & 1 /* Left */) !== 0) { // point is to the left of clip rectangle + y = yA + (yB - yA) * (xMin - xA) / (xB - xA); + x = xMin; + if (normalRadians !== null) { + normalRadian = Math.PI; + } + } + // Now we move outside point to intersection point to clip + // and get ready for next pass. + if (outcodeOut === outcode0) { + xA = x; + yA = y; + outcode0 = RectangleBoundingBoxData._computeOutCode(xA, yA, xMin, yMin, xMax, yMax); + if (normalRadians !== null) { + normalRadians.x = normalRadian; + } + } + else { + xB = x; + yB = y; + outcode1 = RectangleBoundingBoxData._computeOutCode(xB, yB, xMin, yMin, xMax, yMax); + if (normalRadians !== null) { + normalRadians.y = normalRadian; + } + } + } + if (intersectionCount) { + if (inSideA) { + intersectionCount = 2; // 10 + if (intersectionPointA !== null) { + intersectionPointA.x = xB; + intersectionPointA.y = yB; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = xB; + } + if (normalRadians !== null) { + normalRadians.x = normalRadians.y + Math.PI; + } + } + else if (inSideB) { + intersectionCount = 1; // 01 + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA; + intersectionPointB.y = yA; + } + if (normalRadians !== null) { + normalRadians.y = normalRadians.x + Math.PI; + } + } + else { + intersectionCount = 3; // 11 + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = yB; + } + } + } + return intersectionCount; + }; + RectangleBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 0 /* Rectangle */; + }; + /** + * @inheritDoc + */ + RectangleBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var widthH = this.width * 0.5; + if (pX >= -widthH && pX <= widthH) { + var heightH = this.height * 0.5; + if (pY >= -heightH && pY <= heightH) { + return true; + } + } + return false; + }; + /** + * @inheritDoc + */ + RectangleBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var widthH = this.width * 0.5; + var heightH = this.height * 0.5; + var intersectionCount = RectangleBoundingBoxData.rectangleIntersectsSegment(xA, yA, xB, yB, -widthH, -heightH, widthH, heightH, intersectionPointA, intersectionPointB, normalRadians); + return intersectionCount; + }; + return RectangleBoundingBoxData; + }(BoundingBoxData)); + dragonBones.RectangleBoundingBoxData = RectangleBoundingBoxData; + /** + * - The ellipse bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 椭圆边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var EllipseBoundingBoxData = /** @class */ (function (_super) { + __extends(EllipseBoundingBoxData, _super); + function EllipseBoundingBoxData() { + return _super !== null && _super.apply(this, arguments) || this; + } + EllipseBoundingBoxData.toString = function () { + return "[class dragonBones.EllipseData]"; + }; + /** + * @private + */ + EllipseBoundingBoxData.ellipseIntersectsSegment = function (xA, yA, xB, yB, xC, yC, widthH, heightH, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var d = widthH / heightH; + var dd = d * d; + yA *= d; + yB *= d; + var dX = xB - xA; + var dY = yB - yA; + var lAB = Math.sqrt(dX * dX + dY * dY); + var xD = dX / lAB; + var yD = dY / lAB; + var a = (xC - xA) * xD + (yC - yA) * yD; + var aa = a * a; + var ee = xA * xA + yA * yA; + var rr = widthH * widthH; + var dR = rr - ee + aa; + var intersectionCount = 0; + if (dR >= 0.0) { + var dT = Math.sqrt(dR); + var sA = a - dT; + var sB = a + dT; + var inSideA = sA < 0.0 ? -1 : (sA <= lAB ? 0 : 1); + var inSideB = sB < 0.0 ? -1 : (sB <= lAB ? 0 : 1); + var sideAB = inSideA * inSideB; + if (sideAB < 0) { + return -1; + } + else if (sideAB === 0) { + if (inSideA === -1) { + intersectionCount = 2; // 10 + xB = xA + sB * xD; + yB = (yA + sB * yD) / d; + if (intersectionPointA !== null) { + intersectionPointA.x = xB; + intersectionPointA.y = yB; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xB; + intersectionPointB.y = yB; + } + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yB / rr * dd, xB / rr); + normalRadians.y = normalRadians.x + Math.PI; + } + } + else if (inSideB === 1) { + intersectionCount = 1; // 01 + xA = xA + sA * xD; + yA = (yA + sA * yD) / d; + if (intersectionPointA !== null) { + intersectionPointA.x = xA; + intersectionPointA.y = yA; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA; + intersectionPointB.y = yA; + } + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yA / rr * dd, xA / rr); + normalRadians.y = normalRadians.x + Math.PI; + } + } + else { + intersectionCount = 3; // 11 + if (intersectionPointA !== null) { + intersectionPointA.x = xA + sA * xD; + intersectionPointA.y = (yA + sA * yD) / d; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(intersectionPointA.y / rr * dd, intersectionPointA.x / rr); + } + } + if (intersectionPointB !== null) { + intersectionPointB.x = xA + sB * xD; + intersectionPointB.y = (yA + sB * yD) / d; + if (normalRadians !== null) { + normalRadians.y = Math.atan2(intersectionPointB.y / rr * dd, intersectionPointB.x / rr); + } + } + } + } + } + return intersectionCount; + }; + EllipseBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 1 /* Ellipse */; + }; + /** + * @inheritDoc + */ + EllipseBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var widthH = this.width * 0.5; + if (pX >= -widthH && pX <= widthH) { + var heightH = this.height * 0.5; + if (pY >= -heightH && pY <= heightH) { + pY *= widthH / heightH; + return Math.sqrt(pX * pX + pY * pY) <= widthH; + } + } + return false; + }; + /** + * @inheritDoc + */ + EllipseBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var intersectionCount = EllipseBoundingBoxData.ellipseIntersectsSegment(xA, yA, xB, yB, 0.0, 0.0, this.width * 0.5, this.height * 0.5, intersectionPointA, intersectionPointB, normalRadians); + return intersectionCount; + }; + return EllipseBoundingBoxData; + }(BoundingBoxData)); + dragonBones.EllipseBoundingBoxData = EllipseBoundingBoxData; + /** + * - The polygon bounding box data. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形边界框数据。 + * @version DragonBones 5.1 + * @language zh_CN + */ + var PolygonBoundingBoxData = /** @class */ (function (_super) { + __extends(PolygonBoundingBoxData, _super); + function PolygonBoundingBoxData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - The polygon vertices. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 多边形顶点。 + * @version DragonBones 5.1 + * @language zh_CN + */ + _this.vertices = []; + return _this; + } + PolygonBoundingBoxData.toString = function () { + return "[class dragonBones.PolygonBoundingBoxData]"; + }; + /** + * @private + */ + PolygonBoundingBoxData.polygonIntersectsSegment = function (xA, yA, xB, yB, vertices, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + if (xA === xB) { + xA = xB + 0.000001; + } + if (yA === yB) { + yA = yB + 0.000001; + } + var count = vertices.length; + var dXAB = xA - xB; + var dYAB = yA - yB; + var llAB = xA * yB - yA * xB; + var intersectionCount = 0; + var xC = vertices[count - 2]; + var yC = vertices[count - 1]; + var dMin = 0.0; + var dMax = 0.0; + var xMin = 0.0; + var yMin = 0.0; + var xMax = 0.0; + var yMax = 0.0; + for (var i = 0; i < count; i += 2) { + var xD = vertices[i]; + var yD = vertices[i + 1]; + if (xC === xD) { + xC = xD + 0.0001; + } + if (yC === yD) { + yC = yD + 0.0001; + } + var dXCD = xC - xD; + var dYCD = yC - yD; + var llCD = xC * yD - yC * xD; + var ll = dXAB * dYCD - dYAB * dXCD; + var x = (llAB * dXCD - dXAB * llCD) / ll; + if (((x >= xC && x <= xD) || (x >= xD && x <= xC)) && (dXAB === 0.0 || (x >= xA && x <= xB) || (x >= xB && x <= xA))) { + var y = (llAB * dYCD - dYAB * llCD) / ll; + if (((y >= yC && y <= yD) || (y >= yD && y <= yC)) && (dYAB === 0.0 || (y >= yA && y <= yB) || (y >= yB && y <= yA))) { + if (intersectionPointB !== null) { + var d = x - xA; + if (d < 0.0) { + d = -d; + } + if (intersectionCount === 0) { + dMin = d; + dMax = d; + xMin = x; + yMin = y; + xMax = x; + yMax = y; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + normalRadians.y = normalRadians.x; + } + } + else { + if (d < dMin) { + dMin = d; + xMin = x; + yMin = y; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + } + } + if (d > dMax) { + dMax = d; + xMax = x; + yMax = y; + if (normalRadians !== null) { + normalRadians.y = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + } + } + } + intersectionCount++; + } + else { + xMin = x; + yMin = y; + xMax = x; + yMax = y; + intersectionCount++; + if (normalRadians !== null) { + normalRadians.x = Math.atan2(yD - yC, xD - xC) - Math.PI * 0.5; + normalRadians.y = normalRadians.x; + } + break; + } + } + } + xC = xD; + yC = yD; + } + if (intersectionCount === 1) { + if (intersectionPointA !== null) { + intersectionPointA.x = xMin; + intersectionPointA.y = yMin; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xMin; + intersectionPointB.y = yMin; + } + if (normalRadians !== null) { + normalRadians.y = normalRadians.x + Math.PI; + } + } + else if (intersectionCount > 1) { + intersectionCount++; + if (intersectionPointA !== null) { + intersectionPointA.x = xMin; + intersectionPointA.y = yMin; + } + if (intersectionPointB !== null) { + intersectionPointB.x = xMax; + intersectionPointB.y = yMax; + } + } + return intersectionCount; + }; + PolygonBoundingBoxData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.type = 2 /* Polygon */; + this.x = 0.0; + this.y = 0.0; + this.vertices.length = 0; + }; + /** + * @inheritDoc + */ + PolygonBoundingBoxData.prototype.containsPoint = function (pX, pY) { + var isInSide = false; + if (pX >= this.x && pX <= this.width && pY >= this.y && pY <= this.height) { + for (var i = 0, l = this.vertices.length, iP = l - 2; i < l; i += 2) { + var yA = this.vertices[iP + 1]; + var yB = this.vertices[i + 1]; + if ((yB < pY && yA >= pY) || (yA < pY && yB >= pY)) { + var xA = this.vertices[iP]; + var xB = this.vertices[i]; + if ((pY - yB) * (xA - xB) / (yA - yB) + xB < pX) { + isInSide = !isInSide; + } + } + iP = i; + } + } + return isInSide; + }; + /** + * @inheritDoc + */ + PolygonBoundingBoxData.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var intersectionCount = 0; + if (RectangleBoundingBoxData.rectangleIntersectsSegment(xA, yA, xB, yB, this.x, this.y, this.x + this.width, this.y + this.height, null, null, null) !== 0) { + intersectionCount = PolygonBoundingBoxData.polygonIntersectsSegment(xA, yA, xB, yB, this.vertices, intersectionPointA, intersectionPointB, normalRadians); + } + return intersectionCount; + }; + return PolygonBoundingBoxData; + }(BoundingBoxData)); + dragonBones.PolygonBoundingBoxData = PolygonBoundingBoxData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var AnimationData = /** @class */ (function (_super) { + __extends(AnimationData, _super); + function AnimationData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.cachedFrames = []; + /** + * @private + */ + _this.boneTimelines = {}; + /** + * @private + */ + _this.slotTimelines = {}; + /** + * @private + */ + _this.constraintTimelines = {}; + /** + * @private + */ + _this.animationTimelines = {}; + /** + * @private + */ + _this.boneCachedFrameIndices = {}; + /** + * @private + */ + _this.slotCachedFrameIndices = {}; + /** + * @private + */ + _this.actionTimeline = null; // Initial value. + /** + * @private + */ + _this.zOrderTimeline = null; // Initial value. + return _this; + } + AnimationData.toString = function () { + return "[class dragonBones.AnimationData]"; + }; + AnimationData.prototype._onClear = function () { + for (var k in this.boneTimelines) { + for (var _i = 0, _a = this.boneTimelines[k]; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.returnToPool(); + } + delete this.boneTimelines[k]; + } + for (var k in this.slotTimelines) { + for (var _b = 0, _c = this.slotTimelines[k]; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.returnToPool(); + } + delete this.slotTimelines[k]; + } + for (var k in this.constraintTimelines) { + for (var _d = 0, _e = this.constraintTimelines[k]; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.returnToPool(); + } + delete this.constraintTimelines[k]; + } + for (var k in this.animationTimelines) { + for (var _f = 0, _g = this.animationTimelines[k]; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.returnToPool(); + } + delete this.animationTimelines[k]; + } + for (var k in this.boneCachedFrameIndices) { + delete this.boneCachedFrameIndices[k]; + } + for (var k in this.slotCachedFrameIndices) { + delete this.slotCachedFrameIndices[k]; + } + if (this.actionTimeline !== null) { + this.actionTimeline.returnToPool(); + } + if (this.zOrderTimeline !== null) { + this.zOrderTimeline.returnToPool(); + } + this.frameIntOffset = 0; + this.frameFloatOffset = 0; + this.frameOffset = 0; + this.blendType = 0 /* None */; + this.frameCount = 0; + this.playTimes = 0; + this.duration = 0.0; + this.scale = 1.0; + this.fadeInTime = 0.0; + this.cacheFrameRate = 0.0; + this.name = ""; + this.cachedFrames.length = 0; + // this.boneTimelines.clear(); + // this.slotTimelines.clear(); + // this.constraintTimelines.clear(); + // this.animationTimelines.clear(); + // this.boneCachedFrameIndices.clear(); + // this.slotCachedFrameIndices.clear(); + this.actionTimeline = null; + this.zOrderTimeline = null; + this.parent = null; // + }; + /** + * @internal + */ + AnimationData.prototype.cacheFrames = function (frameRate) { + if (this.cacheFrameRate > 0.0) { // TODO clear cache. + return; + } + this.cacheFrameRate = Math.max(Math.ceil(frameRate * this.scale), 1.0); + var cacheFrameCount = Math.ceil(this.cacheFrameRate * this.duration) + 1; // Cache one more frame. + this.cachedFrames.length = cacheFrameCount; + for (var i = 0, l = this.cacheFrames.length; i < l; ++i) { + this.cachedFrames[i] = false; + } + for (var _i = 0, _a = this.parent.sortedBones; _i < _a.length; _i++) { + var bone = _a[_i]; + var indices = new Array(cacheFrameCount); + for (var i = 0, l = indices.length; i < l; ++i) { + indices[i] = -1; + } + this.boneCachedFrameIndices[bone.name] = indices; + } + for (var _b = 0, _c = this.parent.sortedSlots; _b < _c.length; _b++) { + var slot = _c[_b]; + var indices = new Array(cacheFrameCount); + for (var i = 0, l = indices.length; i < l; ++i) { + indices[i] = -1; + } + this.slotCachedFrameIndices[slot.name] = indices; + } + }; + /** + * @private + */ + AnimationData.prototype.addBoneTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : (this.boneTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addSlotTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : (this.slotTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addConstraintTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : (this.constraintTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.addAnimationTimeline = function (timelineName, timeline) { + var timelines = timelineName in this.animationTimelines ? this.animationTimelines[timelineName] : (this.animationTimelines[timelineName] = []); + if (timelines.indexOf(timeline) < 0) { + timelines.push(timeline); + } + }; + /** + * @private + */ + AnimationData.prototype.getBoneTimelines = function (timelineName) { + return timelineName in this.boneTimelines ? this.boneTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getSlotTimelines = function (timelineName) { + return timelineName in this.slotTimelines ? this.slotTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getConstraintTimelines = function (timelineName) { + return timelineName in this.constraintTimelines ? this.constraintTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getAnimationTimelines = function (timelineName) { + return timelineName in this.animationTimelines ? this.animationTimelines[timelineName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getBoneCachedFrameIndices = function (boneName) { + return boneName in this.boneCachedFrameIndices ? this.boneCachedFrameIndices[boneName] : null; + }; + /** + * @private + */ + AnimationData.prototype.getSlotCachedFrameIndices = function (slotName) { + return slotName in this.slotCachedFrameIndices ? this.slotCachedFrameIndices[slotName] : null; + }; + return AnimationData; + }(dragonBones.BaseObject)); + dragonBones.AnimationData = AnimationData; + /** + * @private + */ + var TimelineData = /** @class */ (function (_super) { + __extends(TimelineData, _super); + function TimelineData() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimelineData.toString = function () { + return "[class dragonBones.TimelineData]"; + }; + TimelineData.prototype._onClear = function () { + this.type = 10 /* BoneAll */; + this.offset = 0; + this.frameIndicesOffset = -1; + }; + return TimelineData; + }(dragonBones.BaseObject)); + dragonBones.TimelineData = TimelineData; + /** + * @internal + */ + var AnimationTimelineData = /** @class */ (function (_super) { + __extends(AnimationTimelineData, _super); + function AnimationTimelineData() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationTimelineData.toString = function () { + return "[class dragonBones.AnimationTimelineData]"; + }; + AnimationTimelineData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.x = 0.0; + this.y = 0.0; + }; + return AnimationTimelineData; + }(TimelineData)); + dragonBones.AnimationTimelineData = AnimationTimelineData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation config is used to describe all the information needed to play an animation state. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 动画配置用来描述播放一个动画状态所需要的全部信息。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @see dragonBones.AnimationState + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + var AnimationConfig = /** @class */ (function (_super) { + __extends(AnimationConfig, _super); + function AnimationConfig() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.boneMask = []; + return _this; + } + AnimationConfig.toString = function () { + return "[class dragonBones.AnimationConfig]"; + }; + AnimationConfig.prototype._onClear = function () { + this.pauseFadeOut = true; + this.fadeOutMode = 4 /* All */; + this.fadeOutTweenType = 1 /* Line */; + this.fadeOutTime = -1.0; + this.actionEnabled = true; + this.additive = false; + this.displayControl = true; + this.pauseFadeIn = true; + this.resetToPose = true; + this.fadeInTweenType = 1 /* Line */; + this.playTimes = -1; + this.layer = 0; + this.position = 0.0; + this.duration = -1.0; + this.timeScale = -100.0; + this.weight = 1.0; + this.fadeInTime = -1.0; + this.autoFadeOutTime = -1.0; + this.name = ""; + this.animation = ""; + this.group = ""; + this.boneMask.length = 0; + }; + /** + * @private + */ + AnimationConfig.prototype.clear = function () { + this._onClear(); + }; + /** + * @private + */ + AnimationConfig.prototype.copyFrom = function (value) { + this.pauseFadeOut = value.pauseFadeOut; + this.fadeOutMode = value.fadeOutMode; + this.autoFadeOutTime = value.autoFadeOutTime; + this.fadeOutTweenType = value.fadeOutTweenType; + this.actionEnabled = value.actionEnabled; + this.additive = value.additive; + this.displayControl = value.displayControl; + this.pauseFadeIn = value.pauseFadeIn; + this.resetToPose = value.resetToPose; + this.playTimes = value.playTimes; + this.layer = value.layer; + this.position = value.position; + this.duration = value.duration; + this.timeScale = value.timeScale; + this.fadeInTime = value.fadeInTime; + this.fadeOutTime = value.fadeOutTime; + this.fadeInTweenType = value.fadeInTweenType; + this.weight = value.weight; + this.name = value.name; + this.animation = value.animation; + this.group = value.group; + this.boneMask.length = value.boneMask.length; + for (var i = 0, l = this.boneMask.length; i < l; ++i) { + this.boneMask[i] = value.boneMask[i]; + } + }; + return AnimationConfig; + }(dragonBones.BaseObject)); + dragonBones.AnimationConfig = AnimationConfig; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var TextureAtlasData = /** @class */ (function (_super) { + __extends(TextureAtlasData, _super); + function TextureAtlasData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.textures = {}; + return _this; + } + TextureAtlasData.prototype._onClear = function () { + for (var k in this.textures) { + this.textures[k].returnToPool(); + delete this.textures[k]; + } + this.autoSearch = false; + this.width = 0; + this.height = 0; + this.scale = 1.0; + // this.textures.clear(); + this.name = ""; + this.imagePath = ""; + }; + /** + * @private + */ + TextureAtlasData.prototype.copyFrom = function (value) { + this.autoSearch = value.autoSearch; + this.scale = value.scale; + this.width = value.width; + this.height = value.height; + this.name = value.name; + this.imagePath = value.imagePath; + for (var k in this.textures) { + this.textures[k].returnToPool(); + delete this.textures[k]; + } + // this.textures.clear(); + for (var k in value.textures) { + var texture = this.createTexture(); + texture.copyFrom(value.textures[k]); + this.textures[k] = texture; + } + }; + /** + * @internal + */ + TextureAtlasData.prototype.addTexture = function (value) { + if (value.name in this.textures) { + console.warn("Same texture: " + value.name); + return; + } + value.parent = this; + this.textures[value.name] = value; + }; + /** + * @private + */ + TextureAtlasData.prototype.getTexture = function (textureName) { + return textureName in this.textures ? this.textures[textureName] : null; + }; + return TextureAtlasData; + }(dragonBones.BaseObject)); + dragonBones.TextureAtlasData = TextureAtlasData; + /** + * @private + */ + var TextureData = /** @class */ (function (_super) { + __extends(TextureData, _super); + function TextureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.region = new dragonBones.Rectangle(); + _this.frame = null; // Initial value. + return _this; + } + TextureData.createRectangle = function () { + return new dragonBones.Rectangle(); + }; + TextureData.prototype._onClear = function () { + this.rotated = false; + this.name = ""; + this.region.clear(); + this.parent = null; // + this.frame = null; + }; + TextureData.prototype.copyFrom = function (value) { + this.rotated = value.rotated; + this.name = value.name; + this.region.copyFrom(value.region); + this.parent = value.parent; + if (this.frame === null && value.frame !== null) { + this.frame = TextureData.createRectangle(); + } + else if (this.frame !== null && value.frame === null) { + this.frame = null; + } + if (this.frame !== null && value.frame !== null) { + this.frame.copyFrom(value.frame); + } + }; + return TextureData; + }(dragonBones.BaseObject)); + dragonBones.TextureData = TextureData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones_1) { + /** + * - Armature is the core of the skeleton animation system. + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架是骨骼动画系统的核心。 + * @see dragonBones.ArmatureData + * @see dragonBones.Bone + * @see dragonBones.Slot + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + var Armature = /** @class */ (function (_super) { + __extends(Armature, _super); + function Armature() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._bones = []; + _this._slots = []; + /** + * @internal + */ + _this._constraints = []; + _this._actions = []; + _this._animation = null; // Initial value. + _this._proxy = null; // Initial value. + /** + * @internal + */ + _this._replaceTextureAtlasData = null; // Initial value. + _this._clock = null; // Initial value. + return _this; + } + Armature.toString = function () { + return "[class dragonBones.Armature]"; + }; + Armature._onSortSlots = function (a, b) { + return a._zIndex * 1000 + a._zOrder > b._zIndex * 1000 + b._zOrder ? 1 : -1; + }; + Armature.prototype._onClear = function () { + if (this._clock !== null) { // Remove clock first. + this._clock.remove(this); + } + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + bone.returnToPool(); + } + for (var _b = 0, _c = this._slots; _b < _c.length; _b++) { + var slot = _c[_b]; + slot.returnToPool(); + } + for (var _d = 0, _e = this._constraints; _d < _e.length; _d++) { + var constraint = _e[_d]; + constraint.returnToPool(); + } + for (var _f = 0, _g = this._actions; _f < _g.length; _f++) { + var action = _g[_f]; + action.returnToPool(); + } + if (this._animation !== null) { + this._animation.returnToPool(); + } + if (this._proxy !== null) { + this._proxy.dbClear(); + } + if (this._replaceTextureAtlasData !== null) { + this._replaceTextureAtlasData.returnToPool(); + } + this.inheritAnimation = true; + this.userData = null; + this._lockUpdate = false; + this._slotsDirty = true; + this._zOrderDirty = false; + this._zIndexDirty = false; + this._alphaDirty = true; + this._flipX = false; + this._flipY = false; + this._cacheFrameIndex = -1; + this._alpha = 1.0; + this._globalAlpha = 1.0; + this._bones.length = 0; + this._slots.length = 0; + this._constraints.length = 0; + this._actions.length = 0; + this._armatureData = null; // + this._animation = null; // + this._proxy = null; // + this._display = null; + this._replaceTextureAtlasData = null; + this._replacedTexture = null; + this._dragonBones = null; // + this._clock = null; + this._parent = null; + }; + /** + * @internal + */ + Armature.prototype._sortZOrder = function (slotIndices, offset) { + var slotDatas = this._armatureData.sortedSlots; + var isOriginal = slotIndices === null; + if (this._zOrderDirty || !isOriginal) { + for (var i = 0, l = slotDatas.length; i < l; ++i) { + var slotIndex = isOriginal ? i : slotIndices[offset + i]; + if (slotIndex < 0 || slotIndex >= l) { + continue; + } + var slotData = slotDatas[slotIndex]; + var slot = this.getSlot(slotData.name); + if (slot !== null) { + slot._setZOrder(i); + } + } + this._slotsDirty = true; + this._zOrderDirty = !isOriginal; + } + }; + /** + * @internal + */ + Armature.prototype._addBone = function (value) { + if (this._bones.indexOf(value) < 0) { + this._bones.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._addSlot = function (value) { + if (this._slots.indexOf(value) < 0) { + this._slots.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._addConstraint = function (value) { + if (this._constraints.indexOf(value) < 0) { + this._constraints.push(value); + } + }; + /** + * @internal + */ + Armature.prototype._bufferAction = function (action, append) { + if (this._actions.indexOf(action) < 0) { + if (append) { + this._actions.push(action); + } + else { + this._actions.unshift(action); + } + } + }; + /** + * - Dispose the armature. (Return to the object pool) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 释放骨架。 (回收到对象池) + * @example + *
+         *     removeChild(armature.display);
+         *     armature.dispose();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.dispose = function () { + if (this._armatureData !== null) { + this._lockUpdate = true; + this._dragonBones.bufferObject(this); + } + }; + /** + * @internal + */ + Armature.prototype.init = function (armatureData, proxy, display, dragonBones) { + if (this._armatureData !== null) { + return; + } + this._armatureData = armatureData; + this._animation = dragonBones_1.BaseObject.borrowObject(dragonBones_1.Animation); + this._proxy = proxy; + this._display = display; + this._dragonBones = dragonBones; + this._proxy.dbInit(this); + this._animation.init(this); + this._animation.animations = this._armatureData.animations; + }; + /** + * @inheritDoc + */ + Armature.prototype.advanceTime = function (passedTime) { + if (this._lockUpdate) { + return; + } + this._lockUpdate = true; + if (this._armatureData === null) { + console.warn("The armature has been disposed."); + return; + } + else if (this._armatureData.parent === null) { + console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear()."); + return; + } + var prevCacheFrameIndex = this._cacheFrameIndex; + // Update animation. + this._animation.advanceTime(passedTime); + // Sort slots. + if (this._slotsDirty || this._zIndexDirty) { + this._slots.sort(Armature._onSortSlots); + if (this._zIndexDirty) { + for (var i = 0, l = this._slots.length; i < l; ++i) { + this._slots[i]._setZOrder(i); // + } + } + this._slotsDirty = false; + this._zIndexDirty = false; + } + // Update alpha. + if (this._alphaDirty) { + this._alphaDirty = false; + this._globalAlpha = this._alpha * (this._parent !== null ? this._parent._globalAlpha : 1.0); + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + bone._updateAlpha(); + } + for (var _b = 0, _c = this._slots; _b < _c.length; _b++) { + var slot = _c[_b]; + slot._updateAlpha(); + } + } + // Update bones and slots. + if (this._cacheFrameIndex < 0 || this._cacheFrameIndex !== prevCacheFrameIndex) { + var i = 0, l = 0; + for (i = 0, l = this._bones.length; i < l; ++i) { + this._bones[i].update(this._cacheFrameIndex); + } + for (i = 0, l = this._slots.length; i < l; ++i) { + this._slots[i].update(this._cacheFrameIndex); + } + } + // Do actions. + if (this._actions.length > 0) { + for (var _d = 0, _e = this._actions; _d < _e.length; _d++) { + var action = _e[_d]; + var actionData = action.actionData; + if (actionData !== null) { + if (actionData.type === 0 /* Play */) { + if (action.slot !== null) { + var childArmature = action.slot.childArmature; + if (childArmature !== null) { + childArmature.animation.fadeIn(actionData.name); + } + } + else if (action.bone !== null) { + for (var _f = 0, _g = this.getSlots(); _f < _g.length; _f++) { + var slot = _g[_f]; + if (slot.parent === action.bone) { + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.animation.fadeIn(actionData.name); + } + } + } + } + else { + this._animation.fadeIn(actionData.name); + } + } + } + action.returnToPool(); + } + this._actions.length = 0; + } + this._lockUpdate = false; + this._proxy.dbUpdate(); + }; + /** + * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. + * @param boneName - The bone name. (If not set, all bones will be update) + * @param updateSlot - Whether to update the bone's slots. (Default: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 + * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) + * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) + * @see dragonBones.Bone#invalidUpdate() + * @see dragonBones.Slot#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.invalidUpdate = function (boneName, updateSlot) { + if (boneName === void 0) { boneName = null; } + if (updateSlot === void 0) { updateSlot = false; } + if (boneName !== null && boneName.length > 0) { + var bone = this.getBone(boneName); + if (bone !== null) { + bone.invalidUpdate(); + if (updateSlot) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.parent === bone) { + slot.invalidUpdate(); + } + } + } + } + } + else { + for (var _b = 0, _c = this._bones; _b < _c.length; _b++) { + var bone = _c[_b]; + bone.invalidUpdate(); + } + if (updateSlot) { + for (var _d = 0, _e = this._slots; _d < _e.length; _d++) { + var slot = _e[_d]; + slot.invalidUpdate(); + } + } + } + }; + /** + * - Check whether a specific point is inside a custom bounding box in a slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在某个插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Armature.prototype.containsPoint = function (x, y) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.containsPoint(x, y)) { + return slot; + } + } + return null; + }; + /** + * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Armature.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + var isV = xA === xB; + var dMin = 0.0; + var dMax = 0.0; + var intXA = 0.0; + var intYA = 0.0; + var intXB = 0.0; + var intYB = 0.0; + var intAN = 0.0; + var intBN = 0.0; + var intSlotA = null; + var intSlotB = null; + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var intersectionCount = slot.intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); + if (intersectionCount > 0) { + if (intersectionPointA !== null || intersectionPointB !== null) { + if (intersectionPointA !== null) { + var d = isV ? intersectionPointA.y - yA : intersectionPointA.x - xA; + if (d < 0.0) { + d = -d; + } + if (intSlotA === null || d < dMin) { + dMin = d; + intXA = intersectionPointA.x; + intYA = intersectionPointA.y; + intSlotA = slot; + if (normalRadians) { + intAN = normalRadians.x; + } + } + } + if (intersectionPointB !== null) { + var d = intersectionPointB.x - xA; + if (d < 0.0) { + d = -d; + } + if (intSlotB === null || d > dMax) { + dMax = d; + intXB = intersectionPointB.x; + intYB = intersectionPointB.y; + intSlotB = slot; + if (normalRadians !== null) { + intBN = normalRadians.y; + } + } + } + } + else { + intSlotA = slot; + break; + } + } + } + if (intSlotA !== null && intersectionPointA !== null) { + intersectionPointA.x = intXA; + intersectionPointA.y = intYA; + if (normalRadians !== null) { + normalRadians.x = intAN; + } + } + if (intSlotB !== null && intersectionPointB !== null) { + intersectionPointB.x = intXB; + intersectionPointB.y = intYB; + if (normalRadians !== null) { + normalRadians.y = intBN; + } + } + return intSlotA; + }; + /** + * - Get a specific bone. + * @param name - The bone name. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的骨骼。 + * @param name - 骨骼名称。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBone = function (name) { + for (var _i = 0, _a = this._bones; _i < _a.length; _i++) { + var bone = _a[_i]; + if (bone.name === name) { + return bone; + } + } + return null; + }; + /** + * - Get a specific bone by the display. + * @param display - The display object. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的骨骼。 + * @param display - 显示对象。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBoneByDisplay = function (display) { + var slot = this.getSlotByDisplay(display); + return slot !== null ? slot.parent : null; + }; + /** + * - Get a specific slot. + * @param name - The slot name. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的插槽。 + * @param name - 插槽名称。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlot = function (name) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.name === name) { + return slot; + } + } + return null; + }; + /** + * - Get a specific slot by the display. + * @param display - The display object. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过显示对象获取特定的插槽。 + * @param display - 显示对象。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlotByDisplay = function (display) { + if (display !== null) { + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.display === display) { + return slot; + } + } + } + return null; + }; + /** + * - Get all bones. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getBones = function () { + return this._bones; + }; + /** + * - Get all slots. + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取所有的插槽。 + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + Armature.prototype.getSlots = function () { + return this._slots; + }; + Object.defineProperty(Armature.prototype, "flipX", { + /** + * - Whether to flip the armature horizontally. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架水平翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + get: function () { + return this._flipX; + }, + set: function (value) { + if (this._flipX === value) { + return; + } + this._flipX = value; + this.invalidUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "flipY", { + /** + * - Whether to flip the armature vertically. + * @version DragonBones 5.5 + * @language en_US + */ + /** + * - 是否将骨架垂直翻转。 + * @version DragonBones 5.5 + * @language zh_CN + */ + get: function () { + return this._flipY; + }, + set: function (value) { + if (this._flipY === value) { + return; + } + this._flipY = value; + this.invalidUpdate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "cacheFrameRate", { + /** + * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. + * There is a certain amount of memory overhead to improve performance by caching animation data in memory. + * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. + * When the animation cache is turned on, some features will fail, such as the offset property of bone. + * @example + *
+             *     armature.cacheFrameRate = 24;
+             * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 + * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 + * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 + * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 + * @example + *
+             *     armature.cacheFrameRate = 24;
+             * 
+ * @see dragonBones.DragonBonesData#frameRate + * @see dragonBones.ArmatureData#frameRate + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._armatureData.cacheFrameRate; + }, + set: function (value) { + if (this._armatureData.cacheFrameRate !== value) { + this._armatureData.cacheFrames(value); + // Set child armature frameRate. + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.cacheFrameRate = value; + } + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "name", { + /** + * - The armature name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨架名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._armatureData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "armatureData", { + /** + * - The armature data. + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨架数据。 + * @see dragonBones.ArmatureData + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._armatureData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "animation", { + /** + * - The animation player. + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器。 + * @see dragonBones.Animation + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._animation; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "proxy", { + /** + * @pivate + */ + get: function () { + return this._proxy; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "eventDispatcher", { + /** + * - The EventDispatcher instance of the armature. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架的 EventDispatcher 实例。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._proxy; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "display", { + /** + * - The display container. + * The display of the slot is displayed as the parent. + * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 显示容器实例。 + * 插槽的显示对象都会以此显示容器为父级。 + * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._display; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "replacedTexture", { + /** + * @private + */ + get: function () { + return this._replacedTexture; + }, + set: function (value) { + if (this._replacedTexture === value) { + return; + } + if (this._replaceTextureAtlasData !== null) { + this._replaceTextureAtlasData.returnToPool(); + this._replaceTextureAtlasData = null; + } + this._replacedTexture = value; + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + slot.invalidUpdate(); + slot.update(-1); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "clock", { + /** + * @inheritDoc + */ + get: function () { + return this._clock; + }, + set: function (value) { + if (this._clock === value) { + return; + } + if (this._clock !== null) { + this._clock.remove(this); + } + this._clock = value; + if (this._clock) { + this._clock.add(this); + } + // Update childArmature clock. + for (var _i = 0, _a = this._slots; _i < _a.length; _i++) { + var slot = _a[_i]; + var childArmature = slot.childArmature; + if (childArmature !== null) { + childArmature.clock = this._clock; + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Armature.prototype, "parent", { + /** + * - Get the parent slot which the armature belongs to. + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 该骨架所属的父插槽。 + * @see dragonBones.Slot + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Armature.prototype.getDisplay = function () { + return this._display; + }; + return Armature; + }(dragonBones_1.BaseObject)); + dragonBones_1.Armature = Armature; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The base class of the transform object. + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 变换对象的基类。 + * @see dragonBones.Transform + * @version DragonBones 4.5 + * @language zh_CN + */ + var TransformObject = /** @class */ (function (_super) { + __extends(TransformObject, _super); + function TransformObject() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * - A matrix relative to the armature coordinate system. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的矩阵。 + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.globalTransformMatrix = new dragonBones.Matrix(); + /** + * - A transform relative to the armature coordinate system. + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架坐标系的变换。 + * @see #updateGlobalTransform() + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.global = new dragonBones.Transform(); + /** + * - The offset transform relative to the armature or the parent bone coordinate system. + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 相对于骨架或父骨骼坐标系的偏移变换。 + * @see #dragonBones.Bone#invalidUpdate() + * @version DragonBones 3.0 + * @language zh_CN + */ + _this.offset = new dragonBones.Transform(); + return _this; + } + /** + */ + TransformObject.prototype._onClear = function () { + this.globalTransformMatrix.identity(); + this.global.identity(); + this.offset.identity(); + this.origin = null; + this.userData = null; + this._globalDirty = false; + this._alpha = 1.0; + this._globalAlpha = 1.0; + this._armature = null; // + }; + /** + * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, + * some engines do not rely on these attributes to update rendering, such as Egret. + * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 + * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 + * @example + *
+         *     bone.updateGlobalTransform();
+         *     let rotation = bone.global.rotation;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + TransformObject.prototype.updateGlobalTransform = function () { + if (this._globalDirty) { + this._globalDirty = false; + this.global.fromMatrix(this.globalTransformMatrix); + } + }; + Object.defineProperty(TransformObject.prototype, "armature", { + /** + * - The armature to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的骨架。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._armature; + }, + enumerable: true, + configurable: true + }); + TransformObject._helpMatrix = new dragonBones.Matrix(); + TransformObject._helpTransform = new dragonBones.Transform(); + TransformObject._helpPoint = new dragonBones.Point(); + return TransformObject; + }(dragonBones.BaseObject)); + dragonBones.TransformObject = TransformObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Bone is one of the most important logical units in the armature animation system, + * and is responsible for the realization of translate, rotation, scaling in the animations. + * A armature can contain multiple bones. + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 + * 一个骨架中可以包含多个骨骼。 + * @see dragonBones.BoneData + * @see dragonBones.Armature + * @see dragonBones.Slot + * @version DragonBones 3.0 + * @language zh_CN + */ + var Bone = /** @class */ (function (_super) { + __extends(Bone, _super); + function Bone() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @internal + */ + _this.animationPose = new dragonBones.Transform(); + return _this; + } + Bone.toString = function () { + return "[class dragonBones.Bone]"; + }; + Bone.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.offsetMode = 1 /* Additive */; + this.animationPose.identity(); + this._transformDirty = false; + this._childrenTransformDirty = false; + this._localDirty = true; + this._hasConstraint = false; + this._visible = true; + this._cachedFrameIndex = -1; + this._boneData = null; // + this._parent = null; // + this._cachedFrameIndices = null; + }; + Bone.prototype._updateGlobalTransformMatrix = function (isCache) { + // For typescript. + var boneData = this._boneData; + var global = this.global; + var globalTransformMatrix = this.globalTransformMatrix; + var origin = this.origin; + var offset = this.offset; + var animationPose = this.animationPose; + var parent = this._parent; // + var flipX = this._armature.flipX; + var flipY = this._armature.flipY === dragonBones.DragonBones.yDown; + var inherit = parent !== null; + var rotation = 0.0; + if (this.offsetMode === 1 /* Additive */) { + if (origin !== null) { + // global.copyFrom(this.origin).add(this.offset).add(this.animationPose); + global.x = origin.x + offset.x + animationPose.x; + global.scaleX = origin.scaleX * offset.scaleX * animationPose.scaleX; + global.scaleY = origin.scaleY * offset.scaleY * animationPose.scaleY; + if (dragonBones.DragonBones.yDown) { + global.y = origin.y + offset.y + animationPose.y; + global.skew = origin.skew + offset.skew + animationPose.skew; + global.rotation = origin.rotation + offset.rotation + animationPose.rotation; + } + else { + global.y = origin.y - offset.y + animationPose.y; + global.skew = origin.skew - offset.skew + animationPose.skew; + global.rotation = origin.rotation - offset.rotation + animationPose.rotation; + } + } + else { + global.copyFrom(offset); + if (!dragonBones.DragonBones.yDown) { + global.y = -global.y; + global.skew = -global.skew; + global.rotation = -global.rotation; + } + global.add(animationPose); + } + } + else if (this.offsetMode === 0 /* None */) { + if (origin !== null) { + global.copyFrom(origin).add(animationPose); + } + else { + global.copyFrom(animationPose); + } + } + else { + inherit = false; + global.copyFrom(offset); + if (!dragonBones.DragonBones.yDown) { + global.y = -global.y; + global.skew = -global.skew; + global.rotation = -global.rotation; + } + } + if (inherit) { + var isSurface = parent._boneData.type === 1 /* Surface */; + var surfaceBone = isSurface ? parent._bone : null; + var parentMatrix = isSurface ? parent._getGlobalTransformMatrix(global.x, global.y) : parent.globalTransformMatrix; + if (boneData.inheritScale && (!isSurface || surfaceBone !== null)) { + if (isSurface) { + if (boneData.inheritRotation) { + global.rotation += parent.global.rotation; + } + surfaceBone.updateGlobalTransform(); + global.scaleX *= surfaceBone.global.scaleX; + global.scaleY *= surfaceBone.global.scaleY; + parentMatrix.transformPoint(global.x, global.y, global); + global.toMatrix(globalTransformMatrix); + if (boneData.inheritTranslation) { + global.x = globalTransformMatrix.tx; + global.y = globalTransformMatrix.ty; + } + else { + globalTransformMatrix.tx = global.x; + globalTransformMatrix.ty = global.y; + } + } + else { + if (!boneData.inheritRotation) { + parent.updateGlobalTransform(); + if (flipX && flipY) { + rotation = global.rotation - (parent.global.rotation + Math.PI); + } + else if (flipX) { + rotation = global.rotation + parent.global.rotation + Math.PI; + } + else if (flipY) { + rotation = global.rotation + parent.global.rotation; + } + else { + rotation = global.rotation - parent.global.rotation; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + globalTransformMatrix.concat(parentMatrix); + if (boneData.inheritTranslation) { + global.x = globalTransformMatrix.tx; + global.y = globalTransformMatrix.ty; + } + else { + globalTransformMatrix.tx = global.x; + globalTransformMatrix.ty = global.y; + } + if (isCache) { + global.fromMatrix(globalTransformMatrix); + } + else { + this._globalDirty = true; + } + } + } + else { + if (boneData.inheritTranslation) { + var x = global.x; + var y = global.y; + global.x = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + global.y = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + } + else { + if (flipX) { + global.x = -global.x; + } + if (flipY) { + global.y = -global.y; + } + } + if (boneData.inheritRotation) { + parent.updateGlobalTransform(); + if (parent.global.scaleX < 0.0) { + rotation = global.rotation + parent.global.rotation + Math.PI; + } + else { + rotation = global.rotation + parent.global.rotation; + } + if (parentMatrix.a * parentMatrix.d - parentMatrix.b * parentMatrix.c < 0.0) { + rotation -= global.rotation * 2.0; + if (flipX !== flipY || boneData.inheritReflection) { + global.skew += Math.PI; + } + if (!dragonBones.DragonBones.yDown) { + global.skew = -global.skew; + } + } + global.rotation = rotation; + } + else if (flipX || flipY) { + if (flipX && flipY) { + rotation = global.rotation + Math.PI; + } + else { + if (flipX) { + rotation = Math.PI - global.rotation; + } + else { + rotation = -global.rotation; + } + global.skew += Math.PI; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + } + } + else { + if (flipX || flipY) { + if (flipX) { + global.x = -global.x; + } + if (flipY) { + global.y = -global.y; + } + if (flipX && flipY) { + rotation = global.rotation + Math.PI; + } + else { + if (flipX) { + rotation = Math.PI - global.rotation; + } + else { + rotation = -global.rotation; + } + global.skew += Math.PI; + } + global.rotation = rotation; + } + global.toMatrix(globalTransformMatrix); + } + }; + /** + * @internal + */ + Bone.prototype._updateAlpha = function () { + if (this._parent !== null) { + this._globalAlpha = this._alpha * this._parent._globalAlpha; + } + else { + this._globalAlpha = this._alpha * this._armature._globalAlpha; + } + }; + /** + * @internal + */ + Bone.prototype.init = function (boneData, armatureValue) { + if (this._boneData !== null) { + return; + } + this._boneData = boneData; + this._armature = armatureValue; + this._alpha = this._boneData.alpha; + if (this._boneData.parent !== null) { + this._parent = this._armature.getBone(this._boneData.parent.name); + } + this._armature._addBone(this); + // + this.origin = this._boneData.transform; + }; + /** + * @internal + */ + Bone.prototype.update = function (cacheFrameIndex) { + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache. + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { // Has been Cached. + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || + (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet. + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) { + var constraint = _c[_b]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + if (this._transformDirty) { + this._transformDirty = false; + this._childrenTransformDirty = true; + // + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + if (this._localDirty) { + this._updateGlobalTransformMatrix(isCache); + } + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + // + } + else if (this._childrenTransformDirty) { + this._childrenTransformDirty = false; + } + this._localDirty = true; + }; + /** + * @internal + */ + Bone.prototype.updateByConstraint = function () { + if (this._localDirty) { + this._localDirty = false; + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { + this._updateGlobalTransformMatrix(true); + } + this._transformDirty = true; + } + }; + /** + * - Forces the bone to update the transform in the next frame. + * When the bone is not animated or its animation state is finished, the bone will not continue to update, + * and when the skeleton must be updated for some reason, the method needs to be called explicitly. + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 强制骨骼在下一帧更新变换。 + * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 + * @example + *
+         *     let bone = armature.getBone("arm");
+         *     bone.offset.scaleX = 2.0;
+         *     bone.invalidUpdate();
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Bone.prototype.invalidUpdate = function () { + this._transformDirty = true; + }; + /** + * - Check whether the bone contains a specific bone. + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查该骨骼是否包含特定的骨骼。 + * @see dragonBones.Bone + * @version DragonBones 3.0 + * @language zh_CN + */ + Bone.prototype.contains = function (value) { + if (value === this) { + return false; + } + var ancestor = value; + while (ancestor !== this && ancestor !== null) { + ancestor = ancestor.parent; + } + return ancestor === this; + }; + Object.defineProperty(Bone.prototype, "boneData", { + /** + * - The bone data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 骨骼数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._boneData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "visible", { + /** + * - The visible of all slots in the bone. + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 此骨骼所有插槽的可见。 + * @default true + * @see dragonBones.Slot#visible + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._visible; + }, + set: function (value) { + if (this._visible === value) { + return; + } + this._visible = value; + for (var _i = 0, _a = this._armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + if (slot.parent === this) { + slot._updateVisible(); + } + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "name", { + /** + * - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._boneData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Bone.prototype, "parent", { + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + return Bone; + }(dragonBones.TransformObject)); + dragonBones.Bone = Bone; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var Surface = /** @class */ (function (_super) { + __extends(Surface, _super); + function Surface() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._vertices = []; + _this._deformVertices = []; + /** + * - x1, y1, x2, y2, x3, y3, x4, y4, d1X, d1Y, d2X, d2Y + */ + _this._hullCache = []; + /** + * - Inside [flag, a, b, c, d, tx, ty], Outside [flag, a, b, c, d, tx, ty] + */ + _this._matrixCahce = []; + return _this; + } + Surface.toString = function () { + return "[class dragonBones.Surface]"; + }; + Surface.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._dX = 0.0; + this._dY = 0.0; + this._k = 0.0; + this._kX = 0.0; + this._kY = 0.0; + this._vertices.length = 0; + this._deformVertices.length = 0; + this._matrixCahce.length = 0; + this._hullCache.length = 0; + this._bone = null; + }; + Surface.prototype._getAffineTransform = function (x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown) { + var dabX = bX - aX; + var dabY = bY - aY; + var dacX = cX - aX; + var dacY = cY - aY; + transform.rotation = Math.atan2(dabY, dabX); + transform.skew = Math.atan2(dacY, dacX) - Math.PI * 0.5 - transform.rotation; + if (isDown) { + transform.rotation += Math.PI; + } + transform.scaleX = Math.sqrt(dabX * dabX + dabY * dabY) / lX; + transform.scaleY = Math.sqrt(dacX * dacX + dacY * dacY) / lY; + transform.toMatrix(matrix); + transform.x = matrix.tx = aX - (matrix.a * x + matrix.c * y); + transform.y = matrix.ty = aY - (matrix.b * x + matrix.d * y); + }; + Surface.prototype._updateVertices = function () { + var data = this._armature.armatureData.parent; + var geometry = this._boneData.geometry; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometry.offset + 0 /* GeometryVertexCount */]; + var verticesOffset = intArray[geometry.offset + 2 /* GeometryFloatOffset */]; + var vertices = this._vertices; + var animationVertices = this._deformVertices; + if (this._parent !== null) { + if (this._parent._boneData.type === 1 /* Surface */) { + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + var x = floatArray[verticesOffset + iD] + animationVertices[iD]; + var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + var matrix = this._parent._getGlobalTransformMatrix(x, y); + // + vertices[iD] = matrix.a * x + matrix.c * y + matrix.tx; + vertices[iD + 1] = matrix.b * x + matrix.d * y + matrix.ty; + } + } + else { + var parentMatrix = this._parent.globalTransformMatrix; + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + var x = floatArray[verticesOffset + iD] + animationVertices[iD]; + var y = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + // + vertices[iD] = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; + vertices[iD + 1] = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; + } + } + } + else { + for (var i = 0, l = vertexCount; i < l; ++i) { + var iD = i * 2; + vertices[iD] = floatArray[verticesOffset + iD] + animationVertices[iD]; + vertices[iD + 1] = floatArray[verticesOffset + iD + 1] + animationVertices[iD + 1]; + } + } + }; + Surface.prototype._updateGlobalTransformMatrix = function (isCache) { + // tslint:disable-next-line:no-unused-expression + isCache; + var segmentXD = this._boneData.segmentX * 2; + var lastIndex = this._vertices.length - 2; + var lA = 200.0; + // + var raX = this._vertices[0]; + var raY = this._vertices[1]; + var rbX = this._vertices[segmentXD]; + var rbY = this._vertices[segmentXD + 1]; + var rcX = this._vertices[lastIndex]; + var rcY = this._vertices[lastIndex + 1]; + var rdX = this._vertices[lastIndex - segmentXD]; + var rdY = this._vertices[lastIndex - segmentXD + 1]; + // + var dacX = raX + (rcX - raX) * 0.5; + var dacY = raY + (rcY - raY) * 0.5; + var dbdX = rbX + (rdX - rbX) * 0.5; + var dbdY = rbY + (rdY - rbY) * 0.5; + var aX = dacX + (dbdX - dacX) * 0.5; + var aY = dacY + (dbdY - dacY) * 0.5; + var bX = rbX + (rcX - rbX) * 0.5; + var bY = rbY + (rcY - rbY) * 0.5; + var cX = rdX + (rcX - rdX) * 0.5; + var cY = rdY + (rcY - rdY) * 0.5; + // TODO interpolation + this._getAffineTransform(0.0, 0.0, lA, lA, aX, aY, bX, bY, cX, cY, this.global, this.globalTransformMatrix, false); + this._globalDirty = false; + }; + Surface.prototype._getGlobalTransformMatrix = function (x, y) { + var lA = 200.0; + var lB = 1000.0; + if (x < -lB || lB < x || y < -lB || lB < y) { + return this.globalTransformMatrix; + } + var isDown = false; + var surfaceData = this._boneData; + var segmentX = surfaceData.segmentX; + var segmentY = surfaceData.segmentY; + var segmentXD = surfaceData.segmentX * 2; + var dX = this._dX; + var dY = this._dY; + var indexX = Math.floor((x + lA) / dX); // -1 ~ segmentX - 1 + var indexY = Math.floor((y + lA) / dY); // -1 ~ segmentY - 1 + var matrixIndex = 0; + var pX = indexX * dX - lA; + var pY = indexY * dY - lA; + // + var matrices = this._matrixCahce; + var helpMatrix = Surface._helpMatrix; + if (x < -lA) { + if (y < -lA || y >= lA) { // Out. + return this.globalTransformMatrix; + } + // Left. + isDown = y > this._kX * (x + lA) + pY; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + segmentY + indexY) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexY * (segmentXD + 2); + var ddX = this._hullCache[4]; + var ddY = this._hullCache[5]; + var sX = this._hullCache[2] - (segmentY - indexY) * ddX; + var sY = this._hullCache[3] - (segmentY - indexY) * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(-lA, pY + dY, lB - lA, dY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], sX + ddX, sY + ddY, vertices[vertexIndex], vertices[vertexIndex + 1], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(-lB, pY, lB - lA, dY, sX, sY, vertices[vertexIndex], vertices[vertexIndex + 1], sX + ddX, sY + ddY, Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (x >= lA) { + if (y < -lA || y >= lA) { // Out. + return this.globalTransformMatrix; + } + // Right. + isDown = y > this._kX * (x - lB) + pY; + matrixIndex = ((segmentX * segmentY + segmentX + indexY) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = (indexY + 1) * (segmentXD + 2) - 2; + var ddX = this._hullCache[4]; + var ddY = this._hullCache[5]; + var sX = this._hullCache[0] + indexY * ddX; + var sY = this._hullCache[1] + indexY * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(lB, pY + dY, lB - lA, dY, sX + ddX, sY + ddY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], sX, sY, Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(lA, pY, lB - lA, dY, vertices[vertexIndex], vertices[vertexIndex + 1], sX, sY, vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (y < -lA) { + if (x < -lA || x >= lA) { // Out. + return this.globalTransformMatrix; + } + // Up. + isDown = y > this._kY * (x - pX - dX) - lB; + matrixIndex = ((segmentX * segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexX * 2; + var ddX = this._hullCache[10]; + var ddY = this._hullCache[11]; + var sX = this._hullCache[8] + indexX * ddX; + var sY = this._hullCache[9] + indexX * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, -lA, dX, lB - lA, vertices[vertexIndex + 2], vertices[vertexIndex + 3], vertices[vertexIndex], vertices[vertexIndex + 1], sX + ddX, sY + ddY, Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, -lB, dX, lB - lA, sX, sY, sX + ddX, sY + ddY, vertices[vertexIndex], vertices[vertexIndex + 1], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else if (y >= lA) { + if (x < -lA || x >= lA) { // Out. + return this.globalTransformMatrix; + } + // Down + isDown = y > this._kY * (x - pX - dX) + lA; + matrixIndex = ((segmentX * segmentY + segmentX + segmentY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = segmentY * (segmentXD + 2) + indexX * 2; + var ddX = this._hullCache[10]; + var ddY = this._hullCache[11]; + var sX = this._hullCache[6] - (segmentX - indexX) * ddX; + var sY = this._hullCache[7] - (segmentX - indexX) * ddY; + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, lB, dX, lB - lA, sX + ddX, sY + ddY, sX, sY, vertices[vertexIndex + 2], vertices[vertexIndex + 3], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, lA, dX, lB - lA, vertices[vertexIndex], vertices[vertexIndex + 1], vertices[vertexIndex + 2], vertices[vertexIndex + 3], sX, sY, Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + else { // Center. + isDown = y > this._k * (x - pX - dX) + pY; + matrixIndex = ((segmentX * indexY + indexX) * 2 + (isDown ? 1 : 0)) * 7; + if (matrices[matrixIndex] > 0.0) { + helpMatrix.copyFromArray(matrices, matrixIndex + 1); + } + else { + var vertexIndex = indexX * 2 + indexY * (segmentXD + 2); + var vertices = this._vertices; + if (isDown) { + this._getAffineTransform(pX + dX, pY + dY, dX, dY, vertices[vertexIndex + segmentXD + 4], vertices[vertexIndex + segmentXD + 5], vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], vertices[vertexIndex + 2], vertices[vertexIndex + 3], Surface._helpTransform, helpMatrix, true); + } + else { + this._getAffineTransform(pX, pY, dX, dY, vertices[vertexIndex], vertices[vertexIndex + 1], vertices[vertexIndex + 2], vertices[vertexIndex + 3], vertices[vertexIndex + segmentXD + 2], vertices[vertexIndex + segmentXD + 3], Surface._helpTransform, helpMatrix, false); + } + matrices[matrixIndex] = 1.0; + matrices[matrixIndex + 1] = helpMatrix.a; + matrices[matrixIndex + 2] = helpMatrix.b; + matrices[matrixIndex + 3] = helpMatrix.c; + matrices[matrixIndex + 4] = helpMatrix.d; + matrices[matrixIndex + 5] = helpMatrix.tx; + matrices[matrixIndex + 6] = helpMatrix.ty; + } + } + return helpMatrix; + }; + /** + * @internal + * @private + */ + Surface.prototype.init = function (surfaceData, armatureValue) { + if (this._boneData !== null) { + return; + } + _super.prototype.init.call(this, surfaceData, armatureValue); + var segmentX = surfaceData.segmentX; + var segmentY = surfaceData.segmentY; + var vertexCount = this._armature.armatureData.parent.intArray[surfaceData.geometry.offset + 0 /* GeometryVertexCount */]; + var lB = 1000.0; + var lA = 200.0; + // + this._dX = lA * 2.0 / segmentX; + this._dY = lA * 2.0 / segmentY; + this._k = -this._dY / this._dX; + this._kX = -this._dY / (lB - lA); + this._kY = -(lB - lA) / this._dX; + this._vertices.length = vertexCount * 2; + this._deformVertices.length = vertexCount * 2; + this._matrixCahce.length = (segmentX * segmentY + segmentX * 2 + segmentY * 2) * 2 * 7; + this._hullCache.length = 10; + for (var i = 0; i < vertexCount * 2; ++i) { + this._deformVertices[i] = 0.0; + } + if (this._parent !== null) { + if (this._parent.boneData.type === 0 /* Bone */) { + this._bone = this._parent; + } + else { + this._bone = this._parent._bone; + } + } + }; + /** + * @internal + */ + Surface.prototype.update = function (cacheFrameIndex) { + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache. + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { // Has been Cached. + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || + (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet. + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + } + else { + if (this._hasConstraint) { // Update constraints. + for (var _b = 0, _c = this._armature._constraints; _b < _c.length; _b++) { + var constraint = _c[_b]; + if (constraint._root === this) { + constraint.update(); + } + } + } + if (this._transformDirty || (this._parent !== null && this._parent._childrenTransformDirty)) { // Dirty. + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + if (this._transformDirty) { + this._transformDirty = false; + this._childrenTransformDirty = true; + // + for (var i = 0, l = this._matrixCahce.length; i < l; i += 7) { + this._matrixCahce[i] = -1.0; + } + // + this._updateVertices(); + // + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + if (this._localDirty) { + this._updateGlobalTransformMatrix(isCache); + } + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + // Update hull vertices. + var lB = 1000.0; + var lA = 200.0; + var ddX = 2 * this.global.x; + var ddY = 2 * this.global.y; + // + var helpPoint = Surface._helpPoint; + this.globalTransformMatrix.transformPoint(lB, -lA, helpPoint); + this._hullCache[0] = helpPoint.x; + this._hullCache[1] = helpPoint.y; + this._hullCache[2] = ddX - helpPoint.x; + this._hullCache[3] = ddY - helpPoint.y; + this.globalTransformMatrix.transformPoint(0.0, this._dY, helpPoint, true); + this._hullCache[4] = helpPoint.x; + this._hullCache[5] = helpPoint.y; + // + this.globalTransformMatrix.transformPoint(lA, lB, helpPoint); + this._hullCache[6] = helpPoint.x; + this._hullCache[7] = helpPoint.y; + this._hullCache[8] = ddX - helpPoint.x; + this._hullCache[9] = ddY - helpPoint.y; + this.globalTransformMatrix.transformPoint(this._dX, 0.0, helpPoint, true); + this._hullCache[10] = helpPoint.x; + this._hullCache[11] = helpPoint.y; + } + else if (this._childrenTransformDirty) { + this._childrenTransformDirty = false; + } + this._localDirty = true; + }; + return Surface; + }(dragonBones.Bone)); + dragonBones.Surface = Surface; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DisplayFrame = /** @class */ (function (_super) { + __extends(DisplayFrame, _super); + function DisplayFrame() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.deformVertices = []; + return _this; + } + DisplayFrame.toString = function () { + return "[class dragonBones.DisplayFrame]"; + }; + DisplayFrame.prototype._onClear = function () { + this.rawDisplayData = null; + this.displayData = null; + this.textureData = null; + this.display = null; + this.deformVertices.length = 0; + }; + DisplayFrame.prototype.updateDeformVertices = function () { + if (this.rawDisplayData === null || this.deformVertices.length !== 0) { + return; + } + var rawGeometryData; + if (this.rawDisplayData.type === 2 /* Mesh */) { + rawGeometryData = this.rawDisplayData.geometry; + } + else if (this.rawDisplayData.type === 4 /* Path */) { + rawGeometryData = this.rawDisplayData.geometry; + } + else { + return; + } + var vertexCount = 0; + if (rawGeometryData.weight !== null) { + vertexCount = rawGeometryData.weight.count * 2; + } + else { + vertexCount = rawGeometryData.data.intArray[rawGeometryData.offset + 0 /* GeometryVertexCount */] * 2; + } + this.deformVertices.length = vertexCount; + for (var i = 0, l = this.deformVertices.length; i < l; ++i) { + this.deformVertices[i] = 0.0; + } + }; + DisplayFrame.prototype.getGeometryData = function () { + if (this.displayData !== null) { + if (this.displayData.type === 2 /* Mesh */) { + return this.displayData.geometry; + } + if (this.displayData.type === 4 /* Path */) { + return this.displayData.geometry; + } + } + if (this.rawDisplayData !== null) { + if (this.rawDisplayData.type === 2 /* Mesh */) { + return this.rawDisplayData.geometry; + } + if (this.rawDisplayData.type === 4 /* Path */) { + return this.rawDisplayData.geometry; + } + } + return null; + }; + DisplayFrame.prototype.getBoundingBox = function () { + if (this.displayData !== null && this.displayData.type === 3 /* BoundingBox */) { + return this.displayData.boundingBox; + } + if (this.rawDisplayData !== null && this.rawDisplayData.type === 3 /* BoundingBox */) { + return this.rawDisplayData.boundingBox; + } + return null; + }; + DisplayFrame.prototype.getTextureData = function () { + if (this.displayData !== null) { + if (this.displayData.type === 0 /* Image */) { + return this.displayData.texture; + } + if (this.displayData.type === 2 /* Mesh */) { + return this.displayData.texture; + } + } + if (this.textureData !== null) { + return this.textureData; + } + if (this.rawDisplayData !== null) { + if (this.rawDisplayData.type === 0 /* Image */) { + return this.rawDisplayData.texture; + } + if (this.rawDisplayData.type === 2 /* Mesh */) { + return this.rawDisplayData.texture; + } + } + return null; + }; + return DisplayFrame; + }(dragonBones.BaseObject)); + dragonBones.DisplayFrame = DisplayFrame; + /** + * - The slot attached to the armature, controls the display status and properties of the display object. + * A bone can contain multiple slots. + * A slot can contain multiple display objects, displaying only one of the display objects at a time, + * but you can toggle the display object into frame animation while the animation is playing. + * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, + * and a custom other display object. + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 + * 一个骨骼上可以包含多个插槽。 + * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 + * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 + * @see dragonBones.Armature + * @see dragonBones.Bone + * @see dragonBones.SlotData + * @version DragonBones 3.0 + * @language zh_CN + */ + var Slot = /** @class */ (function (_super) { + __extends(Slot, _super); + function Slot() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._localMatrix = new dragonBones.Matrix(); + /** + * @internal + */ + _this._colorTransform = new dragonBones.ColorTransform(); + /** + * @internal + */ + _this._displayFrames = []; + /** + * @internal + */ + _this._geometryBones = []; + _this._rawDisplay = null; // Initial value. + _this._meshDisplay = null; // Initial value. + _this._display = null; + return _this; + } + Slot.prototype._onClear = function () { + _super.prototype._onClear.call(this); + var disposeDisplayList = []; + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var dispayFrame = _a[_i]; + var display = dispayFrame.display; + if (display !== this._rawDisplay && display !== this._meshDisplay && + disposeDisplayList.indexOf(display) < 0) { + disposeDisplayList.push(display); + } + dispayFrame.returnToPool(); + } + for (var _b = 0, disposeDisplayList_1 = disposeDisplayList; _b < disposeDisplayList_1.length; _b++) { + var eachDisplay = disposeDisplayList_1[_b]; + if (eachDisplay instanceof dragonBones.Armature) { + eachDisplay.dispose(); + } + else { + this._disposeDisplay(eachDisplay, true); + } + } + if (this._meshDisplay !== null && this._meshDisplay !== this._rawDisplay) { // May be _meshDisplay and _rawDisplay is the same one. + this._disposeDisplay(this._meshDisplay, false); + } + if (this._rawDisplay !== null) { + this._disposeDisplay(this._rawDisplay, false); + } + this.displayController = null; + this._displayDataDirty = false; + this._displayDirty = false; + this._geometryDirty = false; + this._textureDirty = false; + this._visibleDirty = false; + this._blendModeDirty = false; + this._zOrderDirty = false; + this._colorDirty = false; + this._verticesDirty = false; + this._transformDirty = false; + this._visible = true; + this._blendMode = 0 /* Normal */; + this._displayIndex = -1; + this._animationDisplayIndex = -1; + this._zOrder = 0; + this._zIndex = 0; + this._cachedFrameIndex = -1; + this._pivotX = 0.0; + this._pivotY = 0.0; + this._localMatrix.identity(); + this._colorTransform.identity(); + this._displayFrames.length = 0; + this._geometryBones.length = 0; + this._slotData = null; // + this._displayFrame = null; + this._geometryData = null; + this._boundingBoxData = null; + this._textureData = null; + this._rawDisplay = null; + this._meshDisplay = null; + this._display = null; + this._childArmature = null; + this._parent = null; // + this._cachedFrameIndices = null; + }; + Slot.prototype._hasDisplay = function (display) { + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var displayFrame = _a[_i]; + if (displayFrame.display === display) { + return true; + } + } + return false; + }; + /** + * @internal + */ + Slot.prototype._isBonesUpdate = function () { + for (var _i = 0, _a = this._geometryBones; _i < _a.length; _i++) { + var bone = _a[_i]; + if (bone !== null && bone._childrenTransformDirty) { + return true; + } + } + return false; + }; + /** + * @internal + */ + Slot.prototype._updateAlpha = function () { + var globalAlpha = this._alpha * this._parent._globalAlpha; + if (this._globalAlpha !== globalAlpha) { + this._globalAlpha = globalAlpha; + this._colorDirty = true; + } + }; + Slot.prototype._updateDisplayData = function () { + var prevDisplayFrame = this._displayFrame; + var prevGeometryData = this._geometryData; + var prevTextureData = this._textureData; + var rawDisplayData = null; + var displayData = null; + this._displayFrame = null; + this._geometryData = null; + this._boundingBoxData = null; + this._textureData = null; + if (this._displayIndex >= 0 && this._displayIndex < this._displayFrames.length) { + this._displayFrame = this._displayFrames[this._displayIndex]; + rawDisplayData = this._displayFrame.rawDisplayData; + displayData = this._displayFrame.displayData; + this._geometryData = this._displayFrame.getGeometryData(); + this._boundingBoxData = this._displayFrame.getBoundingBox(); + this._textureData = this._displayFrame.getTextureData(); + } + if (this._displayFrame !== prevDisplayFrame || + this._geometryData !== prevGeometryData || this._textureData !== prevTextureData) { + // Update pivot offset. + if (this._geometryData === null && this._textureData !== null) { + var imageDisplayData = ((displayData !== null && displayData.type === 0 /* Image */) ? displayData : rawDisplayData); // + var scale = this._textureData.parent.scale * this._armature._armatureData.scale; + var frame = this._textureData.frame; + this._pivotX = imageDisplayData.pivot.x; + this._pivotY = imageDisplayData.pivot.y; + var rect = frame !== null ? frame : this._textureData.region; + var width = rect.width; + var height = rect.height; + if (this._textureData.rotated && frame === null) { + width = rect.height; + height = rect.width; + } + this._pivotX *= width * scale; + this._pivotY *= height * scale; + if (frame !== null) { + this._pivotX += frame.x * scale; + this._pivotY += frame.y * scale; + } + // Update replace pivot. TODO + if (rawDisplayData !== null && imageDisplayData !== rawDisplayData) { + rawDisplayData.transform.toMatrix(Slot._helpMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint); + this._pivotX -= Slot._helpPoint.x; + this._pivotY -= Slot._helpPoint.y; + imageDisplayData.transform.toMatrix(Slot._helpMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(0.0, 0.0, Slot._helpPoint); + this._pivotX += Slot._helpPoint.x; + this._pivotY += Slot._helpPoint.y; + } + if (!dragonBones.DragonBones.yDown) { + this._pivotY = (this._textureData.rotated ? this._textureData.region.width : this._textureData.region.height) * scale - this._pivotY; + } + } + else { + this._pivotX = 0.0; + this._pivotY = 0.0; + } + // Update original transform. + if (rawDisplayData !== null) { // Compatible. + this.origin = rawDisplayData.transform; + } + else if (displayData !== null) { // Compatible. + this.origin = displayData.transform; + } + else { + this.origin = null; + } + // TODO remove slot offset. + if (this.origin !== null) { + this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix); + } + else { + this.global.copyFrom(this.offset).toMatrix(this._localMatrix); + } + // Update geometry. + if (this._geometryData !== prevGeometryData) { + this._geometryDirty = true; + this._verticesDirty = true; + if (this._geometryData !== null) { + this._geometryBones.length = 0; + if (this._geometryData.weight !== null) { + for (var i = 0, l = this._geometryData.weight.bones.length; i < l; ++i) { + var bone = this._armature.getBone(this._geometryData.weight.bones[i].name); + this._geometryBones.push(bone); + } + } + } + else { + this._geometryBones.length = 0; + this._geometryData = null; + } + } + this._textureDirty = this._textureData !== prevTextureData; + this._transformDirty = true; + } + }; + Slot.prototype._updateDisplay = function () { + var prevDisplay = this._display !== null ? this._display : this._rawDisplay; + var prevChildArmature = this._childArmature; + // Update display and child armature. + if (this._displayFrame !== null) { + this._display = this._displayFrame.display; + if (this._display !== null && this._display instanceof dragonBones.Armature) { + this._childArmature = this._display; + this._display = this._childArmature.display; + } + else { + this._childArmature = null; + } + } + else { + this._display = null; + this._childArmature = null; + } + // Update display. + var currentDisplay = this._display !== null ? this._display : this._rawDisplay; + if (currentDisplay !== prevDisplay) { + this._textureDirty = true; + this._visibleDirty = true; + this._blendModeDirty = true; + // this._zOrderDirty = true; + this._colorDirty = true; + this._transformDirty = true; + this._onUpdateDisplay(); + this._replaceDisplay(prevDisplay); + } + // Update child armature. + if (this._childArmature !== prevChildArmature) { + if (prevChildArmature !== null) { + prevChildArmature._parent = null; // Update child armature parent. + prevChildArmature.clock = null; + if (prevChildArmature.inheritAnimation) { + prevChildArmature.animation.reset(); + } + } + if (this._childArmature !== null) { + this._childArmature._parent = this; // Update child armature parent. + this._childArmature.clock = this._armature.clock; + if (this._childArmature.inheritAnimation) { // Set child armature cache frameRate. + if (this._childArmature.cacheFrameRate === 0) { + var cacheFrameRate = this._armature.cacheFrameRate; + if (cacheFrameRate !== 0) { + this._childArmature.cacheFrameRate = cacheFrameRate; + } + } + // Child armature action. + if (this._displayFrame !== null) { + var actions = null; + var displayData = this._displayFrame.displayData !== null ? this._displayFrame.displayData : this._displayFrame.rawDisplayData; + if (displayData !== null && displayData.type === 1 /* Armature */) { + actions = displayData.actions; + } + if (actions !== null && actions.length > 0) { + for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) { + var action = actions_1[_i]; + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + eventObject.slot = this; + this._armature._bufferAction(eventObject, false); + } + } + else { + this._childArmature.animation.play(); + } + } + } + } + } + }; + Slot.prototype._updateGlobalTransformMatrix = function (isCache) { + var parentMatrix = this._parent._boneData.type === 0 /* Bone */ ? this._parent.globalTransformMatrix : this._parent._getGlobalTransformMatrix(this.global.x, this.global.y); + this.globalTransformMatrix.copyFrom(this._localMatrix); + this.globalTransformMatrix.concat(parentMatrix); + if (isCache) { + this.global.fromMatrix(this.globalTransformMatrix); + } + else { + this._globalDirty = true; + } + }; + /** + * @internal + */ + Slot.prototype._setDisplayIndex = function (value, isAnimation) { + if (isAnimation === void 0) { isAnimation = false; } + if (isAnimation) { + if (this._animationDisplayIndex === value) { + return; + } + this._animationDisplayIndex = value; + } + if (this._displayIndex === value) { + return; + } + this._displayIndex = value < this._displayFrames.length ? value : this._displayFrames.length - 1; + this._displayDataDirty = true; + this._displayDirty = this._displayIndex < 0 || this._display !== this._displayFrames[this._displayIndex].display; + }; + /** + * @internal + */ + Slot.prototype._setZOrder = function (value) { + if (this._zOrder === value) { + // return false; + } + this._zOrder = value; + this._zOrderDirty = true; + return this._zOrderDirty; + }; + /** + * @internal + */ + Slot.prototype._setColor = function (value) { + this._colorTransform.copyFrom(value); + return this._colorDirty = true; + }; + /** + * @internal + */ + Slot.prototype.init = function (slotData, armatureValue, rawDisplay, meshDisplay) { + if (this._slotData !== null) { + return; + } + this._slotData = slotData; + this._colorDirty = true; // + this._blendModeDirty = true; // + this._blendMode = this._slotData.blendMode; + this._zOrder = this._slotData.zOrder; + this._zIndex = this._slotData.zIndex; + this._alpha = this._slotData.alpha; + this._colorTransform.copyFrom(this._slotData.color); + this._rawDisplay = rawDisplay; + this._meshDisplay = meshDisplay; + // + this._armature = armatureValue; + var slotParent = this._armature.getBone(this._slotData.parent.name); + if (slotParent !== null) { + this._parent = slotParent; + } + else { + // Never; + } + this._armature._addSlot(this); + // + this._initDisplay(this._rawDisplay, false); + if (this._rawDisplay !== this._meshDisplay) { + this._initDisplay(this._meshDisplay, false); + } + this._onUpdateDisplay(); + this._addDisplay(); + }; + /** + * @internal + */ + Slot.prototype.update = function (cacheFrameIndex) { + if (this._displayDataDirty) { + this._updateDisplayData(); + this._displayDataDirty = false; + } + if (this._displayDirty) { + this._updateDisplay(); + this._displayDirty = false; + } + if (this._geometryDirty || this._textureDirty) { + if (this._display === null || this._display === this._rawDisplay || this._display === this._meshDisplay) { + this._updateFrame(); + } + this._geometryDirty = false; + this._textureDirty = false; + } + if (this._display === null) { + return; + } + if (this._visibleDirty) { + this._updateVisible(); + this._visibleDirty = false; + } + if (this._blendModeDirty) { + this._updateBlendMode(); + this._blendModeDirty = false; + } + if (this._colorDirty) { + this._updateColor(); + this._colorDirty = false; + } + if (this._zOrderDirty) { + this._updateZOrder(); + this._zOrderDirty = false; + } + if (this._geometryData !== null && this._display === this._meshDisplay) { + var isSkinned = this._geometryData.weight !== null; + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + if (this._verticesDirty || + (isSkinned && this._isBonesUpdate()) || + (isSurface && this._parent._childrenTransformDirty)) { + this._verticesDirty = false; // Allow update mesh to reset the dirty value. + this._updateMesh(); + } + if (isSkinned || isSurface) { // Compatible. + return; + } + } + if (cacheFrameIndex >= 0 && this._cachedFrameIndices !== null) { + var cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex]; + if (cachedFrameIndex >= 0 && this._cachedFrameIndex === cachedFrameIndex) { // Same cache. + this._transformDirty = false; + } + else if (cachedFrameIndex >= 0) { // Has been Cached. + this._transformDirty = true; + this._cachedFrameIndex = cachedFrameIndex; + } + else if (this._transformDirty || this._parent._childrenTransformDirty) { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + else if (this._cachedFrameIndex >= 0) { // Same cache, but not set index yet. + this._transformDirty = false; + this._cachedFrameIndices[cacheFrameIndex] = this._cachedFrameIndex; + } + else { // Dirty. + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + } + else if (this._transformDirty || this._parent._childrenTransformDirty) { // Dirty. + cacheFrameIndex = -1; + this._transformDirty = true; + this._cachedFrameIndex = -1; + } + if (this._transformDirty) { + if (this._cachedFrameIndex < 0) { + var isCache = cacheFrameIndex >= 0; + this._updateGlobalTransformMatrix(isCache); + if (isCache && this._cachedFrameIndices !== null) { + this._cachedFrameIndex = this._cachedFrameIndices[cacheFrameIndex] = this._armature._armatureData.setCacheFrame(this.globalTransformMatrix, this.global); + } + } + else { + this._armature._armatureData.getCacheFrame(this.globalTransformMatrix, this.global, this._cachedFrameIndex); + } + this._updateTransform(); + this._transformDirty = false; + } + }; + /** + * - Forces the slot to update the state of the display object in the next frame. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 强制插槽在下一帧更新显示对象的状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Slot.prototype.invalidUpdate = function () { + this._displayDataDirty = true; + this._displayDirty = true; + // + this._transformDirty = true; + }; + /** + * @private + */ + Slot.prototype.updateTransformAndMatrix = function () { + if (this._transformDirty) { + this._updateGlobalTransformMatrix(false); + this._transformDirty = false; + } + }; + /** + * @private + */ + Slot.prototype.replaceRawDisplayData = function (displayData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.rawDisplayData !== displayData) { + displayFrame.deformVertices.length = 0; + displayFrame.rawDisplayData = displayData; + if (displayFrame.rawDisplayData === null) { + var defaultSkin = this._armature._armatureData.defaultSkin; + if (defaultSkin !== null) { + var defaultRawDisplayDatas = defaultSkin.getDisplays(this._slotData.name); + if (defaultRawDisplayDatas !== null && index < defaultRawDisplayDatas.length) { + displayFrame.rawDisplayData = defaultRawDisplayDatas[index]; + } + } + } + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceDisplayData = function (displayData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.displayData !== displayData && displayFrame.rawDisplayData !== displayData) { + displayFrame.displayData = displayData; + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceTextureData = function (textureData, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.textureData !== textureData) { + displayFrame.textureData = textureData; + if (index === this._displayIndex) { + this._displayDataDirty = true; + } + } + }; + /** + * @private + */ + Slot.prototype.replaceDisplay = function (value, index) { + if (index === void 0) { index = -1; } + if (index < 0) { + index = this._displayIndex < 0 ? 0 : this._displayIndex; + } + else if (index >= this._displayFrames.length) { + return; + } + var displayFrame = this._displayFrames[index]; + if (displayFrame.display !== value) { + var prevDisplay = displayFrame.display; + displayFrame.display = value; + if (prevDisplay !== null && + prevDisplay !== this._rawDisplay && prevDisplay !== this._meshDisplay && + !this._hasDisplay(prevDisplay)) { + if (prevDisplay instanceof dragonBones.Armature) { + // (eachDisplay as Armature).dispose(); + } + else { + this._disposeDisplay(prevDisplay, true); + } + } + if (value !== null && + value !== this._rawDisplay && value !== this._meshDisplay && + !this._hasDisplay(prevDisplay) && + !(value instanceof dragonBones.Armature)) { + this._initDisplay(value, true); + } + if (index === this._displayIndex) { + this._displayDirty = true; + } + } + }; + /** + * - Check whether a specific point is inside a custom bounding box in the slot. + * The coordinate system of the point is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param x - The horizontal coordinate of the point. + * @param y - The vertical coordinate of the point. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定点是否在插槽的自定义边界框内。 + * 点的坐标系为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param x - 点的水平坐标。 + * @param y - 点的垂直坐标。 + * @version DragonBones 5.0 + * @language zh_CN + */ + Slot.prototype.containsPoint = function (x, y) { + if (this._boundingBoxData === null) { + return false; + } + this.updateTransformAndMatrix(); + Slot._helpMatrix.copyFrom(this.globalTransformMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(x, y, Slot._helpPoint); + return this._boundingBoxData.containsPoint(Slot._helpPoint.x, Slot._helpPoint.y); + }; + /** + * - Check whether a specific segment intersects a custom bounding box for the slot. + * The coordinate system of the segment and intersection is the inner coordinate system of the armature. + * Custom bounding boxes need to be customized in Dragonbones Pro. + * @param xA - The horizontal coordinate of the beginning of the segment. + * @param yA - The vertical coordinate of the beginning of the segment. + * @param xB - The horizontal coordinate of the end point of the segment. + * @param yB - The vertical coordinate of the end point of the segment. + * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) + * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) + * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) + * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 检查特定线段是否与插槽的自定义边界框相交。 + * 线段和交点的坐标系均为骨架内坐标系。 + * 自定义边界框需要在 DragonBones Pro 中自定义。 + * @param xA - 线段起点的水平坐标。 + * @param yA - 线段起点的垂直坐标。 + * @param xB - 线段终点的水平坐标。 + * @param yB - 线段终点的垂直坐标。 + * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) + * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) + * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] + * @version DragonBones 5.0 + * @language zh_CN + */ + Slot.prototype.intersectsSegment = function (xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians) { + if (intersectionPointA === void 0) { intersectionPointA = null; } + if (intersectionPointB === void 0) { intersectionPointB = null; } + if (normalRadians === void 0) { normalRadians = null; } + if (this._boundingBoxData === null) { + return 0; + } + this.updateTransformAndMatrix(); + Slot._helpMatrix.copyFrom(this.globalTransformMatrix); + Slot._helpMatrix.invert(); + Slot._helpMatrix.transformPoint(xA, yA, Slot._helpPoint); + xA = Slot._helpPoint.x; + yA = Slot._helpPoint.y; + Slot._helpMatrix.transformPoint(xB, yB, Slot._helpPoint); + xB = Slot._helpPoint.x; + yB = Slot._helpPoint.y; + var intersectionCount = this._boundingBoxData.intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); + if (intersectionCount > 0) { + if (intersectionCount === 1 || intersectionCount === 2) { + if (intersectionPointA !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointA.x, intersectionPointA.y, intersectionPointA); + if (intersectionPointB !== null) { + intersectionPointB.x = intersectionPointA.x; + intersectionPointB.y = intersectionPointA.y; + } + } + else if (intersectionPointB !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointB.x, intersectionPointB.y, intersectionPointB); + } + } + else { + if (intersectionPointA !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointA.x, intersectionPointA.y, intersectionPointA); + } + if (intersectionPointB !== null) { + this.globalTransformMatrix.transformPoint(intersectionPointB.x, intersectionPointB.y, intersectionPointB); + } + } + if (normalRadians !== null) { + this.globalTransformMatrix.transformPoint(Math.cos(normalRadians.x), Math.sin(normalRadians.x), Slot._helpPoint, true); + normalRadians.x = Math.atan2(Slot._helpPoint.y, Slot._helpPoint.x); + this.globalTransformMatrix.transformPoint(Math.cos(normalRadians.y), Math.sin(normalRadians.y), Slot._helpPoint, true); + normalRadians.y = Math.atan2(Slot._helpPoint.y, Slot._helpPoint.x); + } + } + return intersectionCount; + }; + /** + * @private + */ + Slot.prototype.getDisplayFrameAt = function (index) { + return this._displayFrames[index]; + }; + Object.defineProperty(Slot.prototype, "visible", { + /** + * - The visible of slot's display object. + * @default true + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 插槽的显示对象的可见。 + * @default true + * @version DragonBones 5.6 + * @language zh_CN + */ + get: function () { + return this._visible; + }, + set: function (value) { + if (this._visible === value) { + return; + } + this._visible = value; + this._updateVisible(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayFrameCount", { + /** + * @private + */ + get: function () { + return this._displayFrames.length; + }, + set: function (value) { + var prevCount = this._displayFrames.length; + if (prevCount < value) { + this._displayFrames.length = value; + for (var i = prevCount; i < value; ++i) { + this._displayFrames[i] = dragonBones.BaseObject.borrowObject(DisplayFrame); + } + } + else if (prevCount > value) { + for (var i = prevCount - 1; i < value; --i) { + this.replaceDisplay(null, i); + this._displayFrames[i].returnToPool(); + } + this._displayFrames.length = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayIndex", { + /** + * - The index of the display object displayed in the display list. + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     slot.displayIndex = 3;
+             *     slot.displayController = "none";
+             * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 此时显示的显示对象在显示列表中的索引。 + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     slot.displayIndex = 3;
+             *     slot.displayController = "none";
+             * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._displayIndex; + }, + set: function (value) { + this._setDisplayIndex(value); + this.update(-1); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "name", { + /** + * - The slot name. + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽名称。 + * @see dragonBones.SlotData#name + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._slotData.name; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "displayList", { + /** + * - Contains a display list of display objects or child armatures. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 包含显示对象或子骨架的显示列表。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + var displays = new Array(); + for (var _i = 0, _a = this._displayFrames; _i < _a.length; _i++) { + var displayFrame = _a[_i]; + displays.push(displayFrame.display); + } + return displays; + }, + set: function (value) { + this.displayFrameCount = value.length; + var index = 0; + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var eachDisplay = value_1[_i]; + this.replaceDisplay(eachDisplay, index++); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "slotData", { + /** + * - The slot data. + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 插槽数据。 + * @see dragonBones.SlotData + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._slotData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "boundingBoxData", { + /** + * - The custom bounding box data for the slot at current time. + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 插槽此时的自定义包围盒数据。 + * @version DragonBones 5.0 + * @language zh_CN + */ + get: function () { + return this._boundingBoxData; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "rawDisplay", { + /** + * @private + */ + get: function () { + return this._rawDisplay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "meshDisplay", { + /** + * @private + */ + get: function () { + return this._meshDisplay; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "display", { + /** + * - The display object that the slot displays at this time. + * @example + *
+             *     let slot = armature.getSlot("text");
+             *     slot.display = new yourEngine.TextField();
+             * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的显示对象。 + * @example + *
+             *     let slot = armature.getSlot("text");
+             *     slot.display = new yourEngine.TextField();
+             * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._display; + }, + set: function (value) { + if (this._display === value) { + return; + } + if (this._displayFrames.length === 0) { + this.displayFrameCount = 1; + this._displayIndex = 0; + } + this.replaceDisplay(value, this._displayIndex); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "childArmature", { + /** + * - The child armature that the slot displayed at current time. + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
+             *     }
+             *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+             * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 插槽此时显示的子骨架。 + * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 + * @example + *
+             *     let slot = armature.getSlot("weapon");
+             *     let prevChildArmature = slot.childArmature;
+             *     if (prevChildArmature) {
+             *         prevChildArmature.dispose();
+             *     }
+             *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
+             * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._childArmature; + }, + set: function (value) { + if (this._childArmature === value) { + return; + } + this.display = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Slot.prototype, "parent", { + /** + * - The parent bone to which it belongs. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 所属的父骨骼。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._parent; + }, + enumerable: true, + configurable: true + }); + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Slot.prototype.getDisplay = function () { + return this._display; + }; + /** + * - Deprecated, please refer to {@link #display}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link #display}。 + * @deprecated + * @language zh_CN + */ + Slot.prototype.setDisplay = function (value) { + this.display = value; + }; + return Slot; + }(dragonBones.TransformObject)); + dragonBones.Slot = Slot; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var Constraint = /** @class */ (function (_super) { + __extends(Constraint, _super); + function Constraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + Constraint.prototype._onClear = function () { + this._armature = null; // + this._target = null; // + this._root = null; // + this._bone = null; + }; + Object.defineProperty(Constraint.prototype, "name", { + get: function () { + return this._constraintData.name; + }, + enumerable: true, + configurable: true + }); + Constraint._helpMatrix = new dragonBones.Matrix(); + Constraint._helpTransform = new dragonBones.Transform(); + Constraint._helpPoint = new dragonBones.Point(); + return Constraint; + }(dragonBones.BaseObject)); + dragonBones.Constraint = Constraint; + /** + * @internal + */ + var IKConstraint = /** @class */ (function (_super) { + __extends(IKConstraint, _super); + function IKConstraint() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraint.toString = function () { + return "[class dragonBones.IKConstraint]"; + }; + IKConstraint.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._scaleEnabled = false; + this._bendPositive = false; + this._weight = 1.0; + this._constraintData = null; + }; + IKConstraint.prototype._computeA = function () { + var ikGlobal = this._target.global; + var global = this._root.global; + var globalTransformMatrix = this._root.globalTransformMatrix; + var radian = Math.atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); + if (global.scaleX < 0.0) { + radian += Math.PI; + } + global.rotation += dragonBones.Transform.normalizeRadian(radian - global.rotation) * this._weight; + global.toMatrix(globalTransformMatrix); + }; + IKConstraint.prototype._computeB = function () { + var boneLength = this._bone._boneData.length; + var parent = this._root; + var ikGlobal = this._target.global; + var parentGlobal = parent.global; + var global = this._bone.global; + var globalTransformMatrix = this._bone.globalTransformMatrix; + var x = globalTransformMatrix.a * boneLength; + var y = globalTransformMatrix.b * boneLength; + var lLL = x * x + y * y; + var lL = Math.sqrt(lLL); + var dX = global.x - parentGlobal.x; + var dY = global.y - parentGlobal.y; + var lPP = dX * dX + dY * dY; + var lP = Math.sqrt(lPP); + var rawRadian = global.rotation; + var rawParentRadian = parentGlobal.rotation; + var rawRadianA = Math.atan2(dY, dX); + dX = ikGlobal.x - parentGlobal.x; + dY = ikGlobal.y - parentGlobal.y; + var lTT = dX * dX + dY * dY; + var lT = Math.sqrt(lTT); + var radianA = 0.0; + if (lL + lP <= lT || lT + lL <= lP || lT + lP <= lL) { + radianA = Math.atan2(ikGlobal.y - parentGlobal.y, ikGlobal.x - parentGlobal.x); + if (lL + lP <= lT) { + } + else if (lP < lL) { + radianA += Math.PI; + } + } + else { + var h = (lPP - lLL + lTT) / (2.0 * lTT); + var r = Math.sqrt(lPP - h * h * lTT) / lT; + var hX = parentGlobal.x + (dX * h); + var hY = parentGlobal.y + (dY * h); + var rX = -dY * r; + var rY = dX * r; + var isPPR = false; + var parentParent = parent.parent; + if (parentParent !== null) { + var parentParentMatrix = parentParent.globalTransformMatrix; + isPPR = parentParentMatrix.a * parentParentMatrix.d - parentParentMatrix.b * parentParentMatrix.c < 0.0; + } + if (isPPR !== this._bendPositive) { + global.x = hX - rX; + global.y = hY - rY; + } + else { + global.x = hX + rX; + global.y = hY + rY; + } + radianA = Math.atan2(global.y - parentGlobal.y, global.x - parentGlobal.x); + } + var dR = dragonBones.Transform.normalizeRadian(radianA - rawRadianA); + parentGlobal.rotation = rawParentRadian + dR * this._weight; + parentGlobal.toMatrix(parent.globalTransformMatrix); + // + var currentRadianA = rawRadianA + dR * this._weight; + global.x = parentGlobal.x + Math.cos(currentRadianA) * lP; + global.y = parentGlobal.y + Math.sin(currentRadianA) * lP; + // + var radianB = Math.atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); + if (global.scaleX < 0.0) { + radianB += Math.PI; + } + global.rotation = parentGlobal.rotation + rawRadian - rawParentRadian + dragonBones.Transform.normalizeRadian(radianB - dR - rawRadian) * this._weight; + global.toMatrix(globalTransformMatrix); + }; + IKConstraint.prototype.init = function (constraintData, armature) { + if (this._constraintData !== null) { + return; + } + this._constraintData = constraintData; + this._armature = armature; + this._target = this._armature.getBone(this._constraintData.target.name); + this._root = this._armature.getBone(this._constraintData.root.name); + this._bone = this._constraintData.bone !== null ? this._armature.getBone(this._constraintData.bone.name) : null; + { + var ikConstraintData = this._constraintData; + this._scaleEnabled = ikConstraintData.scaleEnabled; + this._bendPositive = ikConstraintData.bendPositive; + this._weight = ikConstraintData.weight; + } + this._root._hasConstraint = true; + }; + IKConstraint.prototype.update = function () { + this._root.updateByConstraint(); + if (this._bone !== null) { + this._bone.updateByConstraint(); + this._computeB(); + } + else { + this._computeA(); + } + }; + IKConstraint.prototype.invalidUpdate = function () { + this._root.invalidUpdate(); + if (this._bone !== null) { + this._bone.invalidUpdate(); + } + }; + return IKConstraint; + }(Constraint)); + dragonBones.IKConstraint = IKConstraint; + /** + * @internal + */ + var PathConstraint = /** @class */ (function (_super) { + __extends(PathConstraint, _super); + function PathConstraint() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._bones = []; + _this._spaces = []; + _this._positions = []; + _this._curves = []; + _this._boneLengths = []; + _this._pathGlobalVertices = []; + _this._segments = [10]; + return _this; + } + PathConstraint.toString = function () { + return "[class dragonBones.PathConstraint]"; + }; + PathConstraint.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.dirty = false; + this.pathOffset = 0; + this.position = 0.0; + this.spacing = 0.0; + this.rotateOffset = 0.0; + this.rotateMix = 1.0; + this.translateMix = 1.0; + this._pathSlot = null; + this._bones.length = 0; + this._spaces.length = 0; + this._positions.length = 0; + this._curves.length = 0; + this._boneLengths.length = 0; + this._pathGlobalVertices.length = 0; + }; + PathConstraint.prototype._updatePathVertices = function (verticesData) { + //计算曲线的节点数据 + var armature = this._armature; + var dragonBonesData = armature.armatureData.parent; + var scale = armature.armatureData.scale; + var intArray = dragonBonesData.intArray; + var floatArray = dragonBonesData.floatArray; + var pathOffset = verticesData.offset; + var pathVertexCount = intArray[pathOffset + 0 /* GeometryVertexCount */]; + var pathVertexOffset = intArray[pathOffset + 2 /* GeometryFloatOffset */]; + this._pathGlobalVertices.length = pathVertexCount * 2; + var weightData = verticesData.weight; + //没有骨骼约束我,那节点只受自己的Bone控制 + if (weightData === null) { + var parentBone = this._pathSlot.parent; + parentBone.updateByConstraint(); + var matrix = parentBone.globalTransformMatrix; + for (var i = 0, iV_1 = pathVertexOffset; i < pathVertexCount; i += 2) { + var vx = floatArray[iV_1++] * scale; + var vy = floatArray[iV_1++] * scale; + var x = matrix.a * vx + matrix.c * vy + matrix.tx; + var y = matrix.b * vx + matrix.d * vy + matrix.ty; + // + this._pathGlobalVertices[i] = x; + this._pathGlobalVertices[i + 1] = y; + } + return; + } + //有骨骼约束我,那我的节点受骨骼权重控制 + var bones = this._pathSlot._geometryBones; + var weightBoneCount = weightData.bones.length; + var weightOffset = weightData.offset; + var floatOffset = intArray[weightOffset + 1 /* WeigthFloatOffset */]; + var iV = floatOffset; + var iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount; + for (var i = 0, iW = 0; i < pathVertexCount; i++) { + var vertexBoneCount = intArray[iB++]; // + var xG = 0.0, yG = 0.0; + for (var ii = 0, ll = vertexBoneCount; ii < ll; ii++) { + var boneIndex = intArray[iB++]; + var bone = bones[boneIndex]; + if (bone === null) { + continue; + } + bone.updateByConstraint(); + var matrix = bone.globalTransformMatrix; + var weight = floatArray[iV++]; + var vx = floatArray[iV++] * scale; + var vy = floatArray[iV++] * scale; + xG += (matrix.a * vx + matrix.c * vy + matrix.tx) * weight; + yG += (matrix.b * vx + matrix.d * vy + matrix.ty) * weight; + } + this._pathGlobalVertices[iW++] = xG; + this._pathGlobalVertices[iW++] = yG; + } + }; + PathConstraint.prototype._computeVertices = function (start, count, offset, out) { + //TODO优化 + for (var i = offset, iW = start; i < count; i += 2) { + out[i] = this._pathGlobalVertices[iW++]; + out[i + 1] = this._pathGlobalVertices[iW++]; + } + }; + PathConstraint.prototype._computeBezierCurve = function (pathDisplayDta, spaceCount, tangents, percentPosition, percentSpacing) { + //计算当前的骨骼在曲线上的位置 + var armature = this._armature; + var intArray = armature.armatureData.parent.intArray; + var vertexCount = intArray[pathDisplayDta.geometry.offset + 0 /* GeometryVertexCount */]; + var positions = this._positions; + var spaces = this._spaces; + var isClosed = pathDisplayDta.closed; + var curveVertices = Array(); + var verticesLength = vertexCount * 2; + var curveCount = verticesLength / 6; + var preCurve = -1; + var position = this.position; + positions.length = spaceCount * 3 + 2; + var pathLength = 0.0; + //不需要匀速运动,效率高些 + if (!pathDisplayDta.constantSpeed) { + var lenghts = pathDisplayDta.curveLengths; + curveCount -= isClosed ? 1 : 2; + pathLength = lenghts[curveCount]; + if (percentPosition) { + position *= pathLength; + } + if (percentSpacing) { + for (var i = 0; i < spaceCount; i++) { + spaces[i] *= pathLength; + } + } + curveVertices.length = 8; + for (var i = 0, o = 0, curve = 0; i < spaceCount; i++, o += 3) { + var space = spaces[i]; + position += space; + if (isClosed) { + position %= pathLength; + if (position < 0) { + position += pathLength; + } + curve = 0; + } + else if (position < 0) { + //TODO + continue; + } + else if (position > pathLength) { + //TODO + continue; + } + var percent = 0.0; + for (;; curve++) { + var len = lenghts[curve]; + if (position > len) { + continue; + } + if (curve === 0) { + percent = position / len; + } + else { + var preLen = lenghts[curve - 1]; + percent = (position - preLen) / (len - preLen); + } + break; + } + if (curve !== preCurve) { + preCurve = curve; + if (isClosed && curve === curveCount) { + //计算曲线 + this._computeVertices(verticesLength - 4, 4, 0, curveVertices); + this._computeVertices(0, 4, 4, curveVertices); + } + else { + this._computeVertices(curve * 6 + 2, 8, 0, curveVertices); + } + } + // + this.addCurvePosition(percent, curveVertices[0], curveVertices[1], curveVertices[2], curveVertices[3], curveVertices[4], curveVertices[5], curveVertices[6], curveVertices[7], positions, o, tangents); + } + return; + } + //匀速的 + if (isClosed) { + verticesLength += 2; + curveVertices.length = vertexCount; + this._computeVertices(2, verticesLength - 4, 0, curveVertices); + this._computeVertices(0, 2, verticesLength - 4, curveVertices); + curveVertices[verticesLength - 2] = curveVertices[0]; + curveVertices[verticesLength - 1] = curveVertices[1]; + } + else { + curveCount--; + verticesLength -= 4; + curveVertices.length = verticesLength; + this._computeVertices(2, verticesLength, 0, curveVertices); + } + // + var curves = new Array(curveCount); + pathLength = 0; + var x1 = curveVertices[0], y1 = curveVertices[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; + var tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy; + for (var i = 0, w = 2; i < curveCount; i++, w += 6) { + cx1 = curveVertices[w]; + cy1 = curveVertices[w + 1]; + cx2 = curveVertices[w + 2]; + cy2 = curveVertices[w + 3]; + x2 = curveVertices[w + 4]; + y2 = curveVertices[w + 5]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; + tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx; + dfy += ddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + pathLength += Math.sqrt(dfx * dfx + dfy * dfy); + curves[i] = pathLength; + x1 = x2; + y1 = y2; + } + if (percentPosition) { + position *= pathLength; + } + if (percentSpacing) { + for (var i = 0; i < spaceCount; i++) { + spaces[i] *= pathLength; + } + } + var segments = this._segments; + var curveLength = 0; + for (var i = 0, o = 0, curve = 0, segment = 0; i < spaceCount; i++, o += 3) { + var space = spaces[i]; + position += space; + var p = position; + if (isClosed) { + p %= pathLength; + if (p < 0) + p += pathLength; + curve = 0; + } + else if (p < 0) { + continue; + } + else if (p > pathLength) { + continue; + } + // Determine curve containing position. + for (;; curve++) { + var length_1 = curves[curve]; + if (p > length_1) + continue; + if (curve === 0) + p /= length_1; + else { + var prev = curves[curve - 1]; + p = (p - prev) / (length_1 - prev); + } + break; + } + if (curve !== preCurve) { + preCurve = curve; + var ii = curve * 6; + x1 = curveVertices[ii]; + y1 = curveVertices[ii + 1]; + cx1 = curveVertices[ii + 2]; + cy1 = curveVertices[ii + 3]; + cx2 = curveVertices[ii + 4]; + cy2 = curveVertices[ii + 5]; + x2 = curveVertices[ii + 6]; + y2 = curveVertices[ii + 7]; + tmpx = (x1 - cx1 * 2 + cx2) * 0.03; + tmpy = (y1 - cy1 * 2 + cy2) * 0.03; + dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006; + dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006; + ddfx = tmpx * 2 + dddfx; + ddfy = tmpy * 2 + dddfy; + dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; + dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; + curveLength = Math.sqrt(dfx * dfx + dfy * dfy); + segments[0] = curveLength; + for (ii = 1; ii < 8; ii++) { + dfx += ddfx; + dfy += ddfy; + ddfx += dddfx; + ddfy += dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[ii] = curveLength; + } + dfx += ddfx; + dfy += ddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[8] = curveLength; + dfx += ddfx + dddfx; + dfy += ddfy + dddfy; + curveLength += Math.sqrt(dfx * dfx + dfy * dfy); + segments[9] = curveLength; + segment = 0; + } + // Weight by segment length. + p *= curveLength; + for (;; segment++) { + var length_2 = segments[segment]; + if (p > length_2) + continue; + if (segment === 0) + p /= length_2; + else { + var prev = segments[segment - 1]; + p = segment + (p - prev) / (length_2 - prev); + } + break; + } + this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, positions, o, tangents); + } + }; + //Calculates a point on the curve, for a given t value between 0 and 1. + PathConstraint.prototype.addCurvePosition = function (t, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, offset, tangents) { + if (t === 0) { + out[offset] = x1; + out[offset + 1] = y1; + out[offset + 2] = 0; + return; + } + if (t === 1) { + out[offset] = x2; + out[offset + 1] = y2; + out[offset + 2] = 0; + return; + } + var mt = 1 - t; + var mt2 = mt * mt; + var t2 = t * t; + var a = mt2 * mt; + var b = mt2 * t * 3; + var c = mt * t2 * 3; + var d = t * t2; + var x = a * x1 + b * cx1 + c * cx2 + d * x2; + var y = a * y1 + b * cy1 + c * cy2 + d * y2; + out[offset] = x; + out[offset + 1] = y; + if (tangents) { + //Calculates the curve tangent at the specified t value + out[offset + 2] = Math.atan2(y - (a * y1 + b * cy1 + c * cy2), x - (a * x1 + b * cx1 + c * cx2)); + } + else { + out[offset + 2] = 0; + } + }; + PathConstraint.prototype.init = function (constraintData, armature) { + this._constraintData = constraintData; + this._armature = armature; + var data = constraintData; + this.pathOffset = data.pathDisplayData.geometry.offset; + // + this.position = data.position; + this.spacing = data.spacing; + this.rotateOffset = data.rotateOffset; + this.rotateMix = data.rotateMix; + this.translateMix = data.translateMix; + // + this._root = this._armature.getBone(data.root.name); + this._target = this._armature.getBone(data.target.name); + this._pathSlot = this._armature.getSlot(data.pathSlot.name); + for (var i = 0, l = data.bones.length; i < l; i++) { + var bone = this._armature.getBone(data.bones[i].name); + if (bone !== null) { + this._bones.push(bone); + } + } + if (data.rotateMode === 2 /* ChainScale */) { + this._boneLengths.length = this._bones.length; + } + this._root._hasConstraint = true; + }; + PathConstraint.prototype.update = function () { + var pathSlot = this._pathSlot; + if (pathSlot._geometryData === null || + pathSlot._geometryData.offset !== this.pathOffset) { + return; + } + var constraintData = this._constraintData; + // + //曲线节点数据改变:父亲bone改变,权重bones改变,变形顶点改变 + var isPathVerticeDirty = false; + if (this._root._childrenTransformDirty) { + this._updatePathVertices(pathSlot._geometryData); + isPathVerticeDirty = true; + } + else if (pathSlot._verticesDirty || pathSlot._isBonesUpdate()) { + this._updatePathVertices(pathSlot._geometryData); + pathSlot._verticesDirty = false; + isPathVerticeDirty = true; + } + if (!isPathVerticeDirty && !this.dirty) { + return; + } + // + var positionMode = constraintData.positionMode; + var spacingMode = constraintData.spacingMode; + var rotateMode = constraintData.rotateMode; + var bones = this._bones; + var isLengthMode = spacingMode === 0 /* Length */; + var isChainScaleMode = rotateMode === 2 /* ChainScale */; + var isTangentMode = rotateMode === 0 /* Tangent */; + var boneCount = bones.length; + var spacesCount = isTangentMode ? boneCount : boneCount + 1; + var spacing = this.spacing; + var spaces = this._spaces; + spaces.length = spacesCount; + //计曲线间隔和长度 + if (isChainScaleMode || isLengthMode) { + //Bone改变和spacing改变触发 + spaces[0] = 0; + for (var i = 0, l = spacesCount - 1; i < l; i++) { + var bone = bones[i]; + bone.updateByConstraint(); + var boneLength = bone._boneData.length; + var matrix = bone.globalTransformMatrix; + var x = boneLength * matrix.a; + var y = boneLength * matrix.b; + var len = Math.sqrt(x * x + y * y); + if (isChainScaleMode) { + this._boneLengths[i] = len; + } + spaces[i + 1] = (boneLength + spacing) * len / boneLength; + } + } + else { + for (var i = 0; i < spacesCount; i++) { + spaces[i] = spacing; + } + } + // + this._computeBezierCurve(pathSlot._displayFrame.rawDisplayData, spacesCount, isTangentMode, positionMode === 1 /* Percent */, spacingMode === 2 /* Percent */); + //根据新的节点数据重新采样 + var positions = this._positions; + var rotateOffset = this.rotateOffset; + var boneX = positions[0], boneY = positions[1]; + var tip; + if (rotateOffset === 0) { + tip = rotateMode === 1 /* Chain */; + } + else { + tip = false; + var bone = pathSlot.parent; + if (bone !== null) { + var matrix = bone.globalTransformMatrix; + rotateOffset *= matrix.a * matrix.d - matrix.b * matrix.c > 0 ? dragonBones.Transform.DEG_RAD : -dragonBones.Transform.DEG_RAD; + } + } + // + var rotateMix = this.rotateMix; + var translateMix = this.translateMix; + for (var i = 0, p = 3; i < boneCount; i++, p += 3) { + var bone = bones[i]; + bone.updateByConstraint(); + var matrix = bone.globalTransformMatrix; + matrix.tx += (boneX - matrix.tx) * translateMix; + matrix.ty += (boneY - matrix.ty) * translateMix; + var x = positions[p], y = positions[p + 1]; + var dx = x - boneX, dy = y - boneY; + if (isChainScaleMode) { + var lenght = this._boneLengths[i]; + var s = (Math.sqrt(dx * dx + dy * dy) / lenght - 1) * rotateMix + 1; + matrix.a *= s; + matrix.b *= s; + } + boneX = x; + boneY = y; + if (rotateMix > 0) { + var a = matrix.a, b = matrix.b, c = matrix.c, d = matrix.d, r = void 0, cos = void 0, sin = void 0; + if (isTangentMode) { + r = positions[p - 1]; + } + else { + r = Math.atan2(dy, dx); + } + r -= Math.atan2(b, a); + if (tip) { + cos = Math.cos(r); + sin = Math.sin(r); + var length_3 = bone._boneData.length; + boneX += (length_3 * (cos * a - sin * b) - dx) * rotateMix; + boneY += (length_3 * (sin * a + cos * b) - dy) * rotateMix; + } + else { + r += rotateOffset; + } + if (r > dragonBones.Transform.PI) { + r -= dragonBones.Transform.PI_D; + } + else if (r < -dragonBones.Transform.PI) { + r += dragonBones.Transform.PI_D; + } + r *= rotateMix; + cos = Math.cos(r); + sin = Math.sin(r); + matrix.a = cos * a - sin * b; + matrix.b = sin * a + cos * b; + matrix.c = cos * c - sin * d; + matrix.d = sin * c + cos * d; + } + bone.global.fromMatrix(matrix); + } + this.dirty = false; + }; + PathConstraint.prototype.invalidUpdate = function () { + }; + return PathConstraint; + }(Constraint)); + dragonBones.PathConstraint = PathConstraint; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 + * @see dragonBones.IAnimateble + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + var WorldClock = /** @class */ (function () { + /** + * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. + * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 + * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 + * @version DragonBones 3.0 + * @language zh_CN + */ + function WorldClock(time) { + if (time === void 0) { time = 0.0; } + /** + * - Current time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + this.time = 0.0; + /** + * - The play speed, used to control animation speed-shift play. + * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] + * @default 1.0 + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放速度,用于控制动画变速播放。 + * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] + * @default 1.0 + * @version DragonBones 3.0 + * @language zh_CN + */ + this.timeScale = 1.0; + this._systemTime = 0.0; + this._animatebles = []; + this._clock = null; + this.time = time; + this._systemTime = new Date().getTime() * 0.001; + } + /** + * - Advance time for all IAnimatable instances. + * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 为所有的 IAnimatable 实例更新时间。 + * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.advanceTime = function (passedTime) { + if (passedTime !== passedTime) { + passedTime = 0.0; + } + var currentTime = Date.now() * 0.001; + if (passedTime < 0.0) { + passedTime = currentTime - this._systemTime; + } + this._systemTime = currentTime; + if (this.timeScale !== 1.0) { + passedTime *= this.timeScale; + } + if (passedTime === 0.0) { + return; + } + if (passedTime < 0.0) { + this.time -= passedTime; + } + else { + this.time += passedTime; + } + var i = 0, r = 0, l = this._animatebles.length; + for (; i < l; ++i) { + var animatable = this._animatebles[i]; + if (animatable !== null) { + if (r > 0) { + this._animatebles[i - r] = animatable; + this._animatebles[i] = null; + } + animatable.advanceTime(passedTime); + } + else { + r++; + } + } + if (r > 0) { + l = this._animatebles.length; + for (; i < l; ++i) { + var animateble = this._animatebles[i]; + if (animateble !== null) { + this._animatebles[i - r] = animateble; + } + else { + r++; + } + } + this._animatebles.length -= r; + } + }; + /** + * - Check whether contains a specific instance of IAnimatable. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.contains = function (value) { + if (value === this) { + return false; + } + var ancestor = value; + while (ancestor !== this && ancestor !== null) { + ancestor = ancestor.clock; + } + return ancestor === this; + }; + /** + * - Add IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.add = function (value) { + if (this._animatebles.indexOf(value) < 0) { + this._animatebles.push(value); + value.clock = this; + } + }; + /** + * - Removes a specified IAnimatable instance. + * @param value - The IAnimatable instance. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除特定的 IAnimatable 实例。 + * @param value - IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.remove = function (value) { + var index = this._animatebles.indexOf(value); + if (index >= 0) { + this._animatebles[index] = null; + value.clock = null; + } + }; + /** + * - Clear all IAnimatable instances. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 清除所有的 IAnimatable 实例。 + * @version DragonBones 3.0 + * @language zh_CN + */ + WorldClock.prototype.clear = function () { + for (var _i = 0, _a = this._animatebles; _i < _a.length; _i++) { + var animatable = _a[_i]; + if (animatable !== null) { + animatable.clock = null; + } + } + }; + Object.defineProperty(WorldClock.prototype, "clock", { + /** + * @inheritDoc + */ + get: function () { + return this._clock; + }, + set: function (value) { + if (this._clock === value) { + return; + } + if (this._clock !== null) { + this._clock.remove(this); + } + this._clock = value; + if (this._clock !== null) { + this._clock.add(this); + } + }, + enumerable: true, + configurable: true + }); + return WorldClock; + }()); + dragonBones.WorldClock = WorldClock; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation player is used to play the animation data and manage the animation states. + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画播放器用来播放动画数据和管理动画状态。 + * @see dragonBones.AnimationData + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + var Animation = /** @class */ (function (_super) { + __extends(Animation, _super); + function Animation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._animationNames = []; + _this._animationStates = []; + _this._animations = {}; + _this._blendStates = {}; + _this._animationConfig = null; // Initial value. + return _this; + } + Animation.toString = function () { + return "[class dragonBones.Animation]"; + }; + Animation.prototype._onClear = function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.returnToPool(); + } + for (var k in this._animations) { + delete this._animations[k]; + } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].returnToPool(); + } + delete this._blendStates[k]; + } + if (this._animationConfig !== null) { + this._animationConfig.returnToPool(); + } + this.timeScale = 1.0; + this._animationDirty = false; + this._inheritTimeScale = 1.0; + this._animationNames.length = 0; + this._animationStates.length = 0; + //this._animations.clear(); + this._armature = null; // + this._animationConfig = null; // + this._lastAnimationState = null; + }; + Animation.prototype._fadeOut = function (animationConfig) { + switch (animationConfig.fadeOutMode) { + case 1 /* SameLayer */: + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (animationState._parent !== null) { + continue; + } + if (animationState.layer === animationConfig.layer) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 2 /* SameGroup */: + for (var _b = 0, _c = this._animationStates; _b < _c.length; _b++) { + var animationState = _c[_b]; + if (animationState._parent !== null) { + continue; + } + if (animationState.group === animationConfig.group) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 3 /* SameLayerAndGroup */: + for (var _d = 0, _e = this._animationStates; _d < _e.length; _d++) { + var animationState = _e[_d]; + if (animationState._parent !== null) { + continue; + } + if (animationState.layer === animationConfig.layer && + animationState.group === animationConfig.group) { + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + } + break; + case 4 /* All */: + for (var _f = 0, _g = this._animationStates; _f < _g.length; _f++) { + var animationState = _g[_f]; + if (animationState._parent !== null) { + continue; + } + animationState.fadeOut(animationConfig.fadeOutTime, animationConfig.pauseFadeOut); + } + break; + case 5 /* Single */: // TODO + default: + break; + } + }; + /** + * @internal + */ + Animation.prototype.init = function (armature) { + if (this._armature !== null) { + return; + } + this._armature = armature; + this._animationConfig = dragonBones.BaseObject.borrowObject(dragonBones.AnimationConfig); + }; + /** + * @internal + */ + Animation.prototype.advanceTime = function (passedTime) { + if (passedTime < 0.0) { // Only animationState can reverse play. + passedTime = -passedTime; + } + if (this._armature.inheritAnimation && this._armature._parent !== null) { // Inherit parent animation timeScale. + this._inheritTimeScale = this._armature._parent._armature.animation._inheritTimeScale * this.timeScale; + } + else { + this._inheritTimeScale = this.timeScale; + } + if (this._inheritTimeScale !== 1.0) { + passedTime *= this._inheritTimeScale; + } + for (var k in this._blendStates) { + var blendStates = this._blendStates[k]; + for (var kB in blendStates) { + blendStates[kB].reset(); + } + } + var animationStateCount = this._animationStates.length; + if (animationStateCount === 1) { + var animationState = this._animationStates[0]; + if (animationState._fadeState > 0 && animationState._subFadeState > 0) { + this._armature._dragonBones.bufferObject(animationState); + this._animationStates.length = 0; + this._lastAnimationState = null; + } + else { + var animationData = animationState.animationData; + var cacheFrameRate = animationData.cacheFrameRate; + if (this._animationDirty && cacheFrameRate > 0.0) { // Update cachedFrameIndices. + this._animationDirty = false; + for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { + var bone = _a[_i]; + bone._cachedFrameIndices = animationData.getBoneCachedFrameIndices(bone.name); + } + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { + var slot = _c[_b]; + if (slot.displayFrameCount > 0) { + var rawDisplayData = slot.getDisplayFrameAt(0).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.parent === this._armature.armatureData.defaultSkin) { + slot._cachedFrameIndices = animationData.getSlotCachedFrameIndices(slot.name); + continue; + } + } + slot._cachedFrameIndices = null; + } + } + animationState.advanceTime(passedTime, cacheFrameRate); + } + } + else if (animationStateCount > 1) { + for (var i = 0, r = 0; i < animationStateCount; ++i) { + var animationState = this._animationStates[i]; + if (animationState._fadeState > 0 && animationState._subFadeState > 0) { + r++; + this._armature._dragonBones.bufferObject(animationState); + this._animationDirty = true; + if (this._lastAnimationState === animationState) { // Update last animation state. + this._lastAnimationState = null; + } + } + else { + if (r > 0) { + this._animationStates[i - r] = animationState; + } + animationState.advanceTime(passedTime, 0.0); + } + if (i === animationStateCount - 1 && r > 0) { // Modify animation states size. + this._animationStates.length -= r; + if (this._lastAnimationState === null && this._animationStates.length > 0) { + this._lastAnimationState = this._animationStates[this._animationStates.length - 1]; + } + } + } + this._armature._cacheFrameIndex = -1; + } + else { + this._armature._cacheFrameIndex = -1; + } + }; + /** + * - Clear all animations states. + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除所有的动画状态。 + * @see dragonBones.AnimationState + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.reset = function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.returnToPool(); + } + this._animationDirty = false; + this._animationConfig.clear(); + this._animationStates.length = 0; + this._lastAnimationState = null; + }; + /** + * - Pause a specific animation state. + * @param animationName - The name of animation state. (If not set, it will pause all animations) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停指定动画状态的播放。 + * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.stop = function (animationName) { + if (animationName === void 0) { animationName = null; } + if (animationName !== null) { + var animationState = this.getState(animationName); + if (animationState !== null) { + animationState.stop(); + } + } + else { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + animationState.stop(); + } + } + }; + /** + * - Play animation with a specific animation config. + * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. + * @param animationConfig - The animation config. + * @returns The playing animation state. + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 通过指定的动画配置来播放动画。 + * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 + * @param animationConfig - 动画配置。 + * @returns 播放的动画状态。 + * @see dragonBones.AnimationConfig + * @beta + * @version DragonBones 5.0 + * @language zh_CN + */ + Animation.prototype.playConfig = function (animationConfig) { + var animationName = animationConfig.animation; + if (!(animationName in this._animations)) { + console.warn("Non-existent animation.\n", "DragonBones name: " + this._armature.armatureData.parent.name, "Armature name: " + this._armature.name, "Animation name: " + animationName); + return null; + } + var animationData = this._animations[animationName]; + if (animationConfig.fadeOutMode === 5 /* Single */) { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState_1 = _a[_i]; + if (animationState_1._fadeState < 1 && + animationState_1.layer === animationConfig.layer && + animationState_1.animationData === animationData) { + return animationState_1; + } + } + } + if (this._animationStates.length === 0) { + animationConfig.fadeInTime = 0.0; + } + else if (animationConfig.fadeInTime < 0.0) { + animationConfig.fadeInTime = animationData.fadeInTime; + } + if (animationConfig.fadeOutTime < 0.0) { + animationConfig.fadeOutTime = animationConfig.fadeInTime; + } + if (animationConfig.timeScale <= -100.0) { + animationConfig.timeScale = 1.0 / animationData.scale; + } + if (animationData.frameCount > 0) { + if (animationConfig.position < 0.0) { + animationConfig.position %= animationData.duration; + animationConfig.position = animationData.duration - animationConfig.position; + } + else if (animationConfig.position === animationData.duration) { + animationConfig.position -= 0.000001; // Play a little time before end. + } + else if (animationConfig.position > animationData.duration) { + animationConfig.position %= animationData.duration; + } + if (animationConfig.duration > 0.0 && animationConfig.position + animationConfig.duration > animationData.duration) { + animationConfig.duration = animationData.duration - animationConfig.position; + } + if (animationConfig.playTimes < 0) { + animationConfig.playTimes = animationData.playTimes; + } + } + else { + animationConfig.playTimes = 1; + animationConfig.position = 0.0; + if (animationConfig.duration > 0.0) { + animationConfig.duration = 0.0; + } + } + if (animationConfig.duration === 0.0) { + animationConfig.duration = -1.0; + } + this._fadeOut(animationConfig); + // + var animationState = dragonBones.BaseObject.borrowObject(dragonBones.AnimationState); + animationState.init(this._armature, animationData, animationConfig); + this._animationDirty = true; + this._armature._cacheFrameIndex = -1; + if (this._animationStates.length > 0) { // Sort animation state. + var added = false; + for (var i = 0, l = this._animationStates.length; i < l; ++i) { + if (animationState.layer > this._animationStates[i].layer) { + added = true; + this._animationStates.splice(i, 0, animationState); + break; + } + else if (i !== l - 1 && animationState.layer > this._animationStates[i + 1].layer) { + added = true; + this._animationStates.splice(i + 1, 0, animationState); + break; + } + } + if (!added) { + this._animationStates.push(animationState); + } + } + else { + this._animationStates.push(animationState); + } + for (var _b = 0, _c = this._armature.getSlots(); _b < _c.length; _b++) { // Child armature play same name animation. + var slot = _c[_b]; + var childArmature = slot.childArmature; + if (childArmature !== null && childArmature.inheritAnimation && + childArmature.animation.hasAnimation(animationName) && + childArmature.animation.getState(animationName) === null) { + childArmature.animation.fadeIn(animationName); // + } + } + for (var k in animationData.animationTimelines) { // Blend animation node. + var childAnimationState = this.fadeIn(k, 0.0, 1, animationState.layer, "", 5 /* Single */); + if (childAnimationState === null) { + continue; + } + var timelines = animationData.animationTimelines[k]; + childAnimationState.actionEnabled = false; + childAnimationState.resetToPose = false; + childAnimationState.stop(); + animationState.addState(childAnimationState, timelines); + // + var index = this._animationStates.indexOf(animationState); + var childIndex = this._animationStates.indexOf(childAnimationState); + if (childIndex < index) { + this._animationStates.splice(index, 1); + this._animationStates.splice(childIndex, 0, animationState); + } + } + // if (!this._armature._lockUpdate && animationConfig.fadeInTime <= 0.0) { // Blend animation state, update armature. + // this._armature.advanceTime(0.0); + // } + this._lastAnimationState = animationState; + return animationState; + }; + /** + * - Play a specific animation. + * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) + * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 播放指定动画。 + * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.play("walk");
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.play = function (animationName, playTimes) { + if (animationName === void 0) { animationName = null; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName !== null ? animationName : ""; + if (animationName !== null && animationName.length > 0) { + this.playConfig(this._animationConfig); + } + else if (this._lastAnimationState === null) { + var defaultAnimation = this._armature.armatureData.defaultAnimation; + if (defaultAnimation !== null) { + this._animationConfig.animation = defaultAnimation.name; + this.playConfig(this._animationConfig); + } + } + else if (!this._lastAnimationState.isPlaying && !this._lastAnimationState.isCompleted) { + this._lastAnimationState.play(); + } + else { + this._animationConfig.animation = this._lastAnimationState.name; + this.playConfig(this._animationConfig); + } + return this._lastAnimationState; + }; + /** + * - Fade in a specific animation. + * @param animationName - The name of animation data. + * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) + * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) + * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) + * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) + * @returns The playing animation state. + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 淡入播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) + * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) + * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) + * @returns 播放的动画状态。 + * @example + *
+         *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
+         *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.fadeIn = function (animationName, fadeInTime, playTimes, layer, group, fadeOutMode) { + if (fadeInTime === void 0) { fadeInTime = -1.0; } + if (playTimes === void 0) { playTimes = -1; } + if (layer === void 0) { layer = 0; } + if (group === void 0) { group = null; } + if (fadeOutMode === void 0) { fadeOutMode = 3 /* SameLayerAndGroup */; } + this._animationConfig.clear(); + this._animationConfig.fadeOutMode = fadeOutMode; + this._animationConfig.playTimes = playTimes; + this._animationConfig.layer = layer; + this._animationConfig.fadeInTime = fadeInTime; + this._animationConfig.animation = animationName; + this._animationConfig.group = group !== null ? group : ""; + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific time. + * @param animationName - The name of animation data. + * @param time - The start time point of playing. (In seconds) + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定时间开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param time - 播放开始的时间。 (以秒为单位) + * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByTime = function (animationName, time, playTimes) { + if (time === void 0) { time = 0.0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.position = time; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific frame. + * @param animationName - The name of animation data. + * @param frame - The start frame of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定帧开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param frame - 播放开始的帧数。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByFrame = function (animationName, frame, playTimes) { + if (frame === void 0) { frame = 0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + var animationData = animationName in this._animations ? this._animations[animationName] : null; + if (animationData !== null) { + this._animationConfig.position = animationData.frameCount > 0 ? animationData.duration * frame / animationData.frameCount : 0.0; + } + return this.playConfig(this._animationConfig); + }; + /** + * - Play a specific animation from the specific progress. + * @param animationName - The name of animation data. + * @param progress - The start progress value of playing. + * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 从指定进度开始播放指定的动画。 + * @param animationName - 动画数据名称。 + * @param progress - 开始播放的进度。 + * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndPlayByProgress = function (animationName, progress, playTimes) { + if (progress === void 0) { progress = 0.0; } + if (playTimes === void 0) { playTimes = -1; } + this._animationConfig.clear(); + this._animationConfig.resetToPose = true; + this._animationConfig.playTimes = playTimes; + this._animationConfig.fadeInTime = 0.0; + this._animationConfig.animation = animationName; + var animationData = animationName in this._animations ? this._animations[animationName] : null; + if (animationData !== null) { + this._animationConfig.position = animationData.duration * (progress > 0.0 ? progress : 0.0); + } + return this.playConfig(this._animationConfig); + }; + /** + * - Stop a specific animation at the specific time. + * @param animationName - The name of animation data. + * @param time - The stop time. (In seconds) + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定时间停止指定动画播放 + * @param animationName - 动画数据名称。 + * @param time - 停止的时间。 (以秒为单位) + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByTime = function (animationName, time) { + if (time === void 0) { time = 0.0; } + var animationState = this.gotoAndPlayByTime(animationName, time, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * - Stop a specific animation at the specific frame. + * @param animationName - The name of animation data. + * @param frame - The stop frame. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定帧停止指定动画的播放 + * @param animationName - 动画数据名称。 + * @param frame - 停止的帧数。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByFrame = function (animationName, frame) { + if (frame === void 0) { frame = 0; } + var animationState = this.gotoAndPlayByFrame(animationName, frame, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * - Stop a specific animation at the specific progress. + * @param animationName - The name of animation data. + * @param progress - The stop progress value. + * @returns The played animation state. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 在指定的进度停止指定的动画播放。 + * @param animationName - 动画数据名称。 + * @param progress - 停止进度。 + * @returns 播放的动画状态。 + * @version DragonBones 4.5 + * @language zh_CN + */ + Animation.prototype.gotoAndStopByProgress = function (animationName, progress) { + if (progress === void 0) { progress = 0.0; } + var animationState = this.gotoAndPlayByProgress(animationName, progress, 1); + if (animationState !== null) { + animationState.stop(); + } + return animationState; + }; + /** + * @internal + */ + Animation.prototype.getBlendState = function (type, name, target) { + if (!(type in this._blendStates)) { + this._blendStates[type] = {}; + } + var blendStates = this._blendStates[type]; + if (!(name in blendStates)) { + var blendState = blendStates[name] = dragonBones.BaseObject.borrowObject(dragonBones.BlendState); + blendState.target = target; + } + return blendStates[name]; + }; + /** + * - Get a specific animation state. + * @param animationName - The name of animation state. + * @param layer - The layer of find animation states. [-1: Find all layers, [0~N]: Specified layer] (default: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取指定的动画状态。 + * @param animationName - 动画状态名称。 + * @param layer - 查找动画状态的层级。 [-1: 查找所有层级, [0~N]: 指定层级] (默认: -1) + * @example + *
+         *     armature.animation.play("walk");
+         *     let walkState = armature.animation.getState("walk");
+         *     walkState.timeScale = 0.5;
+         * 
+ * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.getState = function (animationName, layer) { + if (layer === void 0) { layer = -1; } + var i = this._animationStates.length; + while (i--) { + var animationState = this._animationStates[i]; + if (animationState.name === animationName && (layer < 0 || animationState.layer === layer)) { + return animationState; + } + } + return null; + }; + /** + * - Check whether a specific animation data is included. + * @param animationName - The name of animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含指定的动画数据 + * @param animationName - 动画数据名称。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + Animation.prototype.hasAnimation = function (animationName) { + return animationName in this._animations; + }; + /** + * - Get all the animation states. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取所有的动画状态 + * @version DragonBones 5.1 + * @language zh_CN + */ + Animation.prototype.getStates = function () { + return this._animationStates; + }; + Object.defineProperty(Animation.prototype, "isPlaying", { + /** + * - Check whether there is an animation state is playing + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否有动画状态正在播放 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (animationState.isPlaying) { + return true; + } + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "isCompleted", { + /** + * - Check whether all the animation states' playing were finished. + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否所有的动画状态均已播放完毕。 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + for (var _i = 0, _a = this._animationStates; _i < _a.length; _i++) { + var animationState = _a[_i]; + if (!animationState.isCompleted) { + return false; + } + } + return this._animationStates.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "lastAnimationName", { + /** + * - The name of the last playing animation state. + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态名称 + * @see #lastAnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._lastAnimationState !== null ? this._lastAnimationState.name : ""; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animationNames", { + /** + * - The name of all animation data + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有动画数据的名称 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._animationNames; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animations", { + /** + * - All animation data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 所有的动画数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._animations; + }, + set: function (value) { + if (this._animations === value) { + return; + } + this._animationNames.length = 0; + for (var k in this._animations) { + delete this._animations[k]; + } + for (var k in value) { + this._animationNames.push(k); + this._animations[k] = value[k]; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "animationConfig", { + /** + * - An AnimationConfig instance that can be used quickly. + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 一个可以快速使用的动画配置实例。 + * @see dragonBones.AnimationConfig + * @version DragonBones 5.0 + * @language zh_CN + */ + get: function () { + this._animationConfig.clear(); + return this._animationConfig; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Animation.prototype, "lastAnimationState", { + /** + * - The last playing animation state + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 上一个播放的动画状态 + * @see dragonBones.AnimationState + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._lastAnimationState; + }, + enumerable: true, + configurable: true + }); + return Animation; + }(dragonBones.BaseObject)); + dragonBones.Animation = Animation; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The animation state is generated when the animation data is played. + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 动画状态由播放动画数据时产生。 + * @see dragonBones.Animation + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + var AnimationState = /** @class */ (function (_super) { + __extends(AnimationState, _super); + function AnimationState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._boneMask = []; + _this._boneTimelines = []; + _this._boneBlendTimelines = []; + _this._slotTimelines = []; + _this._slotBlendTimelines = []; + _this._constraintTimelines = []; + _this._animationTimelines = []; + _this._poseTimelines = []; + /** + * @internal + */ + _this._actionTimeline = null; // Initial value. + _this._zOrderTimeline = null; // Initial value. + return _this; + } + AnimationState.toString = function () { + return "[class dragonBones.AnimationState]"; + }; + AnimationState.prototype._onClear = function () { + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.returnToPool(); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.returnToPool(); + } + for (var _d = 0, _e = this._slotTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.returnToPool(); + } + for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.returnToPool(); + } + for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) { + var timeline = _j[_h]; + timeline.returnToPool(); + } + for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) { + var timeline = _l[_k]; + var animationState = timeline.target; + if (animationState._parent === this) { + animationState._fadeState = 1; + animationState._subFadeState = 1; + animationState._parent = null; + } + timeline.returnToPool(); + } + if (this._actionTimeline !== null) { + this._actionTimeline.returnToPool(); + } + if (this._zOrderTimeline !== null) { + this._zOrderTimeline.returnToPool(); + } + this.actionEnabled = false; + this.additive = false; + this.displayControl = false; + this.resetToPose = false; + this.blendType = 0 /* None */; + this.playTimes = 1; + this.layer = 0; + this.timeScale = 1.0; + this._weight = 1.0; + this.parameterX = 0.0; + this.parameterY = 0.0; + this.positionX = 0.0; + this.positionY = 0.0; + this.autoFadeOutTime = 0.0; + this.fadeTotalTime = 0.0; + this.name = ""; + this.group = ""; + this._timelineDirty = 2; + this._playheadState = 0; + this._fadeState = -1; + this._subFadeState = -1; + this._position = 0.0; + this._duration = 0.0; + this._fadeTime = 0.0; + this._time = 0.0; + this._fadeProgress = 0.0; + this._weightResult = 0.0; + this._boneMask.length = 0; + this._boneTimelines.length = 0; + this._boneBlendTimelines.length = 0; + this._slotTimelines.length = 0; + this._slotBlendTimelines.length = 0; + this._constraintTimelines.length = 0; + this._animationTimelines.length = 0; + this._poseTimelines.length = 0; + // this._bonePoses.clear(); + this._animationData = null; // + this._armature = null; // + this._actionTimeline = null; // + this._zOrderTimeline = null; + this._activeChildA = null; + this._activeChildB = null; + this._parent = null; + }; + AnimationState.prototype._updateTimelines = function () { + { // Update constraint timelines. + for (var _i = 0, _a = this._armature._constraints; _i < _a.length; _i++) { + var constraint = _a[_i]; + var timelineDatas = this._animationData.getConstraintTimelines(constraint.name); + if (timelineDatas !== null) { + for (var _b = 0, timelineDatas_1 = timelineDatas; _b < timelineDatas_1.length; _b++) { + var timelineData = timelineDatas_1[_b]; + switch (timelineData.type) { + case 30 /* IKConstraint */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState); + timeline.target = constraint; + timeline.init(this._armature, this, timelineData); + this._constraintTimelines.push(timeline); + break; + } + default: + break; + } + } + } + else if (this.resetToPose) { // Pose timeline. + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintTimelineState); + timeline.target = constraint; + timeline.init(this._armature, this, null); + this._constraintTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + }; + AnimationState.prototype._updateBoneAndSlotTimelines = function () { + { // Update bone and surface timelines. + var boneTimelines = {}; + // Create bone timelines map. + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + var timelineName = timeline.target.target.name; + if (!(timelineName in boneTimelines)) { + boneTimelines[timelineName] = []; + } + boneTimelines[timelineName].push(timeline); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + var timelineName = timeline.target.target.name; + if (!(timelineName in boneTimelines)) { + boneTimelines[timelineName] = []; + } + boneTimelines[timelineName].push(timeline); + } + // + for (var _d = 0, _e = this._armature.getBones(); _d < _e.length; _d++) { + var bone = _e[_d]; + var timelineName = bone.name; + if (!this.containsBoneMask(timelineName)) { + continue; + } + if (timelineName in boneTimelines) { // Remove bone timeline from map. + delete boneTimelines[timelineName]; + } + else { // Create new bone timeline. + var timelineDatas = this._animationData.getBoneTimelines(timelineName); + var blendState = this._armature.animation.getBlendState(BlendState.BONE_TRANSFORM, bone.name, bone); + if (timelineDatas !== null) { + for (var _f = 0, timelineDatas_2 = timelineDatas; _f < timelineDatas_2.length; _f++) { + var timelineData = timelineDatas_2[_f]; + switch (timelineData.type) { + case 10 /* BoneAll */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 11 /* BoneTranslate */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneTranslateTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 12 /* BoneRotate */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneRotateTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 13 /* BoneScale */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneScaleTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, timelineData); + this._boneTimelines.push(timeline); + break; + } + case 60 /* BoneAlpha */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.BONE_ALPHA, bone.name, bone); + timeline.init(this._armature, this, timelineData); + this._boneBlendTimelines.push(timeline); + break; + } + case 50 /* Surface */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone); + timeline.init(this._armature, this, timelineData); + this._boneBlendTimelines.push(timeline); + break; + } + default: + break; + } + } + } + else if (this.resetToPose) { // Pose timeline. + if (bone._boneData.type === 0 /* Bone */) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.BoneAllTimelineState); + timeline.target = blendState; + timeline.init(this._armature, this, null); + this._boneTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + else { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SURFACE, bone.name, bone); + timeline.init(this._armature, this, null); + this._boneBlendTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + } + for (var k in boneTimelines) { // Remove bone timelines. + for (var _g = 0, _h = boneTimelines[k]; _g < _h.length; _g++) { + var timeline = _h[_g]; + var index = this._boneTimelines.indexOf(timeline); + if (index >= 0) { + this._boneTimelines.splice(index, 1); + timeline.returnToPool(); + } + index = this._boneBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._boneBlendTimelines.splice(index, 1); + timeline.returnToPool(); + } + } + } + } + { // Update slot timelines. + var slotTimelines = {}; + var ffdFlags = []; + // Create slot timelines map. + for (var _j = 0, _k = this._slotTimelines; _j < _k.length; _j++) { + var timeline = _k[_j]; + var timelineName = timeline.target.name; + if (!(timelineName in slotTimelines)) { + slotTimelines[timelineName] = []; + } + slotTimelines[timelineName].push(timeline); + } + for (var _l = 0, _m = this._slotBlendTimelines; _l < _m.length; _l++) { + var timeline = _m[_l]; + var timelineName = timeline.target.target.name; + if (!(timelineName in slotTimelines)) { + slotTimelines[timelineName] = []; + } + slotTimelines[timelineName].push(timeline); + } + // + for (var _o = 0, _p = this._armature.getSlots(); _o < _p.length; _o++) { + var slot = _p[_o]; + var boneName = slot.parent.name; + if (!this.containsBoneMask(boneName)) { + continue; + } + var timelineName = slot.name; + if (timelineName in slotTimelines) { // Remove slot timeline from map. + delete slotTimelines[timelineName]; + } + else { // Create new slot timeline. + var displayIndexFlag = false; + var colorFlag = false; + ffdFlags.length = 0; + var timelineDatas = this._animationData.getSlotTimelines(timelineName); + if (timelineDatas !== null) { + for (var _q = 0, timelineDatas_3 = timelineDatas; _q < timelineDatas_3.length; _q++) { + var timelineData = timelineDatas_3[_q]; + switch (timelineData.type) { + case 20 /* SlotDisplay */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, timelineData); + this._slotTimelines.push(timeline); + displayIndexFlag = true; + break; + } + case 23 /* SlotZIndex */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotZIndexTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_Z_INDEX, slot.name, slot); + timeline.init(this._armature, this, timelineData); + this._slotBlendTimelines.push(timeline); + break; + } + case 21 /* SlotColor */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, timelineData); + this._slotTimelines.push(timeline); + colorFlag = true; + break; + } + case 22 /* SlotDeform */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot); + timeline.init(this._armature, this, timelineData); + if (timeline.target !== null) { + this._slotBlendTimelines.push(timeline); + ffdFlags.push(timeline.geometryOffset); + } + else { + timeline.returnToPool(); + } + break; + } + case 24 /* SlotAlpha */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AlphaTimelineState); + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_ALPHA, slot.name, slot); + timeline.init(this._armature, this, timelineData); + this._slotBlendTimelines.push(timeline); + break; + } + default: + break; + } + } + } + if (this.resetToPose) { // Pose timeline. + if (!displayIndexFlag) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotDisplayTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, null); + this._slotTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + if (!colorFlag) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.SlotColorTimelineState); + timeline.target = slot; + timeline.init(this._armature, this, null); + this._slotTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayFrame = slot.getDisplayFrameAt(i); + if (displayFrame.deformVertices.length === 0) { + continue; + } + var geometryData = displayFrame.getGeometryData(); + if (geometryData !== null && ffdFlags.indexOf(geometryData.offset) < 0) { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.DeformTimelineState); + timeline.geometryOffset = geometryData.offset; // + timeline.displayFrame = displayFrame; // + timeline.target = this._armature.animation.getBlendState(BlendState.SLOT_DEFORM, slot.name, slot); + timeline.init(this._armature, this, null); + this._slotBlendTimelines.push(timeline); + this._poseTimelines.push(timeline); + } + } + } + } + } + for (var k in slotTimelines) { // Remove slot timelines. + for (var _r = 0, _s = slotTimelines[k]; _r < _s.length; _r++) { + var timeline = _s[_r]; + var index = this._slotTimelines.indexOf(timeline); + if (index >= 0) { + this._slotTimelines.splice(index, 1); + timeline.returnToPool(); + } + index = this._slotBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._slotBlendTimelines.splice(index, 1); + timeline.returnToPool(); + } + } + } + } + }; + AnimationState.prototype._advanceFadeTime = function (passedTime) { + var isFadeOut = this._fadeState > 0; + if (this._subFadeState < 0) { // Fade start event. + this._subFadeState = 0; + var eventActive = this._parent === null && this.actionEnabled; + if (eventActive) { + var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT : dragonBones.EventObject.FADE_IN; + if (this._armature.eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = eventType; + eventObject.armature = this._armature; + eventObject.animationState = this; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + if (passedTime < 0.0) { + passedTime = -passedTime; + } + this._fadeTime += passedTime; + if (this._fadeTime >= this.fadeTotalTime) { // Fade complete. + this._subFadeState = 1; + this._fadeProgress = isFadeOut ? 0.0 : 1.0; + } + else if (this._fadeTime > 0.0) { // Fading. + this._fadeProgress = isFadeOut ? (1.0 - this._fadeTime / this.fadeTotalTime) : (this._fadeTime / this.fadeTotalTime); + } + else { // Before fade. + this._fadeProgress = isFadeOut ? 1.0 : 0.0; + } + if (this._subFadeState > 0) { // Fade complete event. + if (!isFadeOut) { + this._playheadState |= 1; // x1 + this._fadeState = 0; + } + var eventActive = this._parent === null && this.actionEnabled; + if (eventActive) { + var eventType = isFadeOut ? dragonBones.EventObject.FADE_OUT_COMPLETE : dragonBones.EventObject.FADE_IN_COMPLETE; + if (this._armature.eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = eventType; + eventObject.armature = this._armature; + eventObject.animationState = this; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + }; + /** + * @internal + */ + AnimationState.prototype.init = function (armature, animationData, animationConfig) { + if (this._armature !== null) { + return; + } + this._armature = armature; + this._animationData = animationData; + // + this.resetToPose = animationConfig.resetToPose; + this.additive = animationConfig.additive; + this.displayControl = animationConfig.displayControl; + this.actionEnabled = animationConfig.actionEnabled; + this.blendType = animationData.blendType; + this.layer = animationConfig.layer; + this.playTimes = animationConfig.playTimes; + this.timeScale = animationConfig.timeScale; + this.fadeTotalTime = animationConfig.fadeInTime; + this.autoFadeOutTime = animationConfig.autoFadeOutTime; + this.name = animationConfig.name.length > 0 ? animationConfig.name : animationConfig.animation; + this.group = animationConfig.group; + // + this._weight = animationConfig.weight; + if (animationConfig.pauseFadeIn) { + this._playheadState = 2; // 10 + } + else { + this._playheadState = 3; // 11 + } + if (animationConfig.duration < 0.0) { + this._position = 0.0; + this._duration = this._animationData.duration; + if (animationConfig.position !== 0.0) { + if (this.timeScale >= 0.0) { + this._time = animationConfig.position; + } + else { + this._time = animationConfig.position - this._duration; + } + } + else { + this._time = 0.0; + } + } + else { + this._position = animationConfig.position; + this._duration = animationConfig.duration; + this._time = 0.0; + } + if (this.timeScale < 0.0 && this._time === 0.0) { + this._time = -0.000001; // Turn to end. + } + if (this.fadeTotalTime <= 0.0) { + this._fadeProgress = 0.999999; // Make different. + } + if (animationConfig.boneMask.length > 0) { + this._boneMask.length = animationConfig.boneMask.length; + for (var i = 0, l = this._boneMask.length; i < l; ++i) { + this._boneMask[i] = animationConfig.boneMask[i]; + } + } + this._actionTimeline = dragonBones.BaseObject.borrowObject(dragonBones.ActionTimelineState); + this._actionTimeline.init(this._armature, this, this._animationData.actionTimeline); + this._actionTimeline.currentTime = this._time; + if (this._actionTimeline.currentTime < 0.0) { + this._actionTimeline.currentTime = this._duration - this._actionTimeline.currentTime; + } + if (this._animationData.zOrderTimeline !== null) { + this._zOrderTimeline = dragonBones.BaseObject.borrowObject(dragonBones.ZOrderTimelineState); + this._zOrderTimeline.init(this._armature, this, this._animationData.zOrderTimeline); + } + }; + /** + * @internal + */ + AnimationState.prototype.advanceTime = function (passedTime, cacheFrameRate) { + // Update fade time. + if (this._fadeState !== 0 || this._subFadeState !== 0) { + this._advanceFadeTime(passedTime); + } + // Update time. + if (this._playheadState === 3) { // 11 + if (this.timeScale !== 1.0) { + passedTime *= this.timeScale; + } + this._time += passedTime; + } + // Update timeline. + if (this._timelineDirty !== 0) { + if (this._timelineDirty === 2) { + this._updateTimelines(); + } + this._timelineDirty = 0; + this._updateBoneAndSlotTimelines(); + } + var isBlendDirty = this._fadeState !== 0 || this._subFadeState === 0; + var isCacheEnabled = this._fadeState === 0 && cacheFrameRate > 0.0; + var isUpdateTimeline = true; + var isUpdateBoneTimeline = true; + var time = this._time; + this._weightResult = this._weight * this._fadeProgress; + if (this._parent !== null) { + this._weightResult *= this._parent._weightResult; + } + if (this._actionTimeline.playState <= 0) { // Update main timeline. + this._actionTimeline.update(time); + } + if (this._weight === 0.0) { + return; + } + if (isCacheEnabled) { // Cache time internval. + var internval = cacheFrameRate * 2.0; + this._actionTimeline.currentTime = Math.floor(this._actionTimeline.currentTime * internval) / internval; + } + if (this._zOrderTimeline !== null && this._zOrderTimeline.playState <= 0) { // Update zOrder timeline. + this._zOrderTimeline.update(time); + } + if (isCacheEnabled) { // Update cache. + var cacheFrameIndex = Math.floor(this._actionTimeline.currentTime * cacheFrameRate); // uint + if (this._armature._cacheFrameIndex === cacheFrameIndex) { // Same cache. + isUpdateTimeline = false; + isUpdateBoneTimeline = false; + } + else { + this._armature._cacheFrameIndex = cacheFrameIndex; + if (this._animationData.cachedFrames[cacheFrameIndex]) { // Cached. + isUpdateBoneTimeline = false; + } + else { // Cache. + this._animationData.cachedFrames[cacheFrameIndex] = true; + } + } + } + if (isUpdateTimeline) { + var isBlend = false; + var prevTarget = null; // + if (isUpdateBoneTimeline) { + for (var i = 0, l = this._boneTimelines.length; i < l; ++i) { + var timeline = this._boneTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (timeline.target !== prevTarget) { + var blendState = timeline.target; + isBlend = blendState.update(this); + prevTarget = blendState; + if (blendState.dirty === 1) { + var pose = blendState.target.animationPose; + pose.x = 0.0; + pose.y = 0.0; + pose.rotation = 0.0; + pose.skew = 0.0; + pose.scaleX = 1.0; + pose.scaleY = 1.0; + } + } + if (isBlend) { + timeline.blend(isBlendDirty); + } + } + } + for (var i = 0, l = this._boneBlendTimelines.length; i < l; ++i) { + var timeline = this._boneBlendTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (timeline.target.update(this)) { + timeline.blend(isBlendDirty); + } + } + if (this.displayControl) { + for (var i = 0, l = this._slotTimelines.length; i < l; ++i) { + var timeline = this._slotTimelines[i]; + if (timeline.playState <= 0) { + var slot = timeline.target; + var displayController = slot.displayController; + if (displayController === null || + displayController === this.name || + displayController === this.group) { + timeline.update(time); + } + } + } + } + for (var i = 0, l = this._slotBlendTimelines.length; i < l; ++i) { + var timeline = this._slotBlendTimelines[i]; + if (timeline.playState <= 0) { + var blendState = timeline.target; + timeline.update(time); + if (blendState.update(this)) { + timeline.blend(isBlendDirty); + } + } + } + for (var i = 0, l = this._constraintTimelines.length; i < l; ++i) { + var timeline = this._constraintTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + } + if (this._animationTimelines.length > 0) { + var dL = 100.0; + var dR = 100.0; + var leftState = null; + var rightState = null; + for (var i = 0, l = this._animationTimelines.length; i < l; ++i) { + var timeline = this._animationTimelines[i]; + if (timeline.playState <= 0) { + timeline.update(time); + } + if (this.blendType === 1 /* E1D */) { // TODO + var animationState = timeline.target; + var d = this.parameterX - animationState.positionX; + if (d >= 0.0) { + if (d < dL) { + dL = d; + leftState = animationState; + } + } + else { + if (-d < dR) { + dR = -d; + rightState = animationState; + } + } + } + } + if (leftState !== null) { + if (this._activeChildA !== leftState) { + if (this._activeChildA !== null) { + this._activeChildA.weight = 0.0; + } + this._activeChildA = leftState; + this._activeChildA.activeTimeline(); + } + if (this._activeChildB !== rightState) { + if (this._activeChildB !== null) { + this._activeChildB.weight = 0.0; + } + this._activeChildB = rightState; + } + leftState.weight = dR / (dL + dR); + if (rightState) { + rightState.weight = 1.0 - leftState.weight; + } + } + } + } + if (this._fadeState === 0) { + if (this._subFadeState > 0) { + this._subFadeState = 0; + if (this._poseTimelines.length > 0) { // Remove pose timelines. + for (var _i = 0, _a = this._poseTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + var index = this._boneTimelines.indexOf(timeline); + if (index >= 0) { + this._boneTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._boneBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._boneBlendTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._slotTimelines.indexOf(timeline); + if (index >= 0) { + this._slotTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._slotBlendTimelines.indexOf(timeline); + if (index >= 0) { + this._slotBlendTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + index = this._constraintTimelines.indexOf(timeline); + if (index >= 0) { + this._constraintTimelines.splice(index, 1); + timeline.returnToPool(); + continue; + } + } + this._poseTimelines.length = 0; + } + } + if (this._actionTimeline.playState > 0) { + if (this.autoFadeOutTime >= 0.0) { // Auto fade out. + this.fadeOut(this.autoFadeOutTime); + } + } + } + }; + /** + * - Continue play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 继续播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.play = function () { + this._playheadState = 3; // 11 + }; + /** + * - Stop play. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.stop = function () { + this._playheadState &= 1; // 0x + }; + /** + * - Fade out the animation state. + * @param fadeOutTime - The fade out time. (In seconds) + * @param pausePlayhead - Whether to pause the animation playing when fade out. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 淡出动画状态。 + * @param fadeOutTime - 淡出时间。 (以秒为单位) + * @param pausePlayhead - 淡出时是否暂停播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.fadeOut = function (fadeOutTime, pausePlayhead) { + if (pausePlayhead === void 0) { pausePlayhead = true; } + if (fadeOutTime < 0.0) { + fadeOutTime = 0.0; + } + if (pausePlayhead) { + this._playheadState &= 2; // x0 + } + if (this._fadeState > 0) { + if (fadeOutTime > this.fadeTotalTime - this._fadeTime) { // If the animation is already in fade out, the new fade out will be ignored. + return; + } + } + else { + this._fadeState = 1; + this._subFadeState = -1; + if (fadeOutTime <= 0.0 || this._fadeProgress <= 0.0) { + this._fadeProgress = 0.000001; // Modify fade progress to different value. + } + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.fadeOut(); + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.fadeOut(); + } + for (var _d = 0, _e = this._slotTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.fadeOut(); + } + for (var _f = 0, _g = this._slotBlendTimelines; _f < _g.length; _f++) { + var timeline = _g[_f]; + timeline.fadeOut(); + } + for (var _h = 0, _j = this._constraintTimelines; _h < _j.length; _h++) { + var timeline = _j[_h]; + timeline.fadeOut(); + } + for (var _k = 0, _l = this._animationTimelines; _k < _l.length; _k++) { + var timeline = _l[_k]; + timeline.fadeOut(); + // + var animaitonState = timeline.target; + animaitonState.fadeOut(999999.0, true); + } + } + this.displayControl = false; // + this.fadeTotalTime = this._fadeProgress > 0.000001 ? fadeOutTime / this._fadeProgress : 0.0; + this._fadeTime = this.fadeTotalTime * (1.0 - this._fadeProgress); + }; + /** + * - Check if a specific bone mask is included. + * @param boneName - The bone name. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 检查是否包含特定骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.containsBoneMask = function (boneName) { + return this._boneMask.length === 0 || this._boneMask.indexOf(boneName) >= 0; + }; + /** + * - Add a specific bone mask. + * @param boneName - The bone name. + * @param recursive - Whether or not to add a mask to the bone's sub-bone. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 添加特定的骨骼遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.addBoneMask = function (boneName, recursive) { + if (recursive === void 0) { recursive = true; } + var currentBone = this._armature.getBone(boneName); + if (currentBone === null) { + return; + } + if (this._boneMask.indexOf(boneName) < 0) { // Add mixing + this._boneMask.push(boneName); + } + if (recursive) { // Add recursive mixing. + for (var _i = 0, _a = this._armature.getBones(); _i < _a.length; _i++) { + var bone = _a[_i]; + if (this._boneMask.indexOf(bone.name) < 0 && currentBone.contains(bone)) { + this._boneMask.push(bone.name); + } + } + } + this._timelineDirty = 1; + }; + /** + * - Remove the mask of a specific bone. + * @param boneName - The bone name. + * @param recursive - Whether to remove the bone's sub-bone mask. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除特定骨骼的遮罩。 + * @param boneName - 骨骼名称。 + * @param recursive - 是否删除该骨骼的子骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.removeBoneMask = function (boneName, recursive) { + if (recursive === void 0) { recursive = true; } + var index = this._boneMask.indexOf(boneName); + if (index >= 0) { // Remove mixing. + this._boneMask.splice(index, 1); + } + if (recursive) { + var currentBone = this._armature.getBone(boneName); + if (currentBone !== null) { + var bones = this._armature.getBones(); + if (this._boneMask.length > 0) { // Remove recursive mixing. + for (var _i = 0, bones_1 = bones; _i < bones_1.length; _i++) { + var bone = bones_1[_i]; + var index_1 = this._boneMask.indexOf(bone.name); + if (index_1 >= 0 && currentBone.contains(bone)) { + this._boneMask.splice(index_1, 1); + } + } + } + else { // Add unrecursive mixing. + for (var _a = 0, bones_2 = bones; _a < bones_2.length; _a++) { + var bone = bones_2[_a]; + if (bone === currentBone) { + continue; + } + if (!currentBone.contains(bone)) { + this._boneMask.push(bone.name); + } + } + } + } + } + this._timelineDirty = 1; + }; + /** + * - Remove all bone masks. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 删除所有骨骼遮罩。 + * @version DragonBones 3.0 + * @language zh_CN + */ + AnimationState.prototype.removeAllBoneMask = function () { + this._boneMask.length = 0; + this._timelineDirty = 1; + }; + /** + * @private + */ + AnimationState.prototype.addState = function (animationState, timelineDatas) { + if (timelineDatas === void 0) { timelineDatas = null; } + if (timelineDatas !== null) { + for (var _i = 0, timelineDatas_4 = timelineDatas; _i < timelineDatas_4.length; _i++) { + var timelineData = timelineDatas_4[_i]; + switch (timelineData.type) { + case 40 /* AnimationProgress */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationProgressTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + if (this.blendType !== 0 /* None */) { + var animaitonTimelineData = timelineData; + animationState.positionX = animaitonTimelineData.x; + animationState.positionY = animaitonTimelineData.y; + animationState.weight = 0.0; + } + animationState._parent = this; + this.resetToPose = false; + break; + } + case 41 /* AnimationWeight */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationWeightTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + break; + } + case 42 /* AnimationParameter */: { + var timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationParametersTimelineState); + timeline.target = animationState; + timeline.init(this._armature, this, timelineData); + this._animationTimelines.push(timeline); + break; + } + default: + break; + } + } + } + if (animationState._parent === null) { + animationState._parent = this; + } + }; + /** + * @internal + */ + AnimationState.prototype.activeTimeline = function () { + for (var _i = 0, _a = this._slotTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.dirty = true; + timeline.currentTime = -1.0; + } + }; + Object.defineProperty(AnimationState.prototype, "isFadeIn", { + /** + * - Whether the animation state is fading in. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡入。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState < 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isFadeOut", { + /** + * - Whether the animation state is fading out. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否正在淡出。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isFadeComplete", { + /** + * - Whether the animation state is fade completed. + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 是否淡入或淡出完毕。 + * @version DragonBones 5.1 + * @language zh_CN + */ + get: function () { + return this._fadeState === 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isPlaying", { + /** + * - Whether the animation state is playing. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否正在播放。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return (this._playheadState & 2) !== 0 && this._actionTimeline.playState <= 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "isCompleted", { + /** + * - Whether the animation state is play completed. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 是否播放完毕。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.playState > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "currentPlayTimes", { + /** + * - The times has been played. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 已经循环播放的次数。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.currentPlayTimes; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "totalTime", { + /** + * - The total time. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 总播放时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._duration; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "currentTime", { + /** + * - The time is currently playing. (In seconds) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 当前播放的时间。 (以秒为单位) + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._actionTimeline.currentTime; + }, + set: function (value) { + var currentPlayTimes = this._actionTimeline.currentPlayTimes - (this._actionTimeline.playState > 0 ? 1 : 0); + if (value < 0 || this._duration < value) { + value = (value % this._duration) + currentPlayTimes * this._duration; + if (value < 0) { + value += this._duration; + } + } + if (this.playTimes > 0 && currentPlayTimes === this.playTimes - 1 && + value === this._duration && this._parent === null) { + value = this._duration - 0.000001; // + } + if (this._time === value) { + return; + } + this._time = value; + this._actionTimeline.setCurrentTime(this._time); + if (this._zOrderTimeline !== null) { + this._zOrderTimeline.playState = -1; + } + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.playState = -1; + } + for (var _b = 0, _c = this._slotTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.playState = -1; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "weight", { + /** + * - The blend weight. + * @default 1.0 + * @version DragonBones 5.0 + * @language en_US + */ + /** + * - 混合权重。 + * @default 1.0 + * @version DragonBones 5.0 + * @language zh_CN + */ + /** + * - The animation data. + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language en_US + */ + get: function () { + return this._weight; + }, + set: function (value) { + if (this._weight === value) { + return; + } + this._weight = value; + for (var _i = 0, _a = this._boneTimelines; _i < _a.length; _i++) { + var timeline = _a[_i]; + timeline.dirty = true; + } + for (var _b = 0, _c = this._boneBlendTimelines; _b < _c.length; _b++) { + var timeline = _c[_b]; + timeline.dirty = true; + } + for (var _d = 0, _e = this._slotBlendTimelines; _d < _e.length; _d++) { + var timeline = _e[_d]; + timeline.dirty = true; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AnimationState.prototype, "animationData", { + /** + * - 动画数据。 + * @see dragonBones.AnimationData + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._animationData; + }, + enumerable: true, + configurable: true + }); + return AnimationState; + }(dragonBones.BaseObject)); + dragonBones.AnimationState = AnimationState; + /** + * @internal + */ + var BlendState = /** @class */ (function (_super) { + __extends(BlendState, _super); + function BlendState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlendState.toString = function () { + return "[class dragonBones.BlendState]"; + }; + BlendState.prototype._onClear = function () { + this.reset(); + this.target = null; + }; + BlendState.prototype.update = function (animationState) { + var animationLayer = animationState.layer; + var animationWeight = animationState._weightResult; + if (this.dirty > 0) { + if (this.leftWeight > 0.0) { + if (this.layer !== animationLayer) { + if (this.layerWeight >= this.leftWeight) { + this.dirty++; + this.layer = animationLayer; + this.leftWeight = 0.0; + this.blendWeight = 0.0; + return false; + } + this.layer = animationLayer; + this.leftWeight -= this.layerWeight; + this.layerWeight = 0.0; + } + animationWeight *= this.leftWeight; + this.dirty++; + this.blendWeight = animationWeight; + this.layerWeight += this.blendWeight; + return true; + } + return false; + } + this.dirty++; + this.layer = animationLayer; + this.leftWeight = 1.0; + this.blendWeight = animationWeight; + this.layerWeight = animationWeight; + return true; + }; + BlendState.prototype.reset = function () { + this.dirty = 0; + this.layer = 0; + this.leftWeight = 0.0; + this.layerWeight = 0.0; + this.blendWeight = 0.0; + }; + BlendState.BONE_TRANSFORM = "boneTransform"; + BlendState.BONE_ALPHA = "boneAlpha"; + BlendState.SURFACE = "surface"; + BlendState.SLOT_DEFORM = "slotDeform"; + BlendState.SLOT_ALPHA = "slotAlpha"; + BlendState.SLOT_Z_INDEX = "slotZIndex"; + return BlendState; + }(dragonBones.BaseObject)); + dragonBones.BlendState = BlendState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var TimelineState = /** @class */ (function (_super) { + __extends(TimelineState, _super); + function TimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimelineState.prototype._onClear = function () { + this.dirty = false; + this.playState = -1; + this.currentPlayTimes = 0; + this.currentTime = -1.0; + this.target = null; + this._isTween = false; + this._valueOffset = 0; + this._frameValueOffset = 0; + this._frameOffset = 0; + this._frameRate = 0; + this._frameCount = 0; + this._frameIndex = -1; + this._frameRateR = 0.0; + this._position = 0.0; + this._duration = 0.0; + this._timeScale = 1.0; + this._timeOffset = 0.0; + this._animationData = null; // + this._timelineData = null; // + this._armature = null; // + this._animationState = null; // + this._actionTimeline = null; // + this._frameArray = null; // + this._valueArray = null; // + this._timelineArray = null; // + this._frameIndices = null; // + }; + TimelineState.prototype._setCurrentTime = function (passedTime) { + var prevState = this.playState; + var prevPlayTimes = this.currentPlayTimes; + var prevTime = this.currentTime; + if (this._actionTimeline !== null && this._frameCount <= 1) { // No frame or only one frame. + this.playState = this._actionTimeline.playState >= 0 ? 1 : -1; + this.currentPlayTimes = 1; + this.currentTime = this._actionTimeline.currentTime; + } + else if (this._actionTimeline === null || this._timeScale !== 1.0 || this._timeOffset !== 0.0) { // Action timeline or has scale and offset. + var playTimes = this._animationState.playTimes; + var totalTime = playTimes * this._duration; + passedTime *= this._timeScale; + if (this._timeOffset !== 0.0) { + passedTime += this._timeOffset * this._animationData.duration; + } + if (playTimes > 0 && (passedTime >= totalTime || passedTime <= -totalTime)) { + if (this.playState <= 0 && this._animationState._playheadState === 3) { + this.playState = 1; + } + this.currentPlayTimes = playTimes; + if (passedTime < 0.0) { + this.currentTime = 0.0; + } + else { + this.currentTime = this.playState === 1 ? this._duration + 0.000001 : this._duration; // Precision problem + } + } + else { + if (this.playState !== 0 && this._animationState._playheadState === 3) { + this.playState = 0; + } + if (passedTime < 0.0) { + passedTime = -passedTime; + this.currentPlayTimes = Math.floor(passedTime / this._duration); + this.currentTime = this._duration - (passedTime % this._duration); + } + else { + this.currentPlayTimes = Math.floor(passedTime / this._duration); + this.currentTime = passedTime % this._duration; + } + } + this.currentTime += this._position; + } + else { // Multi frames. + this.playState = this._actionTimeline.playState; + this.currentPlayTimes = this._actionTimeline.currentPlayTimes; + this.currentTime = this._actionTimeline.currentTime; + } + if (this.currentPlayTimes === prevPlayTimes && this.currentTime === prevTime) { + return false; + } + // Clear frame flag when timeline start or loopComplete. + if ((prevState < 0 && this.playState !== prevState) || + (this.playState <= 0 && this.currentPlayTimes !== prevPlayTimes)) { + this._frameIndex = -1; + } + return true; + }; + TimelineState.prototype.init = function (armature, animationState, timelineData) { + this._armature = armature; + this._animationState = animationState; + this._timelineData = timelineData; + this._actionTimeline = this._animationState._actionTimeline; + if (this === this._actionTimeline) { + this._actionTimeline = null; // + } + this._animationData = this._animationState.animationData; + // + this._frameRate = this._animationData.parent.frameRate; + this._frameRateR = 1.0 / this._frameRate; + this._position = this._animationState._position; + this._duration = this._animationState._duration; + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; // May by the animation data is not belone to this armature data. + this._frameArray = dragonBonesData.frameArray; + this._timelineArray = dragonBonesData.timelineArray; + this._frameIndices = dragonBonesData.frameIndices; + // + this._frameCount = this._timelineArray[this._timelineData.offset + 2 /* TimelineKeyFrameCount */]; + this._frameValueOffset = this._timelineArray[this._timelineData.offset + 4 /* TimelineFrameValueOffset */]; + this._timeScale = 100.0 / this._timelineArray[this._timelineData.offset + 0 /* TimelineScale */]; + this._timeOffset = this._timelineArray[this._timelineData.offset + 1 /* TimelineOffset */] * 0.01; + } + }; + TimelineState.prototype.fadeOut = function () { + this.dirty = false; + }; + TimelineState.prototype.update = function (passedTime) { + if (this._setCurrentTime(passedTime)) { + if (this._frameCount > 1) { + var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint + var frameIndex = this._frameIndices[this._timelineData.frameIndicesOffset + timelineFrameIndex]; + if (this._frameIndex !== frameIndex) { + this._frameIndex = frameIndex; + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex]; + this._onArriveAtFrame(); + } + } + else if (this._frameIndex < 0) { + this._frameIndex = 0; + if (this._timelineData !== null) { // May be pose timeline. + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */]; + } + this._onArriveAtFrame(); + } + if (this._isTween || this.dirty) { + this._onUpdateFrame(); + } + } + }; + TimelineState.prototype.blend = function (_isDirty) { + }; + return TimelineState; + }(dragonBones.BaseObject)); + dragonBones.TimelineState = TimelineState; + /** + * @internal + */ + var TweenTimelineState = /** @class */ (function (_super) { + __extends(TweenTimelineState, _super); + function TweenTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + TweenTimelineState._getEasingValue = function (tweenType, progress, easing) { + var value = progress; + switch (tweenType) { + case 3 /* QuadIn */: + value = Math.pow(progress, 2.0); + break; + case 4 /* QuadOut */: + value = 1.0 - Math.pow(1.0 - progress, 2.0); + break; + case 5 /* QuadInOut */: + value = 0.5 * (1.0 - Math.cos(progress * Math.PI)); + break; + } + return (value - progress) * easing + progress; + }; + TweenTimelineState._getEasingCurveValue = function (progress, samples, count, offset) { + if (progress <= 0.0) { + return 0.0; + } + else if (progress >= 1.0) { + return 1.0; + } + var isOmited = count > 0; + var segmentCount = count + 1; // + 2 - 1 + var valueIndex = Math.floor(progress * segmentCount); + var fromValue = 0.0; + var toValue = 0.0; + if (isOmited) { + fromValue = valueIndex === 0 ? 0.0 : samples[offset + valueIndex - 1]; + toValue = (valueIndex === segmentCount - 1) ? 10000.0 : samples[offset + valueIndex]; + } + else { + fromValue = samples[offset + valueIndex - 1]; + toValue = samples[offset + valueIndex]; + } + return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001; + }; + TweenTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._tweenType = 0 /* None */; + this._curveCount = 0; + this._framePosition = 0.0; + this._frameDurationR = 0.0; + this._tweenEasing = 0.0; + this._tweenProgress = 0.0; + this._valueScale = 1.0; + }; + TweenTimelineState.prototype._onArriveAtFrame = function () { + if (this._frameCount > 1 && + (this._frameIndex !== this._frameCount - 1 || + this._animationState.playTimes === 0 || + this._animationState.currentPlayTimes < this._animationState.playTimes - 1)) { + this._tweenType = this._frameArray[this._frameOffset + 1 /* FrameTweenType */]; + this._isTween = this._tweenType !== 0 /* None */; + if (this._isTween) { + if (this._tweenType === 2 /* Curve */) { + this._curveCount = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */]; + } + else if (this._tweenType !== 0 /* None */ && this._tweenType !== 1 /* Line */) { + this._tweenEasing = this._frameArray[this._frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] * 0.01; + } + } + else { + this.dirty = true; + } + this._framePosition = this._frameArray[this._frameOffset] * this._frameRateR; + if (this._frameIndex === this._frameCount - 1) { + this._frameDurationR = 1.0 / (this._animationData.duration - this._framePosition); + } + else { + var nextFrameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex + 1]; + var frameDuration = this._frameArray[nextFrameOffset] * this._frameRateR - this._framePosition; + if (frameDuration > 0) { + this._frameDurationR = 1.0 / frameDuration; + } + else { + this._frameDurationR = 0.0; + } + } + } + else { + this.dirty = true; + this._isTween = false; + } + }; + TweenTimelineState.prototype._onUpdateFrame = function () { + if (this._isTween) { + this.dirty = true; + this._tweenProgress = (this.currentTime - this._framePosition) * this._frameDurationR; + if (this._tweenType === 2 /* Curve */) { + this._tweenProgress = TweenTimelineState._getEasingCurveValue(this._tweenProgress, this._frameArray, this._curveCount, this._frameOffset + 3 /* FrameCurveSamples */); + } + else if (this._tweenType !== 1 /* Line */) { + this._tweenProgress = TweenTimelineState._getEasingValue(this._tweenType, this._tweenProgress, this._tweenEasing); + } + } + }; + return TweenTimelineState; + }(TimelineState)); + dragonBones.TweenTimelineState = TweenTimelineState; + /** + * @internal + */ + var SingleValueTimelineState = /** @class */ (function (_super) { + __extends(SingleValueTimelineState, _super); + function SingleValueTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SingleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._current = 0.0; + this._difference = 0.0; + this._result = 0.0; + }; + SingleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + 1; + if (valueScale === 1.0) { + this._current = valueArray[valueOffset]; + this._difference = valueArray[nextValueOffset] - this._current; + } + else { + this._current = valueArray[valueOffset] * valueScale; + this._difference = valueArray[nextValueOffset] * valueScale - this._current; + } + } + else { + this._result = valueArray[valueOffset] * valueScale; + } + } + else { + this._result = 0.0; + } + }; + SingleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._result = this._current + this._difference * this._tweenProgress; + } + }; + return SingleValueTimelineState; + }(TweenTimelineState)); + dragonBones.SingleValueTimelineState = SingleValueTimelineState; + /** + * @internal + */ + var DoubleValueTimelineState = /** @class */ (function (_super) { + __extends(DoubleValueTimelineState, _super); + function DoubleValueTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + DoubleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._currentA = 0.0; + this._currentB = 0.0; + this._differenceA = 0.0; + this._differenceB = 0.0; + this._resultA = 0.0; + this._resultB = 0.0; + }; + DoubleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * 2; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + 2; + if (valueScale === 1.0) { + this._currentA = valueArray[valueOffset]; + this._currentB = valueArray[valueOffset + 1]; + this._differenceA = valueArray[nextValueOffset] - this._currentA; + this._differenceB = valueArray[nextValueOffset + 1] - this._currentB; + } + else { + this._currentA = valueArray[valueOffset] * valueScale; + this._currentB = valueArray[valueOffset + 1] * valueScale; + this._differenceA = valueArray[nextValueOffset] * valueScale - this._currentA; + this._differenceB = valueArray[nextValueOffset + 1] * valueScale - this._currentB; + } + } + else { + this._resultA = valueArray[valueOffset] * valueScale; + this._resultB = valueArray[valueOffset + 1] * valueScale; + } + } + else { + this._resultA = 0.0; + this._resultB = 0.0; + } + }; + DoubleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._resultA = this._currentA + this._differenceA * this._tweenProgress; + this._resultB = this._currentB + this._differenceB * this._tweenProgress; + } + }; + return DoubleValueTimelineState; + }(TweenTimelineState)); + dragonBones.DoubleValueTimelineState = DoubleValueTimelineState; + /** + * @internal + */ + var MutilpleValueTimelineState = /** @class */ (function (_super) { + __extends(MutilpleValueTimelineState, _super); + function MutilpleValueTimelineState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._rd = []; + return _this; + } + MutilpleValueTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._valueCount = 0; + this._rd.length = 0; + }; + MutilpleValueTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + var valueCount = this._valueCount; + var rd = this._rd; + if (this._timelineData !== null) { + var valueScale = this._valueScale; + var valueArray = this._valueArray; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount; + if (this._isTween) { + var nextValueOffset = this._frameIndex === this._frameCount - 1 ? + this._valueOffset + this._frameValueOffset : + valueOffset + valueCount; + if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[valueCount + i] = valueArray[nextValueOffset + i] - valueArray[valueOffset + i]; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[valueCount + i] = (valueArray[nextValueOffset + i] - valueArray[valueOffset + i]) * valueScale; + } + } + } + else if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i]; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] * valueScale; + } + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = 0.0; + } + } + }; + MutilpleValueTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + var valueCount = this._valueCount; + var valueScale = this._valueScale; + var tweenProgress = this._tweenProgress; + var valueArray = this._valueArray; + var rd = this._rd; + // + var valueOffset = this._valueOffset + this._frameValueOffset + this._frameIndex * valueCount; + if (valueScale === 1.0) { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] + rd[valueCount + i] * tweenProgress; + } + } + else { + for (var i = 0; i < valueCount; ++i) { + rd[i] = valueArray[valueOffset + i] * valueScale + rd[valueCount + i] * tweenProgress; + } + } + } + }; + return MutilpleValueTimelineState; + }(TweenTimelineState)); + dragonBones.MutilpleValueTimelineState = MutilpleValueTimelineState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @internal + */ + var ActionTimelineState = /** @class */ (function (_super) { + __extends(ActionTimelineState, _super); + function ActionTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + ActionTimelineState.toString = function () { + return "[class dragonBones.ActionTimelineState]"; + }; + ActionTimelineState.prototype._onCrossFrame = function (frameIndex) { + var eventDispatcher = this._armature.eventDispatcher; + if (this._animationState.actionEnabled) { + var frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */ + frameIndex]; + var actionCount = this._frameArray[frameOffset + 1]; + var actions = this._animationData.parent.actions; // May be the animaton data not belong to this armature data. + for (var i = 0; i < actionCount; ++i) { + var actionIndex = this._frameArray[frameOffset + 2 + i]; + var action = actions[actionIndex]; + if (action.type === 0 /* Play */) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + // eventObject.time = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + eventObject.time = this._frameArray[frameOffset] / this._frameRate; + eventObject.animationState = this._animationState; + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + this._armature._bufferAction(eventObject, true); + } + else { + var eventType = action.type === 10 /* Frame */ ? dragonBones.EventObject.FRAME_EVENT : dragonBones.EventObject.SOUND_EVENT; + if (action.type === 11 /* Sound */ || eventDispatcher.hasDBEventListener(eventType)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + // eventObject.time = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + eventObject.time = this._frameArray[frameOffset] / this._frameRate; + eventObject.animationState = this._animationState; + dragonBones.EventObject.actionDataToInstance(action, eventObject, this._armature); + this._armature._dragonBones.bufferEvent(eventObject); + } + } + } + } + }; + ActionTimelineState.prototype._onArriveAtFrame = function () { }; + ActionTimelineState.prototype._onUpdateFrame = function () { }; + ActionTimelineState.prototype.update = function (passedTime) { + var prevState = this.playState; + var prevPlayTimes = this.currentPlayTimes; + var prevTime = this.currentTime; + if (this._setCurrentTime(passedTime)) { + var eventActive = this._animationState._parent === null && this._animationState.actionEnabled; + var eventDispatcher = this._armature.eventDispatcher; + if (prevState < 0) { + if (this.playState !== prevState) { + if (this._animationState.displayControl && this._animationState.resetToPose) { // Reset zorder to pose. + this._armature._sortZOrder(null, 0); + } + // prevPlayTimes = this.currentPlayTimes; // TODO + if (eventActive && eventDispatcher.hasDBEventListener(dragonBones.EventObject.START)) { + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + eventObject.type = dragonBones.EventObject.START; + eventObject.armature = this._armature; + eventObject.animationState = this._animationState; + this._armature._dragonBones.bufferEvent(eventObject); + } + } + else { + return; + } + } + var isReverse = this._animationState.timeScale < 0.0; + var loopCompleteEvent = null; + var completeEvent = null; + if (eventActive && this.currentPlayTimes !== prevPlayTimes) { + if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.LOOP_COMPLETE)) { + loopCompleteEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + loopCompleteEvent.type = dragonBones.EventObject.LOOP_COMPLETE; + loopCompleteEvent.armature = this._armature; + loopCompleteEvent.animationState = this._animationState; + } + if (this.playState > 0) { + if (eventDispatcher.hasDBEventListener(dragonBones.EventObject.COMPLETE)) { + completeEvent = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + completeEvent.type = dragonBones.EventObject.COMPLETE; + completeEvent.armature = this._armature; + completeEvent.animationState = this._animationState; + } + } + } + if (this._frameCount > 1) { + var timelineData = this._timelineData; + var timelineFrameIndex = Math.floor(this.currentTime * this._frameRate); // uint + var frameIndex = this._frameIndices[timelineData.frameIndicesOffset + timelineFrameIndex]; + if (this._frameIndex !== frameIndex) { // Arrive at frame. + var crossedFrameIndex = this._frameIndex; + this._frameIndex = frameIndex; + if (this._timelineArray !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + this._frameIndex]; + if (isReverse) { + if (crossedFrameIndex < 0) { + var prevFrameIndex = Math.floor(prevTime * this._frameRate); + crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex]; + if (this.currentPlayTimes === prevPlayTimes) { // Start. + if (crossedFrameIndex === frameIndex) { // Uncrossed. + crossedFrameIndex = -1; + } + } + } + while (crossedFrameIndex >= 0) { + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this._position <= framePosition && + framePosition <= this._position + this._duration) { // Support interval play. + this._onCrossFrame(crossedFrameIndex); + } + if (loopCompleteEvent !== null && crossedFrameIndex === 0) { // Add loop complete event after first frame. + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + if (crossedFrameIndex > 0) { + crossedFrameIndex--; + } + else { + crossedFrameIndex = this._frameCount - 1; + } + if (crossedFrameIndex === frameIndex) { + break; + } + } + } + else { + if (crossedFrameIndex < 0) { + var prevFrameIndex = Math.floor(prevTime * this._frameRate); + crossedFrameIndex = this._frameIndices[timelineData.frameIndicesOffset + prevFrameIndex]; + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this.currentPlayTimes === prevPlayTimes) { // Start. + if (prevTime <= framePosition) { // Crossed. + if (crossedFrameIndex > 0) { + crossedFrameIndex--; + } + else { + crossedFrameIndex = this._frameCount - 1; + } + } + else if (crossedFrameIndex === frameIndex) { // Uncrossed. + crossedFrameIndex = -1; + } + } + } + while (crossedFrameIndex >= 0) { + if (crossedFrameIndex < this._frameCount - 1) { + crossedFrameIndex++; + } + else { + crossedFrameIndex = 0; + } + var frameOffset = this._animationData.frameOffset + this._timelineArray[timelineData.offset + 5 /* TimelineFrameOffset */ + crossedFrameIndex]; + // const framePosition = this._frameArray[frameOffset] * this._frameRateR; // Precision problem + var framePosition = this._frameArray[frameOffset] / this._frameRate; + if (this._position <= framePosition && + framePosition <= this._position + this._duration // + ) { // Support interval play. + this._onCrossFrame(crossedFrameIndex); + } + if (loopCompleteEvent !== null && crossedFrameIndex === 0) { // Add loop complete event before first frame. + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + if (crossedFrameIndex === frameIndex) { + break; + } + } + } + } + } + } + else if (this._frameIndex < 0) { + this._frameIndex = 0; + if (this._timelineData !== null) { + this._frameOffset = this._animationData.frameOffset + this._timelineArray[this._timelineData.offset + 5 /* TimelineFrameOffset */]; + // Arrive at frame. + var framePosition = this._frameArray[this._frameOffset] / this._frameRate; + if (this.currentPlayTimes === prevPlayTimes) { // Start. + if (prevTime <= framePosition) { + this._onCrossFrame(this._frameIndex); + } + } + else if (this._position <= framePosition) { // Loop complete. + if (!isReverse && loopCompleteEvent !== null) { // Add loop complete event before first frame. + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + loopCompleteEvent = null; + } + this._onCrossFrame(this._frameIndex); + } + } + } + if (loopCompleteEvent !== null) { + this._armature._dragonBones.bufferEvent(loopCompleteEvent); + } + if (completeEvent !== null) { + this._armature._dragonBones.bufferEvent(completeEvent); + } + } + }; + ActionTimelineState.prototype.setCurrentTime = function (value) { + this._setCurrentTime(value); + this._frameIndex = -1; + }; + return ActionTimelineState; + }(dragonBones.TimelineState)); + dragonBones.ActionTimelineState = ActionTimelineState; + /** + * @internal + */ + var ZOrderTimelineState = /** @class */ (function (_super) { + __extends(ZOrderTimelineState, _super); + function ZOrderTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + ZOrderTimelineState.toString = function () { + return "[class dragonBones.ZOrderTimelineState]"; + }; + ZOrderTimelineState.prototype._onArriveAtFrame = function () { + if (this.playState >= 0) { + var count = this._frameArray[this._frameOffset + 1]; + if (count > 0) { + this._armature._sortZOrder(this._frameArray, this._frameOffset + 2); + } + else { + this._armature._sortZOrder(null, 0); + } + } + }; + ZOrderTimelineState.prototype._onUpdateFrame = function () { }; + return ZOrderTimelineState; + }(dragonBones.TimelineState)); + dragonBones.ZOrderTimelineState = ZOrderTimelineState; + /** + * @internal + */ + var BoneAllTimelineState = /** @class */ (function (_super) { + __extends(BoneAllTimelineState, _super); + function BoneAllTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneAllTimelineState.toString = function () { + return "[class dragonBones.BoneAllTimelineState]"; + }; + BoneAllTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._isTween && this._frameIndex === this._frameCount - 1) { + this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]); + this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]); + } + if (this._timelineData === null) { // Pose. + this._rd[4] = 1.0; + this._rd[5] = 1.0; + } + }; + BoneAllTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = 6; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneAllTimelineState.prototype.fadeOut = function () { + this.dirty = false; + this._rd[2] = dragonBones.Transform.normalizeRadian(this._rd[2]); + this._rd[3] = dragonBones.Transform.normalizeRadian(this._rd[3]); + }; + BoneAllTimelineState.prototype.blend = function (isDirty) { + var valueScale = this._armature.armatureData.scale; + var rd = this._rd; + // + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.x += rd[0] * blendWeight * valueScale; + result.y += rd[1] * blendWeight * valueScale; + result.rotation += rd[2] * blendWeight; + result.skew += rd[3] * blendWeight; + result.scaleX += (rd[4] - 1.0) * blendWeight; + result.scaleY += (rd[5] - 1.0) * blendWeight; + } + else { + result.x = rd[0] * blendWeight * valueScale; + result.y = rd[1] * blendWeight * valueScale; + result.rotation = rd[2] * blendWeight; + result.skew = rd[3] * blendWeight; + result.scaleX = (rd[4] - 1.0) * blendWeight + 1.0; // + result.scaleY = (rd[5] - 1.0) * blendWeight + 1.0; // + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneAllTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.BoneAllTimelineState = BoneAllTimelineState; + /** + * @internal + */ + var BoneTranslateTimelineState = /** @class */ (function (_super) { + __extends(BoneTranslateTimelineState, _super); + function BoneTranslateTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneTranslateTimelineState.toString = function () { + return "[class dragonBones.BoneTranslateTimelineState]"; + }; + BoneTranslateTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneTranslateTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.x += this._resultA * blendWeight; + result.y += this._resultB * blendWeight; + } + else if (blendWeight !== 1.0) { + result.x = this._resultA * blendWeight; + result.y = this._resultB * blendWeight; + } + else { + result.x = this._resultA; + result.y = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneTranslateTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneTranslateTimelineState = BoneTranslateTimelineState; + /** + * @internal + */ + var BoneRotateTimelineState = /** @class */ (function (_super) { + __extends(BoneRotateTimelineState, _super); + function BoneRotateTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneRotateTimelineState.toString = function () { + return "[class dragonBones.BoneRotateTimelineState]"; + }; + BoneRotateTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._isTween && this._frameIndex === this._frameCount - 1) { + this._differenceA = dragonBones.Transform.normalizeRadian(this._differenceA); + this._differenceB = dragonBones.Transform.normalizeRadian(this._differenceB); + } + }; + BoneRotateTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneRotateTimelineState.prototype.fadeOut = function () { + this.dirty = false; + this._resultA = dragonBones.Transform.normalizeRadian(this._resultA); + this._resultB = dragonBones.Transform.normalizeRadian(this._resultB); + }; + BoneRotateTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.rotation += this._resultA * blendWeight; + result.skew += this._resultB * blendWeight; + } + else if (blendWeight !== 1.0) { + result.rotation = this._resultA * blendWeight; + result.skew = this._resultB * blendWeight; + } + else { + result.rotation = this._resultA; + result.skew = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneRotateTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneRotateTimelineState = BoneRotateTimelineState; + /** + * @internal + */ + var BoneScaleTimelineState = /** @class */ (function (_super) { + __extends(BoneScaleTimelineState, _super); + function BoneScaleTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + BoneScaleTimelineState.toString = function () { + return "[class dragonBones.BoneScaleTimelineState]"; + }; + BoneScaleTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { // Pose. + this._resultA = 1.0; + this._resultB = 1.0; + } + }; + BoneScaleTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameFloatOffset; + this._valueArray = this._animationData.parent.parent.frameFloatArray; + }; + BoneScaleTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var bone = blendState.target; + var blendWeight = blendState.blendWeight; + var result = bone.animationPose; + if (blendState.dirty > 1) { + result.scaleX += (this._resultA - 1.0) * blendWeight; + result.scaleY += (this._resultB - 1.0) * blendWeight; + } + else if (blendWeight !== 1.0) { + result.scaleX = (this._resultA - 1.0) * blendWeight + 1.0; + result.scaleY = (this._resultB - 1.0) * blendWeight + 1.0; + } + else { + result.scaleX = this._resultA; + result.scaleY = this._resultB; + } + if (isDirty || this.dirty) { + this.dirty = false; + bone._transformDirty = true; + } + }; + return BoneScaleTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.BoneScaleTimelineState = BoneScaleTimelineState; + /** + * @internal + */ + var SurfaceTimelineState = /** @class */ (function (_super) { + __extends(SurfaceTimelineState, _super); + function SurfaceTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SurfaceTimelineState.toString = function () { + return "[class dragonBones.SurfaceTimelineState]"; + }; + SurfaceTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._deformCount = 0; + this._deformOffset = 0; + this._sameValueOffset = 0; + }; + SurfaceTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; + var frameIntArray = dragonBonesData.frameIntArray; + var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */]; + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */]; + this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */]; + this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */]; + this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = dragonBonesData.frameFloatArray; + this._rd.length = this._valueCount * 2; + } + else { + this._deformCount = this.target.target._deformVertices.length; + } + }; + SurfaceTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var surface = blendState.target; + var blendWeight = blendState.blendWeight; + var result = surface._deformVertices; + var valueArray = this._valueArray; + if (valueArray !== null) { + var valueCount = this._valueCount; + var deformOffset = this._deformOffset; + var sameValueOffset = this._sameValueOffset; + var rd = this._rd; + for (var i = 0; i < this._deformCount; ++i) { + var value = 0.0; + if (i < deformOffset) { + value = valueArray[sameValueOffset + i]; + } + else if (i < deformOffset + valueCount) { + value = rd[i - deformOffset]; + } + else { + value = valueArray[sameValueOffset + i - valueCount]; + } + if (blendState.dirty > 1) { + result[i] += value * blendWeight; + } + else { + result[i] = value * blendWeight; + } + } + } + else if (blendState.dirty === 1) { + for (var i = 0; i < this._deformCount; ++i) { + result[i] = 0.0; + } + } + if (isDirty || this.dirty) { + this.dirty = false; + surface._transformDirty = true; + } + }; + return SurfaceTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.SurfaceTimelineState = SurfaceTimelineState; + /** + * @internal + */ + var AlphaTimelineState = /** @class */ (function (_super) { + __extends(AlphaTimelineState, _super); + function AlphaTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AlphaTimelineState.toString = function () { + return "[class dragonBones.AlphaTimelineState]"; + }; + AlphaTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { // Pose. + this._result = 1.0; + } + }; + AlphaTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.01; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + AlphaTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var alphaTarget = blendState.target; + var blendWeight = blendState.blendWeight; + if (blendState.dirty > 1) { + alphaTarget._alpha += this._result * blendWeight; + if (alphaTarget._alpha > 1.0) { + alphaTarget._alpha = 1.0; + } + } + else { + alphaTarget._alpha = this._result * blendWeight; + } + if (isDirty || this.dirty) { + this.dirty = false; + this._armature._alphaDirty = true; + } + }; + return AlphaTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AlphaTimelineState = AlphaTimelineState; + /** + * @internal + */ + var SlotDisplayTimelineState = /** @class */ (function (_super) { + __extends(SlotDisplayTimelineState, _super); + function SlotDisplayTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SlotDisplayTimelineState.toString = function () { + return "[class dragonBones.SlotDisplayTimelineState]"; + }; + SlotDisplayTimelineState.prototype._onArriveAtFrame = function () { + if (this.playState >= 0) { + var slot = this.target; + var displayIndex = this._timelineData !== null ? this._frameArray[this._frameOffset + 1] : slot._slotData.displayIndex; + if (slot.displayIndex !== displayIndex) { + slot._setDisplayIndex(displayIndex, true); + } + } + }; + SlotDisplayTimelineState.prototype._onUpdateFrame = function () { + }; + return SlotDisplayTimelineState; + }(dragonBones.TimelineState)); + dragonBones.SlotDisplayTimelineState = SlotDisplayTimelineState; + /** + * @internal + */ + var SlotColorTimelineState = /** @class */ (function (_super) { + __extends(SlotColorTimelineState, _super); + function SlotColorTimelineState() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._current = [0, 0, 0, 0, 0, 0, 0, 0]; + _this._difference = [0, 0, 0, 0, 0, 0, 0, 0]; + _this._result = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]; + return _this; + } + SlotColorTimelineState.toString = function () { + return "[class dragonBones.SlotColorTimelineState]"; + }; + SlotColorTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData !== null) { + var dragonBonesData = this._animationData.parent.parent; + var colorArray = dragonBonesData.colorArray; + var frameIntArray = dragonBonesData.frameIntArray; + var valueOffset = this._animationData.frameIntOffset + this._frameValueOffset + this._frameIndex; + var colorOffset = frameIntArray[valueOffset]; + if (colorOffset < 0) { + colorOffset += 65536; // Fixed out of bounds bug. + } + if (this._isTween) { + this._current[0] = colorArray[colorOffset++]; + this._current[1] = colorArray[colorOffset++]; + this._current[2] = colorArray[colorOffset++]; + this._current[3] = colorArray[colorOffset++]; + this._current[4] = colorArray[colorOffset++]; + this._current[5] = colorArray[colorOffset++]; + this._current[6] = colorArray[colorOffset++]; + this._current[7] = colorArray[colorOffset++]; + if (this._frameIndex === this._frameCount - 1) { + colorOffset = frameIntArray[this._animationData.frameIntOffset + this._frameValueOffset]; + } + else { + colorOffset = frameIntArray[valueOffset + 1]; + } + if (colorOffset < 0) { + colorOffset += 65536; // Fixed out of bounds bug. + } + this._difference[0] = colorArray[colorOffset++] - this._current[0]; + this._difference[1] = colorArray[colorOffset++] - this._current[1]; + this._difference[2] = colorArray[colorOffset++] - this._current[2]; + this._difference[3] = colorArray[colorOffset++] - this._current[3]; + this._difference[4] = colorArray[colorOffset++] - this._current[4]; + this._difference[5] = colorArray[colorOffset++] - this._current[5]; + this._difference[6] = colorArray[colorOffset++] - this._current[6]; + this._difference[7] = colorArray[colorOffset++] - this._current[7]; + } + else { + this._result[0] = colorArray[colorOffset++] * 0.01; + this._result[1] = colorArray[colorOffset++] * 0.01; + this._result[2] = colorArray[colorOffset++] * 0.01; + this._result[3] = colorArray[colorOffset++] * 0.01; + this._result[4] = colorArray[colorOffset++]; + this._result[5] = colorArray[colorOffset++]; + this._result[6] = colorArray[colorOffset++]; + this._result[7] = colorArray[colorOffset++]; + } + } + else { // Pose. + var slot = this.target; + var color = slot.slotData.color; + this._result[0] = color.alphaMultiplier; + this._result[1] = color.redMultiplier; + this._result[2] = color.greenMultiplier; + this._result[3] = color.blueMultiplier; + this._result[4] = color.alphaOffset; + this._result[5] = color.redOffset; + this._result[6] = color.greenOffset; + this._result[7] = color.blueOffset; + } + }; + SlotColorTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + if (this._isTween) { + this._result[0] = (this._current[0] + this._difference[0] * this._tweenProgress) * 0.01; + this._result[1] = (this._current[1] + this._difference[1] * this._tweenProgress) * 0.01; + this._result[2] = (this._current[2] + this._difference[2] * this._tweenProgress) * 0.01; + this._result[3] = (this._current[3] + this._difference[3] * this._tweenProgress) * 0.01; + this._result[4] = this._current[4] + this._difference[4] * this._tweenProgress; + this._result[5] = this._current[5] + this._difference[5] * this._tweenProgress; + this._result[6] = this._current[6] + this._difference[6] * this._tweenProgress; + this._result[7] = this._current[7] + this._difference[7] * this._tweenProgress; + } + }; + SlotColorTimelineState.prototype.fadeOut = function () { + this._isTween = false; + }; + SlotColorTimelineState.prototype.update = function (passedTime) { + _super.prototype.update.call(this, passedTime); + // Fade animation. + if (this._isTween || this.dirty) { + var slot = this.target; + var result = slot._colorTransform; + if (this._animationState._fadeState !== 0 || this._animationState._subFadeState !== 0) { + if (result.alphaMultiplier !== this._result[0] || + result.redMultiplier !== this._result[1] || + result.greenMultiplier !== this._result[2] || + result.blueMultiplier !== this._result[3] || + result.alphaOffset !== this._result[4] || + result.redOffset !== this._result[5] || + result.greenOffset !== this._result[6] || + result.blueOffset !== this._result[7]) { + var fadeProgress = Math.pow(this._animationState._fadeProgress, 4); + result.alphaMultiplier += (this._result[0] - result.alphaMultiplier) * fadeProgress; + result.redMultiplier += (this._result[1] - result.redMultiplier) * fadeProgress; + result.greenMultiplier += (this._result[2] - result.greenMultiplier) * fadeProgress; + result.blueMultiplier += (this._result[3] - result.blueMultiplier) * fadeProgress; + result.alphaOffset += (this._result[4] - result.alphaOffset) * fadeProgress; + result.redOffset += (this._result[5] - result.redOffset) * fadeProgress; + result.greenOffset += (this._result[6] - result.greenOffset) * fadeProgress; + result.blueOffset += (this._result[7] - result.blueOffset) * fadeProgress; + slot._colorDirty = true; + } + } + else if (this.dirty) { + this.dirty = false; + if (result.alphaMultiplier !== this._result[0] || + result.redMultiplier !== this._result[1] || + result.greenMultiplier !== this._result[2] || + result.blueMultiplier !== this._result[3] || + result.alphaOffset !== this._result[4] || + result.redOffset !== this._result[5] || + result.greenOffset !== this._result[6] || + result.blueOffset !== this._result[7]) { + result.alphaMultiplier = this._result[0]; + result.redMultiplier = this._result[1]; + result.greenMultiplier = this._result[2]; + result.blueMultiplier = this._result[3]; + result.alphaOffset = this._result[4]; + result.redOffset = this._result[5]; + result.greenOffset = this._result[6]; + result.blueOffset = this._result[7]; + slot._colorDirty = true; + } + } + } + }; + return SlotColorTimelineState; + }(dragonBones.TweenTimelineState)); + dragonBones.SlotColorTimelineState = SlotColorTimelineState; + /** + * @internal + */ + var SlotZIndexTimelineState = /** @class */ (function (_super) { + __extends(SlotZIndexTimelineState, _super); + function SlotZIndexTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + SlotZIndexTimelineState.toString = function () { + return "[class dragonBones.SlotZIndexTimelineState]"; + }; + SlotZIndexTimelineState.prototype._onArriveAtFrame = function () { + _super.prototype._onArriveAtFrame.call(this); + if (this._timelineData === null) { // Pose. + var blendState = this.target; + var slot = blendState.target; + this._result = slot.slotData.zIndex; + } + }; + SlotZIndexTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + SlotZIndexTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var slot = blendState.target; + var blendWeight = blendState.blendWeight; + if (blendState.dirty > 1) { + slot._zIndex += this._result * blendWeight; + } + else { + slot._zIndex = this._result * blendWeight; + } + if (isDirty || this.dirty) { + this.dirty = false; + this._armature._zIndexDirty = true; + } + }; + return SlotZIndexTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.SlotZIndexTimelineState = SlotZIndexTimelineState; + /** + * @internal + */ + var DeformTimelineState = /** @class */ (function (_super) { + __extends(DeformTimelineState, _super); + function DeformTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + DeformTimelineState.toString = function () { + return "[class dragonBones.DeformTimelineState]"; + }; + DeformTimelineState.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this.geometryOffset = 0; + this.displayFrame = null; + this._deformCount = 0; + this._deformOffset = 0; + this._sameValueOffset = 0; + }; + DeformTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + if (this._timelineData !== null) { + var frameIntOffset = this._animationData.frameIntOffset + this._timelineArray[this._timelineData.offset + 3 /* TimelineFrameValueCount */]; + var dragonBonesData = this._animationData.parent.parent; + var frameIntArray = dragonBonesData.frameIntArray; + var slot = this.target.target; + this.geometryOffset = frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */]; + if (this.geometryOffset < 0) { + this.geometryOffset += 65536; // Fixed out of bounds bug. + } + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayFrame = slot.getDisplayFrameAt(i); + var geometryData = displayFrame.getGeometryData(); + if (geometryData === null) { + continue; + } + if (geometryData.offset === this.geometryOffset) { + this.displayFrame = displayFrame; + this.displayFrame.updateDeformVertices(); + break; + } + } + if (this.displayFrame === null) { + this.returnToPool(); // + return; + } + this._valueOffset = this._animationData.frameFloatOffset; + this._valueCount = frameIntArray[frameIntOffset + 2 /* DeformValueCount */]; + this._deformCount = frameIntArray[frameIntOffset + 1 /* DeformCount */]; + this._deformOffset = frameIntArray[frameIntOffset + 3 /* DeformValueOffset */]; + this._sameValueOffset = frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] + this._animationData.frameFloatOffset; + this._valueScale = this._armature.armatureData.scale; + this._valueArray = dragonBonesData.frameFloatArray; + this._rd.length = this._valueCount * 2; + } + else { + this._deformCount = this.displayFrame.deformVertices.length; + } + }; + DeformTimelineState.prototype.blend = function (isDirty) { + var blendState = this.target; + var slot = blendState.target; + var blendWeight = blendState.blendWeight; + var result = this.displayFrame.deformVertices; + var valueArray = this._valueArray; + if (valueArray !== null) { + var valueCount = this._valueCount; + var deformOffset = this._deformOffset; + var sameValueOffset = this._sameValueOffset; + var rd = this._rd; + for (var i = 0; i < this._deformCount; ++i) { + var value = 0.0; + if (i < deformOffset) { + value = valueArray[sameValueOffset + i]; + } + else if (i < deformOffset + valueCount) { + value = rd[i - deformOffset]; + } + else { + value = valueArray[sameValueOffset + i - valueCount]; + } + if (blendState.dirty > 1) { + result[i] += value * blendWeight; + } + else { + result[i] = value * blendWeight; + } + } + } + else if (blendState.dirty === 1) { + for (var i = 0; i < this._deformCount; ++i) { + result[i] = 0.0; + } + } + if (isDirty || this.dirty) { + this.dirty = false; + if (slot._geometryData === this.displayFrame.getGeometryData()) { + slot._verticesDirty = true; + } + } + }; + return DeformTimelineState; + }(dragonBones.MutilpleValueTimelineState)); + dragonBones.DeformTimelineState = DeformTimelineState; + /** + * @internal + */ + var IKConstraintTimelineState = /** @class */ (function (_super) { + __extends(IKConstraintTimelineState, _super); + function IKConstraintTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + IKConstraintTimelineState.toString = function () { + return "[class dragonBones.IKConstraintTimelineState]"; + }; + IKConstraintTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var ikConstraint = this.target; + if (this._timelineData !== null) { + ikConstraint._bendPositive = this._currentA > 0.0; + ikConstraint._weight = this._currentB; + } + else { + var ikConstraintData = ikConstraint._constraintData; + ikConstraint._bendPositive = ikConstraintData.bendPositive; + ikConstraint._weight = ikConstraintData.weight; + } + ikConstraint.invalidUpdate(); + this.dirty = false; + }; + IKConstraintTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.01; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return IKConstraintTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.IKConstraintTimelineState = IKConstraintTimelineState; + /** + * @internal + */ + var AnimationProgressTimelineState = /** @class */ (function (_super) { + __extends(AnimationProgressTimelineState, _super); + function AnimationProgressTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationProgressTimelineState.toString = function () { + return "[class dragonBones.AnimationProgressTimelineState]"; + }; + AnimationProgressTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.currentTime = this._result * animationState.totalTime; + } + this.dirty = false; + }; + AnimationProgressTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationProgressTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AnimationProgressTimelineState = AnimationProgressTimelineState; + /** + * @internal + */ + var AnimationWeightTimelineState = /** @class */ (function (_super) { + __extends(AnimationWeightTimelineState, _super); + function AnimationWeightTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationWeightTimelineState.toString = function () { + return "[class dragonBones.AnimationWeightTimelineState]"; + }; + AnimationWeightTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.weight = this._result; + } + this.dirty = false; + }; + AnimationWeightTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationWeightTimelineState; + }(dragonBones.SingleValueTimelineState)); + dragonBones.AnimationWeightTimelineState = AnimationWeightTimelineState; + /** + * @internal + */ + var AnimationParametersTimelineState = /** @class */ (function (_super) { + __extends(AnimationParametersTimelineState, _super); + function AnimationParametersTimelineState() { + return _super !== null && _super.apply(this, arguments) || this; + } + AnimationParametersTimelineState.toString = function () { + return "[class dragonBones.AnimationParametersTimelineState]"; + }; + AnimationParametersTimelineState.prototype._onUpdateFrame = function () { + _super.prototype._onUpdateFrame.call(this); + var animationState = this.target; + if (animationState._parent !== null) { + animationState.parameterX = this._resultA; + animationState.parameterY = this._resultB; + } + this.dirty = false; + }; + AnimationParametersTimelineState.prototype.init = function (armature, animationState, timelineData) { + _super.prototype.init.call(this, armature, animationState, timelineData); + this._valueOffset = this._animationData.frameIntOffset; + this._valueScale = 0.0001; + this._valueArray = this._animationData.parent.parent.frameIntArray; + }; + return AnimationParametersTimelineState; + }(dragonBones.DoubleValueTimelineState)); + dragonBones.AnimationParametersTimelineState = AnimationParametersTimelineState; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The properties of the object carry basic information about an event, + * which are passed as parameter or parameter's parameter to event listeners when an event occurs. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 + * @version DragonBones 4.5 + * @language zh_CN + */ + var EventObject = /** @class */ (function (_super) { + __extends(EventObject, _super); + function EventObject() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @internal + * @private + */ + EventObject.actionDataToInstance = function (data, instance, armature) { + if (data.type === 0 /* Play */) { + instance.type = EventObject.FRAME_EVENT; + } + else { + instance.type = data.type === 10 /* Frame */ ? EventObject.FRAME_EVENT : EventObject.SOUND_EVENT; + } + instance.name = data.name; + instance.armature = armature; + instance.actionData = data; + instance.data = data.data; + if (data.bone !== null) { + instance.bone = armature.getBone(data.bone.name); + } + if (data.slot !== null) { + instance.slot = armature.getSlot(data.slot.name); + } + }; + EventObject.toString = function () { + return "[class dragonBones.EventObject]"; + }; + EventObject.prototype._onClear = function () { + this.time = 0.0; + this.type = ""; + this.name = ""; + this.armature = null; + this.bone = null; + this.slot = null; + this.animationState = null; + this.actionData = null; + this.data = null; + }; + /** + * - Animation start play. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画开始播放。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.START = "start"; + /** + * - Animation loop play complete once. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画循环播放完成一次。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.LOOP_COMPLETE = "loopComplete"; + /** + * - Animation play complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画播放完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.COMPLETE = "complete"; + /** + * - Animation fade in start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_IN = "fadeIn"; + /** + * - Animation fade in complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡入完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_IN_COMPLETE = "fadeInComplete"; + /** + * - Animation fade out start. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出开始。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_OUT = "fadeOut"; + /** + * - Animation fade out complete. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画淡出完成。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FADE_OUT_COMPLETE = "fadeOutComplete"; + /** + * - Animation frame event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.FRAME_EVENT = "frameEvent"; + /** + * - Animation frame sound event. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 动画帧声音事件。 + * @version DragonBones 4.5 + * @language zh_CN + */ + EventObject.SOUND_EVENT = "soundEvent"; + return EventObject; + }(dragonBones.BaseObject)); + dragonBones.EventObject = EventObject; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var DataParser = /** @class */ (function () { + function DataParser() { + } + DataParser._getArmatureType = function (value) { + switch (value.toLowerCase()) { + case "stage": + return 2 /* Stage */; + case "armature": + return 0 /* Armature */; + case "movieclip": + return 1 /* MovieClip */; + default: + return 0 /* Armature */; + } + }; + DataParser._getBoneType = function (value) { + switch (value.toLowerCase()) { + case "bone": + return 0 /* Bone */; + case "surface": + return 1 /* Surface */; + default: + return 0 /* Bone */; + } + }; + DataParser._getPositionMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "percent": + return 1 /* Percent */; + case "fixed": + return 0 /* Fixed */; + default: + return 1 /* Percent */; + } + }; + DataParser._getSpacingMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "length": + return 0 /* Length */; + case "percent": + return 2 /* Percent */; + case "fixed": + return 1 /* Fixed */; + default: + return 0 /* Length */; + } + }; + DataParser._getRotateMode = function (value) { + switch (value.toLocaleLowerCase()) { + case "tangent": + return 0 /* Tangent */; + case "chain": + return 1 /* Chain */; + case "chainscale": + return 2 /* ChainScale */; + default: + return 0 /* Tangent */; + } + }; + DataParser._getDisplayType = function (value) { + switch (value.toLowerCase()) { + case "image": + return 0 /* Image */; + case "mesh": + return 2 /* Mesh */; + case "armature": + return 1 /* Armature */; + case "boundingbox": + return 3 /* BoundingBox */; + case "path": + return 4 /* Path */; + default: + return 0 /* Image */; + } + }; + DataParser._getBoundingBoxType = function (value) { + switch (value.toLowerCase()) { + case "rectangle": + return 0 /* Rectangle */; + case "ellipse": + return 1 /* Ellipse */; + case "polygon": + return 2 /* Polygon */; + default: + return 0 /* Rectangle */; + } + }; + DataParser._getBlendMode = function (value) { + switch (value.toLowerCase()) { + case "normal": + return 0 /* Normal */; + case "add": + return 1 /* Add */; + case "alpha": + return 2 /* Alpha */; + case "darken": + return 3 /* Darken */; + case "difference": + return 4 /* Difference */; + case "erase": + return 5 /* Erase */; + case "hardlight": + return 6 /* HardLight */; + case "invert": + return 7 /* Invert */; + case "layer": + return 8 /* Layer */; + case "lighten": + return 9 /* Lighten */; + case "multiply": + return 10 /* Multiply */; + case "overlay": + return 11 /* Overlay */; + case "screen": + return 12 /* Screen */; + case "subtract": + return 13 /* Subtract */; + default: + return 0 /* Normal */; + } + }; + DataParser._getAnimationBlendType = function (value) { + switch (value.toLowerCase()) { + case "none": + return 0 /* None */; + case "1d": + return 1 /* E1D */; + default: + return 0 /* None */; + } + }; + DataParser._getActionType = function (value) { + switch (value.toLowerCase()) { + case "play": + return 0 /* Play */; + case "frame": + return 10 /* Frame */; + case "sound": + return 11 /* Sound */; + default: + return 0 /* Play */; + } + }; + DataParser.DATA_VERSION_2_3 = "2.3"; + DataParser.DATA_VERSION_3_0 = "3.0"; + DataParser.DATA_VERSION_4_0 = "4.0"; + DataParser.DATA_VERSION_4_5 = "4.5"; + DataParser.DATA_VERSION_5_0 = "5.0"; + DataParser.DATA_VERSION_5_5 = "5.5"; + DataParser.DATA_VERSION_5_6 = "5.6"; + DataParser.DATA_VERSION = DataParser.DATA_VERSION_5_6; + DataParser.DATA_VERSIONS = [ + DataParser.DATA_VERSION_4_0, + DataParser.DATA_VERSION_4_5, + DataParser.DATA_VERSION_5_0, + DataParser.DATA_VERSION_5_5, + DataParser.DATA_VERSION_5_6 + ]; + DataParser.TEXTURE_ATLAS = "textureAtlas"; + DataParser.SUB_TEXTURE = "SubTexture"; + DataParser.FORMAT = "format"; + DataParser.IMAGE_PATH = "imagePath"; + DataParser.WIDTH = "width"; + DataParser.HEIGHT = "height"; + DataParser.ROTATED = "rotated"; + DataParser.FRAME_X = "frameX"; + DataParser.FRAME_Y = "frameY"; + DataParser.FRAME_WIDTH = "frameWidth"; + DataParser.FRAME_HEIGHT = "frameHeight"; + DataParser.DRADON_BONES = "dragonBones"; + DataParser.USER_DATA = "userData"; + DataParser.ARMATURE = "armature"; + DataParser.CANVAS = "canvas"; + DataParser.BONE = "bone"; + DataParser.SURFACE = "surface"; + DataParser.SLOT = "slot"; + DataParser.CONSTRAINT = "constraint"; + DataParser.SKIN = "skin"; + DataParser.DISPLAY = "display"; + DataParser.FRAME = "frame"; + DataParser.IK = "ik"; + DataParser.PATH_CONSTRAINT = "path"; + DataParser.ANIMATION = "animation"; + DataParser.TIMELINE = "timeline"; + DataParser.FFD = "ffd"; + DataParser.TRANSLATE_FRAME = "translateFrame"; + DataParser.ROTATE_FRAME = "rotateFrame"; + DataParser.SCALE_FRAME = "scaleFrame"; + DataParser.DISPLAY_FRAME = "displayFrame"; + DataParser.COLOR_FRAME = "colorFrame"; + DataParser.DEFAULT_ACTIONS = "defaultActions"; + DataParser.ACTIONS = "actions"; + DataParser.EVENTS = "events"; + DataParser.INTS = "ints"; + DataParser.FLOATS = "floats"; + DataParser.STRINGS = "strings"; + DataParser.TRANSFORM = "transform"; + DataParser.PIVOT = "pivot"; + DataParser.AABB = "aabb"; + DataParser.COLOR = "color"; + DataParser.VERSION = "version"; + DataParser.COMPATIBLE_VERSION = "compatibleVersion"; + DataParser.FRAME_RATE = "frameRate"; + DataParser.TYPE = "type"; + DataParser.SUB_TYPE = "subType"; + DataParser.NAME = "name"; + DataParser.PARENT = "parent"; + DataParser.TARGET = "target"; + DataParser.STAGE = "stage"; + DataParser.SHARE = "share"; + DataParser.PATH = "path"; + DataParser.LENGTH = "length"; + DataParser.DISPLAY_INDEX = "displayIndex"; + DataParser.Z_ORDER = "zOrder"; + DataParser.Z_INDEX = "zIndex"; + DataParser.BLEND_MODE = "blendMode"; + DataParser.INHERIT_TRANSLATION = "inheritTranslation"; + DataParser.INHERIT_ROTATION = "inheritRotation"; + DataParser.INHERIT_SCALE = "inheritScale"; + DataParser.INHERIT_REFLECTION = "inheritReflection"; + DataParser.INHERIT_ANIMATION = "inheritAnimation"; + DataParser.INHERIT_DEFORM = "inheritDeform"; + DataParser.SEGMENT_X = "segmentX"; + DataParser.SEGMENT_Y = "segmentY"; + DataParser.BEND_POSITIVE = "bendPositive"; + DataParser.CHAIN = "chain"; + DataParser.WEIGHT = "weight"; + DataParser.BLEND_TYPE = "blendType"; + DataParser.FADE_IN_TIME = "fadeInTime"; + DataParser.PLAY_TIMES = "playTimes"; + DataParser.SCALE = "scale"; + DataParser.OFFSET = "offset"; + DataParser.POSITION = "position"; + DataParser.DURATION = "duration"; + DataParser.TWEEN_EASING = "tweenEasing"; + DataParser.TWEEN_ROTATE = "tweenRotate"; + DataParser.TWEEN_SCALE = "tweenScale"; + DataParser.CLOCK_WISE = "clockwise"; + DataParser.CURVE = "curve"; + DataParser.SOUND = "sound"; + DataParser.EVENT = "event"; + DataParser.ACTION = "action"; + DataParser.X = "x"; + DataParser.Y = "y"; + DataParser.SKEW_X = "skX"; + DataParser.SKEW_Y = "skY"; + DataParser.SCALE_X = "scX"; + DataParser.SCALE_Y = "scY"; + DataParser.VALUE = "value"; + DataParser.ROTATE = "rotate"; + DataParser.SKEW = "skew"; + DataParser.ALPHA = "alpha"; + DataParser.ALPHA_OFFSET = "aO"; + DataParser.RED_OFFSET = "rO"; + DataParser.GREEN_OFFSET = "gO"; + DataParser.BLUE_OFFSET = "bO"; + DataParser.ALPHA_MULTIPLIER = "aM"; + DataParser.RED_MULTIPLIER = "rM"; + DataParser.GREEN_MULTIPLIER = "gM"; + DataParser.BLUE_MULTIPLIER = "bM"; + DataParser.UVS = "uvs"; + DataParser.VERTICES = "vertices"; + DataParser.TRIANGLES = "triangles"; + DataParser.WEIGHTS = "weights"; + DataParser.SLOT_POSE = "slotPose"; + DataParser.BONE_POSE = "bonePose"; + DataParser.BONES = "bones"; + DataParser.POSITION_MODE = "positionMode"; + DataParser.SPACING_MODE = "spacingMode"; + DataParser.ROTATE_MODE = "rotateMode"; + DataParser.SPACING = "spacing"; + DataParser.ROTATE_OFFSET = "rotateOffset"; + DataParser.ROTATE_MIX = "rotateMix"; + DataParser.TRANSLATE_MIX = "translateMix"; + DataParser.TARGET_DISPLAY = "targetDisplay"; + DataParser.CLOSED = "closed"; + DataParser.CONSTANT_SPEED = "constantSpeed"; + DataParser.VERTEX_COUNT = "vertexCount"; + DataParser.LENGTHS = "lengths"; + DataParser.GOTO_AND_PLAY = "gotoAndPlay"; + DataParser.DEFAULT_NAME = "default"; + return DataParser; + }()); + dragonBones.DataParser = DataParser; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var ObjectDataParser = /** @class */ (function (_super) { + __extends(ObjectDataParser, _super); + function ObjectDataParser() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._rawTextureAtlasIndex = 0; + _this._rawBones = []; + _this._data = null; // + _this._armature = null; // + _this._bone = null; // + _this._geometry = null; // + _this._slot = null; // + _this._skin = null; // + _this._mesh = null; // + _this._animation = null; // + _this._timeline = null; // + _this._rawTextureAtlases = null; + _this._frameValueType = 0 /* Step */; + _this._defaultColorOffset = -1; + _this._prevClockwise = 0; + _this._prevRotation = 0.0; + _this._frameDefaultValue = 0.0; + _this._frameValueScale = 1.0; + _this._helpMatrixA = new dragonBones.Matrix(); + _this._helpMatrixB = new dragonBones.Matrix(); + _this._helpTransform = new dragonBones.Transform(); + _this._helpColorTransform = new dragonBones.ColorTransform(); + _this._helpPoint = new dragonBones.Point(); + _this._helpArray = []; + _this._intArray = []; + _this._floatArray = []; + _this._frameIntArray = []; + _this._frameFloatArray = []; + _this._frameArray = []; + _this._timelineArray = []; + _this._colorArray = []; + _this._cacheRawMeshes = []; + _this._cacheMeshes = []; + _this._actionFrames = []; + _this._weightSlotPose = {}; + _this._weightBonePoses = {}; + _this._cacheBones = {}; + _this._slotChildActions = {}; + return _this; + } + ObjectDataParser._getBoolean = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + var type = typeof value; + if (type === "boolean") { + return value; + } + else if (type === "string") { + switch (value) { + case "0": + case "NaN": + case "": + case "false": + case "null": + case "undefined": + return false; + default: + return true; + } + } + else { + return !!value; + } + } + return defaultValue; + }; + ObjectDataParser._getNumber = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + if (value === null || value === "NaN") { + return defaultValue; + } + return +value || 0; + } + return defaultValue; + }; + ObjectDataParser._getString = function (rawData, key, defaultValue) { + if (key in rawData) { + var value = rawData[key]; + var type = typeof value; + if (type === "string") { + return value; + } + return String(value); + } + return defaultValue; + }; + ObjectDataParser.prototype._getCurvePoint = function (x1, y1, x2, y2, x3, y3, x4, y4, t, result) { + var l_t = 1.0 - t; + var powA = l_t * l_t; + var powB = t * t; + var kA = l_t * powA; + var kB = 3.0 * t * powA; + var kC = 3.0 * l_t * powB; + var kD = t * powB; + result.x = kA * x1 + kB * x2 + kC * x3 + kD * x4; + result.y = kA * y1 + kB * y2 + kC * y3 + kD * y4; + }; + ObjectDataParser.prototype._samplingEasingCurve = function (curve, samples) { + var curveCount = curve.length; + if (curveCount % 3 === 1) { + var stepIndex = -2; + for (var i = 0, l = samples.length; i < l; ++i) { + var t = (i + 1) / (l + 1); // float + while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6] : 1) < t) { // stepIndex + 3 * 2 + stepIndex += 6; + } + var isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount; + var x1 = isInCurve ? curve[stepIndex] : 0.0; + var y1 = isInCurve ? curve[stepIndex + 1] : 0.0; + var x2 = curve[stepIndex + 2]; + var y2 = curve[stepIndex + 3]; + var x3 = curve[stepIndex + 4]; + var y3 = curve[stepIndex + 5]; + var x4 = isInCurve ? curve[stepIndex + 6] : 1.0; + var y4 = isInCurve ? curve[stepIndex + 7] : 1.0; + var lower = 0.0; + var higher = 1.0; + while (higher - lower > 0.0001) { + var percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } + } + samples[i] = this._helpPoint.y; + } + return true; + } + else { + var stepIndex = 0; + for (var i = 0, l = samples.length; i < l; ++i) { + var t = (i + 1) / (l + 1); // float + while (curve[stepIndex + 6] < t) { // stepIndex + 3 * 2 + stepIndex += 6; + } + var x1 = curve[stepIndex]; + var y1 = curve[stepIndex + 1]; + var x2 = curve[stepIndex + 2]; + var y2 = curve[stepIndex + 3]; + var x3 = curve[stepIndex + 4]; + var y3 = curve[stepIndex + 5]; + var x4 = curve[stepIndex + 6]; + var y4 = curve[stepIndex + 7]; + var lower = 0.0; + var higher = 1.0; + while (higher - lower > 0.0001) { + var percentage = (higher + lower) * 0.5; + this._getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, this._helpPoint); + if (t - this._helpPoint.x > 0.0) { + lower = percentage; + } + else { + higher = percentage; + } + } + samples[i] = this._helpPoint.y; + } + return false; + } + }; + ObjectDataParser.prototype._parseActionDataInFrame = function (rawData, frameStart, bone, slot) { + if (dragonBones.DataParser.EVENT in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.EVENT], frameStart, 10 /* Frame */, bone, slot); + } + if (dragonBones.DataParser.SOUND in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.SOUND], frameStart, 11 /* Sound */, bone, slot); + } + if (dragonBones.DataParser.ACTION in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.ACTION], frameStart, 0 /* Play */, bone, slot); + } + if (dragonBones.DataParser.EVENTS in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.EVENTS], frameStart, 10 /* Frame */, bone, slot); + } + if (dragonBones.DataParser.ACTIONS in rawData) { + this._mergeActionFrame(rawData[dragonBones.DataParser.ACTIONS], frameStart, 0 /* Play */, bone, slot); + } + }; + ObjectDataParser.prototype._mergeActionFrame = function (rawData, frameStart, type, bone, slot) { + var actionOffset = this._armature.actions.length; + var actions = this._parseActionData(rawData, type, bone, slot); + var frameIndex = 0; + var frame = null; + for (var _i = 0, actions_2 = actions; _i < actions_2.length; _i++) { + var action = actions_2[_i]; + this._armature.addAction(action, false); + } + if (this._actionFrames.length === 0) { // First frame. + frame = new ActionFrame(); + frame.frameStart = 0; + this._actionFrames.push(frame); + frame = null; + } + for (var _a = 0, _b = this._actionFrames; _a < _b.length; _a++) { // Get same frame. + var eachFrame = _b[_a]; + if (eachFrame.frameStart === frameStart) { + frame = eachFrame; + break; + } + else if (eachFrame.frameStart > frameStart) { + break; + } + frameIndex++; + } + if (frame === null) { // Create and cache frame. + frame = new ActionFrame(); + frame.frameStart = frameStart; + this._actionFrames.splice(frameIndex, 0, frame); + } + for (var i = 0; i < actions.length; ++i) { // Cache action offsets. + frame.actions.push(actionOffset + i); + } + }; + ObjectDataParser.prototype._parseArmature = function (rawData, scale) { + var armature = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureData); + armature.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + armature.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, this._data.frameRate); + armature.scale = scale; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + armature.type = dragonBones.DataParser._getArmatureType(rawData[dragonBones.DataParser.TYPE]); + } + else { + armature.type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Armature */); + } + if (armature.frameRate === 0) { // Data error. + armature.frameRate = 24; + } + this._armature = armature; + if (dragonBones.DataParser.CANVAS in rawData) { + var rawCanvas = rawData[dragonBones.DataParser.CANVAS]; + var canvas = dragonBones.BaseObject.borrowObject(dragonBones.CanvasData); + if (dragonBones.DataParser.COLOR in rawCanvas) { + canvas.hasBackground = true; + } + else { + canvas.hasBackground = false; + } + canvas.color = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.COLOR, 0); + canvas.x = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.X, 0) * armature.scale; + canvas.y = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.Y, 0) * armature.scale; + canvas.width = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.WIDTH, 0) * armature.scale; + canvas.height = ObjectDataParser._getNumber(rawCanvas, dragonBones.DataParser.HEIGHT, 0) * armature.scale; + armature.canvas = canvas; + } + if (dragonBones.DataParser.AABB in rawData) { + var rawAABB = rawData[dragonBones.DataParser.AABB]; + armature.aabb.x = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.X, 0.0) * armature.scale; + armature.aabb.y = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.Y, 0.0) * armature.scale; + armature.aabb.width = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.WIDTH, 0.0) * armature.scale; + armature.aabb.height = ObjectDataParser._getNumber(rawAABB, dragonBones.DataParser.HEIGHT, 0.0) * armature.scale; + } + if (dragonBones.DataParser.BONE in rawData) { + var rawBones = rawData[dragonBones.DataParser.BONE]; + for (var _i = 0, rawBones_1 = rawBones; _i < rawBones_1.length; _i++) { + var rawBone = rawBones_1[_i]; + var parentName = ObjectDataParser._getString(rawBone, dragonBones.DataParser.PARENT, ""); + var bone = this._parseBone(rawBone); + if (parentName.length > 0) { // Get bone parent. + var parent_1 = armature.getBone(parentName); + if (parent_1 !== null) { + bone.parent = parent_1; + } + else { // Cache. + if (!(parentName in this._cacheBones)) { + this._cacheBones[parentName] = []; + } + this._cacheBones[parentName].push(bone); + } + } + if (bone.name in this._cacheBones) { + for (var _a = 0, _b = this._cacheBones[bone.name]; _a < _b.length; _a++) { + var child = _b[_a]; + child.parent = bone; + } + delete this._cacheBones[bone.name]; + } + armature.addBone(bone); + this._rawBones.push(bone); // Cache raw bones sort. + } + } + if (dragonBones.DataParser.IK in rawData) { + var rawIKS = rawData[dragonBones.DataParser.IK]; + for (var _c = 0, rawIKS_1 = rawIKS; _c < rawIKS_1.length; _c++) { + var rawIK = rawIKS_1[_c]; + var constraint = this._parseIKConstraint(rawIK); + if (constraint) { + armature.addConstraint(constraint); + } + } + } + armature.sortBones(); + if (dragonBones.DataParser.SLOT in rawData) { + var zOrder = 0; + var rawSlots = rawData[dragonBones.DataParser.SLOT]; + for (var _d = 0, rawSlots_1 = rawSlots; _d < rawSlots_1.length; _d++) { + var rawSlot = rawSlots_1[_d]; + armature.addSlot(this._parseSlot(rawSlot, zOrder++)); + } + } + if (dragonBones.DataParser.SKIN in rawData) { + var rawSkins = rawData[dragonBones.DataParser.SKIN]; + for (var _e = 0, rawSkins_1 = rawSkins; _e < rawSkins_1.length; _e++) { + var rawSkin = rawSkins_1[_e]; + armature.addSkin(this._parseSkin(rawSkin)); + } + } + if (dragonBones.DataParser.PATH_CONSTRAINT in rawData) { + var rawPaths = rawData[dragonBones.DataParser.PATH_CONSTRAINT]; + for (var _f = 0, rawPaths_1 = rawPaths; _f < rawPaths_1.length; _f++) { + var rawPath = rawPaths_1[_f]; + var constraint = this._parsePathConstraint(rawPath); + if (constraint) { + armature.addConstraint(constraint); + } + } + } + for (var i = 0, l = this._cacheRawMeshes.length; i < l; ++i) { // Link mesh. + var rawData_1 = this._cacheRawMeshes[i]; + var shareName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SHARE, ""); + if (shareName.length === 0) { + continue; + } + var skinName = ObjectDataParser._getString(rawData_1, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME); + if (skinName.length === 0) { // + skinName = dragonBones.DataParser.DEFAULT_NAME; + } + var shareMesh = armature.getMesh(skinName, "", shareName); // TODO slot; + if (shareMesh === null) { + continue; // Error. + } + var mesh = this._cacheMeshes[i]; + mesh.geometry.shareFrom(shareMesh.geometry); + } + if (dragonBones.DataParser.ANIMATION in rawData) { + var rawAnimations = rawData[dragonBones.DataParser.ANIMATION]; + for (var _g = 0, rawAnimations_1 = rawAnimations; _g < rawAnimations_1.length; _g++) { + var rawAnimation = rawAnimations_1[_g]; + var animation = this._parseAnimation(rawAnimation); + armature.addAnimation(animation); + } + } + if (dragonBones.DataParser.DEFAULT_ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.DEFAULT_ACTIONS], 0 /* Play */, null, null); + for (var _h = 0, actions_3 = actions; _h < actions_3.length; _h++) { + var action = actions_3[_h]; + armature.addAction(action, true); + if (action.type === 0 /* Play */) { // Set default animation from default action. + var animation = armature.getAnimation(action.name); + if (animation !== null) { + armature.defaultAnimation = animation; + } + } + } + } + if (dragonBones.DataParser.ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + for (var _j = 0, actions_4 = actions; _j < actions_4.length; _j++) { + var action = actions_4[_j]; + armature.addAction(action, false); + } + } + // Clear helper. + this._rawBones.length = 0; + this._cacheRawMeshes.length = 0; + this._cacheMeshes.length = 0; + this._armature = null; + for (var k in this._weightSlotPose) { + delete this._weightSlotPose[k]; + } + for (var k in this._weightBonePoses) { + delete this._weightBonePoses[k]; + } + for (var k in this._cacheBones) { + delete this._cacheBones[k]; + } + for (var k in this._slotChildActions) { + delete this._slotChildActions[k]; + } + return armature; + }; + ObjectDataParser.prototype._parseBone = function (rawData) { + var type = 0 /* Bone */; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + type = dragonBones.DataParser._getBoneType(rawData[dragonBones.DataParser.TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, 0 /* Bone */); + } + if (type === 0 /* Bone */) { + var scale = this._armature.scale; + var bone = dragonBones.BaseObject.borrowObject(dragonBones.BoneData); + bone.inheritTranslation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_TRANSLATION, true); + bone.inheritRotation = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_ROTATION, true); + bone.inheritScale = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_SCALE, true); + bone.inheritReflection = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_REFLECTION, true); + bone.length = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.LENGTH, 0) * scale; + bone.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + bone.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + if (dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], bone.transform, scale); + } + return bone; + } + var surface = dragonBones.BaseObject.borrowObject(dragonBones.SurfaceData); + surface.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + surface.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + surface.segmentX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_X, 0); + surface.segmentY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SEGMENT_Y, 0); + this._parseGeometry(rawData, surface.geometry); + return surface; + }; + ObjectDataParser.prototype._parseIKConstraint = function (rawData) { + var bone = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.BONE, "")); + if (bone === null) { + return null; + } + var target = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET, "")); + if (target === null) { + return null; + } + var chain = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CHAIN, 0); + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraintData); + constraint.scaleEnabled = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.SCALE, false); + constraint.bendPositive = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true); + constraint.weight = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0); + constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + constraint.type = 0 /* IK */; + constraint.target = target; + if (chain > 0 && bone.parent !== null) { + constraint.root = bone.parent; + constraint.bone = bone; + } + else { + constraint.root = bone; + constraint.bone = null; + } + return constraint; + }; + ObjectDataParser.prototype._parsePathConstraint = function (rawData) { + var target = this._armature.getSlot(ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET, "")); + if (target === null) { + return null; + } + var defaultSkin = this._armature.defaultSkin; + if (defaultSkin === null) { + return null; + } + //TODO + var targetDisplay = defaultSkin.getDisplay(target.name, ObjectDataParser._getString(rawData, dragonBones.DataParser.TARGET_DISPLAY, target.name)); + if (targetDisplay === null || !(targetDisplay instanceof dragonBones.PathDisplayData)) { + return null; + } + var bones = rawData[dragonBones.DataParser.BONES]; + if (bones === null || bones.length === 0) { + return null; + } + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.PathConstraintData); + constraint.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + constraint.type = 1 /* Path */; + constraint.pathSlot = target; + constraint.pathDisplayData = targetDisplay; + constraint.target = target.parent; + constraint.positionMode = dragonBones.DataParser._getPositionMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.POSITION_MODE, "")); + constraint.spacingMode = dragonBones.DataParser._getSpacingMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.SPACING_MODE, "")); + constraint.rotateMode = dragonBones.DataParser._getRotateMode(ObjectDataParser._getString(rawData, dragonBones.DataParser.ROTATE_MODE, "")); + constraint.position = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.POSITION, 0); + constraint.spacing = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SPACING, 0); + constraint.rotateOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE_OFFSET, 0); + constraint.rotateMix = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE_MIX, 1); + constraint.translateMix = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TRANSLATE_MIX, 1); + // + for (var _i = 0, bones_3 = bones; _i < bones_3.length; _i++) { + var boneName = bones_3[_i]; + var bone = this._armature.getBone(boneName); + if (bone !== null) { + constraint.AddBone(bone); + if (constraint.root === null) { + constraint.root = bone; + } + } + } + return constraint; + }; + ObjectDataParser.prototype._parseSlot = function (rawData, zOrder) { + var slot = dragonBones.BaseObject.borrowObject(dragonBones.SlotData); + slot.displayIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0); + slot.zOrder = zOrder; + slot.zIndex = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Z_INDEX, 0); + slot.alpha = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA, 1.0); + slot.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + slot.parent = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.PARENT, "")); // + if (dragonBones.DataParser.BLEND_MODE in rawData && typeof rawData[dragonBones.DataParser.BLEND_MODE] === "string") { + slot.blendMode = dragonBones.DataParser._getBlendMode(rawData[dragonBones.DataParser.BLEND_MODE]); + } + else { + slot.blendMode = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLEND_MODE, 0 /* Normal */); + } + if (dragonBones.DataParser.COLOR in rawData) { + slot.color = dragonBones.SlotData.createColor(); + this._parseColorTransform(rawData[dragonBones.DataParser.COLOR], slot.color); + } + else { + slot.color = dragonBones.SlotData.DEFAULT_COLOR; + } + if (dragonBones.DataParser.ACTIONS in rawData) { + this._slotChildActions[slot.name] = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + } + return slot; + }; + ObjectDataParser.prototype._parseSkin = function (rawData) { + var skin = dragonBones.BaseObject.borrowObject(dragonBones.SkinData); + skin.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (skin.name.length === 0) { + skin.name = dragonBones.DataParser.DEFAULT_NAME; + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawSlots = rawData[dragonBones.DataParser.SLOT]; + this._skin = skin; + for (var _i = 0, rawSlots_2 = rawSlots; _i < rawSlots_2.length; _i++) { + var rawSlot = rawSlots_2[_i]; + var slotName = ObjectDataParser._getString(rawSlot, dragonBones.DataParser.NAME, ""); + var slot = this._armature.getSlot(slotName); + if (slot !== null) { + this._slot = slot; + if (dragonBones.DataParser.DISPLAY in rawSlot) { + var rawDisplays = rawSlot[dragonBones.DataParser.DISPLAY]; + for (var _a = 0, rawDisplays_1 = rawDisplays; _a < rawDisplays_1.length; _a++) { + var rawDisplay = rawDisplays_1[_a]; + if (rawDisplay) { + skin.addDisplay(slotName, this._parseDisplay(rawDisplay)); + } + else { + skin.addDisplay(slotName, null); + } + } + } + this._slot = null; // + } + } + this._skin = null; // + } + return skin; + }; + ObjectDataParser.prototype._parseDisplay = function (rawData) { + var name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + var path = ObjectDataParser._getString(rawData, dragonBones.DataParser.PATH, ""); + var type = 0 /* Image */; + var display = null; + if (dragonBones.DataParser.TYPE in rawData && typeof rawData[dragonBones.DataParser.TYPE] === "string") { + type = dragonBones.DataParser._getDisplayType(rawData[dragonBones.DataParser.TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TYPE, type); + } + switch (type) { + case 0 /* Image */: { + var imageDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ImageDisplayData); + imageDisplay.name = name; + imageDisplay.path = path.length > 0 ? path : name; + this._parsePivot(rawData, imageDisplay); + break; + } + case 1 /* Armature */: { + var armatureDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.ArmatureDisplayData); + armatureDisplay.name = name; + armatureDisplay.path = path.length > 0 ? path : name; + armatureDisplay.inheritAnimation = true; + if (dragonBones.DataParser.ACTIONS in rawData) { + var actions = this._parseActionData(rawData[dragonBones.DataParser.ACTIONS], 0 /* Play */, null, null); + for (var _i = 0, actions_5 = actions; _i < actions_5.length; _i++) { + var action = actions_5[_i]; + armatureDisplay.addAction(action); + } + } + else if (this._slot.name in this._slotChildActions) { + var displays = this._skin.getDisplays(this._slot.name); + if (displays === null ? this._slot.displayIndex === 0 : this._slot.displayIndex === displays.length) { + for (var _a = 0, _b = this._slotChildActions[this._slot.name]; _a < _b.length; _a++) { + var action = _b[_a]; + armatureDisplay.addAction(action); + } + delete this._slotChildActions[this._slot.name]; + } + } + break; + } + case 2 /* Mesh */: { + var meshDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.MeshDisplayData); + meshDisplay.geometry.inheritDeform = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.INHERIT_DEFORM, true); + meshDisplay.name = name; + meshDisplay.path = path.length > 0 ? path : name; + if (dragonBones.DataParser.SHARE in rawData) { + meshDisplay.geometry.data = this._data; + this._cacheRawMeshes.push(rawData); + this._cacheMeshes.push(meshDisplay); + } + else { + this._parseMesh(rawData, meshDisplay); + } + break; + } + case 3 /* BoundingBox */: { + var boundingBox = this._parseBoundingBox(rawData); + if (boundingBox !== null) { + var boundingBoxDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.BoundingBoxDisplayData); + boundingBoxDisplay.name = name; + boundingBoxDisplay.path = path.length > 0 ? path : name; + boundingBoxDisplay.boundingBox = boundingBox; + } + break; + } + case 4 /* Path */: { + var rawCurveLengths = rawData[dragonBones.DataParser.LENGTHS]; + var pathDisplay = display = dragonBones.BaseObject.borrowObject(dragonBones.PathDisplayData); + pathDisplay.closed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CLOSED, false); + pathDisplay.constantSpeed = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.CONSTANT_SPEED, false); + pathDisplay.name = name; + pathDisplay.path = path.length > 0 ? path : name; + pathDisplay.curveLengths.length = rawCurveLengths.length; + for (var i = 0, l = rawCurveLengths.length; i < l; ++i) { + pathDisplay.curveLengths[i] = rawCurveLengths[i]; + } + this._parsePath(rawData, pathDisplay); + break; + } + } + if (display !== null && dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], display.transform, this._armature.scale); + } + return display; + }; + ObjectDataParser.prototype._parsePath = function (rawData, display) { + this._parseGeometry(rawData, display.geometry); + }; + ObjectDataParser.prototype._parsePivot = function (rawData, display) { + if (dragonBones.DataParser.PIVOT in rawData) { + var rawPivot = rawData[dragonBones.DataParser.PIVOT]; + display.pivot.x = ObjectDataParser._getNumber(rawPivot, dragonBones.DataParser.X, 0.0); + display.pivot.y = ObjectDataParser._getNumber(rawPivot, dragonBones.DataParser.Y, 0.0); + } + else { + display.pivot.x = 0.5; + display.pivot.y = 0.5; + } + }; + ObjectDataParser.prototype._parseMesh = function (rawData, mesh) { + this._parseGeometry(rawData, mesh.geometry); + if (dragonBones.DataParser.WEIGHTS in rawData) { // Cache pose data. + var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE]; + var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE]; + var meshName = this._skin.name + "_" + this._slot.name + "_" + mesh.name; + this._weightSlotPose[meshName] = rawSlotPose; + this._weightBonePoses[meshName] = rawBonePoses; + } + }; + ObjectDataParser.prototype._parseBoundingBox = function (rawData) { + var boundingBox = null; + var type = 0 /* Rectangle */; + if (dragonBones.DataParser.SUB_TYPE in rawData && typeof rawData[dragonBones.DataParser.SUB_TYPE] === "string") { + type = dragonBones.DataParser._getBoundingBoxType(rawData[dragonBones.DataParser.SUB_TYPE]); + } + else { + type = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SUB_TYPE, type); + } + switch (type) { + case 0 /* Rectangle */: + boundingBox = dragonBones.BaseObject.borrowObject(dragonBones.RectangleBoundingBoxData); + break; + case 1 /* Ellipse */: + boundingBox = dragonBones.BaseObject.borrowObject(dragonBones.EllipseBoundingBoxData); + break; + case 2 /* Polygon */: + boundingBox = this._parsePolygonBoundingBox(rawData); + break; + } + if (boundingBox !== null) { + boundingBox.color = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.COLOR, 0x000000); + if (boundingBox.type === 0 /* Rectangle */ || boundingBox.type === 1 /* Ellipse */) { + boundingBox.width = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WIDTH, 0.0); + boundingBox.height = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.HEIGHT, 0.0); + } + } + return boundingBox; + }; + ObjectDataParser.prototype._parsePolygonBoundingBox = function (rawData) { + var polygonBoundingBox = dragonBones.BaseObject.borrowObject(dragonBones.PolygonBoundingBoxData); + if (dragonBones.DataParser.VERTICES in rawData) { + var scale = this._armature.scale; + var rawVertices = rawData[dragonBones.DataParser.VERTICES]; + var vertices = polygonBoundingBox.vertices; + vertices.length = rawVertices.length; + for (var i = 0, l = rawVertices.length; i < l; i += 2) { + var x = rawVertices[i] * scale; + var y = rawVertices[i + 1] * scale; + vertices[i] = x; + vertices[i + 1] = y; + // AABB. + if (i === 0) { + polygonBoundingBox.x = x; + polygonBoundingBox.y = y; + polygonBoundingBox.width = x; + polygonBoundingBox.height = y; + } + else { + if (x < polygonBoundingBox.x) { + polygonBoundingBox.x = x; + } + else if (x > polygonBoundingBox.width) { + polygonBoundingBox.width = x; + } + if (y < polygonBoundingBox.y) { + polygonBoundingBox.y = y; + } + else if (y > polygonBoundingBox.height) { + polygonBoundingBox.height = y; + } + } + } + polygonBoundingBox.width -= polygonBoundingBox.x; + polygonBoundingBox.height -= polygonBoundingBox.y; + } + else { + console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug."); + } + return polygonBoundingBox; + }; + ObjectDataParser.prototype._parseAnimation = function (rawData) { + var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData); + animation.blendType = dragonBones.DataParser._getAnimationBlendType(ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, "")); + animation.frameCount = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0); + animation.playTimes = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1); + animation.duration = animation.frameCount / this._armature.frameRate; // float + animation.fadeInTime = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0); + animation.scale = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0); + animation.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (animation.name.length === 0) { + animation.name = dragonBones.DataParser.DEFAULT_NAME; + } + animation.frameIntOffset = this._frameIntArray.length; + animation.frameFloatOffset = this._frameFloatArray.length; + animation.frameOffset = this._frameArray.length; + this._animation = animation; + if (dragonBones.DataParser.FRAME in rawData) { + var rawFrames = rawData[dragonBones.DataParser.FRAME]; + var keyFrameCount = rawFrames.length; + if (keyFrameCount > 0) { + for (var i = 0, frameStart = 0; i < keyFrameCount; ++i) { + var rawFrame = rawFrames[i]; + this._parseActionDataInFrame(rawFrame, frameStart, null, null); + frameStart += ObjectDataParser._getNumber(rawFrame, dragonBones.DataParser.DURATION, 1); + } + } + } + if (dragonBones.DataParser.Z_ORDER in rawData) { + this._animation.zOrderTimeline = this._parseTimeline(rawData[dragonBones.DataParser.Z_ORDER], null, dragonBones.DataParser.FRAME, 1 /* ZOrder */, 0 /* Step */, 0, this._parseZOrderFrame); + } + if (dragonBones.DataParser.BONE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.BONE]; + for (var _i = 0, rawTimelines_1 = rawTimelines; _i < rawTimelines_1.length; _i++) { + var rawTimeline = rawTimelines_1[_i]; + this._parseBoneTimeline(rawTimeline); + } + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.SLOT]; + for (var _a = 0, rawTimelines_2 = rawTimelines; _a < rawTimelines_2.length; _a++) { + var rawTimeline = rawTimelines_2[_a]; + this._parseSlotTimeline(rawTimeline); + } + } + if (dragonBones.DataParser.FFD in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.FFD]; + for (var _b = 0, rawTimelines_3 = rawTimelines; _b < rawTimelines_3.length; _b++) { + var rawTimeline = rawTimelines_3[_b]; + var skinName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SKIN, dragonBones.DataParser.DEFAULT_NAME); + var slotName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.SLOT, ""); + var displayName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + if (skinName.length === 0) { // + skinName = dragonBones.DataParser.DEFAULT_NAME; + } + this._slot = this._armature.getSlot(slotName); + this._mesh = this._armature.getMesh(skinName, slotName, displayName); + if (this._slot === null || this._mesh === null) { + continue; + } + var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 22 /* SlotDeform */, 2 /* Float */, 0, this._parseSlotDeformFrame); + if (timeline !== null) { + this._animation.addSlotTimeline(slotName, timeline); + } + this._slot = null; // + this._mesh = null; // + } + } + if (dragonBones.DataParser.IK in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.IK]; + for (var _c = 0, rawTimelines_4 = rawTimelines; _c < rawTimelines_4.length; _c++) { + var rawTimeline = rawTimelines_4[_c]; + var constraintName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var constraint = this._armature.getConstraint(constraintName); + if (constraint === null) { + continue; + } + var timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, 30 /* IKConstraint */, 1 /* Int */, 2, this._parseIKConstraintFrame); + if (timeline !== null) { + this._animation.addConstraintTimeline(constraintName, timeline); + } + } + } + if (this._actionFrames.length > 0) { + this._animation.actionTimeline = this._parseTimeline(null, this._actionFrames, "", 0 /* Action */, 0 /* Step */, 0, this._parseActionFrame); + this._actionFrames.length = 0; + } + if (dragonBones.DataParser.TIMELINE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.TIMELINE]; + for (var _d = 0, rawTimelines_5 = rawTimelines; _d < rawTimelines_5.length; _d++) { + var rawTimeline = rawTimelines_5[_d]; + var timelineType = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */); + var timelineName = ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var timeline = null; + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 20 /* SlotDisplay */: // TODO + case 23 /* SlotZIndex */: + case 60 /* BoneAlpha */: + case 24 /* SlotAlpha */: + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + if (timelineType === 20 /* SlotDisplay */) { + this._frameValueType = 0 /* Step */; + this._frameValueScale = 1.0; + } + else { + this._frameValueType = 1 /* Int */; + if (timelineType === 23 /* SlotZIndex */) { + this._frameValueScale = 1.0; + } + else if (timelineType === 40 /* AnimationProgress */ || + timelineType === 41 /* AnimationWeight */) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + if (timelineType === 60 /* BoneAlpha */ || + timelineType === 24 /* SlotAlpha */ || + timelineType === 41 /* AnimationWeight */) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData); + var animaitonTimeline = timeline; + animaitonTimeline.x = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0); + animaitonTimeline.y = ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0); + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 1, this._parseSingleValueFrame, timeline); + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 30 /* IKConstraint */: + case 42 /* AnimationParameter */: + if (timelineType === 30 /* IKConstraint */ || + timelineType === 42 /* AnimationParameter */) { + this._frameValueType = 1 /* Int */; + if (timelineType === 42 /* AnimationParameter */) { + this._frameValueScale = 10000.0; + } + else { + this._frameValueScale = 100.0; + } + } + else { + if (timelineType === 12 /* BoneRotate */) { + this._frameValueScale = dragonBones.Transform.DEG_RAD; + } + else { + this._frameValueScale = 1.0; + } + this._frameValueType = 2 /* Float */; + } + if (timelineType === 13 /* BoneScale */ || + timelineType === 30 /* IKConstraint */) { + this._frameDefaultValue = 1.0; + } + else { + this._frameDefaultValue = 0.0; + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, this._frameValueType, 2, this._parseDoubleValueFrame); + break; + case 1 /* ZOrder */: + // TODO + break; + case 50 /* Surface */: { + var surface = this._armature.getBone(timelineName); + if (surface === null) { + continue; + } + this._geometry = surface.geometry; + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame); + this._geometry = null; // + break; + } + case 22 /* SlotDeform */: { + this._geometry = null; // + for (var skinName in this._armature.skins) { + var skin = this._armature.skins[skinName]; + for (var slontName in skin.displays) { + var displays = skin.displays[slontName]; + for (var _e = 0, displays_1 = displays; _e < displays_1.length; _e++) { + var display = displays_1[_e]; + if (display !== null && display.name === timelineName) { + this._geometry = display.geometry; + break; + } + } + } + } + if (this._geometry === null) { + continue; + } + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 2 /* Float */, 0, this._parseDeformFrame); + this._geometry = null; // + break; + } + case 21 /* SlotColor */: + timeline = this._parseTimeline(rawTimeline, null, dragonBones.DataParser.FRAME, timelineType, 1 /* Int */, 1, this._parseSlotColorFrame); + break; + } + if (timeline !== null) { + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 1 /* ZOrder */: + // TODO + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 50 /* Surface */: + case 60 /* BoneAlpha */: + this._animation.addBoneTimeline(timelineName, timeline); + break; + case 20 /* SlotDisplay */: + case 21 /* SlotColor */: + case 22 /* SlotDeform */: + case 23 /* SlotZIndex */: + case 24 /* SlotAlpha */: + this._animation.addSlotTimeline(timelineName, timeline); + break; + case 30 /* IKConstraint */: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + case 42 /* AnimationParameter */: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null; // + return animation; + }; + ObjectDataParser.prototype._parseTimeline = function (rawData, rawFrames, framesKey, timelineType, frameValueType, frameValueCount, frameParser, timeline) { + if (timeline === void 0) { timeline = null; } + if (rawData !== null && framesKey.length > 0 && framesKey in rawData) { + rawFrames = rawData[framesKey]; + } + if (rawFrames === null) { + return null; + } + var keyFrameCount = rawFrames.length; + if (keyFrameCount === 0) { + return null; + } + var frameIntArrayLength = this._frameIntArray.length; + var frameFloatArrayLength = this._frameFloatArray.length; + var timelineOffset = this._timelineArray.length; + if (timeline === null) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.TimelineData); + } + timeline.type = timelineType; + timeline.offset = timelineOffset; + this._frameValueType = frameValueType; + this._timeline = timeline; + this._timelineArray.length += 1 + 1 + 1 + 1 + 1 + keyFrameCount; + if (rawData !== null) { + this._timelineArray[timelineOffset + 0 /* TimelineScale */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0) * 100); + this._timelineArray[timelineOffset + 1 /* TimelineOffset */] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0.0) * 100); + } + else { + this._timelineArray[timelineOffset + 0 /* TimelineScale */] = 100; + this._timelineArray[timelineOffset + 1 /* TimelineOffset */] = 0; + } + this._timelineArray[timelineOffset + 2 /* TimelineKeyFrameCount */] = keyFrameCount; + this._timelineArray[timelineOffset + 3 /* TimelineFrameValueCount */] = frameValueCount; + switch (this._frameValueType) { + case 0 /* Step */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = 0; + break; + case 1 /* Int */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameIntArrayLength - this._animation.frameIntOffset; + break; + case 2 /* Float */: + this._timelineArray[timelineOffset + 4 /* TimelineFrameValueOffset */] = frameFloatArrayLength - this._animation.frameFloatOffset; + break; + } + if (keyFrameCount === 1) { // Only one frame. + timeline.frameIndicesOffset = -1; + this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + 0] = frameParser.call(this, rawFrames[0], 0, 0) - this._animation.frameOffset; + } + else { + var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. + var frameIndices = this._data.frameIndices; + var frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; + timeline.frameIndicesOffset = frameIndicesOffset; + for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) { + if (frameStart + frameCount <= i && iK < keyFrameCount) { + var rawFrame = rawFrames[iK]; + frameStart = i; // frame.frameStart; + if (iK === keyFrameCount - 1) { + frameCount = this._animation.frameCount - frameStart; + } + else { + if (rawFrame instanceof ActionFrame) { + frameCount = this._actionFrames[iK + 1].frameStart - frameStart; + } + else { + frameCount = ObjectDataParser._getNumber(rawFrame, dragonBones.DataParser.DURATION, 1); + } + } + this._timelineArray[timelineOffset + 5 /* TimelineFrameOffset */ + iK] = frameParser.call(this, rawFrame, frameStart, frameCount) - this._animation.frameOffset; + iK++; + } + frameIndices[frameIndicesOffset + i] = iK - 1; + } + } + this._timeline = null; // + return timeline; + }; + ObjectDataParser.prototype._parseBoneTimeline = function (rawData) { + var bone = this._armature.getBone(ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "")); + if (bone === null) { + return; + } + this._bone = bone; + this._slot = this._armature.getSlot(this._bone.name); + if (dragonBones.DataParser.TRANSLATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.TRANSLATE_FRAME, 11 /* BoneTranslate */, 2 /* Float */, 2, this._parseDoubleValueFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.ROTATE_FRAME in rawData) { + this._frameDefaultValue = 0.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.ROTATE_FRAME, 12 /* BoneRotate */, 2 /* Float */, 2, this._parseBoneRotateFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.SCALE_FRAME in rawData) { + this._frameDefaultValue = 1.0; + this._frameValueScale = 1.0; + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.SCALE_FRAME, 13 /* BoneScale */, 2 /* Float */, 2, this._parseBoneScaleFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + if (dragonBones.DataParser.FRAME in rawData) { + var timeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 10 /* BoneAll */, 2 /* Float */, 6, this._parseBoneAllFrame); + if (timeline !== null) { + this._animation.addBoneTimeline(bone.name, timeline); + } + } + this._bone = null; // + this._slot = null; // + }; + ObjectDataParser.prototype._parseSlotTimeline = function (rawData) { + var slot = this._armature.getSlot(ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, "")); + if (slot === null) { + return; + } + var displayTimeline = null; + var colorTimeline = null; + this._slot = slot; + if (dragonBones.DataParser.DISPLAY_FRAME in rawData) { + displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.DISPLAY_FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame); + } + else { + displayTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 20 /* SlotDisplay */, 0 /* Step */, 0, this._parseSlotDisplayFrame); + } + if (dragonBones.DataParser.COLOR_FRAME in rawData) { + colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.COLOR_FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame); + } + else { + colorTimeline = this._parseTimeline(rawData, null, dragonBones.DataParser.FRAME, 21 /* SlotColor */, 1 /* Int */, 1, this._parseSlotColorFrame); + } + if (displayTimeline !== null) { + this._animation.addSlotTimeline(slot.name, displayTimeline); + } + if (colorTimeline !== null) { + this._animation.addSlotTimeline(slot.name, colorTimeline); + } + this._slot = null; // + }; + ObjectDataParser.prototype._parseFrame = function (rawData, frameStart, frameCount) { + // tslint:disable-next-line:no-unused-expression + rawData; + // tslint:disable-next-line:no-unused-expression + frameCount; + var frameOffset = this._frameArray.length; + this._frameArray.length += 1; + this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart; + return frameOffset; + }; + ObjectDataParser.prototype._parseTweenFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + if (frameCount > 0) { + if (dragonBones.DataParser.CURVE in rawData) { + var sampleCount = frameCount + 1; + this._helpArray.length = sampleCount; + var isOmited = this._samplingEasingCurve(rawData[dragonBones.DataParser.CURVE], this._helpArray); + this._frameArray.length += 1 + 1 + this._helpArray.length; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 2 /* Curve */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = isOmited ? sampleCount : -sampleCount; + for (var i = 0; i < sampleCount; ++i) { + this._frameArray[frameOffset + 3 /* FrameCurveSamples */ + i] = Math.round(this._helpArray[i] * 10000.0); + } + } + else { + var noTween = -2.0; + var tweenEasing = noTween; + if (dragonBones.DataParser.TWEEN_EASING in rawData) { + tweenEasing = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TWEEN_EASING, noTween); + } + if (tweenEasing === noTween) { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 0 /* None */; + } + else if (tweenEasing === 0.0) { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 1 /* Line */; + } + else if (tweenEasing < 0.0) { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 3 /* QuadIn */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(-tweenEasing * 100.0); + } + else if (tweenEasing <= 1.0) { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 4 /* QuadOut */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(tweenEasing * 100.0); + } + else { + this._frameArray.length += 1 + 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 5 /* QuadInOut */; + this._frameArray[frameOffset + 2 /* FrameTweenEasingOrCurveSampleCount */] = Math.round(tweenEasing * 100.0 - 100.0); + } + } + } + else { + this._frameArray.length += 1; + this._frameArray[frameOffset + 1 /* FrameTweenType */] = 0 /* None */; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseSingleValueFrame = function (rawData, frameStart, frameCount) { + var frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue); + break; + } + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale); + break; + } + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 1; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + return frameOffset; + }; + ObjectDataParser.prototype._parseDoubleValueFrame = function (rawData, frameStart, frameCount) { + var frameOffset = 0; + switch (this._frameValueType) { + case 0: { + frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 2; + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue); + this._frameArray[frameOffset + 2] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue); + break; + } + case 1: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameValueOffset] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale); + this._frameIntArray[frameValueOffset + 1] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale); + break; + } + case 2: { + frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameValueOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameValueOffset] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, this._frameDefaultValue) * this._frameValueScale; + this._frameFloatArray[frameValueOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, this._frameDefaultValue) * this._frameValueScale; + break; + } + } + return frameOffset; + }; + ObjectDataParser.prototype._parseActionFrame = function (frame, frameStart, frameCount) { + // tslint:disable-next-line:no-unused-expression + frameCount; + var frameOffset = this._frameArray.length; + var actionCount = frame.actions.length; + this._frameArray.length += 1 + 1 + actionCount; + this._frameArray[frameOffset + 0 /* FramePosition */] = frameStart; + this._frameArray[frameOffset + 0 /* FramePosition */ + 1] = actionCount; // Action count. + for (var i = 0; i < actionCount; ++i) { // Action offsets. + this._frameArray[frameOffset + 0 /* FramePosition */ + 2 + i] = frame.actions[i]; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseZOrderFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + if (dragonBones.DataParser.Z_ORDER in rawData) { + var rawZOrder = rawData[dragonBones.DataParser.Z_ORDER]; + if (rawZOrder.length > 0) { + var slotCount = this._armature.sortedSlots.length; + var unchanged = new Array(slotCount - rawZOrder.length / 2); + var zOrders = new Array(slotCount); + for (var i_1 = 0; i_1 < unchanged.length; ++i_1) { + unchanged[i_1] = 0; + } + for (var i_2 = 0; i_2 < slotCount; ++i_2) { + zOrders[i_2] = -1; + } + var originalIndex = 0; + var unchangedIndex = 0; + for (var i_3 = 0, l = rawZOrder.length; i_3 < l; i_3 += 2) { + var slotIndex = rawZOrder[i_3]; + var zOrderOffset = rawZOrder[i_3 + 1]; + while (originalIndex !== slotIndex) { + unchanged[unchangedIndex++] = originalIndex++; + } + var index = originalIndex + zOrderOffset; + zOrders[index] = originalIndex++; + } + while (originalIndex < slotCount) { + unchanged[unchangedIndex++] = originalIndex++; + } + this._frameArray.length += 1 + slotCount; + this._frameArray[frameOffset + 1] = slotCount; + var i = slotCount; + while (i--) { + if (zOrders[i] === -1) { + this._frameArray[frameOffset + 2 + i] = unchanged[--unchangedIndex] || 0; + } + else { + this._frameArray[frameOffset + 2 + i] = zOrders[i] || 0; + } + } + return frameOffset; + } + } + this._frameArray.length += 1; + this._frameArray[frameOffset + 1] = 0; + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneAllFrame = function (rawData, frameStart, frameCount) { + this._helpTransform.identity(); + if (dragonBones.DataParser.TRANSFORM in rawData) { + this._parseTransform(rawData[dragonBones.DataParser.TRANSFORM], this._helpTransform, 1.0); + } + // Modify rotation. + var rotation = this._helpTransform.rotation; + if (frameStart !== 0) { + if (this._prevClockwise === 0) { + rotation = this._prevRotation + dragonBones.Transform.normalizeRadian(rotation - this._prevRotation); + } + else { + if (this._prevClockwise > 0 ? rotation >= this._prevRotation : rotation <= this._prevRotation) { + this._prevClockwise = this._prevClockwise > 0 ? this._prevClockwise - 1 : this._prevClockwise + 1; + } + rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise; + } + } + this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.TWEEN_ROTATE, 0.0); + this._prevRotation = rotation; + // + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 6; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.x; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.y; + this._frameFloatArray[frameFloatOffset++] = rotation; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.skew; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleX; + this._frameFloatArray[frameFloatOffset++] = this._helpTransform.scaleY; + this._parseActionDataInFrame(rawData, frameStart, this._bone, this._slot); + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneTranslateFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0); + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneRotateFrame = function (rawData, frameStart, frameCount) { + // Modify rotation. + var rotation = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE, 0.0) * dragonBones.Transform.DEG_RAD; + if (frameStart !== 0) { + if (this._prevClockwise === 0) { + rotation = this._prevRotation + dragonBones.Transform.normalizeRadian(rotation - this._prevRotation); + } + else { + if (this._prevClockwise > 0 ? rotation >= this._prevRotation : rotation <= this._prevRotation) { + this._prevClockwise = this._prevClockwise > 0 ? this._prevClockwise - 1 : this._prevClockwise + 1; + } + rotation = this._prevRotation + rotation - this._prevRotation + dragonBones.Transform.PI_D * this._prevClockwise; + } + } + this._prevClockwise = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.CLOCK_WISE, 0); + this._prevRotation = rotation; + // + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = rotation; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD; + return frameOffset; + }; + ObjectDataParser.prototype._parseBoneScaleFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameFloatOffset = this._frameFloatArray.length; + this._frameFloatArray.length += 2; + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 1.0); + this._frameFloatArray[frameFloatOffset++] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 1.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotDisplayFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseFrame(rawData, frameStart, frameCount); + this._frameArray.length += 1; + if (dragonBones.DataParser.VALUE in rawData) { + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.VALUE, 0); + } + else { + this._frameArray[frameOffset + 1] = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DISPLAY_INDEX, 0); + } + this._parseActionDataInFrame(rawData, frameStart, this._slot.parent, this._slot); + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotColorFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var colorOffset = -1; + if (dragonBones.DataParser.VALUE in rawData || dragonBones.DataParser.COLOR in rawData) { + var rawColor = dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : rawData[dragonBones.DataParser.COLOR]; + for (var k in rawColor) { // Detects the presence of color. + // tslint:disable-next-line:no-unused-expression + k; + this._parseColorTransform(rawColor, this._helpColorTransform); + colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueMultiplier * 100); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.alphaOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.redOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.greenOffset); + this._colorArray[colorOffset++] = Math.round(this._helpColorTransform.blueOffset); + colorOffset -= 8; + break; + } + } + if (colorOffset < 0) { + if (this._defaultColorOffset < 0) { + this._defaultColorOffset = colorOffset = this._colorArray.length; + this._colorArray.length += 8; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 100; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + this._colorArray[colorOffset++] = 0; + } + colorOffset = this._defaultColorOffset; + } + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1; + this._frameIntArray[frameIntOffset] = colorOffset; + return frameOffset; + }; + ObjectDataParser.prototype._parseSlotDeformFrame = function (rawData, frameStart, frameCount) { + var frameFloatOffset = this._frameFloatArray.length; + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var rawVertices = dragonBones.DataParser.VERTICES in rawData ? rawData[dragonBones.DataParser.VERTICES] : null; + var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint + var vertexCount = this._intArray[this._mesh.geometry.offset + 0 /* GeometryVertexCount */]; + var meshName = this._mesh.parent.name + "_" + this._slot.name + "_" + this._mesh.name; + var weight = this._mesh.geometry.weight; + var x = 0.0; + var y = 0.0; + var iB = 0; + var iV = 0; + if (weight !== null) { + var rawSlotPose = this._weightSlotPose[meshName]; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + this._frameFloatArray.length += weight.count * 2; + iB = weight.offset + 2 /* WeigthBoneIndices */ + weight.bones.length; + } + else { + this._frameFloatArray.length += vertexCount * 2; + } + for (var i = 0; i < vertexCount * 2; i += 2) { + if (rawVertices === null) { // Fill 0. + x = 0.0; + y = 0.0; + } + else { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + if (weight !== null) { // If mesh is skinned, transform point by bone bind pose. + var rawBonePoses = this._weightBonePoses[meshName]; + var vertexBoneCount = this._intArray[iB++]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint, true); + x = this._helpPoint.x; + y = this._helpPoint.y; + for (var j = 0; j < vertexBoneCount; ++j) { + var boneIndex = this._intArray[iB++]; + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint, true); + this._frameFloatArray[frameFloatOffset + iV++] = this._helpPoint.x; + this._frameFloatArray[frameFloatOffset + iV++] = this._helpPoint.y; + } + } + else { + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + if (frameStart === 0) { + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._mesh.geometry.offset; + this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0; + this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseIKConstraintFrame = function (rawData, frameStart, frameCount) { + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 2; + this._frameIntArray[frameIntOffset++] = ObjectDataParser._getBoolean(rawData, dragonBones.DataParser.BEND_POSITIVE, true) ? 1 : 0; + this._frameIntArray[frameIntOffset++] = Math.round(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WEIGHT, 1.0) * 100.0); + return frameOffset; + }; + ObjectDataParser.prototype._parseActionData = function (rawData, type, bone, slot) { + var actions = new Array(); + if (typeof rawData === "string") { + var action = dragonBones.BaseObject.borrowObject(dragonBones.ActionData); + action.type = type; + action.name = rawData; + action.bone = bone; + action.slot = slot; + actions.push(action); + } + else if (rawData instanceof Array) { + for (var _i = 0, rawData_2 = rawData; _i < rawData_2.length; _i++) { + var rawAction = rawData_2[_i]; + var action = dragonBones.BaseObject.borrowObject(dragonBones.ActionData); + if (dragonBones.DataParser.GOTO_AND_PLAY in rawAction) { + action.type = 0 /* Play */; + action.name = ObjectDataParser._getString(rawAction, dragonBones.DataParser.GOTO_AND_PLAY, ""); + } + else { + if (dragonBones.DataParser.TYPE in rawAction && typeof rawAction[dragonBones.DataParser.TYPE] === "string") { + action.type = dragonBones.DataParser._getActionType(rawAction[dragonBones.DataParser.TYPE]); + } + else { + action.type = ObjectDataParser._getNumber(rawAction, dragonBones.DataParser.TYPE, type); + } + action.name = ObjectDataParser._getString(rawAction, dragonBones.DataParser.NAME, ""); + } + if (dragonBones.DataParser.BONE in rawAction) { + var boneName = ObjectDataParser._getString(rawAction, dragonBones.DataParser.BONE, ""); + action.bone = this._armature.getBone(boneName); + } + else { + action.bone = bone; + } + if (dragonBones.DataParser.SLOT in rawAction) { + var slotName = ObjectDataParser._getString(rawAction, dragonBones.DataParser.SLOT, ""); + action.slot = this._armature.getSlot(slotName); + } + else { + action.slot = slot; + } + var userData = null; + if (dragonBones.DataParser.INTS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawInts = rawAction[dragonBones.DataParser.INTS]; + for (var _a = 0, rawInts_1 = rawInts; _a < rawInts_1.length; _a++) { + var rawValue = rawInts_1[_a]; + userData.addInt(rawValue); + } + } + if (dragonBones.DataParser.FLOATS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawFloats = rawAction[dragonBones.DataParser.FLOATS]; + for (var _b = 0, rawFloats_1 = rawFloats; _b < rawFloats_1.length; _b++) { + var rawValue = rawFloats_1[_b]; + userData.addFloat(rawValue); + } + } + if (dragonBones.DataParser.STRINGS in rawAction) { + if (userData === null) { + userData = dragonBones.BaseObject.borrowObject(dragonBones.UserData); + } + var rawStrings = rawAction[dragonBones.DataParser.STRINGS]; + for (var _c = 0, rawStrings_1 = rawStrings; _c < rawStrings_1.length; _c++) { + var rawValue = rawStrings_1[_c]; + userData.addString(rawValue); + } + } + action.data = userData; + actions.push(action); + } + } + return actions; + }; + ObjectDataParser.prototype._parseDeformFrame = function (rawData, frameStart, frameCount) { + var frameFloatOffset = this._frameFloatArray.length; + var frameOffset = this._parseTweenFrame(rawData, frameStart, frameCount); + var rawVertices = dragonBones.DataParser.VERTICES in rawData ? + rawData[dragonBones.DataParser.VERTICES] : + (dragonBones.DataParser.VALUE in rawData ? rawData[dragonBones.DataParser.VALUE] : null); + var offset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.OFFSET, 0); // uint + var vertexCount = this._intArray[this._geometry.offset + 0 /* GeometryVertexCount */]; + var weight = this._geometry.weight; + var x = 0.0; + var y = 0.0; + if (weight !== null) { + // TODO + } + else { + this._frameFloatArray.length += vertexCount * 2; + for (var i = 0; i < vertexCount * 2; i += 2) { + if (rawVertices !== null) { + if (i < offset || i - offset >= rawVertices.length) { + x = 0.0; + } + else { + x = rawVertices[i - offset]; + } + if (i + 1 < offset || i + 1 - offset >= rawVertices.length) { + y = 0.0; + } + else { + y = rawVertices[i + 1 - offset]; + } + } + else { + x = 0.0; + y = 0.0; + } + this._frameFloatArray[frameFloatOffset + i] = x; + this._frameFloatArray[frameFloatOffset + i + 1] = y; + } + } + if (frameStart === 0) { + var frameIntOffset = this._frameIntArray.length; + this._frameIntArray.length += 1 + 1 + 1 + 1 + 1; + this._frameIntArray[frameIntOffset + 0 /* DeformVertexOffset */] = this._geometry.offset; + this._frameIntArray[frameIntOffset + 1 /* DeformCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 2 /* DeformValueCount */] = this._frameFloatArray.length - frameFloatOffset; + this._frameIntArray[frameIntOffset + 3 /* DeformValueOffset */] = 0; + this._frameIntArray[frameIntOffset + 4 /* DeformFloatOffset */] = frameFloatOffset - this._animation.frameFloatOffset; + this._timelineArray[this._timeline.offset + 3 /* TimelineFrameValueCount */] = frameIntOffset - this._animation.frameIntOffset; + } + return frameOffset; + }; + ObjectDataParser.prototype._parseTransform = function (rawData, transform, scale) { + transform.x = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.X, 0.0) * scale; + transform.y = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.Y, 0.0) * scale; + if (dragonBones.DataParser.ROTATE in rawData || dragonBones.DataParser.SKEW in rawData) { + transform.rotation = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ROTATE, 0.0) * dragonBones.Transform.DEG_RAD); + transform.skew = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW, 0.0) * dragonBones.Transform.DEG_RAD); + } + else if (dragonBones.DataParser.SKEW_X in rawData || dragonBones.DataParser.SKEW_Y in rawData) { + transform.rotation = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW_Y, 0.0) * dragonBones.Transform.DEG_RAD); + transform.skew = dragonBones.Transform.normalizeRadian(ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SKEW_X, 0.0) * dragonBones.Transform.DEG_RAD) - transform.rotation; + } + transform.scaleX = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE_X, 1.0); + transform.scaleY = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE_Y, 1.0); + }; + ObjectDataParser.prototype._parseColorTransform = function (rawData, color) { + color.alphaMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA_MULTIPLIER, 100) * 0.01; + color.redMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.RED_MULTIPLIER, 100) * 0.01; + color.greenMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_MULTIPLIER, 100) * 0.01; + color.blueMultiplier = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_MULTIPLIER, 100) * 0.01; + color.alphaOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.ALPHA_OFFSET, 0); + color.redOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.RED_OFFSET, 0); + color.greenOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.GREEN_OFFSET, 0); + color.blueOffset = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.BLUE_OFFSET, 0); + }; + ObjectDataParser.prototype._parseGeometry = function (rawData, geometry) { + var rawVertices = rawData[dragonBones.DataParser.VERTICES]; + var vertexCount = Math.floor(rawVertices.length / 2); // uint + var triangleCount = 0; + var geometryOffset = this._intArray.length; + var verticesOffset = this._floatArray.length; + // + geometry.offset = geometryOffset; + geometry.data = this._data; + // + this._intArray.length += 1 + 1 + 1 + 1; + this._intArray[geometryOffset + 0 /* GeometryVertexCount */] = vertexCount; + this._intArray[geometryOffset + 2 /* GeometryFloatOffset */] = verticesOffset; + this._intArray[geometryOffset + 3 /* GeometryWeightOffset */] = -1; // + // + this._floatArray.length += vertexCount * 2; + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[verticesOffset + i] = rawVertices[i]; + } + if (dragonBones.DataParser.TRIANGLES in rawData) { + var rawTriangles = rawData[dragonBones.DataParser.TRIANGLES]; + triangleCount = Math.floor(rawTriangles.length / 3); // uint + // + this._intArray.length += triangleCount * 3; + for (var i = 0, l = triangleCount * 3; i < l; ++i) { + this._intArray[geometryOffset + 4 /* GeometryVertexIndices */ + i] = rawTriangles[i]; + } + } + // Fill triangle count. + this._intArray[geometryOffset + 1 /* GeometryTriangleCount */] = triangleCount; + if (dragonBones.DataParser.UVS in rawData) { + var rawUVs = rawData[dragonBones.DataParser.UVS]; + var uvOffset = verticesOffset + vertexCount * 2; + this._floatArray.length += vertexCount * 2; + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + this._floatArray[uvOffset + i] = rawUVs[i]; + } + } + if (dragonBones.DataParser.WEIGHTS in rawData) { + var rawWeights = rawData[dragonBones.DataParser.WEIGHTS]; + var weightCount = Math.floor(rawWeights.length - vertexCount) / 2; // uint + var weightOffset = this._intArray.length; + var floatOffset = this._floatArray.length; + var weightBoneCount = 0; + var sortedBones = this._armature.sortedBones; + var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData); + weight.count = weightCount; + weight.offset = weightOffset; + this._intArray.length += 1 + 1 + weightBoneCount + vertexCount + weightCount; + this._intArray[weightOffset + 1 /* WeigthFloatOffset */] = floatOffset; + if (dragonBones.DataParser.BONE_POSE in rawData) { + var rawSlotPose = rawData[dragonBones.DataParser.SLOT_POSE]; + var rawBonePoses = rawData[dragonBones.DataParser.BONE_POSE]; + var weightBoneIndices = new Array(); + weightBoneCount = Math.floor(rawBonePoses.length / 7); // uint + weightBoneIndices.length = weightBoneCount; + for (var i = 0; i < weightBoneCount; ++i) { + var rawBoneIndex = rawBonePoses[i * 7]; // uint + var bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + weightBoneIndices[i] = rawBoneIndex; + this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone); + } + this._floatArray.length += weightCount * 3; + this._helpMatrixA.copyFromArray(rawSlotPose, 0); + for (var i = 0, iW = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iV = floatOffset; i < vertexCount; ++i) { + var iD = i * 2; + var vertexBoneCount = this._intArray[iB++] = rawWeights[iW++]; // uint + var x = this._floatArray[verticesOffset + iD]; + var y = this._floatArray[verticesOffset + iD + 1]; + this._helpMatrixA.transformPoint(x, y, this._helpPoint); + x = this._helpPoint.x; + y = this._helpPoint.y; + for (var j = 0; j < vertexBoneCount; ++j) { + var rawBoneIndex = rawWeights[iW++]; // uint + var boneIndex = weightBoneIndices.indexOf(rawBoneIndex); + this._helpMatrixB.copyFromArray(rawBonePoses, boneIndex * 7 + 1); + this._helpMatrixB.invert(); + this._helpMatrixB.transformPoint(x, y, this._helpPoint); + this._intArray[iB++] = boneIndex; + this._floatArray[iV++] = rawWeights[iW++]; + this._floatArray[iV++] = this._helpPoint.x; + this._floatArray[iV++] = this._helpPoint.y; + } + } + } + else { + var rawBones = rawData[dragonBones.DataParser.BONES]; + weightBoneCount = rawBones.length; + for (var i = 0; i < weightBoneCount; i++) { + var rawBoneIndex = rawBones[i]; + var bone = this._rawBones[rawBoneIndex]; + weight.addBone(bone); + this._intArray[weightOffset + 2 /* WeigthBoneIndices */ + i] = sortedBones.indexOf(bone); + } + this._floatArray.length += weightCount * 3; + for (var i = 0, iW = 0, iV = 0, iB = weightOffset + 2 /* WeigthBoneIndices */ + weightBoneCount, iF = floatOffset; i < weightCount; i++) { + var vertexBoneCount = rawWeights[iW++]; + this._intArray[iB++] = vertexBoneCount; + for (var j = 0; j < vertexBoneCount; j++) { + var boneIndex = rawWeights[iW++]; + var boneWeight = rawWeights[iW++]; + var x = rawVertices[iV++]; + var y = rawVertices[iV++]; + this._intArray[iB++] = rawBones.indexOf(boneIndex); + this._floatArray[iF++] = boneWeight; + this._floatArray[iF++] = x; + this._floatArray[iF++] = y; + } + } + } + geometry.weight = weight; + } + }; + ObjectDataParser.prototype._parseArray = function (rawData) { + // tslint:disable-next-line:no-unused-expression + rawData; + this._intArray.length = 0; + this._floatArray.length = 0; + this._frameIntArray.length = 0; + this._frameFloatArray.length = 0; + this._frameArray.length = 0; + this._timelineArray.length = 0; + this._colorArray.length = 0; + }; + ObjectDataParser.prototype._modifyArray = function () { + // Align. + if ((this._intArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._intArray.push(0); + } + if ((this._frameIntArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._frameIntArray.push(0); + } + if ((this._frameArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._frameArray.push(0); + } + if ((this._timelineArray.length % Uint16Array.BYTES_PER_ELEMENT) !== 0) { + this._timelineArray.push(0); + } + if ((this._timelineArray.length % Int16Array.BYTES_PER_ELEMENT) !== 0) { + this._colorArray.push(0); + } + var l1 = this._intArray.length * Int16Array.BYTES_PER_ELEMENT; + var l2 = this._floatArray.length * Float32Array.BYTES_PER_ELEMENT; + var l3 = this._frameIntArray.length * Int16Array.BYTES_PER_ELEMENT; + var l4 = this._frameFloatArray.length * Float32Array.BYTES_PER_ELEMENT; + var l5 = this._frameArray.length * Int16Array.BYTES_PER_ELEMENT; + var l6 = this._timelineArray.length * Uint16Array.BYTES_PER_ELEMENT; + var l7 = this._colorArray.length * Int16Array.BYTES_PER_ELEMENT; + var lTotal = l1 + l2 + l3 + l4 + l5 + l6 + l7; + // + var binary = new ArrayBuffer(lTotal); + var intArray = new Int16Array(binary, 0, this._intArray.length); + var floatArray = new Float32Array(binary, l1, this._floatArray.length); + var frameIntArray = new Int16Array(binary, l1 + l2, this._frameIntArray.length); + var frameFloatArray = new Float32Array(binary, l1 + l2 + l3, this._frameFloatArray.length); + var frameArray = new Int16Array(binary, l1 + l2 + l3 + l4, this._frameArray.length); + var timelineArray = new Uint16Array(binary, l1 + l2 + l3 + l4 + l5, this._timelineArray.length); + var colorArray = new Int16Array(binary, l1 + l2 + l3 + l4 + l5 + l6, this._colorArray.length); + for (var i = 0, l = this._intArray.length; i < l; ++i) { + intArray[i] = this._intArray[i]; + } + for (var i = 0, l = this._floatArray.length; i < l; ++i) { + floatArray[i] = this._floatArray[i]; + } + for (var i = 0, l = this._frameIntArray.length; i < l; ++i) { + frameIntArray[i] = this._frameIntArray[i]; + } + for (var i = 0, l = this._frameFloatArray.length; i < l; ++i) { + frameFloatArray[i] = this._frameFloatArray[i]; + } + for (var i = 0, l = this._frameArray.length; i < l; ++i) { + frameArray[i] = this._frameArray[i]; + } + for (var i = 0, l = this._timelineArray.length; i < l; ++i) { + timelineArray[i] = this._timelineArray[i]; + } + for (var i = 0, l = this._colorArray.length; i < l; ++i) { + colorArray[i] = this._colorArray[i]; + } + this._data.binary = binary; + this._data.intArray = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = frameArray; + this._data.timelineArray = timelineArray; + this._data.colorArray = colorArray; + this._defaultColorOffset = -1; + }; + ObjectDataParser.prototype.parseDragonBonesData = function (rawData, scale) { + if (scale === void 0) { scale = 1; } + console.assert(rawData !== null && rawData !== undefined, "Data error."); + var version = ObjectDataParser._getString(rawData, dragonBones.DataParser.VERSION, ""); + var compatibleVersion = ObjectDataParser._getString(rawData, dragonBones.DataParser.COMPATIBLE_VERSION, ""); + if (dragonBones.DataParser.DATA_VERSIONS.indexOf(version) >= 0 || + dragonBones.DataParser.DATA_VERSIONS.indexOf(compatibleVersion) >= 0) { + var data = dragonBones.BaseObject.borrowObject(dragonBones.DragonBonesData); + data.version = version; + data.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + data.frameRate = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FRAME_RATE, 24); + if (data.frameRate === 0) { // Data error. + data.frameRate = 24; + } + if (dragonBones.DataParser.ARMATURE in rawData) { + this._data = data; + this._parseArray(rawData); + var rawArmatures = rawData[dragonBones.DataParser.ARMATURE]; + for (var _i = 0, rawArmatures_1 = rawArmatures; _i < rawArmatures_1.length; _i++) { + var rawArmature = rawArmatures_1[_i]; + data.addArmature(this._parseArmature(rawArmature, scale)); + } + if (!this._data.binary) { // DragonBones.webAssembly ? 0 : null; + this._modifyArray(); + } + if (dragonBones.DataParser.STAGE in rawData) { + data.stage = data.getArmature(ObjectDataParser._getString(rawData, dragonBones.DataParser.STAGE, "")); + } + else if (data.armatureNames.length > 0) { + data.stage = data.getArmature(data.armatureNames[0]); + } + this._data = null; + } + if (dragonBones.DataParser.TEXTURE_ATLAS in rawData) { + this._rawTextureAtlases = rawData[dragonBones.DataParser.TEXTURE_ATLAS]; + } + return data; + } + else { + console.assert(false, "Nonsupport data version: " + version + "\n" + + "Please convert DragonBones data to support version.\n" + + "Read more: https://github.com/DragonBones/Tools/"); + } + return null; + }; + ObjectDataParser.prototype.parseTextureAtlasData = function (rawData, textureAtlasData, scale) { + if (scale === void 0) { scale = 1.0; } + console.assert(rawData !== undefined); + if (rawData === null) { + if (this._rawTextureAtlases === null || this._rawTextureAtlases.length === 0) { + return false; + } + var rawTextureAtlas = this._rawTextureAtlases[this._rawTextureAtlasIndex++]; + this.parseTextureAtlasData(rawTextureAtlas, textureAtlasData, scale); + if (this._rawTextureAtlasIndex >= this._rawTextureAtlases.length) { + this._rawTextureAtlasIndex = 0; + this._rawTextureAtlases = null; + } + return true; + } + // Texture format. + textureAtlasData.width = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.WIDTH, 0); + textureAtlasData.height = ObjectDataParser._getNumber(rawData, dragonBones.DataParser.HEIGHT, 0); + textureAtlasData.scale = scale === 1.0 ? (1.0 / ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0)) : scale; + textureAtlasData.name = ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, ""); + textureAtlasData.imagePath = ObjectDataParser._getString(rawData, dragonBones.DataParser.IMAGE_PATH, ""); + if (dragonBones.DataParser.SUB_TEXTURE in rawData) { + var rawTextures = rawData[dragonBones.DataParser.SUB_TEXTURE]; + for (var i = 0, l = rawTextures.length; i < l; ++i) { + var rawTexture = rawTextures[i]; + var frameWidth = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_WIDTH, -1.0); + var frameHeight = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_HEIGHT, -1.0); + var textureData = textureAtlasData.createTexture(); + textureData.rotated = ObjectDataParser._getBoolean(rawTexture, dragonBones.DataParser.ROTATED, false); + textureData.name = ObjectDataParser._getString(rawTexture, dragonBones.DataParser.NAME, ""); + textureData.region.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.X, 0.0); + textureData.region.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.Y, 0.0); + textureData.region.width = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.WIDTH, 0.0); + textureData.region.height = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.HEIGHT, 0.0); + if (frameWidth > 0.0 && frameHeight > 0.0) { + textureData.frame = dragonBones.TextureData.createRectangle(); + textureData.frame.x = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_X, 0.0); + textureData.frame.y = ObjectDataParser._getNumber(rawTexture, dragonBones.DataParser.FRAME_Y, 0.0); + textureData.frame.width = frameWidth; + textureData.frame.height = frameHeight; + } + textureAtlasData.addTexture(textureData); + } + } + return true; + }; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + ObjectDataParser.getInstance = function () { + if (ObjectDataParser._objectDataParserInstance === null) { + ObjectDataParser._objectDataParserInstance = new ObjectDataParser(); + } + return ObjectDataParser._objectDataParserInstance; + }; + ObjectDataParser._objectDataParserInstance = null; + return ObjectDataParser; + }(dragonBones.DataParser)); + dragonBones.ObjectDataParser = ObjectDataParser; + /** + * @private + */ + var ActionFrame = /** @class */ (function () { + function ActionFrame() { + this.frameStart = 0; + this.actions = []; + } + return ActionFrame; + }()); + dragonBones.ActionFrame = ActionFrame; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @private + */ + var BinaryDataParser = /** @class */ (function (_super) { + __extends(BinaryDataParser, _super); + function BinaryDataParser() { + return _super !== null && _super.apply(this, arguments) || this; + } + BinaryDataParser.prototype._inRange = function (a, min, max) { + return min <= a && a <= max; + }; + BinaryDataParser.prototype._decodeUTF8 = function (data) { + var EOF_byte = -1; + var EOF_code_point = -1; + var FATAL_POINT = 0xFFFD; + var pos = 0; + var result = ""; + var code_point; + var utf8_code_point = 0; + var utf8_bytes_needed = 0; + var utf8_bytes_seen = 0; + var utf8_lower_boundary = 0; + while (data.length > pos) { + var _byte = data[pos++]; + if (_byte === EOF_byte) { + if (utf8_bytes_needed !== 0) { + code_point = FATAL_POINT; + } + else { + code_point = EOF_code_point; + } + } + else { + if (utf8_bytes_needed === 0) { + if (this._inRange(_byte, 0x00, 0x7F)) { + code_point = _byte; + } + else { + if (this._inRange(_byte, 0xC2, 0xDF)) { + utf8_bytes_needed = 1; + utf8_lower_boundary = 0x80; + utf8_code_point = _byte - 0xC0; + } + else if (this._inRange(_byte, 0xE0, 0xEF)) { + utf8_bytes_needed = 2; + utf8_lower_boundary = 0x800; + utf8_code_point = _byte - 0xE0; + } + else if (this._inRange(_byte, 0xF0, 0xF4)) { + utf8_bytes_needed = 3; + utf8_lower_boundary = 0x10000; + utf8_code_point = _byte - 0xF0; + } + else { + } + utf8_code_point = utf8_code_point * Math.pow(64, utf8_bytes_needed); + code_point = null; + } + } + else if (!this._inRange(_byte, 0x80, 0xBF)) { + utf8_code_point = 0; + utf8_bytes_needed = 0; + utf8_bytes_seen = 0; + utf8_lower_boundary = 0; + pos--; + code_point = _byte; + } + else { + utf8_bytes_seen += 1; + utf8_code_point = utf8_code_point + (_byte - 0x80) * Math.pow(64, utf8_bytes_needed - utf8_bytes_seen); + if (utf8_bytes_seen !== utf8_bytes_needed) { + code_point = null; + } + else { + var cp = utf8_code_point; + var lower_boundary = utf8_lower_boundary; + utf8_code_point = 0; + utf8_bytes_needed = 0; + utf8_bytes_seen = 0; + utf8_lower_boundary = 0; + if (this._inRange(cp, lower_boundary, 0x10FFFF) && !this._inRange(cp, 0xD800, 0xDFFF)) { + code_point = cp; + } + else { + code_point = _byte; + } + } + } + } + //Decode string + if (code_point !== null && code_point !== EOF_code_point) { + if (code_point <= 0xFFFF) { + if (code_point > 0) + result += String.fromCharCode(code_point); + } + else { + code_point -= 0x10000; + result += String.fromCharCode(0xD800 + ((code_point >> 10) & 0x3ff)); + result += String.fromCharCode(0xDC00 + (code_point & 0x3ff)); + } + } + } + return result; + }; + BinaryDataParser.prototype._parseBinaryTimeline = function (type, offset, timelineData) { + if (timelineData === void 0) { timelineData = null; } + var timeline = timelineData !== null ? timelineData : dragonBones.BaseObject.borrowObject(dragonBones.TimelineData); + timeline.type = type; + timeline.offset = offset; + this._timeline = timeline; + var keyFrameCount = this._timelineArrayBuffer[timeline.offset + 2 /* TimelineKeyFrameCount */]; + if (keyFrameCount === 1) { + timeline.frameIndicesOffset = -1; + } + else { + var frameIndicesOffset = 0; + var totalFrameCount = this._animation.frameCount + 1; // One more frame than animation. + var frameIndices = this._data.frameIndices; + frameIndicesOffset = frameIndices.length; + frameIndices.length += totalFrameCount; + timeline.frameIndicesOffset = frameIndicesOffset; + for (var i = 0, iK = 0, frameStart = 0, frameCount = 0; i < totalFrameCount; ++i) { + if (frameStart + frameCount <= i && iK < keyFrameCount) { + frameStart = this._frameArrayBuffer[this._animation.frameOffset + this._timelineArrayBuffer[timeline.offset + 5 /* TimelineFrameOffset */ + iK]]; + if (iK === keyFrameCount - 1) { + frameCount = this._animation.frameCount - frameStart; + } + else { + frameCount = this._frameArrayBuffer[this._animation.frameOffset + this._timelineArrayBuffer[timeline.offset + 5 /* TimelineFrameOffset */ + iK + 1]] - frameStart; + } + iK++; + } + frameIndices[frameIndicesOffset + i] = iK - 1; + } + } + this._timeline = null; // + return timeline; + }; + BinaryDataParser.prototype._parseAnimation = function (rawData) { + var animation = dragonBones.BaseObject.borrowObject(dragonBones.AnimationData); + animation.blendType = dragonBones.DataParser._getAnimationBlendType(dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.BLEND_TYPE, "")); + animation.frameCount = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.DURATION, 0); + animation.playTimes = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.PLAY_TIMES, 1); + animation.duration = animation.frameCount / this._armature.frameRate; // float + animation.fadeInTime = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.FADE_IN_TIME, 0.0); + animation.scale = dragonBones.ObjectDataParser._getNumber(rawData, dragonBones.DataParser.SCALE, 1.0); + animation.name = dragonBones.ObjectDataParser._getString(rawData, dragonBones.DataParser.NAME, dragonBones.DataParser.DEFAULT_NAME); + if (animation.name.length === 0) { + animation.name = dragonBones.DataParser.DEFAULT_NAME; + } + // Offsets. + var offsets = rawData[dragonBones.DataParser.OFFSET]; + animation.frameIntOffset = offsets[0]; + animation.frameFloatOffset = offsets[1]; + animation.frameOffset = offsets[2]; + this._animation = animation; + if (dragonBones.DataParser.ACTION in rawData) { + animation.actionTimeline = this._parseBinaryTimeline(0 /* Action */, rawData[dragonBones.DataParser.ACTION]); + } + if (dragonBones.DataParser.Z_ORDER in rawData) { + animation.zOrderTimeline = this._parseBinaryTimeline(1 /* ZOrder */, rawData[dragonBones.DataParser.Z_ORDER]); + } + if (dragonBones.DataParser.BONE in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.BONE]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var bone = this._armature.getBone(k); + if (bone === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addBoneTimeline(bone.name, timeline); + } + } + } + if (dragonBones.DataParser.SLOT in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.SLOT]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var slot = this._armature.getSlot(k); + if (slot === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addSlotTimeline(slot.name, timeline); + } + } + } + if (dragonBones.DataParser.CONSTRAINT in rawData) { + var rawTimeliness = rawData[dragonBones.DataParser.CONSTRAINT]; + for (var k in rawTimeliness) { + var rawTimelines = rawTimeliness[k]; + var constraint = this._armature.getConstraint(k); + if (constraint === null) { + continue; + } + for (var i = 0, l = rawTimelines.length; i < l; i += 2) { + var timelineType = rawTimelines[i]; + var timelineOffset = rawTimelines[i + 1]; + var timeline = this._parseBinaryTimeline(timelineType, timelineOffset); + this._animation.addConstraintTimeline(constraint.name, timeline); + } + } + } + if (dragonBones.DataParser.TIMELINE in rawData) { + var rawTimelines = rawData[dragonBones.DataParser.TIMELINE]; + for (var _i = 0, rawTimelines_6 = rawTimelines; _i < rawTimelines_6.length; _i++) { + var rawTimeline = rawTimelines_6[_i]; + var timelineOffset = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.OFFSET, 0); + if (timelineOffset >= 0) { + var timelineType = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.TYPE, 0 /* Action */); + var timelineName = dragonBones.ObjectDataParser._getString(rawTimeline, dragonBones.DataParser.NAME, ""); + var timeline = null; + if (timelineType === 40 /* AnimationProgress */ && animation.blendType !== 0 /* None */) { + timeline = dragonBones.BaseObject.borrowObject(dragonBones.AnimationTimelineData); + var animaitonTimeline = timeline; + animaitonTimeline.x = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.X, 0.0); + animaitonTimeline.y = dragonBones.ObjectDataParser._getNumber(rawTimeline, dragonBones.DataParser.Y, 0.0); + } + timeline = this._parseBinaryTimeline(timelineType, timelineOffset, timeline); + switch (timelineType) { + case 0 /* Action */: + // TODO + break; + case 1 /* ZOrder */: + // TODO + break; + case 11 /* BoneTranslate */: + case 12 /* BoneRotate */: + case 13 /* BoneScale */: + case 50 /* Surface */: + case 60 /* BoneAlpha */: + this._animation.addBoneTimeline(timelineName, timeline); + break; + case 20 /* SlotDisplay */: + case 21 /* SlotColor */: + case 22 /* SlotDeform */: + case 23 /* SlotZIndex */: + case 24 /* SlotAlpha */: + this._animation.addSlotTimeline(timelineName, timeline); + break; + case 30 /* IKConstraint */: + this._animation.addConstraintTimeline(timelineName, timeline); + break; + case 40 /* AnimationProgress */: + case 41 /* AnimationWeight */: + case 42 /* AnimationParameter */: + this._animation.addAnimationTimeline(timelineName, timeline); + break; + } + } + } + } + this._animation = null; + return animation; + }; + BinaryDataParser.prototype._parseGeometry = function (rawData, geometry) { + geometry.offset = rawData[dragonBones.DataParser.OFFSET]; + geometry.data = this._data; + var weightOffset = this._intArrayBuffer[geometry.offset + 3 /* GeometryWeightOffset */]; + if (weightOffset >= 0) { + var weight = dragonBones.BaseObject.borrowObject(dragonBones.WeightData); + var vertexCount = this._intArrayBuffer[geometry.offset + 0 /* GeometryVertexCount */]; + var boneCount = this._intArrayBuffer[weightOffset + 0 /* WeigthBoneCount */]; + weight.offset = weightOffset; + for (var i = 0; i < boneCount; ++i) { + var boneIndex = this._intArrayBuffer[weightOffset + 2 /* WeigthBoneIndices */ + i]; + weight.addBone(this._rawBones[boneIndex]); + } + var boneIndicesOffset = weightOffset + 2 /* WeigthBoneIndices */ + boneCount; + var weightCount = 0; + for (var i = 0, l = vertexCount; i < l; ++i) { + var vertexBoneCount = this._intArrayBuffer[boneIndicesOffset++]; + weightCount += vertexBoneCount; + boneIndicesOffset += vertexBoneCount; + } + weight.count = weightCount; + geometry.weight = weight; + } + }; + BinaryDataParser.prototype._parseArray = function (rawData) { + var offsets = rawData[dragonBones.DataParser.OFFSET]; + var l1 = offsets[1]; + var l2 = offsets[3]; + var l3 = offsets[5]; + var l4 = offsets[7]; + var l5 = offsets[9]; + var l6 = offsets[11]; + var l7 = offsets.length > 12 ? offsets[13] : 0; // Color. + var intArray = new Int16Array(this._binary, this._binaryOffset + offsets[0], l1 / Int16Array.BYTES_PER_ELEMENT); + var floatArray = new Float32Array(this._binary, this._binaryOffset + offsets[2], l2 / Float32Array.BYTES_PER_ELEMENT); + var frameIntArray = new Int16Array(this._binary, this._binaryOffset + offsets[4], l3 / Int16Array.BYTES_PER_ELEMENT); + var frameFloatArray = new Float32Array(this._binary, this._binaryOffset + offsets[6], l4 / Float32Array.BYTES_PER_ELEMENT); + var frameArray = new Int16Array(this._binary, this._binaryOffset + offsets[8], l5 / Int16Array.BYTES_PER_ELEMENT); + var timelineArray = new Uint16Array(this._binary, this._binaryOffset + offsets[10], l6 / Uint16Array.BYTES_PER_ELEMENT); + var colorArray = l7 > 0 ? new Int16Array(this._binary, this._binaryOffset + offsets[12], l7 / Int16Array.BYTES_PER_ELEMENT) : intArray; // Color. + this._data.binary = this._binary; + this._data.intArray = this._intArrayBuffer = intArray; + this._data.floatArray = floatArray; + this._data.frameIntArray = frameIntArray; + this._data.frameFloatArray = frameFloatArray; + this._data.frameArray = this._frameArrayBuffer = frameArray; + this._data.timelineArray = this._timelineArrayBuffer = timelineArray; + this._data.colorArray = colorArray; + }; + BinaryDataParser.prototype.parseDragonBonesData = function (rawData, scale) { + if (scale === void 0) { scale = 1; } + console.assert(rawData !== null && rawData !== undefined && rawData instanceof ArrayBuffer, "Data error."); + var tag = new Uint8Array(rawData, 0, 8); + if (tag[0] !== "D".charCodeAt(0) || + tag[1] !== "B".charCodeAt(0) || + tag[2] !== "D".charCodeAt(0) || + tag[3] !== "T".charCodeAt(0)) { + console.assert(false, "Nonsupport data."); + return null; + } + var headerLength = new Uint32Array(rawData, 8, 1)[0]; + var headerBytes = new Uint8Array(rawData, 8 + 4, headerLength); + var headerString = this._decodeUTF8(headerBytes); + var header = JSON.parse(headerString); + // + this._binaryOffset = 8 + 4 + headerLength; + this._binary = rawData; + return _super.prototype.parseDragonBonesData.call(this, header, scale); + }; + /** + * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}. + * @deprecated + * @language en_US + */ + /** + * - 已废弃,请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。 + * @deprecated + * @language zh_CN + */ + BinaryDataParser.getInstance = function () { + if (BinaryDataParser._binaryDataParserInstance === null) { + BinaryDataParser._binaryDataParserInstance = new BinaryDataParser(); + } + return BinaryDataParser._binaryDataParserInstance; + }; + BinaryDataParser._binaryDataParserInstance = null; + return BinaryDataParser; + }(dragonBones.ObjectDataParser)); + dragonBones.BinaryDataParser = BinaryDataParser; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) + * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. + * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) + * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 + * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 + * @see dragonBones.DragonBonesData + * @see dragonBones.TextureAtlasData + * @see dragonBones.ArmatureData + * @see dragonBones.Armature + * @version DragonBones 3.0 + * @language zh_CN + */ + var BaseFactory = /** @class */ (function () { + /** + * - Create a factory instance. (typically only one global factory instance is required) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) + * @version DragonBones 3.0 + * @language zh_CN + */ + function BaseFactory(dataParser) { + if (dataParser === void 0) { dataParser = null; } + /** + * @private + */ + this.autoSearch = false; + this._dragonBonesDataMap = {}; + this._textureAtlasDataMap = {}; + this._dragonBones = null; + this._dataParser = null; + if (BaseFactory._objectParser === null) { + BaseFactory._objectParser = new dragonBones.ObjectDataParser(); + } + if (BaseFactory._binaryParser === null) { + BaseFactory._binaryParser = new dragonBones.BinaryDataParser(); + } + this._dataParser = dataParser !== null ? dataParser : BaseFactory._objectParser; + } + BaseFactory.prototype._isSupportMesh = function () { + return true; + }; + BaseFactory.prototype._getTextureData = function (textureAtlasName, textureName) { + if (textureAtlasName in this._textureAtlasDataMap) { + for (var _i = 0, _a = this._textureAtlasDataMap[textureAtlasName]; _i < _a.length; _i++) { + var textureAtlasData = _a[_i]; + var textureData = textureAtlasData.getTexture(textureName); + if (textureData !== null) { + return textureData; + } + } + } + if (this.autoSearch) { // Will be search all data, if the autoSearch is true. + for (var k in this._textureAtlasDataMap) { + for (var _b = 0, _c = this._textureAtlasDataMap[k]; _b < _c.length; _b++) { + var textureAtlasData = _c[_b]; + if (textureAtlasData.autoSearch) { + var textureData = textureAtlasData.getTexture(textureName); + if (textureData !== null) { + return textureData; + } + } + } + } + } + return null; + }; + BaseFactory.prototype._fillBuildArmaturePackage = function (dataPackage, dragonBonesName, armatureName, skinName, textureAtlasName) { + var dragonBonesData = null; + var armatureData = null; + if (dragonBonesName.length > 0) { + if (dragonBonesName in this._dragonBonesDataMap) { + dragonBonesData = this._dragonBonesDataMap[dragonBonesName]; + armatureData = dragonBonesData.getArmature(armatureName); + } + } + if (armatureData === null && (dragonBonesName.length === 0 || this.autoSearch)) { // Will be search all data, if do not give a data name or the autoSearch is true. + for (var k in this._dragonBonesDataMap) { + dragonBonesData = this._dragonBonesDataMap[k]; + if (dragonBonesName.length === 0 || dragonBonesData.autoSearch) { + armatureData = dragonBonesData.getArmature(armatureName); + if (armatureData !== null) { + dragonBonesName = k; + break; + } + } + } + } + if (armatureData !== null) { + dataPackage.dataName = dragonBonesName; + dataPackage.textureAtlasName = textureAtlasName; + dataPackage.data = dragonBonesData; + dataPackage.armature = armatureData; + dataPackage.skin = null; + if (skinName.length > 0) { + dataPackage.skin = armatureData.getSkin(skinName); + if (dataPackage.skin === null && this.autoSearch) { + for (var k in this._dragonBonesDataMap) { + var skinDragonBonesData = this._dragonBonesDataMap[k]; + var skinArmatureData = skinDragonBonesData.getArmature(skinName); + if (skinArmatureData !== null) { + dataPackage.skin = skinArmatureData.defaultSkin; + break; + } + } + } + } + if (dataPackage.skin === null) { + dataPackage.skin = armatureData.defaultSkin; + } + return true; + } + return false; + }; + BaseFactory.prototype._buildBones = function (dataPackage, armature) { + for (var _i = 0, _a = dataPackage.armature.sortedBones; _i < _a.length; _i++) { + var boneData = _a[_i]; + var bone = dragonBones.BaseObject.borrowObject(boneData.type === 0 /* Bone */ ? dragonBones.Bone : dragonBones.Surface); + bone.init(boneData, armature); + } + }; + /** + * @private + */ + BaseFactory.prototype._buildSlots = function (dataPackage, armature) { + var currentSkin = dataPackage.skin; + var defaultSkin = dataPackage.armature.defaultSkin; + if (currentSkin === null || defaultSkin === null) { + return; + } + var skinSlots = {}; + for (var k in defaultSkin.displays) { + var displays = defaultSkin.getDisplays(k); + skinSlots[k] = displays; + } + if (currentSkin !== defaultSkin) { + for (var k in currentSkin.displays) { + var displays = currentSkin.getDisplays(k); + skinSlots[k] = displays; + } + } + for (var _i = 0, _a = dataPackage.armature.sortedSlots; _i < _a.length; _i++) { + var slotData = _a[_i]; + var displayDatas = slotData.name in skinSlots ? skinSlots[slotData.name] : null; + var slot = this._buildSlot(dataPackage, slotData, armature); + if (displayDatas !== null) { + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); + if (displayData !== null) { + if (dataPackage.textureAtlasName.length > 0) { + var textureData = this._getTextureData(dataPackage.textureAtlasName, displayData.path); + slot.replaceTextureData(textureData, i); + } + var display = this._getSlotDisplay(dataPackage, displayData, slot); + slot.replaceDisplay(display, i); + } + else { + slot.replaceDisplay(null); + } + } + } + slot._setDisplayIndex(slotData.displayIndex, true); + } + }; + BaseFactory.prototype._buildConstraints = function (dataPackage, armature) { + var constraints = dataPackage.armature.constraints; + for (var k in constraints) { + var constraintData = constraints[k]; + // TODO more constraint type. + switch (constraintData.type) { + case 0 /* IK */: + var ikConstraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraint); + ikConstraint.init(constraintData, armature); + armature._addConstraint(ikConstraint); + break; + case 1 /* Path */: + var pathConstraint = dragonBones.BaseObject.borrowObject(dragonBones.PathConstraint); + pathConstraint.init(constraintData, armature); + armature._addConstraint(pathConstraint); + break; + default: + var constraint = dragonBones.BaseObject.borrowObject(dragonBones.IKConstraint); + constraint.init(constraintData, armature); + armature._addConstraint(constraint); + break; + } + } + }; + BaseFactory.prototype._buildChildArmature = function (dataPackage, _slot, displayData) { + return this.buildArmature(displayData.path, dataPackage !== null ? dataPackage.dataName : "", "", dataPackage !== null ? dataPackage.textureAtlasName : ""); + }; + BaseFactory.prototype._getSlotDisplay = function (dataPackage, displayData, slot) { + var dataName = dataPackage !== null ? dataPackage.dataName : displayData.parent.parent.parent.name; + var display = null; + switch (displayData.type) { + case 0 /* Image */: { + var imageDisplayData = displayData; + if (imageDisplayData.texture === null) { + imageDisplayData.texture = this._getTextureData(dataName, displayData.path); + } + display = slot.rawDisplay; + break; + } + case 2 /* Mesh */: { + var meshDisplayData = displayData; + if (meshDisplayData.texture === null) { + meshDisplayData.texture = this._getTextureData(dataName, meshDisplayData.path); + } + if (this._isSupportMesh()) { + display = slot.meshDisplay; + } + else { + display = slot.rawDisplay; + } + break; + } + case 1 /* Armature */: { + var armatureDisplayData = displayData; + var childArmature = this._buildChildArmature(dataPackage, slot, armatureDisplayData); + if (childArmature !== null) { + childArmature.inheritAnimation = armatureDisplayData.inheritAnimation; + if (!childArmature.inheritAnimation) { + var actions = armatureDisplayData.actions.length > 0 ? armatureDisplayData.actions : childArmature.armatureData.defaultActions; + if (actions.length > 0) { + for (var _i = 0, actions_6 = actions; _i < actions_6.length; _i++) { + var action = actions_6[_i]; + var eventObject = dragonBones.BaseObject.borrowObject(dragonBones.EventObject); + dragonBones.EventObject.actionDataToInstance(action, eventObject, slot.armature); + eventObject.slot = slot; + slot.armature._bufferAction(eventObject, false); + } + } + else { + childArmature.animation.play(); + } + } + armatureDisplayData.armature = childArmature.armatureData; // + } + display = childArmature; + break; + } + case 3 /* BoundingBox */: + break; + default: + break; + } + return display; + }; + /** + * - Parse the raw data to a DragonBonesData instance and cache it to the factory. + * @param rawData - The raw data. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for all armatures. (Default: 1.0) + * @returns DragonBonesData instance + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 + * @param rawData - 原始数据。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) + * @returns DragonBonesData 实例 + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.parseDragonBonesData = function (rawData, name, scale) { + if (name === void 0) { name = null; } + if (scale === void 0) { scale = 1.0; } + var dataParser = rawData instanceof ArrayBuffer ? BaseFactory._binaryParser : this._dataParser; + var dragonBonesData = dataParser.parseDragonBonesData(rawData, scale); + while (true) { + var textureAtlasData = this._buildTextureAtlasData(null, null); + if (dataParser.parseTextureAtlasData(null, textureAtlasData, scale)) { + this.addTextureAtlasData(textureAtlasData, name); + } + else { + textureAtlasData.returnToPool(); + break; + } + } + if (dragonBonesData !== null) { + this.addDragonBonesData(dragonBonesData, name); + } + return dragonBonesData; + }; + /** + * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. + * @param rawData - The raw texture atlas data. + * @param textureAtlas - The texture atlas object. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) + * @param scale - Specify a scaling value for the map set. (Default: 1.0) + * @returns TextureAtlasData instance + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 + * @param rawData - 原始贴图集数据。 + * @param textureAtlas - 贴图集对象。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) + * @returns TextureAtlasData 实例 + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.parseTextureAtlasData = function (rawData, textureAtlas, name, scale) { + if (name === void 0) { name = null; } + if (scale === void 0) { scale = 1.0; } + var textureAtlasData = this._buildTextureAtlasData(null, null); + this._dataParser.parseTextureAtlasData(rawData, textureAtlasData, scale); + this._buildTextureAtlasData(textureAtlasData, textureAtlas || null); + this.addTextureAtlasData(textureAtlasData, name); + return textureAtlasData; + }; + /** + * - Update texture atlases. + * @param textureAtlases - The texture atlas objects. + * @param name - The texture atlas name. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 更新贴图集对象。 + * @param textureAtlases - 多个贴图集对象。 + * @param name - 贴图集名称。 + * @version DragonBones 5.7 + * @language zh_CN + */ + BaseFactory.prototype.updateTextureAtlases = function (textureAtlases, name) { + var textureAtlasDatas = this.getTextureAtlasData(name); + if (textureAtlasDatas !== null) { + for (var i = 0, l = textureAtlasDatas.length; i < l; ++i) { + if (i < textureAtlases.length) { + this._buildTextureAtlasData(textureAtlasDatas[i], textureAtlases[i]); + } + } + } + }; + /** + * - Get a specific DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @returns DragonBonesData instance + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 DragonBonesData 实例。 + * @param name - DragonBonesData 实例的缓存名称。 + * @returns DragonBonesData 实例 + * @see #parseDragonBonesData() + * @see #addDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.getDragonBonesData = function (name) { + return (name in this._dragonBonesDataMap) ? this._dragonBonesDataMap[name] : null; + }; + /** + * - Cache a DragonBonesData instance to the factory. + * @param data - The DragonBonesData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 DragonBonesData 实例缓存到工厂中。 + * @param data - DragonBonesData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #removeDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.addDragonBonesData = function (data, name) { + if (name === void 0) { name = null; } + name = name !== null ? name : data.name; + if (name in this._dragonBonesDataMap) { + if (this._dragonBonesDataMap[name] === data) { + return; + } + console.warn("Can not add same name data: " + name); + return; + } + this._dragonBonesDataMap[name] = data; + }; + /** + * - Remove a DragonBonesData instance. + * @param name - The DragonBonesData instance cache name. + * @param disposeData - Whether to dispose data. (Default: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 DragonBonesData 实例。 + * @param name - DragonBonesData 实例缓存名称。 + * @param disposeData - 是否释放数据。 (默认: true) + * @see #parseDragonBonesData() + * @see #getDragonBonesData() + * @see #addDragonBonesData() + * @see dragonBones.DragonBonesData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.removeDragonBonesData = function (name, disposeData) { + if (disposeData === void 0) { disposeData = true; } + if (name in this._dragonBonesDataMap) { + if (disposeData) { + this._dragonBones.bufferObject(this._dragonBonesDataMap[name]); + } + delete this._dragonBonesDataMap[name]; + } + }; + /** + * - Get a list of specific TextureAtlasData instances. + * @param name - The TextureAtlasData cahce name. + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 获取特定的 TextureAtlasData 实例列表。 + * @param name - TextureAtlasData 实例缓存名称。 + * @see #parseTextureAtlasData() + * @see #addTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.getTextureAtlasData = function (name) { + return (name in this._textureAtlasDataMap) ? this._textureAtlasDataMap[name] : null; + }; + /** + * - Cache a TextureAtlasData instance to the factory. + * @param data - The TextureAtlasData instance. + * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 将 TextureAtlasData 实例缓存到工厂中。 + * @param data - TextureAtlasData 实例。 + * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #removeTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.addTextureAtlasData = function (data, name) { + if (name === void 0) { name = null; } + name = name !== null ? name : data.name; + var textureAtlasList = (name in this._textureAtlasDataMap) ? this._textureAtlasDataMap[name] : (this._textureAtlasDataMap[name] = []); + if (textureAtlasList.indexOf(data) < 0) { + textureAtlasList.push(data); + } + }; + /** + * - Remove a TextureAtlasData instance. + * @param name - The TextureAtlasData instance cache name. + * @param disposeData - Whether to dispose data. + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 移除 TextureAtlasData 实例。 + * @param name - TextureAtlasData 实例的缓存名称。 + * @param disposeData - 是否释放数据。 + * @see #parseTextureAtlasData() + * @see #getTextureAtlasData() + * @see #addTextureAtlasData() + * @see dragonBones.TextureAtlasData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.removeTextureAtlasData = function (name, disposeData) { + if (disposeData === void 0) { disposeData = true; } + if (name in this._textureAtlasDataMap) { + var textureAtlasDataList = this._textureAtlasDataMap[name]; + if (disposeData) { + for (var _i = 0, textureAtlasDataList_1 = textureAtlasDataList; _i < textureAtlasDataList_1.length; _i++) { + var textureAtlasData = textureAtlasDataList_1[_i]; + this._dragonBones.bufferObject(textureAtlasData); + } + } + delete this._textureAtlasDataMap[name]; + } + }; + /** + * - Get a specific armature data. + * @param name - The armature data name. + * @param dragonBonesName - The cached name for DragonbonesData instance. + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language en_US + */ + /** + * - 获取特定的骨架数据。 + * @param name - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @see dragonBones.ArmatureData + * @version DragonBones 5.1 + * @language zh_CN + */ + BaseFactory.prototype.getArmatureData = function (name, dragonBonesName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + var dataPackage = new BuildArmaturePackage(); + if (!this._fillBuildArmaturePackage(dataPackage, dragonBonesName, name, "", "")) { + return null; + } + return dataPackage.armature; + }; + /** + * - Clear all cached DragonBonesData instances and TextureAtlasData instances. + * @param disposeData - Whether to dispose data. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 + * @param disposeData - 是否释放数据。 + * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.clear = function (disposeData) { + if (disposeData === void 0) { disposeData = true; } + for (var k in this._dragonBonesDataMap) { + if (disposeData) { + this._dragonBones.bufferObject(this._dragonBonesDataMap[k]); + } + delete this._dragonBonesDataMap[k]; + } + for (var k in this._textureAtlasDataMap) { + if (disposeData) { + var textureAtlasDataList = this._textureAtlasDataMap[k]; + for (var _i = 0, textureAtlasDataList_2 = textureAtlasDataList; _i < textureAtlasDataList_2.length; _i++) { + var textureAtlasData = textureAtlasDataList_2[_i]; + this._dragonBones.bufferObject(textureAtlasData); + } + } + delete this._textureAtlasDataMap[k]; + } + }; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. + * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature. + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 + * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) + * @returns 骨架。 + * @example + *
+         *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
+         *     armature.clock = factory.clock;
+         * 
+ * @see dragonBones.DragonBonesData + * @see dragonBones.ArmatureData + * @version DragonBones 3.0 + * @language zh_CN + */ + BaseFactory.prototype.buildArmature = function (armatureName, dragonBonesName, skinName, textureAtlasName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + if (skinName === void 0) { skinName = ""; } + if (textureAtlasName === void 0) { textureAtlasName = ""; } + var dataPackage = new BuildArmaturePackage(); + if (!this._fillBuildArmaturePackage(dataPackage, dragonBonesName || "", armatureName, skinName || "", textureAtlasName || "")) { + console.warn("No armature data: " + armatureName + ", " + (dragonBonesName !== null ? dragonBonesName : "")); + return null; + } + var armature = this._buildArmature(dataPackage); + this._buildBones(dataPackage, armature); + this._buildSlots(dataPackage, armature); + this._buildConstraints(dataPackage, armature); + armature.invalidUpdate(null, true); + armature.advanceTime(0.0); // Update armature pose. + return armature; + }; + /** + * @private + */ + BaseFactory.prototype.replaceDisplay = function (slot, displayData, displayIndex) { + if (displayIndex === void 0) { displayIndex = -1; } + if (displayIndex < 0) { + displayIndex = slot.displayIndex; + } + if (displayIndex < 0) { + displayIndex = 0; + } + slot.replaceDisplayData(displayData, displayIndex); + if (displayData !== null) { + var display = this._getSlotDisplay(null, displayData, slot); + if (displayData.type === 0 /* Image */) { + var rawDisplayData = slot.getDisplayFrameAt(displayIndex).rawDisplayData; + if (rawDisplayData !== null && + rawDisplayData.type === 2 /* Mesh */) { + display = slot.meshDisplay; + } + } + slot.replaceDisplay(display, displayIndex); + } + else { + slot.replaceDisplay(null, displayIndex); + } + }; + /** + * - Replaces the current display data for a particular slot with a specific display data. + * Specify display data with "dragonBonesName/armatureName/slotName/displayName". + * @param dragonBonesName - The DragonBonesData instance cache name. + * @param armatureName - The armature data name. + * @param slotName - The slot data name. + * @param displayName - The display data name. + * @param slot - The slot. + * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 + * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 + * @param armatureName - 骨架数据名称。 + * @param slotName - 插槽数据名称。 + * @param displayName - 显示对象数据名称。 + * @param slot - 插槽。 + * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) + * @example + *
+         *     let slot = armature.getSlot("weapon");
+         *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
+         * 
+ * @version DragonBones 4.5 + * @language zh_CN + */ + BaseFactory.prototype.replaceSlotDisplay = function (dragonBonesName, armatureName, slotName, displayName, slot, displayIndex) { + if (displayIndex === void 0) { displayIndex = -1; } + var armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); + if (armatureData === null || armatureData.defaultSkin === null) { + return false; + } + var displayData = armatureData.defaultSkin.getDisplay(slotName, displayName); + this.replaceDisplay(slot, displayData, displayIndex); + return true; + }; + /** + * @private + */ + BaseFactory.prototype.replaceSlotDisplayList = function (dragonBonesName, armatureName, slotName, slot) { + var armatureData = this.getArmatureData(armatureName, dragonBonesName || ""); + if (!armatureData || !armatureData.defaultSkin) { + return false; + } + var displayDatas = armatureData.defaultSkin.getDisplays(slotName); + if (!displayDatas) { + return false; + } + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + this.replaceDisplay(slot, displayData, i); + } + return true; + }; + /** + * - Share specific skin data with specific armature. + * @param armature - The armature. + * @param skin - The skin data. + * @param isOverride - Whether it completely override the original skin. (Default: false) + * @param exclude - A list of slot names that do not need to be replace. + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 将特定的皮肤数据共享给特定的骨架使用。 + * @param armature - 骨架。 + * @param skin - 皮肤数据。 + * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) + * @param exclude - 不需要被替换的插槽名称列表。 + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB && armatureDataB.defaultSkin) {
+         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.SkinData + * @version DragonBones 5.6 + * @language zh_CN + */ + BaseFactory.prototype.replaceSkin = function (armature, skin, isOverride, exclude) { + if (isOverride === void 0) { isOverride = false; } + if (exclude === void 0) { exclude = null; } + var success = false; + var defaultSkin = skin.parent.defaultSkin; + for (var _i = 0, _a = armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + if (exclude !== null && exclude.indexOf(slot.name) >= 0) { + continue; + } + var displayDatas = skin.getDisplays(slot.name); + if (displayDatas === null) { + if (defaultSkin !== null && skin !== defaultSkin) { + displayDatas = defaultSkin.getDisplays(slot.name); + } + if (displayDatas === null) { + if (isOverride) { + slot.displayFrameCount = 0; + } + continue; + } + } + slot.displayFrameCount = displayDatas.length; + for (var i = 0, l = slot.displayFrameCount; i < l; ++i) { + var displayData = displayDatas[i]; + slot.replaceRawDisplayData(displayData, i); + if (displayData !== null) { + slot.replaceDisplay(this._getSlotDisplay(null, displayData, slot), i); + } + else { + slot.replaceDisplay(null, i); + } + } + success = true; + } + return success; + }; + /** + * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. + * This enables you to make a armature template so that other armature without animations can share it's animations. + * @param armature - The armtaure. + * @param armatureData - The armature data. + * @param isOverride - Whether to completely overwrite the original animation. (Default: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language en_US + */ + /** + * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 + * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 + * @param armature - 骨架。 + * @param armatureData - 骨架数据。 + * @param isOverride - 是否完全覆盖原来的动画。(默认: false) + * @example + *
+         *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
+         *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
+         *     if (armatureDataB) {
+         *     factory.replaceAnimation(armatureA, armatureDataB);
+         *     }
+         * 
+ * @see dragonBones.Armature + * @see dragonBones.ArmatureData + * @version DragonBones 5.6 + * @language zh_CN + */ + BaseFactory.prototype.replaceAnimation = function (armature, armatureData, isOverride) { + if (isOverride === void 0) { isOverride = true; } + var skinData = armatureData.defaultSkin; + if (skinData === null) { + return false; + } + if (isOverride) { + armature.animation.animations = armatureData.animations; + } + else { + var rawAnimations = armature.animation.animations; + var animations = {}; + for (var k in rawAnimations) { + animations[k] = rawAnimations[k]; + } + for (var k in armatureData.animations) { + animations[k] = armatureData.animations[k]; + } + armature.animation.animations = animations; + } + for (var _i = 0, _a = armature.getSlots(); _i < _a.length; _i++) { + var slot = _a[_i]; + var index = 0; + for (var _b = 0, _c = slot.displayList; _b < _c.length; _b++) { + var display = _c[_b]; + if (display instanceof dragonBones.Armature) { + var displayDatas = skinData.getDisplays(slot.name); + if (displayDatas !== null && index < displayDatas.length) { + var displayData = displayDatas[index]; + if (displayData !== null && displayData.type === 1 /* Armature */) { + var childArmatureData = this.getArmatureData(displayData.path, displayData.parent.parent.parent.name); + if (childArmatureData) { + this.replaceAnimation(display, childArmatureData, isOverride); + } + } + } + } + index++; + } + } + return true; + }; + /** + * @private + */ + BaseFactory.prototype.getAllDragonBonesData = function () { + return this._dragonBonesDataMap; + }; + /** + * @private + */ + BaseFactory.prototype.getAllTextureAtlasData = function () { + return this._textureAtlasDataMap; + }; + Object.defineProperty(BaseFactory.prototype, "clock", { + /** + * - An Worldclock instance updated by engine. + * @version DragonBones 5.7 + * @language en_US + */ + /** + * - 由引擎驱动的 WorldClock 实例。 + * @version DragonBones 5.7 + * @language zh_CN + */ + get: function () { + return this._dragonBones.clock; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseFactory.prototype, "dragonBones", { + /** + * @private + */ + get: function () { + return this._dragonBones; + }, + enumerable: true, + configurable: true + }); + BaseFactory._objectParser = null; + BaseFactory._binaryParser = null; + return BaseFactory; + }()); + dragonBones.BaseFactory = BaseFactory; + /** + * @private + */ + var BuildArmaturePackage = /** @class */ (function () { + function BuildArmaturePackage() { + this.dataName = ""; + this.textureAtlasName = ""; + this.skin = null; + } + return BuildArmaturePackage; + }()); + dragonBones.BuildArmaturePackage = BuildArmaturePackage; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The PixiJS texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var PixiTextureAtlasData = /** @class */ (function (_super) { + __extends(PixiTextureAtlasData, _super); + function PixiTextureAtlasData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._renderTexture = null; // Initial value. + return _this; + } + PixiTextureAtlasData.toString = function () { + return "[class dragonBones.PixiTextureAtlasData]"; + }; + PixiTextureAtlasData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this._renderTexture !== null) { + // this._renderTexture.dispose(); + } + this._renderTexture = null; + }; + /** + * @inheritDoc + */ + PixiTextureAtlasData.prototype.createTexture = function () { + return dragonBones.BaseObject.borrowObject(PixiTextureData); + }; + Object.defineProperty(PixiTextureAtlasData.prototype, "renderTexture", { + /** + * - The PixiJS texture. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 贴图。 + * @version DragonBones 3.0 + * @language zh_CN + */ + get: function () { + return this._renderTexture; + }, + set: function (value) { + if (this._renderTexture === value) { + return; + } + this._renderTexture = value; + if (this._renderTexture !== null) { + for (var k in this.textures) { + var textureData = this.textures[k]; + textureData.renderTexture = new PIXI.Texture(this._renderTexture, new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height), new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height), new PIXI.Rectangle(0, 0, textureData.region.width, textureData.region.height), textureData.rotated // .d.ts bug + ); + } + } + else { + for (var k in this.textures) { + var textureData = this.textures[k]; + textureData.renderTexture = null; + } + } + }, + enumerable: true, + configurable: true + }); + return PixiTextureAtlasData; + }(dragonBones.TextureAtlasData)); + dragonBones.PixiTextureAtlasData = PixiTextureAtlasData; + /** + * @internal + */ + var PixiTextureData = /** @class */ (function (_super) { + __extends(PixiTextureData, _super); + function PixiTextureData() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.renderTexture = null; // Initial value. + return _this; + } + PixiTextureData.toString = function () { + return "[class dragonBones.PixiTextureData]"; + }; + PixiTextureData.prototype._onClear = function () { + _super.prototype._onClear.call(this); + if (this.renderTexture !== null) { + this.renderTexture.destroy(false); + } + this.renderTexture = null; + }; + return PixiTextureData; + }(dragonBones.TextureData)); + dragonBones.PixiTextureData = PixiTextureData; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * @inheritDoc + */ + var PixiArmatureDisplay = /** @class */ (function (_super) { + __extends(PixiArmatureDisplay, _super); + function PixiArmatureDisplay() { + var _this = _super !== null && _super.apply(this, arguments) || this; + /** + * @private + */ + _this.debugDraw = false; + _this._debugDraw = false; + // private _disposeProxy: boolean = false; + _this._armature = null; + _this._debugDrawer = null; + return _this; + } + /** + * @inheritDoc + */ + PixiArmatureDisplay.prototype.dbInit = function (armature) { + this._armature = armature; + }; + /** + * @inheritDoc + */ + PixiArmatureDisplay.prototype.dbClear = function () { + if (this._debugDrawer !== null) { + this._debugDrawer.destroy({ children: true, texture: true, baseTexture: true }); + } + this._armature = null; + this._debugDrawer = null; + _super.prototype.destroy.call(this); + }; + /** + * @inheritDoc + */ + PixiArmatureDisplay.prototype.dbUpdate = function () { + var drawed = dragonBones.DragonBones.debugDraw || this.debugDraw; + if (drawed || this._debugDraw) { + this._debugDraw = drawed; + if (this._debugDraw) { + if (this._debugDrawer === null) { + this._debugDrawer = new PIXI.Sprite(PIXI.Texture.EMPTY); + var boneDrawer_1 = new PIXI.Graphics(); + this._debugDrawer.addChild(boneDrawer_1); + } + this.addChild(this._debugDrawer); + var boneDrawer = this._debugDrawer.getChildAt(0); + boneDrawer.clear(); + var bones = this._armature.getBones(); + for (var i = 0, l = bones.length; i < l; ++i) { + var bone = bones[i]; + var boneLength = bone.boneData.length; + var startX = bone.globalTransformMatrix.tx; + var startY = bone.globalTransformMatrix.ty; + var endX = startX + bone.globalTransformMatrix.a * boneLength; + var endY = startY + bone.globalTransformMatrix.b * boneLength; + boneDrawer.lineStyle(2.0, 0x00FFFF, 0.7); + boneDrawer.moveTo(startX, startY); + boneDrawer.lineTo(endX, endY); + boneDrawer.lineStyle(0.0, 0, 0.0); + boneDrawer.beginFill(0x00FFFF, 0.7); + boneDrawer.drawCircle(startX, startY, 3.0); + boneDrawer.endFill(); + } + var slots = this._armature.getSlots(); + for (var i = 0, l = slots.length; i < l; ++i) { + var slot = slots[i]; + var boundingBoxData = slot.boundingBoxData; + if (boundingBoxData) { + var child = this._debugDrawer.getChildByName(slot.name); + if (!child) { + child = new PIXI.Graphics(); + child.name = slot.name; + this._debugDrawer.addChild(child); + } + child.clear(); + child.lineStyle(2.0, 0xFF00FF, 0.7); + switch (boundingBoxData.type) { + case 0 /* Rectangle */: + child.drawRect(-boundingBoxData.width * 0.5, -boundingBoxData.height * 0.5, boundingBoxData.width, boundingBoxData.height); + break; + case 1 /* Ellipse */: + child.drawEllipse(-boundingBoxData.width * 0.5, -boundingBoxData.height * 0.5, boundingBoxData.width, boundingBoxData.height); + break; + case 2 /* Polygon */: + var vertices = boundingBoxData.vertices; + for (var i_4 = 0, l_1 = vertices.length; i_4 < l_1; i_4 += 2) { + var x = vertices[i_4]; + var y = vertices[i_4 + 1]; + if (i_4 === 0) { + child.moveTo(x, y); + } + else { + child.lineTo(x, y); + } + } + child.lineTo(vertices[0], vertices[1]); + break; + default: + break; + } + child.endFill(); + slot.updateTransformAndMatrix(); + slot.updateGlobalTransform(); + var transform = slot.global; + child.setTransform(transform.x, transform.y, transform.scaleX, transform.scaleY, transform.rotation, transform.skew, 0.0, slot._pivotX, slot._pivotY); + } + else { + var child = this._debugDrawer.getChildByName(slot.name); + if (child) { + this._debugDrawer.removeChild(child); + } + } + } + } + else if (this._debugDrawer !== null && this._debugDrawer.parent === this) { + this.removeChild(this._debugDrawer); + } + } + }; + /** + * @inheritDoc + */ + PixiArmatureDisplay.prototype.dispose = function (disposeProxy) { + if (disposeProxy === void 0) { disposeProxy = true; } + // tslint:disable-next-line:no-unused-expression + disposeProxy; + if (this._armature !== null) { + this._armature.dispose(); + this._armature = null; + } + }; + /** + * @inheritDoc + */ + PixiArmatureDisplay.prototype.destroy = function () { + this.dispose(); + }; + /** + * @private + */ + PixiArmatureDisplay.prototype.dispatchDBEvent = function (type, eventObject) { + this.emit(type, eventObject); + }; + /** + * @inheritDoc + */ + PixiArmatureDisplay.prototype.hasDBEventListener = function (type) { + return this.listenerCount(type) > 0; + }; + /** + * @inheritDoc + */ + PixiArmatureDisplay.prototype.addDBEventListener = function (type, listener, target) { + this.addListener(type, listener, target); + }; + /** + * @inheritDoc + */ + PixiArmatureDisplay.prototype.removeDBEventListener = function (type, listener, target) { + this.removeListener(type, listener, target); + }; + Object.defineProperty(PixiArmatureDisplay.prototype, "armature", { + /** + * @inheritDoc + */ + get: function () { + return this._armature; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PixiArmatureDisplay.prototype, "animation", { + /** + * @inheritDoc + */ + get: function () { + return this._armature.animation; + }, + enumerable: true, + configurable: true + }); + return PixiArmatureDisplay; + }(PIXI.Sprite)); + dragonBones.PixiArmatureDisplay = PixiArmatureDisplay; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The PixiJS slot. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 插槽。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var PixiSlot = /** @class */ (function (_super) { + __extends(PixiSlot, _super); + function PixiSlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + PixiSlot.toString = function () { + return "[class dragonBones.PixiSlot]"; + }; + PixiSlot.prototype._onClear = function () { + _super.prototype._onClear.call(this); + this._textureScale = 1.0; + this._renderDisplay = null; + this._updateTransform = PIXI.VERSION[0] === "3" ? this._updateTransformV3 : this._updateTransformV4; + }; + PixiSlot.prototype._initDisplay = function (value, isRetain) { + // tslint:disable-next-line:no-unused-expression + value; + // tslint:disable-next-line:no-unused-expression + isRetain; + }; + PixiSlot.prototype._disposeDisplay = function (value, isRelease) { + // tslint:disable-next-line:no-unused-expression + value; + if (!isRelease) { + value.destroy(); + } + }; + PixiSlot.prototype._onUpdateDisplay = function () { + this._renderDisplay = (this._display ? this._display : this._rawDisplay); + }; + PixiSlot.prototype._addDisplay = function () { + var container = this._armature.display; + container.addChild(this._renderDisplay); + }; + PixiSlot.prototype._replaceDisplay = function (value) { + var container = this._armature.display; + var prevDisplay = value; + container.addChild(this._renderDisplay); + container.swapChildren(this._renderDisplay, prevDisplay); + container.removeChild(prevDisplay); + this._textureScale = 1.0; + }; + PixiSlot.prototype._removeDisplay = function () { + this._renderDisplay.parent.removeChild(this._renderDisplay); + }; + PixiSlot.prototype._updateZOrder = function () { + var container = this._armature.display; + var index = container.getChildIndex(this._renderDisplay); + if (index === this._zOrder) { + return; + } + container.addChildAt(this._renderDisplay, this._zOrder); + }; + /** + * @internal + */ + PixiSlot.prototype._updateVisible = function () { + this._renderDisplay.visible = this._parent.visible && this._visible; + }; + PixiSlot.prototype._updateBlendMode = function () { + if (this._renderDisplay instanceof PIXI.Sprite) { + switch (this._blendMode) { + case 0 /* Normal */: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.NORMAL; + break; + case 1 /* Add */: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.ADD; + break; + case 3 /* Darken */: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.DARKEN; + break; + case 4 /* Difference */: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.DIFFERENCE; + break; + case 6 /* HardLight */: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.HARD_LIGHT; + break; + case 9 /* Lighten */: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.LIGHTEN; + break; + case 10 /* Multiply */: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.MULTIPLY; + break; + case 11 /* Overlay */: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.OVERLAY; + break; + case 12 /* Screen */: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.SCREEN; + break; + default: + break; + } + } + // TODO child armature. + }; + PixiSlot.prototype._updateColor = function () { + var alpha = this._colorTransform.alphaMultiplier * this._globalAlpha; + this._renderDisplay.alpha = alpha; + if (this._renderDisplay instanceof PIXI.Sprite || this._renderDisplay instanceof PIXI.SimpleMesh) { + var color = (Math.round(this._colorTransform.redMultiplier * 0xFF) << 16) + (Math.round(this._colorTransform.greenMultiplier * 0xFF) << 8) + Math.round(this._colorTransform.blueMultiplier * 0xFF); + this._renderDisplay.tint = color; + } + // TODO child armature. + }; + PixiSlot.prototype._updateFrame = function () { + var currentTextureData = this._textureData; + if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) { + var currentTextureAtlasData = currentTextureData.parent; + if (this._armature.replacedTexture !== null) { // Update replaced texture atlas. + if (this._armature._replaceTextureAtlasData === null) { + currentTextureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.PixiTextureAtlasData); + currentTextureAtlasData.copyFrom(currentTextureData.parent); + currentTextureAtlasData.renderTexture = this._armature.replacedTexture; + this._armature._replaceTextureAtlasData = currentTextureAtlasData; + } + else { + currentTextureAtlasData = this._armature._replaceTextureAtlasData; + } + currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name); + } + var renderTexture = currentTextureData.renderTexture; + if (renderTexture !== null) { + if (this._geometryData !== null) { // Mesh. + var data = this._geometryData.data; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[this._geometryData.offset + 0 /* GeometryVertexCount */]; + var triangleCount = intArray[this._geometryData.offset + 1 /* GeometryTriangleCount */]; + var vertexOffset = intArray[this._geometryData.offset + 2 /* GeometryFloatOffset */]; + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + var uvOffset = vertexOffset + vertexCount * 2; + var scale = this._armature._armatureData.scale; + var meshDisplay = this._renderDisplay; + var vertices = new Float32Array(vertexCount * 2); + var uvs = new Float32Array(vertexCount * 2); + var indices = new Uint16Array(triangleCount * 3); + for (var i = 0, l = vertexCount * 2; i < l; ++i) { + vertices[i] = floatArray[vertexOffset + i] * scale; + } + for (var i = 0; i < triangleCount * 3; ++i) { + indices[i] = intArray[this._geometryData.offset + 4 /* GeometryVertexIndices */ + i]; + } + for (var i = 0, l = vertexCount * 2; i < l; i += 2) { + var u = floatArray[uvOffset + i]; + var v = floatArray[uvOffset + i + 1]; + if (currentTextureData.rotated) { + uvs[i] = 1 - v; + uvs[i + 1] = u; + } + else { + uvs[i] = u; + uvs[i + 1] = v; + } + } + this._textureScale = 1.0; + meshDisplay.texture = renderTexture; + meshDisplay.vertices = vertices; + meshDisplay.uvBuffer.update(uvs); + meshDisplay.geometry.addIndex(indices); + var isSkinned = this._geometryData.weight !== null; + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + if (isSkinned || isSurface) { + this._identityTransform(); + } + } + else { + // Normal texture. + this._textureScale = currentTextureData.parent.scale * this._armature._armatureData.scale; + var normalDisplay = this._renderDisplay; + normalDisplay.texture = renderTexture; + } + this._visibleDirty = true; + return; + } + } + if (this._geometryData !== null) { + var meshDisplay = this._renderDisplay; + meshDisplay.texture = null; + meshDisplay.x = 0.0; + meshDisplay.y = 0.0; + meshDisplay.visible = false; + } + else { + var normalDisplay = this._renderDisplay; + normalDisplay.texture = null; + normalDisplay.x = 0.0; + normalDisplay.y = 0.0; + normalDisplay.visible = false; + } + }; + PixiSlot.prototype._updateMesh = function () { + var scale = this._armature._armatureData.scale; + var deformVertices = this._displayFrame.deformVertices; + var bones = this._geometryBones; + var geometryData = this._geometryData; + var weightData = geometryData.weight; + var hasDeform = deformVertices.length > 0 && geometryData.inheritDeform; + var meshDisplay = this._renderDisplay; + if (weightData !== null) { + var data = geometryData.data; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometryData.offset + 0 /* GeometryVertexCount */]; + var weightFloatOffset = intArray[weightData.offset + 1 /* WeigthFloatOffset */]; + if (weightFloatOffset < 0) { + weightFloatOffset += 65536; // Fixed out of bouds bug. + } + for (var i = 0, iD = 0, iB = weightData.offset + 2 /* WeigthBoneIndices */ + bones.length, iV = weightFloatOffset, iF = 0; i < vertexCount; ++i) { + var boneCount = intArray[iB++]; + var xG = 0.0, yG = 0.0; + for (var j = 0; j < boneCount; ++j) { + var boneIndex = intArray[iB++]; + var bone = bones[boneIndex]; + if (bone !== null) { + var matrix = bone.globalTransformMatrix; + var weight = floatArray[iV++]; + var xL = floatArray[iV++] * scale; + var yL = floatArray[iV++] * scale; + if (hasDeform) { + xL += deformVertices[iF++]; + yL += deformVertices[iF++]; + } + xG += (matrix.a * xL + matrix.c * yL + matrix.tx) * weight; + yG += (matrix.b * xL + matrix.d * yL + matrix.ty) * weight; + } + } + meshDisplay.vertices[iD++] = xG; + meshDisplay.vertices[iD++] = yG; + } + } + else { + var isSurface = this._parent._boneData.type !== 0 /* Bone */; + var data = geometryData.data; + var intArray = data.intArray; + var floatArray = data.floatArray; + var vertexCount = intArray[geometryData.offset + 0 /* GeometryVertexCount */]; + var vertexOffset = intArray[geometryData.offset + 2 /* GeometryFloatOffset */]; + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + for (var i = 0, l = vertexCount * 2; i < l; i += 2) { + var x = floatArray[vertexOffset + i] * scale; + var y = floatArray[vertexOffset + i + 1] * scale; + if (hasDeform) { + x += deformVertices[i]; + y += deformVertices[i + 1]; + } + if (isSurface) { + var matrix = this._parent._getGlobalTransformMatrix(x, y); + meshDisplay.vertices[i] = matrix.a * x + matrix.c * y + matrix.tx; + meshDisplay.vertices[i + 1] = matrix.b * x + matrix.d * y + matrix.ty; + } + else { + meshDisplay.vertices[i] = x; + meshDisplay.vertices[i + 1] = y; + } + } + } + }; + PixiSlot.prototype._updateTransform = function () { + throw new Error(); + }; + PixiSlot.prototype._updateTransformV3 = function () { + this.updateGlobalTransform(); // Update transform. + var transform = this.global; + if (this._renderDisplay === this._rawDisplay || this._renderDisplay === this._meshDisplay) { + var x = transform.x - (this.globalTransformMatrix.a * this._pivotX + this.globalTransformMatrix.c * this._pivotY); + var y = transform.y - (this.globalTransformMatrix.b * this._pivotX + this.globalTransformMatrix.d * this._pivotY); + this._renderDisplay.setTransform(x, y, transform.scaleX * this._textureScale, transform.scaleY * this._textureScale, transform.rotation, transform.skew, 0.0); + } + else { + this._renderDisplay.position.set(transform.x, transform.y); + this._renderDisplay.rotation = transform.rotation; + this._renderDisplay.skew.set(transform.skew, 0.0); + this._renderDisplay.scale.set(transform.scaleX, transform.scaleY); + } + }; + PixiSlot.prototype._updateTransformV4 = function () { + this.updateGlobalTransform(); // Update transform. + var transform = this.global; + if (this._renderDisplay === this._rawDisplay || this._renderDisplay === this._meshDisplay) { + var x = transform.x - (this.globalTransformMatrix.a * this._pivotX + this.globalTransformMatrix.c * this._pivotY); + var y = transform.y - (this.globalTransformMatrix.b * this._pivotX + this.globalTransformMatrix.d * this._pivotY); + this._renderDisplay.setTransform(x, y, transform.scaleX * this._textureScale, transform.scaleY * this._textureScale, transform.rotation, -transform.skew, 0.0); + } + else { + this._renderDisplay.position.set(transform.x, transform.y); + this._renderDisplay.rotation = transform.rotation; + this._renderDisplay.skew.set(-transform.skew, 0.0); + this._renderDisplay.scale.set(transform.scaleX, transform.scaleY); + } + }; + PixiSlot.prototype._identityTransform = function () { + this._renderDisplay.setTransform(0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0); + }; + return PixiSlot; + }(dragonBones.Slot)); + dragonBones.PixiSlot = PixiSlot; +})(dragonBones || (dragonBones = {})); +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +var dragonBones; +(function (dragonBones) { + /** + * - The PixiJS factory. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 工厂。 + * @version DragonBones 3.0 + * @language zh_CN + */ + var PixiFactory = /** @class */ (function (_super) { + __extends(PixiFactory, _super); + /** + * @inheritDoc + */ + function PixiFactory(dataParser, useSharedTicker) { + if (dataParser === void 0) { dataParser = null; } + if (useSharedTicker === void 0) { useSharedTicker = true; } + var _this = _super.call(this, dataParser) || this; + if (PixiFactory._dragonBonesInstance === null) { + var eventManager = new dragonBones.PixiArmatureDisplay(PIXI.Texture.EMPTY); + PixiFactory._dragonBonesInstance = new dragonBones.DragonBones(eventManager); + if (useSharedTicker) { + PIXI.Ticker.shared.add(PixiFactory._clockHandler, PixiFactory); + } + } + _this._dragonBones = PixiFactory._dragonBonesInstance; + return _this; + } + PixiFactory._clockHandler = function (passedTime) { + this._dragonBonesInstance.advanceTime((passedTime / PIXI.settings.TARGET_FPMS) * 0.001); + }; + /* + * `passedTime` is elapsed time, specified in seconds. + */ + PixiFactory.advanceTime = function (passedTime) { + this._dragonBonesInstance.advanceTime(passedTime); + }; + Object.defineProperty(PixiFactory, "factory", { + /** + * - A global factory instance that can be used directly. + * @version DragonBones 4.7 + * @language en_US + */ + /** + * - 一个可以直接使用的全局工厂实例。 + * @version DragonBones 4.7 + * @language zh_CN + */ + get: function () { + if (PixiFactory._factory === null) { + PixiFactory._factory = new PixiFactory(null, PixiFactory.useSharedTicker); + } + return PixiFactory._factory; + }, + enumerable: true, + configurable: true + }); + /** + * - 一个获取全局工厂实例(单例)的方法, 和get factory相比, 优点是可以传参数。 + * @version DragonBones 4.7 + * @language zh_CN + */ + PixiFactory.newInstance = function (useSharedTicker) { + if (useSharedTicker === void 0) { useSharedTicker = true; } + if (PixiFactory._factory === null) { + PixiFactory._factory = new PixiFactory(null, useSharedTicker); + } + return PixiFactory._factory; + }; + PixiFactory.prototype._buildTextureAtlasData = function (textureAtlasData, textureAtlas) { + if (textureAtlasData) { + textureAtlasData.renderTexture = textureAtlas; + } + else { + textureAtlasData = dragonBones.BaseObject.borrowObject(dragonBones.PixiTextureAtlasData); + } + return textureAtlasData; + }; + PixiFactory.prototype._buildArmature = function (dataPackage) { + var armature = dragonBones.BaseObject.borrowObject(dragonBones.Armature); + var armatureDisplay = new dragonBones.PixiArmatureDisplay(PIXI.Texture.EMPTY); + armature.init(dataPackage.armature, armatureDisplay, armatureDisplay, this._dragonBones); + return armature; + }; + PixiFactory.prototype._buildSlot = function (_dataPackage, slotData, armature) { + var slot = dragonBones.BaseObject.borrowObject(dragonBones.PixiSlot); + slot.init(slotData, armature, new PIXI.Sprite(PIXI.Texture.EMPTY), new PIXI.SimpleMesh()); + return slot; + }; + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it. + * The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature display container. + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + *
+         *     let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
+         * 
+ * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架,并用 {@link #clock} 更新该骨架。 + * 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。 (如果未设置,则使用默认的皮肤数据) + * @returns 骨架的显示容器。 + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + *
+         *     let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
+         * 
+ * @language zh_CN + */ + PixiFactory.prototype.buildArmatureDisplay = function (armatureName, dragonBonesName, skinName, textureAtlasName) { + if (dragonBonesName === void 0) { dragonBonesName = ""; } + if (skinName === void 0) { skinName = ""; } + if (textureAtlasName === void 0) { textureAtlasName = ""; } + var armature = this.buildArmature(armatureName, dragonBonesName || "", skinName || "", textureAtlasName || ""); + if (armature !== null) { + this._dragonBones.clock.add(armature); + return armature.display; + } + return null; + }; + /** + * - Create the display object with the specified texture. + * @param textureName - The texture data name. + * @param textureAtlasName - The texture atlas data name (Of not set, all texture atlas data will be searched) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建带有指定贴图的显示对象。 + * @param textureName - 贴图数据名称。 + * @param textureAtlasName - 贴图集数据名称。 (如果未设置,将检索所有的贴图集数据) + * @version DragonBones 3.0 + * @language zh_CN + */ + PixiFactory.prototype.getTextureDisplay = function (textureName, textureAtlasName) { + if (textureAtlasName === void 0) { textureAtlasName = null; } + var textureData = this._getTextureData(textureAtlasName !== null ? textureAtlasName : "", textureName); + if (textureData !== null && textureData.renderTexture !== null) { + return new PIXI.Sprite(textureData.renderTexture); + } + return null; + }; + Object.defineProperty(PixiFactory.prototype, "soundEventManager", { + /** + * - A global sound event manager. + * Sound events can be listened to uniformly from the manager. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 全局声音事件管理器。 + * 声音事件可以从该管理器统一侦听。 + * @version DragonBones 4.5 + * @language zh_CN + */ + get: function () { + return this._dragonBones.eventManager; + }, + enumerable: true, + configurable: true + }); + PixiFactory._dragonBonesInstance = null; + PixiFactory._factory = null; + /* + * whether use `PIXI.Ticker.shared` + */ + PixiFactory.useSharedTicker = true; + return PixiFactory; + }(dragonBones.BaseFactory)); + dragonBones.PixiFactory = PixiFactory; +})(dragonBones || (dragonBones = {})); diff --git a/Pixi/5.x/out/dragonBones.min.js b/Pixi/5.x/out/dragonBones.min.js new file mode 100644 index 00000000..3c157cb2 --- /dev/null +++ b/Pixi/5.x/out/dragonBones.min.js @@ -0,0 +1 @@ +"use strict";var __extends=this&&this.__extends||function(){var r=function(t,e){r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return r(t,e)};return function(t,e){r(t,e);function a(){this.constructor=t}t.prototype=e===null?Object.create(e):(a.prototype=e.prototype,new a)}}();var dragonBones;(function(o){var t=function(){function e(t){this._clock=new o.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=t;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(t){if(this._objects.length>0){for(var e=0,a=this._objects;e0){for(var i=0;ie){r.length=e}n._maxCountMap[a]=e}else{n._defaultMaxCount=e;for(var a in n._poolsMap){var r=n._poolsMap[a];if(r.length>e){r.length=e}if(a in n._maxCountMap){n._maxCountMap[a]=e}}}};n.clearPool=function(t){if(t===void 0){t=null}if(t!==null){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){a.length=0}}else{for(var r in n._poolsMap){var a=n._poolsMap[r];a.length=0}}};n.borrowObject=function(t){var e=String(t);var a=e in n._poolsMap?n._poolsMap[e]:null;if(a!==null&&a.length>0){var r=a.pop();r._isInPool=false;return r}var i=new t;i._onClear();return i};n.prototype.returnToPool=function(){this._onClear();n._returnObject(this)};n._hashCode=0;n._defaultMaxCount=3e3;n._maxCountMap={};n._poolsMap={};return n}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var a=0;var r=0;var i=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*i;this.ty=-r*n}return this}var s=t*r-e*a;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var u=l+t.width;var f=h+t.height;var _=a*l+i*h+s;var m=r*l+n*h+o;var p=a*u+i*h+s;var c=r*u+n*h+o;var d=a*u+i*f+s;var y=r*u+n*f+o;var v=a*l+i*f+s;var g=r*l+n*f+o;var D=0;if(_>p){D=_;_=p;p=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_v?p:v)-t.x);if(m>c){D=m;m=c;c=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(mg?c:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function n(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;this.scaleY=n}n.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};n.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};n.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};n.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};n.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};n.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};n.prototype.fromMatrix=function(t){var e=this.scaleX,a=this.scaleY;var r=n.PI_Q;this.x=t.tx;this.y=t.ty;this.rotation=Math.atan(t.b/t.a);var i=Math.atan(-t.c/t.d);this.scaleX=this.rotation>-r&&this.rotation-r&&i=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(a>=0&&this.scaleY<0){this.scaleY=-this.scaleY;i=i-Math.PI}this.skew=i-this.rotation;return this};n.prototype.toMatrix=function(t){if(this.rotation===0){t.a=1;t.b=0}else{t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation)}if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}t.tx=this.x;t.ty=this.y;return this};n.PI=Math.PI;n.PI_D=Math.PI*2;n.PI_H=Math.PI/2;n.PI_Q=Math.PI/4;n.RAD_DEG=180/Math.PI;n.DEG_RAD=Math.PI/180;return n}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=a;this.blueMultiplier=r;this.alphaOffset=i;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.ints=[];t.floats=[];t.strings=[];return t}t.toString=function(){return"[class dragonBones.UserData]"};t.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};t.prototype.addInt=function(t){this.ints.push(t)};t.prototype.addFloat=function(t){this.floats.push(t)};t.prototype.addString=function(t){this.strings.push(t)};t.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t=0&&t=0&&t=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};t.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};t.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};t.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};t.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};t.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};t.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};t.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};t.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};t.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};t.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};t.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};t.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};t.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};t.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};t.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return t}(a.BaseObject);a.ArmatureData=t;var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.transform=new a.Transform;t.userData=null;return t}t.toString=function(){return"[class dragonBones.BoneData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return t}(a.BaseObject);a.BoneData=e;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.geometry=new a.GeometryData;return t}t.toString=function(){return"[class dragonBones.SurfaceData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return t}(e);a.SurfaceData=r;var i=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}t.createColor=function(){return new a.ColorTransform};t.toString=function(){return"[class dragonBones.SlotData]"};t.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.zIndex=0;this.alpha=1;this.name="";this.color=null;this.userData=null;this.parent=null};t.DEFAULT_COLOR=new a.ColorTransform;return t}(a.BaseObject);a.SlotData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.order=0;this.name="";this.type=0;this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.scaleEnabled=false;this.bendPositive=false;this.weight=1};return e}(e);t.IKConstraintData=a;var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.bones=[];return t}t.toString=function(){return"[class dragonBones.PathConstraintData]"};t.prototype._onClear=function(){e.prototype._onClear.call(this);this.pathSlot=null;this.pathDisplayData=null;this.bones.length=0;this.positionMode=0;this.spacingMode=1;this.rotateMode=1;this.position=0;this.spacing=0;this.rotateOffset=0;this.rotateMix=0;this.translateMix=0};t.prototype.AddBone=function(t){this.bones.push(t)};return t}(e);t.PathConstraintData=r})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.displays={};return t}t.toString=function(){return"[class dragonBones.SkinData]"};t.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var a=0,r=e;ai){s|=2}if(en){s|=8}return s};D.rectangleIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=t>i&&tn&&ei&&an&&r=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};D.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=this.width*.5;var l=this.height*.5;var h=D.rectangleIntersectsSegment(t,e,a,r,-o,-l,o,l,i,n,s);return h};return D}(e);t.RectangleBoundingBoxData=h;var a=function(t){__extends(l,t);function l(){return t!==null&&t.apply(this,arguments)||this}l.toString=function(){return"[class dragonBones.EllipseData]"};l.ellipseIntersectsSegment=function(t,e,a,r,i,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=s/o;var _=f*f;e*=f;r*=f;var m=a-t;var p=r-e;var c=Math.sqrt(m*m+p*p);var d=m/c;var y=p/c;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var T=s*s;var b=T-D+g;var A=0;if(b>=0){var P=Math.sqrt(b);var S=v-P;var O=v+P;var x=S<0?-1:S<=c?0:1;var B=O<0?-1:O<=c?0:1;var E=x*B;if(E<0){return-1}else if(E===0){if(x===-1){A=2;a=t+O*d;r=(e+O*y)/f;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,a/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*y)/f;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.x=Math.atan2(e/T*_,t/T);u.y=u.x+Math.PI}}else{A=3;if(l!==null){l.x=t+S*d;l.y=(e+S*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+O*d;h.y=(e+O*y)/f;if(u!==null){u.y=Math.atan2(h.y/T*_,h.x/T)}}}}}return A};l.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};l.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};l.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=l.ellipseIntersectsSegment(t,e,a,r,0,0,this.width*.5,this.height*.5,i,n,s);return o};return l}(e);t.EllipseBoundingBoxData=a;var r=function(e){__extends(l,e);function l(){var t=e!==null&&e.apply(this,arguments)||this;t.vertices=[];return t}l.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};l.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var u=e-r;var f=t*r-e*a;var _=0;var m=i[l-2];var p=i[l-1];var c=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var T=0;T=m&&B<=b||B>=b&&B<=m)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var E=(f*S-u*O)/x;if((E>=p&&E<=A||E>=A&&E<=p)&&(u===0||E>=e&&E<=r||E>=r&&E<=e)){if(s!==null){var I=B-t;if(I<0){I=-I}if(_===0){c=I;d=I;y=B;v=E;g=B;D=E;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}}else{if(Id){d=I;g=B;D=E;if(o!==null){o.y=Math.atan2(A-p,b-m)-Math.PI*.5}}}_++}else{y=B;v=E;g=B;D=E;_++;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}break}}}m=b;p=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};l.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};l.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r=e||s=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var a=0,r=this.cacheFrames.length;ae._zIndex*1e3+e._zOrder?1:-1};y.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};y.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};y.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};y.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};y.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};y.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};y.prototype.init=function(t,e,a,r){if(this._armatureData!==null){return}this._armatureData=t;this._animation=i.BaseObject.borrowObject(i.Animation);this._proxy=e;this._display=a;this._dragonBones=r;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};y.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._slotsDirty||this._zIndexDirty){this._slots.sort(y._onSortSlots);if(this._zIndexDirty){for(var a=0,r=this._slots.length;a0){for(var u=0,f=this._actions;u0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r0){if(i!==null||n!==null){if(i!==null){var b=o?i.y-e:i.x-t;if(b<0){b=-b}if(d===null||bh){h=b;_=n.x;m=n.y;y=D;if(s!==null){c=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=u;i.y=f;if(s!==null){s.x=p}}if(y!==null&&n!==null){n.x=_;n.y=m;if(s!==null){s.y=c}}return d};y.prototype.getBone=function(t){for(var e=0,a=this._bones;e=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};t.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};t.prototype.invalidUpdate=function(){this._transformDirty=true};t.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(t.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,a=this._armature.getSlots();e=a){return this.globalTransformMatrix}i=e>this._kX*(t+a)+c;m=((s*o+s+o+o+_)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=_*(l+2);var g=this._hullCache[4];var D=this._hullCache[5];var T=this._hullCache[2]-(o-_)*g;var b=this._hullCache[3]-(o-_)*D;var A=this._vertices;if(i){this._getAffineTransform(-a,c+u,r-a,u,A[v+l+2],A[v+l+3],T+g,b+D,A[v],A[v+1],P._helpTransform,y,true)}else{this._getAffineTransform(-r,c,r-a,u,T,b,A[v],A[v+1],T+g,b+D,P._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else if(t>=a){if(e<-a||e>=a){return this.globalTransformMatrix}i=e>this._kX*(t-r)+c;m=((s*o+s+_)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=(_+1)*(l+2)-2;var g=this._hullCache[4];var D=this._hullCache[5];var T=this._hullCache[0]+_*g;var b=this._hullCache[1]+_*D;var A=this._vertices;if(i){this._getAffineTransform(r,c+u,r-a,u,T+g,b+D,A[v+l+2],A[v+l+3],T,b,P._helpTransform,y,true)}else{this._getAffineTransform(a,c,r-a,u,A[v],A[v+1],T,b,A[v+l+2],A[v+l+3],P._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else if(e<-a){if(t<-a||t>=a){return this.globalTransformMatrix}i=e>this._kY*(t-p-h)-r;m=((s*o+f)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=f*2;var g=this._hullCache[10];var D=this._hullCache[11];var T=this._hullCache[8]+f*g;var b=this._hullCache[9]+f*D;var A=this._vertices;if(i){this._getAffineTransform(p+h,-a,h,r-a,A[v+2],A[v+3],A[v],A[v+1],T+g,b+D,P._helpTransform,y,true)}else{this._getAffineTransform(p,-r,h,r-a,T,b,T+g,b+D,A[v],A[v+1],P._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else if(e>=a){if(t<-a||t>=a){return this.globalTransformMatrix}i=e>this._kY*(t-p-h)+a;m=((s*o+s+o+f)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=o*(l+2)+f*2;var g=this._hullCache[10];var D=this._hullCache[11];var T=this._hullCache[6]-(s-f)*g;var b=this._hullCache[7]-(s-f)*D;var A=this._vertices;if(i){this._getAffineTransform(p+h,r,h,r-a,T+g,b+D,T,b,A[v+2],A[v+3],P._helpTransform,y,true)}else{this._getAffineTransform(p,a,h,r-a,A[v],A[v+1],A[v+2],A[v+3],T,b,P._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}else{i=e>this._k*(t-p-h)+c;m=((s*_+f)*2+(i?1:0))*7;if(d[m]>0){y.copyFromArray(d,m+1)}else{var v=f*2+_*(l+2);var A=this._vertices;if(i){this._getAffineTransform(p+h,c+u,h,u,A[v+l+4],A[v+l+5],A[v+l+2],A[v+l+3],A[v+2],A[v+3],P._helpTransform,y,true)}else{this._getAffineTransform(p,c,h,u,A[v],A[v+1],A[v+2],A[v+3],A[v+l+2],A[v+l+3],P._helpTransform,y,false)}d[m]=1;d[m+1]=y.a;d[m+2]=y.b;d[m+3]=y.c;d[m+4]=y.d;d[m+5]=y.tx;d[m+6]=y.ty}}return y};P.prototype.init=function(t,e){if(this._boneData!==null){return}l.prototype.init.call(this,t,e);var a=t.segmentX;var r=t.segmentY;var i=this._armature.armatureData.parent.intArray[t.geometry.offset+0];var n=1e3;var s=200;this._dX=s*2/a;this._dY=s*2/r;this._k=-this._dY/this._dX;this._kX=-this._dY/(n-s);this._kY=-(n-s)/this._dX;this._vertices.length=i*2;this._deformVertices.length=i*2;this._matrixCahce.length=(a*r+a*2+r*2)*2*7;this._hullCache.length=10;for(var o=0;o=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var a=0,r=this._armature._constraints;a=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n=0;if(this._localDirty){this._updateGlobalTransformMatrix(h)}if(h&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}var u=1e3;var f=200;var _=2*this.global.x;var m=2*this.global.y;var p=P._helpPoint;this.globalTransformMatrix.transformPoint(u,-f,p);this._hullCache[0]=p.x;this._hullCache[1]=p.y;this._hullCache[2]=_-p.x;this._hullCache[3]=m-p.y;this.globalTransformMatrix.transformPoint(0,this._dY,p,true);this._hullCache[4]=p.x;this._hullCache[5]=p.y;this.globalTransformMatrix.transformPoint(f,u,p);this._hullCache[6]=p.x;this._hullCache[7]=p.y;this._hullCache[8]=_-p.x;this._hullCache[9]=m-p.y;this.globalTransformMatrix.transformPoint(this._dX,0,p,true);this._hullCache[10]=p.x;this._hullCache[11]=p.y}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};return P}(t.Bone);t.Surface=e})(dragonBones||(dragonBones={}));var dragonBones;(function(c){var r=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.deformVertices=[];return t}t.toString=function(){return"[class dragonBones.DisplayFrame]"};t.prototype._onClear=function(){this.rawDisplayData=null;this.displayData=null;this.textureData=null;this.display=null;this.deformVertices.length=0};t.prototype.updateDeformVertices=function(){if(this.rawDisplayData===null||this.deformVertices.length!==0){return}var t;if(this.rawDisplayData.type===2){t=this.rawDisplayData.geometry}else if(this.rawDisplayData.type===4){t=this.rawDisplayData.geometry}else{return}var e=0;if(t.weight!==null){e=t.weight.count*2}else{e=t.data.intArray[t.offset+0]*2}this.deformVertices.length=e;for(var a=0,r=this.deformVertices.length;a=0&&this._displayIndex0){for(var s=0,o=i;s=0&&this._cachedFrameIndices!==null){var r=this._cachedFrameIndices[t];if(r>=0&&this._cachedFrameIndex===r){this._transformDirty=false}else if(r>=0){this._transformDirty=true;this._cachedFrameIndex=r}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._transformDirty){if(this._cachedFrameIndex<0){var i=t>=0;this._updateGlobalTransformMatrix(i);if(i&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform();this._transformDirty=false}};p.prototype.invalidUpdate=function(){this._displayDataDirty=true;this._displayDirty=true;this._transformDirty=true};p.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._updateGlobalTransformMatrix(false);this._transformDirty=false}};p.prototype.replaceRawDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.rawDisplayData!==t){a.deformVertices.length=0;a.rawDisplayData=t;if(a.rawDisplayData===null){var r=this._armature._armatureData.defaultSkin;if(r!==null){var i=r.getDisplays(this._slotData.name);if(i!==null&&e=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.displayData!==t&&a.rawDisplayData!==t){a.displayData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};p.prototype.replaceTextureData=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.textureData!==t){a.textureData=t;if(e===this._displayIndex){this._displayDataDirty=true}}};p.prototype.replaceDisplay=function(t,e){if(e===void 0){e=-1}if(e<0){e=this._displayIndex<0?0:this._displayIndex}else if(e>=this._displayFrames.length){return}var a=this._displayFrames[e];if(a.display!==t){var r=a.display;a.display=t;if(r!==null&&r!==this._rawDisplay&&r!==this._meshDisplay&&!this._hasDisplay(r)){if(r instanceof c.Armature){}else{this._disposeDisplay(r,true)}}if(t!==null&&t!==this._rawDisplay&&t!==this._meshDisplay&&!this._hasDisplay(r)&&!(t instanceof c.Armature)){this._initDisplay(t,true)}if(e===this._displayIndex){this._displayDirty=true}}};p.prototype.containsPoint=function(t,e){if(this._boundingBoxData===null){return false}this.updateTransformAndMatrix();p._helpMatrix.copyFrom(this.globalTransformMatrix);p._helpMatrix.invert();p._helpMatrix.transformPoint(t,e,p._helpPoint);return this._boundingBoxData.containsPoint(p._helpPoint.x,p._helpPoint.y)};p.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}if(this._boundingBoxData===null){return 0}this.updateTransformAndMatrix();p._helpMatrix.copyFrom(this.globalTransformMatrix);p._helpMatrix.invert();p._helpMatrix.transformPoint(t,e,p._helpPoint);t=p._helpPoint.x;e=p._helpPoint.y;p._helpMatrix.transformPoint(a,r,p._helpPoint);a=p._helpPoint.x;r=p._helpPoint.y;var o=this._boundingBoxData.intersectsSegment(t,e,a,r,i,n,s);if(o>0){if(o===1||o===2){if(i!==null){this.globalTransformMatrix.transformPoint(i.x,i.y,i);if(n!==null){n.x=i.x;n.y=i.y}}else if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}}else{if(i!==null){this.globalTransformMatrix.transformPoint(i.x,i.y,i)}if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}}if(s!==null){this.globalTransformMatrix.transformPoint(Math.cos(s.x),Math.sin(s.x),p._helpPoint,true);s.x=Math.atan2(p._helpPoint.y,p._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(s.y),Math.sin(s.y),p._helpPoint,true);s.y=Math.atan2(p._helpPoint.y,p._helpPoint.x)}}return o};p.prototype.getDisplayFrameAt=function(t){return this._displayFrames[t]};Object.defineProperty(p.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(p.prototype,"displayFrameCount",{get:function(){return this._displayFrames.length},set:function(t){var e=this._displayFrames.length;if(et){for(var a=e-1;ad){continue}var b=0;for(;;D++){var A=y[D];if(c>A){continue}if(D===0){b=c/A}else{var P=y[D-1];b=(c-P)/(A-P)}break}if(D!==p){p=D;if(u&&D===m){this._computeVertices(_-4,4,0,f);this._computeVertices(0,4,4,f)}else{this._computeVertices(D*6+2,8,0,f)}}this.addCurvePosition(b,f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],l,g,a)}return}if(u){_+=2;f.length=o;this._computeVertices(2,_-4,0,f);this._computeVertices(0,2,_-4,f);f[_-2]=f[0];f[_-1]=f[1]}else{m--;_-=4;f.length=_;this._computeVertices(2,_,0,f)}var S=new Array(m);d=0;var O=f[0],x=f[1],B=0,E=0,I=0,M=0,F=0,w=0;var C,N,R,k,j,L,V,Y;for(var v=0,X=2;vd){continue}for(;;D++){var W=S[D];if(z>W)continue;if(D===0)z/=W;else{var K=S[D-1];z=(z-K)/(W-K)}break}if(D!==p){p=D;var Z=D*6;O=f[Z];x=f[Z+1];B=f[Z+2];E=f[Z+3];I=f[Z+4];M=f[Z+5];F=f[Z+6];w=f[Z+7];C=(O-B*2+I)*.03;N=(x-E*2+M)*.03;R=((B-I)*3-O+F)*.006;k=((E-M)*3-x+w)*.006;j=C*2+R;L=N*2+k;V=(B-O)*.3+C+R*.16666667;Y=(E-x)*.3+N+k*.16666667;G=Math.sqrt(V*V+Y*Y);U[0]=G;for(Z=1;Z<8;Z++){V+=j;Y+=L;j+=R;L+=k;G+=Math.sqrt(V*V+Y*Y);U[Z]=G}V+=j;Y+=L;G+=Math.sqrt(V*V+Y*Y);U[8]=G;V+=j+R;Y+=L+k;G+=Math.sqrt(V*V+Y*Y);U[9]=G;H=0}z*=G;for(;;H++){var q=U[H];if(z>q)continue;if(H===0)z/=q;else{var K=U[H-1];z=H+(z-K)/(q-K)}break}this.addCurvePosition(z*.1,O,x,B,E,I,M,F,w,l,g,a)}};t.prototype.addCurvePosition=function(t,e,a,r,i,n,s,o,l,h,u,f){if(t===0){h[u]=e;h[u+1]=a;h[u+2]=0;return}if(t===1){h[u]=o;h[u+1]=l;h[u+2]=0;return}var _=1-t;var m=_*_;var p=t*t;var c=m*_;var d=m*t*3;var y=_*p*3;var v=t*p;var g=c*e+d*r+y*n+v*o;var D=c*a+d*i+y*s+v*l;h[u]=g;h[u+1]=D;if(f){h[u+2]=Math.atan2(D-(c*a+d*i+y*s),g-(c*e+d*r+y*n))}else{h[u+2]=0}};t.prototype.init=function(t,e){this._constraintData=t;this._armature=e;var a=t;this.pathOffset=a.pathDisplayData.geometry.offset;this.position=a.position;this.spacing=a.spacing;this.rotateOffset=a.rotateOffset;this.rotateMix=a.rotateMix;this.translateMix=a.translateMix;this._root=this._armature.getBone(a.root.name);this._target=this._armature.getBone(a.target.name);this._pathSlot=this._armature.getSlot(a.pathSlot.name);for(var r=0,i=a.bones.length;r0?X.Transform.DEG_RAD:-X.Transform.DEG_RAD}}var x=this.rotateMix;var B=this.translateMix;for(var p=0,E=3;p0){var C=v.a,N=v.b,R=v.c,k=v.d,j=void 0,L=void 0,V=void 0;if(h){j=b[E-1]}else{j=Math.atan2(M,I)}j-=Math.atan2(N,C);if(O){L=Math.cos(j);V=Math.sin(j);var Y=d._boneData.length;P+=(Y*(L*C-V*N)-I)*x;S+=(Y*(V*C+L*N)-M)*x}else{j+=A}if(j>X.Transform.PI){j-=X.Transform.PI_D}else if(j<-X.Transform.PI){j+=X.Transform.PI_D}j*=x;L=Math.cos(j);V=Math.sin(j);v.a=L*C-V*N;v.b=V*C+L*N;v.c=L*R-V*k;v.d=V*R+L*k}d.global.fromMatrix(v)}this.dirty=false};t.prototype.invalidUpdate=function(){};return t}(t);X.PathConstraint=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=0}this.time=0;this.timeScale=1;this._systemTime=0;this._animatebles=[];this._clock=null;this.time=t;this._systemTime=(new Date).getTime()*.001}t.prototype.advanceTime=function(t){if(t!==t){t=0}var e=Date.now()*.001;if(t<0){t=e-this._systemTime}this._systemTime=e;if(this.timeScale!==1){t*=this.timeScale}if(t===0){return}if(t<0){this.time-=t}else{this.time+=t}var a=0,r=0,i=this._animatebles.length;for(;a0){this._animatebles[a-r]=n;this._animatebles[a]=null}n.advanceTime(t)}else{r++}}if(r>0){i=this._animatebles.length;for(;a=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t0&&n._subFadeState>0){this._armature._dragonBones.bufferObject(n);this._animationStates.length=0;this._lastAnimationState=null}else{var s=n.animationData;var o=s.cacheFrameRate;if(this._animationDirty&&o>0){this._animationDirty=false;for(var l=0,h=this._armature.getBones();l0){var p=m.getDisplayFrameAt(0).rawDisplayData;if(p!==null&&p.parent===this._armature.armatureData.defaultSkin){m._cachedFrameIndices=s.getSlotCachedFrameIndices(m.name);continue}}m._cachedFrameIndices=null}}n.advanceTime(t,o)}}else if(i>1){for(var c=0,d=0;c0&&n._subFadeState>0){d++;this._armature._dragonBones.bufferObject(n);this._animationDirty=true;if(this._lastAnimationState===n){this._lastAnimationState=null}}else{if(d>0){this._animationStates[c-d]=n}n.advanceTime(t,0)}if(c===i-1&&d>0){this._animationStates.length-=d;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};t.prototype.reset=function(){for(var t=0,e=this._animationStates;t0){if(t.position<0){t.position%=a.duration;t.position=a.duration-t.position}else if(t.position===a.duration){t.position-=1e-6}else if(t.position>a.duration){t.position%=a.duration}if(t.duration>0&&t.position+t.duration>a.duration){t.duration=a.duration-t.position}if(t.playTimes<0){t.playTimes=a.playTimes}}else{t.playTimes=1;t.position=0;if(t.duration>0){t.duration=0}}if(t.duration===0){t.duration=-1}this._fadeOut(t);var s=g.BaseObject.borrowObject(g.AnimationState);s.init(this._armature,a,t);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var o=false;for(var l=0,h=this._animationStates.length;lthis._animationStates[l].layer){o=true;this._animationStates.splice(l,0,s);break}else if(l!==h-1&&s.layer>this._animationStates[l+1].layer){o=true;this._animationStates.splice(l+1,0,s);break}}if(!o){this._animationStates.push(s)}}else{this._animationStates.push(s)}for(var u=0,f=this._armature.getSlots();u0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var a=this._armature.armatureData.defaultAnimation;if(a!==null){this._animationConfig.animation=a.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};t.prototype.fadeIn=function(t,e,a,r,i,n){if(e===void 0){e=-1}if(a===void 0){a=-1}if(r===void 0){r=0}if(i===void 0){i=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=a;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=i!==null?i:"";return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByTime=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByFrame=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.frameCount>0?r.duration*e/r.frameCount:0}return this.playConfig(this._animationConfig)};t.prototype.gotoAndPlayByProgress=function(t,e,a){if(e===void 0){e=0}if(a===void 0){a=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=a;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};t.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByTime(t,e,1);if(a!==null){a.stop()}return a};t.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByFrame(t,e,1);if(a!==null){a.stop()}return a};t.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var a=this.gotoAndPlayByProgress(t,e,1);if(a!==null){a.stop()}return a};t.prototype.getBlendState=function(t,e,a){if(!(t in this._blendStates)){this._blendStates[t]={}}var r=this._blendStates[t];if(!(e in r)){var i=r[e]=g.BaseObject.borrowObject(g.BlendState);i.target=a}return r[e]};t.prototype.getState=function(t,e){if(e===void 0){e=-1}var a=this._animationStates.length;while(a--){var r=this._animationStates[a];if(r.name===t&&(e<0||r.layer===e)){return r}}return null};t.prototype.hasAnimation=function(t){return t in this._animations};t.prototype.getStates=function(){return this._animationStates};Object.defineProperty(t.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});return t}(g.BaseObject);g.Animation=t})(dragonBones||(dragonBones={}));var dragonBones;(function(L){var t=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t._boneMask=[];t._boneTimelines=[];t._boneBlendTimelines=[];t._slotTimelines=[];t._slotBlendTimelines=[];t._constraintTimelines=[];t._animationTimelines=[];t._poseTimelines=[];t._actionTimeline=null;t._zOrderTimeline=null;return t}t.toString=function(){return"[class dragonBones.AnimationState]"};t.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t=0){this._boneTimelines.splice(v,1);r.returnToPool()}v=this._boneBlendTimelines.indexOf(r);if(v>=0){this._boneBlendTimelines.splice(v,1);r.returnToPool()}}}}{var g={};var D=[];for(var T=0,b=this._slotTimelines;T=0){this._slotTimelines.splice(v,1);r.returnToPool()}v=this._slotBlendTimelines.indexOf(r);if(v>=0){this._slotBlendTimelines.splice(v,1);r.returnToPool()}}}}};t.prototype._advanceFadeTime=function(t){var e=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var a=this._parent===null&&this.actionEnabled;if(a){var r=e?L.EventObject.FADE_OUT:L.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=L.BaseObject.borrowObject(L.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}}if(t<0){t=-t}this._fadeTime+=t;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=e?0:1}else if(this._fadeTime>0){this._fadeProgress=e?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=e?1:0}if(this._subFadeState>0){if(!e){this._playheadState|=1;this._fadeState=0}var a=this._parent===null&&this.actionEnabled;if(a){var r=e?L.EventObject.FADE_OUT_COMPLETE:L.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(r)){var i=L.BaseObject.borrowObject(L.EventObject);i.type=r;i.armature=this._armature;i.animationState=this;this._armature._dragonBones.bufferEvent(i)}}}};t.prototype.init=function(t,e,a){if(this._armature!==null){return}this._armature=t;this._animationData=e;this.resetToPose=a.resetToPose;this.additive=a.additive;this.displayControl=a.displayControl;this.actionEnabled=a.actionEnabled;this.blendType=e.blendType;this.layer=a.layer;this.playTimes=a.playTimes;this.timeScale=a.timeScale;this.fadeTotalTime=a.fadeInTime;this.autoFadeOutTime=a.autoFadeOutTime;this.name=a.name.length>0?a.name:a.animation;this.group=a.group;this._weight=a.weight;if(a.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(a.duration<0){this._position=0;this._duration=this._animationData.duration;if(a.position!==0){if(this.timeScale>=0){this._time=a.position}else{this._time=a.position-this._duration}}else{this._time=0}}else{this._position=a.position;this._duration=a.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(a.boneMask.length>0){this._boneMask.length=a.boneMask.length;for(var r=0,i=this._boneMask.length;r0;var i=true;var n=true;var s=this._time;this._weightResult=this._weight*this._fadeProgress;if(this._parent!==null){this._weightResult*=this._parent._weightResult}if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(this._weight===0){return}if(r){var o=e*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*e);if(this._armature._cacheFrameIndex===l){i=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(i){var h=false;var u=null;if(n){for(var f=0,_=this._boneTimelines.length;f<_;++f){var m=this._boneTimelines[f];if(m.playState<=0){m.update(s)}if(m.target!==u){var p=m.target;h=p.update(this);u=p;if(p.dirty===1){var c=p.target.animationPose;c.x=0;c.y=0;c.rotation=0;c.skew=0;c.scaleX=1;c.scaleY=1}}if(h){m.blend(a)}}}for(var f=0,_=this._boneBlendTimelines.length;f<_;++f){var m=this._boneBlendTimelines[f];if(m.playState<=0){m.update(s)}if(m.target.update(this)){m.blend(a)}}if(this.displayControl){for(var f=0,_=this._slotTimelines.length;f<_;++f){var m=this._slotTimelines[f];if(m.playState<=0){var d=m.target;var y=d.displayController;if(y===null||y===this.name||y===this.group){m.update(s)}}}}for(var f=0,_=this._slotBlendTimelines.length;f<_;++f){var m=this._slotBlendTimelines[f];if(m.playState<=0){var p=m.target;m.update(s);if(p.update(this)){m.blend(a)}}}for(var f=0,_=this._constraintTimelines.length;f<_;++f){var m=this._constraintTimelines[f];if(m.playState<=0){m.update(s)}}if(this._animationTimelines.length>0){var v=100;var g=100;var D=null;var T=null;for(var f=0,_=this._animationTimelines.length;f<_;++f){var m=this._animationTimelines[f];if(m.playState<=0){m.update(s)}if(this.blendType===1){var b=m.target;var A=this.parameterX-b.positionX;if(A>=0){if(A0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var P=0,S=this._poseTimelines;P=0){this._boneTimelines.splice(O,1);m.returnToPool();continue}O=this._boneBlendTimelines.indexOf(m);if(O>=0){this._boneBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._slotTimelines.indexOf(m);if(O>=0){this._slotTimelines.splice(O,1);m.returnToPool();continue}O=this._slotBlendTimelines.indexOf(m);if(O>=0){this._slotBlendTimelines.splice(O,1);m.returnToPool();continue}O=this._constraintTimelines.indexOf(m);if(O>=0){this._constraintTimelines.splice(O,1);m.returnToPool();continue}}this._poseTimelines.length=0}}if(this._actionTimeline.playState>0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};t.prototype.play=function(){this._playheadState=3};t.prototype.stop=function(){this._playheadState&=1};t.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var a=0,r=this._boneTimelines;a1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};t.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};t.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var a=this._armature.getBone(t);if(a===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,i=this._armature.getBones();r=0){this._boneMask.splice(a,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var i=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=i;n=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,u=i;h0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration0&&e===this.playTimes-1&&t===this._duration&&this._parent===null){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var a=0,r=this._boneTimelines;a0){if(this.leftWeight>0){if(this.layer!==e){if(this.layerWeight>=this.leftWeight){this.dirty++;this.layer=e;this.leftWeight=0;this.blendWeight=0;return false}this.layer=e;this.leftWeight-=this.layerWeight;this.layerWeight=0}a*=this.leftWeight;this.dirty++;this.blendWeight=a;this.layerWeight+=this.blendWeight;return true}return false}this.dirty++;this.layer=e;this.leftWeight=1;this.blendWeight=a;this.layerWeight=a;return true};e.prototype.reset=function(){this.dirty=0;this.layer=0;this.leftWeight=0;this.layerWeight=0;this.blendWeight=0};e.BONE_TRANSFORM="boneTransform";e.BONE_ALPHA="boneAlpha";e.SURFACE="surface";e.SLOT_DEFORM="slotDeform";e.SLOT_ALPHA="slotAlpha";e.SLOT_Z_INDEX="slotZIndex";return e}(L.BaseObject);L.BlendState=V})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.dirty=false;this.playState=-1;this.currentPlayTimes=0;this.currentTime=-1;this.target=null;this._isTween=false;this._valueOffset=0;this._frameValueOffset=0;this._frameOffset=0;this._frameRate=0;this._frameCount=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._valueArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var a=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var i=this._animationState.playTimes;var n=i*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(i>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=i;if(t<0){this.currentTime=0}else{this.currentTime=this.playState===1?this._duration+1e-6:this._duration}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===a&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==a){this._frameIndex=-1}return true};e.prototype.init=function(t,e,a){this._armature=t;this._animationState=e;this._timelineData=a;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState.animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;if(this._timelineData!==null){var r=this._animationData.parent.parent;this._frameArray=r.frameArray;this._timelineArray=r.timelineArray;this._frameIndices=r.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){this.dirty=false};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var a=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==a){this._frameIndex=a;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._isTween||this.dirty){this._onUpdateFrame()}}};e.prototype.blend=function(t){};return e}(t.BaseObject);t.TimelineState=e;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,a){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*a+e};e._getEasingCurveValue=function(t,e,a,r){if(t<=0){return 0}else if(t>=1){return 1}var i=a>0;var n=a+1;var s=Math.floor(t*n);var o=0;var l=0;if(i){o=s===0?0:e[r+s-1];l=s===n-1?1e4:e[r+s]}else{o=e[r+s-1];l=e[r+s]}return(o+(l-o)*(t*n-s))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenEasing=0;this._tweenProgress=0;this._valueScale=1};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this.dirty=true;this._isTween=false}};e.prototype._onUpdateFrame=function(){if(this._isTween){this.dirty=true;this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}};return e}(e);t.TweenTimelineState=a;var r=function(i){__extends(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}t.prototype._onClear=function(){i.prototype._onClear.call(this);this._current=0;this._difference=0;this._result=0};t.prototype._onArriveAtFrame=function(){i.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._valueScale;var e=this._valueArray;var a=this._valueOffset+this._frameValueOffset+this._frameIndex;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:a+1;if(t===1){this._current=e[a];this._difference=e[r]-this._current}else{this._current=e[a]*t;this._difference=e[r]*t-this._current}}else{this._result=e[a]*t}}else{this._result=0}};t.prototype._onUpdateFrame=function(){i.prototype._onUpdateFrame.call(this);if(this._isTween){this._result=this._current+this._difference*this._tweenProgress}};return t}(a);t.SingleValueTimelineState=r;var i=function(i){__extends(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}t.prototype._onClear=function(){i.prototype._onClear.call(this);this._currentA=0;this._currentB=0;this._differenceA=0;this._differenceB=0;this._resultA=0;this._resultB=0};t.prototype._onArriveAtFrame=function(){i.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._valueScale;var e=this._valueArray;var a=this._valueOffset+this._frameValueOffset+this._frameIndex*2;if(this._isTween){var r=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:a+2;if(t===1){this._currentA=e[a];this._currentB=e[a+1];this._differenceA=e[r]-this._currentA;this._differenceB=e[r+1]-this._currentB}else{this._currentA=e[a]*t;this._currentB=e[a+1]*t;this._differenceA=e[r]*t-this._currentA;this._differenceB=e[r+1]*t-this._currentB}}else{this._resultA=e[a]*t;this._resultB=e[a+1]*t}}else{this._resultA=0;this._resultB=0}};t.prototype._onUpdateFrame=function(){i.prototype._onUpdateFrame.call(this);if(this._isTween){this._resultA=this._currentA+this._differenceA*this._tweenProgress;this._resultB=this._currentB+this._differenceB*this._tweenProgress}};return t}(a);t.DoubleValueTimelineState=i;var n=function(o){__extends(t,o);function t(){var t=o!==null&&o.apply(this,arguments)||this;t._rd=[];return t}t.prototype._onClear=function(){o.prototype._onClear.call(this);this._valueCount=0;this._rd.length=0};t.prototype._onArriveAtFrame=function(){o.prototype._onArriveAtFrame.call(this);var t=this._valueCount;var e=this._rd;if(this._timelineData!==null){var a=this._valueScale;var r=this._valueArray;var i=this._valueOffset+this._frameValueOffset+this._frameIndex*t;if(this._isTween){var n=this._frameIndex===this._frameCount-1?this._valueOffset+this._frameValueOffset:i+t;if(a===1){for(var s=0;s0){if(n.hasDBEventListener(y.EventObject.COMPLETE)){h=y.BaseObject.borrowObject(y.EventObject);h.type=y.EventObject.COMPLETE;h.armature=this._armature;h.animationState=this._animationState}}}if(this._frameCount>1){var u=this._timelineData;var f=Math.floor(this.currentTime*this._frameRate);var _=this._frameIndices[u.frameIndicesOffset+f];if(this._frameIndex!==_){var m=this._frameIndex;this._frameIndex=_;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[u.offset+5+this._frameIndex];if(o){if(m<0){var p=Math.floor(r*this._frameRate);m=this._frameIndices[u.frameIndicesOffset+p];if(this.currentPlayTimes===a){if(m===_){m=-1}}}while(m>=0){var c=this._animationData.frameOffset+this._timelineArray[u.offset+5+m];var d=this._frameArray[c]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(m)}if(l!==null&&m===0){this._armature._dragonBones.bufferEvent(l);l=null}if(m>0){m--}else{m=this._frameCount-1}if(m===_){break}}}else{if(m<0){var p=Math.floor(r*this._frameRate);m=this._frameIndices[u.frameIndicesOffset+p];var c=this._animationData.frameOffset+this._timelineArray[u.offset+5+m];var d=this._frameArray[c]/this._frameRate;if(this.currentPlayTimes===a){if(r<=d){if(m>0){m--}else{m=this._frameCount-1}}else if(m===_){m=-1}}}while(m>=0){if(m=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(y.TimelineState);y.ZOrderTimelineState=e;var a=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._rd[2]=y.Transform.normalizeRadian(this._rd[2]);this._rd[3]=y.Transform.normalizeRadian(this._rd[3])}if(this._timelineData===null){this._rd[4]=1;this._rd[5]=1}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=6;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.fadeOut=function(){this.dirty=false;this._rd[2]=y.Transform.normalizeRadian(this._rd[2]);this._rd[3]=y.Transform.normalizeRadian(this._rd[3])};t.prototype.blend=function(t){var e=this._armature.armatureData.scale;var a=this._rd;var r=this.target;var i=r.target;var n=r.blendWeight;var s=i.animationPose;if(r.dirty>1){s.x+=a[0]*n*e;s.y+=a[1]*n*e;s.rotation+=a[2]*n;s.skew+=a[3]*n;s.scaleX+=(a[4]-1)*n;s.scaleY+=(a[5]-1)*n}else{s.x=a[0]*n*e;s.y=a[1]*n*e;s.rotation=a[2]*n;s.skew=a[3]*n;s.scaleX=(a[4]-1)*n+1;s.scaleY=(a[5]-1)*n+1}if(t||this.dirty){this.dirty=false;i._transformDirty=true}};return t}(y.MutilpleValueTimelineState);y.BoneAllTimelineState=a;var r=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.x+=this._resultA*r;i.y+=this._resultB*r}else if(r!==1){i.x=this._resultA*r;i.y=this._resultB*r}else{i.x=this._resultA;i.y=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneTranslateTimelineState=r;var i=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._isTween&&this._frameIndex===this._frameCount-1){this._differenceA=y.Transform.normalizeRadian(this._differenceA);this._differenceB=y.Transform.normalizeRadian(this._differenceB)}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.fadeOut=function(){this.dirty=false;this._resultA=y.Transform.normalizeRadian(this._resultA);this._resultB=y.Transform.normalizeRadian(this._resultB)};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.rotation+=this._resultA*r;i.skew+=this._resultB*r}else if(r!==1){i.rotation=this._resultA*r;i.skew=this._resultB*r}else{i.rotation=this._resultA;i.skew=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneRotateTimelineState=i;var n=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){this._resultA=1;this._resultB=1}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameFloatOffset;this._valueArray=this._animationData.parent.parent.frameFloatArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a.animationPose;if(e.dirty>1){i.scaleX+=(this._resultA-1)*r;i.scaleY+=(this._resultB-1)*r}else if(r!==1){i.scaleX=(this._resultA-1)*r+1;i.scaleY=(this._resultB-1)*r+1}else{i.scaleX=this._resultA;i.scaleY=this._resultB}if(t||this.dirty){this.dirty=false;a._transformDirty=true}};return t}(y.DoubleValueTimelineState);y.BoneScaleTimelineState=n;var s=function(s){__extends(t,s);function t(){return s!==null&&s.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.SurfaceTimelineState]"};t.prototype._onClear=function(){s.prototype._onClear.call(this);this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};t.prototype.init=function(t,e,a){s.prototype.init.call(this,t,e,a);if(this._timelineData!==null){var r=this._animationData.parent.parent;var i=r.frameIntArray;var n=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this._valueOffset=this._animationData.frameFloatOffset;this._valueCount=i[n+2];this._deformCount=i[n+1];this._deformOffset=i[n+3];this._sameValueOffset=i[n+4]+this._animationData.frameFloatOffset;this._valueScale=this._armature.armatureData.scale;this._valueArray=r.frameFloatArray;this._rd.length=this._valueCount*2}else{this._deformCount=this.target.target._deformVertices.length}};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;var i=a._deformVertices;var n=this._valueArray;if(n!==null){var s=this._valueCount;var o=this._deformOffset;var l=this._sameValueOffset;var h=this._rd;for(var u=0;u1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u1){a._alpha+=this._result*r;if(a._alpha>1){a._alpha=1}}else{a._alpha=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._alphaDirty=true}};return t}(y.SingleValueTimelineState);y.AlphaTimelineState=o;var l=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotDisplayTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this.target;var e=this._timelineData!==null?this._frameArray[this._frameOffset+1]:t._slotData.displayIndex;if(t.displayIndex!==e){t._setDisplayIndex(e,true)}}};e.prototype._onUpdateFrame=function(){};return e}(y.TimelineState);y.SlotDisplayTimelineState=l;var h=function(o){__extends(t,o);function t(){var t=o!==null&&o.apply(this,arguments)||this;t._current=[0,0,0,0,0,0,0,0];t._difference=[0,0,0,0,0,0,0,0];t._result=[0,0,0,0,0,0,0,0];return t}t.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};t.prototype._onArriveAtFrame=function(){o.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.parent.parent;var e=t.colorArray;var a=t.frameIntArray;var r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex;var i=a[r];if(i<0){i+=65536}if(this._isTween){this._current[0]=e[i++];this._current[1]=e[i++];this._current[2]=e[i++];this._current[3]=e[i++];this._current[4]=e[i++];this._current[5]=e[i++];this._current[6]=e[i++];this._current[7]=e[i++];if(this._frameIndex===this._frameCount-1){i=a[this._animationData.frameIntOffset+this._frameValueOffset]}else{i=a[r+1]}if(i<0){i+=65536}this._difference[0]=e[i++]-this._current[0];this._difference[1]=e[i++]-this._current[1];this._difference[2]=e[i++]-this._current[2];this._difference[3]=e[i++]-this._current[3];this._difference[4]=e[i++]-this._current[4];this._difference[5]=e[i++]-this._current[5];this._difference[6]=e[i++]-this._current[6];this._difference[7]=e[i++]-this._current[7]}else{this._result[0]=e[i++]*.01;this._result[1]=e[i++]*.01;this._result[2]=e[i++]*.01;this._result[3]=e[i++]*.01;this._result[4]=e[i++];this._result[5]=e[i++];this._result[6]=e[i++];this._result[7]=e[i++]}}else{var n=this.target;var s=n.slotData.color;this._result[0]=s.alphaMultiplier;this._result[1]=s.redMultiplier;this._result[2]=s.greenMultiplier;this._result[3]=s.blueMultiplier;this._result[4]=s.alphaOffset;this._result[5]=s.redOffset;this._result[6]=s.greenOffset;this._result[7]=s.blueOffset}};t.prototype._onUpdateFrame=function(){o.prototype._onUpdateFrame.call(this);if(this._isTween){this._result[0]=(this._current[0]+this._difference[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._difference[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._difference[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._difference[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._difference[4]*this._tweenProgress;this._result[5]=this._current[5]+this._difference[5]*this._tweenProgress;this._result[6]=this._current[6]+this._difference[6]*this._tweenProgress;this._result[7]=this._current[7]+this._difference[7]*this._tweenProgress}};t.prototype.fadeOut=function(){this._isTween=false};t.prototype.update=function(t){o.prototype.update.call(this,t);if(this._isTween||this.dirty){var e=this.target;var a=e._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);a.alphaMultiplier+=(this._result[0]-a.alphaMultiplier)*r;a.redMultiplier+=(this._result[1]-a.redMultiplier)*r;a.greenMultiplier+=(this._result[2]-a.greenMultiplier)*r;a.blueMultiplier+=(this._result[3]-a.blueMultiplier)*r;a.alphaOffset+=(this._result[4]-a.alphaOffset)*r;a.redOffset+=(this._result[5]-a.redOffset)*r;a.greenOffset+=(this._result[6]-a.greenOffset)*r;a.blueOffset+=(this._result[7]-a.blueOffset)*r;e._colorDirty=true}}else if(this.dirty){this.dirty=false;if(a.alphaMultiplier!==this._result[0]||a.redMultiplier!==this._result[1]||a.greenMultiplier!==this._result[2]||a.blueMultiplier!==this._result[3]||a.alphaOffset!==this._result[4]||a.redOffset!==this._result[5]||a.greenOffset!==this._result[6]||a.blueOffset!==this._result[7]){a.alphaMultiplier=this._result[0];a.redMultiplier=this._result[1];a.greenMultiplier=this._result[2];a.blueMultiplier=this._result[3];a.alphaOffset=this._result[4];a.redOffset=this._result[5];a.greenOffset=this._result[6];a.blueOffset=this._result[7];e._colorDirty=true}}}};return t}(y.TweenTimelineState);y.SlotColorTimelineState=h;var u=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.SlotZIndexTimelineState]"};t.prototype._onArriveAtFrame=function(){r.prototype._onArriveAtFrame.call(this);if(this._timelineData===null){var t=this.target;var e=t.target;this._result=e.slotData.zIndex}};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueArray=this._animationData.parent.parent.frameIntArray};t.prototype.blend=function(t){var e=this.target;var a=e.target;var r=e.blendWeight;if(e.dirty>1){a._zIndex+=this._result*r}else{a._zIndex=this._result*r}if(t||this.dirty){this.dirty=false;this._armature._zIndexDirty=true}};return t}(y.SingleValueTimelineState);y.SlotZIndexTimelineState=u;var f=function(f){__extends(t,f);function t(){return f!==null&&f.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.DeformTimelineState]"};t.prototype._onClear=function(){f.prototype._onClear.call(this);this.geometryOffset=0;this.displayFrame=null;this._deformCount=0;this._deformOffset=0;this._sameValueOffset=0};t.prototype.init=function(t,e,a){f.prototype.init.call(this,t,e,a);if(this._timelineData!==null){var r=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];var i=this._animationData.parent.parent;var n=i.frameIntArray;var s=this.target.target;this.geometryOffset=n[r+0];if(this.geometryOffset<0){this.geometryOffset+=65536}for(var o=0,l=s.displayFrameCount;o1){i[u]+=f*r}else{i[u]=f*r}}}else if(e.dirty===1){for(var u=0;u0;t._weight=this._currentB}else{var e=t._constraintData;t._bendPositive=e.bendPositive;t._weight=e.weight}t.invalidUpdate();this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=.01;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.DoubleValueTimelineState);y.IKConstraintTimelineState=_;var m=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationProgressTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.currentTime=this._result*t.totalTime}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.SingleValueTimelineState);y.AnimationProgressTimelineState=m;var p=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationWeightTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.weight=this._result}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.SingleValueTimelineState);y.AnimationWeightTimelineState=p;var c=function(r){__extends(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}t.toString=function(){return"[class dragonBones.AnimationParametersTimelineState]"};t.prototype._onUpdateFrame=function(){r.prototype._onUpdateFrame.call(this);var t=this.target;if(t._parent!==null){t.parameterX=this._resultA;t.parameterY=this._resultB}this.dirty=false};t.prototype.init=function(t,e,a){r.prototype.init.call(this,t,e,a);this._valueOffset=this._animationData.frameIntOffset;this._valueScale=1e-4;this._valueArray=this._animationData.parent.parent.frameIntArray};return t}(y.DoubleValueTimelineState);y.AnimationParametersTimelineState=c})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.actionDataToInstance=function(t,e,a){if(t.type===0){e.type=r.FRAME_EVENT}else{e.type=t.type===10?r.FRAME_EVENT:r.SOUND_EVENT}e.name=t.name;e.armature=a;e.actionData=t;e.data=t.data;if(t.bone!==null){e.bone=a.getBone(t.bone.name)}if(t.slot!==null){e.slot=a.getSlot(t.slot.name)}};r.toString=function(){return"[class dragonBones.EventObject]"};r.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.actionData=null;this.data=null};r.START="start";r.LOOP_COMPLETE="loopComplete";r.COMPLETE="complete";r.FADE_IN="fadeIn";r.FADE_IN_COMPLETE="fadeInComplete";r.FADE_OUT="fadeOut";r.FADE_OUT_COMPLETE="fadeOutComplete";r.FRAME_EVENT="frameEvent";r.SOUND_EVENT="soundEvent";return r}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(){}t._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};t._getBoneType=function(t){switch(t.toLowerCase()){case"bone":return 0;case"surface":return 1;default:return 0}};t._getPositionMode=function(t){switch(t.toLocaleLowerCase()){case"percent":return 1;case"fixed":return 0;default:return 1}};t._getSpacingMode=function(t){switch(t.toLocaleLowerCase()){case"length":return 0;case"percent":return 2;case"fixed":return 1;default:return 0}};t._getRotateMode=function(t){switch(t.toLocaleLowerCase()){case"tangent":return 0;case"chain":return 1;case"chainscale":return 2;default:return 0}};t._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;case"path":return 4;default:return 0}};t._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};t._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};t._getAnimationBlendType=function(t){switch(t.toLowerCase()){case"none":return 0;case"1d":return 1;default:return 0}};t._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};t.DATA_VERSION_2_3="2.3";t.DATA_VERSION_3_0="3.0";t.DATA_VERSION_4_0="4.0";t.DATA_VERSION_4_5="4.5";t.DATA_VERSION_5_0="5.0";t.DATA_VERSION_5_5="5.5";t.DATA_VERSION_5_6="5.6";t.DATA_VERSION=t.DATA_VERSION_5_6;t.DATA_VERSIONS=[t.DATA_VERSION_4_0,t.DATA_VERSION_4_5,t.DATA_VERSION_5_0,t.DATA_VERSION_5_5,t.DATA_VERSION_5_6];t.TEXTURE_ATLAS="textureAtlas";t.SUB_TEXTURE="SubTexture";t.FORMAT="format";t.IMAGE_PATH="imagePath";t.WIDTH="width";t.HEIGHT="height";t.ROTATED="rotated";t.FRAME_X="frameX";t.FRAME_Y="frameY";t.FRAME_WIDTH="frameWidth";t.FRAME_HEIGHT="frameHeight";t.DRADON_BONES="dragonBones";t.USER_DATA="userData";t.ARMATURE="armature";t.CANVAS="canvas";t.BONE="bone";t.SURFACE="surface";t.SLOT="slot";t.CONSTRAINT="constraint";t.SKIN="skin";t.DISPLAY="display";t.FRAME="frame";t.IK="ik";t.PATH_CONSTRAINT="path";t.ANIMATION="animation";t.TIMELINE="timeline";t.FFD="ffd";t.TRANSLATE_FRAME="translateFrame";t.ROTATE_FRAME="rotateFrame";t.SCALE_FRAME="scaleFrame";t.DISPLAY_FRAME="displayFrame";t.COLOR_FRAME="colorFrame";t.DEFAULT_ACTIONS="defaultActions";t.ACTIONS="actions";t.EVENTS="events";t.INTS="ints";t.FLOATS="floats";t.STRINGS="strings";t.TRANSFORM="transform";t.PIVOT="pivot";t.AABB="aabb";t.COLOR="color";t.VERSION="version";t.COMPATIBLE_VERSION="compatibleVersion";t.FRAME_RATE="frameRate";t.TYPE="type";t.SUB_TYPE="subType";t.NAME="name";t.PARENT="parent";t.TARGET="target";t.STAGE="stage";t.SHARE="share";t.PATH="path";t.LENGTH="length";t.DISPLAY_INDEX="displayIndex";t.Z_ORDER="zOrder";t.Z_INDEX="zIndex";t.BLEND_MODE="blendMode";t.INHERIT_TRANSLATION="inheritTranslation";t.INHERIT_ROTATION="inheritRotation";t.INHERIT_SCALE="inheritScale";t.INHERIT_REFLECTION="inheritReflection";t.INHERIT_ANIMATION="inheritAnimation";t.INHERIT_DEFORM="inheritDeform";t.SEGMENT_X="segmentX";t.SEGMENT_Y="segmentY";t.BEND_POSITIVE="bendPositive";t.CHAIN="chain";t.WEIGHT="weight";t.BLEND_TYPE="blendType";t.FADE_IN_TIME="fadeInTime";t.PLAY_TIMES="playTimes";t.SCALE="scale";t.OFFSET="offset";t.POSITION="position";t.DURATION="duration";t.TWEEN_EASING="tweenEasing";t.TWEEN_ROTATE="tweenRotate";t.TWEEN_SCALE="tweenScale";t.CLOCK_WISE="clockwise";t.CURVE="curve";t.SOUND="sound";t.EVENT="event";t.ACTION="action";t.X="x";t.Y="y";t.SKEW_X="skX";t.SKEW_Y="skY";t.SCALE_X="scX";t.SCALE_Y="scY";t.VALUE="value";t.ROTATE="rotate";t.SKEW="skew";t.ALPHA="alpha";t.ALPHA_OFFSET="aO";t.RED_OFFSET="rO";t.GREEN_OFFSET="gO";t.BLUE_OFFSET="bO";t.ALPHA_MULTIPLIER="aM";t.RED_MULTIPLIER="rM";t.GREEN_MULTIPLIER="gM";t.BLUE_MULTIPLIER="bM";t.UVS="uvs";t.VERTICES="vertices";t.TRIANGLES="triangles";t.WEIGHTS="weights";t.SLOT_POSE="slotPose";t.BONE_POSE="bonePose";t.BONES="bones";t.POSITION_MODE="positionMode";t.SPACING_MODE="spacingMode";t.ROTATE_MODE="rotateMode";t.SPACING="spacing";t.ROTATE_OFFSET="rotateOffset";t.ROTATE_MIX="rotateMix";t.TRANSLATE_MIX="translateMix";t.TARGET_DISPLAY="targetDisplay";t.CLOSED="closed";t.CONSTANT_SPEED="constantSpeed";t.VERTEX_COUNT="vertexCount";t.LENGTHS="lengths";t.GOTO_AND_PLAY="gotoAndPlay";t.DEFAULT_NAME="default";return t}();t.DataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(tt){var t=function(e){__extends($,e);function $(){var t=e!==null&&e.apply(this,arguments)||this;t._rawTextureAtlasIndex=0;t._rawBones=[];t._data=null;t._armature=null;t._bone=null;t._geometry=null;t._slot=null;t._skin=null;t._mesh=null;t._animation=null;t._timeline=null;t._rawTextureAtlases=null;t._frameValueType=0;t._defaultColorOffset=-1;t._prevClockwise=0;t._prevRotation=0;t._frameDefaultValue=0;t._frameValueScale=1;t._helpMatrixA=new tt.Matrix;t._helpMatrixB=new tt.Matrix;t._helpTransform=new tt.Transform;t._helpColorTransform=new tt.ColorTransform;t._helpPoint=new tt.Point;t._helpArray=[];t._intArray=[];t._floatArray=[];t._frameIntArray=[];t._frameFloatArray=[];t._frameArray=[];t._timelineArray=[];t._colorArray=[];t._cacheRawMeshes=[];t._cacheMeshes=[];t._actionFrames=[];t._weightSlotPose={};t._weightBonePoses={};t._cacheBones={};t._slotChildActions={};return t}$._getBoolean=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="boolean"){return r}else if(i==="string"){switch(r){case"0":case"NaN":case"":case"false":case"null":case"undefined":return false;default:return true}}else{return!!r}}return a};$._getNumber=function(t,e,a){if(e in t){var r=t[e];if(r===null||r==="NaN"){return a}return+r||0}return a};$._getString=function(t,e,a){if(e in t){var r=t[e];var i=typeof r;if(i==="string"){return r}return String(r)}return a};$.prototype._getCurvePoint=function(t,e,a,r,i,n,s,o,l,h){var u=1-l;var f=u*u;var _=l*l;var m=u*f;var p=3*l*f;var c=3*u*_;var d=l*_;h.x=m*t+p*a+c*i+d*s;h.y=m*e+p*r+c*n+d*o};$.prototype._samplingEasingCurve=function(t,e){var a=t.length;if(a%3===1){var r=-2;for(var i=0,n=e.length;i=0&&r+61e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return true}else{var r=0;for(var i=0,n=e.length;i1e-4){var v=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,m,p,c,v,this._helpPoint);if(s-this._helpPoint.x>0){d=v}else{y=v}}e[i]=this._helpPoint.y}return false}};$.prototype._parseActionDataInFrame=function(t,e,a,r){if(tt.DataParser.EVENT in t){this._mergeActionFrame(t[tt.DataParser.EVENT],e,10,a,r)}if(tt.DataParser.SOUND in t){this._mergeActionFrame(t[tt.DataParser.SOUND],e,11,a,r)}if(tt.DataParser.ACTION in t){this._mergeActionFrame(t[tt.DataParser.ACTION],e,0,a,r)}if(tt.DataParser.EVENTS in t){this._mergeActionFrame(t[tt.DataParser.EVENTS],e,10,a,r)}if(tt.DataParser.ACTIONS in t){this._mergeActionFrame(t[tt.DataParser.ACTIONS],e,0,a,r)}};$.prototype._mergeActionFrame=function(t,e,a,r,i){var n=this._armature.actions.length;var s=this._parseActionData(t,a,r,i);var o=0;var l=null;for(var h=0,u=s;he){break}o++}if(l===null){l=new D;l.frameStart=e;this._actionFrames.splice(o,0,l)}for(var c=0;c0){var _=a.getBone(u);if(_!==null){f.parent=_}else{if(!(u in this._cacheBones)){this._cacheBones[u]=[]}this._cacheBones[u].push(f)}}if(f.name in this._cacheBones){for(var m=0,p=this._cacheBones[f.name];m0&&e.parent!==null){i.root=e.parent;i.bone=e}else{i.root=e;i.bone=null}return i};$.prototype._parsePathConstraint=function(t){var e=this._armature.getSlot($._getString(t,tt.DataParser.TARGET,""));if(e===null){return null}var a=this._armature.defaultSkin;if(a===null){return null}var r=a.getDisplay(e.name,$._getString(t,tt.DataParser.TARGET_DISPLAY,e.name));if(r===null||!(r instanceof tt.PathDisplayData)){return null}var i=t[tt.DataParser.BONES];if(i===null||i.length===0){return null}var n=tt.BaseObject.borrowObject(tt.PathConstraintData);n.name=$._getString(t,tt.DataParser.NAME,"");n.type=1;n.pathSlot=e;n.pathDisplayData=r;n.target=e.parent;n.positionMode=tt.DataParser._getPositionMode($._getString(t,tt.DataParser.POSITION_MODE,""));n.spacingMode=tt.DataParser._getSpacingMode($._getString(t,tt.DataParser.SPACING_MODE,""));n.rotateMode=tt.DataParser._getRotateMode($._getString(t,tt.DataParser.ROTATE_MODE,""));n.position=$._getNumber(t,tt.DataParser.POSITION,0);n.spacing=$._getNumber(t,tt.DataParser.SPACING,0);n.rotateOffset=$._getNumber(t,tt.DataParser.ROTATE_OFFSET,0);n.rotateMix=$._getNumber(t,tt.DataParser.ROTATE_MIX,1);n.translateMix=$._getNumber(t,tt.DataParser.TRANSLATE_MIX,1);for(var s=0,o=i;s0?a:e;this._parsePivot(t,n);break}case 1:{var s=i=tt.BaseObject.borrowObject(tt.ArmatureDisplayData);s.name=e;s.path=a.length>0?a:e;s.inheritAnimation=true;if(tt.DataParser.ACTIONS in t){var o=this._parseActionData(t[tt.DataParser.ACTIONS],0,null,null);for(var l=0,h=o;l0?a:e;if(tt.DataParser.SHARE in t){p.geometry.data=this._data;this._cacheRawMeshes.push(t);this._cacheMeshes.push(p)}else{this._parseMesh(t,p)}break}case 3:{var c=this._parseBoundingBox(t);if(c!==null){var d=i=tt.BaseObject.borrowObject(tt.BoundingBoxDisplayData);d.name=e;d.path=a.length>0?a:e;d.boundingBox=c}break}case 4:{var y=t[tt.DataParser.LENGTHS];var v=i=tt.BaseObject.borrowObject(tt.PathDisplayData);v.closed=$._getBoolean(t,tt.DataParser.CLOSED,false);v.constantSpeed=$._getBoolean(t,tt.DataParser.CONSTANT_SPEED,false);v.name=e;v.path=a.length>0?a:e;v.curveLengths.length=y.length;for(var g=0,D=y.length;ge.width){e.width=o}if(le.height){e.height=l}}}e.width-=e.x;e.height-=e.y}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return e};$.prototype._parseAnimation=function(t){var e=tt.BaseObject.borrowObject(tt.AnimationData);e.blendType=tt.DataParser._getAnimationBlendType($._getString(t,tt.DataParser.BLEND_TYPE,""));e.frameCount=$._getNumber(t,tt.DataParser.DURATION,0);e.playTimes=$._getNumber(t,tt.DataParser.PLAY_TIMES,1);e.duration=e.frameCount/this._armature.frameRate;e.fadeInTime=$._getNumber(t,tt.DataParser.FADE_IN_TIME,0);e.scale=$._getNumber(t,tt.DataParser.SCALE,1);e.name=$._getString(t,tt.DataParser.NAME,tt.DataParser.DEFAULT_NAME);if(e.name.length===0){e.name=tt.DataParser.DEFAULT_NAME}e.frameIntOffset=this._frameIntArray.length;e.frameFloatOffset=this._frameFloatArray.length;e.frameOffset=this._frameArray.length;this._animation=e;if(tt.DataParser.FRAME in t){var a=t[tt.DataParser.FRAME];var r=a.length;if(r>0){for(var i=0,n=0;i0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,0,0,this._parseActionFrame);this._actionFrames.length=0}if(tt.DataParser.TIMELINE in t){var o=t[tt.DataParser.TIMELINE];for(var A=0,P=o;A0&&a in t){e=t[a]}if(e===null){return null}var l=e.length;if(l===0){return null}var h=this._frameIntArray.length;var u=this._frameFloatArray.length;var f=this._timelineArray.length;if(o===null){o=tt.BaseObject.borrowObject(tt.TimelineData)}o.type=r;o.offset=f;this._frameValueType=i;this._timeline=o;this._timelineArray.length+=1+1+1+1+1+l;if(t!==null){this._timelineArray[f+0]=Math.round($._getNumber(t,tt.DataParser.SCALE,1)*100);this._timelineArray[f+1]=Math.round($._getNumber(t,tt.DataParser.OFFSET,0)*100)}else{this._timelineArray[f+0]=100;this._timelineArray[f+1]=0}this._timelineArray[f+2]=l;this._timelineArray[f+3]=n;switch(this._frameValueType){case 0:this._timelineArray[f+4]=0;break;case 1:this._timelineArray[f+4]=h-this._animation.frameIntOffset;break;case 2:this._timelineArray[f+4]=u-this._animation.frameFloatOffset;break}if(l===1){o.frameIndicesOffset=-1;this._timelineArray[f+5+0]=s.call(this,e[0],0,0)-this._animation.frameOffset}else{var _=this._animation.frameCount+1;var m=this._data.frameIndices;var p=m.length;m.length+=_;o.frameIndicesOffset=p;for(var c=0,d=0,y=0,v=0;c<_;++c){if(y+v<=c&&d0){if(tt.DataParser.CURVE in t){var i=a+1;this._helpArray.length=i;var n=this._samplingEasingCurve(t[tt.DataParser.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[r+1]=2;this._frameArray[r+2]=n?i:-i;for(var s=0;s0){var n=this._armature.sortedSlots.length;var s=new Array(n-i.length/2);var o=new Array(n);for(var l=0;l0?r>=this._prevRotation:r<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}r=this._prevRotation+r-this._prevRotation+tt.Transform.PI_D*this._prevClockwise}}this._prevClockwise=$._getNumber(t,tt.DataParser.TWEEN_ROTATE,0);this._prevRotation=r;var i=this._parseTweenFrame(t,e,a);var n=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[n++]=this._helpTransform.x;this._frameFloatArray[n++]=this._helpTransform.y;this._frameFloatArray[n++]=r;this._frameFloatArray[n++]=this._helpTransform.skew;this._frameFloatArray[n++]=this._helpTransform.scaleX;this._frameFloatArray[n++]=this._helpTransform.scaleY;this._parseActionDataInFrame(t,e,this._bone,this._slot);return i};$.prototype._parseBoneTranslateFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.X,0);this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.Y,0);return r};$.prototype._parseBoneRotateFrame=function(t,e,a){var r=$._getNumber(t,tt.DataParser.ROTATE,0)*tt.Transform.DEG_RAD;if(e!==0){if(this._prevClockwise===0){r=this._prevRotation+tt.Transform.normalizeRadian(r-this._prevRotation)}else{if(this._prevClockwise>0?r>=this._prevRotation:r<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}r=this._prevRotation+r-this._prevRotation+tt.Transform.PI_D*this._prevClockwise}}this._prevClockwise=$._getNumber(t,tt.DataParser.CLOCK_WISE,0);this._prevRotation=r;var i=this._parseTweenFrame(t,e,a);var n=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[n++]=r;this._frameFloatArray[n++]=$._getNumber(t,tt.DataParser.SKEW,0)*tt.Transform.DEG_RAD;return i};$.prototype._parseBoneScaleFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.X,1);this._frameFloatArray[i++]=$._getNumber(t,tt.DataParser.Y,1);return r};$.prototype._parseSlotDisplayFrame=function(t,e,a){var r=this._parseFrame(t,e,a);this._frameArray.length+=1;if(tt.DataParser.VALUE in t){this._frameArray[r+1]=$._getNumber(t,tt.DataParser.VALUE,0)}else{this._frameArray[r+1]=$._getNumber(t,tt.DataParser.DISPLAY_INDEX,0)}this._parseActionDataInFrame(t,e,this._slot.parent,this._slot);return r};$.prototype._parseSlotColorFrame=function(t,e,a){var r=this._parseTweenFrame(t,e,a);var i=-1;if(tt.DataParser.VALUE in t||tt.DataParser.COLOR in t){var n=tt.DataParser.VALUE in t?t[tt.DataParser.VALUE]:t[tt.DataParser.COLOR];for(var s in n){s;this._parseColorTransform(n,this._helpColorTransform);i=this._colorArray.length;this._colorArray.length+=8;this._colorArray[i++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.redMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._colorArray[i++]=Math.round(this._helpColorTransform.alphaOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.redOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.greenOffset);this._colorArray[i++]=Math.round(this._helpColorTransform.blueOffset);i-=8;break}}if(i<0){if(this._defaultColorOffset<0){this._defaultColorOffset=i=this._colorArray.length;this._colorArray.length+=8;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=100;this._colorArray[i++]=0;this._colorArray[i++]=0;this._colorArray[i++]=0;this._colorArray[i++]=0}i=this._defaultColorOffset}var o=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[o]=i;return r};$.prototype._parseSlotDeformFrame=function(t,e,a){var r=this._frameFloatArray.length;var i=this._parseTweenFrame(t,e,a);var n=tt.DataParser.VERTICES in t?t[tt.DataParser.VERTICES]:null;var s=$._getNumber(t,tt.DataParser.OFFSET,0);var o=this._intArray[this._mesh.geometry.offset+0];var l=this._mesh.parent.name+"_"+this._slot.name+"_"+this._mesh.name;var h=this._mesh.geometry.weight;var u=0;var f=0;var _=0;var m=0;if(h!==null){var p=this._weightSlotPose[l];this._helpMatrixA.copyFromArray(p,0);this._frameFloatArray.length+=h.count*2;_=h.offset+2+h.bones.length}else{this._frameFloatArray.length+=o*2}for(var c=0;c=n.length){u=0}else{u=n[c-s]}if(c+1=n.length){f=0}else{f=n[c+1-s]}}if(h!==null){var d=this._weightBonePoses[l];var y=this._intArray[_++];this._helpMatrixA.transformPoint(u,f,this._helpPoint,true);u=this._helpPoint.x;f=this._helpPoint.y;for(var v=0;v=n.length){h=0}else{h=n[f-s]}if(f+1=n.length){u=0}else{u=n[f+1-s]}}else{h=0;u=0}this._frameFloatArray[r+f]=h;this._frameFloatArray[r+f+1]=u}}if(e===0){var _=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[_+0]=this._geometry.offset;this._frameIntArray[_+1]=this._frameFloatArray.length-r;this._frameIntArray[_+2]=this._frameFloatArray.length-r;this._frameIntArray[_+3]=0;this._frameIntArray[_+4]=r-this._animation.frameFloatOffset;this._timelineArray[this._timeline.offset+3]=_-this._animation.frameIntOffset}return i};$.prototype._parseTransform=function(t,e,a){e.x=$._getNumber(t,tt.DataParser.X,0)*a;e.y=$._getNumber(t,tt.DataParser.Y,0)*a;if(tt.DataParser.ROTATE in t||tt.DataParser.SKEW in t){e.rotation=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.ROTATE,0)*tt.Transform.DEG_RAD);e.skew=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW,0)*tt.Transform.DEG_RAD)}else if(tt.DataParser.SKEW_X in t||tt.DataParser.SKEW_Y in t){e.rotation=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW_Y,0)*tt.Transform.DEG_RAD);e.skew=tt.Transform.normalizeRadian($._getNumber(t,tt.DataParser.SKEW_X,0)*tt.Transform.DEG_RAD)-e.rotation}e.scaleX=$._getNumber(t,tt.DataParser.SCALE_X,1);e.scaleY=$._getNumber(t,tt.DataParser.SCALE_Y,1)};$.prototype._parseColorTransform=function(t,e){e.alphaMultiplier=$._getNumber(t,tt.DataParser.ALPHA_MULTIPLIER,100)*.01;e.redMultiplier=$._getNumber(t,tt.DataParser.RED_MULTIPLIER,100)*.01;e.greenMultiplier=$._getNumber(t,tt.DataParser.GREEN_MULTIPLIER,100)*.01;e.blueMultiplier=$._getNumber(t,tt.DataParser.BLUE_MULTIPLIER,100)*.01;e.alphaOffset=$._getNumber(t,tt.DataParser.ALPHA_OFFSET,0);e.redOffset=$._getNumber(t,tt.DataParser.RED_OFFSET,0);e.greenOffset=$._getNumber(t,tt.DataParser.GREEN_OFFSET,0);e.blueOffset=$._getNumber(t,tt.DataParser.BLUE_OFFSET,0)};$.prototype._parseGeometry=function(t,e){var a=t[tt.DataParser.VERTICES];var r=Math.floor(a.length/2);var i=0;var n=this._intArray.length;var s=this._floatArray.length;e.offset=n;e.data=this._data;this._intArray.length+=1+1+1+1;this._intArray[n+0]=r;this._intArray[n+2]=s;this._intArray[n+3]=-1;this._floatArray.length+=r*2;for(var o=0,l=r*2;o=0||tt.DataParser.DATA_VERSIONS.indexOf(r)>=0){var i=tt.BaseObject.borrowObject(tt.DragonBonesData);i.version=a;i.name=$._getString(t,tt.DataParser.NAME,"");i.frameRate=$._getNumber(t,tt.DataParser.FRAME_RATE,24);if(i.frameRate===0){i.frameRate=24}if(tt.DataParser.ARMATURE in t){this._data=i;this._parseArray(t);var n=t[tt.DataParser.ARMATURE];for(var s=0,o=n;s0){i.stage=i.getArmature(i.armatureNames[0])}this._data=null}if(tt.DataParser.TEXTURE_ATLAS in t){this._rawTextureAtlases=t[tt.DataParser.TEXTURE_ATLAS]}return i}else{console.assert(false,"Nonsupport data version: "+a+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};$.prototype.parseTextureAtlasData=function(t,e,a){if(a===void 0){a=1}console.assert(t!==undefined);if(t===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var r=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(r,e,a);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}e.width=$._getNumber(t,tt.DataParser.WIDTH,0);e.height=$._getNumber(t,tt.DataParser.HEIGHT,0);e.scale=a===1?1/$._getNumber(t,tt.DataParser.SCALE,1):a;e.name=$._getString(t,tt.DataParser.NAME,"");e.imagePath=$._getString(t,tt.DataParser.IMAGE_PATH,"");if(tt.DataParser.SUB_TEXTURE in t){var i=t[tt.DataParser.SUB_TEXTURE];for(var n=0,s=i.length;n0&&h>0){u.frame=tt.TextureData.createRectangle();u.frame.x=$._getNumber(o,tt.DataParser.FRAME_X,0);u.frame.y=$._getNumber(o,tt.DataParser.FRAME_Y,0);u.frame.width=l;u.frame.height=h}e.addTexture(u)}}return true};$.getInstance=function(){if($._objectDataParserInstance===null){$._objectDataParserInstance=new $}return $._objectDataParserInstance};$._objectDataParserInstance=null;return $}(tt.DataParser);tt.ObjectDataParser=t;var D=function(){function t(){this.frameStart=0;this.actions=[]}return t}();tt.ActionFrame=D})(dragonBones||(dragonBones={}));var dragonBones;(function(g){var t=function(o){__extends(t,o);function t(){return o!==null&&o.apply(this,arguments)||this}t.prototype._inRange=function(t,e,a){return e<=t&&t<=a};t.prototype._decodeUTF8=function(t){var e=-1;var a=-1;var r=65533;var i=0;var n="";var s;var o=0;var l=0;var h=0;var u=0;while(t.length>i){var f=t[i++];if(f===e){if(l!==0){s=r}else{s=a}}else{if(l===0){if(this._inRange(f,0,127)){s=f}else{if(this._inRange(f,194,223)){l=1;u=128;o=f-192}else if(this._inRange(f,224,239)){l=2;u=2048;o=f-224}else if(this._inRange(f,240,244)){l=3;u=65536;o=f-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(f,128,191)){o=0;l=0;h=0;u=0;i--;s=f}else{h+=1;o=o+(f-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var m=u;o=0;l=0;h=0;u=0;if(this._inRange(_,m,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=f}}}}if(s!==null&&s!==a){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};t.prototype._parseBinaryTimeline=function(t,e,a){if(a===void 0){a=null}var r=a!==null?a:g.BaseObject.borrowObject(g.TimelineData);r.type=t;r.offset=e;this._timeline=r;var i=this._timelineArrayBuffer[r.offset+2];if(i===1){r.frameIndicesOffset=-1}else{var n=0;var s=this._animation.frameCount+1;var o=this._data.frameIndices;n=o.length;o.length+=s;r.frameIndicesOffset=n;for(var l=0,h=0,u=0,f=0;l=0){var h=g.ObjectDataParser._getNumber(d,g.DataParser.TYPE,0);var y=g.ObjectDataParser._getString(d,g.DataParser.NAME,"");var f=null;if(h===40&&e.blendType!==0){f=g.BaseObject.borrowObject(g.AnimationTimelineData);var v=f;v.x=g.ObjectDataParser._getNumber(d,g.DataParser.X,0);v.y=g.ObjectDataParser._getNumber(d,g.DataParser.Y,0)}f=this._parseBinaryTimeline(h,u,f);switch(h){case 0:break;case 1:break;case 11:case 12:case 13:case 50:case 60:this._animation.addBoneTimeline(y,f);break;case 20:case 21:case 22:case 23:case 24:this._animation.addSlotTimeline(y,f);break;case 30:this._animation.addConstraintTimeline(y,f);break;case 40:case 41:case 42:this._animation.addAnimationTimeline(y,f);break}}}}this._animation=null;return e};t.prototype._parseGeometry=function(t,e){e.offset=t[g.DataParser.OFFSET];e.data=this._data;var a=this._intArrayBuffer[e.offset+3];if(a>=0){var r=g.BaseObject.borrowObject(g.WeightData);var i=this._intArrayBuffer[e.offset+0];var n=this._intArrayBuffer[a+0];r.offset=a;for(var s=0;s12?e[13]:0;var h=new Int16Array(this._binary,this._binaryOffset+e[0],a/Int16Array.BYTES_PER_ELEMENT);var u=new Float32Array(this._binary,this._binaryOffset+e[2],r/Float32Array.BYTES_PER_ELEMENT);var f=new Int16Array(this._binary,this._binaryOffset+e[4],i/Int16Array.BYTES_PER_ELEMENT);var _=new Float32Array(this._binary,this._binaryOffset+e[6],n/Float32Array.BYTES_PER_ELEMENT);var m=new Int16Array(this._binary,this._binaryOffset+e[8],s/Int16Array.BYTES_PER_ELEMENT);var p=new Uint16Array(this._binary,this._binaryOffset+e[10],o/Uint16Array.BYTES_PER_ELEMENT);var c=l>0?new Int16Array(this._binary,this._binaryOffset+e[12],l/Int16Array.BYTES_PER_ELEMENT):h;this._data.binary=this._binary;this._data.intArray=this._intArrayBuffer=h;this._data.floatArray=u;this._data.frameIntArray=f;this._data.frameFloatArray=_;this._data.frameArray=this._frameArrayBuffer=m;this._data.timelineArray=this._timelineArrayBuffer=p;this._data.colorArray=c};t.prototype.parseDragonBonesData=function(t,e){if(e===void 0){e=1}console.assert(t!==null&&t!==undefined&&t instanceof ArrayBuffer,"Data error.");var a=new Uint8Array(t,0,8);if(a[0]!=="D".charCodeAt(0)||a[1]!=="B".charCodeAt(0)||a[2]!=="D".charCodeAt(0)||a[3]!=="T".charCodeAt(0)){console.assert(false,"Nonsupport data.");return null}var r=new Uint32Array(t,8,1)[0];var i=new Uint8Array(t,8+4,r);var n=this._decodeUTF8(i);var s=JSON.parse(n);this._binaryOffset=8+4+r;this._binary=t;return o.prototype.parseDragonBonesData.call(this,s,e)};t.getInstance=function(){if(t._binaryDataParserInstance===null){t._binaryDataParserInstance=new t}return t._binaryDataParserInstance};t._binaryDataParserInstance=null;return t}(g.ObjectDataParser);g.BinaryDataParser=t})(dragonBones||(dragonBones={}));var dragonBones;(function(y){var t=function(){function s(t){if(t===void 0){t=null}this.autoSearch=false;this._dragonBonesDataMap={};this._textureAtlasDataMap={};this._dragonBones=null;this._dataParser=null;if(s._objectParser===null){s._objectParser=new y.ObjectDataParser}if(s._binaryParser===null){s._binaryParser=new y.BinaryDataParser}this._dataParser=t!==null?t:s._objectParser}s.prototype._isSupportMesh=function(){return true};s.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap){for(var a=0,r=this._textureAtlasDataMap[t];a0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(a)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(a);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=i;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};s.prototype._buildBones=function(t,e){for(var a=0,r=t.armature.sortedBones;a0){var c=this._getTextureData(t.textureAtlasName,p.path);f.replaceTextureData(c,_)}var d=this._getSlotDisplay(t,p,f);f.replaceDisplay(d,_)}else{f.replaceDisplay(null)}}}f._setDisplayIndex(h.displayIndex,true)}};s.prototype._buildConstraints=function(t,e){var a=t.armature.constraints;for(var r in a){var i=a[r];switch(i.type){case 0:var n=y.BaseObject.borrowObject(y.IKConstraint);n.init(i,e);e._addConstraint(n);break;case 1:var s=y.BaseObject.borrowObject(y.PathConstraint);s.init(i,e);e._addConstraint(s);break;default:var o=y.BaseObject.borrowObject(y.IKConstraint);o.init(i,e);e._addConstraint(o);break}}};s.prototype._buildChildArmature=function(t,e,a){return this.buildArmature(a.path,t!==null?t.dataName:"","",t!==null?t.textureAtlasName:"")};s.prototype._getSlotDisplay=function(t,e,a){var r=t!==null?t.dataName:e.parent.parent.parent.name;var i=null;switch(e.type){case 0:{var n=e;if(n.texture===null){n.texture=this._getTextureData(r,e.path)}i=a.rawDisplay;break}case 2:{var s=e;if(s.texture===null){s.texture=this._getTextureData(r,s.path)}if(this._isSupportMesh()){i=a.meshDisplay}else{i=a.rawDisplay}break}case 1:{var o=e;var l=this._buildChildArmature(t,a,o);if(l!==null){l.inheritAnimation=o.inheritAnimation;if(!l.inheritAnimation){var h=o.actions.length>0?o.actions:l.armatureData.defaultActions;if(h.length>0){for(var u=0,f=h;u=0){continue}var h=e.getDisplays(l.name);if(h===null){if(n!==null&&e!==n){h=n.getDisplays(l.name)}if(h===null){if(a){l.displayFrameCount=0}continue}}l.displayFrameCount=h.length;for(var u=0,f=l.displayFrameCount;u0};t.prototype.addDBEventListener=function(t,e,a){this.addListener(t,e,a)};t.prototype.removeDBEventListener=function(t,e,a){this.removeListener(t,e,a)};Object.defineProperty(t.prototype,"armature",{get:function(){return this._armature},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"animation",{get:function(){return this._armature.animation},enumerable:true,configurable:true});return t}(PIXI.Sprite);b.PixiArmatureDisplay=t})(dragonBones||(dragonBones={}));var dragonBones;(function(b){var t=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.PixiSlot]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._textureScale=1;this._renderDisplay=null;this._updateTransform=PIXI.VERSION[0]==="3"?this._updateTransformV3:this._updateTransformV4};e.prototype._initDisplay=function(t,e){t;e};e.prototype._disposeDisplay=function(t,e){t;if(!e){t.destroy()}};e.prototype._onUpdateDisplay=function(){this._renderDisplay=this._display?this._display:this._rawDisplay};e.prototype._addDisplay=function(){var t=this._armature.display;t.addChild(this._renderDisplay)};e.prototype._replaceDisplay=function(t){var e=this._armature.display;var a=t;e.addChild(this._renderDisplay);e.swapChildren(this._renderDisplay,a);e.removeChild(a);this._textureScale=1};e.prototype._removeDisplay=function(){this._renderDisplay.parent.removeChild(this._renderDisplay)};e.prototype._updateZOrder=function(){var t=this._armature.display;var e=t.getChildIndex(this._renderDisplay);if(e===this._zOrder){return}t.addChildAt(this._renderDisplay,this._zOrder)};e.prototype._updateVisible=function(){this._renderDisplay.visible=this._parent.visible&&this._visible};e.prototype._updateBlendMode=function(){if(this._renderDisplay instanceof PIXI.Sprite){switch(this._blendMode){case 0:this._renderDisplay.blendMode=PIXI.BLEND_MODES.NORMAL;break;case 1:this._renderDisplay.blendMode=PIXI.BLEND_MODES.ADD;break;case 3:this._renderDisplay.blendMode=PIXI.BLEND_MODES.DARKEN;break;case 4:this._renderDisplay.blendMode=PIXI.BLEND_MODES.DIFFERENCE;break;case 6:this._renderDisplay.blendMode=PIXI.BLEND_MODES.HARD_LIGHT;break;case 9:this._renderDisplay.blendMode=PIXI.BLEND_MODES.LIGHTEN;break;case 10:this._renderDisplay.blendMode=PIXI.BLEND_MODES.MULTIPLY;break;case 11:this._renderDisplay.blendMode=PIXI.BLEND_MODES.OVERLAY;break;case 12:this._renderDisplay.blendMode=PIXI.BLEND_MODES.SCREEN;break;default:break}}};e.prototype._updateColor=function(){var t=this._colorTransform.alphaMultiplier*this._globalAlpha;this._renderDisplay.alpha=t;if(this._renderDisplay instanceof PIXI.Sprite||this._renderDisplay instanceof PIXI.SimpleMesh){var e=(Math.round(this._colorTransform.redMultiplier*255)<<16)+(Math.round(this._colorTransform.greenMultiplier*255)<<8)+Math.round(this._colorTransform.blueMultiplier*255);this._renderDisplay.tint=e}};e.prototype._updateFrame=function(){var t=this._textureData;if(this._displayIndex>=0&&this._display!==null&&t!==null){var e=t.parent;if(this._armature.replacedTexture!==null){if(this._armature._replaceTextureAtlasData===null){e=b.BaseObject.borrowObject(b.PixiTextureAtlasData);e.copyFrom(t.parent);e.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=e}else{e=this._armature._replaceTextureAtlasData}t=e.getTexture(t.name)}var a=t.renderTexture;if(a!==null){if(this._geometryData!==null){var r=this._geometryData.data;var i=r.intArray;var n=r.floatArray;var s=i[this._geometryData.offset+0];var o=i[this._geometryData.offset+1];var l=i[this._geometryData.offset+2];if(l<0){l+=65536}var h=l+s*2;var u=this._armature._armatureData.scale;var f=this._renderDisplay;var _=new Float32Array(s*2);var m=new Float32Array(s*2);var p=new Uint16Array(o*3);for(var c=0,d=s*2;c0&&r.inheritDeform;var s=this._renderDisplay;if(i!==null){var o=r.data;var l=o.intArray;var h=o.floatArray;var u=l[r.offset+0];var f=l[i.offset+1];if(f<0){f+=65536}for(var _=0,m=0,p=i.offset+2+a.length,c=f,d=0;_ 0; + + + } + /** + * @inheritDoc + */ + public addDBEventListener(type: EventStringType, listener: (event: EventObject) => void, target: any): void { + this.addListener(type as any, listener as any, target); + } + /** + * @inheritDoc + */ + public removeDBEventListener(type: EventStringType, listener: (event: EventObject) => void, target: any): void { + this.removeListener(type as any, listener as any, target); + } + /** + * @inheritDoc + */ + public get armature(): Armature { + return this._armature; + } + /** + * @inheritDoc + */ + public get animation(): Animation { + return this._armature.animation; + } + } +} diff --git a/Pixi/5.x/src/dragonBones/pixi/PixiFactory.ts b/Pixi/5.x/src/dragonBones/pixi/PixiFactory.ts new file mode 100644 index 00000000..defc83c8 --- /dev/null +++ b/Pixi/5.x/src/dragonBones/pixi/PixiFactory.ts @@ -0,0 +1,213 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace dragonBones { + /** + * - The PixiJS factory. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 工厂。 + * @version DragonBones 3.0 + * @language zh_CN + */ + export class PixiFactory extends BaseFactory { + private static _dragonBonesInstance: DragonBones = null as any; + private static _factory: PixiFactory = null as any; + private static _clockHandler(passedTime: number): void { + this._dragonBonesInstance.advanceTime((passedTime / PIXI.settings.TARGET_FPMS) * 0.001); + } + + /* + * `passedTime` is elapsed time, specified in seconds. + */ + public static advanceTime(passedTime: number): void { + this._dragonBonesInstance.advanceTime(passedTime); + } + + /* + * whether use `PIXI.Ticker.shared` + */ + public static useSharedTicker: boolean = true; + + /** + * - A global factory instance that can be used directly. + * @version DragonBones 4.7 + * @language en_US + */ + /** + * - 一个可以直接使用的全局工厂实例。 + * @version DragonBones 4.7 + * @language zh_CN + */ + public static get factory(): PixiFactory { + if (PixiFactory._factory === null) { + PixiFactory._factory = new PixiFactory(null, PixiFactory.useSharedTicker); + } + + return PixiFactory._factory; + } + + /** + * - 一个获取全局工厂实例(单例)的方法, 和get factory相比, 优点是可以传参数。 + * @version DragonBones 4.7 + * @language zh_CN + */ + public static newInstance(useSharedTicker = true): PixiFactory { + if (PixiFactory._factory === null) { + PixiFactory._factory = new PixiFactory(null, useSharedTicker); + } + + return PixiFactory._factory; + } + /** + * @inheritDoc + */ + public constructor(dataParser: DataParser | null = null, useSharedTicker = true) { + super(dataParser); + + if (PixiFactory._dragonBonesInstance === null) { + const eventManager = new PixiArmatureDisplay(PIXI.Texture.EMPTY); + PixiFactory._dragonBonesInstance = new DragonBones(eventManager); + if (useSharedTicker) { + PIXI.Ticker.shared.add(PixiFactory._clockHandler, PixiFactory); + } + } + + this._dragonBones = PixiFactory._dragonBonesInstance; + } + + protected _buildTextureAtlasData(textureAtlasData: PixiTextureAtlasData | null, textureAtlas: PIXI.BaseTexture | null): PixiTextureAtlasData { + if (textureAtlasData) { + textureAtlasData.renderTexture = textureAtlas; + } + else { + textureAtlasData = BaseObject.borrowObject(PixiTextureAtlasData); + } + + return textureAtlasData; + } + + protected _buildArmature(dataPackage: BuildArmaturePackage): Armature { + const armature = BaseObject.borrowObject(Armature); + const armatureDisplay = new PixiArmatureDisplay(PIXI.Texture.EMPTY); + + armature.init( + dataPackage.armature, + armatureDisplay, armatureDisplay, this._dragonBones + ); + + return armature; + } + + protected _buildSlot(_dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot { + const slot = BaseObject.borrowObject(PixiSlot); + slot.init( + slotData, armature, + new PIXI.Sprite(PIXI.Texture.EMPTY), new PIXI.SimpleMesh() + ); + + return slot; + } + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it. + * The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature display container. + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + *
+         *     let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
+         * 
+ * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架,并用 {@link #clock} 更新该骨架。 + * 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。 (如果未设置,则使用默认的皮肤数据) + * @returns 骨架的显示容器。 + * @see dragonBones.IArmatureProxy + * @see dragonBones.BaseFactory#buildArmature + * @version DragonBones 4.5 + * @example + *
+         *     let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
+         * 
+ * @language zh_CN + */ + public buildArmatureDisplay(armatureName: string, dragonBonesName: string = "", skinName: string = "", textureAtlasName: string = ""): PixiArmatureDisplay | null { + const armature = this.buildArmature(armatureName, dragonBonesName || "", skinName || "", textureAtlasName || ""); + if (armature !== null) { + this._dragonBones.clock.add(armature); + + return armature.display as PixiArmatureDisplay; + } + + return null; + } + /** + * - Create the display object with the specified texture. + * @param textureName - The texture data name. + * @param textureAtlasName - The texture atlas data name (Of not set, all texture atlas data will be searched) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建带有指定贴图的显示对象。 + * @param textureName - 贴图数据名称。 + * @param textureAtlasName - 贴图集数据名称。 (如果未设置,将检索所有的贴图集数据) + * @version DragonBones 3.0 + * @language zh_CN + */ + public getTextureDisplay(textureName: string, textureAtlasName: string | null = null): PIXI.Sprite | null { + const textureData = this._getTextureData(textureAtlasName !== null ? textureAtlasName : "", textureName) as PixiTextureData; + if (textureData !== null && textureData.renderTexture !== null) { + return new PIXI.Sprite(textureData.renderTexture); + } + + return null; + } + /** + * - A global sound event manager. + * Sound events can be listened to uniformly from the manager. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 全局声音事件管理器。 + * 声音事件可以从该管理器统一侦听。 + * @version DragonBones 4.5 + * @language zh_CN + */ + public get soundEventManager(): PixiArmatureDisplay { + return this._dragonBones.eventManager as PixiArmatureDisplay; + } + } +} diff --git a/Pixi/5.x/src/dragonBones/pixi/PixiSlot.ts b/Pixi/5.x/src/dragonBones/pixi/PixiSlot.ts new file mode 100644 index 00000000..f078d1dc --- /dev/null +++ b/Pixi/5.x/src/dragonBones/pixi/PixiSlot.ts @@ -0,0 +1,406 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace dragonBones { + /** + * - The PixiJS slot. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 插槽。 + * @version DragonBones 3.0 + * @language zh_CN + */ + export class PixiSlot extends Slot { + public static toString(): string { + return "[class dragonBones.PixiSlot]"; + } + + private _textureScale: number; + private _renderDisplay: PIXI.DisplayObject; + + protected _onClear(): void { + super._onClear(); + + this._textureScale = 1.0; + this._renderDisplay = null as any; + this._updateTransform = PIXI.VERSION[0] === "3" ? this._updateTransformV3 : this._updateTransformV4; + } + + protected _initDisplay(value: any, isRetain: boolean): void { + // tslint:disable-next-line:no-unused-expression + value; + // tslint:disable-next-line:no-unused-expression + isRetain; + } + + protected _disposeDisplay(value: any, isRelease: boolean): void { + // tslint:disable-next-line:no-unused-expression + value; + if (!isRelease) { + (value as PIXI.DisplayObject).destroy(); + } + } + + protected _onUpdateDisplay(): void { + this._renderDisplay = (this._display ? this._display : this._rawDisplay) as PIXI.DisplayObject; + } + + protected _addDisplay(): void { + const container = this._armature.display as PixiArmatureDisplay; + container.addChild(this._renderDisplay); + } + + protected _replaceDisplay(value: any): void { + const container = this._armature.display as PixiArmatureDisplay; + const prevDisplay = value as PIXI.DisplayObject; + container.addChild(this._renderDisplay); + container.swapChildren(this._renderDisplay, prevDisplay); + container.removeChild(prevDisplay); + this._textureScale = 1.0; + } + + protected _removeDisplay(): void { + this._renderDisplay.parent.removeChild(this._renderDisplay); + } + + protected _updateZOrder(): void { + const container = this._armature.display as PixiArmatureDisplay; + const index = container.getChildIndex(this._renderDisplay); + if (index === this._zOrder) { + return; + } + + container.addChildAt(this._renderDisplay, this._zOrder); + } + /** + * @internal + */ + public _updateVisible(): void { + this._renderDisplay.visible = this._parent.visible && this._visible; + } + + protected _updateBlendMode(): void { + if (this._renderDisplay instanceof PIXI.Sprite) { + switch (this._blendMode) { + case BlendMode.Normal: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.NORMAL; + break; + + case BlendMode.Add: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.ADD; + break; + + case BlendMode.Darken: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.DARKEN; + break; + + case BlendMode.Difference: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.DIFFERENCE; + break; + + case BlendMode.HardLight: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.HARD_LIGHT; + break; + + case BlendMode.Lighten: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.LIGHTEN; + break; + + case BlendMode.Multiply: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.MULTIPLY; + break; + + case BlendMode.Overlay: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.OVERLAY; + break; + + case BlendMode.Screen: + this._renderDisplay.blendMode = PIXI.BLEND_MODES.SCREEN; + break; + + default: + break; + } + } + // TODO child armature. + } + + protected _updateColor(): void { + const alpha = this._colorTransform.alphaMultiplier * this._globalAlpha; + this._renderDisplay.alpha = alpha; + + if (this._renderDisplay instanceof PIXI.Sprite || this._renderDisplay instanceof PIXI.SimpleMesh) { + const color = (Math.round(this._colorTransform.redMultiplier * 0xFF) << 16) + (Math.round(this._colorTransform.greenMultiplier * 0xFF) << 8) + Math.round(this._colorTransform.blueMultiplier * 0xFF); + this._renderDisplay.tint = color; + } + // TODO child armature. + } + + protected _updateFrame(): void { + let currentTextureData = this._textureData as (PixiTextureData | null); + + if (this._displayIndex >= 0 && this._display !== null && currentTextureData !== null) { + let currentTextureAtlasData = currentTextureData.parent as PixiTextureAtlasData; + + if (this._armature.replacedTexture !== null) { // Update replaced texture atlas. + if (this._armature._replaceTextureAtlasData === null) { + currentTextureAtlasData = BaseObject.borrowObject(PixiTextureAtlasData); + currentTextureAtlasData.copyFrom(currentTextureData.parent); + currentTextureAtlasData.renderTexture = this._armature.replacedTexture; + this._armature._replaceTextureAtlasData = currentTextureAtlasData; + } + else { + currentTextureAtlasData = this._armature._replaceTextureAtlasData as PixiTextureAtlasData; + } + + currentTextureData = currentTextureAtlasData.getTexture(currentTextureData.name) as PixiTextureData; + } + + const renderTexture = currentTextureData.renderTexture; + if (renderTexture !== null) { + if (this._geometryData !== null) { // Mesh. + const data = this._geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexCount]; + const triangleCount = intArray[this._geometryData.offset + BinaryOffset.GeometryTriangleCount]; + let vertexOffset = intArray[this._geometryData.offset + BinaryOffset.GeometryFloatOffset]; + + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + + const uvOffset = vertexOffset + vertexCount * 2; + const scale = this._armature._armatureData.scale; + + const meshDisplay = this._renderDisplay as PIXI.SimpleMesh; + + const vertices = new Float32Array(vertexCount * 2) as any; + const uvs = new Float32Array(vertexCount * 2) as any; + const indices = new Uint16Array(triangleCount * 3) as any; + for (let i = 0, l = vertexCount * 2; i < l; ++i) { + vertices[i] = floatArray[vertexOffset + i] * scale; + } + + for (let i = 0; i < triangleCount * 3; ++i) { + indices[i] = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexIndices + i]; + } + + for (let i = 0, l = vertexCount * 2; i < l; i += 2) { + const u = floatArray[uvOffset + i]; + const v = floatArray[uvOffset + i + 1]; + + if (currentTextureData.rotated) { + uvs[i] = 1 - v; + uvs[i + 1] = u; + } else { + uvs[i] = u; + uvs[i + 1] = v; + } + } + + this._textureScale = 1.0; + meshDisplay.texture = renderTexture as any; + meshDisplay.vertices = vertices; + meshDisplay.uvBuffer.update(uvs); + meshDisplay.geometry.addIndex(indices); + + const isSkinned = this._geometryData.weight !== null; + const isSurface = this._parent._boneData.type !== BoneType.Bone; + if (isSkinned || isSurface) { + this._identityTransform(); + } + } + else { + // Normal texture. + this._textureScale = currentTextureData.parent.scale * this._armature._armatureData.scale; + const normalDisplay = this._renderDisplay as PIXI.Sprite; + normalDisplay.texture = renderTexture; + } + + this._visibleDirty = true; + + return; + } + } + + if (this._geometryData !== null) { + const meshDisplay = this._renderDisplay as PIXI.SimpleMesh; + meshDisplay.texture = null as any; + meshDisplay.x = 0.0; + meshDisplay.y = 0.0; + meshDisplay.visible = false; + } + else { + const normalDisplay = this._renderDisplay as PIXI.Sprite; + normalDisplay.texture = null as any; + normalDisplay.x = 0.0; + normalDisplay.y = 0.0; + normalDisplay.visible = false; + } + } + + protected _updateMesh(): void { + const scale = this._armature._armatureData.scale; + const deformVertices = (this._displayFrame as DisplayFrame).deformVertices; + const bones = this._geometryBones; + const geometryData = this._geometryData as GeometryData; + const weightData = geometryData.weight; + + const hasDeform = deformVertices.length > 0 && geometryData.inheritDeform; + const meshDisplay = this._renderDisplay as PIXI.SimpleMesh; + + if (weightData !== null) { + const data = geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount]; + let weightFloatOffset = intArray[weightData.offset + BinaryOffset.WeigthFloatOffset]; + + if (weightFloatOffset < 0) { + weightFloatOffset += 65536; // Fixed out of bouds bug. + } + + for ( + let i = 0, iD = 0, iB = weightData.offset + BinaryOffset.WeigthBoneIndices + bones.length, iV = weightFloatOffset, iF = 0; + i < vertexCount; + ++i + ) { + const boneCount = intArray[iB++]; + let xG = 0.0, yG = 0.0; + + for (let j = 0; j < boneCount; ++j) { + const boneIndex = intArray[iB++]; + const bone = bones[boneIndex]; + + if (bone !== null) { + const matrix = bone.globalTransformMatrix; + const weight = floatArray[iV++]; + let xL = floatArray[iV++] * scale; + let yL = floatArray[iV++] * scale; + + if (hasDeform) { + xL += deformVertices[iF++]; + yL += deformVertices[iF++]; + } + + xG += (matrix.a * xL + matrix.c * yL + matrix.tx) * weight; + yG += (matrix.b * xL + matrix.d * yL + matrix.ty) * weight; + } + } + + meshDisplay.vertices[iD++] = xG; + meshDisplay.vertices[iD++] = yG; + } + } + else { + const isSurface = this._parent._boneData.type !== BoneType.Bone; + const data = geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount]; + let vertexOffset = intArray[geometryData.offset + BinaryOffset.GeometryFloatOffset]; + + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + + for (let i = 0, l = vertexCount * 2; i < l; i += 2) { + let x = floatArray[vertexOffset + i] * scale; + let y = floatArray[vertexOffset + i + 1] * scale; + + if (hasDeform) { + x += deformVertices[i]; + y += deformVertices[i + 1]; + } + + if (isSurface) { + const matrix = (this._parent as Surface)._getGlobalTransformMatrix(x, y); + meshDisplay.vertices[i] = matrix.a * x + matrix.c * y + matrix.tx; + meshDisplay.vertices[i + 1] = matrix.b * x + matrix.d * y + matrix.ty; + } + else { + meshDisplay.vertices[i] = x; + meshDisplay.vertices[i + 1] = y; + } + } + } + } + + protected _updateTransform(): void { + throw new Error(); + } + + protected _updateTransformV3(): void { + this.updateGlobalTransform(); // Update transform. + + const transform = this.global; + + if (this._renderDisplay === this._rawDisplay || this._renderDisplay === this._meshDisplay) { + const x = transform.x - (this.globalTransformMatrix.a * this._pivotX + this.globalTransformMatrix.c * this._pivotY); + const y = transform.y - (this.globalTransformMatrix.b * this._pivotX + this.globalTransformMatrix.d * this._pivotY); + this._renderDisplay.setTransform( + x, y, + transform.scaleX * this._textureScale, transform.scaleY * this._textureScale, + transform.rotation, + transform.skew, 0.0, + ); + } + else { + this._renderDisplay.position.set(transform.x, transform.y); + this._renderDisplay.rotation = transform.rotation; + this._renderDisplay.skew.set(transform.skew, 0.0); + this._renderDisplay.scale.set(transform.scaleX, transform.scaleY); + } + } + + protected _updateTransformV4(): void { + this.updateGlobalTransform(); // Update transform. + + const transform = this.global; + + if (this._renderDisplay === this._rawDisplay || this._renderDisplay === this._meshDisplay) { + const x = transform.x - (this.globalTransformMatrix.a * this._pivotX + this.globalTransformMatrix.c * this._pivotY); + const y = transform.y - (this.globalTransformMatrix.b * this._pivotX + this.globalTransformMatrix.d * this._pivotY); + this._renderDisplay.setTransform( + x, y, + transform.scaleX * this._textureScale, transform.scaleY * this._textureScale, + transform.rotation, + -transform.skew, 0.0 + ); + } + else { + this._renderDisplay.position.set(transform.x, transform.y); + this._renderDisplay.rotation = transform.rotation; + this._renderDisplay.skew.set(-transform.skew, 0.0); + this._renderDisplay.scale.set(transform.scaleX, transform.scaleY); + } + } + + protected _identityTransform(): void { + this._renderDisplay.setTransform(0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0); + } + } +} diff --git a/Pixi/5.x/src/dragonBones/pixi/PixiTextureAtlasData.ts b/Pixi/5.x/src/dragonBones/pixi/PixiTextureAtlasData.ts new file mode 100644 index 00000000..80ddb09a --- /dev/null +++ b/Pixi/5.x/src/dragonBones/pixi/PixiTextureAtlasData.ts @@ -0,0 +1,118 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace dragonBones { + /** + * - The PixiJS texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + export class PixiTextureAtlasData extends TextureAtlasData { + public static toString(): string { + return "[class dragonBones.PixiTextureAtlasData]"; + } + + private _renderTexture: PIXI.BaseTexture | null = null; // Initial value. + + protected _onClear(): void { + super._onClear(); + + if (this._renderTexture !== null) { + // this._renderTexture.dispose(); + } + + this._renderTexture = null; + } + /** + * @inheritDoc + */ + public createTexture(): TextureData { + return BaseObject.borrowObject(PixiTextureData); + } + /** + * - The PixiJS texture. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - PixiJS 贴图。 + * @version DragonBones 3.0 + * @language zh_CN + */ + public get renderTexture(): PIXI.BaseTexture | null { + return this._renderTexture; + } + public set renderTexture(value: PIXI.BaseTexture | null) { + if (this._renderTexture === value) { + return; + } + + this._renderTexture = value; + + if (this._renderTexture !== null) { + for (let k in this.textures) { + const textureData = this.textures[k] as PixiTextureData; + + textureData.renderTexture = new PIXI.Texture( + this._renderTexture, + new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height), + new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height), + new PIXI.Rectangle(0, 0, textureData.region.width, textureData.region.height), + textureData.rotated as any // .d.ts bug + ); + } + } + else { + for (let k in this.textures) { + const textureData = this.textures[k] as PixiTextureData; + textureData.renderTexture = null; + } + } + } + } + /** + * @internal + */ + export class PixiTextureData extends TextureData { + public static toString(): string { + return "[class dragonBones.PixiTextureData]"; + } + + public renderTexture: PIXI.Texture | null = null; // Initial value. + + protected _onClear(): void { + super._onClear(); + + if (this.renderTexture !== null) { + this.renderTexture.destroy(false); + } + + this.renderTexture = null; + } + } +} \ No newline at end of file diff --git a/Pixi/5.x/tsconfig.json b/Pixi/5.x/tsconfig.json new file mode 100644 index 00000000..7d0506c7 --- /dev/null +++ b/Pixi/5.x/tsconfig.json @@ -0,0 +1,80 @@ +{ + "compilerOptions": { + "watch": false, + "sourceMap": false, + "declaration": true, + "stripInternal": true, + "alwaysStrict": true, + "noImplicitAny": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strictNullChecks": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "es5", + "outFile": "out/dragonBones.js", + "lib": [ + "es5", + "dom", + "es2015.promise" + ] + }, + "exclude": [ + "node_modules", + "out" + ], + "files": [ + "./libs/pixi.js-legacy.d.ts", + + "../../DragonBones/src/dragonBones/core/DragonBones.ts", + "../../DragonBones/src/dragonBones/core/BaseObject.ts", + + "../../DragonBones/src/dragonBones/geom/Matrix.ts", + "../../DragonBones/src/dragonBones/geom/Transform.ts", + "../../DragonBones/src/dragonBones/geom/ColorTransform.ts", + "../../DragonBones/src/dragonBones/geom/Point.ts", + "../../DragonBones/src/dragonBones/geom/Rectangle.ts", + + "../../DragonBones/src/dragonBones/model/UserData.ts", + "../../DragonBones/src/dragonBones/model/DragonBonesData.ts", + "../../DragonBones/src/dragonBones/model/ArmatureData.ts", + "../../DragonBones/src/dragonBones/model/ConstraintData.ts", + "../../DragonBones/src/dragonBones/model/CanvasData.ts", + "../../DragonBones/src/dragonBones/model/SkinData.ts", + "../../DragonBones/src/dragonBones/model/DisplayData.ts", + "../../DragonBones/src/dragonBones/model/BoundingBoxData.ts", + "../../DragonBones/src/dragonBones/model/AnimationData.ts", + "../../DragonBones/src/dragonBones/model/AnimationConfig.ts", + "../../DragonBones/src/dragonBones/model/TextureAtlasData.ts", + + "../../DragonBones/src/dragonBones/armature/IArmatureProxy.ts", + "../../DragonBones/src/dragonBones/armature/Armature.ts", + "../../DragonBones/src/dragonBones/armature/TransformObject.ts", + "../../DragonBones/src/dragonBones/armature/Bone.ts", + "../../DragonBones/src/dragonBones/armature/Surface.ts", + "../../DragonBones/src/dragonBones/armature/Slot.ts", + "../../DragonBones/src/dragonBones/armature/Constraint.ts", + + "../../DragonBones/src/dragonBones/animation/IAnimatable.ts", + "../../DragonBones/src/dragonBones/animation/WorldClock.ts", + "../../DragonBones/src/dragonBones/animation/Animation.ts", + "../../DragonBones/src/dragonBones/animation/AnimationState.ts", + "../../DragonBones/src/dragonBones/animation/BaseTimelineState.ts", + "../../DragonBones/src/dragonBones/animation/TimelineState.ts", + + "../../DragonBones/src/dragonBones/event/EventObject.ts", + "../../DragonBones/src/dragonBones/event/IEventDispatcher.ts", + + "../../DragonBones/src/dragonBones/parser/DataParser.ts", + "../../DragonBones/src/dragonBones/parser/ObjectDataParser.ts", + "../../DragonBones/src/dragonBones/parser/BinaryDataParser.ts", + + "../../DragonBones/src/dragonBones/factory/BaseFactory.ts", + + "./src/dragonBones/pixi/PixiTextureAtlasData.ts", + "./src/dragonBones/pixi/PixiArmatureDisplay.ts", + "./src/dragonBones/pixi/PixiSlot.ts", + "./src/dragonBones/pixi/PixiFactory.ts" + ] +} diff --git a/Pixi/5.x/tslint.json b/Pixi/5.x/tslint.json new file mode 100644 index 00000000..eeb58d17 --- /dev/null +++ b/Pixi/5.x/tslint.json @@ -0,0 +1,15 @@ +{ + "rules": { + "no-unused-expression": true, + "no-unreachable": true, + "no-duplicate-variable": true, + "no-duplicate-key": true, + "no-unused-variable": true, + "curly": false, + "class-name": true, + "triple-equals": true, + "semicolon": [ + true + ] + } +} \ No newline at end of file diff --git a/Pixi/Demos/index.html b/Pixi/Demos/index.html index d18f6a8c..6805bf34 100644 --- a/Pixi/Demos/index.html +++ b/Pixi/Demos/index.html @@ -17,26 +17,30 @@ + + diff --git a/Pixi/Demos/libs/dragonBones/.gitkeep b/Pixi/Demos/libs/dragonBones/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Pixi/Demos/libs/pixi/.gitkeep b/Pixi/Demos/libs/pixi/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Pixi/Demos/out/CoreElement.js b/Pixi/Demos/out/CoreElement.js index e1346727..5a7a3930 100644 --- a/Pixi/Demos/out/CoreElement.js +++ b/Pixi/Demos/out/CoreElement.js @@ -154,14 +154,14 @@ var coreElement; this._armatureDisplay.x = 0.0; this._armatureDisplay.y = Game.GROUND; this._armature = this._armatureDisplay.armature; - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); + this._armatureDisplay.on(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); + this._armatureDisplay.on(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); + this._armatureDisplay.on(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); // Get weapon childArmature. this._weaponL = this._armature.getSlot("weapon_l").childArmature; this._weaponR = this._armature.getSlot("weapon_r").childArmature; - this._weaponL.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); - this._weaponR.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.display.on(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.display.on(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); Game.instance.addChild(this._armatureDisplay); this._updateAnimation(); } @@ -194,22 +194,22 @@ var coreElement; this._isAttackingA = isAttacking; }; Mecha.prototype.switchWeaponL = function () { - this._weaponL.eventDispatcher.removeEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.display.off(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); this._weaponLIndex++; this._weaponLIndex %= Mecha.WEAPON_L_LIST.length; var weaponName = Mecha.WEAPON_L_LIST[this._weaponLIndex]; this._weaponL = dragonBones.PixiFactory.factory.buildArmature(weaponName); this._armature.getSlot("weapon_l").childArmature = this._weaponL; - this._weaponL.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.display.off(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); }; Mecha.prototype.switchWeaponR = function () { - this._weaponR.eventDispatcher.removeEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.display.off(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); this._weaponRIndex++; this._weaponRIndex %= Mecha.WEAPON_R_LIST.length; var weaponName = Mecha.WEAPON_R_LIST[this._weaponRIndex]; this._weaponR = dragonBones.PixiFactory.factory.buildArmature(weaponName); this._armature.getSlot("weapon_r").childArmature = this._weaponR; - this._weaponR.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.display.on(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); }; Mecha.prototype.switchSkin = function () { this._skinIndex++; diff --git a/Pixi/Demos/out/EyeTracking.js b/Pixi/Demos/out/EyeTracking.js new file mode 100644 index 00000000..17178e8c --- /dev/null +++ b/Pixi/Demos/out/EyeTracking.js @@ -0,0 +1,118 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var EyeTracking = /** @class */ (function (_super) { + __extends(EyeTracking, _super); + function EyeTracking() { + var _this = _super.call(this) || this; + _this._scale = 0.3; + _this._target = new PIXI.Point(); + _this._animationNames = [ + "PARAM_ANGLE_X", + "PARAM_ANGLE_Y", + "PARAM_ANGLE_Z", + "PARAM_EYE_BALL_X", + "PARAM_EYE_BALL_Y", + "PARAM_BODY_X", + "PARAM_BODY_Y", + "PARAM_BODY_Z", + "PARAM_BODY_ANGLE_X", + "PARAM_BODY_ANGLE_Y", + "PARAM_BODY_ANGLE_Z", + "PARAM_BREATH", + ]; + _this._resources.push("resource/shizuku/shizuku_ske.json", "resource/shizuku/shizuku.1024/texture_00.png", "resource/shizuku/shizuku.1024/texture_01.png", "resource/shizuku/shizuku.1024/texture_02.png", "resource/shizuku/shizuku.1024/texture_03.png"); + return _this; + } + EyeTracking.prototype._onStart = function () { + var factory = dragonBones.PixiFactory.factory; + factory.parseDragonBonesData(this._pixiResources["resource/shizuku/shizuku_ske.json"].data, "shizuku"); + factory.updateTextureAtlases([ + this._pixiResources["resource/shizuku/shizuku.1024/texture_00.png"].texture, + this._pixiResources["resource/shizuku/shizuku.1024/texture_01.png"].texture, + this._pixiResources["resource/shizuku/shizuku.1024/texture_02.png"].texture, + this._pixiResources["resource/shizuku/shizuku.1024/texture_03.png"].texture, + ], "shizuku"); + this._armatureDisplay = factory.buildArmatureDisplay("shizuku", "shizuku"); + this._armatureDisplay.animation.play("idle_00"); + this._armatureDisplay.x = 0.0; + this._armatureDisplay.y = 200.0; + this._armatureDisplay.scale.set(this._scale); + this.addChild(this._armatureDisplay); + // + this.interactive = true; + this.addListener('touchmove', this._touchHandler, this); + this.addListener('mousemove', this._touchHandler, this); + PIXI.ticker.shared.add(this._enterFrameHandler, this); + }; + EyeTracking.prototype._touchHandler = function (event) { + this._setTarget(event.data.global.x, event.data.global.y); + }; + EyeTracking.prototype._setTarget = function (x, y) { + this._target.x += ((x - this.x - this._armatureDisplay.x) / this._scale - this._target.x) * 0.3; + this._target.y += ((y - this.y - this._armatureDisplay.y) / this._scale - this._target.y) * 0.3; + }; + EyeTracking.prototype._enterFrameHandler = function (deltaTime) { + var armature = this._armatureDisplay.armature; + var animation = this._armatureDisplay.animation; + var canvas = armature.armatureData.canvas; + var p = 0.0; + var pX = Math.max(Math.min((this._target.x - canvas.x) / (canvas.width * 0.5), 1.0), -1.0); + var pY = -Math.max(Math.min((this._target.y - canvas.y) / (canvas.height * 0.5), 1.0), -1.0); + for (var _i = 0, _a = this._animationNames; _i < _a.length; _i++) { + var animationName = _a[_i]; + if (!animation.hasAnimation(animationName)) { + continue; + } + var animationState = animation.getState(animationName, 1); + if (!animationState) { + animationState = animation.fadeIn(animationName, 0.1, 1, 1, animationName); + if (animationState) { + animationState.resetToPose = false; + animationState.stop(); + } + } + if (!animationState) { + continue; + } + switch (animationName) { + case "PARAM_ANGLE_X": + case "PARAM_EYE_BALL_X": + p = (pX + 1.0) * 0.5; + break; + case "PARAM_ANGLE_Y": + case "PARAM_EYE_BALL_Y": + p = (pY + 1.0) * 0.5; + break; + case "PARAM_ANGLE_Z": + p = (-pX * pY + 1.0) * 0.5; + break; + case "PARAM_BODY_X": + case "PARAM_BODY_ANGLE_X": + p = (pX + 1.0) * 0.5; + break; + case "PARAM_BODY_Y": + case "PARAM_BODY_ANGLE_Y": + p = (-pX * pY + 1.0) * 0.5; + break; + case "PARAM_BODY_Z": + case "PARAM_BODY_ANGLE_Z": + p = (-pX * pY + 1.0) * 0.5; + break; + case "PARAM_BREATH": + p = (Math.sin(armature.clock.time) + 1.0) * 0.5; + break; + } + animationState.currentTime = p * animationState.totalTime; + } + }; + return EyeTracking; +}(BaseDemo)); diff --git a/Pixi/Demos/out/MultiTextureAltas.js b/Pixi/Demos/out/MultiTextureAltas.js new file mode 100644 index 00000000..1f70679b --- /dev/null +++ b/Pixi/Demos/out/MultiTextureAltas.js @@ -0,0 +1,68 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var MultiTextureAltas = /** @class */ (function (_super) { + __extends(MultiTextureAltas, _super); + function MultiTextureAltas() { + var _this = _super.call(this) || this; + _this._resources.push("resource/effect/effect_ske.json", "resource/effect/effect_tex.json", "resource/effect/effect_tex.png", "resource/effect/effect_sd_tex.json", "resource/effect/effect_sd_tex.png"); + return _this; + } + MultiTextureAltas.prototype._onStart = function () { + var _this = this; + var factory = dragonBones.PixiFactory.factory; + factory.parseDragonBonesData(this._pixiResources["resource/effect/effect_ske.json"].data, "hd", 1.0); + factory.parseDragonBonesData(this._pixiResources["resource/effect/effect_ske.json"].data, "sd", 0.5); + factory.parseTextureAtlasData(this._pixiResources["resource/effect/effect_tex.json"].data, this._pixiResources["resource/effect/effect_tex.png"].texture, "hd", 1.0); + factory.parseTextureAtlasData(this._pixiResources["resource/effect/effect_sd_tex.json"].data, this._pixiResources["resource/effect/effect_sd_tex.png"].texture, "sd", 2.0); + this._armatureDisplayA = factory.buildArmatureDisplay("flower", "hd", null, "hd"); // HD Armature and HD TextureAtlas. + this._armatureDisplayB = factory.buildArmatureDisplay("flower", "hd", null, "sd"); // HD Armature and SD TextureAtlas. + this._armatureDisplayC = factory.buildArmatureDisplay("flower", "sd", null, "hd"); // SD Armature and HD TextureAtlas. + this._armatureDisplayD = factory.buildArmatureDisplay("flower", "sd", null, "sd"); // SD Armature and SD TextureAtlas. + this._armatureDisplayA.x = -250.0; + this._armatureDisplayA.y = 0.0; + this._armatureDisplayB.x = 250.0; + this._armatureDisplayB.y = 0.0; + this._armatureDisplayC.x = -250.0; + this._armatureDisplayC.y = 200.0; + this._armatureDisplayD.x = 250.0; + this._armatureDisplayD.y = 200.0; + this.addChild(this._armatureDisplayA); + this.addChild(this._armatureDisplayB); + this.addChild(this._armatureDisplayC); + this.addChild(this._armatureDisplayD); + // + this.interactive = true; + var touchHandler = function (event) { + _this._changeAnimation(); + }; + this.addListener("touchstart", touchHandler, this); + this.addListener("mousedown", touchHandler, this); + // + this._changeAnimation(); + }; + MultiTextureAltas.prototype._changeAnimation = function () { + var animationName = this._armatureDisplayA.animation.lastAnimationName; + if (animationName) { + var animationNames = this._armatureDisplayA.animation.animationNames; + var animationIndex = (animationNames.indexOf(animationName) + 1) % animationNames.length; + this._armatureDisplayA.animation.play(animationNames[animationIndex]).playTimes = 0; + } + else { + this._armatureDisplayA.animation.play().playTimes = 0; + } + animationName = this._armatureDisplayA.animation.lastAnimationName; + this._armatureDisplayB.animation.play(animationName).playTimes = 0; + this._armatureDisplayC.animation.play(animationName).playTimes = 0; + this._armatureDisplayD.animation.play(animationName).playTimes = 0; + }; + return MultiTextureAltas; +}(BaseDemo)); diff --git a/Pixi/Demos/resource/effect/effect_sd_tex.json b/Pixi/Demos/resource/effect/effect_sd_tex.json new file mode 100644 index 00000000..92c758be --- /dev/null +++ b/Pixi/Demos/resource/effect/effect_sd_tex.json @@ -0,0 +1 @@ +{"width":256,"SubTexture":[{"width":69,"y":207,"height":62,"name":"jiguang","x":74},{"width":10,"y":142,"height":10,"name":"meigui","x":224},{"y":271,"frameWidth":38,"x":74,"frameHeight":38,"width":36,"frameY":-1,"height":36,"name":"zheng","frameX":-1},{"y":271,"frameWidth":38,"x":112,"frameHeight":38,"width":26,"frameY":-6,"height":26,"name":"zheng2","frameX":-6},{"y":1,"frameWidth":90,"x":173,"frameHeight":80,"width":79,"frameY":-11,"height":68,"name":"1 (6)","frameX":-4},{"y":74,"frameWidth":90,"x":86,"frameHeight":80,"width":77,"frameY":-14,"height":64,"name":"1 (3)","frameX":-4},{"y":142,"frameWidth":90,"x":150,"frameHeight":80,"width":72,"frameY":-15,"height":63,"name":"1 (9)","frameX":-3},{"y":1,"frameWidth":90,"x":1,"frameHeight":80,"width":83,"frameY":-2,"height":77,"name":"1 (2)","frameX":-3},{"y":71,"frameWidth":90,"x":173,"frameHeight":80,"width":75,"frameY":-9,"height":69,"name":"1 (1)","frameX":-3},{"y":148,"frameWidth":90,"x":1,"frameHeight":80,"width":71,"frameY":-14,"height":64,"name":"1 (4)","frameX":-4},{"y":207,"frameWidth":90,"x":150,"frameHeight":80,"width":72,"frameY":-16,"height":63,"name":"1 (10)","frameX":-3},{"y":80,"frameWidth":90,"x":1,"frameHeight":80,"width":72,"frameY":-11,"height":66,"name":"1 (8)","frameX":-4},{"y":1,"frameWidth":90,"x":86,"frameHeight":80,"width":85,"frameY":-6,"height":71,"name":"1 (7)","frameX":-4},{"y":140,"frameWidth":90,"x":75,"frameHeight":80,"width":73,"frameY":-14,"height":65,"name":"1 (5)","frameX":-4}],"height":512,"name":"effect_sd","imagePath":"effect_sd_tex.png"} \ No newline at end of file diff --git a/Pixi/Demos/resource/effect/effect_sd_tex.png b/Pixi/Demos/resource/effect/effect_sd_tex.png new file mode 100644 index 00000000..5da02671 Binary files /dev/null and b/Pixi/Demos/resource/effect/effect_sd_tex.png differ diff --git a/Pixi/Demos/resource/effect/effect_ske.json b/Pixi/Demos/resource/effect/effect_ske.json new file mode 100644 index 00000000..7243ecc4 --- /dev/null +++ b/Pixi/Demos/resource/effect/effect_ske.json @@ -0,0 +1 @@ +{"frameRate":30,"name":"effect","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":30,"name":"flower","aabb":{"x":-316.56,"y":-256.95,"width":505.88,"height":310.08},"bone":[{"name":"root","transform":{"y":-89.1136}},{"name":"hua","parent":"root","transform":{"x":-1.2207,"y":95.86095}},{"name":"roo2","parent":"root","transform":{"x":-122.72615,"y":99.615}},{"name":"JG","parent":"roo2","transform":{"x":48.5738}},{"name":"MG","parent":"roo2","transform":{"x":11.66245,"y":0.09285,"skX":-5.93,"skY":-5.93}},{"name":"zhen","parent":"roo2","transform":{"x":120.51,"y":-6.995,"skX":-0.06,"skY":-0.06,"scX":6.875,"scY":2.385}},{"name":"zheng3","parent":"roo2","transform":{"x":123.96,"y":-30.985,"scY":0.4}},{"name":"jiguang4","parent":"JG","transform":{"x":-64.595,"y":-205.955,"scX":0.663,"scY":0.461}},{"name":"jiguang3","parent":"JG","transform":{"x":38.125,"y":-181.45,"scX":0.83,"scY":0.458}},{"name":"jiguang","parent":"JG","transform":{"x":194.98,"y":-113.8,"scX":0.799,"scY":0.632}},{"name":"jiguang2","parent":"JG","transform":{"x":53.045,"y":-137.18,"scX":1.013,"scY":1.097}},{"name":"jiguang8","parent":"JG","transform":{"x":-3.45,"y":-103.625,"scX":0.335,"scY":0.363}},{"name":"jiguang9","parent":"JG","transform":{"x":76.46,"y":-97.71,"scX":0.429,"scY":0.288}},{"name":"jiguang10","parent":"JG","transform":{"x":140.585,"y":-85.875,"scX":0.448,"scY":0.245}},{"name":"jiguang11","parent":"JG","transform":{"x":180.375,"y":-95.47,"scX":0.47,"scY":0.209}},{"name":"jiguang7","parent":"JG","transform":{"x":186.32,"y":-176.64,"scX":0.737,"scY":0.562}},{"name":"jiguang5","parent":"JG","transform":{"x":74.91,"y":-126.865,"scX":1.021,"scY":0.438}},{"name":"jiguang6","parent":"JG","transform":{"x":-54.655,"y":-131.37,"scX":0.737,"scY":0.562}},{"name":"jiguang12","parent":"JG","transform":{"x":-173.905,"y":-189.055,"scX":0.598,"scY":0.531}},{"name":"meigui4","parent":"MG","transform":{"x":76.075,"y":-172.265,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui5","parent":"MG","transform":{"x":10.4,"y":-173.51,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui6","parent":"MG","transform":{"x":148.425,"y":-166.045,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui7","parent":"MG","transform":{"x":222.04,"y":-146.435,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui8","parent":"MG","transform":{"x":114.085,"y":-161.615,"skX":-9.41,"skY":-9.41,"scX":0.77,"scY":0.77}},{"name":"meigui9","parent":"MG","transform":{"x":98.955,"y":-174.72,"skX":-9.41,"skY":-9.41,"scX":1.146,"scY":1.146}},{"name":"meigui10","parent":"MG","transform":{"x":172.865,"y":-145.485,"skX":-9.41,"skY":-9.41,"scX":0.529,"scY":0.529}},{"name":"meigui11","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui12","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui13","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui14","parent":"MG","transform":{"x":30.535,"y":-161.18,"skX":-9.41,"skY":-9.41,"scX":0.462,"scY":0.462}},{"name":"meigui","parent":"MG","transform":{"x":53.23,"y":-163.915,"scX":1.111,"scY":1.111}},{"name":"zhen1","parent":"zhen"},{"name":"zhen2","parent":"zhen"},{"name":"meigui2","parent":"MG","transform":{"x":128.11,"y":-172.61,"skX":-57.56,"skY":-57.56,"scX":1.151,"scY":1.151}},{"name":"zzz","parent":"zheng3","transform":{"x":-1.2334}},{"name":"meigui3","parent":"MG","transform":{"x":184.74,"y":-156.28,"skX":-9.41,"skY":-9.41,"scX":1.103,"scY":1.103}}],"slot":[{"blendMode":"add","name":"jiguang12","parent":"jiguang11","color":{"aM":72,"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang9","parent":"jiguang8","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang10","parent":"jiguang9","color":{"aM":81,"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang11","parent":"jiguang10","color":{"aM":40,"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang2","parent":"jiguang2","color":{"rM":25,"gM":20}},{"blendMode":"add","name":"jiguang6","parent":"jiguang6","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang","parent":"jiguang"},{"blendMode":"add","name":"jiguang13","parent":"jiguang12","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"jiguang7","parent":"jiguang4","color":{"rM":74,"gM":0}},{"blendMode":"add","name":"jiguang5","parent":"jiguang5"},{"blendMode":"add","name":"jiguang3","parent":"jiguang3"},{"blendMode":"add","name":"jiguang8","parent":"jiguang7","color":{"rM":66,"gM":0}},{"blendMode":"add","name":"meigui","parent":"meigui"},{"blendMode":"add","name":"meigui12","parent":"meigui"},{"blendMode":"add","name":"meigui2","parent":"meigui2"},{"blendMode":"add","displayIndex":-1,"name":"meigui3","parent":"meigui3"},{"blendMode":"add","displayIndex":-1,"name":"meigui4","parent":"meigui4"},{"blendMode":"add","displayIndex":-1,"name":"meigui5","parent":"meigui5"},{"blendMode":"add","displayIndex":-1,"name":"meigui13","parent":"meigui5"},{"blendMode":"add","name":"meigui6","parent":"meigui6"},{"blendMode":"add","name":"meigui7","parent":"meigui7"},{"blendMode":"add","displayIndex":-1,"name":"meigui8","parent":"meigui8"},{"blendMode":"add","name":"meigui9","parent":"meigui9"},{"blendMode":"add","displayIndex":-1,"name":"meigui10","parent":"meigui10"},{"blendMode":"add","displayIndex":-1,"name":"meigui11","parent":"meigui11"},{"blendMode":"add","displayIndex":-1,"name":"meigui14","parent":"meigui12"},{"blendMode":"add","displayIndex":-1,"name":"meigui15","parent":"meigui13"},{"blendMode":"add","displayIndex":-1,"name":"meigui16","parent":"meigui14"},{"blendMode":"add","displayIndex":-1,"name":"zheng","parent":"zhen1"},{"blendMode":"add","displayIndex":-1,"name":"zheng2","parent":"zhen2"},{"blendMode":"add","displayIndex":-1,"name":"zheng3","parent":"zzz"},{"name":"sprite","parent":"hua"}],"skin":[{"slot":[{"name":"meigui12","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[-112.33,33.09,130.41,35.44,130.41,-210.84,-112.33,-213.19],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"meigui16","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui7","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui5","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[-91.11,-46.78,-97.64,-51.68,-95.37,-59.1,-87.14,-55.23,-94.33,-56.63,-92.13,-49.06,-93.57,-52.95],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang3","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang10","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"sprite","display":[{"type":"armature","name":"sprite","transform":{"x":9.52,"y":-33.63},"path":"sprite"}]},{"name":"meigui11","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui2","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang11","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"zheng","display":[{"name":"zheng"}]},{"name":"meigui8","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui13","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang8","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang2","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[209.72,50.23,-180.44,50.23,-180.44,-156.77,209.72,-156.77],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"meigui14","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui3","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang13","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[205.06,63.9,-52.94,63.9,-52.94,-167.1,205.06,-167.1],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang7","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang12","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"zheng2","display":[{"name":"zheng"}]},{"name":"meigui9","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui6","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[100.17,22.33,95.16,21.3,94.47,16.48,100.17,16.48,95.72,17.61,98.98,21.31,97.13,19.5],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang6","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"meigui15","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"meigui4","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]},{"name":"jiguang5","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[148.01,35.84,-109.98,35.84,-109.98,-195.16,148.02,-195.16],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"jiguang9","display":[{"type":"mesh","name":"jiguang","width":137,"height":123,"vertices":[140.19,48.86,-117.8,48.86,-117.8,-182.14,140.2,-182.14],"uvs":[1,1,0,1,0,0,1,0],"triangles":[1,0,3,2,1,3],"edges":[1,0,0,3,3,2,2,1],"userEdges":[]}]},{"name":"zheng3","display":[{"name":"zheng2"}]},{"name":"meigui10","display":[{"type":"mesh","name":"meigui","width":19,"height":20,"vertices":[5.17,6.83,-4.77,4.79,-6.14,-4.77,5.17,-4.77,-3.65,-2.54,2.82,4.8,-0.86,1.2],"uvs":[1,1,0,1,0,0,1,0,0.22016,0.1924,0.79263,0.82497,0.46693,0.51428],"triangles":[5,1,0,2,4,3,6,5,3,4,6,3,5,0,3,6,1,5,4,1,6,2,1,4],"edges":[1,0,0,3,3,2,2,1],"userEdges":[4,6,6,5,4,2,5,0]}]}]}],"animation":[{"duration":110,"name":"skill","frame":[{"duration":0,"events":[{"name":"playse"}]}],"bone":[{"name":"jiguang","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-28.8},{"duration":26,"tweenEasing":0},{"duration":16,"tweenEasing":0,"y":94.69},{"duration":15,"y":114.63}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":26,"tweenEasing":0},{"duration":16,"tweenEasing":0,"y":2.81},{"duration":15,"y":2.17}]},{"name":"jiguang2","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-36.83},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":54.82},{"duration":17,"y":76.35}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":2.81},{"duration":17,"y":2.17}]},{"name":"jiguang3","translateFrame":[{"duration":39,"tweenEasing":0,"y":-14.01},{"duration":25,"tweenEasing":0},{"duration":26,"tweenEasing":0,"y":177.79},{"duration":20,"y":213.84}],"scaleFrame":[{"duration":39,"tweenEasing":0,"y":0.4},{"duration":25,"tweenEasing":0,"y":1.54},{"duration":26,"tweenEasing":0,"y":3.55},{"duration":20,"y":1.9}]},{"name":"jiguang4","translateFrame":[{"duration":39,"tweenEasing":0,"y":5.39},{"duration":25,"tweenEasing":0,"y":26.44},{"duration":21,"tweenEasing":0,"y":146.04},{"duration":25,"y":184.43}],"scaleFrame":[{"duration":39,"tweenEasing":0,"y":0.27},{"duration":25,"tweenEasing":0},{"duration":21,"tweenEasing":0,"x":1.2,"y":5.46},{"duration":25,"y":2.49}]},{"name":"jiguang5","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-25.44},{"duration":13,"tweenEasing":0},{"duration":39,"tweenEasing":0,"y":50.35},{"duration":5,"y":114.63}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":13,"tweenEasing":0},{"duration":39,"tweenEasing":0,"y":4.76},{"duration":5,"y":2.18}]},{"name":"jiguang6","translateFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":-27.58},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":94.69},{"duration":17,"y":114.63}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.611,0.33,0.75,1],"y":0.56},{"duration":26,"tweenEasing":0},{"duration":14,"tweenEasing":0,"y":2.81},{"duration":17,"y":2.17}]},{"name":"jiguang7","translateFrame":[{"duration":39,"tweenEasing":0,"y":-33.84},{"duration":25,"tweenEasing":0},{"duration":36,"tweenEasing":0,"y":139.54},{"duration":10,"y":184.43}],"scaleFrame":[{"duration":39,"tweenEasing":0},{"duration":25,"tweenEasing":0,"y":3.51},{"duration":36,"tweenEasing":0,"y":3.55},{"duration":10,"y":2.49}]},{"name":"jiguang8","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":15,"tweenEasing":0,"y":-61.98},{"duration":15,"tweenEasing":0,"y":9.89},{"duration":17,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.51},{"duration":15,"tweenEasing":0,"y":1.86},{"duration":15,"tweenEasing":0,"y":3.68},{"duration":17,"y":1.83}]},{"name":"jiguang9","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":15,"tweenEasing":0,"y":-61.98},{"duration":32,"tweenEasing":0,"y":9.89},{"duration":0,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.53},{"duration":15,"tweenEasing":0,"y":1.86},{"duration":32,"tweenEasing":0,"y":3.7},{"duration":0,"y":1.84}]},{"name":"jiguang10","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":17,"tweenEasing":0,"y":-61.98},{"duration":25,"tweenEasing":0,"y":9.89},{"duration":5,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.51},{"duration":17,"tweenEasing":0,"y":1.86},{"duration":25,"tweenEasing":0,"y":3.7},{"duration":5,"y":1.84}]},{"name":"jiguang11","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":-91.06},{"duration":15,"tweenEasing":0,"y":-61.98},{"duration":15,"tweenEasing":0,"y":9.89},{"duration":17,"y":48.34}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"y":0.54},{"duration":15,"tweenEasing":0,"y":1.86},{"duration":15,"tweenEasing":0,"y":3.7},{"duration":17,"y":1.84}]},{"name":"jiguang12","translateFrame":[{"duration":40,"tweenEasing":0,"y":-10.34},{"duration":24,"tweenEasing":0},{"duration":21,"tweenEasing":0,"y":139.54},{"duration":25,"y":184.43}],"scaleFrame":[{"duration":40,"tweenEasing":0,"y":0.25},{"duration":24,"tweenEasing":0},{"duration":21,"tweenEasing":0,"y":3.55},{"duration":25,"y":2.49}]},{"name":"meigui","translateFrame":[{"duration":5,"tweenEasing":0},{"duration":82,"tweenEasing":0,"x":-22,"y":-82.62},{"duration":23,"x":73.47,"y":190.1}],"rotateFrame":[{"duration":5,"tweenEasing":0},{"duration":82,"tweenEasing":0},{"duration":23,"rotate":-71.26}],"scaleFrame":[{"duration":5,"tweenEasing":0},{"duration":82,"tweenEasing":0},{"duration":23,"x":0.29}]},{"name":"meigui2","translateFrame":[{"duration":23,"tweenEasing":0},{"duration":72,"tweenEasing":0,"x":-158.4,"y":-48.2},{"duration":15,"x":-88.77,"y":151.79}],"rotateFrame":[{"duration":23,"tweenEasing":0},{"duration":72,"tweenEasing":0,"rotate":134.69},{"duration":15,"rotate":34.01}]},{"name":"meigui3","translateFrame":[{"duration":40,"tweenEasing":0},{"duration":70,"tweenEasing":0,"x":-80.15,"y":-60.77},{"duration":0,"x":18.74,"y":134.04}],"rotateFrame":[{"duration":40,"tweenEasing":0},{"duration":70,"tweenEasing":0,"rotate":-19.05},{"duration":0,"rotate":-52.29}],"scaleFrame":[{"duration":40,"tweenEasing":0},{"duration":70,"tweenEasing":0},{"duration":0,"x":0.54,"y":1.23}]},{"name":"meigui4","translateFrame":[{"duration":45,"tweenEasing":0},{"duration":55,"tweenEasing":0,"x":-77.82,"y":-37.37},{"duration":10,"x":17.57,"y":106}],"rotateFrame":[{"duration":45,"tweenEasing":0},{"duration":55,"tweenEasing":0},{"duration":10,"rotate":-25.04}]},{"name":"meigui5","translateFrame":[{"duration":42,"tweenEasing":0},{"duration":54,"tweenEasing":0,"x":42.56,"y":22.81},{"duration":14,"x":138.97,"y":149.95}],"rotateFrame":[{"duration":42,"tweenEasing":0},{"duration":54,"tweenEasing":0,"rotate":1.39},{"duration":14,"rotate":-43.42}]},{"name":"meigui6","translateFrame":[{"duration":41,"tweenEasing":0,"x":-185,"y":-40.92},{"duration":11,"tweenEasing":0,"x":-116.91,"y":86.74},{"duration":45,"tweenEasing":0,"x":-225.07,"y":-68.34},{"duration":13,"x":-166.09,"y":78.05}],"rotateFrame":[{"duration":110,"rotate":-29.87}]},{"name":"meigui7","translateFrame":[{"duration":13,"tweenEasing":0},{"duration":71,"tweenEasing":0,"x":-230.82,"y":-98.22},{"duration":26,"x":110.11,"y":172.15}],"rotateFrame":[{"duration":13,"tweenEasing":0},{"duration":71,"tweenEasing":0},{"duration":26,"rotate":-57.52}],"scaleFrame":[{"duration":13,"tweenEasing":0},{"duration":71,"tweenEasing":0,"x":2.01,"y":2.01},{"duration":26,"x":0.89,"y":0.89}]},{"name":"meigui8","translateFrame":[{"duration":60,"tweenEasing":0},{"duration":24,"tweenEasing":0,"x":15.4,"y":-64.94},{"duration":23,"tweenEasing":0,"x":15.4,"y":-64.94},{"duration":3,"x":95.14,"y":57.8}],"rotateFrame":[{"duration":84,"tweenEasing":0},{"duration":23,"tweenEasing":0},{"duration":3,"rotate":-87.86}],"scaleFrame":[{"duration":60,"tweenEasing":0},{"duration":24,"tweenEasing":0},{"duration":23,"tweenEasing":0,"x":0.54},{"duration":3}]},{"name":"meigui9","translateFrame":[{"duration":14,"tweenEasing":0},{"duration":66,"tweenEasing":0,"x":-63.98,"y":-75.86},{"duration":30,"x":10.98,"y":54.38}],"rotateFrame":[{"duration":14,"tweenEasing":0},{"duration":66,"tweenEasing":0},{"duration":30,"rotate":-37.05}],"scaleFrame":[{"duration":14,"tweenEasing":0},{"duration":66,"tweenEasing":0,"x":0.5,"y":0.5},{"duration":30,"x":0.44,"y":0.44}]},{"name":"meigui10","translateFrame":[{"duration":41,"tweenEasing":0},{"duration":32,"tweenEasing":0,"x":-105.16,"y":-77.08},{"duration":36,"tweenEasing":0,"x":-105.16,"y":-77.08},{"x":60.47,"y":195.9}],"rotateFrame":[{"duration":41,"tweenEasing":0},{"duration":32,"tweenEasing":0},{"duration":36,"tweenEasing":0,"rotate":-49.87},{"rotate":-133.85}],"scaleFrame":[{"duration":41,"tweenEasing":0},{"duration":32,"tweenEasing":0},{"duration":36,"tweenEasing":0,"x":0.5,"y":1.82},{"x":1.56,"y":1.82}]},{"name":"meigui11","translateFrame":[{"duration":61,"tweenEasing":0},{"duration":49,"tweenEasing":0,"x":-41.54,"y":-52.83},{"duration":0,"x":107.18,"y":100.08}],"rotateFrame":[{"duration":61,"tweenEasing":0},{"duration":49,"tweenEasing":0},{"duration":0,"rotate":-48.84}],"scaleFrame":[{"duration":61,"tweenEasing":0},{"duration":49,"tweenEasing":0,"x":0.78,"y":2.37},{"duration":0,"x":2.33,"y":2.37}]},{"name":"zhen1","translateFrame":[{"duration":43,"tweenEasing":0},{"duration":67,"y":0.97}],"rotateFrame":[{"duration":43,"tweenEasing":0},{"duration":57,"tweenEasing":0},{"duration":10,"rotate":54.95}],"scaleFrame":[{"duration":43,"tweenEasing":0},{"duration":57,"tweenEasing":0,"x":0.89,"y":0.89},{"duration":10,"x":1.22,"y":1.22}]},{"name":"zhen2","translateFrame":[{"duration":43,"tweenEasing":0},{"duration":67,"y":0.97}],"rotateFrame":[{"duration":43,"tweenEasing":0},{"duration":22,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":23.13},{"duration":15,"rotate":54.95}],"scaleFrame":[{"duration":43,"tweenEasing":0},{"duration":22,"tweenEasing":0,"x":0.89,"y":0.89},{"duration":30,"tweenEasing":0,"x":1.03,"y":1.03},{"duration":15,"x":1.53,"y":1.53}]},{"name":"meigui12","translateFrame":[{"duration":75,"tweenEasing":0},{"duration":35,"tweenEasing":0,"x":-55.5,"y":-67.15},{"duration":0,"x":-7.89,"y":-9.12}],"scaleFrame":[{"duration":75,"tweenEasing":0},{"duration":35,"tweenEasing":0},{"duration":0,"x":2.13,"y":2.13}]},{"name":"meigui13","translateFrame":[{"duration":66,"tweenEasing":0},{"duration":34,"tweenEasing":0,"x":43.72,"y":-53.51},{"duration":10,"x":94.5,"y":-10.07}],"rotateFrame":[{"duration":66,"tweenEasing":0},{"duration":34,"tweenEasing":0},{"duration":10,"rotate":-19.75}],"scaleFrame":[{"duration":66,"tweenEasing":0},{"duration":34,"tweenEasing":0,"x":1.98,"y":1.98},{"duration":10,"x":0.96,"y":0.96}]},{"name":"meigui14","translateFrame":[{"duration":77,"tweenEasing":0},{"duration":33,"tweenEasing":0,"x":132.75,"y":-44.2},{"duration":0,"x":188.19,"y":12.82}],"rotateFrame":[{"duration":77,"tweenEasing":0},{"duration":33,"tweenEasing":0,"rotate":28.72},{"duration":0,"rotate":-53.72}],"scaleFrame":[{"duration":77,"tweenEasing":0},{"duration":33,"x":1.54,"y":1.54}]},{"name":"zheng3","translateFrame":[{"duration":110,"x":2.08,"y":22.52}],"scaleFrame":[{"duration":110,"x":7.47,"y":5.65}]},{"name":"zzz","rotateFrame":[{"duration":20,"tweenEasing":0},{"duration":20,"tweenEasing":0,"rotate":82.31},{"duration":10,"curve":[0.2295,0.375,0.6765,0.825]},{"duration":55,"curve":[0.283,0.49,0.761,1],"rotate":-35.64},{"duration":5,"rotate":-124.39}],"scaleFrame":[{"duration":20,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.34,"y":0.34},{"duration":55,"curve":[0.283,0.49,0.761,1],"x":0.85,"y":0.85},{"duration":5,"x":1.5,"y":1.5}]},{"name":"hua","scaleFrame":[{"duration":20},{"duration":30,"tweenEasing":0,"x":0.25,"y":0.25},{"duration":60,"tweenEasing":0,"x":1.1,"y":1.1},{"duration":0,"x":2,"y":1.7}]}],"slot":[{"name":"jiguang","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0}},{"duration":26},{"duration":16,"tweenEasing":0},{"duration":15,"value":{"aM":0}}]},{"name":"jiguang2","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0,"rM":25,"gM":19}},{"duration":26,"value":{"rM":25,"gM":19}},{"duration":14,"tweenEasing":0,"value":{"rM":25,"gM":19}},{"duration":17,"value":{"aM":0,"rM":25,"gM":19}}]},{"name":"jiguang3","colorFrame":[{"duration":39,"tweenEasing":0,"value":{"aM":0}},{"duration":25},{"duration":26,"tweenEasing":0},{"duration":20,"value":{"aM":0}}]},{"name":"jiguang5","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0}},{"duration":13},{"duration":39,"tweenEasing":0},{"duration":5,"value":{"aM":0}}]},{"name":"jiguang6","displayFrame":[{"duration":3,"value":-1},{"duration":107}],"colorFrame":[{"duration":3,"tweenEasing":0},{"duration":50,"curve":[0.3055,0.165,0.875,1],"value":{"aM":0,"rM":65,"gM":0}},{"duration":26,"value":{"rM":65,"gM":0}},{"duration":14,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":17,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang7","colorFrame":[{"duration":39,"tweenEasing":0,"value":{"aM":0,"rM":74,"gM":0}},{"duration":25,"value":{"rM":74,"gM":0}},{"duration":21,"tweenEasing":0,"value":{"rM":74,"gM":0}},{"duration":25,"value":{"aM":0,"rM":74,"gM":0}}]},{"name":"jiguang8","colorFrame":[{"duration":39,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":25,"value":{"rM":65,"gM":0}},{"duration":36,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":10,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang9","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":15,"value":{"rM":65,"gM":0}},{"duration":15,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":17,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang10","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":15,"tweenEasing":0,"value":{"aM":80,"rM":65,"gM":0}},{"duration":32,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":0,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang11","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":17,"value":{"rM":65,"gM":0}},{"duration":25,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":5,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang12","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":50,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":15,"value":{"aM":72,"rM":65,"gM":0}},{"duration":15,"tweenEasing":0,"value":{"aM":72,"rM":65,"gM":0}},{"duration":17,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"jiguang13","colorFrame":[{"duration":40,"tweenEasing":0,"value":{"aM":0,"rM":65,"gM":0}},{"duration":27,"tweenEasing":0,"value":{"rM":65,"gM":0}},{"duration":43,"value":{"aM":0,"rM":65,"gM":0}}]},{"name":"meigui","displayFrame":[{"duration":5,"value":-1},{"duration":105}],"colorFrame":[{"duration":5,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":{"aM":0}},{"duration":16},{"duration":32,"tweenEasing":0},{"duration":23,"value":{"aM":0}}]},{"name":"meigui2","displayFrame":[{"duration":23,"value":-1},{"duration":87}],"colorFrame":[{"duration":23,"tweenEasing":0},{"duration":27,"tweenEasing":0,"value":{"aM":0}},{"duration":25},{"duration":20,"tweenEasing":0},{"duration":15,"value":{"aM":0}}]},{"name":"meigui3","displayFrame":[{"duration":40,"value":-1},{"duration":70}],"colorFrame":[{"duration":40,"tweenEasing":0},{"duration":28,"tweenEasing":0,"value":{"aM":0}},{"duration":22},{"duration":20,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"meigui4","displayFrame":[{"duration":45,"value":-1},{"duration":65}],"colorFrame":[{"duration":45,"tweenEasing":0},{"duration":30,"tweenEasing":0,"value":{"aM":0}},{"duration":25,"tweenEasing":0},{"duration":10,"value":{"aM":0}}]},{"name":"meigui5","displayFrame":[{"duration":42,"value":-1},{"duration":68}],"colorFrame":[{"duration":42,"tweenEasing":0},{"duration":27,"tweenEasing":0,"value":{"aM":0}},{"duration":27,"tweenEasing":0},{"duration":14,"value":{"aM":0}}]},{"name":"meigui6","colorFrame":[{"duration":22,"tweenEasing":0,"value":{"aM":0}},{"duration":19,"tweenEasing":0},{"duration":11,"value":{"aM":0}},{"duration":22,"tweenEasing":0,"value":{"aM":0}},{"duration":23,"tweenEasing":0},{"duration":13,"value":{"aM":0}}]},{"name":"meigui7","displayFrame":[{"duration":13,"value":-1},{"duration":97}],"colorFrame":[{"duration":13,"tweenEasing":0},{"duration":38,"tweenEasing":0,"value":{"aM":0}},{"duration":33,"tweenEasing":0},{"duration":26,"value":{"aM":0}}]},{"name":"meigui8","displayFrame":[{"duration":60,"value":-1},{"duration":50}],"colorFrame":[{"duration":60,"tweenEasing":0},{"duration":24,"tweenEasing":0,"value":{"aM":0}},{"duration":23,"tweenEasing":0},{"duration":3,"value":{"aM":0}}]},{"name":"meigui9","displayFrame":[{"duration":14,"value":-1},{"duration":96}],"colorFrame":[{"duration":14,"tweenEasing":0},{"duration":25,"tweenEasing":0,"value":{"aM":0}},{"duration":41,"tweenEasing":0},{"duration":30,"value":{"aM":0}}]},{"name":"meigui10","displayFrame":[{"duration":41,"value":-1},{"duration":69}],"colorFrame":[{"duration":41,"tweenEasing":0},{"duration":24,"tweenEasing":0,"value":{"aM":0}},{"duration":25},{"duration":19,"tweenEasing":0},{"value":{"aM":0}}]},{"name":"meigui11","displayFrame":[{"duration":61,"value":-1},{"duration":49}],"colorFrame":[{"duration":61,"tweenEasing":0},{"duration":26,"tweenEasing":0,"value":{"aM":0}},{"duration":23,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"meigui12","displayFrame":[{"duration":5,"value":-1},{"duration":105}],"colorFrame":[{"duration":5,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":{"aM":0}},{"duration":16},{"duration":32,"tweenEasing":0},{"duration":23,"value":{"aM":0}}]},{"name":"meigui13","colorFrame":[{"duration":42,"tweenEasing":0},{"duration":27,"tweenEasing":0,"value":{"aM":0}},{"duration":27,"tweenEasing":0},{"duration":14,"value":{"aM":0}}]},{"name":"meigui14","displayFrame":[{"duration":75,"value":-1},{"duration":35}],"colorFrame":[{"duration":76,"tweenEasing":0},{"duration":34,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"meigui15","displayFrame":[{"duration":66,"value":-1},{"duration":44}],"colorFrame":[{"duration":68,"tweenEasing":0},{"duration":32,"tweenEasing":0},{"duration":10,"value":{"aM":0}}]},{"name":"meigui16","displayFrame":[{"duration":77,"value":-1},{"duration":33}],"colorFrame":[{"duration":83,"tweenEasing":0},{"duration":27,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]},{"name":"zheng","displayFrame":[{"duration":43,"value":-1},{"duration":67}],"colorFrame":[{"duration":43,"tweenEasing":0},{"duration":22,"tweenEasing":0,"value":{"aM":0}},{"duration":35,"tweenEasing":0,"value":{"aM":47,"rM":94,"bM":94}},{"duration":10,"value":{"aM":0}}]},{"name":"zheng2","displayFrame":[{"duration":55,"value":-1},{"duration":55}],"colorFrame":[{"duration":55,"tweenEasing":0},{"duration":10,"tweenEasing":0,"value":{"aM":0}},{"duration":30,"tweenEasing":0,"value":{"aM":56}},{"duration":15,"value":{"aM":0}}]},{"name":"zheng3","displayFrame":[{"duration":20,"value":-1},{"duration":90}],"colorFrame":[{"duration":20,"tweenEasing":0},{"duration":30,"tweenEasing":0,"value":{"aM":0}},{"duration":20,"tweenEasing":0,"value":{"aM":22}},{"duration":35,"tweenEasing":0,"value":{"aM":80}},{"duration":5,"value":{"aM":0}}]},{"name":"sprite","displayFrame":[{"duration":20,"value":-1},{"duration":90,"actions":[{"gotoAndPlay":"sprite"}]}],"colorFrame":[{"duration":20},{"duration":30,"tweenEasing":0,"value":{"aM":0}},{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0},{"duration":0,"value":{"aM":0}}]}],"ffd":[{"name":"jiguang","slot":"jiguang","frame":[{"duration":79},{"duration":16,"tweenEasing":0},{"duration":15,"offset":5,"vertices":[141.47,0,141.47]}]},{"name":"jiguang","slot":"jiguang3","frame":[{"duration":64},{"duration":26,"tweenEasing":0},{"duration":20,"offset":5,"vertices":[169.85,0,169.85]}]},{"name":"jiguang","slot":"jiguang7","frame":[{"duration":64},{"duration":21,"tweenEasing":0},{"duration":25,"offset":5,"vertices":[122.89,0,122.89]}]},{"name":"jiguang","slot":"jiguang8","frame":[{"duration":64},{"duration":36,"tweenEasing":0},{"duration":10,"offset":5,"vertices":[127.94,0,127.94]}]},{"name":"meigui","slot":"meigui2","frame":[{"duration":23,"tweenEasing":0},{"duration":87,"vertices":[-1.93,-2.42,1.8,-1.65,2.33,1.95,-1.93,1.95,1.39,1.11,-1.05,-1.65,0.34,-0.29]}]},{"name":"meigui","slot":"meigui5","frame":[{"duration":42,"tweenEasing":0},{"duration":68,"vertices":[225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98]}]},{"name":"meigui","slot":"meigui6","frame":[{"duration":41,"tweenEasing":0},{"duration":11,"tweenEasing":0,"vertices":[2.77,-4.16,3.42,1.98,-1.86,4.53,-3.95,-2.02,-1.02,2.68,2.03,-2.42,0.62,0.37]},{"duration":45,"tweenEasing":0},{"duration":13,"vertices":[2.77,-4.16,3.42,1.98,-1.86,4.53,-3.95,-2.02,-1.02,2.68,2.03,-2.42,0.62,0.37]}]},{"name":"meigui","slot":"meigui13","frame":[{"duration":42},{"duration":53,"tweenEasing":0,"vertices":[112.61,-72.01,112.69,-72.31,111.03,-65.67,110.53,-63.65,111.33,-66.83,112.35,-70.97,111.86,-69.03]},{"duration":15,"vertices":[225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98,225.34,29.98]}]}]}],"defaultActions":[{"gotoAndPlay":"skill"}]},{"type":"Sheet","frameRate":10,"name":"sprite","aabb":{"x":-90,"y":-80,"width":180,"height":160},"bone":[{"name":"root"}],"slot":[{"name":"sheetSlot","parent":"root"}],"skin":[{"slot":[{"name":"sheetSlot","display":[{"name":"1 (1)"},{"name":"1 (2)"},{"name":"1 (3)"},{"name":"1 (4)"},{"name":"1 (5)"},{"name":"1 (6)"},{"name":"1 (7)"},{"name":"1 (8)"},{"name":"1 (9)"},{"name":"1 (10)"}]}]}],"animation":[{"duration":10,"playTimes":0,"name":"sprite","slot":[{"name":"sheetSlot","displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"value":5},{"value":6},{"value":7},{"value":8},{"value":9}]}]}],"defaultActions":[{"gotoAndPlay":"sprite"}]}]} \ No newline at end of file diff --git a/Pixi/Demos/resource/effect/effect_tex.json b/Pixi/Demos/resource/effect/effect_tex.json new file mode 100644 index 00000000..27b04611 --- /dev/null +++ b/Pixi/Demos/resource/effect/effect_tex.json @@ -0,0 +1 @@ +{"width":512,"SubTexture":[{"width":137,"y":421,"height":123,"name":"jiguang","x":1},{"width":20,"y":333,"height":20,"name":"meigui","x":442},{"y":408,"frameWidth":75,"x":292,"frameHeight":75,"width":71,"frameY":-2,"height":71,"name":"zheng","frameX":-2},{"y":280,"frameWidth":75,"x":442,"frameHeight":75,"width":51,"frameY":-12,"height":51,"name":"zheng2","frameX":-12},{"y":1,"frameWidth":180,"x":340,"frameHeight":160,"width":158,"frameY":-22,"height":137,"name":"1 (6)","frameX":-7},{"y":146,"frameWidth":180,"x":168,"frameHeight":160,"width":154,"frameY":-27,"height":127,"name":"1 (3)","frameX":-8},{"y":293,"frameWidth":180,"x":1,"frameHeight":160,"width":145,"frameY":-30,"height":126,"name":"1 (9)","frameX":-7},{"y":1,"frameWidth":180,"x":1,"frameHeight":160,"width":165,"frameY":-4,"height":155,"name":"1 (2)","frameX":-6},{"y":140,"frameWidth":180,"x":340,"frameHeight":160,"width":151,"frameY":-17,"height":138,"name":"1 (1)","frameX":-6},{"y":407,"frameWidth":180,"x":148,"frameHeight":160,"width":142,"frameY":-28,"height":128,"name":"1 (4)","frameX":-8},{"y":280,"frameWidth":180,"x":295,"frameHeight":160,"width":145,"frameY":-33,"height":126,"name":"1 (10)","frameX":-6},{"y":158,"frameWidth":180,"x":1,"frameHeight":160,"width":145,"frameY":-23,"height":133,"name":"1 (8)","frameX":-8},{"y":1,"frameWidth":180,"x":168,"frameHeight":160,"width":170,"frameY":-12,"height":143,"name":"1 (7)","frameX":-7},{"y":275,"frameWidth":180,"x":148,"frameHeight":160,"width":145,"frameY":-27,"height":130,"name":"1 (5)","frameX":-7}],"height":1024,"name":"effect","imagePath":"effect_tex.png"} \ No newline at end of file diff --git a/Pixi/Demos/resource/effect/effect_tex.png b/Pixi/Demos/resource/effect/effect_tex.png new file mode 100644 index 00000000..628b5ba7 Binary files /dev/null and b/Pixi/Demos/resource/effect/effect_tex.png differ diff --git a/Pixi/Demos/resource/shizuku/shizuku.1024/texture_00.png b/Pixi/Demos/resource/shizuku/shizuku.1024/texture_00.png new file mode 100644 index 00000000..c3005403 Binary files /dev/null and b/Pixi/Demos/resource/shizuku/shizuku.1024/texture_00.png differ diff --git a/Pixi/Demos/resource/shizuku/shizuku.1024/texture_01.png b/Pixi/Demos/resource/shizuku/shizuku.1024/texture_01.png new file mode 100644 index 00000000..96566d99 Binary files /dev/null and b/Pixi/Demos/resource/shizuku/shizuku.1024/texture_01.png differ diff --git a/Pixi/Demos/resource/shizuku/shizuku.1024/texture_02.png b/Pixi/Demos/resource/shizuku/shizuku.1024/texture_02.png new file mode 100644 index 00000000..6ace01b9 Binary files /dev/null and b/Pixi/Demos/resource/shizuku/shizuku.1024/texture_02.png differ diff --git a/Pixi/Demos/resource/shizuku/shizuku.1024/texture_03.png b/Pixi/Demos/resource/shizuku/shizuku.1024/texture_03.png new file mode 100644 index 00000000..93eb4c68 Binary files /dev/null and b/Pixi/Demos/resource/shizuku/shizuku.1024/texture_03.png differ diff --git a/Pixi/Demos/resource/shizuku/shizuku_ske.json b/Pixi/Demos/resource/shizuku/shizuku_ske.json new file mode 100644 index 00000000..f3af6ceb --- /dev/null +++ b/Pixi/Demos/resource/shizuku/shizuku_ske.json @@ -0,0 +1 @@ +{"frameRate":30,"name":"shizuku","version":"5.6","compatibleVersion":"5.5","armature":[{"name":"shizuku","aabb":{"x":-640,"y":-1380,"width":1280,"height":1380},"bone":[{"length":150,"name":"DST_BASE"},{"type":"surface","name":"B_BODY.04","segmentX":8,"segmentY":8,"vertices":[-574.8,-1106.14,-429.1,-1106.14,-283.39,-1106.14,-137.68,-1106.14,8.03,-1106.14,153.74,-1106.14,299.45,-1106.14,445.15,-1106.14,590.86,-1106.14,-574.8,-932.9,-429.1,-932.9,-283.39,-932.9,-137.68,-932.9,8.03,-932.9,153.74,-932.9,299.45,-932.9,445.15,-932.9,590.86,-932.9,-574.8,-759.66,-429.1,-759.66,-283.39,-759.66,-137.68,-759.66,8.03,-759.66,153.74,-759.66,299.45,-759.66,445.15,-759.66,590.86,-759.66,-574.8,-586.43,-429.1,-586.43,-283.39,-586.43,-137.68,-586.43,8.03,-586.43,153.74,-586.43,299.45,-586.43,445.15,-586.43,590.86,-586.43,-574.8,-413.19,-429.1,-413.19,-283.39,-413.19,-137.68,-413.19,8.03,-413.19,153.74,-413.19,299.45,-413.19,445.15,-413.19,590.86,-413.19,-574.8,-239.96,-429.1,-239.96,-283.39,-239.96,-137.68,-239.96,8.03,-239.96,153.74,-239.96,299.45,-239.96,445.15,-239.96,590.86,-239.96,-574.8,-66.72,-429.1,-66.72,-283.39,-66.72,-137.68,-66.72,8.03,-66.72,153.74,-66.72,299.45,-66.72,445.15,-66.72,590.86,-66.72,-574.8,106.51,-429.1,106.51,-283.39,106.51,-137.68,106.51,8.03,106.51,153.74,106.51,299.45,106.51,445.15,106.51,590.86,106.51,-574.8,279.75,-429.1,279.75,-283.39,279.75,-137.68,279.75,8.03,279.75,153.74,279.75,299.45,279.75,445.15,279.75,590.86,279.75]},{"length":150,"name":"B_BACKGROUND.01","transform":{"x":-17.33,"y":-22,"skX":-90,"skY":-90}},{"type":"surface","name":"B_BODY.03","parent":"B_BODY.04","segmentX":8,"segmentY":8,"vertices":[-171.8,-158.29,-129.46,-158.29,-87.11,-158.29,-44.76,-158.29,-2.41,-158.29,39.93,-158.29,82.28,-158.29,124.63,-158.29,166.97,-158.29,-171.8,-117.82,-129.46,-117.82,-87.11,-117.82,-44.76,-117.82,-2.41,-117.82,39.93,-117.82,82.28,-117.82,124.63,-117.82,166.97,-117.82,-171.8,-77.34,-129.46,-77.34,-87.11,-77.34,-44.76,-77.34,-2.41,-77.34,39.93,-77.34,82.28,-77.34,124.63,-77.34,166.97,-77.34,-171.8,-36.87,-129.46,-36.87,-87.11,-36.87,-44.76,-36.87,-2.41,-36.87,39.93,-36.87,82.28,-36.87,124.63,-36.87,166.97,-36.87,-171.8,3.6,-129.46,3.6,-87.11,3.6,-44.76,3.6,-2.41,3.6,39.93,3.6,82.28,3.6,124.63,3.6,166.97,3.6,-171.8,44.07,-129.46,44.07,-87.11,44.07,-44.76,44.07,-2.41,44.07,39.93,44.07,82.28,44.07,124.63,44.07,166.97,44.07,-171.8,84.55,-129.46,84.55,-87.11,84.55,-44.76,84.55,-2.41,84.55,39.93,84.55,82.28,84.55,124.63,84.55,166.97,84.55,-171.8,125.02,-129.46,125.02,-87.11,125.02,-44.76,125.02,-2.41,125.02,39.93,125.02,82.28,125.02,124.63,125.02,166.97,125.02,-171.8,165.49,-129.46,165.49,-87.11,165.49,-44.76,165.49,-2.41,165.49,39.93,165.49,82.28,165.49,124.63,165.49,166.97,165.49]},{"type":"surface","name":"B_BODY.02","parent":"B_BODY.03","segmentX":8,"segmentY":8,"vertices":[-174.86,-165.74,-131.63,-165.74,-88.39,-165.74,-45.15,-165.74,-1.92,-165.74,41.32,-165.74,84.56,-165.74,127.8,-165.74,171.03,-165.74,-174.86,-124.71,-131.63,-124.71,-88.39,-124.71,-45.15,-124.71,-1.92,-124.71,41.32,-124.71,84.56,-124.71,127.8,-124.71,171.03,-124.71,-174.86,-83.67,-131.63,-83.67,-88.39,-83.67,-45.15,-83.67,-1.92,-83.67,41.32,-83.67,84.56,-83.67,127.8,-83.67,171.03,-83.67,-174.86,-42.64,-131.63,-42.64,-88.39,-42.64,-45.15,-42.64,-1.92,-42.64,41.32,-42.64,84.56,-42.64,127.8,-42.64,171.03,-42.64,-174.86,-1.6,-131.63,-1.6,-88.39,-1.6,-45.15,-1.6,-1.92,-1.6,41.32,-1.6,84.56,-1.6,127.8,-1.6,171.03,-1.6,-174.86,39.43,-131.63,39.43,-88.39,39.43,-45.15,39.43,-1.92,39.43,41.32,39.43,84.56,39.43,127.8,39.43,171.03,39.43,-174.86,80.46,-131.63,80.46,-88.39,80.46,-45.15,80.46,-1.92,80.46,41.32,80.46,84.56,80.46,127.8,80.46,171.03,80.46,-174.86,121.5,-131.63,121.5,-88.39,121.5,-45.15,121.5,-1.92,121.5,41.32,121.5,84.56,121.5,127.8,121.5,171.03,121.5,-174.86,162.53,-131.63,162.53,-88.39,162.53,-45.15,162.53,-1.92,162.53,41.32,162.53,84.56,162.53,127.8,162.53,171.03,162.53]},{"type":"surface","name":"B_CLOTHES.10","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-87.08,-101.69,-67.29,-101.69,-47.49,-101.69,-27.7,-101.69,-7.9,-101.69,11.89,-101.69,31.68,-101.69,51.48,-101.69,71.27,-101.69,-87.08,-85.59,-67.29,-85.59,-47.49,-85.59,-27.7,-85.59,-7.9,-85.59,11.89,-85.59,31.68,-85.59,51.48,-85.59,71.27,-85.59,-87.08,-69.49,-67.29,-69.49,-47.49,-69.49,-27.7,-69.49,-7.9,-69.49,11.89,-69.49,31.68,-69.49,51.48,-69.49,71.27,-69.49,-87.08,-53.38,-67.29,-53.38,-47.49,-53.38,-27.7,-53.38,-7.9,-53.38,11.89,-53.38,31.68,-53.38,51.48,-53.38,71.27,-53.38,-87.08,-37.28,-67.29,-37.28,-47.49,-37.28,-27.7,-37.28,-7.9,-37.28,11.89,-37.28,31.68,-37.28,51.48,-37.28,71.27,-37.28,-87.08,-21.17,-67.29,-21.17,-47.49,-21.17,-27.7,-21.17,-7.9,-21.17,11.89,-21.17,31.68,-21.17,51.48,-21.17,71.27,-21.17,-87.08,-5.07,-67.29,-5.07,-47.49,-5.07,-27.7,-5.07,-7.9,-5.07,11.89,-5.07,31.68,-5.07,51.48,-5.07,71.27,-5.07,-87.08,11.03,-67.29,11.03,-47.49,11.03,-27.7,11.03,-7.9,11.03,11.89,11.03,31.68,11.03,51.48,11.03,71.27,11.03,-87.08,27.14,-67.29,27.14,-47.49,27.14,-27.7,27.14,-7.9,27.14,11.89,27.14,31.68,27.14,51.48,27.14,71.27,27.14]},{"type":"surface","name":"B_CLOTHES.11","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-53.62,-108.24,-45.36,-108.24,-37.1,-108.24,-28.84,-108.24,-20.58,-108.24,-12.33,-108.24,-4.07,-108.24,4.19,-108.24,12.45,-108.24,-53.62,-99.87,-45.36,-99.87,-37.1,-99.87,-28.84,-99.87,-20.58,-99.87,-12.33,-99.87,-4.07,-99.87,4.19,-99.87,12.45,-99.87,-53.62,-91.51,-45.36,-91.51,-37.1,-91.51,-28.84,-91.51,-20.58,-91.51,-12.33,-91.51,-4.07,-91.51,4.19,-91.51,12.45,-91.51,-53.62,-83.15,-45.36,-83.15,-37.1,-83.15,-28.84,-83.15,-20.58,-83.15,-12.33,-83.15,-4.07,-83.15,4.19,-83.15,12.45,-83.15,-53.62,-74.78,-45.36,-74.78,-37.1,-74.78,-28.84,-74.78,-20.58,-74.78,-12.33,-74.78,-4.07,-74.78,4.19,-74.78,12.45,-74.78,-53.62,-66.42,-45.36,-66.42,-37.1,-66.42,-28.84,-66.42,-20.58,-66.42,-12.33,-66.42,-4.07,-66.42,4.19,-66.42,12.45,-66.42,-53.62,-58.05,-45.36,-58.05,-37.1,-58.05,-28.84,-58.05,-20.58,-58.05,-12.33,-58.05,-4.07,-58.05,4.19,-58.05,12.45,-58.05,-53.62,-49.69,-45.36,-49.69,-37.1,-49.69,-28.84,-49.69,-20.58,-49.69,-12.33,-49.69,-4.07,-49.69,4.19,-49.69,12.45,-49.69,-53.62,-41.33,-45.36,-41.33,-37.1,-41.33,-28.84,-41.33,-20.58,-41.33,-12.33,-41.33,-4.07,-41.33,4.19,-41.33,12.45,-41.33]},{"type":"surface","name":"B_CLOTHES.12","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-21.62,-111.4,-13.24,-111.4,-4.86,-111.4,3.52,-111.4,11.89,-111.4,20.27,-111.4,28.65,-111.4,37.03,-111.4,45.41,-111.4,-21.62,-102.75,-13.24,-102.75,-4.86,-102.75,3.52,-102.75,11.89,-102.75,20.27,-102.75,28.65,-102.75,37.03,-102.75,45.41,-102.75,-21.62,-94.09,-13.24,-94.09,-4.86,-94.09,3.52,-94.09,11.89,-94.09,20.27,-94.09,28.65,-94.09,37.03,-94.09,45.41,-94.09,-21.62,-85.44,-13.24,-85.44,-4.86,-85.44,3.52,-85.44,11.89,-85.44,20.27,-85.44,28.65,-85.44,37.03,-85.44,45.41,-85.44,-21.62,-76.78,-13.24,-76.78,-4.86,-76.78,3.52,-76.78,11.89,-76.78,20.27,-76.78,28.65,-76.78,37.03,-76.78,45.41,-76.78,-21.62,-68.12,-13.24,-68.12,-4.86,-68.12,3.52,-68.12,11.89,-68.12,20.27,-68.12,28.65,-68.12,37.03,-68.12,45.41,-68.12,-21.62,-59.47,-13.24,-59.47,-4.86,-59.47,3.52,-59.47,11.89,-59.47,20.27,-59.47,28.65,-59.47,37.03,-59.47,45.41,-59.47,-21.62,-50.81,-13.24,-50.81,-4.86,-50.81,3.52,-50.81,11.89,-50.81,20.27,-50.81,28.65,-50.81,37.03,-50.81,45.41,-50.81,-21.62,-42.16,-13.24,-42.16,-4.86,-42.16,3.52,-42.16,11.89,-42.16,20.27,-42.16,28.65,-42.16,37.03,-42.16,45.41,-42.16]},{"type":"surface","name":"B_CLOTHES.14","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-46.57,-148.7,-23.14,-148.7,0.29,-148.7,23.72,-148.7,47.15,-148.7,70.58,-148.7,94.01,-148.7,117.44,-148.7,140.87,-148.7,-46.57,-117.79,-23.14,-117.79,0.29,-117.79,23.72,-117.79,47.15,-117.79,70.58,-117.79,94.01,-117.79,117.44,-117.79,140.87,-117.79,-46.57,-86.89,-23.14,-86.89,0.29,-86.89,23.72,-86.89,47.15,-86.89,70.58,-86.89,94.01,-86.89,117.44,-86.89,140.87,-86.89,-46.57,-55.98,-23.14,-55.98,0.29,-55.98,23.72,-55.98,47.15,-55.98,70.58,-55.98,94.01,-55.98,117.44,-55.98,140.87,-55.98,-46.57,-25.08,-23.14,-25.08,0.29,-25.08,23.72,-25.08,47.15,-25.08,70.58,-25.08,94.01,-25.08,117.44,-25.08,140.87,-25.08,-46.57,5.83,-23.14,5.83,0.29,5.83,23.72,5.83,47.15,5.83,70.58,5.83,94.01,5.83,117.44,5.83,140.87,5.83,-46.57,36.74,-23.14,36.74,0.29,36.74,23.72,36.74,47.15,36.74,70.58,36.74,94.01,36.74,117.44,36.74,140.87,36.74,-46.57,67.64,-23.14,67.64,0.29,67.64,23.72,67.64,47.15,67.64,70.58,67.64,94.01,67.64,117.44,67.64,140.87,67.64,-46.57,98.55,-23.14,98.55,0.29,98.55,23.72,98.55,47.15,98.55,70.58,98.55,94.01,98.55,117.44,98.55,140.87,98.55]},{"type":"surface","name":"B_CLOTHES.15","parent":"B_CLOTHES.14","segmentX":8,"segmentY":8,"vertices":[-170.95,-184.9,-128.03,-184.9,-85.11,-184.9,-42.19,-184.9,0.73,-184.9,43.65,-184.9,86.56,-184.9,129.48,-184.9,172.4,-184.9,-170.95,-139.4,-128.03,-139.4,-85.11,-139.4,-42.19,-139.4,0.73,-139.4,43.65,-139.4,86.56,-139.4,129.48,-139.4,172.4,-139.4,-170.95,-93.91,-128.03,-93.91,-85.11,-93.91,-42.19,-93.91,0.73,-93.91,43.65,-93.91,86.56,-93.91,129.48,-93.91,172.4,-93.91,-170.95,-48.41,-128.03,-48.41,-85.11,-48.41,-42.18,-48.41,0.66,-48.41,43.5,-48.41,86.41,-48.41,129.4,-48.41,172.4,-48.41,-170.95,-2.92,-128.03,-2.92,-85.11,-2.92,-42.26,-2.92,-0.02,-2.92,42.21,-2.92,85.23,-2.92,128.79,-2.92,172.4,-2.92,-170.95,42.58,-128.03,42.58,-85.11,42.58,-42.34,42.58,-0.71,42.58,40.92,42.58,84.04,42.58,128.18,42.58,172.4,42.58,-170.95,88.08,-128.03,88.08,-85.11,88.08,-42.34,88.08,-0.61,88.08,41.12,88.08,84.24,88.08,128.28,88.08,172.4,88.08,-170.95,133.57,-128.03,133.57,-85.11,133.57,-42.27,133.57,0.03,133.57,42.34,133.57,85.36,133.57,128.86,133.57,172.4,133.57,-170.95,179.07,-128.03,179.07,-85.11,179.07,-42.19,179.07,0.73,179.07,43.65,179.07,86.56,179.07,129.48,179.07,172.4,179.07]},{"type":"surface","name":"B_CLOTHES.18","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-154.67,-159.39,-130.05,-159.39,-105.44,-159.39,-80.83,-159.39,-56.22,-159.39,-31.6,-159.39,-6.99,-159.39,17.62,-159.39,42.24,-159.39,-154.67,-127.41,-130.05,-127.41,-105.44,-127.41,-80.83,-127.41,-56.22,-127.41,-31.6,-127.41,-6.99,-127.41,17.62,-127.41,42.24,-127.41,-154.67,-95.43,-130.05,-95.43,-105.44,-95.43,-80.83,-95.43,-56.22,-95.43,-31.6,-95.43,-6.99,-95.43,17.62,-95.43,42.24,-95.43,-154.67,-63.46,-130.05,-63.46,-105.44,-63.46,-80.83,-63.46,-56.22,-63.46,-31.6,-63.46,-6.99,-63.46,17.62,-63.46,42.24,-63.46,-154.67,-31.48,-130.05,-31.48,-105.44,-31.48,-80.83,-31.48,-56.22,-31.48,-31.6,-31.48,-6.99,-31.48,17.62,-31.48,42.24,-31.48,-154.67,0.5,-130.05,0.5,-105.44,0.5,-80.83,0.5,-56.22,0.5,-31.6,0.5,-6.99,0.5,17.62,0.5,42.24,0.5,-154.67,32.47,-130.05,32.47,-105.44,32.47,-80.83,32.47,-56.22,32.47,-31.6,32.47,-6.99,32.47,17.62,32.47,42.24,32.47,-154.67,64.45,-130.05,64.45,-105.44,64.45,-80.83,64.45,-56.22,64.45,-31.6,64.45,-6.99,64.45,17.62,64.45,42.24,64.45,-154.67,96.43,-130.05,96.43,-105.44,96.43,-80.83,96.43,-56.22,96.43,-31.6,96.43,-6.99,96.43,17.62,96.43,42.24,96.43]},{"type":"surface","name":"B_CLOTHES.34","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-133.34,-5.72,-101.37,-5.72,-69.39,-5.72,-37.41,-5.72,-5.43,-5.72,26.54,-5.72,58.52,-5.72,90.5,-5.72,122.48,-5.72,-133.34,16.38,-101.37,16.38,-69.39,16.38,-37.41,16.38,-5.43,16.38,26.54,16.38,58.52,16.38,90.5,16.38,122.48,16.38,-133.34,38.48,-101.37,38.48,-69.39,38.48,-37.41,38.48,-5.43,38.48,26.54,38.48,58.52,38.48,90.5,38.48,122.48,38.48,-133.34,60.58,-101.37,60.58,-69.39,60.58,-37.41,60.58,-5.43,60.58,26.54,60.58,58.52,60.58,90.5,60.58,122.48,60.58,-133.34,82.68,-101.37,82.68,-69.39,82.68,-37.41,82.68,-5.43,82.68,26.54,82.68,58.52,82.68,90.5,82.68,122.48,82.68,-133.34,104.78,-101.37,104.78,-69.39,104.78,-37.41,104.78,-5.43,104.78,26.54,104.78,58.52,104.78,90.5,104.78,122.48,104.78,-133.34,126.88,-101.37,126.88,-69.39,126.88,-37.41,126.88,-5.43,126.88,26.54,126.88,58.52,126.88,90.5,126.88,122.48,126.88,-133.34,148.98,-101.37,148.98,-69.39,148.98,-37.41,148.98,-5.43,148.98,26.54,148.98,58.52,148.98,90.5,148.98,122.48,148.98,-133.34,171.08,-101.37,171.08,-69.39,171.08,-37.41,171.08,-5.43,171.08,26.54,171.08,58.52,171.08,90.5,171.08,122.48,171.08]},{"type":"surface","name":"B_CLOTHES.35","parent":"B_CLOTHES.34","segmentX":8,"segmentY":8,"vertices":[-181.91,-175.57,-137.54,-175.57,-93.18,-175.57,-48.81,-175.57,-4.45,-175.57,39.92,-175.57,84.28,-175.57,128.65,-175.57,173.01,-175.57,-181.91,-131.42,-137.54,-131.42,-93.18,-131.42,-48.81,-131.42,-4.45,-131.42,39.92,-131.42,84.28,-131.42,128.65,-131.42,173.01,-131.42,-181.91,-87.28,-137.54,-87.28,-93.18,-87.28,-48.81,-87.28,-4.45,-87.28,39.92,-87.28,84.28,-87.28,128.65,-87.28,173.01,-87.28,-181.91,-43.13,-137.54,-43.13,-93.18,-43.13,-48.81,-43.13,-4.45,-43.13,39.92,-43.13,84.28,-43.13,128.65,-43.13,173.01,-43.13,-181.91,1.01,-137.54,1.01,-93.18,1.01,-48.81,1.01,-4.45,1.01,39.92,1.01,84.28,1.01,128.65,1.01,173.01,1.01,-181.91,45.16,-137.54,45.16,-93.18,45.16,-48.81,45.16,-4.45,45.16,39.92,45.16,84.28,45.16,128.65,45.16,173.01,45.16,-181.91,89.3,-137.54,89.3,-93.18,89.3,-48.81,89.3,-4.45,89.3,39.92,89.3,84.28,89.3,128.65,89.3,173.01,89.3,-181.91,133.45,-137.54,133.45,-93.18,133.45,-48.81,133.45,-4.45,133.45,39.92,133.45,84.28,133.45,128.65,133.45,173.01,133.45,-181.91,177.6,-137.54,177.6,-93.18,177.6,-48.81,177.6,-4.45,177.6,39.92,177.6,84.28,177.6,128.65,177.6,173.01,177.6]},{"type":"surface","name":"B_CLOTHES.19","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-93.43,-150.46,-72,-150.46,-50.57,-150.46,-29.14,-150.46,-7.72,-150.46,13.71,-150.46,35.14,-150.46,56.57,-150.46,77.99,-150.46,-93.43,-142.03,-72,-142.03,-50.57,-142.03,-29.14,-142.03,-7.72,-142.03,13.71,-142.03,35.14,-142.03,56.57,-142.03,77.99,-142.03,-93.43,-133.61,-72,-133.61,-50.57,-133.61,-29.14,-133.61,-7.72,-133.61,13.71,-133.61,35.14,-133.61,56.57,-133.61,77.99,-133.61,-93.43,-125.19,-72,-125.19,-50.57,-125.19,-29.14,-125.19,-7.72,-125.19,13.71,-125.19,35.14,-125.19,56.57,-125.19,77.99,-125.19,-93.43,-116.76,-72,-116.76,-50.57,-116.76,-29.14,-116.76,-7.72,-116.76,13.71,-116.76,35.14,-116.76,56.57,-116.76,77.99,-116.76,-93.43,-108.34,-72,-108.34,-50.57,-108.34,-29.14,-108.34,-7.72,-108.34,13.71,-108.34,35.14,-108.34,56.57,-108.34,77.99,-108.34,-93.43,-99.92,-72,-99.92,-50.57,-99.92,-29.14,-99.92,-7.72,-99.92,13.71,-99.92,35.14,-99.92,56.57,-99.92,77.99,-99.92,-93.43,-91.49,-72,-91.49,-50.57,-91.49,-29.14,-91.49,-7.72,-91.49,13.71,-91.49,35.14,-91.49,56.57,-91.49,77.99,-91.49,-93.43,-83.07,-72,-83.07,-50.57,-83.07,-29.14,-83.07,-7.72,-83.07,13.71,-83.07,35.14,-83.07,56.57,-83.07,77.99,-83.07]},{"type":"surface","name":"B_CLOTHES.20","parent":"B_CLOTHES.19","segmentX":8,"segmentY":8,"vertices":[-163.31,-157.15,-122.61,-157.15,-81.92,-157.15,-41.22,-157.15,-0.53,-157.15,40.16,-157.15,80.86,-157.15,121.55,-157.15,162.25,-157.15,-163.31,-116.49,-122.61,-116.49,-81.92,-116.49,-41.22,-116.49,-0.53,-116.49,40.16,-116.49,80.86,-116.49,121.55,-116.49,162.25,-116.49,-163.31,-75.84,-122.61,-75.84,-81.92,-75.84,-41.22,-75.84,-0.53,-75.84,40.16,-75.84,80.86,-75.84,121.55,-75.84,162.25,-75.84,-163.31,-35.19,-122.61,-35.19,-81.92,-35.19,-41.22,-35.19,-0.53,-35.19,40.16,-35.19,80.86,-35.19,121.55,-35.19,162.25,-35.19,-163.31,5.46,-122.61,5.46,-81.92,5.46,-41.22,5.46,-0.53,5.46,40.16,5.46,80.86,5.46,121.55,5.46,162.25,5.46,-163.31,46.11,-122.61,46.11,-81.92,46.11,-41.22,46.11,-0.53,46.11,40.16,46.11,80.86,46.11,121.55,46.11,162.25,46.11,-163.31,86.77,-122.61,86.77,-81.92,86.77,-41.22,86.77,-0.53,86.77,40.16,86.77,80.86,86.77,121.55,86.77,162.25,86.77,-163.31,127.42,-122.61,127.42,-81.92,127.42,-41.22,127.42,-0.53,127.42,40.16,127.42,80.86,127.42,121.55,127.42,162.25,127.42,-163.31,168.07,-122.61,168.07,-81.92,168.07,-41.22,168.07,-0.53,168.07,40.16,168.07,80.86,168.07,121.55,168.07,162.25,168.07]},{"type":"surface","name":"B_CLOTHES.21","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-87.05,-156.8,-73.69,-156.8,-60.34,-156.8,-46.98,-156.8,-33.63,-156.8,-20.27,-156.8,-6.92,-156.8,6.44,-156.8,19.79,-156.8,-87.05,-142.85,-73.69,-142.85,-60.34,-142.85,-46.98,-142.85,-33.63,-142.85,-20.27,-142.85,-6.92,-142.85,6.44,-142.85,19.79,-142.85,-87.05,-128.89,-73.69,-128.89,-60.34,-128.89,-46.98,-128.89,-33.63,-128.89,-20.27,-128.89,-6.92,-128.89,6.44,-128.89,19.79,-128.89,-87.05,-114.94,-73.69,-114.94,-60.34,-114.94,-46.98,-114.94,-33.63,-114.94,-20.27,-114.94,-6.92,-114.94,6.44,-114.94,19.79,-114.94,-87.05,-100.99,-73.69,-100.99,-60.34,-100.99,-46.98,-100.99,-33.63,-100.99,-20.27,-100.99,-6.92,-100.99,6.44,-100.99,19.79,-100.99,-87.05,-87.04,-73.69,-87.04,-60.34,-87.04,-46.98,-87.04,-33.63,-87.04,-20.27,-87.04,-6.92,-87.04,6.44,-87.04,19.79,-87.04,-87.05,-73.09,-73.69,-73.09,-60.34,-73.09,-46.98,-73.09,-33.63,-73.09,-20.27,-73.09,-6.92,-73.09,6.44,-73.09,19.79,-73.09,-87.05,-59.13,-73.69,-59.13,-60.34,-59.13,-46.98,-59.13,-33.63,-59.13,-20.27,-59.13,-6.92,-59.13,6.44,-59.13,19.79,-59.13,-87.05,-45.18,-73.69,-45.18,-60.34,-45.18,-46.98,-45.18,-33.63,-45.18,-20.27,-45.18,-6.92,-45.18,6.44,-45.18,19.79,-45.18]},{"type":"surface","name":"B_CLOTHES.22","parent":"B_CLOTHES.21","segmentX":8,"segmentY":8,"vertices":[-160.81,-173.51,-120.55,-173.51,-80.28,-173.51,-40.02,-173.51,0.24,-173.51,40.51,-173.51,80.77,-173.51,121.03,-173.51,161.3,-173.51,-160.81,-130.89,-120.55,-130.89,-80.28,-130.89,-40.02,-130.89,0.24,-130.89,40.51,-130.89,80.77,-130.89,121.03,-130.89,161.3,-130.89,-160.81,-88.27,-120.55,-88.27,-80.28,-88.27,-40.02,-88.27,0.24,-88.27,40.51,-88.27,80.77,-88.27,121.03,-88.27,161.3,-88.27,-160.81,-45.65,-120.55,-45.65,-80.28,-45.65,-40.02,-45.65,0.24,-45.65,40.51,-45.65,80.77,-45.65,121.03,-45.65,161.3,-45.65,-160.81,-3.04,-120.55,-3.04,-80.28,-3.04,-40.02,-3.04,0.24,-3.04,40.51,-3.04,80.77,-3.04,121.03,-3.04,161.3,-3.04,-160.81,39.58,-120.55,39.58,-80.28,39.58,-40.02,39.58,0.24,39.58,40.51,39.58,80.77,39.58,121.03,39.58,161.3,39.58,-160.81,82.2,-120.55,82.2,-80.28,82.2,-40.02,82.2,0.24,82.2,40.51,82.2,80.77,82.2,121.03,82.2,161.3,82.2,-160.81,124.81,-120.55,124.81,-80.28,124.81,-40.02,124.81,0.24,124.81,40.51,124.81,80.77,124.81,121.03,124.81,161.3,124.81,-160.81,167.43,-120.55,167.43,-80.28,167.43,-40.02,167.43,0.24,167.43,40.51,167.43,80.77,167.43,121.03,167.43,161.3,167.43]},{"type":"surface","name":"B_CLOTHES.23","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-36.75,-157.67,-22.96,-157.67,-9.17,-157.67,4.63,-157.67,18.42,-157.67,32.21,-157.67,46.01,-157.67,59.8,-157.67,73.6,-157.67,-36.75,-143.19,-22.96,-143.19,-9.17,-143.19,4.63,-143.19,18.42,-143.19,32.21,-143.19,46.01,-143.19,59.8,-143.19,73.6,-143.19,-36.75,-128.71,-22.96,-128.71,-9.17,-128.71,4.63,-128.71,18.42,-128.71,32.21,-128.71,46.01,-128.71,59.8,-128.71,73.6,-128.71,-36.75,-114.24,-22.96,-114.24,-9.17,-114.24,4.63,-114.24,18.42,-114.24,32.21,-114.24,46.01,-114.24,59.8,-114.24,73.6,-114.24,-36.75,-99.76,-22.96,-99.76,-9.17,-99.76,4.63,-99.76,18.42,-99.76,32.21,-99.76,46.01,-99.76,59.8,-99.76,73.6,-99.76,-36.75,-85.28,-22.96,-85.28,-9.17,-85.28,4.63,-85.28,18.42,-85.28,32.21,-85.28,46.01,-85.28,59.8,-85.28,73.6,-85.28,-36.75,-70.81,-22.96,-70.81,-9.17,-70.81,4.63,-70.81,18.42,-70.81,32.21,-70.81,46.01,-70.81,59.8,-70.81,73.6,-70.81,-36.75,-56.33,-22.96,-56.33,-9.17,-56.33,4.63,-56.33,18.42,-56.33,32.21,-56.33,46.01,-56.33,59.8,-56.33,73.6,-56.33,-36.75,-41.85,-22.96,-41.85,-9.17,-41.85,4.63,-41.85,18.42,-41.85,32.21,-41.85,46.01,-41.85,59.8,-41.85,73.6,-41.85]},{"type":"surface","name":"B_CLOTHES.24","parent":"B_CLOTHES.23","segmentX":8,"segmentY":8,"vertices":[-156.87,-164.06,-118.71,-164.06,-80.56,-164.06,-42.4,-164.06,-4.24,-164.06,33.91,-164.06,72.07,-164.06,110.23,-164.06,148.38,-164.06,-156.87,-121.18,-118.71,-121.18,-80.56,-121.18,-42.4,-121.18,-4.24,-121.18,33.91,-121.18,72.07,-121.18,110.23,-121.18,148.38,-121.18,-156.87,-78.3,-118.71,-78.3,-80.56,-78.3,-42.4,-78.3,-4.24,-78.3,33.91,-78.3,72.07,-78.3,110.23,-78.3,148.38,-78.3,-156.87,-35.42,-118.71,-35.42,-80.56,-35.42,-42.4,-35.42,-4.24,-35.42,33.91,-35.42,72.07,-35.42,110.23,-35.42,148.38,-35.42,-156.87,7.45,-118.71,7.45,-80.56,7.45,-42.4,7.45,-4.24,7.45,33.91,7.45,72.07,7.45,110.23,7.45,148.38,7.45,-156.87,50.33,-118.71,50.33,-80.56,50.33,-42.4,50.33,-4.24,50.33,33.91,50.33,72.07,50.33,110.23,50.33,148.38,50.33,-156.87,93.21,-118.71,93.21,-80.56,93.21,-42.4,93.21,-4.24,93.21,33.91,93.21,72.07,93.21,110.23,93.21,148.38,93.21,-156.87,136.09,-118.71,136.09,-80.56,136.09,-42.4,136.09,-4.24,136.09,33.91,136.09,72.07,136.09,110.23,136.09,148.38,136.09,-156.87,178.97,-118.71,178.97,-80.56,178.97,-42.4,178.97,-4.24,178.97,33.91,178.97,72.07,178.97,110.23,178.97,148.38,178.97]},{"type":"surface","name":"B_CLOTHES.13","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-126.12,-153.96,-96.38,-153.96,-66.63,-153.96,-36.89,-153.96,-7.14,-153.96,22.6,-153.96,52.35,-153.96,82.09,-153.96,111.84,-153.96,-126.12,-122.06,-96.38,-122.06,-66.63,-122.06,-36.89,-122.06,-7.14,-122.06,22.6,-122.06,52.35,-122.06,82.09,-122.06,111.84,-122.06,-126.12,-90.16,-96.38,-90.16,-66.63,-90.16,-36.89,-90.16,-7.14,-90.16,22.6,-90.16,52.35,-90.16,82.09,-90.16,111.84,-90.16,-126.12,-58.26,-96.38,-58.26,-66.63,-58.26,-36.89,-58.26,-7.14,-58.26,22.6,-58.26,52.35,-58.26,82.09,-58.26,111.84,-58.26,-126.12,-26.36,-96.38,-26.36,-66.63,-26.36,-36.89,-26.36,-7.14,-26.36,22.6,-26.36,52.35,-26.36,82.09,-26.36,111.84,-26.36,-126.12,5.54,-96.38,5.54,-66.63,5.54,-36.89,5.54,-7.14,5.54,22.6,5.54,52.35,5.54,82.09,5.54,111.84,5.54,-126.12,37.44,-96.38,37.44,-66.63,37.44,-36.89,37.44,-7.14,37.44,22.6,37.44,52.35,37.44,82.09,37.44,111.84,37.44,-126.12,69.34,-96.38,69.34,-66.63,69.34,-36.89,69.34,-7.14,69.34,22.6,69.34,52.35,69.34,82.09,69.34,111.84,69.34,-126.12,101.24,-96.38,101.24,-66.63,101.24,-36.89,101.24,-7.14,101.24,22.6,101.24,52.35,101.24,82.09,101.24,111.84,101.24]},{"type":"surface","name":"B_CLOTHES.16","parent":"B_CLOTHES.13","segmentX":8,"segmentY":8,"vertices":[-183.16,-186.18,-137.23,-186.18,-91.3,-186.18,-45.37,-186.18,0.56,-186.18,46.5,-186.18,92.43,-186.18,138.36,-186.18,184.29,-186.18,-183.16,-139.66,-137.23,-139.66,-91.3,-139.66,-45.37,-139.66,0.56,-139.66,46.5,-139.66,92.43,-139.66,138.36,-139.66,184.29,-139.66,-183.16,-93.15,-137.23,-93.15,-91.3,-93.15,-45.37,-93.15,0.56,-93.15,46.5,-93.15,92.43,-93.15,138.36,-93.15,184.29,-93.15,-183.16,-46.63,-137.23,-46.63,-91.3,-46.63,-45.37,-46.63,0.56,-46.63,46.5,-46.63,92.43,-46.63,138.36,-46.63,184.29,-46.63,-183.16,-0.11,-137.23,-0.11,-91.3,-0.11,-45.37,-0.11,0.56,-0.11,46.5,-0.11,92.43,-0.11,138.36,-0.11,184.29,-0.11,-183.16,46.4,-137.23,46.4,-91.3,46.4,-45.37,46.4,0.56,46.4,46.5,46.4,92.43,46.4,138.36,46.4,184.29,46.4,-183.16,92.92,-137.23,92.92,-91.3,92.92,-45.37,92.92,0.56,92.92,46.5,92.92,92.43,92.92,138.36,92.92,184.29,92.92,-183.16,139.43,-137.23,139.43,-91.3,139.43,-45.37,139.43,0.56,139.43,46.5,139.43,92.43,139.43,138.36,139.43,184.29,139.43,-183.16,185.95,-137.23,185.95,-91.3,185.95,-45.37,185.95,0.56,185.95,46.5,185.95,92.43,185.95,138.36,185.95,184.29,185.95]},{"length":150,"name":"B_CLOTHES.38","parent":"B_CLOTHES.18","transform":{"x":-106.64,"y":-60.89,"skX":84.7,"skY":84.7}},{"length":150,"name":"B_CLOTHES.39","parent":"B_CLOTHES.38","transform":{"x":291.48,"y":-20.7,"skX":-163.5,"skY":-163.5}},{"length":150,"name":"B_NECK.02","parent":"B_BODY.02","transform":{"x":-8.17,"y":-92.16,"skX":-90,"skY":-90}},{"length":150,"name":"B_CLOTHES.62","parent":"B_CLOTHES.18","transform":{"x":-106.64,"y":-60.89,"skX":84.7,"skY":84.7}},{"length":150,"name":"B_FACE.02","parent":"B_NECK.02","transform":{"x":91.33,"y":-0.17}},{"type":"surface","name":"B_EYE.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[313.89,-214.32,313.89,-189.18,313.89,-164.03,313.89,-138.89,313.89,-113.75,313.89,-88.61,313.89,-63.47,313.89,-38.32,313.89,-13.18,286.99,-214.32,286.99,-189.18,286.99,-164.03,286.99,-138.89,286.99,-113.75,286.99,-88.61,286.99,-63.47,286.99,-38.32,286.99,-13.18,260.08,-214.32,260.08,-189.18,260.08,-164.03,260.08,-138.89,260.08,-113.75,260.08,-88.61,260.08,-63.47,260.08,-38.32,260.08,-13.18,233.18,-214.32,233.18,-189.18,233.18,-164.03,233.18,-138.89,233.18,-113.75,233.18,-88.61,233.18,-63.47,233.18,-38.32,233.18,-13.18,206.28,-214.32,206.28,-189.18,206.28,-164.03,206.28,-138.89,206.28,-113.75,206.28,-88.61,206.28,-63.47,206.28,-38.32,206.28,-13.18,179.37,-214.32,179.37,-189.18,179.37,-164.03,179.37,-138.89,179.37,-113.75,179.37,-88.61,179.37,-63.47,179.37,-38.32,179.37,-13.18,152.47,-214.32,152.47,-189.18,152.47,-164.03,152.47,-138.89,152.47,-113.75,152.47,-88.61,152.47,-63.47,152.47,-38.32,152.47,-13.18,125.56,-214.32,125.56,-189.18,125.56,-164.03,125.56,-138.89,125.56,-113.75,125.56,-88.61,125.56,-63.47,125.56,-38.32,125.56,-13.18,98.66,-214.32,98.66,-189.18,98.66,-164.03,98.66,-138.89,98.66,-113.75,98.66,-88.61,98.66,-63.47,98.66,-38.32,98.66,-13.18]},{"type":"surface","name":"B_EYE.04","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[333.42,-28.13,333.42,-0.2,333.42,27.72,333.42,55.64,333.42,83.56,333.42,111.48,333.42,139.41,333.42,167.33,333.42,195.25,304.22,-28.13,304.22,-0.2,304.22,27.72,304.22,55.64,304.22,83.56,304.22,111.48,304.22,139.41,304.22,167.33,304.22,195.25,275.02,-28.13,275.02,-0.2,275.02,27.72,275.02,55.64,275.02,83.56,275.02,111.48,275.02,139.41,275.02,167.33,275.02,195.25,245.82,-28.13,245.82,-0.2,245.82,27.72,245.82,55.64,245.82,83.56,245.82,111.48,245.82,139.41,245.82,167.33,245.82,195.25,216.61,-28.13,216.61,-0.2,216.61,27.72,216.61,55.64,216.61,83.56,216.61,111.48,216.61,139.41,216.61,167.33,216.61,195.25,187.41,-28.13,187.41,-0.2,187.41,27.72,187.41,55.64,187.41,83.56,187.41,111.48,187.41,139.41,187.41,167.33,187.41,195.25,158.21,-28.13,158.21,-0.2,158.21,27.72,158.21,55.64,158.21,83.56,158.21,111.48,158.21,139.41,158.21,167.33,158.21,195.25,129.01,-28.13,129.01,-0.2,129.01,27.72,129.01,55.64,129.01,83.56,129.01,111.48,129.01,139.41,129.01,167.33,129.01,195.25,99.8,-28.13,99.8,-0.2,99.8,27.72,99.8,55.64,99.8,83.56,99.8,111.48,99.8,139.41,99.8,167.33,99.8,195.25]},{"type":"surface","name":"B_BROW.05","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[401.57,-269.07,401.57,-229.06,401.57,-189.05,401.57,-149.04,401.57,-109.03,401.57,-69.03,401.57,-29.02,401.57,10.99,401.57,51,369.37,-269.07,369.37,-229.06,369.37,-189.05,369.37,-149.04,369.37,-109.03,369.37,-69.03,369.37,-29.02,369.37,10.99,369.37,51,337.16,-269.07,337.16,-229.06,337.16,-189.05,337.16,-149.04,337.16,-109.03,337.16,-69.03,337.16,-29.02,337.16,10.99,337.16,51,304.96,-269.07,304.96,-229.06,304.96,-189.05,304.96,-149.04,304.96,-109.03,304.96,-69.03,304.96,-29.02,304.96,10.99,304.96,51,272.75,-269.07,272.75,-229.06,272.75,-189.05,272.75,-149.04,272.75,-109.03,272.75,-69.03,272.75,-29.02,272.75,10.99,272.75,51,240.55,-269.07,240.55,-229.06,240.55,-189.05,240.55,-149.04,240.55,-109.03,240.55,-69.03,240.55,-29.02,240.55,10.99,240.55,51,208.35,-269.07,208.35,-229.06,208.35,-189.05,208.35,-149.04,208.35,-109.03,208.35,-69.03,208.35,-29.02,208.35,10.99,208.35,51,176.14,-269.07,176.14,-229.06,176.14,-189.05,176.14,-149.04,176.14,-109.03,176.14,-69.03,176.14,-29.02,176.14,10.99,176.14,51,143.94,-269.07,143.94,-229.06,143.94,-189.05,143.94,-149.04,143.94,-109.03,143.94,-69.03,143.94,-29.02,143.94,10.99,143.94,51]},{"type":"surface","name":"B_BROW.06","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[412.5,-68.36,412.5,-31.02,412.5,6.32,412.5,43.67,412.5,81.01,412.5,118.35,412.5,155.69,412.5,193.03,412.5,230.37,380.56,-68.36,380.56,-31.02,380.56,6.32,380.56,43.67,380.56,81.01,380.56,118.35,380.56,155.69,380.56,193.03,380.56,230.37,348.62,-68.36,348.62,-31.02,348.62,6.32,348.62,43.67,348.62,81.01,348.62,118.35,348.62,155.69,348.62,193.03,348.62,230.37,316.68,-68.36,316.68,-31.02,316.68,6.32,316.68,43.67,316.68,81.01,316.68,118.35,316.68,155.69,316.68,193.03,316.68,230.37,284.74,-68.36,284.74,-31.02,284.74,6.32,284.74,43.67,284.74,81.01,284.74,118.35,284.74,155.69,284.74,193.03,284.74,230.37,252.8,-68.36,252.8,-31.02,252.8,6.32,252.8,43.67,252.8,81.01,252.8,118.35,252.8,155.69,252.8,193.03,252.8,230.37,220.86,-68.36,220.86,-31.02,220.86,6.32,220.86,43.67,220.86,81.01,220.86,118.35,220.86,155.69,220.86,193.03,220.86,230.37,188.92,-68.36,188.92,-31.02,188.92,6.32,188.92,43.67,188.92,81.01,188.92,118.35,188.92,155.69,188.92,193.03,188.92,230.37,156.98,-68.36,156.98,-31.02,156.98,6.32,156.98,43.67,156.98,81.01,156.98,118.35,156.98,155.69,156.98,193.03,156.98,230.37]},{"type":"surface","name":"B_MOUTH.03","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[156.33,-132.7,156.33,-101.46,156.33,-70.21,156.33,-38.96,156.33,-7.71,156.33,23.53,156.33,54.78,156.33,86.03,156.33,117.28,132.61,-132.7,132.61,-101.46,132.61,-70.21,132.61,-38.96,132.61,-7.71,132.61,23.53,132.61,54.78,132.61,86.03,132.61,117.28,108.88,-132.7,108.88,-101.46,108.88,-70.21,108.88,-38.96,108.88,-7.71,108.88,23.53,108.88,54.78,108.88,86.03,108.88,117.28,85.16,-132.7,85.16,-101.46,85.16,-70.21,85.16,-38.96,85.16,-7.71,85.16,23.53,85.16,54.78,85.16,86.03,85.16,117.28,61.43,-132.7,61.43,-101.46,61.43,-70.21,61.43,-38.96,61.43,-7.71,61.43,23.53,61.43,54.78,61.43,86.03,61.43,117.28,37.71,-132.7,37.71,-101.46,37.71,-70.21,37.71,-38.96,37.71,-7.71,37.71,23.53,37.71,54.78,37.71,86.03,37.71,117.28,13.98,-132.7,13.98,-101.46,13.98,-70.21,13.98,-38.96,13.98,-7.71,13.98,23.53,13.98,54.78,13.98,86.03,13.98,117.28,-9.74,-132.7,-9.74,-101.46,-9.74,-70.21,-9.74,-38.96,-9.74,-7.71,-9.74,23.53,-9.74,54.78,-9.74,86.03,-9.74,117.28,-33.47,-132.7,-33.47,-101.46,-33.47,-70.21,-33.47,-38.96,-33.47,-7.71,-33.47,23.53,-33.47,54.78,-33.47,86.03,-33.47,117.28]},{"type":"surface","name":"B_NOSE.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[141.96,-33.67,141.96,-29.17,141.96,-24.67,141.96,-20.17,141.96,-15.67,141.96,-11.17,141.96,-6.67,141.96,-2.17,141.96,2.33,137.36,-33.67,137.36,-29.17,137.36,-24.67,137.36,-20.17,137.36,-15.67,137.36,-11.17,137.36,-6.67,137.36,-2.17,137.36,2.33,132.77,-33.67,132.77,-29.17,132.77,-24.67,132.77,-20.17,132.77,-15.67,132.77,-11.17,132.77,-6.67,132.77,-2.17,132.77,2.33,128.18,-33.67,128.18,-29.17,128.18,-24.67,128.18,-20.17,128.18,-15.67,128.18,-11.17,128.18,-6.67,128.18,-2.17,128.18,2.33,123.58,-33.67,123.58,-29.17,123.58,-24.67,123.58,-20.17,123.58,-15.67,123.58,-11.17,123.58,-6.67,123.58,-2.17,123.58,2.33,118.99,-33.67,118.99,-29.17,118.99,-24.67,118.99,-20.17,118.99,-15.67,118.99,-11.17,118.99,-6.67,118.99,-2.17,118.99,2.33,114.4,-33.67,114.4,-29.17,114.4,-24.67,114.4,-20.17,114.4,-15.67,114.4,-11.17,114.4,-6.67,114.4,-2.17,114.4,2.33,109.8,-33.67,109.8,-29.17,109.8,-24.67,109.8,-20.17,109.8,-15.67,109.8,-11.17,109.8,-6.67,109.8,-2.17,109.8,2.33,105.21,-33.67,105.21,-29.17,105.21,-24.67,105.21,-20.17,105.21,-15.67,105.21,-11.17,105.21,-6.67,105.21,-2.17,105.21,2.33]},{"type":"surface","name":"B_EAR.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[252.74,89.02,252.74,106.52,252.74,124.02,252.74,141.52,252.74,159.03,252.74,176.53,252.74,194.03,252.74,211.53,252.74,229.04,229.88,89.02,229.88,106.52,229.88,124.02,229.88,141.52,229.88,159.03,229.88,176.53,229.88,194.03,229.88,211.53,229.88,229.04,207.03,89.02,207.03,106.52,207.03,124.02,207.03,141.52,207.03,159.03,207.03,176.53,207.03,194.03,207.03,211.53,207.03,229.04,184.17,89.02,184.17,106.52,184.17,124.02,184.17,141.52,184.17,159.03,184.17,176.53,184.17,194.03,184.17,211.53,184.17,229.04,161.31,89.02,161.31,106.52,161.31,124.02,161.31,141.52,161.31,159.03,161.31,176.53,161.31,194.03,161.31,211.53,161.31,229.04,138.45,89.02,138.45,106.52,138.45,124.02,138.45,141.52,138.45,159.03,138.45,176.53,138.45,194.03,138.45,211.53,138.45,229.04,115.6,89.02,115.6,106.52,115.6,124.02,115.6,141.52,115.6,159.03,115.6,176.53,115.6,194.03,115.6,211.53,115.6,229.04,92.74,89.02,92.74,106.52,92.74,124.02,92.74,141.52,92.74,159.03,92.74,176.53,92.74,194.03,92.74,211.53,92.74,229.04,69.88,89.02,69.88,106.52,69.88,124.02,69.88,141.52,69.88,159.03,69.88,176.53,69.88,194.03,69.88,211.53,69.88,229.04]},{"type":"surface","name":"B_EAR.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[230.68,-240.08,230.68,-224.94,230.68,-209.8,230.68,-194.65,230.68,-179.51,230.68,-164.37,230.68,-149.22,230.68,-134.08,230.68,-118.94,209.42,-240.08,209.42,-224.94,209.42,-209.8,209.42,-194.65,209.42,-179.51,209.42,-164.37,209.42,-149.22,209.42,-134.08,209.42,-118.94,188.16,-240.08,188.16,-224.94,188.16,-209.8,188.16,-194.65,188.16,-179.51,188.16,-164.37,188.16,-149.22,188.16,-134.08,188.16,-118.94,166.9,-240.08,166.9,-224.94,166.9,-209.8,166.9,-194.65,166.9,-179.51,166.9,-164.37,166.9,-149.22,166.9,-134.08,166.9,-118.94,145.64,-240.08,145.64,-224.94,145.64,-209.8,145.64,-194.65,145.64,-179.51,145.64,-164.37,145.64,-149.22,145.64,-134.08,145.64,-118.94,124.38,-240.08,124.38,-224.94,124.38,-209.8,124.38,-194.65,124.38,-179.51,124.38,-164.37,124.38,-149.22,124.38,-134.08,124.38,-118.94,103.12,-240.08,103.12,-224.94,103.12,-209.8,103.12,-194.65,103.12,-179.51,103.12,-164.37,103.12,-149.22,103.12,-134.08,103.12,-118.94,81.86,-240.08,81.86,-224.94,81.86,-209.8,81.86,-194.65,81.86,-179.51,81.86,-164.37,81.86,-149.22,81.86,-134.08,81.86,-118.94,60.6,-240.08,60.6,-224.94,60.6,-209.8,60.6,-194.65,60.6,-179.51,60.6,-164.37,60.6,-149.22,60.6,-134.08,60.6,-118.94]},{"type":"surface","name":"B_HAIR_FRONT.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[578.23,-284.44,578.23,-217.34,578.23,-150.23,578.23,-83.12,578.23,-16.02,578.23,51.09,578.23,118.2,578.23,185.3,578.23,252.41,520.55,-284.44,520.55,-217.34,520.55,-150.23,520.55,-83.12,520.55,-16.02,520.55,51.09,520.55,118.2,520.55,185.3,520.55,252.41,462.87,-284.44,462.87,-217.34,462.87,-150.23,462.87,-83.12,462.87,-16.02,462.87,51.09,462.87,118.2,462.87,185.3,462.87,252.41,405.18,-284.44,405.18,-217.34,405.18,-150.23,405.18,-83.12,405.18,-16.02,405.18,51.09,405.18,118.2,405.18,185.3,405.18,252.41,347.5,-284.44,347.5,-217.34,347.5,-150.23,347.5,-83.12,347.5,-16.02,347.5,51.09,347.5,118.2,347.5,185.3,347.5,252.41,289.82,-284.44,289.82,-217.34,289.82,-150.23,289.82,-83.12,289.82,-16.02,289.82,51.09,289.82,118.2,289.82,185.3,289.82,252.41,232.13,-284.44,232.13,-217.34,232.13,-150.23,232.13,-83.12,232.13,-16.02,232.13,51.09,232.13,118.2,232.13,185.3,232.13,252.41,174.45,-284.44,174.45,-217.34,174.45,-150.23,174.45,-83.12,174.45,-16.02,174.45,51.09,174.45,118.2,174.45,185.3,174.45,252.41,116.77,-284.44,116.77,-217.34,116.77,-150.23,116.77,-83.12,116.77,-16.02,116.77,51.09,116.77,118.2,116.77,185.3,116.77,252.41]},{"type":"surface","name":"B_HAIR_SIDE.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[531.83,-285.13,531.83,-254.06,531.83,-222.99,531.83,-191.91,531.83,-160.84,531.83,-129.77,531.83,-98.7,531.83,-67.63,531.83,-36.55,449.05,-285.13,449.05,-254.06,449.05,-222.99,449.05,-191.91,449.05,-160.84,449.05,-129.77,449.05,-98.7,449.05,-67.63,449.05,-36.55,366.27,-285.13,366.27,-254.06,366.27,-222.99,366.27,-191.91,366.27,-160.84,366.27,-129.77,366.27,-98.7,366.27,-67.63,366.27,-36.55,283.5,-285.13,283.5,-254.06,283.5,-222.99,283.5,-191.91,283.5,-160.84,283.5,-129.77,283.5,-98.7,283.5,-67.63,283.5,-36.55,200.72,-285.13,200.72,-254.06,200.72,-222.99,200.72,-191.91,200.72,-160.84,200.72,-129.77,200.72,-98.7,200.72,-67.63,200.72,-36.55,117.94,-285.13,117.94,-254.06,117.94,-222.99,117.94,-191.91,117.94,-160.84,117.94,-129.77,117.94,-98.7,117.94,-67.63,117.94,-36.55,35.17,-285.13,35.17,-254.06,35.17,-222.99,35.17,-191.91,35.17,-160.84,35.17,-129.77,35.17,-98.7,35.17,-67.63,35.17,-36.55,-47.61,-285.13,-47.61,-254.06,-47.61,-222.99,-47.61,-191.91,-47.61,-160.84,-47.61,-129.77,-47.61,-98.7,-47.61,-67.63,-47.61,-36.55,-130.39,-285.13,-130.39,-254.06,-130.39,-222.99,-130.39,-191.91,-130.39,-160.84,-130.39,-129.77,-130.39,-98.7,-130.39,-67.63,-130.39,-36.55]},{"type":"surface","name":"B_HAIR_SIDE.04","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[523.74,26.87,523.74,54.63,523.74,82.39,523.74,110.15,523.74,137.91,523.74,165.67,523.74,193.43,523.74,221.18,523.74,248.94,444.15,26.87,444.15,54.63,444.15,82.39,444.15,110.15,444.15,137.91,444.15,165.67,444.15,193.43,444.15,221.18,444.15,248.94,364.55,26.87,364.55,54.63,364.55,82.39,364.55,110.15,364.55,137.91,364.55,165.67,364.55,193.43,364.55,221.18,364.55,248.94,284.96,26.87,284.96,54.63,284.96,82.39,284.96,110.15,284.96,137.91,284.96,165.67,284.96,193.43,284.96,221.18,284.96,248.94,205.36,26.87,205.36,54.63,205.36,82.39,205.36,110.15,205.36,137.91,205.36,165.67,205.36,193.43,205.36,221.18,205.36,248.94,125.77,26.87,125.77,54.63,125.77,82.39,125.77,110.15,125.77,137.91,125.77,165.67,125.77,193.43,125.77,221.18,125.77,248.94,46.18,26.87,46.18,54.63,46.18,82.39,46.18,110.15,46.18,137.91,46.18,165.67,46.18,193.43,46.18,221.18,46.18,248.94,-33.42,26.87,-33.42,54.63,-33.42,82.39,-33.42,110.15,-33.42,137.91,-33.42,165.67,-33.42,193.43,-33.42,221.18,-33.42,248.94,-113.01,26.87,-113.01,54.63,-113.01,82.39,-113.01,110.15,-113.01,137.91,-113.01,165.67,-113.01,193.43,-113.01,221.18,-113.01,248.94]},{"type":"surface","name":"B_HAIR_SIDE.03","parent":"B_HAIR_SIDE.04","segmentX":8,"segmentY":8,"vertices":[-179,-192.14,-133.67,-192.14,-88.34,-192.14,-43,-192.14,2.33,-192.14,47.66,-192.14,92.99,-192.14,138.33,-192.14,183.66,-192.14,-179,-144.38,-133.67,-144.38,-88.34,-144.38,-43.01,-144.38,2.32,-144.38,47.66,-144.38,92.99,-144.38,138.32,-144.38,183.65,-144.38,-179.01,-96.62,-133.68,-96.62,-88.35,-96.62,-43.01,-96.62,2.32,-96.61,47.65,-96.61,92.98,-96.61,138.32,-96.61,183.65,-96.61,-179.01,-48.85,-133.68,-48.85,-88.35,-48.85,-43.02,-48.85,2.31,-48.85,47.65,-48.85,92.98,-48.85,138.31,-48.85,183.64,-48.85,-179.02,-1.09,-133.69,-1.09,-88.35,-1.09,-43.02,-1.09,2.31,-1.09,47.64,-1.09,92.97,-1.09,138.31,-1.09,183.64,-1.09,-179.02,46.67,-133.69,46.67,-88.36,46.68,-43.03,46.68,2.31,46.68,47.64,46.68,92.97,46.68,138.3,46.68,183.63,46.68,-179.03,94.44,-133.7,94.44,-88.36,94.44,-43.03,94.44,2.3,94.44,47.63,94.44,92.96,94.44,138.3,94.44,183.63,94.44,-179.03,142.2,-133.7,142.2,-88.37,142.2,-43.04,142.2,2.3,142.2,47.63,142.2,92.96,142.2,138.29,142.21,183.62,142.21,-179.04,189.97,-133.71,189.97,-88.37,189.97,-43.04,189.97,2.29,189.97,47.62,189.97,92.95,189.97,138.29,189.97,183.62,189.97]},{"type":"surface","name":"B_HAIR_SIDE.06","parent":"B_HAIR_SIDE.03","segmentX":8,"segmentY":8,"vertices":[-177.88,-194.08,-133.49,-194.08,-89.1,-194.08,-44.71,-194.08,-0.32,-194.08,44.06,-194.08,88.45,-194.08,132.84,-194.08,177.23,-194.08,-177.88,-145.91,-133.49,-145.91,-89.1,-145.91,-44.71,-145.91,-0.32,-145.91,44.06,-145.91,88.45,-145.91,132.84,-145.91,177.23,-145.91,-177.88,-97.75,-133.49,-97.75,-89.1,-97.75,-44.71,-97.75,-0.32,-97.75,44.06,-97.75,88.45,-97.75,132.84,-97.75,177.23,-97.75,-177.88,-49.59,-133.49,-49.59,-89.1,-49.59,-44.71,-49.59,-0.32,-49.59,44.06,-49.59,88.45,-49.59,132.84,-49.59,177.23,-49.59,-177.88,-1.42,-133.49,-1.42,-89.1,-1.42,-44.71,-1.42,-0.32,-1.42,44.06,-1.42,88.45,-1.42,132.84,-1.42,177.23,-1.42,-177.88,46.74,-133.49,46.74,-89.1,46.74,-44.71,46.74,-0.32,46.74,44.06,46.74,88.45,46.74,132.84,46.74,177.23,46.74,-177.88,94.9,-133.49,94.9,-89.1,94.9,-44.71,94.9,-0.32,94.9,44.06,94.9,88.45,94.9,132.84,94.9,177.23,94.9,-177.88,143.07,-133.49,143.07,-89.1,143.07,-44.71,143.07,-0.32,143.07,44.06,143.07,88.45,143.07,132.84,143.07,177.23,143.07,-177.88,191.23,-133.49,191.23,-89.1,191.23,-44.71,191.23,-0.32,191.23,44.06,191.23,88.45,191.23,132.84,191.23,177.23,191.23]},{"type":"surface","name":"B_HAIR_TWIN.04","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[575.33,-12.52,575.33,56.5,575.33,125.52,575.33,194.55,575.33,263.57,575.33,332.6,575.33,401.62,575.33,470.64,575.33,539.67,457.83,-12.52,457.83,56.5,457.83,125.52,457.83,194.55,457.83,263.57,457.83,332.6,457.83,401.62,457.83,470.64,457.83,539.67,340.33,-12.52,340.33,56.5,340.33,125.52,340.33,194.55,340.33,263.57,340.33,332.6,340.33,401.62,340.33,470.64,340.33,539.67,222.83,-12.52,222.83,56.5,222.83,125.52,222.83,194.55,222.83,263.57,222.83,332.6,222.83,401.62,222.83,470.64,222.83,539.67,105.33,-12.52,105.33,56.5,105.33,125.52,105.33,194.55,105.33,263.57,105.33,332.6,105.33,401.62,105.33,470.64,105.33,539.67,-12.17,-12.52,-12.17,56.5,-12.17,125.52,-12.17,194.55,-12.17,263.57,-12.17,332.6,-12.17,401.62,-12.17,470.64,-12.17,539.67,-129.67,-12.52,-129.67,56.5,-129.67,125.52,-129.67,194.55,-129.67,263.57,-129.67,332.6,-129.67,401.62,-129.67,470.64,-129.67,539.67,-247.17,-12.52,-247.17,56.5,-247.17,125.52,-247.17,194.55,-247.17,263.57,-247.17,332.6,-247.17,401.62,-247.17,470.64,-247.17,539.67,-364.67,-12.52,-364.67,56.5,-364.67,125.52,-364.67,194.55,-364.67,263.57,-364.67,332.6,-364.67,401.62,-364.67,470.64,-364.67,539.67]},{"type":"surface","name":"B_HAIR_TWIN.06","parent":"B_HAIR_TWIN.04","segmentX":8,"segmentY":8,"vertices":[-163.5,-190.48,-121.09,-190.48,-78.68,-190.48,-36.26,-190.48,6.15,-190.48,48.56,-190.48,90.98,-190.48,133.39,-190.48,175.8,-190.48,-163.5,-143.8,-121.09,-143.8,-78.68,-143.8,-36.26,-143.8,6.15,-143.8,48.56,-143.8,90.98,-143.8,133.39,-143.8,175.8,-143.8,-163.5,-97.13,-121.09,-97.13,-78.68,-97.13,-36.26,-97.13,6.15,-97.13,48.56,-97.13,90.98,-97.13,133.39,-97.13,175.8,-97.13,-163.5,-50.45,-121.09,-50.45,-78.68,-50.45,-36.26,-50.45,6.15,-50.45,48.56,-50.45,90.98,-50.45,133.39,-50.45,175.8,-50.45,-163.5,-3.77,-121.09,-3.77,-78.68,-3.77,-36.26,-3.77,6.15,-3.77,48.56,-3.77,90.98,-3.77,133.39,-3.77,175.8,-3.77,-163.5,42.91,-121.09,42.91,-78.68,42.91,-36.26,42.91,6.15,42.91,48.56,42.91,90.98,42.91,133.39,42.91,175.8,42.91,-163.5,89.59,-121.09,89.59,-78.68,89.59,-36.26,89.59,6.15,89.59,48.56,89.59,90.98,89.59,133.39,89.59,175.8,89.59,-163.5,136.27,-121.09,136.27,-78.68,136.27,-36.26,136.27,6.15,136.27,48.56,136.27,90.98,136.27,133.39,136.27,175.8,136.27,-163.5,182.95,-121.09,182.95,-78.68,182.95,-36.26,182.95,6.15,182.95,48.56,182.95,90.98,182.95,133.39,182.95,175.8,182.95]},{"type":"surface","name":"B_HAIR_TWIN.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[553.74,-528.52,553.74,-463.93,553.74,-399.35,553.74,-334.76,553.74,-270.18,553.74,-205.59,553.74,-141,553.74,-76.42,553.74,-11.83,436.33,-528.52,436.33,-463.93,436.33,-399.35,436.33,-334.76,436.33,-270.18,436.33,-205.59,436.33,-141,436.33,-76.42,436.33,-11.83,318.91,-528.52,318.91,-463.93,318.91,-399.35,318.91,-334.76,318.91,-270.18,318.91,-205.59,318.91,-141,318.91,-76.42,318.91,-11.83,201.5,-528.52,201.5,-463.93,201.5,-399.35,201.5,-334.76,201.5,-270.18,201.5,-205.59,201.5,-141,201.5,-76.42,201.5,-11.83,84.09,-528.52,84.09,-463.93,84.09,-399.35,84.09,-334.76,84.09,-270.18,84.09,-205.59,84.09,-141,84.09,-76.42,84.09,-11.83,-33.32,-528.52,-33.32,-463.93,-33.32,-399.35,-33.32,-334.76,-33.32,-270.18,-33.32,-205.59,-33.32,-141,-33.32,-76.42,-33.32,-11.83,-150.74,-528.52,-150.74,-463.93,-150.74,-399.35,-150.74,-334.76,-150.74,-270.18,-150.74,-205.59,-150.74,-141,-150.74,-76.42,-150.74,-11.83,-268.15,-528.52,-268.15,-463.93,-268.15,-399.35,-268.15,-334.76,-268.15,-270.18,-268.15,-205.59,-268.15,-141,-268.15,-76.42,-268.15,-11.83,-385.56,-528.52,-385.56,-463.93,-385.56,-399.35,-385.56,-334.76,-385.56,-270.18,-385.56,-205.59,-385.56,-141,-385.56,-76.42,-385.56,-11.83]},{"type":"surface","name":"B_HAIR_TWIN.03","parent":"B_HAIR_TWIN.01","segmentX":8,"segmentY":8,"vertices":[-176.96,-189.63,-133.15,-189.63,-89.35,-189.63,-45.54,-189.63,-1.74,-189.63,42.06,-189.63,85.87,-189.63,129.67,-189.63,173.48,-189.63,-176.96,-142.61,-133.15,-142.61,-89.35,-142.61,-45.54,-142.61,-1.74,-142.61,42.06,-142.61,85.87,-142.61,129.67,-142.61,173.48,-142.61,-176.96,-95.59,-133.15,-95.59,-89.35,-95.59,-45.54,-95.59,-1.74,-95.59,42.06,-95.59,85.87,-95.59,129.67,-95.59,173.48,-95.59,-176.96,-48.56,-133.15,-48.56,-89.35,-48.56,-45.54,-48.56,-1.74,-48.56,42.06,-48.56,85.87,-48.56,129.67,-48.56,173.48,-48.56,-176.96,-1.54,-133.15,-1.54,-89.35,-1.54,-45.54,-1.54,-1.74,-1.54,42.06,-1.54,85.87,-1.54,129.67,-1.54,173.48,-1.54,-176.96,45.49,-133.64,46.83,-89.78,46.68,-45.71,45.93,-1.74,45.49,42.06,45.49,85.87,45.49,129.67,45.49,173.48,45.49,-176.96,92.51,-134.13,95.2,-90.22,94.91,-45.87,93.41,-1.74,92.51,42.06,92.51,85.87,92.51,129.67,92.51,173.48,92.51,-176.96,139.53,-134.62,143.58,-90.65,143.13,-46.03,140.88,-1.74,139.53,42.06,139.53,85.87,139.53,129.67,139.53,173.48,139.53,-176.96,186.56,-135.11,191.95,-91.09,191.35,-46.2,188.35,-1.74,186.56,42.06,186.56,85.87,186.56,129.67,186.56,173.48,186.56]},{"type":"surface","name":"B_HAIR_TWIN.15","parent":"B_HAIR_TWIN.03","segmentX":8,"segmentY":8,"vertices":[-182.1,-191.51,-137.34,-191.51,-92.57,-191.51,-47.81,-191.51,-3.05,-191.51,41.72,-191.51,86.48,-191.51,131.25,-191.51,176.01,-191.51,-182.1,-143.74,-137.34,-143.74,-92.57,-143.74,-47.81,-143.74,-3.05,-143.74,41.72,-143.74,86.48,-143.74,131.25,-143.74,176.01,-143.74,-182.1,-95.98,-137.34,-95.98,-92.57,-95.98,-47.81,-95.98,-3.05,-95.98,41.72,-95.98,86.48,-95.98,131.25,-95.98,176.01,-95.98,-182.1,-48.21,-137.34,-48.21,-92.57,-48.21,-47.81,-48.21,-3.05,-48.21,41.72,-48.21,86.48,-48.21,131.25,-48.21,176.01,-48.21,-182.1,-0.44,-137.34,-0.44,-92.57,-0.44,-47.81,-0.44,-3.05,-0.44,41.72,-0.44,86.48,-0.44,131.25,-0.44,176.01,-0.44,-182.1,47.33,-137.34,47.33,-92.57,47.33,-47.81,47.33,-3.05,47.33,41.72,47.33,86.48,47.33,131.25,47.33,176.01,47.33,-182.1,95.1,-137.34,95.1,-92.57,95.1,-47.81,95.1,-3.05,95.1,41.72,95.1,86.48,95.1,131.25,95.1,176.01,95.1,-182.1,142.87,-137.34,142.87,-92.57,142.87,-47.81,142.87,-3.05,142.87,41.72,142.87,86.48,142.87,131.25,142.87,176.01,142.87,-182.1,190.63,-137.34,190.63,-92.57,190.63,-47.81,190.63,-3.05,190.63,41.72,190.63,86.48,190.63,131.25,190.63,176.01,190.63]},{"type":"surface","name":"B_HAIR_BACK.02","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[622.07,-345.67,622.07,-258.73,622.07,-171.79,622.07,-84.85,622.07,2.09,622.07,89.04,622.07,175.98,622.07,262.92,622.07,349.86,523.94,-345.67,523.94,-258.73,523.94,-171.79,523.94,-84.85,523.94,2.09,523.94,89.04,523.94,175.98,523.94,262.92,523.94,349.86,425.82,-345.67,425.82,-258.73,425.82,-171.79,425.82,-84.85,425.82,2.09,425.82,89.04,425.82,175.98,425.82,262.92,425.82,349.86,327.7,-345.67,327.7,-258.73,327.7,-171.79,327.7,-84.85,327.7,2.09,327.7,89.04,327.7,175.98,327.7,262.92,327.7,349.86,229.57,-345.67,229.57,-258.73,229.57,-171.79,229.57,-84.85,229.57,2.09,229.57,89.04,229.57,175.98,229.57,262.92,229.57,349.86,131.45,-345.67,131.45,-258.73,131.45,-171.79,131.45,-84.85,131.45,2.09,131.45,89.04,131.45,175.98,131.45,262.92,131.45,349.86,33.33,-345.67,33.33,-258.73,33.33,-171.79,33.33,-84.85,33.33,2.09,33.33,89.04,33.33,175.98,33.33,262.92,33.33,349.86,-64.79,-345.67,-64.79,-258.73,-64.79,-171.79,-64.79,-84.85,-64.79,2.09,-64.79,89.04,-64.79,175.98,-64.79,262.92,-64.79,349.86,-162.92,-345.67,-162.92,-258.73,-162.92,-171.79,-162.92,-84.85,-162.92,2.09,-162.92,89.04,-162.92,175.98,-162.92,262.92,-162.92,349.86]},{"length":150,"name":"B_CLOTHES.07","parent":"B_CLOTHES.14","transform":{"x":91.1,"y":-76.67,"skX":85.4,"skY":85.4}},{"length":150,"name":"B_CLOTHES.31","parent":"B_CLOTHES.18","transform":{"x":-106.87,"y":-60.91,"skX":93.9,"skY":93.9}},{"length":150,"name":"B_CLOTHES.32","parent":"B_CLOTHES.31","transform":{"x":355.72,"y":-16.23,"skX":-79.2,"skY":-79.2}},{"length":150,"name":"B_CLOTHES.33","parent":"B_CLOTHES.32","transform":{"x":265.21,"y":2.1,"skX":16.7,"skY":16.7}},{"type":"surface","name":"B_HAND.09","parent":"B_CLOTHES.33","segmentX":8,"segmentY":8,"vertices":[-117.14,-53.77,-80.32,-67.47,-43.49,-81.16,-6.67,-94.86,30.16,-108.55,66.98,-122.25,103.81,-135.94,140.63,-149.64,177.46,-163.33,-107.52,-27.9,-70.7,-41.6,-33.87,-55.29,2.95,-68.99,39.78,-82.68,76.6,-96.38,113.43,-110.07,150.25,-123.77,187.08,-137.46,-97.9,-2.03,-61.08,-15.73,-24.25,-29.42,12.57,-43.12,49.4,-56.81,86.23,-70.51,123.05,-84.2,159.88,-97.9,196.7,-111.59,-88.28,23.84,-51.45,10.14,-14.63,-3.55,22.2,-17.25,59.02,-30.94,95.85,-44.64,132.67,-58.33,169.5,-72.03,206.32,-85.72,-78.66,49.71,-41.83,36.01,-5.01,22.32,31.82,8.62,68.64,-5.07,105.47,-18.77,142.29,-32.46,179.12,-46.16,215.94,-59.85,-69.04,75.58,-32.21,61.88,4.61,48.19,41.44,34.49,78.26,20.8,115.09,7.1,151.91,-6.59,188.74,-20.29,225.56,-33.98,-59.42,101.45,-22.59,87.75,14.23,74.06,51.06,60.36,87.88,46.67,124.71,32.97,161.53,19.28,198.36,5.58,235.18,-8.11,-49.8,127.32,-12.97,113.62,23.85,99.93,60.68,86.23,97.5,72.54,134.33,58.84,171.15,45.15,207.98,31.45,244.81,17.76,-40.18,153.19,-3.35,139.49,33.48,125.8,70.3,112.1,107.13,98.41,143.95,84.71,180.78,71.02,217.6,57.32,254.43,43.63]},{"type":"surface","name":"B_HAND.10","parent":"B_HAND.09","segmentX":8,"segmentY":8,"vertices":[-178.26,-181.8,-134.31,-181.8,-90.37,-181.8,-46.42,-181.8,-2.47,-181.8,41.47,-181.8,85.42,-181.8,129.37,-181.8,173.31,-181.8,-178.26,-137.49,-134.31,-137.49,-90.37,-137.49,-46.42,-137.49,-2.47,-137.49,41.47,-137.49,85.42,-137.49,129.37,-137.49,173.31,-137.49,-178.26,-93.18,-134.31,-93.18,-90.37,-93.18,-46.42,-93.18,-2.47,-93.18,41.47,-93.18,85.42,-93.18,129.37,-93.18,173.31,-93.18,-178.26,-48.88,-134.31,-48.88,-90.37,-48.88,-46.42,-48.88,-2.47,-48.88,41.47,-48.88,85.42,-48.88,129.37,-48.88,173.31,-48.88,-178.26,-4.57,-134.31,-4.57,-90.37,-4.57,-46.42,-4.57,-2.47,-4.57,41.47,-4.57,85.42,-4.57,129.37,-4.57,173.31,-4.57,-178.26,39.74,-134.31,39.74,-90.37,39.74,-45.15,38.83,0.07,37.93,42.75,38.83,85.42,39.74,129.37,39.74,173.31,39.74,-178.26,84.05,-134.31,84.05,-90.37,84.05,-43.87,82.24,2.62,80.43,44.02,82.24,85.42,84.05,129.37,84.05,173.31,84.05,-178.26,128.36,-134.31,128.36,-90.37,128.36,-44.83,127.22,0.71,126.09,43.06,127.22,85.42,128.36,129.37,128.36,173.31,128.36,-178.26,172.66,-134.31,172.66,-90.37,172.66,-46.42,172.66,-2.47,172.66,41.47,172.66,85.42,172.66,129.37,172.66,173.31,172.66]},{"type":"surface","name":"B_HAND.12","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-83.11,2.27,-56.26,2.28,-29.42,2.3,-2.56,2.3,24.32,2.3,51.2,2.29,78.09,2.28,104.96,2.27,131.83,2.27,-83.13,23.08,-56.29,23.1,-29.44,23.13,-2.58,23.14,24.29,23.13,51.15,23.13,78.04,23.1,104.95,23.08,131.83,23.06,-83.16,43.89,-56.3,43.92,-29.42,43.94,-2.55,43.95,24.29,43.96,51.12,43.96,78,43.93,104.93,43.88,131.83,43.85,-83.19,64.71,-56.31,64.74,-29.41,64.75,-2.53,64.77,24.27,64.8,51.07,64.81,77.96,64.76,104.92,64.68,131.83,64.64,-83.23,85.52,-56.37,85.58,-29.48,85.62,-2.63,85.66,24.16,85.69,50.98,85.68,77.92,85.58,104.91,85.48,131.83,85.43,-83.25,106.33,-56.45,106.44,-29.64,106.53,-2.82,106.6,24,106.6,50.88,106.55,77.87,106.41,104.9,106.28,131.83,106.22,-83.26,127.12,-56.54,127.28,-29.81,127.42,-3.03,127.51,23.85,127.48,50.81,127.38,77.86,127.21,104.89,127.07,131.83,127.01,-83.25,147.9,-56.59,148.08,-29.92,148.27,-3.18,148.38,23.74,148.31,50.77,148.17,77.86,147.98,104.9,147.85,131.83,147.8,-83.24,168.68,-56.63,168.88,-30.01,169.08,-3.29,169.19,23.68,169.11,50.78,168.93,77.9,168.73,104.92,168.63,131.83,168.59]},{"type":"surface","name":"B_HAND.13","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-54.07,-46.15,-26,-46.15,2.06,-46.15,30.12,-46.15,58.19,-46.15,86.25,-46.15,114.31,-46.15,142.38,-46.15,170.44,-46.15,-54.07,-21.08,-26,-21.08,2.06,-21.08,30.11,-21.08,58.17,-21.07,86.24,-21.08,114.31,-21.08,142.38,-21.08,170.44,-21.08,-54.07,3.99,-26,4,2.05,4,30.09,4.01,58.15,4.01,86.24,4,114.31,3.99,142.38,3.99,170.44,3.99,-54.04,29.06,-25.97,29.08,2.06,29.11,30.07,29.13,58.11,29.13,86.21,29.09,114.31,29.06,142.37,29.06,170.44,29.06,-53.99,54.14,-25.91,54.18,2.1,54.23,30.04,54.29,58.02,54.29,86.14,54.21,114.28,54.14,142.37,54.13,170.44,54.12,-54.03,79.27,-25.95,79.34,2.02,79.44,29.9,79.53,57.87,79.49,86.06,79.33,114.27,79.22,142.37,79.2,170.44,79.19,-54.21,104.47,-26.26,104.63,1.63,104.78,29.55,104.84,57.69,104.68,86.02,104.42,114.27,104.29,142.37,104.27,170.44,104.26,-54.42,129.66,-26.62,129.9,1.24,130.08,29.27,130.07,57.59,129.8,86.02,129.48,114.27,129.35,142.37,129.33,170.44,129.33,-54.62,154.82,-26.91,155.12,0.94,155.29,29.1,155.2,57.56,154.87,86.05,154.53,114.29,154.41,142.37,154.4,170.44,154.4]},{"type":"surface","name":"B_HAND.14","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-38.29,-98.04,-11.83,-98.04,14.63,-98.04,41.09,-98.04,67.54,-98.04,94,-98.04,120.46,-98.04,146.91,-98.04,173.37,-98.04,-38.29,-67.75,-11.83,-67.75,14.63,-67.75,41.09,-67.75,67.54,-67.75,94,-67.75,120.46,-67.75,146.91,-67.75,173.37,-67.75,-38.29,-37.45,-11.83,-37.45,14.63,-37.45,41.09,-37.45,67.54,-37.45,94,-37.45,120.46,-37.45,146.91,-37.45,173.37,-37.45,-38.24,-7.18,-11.76,-7.19,14.68,-7.18,41.09,-7.16,67.52,-7.14,93.99,-7.14,120.46,-7.15,146.91,-7.15,173.37,-7.15,-38.06,23.02,-11.54,23,14.83,23.04,41.1,23.15,67.46,23.21,93.96,23.18,120.46,23.14,146.91,23.14,173.37,23.14,-37.91,53.27,-11.39,53.25,14.89,53.37,41.01,53.57,67.33,53.62,93.91,53.51,120.46,53.44,146.91,53.44,173.37,53.44,-38.32,83.88,-11.97,83.98,14.24,84.16,40.47,84.28,67.06,84.12,93.85,83.84,120.46,83.74,146.91,83.74,173.37,83.74,-38.96,114.61,-12.79,114.83,13.44,115,39.94,114.95,66.84,114.56,93.82,114.15,120.46,114.03,146.91,114.03,173.37,114.03,-39.49,145.25,-13.45,145.56,12.86,145.66,39.64,145.41,66.75,144.9,93.82,144.45,120.46,144.33,146.91,144.33,173.37,144.33]},{"type":"surface","name":"B_HAND.15","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-16.94,-149.35,6.43,-149.35,29.8,-149.35,53.17,-149.35,76.54,-149.35,99.91,-149.35,123.27,-149.35,146.64,-149.35,170.01,-149.35,-16.94,-110.77,6.43,-110.77,29.8,-110.77,53.17,-110.77,76.54,-110.77,99.91,-110.77,123.27,-110.77,146.64,-110.77,170.01,-110.77,-16.94,-72.18,6.43,-72.18,29.8,-72.18,53.17,-72.18,76.54,-72.18,99.91,-72.18,123.27,-72.18,146.64,-72.18,170.01,-72.18,-16.92,-33.61,6.46,-33.61,29.82,-33.61,53.17,-33.6,76.53,-33.6,99.9,-33.6,123.27,-33.6,146.64,-33.6,170.01,-33.6,-16.73,4.88,6.66,4.88,29.97,4.9,53.23,4.96,76.54,4.99,99.9,4.99,123.27,4.98,146.64,4.98,170.01,4.98,-16.39,43.34,6.96,43.36,30.16,43.44,53.3,43.55,76.56,43.59,99.9,43.58,123.27,43.57,146.64,43.57,170.01,43.57,-16.88,82.36,6.42,82.39,29.68,82.43,52.96,82.43,76.39,82.31,99.87,82.18,123.27,82.15,146.64,82.15,170.01,82.15,-17.82,121.56,5.47,121.6,28.9,121.52,52.49,121.32,76.19,121.02,99.83,120.78,123.27,120.74,146.64,120.74,170.01,120.74,-18.56,160.54,4.74,160.58,28.36,160.4,52.23,160.01,76.11,159.61,99.83,159.36,123.27,159.32,146.64,159.32,170.01,159.32]},{"type":"surface","name":"B_HAND.16","parent":"B_HAND.10","segmentX":8,"segmentY":8,"vertices":[-6.55,-97.38,13.58,-97.38,33.72,-97.38,53.85,-97.38,73.98,-97.38,94.11,-97.38,114.25,-97.38,134.38,-97.38,154.51,-97.38,-6.55,-82.16,13.58,-82.16,33.72,-82.16,53.85,-82.16,73.98,-82.16,94.11,-82.16,114.25,-82.16,134.38,-82.16,154.51,-82.16,-6.55,-66.94,13.58,-66.94,33.72,-66.94,53.85,-66.94,73.98,-66.94,94.11,-66.94,114.25,-66.94,134.38,-66.94,154.51,-66.94,-6.55,-51.72,13.58,-51.72,33.72,-51.72,53.85,-51.72,73.98,-51.72,94.11,-51.72,114.25,-51.72,134.38,-51.72,154.51,-51.72,-6.55,-36.49,13.58,-36.49,33.72,-36.49,53.85,-36.49,73.98,-36.49,94.11,-36.49,114.25,-36.49,134.38,-36.49,154.51,-36.49,-6.55,-21.27,13.58,-21.27,33.72,-21.27,53.85,-21.27,73.98,-21.27,94.11,-21.27,114.25,-21.27,134.38,-21.27,154.51,-21.27,-6.55,-6.05,13.58,-6.05,33.72,-6.05,53.85,-6.05,73.98,-6.05,94.11,-6.05,114.25,-6.05,134.38,-6.05,154.51,-6.05,-6.55,9.17,13.58,9.17,33.72,9.17,53.85,9.17,73.98,9.17,94.11,9.17,114.25,9.17,134.38,9.17,154.51,9.17,-6.55,24.39,13.58,24.39,33.72,24.39,53.85,24.39,73.98,24.39,94.11,24.39,114.25,24.39,134.38,24.39,154.51,24.39]},{"length":150,"name":"B_CLOTHES.40","parent":"B_CLOTHES.14","transform":{"x":91.11,"y":-76.57,"skX":97.2,"skY":97.2}},{"length":150,"name":"B_CLOTHES.41","parent":"B_CLOTHES.40","transform":{"x":300,"y":13.64,"skX":160.1,"skY":160.1}},{"length":150,"name":"B_HAND.18","parent":"B_CLOTHES.41","transform":{"x":372.97,"y":-9.7}},{"length":150,"name":"B_HAND.17","parent":"B_CLOTHES.39","transform":{"x":396.86,"y":22.99,"skX":-3.2,"skY":-3.2}},{"type":"surface","name":"B_NECK.01","parent":"B_NECK.02","segmentX":8,"segmentY":8,"vertices":[244.58,-117.17,244.58,-87.63,244.58,-58.09,244.58,-28.55,244.58,1,244.58,30.54,244.58,60.08,244.58,89.62,244.58,119.17,201.76,-117.17,201.76,-87.63,201.76,-58.09,201.76,-28.55,201.76,1,201.76,30.54,201.76,60.08,201.76,89.62,201.76,119.17,158.94,-117.17,158.94,-87.63,158.94,-58.09,158.94,-28.55,158.94,1,158.94,30.54,158.94,60.08,158.94,89.62,158.94,119.17,116.11,-117.17,116.11,-87.63,116.11,-58.09,116.11,-28.55,116.11,1,116.11,30.54,116.11,60.08,116.11,89.62,116.11,119.17,73.29,-117.17,73.29,-87.63,73.29,-58.09,73.29,-28.55,73.29,1,73.29,30.54,73.29,60.08,73.29,89.62,73.29,119.17,30.47,-117.17,30.47,-87.63,30.47,-58.09,30.47,-28.55,30.47,1,30.47,30.54,30.47,60.08,30.47,89.62,30.47,119.17,-12.36,-117.17,-12.36,-87.63,-12.36,-58.09,-12.36,-28.55,-12.36,1,-12.36,30.54,-12.36,60.08,-12.36,89.62,-12.36,119.17,-55.18,-117.17,-55.18,-87.63,-55.18,-58.09,-55.18,-28.55,-55.18,1,-55.18,30.54,-55.18,60.08,-55.18,89.62,-55.18,119.17,-98,-117.17,-98,-87.63,-98,-58.09,-98,-28.55,-98,1,-98,30.54,-98,60.08,-98,89.62,-98,119.17]},{"type":"surface","name":"B_NECK.03","parent":"B_NECK.01","segmentX":8,"segmentY":8,"vertices":[-167.24,-149.16,-126.21,-149.16,-85.18,-149.16,-44.15,-149.16,-3.12,-149.16,37.91,-149.16,78.95,-149.16,119.98,-149.16,161.01,-149.16,-167.24,-122.86,-126.21,-122.86,-85.18,-122.86,-44.15,-122.86,-3.12,-122.86,37.91,-122.86,78.95,-122.86,119.98,-122.86,161.01,-122.86,-167.24,-96.55,-126.21,-96.55,-85.18,-96.55,-44.15,-96.55,-3.12,-96.55,37.91,-96.55,78.95,-96.55,119.98,-96.55,161.01,-96.55,-167.24,-70.24,-126.21,-70.24,-85.18,-70.24,-44.15,-70.24,-3.12,-70.24,37.91,-70.24,78.95,-70.24,119.98,-70.24,161.01,-70.24,-167.24,-43.93,-126.21,-43.93,-85.18,-43.93,-44.15,-43.93,-3.12,-43.93,37.91,-43.93,78.95,-43.93,119.98,-43.93,161.01,-43.93,-167.24,-17.63,-126.21,-17.63,-85.18,-17.63,-44.15,-17.63,-3.12,-17.63,37.91,-17.63,78.95,-17.63,119.98,-17.63,161.01,-17.63,-167.24,8.68,-126.21,8.68,-85.18,8.68,-44.15,8.68,-3.12,8.68,37.91,8.68,78.95,8.68,119.98,8.68,161.01,8.68,-167.24,34.99,-126.21,34.99,-85.18,34.99,-44.15,34.99,-3.12,34.99,37.91,34.99,78.95,34.99,119.98,34.99,161.01,34.99,-167.24,61.3,-126.21,61.3,-85.18,61.3,-44.15,61.3,-3.12,61.3,37.91,61.3,78.95,61.3,119.98,61.3,161.01,61.3]},{"type":"surface","name":"B_BODY.01","parent":"B_BODY.02","segmentX":8,"segmentY":8,"vertices":[-129.18,-158.78,-97.99,-158.78,-66.8,-158.78,-35.6,-158.78,-4.41,-158.78,26.78,-158.78,57.98,-158.78,89.17,-158.78,120.36,-158.78,-129.18,-128.73,-97.99,-128.73,-66.8,-128.73,-35.6,-128.73,-4.41,-128.73,26.78,-128.73,57.98,-128.73,89.17,-128.73,120.36,-128.73,-129.18,-98.69,-97.99,-98.69,-66.8,-98.69,-35.6,-98.69,-4.41,-98.69,26.78,-98.69,57.98,-98.69,89.17,-98.69,120.36,-98.69,-129.18,-68.64,-97.99,-68.64,-66.8,-68.64,-35.6,-68.64,-4.41,-68.64,26.78,-68.64,57.98,-68.64,89.17,-68.64,120.36,-68.64,-129.18,-38.6,-97.99,-38.6,-66.8,-38.6,-35.6,-38.6,-4.41,-38.6,26.78,-38.6,57.98,-38.6,89.17,-38.6,120.36,-38.6,-129.18,-8.55,-97.99,-8.55,-66.8,-8.55,-35.6,-8.55,-4.41,-8.55,26.78,-8.55,57.98,-8.55,89.17,-8.55,120.36,-8.55,-129.18,21.49,-97.99,21.49,-66.8,21.49,-35.6,21.49,-4.41,21.49,26.78,21.49,57.98,21.49,89.17,21.49,120.36,21.49,-129.18,51.54,-97.99,51.54,-66.8,51.54,-35.6,51.54,-4.41,51.54,26.78,51.54,57.98,51.54,89.17,51.54,120.36,51.54,-129.18,81.58,-97.99,81.58,-66.8,81.58,-35.6,81.58,-4.41,81.58,26.78,81.58,57.98,81.58,89.17,81.58,120.36,81.58]},{"type":"surface","name":"B_CLOTHES.09","parent":"B_CLOTHES.10","segmentX":8,"segmentY":8,"vertices":[-170.47,-164.99,-127.16,-164.99,-83.85,-164.99,-40.53,-164.99,2.78,-164.99,46.09,-164.99,89.4,-164.99,132.72,-164.99,176.03,-164.99,-170.47,-122.81,-127.16,-122.81,-83.85,-122.81,-40.53,-122.81,2.78,-122.81,46.09,-122.81,89.4,-122.81,132.72,-122.81,176.03,-122.81,-170.47,-80.63,-127.16,-80.63,-83.85,-80.63,-40.53,-80.63,2.78,-80.63,46.09,-80.63,89.4,-80.63,132.72,-80.63,176.03,-80.63,-170.47,-38.45,-127.16,-38.45,-83.85,-38.45,-40.53,-38.45,2.78,-38.45,46.09,-38.45,89.4,-38.45,132.72,-38.45,176.03,-38.45,-170.47,3.72,-127.16,3.72,-83.85,3.72,-40.53,3.72,2.78,3.72,46.09,3.72,89.4,3.72,132.72,3.72,176.03,3.72,-170.47,45.9,-127.16,45.9,-83.85,45.9,-40.53,45.9,2.78,45.9,46.09,45.9,89.4,45.9,132.72,45.9,176.03,45.9,-170.47,88.08,-127.16,88.08,-83.85,88.08,-40.53,88.08,2.78,88.08,46.09,88.08,89.4,88.08,132.72,88.08,176.03,88.08,-170.47,130.26,-127.16,130.26,-83.85,130.26,-40.53,130.26,2.78,130.26,46.09,130.26,89.4,130.26,132.72,130.26,176.03,130.26,-170.47,172.44,-127.16,172.44,-83.85,172.44,-40.53,172.44,2.78,172.44,46.09,172.44,89.4,172.44,132.72,172.44,176.03,172.44]},{"type":"surface","name":"B_CLOTHES.17","parent":"B_CLOTHES.18","segmentX":8,"segmentY":8,"vertices":[-173.66,-175.19,-131.84,-175.19,-90.02,-175.19,-48.2,-175.19,-6.38,-175.19,35.44,-175.19,77.27,-175.19,119.09,-175.19,160.91,-175.19,-173.66,-130.57,-131.84,-130.57,-90.02,-130.57,-48.2,-130.57,-6.38,-130.57,35.44,-130.57,77.27,-130.57,119.09,-130.57,160.91,-130.57,-173.66,-85.94,-131.84,-85.94,-90.02,-85.94,-48.2,-85.94,-6.38,-85.94,35.44,-85.94,77.27,-85.94,119.09,-85.94,160.91,-85.94,-173.66,-41.32,-131.63,-41.41,-89.64,-41.44,-47.83,-41.43,-6.21,-41.38,35.41,-41.33,77.27,-41.32,119.09,-41.32,160.91,-41.32,-173.66,3.3,-130.08,2.67,-86.63,2.09,-44.56,2,-4.47,2.62,35.61,3.24,77.27,3.3,119.09,3.3,160.91,3.3,-173.66,47.93,-128.52,46.75,-83.61,45.62,-41.28,45.44,-2.73,46.63,35.81,47.81,77.27,47.93,119.09,47.93,160.91,47.93,-173.66,92.55,-127.69,91.49,-82.06,90.41,-39.72,90.23,-2.01,91.34,35.69,92.44,77.27,92.55,119.09,92.55,160.91,92.55,-173.66,137.17,-125.72,136.63,-78.27,136.06,-35.61,135.97,0.16,136.54,35.92,137.12,77.27,137.17,119.09,137.17,160.91,137.17,-173.66,181.8,-123.62,181.8,-74.2,181.8,-31.19,181.8,2.51,181.8,36.21,181.8,77.27,181.8,119.09,181.8,160.91,181.8]},{"length":150,"name":"B_CLOTHES.63","parent":"B_CLOTHES.62","transform":{"x":291.48,"y":-20.7,"skX":-163.5,"skY":-163.5}},{"type":"surface","name":"B_FACESHADOW.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[452,-248.13,452,-187.59,452,-127.05,452,-66.51,452,-5.97,452,54.57,452,115.11,452,175.65,452,236.19,410,-248.13,410,-187.59,410,-127.05,410,-66.51,410,-5.97,410,54.57,410,115.11,410,175.65,410,236.19,368,-248.13,368,-187.59,368,-127.05,368,-66.51,368,-5.97,368,54.57,368,115.11,368,175.65,368,236.19,326,-248.13,326,-187.59,326,-127.05,326,-66.51,326,-5.97,326,54.57,326,115.11,326,175.65,326,236.19,284,-248.13,284,-187.59,284,-127.05,284,-66.51,284,-5.97,284,54.57,284,115.11,284,175.65,284,236.19,242,-248.13,242,-187.59,242,-127.05,242,-66.51,242,-5.97,242,54.57,242,115.11,242,175.65,242,236.19,200,-248.13,200,-187.59,200,-127.05,200,-66.51,200,-5.97,200,54.57,200,115.11,200,175.65,200,236.19,158,-248.13,158,-187.59,158,-127.05,158,-66.51,158,-5.97,158,54.57,158,115.11,158,175.65,158,236.19,116,-248.13,116,-187.59,116,-127.05,116,-66.51,116,-5.97,116,54.57,116,115.11,116,175.65,116,236.19]},{"type":"surface","name":"B_FACESHADOW.02","parent":"B_FACESHADOW.01","segmentX":8,"segmentY":8,"vertices":[-190.79,-186.15,-143.48,-186.15,-96.16,-186.15,-48.85,-186.15,-1.54,-186.15,45.78,-186.15,93.09,-186.15,140.41,-186.15,187.72,-186.15,-190.79,-140.2,-143.48,-140.2,-96.16,-140.2,-48.85,-140.2,-1.54,-140.2,45.78,-140.2,93.09,-140.2,140.41,-140.2,187.72,-140.2,-190.79,-94.26,-143.48,-94.26,-96.16,-94.26,-48.85,-94.26,-1.54,-94.26,45.78,-94.26,93.09,-94.26,140.41,-94.26,187.72,-94.26,-190.79,-48.31,-143.48,-48.31,-96.16,-48.31,-48.85,-48.31,-1.54,-48.31,45.78,-48.31,93.09,-48.31,140.41,-48.31,187.72,-48.31,-190.79,-2.36,-143.48,-2.36,-96.16,-2.36,-48.85,-2.36,-1.54,-2.36,45.78,-2.36,93.09,-2.36,140.41,-2.36,187.72,-2.36,-190.79,43.59,-143.48,43.59,-96.16,43.59,-48.85,43.59,-1.54,43.59,45.78,43.59,93.09,43.59,140.41,43.59,187.72,43.59,-190.79,89.53,-143.48,89.53,-96.16,89.53,-48.85,89.53,-1.54,89.53,45.78,89.53,93.09,89.53,140.41,89.53,187.72,89.53,-190.79,135.48,-143.48,135.48,-96.16,135.48,-48.85,135.48,-1.54,135.48,45.78,135.48,93.09,135.48,140.41,135.48,187.72,135.48,-190.79,181.43,-143.48,181.43,-96.16,181.43,-48.85,181.43,-1.54,181.43,45.78,181.43,93.09,181.43,140.41,181.43,187.72,181.43]},{"type":"surface","name":"B_FACE.01","parent":"B_FACE.02","segmentX":8,"segmentY":8,"vertices":[499,-315.38,499,-240,499,-163.05,499,-85.89,499,-8.73,499,68.43,499,145.59,499,222.75,499,299.92,420.75,-317.16,420.75,-240.23,420.75,-163.05,420.75,-85.89,420.75,-8.73,420.75,68.43,420.75,145.59,420.75,222.75,420.75,299.92,342.5,-317.38,342.5,-240.21,342.5,-163.05,342.5,-85.89,342.5,-8.73,342.5,68.43,342.5,145.59,342.5,222.75,342.5,299.92,264.25,-317.38,264.25,-240.21,264.25,-163.05,264.25,-85.89,264.25,-8.73,264.25,68.43,264.25,145.59,264.25,222.75,264.25,299.92,186,-317.38,186,-240.21,186,-163.05,186,-85.89,186,-8.73,186,68.43,186,145.59,186,222.75,186,299.92,107.75,-317.38,107.75,-240.21,107.75,-163.05,107.75,-85.89,107.75,-8.73,107.75,68.43,107.75,145.59,107.75,222.75,107.75,299.92,29.5,-317.38,29.5,-240.21,29.5,-163.05,29.5,-85.89,29.5,-8.73,29.5,68.43,29.5,145.59,29.5,222.75,29.5,299.92,-48.75,-317.38,-48.75,-240.21,-48.75,-163.05,-48.75,-85.89,-48.75,-8.73,-48.75,68.43,-48.75,145.59,-48.75,222.75,-48.75,299.92,-127,-317.38,-127,-240.21,-127,-163.05,-127,-85.89,-127,-8.73,-127,68.43,-127,145.59,-127,222.75,-127,299.92]},{"type":"surface","name":"B_EYE.01","parent":"B_EYE.02","segmentX":8,"segmentY":8,"vertices":[-184.36,-185.36,-138.97,-185.51,-93.45,-185.6,-48.16,-185.57,-3.07,-185.56,41.98,-185.59,87.16,-185.3,132.43,-185.1,177.71,-185.15,-185.19,-139.79,-139.18,-139.85,-93.41,-139.92,-48.12,-139.87,-3,-139.81,42.03,-139.83,87.16,-139.55,132.35,-139.35,177.58,-139.36,-186.09,-94.19,-139.46,-94.15,-93.44,-94.19,-48.15,-94.11,-2.96,-94,42.08,-94.03,87.18,-93.77,132.32,-93.58,177.52,-93.58,-186.12,-48.67,-139.42,-48.5,-93.44,-48.38,-48.21,-48.25,-2.97,-48.16,42.14,-48.23,87.13,-48.03,132.3,-47.96,177.57,-48.01,-184.74,-3.22,-138.85,-2.98,-93.3,-2.66,-48.17,-2.49,-3.02,-2.4,42.12,-2.43,86.81,-2.33,132.17,-2.47,177.71,-2.61,-184.16,42.69,-138.83,42.85,-93.46,43.1,-48.26,43.23,-3.18,43.36,42.03,43.4,86.43,43.45,131.99,43.25,177.81,43.11,-184.24,88.63,-139.03,88.71,-93.7,88.86,-48.43,88.96,-3.22,89.07,42.01,89.12,86.6,89.15,132.23,88.98,178.04,88.88,-184.39,134.41,-139.18,134.49,-93.9,134.64,-48.61,134.74,-3.19,134.78,42.05,134.8,87.08,134.82,132.72,134.76,178.36,134.73,-184.5,180.12,-139.33,180.22,-94.15,180.39,-48.85,180.5,-3.16,180.5,42.13,180.51,87.61,180.55,133.24,180.63,178.7,180.71]},{"type":"surface","name":"B_EYE.03","parent":"B_EYE.04","segmentX":8,"segmentY":8,"vertices":[-176.82,-176.2,-132.74,-176.23,-88.67,-176.25,-44.6,-176.24,-0.56,-176.15,43.39,-176.01,87.27,-175.91,130.91,-175.72,174.64,-175.51,-176.82,-131.91,-132.41,-133.49,-88.02,-135.1,-43.85,-135.47,0.13,-134.88,44,-134.27,87.75,-133.83,131.14,-132.55,174.59,-131.28,-176.82,-87.63,-132.1,-90.66,-87.41,-93.72,-43.15,-94.41,0.78,-93.37,44.57,-92.32,88.21,-91.59,131.37,-89.33,174.56,-87.06,-176.82,-43.34,-132.04,-46.67,-87.29,-49.9,-43.03,-50.62,0.89,-49.51,44.69,-48.41,88.35,-47.66,131.54,-45.32,174.74,-42.88,-176.82,0.95,-132.36,-0.84,-87.92,-2.49,-43.77,-2.86,0.2,-2.29,44.13,-1.69,87.96,-1.28,131.49,-0.06,175.04,1.28,-176.81,45.23,-132.68,44.98,-88.54,44.9,-44.51,44.89,-0.49,44.92,43.55,45.03,87.53,45.09,131.37,45.2,175.26,45.43,-176.81,89.52,-132.72,89.51,-88.61,89.51,-44.58,89.5,-0.57,89.47,43.48,89.52,87.49,89.56,131.43,89.58,175.42,89.6,-176.83,133.8,-132.72,133.8,-88.61,133.8,-44.57,133.79,-0.56,133.77,43.49,133.81,87.52,133.82,131.53,133.81,175.58,133.8,-176.86,178.08,-132.73,178.08,-88.6,178.08,-44.56,178.08,-0.55,178.07,43.49,178.08,87.55,178.07,131.65,178.03,175.76,178]},{"type":"surface","name":"B_EYE_BALL.05","parent":"B_EYE.01","segmentX":8,"segmentY":8,"vertices":[-109.01,-112.78,-76.73,-112.78,-44.46,-112.78,-12.19,-112.78,20.09,-112.78,52.36,-112.78,84.63,-112.78,116.9,-112.78,149.18,-112.78,-109.01,-77.87,-76.73,-77.87,-44.46,-77.87,-12.19,-77.87,20.09,-77.87,52.36,-77.87,84.63,-77.87,116.9,-77.87,149.18,-77.87,-109.01,-42.96,-76.73,-42.96,-44.46,-42.96,-12.19,-42.96,20.09,-42.96,52.36,-42.96,84.63,-42.96,116.9,-42.96,149.18,-42.96,-109.01,-8.06,-76.73,-8.06,-44.46,-8.06,-12.19,-8.06,20.09,-8.06,52.36,-8.06,84.63,-8.06,116.9,-8.06,149.18,-8.06,-109.01,26.85,-76.73,26.85,-44.46,26.85,-12.19,26.85,20.09,26.85,52.36,26.85,84.63,26.85,116.9,26.85,149.18,26.85,-109.01,61.76,-76.73,61.76,-44.46,61.76,-12.19,61.76,20.09,61.76,52.36,61.76,84.63,61.76,116.9,61.76,149.18,61.76,-109.01,96.67,-76.73,96.67,-44.46,96.67,-12.19,96.67,20.09,96.67,52.36,96.67,84.63,96.67,116.9,96.67,149.18,96.67,-109.01,131.58,-76.73,131.58,-44.46,131.58,-12.19,131.58,20.09,131.58,52.36,131.58,84.63,131.58,116.9,131.58,149.18,131.58,-109.01,166.49,-76.73,166.49,-44.46,166.49,-12.19,166.49,20.09,166.49,52.36,166.49,84.63,166.49,116.9,166.49,149.18,166.49]},{"type":"surface","name":"B_EYE_BALL.10","parent":"B_EYE.03","segmentX":8,"segmentY":8,"vertices":[-133.22,-106.6,-99.27,-106.6,-65.32,-106.6,-31.37,-106.6,2.58,-106.6,36.53,-106.6,70.48,-106.6,104.43,-106.6,138.39,-106.6,-133.22,-72.53,-99.27,-72.53,-65.32,-72.53,-31.37,-72.53,2.58,-72.53,36.53,-72.53,70.48,-72.53,104.43,-72.53,138.39,-72.53,-133.22,-38.47,-99.27,-38.47,-65.32,-38.47,-31.37,-38.47,2.58,-38.47,36.53,-38.47,70.48,-38.47,104.43,-38.47,138.39,-38.47,-133.22,-4.4,-99.27,-4.4,-65.32,-4.4,-31.37,-4.4,2.58,-4.4,36.53,-4.4,70.48,-4.4,104.43,-4.4,138.39,-4.4,-133.22,29.67,-99.27,29.67,-65.32,29.67,-31.37,29.67,2.58,29.67,36.53,29.67,70.48,29.67,104.43,29.67,138.39,29.67,-133.22,63.74,-99.27,63.74,-65.32,63.74,-31.37,63.74,2.58,63.74,36.53,63.74,70.48,63.74,104.43,63.74,138.39,63.74,-133.22,97.81,-99.27,97.81,-65.32,97.81,-31.37,97.81,2.58,97.81,36.53,97.81,70.48,97.81,104.43,97.81,138.39,97.81,-133.22,131.88,-99.27,131.88,-65.32,131.88,-31.37,131.88,2.58,131.88,36.53,131.88,70.48,131.88,104.43,131.88,138.39,131.88,-133.22,165.95,-99.27,165.95,-65.32,165.95,-31.37,165.95,2.58,165.95,36.53,165.95,70.48,165.95,104.43,165.95,138.39,165.95]},{"type":"surface","name":"B_BROW.03","parent":"B_BROW.05","segmentX":8,"segmentY":8,"vertices":[-165.41,-139.73,-128.92,-139.73,-92.43,-139.73,-55.94,-139.73,-19.45,-139.73,17.04,-139.73,53.53,-139.73,90.02,-139.73,126.5,-139.73,-165.41,-105.5,-128.92,-105.5,-92.43,-105.5,-55.94,-105.5,-19.45,-105.5,17.04,-105.5,53.53,-105.5,90.02,-105.5,126.5,-105.5,-165.41,-71.28,-128.92,-71.28,-92.43,-71.28,-55.94,-71.28,-19.45,-71.28,17.04,-71.28,53.53,-71.28,90.02,-71.28,126.5,-71.28,-165.41,-37.05,-128.92,-37.05,-92.43,-37.05,-55.94,-37.05,-19.45,-37.05,17.04,-37.05,53.53,-37.05,90.02,-37.05,126.5,-37.05,-165.41,-2.82,-128.92,-2.82,-92.43,-2.82,-55.94,-2.82,-19.45,-2.82,17.04,-2.82,53.53,-2.82,90.02,-2.82,126.5,-2.82,-165.41,31.4,-128.92,31.4,-92.43,31.4,-55.94,31.4,-19.45,31.4,17.04,31.4,53.53,31.4,90.02,31.4,126.5,31.4,-165.41,65.63,-128.92,65.63,-92.43,65.63,-55.94,65.63,-19.45,65.63,17.04,65.63,53.53,65.63,90.02,65.63,126.5,65.63,-165.41,99.85,-128.92,99.85,-92.43,99.85,-55.94,99.85,-19.45,99.85,17.04,99.85,53.53,99.85,90.02,99.85,126.5,99.85,-165.41,134.08,-128.92,134.08,-92.43,134.08,-55.94,134.08,-19.45,134.08,17.04,134.08,53.53,134.08,90.02,134.08,126.5,134.08]},{"type":"surface","name":"B_BROW.04","parent":"B_BROW.06","segmentX":8,"segmentY":8,"vertices":[-151.79,-142.29,-112.65,-142.29,-73.52,-142.29,-34.38,-142.29,4.76,-142.29,43.89,-142.29,83.03,-142.29,122.17,-142.29,161.3,-142.29,-151.79,-107.29,-112.65,-107.29,-73.52,-107.29,-34.38,-107.29,4.76,-107.29,43.89,-107.29,83.03,-107.29,122.17,-107.29,161.3,-107.29,-151.79,-72.28,-112.65,-72.28,-73.52,-72.28,-34.38,-72.28,4.76,-72.28,43.89,-72.28,83.03,-72.28,122.17,-72.28,161.3,-72.28,-151.79,-37.28,-112.65,-37.28,-73.52,-37.28,-34.38,-37.28,4.76,-37.28,43.89,-37.28,83.03,-37.28,122.17,-37.28,161.3,-37.28,-151.79,-2.27,-112.65,-2.27,-73.52,-2.27,-34.38,-2.27,4.76,-2.27,43.89,-2.27,83.03,-2.27,122.17,-2.27,161.3,-2.27,-151.79,32.73,-112.65,32.73,-73.52,32.73,-34.38,32.73,4.76,32.73,43.89,32.73,83.03,32.73,122.17,32.73,161.3,32.73,-151.79,67.74,-112.65,67.74,-73.52,67.74,-34.38,67.74,4.76,67.74,43.89,67.74,83.03,67.74,122.17,67.74,161.3,67.74,-151.79,102.75,-112.65,102.75,-73.52,102.75,-34.38,102.75,4.76,102.75,43.89,102.75,83.03,102.75,122.17,102.75,161.3,102.75,-151.79,137.75,-112.65,137.75,-73.52,137.75,-34.38,137.75,4.76,137.75,43.89,137.75,83.03,137.75,122.17,137.75,161.3,137.75]},{"type":"surface","name":"B_MOUTH.02","parent":"B_MOUTH.03","segmentX":8,"segmentY":8,"vertices":[-178.57,-176.83,-134.33,-176.83,-90.09,-176.83,-45.85,-176.83,-1.6,-176.83,42.64,-176.83,86.88,-176.83,131.12,-176.83,175.36,-176.83,-178.57,-133.24,-134.33,-133.24,-90.09,-133.24,-45.92,-133.24,-2.2,-133.23,41.52,-133.22,85.85,-133.22,130.59,-133.23,175.36,-133.24,-178.57,-89.65,-134.33,-89.65,-90.09,-89.65,-45.98,-89.64,-2.75,-89.63,40.48,-89.61,84.89,-89.61,130.1,-89.63,175.36,-89.65,-178.57,-46.05,-134.33,-46.05,-90.09,-46.05,-45.93,-46.06,-3.01,-46.08,39.91,-46.09,84.32,-46.1,129.78,-46.1,175.36,-46.05,-178.57,-2.46,-134.33,-2.46,-90.09,-2.46,-46.08,-2.5,-4.28,-2.92,37.51,-3.34,82.11,-3.28,128.64,-2.89,175.36,-2.46,-178.57,41.13,-134.33,41.13,-90.09,41.13,-46.23,41.05,-5.55,40.23,35.12,39.41,79.9,39.54,127.5,40.32,175.36,41.13,-178.57,84.72,-134.33,84.72,-90.09,84.72,-46.17,84.66,-5.89,84.01,34.38,83.37,79.16,83.49,127.1,84.16,175.36,84.72,-178.57,128.31,-134.33,128.31,-90.09,128.31,-46.26,128.33,-6.76,128.53,32.74,128.73,77.65,128.72,126.32,128.57,175.36,128.31,-178.57,171.9,-134.33,171.9,-90.09,171.9,-46.37,172,-7.69,173.12,30.99,174.23,76.04,174.06,125.49,173.02,175.36,171.9]},{"type":"surface","name":"B_MOUTH.01","parent":"B_MOUTH.02","segmentX":8,"segmentY":8,"vertices":[-159.45,-108.81,-117.56,-108.81,-75.66,-108.81,-33.77,-108.81,8.12,-108.81,50.02,-108.81,91.91,-108.81,133.81,-108.81,175.7,-108.81,-159.45,-72.73,-117.56,-72.73,-75.66,-72.73,-33.77,-72.73,8.12,-72.73,50.02,-72.73,91.91,-72.73,133.81,-72.73,175.7,-72.73,-159.45,-36.65,-117.56,-36.65,-75.66,-36.65,-33.77,-36.65,8.12,-36.65,50.02,-36.65,91.91,-36.65,133.81,-36.65,175.7,-36.65,-159.45,-0.57,-117.56,-0.57,-75.66,-0.57,-33.77,-0.57,8.12,-0.57,50.02,-0.57,91.91,-0.57,133.81,-0.57,175.7,-0.57,-159.45,35.51,-117.56,35.51,-75.66,35.51,-33.77,35.51,8.12,35.51,50.02,35.51,91.91,35.51,133.81,35.51,175.7,35.51,-159.45,71.59,-117.56,71.59,-75.66,71.59,-33.77,71.59,8.12,71.59,50.02,71.59,91.91,71.59,133.81,71.59,175.7,71.59,-159.45,107.68,-117.56,107.68,-75.66,107.68,-33.77,107.68,8.12,107.68,50.02,107.68,91.91,107.68,133.81,107.68,175.7,107.68,-159.45,143.76,-117.56,143.76,-75.66,143.76,-33.77,143.76,8.12,143.76,50.02,143.76,91.91,143.76,133.81,143.76,175.7,143.76,-159.45,179.84,-117.56,179.84,-75.66,179.84,-33.77,179.84,8.12,179.84,50.02,179.84,91.91,179.84,133.81,179.84,175.7,179.84]},{"type":"surface","name":"B_MOUTH.04","parent":"B_MOUTH.02","segmentX":8,"segmentY":8,"vertices":[-153.74,-140.09,-113.59,-140.09,-73.44,-140.09,-33.3,-140.09,6.85,-140.09,47,-140.09,87.15,-140.09,127.3,-140.09,167.45,-140.09,-153.74,-116.73,-113.59,-116.73,-73.44,-116.73,-33.3,-116.73,6.85,-116.73,47,-116.73,87.15,-116.73,127.3,-116.73,167.45,-116.73,-153.74,-93.37,-113.59,-93.37,-73.44,-93.37,-33.3,-93.37,6.85,-93.37,47,-93.37,87.15,-93.37,127.3,-93.37,167.45,-93.37,-153.74,-70,-113.59,-70,-73.44,-70,-33.3,-70,6.85,-70,47,-70,87.15,-70,127.3,-70,167.45,-70,-153.74,-46.64,-113.59,-46.64,-73.44,-46.64,-33.3,-46.64,6.85,-46.64,47,-46.64,87.15,-46.64,127.3,-46.64,167.45,-46.64,-153.74,-23.28,-113.59,-23.28,-73.44,-23.28,-33.3,-23.28,6.85,-23.28,47,-23.28,87.15,-23.28,127.3,-23.28,167.45,-23.28,-153.74,0.08,-113.59,0.08,-73.44,0.08,-33.3,0.08,6.85,0.08,47,0.08,87.15,0.08,127.3,0.08,167.45,0.08,-153.74,23.44,-113.59,23.44,-73.44,23.44,-33.3,23.44,6.85,23.44,47,23.44,87.15,23.44,127.3,23.44,167.45,23.44,-153.74,46.8,-113.59,46.8,-73.44,46.8,-33.3,46.8,6.85,46.8,47,46.8,87.15,46.8,127.3,46.8,167.45,46.8]},{"type":"surface","name":"B_MOUTH.05","parent":"B_MOUTH.02","segmentX":8,"segmentY":8,"vertices":[-130.04,-126.13,-94.19,-126.13,-58.34,-126.13,-22.48,-126.13,13.37,-126.13,49.22,-126.13,85.08,-126.13,120.93,-126.13,156.79,-126.13,-130.04,-92.77,-94.19,-92.77,-58.34,-92.77,-22.48,-92.77,13.37,-92.77,49.22,-92.77,85.08,-92.77,120.93,-92.77,156.79,-92.77,-130.04,-59.42,-94.19,-59.42,-58.34,-59.42,-22.48,-59.42,13.37,-59.42,49.22,-59.42,85.08,-59.42,120.93,-59.42,156.79,-59.42,-130.04,-26.06,-94.19,-26.06,-58.34,-26.06,-22.48,-26.06,13.37,-26.06,49.22,-26.06,85.08,-26.06,120.93,-26.06,156.79,-26.06,-130.04,7.29,-94.19,7.29,-58.34,7.29,-22.48,7.29,13.37,7.29,49.22,7.29,85.08,7.29,120.93,7.29,156.79,7.29,-130.04,40.65,-94.19,40.65,-58.34,40.65,-22.48,40.65,13.37,40.65,49.22,40.65,85.08,40.65,120.93,40.65,156.79,40.65,-130.04,74,-94.19,74,-58.34,74,-22.48,74,13.37,74,49.22,74,85.08,74,120.93,74,156.79,74,-130.04,107.36,-94.19,107.36,-58.34,107.36,-22.48,107.36,13.37,107.36,49.22,107.36,85.08,107.36,120.93,107.36,156.79,107.36,-130.04,140.72,-94.19,140.72,-58.34,140.72,-22.48,140.72,13.37,140.72,49.22,140.72,85.08,140.72,120.93,140.72,156.79,140.72]},{"type":"surface","name":"B_HAIR_FRONT.01","parent":"B_HAIR_FRONT.02","segmentX":8,"segmentY":8,"vertices":[-171.64,-167.23,-129.2,-167.23,-86.76,-167.23,-44.31,-167.23,-1.87,-167.23,40.58,-167.23,83.02,-167.23,125.47,-167.23,167.91,-167.23,-171.64,-126.11,-129.2,-126.11,-86.76,-126.11,-44.31,-126.11,-1.87,-126.11,40.58,-126.11,83.02,-126.11,125.47,-126.11,167.91,-126.11,-171.64,-85,-129.2,-85,-86.76,-85,-44.31,-85,-1.87,-85,40.58,-85,83.02,-85,125.47,-85,167.91,-85,-171.64,-43.89,-129.2,-43.89,-86.76,-43.89,-44.31,-43.89,-1.87,-43.89,40.58,-43.89,83.02,-43.89,125.47,-43.89,167.91,-43.89,-171.64,-2.77,-129.2,-2.77,-86.76,-2.77,-44.31,-2.77,-1.87,-2.77,40.58,-2.77,83.02,-2.77,125.47,-2.77,167.91,-2.77,-171.64,38.34,-129.2,38.34,-86.76,38.34,-44.31,38.34,-1.87,38.34,40.58,38.34,83.02,38.34,125.47,38.34,167.91,38.34,-171.64,79.46,-129.2,79.46,-86.76,79.46,-44.31,79.46,-1.87,79.46,40.58,79.46,83.02,79.46,125.47,79.46,167.91,79.46,-171.64,120.57,-129.2,120.57,-86.76,120.57,-44.31,120.57,-1.87,120.57,40.58,120.57,83.02,120.57,125.47,120.57,167.91,120.57,-171.64,161.68,-129.2,161.68,-86.76,161.68,-44.31,161.68,-1.87,161.68,40.58,161.68,83.02,161.68,125.47,161.68,167.91,161.68]},{"type":"surface","name":"B_HAIR_SIDE.01","parent":"B_HAIR_SIDE.02","segmentX":8,"segmentY":8,"vertices":[-168.56,-185.44,-126.27,-185.44,-83.97,-185.44,-41.67,-185.44,0.62,-185.44,42.92,-185.44,85.22,-185.44,127.51,-185.44,169.81,-185.44,-168.56,-139.56,-126.27,-139.56,-83.97,-139.56,-41.67,-139.56,0.62,-139.56,42.92,-139.56,85.22,-139.56,127.51,-139.56,169.81,-139.56,-168.56,-93.68,-126.27,-93.68,-83.97,-93.68,-41.67,-93.68,0.62,-93.68,42.92,-93.68,85.22,-93.68,127.51,-93.68,169.81,-93.68,-168.56,-47.8,-126.27,-47.8,-83.97,-47.8,-41.67,-47.8,0.62,-47.8,42.92,-47.8,85.22,-47.8,127.51,-47.8,169.81,-47.8,-168.56,-1.92,-126.27,-1.92,-83.97,-1.92,-41.67,-1.92,0.62,-1.92,42.92,-1.92,85.22,-1.92,127.51,-1.92,169.81,-1.92,-168.56,43.96,-126.27,43.96,-83.97,43.96,-41.67,43.96,0.62,43.96,42.92,43.96,85.22,43.96,127.51,43.96,169.81,43.96,-168.56,89.85,-126.27,89.85,-83.97,89.85,-41.67,89.85,0.62,89.85,42.92,89.85,85.22,89.85,127.51,89.85,169.81,89.85,-168.56,135.73,-126.27,135.73,-83.97,135.73,-41.67,135.73,0.62,135.73,42.92,135.73,85.22,135.73,127.51,135.73,169.81,135.73,-168.56,181.61,-126.27,181.61,-83.97,181.61,-41.67,181.61,0.62,181.61,42.92,181.61,85.22,181.61,127.51,181.61,169.81,181.61]},{"type":"surface","name":"B_HAIR_SIDE.05","parent":"B_HAIR_SIDE.01","segmentX":8,"segmentY":8,"vertices":[-179.97,-192.78,-135.45,-192.78,-90.94,-192.78,-46.42,-192.78,-1.91,-192.78,42.61,-192.78,87.12,-192.78,131.64,-192.78,176.15,-192.78,-179.97,-144.8,-135.45,-144.8,-90.94,-144.8,-46.42,-144.8,-1.91,-144.8,42.61,-144.8,87.12,-144.8,131.64,-144.8,176.15,-144.8,-179.97,-96.82,-135.45,-96.82,-90.94,-96.82,-46.42,-96.82,-1.91,-96.82,42.61,-96.82,87.12,-96.82,131.64,-96.82,176.15,-96.82,-179.97,-48.84,-135.45,-48.84,-90.94,-48.84,-46.42,-48.84,-1.91,-48.84,42.61,-48.84,87.12,-48.84,131.64,-48.84,176.15,-48.84,-179.97,-0.87,-135.45,-0.87,-90.94,-0.87,-46.42,-0.87,-1.91,-0.87,42.61,-0.86,87.12,-0.86,131.64,-0.86,176.15,-0.86,-179.97,47.11,-135.45,47.11,-90.94,47.11,-46.42,47.11,-1.91,47.11,42.61,47.11,87.12,47.11,131.64,47.11,176.15,47.11,-179.97,95.09,-135.45,95.09,-90.94,95.09,-46.42,95.09,-1.91,95.09,42.61,95.09,87.12,95.09,131.64,95.09,176.15,95.09,-179.97,143.07,-135.45,143.07,-90.94,143.07,-46.42,143.07,-1.91,143.07,42.61,143.07,87.12,143.07,131.64,143.07,176.15,143.07,-179.97,191.05,-135.45,191.05,-90.94,191.05,-46.42,191.05,-1.91,191.05,42.61,191.05,87.12,191.05,131.64,191.05,176.15,191.05]},{"type":"surface","name":"B_HAIR_TWIN.05","parent":"B_HAIR_TWIN.06","segmentX":8,"segmentY":8,"vertices":[-180.41,-188.43,-134.47,-188.43,-88.52,-188.43,-42.57,-188.43,3.38,-188.43,49.32,-188.43,95.27,-188.43,141.22,-188.43,187.17,-188.43,-180.41,-141.72,-134.47,-141.72,-88.52,-141.72,-42.57,-141.72,3.38,-141.72,49.32,-141.72,95.27,-141.72,141.22,-141.72,187.17,-141.72,-180.41,-95.02,-134.47,-95.02,-88.52,-95.02,-42.57,-95.02,3.38,-95.02,49.32,-95.02,95.27,-95.02,141.22,-95.02,187.17,-95.02,-180.41,-48.32,-134.47,-48.32,-88.52,-48.32,-42.57,-48.32,3.38,-48.32,49.32,-48.32,95.27,-48.32,141.22,-48.32,187.17,-48.32,-180.41,-1.62,-134.47,-1.62,-88.52,-1.62,-42.57,-1.62,3.38,-1.62,49.32,-1.62,95.27,-1.62,141.22,-1.62,187.17,-1.62,-180.41,45.08,-134.47,45.08,-88.52,45.08,-42.57,45.08,3.38,45.08,49.32,45.08,95.27,45.08,141.22,45.08,187.17,45.08,-180.41,91.79,-134.47,91.79,-88.52,91.79,-42.57,91.79,3.38,91.79,49.32,91.79,95.27,91.79,141.22,91.79,187.17,91.79,-180.41,138.49,-134.47,138.49,-88.52,138.49,-42.57,138.49,3.38,138.49,49.32,138.49,95.27,138.49,141.22,138.49,187.17,138.49,-180.41,185.19,-134.47,185.19,-88.52,185.19,-42.57,185.19,3.38,185.19,49.32,185.19,95.27,185.19,141.22,185.19,187.17,185.19]},{"type":"surface","name":"B_HAIR_TWIN.07","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-78.23,-162.39,-71.61,-162.39,-64.99,-162.39,-58.37,-162.39,-51.74,-162.39,-45.12,-162.39,-38.5,-162.39,-31.88,-162.39,-25.26,-162.39,-78.23,-150.25,-71.61,-150.25,-64.99,-150.25,-58.37,-150.25,-51.74,-150.25,-45.12,-150.25,-38.5,-150.25,-31.88,-150.25,-25.26,-150.25,-78.23,-138.11,-71.61,-138.11,-64.99,-138.11,-58.37,-138.11,-51.74,-138.11,-45.12,-138.11,-38.5,-138.11,-31.88,-138.11,-25.26,-138.11,-78.23,-125.97,-71.61,-125.97,-64.99,-125.97,-58.37,-125.97,-51.74,-125.97,-45.12,-125.97,-38.5,-125.97,-31.88,-125.97,-25.26,-125.97,-78.23,-113.83,-71.61,-113.83,-64.99,-113.83,-58.37,-113.83,-51.74,-113.83,-45.12,-113.83,-38.5,-113.83,-31.88,-113.83,-25.26,-113.83,-78.23,-101.69,-71.61,-101.69,-64.99,-101.69,-58.37,-101.69,-51.74,-101.69,-45.12,-101.69,-38.5,-101.69,-31.88,-101.69,-25.26,-101.69,-78.23,-89.55,-71.61,-89.55,-64.99,-89.55,-58.37,-89.55,-51.74,-89.55,-45.12,-89.55,-38.5,-89.55,-31.88,-89.55,-25.26,-89.55,-78.23,-77.41,-71.61,-77.41,-64.99,-77.41,-58.37,-77.41,-51.74,-77.41,-45.12,-77.41,-38.5,-77.41,-31.88,-77.41,-25.26,-77.41,-78.23,-65.28,-71.61,-65.28,-64.99,-65.28,-58.37,-65.28,-51.74,-65.28,-45.12,-65.28,-38.5,-65.28,-31.88,-65.28,-25.26,-65.28]},{"type":"surface","name":"B_HAIR_TWIN.16","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-104.3,-187.92,-70.44,-187.92,-36.59,-187.92,-2.74,-187.92,31.11,-187.92,64.97,-187.92,98.82,-187.92,132.67,-187.92,166.53,-187.92,-104.3,-141.39,-70.44,-141.39,-36.59,-141.39,-2.74,-141.39,31.11,-141.39,64.97,-141.39,98.82,-141.39,132.67,-141.39,166.53,-141.39,-104.3,-94.87,-70.44,-94.87,-36.59,-94.87,-2.74,-94.87,31.11,-94.87,64.97,-94.87,98.82,-94.87,132.67,-94.87,166.53,-94.87,-104.3,-48.34,-70.44,-48.34,-36.59,-48.34,-2.74,-48.34,31.11,-48.34,64.97,-48.34,98.82,-48.34,132.67,-48.34,166.53,-48.34,-104.3,-1.81,-70.44,-1.81,-36.59,-1.81,-2.74,-1.81,31.11,-1.81,64.97,-1.81,98.82,-1.81,132.67,-1.81,166.53,-1.81,-104.3,44.71,-70.44,44.71,-36.59,44.71,-2.74,44.71,31.11,44.71,64.97,44.71,98.82,44.71,132.67,44.71,166.53,44.71,-104.3,91.24,-70.44,91.24,-36.59,91.24,-2.74,91.24,31.11,91.24,64.97,91.24,98.82,91.24,132.67,91.24,166.53,91.24,-104.3,137.76,-70.44,137.76,-36.59,137.76,-2.74,137.76,31.11,137.76,64.97,137.76,98.82,137.76,132.67,137.76,166.53,137.76,-104.3,184.29,-70.44,184.29,-36.59,184.29,-2.74,184.29,31.11,184.29,64.97,184.29,98.82,184.29,132.67,184.29,166.53,184.29]},{"type":"surface","name":"B_HAIR_TWIN.17","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-106.57,-180.12,-71.06,-180.12,-35.55,-180.12,-0.04,-180.12,35.47,-180.12,70.98,-180.12,106.5,-180.12,142.01,-180.12,177.52,-180.12,-106.57,-137.16,-71.06,-137.16,-35.55,-137.16,-0.04,-137.16,35.47,-137.16,70.98,-137.16,106.5,-137.16,142.01,-137.16,177.52,-137.16,-106.57,-94.21,-71.06,-94.21,-35.55,-94.21,-0.04,-94.21,35.47,-94.21,70.98,-94.21,106.5,-94.21,142.01,-94.21,177.52,-94.21,-106.57,-51.25,-71.06,-51.25,-35.55,-51.25,-0.04,-51.25,35.47,-51.25,70.98,-51.25,106.5,-51.25,142.01,-51.25,177.52,-51.25,-106.57,-8.29,-71.06,-8.29,-35.55,-8.29,-0.04,-8.29,35.47,-8.29,70.98,-8.29,106.5,-8.29,142.01,-8.29,177.52,-8.29,-106.57,34.67,-71.06,34.67,-35.55,34.67,-0.04,34.67,35.47,34.67,70.98,34.67,106.5,34.67,142.01,34.67,177.52,34.67,-106.57,77.63,-71.06,77.63,-35.55,77.63,-0.04,77.63,35.47,77.63,70.98,77.63,106.5,77.63,142.01,77.63,177.52,77.63,-106.57,120.58,-71.06,120.58,-35.55,120.58,-0.04,120.58,35.47,120.58,70.98,120.58,106.5,120.58,142.01,120.58,177.52,120.58,-106.57,163.54,-71.06,163.54,-35.55,163.54,-0.04,163.54,35.47,163.54,70.98,163.54,106.5,163.54,142.01,163.54,177.52,163.54]},{"type":"surface","name":"B_HAIR_TWIN.18","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-100.75,-179.48,-66.05,-179.48,-31.36,-179.48,3.33,-179.48,38.02,-179.48,72.71,-179.48,107.41,-179.48,142.1,-179.48,176.79,-179.48,-100.75,-133.82,-66.05,-133.82,-31.36,-133.82,3.33,-133.82,38.02,-133.82,72.71,-133.82,107.41,-133.82,142.1,-133.82,176.79,-133.82,-100.75,-88.15,-66.05,-88.15,-31.36,-88.15,3.33,-88.15,38.02,-88.15,72.71,-88.15,107.41,-88.15,142.1,-88.15,176.79,-88.15,-100.75,-42.49,-66.05,-42.49,-31.36,-42.49,3.33,-42.49,38.02,-42.49,72.71,-42.49,107.41,-42.49,142.1,-42.49,176.79,-42.49,-100.75,3.18,-66.05,3.18,-31.36,3.18,3.33,3.18,38.02,3.18,72.71,3.18,107.41,3.18,142.1,3.18,176.79,3.18,-100.75,48.84,-66.05,48.84,-31.36,48.84,3.33,48.84,38.02,48.84,72.71,48.84,107.41,48.84,142.1,48.84,176.79,48.84,-100.75,94.51,-66.05,94.51,-31.36,94.51,3.33,94.51,38.02,94.51,72.71,94.51,107.41,94.51,142.1,94.51,176.79,94.51,-100.75,140.17,-66.05,140.17,-31.36,140.17,3.33,140.17,38.02,140.17,72.71,140.17,107.41,140.17,142.1,140.17,176.79,140.17,-100.75,185.84,-66.05,185.84,-31.36,185.84,3.33,185.84,38.02,185.84,72.71,185.84,107.41,185.84,142.1,185.84,176.79,185.84]},{"type":"surface","name":"B_HAIR_TWIN.19","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-123.6,-175.04,-92.26,-175.04,-60.92,-175.04,-29.57,-175.04,1.77,-175.04,33.11,-175.04,64.45,-175.04,95.8,-175.04,127.14,-175.04,-123.6,-132.49,-92.26,-132.49,-60.92,-132.49,-29.57,-132.49,1.77,-132.49,33.11,-132.49,64.45,-132.49,95.8,-132.49,127.14,-132.49,-123.6,-89.93,-92.26,-89.93,-60.92,-89.93,-29.57,-89.93,1.77,-89.93,33.11,-89.93,64.45,-89.93,95.8,-89.93,127.14,-89.93,-123.6,-47.38,-92.26,-47.38,-60.92,-47.38,-29.57,-47.38,1.77,-47.38,33.11,-47.38,64.45,-47.38,95.8,-47.38,127.14,-47.38,-123.6,-4.83,-92.26,-4.83,-60.92,-4.83,-29.57,-4.83,1.77,-4.83,33.11,-4.83,64.45,-4.83,95.8,-4.83,127.14,-4.83,-123.6,37.73,-92.26,37.73,-60.92,37.73,-29.57,37.73,1.77,37.73,33.11,37.73,64.45,37.73,95.8,37.73,127.14,37.73,-123.6,80.28,-92.26,80.28,-60.92,80.28,-29.57,80.28,1.77,80.28,33.11,80.28,64.45,80.28,95.8,80.28,127.14,80.28,-123.6,122.83,-92.26,122.83,-60.92,122.83,-29.57,122.83,1.77,122.83,33.11,122.83,64.45,122.83,95.8,122.83,127.14,122.83,-123.6,165.38,-92.26,165.38,-60.92,165.38,-29.57,165.38,1.77,165.38,33.11,165.38,64.45,165.38,95.8,165.38,127.14,165.38]},{"type":"surface","name":"B_HAIR_TWIN.20","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-132.4,-166.1,-102.9,-166.1,-73.41,-166.1,-43.92,-166.1,-14.42,-166.1,15.07,-166.1,44.57,-166.1,74.06,-166.1,103.55,-166.1,-132.4,-129.59,-102.9,-129.59,-73.41,-129.59,-43.92,-129.59,-14.42,-129.59,15.07,-129.59,44.57,-129.59,74.06,-129.59,103.55,-129.59,-132.4,-93.08,-102.9,-93.08,-73.41,-93.08,-43.92,-93.08,-14.42,-93.08,15.07,-93.08,44.57,-93.08,74.06,-93.08,103.55,-93.08,-132.4,-56.58,-102.9,-56.58,-73.41,-56.58,-43.92,-56.58,-14.42,-56.58,15.07,-56.58,44.57,-56.58,74.06,-56.58,103.55,-56.58,-132.4,-20.07,-102.9,-20.07,-73.41,-20.07,-43.92,-20.07,-14.42,-20.07,15.07,-20.07,44.57,-20.07,74.06,-20.07,103.55,-20.07,-132.4,16.44,-102.9,16.44,-73.41,16.44,-43.92,16.44,-14.42,16.44,15.07,16.44,44.57,16.44,74.06,16.44,103.55,16.44,-132.4,52.94,-102.9,52.94,-73.41,52.94,-43.92,52.94,-14.42,52.94,15.07,52.94,44.57,52.94,74.06,52.94,103.55,52.94,-132.4,89.45,-102.9,89.45,-73.41,89.45,-43.92,89.45,-14.42,89.45,15.07,89.45,44.57,89.45,74.06,89.45,103.55,89.45,-132.4,125.95,-102.9,125.95,-73.41,125.95,-43.92,125.95,-14.42,125.95,15.07,125.95,44.57,125.95,74.06,125.95,103.55,125.95]},{"type":"surface","name":"B_HAIR_TWIN.21","parent":"B_HAIR_TWIN.05","segmentX":8,"segmentY":8,"vertices":[-92.9,-166.34,-75.27,-166.34,-57.65,-166.34,-40.02,-166.34,-22.4,-166.34,-4.77,-166.34,12.86,-166.34,30.48,-166.34,48.11,-166.34,-92.9,-126.55,-75.27,-126.55,-57.65,-126.55,-40.02,-126.55,-22.4,-126.55,-4.77,-126.55,12.86,-126.55,30.48,-126.55,48.11,-126.55,-92.9,-86.75,-75.27,-86.75,-57.65,-86.75,-40.02,-86.75,-22.4,-86.75,-4.77,-86.75,12.86,-86.75,30.48,-86.75,48.11,-86.75,-92.9,-46.96,-75.27,-46.96,-57.65,-46.96,-40.02,-46.96,-22.4,-46.96,-4.77,-46.96,12.86,-46.96,30.48,-46.96,48.11,-46.96,-92.9,-7.17,-75.27,-7.17,-57.65,-7.17,-40.02,-7.17,-22.4,-7.17,-4.77,-7.17,12.86,-7.17,30.48,-7.17,48.11,-7.17,-92.9,32.63,-75.27,32.63,-57.65,32.63,-40.02,32.63,-22.4,32.63,-4.77,32.63,12.86,32.63,30.48,32.63,48.11,32.63,-92.9,72.42,-75.27,72.42,-57.65,72.42,-40.02,72.42,-22.4,72.42,-4.77,72.42,12.86,72.42,30.48,72.42,48.11,72.42,-92.9,112.21,-75.27,112.21,-57.65,112.21,-40.02,112.21,-22.4,112.21,-4.77,112.21,12.86,112.21,30.48,112.21,48.11,112.21,-92.9,152,-75.27,152,-57.65,152,-40.02,152,-22.4,152,-4.77,152,12.86,152,30.48,152,48.11,152]},{"type":"surface","name":"B_HAIR_TWIN.08","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-3.5,-163.12,5.94,-163.12,15.38,-163.12,24.81,-163.12,34.25,-163.12,43.69,-163.12,53.13,-163.12,62.57,-163.12,72.01,-163.12,-3.5,-151.57,5.94,-151.57,15.38,-151.57,24.81,-151.57,34.25,-151.57,43.69,-151.57,53.13,-151.57,62.57,-151.57,72.01,-151.57,-3.5,-140.01,5.94,-140.01,15.38,-140.01,24.81,-140.01,34.25,-140.01,43.69,-140.01,53.13,-140.01,62.57,-140.01,72.01,-140.01,-3.5,-128.46,5.94,-128.46,15.38,-128.46,24.81,-128.46,34.25,-128.46,43.69,-128.46,53.13,-128.46,62.57,-128.46,72.01,-128.46,-3.5,-116.91,5.94,-116.91,15.38,-116.91,24.81,-116.91,34.25,-116.91,43.69,-116.91,53.13,-116.91,62.57,-116.91,72.01,-116.91,-3.5,-105.35,5.94,-105.35,15.38,-105.35,24.81,-105.35,34.25,-105.35,43.69,-105.35,53.13,-105.35,62.57,-105.35,72.01,-105.35,-3.5,-93.8,5.94,-93.8,15.38,-93.8,24.81,-93.8,34.25,-93.8,43.69,-93.8,53.13,-93.8,62.57,-93.8,72.01,-93.8,-3.5,-82.25,5.94,-82.25,15.38,-82.25,24.81,-82.25,34.25,-82.25,43.69,-82.25,53.13,-82.25,62.57,-82.25,72.01,-82.25,-3.5,-70.7,5.94,-70.7,15.38,-70.7,24.81,-70.7,34.25,-70.7,43.69,-70.7,53.13,-70.7,62.57,-70.7,72.01,-70.7]},{"type":"surface","name":"B_HAIR_TWIN.02","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-140.26,-182.52,-110.87,-182.52,-81.49,-182.52,-52.11,-182.52,-22.72,-182.52,6.66,-182.52,36.05,-182.52,65.43,-182.52,94.81,-182.52,-140.26,-140.16,-110.87,-140.16,-81.49,-140.16,-52.11,-140.16,-22.72,-140.16,6.66,-140.16,36.05,-140.16,65.43,-140.16,94.81,-140.16,-140.26,-97.8,-110.87,-97.8,-81.49,-97.8,-52.11,-97.8,-22.72,-97.8,6.66,-97.8,36.05,-97.8,65.43,-97.8,94.81,-97.8,-140.26,-55.44,-110.87,-55.44,-81.49,-55.44,-52.11,-55.44,-22.72,-55.44,6.66,-55.44,36.05,-55.44,65.43,-55.44,94.81,-55.44,-140.26,-13.07,-110.87,-13.07,-81.49,-13.07,-52.11,-13.07,-22.72,-13.07,6.66,-13.07,36.05,-13.07,65.43,-13.07,94.81,-13.07,-140.26,29.29,-110.87,29.29,-81.49,29.29,-52.11,29.29,-22.72,29.29,6.66,29.29,36.05,29.29,65.43,29.29,94.81,29.29,-140.26,71.65,-110.87,71.65,-81.49,71.65,-52.11,71.65,-22.72,71.65,6.66,71.65,36.05,71.65,65.43,71.65,94.81,71.65,-140.26,114.02,-110.87,114.02,-81.49,114.02,-52.11,114.02,-22.72,114.02,6.66,114.02,36.05,114.02,65.43,114.02,94.81,114.02,-140.26,156.38,-110.87,156.38,-81.49,156.38,-52.11,156.38,-22.72,156.38,6.66,156.38,36.05,156.38,65.43,156.38,94.81,156.38]},{"type":"surface","name":"B_HAIR_TWIN.09","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-138.59,-191.25,-110.85,-191.29,-83.11,-191.33,-55.38,-191.37,-27.64,-191.41,0.1,-191.45,27.84,-191.49,55.57,-191.53,83.31,-191.57,-138.31,-145.23,-110.57,-145.26,-82.83,-145.3,-55.1,-145.34,-27.36,-145.38,0.38,-145.42,28.12,-145.46,55.85,-145.5,83.59,-145.54,-138.03,-99.2,-110.29,-99.24,-82.55,-99.28,-54.81,-99.32,-27.08,-99.35,0.66,-99.39,28.4,-99.43,56.13,-99.47,83.87,-99.51,-137.75,-53.17,-110.01,-53.21,-82.27,-53.25,-54.53,-53.29,-26.8,-53.33,0.94,-53.37,28.68,-53.41,56.42,-53.44,84.15,-53.48,-137.46,-7.14,-109.73,-7.18,-81.99,-7.22,-54.25,-7.26,-26.52,-7.3,1.22,-7.34,28.96,-7.38,56.7,-7.42,84.43,-7.46,-137.18,38.88,-109.45,38.84,-81.71,38.81,-53.97,38.77,-26.23,38.73,1.5,38.69,29.24,38.65,56.98,38.61,84.71,38.57,-136.9,84.91,-109.17,84.87,-81.43,84.83,-53.69,84.79,-25.95,84.75,1.78,84.72,29.52,84.68,57.26,84.64,85,84.6,-136.62,130.94,-108.88,130.9,-81.15,130.86,-53.41,130.82,-25.67,130.78,2.06,130.74,29.8,130.7,57.54,130.66,85.28,130.63,-136.34,176.96,-108.6,176.93,-80.87,176.89,-53.13,176.85,-25.39,176.81,2.35,176.77,30.08,176.73,57.82,176.69,85.56,176.65]},{"type":"surface","name":"B_HAIR_TWIN.10","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-144.51,-183.13,-104.01,-183.13,-63.52,-183.13,-23.02,-183.13,17.48,-183.13,57.97,-183.13,98.47,-183.13,138.96,-183.13,179.46,-183.13,-144.51,-137.66,-104.01,-137.66,-63.52,-137.66,-23.02,-137.66,17.48,-137.66,57.97,-137.66,98.47,-137.66,138.96,-137.66,179.46,-137.66,-144.51,-92.19,-104.01,-92.19,-63.52,-92.19,-23.02,-92.19,17.48,-92.19,57.97,-92.19,98.47,-92.19,138.96,-92.19,179.46,-92.19,-144.51,-46.71,-104.01,-46.71,-63.52,-46.71,-23.02,-46.71,17.48,-46.71,57.97,-46.71,98.47,-46.71,138.96,-46.71,179.46,-46.71,-144.51,-1.24,-104.01,-1.24,-63.52,-1.24,-23.02,-1.24,17.48,-1.24,57.97,-1.24,98.47,-1.24,138.96,-1.24,179.46,-1.24,-144.51,44.23,-104.01,44.23,-63.52,44.23,-23.02,44.23,17.48,44.23,57.97,44.23,98.47,44.23,138.96,44.23,179.46,44.23,-144.51,89.71,-104.01,89.71,-63.52,89.71,-23.02,89.71,17.48,89.71,57.97,89.71,98.47,89.71,138.96,89.71,179.46,89.71,-144.51,135.18,-104.01,135.18,-63.52,135.18,-23.02,135.18,17.48,135.18,57.97,135.18,98.47,135.18,138.96,135.18,179.46,135.18,-144.51,180.65,-104.01,180.65,-63.52,180.65,-23.02,180.65,17.48,180.65,57.97,180.65,98.47,180.65,138.96,180.65,179.46,180.65]},{"type":"surface","name":"B_HAIR_TWIN.11","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-97.49,-194.19,-67.77,-194.19,-38.05,-194.19,-8.33,-194.19,21.39,-194.19,51.11,-194.19,80.83,-194.19,110.55,-194.19,140.27,-194.19,-97.49,-146.78,-67.77,-146.78,-38.05,-146.78,-8.33,-146.78,21.39,-146.78,51.11,-146.78,80.83,-146.78,110.55,-146.78,140.27,-146.78,-97.49,-99.36,-67.77,-99.36,-38.05,-99.36,-8.33,-99.36,21.39,-99.36,51.11,-99.36,80.83,-99.36,110.55,-99.36,140.27,-99.36,-97.49,-51.95,-67.77,-51.95,-38.05,-51.95,-8.33,-51.95,21.39,-51.95,51.11,-51.95,80.83,-51.95,110.55,-51.95,140.27,-51.95,-97.49,-4.54,-67.77,-4.54,-38.05,-4.54,-8.33,-4.54,21.39,-4.54,51.11,-4.54,80.83,-4.54,110.55,-4.54,140.27,-4.54,-97.49,42.88,-67.77,42.88,-38.05,42.88,-8.33,42.88,21.39,42.88,51.11,42.88,80.83,42.88,110.55,42.88,140.27,42.88,-97.49,90.29,-67.77,90.29,-38.05,90.29,-8.33,90.29,21.39,90.29,51.11,90.29,80.83,90.29,110.55,90.29,140.27,90.29,-97.49,137.71,-67.77,137.71,-38.05,137.71,-8.33,137.71,21.39,137.71,51.11,137.71,80.83,137.71,110.55,137.71,140.27,137.71,-97.49,185.12,-67.77,185.12,-38.05,185.12,-8.33,185.12,21.39,185.12,51.11,185.12,80.83,185.12,110.55,185.12,140.27,185.12]},{"type":"surface","name":"B_HAIR_TWIN.12","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-39.07,-158.26,-20.86,-158.26,-2.66,-158.26,15.54,-158.26,33.74,-158.26,51.94,-158.26,70.14,-158.26,88.34,-158.26,106.54,-158.26,-39.07,-115.02,-20.86,-115.02,-2.66,-115.02,15.54,-115.02,33.74,-115.02,51.94,-115.02,70.14,-115.02,88.34,-115.02,106.54,-115.02,-39.07,-71.77,-20.86,-71.77,-2.66,-71.77,15.54,-71.77,33.74,-71.77,51.94,-71.77,70.14,-71.77,88.34,-71.77,106.54,-71.77,-39.07,-28.53,-20.86,-28.53,-2.66,-28.53,15.54,-28.53,33.74,-28.53,51.94,-28.53,70.14,-28.53,88.34,-28.53,106.54,-28.53,-39.07,14.72,-20.86,14.72,-2.66,14.72,15.54,14.72,33.74,14.72,51.94,14.72,70.14,14.72,88.34,14.72,106.54,14.72,-39.07,57.97,-20.86,57.97,-2.66,57.97,15.54,57.97,33.74,57.97,51.94,57.97,70.14,57.97,88.34,57.97,106.54,57.97,-39.07,101.21,-20.86,101.21,-2.66,101.21,15.54,101.21,33.74,101.21,51.94,101.21,70.14,101.21,88.34,101.21,106.54,101.21,-39.07,144.46,-20.86,144.46,-2.66,144.46,15.54,144.46,33.74,144.46,51.94,144.46,70.14,144.46,88.34,144.46,106.54,144.46,-39.07,187.7,-20.86,187.7,-2.66,187.7,15.54,187.7,33.74,187.7,51.94,187.7,70.14,187.7,88.34,187.7,106.54,187.7]},{"type":"surface","name":"B_HAIR_TWIN.13","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-174.36,-138.73,-138.23,-138.73,-102.11,-138.73,-65.98,-138.73,-29.85,-138.73,6.27,-138.73,42.4,-138.73,78.53,-138.73,114.66,-138.73,-174.36,-101.83,-138.23,-101.83,-102.11,-101.83,-65.98,-101.83,-29.85,-101.83,6.27,-101.83,42.4,-101.83,78.53,-101.83,114.66,-101.83,-174.36,-64.93,-138.23,-64.93,-102.11,-64.93,-65.98,-64.93,-29.85,-64.93,6.27,-64.93,42.4,-64.93,78.53,-64.93,114.66,-64.93,-174.36,-28.03,-138.23,-28.03,-102.11,-28.03,-65.98,-28.03,-29.85,-28.03,6.27,-28.03,42.4,-28.03,78.53,-28.03,114.66,-28.03,-174.36,8.87,-138.23,8.87,-102.11,8.87,-65.98,8.87,-29.85,8.87,6.27,8.87,42.4,8.87,78.53,8.87,114.66,8.87,-174.36,45.77,-138.23,45.77,-102.11,45.77,-65.98,45.77,-29.85,45.77,6.27,45.77,42.4,45.77,78.53,45.77,114.66,45.77,-174.36,82.67,-138.23,82.67,-102.11,82.67,-65.98,82.67,-29.85,82.67,6.27,82.67,42.4,82.67,78.53,82.67,114.66,82.67,-174.36,119.57,-138.23,119.57,-102.11,119.57,-65.98,119.57,-29.85,119.57,6.27,119.57,42.4,119.57,78.53,119.57,114.66,119.57,-174.36,156.47,-138.23,156.47,-102.11,156.47,-65.98,156.47,-29.85,156.47,6.27,156.47,42.4,156.47,78.53,156.47,114.66,156.47]},{"type":"surface","name":"B_HAIR_TWIN.14","parent":"B_HAIR_TWIN.15","segmentX":8,"segmentY":8,"vertices":[-83.44,-176.67,-61.19,-176.67,-38.94,-176.67,-16.69,-176.67,5.56,-176.67,27.81,-176.67,50.06,-176.67,72.31,-176.67,94.56,-176.67,-83.44,-136.78,-61.19,-136.78,-38.94,-136.78,-16.69,-136.78,5.56,-136.78,27.81,-136.78,50.06,-136.78,72.31,-136.78,94.56,-136.78,-83.44,-96.89,-61.19,-96.89,-38.94,-96.89,-16.69,-96.89,5.56,-96.89,27.81,-96.89,50.06,-96.89,72.31,-96.89,94.56,-96.89,-83.44,-57.01,-61.19,-57.01,-38.94,-57.01,-16.69,-57.01,5.56,-57.01,27.81,-57.01,50.06,-57.01,72.31,-57.01,94.56,-57.01,-83.44,-17.12,-61.19,-17.12,-38.94,-17.12,-16.69,-17.12,5.56,-17.12,27.81,-17.12,50.06,-17.12,72.31,-17.12,94.56,-17.12,-83.44,22.77,-61.19,22.77,-38.94,22.77,-16.69,22.77,5.56,22.77,27.81,22.77,50.06,22.77,72.31,22.77,94.56,22.77,-83.44,62.66,-61.19,62.66,-38.94,62.66,-16.69,62.66,5.56,62.66,27.81,62.66,50.06,62.66,72.31,62.66,94.56,62.66,-83.44,102.55,-61.19,102.55,-38.94,102.55,-16.69,102.55,5.56,102.55,27.81,102.55,50.06,102.55,72.31,102.55,94.56,102.55,-83.44,142.44,-61.19,142.44,-38.94,142.44,-16.69,142.44,5.56,142.44,27.81,142.44,50.06,142.44,72.31,142.44,94.56,142.44]},{"type":"surface","name":"B_HAIR_BACK.01","parent":"B_HAIR_BACK.02","segmentX":8,"segmentY":8,"vertices":[-187.83,-189.04,-141.02,-189.04,-94.22,-189.04,-47.41,-189.04,-0.6,-189.04,46.21,-189.04,93.01,-189.04,139.82,-189.04,186.63,-189.04,-187.83,-141.96,-141.02,-141.96,-94.22,-141.96,-47.41,-141.96,-0.6,-141.96,46.21,-141.96,93.01,-141.96,139.82,-141.96,186.63,-141.96,-187.83,-94.87,-141.02,-94.87,-94.22,-94.87,-47.41,-94.87,-0.6,-94.87,46.21,-94.87,93.01,-94.87,139.82,-94.87,186.63,-94.87,-187.83,-47.79,-141.02,-47.79,-94.22,-47.79,-47.41,-47.79,-0.6,-47.79,46.21,-47.79,93.01,-47.79,139.82,-47.79,186.63,-47.79,-187.83,-0.71,-141.02,-0.71,-94.22,-0.71,-47.41,-0.71,-0.6,-0.71,46.21,-0.71,93.01,-0.71,139.82,-0.71,186.63,-0.71,-187.83,46.38,-141.02,46.38,-94.22,46.38,-47.41,46.38,-0.6,46.38,46.21,46.38,93.01,46.38,139.82,46.38,186.63,46.38,-187.83,93.46,-141.02,93.46,-94.22,93.46,-47.41,93.46,-0.6,93.46,46.21,93.46,93.01,93.46,139.82,93.46,186.63,93.46,-187.83,140.55,-141.02,140.55,-94.22,140.55,-47.41,140.55,-0.6,140.55,46.21,140.55,93.01,140.55,139.82,140.55,186.63,140.55,-187.83,187.63,-141.02,187.63,-94.22,187.63,-47.41,187.63,-0.6,187.63,46.21,187.63,93.01,187.63,139.82,187.63,186.63,187.63]},{"length":150,"name":"B_CLOTHES.04","parent":"B_CLOTHES.07","transform":{"x":378.48,"y":-15.7,"skX":105.9,"skY":105.9}},{"type":"surface","name":"B_CLOTHES.06","parent":"B_CLOTHES.07","segmentX":8,"segmentY":8,"vertices":[-174.38,154.24,-170.89,110.84,-167.4,67.44,-163.9,24.05,-160.41,-19.35,-156.92,-62.74,-153.43,-106.14,-149.94,-149.54,-146.45,-192.93,-84.54,161.47,-81.05,118.07,-77.55,74.67,-74.06,31.28,-70.57,-12.12,-67.08,-55.52,-63.59,-98.91,-60.1,-142.31,-56.6,-185.7,5.3,168.69,8.8,125.3,12.29,81.9,15.78,38.51,19.27,-4.89,22.76,-48.29,26.25,-91.68,29.74,-135.08,33.24,-178.48,95.14,175.92,98.64,132.53,102.13,89.13,105.62,45.73,109.11,2.34,112.6,-41.06,116.09,-84.45,119.59,-127.85,123.08,-171.25,184.99,183.15,188.48,139.75,191.97,96.36,195.46,52.96,198.95,9.57,202.44,-33.83,205.94,-77.23,209.43,-120.62,212.92,-164.02,274.83,190.38,278.32,146.98,281.81,103.59,285.3,60.19,288.79,16.79,292.29,-26.6,295.78,-70,299.27,-113.39,302.76,-156.79,364.67,197.61,368.16,154.21,371.65,110.82,375.14,67.42,378.63,24.02,382.13,-19.37,385.62,-62.77,389.11,-106.17,392.6,-149.56,454.51,204.84,458,161.44,461.49,118.04,464.98,74.65,468.48,31.25,471.97,-12.14,475.46,-55.54,478.95,-98.94,482.44,-142.33,544.35,212.06,547.84,168.67,551.33,125.27,554.83,81.88,558.32,38.48,561.81,-4.92,565.3,-48.31,568.79,-91.71,572.28,-135.1]},{"length":150,"name":"B_HAND.08","parent":"B_CLOTHES.04","transform":{"x":301.23,"y":13.91,"skX":-3.1,"skY":-3.1}},{"type":"surface","name":"B_HAND.11","parent":"B_HAND.08","segmentX":8,"segmentY":8,"vertices":[330.78,106.23,279.15,114.49,227.52,122.75,175.89,131.01,124.26,139.27,72.63,147.53,21.01,155.8,-30.62,164.06,-82.25,172.32,324.91,69.57,273.29,77.83,221.66,86.09,170.03,94.35,118.4,102.61,66.77,110.87,15.14,119.14,-36.49,127.4,-88.12,135.66,319.05,32.9,267.42,41.17,215.79,49.43,164.16,57.69,112.53,65.95,60.9,74.21,9.27,82.47,-42.36,90.74,-93.99,99,313.18,-3.76,261.55,4.51,209.92,12.77,158.29,21.03,106.66,29.29,55.04,37.55,3.41,45.81,-48.22,54.08,-99.85,62.34,307.31,-40.42,255.69,-32.16,204.06,-23.89,152.43,-15.63,100.8,-7.37,49.17,0.89,-2.46,9.15,-54.09,17.41,-105.72,25.68,301.45,-77.08,249.82,-68.82,198.19,-60.55,146.56,-52.29,94.93,-44.03,43.3,-35.77,-8.33,-27.51,-59.96,-19.25,-111.59,-10.98,295.58,-113.74,243.95,-105.48,192.32,-97.21,140.69,-88.95,89.07,-80.69,37.44,-72.43,-14.19,-64.17,-65.82,-55.91,-117.45,-47.64,289.72,-150.4,238.09,-142.14,186.46,-133.88,134.83,-125.61,83.2,-117.35,31.57,-109.09,-20.06,-100.83,-71.69,-92.57,-123.32,-84.3,283.85,-187.06,232.22,-178.8,180.59,-170.54,128.96,-162.27,77.33,-154.01,25.7,-145.75,-25.93,-137.49,-77.55,-129.23,-129.18,-120.97]},{"type":"surface","name":"B_CLOTHES.29","parent":"B_CLOTHES.31","segmentX":8,"segmentY":8,"vertices":[-157.12,151.21,-159.37,118.08,-161.63,84.95,-163.89,51.82,-166.15,18.69,-168.41,-14.44,-170.67,-47.57,-172.93,-80.71,-175.18,-113.84,-72.16,145.42,-74.42,112.29,-76.68,79.16,-78.93,46.03,-81.19,12.9,-83.45,-20.24,-85.71,-53.37,-87.97,-86.5,-90.23,-119.63,12.8,139.63,10.54,106.5,8.28,73.37,6.02,40.23,3.76,7.1,1.5,-26.03,-0.75,-59.16,-3.01,-92.29,-5.27,-125.42,97.75,133.84,95.5,100.7,93.24,67.57,90.98,34.44,88.72,1.31,86.46,-31.82,84.2,-64.95,81.94,-98.08,79.68,-131.21,182.71,128.04,180.45,94.91,178.19,61.78,175.93,28.65,173.68,-4.48,171.42,-37.61,169.16,-70.74,166.9,-103.87,164.64,-137,267.67,122.25,265.41,89.12,263.15,55.99,260.89,22.86,258.63,-10.27,256.37,-43.4,254.12,-76.53,251.86,-109.66,249.6,-142.8,352.62,116.46,350.36,83.33,348.11,50.2,345.85,17.07,343.59,-16.06,341.33,-49.19,339.07,-82.33,336.81,-115.46,334.55,-148.59,437.58,110.67,435.32,77.54,433.06,44.41,430.8,11.28,428.55,-21.86,426.29,-54.99,424.03,-88.12,421.77,-121.25,419.51,-154.38,522.54,104.88,520.28,71.75,518.02,38.61,515.76,5.48,513.5,-27.65,511.24,-60.78,508.98,-93.91,506.73,-127.04,504.47,-160.17]},{"type":"surface","name":"B_CLOTHES.25","parent":"B_CLOTHES.32","segmentX":8,"segmentY":8,"vertices":[-205.93,-75.6,-122.82,-96.93,-40.47,-118.1,34.91,-137.78,107.9,-156.96,180.89,-176.14,253.87,-195.31,326.86,-214.49,399.85,-233.67,-192.95,-39.29,-111.05,-59.36,-29.81,-79.28,45.2,-98.61,118.19,-117.79,191.18,-136.96,264.17,-156.14,337.16,-175.32,410.14,-194.49,-180.17,-2.76,-99.4,-21.65,-19.21,-40.42,55.49,-59.44,128.48,-78.61,201.47,-97.79,274.46,-116.97,347.45,-136.14,420.44,-155.32,-169.07,35.82,-88.76,17.29,-8.98,-1.24,65.78,-20.26,138.77,-39.44,211.76,-58.62,284.75,-77.79,357.74,-96.97,430.73,-116.15,-156.92,75.86,-77.44,56.95,1.55,38.02,76.07,18.91,149.06,-0.27,222.05,-19.44,295.04,-38.62,368.03,-57.8,441.02,-76.97,-144.77,115.89,-66.12,96.61,12.08,77.29,86.36,58.08,159.35,38.91,232.34,19.73,305.33,0.55,378.32,-18.62,451.31,-37.8,-133,155.1,-55.21,135.76,22.28,116.51,96.36,97.33,166.81,78.8,237.26,60.28,310.74,40.93,385.39,21.24,460.15,1.71,-117.57,194.13,-42.11,174.86,33.21,155.65,106.33,136.52,173.18,118.17,240.02,99.83,313.3,80.64,388.94,61.36,464.78,42.2,-101.73,233.13,-28.74,213.96,44.25,194.78,116.32,175.69,179.59,157.43,242.85,139.16,315.8,120.19,392.23,101.48,468.94,82.8]},{"type":"surface","name":"B_CLOTHES.27","parent":"B_CLOTHES.33","segmentX":8,"segmentY":8,"vertices":[-113.21,-50.76,-82.71,-62.11,-52.22,-73.45,-21.72,-84.79,8.78,-96.13,39.28,-107.47,69.78,-118.82,100.27,-130.16,130.77,-141.5,-104.02,-26.04,-73.52,-37.38,-43.02,-48.72,-12.52,-60.06,17.98,-71.41,48.47,-82.75,78.97,-94.09,109.47,-105.43,139.97,-116.77,-94.82,-1.31,-64.32,-12.66,-33.83,-24,-3.33,-35.34,27.17,-46.68,57.67,-58.02,88.17,-69.37,118.66,-80.71,149.16,-92.05,-85.63,23.41,-55.13,12.07,-24.63,0.73,5.87,-10.62,36.37,-21.96,66.86,-33.3,97.36,-44.64,127.86,-55.98,158.36,-67.33,-76.43,48.14,-45.93,36.79,-15.44,25.45,15.06,14.11,45.56,2.77,76.06,-8.57,106.56,-19.92,137.05,-31.26,167.55,-42.6,-67.24,72.86,-36.74,61.52,-6.24,50.18,24.26,38.83,54.76,27.49,85.25,16.15,115.75,4.81,146.25,-6.53,176.75,-17.88,-58.04,97.58,-27.54,86.24,2.95,74.9,33.45,63.56,63.95,52.22,94.45,40.87,124.95,29.53,155.44,18.19,185.94,6.85,-48.85,122.31,-18.35,110.97,12.15,99.62,42.65,88.28,73.15,76.94,103.64,65.6,134.14,54.26,164.64,42.91,195.14,31.57,-39.65,147.03,-9.15,135.69,21.34,124.35,51.84,113.01,82.34,101.67,112.84,90.32,143.34,78.98,173.83,67.64,204.33,56.3]},{"type":"surface","name":"B_HOHO.01","parent":"B_FACE.01","segmentX":8,"segmentY":8,"vertices":[-122.66,2.8,-108.58,2.8,-94.5,2.8,-80.42,2.8,-66.35,2.8,-52.27,2.8,-38.19,2.8,-24.11,2.8,-10.03,2.8,-122.66,10.93,-108.58,10.93,-94.5,10.93,-80.42,10.93,-66.35,10.93,-52.27,10.93,-38.19,10.93,-24.11,10.93,-10.03,10.93,-122.66,19.05,-108.58,19.05,-94.5,19.05,-80.42,19.05,-66.35,19.05,-52.27,19.05,-38.19,19.05,-24.11,19.05,-10.03,19.05,-122.66,27.18,-108.58,27.18,-94.5,27.18,-80.42,27.18,-66.35,27.18,-52.27,27.18,-38.19,27.18,-24.11,27.18,-10.03,27.18,-122.66,35.3,-108.58,35.3,-94.5,35.3,-80.42,35.3,-66.35,35.3,-52.27,35.3,-38.19,35.3,-24.11,35.3,-10.03,35.3,-122.66,43.43,-108.58,43.43,-94.5,43.43,-80.42,43.43,-66.35,43.43,-52.27,43.43,-38.19,43.43,-24.11,43.43,-10.03,43.43,-122.66,51.56,-108.58,51.56,-94.5,51.56,-80.42,51.56,-66.35,51.56,-52.27,51.56,-38.19,51.56,-24.11,51.56,-10.03,51.56,-122.66,59.68,-108.58,59.68,-94.5,59.68,-80.42,59.68,-66.35,59.68,-52.27,59.68,-38.19,59.68,-24.11,59.68,-10.03,59.68,-122.66,67.81,-108.58,67.81,-94.5,67.81,-80.42,67.81,-66.35,67.81,-52.27,67.81,-38.19,67.81,-24.11,67.81,-10.03,67.81]},{"type":"surface","name":"B_HOHO.02","parent":"B_FACE.01","segmentX":8,"segmentY":8,"vertices":[18.1,-8.23,30.17,-8.23,42.24,-8.23,54.3,-8.23,66.37,-8.23,78.44,-8.23,90.51,-8.23,102.58,-8.23,114.65,-8.23,18.1,1.51,30.17,1.51,42.24,1.51,54.3,1.51,66.37,1.51,78.44,1.51,90.51,1.51,102.58,1.51,114.65,1.51,18.1,11.24,30.17,11.24,42.24,11.24,54.3,11.24,66.37,11.24,78.44,11.24,90.51,11.24,102.58,11.24,114.65,11.24,18.1,20.98,30.17,20.98,42.24,20.98,54.3,20.98,66.37,20.98,78.44,20.98,90.51,20.98,102.58,20.98,114.65,20.98,18.1,30.71,30.17,30.71,42.24,30.71,54.3,30.71,66.37,30.71,78.44,30.71,90.51,30.71,102.58,30.71,114.65,30.71,18.1,40.44,30.17,40.44,42.24,40.44,54.3,40.44,66.37,40.44,78.44,40.44,90.51,40.44,102.58,40.44,114.65,40.44,18.1,50.18,30.17,50.18,42.24,50.18,54.3,50.18,66.37,50.18,78.44,50.18,90.51,50.18,102.58,50.18,114.65,50.18,18.1,59.91,30.17,59.91,42.24,59.91,54.3,59.91,66.37,59.91,78.44,59.91,90.51,59.91,102.58,59.91,114.65,59.91,18.1,69.64,30.17,69.64,42.24,69.64,54.3,69.64,66.37,69.64,78.44,69.64,90.51,69.64,102.58,69.64,114.65,69.64]},{"type":"surface","name":"B_EYE_BALL.04","parent":"B_EYE_BALL.05","segmentX":8,"segmentY":8,"vertices":[-184.46,-187.34,-138.63,-187.34,-92.81,-187.34,-46.98,-187.34,-1.15,-187.34,44.67,-187.34,90.5,-187.34,136.33,-187.34,182.15,-187.34,-184.46,-140.36,-138.63,-140.36,-92.81,-140.36,-46.98,-140.36,-1.15,-140.36,44.67,-140.36,90.5,-140.36,136.33,-140.36,182.15,-140.36,-184.46,-93.37,-138.63,-93.37,-92.81,-93.37,-46.98,-93.37,-1.15,-93.37,44.67,-93.37,90.5,-93.37,136.33,-93.37,182.15,-93.37,-184.46,-46.39,-138.63,-46.39,-92.81,-46.39,-46.98,-46.39,-1.15,-46.39,44.67,-46.39,90.5,-46.39,136.33,-46.39,182.15,-46.39,-184.46,0.59,-138.63,0.59,-92.81,0.59,-46.98,0.59,-1.15,0.59,44.67,0.59,90.5,0.59,136.33,0.59,182.15,0.59,-184.46,47.58,-138.63,47.58,-92.81,47.58,-46.98,47.58,-1.15,47.58,44.67,47.58,90.5,47.58,136.33,47.58,182.15,47.58,-184.46,94.57,-138.63,94.57,-92.81,94.57,-46.98,94.57,-1.15,94.57,44.67,94.57,90.5,94.57,136.33,94.57,182.15,94.57,-184.46,141.55,-138.63,141.55,-92.81,141.55,-46.98,141.55,-1.15,141.55,44.67,141.55,90.5,141.55,136.33,141.55,182.15,141.55,-184.46,188.53,-138.63,188.53,-92.81,188.53,-46.98,188.53,-1.15,188.53,44.67,188.53,90.5,188.53,136.33,188.53,182.15,188.53]},{"type":"surface","name":"B_EYE_BALL.06","parent":"B_EYE_BALL.10","segmentX":8,"segmentY":8,"vertices":[-179.86,-180.79,-135.01,-180.79,-90.16,-180.79,-45.31,-180.79,-0.46,-180.79,44.39,-180.79,89.25,-180.79,134.1,-180.79,178.95,-180.79,-179.86,-134.65,-135.01,-134.65,-90.16,-134.65,-45.31,-134.65,-0.46,-134.65,44.39,-134.65,89.25,-134.65,134.1,-134.65,178.95,-134.65,-179.86,-88.52,-135.01,-88.52,-90.16,-88.52,-45.31,-88.52,-0.46,-88.52,44.39,-88.52,89.25,-88.52,134.1,-88.52,178.95,-88.52,-179.86,-42.38,-135.01,-42.38,-90.16,-42.38,-45.31,-42.38,-0.46,-42.38,44.39,-42.38,89.25,-42.38,134.1,-42.38,178.95,-42.38,-179.86,3.76,-135.01,3.76,-90.16,3.76,-45.31,3.76,-0.46,3.76,44.39,3.76,89.25,3.76,134.1,3.76,178.95,3.76,-179.86,49.89,-135.01,49.89,-90.16,49.89,-45.31,49.89,-0.46,49.89,44.39,49.89,89.25,49.89,134.1,49.89,178.95,49.89,-179.86,96.03,-135.01,96.03,-90.16,96.03,-45.31,96.03,-0.46,96.03,44.39,96.03,89.25,96.03,134.1,96.03,178.95,96.03,-179.86,142.17,-135.01,142.17,-90.16,142.17,-45.31,142.17,-0.46,142.17,44.39,142.17,89.25,142.17,134.1,142.17,178.95,142.17,-179.86,188.3,-135.01,188.3,-90.16,188.3,-45.31,188.3,-0.46,188.3,44.39,188.3,89.25,188.3,134.1,188.3,178.95,188.3]},{"type":"surface","name":"B_BROW.01","parent":"B_BROW.03","segmentX":8,"segmentY":8,"vertices":[-147.21,-84.12,-111.03,-84.12,-74.85,-84.12,-38.67,-84.12,-2.5,-84.12,33.68,-84.12,69.86,-84.12,106.04,-84.12,142.21,-84.12,-147.21,-62.46,-111.03,-62.46,-74.85,-62.46,-38.67,-62.46,-2.5,-62.46,33.68,-62.46,69.86,-62.46,106.04,-62.46,142.21,-62.46,-147.21,-40.8,-111.03,-40.8,-74.85,-40.8,-38.67,-40.8,-2.5,-40.8,33.68,-40.8,69.86,-40.8,106.04,-40.8,142.21,-40.8,-147.21,-19.14,-111.03,-19.14,-74.85,-19.14,-38.67,-19.14,-2.5,-19.14,33.68,-19.14,69.86,-19.14,106.04,-19.14,142.21,-19.14,-147.21,2.53,-111.03,2.53,-74.85,2.53,-38.67,2.53,-2.5,2.53,33.68,2.53,69.86,2.53,106.04,2.53,142.21,2.53,-147.21,24.19,-111.03,24.19,-74.85,24.19,-38.67,24.19,-2.5,24.19,33.68,24.19,69.86,24.19,106.04,24.19,142.21,24.19,-147.21,45.85,-111.03,45.85,-74.85,45.85,-38.67,45.85,-2.5,45.85,33.68,45.85,69.86,45.85,106.04,45.85,142.21,45.85,-147.21,67.51,-111.03,67.51,-74.85,67.51,-38.67,67.51,-2.5,67.51,33.68,67.51,69.86,67.51,106.04,67.51,142.21,67.51,-147.21,89.17,-111.03,89.17,-74.85,89.17,-38.67,89.17,-2.5,89.17,33.68,89.17,69.86,89.17,106.04,89.17,142.21,89.17]},{"type":"surface","name":"B_BROW.02","parent":"B_BROW.04","segmentX":8,"segmentY":8,"vertices":[-150.24,-90.12,-112.25,-90.11,-74.27,-90.1,-36.29,-90.1,1.68,-90.1,39.66,-90.09,77.64,-90.07,115.62,-90.04,153.59,-90.02,-150.24,-69.26,-112.26,-69.26,-74.28,-69.26,-36.3,-69.26,1.68,-69.28,39.66,-69.29,77.64,-69.29,115.62,-69.28,153.6,-69.26,-150.25,-48.45,-112.26,-48.44,-74.28,-48.45,-36.3,-48.47,1.68,-48.5,39.66,-48.51,77.64,-48.51,115.63,-48.51,153.61,-48.48,-150.25,-27.68,-112.26,-27.66,-74.28,-27.68,-36.3,-27.71,1.68,-27.76,39.66,-27.76,77.65,-27.76,115.63,-27.74,153.61,-27.69,-150.25,-6.93,-112.26,-6.92,-74.28,-6.93,-36.3,-6.98,1.68,-7.05,39.66,-7.04,77.64,-7.02,115.63,-6.99,153.62,-6.93,-150.25,13.83,-112.27,13.84,-74.28,13.83,-36.3,13.79,1.68,13.74,39.66,13.73,77.64,13.73,115.62,13.73,153.61,13.78,-150.25,34.55,-112.26,34.56,-74.28,34.55,-36.3,34.52,1.68,34.49,39.66,34.49,77.64,34.48,115.62,34.48,153.61,34.52,-150.24,55.2,-112.26,55.22,-74.27,55.22,-36.3,55.21,1.68,55.2,39.66,55.21,77.64,55.21,115.62,55.23,153.6,55.27,-150.22,75.75,-112.24,75.78,-74.26,75.81,-36.29,75.84,1.68,75.87,39.66,75.88,77.64,75.91,115.61,75.94,153.59,75.98]},{"type":"surface","name":"B_CLOTHES.03","parent":"B_CLOTHES.04","segmentX":8,"segmentY":8,"vertices":[608.76,150.34,524.79,167.12,440.82,183.9,356.85,200.67,272.89,217.45,188.92,234.23,104.95,251.01,20.98,267.79,-62.98,284.57,598.31,98.05,514.34,114.83,430.37,131.61,346.4,148.38,262.44,165.16,178.47,181.94,94.5,198.72,10.53,215.5,-73.43,232.28,587.86,45.76,503.89,62.54,419.92,79.32,335.96,96.09,251.99,112.87,168.02,129.65,84.05,146.43,0.09,163.21,-83.88,179.99,577.41,-6.53,493.44,10.25,409.47,27.03,325.51,43.8,241.54,60.58,157.57,77.36,73.6,94.14,-10.36,110.92,-94.33,127.7,566.96,-58.82,482.99,-42.04,399.03,-25.26,315.06,-8.49,231.09,8.29,147.12,25.07,63.16,41.85,-20.81,58.63,-104.78,75.41,556.51,-111.11,472.55,-94.33,388.58,-77.55,304.61,-60.78,220.64,-44,136.67,-27.22,52.71,-10.44,-31.26,6.34,-115.23,23.12,546.06,-163.4,462.1,-146.62,378.13,-129.84,294.16,-113.07,210.19,-96.29,126.23,-79.51,42.26,-62.73,-41.71,-45.95,-125.68,-29.17,535.62,-215.69,451.65,-198.91,367.68,-182.13,283.71,-165.36,199.75,-148.58,115.78,-131.8,31.81,-115.02,-52.16,-98.24,-136.13,-81.46,525.17,-267.98,441.2,-251.2,357.23,-234.43,273.26,-217.65,189.3,-200.87,105.33,-184.09,21.36,-167.31,-62.61,-150.53,-146.57,-133.75]},{"type":"surface","name":"B_CLOTHES.05","parent":"B_CLOTHES.06","segmentX":8,"segmentY":8,"vertices":[-148.34,-178.52,-110.17,-178.52,-71.99,-178.52,-34.21,-178.28,-0.23,-175.75,33.75,-173.21,72.53,-173.58,114.64,-175.95,157.07,-178.52,-148.34,-133.52,-110.17,-133.52,-71.99,-133.52,-33.96,-133.4,1.9,-132.03,37.75,-130.67,76.21,-130.85,116.54,-132.08,157.07,-133.52,-148.34,-88.53,-110.17,-88.53,-71.99,-88.53,-33.75,-88.5,3.86,-88.23,41.47,-87.95,79.64,-87.95,118.32,-88.14,157.07,-88.53,-148.34,-43.53,-110.17,-43.53,-71.99,-43.53,-33.81,-43.53,4.36,-43.53,42.54,-43.53,80.72,-43.53,118.89,-43.53,157.07,-43.53,-148.34,1.46,-110.17,1.46,-71.99,1.46,-33.81,1.46,4.36,1.46,42.54,1.46,80.72,1.46,118.89,1.46,157.07,1.46,-148.34,46.46,-110.17,46.46,-71.99,46.46,-33.81,46.46,4.36,46.46,42.54,46.46,80.72,46.46,118.89,46.46,157.07,46.46,-148.34,91.45,-110.17,91.45,-71.99,91.45,-33.81,91.45,4.36,91.45,42.54,91.45,80.72,91.45,118.89,91.45,157.07,91.45,-148.34,136.45,-110.17,136.45,-71.99,136.45,-33.81,136.45,4.36,136.45,42.54,136.45,80.72,136.45,118.89,136.45,157.07,136.45,-148.34,181.44,-110.17,181.44,-71.99,181.44,-33.81,181.44,4.36,181.44,42.54,181.44,80.72,181.44,118.89,181.44,157.07,181.44]},{"type":"surface","name":"B_CLOTHES.08","parent":"B_HAND.08","segmentX":8,"segmentY":8,"vertices":[219.88,107.15,187.5,111.81,155.13,116.48,122.76,121.14,90.39,125.81,58.02,130.47,25.65,135.14,-6.72,139.8,-39.09,144.47,215.47,76.58,183.1,81.25,150.73,85.91,118.36,90.58,85.99,95.24,53.61,99.91,21.24,104.57,-11.13,109.24,-43.5,113.9,211.07,46.02,178.7,50.68,146.32,55.35,113.95,60.01,81.58,64.68,49.21,69.34,16.84,74.01,-15.53,78.67,-47.9,83.34,206.66,15.45,174.29,20.12,141.92,24.78,109.55,29.45,77.18,34.11,44.81,38.78,12.43,43.44,-19.94,48.1,-52.31,52.77,202.26,-15.11,169.89,-10.45,137.51,-5.79,105.14,-1.12,72.77,3.54,40.4,8.21,8.03,12.87,-24.34,17.54,-56.71,22.2,197.85,-45.68,165.48,-41.02,133.11,-36.35,100.74,-31.69,68.37,-27.02,36,-22.36,3.62,-17.69,-28.75,-13.03,-61.12,-8.36,193.45,-76.25,161.08,-71.58,128.71,-66.92,96.33,-62.25,63.96,-57.59,31.59,-52.92,-0.78,-48.26,-33.15,-43.59,-65.52,-38.93,189.04,-106.81,156.67,-102.15,124.3,-97.48,91.93,-92.82,59.56,-88.15,27.19,-83.49,-5.18,-78.82,-37.56,-74.16,-69.93,-69.5,184.64,-137.38,152.27,-132.72,119.9,-128.05,87.52,-123.39,55.15,-118.72,22.78,-114.06,-9.59,-109.39,-41.96,-104.73,-74.33,-100.06]},{"type":"surface","name":"B_HAND.01","parent":"B_HAND.11","segmentX":8,"segmentY":8,"vertices":[-178.78,-156.52,-134.27,-155.54,-89.77,-154.56,-45.27,-153.59,-0.77,-152.61,43.73,-151.64,88.24,-150.66,132.74,-149.69,177.24,-148.71,-179.22,-116.23,-134.72,-115.26,-90.22,-114.28,-45.71,-113.31,-1.21,-112.33,43.29,-111.36,87.79,-110.38,132.29,-109.41,176.79,-108.43,-179.67,-75.95,-135.16,-74.98,-90.66,-74,-46.16,-73.03,-1.66,-72.05,42.84,-71.08,87.35,-70.1,131.85,-69.13,176.35,-68.15,-180.11,-35.67,-135.61,-34.7,-91.11,-33.72,-46.61,-32.75,-2.1,-31.77,42.4,-30.8,86.9,-29.82,131.4,-28.85,175.9,-27.87,-180.56,4.61,-136.05,5.58,-91.55,6.56,-47.05,7.53,-2.55,8.51,41.95,9.48,86.46,10.46,130.96,11.43,175.46,12.41,-181,44.89,-136.5,45.87,-92,46.84,-47.5,47.82,-2.99,48.79,41.51,49.77,86.01,50.74,130.51,51.72,175.01,52.69,-181.45,85.17,-136.94,86.15,-92.44,87.12,-47.94,88.1,-3.44,89.07,41.06,90.05,85.57,91.02,130.07,92,174.57,92.97,-181.89,125.45,-137.39,126.43,-92.89,127.4,-48.39,128.38,-3.88,129.35,40.62,130.33,85.12,131.3,129.62,132.28,174.12,133.25,-182.34,165.73,-137.83,166.71,-93.33,167.69,-48.83,168.66,-4.33,169.64,40.17,170.61,84.68,171.59,129.18,172.56,173.68,173.54]},{"type":"surface","name":"B_HAND.02","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-124.77,-117.48,-106.66,-117.48,-88.55,-117.48,-70.44,-117.48,-52.32,-117.48,-34.21,-117.48,-16.1,-117.48,2.01,-117.48,20.12,-117.48,-124.77,-101.04,-106.66,-101.04,-88.55,-101.04,-70.44,-101.04,-52.32,-101.04,-34.21,-101.04,-16.1,-101.04,2.01,-101.04,20.12,-101.04,-124.77,-84.59,-106.66,-84.59,-88.55,-84.59,-70.44,-84.59,-52.32,-84.59,-34.21,-84.59,-16.1,-84.59,2.01,-84.59,20.12,-84.59,-124.77,-68.14,-106.66,-68.14,-88.55,-68.14,-70.44,-68.14,-52.32,-68.14,-34.21,-68.14,-16.1,-68.14,2.01,-68.14,20.12,-68.14,-124.77,-51.69,-106.66,-51.69,-88.55,-51.69,-70.44,-51.69,-52.32,-51.69,-34.21,-51.69,-16.1,-51.69,2.01,-51.69,20.12,-51.69,-124.77,-35.24,-106.66,-35.24,-88.55,-35.24,-70.44,-35.24,-52.32,-35.24,-34.21,-35.24,-16.1,-35.24,2.01,-35.24,20.12,-35.24,-124.77,-18.79,-106.66,-18.79,-88.55,-18.79,-70.44,-18.79,-52.32,-18.79,-34.21,-18.79,-16.1,-18.79,2.01,-18.79,20.12,-18.79,-124.77,-2.34,-106.66,-2.34,-88.55,-2.34,-70.44,-2.34,-52.32,-2.34,-34.21,-2.34,-16.1,-2.34,2.01,-2.34,20.12,-2.34,-124.77,14.11,-106.66,14.11,-88.55,14.11,-70.44,14.11,-52.32,14.11,-34.21,14.11,-16.1,14.11,2.01,14.11,20.12,14.11]},{"type":"surface","name":"B_HAND.03","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-133.8,-118.29,-115.55,-118.29,-97.3,-118.29,-79.05,-118.29,-60.8,-118.29,-42.55,-118.29,-24.3,-118.29,-6.05,-118.29,12.2,-118.29,-133.8,-97.82,-115.55,-97.82,-97.3,-97.82,-79.05,-97.82,-60.8,-97.82,-42.55,-97.82,-24.3,-97.82,-6.05,-97.82,12.2,-97.82,-133.8,-77.35,-115.55,-77.35,-97.3,-77.35,-79.05,-77.35,-60.8,-77.35,-42.55,-77.35,-24.3,-77.35,-6.05,-77.35,12.2,-77.35,-133.8,-56.87,-115.55,-56.87,-97.3,-56.87,-79.05,-56.87,-60.8,-56.87,-42.55,-56.87,-24.3,-56.87,-6.05,-56.87,12.2,-56.87,-133.8,-36.4,-115.55,-36.4,-97.3,-36.4,-79.05,-36.4,-60.8,-36.4,-42.55,-36.4,-24.3,-36.4,-6.05,-36.4,12.2,-36.4,-133.8,-15.93,-115.55,-15.93,-97.3,-15.93,-79.05,-15.93,-60.8,-15.93,-42.55,-15.93,-24.3,-15.93,-6.05,-15.93,12.2,-15.93,-133.8,4.54,-115.55,4.54,-97.3,4.54,-79.05,4.54,-60.8,4.54,-42.55,4.54,-24.3,4.54,-6.05,4.54,12.2,4.54,-133.8,25.01,-115.55,25.01,-97.3,25.01,-79.05,25.01,-60.8,25.01,-42.55,25.01,-24.3,25.01,-6.05,25.01,12.2,25.01,-133.8,45.49,-115.55,45.49,-97.3,45.49,-79.05,45.49,-60.8,45.49,-42.55,45.49,-24.3,45.49,-6.05,45.49,12.2,45.49]},{"type":"surface","name":"B_HAND.04","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-133.48,-101.77,-112.79,-101.77,-92.1,-101.77,-71.42,-101.77,-50.73,-101.77,-30.05,-101.77,-9.36,-101.77,11.32,-101.77,32.01,-101.77,-133.48,-81.87,-112.79,-81.87,-92.1,-81.87,-71.42,-81.87,-50.73,-81.87,-30.05,-81.87,-9.36,-81.87,11.32,-81.87,32.01,-81.87,-133.48,-61.96,-112.79,-61.96,-92.1,-61.96,-71.42,-61.96,-50.73,-61.96,-30.05,-61.96,-9.36,-61.96,11.32,-61.96,32.01,-61.96,-133.48,-42.05,-112.79,-42.05,-92.1,-42.05,-71.42,-42.05,-50.73,-42.05,-30.05,-42.05,-9.36,-42.05,11.32,-42.05,32.01,-42.05,-133.48,-22.14,-112.79,-22.14,-92.1,-22.14,-71.42,-22.14,-50.73,-22.14,-30.05,-22.14,-9.36,-22.14,11.32,-22.14,32.01,-22.14,-133.48,-2.24,-112.79,-2.24,-92.1,-2.24,-71.42,-2.24,-50.73,-2.24,-30.05,-2.24,-9.36,-2.24,11.32,-2.24,32.01,-2.24,-133.48,17.67,-112.79,17.67,-92.1,17.67,-71.42,17.67,-50.73,17.67,-30.05,17.67,-9.36,17.67,11.32,17.67,32.01,17.67,-133.48,37.58,-112.79,37.58,-92.1,37.58,-71.42,37.58,-50.73,37.58,-30.05,37.58,-9.36,37.58,11.32,37.58,32.01,37.58,-133.48,57.48,-112.79,57.48,-92.1,57.48,-71.42,57.48,-50.73,57.48,-30.05,57.48,-9.36,57.48,11.32,57.48,32.01,57.48]},{"type":"surface","name":"B_HAND.05","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-121.2,-64.73,-100.75,-64.73,-80.31,-64.73,-59.87,-64.73,-39.43,-64.73,-18.98,-64.73,1.46,-64.73,21.9,-64.73,42.35,-64.73,-121.2,-47.73,-100.75,-47.73,-80.31,-47.73,-59.87,-47.73,-39.43,-47.73,-18.98,-47.73,1.46,-47.73,21.9,-47.73,42.35,-47.73,-121.2,-30.74,-100.75,-30.74,-80.31,-30.74,-59.87,-30.74,-39.43,-30.74,-18.98,-30.74,1.46,-30.74,21.9,-30.74,42.35,-30.74,-121.2,-13.74,-100.75,-13.74,-80.31,-13.74,-59.87,-13.74,-39.43,-13.74,-18.98,-13.74,1.46,-13.74,21.9,-13.74,42.35,-13.74,-121.2,3.25,-100.75,3.25,-80.31,3.25,-59.87,3.25,-39.43,3.25,-18.98,3.25,1.46,3.25,21.9,3.25,42.35,3.25,-121.2,20.25,-100.75,20.25,-80.31,20.25,-59.87,20.25,-39.43,20.25,-18.98,20.25,1.46,20.25,21.9,20.25,42.35,20.25,-121.2,37.24,-100.75,37.24,-80.31,37.24,-59.87,37.24,-39.43,37.24,-18.98,37.24,1.46,37.24,21.9,37.24,42.35,37.24,-121.2,54.24,-100.75,54.24,-80.31,54.24,-59.87,54.24,-39.43,54.24,-18.98,54.24,1.46,54.24,21.9,54.24,42.35,54.24,-121.2,71.23,-100.75,71.23,-80.31,71.23,-59.87,71.23,-39.43,71.23,-18.98,71.23,1.46,71.23,21.9,71.23,42.35,71.23]},{"type":"surface","name":"B_HAND.06","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-84.24,-22.62,-66.23,-22.62,-48.22,-22.62,-30.21,-22.62,-12.21,-22.62,5.8,-22.62,23.81,-22.62,41.82,-22.62,59.83,-22.62,-84.24,-9.22,-66.23,-9.22,-48.22,-9.22,-30.21,-9.22,-12.21,-9.22,5.8,-9.22,23.81,-9.22,41.82,-9.22,59.83,-9.22,-84.24,4.18,-66.23,4.18,-48.22,4.18,-30.21,4.18,-12.21,4.18,5.8,4.18,23.81,4.18,41.82,4.18,59.83,4.18,-84.24,17.57,-66.23,17.57,-48.22,17.57,-30.21,17.57,-12.21,17.57,5.8,17.57,23.81,17.57,41.82,17.57,59.83,17.57,-84.24,30.97,-66.23,30.97,-48.22,30.97,-30.21,30.97,-12.21,30.97,5.8,30.97,23.81,30.97,41.82,30.97,59.83,30.97,-84.24,44.37,-66.23,44.37,-48.22,44.37,-30.21,44.37,-12.21,44.37,5.8,44.37,23.81,44.37,41.82,44.37,59.83,44.37,-84.24,57.77,-66.23,57.77,-48.22,57.77,-30.21,57.77,-12.21,57.77,5.8,57.77,23.81,57.77,41.82,57.77,59.83,57.77,-84.24,71.17,-66.23,71.17,-48.22,71.17,-30.21,71.17,-12.21,71.17,5.8,71.17,23.81,71.17,41.82,71.17,59.83,71.17,-84.24,84.57,-66.23,84.57,-48.22,84.57,-30.21,84.57,-12.21,84.57,5.8,84.57,23.81,84.57,41.82,84.57,59.83,84.57]},{"type":"surface","name":"B_HAND.07","parent":"B_HAND.01","segmentX":8,"segmentY":8,"vertices":[-66.27,-155.93,-39.15,-155.93,-12.04,-155.93,15.08,-155.93,42.19,-155.93,69.31,-155.93,96.42,-155.93,123.54,-155.93,150.65,-155.93,-66.27,-126.29,-39.15,-126.29,-12.04,-126.29,15.08,-126.29,42.19,-126.29,69.31,-126.29,96.42,-126.29,123.54,-126.29,150.65,-126.29,-66.27,-96.65,-39.15,-96.65,-12.04,-96.65,15.08,-96.65,42.19,-96.65,69.31,-96.65,96.42,-96.65,123.54,-96.65,150.65,-96.65,-66.27,-67,-39.15,-67,-12.04,-67,15.08,-67,42.19,-67,69.31,-67,96.42,-67,123.54,-67,150.65,-67,-66.27,-37.36,-39.15,-37.36,-12.04,-37.36,15.08,-37.36,42.19,-37.36,69.31,-37.36,96.42,-37.36,123.54,-37.36,150.65,-37.36,-66.27,-7.72,-39.15,-7.72,-12.04,-7.72,15.08,-7.72,42.19,-7.72,69.31,-7.72,96.42,-7.72,123.54,-7.72,150.65,-7.72,-66.27,21.92,-39.15,21.92,-12.04,21.92,15.08,21.92,42.19,21.92,69.31,21.92,96.42,21.92,123.54,21.92,150.65,21.92,-66.27,51.56,-39.15,51.56,-12.04,51.56,15.08,51.56,42.19,51.56,69.31,51.56,96.42,51.56,123.54,51.56,150.65,51.56,-66.27,81.2,-39.15,81.2,-12.04,81.2,15.08,81.2,42.19,81.2,69.31,81.2,96.42,81.2,123.54,81.2,150.65,81.2]},{"type":"surface","name":"B_CLOTHES.30","parent":"B_CLOTHES.29","segmentX":8,"segmentY":8,"vertices":[-176.5,-187.2,-131.95,-187.2,-87.39,-187.2,-42.83,-187.21,1.72,-187.21,46.28,-187.21,90.84,-187.21,135.39,-187.21,179.95,-187.22,-176.49,-140.4,-131.93,-140.4,-87.38,-140.4,-42.82,-140.4,1.74,-140.41,46.29,-140.41,90.85,-140.41,135.41,-140.41,179.97,-140.41,-176.47,-93.6,-131.92,-93.6,-87.36,-93.6,-42.8,-93.6,1.75,-93.61,46.31,-93.61,90.87,-93.61,135.42,-93.61,179.98,-93.61,-176.46,-46.8,-131.9,-46.8,-87.35,-46.8,-42.79,-46.8,1.77,-46.8,46.32,-46.81,90.88,-46.81,135.44,-46.81,179.99,-46.81,-176.45,0.01,-131.89,0,-87.33,0,-42.78,0,1.78,0,46.34,0,90.89,-0.01,135.45,-0.01,180.01,-0.01,-176.43,46.81,-131.88,46.8,-87.32,46.8,-42.76,46.8,1.79,46.8,46.35,46.8,90.91,46.79,135.47,46.79,180.02,46.79,-176.42,93.61,-131.86,93.61,-87.3,93.6,-42.75,93.6,1.81,93.6,46.37,93.6,90.92,93.6,135.48,93.59,180.04,93.59,-176.4,140.41,-131.85,140.41,-87.29,140.41,-42.73,140.4,1.82,140.4,46.38,140.4,90.94,140.4,135.49,140.4,180.05,140.39,-176.39,187.21,-131.83,187.21,-87.28,187.21,-42.72,187.2,1.84,187.2,46.39,187.2,90.95,187.2,135.51,187.2,180.07,187.2]},{"type":"surface","name":"B_CLOTHES.26","parent":"B_CLOTHES.25","segmentX":8,"segmentY":8,"vertices":[-184.95,-174.11,-139.36,-174.11,-93.77,-174.11,-48.19,-174.11,-2.6,-174.1,42.98,-174.1,88.57,-174.1,134.16,-174.1,179.74,-174.1,-184.95,-130.6,-139.36,-130.59,-93.77,-130.59,-48.19,-130.59,-2.6,-130.59,42.98,-130.59,88.57,-130.59,134.16,-130.59,179.74,-130.59,-184.95,-87.08,-139.36,-87.08,-93.77,-87.08,-48.19,-87.08,-2.6,-87.08,42.98,-87.08,88.57,-87.08,134.16,-87.08,179.74,-87.08,-184.95,-43.57,-139.36,-43.57,-93.77,-43.57,-48.19,-43.57,-2.6,-43.57,42.98,-43.57,88.57,-43.57,134.16,-43.57,179.74,-43.57,-184.95,-0.06,-139.36,-0.06,-93.77,-0.06,-48.19,-0.06,-2.6,-0.06,42.98,-0.06,88.57,-0.06,134.16,-0.06,179.74,-0.06,-184.95,43.45,-139.36,43.45,-93.77,43.45,-48.19,43.45,-2.6,43.45,42.98,43.45,88.57,43.46,134.16,43.46,179.74,43.46,-184.95,86.96,-139.36,86.96,-93.77,86.96,-48.19,86.97,-2.6,86.97,42.98,86.97,88.57,86.97,134.16,86.97,179.74,86.97,-184.95,130.47,-139.36,130.48,-93.77,130.48,-48.19,130.48,-2.6,130.48,42.98,130.48,88.57,130.48,134.16,130.48,179.74,130.48,-184.95,173.99,-139.36,173.99,-93.77,173.99,-48.19,173.99,-2.6,173.99,42.98,173.99,88.57,173.99,134.16,173.99,179.74,173.99]},{"type":"surface","name":"B_CLOTHES.28","parent":"B_CLOTHES.27","segmentX":8,"segmentY":8,"vertices":[-182.37,-170.22,-137.16,-170.22,-91.95,-170.22,-46.73,-170.22,-1.52,-170.22,43.69,-170.22,88.9,-170.22,134.11,-170.22,179.32,-170.22,-182.37,-126.09,-137.16,-126.09,-91.95,-126.09,-46.73,-126.09,-1.52,-126.09,43.69,-126.09,88.9,-126.09,134.11,-126.09,179.32,-126.09,-182.37,-81.97,-137.16,-81.97,-91.95,-81.97,-46.73,-81.97,-1.52,-81.97,43.69,-81.97,88.9,-81.97,134.11,-81.97,179.32,-81.97,-182.37,-37.85,-137.16,-37.85,-91.95,-37.85,-46.73,-37.85,-1.52,-37.85,43.69,-37.85,88.9,-37.85,134.11,-37.85,179.32,-37.85,-182.37,6.28,-137.16,6.28,-91.95,6.28,-46.73,6.28,-1.52,6.28,43.69,6.28,88.9,6.28,134.11,6.28,179.32,6.28,-182.37,50.4,-137.16,50.4,-91.95,50.4,-46.73,50.4,-1.52,50.4,43.69,50.4,88.9,50.4,134.11,50.4,179.32,50.4,-182.37,94.52,-137.16,94.52,-91.95,94.52,-46.73,94.52,-1.52,94.52,43.69,94.52,88.9,94.52,134.11,94.52,179.32,94.52,-182.37,138.65,-137.16,138.65,-91.95,138.65,-46.73,138.65,-1.52,138.65,43.69,138.65,88.9,138.65,134.11,138.65,179.32,138.65,-182.37,182.77,-137.16,182.77,-91.95,182.77,-46.73,182.77,-1.52,182.77,43.69,182.77,88.9,182.77,134.11,182.77,179.32,182.77]},{"type":"surface","name":"B_EYE_BALL.03","parent":"B_EYE_BALL.04","segmentX":8,"segmentY":8,"vertices":[-171.52,-176.12,-128.59,-176.12,-85.65,-176.12,-42.72,-176.12,0.21,-176.12,43.15,-176.12,86.08,-176.12,129.02,-176.12,171.95,-176.12,-171.52,-131.86,-128.59,-131.86,-85.65,-131.86,-42.72,-131.86,0.21,-131.86,43.15,-131.86,86.08,-131.86,129.02,-131.86,171.95,-131.86,-171.52,-87.6,-128.59,-87.6,-85.65,-87.6,-42.72,-87.6,0.21,-87.6,43.15,-87.6,86.08,-87.6,129.02,-87.6,171.95,-87.6,-171.52,-43.34,-128.59,-43.34,-85.65,-43.34,-42.72,-43.34,0.21,-43.34,43.15,-43.34,86.08,-43.34,129.02,-43.34,171.95,-43.34,-171.52,0.92,-128.59,0.92,-85.65,0.92,-42.72,0.92,0.21,0.92,43.15,0.92,86.08,0.92,129.02,0.92,171.95,0.92,-171.52,45.18,-128.59,45.18,-85.65,45.18,-42.72,45.18,0.21,45.18,43.15,45.18,86.08,45.18,129.02,45.18,171.95,45.18,-171.52,89.43,-128.59,89.43,-85.65,89.43,-42.72,89.43,0.21,89.43,43.15,89.43,86.08,89.43,129.02,89.43,171.95,89.43,-171.52,133.69,-128.59,133.69,-85.65,133.69,-42.72,133.69,0.21,133.69,43.15,133.69,86.08,133.69,129.02,133.69,171.95,133.69,-171.52,177.95,-128.59,177.95,-85.65,177.95,-42.72,177.95,0.21,177.95,43.15,177.95,86.08,177.95,129.02,177.95,171.95,177.95]},{"type":"surface","name":"B_EYE_BALL.09","parent":"B_EYE_BALL.06","segmentX":8,"segmentY":8,"vertices":[-169.79,-174.28,-128.28,-174.28,-86.77,-174.28,-45.27,-174.28,-3.76,-174.28,37.75,-174.28,79.26,-174.28,120.76,-174.28,162.27,-174.28,-169.79,-131.19,-128.28,-131.19,-86.77,-131.19,-45.27,-131.19,-3.76,-131.19,37.75,-131.19,79.26,-131.19,120.76,-131.19,162.27,-131.19,-169.79,-88.09,-128.28,-88.09,-86.77,-88.09,-45.27,-88.09,-3.76,-88.09,37.75,-88.09,79.26,-88.09,120.76,-88.09,162.27,-88.09,-169.79,-45,-128.28,-45,-86.77,-45,-45.27,-45,-3.76,-45,37.75,-45,79.26,-45,120.76,-45,162.27,-45,-169.79,-1.9,-128.28,-1.9,-86.77,-1.9,-45.27,-1.9,-3.76,-1.9,37.75,-1.9,79.26,-1.9,120.76,-1.9,162.27,-1.9,-169.79,41.19,-128.28,41.19,-86.77,41.19,-45.27,41.19,-3.76,41.19,37.75,41.19,79.26,41.19,120.76,41.19,162.27,41.19,-169.79,84.29,-128.28,84.29,-86.77,84.29,-45.27,84.29,-3.76,84.29,37.75,84.29,79.26,84.29,120.76,84.29,162.27,84.29,-169.79,127.38,-128.28,127.38,-86.77,127.38,-45.27,127.38,-3.76,127.38,37.75,127.38,79.26,127.38,120.76,127.38,162.27,127.38,-169.79,170.48,-128.28,170.48,-86.77,170.48,-45.27,170.48,-3.76,170.48,37.75,170.48,79.26,170.48,120.76,170.48,162.27,170.48]},{"type":"surface","name":"B_CLOTHES.01","parent":"B_CLOTHES.03","segmentX":8,"segmentY":8,"vertices":[-166.78,-158.7,-122.8,-158.7,-78.83,-158.7,-34.85,-158.7,9.13,-158.7,53.11,-158.7,97.09,-158.7,141.06,-158.7,185.04,-158.7,-166.78,-117.26,-122.8,-117.26,-78.83,-117.26,-34.85,-117.26,9.13,-117.26,53.11,-117.26,97.09,-117.26,141.06,-117.26,185.04,-117.26,-166.78,-75.81,-122.8,-75.81,-78.83,-75.81,-34.85,-75.81,9.13,-75.81,53.11,-75.81,97.09,-75.81,141.06,-75.81,185.04,-75.81,-166.78,-34.36,-122.8,-34.36,-78.83,-34.36,-34.85,-34.36,9.13,-34.36,53.11,-34.36,97.09,-34.36,141.06,-34.36,185.04,-34.36,-166.78,7.09,-122.8,7.09,-78.83,7.09,-34.85,7.09,9.13,7.09,53.11,7.09,97.09,7.09,141.06,7.09,185.04,7.09,-166.78,48.53,-122.8,48.53,-78.83,48.53,-34.85,48.53,9.13,48.53,53.11,48.53,97.09,48.53,141.06,48.53,185.04,48.53,-166.78,89.98,-122.8,89.98,-78.83,89.98,-34.85,89.98,9.13,89.98,53.11,89.98,97.09,89.98,141.06,89.98,185.04,89.98,-166.78,131.43,-122.8,131.43,-78.83,131.43,-34.85,131.43,9.13,131.43,53.11,131.43,97.09,131.43,141.06,131.43,185.04,131.43,-166.78,172.88,-122.8,172.88,-78.83,172.88,-34.85,172.88,9.13,172.88,53.11,172.88,97.09,172.88,141.06,172.88,185.04,172.88]},{"type":"surface","name":"B_CLOTHES.02","parent":"B_CLOTHES.08","segmentX":8,"segmentY":8,"vertices":[-159.62,-164.08,-120.3,-164.08,-80.98,-164.08,-41.66,-164.08,-2.34,-164.08,36.98,-164.08,76.3,-164.08,115.62,-164.08,154.94,-164.08,-159.62,-122.43,-120.3,-122.43,-80.98,-122.43,-41.66,-122.43,-2.34,-122.43,36.98,-122.43,76.3,-122.43,115.62,-122.43,154.94,-122.43,-159.62,-80.78,-120.3,-80.78,-80.98,-80.78,-41.66,-80.78,-2.34,-80.78,36.98,-80.78,76.3,-80.78,115.62,-80.78,154.94,-80.78,-159.62,-39.12,-120.3,-39.12,-80.98,-39.12,-41.66,-39.12,-2.34,-39.12,36.98,-39.12,76.3,-39.12,115.62,-39.12,154.94,-39.12,-159.62,2.53,-120.3,2.53,-80.98,2.53,-41.66,2.53,-2.34,2.53,36.98,2.53,76.3,2.53,115.62,2.53,154.94,2.53,-159.62,44.18,-120.3,44.18,-80.98,44.18,-41.66,44.18,-2.34,44.18,36.98,44.18,76.3,44.18,115.62,44.18,154.94,44.18,-159.62,85.84,-120.3,85.84,-80.98,85.84,-41.66,85.84,-2.34,85.84,36.98,85.84,76.3,85.84,115.62,85.84,154.94,85.84,-159.62,127.49,-120.3,127.49,-80.98,127.49,-41.66,127.49,-2.34,127.49,36.98,127.49,76.3,127.49,115.62,127.49,154.94,127.49,-159.62,169.14,-120.3,169.14,-80.98,169.14,-41.66,169.14,-2.34,169.14,36.98,169.14,76.3,169.14,115.62,169.14,154.94,169.14]},{"type":"surface","name":"B_CLOTHES.36","parent":"B_CLOTHES.01","segmentX":8,"segmentY":8,"vertices":[-183.83,-177.55,-137.55,-179.07,-90.34,-179.85,-42.51,-180.14,5.64,-180.18,53.7,-180.22,100.93,-180.54,146.51,-181.41,189.6,-183.1,-183.83,-133.77,-137.55,-135.11,-90.34,-135.8,-42.51,-136.06,5.64,-136.09,53.7,-136.14,100.93,-136.42,146.51,-137.19,189.6,-138.68,-183.83,-89.99,-137.55,-91.16,-90.34,-91.76,-42.51,-91.98,5.64,-92.01,53.7,-92.05,100.93,-92.29,146.51,-92.96,189.6,-94.26,-183.83,-46.21,-137.55,-47.2,-90.34,-47.71,-42.51,-47.9,5.64,-47.93,53.7,-47.96,100.93,-48.17,146.51,-48.74,189.6,-49.84,-183.83,-2.43,-137.55,-3.25,-90.34,-3.67,-42.51,-3.82,5.64,-3.85,53.7,-3.87,100.93,-4.04,146.51,-4.51,189.6,-5.42,-183.83,41.35,-137.55,40.71,-90.34,40.38,-42.51,40.26,5.64,40.24,53.7,40.22,100.93,40.08,146.51,39.71,189.6,39,-183.83,85.13,-137.55,84.66,-90.34,84.42,-42.51,84.33,5.64,84.32,53.7,84.31,100.93,84.21,146.51,83.94,189.6,83.42,-183.83,128.91,-137.55,128.62,-90.34,128.47,-42.51,128.41,5.64,128.4,53.7,128.4,100.93,128.33,146.51,128.17,189.6,127.84,-183.83,172.69,-137.55,172.58,-90.34,172.51,-42.51,172.49,5.64,172.49,53.7,172.48,100.93,172.46,146.51,172.39,189.6,172.26]},{"type":"surface","name":"B_CLOTHES.37","parent":"B_CLOTHES.01","segmentX":8,"segmentY":8,"vertices":[71.1,-54.17,85.1,-53.82,99.09,-53.47,113.09,-53.12,127.08,-52.77,141.08,-52.41,155.07,-52.06,169.06,-51.71,183.06,-51.36,70.9,-30.11,84.89,-29.76,98.89,-29.41,112.88,-29.06,126.87,-28.71,140.87,-28.35,154.86,-28,168.86,-27.65,182.85,-27.3,70.69,-6.05,84.68,-5.7,98.68,-5.35,112.67,-5,126.67,-4.64,140.66,-4.29,154.65,-3.94,168.65,-3.59,182.64,-3.24,70.48,18.01,84.47,18.36,98.47,18.71,112.46,19.07,126.46,19.42,140.45,19.77,154.45,20.12,168.44,20.47,182.44,20.82,70.27,42.07,84.27,42.42,98.26,42.77,112.26,43.13,126.25,43.48,140.24,43.83,154.24,44.18,168.23,44.53,182.23,44.88,70.06,66.13,84.06,66.48,98.05,66.84,112.05,67.19,126.04,67.54,140.04,67.89,154.03,68.24,168.02,68.59,182.02,68.94,69.86,90.19,83.85,90.55,97.85,90.9,111.84,91.25,125.83,91.6,139.83,91.95,153.82,92.3,167.82,92.65,181.81,93,69.65,114.26,83.64,114.61,97.64,114.96,111.63,115.31,125.63,115.66,139.62,116.01,153.61,116.36,167.61,116.71,181.6,117.06,69.44,138.32,83.44,138.67,97.43,139.02,111.42,139.37,125.42,139.72,139.41,140.07,153.41,140.42,167.4,140.77,181.4,141.13]},{"type":"surface","name":"B_EYE_BALL.01","parent":"B_EYE_BALL.03","segmentX":8,"segmentY":8,"vertices":[-140.45,43.65,-126.91,43.65,-113.37,43.65,-99.82,43.65,-86.28,43.65,-72.74,43.65,-59.2,43.65,-45.66,43.65,-32.12,43.65,-140.45,53.8,-126.91,53.8,-113.37,53.8,-99.82,53.8,-86.28,53.8,-72.74,53.8,-59.2,53.8,-45.66,53.8,-32.12,53.8,-140.45,63.95,-126.91,63.95,-113.37,63.95,-99.82,63.95,-86.28,63.95,-72.74,63.95,-59.2,63.95,-45.66,63.95,-32.12,63.95,-140.45,74.11,-126.91,74.11,-113.37,74.11,-99.82,74.11,-86.28,74.11,-72.74,74.11,-59.2,74.11,-45.66,74.11,-32.12,74.11,-140.45,84.26,-126.91,84.26,-113.37,84.26,-99.82,84.26,-86.28,84.26,-72.74,84.26,-59.2,84.26,-45.66,84.26,-32.12,84.26,-140.45,94.41,-126.91,94.41,-113.37,94.41,-99.82,94.41,-86.28,94.41,-72.74,94.41,-59.2,94.41,-45.66,94.41,-32.12,94.41,-140.45,104.57,-126.91,104.57,-113.37,104.57,-99.82,104.57,-86.28,104.57,-72.74,104.57,-59.2,104.57,-45.66,104.57,-32.12,104.57,-140.45,114.72,-126.91,114.72,-113.37,114.72,-99.82,114.72,-86.28,114.72,-72.74,114.72,-59.2,114.72,-45.66,114.72,-32.12,114.72,-140.45,124.87,-126.91,124.87,-113.37,124.87,-99.82,124.87,-86.28,124.87,-72.74,124.87,-59.2,124.87,-45.66,124.87,-32.12,124.87]},{"type":"surface","name":"B_EYE_BALL.02","parent":"B_EYE_BALL.03","segmentX":8,"segmentY":8,"vertices":[-75.51,-104.42,-55.85,-104.42,-36.19,-104.42,-16.53,-104.42,3.12,-104.42,22.78,-104.42,42.44,-104.42,62.09,-104.42,81.75,-104.42,-75.51,-91.79,-55.85,-91.79,-36.19,-91.79,-16.53,-91.79,3.12,-91.79,22.78,-91.79,42.44,-91.79,62.09,-91.79,81.75,-91.79,-75.51,-79.17,-55.85,-79.17,-36.19,-79.17,-16.53,-79.17,3.12,-79.17,22.78,-79.17,42.44,-79.17,62.09,-79.17,81.75,-79.17,-75.51,-66.54,-55.85,-66.54,-36.19,-66.54,-16.53,-66.54,3.12,-66.54,22.78,-66.54,42.44,-66.54,62.09,-66.54,81.75,-66.54,-75.51,-53.91,-55.85,-53.91,-36.19,-53.91,-16.53,-53.91,3.12,-53.91,22.78,-53.91,42.44,-53.91,62.09,-53.91,81.75,-53.91,-75.51,-41.28,-55.85,-41.28,-36.19,-41.28,-16.53,-41.28,3.12,-41.28,22.78,-41.28,42.44,-41.28,62.09,-41.28,81.75,-41.28,-75.51,-28.65,-55.85,-28.65,-36.19,-28.65,-16.53,-28.65,3.12,-28.65,22.78,-28.65,42.44,-28.65,62.09,-28.65,81.75,-28.65,-75.51,-16.02,-55.85,-16.02,-36.19,-16.02,-16.53,-16.02,3.12,-16.02,22.78,-16.02,42.44,-16.02,62.09,-16.02,81.75,-16.02,-75.51,-3.39,-55.85,-3.39,-36.19,-3.39,-16.53,-3.39,3.12,-3.39,22.78,-3.39,42.44,-3.39,62.09,-3.39,81.75,-3.39]},{"type":"surface","name":"B_EYE_BALL.07","parent":"B_EYE_BALL.09","segmentX":8,"segmentY":8,"vertices":[-165.25,31.53,-150.87,31.53,-136.49,31.53,-122.1,31.53,-107.72,31.53,-93.34,31.53,-78.96,31.53,-64.58,31.53,-50.2,31.53,-165.25,42.11,-150.87,42.11,-136.49,42.11,-122.1,42.11,-107.72,42.11,-93.34,42.11,-78.96,42.11,-64.58,42.11,-50.2,42.11,-165.25,52.68,-150.87,52.68,-136.49,52.68,-122.1,52.68,-107.72,52.68,-93.34,52.68,-78.96,52.68,-64.58,52.68,-50.2,52.68,-165.25,63.26,-150.87,63.26,-136.49,63.26,-122.1,63.26,-107.72,63.26,-93.34,63.26,-78.96,63.26,-64.58,63.26,-50.2,63.26,-165.25,73.83,-150.87,73.83,-136.49,73.83,-122.1,73.83,-107.72,73.83,-93.34,73.83,-78.96,73.83,-64.58,73.83,-50.2,73.83,-165.25,84.41,-150.87,84.41,-136.49,84.41,-122.1,84.41,-107.72,84.41,-93.34,84.41,-78.96,84.41,-64.58,84.41,-50.2,84.41,-165.25,94.98,-150.87,94.98,-136.49,94.98,-122.1,94.98,-107.72,94.98,-93.34,94.98,-78.96,94.98,-64.58,94.98,-50.2,94.98,-165.25,105.56,-150.87,105.56,-136.49,105.56,-122.1,105.56,-107.72,105.56,-93.34,105.56,-78.96,105.56,-64.58,105.56,-50.2,105.56,-165.25,116.13,-150.87,116.13,-136.49,116.13,-122.1,116.13,-107.72,116.13,-93.34,116.13,-78.96,116.13,-64.58,116.13,-50.2,116.13]},{"type":"surface","name":"B_EYE_BALL.08","parent":"B_EYE_BALL.09","segmentX":8,"segmentY":8,"vertices":[-69.82,-116.3,-50.3,-116.3,-30.78,-116.3,-11.26,-116.3,8.26,-116.3,27.78,-116.3,47.3,-116.3,66.82,-116.3,86.34,-116.3,-69.82,-100.86,-50.3,-100.86,-30.78,-100.86,-11.26,-100.86,8.26,-100.86,27.78,-100.86,47.3,-100.86,66.82,-100.86,86.34,-100.86,-69.82,-85.41,-50.3,-85.41,-30.78,-85.41,-11.26,-85.41,8.26,-85.41,27.78,-85.41,47.3,-85.41,66.82,-85.41,86.34,-85.41,-69.82,-69.96,-50.3,-69.96,-30.78,-69.96,-11.26,-69.96,8.26,-69.96,27.78,-69.96,47.3,-69.96,66.82,-69.96,86.34,-69.96,-69.82,-54.51,-50.3,-54.51,-30.78,-54.51,-11.26,-54.51,8.26,-54.51,27.78,-54.51,47.3,-54.51,66.82,-54.51,86.34,-54.51,-69.82,-39.07,-50.3,-39.07,-30.78,-39.07,-11.26,-39.07,8.26,-39.07,27.78,-39.07,47.3,-39.07,66.82,-39.07,86.34,-39.07,-69.82,-23.62,-50.3,-23.62,-30.78,-23.62,-11.26,-23.62,8.26,-23.62,27.78,-23.62,47.3,-23.62,66.82,-23.62,86.34,-23.62,-69.82,-8.17,-50.3,-8.17,-30.78,-8.17,-11.26,-8.17,8.26,-8.17,27.78,-8.17,47.3,-8.17,66.82,-8.17,86.34,-8.17,-69.82,7.27,-50.3,7.27,-30.78,7.27,-11.26,7.27,8.26,7.27,27.78,7.27,47.3,7.27,66.82,7.27,86.34,7.27]}],"slot":[{"zIndex":100,"name":"D_BACKGROUND.01","parent":"DST_BASE"},{"zIndex":190,"name":"D_CLOTHES.04","parent":"B_CLOTHES.20"},{"zIndex":200,"name":"D_HAIR_TWIN.02","parent":"B_HAIR_TWIN.20"},{"zIndex":200,"name":"D_HAIR_TWIN.00","parent":"B_HAIR_TWIN.12"},{"zIndex":200,"name":"D_HAIR_BACK.00","parent":"B_HAIR_BACK.01"},{"zIndex":210,"name":"D_HAIR_TWIN.11","parent":"B_HAIR_TWIN.21"},{"zIndex":220,"name":"D_HAIR_TWIN.05","parent":"B_HAIR_TWIN.14"},{"zIndex":250,"name":"D_BODY.00","parent":"B_BODY.01"},{"zIndex":300,"name":"D_HAIR_TWIN.06","parent":"B_HAIR_TWIN.09"},{"zIndex":310,"name":"D_HAIR_TWIN.13","parent":"B_HAIR_TWIN.19"},{"zIndex":360,"name":"D_NECK.00","parent":"B_NECK.01"},{"zIndex":365,"name":"D_NECK.01","parent":"B_NECK.03"},{"zIndex":380,"name":"D_CLOTHES.00","parent":"B_CLOTHES.16"},{"zIndex":390,"name":"D_CLOTHES.01","parent":"B_CLOTHES.35"},{"zIndex":390,"name":"D_BACKGROUND.02","parent":"B_BACKGROUND.01"},{"zIndex":399,"name":"D_BACKGROUND.03","parent":"B_BACKGROUND.01"},{"zIndex":400,"name":"D_EAR.00","parent":"B_EAR.01"},{"zIndex":400,"name":"D_EAR.01","parent":"B_EAR.02"},{"zIndex":400,"name":"D_HAIR_TWIN.12","parent":"B_HAIR_TWIN.17"},{"zIndex":400,"name":"D_CLOTHES.13","parent":"B_CLOTHES.05"},{"zIndex":400,"name":"D_CLOTHES.10","parent":"B_CLOTHES.30"},{"zIndex":400,"name":"D_CLOTHES.18","parent":"B_CLOTHES.40"},{"zIndex":400,"name":"D_CLOTHES.16","parent":"B_CLOTHES.38"},{"zIndex":400,"name":"D_CLOTHES.07","parent":"B_CLOTHES.11"},{"zIndex":400,"name":"D_CLOTHES.08","parent":"B_CLOTHES.12"},{"zIndex":400,"name":"D_CLOTHES.02","parent":"B_CLOTHES.17"},{"zIndex":400,"name":"D_CLOTHES.03","parent":"B_CLOTHES.15"},{"zIndex":450,"name":"D_CLOTHES.05","parent":"B_CLOTHES.22"},{"zIndex":450,"name":"D_CLOTHES.06","parent":"B_CLOTHES.24"},{"zIndex":480,"name":"D_HAIR_TWIN.14","parent":"B_HAIR_TWIN.18"},{"zIndex":480,"name":"D_HAIR_TWIN.15","parent":"B_HAIR_TWIN.16"},{"zIndex":500,"name":"D_REF.HAIR","parent":"B_FACE.02"},{"zIndex":500,"name":"D_REF.BODY","parent":"DST_BASE"},{"zIndex":500,"name":"D_REF.ARM_R","parent":"DST_BASE"},{"zIndex":500,"name":"D_REF.ARM_L","parent":"DST_BASE"},{"zIndex":500,"name":"D_REF.HEAD","parent":"B_FACE.02"},{"zIndex":500,"name":"D_FACE.00","parent":"B_FACE.01"},{"zIndex":500,"name":"D_EYE.02","parent":"B_EYE.01"},{"zIndex":500,"alpha":0.9,"name":"D_EYE.03","parent":"B_EYE.03"},{"zIndex":500,"name":"D_EYE.12","parent":"B_EYE.01"},{"zIndex":500,"name":"D_EYE_BALL.00","parent":"B_EYE_BALL.03"},{"zIndex":500,"name":"D_EYE_BALL.01","parent":"B_EYE_BALL.09"},{"zIndex":500,"name":"D_EYE_BALL.03","parent":"B_EYE_BALL.08"},{"zIndex":500,"name":"D_EYE_BALL.05","parent":"B_EYE_BALL.07"},{"zIndex":500,"name":"D_MOUTH.00","parent":"B_MOUTH.05"},{"zIndex":500,"alpha":0.8,"name":"D_NOSE.00","parent":"B_NOSE.01"},{"zIndex":500,"name":"D_NOSE.01","parent":"B_NOSE.01"},{"zIndex":500,"name":"D_HAIR_TWIN.30","parent":"B_CLOTHES.37"},{"zIndex":500,"name":"D_HAIR_TWIN.29","parent":"B_CLOTHES.26"},{"zIndex":500,"name":"D_CLOTHES.09","parent":"B_CLOTHES.09"},{"zIndex":500,"name":"D_BACKGROUND.04","parent":"DST_BASE"},{"zIndex":500,"name":"D_BACKGROUND.05","parent":"DST_BASE"},{"zIndex":500,"name":"D_BACKGROUND.06","parent":"B_BACKGROUND.01"},{"zIndex":500,"name":"D_BACKGROUND.07","parent":"B_BACKGROUND.01"},{"zIndex":505,"name":"D_MOUTH.03","parent":"B_MOUTH.04"},{"zIndex":510,"name":"D_REF.FACE","parent":"B_FACE.02"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.07","parent":"B_EYE_BALL.03"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.08","parent":"B_EYE_BALL.02"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.10","parent":"B_EYE_BALL.01"},{"zIndex":510,"alpha":0,"name":"D_EYE_BALL.12","parent":"B_EYE_BALL.09"},{"zIndex":510,"name":"D_EYE_BALL.02","parent":"B_EYE_BALL.02"},{"zIndex":510,"name":"D_EYE_BALL.04","parent":"B_EYE_BALL.01"},{"zIndex":510,"name":"D_MOUTH.01","parent":"B_MOUTH.01"},{"zIndex":510,"name":"D_MOUTH.02","parent":"B_MOUTH.04"},{"zIndex":510,"name":"D_HAIR_TWIN.04","parent":"B_HAIR_TWIN.11"},{"zIndex":510,"name":"D_HAIR_TWIN.07","parent":"B_HAIR_TWIN.13"},{"zIndex":511,"alpha":0,"name":"D_EYE_BALL.09","parent":"B_EYE_BALL.08"},{"zIndex":511,"alpha":0,"name":"D_EYE_BALL.11","parent":"B_EYE_BALL.07"},{"zIndex":520,"name":"D_REF.MOUTH","parent":"B_FACE.02"},{"zIndex":520,"name":"D_HAIR_TWIN.03","parent":"B_HAIR_TWIN.07"},{"zIndex":520,"name":"D_HAIR_TWIN.08","parent":"B_HAIR_TWIN.10"},{"zIndex":520,"name":"D_HAND.01","parent":"B_HAND.16"},{"zIndex":530,"name":"D_EYE.06","parent":"B_EYE.01"},{"zIndex":530,"name":"D_EYE.11","parent":"B_EYE.03"},{"zIndex":530,"name":"D_EYE.13","parent":"B_EYE.03"},{"zIndex":530,"name":"D_HAIR_TWIN.09","parent":"B_HAIR_TWIN.02"},{"zIndex":530,"name":"D_HAIR_TWIN.10","parent":"B_HAIR_TWIN.09"},{"zIndex":530,"name":"D_HAND.00","parent":"B_HAND.10"},{"zIndex":540,"alpha":0.96,"name":"D_FACESHADOW.00","parent":"B_FACESHADOW.02"},{"zIndex":540,"alpha":0,"name":"D_FACESHADOW.01","parent":"B_FACESHADOW.02"},{"zIndex":540,"name":"D_EYE.00","parent":"B_EYE.01"},{"zIndex":540,"name":"D_EYE.01","parent":"B_EYE.03"},{"zIndex":540,"name":"D_EYE.04","parent":"B_EYE.01"},{"zIndex":540,"name":"D_EYE.05","parent":"B_EYE.03"},{"zIndex":540,"name":"D_EYE.09","parent":"B_EYE.03"},{"zIndex":540,"name":"D_HAIR_SIDE.00","parent":"B_HAIR_SIDE.05"},{"zIndex":540,"name":"D_HAIR_SIDE.01","parent":"B_HAIR_SIDE.06"},{"zIndex":540,"name":"D_HAND.02","parent":"B_HAND.15"},{"zIndex":542,"name":"D_HAND.03","parent":"B_HAND.14"},{"zIndex":544,"name":"D_HAND.04","parent":"B_HAND.13"},{"zIndex":546,"name":"D_HAND.05","parent":"B_HAND.12"},{"zIndex":550,"name":"D_EYE.07","parent":"B_EYE.01"},{"zIndex":550,"name":"D_EYE.08","parent":"B_EYE.01"},{"zIndex":550,"name":"D_EYE.10","parent":"B_EYE.03"},{"zIndex":550,"name":"D_HAND.07","parent":"B_HAND.02"},{"zIndex":590,"name":"D_HAND.06","parent":"B_HAND.07"},{"zIndex":590,"name":"D_CLOTHES.11","parent":"B_CLOTHES.26"},{"zIndex":595,"name":"D_CLOTHES.12","parent":"B_CLOTHES.28"},{"zIndex":600,"name":"D_EYE.14","parent":"B_EYE.01"},{"zIndex":600,"name":"D_EYE.15","parent":"B_EYE.01"},{"zIndex":600,"name":"D_EYE.16","parent":"B_EYE.01"},{"zIndex":600,"name":"D_EYE.17","parent":"B_EYE.03"},{"zIndex":600,"name":"D_EYE.18","parent":"B_EYE.03"},{"zIndex":600,"name":"D_EYE.19","parent":"B_EYE.03"},{"zIndex":600,"name":"D_HAIR_FRONT.00","parent":"B_HAIR_FRONT.01"},{"zIndex":600,"name":"D_HAIR_TWIN.01","parent":"B_HAIR_TWIN.08"},{"zIndex":600,"name":"D_HAND.08","parent":"B_HAND.03"},{"zIndex":600,"name":"D_HAND.09","parent":"B_HAND.04"},{"zIndex":600,"name":"D_HAND.10","parent":"B_HAND.05"},{"zIndex":600,"name":"D_HAND.11","parent":"B_HAND.06"},{"zIndex":600,"name":"D_BACKGROUND.08","parent":"B_BACKGROUND.01"},{"zIndex":610,"alpha":0.6,"name":"D_HOHO.00","parent":"B_HOHO.01"},{"zIndex":610,"alpha":0.6,"name":"D_HOHO.01","parent":"B_HOHO.02"},{"zIndex":610,"name":"D_CLOTHES.14","parent":"B_CLOTHES.36"},{"zIndex":620,"name":"D_HAND.12","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.13","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.14","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.15","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.16","parent":"B_HAND.17"},{"zIndex":620,"name":"D_HAND.17","parent":"B_HAND.17"},{"zIndex":640,"name":"D_CLOTHES.15","parent":"B_CLOTHES.02"},{"zIndex":640,"name":"D_CLOTHES.17","parent":"B_CLOTHES.39"},{"zIndex":645,"name":"D_HAND.18","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.19","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.20","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.21","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.22","parent":"B_HAND.18"},{"zIndex":645,"name":"D_HAND.23","parent":"B_HAND.18"},{"zIndex":650,"name":"D_CLOTHES.19","parent":"B_CLOTHES.41"},{"zIndex":700,"name":"D_BROW.00","parent":"B_BROW.01"},{"zIndex":700,"name":"D_BROW.01","parent":"B_BROW.02"}],"skin":[{"slot":[{"name":"D_REF.HAIR","display":[{"type":"mesh","name":"D_REF.HAIR","path":"shizuku_00","vertices":[523.16,-338.04,531.58,341.16,-107.18,341.16,-97.47,-333.18],"uvs":[0.000188,0.000156,0.000906,0.000188,0.000906,0.000906,0.00025,0.000875],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.BODY","display":[{"type":"mesh","name":"D_REF.BODY","path":"shizuku_00","vertices":[-186.37,-671,149.73,-666.01,151.73,-190.57,-190.16,-196.56],"uvs":[0.000156,0.000125,0.001031,0.000188,0.001031,0.001031,0.000125,0.000906],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.ARM_R","display":[{"type":"mesh","name":"D_REF.ARM_R","path":"shizuku_00","vertices":[-335.19,-662.53,-195.92,-661.13,-178.71,-152.49,-335.13,-152.32],"uvs":[0.000125,0.000094,0.000906,0.000156,0.000937,0.000937,0.000094,0.000906],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.ARM_L","display":[{"type":"mesh","name":"D_REF.ARM_L","path":"shizuku_00","vertices":[159.85,-620.09,293.03,-624.81,293.03,-159.79,158.75,-159.79],"uvs":[0.000156,0.000156,0.001187,0.000156,0.001187,0.000906,0.000094,0.000906],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.FACE","display":[{"type":"mesh","name":"D_REF.FACE","path":"shizuku_00","vertices":[293.69,-202.02,292.75,187.64,-4.11,186.7,8.75,-202.02],"uvs":[0.000125,0.000094,0.000906,0.000125,0.000875,0.000813,0.000125,0.000781],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.MOUTH","display":[{"type":"mesh","name":"D_REF.MOUTH","path":"shizuku_00","vertices":[107.87,-137.43,111.03,126.11,-6.13,126.11,-6.13,-132.01],"uvs":[0.000125,0.000094,0.001,0.000125,0.001,0.000875,0.000188,0.000875],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_REF.HEAD","display":[{"type":"mesh","name":"D_REF.HEAD","path":"shizuku_00","vertices":[563.01,-290.81,563.01,279.73,-34.85,271.33,-34.85,-295.54],"uvs":[0.000625,0.000625,0.001406,0.000625,0.001438,0.001438,0.000719,0.001438],"triangles":[3,2,0,2,1,0],"userEdges":[]}]},{"name":"D_FACESHADOW.00","display":[{"type":"mesh","name":"D_FACESHADOW.00","path":"shizuku_00","vertices":[-44.95,-140.8,38.84,-142.52,113.32,-104.52,152.88,-21.61,158.41,98,138.63,121.75,101.1,70.37,15.56,32.8,-66.77,49.64,-125.25,92.82,-141.54,147.66,-164.81,83.75,-163.65,-26.79,-110.12,-107.98,-129.61,16.39,-93.83,-45.79,-32.15,-42.34,39.42,-55.29,94.7,-16.43,122.63,52.66],"uvs":[0.165365,0.658854,0.259115,0.657552,0.342448,0.686198,0.386719,0.748698,0.384115,0.84375,0.361979,0.864583,0.322917,0.81901,0.236979,0.791667,0.138021,0.795573,0.083333,0.835938,0.057292,0.876302,0.03125,0.828125,0.032552,0.744792,0.092448,0.683594,0.071615,0.78125,0.110677,0.730469,0.186198,0.72526,0.261719,0.713542,0.321615,0.752604,0.356771,0.800781],"triangles":[19,3,18,19,18,6,2,17,18,18,17,7,17,16,7,17,0,16,16,15,8,16,13,15,15,14,8,15,12,14,14,11,9,16,0,13,15,13,12,14,12,11,11,10,9,14,9,8,16,8,7,18,7,6,19,6,5,19,5,4,19,4,3,18,3,2,17,2,1,17,1,0],"userEdges":[]}]},{"name":"D_FACESHADOW.01","display":[{"type":"mesh","name":"D_FACESHADOW.01","path":"shizuku_00","vertices":[-112.17,-137.34,-3.75,-177.32,101.64,-154.69,133.2,-23.69,18.25,-19.29,-140.95,-18.73,-5.89,-112.99,-135.52,-84.32,-89.06,-65.05,124.57,-100.51,91.09,-65.97,-69.01,-127.45,60.77,-138.84,-89.03,-21.26,-77.57,-97.13,-74.16,-151.36,90.94,-28.75,73.09,-105.43,58.84,-163.88,5.88,-67.32,139.39,-65.49,-148.19,-55.54,-39.83,-44.06,57.73,-44.59],"uvs":[0.864583,0.526693,0.926432,0.50651,0.985026,0.521484,0.989583,0.595052,0.938802,0.60026,0.873047,0.598307,0.924479,0.55599,0.868495,0.559789,0.897198,0.578436,0.987118,0.555248,0.964571,0.580045,0.888904,0.538589,0.962012,0.5346,0.899816,0.599102,0.893521,0.55809,0.886269,0.519616,0.966485,0.597421,0.962401,0.555541,0.961233,0.515404,0.93146,0.577566,0.98847,0.577076,0.870617,0.577751,0.916284,0.588448,0.952769,0.589304],"triangles":[23,10,19,22,19,8,22,4,19,23,19,4,23,16,10,23,4,16,22,8,13,22,13,4,17,9,12,18,1,12,18,12,2,17,12,6,15,11,1,14,11,7,14,6,11,15,0,11,20,9,10,17,10,9,16,3,10,20,10,3,17,6,10,19,10,6,12,9,2,14,7,8,21,8,7,21,5,8,13,8,5,19,6,8,14,8,6,11,0,7,11,6,1,12,1,6],"userEdges":[]}]},{"name":"D_HOHO.00","display":[{"type":"mesh","name":"D_HOHO.00","path":"shizuku_00","vertices":[-103.31,-96.89,-31.3,-132.75,61.19,-108.1,103.61,-39.73,104.22,73.54,5.85,140.71,-94.98,122.78,-119.99,-10.59,-47.8,1.74,39.78,-2.74],"uvs":[0.484375,0.023438,0.515299,0.013021,0.555013,0.020182,0.574544,0.040039,0.574544,0.073242,0.53125,0.092448,0.487956,0.08724,0.477214,0.048503,0.516276,0.052083,0.546875,0.050781],"triangles":[9,8,5,9,1,8,8,0,7,8,7,6,8,6,5,9,5,4,9,4,3,9,3,2,9,2,1,8,1,0],"userEdges":[]}]},{"name":"D_HOHO.01","display":[{"type":"mesh","name":"D_HOHO.01","path":"shizuku_00","vertices":[-99.15,-99.63,-12.62,-133.3,86.71,-124.27,155.61,-64.12,151.14,40.89,100.13,132.64,-11.72,148.93,-94.94,111.23,-121.79,3.17,-26.04,35.79,58.07,13.36],"uvs":[0.608073,0.017904,0.638672,0.006836,0.674805,0.008464,0.69987,0.027669,0.698242,0.061198,0.679688,0.090495,0.639648,0.100586,0.608724,0.083659,0.598958,0.049154,0.633789,0.05957,0.664388,0.052409],"triangles":[1,9,10,10,9,6,9,0,8,9,8,7,9,7,6,10,6,5,10,5,4,10,4,3,10,3,2,10,2,1,9,1,0],"userEdges":[]}]},{"name":"D_FACE.00","display":[{"type":"mesh","name":"D_FACE.00","path":"shizuku_00","vertices":[-40.57,-131.63,38.06,-133.33,95.94,-106.92,119.27,-63.47,114.09,3.83,93.35,71.57,66.14,108.2,38.06,123.96,6.95,133.33,-36.25,120.55,-97.81,58.15,-115.73,0.43,-116.6,-71.99,-88.09,-116.29,2.63,97.55,44.1,81.36,65.7,41.32,106.18,29.67,77.8,-4.69,-38.84,81.36,-65.62,48.99,-82.9,8.95,-83.77,-42.17,82.12,-44.73,0.9,52.4,-28.47,8.95,25.96,7.24,-1.69,-43.88,44.97,-37.06,-48.34,-38.76,-63.89,-81.36,0.04,-89.88,58.79,-84.77,-69.84,71.91,-60.16,91.53,-15.35,108.19,-17.78,126.02,-37.76,104.23,-47.98,98.2,-25,114.54,-17.27,118.18,-5.08,120.4,40.43,105.49,20.84,90.44,23.08,112.47,5.74,118.58,15.84,121.09,21.71,128.89,-12.96,91.46,-86.33,75.11,-72.53,84.97,-107.07,27.17,-90.43,37.15,-81.71,53.52,-84.72,64.4,67.67,76.96,82.07,87.76,53.73,94.11,86.43,36.01,100.48,45.64,79.79,55.72,82.88,74.02,67.46,90.45,90.14,52.37,51.45,115.71,-101.99,41.77,-93.12,47.87,-89.52,55.54,-81.1,74.48,-68.67,94.06,-57.3,100.61,-45.4,106.64,-63.17,96.92,-51.45,104.23,-37.09,111.48,53.71,106.89,39.27,114.55,29.54,117.43,45.74,110.42,59.67,100.85,75.73,83,87.79,65.06,-73.55,90.11],"uvs":[0.135417,0.238281,0.253906,0.235677,0.341146,0.276042,0.376302,0.342448,0.36849,0.445313,0.338542,0.549479,0.295573,0.602865,0.253906,0.628906,0.207031,0.643229,0.141927,0.623698,0.052083,0.527344,0.022135,0.440104,0.020833,0.329427,0.063802,0.261719,0.200521,0.588542,0.263021,0.563802,0.295573,0.502604,0.356578,0.486745,0.313802,0.432292,0.138021,0.563802,0.097656,0.514323,0.071615,0.453125,0.070313,0.375,0.320313,0.371094,0.197917,0.519531,0.153646,0.453125,0.235677,0.450521,0.19401,0.372396,0.264323,0.382813,0.123698,0.380208,0.10026,0.315104,0.196615,0.302083,0.285156,0.309896,0.090644,0.550661,0.106547,0.57804,0.173426,0.604799,0.169761,0.632048,0.1403,0.598753,0.124248,0.588236,0.158873,0.61353,0.171504,0.619091,0.18889,0.622483,0.258131,0.598729,0.22796,0.57768,0.229386,0.610366,0.204231,0.619707,0.220427,0.623537,0.229278,0.636432,0.177022,0.57924,0.069032,0.560536,0.086916,0.569976,0.036166,0.480977,0.060272,0.496227,0.073408,0.521251,0.070521,0.538493,0.298538,0.557066,0.318616,0.574235,0.278176,0.581989,0.326808,0.494484,0.349933,0.509859,0.314855,0.523639,0.32048,0.552905,0.297245,0.577046,0.332075,0.51917,0.274096,0.616288,0.043826,0.503291,0.056218,0.511633,0.062617,0.524334,0.077588,0.556626,0.092958,0.584188,0.110198,0.592566,0.128193,0.602431,0.101325,0.587724,0.11866,0.598149,0.141023,0.609837,0.277475,0.600866,0.25606,0.613524,0.239964,0.618364,0.265827,0.607194,0.286501,0.591978,0.309765,0.566666,0.32882,0.538873,0.085223,0.578752],"triangles":[77,76,44,78,76,64,78,42,76,77,7,76,78,64,75,79,57,75,78,75,42,79,75,6,74,71,9,73,71,38,74,37,71,73,38,70,72,70,34,82,69,50,72,34,69,67,53,66,67,66,10,66,52,65,66,65,10,76,7,64,75,64,6,81,63,60,81,5,63,80,62,56,79,62,57,80,55,62,79,6,62,80,56,61,81,60,61,80,61,55,81,61,5,61,60,55,63,58,60,63,59,58,63,5,59,59,17,58,60,58,16,62,55,57,75,57,42,62,6,56,61,56,5,60,16,55,57,55,15,68,54,49,67,54,53,68,33,54,67,10,54,54,33,53,66,53,52,53,20,52,65,52,51,52,21,51,69,34,50,68,49,50,82,50,49,68,50,33,54,10,49,77,46,7,47,7,46,47,46,8,77,44,46,46,44,45,46,45,8,76,42,44,45,44,14,44,42,43,44,43,14,57,15,42,43,42,15,45,14,41,45,41,8,41,40,36,41,35,40,40,39,36,74,39,37,40,35,39,74,9,39,70,38,34,71,37,38,39,35,37,38,37,19,39,9,36,41,36,8,48,19,35,37,35,19,41,14,35,48,35,14,50,34,33,38,19,34,34,19,33,53,33,20,32,31,28,32,1,31,31,30,27,31,0,30,30,22,29,30,29,27,32,28,23,31,27,28,28,27,26,29,25,27,27,25,26,28,26,18,29,21,25,26,25,24,25,20,24,26,24,16,48,24,19,43,15,24,48,14,24,43,24,14,32,23,3,28,18,23,30,12,22,29,22,21,51,21,11,22,11,21,52,20,21,25,21,20,33,19,20,24,20,19,58,18,16,26,16,18,23,18,4,58,17,18,18,17,4,24,15,16,55,16,15,30,0,13,30,13,12,22,12,11,23,4,3,32,3,2,32,2,1,31,1,0],"userEdges":[]}]},{"name":"D_EYE.00","display":[{"type":"mesh","name":"D_EYE.00","path":"shizuku_00","vertices":[-94.67,-62.27,-15.52,-76.5,87.83,-67.01,127.41,-25.66,120.81,15.02,72.44,-5.32,2.07,-11.42,-46.3,21.12,-118.86,2.81,-73.26,47.13,-67.63,-15.65,-46.84,-37.13,-75.14,13.84,30.61,-39.26,-5.88,-40.85,78.15,-29.87,97.67,-12.22,39.95,-73.32,32.49,-8.79,-42.74,-12.11,-52.77,-69.8,-106.99,-29.13,-104.54,46.53,-92.57,28.37,-93.03,-6.5,-82.78,-38.07,-73.84,-48.42,-30.75,-57.35,11.6,-55.83,-22.02,-21.61,-24.79,6.65,57.04,-55.24,56.14,-18.51,107.91,-47.7,15.25,-23.65,-9.42,-56.64,34.49,-54.37,82.55,-46.75,101.49,-27.88,93.37,4.82,120.46,-9.7,55.09,-34.43,54.2,-6.9,13.18,-40.02,-26.03,-39.02,-49.86,-53.75,-58.98,-0.73,-44.3,1.37,-23.62,-12.98,-2.03,-26.62,31.61,-22.95,-90.92,-23.98,-95.65,8.67,-89.69,46.82,-57.85,32.26,-110.75,27.57,43.17,-29.05,66.33,-23.77,75.81,-19.83],"uvs":[0.020508,0.90918,0.055664,0.902344,0.101563,0.905273,0.119141,0.926758,0.115234,0.947266,0.094727,0.936523,0.063477,0.933594,0.041992,0.949219,0.009766,0.94043,0.03002,0.961712,0.032519,0.931563,0.041754,0.921252,0.029184,0.945726,0.076474,0.920553,0.059944,0.919462,0.09759,0.923432,0.10626,0.93191,0.079648,0.903875,0.076984,0.93486,0.043575,0.932288,0.039118,0.905561,0.015038,0.925091,0.016127,0.961422,0.021443,0.9527,0.021239,0.935959,0.027092,0.92145,0.031065,0.915178,0.048897,0.911543,0.067383,0.912598,0.05229,0.927238,0.051544,0.942272,0.088542,0.913203,0.08749,0.930192,0.110482,0.916175,0.069328,0.927723,0.058048,0.91188,0.077743,0.913885,0.099395,0.915183,0.107803,0.925008,0.104023,0.941393,0.117681,0.93442,0.087347,0.922035,0.086627,0.935764,0.06858,0.920032,0.050995,0.920343,0.040413,0.913267,0.036363,0.938728,0.042879,0.939734,0.052067,0.932845,0.061653,0.926298,0.076747,0.928211,0.023476,0.928216,0.020074,0.943241,0.022723,0.961559,0.036865,0.954569,0.013367,0.952315,0.081893,0.925294,0.092165,0.927063,0.096419,0.928787],"triangles":[58,57,5,58,15,57,56,50,32,56,13,50,47,19,46,47,46,7,57,41,32,56,32,41,57,15,41,56,41,13,50,34,18,43,14,34,49,34,14,50,13,34,43,34,13,49,6,34,37,15,33,38,33,15,38,3,33,37,33,2,42,32,18,50,18,32,42,5,32,57,32,5,37,31,15,41,15,31,36,31,17,37,2,31,36,13,31,41,31,13,48,19,30,47,30,19,47,7,30,48,30,6,48,29,19,49,14,29,44,29,14,44,11,29,48,6,29,49,29,6,36,17,28,35,14,28,43,28,14,43,13,28,36,28,13,35,28,1,35,27,14,44,14,27,45,27,20,45,11,27,44,27,11,35,1,27,45,20,26,45,26,11,26,25,11,51,25,21,51,10,25,26,0,25,52,12,24,51,21,24,51,24,10,52,24,8,52,23,12,55,22,23,53,23,22,52,8,23,55,23,8,53,9,23,25,0,21,24,21,8,27,1,20,26,20,0,29,11,19,46,19,10,34,6,18,31,2,17,28,17,1,40,16,4,39,4,16,38,15,16,58,16,15,40,3,16,38,16,3,58,5,16,39,16,5,54,12,9,23,9,12,46,10,12,24,12,10,54,7,12,46,12,7,19,11,10,25,10,11],"userEdges":[]}]},{"name":"D_EYE.01","display":[{"type":"mesh","name":"D_EYE.01","path":"shizuku_00","vertices":[-105.01,-39.22,-52.54,-60.49,26.18,-68.22,85.73,-41.15,107.93,3.31,113.99,44.88,32.24,12.01,-21.25,-1.52,-57.58,10.08,-91.89,47.78,-108.04,-0.55,-61.62,-23.75,1.96,-36.32,63.52,-21.82,76.64,14.91,-32.15,-29.58,-81.53,5.03,-6.18,-65.04,-21.32,-46.65,-77.66,-50.31,16.74,-12.72,42.45,-48.01,29.55,-29.82,9.54,6.27,14.28,-54.96,52.9,-56.08,84.89,-9.72,45.13,-1.93,85.09,48.11,95.76,30.26,42.02,30.31,63.74,35.34,69.3,-5.64,97.79,-16.99,103.76,65.46,54.08,24.95,49.49,13.14,81.22,32.92,111.28,26.33,91.82,9.29,99.05,46.55,-88.24,-10.45,-69.56,23.24,-84.28,-31.83,-57.37,-40.95,-43.59,-13.82,-8.51,-20.61,-26.9,-63.01,-15.23,-32.92,-69.4,-36.63,-41.25,-43.37,-1.78,-49.52,-59.64,-7.21,-26.93,-16.15,-71.41,-9.6],"uvs":[0.148926,0.912109,0.174316,0.901367,0.212402,0.897461,0.241211,0.911133,0.251953,0.933594,0.254883,0.95459,0.215332,0.937988,0.189453,0.931152,0.171875,0.937012,0.155273,0.956055,0.147461,0.931641,0.169922,0.919922,0.200684,0.913574,0.230469,0.920898,0.236816,0.939453,0.18418,0.91698,0.160287,0.934462,0.196742,0.899067,0.189417,0.908358,0.162163,0.906509,0.207835,0.925494,0.220272,0.907671,0.214029,0.916856,0.204352,0.935088,0.207293,0.904487,0.225327,0.903595,0.240808,0.927008,0.221571,0.930944,0.240901,0.956221,0.246067,0.947203,0.220065,0.947229,0.230572,0.94977,0.233265,0.929071,0.247049,0.923339,0.249934,0.964983,0.225899,0.944521,0.223677,0.938557,0.239032,0.948548,0.253575,0.945217,0.244159,0.936611,0.247657,0.955433,0.157039,0.926643,0.166081,0.943658,0.158957,0.915842,0.171979,0.911235,0.178643,0.924937,0.195615,0.921508,0.186718,0.900095,0.192367,0.91529,0.166158,0.913415,0.179779,0.910013,0.198872,0.906907,0.170877,0.928276,0.186703,0.923761,0.165185,0.92707],"triangles":[54,16,52,54,52,11,48,15,46,53,46,15,53,7,46,48,46,12,53,15,45,52,8,45,53,45,7,52,45,11,50,44,15,49,44,19,50,1,44,49,11,44,49,19,43,49,43,11,54,41,16,43,0,41,54,11,41,43,41,11,36,6,35,36,35,14,40,28,34,40,34,5,37,31,28,35,30,31,37,14,31,35,31,14,35,6,30,39,29,4,38,4,29,37,28,29,40,29,28,40,5,29,38,29,5,39,14,29,37,29,14,32,27,14,36,14,27,36,27,6,32,13,27,33,3,26,32,14,26,39,26,14,39,4,26,33,26,4,32,26,13,25,21,3,51,24,17,51,12,24,24,12,21,22,21,12,25,2,21,24,21,2,22,13,21,22,20,13,27,13,20,46,7,20,23,20,7,23,6,20,27,20,6,22,12,20,46,20,12,44,1,19,43,19,0,48,18,15,50,15,18,51,17,18,47,18,17,47,1,18,50,18,1,48,12,18,51,18,12,24,2,17,42,16,9,42,8,16,52,16,8,41,10,16,44,11,15,45,15,11,21,13,3,26,3,13,41,0,10,16,10,9,45,8,7],"userEdges":[]}]},{"name":"D_EYE.02","display":[{"type":"mesh","name":"D_EYE.02","path":"shizuku_00","vertices":[-63.16,-35.83,21.86,-58.88,112.75,-39.9,122.96,45.53,74.89,107.86,-23.58,122.81,-88.08,79.42,-91.01,10.27,-11.85,57.73,61.44,33.32],"uvs":[0.733724,0.386068,0.771484,0.375,0.811849,0.384115,0.816406,0.42513,0.794922,0.455078,0.751302,0.46224,0.722656,0.441406,0.721354,0.408203,0.75651,0.43099,0.789063,0.419271],"triangles":[1,8,9,9,8,4,8,0,7,8,7,6,8,6,5,8,5,4,9,4,3,9,3,2,9,2,1,8,1,0],"userEdges":[]}]},{"name":"D_EYE.03","display":[{"type":"mesh","name":"D_EYE.03","path":"shizuku_00","vertices":[-60.95,-53.4,28.87,-54.36,106.58,-12.8,98.51,69.85,30.89,115.77,-59.94,102.24,-108.38,37.47,-93.24,-25.36,-8.47,43.27,55.11,8.47,-19.57,-8.93,-59.94,29.74],"uvs":[0.736328,0.476074,0.779785,0.475586,0.817383,0.496582,0.815918,0.539063,0.780762,0.561523,0.736816,0.554688,0.713379,0.521973,0.720703,0.490234,0.761719,0.524902,0.79248,0.507324,0.756348,0.498535,0.736816,0.518066],"triangles":[11,10,7,11,8,10,10,9,1,10,8,9,9,8,3,11,5,8,10,0,7,11,7,6,11,6,5,8,5,4,8,4,3,9,3,2,9,2,1,10,1,0],"userEdges":[]}]},{"name":"D_EYE.04","display":[{"type":"mesh","name":"D_EYE.04","path":"shizuku_00","vertices":[-50.88,86.88,-19.37,88.91,6.84,107.04,-10.94,127.72,-46.48,120.09,-23.03,107.89],"uvs":[0.299805,0.963542,0.313802,0.964518,0.329102,0.972982,0.318034,0.986328,0.301758,0.979492,0.312174,0.973633],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.05","display":[{"type":"mesh","name":"D_EYE.05","path":"shizuku_00","vertices":[18.78,119.64,18.78,95.47,60.16,86.77,73.28,112.87,45.02,129.3,46.03,108.04],"uvs":[0.344238,0.983398,0.34668,0.969727,0.368164,0.963379,0.373047,0.978516,0.359375,0.986816,0.359863,0.976074],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.06","display":[{"type":"mesh","name":"D_EYE.06","path":"shizuku_00","vertices":[-86.61,38.74,-130.59,-26.34,-107.13,-117.18,-29.44,-165.99,76.1,-155.14,128.87,-92.77,136.2,-22.27,102.49,8.91,45.32,-16.85,-42.64,3.49,-41.17,-73.79,52.65,-85.99,96.62,-48.03,0.61,-46.28,-86.2,-50.36,-90.57,-11.29,12.77,-124.85,-34.71,-124.61,63.06,-116.71,88.06,-89.14,-73.54,-95.08],"uvs":[0.028646,0.229818,0.007161,0.199219,0.019531,0.154948,0.054036,0.13151,0.100911,0.136719,0.124349,0.166667,0.127604,0.200521,0.11263,0.215495,0.08724,0.203125,0.048177,0.212891,0.048828,0.175781,0.090495,0.169922,0.110026,0.188151,0.067386,0.188992,0.028829,0.187031,0.026888,0.205794,0.072786,0.151265,0.051699,0.151379,0.095122,0.155174,0.106225,0.168409,0.034454,0.165559],"triangles":[19,5,18,19,18,11,20,17,2,20,10,17,18,4,16,17,10,16,17,16,3,18,16,11,15,9,14,20,2,14,15,14,1,20,14,10,19,11,12,19,12,5,13,11,10,16,10,11,13,8,11,12,11,8,14,9,10,13,10,9,15,0,9,13,9,8,12,8,7,12,7,6,12,6,5,18,5,4,16,4,3,17,3,2,14,2,1,15,1,0],"userEdges":[]}]},{"name":"D_EYE.07","display":[{"type":"mesh","name":"D_EYE.07","path":"shizuku_00","vertices":[-19.18,-84.98,23.33,-106.67,70.97,-104.64,87.09,-63.96,43.12,-62.61,0.61,-68.03,23.33,-87.69,54.11,-85.66],"uvs":[0.490885,0.204427,0.509766,0.19401,0.530924,0.194987,0.538086,0.214518,0.518555,0.215169,0.499674,0.212565,0.509766,0.203125,0.523438,0.204102],"triangles":[7,6,4,7,1,6,6,0,5,6,5,4,7,4,3,7,3,2,7,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE.08","display":[{"type":"mesh","name":"D_EYE.08","path":"shizuku_00","vertices":[-29.08,-74.47,17.1,-95.82,63.27,-91.76,84.16,-62.27,32.49,-63.28,2.03,-68.82,25.87,-77.29,45.96,-75.74,72.55,-78.67,55.01,-62.84,7.17,-78.03,33.65,-94.37,-3.79,-86.16,64.25,-69.29,42,-83.53],"uvs":[0.023926,0.648438,0.044434,0.638184,0.064941,0.640137,0.074219,0.654297,0.05127,0.653809,0.03774,0.651151,0.048328,0.647085,0.057251,0.647827,0.069059,0.646422,0.06127,0.654021,0.040023,0.646728,0.051784,0.638884,0.035156,0.642822,0.065377,0.650925,0.055495,0.644087],"triangles":[14,11,6,14,2,11,12,0,10,12,10,1,13,7,9,13,9,3,13,8,7,13,3,8,14,6,7,8,2,7,14,7,2,9,7,4,10,5,6,11,1,6,10,6,1,7,6,4,10,0,5,6,5,4],"userEdges":[]}]},{"name":"D_EYE.09","display":[{"type":"mesh","name":"D_EYE.09","path":"shizuku_00","vertices":[-105.52,-52.27,-78.61,-84.49,-36.89,-89,1.46,-67.09,-24.11,-55.49,-71.88,-49.69,-52.9,-70.81],"uvs":[0.572591,0.207357,0.585612,0.191081,0.605794,0.188802,0.624349,0.19987,0.611979,0.205729,0.588867,0.208659,0.598049,0.19799],"triangles":[6,4,2,6,1,5,6,5,4,4,3,2,6,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.10","display":[{"type":"mesh","name":"D_EYE.10","path":"shizuku_00","vertices":[-91.41,-58.28,-66.86,-76.74,-25.86,-79.37,-1.97,-61.09,-32.13,-54.77,-64.41,-53.58],"uvs":[0.089518,0.650065,0.101563,0.640951,0.121419,0.639974,0.132813,0.649414,0.118164,0.652344,0.102539,0.652669],"triangles":[1,5,4,4,3,2,4,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE.11","display":[{"type":"mesh","name":"D_EYE.11","path":"shizuku_00","vertices":[-100.98,27.16,-138.65,-36,-122.51,-112.04,-17.55,-141.69,100.87,-113.33,142.58,-16.66,95.48,64.54,49.73,2.67,-36.39,-5.06,-47.15,-69.51,40.31,-70.8,-81.53,-18.72,1.1,-41.06,85.4,-46.93,95.21,-6.8,-100.28,-50.05,-86.02,-91.45,-72.22,-126.25,-30.53,-110.03,-3.29,-70.16,10.26,-107.62,47.59,-126.09,69.67,-91.42,121.99,-64.37,44.2,-40.48,44.19,-100.22,92.39,-76.97,-61.64,-102.31],"uvs":[0.147135,0.211589,0.128906,0.179688,0.136719,0.141276,0.1875,0.126302,0.244792,0.140625,0.264974,0.189453,0.242188,0.230469,0.220052,0.199219,0.178385,0.195313,0.173177,0.16276,0.215495,0.162109,0.156544,0.188415,0.196521,0.179086,0.237308,0.174164,0.242054,0.194436,0.147475,0.172588,0.154374,0.15168,0.16105,0.134102,0.181219,0.14229,0.194401,0.162434,0.200955,0.143511,0.219018,0.134182,0.229699,0.151693,0.255014,0.165356,0.217375,0.177423,0.21737,0.147249,0.240693,0.158992,0.166167,0.146195],"triangles":[26,13,23,26,23,4,26,22,13,25,22,21,26,4,22,25,10,22,25,21,20,22,4,21,21,3,20,25,20,10,20,18,19,20,19,10,27,18,17,20,3,18,27,9,18,19,18,9,27,17,16,18,3,17,17,2,16,27,16,9,16,2,15,16,15,9,14,13,7,24,7,13,14,5,13,23,13,5,22,10,13,24,13,10,24,12,7,19,9,12,24,10,12,19,12,10,15,11,9,15,1,11,11,8,9,12,9,8,11,0,8,12,8,7,14,7,6,14,6,5,15,2,1,11,1,0],"userEdges":[]}]},{"name":"D_EYE.12","display":[{"type":"mesh","name":"D_EYE.12","path":"shizuku_00","vertices":[-96.8,7.73,-59.01,0.61,-57.83,37.22,-51.92,72.81,-42.08,95.18,-72.39,79.93,-92.86,43.66,-77.86,22.06,-69.82,59.3,-75.22,40.75,-61.63,76.38,-78.64,4.31],"uvs":[0.321289,0.612305,0.336914,0.608887,0.337402,0.626465,0.34082,0.642578,0.342285,0.65332,0.330078,0.646973,0.322266,0.629883,0.32912,0.619187,0.332768,0.637069,0.329886,0.628162,0.335829,0.64462,0.328796,0.610663],"triangles":[10,8,5,9,8,2,9,6,8,10,3,8,9,7,6,11,7,1,11,0,7,9,2,7,7,0,6,8,6,5,10,5,4,10,4,3,8,3,2,7,2,1],"userEdges":[]}]},{"name":"D_EYE.13","display":[{"type":"mesh","name":"D_EYE.13","path":"shizuku_00","vertices":[71.26,10.4,105.58,25.23,96.83,63.89,77.99,84.52,57.13,94.83,61.17,63.25,67.23,32.31,80.01,53.58,83.15,29.37,68.68,77.5],"uvs":[0.396159,0.60612,0.41276,0.613607,0.408529,0.633138,0.400065,0.642904,0.388021,0.647135,0.391276,0.632813,0.394206,0.617188,0.400391,0.62793,0.401908,0.615701,0.395561,0.637733],"triangles":[8,7,1,8,6,7,9,7,5,9,3,7,8,0,6,7,6,5,9,5,4,9,4,3,7,3,2,7,2,1,8,1,0],"userEdges":[]}]},{"name":"D_EYE.14","display":[{"type":"mesh","name":"D_EYE.14","path":"shizuku_00","vertices":[-19.18,-94.13,10.14,-71.08,36.52,-46,-8.19,-36.51,-24.31,-59.56,0.47,-52.85,-9.01,-64.68,10.18,-40.4],"uvs":[0.710286,0.263997,0.723307,0.275065,0.735026,0.287109,0.715169,0.291667,0.708008,0.280599,0.719016,0.283819,0.714806,0.27814,0.723326,0.289795],"triangles":[7,2,5,6,4,5,7,5,3,6,5,1,6,0,4,5,4,3,5,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE.15","display":[{"type":"mesh","name":"D_EYE.15","path":"shizuku_00","vertices":[-119.59,-17.52,-95.41,-22.61,-55.83,-27.35,-70.12,3.15,-96.87,3.83,-111.53,-4.64,-79.95,-8.54,-102.39,-6.62],"uvs":[0.663574,0.29834,0.680664,0.296387,0.698242,0.294434,0.691895,0.309082,0.678711,0.308105,0.667969,0.307129,0.686063,0.30249,0.672194,0.303901],"triangles":[7,4,1,6,1,4,7,0,5,7,5,4,6,4,3,6,3,2,6,2,1,7,1,0],"userEdges":[]}]},{"name":"D_EYE.16","display":[{"type":"mesh","name":"D_EYE.16","path":"shizuku_00","vertices":[-107.41,68.23,-94.22,41.79,-73.33,29.59,-70.03,58.06,-82.66,49.57],"uvs":[0.668945,0.34082,0.674805,0.328125,0.684082,0.322266,0.685547,0.335938,0.679936,0.331857],"triangles":[4,0,3,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_EYE.17","display":[{"type":"mesh","name":"D_EYE.17","path":"shizuku_00","vertices":[-44.46,-47.28,-12.17,-60.16,29.55,-75.63,18.11,-43.41,-3.42,-34.39],"uvs":[0.769857,0.280599,0.785482,0.274089,0.805664,0.266276,0.80013,0.282552,0.789714,0.287109],"triangles":[1,4,3,3,2,1,4,1,0],"userEdges":[]}]},{"name":"D_EYE.18","display":[{"type":"mesh","name":"D_EYE.18","path":"shizuku_00","vertices":[62.18,-20.53,96.49,-12.8,126.1,-4.42,103.89,11.05,79,11.69,62.85,-3.77,83.71,-3.13,100.13,-1.08],"uvs":[0.817383,0.292643,0.833984,0.296549,0.848307,0.300781,0.837565,0.308594,0.825521,0.308919,0.817708,0.301107,0.827799,0.301432,0.835743,0.302467],"triangles":[7,1,6,7,6,3,6,0,5,6,5,4,6,4,3,7,3,2,7,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE.19","display":[{"type":"mesh","name":"D_EYE.19","path":"shizuku_00","vertices":[71.77,4.6,104.06,21.36,130.97,36.83,103.39,42.63,79.17,40.05,74.12,23.78,89.26,27.16,103.72,32.14],"uvs":[0.830078,0.319336,0.845703,0.327799,0.858724,0.335612,0.845378,0.338542,0.833659,0.33724,0.829753,0.328776,0.838542,0.330729,0.845538,0.333247],"triangles":[7,1,6,7,6,3,6,0,5,6,5,4,6,4,3,7,3,2,7,2,1,6,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.07","display":[{"type":"mesh","name":"D_EYE_BALL.07","path":"shizuku_00","vertices":[-22.7,-144.12,96.35,-124.86,164.75,-21.7,156.66,90.3,59.54,151.8,-78.97,136.04,-146.07,25.73,-124.42,-103.85,9.76,29.23,-1.06,-63.57],"uvs":[0.913086,0.32666,0.939941,0.332031,0.955078,0.36084,0.953125,0.39209,0.931641,0.40918,0.900391,0.404785,0.885254,0.374023,0.890137,0.337891,0.92041,0.375,0.917969,0.349121],"triangles":[9,8,2,9,6,8,9,0,7,9,7,6,8,6,5,8,5,4,8,4,3,8,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.08","display":[{"type":"mesh","name":"D_EYE_BALL.08","path":"shizuku_00","vertices":[-51.01,-135.33,136.17,-89.11,147.18,155.85,-17.98,155.85,-161.11,12.57,33.41,7.95],"uvs":[0.905599,0.25,0.922201,0.253255,0.923177,0.270508,0.908529,0.270508,0.895833,0.260417,0.913086,0.260091],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.09","display":[{"type":"mesh","name":"D_EYE_BALL.09","path":"shizuku_00","vertices":[-102.3,-113.07,66.41,-105.67,143.1,92.1,15.29,178.63,-173.87,38.11,-0.05,24.12],"uvs":[0.952148,0.25,0.969238,0.251953,0.976563,0.267578,0.964355,0.274414,0.94873,0.265137,0.962891,0.262207],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.10","display":[{"type":"mesh","name":"D_EYE_BALL.10","path":"shizuku_00","vertices":[-52.92,-153.15,160.18,-78.41,90.92,157.3,-122.18,151.55,-159.47,-20.92,-4.98,7.82],"uvs":[0.888021,0.287109,0.901042,0.291341,0.89681,0.304688,0.883789,0.304362,0.88151,0.294596,0.890951,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.11","display":[{"type":"mesh","name":"D_EYE_BALL.11","path":"shizuku_00","vertices":[-160.05,-23.04,-16.64,-152.36,163.79,-56.77,126.78,145.64,-86.03,156.89,1.87,27.56],"uvs":[0.924154,0.293294,0.934245,0.285807,0.94694,0.291341,0.944336,0.30306,0.929362,0.303711,0.935547,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.12","display":[{"type":"mesh","name":"D_EYE_BALL.12","path":"shizuku_00","vertices":[-12.72,-139.91,107.08,-95.71,127.52,18.11,89.69,132.29,-10.39,154.89,-114.4,119.98,-144.34,14.37,-94.19,-113.56,-15.01,47.96,-15.16,-48.98],"uvs":[0.910645,0.327637,0.941895,0.333008,0.953613,0.362305,0.951172,0.393555,0.929688,0.406738,0.902832,0.40332,0.888184,0.375977,0.890625,0.339844,0.921387,0.37793,0.915527,0.352051],"triangles":[9,6,8,9,8,2,9,0,7,9,7,6,8,6,5,8,5,4,8,4,3,8,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.00","display":[{"type":"mesh","name":"D_EYE_BALL.00","path":"shizuku_00","vertices":[-35.69,-149.38,120.86,-119.02,166.31,26.9,115.81,129.04,-20.54,155.31,-107.11,104.53,-141.74,-47.82,4.35,-31.18,23.83,61.63],"uvs":[0.436035,0.269531,0.470215,0.276367,0.480469,0.318359,0.469727,0.346191,0.438965,0.353516,0.418945,0.340332,0.410156,0.296875,0.44458,0.301514,0.448975,0.327393],"triangles":[8,1,7,8,7,6,7,0,6,8,6,5,8,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.01","display":[{"type":"mesh","name":"D_EYE_BALL.01","path":"shizuku_00","vertices":[19.22,-139.16,129,-73.15,127,73.12,45.17,160.53,-102.53,137.34,-150.43,48.15,-113.17,-107.05,-0.74,-30.34,-14.71,51.72],"uvs":[0.560059,0.268555,0.586914,0.286621,0.586426,0.32666,0.566406,0.350586,0.530273,0.344238,0.518555,0.319824,0.529785,0.275879,0.555176,0.29834,0.551758,0.320801],"triangles":[2,7,8,5,8,7,7,0,6,7,6,5,8,5,4,8,4,3,8,3,2,7,2,1,7,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.02","display":[{"type":"mesh","name":"D_EYE_BALL.02","path":"shizuku_00","vertices":[-51.01,-135.33,136.17,-89.11,147.18,155.85,-17.98,155.85,-161.11,12.57,33.41,7.95],"uvs":[0.905599,0.25,0.922201,0.253255,0.923177,0.270508,0.908529,0.270508,0.895833,0.260417,0.913086,0.260091],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.03","display":[{"type":"mesh","name":"D_EYE_BALL.03","path":"shizuku_00","vertices":[-102.3,-113.07,66.41,-105.67,143.1,92.1,15.29,178.63,-173.87,38.11,-0.05,24.12],"uvs":[0.952148,0.25,0.969238,0.251953,0.976563,0.267578,0.964355,0.274414,0.94873,0.265137,0.962891,0.262207],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.04","display":[{"type":"mesh","name":"D_EYE_BALL.04","path":"shizuku_00","vertices":[-52.92,-153.15,160.18,-78.41,90.92,157.3,-122.18,151.55,-159.47,-20.92,-4.98,7.82],"uvs":[0.888021,0.287109,0.901042,0.291341,0.89681,0.304688,0.883789,0.304362,0.88151,0.294596,0.890951,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_EYE_BALL.05","display":[{"type":"mesh","name":"D_EYE_BALL.05","path":"shizuku_00","vertices":[-160.05,-23.04,-16.64,-152.36,163.79,-56.77,126.78,145.64,-86.03,156.89,1.87,27.56],"uvs":[0.924154,0.293294,0.934245,0.285807,0.94694,0.291341,0.944336,0.30306,0.929362,0.303711,0.935547,0.296224],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_BROW.00","display":[{"type":"mesh","name":"D_BROW.00","path":"shizuku_02","vertices":[-160.01,142.01,-112.68,5.9,-30.63,-91.83,68.77,-105.79,128.73,-49.94,153.97,19.86,101.91,5.9,18.28,12.88,-60.61,68.72,-47.7,-0.4,15.68,-98.33,46.61,-53.69,-9.72,-47.07,-107.47,103.27,-81.89,43.05,16.77,-51.52,85.23,-50.33,116.11,-23.66,-138.37,79.78,-109.91,57.73,-63.61,-52.55,-30.67,47.53,55.43,9.78,73.02,-25.23,32.13,-19.67,94.94,-81.41,-76.9,2.43,-38.31,-50.72,-17.78,5.62,-87.59,-23.98],"uvs":[0.08724,0.645833,0.106771,0.620443,0.140625,0.602214,0.181641,0.599609,0.20638,0.610026,0.216797,0.623047,0.195313,0.620443,0.160807,0.621745,0.128255,0.632161,0.133581,0.619267,0.159733,0.601,0.172495,0.609327,0.149252,0.610562,0.108919,0.638607,0.119474,0.627372,0.160185,0.609733,0.18843,0.609955,0.201171,0.614929,0.09617,0.634223,0.107914,0.630112,0.127017,0.609541,0.14061,0.628208,0.176134,0.621166,0.183393,0.614636,0.166522,0.615673,0.192439,0.604156,0.121536,0.619795,0.137458,0.609882,0.145927,0.620391,0.117122,0.614869],"triangles":[29,26,20,29,1,26,23,11,22,24,22,11,24,7,22,23,22,6,28,9,21,28,21,7,26,9,20,27,20,9,27,2,20,19,18,13,19,1,18,25,16,4,17,4,16,23,16,11,23,6,16,17,16,6,25,3,16,24,11,15,24,15,7,26,14,9,19,13,14,26,1,14,19,14,1,18,0,13,14,13,8,28,12,9,27,9,12,15,10,12,28,7,12,15,12,7,27,12,2,15,11,10,16,3,11,11,3,10,12,10,2,14,8,9,21,9,8,17,6,5,17,5,4],"userEdges":[]}]},{"name":"D_BROW.01","display":[{"type":"mesh","name":"D_BROW.01","path":"shizuku_02","vertices":[-147.95,38.77,-118.67,-29.47,-60.87,-68.98,2.95,-72.57,66.76,-34.86,117.81,31.59,159.1,135.75,108.05,107.02,47.24,54.94,-14.32,22.61,-76.63,24.41,88.03,38.21,26.48,-4.84,-38.07,-24.11,-102.67,-8.97,-68.18,-25.69,-7.18,-16.74,56.83,10.83,112.75,70.69,-97.65,-43.84,-105.77,30.28,-42.1,23.41,-29.73,-70.73,34.49,-53.93,18.06,39.61,95.79,2.92,79.63,82.68,-82.01,-38.63,-51.42,-50.39,-18.74,-46.95,15.48,-36.49,46.29,-19.6,77.67,2.61,-88.66,9,-56.18,-1.33,-26.94,-2.22,5.11,9.54,35.8,22.01,67.83,46.49,98.89,75.52,131.46,66.01,-120.27,9.59,-122.27,33.6,-129.91,-3.28],"uvs":[0.295898,0.611979,0.308594,0.599609,0.333659,0.592448,0.361328,0.591797,0.388997,0.598633,0.411133,0.610677,0.429036,0.629557,0.406901,0.624349,0.380534,0.614909,0.353841,0.609049,0.326823,0.609375,0.398218,0.611877,0.37153,0.604074,0.343545,0.60058,0.315531,0.603326,0.33049,0.600295,0.356936,0.601917,0.384691,0.606914,0.408939,0.617764,0.317708,0.597005,0.31419,0.610439,0.341795,0.609195,0.347159,0.59213,0.375007,0.595176,0.367881,0.612131,0.401583,0.605481,0.394578,0.619937,0.324492,0.597949,0.337754,0.595817,0.351924,0.596441,0.366762,0.598336,0.38012,0.601398,0.393725,0.605424,0.321608,0.606582,0.335692,0.60471,0.34837,0.604549,0.362264,0.606681,0.375574,0.60894,0.389463,0.613378,0.402926,0.618639,0.417048,0.616915,0.307901,0.606689,0.307034,0.611041,0.303722,0.604356],"triangles":[42,20,41,43,41,1,43,0,41,42,41,0,39,11,26,38,26,11,38,8,26,39,26,7,32,11,25,32,25,4,37,12,24,36,24,12,36,9,24,37,24,8,30,12,23,31,23,12,31,4,23,30,23,3,28,13,22,29,22,13,29,3,22,28,22,2,34,21,13,35,13,21,34,10,21,35,21,9,33,14,20,41,20,14,33,20,10,27,19,14,27,2,19,40,18,6,39,18,11,40,5,18,39,7,18,32,17,11,38,11,17,31,12,17,37,17,12,32,4,17,31,17,4,37,8,17,38,17,8,30,16,12,36,12,16,29,13,16,35,16,13,30,3,16,29,16,3,35,9,16,36,16,9,28,15,13,34,13,15,27,14,15,33,15,14,28,2,15,27,15,2,33,10,15,34,15,10,19,1,14,41,14,1,25,11,5,18,5,11,18,7,6],"userEdges":[]}]},{"name":"D_MOUTH.00","display":[{"type":"mesh","name":"D_MOUTH.00","path":"shizuku_00","vertices":[-61.02,-100.31,59.04,-101.55,131.33,-54.93,115.1,10.01,42.64,42.13,-63.57,40.92,-136.8,-3.23,-136.55,-72.01,-54.03,-32.54,37.78,-34.13],"uvs":[0.313477,0.874512,0.365723,0.874023,0.397461,0.897949,0.390625,0.931152,0.358887,0.947266,0.312988,0.947754,0.280273,0.924805,0.280273,0.88916,0.316895,0.909668,0.356934,0.908691],"triangles":[9,8,5,9,0,8,8,0,7,8,7,6,8,6,5,9,5,4,9,4,3,9,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_MOUTH.03","display":[{"type":"mesh","name":"D_MOUTH.03","path":"shizuku_00","vertices":[-118.79,20.11,-84.22,-19.56,-17.35,-25.64,77.56,-28.31,126.28,26.08,131.17,88.37,73.43,93.58,2.52,103.85,-53.69,87.29,-100.59,76.14,33.52,46.75,111.46,41.59,-70.85,37.49],"uvs":[0.686035,0.228516,0.70752,0.215332,0.739746,0.212891,0.780273,0.210938,0.809082,0.220215,0.802246,0.234375,0.777832,0.235352,0.748047,0.237305,0.723145,0.23877,0.700195,0.239258,0.761182,0.226558,0.793993,0.225572,0.716008,0.228065],"triangles":[11,3,6,10,6,3,10,2,7,12,8,2,12,1,9,12,9,8,2,8,7,10,7,6,11,6,5,11,5,4,11,4,3,10,3,2,12,2,1,9,1,0],"userEdges":[]}]},{"name":"D_MOUTH.01","display":[{"type":"mesh","name":"D_MOUTH.01","path":"shizuku_00","vertices":[-111.61,-104.94,-73.02,-80.53,-13.74,-52.42,58.49,-66.08,98.01,-96.46,118.84,-102.5,139.78,-5.89,94.19,51.7,55.75,85.04,-2.18,91.62,-59.18,81.52,-103.6,34.92,-86.38,0.61,-107.28,-53.16,7.68,35.98,75.93,21.79,103.67,-10.46,111.47,-66.07,61.78,-22.71,-35.98,-17.44,-126.72,-89.5,-110.4,-77.46,-100.67,-98.27,-93.77,-64.09,-52.46,-42.3,-27.26,-35.48,34.31,-36.53,61.49,-42.85,91.36,-64.12,105.62,-76.93,115.83,-92.44,110.48,-103.96,121.09,-72.38,6.77,-19.93,-96.52,-79.74,-106.27,-85.89,-85.87,-70.65,-60.95,-56.28,-84.72,-88.22,-25.4,-43.5,-42.63,-61.11,12.74,-43.73,44.17,-47.21,29.01,-51.97,59.7,-50.61,79.49,-62.44,81.13,-81.84,94.55,-74.65,103.22,-86.13,109.56,-90.22,-74.48,-59.5,-43.53,-50.02,-38.37,-42.92,-5.27,-40.01,6.96,-36.06,-101.02,-69.91,30.68,-45.72,-8.44,-43.6,-26.2,-40.05],"uvs":[0.874268,0.173096,0.892334,0.16333,0.909424,0.16333,0.928223,0.16333,0.943115,0.163574,0.956055,0.17041,0.958984,0.184082,0.954346,0.199707,0.936523,0.209473,0.912354,0.21167,0.888916,0.208984,0.877441,0.195801,0.894531,0.189453,0.888916,0.178711,0.914307,0.190674,0.932617,0.188965,0.947021,0.18335,0.94165,0.175293,0.927002,0.175537,0.905273,0.17627,0.875412,0.181282,0.881461,0.175853,0.87941,0.170316,0.890266,0.172636,0.900208,0.171204,0.906937,0.171084,0.92042,0.170967,0.92746,0.170956,0.936458,0.170667,0.942103,0.171672,0.947607,0.173274,0.948877,0.166618,0.951739,0.176592,0.914329,0.175964,0.885254,0.171021,0.880559,0.173419,0.89107,0.169017,0.897156,0.168152,0.886814,0.166314,0.908104,0.167444,0.902344,0.16333,0.915454,0.167518,0.923474,0.167978,0.919922,0.16333,0.927786,0.167693,0.933468,0.168003,0.936649,0.163468,0.938815,0.168157,0.942539,0.168187,0.945395,0.169216,0.894316,0.17,0.90252,0.167805,0.904318,0.169247,0.911619,0.169124,0.91443,0.171019,0.886429,0.174038,0.92003,0.16778,0.911373,0.167477,0.907602,0.169009],"triangles":[57,39,53,58,53,39,58,25,53,54,53,25,54,41,53,57,53,41,58,52,25,58,39,52,52,51,24,52,39,51,49,31,48,49,48,29,48,47,29,48,4,47,47,46,45,47,4,46,47,45,28,46,3,45,45,44,27,45,3,44,44,42,27,56,43,41,56,42,43,44,3,42,43,42,3,56,26,42,54,26,41,56,41,26,43,2,41,57,41,2,51,40,37,51,39,40,57,2,39,40,39,2,55,23,34,50,37,36,50,24,37,51,37,24,40,1,37,38,34,36,34,23,36,50,36,23,37,1,36,38,36,1,55,34,21,35,21,34,38,22,34,35,34,22,54,25,33,54,33,26,49,30,31,48,31,4,49,29,30,32,5,30,31,30,5,32,30,17,47,28,29,30,29,17,45,27,28,29,28,17,42,26,27,28,27,18,33,18,26,27,26,18,52,24,25,33,25,19,50,23,24,25,24,19,55,13,23,24,23,13,35,22,0,35,0,21,55,21,13,21,20,13,21,0,20,33,19,14,24,13,19,33,14,18,15,17,18,28,18,17,32,17,16,32,16,6,17,15,16,16,15,7,18,14,15,15,14,9,19,12,14,20,11,13,19,13,12,14,12,10,13,11,12,12,11,10,14,10,9,15,9,8,15,8,7,16,7,6,32,6,5],"userEdges":[]}]},{"name":"D_MOUTH.02","display":[{"type":"mesh","name":"D_MOUTH.02","path":"shizuku_00","vertices":[-120.37,47.27,-113.44,-49.94,-105.36,-113.71,-58.04,-145.02,24.83,-151.81,74.6,-142.66,107.93,-103.24,126.29,-42.28,126.45,29.76,98.87,77.63,33.79,128.23,-43.27,119.99,-94.38,85.05,-90.63,25.4,-52.32,64.08,29.62,73.73,88.25,53.1,111.15,6.98,71.72,-65.81,21.7,-35.22,-55.92,-43.25,-80.28,-42.16,-101.53,-10.77,126.44,6.37,96.86,-20.59,110.82,-34.1,120.61,25.57,107.91,46.9,95.61,69.1,67.01,93.77,33.63,106.28,-7.48,113.09,121.47,48.78,-48.8,100.03,-77.55,83.06,-96.68,59.65,-109.28,41.36,-109.94,69.52,-114.39,29.83,-119.25,10.3,-23.01,-89.98,-83.92,61.01,-69.36,75.21,-73.75,43.06,-50.35,85.96,-32.69,95.22,13.71,98.26,33.46,95.78,52.29,88.68,75.12,78.01,58.28,67.28,90.81,59.89,99.92,47.13,108.11,24.83,102.12,29.27,116.51,16.42,-94.64,45.11,-101.42,33.82,-106.76,24.41,-96.18,6.99,72.94,103.42,-4.37,124.15,-73.42,105.2,14.06,120.99,12.84,109.73,-79.99,4.37,-53.48,29.54,-27.06,30.18,26.64,32.76,-14.78,68.5,64.26,21.26,82.05,8.51],"uvs":[0.722656,0.195313,0.707031,0.18457,0.707031,0.15918,0.728027,0.140137,0.765137,0.135742,0.80127,0.140625,0.810059,0.166992,0.804688,0.184082,0.791016,0.191895,0.780273,0.188151,0.763997,0.188151,0.747396,0.189128,0.734375,0.190755,0.729167,0.179362,0.744792,0.177083,0.764323,0.178385,0.780273,0.178711,0.792643,0.180013,0.787435,0.158203,0.76237,0.157552,0.733724,0.160482,0.718925,0.170024,0.717083,0.182205,0.798009,0.187898,0.790662,0.171715,0.799069,0.175209,0.791677,0.187069,0.785756,0.184544,0.780273,0.184326,0.771572,0.183758,0.764134,0.184065,0.754914,0.184357,0.786888,0.190456,0.746242,0.183789,0.738912,0.184801,0.732395,0.186424,0.72528,0.188885,0.729602,0.192612,0.720416,0.190045,0.71674,0.191245,0.748025,0.149219,0.734781,0.182495,0.741501,0.181402,0.735916,0.178378,0.745595,0.180798,0.750706,0.181333,0.759419,0.181498,0.764223,0.181386,0.768754,0.18167,0.775392,0.181542,0.771603,0.178534,0.780273,0.181274,0.783159,0.181782,0.788888,0.182484,0.786577,0.179374,0.792168,0.183479,0.731085,0.183559,0.726864,0.185005,0.722615,0.186713,0.723054,0.1808,0.771973,0.188151,0.755775,0.188635,0.74044,0.189997,0.759655,0.186337,0.75947,0.184212,0.730563,0.173577,0.74123,0.17174,0.750793,0.170416,0.763588,0.170551,0.753739,0.17768,0.773819,0.171083,0.782959,0.171021],"triangles":[70,71,18,68,50,70,71,70,16,69,68,67,69,15,68,70,19,68,69,67,14,68,19,67,67,66,14,67,20,66,66,65,43,66,20,65,64,63,30,64,31,63,63,31,61,63,61,10,59,58,57,59,22,58,58,36,57,59,57,13,57,35,56,57,56,13,56,35,41,55,53,26,54,52,53,55,17,53,54,53,17,54,16,52,53,52,27,49,28,51,52,51,28,52,16,51,70,50,16,68,15,50,50,48,49,51,16,49,50,49,16,50,15,48,49,48,29,48,47,30,48,15,47,47,46,30,64,30,46,64,46,31,47,15,46,69,45,15,46,15,45,46,45,31,69,14,45,45,44,33,45,14,44,44,42,33,66,43,14,65,13,43,43,41,42,44,14,42,43,42,14,43,13,41,56,41,13,42,41,34,62,11,34,58,38,36,39,0,38,58,22,38,39,38,22,37,35,36,57,36,35,38,0,36,37,36,0,41,35,34,37,12,35,42,34,33,35,12,34,62,34,12,45,33,31,34,11,33,60,9,29,33,11,31,61,31,11,48,30,29,63,10,30,49,29,28,30,10,29,60,29,10,52,28,27,29,9,28,32,26,27,53,27,26,28,9,27,32,27,9,55,26,23,32,8,26,25,6,24,71,16,24,54,24,16,54,17,24,25,24,17,71,24,18,55,23,17,26,8,23,59,21,22,39,22,1,65,20,21,22,21,1,59,13,21,65,21,13,40,19,4,40,3,20,21,20,2,67,19,20,40,20,19,70,18,19,4,19,18,24,6,18,25,17,7,23,7,17,25,7,6,18,6,5,18,5,4,40,4,3,20,3,2,21,2,1],"userEdges":[]}]},{"name":"D_NOSE.00","display":[{"type":"mesh","name":"D_NOSE.00","path":"shizuku_00","vertices":[-14.81,-73.47,114.81,-8.16,129.63,107.94,-37.04,133.33,-133.33,17.23,11.11,13.61],"uvs":[0.567057,0.132161,0.580404,0.13737,0.580078,0.152018,0.56543,0.154297,0.556966,0.14388,0.569661,0.143555],"triangles":[5,0,4,5,4,3,5,3,2,5,2,1,5,1,0],"userEdges":[]}]},{"name":"D_NOSE.01","display":[{"type":"mesh","name":"D_NOSE.01","path":"shizuku_00","vertices":[-41.21,-133.33,55.09,-42.63,47.68,117.01,-70.84,11.79,-6.83,-15.87,-58.59,-48.21,-30.86,47.28,52.16,20.5,14.48,-80.88,27.3,-30.62,18.87,46.77,-41.84,-0.74,-22.63,-69.86,-21.28,22.11,24.41,3.39],"uvs":[0.500651,0.125977,0.509115,0.134115,0.508464,0.148438,0.498047,0.138997,0.503673,0.136515,0.499124,0.133614,0.501561,0.142182,0.508857,0.139779,0.505546,0.130683,0.506672,0.135192,0.505931,0.142136,0.500595,0.137873,0.502284,0.131671,0.502402,0.139924,0.506418,0.138244],"triangles":[13,11,6,13,4,11,13,6,10,14,10,7,14,4,10,13,10,4,14,7,9,14,9,4,12,4,8,9,8,4,9,1,8,12,8,0,10,2,7,9,7,1,11,3,6,10,6,2,11,4,5,12,5,4,12,0,5,11,5,3],"userEdges":[]}]},{"name":"D_EAR.00","display":[{"type":"mesh","name":"D_EAR.00","path":"shizuku_00","vertices":[-45.78,-121.45,87.53,-147.7,142.76,-98.12,118,11.25,30.4,92.92,-150.53,145.41,-118.15,22.92,-76.26,-66.04,-0.08,1.04,47.54,-77.7,-72.56,122.79,-39.63,59.92],"uvs":[0.861979,0.01237,0.907552,0.000651,0.926432,0.022786,0.917969,0.071615,0.888021,0.108073,0.826172,0.13151,0.83724,0.076823,0.851563,0.037109,0.877604,0.067057,0.89388,0.031901,0.852827,0.12141,0.864083,0.093342],"triangles":[11,6,10,11,10,4,9,8,3,9,7,8,11,8,6,11,4,8,9,0,7,8,7,6,10,6,5,8,4,3,9,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_EAR.01","display":[{"type":"mesh","name":"D_EAR.01","path":"shizuku_00","vertices":[-107.28,-141.95,71.02,-124.7,150.27,35.22,126.06,141.83,4.99,116.74,-107.28,25.81,-153.51,-79.24,-30.23,-61.99,40.21,30.51],"uvs":[0.729167,0.010417,0.781901,0.017578,0.805339,0.083984,0.798177,0.128255,0.76237,0.117839,0.729167,0.080078,0.715495,0.036458,0.751953,0.04362,0.772786,0.082031],"triangles":[8,1,7,8,7,5,7,0,6,7,6,5,8,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_HAIR_FRONT.00","display":[{"type":"mesh","name":"D_HAIR_FRONT.00","path":"shizuku_02","vertices":[5.72,-163.71,93.5,-148.25,157.86,-82.19,173.08,10.57,170.73,110.37,147.33,156.75,116.9,115.99,85.3,65.39,73.6,87.88,43.17,68.2,20.35,97.01,-19.44,75.23,-73.86,85.07,-101.94,108.96,-132.37,151.13,-159.29,112.83,-166.31,10.57,-148.75,-87.81,-85.56,-144.03,-134.71,96.31,-104.28,55.55,-60.98,33.06,-9.78,20.41,32.06,31.66,4.74,55.3,71.26,14.79,141.48,93.5,116.9,49.93,172.51,62.69,108.71,-18.94,-161,61.61,-130.03,37.28,-94.92,-3.48,-132.37,-30.19,59.56,-59.7,19.48,-38.27,-44.6,-37.21,-96.09,-72.35,-34.07,-86.41,30.3,-93.44,85.3,-97.65],"uvs":[0.264323,0.643229,0.358073,0.653646,0.429688,0.708333,0.46224,0.800781,0.463542,0.891927,0.432292,0.940104,0.408854,0.89974,0.373698,0.852865,0.360677,0.873698,0.326823,0.855469,0.313802,0.878906,0.263021,0.861979,0.196615,0.871094,0.165365,0.893229,0.13151,0.932292,0.105469,0.895833,0.09375,0.802083,0.113281,0.710938,0.183594,0.658854,0.132813,0.88151,0.16276,0.84375,0.210938,0.822917,0.266927,0.811198,0.3125,0.821615,0.287647,0.841889,0.358073,0.80599,0.436198,0.878906,0.408854,0.838542,0.462911,0.847758,0.39974,0.77474,0.099659,0.849359,0.134115,0.826823,0.173177,0.789063,0.13151,0.764323,0.345052,0.736979,0.295573,0.757813,0.229167,0.757813,0.174479,0.723958,0.240885,0.708333,0.311198,0.703125,0.360677,0.695313],"triangles":[1,39,40,40,39,34,0,38,39,39,38,35,38,18,37,38,37,36,37,32,36,38,36,35,36,22,35,39,35,34,40,34,2,35,25,34,34,29,2,37,17,33,37,33,32,33,31,32,36,32,21,33,16,31,32,31,20,31,30,19,31,16,30,34,25,29,29,25,27,29,27,3,27,28,3,28,27,26,28,26,4,27,6,26,35,23,25,27,25,7,25,9,7,25,23,9,24,9,23,35,22,23,24,23,22,24,22,11,36,21,22,22,21,11,32,20,21,21,20,12,31,19,20,20,19,13,30,15,19,38,0,18,37,18,17,33,17,16,19,15,14,19,14,13,20,13,12,21,12,11,24,11,10,24,10,9,9,8,7,27,7,6,26,6,5,26,5,4,29,3,2,40,2,1,39,1,0],"userEdges":[]}]},{"name":"D_HAIR_SIDE.00","display":[{"type":"mesh","name":"D_HAIR_SIDE.00","path":"shizuku_02","vertices":[14.66,-166.1,-0.3,-107.56,14.12,-35.76,37.55,37.41,52.87,103.96,160.36,159.52,26.95,160.44,-74.57,126.59,-98.26,47.02,-124.8,-17.92,-141.37,-86.75,-69.41,-148.26,62.04,139.4,-14.55,100.07,-42.87,4.49,-79.21,-51.77,-80.27,-95.21,-29.78,43.75,-92.78,94.74,-118.58,12.48,27.28,0.33,-131.57,-49.92,1.55,-62.73,-112.54,-71.95,-40.18,-80.35,-31.39,-130.32,-65.55,-26.01,-62.81,69.05,6.27,65.77,14.05,116.08,87.9,130.22,76.8,159.25,95.73,149.29,54.24,124.28,7.47,135.15,-25.88,142.82,-35.94,109.52,44.4,67.2,26.13,82.05,16.67,101.87,-23.19,68.11,-95.46,71.45,-44.67,80.71,-0.35,76.68,-46.86,97.87,-25.5,120.77,47.06,148.38,119.05,142.82,73.78,135.23,113.03,159.37,40.36,128.87,69.48,116.41,18.43,149.38,-30.06,131.24,6.1,40.37,-2.88,20.86,-17.87,-13.17,-10.88,2.59,-67.2,45.53,-71.85,26.74,-82.77,8.7,-88.45,-7.98],"uvs":[0.06901,0.528646,0.063802,0.605469,0.065104,0.709635,0.079427,0.8125,0.092448,0.904948,0.140625,0.989583,0.065104,0.984375,0.033854,0.94401,0.02474,0.828125,0.007813,0.733073,0.001302,0.634115,0.027344,0.55599,0.085938,0.951823,0.057292,0.898438,0.044271,0.765625,0.028646,0.684896,0.027575,0.622073,0.052427,0.820214,0.029853,0.893134,0.015694,0.777331,0.071986,0.759063,0.004901,0.688822,0.0646,0.669293,0.013699,0.657137,0.046655,0.64421,0.044002,0.578597,0.035743,0.721566,0.038809,0.858516,0.069357,0.851597,0.06955,0.921283,0.113259,0.941509,0.095558,0.986475,0.108201,0.967195,0.089156,0.928652,0.063621,0.948475,0.048841,0.963369,0.04894,0.914678,0.085256,0.853887,0.079199,0.874338,0.07357,0.901452,0.054531,0.854044,0.027357,0.861404,0.045756,0.87352,0.065518,0.8665,0.045961,0.896248,0.05362,0.931426,0.077046,0.965716,0.125025,0.962178,0.098346,0.947139,0.115098,0.987823,0.078536,0.93803,0.102314,0.922281,0.064455,0.968669,0.050003,0.946433,0.066815,0.816103,0.061753,0.788935,0.053411,0.74106,0.056913,0.762632,0.037296,0.824537,0.034051,0.798328,0.029211,0.771794,0.023987,0.747514],"triangles":[61,60,14,61,19,60,60,19,59,60,59,14,59,58,17,59,8,58,57,20,56,57,56,14,57,55,20,57,14,55,55,17,54,55,54,3,52,46,34,52,6,46,53,34,45,53,45,7,44,42,18,44,13,42,42,40,27,43,28,40,42,13,40,43,40,13,39,38,13,43,13,38,39,4,38,43,38,28,38,37,28,45,29,36,44,18,36,45,36,7,44,36,13,52,34,35,53,35,34,53,7,35,52,35,6,50,29,34,45,34,29,46,12,34,50,34,12,51,33,30,48,30,33,50,33,29,51,4,33,50,12,33,48,33,12,48,32,30,47,30,32,49,32,31,49,5,32,47,32,5,48,12,32,32,12,31,46,31,12,46,6,31,39,29,4,33,4,29,39,13,29,36,29,13,54,17,28,40,28,17,37,3,28,54,28,3,58,27,17,40,17,27,41,18,27,42,27,18,58,8,27,41,27,8,56,2,26,61,26,9,61,14,26,56,26,14,24,15,22,24,22,1,23,21,15,23,10,21,55,3,20,56,20,2,61,9,19,59,19,8,36,18,7,55,14,17,59,17,14,24,16,15,23,15,16,25,11,16,24,1,16,25,16,1,23,16,10,26,15,9,21,9,15,22,15,2,26,2,15,25,0,11,16,11,10,25,1,0],"userEdges":[]}]},{"name":"D_HAIR_SIDE.01","display":[{"type":"mesh","name":"D_HAIR_SIDE.01","path":"shizuku_02","vertices":[-88.85,-172.54,24.54,-151.6,114.06,-105.18,126,-36.92,115.57,34.08,14.88,150.82,-127.6,158.78,-50.03,108.95,-50.04,-49.66,-85.86,-128.85,12.61,-99.72,-16.14,138.66,16.46,72.81,38.82,-2.96,48.69,-43.67,37.23,32.32,16.04,109.36,-37.53,154.39,-69.66,-93.02,-2.38,-24.61,115.36,-0.62,85.89,-19.83,62.01,-70.84,116.62,-72.68,-21.28,-72.64,27.06,-71.69,-59.93,-71.52,1.98,14.31,80.28,16.05,-12.26,51.66,118.25,71.03,72.56,52.84,-14.42,89.14,59.12,90.94,-30.63,-140.23,30.7,-127.41,-47.16,-117.4,-81.12,128.93,-35.23,121.92,51.42,128.27,57.33,137.6,-67.68,147.96,67.97,113.27,120.34,94.95,69.44,128.03,-28.31,147.61,-2.22,144.11,29.95,137.99,36.47,144.09,-11.49,152.61,68.46,71.9,75.26,33.17,76.78,-1.8,87.19,-40.31,-20.57,109.13,-14.28,70.64,-0.87,31.29,-9.09,-4.76,-10.32,-47.25,-151.88,145.67],"uvs":[0.450521,0.516927,0.5,0.546875,0.533854,0.613281,0.541667,0.710938,0.533854,0.8125,0.498698,0.980469,0.433594,0.990885,0.463542,0.916667,0.467448,0.692708,0.451823,0.579427,0.494792,0.621094,0.484188,0.955256,0.496464,0.867893,0.506226,0.759505,0.507606,0.702572,0.503574,0.809977,0.494327,0.921156,0.4729,0.984596,0.458891,0.63067,0.488247,0.728536,0.537672,0.762864,0.523837,0.735371,0.516349,0.662411,0.537574,0.659781,0.480003,0.659825,0.501097,0.661183,0.463133,0.661425,0.488195,0.784214,0.520408,0.786708,0.483931,0.837646,0.530142,0.866325,0.515084,0.840308,0.48201,0.889306,0.509219,0.892857,0.475924,0.563143,0.49748,0.58278,0.468711,0.595804,0.451536,0.946419,0.472554,0.933511,0.504615,0.94087,0.509505,0.958854,0.460794,0.97173,0.509826,0.923416,0.528025,0.89702,0.515625,0.940918,0.477766,0.971949,0.490698,0.966568,0.500069,0.957513,0.504196,0.969473,0.485717,0.982546,0.513667,0.867092,0.518275,0.811202,0.521822,0.761171,0.524565,0.706737,0.477267,0.918668,0.483049,0.864789,0.485875,0.808502,0.485317,0.756928,0.483606,0.696677,0.42,0.9745],"triangles":[48,47,46,48,40,47,49,46,45,49,5,46,48,46,5,47,11,46,49,45,17,46,11,45,44,43,42,43,33,42,44,42,39,45,41,17,45,11,41,44,39,40,47,40,39,42,16,39,47,39,11,54,38,16,54,7,38,41,11,37,38,37,11,38,7,37,59,6,37,41,37,6,35,34,10,36,10,34,35,1,34,36,34,9,50,33,30,43,30,33,42,33,16,50,12,33,54,16,32,55,32,12,55,7,32,54,32,7,51,15,31,50,30,31,50,31,12,51,31,4,31,30,4,56,29,15,55,12,29,52,28,20,51,28,15,51,4,28,52,13,28,56,15,27,57,27,13,25,24,14,58,14,24,26,24,18,26,8,24,58,24,8,25,10,24,53,22,14,25,14,22,23,2,22,53,3,22,23,22,3,25,22,10,53,14,21,52,20,21,52,21,13,53,21,3,28,4,20,21,20,3,58,19,14,57,13,19,58,8,19,24,10,18,36,18,10,36,9,18,41,6,17,39,16,11,38,11,16,33,12,16,32,16,12,31,15,12,29,12,15,28,13,15,27,15,13,21,14,13,19,13,14,35,10,2,22,2,10,34,0,9,35,2,1,34,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.03","display":[{"type":"mesh","name":"D_HAIR_TWIN.03","path":"shizuku_01","vertices":[-72.51,-133.33,109.94,-123.95,133.33,-32.83,119.3,62.31,95.91,133.33,-39.77,114.57,-133.33,38.19,-109.94,-40.87,-87.88,75.29,7.87,51.67,22.92,93.98,-0.58,2.84,125.28,21.74,11.77,-36.85,23.91,-86.25],"uvs":[0.670573,0.430339,0.695964,0.434896,0.699219,0.479167,0.697266,0.525391,0.69401,0.559896,0.67513,0.550781,0.662109,0.513672,0.665365,0.47526,0.668434,0.531698,0.681759,0.520222,0.683853,0.540776,0.680583,0.496495,0.698098,0.50568,0.682302,0.477215,0.683992,0.453212],"triangles":[14,7,13,14,13,2,13,7,11,12,11,9,12,2,11,13,11,2,10,9,8,10,3,9,12,9,3,11,6,9,9,6,8,10,8,5,14,0,7,11,7,6,10,5,4,10,4,3,14,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.02","display":[{"type":"mesh","name":"D_HAIR_TWIN.02","path":"shizuku_02","vertices":[-59.3,-145.66,-17.56,-98.97,3.31,-41.82,-6.18,14.52,-36.53,58.79,3.31,98.23,86.78,110.3,158.88,118.35,88.68,137.67,-4.28,136.86,-93.45,120.76,-125.7,75.69,-108.63,17.74,-78.27,-34.58,-72.58,-86.09,-44.65,-70.25,-50.25,-13.32,-62.28,43.23,-62.1,86.63],"uvs":[0.764334,0.530345,0.785922,0.586946,0.796791,0.656263,0.792033,0.724631,0.776507,0.77837,0.797102,0.826184,0.840098,0.840754,0.877225,0.850452,0.841135,0.873955,0.793282,0.873066,0.747348,0.853619,0.730646,0.798962,0.739306,0.728634,0.754815,0.665129,0.75763,0.602623,0.772044,0.621825,0.769284,0.690893,0.76322,0.759519,0.763406,0.812177],"triangles":[18,10,5,17,11,4,18,4,11,16,12,3,17,3,12,15,13,2,16,2,13,15,1,14,15,14,13,16,13,12,17,12,11,18,11,10,5,10,9,6,9,8,8,7,6,9,6,5,18,5,4,17,4,3,16,3,2,15,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.11","display":[{"type":"mesh","name":"D_HAIR_TWIN.11","path":"shizuku_02","vertices":[-88.89,-154.22,25.4,-141.66,50.79,-93.67,60.32,-39.02,38.1,23,9.52,73.96,15.87,112.35,133.33,141.15,-19.05,138.2,-130.16,112.35,-133.33,60.66,-98.41,3.07,-82.54,-53.05,-88.89,-112.86,-24.5,-129.09,-17.53,-72.85,-17.87,-18.29,-42.45,40.7,-51.05,90.61],"uvs":[0.693359,0.5,0.728516,0.516602,0.736328,0.580078,0.739258,0.652344,0.732422,0.734375,0.723633,0.801758,0.725586,0.852539,0.761719,0.890625,0.714844,0.886719,0.680664,0.852539,0.679688,0.78418,0.69043,0.708008,0.695313,0.633789,0.693359,0.554688,0.713165,0.533231,0.715311,0.607601,0.715205,0.679764,0.707646,0.757774,0.705001,0.823778],"triangles":[18,9,6,17,10,5,18,5,10,16,11,4,17,4,11,15,12,3,16,3,12,14,13,2,15,2,13,14,0,13,15,13,12,16,12,11,17,11,10,18,10,9,6,9,8,8,7,6,18,6,5,17,5,4,16,4,3,15,3,2,14,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.12","display":[{"type":"mesh","name":"D_HAIR_TWIN.12","path":"shizuku_02","vertices":[-119.52,-153.4,-54.92,-145.2,-28.13,-107.57,-21.83,-68.59,-17.1,-23.44,-10.8,14.18,11.26,58.64,56.96,94.89,112.11,100.37,164.1,99,131.01,120.89,64.84,128.41,15.99,116.78,-23.4,102.42,-69.1,74.37,-95.89,25.12,-116.37,-34.39,-121.1,-88.42,-124.25,-131.52,-39,43.3,-6.07,80.53,-53.02,-1.3,-68.63,-51.65,-76.67,-97.57],"uvs":[0.604492,0.581055,0.644531,0.592773,0.661133,0.646484,0.665039,0.702148,0.667969,0.766602,0.671875,0.820313,0.685547,0.883789,0.713867,0.935547,0.748047,0.943359,0.780273,0.941406,0.759766,0.972656,0.71875,0.983398,0.688477,0.966797,0.664063,0.946289,0.635742,0.90625,0.619141,0.835938,0.606445,0.750977,0.603516,0.673828,0.601563,0.612305,0.654397,0.861881,0.674805,0.915039,0.645708,0.798212,0.63603,0.726322,0.631048,0.660762],"triangles":[23,2,18,22,3,17,23,17,3,21,4,16,22,16,4,19,5,15,21,15,5,20,6,14,19,14,6,20,13,7,23,18,17,22,17,16,21,16,15,19,15,14,20,14,13,7,13,12,7,12,11,7,11,10,10,9,8,10,8,7,20,7,6,19,6,5,21,5,4,22,4,3,23,3,2,18,2,1,18,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.13","display":[{"type":"mesh","name":"D_HAIR_TWIN.13","path":"shizuku_02","vertices":[-45.94,-146.74,18.33,-124.64,64.74,-80.45,104.02,-29.35,132.58,21.75,141.51,72.16,121.87,112.21,59.39,134.99,-44.16,139.83,-42.37,117.73,32.61,91.49,59.39,47.3,34.39,-6.56,-1.31,-56.28,-40.59,-99.79,-104.86,135.46,-141.75,114.28],"uvs":[0.893555,0.585938,0.928711,0.617188,0.954102,0.679688,0.975586,0.751953,0.991211,0.824219,0.996094,0.895508,0.985352,0.952148,0.951172,0.984375,0.894531,0.991211,0.895508,0.959961,0.936523,0.922852,0.951172,0.860352,0.9375,0.78418,0.917969,0.713867,0.896484,0.652344,0.861328,0.985026,0.841146,0.955078],"triangles":[9,16,15,2,14,13,3,13,12,4,12,11,5,11,10,7,10,9,15,8,9,9,8,7,10,7,6,10,6,5,11,5,4,12,4,3,13,3,2,14,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.14","display":[{"type":"mesh","name":"D_HAIR_TWIN.14","path":"shizuku_02","vertices":[-133.33,-154.13,-62.37,-151.56,-8.6,-112.09,43.01,-59.76,83.87,-6.56,129.03,56.07,133.33,101.54,90.32,136.71,2.15,138.43,-68.82,112.69,-62.37,90.39,10.75,101.54,55.91,89.53,51.61,50.92,-6.45,-9.14,-58.06,-61.47,-116.13,-118.1,53.76,116.98,-32.31,112.77],"uvs":[0.773438,0.507813,0.816406,0.511719,0.848958,0.571615,0.880208,0.651042,0.904948,0.731771,0.932292,0.826823,0.934896,0.895833,0.908854,0.949219,0.855469,0.951823,0.8125,0.91276,0.816406,0.878906,0.860677,0.895833,0.888021,0.877604,0.885417,0.81901,0.85026,0.727865,0.81901,0.648438,0.783854,0.5625,0.886719,0.919271,0.834602,0.912871],"triangles":[18,8,11,11,8,17,17,6,12,2,16,15,3,15,14,4,14,13,5,13,12,17,12,11,18,11,10,18,10,9,18,9,8,17,8,7,17,7,6,12,6,5,13,5,4,14,4,3,15,3,2,16,2,1,16,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.15","display":[{"type":"mesh","name":"D_HAIR_TWIN.15","path":"shizuku_02","vertices":[-124.49,-153.6,-30.3,-154.72,16.53,-130.3,29.75,-92.4,36.36,-41.88,29.75,19.59,20.94,79.38,25.34,118.11,62.81,147.59,133.33,148.43,73.83,168.64,-20.94,166.11,-78.24,140.01,-95.87,95.38,-82.64,33.06,-65.01,-34.3,-76.03,-92.4,-133.33,-126.09,-58.4,-132.82,-16.83,-63.85,-23.63,-4.1,-30.32,56.46,-36.52,106.51,-20.41,-115.18,-18.73,-92.4,-17.12,-37.88,-24.3,26.07,-36.54,87.25,-0.51,144.92,-23.38,128.41,25.89,155.75],"uvs":[0.507826,0.49913,0.563478,0.497391,0.591146,0.535156,0.598958,0.59375,0.602865,0.671875,0.598958,0.766927,0.59375,0.859375,0.596354,0.919271,0.61849,0.964844,0.660156,0.966146,0.625,0.997396,0.56901,0.99349,0.535156,0.953125,0.52474,0.884115,0.532552,0.78776,0.542969,0.683594,0.536458,0.59375,0.502604,0.541667,0.546875,0.53125,0.571438,0.637911,0.56742,0.730294,0.563467,0.823937,0.559803,0.901327,0.569323,0.558538,0.570313,0.59375,0.571267,0.678057,0.567022,0.776946,0.559789,0.87155,0.581082,0.960725,0.567569,0.935195,0.596676,0.977473],"triangles":[30,8,28,29,12,28,30,28,11,29,28,7,24,3,23,24,23,16,29,22,12,27,22,6,29,7,22,27,13,22,26,21,5,27,21,13,27,6,21,26,14,21,26,5,20,25,15,20,26,20,14,25,20,4,25,4,19,24,16,19,25,19,15,24,19,3,30,10,8,23,2,18,23,18,16,18,0,17,18,17,16,19,16,15,20,15,14,21,14,13,22,13,12,28,12,11,30,11,10,10,9,8,28,8,7,22,7,6,21,6,5,20,5,4,19,4,3,23,3,2,18,2,1,18,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.01","display":[{"type":"mesh","name":"D_HAIR_TWIN.01","path":"shizuku_01","vertices":[-68.28,-112.72,151.09,-135.68,118.18,-37.6,90.76,64.66,30.44,135.61,-128.6,91.79,-95.7,-6.29,-34.55,80.16,-111.86,41.87,-4.55,28.39,19.94,-23.22,105.21,10.79,-83.25,-54.61,26.82,-74.41,60.42,-126.19,135.09,-87.99],"uvs":[0.616211,0.441406,0.655273,0.430664,0.649414,0.476563,0.644531,0.524414,0.633789,0.557617,0.605469,0.537109,0.611328,0.491211,0.622217,0.531666,0.608451,0.513749,0.627559,0.507441,0.63192,0.483291,0.647104,0.499204,0.613545,0.468602,0.633144,0.459336,0.639129,0.435104,0.652425,0.45298],"triangles":[15,14,13,15,1,14,15,13,2,14,0,13,13,12,10,13,0,12,11,10,9,12,6,10,11,2,10,13,10,2,11,9,3,10,6,9,9,8,7,9,6,8,8,5,7,9,7,3,7,5,4,7,4,3],"userEdges":[]}]},{"name":"D_HAIR_TWIN.00","display":[{"type":"mesh","name":"D_HAIR_TWIN.00","path":"shizuku_02","vertices":[88.14,-141.13,92.66,-103.68,79.1,-62.57,106.21,-11.42,133.33,39.73,119.77,97.28,61.02,135.64,-133.33,166.7,-88.14,126.51,-51.98,70.79,-51.98,15.07,-106.21,-53.44,-47.46,-120.12,-74.99,-88.88,9.8,106.25,39.4,55.47,-74.65,-13.57,-3.46,-33.11,-25.38,130.35,33.79,84.02,54.23,29.2],"uvs":[0.71875,0.059896,0.720052,0.113281,0.716146,0.171875,0.723958,0.244792,0.731771,0.317708,0.727865,0.39974,0.710938,0.454427,0.654948,0.498698,0.667969,0.441406,0.678385,0.361979,0.678385,0.282552,0.66276,0.184896,0.679688,0.089844,0.671757,0.134379,0.696184,0.412527,0.704711,0.340148,0.671853,0.241722,0.692362,0.213867,0.686047,0.446885,0.703093,0.380835,0.708982,0.302701],"triangles":[17,16,3,17,11,16,20,10,15,19,5,15,20,15,4,19,15,9,19,14,5,18,14,8,19,9,14,18,6,14,1,12,13,13,11,2,17,2,11,16,10,3,20,3,10,15,10,9,14,9,8,18,8,7,18,7,6,14,6,5,15,5,4,20,4,3,17,3,2,13,2,1,12,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.04","display":[{"type":"mesh","name":"D_HAIR_TWIN.04","path":"shizuku_02","vertices":[11.17,-118.92,10.14,-102.21,44.63,-71.54,18.34,-24.57,53.67,18.4,133.33,59.41,126.99,109.42,64.34,145.39,-32.92,157.24,-100.43,152.93,-133.33,130.1,-64.73,130.67,0.36,114.84,16.92,72.62,-17.99,35.31,-76.24,-7.63,-88.51,-58.14,-23.91,-107.86,-13.7,-130.54,70.8,90.64,50.2,46.17,-5.5,6.54,-16.18,135.91,-31.64,-40.27,-54.76,-84.12,71.49,66.43,62.88,112.17,26.02,127.09,-83.12,142.14],"uvs":[0.621094,0.008789,0.625,0.064453,0.607422,0.130859,0.601563,0.205078,0.624023,0.270508,0.666992,0.331055,0.670898,0.40918,0.646484,0.467773,0.602539,0.490234,0.570313,0.486328,0.551758,0.452148,0.583984,0.450195,0.612305,0.422852,0.614258,0.356445,0.592773,0.299805,0.55957,0.235352,0.546875,0.157227,0.570313,0.077148,0.597656,0.030273,0.641983,0.382258,0.626216,0.313886,0.594671,0.254497,0.607451,0.456342,0.575982,0.182695,0.55912,0.115388,0.638981,0.344542,0.641231,0.416102,0.626013,0.440869,0.576943,0.468804],"triangles":[27,7,26,27,26,12,27,22,7,27,12,22,25,20,13,25,5,20,25,19,5,26,19,12,25,13,19,26,6,19,24,2,17,24,16,2,23,2,16,23,15,3,21,3,15,21,14,4,20,4,14,22,11,8,28,8,11,1,18,17,23,16,15,21,15,14,20,14,13,19,13,12,22,12,11,28,11,10,28,10,9,28,9,8,22,8,7,26,7,6,19,6,5,20,5,4,21,4,3,23,3,2,17,2,1,18,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.05","display":[{"type":"mesh","name":"D_HAIR_TWIN.05","path":"shizuku_02","vertices":[113.58,-163.03,108.64,-92.92,54.32,-17.53,24.69,51.25,34.57,100.19,133.33,125.32,29.63,134.58,-74.07,121.35,-133.33,73.74,-118.52,-5.63,-64.2,-78.37,4.94,-140.54,-7.6,-49.32,48.88,-120.36,-47.9,22.42],"uvs":[0.81913,0.10087,0.817391,0.193043,0.798261,0.292174,0.787826,0.382609,0.791304,0.446957,0.826087,0.48,0.789565,0.492174,0.753043,0.474783,0.732174,0.412174,0.737391,0.307826,0.756522,0.212174,0.78087,0.130435,0.776455,0.250379,0.796346,0.156966,0.762261,0.344702],"triangles":[13,10,1,12,1,10,12,9,2,14,2,9,14,8,3,13,0,11,13,11,10,12,10,9,14,9,8,4,8,7,4,7,6,6,5,4,8,4,3,14,3,2,12,2,1,13,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.06","display":[{"type":"mesh","name":"D_HAIR_TWIN.06","path":"shizuku_02","vertices":[25.83,-125.3,21,-87.97,20.41,-29.4,22.03,30.47,41.46,88.41,130.07,124.53,85.42,140.59,-14.7,143.08,-105.73,126.27,-134.34,95.34,-109.41,50.31,-79.94,-4.38,-54.94,-57.14,-50.12,-93.83,-34.29,-118.92,23.34,120.58,-43.2,101.86,-42.88,69.67],"uvs":[0.955078,0.099609,0.953125,0.15625,0.953125,0.245117,0.954102,0.335938,0.962891,0.423828,1.001953,0.478516,0.982422,0.50293,0.938477,0.506836,0.898438,0.481445,0.885742,0.43457,0.896484,0.366211,0.90918,0.283203,0.919922,0.203125,0.921875,0.147461,0.928711,0.109375,0.955078,0.472656,0.925781,0.444336,0.925781,0.395508],"triangles":[3,10,17,17,16,4,17,9,16,16,8,15,16,15,4,1,14,13,1,13,12,2,12,11,3,11,10,17,10,9,16,9,8,15,8,7,15,7,6,15,6,5,15,5,4,17,4,3,11,3,2,12,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.07","display":[{"type":"mesh","name":"D_HAIR_TWIN.07","path":"shizuku_02","vertices":[90.91,-142.99,127.41,-88.66,130.45,7.14,90.91,97.22,-6.41,138.69,-109.82,138.69,-143.28,111.52,-58.12,110.09,-0.33,72.92,30.08,-0.01,51.37,-87.23,86.58,-45.22,58.78,43.19,5.83,104.57,90.38,-87.96,82.67,3.74,36.37,82.69,-33.94,123.46,-76.6,120.31],"uvs":[0.652174,0.026087,0.718261,0.005217,0.834783,0.003478,0.944348,0.026087,0.994783,0.081739,0.994783,0.14087,0.961739,0.16,0.96,0.111304,0.914783,0.078261,0.826087,0.06087,0.72,0.048696,0.771096,0.028567,0.878626,0.044463,0.953284,0.074738,0.719108,0.026392,0.830643,0.030803,0.926674,0.057277,0.976265,0.097479,0.972434,0.121873],"triangles":[18,5,17,18,17,7,17,4,13,16,8,13,17,13,7,16,13,3,16,3,12,15,9,12,16,12,8,15,12,2,15,11,9,14,11,1,15,2,11,14,10,11,14,0,10,11,10,9,12,9,8,13,8,7,18,7,6,18,6,5,17,5,4,13,4,3,12,3,2,11,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.08","display":[{"type":"mesh","name":"D_HAIR_TWIN.08","path":"shizuku_02","vertices":[41.06,-154.1,35.32,-113.1,49.54,-63.58,73.92,-8.85,118.61,41.53,138.93,83.23,120.64,121.45,65.79,127.53,-7.34,152.73,-90.63,157.94,-137.35,130.14,-64.22,129.27,-3.28,101.47,21.1,53.69,0.79,-0.17,-27.65,-50.55,-58.12,-100.94,-37.81,-155.66,73.92,91.92,51.57,23.29,-2.7,-135.23,-1.26,-81.21,23.3,-29.63,-5.34,127.47,-4.85,-107.87,12.68,-57.36,41.33,-4.98,65.1,48.21],"uvs":[0.539063,0.016927,0.533854,0.088542,0.542969,0.16276,0.558594,0.244792,0.58724,0.320313,0.60026,0.382813,0.588542,0.440104,0.553385,0.449219,0.50651,0.486979,0.453125,0.494792,0.423177,0.453125,0.470052,0.451823,0.509115,0.410156,0.52474,0.338542,0.511719,0.257813,0.49349,0.182292,0.473958,0.106771,0.486979,0.02474,0.558594,0.395833,0.544271,0.292969,0.509485,0.055372,0.510404,0.13634,0.52615,0.213646,0.507793,0.44913,0.508103,0.096379,0.519341,0.172087,0.537708,0.250593,0.55294,0.330317],"triangles":[26,22,14,25,22,2,25,15,22,26,3,22,25,21,15,24,21,1,24,16,21,25,2,21,24,20,16,24,1,20,26,14,19,26,19,3,27,4,19,27,19,13,27,18,4,27,13,18,18,12,7,23,7,12,23,11,8,20,0,17,20,17,16,21,16,15,22,15,14,19,14,13,18,13,12,23,12,11,11,10,9,11,9,8,23,8,7,18,7,6,18,6,5,18,5,4,19,4,3,22,3,2,21,2,1,20,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.09","display":[{"type":"mesh","name":"D_HAIR_TWIN.09","path":"shizuku_02","vertices":[112.48,-152.51,133.33,-137.63,118.63,-94.27,78.74,-47.42,43.04,-3.36,19.95,44.2,13.65,87.56,45.14,114.13,97.64,139.31,17.85,142.11,-55.64,128.12,-133.33,96.65,-122.83,45.6,-80.84,-1.96,-38.85,-46.02,3.15,-95.67,45.14,-147.42,-53.24,66.99,-26.45,22.95,3.3,-24.06,42.72,-70.41,83.36,-119.78,-19.06,106.71,98.69,-141.48,63.89,-94.94,20.32,-46.72,-15.75,-2.69,-42.81,44.81,-45.21,91.2,-0.48,120.47,30.78,128.86],"uvs":[0.90918,0.080078,0.919922,0.112305,0.913086,0.172852,0.894531,0.238281,0.87793,0.299805,0.867188,0.366211,0.864258,0.426758,0.878906,0.463867,0.90332,0.499023,0.866211,0.50293,0.832031,0.483398,0.795898,0.439453,0.800781,0.368164,0.820313,0.301758,0.839844,0.240234,0.859375,0.170898,0.878906,0.098633,0.833148,0.398041,0.845608,0.336539,0.859446,0.270895,0.87778,0.206175,0.896682,0.137232,0.849046,0.453495,0.903809,0.106934,0.887622,0.171926,0.867362,0.239252,0.850584,0.300732,0.838002,0.367069,0.836882,0.431842,0.857688,0.472708,0.872225,0.484425],"triangles":[30,29,9,30,7,29,29,7,22,28,11,22,28,22,6,29,22,10,23,21,1,24,21,15,23,16,21,24,2,21,24,20,2,25,20,14,24,15,20,25,3,20,25,19,3,26,19,13,25,14,19,26,4,19,26,18,4,27,18,12,26,13,18,27,5,18,27,17,5,28,17,11,27,12,17,28,6,17,23,0,16,21,16,15,20,15,14,19,14,13,18,13,12,17,12,11,22,11,10,29,10,9,30,9,8,30,8,7,22,7,6,17,6,5,18,5,4,19,4,3,20,3,2,21,2,1,23,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.10","display":[{"type":"mesh","name":"D_HAIR_TWIN.10","path":"shizuku_02","vertices":[25.62,-150.51,134.82,-147.54,115.68,-131.8,43.21,-114.96,-6.12,-91.83,-47.49,-85.33,-41.84,-114.29,-7.95,-138.86,64.59,-137,15.2,-128.12,-16.27,-102.62],"uvs":[0.038574,0.466797,0.086426,0.471191,0.078125,0.495117,0.045898,0.521484,0.024902,0.556152,0.004883,0.565918,0.010742,0.522461,0.023438,0.484863,0.055664,0.487305,0.033541,0.501336,0.01879,0.54161],"triangles":[10,3,6,9,6,3,9,8,7,9,3,8,8,0,7,9,7,6,10,6,5,10,5,4,10,4,3,8,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_HAIR_BACK.00","display":[{"type":"mesh","name":"D_HAIR_BACK.00","path":"shizuku_02","vertices":[-6.8,-166.63,54.47,-165.66,126.13,-136.27,154.57,-67.37,152.79,22.85,118.35,85.24,64.19,120.29,48.73,139.82,7.42,150.42,-48.93,141.75,-70.25,118.62,-122.49,87.06,-154.5,21.29,-161.6,-63.63,-132.06,-134.34,-76.82,-164.7,-2.42,107.06,47.9,57.91,94.95,12.62,-61.5,64.65,-107.45,10.69,-103.08,-55.8,-4.61,35.74,-51.66,-6.66,35.87,-5.69,69.78,-72.19,-2.42,-73.15,-58.22,-77,-115.11,-96.28,101.51,-103.99,34.77,-118.44,-45.09,-124.22,124.08,-25.31,-130.13,-15.24,-100.03,-130.61,-132.33,-59.72,-130.44,15.87,-116.54,56.86,-141.15,48.71,-96.06,77.35,-61.57,-145.25,-32.51,-138.15,-3.38,-121.2,20.02,-135.54,74.25,-139.73,96.18,-148.56,114.87,-121.51,135.97,-112.44,43.64,-139.7,-147.73,-42.31,-143.26,4.44,-157.9,-19.39,-143.42,18.79,-147.77,35.11,-138.13,39.46,-130.37,52.28,-133.49,64.44,-119.67,72.72,79.91,70.33,105.8,46.3,121.53,17.32,72.4,34.33,34.08,114.31,56.68,91.52],"uvs":[0.238261,0.001739,0.335652,0.003478,0.452174,0.053913,0.492174,0.18087,0.493913,0.333913,0.452174,0.44,0.368696,0.507826,0.330435,0.554783,0.26087,0.573913,0.163478,0.558261,0.137391,0.516522,0.06087,0.455652,0.003478,0.34087,0,0.189565,0.041739,0.062609,0.126957,0.005217,0.245217,0.495652,0.325217,0.406957,0.4,0.325217,0.151304,0.41913,0.078261,0.321739,0.085217,0.201739,0.241739,0.366957,0.166957,0.290435,0.306087,0.292174,0.36,0.172174,0.245217,0.170435,0.156522,0.163478,0.066087,0.128696,0.410435,0.114783,0.304348,0.088696,0.177391,0.078261,0.443711,0.256765,0.042207,0.274949,0.091707,0.068374,0.042613,0.195653,0.041722,0.331086,0.067745,0.402708,0.027404,0.388721,0.100053,0.439828,0.151189,0.040313,0.197386,0.053125,0.243695,0.08371,0.280897,0.057839,0.367096,0.050279,0.403475,0.032834,0.433088,0.081746,0.466011,0.097832,0.318443,0.050326,0.018598,0.227188,0.021342,0.310463,0.001812,0.268389,0.021082,0.336366,0.015535,0.364983,0.031437,0.372487,0.045073,0.394847,0.041135,0.416183,0.064134,0.430517,0.382911,0.421973,0.424199,0.378455,0.443165,0.329214,0.364155,0.364397,0.31287,0.502322,0.348639,0.461294],"triangles":[63,17,62,63,62,6,60,59,4,61,58,59,60,18,59,61,59,18,63,6,58,59,58,5,61,17,58,63,58,17,57,55,56,57,56,11,57,37,55,56,55,38,55,37,54,55,54,38,54,52,53,54,53,38,54,36,52,53,52,12,52,36,50,51,50,49,51,12,50,52,50,12,50,33,49,51,49,13,47,2,46,47,46,29,46,45,44,46,2,45,48,30,44,46,44,29,45,1,44,48,44,1,48,1,43,48,43,30,43,41,42,43,42,30,42,41,31,43,0,41,41,0,40,41,40,31,57,39,37,57,11,39,39,19,37,54,37,36,50,36,33,37,20,36,49,33,35,49,35,13,40,15,34,40,34,31,36,20,33,35,33,21,60,4,32,60,32,18,34,28,31,42,31,26,44,30,29,42,26,30,47,29,3,30,25,29,31,28,27,34,14,28,35,28,13,35,21,28,28,21,27,31,27,26,27,23,26,23,24,26,30,26,25,26,24,25,32,25,18,32,3,25,29,25,3,25,24,18,61,18,24,61,24,17,27,21,23,24,23,22,23,19,22,24,22,17,33,20,21,23,21,20,37,19,20,23,20,19,39,10,19,22,19,16,22,16,17,62,17,16,19,10,16,62,16,7,40,0,15,34,15,14,28,14,13,39,11,10,16,10,9,16,9,8,16,8,7,62,7,6,58,6,5,59,5,4,32,4,3,43,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.13","display":[{"type":"mesh","name":"D_CLOTHES.13","path":"shizuku_01","vertices":[32.55,-158.8,76.4,-131.65,95.57,-78.03,105.28,-14.22,111.03,47.56,127.32,97.95,115.07,135.22,35.68,150.64,-57.92,142.75,-96.6,117.15,-137.39,63.13,-141.3,-4.73,-139.35,-70.83,-114.92,-110.83,-44.51,-155.02,31.64,120.35,-15.18,77.15,-1.58,25.14,-14.68,-31.01,-23.32,-95.63,-8.42,-4.2],"uvs":[0.295573,0.309896,0.329427,0.356771,0.334635,0.442708,0.342448,0.545573,0.352865,0.647135,0.363281,0.729167,0.354167,0.809896,0.303385,0.821615,0.244792,0.802083,0.220052,0.760417,0.209635,0.671875,0.200521,0.5625,0.192708,0.454427,0.208333,0.389323,0.255208,0.326823,0.302083,0.765625,0.272135,0.695313,0.27474,0.611979,0.268229,0.505208,0.266927,0.414063,0.271338,0.556197],"triangles":[14,19,1,19,12,18,19,18,2,20,3,18,20,18,11,20,11,17,20,17,3,17,16,4,17,10,16,16,9,15,16,15,5,19,14,13,19,13,12,18,12,11,17,11,10,16,10,9,15,9,8,15,8,7,15,7,6,15,6,5,16,5,4,17,4,3,18,3,2,19,2,1,14,1,0],"userEdges":[]}]},{"name":"D_HAIR_TWIN.30","display":[{"type":"mesh","name":"D_HAIR_TWIN.30","path":"shizuku_01","vertices":[-0.7,-144.64,116.64,-99.99,156.31,47.83,112.95,130.55,-24.52,114.3,-127.7,22.79,-106.1,-107.36,-15.96,-19.8,83.29,33.51],"uvs":[0.455078,0.754557,0.507161,0.742839,0.555339,0.770833,0.552734,0.818359,0.50651,0.839193,0.44987,0.832682,0.432943,0.783203,0.477214,0.791667,0.520182,0.788411],"triangles":[8,7,4,8,1,7,7,0,6,7,6,5,7,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.14","display":[{"type":"mesh","name":"D_CLOTHES.14","path":"shizuku_01","vertices":[-116.28,-135.59,-49.18,-131.75,32.44,-85.88,103.95,-61.89,167.78,-24.19,182.77,95.42,134.64,158.2,74.9,158.92,-5.46,91.39,-77.66,71.82,-112.59,-2.82,131.16,86.48,52.26,28.9,-30.94,7.36,-95.45,-30.04,-64.92,-25.64,14.09,-3.49,94.42,53.64,-11.99,-103.64,0.01,-38.2,66.57,-73.21,41.55,-33.1,81.2,-10.49,125.04,33.69,133.27,-44.27,34.84,121.88,63.33,92.46,105.46,114.5,23.15,56.79,-36.92,79.25,-17.5,52.68,-55,31.77,-83.57,-143.46,-72.76,-81.28,-39.72,-66.52,-117.31,-53.88,-107.96,-84.84,154.88,103.5,179.68,67.69,168.64,132.66],"uvs":[0.001739,0.878261,0.097391,0.864348,0.217391,0.852174,0.335652,0.84,0.429565,0.873043,0.452174,0.949565,0.410435,0.982609,0.32,0.993043,0.198261,0.987826,0.090435,0.986087,0.024348,0.968696,0.382609,0.925217,0.265497,0.918218,0.146236,0.92414,0.049947,0.936867,0.093605,0.9306,0.208131,0.917836,0.327683,0.917924,0.152381,0.858769,0.181005,0.888976,0.266915,0.847076,0.239512,0.882543,0.298205,0.881751,0.365137,0.893509,0.377858,0.85485,0.259547,0.990453,0.292137,0.954791,0.35539,0.954705,0.231652,0.953258,0.1503,0.987053,0.173219,0.957171,0.116478,0.957175,0.043396,0.872202,0.072486,0.902415,0.120494,0.892628,0.014944,0.931079,0.024313,0.905703,0.417113,0.937294,0.442476,0.916743,0.43044,0.966771],"triangles":[38,4,37,39,37,6,39,5,37,38,37,5,36,35,14,36,0,35,36,14,32,33,32,14,33,1,32,36,32,0,30,13,29,31,29,13,31,9,29,30,29,8,26,12,25,28,25,12,28,8,25,26,25,7,24,23,4,24,3,23,21,12,20,22,20,12,22,3,20,21,20,2,34,13,18,19,18,13,19,2,18,34,18,1,23,17,11,27,11,17,22,12,17,26,17,12,23,3,17,22,17,3,26,7,17,27,17,7,21,16,12,28,12,16,19,13,16,30,16,13,21,2,16,19,16,2,30,8,16,28,16,8,34,15,13,31,13,15,33,14,15,34,1,15,33,15,1,31,15,9,35,10,14,15,14,9,23,11,4,37,4,11,37,11,6,27,6,11,14,10,9,27,7,6],"userEdges":[]}]},{"name":"D_CLOTHES.15","display":[{"type":"mesh","name":"D_CLOTHES.15","path":"shizuku_01","vertices":[82.93,-106,115.14,-21.06,133.33,85.49,121.58,146.56,25.28,115.48,-51.18,95.98,-93.69,14.78,-130.95,-65.08,-133.33,-122.56,-56.54,-138.75,-76.64,-69.56,-10.62,17.86,44.01,-57.12,67.36,50.01,-26.17,-64.26],"uvs":[0.377604,0.182943,0.409505,0.164714,0.453125,0.151042,0.479167,0.154297,0.470703,0.203776,0.466146,0.242839,0.434245,0.267578,0.399089,0.298177,0.375651,0.294922,0.371745,0.246094,0.397786,0.257813,0.431641,0.225911,0.397786,0.201823,0.441406,0.185547,0.398093,0.237216],"triangles":[13,1,12,13,12,11,14,11,12,14,12,9,13,11,4,14,10,11,11,10,6,14,9,10,12,0,9,10,9,8,10,8,7,10,7,6,11,6,5,11,5,4,13,4,3,13,3,2,13,2,1,12,1,0],"userEdges":[]}]},{"name":"D_HAND.07","display":[{"type":"mesh","name":"D_HAND.07","path":"shizuku_00","vertices":[122.95,-169.04,-5.89,-97.49,-155.18,23.02,-79.51,135.99,51.37,98.33,141.35,41.85,-49.86,41.96,84.11,-23.96,23.99,4.69,132.76,-56.55,-117.73,78.93,-27.02,120.89,-72.06,-44.07,101.12,67.1,68.42,-138.76],"uvs":[0.51888,0.630208,0.477865,0.642578,0.430339,0.663411,0.454427,0.682943,0.496094,0.676432,0.52474,0.666667,0.463866,0.666687,0.506516,0.65529,0.487376,0.660243,0.522006,0.649656,0.442261,0.673078,0.471139,0.680331,0.456798,0.651813,0.511931,0.671033,0.501522,0.635443],"triangles":[9,7,5,13,5,7,14,1,7,8,7,1,9,0,7,14,7,0,8,4,7,13,7,4,8,6,4,11,4,6,12,2,6,10,6,2,8,1,6,12,6,1,10,3,6,11,6,3],"userEdges":[]}]},{"name":"D_HAND.06","display":[{"type":"mesh","name":"D_HAND.06","path":"shizuku_00","vertices":[-157.73,-105.85,-36.84,-125,102.5,-137.77,168.07,-99.47,159.87,50.51,92.25,120.71,-20.31,132.17,-129.05,56.89,77.91,-22.88,-47.08,-19.69,-96.53,-58.2,-144.77,-32.35,-95.53,-115.71,40.44,-132.08,9.21,-84.02,128.06,-65.49,164.92,-41.91,92.94,-93.09,23.66,62.76,12.45,-21.21,32.23,126.82,85.95,57.66,110.38,6.19,-73.63,95.26,-30.72,73.14,-86.66,17.29],"uvs":[0.399414,0.53125,0.457031,0.525391,0.523438,0.521484,0.554688,0.533203,0.550781,0.579102,0.518555,0.600586,0.466797,0.603516,0.413086,0.581055,0.511719,0.556641,0.452148,0.557617,0.428581,0.545833,0.405589,0.553746,0.429061,0.528235,0.49386,0.523224,0.478976,0.537931,0.535621,0.543603,0.553188,0.55082,0.51888,0.535156,0.486907,0.582531,0.48052,0.557152,0.490955,0.602148,0.515553,0.58129,0.527192,0.565538,0.44046,0.592502,0.461104,0.585677,0.433287,0.568934],"triangles":[24,9,23,25,23,9,25,7,23,24,23,6,22,21,4,22,8,21,21,18,5,20,5,18,19,9,18,24,18,9,24,6,18,20,18,6,21,8,18,19,18,8,16,15,4,22,4,15,17,15,2,16,3,15,17,8,15,22,15,8,19,14,9,19,8,14,14,8,13,17,13,8,17,2,13,14,13,1,12,10,1,11,7,10,25,10,7,12,0,10,11,10,0,25,9,10,10,9,1,14,1,9,21,5,4,15,3,2],"userEdges":[]}]},{"name":"D_HAND.08","display":[{"type":"mesh","name":"D_HAND.08","path":"shizuku_00","vertices":[69.96,-158.27,-94.94,-40.39,-198.72,166.85,-92.52,164.81,-9.55,75.06,149.47,-32.63,30.07,-41.2,-90.98,79.18,-8.37,-102.28,67.3,23.02,-140.3,50.18,-51.32,18.59],"uvs":[0.658203,0.37793,0.613281,0.40625,0.581055,0.448242,0.612305,0.448242,0.635742,0.428711,0.680664,0.405273,0.646934,0.403407,0.612738,0.429607,0.636866,0.391381,0.657452,0.417384,0.599197,0.424602,0.624756,0.417725],"triangles":[10,2,7,11,7,4,11,1,7,10,7,1,9,5,6,8,1,6,11,6,1,8,6,0,11,4,6,9,6,4,6,5,0,7,3,4,7,2,3],"userEdges":[]}]},{"name":"D_HAND.09","display":[{"type":"mesh","name":"D_HAND.09","path":"shizuku_00","vertices":[-166.29,149.53,-67.73,-27.18,82.15,-154.28,154.01,-5.48,14.39,81.33,-63.63,161.93,44.16,-22.18,-65.36,82.03,116.1,-83.98,-20.86,34.76,-104.17,157.04,8.8,-92.08,76.77,42.55,-108.66,46.21,-29.09,126.25],"uvs":[0.585286,0.507161,0.616536,0.470052,0.664063,0.443359,0.686849,0.474609,0.642578,0.492839,0.617839,0.509766,0.652017,0.471101,0.617288,0.492985,0.674828,0.458123,0.631401,0.483059,0.604985,0.508737,0.640805,0.456422,0.662356,0.484695,0.603558,0.485464,0.62879,0.502272],"triangles":[10,7,0,13,0,7,14,4,7,9,7,4,9,1,7,13,7,1,10,5,7,14,7,5,9,6,1,11,1,6,12,3,6,8,6,3,8,2,6,11,6,2,9,4,6,12,6,4],"userEdges":[]}]},{"name":"D_HAND.10","display":[{"type":"mesh","name":"D_HAND.10","path":"shizuku_00","vertices":[-172.41,92.67,-30.45,-80.3,111.51,-155.98,179.4,11.59,34.35,76.45,-64.4,152.12,-51.42,63.23,70.7,-33.04,144.51,-74.51,7.46,11.4,-106.21,129.11,-91.89,-5.44,44.33,-120.17,94.58,49.52,-12.59,112.43,-105.69,76.43,-41.22,-6.6,20.96,-56.28,92.01,-97.23,123.09,-11.53,51.95,23.43,-3.2,70.66,-59.07,115.63],"uvs":[0.578125,0.547852,0.623047,0.516602,0.667969,0.50293,0.689453,0.533203,0.643555,0.544922,0.612305,0.558594,0.616413,0.542532,0.655056,0.525139,0.678414,0.517647,0.635044,0.53317,0.599075,0.554436,0.603605,0.530127,0.646712,0.509399,0.662612,0.540056,0.628698,0.551422,0.599238,0.544918,0.619641,0.529917,0.639316,0.520941,0.661798,0.513544,0.671633,0.529026,0.649124,0.535343,0.63167,0.543876,0.613991,0.552],"triangles":[21,6,14,22,14,6,22,5,14,21,14,4,19,7,13,20,13,7,20,4,13,19,13,3,17,7,12,18,12,7,18,2,12,17,12,1,15,6,11,16,11,6,16,1,11,15,11,0,22,6,10,15,10,6,15,0,10,22,10,5,21,9,6,16,6,9,20,7,9,17,9,7,21,4,9,20,9,4,17,1,9,16,9,1,19,8,7,18,7,8,19,3,8,18,8,2],"userEdges":[]}]},{"name":"D_HAND.11","display":[{"type":"mesh","name":"D_HAND.11","path":"shizuku_00","vertices":[-155.43,57.21,-36.32,-83.34,104.99,-169.77,166.86,-4.5,28.49,53.78,-57.34,112.05,-49.48,38.98,61.12,-53.78,134.04,-78.14,-0.28,-7.09,-88.11,94.85,-89.84,-20.19,39.69,-130.95,86.25,29.45,-20.71,87.19,-89.41,45.85,-43.26,-18.81,16.13,-67.43,83.68,-113.42,114.41,-28.94,44.12,2.26,-10.45,46.39],"uvs":[0.597656,0.585449,0.630859,0.56543,0.66748,0.553711,0.6875,0.57666,0.648926,0.584961,0.625,0.593262,0.627191,0.582852,0.658022,0.569641,0.67835,0.566171,0.640906,0.576291,0.616423,0.590811,0.61594,0.574425,0.652049,0.558649,0.665029,0.581496,0.635211,0.589719,0.616061,0.583831,0.628924,0.574621,0.64548,0.567696,0.662885,0.56145,0.672878,0.573178,0.653283,0.577622,0.638073,0.583908],"triangles":[21,6,14,21,14,4,19,7,13,20,13,7,20,4,13,19,13,3,17,7,12,18,12,7,18,2,12,17,12,1,15,6,11,16,11,6,16,1,11,15,11,0,15,10,6,15,0,10,21,9,6,16,6,9,20,7,9,17,9,7,21,4,9,20,9,4,17,1,9,16,9,1,19,8,7,18,7,8,19,3,8,18,8,2,10,5,6,14,6,5],"userEdges":[]}]},{"name":"D_CLOTHES.10","display":[{"type":"mesh","name":"D_CLOTHES.10","path":"shizuku_01","vertices":[37.65,-157.4,116.83,-132.26,176.45,-74.06,167.59,11.7,174.13,91.91,128.92,138.59,-7.2,152.73,-107.79,147.52,-135.23,111.06,-117.32,23.41,-85.28,-60.56,-68.75,-127.84,-11.82,121.22,66.76,85.07,-41.65,53.57,87.48,46.38,6.58,3.04,46.84,-39.9,27.28,-102.11,-122.07,58.38,-102.69,-9.89,-36.65,90.92,-40.57,-28.41,-82.78,80.58,38.69,-129.41,-78.73,-96.82,-35.48,-78.94,-20.69,-143.83,-22.55,-114.66,82.03,-145.05],"uvs":[0.088542,0.309896,0.14974,0.358073,0.171875,0.441406,0.166667,0.570313,0.166667,0.708333,0.143229,0.78776,0.080729,0.830729,0.016927,0.816406,0.009115,0.731771,0.019531,0.606771,0.033854,0.473958,0.039063,0.36849,0.076823,0.763021,0.106771,0.700521,0.059896,0.654948,0.125,0.640625,0.08724,0.574219,0.111979,0.489583,0.098958,0.40625,0.015293,0.657633,0.025267,0.553583,0.062738,0.714611,0.060491,0.523983,0.034018,0.694097,0.094143,0.361708,0.036726,0.415804,0.063372,0.443259,0.062533,0.340696,0.068767,0.387217,0.122668,0.336762],"triangles":[26,18,25,28,25,18,28,11,25,26,25,10,29,24,1,27,11,24,28,24,11,29,0,24,27,24,0,28,18,24,23,21,14,23,8,21,22,20,16,22,10,20,23,14,19,23,19,8,24,18,1,26,17,18,18,17,2,22,16,17,26,10,17,22,17,10,17,16,3,20,9,16,16,15,3,16,14,15,19,14,9,16,9,14,15,14,13,21,13,14,15,13,4,21,12,13,13,12,5,21,8,12,12,8,7,12,7,6,12,6,5,13,5,4,15,4,3,17,3,2,18,2,1],"userEdges":[]}]},{"name":"D_HAIR_TWIN.29","display":[{"type":"mesh","name":"D_HAIR_TWIN.29","path":"shizuku_01","vertices":[-136.49,-100.25,-100.49,-120.03,-65.27,-80.78,-66.8,-11.7,-100.29,19.72,-141.27,2.96,-144.07,-56.58,-125.09,-44.57,-90.83,-54.36],"uvs":[0.455078,0.754557,0.507161,0.742839,0.555339,0.770833,0.552734,0.818359,0.50651,0.839193,0.44987,0.832682,0.432943,0.783203,0.477214,0.791667,0.520182,0.788411],"triangles":[8,7,4,8,1,7,7,0,6,7,6,5,7,5,4,8,4,3,8,3,2,8,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.11","display":[{"type":"mesh","name":"D_CLOTHES.11","path":"shizuku_01","vertices":[-147.25,13.94,-151.97,-51.47,-100.07,-124.65,-59.65,-161.82,7.49,-126.43,83.22,-64.33,141.56,-16.5,139.45,62.44,121.98,154.97,64.28,140.69,-0.8,107.64,-72.08,77.34,96.25,57,34.62,27.51,-32.57,8.96,-87.5,-32.83,-103.49,58.18,-127.06,1.22,-47.92,-69.46,19.95,-46.27,71.41,45.12,47.84,77.97,-40.34,90.84,-14.29,68.1,0.23,14.55,-12.34,-61.03,-78.41,32.17,-61.72,-18.73,-58.59,50.61,52.64,-5.05,35.51,-88.84,-30.31,-141.83,-76.77,-98.59,-132.22,-106.81,-137.91,-45.48,-94.8,-86.17],"uvs":[0.384115,0.334635,0.43099,0.316406,0.5,0.348958,0.535156,0.416667,0.53125,0.509115,0.519531,0.621094,0.511719,0.708333,0.457031,0.71875,0.388021,0.710938,0.378906,0.63151,0.380208,0.539063,0.377604,0.438802,0.446615,0.660156,0.446615,0.572917,0.445313,0.479167,0.447917,0.39974,0.380426,0.39365,0.406857,0.357842,0.491255,0.447207,0.487425,0.542152,0.446615,0.625,0.416426,0.599042,0.378764,0.483453,0.406964,0.514448,0.445927,0.523388,0.491804,0.495368,0.406431,0.422787,0.44671,0.436537,0.4003,0.452332,0.474786,0.59153,0.52649,0.554598,0.533592,0.453679,0.496295,0.409126,0.467092,0.333436,0.436306,0.342579,0.478172,0.370241],"triangles":[34,15,33,35,33,15,35,2,33,34,33,1,35,32,2,35,15,32,27,26,14,28,14,26,28,26,11,27,15,26,24,23,13,24,14,23,23,14,22,28,22,14,28,11,22,23,22,10,29,20,5,21,9,20,29,13,20,21,20,13,30,19,5,29,5,19,25,14,19,24,19,14,30,4,19,25,19,4,24,13,19,29,19,13,31,18,4,25,4,18,32,15,18,27,18,15,31,3,18,32,18,3,27,14,18,25,18,14,34,1,17,34,17,15,26,15,16,17,16,15,17,0,16,26,16,11,21,13,10,23,10,13,20,12,5,20,9,12,21,10,9,12,9,8,12,8,7,12,7,6,12,6,5,32,3,2,17,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.12","display":[{"type":"mesh","name":"D_CLOTHES.12","path":"shizuku_01","vertices":[5.2,-158.2,149.14,-105.13,129.47,-24.31,62.5,57.76,4.04,143.98,-86.76,97.07,-145.77,31.48,-86.4,-79.77,-26.73,3.97,62.33,-76.32,-8.09,-81.93,-88.71,24.47,-11.32,74.1,68.4,-134.9],"uvs":[0.373698,0.03776,0.44401,-0.001302,0.459635,0.022135,0.463542,0.080729,0.467448,0.13151,0.423177,0.152344,0.380208,0.15625,0.367188,0.10026,0.417969,0.104167,0.425781,0.044271,0.395333,0.070212,0.398307,0.131286,0.442754,0.117864,0.40457,0.020609],"triangles":[10,8,9,13,9,1,13,0,9,10,9,0,11,8,7,10,7,8,9,8,3,12,3,8,12,8,5,11,5,8,10,0,7,11,7,6,11,6,5,12,5,4,12,4,3,9,3,2,9,2,1],"userEdges":[]}]},{"name":"D_HAND.01","display":[{"type":"mesh","name":"D_HAND.01","path":"shizuku_00","vertices":[-121.12,-133.66,16.69,-90.24,133.7,-8.21,102.49,117.25,-4.11,131.73,-131.52,73.83,-62.7,-1.16,67.89,33.58,-126.37,-28.92,6.83,14.94,118.97,51.01,-49.78,-111.18,-72.25,100.76,76.55,-48.27,60.92,122.9],"uvs":[0.454427,0.701823,0.488932,0.707682,0.518229,0.71875,0.510417,0.735677,0.483724,0.73763,0.451823,0.729818,0.469054,0.7197,0.501753,0.724388,0.453112,0.715955,0.486464,0.721873,0.514542,0.726739,0.472289,0.704856,0.466664,0.733452,0.503919,0.713344,0.500008,0.736439],"triangles":[13,7,2,10,2,7,9,4,7,14,7,4,14,3,7,10,7,3,13,1,7,9,7,1,11,6,1,9,1,6,8,5,6,12,6,5,12,4,6,9,6,4,11,0,6,8,6,0],"userEdges":[]}]},{"name":"D_HAND.00","display":[{"type":"mesh","name":"D_HAND.00","path":"shizuku_00","vertices":[-118.48,-136.25,-31.61,-119.9,84.23,-79.01,68.3,2.76,20.52,78.39,-30.16,100.88,-96.76,64.09,-145.99,2.76,-148.89,-79.01,-38.84,6.85,17.62,-27.91,-62.01,-54.48],"uvs":[0.430664,0.390625,0.489258,0.398438,0.567383,0.417969,0.556641,0.457031,0.524414,0.493164,0.490234,0.503906,0.445313,0.486328,0.412109,0.457031,0.410156,0.417969,0.484375,0.458984,0.522461,0.442383,0.46875,0.429688],"triangles":[11,10,1,11,9,10,10,9,4,11,6,9,11,0,8,11,8,7,11,7,6,9,6,5,9,5,4,10,4,3,10,3,2,10,2,1,11,1,0],"userEdges":[]}]},{"name":"D_HAND.02","display":[{"type":"mesh","name":"D_HAND.02","path":"shizuku_00","vertices":[-127.91,-62.77,-79.03,-146.25,5.81,-101.69,118.53,-3.24,148.37,156.3,60.48,126.04,5.33,55.36,5.62,-27.36,-54.3,2.65,80.58,81.22,137.37,97.47,-54.09,-84.26,-54.86,-43.38,54.7,-59,61.37,26.38,103.16,110.18,5.47,15.44,61.34,-15.45,5.71,-66.18,46.33,69.43,97.16,44.32,126.89,41.43,28.94,85.44],"uvs":[0.444336,0.766602,0.458984,0.738281,0.483398,0.753906,0.515625,0.788086,0.523438,0.842773,0.498047,0.832031,0.482422,0.807617,0.482936,0.779324,0.465414,0.789301,0.504142,0.816794,0.520557,0.822607,0.465899,0.759594,0.465462,0.773565,0.497374,0.768729,0.498853,0.797952,0.510549,0.826797,0.48267,0.793959,0.49907,0.783649,0.483178,0.766047,0.494245,0.812612,0.50916,0.80425,0.517812,0.803398,0.489082,0.818023],"triangles":[21,20,10,21,3,20,22,5,19,22,19,6,20,14,9,19,9,14,17,7,14,16,14,7,20,3,14,17,14,3,16,6,14,19,14,6,18,7,13,17,13,7,17,3,13,18,13,2,18,11,7,12,7,11,18,2,11,12,11,0,20,9,10,15,10,9,15,4,10,19,5,9,15,9,5,16,7,8,12,8,7,12,0,8,16,8,6,15,5,4,11,2,1,11,1,0],"userEdges":[]}]},{"name":"D_HAND.03","display":[{"type":"mesh","name":"D_HAND.03","path":"shizuku_00","vertices":[-123.64,-51.58,-64.17,-142.55,24.87,-77.09,107.97,-2.54,164.36,162.93,82.74,137.48,22.33,64.44,-40.04,15.06,-48.72,-64.47,23.45,-2.46,138.27,86.37,93.77,76.28,114.59,108.16,62.03,33.38,-8.29,-29.97,-94.14,-96.65,-78.58,-15.41,-18.78,-109.18,-5.27,42.46,60.88,-44.81],"uvs":[0.446289,0.848633,0.46582,0.824219,0.495117,0.841797,0.520508,0.858398,0.536133,0.902344,0.511719,0.895508,0.494141,0.879883,0.473743,0.866562,0.470904,0.845187,0.494603,0.861866,0.528903,0.882009,0.51556,0.879289,0.521575,0.887765,0.506422,0.869876,0.484186,0.854462,0.455959,0.836545,0.461147,0.858336,0.480756,0.83318,0.485087,0.87397,0.506115,0.848988],"triangles":[13,6,11,12,10,11,12,11,5,13,11,3,12,4,10,11,10,3,19,9,3,13,3,9,14,7,9,18,9,7,18,6,9,13,9,6,19,2,9,14,9,2,14,8,7,16,7,8,17,1,8,15,8,1,14,2,8,17,8,2,15,0,8,16,8,0,11,6,5,12,5,4],"userEdges":[]}]},{"name":"D_HAND.04","display":[{"type":"mesh","name":"D_HAND.04","path":"shizuku_00","vertices":[-127.44,15.52,-129.15,-72.24,-67.6,-141.05,31.37,-48.86,148.79,94.82,137.61,156.35,74.3,146.02,-25.83,73.46,-49,-44.08,99.45,34.44,54.17,53.73,120.04,114.58,-95.42,-67.97,4.22,9.15,88.61,82.56,34.3,116.76,71.87,0.69,-70.66,47.92,-22.09,-98.67],"uvs":[0.447917,0.914063,0.447266,0.894531,0.472656,0.884115,0.503255,0.89974,0.544271,0.931641,0.540365,0.945313,0.518229,0.942057,0.483073,0.929036,0.477354,0.904375,0.527031,0.918232,0.511149,0.922047,0.534225,0.935659,0.46111,0.898092,0.493701,0.913608,0.523234,0.928508,0.504102,0.936825,0.517397,0.910738,0.467602,0.922447,0.486722,0.891297],"triangles":[14,11,9,14,6,11,16,10,9,14,9,10,13,7,10,15,10,7,15,6,10,14,10,6,16,3,10,13,10,3,11,4,9,18,8,3,13,3,8,12,0,8,17,8,0,17,7,8,13,8,7,18,2,8,12,8,2,11,6,5,11,5,4,12,2,1,12,1,0],"userEdges":[]}]},{"name":"D_HAND.05","display":[{"type":"mesh","name":"D_HAND.05","path":"shizuku_00","vertices":[-139.53,-31.02,-104.49,-133.36,-36.29,-122.81,65.38,-3.01,141.06,149.3,63.7,155.78,-23.78,91.78,-79.12,-61.34,-91.25,20.48,104.1,74.64,24.37,40.53,-30.7,-21.24,64.66,72.85,22.4,-53.49,15.74,120.46,87.54,107.9,94.2,153.23],"uvs":[0.442057,0.94987,0.45638,0.934896,0.479818,0.936198,0.510417,0.955078,0.535807,0.983073,0.509766,0.984375,0.480469,0.972656,0.46406,0.946935,0.458141,0.959411,0.523376,0.969366,0.496664,0.963151,0.480125,0.953422,0.510105,0.969097,0.497515,0.947118,0.493658,0.977932,0.517797,0.975518,0.52003,0.983862],"triangles":[16,4,15,16,15,5,15,9,12,15,12,5,12,10,5,14,5,10,13,2,10,11,10,2,12,3,10,13,10,3,11,6,10,14,10,6,15,4,9,12,9,3,11,2,7,8,7,0,8,6,7,11,7,6,7,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.18","display":[{"type":"mesh","name":"D_CLOTHES.18","path":"shizuku_04","vertices":[234.62,-66.42,298.53,-50.75,336.16,-22.48,358.44,23.22,-38.06,46.47,-3.82,-1.2,78.74,6.94,191.66,10.22,279.43,10.49,328.89,18.46,-57.52,23.12,-62.79,-26.78,-14.63,-58.16,52.87,-58.94,152.45,-63.26,327.53,80.79,270,82.9,182.61,85.68,62.46,82.28,8.97,67.36],"uvs":[0.41,0.815,0.387,0.875,0.355,0.908,0.308,0.924,0.334,0.537,0.376,0.576,0.358,0.655,0.341,0.764,0.33,0.849,0.316229,0.895947,0.359,0.521,0.408,0.522,0.4325,0.5725,0.425,0.638,0.417,0.735,0.256,0.887,0.261,0.831,0.269,0.746,0.287,0.63,0.308,0.58],"triangles":[19,18,6,18,17,6,17,16,7,16,15,9,14,13,6,13,12,5,12,11,5,5,11,10,15,3,9,16,9,8,9,2,8,16,8,7,14,7,0,8,0,7,14,6,7,17,7,6,13,5,6,19,6,5,19,5,4,10,4,5,9,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.19","display":[{"type":"mesh","name":"D_CLOTHES.19","path":"shizuku_04","vertices":[471.9,-73.52,474.06,-13.2,473.44,45.44,464.46,75.96,419.83,69.05,391.68,86.85,317.5,80.63,229.76,78.7,145.64,93.33,58.58,88.41,-7.94,67.05,-29.68,28.56,-42.68,-49.05,22.1,-80.42,101.07,-81.51,182.94,-86.15,266.59,-89.35,364.27,-108.27,409.97,-87.48,412.32,-18.72,425.84,28.42,349.19,33.19,353.99,-48.66,275.77,-4.35,200.5,-5.47,123.38,-2.86,57.28,0.99,9.66,-6.59,-51.63,36.48,-60.98,-19.3],"uvs":[0.184,0.036,0.241,0.021,0.297,0.009,0.328,0.011,0.331,0.055,0.354,0.078,0.364,0.15,0.381,0.234,0.413,0.311,0.427,0.395,0.418,0.461,0.386,0.489,0.309,0.52,0.274,0.466,0.256,0.391,0.234,0.314,0.213,0.235,0.174,0.146,0.184,0.098,0.249,0.081,0.291,0.058,0.312,0.13,0.233,0.143,0.292,0.208,0.311,0.278,0.332,0.347,0.344,0.415,0.347,0.462,0.3885,0.517,0.3315,0.533],"triangles":[29,28,12,27,26,13,27,9,26,26,8,25,26,25,14,25,8,24,25,24,15,24,7,23,24,23,16,23,22,16,23,21,22,22,21,19,23,6,21,21,5,20,21,20,19,20,1,19,22,19,18,19,0,18,22,18,17,22,17,16,24,16,15,25,15,14,26,14,13,27,13,12,28,11,12,27,12,11,28,10,11,27,11,10,27,10,9,26,9,8,24,8,7,23,7,6,21,6,5,20,5,4,20,4,3,20,3,2,20,2,1,19,1,0],"userEdges":[]}]},{"name":"D_HAND.18","display":[{"type":"mesh","name":"D_HAND.18","path":"shizuku_04","vertices":[126.74,47.26,126.73,68.25,92.38,59.99,61.53,52.51,45.22,45.68,40.46,22.57,49.22,9.32,83.83,23.42,108.84,35.88,57.26,29.5],"uvs":[0.361,0.909,0.381,0.9045,0.3805,0.939,0.38,0.97,0.377,0.987,0.356,0.9965,0.3415,0.991,0.3475,0.955,0.354,0.9285,0.359,0.979],"triangles":[9,3,7,2,0,8,2,8,7,9,7,6,9,6,5,9,5,4,9,4,3,7,3,2,2,1,0],"userEdges":[]}]},{"name":"D_HAND.19","display":[{"type":"mesh","name":"D_HAND.19","path":"shizuku_04","vertices":[39.12,-50.33,85.68,-56.63,105.7,-29.02,114.48,6.54,104.31,44.67,67.52,54.22,34.58,37.35,28.65,-3.88,63.9,-15.88,79.68,16.55],"uvs":[0.197,0.9825,0.181,0.9395,0.203,0.9145,0.235,0.8985,0.2735,0.9,0.2905,0.933,0.2815,0.968,0.2435,0.9825,0.2245,0.9515,0.252,0.9295],"triangles":[6,9,8,9,2,8,8,0,7,8,7,6,9,6,5,9,5,4,9,4,3,9,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_HAND.20","display":[{"type":"mesh","name":"D_HAND.20","path":"shizuku_04","vertices":[82.85,48.09,127.59,54.5,167.5,61.39,195.14,64.47,192.46,34.48,160.38,27.77,121.47,21.1,92.05,16.57],"uvs":[0.394,0.123,0.3905,0.079,0.3885,0.0395,0.3855,0.0125,0.3575,0.0215,0.358,0.0535,0.36,0.092,0.362,0.121],"triangles":[0,6,7,1,5,6,2,4,5,4,2,3,5,1,2,6,0,1],"userEdges":[]}]},{"name":"D_HAND.21","display":[{"type":"mesh","name":"D_HAND.21","path":"shizuku_04","vertices":[206.47,21.78,166.93,20.22,126.94,20.65,97.83,24.07,87.99,-9.12,131.88,-12.87,177.84,-7.24,204.38,-3.88],"uvs":[0.4075,0.867,0.4145,0.905,0.4235,0.943,0.433,0.97,0.4035,0.9865,0.3905,0.9455,0.386,0.9005,0.3835,0.8745],"triangles":[0,7,6,1,6,5,2,5,4,4,3,2,5,2,1,6,1,0],"userEdges":[]}]},{"name":"D_HAND.22","display":[{"type":"mesh","name":"D_HAND.22","path":"shizuku_04","vertices":[185.66,-43.52,195.64,-20.27,153.36,-11.96,117.74,-5.29,89.74,-2.15,83.16,-28.83,116.66,-35.45,157.34,-43.6],"uvs":[0.3745,0.165,0.3945,0.1505,0.4115,0.189,0.4255,0.2215,0.4345,0.2475,0.4105,0.2595,0.397,0.229,0.3805,0.192],"triangles":[2,0,7,2,7,6,3,6,5,5,4,3,6,3,2,2,1,0],"userEdges":[]}]},{"name":"D_HAND.23","display":[{"type":"mesh","name":"D_HAND.23","path":"shizuku_04","vertices":[147.11,-59.39,119.52,-44.09,86.58,-23.7,65.77,-47.81,96.54,-65.54,132.46,-80.54],"uvs":[0.1865,0.294,0.207,0.317,0.2335,0.344,0.215,0.369,0.1915,0.3435,0.1695,0.3125],"triangles":[0,5,4,1,4,3,3,2,1,4,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.16","display":[{"type":"mesh","name":"D_CLOTHES.16","path":"shizuku_04","vertices":[-71.31,-7.55,-66.03,-40.98,-34.5,-72.8,47.21,-88.88,117.77,-95.7,202.32,-98.14,275.38,-98.56,327.28,-92.72,362.15,-47.32,337.22,-0.27,295.16,31.82,230.05,46.35,154.68,49.64,55.75,51.78,-34.26,46.51,-12.4,-16.15,48.63,-4.42,33.23,-49.04,116.64,-39.24,135.08,16.97,201.97,-5.62,199.47,-56.24,279.14,-28.28,320.89,-46],"uvs":[0.035,0.014,0.081,0.007,0.12,0.04,0.143,0.118,0.156,0.186,0.166,0.268,0.173,0.339,0.172,0.39,0.131,0.428,0.083,0.408,0.048,0.37,0.028,0.308,0.018,0.235,0.007,0.139,0.004,0.051,0.063,0.064,0.061,0.127,0.103,0.108,0.101,0.19,0.048,0.213,0.076,0.276,0.125,0.269,0.105,0.349,0.126,0.388],"triangles":[23,22,9,23,6,22,22,6,21,22,21,20,21,18,20,22,20,11,20,19,12,20,18,19,19,18,16,21,4,18,18,3,17,18,17,16,19,16,13,17,15,16,16,15,14,17,2,15,15,0,14,16,14,13,19,13,12,20,12,11,22,11,10,22,10,9,23,9,8,23,8,7,23,7,6,21,6,5,21,5,4,18,4,3,17,3,2,15,2,1,15,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.17","display":[{"type":"mesh","name":"D_CLOTHES.17","path":"shizuku_04","vertices":[469.09,-49.88,473.04,5.53,471.31,60.67,463.13,97.41,410.95,103.53,359.55,127.75,274.71,110.83,167.15,106.84,49.59,94.99,-37.13,75.64,-49.15,0.75,-0.92,-60.79,90.76,-87.37,195.06,-71.49,281.26,-61.87,391.83,-71.12,393.85,2.95,333.18,65.54,298.19,-11.83,227.02,33.17,115.44,8.9,23.55,6.02,-52.52,-29.72,-73.8,15.72,-65.32,47.97,143.31,61.69,103.43,100.42,82.63,51.8,38.07,55.63,193.73,74.13,242.05,109.62,234.87,73.09,260.39,87.51],"uvs":[0.138627,0.445491,0.192463,0.452221,0.244953,0.464334,0.2786,0.479139,0.274563,0.530283,0.288022,0.584118,0.25572,0.66218,0.231494,0.764468,0.197847,0.874832,0.162853,0.95424,0.088829,0.951548,0.039031,0.893674,0.030956,0.800808,0.065949,0.703903,0.091521,0.623149,0.103634,0.515478,0.174966,0.527591,0.223419,0.597577,0.142665,0.61642,0.172275,0.693136,0.12786,0.795424,0.107672,0.882907,0.059,0.949,0.0985,0.978,0.131,0.976,0.183715,0.77874,0.213257,0.824286,0.162736,0.834995,0.157947,0.878405,0.2052,0.732796,0.248363,0.693244,0.212005,0.693192,0.230661,0.671477],"triangles":[32,19,31,32,31,30,31,29,30,32,30,6,30,29,7,31,19,29,28,27,21,28,8,27,27,26,25,27,8,26,29,19,25,26,7,25,29,25,7,27,25,20,24,10,23,23,10,22,28,21,9,27,20,21,21,20,12,25,19,20,20,19,13,32,17,19,19,18,14,19,17,18,32,6,17,18,17,16,17,4,16,4,2,16,18,16,15,16,0,15,18,15,14,19,14,13,20,13,12,21,12,11,22,10,11,21,11,10,24,9,10,21,10,9,28,9,8,17,6,5,17,5,4,4,3,2,16,2,1,16,1,0],"userEdges":[]}]},{"name":"D_HAND.12","display":[{"type":"mesh","name":"D_HAND.12","path":"shizuku_04","vertices":[97.88,-58.85,100.65,-35.46,66.59,-23.95,37.37,-7.44,18.2,-15.08,14.49,-37.83,36.61,-53.34,66.81,-55.52,40.11,-32.12],"uvs":[0.0105,0.3435,0.0335,0.344,0.04,0.3785,0.052,0.409,0.042,0.4265,0.0195,0.427,0.0075,0.4035,0.0095,0.374,0.0285,0.403],"triangles":[8,2,7,8,7,6,8,6,5,8,5,4,8,4,3,8,3,2,7,2,1,7,1,0],"userEdges":[]}]},{"name":"D_HAND.13","display":[{"type":"mesh","name":"D_HAND.13","path":"shizuku_04","vertices":[44.7,-47.97,71.77,-42.98,86.84,-16.66,82.19,20.18,67.8,46.51,50.75,61.31,21.94,55.02,4.86,51.22,0.81,18.69,3.36,-21.99,16.14,-37.75,51.14,-16.82,59.47,13.04,34.75,28.4,27.37,-5.72],"uvs":[0.0055,0.469,0.014,0.4435,0.0415,0.4325,0.0765,0.442,0.1,0.4595,0.112,0.478,0.102,0.505,0.096,0.521,0.064,0.5205,0.025,0.5125,0.0115,0.498,0.0365,0.467,0.0665,0.463,0.078,0.489,0.044,0.4915],"triangles":[10,14,11,14,8,13,14,13,12,13,4,12,14,12,11,12,2,11,11,0,10,14,10,9,14,9,8,13,8,7,13,7,6,13,6,5,13,5,4,12,4,3,12,3,2,11,2,1,11,1,0],"userEdges":[]}]},{"name":"D_HAND.14","display":[{"type":"mesh","name":"D_HAND.14","path":"shizuku_04","vertices":[57.18,-43.38,91.73,-47.72,133.66,-51.03,168.35,-50.73,165.61,-26.05,127.59,-20.71,92.09,-15.72,65.51,-9.91,49.25,-26.24,76.56,-30.6,112.19,-34.57,144.13,-37.25],"uvs":[0.01,0.64,0.0105,0.606,0.013,0.565,0.018,0.5315,0.0415,0.5375,0.0415,0.575,0.0415,0.61,0.0435,0.6365,0.0255,0.65,0.025,0.623,0.026,0.588,0.02775,0.55675],"triangles":[11,2,10,11,10,5,10,1,9,10,9,6,9,0,8,9,8,7,9,7,6,10,6,5,11,5,4,11,4,3,11,3,2,10,2,1,9,1,0],"userEdges":[]}]},{"name":"D_HAND.15","display":[{"type":"mesh","name":"D_HAND.15","path":"shizuku_04","vertices":[74.51,-14.36,109.85,-13.12,144.88,-10.29,178.11,-5.66,174.51,16.56,139.89,20.4,97.47,16.53,69.23,17.92,56.81,-0.5,82.88,1.01,119.8,2.54,151.62,6.34],"uvs":[0.051,0.628,0.057,0.594,0.0645,0.5605,0.0735,0.529,0.0945,0.5355,0.0935,0.5695,0.084,0.61,0.0815,0.6375,0.062,0.647,0.067,0.622,0.0735,0.5865,0.0815,0.55625],"triangles":[11,2,10,11,10,5,10,1,9,10,9,6,9,0,8,9,8,7,9,7,6,10,6,5,11,5,4,11,4,3,11,3,2,10,2,1,9,1,0],"userEdges":[]}]},{"name":"D_HAND.16","display":[{"type":"mesh","name":"D_HAND.16","path":"shizuku_04","vertices":[72.9,6.68,107.06,17.9,134.99,25.35,158.64,35.47,148.31,57.61,111.76,51.37,69.71,42.8,53.58,34.73,50.29,15.02,77.06,25.22],"uvs":[0.007,0.74,0.0225,0.7085,0.0335,0.6825,0.0465,0.661,0.0665,0.674,0.0555,0.7085,0.0415,0.748,0.0315,0.7625,0.012,0.763,0.0255,0.7385],"triangles":[5,1,9,9,0,8,9,8,7,9,7,6,9,6,5,2,5,4,4,3,2,5,2,1,9,1,0],"userEdges":[]}]},{"name":"D_HAND.17","display":[{"type":"mesh","name":"D_HAND.17","path":"shizuku_04","vertices":[67.24,32.59,90.44,54.15,114.58,71.44,99.13,86.54,61.44,68.57,39.32,54.61,45.02,32.62,63.51,50.18,82.59,78.65],"uvs":[0.1755,0.4155,0.1995,0.396,0.2195,0.375,0.232,0.392,0.2095,0.426,0.193,0.4455,0.1725,0.437,0.192,0.4215,0.222129,0.406916],"triangles":[1,8,3,8,1,7,8,7,4,7,0,6,7,6,5,7,5,4,3,2,1,7,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.07","display":[{"type":"mesh","name":"D_CLOTHES.07","path":"shizuku_01","vertices":[-133.33,-95.24,-95.51,-133.33,-36.88,-60.61,40.66,25.97,133.33,128.14,61.47,133.33,-17.97,77.92,-93.62,-13.85,-27.28,9.72,53.58,92.64,-92.19,-80.47],"uvs":[0.788411,0.905599,0.801432,0.891276,0.821615,0.91862,0.848307,0.951172,0.880208,0.989583,0.855469,0.991536,0.828125,0.970703,0.802083,0.936198,0.82492,0.945062,0.852754,0.976236,0.802573,0.911153],"triangles":[8,2,7,10,7,2,9,3,6,8,6,3,10,0,7,8,7,6,9,6,5,9,5,4,9,4,3,8,3,2,10,2,1,10,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.08","display":[{"type":"mesh","name":"D_CLOTHES.08","path":"shizuku_01","vertices":[103.78,-133.33,133.33,-77.08,86.96,1.47,3.92,75.26,-78.8,133.33,-133.33,114.45,-66.08,49.77,28.09,-46.39,14.24,23.35,95.14,-64.09,-76.04,96.79],"uvs":[0.987305,0.890625,0.99707,0.913574,0.979004,0.944336,0.947754,0.972656,0.915527,0.992676,0.897461,0.986328,0.922852,0.961426,0.958496,0.924316,0.952338,0.952028,0.983041,0.918215,0.918475,0.980099],"triangles":[9,7,2,8,2,7,8,6,3,10,3,6,9,0,7,8,7,6,10,6,5,10,5,4,10,4,3,8,3,2,9,2,1,9,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.09","display":[{"type":"mesh","name":"D_CLOTHES.09","path":"shizuku_01","vertices":[-161.78,-68.89,-107.58,-99.81,-26.06,-114.74,20.39,-112.6,95.08,-99.81,160.21,-41.17,131.97,37.19,108.29,89.43,125.14,164.59,63.2,189.11,-13.77,187.51,-102.12,170.98,-105.31,96.89,-125.8,68.64,-164.97,-11.32,-19.69,99.55,45.9,95.29,0.35,-2.79,52.27,1.47,-61.59,2.54,-118.06,-32.64,-57.94,-66.76,4,-62.5,67.76,-50.77],"uvs":[0.777344,0.645182,0.817057,0.624349,0.874349,0.617188,0.907552,0.61849,0.961589,0.624349,0.999349,0.64974,0.988932,0.691406,0.966146,0.714844,0.977865,0.758464,0.939453,0.772135,0.889974,0.782552,0.828776,0.77474,0.827474,0.723307,0.803385,0.711589,0.779948,0.678385,0.880208,0.73112,0.925781,0.727214,0.890625,0.680339,0.936849,0.68099,0.846354,0.681641,0.808594,0.667318,0.851563,0.646484,0.899089,0.645182,0.946615,0.647135],"triangles":[23,22,18,23,3,22,22,21,17,22,2,21,21,1,20,21,20,19,20,13,19,21,19,17,23,18,6,22,17,18,18,17,16,19,15,17,18,16,7,17,15,16,19,12,15,16,15,10,20,0,14,20,14,13,19,13,12,15,12,11,15,11,10,16,10,9,16,9,8,16,8,7,18,7,6,23,6,5,23,5,4,23,4,3,22,3,2,21,2,1,20,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.01","display":[{"type":"mesh","name":"D_CLOTHES.01","path":"shizuku_01","vertices":[-132.32,-144.94,-57.19,-130.16,40.51,-119.06,140.97,-134.84,142.07,-4.18,155.28,110.34,139.87,157.58,66.11,171.9,-7.65,177.63,-78.11,166.17,-145.26,144.7,-146.91,70.26,-142.51,-46.35,-75.9,87.44,-6.55,90.3,59.5,88.87,113.45,98.89,-88.01,-7.04,-6.55,5.84,70.51,-1.32,-93.52,-82.92,-19.76,-67.17,49.6,-71.46,106.01,-76.12],"uvs":[0.019531,0.002604,0.111979,0.011719,0.22526,0.014323,0.34375,0.002604,0.347656,0.128906,0.355469,0.235677,0.34375,0.282552,0.25651,0.295573,0.169271,0.300781,0.085938,0.290365,0.00651,0.270833,0.011719,0.200521,0.011719,0.096354,0.088542,0.21875,0.170573,0.221354,0.248698,0.220052,0.300781,0.222656,0.074219,0.132813,0.171875,0.140625,0.261719,0.138021,0.065104,0.063802,0.153646,0.070313,0.236979,0.074219,0.296875,0.06901],"triangles":[23,2,22,23,22,19,22,2,21,22,21,18,21,1,20,21,20,17,23,19,4,4,19,16,22,18,19,19,18,15,21,17,18,20,12,17,18,17,13,19,15,16,16,15,7,18,14,15,7,15,14,18,13,14,17,11,13,14,13,9,20,0,12,17,12,11,13,11,10,13,10,9,14,9,8,14,8,7,16,7,6,16,6,5,16,5,4,23,4,3,23,3,2,21,2,1,20,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.02","display":[{"type":"mesh","name":"D_CLOTHES.02","path":"shizuku_01","vertices":[-145.93,-110.66,-109.53,-129.9,-49.98,-147.71,1.23,-154.62,16.82,-84.28,46.08,-5.22,91.85,73.19,145.22,145.71,103.1,154.38,-27.23,166.6,-69.77,160.45,-89.35,106.87,-101.47,28.49,-129.91,-50.89,-30.01,110.14,55.35,113.26,102.01,125.71,22.07,140.01,-55.61,136.74,-37.45,50.14,38.8,52.08,-69.03,77.3,8.79,70.22,71.43,36.59,-95.07,70.85,-49.52,-1.21,-68.53,-85.08,-68.56,-112.22,-33.63,-128.89,32.37,-39.24,-10.64,-58.41,-82.51,-2.32,-138.02,-80.44,-102.83,-99.06,-57.39,-53.92,-42.51,23.45,-107.02,-111.62,-78.12,-137.65,-94.7,-123.69,-59.25,-131.64,1.65,22.76,42.23,24.2,1.48,-8.91,-37.63,-102.11,-29,-85.77,-4.84,-25.61,1.67,4.92,-63.5,111.46,-80.89,141.25,-119.47,-21.82,-66.61,13.57,-91.07,10.88,-67.58,39.87,-85.93,51.65,-64.52,32.69,-33.93,78.88,-79.97,91.31,-51.14,92.26,-51.57,62.26,-79.55,24.01,-71.62,124.32,-23.36,138.78,80.73,135.21,123.67,108.44,24.9,163.36,17.03,111.86,74.17,92.61,97.4,98.4,77.29,118.29,68.18,63.68,48.29,87.14],"uvs":[0.486328,0.05957,0.519531,0.037109,0.573242,0.019531,0.62207,0.013672,0.632813,0.099609,0.654297,0.199219,0.692383,0.298828,0.741211,0.376953,0.704102,0.394531,0.613281,0.401367,0.569336,0.389648,0.538086,0.324219,0.526367,0.233398,0.501953,0.143555,0.587891,0.333008,0.650391,0.329102,0.702179,0.356388,0.630656,0.367532,0.577032,0.366156,0.585938,0.254883,0.645508,0.272461,0.559247,0.293557,0.621065,0.295332,0.674801,0.252845,0.533872,0.291559,0.572266,0.172852,0.554688,0.100586,0.554688,0.066406,0.589551,0.039122,0.645137,0.156751,0.604345,0.134045,0.531562,0.155892,0.495039,0.106392,0.525247,0.082922,0.564204,0.139709,0.579603,0.216876,0.522973,0.063235,0.545181,0.028715,0.533555,0.048796,0.566259,0.037173,0.61081,0.23463,0.649708,0.237457,0.613424,0.186081,0.582997,0.078438,0.590876,0.100134,0.610539,0.164395,0.613703,0.208815,0.562097,0.328456,0.558985,0.367977,0.510893,0.176452,0.555834,0.194528,0.529265,0.190166,0.55793,0.244782,0.542142,0.262261,0.558404,0.223455,0.586865,0.291993,0.548367,0.309321,0.572365,0.311625,0.573971,0.272221,0.544407,0.209602,0.557426,0.345044,0.600349,0.36655,0.678947,0.363889,0.719759,0.342631,0.644648,0.399006,0.622322,0.330856,0.672044,0.313491,0.697203,0.327152,0.674157,0.341624,0.671457,0.287057,0.648306,0.304923],"triangles":[67,66,16,68,16,66,69,20,66,70,66,20,67,6,66,69,66,6,70,15,66,68,66,15,67,16,63,67,63,6,68,62,16,68,15,62,58,21,55,57,55,21,57,14,55,58,55,19,59,54,50,59,12,54,58,52,21,53,21,52,54,52,35,54,12,52,53,52,12,58,19,52,59,50,51,59,51,12,54,35,50,51,50,31,51,31,49,51,49,12,60,48,18,60,11,48,60,18,47,57,21,47,56,47,21,56,11,47,60,47,11,57,47,14,44,43,26,44,4,43,45,42,29,46,42,35,46,5,42,45,25,42,41,40,20,46,35,40,41,5,40,46,40,5,38,27,37,39,37,27,39,2,37,38,37,1,38,1,36,38,36,27,52,19,35,40,35,19,42,25,35,50,35,25,36,33,27,36,0,33,33,32,26,33,0,32,34,26,31,49,31,13,50,25,31,34,31,25,34,30,26,44,26,30,45,29,30,44,30,4,34,25,30,45,30,25,42,5,29,30,29,4,43,4,28,39,28,2,39,27,28,43,28,27,43,27,26,33,26,27,32,13,26,31,26,13,56,21,24,53,24,21,53,12,24,56,24,11,41,20,23,69,23,20,69,6,23,41,23,5,70,20,22,55,14,22,65,22,14,65,15,22,70,22,15,55,22,19,40,19,20,22,20,19,61,18,9,61,14,18,47,18,14,48,10,18,62,17,8,64,8,17,65,14,17,61,17,14,61,9,17,64,17,9,62,15,17,65,17,15,62,8,16,63,16,7,18,10,9,16,8,7,28,4,3,28,3,2,36,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.03","display":[{"type":"mesh","name":"D_CLOTHES.03","path":"shizuku_01","vertices":[-8.85,-163.07,48.77,-149.7,112.29,-129.12,157.82,-112.25,140.31,-61.25,96.97,8.82,79.5,38.31,80.9,87.17,45.95,167.82,-39.41,161.92,-119.25,154.83,-160.96,143.23,-131.18,82.91,-63.35,0.05,-28.33,-76.06,-87.01,110.79,-25.58,119.55,-51.4,68.59,23.98,68.87,14.56,14.17,13.29,-41.09,84.34,-59.8,27.68,-115.58,82.07,-109.37,-12.05,-125.09,10.86,-138.4,67.62,-126.17,79.36,-140.84,62.07,135.64,34.76,109.49,-93.7,50.34,21.33,-69.26,-43.28,-43.72,0.08,-97.38,-5.13,-58.55,-27.14,-20.62,-18.8,41.86,89.64,-30.94,118.56,-26.21,53.07,-17.46,65.79,10.72,82.5,63.37,54.71,47.92,55.22,30.1,60.13,80.82,73.11,115.44,22.07,151.85,-71.5,136.87,-37.78,95.57,-70.42,91.2,-3.04,96.64,59.47,65.57,62.37,97.55,28.69,130.7,51.67,123.55,55.67,110.76,40.9,145.65,46.92,133.63,-56.33,40.38,-21.85,7.7,13.78,-18.91,-38.56,23.35,-89.98,75.62,-69.72,60.62],"uvs":[0.627604,0.583333,0.673177,0.589844,0.730469,0.60026,0.769531,0.613281,0.769531,0.678385,0.753906,0.759115,0.752604,0.8125,0.765625,0.882813,0.75,0.980469,0.691406,0.980469,0.619792,0.981771,0.574219,0.97526,0.595052,0.898438,0.613281,0.792969,0.622396,0.692708,0.627604,0.93099,0.683594,0.93099,0.645833,0.864583,0.707031,0.859375,0.6875,0.792969,0.671875,0.722656,0.714844,0.678385,0.657552,0.636719,0.71224,0.632813,0.625211,0.633598,0.642145,0.609253,0.694564,0.61337,0.699932,0.594708,0.756118,0.942229,0.728524,0.904602,0.603284,0.850811,0.666954,0.685805,0.618511,0.735442,0.640894,0.663248,0.647211,0.707728,0.642738,0.75762,0.666409,0.829218,0.731337,0.712471,0.761695,0.718871,0.710897,0.739999,0.728768,0.77193,0.75987,0.851736,0.732665,0.833009,0.727518,0.804974,0.742839,0.873698,0.760534,0.914628,0.727772,0.963906,0.652335,0.955869,0.665756,0.899619,0.6361,0.900042,0.694284,0.898326,0.739109,0.854737,0.748859,0.892659,0.727319,0.937766,0.744313,0.926132,0.746923,0.910365,0.740427,0.954228,0.741996,0.94004,0.632378,0.834981,0.652832,0.792969,0.678159,0.750936,0.642894,0.813174,0.621307,0.880934,0.627399,0.858617],"triangles":[63,30,62,63,62,17,61,36,59,61,59,13,61,58,36,63,58,30,61,13,58,63,17,58,57,53,56,57,56,28,55,54,45,57,54,53,55,29,54,57,28,54,56,53,46,54,29,53,55,45,52,55,52,29,62,12,49,62,49,17,50,18,48,49,15,48,50,48,16,49,48,17,56,46,8,53,16,46,54,28,45,52,45,7,52,44,29,51,44,41,52,7,44,51,18,44,43,19,42,51,41,42,51,42,18,43,42,6,44,7,41,42,41,6,43,6,40,43,40,19,40,39,19,60,19,39,40,5,39,60,39,20,38,4,37,39,37,20,39,5,37,38,37,5,59,36,19,58,17,36,60,35,19,59,19,35,60,20,35,59,35,13,35,20,32,34,32,20,34,14,32,35,32,13,34,20,31,33,31,22,33,14,31,34,31,14,58,13,30,62,30,12,50,29,18,44,18,29,50,16,29,53,29,16,56,8,28,27,26,2,27,1,26,33,22,24,25,24,22,25,0,24,33,24,14,26,23,2,26,22,23,23,22,21,31,21,22,25,22,1,26,1,22,23,21,4,37,4,21,31,20,21,37,21,20,42,19,18,36,18,19,36,17,18,48,18,17,46,16,9,47,9,16,48,15,16,47,16,15,49,12,15,47,15,10,15,12,11,15,11,10,47,10,9,46,9,8,40,6,5,23,4,3,23,3,2,25,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.04","display":[{"type":"mesh","name":"D_CLOTHES.04","path":"shizuku_01","vertices":[-153.11,-115.87,-86.84,-157.35,86.9,-163.9,163.91,-129.2,149.59,115.59,77.94,150.53,-76.09,150.53,-139.67,113.4,-86.84,15.15,6.3,15.15,85.11,6.41,2.64,-155.43,6.3,150.53],"uvs":[0.765625,0.809896,0.821615,0.794271,0.947917,0.789063,1,0.804688,0.99349,0.872396,0.941406,0.882813,0.829427,0.882813,0.779948,0.876302,0.821615,0.842448,0.889323,0.842448,0.946615,0.839844,0.886662,0.791588,0.889323,0.882813],"triangles":[11,9,2,10,2,9,10,9,5,12,5,9,12,9,6,11,1,9,9,1,8,9,8,6,8,0,7,8,7,6,10,5,4,10,4,3,10,3,2,8,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.05","display":[{"type":"mesh","name":"D_CLOTHES.05","path":"shizuku_01","vertices":[-100.13,-133.67,-23.16,-88.66,69.79,-49.17,101.74,69.33,133.69,169.3,42.19,153.4,-55.11,143.3,-108.84,61.91,-130.63,-7.02,-155.32,-116.09,66.88,117.85,-10.09,51.67,-47.85,-20.63,-94.32,-75.98,0.25,-32.3,54.93,61.94,-38.91,-45.25,27.46,4.27,21.92,-69.5,-143.82,-65.29,-110,-46.19,-69.04,-45.87,-78.16,20.4,-33.48,99.29,-55.53,56.39,-0.11,131.83,96.96,141.01,61.6,12.07,85.22,8.06],"uvs":[0.740885,0.452474,0.772135,0.477214,0.817057,0.514323,0.832031,0.560547,0.841797,0.607422,0.796224,0.60612,0.766927,0.599609,0.732422,0.558594,0.71875,0.522786,0.719401,0.465495,0.806641,0.579427,0.776693,0.549479,0.757161,0.51888,0.740885,0.486328,0.781653,0.517017,0.808869,0.555914,0.762581,0.503799,0.795669,0.532952,0.793923,0.495212,0.719098,0.492177,0.731324,0.502077,0.74974,0.504036,0.744866,0.538618,0.771618,0.57553,0.756321,0.553673,0.784833,0.59051,0.822466,0.592029,0.812544,0.537246,0.824289,0.536646],"triangles":[28,27,3,28,2,27,25,10,23,24,7,23,25,23,6,24,23,11,24,11,22,24,22,7,21,20,12,21,13,20,20,13,19,20,19,8,27,17,15,27,2,17,21,16,13,21,12,16,27,15,3,17,11,15,17,14,11,18,1,14,16,14,1,17,2,14,18,14,2,16,12,14,16,1,13,19,13,9,22,12,8,20,8,12,22,11,12,14,12,11,23,10,11,15,11,10,15,10,3,26,3,10,25,5,10,26,10,5,13,0,9,22,8,7,23,7,6,25,6,5,26,5,4,26,4,3,13,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.06","display":[{"type":"mesh","name":"D_CLOTHES.06","path":"shizuku_01","vertices":[72.25,-141.23,131.5,-133.68,149.67,-37.14,108.46,48.25,45.69,118.55,-52.06,136.05,-140.75,144.5,-110.22,49.15,-53.54,-62.52,25.78,-112.24,-13.92,47.95,39.72,-24.77,78.58,-88.35,77.57,-120.44,138.57,-100.59,28.11,-76.91],"uvs":[0.960286,0.444661,0.992188,0.453125,0.997396,0.513021,0.978516,0.556641,0.947917,0.593099,0.903646,0.605469,0.863932,0.610026,0.877604,0.558594,0.905599,0.508464,0.934245,0.472656,0.921224,0.557943,0.951172,0.520182,0.969401,0.481771,0.9646,0.462222,0.994377,0.478304,0.942095,0.494698],"triangles":[13,12,1,14,1,12,15,12,9,13,9,12,14,12,2,15,11,12,12,11,2,15,8,11,11,8,10,11,10,3,10,7,5,13,0,9,15,9,8,10,8,7,7,6,5,10,5,4,10,4,3,11,3,2,13,1,0],"userEdges":[]}]},{"name":"D_CLOTHES.00","display":[{"type":"mesh","name":"D_CLOTHES.00","path":"shizuku_01","vertices":[-135.53,-138.56,-63.22,-162.23,-23.21,-145.88,21.66,-152.23,63.67,-160.04,142.26,-139.29,147.41,-87.32,137.98,-7.53,113.11,56.89,67.67,108.86,4.23,155.71,-48.07,125.7,-96.94,62.74,-128.67,-10.46,-144.1,-83.66,-0.06,97.15,-1.78,42.25,51.38,58.35,-45.5,62.74,-66.94,15.16,70.24,10.04,-2.63,-15.58,-86.66,-44.86,79.67,-44.13,-4.63,-78.54,57.38,-99.52,-81.51,-96.84,107.9,-120.84,-112.13,-119.67],"uvs":[0.665039,0.036133,0.755859,0.012695,0.800781,0.03125,0.860352,0.03125,0.908203,0.011719,0.989258,0.035156,0.995117,0.109375,0.984375,0.21582,0.956055,0.301758,0.904297,0.371094,0.832031,0.433594,0.772461,0.393555,0.716797,0.30957,0.680664,0.211914,0.663086,0.114258,0.827148,0.355469,0.825195,0.282227,0.885742,0.303711,0.775391,0.30957,0.750977,0.246094,0.907227,0.239258,0.824219,0.205078,0.728516,0.166016,0.917969,0.166992,0.823242,0.125,0.908203,0.099609,0.734375,0.09668,0.955324,0.064664,0.6995,0.066226],"triangles":[27,4,25,28,26,1,28,14,26,2,26,24,27,25,6,3,24,25,25,24,23,26,22,24,25,23,6,24,21,23,24,22,21,26,14,22,22,19,21,23,21,20,21,16,20,23,20,7,22,13,19,21,19,16,19,12,18,19,18,16,20,17,8,20,16,17,18,15,16,17,16,15,17,15,9,18,11,15,28,0,14,22,14,13,19,13,12,18,12,11,15,11,10,15,10,9,17,9,8,20,8,7,23,7,6,27,6,5,27,5,4,25,4,3,24,3,2,26,2,1,28,1,0],"userEdges":[]}]},{"name":"D_NECK.00","display":[{"type":"mesh","name":"D_NECK.00","path":"shizuku_00","vertices":[-153.72,-130.04,-53.32,-132.38,56.98,-135.88,157.73,-133.55,134.36,-22.62,122.83,68.45,86.61,126.83,14.18,146.68,-71.43,124.49,-121.91,71.56,-137.26,-38.97,4.3,68.45,-5.58,-13.28,1.01,-81],"uvs":[0.27832,0.035156,0.331055,0.014648,0.396484,0.011719,0.442383,0.030273,0.439453,0.107422,0.435547,0.182617,0.414063,0.231445,0.371094,0.248047,0.320313,0.229492,0.294922,0.186523,0.283203,0.09668,0.365234,0.182617,0.362305,0.113281,0.363281,0.057617],"triangles":[13,12,4,13,10,12,12,11,5,12,9,11,13,0,10,12,10,9,11,9,8,11,8,7,11,7,6,11,6,5,12,5,4,13,4,3,13,3,2,13,2,1,13,1,0],"userEdges":[]}]},{"name":"D_NECK.01","display":[{"type":"mesh","name":"D_NECK.01","path":"shizuku_00","vertices":[-141.94,-73.42,-38.82,-120.02,97.3,-133.33,148.86,-77.12,132.36,34.58,49.87,133.33,-80.07,112.99,-135.75,30.14,-45.01,-29.03,66.37,-37.91],"uvs":[0.020508,0.036133,0.079102,0.013672,0.143555,0.007813,0.177734,0.033203,0.169922,0.081055,0.123047,0.124023,0.05957,0.112305,0.027344,0.081055,0.076172,0.053711,0.128906,0.049805],"triangles":[9,8,5,9,1,8,8,0,7,8,7,6,8,6,5,9,5,4,9,4,3,9,3,2,9,2,1,8,1,0],"userEdges":[]}]},{"name":"D_BODY.00","display":[{"type":"mesh","name":"D_BODY.00","path":"shizuku_00","vertices":[-154.9,-95.96,-87.61,-127.55,-11.05,-148.14,79.74,-135.91,151.46,-90.37,159.4,6.05,142.01,89.75,95.49,135.19,37.69,146.41,-67.97,142.54,-121.15,117.77,-153.57,38.25,-171.38,-42.9,-67.97,67.86,24.32,71.72,87.18,70.44,51.06,-5.53,-53.26,-10.68,-86.69,-77.64,-2.43,-80.22,100.55,-67.34],"uvs":[0.572174,0.646957,0.667826,0.617391,0.768696,0.594783,0.893913,0.608696,0.996522,0.648696,0.991304,0.806957,0.968696,0.92,0.937391,0.984348,0.833043,0.996522,0.695652,0.991304,0.617391,0.966956,0.584348,0.850435,0.558261,0.725217,0.695652,0.890435,0.815652,0.895652,0.897391,0.893913,0.850435,0.791304,0.714783,0.784348,0.671304,0.693913,0.78087,0.690435,0.914783,0.707826],"triangles":[3,19,20,20,19,16,19,18,17,19,1,18,18,12,17,11,13,17,19,17,16,17,14,16,20,16,5,16,15,5,16,14,15,15,14,8,17,13,14,8,14,13,18,0,12,17,12,11,13,11,10,13,10,9,13,9,8,15,8,7,15,7,6,15,6,5,20,5,4,20,4,3,19,3,2,19,2,1,18,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.01","display":[{"type":"mesh","name":"D_BACKGROUND.01","path":"shizuku_03","vertices":[-277.32,-351.93,-3.39,-383.42,250.07,-348.78,254.79,-87.45,10.77,-92.17,-282.04,-90.6],"uvs":[0.055147,0.496324,0.268382,0.471814,0.465686,0.498774,0.469363,0.702206,0.279412,0.698529,0.051471,0.699755],"triangles":[0,5,4,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.02","display":[{"type":"mesh","name":"D_BACKGROUND.02","path":"shizuku_03","vertices":[174.79,-441.38,179.52,-170.6,185.81,191.48,177.94,470.13,15.79,614.96,-39.31,613.39,-48.75,511.06,-327.4,506.34,-324.25,426.05,-168.4,407.16,-162.1,-376.83,-321.1,-383.13,-319.53,-485.46,-62.92,-493.33,-51.9,-573.62,40.98,-576.77,-61.35,-228.85,-164.78,-43.13,-45.61,74.99,-48.75,303.26,-166.64,188.33,79.16,242.3,182.08,323.76,68.87,389.84,-47.19,189.77,75.46,135.93,183.2,40.95,65.9,-46.66,67.98,489.98,92.45,546.49,-10.53,572.59,82.58,-358.39,177.58,-281.53,83.07,-193.93,58.94,-466.7,-62.27,-384.18,101.77,-515.26,-11.29,-534.8,20.5,354.23,18.36,441.9,-48.75,401.96,14.04,499.72,39.4,520.06,49.09,-527.06,107.45,-456.1,5.07,-430.02,-1.89,-479.99,150.22,-419.26,77.69,-487.95,176.17,-362.54,145.03,445.9,115.57,481.39,80.22,518.26,64.13,532.38,36.84,560.59,131.32,511.77,68.4,442.39,112.33,421.83,179.39,418.82,135.26,351.09],"uvs":[0.14951,0.044118,0.360294,0.040441,0.642157,0.035539,0.859069,0.041667,0.971814,0.167892,0.970588,0.210784,0.890931,0.218137,0.887255,0.435049,0.824755,0.432598,0.810049,0.311274,0.199755,0.306373,0.194853,0.430147,0.115196,0.428922,0.109069,0.229167,0.046569,0.220588,0.044118,0.148284,0.314951,0.227941,0.459522,0.308459,0.551471,0.215686,0.729167,0.218137,0.639707,0.309906,0.681719,0.118564,0.745129,0.038448,0.796569,0.126572,0.640822,0.216919,0.598914,0.12144,0.524975,0.037577,0.456775,0.128882,0.874524,0.127266,0.918514,0.10822,0.938829,0.188383,0.214113,0.115899,0.273947,0.041947,0.342138,0.115517,0.129801,0.134301,0.194034,0.228661,0.091997,0.100962,0.07679,0.188971,0.768849,0.164229,0.83709,0.165892,0.806,0.218137,0.882106,0.169259,0.897935,0.149516,0.082811,0.14197,0.138053,0.096541,0.15835,0.176241,0.119452,0.181653,0.166726,0.063247,0.113256,0.11971,0.210879,0.043047,0.84021,0.067286,0.867835,0.090217,0.896535,0.117736,0.907528,0.130266,0.929485,0.151511,0.891486,0.07796,0.837474,0.126936,0.821471,0.092743,0.819126,0.040538,0.766402,0.074892],"triangles":[58,59,57,59,58,22,58,57,50,59,23,57,57,56,51,57,23,56,54,29,53,52,42,53,54,53,42,55,51,52,53,29,52,55,52,29,57,51,50,56,28,51,52,51,28,55,3,51,51,3,50,58,50,3,49,47,31,49,0,47,46,13,45,46,45,34,47,44,31,48,44,36,48,34,44,47,0,44,48,36,43,48,43,34,52,28,42,54,42,30,42,41,30,42,28,41,56,39,28,41,28,39,40,39,38,40,6,39,41,39,6,56,23,39,39,23,38,40,38,19,43,37,34,46,34,37,43,15,37,46,37,13,44,0,36,43,36,15,45,35,31,45,13,35,45,31,34,44,34,31,49,31,32,33,32,31,33,1,32,35,16,31,33,31,16,54,30,4,41,6,30,54,4,29,33,16,27,33,27,1,27,25,26,27,26,1,26,25,2,27,18,25,25,24,21,25,18,24,38,23,21,59,21,23,59,22,21,24,19,21,38,21,19,22,2,21,25,21,2,40,9,6,40,19,9,24,18,20,24,20,19,19,20,9,27,16,18,20,18,17,18,16,17,17,16,10,35,10,16,35,13,10,37,15,14,37,14,13,10,13,12,12,11,10,9,8,7,9,7,6,30,6,5,30,5,4],"userEdges":[]}]},{"name":"D_BACKGROUND.03","display":[{"type":"mesh","name":"D_BACKGROUND.03","path":"shizuku_03","vertices":[17.56,-376.8,134.03,-293.98,132.73,-83.04,131.44,77.43,127.56,327.19,7.21,417.78,3.32,107.2,12.38,-138.68,81.18,-226.52,79.62,-4.96,73.13,237.17],"uvs":[0.026,0.967,0.09,0.877,0.253,0.878,0.377,0.879,0.57,0.882,0.64,0.975,0.4,0.978,0.21,0.971,0.142129,0.917835,0.313332,0.919042,0.500439,0.924058],"triangles":[9,6,3,10,3,6,8,7,2,9,2,7,8,0,7,9,7,6,10,6,5,10,5,4,10,4,3,9,3,2,8,2,1,8,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.04","display":[{"type":"mesh","name":"D_BACKGROUND.04","path":"shizuku_03","vertices":[-354.8,-51.76,-359.55,-116.78,-188.28,-123.13,-183.52,-67.62,-270.58,-87.85],"uvs":[0.655637,0.965686,0.651961,0.915441,0.784314,0.910539,0.78799,0.953431,0.720715,0.937796],"triangles":[4,0,3,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.05","display":[{"type":"mesh","name":"D_BACKGROUND.05","path":"shizuku_03","vertices":[-192.71,-107.62,-146.72,-126.65,-8.74,-117.14,-26.19,-41.01,-153.06,-66.39,-87.81,-84.8],"uvs":[0.031863,0.773284,0.067402,0.758578,0.17402,0.765931,0.160539,0.824755,0.0625,0.805147,0.11292,0.790921],"triangles":[5,1,4,5,4,3,5,3,2,5,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.06","display":[{"type":"mesh","name":"D_BACKGROUND.06","path":"shizuku_03","vertices":[9.32,458.67,7.74,384.14,68,376.21,71.17,463.43,38.61,417.51],"uvs":[0.526961,0.832108,0.469363,0.833333,0.463235,0.786765,0.530637,0.784314,0.495153,0.809475],"triangles":[4,0,3,4,3,2,4,2,1,4,1,0],"userEdges":[]}]},{"name":"D_BACKGROUND.07","display":[{"type":"mesh","name":"D_BACKGROUND.07","path":"shizuku_03","vertices":[94.6,394.84,72.39,451.93,116.8,458.28,126.31,398.01],"uvs":[0.477941,0.765931,0.522059,0.783088,0.526961,0.748775,0.480392,0.741422],"triangles":[0,2,3,2,0,1],"userEdges":[]}]},{"name":"D_BACKGROUND.08","display":[{"type":"mesh","name":"D_BACKGROUND.08","path":"shizuku_03","vertices":[40.07,-473.53,113.02,-471.94,139.98,-389.47,120.95,-224.54,9.94,-213.44,-10.68,-284.8,3.59,-397.4,71.79,-387.89,59.1,-294.32,91.83,-332.83,32.77,-251,88.9,-260.7,67.98,-219.24,27.99,-352.1,65.86,-344.15],"uvs":[0.214461,0.808824,0.215686,0.752451,0.279412,0.731618,0.406863,0.746324,0.415441,0.832108,0.360294,0.848039,0.273284,0.83701,0.280637,0.784314,0.352941,0.794118,0.323186,0.768826,0.386414,0.814464,0.378921,0.77109,0.410956,0.787254,0.308289,0.818161,0.314433,0.788896],"triangles":[14,7,13,14,13,8,12,11,10,12,3,11,12,10,4,11,8,10,11,3,9,14,9,7,14,8,9,11,9,8,10,8,5,13,5,8,9,2,7,13,7,6,7,0,6,13,6,5,10,5,4,9,3,2,7,2,1,7,1,0],"userEdges":[]}]}]}],"animation":[{"type":"tree","duration":0,"fadeInTime":0.5,"name":"f04.exp.json","timeline":[{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"value":0.15}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"value":1}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"value":0.8333}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"value":0.8333}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"value":1}]},{"name":"PARAM_TERE","type":40,"frame":[{"value":1}]}]},{"type":"tree","duration":0,"fadeInTime":0.5,"name":"f03.exp.json","timeline":[{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"value":0.6}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"value":0.4}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"value":0.4}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"value":0.15}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"value":0.65}]}]},{"type":"tree","duration":0,"fadeInTime":0.5,"name":"f02.exp.json","timeline":[{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"value":0.3}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"value":0.15}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"value":0.5667}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"value":0.5667}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"value":0.7}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"value":0.35}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"value":0.75}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"value":0.25}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{}]}]},{"type":"tree","duration":66,"playTimes":0,"fadeInTime":0.3,"name":"flick_head_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":13,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.415},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.535},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":4,"tweenEasing":0,"value":0.29},{"duration":2,"tweenEasing":0,"value":0.77},{"duration":2,"tweenEasing":0,"value":0.095},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":4,"tweenEasing":0,"value":0.665},{"duration":4,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.335},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.955},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.135},{"duration":4,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.35},{"duration":5,"value":0.04}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":7,"tweenEasing":0,"value":0.145},{"value":0.145},{"duration":58,"value":0.14}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":14,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.64},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":36,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":21,"value":0.505}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.22}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.24}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":14,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.64},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":36,"value":0.6667}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":66,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":23,"tweenEasing":0,"value":0.235},{"duration":6,"tweenEasing":0,"value":0.27},{"duration":2,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.495},{"duration":34,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":22,"tweenEasing":0,"value":0.825},{"tweenEasing":0,"value":0.895},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.845},{"duration":3,"tweenEasing":0,"value":0.795},{"duration":2,"tweenEasing":0,"value":0.615},{"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.51},{"duration":29,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.51},{"duration":4,"value":0.515}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":66,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.5043},{"duration":22,"tweenEasing":0,"value":0.5168},{"duration":17,"tweenEasing":0,"value":0.9757},{"tweenEasing":0,"value":0.9998},{"value":0.9997}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":23,"tweenEasing":0,"value":0.977},{"tweenEasing":0,"value":0.9737},{"duration":2,"tweenEasing":0,"value":0.9478},{"duration":5,"tweenEasing":0,"value":0.8603},{"duration":2,"tweenEasing":0,"value":0.5937},{"tweenEasing":0,"value":0.525},{"duration":30,"tweenEasing":0,"value":0.5065},{"tweenEasing":0,"value":0.4942},{"value":0.494}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.3355},{"duration":10,"tweenEasing":0,"value":0.3456},{"duration":30,"tweenEasing":0,"value":0.4978},{"tweenEasing":0,"value":0.499},{"value":0.4989}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":58,"tweenEasing":0,"value":0.39},{"value":0.39},{"duration":7,"value":0.385}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":52,"tweenEasing":0,"value":0.3367},{"value":0.3367},{"duration":13,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":57,"tweenEasing":0,"value":0.87},{"tweenEasing":0,"value":0.865},{"duration":8,"value":0.86}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":47,"tweenEasing":0,"value":0.375},{"tweenEasing":0,"value":0.495},{"duration":18,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.1933},{"tweenEasing":0,"value":0.19},{"duration":33,"value":0.1867}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":48,"tweenEasing":0,"value":0.815},{"tweenEasing":0,"value":0.82},{"duration":17,"value":0.825}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.385}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":66,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":21,"value":0.505}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":58,"playTimes":0,"fadeInTime":0.3,"name":"flick_head_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":10,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.03},{"duration":4,"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.69},{"duration":2,"tweenEasing":0,"value":0.84},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.555},{"duration":4,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":2,"tweenEasing":0,"value":0.745},{"duration":2,"tweenEasing":0,"value":0.065},{"duration":4,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.21},{"duration":3,"tweenEasing":0,"value":0.03},{"tweenEasing":0,"value":0.01},{"duration":4}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.435},{"tweenEasing":0,"value":0.27},{"value":0.265}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":19,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":23,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.56},{"duration":40,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.57}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":51,"tweenEasing":0,"value":0.305},{"tweenEasing":0,"value":0.245},{"duration":6,"value":0.24}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.57},{"duration":48,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.58}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.295},{"tweenEasing":0,"value":0.255},{"value":0.25}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":19,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":23,"value":0.6667}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.5213},{"tweenEasing":0,"value":0.7707},{"value":0.7733}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.57},{"duration":48,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.58}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":54,"tweenEasing":0,"value":0.24},{"tweenEasing":0,"value":0.315},{"duration":3,"value":0.32}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":58,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":54,"tweenEasing":0,"value":0.2433},{"tweenEasing":0,"value":0.24},{"duration":3,"value":0.2367}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.815}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.4},{"value":0.395}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.56},{"duration":40,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.57}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":78,"playTimes":0,"fadeInTime":0.3,"name":"flick_head_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.06},{"duration":4,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.73},{"duration":6,"tweenEasing":0,"value":0.965},{"duration":4,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.39},{"duration":2,"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.645},{"duration":2,"tweenEasing":0,"value":0.68},{"duration":2,"tweenEasing":0,"value":0.58},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":4,"tweenEasing":0,"value":0.54},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.14},{"tweenEasing":0,"value":0.085},{"duration":13,"value":0.03}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.255},{"tweenEasing":0,"value":0.495},{"duration":43,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":41,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.46}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.5},{"duration":20,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.775},{"duration":43,"value":0.78}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.69},{"duration":44,"value":0.695}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":31,"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.495},{"duration":46,"value":0.5}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.6567},{"duration":41,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6433},{"duration":3,"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.46}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":19,"tweenEasing":0,"value":0.16},{"duration":15,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.495},{"duration":43,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.505},{"duration":43,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.59},{"duration":45,"value":0.595}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.1208},{"tweenEasing":0,"value":0.499},{"duration":42,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":10,"tweenEasing":0,"value":0.9978},{"duration":22,"tweenEasing":0,"value":0.9422},{"duration":27,"tweenEasing":0,"value":0.5202},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.4632},{"duration":6,"tweenEasing":0,"value":0.4218},{"tweenEasing":0,"value":0.0782},{"tweenEasing":0,"value":0.0368},{"tweenEasing":0,"value":0.01},{"tweenEasing":0},{"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.0368},{"duration":3,"tweenEasing":0,"value":0.0782},{"tweenEasing":0,"value":0.25},{"tweenEasing":0,"value":0.3123}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.675},{"duration":44,"value":0.68}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.2926},{"tweenEasing":0,"value":0.4994},{"duration":42,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.485},{"duration":8,"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.75},{"duration":3,"tweenEasing":0,"value":0.735},{"duration":11,"tweenEasing":0,"value":0.66},{"duration":3,"tweenEasing":0,"value":0.21},{"tweenEasing":0,"value":0.135},{"tweenEasing":0,"value":0.125},{"duration":42,"value":0.12}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.3533},{"tweenEasing":0,"value":0.3367},{"duration":47,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.265},{"duration":8,"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.485},{"tweenEasing":0,"value":0.495},{"duration":63,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":78,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":78,"value":0.815}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.585},{"duration":45,"value":0.59}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"duration":21,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.78},{"tweenEasing":0,"value":0.78},{"duration":43,"value":0.785}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":269,"playTimes":0,"fadeInTime":2,"name":"idle_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":176,"tweenEasing":0},{"tweenEasing":0,"value":0.005},{"duration":92}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6633},{"tweenEasing":0,"value":0.6367},{"duration":2,"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.3567},{"duration":29,"tweenEasing":0,"value":0.33},{"duration":21,"tweenEasing":0,"value":0.3567},{"duration":4,"tweenEasing":0,"value":0.9333},{"duration":7,"tweenEasing":0,"value":0.9933},{"duration":22,"tweenEasing":0,"value":0.9733},{"duration":46,"tweenEasing":0,"value":0.6767},{"tweenEasing":0,"value":0.6533},{"duration":5,"tweenEasing":0,"value":0.6233},{"duration":2,"tweenEasing":0,"value":0.3933},{"duration":2,"tweenEasing":0,"value":0.3433},{"duration":12,"tweenEasing":0,"value":0.34},{"duration":71,"tweenEasing":0,"value":0.6033},{"tweenEasing":0,"value":0.6633},{"duration":10,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6633},{"tweenEasing":0,"value":0.64},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.36},{"duration":29,"tweenEasing":0,"value":0.3367},{"duration":22,"tweenEasing":0,"value":0.3567},{"duration":5,"tweenEasing":0,"value":0.95},{"duration":28,"tweenEasing":0,"value":1},{"duration":45,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.6533},{"duration":5,"tweenEasing":0,"value":0.6233},{"duration":2,"tweenEasing":0,"value":0.3933},{"duration":2,"tweenEasing":0,"value":0.3433},{"duration":12,"tweenEasing":0,"value":0.34},{"duration":71,"tweenEasing":0,"value":0.6033},{"tweenEasing":0,"value":0.6633},{"duration":10,"value":0.6667}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.5},{"duration":87,"tweenEasing":0,"value":0.285},{"duration":27,"tweenEasing":0,"value":0.765},{"duration":66,"tweenEasing":0,"value":0.49},{"duration":50,"tweenEasing":0,"value":0.825},{"tweenEasing":0,"value":0.505},{"duration":3,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.205},{"tweenEasing":0,"value":0.06},{"duration":15,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":0.14},{"duration":8,"tweenEasing":0,"value":0.74},{"duration":7,"tweenEasing":0,"value":0.77},{"duration":17,"tweenEasing":0,"value":0.665},{"duration":5,"tweenEasing":0,"value":0.275},{"duration":24,"tweenEasing":0,"value":0.25},{"duration":4,"tweenEasing":0,"value":0.69},{"duration":7,"tweenEasing":0,"value":0.71},{"duration":30,"tweenEasing":0,"value":0.615},{"duration":32,"tweenEasing":0,"value":0.11},{"duration":45,"tweenEasing":0,"value":0.015},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"duration":3,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":267,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.4998},{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":41,"tweenEasing":0,"value":0.5},{"duration":54,"tweenEasing":0,"value":0.626},{"duration":85,"tweenEasing":0,"value":0.2032},{"duration":31,"tweenEasing":0,"value":0.5232},{"duration":56,"tweenEasing":0,"value":0.1202},{"tweenEasing":0,"value":0.4997},{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":266,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5001},{"duration":2,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":52,"tweenEasing":0,"value":0.5},{"duration":92,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.505},{"duration":124,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":246,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.33},{"duration":22,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.415},{"duration":35,"tweenEasing":0,"value":0.48},{"duration":146,"tweenEasing":0,"value":0.085},{"duration":18,"tweenEasing":0,"value":0.155},{"tweenEasing":0,"value":0.41},{"duration":2,"value":0.415}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.6},{"tweenEasing":0,"value":0.6},{"duration":3,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.63},{"duration":2,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.65},{"duration":3,"tweenEasing":0,"value":0.65},{"duration":46,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.99},{"duration":3,"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.96},{"tweenEasing":0,"value":0.94},{"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":0.91},{"duration":17,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"duration":8,"tweenEasing":0,"value":0.6},{"tweenEasing":0,"value":0.6},{"duration":5,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"duration":4,"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.63},{"duration":3,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.66},{"duration":2,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.67},{"duration":90,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.98},{"tweenEasing":0,"value":0.96},{"duration":11,"tweenEasing":0,"value":0.96},{"tweenEasing":0,"value":0.86},{"duration":28,"tweenEasing":0,"value":0.84},{"tweenEasing":0,"value":0.61},{"duration":4,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":270,"playTimes":0,"fadeInTime":2,"name":"idle_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.6367},{"duration":5,"tweenEasing":0,"value":0.6067},{"duration":2,"tweenEasing":0,"value":0.3833},{"duration":10,"tweenEasing":0,"value":0.3367},{"duration":25,"tweenEasing":0,"value":0.3433},{"duration":20,"tweenEasing":0,"value":0.8833},{"duration":26,"tweenEasing":0,"value":0.9967},{"duration":47,"tweenEasing":0,"value":0.6733},{"tweenEasing":0,"value":0.6567},{"duration":9,"tweenEasing":0,"value":0.64},{"duration":5,"tweenEasing":0,"value":0.2867},{"duration":2,"tweenEasing":0,"value":0.0567},{"duration":30,"tweenEasing":0,"value":0.0067},{"duration":4,"tweenEasing":0,"value":0.0067},{"duration":6,"tweenEasing":0,"value":0.1},{"duration":3,"tweenEasing":0,"value":0.3367},{"duration":6,"tweenEasing":0,"value":0.4667},{"duration":6,"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6633},{"duration":30,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":31,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6533},{"duration":5,"tweenEasing":0,"value":0.6233},{"duration":2,"tweenEasing":0,"value":0.3933},{"duration":10,"tweenEasing":0,"value":0.3433},{"duration":5,"tweenEasing":0,"value":0.34},{"duration":17,"tweenEasing":0,"value":0.4367},{"duration":22,"tweenEasing":0,"value":0.8567},{"duration":27,"tweenEasing":0,"value":1},{"duration":47,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.6567},{"duration":9,"tweenEasing":0,"value":0.64},{"duration":5,"tweenEasing":0,"value":0.2867},{"duration":2,"tweenEasing":0,"value":0.0567},{"duration":30,"tweenEasing":0,"value":0.0067},{"duration":4,"tweenEasing":0,"value":0.0067},{"duration":6,"tweenEasing":0,"value":0.1},{"duration":3,"tweenEasing":0,"value":0.3367},{"duration":6,"tweenEasing":0,"value":0.4667},{"duration":6,"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6633},{"duration":30,"value":0.6667}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":39,"tweenEasing":0,"value":0.5},{"duration":83,"tweenEasing":0,"value":0.285},{"duration":27,"tweenEasing":0,"value":0.765},{"duration":85,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495},{"duration":35,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.69},{"duration":3,"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.14},{"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.015},{"duration":12,"tweenEasing":0},{"duration":34,"tweenEasing":0,"value":0.105},{"duration":7,"tweenEasing":0,"value":0.745},{"duration":7,"tweenEasing":0,"value":0.77},{"duration":17,"tweenEasing":0,"value":0.665},{"duration":5,"tweenEasing":0,"value":0.275},{"duration":24,"tweenEasing":0,"value":0.25},{"duration":4,"tweenEasing":0,"value":0.69},{"duration":3,"tweenEasing":0,"value":0.71},{"duration":10,"tweenEasing":0,"value":0.685},{"duration":89,"tweenEasing":0,"value":0.48},{"tweenEasing":0,"value":0.495},{"duration":17,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":222,"tweenEasing":0,"value":0.5},{"duration":45,"tweenEasing":0,"value":0.4515},{"tweenEasing":0,"value":0.5003},{"duration":2,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":41,"tweenEasing":0,"value":0.5},{"duration":54,"tweenEasing":0,"value":0.626},{"duration":110,"tweenEasing":0,"value":0.2032},{"tweenEasing":0,"value":0.5002},{"duration":64,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":179,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.4999},{"duration":90,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":52,"tweenEasing":0,"value":0.5},{"duration":92,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.505},{"duration":125,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":246,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.33},{"duration":23,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"tweenEasing":0,"value":1}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.6},{"tweenEasing":0,"value":0.6},{"duration":3,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.63},{"duration":2,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.65},{"duration":3,"tweenEasing":0,"value":0.65},{"duration":46,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.99},{"duration":3,"tweenEasing":0,"value":0.99},{"tweenEasing":0,"value":0.96},{"tweenEasing":0,"value":0.94},{"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":0.91},{"duration":17,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.61},{"duration":179,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":270,"playTimes":0,"fadeInTime":2,"name":"idle_00","timeline":[{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.5},{"duration":24,"tweenEasing":0,"value":0.3902},{"duration":75,"tweenEasing":0,"value":0.6823},{"tweenEasing":0,"value":0.5007},{"duration":90,"value":0.5}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.5},{"duration":49,"tweenEasing":0,"value":0.1833},{"duration":23,"tweenEasing":0,"value":0.206},{"duration":165,"tweenEasing":0,"value":0.6368},{"tweenEasing":0,"value":0.5003},{"duration":2,"value":0.5}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":84,"tweenEasing":0,"value":0.5},{"duration":184,"tweenEasing":0,"value":0.5616},{"tweenEasing":0,"value":0.4999},{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.3333}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":60,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":7,"tweenEasing":0,"value":0.57},{"duration":2,"tweenEasing":0,"value":0.91},{"tweenEasing":0,"value":0.975},{"duration":168,"tweenEasing":0,"value":0.995},{"duration":2,"tweenEasing":0,"value":0.995},{"duration":9,"tweenEasing":0,"value":0.95},{"duration":2,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.505},{"duration":15,"value":0.5}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":55,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":34,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6567},{"duration":6,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.3567},{"duration":60,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3433},{"duration":6,"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.66},{"duration":49,"value":0.6667}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":55,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3633},{"duration":2,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.5467},{"tweenEasing":0,"value":0.6367},{"duration":34,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.6567},{"duration":6,"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.3567},{"duration":60,"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3433},{"duration":6,"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.66},{"duration":49,"value":0.6667}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.5},{"duration":24,"tweenEasing":0,"value":0.43},{"duration":161,"tweenEasing":0,"value":0.685},{"tweenEasing":0,"value":0.505},{"duration":4,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":77,"tweenEasing":0,"value":0.5},{"duration":9,"tweenEasing":0,"value":0.705},{"duration":14,"tweenEasing":0,"value":0.54},{"duration":4,"tweenEasing":0,"value":0.185},{"duration":162,"tweenEasing":0,"value":0.145},{"tweenEasing":0,"value":0.495},{"duration":3,"value":0.5}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":139,"playTimes":0,"fadeInTime":0.3,"name":"pinch_in_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":17,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.095},{"duration":4,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.535},{"duration":2,"tweenEasing":0,"value":1},{"duration":4,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.61},{"duration":20,"tweenEasing":0,"value":0.195},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.3},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":4,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":4,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":14,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.03},{"duration":4,"tweenEasing":0,"value":0.635},{"duration":2,"tweenEasing":0,"value":0.605},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.7},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.635},{"duration":12,"tweenEasing":0,"value":0.895},{"duration":4,"tweenEasing":0,"value":0.66},{"duration":2,"tweenEasing":0,"value":0.155},{"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.01},{"duration":5,"value":0.005}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":129,"tweenEasing":0,"value":0.89},{"duration":8,"tweenEasing":0,"value":0.945},{"tweenEasing":0,"value":0.84},{"tweenEasing":0,"value":0.825}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8733},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.7233},{"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4833},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3733},{"duration":2,"tweenEasing":0,"value":0.4733},{"tweenEasing":0,"value":0.7433},{"tweenEasing":0,"value":0.8433},{"duration":64,"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4367},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.3233},{"tweenEasing":0,"value":0.3433},{"duration":3,"tweenEasing":0,"value":0.3833},{"tweenEasing":0,"value":0.5367},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6033},{"duration":31,"tweenEasing":0,"value":0.6133},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":93,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.465},{"duration":9,"tweenEasing":0,"value":0.435},{"duration":33,"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.295},{"tweenEasing":0,"value":0.31}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":111,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":27,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.16},{"tweenEasing":0,"value":0.15},{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":61,"tweenEasing":0,"value":0.74},{"duration":8,"tweenEasing":0,"value":0.8},{"duration":18,"tweenEasing":0,"value":0.68},{"duration":6,"tweenEasing":0,"value":0.27},{"duration":44,"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.37}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":133,"tweenEasing":0,"value":0.075},{"duration":4,"tweenEasing":0,"value":0.03},{"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.075}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8767},{"tweenEasing":0,"value":0.7433},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.7233},{"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4833},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3733},{"duration":2,"tweenEasing":0,"value":0.4733},{"tweenEasing":0,"value":0.7433},{"tweenEasing":0,"value":0.8433},{"duration":64,"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.35},{"duration":3,"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.5367},{"tweenEasing":0,"value":0.6},{"duration":31,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":139,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":65,"tweenEasing":0,"value":0.515},{"duration":23,"tweenEasing":0,"value":0.55},{"duration":4,"tweenEasing":0,"value":0.915},{"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":0.915},{"duration":2,"tweenEasing":0,"value":0.885},{"duration":5,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.43},{"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.29},{"tweenEasing":0,"value":0.265},{"duration":31,"tweenEasing":0,"value":0.255},{"tweenEasing":0,"value":0.31},{"tweenEasing":0,"value":0.315}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":93,"tweenEasing":0,"value":0.545},{"duration":3,"tweenEasing":0,"value":0.6},{"duration":7,"tweenEasing":0,"value":0.545},{"duration":31,"tweenEasing":0,"value":0.365},{"duration":3,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.39}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":139,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":129,"tweenEasing":0,"value":0.505},{"duration":8,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.735},{"tweenEasing":0,"value":0.72}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":132,"tweenEasing":0,"value":0.7722},{"duration":5,"tweenEasing":0,"value":0.9732},{"tweenEasing":0,"value":0.9192},{"tweenEasing":0,"value":0.9062}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":84,"tweenEasing":0,"value":0.6392},{"duration":21,"tweenEasing":0,"value":0.5245},{"duration":32,"tweenEasing":0,"value":0.2512},{"tweenEasing":0,"value":0.2923},{"value":0.2997}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":61,"tweenEasing":0,"value":0.745},{"duration":8,"tweenEasing":0,"value":0.805},{"duration":18,"tweenEasing":0,"value":0.685},{"duration":6,"tweenEasing":0,"value":0.27},{"duration":44,"tweenEasing":0,"value":0.235},{"tweenEasing":0,"value":0.31},{"value":0.315}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.4752},{"tweenEasing":0,"value":0.4877},{"tweenEasing":0,"value":0.4883}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":136,"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.285},{"duration":2,"value":0.29}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":136,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.36},{"duration":2,"value":0.3567}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":87,"tweenEasing":0,"value":0.435},{"duration":15,"tweenEasing":0,"value":0.61},{"duration":35,"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.72},{"value":0.715}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":136,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.425},{"duration":2,"value":0.43}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":130,"tweenEasing":0,"value":0.4767},{"duration":7,"tweenEasing":0,"value":0.5433},{"tweenEasing":0,"value":0.4633},{"tweenEasing":0,"value":0.45}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.305},{"duration":3,"tweenEasing":0,"value":0.195},{"duration":129,"tweenEasing":0,"value":0.165},{"tweenEasing":0,"value":0.445},{"tweenEasing":0,"value":0.455}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.455},{"value":0.46}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":134,"tweenEasing":0,"value":0.405},{"tweenEasing":0,"value":0.5},{"duration":4,"value":0.505}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":137,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.555},{"tweenEasing":0,"value":0.55}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.44},{"duration":112,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.355}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":96,"tweenEasing":0,"value":0.5},{"duration":9,"tweenEasing":0,"value":0.44},{"duration":32,"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.385}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.58},{"value":0.58},{"duration":113,"value":0.59}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":78,"playTimes":0,"fadeInTime":0.3,"name":"pinch_in_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.005},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.58},{"duration":2,"tweenEasing":0,"value":0.83},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":4,"tweenEasing":0,"value":0.715},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.28},{"duration":2,"tweenEasing":0,"value":0.095},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.205},{"tweenEasing":0,"value":0.04},{"tweenEasing":0,"value":0.535},{"tweenEasing":0,"value":1},{"duration":7,"tweenEasing":0,"value":0.97},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":4,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.58},{"duration":15,"tweenEasing":0,"value":0.07},{"tweenEasing":0,"value":0.065},{"duration":3,"value":0.06}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":78,"value":0.675}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.5933},{"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.73},{"tweenEasing":0,"value":0.8267},{"tweenEasing":0,"value":0.8867},{"duration":30,"tweenEasing":0,"value":0.9067},{"tweenEasing":0,"value":0.8267},{"duration":2,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.3733},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3767},{"duration":2,"tweenEasing":0,"value":0.4767},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.8067},{"tweenEasing":0,"value":0.8667},{"duration":17,"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.8567},{"tweenEasing":0,"value":0.8533}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":78,"value":0.505}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":78,"value":0.305}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":73,"tweenEasing":0,"value":0.855},{"tweenEasing":0,"value":0.915},{"duration":4,"value":0.91}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.5933},{"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3867},{"duration":2,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.8233},{"tweenEasing":0,"value":0.8833},{"duration":30,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8267},{"duration":2,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.3733},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3767},{"duration":2,"tweenEasing":0,"value":0.4767},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.8067},{"tweenEasing":0,"value":0.8667},{"duration":17,"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.8567},{"tweenEasing":0,"value":0.8533}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":78,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":20,"tweenEasing":0,"value":0.54},{"duration":18,"tweenEasing":0,"value":0.52},{"duration":2,"tweenEasing":0,"value":0.305},{"duration":7,"tweenEasing":0,"value":0.305},{"duration":12,"tweenEasing":0,"value":0.425},{"duration":3,"tweenEasing":0,"value":0.74},{"duration":12,"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.77},{"duration":3,"value":0.765}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.34},{"duration":15,"tweenEasing":0,"value":0.28},{"duration":12,"tweenEasing":0,"value":0.56},{"duration":23,"tweenEasing":0,"value":0.87},{"duration":7,"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.99},{"duration":2,"value":0.985}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":78,"value":0.51}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":76,"tweenEasing":0,"value":0.5833},{"tweenEasing":0,"value":0.5963},{"tweenEasing":0,"value":0.5995}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.4947},{"duration":23,"tweenEasing":0,"value":0.5628},{"duration":41,"tweenEasing":0,"value":0.983},{"tweenEasing":0,"value":0.983},{"value":0.98}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":75,"tweenEasing":0,"value":0.855},{"tweenEasing":0,"value":0.915},{"duration":2,"value":0.91}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":43,"tweenEasing":0,"value":0.4833},{"duration":19,"tweenEasing":0,"value":0.409},{"duration":14,"tweenEasing":0,"value":0.6238},{"tweenEasing":0,"value":0.6174},{"tweenEasing":0,"value":0.6163}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":59,"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.4},{"duration":18,"value":0.405}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":78,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":59,"tweenEasing":0,"value":0.475},{"tweenEasing":0,"value":0.455},{"duration":18,"value":0.46}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.485},{"duration":27,"tweenEasing":0,"value":0.435},{"tweenEasing":0,"value":0.57},{"duration":6,"value":0.565}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.21}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":76,"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.375},{"value":0.38}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":78,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":14,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":9,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":55,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":12,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":78,"value":0.51}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":76,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.235},{"value":0.23}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":78,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":84,"playTimes":0,"fadeInTime":0.3,"name":"pinch_in_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":3,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.225},{"duration":4,"tweenEasing":0,"value":0.635},{"duration":2,"tweenEasing":0,"value":0.66},{"duration":2,"tweenEasing":0,"value":0.175},{"duration":26,"tweenEasing":0,"value":0.015},{"duration":4,"tweenEasing":0,"value":0.22},{"duration":2,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.54},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":10,"tweenEasing":0,"value":0.51},{"duration":2,"tweenEasing":0,"value":0.895},{"duration":3,"tweenEasing":0,"value":0.22},{"tweenEasing":0,"value":0.055},{"duration":4}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.68},{"value":0.68},{"duration":20,"value":0.675}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.92},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5133},{"tweenEasing":0,"value":0.3833},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.7933},{"duration":11,"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.81},{"duration":16,"value":0.8133}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":20,"value":0.505}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":20,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.31},{"value":0.31},{"duration":20,"value":0.305}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":53,"tweenEasing":0,"value":0.71},{"duration":29,"tweenEasing":0,"value":0.975},{"tweenEasing":0,"value":0.945},{"value":0.94}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.93},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5133},{"tweenEasing":0,"value":0.3833},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.7933},{"duration":28,"value":0.81}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":65,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":73,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.565},{"duration":10,"value":0.56}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.815},{"tweenEasing":0,"value":0.685},{"value":0.68}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.515},{"value":0.515},{"duration":20,"value":0.51}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.7602},{"duration":39,"tweenEasing":0,"value":0.9083},{"duration":27,"tweenEasing":0,"value":0.9885},{"tweenEasing":0,"value":0.5877},{"tweenEasing":0,"value":0.5845},{"duration":8,"value":0.5833}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.4067},{"tweenEasing":0,"value":0.4395},{"tweenEasing":0,"value":0.4405}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":53,"tweenEasing":0,"value":0.71},{"duration":29,"tweenEasing":0,"value":0.975},{"tweenEasing":0,"value":0.945},{"value":0.94}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.4908},{"tweenEasing":0,"value":0.4751},{"duration":2,"value":0.4752}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":72,"tweenEasing":0,"value":0.29},{"tweenEasing":0,"value":0.375},{"duration":11,"value":0.38}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.3333},{"value":0.3333},{"duration":20,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":64,"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.48},{"duration":19,"value":0.475}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":61,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.48},{"duration":22,"value":0.485}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.21}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.54},{"value":0.535}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.44},{"value":0.44},{"duration":20,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":84,"value":0.505}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.51},{"value":0.51},{"value":0.505}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.515},{"value":0.515},{"duration":20,"value":0.51}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.35},{"duration":3,"value":0.355}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":20,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":85,"playTimes":0,"fadeInTime":0.5,"name":"shake_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":6,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":4,"tweenEasing":0,"value":0.12},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.575},{"duration":6,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":4,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.19},{"duration":10,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.025},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":4,"tweenEasing":0,"value":0.275},{"duration":2,"tweenEasing":0,"value":0.995},{"duration":2,"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.445},{"duration":4,"tweenEasing":0,"value":0.995},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.7},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.51},{"duration":7,"tweenEasing":0,"value":0.045},{"tweenEasing":0,"value":0.055},{"duration":2,"value":0.06}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":78,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.28},{"duration":6,"value":0.275}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7167},{"duration":3,"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.88},{"duration":5,"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.8767},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.7167},{"tweenEasing":0,"value":0.5033},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.85},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"duration":2,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.8033},{"duration":32,"tweenEasing":0,"value":0.7633},{"tweenEasing":0,"value":0.77},{"duration":7,"value":0.7733}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.47},{"value":0.465}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.35},{"duration":2,"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.03},{"duration":65,"tweenEasing":0},{"tweenEasing":0,"value":0.17},{"tweenEasing":0,"value":0.175}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.415},{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.735},{"tweenEasing":0,"value":0.805},{"duration":39,"tweenEasing":0,"value":0.83},{"duration":26,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.625},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.305},{"duration":2,"tweenEasing":0,"value":0.245},{"tweenEasing":0,"value":0.085},{"tweenEasing":0,"value":0.025},{"duration":65,"tweenEasing":0},{"tweenEasing":0,"value":0.225},{"tweenEasing":0,"value":0.23}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"duration":3,"tweenEasing":0,"value":0.46},{"duration":4,"tweenEasing":0,"value":0.35},{"duration":15,"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.495},{"duration":48,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.7233},{"tweenEasing":0,"value":0.7367},{"duration":4,"tweenEasing":0,"value":0.75},{"tweenEasing":0,"value":0.8833},{"duration":5,"tweenEasing":0,"value":0.8967},{"tweenEasing":0,"value":0.87},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.4967},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.8533},{"tweenEasing":0,"value":0.9067},{"tweenEasing":0,"value":0.7633},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.8633},{"tweenEasing":0,"value":0.9067},{"duration":2,"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.8033},{"duration":40,"value":0.7867}]},{"name":"PARAM_DESK","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.465},{"tweenEasing":0,"value":0.455},{"tweenEasing":0,"value":0.475},{"tweenEasing":0,"value":0.51},{"duration":2,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.51},{"duration":64,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.34},{"tweenEasing":0,"value":0.3},{"duration":18,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.5},{"duration":48,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.29},{"duration":5,"tweenEasing":0,"value":0.265},{"duration":61,"tweenEasing":0,"value":0.355},{"tweenEasing":0,"value":0.455},{"duration":5,"value":0.46}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.48},{"tweenEasing":0,"value":0.46},{"duration":2,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.23},{"duration":10,"tweenEasing":0,"value":0.21},{"duration":15,"tweenEasing":0,"value":0.31},{"duration":31,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.495},{"duration":10,"value":0.49}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.715},{"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.785},{"duration":17,"tweenEasing":0,"value":0.785},{"tweenEasing":0,"value":0.51},{"duration":48,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.515},{"duration":3,"value":0.52}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.8623},{"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.8647},{"duration":2,"tweenEasing":0,"value":0.8193},{"tweenEasing":0,"value":0.6985},{"tweenEasing":0,"value":0.6527},{"duration":65,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.5842},{"value":0.5833}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.5142},{"tweenEasing":0,"value":0.4923},{"value":0.4922}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.575},{"duration":2,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.875},{"duration":65,"tweenEasing":0,"value":0.9},{"tweenEasing":0,"value":0.635},{"tweenEasing":0,"value":0.63}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.5272},{"tweenEasing":0,"value":0.5277},{"tweenEasing":0,"value":0.5273}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.125},{"duration":2,"tweenEasing":0,"value":0.19},{"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.415},{"duration":55,"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.265},{"duration":11,"value":0.26}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":7,"tweenEasing":0,"value":0.28},{"duration":3,"tweenEasing":0,"value":0.2833},{"duration":7,"tweenEasing":0,"value":0.3333},{"duration":65,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.3067},{"duration":2,"value":0.3033}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.38},{"duration":4,"tweenEasing":0,"value":0.38},{"duration":64,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.37},{"duration":3,"value":0.365}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.705},{"duration":4,"tweenEasing":0,"value":0.695},{"tweenEasing":0,"value":0.56},{"duration":61,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.57},{"duration":5,"value":0.575}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":10,"tweenEasing":0,"value":0.3233},{"duration":7,"tweenEasing":0,"value":0.34},{"duration":66,"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.29},{"tweenEasing":0,"value":0.2867}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.36},{"duration":3,"value":0.365}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.415},{"tweenEasing":0,"value":0.42},{"duration":4,"tweenEasing":0,"value":0.435},{"tweenEasing":0,"value":0.575},{"duration":16,"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.56},{"duration":50,"value":0.555}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.48},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.335},{"duration":18,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.49},{"duration":48,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.73},{"tweenEasing":0,"value":0.785},{"duration":4,"tweenEasing":0,"value":0.81},{"duration":13,"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.51},{"duration":48,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.485},{"duration":3,"tweenEasing":0,"value":0.455},{"tweenEasing":0,"value":0.345},{"duration":61,"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.475},{"duration":5,"value":0.47}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":2,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":70,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":11,"value":0.505}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.015},{"tweenEasing":0},{"tweenEasing":0,"value":0.065},{"duration":2,"tweenEasing":0,"value":0.22},{"tweenEasing":0,"value":0.625},{"tweenEasing":0,"value":0.78},{"tweenEasing":0,"value":0.845},{"duration":24,"tweenEasing":0,"value":0.845},{"duration":39,"tweenEasing":0,"value":0.39},{"tweenEasing":0,"value":0.245},{"duration":2,"value":0.24}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":82,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.475},{"duration":2,"value":0.47}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":86,"playTimes":0,"fadeInTime":0.5,"name":"shake_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":20,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":4,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.95},{"duration":4,"tweenEasing":0,"value":0.8},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":4,"tweenEasing":0,"value":0.205},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":4,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.085},{"duration":2,"tweenEasing":0,"value":0.125},{"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.84},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.59},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.81},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.445},{"duration":6,"tweenEasing":0,"value":0.77},{"duration":2,"tweenEasing":0,"value":0.755},{"tweenEasing":0,"value":0.15},{"tweenEasing":0,"value":0.085},{"duration":4,"value":0.025}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":86,"value":0.68}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.74},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3533},{"duration":2,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5333},{"tweenEasing":0,"value":0.5833},{"tweenEasing":0,"value":0.6167},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.5467},{"duration":3,"tweenEasing":0,"value":0.4633},{"tweenEasing":0,"value":0.1633},{"tweenEasing":0,"value":0.08},{"tweenEasing":0,"value":0.02},{"duration":24,"tweenEasing":0},{"tweenEasing":0},{"duration":37,"value":0.0033}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.305},{"value":0.305},{"duration":48,"value":0.31}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.76},{"duration":5,"tweenEasing":0,"value":0.75},{"duration":10,"tweenEasing":0,"value":0.65},{"duration":4,"tweenEasing":0,"value":0.37},{"duration":28,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.3},{"duration":33,"value":0.295}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.185},{"tweenEasing":0,"value":0.35},{"duration":51,"value":0.355}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":3,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"duration":2,"tweenEasing":0,"value":0.6567},{"tweenEasing":0,"value":0.4367},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3533},{"duration":2,"tweenEasing":0,"value":0.4033},{"tweenEasing":0,"value":0.5333},{"tweenEasing":0,"value":0.5833},{"tweenEasing":0,"value":0.6167},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.5467},{"duration":3,"tweenEasing":0,"value":0.4633},{"tweenEasing":0,"value":0.1633},{"tweenEasing":0,"value":0.08},{"tweenEasing":0,"value":0.02},{"duration":24,"tweenEasing":0},{"tweenEasing":0},{"duration":37,"value":0.0033}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":77,"tweenEasing":0,"value":0.415},{"tweenEasing":0,"value":0.475},{"duration":8,"value":0.48}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":63,"tweenEasing":0,"value":0.565},{"tweenEasing":0,"value":0.62},{"duration":22,"value":0.625}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.49}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":84,"tweenEasing":0,"value":0.6675},{"tweenEasing":0,"value":0.6802},{"tweenEasing":0,"value":0.6773}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.5703},{"duration":16,"tweenEasing":0,"value":0.5522},{"duration":63,"tweenEasing":0,"value":0.1095},{"tweenEasing":0,"value":0.2483},{"tweenEasing":0,"value":0.256}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.765},{"duration":6,"tweenEasing":0,"value":0.755},{"duration":8,"tweenEasing":0,"value":0.62},{"duration":5,"tweenEasing":0,"value":0.375},{"duration":18,"tweenEasing":0,"value":0.31},{"tweenEasing":0,"value":0.305},{"duration":43,"value":0.3}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":64,"tweenEasing":0,"value":0.5517},{"tweenEasing":0,"value":0.5168},{"duration":21,"value":0.5167}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":48,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":25,"tweenEasing":0,"value":0.425},{"duration":3,"tweenEasing":0,"value":0.355},{"duration":53,"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.36},{"duration":4,"value":0.355}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.4},{"duration":51,"value":0.405}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.485},{"duration":52,"value":0.49}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.2067},{"duration":15,"tweenEasing":0,"value":0.2267},{"duration":63,"tweenEasing":0,"value":0.5633},{"tweenEasing":0,"value":0.51},{"value":0.4967}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.77},{"tweenEasing":0,"value":0.765},{"duration":2,"value":0.76}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.44},{"value":0.44},{"duration":48,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":86,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":86,"value":0.48}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":7,"tweenEasing":0,"value":0.465},{"duration":13,"tweenEasing":0,"value":0.495},{"duration":3,"tweenEasing":0,"value":0.775},{"duration":46,"tweenEasing":0,"value":0.805},{"tweenEasing":0,"value":0.585},{"duration":16,"value":0.58}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":86,"value":0.505}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":101,"playTimes":0,"fadeInTime":0.5,"name":"shake_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":0.09},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":4,"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.91},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.375},{"duration":2,"tweenEasing":0,"value":0.07},{"duration":2,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":4,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.605},{"duration":2,"tweenEasing":0,"value":0.44},{"duration":6,"tweenEasing":0,"value":0.07},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.135},{"duration":4,"tweenEasing":0,"value":0.99},{"duration":2,"tweenEasing":0,"value":0.675},{"duration":2,"tweenEasing":0,"value":0.95},{"tweenEasing":0,"value":0.83},{"tweenEasing":0,"value":0.955},{"tweenEasing":0,"value":1},{"duration":3,"tweenEasing":0,"value":0.96},{"duration":2,"tweenEasing":0,"value":0.62},{"duration":2,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.745},{"duration":2,"tweenEasing":0,"value":0.95},{"duration":2,"tweenEasing":0,"value":0.72},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.975},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":12,"tweenEasing":0,"value":0.125},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.06},{"tweenEasing":0,"value":0.015}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.325},{"tweenEasing":0,"value":0.305},{"duration":56,"value":0.3}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7167},{"duration":3,"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.88},{"duration":5,"tweenEasing":0,"value":0.8933},{"tweenEasing":0,"value":0.8767},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.7167},{"tweenEasing":0,"value":0.5033},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.85},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"duration":2,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.86},{"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8733},{"tweenEasing":0,"value":0.82},{"duration":18,"tweenEasing":0,"value":0.78},{"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.37},{"duration":2,"tweenEasing":0,"value":0.4367},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.6767},{"duration":25,"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.6867},{"duration":13,"value":0.69}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":86,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.495},{"duration":14,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.35},{"duration":2,"tweenEasing":0,"value":0.28},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.03},{"duration":40,"tweenEasing":0},{"tweenEasing":0,"value":0.165},{"duration":53,"value":0.17}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.555},{"tweenEasing":0,"value":0.735},{"tweenEasing":0,"value":0.8},{"duration":17,"tweenEasing":0,"value":0.83},{"duration":10,"tweenEasing":0,"value":0.76},{"duration":12,"tweenEasing":0,"value":0.585},{"duration":3,"tweenEasing":0,"value":0.2},{"duration":14,"tweenEasing":0,"value":0.145},{"duration":24,"tweenEasing":0,"value":0.215},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.49},{"duration":12,"value":0.495}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.305},{"duration":2,"tweenEasing":0,"value":0.245},{"tweenEasing":0,"value":0.085},{"tweenEasing":0,"value":0.025},{"duration":41,"tweenEasing":0},{"tweenEasing":0,"value":0.015},{"duration":52,"value":0.01}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"duration":3,"tweenEasing":0,"value":0.46},{"duration":4,"tweenEasing":0,"value":0.35},{"duration":15,"tweenEasing":0,"value":0.35},{"tweenEasing":0,"value":0.495},{"duration":75,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"tweenEasing":0,"value":0.7367},{"tweenEasing":0,"value":0.7367},{"tweenEasing":0,"value":0.7533},{"duration":2,"tweenEasing":0,"value":0.7867},{"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.92},{"duration":3,"tweenEasing":0,"value":0.9367},{"duration":2,"tweenEasing":0,"value":0.9267},{"tweenEasing":0,"value":0.8867},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.3567},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.4567},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.8533},{"tweenEasing":0,"value":0.9067},{"tweenEasing":0,"value":0.7633},{"tweenEasing":0,"value":0.5267},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.59},{"tweenEasing":0,"value":0.7467},{"tweenEasing":0,"value":0.8633},{"tweenEasing":0,"value":0.9067},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":18,"tweenEasing":0,"value":0.8033},{"tweenEasing":0,"value":0.6533},{"duration":2,"tweenEasing":0,"value":0.5867},{"tweenEasing":0,"value":0.4067},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3233},{"tweenEasing":0,"value":0.3533},{"duration":2,"tweenEasing":0,"value":0.4233},{"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.68},{"duration":31,"tweenEasing":0,"value":0.71},{"tweenEasing":0,"value":0.68},{"duration":7,"value":0.6833}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.465},{"tweenEasing":0,"value":0.455},{"tweenEasing":0,"value":0.475},{"tweenEasing":0,"value":0.51},{"duration":2,"tweenEasing":0,"value":0.53},{"tweenEasing":0,"value":0.51},{"duration":91,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.49},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.34},{"tweenEasing":0,"value":0.3},{"duration":18,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.5},{"duration":75,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":2,"tweenEasing":0,"value":0.26},{"duration":5,"tweenEasing":0,"value":0.265},{"duration":27,"tweenEasing":0,"value":0.355},{"duration":5,"tweenEasing":0,"value":0.43},{"duration":8,"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.725},{"duration":5,"tweenEasing":0,"value":0.675},{"tweenEasing":0,"value":0.39},{"tweenEasing":0,"value":0.355},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.37},{"duration":5,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.705},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.765},{"duration":2,"tweenEasing":0,"value":0.775},{"duration":14,"tweenEasing":0,"value":0.765},{"duration":2,"tweenEasing":0,"value":0.51},{"tweenEasing":0,"value":0.505},{"duration":9,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.48},{"tweenEasing":0,"value":0.455},{"duration":2,"tweenEasing":0,"value":0.405},{"tweenEasing":0,"value":0.275},{"tweenEasing":0,"value":0.23},{"duration":10,"tweenEasing":0,"value":0.21},{"duration":15,"tweenEasing":0,"value":0.31},{"duration":20,"tweenEasing":0,"value":0.5},{"duration":8,"tweenEasing":0,"value":0.44},{"duration":2,"tweenEasing":0,"value":0.575},{"duration":2,"tweenEasing":0,"value":0.585},{"duration":7,"tweenEasing":0,"value":0.57},{"duration":27,"tweenEasing":0,"value":0.445},{"tweenEasing":0,"value":0.535},{"duration":2,"value":0.54}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.505},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.575},{"tweenEasing":0,"value":0.715},{"tweenEasing":0,"value":0.765},{"tweenEasing":0,"value":0.785},{"duration":17,"tweenEasing":0,"value":0.785},{"tweenEasing":0,"value":0.51},{"duration":75,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":37,"tweenEasing":0,"value":0.5},{"duration":18,"tweenEasing":0,"value":0.48},{"duration":9,"tweenEasing":0,"value":0.155},{"duration":26,"tweenEasing":0,"value":0.145},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"duration":9,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"tweenEasing":0,"value":0.889},{"tweenEasing":0,"value":0.8833},{"tweenEasing":0,"value":0.8603},{"duration":2,"tweenEasing":0,"value":0.8137},{"tweenEasing":0,"value":0.695},{"tweenEasing":0,"value":0.6513},{"duration":82,"tweenEasing":0,"value":0.6333},{"tweenEasing":0,"value":0.5835},{"duration":11,"value":0.5833}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.5167},{"duration":3,"tweenEasing":0,"value":0.4937},{"duration":10,"tweenEasing":0,"value":0.4317},{"duration":2,"tweenEasing":0,"value":0.0618},{"duration":27,"tweenEasing":0,"value":0.0168},{"duration":14,"tweenEasing":0,"value":0.0143},{"duration":3,"tweenEasing":0,"value":0.3167},{"duration":6,"tweenEasing":0,"value":0.3985},{"tweenEasing":0,"value":0.4493},{"tweenEasing":0,"value":0.45}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.57},{"duration":2,"tweenEasing":0,"value":0.635},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.875},{"duration":19,"tweenEasing":0,"value":0.9},{"duration":8,"tweenEasing":0,"value":0.815},{"duration":13,"tweenEasing":0,"value":0.67},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":25,"tweenEasing":0,"value":0.095},{"duration":13,"tweenEasing":0,"value":0.145},{"duration":5,"tweenEasing":0,"value":0.465},{"tweenEasing":0,"value":0.49},{"duration":8,"value":0.495}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":36,"tweenEasing":0,"value":0.5333},{"duration":14,"tweenEasing":0,"value":0.5185},{"tweenEasing":0,"value":0.3351},{"tweenEasing":0,"value":0.3333},{"duration":8,"tweenEasing":0,"value":0.343},{"tweenEasing":0,"value":0.611},{"tweenEasing":0,"value":0.6273},{"tweenEasing":0,"value":0.6333},{"duration":8,"tweenEasing":0,"value":0.6237},{"tweenEasing":0,"value":0.3557},{"duration":17,"tweenEasing":0,"value":0.3393},{"tweenEasing":0,"value":0.4985},{"duration":11,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"duration":79,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.495},{"duration":21,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.13},{"duration":2,"tweenEasing":0,"value":0.2},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.45},{"duration":45,"tweenEasing":0,"value":0.48},{"duration":46,"tweenEasing":0,"value":0.24},{"tweenEasing":0,"value":0.275},{"duration":2,"value":0.28}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.36},{"duration":42,"tweenEasing":0,"value":0.4867},{"tweenEasing":0,"value":0.3467},{"duration":52,"value":0.3433}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":2,"tweenEasing":0,"value":0.375},{"duration":4,"tweenEasing":0,"value":0.38},{"duration":80,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.43},{"duration":14,"value":0.435}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.71},{"tweenEasing":0,"value":0.705},{"duration":4,"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.56},{"duration":28,"tweenEasing":0,"value":0.55},{"duration":15,"tweenEasing":0,"value":0.56},{"duration":3,"tweenEasing":0,"value":0.365},{"duration":7,"tweenEasing":0,"value":0.38},{"duration":2,"tweenEasing":0,"value":0.5},{"duration":11,"tweenEasing":0,"value":0.51},{"duration":25,"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.565},{"duration":2,"value":0.57}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.35},{"duration":84,"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.5767},{"duration":10,"value":0.5733}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":99,"tweenEasing":0,"value":0.27},{"tweenEasing":0,"value":0.35},{"value":0.355}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.42},{"duration":2,"tweenEasing":0,"value":0.43},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.575},{"duration":16,"tweenEasing":0,"value":0.585},{"tweenEasing":0,"value":0.56},{"duration":77,"value":0.555}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.495},{"tweenEasing":0,"value":0.48},{"duration":2,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.335},{"duration":18,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.49},{"duration":75,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.73},{"tweenEasing":0,"value":0.785},{"duration":4,"tweenEasing":0,"value":0.81},{"duration":13,"tweenEasing":0,"value":0.775},{"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.51},{"duration":75,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.47},{"duration":2,"tweenEasing":0,"value":0.395},{"tweenEasing":0,"value":0.195},{"tweenEasing":0,"value":0.12},{"tweenEasing":0,"value":0.09},{"duration":23,"tweenEasing":0,"value":0.09},{"duration":14,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495},{"duration":55,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.5},{"duration":4,"tweenEasing":0,"value":0.485},{"duration":8,"tweenEasing":0,"value":0.4},{"duration":4,"tweenEasing":0,"value":0.155},{"duration":23,"tweenEasing":0,"value":0.105},{"duration":5,"tweenEasing":0,"value":0.105},{"duration":7,"tweenEasing":0,"value":0.225},{"duration":3,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.495},{"duration":11,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"value":0.05},{"duration":2,"tweenEasing":0,"value":0.18},{"tweenEasing":0,"value":0.515},{"tweenEasing":0,"value":0.645},{"duration":4,"tweenEasing":0,"value":0.695},{"duration":21,"tweenEasing":0,"value":0.675},{"duration":33,"tweenEasing":0,"value":0.385},{"duration":22,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.31},{"duration":13,"value":0.305}]},{"name":"D_CLOTHES.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.30","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.07","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.06","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.08","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.09","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.10","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAIR_TWIN.29","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.11","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.01","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.00","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.02","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.03","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.04","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.05","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":124,"playTimes":0,"fadeInTime":0.3,"name":"pinch_out_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":11,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.76},{"duration":4,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.305},{"duration":2,"tweenEasing":0,"value":0.235},{"duration":4,"tweenEasing":0,"value":0.92},{"duration":14,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.155},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.11},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.55},{"duration":4,"tweenEasing":0,"value":0.885},{"tweenEasing":0,"value":0.07},{"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":4,"tweenEasing":0,"value":0.29},{"duration":6,"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.555},{"duration":2,"tweenEasing":0,"value":1},{"duration":6,"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.745},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.025},{"duration":12,"tweenEasing":0,"value":0.885},{"duration":2,"tweenEasing":0,"value":0.77},{"duration":15,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.11},{"tweenEasing":0,"value":0.115}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":124,"value":0.655}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.2967},{"duration":2,"tweenEasing":0,"value":0.3},{"duration":9,"tweenEasing":0,"value":0.3333},{"duration":8,"tweenEasing":0,"value":0.6033},{"duration":20,"tweenEasing":0,"value":0.72},{"tweenEasing":0,"value":0.7233},{"value":0.7267}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":46,"tweenEasing":0,"value":0.175},{"value":0.175},{"duration":77,"value":0.18}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":124,"value":0.635}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":124,"value":0.295}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":83,"tweenEasing":0,"value":0.3033},{"tweenEasing":0,"value":0.31},{"duration":10,"tweenEasing":0,"value":0.3233},{"duration":28,"tweenEasing":0,"value":0.61},{"tweenEasing":0,"value":0.67},{"value":0.6733}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":124,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.49},{"value":0.49},{"duration":99,"value":0.485}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":47,"tweenEasing":0,"value":0.64},{"value":0.64},{"duration":76,"value":0.645}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":122,"tweenEasing":0,"value":0.7285},{"tweenEasing":0,"value":0.4833},{"tweenEasing":0,"value":0.4838}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":122,"tweenEasing":0,"value":0.9372},{"tweenEasing":0,"value":0.7333},{"value":0.7232}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":124,"value":0.735}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":119,"tweenEasing":0,"value":0.4995},{"tweenEasing":0,"value":0.5332},{"duration":4,"value":0.5333}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":124,"value":0.445}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":46,"tweenEasing":0,"value":0.3167},{"value":0.3167},{"duration":77,"value":0.3133}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":72,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.5},{"duration":51,"value":0.495}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":115,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.58},{"duration":8,"value":0.585}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":124,"value":0.5933}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":98,"tweenEasing":0,"value":0.305},{"tweenEasing":0,"value":0.275},{"duration":25,"value":0.27}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":124,"value":0.515}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":124,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":124,"value":0.25}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":124,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":166,"playTimes":0,"fadeInTime":0.3,"name":"pinch_out_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":45,"tweenEasing":0,"value":0.065},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":6,"tweenEasing":0,"value":1},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.1},{"duration":2,"tweenEasing":0,"value":0.26},{"duration":8,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.69},{"duration":12,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":4,"tweenEasing":0,"value":0.665},{"duration":2,"tweenEasing":0,"value":0.95},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.555},{"duration":2,"tweenEasing":0,"value":0.84},{"duration":2,"tweenEasing":0,"value":0.165},{"duration":2,"tweenEasing":0,"value":0.55},{"duration":2,"tweenEasing":0,"value":0.72},{"duration":2,"tweenEasing":0,"value":0.68},{"duration":2,"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.44},{"duration":4,"tweenEasing":0,"value":0.085},{"duration":2,"tweenEasing":0,"value":0.11},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.87},{"duration":2,"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.335},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":4,"tweenEasing":0,"value":0.845},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":4,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.955},{"duration":2,"tweenEasing":0,"value":0.705},{"tweenEasing":0,"value":0.665},{"tweenEasing":0,"value":0.355},{"duration":25,"value":0.04}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":15,"tweenEasing":0,"value":0.3},{"duration":20,"tweenEasing":0,"value":0.33},{"duration":2,"tweenEasing":0,"value":0.64},{"tweenEasing":0,"value":0.65},{"duration":128,"value":0.655}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.6267},{"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.31},{"tweenEasing":0,"value":0.34},{"duration":2,"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.6967},{"duration":13,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7133},{"duration":5,"tweenEasing":0,"value":0.6733},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3067},{"duration":127,"value":0.2967}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.17},{"value":0.17},{"duration":141,"value":0.175}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.375},{"duration":18,"tweenEasing":0,"value":0.425},{"tweenEasing":0,"value":0.63},{"tweenEasing":0,"value":0.63},{"duration":128,"value":0.635}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":151,"tweenEasing":0,"value":0.195},{"tweenEasing":0,"value":0.3},{"duration":14,"value":0.295}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":6,"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.3467},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.3433},{"duration":2,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.6967},{"duration":13,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.6733},{"duration":3,"tweenEasing":0,"value":0.62},{"tweenEasing":0,"value":0.43},{"tweenEasing":0,"value":0.3767},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3133},{"duration":127,"value":0.3033}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":166,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":93,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":72,"value":0.49}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":117,"tweenEasing":0,"value":0.625},{"tweenEasing":0,"value":0.63},{"duration":48,"value":0.635}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":130,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":35,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.8833},{"duration":20,"tweenEasing":0,"value":0.823},{"duration":126,"tweenEasing":0,"value":0.5843},{"tweenEasing":0,"value":0.5837},{"value":0.5845}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":164,"tweenEasing":0,"value":0.5365},{"tweenEasing":0,"value":0.8502},{"value":0.8507}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.4},{"duration":21,"tweenEasing":0,"value":0.44},{"tweenEasing":0,"value":0.73},{"duration":128,"value":0.735}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":164,"tweenEasing":0,"value":0.5392},{"tweenEasing":0,"value":0.5333},{"value":0.5331}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":36,"tweenEasing":0,"value":0.335},{"tweenEasing":0,"value":0.44},{"duration":129,"value":0.445}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.3033},{"tweenEasing":0,"value":0.3133},{"duration":133,"value":0.3167}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":30,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.475},{"duration":135,"value":0.48}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.495},{"duration":136,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":15,"tweenEasing":0,"value":0.27},{"duration":22,"tweenEasing":0,"value":0.2967},{"tweenEasing":0,"value":0.59},{"duration":128,"value":0.5933}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":12,"tweenEasing":0,"value":1},{"duration":5,"tweenEasing":0,"value":0.99},{"duration":16,"tweenEasing":0,"value":0.89},{"duration":4,"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.32},{"duration":128,"value":0.31}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.52},{"duration":131,"value":0.515}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":161,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":4,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":35,"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.255},{"duration":130,"value":0.25}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":223,"playTimes":0,"fadeInTime":0.3,"name":"pinch_out_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.125},{"duration":4,"tweenEasing":0,"value":0.895},{"duration":2,"tweenEasing":0,"value":0.81},{"duration":2,"tweenEasing":0,"value":0.36},{"duration":2,"tweenEasing":0,"value":0.41},{"duration":2,"tweenEasing":0,"value":0.94},{"duration":4,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.565},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.735},{"duration":2,"tweenEasing":0,"value":0.125},{"duration":4,"tweenEasing":0,"value":0.01},{"duration":4,"tweenEasing":0,"value":0.81},{"duration":2,"tweenEasing":0,"value":0.3},{"duration":6,"tweenEasing":0,"value":0.3},{"duration":2,"tweenEasing":0,"value":0.015},{"duration":2,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.955},{"duration":4,"tweenEasing":0,"value":0.55},{"duration":2,"tweenEasing":0,"value":0.375},{"duration":18,"tweenEasing":0,"value":0.03},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.525},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.83},{"duration":2,"tweenEasing":0,"value":0.32},{"duration":2,"tweenEasing":0,"value":0.825},{"duration":2,"tweenEasing":0,"value":0.88},{"duration":2,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.36},{"duration":2,"tweenEasing":0,"value":0.815},{"duration":2,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.015},{"duration":2,"tweenEasing":0,"value":0.01},{"duration":2,"tweenEasing":0,"value":0.5},{"duration":4,"tweenEasing":0,"value":0.735},{"duration":4,"tweenEasing":0,"value":0.175},{"duration":6,"tweenEasing":0,"value":0.025},{"tweenEasing":0,"value":0.04},{"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":1},{"tweenEasing":0,"value":0.955},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.375},{"duration":2,"tweenEasing":0,"value":0.485},{"duration":4,"tweenEasing":0,"value":0.085},{"duration":2,"tweenEasing":0,"value":0.135},{"duration":16,"tweenEasing":0,"value":0.01},{"duration":4,"tweenEasing":0,"value":0.11},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.94},{"duration":2,"tweenEasing":0,"value":0.965},{"duration":2,"tweenEasing":0,"value":0.69},{"duration":2,"tweenEasing":0,"value":0.94},{"duration":2,"tweenEasing":0,"value":0.72},{"duration":2,"tweenEasing":0,"value":0.87},{"duration":2,"tweenEasing":0,"value":0.84},{"duration":4,"tweenEasing":0,"value":0.205},{"duration":6,"tweenEasing":0,"value":0.9},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":2,"tweenEasing":0,"value":0.665},{"duration":11,"tweenEasing":0,"value":0.1},{"tweenEasing":0,"value":0.09},{"tweenEasing":0,"value":0.085}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.3}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.2267},{"tweenEasing":0,"value":0.11},{"tweenEasing":0,"value":0.0333},{"duration":13,"tweenEasing":0,"value":0.0033},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":52,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.79},{"duration":2,"tweenEasing":0,"value":0.6733},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.23},{"tweenEasing":0,"value":0.1133},{"tweenEasing":0,"value":0.0333},{"duration":13,"tweenEasing":0,"value":0.0033},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":37,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7267},{"duration":2,"tweenEasing":0,"value":0.6467},{"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.3433},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.3433},{"duration":2,"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.5967},{"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.71},{"duration":26,"value":0.7267}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.17}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":34,"tweenEasing":0,"value":0.47},{"duration":11,"tweenEasing":0,"value":0.49},{"duration":5,"tweenEasing":0,"value":0.295},{"duration":11,"tweenEasing":0,"value":0.29},{"duration":113,"tweenEasing":0,"value":0.485},{"tweenEasing":0,"value":0.38},{"duration":48,"value":0.375}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":14,"tweenEasing":0,"value":0.16},{"tweenEasing":0,"value":0.19},{"duration":208,"value":0.195}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":32,"tweenEasing":0,"value":0.9033},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7867},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.2233},{"tweenEasing":0,"value":0.1067},{"tweenEasing":0,"value":0.03},{"duration":13,"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":52,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.79},{"duration":3,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.2233},{"tweenEasing":0,"value":0.1067},{"tweenEasing":0,"value":0.03},{"duration":13,"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"value":0.0267},{"tweenEasing":0,"value":0.0967},{"duration":4,"tweenEasing":0,"value":0.1867},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.7133},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.83},{"duration":37,"tweenEasing":0,"value":0.8467},{"tweenEasing":0,"value":0.7},{"tweenEasing":0,"value":0.6233},{"tweenEasing":0,"value":0.5133},{"tweenEasing":0,"value":0.4133},{"tweenEasing":0,"value":0.34},{"tweenEasing":0,"value":0.3133},{"tweenEasing":0,"value":0.3433},{"duration":2,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.5767},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.6867},{"duration":26,"value":0.7}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":223,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":124,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":98,"value":0.495}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":172,"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.62},{"duration":50,"value":0.625}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":223,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":148,"tweenEasing":0,"value":0.5777},{"duration":36,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.883},{"duration":38,"value":0.8833}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.7308},{"duration":2,"tweenEasing":0,"value":0.657},{"duration":9,"tweenEasing":0,"value":0.6102},{"duration":2,"tweenEasing":0,"value":0.2603},{"duration":2,"tweenEasing":0,"value":0.2158},{"tweenEasing":0,"value":0.2},{"duration":2,"tweenEasing":0,"value":0.2058},{"duration":9,"tweenEasing":0,"value":0.2482},{"duration":2,"tweenEasing":0,"value":0.6037},{"duration":55,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.6608},{"duration":9,"tweenEasing":0,"value":0.6185},{"duration":2,"tweenEasing":0,"value":0.263},{"duration":2,"tweenEasing":0,"value":0.2167},{"tweenEasing":0,"value":0.2},{"duration":2,"tweenEasing":0,"value":0.2058},{"duration":9,"tweenEasing":0,"value":0.2482},{"duration":2,"tweenEasing":0,"value":0.6037},{"duration":75,"tweenEasing":0,"value":0.65},{"tweenEasing":0,"value":0.4127},{"tweenEasing":0,"value":0.417}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":33,"tweenEasing":0,"value":0.5},{"duration":14,"tweenEasing":0,"value":0.5},{"duration":2,"tweenEasing":0,"value":0.33},{"duration":14,"tweenEasing":0,"value":0.33},{"duration":110,"tweenEasing":0,"value":0.5},{"tweenEasing":0,"value":0.405},{"duration":49,"value":0.4}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":221,"tweenEasing":0,"value":0.4835},{"tweenEasing":0,"value":0.5414},{"value":0.5413}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":178,"tweenEasing":0,"value":0.32},{"tweenEasing":0,"value":0.34},{"duration":44,"value":0.335}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":24,"tweenEasing":0,"value":0.3267},{"tweenEasing":0,"value":0.3067},{"duration":198,"value":0.3033}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":176,"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.44},{"duration":46,"value":0.435}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":56,"tweenEasing":0,"value":0.57},{"duration":68,"tweenEasing":0,"value":0.54},{"duration":16,"tweenEasing":0,"value":0.54},{"duration":41,"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.465},{"duration":41,"value":0.46}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":155,"tweenEasing":0,"value":0.2833},{"tweenEasing":0,"value":0.2733},{"duration":67,"value":0.27}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":51,"tweenEasing":0,"value":0.88},{"duration":68,"tweenEasing":0,"value":0.99},{"duration":14,"tweenEasing":0,"value":0.905},{"duration":18,"tweenEasing":0,"value":1},{"duration":30,"tweenEasing":0,"value":0.895},{"tweenEasing":0,"value":0.995},{"duration":41,"value":1}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":155,"tweenEasing":0,"value":0.555},{"value":0.555},{"duration":67,"value":0.56}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":223,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":38,"tweenEasing":0,"value":0.305},{"duration":16,"tweenEasing":0,"value":0.31},{"duration":68,"tweenEasing":0,"value":0.285},{"duration":16,"tweenEasing":0,"value":0.31},{"duration":8,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.33},{"duration":76,"value":0.335}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.6}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":53,"playTimes":0,"fadeInTime":0.3,"name":"tap_body_02","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":11,"tweenEasing":0,"value":0.06},{"duration":2,"tweenEasing":0,"value":0.065},{"duration":2,"tweenEasing":0,"value":0.32},{"duration":4,"tweenEasing":0,"value":0.91},{"duration":2,"tweenEasing":0,"value":0.595},{"duration":2,"tweenEasing":0,"value":0.14},{"duration":2,"tweenEasing":0,"value":0.73},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":4,"tweenEasing":0,"value":0.41},{"duration":2,"tweenEasing":0,"value":0.775},{"duration":2,"tweenEasing":0,"value":0.08},{"duration":6,"tweenEasing":0,"value":0.91},{"duration":2,"tweenEasing":0,"value":0.8},{"duration":2,"tweenEasing":0,"value":0.555},{"duration":3,"tweenEasing":0,"value":0.19},{"tweenEasing":0,"value":0.045},{"duration":4}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":53,"value":0.455}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.0033},{"tweenEasing":0},{"tweenEasing":0,"value":0.01},{"tweenEasing":0,"value":0.04},{"tweenEasing":0,"value":0.0867},{"duration":7,"tweenEasing":0,"value":0.1467},{"tweenEasing":0,"value":0.6667},{"duration":2,"tweenEasing":0,"value":0.7267},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.8333},{"duration":21,"value":0.84}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":48,"tweenEasing":0,"value":0.23},{"value":0.23},{"duration":4,"value":0.235}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.75},{"duration":11,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.535},{"duration":22,"value":0.525}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":41,"tweenEasing":0,"value":0.22},{"tweenEasing":0,"value":0.23},{"duration":11,"value":0.235}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":17,"tweenEasing":0,"value":0.0033},{"tweenEasing":0,"value":0.0133},{"tweenEasing":0,"value":0.0467},{"tweenEasing":0,"value":0.0933},{"duration":7,"tweenEasing":0,"value":0.15},{"duration":2,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.7767},{"tweenEasing":0,"value":0.81},{"tweenEasing":0,"value":0.8333},{"duration":21,"value":0.84}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":29,"tweenEasing":0,"value":0.55},{"tweenEasing":0,"value":0.6},{"duration":23,"value":0.605}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.625},{"duration":11,"tweenEasing":0,"value":0.61},{"duration":2,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.345},{"duration":21,"value":0.34}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"tweenEasing":0,"value":0.6328},{"tweenEasing":0,"value":0.6332},{"duration":51,"value":0.6333}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":4,"tweenEasing":0,"value":0.483},{"duration":10,"tweenEasing":0,"value":0.4697},{"duration":3,"tweenEasing":0,"value":0.2932},{"duration":12,"tweenEasing":0,"value":0.2872},{"duration":2,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.5807},{"duration":21,"value":0.5833}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.75},{"duration":11,"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.535},{"duration":22,"value":0.525}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":53,"value":0.24}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":36,"tweenEasing":0,"value":0.2167},{"value":0.2133},{"duration":16,"value":0.2167}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":53,"value":0.455}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":51,"tweenEasing":0,"value":0.2033},{"tweenEasing":0,"value":0.18},{"value":0.1767}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":22,"tweenEasing":0,"value":0.89},{"tweenEasing":0,"value":0.91},{"duration":30,"value":0.915}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":50,"tweenEasing":0,"value":0.685},{"tweenEasing":0,"value":0.665},{"duration":2,"value":0.66}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":44,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":8,"value":0.495}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":18,"tweenEasing":0,"value":0.625},{"duration":11,"tweenEasing":0,"value":0.61},{"duration":2,"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.345},{"duration":21,"value":0.34}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":28,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.535},{"duration":24,"value":0.54}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"duration":53,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.59}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":100,"playTimes":0,"fadeInTime":0.3,"name":"tap_body_01","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":23,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.855},{"duration":4,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.645},{"duration":2,"tweenEasing":0,"value":0.605},{"duration":2,"tweenEasing":0,"value":0.07},{"duration":4,"tweenEasing":0,"value":0.705},{"duration":2,"tweenEasing":0,"value":0.55},{"duration":2,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.61},{"duration":2,"tweenEasing":0,"value":0.25},{"duration":2,"tweenEasing":0,"value":0.92},{"duration":4,"tweenEasing":0,"value":0.855},{"duration":2,"tweenEasing":0,"value":0.425},{"duration":2,"tweenEasing":0,"value":0.355},{"duration":2,"tweenEasing":0,"value":0.65},{"duration":2,"tweenEasing":0,"value":0.625},{"duration":2,"tweenEasing":0,"value":0.47},{"duration":4,"tweenEasing":0,"value":0.77},{"duration":25,"tweenEasing":0,"value":0.055},{"tweenEasing":0,"value":0.055},{"tweenEasing":0,"value":0.06}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"duration":22,"tweenEasing":0,"value":0.585},{"duration":17,"tweenEasing":0,"value":0.705},{"duration":17,"tweenEasing":0,"value":0.6},{"duration":41,"tweenEasing":0,"value":0.705},{"tweenEasing":0,"value":0.6},{"duration":2,"value":0.595}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":21,"tweenEasing":0,"value":0.75},{"tweenEasing":0,"value":0.7667},{"duration":2,"tweenEasing":0,"value":0.6867},{"tweenEasing":0,"value":0.4433},{"tweenEasing":0,"value":0.36},{"tweenEasing":0,"value":0.3267},{"tweenEasing":0,"value":0.3533},{"duration":3,"tweenEasing":0,"value":0.4167},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":16,"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5633},{"tweenEasing":0,"value":0.4467},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":35,"tweenEasing":0,"value":0.7567},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.73}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":100,"value":0.5}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"duration":98,"tweenEasing":0,"value":0.13},{"tweenEasing":0,"value":0.005},{"value":0.01}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":17,"tweenEasing":0,"value":0.67},{"tweenEasing":0,"value":0.745},{"duration":82,"value":0.75}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"duration":96,"tweenEasing":0,"value":0.145},{"tweenEasing":0},{"duration":3,"value":0.005}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":21,"tweenEasing":0,"value":0.7533},{"tweenEasing":0,"value":0.7667},{"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.5633},{"tweenEasing":0,"value":0.4467},{"tweenEasing":0,"value":0.3633},{"tweenEasing":0,"value":0.33},{"tweenEasing":0,"value":0.3567},{"duration":3,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":16,"tweenEasing":0,"value":0.76},{"tweenEasing":0,"value":0.7667},{"duration":2,"tweenEasing":0,"value":0.69},{"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.36},{"duration":3,"tweenEasing":0,"value":0.42},{"tweenEasing":0,"value":0.6433},{"tweenEasing":0,"value":0.7033},{"tweenEasing":0,"value":0.7433},{"duration":35,"tweenEasing":0,"value":0.7567},{"tweenEasing":0,"value":0.74},{"tweenEasing":0,"value":0.73}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":100,"value":0.5}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":62,"tweenEasing":0,"value":0.5},{"value":0.5},{"duration":37,"value":0.495}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.52},{"tweenEasing":0,"value":0.535},{"duration":32,"value":0.54}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"duration":100,"value":0.5}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":65,"tweenEasing":0,"value":0.54},{"tweenEasing":0,"value":0.615},{"duration":34,"value":0.62}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":98,"tweenEasing":0,"value":0.6067},{"tweenEasing":0,"value":0.5518},{"value":0.5528}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":23,"tweenEasing":0,"value":0.6268},{"duration":13,"tweenEasing":0,"value":0.6552},{"duration":3,"tweenEasing":0,"value":0.4253},{"duration":14,"tweenEasing":0,"value":0.4198},{"duration":3,"tweenEasing":0,"value":0.658},{"duration":13,"tweenEasing":0,"value":0.6635},{"duration":29,"tweenEasing":0,"value":0.4255},{"tweenEasing":0,"value":0.4182},{"value":0.419}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":62,"tweenEasing":0,"value":0.68},{"tweenEasing":0,"value":0.755},{"duration":37,"value":0.75}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":47,"tweenEasing":0,"value":0.41},{"duration":13,"tweenEasing":0,"value":0.395},{"duration":37,"tweenEasing":0,"value":0.41},{"tweenEasing":0,"value":0.36},{"duration":2,"value":0.355}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"duration":16,"tweenEasing":0,"value":0.5733},{"duration":7,"tweenEasing":0,"value":0.9567},{"duration":17,"tweenEasing":0,"value":0.9867},{"duration":17,"tweenEasing":0,"value":0.9},{"duration":41,"tweenEasing":0,"value":0.9867},{"tweenEasing":0,"value":0.88},{"tweenEasing":0,"value":0.8733}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.56},{"tweenEasing":0,"value":0.525},{"duration":32,"value":0.52}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"tweenEasing":0,"value":0.49},{"duration":99,"value":0.495}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"duration":15,"tweenEasing":0,"value":0.4867},{"duration":7,"tweenEasing":0,"value":0.9233},{"duration":18,"tweenEasing":0,"value":0.98},{"duration":17,"tweenEasing":0,"value":0.8867},{"duration":41,"tweenEasing":0,"value":0.9767},{"tweenEasing":0,"value":0.8667},{"tweenEasing":0,"value":0.86}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":68,"tweenEasing":0,"value":0.79},{"tweenEasing":0,"value":0.86},{"duration":31,"value":0.855}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"duration":28,"tweenEasing":0,"value":0.695},{"duration":17,"tweenEasing":0,"value":0.74},{"duration":15,"tweenEasing":0,"value":0.72},{"duration":9,"tweenEasing":0,"value":0.75},{"tweenEasing":0,"value":0.695},{"duration":30,"value":0.69}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":28,"tweenEasing":0,"value":0.505},{"value":0.505},{"duration":71,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":62,"tweenEasing":0,"value":0.545},{"tweenEasing":0,"value":0.62},{"duration":37,"value":0.625}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":65,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.495},{"duration":34,"value":0.5}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"duration":100,"value":0.59}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":83,"playTimes":0,"fadeInTime":0.3,"name":"tap_body_00","timeline":[{"name":"PARAM_MOUTH_OPEN_Y","type":40,"frame":[{"duration":4,"tweenEasing":0},{"duration":6,"tweenEasing":0},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":6,"tweenEasing":0,"value":0.925},{"duration":2,"tweenEasing":0,"value":0.715},{"duration":2,"tweenEasing":0,"value":0.15},{"duration":8,"tweenEasing":0,"value":0.045},{"duration":2,"tweenEasing":0,"value":0.04},{"duration":2,"tweenEasing":0,"value":0.865},{"duration":2,"tweenEasing":0,"value":0.995},{"duration":6,"tweenEasing":0,"value":0.98},{"duration":2,"tweenEasing":0,"value":0.44},{"duration":2,"tweenEasing":0,"value":0.48},{"duration":10,"tweenEasing":0,"value":0.7},{"duration":2,"tweenEasing":0,"value":0.755},{"duration":2,"tweenEasing":0,"value":0.935},{"duration":4,"tweenEasing":0,"value":0.885},{"duration":4,"tweenEasing":0,"value":0.5},{"duration":4,"tweenEasing":0,"value":0.785},{"duration":2,"tweenEasing":0,"value":0.61},{"duration":6,"tweenEasing":0,"value":0.065},{"tweenEasing":0,"value":0.06},{"duration":2,"value":0.055}]},{"name":"PARAM_ARM_L_02","type":40,"frame":[{"tweenEasing":0,"value":0.675}]},{"name":"PARAM_EYE_L_OPEN","type":40,"frame":[{"duration":4,"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.75},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.4533},{"tweenEasing":0,"value":0.37},{"tweenEasing":0,"value":0.3367},{"tweenEasing":0,"value":0.3767},{"duration":2,"tweenEasing":0,"value":0.47},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.84},{"duration":40,"tweenEasing":0,"value":0.86},{"duration":2,"tweenEasing":0,"value":0.85},{"duration":2,"tweenEasing":0,"value":0.8},{"duration":9,"tweenEasing":0,"value":0.7133},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":2,"tweenEasing":0,"value":0.0967},{"duration":5,"tweenEasing":0,"value":0.0433},{"tweenEasing":0,"value":0.0033},{"duration":3}]},{"name":"PARAM_BROW_L_FORM","type":40,"frame":[{"duration":83,"value":0.5}]},{"name":"PARAM_BROW_L_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.445},{"tweenEasing":0,"value":0.49},{"value":0.495}]},{"name":"PARAM_HAND_R","type":40,"frame":[{"tweenEasing":0,"value":0.305}]},{"name":"PARAM_BROW_L_Y","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.435},{"duration":14,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.115},{"value":0.11}]},{"name":"PARAM_HAND_L","type":40,"frame":[{"tweenEasing":0,"value":0.155}]},{"name":"PARAM_DONYORI","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_KAMIYURE_FRONT","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_R_OPEN","type":40,"frame":[{"duration":4,"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.75},{"duration":2,"tweenEasing":0,"value":0.6667},{"tweenEasing":0,"value":0.45},{"tweenEasing":0,"value":0.3667},{"tweenEasing":0,"value":0.3333},{"tweenEasing":0,"value":0.3733},{"duration":2,"tweenEasing":0,"value":0.4667},{"tweenEasing":0,"value":0.6933},{"tweenEasing":0,"value":0.7833},{"tweenEasing":0,"value":0.84},{"duration":40,"tweenEasing":0,"value":0.86},{"duration":2,"tweenEasing":0,"value":0.85},{"duration":2,"tweenEasing":0,"value":0.8},{"duration":9,"tweenEasing":0,"value":0.7133},{"duration":2,"tweenEasing":0,"value":0.18},{"duration":2,"tweenEasing":0,"value":0.0967},{"duration":5,"tweenEasing":0,"value":0.0433},{"tweenEasing":0,"value":0.0033},{"duration":3}]},{"name":"PARAM_DESK","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_KAMIYURE_TWIN_R","type":40,"frame":[{"duration":83,"value":0.505}]},{"name":"PARAM_EYE_BALL_X","type":40,"frame":[{"duration":83,"value":0.43}]},{"name":"PARAM_EYE_BALL_Y","type":40,"frame":[{"duration":78,"tweenEasing":0,"value":0.58},{"tweenEasing":0,"value":0.6},{"duration":4,"value":0.605}]},{"name":"PARAM_KAMIYURE_TWIN_L","type":40,"frame":[{"tweenEasing":0,"value":0.505}]},{"name":"PARAM_BROW_L_ANGLE","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.415},{"duration":7,"tweenEasing":0,"value":0.34},{"duration":65,"tweenEasing":0,"value":0.24},{"tweenEasing":0,"value":0.37},{"duration":2,"value":0.375}]},{"name":"PARAM_ANGLE_Z","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.5313},{"tweenEasing":0,"value":0.5187},{"value":0.5182}]},{"name":"PARAM_BREATH","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_ANGLE_Y","type":40,"frame":[{"duration":5,"tweenEasing":0,"value":0.4487},{"duration":2,"tweenEasing":0,"value":0.444},{"duration":7,"tweenEasing":0,"value":0.4032},{"duration":2,"tweenEasing":0,"value":0.172},{"tweenEasing":0,"value":0.15},{"tweenEasing":0,"value":0.1575},{"duration":8,"tweenEasing":0,"value":0.1778},{"duration":2,"tweenEasing":0,"value":0.4965},{"duration":53,"tweenEasing":0,"value":0.5408},{"tweenEasing":0,"value":0.5653},{"tweenEasing":0,"value":0.563}]},{"name":"PARAM_BROW_R_Y","type":40,"frame":[{"duration":67,"tweenEasing":0,"value":0.44},{"duration":14,"tweenEasing":0,"value":0.285},{"tweenEasing":0,"value":0.115},{"value":0.11}]},{"name":"PARAM_ANGLE_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.4998},{"tweenEasing":0,"value":0.5148},{"value":0.5153}]},{"name":"PARAM_BROW_R_X","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.46},{"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495}]},{"name":"PARAM_BODY_Y","type":40,"frame":[{"duration":79,"tweenEasing":0,"value":0.365},{"tweenEasing":0,"value":0.415},{"duration":3,"value":0.42}]},{"name":"PARAM_ARM_R","type":40,"frame":[{"tweenEasing":0,"value":0.33}]},{"name":"PARAM_BODY_Z","type":40,"frame":[{"duration":71,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":11,"value":0.5}]},{"name":"PARAM_EYE_BALL_KIRAKIRA","type":40,"frame":[{"tweenEasing":0}]},{"name":"PARAM_BODY_X","type":40,"frame":[{"duration":77,"tweenEasing":0,"value":0.49},{"tweenEasing":0,"value":0.495},{"duration":5,"value":0.5}]},{"name":"PARAM_ARM_L","type":40,"frame":[{"tweenEasing":0,"value":0.21}]},{"name":"PARAM_MOUTH_FORM","type":40,"frame":[{"duration":80,"tweenEasing":0,"value":0.66},{"tweenEasing":0,"value":0.775},{"duration":2,"value":0.78}]},{"name":"PARAM_ARM_R_02","type":40,"frame":[{"tweenEasing":0,"value":0.435}]},{"name":"PARAM_KAMIYURE_SIDE_R","type":40,"frame":[{"duration":83,"value":0.5}]},{"name":"PARAM_KAMIYURE_SIDE_L","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_EYE_BALL_FORM","type":40,"frame":[{"duration":13,"tweenEasing":0,"value":0.495},{"value":0.495},{"duration":69,"value":0.5}]},{"name":"PARAM_BROW_R_ANGLE","type":40,"frame":[{"duration":8,"tweenEasing":0,"value":0.415},{"duration":6,"tweenEasing":0,"value":0.34},{"duration":67,"tweenEasing":0,"value":0.25},{"tweenEasing":0,"value":0.38},{"tweenEasing":0,"value":0.385}]},{"name":"PARAM_MOUTH_SIZE","type":40,"frame":[{"duration":81,"tweenEasing":0,"value":0.385},{"tweenEasing":0,"value":0.48},{"value":0.485}]},{"name":"PARAM_BROW_R_FORM","type":40,"frame":[{"tweenEasing":0,"value":0.5}]},{"name":"PARAM_TERE","type":40,"frame":[{"tweenEasing":0,"value":0.62}]},{"name":"D_CLOTHES.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.18","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.19","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.20","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.21","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.22","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.23","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_CLOTHES.17","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.12","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.13","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.14","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.15","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.16","type":21,"frame":[{"value":{"aM":0}}]},{"name":"D_HAND.17","type":21,"frame":[{"value":{"aM":0}}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_DESK","timeline":[{"name":"B_BACKGROUND.01","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-8},{"duration":60,"tweenEasing":0},{"x":8}]},{"name":"D_BACKGROUND.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[2,40,0,46,0,24,-1.33,14.67,-5.33,-42,0,0,-2,-22.67,0,-23.33,0,-42.67,0,-39.33,2,-20,0,-10,2,-12,0,-12,1.33,-24,2.67,-22,0,0,0,-84,0,-24,0,-33.33,0,-50,2,-20,0,14,8,-26,0,-22,0,-18,0,30,0,-14,5.33,-25.33,0,-16,2.67,-42.67,0,-18,0,24,0,-32,-2,-3.33,2,-24,-4,-3.33,4,-11.33,1.18,-34.2,0.28,-25.14,-0.95,-33.9,1.23,-36,1.33,-28.25,0.48,-9.97,-1.5,7.92,1.11,-21.85,2.66,-14.66,1.47,24.54,-2.88,-3.33,1.01,32.11,0.15,10.4,2.45,-4.02,2.66,-18,0.71,-21.2,1.44,-30.4,-0.61,-2.06,6.6,-25.65,4.28,-9.8,-0.87,14.43,3.31,-2.54]},{"duration":60,"tweenEasing":0,"offset":119},{"offset":1,"value":[-20,0,-26,0,-72,-1.67,-22.67,10,22,0,6,0,14,0,18,0,12,0,12,0,42,4,40,0,20,0,8,0,30,0,18,0,40,0,24,0,16,0,18,0,20,0,0,-1,-41,8,10,0,26,0,0,0,-58,0,0,4,-12,-2,2,2,16,-1,34,0,-40,0,30,-3,10,0,38,0,8,0,28,0,10,0,14,0,12,0,26,2,8,0,14,0,2,-1,22.67,-1,14,0,-5.61,1.12,9.12,0,-29.86,-4.78,-29.18,-0.33,-20.59,0,-6.99,-2.86,5.2,0.16,9.56,-3.82,-16.19,5.9,-1.54,2.42,-9.12,-2.56,-37.16,0.31,-7.28]}]},{"name":"D_BACKGROUND.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[-17.33,-1.33,10.67,0,9.33,0,12,1.33,16,1.33,-48,0,-28,0,-25.33,0,-9.33,0,-9.33,0,-17.33]},{"duration":60,"tweenEasing":0,"offset":21},{"value":[-3,19.67,0,-16,0,-8,0,-12,0,-18.67,0,4,0,28,-2.67,40,0,5.33,0,13.33,0,8]}]},{"name":"D_BACKGROUND.06","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[-25.33,0,-25.33,0,-25.33,0,-25.33,0,-25.33]},{"duration":60,"tweenEasing":0,"offset":9},{"offset":1,"value":[4,0,4,0,4,0,4,0,4]}]},{"name":"D_BACKGROUND.07","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[-7.33,0,-7.33,0,-7.33,0,-7.33]},{"duration":60,"tweenEasing":0,"offset":7},{"offset":1,"value":[-18.67,0,-18.67,0,-18.67,0,-18.67]}]},{"name":"D_BACKGROUND.08","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[2.67,-4,1.33,8,-1.33,16,0,0,0,0,1.33,-12,1.33,-5.33,1.33,-8,0,-17.33,0,-4,0,-8.05,0,-8.98,0,0,0.75,-10.61,0.71,-12.36]},{"duration":60,"tweenEasing":0,"offset":29},{"value":[-3.33,8.67,-2.67,5.33,0,-10,-2.33,-15.33,18.67,-2.67,0,24,0,16,-1.33,6.67,-2.67,20,-1.33,13.33,0.71,9.72,-0.95,11.22,5.91,-8.76,-1.17,17.76,-2.67,10.23]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BREATH","timeline":[{"name":"B_BODY.04","type":50,"frame":[{"duration":120,"tweenEasing":0,"offset":161},{"value":[-40,-16,-28.13,-17.19,-15,-18.5,-4.38,-19.56,0,-20,5.03,-18.91,17.25,-16.25,32.34,-12.97,46,-10,-34.16,-9.07,-24.66,-10.58,-13.85,-12.3,-4.66,-13.81,0,-14.66,6.88,-13.2,18.27,-10.33,30.89,-6.87,41.47,-3.66,-25.81,-0.36,-19.32,-2.37,-11.47,-4.93,-4.34,-7.3,0,-8.75,7.09,-6.54,15.92,-2.6,24.32,1.87,30.08,5.69,-15.55,7.54,-12.55,4.97,-8.14,1.48,-3.55,-1.86,0,-3.97,6.4,-0.88,11.79,4.4,15.07,10.16,15.15,14.69,-4,12,-4.8,8.98,-4.15,4.76,-2.43,0.66,0,-2,5.62,1.82,7.5,8.14,5.62,14.89,0,20,-3.56,10.69,-4.02,8.11,-3.4,4.27,-1.96,0.52,0,-1.78,4.22,1.57,5.62,7.37,4.22,13.5,0,17.81,-2.5,7.5,-2.78,5.71,-2.33,3,-1.34,0.35,0,-1.25,2.81,1.09,3.75,5.19,2.82,9.52,0,12.5,-1.19,3.56,-1.34,2.7,-1.13,1.42,-0.65,0.17,0,-0.59,1.4,0.52,1.87,2.46,1.41,4.5,0,5.94]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_02_R","timeline":[{"name":"D_HAND.12","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[12.64,12.48,10.25,12.64,9.26,9.12,7.73,6.06,8.61,4.15,10.94,3.89,12.4,6.22,12.46,9.3,10.22,6.47]},{"offset":17}]},{"name":"D_HAND.13","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-0.3,7.45,1.21,8.58,0,0,0,0,0.1,-4.05,-0.84,-5.94]},{"offset":29}]},{"name":"D_HAND.14","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[4.19,8.69,4.43,11.58,5.41,16.32,3.73,27.51,1.22,23.89,2.24,15.8,1.76,11.5,1.37,9.26,2.79,7.96,3.06,10.26,3.26,13.25,3.93,19.88]},{"offset":23}]},{"name":"D_HAND.15","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-0.85,-1.23,-0.56,-3.96,0.1,-4.05,0,0,-0.46,-3.3,-0.56,-3.96,-0.19,-1.32,0,0,0,0,0,0,0.86,-3.49,-2.06,-5.1]},{"offset":23}]},{"name":"D_HAND.16","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-2.21,-3.01,-0.13,-11.93,0.43,-15.96,2.13,-20.55,6.89,-24.9,6.02,-14.92,5.53,-3.15,5.4,4.32,0.08,1.6,1.35,-6.29]},{"offset":19}]},{"name":"D_HAND.17","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-2.46,-9.98,4.5,-28.03,8.55,-37.87,12.6,-34.89,9.12,-15.37,6.87,-0.4,-0.09,-3.81,3.67,-11.78,11.24,-27.28]},{"offset":17}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_02_L","timeline":[{"name":"D_HAND.18","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[4.84,-14.03,9.51,-14.55,8.54,-6.7,7.65,0.36,6.53,4.17,1.51,5.81,-1.66,4.19,0.61,-3.87,2.75,-9.76,2.63,1.89]},{"offset":19}]},{"name":"D_HAND.19","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[1.17,8.46,1.53,9.91,0,0,0,0,7.08,-8.66,-1.17,-8.46]},{"offset":19}]},{"name":"D_HAND.20","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-0.85,-5.32,0.78,-8.02,3.96,-17.56,1.81,-26.24,-3.41,-21.27,-3,-14,-0.85,-5.32,-0.85,-5.32]},{"offset":15}]},{"name":"D_HAND.21","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-5.85,-1.32,-5.98,3.78,-5.98,3.78,-5.98,3.78,-5.98,3.78,-5.98,3.78,-5.98,3.78,-6.29,0.63]},{"offset":15}]},{"name":"D_HAND.22","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[-5,24.36,-4.73,19.15,-6.24,13.19,-6.57,11.07,-6.71,9.4,-3.04,0.41,-3.42,14.2,-4.8,18.56]},{"offset":15}]},{"name":"D_HAND.23","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[9.39,38.82,3.16,26.92,-2.34,11.34,9.6,4.86,14.19,19.29,15.87,35.22]},{"offset":11}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_L_02","timeline":[{"name":"B_CLOTHES.40","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.41","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.18","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.18","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.19","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_L_01","timeline":[{"name":"B_CLOTHES.40","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.41","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAND.18","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.18","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.19","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_R","timeline":[{"name":"B_HAND.12","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-1.21,-6.42,2.89,-6.57,6.68,-6.7,7.27,-6.73,3.24,-6.59,-0.8,-6.45,-1.2,-6.43,-1.2,-6.42,-1.2,-6.42,-1.18,-6.44,1.72,-7.26,4.42,-8.12,4.91,-8.52,1.32,-9.11,-2.46,-9.4,-3.31,-8.88,-4.47,-7.37,-5.69,-6.09,-1.14,-6.46,0.46,-7.9,1.96,-9.36,2.31,-10.09,-0.86,-11.35,-4.38,-11.99,-5.6,-11.05,-7.82,-8.32,-10.13,-5.94,-1.13,-6.46,-1.29,-8.37,-1.44,-10.21,-1.57,-11.3,-4.54,-12.58,-8.19,-12.89,-9.68,-11.7,-11.94,-9.64,-14.46,-7.03,-1.13,-6.47,-3.11,-9.11,-4.99,-11.74,-5.39,-13.91,-8.09,-18.13,-12.16,-20.91,-15.55,-17.8,-19.42,-11.98,-23.51,-6.14,-1.14,-6.46,-4.42,-9.57,-7.51,-12.53,-7.91,-15.72,-10.94,-23.51,-16.01,-29.38,-21.36,-24.42,-27.33,-14.87,-33.13,-5.79,-1.16,-6.44,-4.89,-9.82,-8.34,-12.81,-8.66,-15.76,-12.23,-23.96,-19.13,-30.95,-26.89,-26.54,-34.59,-16,-41.69,-6.43,-1.19,-6.43,-5.55,-10.34,-9.59,-13.85,-10.56,-15.84,-15.08,-20.58,-24.38,-25.49,-34.26,-23.18,-41.56,-15.31,-48.38,-7.91,-1.21,-6.42,-6.23,-10.9,-10.9,-15,-12.56,-16.04,-18.19,-16.91,-29.99,-19.27,-41.77,-19.18,-48.46,-14.54,-54.68,-9.58]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-4.82,4.09,-4.85,4.11,-4.88,4.13,-4.91,4.14,-4.91,4.14,-4.88,4.13,-4.84,4.1,-4.83,4.09,-4.83,4.09,-4.81,4.07,-4.85,4.1,-4.93,4.16,-5.02,4.23,-5.06,4.25,-5.04,4.23,-4.94,4.16,-4.86,4.11,-4.83,4.09,-4.76,4.04,-4.81,4.07,-4.92,4.16,-5.09,4.28,-5.2,4.35,-5.19,4.34,-5.04,4.23,-4.89,4.13,-4.83,4.09,-4.7,3.99,-4.72,4.01,-4.83,4.09,-5.05,4.49,-5.32,4.92,-5.42,4.9,-5.27,4.75,-4.99,4.5,-4.83,4.09,-4.63,3.95,-4.6,3.93,-4.67,3.98,-5.05,5.29,-5.98,8.26,-6.65,9.76,-6.46,9.18,-5.61,6.69,-4.83,4.09,-4.6,3.93,-4.51,3.86,-4.51,3.86,-4.99,6.09,-6.59,11.58,-7.83,14.57,-7.56,13.56,-6.21,8.87,-4.83,4.09,-4.61,3.94,-4.49,3.85,-4.45,3.82,-4.74,6.35,-6.27,12.05,-7.67,14.81,-7.47,13.86,-6.27,9.56,-5.04,5.43,-4.65,3.97,-4.53,3.88,-4.47,3.83,-4.44,6.41,-5.59,11.81,-7.01,14.09,-7.03,13.81,-6.43,12.15,-5.86,10.68,-4.7,4,-4.59,3.92,-4.51,3.86,-4.15,6.5,-4.91,11.55,-6.31,13.33,-6.54,13.79,-6.65,15.03,-6.76,16.35]}]},{"name":"B_HAND.13","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.32,-2,0.33,-2,0.33,-2,0.44,-2.02,1.36,-2.27,2.28,-2.51,1.02,-2.32,-3.55,-1.56,-8.44,-1.03,0.34,-2.01,0.36,-2.02,0.36,-2.03,0.57,-2.06,2.33,-2.53,4.1,-2.99,1.65,-2.67,-7.29,-1.39,-16.88,-0.47,0.37,-2.03,0.41,-2.06,0.43,-2.08,0.65,-2.09,1.15,-2.34,1.66,-2.59,-1.58,-2.59,-13.04,-2.48,-25.35,-2.2,0.36,-2.03,0.41,-2.06,0.45,-2.09,-0.12,-2.01,-7,-1.1,-13.87,-0.2,-17.62,-0.07,-28.1,0.11,-39.33,0.49,0.34,-2.01,0.39,-2.04,0.42,-2.07,-1.14,-1.96,-15.59,-0.76,-30.04,0.45,-33.76,0.76,-42.36,1.46,-51.68,2.2,0.3,-1.98,-2.04,-1.76,-4.23,-1.52,-7.78,-1.45,-26.89,-0.38,-45.15,0.93,-50.73,1.44,-60.1,2.57,-70.03,3.33,0.26,-1.96,-5.11,-1.43,-10.11,-0.92,-16.14,-0.94,-39.13,-0.11,-59.98,1.33,-67.92,1.59,-78.4,1.55,-89.31,1.21,0.25,-1.95,-8.09,-1.12,-15.82,-0.34,-24.25,-0.48,-51.1,0.03,-74.51,1.52,-84.71,1.47,-96.3,0,-108.13,-1.57]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-1.93,2.73,-2.25,4.18,-2.52,5.65,-2.57,6.09,-2.28,6.6,-1.98,7.1,-1.95,6.62,-1.93,4.65,-1.93,2.73,-1.95,2.74,-2.56,5.56,-3.12,8.4,-3.21,9.23,-2.62,10.19,-2.03,11.15,-1.95,10.24,-1.94,6.47,-1.93,2.73,-1.97,2.75,-2.72,6.02,-3.41,9.09,-3.5,9.99,-2.85,11.15,-2.19,12.31,-2.11,11.35,-2.02,7.23,-1.93,2.73,-1.92,2.71,-2.83,5.41,-3.69,7.92,-3.94,8.81,-3.74,11.15,-3.5,13.47,-3.28,12.47,-2.63,7.79,-1.93,2.73,-1.83,2.66,-2.89,4.76,-3.9,6.68,-4.29,7.56,-4.57,11.12,-4.8,14.63,-4.43,13.58,-3.23,8.34,-1.93,2.73,-1.78,2.62,-2.68,4.3,-3.57,6.04,-3.97,6.9,-4.31,10.62,-4.59,14.28,-4.23,13.27,-3.12,8.14,-1.93,2.73,-1.76,2.6,-2.21,3.46,-2.68,4.38,-2.93,5.03,-3.15,8.78,-3.32,12.49,-3.12,11.7,-2.54,7.35,-1.93,2.73,-1.77,2.61,-1.73,2.58,-1.76,2.6,-1.84,3.01,-1.91,6.8,-1.94,10.56,-1.93,10.01,-1.93,6.51,-1.93,2.73]}]},{"name":"B_HAND.14","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-1.59,5.51,-4.46,6.17,-7.55,6.61,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-0.84,5.32,-2.33,5.64,-8.05,6.73,-14.22,7.47,-0.88,5.35,-1.33,5.24,-1.76,5.13,-1.72,5.11,-2.39,5.26,-3.06,5.4,-5.33,5.55,-13.31,6.08,-21.86,6.53,-1,5.44,-2.56,4.89,-4.01,4.32,-4.77,4.13,-10.63,3.98,-16.49,3.83,-18.63,4.07,-25.26,5.11,-32.41,5.9,-1.05,5.47,-3.28,4.58,-5.3,3.68,-7.05,3.32,-19.12,2.36,-31.19,1.4,-33.32,1.45,-38.08,2.18,-43.3,2.83,-0.9,5.36,-6.41,5.28,-11.49,5.46,-14.18,5.39,-28.91,4.2,-43.64,3.01,-46.1,2.93,-51.44,3.21,-57.3,3.64,-0.71,5.23,-10.66,5.81,-19.91,6.53,-23.85,6.65,-40.29,5.96,-56.73,5.29,-59.88,5.37,-66.75,5.91,-74.21,6.56,-0.58,5.13,-14.94,6.3,-28.3,7.43,-33.42,7.71,-51.54,7.55,-69.68,7.4,-73.64,7.67,-82.13,8.53,-91.28,9.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-0.72,10.22,-0.72,10.22,-0.72,10.22,-0.72,9.93,-0.72,6.81,-0.72,3.7,-0.72,2.36,-0.72,-1.72,-0.72,-6.13,-0.72,10.22,-0.72,10.22,-0.72,10.22,-0.72,9.99,-0.67,7.52,-0.62,5.06,-0.57,3.84,-0.43,-0.03,-0.28,-4.24,-0.72,10.22,-0.72,10.22,-0.72,10.22,-0.72,10.05,-0.62,8.18,-0.52,6.31,-0.43,5.2,-0.15,1.53,0.14,-2.49,-0.83,10.3,-0.86,10.32,-0.87,10.32,-0.81,10.16,-0.76,8.51,-0.72,6.87,-0.62,5.77,-0.21,2.07,0.23,-2.02,-1.09,10.48,-1.2,10.56,-1.24,10.59,-1.24,10.49,-1.93,9.88,-2.64,9.28,-2.37,8.02,-1.17,3.35,0.12,-1.7,-1.19,10.55,-1.37,10.69,-1.43,10.73,-1.5,10.7,-3.01,11.18,-4.55,11.69,-4.12,10.27,-2.14,4.63,0.01,-1.39,-0.89,10.34,-1.01,10.42,-1.05,10.45,-1.01,10.39,-1.8,10.13,-2.6,9.88,-2.41,8.33,-1.31,4.13,-0.16,-0.73,-0.52,10.07,-0.5,10.06,-0.52,10.07,-0.53,10.16,-0.61,10.78,-0.63,11.37,-0.67,9.33,-0.71,5.7,-0.78,1.75,-0.26,9.89,-0.13,9.79,-0.12,9.79,-0.21,10.06,0.42,11.8,1.14,13.47,0.92,10.9,-0.22,7.61,-1.45,4.43]}]},{"name":"B_HAND.15","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-4.07,0.78,-5.25,-0.78,-6.44,-2.34,-6.24,-2.08,-5.11,-0.56,-3.9,0.93,-3.9,0.93,-3.9,0.93,-3.9,0.93,-4.2,0.65,-6.5,-2.35,-8.81,-5.35,-8.42,-4.87,-6.24,-1.97,-3.9,0.93,-3.9,0.93,-4.22,0.7,-4.47,0.51,-4.62,0.13,-7.7,-3.41,-10.78,-6.95,-10.62,-6.42,-8.67,-3.05,-6.55,0.44,-3.9,0.93,-6.56,-0.91,-8.94,-3.17,-9.64,-3.99,-13.68,-6.15,-17.72,-8.31,-18,-7.66,-17.29,-4.31,-16.51,-0.96,-3.86,0.9,-9.71,-1.64,-15.11,-4.5,-16.89,-5.39,-21.7,-6.78,-26.5,-8.18,-27,-7.66,-27.33,-5,-27.72,-2.18,-3.77,0.84,-11.97,-1.21,-19.18,-2.94,-23.47,-3.46,-30.06,-5.3,-35.82,-7.04,-37.13,-6.95,-40.07,-5.75,-43.25,-4.24,-3.72,0.8,-14.04,-1.78,-22.76,-4.19,-30.68,-4.8,-40.39,-6.31,-48.06,-7.53,-50.11,-7.62,-55.42,-7.38,-61.16,-6.97,-3.75,0.82,-16.15,-2.39,-26.37,-5.63,-37.91,-6.35,-50.79,-7.57,-60.47,-8.32,-63.24,-8.54,-70.85,-9.11,-79.08,-9.72]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":6,"value":[-1.04,0.09,-12.16,1.05,-23.27,2.02,-24.66,1.92,-26.03,1.19,-27.5,0.41,0,0,-1.46,-0.95,-2.82,-1.93,-3.95,-2.76,-11.4,-5.86,-18.8,-8.73,-21.12,-10.39,-22.01,-12.76,-22.73,-15.14,0,0,-2.82,-1.84,-5.45,-3.72,-6.55,-5.43,-10.51,-12.27,-14.41,-18.65,-17.42,-21.83,-17.74,-25.83,-17.57,-29.77,0,0,-2.7,-2.74,-5.23,-5.86,-6.1,-8.28,-7.87,-15.67,-9.77,-22.54,-12.8,-27.53,-11.83,-34.47,-10.01,-40.89,0,0,-0.79,-2.69,-1.51,-6.32,-1.41,-9.7,-2.04,-20.95,-3.39,-31.81,-5.56,-38.72,-4.7,-47.24,-3.12,-55.25,0,0,0.18,-0.84,0.38,-2.04,1.52,-5.86,3.64,-22.91,4.35,-39.69,3.57,-47.83,4.49,-54.84,5.63,-62.48,0,0,0,0,0,0,1.36,-3.44,8.32,-23.55,14.02,-44.69,14.35,-54.75,14,-64.48,13.78,-74.37,0,0,0,0,0,0,1.44,-2.87,13.06,-25.74,24.02,-51.49,24.86,-63.05,22.36,-75.13,19.85,-87.01,0,0,0,0,0,0,1.53,-2.3,17.75,-27.92,33.92,-58.28,34.64,-70.28,29.74,-81.77,24.32,-93.6]}]},{"name":"B_HAND.16","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.58,-0.72,-3.58,-0.72,-3.58,-0.72,-3.58,-0.72,-3.58,-0.72,-3.79,4.34,-4.39,9.96,-5.15,15.81,-5.83,21.54,-3.58,-0.72,-3.52,-0.71,-3.45,-0.69,-3.4,-0.68,-3.37,-0.68,-3.47,5.48,-4.05,11.79,-4.81,18.13,-5.46,24.37,-3.58,-0.72,-3.45,-0.7,-3.31,-0.67,-3.2,-0.64,-3.14,-0.63,-3.12,6.69,-3.67,13.78,-4.44,20.7,-5.06,27.5,-3.58,-0.72,-3.4,-0.69,-3.2,-0.64,-3.03,-0.61,-2.95,-0.59,-2.82,7.79,-3.36,15.47,-4.14,22.77,-4.73,30.04,-3.58,-0.72,-3.37,-0.68,-3.14,-0.63,-2.95,-0.59,-2.87,-0.58,-2.71,8.62,-3.21,16.39,-3.97,23.59,-4.6,31.08,-3.58,-0.72,-3.48,-0.04,-3.31,0.3,-3.16,0.56,-3.13,0.98,-3.03,9.64,-3.57,17.13,-4.32,23.96,-4.88,30.69,-3.57,-0.73,-3.67,0.93,-3.66,2.34,-3.67,3.58,-3.79,4.76,-3.82,12.42,-4.32,18.68,-5,24.23,-5.56,29.73,-3.56,-0.74,-3.86,2.04,-4.1,4.82,-4.33,7.36,-4.6,9.43,-4.77,15.91,-5.24,20.57,-5.84,24.44,-6.4,28.54,-3.55,-0.76,-4.02,3.09,-4.5,7.08,-4.95,10.76,-5.34,13.66,-5.61,19.07,-6.08,22.3,-6.64,24.67,-7.16,27.47]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.87,-5.31,0.91,-7.37,0.96,-9.65,1,-11.5,1.01,-12.26,1.01,-12.87,0.99,-14.36,0.96,-16.21,0.94,-17.88,0.87,-5.31,0.93,-7.02,1.01,-8.88,1.08,-10.37,1.1,-10.98,1.08,-11.55,1.05,-12.94,1,-14.65,0.96,-16.21,0.87,-5.31,0.96,-6.65,1.07,-8.04,1.16,-9.13,1.19,-9.58,1.17,-10.09,1.11,-11.35,1.05,-12.92,0.99,-14.36,0.87,-5.31,0.98,-6.32,1.12,-7.34,1.23,-8.12,1.27,-8.44,1.24,-8.91,1.17,-10.08,1.08,-11.53,1.01,-12.87,0.87,-5.31,1,-6.1,1.14,-6.97,1.26,-7.68,1.3,-7.97,1.27,-8.44,1.19,-9.58,1.1,-10.98,1.01,-12.26,0.89,-5.32,1,-5.97,1.12,-6.75,1.21,-7.41,1.26,-7.68,1.22,-8.12,1.15,-9.18,1.07,-10.45,1,-11.5,0.94,-5.36,1.01,-5.8,1.08,-6.34,1.14,-6.8,1.15,-6.98,1.11,-7.29,1.06,-8.04,1.01,-8.93,0.96,-9.65,1.03,-5.42,1.05,-5.62,1.06,-5.87,1.05,-6.06,1.02,-6.12,0.99,-6.25,0.96,-6.6,0.93,-7.02,0.91,-7.37,1.16,-5.51,1.12,-5.49,1.07,-5.45,1,-5.4,0.92,-5.35,0.89,-5.33,0.88,-5.32,0.87,-5.31,0.87,-5.31]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_R_02","timeline":[{"name":"B_CLOTHES.25","type":50,"frame":[{"duration":-60,"tweenEasing":0,"offset":114,"value":[0.29,-0.07,2.83,-0.72,5.37,-1.37,4.88,-1.2,3.22,-0.68,1.45,-0.34,0,0,0,0,0,0,0.61,-0.09,6.76,-0.92,12.9,-1.75,12.62,-1.74,9.97,-1.64,7.11,-1.65,0,0,0,0,0,0,0.91,-0.09,10.64,-1,20.37,-1.91,20.4,-2.12,16.96,-2.58,13.24,-3.08]},{"duration":60,"tweenEasing":0,"offset":114,"value":[0.29,-0.07,2.83,-0.72,5.37,-1.37,4.88,-1.2,3.22,-0.68,1.45,-0.34,0,0,0,0,0,0,0.61,-0.09,6.76,-0.92,12.9,-1.75,12.62,-1.74,9.97,-1.64,7.11,-1.65,0,0,0,0,0,0,0.91,-0.09,10.64,-1,20.37,-1.91,20.4,-2.12,16.96,-2.58,13.24,-3.08]},{"duration":60,"tweenEasing":0,"offset":18,"value":[4.76,-3,2.63,-1.68,0.65,-0.38,0.35,0,3.09,0.21,5.84,0.43,7.26,2.77,5.61,6.45,3.39,9.77,9.17,-5.78,5.04,-3.22,1.21,-0.72,0.65,0,5.95,0.41,11.26,0.82,14.14,5.38,10.86,12.4,6.53,18.81,10.14,-6.52,3.92,-3.96,-1.93,-1.99,-2.6,-1.45,4.53,-0.27,11.67,0.91,15.13,6.04,11.65,13.51,7.21,20.89,8.52,-6.83,-1.35,-4.4,-10.7,-2.74,-12.19,-2.26,-5.02,-0.43,2.16,1.41,5.03,5.02,5.58,11.65,5.91,18.49,6.9,-7.14,-5.17,-4.2,-16.41,-1.61,-18.94,-0.81,-15.65,0.85,-12.35,2.52,-9.68,4.51,-2.8,10.07,4.62,16.09,6.01,-6.39,-6.13,-3.51,-17.36,-0.82,-20.45,-0.02,-21.72,0.94,-22.99,1.89,-20.24,3.55,-7.82,8.99,5.45,13.8,3.12,-3.32,-8.19,-0.78,-18.65,1.58,-21.83,2.28,-26.44,3.11,-31.05,3.94,-27.2,4.38,-9.66,5.33,9.19,5.69,0,0,-10.43,2.18,-20.07,4.19,-23.27,4.78,-31.17,5.64,-39.07,6.5,-34.01,5.52,-11.32,1.39,13.24,-3.08]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":60,"value":[-0.01,-0.01,0,-0.09,0,-0.17,0,-0.17,-0.01,-0.13,0,0,0,0,0,0,0,0,0,-0.09,-0.03,-1,-0.06,-1.91,-0.06,-1.78,-0.03,-0.93,0,0,0,0,0,0,0,0,0,-0.17,-0.06,-1.91,-0.12,-3.66,-0.11,-3.39,-0.05,-1.72,0,0,0,0,0,0,0,0,0.3,-0.26,2.97,-3.07,5.05,-6.72,4.11,-6.81,2.76,-3.95,1.45,-0.34,0,0,0,0,0,0,0.59,-0.51,6.4,-6.41,10.75,-14.37,9.59,-14.86,8.38,-8.67,7.11,-1.65,0,0,0,0,0,0,0.88,-0.79,9.69,-9.97,16.15,-22.46,14.99,-23.33,14.15,-13.61,13.24,-3.08]}]},{"name":"B_CLOTHES.28","type":50,"frame":[{"duration":-60,"tweenEasing":0,"offset":2,"value":[-11.12,-2.97,-21.4,-5.71,-23.03,-6.2,-12.41,-3.96,-1.78,-1.71,-0.7,-1.34,-0.36,-0.7,0,0,0,0,-9.54,-4.64,-18.33,-9.09,-19.63,-9.84,-10.43,-5.52,-1.24,-1.21,-0.39,-0.72,-0.2,-0.39,0,0,0,0,-8.04,-6.23,-15.45,-12.23,-16.47,-13.2,-8.61,-6.97,-0.75,-0.75,-0.09,-0.16,-0.05,-0.11,0,0,0,0,-6.12,-5.97,-11.9,-12.05,-13.17,-13.07,-7.04,-6.83,-0.92,-0.59,0,0,0,0,0,0,0,0,4.3,-1.23,8.4,-2.38,8.92,-2.56,4.69,-1.34,0.46,-0.11,0,0,0,0,0,0,0,0,14.89,3.58,28.78,7.32,30.96,7.96,16.42,4.16,1.88,0.36,0,0,0,0,0,0,0,0,14.09,3.7,27.23,7.36,29.36,7.97,15.61,4.16,1.86,0.36,0,0,0,0,0,0,0,0,7.26,1.89,14.06,3.82,15.23,4.14,8.11,2.16,0.99,0.19]},{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.12,-2.97,-21.4,-5.71,-23.03,-6.2,-12.41,-3.96,-1.78,-1.71,-0.7,-1.34,-0.36,-0.7,0,0,0,0,-9.54,-4.64,-18.33,-9.09,-19.63,-9.84,-10.43,-5.52,-1.24,-1.21,-0.39,-0.72,-0.2,-0.39,0,0,0,0,-8.04,-6.23,-15.45,-12.23,-16.47,-13.2,-8.61,-6.97,-0.75,-0.75,-0.09,-0.16,-0.05,-0.11,0,0,0,0,-6.12,-5.97,-11.9,-12.05,-13.17,-13.07,-7.04,-6.83,-0.92,-0.59,0,0,0,0,0,0,0,0,4.3,-1.23,8.4,-2.38,8.92,-2.56,4.69,-1.34,0.46,-0.11,0,0,0,0,0,0,0,0,14.89,3.58,28.78,7.32,30.96,7.96,16.42,4.16,1.88,0.36,0,0,0,0,0,0,0,0,14.09,3.7,27.23,7.36,29.36,7.97,15.61,4.16,1.86,0.36,0,0,0,0,0,0,0,0,7.26,1.89,14.06,3.82,15.23,4.14,8.11,2.16,0.99,0.19]},{"duration":60,"tweenEasing":0,"offset":2,"value":[1.12,-6.91,2.16,-13.29,2.29,-14.88,0.84,-14.51,-0.61,-14.13,-0.66,-12.56,-0.35,-6.53,0,0,0,0,1.81,-12.55,2.8,-28.01,2.77,-34.74,1.24,-31.21,-0.28,-27.69,-0.29,-23.5,-0.42,-9.97,0,0,0,0,2.02,-13.54,2.99,-30.44,2.66,-39.69,1.33,-29.03,0,-18.37,-0.12,-14.82,-0.17,-6.02,0,0,0,0,3.15,-8.35,3.82,-18.4,1.54,-26.58,0.8,-13.89,0.07,-1.19,0,0,0,0,0,0,0,0,7.79,-2.5,7.07,-7.92,0.73,-13.89,0.42,-7.25,0.11,-0.62,0,0,0,0,0,0,0,0,12.57,3.36,10.23,2.62,0.05,-1.19,0.04,-0.62,0.03,-0.05,0,0,0,0,0,0,0,0,10.73,3.25,8.59,2.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5.37,1.62,4.29,1.3]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":56,"value":[0.67,-0.84,0.64,-0.17,0.25,0.27,-0.02,0.48,-0.29,0.69,-0.3,0.69,-0.15,0.52,0,0,0,0,3.26,-2.74,3.75,0.97,2.17,3.2,-0.22,5.59,-2.61,7.99,-2.56,7.32,-1.3,3.8,0,0,0,0,5.88,-4.66,6.87,2.1,4.11,6.12,-0.42,10.71,-4.95,15.29,-4.79,13.94,-2.49,7.09,0,0,0,0,4.51,-0.91,4.69,9.96,2.12,14.82,-1.48,17.87,-5.08,20.93,-4.6,18.49,-2.48,8.55,0,0,0,0,1.67,1.97,1.09,11.39,-0.39,14.89,-1.71,15.23,-3.04,15.57,-2.55,13.45,-1.37,5.85]}]},{"name":"B_CLOTHES.33","type":11,"frame":[{"duration":-60,"tweenEasing":0,"x":21.65,"y":1.6},{"duration":60,"tweenEasing":0,"x":21.65,"y":1.6},{"duration":121}]},{"name":"B_CLOTHES.33","type":12,"frame":[{"duration":-60,"tweenEasing":0,"x":75.1},{"duration":60,"tweenEasing":0,"x":75.1},{"duration":60,"tweenEasing":0,"x":27.6},{"duration":60,"tweenEasing":0},{"x":-34}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_L_02","timeline":[{"name":"B_CLOTHES.36","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.08","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_HAND_L","timeline":[{"name":"B_CLOTHES.08","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-0.11,-0.44,-0.23,-0.88,-0.24,-0.96,-0.13,-0.5,-0.01,-0.04,0,0,0,0,0,0,0,0,-0.22,-0.85,-0.43,-1.7,-0.47,-1.85,-0.25,-0.96,-0.02,-0.08,0,0,0,0,0,0,0,0,-0.24,-0.93,-0.47,-1.84,-0.51,-1.98,-0.27,-1.04,-0.02,-0.09,0,0,0,0,0,0,0,0,-0.13,-0.5,-0.25,-0.96,-0.27,-1.04,-0.14,-0.54,-0.01,-0.05,0,0,0,0,0,0,0,0,-0.02,-0.07,-0.03,-0.09,-0.02,-0.09,-0.01,-0.05]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.54,1.35,1.06,2.74,1.28,3,1.67,1.97,2.07,0.93,1.84,0.74,0.95,0.36,0,0,0,0,1.05,2.62,2.06,5.28,2.46,5.78,3.22,3.79,3.98,1.79,3.56,1.42,1.83,0.7,0,0,0,0,1.15,2.89,2.23,5.69,2.63,6.22,3.46,4.07,4.29,1.92,3.86,1.53,2,0.77,0,0,0,0,0.62,1.55,1.17,2.99,1.37,3.25,1.81,2.13,2.25,1,2.04,0.8,1.06,0.42,0,0,0,0,0.08,0.22,0.12,0.28,0.1,0.28,0.16,0.18,0.21,0.08,0.23,0.07,0.13,0.06]}]},{"name":"B_HAND.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[40.01,14.54,33.74,10.25,26.97,6.03,21.14,1.84,17.68,-2.35,16.84,-2.27,14.91,-1.94,12.64,-1.37,10.8,-0.6,38.45,21.52,32.62,15.86,26.41,10.06,20.96,4.47,17.38,-0.54,16.56,-0.69,14.72,-0.89,12.6,-0.98,10.92,-0.78,36.7,29.22,31.39,22.06,25.73,14.51,20.64,7.37,17.02,1.43,16.26,1.01,14.53,0.19,12.57,-0.61,11.1,-1.02,35.28,35.44,30.41,26.96,25.26,18.01,20.47,9.66,16.71,2.97,16.01,2.33,14.4,1.02,12.61,-0.4,11.35,-1.37,34.68,37.98,30.01,28.7,25.28,19.2,20.71,10.46,16.54,3.48,15.89,2.77,14.38,1.27,12.74,-0.45,11.67,-1.83,37.9,36.18,32.7,27.92,27.1,19.03,21.88,10.66,17.8,3.93,17.29,3.17,15.52,1.52,13.46,-0.49,12.1,-2.36,41.69,32.39,36.15,25.61,30.16,18.31,24.75,11.26,20.94,5.24,20.09,4.32,17.56,2.27,14.62,-0.28,12.47,-2.72,45.75,27.84,39.97,22.69,33.75,17.39,28.3,12.08,24.88,6.94,23.44,5.82,19.95,3.29,15.88,0.13,12.76,-2.9,49.77,23.76,43.75,20.15,37.14,16.67,31.53,12.94,28.52,8.58,26.55,7.3,22.11,4.37,16.97,0.68,12.9,-2.89]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[20.27,-65.55,18.9,-54.78,17.53,-44.02,16.15,-33.26,14.78,-22.5,13.41,-11.73,12.04,-0.97,10.66,9.79,9.29,20.56,16.24,-66.79,14.86,-56.03,13.49,-45.27,12.12,-34.51,10.74,-23.74,9.37,-12.98,8,-2.22,6.62,8.55,5.25,19.31,12.2,-68.04,10.83,-57.28,9.45,-46.52,8.08,-35.75,6.71,-24.99,5.33,-14.23,3.96,-3.46,2.59,7.3,1.21,18.06,8.16,-69.29,6.79,-58.53,5.41,-47.76,4.04,-37,2.67,-26.24,1.29,-15.47,-0.08,-4.71,-1.45,6.05,-2.83,16.82,4.12,-70.54,2.75,-59.77,1.38,-49.01,0,-38.25,-1.37,-27.48,-2.74,-16.72,-4.12,-5.96,-5.49,4.81,-6.86,15.57,0.08,-71.78,-1.29,-61.02,-2.66,-50.26,-4.04,-39.49,-5.41,-28.73,-6.78,-17.97,-8.15,-7.2,-9.53,3.56,-10.9,14.32,-3.95,-73.03,-5.33,-62.27,-6.7,-51.5,-8.07,-40.74,-9.45,-29.98,-10.82,-19.21,-12.19,-8.45,-13.57,2.31,-14.94,13.07,-7.99,-74.28,-9.36,-63.51,-10.74,-52.75,-12.11,-41.99,-13.48,-31.22,-14.86,-20.46,-16.23,-9.7,-17.6,1.06,-18.98,11.83,-12.03,-75.52,-13.4,-64.76,-14.78,-54,-16.15,-43.23,-17.52,-32.47,-18.9,-21.71,-20.27,-10.95,-21.64,-0.18,-23.02,10.58]}]},{"name":"B_HAND.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[19.38,1.82,15.27,1.77,10.69,1.54,6.99,1.22,5.48,0.95,5.47,0.87,5.5,0.81,5.61,0.74,5.84,0.63,26.27,1.6,21,1.43,15.15,1.04,10.43,0.58,8.51,0.23,8.09,0.23,7.32,0.36,6.49,0.5,5.9,0.54,33.4,1.64,27,1.3,19.89,0.62,14.15,-0.1,11.85,-0.57,10.94,-0.49,9.31,-0.16,7.48,0.22,6,0.4,40.02,1.13,32.44,0.71,24.04,-0.02,17.25,-0.77,14.54,-1.26,13.31,-1.12,10.99,-0.63,8.34,-0.09,6.14,0.22,45.34,-0.76,36.51,-0.98,26.76,-1.17,18.87,-1.36,15.62,-1.61,14.52,-1.47,11.91,-0.97,8.83,-0.4,6.32,-0.02,53.96,-0.98,45.05,-1.22,35.41,-1.58,27.2,-1.93,22.53,-2.16,19.91,-1.67,15.59,-1.13,10.72,-0.59,6.43,-0.12,63.65,-2.21,54.84,-2.33,45.5,-2.57,37.19,-2.78,31.43,-2.85,26.74,-1.98,20.22,-1.29,13.06,-0.69,6.48,-0.1,73.8,-3.76,65.18,-3.73,56.23,-3.74,47.89,-3.71,41.13,-3.58,34.13,-2.3,25.19,-1.41,15.57,-0.7,6.49,0.04,83.85,-4.96,75.36,-4.81,66.73,-4.68,58.32,-4.5,50.47,-4.21,41.25,-2.53,29.98,-1.44,17.95,-0.62,6.49,0.27]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[15.43,-49.79,13.76,-37,12.06,-23.8,10.41,-11.42,8.83,-1.07,8.76,3.05,7.58,7.93,5.96,13.12,4.56,18.15,10.62,-55.34,9.42,-42.77,8.16,-29.83,6.98,-17.52,6.01,-6.84,6.05,-2.79,5.28,3.18,4.19,9.89,3.27,16.14,5.73,-61.61,4.97,-49.25,4.08,-36.52,3.3,-24.24,2.89,-13.22,3.1,-9.18,2.76,-1.99,2.23,6.37,1.85,13.91,0.98,-66.43,0.76,-54.3,0.36,-41.87,0.12,-29.71,0.37,-18.39,0.64,-14.48,0.67,-6.34,0.63,3.41,0.69,12.1,-3.4,-67.63,-2.87,-55.78,-2.44,-43.89,-1.81,-32.09,-0.67,-20.52,-0.58,-17.03,-0.34,-8.57,-0.05,1.89,0.22,11.36,-5.29,-69.57,-5.59,-57.98,-5.29,-46.09,-3.91,-34.19,-0.93,-22.56,-0.86,-19.05,-0.55,-10.5,-0.16,0.1,0.16,9.74,-6.99,-72.33,-8.32,-61.39,-8.22,-50.15,-6.14,-38.8,-1.55,-27.53,-1.42,-23.9,-0.99,-15.07,-0.45,-4.14,0.01,5.79,-8.61,-75.41,-11.01,-65.28,-11.14,-54.96,-8.42,-44.43,-2.31,-33.66,-2.09,-29.89,-1.52,-20.71,-0.81,-9.36,-0.18,0.92,-10.26,-78.33,-13.71,-68.92,-14.04,-59.4,-10.67,-49.56,-3,-39.21,-2.71,-35.31,-2.01,-25.81,-1.14,-14.09,-0.35,-3.48]}]},{"name":"B_HAND.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[23.14,1.08,17.91,1.21,12.11,1.19,7.42,1.05,5.5,0.84,5.52,0.7,5.64,0.6,5.87,0.64,6.23,0.96,29.17,2.67,22.51,2.35,15.13,1.78,9.16,1.18,6.74,0.77,6.61,0.65,6.44,0.57,6.35,0.6,6.45,0.8,35.22,4.41,27.15,3.61,18.2,2.42,10.99,1.28,8.11,0.63,7.8,0.52,7.32,0.44,6.89,0.42,6.71,0.5,41.17,5.37,31.66,4.2,21.1,2.65,12.59,1.24,9.2,0.46,8.79,0.35,8.09,0.23,7.4,0.14,7.02,0.09,46.93,4.58,35.85,3.33,23.62,2.02,13.71,0.93,9.63,0.3,9.3,0.17,8.54,0,7.76,-0.2,7.35,-0.39,57.36,5.39,45.53,4.27,32.8,2.7,21.81,1.25,15.19,0.5,14.72,0.35,12.5,0.08,9.71,-0.21,7.52,-0.46,68.75,3.61,56.44,2.99,43.51,2.02,31.78,1.08,23.05,0.6,21.83,0.46,17.56,0.19,12.17,-0.11,7.59,-0.38,80.57,0.85,67.89,0.89,54.87,0.84,42.52,0.74,31.83,0.66,29.55,0.56,22.99,0.35,14.79,0.09,7.59,-0.17,92.28,-1.24,79.18,-0.64,65.98,0.02,52.91,0.54,40.17,0.79,36.91,0.74,28.17,0.6,17.27,0.4,7.55,0.16]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-1.54,-10.15,-1.08,-7.14,-0.58,-3.81,-0.17,-1.11,0,0,0,0,0,0,0,0,0,0,-2.78,-14.51,-1.99,-11.25,-1.12,-7.61,-0.42,-4.67,-0.1,-3.45,-0.04,-3.38,0.07,-3.21,0.21,-3.01,0.33,-2.84,-4.14,-19.34,-2.99,-15.8,-1.74,-11.83,-0.71,-8.6,-0.21,-7.26,-0.09,-7.11,0.15,-6.75,0.44,-6.33,0.7,-5.99,-5.25,-23.24,-3.8,-19.46,-2.22,-15.23,-0.92,-11.77,-0.3,-10.35,-0.13,-10.14,0.21,-9.63,0.62,-9.03,0.99,-8.53,-5.7,-24.85,-4.11,-20.92,-2.35,-16.58,-0.92,-13.07,-0.34,-11.62,-0.18,-11.4,0.21,-10.85,0.68,-10.19,1.11,-9.58,-6.05,-25.54,-4.48,-21.19,-2.69,-16.56,-1.23,-12.89,-0.67,-11.4,-0.54,-11.13,-0.08,-10.45,0.5,-9.53,0.99,-8.53,-6.9,-27.23,-5.32,-22.23,-3.52,-16.87,-2.05,-12.6,-1.48,-10.86,-1.29,-10.37,-0.7,-9.15,0.05,-7.56,0.7,-5.99,-7.95,-29.31,-6.34,-23.58,-4.54,-17.31,-3.07,-12.26,-2.49,-10.19,-2.2,-9.4,-1.44,-7.48,-0.5,-5.07,0.33,-2.84,-8.89,-31.19,-7.26,-24.78,-5.46,-17.69,-4,-11.95,-3.4,-9.59,-3.03,-8.54,-2.12,-5.99,-1.01,-2.85]}]},{"name":"B_HAND.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[24.45,7.62,18.81,5.59,12.58,3.42,7.53,1.63,5.45,0.76,5.56,0.65,5.87,0.58,6.3,0.6,6.77,0.78,33.1,9.87,25.47,7.37,17.33,4.67,10.32,2.18,6.1,0.31,6.17,0.22,6.38,0.16,6.69,0.17,7.06,0.31,42.14,12.43,32.49,9.41,22.32,6.05,13.23,2.72,6.82,-0.18,6.82,-0.24,6.92,-0.26,7.1,-0.22,7.35,-0.1,50.42,14.32,38.9,10.88,26.82,7.12,15.79,3.24,7.4,-0.59,7.37,-0.62,7.37,-0.59,7.45,-0.53,7.62,-0.44,56.75,14.54,43.7,10.93,30.12,7.48,17.57,3.73,7.63,-0.8,7.64,-0.8,7.64,-0.77,7.69,-0.71,7.85,-0.65,68.21,16.58,55.06,13.18,41.36,9.37,28.43,5.43,17.61,1.7,15.9,1.38,13.36,0.47,10.49,-0.36,7.82,-0.48,76.59,12.82,63.56,10,50.16,6.66,37.28,3.39,25.83,0.81,22.81,0.7,18.16,0.05,12.83,-0.48,7.79,-0.23,82.71,5.5,69.9,3.46,56.93,1.01,44.24,-1.16,32.27,-2.4,28.41,-1.92,22.09,-1.5,14.73,-0.92,7.75,0.07,87.4,-3.12,74.76,-4.39,62.08,-5.91,49.43,-6.97,36.89,-6.86,32.84,-5.57,25.26,-3.68,16.2,-1.57,7.72,0.4]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[-0.22,3.63,-0.15,3.63,-0.07,3.71,-0.01,3.57,0.01,2.9,0,2.56,0.01,1.75,0.01,0.8,0,0,-0.46,7.64,-0.32,7.62,-0.15,7.77,-0.02,7.47,0.03,6.1,0.02,5.38,0.02,3.66,0.01,1.64,0,0,-0.66,10.89,-0.45,10.88,-0.21,11.14,-0.02,10.72,0.04,8.69,0.04,7.68,0.02,5.26,0.01,2.39,0,0,-0.74,12.23,-0.49,12.28,-0.22,12.79,0,12.39,0.04,9.76,0.04,8.69,0.03,6.1,0.01,2.9,0,0,-0.66,12.43,-0.39,12.25,-0.08,12.39,0.16,11.91,0.21,9.87,0.21,8.8,0.16,6.19,0.07,2.95,0,0,-0.46,12.93,-0.13,12.48,0.24,12.22,0.52,11.61,0.61,10.13,0.57,9.03,0.4,6.35,0.19,3.03,0,0,-0.22,13.53,0.18,12.81,0.62,12.13,0.97,11.39,1.1,10.46,0.99,9.32,0.7,6.54,0.33,3.11,0,0,0,14.08,0.46,13.1,0.97,12,1.38,11.12,1.55,10.76,1.38,9.58,0.97,6.72,0.46,3.19]}]},{"name":"B_HAND.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[6.98,1.49,2.89,1.85,-1.63,2.33,-5.28,2.72,-6.77,2.82,-5.01,2.29,-1.14,1.41,3.43,0.5,7.23,-0.16,15.92,2.7,10.12,2.54,3.86,2.38,-1.43,2,-4.33,1.19,-2.71,0.97,0.58,0.8,4.35,0.71,7.42,0.7,25.29,4.31,17.67,3.52,9.52,2.46,2.42,1.05,-2.04,-0.75,-0.52,-0.58,2.19,0.14,5.2,1.04,7.57,1.77,33.93,5.32,24.75,4.1,14.94,2.57,6.28,0.57,0.57,-2.03,1.91,-1.59,3.95,-0.25,6.07,1.38,7.66,2.71,40.7,4.72,30.52,3.58,19.67,2.77,10.14,1.33,3.97,-1.67,4.91,-1.29,6.06,-0.04,7.1,1.61,7.69,3.21,48.86,4.08,37.86,2.82,26.11,1.19,15.8,-0.84,9.11,-3.34,9.67,-2.5,9.42,-0.84,8.65,1.17,7.65,3.06,54.68,0.33,43.75,-0.57,32.07,-1.79,22.06,-3.26,16.14,-4.94,15.85,-3.74,13.7,-1.86,10.63,0.3,7.58,2.37,59.55,-4.68,49.05,-5.03,37.75,-5.38,28.46,-5.85,23.98,-6.53,22.6,-5.01,18.35,-2.99,12.79,-0.76,7.49,1.43,64.86,-9.09,54.64,-8.97,43.52,-8.72,34.74,-8.41,31.55,-8.15,29.14,-6.28,22.85,-4.1,14.88,-1.76,7.42,0.57]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[1.41,43.43,1.14,36.12,0.93,28.59,0.61,21.51,-0.01,15.55,-0.01,13.85,-0.01,9.72,0,4.62,0,0,2.21,40.94,2.22,34.62,2.38,28.25,2.37,22.17,1.89,16.69,1.66,14.35,1.16,9.95,0.55,4.75,0,0,3.1,38.18,3.42,32.9,3.96,27.84,4.3,22.89,4,17.95,3.49,14.96,2.43,10.25,1.15,4.91,0,0,3.82,35.95,4.42,31.59,5.27,27.57,5.86,23.5,5.7,18.97,5.02,15.37,3.5,10.44,1.65,5.03,0,0,4.12,35.03,4.91,31.29,5.86,27.66,6.5,23.81,6.4,19.39,5.78,15.26,4.07,10.33,1.93,5.09,0,0,7.09,36.27,7.2,32.68,7.4,28.68,7.36,24.25,6.77,19.33,6,15.22,4.21,10.31,2,5.08,0,0,9.71,36.48,9.34,33.18,9.03,29.15,8.55,24.47,7.67,19.18,6.61,15.12,4.59,10.25,2.2,5.05,0,0,12.19,36.29,11.42,33.32,10.7,29.41,9.88,24.61,8.78,18.99,7.37,14.99,5.09,10.16,2.46,5,0,0,14.74,36.29,13.53,33.65,12.35,29.77,11.14,24.79,9.78,18.82,8.05,14.87,5.53,10.08,2.68,4.96]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_TWIN_R","timeline":[{"name":"B_HAIR_TWIN.15","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.19,0,-0.35,0,-0.28,0,-0.42,-0.02,-0.56,-0.04,-0.53,-0.04,-0.53,-0.03,-0.53,0,0,0,-1.64,0,-3.15,0,-3.65,-0.02,-4.86,-0.23,-6.07,-0.43,-6.19,-0.4,-6.19,-0.21,-6.19,0,0,0,-3.08,0,-5.94,0,-7.02,-0.04,-9.3,-0.43,-11.58,-0.83,-11.84,-0.77,-11.84,-0.39,-11.84,0,0,0,-5.32,0,-10.31,0,-12.36,-0.03,-15.45,-0.4,-18.54,-0.77,-18.37,-0.71,-17.63,-0.36,-16.9,0,0,0,-6.85,0,-13.22,0,-15.47,-0.02,-18.69,-0.21,-21.9,-0.4,-22.01,-0.37,-21.9,-0.18,-21.83,0,0,0,-8.18,0,-15.74,0,-17.98,0,-21.21,0,-24.44,0,-24.94,0,-25.69,0,-26.51]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":19,"value":[0.42,0.37,0.24,0.71,0.05,0.77,0,0.41,0,0.05,0,0,0,0,0,0,0,0,0.81,0.71,0.45,1.37,0.09,1.49,0,0.79,0,0.09,0,0,0,0,0,0,0,1.9,1.13,2.24,0.66,2.51,0.14,2.21,0,1.45,-0.02,0.69,-0.04,0.71,-0.04,0.38,-0.03,0,0,6.41,0.79,7.29,0.48,8.06,0.1,7.91,-0.02,7.51,-0.23,7.11,-0.43,6.3,-0.4,3.27,-0.21,0,0,8.67,0.08,10.95,0.04,13.06,0.01,13.62,-0.04,13.57,-0.43,13.52,-0.83,11.87,-0.77,6.15,-0.39,0,0,9.42,0,13.11,0,16.6,0,18.07,-0.04,18.74,-0.45,19.4,-0.87,16.91,-0.81,8.73,-0.42,0,0,11.68,0,15.3,0,18.68,0,19.94,-0.04,20.74,-0.45,21.54,-0.87,18.97,-0.81,9.82,-0.42,0,0,14.14,0,17.41,0,20.43,0,21.28,-0.04,22.09,-0.45,22.9,-0.87,20.46,-0.81,10.63,-0.42]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_TWIN_L","timeline":[{"name":"B_HAIR_TWIN.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.12,-0.02,-0.23,-0.03,-0.16,-0.03,-0.37,-0.04,-0.58,-0.05,-0.56,-0.05,-0.48,-0.04,-0.39,0,0,0,-1.05,-0.14,-2.03,-0.27,-2.45,-0.31,-4.27,-0.45,-6.09,-0.58,-6.08,-0.53,-5.35,-0.27,-4.55,0.01,0,0,-1.99,-0.26,-3.83,-0.51,-4.75,-0.6,-8.18,-0.86,-11.61,-1.12,-11.6,-1.01,-10.21,-0.51,-8.72,0.01,0,0,-4.76,-0.31,-9.2,-0.68,-10.37,-0.79,-12.52,-0.92,-14.67,-1.05,-14.19,-0.93,-12.42,-0.45,-10.48,0.02,0,0,-7.96,-0.16,-15.34,-0.36,-17.37,-0.42,-19.83,-0.47,-22.3,-0.52,-21.67,-0.46,-18.88,-0.21,-15.84,0.03,0,0,-11.07,0.02,-21.3,0.04,-24.2,0.04,-27.33,0.05,-30.45,0.05,-29.75,0.05,-25.85,0.04,-21.63,0.04]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":54,"value":[0.34,0.03,1.02,0.02,1.68,0.02,2.05,0.02,2.17,-0.06,2.29,-0.14,1.55,-0.26,0.73,-0.17,-0.05,-0.21,3.99,0.3,5.32,0.3,6.61,0.29,7.36,0.28,8.4,0.18,9.44,0.07,6.45,-0.7,2.87,-1.56,-0.58,-2.43,7.63,0.57,8.71,0.57,9.72,0.57,10.26,0.56,12.22,0.55,14.19,0.53,9.56,-0.94,4.1,-2.87,-1.12,-4.65,10.71,0.59,10.83,0.55,11,0.53,11.43,0.49,12.61,0.14,13.8,-0.22,9.97,-1.71,4.44,-3.97,-1.05,-5.87,21.43,0.57,18.68,0.42,16.18,0.29,15.75,0.23,16.05,0.01,16.35,-0.21,13.42,-0.98,6.6,-2.21,-0.55,-3.21,33.02,0.55,27.22,0.28,21.87,0.03,20.45,-0.03,19.93,-0.03,19.41,-0.03,17.24,-0.03,8.96,-0.02]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_SIDE_L","timeline":[{"name":"B_HAIR_SIDE.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-0.23,0,-0.48,0,-0.68,0,-0.79,0,-0.68,0,-0.48,0,-0.23,0,0,0,0,0,-0.48,0,-0.99,0,-1.43,0,-1.66,0,-1.43,0,-0.99,0,-0.48,0,0,0,0,0,-0.68,0,-1.43,0,-2.05,0,-2.36,0,-2.05,0,-1.43,0,-0.68,0,0,0,0,0,-0.79,0,-1.66,0,-2.36,0,-2.65,0,-2.36,0,-1.66,0,-0.79,0,0,0,-0.87,-0.1,-6.03,-0.07,-10.34,-0.04,-13,-0.04,-13.22,-0.14,-13.51,-0.29,-11.79,-0.32,-8.65,-0.22,-4.64,0,-2.98,-0.33,-13.59,-0.29,-22.42,-0.22,-28.16,-0.25,-29.51,-0.45,-30.63,-0.73,-28.15,-0.72,-22.94,-0.46,-15.89,0,-5.59,-0.62,-21.57,-0.55,-34.88,-0.44,-43.72,-0.46,-46.28,-0.75,-48.74,-1.16,-46.01,-1.12,-39.3,-0.71,-29.8,0,-7.95,-0.88,-28.36,-0.75,-45.12,-0.55,-55.88,-0.51,-58.28,-0.88,-62.78,-1.43,-60.64,-1.41,-53.34,-0.91,-42.38]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.23,0,0.48,0,0.68,0,0.79,0,0.68,0,0.48,0,0.23,0,0,0,0,0,0.48,0,0.99,0,1.43,0,1.66,0,1.43,0,0.99,0,0.48,0,0,0,0,0,0.68,0,1.43,0,2.05,0,2.36,0,2.05,0,1.43,0,0.68,0,0,0,0,0,0.79,0,1.66,0,2.36,0,2.65,0,2.36,0,1.66,0,0.79,0,0,0,8.24,0,9.43,0.06,10.8,0.18,11.83,0.31,12.04,0.37,11.53,0.31,9.63,0.18,6.22,0.06,1.16,0,16.89,0,18.91,0.05,21.18,0.16,22.96,0.28,23.51,0.33,22.66,0.28,19.46,0.16,13.41,0.05,3.97,0,25.7,0,28.72,0.02,32.07,0.06,34.76,0.1,35.8,0.12,34.57,0.1,30.03,0.06,21.29,0.02,7.45,0,34.44,0,38.37,0,42.71,0,46.23,0,47.68,0,46.08,0,40.22,0,28.82,0,10.6]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_SIDE_R","timeline":[{"name":"B_HAIR_SIDE.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":90,"value":[-0.28,0,-4.37,0,-6.76,0,-6.74,0,-3.61,0,-6.53,-0.13,-8.92,-0.17,-10.53,-0.13,-11.14,0,-0.95,0,-10.31,0,-16.28,0,-17.43,0,-12.36,0,-16.84,-0.26,-20.23,-0.35,-22.06,-0.26,-21.88,0,-1.78,0,-16.76,0,-26.71,0,-29.55,0,-23.18,0,-28.7,-0.4,-32.56,-0.53,-34.04,-0.4,-32.46,0,-2.54,0,-22.86,0,-36.55,0,-40.84,0,-32.97,0,-39.82,-0.53,-44.42,-0.71,-45.84,-0.53,-43.12]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":90,"value":[1.66,0,5.39,0,9.21,0.02,12.86,0.03,16.08,0.03,15.06,0.23,12.01,0.67,7.24,1.12,1.11,1.32,5.71,0,11.35,0.01,17.17,0.02,22.64,0.03,27.25,0.04,26.68,0.31,22.14,0.9,14.3,1.49,3.8,1.76,10.7,0,16.19,0.01,21.94,0.02,27.17,0.03,31.14,0.03,33.22,0.23,29.25,0.67,20.22,1.11,7.13,1.32,15.22,0,18.23,0,21.56,0,24.25,0,25.36,0,33.21,0,32.34,0,24.17,0,10.15]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_MOUTH_OPEN_Y","timeline":[{"name":"D_MOUTH.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_MOUTH_FORM","timeline":[{"name":"D_MOUTH.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_MOUTH.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_MOUTH.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_MOUTH.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_MOUTH_SIZE","timeline":[{"name":"B_MOUTH.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[41.89,26.96,32.49,26.96,23.08,26.96,13.68,26.96,4.27,26.96,-5.14,26.95,-14.54,26.95,-23.95,26.95,-33.35,26.95,41.89,21.14,32.48,21.14,23.08,21.13,13.69,21.13,4.4,21.13,-4.9,21.13,-14.32,21.12,-23.83,21.12,-33.35,21.12,41.89,15.31,32.48,15.31,23.08,15.31,13.7,15.31,4.51,15.3,-4.68,15.3,-14.12,15.3,-23.73,15.3,-33.35,15.3,41.89,9.49,32.48,9.49,23.08,9.49,13.69,9.48,4.57,9.48,-4.56,9.49,-14,9.48,-23.66,9.48,-33.35,9.47,41.89,3.66,32.48,3.66,23.08,3.66,13.72,3.66,4.83,3.72,-4.05,3.77,-13.53,3.76,-23.42,3.71,-33.36,3.65,41.89,-2.16,32.48,-2.16,23.08,-2.16,13.75,-2.15,5.1,-2.05,-3.54,-1.94,-13.06,-1.96,-23.18,-2.06,-33.36,-2.17,41.88,-7.98,32.48,-7.99,23.07,-7.99,13.74,-7.98,5.18,-7.9,-3.38,-7.81,-12.91,-7.83,-23.1,-7.92,-33.36,-8,41.88,-13.81,32.48,-13.81,23.07,-13.81,13.76,-13.82,5.36,-13.84,-3.04,-13.87,-12.59,-13.87,-22.93,-13.86,-33.36,-13.82,41.88,-19.63,32.48,-19.63,23.07,-19.64,13.78,-19.65,5.56,-19.8,-2.67,-19.95,-12.24,-19.93,-22.76,-19.8,-33.36,-19.65]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-6.4,-1.4,-12.33,-4.01,-17.8,-6.41,-17.87,-7.02,-3.73,-7.02,10.4,-7.03,11.03,-6.26,8.3,-3.25,5.33,0,-6.4,1.85,-11.32,-2.04,-15.79,-5.93,-14.61,-7.94,-0.88,-8.02,11.03,-7.35,11.74,-5.49,9.48,-1.06,6.32,3.9,-6.4,4.85,-10.36,-0.22,-13.88,-5.45,-11.46,-8.81,1.88,-8.99,11.57,-7.67,12.37,-4.77,10.58,0.94,7.23,7.51,-6.22,5.74,-9.68,0.97,-12.71,-4.21,-9.95,-7.91,2.93,-8.13,11.52,-6.57,12.68,-3.63,11.27,1.93,7.56,8.43,-4.27,7.03,-7.59,6.6,-10.47,6.03,-8.8,4.61,3.2,5.06,12.73,6.53,14.7,6.81,13.27,6.82,8.53,8.43,-2.32,8.31,-5.12,12.23,-7.67,16.28,-7.03,17.14,3.2,18.27,12.83,19.65,15.87,17.24,14.74,11.68,9.51,8.43,-1.9,7.51,-3.52,11.94,-5.03,16.54,-4.65,17.78,3.18,18.05,11.01,18.31,13.75,15.93,13.27,10.96,9.48,7.66,-0.99,3.9,-1.77,6.85,-2.49,9.9,-2.07,10.68,4.24,10.42,10.55,10.16,12.03,8.91,11.38,6.36,9.03,4.66,0,0,0,1.3,0,2.5,0.46,2.75,5.33,2.11,10.21,1.46,10.43,1.4,9.52,1.4,8.53,1.4]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_FORM","timeline":[{"name":"D_BROW.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[7.51,62.86,4.31,118.99,-3.75,114.04,1.49,63.76,-6.21,14.82,0,0,0,-14.82,0.56,-5.39,1.73,10.79,8.26,77.22,-0.56,124.81,-2.25,8.08,-2.44,50.28,-0.74,105.5,0.56,122.57,-7.88,130.2,0.19,81.71,-3.38,24.24,0,1.35,-1.13,123.92,-5.82,119.88,6.01,80.82,-4.34,99.69,1.66,37.72,0,56.12,-1.69,2.69,0,0,-3.36,126.84,-1.51,113.14,-1.18,90,-1.14,53.06,-1.7,29.63,-5.07,5.38,-1.15,129.26,-0.4,111.42,3.07,86.26,4.33,56.62,-1.1,30.51,0.01,9.42,0,0,0.56,-9.43,2.04,104.97,-2.83,99.03,4.88,102.42]},{"duration":60,"tweenEasing":0,"offset":87},{"value":[21.77,-63.75,4.88,-30.53,-3.38,-56.57,7.13,-72.73,2.25,-67.35,0,-34.12,-22.52,-35.92,-3.75,-62.86,6.38,-64.65,6.38,-45.8,2.63,-51.18,-1.5,-61.96,5.26,-61.96,2.25,-54.77,0,-42.2,-0.75,-47.59,6.76,-57.47,2.25,-63.75,-0.75,-43.1,1.13,-43.1,1.13,-44,3.75,-61.06,0,-66.45,5.26,-65.55,6.76,-56.57,4.13,-47.59,1.5,-66.45,-1.67,-49.31,-1.05,-55.83,4.55,-63.24,6.13,-66.99,3.78,-64.61,0.33,-64.58,1.41,-47.04,2.43,-53.09,4.19,-50.57,5.85,-53.49,5.76,-63.17,2.4,-63.29,-2.72,-62.45,-7.44,-34.72,8.46,-50.58,9.2,-51.73,11.36,-43.28]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_FORM","timeline":[{"name":"D_BROW.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[2.37,-26.18,0.52,1.33,2.96,48.43,13.61,115.18,-5.33,90.31,0,23.56,2.37,102.09,-4.73,53.66,0.41,-16.02,1.52,9.15,0.98,84.35,4.73,98.16,0.13,57.88,-2.37,-11.78,-5.12,-7.43,1.18,75.91,9.47,112.56,3.55,83.76,-3.55,-23.56,-2.96,-9.6,3.22,20.95,0,0,2.96,81.15,3.6,109.71,2.88,82.02,6.6,105.39,3.03,2.22,0.53,29.32,1.69,26.14,2.37,5.41]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[34.32,-44.5,-1.18,-18.32,-1.18,-47.12,-1.18,-60.21,-2.37,-61.95,-14.2,-74.17,-3.16,-59.33,-13.41,-51.48,-5.92,-18.32,-11.44,-36.65,0,-58.46,-1.97,-55.84,-5.92,-50.61,2.37,-20.94,-7.1,-20.94,-1.58,-54.97,0,-54.1,-1.97,-57.59,14.2,-23.56,2.37,-18.32,-7.1,-30.54,-4.73,-23.56,-1.18,-36.65,0.79,-47.96,-8.99,-46.83,0.72,-55.97,-7.07,-26.14,-7.02,-43.55,-13.55,-46.07,-6.94,-33.22]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_Y","timeline":[{"name":"B_BROW.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_X","timeline":[{"name":"B_BROW.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_Y","timeline":[{"name":"B_BROW.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_X","timeline":[{"name":"B_BROW.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_L_ANGLE","timeline":[{"name":"B_BROW.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-11.34,70.86,-13.2,55.55,-15.05,40.24,-16.9,24.93,-18.75,9.63,-20.6,-5.68,-22.45,-21,-24.3,-36.33,-26.15,-51.66,-6.44,69.75,-8.3,54.43,-10.15,39.13,-12.01,23.84,-13.86,8.55,-15.71,-6.74,-17.56,-22.04,-19.41,-37.35,-21.26,-52.68,-1.54,68.67,-3.4,53.36,-5.26,38.06,-7.11,22.78,-8.96,7.52,-10.82,-7.78,-12.67,-23.08,-14.52,-38.39,-16.38,-53.72,3.36,67.64,1.5,52.32,-0.36,37.03,-2.22,21.76,-4.07,6.51,-5.92,-8.79,-7.78,-24.09,-9.63,-39.42,-11.49,-54.76,8.25,66.63,6.39,51.32,4.53,36.03,2.68,20.77,0.82,5.54,-1.03,-9.77,-2.88,-25.09,-4.74,-40.43,-6.6,-55.79,13.15,65.61,11.29,50.3,9.43,35.01,7.57,19.75,5.72,4.5,3.87,-10.8,2.02,-26.1,0.16,-41.41,-1.69,-56.75,18.04,64.63,16.18,49.32,14.32,34.03,12.47,18.75,10.61,3.49,8.76,-11.81,6.91,-27.11,5.06,-42.42,3.2,-57.76,22.92,63.72,21.06,48.41,19.21,33.1,17.36,17.81,15.51,2.51,13.66,-12.8,11.8,-28.1,9.95,-43.42,8.1,-58.76,27.79,62.91,25.94,47.58,24.09,32.25,22.25,16.91,20.4,1.59,18.55,-13.73,16.7,-29.06,14.85,-44.39,13.01,-59.73]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[34.49,-61.13,31.86,-43.02,29.24,-24.91,26.62,-6.8,24,11.31,21.38,29.42,18.76,47.52,16.14,65.61,13.53,83.7,28.7,-62.66,26.08,-44.56,23.45,-26.44,20.83,-8.32,18.21,9.82,15.59,27.94,12.96,46.05,10.34,64.16,7.72,82.25,22.92,-64.16,20.29,-46.05,17.66,-27.93,15.03,-9.79,12.41,8.36,9.79,26.48,7.17,44.6,4.54,62.71,1.92,80.79,17.12,-65.61,14.49,-47.51,11.87,-29.38,9.24,-11.23,6.62,6.93,4,25.05,1.37,43.16,-1.25,61.26,-3.88,79.33,11.33,-67.04,8.7,-48.94,6.07,-30.8,3.45,-12.65,0.82,5.54,-1.8,23.65,-4.42,41.75,-7.05,59.83,-9.68,77.88,5.54,-68.48,2.91,-50.38,0.28,-32.24,-2.35,-14.09,-4.97,4.08,-7.59,22.2,-10.21,40.32,-12.84,58.43,-15.46,76.5,-0.26,-69.88,-2.89,-51.78,-5.52,-33.65,-8.14,-15.51,-10.76,2.64,-13.38,20.76,-16.01,38.89,-18.63,57,-21.25,75.07,-6.06,-71.22,-8.69,-53.11,-11.31,-35,-13.94,-16.87,-16.56,1.25,-19.18,19.36,-21.8,37.47,-24.42,55.57,-27.04,73.65,-11.88,-72.45,-14.5,-54.35,-17.12,-36.27,-19.73,-18.19,-22.35,-0.09,-24.97,18,-27.59,36.1,-30.21,54.18,-32.82,72.26]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BROW_R_ANGLE","timeline":[{"name":"B_BROW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[21.06,-45.35,19.9,-33.32,18.74,-21.29,17.58,-9.26,16.43,2.78,15.27,14.81,14.11,26.84,12.95,38.87,11.79,50.9,16.96,-46.04,15.8,-34.01,14.64,-21.98,13.48,-9.95,12.32,2.08,11.16,14.11,10,26.14,8.84,38.18,7.68,50.21,12.85,-46.74,11.69,-34.71,10.53,-22.67,9.37,-10.64,8.21,1.39,7.05,13.42,5.9,25.45,4.74,37.48,3.58,49.51,8.74,-47.43,7.58,-35.4,6.42,-23.37,5.27,-11.34,4.11,0.69,2.95,12.73,1.79,24.76,0.63,36.79,-0.53,48.82,4.64,-48.12,3.48,-36.09,2.32,-24.06,1.16,-12.03,0,0,-1.16,12.03,-2.32,24.06,-3.48,36.09,-4.64,48.12,0.53,-48.82,-0.63,-36.79,-1.79,-24.76,-2.95,-12.72,-4.11,-0.69,-5.27,11.34,-6.42,23.37,-7.58,35.4,-8.74,47.43,-3.58,-49.51,-4.74,-37.48,-5.9,-25.45,-7.05,-13.42,-8.21,-1.39,-9.37,10.64,-10.53,22.67,-11.69,34.71,-12.85,46.74,-7.68,-50.21,-8.84,-38.17,-10,-26.14,-11.16,-14.11,-12.32,-2.08,-13.48,9.95,-14.64,21.98,-15.8,34.01,-16.96,46.04,-11.79,-50.9,-12.95,-38.87,-14.11,-26.84,-15.27,-14.81,-16.43,-2.78,-17.58,9.26,-18.74,21.29,-19.9,33.32,-21.06,45.35]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-14.01,79.68,-16.75,61.4,-19.49,43.12,-22.22,24.84,-24.96,6.55,-27.7,-11.73,-30.43,-30.01,-33.17,-48.29,-35.91,-66.57,-7.77,78.05,-10.51,59.76,-13.25,41.48,-15.98,23.2,-18.72,4.92,-21.46,-13.37,-24.19,-31.65,-26.93,-49.93,-29.67,-68.21,-1.53,76.41,-4.27,58.12,-7.01,39.84,-9.74,21.56,-12.48,3.28,-15.22,-15.01,-17.95,-33.29,-20.69,-51.57,-23.43,-69.85,4.71,74.77,1.97,56.49,-0.77,38.2,-3.5,19.92,-6.24,1.64,-8.98,-16.64,-11.71,-34.93,-14.45,-53.21,-17.19,-71.49,10.95,73.13,8.21,54.85,5.47,36.56,2.74,18.28,0,0,-2.74,-18.28,-5.47,-36.56,-8.21,-54.85,-10.95,-73.13,17.19,71.49,14.45,53.21,11.71,34.93,8.98,16.64,6.24,-1.64,3.5,-19.92,0.77,-38.2,-1.97,-56.49,-4.71,-74.77,23.43,69.85,20.69,51.57,17.95,33.29,15.22,15,12.48,-3.28,9.74,-21.56,7.01,-39.84,4.27,-58.12,1.53,-76.41,29.67,68.21,26.93,49.93,24.19,31.65,21.46,13.37,18.72,-4.92,15.98,-23.2,13.25,-41.48,10.51,-59.76,7.77,-78.05,35.91,66.57,33.17,48.29,30.43,30.01,27.7,11.73,24.96,-6.56,22.22,-24.84,19.49,-43.12,16.75,-61.4,14.01,-79.68]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_Y","timeline":[{"name":"B_EYE_BALL.05","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE_BALL.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_X","timeline":[{"name":"B_EYE_BALL.05","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EYE_BALL.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_FORM","timeline":[{"name":"B_EYE_BALL.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[31.56,49.59,14.93,44.1,1.94,38.11,-4.15,31.15,-0.1,22.73,6.1,26.72,1.36,30.92,-10.32,35.85,-24.94,41.99,26.88,39.39,12.49,34.48,1.35,28.93,-3.77,22.77,-0.07,15.98,4.49,19.04,0.48,22.31,-8.92,26.09,-20.5,30.67,21.89,28.93,9.82,24.52,0.58,19.27,-3.49,13.75,-0.04,8.52,3.04,10.72,-0.16,13.23,-7.18,16.04,-15.58,19.14,17.53,18.98,7.66,15.23,0.17,10.57,-3.02,5.99,-0.01,2.49,1.28,3.67,-1.35,5.08,-6.2,6.58,-11.61,8.02,14.72,10.33,6.7,7.59,0.62,4.3,-2.1,1.43,0,0,-1.1,-0.23,-3.76,-0.78,-7.05,-1.45,-10.03,-2.07,18.53,-2.16,10.59,-3.37,3.96,-4.17,0.19,-4.68,0.83,-5.02,-0.13,-6.53,-3.61,-9.96,-8.07,-13.66,-11.99,-15.98,22.38,-16.97,14.8,-17.42,7.86,-17.39,3.29,-17.22,2.83,-17.21,1.55,-18.84,-3.15,-22.58,-9.19,-26.73,-14.51,-29.57,26.26,-32.7,19.14,-32.7,11.99,-32.51,6.75,-32.31,5.31,-32.27,3.19,-33.55,-3.16,-36.57,-11.2,-40.14,-18.38,-43.04,30.12,-47.97,23.42,-47.36,16.02,-46.68,10.03,-46.13,7.56,-45.9,4.06,-47.06,-4.42,-49.89,-14.91,-53.38,-24.39,-56.53]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[11.15,21.7,7.83,15.26,4.17,8.91,1.22,3.54,0,0,-0.14,1.29,-0.46,4.65,-0.87,9.3,-1.24,14.47,2.2,17.99,-2.81,12.86,-4.57,7.61,-3.49,3.05,0,0,1.59,0.73,2.66,2.98,3.01,6.28,2.42,10.15,-5.19,13.93,-12.34,10.2,-12.58,6.15,-7.83,2.51,0,0,3.44,0,6,0.82,7.17,2.44,6.45,4.85,-10.22,10.65,-19.98,8.22,-19.31,5.1,-11.53,2.09,0,0,5.1,-0.59,8.94,-0.93,10.74,-0.72,9.71,0.36,-12.08,9.3,-24.94,7.86,-24.12,5,-14.25,1.96,0,0,6.26,-0.77,10.88,-1.38,12.82,-1.68,11.06,-1.54,-10.76,8.28,-19.97,6.68,-18.82,3.87,-10.89,1.03,0.27,-0.68,4.93,-1.29,7.96,-1.82,8.83,-2.13,6.98,-2.05,-7.55,5.81,-13.36,4.11,-12.25,1.53,-6.67,-0.94,0.93,-2.32,3.72,-2.74,4.93,-3.11,4.48,-3.33,2.32,-3.29,-3.59,2.76,-6.15,1,-5.22,-1.29,-2.14,-3.34,1.74,-4.36,2.58,-4.56,1.85,-4.74,-0.01,-4.85,-2.57,-4.83,0,0,0.74,-1.84,1.55,-3.88,2.21,-5.52,2.48,-6.2,1.4,-6.2,-1.2,-6.2,-4.42,-6.21,-7.34,-6.21]}]},{"name":"B_EYE_BALL.09","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[17.16,61.85,11.71,55.12,5.69,48.34,0.81,41.68,-1.18,35.32,-3,41.02,-9.17,45.53,-17.08,49.57,-24.12,53.84,14,44.74,9.52,39.55,4.65,34.47,0.75,29.56,-0.83,24.84,-2.63,29.21,-8.34,32.8,-15.63,36.04,-22.17,39.35,10.51,25.84,7.12,22.27,3.47,19.15,0.6,16.22,-0.44,13.25,-2.15,16.35,-7.38,19.16,-14.03,21.73,-20,24.14,7.68,10.53,5.24,8.39,2.58,6.74,0.53,5.31,-0.13,3.86,-1.84,5.58,-6.67,7.33,-12.76,8.98,-18.25,10.36,6.52,4.23,4.59,2.97,2.45,1.59,0.71,0.46,0,0,-1.91,0.02,-6.57,0.06,-12.31,0.11,-17.51,0.16,12.45,-0.02,8.89,-0.84,5.06,-2.06,1.8,-3.04,-0.02,-3.13,-3.53,-3.35,-9.31,-3.49,-15.34,-3.6,-19.61,-3.72,21.56,-10.42,15.59,-10.53,9.26,-11.01,3.68,-11.27,-0.05,-10.72,-5.95,-11.36,-13.6,-12.05,-20.64,-12.69,-24.7,-13.16,31.94,-23.28,23.25,-22.58,14.12,-22.08,5.89,-21.38,-0.1,-20.1,-8.67,-21.22,-18.46,-22.61,-26.81,-23.93,-30.99,-24.81,41.69,-34.91,30.44,-33.46,18.66,-32.09,7.93,-30.55,-0.15,-28.59,-11.21,-30.14,-23.01,-32.17,-32.52,-34.1,-36.69,-35.35]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[-4.56,-0.09,-3.72,-0.07,-2.45,-0.04,-1.08,-0.01,0,0,0.86,-0.01,2.58,-0.02,4.64,-0.04,6.54,-0.05,-9.59,-0.18,-7.81,-0.14,-5.13,-0.09,-2.29,-0.03,0,0,1.87,-0.01,5.48,-0.04,9.8,-0.08,13.76,-0.1,-13.67,-0.26,-11.18,-0.2,-7.34,-0.12,-3.25,-0.04,0,0,2.54,-0.02,7.71,-0.06,13.92,-0.11,19.61,-0.15,-15.35,-0.29,-12.73,-0.22,-8.34,-0.13,-3.62,-0.05,0,0,2.41,-0.02,8.26,-0.06,15.48,-0.12,22.02,-0.17,-13.67,-0.26,-8.82,-0.18,-4.2,-0.09,-0.89,-0.02,0,0,2.4,0.27,7.63,0.33,14.1,0.18,20.23,-0.14,-9.59,-0.18,-3.1,-0.1,1.14,-0.02,2.42,0.02,0,0,1.69,0.57,5.53,0.73,10.46,0.51,15.41,-0.09,-4.56,-0.09,3.29,0,6.91,0.05,5.93,0.05,0,0,0.46,0.85,2.36,1.13,5.18,0.83,8.39,-0.04,0,0,9.31,0.09,12.42,0.12,9.31,0.09,0,0,-1.12,1.12,-1.5,1.5,-1.12,1.12]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_BALL_KIRAKIRA","timeline":[{"name":"D_EYE_BALL.07","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.08","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.09","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.10","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.11","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_EYE_BALL.12","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_L_OPEN","timeline":[{"name":"D_EYE.01","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[3.05,110.77,4.21,108.19,0.23,107.78,-1.27,93.36,-19.98,70.89,-20.98,38.83,2.9,99.81,-6.12,118.5,-5.37,93.04,-7.75,49.38,3.07,79.83,-6.86,100.94,-8.08,106.09,-6.38,97.55,-16.18,78.14,-11.92,103.52,-4.58,86.76,0.18,107.22,-6.49,103.27,0.68,106.42,-2.8,100.29,8.34,107.54,-6.77,104.64,-2.49,116.57,-2.7,105.53,-2.26,96.43,-15.26,82.09,-2.96,96.26,1.52,50.27,-18.3,58.32,10.76,83.7,9.73,78.46,-11.84,92.24,-11.63,80.72,-8.47,22.07,7.19,78.2,-0.37,88.04,-9.63,67.09,-21.47,52.53,-16.54,72.63,-11.74,45.11,2.1,87.11,-16.31,78.12,-4.28,104.08,-2.34,102.97,-9.56,103.09,-11.32,102.82,1.58,106.05,-11.75,105.12,-2.71,102.37,-5.56,101.84,-2.53,102.3,-7.83,98.55,-11.83,103.97,-4.64,95.78]},{"duration":40,"tweenEasing":0,"value":[1.03,103.6,7.05,138.24,1.5,140.17,-8.67,93.45,-13.43,85.07,-13.16,53,4.91,115.67,-4.12,134.37,-3.37,121.16,-9.78,69.12,1.71,87.97,-0.83,123.9,-4.05,140.01,4.55,109.08,1.73,82.17,-1.17,136.79,-3.59,100.7,2.19,141.78,-1.79,140.65,3.53,123.41,3.92,136.78,3.46,125.83,-0.05,132.11,-0.49,132.43,-1.86,139.36,-6.29,108.92,-5.84,94.9,17.89,108.91,4.63,59.44,-8.8,65.73,12.78,99.56,14.52,77.01,5.31,96.19,-5.33,94.41,-1.41,36.24,17.28,86.98,17.29,95.37,2.82,67.58,-13.9,66.71,-7.8,83.34,-5.68,53.88,2.76,99.76,-9.26,106.87,-0.93,112.22,2.86,128.18,-3.52,135.07,-2.59,141.89,4.26,139.97,-2.35,138.39,1.48,121.14,2.5,135.11,-1.87,138.15,-3.81,122.79,-1.08,140.46,-4.66,112.94]},{"duration":40,"tweenEasing":0,"offset":109},{"offset":2,"value":[-2.52,-3.37,0,0,0,0,0,0,0,0,8.07,-14.5,-1.01,-7.73,0,0,0,-13.53,0,0,-3.03,-6.77,0.64,-12.58,3.03,-3.87,0,0,-5.05,-11.6,0,-4.83,1.68,-4.83,-3.36,-6.77,-1.52,-1.44,5.34,-18.37,1.01,-4.83,5.05,-9.67,6.06,-16.43,-0.67,-5.48,5.05,-4.83,0,0,6.06,-8.7,0,0,0,0,0,0,0,0,3.03,-2.9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.02,-1.93,0,0,0.48,-3.39,-3.03,-5.79,-4.04,-5.8,-0.72,-16.12,0.67,-4.83,-3.41,-11.92,-1.52,-5.31,-3.7,-6.59,0,-8.7,-1.01,-4.83,-4.43,-9.35,-2.02,-2.9]}]},{"name":"D_EYE.03","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[49.79,123.74,8.07,118.58,-26.91,63.16,-12.28,11.76,0,0,0,0,13.46,28.36,29.6,92.8,8.07,58,-2.69,70.89,18.84,95.38,6.73,58]},{"duration":40,"tweenEasing":0,"value":[49.79,123.74,8.07,118.58,-26.91,63.16,-6.73,16.59,0,0,0,0,13.46,28.36,29.6,92.8,8.07,58,-2.69,70.89,18.84,95.38,6.73,58]},{"duration":40,"tweenEasing":0,"offset":23},{"offset":6,"value":[0.03,4.51,0.03,3.87,-2,3.23]}]},{"name":"D_EYE.05","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[2.23,-35.01,18.89,-29,14.59,-0.68,-6.66,1.12,-10.95,-20.83,3.45,-14.9]},{"duration":40,"tweenEasing":0,"offset":11},{"duration":40,"tweenEasing":0,"offset":11},{"value":[0.67,0,0.67,0,0.68,1.28,0.67,0,0.67,0,0.67]}]},{"name":"D_EYE.09","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-11.01,99.57,-20.26,94.16,-22.76,84.33,-18.26,74.46,-14.43,80.21,-11.41,91.45,-17.51,87.58]},{"duration":40,"tweenEasing":0,"value":[-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69,-4.04,105.69]},{"duration":40,"tweenEasing":0,"offset":13},{"value":[4.04,-0.97,2.02,-0.97,0,-1.93,0,-4.83,0,-4.83,0,-4.83,0,-4.83]}]},{"name":"D_EYE.10","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-12.55,99.26,-19.43,94.67,-25.63,88.38,-39.41,81.98,-28.75,82.73,-17.99,92.08]},{"duration":40,"tweenEasing":0,"value":[-4.04,105.69,-2.69,110.2,-4.71,110.2,-8.75,104.4,-2.02,107.62,-4.04,106.98]},{"duration":40,"tweenEasing":0,"offset":11},{"value":[-1.35,-2.02,-2.68,-3.53,-2.95,-6.12,-1.74,-7.68,-1.24,-5.78,-1.09,-3.74]}]},{"name":"D_EYE.11","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-5.05,77.33,0,0,0,0,0,0,0,0,0,0,-1.01,48.33,9.08,141.14,-7.06,147.9,11.1,180.77,-17.16,183.67,5.05,119.87,21.19,175.94,-2.02,34.8,-11.1,109.23,0.42,51.9,0.49,59.92,0,0,-2.59,35.9,-2.55,176.91,-4.69,30.32,0,0,-2.29,35.83,0,0,8.27,157.69,-1.97,27.94,-1.11,19.06,-1.37,36.65]},{"duration":40,"tweenEasing":0,"value":[-5.05,77.33,0,0,0,0,0,0,0,0,0,0,-1.01,48.33,-3.03,141.14,-7.06,147.9,9.08,169.17,-16.15,174.97,5.05,119.87,-3.03,164.34,-2.02,34.8,-15.14,107.3,0.42,51.9,0.49,59.92,0,0,-2.59,35.9,-3.56,169.18,-4.69,30.32,0,0,-2.29,35.83,0,0,1.2,149.96,-1.97,27.94,-1.11,19.06,-1.37,36.65]},{"duration":41,"offset":55}]},{"name":"D_EYE.13","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-3.36,56.31,-25.74,47.13,-17.07,20.54,-11.86,8.62,4.88,-4.03,-4.54,20.22,-9.08,44.95,-9.5,28.76,-13.71,46.64,-4.54,8.7]},{"duration":40,"tweenEasing":0,"value":[0.58,60.48,-21.46,51.1,-13.81,30.44,-9.77,21.28,-4.05,12.34,-1.51,29.46,-1.65,50,-4.74,36.47,-9.23,53.84,-3.6,20.76]},{"duration":40,"tweenEasing":0,"offset":19},{"offset":2,"value":[0.66,-1.29,4.07,4.49,2.72,3.85,2.02,0.63,2.02,0.63,2.02,-0.01,0.67,0,0,0,0.68,0.64]}]},{"name":"D_EYE.17","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[20.45,98.49,22.43,104.67,24.76,112.64,18.51,109.93,17.1,105.8]},{"duration":40,"tweenEasing":0,"value":[15.25,134.19,17.81,144.17,20.74,157.01,11.08,152.18,9.24,145.5]},{"duration":40,"tweenEasing":0,"offset":9},{"value":[1.35,-7.09,1.35,-7.09,1.35,-7.09,1.35,-7.09,1.35,-7.09]}]},{"name":"D_EYE.18","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22,-41.38,66.22]},{"duration":40,"tweenEasing":0,"value":[-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25,-36.84,94.25]},{"duration":41,"offset":15}]},{"name":"D_EYE.19","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58,-15.14,58]},{"duration":40,"tweenEasing":0,"value":[-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35,-15.14,62.35]},{"duration":41,"offset":15}]},{"name":"B_EYE_BALL.08","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":1,"value":[149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84,0,149.84]},{"duration":41,"offset":161}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_EYE_R_OPEN","timeline":[{"name":"D_EYE.00","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-3.94,111.73,-0.37,105.09,12.83,103.17,6.96,100.08,-1.47,67.18,26.02,92,-5.31,129.22,-22.62,81.2,27.39,78.92,-4.76,42.47,-5.86,93.93,-22.9,112.58,-0.92,69.59,6.6,101.23,-8.61,106.26,17.77,97.44,10.26,87.04,-11.36,97.76,1.28,132.72,-17.77,110.34,-8.61,116.1,13.38,99.96,15.63,44.87,8.71,58.39,10.9,84.93,2.84,105.64,-4.86,109.41,-7.51,108.32,-4.21,103.09,-16.86,113.07,-30.78,106.52,12.28,101.81,15.58,98.86,24.74,108.33,-7.15,107.48,-7.02,102.94,-1.47,101.17,25.45,106.32,19.56,99.19,14.84,79.99,4.4,87.53,16.49,100.14,22.23,122.86,-5,101.67,-13.8,108.37,-18.14,118.18,-9.99,93.14,-18.44,102.67,-16,120.96,-12.38,109.96,8.73,105.07,8.61,97.56,12.28,73.2,5.18,44.82,-16.56,63.94,19.42,60.4,15.63,103.6,18.83,99.66,21.9,96.47]},{"duration":40,"tweenEasing":0,"value":[2.66,111.72,0.37,134.92,9.18,114.69,-5.88,96.7,-5.88,72.78,19.4,100.15,-0.92,156.18,-22.35,87.06,27.39,83,-4.77,46.55,-5.87,98.01,-22.91,116.66,-1.19,74.94,10.62,144.46,-2.75,144.92,13.54,109.82,3.64,95.69,-8.43,137.75,1.28,136.79,-16.68,115.94,-8.61,120.15,13.37,104.04,15.62,48.95,8.71,62.47,10.9,89.01,2.84,109.71,-4.31,110.95,-6.05,134.09,2.38,147.17,-9.53,132.74,-6.05,137.55,13.92,129.28,13.73,133.11,5.33,103.76,-0.55,147.49,-1.16,140.24,7.33,139.15,15.03,112.42,6.35,99.37,13.72,92.71,-2.22,91.44,12.27,135.41,22.23,126.94,1.6,147.78,-9.41,134.82,-18.14,122.25,-10.54,97.39,-15.7,109.8,-3.36,144.86,-5.78,143.87,9.46,141.02,8.61,101.63,12.27,77.28,5.18,48.9,-16.56,68.02,19.42,64.48,11.6,141.41,13.13,123.74,16.39,109.19]},{"duration":40,"tweenEasing":0,"offset":117},{"value":[1.47,6.78,-3.66,-8.81,1.47,1.36,0,0,-6.59,-2.03,4.47,-4.08,0,0,-8.06,-3.39,0,0,0,0,-4.03,-9.49,-8.43,-8.14,-6.6,-2.03,2.2,-11.52,-4.4,-11.86,2.2,-6.78,-3.73,-5.41,0,-6.78,0,0,-5.86,-8.81,-8.8,-2.71,0,0,0,0,-2.2,0,-1.1,0,0.37,-0.34,1.1,-3.05,-2.93,-5.42,-2.2,-8.14,-6.96,-13.22,0,0,2.2,-6.1,0.73,-7.46,1.5,4.06,-3.66,-16.27,-1.47,-7.46,1.47,-8.14,-0.03,-5.42,2.2,0,0.73,-2.71,0,0,4.4,-8.14,0,0,-1.47,-13.9,-6.23,-11.86,-4.4,-3.05,-6.23,-4.41,-1.47,-1.36,-1.47,-2.03,-7.33,-11.86,-1.47,-10.85,0,0,-2.2,1.02,0,0,0,0,0,0,5.86,-7.46,4.44,-5.43,5.94,-3.4]}]},{"name":"D_EYE.02","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[25.29,84.4,2.2,104.74,-28.23,74.19,-5.01,10.15,-10.9,-23.69,-2.2,-28.47,10.99,2.03,17.59,40.68,-6.6,19.32,-12.83,38.64]},{"duration":40,"tweenEasing":0,"value":[26.75,93.89,3.66,121.01,-38.79,94.56,-12.37,6.77,-6.43,-10.14,-0.73,-20.34,12.46,2.03,19.06,40.68,-5.13,31.52,-5.5,53.56]},{"duration":40,"tweenEasing":0,"offset":19},{"value":[-5.5,-7.12,-1.1,-13.22,-0.02,-2.03,0,0,1.13,1.01,-8.43,0.68,0,0,-5.5,-8.14,-7.7,-13.22,-3.3,-11.19]}]},{"name":"D_EYE.04","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-21.4,-14.62,-24.11,-28.65,-18.27,-44.95,-4.59,-37.7,-4.95,-20.49,-13.97,-29.3]},{"duration":40,"tweenEasing":0,"value":[-10.7,-7.31,-12.05,-14.32,-5.47,-23.15,-0.46,-15.8,-2.47,-10.25,-6.98,-14.65]},{"duration":40,"tweenEasing":0,"offset":11},{"offset":2,"value":[-1.1,3.05,0,0,0,0,0,0,0,3.05]}]},{"name":"D_EYE.06","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-2.57,85.76,24.92,65.08,-27.12,31.18,-6.96,6.1,31.88,-16.61,30.05,-18.3,7.33,70.5,27.49,124.74,20.16,181.68,0,159.99,7.33,166.09,-11.36,174.9,12.46,114.23,15.03,180.67,-0.37,79.66,5.13,75.59,-2.63,66.47,-0.55,77.91,11.15,71.54,16.68,77,-9.57,99.9]},{"duration":40,"tweenEasing":0,"value":[7.33,70.5,24.92,65.08,-27.12,31.18,-8.06,5.08,35.18,-19.66,47.64,-53.89,7.33,70.5,30.63,119.7,34.41,150.88,5.5,131.18,13.93,158.97,-7.33,184.73,12.46,114.23,13.19,173.21,8.43,90.84,11.73,91.86,1.3,65.05,-15.78,69.07,13.96,63.4,20.61,64.74,-6.21,96.27]},{"duration":41,"offset":41}]},{"name":"D_EYE.07","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[40.33,58.76,45.62,72.58,42.37,86.67,27.34,89.3,29.22,76.13,33.37,63.75,39.01,71.57,36.66,80.63]},{"duration":40,"tweenEasing":0,"value":[21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47,21.26,108.47]},{"duration":40,"tweenEasing":0,"offset":15},{"offset":1,"value":[-4.75,0,-4.75,-3.66,4.07,-0.01,-4.74,0,-4.75,0,-4.75,0,-4.75,0.73,-3.39]}]},{"name":"D_EYE.08","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[65.96,61.69,46.18,76.61,33.35,81.69,26.39,73.89,39.58,73.22,46.18,67.79,41.59,73.89,38.66,78.64,32.98,80.33,33.72,77.96,47.09,71.01,40.31,76.77,51.31,71.18,32.43,77.96,39.42,77.68]},{"duration":40,"tweenEasing":0,"value":[34.45,105.76,21.26,113.21,20.16,108.13,21.26,109.15,21.26,109.15,21.26,109.15,21.8,113.21,21.8,113.21,21.26,106.09,21.26,109.15,23.64,111.69,21.99,111.35,27.12,109.82,20.71,107.11,21.09,112.26]},{"duration":40,"tweenEasing":0,"offset":29},{"offset":1,"value":[-6.78,0,-6.78,0,-6.78,-0.02,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78,0,-6.78]}]},{"name":"D_EYE.12","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[13.01,40.22,8.8,54.55,11.73,31.36,10.08,2.71,-8.25,-12.14,12.46,5.66,15.39,22.65,10.99,38.62,9.35,13.55,13.93,26.91,5.86,0.96,10.26,39.89]},{"duration":40,"tweenEasing":0,"value":[10.26,45.3,8.8,63.71,11.73,40.51,11.73,18.98,8.8,14.3,12.46,14.81,15.39,31.8,10.99,47.78,13.19,27.78,13.93,36.06,14.66,19.27,10.26,49.04]},{"duration":40,"tweenEasing":0,"offset":23},{"value":[-6.6,0.68,-5.86,-0.68,-3.66,0,-2.93,-7.46,-5.13,-4.75,-5.13,-5.42,-3.66,0,-2.2,0,-2.93,-3.39,-0.73,0.68,-2.2,-2.71,-5.86,-0.68]}]},{"name":"D_EYE.14","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-40.61,126.07,-31.45,102.69,-20.14,80.58,-2.5,105.34,-14.88,120.74,-16.18,104.09,-22.24,112.72,-9.74,95.17]},{"duration":40,"tweenEasing":0,"value":[-36.21,166.75,-27.05,143.36,-15.74,121.26,1.9,146.02,-10.48,161.41,-11.79,144.76,-17.84,153.39,-5.35,135.85]},{"duration":40,"tweenEasing":0,"offset":15},{"value":[-10.26,-0.68,-4.4,-6.1,-13.93,-14.24,-8.06,-14.91,-4.4,-6.1,-7.33,-11.52,-4.4,-6.1,-10.26,-13.56]}]},{"name":"D_EYE.15","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2,24.74,72.2]},{"duration":40,"tweenEasing":0,"value":[16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57,16.49,94.57]},{"duration":40,"tweenEasing":0,"offset":15},{"value":[-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08,-1.1,-5.08]}]},{"name":"D_EYE.16","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-1.47,17.55,9.18,24.97,12.76,34.06,-0.27,32.77,4.66,28.7]},{"duration":40,"tweenEasing":0,"value":[-1.47,17.55,9.18,24.97,12.76,34.06,-0.27,32.77,4.66,28.7]},{"duration":40,"tweenEasing":0,"offset":9},{"value":[-2.2,-2.03,-2.2,-2.03,-2.2,-2.03,-2.2,-2.03,-2.2,-2.03]}]},{"name":"B_EYE_BALL.02","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":1,"value":[127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83]},{"duration":40,"tweenEasing":0,"offset":1,"value":[127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83,0,127.83]},{"duration":41,"offset":161}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ANGLE_Z","timeline":[{"name":"B_FACE.02","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-9.7},{"duration":60,"tweenEasing":0},{"x":10.7}]},{"name":"B_HAIR_SIDE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.47,-0.01,-0.86,-0.01,-0.77,-0.01,-0.61,0,-0.44,0,-0.54,0,-0.3,0,0,0,0,0,-4,-0.07,-7.7,-0.13,-8.5,-0.14,-7.05,-0.04,-5.6,0.05,-4.87,0.05,-2.53,0.03,0,0,0,0,-7.51,-0.13,-14.5,-0.25,-16.24,-0.26,-13.5,-0.08,-10.77,0.09,-9.2,0.1,-4.77,0.05,0,0,-1.89,-0.03,-13.33,-0.03,-24.15,-0.04,-27.34,-0.04,-23.65,-0.09,-19.95,-0.14,-18.92,-0.14,-15.94,-0.08,-12.58,0.06,-9.28,-0.16,-20.95,0.04,-31.89,0.23,-35.17,0.2,-35.11,-0.67,-35.05,-1.55,-34.09,-1.5,-30.26,-0.97,-26.04,-0.36,-17.28,-0.29,-28.55,0.12,-38.97,0.5,-42.02,0.43,-46.19,-1.33,-50.36,-3.09,-49.45,-2.99,-44.33,-1.97,-38.79,-0.85]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":54,"value":[0.83,-0.02,0.71,-0.04,0.6,-0.04,0.53,-0.04,0.61,-0.02,0.68,-0.01,0.79,0,0.65,-0.01,0.45,-0.03,9.69,-0.28,8.62,-0.39,7.63,-0.5,7.08,-0.5,7.64,-0.29,8.19,-0.07,8.22,-0.08,6.87,-0.22,5.27,-0.37,18.54,-0.53,16.53,-0.74,14.66,-0.95,14.19,-0.96,16.97,-0.54,19.75,-0.11,19.07,-0.14,14.79,-0.42,10.09,-0.72,24.57,-0.32,20.6,-0.48,16.8,-0.79,15.98,-0.82,22.88,-0.06,29.78,0.7,28.96,0.61,22.34,0.07,15.18,-0.28,24.41,-0.92,20.93,-0.56,17.63,-0.33,17.29,-0.22,25.98,0.4,34.68,1.02,33.63,1.06,25.8,1.05,17.34,1.19,23.19,-1.64,20.63,-0.7,18.27,0.16,18.62,0.42,28.8,0.83,38.98,1.23,37.63,1.43,28.62,2.07,18.86,2.76]}]},{"name":"B_HAIR_SIDE.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-0.2,-0.01,-0.43,-0.03,-0.61,-0.04,-0.7,-0.04,-0.61,-0.04,-0.43,-0.03,-0.2,-0.01,0,0,0,0,-0.43,-0.02,-0.89,-0.05,-1.28,-0.08,-1.48,-0.09,-1.28,-0.08,-0.89,-0.05,-0.43,-0.02,0,0,0,0,-0.61,-0.03,-1.28,-0.08,-1.83,-0.11,-2.11,-0.13,-1.83,-0.11,-1.28,-0.08,-0.61,-0.03,0,0,0,0,-0.7,-0.04,-1.48,-0.09,-2.11,-0.13,-2.37,-0.14,-2.11,-0.13,-1.48,-0.09,-0.7,-0.04,0,0,-0.52,-0.03,-8.11,-0.3,-14.2,-0.66,-17.65,-0.95,-17.35,-1.06,-16,-0.87,-13.56,-0.42,-10.68,0.07,-8.01,0.43,-1.78,-0.11,-15.38,-0.58,-25.94,-1.18,-31.45,-1.67,-29.9,-1.85,-27.55,-1.56,-23.37,-0.9,-18.47,-0.13,-13.92,0.44,-3.33,-0.2,-22.22,-0.84,-36.47,-1.6,-43.15,-2.22,-39.33,-2.42,-36.54,-2.1,-31.2,-1.34,-24.84,-0.44,-18.99,0.3,-4.73,-0.28,-28.42,-1.06,-45.67,-1.88,-52.51,-2.5,-44.98,-2.68,-42.74,-2.36,-37.29,-1.59,-30.57,-0.63,-24.48,0.24]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.41,-0.03,0.85,-0.06,1.22,-0.08,1.4,-0.09,1.96,-0.13,1.51,-0.1,0.65,-0.04,0,0,0,0,0.85,-0.05,1.77,-0.12,2.55,-0.17,2.95,-0.19,4.03,-0.27,3.09,-0.2,1.34,-0.08,0,0,0,0,1.22,-0.08,2.55,-0.17,3.65,-0.24,4.2,-0.28,5.88,-0.39,4.53,-0.3,1.96,-0.12,0,0,0,0,1.4,-0.09,2.95,-0.19,4.2,-0.28,4.72,-0.31,7.19,-0.47,5.6,-0.37,2.4,-0.16,0,0,5.05,-0.33,8.29,-0.28,11.76,-0.07,14.77,0.15,16.63,0.25,16.8,0.02,12.69,-0.14,6.87,-0.19,1.91,-0.13,9.73,-0.64,14.57,-0.53,19.71,-0.23,24.23,0.09,27.17,0.24,25.05,0.04,18.45,-0.15,10.05,-0.25,2.54,-0.17,14.27,-0.94,19.71,-0.87,25.55,-0.65,30.6,-0.42,33.68,-0.31,30.02,-0.38,21.61,-0.39,11.28,-0.32,1.91,-0.13,18.88,-1.24,23.21,-1.28,28.01,-1.31,31.89,-1.34,33.48,-1.35,29.82,-1.21,20.93,-0.85,9.94,-0.4]}]},{"name":"B_HAIR_TWIN.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[1.34,-0.12,2.83,-0.26,4.03,-0.36,4.53,-0.41,4.03,-0.36,2.83,-0.26,1.34,-0.12,0,0,-2.31,-0.35,-1.25,-0.43,-0.09,-0.52,0.86,-0.58,1.28,-0.6,-0.36,-0.56,-1.19,-0.4,-1.11,-0.2,0,0,-4.73,-0.8,-3.93,-0.83,-3.06,-0.85,-2.33,-0.85,-1.96,-0.84,-4.73,-0.8,-5.2,-0.58,-3.56,-0.28,0,0,-6.93,-1.06,-6.45,-1.06,-5.93,-1.03,-5.49,-1,-5.23,-0.98,-9.13,-0.95,-9.23,-0.7,-6.02,-0.34,0,0,-8.57,-0.86,-8.57,-0.86,-8.57,-0.86,-8.57,-0.86,-8.57,-0.86,-13.59,-0.88,-13.3,-0.69,-8.5,-0.37,0,0,-14.9,-1.04,-17.51,-1.14,-20.42,-1.31,-22.71,-1.47,-23.45,-1.54,-26.1,-1.53,-23.73,-1.33,-17.53,-1.05,-8.73,-0.78,-16.25,-0.98,-22.09,-1.14,-28.55,-1.39,-33.78,-1.63,-35.92,-1.73,-36.42,-1.72,-32.22,-1.59,-24.93,-1.42,-16.16,-1.3,-15.6,-0.84,-24.69,-1.01,-34.69,-1.26,-42.86,-1.48,-46.44,-1.58,-45.1,-1.61,-39.43,-1.62,-31.42,-1.65,-23.07,-1.71,-15.95,-0.74,-27.69,-0.89,-40.66,-1.06,-51.16,-1.2,-55.49,-1.25,-52.72,-1.35,-46.02,-1.6,-37.73,-1.9,-30.23,-2.17]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.33,-0.03,0.68,-0.08,0.98,-0.11,1.13,-0.13,1.22,-0.09,1.39,-0.02,1.6,0.07,1.8,0.14,0,0,0.68,-0.07,1.42,-0.16,2.05,-0.23,2.37,-0.26,2.57,-0.2,2.94,-0.04,3.38,0.15,3.78,0.3,0,0,0.98,-0.1,2.05,-0.23,2.94,-0.33,3.38,-0.38,3.65,-0.28,4.17,-0.06,4.81,0.21,5.39,0.43,0,0,1.13,-0.13,2.37,-0.26,3.38,-0.38,3.8,-0.42,4.04,-0.32,4.64,-0.08,5.38,0.21,6.05,0.48,2.12,0.01,4.4,-0.03,6.98,-0.21,8.97,-0.4,9.5,-0.49,9.44,-0.35,8.8,-0.03,7.94,0.35,7.19,0.67,5.05,-0.34,9.06,-0.17,13.53,-0.1,17.07,-0.08,18.28,-0.08,17.54,0.06,15.31,0.39,12.48,0.79,9.95,1.13,8.3,-0.84,14.26,-0.4,20.87,0.04,26.19,0.38,28.29,0.51,26.72,0.65,22.75,0.97,17.81,1.36,13.36,1.7,11.39,-1.26,19.19,-0.59,27.82,0.16,34.8,0.77,37.68,1.01,35.36,1.15,29.71,1.47,22.75,1.86,16.44,2.22]}]},{"name":"B_HAIR_TWIN.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[3.62,0.34,7.63,0.72,10.87,1.02,12.21,1.15,10.87,1.02,7.63,0.72,3.62,0.34,0,0,0,0,0.05,-0.14,1.23,0.03,2.99,0.42,4.81,0.96,2.73,0.91,-0.03,0.99,-2.62,1.17,-4.17,1.4,0,0,-3.67,-0.62,-5.5,-0.66,-5.43,-0.18,-3.38,0.76,-6.12,0.79,-8.33,1.33,-9.4,2.12,-8.77,2.96,0,0,-7.01,-1.09,-11.45,-1.33,-12.67,-0.75,-10,0.6,-13.59,0.67,-15.4,1.53,-15.14,2.83,-12.5,4.21,0,0,-9.52,-1.58,-15.66,-2,-17.16,-1.28,-12.73,0.53,-17.54,0.51,-19.37,1.43,-18.21,2.94,-14.04,4.73,-7,-1.1,-17.3,-4.12,-26.02,-5.67,-30.71,-5.76,-28.93,-4.39,-31.31,-3.62,-30.5,-1.2,-27.03,1.65,-21.43,3.74,-10.38,-2.6,-21.3,-6.5,-32.39,-7.94,-40.06,-7.58,-40.66,-6.08,-40.99,-5.19,-37.93,-2.75,-32.57,-0.04,-26.04,1.66,-11.24,-4.34,-22.71,-8.66,-36.13,-8.99,-46.7,-7.18,-49.63,-5.09,-48.3,-4.55,-43.37,-3.16,-36.55,-1.68,-29.53,-0.86,-10.64,-6.19,-22.74,-10.57,-38.57,-9.01,-52.16,-4.98,-57.51,-1.95,-54.89,-2.08,-48.54,-2.4,-40.68,-2.8,-33.58,-3.16]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[2.16,-0.05,2.13,-0.14,2.1,-0.25,2.07,-0.35,2.05,-0.38,1.73,-0.33,1.17,-0.22,0.54,-0.1,0,0,4.56,-0.11,4.49,-0.3,4.41,-0.53,4.35,-0.73,4.32,-0.81,3.62,-0.7,2.45,-0.47,1.14,-0.2,0,0,6.49,-0.16,6.4,-0.43,6.29,-0.76,6.2,-1.04,6.15,-1.15,5.18,-1,3.51,-0.67,1.62,-0.3,0,0,7.29,-0.18,7.18,-0.51,7.05,-0.88,6.95,-1.17,6.91,-1.3,5.95,-1.13,4.04,-0.77,1.84,-0.36,0,0,15.33,0.09,16.28,-1.61,16.77,-1.97,16.86,-1.68,16.63,-1.43,15.85,-1.25,13.39,-0.87,10.32,-0.46,7.71,-0.18,20.11,0.44,22.55,-2.53,24.09,-2.64,24.81,-1.51,24.81,-0.77,24.25,-0.68,21.23,-0.5,17.28,-0.32,13.9,-0.22,23.58,0.81,27.69,-3.38,30.45,-3.14,31.98,-1.07,32.39,0.2,31.42,0.17,27.25,0.1,21.83,-0.01,17.09,-0.12,27.71,1.16,33.4,-4.27,37.3,-3.72,39.55,-0.76,40.27,1.02,37.59,0.91,31.09,0.67,23.06,0.37,15.79,0.09]}]},{"name":"B_NECK.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-9.33,-34.67,-6.96,-33.08,-4.33,-31.33,-2.21,-29.92,-1.33,-29.33,-1.04,-28.17,-0.33,-25.33,0.54,-21.83,1.33,-18.67,-6.94,-26.83,-5.15,-25.71,-3.18,-24.47,-1.59,-23.44,-0.94,-22.94,-0.49,-22.18,0.56,-20.14,1.77,-17.58,2.71,-15.27,-4.5,-19.33,-3.31,-18.57,-1.99,-17.75,-0.94,-17.01,-0.5,-16.5,0,-15.83,1.16,-14.23,2.49,-12.26,3.49,-10.46,-2.15,-11.17,-1.55,-10.95,-0.89,-10.74,-0.36,-10.49,-0.15,-10.15,0.3,-9.56,1.35,-8.41,2.57,-7.03,3.52,-5.75,0,-1.33,0,-2.13,0,-3,0,-3.71,0,-4,0.29,-3.85,1,-3.5,1.88,-3.06,2.67,-2.67,0,-1.19,0.18,-1.14,0.56,-1.09,0.95,-1.05,1.13,-1,1.32,-0.77,1.81,-0.06,2.45,0.83,3.08,1.63,0,-0.83,0.16,0,0.5,0.92,0.84,1.67,1,2,1.17,2.43,1.58,3.58,2.13,5.03,2.67,6.33,0,-0.4,0.06,1.2,0.19,2.97,0.32,4.4,0.38,5,0.54,5.66,0.94,7.31,1.44,9.36,1.92,11.21,0,0,0,2.38,0,5,0,7.12,0,8,0.15,8.88,0.5,11,0.94,13.62,1.33,16]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[10.67,20,7.9,20,4.83,20,2.35,20,1.33,20,0.9,20.58,-0.17,22,-1.48,23.75,-2.67,25.33,9.88,16.83,7.24,16.4,4.37,15.92,2.07,15.54,1.13,15.42,0.4,16.11,-1.34,17.44,-3.43,19.03,-5.23,20.48,9,13.33,6.52,12.5,3.91,11.58,1.84,10.87,1,10.67,-0.08,11.66,-2.64,13.08,-5.68,14.66,-8.17,16.17,8.29,10.5,5.93,9.2,3.45,7.75,1.5,6.61,0.71,6.25,-0.59,7.2,-3.67,8.34,-7.33,9.57,-10.35,10.77,8,9.33,5.63,7.35,3,5.17,0.88,3.4,0,2.67,-1.17,2.67,-4,2.67,-7.5,2.67,-10.67,2.67,11.56,2.32,8.49,1.89,4.81,1.22,1.73,0.97,0.44,1.79,-0.68,1.84,-3.37,1.67,-6.6,1.41,-9.35,1.21,13.83,-1.91,10.4,-1.8,6.33,-1.92,2.93,-1.64,1.5,-0.33,0.62,-0.46,-1.5,-1,-4.03,-1.71,-6.17,-2.33,15.19,-2.85,11.63,-3.15,7.56,-3.65,4.2,-3.77,2.81,-2.96,2.24,-3.34,0.88,-4.33,-0.78,-5.58,-2.23,-6.71,16,0,12.44,-1.58,8.5,-3.33,5.31,-4.75,4,-5.33,3.71,-5.92,3,-7.33,2.13,-9.08,1.33,-10.67]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_TERE","timeline":[{"name":"D_HOHO.00","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_HOHO.00","type":22,"frame":[{"duration":120,"tweenEasing":0,"offset":6,"value":[-4.6,0,-3.68,-1.57,0,0,0,0,0,0,0,0,-3.68]},{"offset":6,"value":[3.07,0,2.45,1.05,0,0,0,0,0,0,0,0,2.45]}]},{"name":"D_HOHO.01","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_HOHO.01","type":22,"frame":[{"duration":120,"tweenEasing":0,"value":[2.42,4.92,0,3.94]},{"value":[-1.61,-3.28,0,-2.63]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_DONYORI","timeline":[{"name":"D_FACESHADOW.01","type":24,"frame":[{"duration":120,"tweenEasing":0,"value":0},{}]},{"name":"D_FACESHADOW.01","type":22,"frame":[{"duration":120,"tweenEasing":0,"offset":47},{"value":[-10.07,35.25,-15.69,12.95,6.38,26.71,22.77,159.17,-14.6,94.19,-9.86,161.55,-1.89,47.22,-11.86,61.32,-24.28,90.28,8.14,53.36,4.08,83.23,-6.75,40.11,3.24,34.51,-14.04,75.34,-7.4,55.02,-7.14,28.35,6.95,74.36,4.19,50.93,3.09,22.19,-4.95,89.08,11.9,121.61,-12.84,75.47,-4.23,96.95,-1.88,86.44]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_KAMIYURE_FRONT","timeline":[{"name":"B_FACESHADOW.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":56,"value":[-0.13,0,-0.25,0,-0.14,0,-0.46,0,-0.79,0,0.34,0,0.82,0,-0.23,0,0,0,-1.15,0,-2.21,0,-2.68,0,-5.47,0,-8.26,0,-3.41,0,-0.23,0,-3.3,0,0,0,-2.16,0,-4.16,0,-5.32,0,-10.83,0,-16.34,0,-8.38,0.01,-3.31,0.01,-9.17,0,-0.36,-1,-3.6,-0.69,-6.54,-0.16,-7.61,0.01,-12.83,0.13,-18.04,0.25,-10.69,0.26,-6.43,0.22,-13.65,0.13,-1.77,-0.63,-7.89,-0.43,-13.51,-0.1,-15.08,0.06,-17.77,0.64,-20.47,1.23,-12.81,1.22,-7.48,0.96,-12.87,0.65,-3.3,0,-12.48,0,-20.96,0,-23.13,0.1,-23.13,1.19,-23.13,2.28,-14.92,2.26,-8.24,1.76,-11.56,1.2]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[1.37,0,2.64,0,2.88,0,1.53,0,0.18,0,0,0,0,0,0,0,0,0,2.65,0,5.12,0,5.55,0,2.94,0,0.33,0,0,0,0,0,0,0,0.5,0,3.87,-0.08,7.02,-0.1,7.55,-0.1,4.31,-0.05,1.07,0,0.74,0,0.4,0,0,0,5.78,0,8.93,-0.55,11.87,-1.06,12.47,-1.14,10.12,-0.6,7.77,-0.05,6.62,0,3.44,0,0,0,11.07,0,13.46,-1.03,15.66,-2.02,16.16,-2.18,15.23,-1.14,14.29,-0.1,12.48,0,6.47,0,0,0,13.01,0,10.36,-1.01,12.58,-1.93,16.42,-2.04,15.87,-1.19,15.32,-0.34,13.64,-0.25,7.1,-0.17,0,0,18.66,0,7.33,-0.67,8.4,-1.12,16.5,-1.11,16.58,-1.19,16.66,-1.27,14.87,-1.15,7.73,-0.62,0,0,24.78,0,4.73,-0.29,4.44,-0.23,16.59,-0.1,17.34,-1.19,18.1,-2.28,16.18,-2.12,8.41,-1.1]}]},{"name":"B_HAIR_FRONT.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":18,"value":[-0.14,0,-0.4,0,-0.68,0,-0.92,0,-1.03,0,-1.02,0,-0.98,0,-0.94,0,-0.9,0,-0.29,0,-0.83,0,-1.42,0,-1.92,0,-2.18,0,-2.14,0,-2.06,0,-1.97,0,-1.89,0.01,-0.41,0,-1.19,0,-2.04,0,-2.74,0,-3.1,0,-3.05,0,-2.94,0,-2.81,0.01,-2.69,0.01,-0.46,0,-1.36,0,-2.35,0,-3.15,0,-3.48,0,-3.43,0,-3.31,0.01,-3.16,0.01,-3.02,0.01,-2.95,0,-4.2,0,-5.62,0,-6.71,0,-6.97,0.01,-7.23,0.01,-7.21,0.01,-7.08,0.01,-7.01,0.02,-5.82,0,-7.78,0,-9.99,0,-11.71,0.01,-12.25,0.01,-12.22,0.01,-11.71,0.01,-11,0.01,-10.39,0.01,-8.84,-0.01,-11.65,0,-14.78,0.01,-17.28,0.01,-18.25,0.01,-17.77,0.01,-16.61,0.01,-15.17,0.01,-13.86,0.01,-11.79,-0.01,-15.38,0,-19.35,0.01,-22.56,0.01,-23.88,0.02,-23.26,0.02,-21.73,0.02,-19.84,0.02,-18.14,0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[0.28,0.04,0.59,0.12,0.84,0.2,0.91,0.24,0.84,0.2,0.59,0.12,0.28,0.04,0,0,0,0,0.52,0.1,1.12,0.32,1.57,0.55,1.68,0.65,1.57,0.55,1.12,0.32,0.52,0.1,0,0,0,0,0.84,0.11,1.78,0.36,2.51,0.61,2.72,0.73,2.52,0.61,1.78,0.36,0.84,0.11,0,0,0,0,1.33,0,2.8,0,3.98,0,4.47,0,3.98,0,2.8,0,1.33,0,0,0,1.61,0,3.85,0,6.26,0,8.34,0,9.58,-0.01,8.36,-0.01,6.11,-0.05,3.45,-0.1,0.99,-0.19,5.52,0,7.93,0,10.52,0,12.74,-0.01,13.99,-0.01,12.58,-0.07,9.8,-0.23,6.46,-0.43,3.4,-0.66,10.35,0.01,12.62,0,15.1,0,17.15,-0.01,18.12,-0.01,16.74,-0.14,13.63,-0.46,9.83,-0.86,6.37,-1.23,14.72,0.01,17,0,19.51,0,21.55,-0.01,22.39,-0.01,20.93,-0.2,17.39,-0.67,13.02,-1.23,9.06,-1.75]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ANGLE_Y","timeline":[{"name":"B_FACESHADOW.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_FACE.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.05","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.06","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_MOUTH.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NOSE.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_FRONT.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_SIDE.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.07","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.16","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.17","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.18","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.19","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.20","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.21","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.11","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.08","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.09","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.11","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.12","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.13","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.14","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.05","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.06","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.07","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.08","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.09","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_BACK.02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_BACK.00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NECK.03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ANGLE_X","timeline":[{"name":"D_REF.MOUTH","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[6.11,-40.48,6.11,-40.48,6.11,-40.48,6.11,-40.48]},{"duration":30,"tweenEasing":0,"value":[6.11,-40.48,6.11,-40.48,6.11,-40.48,6.11,-40.48]},{"duration":30,"tweenEasing":0,"offset":7},{"value":[3.87,49.92,3.87,49.92,3.87,49.92,3.87,49.92]}]},{"name":"B_FACESHADOW.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HOHO.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HOHO.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_FACE.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EYE.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EYE.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_BROW.05","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_BROW.06","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_MOUTH.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_NOSE.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_NOSE.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_NOSE.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EAR.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_EAR.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_FRONT.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_SIDE.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_SIDE.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_SIDE.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_SIDE.01","type":23,"frame":[{"duration":90,"value":540},{"duration":30,"value":540},{"value":490}]},{"name":"D_HAIR_SIDE.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":119},{"duration":30,"tweenEasing":0,"offset":119},{"duration":30,"tweenEasing":0,"offset":6,"value":[7.05,-0.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19.12,0.05,13.67,0.02,7.08,0.94,0,0,0,0,0,0,19.41,-1.36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10.51,0.48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21.2,0.49,12.29,-0.44]},{"offset":26,"value":[13.68,0.89,0,0,0,0,0,0,0,0,0,0,28.36,2.69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13.67,0.89,0,0,7.65,-0.01,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7.44,0.43,0,0,0,0,0,0,7.78,0.44,32.44,-0.02]}]},{"name":"B_HAIR_TWIN.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.07","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.16","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.17","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.18","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.19","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.20","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.21","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.11","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.12","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[20.33,-1.95,3.06,-0.53,1.05,-0.55,1.07,-0.55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.31,0.06,7.97,1.83,0,0,0,0,0,0,0,0,4.55,0.07]},{"duration":91,"offset":47}]},{"name":"D_HAIR_TWIN.14","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[16.02,-3.03,6.29,-2.59,2.3,0.56,2.34,0.67,15.57,-1.54,16.14,0.1,6.09,0.55,0,0,1.43,2.53,0,0,0,0,-1.2,-1.03,-7.25,-1.57,-3.65,-0.54,-6.01,-0.04,8.63,-0.59,12.95,-2.67,-5.77,0.51]},{"duration":30,"tweenEasing":0,"value":[22.54,-2.54,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12.43,-0.43]},{"duration":30,"tweenEasing":0,"offset":37},{"duration":30,"tweenEasing":0,"offset":10,"value":[4.66,-0.98,3.79,-0.27,0,0,0,0,0,0,0,0,0,0,-2.52,-0.74,-7.77,-0.35,-4.74,0.39,0,0,0,0,-5.74,-0.09]},{"offset":10,"value":[9.32,-1.97,7.58,-0.55,0,0,0,0,0,0,0,0,0,0,-5.04,-1.47,-15.54,-0.7,-9.49,0.77,0,0,0,0,-11.48,-0.18]}]},{"name":"D_HAIR_TWIN.15","type":22,"frame":[{"duration":30,"tweenEasing":0,"value":[34.23,-2.89,19.05,0.38,13.14,-1.55,5.27,0.71,0,0,-10.6,-0.03,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-8.91,0.67,0,0,7.85,-3.72,8.26,-5.59,12.58,0.37,0,0,-4.67,1.36,0,0,0,0,7.58,-1.02,2.77,-0.92]},{"duration":30,"tweenEasing":0,"value":[9.77,-3.59,4.86,-1.61,3.13,-2.08,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12.84,-4.08]},{"duration":30,"tweenEasing":0,"offset":61},{"duration":30,"tweenEasing":0,"value":[-3.24,0.61,-3.12,0.18,-2.12,-0.05,-0.57,-0.07,1.59,-0.04,3.88,0.08,5.56,0.15,7.22,0.02,8.16,-0.16,7.89,-0.54,8.59,-0.02,8.53,0.3,7.16,0.63,5.75,0.66,4.36,0.55,2.09,0.3,-0.49,0.31,-2.07,0.59,-2.23,0.31,0.7,0.11,3.32,0.23,5.18,0.38,6.54,0.36,-1.54,0.11,-0.55,0.11,1.87,0.13,4.58,0.25,6.16,0.37,7.79,0.21,7.11,0.27,8.36,0.01]},{"value":[-6.49,1.23,-6.24,0.36,-4.24,-0.1,-1.14,-0.14,3.19,-0.08,-4.22,-0.62,3.87,0.25,14.43,0.03,16.32,-0.31,15.78,-1.08,17.19,-0.05,17.05,0.6,14.33,1.27,11.5,1.31,-0.8,1.17,4.18,0.61,-0.98,0.61,-4.13,1.18,-4.45,0.62,1.41,0.22,6.64,0.45,0.76,0.64,13.08,0.72,-3.07,0.23,-1.11,0.22,3.74,0.26,5.34,0.46,10.57,0.71,15.57,0.41,14.21,0.55,16.73,0.03]}]},{"name":"B_HAIR_TWIN.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.08","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.09","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.11","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.12","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.13","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_TWIN.14","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.01","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.05","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.06","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.07","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.08","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.09","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAIR_BACK.02","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_BACK.00","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_NECK.03","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_NECK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[1.69,21.02,0,0,-25.39,-23.35,-23.69,-32.69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.77,-1.17]},{"duration":60,"tweenEasing":0,"offset":27},{"value":[5.08,-19.85,10.15,-17.51,0,0,-8.46,19.85,5.08,0,5.08,0,0,0,0,0,0,0,0,0,5.08,-1.17,0,0,0,0,5.08,-2.34]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BODY_Z","timeline":[{"name":"D_REF.BODY","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BODY.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-8.92,2.89,-15.78,3.25,-19.9,3.46,-18.53,5.77,-17.16,8.08,-14.07,8.37,-10.98,8.66,-6.86,5.41,0,0,-5.92,3.25,-12.01,4.04,-15.7,4.55,-15.14,6.85,-14.58,9.16,-14.71,9.09,-14.84,9.02,-9.19,5.64,0,0,-4.12,3.46,-9.27,4.55,-12.35,5.2,-12.7,7.5,-13.04,9.81,-15.1,9.52,-17.16,9.24,-10.72,5.77,0,0,-2.4,7.79,-6.31,7.9,-9.27,7.79,-10.55,7.72,-10.81,7.65,-13.13,7.29,-15.44,6.93,-9.65,4.33,0,0,-0.69,12.12,-3.35,11.26,-6.18,10.39,-7.89,7.5,-7.55,4.62,-10.64,4.62,-13.73,4.62,-8.58,2.89,0,0,-0.34,10.68,-1.8,8.02,-3.6,6.06,-4.72,4.51,-4.8,2.96,-9.44,2.63,-14.07,2.31,-8.79,1.44,0,0,0,9.24,1.29,5.63,2.06,3.46,1.03,1.73,0,0,-7.21,0,-14.41,0,-9.01,0,0,0,0,5.77,0.77,3.61,1.29,2.16,0.64,1.08,0,0,-4.5,0,-9.01,0,-5.42]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":2,"value":[2.14,3.25,3.43,5.2,5.83,7.22,8.24,9.24,7.21,5.48,6.18,1.73,3.86,1.08,0,0,4.29,6.49,7.21,8.23,9.01,9.16,10.55,9.2,12.1,9.24,9.65,5.16,7.21,1.08,4.5,0.87,0,0,6.86,10.39,10.29,11.11,12.35,11.54,12.35,10.39,12.35,9.24,10.29,6.35,8.24,3.46,5.15,2.16,0,0,3.43,4.91,9.72,7.29,12.01,8.66,10.72,7.65,9.44,7.5,8.7,8.29,7.21,7.79,4.5,4.87,0,0,0,-0.58,9.14,3.47,11.67,5.77,8.58,4.91,5.49,5.77,6.61,10.25,6.18,12.12,3.86,7.58,0,0,-0.34,-0.58,7.23,0.65,10.29,1.37,6.52,1.7,2.75,2.89,3.32,6.21,3.13,8.23,1.95,4.87,0,0,-0.69,-0.58,5.32,-2.38,8.92,-3.46,4.46,-1.73,0,0,0,0,0,0,0,0,0,0,-0.43,-0.36,3.18,-1.45,5.58,-2.16,2.79,-1.08]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BODY_Y","timeline":[{"name":"D_REF.BODY","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.13","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.10","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BODY.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":19,"value":[3.57,0,5.17,0,6.24,-0.17,8.62,-0.34,10.99,0.08,8.84,0.51,6.69,0.3,4.01,0,0,0,5.71,0,8.38,0,9.98,-0.27,13.79,-0.54,17.59,0.14,14.14,0.81,10.7,0.51,6.69,0,0,-0.87,8.61,-1.74,12.44,0.2,14.96,1.44,17.82,-0.57,20.41,-0.09,17.98,2.7,14.5,2.68,8.39,0,0,-1.74,11.52,-3.8,17.09,-0.27,21.16,2.03,19.4,-2.16,17.12,-1.11,16.62,4.59,14.03,4.84,7.94,0,0,-0.87,5.76,1.4,12.12,5.11,16.76,3.28,18.98,-1.49,18.54,-1.35,17.92,0.29,14.6,1.38,8.38,0,0,0,0,5.59,7.93,8.46,13.96,3.57,19.4,-0.81,19.97,-0.15,16.44,-1.08,9.51,-0.68,5.94,0,0,0,0,3.33,4.84,5.29,8.73,2.27,11.81,-0.51,12.48,-0.19,10.06,-0.68,5.94,-0.41,3.57]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[8.1,-0.71,6.08,-1.6,4.86,-2.14,2.43,-1.07,0,0,0.41,1.07,0.81,2.14,0.51,1.34,0,0,6.58,-1.16,4.56,-2.45,3.44,-3.48,1.46,-2.53,-0.52,-1.06,-1.22,-1.95,-1.92,-1.78,-1.17,-0.8,0,0,5.67,-1.43,3.14,-1.87,1.62,-2.14,0.41,-4.46,-0.81,-5.71,-2.43,-4.28,-4.05,-0.71,-2.53,-0.45,0,0,4.46,-1.78,1.85,-4.95,0.69,-8.12,0.44,-7.94,-0.41,-7.49,-1.3,-7.12,-2.79,-5.7,-1.6,-3.39,0,0,3.24,-2.14,-0.1,-3.83,-1.62,-5.71,-0.2,-7.22,0,-9.27,1.01,-8.56,0.81,-7.84,0.51,-4.9,0,0,3.24,-3.21,0.3,-4.5,-1.22,-5.71,-2.08,-6.99,0,-7.13,3.03,-7.68,1.22,-6.06,0.76,-3.79,0,0,3.24,-4.28,0.71,-5.17,-0.81,-5.71,-3.96,-6.76,0,-4.99,5.05,-6.8,1.62,-4.28,1.01,-2.67,0,0,2.03,-2.67,0.51,-3.21,-0.51,-3.57,-2.03,-4.05,0,-3.12,2.63,-3.98,1.01,-2.67,0.61,-1.6]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_R_02","timeline":[{"name":"B_CLOTHES.38","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.39","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.63","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.62","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.17","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.16","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.17","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_02_R_01","timeline":[{"name":"B_CLOTHES.38","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.39","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.63","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.62","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_HAND.17","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.16","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.17","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_R","timeline":[{"name":"B_CLOTHES.17","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":56,"value":[-0.21,0.09,-0.38,0.11,-0.36,0.11,-0.16,0.06,0.04,0.01,0,0,0,0,0,0,0,0,-1.76,0.63,-3.39,1.21,-3.64,1.3,-1.9,0.68,-0.16,0.06,0,0,0,0,0,0,0,0,-3.32,1.17,-6.41,2.31,-6.92,2.49,-3.64,1.3,-0.37,0.11,0,0,0,0,0,0,0,0,-4.15,1.06,-7.95,2.14,-8.48,2.32,-4.36,1.21,-0.25,0.1,0,0,0,0,0,0,0,0,-6.12,0.55,-11.75,1.11,-12.59,1.2,-6.53,0.63,-0.48,0.05,0,0,0,0,0,0,0,0,-8.22,0,-15.82,0,-17,0,-8.88,0,-0.76]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":56,"value":[0.04,-1.33,0.05,-3.48,0.06,-3.93,0.02,-2.06,-0.01,-0.18,0,0,0,0,0,0,0,0,0.32,-3.34,0.5,-8.58,0.64,-9.69,0.31,-5.06,-0.02,-0.43,0,0,0,0,0,0,0,0,0.56,-2.06,1.04,-4.94,1.17,-5.52,0.6,-2.88,0.04,-0.25,0,0,0,0,0,0,0,0,0.23,-0.71,0.47,-1.43,0.54,-1.54,0.32,-0.81,0.1,-0.07,0,0,0,0,0,0,0,0,-0.87,-0.37,-1.66,-0.74,-1.77,-0.8,-0.9,-0.42,-0.03,-0.04,0,0,0,0,0,0,0,0,-2.06,0,-3.96,0,-4.25,0,-2.22,0,-0.19]},{"offset":56,"value":[-0.1,0,-0.19,0,-0.18,0,-0.08,0,0.02,0,0,0,0,0,0,0,0,0,-0.88,0,-1.7,0,-1.82,0,-0.95,0,-0.08,0,0,0,0,0,0,0,0,0,-1.66,0,-3.2,0,-3.46,0,-1.82,0,-0.18,0,0,0,0,0,0,0,0,0,-1.8,0,-3.46,0,-3.72,0,-1.94,0,-0.15,0,0,0,0,0,0,0,0,0,-1.92,0,-3.7,0,-3.98,0,-2.07,0,-0.17,0,0,0,0,0,0,0,0,0,-2.06,0,-3.96,0,-4.25,0,-2.22,0,-0.19]}]},{"name":"B_CLOTHES.04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.07","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.30","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":2,"value":[-2.63,-0.81,-5.07,-1.55,-6.04,-1.72,-9.77,-1.48,-13.5,-1.23,-12.34,-1.08,-6.41,-0.56,0,0,0,0,-1.76,-1.02,-3.37,-1.98,-4.14,-2.17,-8.36,-1.53,-12.58,-0.88,-11.6,-0.73,-6.03,-0.39,0,0,0,0,-0.94,-1.22,-1.79,-2.38,-2.39,-2.58,-7.06,-1.57,-11.74,-0.56,-10.91,-0.42,-5.67,-0.23,0,0,0,0,-1.56,-1.55,-1.95,-2.74,-1.84,-2.88,-6.55,-1.88,-11.25,-0.87,-10.35,-0.73,-5.48,-0.53,-0.24,-0.24,0,0,-3.98,-2.76,-3.43,-4.7,-0.79,-4.95,-4.59,-5.01,-8.4,-5.08,-8.1,-4.84,-5.53,-3.87,-2.76,-2.82,0,0,-6.4,-3.98,-4.93,-6.66,0.26,-7.01,-2.64,-8.15,-5.55,-9.29,-5.87,-8.94,-5.6,-7.2,-5.28,-5.41,3.98,-2.62,-0.06,-6.73,2.32,-10.72,6.85,-11.54,2.17,-12.44,-2.51,-13.33,-2.37,-12.68,-3.99,-10.21,-5.9,-8.68,19.55,-12.85,21.78,-14.13,26.95,-15.52,29.54,-15.9,18.98,-17.46,8.41,-19.02,6.37,-19.11,-0.15,-19.26,-7.38,-20.52,36.39,-23.92,45.19,-21.99,53.31,-20.2,53.8,-19.84,36.82,-20.83,19.84,-21.82,15.26,-23.16,3.62,-28.05,-8.98,-33.33]},{"offset":2,"value":[-2.63,-0.81,-5.07,-1.55,-6.04,-1.72,-9.77,-1.48,-13.5,-1.23,-12.34,-1.08,-6.41,-0.56,0,0,0.66,-1.79,-0.51,-3.26,-1.57,-4.68,-2.14,-5.03,-6.18,-4.88,-10.23,-4.73,-9.54,-4.17,-4.96,-2.08,0,0,1.28,-3.45,1.48,-5.54,1.69,-7.57,1.47,-8.09,-2.87,-8.03,-7.21,-7.96,-6.93,-7.03,-3.62,-3.52,0,0,1.74,-4.96,1.43,-6.99,2.02,-8.99,1.79,-9.11,-2.08,-9.23,-5.95,-9.36,-5.71,-8.42,-2.86,-4.87,0.21,-1.44,4.8,-17.13,-0.57,-15.97,-2.32,-13.73,-3.06,-11.6,-2.71,-13.51,-2.36,-15.42,-1.85,-15.73,0.23,-16.23,2.39,-16.77,7.14,-32.01,-2.92,-26.81,-6.96,-18.89,-7.92,-14.08,-3.34,-17.78,1.23,-21.49,2.06,-23.03,3.27,-27.59,4.58,-32.1,17.26,-41.44,8.9,-32.87,5.6,-20.21,5.71,-14.53,6.19,-20.32,4.9,-26.21,4.39,-27.64,4.64,-30.91,4.84,-34.73,47.07,-46.41,42.8,-38.29,41.11,-27.12,40.69,-23.16,29.56,-28.98,14.2,-35.04,9.58,-36.07,7.42,-37.42,5.04,-39.37,78.78,-50.8,76.06,-46.86,73.55,-43.21,71.1,-42.24,50.24,-41.92,22.67,-41.98,14.51,-42.47,10.06,-43.39,5.25,-44.4]}]},{"name":"B_CLOTHES.26","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"value":[-8.72,-7.08,-8.3,-6.32,-4.77,-2.84,0,0,0,0,0,0,0,0,0,0,0,0,-6.2,-12.92,-10.34,-10.24,-5.98,-4.9,0.01,-0.73,0.01,-0.38,0,-0.03,0,0,0,0,0,0,-3.88,-18.32,-12.49,-13.85,-7.26,-6.85,0.02,-1.4,0.01,-0.73,0,-0.06,0,0,0,0,0,0,-2.82,-19.95,-12.82,-14.37,-7.31,-7.31,0.05,-1.1,0.03,-0.57,0,-0.05,0,0,0,0,0,0,2.04,-22.57,-4.94,-13.61,-3.06,-3.55,0.35,3.96,0.19,2.07,0.03,0.18,0,0,0,0,0,0,6.9,-25.2,2.91,-12.86,1.09,0.2,0.66,9.02,0.35,4.71,0.03,0.4,0,0,0,0,0,0,6.55,-22.66,4.25,-11.44,1.94,0.98,0.61,8.46,0.32,4.42,0.03,0.38,0,0,0,0,0,0,3.4,-11.78,2.15,-5.97,1.1,0.58,0.31,4.39,0.17,2.3,0.02,0.2]},{"value":[-8.72,-7.08,-8.3,-6.32,-4.77,-2.84,0,0,0,0,0,0,0,0,0,0,0,0,-16.65,-20.84,-19.08,-16.28,-11.15,-7.73,0.01,-0.73,0.01,-0.38,0,-0.03,0,0,0,0,0,0,-23.97,-33.55,-29.55,-25.51,-17.54,-12.44,0.02,-1.4,0.01,-0.73,0,-0.06,0,0,0,0,0,0,-25.38,-36.62,-32.04,-27.23,-19.16,-13.77,-0.55,-1.33,-0.25,-0.69,0.06,-0.06,0,0,0,0,0,0,-20.37,-34.65,-23.71,-23.43,-16.16,-9.79,-5.76,1.32,-3.01,0.69,-0.26,0.06,0,0,0,0,0,0,-15.36,-32.68,-15.56,-19.66,-13.31,-5.83,-10.98,3.97,-5.77,2.07,-0.57,0.18,0,0,0,0,0,0,-13.26,-28.94,-11.78,-17.1,-10.56,-4.12,-10.16,3.76,-5.37,1.96,-0.59,0.17,0,0,0,0,0,0,-6.89,-15.04,-6.19,-8.92,-5.42,-2.07,-5.26,1.95,-2.79,1.02,-0.32,0.09]}]},{"name":"B_CLOTHES.31","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.32","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.10","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_HAIR_TWIN.29","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-1.28,10.56,-1.32,10.52,-1.38,10.46,-1.38,10.46,-1.36,10.45,-2.04,10.6,-1.31,10.46,-5.12,14.73,-1.32,10.5]},{"duration":40,"tweenEasing":0,"offset":17},{"duration":40,"tweenEasing":0,"value":[4.89,4.92,4.4,5.05,5.47,5.72,5.42,4.99,4.61,3.94,4.29,4.25,-1.23,7.09,7.64,-10.76,4.08,4.61]},{"value":[2.78,6.9,0,0,0,0,0,0,0,0,0,0,-0.19,13.1,11.45,0.85]}]},{"name":"D_CLOTHES.11","type":22,"frame":[{"duration":40,"tweenEasing":0,"value":[-0.97,-2.71,6.74,9.58,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.27,5.57,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,6.74,23.64,6.08,9.34,-1.94]},{"duration":40,"tweenEasing":0,"offset":71},{"duration":40,"tweenEasing":0,"value":[-7.95,1.7,5.38,-18.2,-22.24,-15.56,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-16.33,-18.63,-1.94,0,-1.91,3.91,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.66,0.23,4.75,-18.46,-19.76,-16.85]},{"value":[-4.41,-7.61,10.53,-18.48,-22.24,-15.56,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-16.33,-18.63,-1.94,0,-1.91,3.91,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,-1.94,0,2.44,6.18,9.6,-9.87,-19.76,-16.85]}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_ARM_L","timeline":[{"name":"B_CLOTHES.15","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":60,"value":[-0.03,0,0.13,0.02,0.28,0.04,0.3,0.04,0.16,0.03,0,0,0,0,0,0,0,0,0.13,0.02,1.48,0.23,2.84,0.44,2.64,0.41,1.37,0.21,0,0,0,0,0,0,0,0,0.28,0.04,2.84,0.44,5.39,0.85,4.99,0.78,2.58,0.4,0,0,0,0,0,0,0,0,0.3,0.04,2.64,0.41,4.99,0.79,4.59,0.73,2.37,0.36,0,0,0,0,0,0,0,0,0.16,0.02,1.37,0.21,2.58,0.41,2.37,0.38,1.22,0.19]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":24,"value":[0.04,-0.31,0.46,-3.58,0.88,-6.85,0.91,-7.09,0.86,-6.84,0.81,-6.59,0,0,0,0,0,0,0.1,-0.59,0.89,-6.89,1.68,-13.18,1.75,-13.64,1.65,-13.16,1.55,-12.68,0,0,0,0,0,0,0.11,-0.64,0.89,-7.4,1.67,-14.16,1.73,-14.67,1.7,-14.15,1.67,-13.62,0,0,0,0,0,0,-0.04,-0.33,-0.25,-3.87,-0.46,-7.4,-0.35,-7.66,0.24,-7.4,0.87,-7.12,0,0,0,0,0,0,-0.17,-0.03,-1.39,-0.33,-2.62,-0.64,-2.44,-0.66,-1.23,-0.65,0.07,-0.61,0,0,0,0,0,0,-0.15,0,-1.34,0,-2.52,0,-2.32,0,-1.2,0,0,0,0,0,0,0,0,0,-0.08,0,-0.69,0,-1.31,0,-1.2,0,-0.62]},{"offset":24,"value":[0.04,-0.31,0.46,-3.58,0.88,-6.85,0.91,-7.09,0.86,-6.84,0.81,-6.59,0,0,0,0,0,0,0.1,-0.59,0.89,-6.89,1.68,-13.18,1.75,-13.64,1.65,-13.16,1.55,-12.68,0,0,0,0,0,0,0.12,-0.64,0.87,-7.45,1.62,-14.25,1.68,-14.75,1.67,-14.22,1.67,-13.62,0,0,0,0,0,0,-0.06,-0.38,-0.5,-4.39,-0.94,-8.41,-0.8,-8.6,0,-7.89,0.87,-7.12,0,0,0,0,0,0,-0.21,-0.12,-1.87,-1.34,-3.53,-2.57,-3.28,-2.45,-1.66,-1.56,0.07,-0.61,0,0,0,0,0,0,-0.2,-0.08,-1.78,-0.94,-3.36,-1.8,-3.1,-1.66,-1.6,-0.83,0,0,0,0,0,0,0,0,-0.11,-0.04,-0.93,-0.49,-1.74,-0.93,-1.6,-0.86,-0.83,-0.43]}]},{"name":"B_CLOTHES.01","type":50,"frame":[{"duration":80,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"offset":2,"value":[-13.65,-1.45,-26.26,-2.78,-28.21,-2.99,-14.74,-1.56,-1.27,-0.13,0,0,0,0,0,0,0,0,-12.75,-6.97,-24.42,-13.99,-26.29,-15.15,-13.71,-7.92,-1.13,-0.68,0.08,-0.29,0.34,-1.36,0.61,-2.41,0,0,-11.87,-12.24,-22.87,-24.39,-24.44,-26.4,-12.75,-13.79,-1.07,-1.19,0.16,-0.54,0.65,-2.6,1.18,-4.64,0,0,-11.04,-13.4,-21.36,-26.29,-23.06,-28.35,-12.24,-14.76,-1.42,-1.18,-0.09,-0.47,0.44,-2.73,1,-5.23,0,0,-7.37,-9.01,-14.03,-17.37,-15.31,-18.62,-9.34,-9.16,-3.37,0.3,-2.78,0.46,-2.61,-2.37,-2.42,-5.44,0,0,-3.63,-4.63,-6.83,-8.45,-7.56,-8.89,-6.44,-3.56,-5.32,1.77,-5.47,1.39,-5.66,-2.01,-5.84,-5.64,0,0,-2.67,-3.3,-5.17,-6.63,-5.9,-7.1,-5.49,-2.7,-5.08,1.7,-5.09,1.28,-5.29,-1.9,-5.49,-5.04,0,0,-1.38,-1.7,-2.67,-3.44,-3.07,-3.69,-2.85,-1.4,-2.64,0.88,-2.65,0.66,-2.75,-1,-2.85,-2.62]}]},{"name":"B_CLOTHES.04","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.05","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":6,"value":[1.82,1.4,9,3.36,14.45,3.5,13.29,3.09,6.91,1.61,0,0,0,0,0,0,0,0,0.96,0.85,4.96,1.94,7.89,1.89,7.31,1.68,3.83,0.91,0,0,0,0,0,0,0,0,0.18,0.33,1.2,0.59,1.78,0.41,1.74,0.36,0.94,0.25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.01,-0.04,0.02,-0.43,0.05,-0.83,0.03,-0.94,-0.01,-1.4,-0.11,-2.38,0,0,0,0,0,0,0,-0.18,0.11,-2.13,0.21,-4.08,0.12,-5.02,-0.16,-8.09,-0.54,-11.71,0,0,0,0,0,0,0.02,-0.34,0.2,-3.97,0.38,-7.6,0.24,-9.46,-0.35,-15.38,-1,-21.79]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":6,"value":[-0.4,-0.06,-4.71,-0.75,-9.01,-1.44,-8.38,-1.34,-4.36,-0.7,0,0,0,0,0,0,0,0,-0.13,-0.03,-2.53,-0.41,-4.92,-0.78,-3.32,-0.74,2.91,-0.44,9.63,-0.08,0,0,0,0,0,0,0.07,-0.01,-0.51,-0.08,-1.1,-0.16,1.32,-0.17,9.6,-0.19,18.52,-0.16,0,0,0,0,0,0,-0.1,0,0.43,-0.05,0.96,-0.1,3.25,-0.12,11.7,-0.17,20.8,-0.18,0,0,0,0,0,0,0.43,-0.05,5.05,-0.6,9.67,-1.14,11.27,-1.08,15.85,-0.65,20.8,-0.18,0,0,0,0,0,0,0.95,-0.1,9.67,-1.14,18.39,-2.18,19.27,-2.04,19.98,-1.12,20.8,-0.18,1.21,-3.67,-0.3,-3.4,-1.59,-3.28,-1.32,-3.37,2.46,-4.61,6.24,-5.85,8.57,-5.67,11.8,-4.62,15,-3.86,5.96,-18,-0.15,-17.02,-5.72,-16.2,-7.54,-16.04,-10.49,-16.46,-13.44,-16.87,-12.21,-17.03,-9.89,-17.53,-7.67,-18.23,11.1,-33.51,0.13,-31.79,-10.01,-30.2,-13.27,-29.78,-20.3,-29.68,-27.33,-29.59,-28.45,-30.04,-30.25,-31.84,-32.2,-33.79]},{"offset":2,"value":[-7.69,2.46,-14.79,4.72,-16.79,5.35,-18.74,5.79,-20.7,6.23,-18.6,5.58,-9.67,2.9,0,0,0,0,-4.62,0.36,-8.81,0.47,-9.44,0.35,-8.02,-1.04,-6.61,-2.43,-4.72,-2.16,2.21,-0.81,9.63,-0.08,0,0,-1.72,-1.63,-3.22,-3.48,-2.68,-4.24,1.92,-7.1,6.51,-9.95,8.23,-8.89,13.16,-4.11,18.52,-0.16,0.19,-0.98,-0.47,-2.97,-1.08,-5.04,0.18,-5.77,8.99,-7.65,17.81,-9.52,18.52,-8.66,19.4,-4.62,20.56,-0.31,2.16,-11.39,2.26,-11.05,2.38,-10.74,4.14,-10.76,13.83,-11.87,23.53,-12.98,23.06,-11.78,20.47,-6.79,18,-1.65,4.14,-21.8,5.01,-19.12,5.83,-16.43,6.74,-15.76,12.78,-16.13,18.82,-16.5,18.72,-15.02,17.11,-9.17,15.44,-3,11.24,-26.01,8.89,-23.05,6.68,-20.3,4.7,-19.75,4.29,-21.34,5.33,-22.92,6.33,-21.29,5.33,-14.68,4.06,-8.67,17.13,-39.12,10.96,-36.23,5.23,-33.56,0.29,-32.89,-7.88,-32.95,-12.41,-32.98,-13.42,-32.23,-18.66,-29.53,-24.55,-27.42,22.42,-53.32,12.57,-50.51,3.46,-47.9,-4.25,-47.08,-20.08,-45.14,-30.02,-43.16,-33.44,-43.48,-43.67,-45.43,-54.75,-47.55]}]},{"name":"B_CLOTHES.07","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.36","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.37","type":50,"frame":[{"duration":40,"tweenEasing":0,"offset":28,"value":[-0.05,-0.02,-0.15,-0.07,-0.27,-0.13,-0.38,-0.18,0,0,0,0,0,0,0,0,0,0,-0.11,-0.04,-0.32,-0.15,-0.57,-0.27,-0.8,-0.37,0,0,0,0,0,0,0,0,0,0,-0.15,-0.06,-0.45,-0.21,-0.81,-0.39,-1.14,-0.53,0,0,0,0,0,0,0,0,0,0,-0.14,-0.07,-0.48,-0.22,-0.9,-0.42,-1.28,-0.6,0,0,0,0,0,0,0,0,0,0,-0.15,-0.06,-0.45,-0.21,-0.81,-0.39,-1.14,-0.53,0,0,0,0,0,0,0,0,0,0,-0.11,-0.04,-0.32,-0.15,-0.57,-0.27,-0.8,-0.37,0,0,0,0,0,0,0,0,0,0,-0.05,-0.02,-0.15,-0.07,-0.27,-0.13,-0.38,-0.18]},{"duration":40,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"value":[-8.96,-6.49,-9.64,-5.53,-10.38,-4.46,-10.99,-3.6,-11.24,-3.25,-15.44,2.2,-19.9,5.14,-24.46,7.07,-28.98,9.5,-8.96,-6.49,-9.44,-5.79,-9.98,-5.05,-10.4,-4.45,-10.56,-4.21,-14.02,-0.12,-18.09,2.14,-22.44,3.7,-26.71,5.69,-8.96,-6.49,-9.23,-6.07,-9.53,-5.68,-9.76,-5.39,-9.81,-5.27,-12.48,-2.56,-16.13,-1.09,-20.22,-0.02,-24.21,1.47,-8.96,-6.49,-9.05,-6.32,-9.16,-6.21,-9.22,-6.15,-9.21,-6.14,-11.12,-4.72,-14.47,-3.83,-18.44,-3.04,-22.18,-1.94,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.32,-6.15,-13.61,-5.31,-17.67,-4.28,-21.35,-3.34,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.38,-6.21,-13.54,-5.57,-17.42,-4.9,-20.96,-4.54,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.29,-6.54,-13.19,-6.69,-16.74,-6.98,-20.03,-7.45,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-10.11,-6.97,-12.71,-8.14,-15.92,-9.63,-18.87,-11.05,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-8.96,-6.49,-9.93,-7.35,-12.29,-9.42,-15.19,-11.98,-17.83,-14.3]},{"value":[-11.56,-10.47,-14.89,-8.57,-18.62,-6.54,-21.72,-5.07,-23.12,-4.87,-24.09,-4.1,-26.42,-2.24,-29.28,0.05,-31.86,2.09,-11.81,-10.29,-14.39,-8.89,-17.24,-7.38,-19.62,-6.31,-20.76,-6.23,-21.37,-5.63,-22.96,-4.11,-24.94,-2.18,-26.75,-0.33,-12.01,-10.26,-13.85,-9.32,-15.85,-8.26,-17.53,-7.53,-18.41,-7.55,-18.61,-7.16,-19.42,-6.12,-20.48,-4.67,-21.47,-3.08,-12.19,-10.31,-13.23,-9.87,-14.32,-9.36,-15.25,-9.04,-15.8,-9.2,-15.74,-8.87,-15.92,-7.97,-16.22,-6.67,-16.5,-5.19,-12.34,-10.42,-12.45,-10.58,-12.51,-10.83,-12.57,-11.16,-12.66,-11.56,-12.64,-10.94,-12.56,-9.37,-12.45,-7.44,-12.36,-5.72,-11.98,-10.66,-12.03,-10.8,-12.05,-11.03,-12.06,-11.33,-12.09,-11.61,-12.06,-11.02,-12.19,-9.73,-12.43,-8.4,-12.72,-7.7,-11.68,-10.82,-11.7,-10.93,-11.69,-11.16,-11.69,-11.41,-11.69,-11.59,-11.98,-11.55,-12.67,-11.66,-13.59,-12.06,-14.59,-12.88,-11.43,-10.92,-11.43,-11,-11.43,-11.19,-11.42,-11.38,-11.42,-11.44,-12.1,-12.18,-13.52,-14.18,-15.3,-16.8,-17.08,-19.35,-11.23,-10.97,-11.24,-11,-11.24,-11.12,-11.24,-11.21,-11.24,-11.15,-12.11,-12.57,-14.25,-16.3,-16.88,-20.98,-19.27,-25.22]}]},{"name":"B_HAND.01","type":50,"frame":[{"duration":80,"tweenEasing":0,"offset":161},{"duration":40,"tweenEasing":0,"offset":161},{"value":[-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.77,-0.4,-4.91,-11.37,-4.03,-6.74,-3.44,-3.66,-3.81,-1.92,-4.25,1.33,-7.06,4.03,-9.76,4.24,-7.77,2.39,-4.77,-0.4,-4.99,-17.96,-3.52,-10.24,-2.64,-5.62,-3.22,-3.14,-3.93,2.37,-8.45,7.22,-12.75,7.03,-9.76,4.24,-4.77,-0.4,-4.54,-17.24,-3.81,-13.39,-3.36,-11.07,-3.5,-7.8,-3.79,-0.99,-10.94,6.66,-17.24,11.37,-13.22,9.69,-6.52,6.87,-4.09,-16.53,-4.09,-16.53,-4.09,-16.53,-3.79,-12.46,-3.65,-4.35,-13.43,6.13,-21.74,15.72,-16.68,15.13,-8.26,14.15,-4.63,-3.76,-1.51,-6.87,0.37,-8.74,-2.02,-7.5,-4.24,-1.7,-13.69,5.26,-22.07,12.32,-16.62,15.05,-7.42,16.92,-5.17,9.01,1.08,2.79,4.83,-0.94,-0.25,-2.55,-4.83,0.95,-13.96,4.4,-22.41,8.92,-16.56,14.97,-6.58,19.69,-5.02,5.48,2.25,3.06,6.53,1.22,1.24,0.35,-3.8,2.04,-12.37,5.04,-20.6,8.56,-15.08,11.22,-5.9,12.15,-4.77,-0.4,4.07,2.87,9.38,4.83,3.65,4.35,-2.08,3.87,-9.83,5.92,-17.58,7.97,-12.78,4.83,-4.77,-0.4]}]},{"name":"B_HAND.08","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"D_CLOTHES.13","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.31","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]},{"name":"B_CLOTHES.32","type":42,"frame":[{"duration":120,"tweenEasing":0,"x":-1},{"x":1}]}]},{"type":"tree","duration":120,"playTimes":0,"name":"PARAM_BODY_X","timeline":[{"name":"B_CLOTHES.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[5.62,2.75,0.27,3.52,-4.67,4.15,-6.14,3.37,-8.28,1.47,-10.42,0.11,-10.62,0,-10.62,0,-10.62,0,2.91,-2.69,-2.12,-0.65,-6.76,1.39,-9.13,1.68,-10.79,0.59,-10.85,0.04,-10.84,0.07,-10.76,0.04,-10.62,0,0.21,-7.87,-4.53,-4.61,-8.97,-1.27,-12.21,0.04,-13.36,-0.26,-11.3,-0.04,-11.07,0.14,-10.9,0.09,-10.62,0,-1.98,-10.04,-6.96,-6.35,-11.68,-2.61,-15.64,-0.69,-16.26,-0.6,-12.22,-0.02,-11.44,0.21,-11.11,0.14,-10.62,0,-3.63,-9.21,-9.12,-6.3,-14.27,-3.4,-18.36,-1.42,-19.71,-0.62,-15.55,0.51,-13.64,0.67,-12.23,0.36,-10.62,0,-4.89,-8.21,-10.96,-6.13,-16.62,-4.16,-20.94,-2.14,-23.28,-0.63,-19.35,1.05,-16.3,1.13,-13.58,0.58,-10.62,0,-5.84,-8.53,-12.23,-6.51,-18.19,-4.31,-21.95,-2.29,-24.24,-0.77,-21.43,0.75,-18.58,0.8,-15,0.36,-11.13,0,-5.74,-7.83,-13.25,-6.39,-20.25,-4.82,-23.81,-3.31,-25.31,-1.91,-23.75,-0.69,-21.71,-0.52,-17.58,-0.31,-13.14,0,-5.47,-6.95,-14.2,-6.18,-22.4,-5.38,-25.86,-4.42,-26.49,-3.15,-26.14,-2.25,-24.9,-1.93,-20.29,-1.01,-15.31]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[11.87,0,9.7,0,7.7,0,7.1,0,6.25,0,5.39,0,5.11,0,4.3,0,3.44,0,11.87,0,11.25,0,10.69,0,11.46,-0.01,11.91,-0.09,9.96,-0.17,8.42,-0.16,6.44,-0.1,4.3,0,11.87,0,12.7,0,13.5,0,15.58,-0.02,17.4,-0.2,14.46,-0.39,11.69,-0.37,8.53,-0.22,5.11,0,11.87,0,13.25,0.03,14.51,0.04,17.24,0,20.43,-0.4,17.34,-0.79,13.88,-0.74,9.82,-0.37,5.43,0,11.87,0,13.82,0.2,15.63,0.39,18.39,0.4,21.72,0,19.25,-0.4,15.9,-0.39,11.49,-0.2,6.72,0,11.87,0,14.4,0.37,16.74,0.74,19.54,0.79,23.01,0.4,21.15,0,17.92,-0.04,13.15,-0.03,8,0,11.87,0,14.59,0.34,17.09,0.68,20.18,0.76,24.2,0.44,22.01,0.06,18.43,0,13.67,0,8.53,0,11.87,0,14.95,0.17,17.79,0.35,21.62,0.44,26.61,0.34,23.81,0.08,19.69,0,15.1,0,10.13,0,11.87,0,15.34,0,18.55,0,23.14,0.09,29.12,0.22,25.71,0.09,21.05,0,16.64,0,11.87]}]},{"name":"B_CLOTHES.11","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-2.34,-0.43,-3.32,-0.43,-4.39,-0.43,-5.26,-0.43,-5.62,-0.43,-5.88,-0.43,-6.5,-0.43,-7.27,-0.43,-7.97,-0.43,-3.26,-0.56,-4.31,-0.55,-5.48,-0.53,-6.42,-0.51,-6.82,-0.5,-7.16,-0.5,-7.91,-0.48,-8.81,-0.46,-9.63,-0.43,-4.16,-0.71,-5.3,-0.68,-6.56,-0.62,-7.58,-0.57,-8.02,-0.54,-8.5,-0.54,-9.41,-0.52,-10.49,-0.48,-11.48,-0.43,-5.09,-0.82,-6.3,-0.79,-7.64,-0.73,-8.73,-0.67,-9.2,-0.64,-9.73,-0.62,-10.72,-0.58,-11.89,-0.51,-12.97,-0.43,-6.09,-0.87,-7.34,-0.87,-8.73,-0.87,-9.85,-0.87,-10.31,-0.87,-10.67,-0.82,-11.54,-0.71,-12.61,-0.56,-13.59,-0.43,-7.05,-1.24,-8.65,-1.18,-10.41,-1.11,-11.86,-1.04,-12.56,-1,-12.77,-0.96,-13.48,-0.85,-14.39,-0.72,-15.2,-0.62,-8.38,-1.19,-10.17,-1.11,-12.14,-1.01,-13.76,-0.91,-14.52,-0.87,-14.73,-0.84,-15.43,-0.76,-16.31,-0.67,-17.1,-0.6,-9.85,-0.99,-11.77,-0.89,-13.89,-0.77,-15.62,-0.67,-16.37,-0.62,-16.64,-0.61,-17.38,-0.57,-18.3,-0.53,-19.12,-0.5,-11.24,-0.87,-13.33,-0.74,-15.64,-0.6,-17.5,-0.48,-18.27,-0.43,-18.58,-0.43,-19.33,-0.43,-20.25,-0.43,-21.08,-0.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-5,0,-3.51,0,-1.87,0,-0.55,0,0,0,0,0,0,0,0,0,0,0,-3.78,0,-2.04,0,-0.11,0,1.44,0,2.07,0,2.27,0,2.55,0,2.86,0,3.15,0,-2.58,0,-0.6,0,1.6,0,3.36,0,4.06,0,4.57,0,5.23,0,5.95,0,6.64,0,-1.34,0,0.91,0,3.41,0,5.41,0,6.21,0,6.81,0,7.65,0,8.58,0,9.46,0,0,0,2.6,0,5.47,0,7.79,0,8.75,0,8.95,0,9.45,0,10.06,0,10.62,0,2.28,0.24,4.9,0.17,7.77,0,10.13,-0.17,11.22,-0.24,11.05,-0.21,11.06,-0.12,11.13,-0.04,11.17,0,5.15,0.22,7.51,0.15,10.09,0,12.22,-0.15,13.2,-0.22,12.98,-0.18,12.81,-0.11,12.66,-0.03,12.49,0,8.26,0.08,10.24,0.06,12.43,0,14.21,-0.06,14.98,-0.08,14.84,-0.07,14.62,-0.04,14.37,-0.01,14.13,0,11.24,0,12.91,0,14.76,0,16.25,0,16.87,0,16.73,0,16.4,0,15.99,0,15.62]}]},{"name":"B_CLOTHES.12","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-9.37,-0.58,-9.37,-0.58,-9.37,-0.58,-9.37,-0.58,-9.37,-0.58,-8.82,-0.71,-7.5,-1.01,-5.86,-1.39,-4.37,-1.74,-10.07,-0.58,-10.02,-0.59,-9.98,-0.62,-9.93,-0.65,-9.89,-0.66,-9.32,-0.8,-7.9,-1.12,-6.15,-1.53,-4.56,-1.91,-10.83,-0.58,-10.72,-0.61,-10.6,-0.69,-10.48,-0.76,-10.37,-0.8,-9.78,-0.93,-8.29,-1.27,-6.44,-1.69,-4.76,-2.1,-11.46,-0.58,-11.33,-0.62,-11.19,-0.7,-11.06,-0.79,-10.93,-0.82,-10.31,-0.97,-8.71,-1.34,-6.72,-1.81,-4.93,-2.25,-11.71,-0.58,-11.71,-0.58,-11.71,-0.58,-11.71,-0.58,-11.71,-0.58,-10.98,-0.77,-9.2,-1.23,-6.99,-1.8,-5,-2.32,-13.21,-0.58,-13.15,-0.58,-13.08,-0.58,-13.01,-0.58,-12.97,-0.58,-12.05,-0.76,-10.07,-1.19,-7.67,-1.7,-5.48,-2.13,-14.35,-0.58,-14.25,-0.58,-14.14,-0.58,-14.05,-0.58,-14,-0.58,-13.11,-0.71,-11.16,-1.01,-8.79,-1.37,-6.64,-1.67,-15.34,-0.58,-15.22,-0.58,-15.1,-0.58,-14.99,-0.58,-14.94,-0.58,-14.16,-0.64,-12.34,-0.78,-10.1,-0.95,-8.07,-1.1,-16.4,-0.58,-16.26,-0.58,-16.11,-0.58,-15.98,-0.58,-15.93,-0.58,-15.21,-0.58,-13.47,-0.58,-11.32,-0.58,-9.37,-0.58]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[6.25,1.16,4.95,0.47,3.51,-0.29,2.35,-0.91,1.87,-1.16,1.27,-1.66,0.47,-2.24,-0.41,-2.87,-1.25,-3.48,7.55,0.81,6.18,0.24,4.71,-0.37,3.46,-0.88,2.8,-1.16,2.16,-1.68,1.16,-2.46,0.01,-3.35,-1.06,-4.16,8.98,0.43,7.55,-0.02,6.02,-0.47,4.68,-0.87,3.83,-1.16,3.13,-1.71,1.91,-2.72,0.47,-3.89,-0.86,-4.92,10.14,0.13,8.65,-0.22,7.09,-0.53,5.68,-0.84,4.66,-1.16,3.95,-1.72,2.54,-2.9,0.85,-4.31,-0.69,-5.54,10.62,0,9.13,-0.26,7.57,-0.51,6.14,-0.79,5,-1.16,4.38,-1.67,2.89,-2.9,1.04,-4.42,-0.62,-5.79,11.68,0.06,10.33,-0.15,8.89,-0.33,7.61,-0.52,6.73,-0.79,5.79,-1.31,3.86,-2.55,1.55,-4,-0.56,-5.16,12.26,0.22,10.94,0.02,9.52,-0.14,8.3,-0.31,7.57,-0.51,6.56,-0.89,4.46,-1.78,1.93,-2.82,-0.39,-3.62,12.64,0.41,11.32,0.22,9.89,0.04,8.69,-0.13,8.07,-0.26,7.11,-0.44,4.93,-0.85,2.25,-1.33,-0.19,-1.72,13.12,0.58,11.82,0.41,10.39,0.22,9.22,0.06,8.75,0,7.79,0,5.47,0,2.6]}]},{"name":"B_CLOTHES.14","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-1.25,0,-5.3,-0.54,-6.13,-0.76,-6.87,-1.02,-6.8,-1.04,-4.97,-0.55,-3.14,-0.05,-2.73,0.47,-2,0.59,-1.25,0,-9.04,-1.03,-10.8,-1.45,-12.4,-1.92,-12.31,-1.96,-8.61,-1.03,-4.91,-0.09,-4.12,0.95,-2.71,1.18,-1.25,0,-9.97,-1.16,-13.39,-1.5,-16.55,-1.85,-17.01,-1.87,-11.84,-0.73,-5.71,0.49,-4.36,1.61,-2.85,1.55,-1.25,0,-9.68,-1.16,-14.66,-1.09,-19.27,-1.04,-20.8,-1.07,-16.37,-0.33,-8.07,0.75,-5.22,1.42,-3.33,1.06,-1.25,0,-9.4,-1.16,-15.87,-0.69,-21.85,-0.22,-24.67,-0.3,-22.07,-0.46,-12.84,-0.03,-8.23,0.33,-4.89,0.26,-1.25,0,-8.96,-0.78,-16.32,0.28,-23.31,1.72,-26.71,1.77,-20.82,-0.22,-9.21,-1.71,-4.56,-1.43,-2.48,-0.57,-0.29,0,-7.36,0.71,-12.9,2.09,-18.21,4.14,-19.81,4.36,-7.96,1.32,6.81,-1.47,9.23,-1.42,6.47,-0.63,3.45,0,-5.62,2.32,-7.36,2.59,-8.96,2.83,-7.89,2.72,7.89,0.87,23.66,-0.98,23.21,-1.03,15.67,-0.54,7.5]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-17.34,-4.24,-11.63,-3.65,-6.35,-3.1,-6.95,-2.92,-9.38,-2.61,-8.02,-2.57,-7.93,-2.62,-11.47,-2.2,-15.32,-1.75,-6.71,-2.28,-3.25,-2.03,-0.08,-1.88,-1.72,-1.82,-6.27,-1.54,-6.18,-1.42,-5.1,-1.02,-6.95,0.71,-8.98,1.96,3.49,-0.46,4.88,-0.51,6.12,-0.68,3.54,-0.72,-3.09,-0.5,-4.24,-0.36,-2.34,0.34,-2.68,2.86,-3.08,4.59,8.12,0,9.63,0,11.02,0,8.86,0,1.41,-0.05,-0.7,-0.09,0.72,0.02,-0.32,0.45,-1.44,0.9,8.12,0,12.04,0,15.69,0,15.18,-0.01,8.88,-0.16,5.64,-0.3,5.13,-0.27,1.12,-0.09,-3.17,0.11,8.12,0,13.95,0,19.36,0,20.14,-0.02,14.91,-0.28,10.45,-0.53,8.38,-0.58,1.98,-0.64,-4.89,-0.69,8.12,0,14.44,0.08,20.28,0.21,21.43,0.21,15.58,-0.19,9.73,-0.6,7.47,-0.65,1.36,-0.69,-5.2,-0.69,8.12,0,14.48,0.05,20.37,0.13,21.24,0.11,13.08,-0.35,4.91,-0.8,3,-0.8,-1.24,-0.62,-5.79,-0.4,8.12,0,14.48,0,20.36,0,20.87,-0.05,10.31,-0.54,-0.26,-1.03,-1.81,-0.97,-4.03,-0.54,-6.42,-0.08]}]},{"name":"B_CLOTHES.18","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[9.37,-4.06,8.21,-2.98,7.15,-1.99,11.31,-1.31,19.76,-0.14,18.28,0.53,14.72,0.52,13.65,0.27,12.49,0,8.79,-3.25,6.35,-2.76,4.08,-2.37,6,-1.96,9.21,-0.8,6.2,0.05,3.73,0.13,2.72,0.12,1.62,0,8.26,-2.51,4.61,-2.57,1.22,-2.72,0.94,-2.57,-1.13,-1.35,-5.69,-0.25,-7.09,-0.1,-8.06,0.04,-9.12,0,7.83,-2.39,3.6,-2.57,-0.3,-2.79,-1.79,-2.7,-7.42,-1.15,-13.04,0.41,-13.9,0.49,-14.68,0.25,-15.48,0,4.69,-3.19,0.62,-2.78,-3.09,-2.41,-4.45,-2.21,-10.82,-1.01,-17.18,0.18,-17.52,0.26,-15.87,0.13,-14.06,0,1.54,-3.98,-2.83,-2.99,-6.83,-2.04,-8.39,-1.71,-15.4,-0.88,-22.41,-0.05,-21.95,0.02,-17.47,0.02,-12.63,0,0.84,-3.61,-2.7,-2.75,-5.99,-1.85,-7.75,-1.54,-15.32,-0.81,-22.89,-0.07,-22.36,0,-17.55,0,-12.36,0,-0.76,-1.88,-1.6,-1.56,-2.38,-1.21,-3.47,-1.07,-11.81,-0.56,-20.14,-0.05,-19.95,0,-16.04,0,-11.82,0,-2.5,0,-0.76,-0.27,0.84,-0.52,0.42,-0.55,-8.43,-0.29,-17.28,-0.02,-17.37,0,-14.43,0,-11.24]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.12,0,3.32,-0.01,3.5,-0.02,3.68,-0.02,4.64,-0.01,5.6,0,5.37,0,4.28,0,3.12,0,3.12,0,3.5,-0.01,3.85,-0.03,4.19,-0.03,6.04,-0.02,7.9,0,7.46,0,5.37,0,3.12,0,3.12,0,4.02,-0.16,4.87,-0.36,5.46,-0.4,8.08,-0.22,10.69,-0.04,9.9,-0.02,6.77,-0.02,3.42,-0.02,3.12,0,4.24,-0.56,5.3,-1.29,6.31,-1.45,11.43,-0.89,16.55,-0.34,15.61,-0.29,11.23,-0.29,6.56,-0.29,3.12,0,3.94,-0.65,4.69,-1.37,5.66,-1.53,12.91,-1.06,20.16,-0.6,19.59,-0.55,14.83,-0.55,9.7,-0.55,2.34,-0.24,3.02,-0.57,3.69,-0.74,4.8,-0.76,11.9,-0.64,19,-0.51,18.23,-0.5,13.88,-0.51,9.24,-0.52,-0.73,0.05,-1.42,-0.14,-2.04,-0.16,-1.31,-0.15,5.43,-0.19,12.16,-0.22,11.82,-0.23,9.13,-0.25,6.3,-0.27,-4.06,0.42,-6.23,0.09,-8.23,-0.21,-8.24,-0.28,-2.81,-0.15,2.61,-0.01,3.12,0,3.12,0,3.12]}]},{"name":"B_CLOTHES.34","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[23.74,0,6.1,0,-10.2,0,-13.91,0,-9.06,0,-4.2,0,-3.75,0,-3.75,0,-3.75,0,22,0,5.62,0.23,-9.49,0.47,-14.54,0.51,-12.86,0.26,-6.26,0.02,-3.75,0,-3.75,0,-3.75,0,20.4,0,5.21,0.46,-8.79,0.91,-15.24,0.98,-16.7,0.51,-8.32,0.04,-3.75,0,-3.75,0,-3.75,0,20.48,0.17,5.54,0.61,-8.27,1.01,-15.95,1.08,-19.07,0.6,-9.5,0.07,-3.26,-0.05,-3.13,-0.06,-3.75,0,22.02,0.22,6.55,0.4,-7.77,0.52,-15.29,0.62,-17.57,0.5,-8.69,0.12,-1.78,-0.18,-1.29,-0.23,-3.75,0,23.03,0.02,7.19,0.02,-7.46,0,-14.63,0.17,-16.07,0.4,-7.88,0.18,-0.31,-0.32,0.55,-0.4,-3.75,0,23.59,0.05,7.38,0.03,-7.58,0.01,-13.58,0.16,-13.58,0.35,-6.73,0.15,-0.8,-0.27,-0.06,-0.34,-3.75,0,25.46,0.31,8.41,0.3,-7.32,0.28,-12.25,0.35,-10.54,0.32,-5.4,0.09,-2.27,-0.14,-1.91,-0.17,-3.75,0,27.49,0.58,9.56,0.58,-7.01,0.58,-10.92,0.55,-7.5,0.29,-4.07,0.02,-3.75,0,-3.75,0,-3.75]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[3.12,0,5.29,0,7.3,0,8.09,0,11.09,0,14.09,0,10.75,-0.19,-3.42,-0.93,-18.74,-1.74,3.12,0,5,0.04,6.73,0.1,9.51,0.11,14.54,0.16,14.04,0.25,8.52,0.14,-5.4,-0.36,-20.48,-0.93,3.12,0,4.69,0.06,6.14,0.15,10.9,0.17,18.02,0.3,14.12,0.48,6.46,0.45,-7.24,0.16,-22.08,-0.19,3.12,0,3.67,-0.05,5.06,-0.04,12,-0.01,20.97,0.2,14.9,0.48,5.72,0.46,-7.89,0.22,-22.62,-0.03,3.12,0,1.54,-0.21,3.6,-0.17,12.46,-0.02,20.7,-0.06,13.47,-0.05,4.06,-0.07,-9.45,-0.19,-24.06,-0.32,3.12,0,-0.61,-0.37,2.13,-0.29,12.92,-0.03,20.41,-0.31,12.05,-0.58,2.4,-0.6,-11,-0.6,-25.5,-0.62,3.12,0,-0.8,-0.36,0.93,-0.3,9.56,-0.09,15.59,-0.48,9.61,-0.87,1.5,-0.87,-11.57,-0.73,-25.7,-0.64,3.12,0,-0.39,-0.3,-0.97,-0.39,3.1,-0.31,7.25,-0.55,5.39,-0.79,-0.08,-0.79,-12.52,-0.69,-25.96,-0.62,3.12,0,-0.06,-0.25,-3,-0.49,-3.54,-0.55,-1.24,-0.6,1.06,-0.65,-1.74,-0.65,-13.51,-0.63,-26.25,-0.61]}]},{"name":"B_CLOTHES.19","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43,0.13,-0.43,-0.73,-0.43,-1.58,-0.43,-2.43,-0.43,-3.29,-0.43,-4.14,-0.43,-4.99,-0.43,-5.85,-0.43,-6.7,-0.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91,0,6.59,0,5.88,0,5.17,0,4.46,0,3.75,0,3.04,0,2.33,0,1.62,0,0.91]}]},{"name":"B_CLOTHES.21","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[2.81,6.52,2.39,4.96,1.93,3.37,1.56,1.83,1.41,0.43,-1.13,-0.07,-2.28,-0.38,-2.88,-0.6,-3.75,-0.87,2.95,2.91,1.33,2.11,0.03,1.45,-1.02,0.86,-1.87,0.31,-4.11,-0.11,-4.99,-0.43,-5.32,-0.7,-5.92,-1,3.1,-1.09,0.24,-1.06,-1.98,-0.66,-3.78,-0.17,-5.39,0.16,-7.28,-0.16,-7.83,-0.49,-7.85,-0.81,-8.14,-1.14,3.23,-4.32,-0.73,-3.59,-3.77,-2.39,-6.23,-1.05,-8.43,0.05,-10.07,-0.19,-10.39,-0.52,-10.2,-0.9,-10.27,-1.26,3.28,-5.65,-1.51,-4.5,-5.06,-3.13,-7.84,-1.61,-10.31,0,-11.9,-0.14,-12.24,-0.49,-12.09,-0.92,-12.18,-1.3,3.07,-6.08,-2.09,-4.83,-6.47,-3.38,-10.08,-1.81,-12.95,-0.17,-14.28,-0.37,-15.1,-0.81,-15.72,-1.26,-16.44,-1.48,2.58,-7.11,-2.67,-5.77,-7.54,-4.28,-11.62,-2.68,-14.52,-1,-15.73,-1.04,-17.19,-1.12,-18.74,-1.14,-20.26,-0.98,1.96,-8.4,-3.21,-6.94,-8.4,-5.44,-12.78,-3.84,-15.51,-2.09,-16.7,-1.9,-18.9,-1.43,-21.5,-0.82,-23.91,-0.2,1.41,-9.56,-3.68,-7.99,-9.2,-6.46,-13.86,-4.85,-16.4,-3.04,-17.63,-2.66,-20.62,-1.74,-24.31,-0.6,-27.64,0.43]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[4.37,0,5.49,0,6.72,0,7.71,0,8.12,0,9.62,0,13.28,0,17.78,0,21.87,0,3.26,0,4.68,-0.2,6.37,-0.35,7.86,-0.41,8.67,-0.34,11.28,-0.3,15.25,-0.2,19.31,-0.08,22.24,0,2.03,0,3.82,-0.42,6.04,-0.73,8.1,-0.86,9.37,-0.72,13.06,-0.63,17.3,-0.41,20.9,-0.17,22.65,0,1.03,0,3.06,-0.61,5.68,-1.07,8.15,-1.24,9.76,-1.03,14.58,-0.9,19.16,-0.59,22.35,-0.24,22.98,0,0.62,0,2.55,-0.77,5.2,-1.3,7.76,-1.46,9.37,-1.16,15.49,-1.01,20.57,-0.67,23.49,-0.29,23.11,0,-0.98,0,1.43,-0.61,4.47,-1.06,7.27,-1.24,8.96,-1.03,14.25,-1.01,19.05,-0.75,22.22,-0.41,22.64,-0.13,-2.19,0,0.46,-0.41,3.63,-0.73,6.43,-0.86,7.97,-0.72,12.39,-0.88,16.88,-0.83,20.3,-0.66,21.47,-0.43,-3.24,0,-0.46,-0.2,2.74,-0.35,5.44,-0.41,6.74,-0.34,10.29,-0.7,14.47,-0.91,18.1,-0.96,20.04,-0.81,-4.37,0,-1.41,0,1.87,0,4.53,0,5.62,0,8.32,-0.54,12.18,-0.99,16.04,-1.23,18.74,-1.16]}]},{"name":"B_CLOTHES.23","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-14.99,0,-11.01,0,-6.6,0,-3.03,0,-1.56,0,-1.19,-0.1,-0.27,-0.33,0.85,-0.61,1.87,-0.87,-16.11,0.52,-12.6,0.38,-8.73,0.23,-5.59,0.11,-4.26,0.06,-3.59,-0.02,-1.93,-0.23,0.12,-0.48,1.97,-0.7,-17.34,1.09,-14.27,0.82,-10.89,0.51,-8.13,0.27,-6.91,0.16,-5.95,0.09,-3.56,-0.1,-0.6,-0.32,2.07,-0.51,-18.33,1.55,-15.79,1.15,-12.99,0.7,-10.7,0.33,-9.66,0.18,-8.39,0.12,-5.25,-0.03,-1.36,-0.21,2.15,-0.35,-18.74,1.74,-16.93,1.22,-14.93,0.65,-13.32,0.19,-12.65,0,-11.03,-0.03,-7.09,-0.11,-2.22,-0.2,2.19,-0.29,-19.24,2.16,-19.11,1.86,-17.41,1.51,-14.87,1.21,-12.19,1.03,-10.34,1.08,-6.24,1.19,-1.25,1.28,3.29,1.27,-19.44,2.72,-20.9,2.63,-19.41,2.48,-15.85,2.3,-11.07,2.12,-9.33,2.16,-5.49,2.24,-0.79,2.29,3.47,2.26,-19.53,3.33,-22.55,3.44,-21.24,3.48,-16.62,3.43,-9.69,3.24,-8.21,3.22,-4.77,3.18,-0.55,3.12,3.28,3.03,-19.68,3.91,-24.29,4.23,-23.17,4.47,-17.5,4.54,-8.43,4.34,-7.15,4.3,-4.04,4.18,-0.2,4.04,3.28,3.91]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[8.12,0,4.6,0.17,0.7,0.36,-2.45,0.52,-3.75,0.58,-3.2,0.45,-1.87,0.14,-0.23,-0.24,1.25,-0.58,9.42,0,6.49,0.14,3.26,0.3,0.64,0.43,-0.4,0.49,-0.44,0.39,-0.34,0.15,-0.18,-0.15,-0.05,-0.41,10.85,0,8.56,0.11,6,0.25,3.96,0.38,3.2,0.43,2.46,0.36,1.24,0.18,-0.17,-0.04,-1.48,-0.22,12.02,0,10.29,0.07,8.37,0.17,6.84,0.27,6.3,0.31,5.03,0.26,2.69,0.16,-0.09,0.03,-2.65,-0.06,12.49,0,11.2,0,9.76,0,8.6,0,8.12,0,6.89,0,3.9,0,0.21,0,-3.12,0,12.49,0,12.39,-0.29,11.65,-0.39,10.48,-0.29,9.08,0,7.93,0,4.76,0,0.79,0,-2.78,0,12.49,0,13.92,-0.59,14.21,-0.78,13.37,-0.59,11.4,0,10.07,0,6.51,0,2.06,0,-1.95,0,12.49,0,15.62,-0.89,17.09,-1.19,16.71,-0.89,14.27,0,12.66,0,8.62,0,3.6,0,-0.93,0,12.49,0,17.26,-1.19,19.84,-1.59,19.85,-1.19,16.87,0,15.02,0,10.54,0,5.01]}]},{"name":"B_CLOTHES.13","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":20,"value":[-3.96,0.6,-7.62,1.16,-8.54,1.27,-7.51,0.83,-5.19,0.01,-3.63,-0.26,-1.89,-0.1,0,0,0,0,-7.84,1.2,-15.1,2.32,-16.93,2.55,-14.92,1.71,-10.32,0.15,-7.23,-0.41,-3.75,-0.15,0,0,0,0,-10.41,1.54,-20.07,3.09,-22.75,3.45,-20.38,2.57,-14.05,0.74,-9.88,-0.02,-5.15,-0.02,0,0,0,0,-10.38,0.87,-20.01,1.73,-23.83,2,-23.61,1.5,-18,0.24,-13.37,-0.26,-6.96,-0.13,0,0,0,0,-9.89,0.12,-19.04,0.17,-23.79,0.32,-26.42,0.3,-22.41,-0.27,-17.47,-0.49,-9.08,-0.25,0,0,0,0,-8.4,-0.04,-16.15,-0.06,-20.13,0.08,-22.92,0.23,-20.32,0,-16.29,-0.13,-8.48,-0.07,0,0,0,0,-6.36,-0.15,-12.23,-0.28,-14.83,-0.2,-17.47,0.26,-17.42,0.54,-14.72,0.45,-7.66,0.23,0,0,0,0,-4.34,-0.27,-8.35,-0.52,-9.61,-0.5,-12.18,0.29,-14.75,1.08,-13.35,1.03,-6.94,0.54]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":20,"value":[2.08,-0.05,4.01,-0.13,4.54,-0.15,4.15,-0.08,3.76,-0.01,3.24,0,1.67,0,0,0,0,0,4.11,-0.08,7.91,-0.21,8.94,-0.23,8.1,-0.12,7.26,-0.01,6.27,0,3.24,0,0,0,0,0,6.43,-0.03,12.39,-0.12,13.82,-0.14,11.73,-0.15,9.63,-0.17,8.28,-0.14,4.29,-0.05,0,0,0,0,9.78,0.07,18.88,0.08,21.01,0.06,16.79,-0.07,12.56,-0.2,10.48,-0.18,5.42,-0.07,0,0,0,0,11.89,0.24,22.9,0.47,25.26,0.51,19.48,0.25,13.7,0,11.54,-0.02,5.99,-0.01,0,0,0,0,11.92,0.23,22.95,0.46,24.61,0.49,18.18,0.26,13.33,0.02,11.91,0,6.2,0,0,0,0,0,11.19,0.12,21.54,0.24,22.22,0.26,15.68,0.13,13.08,0.01,12.61,0,6.56,0,0,0,0,0,10.41,0,20.03,0,19.7,0,13.11,0,12.85,0,13.35,0,6.94]}]},{"name":"B_NECK.02","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-4.69},{"duration":60,"tweenEasing":0},{"x":4.06}]},{"name":"B_NECK.02","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-0.1},{"duration":61}]},{"name":"D_CLOTHES.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[0.03,-0.44,0.04,-0.34,0.04,2.86,0.8,2.68,0.42,-0.63,0.57,-1.33,0.41,-1.8,-0.44,-0.98,-0.56,-2.32,9.56,-1.05,3.03,-0.85,-1.7,-1.35,-1.94,-1.42,0.13,-0.84,-0.92,-2.12,-0.56,-2.1,0.58,-1.63,-1.17,-2.29,3.26,2.15,0.6,-1.7,0.78,-1.81,-0.45,-2.07,0.86,-1.83,0.65,-1.67,1.7,-1.78,0.34,-1.21,0.01,-0.61,0.03,-0.43,0.11,-0.34,0.28,-0.96,0.13,-0.86,-6.57,-8.4,0.03,-0.66,0.02,-0.56,0.07,-0.93,0.49,-1.39,0.03,-0.43,0.04,-0.29,0.04,-0.32,0.03,0.7,0.67,-1.49,0.74,-1.59,0.45,-1.23,0.13,-0.5,0.17,-0.57,0.33,-1.07,0.56,-1.35,0.42,-2.17,-0.19,-1.33,-8.01,2.02,-2.83,-5.46,-1.96,-5.44,-4.36,-0.91,-0.88,-1.17,-6.78,-7.61,-0.5,-2.03,-0.57,-0.55,-0.63,-2.01,0.72,-1.72,-4.78,-5.43,-0.88,-2.58,-1.3,-2.32,-0.62,-2.21,-0.2,-2.01,-1.28,-2.39,-0.81,-2.1,-0.13,-1.96,-0.22,-1.95,-0.48,-2.12,0.62,-1.69,-0.23,-1.87]},{"duration":60,"tweenEasing":0,"offset":141},{"value":[-0.01,1.04,-0.02,0.7,-0.02,3.57,-6.48,2.63,-0.04,1.49,-1.05,3.1,0.09,4.17,16.25,-3.46,17.89,5.58,14.69,7.15,20.51,11.76,6.31,-0.26,2.43,14.74,-0.33,2.19,2.16,4.56,6.72,3.12,13.62,3.47,2.99,5.21,14.71,8.79,-0.14,3.62,-3.99,4.77,9.84,1.91,0.03,3.96,-3.05,3.91,1.33,3.85,-0.19,3.09,-0.02,1.44,-0.02,1.01,-0.03,0.72,-0.92,2.43,0.04,1.47,-0.67,4.8,-0.01,1.56,-0.02,1.23,-0.55,2.19,-0.18,3.44,-0.02,1.02,-0.02,0.56,-0.02,0.81,-0.02,1.72,-0.49,3.51,-0.83,3.61,-0.63,3.03,-0.03,1.17,3.99,1.44,3.72,1.48,-0.56,3.24,9.15,0.87,14.1,5.6,2.18,15.99,-0.18,7.48,-3.43,9.68,-2.01,13.26,3.65,13.01,-4.43,3.73,0.78,3.92,6.85,-2.09,6,1,-0.13,3.71,-2.38,4.47,7.83,-1.46,3.19,5.14,12.41,5.14,14.6,3.79,3.68,5.7,4.54,3.8,-5.25,4.66,8.93,6.64,14.42,3.95,-6.06,7.91,-1.9,4.22]}]},{"name":"D_CLOTHES.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[11.69,4.17,0.05,0,0.05,0.03,-0.92,4.64,0.07,0.11,0.1,0.24,2.21,2.39,-5.45,10.3,1.28,-0.17,12.54,2.12,-3.04,-0.27,-1.53,-6.76,12.69,2.39,0.74,-0.03,0.31,0.07,0.49,3.4,-1.56,-0.76,11.39,1.93,1.47,0.2,0.66,0.22,-2.14,-0.31,0.07,0.09,3.96,1.13,0.06,0.1,-0.64,0.8,4.75,0.53,0.07,0.02,0.05,0.01,-1.34,2.2,-2.36,0,0.76,-0.04,0.16,0.11,0.45,0.05,0.17,0.08,-1.65,-0.88,4.43,-0.59,6.02,1.93,-0.35,0.09,-0.22,0.15,0.05,0.09,-2.29,1.87,0.63,10.29,3.37,5.16,0.67,0.29,1.25,5.74,-8.13,3.14,2.28,1.29,-1.72,-0.78,3.45,1.75,5.55,3.63,-1.05,-0.32,3.32,4.11,-2.88,3.93,-2.95,-0.45,-3.14,2.16,-2.55,4.75,0.45,-1.06,-2.94,1.27,0.66,-1.53,0.38,-0.69,0.3,0.09,1.32,-0.67,8.27,-0.11,2.66,-1.06]},{"duration":60,"tweenEasing":0,"offset":127},{"value":[11.59,4.33,-0.06,0.24,-0.13,0.48,4.35,-5.37,-9.94,-2.47,-7.92,-0.25,-1.94,6.7,-2.72,12.98,4.24,4.69,0.9,4.71,0,4.61,0.02,4.22,-0.24,3.39,-2.44,2.22,6.88,1.07,-0.23,3.89,0.6,3.98,4.55,3.3,-1.23,3.16,-2.86,1.96,-1.71,1.32,-17.96,-3.21,3.73,1.71,-9.08,-1.36,-1.09,1.28,4.52,0.92,-6.25,-0.47,-6.93,-0.74,1.54,5.68,2.05,3.8,-1.02,2.96,1.07,0.16,6.01,1.49,2.6,0.84,2.18,1.2,7.49,0.52,-2.66,2.54,-16.19,-1.28,-5.75,0.36,-1.51,1.64,-7.5,-1.31,-0.22,11.35,-5.32,6.6,-6.66,0.05,-1.09,6.91,-2.52,7.67,-0.46,0.54,0.01,4.34,-0.25,3.59,-0.45,3.49,0.55,3.6,-4,6.86,-5.35,10.56,0.95,-0.77,-1.58,4.7,-3.21,6.92,-2.16,2.59,-0.71,5.08,-2.18,2.59,4.76,1.91,-2.34,1.52,-1.23,3.44,-0.27,3.37,1.73,2.12]}]},{"name":"D_CLOTHES.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[24.14,5.84,0,0,0,0,0,0,0,0,-0.91,1.96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8.62,3.66]},{"duration":60,"tweenEasing":0,"offset":57},{"offset":10,"value":[-35.89,7.81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-17.74,0.01]}]},{"name":"B_BODY.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.9,-0.45,3.7,-0.24,-1.11,-0.04,-2.34,0.01,-2.34,0,-2.34,-0.01,-3.32,0.22,-7.13,1.12,-11.25,2.09,9.34,0.72,3.94,0.42,-1.05,0.1,-2.47,0.01,-3.42,-0.1,-4.38,-0.22,-5.24,-0.12,-8.33,0.34,-11.68,0.87,9.74,1.8,4.16,1.02,-1,0.23,-2.58,0,-4.42,-0.2,-6.27,-0.41,-7.03,-0.43,-9.45,-0.38,-12.08,-0.25,9.78,2.01,4.18,1.11,-1,0.26,-2.54,0.01,-4.71,-0.21,-6.88,-0.43,-7.65,-0.46,-9.81,-0.49,-12.15,-0.56,9.15,1.2,3.83,0.65,-1.09,0.16,-2.58,0.03,-5.02,0,-7.47,-0.03,-8.14,-0.12,-9.86,-0.44,-11.74,-0.77,8.51,0.39,3.47,0.2,-1.17,0.07,-2.61,0.04,-5.34,0.2,-8.06,0.37,-8.62,0.21,-9.91,-0.39,-11.32,-0.98,8.7,0.27,3.56,0.16,-1.19,0.06,-2.65,0.04,-5.04,0.2,-7.42,0.36,-8.06,0.21,-9.14,-0.36,-10.3,-0.89,9.7,0.13,4.1,0.08,-1.06,0.05,-2.51,0.03,-3.74,0.1,-4.97,0.18,-5.32,0.09,-5.88,-0.21,-6.48,-0.47,10.78,-0.03,4.7,0,-0.91,0.03,-2.35,0.03,-2.34,0,-2.33,-0.02,-2.34,-0.03,-2.35,-0.04,-2.34,-0.01]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[4.22,-0.01,4.22,-0.01,4.22,-0.02,4.22,-0.02,4.22,0,4.21,0.01,1.86,0,-7.36,-0.03,-17.34,-0.05,4.22,-0.02,4.22,-0.02,4.22,-0.03,4.08,-0.02,3.03,0.08,1.97,0.18,-0.06,0.16,-7.93,0.03,-16.47,-0.09,4.22,-0.03,4.22,-0.03,4.22,-0.04,3.96,-0.03,1.93,0.16,-0.11,0.34,-1.87,0.31,-8.49,0.09,-15.67,-0.13,4.22,-0.05,4.22,-0.04,4.22,-0.06,3.97,-0.04,1.75,0.17,-0.47,0.37,-2.24,0.35,-8.63,0.11,-15.55,-0.13,4.22,-0.06,4.22,-0.06,4.22,-0.07,4.11,-0.05,2.93,0.08,1.74,0.21,-0.35,0.2,-8.08,0.04,-16.42,-0.14,4.22,-0.07,4.21,-0.07,4.22,-0.06,4.25,-0.04,4.1,0,3.95,0.03,1.53,0.04,-7.53,-0.04,-17.29,-0.16,4.22,-0.06,4.21,-0.07,4.22,-0.06,4.22,-0.04,4.21,-0.01,4.2,0.01,1.78,0.02,-7.26,-0.04,-17.02,-0.15,4.22,-0.04,4.22,-0.06,4.22,-0.07,4.22,-0.05,4.22,-0.01,4.2,0.02,1.98,0.03,-6.47,-0.01,-15.59,-0.1,4.22,-0.02,4.22,-0.06,4.22,-0.07,4.22,-0.05,4.21,0,4.2,0.04,2.21,0.05,-5.59,0.03,-14.05,-0.05]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.38","timeline":[{"name":"B_CLOTHES.38_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.38_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.38_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.38_00","timeline":[{"name":"B_CLOTHES.38","type":12,"frame":[{"duration":121,"x":-1.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.38_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.38_02","timeline":[{"name":"B_CLOTHES.38","type":12,"frame":[{"duration":121,"x":5.4}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.39","timeline":[{"name":"B_CLOTHES.39_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.39_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.39_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.39_00","timeline":[{"name":"B_CLOTHES.39","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":26.5,"y":2.97},{"duration":60,"tweenEasing":0},{"x":-19.88,"y":-2.23}]},{"name":"B_CLOTHES.39","type":12,"frame":[{"duration":121,"x":6.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.39_01","timeline":[{"name":"B_CLOTHES.39","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":38.5,"y":3.57},{"duration":60,"tweenEasing":0},{"x":-27.88,"y":-2.59}]},{"name":"B_CLOTHES.39","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":-1.7}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.39_02","timeline":[{"name":"B_CLOTHES.39","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":29.33,"y":-0.05},{"duration":60,"tweenEasing":0},{"x":-24,"y":0.04}]},{"name":"B_CLOTHES.39","type":12,"frame":[{"duration":121,"x":-15.1}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.63","timeline":[{"name":"B_CLOTHES.63_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.63_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.63_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.63_00","timeline":[{"name":"B_CLOTHES.63","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":26.5,"y":2.97},{"duration":60,"tweenEasing":0},{"x":-19.88,"y":-2.23}]},{"name":"B_CLOTHES.63","type":12,"frame":[{"duration":121,"x":6.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.63_01","timeline":[{"name":"B_CLOTHES.63","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":38.5,"y":3.57},{"duration":60,"tweenEasing":0},{"x":-27.88,"y":-2.59}]},{"name":"B_CLOTHES.63","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":-1.7}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.63_02","timeline":[{"name":"B_CLOTHES.63","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":29.33,"y":-0.05},{"duration":60,"tweenEasing":0},{"x":-24,"y":0.04}]},{"name":"B_CLOTHES.63","type":12,"frame":[{"duration":121,"x":-15.1}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.62","timeline":[{"name":"B_CLOTHES.62_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.62_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.62_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.62_00","timeline":[{"name":"B_CLOTHES.62","type":12,"frame":[{"duration":121,"x":-1.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.62_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.62_02","timeline":[{"name":"B_CLOTHES.62","type":12,"frame":[{"duration":121,"x":5.4}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_REF.BODY","timeline":[{"name":"D_REF.BODY_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_REF.BODY_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_REF.BODY_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_REF.BODY_00","timeline":[{"name":"D_REF.BODY","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-54,64.99,-26,64.76,0,1.19,0,1.47]},{"duration":60,"tweenEasing":0,"offset":1,"value":[40.63,0,40.23,0,1.93,0,2.42]},{"value":[54,64.63,54,64.23,0,1.94,0,2.42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_REF.BODY_01","timeline":[{"name":"D_REF.BODY","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-54,40,-32,40]},{"duration":60,"tweenEasing":0,"offset":7},{"value":[32,24,54,24]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_REF.BODY_02","timeline":[{"name":"D_REF.BODY","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-54,20.79,-34,20.99,0,-0.91,0,-1.15]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-9.6,0,-9.51,0,-0.46,0,-0.57]},{"value":[34,14.4,54,14.49,0,-0.46,0,-0.57]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_FACESHADOW.01","timeline":[{"name":"B_FACESHADOW.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_FACESHADOW.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_FACESHADOW.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_FACESHADOW.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_FACESHADOW.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_00","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-104.32,-16.06,-90.4,-52.76,-76.2,-88.24,-58.56,-102.73,-40.07,-81.07,-29.17,-62.49,-29.93,-61.89,-36.2,-54.85,-42.99,-46.87,-90.9,-18.06,-80.86,-54.37,-70.96,-89.24,-58.37,-105.73,-45.4,-89.2,-36.92,-70.2,-37.07,-63.47,-40.87,-55.52,-44.84,-47.21,-78.49,-19.92,-72.06,-55.95,-66.1,-90.66,-58.34,-108.96,-50.81,-97.36,-44.75,-77.78,-44.27,-64.87,-45.48,-56.11,-46.55,-47.52,-74.93,-18.73,-69.64,-55.69,-63.86,-91.83,-58.96,-112.35,-54.92,-103.75,-50.33,-82.5,-49.46,-67.08,-48.22,-55.55,-47.11,-47.57,-67.32,-13.01,-63.18,-49.68,-58.61,-85.57,-55.09,-107.86,-52.4,-102.58,-49.15,-82.38,-49.41,-73.11,-48.92,-54.05,-48.82,-47.74,-57.47,-5.47,-55.01,-42.07,-52.5,-77.98,-50.68,-102.34,-49.59,-100.76,-47.95,-82.07,-49.62,-79.52,-50.78,-53.63,-52.22,-49.58,-56.25,4.41,-54.36,-33.35,-52.03,-71.1,-50.57,-97.13,-49.93,-97.54,-49.04,-81.07,-52.25,-77.94,-55.64,-53.34,-58.8,-47.36,-53.87,11.7,-53.12,-26.62,-52.01,-65.79,-50.99,-92.23,-52.46,-93.42,-54.08,-79.01,-58.59,-72.13,-62.89,-54.45,-66.87,-45.67,-50.99,18.61,-51.52,-20.22,-51.83,-60.78,-51.33,-87.51,-55.15,-89.39,-59.54,-76.93,-65.3,-66.4,-70.31,-55.8,-74.99,-44.45]},{"duration":60,"tweenEasing":0,"value":[-54.66,-16.06,-40.73,-52.76,-26.53,-88.24,-8.9,-102.73,9.6,-81.07,20.49,-62.49,19.74,-61.89,13.47,-54.85,6.68,-46.87,-41.23,-18.06,-31.19,-54.37,-21.3,-89.24,-8.71,-105.73,4.27,-89.2,12.75,-70.2,12.6,-63.47,8.79,-55.52,4.83,-47.21,-28.83,-19.92,-22.39,-55.95,-16.44,-90.66,-8.67,-108.96,-1.15,-97.36,4.92,-77.78,5.39,-64.87,4.18,-56.11,3.12,-47.52,-25.26,-18.77,-19.97,-55.7,-14.19,-91.82,-9.29,-112.35,-5.26,-103.75,-0.66,-82.5,0.21,-67.08,1.45,-55.55,2.56,-47.57,-17.65,-13.51,-13.51,-49.94,-8.94,-85.63,-5.42,-107.86,-2.73,-102.58,0.52,-82.38,0.26,-73.11,0.74,-54.05,0.84,-47.74,-7.8,-6.43,-5.35,-42.59,-2.84,-78.09,-1.02,-102.34,0.08,-100.76,1.72,-82.07,0.05,-79.52,-1.11,-53.63,-2.55,-49.58,-6.17,1.49,-4.41,-34.93,-2.3,-71.47,-0.9,-97.13,-0.27,-97.54,0.63,-81.07,-2.58,-77.94,-5.97,-53.34,-9.13,-47.36,-3.94,6.69,-3.28,-29.23,-2.3,-66.35,-1.32,-92.23,-2.79,-93.42,-4.41,-79.01,-8.92,-72.13,-13.22,-54.45,-17.2,-45.67,-1.32,11.61,-1.85,-23.8,-2.17,-61.49,-1.67,-87.51,-5.49,-89.39,-9.87,-76.93,-15.63,-66.4,-20.64,-55.8,-25.32,-44.45]},{"value":[-31.99,-16.06,-18.07,-52.76,-3.86,-88.24,13.77,-102.73,32.26,-81.07,43.16,-62.49,42.41,-61.89,36.13,-54.85,29.35,-46.87,-18.56,-18.06,-8.52,-54.37,1.37,-89.24,13.96,-105.73,26.94,-89.2,35.42,-70.2,35.26,-63.47,31.46,-55.52,27.49,-47.21,-6.16,-19.92,0.28,-55.95,6.23,-90.66,14,-108.96,21.52,-97.36,27.58,-77.78,28.06,-64.87,26.85,-56.11,25.78,-47.52,-2.59,-18.77,2.7,-55.7,8.47,-91.82,13.38,-112.35,17.41,-103.75,22,-82.5,22.87,-67.08,24.11,-55.55,25.22,-47.57,5.01,-13.51,9.15,-49.94,13.72,-85.63,17.24,-107.86,19.94,-102.58,23.18,-82.38,22.92,-73.11,23.41,-54.05,23.51,-47.74,14.87,-6.43,17.32,-42.59,19.83,-78.09,21.65,-102.34,22.75,-100.76,24.39,-82.07,22.72,-79.52,21.56,-53.63,20.11,-49.58,16.5,1.49,18.26,-34.93,20.37,-71.47,21.76,-97.13,22.4,-97.54,23.3,-81.07,20.08,-77.94,16.7,-53.34,13.53,-47.36,18.72,6.69,19.39,-29.23,20.36,-66.35,21.34,-92.23,19.87,-93.42,18.26,-79.01,13.74,-72.13,9.45,-54.45,5.46,-45.67,21.34,11.61,20.82,-23.8,20.5,-61.49,21,-87.51,17.18,-89.39,12.8,-76.93,7.03,-66.4,2.02,-55.8,-2.66,-44.45]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_01","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-49.67,-19.72,-49.67,-24.72,-49.67,-29.67,-49.67,-33.77,-49.67,-33.32,-49.67,-32.86,-49.67,-36.08,-49.67,-37.6,-49.67,-38.87,-50.37,-12.84,-50,-23.48,-49.73,-33.66,-49.67,-38.88,-49.67,-36.24,-49.67,-33.59,-49.67,-36.35,-49.67,-37.3,-49.67,-37.97,-51.2,-5.71,-50.42,-21.93,-49.81,-37.27,-49.67,-43.63,-49.67,-38.93,-49.67,-34.24,-49.67,-36.61,-49.67,-37.03,-49.67,-37.14,-52.51,3.06,-51.29,-17.93,-50.05,-37.67,-49.72,-45.19,-49.65,-39.71,-49.59,-34.22,-49.77,-38.03,-49.66,-36.33,-49.67,-37.01,-51.5,9.4,-50.96,-15.42,-50.46,-38.74,-50.26,-47.2,-49.5,-40.56,-48.74,-33.92,-49.53,-41.83,-49.44,-34.61,-49.67,-37.9,-50.49,14.48,-50.63,-13.75,-50.87,-40.21,-50.81,-49.22,-49.35,-41.42,-47.89,-33.63,-49.28,-45.61,-49.21,-32.89,-49.67,-38.79,-50.56,20.89,-50.78,-10.21,-50.96,-39.29,-50.87,-48.93,-49.44,-41.48,-48.02,-34.03,-49.22,-44.64,-49.24,-33.95,-49.67,-39.19,-50.13,28.06,-50.54,-5.53,-50.91,-36.92,-50.9,-47.29,-49.87,-41.4,-48.84,-35.51,-49.41,-42.18,-49.44,-37.39,-49.67,-40.44,-49.67,35.28,-50.28,-0.78,-50.85,-34.44,-50.94,-45.52,-50.33,-41.31,-49.72,-37.09,-49.67,-39.86,-49.67,-40.96,-49.67,-41.78]},{"duration":60,"tweenEasing":0,"offset":1,"value":[4.28,0,-11.83,0,-27.05,0,-33.77,0,-33.32,0,-32.86,0,-36.08,0,-37.6,0,-38.87,-1.23,2.43,-0.7,-15.25,-0.15,-31.94,0,-38.88,0,-36.24,0,-33.59,0,-36.35,0,-37.3,0,-37.97,-2.37,0.71,-1.33,-18.43,-0.28,-36.49,0,-43.63,0,-38.93,0,-34.24,0,-36.61,0,-37.03,0,-37.14,-2.55,0.45,-1.44,-19.45,-0.34,-38.15,-0.05,-45.19,0.01,-39.71,0.08,-34.22,-0.1,-38.03,0.01,-36.33,0,-37.01,-1.33,2.28,-1.02,-19.39,-0.74,-39.74,-0.6,-47.2,0.17,-40.56,0.93,-33.92,0.14,-41.83,0.23,-34.61,0,-37.9,-0.11,4.1,-0.6,-19.32,-1.13,-41.33,-1.14,-49.22,0.32,-41.42,1.78,-33.63,0.39,-45.61,0.45,-32.89,0,-38.79,0,4.28,-0.62,-19.12,-1.19,-41.1,-1.2,-48.93,0.22,-41.48,1.65,-34.03,0.45,-44.64,0.43,-33.95,0,-39.19,0,4.28,-0.62,-18.3,-1.19,-39.52,-1.24,-47.29,-0.2,-41.4,0.83,-35.51,0.25,-42.18,0.23,-37.39,0,-40.44,0,4.28,-0.62,-17.43,-1.19,-37.83,-1.28,-45.52,-0.67,-41.31,-0.06,-37.09,0,-39.86,0,-40.96,0,-41.78]},{"value":[22.67,4.28,22.67,-11.83,22.67,-27.05,22.67,-33.77,22.67,-33.32,22.67,-32.86,22.67,-36.08,22.67,-37.6,22.67,-38.87,21.43,2.43,21.97,-15.25,22.52,-31.94,22.67,-38.88,22.67,-36.24,22.67,-33.59,22.67,-36.35,22.67,-37.3,22.67,-37.97,20.29,0.71,21.33,-18.43,22.39,-36.49,22.67,-43.63,22.67,-38.93,22.67,-34.24,22.67,-36.61,22.67,-37.03,22.67,-37.14,20.11,0.45,21.22,-19.45,22.32,-38.15,22.62,-45.19,22.68,-39.71,22.75,-34.22,22.56,-38.03,22.67,-36.33,22.67,-37.01,21.33,2.28,21.64,-19.39,21.93,-39.74,22.07,-47.2,22.83,-40.56,23.6,-33.92,22.81,-41.83,22.9,-34.61,22.67,-37.9,22.55,4.1,22.06,-19.32,21.53,-41.33,21.53,-49.22,22.99,-41.42,24.44,-33.63,23.05,-45.61,23.12,-32.89,22.67,-38.79,22.67,4.28,22.05,-19.12,21.48,-41.1,21.47,-48.93,22.89,-41.48,24.31,-34.03,23.12,-44.64,23.1,-33.95,22.67,-39.19,22.67,4.28,22.05,-18.3,21.48,-39.52,21.43,-47.29,22.46,-41.4,23.5,-35.51,22.92,-42.18,22.89,-37.39,22.67,-40.44,22.67,4.28,22.05,-17.43,21.48,-37.83,21.39,-45.52,22,-41.31,22.61,-37.09,22.67,-39.86,22.67,-40.96,22.67,-41.78]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_02","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67,0,-49.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67,0,22.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_03","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-49.67,29.2,-49.67,40.11,-49.67,50.31,-49.62,53.72,-49.17,52.35,-48.71,50.99,-48.78,45.11,-49.2,18.96,-49.67,-9.46,-49.67,29.2,-49.67,40.11,-49.67,50.31,-49.52,54.92,-49.12,54.92,-49.03,51.76,-49.29,45.42,-49.93,21.42,-50.59,-4.72,-49.67,29.2,-49.67,40.11,-49.67,50.31,-49.42,56.12,-49.05,57.49,-49.32,52.57,-49.77,45.63,-50.59,23.64,-51.45,-0.34,-49.67,29.2,-49.67,40.14,-49.67,50.36,-49.38,57.1,-49,59.6,-49.38,53.42,-49.88,44.99,-50.69,23.53,-51.49,0.25,-49.67,29.2,-49.67,40.35,-49.67,50.76,-49.49,57.89,-49.26,60.81,-49.49,54.22,-49.67,42.98,-49.67,19.61,-49.67,-5.34,-49.67,29.2,-49.67,40.56,-49.67,51.17,-49.6,58.68,-49.52,62.02,-49.6,55.01,-49.45,40.99,-48.63,15.7,-47.84,-10.94,-49.67,29.2,-49.67,40.71,-49.67,51.46,-49.54,59.12,-49.37,62.37,-49.54,54.94,-49.46,40.61,-48.67,15.23,-47.89,-11.47,-49.67,29.2,-49.67,41.11,-49.67,52.22,-49.38,59.91,-49.02,62.4,-49.38,54.16,-49.56,40.17,-49.14,15.03,-48.74,-11.49,-49.67,29.2,-49.67,41.53,-49.67,53.04,-49.23,60.75,-48.67,62.42,-49.23,53.34,-49.67,39.68,-49.67,14.8,-49.67,-11.51]},{"duration":60,"tweenEasing":0,"offset":1,"value":[29.2,0,40.11,0,50.31,0.04,53.72,0.5,52.35,0.96,50.99,0.89,45.11,0.46,18.96,0,-9.46,0,29.2,0,40.11,0,50.31,0.15,54.92,0.55,54.92,0.64,51.76,0.37,45.42,-0.26,21.42,-0.93,-4.72,0,29.2,0,40.11,0,50.31,0.25,56.12,0.62,57.49,0.35,52.57,-0.1,45.63,-0.92,23.64,-1.78,-0.34,0,29.2,0,40.14,0,50.36,0.29,57.1,0.66,59.6,0.29,53.42,-0.21,44.99,-1.03,23.53,-1.83,0.25,0,29.2,0,40.35,0,50.76,0.18,57.89,0.41,60.81,0.18,54.22,0,42.98,0,19.61,0,-5.34,0,29.2,0,40.56,0,51.17,0.06,58.68,0.15,62.02,0.06,55.01,0.22,40.99,1.03,15.7,1.83,-10.94,0,29.2,0,40.71,0,51.46,0.13,59.12,0.3,62.37,0.13,54.94,0.21,40.61,1,15.23,1.78,-11.47,0,29.2,0,41.11,0,52.22,0.28,59.91,0.65,62.4,0.28,54.16,0.11,40.17,0.52,15.03,0.93,-11.49,0,29.2,0,41.53,0,53.04,0.44,60.75,1,62.42,0.44,53.34,0,39.68,0,14.8,0,-11.51]},{"value":[22.67,29.2,22.67,40.11,22.67,50.31,22.71,53.72,23.17,52.35,23.62,50.99,23.56,45.11,23.13,18.96,22.67,-9.46,22.67,29.2,22.67,40.11,22.67,50.31,22.81,54.92,23.22,54.92,23.3,51.76,23.04,45.42,22.41,21.42,21.74,-4.72,22.67,29.2,22.67,40.11,22.67,50.31,22.92,56.12,23.28,57.49,23.02,52.57,22.56,45.63,21.74,23.64,20.89,-0.34,22.67,29.2,22.67,40.14,22.67,50.36,22.96,57.1,23.33,59.6,22.96,53.42,22.45,44.99,21.64,23.53,20.84,0.25,22.67,29.2,22.67,40.35,22.67,50.76,22.84,57.89,23.07,60.81,22.84,54.22,22.67,42.98,22.67,19.61,22.67,-5.34,22.67,29.2,22.67,40.56,22.67,51.17,22.73,58.68,22.82,62.02,22.73,55.01,22.88,40.99,23.7,15.7,24.49,-10.94,22.67,29.2,22.67,40.71,22.67,51.46,22.8,59.12,22.96,62.37,22.8,54.94,22.87,40.61,23.67,15.23,24.45,-11.47,22.67,29.2,22.67,41.11,22.67,52.22,22.95,59.91,23.31,62.4,22.95,54.16,22.78,40.17,23.19,15.03,23.59,-11.49,22.67,29.2,22.67,41.53,22.67,53.04,23.1,60.75,23.66,62.42,23.1,53.34,22.67,39.68,22.67,14.8,22.67,-11.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_FACESHADOW.01_04","timeline":[{"name":"B_FACESHADOW.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-45.72,62.2,-47.59,83.3,-49.32,102.9,-49.72,108.72,-49.26,107.35,-48.8,105.99,-49.82,92.94,-51.91,64.55,-54.74,36.54,-47.11,61.27,-48.38,82.79,-49.48,102.78,-49.62,110.03,-49.21,110.85,-49.13,108.51,-50.25,91.96,-51.65,60.79,-54.11,31.25,-48.39,60.42,-49.09,82.32,-49.63,102.68,-49.51,111.33,-49.15,114.29,-49.42,110.94,-50.67,91.04,-51.4,57.27,-53.53,26.36,-48.85,60.37,-49.24,82.32,-49.65,102.71,-49.47,112.3,-49.1,116.53,-49.48,112.07,-50.82,89.93,-51.37,55.21,-53.19,23.83,-50.22,62.19,-50.01,83.53,-49.81,103.36,-49.58,112.98,-49.36,116.81,-49.59,111.13,-50.49,86.68,-50.46,51.58,-51.06,18.4,-51.6,64.02,-50.78,84.75,-49.97,104,-49.7,113.65,-49.61,117.09,-49.7,110.2,-50.06,82.9,-49.18,46.73,-48.36,11.01,-52.6,63.75,-51.13,84.77,-50.02,104.28,-49.62,114.34,-49.39,116.52,-49.49,107.82,-49.75,79.27,-48.48,41.42,-47.24,3.47,-56.02,62.04,-53.02,84.23,-50.42,104.84,-49.45,114.68,-48.75,112.5,-48.79,99.46,-49.36,70.92,-48.56,32.88,-47.73,-5.4,-59.72,60.18,-55.11,83.63,-50.85,105.42,-49.27,114.95,-48.1,108.08,-48.04,90.47,-48.97,62,-48.75,23.94,-48.38,-14.51]},{"duration":60,"tweenEasing":0,"value":[3.94,62.2,2.07,83.3,0.35,102.9,-0.05,108.72,0.4,107.35,0.86,105.99,0.13,91.95,-0.85,59.62,-2.41,27.21,2.56,61.27,1.29,82.79,0.18,102.78,0.05,110.03,0.45,110.85,0.54,108.51,-0.52,91.49,-1.6,57.9,-3.63,25.62,1.27,60.42,0.58,82.32,0.03,102.68,0.16,111.33,0.52,114.29,0.25,110.94,-1.13,91.01,-2.27,56.24,-4.76,24.15,0.82,60.37,0.43,82.32,0.02,102.71,0.2,112.3,0.57,116.53,0.19,112.07,-1.27,90.17,-2.35,54.92,-4.75,22.74,-0.56,62.19,-0.34,83.53,-0.15,103.36,0.08,112.98,0.31,116.81,0.08,111.13,-0.79,88.76,-0.8,53.96,-1.56,20.57,-1.93,64.02,-1.12,84.75,-0.31,104,-0.03,113.65,0.05,117.09,-0.03,110.2,-0.32,87.61,0.75,53.54,1.64,19.24,-2.94,63.75,-1.46,84.77,-0.35,104.28,0.03,114.16,0.2,117.19,0.04,109.48,-0.23,86.1,0.6,50.45,1.72,14.16,-6.35,62.04,-3.36,84.23,-0.75,104.84,0.19,114.86,0.55,116.35,0.19,107.09,-0.23,83.11,0.01,45.68,0.87,7.78,-10.05,60.18,-5.44,83.63,-1.19,105.42,0.34,115.58,0.9,115.42,0.35,104.51,-0.25,80.02,-0.62,40.9,-0.05,1.49]},{"value":[26.61,62.2,24.74,83.3,23.01,102.9,22.61,108.72,23.07,107.35,23.53,105.99,21.41,83.67,17.71,46.13,13.59,14.54,25.22,61.27,23.96,82.79,22.85,102.78,22.72,110.03,23.12,110.85,23.21,108.51,21.16,85.35,17.88,47.13,13.61,13.72,23.94,60.42,23.24,82.32,22.7,102.68,22.82,111.33,23.19,114.29,22.92,110.94,20.94,86.95,18.07,48.12,13.62,12.97,23.48,60.37,23.1,82.32,22.68,102.71,22.86,112.3,23.23,116.53,22.86,112.07,20.99,87.64,18.32,48.47,14.15,11.74,22.11,62.19,22.32,83.53,22.52,103.36,22.75,112.98,22.98,116.81,22.75,111.13,21.74,86.82,21.17,47.7,19.61,9.4,20.74,64.02,21.55,84.75,22.36,104,22.64,113.65,22.72,117.09,22.64,110.2,22.4,86.16,23.64,47.11,24.51,7.35,19.73,63.75,21.21,84.77,22.31,104.28,22.7,114.16,22.87,117.19,22.7,109.48,22.48,85.27,23.37,46.72,24.28,7.08,16.31,62.04,19.31,84.23,21.92,104.84,22.85,114.86,23.22,116.35,22.86,107.09,22.49,83.33,22.75,46.74,23,9.2,12.61,60.18,17.22,83.63,21.48,105.42,23.01,115.58,23.57,115.42,23.01,104.51,22.48,81.28,22.07,46.8,21.62,11.49]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HOHO.01","timeline":[{"name":"B_HOHO.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HOHO.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HOHO.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HOHO.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_00","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-16.64,18.74,-22.42,18.62,-28.26,18.48,-33.96,18.36,-39.3,18.32,-44.13,18.36,-48.6,18.48,-52.92,18.62,-57.31,18.74,-16.64,18.74,-22.39,18.65,-28.2,18.55,-33.88,18.48,-39.2,18.44,-44.04,18.48,-48.54,18.55,-52.89,18.65,-57.31,18.74,-16.64,18.74,-22.36,18.69,-28.14,18.64,-33.78,18.6,-39.09,18.58,-43.95,18.6,-48.47,18.64,-52.86,18.69,-57.31,18.74,-16.64,18.74,-22.33,18.72,-28.08,18.71,-33.71,18.7,-39,18.7,-43.87,18.7,-48.42,18.71,-52.83,18.72,-57.31,18.74,-16.64,18.74,-22.32,18.74,-28.05,18.74,-33.67,18.74,-38.97,18.74,-43.83,18.74,-48.39,18.74,-52.82,18.74,-57.31,18.74,-16.64,18.74,-22.3,18.74,-28.03,18.74,-33.63,18.74,-38.93,18.74,-43.8,18.74,-48.36,18.74,-52.81,18.74,-57.31,18.74,-16.64,18.74,-22.28,18.74,-27.97,18.74,-33.55,18.74,-38.84,18.74,-43.72,18.74,-48.31,18.74,-52.78,18.74,-57.31,18.74,-16.64,18.74,-22.25,18.74,-27.91,18.74,-33.46,18.74,-38.73,18.74,-43.62,18.74,-48.24,18.74,-52.75,18.74,-57.31,18.74,-16.64,18.74,-22.22,18.74,-27.85,18.74,-33.37,18.74,-38.64,18.74,-43.54,18.74,-48.18,18.74,-52.72,18.74,-57.31,18.74]},{"duration":60,"tweenEasing":0,"value":[-17.51,0,-23.28,-0.13,-29.13,-0.27,-34.83,-0.38,-40.16,-0.43,-44.99,-0.38,-49.46,-0.27,-53.78,-0.13,-58.18,0,-17.51,0,-23.25,-0.09,-29.07,-0.19,-34.74,-0.27,-40.07,-0.3,-44.91,-0.27,-49.4,-0.19,-53.75,-0.09,-58.18,0,-17.51,0,-23.22,-0.05,-29,-0.11,-34.65,-0.14,-39.96,-0.16,-44.81,-0.14,-49.34,-0.11,-53.72,-0.05,-58.18,0,-17.51,0,-23.19,-0.02,-28.95,-0.04,-34.57,-0.04,-39.87,-0.05,-44.74,-0.04,-49.28,-0.04,-53.7,-0.02,-58.18,0,-17.51,0,-23.18,0,-28.92,0,-34.53,0,-39.83,0,-44.7,0,-49.25,0,-53.68,0,-58.18,0,-17.51,0,-23.17,0,-28.89,0,-34.49,0,-39.8,0,-44.66,0,-49.22,0,-53.67,0,-58.18,0,-17.51,0,-23.14,0,-28.84,0,-34.41,0,-39.71,0,-44.58,0,-49.17,0,-53.64,0,-58.18,0,-17.51,0,-23.11,0,-28.77,0,-34.32,0,-39.6,0,-44.49,0,-49.11,0,-53.61,0,-58.18,0,-17.51,0,-23.08,0,-28.71,0,-34.24,0,-39.5,0,-44.4,0,-49.05,0,-53.59,0,-58.18]},{"value":[-15.78,-11.93,-21.55,-12.05,-27.4,-12.19,-33.1,-12.31,-38.44,-12.35,-43.27,-12.31,-47.73,-12.19,-52.05,-12.05,-56.45,-11.93,-15.78,-11.93,-21.52,-12.02,-27.34,-12.12,-33.01,-12.2,-38.34,-12.23,-43.18,-12.2,-47.67,-12.12,-52.03,-12.02,-56.45,-11.93,-15.78,-11.93,-21.49,-11.98,-27.27,-12.03,-32.92,-12.07,-38.23,-12.09,-43.09,-12.07,-47.61,-12.03,-51.99,-11.98,-56.45,-11.93,-15.78,-11.93,-21.47,-11.95,-27.22,-11.96,-32.84,-11.97,-38.14,-11.97,-43.01,-11.97,-47.55,-11.96,-51.97,-11.95,-56.45,-11.93,-15.78,-11.93,-21.45,-11.93,-27.19,-11.93,-32.8,-11.93,-38.1,-11.93,-42.97,-11.93,-47.53,-11.93,-51.96,-11.93,-56.45,-11.93,-15.78,-11.93,-21.44,-11.93,-27.16,-11.93,-32.76,-11.93,-38.07,-11.93,-42.93,-11.93,-47.5,-11.93,-51.94,-11.93,-56.45,-11.93,-15.78,-11.93,-21.41,-11.93,-27.11,-11.93,-32.69,-11.93,-37.98,-11.93,-42.85,-11.93,-47.44,-11.93,-51.92,-11.93,-56.45,-11.93,-15.78,-11.93,-21.38,-11.93,-27.04,-11.93,-32.59,-11.93,-37.87,-11.93,-42.76,-11.93,-47.38,-11.93,-51.89,-11.93,-56.45,-11.93,-15.78,-11.93,-21.36,-11.93,-26.98,-11.93,-32.51,-11.93,-37.77,-11.93,-42.67,-11.93,-47.32,-11.93,-51.86,-11.93,-56.45,-11.93]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_01","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-8.64,20.45,-11.91,20.32,-15.26,20.18,-18.43,20.07,-21.13,20.02,-23.16,20.07,-24.72,20.18,-26.1,20.32,-27.57,20.45,-8.64,20.45,-11.87,20.36,-15.19,20.26,-18.32,20.18,-21,20.15,-23.05,20.18,-24.65,20.26,-26.06,20.36,-27.57,20.45,-8.64,20.45,-11.83,20.39,-15.1,20.34,-18.2,20.3,-20.86,20.29,-22.93,20.3,-24.56,20.34,-26.02,20.39,-27.57,20.45,-8.64,20.45,-11.8,20.42,-15.03,20.41,-18.1,20.4,-20.74,20.4,-22.83,20.4,-24.49,20.41,-25.99,20.42,-27.57,20.45,-8.64,20.45,-11.78,20.45,-14.99,20.45,-18.05,20.45,-20.7,20.45,-22.78,20.45,-24.45,20.45,-25.97,20.45,-27.57,20.45,-8.64,20.45,-11.76,20.45,-14.96,20.45,-18,20.45,-20.65,20.45,-22.73,20.45,-24.42,20.45,-25.95,20.45,-27.57,20.45,-8.64,20.45,-11.73,20.45,-14.89,20.45,-17.9,20.45,-20.53,20.45,-22.63,20.45,-24.35,20.45,-25.92,20.45,-27.57,20.45,-8.64,20.45,-11.69,20.45,-14.8,20.45,-17.77,20.45,-20.39,20.45,-22.5,20.45,-24.26,20.45,-25.88,20.45,-27.57,20.45,-8.64,20.45,-11.65,20.45,-14.72,20.45,-17.66,20.45,-20.26,20.45,-22.39,20.45,-24.18,20.45,-25.84,20.45,-27.57,20.45]},{"duration":60,"tweenEasing":0,"value":[-8.64,0,-11.91,-0.13,-15.26,-0.27,-18.43,-0.38,-21.13,-0.43,-23.16,-0.38,-24.72,-0.27,-26.1,-0.13,-27.57,0,-8.64,0,-11.87,-0.09,-15.19,-0.19,-18.32,-0.27,-21,-0.3,-23.05,-0.27,-24.65,-0.19,-26.06,-0.09,-27.57,0,-8.64,0,-11.83,-0.05,-15.1,-0.11,-18.2,-0.14,-20.86,-0.16,-22.93,-0.14,-24.56,-0.11,-26.02,-0.05,-27.57,0,-8.64,0,-11.8,-0.02,-15.03,-0.04,-18.1,-0.04,-20.74,-0.05,-22.83,-0.04,-24.49,-0.04,-25.99,-0.02,-27.57,0,-8.64,0,-11.78,0,-14.99,0,-18.05,0,-20.7,0,-22.78,0,-24.45,0,-25.97,0,-27.57,0,-8.64,0,-11.76,0,-14.96,0,-18,0,-20.65,0,-22.73,0,-24.42,0,-25.95,0,-27.57,0,-8.64,0,-11.73,0,-14.89,0,-17.9,0,-20.53,0,-22.63,0,-24.35,0,-25.92,0,-27.57,0,-8.64,0,-11.69,0,-14.8,0,-17.77,0,-20.39,0,-22.5,0,-24.26,0,-25.88,0,-27.57,0,-8.64,0,-11.65,0,-14.72,0,-17.66,0,-20.26,0,-22.39,0,-24.18,0,-25.84,0,-27.57]},{"value":[-8.64,-15.34,-11.91,-15.46,-15.26,-15.6,-18.43,-15.71,-21.13,-15.76,-23.16,-15.71,-24.72,-15.6,-26.1,-15.46,-27.57,-15.34,-8.64,-15.34,-11.87,-15.43,-15.19,-15.53,-18.32,-15.6,-21,-15.64,-23.05,-15.6,-24.65,-15.53,-26.06,-15.43,-27.57,-15.34,-8.64,-15.34,-11.83,-15.39,-15.1,-15.44,-18.2,-15.48,-20.86,-15.5,-22.93,-15.48,-24.56,-15.44,-26.02,-15.39,-27.57,-15.34,-8.64,-15.34,-11.8,-15.36,-15.03,-15.37,-18.1,-15.38,-20.74,-15.38,-22.83,-15.38,-24.49,-15.37,-25.99,-15.36,-27.57,-15.34,-8.64,-15.34,-11.78,-15.34,-14.99,-15.34,-18.05,-15.34,-20.7,-15.34,-22.78,-15.34,-24.45,-15.34,-25.97,-15.34,-27.57,-15.34,-8.64,-15.34,-11.76,-15.34,-14.96,-15.34,-18,-15.34,-20.65,-15.34,-22.73,-15.34,-24.42,-15.34,-25.95,-15.34,-27.57,-15.34,-8.64,-15.34,-11.73,-15.34,-14.89,-15.34,-17.9,-15.34,-20.53,-15.34,-22.63,-15.34,-24.35,-15.34,-25.92,-15.34,-27.57,-15.34,-8.64,-15.34,-11.69,-15.34,-14.8,-15.34,-17.77,-15.34,-20.39,-15.34,-22.5,-15.34,-24.26,-15.34,-25.88,-15.34,-27.57,-15.34,-8.64,-15.34,-11.65,-15.34,-14.72,-15.34,-17.66,-15.34,-20.26,-15.34,-22.39,-15.34,-24.18,-15.34,-25.84,-15.34,-27.57,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_02","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_03","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[31.13,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.06,20.48,44.25,20.49,46.43,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.06,20.48,44.25,20.49,46.43,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.06,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.69,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.32,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.62,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.25,20.49,46.44,20.49,48.63,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.88,20.48,42.07,20.48,44.26,20.49,46.44,20.49,48.63,20.49,31.14,20.47,33.33,20.47,35.51,20.48,37.7,20.48,39.89,20.48,42.07,20.48,44.26,20.49,46.44,20.49,48.63,20.49]},{"duration":60,"tweenEasing":0,"value":[31.13,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.06,0.04,44.25,0.04,46.43,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.06,0.04,44.25,0.04,46.43,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.06,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.69,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.32,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.62,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.25,0.04,46.44,0.04,48.63,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.88,0.03,42.07,0.04,44.26,0.04,46.44,0.04,48.63,0.04,31.14,0.02,33.33,0.03,35.51,0.03,37.7,0.03,39.89,0.03,42.07,0.04,44.26,0.04,46.44,0.04,48.63,0.04]},{"value":[32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.17,-17.43,43.36,-17.43,45.54,-17.43,47.73,-17.43,49.91,-17.42,32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.17,-17.43,43.36,-17.43,45.54,-17.43,47.73,-17.43,49.92,-17.42,32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.17,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.43,-17.44,34.62,-17.44,36.8,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.43,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.73,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.36,-17.43,45.55,-17.43,47.74,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,38.99,-17.43,41.18,-17.43,43.37,-17.43,45.55,-17.43,47.74,-17.43,49.92,-17.42,32.44,-17.44,34.62,-17.44,36.81,-17.44,39,-17.43,41.18,-17.43,43.37,-17.43,45.55,-17.43,47.74,-17.43,49.92,-17.42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.01_04","timeline":[{"name":"B_HOHO.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[62.27,20.5,66.64,20.5,71.01,20.51,75.38,20.51,79.75,20.51,84.12,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.27,20.5,66.64,20.5,71.01,20.51,75.38,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.27,20.5,66.64,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.27,20.5,66.65,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.87,20.53,97.24,20.53,62.28,20.5,66.65,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.13,20.52,88.5,20.52,92.88,20.53,97.25,20.53,62.28,20.5,66.65,20.5,71.02,20.51,75.39,20.51,79.76,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.25,20.53,62.28,20.5,66.65,20.5,71.02,20.51,75.4,20.51,79.77,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.25,20.53,62.28,20.5,66.66,20.5,71.03,20.51,75.4,20.51,79.77,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.25,20.53,62.29,20.5,66.66,20.5,71.03,20.51,75.4,20.51,79.77,20.51,84.14,20.52,88.51,20.52,92.88,20.53,97.26,20.53]},{"duration":60,"tweenEasing":0,"value":[62.27,0.05,66.64,0.05,71.01,0.06,75.38,0.06,79.75,0.07,84.12,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.27,0.05,66.64,0.05,71.01,0.06,75.38,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.27,0.05,66.64,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.27,0.05,66.65,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.87,0.08,97.24,0.08,62.28,0.05,66.65,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.13,0.07,88.5,0.08,92.88,0.08,97.25,0.08,62.28,0.05,66.65,0.05,71.02,0.06,75.39,0.06,79.76,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.25,0.08,62.28,0.05,66.65,0.05,71.02,0.06,75.4,0.06,79.77,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.25,0.08,62.28,0.05,66.66,0.05,71.03,0.06,75.4,0.06,79.77,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.25,0.08,62.29,0.05,66.66,0.05,71.03,0.06,75.4,0.06,79.77,0.07,84.14,0.07,88.51,0.08,92.88,0.08,97.26,0.08]},{"value":[64.86,-19.55,69.23,-19.54,73.6,-19.54,77.97,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.83,-19.51,64.86,-19.55,69.23,-19.54,73.6,-19.54,77.98,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.83,-19.51,64.86,-19.55,69.24,-19.54,73.61,-19.54,77.98,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.83,-19.51,64.87,-19.55,69.24,-19.54,73.61,-19.54,77.98,-19.53,82.35,-19.53,86.72,-19.52,91.09,-19.52,95.46,-19.52,99.84,-19.51,64.87,-19.55,69.24,-19.54,73.61,-19.54,77.98,-19.53,82.35,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.84,-19.51,64.87,-19.55,69.24,-19.54,73.61,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.84,-19.51,64.87,-19.55,69.24,-19.54,73.62,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.84,-19.51,64.88,-19.55,69.25,-19.54,73.62,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.1,-19.52,95.47,-19.52,99.85,-19.51,64.88,-19.55,69.25,-19.54,73.62,-19.54,77.99,-19.53,82.36,-19.53,86.73,-19.52,91.11,-19.52,95.48,-19.52,99.85,-19.51]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HOHO.02","timeline":[{"name":"B_HOHO.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HOHO.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HOHO.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HOHO.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HOHO.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_00","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-76.73,26.41,-77.96,26.41,-75.93,26.41,-70.97,26.41,-63.4,26.41,-60.9,26.41,-57.48,26.41,-53.68,26.41,-50.06,26.41,-76.14,26.41,-77.15,26.41,-75.13,26.41,-70.39,26.41,-63.25,26.41,-60.77,26.41,-57.39,26.41,-53.63,26.41,-50.06,26.41,-75.48,26.41,-76.28,26.41,-74.29,26.41,-69.79,26.41,-63.08,26.41,-60.63,26.41,-57.29,26.41,-53.59,26.41,-50.06,26.41,-74.96,26.41,-75.53,26.41,-73.53,26.41,-69.24,26.41,-62.95,26.41,-60.52,26.41,-57.21,26.41,-53.55,26.41,-50.06,26.41,-74.74,26.41,-75.03,26.41,-72.98,26.41,-68.85,26.41,-62.9,26.41,-60.46,26.41,-57.16,26.41,-53.53,26.41,-50.06,26.41,-74.63,26.41,-75.48,26.39,-73.64,26.38,-69.35,26.39,-62.84,26.41,-60.4,26.41,-57.12,26.41,-53.51,26.41,-50.06,26.41,-74.36,26.41,-75.79,26.37,-74.18,26.36,-69.76,26.37,-62.71,26.41,-60.28,26.41,-57.04,26.41,-53.47,26.41,-50.06,26.41,-74.04,26.41,-76.04,26.35,-74.67,26.33,-70.12,26.35,-62.55,26.41,-60.14,26.41,-56.94,26.41,-53.42,26.41,-50.06,26.41,-73.74,26.41,-76.32,26.33,-75.19,26.31,-70.5,26.33,-62.4,26.41,-60.02,26.41,-56.85,26.41,-53.38,26.41,-50.06,26.41]},{"duration":60,"tweenEasing":0,"value":[-80.19,0,-81.42,0,-79.39,0,-74.42,0,-66.85,0,-64.36,0,-60.93,0,-57.13,0,-53.52,0,-79.59,0,-80.61,0,-78.59,0,-73.85,0,-66.7,0,-64.23,0,-60.84,0,-57.09,0,-53.52,0,-78.94,0,-79.74,0,-77.74,0,-73.24,0,-66.54,0,-64.09,0,-60.74,0,-57.04,0,-53.52,0,-78.41,0,-78.98,0,-76.99,0,-72.7,0,-66.41,0,-63.97,0,-60.66,0,-57,0,-53.52,0,-78.19,0,-78.49,0,-76.44,0,-72.3,0,-66.35,0,-63.91,0,-60.62,0,-56.98,0,-53.52,0,-78.08,0,-78.94,-0.02,-77.1,-0.03,-72.81,-0.02,-66.3,0,-63.86,0,-60.58,0,-56.96,0,-53.52,0,-77.82,0,-79.24,-0.04,-77.64,-0.05,-73.21,-0.04,-66.17,0,-63.74,0,-60.5,0,-56.93,0,-53.52,0,-77.49,0,-79.49,-0.06,-78.13,-0.08,-73.57,-0.06,-66,0,-63.6,0,-60.4,0,-56.88,0,-53.52,0,-77.2,0,-79.77,-0.08,-78.64,-0.1,-73.96,-0.08,-65.86,0,-63.47,0,-60.31,0,-56.84,0,-53.52]},{"value":[-82.78,-22.15,-84.01,-22.15,-81.98,-22.15,-77.01,-22.15,-69.44,-22.15,-66.95,-22.15,-63.52,-22.15,-59.72,-22.15,-56.11,-22.15,-82.19,-22.15,-83.2,-22.15,-81.18,-22.15,-76.44,-22.15,-69.3,-22.15,-66.82,-22.15,-63.43,-22.15,-59.68,-22.15,-56.11,-22.15,-81.53,-22.15,-82.33,-22.15,-80.33,-22.15,-75.84,-22.15,-69.13,-22.15,-66.68,-22.15,-63.34,-22.15,-59.63,-22.15,-56.11,-22.15,-81,-22.15,-81.57,-22.15,-79.58,-22.15,-75.29,-22.15,-69,-22.15,-66.56,-22.15,-63.25,-22.15,-59.59,-22.15,-56.11,-22.15,-80.79,-22.15,-81.08,-22.15,-79.03,-22.15,-74.9,-22.15,-68.95,-22.15,-66.51,-22.15,-63.21,-22.15,-59.58,-22.15,-56.11,-22.15,-80.68,-22.15,-81.53,-22.17,-79.69,-22.18,-75.4,-22.17,-68.89,-22.15,-66.45,-22.15,-63.17,-22.15,-59.56,-22.15,-56.11,-22.15,-80.41,-22.15,-81.84,-22.19,-80.23,-22.2,-75.8,-22.19,-68.76,-22.15,-66.33,-22.15,-63.09,-22.15,-59.52,-22.15,-56.11,-22.15,-80.09,-22.15,-82.09,-22.21,-80.72,-22.23,-76.17,-22.21,-68.6,-22.15,-66.19,-22.15,-62.99,-22.15,-59.47,-22.15,-56.11,-22.15,-79.79,-22.15,-82.36,-22.23,-81.23,-22.26,-76.55,-22.23,-68.45,-22.15,-66.06,-22.15,-62.9,-22.15,-59.43,-22.15,-56.11,-22.15]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_01","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-38.88,20.45,-41.55,20.45,-41.38,20.45,-38.67,20.45,-33.7,20.45,-33.13,20.45,-31.75,20.45,-30.05,20.45,-28.51,20.45,-38.37,20.45,-40.84,20.45,-40.68,20.45,-38.17,20.45,-33.57,20.45,-33.02,20.45,-31.67,20.45,-30.01,20.45,-28.51,20.45,-37.8,20.45,-40.09,20.45,-39.95,20.45,-37.65,20.45,-33.43,20.45,-32.89,20.45,-31.59,20.45,-29.97,20.45,-28.51,20.45,-37.34,20.45,-39.43,20.45,-39.3,20.45,-37.17,20.45,-33.31,20.45,-32.79,20.45,-31.52,20.45,-29.94,20.45,-28.51,20.45,-37.15,20.45,-39.01,20.45,-38.82,20.45,-36.83,20.45,-33.26,20.45,-32.74,20.45,-31.48,20.45,-29.92,20.45,-28.51,20.45,-37.06,20.45,-39.39,20.43,-39.4,20.42,-37.27,20.43,-33.22,20.45,-32.69,20.45,-31.44,20.45,-29.91,20.45,-28.51,20.45,-36.83,20.45,-39.66,20.41,-39.86,20.39,-37.62,20.41,-33.1,20.45,-32.59,20.45,-31.37,20.45,-29.87,20.45,-28.51,20.45,-36.54,20.45,-39.88,20.39,-40.29,20.37,-37.93,20.39,-32.96,20.45,-32.47,20.45,-31.29,20.45,-29.83,20.45,-28.51,20.45,-36.29,20.45,-40.12,20.37,-40.73,20.34,-38.26,20.37,-32.83,20.45,-32.36,20.45,-31.21,20.45,-29.79,20.45,-28.51,20.45]},{"duration":60,"tweenEasing":0,"value":[-38.88,0,-41.55,0,-41.38,0,-38.67,0,-33.7,0,-33.13,0,-31.75,0,-30.05,0,-28.51,0,-38.37,0,-40.84,0,-40.68,0,-38.17,0,-33.57,0,-33.02,0,-31.67,0,-30.01,0,-28.51,0,-37.8,0,-40.09,0,-39.95,0,-37.65,0,-33.43,0,-32.89,0,-31.59,0,-29.97,0,-28.51,0,-37.34,0,-39.43,0,-39.3,0,-37.17,0,-33.31,0,-32.79,0,-31.52,0,-29.94,0,-28.51,0,-37.15,0,-39.01,0,-38.82,0,-36.83,0,-33.26,0,-32.74,0,-31.48,0,-29.92,0,-28.51,0,-37.06,0,-39.39,-0.02,-39.4,-0.03,-37.27,-0.02,-33.22,0,-32.69,0,-31.44,0,-29.91,0,-28.51,0,-36.83,0,-39.66,-0.04,-39.86,-0.05,-37.62,-0.04,-33.1,0,-32.59,0,-31.37,0,-29.87,0,-28.51,0,-36.54,0,-39.88,-0.06,-40.29,-0.08,-37.93,-0.06,-32.96,0,-32.47,0,-31.29,0,-29.83,0,-28.51,0,-36.29,0,-40.12,-0.08,-40.73,-0.1,-38.26,-0.08,-32.83,0,-32.36,0,-31.21,0,-29.79,0,-28.51]},{"value":[-40.61,-16.19,-43.27,-16.19,-43.11,-16.19,-40.4,-16.19,-35.42,-16.19,-34.86,-16.19,-33.48,-16.19,-31.78,-16.19,-30.24,-16.19,-40.09,-16.19,-42.57,-16.19,-42.41,-16.19,-39.9,-16.19,-35.3,-16.19,-34.74,-16.19,-33.4,-16.19,-31.74,-16.19,-30.24,-16.19,-39.53,-16.19,-41.82,-16.19,-41.68,-16.19,-39.37,-16.19,-35.15,-16.19,-34.62,-16.19,-33.32,-16.19,-31.7,-16.19,-30.24,-16.19,-39.07,-16.19,-41.16,-16.19,-41.02,-16.19,-38.9,-16.19,-35.04,-16.19,-34.52,-16.19,-33.25,-16.19,-31.67,-16.19,-30.24,-16.19,-38.88,-16.19,-40.73,-16.19,-40.55,-16.19,-38.56,-16.19,-34.99,-16.19,-34.47,-16.19,-33.21,-16.19,-31.65,-16.19,-30.24,-16.19,-38.78,-16.19,-41.12,-16.21,-41.12,-16.21,-39,-16.21,-34.94,-16.19,-34.42,-16.19,-33.17,-16.19,-31.63,-16.19,-30.24,-16.19,-38.56,-16.19,-41.39,-16.23,-41.59,-16.24,-39.35,-16.23,-34.83,-16.19,-34.32,-16.19,-33.1,-16.19,-31.6,-16.19,-30.24,-16.19,-38.27,-16.19,-41.6,-16.25,-42.02,-16.27,-39.66,-16.25,-34.69,-16.19,-34.2,-16.19,-33.02,-16.19,-31.56,-16.19,-30.24,-16.19,-38.02,-16.19,-41.84,-16.27,-42.46,-16.29,-39.99,-16.27,-34.56,-16.19,-34.09,-16.19,-32.94,-16.19,-31.52,-16.19,-30.24,-16.19]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_02","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45,0,20.45]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34,0,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_03","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45,45.05,20.45,41.03,20.45,37.01,20.45,33,20.45,28.98,20.45,24.96,20.45,20.95,20.45,16.93,20.45,12.91,20.45]},{"duration":60,"tweenEasing":0,"value":[45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91,0,45.05,0,41.03,0,37.01,0,33,0,28.98,0,24.96,0,20.95,0,16.93,0,12.91]},{"value":[45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34,45.05,-15.34,41.03,-15.34,37.01,-15.34,33,-15.34,28.98,-15.34,24.96,-15.34,20.95,-15.34,16.93,-15.34,12.91,-15.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HOHO.02_04","timeline":[{"name":"B_HOHO.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[87.4,20.52,81.1,20.52,74.81,20.51,68.51,20.51,62.21,20.5,55.91,20.5,49.61,20.5,43.31,20.49,37.01,20.49,87.4,20.52,81.1,20.52,74.8,20.51,68.5,20.51,62.2,20.5,55.9,20.5,49.61,20.5,43.31,20.49,37.01,20.49,87.39,20.52,81.09,20.52,74.8,20.51,68.5,20.51,62.2,20.5,55.9,20.5,49.6,20.5,43.3,20.49,37,20.49,87.39,20.52,81.09,20.52,74.79,20.51,68.49,20.51,62.19,20.5,55.9,20.5,49.6,20.5,43.3,20.49,37,20.49,87.38,20.52,81.08,20.52,74.79,20.51,68.49,20.51,62.19,20.5,55.89,20.5,49.59,20.5,43.29,20.49,36.99,20.49,87.38,20.52,81.08,20.52,74.78,20.51,68.48,20.51,62.18,20.5,55.89,20.5,49.59,20.5,43.29,20.49,36.99,20.49,87.37,20.52,81.07,20.52,74.78,20.51,68.48,20.51,62.18,20.5,55.88,20.5,49.58,20.5,43.28,20.49,36.98,20.49,87.37,20.52,81.07,20.52,74.77,20.51,68.47,20.51,62.17,20.5,55.88,20.5,49.58,20.5,43.28,20.49,36.98,20.49,87.36,20.52,81.06,20.52,74.77,20.51,68.47,20.51,62.17,20.5,55.87,20.5,49.57,20.5,43.27,20.49,36.97,20.49]},{"duration":60,"tweenEasing":0,"value":[87.4,0.07,81.1,0.07,74.81,0.07,68.51,0.06,62.21,0.06,55.91,0.05,49.61,0.05,43.31,0.05,37.01,0.04,87.4,0.07,81.1,0.07,74.8,0.07,68.5,0.06,62.2,0.06,55.9,0.05,49.61,0.05,43.31,0.05,37.01,0.04,87.39,0.07,81.09,0.07,74.8,0.07,68.5,0.06,62.2,0.06,55.9,0.05,49.6,0.05,43.3,0.05,37,0.04,87.39,0.07,81.09,0.07,74.79,0.07,68.49,0.06,62.19,0.06,55.9,0.05,49.6,0.05,43.3,0.05,37,0.04,87.38,0.07,81.08,0.07,74.79,0.07,68.49,0.06,62.19,0.06,55.89,0.05,49.59,0.05,43.29,0.05,36.99,0.04,87.38,0.07,81.08,0.07,74.78,0.07,68.48,0.06,62.18,0.06,55.89,0.05,49.59,0.05,43.29,0.05,36.99,0.04,87.37,0.07,81.07,0.07,74.78,0.07,68.48,0.06,62.18,0.06,55.88,0.05,49.58,0.05,43.28,0.05,36.98,0.04,87.37,0.07,81.07,0.07,74.77,0.07,68.47,0.06,62.17,0.06,55.88,0.05,49.58,0.05,43.28,0.05,36.98,0.04,87.36,0.07,81.06,0.07,74.77,0.07,68.47,0.06,62.17,0.06,55.87,0.05,49.57,0.05,43.27,0.05,36.97,0.04]},{"value":[87.4,-15.26,81.1,-15.27,74.81,-15.27,68.51,-15.27,62.21,-15.28,55.91,-15.28,49.61,-15.29,43.31,-15.29,37.01,-15.29,87.4,-15.26,81.1,-15.27,74.8,-15.27,68.5,-15.27,62.2,-15.28,55.9,-15.28,49.61,-15.29,43.31,-15.29,37.01,-15.29,87.39,-15.26,81.09,-15.27,74.8,-15.27,68.5,-15.27,62.2,-15.28,55.9,-15.28,49.6,-15.29,43.3,-15.29,37,-15.29,87.39,-15.26,81.09,-15.27,74.79,-15.27,68.49,-15.27,62.19,-15.28,55.9,-15.28,49.6,-15.29,43.3,-15.29,37,-15.29,87.38,-15.26,81.08,-15.27,74.79,-15.27,68.49,-15.27,62.19,-15.28,55.89,-15.28,49.59,-15.29,43.29,-15.29,36.99,-15.29,87.38,-15.26,81.08,-15.27,74.78,-15.27,68.48,-15.27,62.18,-15.28,55.89,-15.28,49.59,-15.29,43.29,-15.29,36.99,-15.29,87.37,-15.26,81.07,-15.27,74.78,-15.27,68.48,-15.27,62.18,-15.28,55.88,-15.28,49.58,-15.29,43.28,-15.29,36.98,-15.29,87.37,-15.26,81.07,-15.27,74.77,-15.27,68.47,-15.27,62.17,-15.28,55.88,-15.28,49.58,-15.29,43.28,-15.29,36.98,-15.29,87.36,-15.26,81.06,-15.27,74.77,-15.27,68.47,-15.27,62.17,-15.28,55.87,-15.28,49.57,-15.29,43.27,-15.29,36.97,-15.29]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_FACE.00","timeline":[{"name":"D_FACE.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_FACE.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_FACE.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_FACE.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_FACE.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_00","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-37.79,11.49,-49.02,8.09,-45.63,-0.43,-33.57,-0.96,-32.16,-2.97,-32.56,14.29,-42.99,9.8,-49.39,14.46,-49.06,10.51,-33.29,10.49,-35.29,9.83,-45.96,-20.14,-40.83,5.56,-37.82,11.51,-46.5,16.01,-47.35,14.9,-39.71,14.03,-31.08,2.68,-26.76,11.33,-34.76,17.96,-35.84,22.1,-36.69,5.56,-37.42,11.02,-28.89,6.96,-52.87,30.47,-37.48,16.93,-37.79,10.39,-37.79,11.5,-37.49,11.69,-37.28,11.28,-37.83,11.52,-37.8,11.5,-41.32,5.94,-38.49,9.07,-37.03,4.81,-42.91,11.18,-34.6,12.94,-30.49,11.4,-32.93,8.34,-37.95,10.19,-38.47,11.26,-40.75,12.47,-44.87,13.05,-49.22,14.16,-46.62,13.33,-46.11,13.22,-50.83,13.73,-44.84,14.96,-42.22,16.78,-41.48,4.2,-39.44,5.74,-38.4,-1.07,-33.88,9.33,-33.46,12.41,-35.42,11.2,-41.15,12.12,-41.1,14.51,-44.39,14.09,-29.77,7.35,-31.31,16.08,-35.52,13.64,-37.48,15.87,-43.92,16.07,-33.41,13.07,-47.03,15.94,-34.31,7.75,-34.1,12.56,-34.33,12.5,-37.28,7,-44.42,5.01,-38.93,7.89,-33.61,11.67,-41.84,6.44,-36.18,9.61,-34.95,11.09,-44.41,15.41,-48.45,14.71,-51.41,15.27,-46.2,15.87,-43.72,15.27,-40.94,15.6,-33.8,14.33,-47.47,0.8]},{"duration":60,"tweenEasing":0,"value":[-37.78,-0.01,-49.04,-3.41,-45.58,-11.93,-35.41,-11.92,-35.46,-5.14,-31.39,-4.33,-33.67,-5.39,-38.65,1.28,-54.46,-1.35,-37.79,-2.54,-32.45,-6.81,-37.75,-24.87,-33.92,-3.81,-37.83,0.01,-50.32,0.12,-39.53,0.87,-37.97,0.78,-33.27,-2.16,-27.03,0.17,-43.98,-3.87,-39.67,0.08,-33.16,-5.11,-37.36,-0.47,-29.15,-4.69,-54.25,5.86,-37.95,3.8,-37.87,0.24,-37.8,0,-37.8,-0.05,-37.2,-0.1,-37.85,0.02,-37.8,0,-41.26,-5.54,-40.58,-8.88,-40.3,-9.62,-46.09,-1.27,-44.06,-0.56,-36.85,-4.16,-38.3,-7.09,-41.62,-3.51,-41.8,-1.94,-44.83,-0.29,-36.81,-3.66,-41.66,0.78,-43.55,-2.39,-49.09,1.29,-47.69,-0.01,-37.98,2.52,-47.32,0.24,-39.51,-8.96,-39.38,-8.63,-32.42,-8.34,-31.97,-6.21,-33.99,-5.7,-34.85,-4.09,-35.43,-2.74,-34.37,-1.6,-35.45,-4.69,-30.06,-2.32,-32.04,0.66,-32.61,-1.06,-32.9,-0.51,-36.43,-1.58,-32.31,-0.84,-37.34,1.27,-32.14,-7.04,-32.61,-5.9,-33.15,-4.19,-35.69,-5.99,-41.78,-8.23,-42.04,-7.72,-39.92,-4.36,-41.85,-8.48,-41.27,-6.66,-39.72,-3.19,-34.44,-1.03,-40.7,-0.02,-45.64,1.08,-39.52,0.64,-34.41,-1.69,-35.18,-0.9,-31.23,-2.23,-44.36,-10.89]},{"value":[-37.78,-7.46,-49.04,-10.87,-45.58,-19.39,-35.48,-19.39,-35.32,-12.62,-27.05,-18.49,-33.81,-15.51,-39.05,-9.66,-50.9,-13.28,-38.92,-13.21,-32.75,-17.07,-37.8,-32.25,-33.91,-11.27,-37.83,-7.45,-49.78,-7.31,-40.05,-8.97,-37.82,-7.76,-32.68,-15.95,-26.94,-7.12,-45.83,-13.64,-39.89,-9.92,-33.21,-12.84,-37.4,-7.82,-29.21,-12.13,-53.22,-2.19,-38.2,-5.29,-37.69,-7.16,-37.8,-7.46,-37.85,-7.32,-37.28,-7.5,-37.85,-7.44,-37.8,-7.46,-41.25,-13,-41.63,-19.27,-44.66,-24.18,-45.82,-13.44,-43.07,-10.8,-39.08,-15.49,-41.75,-18.75,-43.76,-14.86,-42.65,-13.45,-46.16,-13.11,-30.33,-18.89,-43.41,-7.26,-38.14,-16.35,-48.7,-8.72,-38.66,-14.34,-48.51,-7.87,-47.22,-8.12,-40.58,-19.87,-43.68,-22.15,-33.41,-16.21,-32.04,-15.4,-34.9,-15.83,-36.35,-14.85,-31.68,-17.48,-33.81,-12.17,-30.68,-19.66,-28.23,-12.82,-28.11,-14.78,-30.35,-11.26,-29.07,-14.31,-31.69,-16.34,-28.87,-15.47,-37.63,-8.39,-33.81,-15.61,-34.34,-16.2,-34.74,-14.1,-38.04,-16.97,-45.06,-18.91,-45.64,-19.44,-41.49,-14.5,-45.38,-19.92,-43.48,-16.83,-40.93,-13.86,-33.06,-11.77,-37.2,-10.84,-40.8,-11.67,-35.67,-10.71,-30.15,-14.86,-30.6,-15.59,-27.41,-16.56,-48.86,-22.21]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_01","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-18.9,11.5,-24.5,9.8,-22.84,5.54,-15.87,5,-14.43,-0.4,-16.87,16.45,-26.15,12.5,-30.06,13.82,-27.01,11.19,-14.39,11.76,-17.12,16.43,-25.36,-9.41,-23.87,7.46,-18.91,11.51,-25.23,11.69,-27.58,14.47,-20.73,13.64,-14.45,3.76,-13.24,11.25,-17.96,11.38,-18.17,14.82,-18.39,8.12,-18.74,11.25,-14.31,9.31,-31.79,17.74,-18.5,15.03,-18.86,10.27,-18.89,11.5,-18.59,11.71,-18.68,11.33,-18.9,11.5,-18.9,11.5,-20.69,8.72,-17.34,10.53,-19.9,4.94,-19.87,11.82,-14.3,12.79,-14.65,10.92,-18.1,6.78,-20.17,10.24,-18.43,11.38,-20.06,12.19,-27.32,13.18,-28.39,13.77,-27.87,12.39,-25.03,12.15,-28.71,12.89,-25.85,13.7,-19.86,12.83,-21.29,12.94,-22.34,6.64,-24.14,-4.36,-18.98,8.39,-15.16,14.62,-17.13,15.8,-23.44,13.5,-23.91,15.31,-27.1,13.45,-14.74,8.51,-15.3,15.75,-19.22,14.17,-21.03,16.12,-26.57,14.73,-17.26,13.49,-28.36,15.31,-21.48,7.44,-18.66,12.31,-16.89,16.3,-18.14,12.12,-24.4,8.28,-20.5,9.2,-15.38,12.58,-21.78,8.55,-18.14,10.81,-16.82,11.41,-27.19,15.5,-29.83,14.72,-30.32,14.3,-27.73,15.13,-26.51,15.26,-23.78,16.05,-18.18,15.44,-27.02,5.82]},{"duration":60,"tweenEasing":0,"value":[-18.89,0,-24.52,-1.71,-22.79,-5.97,-17.71,-5.96,-17.73,-2.57,-15.69,-2.16,-16.84,-2.7,-19.33,0.64,-27.23,-0.67,-18.89,-1.27,-16.23,-3.41,-18.88,-12.43,-16.96,-1.9,-18.91,0,-25.16,0.06,-19.77,0.43,-18.99,0.39,-16.63,-1.08,-13.52,0.08,-21.99,-1.94,-19.83,0.04,-16.58,-2.56,-18.68,-0.23,-14.58,-2.35,-27.13,2.93,-18.98,1.9,-18.94,0.12,-18.9,0,-18.9,-0.03,-18.6,-0.05,-18.93,0.01,-18.9,0,-20.63,-2.77,-20.29,-4.44,-20.15,-4.81,-23.04,-0.63,-22.03,-0.28,-18.42,-2.08,-19.15,-3.55,-20.81,-1.75,-20.9,-0.97,-22.42,-0.15,-18.41,-1.83,-20.83,0.39,-21.77,-1.2,-24.54,0.64,-23.85,0,-18.99,1.26,-23.66,0.12,-19.75,-4.48,-19.69,-4.31,-16.21,-4.17,-15.99,-3.11,-17,-2.85,-17.43,-2.05,-17.71,-1.37,-17.18,-0.8,-17.72,-2.35,-15.03,-1.16,-16.02,0.33,-16.3,-0.53,-16.45,-0.25,-18.22,-0.79,-16.16,-0.42,-18.67,0.64,-16.07,-3.52,-16.31,-2.95,-16.57,-2.1,-17.85,-2.99,-20.89,-4.12,-21.02,-3.86,-19.96,-2.18,-20.92,-4.24,-20.64,-3.33,-19.86,-1.59,-17.22,-0.51,-20.35,-0.01,-22.82,0.54,-19.76,0.32,-17.21,-0.85,-17.59,-0.45,-15.61,-1.11,-22.18,-5.45]},{"value":[-18.89,-7.46,-24.52,-9.16,-22.79,-13.42,-17.77,-13.43,-17.59,-10.05,-11.36,-16.33,-16.97,-12.81,-19.72,-10.3,-27.12,-11.97,-20.02,-11.93,-16.52,-13.66,-18.92,-19.81,-16.95,-9.37,-18.92,-7.45,-24.62,-7.37,-20.28,-9.41,-18.84,-8.15,-16.05,-14.86,-13.42,-7.21,-23.85,-11.7,-20.06,-9.96,-16.63,-10.28,-18.72,-7.58,-14.64,-9.78,-26.09,-5.12,-19.22,-7.2,-18.76,-7.28,-18.9,-7.46,-18.95,-7.29,-18.68,-7.45,-18.92,-7.45,-18.9,-7.46,-20.62,-10.22,-21.34,-14.83,-24.51,-19.36,-22.78,-12.81,-22.34,-9.89,-20.66,-13.41,-21.96,-16.17,-22.95,-13.11,-22.08,-12.8,-27.96,-12.96,-11.92,-17.92,-22.57,-7.65,-16.8,-16.43,-24.16,-9.37,-14.39,-14.76,-15.26,-8.27,-23.56,-8.24,-20.83,-15.39,-23.99,-17.83,-17.2,-12.04,-16.05,-12.29,-17.9,-12.98,-18.6,-11.84,-13.97,-16.11,-16.63,-11.37,-12.96,-17.31,-13.2,-11.66,-12.1,-15.11,-14.05,-10.72,-12.61,-14.06,-13.47,-15.55,-12.71,-15.05,-18.96,-9.03,-17.74,-12.09,-18.04,-13.25,-17.19,-11.36,-19.55,-14.29,-24.17,-14.79,-24.63,-15.58,-21.53,-12.32,-24.46,-15.69,-22.52,-14.14,-21.07,-12.26,-15.84,-11.26,-17.71,-11.26,-19.28,-11.79,-16.34,-11.03,-12.95,-14.02,-13.01,-15.14,-11.8,-15.45,-26.68,-16.76]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_02","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.01,11.5,0.02,11.5,-0.05,11.5,1.84,10.96,3.3,2.17,-1.17,18.62,-9.32,15.19,-10.74,13.17,0.22,11.86,4.5,13.03,-2.84,16.64,-6.48,3.02,-6.91,9.37,0.01,11.5,-0.07,11.63,-7.82,14.04,-1.74,13.26,2.19,4.84,0.28,11.16,4.03,13.31,1.66,14.78,-1.81,10.68,-0.05,11.49,0.26,11.65,-4.67,14.81,0.47,13.12,0.08,10.15,0.01,11.5,0.31,11.74,-0.08,11.38,0.02,11.49,0.01,11.5,-0.06,11.49,2.95,14.97,0.25,9.75,3.17,12.45,7.72,13.07,3.77,13,1.05,10.32,0.65,11.99,2.47,12.35,2.36,12.33,-8.92,15.01,-7.56,13.38,-6.1,13.59,-0.48,11.51,-4.87,12.89,-6.86,12.44,3.8,12.71,-1.54,17.42,-2.65,10.96,-7.93,-0.19,-4.93,4.47,0.53,14.28,-1,15.29,-5.72,14.87,-6.73,16.11,-9.38,15.8,0.29,9.67,0.72,15.42,-2.91,14.71,-4.58,16.37,-8.35,15.52,-1.1,13.91,-9.69,14.67,-7.35,4.57,-6.25,6.95,-1.61,15.85,-0.29,15.12,-3.51,12.39,0.52,13.06,4.58,14.76,-0.86,12.79,2.5,14.13,3.04,13,-9.97,16.02,-9.48,14.73,-7.49,13.76,-7.97,14.81,-9.31,16.11,-6.19,16.5,-2.57,16.55,-4.84,11.26]},{"duration":60,"tweenEasing":0,"offset":165},{"offset":1,"value":[-7.45,0,-7.45,0,-7.46,-0.06,-7.47,0.14,-7.48,4.33,-14.16,-0.13,-10.12,-0.4,-10.94,0.11,-11.3,-1.13,-10.66,-0.3,-10.25,-0.05,-7.38,0.01,-7.46,0,-7.45,0.54,-7.43,-0.51,-9.84,0.15,-8.54,0.58,-13.78,0.1,-7.29,-1.86,-9.77,-0.22,-10,-0.06,-7.73,-0.04,-7.35,-0.06,-7.44,1.04,-8.05,-0.25,-9.1,0.18,-7.4,0,-7.46,-0.05,-7.26,-0.07,-7.39,0.01,-7.46,0,-7.46,0.01,-7.45,-1.05,-10.39,-4.36,-14.55,0.26,-12.17,-0.31,-9.61,-2.23,-11.33,-2.81,-12.62,-2.14,-11.36,-1.18,-11.83,-5.54,-12.82,6.49,-16.09,-1.74,-8.04,4.97,-15.23,0.39,-10.01,9.46,-14.76,3.72,-9.53,0.1,-8.36,-1.08,-10.91,-4.3,-13.52,-1,-7.87,-0.07,-9.18,-0.91,-10.13,-1.17,-9.8,3.74,-14.74,0.56,-10.58,4.76,-14.96,1.83,-10.5,3.92,-15.44,2.25,-10.19,3.84,-13.81,4.75,-14.76,3.45,-14.63,-0.29,-9.67,-1.67,-8.57,-1.73,-10.31,-0.62,-9.27,-1.7,-11.3,-3.28,-10.68,-3.61,-11.72,-1.57,-10.14,-3.53,-11.45,-1.88,-10.81,-1.21,-10.67,1.38,-10.75,2.64,-11.25,3.54,-12.33,3.42,-11.34,4.26,-13.17,4.58,-14.69,3.82,-14.33,-4.5,-11.32]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_03","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[23.32,11.43,22.98,11.55,16.18,12.07,19.83,9.35,25.73,-17.73,21.67,14.78,15.22,10.73,12.61,11.5,25.52,11.21,29.03,12.43,18.92,17.15,13.47,-0.22,19.93,5.74,26.89,9.55,28.82,14.08,14.33,13.2,17.24,12.31,21.68,2.5,25.18,6.72,26.45,13.26,24.49,14.98,20.86,9.96,25.52,9.32,27.64,8.52,22.39,14.28,24.21,14.22,26.79,5.48,23.24,11.43,29.6,11.19,25.6,9.9,26.47,9.82,23.12,11.45,24.28,13.03,24.78,14.81,23.74,8.94,34.71,14.14,39.84,14.42,30.47,13.65,24.69,9.5,30.14,13.53,35.15,14.21,32.16,12.84,16.91,12,19.76,12.97,21.68,10.89,27.74,11.28,22.16,11.8,19.6,11.61,26.75,12.68,21.47,20.2,21.12,11.2,12.25,-1.23,15.83,3.81,22.33,14.17,21.52,17.06,18.27,12.34,16.31,13.42,15.58,13.53,21.5,7.73,21,15.27,19.96,14.63,17.64,15.33,15.36,13.13,20.72,11.61,13.31,13.19,13.27,3.57,14.7,7.12,20.18,17.47,23.27,16.41,19.97,12.09,24.26,12.7,31.02,16.18,22.73,12.44,25.94,13.79,31.45,14.87,14.22,13.33,14.39,13.12,17.2,12.53,16.04,12.6,15.02,13.15,16.75,13.79,19.68,14.67,18.21,11.05]},{"duration":60,"tweenEasing":0,"value":[23.33,-0.08,22.96,0.04,16.23,0.57,17.99,-1.61,22.43,-19.9,22.84,-3.84,24.53,-4.46,23.35,-1.67,27.73,-0.97,24.53,-0.6,21.77,0.51,19.95,-3.24,26.84,-3.63,26.88,-1.95,28.89,2.45,22.15,-0.84,18.98,-0.94,19.5,-2.34,24.9,-4.44,22.42,-0.05,22.83,0.2,22.67,-0.72,25.58,-2.17,27.38,-3.14,27.06,-0.53,23.74,1.1,26.72,-4.67,23.23,-0.07,29.29,-0.55,25.67,-1.49,26.45,-1.68,23.11,-0.06,24.34,1.54,21.83,-0.16,23.49,-0.81,31.54,1.69,32.11,1.35,26.7,0.65,23.65,-0.83,29.49,1.54,32.68,1.86,31.58,0.98,23.4,-2.21,27.32,-0.4,25.83,-2.06,28.55,-0.23,25.57,-0.77,26.46,-0.83,22.94,-0.03,23.01,2.78,23.77,0.24,20.18,-1.04,20.76,-0.66,21.79,-0.11,22.52,1.76,23.99,-2.53,23.04,-2.69,25.28,-3.39,21.22,-1.94,20.28,-0.15,22.87,-0.07,22.22,-1.05,23.38,-2.71,21.82,-2.3,23,-1.48,20.63,-0.99,20.95,0.17,21.79,1.63,23.56,1.3,23.48,-0.3,23.74,-0.36,26.44,1.42,23.59,-0.34,23.44,-0.34,28.41,1.87,23.05,-2.05,21.44,-0.49,22.59,-0.6,23.2,-1.73,24.33,-3.44,23.27,-2.07,22.25,-1.88,23.05,-0.21]},{"value":[23.33,-7.53,22.96,-7.41,16.23,-6.89,14.36,-14.83,20.63,-28.34,27.18,-18,24.4,-14.58,22.95,-12.61,27.84,-12.27,23.4,-11.27,21.47,-9.74,19.9,-10.62,26.85,-11.09,26.88,-9.41,29.43,-4.98,21.64,-10.68,19.13,-9.48,20.08,-16.13,25,-11.73,20.56,-9.82,22.61,-9.8,22.61,-8.45,25.54,-9.52,27.32,-10.57,28.09,-8.58,23.49,-8,26.89,-12.08,23.23,-7.53,29.24,-7.82,25.6,-8.88,26.45,-9.14,23.11,-7.51,24.35,-5.91,20.78,-10.55,19.13,-15.37,31.8,-10.48,31.8,-8.25,24.47,-10.69,20.84,-13.45,27.36,-9.82,31.5,-9.96,26.04,-11.84,29.88,-18.3,25.58,-8.45,28.54,-15.85,28.94,-10.24,32.28,-14.56,30.18,-10.36,23.04,-8.39,21.94,-8.12,19.48,-13.28,19.19,-8.91,20.7,-9.84,20.89,-10.24,21.35,-8.04,27.74,-17.27,23.59,-13.27,30.05,-18.35,22.72,-13.72,22.9,-16.54,25.13,-10.27,26.06,-14.85,27.81,-16.84,24.4,-16.08,22.71,-11.14,18.96,-9.56,19.21,-10.13,21.18,-7.64,21.86,-10,20.2,-10.98,20.13,-12.09,24.87,-8.72,20.05,-11.79,21.56,-11.16,27.2,-8.8,25.89,-13.76,24.57,-12.21,26.78,-13.25,26.62,-13.08,29.24,-17.09,27.85,-16.77,25.64,-16.01,18.55,-11.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_FACE.00_04","timeline":[{"name":"D_FACE.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[46.65,11.35,45.93,11.59,32.41,12.64,37.82,7.73,48.16,-37.63,44.51,10.94,39.75,6.27,35.96,9.83,50.83,10.56,53.56,11.83,40.69,17.66,33.42,-3.46,46.76,2.11,53.76,7.59,57.7,16.53,36.48,12.36,36.22,11.37,41.18,0.15,50.08,2.28,48.88,13.2,47.33,15.19,43.52,9.24,51.1,7.15,55.02,5.38,49.45,13.75,47.96,15.32,53.51,0.81,46.47,11.36,58.89,10.63,51.27,8.41,52.92,8.14,46.22,11.39,48.62,14.57,45.74,15.92,45.93,9.83,66.25,15.83,67.19,15.77,56.75,14.29,49.64,10.8,58.77,15.5,65.67,16.07,61.96,13.34,42.74,8.99,47.08,12.57,49.45,8.2,55.97,11.04,49.2,10.72,46.05,10.78,49.69,12.65,44.49,22.99,44.03,12.29,32.44,-2.27,36.59,3.15,44.12,14.06,44.04,18.82,42.27,9.81,39.34,10.72,40.54,11.27,42.72,5.79,41.28,15.13,42.83,14.56,39.85,14.28,39.06,10.73,42.54,9.31,36.32,11.72,33.9,2.58,35.65,7.29,41.98,19.1,46.83,17.71,43.45,11.79,47.13,12.76,57.03,18.02,46.32,12.1,48.95,14.3,58.99,17.16,38.4,10.63,38.27,11.52,41.89,11.3,40.05,10.38,39.35,10.19,39.7,11.07,41.94,12.79,41.25,10.84]},{"duration":60,"tweenEasing":0,"value":[46.65,-0.15,45.91,0.08,32.46,1.13,35.98,-3.23,44.86,-39.8,45.68,-7.68,49.06,-8.92,46.7,-3.34,55.47,-1.94,49.06,-1.21,43.53,1.02,39.91,-6.49,53.67,-7.26,53.75,-3.91,57.78,4.91,44.29,-1.68,37.96,-1.89,39,-4.69,49.8,-8.88,44.84,-0.11,45.66,0.41,45.33,-1.44,51.15,-4.33,54.75,-6.28,54.11,-1.06,47.48,2.2,53.43,-9.35,46.47,-0.14,58.58,-1.11,51.35,-2.97,52.9,-3.35,46.22,-0.11,48.68,3.08,43.65,-0.33,46.98,-1.63,63.08,3.38,64.22,2.7,53.41,1.29,47.29,-1.65,58.99,3.08,65.36,3.73,63.17,1.97,46.8,-4.42,54.64,-0.81,51.66,-4.11,57.1,-0.46,51.15,-1.53,52.92,-1.66,45.88,-0.06,46.02,5.57,47.55,0.48,40.37,-2.08,41.53,-1.32,43.58,-0.22,45.05,3.53,47.99,-5.06,46.08,-5.38,50.56,-6.77,42.43,-3.88,40.55,-0.3,45.74,-0.15,44.44,-2.09,46.77,-5.43,43.64,-4.6,46.01,-2.95,41.25,-1.98,41.89,0.34,43.59,3.26,47.12,2.59,46.96,-0.6,47.48,-0.72,52.87,2.84,47.18,-0.68,46.88,-0.69,56.82,3.73,46.1,-4.1,42.88,-0.97,45.18,-1.19,46.4,-3.47,48.66,-6.87,46.54,-4.15,44.51,-3.77,46.09,-0.43]},{"value":[46.65,-7.61,45.91,-7.37,32.46,-6.33,28.79,-22.2,41.11,-49.2,50.02,-21.84,48.93,-19.04,46.3,-14.29,55.57,-13.24,47.93,-11.87,43.24,-9.23,39.86,-13.86,53.69,-14.72,53.75,-11.36,58.32,-2.53,43.78,-11.52,38.11,-10.43,39.58,-18.47,49.9,-16.17,42.99,-9.88,45.44,-9.59,45.27,-9.17,51.11,-11.69,54.69,-13.71,55.15,-9.11,47.24,-6.9,53.61,-16.75,46.47,-7.6,58.53,-8.37,51.27,-10.37,52.9,-10.81,46.22,-7.57,48.69,-4.37,42.6,-10.72,42.62,-16.18,63.34,-8.79,63.91,-6.9,51.17,-10.04,44.49,-14.28,56.85,-8.28,64.18,-8.1,57.63,-10.85,53.28,-20.51,52.9,-8.85,52.1,-16.47,57.49,-10.47,55.1,-14.37,56.64,-11.19,45.98,-8.42,44.95,-5.34,43.25,-13.04,39.37,-9.95,41.46,-10.51,42.68,-10.35,43.87,-6.27,51.73,-19.79,46.63,-15.96,55.33,-21.73,43.61,-16.93,41.88,-17.65,48,-10.34,48.27,-15.9,50.87,-18.91,45.36,-17.53,45.72,-12.62,39.58,-10.55,40.16,-9.96,42.97,-6.01,45.42,-8.71,43.67,-11.28,43.87,-12.45,51.31,-7.3,43.64,-12.13,45,-11.5,55.6,-6.93,50.4,-16.77,46.5,-13.18,50.02,-14.16,49.82,-14.81,54.22,-21,51.12,-18.84,47.46,-17.68,41.59,-11.74]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE.02","timeline":[{"name":"B_EYE.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EYE.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EYE.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_00","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-52.74,-61.09,-47.31,-71.89,-41.9,-82.55,-37.05,-91.26,-33.28,-93.7,-30.47,-91.99,-31.91,-97.6,-35.12,-106.7,-38.36,-115.71,-49.03,-54.33,-44.71,-65.75,-40.46,-76.98,-36.28,-86.39,-33.55,-89.25,-32.35,-88.44,-34.34,-94.48,-37.49,-104.26,-40.58,-114.07,-45.51,-47.43,-42.26,-59.48,-39.09,-71.32,-35.54,-81.41,-33.78,-84.75,-34.13,-84.86,-36.64,-91.36,-39.65,-101.88,-42.53,-112.56,-43.87,-38.7,-41.64,-51.37,-39.63,-63.78,-37.07,-74.16,-36.09,-78.42,-37.07,-80.32,-39.19,-88.31,-40.61,-100.04,-42.31,-112.05,-39.76,-29.56,-38.5,-43.17,-37.72,-56.36,-36.95,-66.31,-37.42,-71.5,-38.29,-75.87,-39.43,-85.76,-39.68,-98.18,-40.37,-110.79,-33.97,-21.42,-32.88,-36.21,-32,-50.5,-32.66,-60.17,-34.91,-66.39,-36,-73.34,-36.62,-84.69,-37.07,-97.23,-37.6,-109.81,-29.13,-16.1,-28.93,-30.67,-28.73,-44.74,-30.05,-54.78,-32.92,-62.63,-34.53,-71.65,-35.19,-83.3,-35.87,-96.14,-36.44,-109.1,-21.81,-11.33,-23.13,-25.37,-24.42,-39.05,-26.04,-49.97,-27.57,-59.2,-28.44,-69.49,-29.34,-80.95,-30.44,-94.51,-31.23,-108.36,-14.16,-6.47,-17.01,-20.01,-19.82,-33.41,-21.83,-45.13,-22.79,-55.63,-23.7,-67.1,-24.59,-78.45,-25.01,-92.83,-25.38,-107.69]},{"duration":60,"tweenEasing":0,"value":[-23.25,-50.24,-16.58,-61.4,-10.02,-72.37,-4.47,-81.71,-0.2,-87.63,2.82,-87.09,1.58,-91.96,-1.63,-103.06,-4.87,-114.24,-21.99,-45.85,-16.48,-57.59,-11.07,-69.02,-5.43,-78.64,-1.55,-84.26,0.41,-84.64,-1.51,-90.19,-4.23,-101.43,-6.95,-112.89,-20.77,-41.4,-16.33,-53.77,-11.94,-65.74,-6.16,-75.66,-2.65,-80.96,-1.73,-82.24,-4.33,-88.46,-6.61,-99.88,-8.82,-111.63,-19.6,-36.12,-16.13,-48.82,-12.61,-61.05,-7.18,-70.86,-3.89,-76,-3.26,-78.27,-5.78,-86.09,-7.17,-98.47,-8.6,-111.2,-14.22,-31.27,-11.79,-43.33,-9.34,-54.82,-5.5,-63.56,-3.63,-69.32,-3.17,-73.33,-4.65,-83.39,-5.06,-96.61,-5.73,-110.01,-5.75,-27.44,-4,-39.25,-2,-50.49,0.29,-58.57,-0.11,-65.5,-0.65,-71.88,-1.61,-83.36,-2.21,-96.09,-2.86,-108.83,-1.59,-26.33,-1.11,-37.52,-0.3,-48.23,0.64,-56.48,-1.58,-64.61,-3.44,-72.99,-3.55,-84.27,-2.39,-96.3,-1.8,-108.36,1.87,-26.8,0.76,-37.26,-0.07,-47.43,-0.14,-56.05,-1.2,-64.44,-1.78,-73.72,-1.58,-83.89,-0.91,-95.33,-0.4,-106.98,5.57,-27.31,2.82,-37.02,0.27,-46.76,-0.9,-55.67,-1.38,-64.25,-1.27,-74.37,-0.61,-83.38,0.24,-94.26,1.06,-105.48]},{"value":[-34.25,-40.88,-23.36,-55.57,-12.23,-69.88,-1.1,-81.3,6.26,-88.53,12.24,-86.98,11.58,-91.29,8.36,-103.66,5.12,-116.22,-26.51,-37.57,-16.97,-52.32,-7.42,-66.53,2.77,-78,10.31,-84.3,15.35,-84.09,13.37,-89.14,9.41,-101.38,5.54,-113.96,-19.3,-34.13,-10.97,-48.99,-2.82,-63.26,6.54,-74.78,14.22,-80.12,18.31,-81.24,15.03,-87.03,10.39,-99.18,5.91,-111.81,-15.97,-29.9,-9,-44.52,-2.28,-58.47,5.97,-69.59,13.62,-74.51,17.49,-77.01,14.23,-84.67,10.4,-97.47,6.53,-110.82,-6.97,-27.75,-2.04,-41.01,2.52,-53.4,8.66,-63,13.92,-68.56,17.13,-72.65,15.27,-82.6,13.2,-95.79,10.77,-109.33,4.28,-26.63,8.19,-39.01,12.27,-50.73,16.7,-59.09,18.53,-65.7,20.07,-71.82,18.92,-83.12,17.07,-95.47,15.01,-107.84,8.29,-27.92,10.77,-39.49,13.16,-50.52,15.65,-58.81,15.33,-65.64,15.37,-72.73,15.39,-83.88,16.21,-95.49,16.09,-107.13,11.32,-31.07,13.21,-41.73,14.95,-52.11,16.12,-60.58,16.06,-66.69,16.49,-73.7,16.72,-83.5,17.1,-94.13,17.07,-104.9,14.55,-34.3,15.97,-44.02,17.27,-53.76,17.09,-62.37,16.61,-67.75,16.73,-74.67,17.28,-83.05,17.71,-92.64,18.07,-102.47]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_01","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-43.45,-37.3,-41.35,-42.52,-39.22,-47.7,-37.15,-51.74,-35.51,-51.21,-34.22,-49.78,-35.03,-52.95,-36.64,-56.51,-38.26,-59.92,-42.22,-31.36,-40.05,-37.52,-37.89,-43.62,-36.34,-48.37,-35.34,-48.22,-34.91,-47.01,-35.91,-50.32,-37.71,-54.67,-39.43,-58.96,-41.02,-25.39,-38.82,-32.45,-36.67,-39.44,-35.65,-44.86,-35.24,-45.15,-35.64,-44.23,-36.8,-47.7,-38.68,-52.87,-40.46,-58.07,-40.23,-19.1,-38.43,-26.69,-36.91,-34.16,-36.69,-39.97,-36.93,-41.27,-37.81,-41.62,-38.62,-45.75,-39.35,-51.71,-40.34,-57.78,-36.98,-13.75,-36.09,-21.72,-35.76,-29.53,-36.68,-35.21,-38,-37.61,-39.04,-40.04,-39.42,-44.95,-39.47,-50.99,-39.84,-57.12,-33.61,-8.91,-33,-17.3,-32.82,-25.51,-34.56,-31.01,-36.88,-34.32,-37.98,-38.63,-38.14,-44.29,-38.29,-50.49,-38.5,-56.73,-30.67,-4.27,-30.44,-12.97,-30.38,-21.45,-32.13,-27.3,-34.07,-31.78,-34.91,-37.29,-35.56,-43.33,-36.94,-49.76,-37.87,-56.25,-25.08,0.74,-25.71,-8.62,-26.44,-17.73,-28.01,-24.47,-29.08,-30.17,-29.74,-36.48,-30.77,-42.7,-32.27,-49.41,-33.36,-56.21,-19.27,5.85,-20.75,-4.22,-22.29,-14.04,-23.72,-21.69,-24.43,-28.59,-25.4,-35.68,-26.62,-42.1,-27.46,-49.11,-28.24,-56.29]},{"duration":60,"tweenEasing":0,"value":[-11.63,-25.12,-8.29,-30.7,-5.01,-36.19,-2.24,-40.86,-0.1,-43.82,1.41,-43.54,0.79,-45.98,-0.82,-51.53,-2.44,-57.12,-10.99,-22.92,-8.24,-28.79,-5.54,-34.52,-2.72,-39.32,-0.78,-42.14,0.21,-42.33,-0.75,-45.1,-2.12,-50.72,-3.48,-56.44,-10.39,-20.7,-8.16,-26.87,-5.97,-32.88,-3.08,-37.83,-1.32,-40.48,-0.86,-41.12,-2.16,-44.23,-3.3,-49.94,-4.41,-55.82,-9.8,-18.06,-8.07,-24.4,-6.31,-30.54,-3.59,-35.43,-1.95,-37.99,-1.63,-39.13,-2.91,-43.02,-3.59,-49.22,-4.3,-55.6,-7.11,-15.63,-5.89,-21.65,-4.67,-27.42,-2.76,-31.77,-1.82,-34.65,-1.59,-36.67,-2.35,-41.67,-2.53,-48.29,-2.87,-55.01,-2.87,-13.72,-2,-19.62,-1,-25.24,0.14,-29.28,-0.06,-32.75,-0.33,-35.94,-0.81,-41.68,-1.1,-48.05,-1.43,-54.41,-0.8,-13.17,-0.55,-18.76,-0.15,-24.12,0.32,-28.25,-0.79,-32.3,-1.72,-36.49,-1.78,-42.14,-1.2,-48.15,-0.9,-54.18,0.94,-13.4,0.38,-18.62,-0.04,-23.73,-0.07,-28.03,-0.6,-32.22,-0.89,-36.86,-0.79,-41.94,-0.45,-47.67,-0.2,-53.49,2.79,-13.66,1.41,-18.51,0.13,-23.38,-0.45,-27.83,-0.69,-32.12,-0.63,-37.19,-0.31,-41.69,0.12,-47.13,0.53,-52.74]},{"value":[-13.29,-19.09,-6.29,-27.99,0.89,-36.37,8.04,-41.72,12.03,-45.38,14.13,-43.49,13.12,-45.31,11.51,-52.13,9.89,-59.1,-9.42,-17.36,-2.09,-26.14,5.29,-34.45,12.51,-39.84,17.01,-42.98,18.65,-42.25,15.89,-44.47,12.5,-50.65,9.32,-57.03,-5.82,-15.57,1.84,-24.27,9.46,-32.56,16.73,-38,21.72,-40.6,22.89,-40.99,18.43,-43.63,13.45,-49.27,8.81,-55.12,-3.84,-13.75,3.5,-22.1,10.7,-30.05,17.47,-35.36,22.4,-37.59,23.41,-38.85,18.72,-42.54,13.95,-48.44,9.33,-54.58,2.47,-13.11,8.29,-20.32,13.87,-27.08,18.99,-31.73,21.93,-34.42,22.66,-36.5,19.89,-41.38,17,-47.6,13.97,-53.99,9.48,-12.99,14.23,-19.23,18.92,-25.12,22.57,-29.27,23.07,-32.69,23.13,-35.9,22.02,-41.53,20.44,-47.46,18.6,-53.4,12.08,-14.75,16,-20.22,20.17,-25.5,22.69,-29.57,21.99,-33,21.46,-36.56,21.12,-42.05,20.41,-47.51,19.32,-52.95,15.94,-17.67,18.41,-22.39,21,-27.02,22.27,-31.09,21.96,-33.82,21.88,-37,21.68,-41.74,20.73,-46.56,19.6,-51.41,20.1,-20.64,21.04,-24.58,21.91,-28.6,21.87,-32.62,21.64,-34.62,21.7,-37.4,21.7,-41.36,20.85,-45.51,19.87,-49.73]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_02","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-38.49,-9.33,-38.19,-8.72,-37.91,-8.15,-37.86,-7.66,-38.16,-4,-38.46,-0.35,-38.49,0,-38.49,0,-38.49,0,-36.04,-6.67,-36.78,-6.54,-37.6,-6.41,-37.85,-6.11,-38.15,-3.42,-38.44,-0.72,-38.41,-0.4,-38.21,-0.21,-38.01,0,-33.74,-3.92,-35.44,-4.29,-37.25,-4.63,-37.76,-4.52,-38.07,-2.79,-38.37,-1.06,-38.3,-0.77,-37.91,-0.4,-37.52,0,-33.51,-0.61,-35.19,-1.84,-36.85,-2.96,-37.21,-3.1,-37.66,-2.12,-38.1,-1.15,-38.1,-1.02,-37.89,-0.87,-37.51,-0.71,-37.29,3.49,-37.76,0.9,-38.35,-1.43,-38.09,-1.82,-38.47,-1.54,-38.84,-1.26,-38.82,-1.37,-38.49,-1.84,-37.89,-2.33,-42.2,9.27,-41.11,5.04,-40.03,1.16,-38.98,0.19,-39.28,-0.54,-39.59,-1.27,-39.36,-1.57,-38.34,-2.45,-37.16,-3.4,-38.93,14.47,-37.82,9.25,-36.88,4.45,-36,3.13,-36.31,1.25,-36.62,-0.62,-36.34,-1.23,-35.13,-2.6,-33.91,-4.06,-30.27,18.89,-29.44,12.98,-28.76,7.53,-28.26,5.88,-28.35,2.6,-28.44,-0.69,-28.23,-1.42,-27.41,-2.85,-26.56,-4.38,-21.39,23.33,-20.79,16.7,-20.23,10.57,-20.07,8.55,-19.91,3.83,-19.74,-0.89,-19.62,-1.7,-19.21,-3.13,-18.77,-4.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-1.33,9.03,3.57,5.25,8.61,1.93,13.25,0.92,14.8,-2.07,15.08,-2.73,14.34,-2.33,13.05,-3.6,11.66,-4.98,2.83,7.17,8.54,3.91,14.31,1.03,19.08,0.47,20.93,-1.13,20.85,-1.46,18.97,-1.07,16.82,-1.89,14.75,-2.82,6.68,5.46,13.16,2.68,19.61,0.21,24.5,0.08,26.63,-0.17,26.2,-0.23,23.2,0.09,20.29,-0.31,17.61,-0.82,8.3,4.31,14.85,2.08,21.27,0.09,25.97,0.21,28.13,0.59,27.55,0.3,24.3,0.33,21.37,0.08,18.69,-0.26,11.91,2.52,17.23,1.21,22.28,0.09,26.24,0.61,27.82,0.98,27.35,0.24,25.52,0.24,23.98,0.33,22.5,0.35,14.69,0.73,19.04,0.36,23.15,0.06,26.51,1.01,27.51,1.37,27.16,0.18,26.73,0.17,26.59,0.56,26.31,0.95,15.21,-1.59,19.28,-1.47,23.43,-1.38,26.18,-0.46,26.9,0.43,26.78,0.05,26.69,0.09,26.46,0.64,26.12,1.23,17.34,-4.27,20.57,-3.77,23.77,-3.3,25.44,-2.64,25.81,-1.04,25.76,-0.08,25.56,0.2,24.83,1.1,23.98,2.08,19.65,-6.99,21.97,-6.07,24.11,-5.22,24.66,-4.79,24.66,-2.5,24.67,-0.21,24.34,0.33,23.06,1.62,21.67,3.01]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_03","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-39.57,48.5,-38.6,51.41,-37.65,54.19,-37.11,55.99,-37.31,60.83,-37.71,66.28,-38.14,67.8,-38.96,67.58,-40.19,66.91,-38.12,51.51,-37.67,53.82,-37.44,56,-36.82,57.94,-36.72,61.94,-37.27,65.79,-37.94,67.07,-38.51,66.82,-39.34,66.2,-36.77,54.58,-36.79,56.27,-37.21,57.85,-36.49,59.92,-36.12,63.08,-36.85,65.31,-37.75,66.36,-38.1,66.05,-38.55,65.46,-36.9,58.06,-36.62,58.74,-36.49,59.42,-35.52,61.54,-35.57,63.67,-36.84,64.68,-37.94,65.28,-38.5,64.65,-38.84,63.83,-38.79,62.43,-37.89,61.16,-36.91,60.2,-35.96,62.03,-37,62.49,-38.74,62.79,-39.47,62.99,-39.7,62.24,-39.63,61.42,-41.67,68.63,-40.57,64.92,-39.44,61.83,-38.63,62.95,-39.63,61.58,-40.8,61.02,-40.87,60.96,-40.12,60.37,-39.23,59.84,-37.42,74.4,-36.48,69.3,-35.71,64.88,-35.17,65.19,-35.95,62.64,-36.61,61.11,-36.39,60.99,-35.54,60.05,-34.64,59.14,-28.58,79.68,-27.51,73.75,-26.59,68.45,-26.15,67.85,-26.52,64.15,-26.62,61.31,-26.3,61.37,-25.84,60.19,-25.36,58.93,-19.65,85.02,-18.4,78.23,-17.24,72.02,-16.87,70.5,-16.75,65.62,-16.2,61.46,-15.79,61.71,-15.73,60.32,-15.68,58.75]},{"duration":60,"tweenEasing":0,"value":[0.92,57.83,1.59,60.13,2.26,62.34,2.75,63.65,2.85,64.83,2.75,66.63,2.35,67.8,1.53,67.59,0.3,66.91,-0.08,58.17,1.11,60.35,2.16,62.41,3.03,64.05,3.42,65.35,3.16,66.51,2.47,67.47,1.7,67.03,0.67,66.2,-1.04,58.5,0.65,60.56,2.04,62.48,3.27,64.44,3.95,65.87,3.52,66.37,2.55,67.13,1.81,66.45,0.97,65.46,-1.48,58.67,0.54,60.6,2.34,62.41,3.69,64.64,4.1,65.84,3.25,65.9,2.16,66.36,1.39,65.55,0.67,64.54,-0.5,58.95,1.22,60.38,3.11,61.87,3.98,64.08,3.42,64.5,2.02,64.71,1.28,64.88,0.75,64.35,0.26,63.75,0.62,59.36,1.27,60.1,1.95,61.11,2.05,63.21,1.55,63.03,0.63,63.54,0.35,63.52,0.15,63.33,-0.07,63.24,0.18,60.46,0.78,60.87,1.61,61.52,1.7,63.18,1.35,63.05,0.8,63.65,0.8,63.69,1.04,63.41,1.26,63.2,0.63,61.59,1,62.01,1.52,62.57,1.66,63.75,1.66,63.85,1.56,64.33,1.76,64.51,2.46,63.93,3.2,63.31,1.24,62.69,1.27,63.15,1.3,63.64,1.42,64.34,1.87,64.67,2.31,65,2.72,65.34,3.86,64.45,5.1,63.42]},{"value":[6.92,66.36,11.82,65.08,16.84,64.24,21.26,65.08,22.15,63.34,21.57,64.56,20.15,66.07,17.25,64.3,13.8,61.94,11.24,65.08,17.06,64.19,22.79,63.6,27.39,64.92,28.31,64.4,27.31,65.28,24.85,66.64,21.52,64.93,17.95,62.69,15.2,63.9,21.91,63.4,28.27,63.04,33.03,64.82,34,65.47,32.6,65.97,29.11,67.13,25.4,65.45,21.75,63.3,16.46,63.01,23.48,62.97,30.15,62.99,34.77,65.12,35.35,66.09,33.53,65.91,29.8,66.52,26.09,64.85,22.68,62.85,19,61.72,24.9,62.06,30.73,62.5,34.5,64.88,34.26,65.36,32.34,64.79,30.1,65.03,27.93,64.27,25.85,63.35,20.83,60.56,25.1,61.09,29.24,61.8,32.01,64.34,32,64.49,31,63.69,30.36,63.69,29.8,63.87,29.09,64.13,20.56,59.32,24.63,59.95,29.03,60.65,31.37,62.83,31.44,63.62,30.93,63.72,30.83,63.79,30.64,64.05,30.33,64.43,22.5,57.55,25.79,58.53,29.21,59.53,30.75,61.16,30.97,62.88,30.91,64.25,30.9,64.72,30.77,65.03,30.55,65.39,24.72,55.7,27.07,57.08,29.24,58.43,29.91,59.55,30.36,62.17,30.81,64.78,30.89,65.67,30.76,66.06,30.6,66.42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.02_04","timeline":[{"name":"B_EYE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-41.66,106.33,-40.01,111.55,-38.39,116.54,-37.36,119.64,-37.46,125.65,-37.96,132.91,-38.8,135.6,-40.43,135.17,-42.89,133.83,-41.2,109.68,-39.56,114.17,-38.28,118.41,-36.79,121.98,-36.3,127.29,-37.11,132.29,-38.46,134.55,-39.81,133.85,-41.67,132.4,-40.81,113.08,-39.15,116.84,-38.16,120.33,-36.21,124.37,-35.17,128.95,-36.33,131.68,-38.2,133.49,-39.29,132.5,-40.58,130.92,-41.3,116.73,-39.04,119.33,-37.13,121.8,-34.84,126.13,-34.49,129.25,-36.59,130.14,-38.77,131.27,-40.1,130.01,-41.16,128.37,-41.29,121.38,-39.01,121.42,-36.47,121.81,-34.84,125.8,-36.55,126.09,-39.64,126.08,-41.12,126.68,-41.91,125.98,-42.37,125.17,-42.14,127.99,-41.04,124.8,-39.84,122.5,-39.27,125.67,-40.99,123.36,-43.02,122.66,-43.38,122.89,-42.9,122.89,-42.3,123.08,-36.92,134.33,-36.14,129.35,-35.53,125.33,-35.33,127.22,-36.59,123.73,-37.61,122.29,-37.44,122.69,-36.94,122.44,-36.38,122.34,-27.89,140.47,-26.57,134.52,-25.42,129.37,-25.04,129.79,-25.7,125.55,-25.81,123.03,-25.38,123.89,-25.28,123.09,-25.16,122.24,-18.91,146.7,-17.02,139.76,-15.25,133.48,-14.67,132.44,-14.59,127.42,-13.67,123.8,-12.95,125.12,-13.25,123.77,-13.58,122.17]},{"duration":60,"tweenEasing":0,"value":[1.83,115.66,3.17,120.26,4.52,124.68,5.5,127.3,5.71,129.65,5.5,133.26,4.69,135.6,3.06,135.17,0.6,133.83,-0.17,116.35,2.22,120.71,4.33,124.83,6.06,128.1,6.85,130.7,6.32,133.01,4.95,134.95,3.4,134.06,1.33,132.4,-2.08,117,1.29,121.13,4.08,124.95,6.54,128.89,7.89,131.74,7.04,132.74,5.1,134.26,3.62,132.9,1.94,130.92,-2.96,117.35,1.08,121.21,4.68,124.82,7.37,129.28,8.19,131.67,6.5,131.8,4.31,132.72,2.77,131.11,1.34,129.07,-1,117.89,2.45,120.75,6.23,123.72,7.96,128.16,6.83,129.01,4.05,129.42,2.55,129.76,1.5,128.69,0.53,127.51,1.23,118.71,2.53,120.21,3.9,122.23,4.11,126.42,3.09,126.06,1.27,127.07,0.7,127.03,0.29,126.67,-0.15,126.48,0.37,120.92,1.55,121.74,3.21,123.03,3.4,126.36,2.7,126.09,1.59,127.31,1.6,127.38,2.07,126.83,2.53,126.4,1.26,123.19,1.99,124.03,3.05,125.15,3.31,127.49,3.31,127.7,3.11,128.65,3.52,129.02,4.93,127.86,6.4,126.62,2.48,125.37,2.53,126.3,2.6,127.29,2.85,128.67,3.73,129.34,4.62,130,5.44,130.68,7.73,128.9,10.19,126.83]},{"value":[15.17,123.69,20.08,124.91,25.07,126.55,29.27,129.24,29.51,128.76,28.06,131.85,25.95,134.46,21.45,132.2,15.93,128.85,19.65,122.98,25.59,124.48,31.26,126.18,35.69,129.37,35.7,129.92,33.78,132.02,30.73,134.35,26.22,131.74,21.14,128.19,23.72,122.35,30.65,124.12,36.94,125.87,41.57,129.56,41.36,131.11,39,132.16,35.02,134.16,30.51,131.21,25.89,127.43,24.62,121.7,32.11,123.86,39.04,125.88,43.56,130.03,42.57,131.58,39.52,131.52,35.29,132.7,30.8,129.61,26.66,125.95,26.08,120.91,32.57,122.9,39.18,124.9,42.76,129.15,40.72,129.73,37.34,129.33,34.69,129.83,31.88,128.22,29.2,126.36,26.98,120.4,31.15,121.83,35.32,123.54,37.51,127.67,36.49,127.6,34.84,127.19,33.99,127.21,33.02,127.18,31.87,127.31,25.91,120.22,29.99,121.37,34.63,122.69,36.56,126.12,35.97,126.81,35.09,127.39,34.97,127.48,34.81,127.46,34.53,127.63,27.66,119.38,31.01,120.83,34.65,122.36,36.07,124.96,36.13,126.8,36.05,128.58,36.24,129.23,36.7,128.97,37.12,128.7,29.8,118.38,32.17,120.23,34.38,122.07,35.17,123.89,36.06,126.84,36.95,129.78,37.44,131.01,38.45,130.51,39.53,129.84]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE.04","timeline":[{"name":"B_EYE.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EYE.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EYE.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_00","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-57.27,-110.11,-52.92,-112.96,-48.56,-116.8,-44.95,-111.17,-44.01,-98.49,-43.91,-87.77,-43.85,-84.4,-43.57,-80.92,-43.27,-77.34,-54.12,-105.67,-50.06,-109.53,-46.07,-113.76,-42.29,-109.65,-41.65,-99.45,-42.91,-89.96,-43.99,-85.76,-44.89,-82.26,-45.59,-78.74,-51.38,-101.11,-47.53,-105.99,-43.82,-110.61,-39.84,-108.03,-39.4,-100.44,-41.9,-92.27,-44.09,-87.29,-45.98,-83.81,-47.57,-80.37,-52.58,-95.43,-48.58,-101.1,-44.35,-106.13,-40.28,-104.75,-39.09,-100.2,-40.87,-94.56,-43.06,-89.78,-45.08,-86.73,-46.86,-83.76,-51.43,-88.85,-48.58,-94.88,-45.63,-100.21,-42.86,-99.03,-40.85,-97.12,-39.92,-95.09,-40.62,-91.75,-42.49,-89.57,-43.94,-87.46,-49.42,-82,-48,-88.51,-46.76,-94.31,-45.52,-93.36,-43.65,-93.97,-40.99,-95.4,-39.96,-93.92,-40.57,-93.28,-41.03,-92.7,-46.44,-76.45,-44.53,-83.75,-42.01,-90.35,-40.96,-90.13,-40.3,-92.44,-38.44,-95.76,-37.5,-95.56,-38.58,-96.69,-39.23,-97.99,-36.57,-72.06,-35.57,-80.32,-34.17,-87.78,-33.65,-88.51,-33.21,-91.92,-31.87,-96.18,-31.23,-96.65,-31.84,-99.32,-32.18,-102.34,-26.05,-67.73,-26.21,-76.97,-26.36,-85.32,-26.5,-86.97,-26.14,-91.43,-25.16,-96.58,-24.74,-97.7,-24.61,-101.92,-24.47,-106.68]},{"duration":60,"tweenEasing":0,"value":[-14,-110.11,-9.65,-113.43,-5.29,-117.69,-1.65,-112.35,-0.41,-101.65,-0.02,-92.92,0,-90.02,0,-87.68,0,-85.34,-12.35,-104.48,-8.18,-108.85,-4.01,-113.59,-0.29,-110.17,1.22,-102.33,0.89,-94.89,0.36,-91.03,-0.06,-87.52,-0.46,-83.93,-10.9,-99.1,-6.9,-104.42,-2.91,-109.53,0.92,-107.91,2.76,-102.93,1.76,-96.75,0.69,-91.99,-0.1,-87.39,-0.89,-82.63,-10.79,-95.57,-7.21,-100.78,-3.71,-105.41,-0.02,-104.37,2.89,-101.63,2.83,-96.96,1.72,-92.03,0.32,-87.33,-0.95,-82.43,-8.66,-92.02,-6.37,-96.9,-4.22,-101.2,-1.58,-99.81,1.92,-98.17,4.08,-95.61,3.79,-91.44,1.41,-87.71,-0.5,-83.82,-7.11,-88.75,-5.9,-93.23,-4.83,-97.18,-3.27,-95.41,-0.53,-94.98,2.51,-94.63,3.38,-91.19,1.57,-88.24,-0.04,-85.21,-6.46,-87.88,-4.81,-91.66,-2.97,-95,-1.75,-93.62,-0.02,-94.53,2.44,-94.73,3.3,-91.17,1.65,-88.28,0,-85.34,-3.03,-88.45,-1.08,-91.27,0.92,-93.71,1.73,-93.01,2.38,-95.36,3.57,-95.31,3.79,-91.33,1.93,-88.36,0,-85.34,0.67,-89.07,2.83,-90.89,4.83,-92.4,5.17,-92.35,4.69,-96.18,4.56,-95.91,4.16,-91.51,2.16,-88.45,0,-85.34]},{"value":[5,-107.11,13.52,-112.28,21.72,-118.26,27.28,-113.11,29.42,-102.78,29.03,-94.84,26.44,-92.79,21.34,-93.44,16,-94.34,8.04,-102.4,16.18,-108.01,24.16,-113.9,30.28,-110.54,32.62,-102.91,31.57,-95.92,27.99,-92.85,23.15,-91.5,18.12,-90.22,10.77,-97.89,18.54,-103.85,26.3,-109.57,32.99,-107.94,35.58,-103,33.95,-96.97,29.37,-92.92,24.73,-89.64,19.99,-86.24,11.53,-94.57,18.57,-100.26,25.82,-105.34,32.44,-104.43,36.09,-101.74,35.57,-97.03,30.85,-92.65,25.67,-88.63,20.81,-84.34,17.59,-91.14,22.38,-96.62,27.54,-101.47,32.15,-100.33,36.36,-98.8,38.18,-95.92,35.54,-91.83,30.74,-88.31,26.38,-84.57,25.61,-88.42,27.55,-93.47,29.55,-97.93,31.72,-96.39,35.14,-96.12,37.96,-95.19,37.66,-91.14,34.6,-87.62,31.53,-83.96,28.54,-87.88,30.12,-92.19,31.92,-96.01,33.16,-94.73,35.01,-95.27,36.96,-94.47,37.1,-90.08,34.49,-86.29,31.8,-82.39,31.97,-88.45,33.66,-91.99,35.44,-95.09,36.2,-94.44,36.86,-95.47,37.74,-93.79,37.6,-89.27,35.26,-85.81,32.81,-82.28,35.67,-89.07,37.37,-91.82,38.93,-94.18,39.17,-94.14,38.69,-95.68,38.56,-93.13,38.16,-88.51,36.16,-85.45,34,-82.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_01","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-48.77,-55.72,-45.9,-57.15,-43.08,-59.07,-40.97,-56.14,-40.45,-48.58,-40.75,-42,-40.89,-40,-40.75,-37.48,-40.61,-34.84,-48.86,-52.81,-45.93,-54.96,-43.08,-57.27,-40.68,-55.21,-39.92,-49.53,-40.56,-43.94,-41.21,-41.18,-41.97,-39.12,-42.61,-37.1,-49.01,-49.88,-46,-52.76,-43.09,-55.44,-40.4,-54.26,-39.38,-50.48,-40.33,-45.88,-41.44,-42.41,-42.96,-40.87,-44.31,-39.52,-50.01,-46.66,-46.71,-50.12,-43.12,-53.19,-40.26,-52.6,-38.87,-50.65,-39.39,-47.49,-40.41,-44.1,-42.03,-43.26,-43.53,-42.69,-47.53,-42.41,-45.34,-46.54,-42.89,-50.23,-40.99,-49.91,-39.49,-49.3,-38.5,-48.15,-38.58,-46.13,-39.78,-46.04,-40.74,-46.15,-44.55,-37.95,-44,-42.84,-43.55,-47.26,-42.9,-47.22,-41.62,-47.79,-39.47,-48.49,-38.42,-48.22,-38.42,-49.52,-38.37,-50.95,-41.24,-33.93,-40.59,-39.68,-39.62,-44.91,-39.15,-45.36,-38.49,-46.88,-36.73,-49.03,-35.71,-49.92,-35.73,-52.62,-35.49,-55.52,-32.38,-30.38,-32.19,-37.06,-31.78,-43.15,-31.56,-44.16,-30.86,-46.3,-29.39,-49.49,-28.59,-51.07,-28.13,-55.04,-27.48,-59.37,-23.05,-26.87,-23.45,-34.49,-23.81,-41.45,-23.89,-43.01,-23.07,-45.72,-21.8,-49.89,-21.17,-52.15,-20.11,-57.4,-18.97,-63.17]},{"duration":60,"tweenEasing":0,"value":[-7,-55.05,-4.83,-56.72,-2.65,-58.85,-0.83,-56.18,-0.21,-50.83,-0.01,-46.46,0,-45.01,0,-43.84,0,-42.67,-6.17,-52.24,-4.09,-54.43,-2.01,-56.81,-0.14,-55.08,0.61,-51.17,0.45,-47.44,0.18,-45.52,-0.03,-43.76,-0.23,-41.97,-5.45,-49.55,-3.44,-52.22,-1.46,-54.78,0.46,-53.96,1.38,-51.46,0.88,-48.38,0.34,-46,-0.05,-43.7,-0.44,-41.32,-5.39,-47.78,-3.61,-50.39,-1.85,-52.71,-0.01,-52.19,1.44,-50.81,1.41,-48.48,0.86,-46.02,0.16,-43.66,-0.48,-41.21,-4.33,-46.01,-3.18,-48.45,-2.11,-50.61,-0.79,-49.91,0.96,-49.08,2.04,-47.8,1.9,-45.72,0.71,-43.85,-0.25,-41.91,-3.55,-44.38,-2.95,-46.61,-2.42,-48.59,-1.64,-47.71,-0.27,-47.49,1.26,-47.31,1.69,-45.6,0.79,-44.12,-0.02,-42.61,-3.23,-43.94,-2.4,-45.83,-1.49,-47.5,-0.88,-46.81,-0.01,-47.26,1.22,-47.37,1.65,-45.58,0.82,-44.14,0,-42.67,-1.52,-44.22,-0.54,-45.63,0.46,-46.85,0.87,-46.5,1.19,-47.68,1.79,-47.66,1.89,-45.67,0.96,-44.18,0,-42.67,0.33,-44.53,1.41,-45.45,2.41,-46.2,2.59,-46.18,2.35,-48.09,2.28,-47.96,2.08,-45.75,1.08,-44.23,0,-42.67]},{"value":[9,-52.05,15.34,-55.57,21.37,-59.41,25.05,-56.93,25.96,-51.95,24.76,-48.38,22.25,-47.78,17.72,-49.6,13,-51.67,11.22,-50.17,17.32,-53.64,23.25,-57.18,27.56,-55.51,28.86,-51.81,27.47,-48.48,24.17,-47.33,19.82,-47.74,15.35,-48.25,13.22,-48.33,19.09,-51.75,24.9,-54.97,29.85,-54.09,31.55,-51.68,29.98,-48.61,25.9,-46.92,21.69,-45.94,17.43,-44.92,14.04,-46.81,19.37,-49.98,24.88,-52.8,29.82,-52.34,32.09,-51.03,31.17,-48.53,27,-46.64,22.51,-44.96,18.28,-43.12,20.04,-45.32,23.4,-48.25,26.93,-50.81,30.13,-50.24,32.49,-49.49,33.02,-47.97,30.64,-46.12,27.04,-44.45,23.63,-42.66,27.03,-44.19,28.1,-46.75,29.13,-48.99,30.37,-48.22,32.14,-48.08,33.46,-47.59,32.97,-45.55,30.82,-43.5,28.55,-41.35,28.77,-43.94,29.39,-46.16,30.05,-48.12,30.6,-47.49,31.53,-47.6,32.5,-47.05,32.45,-44.66,30.67,-42.23,28.8,-39.72,30.48,-44.22,31.12,-46.25,31.76,-48.04,32.07,-47.71,32.4,-47.6,32.84,-46.13,32.71,-43.7,31.3,-41.68,29.81,-39.61,32.33,-44.53,32.95,-46.37,33.52,-47.98,33.59,-47.96,33.35,-47.59,33.28,-45.17,33.08,-42.75,32.08,-41.23,31,-39.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_02","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-40.27,-1.33,-38.88,-1.33,-37.6,-1.33,-36.99,-1.11,-36.89,1.33,-37.59,3.77,-37.93,4.4,-37.93,5.97,-37.94,7.67,-43.6,0.05,-41.81,-0.39,-40.08,-0.77,-39.08,-0.78,-38.19,0.38,-38.22,2.09,-38.42,3.4,-39.04,4.03,-39.64,4.55,-46.64,1.34,-44.47,0.47,-42.35,-0.27,-40.96,-0.48,-39.34,-0.52,-38.76,0.52,-38.79,2.47,-39.93,2.07,-41.05,1.33,-47.44,2.11,-44.84,0.87,-41.89,-0.23,-40.23,-0.45,-38.66,-1.09,-37.91,-0.4,-37.75,1.58,-38.98,0.21,-40.2,-1.62,-43.64,4.04,-42.1,1.79,-40.15,-0.24,-39.11,-0.79,-38.13,-1.47,-37.08,-1.21,-36.53,-0.5,-37.07,-2.51,-37.53,-4.85,-39.68,6.11,-40,2.82,-40.33,-0.21,-40.28,-1.07,-39.6,-1.61,-37.95,-1.59,-36.87,-2.52,-36.27,-5.77,-35.71,-9.2,-36.04,8.59,-36.66,4.39,-37.23,0.51,-37.34,-0.6,-36.68,-1.32,-35.01,-2.3,-33.93,-4.26,-32.87,-8.54,-31.76,-13.06,-28.19,11.31,-28.81,6.19,-29.39,1.47,-29.46,0.18,-28.51,-0.69,-26.91,-2.79,-25.95,-5.48,-24.43,-10.76,-22.79,-16.41,-20.05,14,-20.68,7.98,-21.26,2.42,-21.29,0.96,-20,0,-18.43,-3.21,-17.6,-6.61,-15.62,-12.88,-13.47,-19.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[11,3,15.17,1.15,19.02,-0.56,20.82,-0.76,20.5,-1.13,18.5,-1.92,16.06,-2.77,12.1,-5.76,8,-9,12.39,2.07,16.46,0.74,20.34,-0.45,22.83,-0.48,23.1,-0.71,21.36,-1.05,18.35,-1.82,14.5,-3.98,10.58,-6.29,13.67,1.22,17.64,0.37,21.52,-0.34,24.7,-0.25,25.52,-0.35,24.01,-0.25,20.42,-0.93,16.64,-2.25,12.88,-3.61,14.56,0.96,18.18,0.29,21.94,-0.26,25.21,-0.25,26.1,-0.33,24.77,-0.04,21.14,-0.63,17.35,-1.29,13.76,-1.91,20.5,0.5,22.42,0.13,24.32,-0.14,26.12,-0.14,26.62,-0.19,25.87,-0.02,23.75,-0.41,21.33,-0.59,18.87,-0.75,26.44,0.04,26.66,-0.02,26.7,-0.05,27.02,-0.04,27.15,-0.05,26.96,-0.01,26.28,0.04,25.03,0.62,23.57,1.25,27,0,26.66,-0.13,26.18,-0.24,26.05,-0.25,26.05,0.05,26.05,0.36,25.8,0.77,24.84,1.84,23.8,2.95,27,0,26.57,-0.51,26.07,-0.98,25.94,-0.99,25.94,0.27,25.94,1.53,25.81,1.87,25.33,2.45,24.81,3.06,27,0,26.54,-0.93,26.11,-1.78,26,-1.79,26,0.5,26,2.79,26,3,26,3,26,3]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_03","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-48.06,64.31,-45.88,58.83,-43.73,53.48,-42.29,50.1,-43.16,50.93,-45.52,50.97,-48.66,46.38,-50.94,39.97,-53.1,33.4,-50.65,65.64,-48.17,59.71,-45.89,54.04,-43.44,50.75,-42.17,49.88,-42.8,48.51,-45.51,44.42,-48.04,37.7,-50.84,30.34,-52.98,66.89,-49.7,60.5,-46.45,54.44,-42.82,51.28,-40.33,48.82,-40.14,46.15,-42.47,42.54,-45.15,35.39,-48.54,27.1,-53.03,67.9,-49.03,61.09,-44.56,54.63,-40.39,51.46,-38.07,47.75,-37.88,44.05,-39.64,40.15,-42.06,32.16,-45.3,22.86,-47.88,69.78,-44.99,62.1,-41.44,54.8,-38.63,50.63,-36.77,45.55,-35.61,40.59,-36.22,35.38,-37.59,26.77,-39.35,17.27,-42.3,71.79,-41.57,63.09,-40.69,54.83,-39.73,49.66,-38.29,43.64,-36.14,37.85,-35.44,30.88,-35.28,20.83,-35.23,10.37,-37.22,74.07,-37.04,64.55,-36.73,55.48,-36.29,49.8,-35.02,43.19,-32.84,36.22,-31.79,28.15,-30.85,17.19,-29.79,5.95,-26.83,76.26,-26.82,65.97,-26.71,56.17,-26.32,50.25,-25.01,43.44,-23.21,35.34,-22.16,26.54,-20.42,14.96,-18.52,3.01,-15.97,78.41,-16.17,67.37,-16.34,56.83,-16.01,50.69,-14.61,43.75,-13.15,34.55,-12.1,25.04,-9.56,12.79,-6.81,0.14]},{"duration":60,"tweenEasing":0,"value":[-12.29,65.65,-11.04,60.01,-9.74,54.52,-9.04,50.74,-10.71,49.1,-12.58,47.04,-15.23,41.98,-17.51,34,-19.66,25.74,-12.78,65.13,-11.36,59.71,-10.1,54.48,-8.66,51.1,-8.73,49.16,-9.64,46.47,-12.27,41.45,-14.51,33.68,-16.74,25.53,-13.21,64.67,-11.08,59.41,-8.99,54.35,-6.61,51.35,-5.98,49.18,-6.81,45.91,-9.48,40.89,-11.62,33.26,-13.89,25.14,-12.86,64.74,-10.22,59.51,-7.35,54.47,-4.59,51.46,-4.09,48.66,-5.24,44.68,-7.72,39.4,-9.8,31.78,-11.97,23.66,-9.83,65.07,-7.75,59.92,-5.44,54.93,-3.53,51.24,-2.87,46.86,-3.16,41.77,-4.76,36.26,-6.52,29.21,-8.15,21.83,-6.79,65.4,-5.64,60.27,-4.47,55.29,-3.6,50.98,-2.93,45.33,-2.55,39.39,-3.02,33.42,-3.64,26.48,-4.2,19.39,-5.57,65.76,-4.67,60.48,-3.62,55.34,-3.04,50.8,-2.63,44.73,-2.31,38.55,-2.37,32.41,-2.47,25.73,-2.53,19,-2.61,66.4,-2.14,60.65,-1.56,55.04,-1.13,50.3,-0.88,44.25,-0.79,38.16,-0.71,32.02,-0.49,25.71,-0.22,19.42,0.58,67.08,0.55,60.82,0.53,54.7,0.78,49.73,0.89,43.75,0.78,37.76,1,31.64,1.56,25.67,2.16,19.81]},{"value":[-2.13,68.65,2.37,61.16,6.66,53.95,8.99,49.96,7.46,47.64,4.04,44.49,-1.82,38.49,-8.22,28.47,-14.5,18.07,-1.23,67.2,3.77,60.44,8.48,54.04,12.2,50.58,12.22,47.85,9.57,44.21,3.44,38.3,-2.69,29.04,-8.84,19.34,-0.37,65.88,5.59,59.77,11.5,54.01,16.78,51.08,17.51,47.99,14.8,43.91,8.32,38.08,2.45,29.53,-3.55,20.49,0.86,65.69,7.13,59.81,13.75,54.21,19.45,51.2,20.01,47.48,17.1,42.84,10.84,36.95,4.98,28.92,-0.88,20.47,9.84,65.57,13.83,60.04,18.05,54.81,21.54,51.1,22.06,46.24,20.58,40.8,16.21,34.96,11.18,27.83,6.23,20.41,18.82,65.45,20.18,60.24,21.4,55.25,22.51,50.96,22.82,45.26,22.59,39.29,20.27,33.49,16.7,27.1,13.04,20.58,20.59,65.76,21.16,60.35,21.73,55.11,22.14,50.55,22.14,44.79,22.05,38.91,20.69,33.28,17.99,27.64,15.39,21.96,23.56,66.4,23.6,60.14,23.68,54.06,23.95,49.3,23.99,44.52,23.87,39.69,23.28,33.93,22.16,28.2,21.13,22.49,26.75,67.08,26.25,59.9,25.8,52.92,25.95,47.95,26.05,44.25,25.95,40.55,26.17,34.64,26.73,28.67,27.32,22.81]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE.04_04","timeline":[{"name":"B_EYE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-55.85,129.96,-52.88,119,-49.86,108.29,-47.59,101.31,-49.42,100.54,-53.45,98.18,-59.39,88.37,-63.95,73.97,-68.27,59.14,-57.69,131.23,-54.53,119.81,-51.69,108.9,-47.81,102.26,-46.16,99.36,-47.38,94.92,-52.62,85.47,-57.02,71.4,-62.04,56.14,-59.32,132.45,-54.92,120.52,-50.53,109.19,-44.69,103.02,-41.33,98.16,-41.53,91.78,-46.19,82.65,-50.34,68.75,-56.02,52.87,-58.79,133.69,-53.36,121.38,-47.4,109.58,-40.55,103.37,-37.5,96.59,-37.85,88.5,-41.55,78.71,-45.12,64.14,-50.41,47.34,-54.12,135.51,-49.34,122.67,-43.64,110.18,-38.16,102.03,-35.44,92.55,-34.14,82.4,-35.94,71.27,-38.09,56.1,-41.16,39.39,-48.74,137.47,-45.93,123.83,-42.6,110.56,-39.18,100.39,-36.99,88.88,-34.32,77.3,-34.02,64.29,-34.29,47.44,-34.75,29.93,-41.96,139.55,-40.01,125.11,-37.6,111.06,-35.25,100.2,-33.36,87.7,-30.67,74.74,-29.66,60.55,-28.82,42.94,-27.82,24.95,-27.33,141.21,-26.17,125.95,-24.73,111.18,-23.18,100.32,-21.51,87.57,-19.51,73.48,-18.37,58.55,-16.41,40.67,-14.24,22.43,-11.89,142.83,-11.66,126.76,-11.42,111.24,-10.73,100.42,-9.22,87.5,-7.87,72.32,-6.6,56.68,-3.5,38.46,-0.16,19.94]},{"duration":60,"tweenEasing":0,"value":[-24.58,131.29,-22.08,120.03,-19.48,109.03,-18.08,101.49,-21.42,98.2,-25.17,94.09,-30.47,83.97,-35.02,68,-39.33,51.48,-25.56,130.25,-22.71,119.41,-20.2,109,-17.31,102.18,-17.48,98.32,-19.29,92.96,-24.58,82.95,-29,67.4,-33.48,51.06,-26.42,129.33,-22.16,118.81,-17.97,108.73,-13.22,102.69,-11.98,98.34,-13.63,91.82,-19.03,81.86,-23.22,66.58,-27.78,50.29,-25.72,129.47,-20.43,119.03,-14.71,108.93,-9.19,102.92,-8.2,97.31,-10.48,89.36,-15.48,78.88,-19.58,63.6,-23.93,47.31,-19.65,130.14,-15.5,119.83,-10.88,109.85,-7.07,102.46,-5.76,93.71,-6.33,83.53,-9.56,72.6,-13.03,58.47,-16.3,43.66,-13.58,130.81,-11.28,120.53,-8.94,110.58,-7.21,101.95,-5.87,90.65,-5.1,78.78,-6.05,66.84,-7.27,52.98,-8.4,38.77,-11.14,131.51,-9.34,120.95,-7.23,110.66,-6.07,101.6,-5.26,89.46,-4.63,77.11,-4.74,64.82,-4.95,51.47,-5.06,38.01,-5.21,132.81,-4.27,121.3,-3.12,110.08,-2.26,100.59,-1.77,88.51,-1.58,76.32,-1.42,64.04,-0.98,51.42,-0.45,38.84,1.17,134.16,1.1,121.64,1.06,109.41,1.56,99.47,1.77,87.5,1.56,75.53,2,63.28,3.12,51.34,4.31,39.61]},{"value":[-15.25,134.29,-10.43,121.17,-5.7,108.47,-2.84,100.67,-5.59,96.41,-10.42,90.89,-19.69,79.74,-28.53,62.7,-37,45.15,-14.84,132.33,-8.93,120.14,-3.36,108.59,1.57,101.63,1.32,96.41,-2.23,89.48,-11.5,78.43,-19.88,62.08,-28.26,44.97,-14.42,130.55,-6.46,119.16,1.49,108.39,8.85,102.38,9.48,96.31,5.57,88.08,-3.82,77.12,-11.73,61.35,-19.98,44.59,-12.83,130.43,-3.92,119.33,5.54,108.65,13.7,102.63,13.9,95.27,9.41,85.71,0.49,74.59,-7.37,59.17,-15.52,42.85,-0.82,130.64,5.24,119.95,11.79,109.76,16.96,102.32,17.46,92.64,15.27,81.62,8.58,70.41,1.06,56.28,-6.42,41.57,11.19,130.85,13.71,120.49,16.1,110.57,17.99,101.96,18.49,90.55,18.22,78.59,14.25,66.96,8.37,53.59,2.51,39.91,14.19,131.51,15.66,120.82,17.29,110.43,18.22,101.35,18.23,89.51,18.05,77.47,15.57,65.78,11.15,53.46,6.98,40.96,20.12,132.81,20.63,120.78,21.28,109.1,21.97,99.6,22.04,88.77,21.8,77.84,20.76,65.95,18.99,53.98,17.45,41.91,26.5,134.16,25.97,120.72,25.5,107.62,25.89,97.68,26.11,88,25.89,78.31,26.33,66.28,27.45,54.34,28.64,42.61]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE_BALL.05","timeline":[{"name":"B_EYE_BALL.05_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE_BALL.05_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE_BALL.05_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.05_00","timeline":[{"name":"B_EYE_BALL.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-24.19,10.17,-21.58,5.4,-22.32,6.15,-23.18,7.47,-23.83,8.72,-23.95,9.28,-23.93,9.32,-24,9.47,-24.1,9.74,-24.19,10.17,-17.59,2.54,-19.34,3.55,-21.31,5.09,-22.86,6.5,-23.36,7.12,-23.42,7.4,-23.64,8.13,-23.92,9.12,-24.19,10.17,-13.06,0.44,-15.92,1.5,-19.09,2.83,-21.64,3.97,-22.64,4.45,-22.8,5.06,-23.21,6.55,-23.72,8.42,-24.19,10.17,-8.8,-2.03,-12.71,-0.83,-17.04,0.51,-20.55,1.59,-21.99,2.03,-22.23,2.92,-22.81,5.08,-23.53,7.75,-24.19,10.17]},{"duration":60,"tweenEasing":0,"value":[-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19,0,-24.19]},{"value":[-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34,-24.19,-20.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.05_01","timeline":[{"name":"B_EYE_BALL.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17,0,10.17]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34,0,-20.34]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.05_02","timeline":[{"name":"B_EYE_BALL.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17,15.39,10.17]},{"duration":60,"tweenEasing":0,"value":[15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39,0,15.39]},{"value":[15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34,15.39,-20.34]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EYE_BALL.10","timeline":[{"name":"B_EYE_BALL.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EYE_BALL.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EYE_BALL.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.10_00","timeline":[{"name":"B_EYE_BALL.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67,-18.17,9.67]},{"duration":60,"tweenEasing":0,"value":[-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17,0,-18.17]},{"value":[-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33,-18.17,-19.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.10_01","timeline":[{"name":"B_EYE_BALL.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6,0,11.6]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33,0,-19.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EYE_BALL.10_02","timeline":[{"name":"B_EYE_BALL.10","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.17,11.6,18.39,11.81,18.52,12.19,18.74,12.34,18.84,11.96,18.61,10.75,18.35,9.87,17.74,9.31,17.13,9,16.84,8.85,18.92,12.33,19.27,12.85,19.79,12.63,20.06,11.35,19.68,8.7,18.54,6.5,16.68,4.45,14.81,2.89,13.62,2.18,19.59,12.96,20.19,13.53,21.03,12.74,21.5,10.35,21,6.16,18.76,2.5,15.37,-1.43,11.97,-4.61,9.65,-6.07,20.18,13.53,21.03,14.21,22.17,12.94,22.82,9.55,22.2,3.87,18.99,-1.18,14.19,-6.79,9.36,-11.42,6.06,-13.53]},{"duration":60,"tweenEasing":0,"value":[18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17,0,18.17]},{"value":[18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33,18.17,-19.33]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.03","timeline":[{"name":"B_BROW.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.03_00","timeline":[{"name":"B_BROW.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.44,42.44,28.42,42.44,28.41,42.44,28.4,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.44,42.44,28.43,42.44,28.42,42.44,28.41,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.44,42.44,28.43,42.44,28.42,42.44,28.41,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.43,42.44,28.43,42.44,28.42,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.44,42.44,28.43,42.44,28.43,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.44,42.44,28.43,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.44,42.44,28.44,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.45,42.44,28.44,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.46,42.44,28.45,42.44,28.45]},{"duration":60,"tweenEasing":0,"value":[41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.04,41.61,-0.05,41.61,-0.06,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.05,41.61,-0.05,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.04,41.61,-0.05,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.04,41.61,-0.04,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.03,41.61,-0.04,41.61,-0.04,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02,41.61,-0.03,41.61,-0.03,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02,41.61,-0.03,41.61,-0.03,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02,41.61,-0.02,41.61,0,41.61,0,41.61,0,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.01,41.61,-0.02,41.61,-0.02]},{"value":[41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.74,41.61,-20.76,41.61,-20.77,41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.74,41.61,-20.75,41.61,-20.76,41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.75,41.61,-20.75,41.61,-20.7,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.74,41.61,-20.75,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.74,41.61,-20.74,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.73,41.61,-20.73,41.61,-20.74,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.72,41.61,-20.73,41.61,-20.73,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.72,41.61,-20.73,41.61,-20.73,41.61,-20.7,41.61,-20.7,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.71,41.61,-20.72,41.61,-20.72,41.61,-20.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.03_01","timeline":[{"name":"B_BROW.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46,0,28.46]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7,0,-20.7]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.03_02","timeline":[{"name":"B_BROW.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46,-16.66,28.46]},{"duration":60,"tweenEasing":0,"value":[-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66,0,-16.66]},{"value":[-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7,-16.66,-20.7]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.04","timeline":[{"name":"B_BROW.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.04_00","timeline":[{"name":"B_BROW.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.86,26.13,-26.86,26.13,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.85,26.13,-26.86,26.13,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.85,26.12,-26.86,26.13,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.85,26.11,-26.85,26.12,-26.86,26.12,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.1,-26.86,26.11,-26.86,26.12,-26.86,26.12,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.11,-26.86,26.11,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.11,-26.86,26.11,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.1,-26.86,26.1,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.85,26.09,-26.86,26.1,-26.86,26.1]},{"duration":60,"tweenEasing":0,"value":[-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.86,0.03,-26.86,0.04,-26.86,0.05,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.86,0.04,-26.86,0.04,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.85,0.04,-26.86,0.04,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.85,0.03,-26.86,0.04,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0.01,-26.85,0.02,-26.86,0.03,-26.86,0.03,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.02,-26.86,0.02,-26.86,0.02,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.01,-26.86,0.02,-26.86,0.02,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.01,-26.86,0.02,-26.86,0.02,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.85,0,-26.86,0.01,-26.86,0.01,-26.86,0.01]},{"value":[-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.86,-26.86,-20.84,-26.86,-20.82,-26.86,-20.82,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.86,-26.85,-20.85,-26.86,-20.83,-26.86,-20.83,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.86,-26.85,-20.85,-26.85,-20.83,-26.86,-20.83,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.85,-26.85,-20.84,-26.86,-20.83,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.85,-26.85,-20.84,-26.86,-20.84,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.85,-26.86,-20.84,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.85,-26.86,-20.85,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.85,-26.86,-20.85,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.85,-20.87,-26.86,-20.86,-26.86,-20.86,-26.86,-20.85]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.04_01","timeline":[{"name":"B_BROW.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09,0,26.09]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87,0,-20.87]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.04_02","timeline":[{"name":"B_BROW.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09,17.85,26.09]},{"duration":60,"tweenEasing":0,"value":[17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85,0,17.85]},{"value":[17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87,17.85,-20.87]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.05","timeline":[{"name":"B_BROW.05_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.05_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_BROW.05_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.05_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_BROW.05_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_00","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-59.36,-43.36,-52.32,-65.17,-44.99,-85.95,-36.15,-96.75,-28.73,-97.1,-21.99,-94.34,-20.35,-99.72,-21.49,-106.79,-22.72,-113.66,-56.04,-39.6,-49.22,-60.61,-43,-80.41,-35.82,-91.56,-31.08,-93.07,-27.57,-93.23,-26.97,-100.21,-28.59,-107.79,-30.29,-115.22,-53.15,-35.78,-46.44,-56.1,-41.15,-75.08,-35.57,-86.61,-33.23,-89.2,-32.65,-92.18,-33.04,-100.65,-35.09,-108.71,-37.23,-116.65,-52.45,-30.7,-45.82,-51.45,-40.42,-70.96,-35.62,-82.96,-33.54,-86.52,-33.35,-91.45,-34.14,-100.32,-36.22,-108.69,-38.37,-117.04,-46.13,-23.72,-41.8,-46.16,-38.09,-67.37,-34.13,-79.74,-33.58,-84.86,-34.14,-90.78,-34.63,-98.72,-35.69,-107.91,-36.84,-117.34,-40.22,-15.62,-38.06,-39.57,-35.93,-62.36,-32.76,-75.14,-33.72,-82.44,-34.95,-89.94,-35.11,-97.12,-35.16,-107.13,-35.32,-117.64,-36.68,-8.87,-34.4,-33.3,-31.03,-56.77,-28.17,-70.23,-30.34,-79.91,-32.5,-89.59,-32.71,-97.27,-32.75,-107.32,-32.85,-117.81,-26.22,-3.77,-25.4,-28.56,-23.87,-52.43,-22.35,-67.06,-23.59,-78.25,-24.84,-89.45,-25.03,-98.19,-25.32,-108.16,-25.67,-118.38,-14.96,1.29,-15.91,-23.86,-16.73,-48.22,-16.64,-63.91,-16.64,-76.61,-16.64,-89.31,-16.78,-99.12,-17.35,-109.03,-17.97,-119]},{"duration":60,"tweenEasing":0,"value":[-49.02,-22.03,-40.49,-42.85,-31.66,-62.88,-21.85,-75.04,-14.73,-82.44,-8.29,-88.4,-6.39,-96.3,-6.39,-105.65,-6.39,-115,-41.78,-19.68,-32.97,-40.41,-24.55,-60.16,-15.63,-72.77,-10.1,-80.82,-6.22,-88.47,-5.23,-97.18,-5.43,-106.33,-5.63,-115.47,-35.04,-17.51,-25.92,-38.15,-17.87,-57.62,-9.81,-70.64,-5.7,-79.28,-4.21,-88.52,-4.1,-98,-4.48,-106.96,-4.87,-115.9,-32.33,-16.26,-23.32,-37.14,-15.21,-56.89,-7.8,-69.94,-3.94,-78.59,-2.97,-88.37,-3.28,-98.13,-3.68,-107.07,-4.1,-115.97,-24.38,-14.72,-18.34,-36.26,-12.56,-56.7,-6.86,-69.61,-4,-78.37,-2.8,-87.77,-2.91,-97.27,-3.12,-106.39,-3.34,-115.51,-16.56,-13.18,-13.8,-34.92,-11.04,-55.64,-7.13,-68.15,-4.7,-77.51,-2.69,-87.02,-2.54,-96.4,-2.55,-105.72,-2.58,-115.04,-14.03,-11.72,-12.15,-33.55,-9.78,-54.53,-6.82,-67.41,-4.43,-77.16,-2.05,-86.91,-1.82,-96.3,-1.82,-105.65,-1.82,-115,-7.56,-10.55,-6.59,-32.65,-5.32,-54.01,-3.66,-67.82,-2.42,-77.38,-1.18,-86.93,-1.06,-96.3,-1.06,-105.65,-1.06,-115,-0.63,-9.38,-0.65,-31.75,-0.61,-53.54,-0.3,-68.26,-0.3,-77.61,-0.3,-86.96,-0.3,-96.3,-0.3,-105.65,-0.3,-115]},{"value":[-45.02,-11.14,-31.39,-34.02,-17.86,-56.01,-6.72,-69.31,1.78,-78.75,9.58,-86.77,11.61,-95.48,11.61,-105.5,11.61,-115.52,-33.61,-10.18,-21.44,-32.59,-9.99,-53.81,-0.01,-67.48,7.1,-77.37,12.56,-86.86,13.81,-96.29,14.02,-105.92,14.22,-115.53,-23.01,-9.29,-12.17,-31.24,-2.65,-51.8,6.26,-65.75,12.14,-76.04,15.41,-86.93,15.89,-97.05,16.3,-106.32,16.7,-115.54,-19.45,-8.45,-9.24,-30.36,0.02,-51.13,8.45,-65.26,14.1,-75.45,16.87,-86.77,16.94,-97.19,17.4,-106.39,17.94,-115.54,-12.87,-7.83,-4.82,-29.98,2.99,-51.27,10.27,-65.79,14.51,-75.68,17.08,-86.22,17.36,-96.38,18.22,-105.97,19.16,-115.53,-6.43,-7.2,-0.85,-29.17,4.85,-50.47,10.88,-65.2,14.26,-75.28,17.22,-85.52,17.79,-95.57,19.05,-105.55,20.37,-115.52,-4.25,-6.04,0.56,-28.08,5.86,-49.6,11.29,-64.55,14.73,-74.92,18.18,-85.28,18.82,-95.36,20.04,-105.39,21.29,-115.41,1.37,-5.73,5.44,-28.05,9.91,-49.83,14.5,-64.94,17.39,-74.92,20.28,-84.9,20.77,-94.93,21.61,-104.96,22.47,-114.98,7.38,-5.48,10.67,-28.07,14.19,-50.11,17.92,-65.36,20.2,-74.92,22.48,-84.49,22.81,-94.47,23.24,-104.49,23.7,-114.52]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_01","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-31.67,-12.22,-28.14,-26.28,-24.42,-39.97,-20.94,-48.8,-20.33,-48.55,-19.72,-48.31,-19.96,-53.55,-21.1,-57.73,-22.33,-61.72,-34.05,-9.74,-31.71,-24.68,-29.4,-39.01,-26.8,-47.33,-26.64,-47.49,-26.47,-47.66,-26.82,-53.35,-28.24,-58.82,-29.74,-64.19,-36.48,-7.11,-35.21,-22.98,-34.11,-38.04,-32.33,-45.86,-32.52,-46.46,-32.71,-47.05,-33.16,-53.14,-34.83,-59.81,-36.58,-66.47,-37.88,-3.35,-36.92,-19.86,-35.7,-35.45,-34.28,-43.05,-34.33,-44.89,-34.39,-46.72,-34.83,-52.67,-36.5,-59.78,-38.22,-66.99,-33.17,2.35,-33.69,-14.35,-34.17,-30.08,-33.72,-38.05,-34.33,-42.22,-34.94,-46.39,-35.22,-51.75,-36.07,-58.91,-37,-66.38,-29.02,8.61,-30.83,-9.22,-32.71,-26.14,-33.17,-35.02,-34.33,-40.67,-35.5,-46.32,-35.61,-50.82,-35.65,-58.05,-35.78,-65.77,-28.42,13.43,-29.63,-5.47,-30.41,-23.45,-30.74,-32.97,-32.4,-39.69,-34.05,-46.41,-34.22,-51.1,-34.26,-58.26,-34.35,-65.86,-26.14,18.51,-27.3,-0.77,-28.16,-19.08,-28.37,-28.84,-28.43,-37.51,-28.5,-46.18,-28.58,-52.02,-28.87,-59.11,-29.22,-66.43,-23.67,23.62,-24.9,4.05,-26.04,-14.53,-26.16,-24.49,-24.33,-35.22,-22.51,-45.94,-22.48,-52.95,-23.05,-59.98,-23.67,-67.05]},{"duration":60,"tweenEasing":0,"value":[-10.67,3.78,-7.14,-10.9,-3.42,-25.16,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-8.82,3.61,-5.83,-11.37,-2.78,-25.78,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-7.1,3.45,-4.61,-11.84,-2.16,-26.4,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-6.27,3.47,-4.09,-12.04,-1.71,-26.75,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,-2,4.18,-1.43,-11.51,-0.78,-26.42,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,2.27,4.89,1.24,-10.98,0.14,-26.12,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,2.52,5.25,1.38,-10.8,0.28,-26.11,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,1.95,6.39,1.06,-10.18,0.22,-25.96,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05,1.33,7.62,0.72,-9.49,0.15,-25.78,0,-34.76,0,-41.22,0,-47.68,0,-54.13,0,-60.59,0,-67.05]},{"value":[9.34,8.68,12.87,-6.68,16.59,-21.62,20,-31.9,20,-39.04,20,-46.17,20,-53.31,20,-60.44,20,-67.58,11.19,8.5,14.18,-7.16,17.23,-22.24,20,-31.9,20,-39.03,20,-46.17,20,-53.31,20,-60.44,20,-67.58,12.9,8.34,15.39,-7.62,17.85,-22.86,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.58,13.74,8.37,15.91,-7.82,18.3,-23.21,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,18.01,9.08,18.58,-7.3,19.22,-22.88,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,22.27,9.78,21.25,-6.77,20.15,-22.58,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,22.53,10.14,21.38,-6.59,20.29,-22.57,20,-31.9,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,21.96,11.28,21.07,-5.96,20.22,-22.42,20,-31.89,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57,21.34,12.52,20.72,-5.27,20.15,-22.24,20,-31.89,20,-39.03,20,-46.17,20,-53.3,20,-60.44,20,-67.57]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_02","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-21,-16,-21,-15.38,-21,-14.81,-20.94,-14.04,-20.33,-7.33,-19.72,-0.63,-19.96,0.58,-21.1,2.86,-22.33,5.33,-25.23,-13.35,-25.88,-13.3,-26.62,-13.24,-26.8,-12.57,-26.64,-6.27,-26.47,0.02,-26.82,0.78,-28.24,1.77,-29.74,2.86,-29.38,-10.56,-30.6,-11.12,-31.95,-11.63,-32.33,-11.1,-32.52,-5.24,-32.71,0.62,-33.16,0.99,-34.83,0.78,-36.58,0.58,-31.61,-6.83,-32.83,-7.79,-33.98,-8.64,-34.28,-8.3,-34.33,-3.67,-34.39,0.95,-34.83,1.46,-36.5,0.81,-38.22,0.06,-31.17,-1.83,-32.26,-2.76,-33.37,-3.54,-33.72,-3.29,-34.33,-1,-34.94,1.29,-35.22,2.38,-36.07,1.68,-37,0.67,-31.28,3.72,-32.07,1.79,-32.85,0.04,-33.17,-0.26,-34.33,0.55,-35.5,1.35,-35.61,3.31,-35.65,2.54,-35.78,1.28,-30.94,8.19,-31.02,5.3,-30.7,2.6,-30.74,1.79,-32.4,1.53,-34.05,1.27,-34.22,3.03,-34.26,2.33,-34.35,1.19,-28.09,12.12,-28.37,9.39,-28.38,6.85,-28.37,5.92,-28.43,3.71,-28.5,1.49,-28.58,2.12,-28.87,1.49,-29.22,0.62,-25,16,-25.62,13.53,-26.19,11.25,-26.16,10.27,-24.33,6,-22.51,1.73,-22.48,1.19,-23.05,0.62,-23.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[22.67,4.89,28.76,3.25,34.61,1.79,37.89,2.08,39.84,3.35,41.22,4.06,40.75,3.2,38.47,1.39,36,-0.53,20.2,4.89,25.48,3.65,30.39,2.54,33.1,2.45,35.08,2.85,36.3,2.91,35.96,2.14,34.23,0.84,32.3,-0.53,17.92,4.89,22.45,4.04,26.51,3.25,28.68,2.78,30.71,2.38,31.76,1.84,31.53,1.14,30.3,0.32,28.87,-0.52,17.57,4.89,21.72,4.22,25.65,3.54,27.51,2.86,29.49,2.18,30.48,1.51,30.26,0.83,29.13,0.15,27.94,-0.52,20.01,4.89,23.09,4.22,25.94,3.54,27.17,2.86,28.5,2.19,29.28,1.51,29.12,0.83,28.26,0.15,27.33,-0.52,22.44,4.89,24.46,4.22,26.23,3.54,26.83,2.86,27.52,2.19,28.07,1.51,27.97,0.83,27.38,0.15,26.72,-0.52,22.67,4.9,24.24,4.22,25.82,3.54,26.28,2.86,26.83,2.19,27.37,1.51,27.28,0.83,26.75,0.16,26.23,-0.52,22.67,4.9,23.48,4.22,24.3,3.54,24.55,2.86,24.83,2.19,25.11,1.51,25.06,0.83,24.79,0.16,24.52,-0.52,22.67,4.9,22.67,4.22,22.67,3.54,22.67,2.87,22.67,2.19,22.67,1.51,22.67,0.83,22.67,0.16,22.67,-0.52]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_03","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-21.79,33.85,-20.02,39.08,-18.33,44.37,-17.13,50.73,-16.68,60.1,-16.87,69.05,-17.51,74.74,-19.88,78.7,-22.46,82.49,-26.92,36.5,-25.84,40.79,-24.9,45.21,-23.81,51.51,-23.35,61.65,-23.64,70.95,-24.45,76.08,-27.2,78.94,-30.13,81.56,-31.92,39.28,-31.44,42.61,-31.13,46.14,-30.11,52.34,-29.57,63.18,-29.93,72.74,-30.88,77.34,-33.97,79.17,-37.24,80.7,-34.73,42.93,-34.25,45.83,-33.76,48.99,-32.71,54.95,-31.96,64.85,-32.06,73.39,-33,78,-36.07,79.52,-39.21,80.63,-36.1,46.89,-35.57,50.56,-35.15,54.48,-34.58,60.36,-34.76,67.11,-35.42,73.11,-35.92,78.73,-37.35,80.76,-38.9,82.21,-38.04,51.43,-37.27,54.82,-36.63,58.45,-36.45,63.79,-37.56,68.27,-38.78,72.55,-38.85,79.47,-38.64,81.99,-38.59,83.79,-37.97,56.19,-36.69,58.62,-35.02,61.29,-34.7,66.1,-36.29,69.2,-37.88,72.3,-37.95,79.17,-37.67,81.64,-37.36,83.43,-34.82,61.64,-34.25,63.93,-33.42,66.48,-33.16,71.03,-32.89,71.8,-32.63,72.57,-32.53,78.06,-32.25,80.01,-31.94,81.43,-31.38,67.18,-31.69,69.41,-31.98,71.91,-31.82,76.25,-29.38,74.56,-26.95,72.87,-26.64,76.92,-26.36,78.28,-26.05,79.27]},{"duration":60,"tweenEasing":0,"value":[3.71,49.85,5.48,54.46,7.17,59.18,8.32,64.77,8.15,67.43,7.36,69.68,6.95,74.16,5.72,75.83,4.38,77.15,2.81,49.85,4.55,54.09,6.22,58.45,7.5,64.08,7.79,67.93,7.33,70.93,6.88,75.3,5.54,77.17,4.11,78.7,1.96,49.85,3.66,53.73,5.31,57.76,6.72,63.44,7.45,68.42,7.28,72.12,6.78,76.36,5.36,78.4,3.84,80.12,1.38,49.75,3.07,53.62,4.72,57.63,6.08,63.26,6.88,68.53,6.83,72.44,6.33,76.54,4.93,78.71,3.51,80.58,-0.44,48.73,1.18,53.32,2.72,58.02,3.65,63.65,4.08,68.12,4.02,71.82,3.8,76.35,3.22,79.08,2.6,81.55,-2.26,47.7,-0.71,53.03,0.72,58.41,1.21,64.05,1.28,67.72,1.22,71.2,1.27,76.15,1.51,79.45,1.69,82.51,-2.54,48,-1.17,53.32,0.18,58.7,0.54,64.3,0.61,67.67,0.68,71.04,0.76,76.12,1.09,79.3,1.49,82.24,-2.23,49.53,-1.38,54.54,-0.54,59.64,-0.29,65.11,0.04,68.1,0.37,71.08,0.54,75.94,1.12,78.52,1.78,80.82,-1.88,51.18,-1.57,55.87,-1.29,60.66,-1.16,65.98,-0.55,68.56,0.06,71.14,0.34,75.73,1.19,77.66,2.12,79.27]},{"value":[29.05,54.74,36.9,57.71,44.45,60.97,48.87,66.85,50.66,70.78,51.24,73.73,50.37,77.36,46.85,77.22,43.04,76.63,25.99,54.74,33.14,57.53,39.91,60.61,44,66.24,45.82,70.63,46.31,73.82,45.5,77.44,42.44,78.01,39.07,78.17,23.14,54.74,29.62,57.37,35.71,60.29,39.48,65.66,41.34,70.5,41.74,73.92,40.98,77.5,38.33,78.73,35.38,79.6,22.26,54.64,28.36,57.39,34.32,60.36,37.75,65.51,39.55,70.39,40.01,73.92,39.25,77.38,36.73,78.86,34.11,80.05,22.57,53.62,27.41,57.29,31.98,61.13,34.25,66.2,35.5,70.14,35.98,73.31,35.58,77.18,34.15,79.23,32.6,81.02,22.88,52.6,26.45,57.2,29.63,61.89,30.74,66.88,31.44,69.89,31.95,72.71,31.9,76.98,31.56,79.6,31.08,81.99,22.8,52.89,25.74,57.54,28.67,62.24,29.49,67.17,30.1,69.86,30.71,72.55,30.71,76.95,30.51,79.46,30.39,81.72,23.11,54.42,24.76,58.76,26.43,63.18,26.93,67.98,27.54,70.28,28.15,72.59,28.27,76.77,28.58,78.68,28.97,80.29,23.46,56.08,23.76,60.09,24.05,64.2,24.18,68.85,24.79,70.75,25.39,72.65,25.67,76.56,26.52,77.82,27.45,78.75]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.05_04","timeline":[{"name":"B_BROW.05","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-22.58,83.69,-19.04,93.54,-15.66,103.55,-13.31,115.5,-13.03,127.54,-14.01,138.72,-15.05,148.9,-18.67,154.53,-22.58,159.64,-28.61,86.34,-25.79,94.87,-23.18,103.66,-20.81,115.6,-20.05,129.59,-20.82,141.88,-22.07,151.38,-26.16,156.1,-30.52,160.26,-34.46,89.13,-32.28,96.34,-30.32,103.9,-27.88,115.78,-26.62,131.6,-27.15,144.86,-28.59,153.69,-33.11,157.57,-37.9,160.83,-37.84,92.68,-35.68,99.44,-33.53,106.61,-31.13,118.21,-29.59,133.38,-29.74,145.84,-31.18,154.54,-35.64,158.23,-40.21,161.21,-41.04,95.62,-38.87,103.88,-36.93,112.49,-35.44,124,-35.19,135.23,-35.9,144.93,-36.63,155.06,-38.63,159.84,-40.8,163.76,-44.8,99.13,-42.47,107.84,-40.4,116.85,-39.74,127.83,-40.78,135.99,-42.06,143.75,-42.08,155.62,-41.63,161.44,-41.4,166.3,-45.01,104.18,-42.36,111.95,-39.34,119.98,-38.66,130.4,-40.18,136.87,-41.7,143.34,-41.69,155.3,-41.08,160.95,-40.37,165.67,-41.55,111.17,-40.13,118.48,-38.46,126.12,-37.94,136.15,-37.35,139.9,-36.76,143.65,-36.49,154.01,-35.63,158.54,-34.66,162.25,-37.77,118.36,-37.77,125.28,-37.77,132.57,-37.48,142.23,-34.43,143.12,-31.39,144.01,-30.81,152.64,-29.67,155.95,-28.43,158.54]},{"duration":60,"tweenEasing":0,"value":[7.42,99.69,10.96,108.93,14.34,118.36,16.63,129.54,16.31,134.87,14.72,139.35,13.9,148.32,11.43,151.66,8.75,154.3,5.62,99.69,9.09,108.17,12.44,116.9,14.99,128.17,15.59,135.86,14.65,141.85,13.75,150.61,11.09,154.34,8.22,157.39,3.92,99.69,7.32,107.46,10.63,115.53,13.45,126.89,14.9,136.84,14.56,144.23,13.57,152.72,10.73,156.8,7.69,160.24,2.77,99.5,6.14,107.24,9.45,115.26,12.15,126.51,13.75,137.06,13.65,144.88,12.65,153.09,9.86,157.42,7.01,161.15,-0.87,97.45,2.37,106.64,5.45,116.04,7.29,127.31,8.15,136.25,8.04,143.64,7.59,152.69,6.44,158.16,5.2,163.09,-4.52,95.41,-1.41,106.06,1.45,116.81,2.43,128.1,2.56,135.44,2.44,142.39,2.53,152.3,3.02,158.89,3.38,165.03,-5.07,96,-2.34,106.64,0.36,117.39,1.08,128.61,1.22,135.34,1.35,142.07,1.52,152.25,2.18,158.61,2.99,164.48,-4.47,99.05,-2.76,109.09,-1.08,119.27,-0.57,130.23,0.08,136.19,0.74,142.16,1.09,151.89,2.25,157.04,3.56,161.63,-3.77,102.36,-3.15,111.75,-2.58,121.32,-2.32,131.97,-1.1,137.12,0.12,142.27,0.67,151.46,2.38,155.33,4.23,158.54]},{"value":[35.43,104.59,45.05,112.17,54.28,120.15,59.86,131.62,61.48,138.22,61.27,143.41,59.99,151.52,55.23,153.05,50.09,153.78,31.78,104.59,40.79,111.42,49.44,118.69,54.91,130.03,56.56,138.41,56.33,144.73,55.05,152.75,50.65,155.18,45.85,156.87,28.36,104.59,36.8,110.71,44.91,117.33,50.29,128.54,51.97,138.62,51.73,146.01,50.43,153.87,46.37,157.13,41.89,159.72,26.95,104.4,35,110.57,42.99,117.18,47.99,128.16,49.62,138.61,49.54,146.33,48.25,153.92,44.33,157.57,40.29,160.63,25.13,102.35,31.72,110.37,38.01,118.71,41.32,129.53,42.49,138.1,42.68,145.12,42.04,153.52,40.03,158.32,37.86,162.57,23.32,100.3,28.45,110.19,33.04,120.23,34.66,130.9,35.37,137.6,35.83,143.91,35.83,153.13,35.74,159.05,35.44,164.51,22.93,100.89,27.24,110.86,31.52,120.93,32.7,131.47,33.38,137.52,34.05,143.58,34.14,153.08,34.26,158.77,34.55,163.96,23.54,103.95,26.05,113.31,28.56,122.82,29.31,133.09,30.24,138.38,31.18,143.67,31.49,152.72,32.37,157.2,33.41,161.11,24.24,107.26,24.86,115.97,25.43,124.87,25.68,134.83,26.9,139.31,28.12,143.78,28.67,152.29,30.38,155.49,32.23,158.02]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_BROW.06","timeline":[{"name":"B_BROW.06_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_BROW.06_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_BROW.06_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_BROW.06_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_BROW.06_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_00","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-34.58,-117.44,-33.35,-118.91,-32.21,-119.67,-31.44,-113.49,-30.25,-103.6,-29.64,-94.27,-30.1,-85.69,-32.1,-75.33,-34.26,-64.76,-40.57,-117.75,-39.2,-118.12,-37.84,-117.88,-36.79,-111.79,-35.49,-103.41,-34.54,-95.39,-35.37,-87.15,-37.94,-77.93,-40.41,-68.59,-46.14,-118.03,-44.65,-117.37,-43.09,-116.19,-41.78,-110.23,-40.53,-103.32,-39.41,-96.56,-40.55,-88.63,-43.47,-80.52,-46.12,-72.4,-47.32,-118.08,-45.91,-117.06,-44.38,-115.58,-43.14,-109.84,-42.77,-104.05,-42.39,-98.25,-43.51,-90.63,-45.64,-83.51,-47.84,-76.48,-41.66,-117.77,-40.92,-116.75,-40.16,-115.25,-39.46,-109.46,-39,-104.78,-38.55,-100.11,-39.72,-92.97,-42.09,-86.6,-44.55,-80.33,-36,-117.46,-35.93,-116.45,-35.93,-114.92,-35.75,-109.16,-34.96,-105.87,-34.16,-102.58,-35.39,-95.63,-38.07,-89.42,-40.85,-83.34,-35.17,-117.21,-35.15,-116.19,-35.14,-114.65,-35.11,-108.96,-34.8,-107.17,-34.49,-105.39,-35.44,-98.88,-37.49,-93.57,-39.68,-88.44,-32.9,-116.36,-32.82,-115.27,-32.75,-113.67,-32.71,-108.17,-32.53,-108.3,-32.35,-108.43,-32.87,-102.26,-34.1,-97.67,-35.41,-93.34,-30.41,-115.43,-30.25,-114.27,-30.11,-112.61,-30.07,-107.31,-29.92,-109.42,-29.77,-111.53,-29.86,-105.65,-30.29,-101.71,-30.76,-98.08]},{"duration":60,"tweenEasing":0,"value":[3.75,-114.78,3.75,-116.24,3.75,-117,3.75,-111.79,3.75,-108.27,3.74,-104.74,3.3,-96.91,1.59,-87.4,-0.26,-77.76,2.08,-114.77,2.35,-115.42,2.62,-115.41,2.75,-109.91,3.31,-106.1,3.87,-102.3,3.7,-94.94,2.81,-86.98,1.77,-78.99,0.51,-114.77,1.03,-114.64,1.55,-113.92,1.79,-108.16,2.87,-104.11,3.95,-100.05,4.03,-93.1,3.9,-86.58,3.61,-80.13,-0.11,-114.83,0.46,-114.4,1.02,-113.42,1.27,-107.73,2.46,-103.6,3.65,-99.46,3.76,-92.45,3.73,-86.36,3.65,-80.42,0.67,-115.44,0.98,-114.74,1.26,-113.5,1.42,-107.73,2.33,-103.59,3.24,-99.46,3.18,-92.44,2.61,-86.36,1.99,-80.42,1.46,-116.04,1.5,-115.08,1.51,-113.59,1.57,-107.73,2.2,-103.59,2.83,-99.45,2.6,-92.44,1.49,-86.36,0.33,-80.42,0.84,-116.1,0.93,-115.01,0.98,-113.41,1.04,-107.53,1.65,-103.81,2.25,-100.09,2.03,-93.06,0.97,-86.76,-0.07,-80.56,-0.74,-116.1,-0.39,-114.75,-0.1,-112.92,0.03,-107.11,0.64,-104.66,1.25,-102.22,1.15,-95.12,0.6,-88.1,0.06,-81.13,-2.41,-116.1,-1.79,-114.47,-1.22,-112.38,-1.02,-106.68,-0.42,-105.59,0.19,-104.5,0.25,-97.33,0.24,-89.54,0.24,-81.75]},{"value":[29.76,-113.28,32.22,-115.38,34.5,-116.77,35.11,-112.13,35.41,-108.47,35.71,-104.81,35.08,-98.3,32.51,-92.43,29.73,-86.65,28.08,-113.28,31.63,-114.83,35.01,-115.71,36.25,-110.86,37.28,-107,37.88,-103.14,37.69,-96.57,36.7,-90.55,35.47,-84.64,26.51,-113.28,31.07,-114.31,35.45,-114.72,37.3,-109.69,39,-105.64,39.85,-101.59,40.05,-94.96,40.51,-88.83,40.73,-82.79,25.89,-113.33,30.48,-114.12,34.94,-114.31,37.03,-109.34,39,-105.27,39.82,-101.2,40.05,-94.6,40.75,-88.35,41.51,-82.17,26.68,-113.94,29.14,-114.19,31.42,-113.85,33.03,-108.78,35.56,-105.04,36.9,-101.31,37.16,-94.52,37.79,-87.57,38.49,-80.64,27.46,-114.55,27.79,-114.25,27.9,-113.41,29.02,-108.21,32.12,-104.81,33.97,-101.41,34.26,-94.45,34.83,-86.8,35.46,-79.12,26.84,-114.6,26.94,-114.14,26.98,-113.18,27.88,-107.99,30.79,-104.7,32.74,-101.41,33.04,-94.46,33.52,-86.65,33.94,-78.79,25.27,-114.6,25.61,-113.88,25.9,-112.68,26.48,-107.44,28.57,-104.34,30.19,-101.24,30.33,-94.24,30.31,-86.2,30.22,-78.08,23.59,-114.6,24.21,-113.61,24.78,-112.15,25.03,-106.85,26.25,-103.95,27.47,-101.05,27.43,-94,26.86,-85.7,26.24,-77.3]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_01","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-33.79,-58.72,-33.17,-59.45,-32.6,-59.83,-32.24,-56.6,-31.88,-50.05,-31.8,-43.79,-32.05,-39.13,-33.05,-33.09,-34.13,-26.88,-36.79,-58.87,-36.6,-59.16,-36.44,-59.14,-36.05,-55.95,-35.42,-50.22,-34.96,-44.66,-35.38,-40.19,-36.66,-34.81,-37.9,-29.33,-39.57,-59.02,-39.81,-58.88,-40.01,-58.48,-39.6,-55.38,-38.79,-50.49,-38.06,-45.66,-38.61,-41.36,-40.07,-36.63,-41.4,-31.85,-40.16,-59.04,-40.53,-58.75,-40.81,-58.21,-40.44,-55.33,-40.04,-51.53,-39.63,-47.73,-40.19,-43.72,-41.33,-39.69,-42.45,-35.68,-37.33,-58.88,-37.54,-58.49,-37.69,-57.85,-37.47,-55.01,-37.13,-52.42,-36.78,-49.84,-37.36,-46.31,-38.54,-43.26,-39.71,-40.29,-34.5,-58.73,-34.55,-58.24,-34.57,-57.48,-34.48,-54.65,-34.07,-53.17,-33.67,-51.7,-34.23,-48.47,-35.37,-46.2,-36.55,-44.06,-33.59,-58.5,-33.62,-58.02,-33.63,-57.27,-33.62,-54.54,-33.49,-54.37,-33.36,-54.2,-33.79,-51.42,-34.63,-50.1,-35.57,-48.98,-30.53,-57.64,-30.62,-57.22,-30.7,-56.54,-30.72,-53.95,-30.75,-55.2,-30.78,-56.45,-31.06,-53.93,-31.67,-53.28,-32.36,-52.88,-27.2,-56.71,-27.36,-56.37,-27.5,-55.75,-27.55,-53.31,-27.71,-55.96,-27.86,-58.61,-27.99,-56.32,-28.41,-56.27,-28.88,-56.54]},{"duration":60,"tweenEasing":0,"value":[1.88,-57.39,1.88,-58.12,1.87,-58.5,1.87,-55.9,1.87,-54.13,1.87,-52.37,1.65,-48.45,0.8,-43.7,-0.13,-38.88,1.04,-57.39,1.17,-57.71,1.31,-57.7,1.37,-54.95,1.65,-53.05,1.94,-51.15,1.85,-47.47,1.41,-43.49,0.88,-39.5,0.25,-57.39,0.51,-57.32,0.77,-56.95,0.89,-54.08,1.44,-52.05,1.98,-50.03,2.02,-46.55,1.95,-43.29,1.81,-40.06,-0.05,-57.41,0.23,-57.2,0.51,-56.71,0.64,-53.87,1.23,-51.8,1.83,-49.73,1.88,-46.22,1.87,-43.18,1.82,-40.21,0.34,-57.72,0.49,-57.37,0.63,-56.75,0.71,-53.87,1.17,-51.8,1.62,-49.73,1.59,-46.22,1.3,-43.18,0.99,-40.21,0.73,-58.02,0.75,-57.54,0.75,-56.79,0.78,-53.86,1.1,-51.8,1.42,-49.73,1.3,-46.22,0.74,-43.18,0.17,-40.21,0.42,-58.05,0.47,-57.5,0.49,-56.71,0.52,-53.77,0.82,-51.9,1.13,-50.04,1.02,-46.53,0.49,-43.38,-0.04,-40.28,-0.37,-58.05,-0.19,-57.38,-0.05,-56.46,0.02,-53.56,0.32,-52.33,0.62,-51.11,0.58,-47.56,0.3,-44.05,0.03,-40.56,-1.2,-58.05,-0.9,-57.24,-0.61,-56.19,-0.51,-53.34,-0.21,-52.79,0.1,-52.25,0.12,-48.67,0.12,-44.77,0.12,-40.87]},{"value":[26.21,-55.89,27.44,-57.26,28.58,-58.27,28.89,-56.26,29.04,-54.75,29.19,-53.24,28.87,-50.3,27.59,-47.68,26.2,-45.11,25.38,-55.89,27.15,-56.98,28.84,-57.74,29.46,-55.63,29.97,-54.02,30.27,-52.4,30.18,-49.43,29.68,-46.74,29.06,-44.1,24.59,-55.89,26.87,-56.72,29.06,-57.24,29.98,-55.05,30.83,-53.34,31.26,-51.63,31.36,-48.63,31.59,-45.88,31.7,-43.17,24.28,-55.92,26.58,-56.63,28.8,-57.04,29.85,-54.87,30.83,-53.15,31.24,-51.43,31.36,-48.45,31.71,-45.64,32.09,-42.86,24.67,-56.22,25.9,-56.66,27.04,-56.81,27.85,-54.59,29.11,-53.04,29.78,-51.49,29.91,-48.41,30.23,-45.25,30.57,-42.1,25.06,-56.52,25.23,-56.69,25.28,-56.59,25.84,-54.3,27.39,-52.92,28.32,-51.54,28.46,-48.37,28.75,-44.86,29.06,-41.34,24.76,-56.55,24.8,-56.64,24.82,-56.47,25.27,-54.19,26.73,-52.86,27.7,-51.53,27.85,-48.38,28.09,-44.79,28.3,-41.17,23.97,-56.55,24.14,-56.51,24.29,-56.22,24.58,-53.92,25.62,-52.68,26.43,-51.45,26.5,-48.27,26.48,-44.56,26.44,-40.82,23.13,-56.55,23.44,-56.37,23.72,-55.96,23.85,-53.62,24.46,-52.49,25.07,-51.36,25.05,-48.15,24.76,-44.31,24.45,-40.43]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_02","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-33,0,-33,0,-33,0,-33.04,0.3,-33.5,3.5,-33.96,6.7,-34,7.44,-34,9.15,-34,11,-33,0,-34.01,-0.21,-35.04,-0.4,-35.32,-0.12,-35.35,2.97,-35.39,6.06,-35.39,6.78,-35.39,8.29,-35.39,9.94,-33,0,-34.96,-0.4,-36.93,-0.77,-37.42,-0.54,-37.06,2.35,-36.71,5.24,-36.67,5.91,-36.67,7.25,-36.67,8.7,-33,0,-35.15,-0.44,-37.24,-0.84,-37.74,-0.82,-37.31,0.98,-36.87,2.79,-36.87,3.19,-37.01,4.13,-37.07,5.13,-33,0,-34.16,-0.23,-35.23,-0.44,-35.48,-0.55,-35.25,-0.06,-35.02,0.43,-35,0.36,-34.99,0.07,-34.88,-0.25,-33,0,-33.16,-0.03,-33.21,-0.05,-33.21,-0.13,-33.19,-0.48,-33.17,-0.82,-33.07,-1.31,-32.67,-2.98,-32.26,-4.79,-32.02,0.22,-32.09,0.16,-32.12,0.1,-32.13,-0.11,-32.18,-1.56,-32.23,-3.02,-32.14,-3.96,-31.77,-6.63,-31.45,-9.52,-28.17,1.07,-28.43,0.82,-28.65,0.58,-28.73,0.26,-28.97,-2.1,-29.22,-4.47,-29.24,-5.61,-29.25,-8.88,-29.31,-12.42,-24,2,-24.46,1.54,-24.89,1.11,-25.04,0.7,-25.5,-2.5,-25.96,-5.7,-26.11,-6.98,-26.54,-10.83,-27,-15]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[22.67,1.49,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.67,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.49,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.67,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.86,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.3,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.23,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.93,22.66,-3.56,22.67,1.5,22.67,0.87,22.67,0.24,22.67,-0.4,22.67,-1.03,22.66,-1.66,22.66,-2.29,22.66,-2.92,22.66,-3.56]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_03","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-39.23,76.64,-39.22,70,-39.22,63.37,-39.7,59.44,-40.98,58.58,-42.78,54.58,-45.02,48.02,-46.65,39.13,-48.23,29.98,-39.85,76.93,-40.19,70.48,-40.53,64.02,-40.88,59.29,-41.32,57.09,-42.31,53.1,-44.54,46.09,-46.44,37.07,-48.28,27.88,-40.4,77.2,-41.05,70.92,-41.7,64.63,-41.92,59.05,-41.6,55.44,-41.85,51.4,-44.08,43.92,-46.24,34.77,-48.33,25.55,-40.1,77.24,-40.83,71.04,-41.53,64.82,-41.65,58.47,-41.21,53.12,-41.28,48.19,-43.52,40.22,-45.94,30.63,-48.19,21.01,-38.58,76.95,-39.07,70.93,-39.53,64.88,-39.59,58.48,-39.13,52.01,-38.96,45.78,-40.87,37.39,-42.8,26.44,-44.6,15.3,-37.05,76.66,-37.31,70.83,-37.53,64.95,-37.56,58.52,-37.36,51,-37.23,43.55,-38.81,34.6,-40.15,22.06,-41.43,9.18,-35.51,76.85,-35.77,70.88,-35.99,64.89,-36.05,58.28,-36.13,49.34,-36.21,40.41,-37.42,30.52,-38.79,16.97,-39.98,3.11,-31.21,77.7,-31.57,71.25,-31.88,64.81,-31.98,57.99,-32.13,48,-32.28,38.01,-32.83,27.26,-33.7,13.18,-34.49,-1.15,-26.59,78.62,-27.05,71.66,-27.47,64.74,-27.6,57.71,-27.83,46.73,-28.07,35.75,-27.94,24.19,-28.23,9.57,-28.59,-5.21]},{"duration":60,"tweenEasing":0,"value":[-7.23,76.64,-7.22,70,-7.22,63.37,-8.69,58.52,-11.61,53.83,-13.78,46.85,-17.51,38.36,-20.46,26.58,-23.23,14.48,-6.7,76.93,-6.73,70.58,-6.76,64.22,-7.72,58.81,-10.09,53.28,-12.52,46.34,-16.17,37.68,-19.2,26.26,-22.12,14.59,-6.17,77.2,-6.23,71.12,-6.3,65.01,-6.76,59.03,-8.59,52.67,-11.32,45.79,-14.9,36.94,-18.01,25.83,-21.1,14.57,-5.71,77.24,-5.79,71.26,-5.86,65.24,-6,58.83,-7.65,51.94,-10.55,45.11,-13.95,36.12,-17.21,24.99,-20.38,13.76,-5.33,76.95,-5.47,71.05,-5.61,65.1,-5.73,58.7,-6.78,51.66,-8.56,44.66,-11.19,35.71,-13.74,24.17,-16.22,12.43,-4.95,76.66,-5.16,70.84,-5.36,64.97,-5.45,58.57,-5.92,51.38,-6.57,44.21,-8.43,35.31,-10.26,23.34,-12.07,11.1,-4.5,76.63,-4.69,70.73,-4.87,64.79,-4.96,58.41,-5.4,51.13,-5.83,43.85,-7.17,34.63,-8.91,22.83,-10.42,10.84,-4.04,76.62,-4.14,70.44,-4.24,64.23,-4.27,57.74,-4.39,50.22,-4.51,42.69,-5.05,32.94,-5.9,21.65,-6.64,10.34,-3.59,76.62,-3.59,70.13,-3.58,63.63,-3.56,57.02,-3.33,49.23,-3.11,41.44,-2.83,31.17,-2.69,20.4,-2.59,9.79]},{"value":[15.44,78.14,15.44,70.86,15.45,63.6,13.98,58.12,11.06,52.8,8.89,45.18,5.15,36.06,2.2,23.65,-0.57,10.92,15.97,78.43,15.94,71.44,15.91,64.45,14.95,58.41,12.58,52.25,10.14,44.68,6.49,35.39,3.47,23.33,0.54,11.03,16.49,78.7,16.43,71.98,16.37,65.25,15.91,58.63,14.07,51.64,11.35,44.13,7.77,34.64,4.65,22.9,1.56,11.01,16.96,78.74,16.88,72.12,16.81,65.47,16.66,58.43,15.02,50.91,12.12,43.45,8.71,33.83,5.45,22.07,2.28,10.2,17.34,78.45,17.19,71.91,17.06,65.34,16.94,58.3,15.88,50.63,14.11,43,11.47,33.42,8.92,21.24,6.44,8.87,17.72,78.15,17.51,71.7,17.31,65.2,17.22,58.17,16.75,50.35,16.1,42.55,14.23,33.01,12.4,20.41,10.59,7.54,18.17,78.13,17.98,71.59,17.79,65.02,17.7,58.01,17.27,50.1,16.83,42.19,15.49,32.34,13.75,19.9,12.25,7.29,18.63,78.12,18.53,71.3,18.43,64.46,18.4,57.34,18.28,49.19,18.16,41.03,17.61,30.65,16.76,18.72,16.02,6.78,19.08,78.12,19.08,70.99,19.08,63.87,19.11,56.62,19.33,48.2,19.55,39.78,19.84,28.88,19.97,17.48,20.07,6.24]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_BROW.06_04","timeline":[{"name":"B_BROW.06","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-45.45,153.29,-45.45,140,-45.44,126.73,-46.34,118.58,-48.09,113.79,-49.6,103.14,-52.08,90.24,-55.24,71.46,-58.46,51.95,-46.71,153.87,-46.37,141.16,-46.01,128.44,-46.45,118.71,-47.15,111.47,-47.67,100.92,-49.8,86.87,-52.43,67.71,-55.16,48.04,-47.8,154.4,-47.14,142.24,-46.47,130.03,-46.46,118.67,-46.21,108.92,-45.84,98.44,-47.65,83.26,-49.84,63.73,-52.13,43.91,-47.2,154.48,-46.5,142.52,-45.81,130.48,-45.58,117.8,-45.05,105.73,-44.46,94.51,-46.25,78.55,-48.71,58.46,-51.12,38.16,-44.15,153.9,-43.99,142.1,-43.83,130.21,-43.64,117.54,-42.07,104.32,-40.45,91.6,-42.14,75.3,-44.88,53.62,-47.66,31.52,-41.11,153.31,-41.47,141.68,-41.85,129.94,-41.76,117.18,-39.71,102.5,-37.66,87.95,-39.28,70.97,-42.33,47.4,-45.46,23.2,-39.01,153.47,-39.46,141.61,-39.87,129.68,-39.83,116.66,-38.3,100.25,-36.78,83.84,-38.08,65.33,-41.15,40.78,-44.05,15.74,-34.25,154.32,-34.71,141.69,-35.12,129.04,-35.15,115.71,-34.36,98.1,-33.57,80.49,-34.04,60.28,-35.73,35.34,-37.35,10.12,-29.18,155.24,-29.63,141.79,-30.06,128.37,-30.16,114.73,-30.17,95.96,-30.18,77.19,-29.76,55.36,-29.92,29.97,-30.18,4.59]},{"duration":60,"tweenEasing":0,"value":[-14.45,153.29,-14.45,140,-14.44,126.73,-17.37,117.05,-23.22,107.67,-27.55,93.69,-35.02,76.71,-40.92,53.16,-46.46,28.95,-13.39,153.87,-13.45,141.16,-13.52,128.44,-15.44,117.62,-20.17,106.56,-25.05,92.69,-32.36,75.37,-38.39,52.53,-44.24,29.19,-12.35,154.4,-12.47,142.24,-12.59,130.03,-13.51,118.06,-17.19,105.35,-22.64,91.59,-29.81,73.87,-36.02,51.68,-42.2,29.15,-11.42,154.48,-11.58,142.52,-11.72,130.48,-12,117.66,-15.29,103.89,-21.09,90.22,-27.92,72.26,-34.42,49.99,-40.76,27.51,-10.65,153.9,-10.95,142.1,-11.22,130.21,-11.45,117.38,-13.57,103.33,-17.12,89.34,-22.38,71.42,-27.48,48.34,-32.45,24.86,-9.89,153.31,-10.32,141.68,-10.72,129.94,-10.9,117.13,-11.84,102.77,-13.13,88.43,-16.85,70.58,-20.53,46.67,-24.14,22.2,-9,153.25,-9.37,141.45,-9.75,129.57,-9.93,116.82,-10.79,102.26,-11.66,87.7,-14.33,69.26,-17.82,45.64,-20.83,21.69,-8.09,153.25,-8.28,140.87,-8.47,128.46,-8.54,115.48,-8.78,100.43,-9.01,85.39,-10.1,65.86,-11.81,43.31,-13.28,20.68,-7.18,153.24,-7.17,140.25,-7.17,127.26,-7.12,114.03,-6.67,98.46,-6.22,82.89,-5.65,62.34,-5.38,40.81,-5.18,19.59]},{"value":[8.22,154.78,8.22,140.86,8.23,126.96,5.29,116.64,-0.55,106.63,-4.89,92.03,-12.36,74.41,-18.25,50.23,-23.8,25.39,9.27,155.36,9.21,142.02,9.15,128.67,7.23,117.22,2.49,105.53,-2.38,91.03,-9.7,73.07,-15.73,49.6,-21.58,25.63,10.32,155.9,10.2,143.11,10.08,130.26,9.15,117.66,5.48,104.31,0.03,89.92,-7.14,71.57,-13.35,48.75,-19.54,25.59,11.25,155.98,11.09,143.38,10.95,130.71,10.66,117.26,7.38,102.85,1.57,88.56,-5.25,69.97,-11.76,47.06,-18.1,23.95,12.01,155.39,11.72,142.96,11.45,130.44,11.21,116.98,9.1,102.3,5.55,87.67,0.28,69.13,-4.81,45.41,-9.79,21.3,12.78,154.81,12.35,142.54,11.95,130.17,11.77,116.73,10.83,101.74,9.53,86.76,5.81,68.29,2.14,43.74,-1.48,18.64,13.67,154.75,13.3,142.32,12.92,129.81,12.74,116.42,11.87,101.23,11,86.04,8.33,66.97,4.84,42.72,1.83,18.13,14.58,154.75,14.39,141.74,14.19,128.69,14.12,115.08,13.89,99.4,13.65,83.72,12.57,63.57,10.85,40.39,9.38,17.12,15.49,154.74,15.5,141.12,15.5,127.5,15.55,113.63,16,97.43,16.45,81.23,17.01,60.05,17.28,37.88,17.49,16.03]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_MOUTH.03","timeline":[{"name":"B_MOUTH.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_MOUTH.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_MOUTH.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_MOUTH.03_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_MOUTH.03_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_00","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32,-44.57,-32.46,-64.72,-32.89,-84.59,-33,-99.68,-32.87,-104.31,-32.32,-91.74,-31.99,-83.25,-31.98,-83.12,-31.98,-82.63,-31.82,-37.67,-32.4,-57.7,-33.01,-77.4,-33.67,-92,-34.58,-97.6,-34.33,-88.73,-33.72,-82.11,-32.89,-82.55,-31.98,-82.74,-31.71,-30.71,-32.36,-50.68,-33.08,-70.3,-34.27,-84.45,-36.26,-90.94,-36.36,-85.62,-35.47,-80.82,-33.81,-81.9,-31.98,-82.83,-31.39,-22.18,-32.03,-42.7,-32.57,-62.68,-34.23,-77.3,-37.02,-84.38,-37.52,-81.96,-36.32,-79.39,-33.9,-81.71,-31.15,-84.01,-25.49,-13.91,-26.99,-34.4,-28.46,-53.92,-30.86,-69.71,-33.71,-77.89,-34.61,-78.78,-32.74,-79.84,-28.61,-84.37,-24.27,-89.03,-17.89,-6.68,-20.37,-26.77,-22.86,-45.41,-26.13,-61.98,-29.52,-71.17,-31.3,-75.21,-28.85,-80.12,-23.1,-87.35,-17.25,-94.81,-10.85,-0.13,-13.58,-20.27,-16.29,-39.17,-19.59,-56.33,-22.93,-67.38,-24.71,-74.98,-22.85,-82.15,-18.54,-91.12,-13.52,-100.54,-2.04,5.27,-4.7,-15.12,-7.33,-34.8,-10.27,-52.29,-13.02,-65,-14.09,-75.61,-12.51,-83.82,-8.27,-94.07,-3.42,-104.85,6.92,10.62,4.33,-10.02,1.8,-30.47,-0.78,-48.27,-2.92,-62.56,-3.25,-76.12,-1.86,-85.29,2.61,-96.81,7.46,-108.92]},{"duration":60,"tweenEasing":0,"value":[0.01,-50.84,-0.45,-67.84,-0.88,-84.72,-0.99,-98.45,-0.87,-104.08,-0.32,-92.51,0.01,-83.15,0.01,-81.96,0.01,-80.41,0.01,-45.72,-0.57,-62.51,-1.18,-79.18,-1.3,-92.66,-0.82,-98.75,-0.4,-89.8,-0.68,-82.12,-0.43,-80.76,0.01,-79.02,0.01,-40.74,-0.63,-57.32,-1.36,-73.76,-1.48,-86.96,-0.78,-93.45,-0.6,-86.98,-1.5,-80.99,-0.91,-79.57,0.01,-77.74,-1.1,-35.94,-1.15,-52.66,-0.86,-69.12,-0.78,-81.61,-0.81,-87.74,-1.53,-83.39,-2.61,-79.42,-1.51,-78.69,-0.16,-77.58,-0.99,-30.49,-1,-47.78,-0.53,-64.5,-0.59,-75.53,-1.56,-80.71,-2.73,-79.05,-3.44,-78.02,-2.84,-78.82,-1.99,-79.4,0.8,-27.54,0.07,-44.57,-0.53,-60.69,-1.09,-69.43,-2.86,-73.35,-4.37,-74,-4.62,-75.98,-4.29,-78.63,-3.82,-81.22,0.9,-26.47,0.05,-42.87,-0.78,-58.47,-1.25,-66.94,-2.95,-70.34,-4.32,-72.19,-4.34,-75.12,-3.95,-78.2,-3.55,-81.29,0.47,-24.92,-0.1,-40.87,-0.61,-56.37,-0.64,-65.98,-1.52,-69.22,-2.24,-71.69,-2.25,-74.7,-2.04,-77.78,-1.84,-80.87,0.01,-23.32,-0.26,-38.83,-0.41,-54.23,0.01,-64.99,0.01,-68.08,0.01,-71.16,0.01,-74.24,0.01,-77.33,0.01,-80.41]},{"value":[15.36,-43.16,20.87,-61.82,26.48,-80.15,31.89,-93.86,36.05,-98.62,39.78,-90.82,39.6,-86.39,35.46,-90.04,30.98,-93.74,18.93,-40.44,23.05,-58.22,27.04,-75.68,31.46,-89.48,35.87,-94.98,39.91,-88.33,39.81,-84,36.21,-86.81,32.53,-89.57,22.16,-37.85,25.06,-54.76,27.65,-71.48,31.14,-85.31,35.54,-91.47,39.63,-85.88,39.64,-81.6,36.76,-83.52,33.96,-85.31,21.79,-35.98,24.77,-52.69,28.36,-69.33,31.37,-82.42,34.09,-87.55,36.62,-82.27,36.74,-78.44,35.1,-79.67,33.52,-80.74,24.26,-33.43,25.42,-50.71,27.27,-67.4,28.72,-78.33,29.24,-80.14,29.83,-75.13,29.89,-73.9,29.28,-76.12,28.85,-78.3,28.69,-31.56,27.11,-48.96,25.62,-65.39,25.12,-73.72,23.68,-72.23,22.58,-67.47,22.77,-69.13,23.71,-72.89,24.73,-76.71,29.37,-30.53,27.62,-48.01,25.8,-64.62,25.1,-72.74,23.89,-68.45,23,-62.6,23.17,-65.16,24.1,-69.59,24.94,-74.14,29.51,-29.26,28.93,-46.71,28.3,-63.58,28.28,-72.68,27.98,-65.83,27.83,-58.2,27.77,-60.69,27.56,-65.44,27.23,-70.34,29.66,-27.98,30.32,-45.34,31.01,-62.46,31.71,-72.48,32.35,-63.08,32.99,-53.67,32.68,-56.09,31.25,-61.16,29.71,-66.4]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_01","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32.5,-20.81,-32.74,-32.46,-32.95,-43.89,-33.01,-52.12,-32.94,-53.94,-32.66,-47.15,-32.49,-43.34,-32.49,-43.8,-32.49,-44.09,-32.32,-16.52,-32.61,-28.1,-32.92,-39.45,-33.53,-47.35,-34.68,-49.92,-34.64,-45.51,-34.04,-42.87,-33.28,-43.93,-32.48,-44.89,-32.22,-12.13,-32.54,-23.72,-32.9,-35.04,-34.04,-42.64,-36.39,-45.93,-36.57,-43.82,-35.54,-42.32,-34.05,-43.99,-32.48,-45.63,-32.19,-6.24,-32.64,-18.46,-32.94,-30.32,-34.44,-38.43,-37.27,-42.23,-37.35,-41.86,-35.91,-41.67,-33.88,-44.24,-31.57,-46.88,-26.52,-0.18,-28.36,-12.61,-30.17,-24.43,-32.21,-33.75,-34.45,-38.71,-34.23,-40.21,-31.9,-42.29,-27.87,-46.56,-23.77,-51,-19.82,5.49,-23.02,-6.62,-26.22,-17.9,-28.78,-28.19,-30.6,-34.9,-30.3,-38.92,-27.21,-43.52,-21.53,-49.58,-15.84,-55.86,-14.53,11.96,-17.85,-0.5,-21.09,-12.21,-23.6,-23.4,-25.24,-32.83,-24.84,-40.35,-22.19,-46.59,-17.41,-53.89,-12.24,-61.57,-5.1,16.57,-8.18,3.63,-11.15,-8.78,-13.48,-20.38,-14.83,-31.78,-14,-41.92,-11.82,-48.9,-7.59,-57.25,-3,-66.08,4.75,20.95,1.94,7.56,-0.72,-5.55,-2.86,-17.48,-3.93,-30.73,-2.62,-43.38,-0.88,-51.02,2.88,-60.43,6.95,-70.39]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-25.42,-0.23,-33.92,-0.44,-42.36,-0.49,-49.22,-0.43,-52.04,-0.16,-46.26,0,-41.58,0,-40.98,0,-40.21,0,-22.86,-0.28,-31.26,-0.59,-39.59,-0.65,-46.34,-0.41,-49.4,-0.2,-44.92,-0.34,-41.06,-0.21,-40.38,0,-39.51,0,-20.37,-0.32,-28.66,-0.68,-36.88,-0.74,-43.49,-0.39,-46.76,-0.3,-43.51,-0.75,-40.49,-0.45,-39.78,0,-38.87,-0.55,-17.97,-0.58,-26.33,-0.43,-34.57,-0.39,-40.81,-0.41,-43.88,-0.76,-41.7,-1.31,-39.71,-0.75,-39.34,-0.08,-38.79,-0.5,-15.25,-0.51,-23.92,-0.27,-32.29,-0.29,-37.77,-0.78,-40.37,-1.37,-39.53,-1.72,-39.01,-1.42,-39.41,-1,-39.7,0.4,-13.77,0.03,-22.3,-0.27,-30.37,-0.54,-34.72,-1.43,-36.68,-2.19,-37,-2.31,-37.99,-2.14,-39.31,-1.91,-40.61,0.45,-13.24,0.02,-21.44,-0.39,-29.23,-0.63,-33.47,-1.47,-35.17,-2.16,-36.09,-2.17,-37.56,-1.97,-39.1,-1.78,-40.64,0.24,-12.46,-0.05,-20.43,-0.3,-28.18,-0.32,-32.99,-0.76,-34.61,-1.12,-35.84,-1.13,-37.35,-1.02,-38.89,-0.92,-40.43,0,-11.66,-0.13,-19.41,-0.21,-27.11,0,-32.5,0,-34.04,0,-35.58,0,-37.12,0,-38.66,0,-40.21]},{"value":[22.86,-17.24,26.85,-27.5,30.79,-37.52,33.79,-44.87,35.85,-50.15,37.71,-49.14,37.37,-47.49,34.3,-50.45,30.97,-53.53,24.11,-17.31,27.58,-26.82,30.89,-36.14,33.57,-43.32,35.77,-47.9,37.78,-46.4,37.37,-44.68,34.61,-47.18,31.75,-49.74,25.2,-17.43,28.24,-26.22,31.03,-34.91,33.4,-41.93,35.6,-45.77,37.64,-43.72,37.19,-41.87,34.82,-43.85,32.47,-45.85,24.73,-17.37,27.75,-26.2,31.13,-34.95,33.31,-41.62,34.64,-43.73,35.87,-40.61,35.4,-38.65,33.66,-39.98,32.01,-41.31,26,-16.87,27.19,-26.11,28.76,-35.02,29.82,-40.56,30.1,-39.82,30.42,-35.64,30.2,-34.85,29.53,-36.53,29.01,-38.27,28.4,-17.27,27.2,-26.38,26.03,-34.98,25.71,-39.01,25.14,-35.56,24.74,-30.48,24.9,-31.14,25.72,-33.56,26.57,-36.07,28.92,-17.29,27.59,-26.59,26.19,-35.41,25.73,-39.27,25.37,-33.28,25.16,-26.51,25.35,-27.6,26.07,-30.49,26.72,-33.5,29.27,-16.8,28.97,-26.28,28.6,-35.41,28.6,-39.69,28.74,-31.21,28.95,-22.35,28.9,-23.34,28.58,-26.55,28.15,-29.9,29.66,-16.31,30.45,-25.93,31.22,-35.34,31.71,-39.99,32.35,-29.04,32.99,-18.09,32.68,-18.96,31.25,-22.5,29.7,-26.19]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_02","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-33.01,2.94,-33.01,-0.21,-33.01,-3.2,-33.01,-4.56,-33,-3.56,-33,-2.56,-32.99,-3.43,-32.99,-4.49,-32.99,-5.55,-32.83,4.64,-32.83,1.49,-32.83,-1.5,-33.38,-2.68,-34.77,-2.19,-34.94,-2.27,-34.35,-3.64,-33.66,-5.32,-32.99,-7.05,-32.72,6.44,-32.72,3.23,-32.72,0.2,-33.81,-0.81,-36.51,-0.84,-36.78,-1.98,-35.61,-3.82,-34.29,-6.08,-32.99,-8.42,-33,9.7,-33.25,5.78,-33.3,2.06,-34.65,0.46,-37.53,0.02,-37.19,-1.71,-35.49,-3.96,-33.86,-6.78,-31.99,-9.76,-27.56,13.55,-29.73,9.2,-31.88,5.07,-33.56,2.26,-35.21,0.65,-33.86,-1.53,-31.05,-4.74,-27.13,-8.75,-23.28,-12.96,-21.76,17.67,-25.67,13.53,-29.59,9.61,-31.42,5.61,-31.68,1.43,-29.3,-2.59,-25.58,-6.92,-19.95,-11.81,-14.43,-16.92,-18.2,24.04,-22.13,19.27,-25.88,14.76,-27.61,9.53,-27.55,1.7,-24.97,-5.72,-21.54,-11.03,-16.27,-16.66,-10.96,-22.59,-8.15,27.86,-11.65,22.38,-14.96,17.23,-16.68,11.53,-16.64,1.44,-13.9,-8.24,-11.14,-13.99,-6.92,-20.44,-2.58,-27.31,2.58,31.28,-0.45,25.13,-3.25,19.37,-4.95,13.3,-4.93,1.1,-1.98,-10.65,0.1,-16.76,3.15,-24.04,6.45,-31.85]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[30.35,8.68,32.82,6.82,35.1,5.11,35.68,4.12,35.66,-1.67,35.65,-7.46,35.14,-8.58,33.13,-10.86,30.97,-13.32,29.29,5.81,32.11,4.57,34.76,3.44,35.67,2.85,35.66,-0.81,35.66,-4.47,34.93,-5.35,33.01,-7.55,30.98,-9.92,28.25,3,31.41,2.31,34.43,1.69,35.67,1.48,35.67,-0.04,35.66,-1.56,34.73,-2.14,32.88,-4.17,30.98,-6.38,27.67,1.23,30.73,0.3,33.9,-0.58,35.26,-0.81,35.18,0.13,35.11,1.06,34.07,1.13,32.21,-0.29,30.5,-1.88,27.75,-0.31,28.96,-1.5,30.26,-2.62,30.91,-2.78,30.96,0.55,31.01,3.88,30.5,4.19,29.77,3.06,29.17,1.77,28.11,-2.99,27.29,-3.79,26.43,-4.54,26.3,-4.29,26.6,1.11,26.89,6.52,27.03,6.84,27.72,5.76,28.4,4.57,28.47,-4.06,27.57,-5.16,26.57,-6.19,26.35,-5.8,26.84,1.89,27.33,9.58,27.52,9.96,28.04,8.61,28.5,7.14,29.04,-4.34,29.02,-5.85,28.91,-7.24,28.92,-6.69,29.5,3.4,30.07,13.49,30.02,14.01,29.6,12.34,29.07,10.53,29.66,-4.65,30.58,-6.51,31.43,-8.23,31.7,-7.49,32.34,5,32.98,17.49,32.68,18.16,31.25,16.17,29.7,14.01]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_03","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32.38,57.84,-32.3,54.57,-32.23,51.34,-32.32,51.86,-32.62,56.25,-32.91,55.57,-32.95,47.5,-32.66,37.04,-32.34,26.5,-32.43,58.87,-32.39,54.94,-32.35,51.12,-32.88,52.34,-33.99,56.63,-34.19,54.07,-33.76,44.68,-33.19,33.15,-32.77,21.72,-32.54,60.04,-32.52,55.4,-32.52,50.92,-33.49,52.72,-35.48,56.67,-35.65,52.04,-34.71,41.44,-33.77,29.11,-33.16,17.04,-32.83,63.1,-33.11,56.92,-33.19,50.96,-34.38,51.82,-36.48,54.77,-36.11,48.76,-34.52,37.47,-32.92,24.75,-31.63,12.28,-27.1,66.46,-29.49,59.2,-31.92,52.24,-33.57,50.41,-34.52,50.63,-32.87,44.36,-30.1,32.83,-26.44,19.65,-22.97,6.5,-21.28,69.68,-25.53,62.32,-29.83,55.27,-31.73,50.83,-31.48,46.57,-28.64,38.67,-24.96,26.76,-19.98,13.42,-14.74,-0.11,-17.87,75.57,-22.02,67.11,-25.94,59.05,-27.67,52.44,-26.95,43.35,-23.64,32.28,-20.19,19.51,-15.93,5.69,-11.15,-8.44,-7.68,78.86,-11.39,69.29,-14.89,60.21,-16.61,52.59,-16.13,40.44,-12.85,27.2,-9.87,13.99,-6.4,-0.34,-2.62,-14.95,3.2,81.71,-0.05,71.08,-3.06,61.04,-4.81,52.54,-4.64,37.46,-1.44,22.21,1.1,8.64,3.78,-6.17,6.59,-21.24]},{"duration":60,"tweenEasing":0,"value":[-0.04,55.66,0.04,55.53,0.12,55.29,0.02,57.17,-0.28,60.56,-0.58,58.88,-1,51.63,-2.21,42.01,-3.52,32.31,-0.27,54.98,-0.22,54.21,-0.18,53.37,-0.26,55.93,-0.51,60.1,-0.77,57.6,-1.27,49.37,-2.46,39.05,-3.83,28.78,-0.48,54.35,-0.47,52.91,-0.46,51.46,-0.52,54.59,-0.87,59.3,-1.2,55.75,-1.76,46.65,-2.77,35.87,-4.12,25.27,-0.5,54.15,-0.53,51.88,-0.55,49.65,-0.61,52.44,-1.1,56.75,-1.56,52.55,-2.03,43.12,-2.58,32.18,-3.63,21.68,-0.21,53.66,-0.44,50.74,-0.71,47.9,-0.8,49.04,-0.84,51.43,-0.83,47.61,-0.99,38.83,-1.12,27.94,-1.61,18,-0.19,52.76,-0.53,49.53,-0.91,46.41,-0.99,45.99,-0.6,46.09,-0.15,42.34,-0.09,34.23,-0.06,23.54,-0.15,14.33,-0.34,52.28,-0.56,48.58,-0.73,45.03,-0.77,43.61,-0.62,42.16,-0.43,38.42,-0.28,30.94,-0.08,20.39,0.08,11.01,-0.19,51.75,-0.42,47.65,-0.59,43.72,-0.63,41.74,-0.46,39.32,-0.27,35.76,-0.08,28.95,0.23,18.52,0.51,8.53,-0.04,51.18,-0.27,46.7,-0.48,42.42,-0.51,39.92,-0.29,36.56,-0.06,33.19,0.19,27.05,0.58,16.72,0.98,6.11]},{"value":[30.31,64.33,33.17,62.2,35.81,60.1,36.34,60.98,35.72,58.73,35.1,51.41,34.13,43.05,30.92,31.15,27.45,18.98,30.93,60.9,33.87,58.77,36.51,56.69,37.24,58.61,36.1,59.2,34.97,53.12,33.66,44,30.54,31.49,27.15,18.86,31.28,57.47,34.37,55.3,37.11,53.19,38.06,56.02,36.32,59.22,34.59,54.19,32.97,44.49,30.1,31.69,26.87,18.88,30.23,54.59,33.46,51.7,36.74,48.88,37.92,51.63,35.79,56.91,33.7,53.62,32.05,44.25,29.63,31.89,26.87,19.8,29.29,52.55,30.79,48.65,32.29,44.89,32.84,46.04,31.55,51.9,30.3,51.5,29.51,43.01,28.65,31,27.56,19.76,28.07,49.69,27.78,45.48,27.38,41.45,27.3,41.24,27.04,46.97,26.83,48.84,26.93,41.07,27.66,29.31,28.25,18.9,28.13,48.22,27.78,43.23,27.42,38.46,27.29,37.39,27.11,43.83,26.98,47.98,27.23,40.9,27.97,29,28.58,18.16,28.85,47.41,29.01,41.7,29.13,36.29,29.18,34.83,29.5,42.61,29.84,49.23,29.95,42.95,29.83,30.86,29.59,19.06,29.62,46.53,30.31,40.19,30.94,34.19,31.19,32.43,32.06,41.56,32.93,50.68,32.86,45.21,31.82,32.89,30.68,20.12]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_MOUTH.03_04","timeline":[{"name":"B_MOUTH.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-31.75,112.75,-31.59,109.35,-31.44,105.88,-31.63,108.29,-32.23,116.06,-32.83,113.71,-33.09,99.58,-33.22,84.21,-33.36,69.06,-32.04,113.1,-31.94,108.4,-31.86,103.74,-32.38,107.41,-33.2,116.05,-33.44,111.59,-33.61,95.77,-33.86,77.73,-34.08,59.8,-32.36,113.64,-32.33,107.56,-32.31,101.63,-33.16,106.31,-34.43,115.3,-34.53,108.32,-34.53,90.95,-34.58,70.67,-34.69,50.39,-32.67,116.51,-32.98,108.06,-33.07,99.88,-34.11,103.16,-35.43,110.63,-35.04,101.65,-34.32,83.2,-33.19,61.6,-32.24,39.84,-26.63,119.36,-29.24,109.22,-31.96,99.43,-33.59,98.55,-33.82,101.2,-31.87,91.53,-29.6,72.92,-26.54,51.46,-23.35,29.74,-20.8,121.69,-25.39,111.12,-30.07,100.94,-32.03,96.01,-31.27,91.75,-27.98,80.06,-24.44,60.92,-20.24,39.44,-15.23,17.66,-17.54,127.1,-21.9,114.96,-26.01,103.35,-27.72,95.35,-26.35,85.01,-22.31,70.28,-18.86,50.03,-15.56,28.03,-11.34,5.72,-7.21,129.87,-11.14,116.19,-14.81,103.19,-16.55,93.65,-15.62,79.45,-11.81,62.64,-8.61,41.95,-5.88,19.76,-2.66,-2.59,3.83,132.15,0.34,117.02,-2.88,102.71,-4.66,91.77,-4.36,73.83,-0.9,55.08,2.11,34.04,4.42,11.7,6.74,-10.63]},{"duration":60,"tweenEasing":0,"value":[-0.08,111.31,0.09,111.06,0.24,110.57,0.04,114.35,-0.56,121.12,-1.16,117.77,-2.01,103.26,-4.42,84.02,-7.04,64.61,-0.54,109.95,-0.45,108.41,-0.36,106.74,-0.51,111.89,-1.03,120.28,-1.53,115.22,-2.55,98.73,-4.94,78.09,-7.66,57.56,-0.97,108.7,-0.94,105.83,-0.92,102.93,-1.04,109.23,-1.74,118.71,-2.41,111.55,-3.52,93.29,-5.56,71.73,-8.24,50.54,-1.01,108.3,-1.06,103.77,-1.1,99.3,-1.22,104.92,-2.2,113.59,-3.13,105.12,-4.05,86.23,-5.19,64.38,-7.26,43.35,-0.41,107.31,-0.87,101.49,-1.42,95.82,-1.6,98.14,-1.67,102.97,-1.66,95.25,-1.98,77.63,-2.25,55.91,-3.22,36,-0.38,105.52,-1.07,99.07,-1.82,92.83,-1.99,91.99,-1.2,92.2,-0.3,84.68,-0.19,68.46,-0.12,47.09,-0.3,28.67,-0.67,104.55,-1.13,97.17,-1.46,90.07,-1.54,87.21,-1.24,84.3,-0.85,76.83,-0.57,61.89,-0.15,40.78,0.17,22.03,-0.39,103.5,-0.83,95.3,-1.19,87.44,-1.25,83.48,-0.92,78.64,-0.54,71.51,-0.15,57.9,0.46,37.04,1.03,17.05,-0.08,102.37,-0.54,93.39,-0.97,84.84,-1.03,79.85,-0.57,73.11,-0.11,66.37,0.37,54.1,1.15,33.45,1.95,12.21]},{"value":[30.28,119.99,33.52,117.57,36.52,115.09,37,117.83,35.77,119.12,34.54,110.29,33.13,94.67,28.71,73.17,23.93,51.29,32.58,115.99,35.64,112.96,38.26,109.95,38.8,114.4,36.54,119.28,34.29,110.73,32.38,93.35,28.03,70.5,23.31,47.64,34.31,111.95,37.32,108.28,39.78,104.69,40.45,110.61,36.97,118.59,33.52,109.97,31.22,91.12,27.27,67.51,22.75,44.15,32.79,107.94,36.18,103.1,39.58,98.35,40.58,104.11,36.4,113.77,32.28,106.21,30.04,87.33,27.02,64.08,23.24,41.47,30.84,105.41,32.62,98.8,34.32,92.41,34.78,94.9,32.14,103.35,29.59,99.15,28.53,81.75,27.52,58.99,25.95,37.76,28.04,102.37,28.27,94.75,28.33,87.44,28.29,86.78,27.48,92.84,26.77,91.17,26.84,75.29,27.6,52.86,28.11,33.23,27.8,100.5,28,91.62,28.26,83.13,28.22,80.58,27.38,85.76,26.63,86.36,26.95,71.85,27.89,49.39,28.66,29.17,28.65,99.16,28.99,89.25,29.35,79.82,29.44,76.36,29.51,81.81,29.61,84.97,29.87,71.91,30.06,49.38,30.1,27.58,29.58,97.72,30.04,86.88,30.46,76.62,30.67,72.36,31.77,78.11,32.87,83.86,33.05,72.25,32.4,49.62,31.65,26.23]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.00","timeline":[{"name":"D_MOUTH.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.00_00","timeline":[{"name":"D_MOUTH.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[25.3,51.19,-38.74,54.35,-71.15,33.55,-61.71,28.87,-25.93,9.59,32.17,7.28,63.19,28.81,62.11,42.77,22.52,31.54,-24.36,31.6]},{"duration":60,"tweenEasing":0,"value":[25.07,-1.51,-22.66,4.98,-50.98,31.03,-35.86,68.35,-8.29,80.3,31.19,79.01,47.32,51.46,49.04,7.68,21.86,34.76,-7.81,32.72]},{"value":[27.29,-9.01,-38.31,-4.31,-58.89,31.54,-23.93,64.33,-6.51,76.3,10.19,69.95,47.41,47.56,58.98,11.61,4.41,30.95,-7.66,27.23]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.00_01","timeline":[{"name":"D_MOUTH.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[11.6,16.87,-14.75,17.03,-52.36,13.58,-37.22,6.39,-10.07,11.3,13.12,11.72,46.62,11.89,46.81,13.86,10.75,14.44,-9.04,14.56]},{"duration":60,"tweenEasing":0,"value":[5.95,-7.11,-12.72,-7.62,-22.53,19.46,-17.95,57.53,-8.11,74.11,7.28,75.5,17.07,49.19,17.27,9.32,5.62,32.53,-7.68,31.49]},{"value":[3.53,-26.15,1.85,-26.87,1.58,10.78,4.36,63.83,4.8,88.07,4.45,89.55,4.03,53.02,4.27,-3.05,4.24,29.4,4.22,27.87]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.00_02","timeline":[{"name":"D_MOUTH.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":19},{"duration":60,"tweenEasing":0,"value":[-0.39,9.98,2.61,9.67,-0.41,-4.99,5.81,40.99,4.15,35.66,0.26,34.71,-0.66,8.61,-1.85,5.99,-21.87,4.86,12.67,20.55]},{"value":[0.35,-33.44,5.22,-34.25,8.57,8.1,10.2,67.62,7.22,95.32,0.68,96.83,-3.31,55.86,-3.09,-7.4,1.2,29.11,6.45,27.39]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.03","timeline":[{"name":"D_MOUTH.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.03_00","timeline":[{"name":"D_MOUTH.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[53.29,10.63,36.88,21.26,3.84,22.88,-42.9,23.63,-65.75,9.33,-68,-7.38,-40.79,-9.14,-5.71,-11.78,22.21,-7.17,44.54,-4.44,-21.21,3.51,-58.53,5.13,30.27,5.91]},{"duration":60,"tweenEasing":0,"value":[41.49,0.02,28.62,-13.8,3.54,-22.36,-32.94,-22.27,-51.66,-22.65,-52.77,-22.6,-31.24,-22.86,-3.57,-29.22,16.87,-10.14,33.47,-3.41,-16.28,-22.62,-45.87,-22.64,23.17,-13.77]},{"value":[43.61,-31,28.45,-57.29,-2.05,-70.54,-46.65,-64.91,-69.28,-63.05,-71.53,-63.63,-46.35,-67.07,-12.57,-69.94,12.36,-48.26,32.81,-36.85,-27,-68.1,-62.73,-64.37,21.04,-56.22]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.03_01","timeline":[{"name":"D_MOUTH.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[39.53,63.91,22.33,60.44,8,71.29,-24.98,75.26,-46.87,15.88,-49.07,17.6,-16.91,0.1,-4.87,0.05,15.29,2,36.56,32.95,-12.81,24.53,-42.46,22.95,24.28,31.2]},{"duration":60,"tweenEasing":0,"value":[7.51,5.21,1.06,-8.58,-10.81,-17.19,-27.89,-17.11,-37.05,-17.27,-37.63,-17.21,-27.32,-17.37,-14.42,-17.28,-5.85,-5.34,2.7,1.76,-20.26,-17.22,-34.14,-17.23,-2.21,-8.57]},{"value":[0.32,-5.13,-2.66,-32.72,-7.18,-49.94,-14.91,-49.85,-19.64,-50.18,-20.03,-50.4,-15.18,-50.38,-9.24,-50.21,-7.17,-25.9,-4.19,-12.03,-12.13,-50.28,-18.89,-50.45,-5.3,-32.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.03_02","timeline":[{"name":"D_MOUTH.03","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":25},{"duration":60,"tweenEasing":0,"value":[1.9,-1.68,-1.01,-15.48,-5.98,-24.07,-13.49,-23.98,-17.89,-24.2,-17.94,-24.16,-13.15,-24.1,-7.65,-24.15,-4.68,-12.16,-1.12,-5.13,-10.34,-24.15,-16.77,-24.19,-2.85,-15.46]},{"value":[0.42,10.38,-2.28,-17.2,-6.2,-34.42,-13.14,-34.33,-17.39,-34.66,-17.24,-34.52,-12.86,-34.47,-7.75,-34.48,-6.57,-10.42,-3.96,3.49,-10.33,-34.52,-16.35,-34.6,-4.78,-17.18]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.01","timeline":[{"name":"D_MOUTH.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.01_00","timeline":[{"name":"D_MOUTH.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[46,85.21,27.16,29.8,2.44,-12.45,-33.44,9.75,-51.56,56.73,-57.85,81.11,-60.41,17.05,0,0,0,0,0,0,0,0,18.14,1.15,56.75,10.57,60.97,34.88,-6.97,-16.39,-30.26,-6.71,-44.06,20.23,-68.32,51.72,-43.34,-10.92,17.47,-22.55,60.45,78.85,52.61,58.43,37.37,69.47,48.9,32.25,23.06,-3.02,13.75,-16.15,-30.04,-14.23,-40.65,1.89,-55.53,32.6,-60.68,52.75,-62.84,76.97,-54.36,72.06,-60.84,64.47,-5.35,-21.22,40.8,50.11,45.57,63.34,39.65,30.04,24,8.65,30.07,47.86,10.37,-15.13,16.2,-0.04,-16.3,-17.58,-30.04,-6.29,-20.15,-12.18,-35.83,1.74,-46.32,20.07,-44.32,33.03,-53.69,38.64,-56.96,54.28,-58.17,65.71,34.26,18.37,17.32,-3,16.45,-9.33,-2.77,-16.93,-10.59,-15.08,50.52,43.66,-24.14,-11.14,-1.5,-16.22,11.82,-15.57]},{"duration":60,"tweenEasing":0,"value":[43.72,82.63,26.82,64.05,4.21,43.06,-22.6,54.93,-42.37,76.32,-44.87,67.18,-53.64,-5.02,12.1,-27.27,27.84,-9.46,6.27,18.33,-27.31,-6.63,10.96,-35.53,21.04,27.35,46.73,59.62,-9.06,12.99,-10.29,4.58,-28.59,13.12,-50.01,68.02,-23.02,39.68,11.53,38.52,51.61,64.71,45.14,63.96,38.83,72.47,39.37,58.15,15.37,43.11,12.97,46.06,-21.55,47.46,-23.89,45.98,-37.58,61.62,-43.98,68.26,-50.43,76.5,-48.21,75.76,-42.74,58.75,1.56,42.08,36.63,64.61,43.39,67.02,32.45,59.41,19.75,49.34,30.76,67.53,9.03,41.9,15.21,49.78,-11.99,45.2,-18.29,47.11,-13.38,43.18,-23.02,47.69,-30.02,54.68,-32.91,67.21,-39.35,64.24,-44.68,72.41,-47.83,73.17,28,53.62,11.57,46.29,13.05,44.06,0.38,45.1,-6.77,46.29,40.42,60.9,-15.98,46.59,1.74,43.1,10.25,44.45]},{"value":[45.37,84.3,25.41,81.24,6.14,75.75,-13.83,82.97,-33.63,89.41,-44.8,73.45,-46.31,-26.16,24.21,-54.46,55.67,-18.94,12.54,36.64,-32.9,-3.97,9.28,-36.83,14.91,30.54,40.77,59.58,-11.15,42.34,5.09,16.87,-13.83,7.72,-36.6,75.57,-13.43,65.04,11.57,74.22,54.57,68.26,45.33,68.03,41.05,78.98,36.34,69.91,13,67.31,10.84,77.79,-15.34,76.91,-12.97,74.89,-26.07,75.45,-32.77,76.75,-41.38,76.78,-41.7,80.16,-41.27,62.14,6.02,75.51,37.44,71.48,43.61,71.34,34.28,73.45,16.63,69.18,30.53,80.27,8.55,72.81,14.49,81.12,-8.41,78.26,-10.67,77.07,-6.94,77.88,-12.96,75.38,-21.31,76.88,-22.92,89.04,-30.1,81.02,-35.03,85.71,-39.63,85.12,24.4,69.29,10.86,72.85,8.49,71.07,0.48,76.48,-3.47,77.03,40.1,68.81,-10.38,79.06,1.94,76.09,9.18,74.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.01_01","timeline":[{"name":"D_MOUTH.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[18.95,63.08,20.84,5.19,1.3,-27.05,-27.41,-8.62,-32.99,22.83,-24.41,52.7,-36.85,3.84,0,0,0,0,0,0,0,0,18.14,1.15,40.6,14.18,47.74,30.72,-5.77,-15.9,-30.26,-6.71,-26.97,5.94,-45.1,30.55,-31.86,-9.47,14.81,-12.9,36.65,75.75,34,45.13,19.53,46.88,37.14,20.75,19.15,-5.66,9.58,-14.55,-20.25,-13.36,-31.14,-5.29,-40.32,15.2,-40.29,29.89,-38.76,50.13,-33.3,43.93,-35.13,44.22,-6.65,-11.18,28.56,30.81,27.78,45.19,30.97,14.86,20.33,-2.29,20.18,23.11,10.18,-20.35,13.73,-16.65,-10.65,-19.52,-23.46,-12.38,-17.15,-24.83,-29.04,-8.9,-35.7,4.16,-30.85,7.75,-38.55,16.99,-38.74,28.63,-38.66,36.3,27.26,7.2,15.36,-11.14,14.48,-13.31,-1.54,-17.28,-7,-13.89,35.77,31.38,-17.96,-15.45,0.92,-19.98,9.92,-17.86]},{"duration":60,"tweenEasing":0,"value":[14.25,55.8,9.95,57.89,-1.37,66.17,-9.73,71.75,-17.84,58.94,-20.77,42.1,-22.65,-37.85,35.09,-59.93,29.71,14.78,3.83,34.39,-18.62,20.1,-9.63,-22.89,7,49.72,18.51,54.8,-10.86,53.93,1.65,44.67,4.26,-2.43,-14.75,51.1,-3.95,65.91,-6.9,65.31,19.2,61.37,18.44,42.18,15.51,50.7,12.91,51.27,-7.63,51.97,-9.22,70.74,-6.24,78.55,-3.4,69.83,-12.79,62.99,-14.92,53.41,-22.67,46.43,-23.1,49.48,-17.42,35.77,-6.83,83.84,13.72,43.86,17.16,45.44,12.42,51.95,0.26,54.32,9.55,55.01,0.13,67.57,2.73,61.36,-6.68,76.48,-5.83,75.61,-6.52,68.99,-7.39,69.42,-11.59,64.15,-11.03,60.91,-15.66,60.01,-18.62,58.88,-19.46,50.22,5.26,52.48,-2.99,59.99,-2.78,64.66,-4.77,77.01,-5.68,81.68,15.26,44.61,-5.68,77.61,-1.86,74.35,0.61,71.56]},{"value":[12.92,39.57,2.72,63.33,-5.06,78.39,1.77,80.84,-7.07,60.65,-19.1,21.87,-8.67,-79.33,70.08,-119.79,28.86,23.25,7.64,68.72,-37.23,40.15,-37.59,-46.98,-17.21,57.94,5.57,52.73,0.01,74.15,18.65,42.73,25.92,-32.81,3.23,42.28,11.3,74.79,-15.78,79.64,13.28,44.85,9.58,22.73,12.95,33.07,2.3,46.59,-21.06,56.56,-19.86,84.56,-0.1,89.63,6.41,81.22,5.32,63.82,1.53,43.33,-10.46,22.8,-15.23,34.57,-5.54,11.29,-7.52,95.69,3.43,30.87,11.05,27.11,0.95,50.85,-11.57,59.15,2.51,52.65,-7.21,78.48,-5.58,71.6,-6.55,87.89,3.23,86.18,-1.43,79.9,5.24,77.68,4.32,67.65,3.61,64.34,-0.11,59.26,-5.95,52.14,-8.49,35.51,-7.4,53.96,-15.05,67.24,-13.45,74.37,-7.27,89.14,-6.49,93.28,3.05,33.08,-0.43,88.59,-4.53,86.45,-4.5,84.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.01_02","timeline":[{"name":"D_MOUTH.01","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":117},{"duration":60,"tweenEasing":0,"value":[-1.19,-2.18,-5.73,27.27,-5.33,51.16,11.9,38.59,-2.03,11.19,2.58,-14.22,7.72,-64.47,23.98,17.74,1.12,33.88,5.09,41.66,-15.33,31.93,-38.39,-35.53,-8.35,30.73,-12.2,5.29,-5.24,61.57,17.25,31.35,15.54,11.42,2.78,-1.91,23,44.96,-17.45,52.79,-1.78,-15.91,0.3,-5,1.72,0.53,-4.66,8.82,-20.46,22.27,-19.81,58.76,13.11,59.1,15.32,43.76,6.8,18.96,0.73,2.72,-7.62,-3.04,-7.27,1.06,0.87,-11.69,-1.68,68.21,-2.91,2.85,1.87,-1.41,-5.11,12.78,-11.32,25.93,-5.64,15.2,-12.7,44.78,-9.4,39.4,-4.18,62.43,8.53,52.32,3.37,45.37,10.78,37.22,6.77,25.37,6.04,25.78,3.59,10.49,-2.21,5.64,-5.69,0.14,-9.27,18.4,-16.48,33.66,-14.46,41.4,-11.91,62.78,-0.68,68.64,-3.96,-1.85,7.77,59.17,-9,55.24,-16.51,49.2]},{"value":[4.36,-3.36,-7.33,32.57,-7.21,75.96,10.4,63.9,-3.45,17.85,-12.55,-7.45,-5.37,43.95,-3.32,50.54,-2.79,49.51,-3.82,50.24,-4.6,51.17,-16.69,-12.04,17.79,69.27,-5.13,-1.96,-3.92,37.78,1.1,42.28,-7.13,58.69,5.35,-4.17,11.26,72.21,-18.7,72.87,1.83,-11.98,2.61,-2.99,2.59,2.17,-6.72,9.17,-24.26,32.71,-19.22,72.52,9.7,74.71,14.21,61.36,10.26,23.97,2.56,5.24,-7.08,-6.45,-10.46,2.52,-0.08,-17.42,-3.29,78.21,-2.37,0.94,3.16,-1.54,-2.17,22.07,-14.7,34.72,-3.33,17.63,-17.4,61.25,-11.37,54.11,-7.05,81.57,10.63,73.41,6.62,72.05,12.53,58.07,11.5,38.02,5.67,36.87,6.07,20.11,-0.6,9.57,-4.18,1.29,-12.5,26.04,-16.88,48.4,-18.76,51.09,-16.54,75.9,-1.43,78.59,-3.42,-1.36,4.25,80.62,-12.35,74.2,-18.2,63.45]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_MOUTH.02","timeline":[{"name":"D_MOUTH.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_MOUTH.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_MOUTH.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.02_00","timeline":[{"name":"D_MOUTH.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[58,128.85,8.18,201.42,-21.83,141.41,-45.34,49.15,5.63,-4.42,18.82,48.24,5.05,191.03,-37.79,203.48,-71.73,131.49,-64.48,53.36,-23.23,-17.76,22.98,-6.06,50.86,54.35,29.42,82.79,29.6,-4.63,-17.05,-10.38,-42.98,42.25,-53.14,114.81,-4.64,99.99,-6.28,-20.63,-17.85,36.33,-13.57,104.13,27.12,152.31,-61.2,147.76,-32.36,119.4,-33.93,154.19,-64.06,115.92,-61.42,77.01,-56.11,46.06,-39.86,2.74,-22.62,-20.93,-0.94,-29.39,-77.25,102.28,21.8,-8.58,36.83,23.98,45.15,63.65,45.88,103.23,59.07,84.99,42.24,124.52,40.68,155.7,-3.31,15.09,34.93,46.57,31.31,14.86,23.44,46.93,22.62,-4.34,13.46,-19.91,-11.41,-24.86,-22.61,-18.62,-32.1,-5.53,-39.51,17.18,-28.88,9.78,-48.66,44.63,-54.67,64.5,-55.9,97.22,-48.71,78.57,-58.86,117.33,40.32,73.11,39.46,96.33,40.02,117.94,27.13,116.11,-51.19,15.27,-0.83,-13.79,40.72,22.34,-13.07,-25.2,-11.51,-25.54,14.94,68.56,14.33,8.55,17.35,-10.09,-13,-14.24,8.23,-7.26,-29.75,19.58,-28.6,63.9]},{"duration":60,"tweenEasing":0,"value":[60.61,133.65,8.18,185.25,-21.83,125.24,-45.35,32.98,5.43,-20.59,18.66,32.06,4.58,174.57,-30.01,192.45,-61.83,129.71,-58.03,18.89,-25.81,-70.78,17.42,-42.78,44.48,45.72,31.18,46.7,32.28,-44.09,-14.79,-53.89,-44.74,0.59,-37.2,118.62,-5.16,83.5,-6.34,-36.82,-17.84,20.16,-13.59,87.95,24.49,162.87,-51.5,148.28,-27.92,97.87,-18.92,149.78,-53.76,122.05,-54.4,57.23,-51.32,17.08,-40.8,-33.57,-23.97,-59.67,-1.6,-65.61,-65.25,91.42,22.89,-40.5,38.62,1.4,42.81,62.53,45.8,112.19,55.55,89.68,43.32,137.05,42.88,168.22,-3.31,-1.09,35.72,23.35,33.02,-19.08,25.31,10.82,23.08,-38.02,14.72,-56.54,-11.89,-64.33,-19.29,-56.34,-30.28,-41.37,-40.27,-15.71,-29.13,-24.15,-46.2,17.87,-49.89,40.45,-47.2,85.9,-44.16,54.7,-48.73,118.19,36.77,63.55,37.42,94.57,37.99,119.74,26.43,98.2,-47.03,-26.72,-2.48,-67.17,37.69,-3.82,-13.08,-69.61,-11.68,-65.62,16.16,38.56,16.15,-23.41,19.1,-41.61,-11.61,-47.47,10.72,-48.58,-30.9,-12.9,-29.9,31.68]},{"value":[63.22,138.45,8.18,169.08,-21.83,109.08,-45.35,16.81,5.23,-36.75,18.51,15.88,4.1,158.11,-33.27,147.22,-51.92,127.92,-52.1,-12.96,-24.97,-112.35,13.73,-74.9,40.5,41.02,31.72,5.4,32.08,-78.37,-17.17,-83.74,-45.1,-33.17,-32.05,98.71,-5.68,67.02,-6.4,-53,-17.83,3.99,-13.62,71.77,24.13,169.56,-41.81,148.81,-23.48,76.35,-26.19,111.13,-45.03,122.91,-47.38,37.46,-48.69,-13.9,-40.65,-73.15,-24.77,-100.38,-2.36,-107.05,-54.79,85.19,21.18,-75.11,33.53,-23.26,37.5,61.37,45.72,121.14,52.04,94.37,44.41,149.57,45.09,180.74,-3.32,-17.26,35.08,-2.21,35.34,-53.74,25.75,-30.54,25.06,-74.65,16.79,-90.61,-9.97,-98.4,-21.66,-94.39,-28.35,-75.95,-41.89,-55.23,-27.96,-64.98,-49.02,-24.79,-48.66,8.44,-38.51,74.59,-37.57,27.59,-38.6,119.04,35.25,50.77,35.38,92.81,35.95,121.54,24.09,75.41,-41.46,-62.09,-4.8,-108.8,34.66,-29.99,-13.33,-110.74,-11.41,-105.38,16.54,4.97,16.02,-51.87,18.95,-69.71,-12.78,-74.61,9.77,-82.61,-31.01,-48.73,-30.49,4.75]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.02_01","timeline":[{"name":"D_MOUTH.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[35.11,94.12,-8.11,134.34,-16.19,63.59,-14.97,-5.99,-10.97,-22.53,23.58,-5.83,11.59,94.61,-16.37,125.82,-45.15,92.51,-42.61,29.76,-18.85,-23.3,17.62,-10.6,36.96,32.44,19.6,36.64,17.06,-12.25,-15.43,-21.44,-32.99,10.33,-30.42,58.64,-4.45,10.53,-13.47,-23.54,-3.7,0.02,-13.8,49.49,3.26,82.66,-31.2,97.8,-21.06,37.45,-15.13,69.81,-39.13,72.08,-39.46,42.19,-39.36,18.34,-32.85,-10.61,-19,-23.38,-0.47,-29.06,-49.79,67.77,18.89,-16.15,29.78,5.84,34.09,36.77,29.75,68.05,41.18,57.71,23.9,83.64,20.25,109.51,-3.16,-12.93,26.08,21.07,26.27,1.27,18.17,14.57,18.05,-16.37,13.38,-24.58,-11.06,-29.42,-19.03,-27.31,-25.89,-17.52,-31.7,-3.51,-25.34,-9.9,-35.1,14.5,-37.72,29.81,-34.07,53.59,-33.88,35.28,-35.41,64.93,28.63,41.89,25.36,56.29,21.14,72.8,11.37,60.04,-37.75,2.71,-0.79,-17.01,30.8,8.52,-10.06,-26.05,-9.63,-26.25,12.46,25.42,10.38,-8.3,6.64,-16.1,-14.69,-22.23,2.18,-16.46,-25.95,-1.88,-22.29,10.41]},{"duration":60,"tweenEasing":0,"value":[30.82,98.56,-15.67,171.77,-43.79,120.21,-51.14,30.11,11.3,-11.41,57.56,32.47,36.73,129.82,5.14,166.39,-29.79,100,-28.42,-12.48,-14.95,-92.95,1.5,-72.25,22.72,6.47,-4.23,35.44,-5.65,-70.74,-11.24,-109.1,-9.71,-33.27,-8.04,61.27,23.48,0.52,-6.28,-49.21,-29.38,1.46,-37.07,79.59,-9.98,119.71,-16.52,123.92,6.71,36.53,7.29,84.61,-23.9,87.69,-19.1,28.47,-20.9,-17.24,-16.94,-72.31,-13.75,-92.7,-7.26,-98.8,-37.97,34.68,-1.44,-71.45,8.53,-29.12,15.45,25.18,19.77,77.54,31.62,45.34,15.01,106.42,14.33,134.71,-7.96,-25.23,5.35,-3.16,4.71,-44.48,-8.37,-11.18,-3.83,-69.37,-1.82,-92.25,-9.43,-104.2,-13.03,-96.42,-13.8,-83.14,-11.93,-56.5,-7.92,-70.81,-15.11,-23.81,-16.02,2.06,-13,43.95,-13.1,12.99,-15.47,86.48,10.49,28.83,11.16,51.67,8.51,93.59,-4.47,74.72,-23.61,-58.67,-7.37,-85.13,16.31,-38.42,-11,-96.04,-10.17,-96.11,-11.94,25.03,-13.29,-47.51,-5.87,-63.39,-9.37,-86.58,-8.21,-88.32,-8.47,-39.01,2.74,-20.6]},{"value":[28.27,77.71,-23.08,209.57,-71.46,176.65,-87.27,66.29,33.5,-0.16,91.59,70.57,61.83,165.05,9.09,127.14,-22.17,72.06,-20.14,-46.97,-14.05,-136.49,8.61,-119.32,12.62,-19.54,-21.98,24.3,0.66,-113.31,-6.47,-133.33,-3.15,-65.27,6.42,48.91,51.5,-9.39,0.84,-74.78,-55,2.96,-60.39,109.41,-21.57,123.69,-6.55,88.59,26.16,25.02,28.83,94.88,-14.76,53.18,-11.95,-3.93,-14.23,-53.99,-16.97,-114.72,-12.12,-135.97,-1.85,-143.85,-28.19,12.63,4.99,-117.97,2.83,-66.6,5.73,1.97,10.84,51.08,21.55,34.96,12.58,85.61,9.7,139.68,-12.78,-37.52,-4.41,-34.22,7.23,-91.21,-17.77,-48.02,3.52,-116.27,4.58,-134.27,-6.12,-143.79,-10.97,-139.5,-13.44,-125.17,-10.16,-98.24,-7.83,-112.48,-7.89,-58.19,-8.61,-27.04,-5.18,14.32,-0.04,-5.26,-5.71,58.97,-2.13,9.66,-1.01,43.31,1.54,74.7,-19.45,86.79,-23.71,-100.38,-3.08,-128.35,18.98,-80.73,-8.22,-140.01,-6.93,-139.95,-32.1,17.76,-17.25,-75.89,0.72,-100.16,-3.72,-111.31,-2.6,-122.48,-1.71,-68.7,17.34,-44.31]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_MOUTH.02_02","timeline":[{"name":"D_MOUTH.02","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":143},{"duration":60,"tweenEasing":0,"value":[8.14,20.52,-17.23,54.58,-29.04,43.42,-34.34,10.06,-20.78,-20.53,37.73,10.01,29.1,60.29,9,62.02,-12.95,19.19,-6.16,-37.13,-2.66,-95.72,-0.91,-80.45,5.32,-29.87,-8.58,-13.29,-5.48,-76.28,-4.9,-114.9,1.7,-61.52,3.64,9.65,9.94,-28.34,4.01,-44.87,-19.34,-26.19,-18.05,-1.98,-15.72,16.65,-7.3,34.98,18.88,5.67,14.75,33.29,-10.39,12.42,-7.58,-16.26,-6.58,-43.45,-0.71,-77.1,-6.06,-96.53,-3.68,-100.57,-15.16,1.04,-1.85,-81.03,0.07,-52.03,1.15,-17.4,2.48,11.17,8.43,-1.44,0.85,20.12,-3.53,34.95,-10.79,-23.41,-2.66,-39.2,-1.61,-60.1,-8.25,-41.63,-3.99,-77.04,-2.55,-90.72,-4.75,-101.26,-6.87,-100.71,1.41,-88.74,-0.25,-70.7,3.56,-83.99,-1.18,-45.27,-2.61,-27.76,-1.99,-0.8,3.39,-12.98,-6.49,13.19,-3.02,-16.71,-3.25,-0.33,-4.05,10.88,-12.3,1.71,-6.15,-70.57,-1.68,-86.83,3.61,-59.57,-2.45,-96.12,-2.96,-100.56,-11.88,-17.24,-9.94,-60.16,-2.24,-65.56,-1.55,-88.56,-5.21,-93.97,2.53,-55.52,4.79,-49.08]},{"value":[12.87,32.73,-29.65,69.91,-58.2,86.8,-68.61,19.93,-41.8,-41.13,76.38,20.82,51.47,93.89,12.39,85.83,-17.52,24.38,-9.71,-55.22,-3.37,-126.51,4.74,-109.36,9.29,-36.17,-7.93,-12.2,-3.41,-89.31,0.01,-116.28,2.98,-63.64,3.71,9.3,20,-56.27,31.54,-50.92,-38.36,-52.83,-35.88,-3.92,-17.85,24,-7.76,45.07,26.64,1.82,20.7,42.87,-11.23,14.73,-7.5,-24.08,-5.19,-57.08,-5.62,-104,-4.93,-123.3,-0.45,-128.77,-21.01,-2.15,3.16,-104.88,4.21,-66.73,4.21,-18.11,5.16,23.21,12.55,3.77,3.31,31.88,-2.98,48.47,-21.4,-46.98,0.69,-49.88,3.8,-76.45,-6.86,-48.96,-0.09,-98.78,2.84,-117.38,1.05,-126.81,-2.87,-121.69,-2.09,-112.46,-2.18,-90.71,-0.24,-103.97,-0.14,-61.81,-0.79,-37.91,-0.02,-9.29,3.58,-23.15,-4.29,13.28,-0.73,-18.34,-1.64,4.84,-2.97,18.69,-13.12,6.01,-13.74,-91.56,0.94,-116.74,9.12,-75.52,-1.42,-128.28,-1.52,-128,-17.25,-24.65,-14.66,-77.57,8.52,-76.21,11.86,-91.71,-1.84,-101.67,13.28,-59.05,9.36,-60.87]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_NOSE.01","timeline":[{"name":"B_NOSE.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_NOSE.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_NOSE.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NOSE.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_NOSE.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_00","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67,-38.83,-116.67]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33,0,-119.33]},{"value":[42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33,42,-119.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_01","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67,-41.5,-68.67]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70,0,-70]},{"value":[42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70,42,-70]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_02","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83,0,-42.83]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42,0,42]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_03","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-41.88,77.54,-41.88,77.69,-41.88,77.85,-41.88,77.99,-41.88,78.04,-41.88,77.99,-41.88,77.85,-41.88,77.69,-41.88,77.54,-41.88,77.2,-41.89,77.38,-41.9,77.57,-41.9,77.73,-41.9,77.79,-41.9,77.72,-41.89,77.56,-41.88,77.36,-41.87,77.18,-41.88,76.87,-41.9,77.07,-41.91,77.3,-41.91,77.48,-41.91,77.57,-41.91,77.47,-41.88,77.27,-41.86,77.04,-41.84,76.82,-41.88,76.53,-41.91,76.75,-41.92,77,-41.94,77.21,-41.94,77.3,-41.93,77.19,-41.9,76.97,-41.86,76.71,-41.83,76.47,-41.88,76.17,-41.92,76.39,-41.96,76.63,-41.99,76.83,-42.01,76.92,-41.99,76.83,-41.96,76.63,-41.92,76.39,-41.88,76.17,-41.82,75.63,-41.85,75.87,-41.9,76.14,-41.93,76.35,-41.94,76.45,-41.95,76.35,-41.95,76.14,-41.95,75.87,-41.94,75.63,-41.79,75.13,-41.83,75.38,-41.87,75.66,-41.9,75.88,-41.91,75.98,-41.92,75.88,-41.93,75.66,-41.94,75.38,-41.93,75.13,-41.78,74.65,-41.82,74.91,-41.86,75.19,-41.89,75.41,-41.9,75.51,-41.9,75.41,-41.91,75.19,-41.91,74.91,-41.9,74.65,-41.76,74.17,-41.8,74.43,-41.84,74.71,-41.87,74.94,-41.88,75.04,-41.88,74.94,-41.88,74.71,-41.88,74.43,-41.88,74.17]},{"duration":60,"tweenEasing":0,"value":[-0.05,82.04,-0.05,82.19,-0.05,82.35,-0.05,82.49,-0.05,82.54,-0.05,82.49,-0.05,82.35,-0.05,82.19,-0.05,82.04,-0.05,81.7,-0.06,81.88,-0.06,82.07,-0.07,82.23,-0.07,82.3,-0.07,82.22,-0.06,82.06,-0.04,81.86,-0.03,81.69,-0.05,81.37,-0.06,81.57,-0.07,81.8,-0.08,81.99,-0.08,82.07,-0.07,81.97,-0.05,81.78,-0.02,81.54,0,81.32,-0.05,81.03,-0.07,81.25,-0.09,81.5,-0.1,81.71,-0.11,81.8,-0.1,81.69,-0.06,81.47,-0.03,81.21,0,80.98,-0.05,80.67,-0.09,80.89,-0.13,81.14,-0.16,81.33,-0.18,81.42,-0.16,81.33,-0.13,81.14,-0.09,80.89,-0.05,80.67,0.02,80.13,-0.02,80.37,-0.06,80.64,-0.09,80.85,-0.11,80.95,-0.11,80.85,-0.12,80.64,-0.12,80.37,-0.1,80.13,0.04,79.64,0.01,79.88,-0.03,80.16,-0.07,80.38,-0.08,80.48,-0.09,80.38,-0.1,80.16,-0.1,79.88,-0.1,79.64,0.06,79.15,0.02,79.41,-0.02,79.69,-0.06,79.92,-0.07,80.01,-0.07,79.92,-0.07,79.69,-0.07,79.41,-0.07,79.15,0.07,78.67,0.04,78.93,0,79.21,-0.04,79.45,-0.05,79.54,-0.05,79.45,-0.05,79.21,-0.05,78.93,-0.05,78.67]},{"value":[41.95,82.04,41.95,82.19,41.95,82.35,41.95,82.49,41.95,82.54,41.95,82.49,41.95,82.35,41.95,82.19,41.95,82.04,41.95,81.7,41.94,81.88,41.94,82.07,41.93,82.23,41.93,82.3,41.93,82.22,41.94,82.06,41.96,81.86,41.97,81.69,41.95,81.37,41.94,81.57,41.93,81.8,41.92,81.99,41.92,82.07,41.93,81.97,41.95,81.78,41.98,81.54,42,81.32,41.95,81.03,41.93,81.25,41.91,81.5,41.9,81.71,41.89,81.8,41.9,81.69,41.94,81.47,41.97,81.21,42,80.98,41.95,80.67,41.91,80.89,41.87,81.14,41.84,81.33,41.82,81.42,41.84,81.33,41.87,81.14,41.91,80.89,41.95,80.67,42.02,80.13,41.98,80.37,41.94,80.64,41.91,80.85,41.89,80.95,41.89,80.85,41.88,80.64,41.88,80.37,41.9,80.13,42.04,79.64,42.01,79.88,41.97,80.16,41.93,80.38,41.92,80.48,41.91,80.38,41.9,80.16,41.9,79.88,41.9,79.64,42.06,79.15,42.02,79.41,41.98,79.69,41.94,79.92,41.93,80.01,41.93,79.92,41.93,79.69,41.93,79.41,41.93,79.15,42.07,78.67,42.04,78.93,42,79.21,41.96,79.45,41.95,79.54,41.95,79.45,41.95,79.21,41.95,78.93,41.95,78.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NOSE.01_04","timeline":[{"name":"B_NOSE.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-36.93,157.75,-36.93,158.05,-36.93,158.37,-36.93,158.64,-36.93,158.75,-36.93,158.64,-36.93,158.37,-36.93,158.05,-36.93,157.75,-36.93,157.07,-36.95,157.42,-36.96,157.81,-36.97,158.12,-36.97,158.26,-36.96,158.11,-36.94,157.79,-36.92,157.39,-36.9,157.04,-36.93,156.4,-36.96,156.82,-36.98,157.27,-36.99,157.64,-37,157.81,-36.98,157.61,-36.93,157.22,-36.88,156.74,-36.84,156.31,-36.93,155.72,-36.98,156.17,-37.02,156.67,-37.04,157.08,-37.05,157.27,-37.02,157.05,-36.96,156.61,-36.89,156.09,-36.83,155.62,-36.93,155,-37.01,155.44,-37.09,155.94,-37.16,156.33,-37.18,156.5,-37.16,156.33,-37.09,155.94,-37.01,155.44,-36.93,155,-36.8,153.93,-36.88,154.41,-36.96,154.94,-37.02,155.37,-37.05,155.56,-37.06,155.37,-37.07,154.94,-37.07,154.41,-37.04,153.93,-36.75,152.94,-36.82,153.43,-36.9,153.98,-36.97,154.43,-37,154.62,-37.01,154.43,-37.03,153.98,-37.04,153.43,-37.03,152.94,-36.72,151.98,-36.8,152.48,-36.88,153.04,-36.95,153.5,-36.97,153.69,-36.97,153.5,-36.98,153.04,-36.98,152.48,-36.97,151.98,-36.68,151,-36.76,151.52,-36.84,152.09,-36.91,152.56,-36.93,152.75,-36.93,152.56,-36.93,152.09,-36.93,151.52,-36.93,151]},{"duration":60,"tweenEasing":0,"value":[-0.1,164.08,-0.1,164.38,-0.1,164.71,-0.1,164.97,-0.1,165.08,-0.1,164.97,-0.1,164.71,-0.1,164.38,-0.1,164.08,-0.1,163.41,-0.12,163.76,-0.13,164.14,-0.14,164.45,-0.14,164.59,-0.13,164.44,-0.11,164.12,-0.09,163.73,-0.07,163.37,-0.1,162.74,-0.13,163.15,-0.15,163.6,-0.16,163.97,-0.16,164.15,-0.14,163.94,-0.1,163.55,-0.05,163.08,-0.01,162.65,-0.1,162.06,-0.15,162.51,-0.18,163,-0.21,163.41,-0.22,163.61,-0.19,163.38,-0.13,162.95,-0.06,162.43,0.01,161.95,-0.1,161.33,-0.17,161.78,-0.26,162.27,-0.32,162.67,-0.35,162.83,-0.32,162.67,-0.26,162.27,-0.17,161.78,-0.1,161.33,0.03,160.26,-0.04,160.74,-0.12,161.28,-0.19,161.71,-0.22,161.9,-0.22,161.71,-0.23,161.27,-0.23,160.74,-0.21,160.26,0.09,159.27,0.01,159.77,-0.07,160.32,-0.14,160.77,-0.16,160.96,-0.17,160.76,-0.19,160.32,-0.21,159.77,-0.19,159.27,0.11,158.31,0.04,158.82,-0.05,159.38,-0.11,159.83,-0.14,160.02,-0.14,159.83,-0.14,159.38,-0.14,158.82,-0.14,158.31,0.15,157.33,0.08,157.85,-0.01,158.43,-0.07,158.89,-0.1,159.08,-0.1,158.89,-0.1,158.43,-0.1,157.85,-0.1,157.33]},{"value":[41.9,164.08,41.9,164.38,41.9,164.71,41.9,164.97,41.9,165.08,41.9,164.97,41.9,164.71,41.9,164.38,41.9,164.08,41.9,163.41,41.88,163.76,41.87,164.14,41.86,164.45,41.86,164.59,41.87,164.44,41.89,164.12,41.91,163.73,41.93,163.37,41.9,162.74,41.87,163.15,41.85,163.6,41.84,163.97,41.84,164.15,41.86,163.94,41.9,163.55,41.95,163.08,41.99,162.65,41.9,162.06,41.85,162.51,41.82,163,41.79,163.41,41.78,163.61,41.81,163.38,41.87,162.95,41.94,162.43,42.01,161.95,41.9,161.33,41.83,161.78,41.74,162.27,41.68,162.67,41.65,162.83,41.68,162.67,41.74,162.27,41.83,161.78,41.9,161.33,42.03,160.26,41.96,160.74,41.88,161.28,41.81,161.71,41.78,161.9,41.78,161.71,41.77,161.27,41.77,160.74,41.79,160.26,42.09,159.27,42.01,159.77,41.93,160.32,41.86,160.77,41.84,160.96,41.83,160.76,41.81,160.32,41.79,159.77,41.81,159.27,42.11,158.31,42.04,158.82,41.95,159.38,41.89,159.83,41.86,160.02,41.86,159.83,41.86,159.38,41.86,158.82,41.86,158.31,42.15,157.33,42.08,157.85,41.99,158.43,41.93,158.89,41.9,159.08,41.9,158.89,41.9,158.43,41.9,157.85,41.9,157.33]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_NOSE.00","timeline":[{"name":"D_NOSE.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_NOSE.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_NOSE.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_NOSE.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_00"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_03","timeline":[{"name":"D_NOSE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-21.38,2.28,-42.1,8.37,-41.92,8.7]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.00_04","timeline":[{"name":"D_NOSE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-21.38,2.28,-42.1,8.37,-41.92,8.7]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_NOSE.01","timeline":[{"name":"D_NOSE.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_NOSE.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_NOSE.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_NOSE.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_NOSE.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_00","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"offset":8,"value":[-8.33,4.08,-15.28,-1.36,0,0,0,0,0,0,0,0,0,0,0,0,-8.33,5.44,0,0,-1.39,1.36]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_01","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"offset":8,"value":[-8.33,4.08,-15.28,-1.36,0,0,0,0,0,0,0,0,0,0,0,0,-8.33,5.44,0,0,-1.39,1.36]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_03","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"value":[8.68,0.67,-19.45,-0.18,-85.46,-7.25,-36.09,-3.63,-23.56,0.08,-4.11,2.69,-51.96,-5.64,-35.58,-2.22,-2.72,1.34,-18.71,-0.07,-69.7,7.26,-31.13,-4.28,1.18,-1.34,-43.96,-2.37,-33.84,-1.25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_NOSE.01_04","timeline":[{"name":"D_NOSE.01","type":22,"frame":[{"duration":121,"value":[8.68,0.67,-19.45,-0.18,-85.46,-7.25,-36.09,-3.63,-23.56,0.08,-4.11,2.69,-51.96,-5.64,-35.58,-2.22,-2.72,1.34,-18.71,-0.07,-69.7,7.26,-31.13,-4.28,1.18,-1.34,-43.96,-2.37,-33.84,-1.25]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EAR.01","timeline":[{"name":"B_EAR.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EAR.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EAR.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EAR.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_00","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-5.26,-39.61,-5.96,-40.18,-6.67,-40.96,-7.37,-41.3,-8.08,-40.55,-8.78,-39.47,-9.49,-39.02,-10.19,-38.82,-10.9,-38.49,-6.95,-40.54,-7.66,-40.5,-8.36,-40.63,-9.07,-40.42,-9.77,-39.4,-10.45,-38.43,-11.11,-38.13,-11.76,-38.08,-12.45,-37.91,-8.65,-41.46,-9.36,-40.77,-10.06,-40.19,-10.76,-39.38,-11.47,-38.02,-12.11,-37.23,-12.68,-37.12,-13.26,-37.3,-13.9,-37.34,-10.34,-42.39,-11.05,-41.14,-11.75,-39.96,-12.46,-38.66,-13.16,-37.09,-13.8,-36.35,-14.35,-36.34,-14.91,-36.62,-15.55,-36.76,-12.04,-43.31,-12.75,-41.79,-13.45,-40.28,-14.16,-38.76,-14.86,-37.25,-15.56,-36.28,-16.27,-36.09,-16.97,-36.21,-17.68,-36.18,-13.59,-45.25,-14.16,-43.63,-14.77,-41.99,-15.43,-40.39,-16.12,-38.9,-16.81,-37.96,-17.47,-37.66,-18.08,-37.61,-18.65,-37.43,-14.93,-48.66,-15.29,-46.83,-15.68,-44.96,-16.14,-43.17,-16.75,-41.59,-17.36,-40.54,-17.83,-39.98,-18.21,-39.62,-18.57,-39.16,-16.19,-52.64,-16.32,-50.57,-16.41,-48.42,-16.63,-46.41,-17.14,-44.7,-17.64,-43.48,-17.86,-42.6,-17.95,-41.87,-18.08,-41.06,-17.49,-56.34,-17.4,-54.03,-17.23,-51.64,-17.23,-49.42,-17.64,-47.61,-18.06,-46.24,-18.05,-45.08,-17.88,-44,-17.8,-42.88]},{"duration":60,"tweenEasing":0,"value":[2.66,-43.36,2.66,-43.91,2.66,-44.67,2.66,-45,2.66,-44.24,2.67,-43.15,2.67,-42.68,2.67,-42.46,2.67,-42.12,0.95,-43.36,0.95,-43.31,0.95,-43.42,0.95,-43.2,0.95,-42.16,0.97,-41.18,1.03,-40.86,1.08,-40.81,1.1,-40.62,-0.77,-43.36,-0.77,-42.66,-0.77,-42.06,-0.77,-41.24,-0.76,-39.87,-0.7,-39.06,-0.57,-38.94,-0.43,-39.1,-0.37,-39.12,-2.48,-43.36,-2.48,-42.11,-2.48,-40.91,-2.48,-39.6,-2.48,-38.01,-2.41,-37.25,-2.26,-37.23,-2.11,-37.5,-2.04,-37.62,-4.2,-43.37,-4.2,-41.84,-4.2,-40.31,-4.19,-38.78,-4.19,-37.25,-4.19,-36.26,-4.19,-36.06,-4.19,-36.17,-4.19,-36.13,-5.91,-43.37,-5.91,-41.84,-5.91,-40.31,-5.91,-38.78,-5.91,-37.25,-5.91,-36.27,-5.91,-36.04,-5.9,-36.1,-5.9,-36.02,-7.63,-43.37,-7.63,-41.84,-7.63,-40.31,-7.62,-38.78,-7.62,-37.25,-7.62,-36.24,-7.62,-35.94,-7.62,-35.92,-7.62,-35.75,-9.34,-43.37,-9.34,-41.84,-9.34,-40.31,-9.34,-38.78,-9.34,-37.25,-9.34,-36.2,-9.34,-35.81,-9.33,-35.68,-9.33,-35.43,-11.06,-43.37,-11.06,-41.84,-11.05,-40.31,-11.05,-38.78,-11.05,-37.25,-11.05,-36.16,-11.05,-35.69,-11.05,-35.47,-11.05,-35.13]},{"value":[19.99,-43.36,19.99,-43.91,20,-44.67,20,-45,20,-44.24,20,-43.15,20,-42.68,20,-42.46,20,-42.12,18.28,-43.36,18.28,-43.31,18.28,-43.42,18.28,-43.2,18.28,-42.16,18.31,-41.18,18.36,-40.86,18.41,-40.81,18.43,-40.62,16.56,-43.36,16.57,-42.66,16.57,-42.06,16.57,-41.24,16.57,-39.87,16.63,-39.06,16.77,-38.94,16.9,-39.1,16.96,-39.12,14.85,-43.36,14.85,-42.11,14.85,-40.91,14.85,-39.6,14.85,-38.01,14.92,-37.25,15.08,-37.23,15.23,-37.5,15.3,-37.62,13.13,-43.37,13.14,-41.84,13.14,-40.31,13.14,-38.78,13.14,-37.25,13.14,-36.26,13.14,-36.06,13.14,-36.17,13.14,-36.13,11.42,-43.37,11.42,-41.84,11.42,-40.31,11.42,-38.78,11.43,-37.25,11.43,-36.27,11.43,-36.04,11.43,-36.1,11.43,-36.02,9.71,-43.37,9.71,-41.84,9.71,-40.31,9.71,-38.78,9.71,-37.25,9.71,-36.24,9.71,-35.94,9.71,-35.92,9.72,-35.75,7.99,-43.37,7.99,-41.84,7.99,-40.31,7.99,-38.78,8,-37.25,8,-36.2,8,-35.81,8,-35.68,8,-35.43,6.28,-43.37,6.28,-41.84,6.28,-40.31,6.28,-38.78,6.28,-37.25,6.28,-36.16,6.28,-35.69,6.28,-35.47,6.29,-35.13]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_01","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.08,-16.43,-0.63,-16.72,-1.33,-17.12,-2.04,-17.3,-2.74,-16.93,-3.45,-16.4,-4.15,-16.18,-4.86,-16.08,-5.56,-15.93,-0.76,-17.36,-1.46,-17.35,-2.17,-17.42,-2.87,-17.32,-3.58,-16.82,-4.27,-16.34,-4.96,-16.19,-5.64,-16.18,-6.33,-16.1,-1.6,-18.28,-2.3,-17.94,-3.01,-17.66,-3.71,-17.26,-4.42,-16.59,-5.09,-16.2,-5.73,-16.15,-6.37,-16.25,-7.05,-16.27,-2.44,-19.2,-3.14,-18.59,-3.85,-18,-4.55,-17.36,-5.26,-16.58,-5.93,-16.22,-6.56,-16.22,-7.19,-16.37,-7.86,-16.45,-3.27,-20.13,-3.98,-19.38,-4.69,-18.62,-5.39,-17.87,-6.1,-17.12,-6.8,-16.65,-7.51,-16.56,-8.21,-16.63,-8.92,-16.62,-3.97,-22.07,-4.53,-21.21,-5.15,-20.34,-5.81,-19.51,-6.5,-18.78,-7.19,-18.32,-7.85,-18.14,-8.46,-18.06,-9.03,-17.93,-4.45,-25.47,-4.81,-24.41,-5.2,-23.3,-5.66,-22.28,-6.27,-21.47,-6.88,-20.92,-7.35,-20.51,-7.73,-20.16,-8.1,-19.78,-4.85,-29.46,-4.98,-28.15,-5.08,-26.77,-5.29,-25.52,-5.8,-24.58,-6.31,-23.88,-6.52,-23.2,-6.62,-22.53,-6.75,-21.85,-5.3,-33.15,-5.21,-31.61,-5.04,-29.98,-5.04,-28.52,-5.45,-27.48,-5.87,-26.66,-5.86,-25.73,-5.69,-24.76,-5.61,-23.81]},{"duration":60,"tweenEasing":0,"value":[1.33,-20.18,1.33,-20.45,1.33,-20.84,1.33,-21,1.33,-20.62,1.33,-20.07,1.33,-19.84,1.33,-19.73,1.33,-19.56,0.47,-20.18,0.47,-20.15,0.47,-20.21,0.47,-20.1,0.48,-19.58,0.49,-19.09,0.51,-18.93,0.54,-18.9,0.55,-18.81,-0.38,-20.18,-0.38,-19.83,-0.38,-19.53,-0.38,-19.12,-0.38,-18.43,-0.35,-18.03,-0.28,-17.97,-0.22,-18.05,-0.18,-18.06,-1.24,-20.18,-1.24,-19.55,-1.24,-18.95,-1.24,-18.3,-1.24,-17.51,-1.2,-17.13,-1.13,-17.11,-1.05,-17.25,-1.02,-17.31,-2.1,-20.18,-2.1,-19.42,-2.1,-18.65,-2.1,-17.89,-2.1,-17.12,-2.1,-16.63,-2.1,-16.53,-2.09,-16.59,-2.09,-16.56,-2.96,-20.18,-2.96,-19.42,-2.96,-18.65,-2.95,-17.89,-2.95,-17.12,-2.95,-16.64,-2.95,-16.52,-2.95,-16.55,-2.95,-16.51,-3.81,-20.18,-3.81,-19.42,-3.81,-18.65,-3.81,-17.89,-3.81,-17.12,-3.81,-16.62,-3.81,-16.47,-3.81,-16.46,-3.81,-16.38,-4.67,-20.19,-4.67,-19.42,-4.67,-18.66,-4.67,-17.89,-4.67,-17.13,-4.67,-16.6,-4.67,-16.4,-4.67,-16.34,-4.67,-16.21,-5.53,-20.19,-5.53,-19.42,-5.53,-18.66,-5.53,-17.89,-5.53,-17.13,-5.53,-16.58,-5.52,-16.35,-5.52,-16.24,-5.52,-16.07]},{"value":[10,-20.18,10,-20.45,10,-20.84,10,-21,10,-20.62,10,-20.07,10,-19.84,10,-19.73,10,-19.56,9.14,-20.18,9.14,-20.15,9.14,-20.21,9.14,-20.1,9.14,-19.58,9.15,-19.09,9.18,-18.93,9.21,-18.9,9.22,-18.81,8.28,-20.18,8.28,-19.83,8.28,-19.53,8.28,-19.12,8.28,-18.43,8.32,-18.03,8.38,-17.97,8.45,-18.05,8.48,-18.06,7.42,-20.18,7.43,-19.55,7.43,-18.95,7.43,-18.3,7.43,-17.51,7.46,-17.13,7.54,-17.11,7.61,-17.25,7.65,-17.31,6.57,-20.18,6.57,-19.42,6.57,-18.65,6.57,-17.89,6.57,-17.12,6.57,-16.63,6.57,-16.53,6.57,-16.59,6.57,-16.56,5.71,-20.18,5.71,-19.42,5.71,-18.65,5.71,-17.89,5.71,-17.12,5.71,-16.64,5.71,-16.52,5.71,-16.55,5.72,-16.51,4.85,-20.18,4.85,-19.42,4.85,-18.65,4.85,-17.89,4.86,-17.12,4.86,-16.62,4.86,-16.47,4.86,-16.46,4.86,-16.38,4,-20.19,4,-19.42,4,-18.66,4,-17.89,4,-17.13,4,-16.6,4,-16.4,4,-16.34,4,-16.21,3.14,-20.19,3.14,-19.42,3.14,-18.66,3.14,-17.89,3.14,-17.13,3.14,-16.58,3.14,-16.35,3.14,-16.24,3.14,-16.07]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_02","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[4.08,3.75,3.38,3.73,2.67,3.72,1.97,3.7,1.26,3.69,0.55,3.67,-0.15,3.66,-0.86,3.65,-1.57,3.63,4.1,2.82,3.4,2.81,2.69,2.8,1.98,2.78,1.28,2.77,0.57,2.75,-0.13,2.74,-0.84,2.72,-1.55,2.71,4.12,1.9,3.41,1.89,2.71,1.87,2,1.86,1.3,1.84,0.59,1.83,-0.12,1.82,-0.82,1.8,-1.53,1.79,4.14,0.98,3.43,0.96,2.73,0.95,2.02,0.94,1.31,0.92,0.61,0.91,-0.1,0.89,-0.8,0.88,-1.51,0.87,4.16,0.06,3.45,0.04,2.75,0.03,2.04,0.01,1.33,0,0.63,-0.01,-0.08,-0.03,-0.79,-0.04,-1.49,-0.06,4.32,-1.89,3.76,-1.8,3.14,-1.69,2.48,-1.62,1.79,-1.65,1.1,-1.69,0.44,-1.62,-0.18,-1.51,-0.74,-1.42,4.7,-5.29,4.33,-4.99,3.95,-4.65,3.48,-4.39,2.87,-4.34,2.26,-4.3,1.79,-4.04,1.41,-3.7,1.05,-3.4,5.15,-9.27,5.02,-8.72,4.93,-8.11,4.71,-7.63,4.2,-7.45,3.7,-7.28,3.48,-6.79,3.38,-6.18,3.25,-5.64,5.57,-12.97,5.65,-12.19,5.82,-11.33,5.82,-10.63,5.41,-10.36,4.99,-10.08,5,-9.38,5.16,-8.52,5.25,-7.75]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33,0,-3.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_03","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[0.46,30,-0.1,28.82,-0.64,27.66,-1.21,26.47,-1.86,25.25,-2.62,23.92,-3.46,22.48,-4.33,20.98,-5.18,19.51,0.63,28.25,0.02,27.03,-0.6,25.82,-1.24,24.6,-1.92,23.37,-2.66,22,-3.46,20.51,-4.28,18.98,-5.09,17.48,0.87,26.49,0.19,25.24,-0.53,23.98,-1.26,22.73,-1.98,21.48,-2.7,20.04,-3.46,18.49,-4.22,16.89,-4.99,15.32,0.98,24.75,0.26,23.45,-0.51,22.15,-1.29,20.86,-2.03,19.6,-2.74,18.14,-3.45,16.58,-4.18,14.98,-4.9,13.4,0.78,23.05,0.07,21.7,-0.63,20.35,-1.33,19.01,-2.04,17.73,-2.74,16.4,-3.45,14.98,-4.15,13.51,-4.86,12.07,0.66,21.14,0.14,19.87,-0.38,18.62,-0.94,17.34,-1.58,16,-2.27,14.65,-2.93,13.33,-3.55,12.02,-4.11,10.71,1.07,17.45,0.75,16.42,0.45,15.44,0.07,14.37,-0.5,13.13,-1.11,11.89,-1.58,10.8,-1.96,9.78,-2.32,8.72,1.68,13.06,1.56,12.33,1.5,11.67,1.32,10.88,0.83,9.8,0.32,8.71,0.11,7.91,0.02,7.23,-0.12,6.48,2.19,9.02,2.27,8.57,2.44,8.19,2.45,7.65,2.03,6.7,1.62,5.74,1.63,5.2,1.8,4.83,1.88,4.37]},{"duration":60,"tweenEasing":0,"value":[-3.63,26.25,-3.48,25.09,-3.31,23.94,-3.18,22.77,-3.12,21.57,-3.18,20.25,-3.31,18.82,-3.47,17.34,-3.62,15.88,-3.47,25.42,-3.38,24.22,-3.29,23.03,-3.22,21.82,-3.2,20.6,-3.23,19.24,-3.32,17.77,-3.44,16.26,-3.54,14.77,-3.25,24.59,-3.22,23.35,-3.23,22.11,-3.26,20.87,-3.28,19.63,-3.3,18.21,-3.34,16.67,-3.4,15.09,-3.46,13.53,-3.16,23.77,-3.17,22.49,-3.24,21.2,-3.31,19.92,-3.35,18.67,-3.35,17.24,-3.35,15.69,-3.37,14.1,-3.4,12.54,-3.38,22.99,-3.38,21.66,-3.38,20.32,-3.37,19,-3.37,17.73,-3.37,16.42,-3.37,15.01,-3.37,13.56,-3.37,12.12,-3.66,23.02,-3.61,21.67,-3.52,20.31,-3.42,18.96,-3.37,17.65,-3.37,16.34,-3.37,14.95,-3.37,13.53,-3.37,12.12,-3.63,22.74,-3.59,21.42,-3.5,20.09,-3.41,18.77,-3.37,17.47,-3.37,16.18,-3.37,14.84,-3.37,13.47,-3.37,12.12,-3.47,22.33,-3.46,21.06,-3.42,19.78,-3.39,18.51,-3.37,17.25,-3.37,15.99,-3.37,14.71,-3.37,13.41,-3.37,12.12,-3.38,21.99,-3.38,20.75,-3.38,19.52,-3.37,18.29,-3.37,17.05,-3.37,15.82,-3.37,14.59,-3.37,13.35,-3.37,12.12]},{"value":[-16.96,26.25,-16.81,25.09,-16.65,23.94,-16.51,22.77,-16.46,21.57,-16.51,20.25,-16.64,18.82,-16.8,17.34,-16.95,15.88,-16.81,25.42,-16.71,24.22,-16.62,23.03,-16.56,21.82,-16.53,20.6,-16.57,19.24,-16.66,17.77,-16.77,16.26,-16.88,14.77,-16.59,24.59,-16.55,23.35,-16.57,22.11,-16.6,20.87,-16.61,19.63,-16.63,18.21,-16.67,16.67,-16.73,15.09,-16.79,13.53,-16.49,23.77,-16.5,22.49,-16.57,21.2,-16.64,19.92,-16.68,18.67,-16.68,17.24,-16.69,15.69,-16.7,14.1,-16.73,12.54,-16.71,22.99,-16.71,21.66,-16.71,20.32,-16.71,19,-16.71,17.73,-16.71,16.42,-16.7,15.01,-16.7,13.56,-16.7,12.12,-16.99,23.02,-16.95,21.67,-16.85,20.31,-16.75,18.96,-16.71,17.65,-16.7,16.34,-16.7,14.95,-16.7,13.53,-16.7,12.12,-16.96,22.74,-16.92,21.42,-16.83,20.09,-16.75,18.77,-16.71,17.47,-16.7,16.18,-16.7,14.84,-16.7,13.47,-16.7,12.12,-16.81,22.33,-16.79,21.06,-16.76,19.78,-16.72,18.51,-16.71,17.25,-16.7,15.99,-16.7,14.71,-16.7,13.41,-16.7,12.12,-16.71,21.99,-16.71,20.75,-16.71,19.52,-16.71,18.29,-16.71,17.05,-16.7,15.82,-16.7,14.59,-16.7,13.35,-16.7,12.12]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.01_04","timeline":[{"name":"B_EAR.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.17,56.24,-3.58,53.91,-3.96,51.59,-4.39,49.25,-4.99,46.82,-5.8,44.17,-6.77,41.29,-7.8,38.32,-8.8,35.39,-2.84,53.67,-3.36,51.26,-3.89,48.85,-4.46,46.42,-5.12,43.97,-5.89,41.24,-6.78,38.29,-7.72,35.24,-8.63,32.24,-2.39,51.08,-3.03,48.59,-3.76,46.09,-4.53,43.59,-5.26,41.11,-6,38.24,-6.8,35.16,-7.62,31.99,-8.45,28.86,-2.18,48.52,-2.91,45.94,-3.75,43.35,-4.6,40.78,-5.38,38.27,-6.08,35.38,-6.81,32.27,-7.55,29.08,-8.3,25.94,-2.6,46.04,-3.3,43.36,-4.01,40.66,-4.71,38.01,-5.41,35.45,-6.12,32.82,-6.82,29.99,-7.52,27.07,-8.23,24.19,-3,44.16,-3.47,41.54,-3.89,38.93,-4.36,36.3,-4.96,33.65,-5.64,30.99,-6.3,28.28,-6.92,25.55,-7.48,22.83,-2.56,40.19,-2.84,37.84,-3.05,35.52,-3.35,33.14,-3.88,30.6,-4.48,28.07,-4.95,25.64,-5.33,23.25,-5.69,20.84,-1.79,35.39,-1.89,33.39,-1.92,31.45,-2.07,29.39,-2.54,27.05,-3.05,24.7,-3.26,22.62,-3.35,20.64,-3.48,18.6,-1.19,31.01,-1.1,29.32,-0.93,27.71,-0.93,25.94,-1.34,23.75,-1.75,21.56,-1.75,19.79,-1.57,18.18,-1.49,16.49]},{"duration":60,"tweenEasing":0,"value":[-7.26,52.5,-6.96,50.18,-6.63,47.88,-6.36,45.54,-6.25,43.13,-6.35,40.5,-6.62,37.63,-6.94,34.67,-7.24,31.76,-6.94,50.85,-6.75,48.45,-6.58,46.05,-6.45,43.64,-6.39,41.2,-6.47,38.49,-6.65,35.55,-6.88,32.52,-7.09,29.53,-6.51,49.18,-6.44,46.7,-6.47,44.21,-6.53,41.74,-6.56,39.27,-6.59,36.42,-6.68,33.34,-6.8,30.18,-6.92,27.07,-6.32,47.54,-6.34,44.98,-6.47,42.4,-6.62,39.84,-6.69,37.35,-6.69,34.47,-6.71,31.38,-6.74,28.2,-6.79,25.07,-6.76,45.99,-6.75,43.32,-6.75,40.64,-6.75,37.99,-6.75,35.45,-6.74,32.84,-6.74,30.02,-6.74,27.11,-6.74,24.25,-7.32,46.05,-7.23,43.34,-7.03,40.61,-6.84,37.92,-6.75,35.3,-6.74,32.68,-6.74,29.9,-6.74,27.06,-6.74,24.25,-7.26,45.48,-7.18,42.83,-7,40.17,-6.83,37.53,-6.75,34.94,-6.74,32.36,-6.74,29.68,-6.74,26.95,-6.74,24.24,-6.94,44.66,-6.91,42.12,-6.84,39.56,-6.78,37.02,-6.75,34.5,-6.74,31.98,-6.74,29.41,-6.74,26.82,-6.74,24.24,-6.76,43.97,-6.75,41.51,-6.75,39.04,-6.75,36.57,-6.75,34.1,-6.74,31.64,-6.74,29.17,-6.74,26.7,-6.74,24.24]},{"value":[-10.59,52.5,-10.29,50.18,-9.96,47.88,-9.69,45.54,-9.58,43.13,-9.69,40.5,-9.95,37.63,-10.27,34.67,-10.57,31.76,-10.28,50.85,-10.08,48.45,-9.91,46.05,-9.78,43.64,-9.73,41.2,-9.8,38.49,-9.98,35.55,-10.21,32.52,-10.42,29.53,-9.84,49.18,-9.78,46.7,-9.8,44.21,-9.86,41.74,-9.89,39.27,-9.92,36.42,-10.01,33.34,-10.13,30.18,-10.26,27.07,-9.65,47.54,-9.67,44.98,-9.81,42.4,-9.96,39.84,-10.02,37.35,-10.03,34.47,-10.04,31.38,-10.07,28.2,-10.12,25.07,-10.09,45.99,-10.09,43.32,-10.08,40.64,-10.08,37.99,-10.08,35.45,-10.08,32.84,-10.07,30.02,-10.07,27.11,-10.07,24.25,-10.65,46.05,-10.56,43.34,-10.37,40.61,-10.17,37.92,-10.08,35.3,-10.08,32.68,-10.07,29.9,-10.07,27.06,-10.07,24.25,-10.59,45.48,-10.51,42.83,-10.33,40.17,-10.16,37.53,-10.08,34.94,-10.08,32.36,-10.07,29.68,-10.07,26.95,-10.07,24.24,-10.28,44.66,-10.25,42.12,-10.18,39.56,-10.11,37.02,-10.08,34.5,-10.08,31.98,-10.07,29.41,-10.07,26.82,-10.07,24.24,-10.09,43.97,-10.09,41.51,-10.08,39.04,-10.08,36.57,-10.08,34.1,-10.08,31.64,-10.07,29.17,-10.07,26.7,-10.07,24.24]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_EAR.02","timeline":[{"name":"B_EAR.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_EAR.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_EAR.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_EAR.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_EAR.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_00","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-8.02,5.82,-6.89,4.51,-5.75,3.2,-4.61,1.89,-3.47,0.58,-2.33,-0.73,-1.2,-2.04,-0.06,-3.35,1.08,-4.66,-7.93,7.42,-6.8,6.11,-5.66,4.8,-4.52,3.49,-3.38,2.18,-2.24,0.87,-1.11,-0.44,0.03,-1.75,1.17,-3.06,-7.84,9.01,-6.7,7.71,-5.57,6.4,-4.43,5.09,-3.29,3.78,-2.15,2.47,-1.02,1.16,0.12,-0.15,1.26,-1.46,-7.75,10.61,-6.61,9.3,-5.48,7.99,-4.34,6.68,-3.2,5.37,-2.06,4.06,-0.93,2.75,0.21,1.45,1.35,0.14,-7.66,12.21,-6.52,10.9,-5.39,9.59,-4.25,8.28,-3.11,6.97,-1.97,5.66,-0.84,4.35,0.3,3.04,1.44,1.73,-7.57,13.81,-6.43,12.5,-5.3,11.19,-4.16,9.88,-3.02,8.57,-1.88,7.26,-0.75,5.95,0.39,4.64,1.53,3.33,-7.48,15.4,-6.34,14.09,-5.21,12.79,-4.07,11.48,-2.93,10.17,-1.79,8.86,-0.66,7.55,0.48,6.24,1.62,4.93,-7.39,17,-6.25,15.69,-5.12,14.38,-3.98,13.07,-2.84,11.76,-1.7,10.45,-0.56,9.14,0.57,7.83,1.71,6.53,-7.3,18.6,-6.16,17.29,-5.03,15.98,-3.89,14.67,-2.75,13.36,-1.61,12.05,-0.47,10.74,0.66,9.43,1.8,8.12]},{"duration":60,"tweenEasing":0,"offset":1,"value":[11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99,0,11.95,0,10.71,0,9.46,0,8.22,0,6.97,0,5.73,0,4.48,0,3.24,0,1.99]},{"value":[-3.07,16.05,-3.78,14.78,-4.5,13.51,-5.21,12.24,-5.92,10.97,-6.63,9.7,-7.34,8.43,-8.05,7.16,-8.77,5.89,-3.04,15.05,-3.75,13.78,-4.46,12.51,-5.17,11.24,-5.88,9.97,-6.6,8.7,-7.31,7.43,-8.02,6.16,-8.73,4.89,-3,14.05,-3.71,12.78,-4.43,11.51,-5.14,10.24,-5.85,8.97,-6.56,7.7,-7.27,6.43,-7.98,5.16,-8.69,3.89,-2.97,13.05,-3.68,11.78,-4.39,10.51,-5.1,9.24,-5.81,7.97,-6.52,6.7,-7.24,5.43,-7.95,4.16,-8.66,2.89,-2.93,12.05,-3.64,10.78,-4.35,9.51,-5.07,8.24,-5.78,6.97,-6.49,5.7,-7.2,4.43,-7.91,3.16,-8.62,1.89,-2.9,11.05,-3.61,9.78,-4.32,8.51,-5.03,7.24,-5.74,5.97,-6.45,4.7,-7.17,3.43,-7.88,2.16,-8.59,0.89,-2.86,10.05,-3.57,8.78,-4.28,7.51,-5,6.24,-5.71,4.97,-6.42,3.7,-7.13,2.43,-7.84,1.16,-8.55,-0.11,-2.83,9.06,-3.54,7.79,-4.25,6.51,-4.96,5.24,-5.67,3.97,-6.38,2.7,-7.1,1.43,-7.81,0.16,-8.52,-1.11,-2.79,8.06,-3.5,6.79,-4.21,5.52,-4.93,4.25,-5.64,2.98,-6.35,1.7,-7.06,0.43,-7.77,-0.84,-8.48,-2.11]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_01","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-1.36,-0.16,-0.22,-0.84,0.92,-1.53,2.06,-2.22,3.19,-2.9,4.33,-3.59,5.47,-4.28,6.61,-4.96,7.75,-5.65,-1.27,1.44,-0.13,0.75,1.01,0.07,2.15,-0.62,3.28,-1.31,4.42,-1.99,5.56,-2.68,6.7,-3.37,7.84,-4.05,-1.18,3.04,-0.04,2.35,1.1,1.66,2.24,0.98,3.37,0.29,4.51,-0.4,5.65,-1.08,6.79,-1.77,7.93,-2.46,-1.09,4.64,0.05,3.95,1.19,3.26,2.33,2.58,3.47,1.89,4.6,1.2,5.74,0.51,6.88,-0.17,8.02,-0.86,-1,6.23,0.14,5.55,1.28,4.86,2.42,4.17,3.56,3.49,4.69,2.8,5.83,2.11,6.97,1.42,8.11,0.74,-0.9,7.83,0.23,7.14,1.37,6.46,2.51,5.77,3.65,5.08,4.78,4.4,5.92,3.71,7.06,3.02,8.2,2.34,-0.81,9.43,0.32,8.74,1.46,8.05,2.6,7.37,3.74,6.68,4.87,5.99,6.01,5.31,7.15,4.62,8.29,3.93,-0.72,11.03,0.41,10.34,1.55,9.65,2.69,8.96,3.83,8.28,4.96,7.59,6.1,6.9,7.24,6.22,8.38,5.53,-0.63,12.62,0.5,11.94,1.64,11.25,2.78,10.56,3.92,9.88,5.05,9.19,6.19,8.5,7.33,7.81,8.47,7.13]},{"duration":60,"tweenEasing":0,"offset":1,"value":[5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1,0,5.98,0,5.35,0,4.73,0,4.11,0,3.49,0,2.86,0,2.24,0,1.62,0,1]},{"value":[-1.07,10.07,-1.78,9.43,-2.5,8.78,-3.21,8.13,-3.92,7.48,-4.63,6.83,-5.34,6.19,-6.05,5.54,-6.77,4.89,-1.04,9.07,-1.75,8.43,-2.46,7.78,-3.17,7.13,-3.88,6.48,-4.6,5.84,-5.31,5.19,-6.02,4.54,-6.73,3.89,-1,8.07,-1.71,7.43,-2.43,6.78,-3.14,6.13,-3.85,5.48,-4.56,4.84,-5.27,4.19,-5.98,3.54,-6.69,2.89,-0.97,7.08,-1.68,6.43,-2.39,5.78,-3.1,5.13,-3.81,4.48,-4.52,3.84,-5.24,3.19,-5.95,2.54,-6.66,1.89,-0.93,6.08,-1.64,5.43,-2.35,4.78,-3.07,4.13,-3.78,3.49,-4.49,2.84,-5.2,2.19,-5.91,1.54,-6.62,0.89,-0.9,5.08,-1.61,4.43,-2.32,3.78,-3.03,3.13,-3.74,2.49,-4.45,1.84,-5.17,1.19,-5.88,0.54,-6.59,-0.1,-0.86,4.08,-1.57,3.43,-2.28,2.78,-3,2.14,-3.71,1.49,-4.42,0.84,-5.13,0.19,-5.84,-0.46,-6.55,-1.1,-0.83,3.08,-1.54,2.43,-2.25,1.78,-2.96,1.14,-3.67,0.49,-4.38,-0.16,-5.1,-0.81,-5.81,-1.45,-6.52,-2.1,-0.79,2.08,-1.5,1.43,-2.21,0.78,-2.93,0.14,-3.64,-0.51,-4.35,-1.16,-5.06,-1.81,-5.77,-2.45,-6.48,-3.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_02","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[3.98,-6.13,5.11,-6.2,6.25,-6.26,7.39,-6.33,8.53,-6.39,9.67,-6.45,10.8,-6.52,11.94,-6.58,13.08,-6.65,4.07,-4.53,5.2,-4.6,6.34,-4.66,7.48,-4.73,8.62,-4.79,9.76,-4.86,10.89,-4.92,12.03,-4.99,13.17,-5.05,4.16,-2.94,5.3,-3,6.43,-3.07,7.57,-3.13,8.71,-3.19,9.85,-3.26,10.98,-3.32,12.12,-3.39,13.26,-3.45,4.25,-1.34,5.39,-1.4,6.52,-1.47,7.66,-1.53,8.8,-1.6,9.94,-1.66,11.07,-1.73,12.21,-1.79,13.35,-1.85,4.34,0.26,5.48,0.19,6.61,0.13,7.75,0.06,8.89,0,10.03,-0.06,11.16,-0.13,12.3,-0.19,13.44,-0.26,4.43,1.85,5.57,1.79,6.7,1.73,7.84,1.66,8.98,1.6,10.12,1.53,11.25,1.47,12.39,1.4,13.53,1.34,4.52,3.45,5.66,3.39,6.79,3.32,7.93,3.26,9.07,3.19,10.21,3.13,11.34,3.07,12.48,3,13.62,2.94,4.61,5.05,5.75,4.99,6.88,4.92,8.02,4.86,9.16,4.79,10.3,4.73,11.44,4.66,12.57,4.6,13.71,4.53,4.7,6.65,5.84,6.58,6.97,6.52,8.11,6.45,9.25,6.39,10.39,6.33,11.53,6.26,12.66,6.2,13.8,6.13]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.93,4.1,0.22,4.07,-0.5,4.05,-1.21,4.02,-1.92,4,-2.63,3.97,-3.34,3.95,-4.05,3.92,-4.77,3.9,0.96,3.1,0.25,3.07,-0.46,3.05,-1.17,3.02,-1.88,3,-2.6,2.97,-3.31,2.95,-4.02,2.92,-4.73,2.9,1,2.1,0.29,2.07,-0.43,2.05,-1.14,2.02,-1.85,2,-2.56,1.97,-3.27,1.95,-3.98,1.92,-4.69,1.9,1.03,1.1,0.32,1.07,-0.39,1.05,-1.1,1.02,-1.81,1,-2.52,0.97,-3.24,0.95,-3.95,0.92,-4.66,0.9,1.07,0.1,0.36,0.08,-0.35,0.05,-1.07,0.03,-1.78,0,-2.49,-0.03,-3.2,-0.05,-3.91,-0.08,-4.62,-0.1,1.1,-0.9,0.39,-0.92,-0.32,-0.95,-1.03,-0.97,-1.74,-1,-2.45,-1.02,-3.17,-1.05,-3.88,-1.07,-4.59,-1.1,1.14,-1.9,0.43,-1.92,-0.28,-1.95,-1,-1.97,-1.71,-2,-2.42,-2.02,-3.13,-2.05,-3.84,-2.07,-4.55,-2.1,1.17,-2.9,0.46,-2.92,-0.25,-2.95,-0.96,-2.97,-1.67,-3,-2.38,-3.02,-3.1,-3.05,-3.81,-3.07,-4.52,-3.1,1.21,-3.9,0.5,-3.92,-0.21,-3.95,-0.93,-3.97,-1.64,-4,-2.35,-4.02,-3.06,-4.05,-3.77,-4.07,-4.48,-4.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_03","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.31,20.14,1.46,20.72,3.3,21.34,5.01,21.88,6.38,22.26,7.52,22.58,8.66,22.97,9.8,23.39,10.93,23.79,-2.08,21.93,-0.33,22.52,1.48,23.14,3.16,23.7,4.52,24.08,5.66,24.47,6.8,25.01,7.93,25.6,9.07,26.17,-3.84,23.25,-2.11,23.97,-0.34,24.73,1.31,25.42,2.66,25.93,3.8,26.4,4.93,27.1,6.07,27.88,7.21,28.62,-5.61,24.77,-3.91,25.56,-2.17,26.39,-0.55,27.15,0.8,27.73,1.94,28.26,3.07,29.09,4.21,30.03,5.34,30.92,-7.43,27.19,-5.76,27.8,-4.02,28.44,-2.4,29.02,-1.07,29.41,0.07,29.93,1.21,30.81,2.34,31.84,3.48,32.8,-9.1,29.35,-7.65,29.88,-6.16,30.44,-4.73,30.94,-3.47,31.3,-2.26,31.94,-0.98,32.86,0.31,33.89,1.54,34.88,-10.48,32.32,-9.27,32.75,-8.06,33.19,-6.86,33.6,-5.7,33.92,-4.47,34.49,-3.14,35.28,-1.79,36.14,-0.5,36.97,-11.75,35.61,-10.78,35.94,-9.85,36.28,-8.87,36.6,-7.81,36.87,-6.58,37.31,-5.25,37.87,-3.89,38.49,-2.58,39.08,-13.07,38.74,-12.33,39,-11.63,39.27,-10.85,39.53,-9.85,39.79,-8.64,40.09,-7.33,40.44,-5.98,40.82,-4.64,41.18]},{"duration":60,"tweenEasing":0,"value":[8.71,26.27,9.35,26.92,10.05,27.6,10.62,28.21,10.86,28.65,10.86,29.03,10.86,29.49,10.86,29.97,10.86,30.44,6.85,26.47,7.46,27.12,8.14,27.81,8.68,28.43,8.9,28.88,8.9,29.33,8.9,29.93,8.9,30.59,8.9,31.22,5.01,26.18,5.59,26.97,6.23,27.8,6.74,28.55,6.95,29.12,6.95,29.66,6.95,30.42,6.95,31.27,6.95,32.08,3.14,26.11,3.7,26.97,4.31,27.86,4.8,28.68,5,29.32,5,29.92,5,30.81,5,31.82,4.99,32.77,1.23,26.93,1.77,27.61,2.36,28.32,2.85,28.95,3.05,29.41,3.04,29.99,3.04,30.94,3.04,32.03,3.04,33.06,-0.53,27.5,-0.21,28.09,0.14,28.71,0.43,29.28,0.55,29.71,0.61,30.4,0.76,31.39,0.92,32.49,1.01,33.54,-2,28.87,-1.93,29.36,-1.85,29.87,-1.79,30.34,-1.77,30.72,-1.68,31.36,-1.48,32.21,-1.27,33.14,-1.12,34.04,-3.36,30.56,-3.53,30.96,-3.73,31.36,-3.9,31.74,-3.97,32.08,-3.88,32.58,-3.69,33.21,-3.47,33.89,-3.29,34.55,-4.77,32.1,-5.17,32.42,-5.61,32.75,-5.96,33.07,-6.1,33.4,-6.03,33.76,-5.86,34.18,-5.64,34.62,-5.44,35.05]},{"value":[20.64,30.37,20.56,30.99,20.56,31.64,20.41,32.23,19.94,32.65,19.23,33,18.51,33.43,17.8,33.89,17.09,34.34,18.81,29.56,18.71,30.19,18.67,30.86,18.51,31.45,18.02,31.87,17.31,32.3,16.6,32.87,15.88,33.51,15.17,34.11,17,28.28,16.88,29.05,16.8,29.84,16.61,30.57,16.1,31.12,15.39,31.64,14.68,32.37,13.97,33.19,13.25,33.97,15.18,27.21,15.02,28.04,14.92,28.91,14.7,29.71,14.19,30.32,13.47,30.89,12.76,31.76,12.05,32.74,11.33,33.67,13.3,27.03,13.12,27.68,13.01,28.37,12.78,28.98,12.27,29.41,11.56,29.96,10.84,30.89,10.13,31.96,9.42,32.96,11.58,26.6,11.18,27.17,10.82,27.76,10.4,28.31,9.81,28.71,9.16,29.38,8.6,30.34,8.04,31.42,7.42,32.44,10.14,26.97,9.5,27.44,8.86,27.92,8.21,28.37,7.52,28.73,6.9,29.34,6.39,30.16,5.89,31.07,5.33,31.94,8.82,27.67,7.93,28.03,7.02,28.41,6.14,28.77,5.36,29.08,4.73,29.55,4.21,30.16,3.73,30.82,3.19,31.45,7.44,28.2,6.33,28.5,5.18,28.8,4.12,29.1,3.26,29.4,2.62,29.74,2.08,30.14,1.59,30.55,1.08,30.95]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_EAR.02_04","timeline":[{"name":"B_EAR.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-4.6,46.41,-2.19,47.64,0.36,48.93,2.63,50.09,4.24,50.91,5.38,51.61,6.52,52.45,7.65,53.36,8.79,54.23,-8.23,48.4,-5.87,49.64,-3.39,50.95,-1.16,52.13,0.43,52.96,1.57,53.8,2.7,54.93,3.84,56.19,4.97,57.38,-11.83,49.43,-9.51,50.94,-7.11,52.53,-4.95,53.97,-3.39,55.05,-2.25,56.06,-1.12,57.52,0.02,59.15,1.15,60.7,-15.47,50.88,-13.19,52.53,-10.85,54.26,-8.75,55.84,-7.2,57.05,-6.06,58.18,-4.93,59.9,-3.8,61.85,-2.66,63.69,-19.21,54.13,-16.99,55.41,-14.66,56.76,-12.56,57.97,-11.02,58.81,-9.88,59.91,-8.75,61.75,-7.61,63.87,-6.48,65.86,-22.63,56.85,-20.86,57.97,-19.02,59.15,-17.3,60.22,-15.92,61.01,-14.64,62.34,-13.22,64.24,-11.78,66.38,-10.44,68.41,-25.48,61.19,-24.2,62.1,-22.91,63.06,-21.65,63.95,-20.47,64.64,-19.15,65.85,-17.62,67.48,-16.06,69.29,-14.62,71.01,-28.11,66.18,-27.31,66.89,-26.58,67.64,-25.77,68.35,-24.77,68.95,-23.47,69.88,-21.95,71.08,-20.36,72.38,-18.87,73.63,-30.85,70.84,-30.5,71.43,-30.24,72.01,-29.81,72.6,-28.96,73.19,-27.68,73.85,-26.19,74.63,-24.61,75.44,-23.08,76.23]},{"duration":60,"tweenEasing":0,"value":[17.42,52.54,18.7,53.83,20.1,55.19,21.24,56.42,21.71,57.3,21.71,58.06,21.71,58.97,21.71,59.94,21.71,60.88,13.7,52.93,14.92,54.24,16.27,55.62,17.36,56.86,17.81,57.75,17.81,58.66,17.81,59.86,17.81,61.17,17.8,62.43,10.01,52.37,11.19,53.94,12.46,55.59,13.48,57.1,13.9,58.25,13.9,59.32,13.9,60.84,13.9,62.54,13.9,64.15,6.29,52.22,7.41,53.94,8.63,55.73,9.6,57.37,10,58.65,10,59.84,9.99,61.62,9.99,63.64,9.99,65.54,2.46,53.87,3.53,55.21,4.73,56.63,5.69,57.91,6.09,58.81,6.09,59.98,6.09,61.88,6.08,64.07,6.08,66.11,-1.05,55,-0.43,56.18,0.28,57.42,0.86,58.56,1.1,59.41,1.23,60.8,1.52,62.77,1.84,64.98,2.03,67.07,-4,57.74,-3.86,58.71,-3.71,59.74,-3.59,60.69,-3.54,61.45,-3.36,62.72,-2.97,64.42,-2.53,66.29,-2.24,68.07,-6.71,61.13,-7.06,61.91,-7.46,62.72,-7.79,63.49,-7.93,64.16,-7.77,65.16,-7.38,66.41,-6.93,67.78,-6.58,69.09,-9.54,64.19,-10.34,64.84,-11.21,65.5,-11.92,66.15,-12.21,66.8,-12.06,67.53,-11.71,68.36,-11.28,69.24,-10.88,70.1]},{"value":[40.35,56.64,40.91,57.91,41.61,59.24,42.04,60.44,41.8,61.3,41.08,62.03,40.37,62.92,39.66,63.86,38.95,64.78,36.67,56.03,37.18,57.31,37.81,58.66,38.19,59.88,37.92,60.75,37.21,61.63,36.5,62.8,35.79,64.1,35.07,65.33,33.01,54.47,33.47,56.02,34.04,57.64,34.35,59.12,34.05,60.25,33.34,61.3,32.63,62.79,31.92,64.46,31.2,66.05,29.32,53.32,29.73,55.01,30.24,56.78,30.5,58.4,30.18,59.65,29.47,60.81,28.76,62.57,28.04,64.56,27.33,66.44,25.52,53.97,25.89,55.29,26.37,56.68,26.63,57.93,26.31,58.81,25.6,59.95,24.89,61.83,24.17,63.99,23.46,66.01,22.05,54.1,21.96,55.25,21.96,56.48,21.83,57.59,21.36,58.42,20.77,59.77,20.36,61.72,19.96,63.91,19.44,65.97,19.14,55.84,18.57,56.79,18.01,57.79,17.42,58.72,16.76,59.45,16.21,60.69,15.9,62.37,15.63,64.22,15.21,65.97,16.46,58.23,15.41,58.99,14.29,59.77,13.25,60.52,12.4,61.17,11.85,62.13,11.52,63.37,11.26,64.71,10.9,65.99,13.66,60.3,12.16,60.92,10.58,61.55,9.16,62.18,8.15,62.8,7.59,63.51,7.23,64.32,6.95,65.17,6.63,66]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02","timeline":[{"name":"B_HAIR_FRONT.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_FRONT.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_FRONT.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_FRONT.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_FRONT.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_00","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-70,-27.99,-54.24,-43.61,-37.95,-57.8,-19,-60.63,-6.62,-62.03,2.85,-53.7,3.49,-42.18,-2.61,-33.32,-9.03,-24.18,-65.6,-33.17,-53.11,-51.85,-40.04,-67.04,-25.12,-75,-15.49,-80.97,-8.12,-73.63,-8.4,-57.83,-16.73,-46.53,-24.71,-35.43,-59.1,-40.99,-51.1,-62.43,-43.31,-78.26,-32.9,-90.84,-25.38,-100.6,-19.51,-93.34,-20.41,-72.9,-30.22,-59.17,-39.31,-46.14,-52.23,-46.18,-47.93,-69.73,-44.3,-87.34,-38.26,-103.62,-34.87,-115.52,-31.99,-108.08,-31.8,-84.31,-37.16,-66.88,-42.72,-50.41,-42.17,-44.51,-42.29,-68,-44.45,-88.37,-43.27,-106.83,-43.46,-121.14,-41.86,-117.66,-39.03,-94.83,-35.63,-71.7,-32.9,-48.8,-36.4,-39,-39.59,-62.48,-45.27,-85.84,-48.13,-106.53,-50.2,-123.66,-48.22,-124.66,-43.31,-103.56,-33.51,-75.96,-23.93,-47.62,-35.35,-26.63,-38.66,-51.61,-42.85,-77.03,-46.17,-98.68,-48.11,-118.86,-46.59,-125.45,-42.96,-107.08,-32.93,-79.63,-22.09,-48.48,-21.94,-11.24,-27.07,-37.88,-32.55,-64.45,-36.27,-85.95,-38.62,-109.22,-39.53,-121.89,-38.27,-106.33,-28.64,-80.83,-17.84,-47.58,-7.33,4.09,-14.43,-24.12,-21.4,-51.79,-25.59,-73.03,-28.5,-99.39,-31.97,-118.12,-33.13,-105.35,-24.02,-81.77,-13.33,-46.42]},{"duration":60,"tweenEasing":0,"value":[-74,-4.32,-62.98,-19.9,-50.98,-35.17,-33.94,-45.03,-22.54,-53.28,-10.57,-51.51,-4.93,-46.73,-0.66,-47.73,3.97,-48.51,-59.99,-12.87,-49.28,-32.84,-36.93,-51.54,-21.16,-65.55,-10.45,-73.54,0.14,-67.77,3.4,-60.46,1.74,-56.56,0.9,-52.23,-44.66,-24.08,-35.02,-47.4,-23.7,-68.32,-9.5,-85.86,0.46,-93.77,9.6,-84.15,10.68,-74.18,3.88,-65.33,-1.94,-55.66,-35.23,-33.33,-27.49,-57.75,-19.09,-79.29,-7.57,-98.99,1.49,-109.66,9.65,-100.95,10.3,-87.87,3.88,-72.49,-2.76,-56.12,-27.67,-39.23,-21.14,-61.49,-15.57,-82.24,-7.93,-101.36,-2.14,-117.12,3.86,-114.49,4.7,-97.29,0.59,-74.94,-3.91,-51.65,-22.71,-41.57,-16.59,-62.64,-12.4,-83.74,-8.28,-102.41,-6.18,-121.46,-2.79,-122.46,-1.76,-101.62,-3.58,-74.84,-5.9,-47.17,-21.39,-31.76,-15.76,-53.47,-10.8,-75.66,-7.61,-94.97,-6.15,-116.39,-3.56,-122.32,-3.72,-102.95,-5.39,-76.03,-6.87,-45.44,-10.25,-14.18,-8.04,-38.31,-5.93,-62.65,-4.08,-84.02,-4.69,-107.9,-5.02,-120.23,-6.8,-103.58,-7.54,-75.89,-7.73,-40.29,2,3.79,0.55,-22.88,-0.63,-49.57,-0.26,-73.03,-3.17,-99.39,-6.64,-118.12,-10.06,-104.07,-9.79,-75.49,-8.67,-34.73]},{"value":[-112.33,19.68,-92.29,-17.89,-70.25,-45.88,-47.02,-59.85,-35.29,-73.11,-23.83,-71.3,-17.27,-65.44,-16.34,-69.92,-15.7,-74.85,-83.2,5.22,-65.36,-29.06,-46.17,-55.27,-23.16,-69.82,-9.32,-82.7,2.34,-78.12,4.87,-70.28,0.85,-69.14,-3.7,-68.13,-57.81,-7.87,-41.02,-39.43,-22.77,-64.9,0.56,-80.34,16.24,-92.86,27.84,-85.56,26.28,-75.42,17.13,-68.47,7.31,-61.15,-35.26,-19.49,-20.77,-49.42,-5.78,-75.14,15.24,-92.79,30.83,-106.39,41.37,-99.14,36.9,-85.18,23.54,-70.44,10.09,-54.84,-20.17,-27.56,-8.98,-54.39,-0.4,-78.24,14.91,-96.96,26.79,-114.53,34.53,-112.86,31.84,-95.32,23.41,-73.52,14.43,-50.98,-20.05,-32.08,-7.23,-55.56,2.78,-78.23,15.01,-97.13,22.62,-117.81,26.91,-120.48,25.94,-100.34,22.38,-74.11,17.91,-47.12,-22.37,-25.01,-9.02,-49.95,3.97,-75.14,14.63,-95.15,21.17,-115.75,25.22,-120.95,23.76,-101.91,20.5,-75.49,17.46,-45.44,-8.51,-16.53,0.05,-43.23,8.68,-69.77,15.89,-90.62,19.43,-110.98,21.46,-119.83,19.16,-103.04,17.6,-75.61,16.6,-40.29,6.67,-8.21,10.11,-36.46,13.78,-64.3,17.37,-85.79,17.67,-106.06,17.4,-118.69,14.27,-104.07,14.54,-75.49,15.67,-34.73]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_01","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-54.33,-21.83,-36.32,-29.4,-18.17,-36.4,-1.85,-37.25,6.65,-25.39,11.96,-8.81,7.83,-4.38,-1.49,-2.31,-11.02,0.07,-53.79,-21.53,-41.16,-31.52,-28.63,-38.9,-16.74,-41.3,-10.52,-34.68,-6.51,-21.46,-8.54,-16.82,-14.45,-14.1,-20.84,-11.17,-52.15,-22.59,-45.59,-35.17,-39.86,-43.26,-32.61,-47.03,-27.64,-44.96,-23.94,-34.34,-23.86,-29.06,-26.61,-25.56,-30.03,-21.87,-48.96,-23.11,-46.15,-37.28,-43.46,-46.61,-39.22,-51.85,-34.77,-53.61,-30.41,-45.63,-29.22,-38.58,-31.03,-32.48,-32.41,-26.18,-38.83,-21.56,-41.3,-35.15,-44.34,-45.93,-43.2,-53.26,-41.4,-58.03,-38.09,-53.46,-35.29,-44.53,-30.96,-34.83,-26.28,-24.98,-30.01,-19.08,-37.33,-32.24,-45.42,-44.82,-47.2,-53.96,-48.26,-60.74,-46.2,-58.43,-41.79,-48,-31.3,-36.25,-20.58,-24.2,-26.89,-10.93,-35.25,-25.34,-43.19,-39.66,-45.19,-49.87,-46.35,-58.24,-44.8,-58.82,-41.09,-49.4,-30.23,-38.41,-18.66,-25.76,-14.78,2.8,-24.53,-14.5,-33.57,-31.48,-35.7,-43.24,-36.96,-53.98,-37.01,-58.91,-34.86,-51.33,-24.87,-41.22,-13.98,-27.43,-1.67,16.86,-12.89,-3.4,-23.17,-23.15,-25.46,-36.52,-26.92,-49.7,-28.65,-59.06,-28.1,-53.32,-19.13,-44.03,-9,-29.05]},{"duration":60,"tweenEasing":0,"value":[-37,-2.16,-31.49,-9.95,-25.49,-17.59,-16.97,-22.52,-11.27,-26.64,-5.28,-25.76,-2.46,-23.37,-0.33,-23.86,1.98,-24.26,-30,-6.43,-24.64,-16.44,-18.48,-25.75,-10.59,-32.77,-5.23,-36.75,0.07,-33.88,1.7,-30.23,0.87,-28.29,0.45,-26.11,-22.33,-12.04,-17.51,-23.71,-11.85,-34.14,-4.76,-42.92,0.23,-46.84,4.8,-42.06,5.34,-37.1,1.94,-32.67,-0.97,-27.83,-17.61,-16.67,-13.74,-28.87,-9.53,-39.64,-3.78,-49.52,0.75,-54.87,4.82,-50.49,5.15,-43.93,1.94,-36.24,-1.38,-28.06,-13.83,-19.62,-10.57,-30.73,-7.77,-41.13,-3.96,-50.73,-1.07,-58.69,1.92,-57.32,2.35,-48.62,0.29,-37.46,-1.95,-25.82,-11.36,-20.79,-8.3,-31.31,-6.2,-41.88,-4.14,-51.22,-3.1,-60.8,-1.4,-61.27,-0.88,-50.8,-1.79,-37.41,-2.95,-23.59,-10.7,-15.88,-7.88,-26.74,-5.4,-37.82,-3.8,-47.48,-3.07,-58.2,-1.78,-61.17,-1.86,-51.48,-2.7,-38.02,-3.43,-22.72,-5.12,-7.09,-4.02,-19.15,-2.96,-31.33,-2.04,-42.01,-2.34,-53.96,-2.51,-60.12,-3.4,-51.79,-3.77,-37.95,-3.87,-20.15,1,1.89,0.27,-11.44,-0.31,-24.78,-0.13,-36.51,-1.58,-49.69,-3.32,-59.06,-5.03,-52.04,-4.9,-37.75,-4.33,-17.36]},{"value":[-78.66,35.18,-61.21,18.23,-43.74,2.06,-29.9,-6.92,-23.44,-25.97,-16.69,-40.02,-16.4,-39.36,-17.19,-44.73,-17.68,-50.59,-54.15,20.91,-36.71,5.01,-18.47,-9.98,-4.41,-20.14,2.6,-36.29,8.04,-45.11,5.97,-42.18,0.78,-42.04,-4.14,-42.01,-29.05,4.73,-12.22,-9.61,5.72,-22.75,19.72,-33.68,27.17,-46.77,31.22,-50.2,26.86,-44.86,17.5,-39.26,8.28,-33.32,-12.77,-10.61,1.66,-23.48,16.56,-34.95,29.03,-46.02,36.29,-56.58,38.89,-55.96,33.44,-47.98,22.46,-37.68,11.47,-26.78,-3.17,-16.12,7.73,-28.33,18.12,-39.69,27.34,-50.3,33.13,-60.56,34.23,-60.01,30.38,-50.22,23.56,-37.91,16.38,-25.16,5.7,-19.28,13.17,-31.05,19.19,-42.67,25.24,-52.74,29.59,-62.16,29.17,-61.02,26.91,-49.91,24.22,-36.91,20.87,-23.53,6.24,-14.69,13.41,-26.71,19.85,-38.85,24.6,-48.95,27.99,-59.14,27.71,-60.53,25.62,-50.45,23.2,-37.49,20.9,-22.72,8.96,-6.47,15.31,-19.31,21.16,-32.14,24.38,-42.76,25.41,-54.42,24.47,-59.78,22.56,-51.26,21.37,-37.67,20.47,-20.15,12,1.89,17.45,-11.79,22.56,-25.35,24.2,-36.51,22.75,-49.69,21.02,-59.06,19.3,-52.04,19.44,-37.75,20,-17.36]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_02","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-17.33,-19.67,-4.83,-19.45,7.32,-18.81,15.12,-14.74,17.92,1.25,17.25,16.95,10.3,18.99,-1.16,21.55,-13,24.33,-23.79,-15.09,-16.5,-15.08,-10.14,-13.18,-6.15,-8.53,-5.3,2,-6.6,12.36,-10.24,13.34,-15.32,14.22,-21.29,14.95,-29.82,-10.55,-28.07,-11.44,-28,-9.19,-27.84,-4.14,-27.87,1.8,-28.75,7.66,-29.2,8,-28.55,7.11,-29.06,5.96,-31.34,-6.44,-32.41,-8.4,-33.94,-6.95,-35.44,-2.34,-35.51,1.27,-35.23,4.87,-34.37,5.34,-32.97,3.76,-31.03,1.88,-25,-1.95,-30.71,-4.41,-36.58,-4.8,-39.25,-2.54,-40.35,0.66,-40.02,3.86,-37.63,4.09,-31.22,2.61,-24.33,0.84,-18.66,1.7,-29.03,-0.93,-39.22,-2.94,-43.07,-2.74,-45.18,0.05,-44.8,2.85,-40.9,2.8,-29.48,1.16,-17.63,-0.62,-16.2,4.95,-27.35,1.42,-37.79,-1.86,-41.38,-2.38,-43.27,0,-43.01,2.37,-39.24,2.1,-27.55,-0.39,-15.22,-3.04,-9.65,9.89,-20.5,4.67,-30.61,-0.17,-33.66,-1.23,-34.62,0,-34.5,1.22,-31.46,0.47,-21.11,-3.26,-10.11,-7.29,-2.67,14.97,-13.16,8.04,-22.85,1.63,-25.33,0,-25.33,0,-25.33,0,-23.07,-1.28,-14.23,-6.28,-4.67,-11.69]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-31,38.67,-23.99,28.9,-17.08,19.79,-12.93,15.6,-12.17,0.67,-11.4,-14.26,-14.95,-16.43,-21.88,-23.02,-29,-30.33,-21.54,26.32,-10.67,20.09,0.66,14.42,7.76,12.22,8.08,0.55,8.08,-10.59,2.56,-11.42,-6.85,-15.08,-16.39,-19.28,-12.72,14.1,1.69,11.26,16.9,8.81,26.83,8.57,26.93,0.3,26.42,-6.92,18.96,-6.38,7.1,-7.17,-4.83,-8.3,-8.52,6.38,5.93,4.68,21.22,3.33,31.73,3.57,33.06,-1.04,32.97,-4.25,24.73,-2.73,11.57,-1.94,-1.19,-1.28,7.17,3.33,15.44,1.8,23.86,0.7,30.69,0.48,32.82,-1.48,31.71,-2.03,26.12,-0.91,18.62,-0.66,11,-0.67,22.86,0.29,24.84,-0.53,26.11,-1.14,29.24,-1.51,32.37,-1.27,30.43,0.36,27.49,1.02,25.67,0.55,23.19,-0.06,24.33,0,25.38,-0.53,26.43,-1.03,28.4,-1.46,31.06,-0.92,29.49,0.65,27.48,1.03,25.9,0.53,24.33,0,24.33,0,24.87,-0.28,25.42,-0.53,26.42,-0.75,27.76,-0.46,26.98,0.34,25.97,0.53,25.14,0.28,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33,0,24.33]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_03","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-4.7,-20.21,5.04,-4.77,14.38,11.42,17.67,28.03,14.27,34.09,7.69,33.83,-7.05,23.44,-25.44,13.38,-44.03,3.48,-12.18,-9.27,-7.83,8.25,-5.21,27.87,-5.44,46.62,-8.8,49,-13.79,44.44,-23.22,31.84,-33.71,18.91,-44.8,5.68,-19.93,1.41,-21.05,20.19,-25.23,42.19,-28.95,62.96,-31.42,62.95,-34.05,55.3,-38.4,41,-41.5,24.87,-45.51,8.43,-26.23,8.93,-28.89,27.1,-32.79,49.74,-37.16,70.72,-39.95,71.82,-41.65,65.5,-43.36,51.41,-44.3,33.65,-44.61,15.88,-21.84,18.44,-28.77,33.48,-35.85,54.44,-40,69.34,-42.49,69.33,-43.12,65.05,-42.73,52.54,-38.25,37.67,-33.45,22.96,-17.88,27.52,-29.04,39.3,-39.32,58.37,-43.24,66.9,-45.36,65.07,-44.88,62.19,-42.55,50.89,-33.27,38.47,-23.69,26.56,-16.65,32.22,-28.13,41.67,-38.53,57.18,-41.93,63.3,-44.54,58.88,-44.9,55.2,-42.13,44.68,-31.89,32.1,-21.18,19.92,-12.96,39.74,-22.58,46.12,-31.38,55.93,-33.82,60.78,-34.98,53.39,-34.82,47.84,-31.97,37.57,-22.24,23.08,-12,8.61,-9.06,47.61,-16.66,50.89,-23.58,54.96,-24.96,58.51,-24.43,48.12,-23.49,40.68,-20.66,30.02,-11.83,12.69,-2.37,-4.98]},{"duration":60,"tweenEasing":0,"value":[12.64,-0.54,9.87,14.67,7.05,30.23,2.55,42.76,-3.65,32.84,-9.56,16.88,-17.35,4.45,-24.29,-8.17,-31.03,-20.85,11.61,5.82,8.66,23.33,4.93,41.07,0.71,55.14,-3.48,47.05,-7.17,32.14,-13.02,18.57,-18.37,4.64,-23.51,-9.27,9.89,11.96,7.01,31.63,2.76,51.43,-1.11,67.1,-3.54,61.22,-5.29,47.7,-9.23,33.07,-12.95,17.7,-16.45,2.47,5.12,15.37,3.51,35.53,1.14,56.71,-1.71,73.06,-4.43,70.55,-6.41,60.63,-9,46.07,-11.34,29.9,-13.58,14,3.16,20.39,1.95,37.89,0.73,59.28,-0.74,71.89,-2.13,68.67,-3.1,61.19,-5.09,48.45,-7.03,35.06,-9.12,22.12,0.78,25.82,-0.02,40.22,-0.1,61.32,-0.17,69.64,-0.17,65.02,-0.07,59.34,-1.64,48.09,-3.77,37.32,-6.06,27.18,-0.45,27.27,-0.77,40.25,-0.74,59.06,-0.55,65.67,-1.27,58.89,-1.89,52.84,-2.87,42.57,-4.29,32.5,-5.95,22.97,-3.31,29.85,-2.08,41.45,-0.77,56.12,-0.16,62.01,-0.37,53.39,-0.31,46.62,-0.49,37.07,-1.08,26.34,-1.89,15.9,-6.39,32.64,-3.51,42.85,-0.72,53.33,0.37,58.52,0.9,48.12,1.85,40.69,2.42,31.3,2.41,18.97,2.3,6.71]},{"value":[-18.36,38.13,-15.97,42.95,-13.59,48.83,-14.12,54.83,-20.44,36.55,-25.77,13.49,-35.75,-1.62,-47.48,-18.12,-59.03,-35.18,-7.02,32.94,-1.84,42.59,3.22,53.18,4.64,63.05,-0.91,48.97,-6.05,29.47,-16.71,15,-28.96,-1.12,-41.43,-18.53,3.64,27.94,11.48,42.31,19,57.46,22.32,71.1,17.68,61.18,12.88,45.19,1.08,31.59,-13.12,16.02,-27.41,-1.46,7.5,26.16,16.29,42.51,25.02,60.41,29.46,74.94,26.14,68.18,21.82,55.97,10.04,43.31,-5.11,28.34,-19.95,11.42,15.57,26.47,20.65,41.2,25.95,60.16,29.36,71.38,28.25,66.5,24.72,59.31,16.3,47.56,5.34,33.11,-5.49,17.62,24.07,26.36,25.03,39.81,26.22,60.1,28.43,67.74,29.74,63.24,27.29,59.64,22.4,48.51,16.19,34.63,9.66,20.76,23.88,27.27,24.61,39.72,25.69,58.03,27.31,64.01,27.55,57.99,24.78,54.15,21.95,44.04,18.24,31.64,14.16,19.53,21.03,29.85,22.79,41.18,24.65,55.58,25.96,61.3,26.01,54.64,24.76,50.53,23.58,41.11,21.64,28.79,19.39,16.6,17.94,32.64,20.83,42.85,23.61,53.33,24.66,58.82,24.73,51.62,25.22,47.38,25.64,38.08,25.2,24.9,24.63,11.71]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_FRONT.02_04","timeline":[{"name":"B_HAIR_FRONT.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[7.94,-20.75,14.91,9.9,21.43,41.64,20.22,70.79,10.62,66.93,-1.88,50.71,-24.39,27.89,-49.73,5.21,-75.06,-17.36,-0.57,-3.45,0.84,31.58,-0.27,68.91,-4.68,101.56,-12.3,95.72,-21.04,76.5,-36.18,50.34,-52.11,23.59,-68.31,-3.59,-10.04,13.37,-14.03,51.82,-22.45,93.57,-30.01,129.72,-34.94,123.66,-39.38,102.9,-47.58,73.97,-54.46,42.65,-61.96,10.91,-21.11,24.31,-25.38,62.62,-31.64,106.44,-38.88,143.83,-44.39,142.44,-48.06,126.14,-52.35,97.49,-55.63,63.56,-58.2,29.88,-18.69,38.82,-26.82,71.36,-35.12,113.71,-40.75,141.28,-44.64,138.07,-46.22,126.26,-47.82,100.96,-45.28,72.75,-42.57,45.09,-17.1,53.34,-29.06,79.52,-39.41,119.68,-43.41,136.54,-45.54,130.1,-44.95,121.53,-44.21,98.93,-37.06,75.76,-29.75,53.74,-17.11,59.48,-28.9,81.91,-39.28,116.24,-42.48,128.97,-45.8,117.77,-46.79,108.04,-45.03,87.17,-36.24,64.55,-27.13,42.89,-16.27,69.59,-24.66,87.58,-32.15,112.05,-33.98,122.8,-35.35,106.79,-35.13,94.46,-32.48,74.61,-23.39,49.39,-13.89,24.51,-15.45,80.25,-20.17,93.74,-24.3,108.29,-24.58,117.03,-23.53,96.25,-21.64,81.37,-18.24,61.32,-9.42,31.66,-0.07,1.73]},{"duration":60,"tweenEasing":0,"value":[25.28,-1.08,19.74,29.34,14.11,60.45,5.11,85.53,-7.29,65.68,-19.13,33.76,-34.69,8.9,-48.57,-16.34,-62.06,-41.69,23.22,11.65,17.33,46.67,9.87,82.14,1.49,109.98,-6.93,93.75,-14.4,64.29,-26.07,37.13,-36.74,9.28,-47.02,-18.54,19.78,23.92,14.02,63.27,5.54,102.84,-2.15,133.81,-7.04,121.93,-10.61,95.35,-18.49,66.11,-25.89,35.4,-32.91,4.95,10.23,30.75,7.03,71.05,2.28,113.43,-3.44,146.17,-8.87,141.17,-12.82,121.26,-17.98,92.15,-22.67,59.81,-27.17,28,6.31,40.77,3.91,75.76,1.46,118.58,-1.48,143.83,-4.27,137.42,-6.19,122.39,-10.19,96.87,-14.06,70.13,-18.24,44.24,1.55,51.64,-0.04,80.44,-0.2,122.63,-0.34,139.29,-0.34,130.05,-0.14,118.67,-3.29,96.13,-7.53,74.62,-12.12,54.36,-0.91,54.54,-1.54,80.49,-1.48,118.13,-1.1,131.34,-2.55,117.78,-3.79,105.69,-5.75,85.04,-8.57,64.97,-11.9,45.93,-6.61,59.69,-4.16,82.9,-1.54,112.24,-0.32,124.02,-0.73,106.8,-0.62,93.25,-0.97,74.08,-2.15,52.65,-3.78,31.8,-12.79,65.28,-7.01,85.7,-1.45,106.65,0.75,117.03,1.8,96.25,3.7,81.37,4.83,62.6,4.81,37.94,4.6,13.42]},{"value":[-5.72,37.59,-7.95,57.01,-10.1,77.87,-15.3,94.07,-28.71,72.43,-40.14,41.25,-56.55,13.2,-73.08,-13.22,-89.06,-40.02,7.51,39.56,7.01,65.1,5.77,91.92,1.49,113.87,-9.92,97.48,-20.18,69.61,-35.89,41.35,-51.09,12.85,-66.47,-17.78,20,41.77,21.29,73.38,21.07,106.07,17.78,133.69,8.42,122.24,-0.63,97.4,-16.74,69.51,-33.35,39.21,-50,5.38,23.53,45.93,26.64,80.34,28.84,117.5,27.19,146.37,19.22,137.52,10.68,116.22,-4.64,89.32,-21.8,58.62,-38.71,24.12,23.98,49.6,25.84,80.57,28.05,119.69,28,142.34,23.65,134.59,17.74,120.68,6.48,96.04,-7.95,66.88,-21.99,35.91,25.28,52.43,25.22,80.13,26.33,121.36,27.61,136.98,27.11,127.76,24.14,118.92,17.31,96.03,6.71,68.7,-3.86,41.57,23.42,54.54,23.84,79.96,24.95,117.09,26.23,129.48,24.06,116.93,20.08,107.66,16.41,86.94,10.63,62.73,3.98,39.06,17.72,59.69,20.71,82.63,23.88,111.7,25.52,123.36,24.27,109.76,22.54,100.73,21.2,81.62,18.18,57.31,14.45,33.21,11.55,65.28,17.32,85.7,22.88,106.65,25,117.64,25.13,103.25,26.12,94.77,26.95,76.17,26.07,49.8,24.93,23.42]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02","timeline":[{"name":"B_HAIR_SIDE.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_SIDE.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_SIDE.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_SIDE.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_00","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-67.76,-49.87,-57.41,-56.77,-49.99,-64.04,-40.89,-65.8,-34.23,-64.45,-30.95,-63.09,-30.6,-64.06,-30.15,-54.9,-29.67,-44.55,-51.46,-47.73,-45.1,-53.68,-41.03,-59.43,-35.83,-61.56,-32.28,-63.24,-30.79,-64.92,-30.59,-65.95,-30.15,-55.88,-29.67,-44.56,-36.36,-45.22,-33.74,-50.28,-32.66,-54.91,-31.2,-57.27,-30.51,-61.87,-30.65,-66.47,-30.57,-67.57,-30.14,-56.72,-29.67,-44.56,-32.31,-39.15,-31.1,-44.48,-30.06,-49.48,-30.32,-53.01,-30.47,-58.92,-30.62,-64.83,-30.53,-66,-30.11,-55.9,-29.67,-44.57,-32.01,-29.49,-30.92,-32.8,-29.96,-36.09,-30.01,-40.03,-30.09,-45.97,-30.17,-51.91,-30.12,-54.72,-29.9,-50.06,-29.67,-44.58,-31.7,-22.25,-30.73,-22.59,-29.85,-23.25,-29.7,-27.05,-29.71,-33.02,-29.72,-38.99,-29.72,-43.49,-29.7,-44.26,-29.67,-44.58,-31.38,-20.53,-30.51,-23.51,-29.47,-26.68,-29.2,-31.16,-29.43,-34.51,-29.65,-37.86,-29.67,-41.86,-29.67,-43.38,-29.67,-44.59,-30.25,-16.25,-30.08,-23.84,-29.77,-31.26,-29.67,-36.58,-29.67,-36.82,-29.67,-37.06,-29.67,-40.94,-29.67,-42.9,-29.67,-44.6,-29.02,-11.62,-29.63,-23.81,-30.19,-35.47,-30.3,-41.64,-30,-38.89,-29.69,-36.14,-29.66,-39.95,-29.67,-42.4,-29.67,-44.6]},{"duration":60,"tweenEasing":0,"value":[-38.02,-28.89,-27.68,-36.26,-20.26,-43.96,-11.12,-46.12,-4.01,-47.97,-0.28,-49.82,-0.01,-52.51,-0.01,-48.91,0,-44.57,-22.89,-32.95,-16.72,-39.4,-12.73,-45.81,-7.29,-49.38,-2.93,-53.3,-0.64,-57.22,-0.42,-59.22,-0.21,-52.38,0,-44.58,-8.91,-36.71,-6.62,-42.2,-5.74,-47.61,-3.79,-52.36,-1.97,-58.23,-0.98,-64.09,-0.8,-65.48,-0.4,-55.63,0,-44.59,-5.19,-35.34,-4.28,-40.63,-3.41,-46,-3.1,-51.81,-2.08,-58.3,-1.06,-64.79,-0.86,-66.02,-0.44,-55.92,0,-44.59,-3.67,-27.51,-2.75,-30.75,-1.89,-34.2,-1.62,-39.41,-1.09,-45.66,-0.56,-51.9,-0.45,-54.74,-0.24,-50.08,0,-44.6,-2.15,-22.1,-1.22,-22.34,-0.37,-22.94,-0.15,-27.01,-0.1,-33.02,-0.06,-39.02,-0.05,-43.52,-0.04,-44.28,0,-44.61,-1.72,-20.55,-0.85,-23.54,0.2,-26.7,0.47,-31.18,0.24,-34.53,0.01,-37.88,-0.01,-41.88,0,-43.4,0,-44.61,-0.58,-16.27,-0.41,-23.86,-0.1,-31.28,-0.01,-36.6,-0.01,-36.84,0,-37.08,0,-40.96,0,-42.92,0,-44.62,0.65,-11.64,0.04,-23.83,-0.52,-35.5,-0.64,-41.66,-0.33,-38.91,-0.03,-36.16,0,-39.97,0,-42.42,0,-44.63]},{"value":[-71.02,-20.56,-53.42,-23.73,-39.38,-27.65,-25.93,-30.05,-15.68,-37.8,-4.31,-43.87,3.8,-45.45,10.38,-45.12,17,-44.57,-43.41,-25.57,-29.37,-30.13,-17.27,-35.09,-6.62,-38.76,0.98,-46.83,9.26,-54.28,14.65,-55.98,18.41,-51.14,22.55,-45.81,-16.83,-30.75,-6.53,-36.63,3.32,-42.61,11.16,-47.36,16.33,-55.5,21.76,-64.04,24.61,-65.8,25.87,-56.85,27.68,-46.96,-3.51,-32.79,3.04,-39.52,9.93,-46.17,15.2,-51.49,20.02,-58.07,24.85,-65.62,26.49,-67.45,27.47,-57.88,28.48,-47.14,5.33,-26.18,9.23,-30.23,13.13,-34.28,16.1,-39.25,18.58,-45.49,21.05,-52.3,21.95,-55.48,22.45,-51.1,23,-45.93,14.16,-21.98,15.43,-22.36,16.33,-23.01,17,-26.96,17.13,-32.92,17.26,-39.02,17.41,-43.57,17.44,-44.36,17.51,-44.72,15.28,-20.55,16.15,-23.54,17.2,-26.7,17.47,-31.18,17.24,-34.53,17.01,-37.88,16.99,-41.88,17,-43.4,17,-44.61,16.42,-16.27,16.59,-23.86,16.9,-31.28,16.99,-36.6,16.99,-36.84,17,-37.08,17,-40.96,17,-42.92,17,-44.62,17.65,-11.64,17.04,-23.83,16.48,-35.5,16.36,-41.66,16.67,-38.91,16.97,-36.16,17,-39.97,17,-42.42,17,-44.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_01","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-29.73,-29.49,-29.73,-34.68,-29.73,-39.7,-29.77,-42.74,-30.22,-41.5,-30.67,-40.26,-30.59,-40.89,-30.15,-36.5,-29.67,-31.51,-28.56,-23.29,-28.4,-27.21,-28.27,-30.84,-28.57,-33.01,-29.58,-36.81,-30.6,-40.62,-30.58,-41.71,-30.14,-36.92,-29.67,-31.51,-27.45,-17.02,-27.14,-19.86,-26.9,-22.3,-27.45,-23.67,-28.99,-32.23,-30.53,-40.79,-30.56,-42.33,-30.14,-37.24,-29.67,-31.51,-27.06,-12.44,-26.8,-15.42,-26.62,-17.99,-27.27,-19.36,-28.87,-29.55,-30.47,-39.75,-30.52,-41.41,-30.1,-36.76,-29.67,-31.51,-27.67,-11.82,-27.8,-15.1,-27.98,-18.11,-28.41,-20.28,-29.25,-28.33,-30.09,-36.39,-30.11,-38.22,-29.9,-35.11,-29.67,-31.51,-28.28,-11.21,-28.81,-14.77,-29.34,-18.24,-29.56,-21.21,-29.63,-27.11,-29.7,-33.02,-29.71,-35.05,-29.7,-33.47,-29.67,-31.51,-28.62,-11.3,-28.96,-14.97,-29.4,-18.56,-29.53,-21.92,-29.59,-26.67,-29.66,-31.42,-29.67,-33.51,-29.67,-32.64,-29.67,-31.51,-29.77,-11.87,-29.34,-16.05,-29.02,-20.12,-28.98,-23.3,-29.31,-25.39,-29.64,-27.47,-29.67,-29.76,-29.67,-30.7,-29.67,-31.51,-31,-12.49,-29.77,-17.22,-28.62,-21.81,-28.39,-24.78,-29,-24,-29.61,-23.22,-29.67,-25.76,-29.67,-28.63,-29.67,-31.51]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-8.51,0,-14.17,0,-19.61,0,-23.06,0,-25.02,0,-26.99,0,-29.34,0,-30.51,0,-31.53,0,-8.51,0,-12.93,0,-17.22,-0.02,-20.83,-0.23,-26.87,-0.44,-32.91,-0.41,-34.96,-0.2,-33.41,0,-31.53,0,-8.51,0,-11.77,0,-14.97,-0.04,-18.76,-0.45,-28.58,-0.85,-38.41,-0.79,-40.21,-0.39,-36.13,0,-31.53,0.06,-8.63,0.01,-11.54,0,-14.45,-0.04,-18.17,-0.48,-28.94,-0.92,-39.7,-0.85,-41.43,-0.43,-36.78,0,-31.53,0.67,-9.84,0.36,-13.03,0.07,-16.19,-0.02,-19.66,-0.25,-28.02,-0.48,-36.38,-0.45,-38.25,-0.23,-35.14,0,-31.53,1.28,-11.06,0.7,-14.52,0.14,-17.94,0,-21.16,-0.02,-27.11,-0.04,-33.05,-0.04,-35.07,-0.03,-33.49,0,-31.53,1.04,-11.32,0.71,-14.99,0.27,-18.58,0.14,-21.94,0.07,-26.69,0.01,-31.45,0,-33.53,0,-32.67,0,-31.53,-0.1,-11.89,0.33,-16.08,0.64,-20.14,0.69,-23.33,0.36,-25.41,0.03,-27.5,0,-29.78,0,-30.73,0,-31.53,-1.33,-12.51,-0.1,-17.24,1.04,-21.83,1.28,-24.8,0.67,-24.02,0.06,-23.24,0,-25.78,0,-28.66,0,-31.53]},{"value":[15,6.49,15.93,0.37,16.78,-5.5,17,-9.14,17,-12.02,17,-14.9,17,-18.65,17,-24.95,17,-31.53,16.19,0.86,16.72,-3.52,17.16,-7.74,17.23,-11.52,16.9,-18.84,16.57,-26.15,16.59,-29.06,16.8,-30.33,17,-31.53,17.2,-4.76,17.35,-7.61,17.41,-10.39,17.37,-14.32,16.77,-25.48,16.17,-36.63,16.21,-38.83,16.6,-35.39,17,-31.53,17.06,-8.63,17.01,-11.54,17,-14.45,16.96,-18.17,16.52,-28.94,16.08,-39.7,16.15,-41.43,16.57,-36.78,17,-31.53,17.67,-9.84,17.36,-13.03,17.07,-16.19,16.98,-19.66,16.75,-28.02,16.52,-36.38,16.55,-38.25,16.77,-35.14,17,-31.53,18.28,-11.06,17.7,-14.52,17.14,-17.94,17,-21.16,16.98,-27.11,16.96,-33.05,16.96,-35.07,16.97,-33.49,17,-31.53,18.04,-11.32,17.71,-14.99,17.27,-18.58,17.14,-21.94,17.07,-26.69,17.01,-31.45,17,-33.53,17,-32.67,17,-31.53,16.9,-11.89,17.33,-16.08,17.64,-20.14,17.69,-23.33,17.36,-25.41,17.03,-27.5,17,-29.78,17,-30.73,17,-31.53,15.67,-12.51,16.9,-17.24,18.04,-21.83,18.28,-24.8,17.67,-24.02,17.06,-23.24,17,-25.78,17,-28.66,17,-31.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_02","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-29.73,-20.98,-29.73,-20.51,-29.73,-20.09,-29.77,-19.68,-30.22,-16.48,-30.67,-13.28,-30.59,-11.55,-30.15,-5.99,-29.67,0.02,-28.56,-14.78,-28.4,-14.27,-28.27,-13.61,-28.55,-12.18,-29.35,-9.94,-30.15,-7.7,-30.17,-6.74,-29.94,-3.5,-29.67,0.02,-27.45,-8.51,-27.14,-8.08,-26.9,-7.3,-27.41,-4.92,-28.54,-3.64,-29.68,-2.37,-29.78,-2.13,-29.74,-1.11,-29.67,0.02,-27.12,-3.81,-26.81,-3.88,-26.63,-3.54,-27.23,-1.19,-28.39,-0.62,-29.56,-0.04,-29.67,0.02,-29.67,0.02,-29.67,0.02,-28.34,-1.98,-28.16,-2.07,-28.05,-1.92,-28.39,-0.62,-29,-0.31,-29.61,-0.01,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.55,-0.15,-29.51,-0.25,-29.48,-0.3,-29.56,-0.04,-29.61,-0.01,-29.66,0.03,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[15,15,15.93,14.54,16.78,14.11,17,13.91,17,13,17,12.09,17,10.69,17,5.55,17,0,16.19,9.37,16.71,9.41,17.16,9.48,17.25,9.33,17.13,8.04,17.01,6.74,17,5.9,17,3.09,17,0,17.2,3.75,17.35,4.16,17.41,4.58,17.4,4.5,17.21,3.11,17.02,1.72,17,1.42,17,0.76,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,17]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_03","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-13.86,0.08,-7.53,11.72,-1.33,23.13,2.78,33.77,4.09,50,4.56,64.54,3.72,72.52,0.37,82.31,-3.26,92.37,-13.74,5.51,-10.15,17.56,-6.96,29.46,-4.69,39.72,-3.58,54.2,-2.99,67.64,-3.51,75.17,-5.73,83.82,-8.2,92.64,-13.62,10.8,-12.6,23.21,-12.13,35.46,-11.61,45.37,-10.72,58.23,-10.04,70.66,-10.27,77.78,-11.41,85.29,-12.76,92.89,-13.52,13.89,-13.39,25.95,-13.33,37.82,-13.54,47.4,-12.97,59.28,-12.41,71.17,-12.53,78.29,-13.21,85.48,-13.9,92.73,-13.8,17.02,-13.84,26.79,-14,36.45,-14.18,44.76,-13.88,55.03,-13.59,65.31,-13.57,72.74,-13.59,81.38,-13.72,90.18,-14.5,21.41,-14.58,28.42,-14.73,35.39,-14.81,42.22,-14.79,51.21,-14.78,60.2,-14.67,67.72,-14.27,77.34,-13.95,87.2,-14.85,22.67,-14.86,29.06,-14.86,35.44,-14.87,42.05,-14.88,50.87,-14.89,59.69,-14.83,67.1,-14.58,76.99,-14.33,87.18,-14.85,22.69,-14.86,29.07,-14.86,35.46,-14.87,42.07,-14.88,50.89,-14.89,59.71,-14.86,67.38,-14.74,78.13,-14.62,89.26,-14.85,22.71,-14.86,29.09,-14.86,35.47,-14.87,42.08,-14.88,50.9,-14.88,59.72,-14.89,67.69,-14.91,79.38,-14.93,91.5]},{"duration":60,"tweenEasing":0,"value":[1,10.57,7.8,26.61,14.42,42.08,18.62,53.18,19.7,63.24,19.93,71.61,19.02,78.3,15.44,85.3,11.57,92.36,0.54,12.9,4.39,27.55,7.88,41.75,10.35,51.71,11.5,62.26,12.13,71.76,11.58,78.55,9.24,85.57,6.63,92.63,0.11,15.05,1.17,28.34,1.78,41.21,2.61,50.09,3.82,61.23,4.82,71.94,4.62,78.85,3.46,85.85,2.07,92.88,0.04,15.79,0.01,27.9,-0.02,39.6,0.07,47.99,1.26,59.7,2.45,71.4,2.38,78.49,1.67,85.58,0.93,92.72,0.37,18.01,0.24,27.83,0.03,37.41,0.06,45.22,1.05,56.32,2.05,67.41,2.03,74.63,1.59,82.35,1.12,90.16,0.27,21.49,0.17,28.54,0.01,35.54,0.02,42.45,0.63,52.93,1.24,63.42,1.26,70.67,1.09,78.86,0.88,87.18,-0.02,22.66,-0.02,29.05,-0.03,35.43,0,42.19,0.4,52.2,0.8,62.21,0.79,69.41,0.65,78.18,0.51,87.17,-0.02,22.68,-0.02,29.06,-0.03,35.44,-0.02,42.14,0.19,51.57,0.39,61.01,0.38,68.57,0.3,78.74,0.22,89.24,-0.02,22.7,-0.02,29.08,-0.03,35.46,-0.04,42.07,-0.04,50.89,-0.05,59.71,-0.06,67.68,-0.08,79.37,-0.09,91.49]},{"value":[8.5,18.07,15.3,29.25,21.92,40.23,26.17,50.56,27.7,64.74,28.39,77.22,27.52,83.64,23.94,88.08,20.07,92.36,8.63,17.59,12.4,29.4,15.75,41,18.21,50.48,19.66,63.18,20.6,74.85,20.08,81.49,17.75,87.11,15.13,92.63,8.71,16.93,9.64,29.33,10.03,41.4,10.8,50.09,12.16,61.6,13.31,72.69,13.12,79.55,11.96,86.23,10.57,92.88,8.54,15.79,8.51,27.9,8.48,39.6,8.57,48,9.72,59.59,10.87,71.19,10.8,78.28,10.12,85.47,9.43,92.72,8.87,18.01,8.74,27.83,8.53,37.41,8.52,45.07,9.12,55.19,9.71,65.31,9.77,72.73,9.74,81.37,9.62,90.16,8.77,21.49,8.67,28.54,8.51,35.54,8.47,42.24,8.51,51.21,8.55,60.18,8.67,67.71,9.07,77.33,9.38,87.18,8.48,22.66,8.48,29.05,8.47,35.43,8.46,42.04,8.45,50.86,8.45,59.68,8.51,67.09,8.76,76.98,9.01,87.17,8.48,22.68,8.48,29.06,8.47,35.44,8.46,42.06,8.45,50.88,8.45,59.7,8.47,67.37,8.6,78.12,8.72,89.24,8.48,22.7,8.48,29.08,8.47,35.46,8.46,42.07,8.46,50.89,8.45,59.71,8.44,67.68,8.42,79.37,8.41,91.49]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.02_04","timeline":[{"name":"B_HAIR_SIDE.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-27.72,0.16,-14.13,32.7,-0.88,64.08,7.47,86.68,9.18,110,9.2,129.94,7.44,145.05,0.73,164.62,-6.52,184.74,-27.49,11.02,-19.62,40.81,-12.52,69.94,-7.85,91.24,-6.35,114.57,-5.9,135.8,-7.02,150.34,-11.46,167.64,-16.4,185.28,-27.24,21.59,-24.79,48.61,-23.34,75.18,-22.2,95.28,-20.91,118.81,-20.03,141.51,-20.54,155.56,-22.83,170.59,-25.52,185.78,-27.05,27.78,-26.78,51.92,-26.66,75.66,-27.08,94.79,-25.86,118.78,-24.65,142.76,-24.91,157,-26.33,171.18,-27.8,185.47,-27.6,34.04,-27.68,53.59,-27.99,72.91,-28.28,89.83,-26.89,112.32,-25.51,134.81,-25.61,149.28,-26.49,164.72,-27.43,180.35,-29.01,42.82,-29.16,56.83,-29.45,70.79,-29.52,84.86,-28.34,105.86,-27.17,126.86,-27.15,141.36,-27.49,157.73,-27.91,174.39,-29.7,45.35,-29.71,58.11,-29.73,70.88,-29.67,84.39,-28.87,104.42,-28.07,124.44,-28.08,138.86,-28.37,156.38,-28.66,174.36,-29.7,45.38,-29.71,58.15,-29.73,70.91,-29.7,84.29,-29.29,103.16,-28.89,122.04,-28.9,137.17,-29.07,157.51,-29.23,178.51,-29.7,45.41,-29.71,58.18,-29.73,70.94,-29.74,84.17,-29.76,101.81,-29.77,119.45,-29.79,135.39,-29.82,158.76,-29.86,183]},{"duration":60,"tweenEasing":0,"value":[2.01,21.14,15.6,53.22,28.85,84.17,37.24,106.36,39.4,126.47,39.87,143.22,38.04,156.6,30.88,170.61,23.14,184.72,1.07,25.8,8.77,55.07,15.76,83.52,20.7,103.41,23,124.5,24.25,143.5,23.16,157.08,18.49,171.15,13.27,185.26,0.21,30.11,2.34,56.67,3.57,82.43,5.21,100.2,7.64,122.45,9.64,143.87,9.24,157.69,6.92,171.7,4.14,185.76,0.07,31.59,0.02,55.81,-0.05,79.22,0.15,95.99,2.53,119.39,4.9,142.8,4.75,156.98,3.34,171.16,1.86,185.44,0.73,36.01,0.47,55.66,0.06,74.84,0.11,90.45,2.11,112.63,4.1,134.82,4.06,149.26,3.18,164.7,2.23,180.33,0.54,42.97,0.35,57.09,0.03,71.09,0.04,84.9,1.27,105.87,2.49,126.83,2.51,141.34,2.18,157.71,1.76,174.37,-0.03,45.33,-0.05,58.09,-0.06,70.86,0,84.37,0.8,104.39,1.6,124.42,1.59,138.84,1.3,156.36,1.01,174.33,-0.03,45.36,-0.05,58.12,-0.06,70.89,-0.04,84.27,0.37,103.14,0.78,122.01,0.77,137.15,0.6,157.49,0.43,178.49,-0.03,45.39,-0.05,58.16,-0.06,70.92,-0.08,84.14,-0.09,101.79,-0.1,119.43,-0.12,135.36,-0.15,158.74,-0.19,182.98]},{"value":[17.01,36.14,32.76,64.67,48.01,92.34,57.14,113.77,61.73,134.81,64.64,152.47,62.16,164.91,51.59,174.93,40.14,184.72,17.26,35.17,27.2,62.8,36.86,89.76,42.52,109.22,44.56,130,45.57,148.73,44.02,161.62,37.59,173.57,30.27,185.26,17.41,33.86,21.49,60.44,25.52,86.3,27.77,103.96,27.95,125.03,27.73,145.29,27.08,158.75,24.5,172.31,21.14,185.76,17.07,31.59,17.02,55.81,16.95,79.22,17.15,95.99,19.53,119.39,21.9,142.8,21.75,156.98,20.34,171.16,18.86,185.44,17.73,36.01,17.47,55.66,17.06,74.84,17.11,90.45,19.11,112.63,21.1,134.82,21.06,149.26,20.18,164.7,19.23,180.33,17.54,42.97,17.35,57.09,17.03,71.09,17.04,84.9,18.27,105.87,19.49,126.83,19.51,141.34,19.18,157.71,18.76,174.37,16.97,45.33,16.95,58.09,16.94,70.86,17,84.37,17.8,104.39,18.6,124.42,18.59,138.84,18.3,156.36,18.01,174.33,16.97,45.36,16.95,58.12,16.94,70.89,16.96,84.27,17.37,103.14,17.78,122.01,17.77,137.15,17.6,157.49,17.43,178.49,16.97,45.39,16.95,58.16,16.94,70.92,16.92,84.14,16.91,101.79,16.9,119.43,16.88,135.36,16.85,158.74,16.81,182.98]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04","timeline":[{"name":"B_HAIR_SIDE.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_SIDE.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_SIDE.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_SIDE.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_SIDE.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_00","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-17.62,-132.27,-14.8,-117.22,-12.19,-102.69,-11.59,-90.39,-12.23,-73.75,-12.86,-59.65,-12.56,-49.54,-11.13,-35.9,-9.59,-21.81,-17.08,-128.88,-15.22,-118.27,-14.19,-108.23,-14.01,-97.45,-14.22,-77.84,-14.43,-59.83,-14.29,-49.52,-13.69,-36.96,-13.06,-24.06,-16.88,-125.24,-15.87,-118.95,-16.2,-113.3,-16.38,-104.07,-16.2,-81.7,-16.02,-59.97,-16.06,-49.52,-16.29,-38.04,-16.57,-26.31,-18.99,-121.66,-18.06,-117.53,-18.28,-114.02,-18.59,-105.72,-20.15,-82.45,-21.72,-59.17,-21.45,-48.87,-20.17,-38.43,-19.76,-27.81,-19.76,-122.41,-19.69,-116.23,-20.57,-110.41,-21.1,-101.29,-23.37,-78.79,-25.63,-56.29,-25.13,-46.36,-22.79,-37.14,-21.59,-27.81,-22.23,-120.63,-22.47,-112.39,-23.14,-104.25,-23.37,-94.69,-23.63,-74.29,-23.89,-53.89,-23.83,-44.5,-23.55,-36.16,-23.43,-27.81,-25.24,-117.79,-25.24,-109.23,-25.24,-100.7,-25.29,-91.45,-25.78,-75.25,-26.28,-59.06,-26.19,-49.38,-25.75,-39.12,-25.48,-28.68,-27.08,-113.87,-27.09,-105.02,-27.09,-96.23,-27.16,-87.63,-27.89,-78.49,-28.63,-69.36,-28.61,-59.56,-28.34,-46.05,-28.17,-32.1,-28.93,-109.63,-28.93,-100.47,-28.93,-91.39,-29.02,-83.55,-29.93,-81.72,-30.84,-79.89,-30.93,-70.07,-30.93,-53.29,-30.93,-35.81]},{"duration":60,"tweenEasing":0,"value":[12.05,-132.3,14.87,-117.24,17.47,-102.71,18.11,-90.64,17.77,-76.44,17.44,-64.78,17.19,-54.97,16.34,-41.61,15.41,-27.83,12.59,-128.91,14.45,-118.29,15.48,-108.25,15.64,-97.61,15.16,-79.75,14.69,-63.5,14.54,-53.37,14.1,-40.78,13.58,-27.83,12.78,-125.26,13.8,-118.97,13.47,-113.32,13.21,-104.16,12.61,-82.9,12.02,-62.28,11.95,-51.87,11.88,-40.01,11.74,-27.83,10.68,-121.68,11.61,-117.55,11.38,-114.04,11.17,-105.89,10.57,-83.71,9.96,-61.53,9.91,-51.02,9.91,-39.55,9.91,-27.83,9.9,-122.43,9.98,-116.25,9.09,-110.43,8.75,-101.44,8.43,-79.69,8.1,-57.94,8.07,-47.85,8.07,-37.91,8.07,-27.83,7.44,-120.65,7.19,-112.41,6.53,-104.27,6.32,-94.71,6.28,-74.4,6.24,-54.08,6.24,-44.68,6.24,-36.27,6.24,-27.83,4.43,-117.81,4.43,-109.25,4.42,-100.72,4.38,-91.47,3.88,-75.28,3.39,-59.08,3.47,-49.4,3.92,-39.14,4.19,-28.7,2.58,-113.89,2.58,-105.04,2.58,-96.25,2.51,-87.65,1.77,-78.51,1.04,-69.38,1.05,-59.58,1.33,-46.07,1.5,-32.12,0.74,-109.65,0.74,-100.5,0.74,-91.41,0.65,-83.57,-0.26,-81.74,-1.18,-79.91,-1.26,-70.1,-1.26,-53.31,-1.26,-35.83]},{"value":[27.05,-132.3,29.87,-117.24,32.47,-102.71,33.11,-91.15,32.77,-82.44,32.44,-76.26,32.19,-65.66,31.34,-47.16,30.41,-27.83,27.59,-128.91,29.45,-118.29,30.48,-108.25,30.62,-97.92,29.97,-83.5,29.31,-70.69,29.17,-60.04,28.86,-44.25,28.58,-27.83,27.78,-125.26,28.8,-118.97,28.47,-113.32,28.17,-104.29,27.15,-84.4,26.12,-65.16,26.09,-54.54,26.37,-41.39,26.74,-27.83,25.68,-121.68,26.61,-117.55,26.38,-114.04,26.09,-105.89,24.61,-83.71,23.13,-61.53,23.21,-51.02,24.04,-39.55,24.91,-27.83,24.9,-122.43,24.98,-116.25,24.09,-110.43,23.7,-101.44,22.93,-79.69,22.15,-57.94,22.18,-47.85,22.61,-37.91,23.07,-27.83,22.44,-120.65,22.19,-112.41,21.53,-104.27,21.31,-94.71,21.24,-74.4,21.16,-54.08,21.16,-44.68,21.18,-36.27,21.24,-27.83,19.43,-117.81,19.43,-109.25,19.42,-100.72,19.38,-91.47,18.88,-75.28,18.39,-59.08,18.47,-49.4,18.92,-39.14,19.19,-28.7,17.58,-113.89,17.58,-105.04,17.58,-96.25,17.51,-87.65,16.77,-78.51,16.04,-69.38,16.05,-59.58,16.33,-46.07,16.5,-32.12,15.74,-109.65,15.74,-100.5,15.74,-91.41,15.65,-83.57,14.74,-81.74,13.82,-79.91,13.74,-70.1,13.74,-53.31,13.74,-35.83]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_01","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-23.64,-66.13,-22.23,-58.6,-20.93,-51.33,-20.66,-45.04,-21.28,-35.2,-21.9,-26.62,-21.96,-22.12,-21.96,-18.01,-21.96,-13.89,-23.37,-64.43,-22.44,-59.12,-21.93,-54.1,-21.87,-48.58,-22.35,-37.32,-22.83,-26.86,-22.88,-22.12,-22.88,-18.01,-22.88,-13.89,-23.27,-62.61,-22.76,-59.46,-22.93,-56.64,-23.07,-51.89,-23.41,-39.32,-23.76,-27.07,-23.8,-22.12,-23.8,-18.01,-23.8,-13.89,-24.33,-60.82,-23.86,-58.75,-23.97,-57,-24.08,-52.74,-24.38,-39.92,-24.68,-27.1,-24.71,-22.12,-24.71,-18.01,-24.71,-13.89,-24.71,-61.19,-24.68,-58.1,-25.12,-55.19,-25.29,-50.6,-25.45,-38.82,-25.61,-27.04,-25.63,-22.12,-25.63,-18.01,-25.63,-13.89,-25.95,-60.3,-26.07,-56.18,-26.4,-52.11,-26.51,-47.35,-26.53,-37.09,-26.55,-26.83,-26.55,-22.12,-26.55,-18.01,-26.55,-13.89,-27.45,-58.88,-27.45,-54.6,-27.45,-50.34,-27.48,-45.71,-27.73,-37.62,-27.97,-29.52,-27.93,-24.68,-27.71,-19.55,-27.57,-14.33,-28.38,-56.92,-28.38,-52.5,-28.38,-48.1,-28.41,-43.8,-28.78,-39.23,-29.15,-34.67,-29.14,-29.77,-29,-23.01,-28.92,-16.04,-29.3,-54.8,-29.3,-50.23,-29.3,-45.68,-29.34,-41.76,-29.8,-40.85,-30.26,-39.93,-30.3,-35.03,-30.3,-26.63,-30.3,-17.89]},{"duration":60,"tweenEasing":0,"value":[6.02,-66.15,7.43,-58.62,8.74,-51.36,9.05,-45.32,8.89,-38.22,8.72,-32.39,8.6,-27.49,8.17,-20.81,7.71,-13.91,6.3,-64.45,7.22,-59.14,7.74,-54.12,7.82,-48.8,7.58,-39.88,7.35,-31.76,7.27,-26.68,7.05,-20.39,6.79,-13.91,6.39,-62.63,6.9,-59.48,6.74,-56.66,6.61,-52.07,6.31,-41.45,6.01,-31.15,5.97,-25.94,5.94,-20,5.87,-13.91,5.34,-60.84,5.8,-58.78,5.69,-57.02,5.59,-52.94,5.28,-41.86,4.98,-30.77,4.95,-25.51,4.95,-19.77,4.95,-13.91,4.95,-61.22,4.99,-58.12,4.55,-55.21,4.37,-50.71,4.21,-39.84,4.05,-28.98,4.04,-23.92,4.04,-18.95,4.04,-13.91,3.72,-60.33,3.6,-56.2,3.27,-52.14,3.16,-47.35,3.14,-37.2,3.12,-27.04,3.12,-22.34,3.12,-18.14,3.12,-13.91,2.21,-58.91,2.21,-54.63,2.21,-50.36,2.19,-45.73,1.94,-37.64,1.69,-29.55,1.74,-24.7,1.96,-19.57,2.09,-14.35,1.29,-56.95,1.29,-52.52,1.29,-48.12,1.26,-43.82,0.89,-39.26,0.52,-34.69,0.53,-29.79,0.66,-23.04,0.75,-16.06,0.37,-54.83,0.37,-50.25,0.37,-45.71,0.33,-41.78,-0.13,-40.87,-0.59,-39.95,-0.63,-35.05,-0.63,-26.66,-0.63,-17.91]},{"value":[21.02,-66.15,22.43,-58.62,23.74,-51.36,24.01,-45.06,23.39,-35.22,22.76,-26.65,22.71,-22.14,22.71,-18.03,22.71,-13.91,21.3,-64.45,22.22,-59.14,22.74,-54.12,22.79,-48.6,22.31,-37.34,21.83,-26.88,21.79,-22.14,21.79,-18.03,21.79,-13.91,21.39,-62.63,21.9,-59.48,21.74,-56.66,21.6,-51.92,21.25,-39.34,20.9,-27.09,20.87,-22.14,20.87,-18.03,20.87,-13.91,20.34,-60.84,20.8,-58.78,20.69,-57.02,20.59,-52.76,20.28,-39.94,19.98,-27.13,19.95,-22.14,19.95,-18.03,19.95,-13.91,19.95,-61.22,19.99,-58.12,19.55,-55.21,19.37,-50.63,19.21,-38.84,19.05,-27.06,19.04,-22.14,19.04,-18.03,19.04,-13.91,18.72,-60.33,18.6,-56.2,18.27,-52.14,18.16,-47.37,18.14,-37.11,18.12,-26.86,18.12,-22.14,18.12,-18.03,18.12,-13.91,17.21,-58.91,17.21,-54.63,17.21,-50.36,17.19,-45.73,16.94,-37.64,16.69,-29.55,16.74,-24.7,16.96,-19.57,17.09,-14.35,16.29,-56.95,16.29,-52.52,16.29,-48.12,16.26,-43.82,15.89,-39.26,15.52,-34.69,15.53,-29.79,15.66,-23.04,15.75,-16.06,15.37,-54.83,15.37,-50.25,15.37,-45.71,15.33,-41.78,14.87,-40.87,14.41,-39.95,14.37,-35.05,14.37,-26.66,14.37,-17.91]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_02","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.55,0.54,-28.33,6.02,-27.11,11.51,-26.56,12.9,-24.85,16.32,-23,20.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.61,0.22,-28.95,3.24,-28.3,6.27,-27.96,7.35,-26.9,10.27,-25.73,13.41,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.65,-0.06,-29.52,0.68,-29.39,1.41,-29.27,2.13,-28.84,4.42,-28.38,6.83,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.33,-29.67,1.41,-29.67,2.57,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.17,-29.67,0.74,-29.67,1.36,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0,-29.67,0.06,-29.67,0.14,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02,-29.67,0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15,0,15]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_03","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-16.38,40.17,-16.37,36.62,-16.37,33.18,-16.29,30.92,-15.45,30.97,-14.61,31.01,-14.42,29.59,-13.99,29.43,-13.53,29.44,-15.68,42.1,-15.58,39.96,-15.47,37.83,-15.4,35.78,-14.95,34.56,-14.5,33.34,-14.45,31.4,-14.43,29.96,-14.32,28.59,-15.04,43.88,-14.84,43.16,-14.64,42.33,-14.58,40.5,-14.49,38.01,-14.39,35.51,-14.47,33.1,-14.79,30.44,-15,27.77,-14.87,44.33,-14.68,44.1,-14.47,43.73,-14.42,42.04,-14.42,38.86,-14.42,35.68,-14.54,33.08,-14.94,29.86,-15.27,26.57,-14.87,44.33,-14.91,42.04,-14.95,39.74,-14.96,37.45,-14.99,34.47,-15.03,31.5,-15.13,29.08,-15.46,26.35,-15.69,23.6,-14.87,44.32,-15.14,40.27,-15.42,36.35,-15.49,33.54,-15.56,30.48,-15.64,27.42,-15.63,25.29,-15.59,23.38,-15.55,21.48,-14.8,43.84,-15.02,39.7,-15.15,35.67,-15.21,32.62,-15.54,28.82,-15.86,25.02,-15.83,22.83,-15.61,20.98,-15.46,19.13,-14.52,41.99,-14.77,38.93,-14.96,35.93,-15.02,33.19,-15.22,28.82,-15.41,24.44,-15.39,22.07,-15.26,19.74,-15.17,17.39,-14.21,39.98,-14.52,38.14,-14.8,36.27,-14.87,33.95,-14.87,29.07,-14.87,24.19,-14.87,21.61,-14.86,18.76,-14.86,15.84]},{"duration":60,"tweenEasing":0,"value":[-1.54,40.16,-1.54,36.61,-1.54,33.17,-1.52,30.65,-1.29,27.95,-1.06,25.26,-1.14,23.14,-1.57,21.27,-2.03,19.43,-0.85,42.09,-0.74,39.95,-0.64,37.82,-0.6,35.68,-0.47,32.94,-0.35,30.2,-0.47,27.72,-0.98,24.82,-1.45,21.88,-0.21,43.87,-0.01,43.15,0.19,42.32,0.25,40.54,0.27,37.67,0.3,34.8,0.16,32.02,-0.37,28.23,-0.81,24.35,-0.04,44.32,0.16,44.09,0.36,43.72,0.41,42.03,0.41,38.85,0.41,35.66,0.3,32.91,-0.11,29.15,-0.44,25.28,-0.04,44.32,-0.08,42.03,-0.11,39.73,-0.12,37.44,-0.16,34.46,-0.2,31.49,-0.29,29,-0.63,25.98,-0.86,22.92,-0.04,44.31,-0.31,40.26,-0.58,36.33,-0.66,33.53,-0.73,30.47,-0.8,27.41,-0.8,25.29,-0.76,23.35,-0.72,21.41,0.03,43.83,-0.18,39.69,-0.32,35.66,-0.38,32.61,-0.7,28.81,-1.03,25.01,-0.99,22.82,-0.78,20.97,-0.62,19.12,0.32,41.98,0.07,38.92,-0.13,35.92,-0.19,33.18,-0.38,28.81,-0.58,24.43,-0.56,22.06,-0.43,19.73,-0.34,17.38,0.63,39.97,0.32,38.13,0.03,36.26,-0.04,33.94,-0.04,29.06,-0.03,24.18,-0.03,21.6,-0.03,18.75,-0.03,15.83]},{"value":[11.46,32.16,10.53,30.16,9.68,28.14,8.96,25.48,7.38,19.29,5.81,13.1,2.56,10.61,-0.94,8.07,-4.36,5.43,13.08,37.79,12.66,36.51,12.32,35.15,11.93,32.79,11.06,27.19,10.18,21.58,8.26,19.02,6.35,16.48,4.41,13.84,14.58,42.99,14.63,42.48,14.77,41.83,14.69,39.77,14.43,34.66,14.16,29.54,13.51,26.98,13.11,24.5,12.58,21.98,14.96,44.32,15.16,44.09,15.36,43.72,15.39,41.84,15.09,36.93,14.8,32.03,14.73,29.56,14.6,27.41,14.56,25.28,14.96,44.32,14.92,42.03,14.89,39.73,14.86,37.35,14.67,33.46,14.48,29.57,14.41,27.22,14.22,25.06,14.14,22.92,14.96,44.31,14.69,40.26,14.42,36.33,14.34,33.55,14.25,30.38,14.17,27.22,14.17,25.09,14.22,23.24,14.28,21.41,15.03,43.83,14.82,39.69,14.68,35.66,14.62,32.61,14.3,28.81,13.97,25.01,14.01,22.82,14.22,20.97,14.38,19.12,15.32,41.98,15.07,38.92,14.87,35.92,14.81,33.18,14.62,28.81,14.42,24.43,14.44,22.06,14.57,19.73,14.66,17.38,15.63,39.97,15.32,38.13,15.03,36.26,14.96,33.94,14.96,29.06,14.97,24.18,14.97,21.6,14.97,18.75,14.97,15.83]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_SIDE.04_04","timeline":[{"name":"B_HAIR_SIDE.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-32.75,80.35,-32.75,73.25,-32.74,66.36,-32.58,61.84,-30.9,61.93,-29.23,62.02,-28.85,59.18,-27.99,58.87,-27.06,58.88,-31.36,84.2,-31.16,79.93,-30.95,75.65,-30.8,71.57,-29.9,69.13,-29,66.69,-28.91,62.81,-28.86,59.92,-28.64,57.17,-30.08,87.76,-29.68,86.32,-29.28,84.66,-29.16,81.01,-28.97,76.02,-28.79,71.03,-28.95,66.19,-29.57,60.89,-30,55.54,-29.75,88.66,-29.36,88.21,-28.95,87.47,-28.84,84.09,-28.84,77.72,-28.85,71.35,-29.07,66.16,-29.89,59.71,-30.55,53.13,-29.75,88.65,-29.82,84.08,-29.89,79.48,-29.91,74.9,-29.99,68.95,-30.06,62.99,-30.26,58.17,-30.92,52.71,-31.39,47.2,-29.75,88.64,-30.28,80.56,-30.83,72.71,-30.99,67.08,-31.13,60.96,-31.27,54.84,-31.26,50.59,-31.19,46.76,-31.11,42.95,-29.6,87.69,-30.03,79.41,-30.31,71.36,-30.43,65.24,-31.07,57.64,-31.72,50.05,-31.66,45.66,-31.22,41.96,-30.91,38.26,-29.03,83.98,-29.53,77.87,-29.92,71.86,-30.04,66.38,-30.43,57.63,-30.82,48.89,-30.78,44.13,-30.52,39.48,-30.34,34.77,-28.42,79.96,-29.03,76.27,-29.6,72.55,-29.74,67.91,-29.74,58.14,-29.74,48.37,-29.73,43.23,-29.73,37.52,-29.73,31.69]},{"duration":60,"tweenEasing":0,"value":[-3.08,80.33,-3.08,73.23,-3.08,66.34,-3.03,61.3,-2.57,55.91,-2.11,50.51,-2.28,46.28,-3.14,42.55,-4.06,38.85,-1.69,84.18,-1.49,79.9,-1.28,75.63,-1.2,71.36,-0.95,65.88,-0.7,60.4,-0.95,55.44,-1.97,49.64,-2.91,43.77,-0.41,87.74,-0.02,86.3,0.38,84.64,0.5,81.08,0.55,75.34,0.6,69.59,0.32,64.02,-0.74,56.44,-1.62,48.71,-0.08,88.64,0.31,88.18,0.72,87.45,0.83,84.06,0.82,77.69,0.82,71.32,0.59,65.81,-0.22,58.29,-0.88,50.56,-0.08,88.63,-0.16,84.05,-0.22,79.46,-0.25,74.88,-0.32,68.92,-0.39,62.97,-0.59,57.99,-1.26,51.96,-1.72,45.84,-0.08,88.62,-0.62,80.54,-1.16,72.69,-1.32,67.06,-1.46,60.94,-1.6,54.82,-1.6,50.59,-1.52,46.69,-1.44,42.81,0.06,87.67,-0.36,79.39,-0.64,71.34,-0.76,65.21,-1.41,57.62,-2.05,50.03,-1.99,45.64,-1.56,41.93,-1.24,38.24,0.63,83.95,0.14,77.85,-0.25,71.84,-0.38,66.36,-0.76,57.61,-1.15,48.87,-1.11,44.11,-0.86,39.46,-0.68,34.75,1.25,79.94,0.64,76.25,0.07,72.52,-0.07,67.88,-0.07,58.12,-0.07,48.35,-0.07,43.2,-0.06,37.49,-0.06,31.66]},{"value":[7.92,64.33,6.07,60.31,4.36,56.28,2.91,50.96,-0.24,38.57,-3.39,26.19,-9.89,21.22,-16.89,16.13,-23.73,10.85,11.16,75.59,10.32,73.01,9.64,70.31,8.86,65.58,7.11,54.37,5.37,43.16,1.55,37.99,-2.3,32.97,-6.18,27.67,14.15,85.99,14.26,84.95,14.53,83.65,14.38,79.56,13.85,69.32,13.32,59.07,12.03,53.92,11.22,49.02,10.15,43.96,14.92,88.64,15.31,88.18,15.72,87.45,15.77,83.68,15.19,73.87,14.6,64.05,14.46,59.11,14.21,54.82,14.12,50.56,14.92,88.63,14.84,84.05,14.78,79.46,14.73,74.72,14.35,66.92,13.97,59.13,13.82,54.44,13.44,50.12,13.28,45.84,14.92,88.62,14.38,80.54,13.84,72.69,13.68,67.1,13.51,60.76,13.34,54.43,13.35,50.19,13.44,46.48,13.56,42.81,15.06,87.67,14.64,79.39,14.36,71.34,14.24,65.21,13.59,57.62,12.95,50.03,13.01,45.64,13.44,41.93,13.76,38.24,15.63,83.95,15.14,77.85,14.75,71.84,14.62,66.36,14.24,57.61,13.85,48.87,13.89,44.11,14.14,39.46,14.32,34.75,16.25,79.94,15.64,76.25,15.07,72.52,14.93,67.88,14.93,58.12,14.93,48.35,14.93,43.2,14.94,37.49,14.94,31.66]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00","timeline":[{"name":"D_HAIR_SIDE.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_SIDE.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_SIDE.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_SIDE.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_SIDE.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_00","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":490}]},{"name":"D_HAIR_SIDE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-31.64,-0.58,-73.13,0.72,-41.53,2.62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-12.8,1.19,0,0,0,0,0,0,-40.41,0.45,0,0,-56.65,-1.3,0,0,-23.71,0.24,0.32,1.39,-10.65,0.67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-18.49,0.68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-22.13,1.4,-20.65,1.31,-32.08,0.32,-18.43,0.21]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_01","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]},{"name":"D_HAIR_SIDE.00","type":22,"frame":[{"duration":121,"offset":2,"value":[-21.96,0.09,-40.01,0.14,-8.03,0.69,0,0,0,0,0,0,0,0,0,0,2.38,-0.69,0,0,-9.67,-0.68,0,0,0,0,-5.85,0.01,-4.85,0,-14.62,1.38,0,0,0,0,0,0,-26.69,0.76,0,0,-32.67,0.83,-2.45,0.69,-29.85,0.79,-12.07,-1.32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-4.28,0.37,-6.93,0.35,-20.83,0.07,-15.35,0.35,0,0,-2.79,0.01,-2.76,0.01,-1.27,-0.38]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_02","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_03","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_SIDE.00_04","timeline":[{"name":"D_HAIR_SIDE.00","type":23,"frame":[{"duration":121,"value":540}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04","timeline":[{"name":"B_HAIR_TWIN.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_00","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[14.67,-77.09,16.52,-69.47,18.23,-62.14,18.58,-55.54,17.65,-32.43,16.72,-9.32,17.07,-6.23,18.8,-12.58,20.67,-19.78,-2.91,-77.09,-2.27,-70.18,-1.8,-63.5,-1.48,-57.73,0.8,-40.7,3.07,-23.67,3.64,-19.07,5.08,-17.9,6.78,-17,-19.16,-77.09,-19.66,-70.84,-20.32,-64.78,-20.02,-59.77,-14.86,-48.77,-9.7,-37.76,-8.91,-31.77,-7.64,-23.26,-6.05,-14.43,-23.05,-77.43,-23.81,-72.08,-24.53,-66.71,-24.23,-61.64,-19.07,-54.05,-13.91,-46.45,-12.96,-40.58,-11.19,-27.35,-9.43,-13.24,-20.31,-81.09,-19.83,-80.69,-19.05,-79.75,-18.62,-75.06,-16.58,-65.31,-14.53,-55.55,-13.89,-48.17,-12.23,-28.29,-10.83,-6.95,-17.56,-84.75,-16.39,-93.01,-14.98,-100.21,-14.62,-97.71,-14.92,-83.27,-15.23,-68.84,-15.07,-57.84,-14.42,-28.99,-13.93,1.91,-21.33,-93.44,-19.5,-104.86,-16.62,-115.05,-16,-113.25,-18.37,-94.62,-20.33,-71.62,-19.71,-52.13,-18.57,-22.8,-17.46,7.69,-22.65,-104.37,-22.46,-116.72,-21.54,-127.77,-21.5,-125.94,-24.01,-102.22,-25.49,-67.5,-23.7,-37.72,-21.15,-13.9,-18.54,9.39,-23.33,-115.09,-25.19,-128.56,-26.9,-140.71,-27.58,-138.94,-29.8,-109.87,-30.34,-63.09,-27.34,-23.18,-23.41,-5.17,-19.33,10.67]},{"duration":60,"tweenEasing":0,"value":[-1.33,-63.07,-1.33,-59.16,-1.33,-55.24,-1.33,-49.87,-1.35,-30.41,-1.37,-10.96,-1.36,-9.3,-1.35,-19.93,-1.33,-31.76,-1.32,-68.62,-2.53,-63.76,-3.77,-58.96,-3.96,-53.69,-2.46,-38.68,-0.97,-23.67,-0.69,-19.64,-0.13,-20.82,0.52,-22.5,-1.31,-73.76,-3.67,-68.01,-6.04,-62.38,-6.39,-57.27,-3.58,-46.75,-0.76,-36.22,-0.21,-30.11,0.92,-22.14,2.23,-13.94,-1.48,-75.41,-3.97,-70.06,-6.36,-64.69,-6.74,-59.62,-4.2,-52.03,-1.66,-44.43,-0.96,-38.56,0.81,-25.33,2.57,-11.22,-3.31,-79.07,-3.77,-78.68,-3.83,-77.72,-3.75,-73.03,-3.08,-63.28,-2.41,-53.54,-1.89,-46.15,-0.23,-26.27,1.17,-4.93,-5.13,-82.73,-4.09,-90.98,-2.72,-98.19,-2.37,-95.69,-2.79,-81.25,-3.22,-66.82,-3.07,-55.81,-2.42,-26.97,-1.93,3.93,-9.33,-91.42,-7.5,-102.84,-4.62,-113.03,-4,-111.23,-6.37,-92.6,-8.33,-69.6,-7.71,-50.11,-6.57,-20.78,-5.46,9.71,-10.65,-102.35,-10.46,-114.7,-9.54,-125.75,-9.5,-123.92,-12.01,-100.2,-13.49,-65.48,-11.7,-35.7,-9.15,-11.88,-6.54,11.41,-11.33,-113.07,-13.18,-126.54,-14.9,-138.69,-15.58,-136.92,-17.8,-107.85,-18.34,-61.07,-15.34,-21.16,-11.41,-3.15,-7.33,12.69]},{"value":[-28.88,-65.04,-25.18,-64.83,-21.76,-64.34,-18.9,-61.21,-15.65,-56.39,-14.93,-51.56,-13.63,-50.81,-12.22,-55.99,-10.88,-61.73,-7.58,-67.82,-2.23,-65.2,3.41,-62.5,7.11,-58.65,10.38,-54.83,10.19,-50.37,10.1,-48.33,9.56,-50.56,9.08,-53.12,12.11,-70.39,18.72,-65.44,25.94,-60.61,30.29,-56.08,33.39,-53.17,32.08,-48.99,30.65,-45.4,28.33,-44.38,26.15,-43.45,16.45,-71.56,21.17,-66.72,24.92,-61.82,27.97,-56.87,29.88,-53.09,27.4,-47.85,25.33,-42.66,22.24,-36.71,18.97,-30.45,9.15,-77.05,16.93,-77.82,25.92,-78.12,29.52,-73.68,29.78,-66.36,27.56,-58.22,26,-51.59,22.8,-37.24,18.87,-21.9,1.84,-82.53,9.66,-92.35,19.08,-101.17,22.01,-98.99,22.49,-85.95,22.34,-72.7,21.07,-62.56,16.56,-37.53,11.17,-10.79,-1.57,-91.39,3.84,-104.66,10.07,-116.6,11.82,-115.11,12.45,-96.75,13.5,-74,12.59,-55.74,6.78,-29.64,0.74,-2.52,2.25,-102.32,5.63,-116.52,9.52,-129.31,10.73,-127.88,12.48,-104.68,15.28,-70.44,15.67,-41.03,11.24,-17.28,6.51,6.03,7.12,-113.04,8.04,-128.36,8.9,-142.22,9.39,-140.98,12.65,-112.82,17.6,-66.95,19.36,-26.26,16.45,-4.83,13.12,14.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_01","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[15.33,-43.56,17.19,-37.9,18.9,-32.52,19.25,-28.61,18.32,-15.23,17.4,-1.84,17.76,0.42,19.47,-0.62,21.33,-1.9,-2.25,-40.78,-1.01,-36.3,0.09,-32.02,0.5,-28.89,2.03,-19.36,3.56,-9.83,3.99,-7.24,5.15,-5.48,6.52,-3.75,-18.5,-38.21,-17.83,-34.84,-17.3,-31.59,-16.82,-29.14,-13.07,-23.39,-9.32,-17.65,-8.8,-14.71,-8.1,-10.19,-7.17,-5.46,-22.31,-37.73,-21.82,-35.05,-21.35,-32.37,-20.86,-29.83,-16.97,-26.03,-13.08,-22.24,-12.48,-19.32,-11.6,-12.7,-10.71,-5.63,-18.65,-39.56,-17.95,-39.34,-17.13,-38.86,-16.75,-36.55,-15.04,-31.66,-13.33,-26.78,-12.94,-23.13,-12.12,-13.17,-11.42,-2.49,-14.99,-41.39,-14.35,-45.5,-13.62,-49.09,-13.43,-47.87,-13.53,-40.65,-13.62,-33.42,-13.54,-27.93,-13.21,-13.51,-12.96,1.95,-16.67,-45.73,-15.75,-51.43,-14.31,-56.51,-14,-55.65,-15.19,-46.33,-16.17,-34.82,-15.85,-25.06,-15.29,-10.4,-14.73,4.83,-17.32,-51.2,-17.23,-57.36,-16.77,-62.89,-16.75,-61.99,-18.01,-50.13,-18.74,-32.76,-17.85,-17.87,-16.57,-5.97,-15.27,5.68,-17.67,-56.56,-18.59,-63.29,-19.45,-69.36,-19.79,-68.48,-20.9,-53.95,-21.17,-30.55,-19.67,-10.6,-17.7,-1.6,-15.67,6.33]},{"duration":60,"tweenEasing":0,"value":[-0.67,-29.98,-0.67,-28.02,-0.67,-26.06,-0.67,-23.37,-0.68,-13.65,-0.68,-3.92,-0.68,-3.09,-0.67,-8.41,-0.67,-14.32,-0.66,-32.75,-1.27,-30.32,-1.89,-27.92,-1.98,-25.29,-1.23,-17.78,-0.48,-10.28,-0.34,-8.27,-0.07,-8.86,0.26,-9.69,-0.66,-35.32,-1.83,-32.45,-3.02,-29.63,-3.2,-27.07,-1.79,-21.81,-0.38,-16.55,-0.11,-13.49,0.46,-9.51,1.11,-5.41,-0.74,-36.15,-1.98,-33.47,-3.18,-30.79,-3.37,-28.25,-2.1,-24.45,-0.83,-20.65,-0.48,-17.74,0.4,-11.12,1.29,-4.05,-1.65,-37.98,-1.88,-37.76,-1.91,-37.28,-1.88,-34.96,-1.54,-30.08,-1.2,-25.2,-0.94,-21.55,-0.12,-11.59,0.58,-0.91,-2.56,-39.81,-2.05,-43.92,-1.36,-47.51,-1.18,-46.29,-1.4,-39.07,-1.61,-31.84,-1.54,-26.35,-1.21,-11.93,-0.96,3.53,-4.67,-44.15,-3.75,-49.85,-2.31,-54.93,-2,-54.07,-3.19,-44.75,-4.17,-33.24,-3.85,-23.48,-3.29,-8.82,-2.73,6.41,-5.32,-49.62,-5.23,-55.78,-4.77,-61.31,-4.75,-60.41,-6.01,-48.55,-6.74,-31.18,-5.85,-16.29,-4.57,-4.39,-3.27,7.26,-5.67,-54.98,-6.59,-61.71,-7.45,-67.78,-7.79,-66.9,-8.9,-52.37,-9.17,-28.97,-7.67,-9.02,-5.7,-0.02,-3.67,7.91]},{"value":[-27.31,-29.39,-25.46,-29.75,-23.75,-29.93,-22.36,-28.78,-21.19,-29.56,-21.29,-30.35,-22.08,-30.38,-23.19,-33.4,-24.31,-36.73,-6.94,-30.31,-3.86,-28.85,-0.63,-27.34,1.2,-25.72,1.35,-27.09,-0.53,-28.15,-1.93,-27.55,-3.8,-28.9,-5.74,-30.44,11.89,-31.17,15.98,-27.96,20.38,-24.85,22.54,-22.76,21.69,-24.57,18.01,-25.76,16.01,-24.37,13.41,-23.92,10.66,-23.51,16.18,-31.65,18.97,-28.61,20.97,-25.59,22.3,-23.22,20.85,-23.75,16.46,-23.54,14.13,-21.11,10.64,-18,7.06,-14.72,10.7,-34.39,16.11,-34.9,22.82,-35.19,25.12,-33.2,23.51,-30.99,20.23,-28.37,18.68,-25.07,15.95,-17.46,12.69,-9.32,5.22,-37.13,10.55,-42.76,17.55,-47.85,19.65,-47.04,19.35,-41.18,18.62,-35.21,17.75,-30.02,15.01,-16.79,11.56,-2.64,2.8,-41.56,5.5,-48.98,8.62,-55.68,9.55,-55.17,10.39,-45.95,11.45,-34.52,10.69,-25.31,6.46,-11.94,2.17,1.98,2.57,-47.03,4.26,-54.53,6.2,-61.3,6.9,-60.67,8.75,-48.58,11.13,-30.95,11.06,-16.27,7.49,-4.67,3.77,6.68,2.69,-52.39,3.15,-60.05,3.58,-66.98,3.95,-66.27,6.95,-51.28,10.8,-27.43,11.48,-7.22,8.74,2.64,5.69,11.49]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_02","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[16,-12.02,17.85,-8.32,19.56,-4.9,19.91,-3.68,19,-0.02,18.09,3.64,18.44,5.07,20.15,9.35,22,13.98,-1.59,-6.47,0.26,-4.42,1.97,-2.54,2.48,-2.04,3.26,-0.02,4.04,2,4.33,2.59,5.22,4.94,6.26,7.5,-17.84,-1.33,-16,-0.83,-14.28,-0.4,-13.62,-0.51,-11.28,-0.02,-8.94,0.47,-8.7,0.34,-8.57,0.88,-8.28,1.51,-21.57,-0.02,-19.85,-0.02,-18.18,-0.02,-17.5,-0.02,-14.87,-0.02,-12.25,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-17,-0.02,-16.07,-0.02,-15.22,-0.02,-14.87,-0.02,-13.5,-0.02,-12.13,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12.43,-0.02,-12.3,-0.02,-12.26,-0.02,-12.25,-0.02,-12.13,-0.02,-12.01,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02,-12,-0.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-45.33,-1.97,-45.33,-2.9,-45.33,-3.75,-45.59,-4.49,-48.33,-9.97,-51.08,-15.46,-53.68,-16.41,-55.61,-18.12,-57.33,-19.97,-25.89,-1.05,-25.09,-0.73,-24.26,-0.43,-24.4,-0.99,-28.33,-7.06,-32.9,-13.13,-35.48,-14.04,-37.79,-14.97,-40.14,-16,-7.93,-0.19,-6.36,1.28,-4.78,2.67,-4.81,2.31,-9.82,-4.11,-16.08,-10.54,-18.64,-11.35,-21.39,-11.56,-24.43,-11.82,-3.68,0.03,-2.81,1.26,-2.57,2.39,-2.97,2.19,-7.78,-2.64,-14.07,-7.46,-16.66,-7.79,-20.55,-7.52,-24.44,-7.22,-7.33,0.03,-4.27,-0.24,0.14,-0.55,1.11,-0.93,-2.37,-3.85,-6.7,-6.76,-8.23,-6.76,-10.49,-5.9,-13.08,-4.97,-10.99,0.03,-8.14,-1.44,-3.55,-2.85,-2.3,-3.31,-3.39,-4.64,-4.69,-5.97,-5.16,-5.72,-6.13,-4.28,-7.63,-2.72,-12.43,0.03,-12.43,-1.57,-12.43,-3.07,-12.33,-3.45,-11.26,-3.36,-10.18,-3.28,-10.8,-3.11,-13.46,-2.47,-15.99,-1.75,-16.7,0.03,-16.7,-0.8,-16.7,-1.57,-16.52,-1.68,-14.57,-0.69,-12.61,0.31,-13.14,0.26,-15.85,-0.31,-18.56,-0.9,-21.33,0.03,-21.33,0.03,-21.33,0.03,-21.08,0.2,-18.33,2.03,-15.59,3.86,-15.99,3.59,-18.56,1.88,-21.33,0.03]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_03","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[11.99,1.73,11.83,-0.51,11.68,-3.01,10.41,-8.46,5.97,-20.56,1.52,-32.66,-2.28,-32.49,-3.3,-32.13,-4.39,-37.7,-5.14,8.35,-4.31,4.43,-3.81,0.41,-4.25,-5.77,-4.83,-19.72,-5.56,-34.59,-7.73,-39.01,-7.98,-43.53,-8.22,-51.9,-20.96,14.13,-18.3,7.97,-15.72,1.88,-15.08,-5.05,-13.32,-20.03,-11.88,-36.84,-12.58,-45.31,-12.03,-54.46,-11.42,-65.41,-24.41,13.36,-21.35,5.3,-18.32,-2.57,-17.35,-9.95,-15.48,-23.92,-13.97,-40.05,-13.69,-48.42,-12.45,-57.61,-11.12,-67.3,-18.01,8.64,-17.02,-0.63,-16.09,-9.66,-15.73,-17.59,-14.39,-28.5,-13.26,-40.62,-12.74,-44.53,-11.46,-49.18,-10.01,-54.47,-11.61,1.81,-12.67,-7.88,-13.86,-17.3,-14.07,-24.25,-12.88,-29.24,-11.74,-34.54,-10.88,-33.98,-9.33,-35.39,-7.64,-37.56,-11.34,0.88,-12.63,-6.85,-14.36,-14.42,-14.28,-19.06,-12.65,-20.4,-11.22,-21.3,-9.36,-18.54,-7.94,-18,-5.87,-18,-12.62,5.16,-12.44,-0.35,-12.59,-5.87,-11.32,-9.04,-7.98,-10.5,-5.18,-10.9,-1.13,-8.31,2.6,-7.02,6.68,-5.87,-14.01,9.8,-12.16,6.48,-10.46,2.98,-7.91,1.16,-2.78,-0.75,1.5,-0.98,7.84,1.27,14.29,3.15,20.61,5.36]},{"duration":60,"tweenEasing":0,"value":[-4.01,13.76,-6.02,7.81,-7.88,1.88,-9.5,-4.78,-13.03,-20.54,-16.57,-36.29,-20.72,-37.56,-23.45,-41.48,-26.39,-51.68,-3.55,14.82,-4.58,8.84,-5.78,2.94,-6.74,-3.72,-8.09,-19.69,-9.6,-36.6,-12.07,-41.6,-13.2,-48.45,-14.48,-59.39,-3.12,15.46,-2.31,8.8,-1.44,2.27,-1.45,-4.53,-2.04,-19.99,-2.94,-37.32,-3.89,-45.63,-3.47,-55.32,-3.14,-66.92,-2.84,13.38,-1.5,5.33,-0.15,-2.55,0.14,-9.93,-0.61,-23.9,-1.72,-40.03,-1.69,-48.39,-0.45,-57.59,0.88,-67.28,-1.01,8.66,-0.94,-0.6,-0.87,-9.65,-0.86,-17.57,-0.89,-28.48,-1.13,-40.6,-0.74,-44.5,0.54,-49.16,1.99,-54.45,0.82,1.83,-0.37,-7.86,-1.6,-17.28,-1.82,-24.23,-0.75,-29.22,0.27,-34.52,1.12,-33.96,2.67,-35.37,4.36,-37.54,0.66,0.9,-0.63,-6.83,-2.36,-14.4,-2.28,-19.04,-0.65,-20.37,0.78,-21.28,2.64,-18.52,4.06,-17.98,6.13,-17.98,-0.62,5.19,-0.44,-0.33,-0.59,-5.85,0.68,-9.02,4.02,-10.48,6.82,-10.88,10.87,-8.29,14.6,-7,18.68,-5.85,-2.01,9.82,-0.16,6.5,1.54,3,4.09,1.18,9.22,-0.73,13.5,-0.96,19.84,1.3,26.29,3.17,32.61,5.38]},{"value":[-50.68,11.78,-52.69,4.91,-54.55,-1.87,-56.42,-9.27,-62.7,-30.51,-68.97,-51.75,-75.73,-53.97,-80.39,-59.6,-85.05,-71.65,-30.77,13.77,-30.99,8.1,-31.37,2.52,-32.46,-4.76,-37.77,-26.77,-43.85,-49.69,-48.88,-55.63,-52.32,-63.41,-55.96,-75.39,-12.38,15.27,-9.99,10.08,-7.55,4.94,-7.59,-2.27,-13.23,-24.14,-20.38,-47.82,-23.86,-56.97,-26.21,-66.88,-28.9,-78.74,-7.85,13.41,-5.65,6.58,-4.05,-0.15,-4.17,-7.76,-9.76,-26.54,-17.15,-47.47,-19.68,-56.18,-22.33,-65.11,-24.89,-74.51,-9.68,8.69,-6.55,-0.85,-2.06,-10.2,-1.09,-18.53,-4.63,-32.32,-9.19,-47.34,-10.3,-51.27,-11.27,-55.06,-12.43,-59.42,-11.5,1.86,-9.84,-9.3,-6.48,-20.12,-5.46,-27.55,-5.48,-33.86,-5.75,-40.48,-5.37,-39.68,-4.79,-39.66,-4.61,-40.26,-13.1,0.93,-14.39,-8.4,-16.12,-17.46,-15.94,-22.5,-13.23,-23.74,-10.74,-24.55,-9.49,-21.63,-10.73,-20.46,-11.2,-19.74,-18.66,5.21,-18.47,-1.13,-18.63,-7.42,-17.17,-10.71,-11.88,-11.17,-7.12,-10.57,-3.61,-8.03,-2.58,-7.31,-1.21,-6.74,-24.68,9.85,-22.83,6.53,-21.13,3.03,-18.32,1.38,-10.45,1.29,-3.42,2.9,2.52,4.89,6.4,5.05,9.95,5.4]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.04_04","timeline":[{"name":"B_HAIR_TWIN.04","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[7.98,15.49,5.81,7.3,3.8,-1.13,1.09,-12.72,-5.06,-35.09,-11.22,-57.46,-19.46,-59.43,-24.98,-68.27,-30.78,-89.38,-8.68,23.17,-8.89,13.26,-9.59,3.36,-10.87,-8.92,-11.86,-32.53,-13.14,-57.95,-17.85,-68.52,-20.19,-85.84,-22.7,-111.29,-24.08,29.59,-20.59,16.76,-17.15,4.14,-16.5,-8.92,-15.16,-32.34,-14.42,-59.34,-16.03,-77.39,-15.23,-102.83,-14.56,-132.33,-27.25,26.75,-22.86,10.63,-18.47,-5.13,-17.21,-19.15,-16.1,-40.27,-15.7,-65.59,-15.38,-83.31,-12.9,-108.21,-10.24,-134.59,-19.02,17.31,-17.96,-1.22,-16.97,-19.27,-16.59,-34.83,-15.31,-53.09,-14.41,-73.65,-13.48,-81.75,-10.94,-94.54,-8.03,-108.92,-10.79,3.65,-13.04,-15.72,-15.45,-34.56,-15.89,-48.55,-13.64,-58.13,-11.48,-68.33,-9.76,-67.05,-6.68,-70.27,-3.28,-75.09,-10.68,1.78,-13.27,-13.69,-16.72,-28.82,-16.55,-38.12,-13.28,-40.78,-10.45,-42.57,-6.72,-37.08,-3.88,-35.95,0.26,-35.99,-13.24,10.35,-12.87,-0.69,-13.19,-11.7,-10.62,-18.06,-3.96,-21,1.63,-21.8,9.74,-16.64,17.21,-14,25.37,-11.71,-16.02,19.62,-12.33,12.98,-8.92,5.98,-3.82,2.34,6.44,-1.49,15,-1.94,27.68,2.57,40.57,6.31,53.22,10.73]},{"duration":60,"tweenEasing":0,"value":[-8.02,27.51,-12.04,15.61,-15.76,3.77,-18.83,-9.04,-24.06,-35.07,-29.3,-61.1,-37.9,-64.51,-45.13,-77.62,-52.78,-103.36,-7.09,29.64,-9.16,17.67,-11.57,5.88,-13.36,-6.87,-15.12,-32.5,-17.17,-59.95,-22.19,-71.11,-25.41,-90.74,-28.96,-118.79,-6.24,30.92,-4.61,17.58,-2.87,4.53,-2.88,-8.38,-3.88,-32.29,-5.48,-59.81,-7.34,-77.69,-6.67,-103.65,-6.28,-133.84,-5.68,26.77,-3.01,10.65,-0.3,-5.1,0.29,-19.12,-1.23,-40.24,-3.45,-65.58,-3.38,-83.29,-0.9,-108.19,1.76,-134.57,-2.02,17.33,-1.88,-1.2,-1.75,-19.26,-1.72,-34.81,-1.81,-53.07,-2.28,-73.63,-1.48,-81.73,1.06,-94.52,3.97,-108.9,1.64,3.67,-0.73,-15.7,-3.19,-34.54,-3.65,-48.52,-1.51,-58.11,0.53,-68.31,2.24,-67.02,5.32,-70.25,8.72,-75.07,1.32,1.8,-1.27,-13.67,-4.72,-28.8,-4.55,-38.1,-1.28,-40.76,1.55,-42.55,5.28,-37.06,8.12,-35.93,12.26,-35.97,-1.24,10.37,-0.87,-0.67,-1.19,-11.68,1.38,-18.04,8.04,-20.98,13.63,-21.78,21.74,-16.62,29.21,-13.98,37.37,-11.69,-4.02,19.65,-0.33,13,3.08,6,8.18,2.36,18.44,-1.47,27,-1.92,39.68,2.59,52.57,6.33,65.22,10.76]},{"value":[-60.02,25.54,-65.28,10.25,-70.14,-4.74,-74.69,-18.64,-84.73,-47.71,-93.65,-76.78,-108.98,-83.65,-124.04,-104.07,-138.11,-136.66,-39.65,28.59,-41.6,15.57,-43.74,2.89,-46.33,-10.68,-53.22,-41,-60.34,-73.09,-70.24,-86.65,-78.79,-110.11,-87.23,-141.95,-20.83,30.73,-17.8,18.52,-14.58,6.59,-14.82,-6.81,-21.18,-36.79,-29.03,-70.27,-34.08,-89.25,-36.56,-116.01,-39.7,-147.12,-16.02,26.8,-12.49,11.91,-9.53,-2.7,-9.36,-16.95,-15.75,-42.88,-24.24,-73.01,-26.7,-91.08,-28.11,-115.7,-29.35,-141.79,-16.02,17.36,-12.83,-1.44,-8.27,-19.81,-7.28,-35.81,-10.92,-56.92,-15.7,-80.33,-16.37,-88.5,-16.06,-100.43,-15.78,-113.87,-16.02,3.7,-15.54,-17.15,-13.41,-37.34,-12.62,-51.86,-11.57,-62.75,-10.83,-74.25,-9.58,-72.75,-7.46,-74.54,-5.58,-77.79,-17.77,1.83,-20.36,-15.24,-23.82,-31.86,-23.54,-41.56,-19.2,-44.13,-15.31,-45.82,-12.18,-40.17,-12.01,-38.41,-10.4,-37.72,-24.61,10.4,-24.24,-1.47,-24.56,-13.25,-21.81,-19.73,-13.19,-21.67,-5.65,-21.46,1.93,-16.36,6.69,-14.29,12.15,-12.59,-32.02,19.67,-28.33,13.02,-24.92,6.02,-19.56,2.56,-6.56,0.56,4.74,1.94,17.03,6.18,27.35,8.21,37.22,10.78]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07","timeline":[{"name":"B_HAIR_TWIN.07_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.07_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.07_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.07_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.07_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_00","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-14.37,1.37,-10.96,1.06,-7.51,0.76,-4.05,0.47,-0.55,0.18,2.95,-0.1,6.46,-0.38,9.97,-0.66,13.49,-0.93,-11.44,1.31,-8,1.01,-4.54,0.71,-1.07,0.42,2.43,0.14,5.94,-0.13,9.45,-0.41,12.96,-0.68,16.48,-0.96,-8.51,1.26,-5.05,0.96,-1.57,0.67,1.92,0.38,5.42,0.11,8.92,-0.17,12.42,-0.44,15.92,-0.71,19.41,-0.99,-5.59,1.2,-2.1,0.91,1.39,0.63,4.89,0.35,8.39,0.07,11.89,-0.2,15.38,-0.47,18.86,-0.74,22.32,-1.02,-2.67,1.14,0.84,0.86,4.34,0.58,7.83,0.31,11.33,0.04,14.82,-0.23,18.31,-0.5,21.78,-0.77,25.22,-1.05,0.08,1.1,3.61,0.82,7.12,0.55,10.63,0.28,14.13,0.01,17.64,-0.25,21.14,-0.52,24.62,-0.79,28.09,-1.07,2.82,1.06,6.37,0.79,9.9,0.52,13.41,0.25,16.92,-0.01,20.43,-0.28,23.93,-0.55,27.42,-0.82,30.9,-1.09,5.56,1.02,9.13,0.76,12.67,0.49,16.2,0.23,19.7,-0.04,23.21,-0.31,26.7,-0.57,30.19,-0.84,33.68,-1.12,8.31,0.99,11.89,0.73,15.45,0.47,18.99,0.2,22.5,-0.07,25.99,-0.33,29.47,-0.6,32.95,-0.87,36.43,-1.14]},{"duration":60,"tweenEasing":0,"value":[-14.37,1.37,-10.96,1.06,-7.51,0.76,-4.05,0.47,-0.55,0.18,2.95,-0.1,6.46,-0.38,9.97,-0.66,13.49,-0.93,-11.44,1.31,-8,1.01,-4.54,0.71,-1.07,0.42,2.43,0.14,5.94,-0.13,9.45,-0.41,12.96,-0.68,16.48,-0.96,-8.51,1.26,-5.05,0.96,-1.57,0.67,1.92,0.38,5.42,0.11,8.92,-0.17,12.42,-0.44,15.92,-0.71,19.41,-0.99,-5.59,1.2,-2.1,0.91,1.39,0.63,4.89,0.35,8.39,0.07,11.89,-0.2,15.38,-0.47,18.86,-0.74,22.32,-1.02,-2.67,1.14,0.84,0.86,4.34,0.58,7.83,0.31,11.33,0.04,14.82,-0.23,18.31,-0.5,21.78,-0.77,25.22,-1.05,0.08,1.1,3.61,0.82,7.12,0.55,10.63,0.28,14.13,0.01,17.64,-0.25,21.14,-0.52,24.62,-0.79,28.09,-1.07,2.82,1.06,6.37,0.79,9.9,0.52,13.41,0.25,16.92,-0.01,20.43,-0.28,23.93,-0.55,27.42,-0.82,30.9,-1.09,5.56,1.02,9.13,0.76,12.67,0.49,16.2,0.23,19.7,-0.04,23.21,-0.31,26.7,-0.57,30.19,-0.84,33.68,-1.12,8.31,0.99,11.89,0.73,15.45,0.47,18.99,0.2,22.5,-0.07,25.99,-0.33,29.47,-0.6,32.95,-0.87,36.43,-1.14]},{"value":[-14.37,3.48,-10.95,3.18,-7.51,2.89,-4.04,2.62,-0.55,2.35,2.95,2.08,6.46,1.81,9.97,1.55,13.5,1.28,-11.44,2.73,-8.01,2.5,-4.55,2.29,-1.07,2.08,2.42,1.84,5.93,1.63,9.44,1.47,12.95,1.34,16.47,1.19,-8.53,1.81,-5.06,1.65,-1.59,1.53,1.9,1.4,5.4,1.2,8.9,1.04,12.4,1.01,15.9,1.02,19.39,0.98,-5.62,1.23,-2.13,1.14,1.36,1.1,4.86,1.02,8.36,0.85,11.86,0.73,15.34,0.8,18.82,0.93,22.28,0.99,-2.71,1.51,0.79,1.47,4.29,1.45,7.79,1.4,11.28,1.23,14.78,1.13,18.26,1.22,21.73,1.4,25.18,1.53,0.06,2.85,3.59,2.77,7.1,2.75,10.6,2.69,14.1,2.52,17.6,2.41,21.09,2.48,24.56,2.62,28.02,2.68,2.81,5.14,6.35,5.01,9.87,4.92,13.38,4.81,16.88,4.62,20.38,4.47,23.86,4.45,27.34,4.47,30.8,4.44,5.55,7.83,9.1,7.64,12.62,7.47,16.12,7.29,19.62,7.07,23.11,6.86,26.59,6.72,30.07,6.6,33.53,6.45,8.3,10.38,11.85,10.13,15.35,9.89,18.84,9.64,22.32,9.39,25.81,9.14,29.3,8.89,32.78,8.64,36.26,8.39]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_01","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-4.15,1.36,-3.84,1.06,-3.48,0.77,-3.11,0.47,-2.71,0.18,-2.32,-0.11,-1.92,-0.4,-1.53,-0.69,-1.13,-0.98,-2.27,1.31,-1.93,1.01,-1.56,0.72,-1.18,0.43,-0.79,0.14,-0.39,-0.15,0.01,-0.44,0.41,-0.73,0.81,-1.02,-0.4,1.25,-0.02,0.96,0.36,0.67,0.75,0.38,1.14,0.09,1.53,-0.19,1.93,-0.48,2.33,-0.77,2.73,-1.05,1.46,1.19,1.88,0.91,2.28,0.63,2.68,0.34,3.07,0.05,3.46,-0.23,3.85,-0.52,4.24,-0.8,4.63,-1.09,3.3,1.14,3.76,0.86,4.19,0.58,4.59,0.3,4.98,0.02,5.37,-0.27,5.75,-0.56,6.14,-0.84,6.53,-1.13,5.24,1.11,5.7,0.83,6.12,0.55,6.51,0.27,6.9,-0.02,7.3,-0.31,7.7,-0.59,8.1,-0.88,8.5,-1.17,7.18,1.08,7.63,0.8,8.05,0.52,8.45,0.23,8.83,-0.05,9.23,-0.34,9.63,-0.63,10.04,-0.92,10.44,-1.2,9.11,1.05,9.56,0.77,9.99,0.48,10.39,0.2,10.77,-0.09,11.17,-0.37,11.57,-0.66,11.97,-0.95,12.36,-1.24,11.03,1.01,11.5,0.73,11.94,0.45,12.35,0.16,12.75,-0.12,13.13,-0.41,13.51,-0.7,13.9,-0.98,14.27,-1.27]},{"duration":60,"tweenEasing":0,"value":[-4.15,1.36,-3.84,1.06,-3.48,0.77,-3.11,0.47,-2.71,0.18,-2.32,-0.11,-1.92,-0.4,-1.53,-0.69,-1.13,-0.98,-2.27,1.31,-1.93,1.01,-1.56,0.72,-1.18,0.43,-0.79,0.14,-0.39,-0.15,0.01,-0.44,0.41,-0.73,0.81,-1.02,-0.4,1.25,-0.02,0.96,0.36,0.67,0.75,0.38,1.14,0.09,1.53,-0.19,1.93,-0.48,2.33,-0.77,2.73,-1.05,1.46,1.19,1.88,0.91,2.28,0.63,2.68,0.34,3.07,0.05,3.46,-0.23,3.85,-0.52,4.24,-0.8,4.63,-1.09,3.3,1.14,3.76,0.86,4.19,0.58,4.59,0.3,4.98,0.02,5.37,-0.27,5.75,-0.56,6.14,-0.84,6.53,-1.13,5.24,1.11,5.7,0.83,6.12,0.55,6.51,0.27,6.9,-0.02,7.3,-0.31,7.7,-0.59,8.1,-0.88,8.5,-1.17,7.18,1.08,7.63,0.8,8.05,0.52,8.45,0.23,8.83,-0.05,9.23,-0.34,9.63,-0.63,10.04,-0.92,10.44,-1.2,9.11,1.05,9.56,0.77,9.99,0.48,10.39,0.2,10.77,-0.09,11.17,-0.37,11.57,-0.66,11.97,-0.95,12.36,-1.24,11.03,1.01,11.5,0.73,11.94,0.45,12.35,0.16,12.75,-0.12,13.13,-0.41,13.51,-0.7,13.9,-0.98,14.27,-1.27]},{"value":[-4.14,3.47,-3.83,3.18,-3.48,2.9,-3.1,2.62,-2.71,2.34,-2.31,2.07,-1.92,1.79,-1.53,1.51,-1.13,1.24,-2.28,2.72,-1.93,2.5,-1.57,2.3,-1.19,2.09,-0.8,1.84,-0.4,1.61,0,1.44,0.4,1.3,0.8,1.13,-0.42,1.8,-0.04,1.65,0.35,1.54,0.73,1.4,1.12,1.18,1.51,1.01,1.91,0.97,2.31,0.97,2.7,0.91,1.43,1.22,1.85,1.14,2.25,1.1,2.65,1.02,3.03,0.83,3.42,0.69,3.82,0.75,4.21,0.86,4.6,0.92,3.26,1.51,3.72,1.47,4.14,1.46,4.54,1.39,4.93,1.21,5.32,1.08,5.71,1.16,6.1,1.33,6.48,1.45,5.22,2.86,5.68,2.79,6.09,2.75,6.48,2.67,6.87,2.49,7.26,2.35,7.65,2.41,8.04,2.53,8.43,2.58,7.17,5.16,7.62,5.02,8.02,4.92,8.41,4.79,8.79,4.58,9.18,4.41,9.57,4.37,9.95,4.37,10.33,4.33,9.1,7.85,9.54,7.65,9.94,7.46,10.32,7.26,10.7,7.02,11.08,6.8,11.46,6.64,11.84,6.5,12.22,6.33,11.02,10.4,11.45,10.14,11.84,9.87,12.2,9.6,12.57,9.34,12.96,9.07,13.34,8.8,13.72,8.53,14.1,8.26]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_02","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":161},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[2.11,0,2.12,0,2.13,0,2.15,0,2.16,0,2.18,0,2.19,0,2.2,0,2.22,-0.01,1.42,-0.01,1.49,-0.01,1.58,-0.01,1.66,-0.01,1.7,-0.01,1.76,-0.01,1.88,-0.01,2.02,-0.01,2.15,-0.02,0.55,-0.02,0.69,-0.02,0.87,-0.02,1.02,-0.02,1.09,-0.02,1.2,-0.02,1.45,-0.02,1.73,-0.02,1.97,-0.03,0.03,-0.03,0.23,-0.03,0.47,-0.03,0.68,-0.03,0.77,-0.03,0.93,-0.03,1.27,-0.03,1.67,-0.03,2.01,-0.04,0.37,-0.04,0.61,-0.04,0.87,-0.04,1.09,-0.04,1.19,-0.05,1.35,-0.05,1.72,-0.05,2.17,-0.05,2.58,-0.02,1.75,-0.02,1.95,-0.03,2.2,-0.03,2.41,-0.03,2.51,-0.04,2.66,-0.05,3,-0.06,3.41,-0.07,3.75,-0.01,4.08,-0.01,4.22,-0.03,4.4,-0.04,4.56,-0.03,4.63,-0.05,4.75,-0.07,5,-0.09,5.29,-0.1,5.53,-0.01,6.81,-0.02,6.88,-0.05,6.98,-0.07,7.06,-0.08,7.11,-0.09,7.17,-0.11,7.3,-0.13,7.44,-0.14,7.57,-0.01,9.39,-0.05,9.4,-0.1,9.42,-0.15,9.44,-0.17,9.46,-0.17,9.48,-0.17,9.49,-0.17,9.51,-0.17,9.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_03","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.73,0.12,12.74,0.12,12.7,0.12,12.57,0.13,12.72,0.12,12.77,0.12,12.82,0.11,12.87,0.1,12.91,0.1,12.89,0.1,12.84,0.11,12.75,0.12,12.58,0.13,12.77,0.11,12.85,0.11,12.92,0.1,12.99,0.09,13.06,0.09,13.01,0.09,12.93,0.1,12.8,0.11,12.59,0.13,12.92,0.1,12.98,0.1,13.04,0.09,13.1,0.08,13.16,0.08,13.1,0.08,13,0.09,12.85,0.11,12.64,0.13,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.16,0.08,13.07,0.09,12.92,0.1,12.72,0.12,13.2,0.08,13.21,0.08,13.22,0.08,13.23,0.08,13.23,0.08,13.22,0.08,13.14,0.09,13.01,0.1,12.81,0.11,13.22,0.08,13.26,0.08,13.28,0.08,13.3,0.09,13.32,0.09,13.3,0.09,13.22,0.09,13.07,0.1,12.85,0.11,13.26,0.08,13.32,0.09,13.36,0.09,13.38,0.09,13.4,0.09,13.37,0.09,13.28,0.1,13.11,0.1,12.87,0.11,13.35,0.09,13.4,0.09,13.43,0.1,13.44,0.1,13.44,0.1,13.41,0.1,13.31,0.1,13.13,0.1,12.87,0.11]},{"duration":60,"tweenEasing":0,"value":[12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.71,0.12,12.73,0.12,12.74,0.12,12.7,0.12,12.57,0.13,12.72,0.12,12.77,0.12,12.82,0.11,12.87,0.1,12.91,0.1,12.89,0.1,12.84,0.11,12.75,0.12,12.58,0.13,12.77,0.11,12.85,0.11,12.92,0.1,12.99,0.09,13.06,0.09,13.01,0.09,12.93,0.1,12.8,0.11,12.59,0.13,12.92,0.1,12.98,0.1,13.04,0.09,13.1,0.08,13.16,0.08,13.1,0.08,13,0.09,12.85,0.11,12.64,0.13,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.19,0.08,13.16,0.08,13.07,0.09,12.92,0.1,12.72,0.12,13.2,0.08,13.21,0.08,13.22,0.08,13.23,0.08,13.23,0.08,13.22,0.08,13.14,0.09,13.01,0.1,12.81,0.11,13.22,0.08,13.26,0.08,13.28,0.08,13.3,0.09,13.32,0.09,13.3,0.09,13.22,0.09,13.07,0.1,12.85,0.11,13.26,0.08,13.32,0.09,13.36,0.09,13.38,0.09,13.4,0.09,13.37,0.09,13.28,0.1,13.11,0.1,12.87,0.11,13.35,0.09,13.4,0.09,13.43,0.1,13.44,0.1,13.44,0.1,13.41,0.1,13.31,0.1,13.13,0.1,12.87,0.11]},{"value":[3.6,2.7,3.73,2.7,3.88,2.71,4,2.71,4.05,2.72,4.41,2.77,5.27,2.85,6.28,2.95,7.09,3.06,6.3,1.87,6.44,1.94,6.6,2.01,6.73,2.07,6.81,2.11,7.01,2.19,7.57,2.37,8.22,2.58,8.71,2.78,9.34,0.85,9.46,0.98,9.59,1.14,9.71,1.28,9.79,1.34,9.82,1.47,10.06,1.75,10.35,2.08,10.51,2.37,11.89,0.18,11.97,0.38,12.05,0.61,12.12,0.81,12.18,0.9,12.1,1.06,12.1,1.42,12.09,1.85,12,2.21,13.15,0.45,13.15,0.69,13.15,0.95,13.15,1.17,13.15,1.27,13.11,1.43,13.02,1.81,12.87,2.27,12.67,2.7,13.18,1.83,13.19,2.03,13.2,2.28,13.2,2.49,13.21,2.58,13.18,2.74,13.1,3.09,12.95,3.51,12.74,3.86,13.2,4.16,13.24,4.3,13.26,4.48,13.27,4.64,13.28,4.72,13.25,4.84,13.15,5.09,12.98,5.39,12.75,5.64,13.25,6.89,13.3,6.97,13.31,7.07,13.31,7.15,13.32,7.2,13.28,7.26,13.17,7.39,12.99,7.54,12.73,7.68,13.34,9.48,13.36,9.5,13.33,9.52,13.29,9.54,13.27,9.56,13.23,9.57,13.14,9.59,12.96,9.61,12.7,9.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.07_04","timeline":[{"name":"B_HAIR_TWIN.07","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[19.7,0.28,22.06,0.49,24.77,0.75,26.74,0.92,26.9,0.85,25.31,0.68,23.1,0.62,20.7,0.6,18.61,0.55,28.95,0.6,30.16,0.69,31.65,0.81,32.64,0.85,32.35,0.72,30.89,0.52,28.94,0.38,26.85,0.26,24.97,0.15,38.54,0.97,38.72,0.92,39.11,0.86,39.21,0.75,38.53,0.56,36.82,0.33,34.78,0.1,32.64,-0.11,30.64,-0.28,46.86,1.26,46.27,1.1,45.83,0.89,45.29,0.65,44.43,0.4,42.72,0.15,40.82,-0.13,38.86,-0.39,36.97,-0.61,52.3,1.35,51.32,1.1,50.43,0.84,49.65,0.57,49.01,0.29,48.15,0.03,47.23,-0.22,46.26,-0.46,45.3,-0.7,56.02,1.3,55.12,1.04,54.26,0.75,53.46,0.46,52.74,0.18,51.96,-0.05,51.1,-0.25,50.2,-0.46,49.27,-0.7,59.65,1.21,58.9,0.95,58.14,0.66,57.38,0.37,56.64,0.09,55.88,-0.11,55.06,-0.29,54.18,-0.49,53.25,-0.73,63.26,1.09,62.67,0.84,62.03,0.57,61.34,0.29,60.61,0.03,59.87,-0.15,59.06,-0.34,58.19,-0.56,57.24,-0.82,66.9,0.94,66.47,0.71,65.94,0.47,65.3,0.23,64.56,-0.01,63.83,-0.2,63.05,-0.42,62.19,-0.67,61.22,-0.96]},{"duration":60,"tweenEasing":0,"value":[19.7,0.28,22.06,0.49,24.77,0.75,26.74,0.92,26.9,0.85,25.31,0.68,23.1,0.62,20.7,0.6,18.61,0.55,28.95,0.6,30.16,0.69,31.65,0.81,32.64,0.85,32.35,0.72,30.89,0.52,28.94,0.38,26.85,0.26,24.97,0.15,38.54,0.97,38.72,0.92,39.11,0.86,39.21,0.75,38.53,0.56,36.82,0.33,34.78,0.1,32.64,-0.11,30.64,-0.28,46.86,1.26,46.27,1.1,45.83,0.89,45.29,0.65,44.43,0.4,42.72,0.15,40.82,-0.13,38.86,-0.39,36.97,-0.61,52.3,1.35,51.32,1.1,50.43,0.84,49.65,0.57,49.01,0.29,48.15,0.03,47.23,-0.22,46.26,-0.46,45.3,-0.7,56.02,1.3,55.12,1.04,54.26,0.75,53.46,0.46,52.74,0.18,51.96,-0.05,51.1,-0.25,50.2,-0.46,49.27,-0.7,59.65,1.21,58.9,0.95,58.14,0.66,57.38,0.37,56.64,0.09,55.88,-0.11,55.06,-0.29,54.18,-0.49,53.25,-0.73,63.26,1.09,62.67,0.84,62.03,0.57,61.34,0.29,60.61,0.03,59.87,-0.15,59.06,-0.34,58.19,-0.56,57.24,-0.82,66.9,0.94,66.47,0.71,65.94,0.47,65.3,0.23,64.56,-0.01,63.83,-0.2,63.05,-0.42,62.19,-0.67,61.22,-0.96]},{"value":[19.71,2.39,22.07,2.61,24.77,2.89,26.74,3.07,26.9,3.01,25.32,2.86,23.1,2.81,20.71,2.81,18.61,2.77,28.94,2.02,30.16,2.18,31.65,2.39,32.63,2.51,32.34,2.42,30.88,2.28,28.93,2.26,26.84,2.29,24.96,2.29,38.52,1.52,38.7,1.61,39.09,1.73,39.19,1.77,38.51,1.65,36.8,1.53,34.76,1.56,32.62,1.63,30.62,1.69,46.83,1.29,46.24,1.32,45.8,1.36,45.26,1.33,44.4,1.17,42.69,1.08,40.79,1.15,38.83,1.29,36.93,1.4,52.27,1.72,51.28,1.71,50.39,1.71,49.61,1.66,48.96,1.48,48.11,1.38,47.18,1.5,46.22,1.71,45.25,1.88,56,3.05,55.1,2.99,54.24,2.95,53.44,2.87,52.71,2.68,51.92,2.61,51.06,2.75,50.14,2.95,49.21,3.05,59.64,5.29,58.88,5.17,58.11,5.06,57.34,4.93,56.6,4.73,55.83,4.64,54.99,4.71,54.1,4.8,53.15,4.8,63.25,7.89,62.65,7.72,61.98,7.54,61.27,7.36,60.53,7.14,59.77,7.02,58.95,6.95,58.06,6.89,57.09,6.75,66.89,10.33,66.43,10.11,65.84,9.89,65.15,9.67,64.39,9.45,63.66,9.28,62.88,9.08,62.01,8.84,61.05,8.56]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16","timeline":[{"name":"B_HAIR_TWIN.16_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.16_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.16_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.16_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.16_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_00","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[-0.06,1.94,-0.05,1.94,-0.04,1.94,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.04,1.94,-0.04,1.94,-0.03,1.95,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.02,1.95,-0.02,1.95,-0.02,1.95,-0.01,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.01,1.96,-0.01,1.96,0,1.95,0,1.95,0.01,1.95,0.01,1.95,0.02,1.95,0.02,1.95,0.03,1.95,0.04,1.97,0.04,1.96,0.04,1.96,0.04,1.95,0.04,1.94,0.05,1.94,0.07,1.94,0.09,1.94,0.1,1.94,0.1,1.96,0.09,1.96,0.08,1.95,0.06,1.95,0.05,1.94,0.07,1.94,0.09,1.94,0.12,1.95,0.13,1.95,0.12,1.24,0.13,1,0.15,0.85,0.15,0.76,0.1,0.74,0.25,0.64,0.25,0.66,0.17,0.71,0.12,0.73,-0.15,-1.56,0,-2.34,0.17,-3.13,0.3,-3.75,0.32,-3.99,0.63,-4.24,0.53,-4.22,0.26,-4.11,0.07,-4.05,-0.49,-4.59,-0.16,-5.94,0.18,-7.43,0.46,-8.63,0.57,-9.12,1.03,-9.51,0.82,-9.5,0.35,-9.32,0.01,-9.23]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_01","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[-0.06,1.94,-0.05,1.94,-0.04,1.94,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.04,1.94,-0.04,1.94,-0.03,1.95,-0.02,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.02,1.95,-0.02,1.95,-0.02,1.95,-0.01,1.95,0,1.95,0,1.95,0,1.95,0,1.95,0,1.95,-0.01,1.96,-0.01,1.96,0,1.95,0,1.95,0.01,1.95,0.01,1.95,0.02,1.95,0.02,1.95,0.03,1.95,0.04,1.97,0.04,1.96,0.04,1.96,0.04,1.95,0.04,1.94,0.05,1.94,0.07,1.94,0.09,1.94,0.1,1.94,0.1,1.96,0.09,1.96,0.08,1.95,0.06,1.95,0.05,1.94,0.07,1.94,0.09,1.94,0.12,1.95,0.13,1.95,0.2,1.95,0.17,1.95,0.13,1.95,0.1,1.95,0.06,1.95,0.07,1.95,0.09,1.96,0.12,1.96,0.13,1.96,0.26,1.95,0.23,1.95,0.19,1.95,0.15,1.96,0.12,1.96,0.11,1.96,0.12,1.96,0.13,1.96,0.14,1.96,0.26,1.94,0.26,1.95,0.23,1.95,0.21,1.95,0.2,1.95,0.17,1.96,0.15,1.96,0.15,1.97,0.15,1.97]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_03","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[24.3,3.25,20.78,2.96,16.91,2.64,13.76,2.38,12.38,2.28,11.26,2.28,8.73,2.28,5.62,2.28,2.8,2.28,15.02,-0.69,12.91,-0.45,10.57,0.27,8.69,1.04,7.92,1.4,7.21,1.42,5.61,1.46,3.66,1.5,1.88,1.52,6.23,-1.26,5.44,-1,4.55,-0.35,3.84,0.32,3.58,0.62,3.27,0.65,2.6,0.73,1.78,0.8,1.04,0.83,1.84,0.65,1.78,0.68,1.74,0.69,1.66,0.7,1.5,0.7,1.4,0.7,1.23,0.69,1.02,0.68,0.82,0.65,1.84,0.65,2.31,0.83,2.83,1.02,3.23,1.18,3.32,1.24,2.97,1.18,2.32,1.02,1.54,0.83,0.82,0.65,1.84,0.65,2.83,0.97,3.92,1.35,4.8,1.66,5.13,1.79,4.54,1.66,3.41,1.35,2.06,0.97,0.82,0.65,1.84,0.65,2.74,0.94,3.73,1.29,4.53,1.59,4.87,1.71,4.28,1.59,3.22,1.29,1.97,0.94,0.82,0.65,1.84,0.65,2.24,0.8,2.69,0.98,3.05,1.14,3.17,1.2,2.79,1.14,2.18,0.98,1.48,0.8,0.82,0.65,1.84,0.65,1.72,0.65,1.59,0.65,1.46,0.65,1.33,0.65,1.2,0.65,1.08,0.65,0.95,0.65,0.82,0.65]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.16_04","timeline":[{"name":"B_HAIR_TWIN.16","type":50,"frame":[{"duration":121,"value":[48.59,6.5,41.57,5.92,33.83,5.28,27.51,4.77,24.76,4.55,22.52,4.55,17.45,4.55,11.24,4.55,5.6,4.55,30.03,-1.39,25.82,-0.91,21.14,0.55,17.36,2.08,15.84,2.79,14.42,2.83,11.22,2.92,7.32,3.01,3.77,3.05,12.47,-2.51,10.88,-2,9.1,-0.7,7.68,0.63,7.17,1.24,6.54,1.31,5.19,1.45,3.56,1.59,2.08,1.66,3.69,1.3,4.02,1.31,4.49,1.32,4.69,1.32,4.21,1.32,4.21,1.32,3.5,1.32,2.5,1.31,1.64,1.3,3.69,1.3,8.75,1.36,14.38,1.43,18.89,1.49,20.59,1.51,18.38,1.49,13.36,1.43,7.22,1.36,1.64,1.3,3.69,1.3,13.51,1.42,24.32,1.55,33.14,1.66,36.98,1.71,32.43,1.66,23.12,1.55,11.91,1.41,1.64,1.3,3.69,1.3,12.71,1.41,22.61,1.53,30.77,1.63,34.6,1.68,29.96,1.63,21.32,1.53,11.08,1.4,1.64,1.3,3.69,1.3,8.22,1.35,13.19,1.42,17.3,1.47,19.26,1.5,16.7,1.47,12.09,1.42,6.66,1.35,1.64,1.3,3.69,1.3,3.43,1.3,3.18,1.3,2.92,1.3,2.66,1.3,2.41,1.3,2.15,1.3,1.9,1.3,1.64,1.3]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17","timeline":[{"name":"B_HAIR_TWIN.17_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.17_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.17_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.17_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.17_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_00","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[2.35,0,3.29,0.01,4.28,0.02,5.34,0.03,6.49,0.06,7.9,0.04,8.98,0.04,9.44,0.03,8.97,0.02,2.28,0,3.27,0.03,4.29,0.05,5.36,0.08,6.51,0.11,8.01,0.08,9.24,0.08,10.07,0.09,10.39,0.09,2.22,-0.01,3.23,0.04,4.27,0.07,5.34,0.09,6.46,0.12,7.72,0.09,8.77,0.09,9.65,0.11,10.43,0.12,2.14,-0.01,3.16,0.04,4.22,0.06,5.29,0.08,6.39,0.1,7.4,0.07,8.24,0.08,9.08,0.11,10.09,0.13,1.96,0,2.96,0.02,4.02,0.04,5.1,0.05,6.17,0.06,7.06,0.04,7.75,0.06,8.45,0.08,9.38,0.1,1.71,0,2.68,0.01,3.73,0.03,4.8,0.03,5.82,0.03,6.68,0.03,7.31,0.04,7.97,0.06,8.91,0.08,1.41,0,2.34,0,3.36,0.01,4.4,0.01,5.41,0,6.21,0.01,6.85,0.03,7.54,0.04,8.49,0.06,1.16,0,2.09,0,3.09,-0.01,4.14,-0.01,5.18,-0.03,5.9,0.01,6.54,0.04,7.26,0.07,8.19,0.08,0.97,0,1.9,-0.01,2.91,-0.02,3.97,-0.03,5.05,-0.05,5.71,0.02,6.39,0.06,7.17,0.09,8.12,0.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_01","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[1.18,0,1.64,0.01,2.14,0.01,2.67,0.02,3.25,0.03,3.95,0.02,4.49,0.02,4.72,0.02,4.49,0.01,1.14,0,1.63,0.01,2.14,0.03,2.68,0.04,3.26,0.05,4,0.04,4.62,0.04,5.04,0.04,5.19,0.04,1.11,0,1.62,0.02,2.13,0.03,2.67,0.05,3.23,0.06,3.86,0.05,4.38,0.05,4.83,0.05,5.22,0.06,1.07,0,1.58,0.02,2.11,0.03,2.65,0.04,3.19,0.05,3.7,0.04,4.12,0.04,4.54,0.05,5.05,0.06,0.98,0,1.48,0.01,2.01,0.02,2.55,0.03,3.09,0.03,3.53,0.02,3.87,0.03,4.23,0.04,4.69,0.05,0.85,0,1.34,0.01,1.86,0.01,2.4,0.02,2.91,0.02,3.34,0.01,3.66,0.02,3.99,0.03,4.45,0.04,0.71,0,1.17,0,1.68,0,2.2,0,2.7,0,3.11,0.01,3.43,0.01,3.77,0.02,4.25,0.03,0.58,0,1.04,0,1.55,0,2.07,-0.01,2.59,-0.01,2.95,0.01,3.27,0.02,3.63,0.03,4.09,0.04,0.49,0,0.95,-0.01,1.45,-0.01,1.98,-0.01,2.52,-0.02,2.86,0.01,3.2,0.03,3.58,0.04,4.06,0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_03","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[19.32,1.05,14.58,1.08,9.59,1.13,5.08,1.17,1.8,1.18,-0.48,1.21,-2.84,1.25,-5.14,1.28,-7.23,1.27,18.8,1.05,14.36,1.07,9.69,1.1,5.45,1.13,2.33,1.14,0.03,1.14,-2.35,1.14,-4.68,1.14,-6.83,1.11,18.46,1.01,14.31,1.03,9.96,1.05,5.99,1.07,3.02,1.09,0.65,1.06,-1.77,1.03,-4.17,0.99,-6.43,0.94,18.41,0.99,14.14,1,9.91,1.02,6.2,1.04,3.51,1.06,1.53,1.01,-0.71,0.96,-3.16,0.9,-5.74,0.84,16.28,0.96,11.81,0.98,8.09,0.99,5.39,1,4.02,1,3.09,0.97,1.28,0.92,-1.4,0.87,-4.96,0.82,14.12,0.96,9.4,0.97,6.14,0.98,4.42,0.98,4.33,0.97,4.38,0.95,2.94,0.91,-0.06,0.87,-4.66,0.83,13.6,0.97,9.31,0.98,6.28,0.97,4.53,0.96,4.07,0.94,3.76,0.92,2.18,0.91,-0.74,0.89,-5.04,0.84,13.05,1.01,9.73,1,7.04,0.98,4.98,0.96,3.57,0.93,2.26,0.89,0.33,0.89,-2.27,0.87,-5.58,0.8,12.54,1.03,10.19,1,7.81,0.97,5.43,0.94,3.07,0.9,0.79,0.84,-1.47,0.81,-3.74,0.77,-6.02,0.66]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.17_04","timeline":[{"name":"B_HAIR_TWIN.17","type":50,"frame":[{"duration":121,"value":[38.63,2.09,29.16,2.17,19.18,2.26,10.17,2.33,3.6,2.36,-0.95,2.43,-5.68,2.5,-10.28,2.55,-14.45,2.55,37.6,2.1,28.72,2.15,19.37,2.2,10.9,2.25,4.65,2.28,0.05,2.28,-4.7,2.29,-9.35,2.27,-13.66,2.21,36.92,2.03,28.63,2.07,19.91,2.11,11.97,2.15,6.03,2.18,1.31,2.12,-3.55,2.06,-8.34,1.99,-12.86,1.88,36.81,1.97,28.29,2,19.83,2.04,12.42,2.07,7.02,2.11,3.06,2.02,-1.43,1.92,-6.32,1.81,-11.49,1.67,32.56,1.93,23.62,1.96,16.17,1.98,10.78,1.99,8.03,2,6.19,1.94,2.58,1.85,-2.8,1.75,-9.92,1.64,28.23,1.92,18.78,1.95,12.25,1.96,8.82,1.96,8.65,1.93,8.76,1.9,5.88,1.83,-0.11,1.73,-9.31,1.66,27.19,1.95,18.62,1.96,12.56,1.95,9.06,1.92,8.14,1.87,7.51,1.85,4.35,1.82,-1.48,1.78,-10.08,1.69,26.09,2.02,19.46,1.99,14.07,1.96,9.95,1.92,7.14,1.85,4.53,1.79,0.65,1.78,-4.55,1.75,-11.15,1.61,25.07,2.05,20.37,1.99,15.62,1.94,10.87,1.89,6.14,1.81,1.58,1.68,-2.95,1.63,-7.48,1.54,-12.04,1.31]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18","timeline":[{"name":"B_HAIR_TWIN.18_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.18_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.18_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.18_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.18_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_00","timeline":[{"name":"B_HAIR_TWIN.18","type":50,"frame":[{"duration":121,"offset":20,"value":[0.9,0.1,1.88,0.22,2.7,0.32,3.12,0.36,2.7,0.32,1.88,0.22,0.9,0.1,0,0,0,0,1.74,0.19,3.64,0.42,5.22,0.62,6.01,0.7,5.21,0.62,3.63,0.42,1.74,0.19,0,0,0,0,1.89,0.21,3.97,0.46,5.68,0.66,6.46,0.75,6.43,0.67,4.69,0.46,2.27,0.21,0.19,0,0,0,1,0.12,2.11,0.24,3.01,0.35,3.37,0.39,6.41,0.35,5.74,0.25,3.58,0.12,2.17,0.01,0,0,0.11,0.02,0.25,0.03,0.34,0.03,0.29,0.03,6.42,0.04,6.82,0.04,4.91,0.04,4.15,0.02,0,0,0,0,0,0,0,0,0,0,5.28,0.01,5.77,0.01,4.34,0.01,3.86,0.02,0,0,0,0,0,0,0,0,0,0,2.66,0.01,2.92,0.01,2.23,0.01,2.01,0.01]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_03","timeline":[{"name":"B_HAIR_TWIN.18","type":50,"frame":[{"duration":121,"value":[15.87,-0.85,15.12,-0.67,14.86,-0.49,13.71,-0.24,10.3,0.16,7.84,0.16,3.1,0.18,-2.44,0.19,-7.28,0.17,10.8,-0.57,9.5,-0.45,8.48,-0.32,6.92,-0.15,3.99,0.11,2.52,0.08,-0.42,0.06,-3.86,0.04,-6.85,0.01,5.56,-0.24,3.95,-0.17,2.41,-0.1,0.67,-0.01,-1.56,0.11,-2.27,0.04,-3.59,-0.02,-5.12,-0.08,-6.44,-0.13,0.89,0,0.02,0.03,-0.92,0.05,-1.84,0.07,-2.68,0.09,-3.24,0.04,-3.89,-0.03,-4.65,-0.12,-5.55,-0.2,1.18,0,0.39,0,-0.45,0,-1.29,-0.01,-2.1,-0.01,-1.62,0.07,-1.33,0.05,-1.49,-0.04,-2.36,-0.21,1.51,0.01,0.76,-0.01,-0.04,-0.03,-0.85,-0.05,-1.66,-0.06,-0.2,0.14,0.96,0.17,1.34,0.05,0.44,-0.21,1.55,0,0.79,-0.03,-0.01,-0.06,-0.84,-0.08,-1.67,-0.1,-0.46,0.07,0.5,0.1,0.79,0,-0.03,-0.25,1.34,-0.02,0.57,-0.07,-0.26,-0.1,-1.12,-0.13,-1.96,-0.16,-1.72,-0.12,-1.59,-0.14,-1.8,-0.23,-2.59,-0.44,1.02,-0.03,0.25,-0.09,-0.61,-0.13,-1.49,-0.17,-2.35,-0.2,-3.08,-0.31,-3.8,-0.42,-4.52,-0.55,-5.28,-0.73]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.18_04","timeline":[{"name":"B_HAIR_TWIN.18","type":50,"frame":[{"duration":121,"value":[31.74,-1.69,30.24,-1.34,29.72,-0.99,27.43,-0.49,20.6,0.31,15.69,0.33,6.2,0.36,-4.88,0.38,-14.57,0.34,21.61,-1.14,18.99,-0.89,16.93,-0.63,13.79,-0.29,7.98,0.23,5.07,0.17,-0.82,0.13,-7.72,0.09,-13.7,0.02,11.13,-0.49,7.89,-0.34,4.81,-0.2,1.32,-0.02,-3.13,0.22,-4.52,0.08,-7.18,-0.05,-10.24,-0.16,-12.88,-0.26,1.78,0,0.03,0.05,-1.83,0.09,-3.68,0.13,-5.37,0.17,-6.49,0.07,-7.78,-0.07,-9.3,-0.23,-11.1,-0.41,2.37,0.01,0.78,0.01,-0.9,0,-2.59,-0.02,-4.2,-0.01,-3.23,0.14,-2.65,0.11,-2.97,-0.09,-4.71,-0.43,3.02,0.01,1.52,-0.03,-0.07,-0.07,-1.7,-0.1,-3.32,-0.12,-0.39,0.28,1.94,0.34,2.69,0.09,0.88,-0.42,3.09,0,1.58,-0.07,-0.02,-0.12,-1.68,-0.16,-3.33,-0.2,-0.91,0.13,1.02,0.2,1.59,0,-0.07,-0.5,2.69,-0.03,1.15,-0.13,-0.52,-0.21,-2.24,-0.27,-3.92,-0.32,-3.44,-0.25,-3.18,-0.28,-3.61,-0.47,-5.17,-0.88,2.05,-0.06,0.49,-0.18,-1.22,-0.27,-2.98,-0.33,-4.69,-0.39,-6.17,-0.62,-7.6,-0.84,-9.04,-1.1,-10.55,-1.46]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19","timeline":[{"name":"B_HAIR_TWIN.19_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.19_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.19_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.19_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.19_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_00"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_03","timeline":[{"name":"B_HAIR_TWIN.19","type":50,"frame":[{"duration":121,"value":[-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-6.02,0,-5.94,0,-5.8,-0.01,-5.69,-0.03,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.62,-0.04,-4.73,-0.12,-3.64,-0.23,-2.66,-0.33,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.21,-0.07,-3.53,-0.24,-1.48,-0.44,0.38,-0.62,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.21,-0.07,-3.65,-0.23,-1.78,-0.42,-0.06,-0.58,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.56,-0.04,-4.75,-0.12,-3.79,-0.22,-2.9,-0.3,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98,0,-5.98]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.19_04","timeline":[{"name":"B_HAIR_TWIN.19","type":50,"frame":[{"duration":121,"value":[-28.72,1.09,-28.59,1.04,-28.83,1.1,-29.13,1.23,-29.22,1.39,-29.69,1.3,-29.73,1.26,-29.95,1.26,-30.95,1.29,-28.26,0.64,-28.36,0.67,-28.76,0.8,-29.29,0.97,-29.77,1.12,-30.26,1.07,-30.36,1,-30.55,0.95,-31.3,0.93,-28.23,0.34,-28.33,0.46,-28.67,0.66,-29.2,0.87,-29.86,1.01,-30.39,0.99,-30.56,0.87,-30.72,0.72,-31.23,0.64,-28.67,0.33,-28.58,0.45,-28.68,0.64,-29.03,0.82,-29.69,0.93,-29.53,0.97,-28.64,0.95,-27.51,0.9,-26.65,0.87,-29.64,0.54,-29.1,0.53,-28.73,0.54,-28.69,0.57,-29.19,0.64,-26.77,0.74,-22.38,1.03,-17.26,1.34,-12.63,1.54,-30.24,0.72,-29.31,0.58,-28.5,0.43,-28.11,0.34,-28.48,0.37,-24.98,0.47,-18.35,0.9,-10.49,1.41,-3.32,1.77,-32.59,0.8,-32.2,0.53,-31.86,0.29,-32.13,0.16,-33.61,0.2,-28.99,0.25,-20.93,0.62,-11.48,1.1,-2.69,1.51,-43.05,0.71,-40.48,0.19,-37.86,-0.33,-36.15,-0.68,-36.33,-0.72,-33.31,-0.66,-27.23,-0.34,-19.84,0.1,-12.92,0.55,-54.92,0.54,-49.87,-0.25,-44.65,-1.03,-40.66,-1.58,-39.29,-1.68,-38.17,-1.63,-34.39,-1.39,-29.41,-1.01,-24.69,-0.55]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20","timeline":[{"name":"B_HAIR_TWIN.20_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.20_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.20_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.20_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.20_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_00","timeline":[{"name":"B_HAIR_TWIN.20","type":50,"frame":[{"duration":121,"value":[13.92,-0.01,13.76,0.01,13.42,0.06,13.08,0.11,12.92,0.14,13.08,0.12,13.42,0.09,13.77,0.06,13.94,0.05,13.92,-0.01,13.79,0.02,13.51,0.09,13.23,0.16,13.09,0.19,13.18,0.17,13.39,0.13,13.6,0.09,13.68,0.08,13.92,-0.02,13.82,0.02,13.61,0.12,13.41,0.21,13.29,0.25,13.36,0.23,13.48,0.17,13.58,0.11,13.62,0.09,13.89,-0.03,13.83,0.02,13.67,0.12,13.49,0.22,13.38,0.26,13.43,0.23,13.51,0.17,13.57,0.11,13.58,0.08,13.87,-0.01,13.89,0.04,13.74,0.12,13.54,0.2,13.41,0.23,13.39,0.2,13.45,0.14,13.51,0.09,13.45,0.06,13.88,0.01,13.95,0.04,13.76,0.1,13.49,0.14,13.31,0.16,13.24,0.13,13.3,0.09,13.35,0.07,13.24,0.05,14.1,0.03,14.05,0.04,13.7,0.07,13.28,0.08,13.03,0.08,12.98,0.06,13.08,0.05,13.17,0.05,13.09,0.04,14.25,0.04,14.06,0.04,13.53,0.04,12.97,0.04,12.68,0.03,12.69,0.03,12.83,0.03,12.97,0.04,12.96,0.04,14.3,0.07,13.98,0.05,13.27,0.01,12.57,-0.03,12.25,-0.05,12.35,-0.03,12.57,0,12.78,0.04,12.85,0.07]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_01","timeline":[{"name":"B_HAIR_TWIN.20","type":50,"frame":[{"duration":121,"value":[6.96,0,6.88,0.01,6.71,0.03,6.54,0.06,6.46,0.07,6.54,0.06,6.71,0.05,6.88,0.03,6.97,0.03,6.96,-0.01,6.89,0.01,6.76,0.04,6.62,0.08,6.55,0.09,6.59,0.09,6.7,0.07,6.8,0.05,6.84,0.04,6.96,-0.01,6.91,0.01,6.81,0.06,6.7,0.1,6.65,0.12,6.68,0.11,6.74,0.08,6.79,0.05,6.81,0.04,6.95,-0.01,6.92,0.01,6.84,0.06,6.75,0.11,6.69,0.13,6.71,0.12,6.75,0.08,6.79,0.05,6.79,0.04,6.94,0,6.95,0.02,6.87,0.06,6.77,0.1,6.7,0.12,6.69,0.1,6.73,0.07,6.75,0.04,6.73,0.03,6.94,0.01,6.97,0.02,6.88,0.05,6.75,0.07,6.66,0.08,6.62,0.06,6.65,0.05,6.68,0.03,6.62,0.02,7.05,0.01,7.03,0.02,6.85,0.03,6.64,0.04,6.51,0.04,6.49,0.03,6.54,0.03,6.58,0.02,6.54,0.02,7.12,0.02,7.03,0.02,6.76,0.02,6.48,0.02,6.34,0.01,6.34,0.01,6.42,0.01,6.48,0.02,6.48,0.02,7.15,0.04,6.99,0.03,6.64,0.01,6.28,-0.01,6.13,-0.03,6.18,-0.02,6.28,0,6.39,0.02,6.43,0.03]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.20_04","timeline":[{"name":"B_HAIR_TWIN.20","type":50,"frame":[{"duration":121,"value":[-14.43,0.25,-12.8,0.21,-11.34,0.2,-9.91,0.19,-8.4,0.16,-6.94,0.15,-5.37,0.12,-3.74,0.08,-2.13,0.05,-14.25,0.04,-12.7,0.05,-11.26,0.09,-9.84,0.13,-8.31,0.13,-6.96,0.12,-5.46,0.1,-3.88,0.06,-2.29,0.03,-14.38,-0.1,-12.83,-0.04,-11.36,0.04,-9.88,0.11,-8.27,0.13,-7.02,0.12,-5.59,0.09,-4.05,0.05,-2.47,0.01,-14.92,-0.09,-13.33,-0.04,-11.81,0.03,-10.26,0.09,-8.56,0.1,-7.36,0.11,-5.92,0.08,-4.33,0.03,-2.7,-0.01,-15.84,-0.01,-14.14,-0.01,-12.53,0.03,-10.89,0.05,-9.1,0.02,-7.93,0.06,-6.42,0.05,-4.7,0.02,-2.94,-0.01,-16.83,0.11,-14.9,0.05,-13.09,0.03,-11.24,-0.01,-9.24,-0.09,-8.18,0,-6.67,0.01,-4.91,-0.01,-3.11,-0.02,-17.38,0.2,-16.47,0.27,-15.81,0.49,-14.78,0.69,-12.74,0.72,-11.51,0.69,-9,0.43,-5.92,0.13,-2.97,-0.03,-16.83,0.2,-18.73,0.29,-21.06,0.47,-22.5,0.62,-21.69,0.66,-19.15,0.63,-14.13,0.41,-8.06,0.14,-2.4,-0.04,-15.54,0.06,-20.53,0.18,-26.13,0.29,-30.32,0.37,-31.1,0.4,-27.11,0.42,-19.41,0.3,-10.18,0.13,-1.62,-0.04]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21","timeline":[{"name":"B_HAIR_TWIN.21_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.21_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.21_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.21_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.21_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_00","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"value":[5.31,0,6.35,0.04,7.51,0.07,8.77,0.09,10.06,0.11,11.39,0.12,12.79,0.13,14.34,0.12,16.13,0.09,5.18,-0.01,6.29,0.06,7.51,0.11,8.8,0.15,10.13,0.18,11.42,0.19,12.77,0.19,14.23,0.17,15.84,0.13,5.06,-0.01,6.22,0.07,7.46,0.13,8.76,0.17,10.08,0.2,11.36,0.22,12.68,0.23,14.05,0.21,15.51,0.15,4.35,0,5.65,0.09,7.02,0.14,8.37,0.17,9.62,0.2,10.92,0.22,12.31,0.23,13.77,0.21,15.28,0.14,-1.72,0,0.53,0.15,2.89,0.29,5.07,0.4,6.74,0.45,8.4,0.44,10.38,0.35,12.55,0.23,14.82,0.09,-7.94,0.01,-4.75,0.22,-1.4,0.45,1.56,0.64,3.64,0.73,5.71,0.68,8.3,0.5,11.23,0.27,14.31,0.06,-5.81,0.08,-1.17,0.35,3.62,0.77,8.13,1.16,11.91,1.33,13.57,1.39,15.99,1.49,18.86,1.55,21.85,1.51,6.7,0.34,9.39,0.44,12.21,0.64,15.02,0.84,17.71,0.93,19.6,0.99,22.52,1.11,26,1.24,29.57,1.29,20.42,0.6,20.68,0.53,21.03,0.45,21.63,0.39,22.67,0.36,24.88,0.4,28.4,0.5,32.61,0.63,36.86,0.76]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_01","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"offset":54,"value":[-0.49,0,-0.38,0.02,-0.24,0.03,-0.16,0.03,-0.2,0.03,-0.23,0.03,-0.17,0.03,-0.08,0.02,0,0,-5.75,0,-4.74,0.11,-3.63,0.22,-2.73,0.31,-2.36,0.35,-2.1,0.31,-1.47,0.22,-0.7,0.1,0,0,-11,0,-9.1,0.19,-7.01,0.42,-5.29,0.6,-4.51,0.68,-3.97,0.6,-2.77,0.42,-1.32,0.19,0,0,-10.24,0,-8.49,0.18,-6.58,0.38,-4.99,0.56,-4.2,0.63,-3.65,0.56,-2.55,0.38,-1.22,0.17,0,0,-5.32,0,-4.42,0.09,-3.43,0.2,-2.61,0.29,-2.18,0.33,-1.89,0.29,-1.31,0.2,-0.63,0.09]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_03","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"value":[43.85,0.65,42.67,0.84,41.36,1.05,40.3,1.23,39.86,1.3,40.01,1.23,40.36,1.05,40.8,0.84,41.19,0.65,36.37,0.65,35.38,0.38,34.31,-0.35,33.4,-1.1,32.87,-1.44,32.66,-1.1,32.58,-0.35,32.54,0.38,32.49,0.65,28.09,0.65,27.32,0.38,26.51,-0.27,25.76,-0.93,25.17,-1.23,24.8,-0.93,24.48,-0.27,24.18,0.38,23.88,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.21_04","timeline":[{"name":"B_HAIR_TWIN.21","type":50,"frame":[{"duration":121,"value":[43.85,0.65,42.67,0.84,41.36,1.05,40.3,1.23,39.86,1.3,40.01,1.23,40.36,1.05,40.8,0.84,41.19,0.65,36.37,0.65,35.38,0.38,34.31,-0.35,33.4,-1.1,32.87,-1.44,32.66,-1.1,32.58,-0.35,32.54,0.38,32.49,0.65,28.09,0.65,27.32,0.38,26.51,-0.27,25.76,-0.93,25.17,-1.23,24.8,-0.93,24.48,-0.27,24.18,0.38,23.88,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65,18.6,0.65]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03","timeline":[{"name":"D_HAIR_TWIN.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.03_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.03_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_00","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[155.94,2.82,77.85,16.35,-47.4,-4.83,-80.69,-6.42,-97.91,5.26,-35.67,16.31,11.56,19.46,27.12,-28.41,-9.2,12.85,-70.62,2.47,-71.36,-0.14,-60.2,-4.73,-68.94,-4.68,-26.74,-9.69,23.51,-7.16]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_01","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[78.1,-1.86,76.94,0.25,-47.4,-4.83,-47.56,-8.2,-1.71,-0.01,-30.58,-0.1,-26.34,18.01,-5.13,-14.65,-28.4,9.21,-38.2,3.36,-37.27,-3.29,-36.82,6.64,-47.49,-6.77,-26.28,-9.74,19.31,-3.25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_03","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[-18.36,3.02,-37.5,-4.02,-3.55,0,-4.55,0,-6.23,0,28.38,7.03,106.35,1,51.56,6.03,68.47,3.93,44.36,0.44,15.4,4.26,51.64,0.5,-4.13,0,23.99,3.01,-11.42,1.6]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.03_04","timeline":[{"name":"D_HAIR_TWIN.03","type":22,"frame":[{"duration":121,"value":[-18.36,3.02,-37.5,-4.02,-3.55,0,-4.55,0,-6.23,0,28.38,7.03,106.35,1,51.56,6.03,68.47,3.93,44.36,0.44,15.4,4.26,51.64,0.5,-4.13,0,23.99,3.01,-11.42,1.6]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02","timeline":[{"name":"D_HAIR_TWIN.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_00","timeline":[{"name":"D_HAIR_TWIN.02","type":22,"frame":[{"duration":121,"value":[30.57,0.18,30.68,0.18,30.77,0.18,30.82,0.14,29.97,0.08,30.54,0.07,29.45,0.09,27.74,0.07,26.79,0.02,28.57,0.06,29.54,0.09,30.41,0.06,30.54,0.16,30.76,0.18,30.59,0.18,30.72,0.18,30.85,0.12,30.94,0.07,29.55,0.09]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.02_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11","timeline":[{"name":"D_HAIR_TWIN.11_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.11_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.11_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.11_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.11_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_00","timeline":[{"name":"D_HAIR_TWIN.11","type":22,"frame":[{"duration":121,"value":[71.53,1.03,71.18,1,71.65,1.04,71.83,1.08,69.76,1.11,68.04,1.12,63.87,1.07,60.06,0.98,61.84,0.87,63.8,0.65,65.91,0.56,69.85,0.75,72.35,1.05,71.65,1.04,71.57,1.04,71.98,1.05,71.98,0.95,68.38,0.87,66.76,0.86]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_01","timeline":[{"name":"D_HAIR_TWIN.11","type":22,"frame":[{"duration":121,"value":[35.76,0.52,35.59,0.5,35.82,0.52,35.92,0.54,34.88,0.55,34.02,0.56,31.93,0.54,30.03,0.49,30.92,0.43,31.9,0.33,32.95,0.28,34.93,0.38,36.18,0.53,35.82,0.52,35.79,0.52,35.99,0.52,35.99,0.47,34.19,0.44,33.38,0.43]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.11_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01","timeline":[{"name":"B_HAIR_TWIN.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_00","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-20,41.71,-9.28,31.92,1.66,22.98,10.6,21.04,17,27,23.4,32.96,24.88,30.21,28.3,25.32,32,20.29,-5.06,53.09,0.94,40.3,6.79,28.44,11.84,24.53,14.55,31.7,17.26,38.88,18.07,34.89,20.26,24.6,22.74,13.81,8.41,64.12,10,49.15,11.03,35.02,12.49,29.61,12.03,37.08,11.57,44.54,11.79,39.29,12.85,23.99,14.19,7.82,7.92,64.81,8.32,54.01,9.34,44.13,9.45,41.15,9.87,42.64,10.18,45.18,10.31,38.38,11.45,21.08,12.49,2.82,21.01,52.97,19.19,44.03,17.61,36.63,16.03,35.88,13.75,29.33,11.06,26.91,10.23,21.56,11.06,8.87,11.75,-4.46,37.48,41.96,33.18,33.45,28.54,26.98,25.02,27.68,18.89,14.33,12.05,8.19,10.02,5.8,10.08,-0.7,10.17,-7.52,37.56,27.75,32.68,16.52,30.09,5.47,25.74,3.21,18.37,-9.67,10.57,-13.46,8.14,-10.95,9.29,-9.86,8.91,-8.59,59.14,17.23,49.02,1.21,41.63,-17.96,34.24,-26.77,25.94,-39.69,17.86,-42.89,13.4,-35.05,9.59,-23.94,4.63,-12.01,78.03,5.75,62.8,-13.38,51.28,-39.47,41.11,-53.98,33.29,-67.98,26.31,-71.87,19.73,-59.31,10.08,-38.32,0,-15.71]},{"duration":60,"tweenEasing":0,"value":[-18,69.73,-10.05,56.24,-1.69,43.88,6.43,40.71,11,43.02,15.57,45.33,16.22,41.79,17.07,35.19,18,28.31,-4.11,73.43,0.68,58.21,5.73,44.04,10.52,39.3,12.25,43.42,13.99,47.55,14.37,43.28,15.23,32.83,16.15,21.83,8.72,76.85,10.43,60.61,12.14,45.26,13.81,39.36,13.16,44.57,12.5,49.77,12.66,44.73,13.52,30.68,14.44,15.84,9.84,72.66,10.23,61.05,11.25,50.41,11.37,47.07,11.82,47.75,12.17,49.48,12.31,43.07,13.45,27.38,14.49,10.84,22.01,58.99,20.19,50.06,18.61,42.66,17.07,41.91,15.25,35.35,13.01,32.92,12.23,27.81,13.06,15.98,13.75,3.56,37.56,46.15,33.26,38.45,28.63,32.74,25.19,33.81,19.94,21.25,13.97,15.92,12.02,13.61,12.08,7.21,12.17,0.5,37.78,32.21,32.89,21.77,30.31,11.46,26.04,9.54,19.48,-2.55,12.5,-5.54,10.14,-2.93,11.29,-1.84,10.91,-0.56,60.21,23.4,50.09,7.79,42.7,-11,35.36,-19.62,27.48,-32.14,19.82,-34.92,15.4,-27.02,11.59,-15.92,6.63,-3.99,80.03,13.77,64.8,-5.36,53.28,-31.45,43.11,-45.96,35.29,-59.96,28.31,-63.85,21.73,-51.29,12.08,-30.3,2,-7.69]},{"value":[-118.67,95.76,-106.22,75.26,-93.35,56.59,-78.26,53.13,-66.17,48.3,-55.76,44.31,-47.73,44.54,-39.27,34.1,-30.67,22.34,-70,92.71,-62.25,73.43,-54.54,55.97,-44.67,51.48,-37.64,48.58,-31.67,46.2,-27.04,44.02,-22.77,32.42,-17.71,19.56,-25.2,89.38,-21.86,71.43,-18.94,55.01,-14.05,49.87,-11.75,48.86,-9.87,48.06,-8.4,43.7,-7.66,30.87,-5.73,16.99,-16.57,80.43,-15.68,65.92,-14.85,52.8,-12.96,49.52,-9.8,48.13,-6.75,47.8,-6.13,41.59,-4.08,27.51,-2.01,12.69,-1.65,64.01,-4.65,53.18,-9.35,44.16,-10.53,43.61,-8.09,35.43,-6.06,31.33,-5.99,26.06,-3.45,15.08,-0.92,3.59,16.64,48.44,12.83,39.06,7.7,31.83,4.37,32.77,0.14,19.85,-4.81,14.09,-6,11.61,-3.41,5.3,-0.67,-1.3,16.45,34.02,13.14,21.99,12.12,10.21,8.2,7.79,0.83,-4.31,-6.97,-7.3,-8.77,-4.69,-5.26,-3.59,-3.29,-2.32,36.32,24.35,27.02,7.91,20.44,-11.6,13.28,-20.52,4.98,-33.04,-3.11,-35.82,-7.23,-27.94,-9.8,-16.8,-13.56,-4.89,53.36,13.8,38.14,-5.33,26.61,-31.43,16.45,-45.93,8.63,-59.94,1.64,-63.82,-4.93,-51.26,-14.59,-30.27,-24.67,-7.66]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_01","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-17,6.84,-10.25,3.8,-3.5,1.04,1.39,0.68,5.5,5.49,9.61,10.3,10.77,9.31,13.76,7.72,17,6.13,-9,16.37,-5.38,11.19,-2.1,6.36,0.58,4.9,2.42,9.99,4.27,15.08,4.88,13.26,6.64,8.2,8.67,2.89,-1.95,25.69,-1.21,18.83,-1.06,12.32,-0.42,9.96,-0.55,14.79,-0.68,19.63,-0.54,16.96,0.08,8.67,0.97,-0.1,-2.99,28.48,-2.8,23.5,-2.29,18.95,-2.23,17.62,-2.05,18.77,-1.91,20.44,-1.85,16.9,-1.28,7.43,-0.76,-2.6,4.01,23.47,3.1,19.03,2.31,15.34,1.49,14.93,0.13,11.63,-1.45,10.43,-1.88,7.68,-1.47,0.9,-1.13,-6.24,12.7,18.88,10.55,14.22,8.23,10.61,6.42,10.76,2.93,3.66,-0.93,0.2,-1.99,-1.02,-1.96,-4.31,-1.92,-7.77,12.67,11.65,10.22,5.64,8.94,-0.33,6.73,-1.55,2.63,-8.34,-1.69,-10.65,-2.93,-9.48,-2.35,-8.94,-2.55,-8.3,23.03,5.53,17.95,-2.67,14.29,-12.54,10.58,-16.96,6.2,-23.57,1.94,-25.38,-0.3,-21.53,-2.2,-15.99,-4.69,-10.01,32.01,-1.14,24.4,-10.7,18.64,-23.75,13.56,-31,9.65,-38,6.15,-39.94,2.87,-33.67,-1.96,-23.17,-7,-11.87]},{"duration":60,"tweenEasing":0,"value":[-9,34.86,-5.03,28.12,-0.84,21.94,3.21,20.36,5.5,21.51,7.79,22.66,8.11,20.9,8.54,17.6,9,14.16,-2.06,36.72,0.34,29.09,2.84,21.97,5.26,19.66,6.13,21.71,6.99,23.77,7.18,21.65,7.61,16.42,8.07,10.92,4.36,38.43,5.22,30.28,6.06,22.56,6.91,19.69,6.58,22.28,6.25,24.87,6.33,22.38,6.76,15.35,7.22,7.92,4.92,36.33,5.12,30.53,5.63,25.22,5.68,23.54,5.91,23.87,6.09,24.74,6.15,21.57,6.72,13.71,7.24,5.42,11.01,29.49,10.1,25.05,9.31,21.36,8.53,20.95,7.63,17.65,6.51,16.45,6.12,13.92,6.53,8,6.88,1.78,18.78,23.08,16.63,19.23,14.32,16.38,12.59,16.89,9.97,10.59,6.99,7.94,6.01,6.8,6.04,3.61,6.08,0.25,18.89,16.11,16.44,10.89,15.16,5.67,13.03,4.78,9.74,-1.22,6.24,-2.73,5.07,-1.46,5.65,-0.92,5.45,-0.28,30.11,11.7,25.02,3.91,21.36,-5.57,17.69,-9.81,13.74,-16.01,9.9,-17.41,7.7,-13.5,5.8,-7.97,3.31,-1.99,40.01,6.88,32.4,-2.68,26.64,-15.73,21.56,-22.98,17.65,-29.98,14.15,-31.92,10.87,-25.65,6.04,-15.15,1,-3.84]},{"value":[-91.67,59.89,-81.81,46.6,-71.84,34.54,-61.71,32.48,-53.17,26.41,-44.62,21.61,-37.28,23.64,-30.95,16.51,-24.67,8.18,-52.26,55.46,-45.7,43.39,-39.15,32.48,-32.13,30.04,-27.28,25.71,-22.43,22.17,-18.21,22.42,-15.27,16.01,-11.71,8.65,-16.01,50.85,-12.65,40.02,-9.37,30.18,-5.35,27.53,-3.88,25.01,-2.4,22.8,-1.09,21.35,-0.92,15.52,0.27,9.07,-8.49,44.1,-7.8,35.43,-7.46,27.64,-5.64,25.98,-2.71,24.26,0.16,23.06,0.71,20.07,2.18,13.83,3.75,7.27,0.34,34.52,-1.74,28.22,-5.65,22.94,-6.07,22.66,-2.71,17.71,0.44,14.82,0.89,12.17,3.02,7.1,5.21,1.81,10.86,25.36,9.2,19.85,6.38,15.52,4.76,15.86,3.18,9.15,1.22,6.08,1,4.8,3.55,1.69,6.25,-1.55,10.57,17.92,9.68,11.11,9.98,4.4,8.19,3.03,4.09,-2.97,-0.23,-4.49,-0.85,-3.21,2.1,-2.68,4.26,-2.04,19.22,12.65,14.94,4.04,12.1,-6.2,8.61,-10.71,4.24,-16.91,-0.03,-18.31,-1.93,-14.41,-2.6,-8.86,-3.87,-2.89,26.35,6.91,18.74,-2.65,12.97,-15.7,7.89,-22.95,3.98,-29.95,0.49,-31.9,-2.8,-25.62,-7.63,-15.12,-12.67,-3.82]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_02","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-10,-26.02,-7.22,-22.32,-4.66,-18.9,-3.83,-17.68,-2,-14.02,-0.17,-10.36,0.66,-9.58,3.22,-7.87,6,-6.02,-8.95,-18.35,-7.71,-15.89,-6.94,-13.62,-6.69,-12.75,-5.7,-9.72,-4.72,-6.69,-4.3,-6.39,-2.97,-6.22,-1.41,-6.02,-8.31,-10.74,-8.42,-9.44,-9.11,-8.26,-9.32,-7.73,-9.13,-5.49,-8.93,-3.25,-8.87,-3.4,-8.68,-4.67,-8.25,-6.02,-9.91,-5.85,-9.91,-5.03,-9.91,-4.27,-9.92,-3.92,-9.96,-3.11,-10,-2.3,-10,-2.66,-10,-4.28,-10,-6.02,-9,-4.02,-9,-4.02,-9,-4.02,-9.04,-4.02,-9.5,-4.02,-9.96,-4.02,-10,-4.24,-10,-5.1,-10,-6.02,-8.09,-2.19,-8.09,-3.01,-8.09,-3.77,-8.17,-4.13,-9.04,-4.94,-9.92,-5.74,-10,-5.82,-10,-5.91,-10,-6.02,-8.22,-2.46,-8.22,-3.26,-8.22,-4.01,-8.3,-4.34,-9.11,-5.13,-9.92,-5.92,-10,-6.02,-10,-6.02,-10,-6.02,-9.07,-4.17,-9.07,-4.58,-9.07,-4.97,-9.11,-5.15,-9.54,-5.56,-9.96,-5.97,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02,-10,-6.02]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-70.67,24.03,-63.39,17.94,-56.32,12.5,-51.16,11.84,-46.17,4.53,-39.49,-1.1,-32.82,2.75,-28.64,-1.09,-24.67,-5.97,-40.51,18.2,-35.15,13.35,-29.74,9.07,-25.59,8.59,-22.92,2.85,-19.2,-1.85,-15.39,0.79,-13.76,-0.42,-11.71,-2.27,-12.82,12.31,-9.44,8.62,-5.79,5.41,-2.66,5.17,-2,1.16,-0.93,-2.44,0.22,-1.03,-0.17,0.15,0.27,1.15,-6.41,7.77,-5.91,4.9,-6.08,2.45,-4.33,2.44,-1.62,0.38,1.08,-1.68,1.56,-1.51,2.45,0.11,3.51,1.86,-3.67,5.03,-4.83,3.19,-7.95,1.65,-7.61,1.72,-3.34,0.03,0.93,-1.65,1.77,-1.76,3.48,-0.9,5.33,0.03,-0.92,2.29,-0.43,0.64,-0.94,-0.82,-0.83,-1.01,0.2,-1.45,1.24,-1.88,1.99,-2,4.51,-1.91,7.16,-1.8,-1.32,1.81,0.24,0.21,1.82,-1.28,2.16,-1.75,1.35,-1.75,0.53,-1.75,1.08,-1.75,3.45,-1.75,5.8,-1.75,-3.89,0.95,-3.08,0.13,-2.26,-0.65,-2.08,-0.9,-2.5,-0.9,-2.92,-0.9,-2.64,-0.9,-1.39,-0.9,-0.19,-0.9,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03,-6.67,0.03]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_03","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-2.67,-29.48,-0.35,-26.39,1.79,-23.13,2.24,-14.04,3.29,0.89,3.64,16.87,3.36,28.95,4.79,40.76,6.33,53.09,-2.68,-20.01,-2.99,-14.84,-4.05,-9.64,-4.71,-1.4,-5.19,13.64,-6.74,29.17,-7.5,37.31,-6.56,41.89,-5.24,46.49,-3.89,-10.41,-6.6,-4.45,-10.46,1.33,-12.09,8.16,-13.69,24.24,-16.75,40.26,-17.9,44.96,-17.19,42.71,-15.93,39.95,-9.77,-3.1,-11.9,2.29,-13.93,7.48,-15.37,12.55,-16.52,26.94,-19.01,41.01,-20.11,44.56,-19.55,40.37,-18.54,35.4,-0.29,-0.87,-2.83,4.21,-5.31,9.24,-8.18,13.99,-10.75,21.77,-13.53,29.55,-14.78,33.13,-16.29,31.8,-17.17,29.91,8.76,-0.74,5.54,4.03,2.18,8.9,-2.34,13.57,-7.28,15.55,-11.33,17.83,-12.31,21.69,-14.11,23.22,-15.8,24.43,11.91,-3,7.9,1.31,3.76,5.7,-1.77,10.36,-7.21,13.35,-11.18,16.66,-11.92,20.93,-13.59,22.33,-15.78,23.36,16.57,-6.42,11.48,-1.83,6.22,2.74,-0.1,7.33,-4.97,12.94,-8.04,18.72,-9.13,22.68,-12.47,22.2,-16.2,21.23,21.33,-10.12,15.11,-5.14,8.68,-0.3,1.51,4.27,-3.04,12.39,-5.49,20.51,-6.87,24.18,-11.57,21.86,-16.67,18.91]},{"duration":60,"tweenEasing":0,"value":[7.33,-3.46,6.87,-4.07,6.44,-4.23,6.07,3.63,5.29,14.91,3.81,27.23,2.71,38.53,1.57,48.63,0.33,59.11,6.27,-1.67,4.71,1.04,2.89,3.96,1.97,11.35,0.51,23.36,-2.02,35.87,-3.2,43.69,-3.59,48.11,-3.83,52.51,4.43,0.33,1.82,4.98,-1.35,9.58,-2.76,15.89,-4.58,29.73,-7.83,43.51,-9.03,48.38,-8.52,47.39,-7.68,45.97,0.15,2.75,-1.98,7.33,-4.01,11.74,-5.45,16.47,-6.57,30.05,-9.01,43.31,-10.11,47.22,-9.55,44.65,-8.54,41.42,8.71,3.15,6.17,8.24,3.69,13.27,0.86,18.01,-1.25,25.79,-3.58,33.56,-4.78,37.37,-6.29,36.89,-7.17,35.93,16.85,1.45,13.62,7.04,10.27,12.67,5.83,17.7,1.76,20.48,-1.41,23.57,-2.31,27.51,-4.11,29.13,-5.8,30.45,20.13,-0.54,16.12,4.57,11.98,9.71,6.53,14.7,1.89,18.48,-1.26,22.59,-1.92,26.95,-3.59,28.35,-5.78,29.39,25.64,-2.25,20.55,2.75,15.3,7.71,9.01,12.48,4.57,18.5,1.92,24.68,0.87,28.71,-2.47,28.23,-6.2,27.25,31.33,-4.1,25.11,0.88,18.68,5.72,11.51,10.29,6.96,18.41,4.51,26.54,3.13,30.2,-1.57,27.88,-6.67,24.93]},{"value":[-56.33,19.57,-47.67,13.33,-39.32,8.16,-34.05,15.43,-29.38,18.93,-23.72,25.18,-18.66,40.28,-17.76,46.54,-17.33,52.14,-27.25,15.53,-21.76,13.61,-16.71,12.51,-13.11,19.43,-12.07,25.26,-11.05,32.62,-8.78,43.07,-8.84,46.47,-8.54,49.24,-1.4,11.63,0.85,12.62,2.62,14.11,4.61,20.15,2.67,29.49,-0.27,39.21,-0.51,45.59,-0.94,46.15,-0.41,46.12,0.74,9.52,0.4,11.24,-0.54,13.19,0.01,17.85,0.71,28.95,0.1,39.72,-0.7,43.88,0.33,43.33,1.97,42.27,12.04,7.18,9.03,10.45,4.1,13.89,1.72,18.68,3.41,24.57,4.89,30.46,4.43,34.17,4.42,34.76,5.17,34.96,22.92,2.74,20.29,6.69,16.47,10.83,12.13,15.67,9.06,18.01,6.87,20.66,6.72,24.46,7.44,26.19,8.37,27.65,25.81,0.27,23.36,3.78,20.8,7.43,15.69,11.94,10.24,15.73,6.27,19.83,6.16,24.2,6.86,25.6,7.03,26.63,28.75,-2.3,24.47,1.88,20.04,6.07,13.94,10.58,9.07,16.6,5.99,22.78,5.23,26.8,3.13,26.33,0.61,25.35,31.67,-5.08,25.44,-0.1,19.01,4.75,11.84,9.32,7.29,17.44,4.85,25.56,3.46,29.23,-1.24,26.91,-6.33,23.96]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.01_04","timeline":[{"name":"B_HAIR_TWIN.01","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[4.67,-32.94,6.52,-30.46,8.23,-27.36,8.3,-10.41,8.57,15.79,7.45,44.1,6.07,67.49,6.36,89.38,6.67,112.2,3.59,-21.68,1.73,-13.8,-1.15,-5.69,-2.74,9.95,-4.69,37,-8.76,65.03,-10.7,80.99,-10.15,90.01,-9.07,98.99,0.54,-10.09,-4.79,0.54,-11.8,10.9,-14.85,24.05,-18.27,53.96,-24.58,83.77,-26.93,93.26,-25.68,90.06,-23.61,85.92,-9.62,-0.35,-13.88,9.62,-17.94,19.22,-20.82,29,-23.09,56.99,-28.01,84.34,-30.22,91.77,-29.1,85.03,-27.08,76.81,8.42,2.29,3.33,12.45,-1.62,22.52,-7.31,32,-12.01,47.55,-17.12,63.11,-19.57,70.49,-22.59,68.69,-24.33,65.84,25.61,0.71,19.16,11.07,12.44,21.57,3.5,31.28,-5.5,36.03,-12.75,41.41,-14.61,49.2,-18.21,52.35,-21.59,54.87,32.04,-3.54,24.02,5.88,15.72,15.42,4.76,25.07,-5.33,31.84,-12.45,39.24,-13.84,47.88,-17.17,50.69,-21.55,52.75,42.21,-8.67,32.03,0.92,21.5,10.45,8.91,19.81,-0.41,31.45,-6.12,43.4,-8.27,51.38,-14.94,50.44,-22.41,48.47,52.67,-14.23,40.22,-4.27,27.35,5.42,13.02,14.56,3.92,30.81,-0.97,47.05,-3.74,54.39,-13.15,49.75,-23.33,43.84]},{"duration":60,"tweenEasing":0,"value":[14.67,-6.92,13.74,-8.15,12.89,-8.46,12.13,7.27,10.57,29.81,7.62,54.47,5.42,77.07,3.14,97.26,0.67,118.22,12.53,-3.34,9.41,2.06,5.78,7.88,3.94,22.7,1,46.72,-4.05,71.74,-6.4,87.37,-7.18,96.23,-7.67,105.01,8.85,0.65,3.62,9.97,-2.69,19.15,-5.53,31.78,-9.16,59.45,-15.67,87.02,-18.06,96.69,-17.02,94.76,-15.36,91.94,0.3,5.5,-3.96,14.65,-8.03,23.49,-10.9,32.92,-13.13,60.09,-18.02,86.63,-20.22,94.44,-19.1,89.31,-17.08,82.83,17.42,6.31,12.33,16.47,7.38,26.54,1.73,36.02,-2.51,51.58,-7.16,67.13,-9.57,74.73,-12.59,73.79,-14.33,71.86,33.69,2.9,27.25,14.08,20.54,25.35,11.67,35.4,3.54,40.97,-2.83,47.15,-4.61,55.02,-8.21,58.26,-11.59,60.9,40.26,-1.08,32.24,9.13,23.94,19.43,13.05,29.4,3.78,36.96,-2.52,45.16,-3.84,53.9,-7.17,56.71,-11.55,58.77,51.29,-4.5,41.1,5.5,30.58,15.42,18.02,24.96,9.13,37,3.84,49.37,1.73,57.4,-4.94,56.46,-12.41,54.49,62.67,-8.21,50.22,1.76,37.35,11.44,23.02,20.59,13.92,36.83,9.03,53.07,6.26,60.41,-3.15,55.77,-13.33,49.86]},{"value":[-42,15.11,-31.94,8.72,-22.31,3.81,-16.94,19.02,-12.59,33.34,-7.95,51.45,-4.5,77.82,-6.87,94.17,-10,110.24,-13.98,12.87,-8.36,13.85,-3.68,15.94,-0.63,30.27,-1.24,47.68,-2.92,67.09,-2.17,85.34,-3.93,93.37,-5.37,100.74,10.03,10.96,11.14,16.63,11.04,22.8,11.88,35.12,7.35,57.83,0.4,80.86,-1.24,92.16,-1.71,92.13,-1.09,91.09,7.89,11.27,6.71,17.56,5,23.94,4.35,33.25,3.05,57.51,-0.87,81.14,-2.97,89.27,-1.79,86.56,0.43,82.69,27.75,9.34,22.89,17.69,16.14,26.15,11.05,35.65,10.15,49.11,8.84,62.56,7.09,70.08,5.36,70.43,5,69.89,46.77,3.19,41.01,12.73,33.88,22.48,25.1,32.37,17.93,37.48,12.5,43.2,11.46,50.91,10.36,54.3,9.57,57.09,52.94,-1.27,46.48,7.34,39.75,16.16,29.21,25.65,19.13,33.21,12.01,41.41,11.25,50.14,10.28,52.96,8.25,55.02,61.4,-5.55,52.02,3.62,42.31,12.78,29.95,22.06,20.63,34.11,14.91,46.47,13.1,54.48,7.66,53.57,1.41,51.59,70,-10.18,57.55,-0.22,44.69,9.46,30.36,18.61,21.25,34.86,16.36,51.1,13.59,58.44,4.18,53.8,-6,47.89]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08","timeline":[{"name":"B_HAIR_TWIN.08_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.08_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.08_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.08_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.08_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_00","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-43.39,6.37,-47.11,6.34,-50.46,6.31,-53.48,6.26,-56.2,6.21,-58.78,6.16,-61.37,6.1,-63.97,6.01,-66.59,5.89,-43.08,6.38,-46.79,6.33,-50.13,6.28,-53.13,6.23,-55.84,6.18,-58.42,6.11,-61.01,6.01,-63.6,5.9,-66.21,5.79,-42.78,6.36,-46.49,6.29,-49.8,6.22,-52.78,6.14,-55.49,6.08,-58.07,6.02,-60.65,5.93,-63.24,5.83,-65.83,5.74,-42.5,6.32,-46.2,6.23,-49.49,6.13,-52.44,6.05,-55.14,5.98,-57.72,5.92,-60.3,5.86,-62.88,5.79,-65.46,5.72,-42.23,6.23,-45.92,6.13,-49.18,6.04,-52.1,5.96,-54.77,5.9,-57.36,5.85,-59.94,5.8,-62.52,5.76,-65.09,5.72,-42.14,6.15,-45.76,6.07,-48.95,6,-51.81,5.93,-54.45,5.88,-56.88,5.84,-59.32,5.81,-61.77,5.79,-64.24,5.75,-41.94,6.12,-45.46,6.05,-48.53,5.99,-51.28,5.94,-53.85,5.9,-56.24,5.86,-58.64,5.84,-61.06,5.82,-63.53,5.78,-41.67,6.1,-45.04,6.05,-47.96,6.01,-50.56,5.98,-53,5.95,-55.44,5.91,-57.9,5.88,-60.4,5.84,-62.96,5.79,-41.36,6.1,-44.54,6.07,-47.26,6.05,-49.66,6.04,-51.93,6.03,-54.52,5.98,-57.13,5.93,-59.8,5.87,-62.54,5.8]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_01","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-2.98,0.21,-5.56,0.16,-8.15,0.11,-10.73,0.06,-13.31,0.01,-15.9,-0.04,-18.48,-0.09,-21.06,-0.15,-23.65,-0.2,-2.62,0.2,-5.2,0.15,-7.78,0.1,-10.36,0.05,-12.95,0,-15.53,-0.05,-18.11,-0.1,-20.7,-0.15,-23.28,-0.2,-2.25,0.2,-4.83,0.15,-7.41,0.1,-10,0.05,-12.58,0,-15.16,-0.05,-17.75,-0.1,-20.33,-0.15,-22.91,-0.2,-1.88,0.2,-4.47,0.15,-7.05,0.1,-9.63,0.05,-12.21,0,-14.8,-0.05,-17.38,-0.1,-19.96,-0.15,-22.55,-0.2,-1.52,0.2,-4.1,0.15,-6.68,0.1,-9.26,0.05,-11.85,0,-14.43,-0.05,-17.01,-0.1,-19.6,-0.15,-22.18,-0.2,-1.15,0.2,-3.73,0.15,-6.32,0.1,-8.9,0.05,-11.48,0,-14.06,-0.05,-16.65,-0.1,-19.23,-0.15,-21.81,-0.2,-0.78,0.2,-3.37,0.15,-5.95,0.1,-8.53,0.05,-11.11,0,-13.7,-0.05,-16.28,-0.1,-18.86,-0.15,-21.45,-0.2,-0.42,0.2,-3,0.15,-5.58,0.1,-8.17,0.05,-10.75,0,-13.33,-0.05,-15.91,-0.1,-18.5,-0.15,-21.08,-0.2,-0.05,0.2,-2.63,0.15,-5.22,0.09,-7.8,0.04,-10.38,-0.01,-12.96,-0.06,-15.55,-0.11,-18.13,-0.16,-20.71,-0.21]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_03","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-17.31,-2.66,-16.3,-3.22,-15.15,-3.78,-13.92,-4.36,-12.64,-4.97,-11.64,-5.65,-11.22,-6.33,-11.14,-7.01,-11.17,-7.67,-14.38,-2.78,-12.69,-3.37,-10.89,-3.96,-9.11,-4.56,-7.52,-5.19,-6.78,-5.84,-6.73,-6.49,-7.06,-7.13,-7.49,-7.76,-11.47,-2.9,-9.07,-3.52,-6.57,-4.13,-4.22,-4.74,-2.26,-5.38,-1.78,-6.01,-2.05,-6.64,-2.75,-7.27,-3.55,-7.87,-8.51,-2.97,-5.58,-3.61,-2.56,-4.24,0.19,-4.87,2.32,-5.5,2.76,-6.12,2.33,-6.74,1.43,-7.35,0.43,-7.93,-5.44,-2.93,-2.37,-3.59,0.76,-4.25,3.51,-4.9,5.45,-5.53,6.2,-6.14,5.95,-6.72,5.15,-7.29,4.26,-7.86,-3.42,-2.99,-0.58,-3.6,2.32,-4.23,4.94,-4.87,6.95,-5.5,7.6,-6.09,7.51,-6.66,6.99,-7.23,6.36,-7.79,-1.34,-3.02,1.02,-3.57,3.44,-4.14,5.7,-4.72,7.55,-5.32,8.38,-5.92,8.69,-6.53,8.68,-7.14,8.54,-7.72,0.78,-3.05,2.55,-3.53,4.4,-4.01,6.19,-4.52,7.78,-5.08,8.89,-5.7,9.72,-6.37,10.32,-7.03,10.78,-7.65,2.91,-3.09,4.14,-3.48,5.44,-3.88,6.79,-4.32,8.14,-4.84,9.51,-5.49,10.82,-6.2,12.02,-6.92,13.06,-7.57]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.08_04","timeline":[{"name":"B_HAIR_TWIN.08","type":50,"frame":[{"duration":121,"value":[-29.22,-2.23,-26.6,-3.42,-23.92,-4.53,-21.25,-5.75,-18.71,-7.26,-16.49,-7.62,-14.86,-8.13,-13.71,-8.71,-12.91,-9.25,-24.22,-4.19,-21.15,-5.26,-18.01,-6.22,-14.97,-7.26,-12.17,-8.54,-10.4,-8.78,-9.55,-9.02,-9.31,-9.28,-9.4,-9.58,-19.07,-6.36,-15.58,-7.27,-12.04,-8.03,-8.66,-8.83,-5.63,-9.86,-4.31,-9.98,-4.19,-9.96,-4.84,-9.94,-5.78,-10.01,-14.08,-7.97,-10.3,-8.76,-6.49,-9.4,-2.9,-10.04,0.21,-10.84,1.31,-10.86,0.86,-10.65,-0.49,-10.38,-2.11,-10.25,-9.55,-8.3,-5.71,-9.05,-1.87,-9.77,1.69,-10.46,4.68,-11.11,5.97,-11.09,5.31,-10.74,3.55,-10.3,1.55,-10.01,-8.3,-8.22,-4.89,-8.88,-1.51,-9.55,1.67,-10.19,4.51,-10.76,5.52,-10.74,4.94,-10.41,3.42,-10.01,1.61,-9.8,-7.77,-8.05,-4.92,-8.57,-2.16,-9.1,0.51,-9.61,3.06,-10.05,4.27,-10.1,4.17,-9.92,3.25,-9.7,1.96,-9.62,-7.48,-7.85,-5.29,-8.21,-3.23,-8.56,-1.18,-8.88,0.99,-9.18,2.63,-9.32,3.23,-9.35,3.1,-9.36,2.53,-9.44,-6.94,-7.69,-5.47,-7.89,-4.17,-8.04,-2.78,-8.18,-1.05,-8.32,1.04,-8.55,2.37,-8.78,3.07,-9,3.24,-9.24]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02","timeline":[{"name":"B_HAIR_TWIN.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_00","timeline":[{"name":"B_HAIR_TWIN.02","type":50,"frame":[{"duration":121,"offset":20,"value":[-1.03,-0.19,-2.06,-0.6,-3.08,-1.01,-4.11,-1.19,-4.23,-1.25,-5.44,-1.41,-7.09,-1.68,-8.53,-2.05,0,0,-0.82,-0.15,-1.64,-0.48,-2.47,-0.81,-3.29,-0.96,-4.62,-1.26,-8.11,-2.03,-12.47,-3,-16.41,-3.94,-0.23,-0.05,-0.2,-0.02,-0.18,-0.01,-0.16,0,-0.17,0,-2.38,-0.48,-6.98,-1.64,-12.55,-3.04,-17.63,-4.23,-2.63,-0.63,-2.44,-0.44,-2.22,-0.24,-2.05,-0.07,-1.97,0,-2.77,-0.24,-4.69,-0.83,-7.06,-1.56,-9.21,-2.21,-5.04,-1.21,-4.67,-0.86,-4.26,-0.47,-3.93,-0.14,-3.78,0,-3.2,0,-2.43,-0.02,-1.59,-0.08,-0.79,-0.19,-4.69,-1.13,-4.35,-0.82,-3.98,-0.44,-3.67,-0.13,-3.52,0,-3.06,0,-2.13,0,-1.02,0,0,0,-2.44,-0.59,-2.26,-0.43,-2.07,-0.23,-1.91,-0.07,-1.83,0,-1.58,0,-1.1,0,-0.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_01","timeline":[{"name":"B_HAIR_TWIN.02","type":50,"frame":[{"duration":121,"offset":20,"value":[-1.03,-0.19,-2.06,-0.6,-3.08,-1.01,-4.11,-1.19,-4.23,-1.25,-5.44,-1.41,-7.09,-1.68,-8.53,-2.05,0,0,-0.82,-0.15,-1.64,-0.48,-2.47,-0.81,-3.29,-0.96,-4.62,-1.26,-8.11,-2.03,-12.47,-3,-16.41,-3.94,-0.23,-0.05,-0.2,-0.02,-0.18,-0.01,-0.16,0,-0.17,0,-2.38,-0.48,-6.98,-1.64,-12.55,-3.04,-17.63,-4.23,-2.63,-0.63,-2.44,-0.44,-2.22,-0.24,-2.05,-0.07,-1.97,0,-2.77,-0.24,-4.69,-0.83,-7.06,-1.56,-9.21,-2.21,-5.04,-1.21,-4.67,-0.86,-4.26,-0.47,-3.93,-0.14,-3.78,0,-3.2,0,-2.43,-0.02,-1.59,-0.08,-0.79,-0.19,-4.69,-1.13,-4.35,-0.82,-3.98,-0.44,-3.67,-0.13,-3.52,0,-3.06,0,-2.13,0,-1.02,0,0,0,-2.44,-0.59,-2.26,-0.43,-2.07,-0.23,-1.91,-0.07,-1.83,0,-1.58,0,-1.1,0,-0.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.02_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09","timeline":[{"name":"B_HAIR_TWIN.09_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.09_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.09_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.09_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.09_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_00"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.09_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10","timeline":[{"name":"B_HAIR_TWIN.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.10_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.10_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_00","timeline":[{"name":"B_HAIR_TWIN.10","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,11.31,-0.26,12.17,0.16,12.87,0.49,13.16,0.63,10.71,0.56,4.77,0.39,-2.57,0.19,-9.21,0,1.39,-0.34,1.82,-0.12,2.3,0.1,2.68,0.27,2.8,0.34,-3.61,0.3,-10.88,0.22,-16.9,0.11,-19.57,0,-7.05,-0.07,-6.95,0,-6.83,0.04,-6.74,0.06,-6.77,0.07,-17.15,0.07,-25.74,0.05,-30.43,0.03,-29.14,0,-9.21,0,-8.33,-0.04,-7.45,-0.14,-6.57,-0.24,-5.68,-0.29,-17.32,-0.24,-26.59,-0.14,-31.69,-0.04,-30.79,0,-9.21,0,-8.4,-0.13,-7.59,-0.41,-6.77,-0.7,-5.96,-0.83,-9.97,-0.7,-14.85,-0.41,-19.39,-0.13,-22.37,0,-9.21,0,-9.38,-0.07,-9.55,-0.22,-9.72,-0.37,-9.89,-0.44,-5.09,-0.37,-4.56,-0.22,-7.71,-0.07,-13.95,0,-7.48,0.07,-7.64,0.04,-7.82,0.01,-7.95,0,-7.92,0,-2.72,0,-2.7,0,-6.93,0,-14.46,0,-0.73,0.34,-1.38,0.23,-2.1,0.12,-2.67,0.03,-2.85,0,-1.65,0,-5.22,0,-11.77,0,-19.52,0,6.58,0.63,5.41,0.44,4.11,0.24,3.06,0.07,2.63,0,-0.39,0,-7.73,0,-16.8,0,-25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_01","timeline":[{"name":"B_HAIR_TWIN.10","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,11.31,-0.26,12.17,0.16,12.87,0.49,13.16,0.63,10.71,0.56,4.77,0.39,-2.57,0.19,-9.21,0,1.39,-0.34,1.82,-0.12,2.3,0.1,2.68,0.27,2.8,0.34,-3.61,0.3,-10.88,0.22,-16.9,0.11,-19.57,0,-7.05,-0.07,-6.95,0,-6.83,0.04,-6.74,0.06,-6.77,0.07,-17.15,0.07,-25.74,0.05,-30.43,0.03,-29.14,0,-9.21,0,-8.33,-0.04,-7.45,-0.14,-6.57,-0.24,-5.68,-0.29,-17.32,-0.24,-26.59,-0.14,-31.69,-0.04,-30.79,0,-9.21,0,-8.4,-0.13,-7.59,-0.41,-6.77,-0.7,-5.96,-0.83,-9.97,-0.7,-14.85,-0.41,-19.39,-0.13,-22.37,0,-9.21,0,-9.38,-0.07,-9.55,-0.22,-9.72,-0.37,-9.89,-0.44,-5.09,-0.37,-4.56,-0.22,-7.71,-0.07,-13.95,0,-7.48,0.07,-7.64,0.04,-7.82,0.01,-7.95,0,-7.92,0,-2.72,0,-2.7,0,-6.93,0,-14.46,0,-0.73,0.34,-1.38,0.23,-2.1,0.12,-2.67,0.03,-2.85,0,-1.65,0,-5.22,0,-11.77,0,-19.52,0,6.58,0.63,5.41,0.44,4.11,0.24,3.06,0.07,2.63,0,-0.39,0,-7.73,0,-16.8,0,-25]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.10_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11","timeline":[{"name":"B_HAIR_TWIN.11_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.11_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.11_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.11_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.11_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_00","timeline":[{"name":"B_HAIR_TWIN.11","type":50,"frame":[{"duration":121,"offset":10,"value":[-2.45,-0.07,-8.39,-0.24,-15.73,-0.44,-22.37,-0.63,0,0,0,0,0,0,0,0,0,0,-7,-0.17,-15.54,-0.59,-23.89,-1.09,-30.29,-1.51,0,0,0,0,0,0,0,0,0,0,-11.33,-0.27,-22.31,-0.91,-31.53,-1.67,-37.61,-2.32,0,0,0,0,0,0,0,0,0,0,-12.56,-0.28,-23.72,-0.94,-32.47,-1.74,-37.78,-2.42,0,0,0,0,0,0,0,0,0,0,-6.79,-0.14,-12.74,-0.47,-17.26,-0.89,-19.74,-1.26,0,0,0,0,0,0,0,0,0,0,-0.9,0,-1.59,-0.01,-1.9,-0.05,-1.7,-0.11]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_01","timeline":[{"name":"B_HAIR_TWIN.11","type":50,"frame":[{"duration":121,"offset":10,"value":[-2.45,-0.07,-8.39,-0.24,-15.73,-0.44,-22.37,-0.63,0,0,0,0,0,0,0,0,0,0,-7,-0.17,-15.54,-0.59,-23.89,-1.09,-30.29,-1.51,0,0,0,0,0,0,0,0,0,0,-11.33,-0.27,-22.31,-0.91,-31.53,-1.67,-37.61,-2.32,0,0,0,0,0,0,0,0,0,0,-12.56,-0.28,-23.72,-0.94,-32.47,-1.74,-37.78,-2.42,0,0,0,0,0,0,0,0,0,0,-6.79,-0.14,-12.74,-0.47,-17.26,-0.89,-19.74,-1.26,0,0,0,0,0,0,0,0,0,0,-0.9,0,-1.59,-0.01,-1.9,-0.05,-1.7,-0.11]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.11_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12","timeline":[{"name":"B_HAIR_TWIN.12_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.12_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.12_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.12_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.12_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_00"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.12_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13","timeline":[{"name":"B_HAIR_TWIN.13_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.13_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.13_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.13_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.13_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_00","timeline":[{"name":"B_HAIR_TWIN.13","type":50,"frame":[{"duration":121,"offset":20,"value":[1.23,-0.08,2.57,-0.18,3.69,-0.26,4.26,-0.29,1.37,-0.33,-4.06,-0.41,-10.51,-0.51,-16.45,-0.59,0,0,2.38,-0.16,4.97,-0.34,7.13,-0.5,8.2,-0.56,2.69,-0.63,-7.76,-0.79,-20.2,-0.97,-31.65,-1.13,0,0,2.58,-0.17,5.42,-0.37,7.75,-0.54,8.82,-0.6,3.25,-0.67,-8.2,-0.84,-21.98,-1.04,-34.6,-1.21,0,0,1.37,-0.09,2.88,-0.2,4.1,-0.28,4.61,-0.32,0.66,-0.35,-6.62,-0.44,-15.24,-0.54,-23.2,-0.63,0,0,0.15,-0.02,0.34,-0.02,0.46,-0.03,0.4,-0.03,-0.34,-0.03,-1.95,-0.03,-3.9,-0.04,-5.68,-0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_01","timeline":[{"name":"B_HAIR_TWIN.13","type":50,"frame":[{"duration":121,"offset":20,"value":[1.23,-0.08,2.57,-0.18,3.69,-0.26,4.26,-0.29,1.37,-0.33,-4.06,-0.41,-10.51,-0.51,-16.45,-0.59,0,0,2.38,-0.16,4.97,-0.34,7.13,-0.5,8.2,-0.56,2.69,-0.63,-7.76,-0.79,-20.2,-0.97,-31.65,-1.13,0,0,2.58,-0.17,5.42,-0.37,7.75,-0.54,8.82,-0.6,3.25,-0.67,-8.2,-0.84,-21.98,-1.04,-34.6,-1.21,0,0,1.37,-0.09,2.88,-0.2,4.1,-0.28,4.61,-0.32,0.66,-0.35,-6.62,-0.44,-15.24,-0.54,-23.2,-0.63,0,0,0.15,-0.02,0.34,-0.02,0.46,-0.03,0.4,-0.03,-0.34,-0.03,-1.95,-0.03,-3.9,-0.04,-5.68,-0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.13_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14","timeline":[{"name":"B_HAIR_TWIN.14_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_TWIN.14_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_TWIN.14_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_TWIN.14_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_TWIN.14_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_00","timeline":[{"name":"B_HAIR_TWIN.14","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,3.89,-0.63,-3.45,-0.63,-9.4,-0.63,-11.84,-0.63,-13.86,-0.7,-18.75,-0.87,-24.8,-1.08,-30.27,-1.26,10.53,-0.63,4.39,-0.61,-2.23,-0.57,-7.9,-0.53,-11.18,-0.51,-16.4,-0.28,-23.97,0.22,-32.49,0.7,-40.53,0.87,10.53,-0.63,6.98,-0.63,3.11,-0.61,-0.11,-0.6,-1.73,-0.59,-6.1,-0.41,-12.87,-0.02,-20.6,0.37,-27.85,0.53,10.53,-0.63,8.69,-0.63,6.66,-0.63,5,-0.63,4.23,-0.63,2.33,-0.63,-2.18,-0.64,-7.73,-0.64,-12.76,-0.66,10.53,-0.63,9.55,-0.63,8.47,-0.63,7.6,-0.63,7.24,-0.63,5.51,-0.67,1.32,-0.75,-3.87,-0.85,-8.55,-0.95,10.53,-0.63,10.42,-0.63,10.28,-0.63,10.2,-0.63,10.25,-0.63,8.69,-0.7,4.81,-0.87,0,-1.06,-4.34,-1.24,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,8.79,-0.7,5.4,-0.86,1.35,-1.04,-2.36,-1.19,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,9.6,-0.67,7.85,-0.75,5.75,-0.85,3.83,-0.92,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_01","timeline":[{"name":"B_HAIR_TWIN.14","type":50,"frame":[{"duration":121,"value":[10.53,-0.63,3.89,-0.63,-3.45,-0.63,-9.4,-0.63,-11.84,-0.63,-13.86,-0.7,-18.75,-0.87,-24.8,-1.08,-30.27,-1.26,10.53,-0.63,4.39,-0.61,-2.23,-0.57,-7.9,-0.53,-11.18,-0.51,-16.4,-0.28,-23.97,0.22,-32.49,0.7,-40.53,0.87,10.53,-0.63,6.98,-0.63,3.11,-0.61,-0.11,-0.6,-1.73,-0.59,-6.1,-0.41,-12.87,-0.02,-20.6,0.37,-27.85,0.53,10.53,-0.63,8.69,-0.63,6.66,-0.63,5,-0.63,4.23,-0.63,2.33,-0.63,-2.18,-0.64,-7.73,-0.64,-12.76,-0.66,10.53,-0.63,9.55,-0.63,8.47,-0.63,7.6,-0.63,7.24,-0.63,5.51,-0.67,1.32,-0.75,-3.87,-0.85,-8.55,-0.95,10.53,-0.63,10.42,-0.63,10.28,-0.63,10.2,-0.63,10.25,-0.63,8.69,-0.7,4.81,-0.87,0,-1.06,-4.34,-1.24,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,8.79,-0.7,5.4,-0.86,1.35,-1.04,-2.36,-1.19,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,9.6,-0.67,7.85,-0.75,5.75,-0.85,3.83,-0.92,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63,10.53,-0.63]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_02"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_03"},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_TWIN.14_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01","timeline":[{"name":"D_HAIR_TWIN.01_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.01_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.01_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.01_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.01_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_00","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":550}]},{"name":"D_HAIR_TWIN.01","type":22,"frame":[{"duration":121,"value":[82.47,-8.71,18.8,-7.24,-17.76,-0.07,-43.52,0,27.66,1.51,51.4,1.5,18.69,0.09,10.7,0.86,34.75,0.78,-11.72,0.04,-1.02,0,-29.95,-0.04,47.64,-3.91,31.35,-4.3,45.12,-7.85,1.03,-3.75]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_01","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_02","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_03","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]},{"name":"D_HAIR_TWIN.01","type":22,"frame":[{"duration":121,"value":[-77.6,13.12,-161.4,-30.15,1.86,-5.77,12.57,-4.81,-6.13,5.71,30.68,9.4,11.96,-3.09,22.91,3.31,21.15,3.04,12.26,-3.93,6.5,-4.54,6.93,-5.32,-18.55,-1.94,-46.43,-17.13,-134.12,-14.54,-89.02,-30.45]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.01_04","timeline":[{"name":"D_HAIR_TWIN.01","type":23,"frame":[{"duration":121,"value":600}]},{"name":"D_HAIR_TWIN.01","type":22,"frame":[{"duration":121,"value":[-57.19,6.66,-116.21,-24.58,-15.93,-34.98,9.22,-7.28,-2.8,9.22,75.94,16.52,25.87,1.58,47.34,6.32,49.47,4.97,16.73,-6.72,-5.17,-17.16,8.93,-18.22,-3.91,-5.47,-40.61,-15.06,-111.97,-6.41,-79.83,-33.74]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00","timeline":[{"name":"D_HAIR_TWIN.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_00"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.00_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04","timeline":[{"name":"D_HAIR_TWIN.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.04_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_00","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":410}]},{"name":"D_HAIR_TWIN.04","type":22,"frame":[{"duration":121,"offset":14,"value":[-6.84,-3.25,-11.01,-7.53,2.49,-6.91,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.96,-4.15]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_01","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":410}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_02","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_03","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":510}]},{"name":"D_HAIR_TWIN.04","type":22,"frame":[{"duration":121,"value":[-7.61,-0.32,-7.59,-0.32,-8.26,-0.3,-8.29,-0.32,-8.71,-0.35,-9.63,-0.34,-9.69,-0.34,-9.49,-0.4,-9.38,-0.55,-9.38,-0.51,-9.14,-0.56,-9.38,-0.51,-9.29,-0.39,-9.11,-0.37,-8.95,-0.39,-8.73,-0.35,2,-2.22,-8.1,-0.33,-6.99,-0.27,-9.51,-0.41,-9.24,-0.39,-8.77,-0.35,-9.44,-0.44,-8.66,-0.35,-2.96,-2.21,-9.12,-0.38,-9.51,-0.41,-9.44,-0.41,-9.38,-0.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.04_04","timeline":[{"name":"D_HAIR_TWIN.04","type":23,"frame":[{"duration":121,"value":510}]},{"name":"D_HAIR_TWIN.04","type":22,"frame":[{"duration":121,"value":[-15.22,-0.65,-15.19,-0.63,-16.52,-0.6,-16.58,-0.64,-17.43,-0.7,-19.25,-0.68,-19.37,-0.67,-18.98,-0.79,-18.76,-1.11,-18.75,-1.02,-18.28,-1.13,-18.75,-1.02,-18.59,-0.78,-18.22,-0.75,-17.9,-0.77,-17.47,-0.7,3.99,-4.44,-16.19,-0.66,-13.98,-0.54,-19.03,-0.81,-18.48,-0.78,-17.54,-0.71,-18.87,-0.89,-17.31,-0.69,-5.92,-4.42,-18.24,-0.75,-19.03,-0.81,-18.89,-0.82,-18.75,-1.02]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05","timeline":[{"name":"D_HAIR_TWIN.05_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.05_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.05_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.05_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.05_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_00"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_03"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.05_04"},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06","timeline":[{"name":"D_HAIR_TWIN.06_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.06_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.06_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.06_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.06_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_00","timeline":[{"name":"D_HAIR_TWIN.06","type":22,"frame":[{"duration":121,"value":[5.49,-0.01,-12.53,0.16,16.63,1.79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-9.17,1.69,-9.33,3.04,-19.17,1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_01"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_03","timeline":[{"name":"D_HAIR_TWIN.06","type":22,"frame":[{"duration":121,"value":[2.55,-0.02,8.9,0.59,4.9,0.27,2.93,-0.07,3.02,-0.08,4.17,-0.13,3.55,-0.11,2.16,-0.06,0.85,-0.02,0.54,-0.01,1,-0.02,6.76,0.32,1.7,-0.31,1.61,-0.02,1.75,-0.02,2.69,-0.07,1.82,-0.04,1.9,-0.05]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.06_04","timeline":[{"name":"D_HAIR_TWIN.06","type":22,"frame":[{"duration":121,"value":[5.11,-0.05,21.46,1.04,9.8,0.55,5.85,-0.14,6.04,-0.16,8.35,-0.26,7.1,-0.23,4.32,-0.12,1.71,-0.04,1.08,-0.02,1.99,-0.05,13.52,0.63,3.39,-0.62,3.23,-0.03,3.5,-0.03,5.38,-0.14,3.64,-0.09,3.8,-0.09]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07","timeline":[{"name":"D_HAIR_TWIN.07_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.07_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.07_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.07_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.07_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_00","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":410}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_01","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":410}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_02","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_03","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.07_04","timeline":[{"name":"D_HAIR_TWIN.07","type":23,"frame":[{"duration":121,"value":510}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08","timeline":[{"name":"D_HAIR_TWIN.08_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.08_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.08_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.08_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.08_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_00","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":420}]},{"name":"D_HAIR_TWIN.08","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":8,"value":[4.16,10.38,0,0,0,0,-4.12,5.73,-8.71,-4.16,-11.92,-13.56,1.17,-7.73,-1.93,-7.03,1.61,8.17,0,0,-33.93,-0.02,-17.41,0.63,-15,0.07,0,0,2.31,10.1,-5.42,9.7,0,0,-17.05,0.65,0,0,-8.9,5.12,0,0,0,0,-7.68,0.77,-0.64,15.18]},{"duration":60,"tweenEasing":0,"value":[-63.33,2.35,-42.66,2.56,0,0,0,0,4.16,10.38,0,0,0,0,-4.12,5.73,-8.71,-4.16,-11.92,-13.56,1.17,-7.73,-1.93,-7.03,1.61,8.17,0,0,-33.93,-0.02,-17.41,0.63,-15,0.07,-12.46,7.83,2.31,10.1,-5.42,9.7,-21.08,0.62,-17.05,0.65,0,0,-8.9,5.12,-18.15,0.66,0,0,-7.68,0.77,-0.64,15.18]},{"offset":8,"value":[4.16,10.38,0,0,0,0,-4.12,5.73,-8.71,-4.16,-11.92,-13.56,1.17,-7.73,-1.93,-7.03,1.61,8.17,0,0,-33.93,-0.02,-17.41,0.63,-15,0.07,0,0,2.31,10.1,-5.42,9.7,0,0,-17.05,0.65,0,0,-8.9,5.12,0,0,0,0,-7.68,0.77,-0.64,15.18]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_01","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":420}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_02","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":520}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_03","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":520}]},{"name":"D_HAIR_TWIN.08","type":22,"frame":[{"duration":121,"value":[1.75,-0.37,5.19,-0.11,1.26,0.29,0,0,0,0,0,0,0,0,-4.17,3.1,0,0,-10.09,-7.32,-1.16,-4.77,-3.88,-1.49,0,0,0,0,0,0,0,0,3.12,-0.05,4.37,-0.07,0,0,0,0,5.24,-0.11,1.73,-0.04,0,0,-5.9,1.33,5.19,-0.11,0,0,0,0,0.79,0.72]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.08_04","timeline":[{"name":"D_HAIR_TWIN.08","type":23,"frame":[{"duration":121,"value":520}]},{"name":"D_HAIR_TWIN.08","type":22,"frame":[{"duration":121,"value":[3.51,-0.75,10.38,-0.21,2.52,0.59,0,0,0,0,0,0,0,0,-8.34,6.19,0,0,-20.17,-14.65,-2.32,-9.54,-7.77,-2.98,0,0,0,0,0,0,0,0,6.24,-0.1,8.75,-0.14,0,0,0,0,10.48,-0.23,3.46,-0.07,0,0,-11.8,2.66,10.38,-0.21,0,0,0,0,1.58,1.43]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09","timeline":[{"name":"D_HAIR_TWIN.09_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.09_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.09_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.09_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.09_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_00","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-100.44,19.26,-82.41,12.98,-79.78,1.24,-47.01,3.73,-25.38,0.58,-21.12,0.69,-27.48,0.77,-20.83,0.68,-20.96,0.93,-20.87,0.68,-34.12,0.47,-26.39,0.91,-18.35,1.05,-16.02,3.06,-30.94,1.5,-43.96,15.64,-70.94,24.23,-33.58,1.74,-20.61,0.78,-26.53,2.25,-44.1,11.26,-70.39,18.13,-36.18,0.78,-85.48,20.64,-57.06,11.3,-36.53,2.55,-24.59,0.19,-23.42,0.72,-33.79,-0.01,-32.18,2.27,-20.84,0.68]},{"duration":60,"tweenEasing":0,"value":[-100.44,19.26,-82.41,12.98,-79.78,1.24,-47.01,3.73,-25.38,0.58,-21.12,0.69,-27.48,0.77,-20.83,0.68,-20.96,0.93,-20.87,0.68,-34.12,0.47,-26.39,0.91,-18.35,1.05,-16.02,3.06,-30.94,1.5,-43.96,15.64,-62.12,19,-33.58,1.74,-20.61,0.78,-26.53,2.25,-44.1,11.26,-69.61,13.75,-36.18,0.78,-85.48,20.64,-57.06,11.3,-36.53,2.55,-24.59,0.19,-23.42,0.72,-33.79,-0.01,-32.18,2.27,-20.84,0.68]},{"value":[-100.44,19.26,-82.41,12.98,-79.78,1.24,-47.01,3.73,-25.38,0.58,-21.12,0.69,-27.48,0.77,-20.83,0.68,-20.96,0.93,-20.87,0.68,-34.12,0.47,-26.39,0.91,-18.35,1.05,-16.02,3.06,-30.94,1.5,-43.96,15.64,-70.94,24.23,-33.58,1.74,-20.61,0.78,-26.53,2.25,-44.1,11.26,-70.39,18.13,-36.18,0.78,-85.48,20.64,-57.06,11.3,-36.53,2.55,-24.59,0.19,-23.42,0.72,-33.79,-0.01,-32.18,2.27,-20.84,0.68]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_01","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":61},{"duration":60,"tweenEasing":0,"value":[-10.2,1.79,-21.6,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.33,-3.38,0,0,-6.26,0.59]},{"offset":61}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_02","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":530}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_03","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":121,"value":[-1.93,-0.1,-0.26,-0.5,-5.82,-2.15,4.83,0.16,6.78,0.75,10.22,1.21,13.14,1.29,16.84,0.67,33.72,-2.57,27.42,1.98,19.48,5.54,3.15,3.04,9.17,1.59,7.64,3.37,4.89,2.41,2.94,1.47,-5.02,1.03,6.18,1.39,6.32,1.8,3.97,1.35,1.53,0.77,-0.81,0.28,13.31,3.87,-1.84,0.08,0.32,0.51,2.78,1.09,5.03,1.66,7.44,2.01,7.78,0.89,23.61,3.49,24.4,0.96]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.09_04","timeline":[{"name":"D_HAIR_TWIN.09","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.09","type":22,"frame":[{"duration":121,"value":[-3.87,-0.2,-0.53,-1,-11.65,-4.29,9.67,0.32,13.55,1.5,20.44,2.41,26.27,2.58,33.68,1.34,67.45,-5.14,54.84,3.97,38.97,11.09,6.3,6.07,18.34,3.17,15.28,6.75,9.78,4.81,5.87,2.94,-10.05,2.05,12.37,2.78,12.63,3.59,7.94,2.7,3.05,1.53,-1.63,0.55,26.61,7.73,-3.67,0.16,0.64,1.02,5.56,2.18,10.07,3.32,14.88,4.01,15.56,1.78,47.22,6.98,48.79,1.92]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10","timeline":[{"name":"D_HAIR_TWIN.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_TWIN.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_TWIN.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_TWIN.10_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_TWIN.10_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_00","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-23.32,3.55,-45.66,5.37,-45.67,5.45,-52.61,6.34,-21.26,2.07,-4.51,8.76,-27.17,5.47,-23.33,4.21,-45.57,5.66,-46.69,6.05,-27.59,7.47]},{"duration":60,"tweenEasing":0,"value":[-23.32,3.55,-79.04,5.12,-85.4,6.46,-52.61,6.34,-21.26,2.07,-4.51,8.76,-27.17,5.47,-23.33,4.21,-45.57,5.66,-46.69,6.05,-27.59,7.47]},{"value":[-23.32,3.55,-45.66,5.37,-45.67,5.45,-52.61,6.34,-21.26,2.07,-4.51,8.76,-27.17,5.47,-23.33,4.21,-45.57,5.66,-46.69,6.05,-27.59,7.47]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_01","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":430}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":21},{"duration":60,"tweenEasing":0,"offset":2,"value":[-17.77,0.57,-6.06,2.04]},{"offset":21}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_02","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":530}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_03","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":121,"value":[-1.74,-2.49,-8.78,-6.35,20.52,1.16,-0.8,-0.7,-0.13,4.15,0.98,4.85,-0.26,0.22,-4.83,-4.02,-10.24,-2.78,-6.03,-2.19,2.68,1.53]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_TWIN.10_04","timeline":[{"name":"D_HAIR_TWIN.10","type":23,"frame":[{"duration":121,"value":530}]},{"name":"D_HAIR_TWIN.10","type":22,"frame":[{"duration":121,"value":[-3.47,-4.99,-17.57,-12.71,41.03,2.32,-1.6,-1.39,-0.26,8.31,1.96,9.7,-0.53,0.43,-9.67,-8.03,-20.48,-5.57,-12.05,-4.38,5.36,3.05]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02","timeline":[{"name":"B_HAIR_BACK.02_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAIR_BACK.02_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_HAIR_BACK.02_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAIR_BACK.02_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_HAIR_BACK.02_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_00","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-58.64,49.98,-30.47,13.5,-3.07,-22.09,14.39,-38.98,23.95,-17.69,27.19,2.46,22.86,2.52,13.16,-3.17,2.67,-9.33,-27.68,35.92,-16.76,-0.99,-8.53,-33.09,-5.83,-53.38,-5.38,-41.68,1.79,-16.16,6.7,-7.44,8.72,-5.19,9.3,-3.3,1.07,27.92,-4.05,-11.2,-13.45,-44.2,-24.83,-67.76,-33.18,-65.1,-21.98,-33.88,-8.21,-16.8,4.34,-7.87,15.43,1.41,10.73,26.93,0.21,-14.01,-12.47,-49.32,-29.08,-74.4,-40.83,-75.04,-27.06,-40.41,-10.28,-20.76,3.56,-11.79,17.06,-2.13,13.66,41.25,7.39,4.96,0.3,-27.54,-8.75,-49.02,-14.13,-50.57,-4.46,-29.91,5.4,-17.16,11.34,-10.52,17.08,-3.59,14.34,64.85,12.53,31.26,11.23,-0.8,9.89,-20.57,11.11,-23.87,16.98,-18.01,19.74,-12.79,17.01,-9.44,14.58,-5.89,12.38,92.14,10.99,58.64,9.75,25.82,9.99,6.4,13.28,-0.05,17.52,-5.74,17.91,-6.27,13.67,-5.98,9.7,-5.6,13.3,117.65,12.13,85.04,11.14,53.07,10.69,34.16,12.19,21.91,14.16,4.25,14.18,-1.37,11.48,-3.16,8.94,-5.06,14.67,142.67,13.34,108.26,11.95,74.42,10.67,55.12,10.67,39.84,10.67,12.74,10.45,3.05,9.59,-0.65,8.67,-4.67]},{"duration":60,"tweenEasing":0,"value":[-67.31,49.98,-47.47,20.3,-27.76,-9.01,-14.75,-25.67,-8.66,-15,-2.57,-4.34,-2.44,-3.99,-4.15,-6.56,-6,-9.33,-39.12,38.23,-26.9,7.25,-15.7,-22.5,-7.89,-43.53,-4.37,-39.47,-1.17,-20.11,-1.51,-10.88,-3.21,-7.17,-5.07,-3.3,-12.94,32.37,-7.93,-1.88,-4.34,-34.68,-1.55,-61.18,-0.39,-63.46,0.15,-35.23,-0.65,-17.61,-2.35,-8.36,-4.22,1.42,-3.76,31.88,-1.86,-4.76,-0.18,-40.17,0.42,-68.97,1.14,-73.33,1.27,-40.75,0.47,-20.78,-1.51,-11.84,-3.66,-2.2,1.25,45.25,1.79,10.97,2.35,-22.27,3,-46.21,4.73,-49.78,6.67,-30.15,6.49,-17.26,3.25,-11.04,0,-4.33,4.84,66.22,3.94,32.8,3.23,0.19,3.91,-20.36,6.92,-23.96,10.94,-18.14,11.55,-12.9,7.65,-9.82,3.66,-6.47,3.71,92.14,2.32,58.64,1.08,25.81,1.33,6.4,4.62,-0.05,8.85,-5.74,9.24,-6.27,5.01,-5.98,1.03,-5.6,4.63,117.65,3.46,85.04,2.48,53.07,2.02,34.16,3.53,21.9,5.5,4.25,5.51,-1.37,2.81,-3.16,0.27,-5.07,6,142.67,4.68,108.26,3.28,74.42,2,55.11,2,39.83,2,12.74,1.78,3.05,0.93,-0.65,0,-4.67]},{"value":[-155.98,77.31,-118.85,29.47,-81.68,-11.87,-56.35,-26.16,-50.39,-16.71,-44.73,-10.59,-53.83,-15.61,-70.4,-29.95,-87.33,-45.33,-109.97,58.07,-71.7,14.72,-34.29,-23.51,-10.57,-42.38,-6.64,-40.26,-6.67,-25.43,-20.1,-20.2,-42.67,-25.34,-65.33,-30.83,-67.11,45.11,-28.14,4.25,9.63,-33.56,31.3,-58.57,33.56,-63.27,28.27,-39.4,10.84,-24.49,-16.95,-21.14,-44.83,-17.43,-51.16,40.56,-18.49,0.14,12.45,-38.11,29.33,-67.34,31.3,-73.49,24.43,-43.61,7.14,-24.58,-19.81,-18.86,-47.83,-12.68,-32.75,51.75,-15.11,14.25,-1.43,-20.15,7.19,-45.42,9.05,-50.86,6.4,-33.58,-6.07,-20.27,-31.35,-15.92,-57.47,-11.33,-15.75,72.22,-7.07,36.52,-1.28,2.5,2.17,-19.04,6.05,-25.13,9.78,-21.91,2.71,-15.43,-19.62,-13.24,-42.96,-11.11,-13.94,97.48,-6.41,61.26,1.34,25.86,3.99,5.58,7.71,-0.8,12.38,-6.42,7.22,-5.95,-13.01,-7.47,-32.66,-9.17,-6.46,120.42,-2.08,84.53,2.47,49.52,3.49,30.06,5.18,22.14,7.34,8.82,4.25,3.52,-7.65,-1.4,-19.16,-6.92,2,142.67,2.53,104.56,2.84,67.29,2,47.97,2,41.83,2,23.88,1.34,13.74,-1.22,4.9,-4,-4.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_01","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[-22.68,80,-6.27,34.94,9.57,-6.71,20.21,-15.74,27.94,-2.69,29.36,9.24,25.3,7.86,17.31,-0.4,8.67,-9.33,-6.24,54.24,-2.52,17.68,-1.3,-13.18,-2.76,-23.09,-3.57,-17.17,2.72,0.8,8.08,5.64,11.4,1.6,13.45,-3.16,8.51,35.42,0.45,5.24,-11.28,-18.49,-24.38,-30.26,-33.58,-31.43,-22.29,-7.38,-7.8,3.75,5.75,3.25,17.87,2.53,12.91,27.03,1.23,1.33,-12.49,-18.44,-29.4,-31.57,-41.37,-36.07,-27.41,-10.59,-10.15,2.48,4.52,3.13,18.8,3.79,17.66,20.25,8.59,3.26,-1.43,-9.81,-11.4,-16.84,-15.54,-19.9,-5.01,-6.01,4.4,1.18,10.34,1.45,16.08,1.41,20.17,19.39,14.46,9.15,9.21,0.53,6.45,-2.08,9.52,-3.42,16.23,-0.55,17.61,0.69,14.06,-0.45,10.83,-1.8,18.76,27.39,14.32,18.34,9.84,9.99,9.1,7.5,13.7,4.12,18.3,0.74,17.54,0.24,13.04,-1.74,8.67,-3.98,13.91,34.99,11.63,27.25,9.29,20.12,8.89,17.51,11.31,9.67,13.73,1.82,13.32,0.15,10.93,-4.26,8.67,-9.11,8.67,42.67,8.67,36.19,8.67,30.2,8.67,27.52,8.67,15.34,8.67,3.15,8.67,0.18,8.67,-6.95,8.67,-14.67]},{"duration":60,"tweenEasing":0,"value":[-31.34,80,-23.27,41.74,-15.12,6.38,-8.93,-2.44,-4.67,0,-0.4,2.44,0,1.35,0,-3.78,0,-9.33,-17.68,56.55,-12.77,25.81,-8.44,-2.3,-4.8,-13.24,-2.51,-14.98,-0.22,-3.17,-0.11,2.2,-0.52,-0.36,-0.93,-3.16,-5.5,39.87,-3.43,14.56,-2.2,-8.63,-0.98,-23.67,-0.51,-29.81,-0.04,-8.76,-0.21,2.92,-1,2.77,-1.78,2.54,-1.58,31.97,-0.86,10.53,-0.18,-9.31,0.04,-26.15,0.45,-34.34,0.86,-10.92,0.6,2.46,-0.57,3.08,-1.91,3.71,5.25,24.25,2.99,9.24,0.63,-4.49,0.27,-14.03,3.17,-19.1,6.06,-6.25,5.49,1.1,2.25,0.91,-1,0.67,10.67,20.75,5.87,10.68,1.21,1.53,0.46,-1.86,5.32,-3.5,10.19,-0.68,9.42,0.59,4.71,-0.84,-0.09,-2.38,10.09,27.39,5.65,18.33,1.18,9.99,0.43,7.5,5.03,4.11,9.63,0.73,8.87,0.24,4.37,-1.75,0,-3.98,5.24,34.99,2.96,27.25,0.62,20.12,0.23,17.51,2.64,9.67,5.06,1.82,4.65,0.15,2.26,-4.27,0,-9.11,0,42.67,0,36.19,0,30.2,0,27.52,0,15.33,0,3.15,0,0.18,0,-6.95,0,-14.67]},{"value":[-120.01,107.33,-94.65,50.9,-69.03,3.51,-50.53,-2.92,-46.39,-1.7,-42.56,-3.81,-51.4,-10.27,-66.25,-27.17,-81.33,-45.33,-88.53,76.39,-57.59,33.13,-27.03,-3.41,-7.46,-12.07,-4.74,-15.76,-5.69,-8.48,-18.66,-7.14,-40.05,-18.56,-61.18,-30.69,-59.67,52.61,-23.66,20.64,11.78,-7.6,31.91,-21.05,33.55,-29.62,28.15,-12.93,11.34,-3.93,-15.72,-10.05,-42.4,-16.3,-48.99,40.65,-17.5,15.45,12.45,-7.31,28.94,-24.52,30.56,-34.5,23.99,-13.78,7.27,-1.34,-18.89,-3.95,-46.09,-6.77,-28.75,30.75,-13.79,12.54,-3.16,-2.54,4.45,-13.24,7.44,-20.16,5.77,-9.65,-7.07,-1.88,-32.35,-3.96,-58.47,-6.33,-9.92,26.75,-5.07,14.42,-3.29,3.73,-1.28,-0.55,4.45,-4.66,9.03,-4.44,0.59,-1.92,-22.54,-4.25,-46.7,-7.02,-7.57,32.73,-3.1,20.96,1.43,10.04,3.1,6.68,8.13,3.36,13.15,0.05,6.85,0.57,-13.57,-3.19,-33.69,-7.54,-5.85,37.77,-2.63,26.76,0.6,16.58,1.7,13.41,4.3,9.92,6.9,6.42,3.4,5.03,-8.17,-2.48,-19.43,-10.96,-4,42.67,-2.15,32.48,-0.44,23.07,0,20.38,0,17.33,0,14.29,-0.44,10.86,-2.15,-1.4,-4,-14.67]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_02","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.67,0,16.99,-6.8,24.69,-13.08,29.14,-13.31,32.61,-2.69,29.76,6.8,25.3,6.51,17.31,3.38,8.67,0,11.44,-2.31,10.25,-8.05,7.1,-11.28,2.05,-9.88,-1.04,-2.26,2.95,3.94,8.18,3.43,11.93,1.96,14.38,0,14.01,-4.45,3.89,-9.19,-9.11,-9.9,-23.34,-6.68,-32.93,-1.84,-22.19,1.28,-7.6,0.83,6.76,0.48,19.65,-0.01,14.49,-4.95,2.08,-9.23,-12.3,-9.1,-29.4,-5.4,-41.73,-1.67,-28.23,0.35,-10.76,0.04,5.1,0.04,20.72,0.07,12.42,-4,5.63,-5.94,-2.09,-5.2,-11.7,-2.81,-18.76,-0.8,-11.09,0.24,-1.09,0.13,8.09,0.51,17.08,0.75,9.5,-1.36,8.6,-1.52,7.99,-0.96,5.98,-0.22,4.17,0.07,6.03,0.13,8.19,0.11,9.35,0.38,10.92,0.58,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67,0,8.67]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[-88.67,27.33,-71.38,9.17,-53.92,-2.86,-41.6,-0.49,-41.73,-1.7,-42.16,-6.25,-51.4,-11.63,-66.25,-23.39,-81.33,-36,-70.85,19.84,-44.98,7.63,-18.42,-0.78,-2.67,1.13,-2.25,-0.85,-5.49,-5.34,-18.53,-9.36,-39.55,-18.21,-60.26,-27.53,-54.17,12.74,-20.39,6.32,14.07,1.23,32.87,2.52,34.01,-0.03,28.16,-4.26,11.57,-6.86,-14.77,-12.83,-40.61,-18.84,-47.41,8.68,-16.53,4.9,12.59,1.81,28.89,1.67,30.09,-0.07,23.12,-2.82,6.68,-3.8,-18.34,-7.03,-44.18,-10.48,-34,6.5,-16.81,3.33,-3.8,1.5,4.19,0.85,4.29,-0.98,-0.28,-3.39,-12.55,-3.04,-34.64,-4.85,-57.47,-7,-20.59,6.01,-11.03,3.75,-4.51,2.1,-1.74,1.33,-0.86,-1.15,-1.16,-3.77,-8.83,-2.55,-27.27,-3.39,-46.61,-4.64,-17.66,5.34,-8.76,2.62,0.25,0.04,2.67,-0.81,3.09,-0.75,3.52,-0.69,-2.02,0.28,-18,-1.45,-33.69,-3.56,-11.1,2.78,-5.59,-0.5,-0.02,-3.53,1.47,-4.09,1.65,0.25,1.84,4.59,-1.26,4.88,-10.45,1.77,-19.43,-1.85,-4,0,-2.15,-3.7,-0.44,-7.13,0,-7.14,0,2,0,11.14,-0.44,10.69,-2.15,5.55,-4]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_03","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.67,-12,17.61,-18.8,25.88,-25.08,30.14,-19.69,30.1,-7.22,23.76,-11.78,19.37,-22.47,12.96,-39.86,6.02,-58.67,11.44,-14.31,10.6,-18.69,7.74,-20.62,2.58,-9.12,-2.29,8.72,-0.05,-0.28,5.28,-15.17,9.98,-33.19,13.58,-53.11,14.01,-16.45,3.98,-18.54,-8.96,-16.75,-23.27,0.99,-33.12,24.32,-22.5,11.01,-7.78,-7.69,7.01,-26.98,20.56,-47.99,14.49,-16.95,2.08,-18.11,-12.3,-15.09,-29.44,3.79,-41.83,28.75,-28.28,15.56,-10.63,-3.95,5.8,-24.28,21.95,-46.19,12.42,-16,5.62,-14.54,-2.09,-10.66,-11.72,0.86,-18.81,15.99,-11.12,9.39,-1.09,-3.32,8.1,-21.42,17.1,-41.25,9.5,-13.36,8.59,-9.85,7.99,-5.9,5.97,-2.04,4.15,3.31,6.02,3.25,8.04,-2.72,8.67,-19.18,9.72,-37.16,8.67,-12,9.17,-5.68,9.72,0.16,9.82,1.64,9.26,1.74,8.71,1.85,8.52,-2.69,8,-18.05,7.49,-34.56,8.67,-12,9.7,-2.03,10.71,7.18,10.88,9.26,9.82,6.53,8.76,3.79,8.59,0.21,8.32,-11.32,8.06,-23.73,8.67,-12,10.2,1.58,11.62,14.13,11.84,16.82,10.32,11.34,8.8,5.85,8.66,3.44,8.66,-3.97,8.67,-12]},{"duration":60,"tweenEasing":0,"offset":1,"value":[-12,0.62,-12,1.19,-12,1,-6.39,-2.5,-4.53,-6,-18.58,-5.92,-28.98,-4.35,-43.24,-2.65,-58.67,0,-12,0.35,-10.62,0.64,-9.33,0.53,0.83,-1.25,11.11,-2.99,-4.17,-2.9,-18.55,-1.95,-35.15,-0.8,-53.11,0,-12,0.1,-9.33,0.14,-6.84,0.1,7.79,-0.13,26.43,-0.29,9.85,-0.18,-8.53,0.25,-27.47,0.91,-47.98,0,-12,0,-8.88,0,-6,-0.03,9.15,-0.08,30.34,-0.04,15.18,0.14,-4.01,0.69,-24.32,1.23,-46.27,0,-12,0,-8.61,0,-5.47,-0.02,3.67,-0.05,16.79,-0.03,9.15,-0.01,-3.41,0,-21.94,0.02,-42,0,-12,0,-8.33,0,-4.94,-0.01,-1.82,-0.02,3.25,-0.01,3.13,-0.15,-2.81,-0.68,-19.57,-1.2,-37.74,0,-12,0.5,-5.69,1.05,0.16,1.15,1.63,0.6,1.74,0.04,1.84,-0.14,-2.7,-0.66,-18.05,-1.17,-34.56,0,-12,1.03,-2.04,2.05,7.18,2.21,9.26,1.15,6.52,0.09,3.79,-0.08,0.21,-0.35,-11.32,-0.61,-23.73,0,-12,1.54,1.58,2.96,14.13,3.18,16.82,1.66,11.33,0.13,5.85,-0.01,3.44,0,-3.98,0,-12]},{"value":[-88.67,15.33,-70.77,-2.83,-52.73,-14.86,-40.6,-6.87,-44.23,-6.23,-48.16,-24.83,-57.32,-40.61,-70.6,-66.63,-83.98,-94.67,-70.85,7.84,-44.62,-3,-17.78,-10.12,-2.14,1.9,-3.49,10.13,-8.47,-9.57,-21.44,-27.88,-41.5,-53.35,-61.06,-80.64,-54.17,0.74,-20.27,-3.02,14.19,-5.6,32.97,10.19,33.9,26.12,27.89,5.46,11.38,-15.28,-14.5,-40.28,-39.7,-66.82,-47.41,-3.32,-16.53,-3.98,12.59,-4.2,28.86,10.87,30.01,30.39,23.08,12.41,6.83,-7.8,-17.67,-31.34,-42.94,-56.75,-34,-5.5,-16.8,-5.28,-3.8,-4,4.16,4.56,4.24,15.92,-0.31,5.81,-12.56,-6.42,-34.63,-26.77,-57.46,-49,-20.59,-5.99,-11.03,-4.58,-4.52,-2.86,-1.75,-0.48,-0.88,2.11,-1.17,-0.64,-8.98,-5.34,-27.93,-22.95,-47.82,-42.38,-17.66,-6.66,-8.25,-3.07,1.3,0.18,3.82,0.82,3.69,0.99,3.57,1.16,-2.17,-2.42,-18.72,-19.52,-34.86,-38.13,-11.1,-9.22,-4.56,-2.53,2.03,3.63,3.68,5.16,2.81,6.77,1.93,8.39,-1.34,5.06,-10.82,-9.55,-20.04,-25.58,-4,-12,-0.61,-2.12,2.52,7,3.18,9.68,1.66,13.33,0.13,16.99,-0.45,14.12,-2.15,1.58,-4,-12]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAIR_BACK.02_04","timeline":[{"name":"B_HAIR_BACK.02","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[4.67,-8,14.54,-18.5,23.66,-28.21,27.13,-19.04,21.6,7.53,8.09,12.85,-7.18,-3.54,-24.75,-36.2,-43.98,-66.67,9.42,-5.29,9.19,-9.88,6.63,-11.94,1.42,5.78,-5.67,34.36,-7.36,29,-8.84,6.06,-11.54,-24.3,-15.91,-54.89,13.48,-2.61,3.84,-1.71,-9.11,2.95,-22.63,29.24,-31.64,60.19,-22.07,44.55,-10.28,16.37,1.14,-13.03,10.88,-43.33,12.58,-0.6,1.15,1.32,-12.34,7.27,-28.25,35.45,-39.63,66.84,-26.37,48.6,-8.94,20.51,6.66,-7.85,21.87,-37.31,11.42,4,6.02,4.07,-0.41,6.67,-9.19,22.07,-16.56,37.61,-9.99,25.09,-0.31,6.73,8.03,-17.93,16.1,-44.25,9.41,10.29,10.3,7.93,11.38,6.38,9.79,8.88,6.32,8.78,6.3,1.74,7.91,-7.02,7.68,-28.61,7.8,-52.04,8.67,12,10.74,11.2,12.87,10.51,13.24,9.88,11.15,4.09,9.07,-1.71,8.33,-10.46,7.17,-32.37,6.15,-55.59,8.67,12,10.51,12.92,12.35,13.8,12.69,13.41,11.28,6.3,9.87,-0.8,9.13,-15.01,9.09,-39.44,9.28,-64.43,8.67,12,10.2,14.47,11.62,16.75,11.93,16.56,11.32,8.34,10.71,0.11,10.03,-19.65,11.21,-46.91,12.67,-74]},{"duration":60,"tweenEasing":0,"value":[-4,-8,-2.46,-11.7,-1.03,-15.12,-2.01,-5.73,-11,10.22,-21.67,6.05,-32.48,-10.05,-42.06,-39.59,-52.65,-66.67,-2.02,-2.97,-1.07,-1.8,-0.48,-0.64,-0.65,15.72,-4.67,36.76,-10.32,25.13,-17.05,3.13,-23.42,-26.39,-30.29,-54.89,-0.53,1.84,-0.04,7.53,-0.03,12.91,0.65,36.08,1.15,62.36,0.05,43.41,-2.66,15.83,-5.67,-13.62,-8.78,-43.32,-1.91,4.34,-0.92,10.58,-0.05,16.39,1.23,40.8,2.28,68.41,1.94,48.21,1.83,20.46,1.53,-7.89,1.15,-37.38,-1,8,0.39,10.01,1.67,11.86,2.51,24.88,2.2,38.41,1.1,24.85,0.78,6.67,-0.07,-18.46,-0.98,-45,-0.09,11.66,1.7,9.44,3.39,7.35,3.8,9.11,2.13,8.72,0.25,1.62,-0.28,-7.1,-1.67,-29.01,-3.12,-52.62,0,12,2.07,11.2,4.2,10.51,4.57,9.88,2.49,4.08,0.41,-1.71,-0.34,-10.46,-1.49,-32.37,-2.52,-55.59,0,12,1.84,12.92,3.68,13.8,4.03,13.41,2.61,6.3,1.2,-0.8,0.46,-15.02,0.42,-39.44,0.61,-64.43,0,12,1.54,14.47,2.96,16.75,3.26,16.56,2.66,8.33,2.05,0.11,1.37,-19.66,2.54,-46.91,4,-74]},{"value":[-92.67,19.33,-73.84,-2.53,-54.95,-17.99,-43.61,-6.22,-52.73,8.52,-63.83,-0.2,-83.87,-21.68,-108.31,-62.98,-133.98,-102.67,-72.87,16.86,-46,5.77,-18.95,-1.45,-3.32,16.78,-6.94,35.74,-15.83,19.71,-35.63,-5.98,-62.95,-44.67,-90.55,-82.42,-54.7,14.58,-20.33,13.79,13.99,14.2,33.5,38.41,35.09,61.96,28.18,39.01,8.89,9.27,-20.43,-26.51,-49.39,-62.17,-49.32,13.02,-17.4,15.46,12.52,18.18,30.14,42.55,32.44,68.49,25.09,45.44,8.53,16.67,-16.87,-14.92,-43.03,-47.86,-35,14.5,-16.42,13.35,-2.13,13.31,6.7,25.81,6.5,37.58,0.82,21.51,-11.77,3.64,-34.71,-23.28,-58.46,-52,-20.68,17.66,-9.37,13.2,-1.13,9.45,2.06,10.45,1.25,7.58,-0.91,-2.15,-9.12,-9.64,-28.88,-32.38,-49.73,-57.26,-17.66,17.34,-6.67,13.82,4.46,10.53,7.24,9.06,5.58,3.33,3.93,-2.4,-2.35,-10.12,-19.41,-33.8,-36.21,-59.16,-11.1,14.78,-3.74,12.42,3.66,10.26,5.5,9.31,4.27,6.55,3.04,3.79,-0.8,-10.13,-10,-37.64,-18.82,-66.29,-4,12,-0.61,10.77,2.52,9.63,3.26,9.42,2.66,10.33,2.05,11.25,0.93,-8.97,0.39,-41.36,0,-74]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00","timeline":[{"name":"D_HAIR_BACK.00_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_HAIR_BACK.00_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"D_HAIR_BACK.00_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_HAIR_BACK.00_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"D_HAIR_BACK.00_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_00","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-6.24,-1.37,-3.48,-2.66,9.34,-1.24,0.57,-4.97,-11.22,14.88,-2.84,6.45,-0.24,2.09,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.3,1.95,-4.25,4.29,0,0,-9.7,7.17,-11.69,7.69,0,0,0,0,0,0,0,0,0,0,0,0,-1.57,23.94,0,0,0,0,0,0,0,0,2.52,10.68,-3.69,11.77,-1.73,6.58,0,0,3.3,0.3,0,0,0,0,0,0,0,0,0,0,11.04,-2.72,-7.89,-0.31,-9.64,5.46,-15.71,-1.31,-2.02,-1.54,3.98,-1.83,5.07,-0.67,6.12,-1.84,-2.09,1.37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.58,6.85,-6.68,11.98,-9.35,10.72,-10.79,7.92,-0.13,1.15,-4.6,4.44]},{"duration":60,"tweenEasing":0,"value":[-6.24,-1.37,-3.48,-2.66,9.34,-1.24,2.1,-3.67,-6.34,1.02,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.3,1.95,-4.25,4.29,0,0,-8.57,2.82,-10.33,2.32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.3,0.3,0,0,0,0,0,0,0,0,0,0,11.04,-2.72,-7.89,-0.31,-13.51,-0.19,-15.71,-1.31,-2.02,-1.54,3.98,-1.83,5.07,-0.67,7.59,-2.35,-1.57,-1.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-4.68,1.54,-5.54,1.25,-5.58,1.25,-9.49,2.56,0,0,-3.95,1.3]},{"value":[-6.24,-1.37,-3.48,-2.66,9.34,-1.24,4.3,-4.45,-7.76,-7,-0.74,-0.58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.3,1.95,-4.25,4.29,0,0,-8.57,2.82,-13.24,-9.25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.3,0.3,0,0,0,0,0,0,0,0,0,0,11.04,-2.72,-7.89,-0.31,-13.51,-0.19,-15.71,-1.31,-2.02,-1.54,3.98,-1.83,5.07,-0.67,7.59,-2.35,-1.57,-1.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.24,-2.8,-9.24,-0.84,-7.04,-0.71,-9.49,2.56,0,0,-3.95,1.3]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_01","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-3.12,-0.68,-1.74,-1.33,4.67,-0.62,2.15,-2.22,-4.13,0.9,-0.81,4.35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.15,0.97,-2.12,2.14,0,0,-4.29,1.41,-5.17,1.16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.65,0.15,0,0,0,0,0,0,0,0,0,0,5.52,-1.36,-3.94,-0.16,-6.76,-0.09,-7.85,-0.66,-1.01,-0.77,1.99,-0.92,2.53,-0.34,3.8,-1.17,-0.78,-0.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.7,2.75,-3.14,2.64,-2.79,0.63,-4.74,1.28,0,0,-1.98,0.65]},{"duration":60,"tweenEasing":0,"value":[-3.12,-0.68,-1.74,-1.33,4.67,-0.62,2.15,-2.22,-4.96,1.72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.15,0.97,-2.12,2.14,0,0,-4.29,1.41,-5.17,1.16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.65,0.15,0,0,0,0,0,0,0,0,0,0,5.52,-1.36,-3.94,-0.16,-6.76,-0.09,-7.85,-0.66,-1.01,-0.77,1.99,-0.92,2.53,-0.34,3.8,-1.17,-0.78,-0.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.34,0.77,-2.77,0.62,-2.79,0.63,-4.74,1.28,0,0,-1.98,0.65]},{"value":[-3.12,-0.68,-1.74,-1.33,4.67,-0.62,2.15,-2.22,-8.44,-5.82,-0.69,-5.22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.15,0.97,-2.12,2.14,0,0,-4.29,1.41,-7.78,-5.95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-0.88,-4.83,0,0,1.65,0.15,0,0,0,0,0,0,0,0,0,0,5.52,-1.36,-3.94,-0.16,-6.76,-0.09,-7.85,-0.66,-1.01,-0.77,1.99,-0.92,2.53,-0.34,3.8,-1.17,-0.78,-0.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2.34,0.77,-2.77,0.62,-3.63,0.08,-6.77,-2.93,0,0,-1.98,0.65]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_02"},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_03","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-2.56,0.02,-1.21,1.01,-4.02,-2.13,5.49,-4.2,12.11,0.23,0,0,0,0,0,0,0,0,0,0,-0.56,-1.62,0.51,-2.54,-5.5,-9.39,-0.68,-2.51,6.36,-3.62,6.24,-1.84,0,0,20.03,2.37,25.71,4.42,19.57,3.74,33.45,-2.63,26.09,-2.42,10.81,2.02,11.96,1.96,30.8,5.55,31.85,3.47,28.28,4.25,17.43,3.6,3.69,-5.01,11.39,2.52,19.05,-0.32,18.49,4.52,13.03,0.63,17.59,-6.98,5.9,-2.91,5.36,-8.98,20.08,-0.79,6.5,-2.09,-4.33,-4.29,3.54,-1.18,3.3,-0.34,11.84,0.04,5.72,0.36,13.31,1.37,3.71,0.97,-2.98,-1.61,3.13,-2.39,5.42,-0.04,10.13,1.47,1.2,-6.82,-1.22,-9.71,-2.36,-4.75,-1.59,-5.41,-3.68,-4.43,-1.64,-7.38,1.14,-3.71,-1.84,-2.27,1.28,-4.01,10.93,1.3,13.78,2.37,19.46,2.49,22.99,3.44,0,0,9.24,1.1]},{"duration":60,"tweenEasing":0,"value":[-2.56,0.02,-1.21,1.01,-4.02,-2.13,5.49,-4.2,12.11,0.23,0,0,0,0,0,0,0,0,0,0,-0.56,-1.62,0.51,-2.54,-5.5,-9.39,0.9,-1.79,6.36,-3.62,6.24,-1.84,0,0,20.03,2.37,25.71,4.42,19.57,3.74,33.45,-2.63,26.09,-2.42,10.81,2.02,11.96,1.96,30.8,5.55,31.85,3.47,28.28,4.25,17.43,3.6,3.69,-5.01,11.39,2.52,19.05,-0.32,18.49,4.52,13.03,0.63,17.59,-6.98,5.9,-2.91,5.36,-8.98,20.08,-0.79,6.5,-2.09,-4.33,-4.29,3.54,-1.18,3.3,-0.34,11.84,0.04,5.72,0.36,13.31,1.37,3.71,0.97,-2.98,-1.61,3.13,-2.39,5.42,-0.04,10.13,1.47,1.2,-6.82,-1.22,-9.71,0.01,-4.03,-1.59,-5.41,-3.68,-4.43,-1.64,-7.38,1.14,-3.71,-1.84,-2.27,1.28,-4.01,10.93,1.3,13.78,2.37,19.46,2.49,22.99,3.44,0,0,9.24,1.1]},{"value":[-2.56,0.02,-1.21,1.01,-4.02,-2.13,5.49,-4.2,12.11,0.23,0,0,0,0,0,0,0,0,0,0,-0.56,-1.62,0.51,-2.54,-5.5,-9.39,-0.68,-2.51,6.36,-3.62,6.24,-1.84,0,0,20.03,2.37,25.71,4.42,19.57,3.74,33.45,-2.63,26.09,-2.42,10.81,2.02,11.96,1.96,30.8,5.55,31.85,3.47,28.28,4.25,17.43,3.6,3.69,-5.01,11.39,2.52,19.05,-0.32,18.49,4.52,13.03,0.63,17.59,-6.98,5.9,-2.91,5.36,-8.98,20.08,-0.79,6.5,-2.09,-4.33,-4.29,3.54,-1.18,3.3,-0.34,11.84,0.04,5.72,0.36,13.31,1.37,3.71,0.97,-2.98,-1.61,3.13,-2.39,5.42,-0.04,10.13,1.47,1.2,-6.82,-1.22,-9.71,-2.36,-4.75,-1.59,-5.41,-3.68,-4.43,-1.64,-7.38,1.14,-3.71,-1.84,-2.27,1.28,-4.01,10.93,1.3,13.78,2.37,19.46,2.49,22.99,3.44,0,0,9.24,1.1]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_HAIR_BACK.00_04","timeline":[{"name":"D_HAIR_BACK.00","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-5.12,0.03,-2.43,2.02,-8.05,-4.25,2.23,-4.1,24.22,0.45,0,0,0,0,0,0,0,0,0,0,0,0,1.01,-5.07,-8.61,-17.84,3.46,-6.64,15.24,-8.46,12.49,-3.68,0,0,40.07,4.75,51.41,8.85,31.65,20.1,61.44,22.41,47.17,2.96,21.61,4.04,27.75,13.14,61.6,11.1,63.71,6.94,56.56,8.51,34.86,7.2,7.38,-10.02,18.49,6.46,38.09,-0.63,36.99,9.05,26.06,1.25,29.68,1.03,11.8,-5.82,6.91,-10.13,30.63,9.28,11.91,-1.76,-8.67,-8.58,6.82,3.13,6.97,-2.46,23.68,0.09,11.44,0.72,26.63,2.74,7.43,1.93,-5.97,-3.23,-0.23,-1.88,-3.81,-0.14,20.27,2.95,6.84,-10.04,-2.44,-19.42,1.14,-6.66,-2.03,-9.76,-7.37,-8.85,-3.28,-14.75,2.28,-7.43,-3.68,-4.53,2.56,-8.01,21.86,2.59,27.57,4.75,38.91,4.99,45.98,6.88,0,0,18.48,2.19]},{"duration":60,"tweenEasing":0,"value":[-5.12,0.03,-2.43,2.02,-8.05,-4.25,2.23,-4.1,24.22,0.45,0,0,0,0,0,0,0,0,0,0,-1.11,-3.23,1.01,-5.07,-4.49,-17.21,-1.36,-5.02,12.71,-7.24,12.49,-3.68,0,0,40.07,4.75,51.41,8.85,39.14,7.48,64.02,10.1,52.19,-4.85,21.61,4.04,23.92,3.92,61.6,11.1,63.71,6.94,56.56,8.51,34.86,7.2,7.38,-10.02,18.49,6.46,38.09,-0.63,36.99,9.05,26.06,1.25,32.39,-11.79,11.8,-5.82,10.73,-17.97,30.6,-0.56,12.99,-4.19,-8.67,-8.58,7.08,-2.37,6.59,-0.68,23.68,0.09,11.44,0.72,26.63,2.74,7.43,1.93,-5.97,-3.23,-0.23,-1.88,-3.81,-0.14,20.27,2.95,2.41,-13.64,-2.44,-19.42,2.32,-8.69,-3.18,-10.81,-5.76,-8.83,-3.28,-14.75,2.28,-7.43,-3.68,-4.53,2.56,-8.01,21.86,2.59,27.57,4.75,38.91,4.99,45.98,6.88,0,0,18.48,2.19]},{"value":[-5.12,0.03,-2.43,2.02,-8.05,-4.25,2.23,-4.1,24.22,0.45,0,0,0,0,0,0,0,0,0,0,-1.11,-3.23,6.1,-3.32,-5.29,-27.41,-1.31,-7.98,12.71,-7.24,12.49,-3.68,0,0,40.07,4.75,51.41,8.85,33.09,-0.08,61.88,-8.15,52.19,-4.85,21.61,4.04,23.92,3.92,61.6,11.1,63.71,6.94,56.56,8.51,34.86,7.2,7.38,-10.02,18.49,6.46,38.09,-0.63,36.99,9.05,26.06,1.25,32.27,-14.63,11.8,-5.82,10.73,-17.97,30.43,-4.95,12.81,-13.59,-7.04,-13.77,8.33,-5.77,6.59,-0.68,23.68,0.09,11.44,0.72,26.63,2.74,7.43,1.93,-5.97,-3.23,-0.23,-1.88,-3.81,-0.14,20.27,2.95,3.77,-17.5,-1.01,-26.27,-1.48,-12.5,-1.55,-17.56,-5.74,-17.15,-2.47,-21.62,0.77,-12.29,-3.68,-4.53,0.01,-10.83,21.86,2.59,27.57,4.75,38.91,4.99,45.98,6.88,0,0,18.48,2.19]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.04","timeline":[{"name":"B_CLOTHES.04_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.04_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.04_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.04_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_00","timeline":[{"name":"B_CLOTHES.04","type":12,"frame":[{"duration":121,"x":-3.5}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_02","timeline":[{"name":"B_CLOTHES.04","type":12,"frame":[{"duration":121,"x":59.6}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.04_03","timeline":[{"name":"B_CLOTHES.04","type":11,"frame":[{"duration":121,"x":-22.7,"y":0.32}]},{"name":"B_CLOTHES.04","type":12,"frame":[{"duration":121,"x":60.9}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.07","timeline":[{"name":"B_CLOTHES.07_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.07_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.07_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.07_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_00","timeline":[{"name":"B_CLOTHES.07","type":12,"frame":[{"duration":121,"x":-11}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_02","timeline":[{"name":"B_CLOTHES.07","type":11,"frame":[{"duration":121,"x":1.65,"y":-12.82}]},{"name":"B_CLOTHES.07","type":12,"frame":[{"duration":121,"x":7.37}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.07_03","timeline":[{"name":"B_CLOTHES.07","type":11,"frame":[{"duration":121,"x":1.65,"y":-12.82}]},{"name":"B_CLOTHES.07","type":12,"frame":[{"duration":121,"x":8.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.36","timeline":[{"name":"B_CLOTHES.36_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.36_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.36_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.36_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_00","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[1.54,38.07,0.45,24.73,-0.97,14.08,-1.52,5.9,0,0,0,0,0,0,0,0,0,0,1.57,30.68,0.59,19.92,-0.56,11.24,-1.04,4.61,0,0,0,0,0,0,0,0,0,0,1.61,22.52,0.74,14.44,-0.16,8.01,-0.58,3.2,0,0,0,0,0,0,0,0,0,0,1.64,15.91,0.93,10.25,0.23,5.54,-0.17,2.03,0,0,0,0,0,0,0,0,0,0,1.65,13.19,1.16,9.34,0.62,5.01,0.18,1.46,0,0,0,0,0,0,0,0,0,0,1.47,11.75,1.05,8.57,0.58,4.68,0.19,1.39,0,0,0,0,0,0,0,0,0,0,1.03,8.24,0.73,6.06,0.41,3.33,0.15,0.99,0,0,0,0,0,0,0,0,0,0,0.49,3.92,0.34,2.86,0.19,1.56,0.07,0.46]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.89,-5.84,2.04,-8.54,2.19,-8.11,1.47,-5.08,0,0,0,0,0,0,0,0,0,0,0.72,-10.08,1.69,-11.11,1.94,-10.15,1.54,-7.55,0.55,-3.64,0.41,-3.07,0.27,-1.82,0.13,-0.57,0,0,0.53,-14.76,1.24,-13.66,1.49,-11.19,1.32,-8.03,0.74,-4.85,0.54,-4.09,0.35,-2.43,0.17,-0.76,0,0,0.37,-18.55,0.74,-15.08,0.88,-10.57,0.81,-6.33,0.55,-3.64,0.41,-3.07,0.27,-1.82,0.13,-0.57,0,0,0.31,-20.12,0.24,-14.24,0.14,-7.63,0.04,-2.23,0,0,0,0,0,0,0,0,0,0,0.28,-17.91,0.22,-13.07,0.12,-7.14,0.04,-2.12,0,0,0,-0.87,0.01,-1.17,0,-0.87,0,0,0.19,-12.57,0.14,-9.24,0.09,-5.07,0.04,-1.51,0,0,0.01,-1.75,0.01,-2.33,0.01,-1.75,0,0,0.09,-5.97,0.06,-4.36,0.04,-2.38,0.03,-0.71,0,0,0.01,-2.62,0.02,-3.5,0.01,-2.62,0,0,0,0,0,0,0,0,0,0,0,0,0.02,-3.5,0.02,-4.66,0.02,-3.5]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_01","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[1.77,51.28,1.42,34.68,1.14,20.25,0.95,9.27,0.89,3.02,0.79,2.67,0.55,1.85,0.26,0.85,0,0,1.51,45.01,1.05,31.13,0.74,18.85,0.52,9.49,0.36,4.36,0.33,3.85,0.24,2.65,0.11,1.21,0,0,1.22,38.08,0.65,27.02,0.29,17.18,0.04,9.73,-0.22,5.84,-0.16,5.16,-0.1,3.52,-0.04,1.59,0,0,0.98,32.47,0.38,23.96,-0.07,16.01,-0.42,9.94,-0.69,7.05,-0.57,6.22,-0.38,4.25,-0.18,1.92,0,0,0.89,30.16,0.34,23.56,-0.24,16.12,-0.7,10.05,-0.89,7.54,-0.78,6.68,-0.53,4.62,-0.24,2.14,0,0,0.79,26.86,0.33,21.42,-0.17,14.75,-0.59,9.1,-0.79,6.72,-0.68,5.91,-0.46,4,-0.21,1.77,0,0,0.55,18.85,0.21,15.11,-0.11,10.42,-0.39,6.41,-0.55,4.71,-0.48,4.14,-0.32,2.78,-0.14,1.22,0,0,0.26,8.95,0.09,7.14,-0.06,4.92,-0.17,3.03,-0.26,2.24,-0.23,1.97,-0.15,1.33,-0.07,0.59]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":2,"value":[0.25,-1.32,0.54,-2.81,0.78,-4.02,0.89,-4.52,0.78,-4.01,0.53,-2.78,0.24,-1.28,0,0,0.79,-5.82,0.8,-5.57,0.86,-5.13,0.91,-4.71,0.89,-4.52,0.78,-4.01,0.53,-2.78,0.24,-1.28,0,0,1.66,-12.25,1.43,-10.33,1.23,-7.75,1.04,-5.49,0.89,-4.52,0.78,-4.01,0.54,-2.78,0.24,-1.28,0,0,2.37,-17.46,1.95,-14.06,1.5,-9.77,1.11,-6.09,0.89,-4.52,0.78,-4.01,0.54,-2.77,0.24,-1.28,0,0,2.66,-19.61,2.15,-15.2,1.57,-10.24,1.09,-6.2,0.89,-4.52,0.78,-4.01,0.54,-2.77,0.25,-1.28,0,0,2.37,-17.46,1.93,-13.83,1.43,-9.38,1,-5.62,0.79,-4.03,0.68,-3.54,0.46,-2.4,0.21,-1.06,0,0,1.66,-12.25,1.35,-9.76,1.01,-6.63,0.72,-3.96,0.55,-2.83,0.47,-2.48,0.32,-1.67,0.15,-0.73,0,0,0.79,-5.82,0.64,-4.61,0.48,-3.13,0.34,-1.87,0.26,-1.34,0.23,-1.18,0.15,-0.8,0.07,-0.35]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_02","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[8.2,105.91,0.08,82.08,-4.7,53.43,-5.11,26.58,-0.1,8.12,-0.08,7.2,-0.05,4.98,-0.01,2.3,0,0,9.21,92.64,2.79,71.42,-0.92,46.06,-1.33,22.9,2.14,8.29,2.55,7.48,3.2,5.41,3.1,2.57,1.28,-0.54,10.16,79.26,5.53,60.63,2.9,38.62,2.51,19.23,4.62,8.47,5.39,7.77,6.62,5.81,6.36,2.78,2.69,-1.13,11.24,66.09,8.35,49.99,6.54,31.25,5.93,15.56,6.63,8.62,7.81,8.05,9.67,6.26,9.31,3.09,3.83,-1.61,12.64,53.41,11.22,39.77,9.77,24.09,8.45,11.89,7.45,8.68,9.19,8.31,11.83,6.82,11.49,3.64,4.3,-1.8,19.67,50.66,20.58,37.4,19.15,22.18,15.84,10.62,11.11,8.36,11.6,7.76,12.42,5.9,10.94,2.62,4.5,-2.19,25.52,39.38,28.4,27.87,26.94,15.89,21.57,7.72,12.77,7.61,12.64,6.79,12.28,4.53,10.22,1.12,4.99,-3.14,30.9,24.69,35.65,15.43,34.03,7.82,26.54,4.15,13.63,6.7,13.13,5.65,11.82,2.98,9.41,-0.58,5.6,-4.32,36.52,11.7,43.32,4.4,41.51,0.59,31.8,0.89,14.89,5.87,13.89,4.59,11.51,1.51,8.63,-2.19,6.15,-5.38]},{"duration":60,"tweenEasing":0,"offset":161},{"value":[0.28,-9.65,0.22,-6.83,0.12,-3.66,0.04,-1.07,0,0,0,0,0,0,0,0,0,0,0.26,-12.96,0.04,-9.56,-0.23,-5.67,-0.46,-2.48,-0.57,-1.15,-0.49,-1.01,-0.34,-0.68,-0.16,-0.3,0,0,0.24,-16.62,-0.15,-12.59,-0.61,-7.91,-1,-4.04,-1.19,-2.42,-1.03,-2.12,-0.7,-1.43,-0.33,-0.62,0,0,0.22,-19.57,-0.31,-15,-0.92,-9.69,-1.45,-5.28,-1.7,-3.45,-1.47,-3.03,-1.01,-2.05,-0.47,-0.91,0,0,0.21,-20.79,-0.39,-15.85,-1.09,-10.29,-1.67,-5.75,-1.91,-3.87,-1.7,-3.43,-1.18,-2.37,-0.55,-1.09,0,0,0.5,-22.87,-1.61,-18.26,-2.76,-12.42,-2.83,-6.95,-1.7,-3.45,-1.47,-3.03,-1.01,-2.05,-0.47,-0.91,0,0,1.2,-27.92,-2.39,-23.07,-4.07,-15.72,-3.7,-8.1,-1.19,-2.42,-1.02,-2.12,-0.7,-1.43,-0.33,-0.62,0,0,2.07,-34.15,-3,-28.85,-5.24,-19.5,-4.5,-9.23,-0.57,-1.15,-0.49,-1.01,-0.34,-0.68,-0.16,-0.3,0,0,2.86,-39.79,-3.67,-34.14,-6.51,-23.05,-5.38,-10.39]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.36_03","timeline":[{"name":"B_CLOTHES.36","type":50,"frame":[{"duration":60,"tweenEasing":0,"value":[7.91,132.11,5.18,113.03,-0.71,87.91,-4.26,51.86,0,0,0,0,0,0,0,0,0,0,10.57,117.82,9.23,100.32,3.93,76.24,-0.69,43.5,0,0,0,0,0,0,0,0,0,0,13.23,103.97,13.34,87.98,8.56,64.86,2.81,35.3,0,0,0,0,0,0,0,0,0,0,15.88,89.25,17.46,74.91,13.19,53.05,6.3,26.97,0,0,0,0,0,0,0,0,0,0,18.52,72.36,21.56,60.01,17.82,40.13,9.79,18.28,0,0,0,0,0,0,0,0,0,0,20.57,56.54,22.2,47.01,18.59,31.23,11.09,13.97,1.08,0,1.16,0,0.84,0,0.37,0,0,0,23.86,37.5,24.23,31.28,20.79,20.74,13.84,9.2,3.69,-0.01,3.46,-0.01,2.43,0,1.11,0,0,0,27.64,17.17,27,14.44,23.61,9.62,17.05,4.28,6.92,-0.02,6.2,-0.02,4.3,-0.01,1.98,-0.01,0,0,31.17,-2.52,29.78,-1.84,26.21,-1.17,19.8,-0.55,9.84,-0.03,8.72,-0.02,6.03,-0.02,2.79,-0.01]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":18,"value":[2.17,-5.43,1.54,-3.96,0.87,-2.16,0.31,-0.64,0,0,0,0,0,0,0,0,0,0,4.57,-11.43,3.28,-8.4,1.86,-4.61,0.66,-1.37,0,0,0,0,0,0,0,0,0,0,6.52,-16.29,4.68,-11.88,2.62,-6.49,0.88,-1.92,0,0,0,0,0,0,0,0,0,0,7.32,-18.29,5.2,-12.94,2.79,-6.93,0.82,-2.03,0,0,0,0,0,0,0,0,0,0,6.52,-16.29,4.68,-11.88,2.62,-6.49,0.88,-1.92,0,0,0,0,0,0,0,0,0,0,4.57,-11.43,3.29,-8.4,1.86,-4.61,0.65,-1.37,0,0,0,0,0,0,0,0,0,0,2.17,-5.43,1.55,-3.96,0.87,-2.16,0.31,-0.64]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAND.08","timeline":[{"name":"B_HAND.08_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAND.08_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_HAND.08_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_HAND.08_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_00","timeline":[{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-6.6},{"duration":60,"tweenEasing":0},{"x":19.5}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_01","timeline":[{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-12.7},{"duration":60,"tweenEasing":0},{"x":14.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_02","timeline":[{"name":"B_HAND.08","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-3.91,"y":-0.85},{"duration":61}]},{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-34.5},{"duration":60,"tweenEasing":0,"x":15},{"x":25.1}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.08_03","timeline":[{"name":"B_HAND.08","type":11,"frame":[{"duration":121,"x":10.98,"y":7.2}]},{"name":"B_HAND.08","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-37.8},{"duration":60,"tweenEasing":0,"x":18.1},{"x":24.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.13","timeline":[{"name":"D_CLOTHES.13_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.13_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"D_CLOTHES.13_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"D_CLOTHES.13_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_00","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":121,"value":[-1.76,-2.49,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,0,0,0,0,0,0,0,0,0,0,0,0,1.82,8.32]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_01","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.94,-6.94,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-10.35,-3.91]},{"duration":60,"tweenEasing":0,"offset":41},{"value":[-2.94,4.41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-6.73,1.88]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_02","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-6.39,-5.27,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,2.2,-3.18,23.13,-15.27,8.11,-17.93,15.38,-2.68,0,0,0,0,0,0,-7.95,-1.01]},{"duration":60,"tweenEasing":0,"value":[-10.85,-2.42,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,2.2,-3.18,23.13,-15.27,8.11,-17.93,15.38,-2.68,0,0,0,0,0,0,-7.29,1.45]},{"value":[-5.74,4.06,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,2.2,-3.18,23.13,-15.27,8.11,-17.93,23.96,-8.41,0,0,0,0,0,0,-6.62,3.9]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.13_03","timeline":[{"name":"D_CLOTHES.13","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[4.35,-8.53,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,19.05,-5.98,-7.44,-34.98,12.3,-16.28,0,0,0,0,0,0,-7.5,0.63]},{"duration":60,"tweenEasing":0,"value":[-1.07,-2.83,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,19.05,-5.98,-7.44,-34.98,12.3,-16.28,0,0,0,0,0,0,-2.83,3.97]},{"value":[-4.81,4.89,0,0,0,0,0,0,0,0,0,0,-2.01,12.33,-2.01,4.11,19.05,-5.98,-7.44,-34.98,12.3,-16.28,0,0,0,0,0,0,-2.83,3.97]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.31","timeline":[{"name":"B_CLOTHES.31_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.31_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.31_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.31_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_00","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_01","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_02","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.31_03","timeline":[{"name":"B_CLOTHES.31","type":12,"frame":[{"duration":40,"tweenEasing":0,"x":8.1},{"duration":40,"tweenEasing":0},{"duration":41,"x":-8.2}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.32","timeline":[{"name":"B_CLOTHES.32_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.32_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"B_CLOTHES.32_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"B_CLOTHES.32_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_00","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_01","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_02","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.32_03","timeline":[{"name":"B_CLOTHES.32","type":11,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-45.14,"y":4.63},{"x":-91.48,"y":-1.53}]},{"name":"B_CLOTHES.32","type":12,"frame":[{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0},{"duration":40,"tweenEasing":0,"x":-90.1},{"x":-94.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.10","timeline":[{"name":"D_CLOTHES.10_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.10_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.3333},{"name":"D_CLOTHES.10_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.3333},{"name":"D_CLOTHES.10_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_00","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-0.97,-2.48,0,0,0,0,0,0,0,0,0,0,2.25,10.87,-0.94,0.8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-14.67,-2.59,0,0,0,0,-1.95,-4.97]},{"duration":60,"tweenEasing":0,"offset":12,"value":[2.25,10.87,-0.94,0.8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3.19,-3.55]},{"value":[1.12,2.47,0,0,0,0,0,0,0,0,0,0,2.25,10.87,-0.94,0.8,0,0,0,0,0,0,4.08,3.99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.97,1.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_01","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[6.74,-2.52,0,0,0,0,0,0,0,0,0,0,2.25,10.87,0,9.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.49,-1.68,0,0,0,0,4.45,-6.7]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[7.14,5.79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.62,1.63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.45,-0.88,0,0,0,0,4.84,4.98,2.47,3.32]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_02","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[27.2,2.02,0,0,0,0,0,0,0,0,-17.97,-13.9,17.9,8.32,0,9.2,0,0,0,0,0,0,10.91,1.49,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,16.32,1.39,0,0,0,0,23.32,-1.78,12.06,1.16,12.09,3.14]},{"duration":60,"tweenEasing":0,"value":[22.2,3.45,0,0,0,0,0,0,0,0,-17.97,-13.9,17.9,8.32,0,9.2,0,0,0,0,0,0,10.91,1.49,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,10.94,3.65,0,0,0,0,21.45,2.39,12.06,1.16,12.09,3.14]},{"value":[24.93,8.59,0,0,0,0,0,0,0,0,-17.97,-13.9,17.9,8.32,0,9.2,0,0,0,0,0,0,16.79,4.32,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,10.94,3.65,0,0,0,0,27.57,5.93,12.06,1.16,12.09,3.14]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.10_03","timeline":[{"name":"D_CLOTHES.10","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[24.34,9,0,0,0,0,0,0,0,0,-9.57,-14.01,32.19,11.47,0,9.2,0,0,0,0,0,0,17.99,1.07,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,16.1,2.06,0,0,0,0,26.73,1.74,11.63,2.05,12.09,3.14]},{"duration":60,"tweenEasing":0,"value":[24.34,9,0,0,0,0,0,0,0,0,-9.57,-14.01,32.19,11.47,0,9.2,0,0,0,0,0,0,17.99,1.07,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,13.17,3.75,0,0,0,0,27.92,4.52,11.63,2.05,12.09,3.14]},{"value":[21.76,16.17,0,0,0,0,0,0,0,0,-9.57,-14.01,32.19,11.47,0,9.2,0,0,0,0,0,0,17.85,7.39,0,0,0,0,0,0,0,0,0,0,0,0,19.92,0.52,0,0,0,0,0,0,0,0,0,0,11.23,9.13,0,0,0,0,31.36,8.29,15.46,4.93,11.46,4.92]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.40","timeline":[{"name":"B_CLOTHES.40_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.40_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.40_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.40_00","timeline":[{"name":"B_CLOTHES.40","type":12,"frame":[{"duration":121,"x":2}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.40_01"},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.40_02","timeline":[{"name":"B_CLOTHES.40","type":12,"frame":[{"duration":121,"x":-2.5}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_CLOTHES.41","timeline":[{"name":"B_CLOTHES.41_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_CLOTHES.41_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_CLOTHES.41_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.41_00","timeline":[{"name":"B_CLOTHES.41","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":9.21,"y":-1.49},{"duration":60,"tweenEasing":0},{"x":-17.77,"y":2.88}]},{"name":"B_CLOTHES.41","type":12,"frame":[{"duration":121,"x":-6}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.41_01","timeline":[{"name":"B_CLOTHES.41","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":10.58,"y":-1.34},{"duration":60,"tweenEasing":0},{"x":-25.79,"y":3.26}]},{"name":"B_CLOTHES.41","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":1.4}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_CLOTHES.41_02","timeline":[{"name":"B_CLOTHES.41","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":9.3,"y":-0.76},{"duration":60,"tweenEasing":0},{"x":-21.93,"y":1.8}]},{"name":"B_CLOTHES.41","type":12,"frame":[{"duration":121,"x":13.2}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAND.18","timeline":[{"name":"B_HAND.18_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAND.18_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.18_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.18_00","timeline":[{"name":"B_HAND.18","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-32.95,"y":-1.53},{"duration":61}]},{"name":"B_HAND.18","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-3.1},{"duration":60,"tweenEasing":0,"x":-3.1},{"x":2.6}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.18_01","timeline":[{"name":"B_HAND.18","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-35.43,"y":-0.47},{"duration":61}]},{"name":"B_HAND.18","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":4.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.18_02","timeline":[{"name":"B_HAND.18","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-29.39,"y":0.98},{"duration":61}]},{"name":"B_HAND.18","type":12,"frame":[{"duration":60,"tweenEasing":0},{"duration":60,"tweenEasing":0},{"x":5.7}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.18","timeline":[{"name":"D_CLOTHES.18_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.18_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.18_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.18_00","timeline":[{"name":"D_CLOTHES.18","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":39},{"duration":60,"tweenEasing":0,"offset":39},{"value":[-20.34,-1.46,6.33,16.06,-20.82,16.07,-24.31,-0.96,0,0,0,0,-8.27,-1.64,0,0,-17.36,0.85,-15.87,2.01,0,0,0,0,0,0,-13.4,0.35,0,0,-15.05,-2.13]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.18_01","timeline":[{"name":"D_CLOTHES.18","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[11.75,7.92,0,0,0,0,0,0,0,0,5.29,-0.67,6.61,-0.84,0,0,0,0,0,0,0,0,0,0,18.52,-2.34,17.53,0.47]},{"duration":60,"tweenEasing":0,"offset":39},{"value":[-20.34,-1.46,-12.06,10.93,-20.82,16.07,-24.31,-0.96,0,0,0,0,-8.27,-1.64,0,0,-17.36,0.85,-15.87,2.01,0,0,0,0,0,0,-13.4,0.35,0,0,-15.05,-2.13]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.18_02","timeline":[{"name":"D_CLOTHES.18","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":39},{"duration":60,"tweenEasing":0,"offset":39},{"value":[-20.34,-1.46,-12.06,10.93,-20.82,16.07,-24.31,-0.96,0,0,0,0,-8.27,-1.64,0,0,-17.36,0.85,-15.87,2.01,0,0,0,0,0,0,-13.4,0.35,0,0,-15.05,-2.13]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.19","timeline":[{"name":"D_CLOTHES.19_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.19_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.19_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.19_00","timeline":[{"name":"D_CLOTHES.19","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-25.3,-2.97,-36.13,-9.51,-29.33,-9.34,-18.08,1.39,-12.88,2.56,-9.98,1.85,-31.68,1.06,-15.19,0.68,-24.29,-1.37,2.47,-4.91,14.6,1.92,5.2,1.17,14.73,7.42,4.91,2.47,0,0,-31.68,1.06,-16.49,0.38,-21.56,4.71,-20.81,-4.69,-37.59,-3,-44.3,-1.86,-23.28,0.22,-32.55,4.96,-58.86,0.4,-53.37,0.27,-32.68,-0.53,-21.69,-0.79,-27.61,-4.85,12,1.34,15.9,2.22]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[2.35,8.63,0.52,4.18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.97,2.35,13.07,2.61]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.19_01","timeline":[{"name":"D_CLOTHES.19","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-25.3,-2.97,-36.13,-9.51,-29.33,-9.34,-18.08,1.39,-12.88,2.56,-9.98,1.85,-31.68,1.06,-15.19,0.68,-24.29,-1.37,2.47,-4.91,14.6,1.92,5.2,1.17,14.73,7.42,4.91,2.47,0,0,-31.68,1.06,-16.49,0.38,-21.56,4.71,-20.81,-4.69,-37.59,-3,-44.3,-1.75,-23.28,0.22,-32.55,4.96,-58.86,0.4,-53.37,0.27,-32.68,-0.53,-21.69,-0.79,-27.61,-4.85,12,1.34,15.9,2.22]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[2.35,8.63,0.52,4.18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.97,2.35,13.07,2.61]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.19_02","timeline":[{"name":"D_CLOTHES.19","type":22,"frame":[{"duration":60,"tweenEasing":0,"value":[-25.3,-2.97,-36.13,-9.51,-29.33,-9.34,-18.08,1.39,-12.88,2.56,-9.98,1.85,-31.68,1.06,-15.19,0.68,-24.29,-1.37,2.47,-4.91,14.6,1.92,5.2,1.17,14.73,7.42,4.91,2.47,0,0,-31.68,1.06,-16.49,0.38,-21.56,4.71,-20.81,-4.69,-37.59,-3,-44.3,-1.75,-23.28,0.22,-32.55,4.96,-58.86,0.4,-53.37,0.27,-32.68,-0.53,-21.69,-0.79,-27.61,-4.85,12,1.34,15.9,2.22]},{"duration":60,"tweenEasing":0,"offset":59},{"value":[2.35,8.63,0.52,4.18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4.97,2.35,13.07,2.61]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_HAND.17","timeline":[{"name":"B_HAND.17_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_HAND.17_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_HAND.17_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.17_00","timeline":[{"name":"B_HAND.17","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-14.07,"y":4.14},{"duration":61}]},{"name":"B_HAND.17","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-1.7},{"duration":60,"tweenEasing":0,"x":2},{"x":-1.7}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.17_01","timeline":[{"name":"B_HAND.17","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-5.75,"y":-1.58},{"duration":61}]},{"name":"B_HAND.17","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":0.9},{"duration":60,"tweenEasing":0},{"x":-3.3}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_HAND.17_02","timeline":[{"name":"B_HAND.17","type":11,"frame":[{"duration":60,"tweenEasing":0,"x":-12,"y":0.31},{"duration":61}]},{"name":"B_HAND.17","type":12,"frame":[{"duration":60,"tweenEasing":0,"x":-5},{"duration":60,"tweenEasing":0,"x":-7.1},{"x":-2.8}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.16","timeline":[{"name":"D_CLOTHES.16_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.16_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.16_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.16_00","timeline":[{"name":"D_CLOTHES.16","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":47},{"duration":60,"tweenEasing":0,"offset":47},{"offset":10,"value":[-25.72,2.97,-24.14,0.44,-24.27,1.77,-30.78,-0.18,-21,-4.63,-1.3,-14.85,0,0,-13.4,0.1,0,0,0,0,0,0,0,0,0,0,0,0,-25.35,-1.01,-33.81,3.56,-26.92,1.52,-31.74,-4.28,-25.72,2.97]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.16_01","timeline":[{"name":"D_CLOTHES.16","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":47},{"duration":60,"tweenEasing":0,"offset":47},{"offset":10,"value":[-25.72,2.97,-24.14,0.44,-24.27,1.77,-30.78,-0.18,-21,-4.63,-1.3,-14.85,0,0,-13.4,0.1,0,0,0,0,0,0,0,0,0,0,0,0,-25.35,-1.01,-33.81,3.56,-26.92,1.52,-31.74,-4.28,-25.72,2.97]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.16_02","timeline":[{"name":"D_CLOTHES.16","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":47},{"duration":60,"tweenEasing":0,"offset":47},{"offset":10,"value":[-25.72,2.97,-24.14,0.44,-24.27,1.77,-30.78,-0.18,-21,-4.63,-1.3,-14.85,0,0,-13.4,0.1,0,0,0,0,0,0,0,0,0,0,0,0,-25.35,-1.01,-33.81,3.56,-26.92,1.52,-31.74,-4.28,-25.72,2.97]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"D_CLOTHES.17","timeline":[{"name":"D_CLOTHES.17_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"D_CLOTHES.17_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"D_CLOTHES.17_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.17_00","timeline":[{"name":"D_CLOTHES.17","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.24,-1.85,-10.2,3.38,1.05,-1.57,-5.23,1.04,0,0,-11.17,0.86,20.87,-1.57,20.55,5.71,30,-9.33,28.83,-7.41,39.18,-19.91,29.24,3.61,0,0,-3.13,-2.1,0,0,-19.09,-0.3,-27.45,-1.36,-1.04,-5.23,-31.39,-3.57,-4.04,3.79,3.55,1.94,26.92,-11.98,27.21,-6.75,35.34,-15.49,9.39,0.9,20.7,2.38,8.21,4.75,0.92,0.36,3.17,4.07,-5.93,-0.69,-13.37,5.81,-15.02,2.54]},{"duration":61,"offset":65}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.17_01","timeline":[{"name":"D_CLOTHES.17","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.24,-1.85,-10.2,3.38,1.05,-1.57,-5.23,1.04,0,0,-11.17,0.86,20.87,-1.57,20.55,5.71,30,-9.33,31.46,1.55,43.13,-8.66,29.24,3.61,0,0,-3.13,-2.1,0,0,-19.09,-0.3,-27.45,-1.36,-1.04,-5.23,-31.39,-3.57,-4.04,3.79,3.55,1.94,30.08,-5.96,27.21,-6.75,35.34,-15.49,9.39,0.9,20.7,2.38,8.21,4.75,0.92,0.36,3.17,4.07,-5.93,-0.69,-13.37,5.81,-15.02,2.54]},{"duration":61,"offset":65}]}]},{"type":"node","duration":120,"playTimes":0,"name":"D_CLOTHES.17_02","timeline":[{"name":"D_CLOTHES.17","type":22,"frame":[{"duration":60,"tweenEasing":0,"offset":2,"value":[-11.24,-1.85,-10.2,3.38,1.05,-1.57,-5.23,1.04,0,0,-11.17,0.86,20.87,-1.57,20.55,5.71,30,-9.33,31.46,1.55,45.73,-2.37,29.24,3.61,0,0,-3.13,-2.1,0,0,-19.09,-0.3,-27.45,-1.36,-1.04,-5.23,-31.39,-3.57,-4.04,3.79,3.55,1.94,30.08,-5.96,27.21,-6.75,35.34,-15.49,9.39,0.9,20.7,2.38,8.21,4.75,0.92,0.36,3.17,4.07,-5.93,-0.69,-13.37,5.81,-15.02,2.54]},{"duration":60,"tweenEasing":0,"offset":65},{"offset":34,"value":[8.14,5.12,16.03,0.91,14.7,0.95,13.36,0.98,0,0,0,0,0,0,0,0,6.16,0.45,0,0,6.7,0.49,0,0,6.53,0.42,0,0,7.02,0.45,4.41,0.28]}]}]},{"type":"node","blendType":"1d","duration":120,"playTimes":0,"name":"B_NECK.03","timeline":[{"name":"B_NECK.03_00","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-1},{"name":"B_NECK.03_01","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":-0.5},{"name":"B_NECK.03_02","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}]},{"name":"B_NECK.03_03","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":0.5},{"name":"B_NECK.03_04","type":40,"frame":[{"duration":120,"tweenEasing":0},{"value":1}],"x":1}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_00","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,5.36,21.02,11.28,21.02,16.08,21.02,18.05,21.02,18.67,20.93,20.17,20.72,22.02,20.47,23.69,20.24,0,21.02,4.05,21.03,8.52,21.07,12.14,21.11,13.65,21.13,13.43,21.05,13.16,20.87,12.85,20.65,12.56,20.47,0,21.02,2.75,21.06,5.78,21.16,8.25,21.26,9.31,21.31,8.15,21.24,5.99,21.06,3.42,20.87,1.06,20.72,0,21.02,1.42,21.07,2.98,21.18,4.26,21.29,4.83,21.35,2.94,21.29,-0.89,21.16,-5.49,21.02,-9.71,20.93,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,-2.04,21.02,-6.98,21.02,-13.09,21.02,-18.62,21.02,0,21.02,-5.67,20.97,-11.83,20.85,-17.01,20.74,-19.71,20.69,-20.13,20.69,-21.13,20.69,-22.35,20.69,-23.46,20.69,0,21.02,-10.87,20.93,-22.72,20.72,-32.62,20.52,-37.66,20.43,-35.93,20.48,-32.42,20.58,-28.2,20.68,-24.33,20.72,0,21.02,-15.44,20.93,-32.35,20.74,-46.33,20.55,-53,20.47,-49.4,20.54,-41.64,20.69,-32.21,20.84,-23.62,20.91,0,21.02,-19.26,21.02,-40.55,21.02,-57.78,21.02,-64.88,21.02,-60.37,21.02,-49.43,21.02,-35.92,21.02,-23.69,21.02]},{"duration":60,"tweenEasing":0,"offset":2,"value":[5.36,0,11.28,0,16.08,0,18.05,0,18.67,-0.09,20.17,-0.29,22.02,-0.55,23.69,-0.78,0,0,4.05,0.02,8.52,0.05,12.14,0.09,13.65,0.11,13.43,0.03,13.16,-0.15,12.85,-0.36,12.56,-0.55,0,0,2.75,0.05,5.78,0.15,8.25,0.25,9.31,0.29,8.15,0.22,5.99,0.05,3.42,-0.15,1.06,-0.29,0,0,1.42,0.05,2.98,0.16,4.26,0.28,4.83,0.33,2.94,0.27,-0.89,0.15,-5.49,0.01,-9.71,-0.09,0,0,0,0,0,0,0,0,0,0,-2.04,0,-6.98,0,-13.09,0,-18.62,0,0,0,-5.67,-0.05,-11.83,-0.16,-17.01,-0.28,-19.71,-0.33,-20.13,-0.33,-21.13,-0.33,-22.35,-0.33,-23.46,-0.33,0,0,-10.87,-0.09,-22.72,-0.29,-32.62,-0.49,-37.66,-0.58,-35.93,-0.54,-32.42,-0.44,-28.2,-0.34,-24.33,-0.29,0,0,-15.44,-0.09,-32.35,-0.27,-46.33,-0.46,-53,-0.55,-49.4,-0.48,-41.64,-0.33,-32.21,-0.18,-23.62,-0.11,0,0,-19.26,0,-40.55,0,-57.78,0,-64.88,0,-60.37,0,-49.43,0,-35.92,0,-23.69]},{"offset":1,"value":[-11.29,5.36,-11.29,11.28,-11.29,16.08,-11.29,18.05,-11.29,18.67,-11.37,20.17,-11.58,22.02,-11.83,23.69,-12.07,1,-7.82,4.75,-8.76,8.91,-9.86,12.28,-10.79,13.65,-11.18,13.52,-10.96,13.42,-10.43,13.33,-9.8,13.23,-9.29,2.12,-3.99,4.25,-5.9,6.63,-8.22,8.55,-10.17,9.31,-10.99,8.34,-10.43,6.55,-9.09,4.43,-7.51,2.47,-6.23,3.01,-0.89,3.56,-3.69,4.17,-7.02,4.66,-9.79,4.83,-10.96,3.21,-10.12,-0.09,-8.12,-4.06,-5.74,-7.7,-3.75,3.38,0.39,2.38,-3.08,1.27,-6.91,0.37,-10.01,0,-11.29,-1.79,-10.35,-6.14,-8.08,-11.5,-5.27,-16.36,-2.72,3.01,-0.89,-3.51,-3.76,-10.63,-7.32,-16.61,-10.34,-19.71,-11.62,-19.87,-10.72,-20.33,-8.61,-20.92,-6.09,-21.45,-3.99,2.12,-3.99,-9.35,-6.01,-21.85,-8.63,-32.31,-10.9,-37.66,-11.87,-35.74,-11.19,-31.86,-9.59,-27.19,-7.72,-22.92,-6.23,1,-7.82,-14.73,-8.84,-31.94,-10.18,-46.18,-11.34,-53,-11.83,-49.32,-11.47,-41.38,-10.62,-31.73,-9.63,-22.95,-8.85,0,-11.29,-19.26,-11.29,-40.55,-11.29,-57.78,-11.29,-64.88,-11.29,-60.37,-11.29,-49.43,-11.29,-35.92,-11.29,-23.69,-11.29]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_01","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,5.36,21.02,11.28,21.02,16.08,21.02,18.05,21.02,18.67,20.93,20.17,20.72,22.02,20.47,23.69,20.24,0,21.02,4.05,21.03,8.52,21.07,12.14,21.11,13.65,21.13,14.16,21.05,15.34,20.87,16.78,20.65,18.09,20.47,0,21.02,2.75,21.06,5.78,21.16,8.25,21.26,9.31,21.31,9.76,21.24,10.65,21.07,11.71,20.87,12.69,20.72,0,21.02,1.42,21.07,2.98,21.18,4.26,21.29,4.83,21.35,5.14,21.29,5.68,21.16,6.3,21.02,6.88,20.93,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,-4.08,20.91,-8.53,20.69,-12.23,20.46,-14,20.36,-13.13,20.41,-11.25,20.52,-8.96,20.64,-6.88,20.69,0,21.02,-7.71,20.93,-16.19,20.72,-23.13,20.52,-26.23,20.43,-24.68,20.48,-21.09,20.58,-16.69,20.68,-12.69,20.72,0,21.02,-11.18,20.98,-23.52,20.91,-33.54,20.83,-37.76,20.8,-35.58,20.81,-30.36,20.85,-23.92,20.89,-18.09,20.91,0,21.02,-14.74,21.02,-31.03,21.02,-44.22,21.02,-49.65,21.02,-46.81,21.02,-39.91,21.02,-31.4,21.02,-23.69,21.02]},{"duration":60,"tweenEasing":0,"offset":2,"value":[5.36,0,11.28,0,16.08,0,18.05,0,18.67,-0.09,20.17,-0.29,22.02,-0.55,23.69,-0.78,0,0,4.05,0.02,8.52,0.05,12.14,0.09,13.65,0.11,14.16,0.03,15.34,-0.15,16.78,-0.36,18.09,-0.55,0,0,2.75,0.05,5.78,0.15,8.25,0.25,9.31,0.29,9.76,0.22,10.65,0.05,11.71,-0.15,12.69,-0.29,0,0,1.42,0.05,2.98,0.16,4.26,0.28,4.83,0.33,5.14,0.27,5.68,0.15,6.3,0.01,6.88,-0.09,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-4.08,-0.1,-8.53,-0.33,-12.23,-0.55,-14,-0.66,-13.13,-0.61,-11.25,-0.49,-8.96,-0.38,-6.88,-0.33,0,0,-7.71,-0.09,-16.19,-0.29,-23.13,-0.49,-26.23,-0.58,-24.68,-0.54,-21.09,-0.44,-16.69,-0.34,-12.69,-0.29,0,0,-11.18,-0.03,-23.52,-0.11,-33.54,-0.18,-37.76,-0.22,-35.58,-0.2,-30.36,-0.16,-23.92,-0.13,-18.09,-0.11,0,0,-14.74,0,-31.03,0,-44.22,0,-49.65,0,-46.81,0,-39.91,0,-31.4,0,-23.69]},{"offset":1,"value":[-11.29,5.36,-11.29,11.28,-11.29,16.08,-11.29,18.05,-11.29,18.67,-11.37,20.17,-11.58,22.02,-11.83,23.69,-12.07,1,-7.82,4.75,-8.76,8.91,-9.86,12.28,-10.79,13.65,-11.18,14.11,-10.96,15.21,-10.43,16.55,-9.81,17.75,-9.29,2.12,-3.99,4.25,-5.9,6.63,-8.22,8.55,-10.17,9.31,-10.99,9.66,-10.43,10.37,-9.1,11.22,-7.52,11.99,-6.23,3.01,-0.89,3.56,-3.69,4.17,-7.02,4.66,-9.79,4.83,-10.96,5.01,-10.12,5.28,-8.13,5.59,-5.75,5.87,-3.75,3.38,0.39,2.38,-3.08,1.27,-6.91,0.37,-10.01,0,-11.29,-0.12,-10.35,-0.42,-8.08,-0.79,-5.27,-1.13,-2.72,3.01,-0.89,-1.92,-3.83,-7.34,-7.5,-11.83,-10.62,-14,-11.94,-13.26,-11,-11.65,-8.77,-9.68,-6.14,-7.88,-3.99,2.12,-3.99,-6.2,-6.03,-15.33,-8.65,-22.83,-10.91,-26.23,-11.87,-24.78,-11.19,-21.37,-9.59,-17.19,-7.71,-13.4,-6.23,1,-7.82,-10.47,-8.8,-23.11,-10.03,-33.39,-11.07,-37.76,-11.51,-35.63,-11.19,-30.49,-10.45,-24.15,-9.57,-18.42,-8.85,0,-11.29,-14.74,-11.29,-31.03,-11.29,-44.22,-11.29,-49.65,-11.29,-46.81,-11.29,-39.91,-11.29,-31.4,-11.29,-23.69,-11.29]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_02","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02]},{"duration":60,"tweenEasing":0,"offset":161},{"offset":1,"value":[-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,1,-7.82,0.71,-8.77,0.4,-9.92,0.14,-10.88,0,-11.29,-0.05,-10.99,-0.13,-10.28,-0.23,-9.44,-0.33,-8.74,2.12,-3.99,1.5,-5.95,0.85,-8.37,0.3,-10.42,0,-11.29,-0.1,-10.65,-0.28,-9.15,-0.5,-7.37,-0.71,-5.94,3.01,-0.89,2.14,-3.74,1.19,-7.18,0.4,-10.07,0,-11.29,-0.13,-10.4,-0.4,-8.28,-0.71,-5.75,-1,-3.66,3.38,0.39,2.38,-3.08,1.27,-6.91,0.37,-10.01,0,-11.29,-0.12,-10.35,-0.42,-8.08,-0.79,-5.27,-1.13,-2.72,3.01,-0.89,2.14,-3.74,1.19,-7.18,0.4,-10.07,0,-11.29,-0.13,-10.4,-0.4,-8.28,-0.71,-5.75,-1,-3.66,2.12,-3.99,1.5,-5.95,0.85,-8.37,0.3,-10.42,0,-11.29,-0.1,-10.65,-0.28,-9.15,-0.5,-7.37,-0.71,-5.94,1,-7.82,0.71,-8.77,0.4,-9.92,0.14,-10.88,0,-11.29,-0.05,-10.99,-0.13,-10.28,-0.23,-9.44,-0.33,-8.74,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_03","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,1.34,21.02,1.24,21.02,1.14,21.02,1.05,21.02,1,21.02,1.82,21.02,1.86,21.02,1.23,21.02,0,21.02,2.82,21.02,2.62,21.02,2.4,21.02,2.21,21.02,2.12,21.02,3.71,21.02,3.77,21.02,2.48,21.02,0,21.02,4.02,21.02,3.73,21.02,3.41,21.02,3.15,21.02,3.01,21.02,5.45,21.02,5.58,21.02,3.68,21.02,0,21.02,4.51,21.02,4.18,21.02,3.81,21.02,3.51,21.02,3.38,21.02,6.8,21.02,7.14,21.02,4.75,21.02,0,21.02,12.61,21.84,12.61,21.76,12.62,21.71,12.62,21.68,12.57,21.67,14.52,21.63,13.59,21.53,10.41,21.44,5.57,21.43,20.17,22.18,20.6,21.98,21.08,21.8,21.46,21.66,21.58,21.6,22.3,21.58,20.34,21.55,16.57,21.55,11.85,21.6,27.52,22.33,28.41,22,29.41,21.64,30.2,21.35,30.52,21.24,30.1,21.28,27.19,21.38,22.92,21.52,18.41,21.67,34.98,22.57,36.32,22.11,37.8,21.6,39,21.19,39.49,21.02,37.89,21.1,33.99,21.31,29.18,21.56,24.82,21.8]},{"duration":60,"tweenEasing":0,"offset":18,"value":[1.34,0,1.24,0,1.14,0,1.05,0,1,0,1.82,0,1.86,0,1.23,0,0,0,2.82,0,2.62,0,2.4,0,2.21,0,2.12,0,3.71,0,3.77,0,2.48,0,0,0,4.02,0,3.73,0,3.41,0,3.15,0,3.01,0,5.45,0,5.58,0,3.68,0,0,0,4.51,0,4.18,0,3.81,0,3.51,0,3.38,0,6.8,0,7.14,0,4.75,0,0,0,12.61,0.83,12.61,0.75,12.62,0.69,12.62,0.67,12.57,0.66,14.52,0.61,13.59,0.51,10.41,0.42,5.57,0.41,20.17,1.17,20.6,0.97,21.08,0.78,21.46,0.64,21.58,0.58,22.3,0.57,20.34,0.54,16.57,0.53,11.85,0.58,27.52,1.31,28.41,0.98,29.41,0.62,30.2,0.34,30.52,0.22,30.1,0.26,27.19,0.36,22.92,0.51,18.41,0.66,34.98,1.56,36.32,1.09,37.8,0.58,39,0.17,39.49,0,37.89,0.09,33.99,0.29,29.18,0.55,24.82,0.78]},{"offset":1,"value":[-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,2.34,-7.82,1.95,-8.77,1.53,-9.92,1.19,-10.88,1,-11.29,1.77,-10.99,1.73,-10.28,0.99,-9.44,-0.33,-8.74,4.94,-3.99,4.12,-5.95,3.24,-8.36,2.51,-10.42,2.12,-11.29,3.61,-10.65,3.49,-9.14,1.98,-7.37,-0.71,-5.94,7.03,-0.89,5.87,-3.74,4.6,-7.18,3.54,-10.07,3.01,-11.29,5.32,-10.4,5.18,-8.27,2.96,-5.75,-1,-3.66,7.9,0.39,6.56,-3.08,5.08,-6.91,3.88,-10.01,3.38,-11.29,6.68,-10.35,6.72,-8.08,3.96,-5.27,-1.13,-2.72,15.62,-0.06,14.75,-2.99,13.81,-6.48,13.01,-9.41,12.57,-10.63,14.38,-9.78,13.19,-7.76,9.69,-5.33,4.57,-3.25,22.28,-2.82,22.11,-4.98,21.93,-7.59,21.76,-9.78,21.58,-10.7,22.19,-10.08,20.05,-8.61,16.06,-6.84,11.14,-5.35,28.53,-6.51,29.12,-7.79,29.8,-9.3,30.34,-10.55,30.52,-11.07,30.05,-10.73,27.06,-9.92,22.69,-8.94,18.07,-8.09,34.98,-9.73,36.32,-10.19,37.8,-10.7,39,-11.12,39.49,-11.29,37.89,-11.2,33.99,-10.99,29.18,-10.74,24.82,-10.51]}]}]},{"type":"node","duration":120,"playTimes":0,"name":"B_NECK.03_04","timeline":[{"name":"B_NECK.03","type":50,"frame":[{"duration":60,"tweenEasing":0,"offset":1,"value":[21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,0,21.02,6.87,21.02,5.17,21.02,3.32,21.02,1.78,21.02,1,21.02,1.82,21.02,1.86,21.02,1.23,21.02,0,21.02,14.46,21.02,10.92,21.02,7.07,21.02,3.83,21.02,2.12,21.02,3.71,21.02,3.77,21.02,2.48,21.02,0,21.02,20.6,21.02,15.52,21.02,9.99,21.02,5.37,21.02,3.01,21.02,5.45,21.02,5.58,21.02,3.68,21.02,0,21.02,23.13,21.02,17.27,21.02,10.79,21.02,5.54,21.02,3.38,21.02,6.8,21.02,7.14,21.02,4.75,21.02,0,21.02,29.19,21.84,24.4,21.76,19.2,21.71,14.84,21.68,12.57,21.67,14.52,21.63,13.59,21.53,10.41,21.44,5.57,21.43,31.8,22.18,28.9,21.99,25.76,21.8,23.08,21.66,21.58,21.6,22.3,21.58,20.34,21.55,16.57,21.55,11.85,21.6,33.05,22.33,32.34,22,31.59,21.64,30.93,21.35,30.52,21.24,30.1,21.28,27.19,21.38,22.92,21.52,18.41,21.67,34.98,22.57,36.32,22.11,37.8,21.6,39,21.19,39.49,21.02,37.89,21.1,33.99,21.31,29.18,21.56,24.82,21.8]},{"duration":60,"tweenEasing":0,"offset":18,"value":[3.85,0.35,3.03,0.25,2.13,0.14,1.38,0.04,1,0,1.82,0,1.86,0,1.23,0,0,0,8.11,0.73,6.39,0.53,4.52,0.29,2.94,0.09,2.12,0,3.71,0,3.77,0,2.48,0,0,0,11.56,1.04,9.09,0.76,6.39,0.41,4.15,0.12,3.01,0,5.45,0,5.58,0,3.68,0,0,0,12.98,1.17,10.13,0.82,6.98,0.44,4.43,0.13,3.38,0,6.8,0,7.14,0,4.75,0,0,0,20.14,1.87,17.97,1.5,15.61,1.11,13.62,0.79,12.57,0.66,14.52,0.61,13.59,0.51,10.41,0.42,5.57,0.41,25.46,1.9,24.37,1.5,23.2,1.07,22.19,0.73,21.58,0.58,22.3,0.57,20.34,0.54,16.57,0.53,11.85,0.58,30.03,1.66,30.2,1.23,30.4,0.76,30.53,0.38,30.52,0.22,30.1,0.26,27.19,0.36,22.92,0.51,18.41,0.66,34.98,1.56,36.32,1.09,37.8,0.58,39,0.17,39.49,0,37.89,0.09,33.99,0.29,29.18,0.55,24.82,0.78]},{"offset":1,"value":[-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,0,-11.29,3.85,-7.82,3.02,-8.77,2.13,-9.92,1.39,-10.88,1,-11.29,1.77,-10.99,1.73,-10.28,0.99,-9.44,-0.33,-8.74,8.11,-3.99,6.38,-5.94,4.52,-8.36,2.95,-10.42,2.12,-11.29,3.61,-10.65,3.49,-9.14,1.98,-7.37,-0.71,-5.94,11.56,-0.89,9.09,-3.73,6.39,-7.17,4.15,-10.07,3.01,-11.29,5.32,-10.4,5.18,-8.27,2.96,-5.75,-1,-3.66,12.98,0.39,10.13,-3.08,6.98,-6.91,4.43,-10.01,3.38,-11.29,6.68,-10.35,6.72,-8.08,3.96,-5.27,-1.13,-2.72,20.14,-0.06,17.97,-2.99,15.61,-6.48,13.62,-9.4,12.57,-10.63,14.38,-9.78,13.19,-7.76,9.69,-5.33,4.57,-3.25,25.46,-2.82,24.37,-4.98,23.2,-7.58,22.2,-9.78,21.58,-10.7,22.19,-10.08,20.05,-8.61,16.06,-6.84,11.14,-5.35,30.03,-6.51,30.19,-7.79,30.4,-9.3,30.54,-10.55,30.52,-11.07,30.05,-10.73,27.06,-9.92,22.69,-8.94,18.07,-8.09,34.98,-9.73,36.32,-10.19,37.8,-10.7,39,-11.12,39.49,-11.29,37.89,-11.2,33.99,-10.99,29.18,-10.74,24.82,-10.51]}]}]}],"canvas":{"y":-690,"width":1280,"height":1380}}],"textureAtlas":[{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_00.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_00"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_01.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_01"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_02.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_02"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_03.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_03"}]},{"width":1024,"height":1024,"name":"shizuku","imagePath":"shizuku.1024/texture_04.png","SubTexture":[{"width":1024,"height":1024,"name":"shizuku_04"}]}]} \ No newline at end of file diff --git a/Pixi/Demos/src/CoreElement.ts b/Pixi/Demos/src/CoreElement.ts index 4a4568f3..342c4ce3 100644 --- a/Pixi/Demos/src/CoreElement.ts +++ b/Pixi/Demos/src/CoreElement.ts @@ -189,15 +189,15 @@ namespace coreElement { this._armatureDisplay.x = 0.0; this._armatureDisplay.y = Game.GROUND; this._armature = this._armatureDisplay.armature; - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); - this._armature.eventDispatcher.addEvent(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); + this._armatureDisplay.on(dragonBones.EventObject.FADE_IN_COMPLETE, this._animationEventHandler, this); + this._armatureDisplay.on(dragonBones.EventObject.FADE_OUT_COMPLETE, this._animationEventHandler, this); + this._armatureDisplay.on(dragonBones.EventObject.COMPLETE, this._animationEventHandler, this); // Get weapon childArmature. this._weaponL = this._armature.getSlot("weapon_l").childArmature; this._weaponR = this._armature.getSlot("weapon_r").childArmature; - this._weaponL.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); - this._weaponR.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.display.on(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.display.on(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); Game.instance.addChild(this._armatureDisplay); this._updateAnimation(); @@ -244,25 +244,25 @@ namespace coreElement { } public switchWeaponL(): void { - this._weaponL.eventDispatcher.removeEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.display.off(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); this._weaponLIndex++; this._weaponLIndex %= Mecha.WEAPON_L_LIST.length; const weaponName = Mecha.WEAPON_L_LIST[this._weaponLIndex]; this._weaponL = dragonBones.PixiFactory.factory.buildArmature(weaponName); this._armature.getSlot("weapon_l").childArmature = this._weaponL; - this._weaponL.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponL.display.off(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); } public switchWeaponR(): void { - this._weaponR.eventDispatcher.removeEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.display.off(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); this._weaponRIndex++; this._weaponRIndex %= Mecha.WEAPON_R_LIST.length; const weaponName = Mecha.WEAPON_R_LIST[this._weaponRIndex]; this._weaponR = dragonBones.PixiFactory.factory.buildArmature(weaponName); this._armature.getSlot("weapon_r").childArmature = this._weaponR; - this._weaponR.eventDispatcher.addEvent(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); + this._weaponR.display.on(dragonBones.EventObject.FRAME_EVENT, this._frameEventHandler, this); } public switchSkin(): void { diff --git a/Pixi/Demos/src/EyeTracking.ts b/Pixi/Demos/src/EyeTracking.ts new file mode 100644 index 00000000..5880fd14 --- /dev/null +++ b/Pixi/Demos/src/EyeTracking.ts @@ -0,0 +1,133 @@ +class EyeTracking extends BaseDemo { + private _scale: number = 0.3; + private readonly _target: PIXI.Point = new PIXI.Point(); + private readonly _animationNames: string[] = [ + "PARAM_ANGLE_X", + "PARAM_ANGLE_Y", + "PARAM_ANGLE_Z", + "PARAM_EYE_BALL_X", + "PARAM_EYE_BALL_Y", + "PARAM_BODY_X", + "PARAM_BODY_Y", + "PARAM_BODY_Z", + "PARAM_BODY_ANGLE_X", + "PARAM_BODY_ANGLE_Y", + "PARAM_BODY_ANGLE_Z", + "PARAM_BREATH", + ]; + private _armatureDisplay: dragonBones.PixiArmatureDisplay; + + public constructor() { + super(); + + this._resources.push( + "resource/shizuku/shizuku_ske.json", + "resource/shizuku/shizuku.1024/texture_00.png", + "resource/shizuku/shizuku.1024/texture_01.png", + "resource/shizuku/shizuku.1024/texture_02.png", + "resource/shizuku/shizuku.1024/texture_03.png", + ); + } + + protected _onStart(): void { + const factory = dragonBones.PixiFactory.factory; + factory.parseDragonBonesData(this._pixiResources["resource/shizuku/shizuku_ske.json"].data, "shizuku"); + factory.updateTextureAtlases( + [ + this._pixiResources["resource/shizuku/shizuku.1024/texture_00.png"].texture, + this._pixiResources["resource/shizuku/shizuku.1024/texture_01.png"].texture, + this._pixiResources["resource/shizuku/shizuku.1024/texture_02.png"].texture, + this._pixiResources["resource/shizuku/shizuku.1024/texture_03.png"].texture, + ], + "shizuku" + ); + + this._armatureDisplay = factory.buildArmatureDisplay("shizuku", "shizuku"); + this._armatureDisplay.animation.play("idle_00"); + + this._armatureDisplay.x = 0.0; + this._armatureDisplay.y = 200.0; + this._armatureDisplay.scale.set(this._scale); + this.addChild(this._armatureDisplay); + + // + this.interactive = true; + this.addListener('touchmove', this._touchHandler, this); + this.addListener('mousemove', this._touchHandler, this); + PIXI.ticker.shared.add(this._enterFrameHandler, this); + } + + private _touchHandler(event: PIXI.interaction.InteractionEvent): void { + this._setTarget(event.data.global.x, event.data.global.y); + } + + private _setTarget(x: number, y: number) { + this._target.x += ((x - this.x - this._armatureDisplay.x) / this._scale - this._target.x) * 0.3; + this._target.y += ((y - this.y - this._armatureDisplay.y) / this._scale - this._target.y) * 0.3; + } + + protected _enterFrameHandler(deltaTime: number): void { + const armature = this._armatureDisplay.armature; + const animation = this._armatureDisplay.animation; + const canvas = armature.armatureData.canvas; + + let p = 0.0; + const pX = Math.max(Math.min((this._target.x - canvas.x) / (canvas.width * 0.5), 1.0), -1.0); + const pY = -Math.max(Math.min((this._target.y - canvas.y) / (canvas.height * 0.5), 1.0), -1.0); + for (const animationName of this._animationNames) { + if (!animation.hasAnimation(animationName)) { + continue; + } + + let animationState = animation.getState(animationName, 1); + if (!animationState) { + animationState = animation.fadeIn(animationName, 0.1, 1, 1, animationName); + if (animationState) { + animationState.resetToPose = false; + animationState.stop(); + } + } + + if (!animationState) { + continue; + } + + switch (animationName) { + case "PARAM_ANGLE_X": + case "PARAM_EYE_BALL_X": + p = (pX + 1.0) * 0.5; + break; + + case "PARAM_ANGLE_Y": + case "PARAM_EYE_BALL_Y": + p = (pY + 1.0) * 0.5; + break; + + case "PARAM_ANGLE_Z": + p = (-pX * pY + 1.0) * 0.5; + break; + + case "PARAM_BODY_X": + case "PARAM_BODY_ANGLE_X": + p = (pX + 1.0) * 0.5; + break; + + case "PARAM_BODY_Y": + case "PARAM_BODY_ANGLE_Y": + p = (-pX * pY + 1.0) * 0.5; + break; + + case "PARAM_BODY_Z": + case "PARAM_BODY_ANGLE_Z": + p = (-pX * pY + 1.0) * 0.5; + break; + + case "PARAM_BREATH": + p = (Math.sin(armature.clock.time) + 1.0) * 0.5; + break; + } + + animationState.currentTime = p * animationState.totalTime; + } + } +} \ No newline at end of file diff --git a/Pixi/Demos/src/MultiTextureAltas.ts b/Pixi/Demos/src/MultiTextureAltas.ts new file mode 100644 index 00000000..4ace7085 --- /dev/null +++ b/Pixi/Demos/src/MultiTextureAltas.ts @@ -0,0 +1,72 @@ +class MultiTextureAltas extends BaseDemo { + private _armatureDisplayA: dragonBones.PixiArmatureDisplay; + private _armatureDisplayB: dragonBones.PixiArmatureDisplay; + private _armatureDisplayC: dragonBones.PixiArmatureDisplay; + private _armatureDisplayD: dragonBones.PixiArmatureDisplay; + + public constructor() { + super(); + + this._resources.push( + "resource/effect/effect_ske.json", + "resource/effect/effect_tex.json", + "resource/effect/effect_tex.png", + "resource/effect/effect_sd_tex.json", + "resource/effect/effect_sd_tex.png" + ); + } + + protected _onStart(): void { + const factory = dragonBones.PixiFactory.factory; + factory.parseDragonBonesData(this._pixiResources["resource/effect/effect_ske.json"].data, "hd", 1.0); + factory.parseDragonBonesData(this._pixiResources["resource/effect/effect_ske.json"].data, "sd", 0.5); + factory.parseTextureAtlasData(this._pixiResources["resource/effect/effect_tex.json"].data, this._pixiResources["resource/effect/effect_tex.png"].texture, "hd", 1.0); + factory.parseTextureAtlasData(this._pixiResources["resource/effect/effect_sd_tex.json"].data, this._pixiResources["resource/effect/effect_sd_tex.png"].texture, "sd", 2.0); + + this._armatureDisplayA = factory.buildArmatureDisplay("flower", "hd", null, "hd"); // HD Armature and HD TextureAtlas. + this._armatureDisplayB = factory.buildArmatureDisplay("flower", "hd", null, "sd"); // HD Armature and SD TextureAtlas. + this._armatureDisplayC = factory.buildArmatureDisplay("flower", "sd", null, "hd"); // SD Armature and HD TextureAtlas. + this._armatureDisplayD = factory.buildArmatureDisplay("flower", "sd", null, "sd"); // SD Armature and SD TextureAtlas. + + this._armatureDisplayA.x = -250.0; + this._armatureDisplayA.y = 0.0; + this._armatureDisplayB.x = 250.0; + this._armatureDisplayB.y = 0.0; + this._armatureDisplayC.x = -250.0; + this._armatureDisplayC.y = 200.0; + this._armatureDisplayD.x = 250.0; + this._armatureDisplayD.y = 200.0; + + this.addChild(this._armatureDisplayA); + this.addChild(this._armatureDisplayB); + this.addChild(this._armatureDisplayC); + this.addChild(this._armatureDisplayD); + // + this.interactive = true; + const touchHandler = (event: PIXI.interaction.InteractionEvent) => { + this._changeAnimation(); + }; + this.addListener("touchstart", touchHandler, this); + this.addListener("mousedown", touchHandler, this); + // + this._changeAnimation(); + } + + private _changeAnimation(): void { + let animationName = this._armatureDisplayA.animation.lastAnimationName; + if (animationName) { + const animationNames = this._armatureDisplayA.animation.animationNames; + const animationIndex = (animationNames.indexOf(animationName) + 1) % animationNames.length; + this._armatureDisplayA.animation.play(animationNames[animationIndex]).playTimes = 0; + } + else { + this._armatureDisplayA.animation.play().playTimes = 0; + } + + animationName = this._armatureDisplayA.animation.lastAnimationName; + + this._armatureDisplayB.animation.play(animationName).playTimes = 0; + this._armatureDisplayC.animation.play(animationName).playTimes = 0; + this._armatureDisplayD.animation.play(animationName).playTimes = 0; + } +} \ No newline at end of file diff --git a/README-zh_CN.md b/README-zh_CN.md index d802dae2..1313e2a6 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -8,6 +8,13 @@ * [PixiJS](http://www.pixijs.com/) - [如何在 PixiJS 中使用 DragonBones](./Pixi/) * [Phaser](https://phaser.io/) - [如何在 Phaser 中使用 DragonBones](./Phaser/) * [Hilo](http://hiloteam.github.io/) - [如何在 Hilo 中使用 DragonBones](./Hilo/) +* [Cocos Creator](http://www.cocos.com/) - [如何在 Cocos Creator 中使用 DragonBones](./Cocos/) + +## 了解更多 +* [DragonBones 官网](http://www.dragonbones.com/) + +## 在线示例 +[![PerformanceTest](https://dragonbones.github.io/demo/demos.jpg)](https://github.com/DragonBones/Demos) ## 生成各引擎依赖的文件 执行 `npm install -g dragonbones-runtime` 在全局安装 `dragonbones-runtime`。 @@ -28,12 +35,6 @@ Hilo: `dbr hilo@1.1.6` npm - https://registry.npmjs.org/ taobao - https://registry.npm.taobao.org/ cnpm - http://r.cnpmjs.org/ -``` - -## 了解更多 -* [DragonBones 官网](http://www.dragonbones.com/) - -## 在线示例 -[![PerformanceTest](https://dragonbones.github.io/demo/demos.jpg)](https://github.com/DragonBones/Demos) +``` Copyright (c) 2012-2018 The DragonBones team and other contributors. diff --git a/README.md b/README.md index 2a51d000..20eefd10 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,14 @@ # DragonBones JavaScript / TypeScript Runtime [中文 README](./README-zh_CN.md) ## [DragonBones common library](./DragonBones/) -## Highly suggest use [DragonBones Pro](http://www.dragonbones.com/) to create aniamtion. +## Highly suggest use [DragonBones Pro](http://www.dragonbones.com/) to create animation. ## Supported engines * [Egret](http://www.egret.com/) - [How to use DragonBones in Egret](./Egret/) * [PixiJS](http://www.pixijs.com/) - [How to use DragonBones in PixiJS](./Pixi/) * [Phaser](https://phaser.io/) - [How to use DragonBones in Phaser](./Phaser/) * [Hilo](http://hiloteam.github.io/) - [How to use DragonBones in Hilo](./Hilo/) - -## Generate the files which are dependent by the engines -run `npm install -g dragonbones-runtime` to install the `dragonbones-runtime` in global. - -Then you can get the dependent files in folder names `dragonbones-out` by run `dbr @`, ex: -Egret: `dbr egret@4.1.0` -PixiJS: `dbr pixijs@4.6.2` -Phaser: `dbr phaser@2.6.2` or `dbr phaser-ce@2.7.0` -Hilo: `dbr hilo@1.1.6` - -using `-o` to specify the output folder(default: `dragonbones-out`), ex: -`dbr egret@4.1.0 -o ./egret-db-out` - -because the `phaser` is downloaded from `npm register`, so you can use `-r` to specify the `register`, ex: -`dbr phaser@2.6.2 -r taobao` (default: npm) -valid `register`: -``` -npm - https://registry.npmjs.org/ -taobao - https://registry.npm.taobao.org/ -cnpm - http://r.cnpmjs.org/ -``` +* [Cocos creator](http://www.cocos.com/) - [How to use DragonBones in Cocos creator](./Cocos/) ## To learn more about * [DragonBones offical website](http://www.dragonbones.com/) diff --git a/ThreeJS/Current/README.md b/ThreeJS/Current/README.md new file mode 100644 index 00000000..38d46b6e --- /dev/null +++ b/ThreeJS/Current/README.md @@ -0,0 +1,3 @@ +## How to build +* $ `npm install` +* $ `npm run build` \ No newline at end of file diff --git a/ThreeJS/Current/libs/.gitkeep b/ThreeJS/Current/libs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/ThreeJS/Current/package.json b/ThreeJS/Current/package.json new file mode 100644 index 00000000..701483ed --- /dev/null +++ b/ThreeJS/Current/package.json @@ -0,0 +1,13 @@ +{ + "name": "dragonbones-threejs", + "version": "5.6.3", + "main": "", + "scripts": { + "build": "tsc & uglifyjs ./out/dragonBones.js -o ./out/dragonBones.min.js -m" + }, + "devDependencies": { + "@types/three": "^0.89.12", + "typescript": "^2.4.2", + "uglify-js": "^3.3.15" + } +} \ No newline at end of file diff --git a/ThreeJS/Current/src/dragonBones/three/ThreeArmatureDisplay.ts b/ThreeJS/Current/src/dragonBones/three/ThreeArmatureDisplay.ts new file mode 100644 index 00000000..5035fc03 --- /dev/null +++ b/ThreeJS/Current/src/dragonBones/three/ThreeArmatureDisplay.ts @@ -0,0 +1,144 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +namespace dragonBones { + /** + * @inheritDoc + */ + export class ThreeArmatureDisplay extends THREE.Group implements IArmatureProxy { + /** + * @private + */ + public debugDraw: boolean = false; + private _debugDraw: boolean = false; + // private _disposeProxy: boolean = false; + private _armature: Armature = null as any; + private _debugDrawer: THREE.Group | null = null; + /** + * @inheritDoc + */ + public dbInit(armature: Armature): void { + this._armature = armature; + } + /** + * @inheritDoc + */ + public dbClear(): void { + if (this._debugDrawer !== null) { + } + + this._armature = null as any; + this._debugDrawer = null; + } + /** + * @inheritDoc + */ + public dbUpdate(): void { + const drawed = DragonBones.debugDraw || this.debugDraw; + if (drawed || this._debugDraw) { + this._debugDraw = drawed; + if (this._debugDraw) { + if (this._debugDrawer === null) { + this._debugDrawer = new THREE.Group(); + } + + this.add(this._debugDrawer); + } + else if (this._debugDrawer !== null && this._debugDrawer.parent === this) { + this.remove(this._debugDrawer); + } + } + } + /** + * @inheritDoc + */ + public dispose(disposeProxy: boolean = true): void { + // tslint:disable-next-line:no-unused-expression + disposeProxy; + if (this._armature !== null) { + this._armature.dispose(); + this._armature = null as any; + } + } + /** + * @private + */ + public dispatchDBEvent(type: EventStringType, eventObject: EventObject): void { + // tslint:disable-next-line:no-unused-expression + type; + this.dispatchEvent(eventObject); + } + /** + * @inheritDoc + */ + public hasDBEventListener(type: EventStringType): boolean { + const listeners = (this as any)._listeners; // + return listeners !== undefined && type in listeners; + } + /** + * @inheritDoc + */ + public addDBEventListener(type: EventStringType, listener: (event: EventObject) => void, target: any): void { + listener.bind(target); + this.addEventListener(type, listener as any); + } + /** + * @inheritDoc + */ + public removeDBEventListener(type: EventStringType, listener: (event: EventObject) => void, target: any): void { + // tslint:disable-next-line:no-unused-expression + target; + this.removeEventListener(type, listener as any); + } + /** + * @inheritDoc + */ + public get armature(): Armature { + return this._armature; + } + /** + * @inheritDoc + */ + public get animation(): Animation { + return this._armature.animation; + } + + /** + * @inheritDoc + */ + public hasEvent(type: EventStringType): boolean { + return this.hasDBEventListener(type); + } + /** + * @inheritDoc + */ + public addEvent(type: EventStringType, listener: (event: EventObject) => void, target: any): void { + this.addDBEventListener(type, listener, target); + } + /** + * @inheritDoc + */ + public removeEvent(type: EventStringType, listener: (event: EventObject) => void, target: any): void { + this.removeDBEventListener(type, listener, target); + } + } +} \ No newline at end of file diff --git a/ThreeJS/Current/src/dragonBones/three/ThreeFactory.ts b/ThreeJS/Current/src/dragonBones/three/ThreeFactory.ts new file mode 100644 index 00000000..403600d2 --- /dev/null +++ b/ThreeJS/Current/src/dragonBones/three/ThreeFactory.ts @@ -0,0 +1,268 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +namespace dragonBones { + /** + * - The ThreeJS factory. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - ThreeJS 工厂。 + * @version DragonBones 3.0 + * @language zh_CN + */ + export class ThreeFactory extends BaseFactory { + /** + * @private + */ + public static readonly POOL_TYPE_VECTOR2: string = "POOL_TYPE_VECTOR2"; + /** + * @private + */ + public static readonly POOL_TYPE_VECTOR3: string = "POOL_TYPE_VECTOR3"; + /** + * @private + */ + public static readonly POOL_TYPE_FACE3: string = "POOL_TYPE_FACE3"; + + private static readonly _emptyMaterial: THREE.Material = new THREE.MeshBasicMaterial(); + private static readonly _pools: Map> = {}; + private static _dragonBonesInstance: DragonBones = null as any; + private static _factory: ThreeFactory = null as any; + + private static _createDragonBones(): DragonBones { + const eventManager = new ThreeArmatureDisplay(); + const dragonBonesInstance = new DragonBones(eventManager); + + return dragonBonesInstance; + } + /** + * @private + */ + public static create(type: string): T { + let pool: Array; + if (type in ThreeFactory._pools) { + pool = ThreeFactory._pools[type]; + } + else { + pool = ThreeFactory._pools[type] = []; + } + + if (pool.length > 0) { + return pool.pop(); + } + + switch (type) { + case ThreeFactory.POOL_TYPE_VECTOR2: + return new THREE.Vector2() as any; + + case ThreeFactory.POOL_TYPE_VECTOR3: + return new THREE.Vector3() as any; + + case ThreeFactory.POOL_TYPE_FACE3: + return new THREE.Face3(0, 1, 2) as any; + } + + throw new Error(); + } + /** + * @private + */ + public static release(object: any, type: string): void { + let pool: Array; + if (type in ThreeFactory._pools) { + pool = ThreeFactory._pools[type]; + } + else { + pool = ThreeFactory._pools[type] = []; + } + + if (pool.indexOf(object) < 0) { + pool.push(object); + } + else { + throw new Error(); + } + } + /** + * - A global factory instance that can be used directly. + * @version DragonBones 4.7 + * @language en_US + */ + /** + * - 一个可以直接使用的全局工厂实例。 + * @version DragonBones 4.7 + * @language zh_CN + */ + public static get factory(): ThreeFactory { + if (ThreeFactory._factory === null) { + ThreeFactory._factory = new ThreeFactory(); + } + + return ThreeFactory._factory; + } + /** + * @inheritDoc + */ + public constructor(dataParser: DataParser | null = null) { + super(dataParser); + + if (ThreeFactory._dragonBonesInstance === null) { + ThreeFactory._dragonBonesInstance = ThreeFactory._createDragonBones(); + } + + this._dragonBones = ThreeFactory._dragonBonesInstance; + } + + protected _buildTextureAtlasData(textureAtlasData: ThreeTextureAtlasData | null, textureAtlas: THREE.Texture | null): TextureAtlasData { + if (textureAtlasData) { + textureAtlasData.renderTexture = textureAtlas; + const material = new THREE.MeshBasicMaterial(); + material.side = THREE.DoubleSide; + material.transparent = true; + + if (textureAtlas !== null) { + material.map = textureAtlas; + } + + textureAtlasData.material = material; + } + else { + textureAtlasData = BaseObject.borrowObject(ThreeTextureAtlasData); + } + + return textureAtlasData; + } + + protected _buildArmature(dataPackage: BuildArmaturePackage): Armature { + const armature = BaseObject.borrowObject(Armature); + const armatureDisplay = new ThreeArmatureDisplay(); + + armature.init( + dataPackage.armature, + armatureDisplay, armatureDisplay, this._dragonBones + ); + + return armature; + } + + protected _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot { + // tslint:disable-next-line:no-unused-expression + dataPackage; + // tslint:disable-next-line:no-unused-expression + armature; + + const slot = BaseObject.borrowObject(ThreeSlot); + const geometry = new THREE.Geometry(); + const rawDisplay = new THREE.Mesh(geometry, ThreeFactory._emptyMaterial); + + slot.init( + slotData, armature, + rawDisplay, rawDisplay + ); + + return slot; + } + /** + * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it. + * The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update. + * @param armatureName - The armature data name. + * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) + * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) + * @returns The armature display container. + * @version DragonBones 4.5 + * @example + *
+         *     let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
+         * 
+ * @language en_US + */ + /** + * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架,并用 {@link #clock} 更新该骨架。 + * 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。 + * @param armatureName - 骨架数据名称。 + * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) + * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。 (如果未设置,则使用默认的皮肤数据) + * @returns 骨架的显示容器。 + * @version DragonBones 4.5 + * @example + *
+         *     let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
+         * 
+ * @language zh_CN + */ + public buildArmatureDisplay(armatureName: string, dragonBonesName: string = "", skinName: string = "", textureAtlasName: string = ""): ThreeArmatureDisplay | null { + const armature = this.buildArmature(armatureName, dragonBonesName || "", skinName || "", textureAtlasName || ""); + if (armature !== null) { + this._dragonBones.clock.add(armature); + + return armature.display as ThreeArmatureDisplay; + } + + return null; + } + /** + * - Create the display object with the specified texture. + * @param textureName - The texture data name. + * @param textureAtlasName - The texture atlas data name (Of not set, all texture atlas data will be searched) + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - 创建带有指定贴图的显示对象。 + * @param textureName - 贴图数据名称。 + * @param textureAtlasName - 贴图集数据名称。 (如果未设置,将检索所有的贴图集数据) + * @version DragonBones 3.0 + * @language zh_CN + */ + public getTextureDisplay(textureName: string, textureAtlasName: string | null = null): THREE.Sprite | null { + const textureData = this._getTextureData(textureAtlasName !== null ? textureAtlasName : "", textureName) as ThreeTextureData; + if (textureData !== null) { + const textureAtlasData = textureData.parent as ThreeTextureAtlasData; + if (textureAtlasData.renderTexture !== null) { + const material = new THREE.SpriteMaterial({ map: textureAtlasData.renderTexture }); + const sprite = new THREE.Sprite(material); + + return sprite; + } + } + + return null; + } + /** + * - A global sound event manager. + * Sound events can be listened to uniformly from the manager. + * @version DragonBones 4.5 + * @language en_US + */ + /** + * - 全局声音事件管理器。 + * 声音事件可以从该管理器统一侦听。 + * @version DragonBones 4.5 + * @language zh_CN + */ + public get soundEventManager(): ThreeArmatureDisplay { + return this._dragonBones.eventManager as ThreeArmatureDisplay; + } + } +} \ No newline at end of file diff --git a/ThreeJS/Current/src/dragonBones/three/ThreeSlot.ts b/ThreeJS/Current/src/dragonBones/three/ThreeSlot.ts new file mode 100644 index 00000000..684058fe --- /dev/null +++ b/ThreeJS/Current/src/dragonBones/three/ThreeSlot.ts @@ -0,0 +1,503 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +namespace dragonBones { + /** + * - The ThreeJS slot. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - ThreeJS 插槽。 + * @version DragonBones 3.0 + * @language zh_CN + */ + export class ThreeSlot extends Slot { + public static toString(): string { + return "[class dragonBones.ThreeSlot]"; + } + + public static readonly RAW_UVS: Array = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0]; + public static readonly RAW_INDICES: Array = [0, 1, 2, 3, 2, 1]; + + private _renderDisplay: THREE.Object3D; + private _material: THREE.MeshBasicMaterial | null = null; // Initial value. + + + protected _onClear(): void { + super._onClear(); + + if (this._material !== null) { + this._material.dispose(); + } + + this._renderDisplay = null as any; + this._material = null; + } + + private _clearGeometry(geometry: THREE.Geometry): void { + const vertices = geometry.vertices; + const faces = geometry.faces; + const faceVertexUVs = geometry.faceVertexUvs[0]; + + for (const vertex of vertices) { + ThreeFactory.release(vertex, ThreeFactory.POOL_TYPE_VECTOR3); + } + + for (const face of faces) { + ThreeFactory.release(face, ThreeFactory.POOL_TYPE_FACE3); + } + + for (const faceUVS of faceVertexUVs) { + for (const uv of faceUVS) { + ThreeFactory.release(uv, ThreeFactory.POOL_TYPE_VECTOR2); + } + } + + vertices.length = 0; + faces.length = 0; + faceVertexUVs.length = 0; + } + + protected _initDisplay(value: any, isRetain: boolean): void { + // tslint:disable-next-line:no-unused-expression + value; + // tslint:disable-next-line:no-unused-expression + isRetain; + } + + protected _disposeDisplay(value: any, isRelease: boolean): void { + // tslint:disable-next-line:no-unused-expression + value; + + if (!isRelease) { + (value as THREE.Mesh).geometry.dispose(); // + } + } + + protected _onUpdateDisplay(): void { + this._renderDisplay = (this._display ? this._display : this._rawDisplay) as THREE.Object3D; + this._renderDisplay.matrixAutoUpdate = false; + } + + protected _addDisplay(): void { + const container = this._armature.display as ThreeArmatureDisplay; + container.add(this._renderDisplay); + } + + protected _replaceDisplay(value: any): void { + const container = this._armature.display as ThreeArmatureDisplay; + const prevDisplay = value as THREE.Object3D; + container.add(this._renderDisplay); + container.remove(prevDisplay); + } + + protected _removeDisplay(): void { + this._renderDisplay.parent.remove(this._renderDisplay); + } + + protected _updateZOrder(): void { + this._renderDisplay.position.setZ(this._zOrder); + } + /** + * @internal + */ + public _updateVisible(): void { + this._renderDisplay.visible = this._parent.visible && this._visible; + } + + protected _updateBlendMode(): void { + // switch (this._blendMode) { + // case BlendMode.Normal: + // break; + + // case BlendMode.Add: + // break; + + // case BlendMode.Darken: + // break; + + // case BlendMode.Difference: + // break; + + // case BlendMode.HardLight: + // break; + + // case BlendMode.Lighten: + // break; + + // case BlendMode.Multiply: + // break; + + // case BlendMode.Overlay: + // break; + + // case BlendMode.Screen: + // break; + + // default: + // break; + // } + + if (this._renderDisplay === this._rawDisplay) { + const textureData = this._textureData as (ThreeTextureData | null); + if (textureData === null) { + return; + } + + const textureAtlasData = textureData.parent as ThreeTextureAtlasData; + if (textureAtlasData.renderTexture === null) { + return; + } + + const meshDisplay = this._renderDisplay as THREE.Mesh; + + if (this._blendMode !== BlendMode.Normal) { + if (this._material === null) { + this._material = new THREE.MeshBasicMaterial(); + this._material.copy(textureAtlasData.material); + } + + this._material.blending = THREE.AdditiveBlending; + meshDisplay.material = this._material; + } + else { + meshDisplay.material = textureAtlasData.material; + } + } + + // TODO child armature. + } + + protected _updateColor(): void { + if (this._renderDisplay === this._rawDisplay) { + const textureData = this._textureData as (ThreeTextureData | null); + if (textureData === null) { + return; + } + + const textureAtlasData = textureData.parent as ThreeTextureAtlasData; + if (textureAtlasData.renderTexture === null) { + return; + } + + const alpha = this._colorTransform.alphaMultiplier * this._globalAlpha; + const meshDisplay = this._renderDisplay as THREE.Mesh; + + if ( + alpha !== 1.0 || + this._colorTransform.redMultiplier !== 1.0 || + this._colorTransform.greenMultiplier !== 1.0 || + this._colorTransform.blueMultiplier !== 1.0 + ) { + if (this._material === null) { + this._material = new THREE.MeshBasicMaterial(); + this._material.copy(textureAtlasData.material); + } + + this._material.opacity = alpha; + this._material.color.setRGB( + this._colorTransform.redMultiplier, + this._colorTransform.greenMultiplier, + this._colorTransform.blueMultiplier + ); + meshDisplay.material = this._material; + } + else { + meshDisplay.material = textureAtlasData.material; + } + } + + // TODO child armature. + } + + protected _updateFrame(): void { + const textureData = this._textureData as (ThreeTextureData | null); + const meshDisplay = this._renderDisplay as THREE.Mesh; + + if (textureData !== null) { + const textureAtlasData = textureData.parent as ThreeTextureAtlasData; + const renderTexture = textureAtlasData.renderTexture; + + if (renderTexture !== null) { + const textureAtlasWidth = textureAtlasData.width > 0.0 ? textureAtlasData.width : renderTexture.image.width; + const textureAtlasHeight = textureAtlasData.height > 0.0 ? textureAtlasData.height : renderTexture.image.height; + const textureX = textureData.region.x; + const textureY = textureData.region.y; + const textureWidth = textureData.region.width; + const textureHeight = textureData.region.height; + const geometry = meshDisplay.geometry as THREE.Geometry; + const vertices = geometry.vertices; + const faces = geometry.faces; + const faceVertexUVs = geometry.faceVertexUvs[0]; + + this._clearGeometry(geometry); + + if (this._geometryData !== null) { // Mesh. + const data = this._geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[this._geometryData.offset + BinaryOffset.GeometryVertexCount]; + const triangleCount = intArray[this._geometryData.offset + BinaryOffset.GeometryTriangleCount]; + let vertexOffset = intArray[this._geometryData.offset + BinaryOffset.GeometryFloatOffset]; + + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bouds bug. + } + + const uvOffset = vertexOffset + vertexCount * 2; + const indexOffset = this._geometryData.offset + BinaryOffset.GeometryVertexIndices; + const scale = this._armature._armatureData.scale; + const uvs = new Array(); + + for (let i = 0, l = vertexCount; i < l; ++i) { + const vertex = ThreeFactory.create(ThreeFactory.POOL_TYPE_VECTOR3) as THREE.Vector3; + const uv = ThreeFactory.create(ThreeFactory.POOL_TYPE_VECTOR2) as THREE.Vector2; + + vertices.push(vertex); + uvs.push(uv); + uv.set( + floatArray[uvOffset + i], + floatArray[uvOffset + i + 1] + ); + vertex.set( + floatArray[vertexOffset + i] * scale, + floatArray[vertexOffset + i + 1] * scale, + 0.0 + ); + + if (textureData.rotated) { + uv.set( + (textureX + (1.0 - uv.y) * textureWidth) / textureAtlasWidth, + (textureY + uv.x * textureHeight) / textureAtlasHeight + ); + } + else { + uv.set( + (textureX + uv.x * textureWidth) / textureAtlasWidth, + 1.0 - (textureY + uv.y * textureHeight) / textureAtlasHeight + ); + } + } + + for (let i = 0; i < triangleCount; ++i) { + const iT = i * 3; + const face3 = ThreeFactory.create(ThreeFactory.POOL_TYPE_FACE3) as THREE.Face3; + const faceUVs: Array = []; + + faces.push(face3); + faceVertexUVs.push(faceUVs); + + face3.a = intArray[indexOffset + iT]; + face3.b = intArray[indexOffset + iT + 1]; + face3.c = intArray[indexOffset + iT + 2]; + + faceUVs[0] = uvs[face3.a]; + faceUVs[1] = uvs[face3.b]; + faceUVs[2] = uvs[face3.c]; + } + + // this._clearMesh(geometry, vertexCount, triangleCount); + } + else { // Normal texture. + const scale = textureAtlasData.scale * this._armature._armatureData.scale; + const rawUVs = ThreeSlot.RAW_UVS; + const rawIndices = ThreeSlot.RAW_INDICES; + const uvs = new Array(); + + for (let i = 0; i < 4; ++i) { + const iD = i * 2; + const vertex = ThreeFactory.create(ThreeFactory.POOL_TYPE_VECTOR3) as THREE.Vector3; + const uv = ThreeFactory.create(ThreeFactory.POOL_TYPE_VECTOR2) as THREE.Vector2; + + vertices.push(vertex); + uvs.push(uv); + uv.set( + rawUVs[iD], + rawUVs[iD + 1] + ); + + vertex.set( + (uv.x * textureWidth * scale) - this._pivotX, + (uv.y * textureHeight * scale) - this._pivotY, + 0.0 + ); + + if (textureData.rotated) { + uv.set( + (textureX + (1.0 - uv.y) * textureWidth) / textureAtlasWidth, + (textureY + uv.x * textureHeight) / textureAtlasHeight + ); + } + else { + uv.set( + (textureX + uv.x * textureWidth) / textureAtlasWidth, + 1.0 - (textureY + uv.y * textureHeight) / textureAtlasHeight + ); + } + } + + for (let i = 0; i < 2; ++i) { + const iT = i * 3; + const face3 = ThreeFactory.create(ThreeFactory.POOL_TYPE_FACE3) as THREE.Face3; + const faceUVs: Array = []; + + faces.push(face3); + faceVertexUVs.push(faceUVs); + + face3.a = rawIndices[iT]; + face3.b = rawIndices[iT + 1]; + face3.c = rawIndices[iT + 2]; + + faceUVs[0] = uvs[face3.a]; + faceUVs[1] = uvs[face3.b]; + faceUVs[2] = uvs[face3.c]; + } + } + + if (this._material !== null) { + this._material.copy(textureAtlasData.material); + } + + meshDisplay.material = textureAtlasData.material; + this._visibleDirty = true; + + return; + } + } + + meshDisplay.visible = false; + meshDisplay.position.set(0.0, 0.0, meshDisplay.position.z); + } + + protected _updateMesh(): void { + const scale = this._armature._armatureData.scale; + const deformVertices = (this._displayFrame as DisplayFrame).deformVertices; + const bones = this._geometryBones; + const geometryData = this._geometryData as GeometryData; + const weightData = geometryData.weight; + + const hasDeform = deformVertices.length > 0 && geometryData.inheritDeform; + const meshDisplay = this._renderDisplay as THREE.Mesh; + const geometry = meshDisplay.geometry as THREE.Geometry; + const vertices = geometry.vertices; + + if (weightData !== null) { + const data = geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount]; + let weightFloatOffset = intArray[weightData.offset + BinaryOffset.WeigthFloatOffset]; + + if (weightFloatOffset < 0) { + weightFloatOffset += 65536; // Fixed out of bounds bug. + } + + for ( + let i = 0, iB = weightData.offset + BinaryOffset.WeigthBoneIndices + bones.length, iV = weightFloatOffset, iF = 0; + i < vertexCount; + ++i + ) { + const boneCount = intArray[iB++]; + let xG = 0.0, yG = 0.0; + + for (let j = 0; j < boneCount; ++j) { + const boneIndex = intArray[iB++]; + const bone = bones[boneIndex]; + + if (bone !== null) { + const matrix = bone.globalTransformMatrix; + const weight = floatArray[iV++]; + let xL = floatArray[iV++] * scale; + let yL = floatArray[iV++] * scale; + + if (hasDeform) { + xL += deformVertices[iF++]; + yL += deformVertices[iF++]; + } + + xG += (matrix.a * xL + matrix.c * yL + matrix.tx) * weight; + yG += (matrix.b * xL + matrix.d * yL + matrix.ty) * weight; + } + } + + const vertex = vertices[i]; + vertex.set( + xG, + yG, + 0.0 + ); + } + } + else if (hasDeform) { + const isSurface = this._parent._boneData.type !== BoneType.Bone; + const data = geometryData.data; + const intArray = data.intArray; + const floatArray = data.floatArray; + const vertexCount = intArray[geometryData.offset + BinaryOffset.GeometryVertexCount]; + let vertexOffset = intArray[geometryData.offset + BinaryOffset.GeometryFloatOffset]; + + if (vertexOffset < 0) { + vertexOffset += 65536; // Fixed out of bounds bug. + } + + for (let i = 0, l = vertexCount * 2; i < l; i += 2) { + const x = floatArray[vertexOffset + i] * scale + deformVertices[i]; + const y = floatArray[vertexOffset + i + 1] * scale + deformVertices[i + 1]; + const vertex = vertices[i]; + + if (isSurface) { + const matrix = (this._parent as Surface)._getGlobalTransformMatrix(x, y); + vertex.set( + matrix.a * x + matrix.c * y + matrix.tx, + matrix.b * x + matrix.d * y + matrix.ty, + 0.0 + ); + } + else { + vertex.set( + x, + y, + 0.0 + ); + } + } + } + } + + protected _updateTransform(): void { + const globalTransformMatrix = this.globalTransformMatrix; + const displayMatrixElements = this._renderDisplay.matrix.elements; + displayMatrixElements[0] = globalTransformMatrix.a; + displayMatrixElements[1] = globalTransformMatrix.b; + displayMatrixElements[4] = globalTransformMatrix.c; + displayMatrixElements[5] = globalTransformMatrix.d; + displayMatrixElements[12] = globalTransformMatrix.tx; + displayMatrixElements[13] = globalTransformMatrix.ty; + this._renderDisplay.matrixWorldNeedsUpdate = true; + } + + protected _identityTransform(): void { + this._renderDisplay.matrix.identity(); + } + } +} \ No newline at end of file diff --git a/ThreeJS/Current/src/dragonBones/three/ThreeTextureAtlasData.ts b/ThreeJS/Current/src/dragonBones/three/ThreeTextureAtlasData.ts new file mode 100644 index 00000000..2650c236 --- /dev/null +++ b/ThreeJS/Current/src/dragonBones/three/ThreeTextureAtlasData.ts @@ -0,0 +1,94 @@ +/** + * The MIT License (MIT) + * + * Copyright (c) 2012-2018 DragonBones team and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +namespace dragonBones { + /** + * - The ThreeJS texture atlas data. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - ThreeJS 贴图集数据。 + * @version DragonBones 3.0 + * @language zh_CN + */ + export class ThreeTextureAtlasData extends TextureAtlasData { + public static toString(): string { + return "[class dragonBones.ThreeTextureAtlasData]"; + } + /** + * @private + */ + public material: THREE.MeshBasicMaterial = null as any; // Initial value. + private _renderTexture: THREE.Texture | null = null; // Initial value. + + protected _onClear(): void { + super._onClear(); + + if (this.material !== null) { + this.material.dispose(); + } + + if (this._renderTexture !== null) { + // this._renderTexture.dispose(); + } + + this.material = null as any; + + this._renderTexture = null; + } + /** + * @inheritDoc + */ + public createTexture(): TextureData { + return BaseObject.borrowObject(ThreeTextureData); + } + /** + * - The ThreeJS texture. + * @version DragonBones 3.0 + * @language en_US + */ + /** + * - ThreeJS 贴图。 + * @version DragonBones 3.0 + * @language zh_CN + */ + public get renderTexture(): THREE.Texture | null { + return this._renderTexture; + } + public set renderTexture(value: THREE.Texture | null) { + if (this._renderTexture === value) { + return; + } + + this._renderTexture = value; + } + } + /** + * @internal + */ + export class ThreeTextureData extends TextureData { + public static toString(): string { + return "[class dragonBones.ThreeTextureData]"; + } + } +} \ No newline at end of file diff --git a/ThreeJS/Current/tsconfig.json b/ThreeJS/Current/tsconfig.json new file mode 100644 index 00000000..0538118b --- /dev/null +++ b/ThreeJS/Current/tsconfig.json @@ -0,0 +1,79 @@ +{ + "compilerOptions": { + "watch": false, + "sourceMap": false, + "declaration": true, + "stripInternal": true, + "alwaysStrict": true, + "noImplicitAny": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strictNullChecks": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "es5", + "outFile": "out/dragonBones.js", + "lib": [ + "es6", + "dom" + ] + }, + "exclude": [ + "node_modules", + "out" + ], + "files": [ + "./node_modules/@types/three/index.d.ts", + + "../../DragonBones/src/dragonBones/core/DragonBones.ts", + "../../DragonBones/src/dragonBones/core/BaseObject.ts", + + "../../DragonBones/src/dragonBones/geom/Matrix.ts", + "../../DragonBones/src/dragonBones/geom/Transform.ts", + "../../DragonBones/src/dragonBones/geom/ColorTransform.ts", + "../../DragonBones/src/dragonBones/geom/Point.ts", + "../../DragonBones/src/dragonBones/geom/Rectangle.ts", + + "../../DragonBones/src/dragonBones/model/UserData.ts", + "../../DragonBones/src/dragonBones/model/DragonBonesData.ts", + "../../DragonBones/src/dragonBones/model/ArmatureData.ts", + "../../DragonBones/src/dragonBones/model/ConstraintData.ts", + "../../DragonBones/src/dragonBones/model/CanvasData.ts", + "../../DragonBones/src/dragonBones/model/SkinData.ts", + "../../DragonBones/src/dragonBones/model/DisplayData.ts", + "../../DragonBones/src/dragonBones/model/BoundingBoxData.ts", + "../../DragonBones/src/dragonBones/model/AnimationData.ts", + "../../DragonBones/src/dragonBones/model/AnimationConfig.ts", + "../../DragonBones/src/dragonBones/model/TextureAtlasData.ts", + + "../../DragonBones/src/dragonBones/armature/IArmatureProxy.ts", + "../../DragonBones/src/dragonBones/armature/Armature.ts", + "../../DragonBones/src/dragonBones/armature/TransformObject.ts", + "../../DragonBones/src/dragonBones/armature/Bone.ts", + "../../DragonBones/src/dragonBones/armature/Surface.ts", + "../../DragonBones/src/dragonBones/armature/Slot.ts", + "../../DragonBones/src/dragonBones/armature/Constraint.ts", + + "../../DragonBones/src/dragonBones/animation/IAnimatable.ts", + "../../DragonBones/src/dragonBones/animation/WorldClock.ts", + "../../DragonBones/src/dragonBones/animation/Animation.ts", + "../../DragonBones/src/dragonBones/animation/AnimationState.ts", + "../../DragonBones/src/dragonBones/animation/BaseTimelineState.ts", + "../../DragonBones/src/dragonBones/animation/TimelineState.ts", + + "../../DragonBones/src/dragonBones/event/EventObject.ts", + "../../DragonBones/src/dragonBones/event/IEventDispatcher.ts", + + "../../DragonBones/src/dragonBones/parser/DataParser.ts", + "../../DragonBones/src/dragonBones/parser/ObjectDataParser.ts", + "../../DragonBones/src/dragonBones/parser/BinaryDataParser.ts", + + "../../DragonBones/src/dragonBones/factory/BaseFactory.ts", + + "./src/dragonBones/three/ThreeTextureAtlasData.ts", + "./src/dragonBones/three/ThreeArmatureDisplay.ts", + "./src/dragonBones/three/ThreeSlot.ts", + "./src/dragonBones/three/ThreeFactory.ts" + ] +} \ No newline at end of file diff --git a/ThreeJS/Current/tslint.json b/ThreeJS/Current/tslint.json new file mode 100644 index 00000000..eeb58d17 --- /dev/null +++ b/ThreeJS/Current/tslint.json @@ -0,0 +1,15 @@ +{ + "rules": { + "no-unused-expression": true, + "no-unreachable": true, + "no-duplicate-variable": true, + "no-duplicate-key": true, + "no-unused-variable": true, + "curly": false, + "class-name": true, + "triple-equals": true, + "semicolon": [ + true + ] + } +} \ No newline at end of file diff --git a/ThreeJS/Demos/index.html b/ThreeJS/Demos/index.html new file mode 100644 index 00000000..dd947b81 --- /dev/null +++ b/ThreeJS/Demos/index.html @@ -0,0 +1,46 @@ + + + + + + DragonBones Demo + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ThreeJS/Demos/libs/dragonBones/.gitkeep b/ThreeJS/Demos/libs/dragonBones/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/ThreeJS/Demos/libs/three/.gitkeep b/ThreeJS/Demos/libs/three/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/ThreeJS/Demos/package.json b/ThreeJS/Demos/package.json new file mode 100644 index 00000000..597f25f1 --- /dev/null +++ b/ThreeJS/Demos/package.json @@ -0,0 +1,18 @@ +{ + "name": "dragonbones-threejs-demos", + "version": "5.6.3", + "main": "", + "scripts": { + "start": "tsc & copyfiles -u 3 -s ../Current/out/* libs/dragonBones/ & anywhere", + "upgradeA": "cd .. & cd Current & npm run build & cd .. & cd Demos", + "upgradeB": "copyfiles -u 3 ../Current/out/* libs/dragonBones/", + "upgrade": "npm run upgradeA & npm run upgradeB", + "build": "tsc" + }, + "devDependencies": { + "@types/three": "^0.89.12", + "anywhere": "^1.4.0", + "copyfiles": "^1.2.0", + "typescript": "^2.4.2" + } +} diff --git a/ThreeJS/Demos/src/BaseDemo.ts b/ThreeJS/Demos/src/BaseDemo.ts new file mode 100644 index 00000000..7056eb5a --- /dev/null +++ b/ThreeJS/Demos/src/BaseDemo.ts @@ -0,0 +1,98 @@ +abstract class BaseDemo extends THREE.Group { + private static readonly BACKGROUND_URL: string = "resource/background.png"; + private readonly _scene: THREE.Scene = new THREE.Scene(); + private readonly _camera: THREE.OrthographicCamera = new THREE.OrthographicCamera(-0.5, 0.5, -0.5, 0.5, -1000, 1000); + private readonly _renderer: THREE.WebGLRenderer = new THREE.WebGLRenderer({ antialias: true }); + + private readonly _background: THREE.Sprite = new THREE.Sprite(); + protected readonly _resources: string[] = [BaseDemo.BACKGROUND_URL]; + protected readonly _loadedResources: dragonBones.Map = {}; + + public constructor() { + super(); + + this._scene.add(this); + this._renderer.setClearColor(0x666666); + this._renderer.setSize(1136, 640); + const wH = this.stageWidth * 0.5; + const hH = this.stageHeight * 0.5; + this._camera.left = - wH; + this._camera.right = wH; + this._camera.top = - hH; + this._camera.bottom = hH; + this._camera.updateProjectionMatrix(); + document.body.appendChild(this._renderer.domElement); + // + setTimeout(() => { + this._loadResources(); + }, 10); + } + + protected abstract _onStart(): void; + + protected _startTick(): void { + const update = () => { + dragonBones.ThreeFactory.factory.dragonBones.advanceTime(-1.0); + this._renderer.render(this._scene, this._camera); + requestAnimationFrame(update); + }; + + update(); + } + + protected _loadResources(): void { + for (const resource of this._resources) { + if (resource.indexOf("dbbin") > 0) { + const loader = new THREE.FileLoader(); + loader.setResponseType("arraybuffer"); + loader.load(resource, (result: any) => { + this._loadedResources[resource] = result; + }); + } + else if (resource.indexOf(".png") > 0) { + const loader = new THREE.TextureLoader(); + this._loadedResources[resource] = loader.load(resource); + } + else { + const loader = new THREE.FileLoader(); + loader.setResponseType("json"); + loader.load(resource, (result: any) => { + this._loadedResources[resource] = result; + }); + } + } + + THREE.DefaultLoadingManager.onLoad = () => { + const backgroundTexture = this._loadedResources[BaseDemo.BACKGROUND_URL] as THREE.Texture; + backgroundTexture.wrapS = THREE.RepeatWrapping; + backgroundTexture.wrapT = THREE.RepeatWrapping; + this._background.material = new THREE.SpriteMaterial({ map: backgroundTexture }); + this._background.scale.set(backgroundTexture.image.width, backgroundTexture.image.height, 1.0); + this._background.position.z = -10; + this.add(this._background); + // + this._startTick(); + this._onStart(); + }; + } + + // public createText(string: string): PIXI.Text { + // const text = new PIXI.Text(string, { align: "center" }); + // text.text = string; + // text.scale.x = 0.7; + // text.scale.y = 0.7; + // text.x = - text.width * 0.5; + // text.y = this.stageHeight * 0.5 - 100.0; + // this.addChild(text); + + // return text; + // } + + public get stageWidth(): number { + return this._renderer.getSize().width; + } + + public get stageHeight(): number { + return this._renderer.getSize().height; + } +} \ No newline at end of file diff --git a/ThreeJS/Demos/src/HelloDragonBones.ts b/ThreeJS/Demos/src/HelloDragonBones.ts new file mode 100644 index 00000000..57e73c78 --- /dev/null +++ b/ThreeJS/Demos/src/HelloDragonBones.ts @@ -0,0 +1,43 @@ +/** + * How to use + * 1. Load data. + * + * 2. Parse data. + * factory.parseDragonBonesData(); + * factory.parseTextureAtlasData(); + * + * 3. Build armature. + * armatureDisplay = factory.buildArmatureDisplay("armatureName"); + * + * 4. Play animation. + * armatureDisplay.animation.play("animationName"); + * + * 5. Add armature to stage. + * addChild(armatureDisplay); + */ +class HelloDragonBones extends BaseDemo { + public constructor() { + super(); + + this._resources.push( + // "resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.json", + "resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin", + "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json", + "resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png" + ); + } + + protected _onStart(): void { + const factory = dragonBones.ThreeFactory.factory; + // factory.parseDragonBonesData(this._pixiResource["resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.json"].data); + factory.parseDragonBonesData(this._loadedResources["resource/mecha_1002_101d_show/mecha_1002_101d_show_ske.dbbin"]); + factory.parseTextureAtlasData(this._loadedResources["resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.json"], this._loadedResources["resource/mecha_1002_101d_show/mecha_1002_101d_show_tex.png"]); + + const armatureDisplay = factory.buildArmatureDisplay("mecha_1002_101d", "mecha_1002_101d_show"); + armatureDisplay.animation.play("idle"); + + armatureDisplay.position.setX(0.0); + armatureDisplay.position.setY(200.0); + this.add(armatureDisplay); + } +} \ No newline at end of file diff --git a/ThreeJS/Demos/tsconfig.json b/ThreeJS/Demos/tsconfig.json new file mode 100644 index 00000000..b1cd1731 --- /dev/null +++ b/ThreeJS/Demos/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "watch": false, + "sourceMap": false, + "declaration": false, + "alwaysStrict": true, + "noImplicitAny": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": false, + "strictNullChecks": false, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "es5", + "module": "commonjs", + "outDir": "./out", + "lib": [ + "es6", + "dom" + ] + }, + "exclude": [ + "node_modules", + "out" + ] +} \ No newline at end of file diff --git a/ThreeJS/Demos/tslint.json b/ThreeJS/Demos/tslint.json new file mode 100644 index 00000000..eeb58d17 --- /dev/null +++ b/ThreeJS/Demos/tslint.json @@ -0,0 +1,15 @@ +{ + "rules": { + "no-unused-expression": true, + "no-unreachable": true, + "no-duplicate-variable": true, + "no-duplicate-key": true, + "no-unused-variable": true, + "curly": false, + "class-name": true, + "triple-equals": true, + "semicolon": [ + true + ] + } +} \ No newline at end of file diff --git a/ThreeJS/README.md b/ThreeJS/README.md new file mode 100644 index 00000000..c6c7133b --- /dev/null +++ b/ThreeJS/README.md @@ -0,0 +1,6 @@ +# DragonBones ThreeJS library + +## [Demos](./Demos/) +* [Hello DragonBones](./Demos/src/HelloDragonBones.ts) + +## [ThreeJS website](https://threejs.org/) \ No newline at end of file diff --git a/builds/build_pixi.js b/builds/build_pixi.js index a6a53266..db094a9d 100644 --- a/builds/build_pixi.js +++ b/builds/build_pixi.js @@ -53,7 +53,7 @@ class BuildPixi extends BuildBase { copyDeclear (callback) { copy( [ - path.join(this.cacheFolder, `pixi-typescript-4.6.2/pixi.js.d.ts`) + path.join(this.cacheFolder, `pixi-typescript-${ this.version }/pixi.js.d.ts`) ], path.join(this.cacheSourceFolder, 'libs'), { flatten: true }, diff --git a/package.json b/package.json index ae7d837d..bd53e956 100644 --- a/package.json +++ b/package.json @@ -35,4 +35,4 @@ "semver": "^5.4.1", "debug": "^3.1.0" } -} \ No newline at end of file +}